@imtbl/sdk 0.20.1-alpha.1 → 0.21.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/blockchain_data.js +1 -1
- package/dist/browser/checkout.js +1 -1
- package/dist/checkout_sdk.js +1 -1
- package/dist/checkout_widgets.js +1 -1
- package/dist/immutablex_client.js +1 -1
- package/dist/index.browser.js +3 -3
- package/dist/index.browser.js.map +1 -1
- package/dist/index.cjs +4 -4
- package/dist/index.js +4 -4
- package/dist/passport.js +2 -2
- package/package.json +1 -1
package/dist/index.browser.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).immutable={})}(this,(function(e){"use strict";var t;!function(e){e.PRODUCTION="production",e.SANDBOX="sandbox"}(t||(t={}));class n{environment;apiKey;constructor(e){this.environment=e.environment,this.apiKey=e.apiKey}}var r=Object.freeze({__proto__:null,get Environment(){return t},ImmutableConfiguration:n});function i(e,t){return function(){return e.apply(t,arguments)}}const{toString:a}=Object.prototype,{getPrototypeOf:o}=Object,s=(c=Object.create(null),e=>{const t=a.call(e);return c[t]||(c[t]=t.slice(8,-1).toLowerCase())});var c;const u=e=>(e=e.toLowerCase(),t=>s(t)===e),f=e=>t=>typeof t===e,{isArray:d}=Array,l=f("undefined");const p=u("ArrayBuffer");const h=f("string"),b=f("function"),m=f("number"),y=e=>null!==e&&"object"==typeof e,g=e=>{if("object"!==s(e))return!1;const t=o(e);return!(null!==t&&t!==Object.prototype&&null!==Object.getPrototypeOf(t)||Symbol.toStringTag in e||Symbol.iterator in e)},v=u("Date"),w=u("File"),_=u("Blob"),E=u("FileList"),T=u("URLSearchParams");function A(e,t,{allOwnKeys:n=!1}={}){if(null==e)return;let r,i;if("object"!=typeof e&&(e=[e]),d(e))for(r=0,i=e.length;r<i;r++)t.call(null,e[r],r,e);else{const i=n?Object.getOwnPropertyNames(e):Object.keys(e),a=i.length;let o;for(r=0;r<a;r++)o=i[r],t.call(null,e[o],o,e)}}function R(e,t){t=t.toLowerCase();const n=Object.keys(e);let r,i=n.length;for(;i-- >0;)if(r=n[i],t===r.toLowerCase())return r;return null}const S="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:global,k=e=>!l(e)&&e!==S;const I=(O="undefined"!=typeof Uint8Array&&o(Uint8Array),e=>O&&e instanceof O);var O;const x=u("HTMLFormElement"),C=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),M=u("RegExp"),P=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};A(n,((n,i)=>{!1!==t(n,i,e)&&(r[i]=n)})),Object.defineProperties(e,r)},N="abcdefghijklmnopqrstuvwxyz",B="0123456789",D={DIGIT:B,ALPHA:N,ALPHA_DIGIT:N+N.toUpperCase()+B};const F=u("AsyncFunction");var L={isArray:d,isArrayBuffer:p,isBuffer:function(e){return null!==e&&!l(e)&&null!==e.constructor&&!l(e.constructor)&&b(e.constructor.isBuffer)&&e.constructor.isBuffer(e)},isFormData:e=>{let t;return e&&("function"==typeof FormData&&e instanceof FormData||b(e.append)&&("formdata"===(t=s(e))||"object"===t&&b(e.toString)&&"[object FormData]"===e.toString()))},isArrayBufferView:function(e){let t;return t="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&p(e.buffer),t},isString:h,isNumber:m,isBoolean:e=>!0===e||!1===e,isObject:y,isPlainObject:g,isUndefined:l,isDate:v,isFile:w,isBlob:_,isRegExp:M,isFunction:b,isStream:e=>y(e)&&b(e.pipe),isURLSearchParams:T,isTypedArray:I,isFileList:E,forEach:A,merge:function e(){const{caseless:t}=k(this)&&this||{},n={},r=(r,i)=>{const a=t&&R(n,i)||i;g(n[a])&&g(r)?n[a]=e(n[a],r):g(r)?n[a]=e({},r):d(r)?n[a]=r.slice():n[a]=r};for(let e=0,t=arguments.length;e<t;e++)arguments[e]&&A(arguments[e],r);return n},extend:(e,t,n,{allOwnKeys:r}={})=>(A(t,((t,r)=>{n&&b(t)?e[r]=i(t,n):e[r]=t}),{allOwnKeys:r}),e),trim:e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),stripBOM:e=>(65279===e.charCodeAt(0)&&(e=e.slice(1)),e),inherits:(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},toFlatObject:(e,t,n,r)=>{let i,a,s;const c={};if(t=t||{},null==e)return t;do{for(i=Object.getOwnPropertyNames(e),a=i.length;a-- >0;)s=i[a],r&&!r(s,e,t)||c[s]||(t[s]=e[s],c[s]=!0);e=!1!==n&&o(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},kindOf:s,kindOfTest:u,endsWith:(e,t,n)=>{e=String(e),(void 0===n||n>e.length)&&(n=e.length),n-=t.length;const r=e.indexOf(t,n);return-1!==r&&r===n},toArray:e=>{if(!e)return null;if(d(e))return e;let t=e.length;if(!m(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},forEachEntry:(e,t)=>{const n=(e&&e[Symbol.iterator]).call(e);let r;for(;(r=n.next())&&!r.done;){const n=r.value;t.call(e,n[0],n[1])}},matchAll:(e,t)=>{let n;const r=[];for(;null!==(n=e.exec(t));)r.push(n);return r},isHTMLForm:x,hasOwnProperty:C,hasOwnProp:C,reduceDescriptors:P,freezeMethods:e=>{P(e,((t,n)=>{if(b(e)&&-1!==["arguments","caller","callee"].indexOf(n))return!1;const r=e[n];b(r)&&(t.enumerable=!1,"writable"in t?t.writable=!1:t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")}))}))},toObjectSet:(e,t)=>{const n={},r=e=>{e.forEach((e=>{n[e]=!0}))};return d(e)?r(e):r(String(e).split(t)),n},toCamelCase:e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,(function(e,t,n){return t.toUpperCase()+n})),noop:()=>{},toFiniteNumber:(e,t)=>(e=+e,Number.isFinite(e)?e:t),findKey:R,global:S,isContextDefined:k,ALPHABET:D,generateString:(e=16,t=D.ALPHA_DIGIT)=>{let n="";const{length:r}=t;for(;e--;)n+=t[Math.random()*r|0];return n},isSpecCompliantForm:function(e){return!!(e&&b(e.append)&&"FormData"===e[Symbol.toStringTag]&&e[Symbol.iterator])},toJSONObject:e=>{const t=new Array(10),n=(e,r)=>{if(y(e)){if(t.indexOf(e)>=0)return;if(!("toJSON"in e)){t[r]=e;const i=d(e)?[]:{};return A(e,((e,t)=>{const a=n(e,r+1);!l(a)&&(i[t]=a)})),t[r]=void 0,i}}return e};return n(e,0)},isAsyncFn:F,isThenable:e=>e&&(y(e)||b(e))&&b(e.then)&&b(e.catch)};function U(e,t,n,r,i){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack,this.message=e,this.name="AxiosError",t&&(this.code=t),n&&(this.config=n),r&&(this.request=r),i&&(this.response=i)}L.inherits(U,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:L.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});const j=U.prototype,q={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach((e=>{q[e]={value:e}})),Object.defineProperties(U,q),Object.defineProperty(j,"isAxiosError",{value:!0}),U.from=(e,t,n,r,i,a)=>{const o=Object.create(j);return L.toFlatObject(e,o,(function(e){return e!==Error.prototype}),(e=>"isAxiosError"!==e)),U.call(o,e.message,t,n,r,i),o.cause=e,o.name=e.name,a&&Object.assign(o,a),o};function z(e){return L.isPlainObject(e)||L.isArray(e)}function H(e){return L.endsWith(e,"[]")?e.slice(0,-2):e}function G(e,t,n){return e?e.concat(t).map((function(e,t){return e=H(e),!n&&t?"["+e+"]":e})).join(n?".":""):t}const V=L.toFlatObject(L,{},null,(function(e){return/^is[A-Z]/.test(e)}));function K(e,t,n){if(!L.isObject(e))throw new TypeError("target must be an object");t=t||new FormData;const r=(n=L.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,(function(e,t){return!L.isUndefined(t[e])}))).metaTokens,i=n.visitor||u,a=n.dots,o=n.indexes,s=(n.Blob||"undefined"!=typeof Blob&&Blob)&&L.isSpecCompliantForm(t);if(!L.isFunction(i))throw new TypeError("visitor must be a function");function c(e){if(null===e)return"";if(L.isDate(e))return e.toISOString();if(!s&&L.isBlob(e))throw new U("Blob is not supported. Use a Buffer instead.");return L.isArrayBuffer(e)||L.isTypedArray(e)?s&&"function"==typeof Blob?new Blob([e]):Buffer.from(e):e}function u(e,n,i){let s=e;if(e&&!i&&"object"==typeof e)if(L.endsWith(n,"{}"))n=r?n:n.slice(0,-2),e=JSON.stringify(e);else if(L.isArray(e)&&function(e){return L.isArray(e)&&!e.some(z)}(e)||(L.isFileList(e)||L.endsWith(n,"[]"))&&(s=L.toArray(e)))return n=H(n),s.forEach((function(e,r){!L.isUndefined(e)&&null!==e&&t.append(!0===o?G([n],r,a):null===o?n:n+"[]",c(e))})),!1;return!!z(e)||(t.append(G(i,n,a),c(e)),!1)}const f=[],d=Object.assign(V,{defaultVisitor:u,convertValue:c,isVisitable:z});if(!L.isObject(e))throw new TypeError("data must be an object");return function e(n,r){if(!L.isUndefined(n)){if(-1!==f.indexOf(n))throw Error("Circular reference detected in "+r.join("."));f.push(n),L.forEach(n,(function(n,a){!0===(!(L.isUndefined(n)||null===n)&&i.call(t,n,L.isString(a)?a.trim():a,r,d))&&e(n,r?r.concat(a):[a])})),f.pop()}}(e),t}function W(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,(function(e){return t[e]}))}function X(e,t){this._pairs=[],e&&K(e,this,t)}const $=X.prototype;function J(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function Y(e,t,n){if(!t)return e;const r=n&&n.encode||J,i=n&&n.serialize;let a;if(a=i?i(t,n):L.isURLSearchParams(t)?t.toString():new X(t,n).toString(r),a){const t=e.indexOf("#");-1!==t&&(e=e.slice(0,t)),e+=(-1===e.indexOf("?")?"?":"&")+a}return e}$.append=function(e,t){this._pairs.push([e,t])},$.toString=function(e){const t=e?function(t){return e.call(this,t,W)}:W;return this._pairs.map((function(e){return t(e[0])+"="+t(e[1])}),"").join("&")};var Q=class{constructor(){this.handlers=[]}use(e,t,n){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!n&&n.synchronous,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){L.forEach(this.handlers,(function(t){null!==t&&e(t)}))}},Z={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1};var ee={isBrowser:!0,classes:{URLSearchParams:"undefined"!=typeof URLSearchParams?URLSearchParams:X,FormData:"undefined"!=typeof FormData?FormData:null,Blob:"undefined"!=typeof Blob?Blob:null},isStandardBrowserEnv:(()=>{let e;return("undefined"==typeof navigator||"ReactNative"!==(e=navigator.product)&&"NativeScript"!==e&&"NS"!==e)&&("undefined"!=typeof window&&"undefined"!=typeof document)})(),isStandardBrowserWebWorkerEnv:"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,protocols:["http","https","file","blob","url","data"]};function te(e){function t(e,n,r,i){let a=e[i++];const o=Number.isFinite(+a),s=i>=e.length;if(a=!a&&L.isArray(r)?r.length:a,s)return L.hasOwnProp(r,a)?r[a]=[r[a],n]:r[a]=n,!o;r[a]&&L.isObject(r[a])||(r[a]=[]);return t(e,n,r[a],i)&&L.isArray(r[a])&&(r[a]=function(e){const t={},n=Object.keys(e);let r;const i=n.length;let a;for(r=0;r<i;r++)a=n[r],t[a]=e[a];return t}(r[a])),!o}if(L.isFormData(e)&&L.isFunction(e.entries)){const n={};return L.forEachEntry(e,((e,r)=>{t(function(e){return L.matchAll(/\w+|\[(\w*)]/g,e).map((e=>"[]"===e[0]?"":e[1]||e[0]))}(e),r,n,0)})),n}return null}const ne={"Content-Type":void 0};const re={transitional:Z,adapter:["xhr","http"],transformRequest:[function(e,t){const n=t.getContentType()||"",r=n.indexOf("application/json")>-1,i=L.isObject(e);i&&L.isHTMLForm(e)&&(e=new FormData(e));if(L.isFormData(e))return r&&r?JSON.stringify(te(e)):e;if(L.isArrayBuffer(e)||L.isBuffer(e)||L.isStream(e)||L.isFile(e)||L.isBlob(e))return e;if(L.isArrayBufferView(e))return e.buffer;if(L.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let a;if(i){if(n.indexOf("application/x-www-form-urlencoded")>-1)return function(e,t){return K(e,new ee.classes.URLSearchParams,Object.assign({visitor:function(e,t,n,r){return ee.isNode&&L.isBuffer(e)?(this.append(t,e.toString("base64")),!1):r.defaultVisitor.apply(this,arguments)}},t))}(e,this.formSerializer).toString();if((a=L.isFileList(e))||n.indexOf("multipart/form-data")>-1){const t=this.env&&this.env.FormData;return K(a?{"files[]":e}:e,t&&new t,this.formSerializer)}}return i||r?(t.setContentType("application/json",!1),function(e,t,n){if(L.isString(e))try{return(t||JSON.parse)(e),L.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(n||JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){const t=this.transitional||re.transitional,n=t&&t.forcedJSONParsing,r="json"===this.responseType;if(e&&L.isString(e)&&(n&&!this.responseType||r)){const n=!(t&&t.silentJSONParsing)&&r;try{return JSON.parse(e)}catch(e){if(n){if("SyntaxError"===e.name)throw U.from(e,U.ERR_BAD_RESPONSE,this,null,this.response);throw e}}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:ee.classes.FormData,Blob:ee.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};L.forEach(["delete","get","head"],(function(e){re.headers[e]={}})),L.forEach(["post","put","patch"],(function(e){re.headers[e]=L.merge(ne)}));var ie=re;const ae=L.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]);const oe=Symbol("internals");function se(e){return e&&String(e).trim().toLowerCase()}function ce(e){return!1===e||null==e?e:L.isArray(e)?e.map(ce):String(e)}function ue(e,t,n,r,i){return L.isFunction(r)?r.call(this,t,n):(i&&(t=n),L.isString(t)?L.isString(r)?-1!==t.indexOf(r):L.isRegExp(r)?r.test(t):void 0:void 0)}let fe=class{constructor(e){e&&this.set(e)}set(e,t,n){const r=this;function i(e,t,n){const i=se(t);if(!i)throw new Error("header name must be a non-empty string");const a=L.findKey(r,i);(!a||void 0===r[a]||!0===n||void 0===n&&!1!==r[a])&&(r[a||t]=ce(e))}const a=(e,t)=>L.forEach(e,((e,n)=>i(e,n,t)));return L.isPlainObject(e)||e instanceof this.constructor?a(e,t):L.isString(e)&&(e=e.trim())&&!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim())?a((e=>{const t={};let n,r,i;return e&&e.split("\n").forEach((function(e){i=e.indexOf(":"),n=e.substring(0,i).trim().toLowerCase(),r=e.substring(i+1).trim(),!n||t[n]&&ae[n]||("set-cookie"===n?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)})),t})(e),t):null!=e&&i(t,e,n),this}get(e,t){if(e=se(e)){const n=L.findKey(this,e);if(n){const e=this[n];if(!t)return e;if(!0===t)return function(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(e);)t[r[1]]=r[2];return t}(e);if(L.isFunction(t))return t.call(this,e,n);if(L.isRegExp(t))return t.exec(e);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=se(e)){const n=L.findKey(this,e);return!(!n||void 0===this[n]||t&&!ue(0,this[n],n,t))}return!1}delete(e,t){const n=this;let r=!1;function i(e){if(e=se(e)){const i=L.findKey(n,e);!i||t&&!ue(0,n[i],i,t)||(delete n[i],r=!0)}}return L.isArray(e)?e.forEach(i):i(e),r}clear(e){const t=Object.keys(this);let n=t.length,r=!1;for(;n--;){const i=t[n];e&&!ue(0,this[i],i,e,!0)||(delete this[i],r=!0)}return r}normalize(e){const t=this,n={};return L.forEach(this,((r,i)=>{const a=L.findKey(n,i);if(a)return t[a]=ce(r),void delete t[i];const o=e?function(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,((e,t,n)=>t.toUpperCase()+n))}(i):String(i).trim();o!==i&&delete t[i],t[o]=ce(r),n[o]=!0})),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const t=Object.create(null);return L.forEach(this,((n,r)=>{null!=n&&!1!==n&&(t[r]=e&&L.isArray(n)?n.join(", "):n)})),t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map((([e,t])=>e+": "+t)).join("\n")}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...t){const n=new this(e);return t.forEach((e=>n.set(e))),n}static accessor(e){const t=(this[oe]=this[oe]={accessors:{}}).accessors,n=this.prototype;function r(e){const r=se(e);t[r]||(!function(e,t){const n=L.toCamelCase(" "+t);["get","set","has"].forEach((r=>{Object.defineProperty(e,r+n,{value:function(e,n,i){return this[r].call(this,t,e,n,i)},configurable:!0})}))}(n,e),t[r]=!0)}return L.isArray(e)?e.forEach(r):r(e),this}};fe.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),L.freezeMethods(fe.prototype),L.freezeMethods(fe);var de=fe;function le(e,t){const n=this||ie,r=t||n,i=de.from(r.headers);let a=r.data;return L.forEach(e,(function(e){a=e.call(n,a,i.normalize(),t?t.status:void 0)})),i.normalize(),a}function pe(e){return!(!e||!e.__CANCEL__)}function he(e,t,n){U.call(this,null==e?"canceled":e,U.ERR_CANCELED,t,n),this.name="CanceledError"}L.inherits(he,U,{__CANCEL__:!0});var be=ee.isStandardBrowserEnv?{write:function(e,t,n,r,i,a){const o=[];o.push(e+"="+encodeURIComponent(t)),L.isNumber(n)&&o.push("expires="+new Date(n).toGMTString()),L.isString(r)&&o.push("path="+r),L.isString(i)&&o.push("domain="+i),!0===a&&o.push("secure"),document.cookie=o.join("; ")},read:function(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove:function(e){this.write(e,"",Date.now()-864e5)}}:{write:function(){},read:function(){return null},remove:function(){}};function me(e,t){return e&&!/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)?function(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e}(e,t):t}var ye=ee.isStandardBrowserEnv?function(){const e=/(msie|trident)/i.test(navigator.userAgent),t=document.createElement("a");let n;function r(n){let r=n;return e&&(t.setAttribute("href",r),r=t.href),t.setAttribute("href",r),{href:t.href,protocol:t.protocol?t.protocol.replace(/:$/,""):"",host:t.host,search:t.search?t.search.replace(/^\?/,""):"",hash:t.hash?t.hash.replace(/^#/,""):"",hostname:t.hostname,port:t.port,pathname:"/"===t.pathname.charAt(0)?t.pathname:"/"+t.pathname}}return n=r(window.location.href),function(e){const t=L.isString(e)?r(e):e;return t.protocol===n.protocol&&t.host===n.host}}():function(){return!0};function ge(e,t){let n=0;const r=function(e,t){e=e||10;const n=new Array(e),r=new Array(e);let i,a=0,o=0;return t=void 0!==t?t:1e3,function(s){const c=Date.now(),u=r[o];i||(i=c),n[a]=s,r[a]=c;let f=o,d=0;for(;f!==a;)d+=n[f++],f%=e;if(a=(a+1)%e,a===o&&(o=(o+1)%e),c-i<t)return;const l=u&&c-u;return l?Math.round(1e3*d/l):void 0}}(50,250);return i=>{const a=i.loaded,o=i.lengthComputable?i.total:void 0,s=a-n,c=r(s);n=a;const u={loaded:a,total:o,progress:o?a/o:void 0,bytes:s,rate:c||void 0,estimated:c&&o&&a<=o?(o-a)/c:void 0,event:i};u[t?"download":"upload"]=!0,e(u)}}var ve="undefined"!=typeof XMLHttpRequest&&function(e){return new Promise((function(t,n){let r=e.data;const i=de.from(e.headers).normalize(),a=e.responseType;let o;function s(){e.cancelToken&&e.cancelToken.unsubscribe(o),e.signal&&e.signal.removeEventListener("abort",o)}L.isFormData(r)&&(ee.isStandardBrowserEnv||ee.isStandardBrowserWebWorkerEnv?i.setContentType(!1):i.setContentType("multipart/form-data;",!1));let c=new XMLHttpRequest;if(e.auth){const t=e.auth.username||"",n=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";i.set("Authorization","Basic "+btoa(t+":"+n))}const u=me(e.baseURL,e.url);function f(){if(!c)return;const r=de.from("getAllResponseHeaders"in c&&c.getAllResponseHeaders());!function(e,t,n){const r=n.config.validateStatus;n.status&&r&&!r(n.status)?t(new U("Request failed with status code "+n.status,[U.ERR_BAD_REQUEST,U.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n)):e(n)}((function(e){t(e),s()}),(function(e){n(e),s()}),{data:a&&"text"!==a&&"json"!==a?c.response:c.responseText,status:c.status,statusText:c.statusText,headers:r,config:e,request:c}),c=null}if(c.open(e.method.toUpperCase(),Y(u,e.params,e.paramsSerializer),!0),c.timeout=e.timeout,"onloadend"in c?c.onloadend=f:c.onreadystatechange=function(){c&&4===c.readyState&&(0!==c.status||c.responseURL&&0===c.responseURL.indexOf("file:"))&&setTimeout(f)},c.onabort=function(){c&&(n(new U("Request aborted",U.ECONNABORTED,e,c)),c=null)},c.onerror=function(){n(new U("Network Error",U.ERR_NETWORK,e,c)),c=null},c.ontimeout=function(){let t=e.timeout?"timeout of "+e.timeout+"ms exceeded":"timeout exceeded";const r=e.transitional||Z;e.timeoutErrorMessage&&(t=e.timeoutErrorMessage),n(new U(t,r.clarifyTimeoutError?U.ETIMEDOUT:U.ECONNABORTED,e,c)),c=null},ee.isStandardBrowserEnv){const t=(e.withCredentials||ye(u))&&e.xsrfCookieName&&be.read(e.xsrfCookieName);t&&i.set(e.xsrfHeaderName,t)}void 0===r&&i.setContentType(null),"setRequestHeader"in c&&L.forEach(i.toJSON(),(function(e,t){c.setRequestHeader(t,e)})),L.isUndefined(e.withCredentials)||(c.withCredentials=!!e.withCredentials),a&&"json"!==a&&(c.responseType=e.responseType),"function"==typeof e.onDownloadProgress&&c.addEventListener("progress",ge(e.onDownloadProgress,!0)),"function"==typeof e.onUploadProgress&&c.upload&&c.upload.addEventListener("progress",ge(e.onUploadProgress)),(e.cancelToken||e.signal)&&(o=t=>{c&&(n(!t||t.type?new he(null,e,c):t),c.abort(),c=null)},e.cancelToken&&e.cancelToken.subscribe(o),e.signal&&(e.signal.aborted?o():e.signal.addEventListener("abort",o)));const d=function(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}(u);d&&-1===ee.protocols.indexOf(d)?n(new U("Unsupported protocol "+d+":",U.ERR_BAD_REQUEST,e)):c.send(r||null)}))};const we={http:null,xhr:ve};L.forEach(we,((e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch(e){}Object.defineProperty(e,"adapterName",{value:t})}}));var _e=e=>{e=L.isArray(e)?e:[e];const{length:t}=e;let n,r;for(let i=0;i<t&&(n=e[i],!(r=L.isString(n)?we[n.toLowerCase()]:n));i++);if(!r){if(!1===r)throw new U(`Adapter ${n} is not supported by the environment`,"ERR_NOT_SUPPORT");throw new Error(L.hasOwnProp(we,n)?`Adapter '${n}' is not available in the build`:`Unknown adapter '${n}'`)}if(!L.isFunction(r))throw new TypeError("adapter is not a function");return r};function Ee(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new he(null,e)}function Te(e){Ee(e),e.headers=de.from(e.headers),e.data=le.call(e,e.transformRequest),-1!==["post","put","patch"].indexOf(e.method)&&e.headers.setContentType("application/x-www-form-urlencoded",!1);return _e(e.adapter||ie.adapter)(e).then((function(t){return Ee(e),t.data=le.call(e,e.transformResponse,t),t.headers=de.from(t.headers),t}),(function(t){return pe(t)||(Ee(e),t&&t.response&&(t.response.data=le.call(e,e.transformResponse,t.response),t.response.headers=de.from(t.response.headers))),Promise.reject(t)}))}const Ae=e=>e instanceof de?e.toJSON():e;function Re(e,t){t=t||{};const n={};function r(e,t,n){return L.isPlainObject(e)&&L.isPlainObject(t)?L.merge.call({caseless:n},e,t):L.isPlainObject(t)?L.merge({},t):L.isArray(t)?t.slice():t}function i(e,t,n){return L.isUndefined(t)?L.isUndefined(e)?void 0:r(void 0,e,n):r(e,t,n)}function a(e,t){if(!L.isUndefined(t))return r(void 0,t)}function o(e,t){return L.isUndefined(t)?L.isUndefined(e)?void 0:r(void 0,e):r(void 0,t)}function s(n,i,a){return a in t?r(n,i):a in e?r(void 0,n):void 0}const c={url:a,method:a,data:a,baseURL:o,transformRequest:o,transformResponse:o,paramsSerializer:o,timeout:o,timeoutMessage:o,withCredentials:o,adapter:o,responseType:o,xsrfCookieName:o,xsrfHeaderName:o,onUploadProgress:o,onDownloadProgress:o,decompress:o,maxContentLength:o,maxBodyLength:o,beforeRedirect:o,transport:o,httpAgent:o,httpsAgent:o,cancelToken:o,socketPath:o,responseEncoding:o,validateStatus:s,headers:(e,t)=>i(Ae(e),Ae(t),!0)};return L.forEach(Object.keys(Object.assign({},e,t)),(function(r){const a=c[r]||i,o=a(e[r],t[r],r);L.isUndefined(o)&&a!==s||(n[r]=o)})),n}const Se="1.4.0",ke={};["object","boolean","number","function","string","symbol"].forEach(((e,t)=>{ke[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}}));const Ie={};ke.transitional=function(e,t,n){function r(e,t){return"[Axios v1.4.0] Transitional option '"+e+"'"+t+(n?". "+n:"")}return(n,i,a)=>{if(!1===e)throw new U(r(i," has been removed"+(t?" in "+t:"")),U.ERR_DEPRECATED);return t&&!Ie[i]&&(Ie[i]=!0,console.warn(r(i," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(n,i,a)}};var Oe={assertOptions:function(e,t,n){if("object"!=typeof e)throw new U("options must be an object",U.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let i=r.length;for(;i-- >0;){const a=r[i],o=t[a];if(o){const t=e[a],n=void 0===t||o(t,a,e);if(!0!==n)throw new U("option "+a+" must be "+n,U.ERR_BAD_OPTION_VALUE)}else if(!0!==n)throw new U("Unknown option "+a,U.ERR_BAD_OPTION)}},validators:ke};const xe=Oe.validators;let Ce=class{constructor(e){this.defaults=e,this.interceptors={request:new Q,response:new Q}}request(e,t){"string"==typeof e?(t=t||{}).url=e:t=e||{},t=Re(this.defaults,t);const{transitional:n,paramsSerializer:r,headers:i}=t;let a;void 0!==n&&Oe.assertOptions(n,{silentJSONParsing:xe.transitional(xe.boolean),forcedJSONParsing:xe.transitional(xe.boolean),clarifyTimeoutError:xe.transitional(xe.boolean)},!1),null!=r&&(L.isFunction(r)?t.paramsSerializer={serialize:r}:Oe.assertOptions(r,{encode:xe.function,serialize:xe.function},!0)),t.method=(t.method||this.defaults.method||"get").toLowerCase(),a=i&&L.merge(i.common,i[t.method]),a&&L.forEach(["delete","get","head","post","put","patch","common"],(e=>{delete i[e]})),t.headers=de.concat(a,i);const o=[];let s=!0;this.interceptors.request.forEach((function(e){"function"==typeof e.runWhen&&!1===e.runWhen(t)||(s=s&&e.synchronous,o.unshift(e.fulfilled,e.rejected))}));const c=[];let u;this.interceptors.response.forEach((function(e){c.push(e.fulfilled,e.rejected)}));let f,d=0;if(!s){const e=[Te.bind(this),void 0];for(e.unshift.apply(e,o),e.push.apply(e,c),f=e.length,u=Promise.resolve(t);d<f;)u=u.then(e[d++],e[d++]);return u}f=o.length;let l=t;for(d=0;d<f;){const e=o[d++],t=o[d++];try{l=e(l)}catch(e){t.call(this,e);break}}try{u=Te.call(this,l)}catch(e){return Promise.reject(e)}for(d=0,f=c.length;d<f;)u=u.then(c[d++],c[d++]);return u}getUri(e){return Y(me((e=Re(this.defaults,e)).baseURL,e.url),e.params,e.paramsSerializer)}};L.forEach(["delete","get","head","options"],(function(e){Ce.prototype[e]=function(t,n){return this.request(Re(n||{},{method:e,url:t,data:(n||{}).data}))}})),L.forEach(["post","put","patch"],(function(e){function t(t){return function(n,r,i){return this.request(Re(i||{},{method:e,headers:t?{"Content-Type":"multipart/form-data"}:{},url:n,data:r}))}}Ce.prototype[e]=t(),Ce.prototype[e+"Form"]=t(!0)}));var Me=Ce;var Pe=class e{constructor(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");let t;this.promise=new Promise((function(e){t=e}));const n=this;this.promise.then((e=>{if(!n._listeners)return;let t=n._listeners.length;for(;t-- >0;)n._listeners[t](e);n._listeners=null})),this.promise.then=e=>{let t;const r=new Promise((e=>{n.subscribe(e),t=e})).then(e);return r.cancel=function(){n.unsubscribe(t)},r},e((function(e,r,i){n.reason||(n.reason=new he(e,r,i),t(n.reason))}))}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){this.reason?e(this.reason):this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const t=this._listeners.indexOf(e);-1!==t&&this._listeners.splice(t,1)}static source(){let t;const n=new e((function(e){t=e}));return{token:n,cancel:t}}};const Ne={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(Ne).forEach((([e,t])=>{Ne[t]=e}));var Be=Ne;const De=function e(t){const n=new Me(t),r=i(Me.prototype.request,n);return L.extend(r,Me.prototype,n,{allOwnKeys:!0}),L.extend(r,n,null,{allOwnKeys:!0}),r.create=function(n){return e(Re(t,n))},r}(ie);De.Axios=Me,De.CanceledError=he,De.CancelToken=Pe,De.isCancel=pe,De.VERSION=Se,De.toFormData=K,De.AxiosError=U,De.Cancel=De.CanceledError,De.all=function(e){return Promise.all(e)},De.spread=function(e){return function(t){return e.apply(null,t)}},De.isAxiosError=function(e){return L.isObject(e)&&!0===e.isAxiosError},De.mergeConfig=Re,De.AxiosHeaders=de,De.formToJSON=e=>te(L.isHTMLForm(e)?new FormData(e):e),De.HttpStatusCode=Be,De.default=De;var Fe=De;const{Axios:Le,AxiosError:Ue,CanceledError:je,isCancel:qe,CancelToken:ze,VERSION:He,all:Ge,Cancel:Ve,isAxiosError:Ke,spread:We,toFormData:Xe,AxiosHeaders:$e,HttpStatusCode:Je,formToJSON:Ye,mergeConfig:Qe}=Fe;const Ze="https://api.sandbox.immutable.com".replace(/\/+$/,"");let et=class{basePath;axios;configuration;constructor(e,t=Ze,n=Fe){this.basePath=t,this.axios=n,e&&(this.configuration=e,this.basePath=e.basePath||this.basePath)}},tt=class extends Error{field;name="RequiredError";constructor(e,t){super(t),this.field=e}};const nt="https://example.com",rt=function(e,t,n){if(null==n)throw new tt(t,`Required parameter ${t} was null or undefined when calling ${e}.`)},it=async function(e,t,n){if(n&&n.apiKey){const r="function"==typeof n.apiKey?await n.apiKey(t):await n.apiKey;e[t]=r}},at=async function(e,t){if(t&&t.accessToken){const n="function"==typeof t.accessToken?await t.accessToken():await t.accessToken;e.Authorization="Bearer "+n}};function ot(e,t,n=""){"object"==typeof t?Array.isArray(t)?t.forEach((t=>ot(e,t,n))):Object.keys(t).forEach((r=>ot(e,t[r],`${n}${""!==n?".":""}${r}`))):e.has(n)?e.append(n,t):e.set(n,t)}const st=function(e,...t){const n=new URLSearchParams(e.search);ot(n,t),e.search=n.toString()},ct=function(e,t,n){const r="string"!=typeof e;return(r&&n&&n.isJsonMime?n.isJsonMime(t.headers["Content-Type"]):r)?JSON.stringify(void 0!==e?e:{}):e||""},ut=function(e){return e.pathname+e.search+e.hash},ft=function(e,t,n,r){return(i=t,a=n)=>{const o={...e.options,url:(r?.basePath||a)+e.url};return i.request(o)}},dt=function(e){return{getActivity:async(t,n,r={})=>{rt("getActivity","chainName",t),rt("getActivity","activityId",n);const i="/v1/chains/{chain_name}/activities/{activity_id}".replace("{chain_name}",encodeURIComponent(String(t))).replace("{activity_id}",encodeURIComponent(String(n))),a=new URL(i,nt);let o;e&&(o=e.baseOptions);const s={method:"GET",...o,...r};st(a,{});let c=o&&o.headers?o.headers:{};return s.headers={...c,...r.headers},{url:ut(a),options:s}},listActivities:async(t,n,r,i,a,o,s,c,u,f,d={})=>{rt("listActivities","chainName",t);const l="/v1/chains/{chain_name}/activities".replace("{chain_name}",encodeURIComponent(String(t))),p=new URL(l,nt);let h;e&&(h=e.baseOptions);const b={method:"GET",...h,...d},m={};void 0!==n&&(m.contract_address=n),void 0!==r&&(m.token_id=r),void 0!==i&&(m.account_address=i),void 0!==a&&(m.activity_type=a),void 0!==o&&(m.from_indexed_at=o instanceof Date?o.toISOString():o),void 0!==s&&(m.to_indexed_at=s instanceof Date?s.toISOString():s),void 0!==c&&(m.transaction_hash=c),void 0!==u&&(m.page_cursor=u),void 0!==f&&(m.page_size=f),st(p,m);let y=h&&h.headers?h.headers:{};return b.headers={...y,...d.headers},{url:ut(p),options:b}}}},lt=function(e){const t=dt(e);return{async getActivity(n,r,i){const a=await t.getActivity(n,r,i);return ft(a,Fe,Ze,e)},async listActivities(n,r,i,a,o,s,c,u,f,d,l){const p=await t.listActivities(n,r,i,a,o,s,c,u,f,d,l);return ft(p,Fe,Ze,e)}}};class pt extends et{getActivity(e,t){return lt(this.configuration).getActivity(e.chainName,e.activityId,t).then((e=>e(this.axios,this.basePath)))}listActivities(e,t){return lt(this.configuration).listActivities(e.chainName,e.contractAddress,e.tokenId,e.accountAddress,e.activityType,e.fromIndexedAt,e.toIndexedAt,e.transactionHash,e.pageCursor,e.pageSize,t).then((e=>e(this.axios,this.basePath)))}}const ht=function(e){return{listChains:async(t,n,r={})=>{const i=new URL("/v1/chains",nt);let a;e&&(a=e.baseOptions);const o={method:"GET",...a,...r},s={};void 0!==t&&(s.page_cursor=t),void 0!==n&&(s.page_size=n),st(i,s);let c=a&&a.headers?a.headers:{};return o.headers={...c,...r.headers},{url:ut(i),options:o}}}},bt=function(e){const t=ht(e);return{async listChains(n,r,i){const a=await t.listChains(n,r,i);return ft(a,Fe,Ze,e)}}};class mt extends et{listChains(e={},t){return bt(this.configuration).listChains(e.pageCursor,e.pageSize,t).then((e=>e(this.axios,this.basePath)))}}const yt=function(e){return{getCollection:async(t,n,r={})=>{rt("getCollection","contractAddress",t),rt("getCollection","chainName",n);const i="/v1/chains/{chain_name}/collections/{contract_address}".replace("{contract_address}",encodeURIComponent(String(t))).replace("{chain_name}",encodeURIComponent(String(n))),a=new URL(i,nt);let o;e&&(o=e.baseOptions);const s={method:"GET",...o,...r};st(a,{});let c=o&&o.headers?o.headers:{};return s.headers={...c,...r.headers},{url:ut(a),options:s}},listCollections:async(t,n,r,i={})=>{rt("listCollections","chainName",t);const a="/v1/chains/{chain_name}/collections".replace("{chain_name}",encodeURIComponent(String(t))),o=new URL(a,nt);let s;e&&(s=e.baseOptions);const c={method:"GET",...s,...i},u={};void 0!==n&&(u.page_cursor=n),void 0!==r&&(u.page_size=r),st(o,u);let f=s&&s.headers?s.headers:{};return c.headers={...f,...i.headers},{url:ut(o),options:c}},listCollectionsByNFTOwner:async(t,n,r,i,a={})=>{rt("listCollectionsByNFTOwner","accountAddress",t),rt("listCollectionsByNFTOwner","chainName",n);const o="/v1/chains/{chain_name}/accounts/{account_address}/collections".replace("{account_address}",encodeURIComponent(String(t))).replace("{chain_name}",encodeURIComponent(String(n))),s=new URL(o,nt);let c;e&&(c=e.baseOptions);const u={method:"GET",...c,...a},f={};void 0!==r&&(f.page_cursor=r),void 0!==i&&(f.page_size=i),st(s,f);let d=c&&c.headers?c.headers:{};return u.headers={...d,...a.headers},{url:ut(s),options:u}},refreshCollectionMetadata:async(t,n,r,i={})=>{rt("refreshCollectionMetadata","contractAddress",t),rt("refreshCollectionMetadata","chainName",n),rt("refreshCollectionMetadata","refreshCollectionMetadataRequest",r);const a="/v1/chains/{chain_name}/collections/{contract_address}/refresh-metadata".replace("{contract_address}",encodeURIComponent(String(t))).replace("{chain_name}",encodeURIComponent(String(n))),o=new URL(a,nt);let s;e&&(s=e.baseOptions);const c={method:"POST",...s,...i},u={};await it(u,"X-Immutable-API-Key",e),u["Content-Type"]="application/json",st(o,{});let f=s&&s.headers?s.headers:{};return c.headers={...u,...f,...i.headers},c.data=ct(r,c,e),{url:ut(o),options:c}}}},gt=function(e){const t=yt(e);return{async getCollection(n,r,i){const a=await t.getCollection(n,r,i);return ft(a,Fe,Ze,e)},async listCollections(n,r,i,a){const o=await t.listCollections(n,r,i,a);return ft(o,Fe,Ze,e)},async listCollectionsByNFTOwner(n,r,i,a,o){const s=await t.listCollectionsByNFTOwner(n,r,i,a,o);return ft(s,Fe,Ze,e)},async refreshCollectionMetadata(n,r,i,a){const o=await t.refreshCollectionMetadata(n,r,i,a);return ft(o,Fe,Ze,e)}}};class vt extends et{getCollection(e,t){return gt(this.configuration).getCollection(e.contractAddress,e.chainName,t).then((e=>e(this.axios,this.basePath)))}listCollections(e,t){return gt(this.configuration).listCollections(e.chainName,e.pageCursor,e.pageSize,t).then((e=>e(this.axios,this.basePath)))}listCollectionsByNFTOwner(e,t){return gt(this.configuration).listCollectionsByNFTOwner(e.accountAddress,e.chainName,e.pageCursor,e.pageSize,t).then((e=>e(this.axios,this.basePath)))}refreshCollectionMetadata(e,t){return gt(this.configuration).refreshCollectionMetadata(e.contractAddress,e.chainName,e.refreshCollectionMetadataRequest,t).then((e=>e(this.axios,this.basePath)))}}const wt=function(e){return{getMetadata:async(t,n,r,i={})=>{rt("getMetadata","chainName",t),rt("getMetadata","contractAddress",n),rt("getMetadata","metadataId",r);const a="/v1/chains/{chain_name}/collections/{contract_address}/metadata/{metadata_id}".replace("{chain_name}",encodeURIComponent(String(t))).replace("{contract_address}",encodeURIComponent(String(n))).replace("{metadata_id}",encodeURIComponent(String(r))),o=new URL(a,nt);let s;e&&(s=e.baseOptions);const c={method:"GET",...s,...i};st(o,{});let u=s&&s.headers?s.headers:{};return c.headers={...u,...i.headers},{url:ut(o),options:c}},refreshMetadataByID:async(t,n,r,i={})=>{rt("refreshMetadataByID","chainName",t),rt("refreshMetadataByID","contractAddress",n),rt("refreshMetadataByID","refreshMetadataByIDRequest",r);const a="/v1/chains/{chain_name}/collections/{contract_address}/metadata/refresh-metadata".replace("{chain_name}",encodeURIComponent(String(t))).replace("{contract_address}",encodeURIComponent(String(n))),o=new URL(a,nt);let s;e&&(s=e.baseOptions);const c={method:"POST",...s,...i},u={};await it(u,"X-Immutable-API-Key",e),u["Content-Type"]="application/json",st(o,{});let f=s&&s.headers?s.headers:{};return c.headers={...u,...f,...i.headers},c.data=ct(r,c,e),{url:ut(o),options:c}}}},_t=function(e){const t=wt(e);return{async getMetadata(n,r,i,a){const o=await t.getMetadata(n,r,i,a);return ft(o,Fe,Ze,e)},async refreshMetadataByID(n,r,i,a){const o=await t.refreshMetadataByID(n,r,i,a);return ft(o,Fe,Ze,e)}}};const Et=function(e){return{listNFTOwners:async(t,n,r,i,a,o={})=>{rt("listNFTOwners","contractAddress",t),rt("listNFTOwners","tokenId",n),rt("listNFTOwners","chainName",r);const s="/v1/chains/{chain_name}/collections/{contract_address}/nfts/{token_id}/owners".replace("{contract_address}",encodeURIComponent(String(t))).replace("{token_id}",encodeURIComponent(String(n))).replace("{chain_name}",encodeURIComponent(String(r))),c=new URL(s,nt);let u;e&&(u=e.baseOptions);const f={method:"GET",...u,...o},d={};void 0!==i&&(d.page_cursor=i),void 0!==a&&(d.page_size=a),st(c,d);let l=u&&u.headers?u.headers:{};return f.headers={...l,...o.headers},{url:ut(c),options:f}}}},Tt=function(e){const t=Et(e);return{async listNFTOwners(n,r,i,a,o,s){const c=await t.listNFTOwners(n,r,i,a,o,s);return ft(c,Fe,Ze,e)}}};class At extends et{listNFTOwners(e,t){return Tt(this.configuration).listNFTOwners(e.contractAddress,e.tokenId,e.chainName,e.pageCursor,e.pageSize,t).then((e=>e(this.axios,this.basePath)))}}const Rt=function(e){return{getNFT:async(t,n,r,i={})=>{rt("getNFT","contractAddress",t),rt("getNFT","tokenId",n),rt("getNFT","chainName",r);const a="/v1/chains/{chain_name}/collections/{contract_address}/nfts/{token_id}".replace("{contract_address}",encodeURIComponent(String(t))).replace("{token_id}",encodeURIComponent(String(n))).replace("{chain_name}",encodeURIComponent(String(r))),o=new URL(a,nt);let s;e&&(s=e.baseOptions);const c={method:"GET",...s,...i};st(o,{});let u=s&&s.headers?s.headers:{};return c.headers={...u,...i.headers},{url:ut(o),options:c}},listNFTs:async(t,n,r,i,a={})=>{rt("listNFTs","contractAddress",t),rt("listNFTs","chainName",n);const o="/v1/chains/{chain_name}/collections/{contract_address}/nfts".replace("{contract_address}",encodeURIComponent(String(t))).replace("{chain_name}",encodeURIComponent(String(n))),s=new URL(o,nt);let c;e&&(c=e.baseOptions);const u={method:"GET",...c,...a},f={};void 0!==r&&(f.page_cursor=r),void 0!==i&&(f.page_size=i),st(s,f);let d=c&&c.headers?c.headers:{};return u.headers={...d,...a.headers},{url:ut(s),options:u}},listNFTsByAccountAddress:async(t,n,r,i,a,o={})=>{rt("listNFTsByAccountAddress","accountAddress",t),rt("listNFTsByAccountAddress","chainName",n);const s="/v1/chains/{chain_name}/accounts/{account_address}/nfts".replace("{account_address}",encodeURIComponent(String(t))).replace("{chain_name}",encodeURIComponent(String(n))),c=new URL(s,nt);let u;e&&(u=e.baseOptions);const f={method:"GET",...u,...o},d={};void 0!==r&&(d.contract_address=r),void 0!==i&&(d.page_cursor=i),void 0!==a&&(d.page_size=a),st(c,d);let l=u&&u.headers?u.headers:{};return f.headers={...l,...o.headers},{url:ut(c),options:f}}}},St=function(e){const t=Rt(e);return{async getNFT(n,r,i,a){const o=await t.getNFT(n,r,i,a);return ft(o,Fe,Ze,e)},async listNFTs(n,r,i,a,o){const s=await t.listNFTs(n,r,i,a,o);return ft(s,Fe,Ze,e)},async listNFTsByAccountAddress(n,r,i,a,o,s){const c=await t.listNFTsByAccountAddress(n,r,i,a,o,s);return ft(c,Fe,Ze,e)}}};class kt extends et{getNFT(e,t){return St(this.configuration).getNFT(e.contractAddress,e.tokenId,e.chainName,t).then((e=>e(this.axios,this.basePath)))}listNFTs(e,t){return St(this.configuration).listNFTs(e.contractAddress,e.chainName,e.pageCursor,e.pageSize,t).then((e=>e(this.axios,this.basePath)))}listNFTsByAccountAddress(e,t){return St(this.configuration).listNFTsByAccountAddress(e.accountAddress,e.chainName,e.contractAddress,e.pageCursor,e.pageSize,t).then((e=>e(this.axios,this.basePath)))}}const It=function(e){return{createListing:async(t,n,r={})=>{rt("createListing","chainName",t),rt("createListing","createListingRequestBody",n);const i="/v1/chains/{chain_name}/orders/listings".replace("{chain_name}",encodeURIComponent(String(t))),a=new URL(i,nt);let o;e&&(o=e.baseOptions);const s={method:"POST",...o,...r},c={};c["Content-Type"]="application/json",st(a,{});let u=o&&o.headers?o.headers:{};return s.headers={...c,...u,...r.headers},s.data=ct(n,s,e),{url:ut(a),options:s}},fulfillmentData:async(t,n,r={})=>{rt("fulfillmentData","chainName",t),rt("fulfillmentData","fulfillmentDataRequest",n);const i="/v1/chains/{chain_name}/orders/fulfillment-data".replace("{chain_name}",encodeURIComponent(String(t))),a=new URL(i,nt);let o;e&&(o=e.baseOptions);const s={method:"POST",...o,...r},c={};c["Content-Type"]="application/json",st(a,{});let u=o&&o.headers?o.headers:{};return s.headers={...c,...u,...r.headers},s.data=ct(n,s,e),{url:ut(a),options:s}},getListing:async(t,n,r={})=>{rt("getListing","chainName",t),rt("getListing","listingId",n);const i="/v1/chains/{chain_name}/orders/listings/{listing_id}".replace("{chain_name}",encodeURIComponent(String(t))).replace("{listing_id}",encodeURIComponent(String(n))),a=new URL(i,nt);let o;e&&(o=e.baseOptions);const s={method:"GET",...o,...r};st(a,{});let c=o&&o.headers?o.headers:{};return s.headers={...c,...r.headers},{url:ut(a),options:s}},getTrade:async(t,n,r={})=>{rt("getTrade","chainName",t),rt("getTrade","tradeId",n);const i="/v1/chains/{chain_name}/trades/{trade_id}".replace("{chain_name}",encodeURIComponent(String(t))).replace("{trade_id}",encodeURIComponent(String(n))),a=new URL(i,nt);let o;e&&(o=e.baseOptions);const s={method:"GET",...o,...r};st(a,{});let c=o&&o.headers?o.headers:{};return s.headers={...c,...r.headers},{url:ut(a),options:s}},listListings:async(t,n,r,i,a,o,s,c,u,f={})=>{rt("listListings","chainName",t);const d="/v1/chains/{chain_name}/orders/listings".replace("{chain_name}",encodeURIComponent(String(t))),l=new URL(d,nt);let p;e&&(p=e.baseOptions);const h={method:"GET",...p,...f},b={};void 0!==n&&(b.status=n),void 0!==r&&(b.sell_item_contract_address=r),void 0!==i&&(b.buy_item_contract_address=i),void 0!==a&&(b.sell_item_token_id=a),void 0!==o&&(b.page_size=o),void 0!==s&&(b.sort_by=s),void 0!==c&&(b.sort_direction=c),void 0!==u&&(b.page_cursor=u),st(l,b);let m=p&&p.headers?p.headers:{};return h.headers={...m,...f.headers},{url:ut(l),options:h}},listTrades:async(t,n,r,i,a,o,s={})=>{rt("listTrades","chainName",t);const c="/v1/chains/{chain_name}/trades".replace("{chain_name}",encodeURIComponent(String(t))),u=new URL(c,nt);let f;e&&(f=e.baseOptions);const d={method:"GET",...f,...s},l={};void 0!==n&&(l.account_address=n),void 0!==r&&(l.page_size=r),void 0!==i&&(l.sort_by=i),void 0!==a&&(l.sort_direction=a),void 0!==o&&(l.page_cursor=o),st(u,l);let p=f&&f.headers?f.headers:{};return d.headers={...p,...s.headers},{url:ut(u),options:d}}}},Ot=function(e){const t=It(e);return{async createListing(n,r,i){const a=await t.createListing(n,r,i);return ft(a,Fe,Ze,e)},async fulfillmentData(n,r,i){const a=await t.fulfillmentData(n,r,i);return ft(a,Fe,Ze,e)},async getListing(n,r,i){const a=await t.getListing(n,r,i);return ft(a,Fe,Ze,e)},async getTrade(n,r,i){const a=await t.getTrade(n,r,i);return ft(a,Fe,Ze,e)},async listListings(n,r,i,a,o,s,c,u,f,d){const l=await t.listListings(n,r,i,a,o,s,c,u,f,d);return ft(l,Fe,Ze,e)},async listTrades(n,r,i,a,o,s,c){const u=await t.listTrades(n,r,i,a,o,s,c);return ft(u,Fe,Ze,e)}}};class xt extends et{createListing(e,t){return Ot(this.configuration).createListing(e.chainName,e.createListingRequestBody,t).then((e=>e(this.axios,this.basePath)))}fulfillmentData(e,t){return Ot(this.configuration).fulfillmentData(e.chainName,e.fulfillmentDataRequest,t).then((e=>e(this.axios,this.basePath)))}getListing(e,t){return Ot(this.configuration).getListing(e.chainName,e.listingId,t).then((e=>e(this.axios,this.basePath)))}getTrade(e,t){return Ot(this.configuration).getTrade(e.chainName,e.tradeId,t).then((e=>e(this.axios,this.basePath)))}listListings(e,t){return Ot(this.configuration).listListings(e.chainName,e.status,e.sellItemContractAddress,e.buyItemContractAddress,e.sellItemTokenId,e.pageSize,e.sortBy,e.sortDirection,e.pageCursor,t).then((e=>e(this.axios,this.basePath)))}listTrades(e,t){return Ot(this.configuration).listTrades(e.chainName,e.accountAddress,e.pageSize,e.sortBy,e.sortDirection,e.pageCursor,t).then((e=>e(this.axios,this.basePath)))}}const Ct=function(e){return{createCounterfactualAddress:async(t,n={})=>{rt("createCounterfactualAddress","createCounterfactualAddressRequest",t);const r=new URL("/passport-mr/v1/counterfactual-address",nt);let i;e&&(i=e.baseOptions);const a={method:"POST",...i,...n},o={};await at(o,e),o["Content-Type"]="application/json",st(r,{});let s=i&&i.headers?i.headers:{};return a.headers={...o,...s,...n.headers},a.data=ct(t,a,e),{url:ut(r),options:a}},getLinkedAddresses:async(t,n={})=>{rt("getLinkedAddresses","userId",t);const r="/passport-mr/v1/users/{userId}/linked-addresses".replace("{userId}",encodeURIComponent(String(t))),i=new URL(r,nt);let a;e&&(a=e.baseOptions);const o={method:"GET",...a,...n},s={};await at(s,e),st(i,{});let c=a&&a.headers?a.headers:{};return o.headers={...s,...c,...n.headers},{url:ut(i),options:o}}}},Mt=function(e){const t=Ct(e);return{async createCounterfactualAddress(n,r){const i=await t.createCounterfactualAddress(n,r);return ft(i,Fe,Ze,e)},async getLinkedAddresses(n,r){const i=await t.getLinkedAddresses(n,r);return ft(i,Fe,Ze,e)}}};class Pt extends et{createCounterfactualAddress(e,t){return Mt(this.configuration).createCounterfactualAddress(e.createCounterfactualAddressRequest,t).then((e=>e(this.axios,this.basePath)))}getLinkedAddresses(e,t){return Mt(this.configuration).getLinkedAddresses(e.userId,t).then((e=>e(this.axios,this.basePath)))}}const Nt=function(e){return{getERC20Token:async(t,n,r={})=>{rt("getERC20Token","contractAddress",t),rt("getERC20Token","chainName",n);const i="/v1/chains/{chain_name}/tokens/{contract_address}".replace("{contract_address}",encodeURIComponent(String(t))).replace("{chain_name}",encodeURIComponent(String(n))),a=new URL(i,nt);let o;e&&(o=e.baseOptions);const s={method:"GET",...o,...r};st(a,{});let c=o&&o.headers?o.headers:{};return s.headers={...c,...r.headers},{url:ut(a),options:s}},listERC20Tokens:async(t,n,r,i={})=>{rt("listERC20Tokens","chainName",t);const a="/v1/chains/{chain_name}/tokens".replace("{chain_name}",encodeURIComponent(String(t))),o=new URL(a,nt);let s;e&&(s=e.baseOptions);const c={method:"GET",...s,...i},u={};void 0!==n&&(u.page_cursor=n),void 0!==r&&(u.page_size=r),st(o,u);let f=s&&s.headers?s.headers:{};return c.headers={...f,...i.headers},{url:ut(o),options:c}}}},Bt=function(e){const t=Nt(e);return{async getERC20Token(n,r,i){const a=await t.getERC20Token(n,r,i);return ft(a,Fe,Ze,e)},async listERC20Tokens(n,r,i,a){const o=await t.listERC20Tokens(n,r,i,a);return ft(o,Fe,Ze,e)}}};var Dt=Object.freeze({__proto__:null,APIError400AllOfCodeEnum:{ValidationError:"VALIDATION_ERROR"},APIError401AllOfCodeEnum:{UnauthorisedRequest:"UNAUTHORISED_REQUEST"},APIError403AllOfCodeEnum:{AuthenticationError:"AUTHENTICATION_ERROR"},APIError404AllOfCodeEnum:{ResourceNotFound:"RESOURCE_NOT_FOUND"},APIError429AllOfCodeEnum:{TooManyRequestsError:"TOO_MANY_REQUESTS_ERROR"},APIError500AllOfCodeEnum:{InternalServerError:"INTERNAL_SERVER_ERROR"},ActivitiesApi:pt,ActivitiesApiAxiosParamCreator:dt,ActivitiesApiFactory:function(e,t,n){const r=lt(e);return{getActivity:(e,i,a)=>r.getActivity(e,i,a).then((e=>e(n,t))),listActivities:(e,i,a,o,s,c,u,f,d,l,p)=>r.listActivities(e,i,a,o,s,c,u,f,d,l,p).then((e=>e(n,t)))}},ActivitiesApiFp:lt,ActivityType:{Mint:"mint",Burn:"burn",Transfer:"transfer",Sale:"sale",Deposit:"deposit",Withdrawal:"withdrawal"},ChainsApi:mt,ChainsApiAxiosParamCreator:ht,ChainsApiFactory:function(e,t,n){const r=bt(e);return{listChains:(e,i,a)=>r.listChains(e,i,a).then((e=>e(n,t)))}},ChainsApiFp:bt,CollectionContractType:{Erc721:"ERC721"},CollectionsApi:vt,CollectionsApiAxiosParamCreator:yt,CollectionsApiFactory:function(e,t,n){const r=gt(e);return{getCollection:(e,i,a)=>r.getCollection(e,i,a).then((e=>e(n,t))),listCollections:(e,i,a,o)=>r.listCollections(e,i,a,o).then((e=>e(n,t))),listCollectionsByNFTOwner:(e,i,a,o,s)=>r.listCollectionsByNFTOwner(e,i,a,o,s).then((e=>e(n,t))),refreshCollectionMetadata:(e,i,a,o)=>r.refreshCollectionMetadata(e,i,a,o).then((e=>e(n,t)))}},CollectionsApiFp:gt,Configuration:class{apiKey;username;password;accessToken;basePath;baseOptions;formDataCtor;constructor(e={}){this.apiKey=e.apiKey,this.username=e.username,this.password=e.password,this.accessToken=e.accessToken,this.basePath=e.basePath,this.baseOptions=e.baseOptions,this.formDataCtor=e.formDataCtor}isJsonMime(e){const t=new RegExp("^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$","i");return null!==e&&(t.test(e)||"application/json-patch+json"===e.toLowerCase())}},ERC20ItemItemTypeEnum:{Erc20:"ERC20"},ERC721ItemItemTypeEnum:{Erc721:"ERC721"},FeeFeeTypeEnum:{Royalty:"ROYALTY",MakerMarketplace:"MAKER_MARKETPLACE",TakerMarketplace:"TAKER_MARKETPLACE",Protocol:"PROTOCOL"},MetadataApi:class extends et{getMetadata(e,t){return _t(this.configuration).getMetadata(e.chainName,e.contractAddress,e.metadataId,t).then((e=>e(this.axios,this.basePath)))}refreshMetadataByID(e,t){return _t(this.configuration).refreshMetadataByID(e.chainName,e.contractAddress,e.refreshMetadataByIDRequest,t).then((e=>e(this.axios,this.basePath)))}},MetadataApiAxiosParamCreator:wt,MetadataApiFactory:function(e,t,n){const r=_t(e);return{getMetadata:(e,i,a,o)=>r.getMetadata(e,i,a,o).then((e=>e(n,t))),refreshMetadataByID:(e,i,a,o)=>r.refreshMetadataByID(e,i,a,o).then((e=>e(n,t)))}},MetadataApiFp:_t,NFTContractType:{Erc721:"ERC721"},NativeItemItemTypeEnum:{Native:"NATIVE"},NftOwnersApi:At,NftOwnersApiAxiosParamCreator:Et,NftOwnersApiFactory:function(e,t,n){const r=Tt(e);return{listNFTOwners:(e,i,a,o,s,c)=>r.listNFTOwners(e,i,a,o,s,c).then((e=>e(n,t)))}},NftOwnersApiFp:Tt,NftsApi:kt,NftsApiAxiosParamCreator:Rt,NftsApiFactory:function(e,t,n){const r=St(e);return{getNFT:(e,i,a,o)=>r.getNFT(e,i,a,o).then((e=>e(n,t))),listNFTs:(e,i,a,o,s)=>r.listNFTs(e,i,a,o,s).then((e=>e(n,t))),listNFTsByAccountAddress:(e,i,a,o,s,c)=>r.listNFTsByAccountAddress(e,i,a,o,s,c).then((e=>e(n,t)))}},NftsApiFp:St,OrderStatus:{Pending:"PENDING",Active:"ACTIVE",Inactive:"INACTIVE",Filled:"FILLED",Cancelled:"CANCELLED",Expired:"EXPIRED"},OrdersApi:xt,OrdersApiAxiosParamCreator:It,OrdersApiFactory:function(e,t,n){const r=Ot(e);return{createListing:(e,i,a)=>r.createListing(e,i,a).then((e=>e(n,t))),fulfillmentData:(e,i,a)=>r.fulfillmentData(e,i,a).then((e=>e(n,t))),getListing:(e,i,a)=>r.getListing(e,i,a).then((e=>e(n,t))),getTrade:(e,i,a)=>r.getTrade(e,i,a).then((e=>e(n,t))),listListings:(e,i,a,o,s,c,u,f,d,l)=>r.listListings(e,i,a,o,s,c,u,f,d,l).then((e=>e(n,t))),listTrades:(e,i,a,o,s,c,u)=>r.listTrades(e,i,a,o,s,c,u).then((e=>e(n,t)))}},OrdersApiFp:Ot,PassportApi:Pt,PassportApiAxiosParamCreator:Ct,PassportApiFactory:function(e,t,n){const r=Mt(e);return{createCounterfactualAddress:(e,i)=>r.createCounterfactualAddress(e,i).then((e=>e(n,t))),getLinkedAddresses:(e,i)=>r.getLinkedAddresses(e,i).then((e=>e(n,t)))}},PassportApiFp:Mt,ProtocolDataOrderTypeEnum:{FullRestricted:"FULL_RESTRICTED"},SaleFeeTypeEnum:{Royalty:"ROYALTY"},TokenContractType:{Erc20:"ERC20"},TokensApi:class extends et{getERC20Token(e,t){return Bt(this.configuration).getERC20Token(e.contractAddress,e.chainName,t).then((e=>e(this.axios,this.basePath)))}listERC20Tokens(e,t){return Bt(this.configuration).listERC20Tokens(e.chainName,e.pageCursor,e.pageSize,t).then((e=>e(this.axios,this.basePath)))}},TokensApiAxiosParamCreator:Nt,TokensApiFactory:function(e,t,n){const r=Bt(e);return{getERC20Token:(e,i,a)=>r.getERC20Token(e,i,a).then((e=>e(n,t))),listERC20Tokens:(e,i,a,o)=>r.listERC20Tokens(e,i,a,o).then((e=>e(n,t)))}},TokensApiFp:Bt});class Ft{config;activitiesApi;chainsApi;collectionApi;nftOwnersApi;nftsApi;ordersApi;passportApi;constructor(e){this.config=e,this.activitiesApi=new pt(e.indexer),this.chainsApi=new mt(e.indexer),this.collectionApi=new vt(e.indexer),this.nftOwnersApi=new At(e.indexer),this.nftsApi=new kt(e.indexer),this.ordersApi=new xt(e.orderBook),this.passportApi=new Pt(e.passport)}}const Lt={"x-sdk-version":"ts-immutable-sdk-0.20.1-alpha.1"},Ut=({basePath:e,headers:t})=>{if(!e.trim())throw Error("basePath can not be empty");const n={basePath:e,baseOptions:{headers:{...Lt,...t||{}}}};return new class{apiKey;username;password;accessToken;basePath;baseOptions;formDataCtor;constructor(e={}){this.apiKey=e.apiKey,this.username=e.username,this.password=e.password,this.accessToken=e.accessToken,this.basePath=e.basePath,this.baseOptions=e.baseOptions,this.formDataCtor=e.formDataCtor}isJsonMime(e){const t=new RegExp("^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$","i");return null!==e&&(t.test(e)||"application/json-patch+json"===e.toLowerCase())}}(n)},jt=()=>({indexer:Ut({basePath:"https://indexer-mr.imtbl.com"}),orderBook:Ut({basePath:"https://order-book-mr.imtbl.com"}),passport:Ut({basePath:"https://api.immutable.com"})}),qt=()=>({indexer:Ut({basePath:"https://api.sandbox.immutable.com"}),orderBook:Ut({basePath:"https://api.sandbox.immutable.com"}),passport:Ut({basePath:"https://api.sandbox.immutable.com"})});class zt extends Error{code;details;link;traceId;constructor({message:e,code:t,details:n,link:r,trace_id:i}){super(e),this.code=t,this.details=n,this.link=r,this.traceId=i}}const Ht={sdkVersion:"ts-immutable-sdk-multi-rollup-api-client-0.20.1-alpha.1"},Gt=({basePath:e,headers:t})=>{if(!e.trim())throw Error("basePath can not be empty");const n={basePath:e,baseOptions:{headers:{...t||{},...Ht}}};return new Dt.Configuration(n)},Vt=()=>Gt({basePath:"https://api.sandbox.immutable.com"});class Kt{apiConfig;baseConfig;constructor({baseConfig:e,overrides:n}){if(this.baseConfig=e,n)this.apiConfig=Gt(n);else switch(e.environment){case t.SANDBOX:this.apiConfig=Vt();break;case t.PRODUCTION:this.apiConfig=Gt({basePath:"https://indexer-mr.imtbl.com"});break;default:this.apiConfig=Vt()}}}function Wt(e){if(Fe.isAxiosError(e)&&e.response){const t=e.response.data;return t.code&&t.message?new zt({code:t.code,message:t.message,details:t.details||null,link:t.link||"",trace_id:t.trace_id||""}):new zt({code:e.code??e.response?.status.toString()??"unknown_error_code",message:String(e),details:null,link:"",trace_id:""})}return new zt({code:"unknown_error_code",message:String(e),details:null,link:"",trace_id:""})}class Xt{config;activities;chains;collections;nfts;nftOwners;tokens;constructor(e){this.config=new Kt(e),this.activities=new Dt.ActivitiesApi(this.config.apiConfig),this.chains=new Dt.ChainsApi(this.config.apiConfig),this.collections=new Dt.CollectionsApi(this.config.apiConfig),this.nfts=new Dt.NftsApi(this.config.apiConfig),this.nftOwners=new Dt.NftOwnersApi(this.config.apiConfig),this.tokens=new Dt.TokensApi(this.config.apiConfig)}async listActivities(e){return await this.activities.listActivities(e).then((e=>e.data)).catch((e=>{throw Wt(e)}))}async getActivity(e){return await this.activities.getActivity(e).then((e=>e.data)).catch((e=>{throw Wt(e)}))}async listChains(e){return await this.chains.listChains(e).then((e=>e.data)).catch((e=>{throw Wt(e)}))}async listCollections(e){return await this.collections.listCollections(e).then((e=>e.data)).catch((e=>{throw Wt(e)}))}async listCollectionsByNFTOwner(e){return await this.collections.listCollectionsByNFTOwner(e).then((e=>e.data)).catch((e=>{throw Wt(e)}))}async getCollection(e){return await this.collections.getCollection(e).then((e=>e.data)).catch((e=>{throw Wt(e)}))}async getNFT(e){return await this.nfts.getNFT(e).then((e=>e.data)).catch((e=>{throw Wt(e)}))}async listNFTs(e){return await this.nfts.listNFTs(e).then((e=>e.data)).catch((e=>{throw Wt(e)}))}async listNFTsByAccountAddress(e){return await this.nfts.listNFTsByAccountAddress(e).then((e=>e.data)).catch((e=>{throw Wt(e)}))}async listNFTOwners(e){return await this.nftOwners.listNFTOwners(e).then((e=>e.data)).catch((e=>{throw Wt(e)}))}async listTokens(e){return await this.tokens.listERC20Tokens(e).then((e=>e.data)).catch((e=>{throw Wt(e)}))}async getToken(e){return await this.tokens.getERC20Token(e).then((e=>e.data)).catch((e=>{throw Wt(e)}))}}var $t=Object.freeze({__proto__:null,APIError:zt,BlockchainData:Xt}),Jt="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function Yt(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function Qt(e){if(e.__esModule)return e;var t=e.default;if("function"==typeof t){var n=function e(){if(this instanceof e){var n=[null];return n.push.apply(n,arguments),new(Function.bind.apply(t,n))}return t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach((function(t){var r=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(n,t,r.get?r:{enumerable:!0,get:function(){return e[t]}})})),n}var Zt={exports:{}},en="undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},tn=[],nn=[],rn="undefined"!=typeof Uint8Array?Uint8Array:Array,an=!1;function on(){an=!0;for(var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",t=0;t<64;++t)tn[t]=e[t],nn[e.charCodeAt(t)]=t;nn["-".charCodeAt(0)]=62,nn["_".charCodeAt(0)]=63}function sn(e,t,n){for(var r,i,a=[],o=t;o<n;o+=3)r=(e[o]<<16)+(e[o+1]<<8)+e[o+2],a.push(tn[(i=r)>>18&63]+tn[i>>12&63]+tn[i>>6&63]+tn[63&i]);return a.join("")}function cn(e){var t;an||on();for(var n=e.length,r=n%3,i="",a=[],o=16383,s=0,c=n-r;s<c;s+=o)a.push(sn(e,s,s+o>c?c:s+o));return 1===r?(t=e[n-1],i+=tn[t>>2],i+=tn[t<<4&63],i+="=="):2===r&&(t=(e[n-2]<<8)+e[n-1],i+=tn[t>>10],i+=tn[t>>4&63],i+=tn[t<<2&63],i+="="),a.push(i),a.join("")}function un(e,t,n,r,i){var a,o,s=8*i-r-1,c=(1<<s)-1,u=c>>1,f=-7,d=n?i-1:0,l=n?-1:1,p=e[t+d];for(d+=l,a=p&(1<<-f)-1,p>>=-f,f+=s;f>0;a=256*a+e[t+d],d+=l,f-=8);for(o=a&(1<<-f)-1,a>>=-f,f+=r;f>0;o=256*o+e[t+d],d+=l,f-=8);if(0===a)a=1-u;else{if(a===c)return o?NaN:1/0*(p?-1:1);o+=Math.pow(2,r),a-=u}return(p?-1:1)*o*Math.pow(2,a-r)}function fn(e,t,n,r,i,a){var o,s,c,u=8*a-i-1,f=(1<<u)-1,d=f>>1,l=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,p=r?0:a-1,h=r?1:-1,b=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,o=f):(o=Math.floor(Math.log(t)/Math.LN2),t*(c=Math.pow(2,-o))<1&&(o--,c*=2),(t+=o+d>=1?l/c:l*Math.pow(2,1-d))*c>=2&&(o++,c/=2),o+d>=f?(s=0,o=f):o+d>=1?(s=(t*c-1)*Math.pow(2,i),o+=d):(s=t*Math.pow(2,d-1)*Math.pow(2,i),o=0));i>=8;e[n+p]=255&s,p+=h,s/=256,i-=8);for(o=o<<i|s,u+=i;u>0;e[n+p]=255&o,p+=h,o/=256,u-=8);e[n+p-h]|=128*b}var dn={}.toString,ln=Array.isArray||function(e){return"[object Array]"==dn.call(e)};mn.TYPED_ARRAY_SUPPORT=void 0===en.TYPED_ARRAY_SUPPORT||en.TYPED_ARRAY_SUPPORT;var pn=hn();function hn(){return mn.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function bn(e,t){if(hn()<t)throw new RangeError("Invalid typed array length");return mn.TYPED_ARRAY_SUPPORT?(e=new Uint8Array(t)).__proto__=mn.prototype:(null===e&&(e=new mn(t)),e.length=t),e}function mn(e,t,n){if(!(mn.TYPED_ARRAY_SUPPORT||this instanceof mn))return new mn(e,t,n);if("number"==typeof e){if("string"==typeof t)throw new Error("If encoding is specified then the first argument must be a string");return vn(this,e)}return yn(this,e,t,n)}function yn(e,t,n,r){if("number"==typeof t)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&t instanceof ArrayBuffer?function(e,t,n,r){if(t.byteLength,n<0||t.byteLength<n)throw new RangeError("'offset' is out of bounds");if(t.byteLength<n+(r||0))throw new RangeError("'length' is out of bounds");t=void 0===n&&void 0===r?new Uint8Array(t):void 0===r?new Uint8Array(t,n):new Uint8Array(t,n,r);mn.TYPED_ARRAY_SUPPORT?(e=t).__proto__=mn.prototype:e=wn(e,t);return e}(e,t,n,r):"string"==typeof t?function(e,t,n){"string"==typeof n&&""!==n||(n="utf8");if(!mn.isEncoding(n))throw new TypeError('"encoding" must be a valid string encoding');var r=0|Tn(t,n);e=bn(e,r);var i=e.write(t,n);i!==r&&(e=e.slice(0,i));return e}(e,t,n):function(e,t){if(En(t)){var n=0|_n(t.length);return 0===(e=bn(e,n)).length||t.copy(e,0,0,n),e}if(t){if("undefined"!=typeof ArrayBuffer&&t.buffer instanceof ArrayBuffer||"length"in t)return"number"!=typeof t.length||(r=t.length)!=r?bn(e,0):wn(e,t);if("Buffer"===t.type&&ln(t.data))return wn(e,t.data)}var r;throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(e,t)}function gn(e){if("number"!=typeof e)throw new TypeError('"size" argument must be a number');if(e<0)throw new RangeError('"size" argument must not be negative')}function vn(e,t){if(gn(t),e=bn(e,t<0?0:0|_n(t)),!mn.TYPED_ARRAY_SUPPORT)for(var n=0;n<t;++n)e[n]=0;return e}function wn(e,t){var n=t.length<0?0:0|_n(t.length);e=bn(e,n);for(var r=0;r<n;r+=1)e[r]=255&t[r];return e}function _n(e){if(e>=hn())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+hn().toString(16)+" bytes");return 0|e}function En(e){return!(null==e||!e._isBuffer)}function Tn(e,t){if(En(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!=typeof e&&(e=""+e);var n=e.length;if(0===n)return 0;for(var r=!1;;)switch(t){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":case void 0:return Jn(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return Yn(e).length;default:if(r)return Jn(e).length;t=(""+t).toLowerCase(),r=!0}}function An(e,t,n){var r=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if((n>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return Un(this,t,n);case"utf8":case"utf-8":return Bn(this,t,n);case"ascii":return Fn(this,t,n);case"latin1":case"binary":return Ln(this,t,n);case"base64":return Nn(this,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return jn(this,t,n);default:if(r)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),r=!0}}function Rn(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}function Sn(e,t,n,r,i){if(0===e.length)return-1;if("string"==typeof n?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,isNaN(n)&&(n=i?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(i)return-1;n=e.length-1}else if(n<0){if(!i)return-1;n=0}if("string"==typeof t&&(t=mn.from(t,r)),En(t))return 0===t.length?-1:kn(e,t,n,r,i);if("number"==typeof t)return t&=255,mn.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):kn(e,[t],n,r,i);throw new TypeError("val must be string, number or Buffer")}function kn(e,t,n,r,i){var a,o=1,s=e.length,c=t.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(e.length<2||t.length<2)return-1;o=2,s/=2,c/=2,n/=2}function u(e,t){return 1===o?e[t]:e.readUInt16BE(t*o)}if(i){var f=-1;for(a=n;a<s;a++)if(u(e,a)===u(t,-1===f?0:a-f)){if(-1===f&&(f=a),a-f+1===c)return f*o}else-1!==f&&(a-=a-f),f=-1}else for(n+c>s&&(n=s-c),a=n;a>=0;a--){for(var d=!0,l=0;l<c;l++)if(u(e,a+l)!==u(t,l)){d=!1;break}if(d)return a}return-1}function In(e,t,n,r){n=Number(n)||0;var i=e.length-n;r?(r=Number(r))>i&&(r=i):r=i;var a=t.length;if(a%2!=0)throw new TypeError("Invalid hex string");r>a/2&&(r=a/2);for(var o=0;o<r;++o){var s=parseInt(t.substr(2*o,2),16);if(isNaN(s))return o;e[n+o]=s}return o}function On(e,t,n,r){return Qn(Jn(t,e.length-n),e,n,r)}function xn(e,t,n,r){return Qn(function(e){for(var t=[],n=0;n<e.length;++n)t.push(255&e.charCodeAt(n));return t}(t),e,n,r)}function Cn(e,t,n,r){return xn(e,t,n,r)}function Mn(e,t,n,r){return Qn(Yn(t),e,n,r)}function Pn(e,t,n,r){return Qn(function(e,t){for(var n,r,i,a=[],o=0;o<e.length&&!((t-=2)<0);++o)r=(n=e.charCodeAt(o))>>8,i=n%256,a.push(i),a.push(r);return a}(t,e.length-n),e,n,r)}function Nn(e,t,n){return 0===t&&n===e.length?cn(e):cn(e.slice(t,n))}function Bn(e,t,n){n=Math.min(e.length,n);for(var r=[],i=t;i<n;){var a,o,s,c,u=e[i],f=null,d=u>239?4:u>223?3:u>191?2:1;if(i+d<=n)switch(d){case 1:u<128&&(f=u);break;case 2:128==(192&(a=e[i+1]))&&(c=(31&u)<<6|63&a)>127&&(f=c);break;case 3:a=e[i+1],o=e[i+2],128==(192&a)&&128==(192&o)&&(c=(15&u)<<12|(63&a)<<6|63&o)>2047&&(c<55296||c>57343)&&(f=c);break;case 4:a=e[i+1],o=e[i+2],s=e[i+3],128==(192&a)&&128==(192&o)&&128==(192&s)&&(c=(15&u)<<18|(63&a)<<12|(63&o)<<6|63&s)>65535&&c<1114112&&(f=c)}null===f?(f=65533,d=1):f>65535&&(f-=65536,r.push(f>>>10&1023|55296),f=56320|1023&f),r.push(f),i+=d}return function(e){var t=e.length;if(t<=Dn)return String.fromCharCode.apply(String,e);var n="",r=0;for(;r<t;)n+=String.fromCharCode.apply(String,e.slice(r,r+=Dn));return n}(r)}mn.poolSize=8192,mn._augment=function(e){return e.__proto__=mn.prototype,e},mn.from=function(e,t,n){return yn(null,e,t,n)},mn.TYPED_ARRAY_SUPPORT&&(mn.prototype.__proto__=Uint8Array.prototype,mn.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&mn[Symbol.species]),mn.alloc=function(e,t,n){return function(e,t,n,r){return gn(t),t<=0?bn(e,t):void 0!==n?"string"==typeof r?bn(e,t).fill(n,r):bn(e,t).fill(n):bn(e,t)}(null,e,t,n)},mn.allocUnsafe=function(e){return vn(null,e)},mn.allocUnsafeSlow=function(e){return vn(null,e)},mn.isBuffer=Zn,mn.compare=function(e,t){if(!En(e)||!En(t))throw new TypeError("Arguments must be Buffers");if(e===t)return 0;for(var n=e.length,r=t.length,i=0,a=Math.min(n,r);i<a;++i)if(e[i]!==t[i]){n=e[i],r=t[i];break}return n<r?-1:r<n?1:0},mn.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},mn.concat=function(e,t){if(!ln(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return mn.alloc(0);var n;if(void 0===t)for(t=0,n=0;n<e.length;++n)t+=e[n].length;var r=mn.allocUnsafe(t),i=0;for(n=0;n<e.length;++n){var a=e[n];if(!En(a))throw new TypeError('"list" argument must be an Array of Buffers');a.copy(r,i),i+=a.length}return r},mn.byteLength=Tn,mn.prototype._isBuffer=!0,mn.prototype.swap16=function(){var e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;t<e;t+=2)Rn(this,t,t+1);return this},mn.prototype.swap32=function(){var e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;t<e;t+=4)Rn(this,t,t+3),Rn(this,t+1,t+2);return this},mn.prototype.swap64=function(){var e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var t=0;t<e;t+=8)Rn(this,t,t+7),Rn(this,t+1,t+6),Rn(this,t+2,t+5),Rn(this,t+3,t+4);return this},mn.prototype.toString=function(){var e=0|this.length;return 0===e?"":0===arguments.length?Bn(this,0,e):An.apply(this,arguments)},mn.prototype.equals=function(e){if(!En(e))throw new TypeError("Argument must be a Buffer");return this===e||0===mn.compare(this,e)},mn.prototype.inspect=function(){var e="";return this.length>0&&(e=this.toString("hex",0,50).match(/.{2}/g).join(" "),this.length>50&&(e+=" ... ")),"<Buffer "+e+">"},mn.prototype.compare=function(e,t,n,r,i){if(!En(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===n&&(n=e?e.length:0),void 0===r&&(r=0),void 0===i&&(i=this.length),t<0||n>e.length||r<0||i>this.length)throw new RangeError("out of range index");if(r>=i&&t>=n)return 0;if(r>=i)return-1;if(t>=n)return 1;if(this===e)return 0;for(var a=(i>>>=0)-(r>>>=0),o=(n>>>=0)-(t>>>=0),s=Math.min(a,o),c=this.slice(r,i),u=e.slice(t,n),f=0;f<s;++f)if(c[f]!==u[f]){a=c[f],o=u[f];break}return a<o?-1:o<a?1:0},mn.prototype.includes=function(e,t,n){return-1!==this.indexOf(e,t,n)},mn.prototype.indexOf=function(e,t,n){return Sn(this,e,t,n,!0)},mn.prototype.lastIndexOf=function(e,t,n){return Sn(this,e,t,n,!1)},mn.prototype.write=function(e,t,n,r){if(void 0===t)r="utf8",n=this.length,t=0;else if(void 0===n&&"string"==typeof t)r=t,n=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t|=0,isFinite(n)?(n|=0,void 0===r&&(r="utf8")):(r=n,n=void 0)}var i=this.length-t;if((void 0===n||n>i)&&(n=i),e.length>0&&(n<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");for(var a=!1;;)switch(r){case"hex":return In(this,e,t,n);case"utf8":case"utf-8":return On(this,e,t,n);case"ascii":return xn(this,e,t,n);case"latin1":case"binary":return Cn(this,e,t,n);case"base64":return Mn(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Pn(this,e,t,n);default:if(a)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),a=!0}},mn.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var Dn=4096;function Fn(e,t,n){var r="";n=Math.min(e.length,n);for(var i=t;i<n;++i)r+=String.fromCharCode(127&e[i]);return r}function Ln(e,t,n){var r="";n=Math.min(e.length,n);for(var i=t;i<n;++i)r+=String.fromCharCode(e[i]);return r}function Un(e,t,n){var r=e.length;(!t||t<0)&&(t=0),(!n||n<0||n>r)&&(n=r);for(var i="",a=t;a<n;++a)i+=$n(e[a]);return i}function jn(e,t,n){for(var r=e.slice(t,n),i="",a=0;a<r.length;a+=2)i+=String.fromCharCode(r[a]+256*r[a+1]);return i}function qn(e,t,n){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(e+t>n)throw new RangeError("Trying to access beyond buffer length")}function zn(e,t,n,r,i,a){if(!En(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||t<a)throw new RangeError('"value" argument is out of bounds');if(n+r>e.length)throw new RangeError("Index out of range")}function Hn(e,t,n,r){t<0&&(t=65535+t+1);for(var i=0,a=Math.min(e.length-n,2);i<a;++i)e[n+i]=(t&255<<8*(r?i:1-i))>>>8*(r?i:1-i)}function Gn(e,t,n,r){t<0&&(t=4294967295+t+1);for(var i=0,a=Math.min(e.length-n,4);i<a;++i)e[n+i]=t>>>8*(r?i:3-i)&255}function Vn(e,t,n,r,i,a){if(n+r>e.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function Kn(e,t,n,r,i){return i||Vn(e,0,n,4),fn(e,t,n,r,23,4),n+4}function Wn(e,t,n,r,i){return i||Vn(e,0,n,8),fn(e,t,n,r,52,8),n+8}mn.prototype.slice=function(e,t){var n,r=this.length;if((e=~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),(t=void 0===t?r:~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),t<e&&(t=e),mn.TYPED_ARRAY_SUPPORT)(n=this.subarray(e,t)).__proto__=mn.prototype;else{var i=t-e;n=new mn(i,void 0);for(var a=0;a<i;++a)n[a]=this[a+e]}return n},mn.prototype.readUIntLE=function(e,t,n){e|=0,t|=0,n||qn(e,t,this.length);for(var r=this[e],i=1,a=0;++a<t&&(i*=256);)r+=this[e+a]*i;return r},mn.prototype.readUIntBE=function(e,t,n){e|=0,t|=0,n||qn(e,t,this.length);for(var r=this[e+--t],i=1;t>0&&(i*=256);)r+=this[e+--t]*i;return r},mn.prototype.readUInt8=function(e,t){return t||qn(e,1,this.length),this[e]},mn.prototype.readUInt16LE=function(e,t){return t||qn(e,2,this.length),this[e]|this[e+1]<<8},mn.prototype.readUInt16BE=function(e,t){return t||qn(e,2,this.length),this[e]<<8|this[e+1]},mn.prototype.readUInt32LE=function(e,t){return t||qn(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},mn.prototype.readUInt32BE=function(e,t){return t||qn(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},mn.prototype.readIntLE=function(e,t,n){e|=0,t|=0,n||qn(e,t,this.length);for(var r=this[e],i=1,a=0;++a<t&&(i*=256);)r+=this[e+a]*i;return r>=(i*=128)&&(r-=Math.pow(2,8*t)),r},mn.prototype.readIntBE=function(e,t,n){e|=0,t|=0,n||qn(e,t,this.length);for(var r=t,i=1,a=this[e+--r];r>0&&(i*=256);)a+=this[e+--r]*i;return a>=(i*=128)&&(a-=Math.pow(2,8*t)),a},mn.prototype.readInt8=function(e,t){return t||qn(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},mn.prototype.readInt16LE=function(e,t){t||qn(e,2,this.length);var n=this[e]|this[e+1]<<8;return 32768&n?4294901760|n:n},mn.prototype.readInt16BE=function(e,t){t||qn(e,2,this.length);var n=this[e+1]|this[e]<<8;return 32768&n?4294901760|n:n},mn.prototype.readInt32LE=function(e,t){return t||qn(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},mn.prototype.readInt32BE=function(e,t){return t||qn(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},mn.prototype.readFloatLE=function(e,t){return t||qn(e,4,this.length),un(this,e,!0,23,4)},mn.prototype.readFloatBE=function(e,t){return t||qn(e,4,this.length),un(this,e,!1,23,4)},mn.prototype.readDoubleLE=function(e,t){return t||qn(e,8,this.length),un(this,e,!0,52,8)},mn.prototype.readDoubleBE=function(e,t){return t||qn(e,8,this.length),un(this,e,!1,52,8)},mn.prototype.writeUIntLE=function(e,t,n,r){(e=+e,t|=0,n|=0,r)||zn(this,e,t,n,Math.pow(2,8*n)-1,0);var i=1,a=0;for(this[t]=255&e;++a<n&&(i*=256);)this[t+a]=e/i&255;return t+n},mn.prototype.writeUIntBE=function(e,t,n,r){(e=+e,t|=0,n|=0,r)||zn(this,e,t,n,Math.pow(2,8*n)-1,0);var i=n-1,a=1;for(this[t+i]=255&e;--i>=0&&(a*=256);)this[t+i]=e/a&255;return t+n},mn.prototype.writeUInt8=function(e,t,n){return e=+e,t|=0,n||zn(this,e,t,1,255,0),mn.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},mn.prototype.writeUInt16LE=function(e,t,n){return e=+e,t|=0,n||zn(this,e,t,2,65535,0),mn.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):Hn(this,e,t,!0),t+2},mn.prototype.writeUInt16BE=function(e,t,n){return e=+e,t|=0,n||zn(this,e,t,2,65535,0),mn.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):Hn(this,e,t,!1),t+2},mn.prototype.writeUInt32LE=function(e,t,n){return e=+e,t|=0,n||zn(this,e,t,4,4294967295,0),mn.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):Gn(this,e,t,!0),t+4},mn.prototype.writeUInt32BE=function(e,t,n){return e=+e,t|=0,n||zn(this,e,t,4,4294967295,0),mn.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):Gn(this,e,t,!1),t+4},mn.prototype.writeIntLE=function(e,t,n,r){if(e=+e,t|=0,!r){var i=Math.pow(2,8*n-1);zn(this,e,t,n,i-1,-i)}var a=0,o=1,s=0;for(this[t]=255&e;++a<n&&(o*=256);)e<0&&0===s&&0!==this[t+a-1]&&(s=1),this[t+a]=(e/o>>0)-s&255;return t+n},mn.prototype.writeIntBE=function(e,t,n,r){if(e=+e,t|=0,!r){var i=Math.pow(2,8*n-1);zn(this,e,t,n,i-1,-i)}var a=n-1,o=1,s=0;for(this[t+a]=255&e;--a>=0&&(o*=256);)e<0&&0===s&&0!==this[t+a+1]&&(s=1),this[t+a]=(e/o>>0)-s&255;return t+n},mn.prototype.writeInt8=function(e,t,n){return e=+e,t|=0,n||zn(this,e,t,1,127,-128),mn.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},mn.prototype.writeInt16LE=function(e,t,n){return e=+e,t|=0,n||zn(this,e,t,2,32767,-32768),mn.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):Hn(this,e,t,!0),t+2},mn.prototype.writeInt16BE=function(e,t,n){return e=+e,t|=0,n||zn(this,e,t,2,32767,-32768),mn.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):Hn(this,e,t,!1),t+2},mn.prototype.writeInt32LE=function(e,t,n){return e=+e,t|=0,n||zn(this,e,t,4,2147483647,-2147483648),mn.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):Gn(this,e,t,!0),t+4},mn.prototype.writeInt32BE=function(e,t,n){return e=+e,t|=0,n||zn(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),mn.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):Gn(this,e,t,!1),t+4},mn.prototype.writeFloatLE=function(e,t,n){return Kn(this,e,t,!0,n)},mn.prototype.writeFloatBE=function(e,t,n){return Kn(this,e,t,!1,n)},mn.prototype.writeDoubleLE=function(e,t,n){return Wn(this,e,t,!0,n)},mn.prototype.writeDoubleBE=function(e,t,n){return Wn(this,e,t,!1,n)},mn.prototype.copy=function(e,t,n,r){if(n||(n=0),r||0===r||(r=this.length),t>=e.length&&(t=e.length),t||(t=0),r>0&&r<n&&(r=n),r===n)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("sourceStart out of bounds");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),e.length-t<r-n&&(r=e.length-t+n);var i,a=r-n;if(this===e&&n<t&&t<r)for(i=a-1;i>=0;--i)e[i+t]=this[i+n];else if(a<1e3||!mn.TYPED_ARRAY_SUPPORT)for(i=0;i<a;++i)e[i+t]=this[i+n];else Uint8Array.prototype.set.call(e,this.subarray(n,n+a),t);return a},mn.prototype.fill=function(e,t,n,r){if("string"==typeof e){if("string"==typeof t?(r=t,t=0,n=this.length):"string"==typeof n&&(r=n,n=this.length),1===e.length){var i=e.charCodeAt(0);i<256&&(e=i)}if(void 0!==r&&"string"!=typeof r)throw new TypeError("encoding must be a string");if("string"==typeof r&&!mn.isEncoding(r))throw new TypeError("Unknown encoding: "+r)}else"number"==typeof e&&(e&=255);if(t<0||this.length<t||this.length<n)throw new RangeError("Out of range index");if(n<=t)return this;var a;if(t>>>=0,n=void 0===n?this.length:n>>>0,e||(e=0),"number"==typeof e)for(a=t;a<n;++a)this[a]=e;else{var o=En(e)?e:Jn(new mn(e,r).toString()),s=o.length;for(a=0;a<n-t;++a)this[a+t]=o[a%s]}return this};var Xn=/[^+\/0-9A-Za-z-_]/g;function $n(e){return e<16?"0"+e.toString(16):e.toString(16)}function Jn(e,t){var n;t=t||1/0;for(var r=e.length,i=null,a=[],o=0;o<r;++o){if((n=e.charCodeAt(o))>55295&&n<57344){if(!i){if(n>56319){(t-=3)>-1&&a.push(239,191,189);continue}if(o+1===r){(t-=3)>-1&&a.push(239,191,189);continue}i=n;continue}if(n<56320){(t-=3)>-1&&a.push(239,191,189),i=n;continue}n=65536+(i-55296<<10|n-56320)}else i&&(t-=3)>-1&&a.push(239,191,189);if(i=null,n<128){if((t-=1)<0)break;a.push(n)}else if(n<2048){if((t-=2)<0)break;a.push(n>>6|192,63&n|128)}else if(n<65536){if((t-=3)<0)break;a.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;a.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return a}function Yn(e){return function(e){var t,n,r,i,a,o;an||on();var s=e.length;if(s%4>0)throw new Error("Invalid string. Length must be a multiple of 4");a="="===e[s-2]?2:"="===e[s-1]?1:0,o=new rn(3*s/4-a),r=a>0?s-4:s;var c=0;for(t=0,n=0;t<r;t+=4,n+=3)i=nn[e.charCodeAt(t)]<<18|nn[e.charCodeAt(t+1)]<<12|nn[e.charCodeAt(t+2)]<<6|nn[e.charCodeAt(t+3)],o[c++]=i>>16&255,o[c++]=i>>8&255,o[c++]=255&i;return 2===a?(i=nn[e.charCodeAt(t)]<<2|nn[e.charCodeAt(t+1)]>>4,o[c++]=255&i):1===a&&(i=nn[e.charCodeAt(t)]<<10|nn[e.charCodeAt(t+1)]<<4|nn[e.charCodeAt(t+2)]>>2,o[c++]=i>>8&255,o[c++]=255&i),o}(function(e){if((e=function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}(e).replace(Xn,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function Qn(e,t,n,r){for(var i=0;i<r&&!(i+n>=t.length||i>=e.length);++i)t[i+n]=e[i];return i}function Zn(e){return null!=e&&(!!e._isBuffer||er(e)||function(e){return"function"==typeof e.readFloatLE&&"function"==typeof e.slice&&er(e.slice(0,0))}(e))}function er(e){return!!e.constructor&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)}var tr=Qt(Object.freeze({__proto__:null,Buffer:mn,INSPECT_MAX_BYTES:50,SlowBuffer:function(e){return+e!=e&&(e=0),mn.alloc(+e)},isBuffer:Zn,kMaxLength:pn}));!function(e){!function(e,t){function n(e,t){if(!e)throw new Error(t||"Assertion failed")}function r(e,t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}function i(e,t,n){if(i.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&("le"!==t&&"be"!==t||(n=t,t=10),this._init(e||0,t||10,n||"be"))}var a;"object"==typeof e?e.exports=i:t.BN=i,i.BN=i,i.wordSize=26;try{a="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:tr.Buffer}catch(e){}function o(e,t){var r=e.charCodeAt(t);return r>=48&&r<=57?r-48:r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:void n(!1,"Invalid character in "+e)}function s(e,t,n){var r=o(e,n);return n-1>=t&&(r|=o(e,n-1)<<4),r}function c(e,t,r,i){for(var a=0,o=0,s=Math.min(e.length,r),c=t;c<s;c++){var u=e.charCodeAt(c)-48;a*=i,o=u>=49?u-49+10:u>=17?u-17+10:u,n(u>=0&&o<i,"Invalid character"),a+=o}return a}function u(e,t){e.words=t.words,e.length=t.length,e.negative=t.negative,e.red=t.red}if(i.isBN=function(e){return e instanceof i||null!==e&&"object"==typeof e&&e.constructor.wordSize===i.wordSize&&Array.isArray(e.words)},i.max=function(e,t){return e.cmp(t)>0?e:t},i.min=function(e,t){return e.cmp(t)<0?e:t},i.prototype._init=function(e,t,r){if("number"==typeof e)return this._initNumber(e,t,r);if("object"==typeof e)return this._initArray(e,t,r);"hex"===t&&(t=16),n(t===(0|t)&&t>=2&&t<=36);var i=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(i++,this.negative=1),i<e.length&&(16===t?this._parseHex(e,i,r):(this._parseBase(e,t,i),"le"===r&&this._initArray(this.toArray(),t,r)))},i.prototype._initNumber=function(e,t,r){e<0&&(this.negative=1,e=-e),e<67108864?(this.words=[67108863&e],this.length=1):e<4503599627370496?(this.words=[67108863&e,e/67108864&67108863],this.length=2):(n(e<9007199254740992),this.words=[67108863&e,e/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),t,r)},i.prototype._initArray=function(e,t,r){if(n("number"==typeof e.length),e.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(e.length/3),this.words=new Array(this.length);for(var i=0;i<this.length;i++)this.words[i]=0;var a,o,s=0;if("be"===r)for(i=e.length-1,a=0;i>=0;i-=3)o=e[i]|e[i-1]<<8|e[i-2]<<16,this.words[a]|=o<<s&67108863,this.words[a+1]=o>>>26-s&67108863,(s+=24)>=26&&(s-=26,a++);else if("le"===r)for(i=0,a=0;i<e.length;i+=3)o=e[i]|e[i+1]<<8|e[i+2]<<16,this.words[a]|=o<<s&67108863,this.words[a+1]=o>>>26-s&67108863,(s+=24)>=26&&(s-=26,a++);return this._strip()},i.prototype._parseHex=function(e,t,n){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var r=0;r<this.length;r++)this.words[r]=0;var i,a=0,o=0;if("be"===n)for(r=e.length-1;r>=t;r-=2)i=s(e,t,r)<<a,this.words[o]|=67108863&i,a>=18?(a-=18,o+=1,this.words[o]|=i>>>26):a+=8;else for(r=(e.length-t)%2==0?t+1:t;r<e.length;r+=2)i=s(e,t,r)<<a,this.words[o]|=67108863&i,a>=18?(a-=18,o+=1,this.words[o]|=i>>>26):a+=8;this._strip()},i.prototype._parseBase=function(e,t,n){this.words=[0],this.length=1;for(var r=0,i=1;i<=67108863;i*=t)r++;r--,i=i/t|0;for(var a=e.length-n,o=a%r,s=Math.min(a,a-o)+n,u=0,f=n;f<s;f+=r)u=c(e,f,f+r,t),this.imuln(i),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u);if(0!==o){var d=1;for(u=c(e,f,e.length,t),f=0;f<o;f++)d*=t;this.imuln(d),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u)}this._strip()},i.prototype.copy=function(e){e.words=new Array(this.length);for(var t=0;t<this.length;t++)e.words[t]=this.words[t];e.length=this.length,e.negative=this.negative,e.red=this.red},i.prototype._move=function(e){u(e,this)},i.prototype.clone=function(){var e=new i(null);return this.copy(e),e},i.prototype._expand=function(e){for(;this.length<e;)this.words[this.length++]=0;return this},i.prototype._strip=function(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},i.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},"undefined"!=typeof Symbol&&"function"==typeof Symbol.for)try{i.prototype[Symbol.for("nodejs.util.inspect.custom")]=f}catch(e){i.prototype.inspect=f}else i.prototype.inspect=f;function f(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"}var d=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],l=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],p=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];i.prototype.toString=function(e,t){var r;if(t=0|t||1,16===(e=e||10)||"hex"===e){r="";for(var i=0,a=0,o=0;o<this.length;o++){var s=this.words[o],c=(16777215&(s<<i|a)).toString(16);a=s>>>24-i&16777215,(i+=2)>=26&&(i-=26,o--),r=0!==a||o!==this.length-1?d[6-c.length]+c+r:c+r}for(0!==a&&(r=a.toString(16)+r);r.length%t!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(e===(0|e)&&e>=2&&e<=36){var u=l[e],f=p[e];r="";var h=this.clone();for(h.negative=0;!h.isZero();){var b=h.modrn(f).toString(e);r=(h=h.idivn(f)).isZero()?b+r:d[u-b.length]+b+r}for(this.isZero()&&(r="0"+r);r.length%t!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}n(!1,"Base should be between 2 and 36")},i.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},i.prototype.toJSON=function(){return this.toString(16,2)},a&&(i.prototype.toBuffer=function(e,t){return this.toArrayLike(a,e,t)}),i.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)};function h(e,t,n){n.negative=t.negative^e.negative;var r=e.length+t.length|0;n.length=r,r=r-1|0;var i=0|e.words[0],a=0|t.words[0],o=i*a,s=67108863&o,c=o/67108864|0;n.words[0]=s;for(var u=1;u<r;u++){for(var f=c>>>26,d=67108863&c,l=Math.min(u,t.length-1),p=Math.max(0,u-e.length+1);p<=l;p++){var h=u-p|0;f+=(o=(i=0|e.words[h])*(a=0|t.words[p])+d)/67108864|0,d=67108863&o}n.words[u]=0|d,c=0|f}return 0!==c?n.words[u]=0|c:n.length--,n._strip()}i.prototype.toArrayLike=function(e,t,r){this._strip();var i=this.byteLength(),a=r||Math.max(1,i);n(i<=a,"byte array longer than desired length"),n(a>0,"Requested array length <= 0");var o=function(e,t){return e.allocUnsafe?e.allocUnsafe(t):new e(t)}(e,a);return this["_toArrayLike"+("le"===t?"LE":"BE")](o,i),o},i.prototype._toArrayLikeLE=function(e,t){for(var n=0,r=0,i=0,a=0;i<this.length;i++){var o=this.words[i]<<a|r;e[n++]=255&o,n<e.length&&(e[n++]=o>>8&255),n<e.length&&(e[n++]=o>>16&255),6===a?(n<e.length&&(e[n++]=o>>24&255),r=0,a=0):(r=o>>>24,a+=2)}if(n<e.length)for(e[n++]=r;n<e.length;)e[n++]=0},i.prototype._toArrayLikeBE=function(e,t){for(var n=e.length-1,r=0,i=0,a=0;i<this.length;i++){var o=this.words[i]<<a|r;e[n--]=255&o,n>=0&&(e[n--]=o>>8&255),n>=0&&(e[n--]=o>>16&255),6===a?(n>=0&&(e[n--]=o>>24&255),r=0,a=0):(r=o>>>24,a+=2)}if(n>=0)for(e[n--]=r;n>=0;)e[n--]=0},Math.clz32?i.prototype._countBits=function(e){return 32-Math.clz32(e)}:i.prototype._countBits=function(e){var t=e,n=0;return t>=4096&&(n+=13,t>>>=13),t>=64&&(n+=7,t>>>=7),t>=8&&(n+=4,t>>>=4),t>=2&&(n+=2,t>>>=2),n+t},i.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,n=0;return 0==(8191&t)&&(n+=13,t>>>=13),0==(127&t)&&(n+=7,t>>>=7),0==(15&t)&&(n+=4,t>>>=4),0==(3&t)&&(n+=2,t>>>=2),0==(1&t)&&n++,n},i.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},i.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;t<this.length;t++){var n=this._zeroBits(this.words[t]);if(e+=n,26!==n)break}return e},i.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},i.prototype.toTwos=function(e){return 0!==this.negative?this.abs().inotn(e).iaddn(1):this.clone()},i.prototype.fromTwos=function(e){return this.testn(e-1)?this.notn(e).iaddn(1).ineg():this.clone()},i.prototype.isNeg=function(){return 0!==this.negative},i.prototype.neg=function(){return this.clone().ineg()},i.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},i.prototype.iuor=function(e){for(;this.length<e.length;)this.words[this.length++]=0;for(var t=0;t<e.length;t++)this.words[t]=this.words[t]|e.words[t];return this._strip()},i.prototype.ior=function(e){return n(0==(this.negative|e.negative)),this.iuor(e)},i.prototype.or=function(e){return this.length>e.length?this.clone().ior(e):e.clone().ior(this)},i.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},i.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var n=0;n<t.length;n++)this.words[n]=this.words[n]&e.words[n];return this.length=t.length,this._strip()},i.prototype.iand=function(e){return n(0==(this.negative|e.negative)),this.iuand(e)},i.prototype.and=function(e){return this.length>e.length?this.clone().iand(e):e.clone().iand(this)},i.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},i.prototype.iuxor=function(e){var t,n;this.length>e.length?(t=this,n=e):(t=e,n=this);for(var r=0;r<n.length;r++)this.words[r]=t.words[r]^n.words[r];if(this!==t)for(;r<t.length;r++)this.words[r]=t.words[r];return this.length=t.length,this._strip()},i.prototype.ixor=function(e){return n(0==(this.negative|e.negative)),this.iuxor(e)},i.prototype.xor=function(e){return this.length>e.length?this.clone().ixor(e):e.clone().ixor(this)},i.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},i.prototype.inotn=function(e){n("number"==typeof e&&e>=0);var t=0|Math.ceil(e/26),r=e%26;this._expand(t),r>0&&t--;for(var i=0;i<t;i++)this.words[i]=67108863&~this.words[i];return r>0&&(this.words[i]=~this.words[i]&67108863>>26-r),this._strip()},i.prototype.notn=function(e){return this.clone().inotn(e)},i.prototype.setn=function(e,t){n("number"==typeof e&&e>=0);var r=e/26|0,i=e%26;return this._expand(r+1),this.words[r]=t?this.words[r]|1<<i:this.words[r]&~(1<<i),this._strip()},i.prototype.iadd=function(e){var t,n,r;if(0!==this.negative&&0===e.negative)return this.negative=0,t=this.isub(e),this.negative^=1,this._normSign();if(0===this.negative&&0!==e.negative)return e.negative=0,t=this.isub(e),e.negative=1,t._normSign();this.length>e.length?(n=this,r=e):(n=e,r=this);for(var i=0,a=0;a<r.length;a++)t=(0|n.words[a])+(0|r.words[a])+i,this.words[a]=67108863&t,i=t>>>26;for(;0!==i&&a<n.length;a++)t=(0|n.words[a])+i,this.words[a]=67108863&t,i=t>>>26;if(this.length=n.length,0!==i)this.words[this.length]=i,this.length++;else if(n!==this)for(;a<n.length;a++)this.words[a]=n.words[a];return this},i.prototype.add=function(e){var t;return 0!==e.negative&&0===this.negative?(e.negative=0,t=this.sub(e),e.negative^=1,t):0===e.negative&&0!==this.negative?(this.negative=0,t=e.sub(this),this.negative=1,t):this.length>e.length?this.clone().iadd(e):e.clone().iadd(this)},i.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var n,r,i=this.cmp(e);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(n=this,r=e):(n=e,r=this);for(var a=0,o=0;o<r.length;o++)a=(t=(0|n.words[o])-(0|r.words[o])+a)>>26,this.words[o]=67108863&t;for(;0!==a&&o<n.length;o++)a=(t=(0|n.words[o])+a)>>26,this.words[o]=67108863&t;if(0===a&&o<n.length&&n!==this)for(;o<n.length;o++)this.words[o]=n.words[o];return this.length=Math.max(this.length,o),n!==this&&(this.negative=1),this._strip()},i.prototype.sub=function(e){return this.clone().isub(e)};var b=function(e,t,n){var r,i,a,o=e.words,s=t.words,c=n.words,u=0,f=0|o[0],d=8191&f,l=f>>>13,p=0|o[1],h=8191&p,b=p>>>13,m=0|o[2],y=8191&m,g=m>>>13,v=0|o[3],w=8191&v,_=v>>>13,E=0|o[4],T=8191&E,A=E>>>13,R=0|o[5],S=8191&R,k=R>>>13,I=0|o[6],O=8191&I,x=I>>>13,C=0|o[7],M=8191&C,P=C>>>13,N=0|o[8],B=8191&N,D=N>>>13,F=0|o[9],L=8191&F,U=F>>>13,j=0|s[0],q=8191&j,z=j>>>13,H=0|s[1],G=8191&H,V=H>>>13,K=0|s[2],W=8191&K,X=K>>>13,$=0|s[3],J=8191&$,Y=$>>>13,Q=0|s[4],Z=8191&Q,ee=Q>>>13,te=0|s[5],ne=8191&te,re=te>>>13,ie=0|s[6],ae=8191&ie,oe=ie>>>13,se=0|s[7],ce=8191&se,ue=se>>>13,fe=0|s[8],de=8191&fe,le=fe>>>13,pe=0|s[9],he=8191&pe,be=pe>>>13;n.negative=e.negative^t.negative,n.length=19;var me=(u+(r=Math.imul(d,q))|0)+((8191&(i=(i=Math.imul(d,z))+Math.imul(l,q)|0))<<13)|0;u=((a=Math.imul(l,z))+(i>>>13)|0)+(me>>>26)|0,me&=67108863,r=Math.imul(h,q),i=(i=Math.imul(h,z))+Math.imul(b,q)|0,a=Math.imul(b,z);var ye=(u+(r=r+Math.imul(d,G)|0)|0)+((8191&(i=(i=i+Math.imul(d,V)|0)+Math.imul(l,G)|0))<<13)|0;u=((a=a+Math.imul(l,V)|0)+(i>>>13)|0)+(ye>>>26)|0,ye&=67108863,r=Math.imul(y,q),i=(i=Math.imul(y,z))+Math.imul(g,q)|0,a=Math.imul(g,z),r=r+Math.imul(h,G)|0,i=(i=i+Math.imul(h,V)|0)+Math.imul(b,G)|0,a=a+Math.imul(b,V)|0;var ge=(u+(r=r+Math.imul(d,W)|0)|0)+((8191&(i=(i=i+Math.imul(d,X)|0)+Math.imul(l,W)|0))<<13)|0;u=((a=a+Math.imul(l,X)|0)+(i>>>13)|0)+(ge>>>26)|0,ge&=67108863,r=Math.imul(w,q),i=(i=Math.imul(w,z))+Math.imul(_,q)|0,a=Math.imul(_,z),r=r+Math.imul(y,G)|0,i=(i=i+Math.imul(y,V)|0)+Math.imul(g,G)|0,a=a+Math.imul(g,V)|0,r=r+Math.imul(h,W)|0,i=(i=i+Math.imul(h,X)|0)+Math.imul(b,W)|0,a=a+Math.imul(b,X)|0;var ve=(u+(r=r+Math.imul(d,J)|0)|0)+((8191&(i=(i=i+Math.imul(d,Y)|0)+Math.imul(l,J)|0))<<13)|0;u=((a=a+Math.imul(l,Y)|0)+(i>>>13)|0)+(ve>>>26)|0,ve&=67108863,r=Math.imul(T,q),i=(i=Math.imul(T,z))+Math.imul(A,q)|0,a=Math.imul(A,z),r=r+Math.imul(w,G)|0,i=(i=i+Math.imul(w,V)|0)+Math.imul(_,G)|0,a=a+Math.imul(_,V)|0,r=r+Math.imul(y,W)|0,i=(i=i+Math.imul(y,X)|0)+Math.imul(g,W)|0,a=a+Math.imul(g,X)|0,r=r+Math.imul(h,J)|0,i=(i=i+Math.imul(h,Y)|0)+Math.imul(b,J)|0,a=a+Math.imul(b,Y)|0;var we=(u+(r=r+Math.imul(d,Z)|0)|0)+((8191&(i=(i=i+Math.imul(d,ee)|0)+Math.imul(l,Z)|0))<<13)|0;u=((a=a+Math.imul(l,ee)|0)+(i>>>13)|0)+(we>>>26)|0,we&=67108863,r=Math.imul(S,q),i=(i=Math.imul(S,z))+Math.imul(k,q)|0,a=Math.imul(k,z),r=r+Math.imul(T,G)|0,i=(i=i+Math.imul(T,V)|0)+Math.imul(A,G)|0,a=a+Math.imul(A,V)|0,r=r+Math.imul(w,W)|0,i=(i=i+Math.imul(w,X)|0)+Math.imul(_,W)|0,a=a+Math.imul(_,X)|0,r=r+Math.imul(y,J)|0,i=(i=i+Math.imul(y,Y)|0)+Math.imul(g,J)|0,a=a+Math.imul(g,Y)|0,r=r+Math.imul(h,Z)|0,i=(i=i+Math.imul(h,ee)|0)+Math.imul(b,Z)|0,a=a+Math.imul(b,ee)|0;var _e=(u+(r=r+Math.imul(d,ne)|0)|0)+((8191&(i=(i=i+Math.imul(d,re)|0)+Math.imul(l,ne)|0))<<13)|0;u=((a=a+Math.imul(l,re)|0)+(i>>>13)|0)+(_e>>>26)|0,_e&=67108863,r=Math.imul(O,q),i=(i=Math.imul(O,z))+Math.imul(x,q)|0,a=Math.imul(x,z),r=r+Math.imul(S,G)|0,i=(i=i+Math.imul(S,V)|0)+Math.imul(k,G)|0,a=a+Math.imul(k,V)|0,r=r+Math.imul(T,W)|0,i=(i=i+Math.imul(T,X)|0)+Math.imul(A,W)|0,a=a+Math.imul(A,X)|0,r=r+Math.imul(w,J)|0,i=(i=i+Math.imul(w,Y)|0)+Math.imul(_,J)|0,a=a+Math.imul(_,Y)|0,r=r+Math.imul(y,Z)|0,i=(i=i+Math.imul(y,ee)|0)+Math.imul(g,Z)|0,a=a+Math.imul(g,ee)|0,r=r+Math.imul(h,ne)|0,i=(i=i+Math.imul(h,re)|0)+Math.imul(b,ne)|0,a=a+Math.imul(b,re)|0;var Ee=(u+(r=r+Math.imul(d,ae)|0)|0)+((8191&(i=(i=i+Math.imul(d,oe)|0)+Math.imul(l,ae)|0))<<13)|0;u=((a=a+Math.imul(l,oe)|0)+(i>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,r=Math.imul(M,q),i=(i=Math.imul(M,z))+Math.imul(P,q)|0,a=Math.imul(P,z),r=r+Math.imul(O,G)|0,i=(i=i+Math.imul(O,V)|0)+Math.imul(x,G)|0,a=a+Math.imul(x,V)|0,r=r+Math.imul(S,W)|0,i=(i=i+Math.imul(S,X)|0)+Math.imul(k,W)|0,a=a+Math.imul(k,X)|0,r=r+Math.imul(T,J)|0,i=(i=i+Math.imul(T,Y)|0)+Math.imul(A,J)|0,a=a+Math.imul(A,Y)|0,r=r+Math.imul(w,Z)|0,i=(i=i+Math.imul(w,ee)|0)+Math.imul(_,Z)|0,a=a+Math.imul(_,ee)|0,r=r+Math.imul(y,ne)|0,i=(i=i+Math.imul(y,re)|0)+Math.imul(g,ne)|0,a=a+Math.imul(g,re)|0,r=r+Math.imul(h,ae)|0,i=(i=i+Math.imul(h,oe)|0)+Math.imul(b,ae)|0,a=a+Math.imul(b,oe)|0;var Te=(u+(r=r+Math.imul(d,ce)|0)|0)+((8191&(i=(i=i+Math.imul(d,ue)|0)+Math.imul(l,ce)|0))<<13)|0;u=((a=a+Math.imul(l,ue)|0)+(i>>>13)|0)+(Te>>>26)|0,Te&=67108863,r=Math.imul(B,q),i=(i=Math.imul(B,z))+Math.imul(D,q)|0,a=Math.imul(D,z),r=r+Math.imul(M,G)|0,i=(i=i+Math.imul(M,V)|0)+Math.imul(P,G)|0,a=a+Math.imul(P,V)|0,r=r+Math.imul(O,W)|0,i=(i=i+Math.imul(O,X)|0)+Math.imul(x,W)|0,a=a+Math.imul(x,X)|0,r=r+Math.imul(S,J)|0,i=(i=i+Math.imul(S,Y)|0)+Math.imul(k,J)|0,a=a+Math.imul(k,Y)|0,r=r+Math.imul(T,Z)|0,i=(i=i+Math.imul(T,ee)|0)+Math.imul(A,Z)|0,a=a+Math.imul(A,ee)|0,r=r+Math.imul(w,ne)|0,i=(i=i+Math.imul(w,re)|0)+Math.imul(_,ne)|0,a=a+Math.imul(_,re)|0,r=r+Math.imul(y,ae)|0,i=(i=i+Math.imul(y,oe)|0)+Math.imul(g,ae)|0,a=a+Math.imul(g,oe)|0,r=r+Math.imul(h,ce)|0,i=(i=i+Math.imul(h,ue)|0)+Math.imul(b,ce)|0,a=a+Math.imul(b,ue)|0;var Ae=(u+(r=r+Math.imul(d,de)|0)|0)+((8191&(i=(i=i+Math.imul(d,le)|0)+Math.imul(l,de)|0))<<13)|0;u=((a=a+Math.imul(l,le)|0)+(i>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,r=Math.imul(L,q),i=(i=Math.imul(L,z))+Math.imul(U,q)|0,a=Math.imul(U,z),r=r+Math.imul(B,G)|0,i=(i=i+Math.imul(B,V)|0)+Math.imul(D,G)|0,a=a+Math.imul(D,V)|0,r=r+Math.imul(M,W)|0,i=(i=i+Math.imul(M,X)|0)+Math.imul(P,W)|0,a=a+Math.imul(P,X)|0,r=r+Math.imul(O,J)|0,i=(i=i+Math.imul(O,Y)|0)+Math.imul(x,J)|0,a=a+Math.imul(x,Y)|0,r=r+Math.imul(S,Z)|0,i=(i=i+Math.imul(S,ee)|0)+Math.imul(k,Z)|0,a=a+Math.imul(k,ee)|0,r=r+Math.imul(T,ne)|0,i=(i=i+Math.imul(T,re)|0)+Math.imul(A,ne)|0,a=a+Math.imul(A,re)|0,r=r+Math.imul(w,ae)|0,i=(i=i+Math.imul(w,oe)|0)+Math.imul(_,ae)|0,a=a+Math.imul(_,oe)|0,r=r+Math.imul(y,ce)|0,i=(i=i+Math.imul(y,ue)|0)+Math.imul(g,ce)|0,a=a+Math.imul(g,ue)|0,r=r+Math.imul(h,de)|0,i=(i=i+Math.imul(h,le)|0)+Math.imul(b,de)|0,a=a+Math.imul(b,le)|0;var Re=(u+(r=r+Math.imul(d,he)|0)|0)+((8191&(i=(i=i+Math.imul(d,be)|0)+Math.imul(l,he)|0))<<13)|0;u=((a=a+Math.imul(l,be)|0)+(i>>>13)|0)+(Re>>>26)|0,Re&=67108863,r=Math.imul(L,G),i=(i=Math.imul(L,V))+Math.imul(U,G)|0,a=Math.imul(U,V),r=r+Math.imul(B,W)|0,i=(i=i+Math.imul(B,X)|0)+Math.imul(D,W)|0,a=a+Math.imul(D,X)|0,r=r+Math.imul(M,J)|0,i=(i=i+Math.imul(M,Y)|0)+Math.imul(P,J)|0,a=a+Math.imul(P,Y)|0,r=r+Math.imul(O,Z)|0,i=(i=i+Math.imul(O,ee)|0)+Math.imul(x,Z)|0,a=a+Math.imul(x,ee)|0,r=r+Math.imul(S,ne)|0,i=(i=i+Math.imul(S,re)|0)+Math.imul(k,ne)|0,a=a+Math.imul(k,re)|0,r=r+Math.imul(T,ae)|0,i=(i=i+Math.imul(T,oe)|0)+Math.imul(A,ae)|0,a=a+Math.imul(A,oe)|0,r=r+Math.imul(w,ce)|0,i=(i=i+Math.imul(w,ue)|0)+Math.imul(_,ce)|0,a=a+Math.imul(_,ue)|0,r=r+Math.imul(y,de)|0,i=(i=i+Math.imul(y,le)|0)+Math.imul(g,de)|0,a=a+Math.imul(g,le)|0;var Se=(u+(r=r+Math.imul(h,he)|0)|0)+((8191&(i=(i=i+Math.imul(h,be)|0)+Math.imul(b,he)|0))<<13)|0;u=((a=a+Math.imul(b,be)|0)+(i>>>13)|0)+(Se>>>26)|0,Se&=67108863,r=Math.imul(L,W),i=(i=Math.imul(L,X))+Math.imul(U,W)|0,a=Math.imul(U,X),r=r+Math.imul(B,J)|0,i=(i=i+Math.imul(B,Y)|0)+Math.imul(D,J)|0,a=a+Math.imul(D,Y)|0,r=r+Math.imul(M,Z)|0,i=(i=i+Math.imul(M,ee)|0)+Math.imul(P,Z)|0,a=a+Math.imul(P,ee)|0,r=r+Math.imul(O,ne)|0,i=(i=i+Math.imul(O,re)|0)+Math.imul(x,ne)|0,a=a+Math.imul(x,re)|0,r=r+Math.imul(S,ae)|0,i=(i=i+Math.imul(S,oe)|0)+Math.imul(k,ae)|0,a=a+Math.imul(k,oe)|0,r=r+Math.imul(T,ce)|0,i=(i=i+Math.imul(T,ue)|0)+Math.imul(A,ce)|0,a=a+Math.imul(A,ue)|0,r=r+Math.imul(w,de)|0,i=(i=i+Math.imul(w,le)|0)+Math.imul(_,de)|0,a=a+Math.imul(_,le)|0;var ke=(u+(r=r+Math.imul(y,he)|0)|0)+((8191&(i=(i=i+Math.imul(y,be)|0)+Math.imul(g,he)|0))<<13)|0;u=((a=a+Math.imul(g,be)|0)+(i>>>13)|0)+(ke>>>26)|0,ke&=67108863,r=Math.imul(L,J),i=(i=Math.imul(L,Y))+Math.imul(U,J)|0,a=Math.imul(U,Y),r=r+Math.imul(B,Z)|0,i=(i=i+Math.imul(B,ee)|0)+Math.imul(D,Z)|0,a=a+Math.imul(D,ee)|0,r=r+Math.imul(M,ne)|0,i=(i=i+Math.imul(M,re)|0)+Math.imul(P,ne)|0,a=a+Math.imul(P,re)|0,r=r+Math.imul(O,ae)|0,i=(i=i+Math.imul(O,oe)|0)+Math.imul(x,ae)|0,a=a+Math.imul(x,oe)|0,r=r+Math.imul(S,ce)|0,i=(i=i+Math.imul(S,ue)|0)+Math.imul(k,ce)|0,a=a+Math.imul(k,ue)|0,r=r+Math.imul(T,de)|0,i=(i=i+Math.imul(T,le)|0)+Math.imul(A,de)|0,a=a+Math.imul(A,le)|0;var Ie=(u+(r=r+Math.imul(w,he)|0)|0)+((8191&(i=(i=i+Math.imul(w,be)|0)+Math.imul(_,he)|0))<<13)|0;u=((a=a+Math.imul(_,be)|0)+(i>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,r=Math.imul(L,Z),i=(i=Math.imul(L,ee))+Math.imul(U,Z)|0,a=Math.imul(U,ee),r=r+Math.imul(B,ne)|0,i=(i=i+Math.imul(B,re)|0)+Math.imul(D,ne)|0,a=a+Math.imul(D,re)|0,r=r+Math.imul(M,ae)|0,i=(i=i+Math.imul(M,oe)|0)+Math.imul(P,ae)|0,a=a+Math.imul(P,oe)|0,r=r+Math.imul(O,ce)|0,i=(i=i+Math.imul(O,ue)|0)+Math.imul(x,ce)|0,a=a+Math.imul(x,ue)|0,r=r+Math.imul(S,de)|0,i=(i=i+Math.imul(S,le)|0)+Math.imul(k,de)|0,a=a+Math.imul(k,le)|0;var Oe=(u+(r=r+Math.imul(T,he)|0)|0)+((8191&(i=(i=i+Math.imul(T,be)|0)+Math.imul(A,he)|0))<<13)|0;u=((a=a+Math.imul(A,be)|0)+(i>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,r=Math.imul(L,ne),i=(i=Math.imul(L,re))+Math.imul(U,ne)|0,a=Math.imul(U,re),r=r+Math.imul(B,ae)|0,i=(i=i+Math.imul(B,oe)|0)+Math.imul(D,ae)|0,a=a+Math.imul(D,oe)|0,r=r+Math.imul(M,ce)|0,i=(i=i+Math.imul(M,ue)|0)+Math.imul(P,ce)|0,a=a+Math.imul(P,ue)|0,r=r+Math.imul(O,de)|0,i=(i=i+Math.imul(O,le)|0)+Math.imul(x,de)|0,a=a+Math.imul(x,le)|0;var xe=(u+(r=r+Math.imul(S,he)|0)|0)+((8191&(i=(i=i+Math.imul(S,be)|0)+Math.imul(k,he)|0))<<13)|0;u=((a=a+Math.imul(k,be)|0)+(i>>>13)|0)+(xe>>>26)|0,xe&=67108863,r=Math.imul(L,ae),i=(i=Math.imul(L,oe))+Math.imul(U,ae)|0,a=Math.imul(U,oe),r=r+Math.imul(B,ce)|0,i=(i=i+Math.imul(B,ue)|0)+Math.imul(D,ce)|0,a=a+Math.imul(D,ue)|0,r=r+Math.imul(M,de)|0,i=(i=i+Math.imul(M,le)|0)+Math.imul(P,de)|0,a=a+Math.imul(P,le)|0;var Ce=(u+(r=r+Math.imul(O,he)|0)|0)+((8191&(i=(i=i+Math.imul(O,be)|0)+Math.imul(x,he)|0))<<13)|0;u=((a=a+Math.imul(x,be)|0)+(i>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,r=Math.imul(L,ce),i=(i=Math.imul(L,ue))+Math.imul(U,ce)|0,a=Math.imul(U,ue),r=r+Math.imul(B,de)|0,i=(i=i+Math.imul(B,le)|0)+Math.imul(D,de)|0,a=a+Math.imul(D,le)|0;var Me=(u+(r=r+Math.imul(M,he)|0)|0)+((8191&(i=(i=i+Math.imul(M,be)|0)+Math.imul(P,he)|0))<<13)|0;u=((a=a+Math.imul(P,be)|0)+(i>>>13)|0)+(Me>>>26)|0,Me&=67108863,r=Math.imul(L,de),i=(i=Math.imul(L,le))+Math.imul(U,de)|0,a=Math.imul(U,le);var Pe=(u+(r=r+Math.imul(B,he)|0)|0)+((8191&(i=(i=i+Math.imul(B,be)|0)+Math.imul(D,he)|0))<<13)|0;u=((a=a+Math.imul(D,be)|0)+(i>>>13)|0)+(Pe>>>26)|0,Pe&=67108863;var Ne=(u+(r=Math.imul(L,he))|0)+((8191&(i=(i=Math.imul(L,be))+Math.imul(U,he)|0))<<13)|0;return u=((a=Math.imul(U,be))+(i>>>13)|0)+(Ne>>>26)|0,Ne&=67108863,c[0]=me,c[1]=ye,c[2]=ge,c[3]=ve,c[4]=we,c[5]=_e,c[6]=Ee,c[7]=Te,c[8]=Ae,c[9]=Re,c[10]=Se,c[11]=ke,c[12]=Ie,c[13]=Oe,c[14]=xe,c[15]=Ce,c[16]=Me,c[17]=Pe,c[18]=Ne,0!==u&&(c[19]=u,n.length++),n};function m(e,t,n){n.negative=t.negative^e.negative,n.length=e.length+t.length;for(var r=0,i=0,a=0;a<n.length-1;a++){var o=i;i=0;for(var s=67108863&r,c=Math.min(a,t.length-1),u=Math.max(0,a-e.length+1);u<=c;u++){var f=a-u,d=(0|e.words[f])*(0|t.words[u]),l=67108863&d;s=67108863&(l=l+s|0),i+=(o=(o=o+(d/67108864|0)|0)+(l>>>26)|0)>>>26,o&=67108863}n.words[a]=s,r=o,o=i}return 0!==r?n.words[a]=r:n.length--,n._strip()}function y(e,t,n){return m(e,t,n)}Math.imul||(b=h),i.prototype.mulTo=function(e,t){var n=this.length+e.length;return 10===this.length&&10===e.length?b(this,e,t):n<63?h(this,e,t):n<1024?m(this,e,t):y(this,e,t)},i.prototype.mul=function(e){var t=new i(null);return t.words=new Array(this.length+e.length),this.mulTo(e,t)},i.prototype.mulf=function(e){var t=new i(null);return t.words=new Array(this.length+e.length),y(this,e,t)},i.prototype.imul=function(e){return this.clone().mulTo(e,this)},i.prototype.imuln=function(e){var t=e<0;t&&(e=-e),n("number"==typeof e),n(e<67108864);for(var r=0,i=0;i<this.length;i++){var a=(0|this.words[i])*e,o=(67108863&a)+(67108863&r);r>>=26,r+=a/67108864|0,r+=o>>>26,this.words[i]=67108863&o}return 0!==r&&(this.words[i]=r,this.length++),t?this.ineg():this},i.prototype.muln=function(e){return this.clone().imuln(e)},i.prototype.sqr=function(){return this.mul(this)},i.prototype.isqr=function(){return this.imul(this.clone())},i.prototype.pow=function(e){var t=function(e){for(var t=new Array(e.bitLength()),n=0;n<t.length;n++){var r=n/26|0,i=n%26;t[n]=e.words[r]>>>i&1}return t}(e);if(0===t.length)return new i(1);for(var n=this,r=0;r<t.length&&0===t[r];r++,n=n.sqr());if(++r<t.length)for(var a=n.sqr();r<t.length;r++,a=a.sqr())0!==t[r]&&(n=n.mul(a));return n},i.prototype.iushln=function(e){n("number"==typeof e&&e>=0);var t,r=e%26,i=(e-r)/26,a=67108863>>>26-r<<26-r;if(0!==r){var o=0;for(t=0;t<this.length;t++){var s=this.words[t]&a,c=(0|this.words[t])-s<<r;this.words[t]=c|o,o=s>>>26-r}o&&(this.words[t]=o,this.length++)}if(0!==i){for(t=this.length-1;t>=0;t--)this.words[t+i]=this.words[t];for(t=0;t<i;t++)this.words[t]=0;this.length+=i}return this._strip()},i.prototype.ishln=function(e){return n(0===this.negative),this.iushln(e)},i.prototype.iushrn=function(e,t,r){var i;n("number"==typeof e&&e>=0),i=t?(t-t%26)/26:0;var a=e%26,o=Math.min((e-a)/26,this.length),s=67108863^67108863>>>a<<a,c=r;if(i-=o,i=Math.max(0,i),c){for(var u=0;u<o;u++)c.words[u]=this.words[u];c.length=o}if(0===o);else if(this.length>o)for(this.length-=o,u=0;u<this.length;u++)this.words[u]=this.words[u+o];else this.words[0]=0,this.length=1;var f=0;for(u=this.length-1;u>=0&&(0!==f||u>=i);u--){var d=0|this.words[u];this.words[u]=f<<26-a|d>>>a,f=d&s}return c&&0!==f&&(c.words[c.length++]=f),0===this.length&&(this.words[0]=0,this.length=1),this._strip()},i.prototype.ishrn=function(e,t,r){return n(0===this.negative),this.iushrn(e,t,r)},i.prototype.shln=function(e){return this.clone().ishln(e)},i.prototype.ushln=function(e){return this.clone().iushln(e)},i.prototype.shrn=function(e){return this.clone().ishrn(e)},i.prototype.ushrn=function(e){return this.clone().iushrn(e)},i.prototype.testn=function(e){n("number"==typeof e&&e>=0);var t=e%26,r=(e-t)/26,i=1<<t;return!(this.length<=r)&&!!(this.words[r]&i)},i.prototype.imaskn=function(e){n("number"==typeof e&&e>=0);var t=e%26,r=(e-t)/26;if(n(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==t&&r++,this.length=Math.min(r,this.length),0!==t){var i=67108863^67108863>>>t<<t;this.words[this.length-1]&=i}return this._strip()},i.prototype.maskn=function(e){return this.clone().imaskn(e)},i.prototype.iaddn=function(e){return n("number"==typeof e),n(e<67108864),e<0?this.isubn(-e):0!==this.negative?1===this.length&&(0|this.words[0])<=e?(this.words[0]=e-(0|this.words[0]),this.negative=0,this):(this.negative=0,this.isubn(e),this.negative=1,this):this._iaddn(e)},i.prototype._iaddn=function(e){this.words[0]+=e;for(var t=0;t<this.length&&this.words[t]>=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},i.prototype.isubn=function(e){if(n("number"==typeof e),n(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t<this.length&&this.words[t]<0;t++)this.words[t]+=67108864,this.words[t+1]-=1;return this._strip()},i.prototype.addn=function(e){return this.clone().iaddn(e)},i.prototype.subn=function(e){return this.clone().isubn(e)},i.prototype.iabs=function(){return this.negative=0,this},i.prototype.abs=function(){return this.clone().iabs()},i.prototype._ishlnsubmul=function(e,t,r){var i,a,o=e.length+r;this._expand(o);var s=0;for(i=0;i<e.length;i++){a=(0|this.words[i+r])+s;var c=(0|e.words[i])*t;s=((a-=67108863&c)>>26)-(c/67108864|0),this.words[i+r]=67108863&a}for(;i<this.length-r;i++)s=(a=(0|this.words[i+r])+s)>>26,this.words[i+r]=67108863&a;if(0===s)return this._strip();for(n(-1===s),s=0,i=0;i<this.length;i++)s=(a=-(0|this.words[i])+s)>>26,this.words[i]=67108863&a;return this.negative=1,this._strip()},i.prototype._wordDiv=function(e,t){var n=(this.length,e.length),r=this.clone(),a=e,o=0|a.words[a.length-1];0!==(n=26-this._countBits(o))&&(a=a.ushln(n),r.iushln(n),o=0|a.words[a.length-1]);var s,c=r.length-a.length;if("mod"!==t){(s=new i(null)).length=c+1,s.words=new Array(s.length);for(var u=0;u<s.length;u++)s.words[u]=0}var f=r.clone()._ishlnsubmul(a,1,c);0===f.negative&&(r=f,s&&(s.words[c]=1));for(var d=c-1;d>=0;d--){var l=67108864*(0|r.words[a.length+d])+(0|r.words[a.length+d-1]);for(l=Math.min(l/o|0,67108863),r._ishlnsubmul(a,l,d);0!==r.negative;)l--,r.negative=0,r._ishlnsubmul(a,1,d),r.isZero()||(r.negative^=1);s&&(s.words[d]=l)}return s&&s._strip(),r._strip(),"div"!==t&&0!==n&&r.iushrn(n),{div:s||null,mod:r}},i.prototype.divmod=function(e,t,r){return n(!e.isZero()),this.isZero()?{div:new i(0),mod:new i(0)}:0!==this.negative&&0===e.negative?(s=this.neg().divmod(e,t),"mod"!==t&&(a=s.div.neg()),"div"!==t&&(o=s.mod.neg(),r&&0!==o.negative&&o.iadd(e)),{div:a,mod:o}):0===this.negative&&0!==e.negative?(s=this.divmod(e.neg(),t),"mod"!==t&&(a=s.div.neg()),{div:a,mod:s.mod}):0!=(this.negative&e.negative)?(s=this.neg().divmod(e.neg(),t),"div"!==t&&(o=s.mod.neg(),r&&0!==o.negative&&o.isub(e)),{div:s.div,mod:o}):e.length>this.length||this.cmp(e)<0?{div:new i(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new i(this.modrn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new i(this.modrn(e.words[0]))}:this._wordDiv(e,t);var a,o,s},i.prototype.div=function(e){return this.divmod(e,"div",!1).div},i.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},i.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},i.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var n=0!==t.div.negative?t.mod.isub(e):t.mod,r=e.ushrn(1),i=e.andln(1),a=n.cmp(r);return a<0||1===i&&0===a?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},i.prototype.modrn=function(e){var t=e<0;t&&(e=-e),n(e<=67108863);for(var r=(1<<26)%e,i=0,a=this.length-1;a>=0;a--)i=(r*i+(0|this.words[a]))%e;return t?-i:i},i.prototype.modn=function(e){return this.modrn(e)},i.prototype.idivn=function(e){var t=e<0;t&&(e=-e),n(e<=67108863);for(var r=0,i=this.length-1;i>=0;i--){var a=(0|this.words[i])+67108864*r;this.words[i]=a/e|0,r=a%e}return this._strip(),t?this.ineg():this},i.prototype.divn=function(e){return this.clone().idivn(e)},i.prototype.egcd=function(e){n(0===e.negative),n(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var a=new i(1),o=new i(0),s=new i(0),c=new i(1),u=0;t.isEven()&&r.isEven();)t.iushrn(1),r.iushrn(1),++u;for(var f=r.clone(),d=t.clone();!t.isZero();){for(var l=0,p=1;0==(t.words[0]&p)&&l<26;++l,p<<=1);if(l>0)for(t.iushrn(l);l-- >0;)(a.isOdd()||o.isOdd())&&(a.iadd(f),o.isub(d)),a.iushrn(1),o.iushrn(1);for(var h=0,b=1;0==(r.words[0]&b)&&h<26;++h,b<<=1);if(h>0)for(r.iushrn(h);h-- >0;)(s.isOdd()||c.isOdd())&&(s.iadd(f),c.isub(d)),s.iushrn(1),c.iushrn(1);t.cmp(r)>=0?(t.isub(r),a.isub(s),o.isub(c)):(r.isub(t),s.isub(a),c.isub(o))}return{a:s,b:c,gcd:r.iushln(u)}},i.prototype._invmp=function(e){n(0===e.negative),n(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var a,o=new i(1),s=new i(0),c=r.clone();t.cmpn(1)>0&&r.cmpn(1)>0;){for(var u=0,f=1;0==(t.words[0]&f)&&u<26;++u,f<<=1);if(u>0)for(t.iushrn(u);u-- >0;)o.isOdd()&&o.iadd(c),o.iushrn(1);for(var d=0,l=1;0==(r.words[0]&l)&&d<26;++d,l<<=1);if(d>0)for(r.iushrn(d);d-- >0;)s.isOdd()&&s.iadd(c),s.iushrn(1);t.cmp(r)>=0?(t.isub(r),o.isub(s)):(r.isub(t),s.isub(o))}return(a=0===t.cmpn(1)?o:s).cmpn(0)<0&&a.iadd(e),a},i.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),n=e.clone();t.negative=0,n.negative=0;for(var r=0;t.isEven()&&n.isEven();r++)t.iushrn(1),n.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;n.isEven();)n.iushrn(1);var i=t.cmp(n);if(i<0){var a=t;t=n,n=a}else if(0===i||0===n.cmpn(1))break;t.isub(n)}return n.iushln(r)},i.prototype.invm=function(e){return this.egcd(e).a.umod(e)},i.prototype.isEven=function(){return 0==(1&this.words[0])},i.prototype.isOdd=function(){return 1==(1&this.words[0])},i.prototype.andln=function(e){return this.words[0]&e},i.prototype.bincn=function(e){n("number"==typeof e);var t=e%26,r=(e-t)/26,i=1<<t;if(this.length<=r)return this._expand(r+1),this.words[r]|=i,this;for(var a=i,o=r;0!==a&&o<this.length;o++){var s=0|this.words[o];a=(s+=a)>>>26,s&=67108863,this.words[o]=s}return 0!==a&&(this.words[o]=a,this.length++),this},i.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},i.prototype.cmpn=function(e){var t,r=e<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this._strip(),this.length>1)t=1;else{r&&(e=-e),n(e<=67108863,"Number is too big");var i=0|this.words[0];t=i===e?0:i<e?-1:1}return 0!==this.negative?0|-t:t},i.prototype.cmp=function(e){if(0!==this.negative&&0===e.negative)return-1;if(0===this.negative&&0!==e.negative)return 1;var t=this.ucmp(e);return 0!==this.negative?0|-t:t},i.prototype.ucmp=function(e){if(this.length>e.length)return 1;if(this.length<e.length)return-1;for(var t=0,n=this.length-1;n>=0;n--){var r=0|this.words[n],i=0|e.words[n];if(r!==i){r<i?t=-1:r>i&&(t=1);break}}return t},i.prototype.gtn=function(e){return 1===this.cmpn(e)},i.prototype.gt=function(e){return 1===this.cmp(e)},i.prototype.gten=function(e){return this.cmpn(e)>=0},i.prototype.gte=function(e){return this.cmp(e)>=0},i.prototype.ltn=function(e){return-1===this.cmpn(e)},i.prototype.lt=function(e){return-1===this.cmp(e)},i.prototype.lten=function(e){return this.cmpn(e)<=0},i.prototype.lte=function(e){return this.cmp(e)<=0},i.prototype.eqn=function(e){return 0===this.cmpn(e)},i.prototype.eq=function(e){return 0===this.cmp(e)},i.red=function(e){return new A(e)},i.prototype.toRed=function(e){return n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},i.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},i.prototype._forceRed=function(e){return this.red=e,this},i.prototype.forceRed=function(e){return n(!this.red,"Already a number in reduction context"),this._forceRed(e)},i.prototype.redAdd=function(e){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},i.prototype.redIAdd=function(e){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},i.prototype.redSub=function(e){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},i.prototype.redISub=function(e){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},i.prototype.redShl=function(e){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},i.prototype.redMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},i.prototype.redIMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},i.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},i.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},i.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},i.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},i.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},i.prototype.redPow=function(e){return n(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var g={k256:null,p224:null,p192:null,p25519:null};function v(e,t){this.name=e,this.p=new i(t,16),this.n=this.p.bitLength(),this.k=new i(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function w(){v.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function _(){v.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function E(){v.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function T(){v.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function A(e){if("string"==typeof e){var t=i._prime(e);this.m=t.p,this.prime=t}else n(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function R(e){A.call(this,e),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new i(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}v.prototype._tmp=function(){var e=new i(null);return e.words=new Array(Math.ceil(this.n/13)),e},v.prototype.ireduce=function(e){var t,n=e;do{this.split(n,this.tmp),t=(n=(n=this.imulK(n)).iadd(this.tmp)).bitLength()}while(t>this.n);var r=t<this.n?-1:n.ucmp(this.p);return 0===r?(n.words[0]=0,n.length=1):r>0?n.isub(this.p):void 0!==n.strip?n.strip():n._strip(),n},v.prototype.split=function(e,t){e.iushrn(this.n,0,t)},v.prototype.imulK=function(e){return e.imul(this.k)},r(w,v),w.prototype.split=function(e,t){for(var n=4194303,r=Math.min(e.length,9),i=0;i<r;i++)t.words[i]=e.words[i];if(t.length=r,e.length<=9)return e.words[0]=0,void(e.length=1);var a=e.words[9];for(t.words[t.length++]=a&n,i=10;i<e.length;i++){var o=0|e.words[i];e.words[i-10]=(o&n)<<4|a>>>22,a=o}a>>>=22,e.words[i-10]=a,0===a&&e.length>10?e.length-=10:e.length-=9},w.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,n=0;n<e.length;n++){var r=0|e.words[n];t+=977*r,e.words[n]=67108863&t,t=64*r+(t/67108864|0)}return 0===e.words[e.length-1]&&(e.length--,0===e.words[e.length-1]&&e.length--),e},r(_,v),r(E,v),r(T,v),T.prototype.imulK=function(e){for(var t=0,n=0;n<e.length;n++){var r=19*(0|e.words[n])+t,i=67108863&r;r>>>=26,e.words[n]=i,t=r}return 0!==t&&(e.words[e.length++]=t),e},i._prime=function(e){if(g[e])return g[e];var t;if("k256"===e)t=new w;else if("p224"===e)t=new _;else if("p192"===e)t=new E;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new T}return g[e]=t,t},A.prototype._verify1=function(e){n(0===e.negative,"red works only with positives"),n(e.red,"red works only with red numbers")},A.prototype._verify2=function(e,t){n(0==(e.negative|t.negative),"red works only with positives"),n(e.red&&e.red===t.red,"red works only with red numbers")},A.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):(u(e,e.umod(this.m)._forceRed(this)),e)},A.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},A.prototype.add=function(e,t){this._verify2(e,t);var n=e.add(t);return n.cmp(this.m)>=0&&n.isub(this.m),n._forceRed(this)},A.prototype.iadd=function(e,t){this._verify2(e,t);var n=e.iadd(t);return n.cmp(this.m)>=0&&n.isub(this.m),n},A.prototype.sub=function(e,t){this._verify2(e,t);var n=e.sub(t);return n.cmpn(0)<0&&n.iadd(this.m),n._forceRed(this)},A.prototype.isub=function(e,t){this._verify2(e,t);var n=e.isub(t);return n.cmpn(0)<0&&n.iadd(this.m),n},A.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},A.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},A.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},A.prototype.isqr=function(e){return this.imul(e,e.clone())},A.prototype.sqr=function(e){return this.mul(e,e)},A.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(n(t%2==1),3===t){var r=this.m.add(new i(1)).iushrn(2);return this.pow(e,r)}for(var a=this.m.subn(1),o=0;!a.isZero()&&0===a.andln(1);)o++,a.iushrn(1);n(!a.isZero());var s=new i(1).toRed(this),c=s.redNeg(),u=this.m.subn(1).iushrn(1),f=this.m.bitLength();for(f=new i(2*f*f).toRed(this);0!==this.pow(f,u).cmp(c);)f.redIAdd(c);for(var d=this.pow(f,a),l=this.pow(e,a.addn(1).iushrn(1)),p=this.pow(e,a),h=o;0!==p.cmp(s);){for(var b=p,m=0;0!==b.cmp(s);m++)b=b.redSqr();n(m<h);var y=this.pow(d,new i(1).iushln(h-m-1));l=l.redMul(y),d=y.redSqr(),p=p.redMul(d),h=m}return l},A.prototype.invm=function(e){var t=e._invmp(this.m);return 0!==t.negative?(t.negative=0,this.imod(t).redNeg()):this.imod(t)},A.prototype.pow=function(e,t){if(t.isZero())return new i(1).toRed(this);if(0===t.cmpn(1))return e.clone();var n=new Array(16);n[0]=new i(1).toRed(this),n[1]=e;for(var r=2;r<n.length;r++)n[r]=this.mul(n[r-1],e);var a=n[0],o=0,s=0,c=t.bitLength()%26;for(0===c&&(c=26),r=t.length-1;r>=0;r--){for(var u=t.words[r],f=c-1;f>=0;f--){var d=u>>f&1;a!==n[0]&&(a=this.sqr(a)),0!==d||0!==o?(o<<=1,o|=d,(4===++s||0===r&&0===f)&&(a=this.mul(a,n[o]),s=0,o=0)):s=0}c=26}return a},A.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},A.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},i.mont=function(e){return new R(e)},r(R,A),R.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},R.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},R.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var n=e.imul(t),r=n.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=n.isub(r).iushrn(this.shift),a=i;return i.cmp(this.m)>=0?a=i.isub(this.m):i.cmpn(0)<0&&(a=i.iadd(this.m)),a._forceRed(this)},R.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new i(0)._forceRed(this);var n=e.mul(t),r=n.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),a=n.isub(r).iushrn(this.shift),o=a;return a.cmp(this.m)>=0?o=a.isub(this.m):a.cmpn(0)<0&&(o=a.iadd(this.m)),o._forceRed(this)},R.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(e,Jt)}(Zt);var nr=Zt.exports,rr=Yt(nr);let ir=!1,ar=!1;const or={debug:1,default:2,info:2,warning:3,error:4,off:5};let sr=or.default,cr=null;const ur=function(){try{const e=[];if(["NFD","NFC","NFKD","NFKC"].forEach((t=>{try{if("test"!=="test".normalize(t))throw new Error("bad normalize")}catch(n){e.push(t)}})),e.length)throw new Error("missing "+e.join(", "));if(String.fromCharCode(233).normalize("NFD")!==String.fromCharCode(101,769))throw new Error("broken implementation")}catch(e){return e.message}return null}();var fr,dr;!function(e){e.DEBUG="DEBUG",e.INFO="INFO",e.WARNING="WARNING",e.ERROR="ERROR",e.OFF="OFF"}(fr||(fr={})),function(e){e.UNKNOWN_ERROR="UNKNOWN_ERROR",e.NOT_IMPLEMENTED="NOT_IMPLEMENTED",e.UNSUPPORTED_OPERATION="UNSUPPORTED_OPERATION",e.NETWORK_ERROR="NETWORK_ERROR",e.SERVER_ERROR="SERVER_ERROR",e.TIMEOUT="TIMEOUT",e.BUFFER_OVERRUN="BUFFER_OVERRUN",e.NUMERIC_FAULT="NUMERIC_FAULT",e.MISSING_NEW="MISSING_NEW",e.INVALID_ARGUMENT="INVALID_ARGUMENT",e.MISSING_ARGUMENT="MISSING_ARGUMENT",e.UNEXPECTED_ARGUMENT="UNEXPECTED_ARGUMENT",e.CALL_EXCEPTION="CALL_EXCEPTION",e.INSUFFICIENT_FUNDS="INSUFFICIENT_FUNDS",e.NONCE_EXPIRED="NONCE_EXPIRED",e.REPLACEMENT_UNDERPRICED="REPLACEMENT_UNDERPRICED",e.UNPREDICTABLE_GAS_LIMIT="UNPREDICTABLE_GAS_LIMIT",e.TRANSACTION_REPLACED="TRANSACTION_REPLACED",e.ACTION_REJECTED="ACTION_REJECTED"}(dr||(dr={}));const lr="0123456789abcdef";let pr=class e{constructor(e){Object.defineProperty(this,"version",{enumerable:!0,value:e,writable:!1})}_log(e,t){const n=e.toLowerCase();null==or[n]&&this.throwArgumentError("invalid log level name","logLevel",e),sr>or[n]||console.log.apply(console,t)}debug(...t){this._log(e.levels.DEBUG,t)}info(...t){this._log(e.levels.INFO,t)}warn(...t){this._log(e.levels.WARNING,t)}makeError(t,n,r){if(ar)return this.makeError("censored error",n,{});n||(n=e.errors.UNKNOWN_ERROR),r||(r={});const i=[];Object.keys(r).forEach((e=>{const t=r[e];try{if(t instanceof Uint8Array){let n="";for(let e=0;e<t.length;e++)n+=lr[t[e]>>4],n+=lr[15&t[e]];i.push(e+"=Uint8Array(0x"+n+")")}else i.push(e+"="+JSON.stringify(t))}catch(t){i.push(e+"="+JSON.stringify(r[e].toString()))}})),i.push(`code=${n}`),i.push(`version=${this.version}`);const a=t;let o="";switch(n){case dr.NUMERIC_FAULT:{o="NUMERIC_FAULT";const e=t;switch(e){case"overflow":case"underflow":case"division-by-zero":o+="-"+e;break;case"negative-power":case"negative-width":o+="-unsupported";break;case"unbound-bitwise-result":o+="-unbound-result"}break}case dr.CALL_EXCEPTION:case dr.INSUFFICIENT_FUNDS:case dr.MISSING_NEW:case dr.NONCE_EXPIRED:case dr.REPLACEMENT_UNDERPRICED:case dr.TRANSACTION_REPLACED:case dr.UNPREDICTABLE_GAS_LIMIT:o=n}o&&(t+=" [ See: https://links.ethers.org/v5-errors-"+o+" ]"),i.length&&(t+=" ("+i.join(", ")+")");const s=new Error(t);return s.reason=a,s.code=n,Object.keys(r).forEach((function(e){s[e]=r[e]})),s}throwError(e,t,n){throw this.makeError(e,t,n)}throwArgumentError(t,n,r){return this.throwError(t,e.errors.INVALID_ARGUMENT,{argument:n,value:r})}assert(e,t,n,r){e||this.throwError(t,n,r)}assertArgument(e,t,n,r){e||this.throwArgumentError(t,n,r)}checkNormalize(t){ur&&this.throwError("platform missing String.prototype.normalize",e.errors.UNSUPPORTED_OPERATION,{operation:"String.prototype.normalize",form:ur})}checkSafeUint53(t,n){"number"==typeof t&&(null==n&&(n="value not safe"),(t<0||t>=9007199254740991)&&this.throwError(n,e.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"out-of-safe-range",value:t}),t%1&&this.throwError(n,e.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"non-integer",value:t}))}checkArgumentCount(t,n,r){r=r?": "+r:"",t<n&&this.throwError("missing argument"+r,e.errors.MISSING_ARGUMENT,{count:t,expectedCount:n}),t>n&&this.throwError("too many arguments"+r,e.errors.UNEXPECTED_ARGUMENT,{count:t,expectedCount:n})}checkNew(t,n){t!==Object&&null!=t||this.throwError("missing new",e.errors.MISSING_NEW,{name:n.name})}checkAbstract(t,n){t===n?this.throwError("cannot instantiate abstract class "+JSON.stringify(n.name)+" directly; use a sub-class",e.errors.UNSUPPORTED_OPERATION,{name:t.name,operation:"new"}):t!==Object&&null!=t||this.throwError("missing new",e.errors.MISSING_NEW,{name:n.name})}static globalLogger(){return cr||(cr=new e("logger/5.7.0")),cr}static setCensorship(t,n){if(!t&&n&&this.globalLogger().throwError("cannot permanently disable censorship",e.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"}),ir){if(!t)return;this.globalLogger().throwError("error censorship permanent",e.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"})}ar=!!t,ir=!!n}static setLogLevel(t){const n=or[t.toLowerCase()];null!=n?sr=n:e.globalLogger().warn("invalid log level - "+t)}static from(t){return new e(t)}};pr.errors=dr,pr.levels=fr;var hr=Object.freeze({__proto__:null,get ErrorCode(){return dr},get LogLevel(){return fr},Logger:pr});const br=new pr("bytes/5.7.0");function mr(e){return!!e.toHexString}function yr(e){return e.slice||(e.slice=function(){const t=Array.prototype.slice.call(arguments);return yr(new Uint8Array(Array.prototype.slice.apply(e,t)))}),e}function gr(e){return Rr(e)&&!(e.length%2)||wr(e)}function vr(e){return"number"==typeof e&&e==e&&e%1==0}function wr(e){if(null==e)return!1;if(e.constructor===Uint8Array)return!0;if("string"==typeof e)return!1;if(!vr(e.length)||e.length<0)return!1;for(let t=0;t<e.length;t++){const n=e[t];if(!vr(n)||n<0||n>=256)return!1}return!0}function _r(e,t){if(t||(t={}),"number"==typeof e){br.checkSafeUint53(e,"invalid arrayify value");const t=[];for(;e;)t.unshift(255&e),e=parseInt(String(e/256));return 0===t.length&&t.push(0),yr(new Uint8Array(t))}if(t.allowMissingPrefix&&"string"==typeof e&&"0x"!==e.substring(0,2)&&(e="0x"+e),mr(e)&&(e=e.toHexString()),Rr(e)){let n=e.substring(2);n.length%2&&("left"===t.hexPad?n="0"+n:"right"===t.hexPad?n+="0":br.throwArgumentError("hex data is odd-length","value",e));const r=[];for(let e=0;e<n.length;e+=2)r.push(parseInt(n.substring(e,e+2),16));return yr(new Uint8Array(r))}return wr(e)?yr(new Uint8Array(e)):br.throwArgumentError("invalid arrayify value","value",e)}function Er(e){const t=e.map((e=>_r(e))),n=t.reduce(((e,t)=>e+t.length),0),r=new Uint8Array(n);return t.reduce(((e,t)=>(r.set(t,e),e+t.length)),0),yr(r)}function Tr(e){let t=_r(e);if(0===t.length)return t;let n=0;for(;n<t.length&&0===t[n];)n++;return n&&(t=t.slice(n)),t}function Ar(e,t){(e=_r(e)).length>t&&br.throwArgumentError("value out of range","value",arguments[0]);const n=new Uint8Array(t);return n.set(e,t-e.length),yr(n)}function Rr(e,t){return!("string"!=typeof e||!e.match(/^0x[0-9A-Fa-f]*$/))&&(!t||e.length===2+2*t)}const Sr="0123456789abcdef";function kr(e,t){if(t||(t={}),"number"==typeof e){br.checkSafeUint53(e,"invalid hexlify value");let t="";for(;e;)t=Sr[15&e]+t,e=Math.floor(e/16);return t.length?(t.length%2&&(t="0"+t),"0x"+t):"0x00"}if("bigint"==typeof e)return(e=e.toString(16)).length%2?"0x0"+e:"0x"+e;if(t.allowMissingPrefix&&"string"==typeof e&&"0x"!==e.substring(0,2)&&(e="0x"+e),mr(e))return e.toHexString();if(Rr(e))return e.length%2&&("left"===t.hexPad?e="0x0"+e.substring(2):"right"===t.hexPad?e+="0":br.throwArgumentError("hex data is odd-length","value",e)),e.toLowerCase();if(wr(e)){let t="0x";for(let n=0;n<e.length;n++){let r=e[n];t+=Sr[(240&r)>>4]+Sr[15&r]}return t}return br.throwArgumentError("invalid hexlify value","value",e)}function Ir(e){if("string"!=typeof e)e=kr(e);else if(!Rr(e)||e.length%2)return null;return(e.length-2)/2}function Or(e,t,n){return"string"!=typeof e?e=kr(e):(!Rr(e)||e.length%2)&&br.throwArgumentError("invalid hexData","value",e),t=2+2*t,null!=n?"0x"+e.substring(t,2+2*n):"0x"+e.substring(t)}function xr(e){let t="0x";return e.forEach((e=>{t+=kr(e).substring(2)})),t}function Cr(e){const t=Mr(kr(e,{hexPad:"left"}));return"0x"===t?"0x0":t}function Mr(e){"string"!=typeof e&&(e=kr(e)),Rr(e)||br.throwArgumentError("invalid hex string","value",e),e=e.substring(2);let t=0;for(;t<e.length&&"0"===e[t];)t++;return"0x"+e.substring(t)}function Pr(e,t){for("string"!=typeof e?e=kr(e):Rr(e)||br.throwArgumentError("invalid hex string","value",e),e.length>2*t+2&&br.throwArgumentError("value out of range","value",arguments[1]);e.length<2*t+2;)e="0x0"+e.substring(2);return e}function Nr(e){const t={r:"0x",s:"0x",_vs:"0x",recoveryParam:0,v:0,yParityAndS:"0x",compact:"0x"};if(gr(e)){let n=_r(e);64===n.length?(t.v=27+(n[32]>>7),n[32]&=127,t.r=kr(n.slice(0,32)),t.s=kr(n.slice(32,64))):65===n.length?(t.r=kr(n.slice(0,32)),t.s=kr(n.slice(32,64)),t.v=n[64]):br.throwArgumentError("invalid signature string","signature",e),t.v<27&&(0===t.v||1===t.v?t.v+=27:br.throwArgumentError("signature invalid v byte","signature",e)),t.recoveryParam=1-t.v%2,t.recoveryParam&&(n[32]|=128),t._vs=kr(n.slice(32,64))}else{if(t.r=e.r,t.s=e.s,t.v=e.v,t.recoveryParam=e.recoveryParam,t._vs=e._vs,null!=t._vs){const n=Ar(_r(t._vs),32);t._vs=kr(n);const r=n[0]>=128?1:0;null==t.recoveryParam?t.recoveryParam=r:t.recoveryParam!==r&&br.throwArgumentError("signature recoveryParam mismatch _vs","signature",e),n[0]&=127;const i=kr(n);null==t.s?t.s=i:t.s!==i&&br.throwArgumentError("signature v mismatch _vs","signature",e)}if(null==t.recoveryParam)null==t.v?br.throwArgumentError("signature missing v and recoveryParam","signature",e):0===t.v||1===t.v?t.recoveryParam=t.v:t.recoveryParam=1-t.v%2;else if(null==t.v)t.v=27+t.recoveryParam;else{const n=0===t.v||1===t.v?t.v:1-t.v%2;t.recoveryParam!==n&&br.throwArgumentError("signature recoveryParam mismatch v","signature",e)}null!=t.r&&Rr(t.r)?t.r=Pr(t.r,32):br.throwArgumentError("signature missing or invalid r","signature",e),null!=t.s&&Rr(t.s)?t.s=Pr(t.s,32):br.throwArgumentError("signature missing or invalid s","signature",e);const n=_r(t.s);n[0]>=128&&br.throwArgumentError("signature s out of range","signature",e),t.recoveryParam&&(n[0]|=128);const r=kr(n);t._vs&&(Rr(t._vs)||br.throwArgumentError("signature invalid _vs","signature",e),t._vs=Pr(t._vs,32)),null==t._vs?t._vs=r:t._vs!==r&&br.throwArgumentError("signature _vs mismatch v and s","signature",e)}return t.yParityAndS=t._vs,t.compact=t.r+t.yParityAndS.substring(2),t}function Br(e){return kr(Er([(e=Nr(e)).r,e.s,e.recoveryParam?"0x1c":"0x1b"]))}var Dr=Object.freeze({__proto__:null,arrayify:_r,concat:Er,hexConcat:xr,hexDataLength:Ir,hexDataSlice:Or,hexStripZeros:Mr,hexValue:Cr,hexZeroPad:Pr,hexlify:kr,isBytes:wr,isBytesLike:gr,isHexString:Rr,joinSignature:Br,splitSignature:Nr,stripZeros:Tr,zeroPad:Ar});const Fr="bignumber/5.7.0";var Lr=rr.BN;const Ur=new pr(Fr),jr={},qr=9007199254740991;let zr=!1,Hr=class e{constructor(e,t){e!==jr&&Ur.throwError("cannot call constructor directly; use BigNumber.from",pr.errors.UNSUPPORTED_OPERATION,{operation:"new (BigNumber)"}),this._hex=t,this._isBigNumber=!0,Object.freeze(this)}fromTwos(e){return Vr(Kr(this).fromTwos(e))}toTwos(e){return Vr(Kr(this).toTwos(e))}abs(){return"-"===this._hex[0]?e.from(this._hex.substring(1)):this}add(e){return Vr(Kr(this).add(Kr(e)))}sub(e){return Vr(Kr(this).sub(Kr(e)))}div(t){return e.from(t).isZero()&&Wr("division-by-zero","div"),Vr(Kr(this).div(Kr(t)))}mul(e){return Vr(Kr(this).mul(Kr(e)))}mod(e){const t=Kr(e);return t.isNeg()&&Wr("division-by-zero","mod"),Vr(Kr(this).umod(t))}pow(e){const t=Kr(e);return t.isNeg()&&Wr("negative-power","pow"),Vr(Kr(this).pow(t))}and(e){const t=Kr(e);return(this.isNegative()||t.isNeg())&&Wr("unbound-bitwise-result","and"),Vr(Kr(this).and(t))}or(e){const t=Kr(e);return(this.isNegative()||t.isNeg())&&Wr("unbound-bitwise-result","or"),Vr(Kr(this).or(t))}xor(e){const t=Kr(e);return(this.isNegative()||t.isNeg())&&Wr("unbound-bitwise-result","xor"),Vr(Kr(this).xor(t))}mask(e){return(this.isNegative()||e<0)&&Wr("negative-width","mask"),Vr(Kr(this).maskn(e))}shl(e){return(this.isNegative()||e<0)&&Wr("negative-width","shl"),Vr(Kr(this).shln(e))}shr(e){return(this.isNegative()||e<0)&&Wr("negative-width","shr"),Vr(Kr(this).shrn(e))}eq(e){return Kr(this).eq(Kr(e))}lt(e){return Kr(this).lt(Kr(e))}lte(e){return Kr(this).lte(Kr(e))}gt(e){return Kr(this).gt(Kr(e))}gte(e){return Kr(this).gte(Kr(e))}isNegative(){return"-"===this._hex[0]}isZero(){return Kr(this).isZero()}toNumber(){try{return Kr(this).toNumber()}catch(e){Wr("overflow","toNumber",this.toString())}return null}toBigInt(){try{return BigInt(this.toString())}catch(e){}return Ur.throwError("this platform does not support BigInt",pr.errors.UNSUPPORTED_OPERATION,{value:this.toString()})}toString(){return arguments.length>0&&(10===arguments[0]?zr||(zr=!0,Ur.warn("BigNumber.toString does not accept any parameters; base-10 is assumed")):16===arguments[0]?Ur.throwError("BigNumber.toString does not accept any parameters; use bigNumber.toHexString()",pr.errors.UNEXPECTED_ARGUMENT,{}):Ur.throwError("BigNumber.toString does not accept parameters",pr.errors.UNEXPECTED_ARGUMENT,{})),Kr(this).toString(10)}toHexString(){return this._hex}toJSON(e){return{type:"BigNumber",hex:this.toHexString()}}static from(t){if(t instanceof e)return t;if("string"==typeof t)return t.match(/^-?0x[0-9a-f]+$/i)?new e(jr,Gr(t)):t.match(/^-?[0-9]+$/)?new e(jr,Gr(new Lr(t))):Ur.throwArgumentError("invalid BigNumber string","value",t);if("number"==typeof t)return t%1&&Wr("underflow","BigNumber.from",t),(t>=qr||t<=-qr)&&Wr("overflow","BigNumber.from",t),e.from(String(t));const n=t;if("bigint"==typeof n)return e.from(n.toString());if(wr(n))return e.from(kr(n));if(n)if(n.toHexString){const t=n.toHexString();if("string"==typeof t)return e.from(t)}else{let t=n._hex;if(null==t&&"BigNumber"===n.type&&(t=n.hex),"string"==typeof t&&(Rr(t)||"-"===t[0]&&Rr(t.substring(1))))return e.from(t)}return Ur.throwArgumentError("invalid BigNumber value","value",t)}static isBigNumber(e){return!(!e||!e._isBigNumber)}};function Gr(e){if("string"!=typeof e)return Gr(e.toString(16));if("-"===e[0])return"-"===(e=e.substring(1))[0]&&Ur.throwArgumentError("invalid hex","value",e),"0x00"===(e=Gr(e))?e:"-"+e;if("0x"!==e.substring(0,2)&&(e="0x"+e),"0x"===e)return"0x00";for(e.length%2&&(e="0x0"+e.substring(2));e.length>4&&"0x00"===e.substring(0,4);)e="0x"+e.substring(4);return e}function Vr(e){return Hr.from(Gr(e))}function Kr(e){const t=Hr.from(e).toHexString();return"-"===t[0]?new Lr("-"+t.substring(3),16):new Lr(t.substring(2),16)}function Wr(e,t,n){const r={fault:e,operation:t};return null!=n&&(r.value=n),Ur.throwError(e,pr.errors.NUMERIC_FAULT,r)}const Xr=new pr(Fr),$r={},Jr=Hr.from(0),Yr=Hr.from(-1);function Qr(e,t,n,r){const i={fault:t,operation:n};return void 0!==r&&(i.value=r),Xr.throwError(e,pr.errors.NUMERIC_FAULT,i)}let Zr="0";for(;Zr.length<256;)Zr+=Zr;function ei(e){if("number"!=typeof e)try{e=Hr.from(e).toNumber()}catch(e){}return"number"==typeof e&&e>=0&&e<=256&&!(e%1)?"1"+Zr.substring(0,e):Xr.throwArgumentError("invalid decimal size","decimals",e)}function ti(e,t){null==t&&(t=0);const n=ei(t),r=(e=Hr.from(e)).lt(Jr);r&&(e=e.mul(Yr));let i=e.mod(n).toString();for(;i.length<n.length-1;)i="0"+i;i=i.match(/^([0-9]*[1-9]|0)(0*)/)[1];const a=e.div(n).toString();return e=1===n.length?a:a+"."+i,r&&(e="-"+e),e}function ni(e,t){null==t&&(t=0);const n=ei(t);"string"==typeof e&&e.match(/^-?[0-9.]+$/)||Xr.throwArgumentError("invalid decimal value","value",e);const r="-"===e.substring(0,1);r&&(e=e.substring(1)),"."===e&&Xr.throwArgumentError("missing value","value",e);const i=e.split(".");i.length>2&&Xr.throwArgumentError("too many decimal points","value",e);let a=i[0],o=i[1];for(a||(a="0"),o||(o="0");"0"===o[o.length-1];)o=o.substring(0,o.length-1);for(o.length>n.length-1&&Qr("fractional component exceeds decimals","underflow","parseFixed"),""===o&&(o="0");o.length<n.length-1;)o+="0";const s=Hr.from(a),c=Hr.from(o);let u=s.mul(n).add(c);return r&&(u=u.mul(Yr)),u}class ri{constructor(e,t,n,r){e!==$r&&Xr.throwError("cannot use FixedFormat constructor; use FixedFormat.from",pr.errors.UNSUPPORTED_OPERATION,{operation:"new FixedFormat"}),this.signed=t,this.width=n,this.decimals=r,this.name=(t?"":"u")+"fixed"+String(n)+"x"+String(r),this._multiplier=ei(r),Object.freeze(this)}static from(e){if(e instanceof ri)return e;"number"==typeof e&&(e=`fixed128x${e}`);let t=!0,n=128,r=18;if("string"==typeof e)if("fixed"===e);else if("ufixed"===e)t=!1;else{const i=e.match(/^(u?)fixed([0-9]+)x([0-9]+)$/);i||Xr.throwArgumentError("invalid fixed format","format",e),t="u"!==i[1],n=parseInt(i[2]),r=parseInt(i[3])}else if(e){const i=(t,n,r)=>null==e[t]?r:(typeof e[t]!==n&&Xr.throwArgumentError("invalid fixed format ("+t+" not "+n+")","format."+t,e[t]),e[t]);t=i("signed","boolean",t),n=i("width","number",n),r=i("decimals","number",r)}return n%8&&Xr.throwArgumentError("invalid fixed format width (not byte aligned)","format.width",n),r>80&&Xr.throwArgumentError("invalid fixed format (decimals too large)","format.decimals",r),new ri($r,t,n,r)}}class ii{constructor(e,t,n,r){e!==$r&&Xr.throwError("cannot use FixedNumber constructor; use FixedNumber.from",pr.errors.UNSUPPORTED_OPERATION,{operation:"new FixedFormat"}),this.format=r,this._hex=t,this._value=n,this._isFixedNumber=!0,Object.freeze(this)}_checkFormat(e){this.format.name!==e.format.name&&Xr.throwArgumentError("incompatible format; use fixedNumber.toFormat","other",e)}addUnsafe(e){this._checkFormat(e);const t=ni(this._value,this.format.decimals),n=ni(e._value,e.format.decimals);return ii.fromValue(t.add(n),this.format.decimals,this.format)}subUnsafe(e){this._checkFormat(e);const t=ni(this._value,this.format.decimals),n=ni(e._value,e.format.decimals);return ii.fromValue(t.sub(n),this.format.decimals,this.format)}mulUnsafe(e){this._checkFormat(e);const t=ni(this._value,this.format.decimals),n=ni(e._value,e.format.decimals);return ii.fromValue(t.mul(n).div(this.format._multiplier),this.format.decimals,this.format)}divUnsafe(e){this._checkFormat(e);const t=ni(this._value,this.format.decimals),n=ni(e._value,e.format.decimals);return ii.fromValue(t.mul(this.format._multiplier).div(n),this.format.decimals,this.format)}floor(){const e=this.toString().split(".");1===e.length&&e.push("0");let t=ii.from(e[0],this.format);const n=!e[1].match(/^(0*)$/);return this.isNegative()&&n&&(t=t.subUnsafe(ai.toFormat(t.format))),t}ceiling(){const e=this.toString().split(".");1===e.length&&e.push("0");let t=ii.from(e[0],this.format);const n=!e[1].match(/^(0*)$/);return!this.isNegative()&&n&&(t=t.addUnsafe(ai.toFormat(t.format))),t}round(e){null==e&&(e=0);const t=this.toString().split(".");if(1===t.length&&t.push("0"),(e<0||e>80||e%1)&&Xr.throwArgumentError("invalid decimal count","decimals",e),t[1].length<=e)return this;const n=ii.from("1"+Zr.substring(0,e),this.format),r=oi.toFormat(this.format);return this.mulUnsafe(n).addUnsafe(r).floor().divUnsafe(n)}isZero(){return"0.0"===this._value||"0"===this._value}isNegative(){return"-"===this._value[0]}toString(){return this._value}toHexString(e){if(null==e)return this._hex;e%8&&Xr.throwArgumentError("invalid byte width","width",e);return Pr(Hr.from(this._hex).fromTwos(this.format.width).toTwos(e).toHexString(),e/8)}toUnsafeFloat(){return parseFloat(this.toString())}toFormat(e){return ii.fromString(this._value,e)}static fromValue(e,t,n){return null!=n||null==t||function(e){return null!=e&&(Hr.isBigNumber(e)||"number"==typeof e&&e%1==0||"string"==typeof e&&!!e.match(/^-?[0-9]+$/)||Rr(e)||"bigint"==typeof e||wr(e))}(t)||(n=t,t=null),null==t&&(t=0),null==n&&(n="fixed"),ii.fromString(ti(e,t),ri.from(n))}static fromString(e,t){null==t&&(t="fixed");const n=ri.from(t),r=ni(e,n.decimals);!n.signed&&r.lt(Jr)&&Qr("unsigned value cannot be negative","overflow","value",e);let i=null;n.signed?i=r.toTwos(n.width).toHexString():(i=r.toHexString(),i=Pr(i,n.width/8));const a=ti(r,n.decimals);return new ii($r,i,a,n)}static fromBytes(e,t){null==t&&(t="fixed");const n=ri.from(t);if(_r(e).length>n.width/8)throw new Error("overflow");let r=Hr.from(e);n.signed&&(r=r.fromTwos(n.width));const i=r.toTwos((n.signed?0:1)+n.width).toHexString(),a=ti(r,n.decimals);return new ii($r,i,a,n)}static from(e,t){if("string"==typeof e)return ii.fromString(e,t);if(wr(e))return ii.fromBytes(e,t);try{return ii.fromValue(e,0,t)}catch(e){if(e.code!==pr.errors.INVALID_ARGUMENT)throw e}return Xr.throwArgumentError("invalid FixedNumber value","value",e)}static isFixedNumber(e){return!(!e||!e._isFixedNumber)}}const ai=ii.from(1),oi=ii.from("0.5");var si=function(e,t,n,r){return new(n||(n=Promise))((function(i,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(o,s)}c((r=r.apply(e,t||[])).next())}))};const ci=new pr("properties/5.7.0");function ui(e,t,n){Object.defineProperty(e,t,{enumerable:!0,value:n,writable:!1})}function fi(e,t){for(let n=0;n<32;n++){if(e[t])return e[t];if(!e.prototype||"object"!=typeof e.prototype)break;e=Object.getPrototypeOf(e.prototype).constructor}return null}function di(e){return si(this,void 0,void 0,(function*(){const t=Object.keys(e).map((t=>{const n=e[t];return Promise.resolve(n).then((e=>({key:t,value:e})))}));return(yield Promise.all(t)).reduce(((e,t)=>(e[t.key]=t.value,e)),{})}))}function li(e,t){e&&"object"==typeof e||ci.throwArgumentError("invalid object","object",e),Object.keys(e).forEach((n=>{t[n]||ci.throwArgumentError("invalid object key - "+n,"transaction:"+n,e)}))}function pi(e){const t={};for(const n in e)t[n]=e[n];return t}const hi={bigint:!0,boolean:!0,function:!0,number:!0,string:!0};function bi(e){if(null==e||hi[typeof e])return!0;if(Array.isArray(e)||"object"==typeof e){if(!Object.isFrozen(e))return!1;const t=Object.keys(e);for(let n=0;n<t.length;n++){let r=null;try{r=e[t[n]]}catch(e){continue}if(!bi(r))return!1}return!0}return ci.throwArgumentError("Cannot deepCopy "+typeof e,"object",e)}function mi(e){if(bi(e))return e;if(Array.isArray(e))return Object.freeze(e.map((e=>yi(e))));if("object"==typeof e){const t={};for(const n in e){const r=e[n];void 0!==r&&ui(t,n,yi(r))}return t}return ci.throwArgumentError("Cannot deepCopy "+typeof e,"object",e)}function yi(e){return mi(e)}let gi=class{constructor(e){for(const t in e)this[t]=yi(e[t])}};var vi=Object.freeze({__proto__:null,Description:gi,checkProperties:li,deepCopy:yi,defineReadOnly:ui,getStatic:fi,resolveProperties:di,shallowCopy:pi});const wi="abi/5.7.0",_i=new pr(wi),Ei={};let Ti={calldata:!0,memory:!0,storage:!0},Ai={calldata:!0,memory:!0};function Ri(e,t){if("bytes"===e||"string"===e){if(Ti[t])return!0}else if("address"===e){if("payable"===t)return!0}else if((e.indexOf("[")>=0||"tuple"===e)&&Ai[t])return!0;return(Ti[t]||"payable"===t)&&_i.throwArgumentError("invalid modifier","name",t),!1}function Si(e,t){for(let n in t)ui(e,n,t[n])}const ki=Object.freeze({sighash:"sighash",minimal:"minimal",full:"full",json:"json"}),Ii=new RegExp(/^(.*)\[([0-9]*)\]$/);let Oi=class e{constructor(t,n){t!==Ei&&_i.throwError("use fromString",pr.errors.UNSUPPORTED_OPERATION,{operation:"new ParamType()"}),Si(this,n);let r=this.type.match(Ii);Si(this,r?{arrayLength:parseInt(r[2]||"-1"),arrayChildren:e.fromObject({type:r[1],components:this.components}),baseType:"array"}:{arrayLength:null,arrayChildren:null,baseType:null!=this.components?"tuple":this.type}),this._isParamType=!0,Object.freeze(this)}format(e){if(e||(e=ki.sighash),ki[e]||_i.throwArgumentError("invalid format type","format",e),e===ki.json){let t={type:"tuple"===this.baseType?"tuple":this.type,name:this.name||void 0};return"boolean"==typeof this.indexed&&(t.indexed=this.indexed),this.components&&(t.components=this.components.map((t=>JSON.parse(t.format(e))))),JSON.stringify(t)}let t="";return"array"===this.baseType?(t+=this.arrayChildren.format(e),t+="["+(this.arrayLength<0?"":String(this.arrayLength))+"]"):"tuple"===this.baseType?(e!==ki.sighash&&(t+=this.type),t+="("+this.components.map((t=>t.format(e))).join(e===ki.full?", ":",")+")"):t+=this.type,e!==ki.sighash&&(!0===this.indexed&&(t+=" indexed"),e===ki.full&&this.name&&(t+=" "+this.name)),t}static from(t,n){return"string"==typeof t?e.fromString(t,n):e.fromObject(t)}static fromObject(t){return e.isParamType(t)?t:new e(Ei,{name:t.name||null,type:ji(t.type),indexed:null==t.indexed?null:!!t.indexed,components:t.components?t.components.map(e.fromObject):null})}static fromString(t,n){return r=function(e,t){let n=e;function r(t){_i.throwArgumentError(`unexpected character at position ${t}`,"param",e)}function i(e){let n={type:"",name:"",parent:e,state:{allowType:!0}};return t&&(n.indexed=!1),n}e=e.replace(/\s/g," ");let a={type:"",name:"",state:{allowType:!0}},o=a;for(let n=0;n<e.length;n++){let a=e[n];switch(a){case"(":o.state.allowType&&""===o.type?o.type="tuple":o.state.allowParams||r(n),o.state.allowType=!1,o.type=ji(o.type),o.components=[i(o)],o=o.components[0];break;case")":delete o.state,"indexed"===o.name&&(t||r(n),o.indexed=!0,o.name=""),Ri(o.type,o.name)&&(o.name=""),o.type=ji(o.type);let e=o;o=o.parent,o||r(n),delete e.parent,o.state.allowParams=!1,o.state.allowName=!0,o.state.allowArray=!0;break;case",":delete o.state,"indexed"===o.name&&(t||r(n),o.indexed=!0,o.name=""),Ri(o.type,o.name)&&(o.name=""),o.type=ji(o.type);let s=i(o.parent);o.parent.components.push(s),delete o.parent,o=s;break;case" ":o.state.allowType&&""!==o.type&&(o.type=ji(o.type),delete o.state.allowType,o.state.allowName=!0,o.state.allowParams=!0),o.state.allowName&&""!==o.name&&("indexed"===o.name?(t||r(n),o.indexed&&r(n),o.indexed=!0,o.name=""):Ri(o.type,o.name)?o.name="":o.state.allowName=!1);break;case"[":o.state.allowArray||r(n),o.type+=a,o.state.allowArray=!1,o.state.allowName=!1,o.state.readArray=!0;break;case"]":o.state.readArray||r(n),o.type+=a,o.state.readArray=!1,o.state.allowArray=!0,o.state.allowName=!0;break;default:o.state.allowType?(o.type+=a,o.state.allowParams=!0,o.state.allowArray=!0):o.state.allowName?(o.name+=a,delete o.state.allowArray):o.state.readArray?o.type+=a:r(n)}}return o.parent&&_i.throwArgumentError("unexpected eof","param",e),delete a.state,"indexed"===o.name?(t||r(n.length-7),o.indexed&&r(n.length-7),o.indexed=!0,o.name=""):Ri(o.type,o.name)&&(o.name=""),a.type=ji(a.type),a}(t,!!n),e.fromObject({name:r.name,type:r.type,indexed:r.indexed,components:r.components});var r}static isParamType(e){return!(null==e||!e._isParamType)}};function xi(e,t){return function(e){e=e.trim();let t=[],n="",r=0;for(let i=0;i<e.length;i++){let a=e[i];","===a&&0===r?(t.push(n),n=""):(n+=a,"("===a?r++:")"===a&&(r--,-1===r&&_i.throwArgumentError("unbalanced parenthesis","value",e)))}n&&t.push(n);return t}(e).map((e=>Oi.fromString(e,t)))}let Ci=class e{constructor(e,t){e!==Ei&&_i.throwError("use a static from method",pr.errors.UNSUPPORTED_OPERATION,{operation:"new Fragment()"}),Si(this,t),this._isFragment=!0,Object.freeze(this)}static from(t){return e.isFragment(t)?t:"string"==typeof t?e.fromString(t):e.fromObject(t)}static fromObject(t){if(e.isFragment(t))return t;switch(t.type){case"function":return Fi.fromObject(t);case"event":return Mi.fromObject(t);case"constructor":return Di.fromObject(t);case"error":return Ui.fromObject(t);case"fallback":case"receive":return null}return _i.throwArgumentError("invalid fragment object","value",t)}static fromString(e){return"event"===(e=(e=(e=e.replace(/\s/g," ")).replace(/\(/g," (").replace(/\)/g,") ").replace(/\s+/g," ")).trim()).split(" ")[0]?Mi.fromString(e.substring(5).trim()):"function"===e.split(" ")[0]?Fi.fromString(e.substring(8).trim()):"constructor"===e.split("(")[0].trim()?Di.fromString(e.trim()):"error"===e.split(" ")[0]?Ui.fromString(e.substring(5).trim()):_i.throwArgumentError("unsupported fragment","value",e)}static isFragment(e){return!(!e||!e._isFragment)}},Mi=class e extends Ci{format(e){if(e||(e=ki.sighash),ki[e]||_i.throwArgumentError("invalid format type","format",e),e===ki.json)return JSON.stringify({type:"event",anonymous:this.anonymous,name:this.name,inputs:this.inputs.map((t=>JSON.parse(t.format(e))))});let t="";return e!==ki.sighash&&(t+="event "),t+=this.name+"("+this.inputs.map((t=>t.format(e))).join(e===ki.full?", ":",")+") ",e!==ki.sighash&&this.anonymous&&(t+="anonymous "),t.trim()}static from(t){return"string"==typeof t?e.fromString(t):e.fromObject(t)}static fromObject(t){if(e.isEventFragment(t))return t;"event"!==t.type&&_i.throwArgumentError("invalid event object","value",t);const n={name:zi(t.name),anonymous:t.anonymous,inputs:t.inputs?t.inputs.map(Oi.fromObject):[],type:"event"};return new e(Ei,n)}static fromString(t){let n=t.match(Hi);n||_i.throwArgumentError("invalid event string","value",t);let r=!1;return n[3].split(" ").forEach((e=>{switch(e.trim()){case"anonymous":r=!0;break;case"":break;default:_i.warn("unknown modifier: "+e)}})),e.fromObject({name:n[1].trim(),anonymous:r,inputs:xi(n[2],!0),type:"event"})}static isEventFragment(e){return e&&e._isFragment&&"event"===e.type}};function Pi(e,t){t.gas=null;let n=e.split("@");return 1!==n.length?(n.length>2&&_i.throwArgumentError("invalid human-readable ABI signature","value",e),n[1].match(/^[0-9]+$/)||_i.throwArgumentError("invalid human-readable ABI signature gas","value",e),t.gas=Hr.from(n[1]),n[0]):e}function Ni(e,t){t.constant=!1,t.payable=!1,t.stateMutability="nonpayable",e.split(" ").forEach((e=>{switch(e.trim()){case"constant":t.constant=!0;break;case"payable":t.payable=!0,t.stateMutability="payable";break;case"nonpayable":t.payable=!1,t.stateMutability="nonpayable";break;case"pure":t.constant=!0,t.stateMutability="pure";break;case"view":t.constant=!0,t.stateMutability="view";break;case"external":case"public":case"":break;default:console.log("unknown modifier: "+e)}}))}function Bi(e){let t={constant:!1,payable:!0,stateMutability:"payable"};return null!=e.stateMutability?(t.stateMutability=e.stateMutability,t.constant="view"===t.stateMutability||"pure"===t.stateMutability,null!=e.constant&&!!e.constant!==t.constant&&_i.throwArgumentError("cannot have constant function with mutability "+t.stateMutability,"value",e),t.payable="payable"===t.stateMutability,null!=e.payable&&!!e.payable!==t.payable&&_i.throwArgumentError("cannot have payable function with mutability "+t.stateMutability,"value",e)):null!=e.payable?(t.payable=!!e.payable,null!=e.constant||t.payable||"constructor"===e.type||_i.throwArgumentError("unable to determine stateMutability","value",e),t.constant=!!e.constant,t.constant?t.stateMutability="view":t.stateMutability=t.payable?"payable":"nonpayable",t.payable&&t.constant&&_i.throwArgumentError("cannot have constant payable function","value",e)):null!=e.constant?(t.constant=!!e.constant,t.payable=!t.constant,t.stateMutability=t.constant?"view":"payable"):"constructor"!==e.type&&_i.throwArgumentError("unable to determine stateMutability","value",e),t}let Di=class e extends Ci{format(e){if(e||(e=ki.sighash),ki[e]||_i.throwArgumentError("invalid format type","format",e),e===ki.json)return JSON.stringify({type:"constructor",stateMutability:"nonpayable"!==this.stateMutability?this.stateMutability:void 0,payable:this.payable,gas:this.gas?this.gas.toNumber():void 0,inputs:this.inputs.map((t=>JSON.parse(t.format(e))))});e===ki.sighash&&_i.throwError("cannot format a constructor for sighash",pr.errors.UNSUPPORTED_OPERATION,{operation:"format(sighash)"});let t="constructor("+this.inputs.map((t=>t.format(e))).join(e===ki.full?", ":",")+") ";return this.stateMutability&&"nonpayable"!==this.stateMutability&&(t+=this.stateMutability+" "),t.trim()}static from(t){return"string"==typeof t?e.fromString(t):e.fromObject(t)}static fromObject(t){if(e.isConstructorFragment(t))return t;"constructor"!==t.type&&_i.throwArgumentError("invalid constructor object","value",t);let n=Bi(t);n.constant&&_i.throwArgumentError("constructor cannot be constant","value",t);const r={name:null,type:t.type,inputs:t.inputs?t.inputs.map(Oi.fromObject):[],payable:n.payable,stateMutability:n.stateMutability,gas:t.gas?Hr.from(t.gas):null};return new e(Ei,r)}static fromString(t){let n={type:"constructor"},r=(t=Pi(t,n)).match(Hi);return r&&"constructor"===r[1].trim()||_i.throwArgumentError("invalid constructor string","value",t),n.inputs=xi(r[2].trim(),!1),Ni(r[3].trim(),n),e.fromObject(n)}static isConstructorFragment(e){return e&&e._isFragment&&"constructor"===e.type}},Fi=class e extends Di{format(e){if(e||(e=ki.sighash),ki[e]||_i.throwArgumentError("invalid format type","format",e),e===ki.json)return JSON.stringify({type:"function",name:this.name,constant:this.constant,stateMutability:"nonpayable"!==this.stateMutability?this.stateMutability:void 0,payable:this.payable,gas:this.gas?this.gas.toNumber():void 0,inputs:this.inputs.map((t=>JSON.parse(t.format(e)))),outputs:this.outputs.map((t=>JSON.parse(t.format(e))))});let t="";return e!==ki.sighash&&(t+="function "),t+=this.name+"("+this.inputs.map((t=>t.format(e))).join(e===ki.full?", ":",")+") ",e!==ki.sighash&&(this.stateMutability?"nonpayable"!==this.stateMutability&&(t+=this.stateMutability+" "):this.constant&&(t+="view "),this.outputs&&this.outputs.length&&(t+="returns ("+this.outputs.map((t=>t.format(e))).join(", ")+") "),null!=this.gas&&(t+="@"+this.gas.toString()+" ")),t.trim()}static from(t){return"string"==typeof t?e.fromString(t):e.fromObject(t)}static fromObject(t){if(e.isFunctionFragment(t))return t;"function"!==t.type&&_i.throwArgumentError("invalid function object","value",t);let n=Bi(t);const r={type:t.type,name:zi(t.name),constant:n.constant,inputs:t.inputs?t.inputs.map(Oi.fromObject):[],outputs:t.outputs?t.outputs.map(Oi.fromObject):[],payable:n.payable,stateMutability:n.stateMutability,gas:t.gas?Hr.from(t.gas):null};return new e(Ei,r)}static fromString(t){let n={type:"function"},r=(t=Pi(t,n)).split(" returns ");r.length>2&&_i.throwArgumentError("invalid function string","value",t);let i=r[0].match(Hi);if(i||_i.throwArgumentError("invalid function signature","value",t),n.name=i[1].trim(),n.name&&zi(n.name),n.inputs=xi(i[2],!1),Ni(i[3].trim(),n),r.length>1){let e=r[1].match(Hi);""==e[1].trim()&&""==e[3].trim()||_i.throwArgumentError("unexpected tokens","value",t),n.outputs=xi(e[2],!1)}else n.outputs=[];return e.fromObject(n)}static isFunctionFragment(e){return e&&e._isFragment&&"function"===e.type}};function Li(e){const t=e.format();return"Error(string)"!==t&&"Panic(uint256)"!==t||_i.throwArgumentError(`cannot specify user defined ${t} error`,"fragment",e),e}let Ui=class e extends Ci{format(e){if(e||(e=ki.sighash),ki[e]||_i.throwArgumentError("invalid format type","format",e),e===ki.json)return JSON.stringify({type:"error",name:this.name,inputs:this.inputs.map((t=>JSON.parse(t.format(e))))});let t="";return e!==ki.sighash&&(t+="error "),t+=this.name+"("+this.inputs.map((t=>t.format(e))).join(e===ki.full?", ":",")+") ",t.trim()}static from(t){return"string"==typeof t?e.fromString(t):e.fromObject(t)}static fromObject(t){if(e.isErrorFragment(t))return t;"error"!==t.type&&_i.throwArgumentError("invalid error object","value",t);const n={type:t.type,name:zi(t.name),inputs:t.inputs?t.inputs.map(Oi.fromObject):[]};return Li(new e(Ei,n))}static fromString(t){let n={type:"error"},r=t.match(Hi);return r||_i.throwArgumentError("invalid error signature","value",t),n.name=r[1].trim(),n.name&&zi(n.name),n.inputs=xi(r[2],!1),Li(e.fromObject(n))}static isErrorFragment(e){return e&&e._isFragment&&"error"===e.type}};function ji(e){return e.match(/^uint($|[^1-9])/)?e="uint256"+e.substring(4):e.match(/^int($|[^1-9])/)&&(e="int256"+e.substring(3)),e}const qi=new RegExp("^[a-zA-Z$_][a-zA-Z0-9$_]*$");function zi(e){return e&&e.match(qi)||_i.throwArgumentError(`invalid identifier "${e}"`,"value",e),e}const Hi=new RegExp("^([^)(]*)\\((.*)\\)([^)(]*)$");const Gi=new pr(wi);function Vi(e){const t=[],n=function(e,r){if(Array.isArray(r))for(let i in r){const a=e.slice();a.push(i);try{n(a,r[i])}catch(e){t.push({path:a,error:e})}}};return n([],e),t}let Ki=class{constructor(e,t,n,r){this.name=e,this.type=t,this.localName=n,this.dynamic=r}_throwError(e,t){Gi.throwArgumentError(e,this.localName,t)}},Wi=class{constructor(e){ui(this,"wordSize",e||32),this._data=[],this._dataLength=0,this._padding=new Uint8Array(e)}get data(){return xr(this._data)}get length(){return this._dataLength}_writeData(e){return this._data.push(e),this._dataLength+=e.length,e.length}appendWriter(e){return this._writeData(Er(e._data))}writeBytes(e){let t=_r(e);const n=t.length%this.wordSize;return n&&(t=Er([t,this._padding.slice(n)])),this._writeData(t)}_getValue(e){let t=_r(Hr.from(e));return t.length>this.wordSize&&Gi.throwError("value out-of-bounds",pr.errors.BUFFER_OVERRUN,{length:this.wordSize,offset:t.length}),t.length%this.wordSize&&(t=Er([this._padding.slice(t.length%this.wordSize),t])),t}writeValue(e){return this._writeData(this._getValue(e))}writeUpdatableValue(){const e=this._data.length;return this._data.push(this._padding),this._dataLength+=this.wordSize,t=>{this._data[e]=this._getValue(t)}}};var Xi={exports:{}};
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).immutable={})}(this,(function(e){"use strict";var t;!function(e){e.PRODUCTION="production",e.SANDBOX="sandbox"}(t||(t={}));class n{environment;apiKey;constructor(e){this.environment=e.environment,this.apiKey=e.apiKey}}var r=Object.freeze({__proto__:null,get Environment(){return t},ImmutableConfiguration:n});function i(e,t){return function(){return e.apply(t,arguments)}}const{toString:a}=Object.prototype,{getPrototypeOf:o}=Object,s=(c=Object.create(null),e=>{const t=a.call(e);return c[t]||(c[t]=t.slice(8,-1).toLowerCase())});var c;const u=e=>(e=e.toLowerCase(),t=>s(t)===e),f=e=>t=>typeof t===e,{isArray:d}=Array,l=f("undefined");const p=u("ArrayBuffer");const h=f("string"),b=f("function"),m=f("number"),y=e=>null!==e&&"object"==typeof e,g=e=>{if("object"!==s(e))return!1;const t=o(e);return!(null!==t&&t!==Object.prototype&&null!==Object.getPrototypeOf(t)||Symbol.toStringTag in e||Symbol.iterator in e)},v=u("Date"),w=u("File"),_=u("Blob"),E=u("FileList"),T=u("URLSearchParams");function A(e,t,{allOwnKeys:n=!1}={}){if(null==e)return;let r,i;if("object"!=typeof e&&(e=[e]),d(e))for(r=0,i=e.length;r<i;r++)t.call(null,e[r],r,e);else{const i=n?Object.getOwnPropertyNames(e):Object.keys(e),a=i.length;let o;for(r=0;r<a;r++)o=i[r],t.call(null,e[o],o,e)}}function R(e,t){t=t.toLowerCase();const n=Object.keys(e);let r,i=n.length;for(;i-- >0;)if(r=n[i],t===r.toLowerCase())return r;return null}const S="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:global,k=e=>!l(e)&&e!==S;const I=(O="undefined"!=typeof Uint8Array&&o(Uint8Array),e=>O&&e instanceof O);var O;const x=u("HTMLFormElement"),C=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),M=u("RegExp"),P=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};A(n,((n,i)=>{!1!==t(n,i,e)&&(r[i]=n)})),Object.defineProperties(e,r)},N="abcdefghijklmnopqrstuvwxyz",B="0123456789",D={DIGIT:B,ALPHA:N,ALPHA_DIGIT:N+N.toUpperCase()+B};const F=u("AsyncFunction");var L={isArray:d,isArrayBuffer:p,isBuffer:function(e){return null!==e&&!l(e)&&null!==e.constructor&&!l(e.constructor)&&b(e.constructor.isBuffer)&&e.constructor.isBuffer(e)},isFormData:e=>{let t;return e&&("function"==typeof FormData&&e instanceof FormData||b(e.append)&&("formdata"===(t=s(e))||"object"===t&&b(e.toString)&&"[object FormData]"===e.toString()))},isArrayBufferView:function(e){let t;return t="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&p(e.buffer),t},isString:h,isNumber:m,isBoolean:e=>!0===e||!1===e,isObject:y,isPlainObject:g,isUndefined:l,isDate:v,isFile:w,isBlob:_,isRegExp:M,isFunction:b,isStream:e=>y(e)&&b(e.pipe),isURLSearchParams:T,isTypedArray:I,isFileList:E,forEach:A,merge:function e(){const{caseless:t}=k(this)&&this||{},n={},r=(r,i)=>{const a=t&&R(n,i)||i;g(n[a])&&g(r)?n[a]=e(n[a],r):g(r)?n[a]=e({},r):d(r)?n[a]=r.slice():n[a]=r};for(let e=0,t=arguments.length;e<t;e++)arguments[e]&&A(arguments[e],r);return n},extend:(e,t,n,{allOwnKeys:r}={})=>(A(t,((t,r)=>{n&&b(t)?e[r]=i(t,n):e[r]=t}),{allOwnKeys:r}),e),trim:e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),stripBOM:e=>(65279===e.charCodeAt(0)&&(e=e.slice(1)),e),inherits:(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},toFlatObject:(e,t,n,r)=>{let i,a,s;const c={};if(t=t||{},null==e)return t;do{for(i=Object.getOwnPropertyNames(e),a=i.length;a-- >0;)s=i[a],r&&!r(s,e,t)||c[s]||(t[s]=e[s],c[s]=!0);e=!1!==n&&o(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},kindOf:s,kindOfTest:u,endsWith:(e,t,n)=>{e=String(e),(void 0===n||n>e.length)&&(n=e.length),n-=t.length;const r=e.indexOf(t,n);return-1!==r&&r===n},toArray:e=>{if(!e)return null;if(d(e))return e;let t=e.length;if(!m(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},forEachEntry:(e,t)=>{const n=(e&&e[Symbol.iterator]).call(e);let r;for(;(r=n.next())&&!r.done;){const n=r.value;t.call(e,n[0],n[1])}},matchAll:(e,t)=>{let n;const r=[];for(;null!==(n=e.exec(t));)r.push(n);return r},isHTMLForm:x,hasOwnProperty:C,hasOwnProp:C,reduceDescriptors:P,freezeMethods:e=>{P(e,((t,n)=>{if(b(e)&&-1!==["arguments","caller","callee"].indexOf(n))return!1;const r=e[n];b(r)&&(t.enumerable=!1,"writable"in t?t.writable=!1:t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")}))}))},toObjectSet:(e,t)=>{const n={},r=e=>{e.forEach((e=>{n[e]=!0}))};return d(e)?r(e):r(String(e).split(t)),n},toCamelCase:e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,(function(e,t,n){return t.toUpperCase()+n})),noop:()=>{},toFiniteNumber:(e,t)=>(e=+e,Number.isFinite(e)?e:t),findKey:R,global:S,isContextDefined:k,ALPHABET:D,generateString:(e=16,t=D.ALPHA_DIGIT)=>{let n="";const{length:r}=t;for(;e--;)n+=t[Math.random()*r|0];return n},isSpecCompliantForm:function(e){return!!(e&&b(e.append)&&"FormData"===e[Symbol.toStringTag]&&e[Symbol.iterator])},toJSONObject:e=>{const t=new Array(10),n=(e,r)=>{if(y(e)){if(t.indexOf(e)>=0)return;if(!("toJSON"in e)){t[r]=e;const i=d(e)?[]:{};return A(e,((e,t)=>{const a=n(e,r+1);!l(a)&&(i[t]=a)})),t[r]=void 0,i}}return e};return n(e,0)},isAsyncFn:F,isThenable:e=>e&&(y(e)||b(e))&&b(e.then)&&b(e.catch)};function U(e,t,n,r,i){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack,this.message=e,this.name="AxiosError",t&&(this.code=t),n&&(this.config=n),r&&(this.request=r),i&&(this.response=i)}L.inherits(U,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:L.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});const j=U.prototype,q={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach((e=>{q[e]={value:e}})),Object.defineProperties(U,q),Object.defineProperty(j,"isAxiosError",{value:!0}),U.from=(e,t,n,r,i,a)=>{const o=Object.create(j);return L.toFlatObject(e,o,(function(e){return e!==Error.prototype}),(e=>"isAxiosError"!==e)),U.call(o,e.message,t,n,r,i),o.cause=e,o.name=e.name,a&&Object.assign(o,a),o};function z(e){return L.isPlainObject(e)||L.isArray(e)}function H(e){return L.endsWith(e,"[]")?e.slice(0,-2):e}function G(e,t,n){return e?e.concat(t).map((function(e,t){return e=H(e),!n&&t?"["+e+"]":e})).join(n?".":""):t}const V=L.toFlatObject(L,{},null,(function(e){return/^is[A-Z]/.test(e)}));function K(e,t,n){if(!L.isObject(e))throw new TypeError("target must be an object");t=t||new FormData;const r=(n=L.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,(function(e,t){return!L.isUndefined(t[e])}))).metaTokens,i=n.visitor||u,a=n.dots,o=n.indexes,s=(n.Blob||"undefined"!=typeof Blob&&Blob)&&L.isSpecCompliantForm(t);if(!L.isFunction(i))throw new TypeError("visitor must be a function");function c(e){if(null===e)return"";if(L.isDate(e))return e.toISOString();if(!s&&L.isBlob(e))throw new U("Blob is not supported. Use a Buffer instead.");return L.isArrayBuffer(e)||L.isTypedArray(e)?s&&"function"==typeof Blob?new Blob([e]):Buffer.from(e):e}function u(e,n,i){let s=e;if(e&&!i&&"object"==typeof e)if(L.endsWith(n,"{}"))n=r?n:n.slice(0,-2),e=JSON.stringify(e);else if(L.isArray(e)&&function(e){return L.isArray(e)&&!e.some(z)}(e)||(L.isFileList(e)||L.endsWith(n,"[]"))&&(s=L.toArray(e)))return n=H(n),s.forEach((function(e,r){!L.isUndefined(e)&&null!==e&&t.append(!0===o?G([n],r,a):null===o?n:n+"[]",c(e))})),!1;return!!z(e)||(t.append(G(i,n,a),c(e)),!1)}const f=[],d=Object.assign(V,{defaultVisitor:u,convertValue:c,isVisitable:z});if(!L.isObject(e))throw new TypeError("data must be an object");return function e(n,r){if(!L.isUndefined(n)){if(-1!==f.indexOf(n))throw Error("Circular reference detected in "+r.join("."));f.push(n),L.forEach(n,(function(n,a){!0===(!(L.isUndefined(n)||null===n)&&i.call(t,n,L.isString(a)?a.trim():a,r,d))&&e(n,r?r.concat(a):[a])})),f.pop()}}(e),t}function W(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,(function(e){return t[e]}))}function X(e,t){this._pairs=[],e&&K(e,this,t)}const $=X.prototype;function J(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function Y(e,t,n){if(!t)return e;const r=n&&n.encode||J,i=n&&n.serialize;let a;if(a=i?i(t,n):L.isURLSearchParams(t)?t.toString():new X(t,n).toString(r),a){const t=e.indexOf("#");-1!==t&&(e=e.slice(0,t)),e+=(-1===e.indexOf("?")?"?":"&")+a}return e}$.append=function(e,t){this._pairs.push([e,t])},$.toString=function(e){const t=e?function(t){return e.call(this,t,W)}:W;return this._pairs.map((function(e){return t(e[0])+"="+t(e[1])}),"").join("&")};var Q=class{constructor(){this.handlers=[]}use(e,t,n){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!n&&n.synchronous,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){L.forEach(this.handlers,(function(t){null!==t&&e(t)}))}},Z={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1};var ee={isBrowser:!0,classes:{URLSearchParams:"undefined"!=typeof URLSearchParams?URLSearchParams:X,FormData:"undefined"!=typeof FormData?FormData:null,Blob:"undefined"!=typeof Blob?Blob:null},isStandardBrowserEnv:(()=>{let e;return("undefined"==typeof navigator||"ReactNative"!==(e=navigator.product)&&"NativeScript"!==e&&"NS"!==e)&&("undefined"!=typeof window&&"undefined"!=typeof document)})(),isStandardBrowserWebWorkerEnv:"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,protocols:["http","https","file","blob","url","data"]};function te(e){function t(e,n,r,i){let a=e[i++];const o=Number.isFinite(+a),s=i>=e.length;if(a=!a&&L.isArray(r)?r.length:a,s)return L.hasOwnProp(r,a)?r[a]=[r[a],n]:r[a]=n,!o;r[a]&&L.isObject(r[a])||(r[a]=[]);return t(e,n,r[a],i)&&L.isArray(r[a])&&(r[a]=function(e){const t={},n=Object.keys(e);let r;const i=n.length;let a;for(r=0;r<i;r++)a=n[r],t[a]=e[a];return t}(r[a])),!o}if(L.isFormData(e)&&L.isFunction(e.entries)){const n={};return L.forEachEntry(e,((e,r)=>{t(function(e){return L.matchAll(/\w+|\[(\w*)]/g,e).map((e=>"[]"===e[0]?"":e[1]||e[0]))}(e),r,n,0)})),n}return null}const ne={"Content-Type":void 0};const re={transitional:Z,adapter:["xhr","http"],transformRequest:[function(e,t){const n=t.getContentType()||"",r=n.indexOf("application/json")>-1,i=L.isObject(e);i&&L.isHTMLForm(e)&&(e=new FormData(e));if(L.isFormData(e))return r&&r?JSON.stringify(te(e)):e;if(L.isArrayBuffer(e)||L.isBuffer(e)||L.isStream(e)||L.isFile(e)||L.isBlob(e))return e;if(L.isArrayBufferView(e))return e.buffer;if(L.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let a;if(i){if(n.indexOf("application/x-www-form-urlencoded")>-1)return function(e,t){return K(e,new ee.classes.URLSearchParams,Object.assign({visitor:function(e,t,n,r){return ee.isNode&&L.isBuffer(e)?(this.append(t,e.toString("base64")),!1):r.defaultVisitor.apply(this,arguments)}},t))}(e,this.formSerializer).toString();if((a=L.isFileList(e))||n.indexOf("multipart/form-data")>-1){const t=this.env&&this.env.FormData;return K(a?{"files[]":e}:e,t&&new t,this.formSerializer)}}return i||r?(t.setContentType("application/json",!1),function(e,t,n){if(L.isString(e))try{return(t||JSON.parse)(e),L.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(n||JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){const t=this.transitional||re.transitional,n=t&&t.forcedJSONParsing,r="json"===this.responseType;if(e&&L.isString(e)&&(n&&!this.responseType||r)){const n=!(t&&t.silentJSONParsing)&&r;try{return JSON.parse(e)}catch(e){if(n){if("SyntaxError"===e.name)throw U.from(e,U.ERR_BAD_RESPONSE,this,null,this.response);throw e}}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:ee.classes.FormData,Blob:ee.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};L.forEach(["delete","get","head"],(function(e){re.headers[e]={}})),L.forEach(["post","put","patch"],(function(e){re.headers[e]=L.merge(ne)}));var ie=re;const ae=L.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]);const oe=Symbol("internals");function se(e){return e&&String(e).trim().toLowerCase()}function ce(e){return!1===e||null==e?e:L.isArray(e)?e.map(ce):String(e)}function ue(e,t,n,r,i){return L.isFunction(r)?r.call(this,t,n):(i&&(t=n),L.isString(t)?L.isString(r)?-1!==t.indexOf(r):L.isRegExp(r)?r.test(t):void 0:void 0)}let fe=class{constructor(e){e&&this.set(e)}set(e,t,n){const r=this;function i(e,t,n){const i=se(t);if(!i)throw new Error("header name must be a non-empty string");const a=L.findKey(r,i);(!a||void 0===r[a]||!0===n||void 0===n&&!1!==r[a])&&(r[a||t]=ce(e))}const a=(e,t)=>L.forEach(e,((e,n)=>i(e,n,t)));return L.isPlainObject(e)||e instanceof this.constructor?a(e,t):L.isString(e)&&(e=e.trim())&&!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim())?a((e=>{const t={};let n,r,i;return e&&e.split("\n").forEach((function(e){i=e.indexOf(":"),n=e.substring(0,i).trim().toLowerCase(),r=e.substring(i+1).trim(),!n||t[n]&&ae[n]||("set-cookie"===n?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)})),t})(e),t):null!=e&&i(t,e,n),this}get(e,t){if(e=se(e)){const n=L.findKey(this,e);if(n){const e=this[n];if(!t)return e;if(!0===t)return function(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(e);)t[r[1]]=r[2];return t}(e);if(L.isFunction(t))return t.call(this,e,n);if(L.isRegExp(t))return t.exec(e);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=se(e)){const n=L.findKey(this,e);return!(!n||void 0===this[n]||t&&!ue(0,this[n],n,t))}return!1}delete(e,t){const n=this;let r=!1;function i(e){if(e=se(e)){const i=L.findKey(n,e);!i||t&&!ue(0,n[i],i,t)||(delete n[i],r=!0)}}return L.isArray(e)?e.forEach(i):i(e),r}clear(e){const t=Object.keys(this);let n=t.length,r=!1;for(;n--;){const i=t[n];e&&!ue(0,this[i],i,e,!0)||(delete this[i],r=!0)}return r}normalize(e){const t=this,n={};return L.forEach(this,((r,i)=>{const a=L.findKey(n,i);if(a)return t[a]=ce(r),void delete t[i];const o=e?function(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,((e,t,n)=>t.toUpperCase()+n))}(i):String(i).trim();o!==i&&delete t[i],t[o]=ce(r),n[o]=!0})),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const t=Object.create(null);return L.forEach(this,((n,r)=>{null!=n&&!1!==n&&(t[r]=e&&L.isArray(n)?n.join(", "):n)})),t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map((([e,t])=>e+": "+t)).join("\n")}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...t){const n=new this(e);return t.forEach((e=>n.set(e))),n}static accessor(e){const t=(this[oe]=this[oe]={accessors:{}}).accessors,n=this.prototype;function r(e){const r=se(e);t[r]||(!function(e,t){const n=L.toCamelCase(" "+t);["get","set","has"].forEach((r=>{Object.defineProperty(e,r+n,{value:function(e,n,i){return this[r].call(this,t,e,n,i)},configurable:!0})}))}(n,e),t[r]=!0)}return L.isArray(e)?e.forEach(r):r(e),this}};fe.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),L.freezeMethods(fe.prototype),L.freezeMethods(fe);var de=fe;function le(e,t){const n=this||ie,r=t||n,i=de.from(r.headers);let a=r.data;return L.forEach(e,(function(e){a=e.call(n,a,i.normalize(),t?t.status:void 0)})),i.normalize(),a}function pe(e){return!(!e||!e.__CANCEL__)}function he(e,t,n){U.call(this,null==e?"canceled":e,U.ERR_CANCELED,t,n),this.name="CanceledError"}L.inherits(he,U,{__CANCEL__:!0});var be=ee.isStandardBrowserEnv?{write:function(e,t,n,r,i,a){const o=[];o.push(e+"="+encodeURIComponent(t)),L.isNumber(n)&&o.push("expires="+new Date(n).toGMTString()),L.isString(r)&&o.push("path="+r),L.isString(i)&&o.push("domain="+i),!0===a&&o.push("secure"),document.cookie=o.join("; ")},read:function(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove:function(e){this.write(e,"",Date.now()-864e5)}}:{write:function(){},read:function(){return null},remove:function(){}};function me(e,t){return e&&!/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)?function(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e}(e,t):t}var ye=ee.isStandardBrowserEnv?function(){const e=/(msie|trident)/i.test(navigator.userAgent),t=document.createElement("a");let n;function r(n){let r=n;return e&&(t.setAttribute("href",r),r=t.href),t.setAttribute("href",r),{href:t.href,protocol:t.protocol?t.protocol.replace(/:$/,""):"",host:t.host,search:t.search?t.search.replace(/^\?/,""):"",hash:t.hash?t.hash.replace(/^#/,""):"",hostname:t.hostname,port:t.port,pathname:"/"===t.pathname.charAt(0)?t.pathname:"/"+t.pathname}}return n=r(window.location.href),function(e){const t=L.isString(e)?r(e):e;return t.protocol===n.protocol&&t.host===n.host}}():function(){return!0};function ge(e,t){let n=0;const r=function(e,t){e=e||10;const n=new Array(e),r=new Array(e);let i,a=0,o=0;return t=void 0!==t?t:1e3,function(s){const c=Date.now(),u=r[o];i||(i=c),n[a]=s,r[a]=c;let f=o,d=0;for(;f!==a;)d+=n[f++],f%=e;if(a=(a+1)%e,a===o&&(o=(o+1)%e),c-i<t)return;const l=u&&c-u;return l?Math.round(1e3*d/l):void 0}}(50,250);return i=>{const a=i.loaded,o=i.lengthComputable?i.total:void 0,s=a-n,c=r(s);n=a;const u={loaded:a,total:o,progress:o?a/o:void 0,bytes:s,rate:c||void 0,estimated:c&&o&&a<=o?(o-a)/c:void 0,event:i};u[t?"download":"upload"]=!0,e(u)}}var ve="undefined"!=typeof XMLHttpRequest&&function(e){return new Promise((function(t,n){let r=e.data;const i=de.from(e.headers).normalize(),a=e.responseType;let o;function s(){e.cancelToken&&e.cancelToken.unsubscribe(o),e.signal&&e.signal.removeEventListener("abort",o)}L.isFormData(r)&&(ee.isStandardBrowserEnv||ee.isStandardBrowserWebWorkerEnv?i.setContentType(!1):i.setContentType("multipart/form-data;",!1));let c=new XMLHttpRequest;if(e.auth){const t=e.auth.username||"",n=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";i.set("Authorization","Basic "+btoa(t+":"+n))}const u=me(e.baseURL,e.url);function f(){if(!c)return;const r=de.from("getAllResponseHeaders"in c&&c.getAllResponseHeaders());!function(e,t,n){const r=n.config.validateStatus;n.status&&r&&!r(n.status)?t(new U("Request failed with status code "+n.status,[U.ERR_BAD_REQUEST,U.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n)):e(n)}((function(e){t(e),s()}),(function(e){n(e),s()}),{data:a&&"text"!==a&&"json"!==a?c.response:c.responseText,status:c.status,statusText:c.statusText,headers:r,config:e,request:c}),c=null}if(c.open(e.method.toUpperCase(),Y(u,e.params,e.paramsSerializer),!0),c.timeout=e.timeout,"onloadend"in c?c.onloadend=f:c.onreadystatechange=function(){c&&4===c.readyState&&(0!==c.status||c.responseURL&&0===c.responseURL.indexOf("file:"))&&setTimeout(f)},c.onabort=function(){c&&(n(new U("Request aborted",U.ECONNABORTED,e,c)),c=null)},c.onerror=function(){n(new U("Network Error",U.ERR_NETWORK,e,c)),c=null},c.ontimeout=function(){let t=e.timeout?"timeout of "+e.timeout+"ms exceeded":"timeout exceeded";const r=e.transitional||Z;e.timeoutErrorMessage&&(t=e.timeoutErrorMessage),n(new U(t,r.clarifyTimeoutError?U.ETIMEDOUT:U.ECONNABORTED,e,c)),c=null},ee.isStandardBrowserEnv){const t=(e.withCredentials||ye(u))&&e.xsrfCookieName&&be.read(e.xsrfCookieName);t&&i.set(e.xsrfHeaderName,t)}void 0===r&&i.setContentType(null),"setRequestHeader"in c&&L.forEach(i.toJSON(),(function(e,t){c.setRequestHeader(t,e)})),L.isUndefined(e.withCredentials)||(c.withCredentials=!!e.withCredentials),a&&"json"!==a&&(c.responseType=e.responseType),"function"==typeof e.onDownloadProgress&&c.addEventListener("progress",ge(e.onDownloadProgress,!0)),"function"==typeof e.onUploadProgress&&c.upload&&c.upload.addEventListener("progress",ge(e.onUploadProgress)),(e.cancelToken||e.signal)&&(o=t=>{c&&(n(!t||t.type?new he(null,e,c):t),c.abort(),c=null)},e.cancelToken&&e.cancelToken.subscribe(o),e.signal&&(e.signal.aborted?o():e.signal.addEventListener("abort",o)));const d=function(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}(u);d&&-1===ee.protocols.indexOf(d)?n(new U("Unsupported protocol "+d+":",U.ERR_BAD_REQUEST,e)):c.send(r||null)}))};const we={http:null,xhr:ve};L.forEach(we,((e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch(e){}Object.defineProperty(e,"adapterName",{value:t})}}));var _e=e=>{e=L.isArray(e)?e:[e];const{length:t}=e;let n,r;for(let i=0;i<t&&(n=e[i],!(r=L.isString(n)?we[n.toLowerCase()]:n));i++);if(!r){if(!1===r)throw new U(`Adapter ${n} is not supported by the environment`,"ERR_NOT_SUPPORT");throw new Error(L.hasOwnProp(we,n)?`Adapter '${n}' is not available in the build`:`Unknown adapter '${n}'`)}if(!L.isFunction(r))throw new TypeError("adapter is not a function");return r};function Ee(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new he(null,e)}function Te(e){Ee(e),e.headers=de.from(e.headers),e.data=le.call(e,e.transformRequest),-1!==["post","put","patch"].indexOf(e.method)&&e.headers.setContentType("application/x-www-form-urlencoded",!1);return _e(e.adapter||ie.adapter)(e).then((function(t){return Ee(e),t.data=le.call(e,e.transformResponse,t),t.headers=de.from(t.headers),t}),(function(t){return pe(t)||(Ee(e),t&&t.response&&(t.response.data=le.call(e,e.transformResponse,t.response),t.response.headers=de.from(t.response.headers))),Promise.reject(t)}))}const Ae=e=>e instanceof de?e.toJSON():e;function Re(e,t){t=t||{};const n={};function r(e,t,n){return L.isPlainObject(e)&&L.isPlainObject(t)?L.merge.call({caseless:n},e,t):L.isPlainObject(t)?L.merge({},t):L.isArray(t)?t.slice():t}function i(e,t,n){return L.isUndefined(t)?L.isUndefined(e)?void 0:r(void 0,e,n):r(e,t,n)}function a(e,t){if(!L.isUndefined(t))return r(void 0,t)}function o(e,t){return L.isUndefined(t)?L.isUndefined(e)?void 0:r(void 0,e):r(void 0,t)}function s(n,i,a){return a in t?r(n,i):a in e?r(void 0,n):void 0}const c={url:a,method:a,data:a,baseURL:o,transformRequest:o,transformResponse:o,paramsSerializer:o,timeout:o,timeoutMessage:o,withCredentials:o,adapter:o,responseType:o,xsrfCookieName:o,xsrfHeaderName:o,onUploadProgress:o,onDownloadProgress:o,decompress:o,maxContentLength:o,maxBodyLength:o,beforeRedirect:o,transport:o,httpAgent:o,httpsAgent:o,cancelToken:o,socketPath:o,responseEncoding:o,validateStatus:s,headers:(e,t)=>i(Ae(e),Ae(t),!0)};return L.forEach(Object.keys(Object.assign({},e,t)),(function(r){const a=c[r]||i,o=a(e[r],t[r],r);L.isUndefined(o)&&a!==s||(n[r]=o)})),n}const Se="1.4.0",ke={};["object","boolean","number","function","string","symbol"].forEach(((e,t)=>{ke[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}}));const Ie={};ke.transitional=function(e,t,n){function r(e,t){return"[Axios v1.4.0] Transitional option '"+e+"'"+t+(n?". "+n:"")}return(n,i,a)=>{if(!1===e)throw new U(r(i," has been removed"+(t?" in "+t:"")),U.ERR_DEPRECATED);return t&&!Ie[i]&&(Ie[i]=!0,console.warn(r(i," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(n,i,a)}};var Oe={assertOptions:function(e,t,n){if("object"!=typeof e)throw new U("options must be an object",U.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let i=r.length;for(;i-- >0;){const a=r[i],o=t[a];if(o){const t=e[a],n=void 0===t||o(t,a,e);if(!0!==n)throw new U("option "+a+" must be "+n,U.ERR_BAD_OPTION_VALUE)}else if(!0!==n)throw new U("Unknown option "+a,U.ERR_BAD_OPTION)}},validators:ke};const xe=Oe.validators;let Ce=class{constructor(e){this.defaults=e,this.interceptors={request:new Q,response:new Q}}request(e,t){"string"==typeof e?(t=t||{}).url=e:t=e||{},t=Re(this.defaults,t);const{transitional:n,paramsSerializer:r,headers:i}=t;let a;void 0!==n&&Oe.assertOptions(n,{silentJSONParsing:xe.transitional(xe.boolean),forcedJSONParsing:xe.transitional(xe.boolean),clarifyTimeoutError:xe.transitional(xe.boolean)},!1),null!=r&&(L.isFunction(r)?t.paramsSerializer={serialize:r}:Oe.assertOptions(r,{encode:xe.function,serialize:xe.function},!0)),t.method=(t.method||this.defaults.method||"get").toLowerCase(),a=i&&L.merge(i.common,i[t.method]),a&&L.forEach(["delete","get","head","post","put","patch","common"],(e=>{delete i[e]})),t.headers=de.concat(a,i);const o=[];let s=!0;this.interceptors.request.forEach((function(e){"function"==typeof e.runWhen&&!1===e.runWhen(t)||(s=s&&e.synchronous,o.unshift(e.fulfilled,e.rejected))}));const c=[];let u;this.interceptors.response.forEach((function(e){c.push(e.fulfilled,e.rejected)}));let f,d=0;if(!s){const e=[Te.bind(this),void 0];for(e.unshift.apply(e,o),e.push.apply(e,c),f=e.length,u=Promise.resolve(t);d<f;)u=u.then(e[d++],e[d++]);return u}f=o.length;let l=t;for(d=0;d<f;){const e=o[d++],t=o[d++];try{l=e(l)}catch(e){t.call(this,e);break}}try{u=Te.call(this,l)}catch(e){return Promise.reject(e)}for(d=0,f=c.length;d<f;)u=u.then(c[d++],c[d++]);return u}getUri(e){return Y(me((e=Re(this.defaults,e)).baseURL,e.url),e.params,e.paramsSerializer)}};L.forEach(["delete","get","head","options"],(function(e){Ce.prototype[e]=function(t,n){return this.request(Re(n||{},{method:e,url:t,data:(n||{}).data}))}})),L.forEach(["post","put","patch"],(function(e){function t(t){return function(n,r,i){return this.request(Re(i||{},{method:e,headers:t?{"Content-Type":"multipart/form-data"}:{},url:n,data:r}))}}Ce.prototype[e]=t(),Ce.prototype[e+"Form"]=t(!0)}));var Me=Ce;var Pe=class e{constructor(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");let t;this.promise=new Promise((function(e){t=e}));const n=this;this.promise.then((e=>{if(!n._listeners)return;let t=n._listeners.length;for(;t-- >0;)n._listeners[t](e);n._listeners=null})),this.promise.then=e=>{let t;const r=new Promise((e=>{n.subscribe(e),t=e})).then(e);return r.cancel=function(){n.unsubscribe(t)},r},e((function(e,r,i){n.reason||(n.reason=new he(e,r,i),t(n.reason))}))}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){this.reason?e(this.reason):this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const t=this._listeners.indexOf(e);-1!==t&&this._listeners.splice(t,1)}static source(){let t;const n=new e((function(e){t=e}));return{token:n,cancel:t}}};const Ne={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(Ne).forEach((([e,t])=>{Ne[t]=e}));var Be=Ne;const De=function e(t){const n=new Me(t),r=i(Me.prototype.request,n);return L.extend(r,Me.prototype,n,{allOwnKeys:!0}),L.extend(r,n,null,{allOwnKeys:!0}),r.create=function(n){return e(Re(t,n))},r}(ie);De.Axios=Me,De.CanceledError=he,De.CancelToken=Pe,De.isCancel=pe,De.VERSION=Se,De.toFormData=K,De.AxiosError=U,De.Cancel=De.CanceledError,De.all=function(e){return Promise.all(e)},De.spread=function(e){return function(t){return e.apply(null,t)}},De.isAxiosError=function(e){return L.isObject(e)&&!0===e.isAxiosError},De.mergeConfig=Re,De.AxiosHeaders=de,De.formToJSON=e=>te(L.isHTMLForm(e)?new FormData(e):e),De.HttpStatusCode=Be,De.default=De;var Fe=De;const{Axios:Le,AxiosError:Ue,CanceledError:je,isCancel:qe,CancelToken:ze,VERSION:He,all:Ge,Cancel:Ve,isAxiosError:Ke,spread:We,toFormData:Xe,AxiosHeaders:$e,HttpStatusCode:Je,formToJSON:Ye,mergeConfig:Qe}=Fe;const Ze="https://api.sandbox.immutable.com".replace(/\/+$/,"");let et=class{basePath;axios;configuration;constructor(e,t=Ze,n=Fe){this.basePath=t,this.axios=n,e&&(this.configuration=e,this.basePath=e.basePath||this.basePath)}},tt=class extends Error{field;name="RequiredError";constructor(e,t){super(t),this.field=e}};const nt="https://example.com",rt=function(e,t,n){if(null==n)throw new tt(t,`Required parameter ${t} was null or undefined when calling ${e}.`)},it=async function(e,t,n){if(n&&n.apiKey){const r="function"==typeof n.apiKey?await n.apiKey(t):await n.apiKey;e[t]=r}},at=async function(e,t){if(t&&t.accessToken){const n="function"==typeof t.accessToken?await t.accessToken():await t.accessToken;e.Authorization="Bearer "+n}};function ot(e,t,n=""){"object"==typeof t?Array.isArray(t)?t.forEach((t=>ot(e,t,n))):Object.keys(t).forEach((r=>ot(e,t[r],`${n}${""!==n?".":""}${r}`))):e.has(n)?e.append(n,t):e.set(n,t)}const st=function(e,...t){const n=new URLSearchParams(e.search);ot(n,t),e.search=n.toString()},ct=function(e,t,n){const r="string"!=typeof e;return(r&&n&&n.isJsonMime?n.isJsonMime(t.headers["Content-Type"]):r)?JSON.stringify(void 0!==e?e:{}):e||""},ut=function(e){return e.pathname+e.search+e.hash},ft=function(e,t,n,r){return(i=t,a=n)=>{const o={...e.options,url:(r?.basePath||a)+e.url};return i.request(o)}},dt=function(e){return{getActivity:async(t,n,r={})=>{rt("getActivity","chainName",t),rt("getActivity","activityId",n);const i="/v1/chains/{chain_name}/activities/{activity_id}".replace("{chain_name}",encodeURIComponent(String(t))).replace("{activity_id}",encodeURIComponent(String(n))),a=new URL(i,nt);let o;e&&(o=e.baseOptions);const s={method:"GET",...o,...r};st(a,{});let c=o&&o.headers?o.headers:{};return s.headers={...c,...r.headers},{url:ut(a),options:s}},listActivities:async(t,n,r,i,a,o,s,c,u,f,d={})=>{rt("listActivities","chainName",t);const l="/v1/chains/{chain_name}/activities".replace("{chain_name}",encodeURIComponent(String(t))),p=new URL(l,nt);let h;e&&(h=e.baseOptions);const b={method:"GET",...h,...d},m={};void 0!==n&&(m.contract_address=n),void 0!==r&&(m.token_id=r),void 0!==i&&(m.account_address=i),void 0!==a&&(m.activity_type=a),void 0!==o&&(m.from_indexed_at=o instanceof Date?o.toISOString():o),void 0!==s&&(m.to_indexed_at=s instanceof Date?s.toISOString():s),void 0!==c&&(m.transaction_hash=c),void 0!==u&&(m.page_cursor=u),void 0!==f&&(m.page_size=f),st(p,m);let y=h&&h.headers?h.headers:{};return b.headers={...y,...d.headers},{url:ut(p),options:b}}}},lt=function(e){const t=dt(e);return{async getActivity(n,r,i){const a=await t.getActivity(n,r,i);return ft(a,Fe,Ze,e)},async listActivities(n,r,i,a,o,s,c,u,f,d,l){const p=await t.listActivities(n,r,i,a,o,s,c,u,f,d,l);return ft(p,Fe,Ze,e)}}};class pt extends et{getActivity(e,t){return lt(this.configuration).getActivity(e.chainName,e.activityId,t).then((e=>e(this.axios,this.basePath)))}listActivities(e,t){return lt(this.configuration).listActivities(e.chainName,e.contractAddress,e.tokenId,e.accountAddress,e.activityType,e.fromIndexedAt,e.toIndexedAt,e.transactionHash,e.pageCursor,e.pageSize,t).then((e=>e(this.axios,this.basePath)))}}const ht=function(e){return{listChains:async(t,n,r={})=>{const i=new URL("/v1/chains",nt);let a;e&&(a=e.baseOptions);const o={method:"GET",...a,...r},s={};void 0!==t&&(s.page_cursor=t),void 0!==n&&(s.page_size=n),st(i,s);let c=a&&a.headers?a.headers:{};return o.headers={...c,...r.headers},{url:ut(i),options:o}}}},bt=function(e){const t=ht(e);return{async listChains(n,r,i){const a=await t.listChains(n,r,i);return ft(a,Fe,Ze,e)}}};class mt extends et{listChains(e={},t){return bt(this.configuration).listChains(e.pageCursor,e.pageSize,t).then((e=>e(this.axios,this.basePath)))}}const yt=function(e){return{getCollection:async(t,n,r={})=>{rt("getCollection","contractAddress",t),rt("getCollection","chainName",n);const i="/v1/chains/{chain_name}/collections/{contract_address}".replace("{contract_address}",encodeURIComponent(String(t))).replace("{chain_name}",encodeURIComponent(String(n))),a=new URL(i,nt);let o;e&&(o=e.baseOptions);const s={method:"GET",...o,...r};st(a,{});let c=o&&o.headers?o.headers:{};return s.headers={...c,...r.headers},{url:ut(a),options:s}},listCollections:async(t,n,r,i={})=>{rt("listCollections","chainName",t);const a="/v1/chains/{chain_name}/collections".replace("{chain_name}",encodeURIComponent(String(t))),o=new URL(a,nt);let s;e&&(s=e.baseOptions);const c={method:"GET",...s,...i},u={};void 0!==n&&(u.page_cursor=n),void 0!==r&&(u.page_size=r),st(o,u);let f=s&&s.headers?s.headers:{};return c.headers={...f,...i.headers},{url:ut(o),options:c}},listCollectionsByNFTOwner:async(t,n,r,i,a={})=>{rt("listCollectionsByNFTOwner","accountAddress",t),rt("listCollectionsByNFTOwner","chainName",n);const o="/v1/chains/{chain_name}/accounts/{account_address}/collections".replace("{account_address}",encodeURIComponent(String(t))).replace("{chain_name}",encodeURIComponent(String(n))),s=new URL(o,nt);let c;e&&(c=e.baseOptions);const u={method:"GET",...c,...a},f={};void 0!==r&&(f.page_cursor=r),void 0!==i&&(f.page_size=i),st(s,f);let d=c&&c.headers?c.headers:{};return u.headers={...d,...a.headers},{url:ut(s),options:u}},refreshCollectionMetadata:async(t,n,r,i={})=>{rt("refreshCollectionMetadata","contractAddress",t),rt("refreshCollectionMetadata","chainName",n),rt("refreshCollectionMetadata","refreshCollectionMetadataRequest",r);const a="/v1/chains/{chain_name}/collections/{contract_address}/refresh-metadata".replace("{contract_address}",encodeURIComponent(String(t))).replace("{chain_name}",encodeURIComponent(String(n))),o=new URL(a,nt);let s;e&&(s=e.baseOptions);const c={method:"POST",...s,...i},u={};await it(u,"X-Immutable-API-Key",e),u["Content-Type"]="application/json",st(o,{});let f=s&&s.headers?s.headers:{};return c.headers={...u,...f,...i.headers},c.data=ct(r,c,e),{url:ut(o),options:c}}}},gt=function(e){const t=yt(e);return{async getCollection(n,r,i){const a=await t.getCollection(n,r,i);return ft(a,Fe,Ze,e)},async listCollections(n,r,i,a){const o=await t.listCollections(n,r,i,a);return ft(o,Fe,Ze,e)},async listCollectionsByNFTOwner(n,r,i,a,o){const s=await t.listCollectionsByNFTOwner(n,r,i,a,o);return ft(s,Fe,Ze,e)},async refreshCollectionMetadata(n,r,i,a){const o=await t.refreshCollectionMetadata(n,r,i,a);return ft(o,Fe,Ze,e)}}};class vt extends et{getCollection(e,t){return gt(this.configuration).getCollection(e.contractAddress,e.chainName,t).then((e=>e(this.axios,this.basePath)))}listCollections(e,t){return gt(this.configuration).listCollections(e.chainName,e.pageCursor,e.pageSize,t).then((e=>e(this.axios,this.basePath)))}listCollectionsByNFTOwner(e,t){return gt(this.configuration).listCollectionsByNFTOwner(e.accountAddress,e.chainName,e.pageCursor,e.pageSize,t).then((e=>e(this.axios,this.basePath)))}refreshCollectionMetadata(e,t){return gt(this.configuration).refreshCollectionMetadata(e.contractAddress,e.chainName,e.refreshCollectionMetadataRequest,t).then((e=>e(this.axios,this.basePath)))}}const wt=function(e){return{getMetadata:async(t,n,r,i={})=>{rt("getMetadata","chainName",t),rt("getMetadata","contractAddress",n),rt("getMetadata","metadataId",r);const a="/v1/chains/{chain_name}/collections/{contract_address}/metadata/{metadata_id}".replace("{chain_name}",encodeURIComponent(String(t))).replace("{contract_address}",encodeURIComponent(String(n))).replace("{metadata_id}",encodeURIComponent(String(r))),o=new URL(a,nt);let s;e&&(s=e.baseOptions);const c={method:"GET",...s,...i};st(o,{});let u=s&&s.headers?s.headers:{};return c.headers={...u,...i.headers},{url:ut(o),options:c}},refreshMetadataByID:async(t,n,r,i={})=>{rt("refreshMetadataByID","chainName",t),rt("refreshMetadataByID","contractAddress",n),rt("refreshMetadataByID","refreshMetadataByIDRequest",r);const a="/v1/chains/{chain_name}/collections/{contract_address}/metadata/refresh-metadata".replace("{chain_name}",encodeURIComponent(String(t))).replace("{contract_address}",encodeURIComponent(String(n))),o=new URL(a,nt);let s;e&&(s=e.baseOptions);const c={method:"POST",...s,...i},u={};await it(u,"X-Immutable-API-Key",e),u["Content-Type"]="application/json",st(o,{});let f=s&&s.headers?s.headers:{};return c.headers={...u,...f,...i.headers},c.data=ct(r,c,e),{url:ut(o),options:c}}}},_t=function(e){const t=wt(e);return{async getMetadata(n,r,i,a){const o=await t.getMetadata(n,r,i,a);return ft(o,Fe,Ze,e)},async refreshMetadataByID(n,r,i,a){const o=await t.refreshMetadataByID(n,r,i,a);return ft(o,Fe,Ze,e)}}};const Et=function(e){return{listNFTOwners:async(t,n,r,i,a,o={})=>{rt("listNFTOwners","contractAddress",t),rt("listNFTOwners","tokenId",n),rt("listNFTOwners","chainName",r);const s="/v1/chains/{chain_name}/collections/{contract_address}/nfts/{token_id}/owners".replace("{contract_address}",encodeURIComponent(String(t))).replace("{token_id}",encodeURIComponent(String(n))).replace("{chain_name}",encodeURIComponent(String(r))),c=new URL(s,nt);let u;e&&(u=e.baseOptions);const f={method:"GET",...u,...o},d={};void 0!==i&&(d.page_cursor=i),void 0!==a&&(d.page_size=a),st(c,d);let l=u&&u.headers?u.headers:{};return f.headers={...l,...o.headers},{url:ut(c),options:f}}}},Tt=function(e){const t=Et(e);return{async listNFTOwners(n,r,i,a,o,s){const c=await t.listNFTOwners(n,r,i,a,o,s);return ft(c,Fe,Ze,e)}}};class At extends et{listNFTOwners(e,t){return Tt(this.configuration).listNFTOwners(e.contractAddress,e.tokenId,e.chainName,e.pageCursor,e.pageSize,t).then((e=>e(this.axios,this.basePath)))}}const Rt=function(e){return{getNFT:async(t,n,r,i={})=>{rt("getNFT","contractAddress",t),rt("getNFT","tokenId",n),rt("getNFT","chainName",r);const a="/v1/chains/{chain_name}/collections/{contract_address}/nfts/{token_id}".replace("{contract_address}",encodeURIComponent(String(t))).replace("{token_id}",encodeURIComponent(String(n))).replace("{chain_name}",encodeURIComponent(String(r))),o=new URL(a,nt);let s;e&&(s=e.baseOptions);const c={method:"GET",...s,...i};st(o,{});let u=s&&s.headers?s.headers:{};return c.headers={...u,...i.headers},{url:ut(o),options:c}},listNFTs:async(t,n,r,i,a={})=>{rt("listNFTs","contractAddress",t),rt("listNFTs","chainName",n);const o="/v1/chains/{chain_name}/collections/{contract_address}/nfts".replace("{contract_address}",encodeURIComponent(String(t))).replace("{chain_name}",encodeURIComponent(String(n))),s=new URL(o,nt);let c;e&&(c=e.baseOptions);const u={method:"GET",...c,...a},f={};void 0!==r&&(f.page_cursor=r),void 0!==i&&(f.page_size=i),st(s,f);let d=c&&c.headers?c.headers:{};return u.headers={...d,...a.headers},{url:ut(s),options:u}},listNFTsByAccountAddress:async(t,n,r,i,a,o={})=>{rt("listNFTsByAccountAddress","accountAddress",t),rt("listNFTsByAccountAddress","chainName",n);const s="/v1/chains/{chain_name}/accounts/{account_address}/nfts".replace("{account_address}",encodeURIComponent(String(t))).replace("{chain_name}",encodeURIComponent(String(n))),c=new URL(s,nt);let u;e&&(u=e.baseOptions);const f={method:"GET",...u,...o},d={};void 0!==r&&(d.contract_address=r),void 0!==i&&(d.page_cursor=i),void 0!==a&&(d.page_size=a),st(c,d);let l=u&&u.headers?u.headers:{};return f.headers={...l,...o.headers},{url:ut(c),options:f}}}},St=function(e){const t=Rt(e);return{async getNFT(n,r,i,a){const o=await t.getNFT(n,r,i,a);return ft(o,Fe,Ze,e)},async listNFTs(n,r,i,a,o){const s=await t.listNFTs(n,r,i,a,o);return ft(s,Fe,Ze,e)},async listNFTsByAccountAddress(n,r,i,a,o,s){const c=await t.listNFTsByAccountAddress(n,r,i,a,o,s);return ft(c,Fe,Ze,e)}}};class kt extends et{getNFT(e,t){return St(this.configuration).getNFT(e.contractAddress,e.tokenId,e.chainName,t).then((e=>e(this.axios,this.basePath)))}listNFTs(e,t){return St(this.configuration).listNFTs(e.contractAddress,e.chainName,e.pageCursor,e.pageSize,t).then((e=>e(this.axios,this.basePath)))}listNFTsByAccountAddress(e,t){return St(this.configuration).listNFTsByAccountAddress(e.accountAddress,e.chainName,e.contractAddress,e.pageCursor,e.pageSize,t).then((e=>e(this.axios,this.basePath)))}}const It=function(e){return{createListing:async(t,n,r={})=>{rt("createListing","chainName",t),rt("createListing","createListingRequestBody",n);const i="/v1/chains/{chain_name}/orders/listings".replace("{chain_name}",encodeURIComponent(String(t))),a=new URL(i,nt);let o;e&&(o=e.baseOptions);const s={method:"POST",...o,...r},c={};c["Content-Type"]="application/json",st(a,{});let u=o&&o.headers?o.headers:{};return s.headers={...c,...u,...r.headers},s.data=ct(n,s,e),{url:ut(a),options:s}},fulfillmentData:async(t,n,r={})=>{rt("fulfillmentData","chainName",t),rt("fulfillmentData","fulfillmentDataRequest",n);const i="/v1/chains/{chain_name}/orders/fulfillment-data".replace("{chain_name}",encodeURIComponent(String(t))),a=new URL(i,nt);let o;e&&(o=e.baseOptions);const s={method:"POST",...o,...r},c={};c["Content-Type"]="application/json",st(a,{});let u=o&&o.headers?o.headers:{};return s.headers={...c,...u,...r.headers},s.data=ct(n,s,e),{url:ut(a),options:s}},getListing:async(t,n,r={})=>{rt("getListing","chainName",t),rt("getListing","listingId",n);const i="/v1/chains/{chain_name}/orders/listings/{listing_id}".replace("{chain_name}",encodeURIComponent(String(t))).replace("{listing_id}",encodeURIComponent(String(n))),a=new URL(i,nt);let o;e&&(o=e.baseOptions);const s={method:"GET",...o,...r};st(a,{});let c=o&&o.headers?o.headers:{};return s.headers={...c,...r.headers},{url:ut(a),options:s}},getTrade:async(t,n,r={})=>{rt("getTrade","chainName",t),rt("getTrade","tradeId",n);const i="/v1/chains/{chain_name}/trades/{trade_id}".replace("{chain_name}",encodeURIComponent(String(t))).replace("{trade_id}",encodeURIComponent(String(n))),a=new URL(i,nt);let o;e&&(o=e.baseOptions);const s={method:"GET",...o,...r};st(a,{});let c=o&&o.headers?o.headers:{};return s.headers={...c,...r.headers},{url:ut(a),options:s}},listListings:async(t,n,r,i,a,o,s,c,u,f={})=>{rt("listListings","chainName",t);const d="/v1/chains/{chain_name}/orders/listings".replace("{chain_name}",encodeURIComponent(String(t))),l=new URL(d,nt);let p;e&&(p=e.baseOptions);const h={method:"GET",...p,...f},b={};void 0!==n&&(b.status=n),void 0!==r&&(b.sell_item_contract_address=r),void 0!==i&&(b.buy_item_contract_address=i),void 0!==a&&(b.sell_item_token_id=a),void 0!==o&&(b.page_size=o),void 0!==s&&(b.sort_by=s),void 0!==c&&(b.sort_direction=c),void 0!==u&&(b.page_cursor=u),st(l,b);let m=p&&p.headers?p.headers:{};return h.headers={...m,...f.headers},{url:ut(l),options:h}},listTrades:async(t,n,r,i,a,o,s={})=>{rt("listTrades","chainName",t);const c="/v1/chains/{chain_name}/trades".replace("{chain_name}",encodeURIComponent(String(t))),u=new URL(c,nt);let f;e&&(f=e.baseOptions);const d={method:"GET",...f,...s},l={};void 0!==n&&(l.account_address=n),void 0!==r&&(l.page_size=r),void 0!==i&&(l.sort_by=i),void 0!==a&&(l.sort_direction=a),void 0!==o&&(l.page_cursor=o),st(u,l);let p=f&&f.headers?f.headers:{};return d.headers={...p,...s.headers},{url:ut(u),options:d}}}},Ot=function(e){const t=It(e);return{async createListing(n,r,i){const a=await t.createListing(n,r,i);return ft(a,Fe,Ze,e)},async fulfillmentData(n,r,i){const a=await t.fulfillmentData(n,r,i);return ft(a,Fe,Ze,e)},async getListing(n,r,i){const a=await t.getListing(n,r,i);return ft(a,Fe,Ze,e)},async getTrade(n,r,i){const a=await t.getTrade(n,r,i);return ft(a,Fe,Ze,e)},async listListings(n,r,i,a,o,s,c,u,f,d){const l=await t.listListings(n,r,i,a,o,s,c,u,f,d);return ft(l,Fe,Ze,e)},async listTrades(n,r,i,a,o,s,c){const u=await t.listTrades(n,r,i,a,o,s,c);return ft(u,Fe,Ze,e)}}};class xt extends et{createListing(e,t){return Ot(this.configuration).createListing(e.chainName,e.createListingRequestBody,t).then((e=>e(this.axios,this.basePath)))}fulfillmentData(e,t){return Ot(this.configuration).fulfillmentData(e.chainName,e.fulfillmentDataRequest,t).then((e=>e(this.axios,this.basePath)))}getListing(e,t){return Ot(this.configuration).getListing(e.chainName,e.listingId,t).then((e=>e(this.axios,this.basePath)))}getTrade(e,t){return Ot(this.configuration).getTrade(e.chainName,e.tradeId,t).then((e=>e(this.axios,this.basePath)))}listListings(e,t){return Ot(this.configuration).listListings(e.chainName,e.status,e.sellItemContractAddress,e.buyItemContractAddress,e.sellItemTokenId,e.pageSize,e.sortBy,e.sortDirection,e.pageCursor,t).then((e=>e(this.axios,this.basePath)))}listTrades(e,t){return Ot(this.configuration).listTrades(e.chainName,e.accountAddress,e.pageSize,e.sortBy,e.sortDirection,e.pageCursor,t).then((e=>e(this.axios,this.basePath)))}}const Ct=function(e){return{createCounterfactualAddress:async(t,n={})=>{rt("createCounterfactualAddress","createCounterfactualAddressRequest",t);const r=new URL("/passport-mr/v1/counterfactual-address",nt);let i;e&&(i=e.baseOptions);const a={method:"POST",...i,...n},o={};await at(o,e),o["Content-Type"]="application/json",st(r,{});let s=i&&i.headers?i.headers:{};return a.headers={...o,...s,...n.headers},a.data=ct(t,a,e),{url:ut(r),options:a}},getLinkedAddresses:async(t,n={})=>{rt("getLinkedAddresses","userId",t);const r="/passport-mr/v1/users/{userId}/linked-addresses".replace("{userId}",encodeURIComponent(String(t))),i=new URL(r,nt);let a;e&&(a=e.baseOptions);const o={method:"GET",...a,...n},s={};await at(s,e),st(i,{});let c=a&&a.headers?a.headers:{};return o.headers={...s,...c,...n.headers},{url:ut(i),options:o}}}},Mt=function(e){const t=Ct(e);return{async createCounterfactualAddress(n,r){const i=await t.createCounterfactualAddress(n,r);return ft(i,Fe,Ze,e)},async getLinkedAddresses(n,r){const i=await t.getLinkedAddresses(n,r);return ft(i,Fe,Ze,e)}}};class Pt extends et{createCounterfactualAddress(e,t){return Mt(this.configuration).createCounterfactualAddress(e.createCounterfactualAddressRequest,t).then((e=>e(this.axios,this.basePath)))}getLinkedAddresses(e,t){return Mt(this.configuration).getLinkedAddresses(e.userId,t).then((e=>e(this.axios,this.basePath)))}}const Nt=function(e){return{getERC20Token:async(t,n,r={})=>{rt("getERC20Token","contractAddress",t),rt("getERC20Token","chainName",n);const i="/v1/chains/{chain_name}/tokens/{contract_address}".replace("{contract_address}",encodeURIComponent(String(t))).replace("{chain_name}",encodeURIComponent(String(n))),a=new URL(i,nt);let o;e&&(o=e.baseOptions);const s={method:"GET",...o,...r};st(a,{});let c=o&&o.headers?o.headers:{};return s.headers={...c,...r.headers},{url:ut(a),options:s}},listERC20Tokens:async(t,n,r,i={})=>{rt("listERC20Tokens","chainName",t);const a="/v1/chains/{chain_name}/tokens".replace("{chain_name}",encodeURIComponent(String(t))),o=new URL(a,nt);let s;e&&(s=e.baseOptions);const c={method:"GET",...s,...i},u={};void 0!==n&&(u.page_cursor=n),void 0!==r&&(u.page_size=r),st(o,u);let f=s&&s.headers?s.headers:{};return c.headers={...f,...i.headers},{url:ut(o),options:c}}}},Bt=function(e){const t=Nt(e);return{async getERC20Token(n,r,i){const a=await t.getERC20Token(n,r,i);return ft(a,Fe,Ze,e)},async listERC20Tokens(n,r,i,a){const o=await t.listERC20Tokens(n,r,i,a);return ft(o,Fe,Ze,e)}}};var Dt=Object.freeze({__proto__:null,APIError400AllOfCodeEnum:{ValidationError:"VALIDATION_ERROR"},APIError401AllOfCodeEnum:{UnauthorisedRequest:"UNAUTHORISED_REQUEST"},APIError403AllOfCodeEnum:{AuthenticationError:"AUTHENTICATION_ERROR"},APIError404AllOfCodeEnum:{ResourceNotFound:"RESOURCE_NOT_FOUND"},APIError429AllOfCodeEnum:{TooManyRequestsError:"TOO_MANY_REQUESTS_ERROR"},APIError500AllOfCodeEnum:{InternalServerError:"INTERNAL_SERVER_ERROR"},ActivitiesApi:pt,ActivitiesApiAxiosParamCreator:dt,ActivitiesApiFactory:function(e,t,n){const r=lt(e);return{getActivity:(e,i,a)=>r.getActivity(e,i,a).then((e=>e(n,t))),listActivities:(e,i,a,o,s,c,u,f,d,l,p)=>r.listActivities(e,i,a,o,s,c,u,f,d,l,p).then((e=>e(n,t)))}},ActivitiesApiFp:lt,ActivityType:{Mint:"mint",Burn:"burn",Transfer:"transfer",Sale:"sale",Deposit:"deposit",Withdrawal:"withdrawal"},ChainsApi:mt,ChainsApiAxiosParamCreator:ht,ChainsApiFactory:function(e,t,n){const r=bt(e);return{listChains:(e,i,a)=>r.listChains(e,i,a).then((e=>e(n,t)))}},ChainsApiFp:bt,CollectionContractType:{Erc721:"ERC721"},CollectionsApi:vt,CollectionsApiAxiosParamCreator:yt,CollectionsApiFactory:function(e,t,n){const r=gt(e);return{getCollection:(e,i,a)=>r.getCollection(e,i,a).then((e=>e(n,t))),listCollections:(e,i,a,o)=>r.listCollections(e,i,a,o).then((e=>e(n,t))),listCollectionsByNFTOwner:(e,i,a,o,s)=>r.listCollectionsByNFTOwner(e,i,a,o,s).then((e=>e(n,t))),refreshCollectionMetadata:(e,i,a,o)=>r.refreshCollectionMetadata(e,i,a,o).then((e=>e(n,t)))}},CollectionsApiFp:gt,Configuration:class{apiKey;username;password;accessToken;basePath;baseOptions;formDataCtor;constructor(e={}){this.apiKey=e.apiKey,this.username=e.username,this.password=e.password,this.accessToken=e.accessToken,this.basePath=e.basePath,this.baseOptions=e.baseOptions,this.formDataCtor=e.formDataCtor}isJsonMime(e){const t=new RegExp("^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$","i");return null!==e&&(t.test(e)||"application/json-patch+json"===e.toLowerCase())}},ERC20ItemItemTypeEnum:{Erc20:"ERC20"},ERC721ItemItemTypeEnum:{Erc721:"ERC721"},FeeFeeTypeEnum:{Royalty:"ROYALTY",MakerMarketplace:"MAKER_MARKETPLACE",TakerMarketplace:"TAKER_MARKETPLACE",Protocol:"PROTOCOL"},MetadataApi:class extends et{getMetadata(e,t){return _t(this.configuration).getMetadata(e.chainName,e.contractAddress,e.metadataId,t).then((e=>e(this.axios,this.basePath)))}refreshMetadataByID(e,t){return _t(this.configuration).refreshMetadataByID(e.chainName,e.contractAddress,e.refreshMetadataByIDRequest,t).then((e=>e(this.axios,this.basePath)))}},MetadataApiAxiosParamCreator:wt,MetadataApiFactory:function(e,t,n){const r=_t(e);return{getMetadata:(e,i,a,o)=>r.getMetadata(e,i,a,o).then((e=>e(n,t))),refreshMetadataByID:(e,i,a,o)=>r.refreshMetadataByID(e,i,a,o).then((e=>e(n,t)))}},MetadataApiFp:_t,NFTContractType:{Erc721:"ERC721"},NativeItemItemTypeEnum:{Native:"NATIVE"},NftOwnersApi:At,NftOwnersApiAxiosParamCreator:Et,NftOwnersApiFactory:function(e,t,n){const r=Tt(e);return{listNFTOwners:(e,i,a,o,s,c)=>r.listNFTOwners(e,i,a,o,s,c).then((e=>e(n,t)))}},NftOwnersApiFp:Tt,NftsApi:kt,NftsApiAxiosParamCreator:Rt,NftsApiFactory:function(e,t,n){const r=St(e);return{getNFT:(e,i,a,o)=>r.getNFT(e,i,a,o).then((e=>e(n,t))),listNFTs:(e,i,a,o,s)=>r.listNFTs(e,i,a,o,s).then((e=>e(n,t))),listNFTsByAccountAddress:(e,i,a,o,s,c)=>r.listNFTsByAccountAddress(e,i,a,o,s,c).then((e=>e(n,t)))}},NftsApiFp:St,OrderStatus:{Pending:"PENDING",Active:"ACTIVE",Inactive:"INACTIVE",Filled:"FILLED",Cancelled:"CANCELLED",Expired:"EXPIRED"},OrdersApi:xt,OrdersApiAxiosParamCreator:It,OrdersApiFactory:function(e,t,n){const r=Ot(e);return{createListing:(e,i,a)=>r.createListing(e,i,a).then((e=>e(n,t))),fulfillmentData:(e,i,a)=>r.fulfillmentData(e,i,a).then((e=>e(n,t))),getListing:(e,i,a)=>r.getListing(e,i,a).then((e=>e(n,t))),getTrade:(e,i,a)=>r.getTrade(e,i,a).then((e=>e(n,t))),listListings:(e,i,a,o,s,c,u,f,d,l)=>r.listListings(e,i,a,o,s,c,u,f,d,l).then((e=>e(n,t))),listTrades:(e,i,a,o,s,c,u)=>r.listTrades(e,i,a,o,s,c,u).then((e=>e(n,t)))}},OrdersApiFp:Ot,PassportApi:Pt,PassportApiAxiosParamCreator:Ct,PassportApiFactory:function(e,t,n){const r=Mt(e);return{createCounterfactualAddress:(e,i)=>r.createCounterfactualAddress(e,i).then((e=>e(n,t))),getLinkedAddresses:(e,i)=>r.getLinkedAddresses(e,i).then((e=>e(n,t)))}},PassportApiFp:Mt,ProtocolDataOrderTypeEnum:{FullRestricted:"FULL_RESTRICTED"},SaleFeeTypeEnum:{Royalty:"ROYALTY"},TokenContractType:{Erc20:"ERC20"},TokensApi:class extends et{getERC20Token(e,t){return Bt(this.configuration).getERC20Token(e.contractAddress,e.chainName,t).then((e=>e(this.axios,this.basePath)))}listERC20Tokens(e,t){return Bt(this.configuration).listERC20Tokens(e.chainName,e.pageCursor,e.pageSize,t).then((e=>e(this.axios,this.basePath)))}},TokensApiAxiosParamCreator:Nt,TokensApiFactory:function(e,t,n){const r=Bt(e);return{getERC20Token:(e,i,a)=>r.getERC20Token(e,i,a).then((e=>e(n,t))),listERC20Tokens:(e,i,a,o)=>r.listERC20Tokens(e,i,a,o).then((e=>e(n,t)))}},TokensApiFp:Bt});class Ft{config;activitiesApi;chainsApi;collectionApi;nftOwnersApi;nftsApi;ordersApi;passportApi;constructor(e){this.config=e,this.activitiesApi=new pt(e.indexer),this.chainsApi=new mt(e.indexer),this.collectionApi=new vt(e.indexer),this.nftOwnersApi=new At(e.indexer),this.nftsApi=new kt(e.indexer),this.ordersApi=new xt(e.orderBook),this.passportApi=new Pt(e.passport)}}const Lt={"x-sdk-version":"ts-immutable-sdk-0.21.0"},Ut=({basePath:e,headers:t})=>{if(!e.trim())throw Error("basePath can not be empty");const n={basePath:e,baseOptions:{headers:{...Lt,...t||{}}}};return new class{apiKey;username;password;accessToken;basePath;baseOptions;formDataCtor;constructor(e={}){this.apiKey=e.apiKey,this.username=e.username,this.password=e.password,this.accessToken=e.accessToken,this.basePath=e.basePath,this.baseOptions=e.baseOptions,this.formDataCtor=e.formDataCtor}isJsonMime(e){const t=new RegExp("^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$","i");return null!==e&&(t.test(e)||"application/json-patch+json"===e.toLowerCase())}}(n)},jt=()=>({indexer:Ut({basePath:"https://indexer-mr.imtbl.com"}),orderBook:Ut({basePath:"https://order-book-mr.imtbl.com"}),passport:Ut({basePath:"https://api.immutable.com"})}),qt=()=>({indexer:Ut({basePath:"https://api.sandbox.immutable.com"}),orderBook:Ut({basePath:"https://api.sandbox.immutable.com"}),passport:Ut({basePath:"https://api.sandbox.immutable.com"})});class zt extends Error{code;details;link;traceId;constructor({message:e,code:t,details:n,link:r,trace_id:i}){super(e),this.code=t,this.details=n,this.link=r,this.traceId=i}}const Ht={sdkVersion:"ts-immutable-sdk-multi-rollup-api-client-0.21.0"},Gt=({basePath:e,headers:t})=>{if(!e.trim())throw Error("basePath can not be empty");const n={basePath:e,baseOptions:{headers:{...t||{},...Ht}}};return new Dt.Configuration(n)},Vt=()=>Gt({basePath:"https://api.sandbox.immutable.com"});class Kt{apiConfig;baseConfig;constructor({baseConfig:e,overrides:n}){if(this.baseConfig=e,n)this.apiConfig=Gt(n);else switch(e.environment){case t.SANDBOX:this.apiConfig=Vt();break;case t.PRODUCTION:this.apiConfig=Gt({basePath:"https://indexer-mr.imtbl.com"});break;default:this.apiConfig=Vt()}}}function Wt(e){if(Fe.isAxiosError(e)&&e.response){const t=e.response.data;return t.code&&t.message?new zt({code:t.code,message:t.message,details:t.details||null,link:t.link||"",trace_id:t.trace_id||""}):new zt({code:e.code??e.response?.status.toString()??"unknown_error_code",message:String(e),details:null,link:"",trace_id:""})}return new zt({code:"unknown_error_code",message:String(e),details:null,link:"",trace_id:""})}class Xt{config;activities;chains;collections;nfts;nftOwners;tokens;constructor(e){this.config=new Kt(e),this.activities=new Dt.ActivitiesApi(this.config.apiConfig),this.chains=new Dt.ChainsApi(this.config.apiConfig),this.collections=new Dt.CollectionsApi(this.config.apiConfig),this.nfts=new Dt.NftsApi(this.config.apiConfig),this.nftOwners=new Dt.NftOwnersApi(this.config.apiConfig),this.tokens=new Dt.TokensApi(this.config.apiConfig)}async listActivities(e){return await this.activities.listActivities(e).then((e=>e.data)).catch((e=>{throw Wt(e)}))}async getActivity(e){return await this.activities.getActivity(e).then((e=>e.data)).catch((e=>{throw Wt(e)}))}async listChains(e){return await this.chains.listChains(e).then((e=>e.data)).catch((e=>{throw Wt(e)}))}async listCollections(e){return await this.collections.listCollections(e).then((e=>e.data)).catch((e=>{throw Wt(e)}))}async listCollectionsByNFTOwner(e){return await this.collections.listCollectionsByNFTOwner(e).then((e=>e.data)).catch((e=>{throw Wt(e)}))}async getCollection(e){return await this.collections.getCollection(e).then((e=>e.data)).catch((e=>{throw Wt(e)}))}async getNFT(e){return await this.nfts.getNFT(e).then((e=>e.data)).catch((e=>{throw Wt(e)}))}async listNFTs(e){return await this.nfts.listNFTs(e).then((e=>e.data)).catch((e=>{throw Wt(e)}))}async listNFTsByAccountAddress(e){return await this.nfts.listNFTsByAccountAddress(e).then((e=>e.data)).catch((e=>{throw Wt(e)}))}async listNFTOwners(e){return await this.nftOwners.listNFTOwners(e).then((e=>e.data)).catch((e=>{throw Wt(e)}))}async listTokens(e){return await this.tokens.listERC20Tokens(e).then((e=>e.data)).catch((e=>{throw Wt(e)}))}async getToken(e){return await this.tokens.getERC20Token(e).then((e=>e.data)).catch((e=>{throw Wt(e)}))}}var $t=Object.freeze({__proto__:null,APIError:zt,BlockchainData:Xt}),Jt="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function Yt(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function Qt(e){if(e.__esModule)return e;var t=e.default;if("function"==typeof t){var n=function e(){if(this instanceof e){var n=[null];return n.push.apply(n,arguments),new(Function.bind.apply(t,n))}return t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach((function(t){var r=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(n,t,r.get?r:{enumerable:!0,get:function(){return e[t]}})})),n}var Zt={exports:{}},en="undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},tn=[],nn=[],rn="undefined"!=typeof Uint8Array?Uint8Array:Array,an=!1;function on(){an=!0;for(var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",t=0;t<64;++t)tn[t]=e[t],nn[e.charCodeAt(t)]=t;nn["-".charCodeAt(0)]=62,nn["_".charCodeAt(0)]=63}function sn(e,t,n){for(var r,i,a=[],o=t;o<n;o+=3)r=(e[o]<<16)+(e[o+1]<<8)+e[o+2],a.push(tn[(i=r)>>18&63]+tn[i>>12&63]+tn[i>>6&63]+tn[63&i]);return a.join("")}function cn(e){var t;an||on();for(var n=e.length,r=n%3,i="",a=[],o=16383,s=0,c=n-r;s<c;s+=o)a.push(sn(e,s,s+o>c?c:s+o));return 1===r?(t=e[n-1],i+=tn[t>>2],i+=tn[t<<4&63],i+="=="):2===r&&(t=(e[n-2]<<8)+e[n-1],i+=tn[t>>10],i+=tn[t>>4&63],i+=tn[t<<2&63],i+="="),a.push(i),a.join("")}function un(e,t,n,r,i){var a,o,s=8*i-r-1,c=(1<<s)-1,u=c>>1,f=-7,d=n?i-1:0,l=n?-1:1,p=e[t+d];for(d+=l,a=p&(1<<-f)-1,p>>=-f,f+=s;f>0;a=256*a+e[t+d],d+=l,f-=8);for(o=a&(1<<-f)-1,a>>=-f,f+=r;f>0;o=256*o+e[t+d],d+=l,f-=8);if(0===a)a=1-u;else{if(a===c)return o?NaN:1/0*(p?-1:1);o+=Math.pow(2,r),a-=u}return(p?-1:1)*o*Math.pow(2,a-r)}function fn(e,t,n,r,i,a){var o,s,c,u=8*a-i-1,f=(1<<u)-1,d=f>>1,l=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,p=r?0:a-1,h=r?1:-1,b=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,o=f):(o=Math.floor(Math.log(t)/Math.LN2),t*(c=Math.pow(2,-o))<1&&(o--,c*=2),(t+=o+d>=1?l/c:l*Math.pow(2,1-d))*c>=2&&(o++,c/=2),o+d>=f?(s=0,o=f):o+d>=1?(s=(t*c-1)*Math.pow(2,i),o+=d):(s=t*Math.pow(2,d-1)*Math.pow(2,i),o=0));i>=8;e[n+p]=255&s,p+=h,s/=256,i-=8);for(o=o<<i|s,u+=i;u>0;e[n+p]=255&o,p+=h,o/=256,u-=8);e[n+p-h]|=128*b}var dn={}.toString,ln=Array.isArray||function(e){return"[object Array]"==dn.call(e)};mn.TYPED_ARRAY_SUPPORT=void 0===en.TYPED_ARRAY_SUPPORT||en.TYPED_ARRAY_SUPPORT;var pn=hn();function hn(){return mn.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function bn(e,t){if(hn()<t)throw new RangeError("Invalid typed array length");return mn.TYPED_ARRAY_SUPPORT?(e=new Uint8Array(t)).__proto__=mn.prototype:(null===e&&(e=new mn(t)),e.length=t),e}function mn(e,t,n){if(!(mn.TYPED_ARRAY_SUPPORT||this instanceof mn))return new mn(e,t,n);if("number"==typeof e){if("string"==typeof t)throw new Error("If encoding is specified then the first argument must be a string");return vn(this,e)}return yn(this,e,t,n)}function yn(e,t,n,r){if("number"==typeof t)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&t instanceof ArrayBuffer?function(e,t,n,r){if(t.byteLength,n<0||t.byteLength<n)throw new RangeError("'offset' is out of bounds");if(t.byteLength<n+(r||0))throw new RangeError("'length' is out of bounds");t=void 0===n&&void 0===r?new Uint8Array(t):void 0===r?new Uint8Array(t,n):new Uint8Array(t,n,r);mn.TYPED_ARRAY_SUPPORT?(e=t).__proto__=mn.prototype:e=wn(e,t);return e}(e,t,n,r):"string"==typeof t?function(e,t,n){"string"==typeof n&&""!==n||(n="utf8");if(!mn.isEncoding(n))throw new TypeError('"encoding" must be a valid string encoding');var r=0|Tn(t,n);e=bn(e,r);var i=e.write(t,n);i!==r&&(e=e.slice(0,i));return e}(e,t,n):function(e,t){if(En(t)){var n=0|_n(t.length);return 0===(e=bn(e,n)).length||t.copy(e,0,0,n),e}if(t){if("undefined"!=typeof ArrayBuffer&&t.buffer instanceof ArrayBuffer||"length"in t)return"number"!=typeof t.length||(r=t.length)!=r?bn(e,0):wn(e,t);if("Buffer"===t.type&&ln(t.data))return wn(e,t.data)}var r;throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(e,t)}function gn(e){if("number"!=typeof e)throw new TypeError('"size" argument must be a number');if(e<0)throw new RangeError('"size" argument must not be negative')}function vn(e,t){if(gn(t),e=bn(e,t<0?0:0|_n(t)),!mn.TYPED_ARRAY_SUPPORT)for(var n=0;n<t;++n)e[n]=0;return e}function wn(e,t){var n=t.length<0?0:0|_n(t.length);e=bn(e,n);for(var r=0;r<n;r+=1)e[r]=255&t[r];return e}function _n(e){if(e>=hn())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+hn().toString(16)+" bytes");return 0|e}function En(e){return!(null==e||!e._isBuffer)}function Tn(e,t){if(En(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!=typeof e&&(e=""+e);var n=e.length;if(0===n)return 0;for(var r=!1;;)switch(t){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":case void 0:return Jn(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return Yn(e).length;default:if(r)return Jn(e).length;t=(""+t).toLowerCase(),r=!0}}function An(e,t,n){var r=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if((n>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return Un(this,t,n);case"utf8":case"utf-8":return Bn(this,t,n);case"ascii":return Fn(this,t,n);case"latin1":case"binary":return Ln(this,t,n);case"base64":return Nn(this,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return jn(this,t,n);default:if(r)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),r=!0}}function Rn(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}function Sn(e,t,n,r,i){if(0===e.length)return-1;if("string"==typeof n?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,isNaN(n)&&(n=i?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(i)return-1;n=e.length-1}else if(n<0){if(!i)return-1;n=0}if("string"==typeof t&&(t=mn.from(t,r)),En(t))return 0===t.length?-1:kn(e,t,n,r,i);if("number"==typeof t)return t&=255,mn.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):kn(e,[t],n,r,i);throw new TypeError("val must be string, number or Buffer")}function kn(e,t,n,r,i){var a,o=1,s=e.length,c=t.length;if(void 0!==r&&("ucs2"===(r=String(r).toLowerCase())||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(e.length<2||t.length<2)return-1;o=2,s/=2,c/=2,n/=2}function u(e,t){return 1===o?e[t]:e.readUInt16BE(t*o)}if(i){var f=-1;for(a=n;a<s;a++)if(u(e,a)===u(t,-1===f?0:a-f)){if(-1===f&&(f=a),a-f+1===c)return f*o}else-1!==f&&(a-=a-f),f=-1}else for(n+c>s&&(n=s-c),a=n;a>=0;a--){for(var d=!0,l=0;l<c;l++)if(u(e,a+l)!==u(t,l)){d=!1;break}if(d)return a}return-1}function In(e,t,n,r){n=Number(n)||0;var i=e.length-n;r?(r=Number(r))>i&&(r=i):r=i;var a=t.length;if(a%2!=0)throw new TypeError("Invalid hex string");r>a/2&&(r=a/2);for(var o=0;o<r;++o){var s=parseInt(t.substr(2*o,2),16);if(isNaN(s))return o;e[n+o]=s}return o}function On(e,t,n,r){return Qn(Jn(t,e.length-n),e,n,r)}function xn(e,t,n,r){return Qn(function(e){for(var t=[],n=0;n<e.length;++n)t.push(255&e.charCodeAt(n));return t}(t),e,n,r)}function Cn(e,t,n,r){return xn(e,t,n,r)}function Mn(e,t,n,r){return Qn(Yn(t),e,n,r)}function Pn(e,t,n,r){return Qn(function(e,t){for(var n,r,i,a=[],o=0;o<e.length&&!((t-=2)<0);++o)r=(n=e.charCodeAt(o))>>8,i=n%256,a.push(i),a.push(r);return a}(t,e.length-n),e,n,r)}function Nn(e,t,n){return 0===t&&n===e.length?cn(e):cn(e.slice(t,n))}function Bn(e,t,n){n=Math.min(e.length,n);for(var r=[],i=t;i<n;){var a,o,s,c,u=e[i],f=null,d=u>239?4:u>223?3:u>191?2:1;if(i+d<=n)switch(d){case 1:u<128&&(f=u);break;case 2:128==(192&(a=e[i+1]))&&(c=(31&u)<<6|63&a)>127&&(f=c);break;case 3:a=e[i+1],o=e[i+2],128==(192&a)&&128==(192&o)&&(c=(15&u)<<12|(63&a)<<6|63&o)>2047&&(c<55296||c>57343)&&(f=c);break;case 4:a=e[i+1],o=e[i+2],s=e[i+3],128==(192&a)&&128==(192&o)&&128==(192&s)&&(c=(15&u)<<18|(63&a)<<12|(63&o)<<6|63&s)>65535&&c<1114112&&(f=c)}null===f?(f=65533,d=1):f>65535&&(f-=65536,r.push(f>>>10&1023|55296),f=56320|1023&f),r.push(f),i+=d}return function(e){var t=e.length;if(t<=Dn)return String.fromCharCode.apply(String,e);var n="",r=0;for(;r<t;)n+=String.fromCharCode.apply(String,e.slice(r,r+=Dn));return n}(r)}mn.poolSize=8192,mn._augment=function(e){return e.__proto__=mn.prototype,e},mn.from=function(e,t,n){return yn(null,e,t,n)},mn.TYPED_ARRAY_SUPPORT&&(mn.prototype.__proto__=Uint8Array.prototype,mn.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&mn[Symbol.species]),mn.alloc=function(e,t,n){return function(e,t,n,r){return gn(t),t<=0?bn(e,t):void 0!==n?"string"==typeof r?bn(e,t).fill(n,r):bn(e,t).fill(n):bn(e,t)}(null,e,t,n)},mn.allocUnsafe=function(e){return vn(null,e)},mn.allocUnsafeSlow=function(e){return vn(null,e)},mn.isBuffer=Zn,mn.compare=function(e,t){if(!En(e)||!En(t))throw new TypeError("Arguments must be Buffers");if(e===t)return 0;for(var n=e.length,r=t.length,i=0,a=Math.min(n,r);i<a;++i)if(e[i]!==t[i]){n=e[i],r=t[i];break}return n<r?-1:r<n?1:0},mn.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},mn.concat=function(e,t){if(!ln(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return mn.alloc(0);var n;if(void 0===t)for(t=0,n=0;n<e.length;++n)t+=e[n].length;var r=mn.allocUnsafe(t),i=0;for(n=0;n<e.length;++n){var a=e[n];if(!En(a))throw new TypeError('"list" argument must be an Array of Buffers');a.copy(r,i),i+=a.length}return r},mn.byteLength=Tn,mn.prototype._isBuffer=!0,mn.prototype.swap16=function(){var e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;t<e;t+=2)Rn(this,t,t+1);return this},mn.prototype.swap32=function(){var e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;t<e;t+=4)Rn(this,t,t+3),Rn(this,t+1,t+2);return this},mn.prototype.swap64=function(){var e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var t=0;t<e;t+=8)Rn(this,t,t+7),Rn(this,t+1,t+6),Rn(this,t+2,t+5),Rn(this,t+3,t+4);return this},mn.prototype.toString=function(){var e=0|this.length;return 0===e?"":0===arguments.length?Bn(this,0,e):An.apply(this,arguments)},mn.prototype.equals=function(e){if(!En(e))throw new TypeError("Argument must be a Buffer");return this===e||0===mn.compare(this,e)},mn.prototype.inspect=function(){var e="";return this.length>0&&(e=this.toString("hex",0,50).match(/.{2}/g).join(" "),this.length>50&&(e+=" ... ")),"<Buffer "+e+">"},mn.prototype.compare=function(e,t,n,r,i){if(!En(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===n&&(n=e?e.length:0),void 0===r&&(r=0),void 0===i&&(i=this.length),t<0||n>e.length||r<0||i>this.length)throw new RangeError("out of range index");if(r>=i&&t>=n)return 0;if(r>=i)return-1;if(t>=n)return 1;if(this===e)return 0;for(var a=(i>>>=0)-(r>>>=0),o=(n>>>=0)-(t>>>=0),s=Math.min(a,o),c=this.slice(r,i),u=e.slice(t,n),f=0;f<s;++f)if(c[f]!==u[f]){a=c[f],o=u[f];break}return a<o?-1:o<a?1:0},mn.prototype.includes=function(e,t,n){return-1!==this.indexOf(e,t,n)},mn.prototype.indexOf=function(e,t,n){return Sn(this,e,t,n,!0)},mn.prototype.lastIndexOf=function(e,t,n){return Sn(this,e,t,n,!1)},mn.prototype.write=function(e,t,n,r){if(void 0===t)r="utf8",n=this.length,t=0;else if(void 0===n&&"string"==typeof t)r=t,n=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t|=0,isFinite(n)?(n|=0,void 0===r&&(r="utf8")):(r=n,n=void 0)}var i=this.length-t;if((void 0===n||n>i)&&(n=i),e.length>0&&(n<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");for(var a=!1;;)switch(r){case"hex":return In(this,e,t,n);case"utf8":case"utf-8":return On(this,e,t,n);case"ascii":return xn(this,e,t,n);case"latin1":case"binary":return Cn(this,e,t,n);case"base64":return Mn(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Pn(this,e,t,n);default:if(a)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),a=!0}},mn.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var Dn=4096;function Fn(e,t,n){var r="";n=Math.min(e.length,n);for(var i=t;i<n;++i)r+=String.fromCharCode(127&e[i]);return r}function Ln(e,t,n){var r="";n=Math.min(e.length,n);for(var i=t;i<n;++i)r+=String.fromCharCode(e[i]);return r}function Un(e,t,n){var r=e.length;(!t||t<0)&&(t=0),(!n||n<0||n>r)&&(n=r);for(var i="",a=t;a<n;++a)i+=$n(e[a]);return i}function jn(e,t,n){for(var r=e.slice(t,n),i="",a=0;a<r.length;a+=2)i+=String.fromCharCode(r[a]+256*r[a+1]);return i}function qn(e,t,n){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(e+t>n)throw new RangeError("Trying to access beyond buffer length")}function zn(e,t,n,r,i,a){if(!En(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||t<a)throw new RangeError('"value" argument is out of bounds');if(n+r>e.length)throw new RangeError("Index out of range")}function Hn(e,t,n,r){t<0&&(t=65535+t+1);for(var i=0,a=Math.min(e.length-n,2);i<a;++i)e[n+i]=(t&255<<8*(r?i:1-i))>>>8*(r?i:1-i)}function Gn(e,t,n,r){t<0&&(t=4294967295+t+1);for(var i=0,a=Math.min(e.length-n,4);i<a;++i)e[n+i]=t>>>8*(r?i:3-i)&255}function Vn(e,t,n,r,i,a){if(n+r>e.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function Kn(e,t,n,r,i){return i||Vn(e,0,n,4),fn(e,t,n,r,23,4),n+4}function Wn(e,t,n,r,i){return i||Vn(e,0,n,8),fn(e,t,n,r,52,8),n+8}mn.prototype.slice=function(e,t){var n,r=this.length;if((e=~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),(t=void 0===t?r:~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),t<e&&(t=e),mn.TYPED_ARRAY_SUPPORT)(n=this.subarray(e,t)).__proto__=mn.prototype;else{var i=t-e;n=new mn(i,void 0);for(var a=0;a<i;++a)n[a]=this[a+e]}return n},mn.prototype.readUIntLE=function(e,t,n){e|=0,t|=0,n||qn(e,t,this.length);for(var r=this[e],i=1,a=0;++a<t&&(i*=256);)r+=this[e+a]*i;return r},mn.prototype.readUIntBE=function(e,t,n){e|=0,t|=0,n||qn(e,t,this.length);for(var r=this[e+--t],i=1;t>0&&(i*=256);)r+=this[e+--t]*i;return r},mn.prototype.readUInt8=function(e,t){return t||qn(e,1,this.length),this[e]},mn.prototype.readUInt16LE=function(e,t){return t||qn(e,2,this.length),this[e]|this[e+1]<<8},mn.prototype.readUInt16BE=function(e,t){return t||qn(e,2,this.length),this[e]<<8|this[e+1]},mn.prototype.readUInt32LE=function(e,t){return t||qn(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},mn.prototype.readUInt32BE=function(e,t){return t||qn(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},mn.prototype.readIntLE=function(e,t,n){e|=0,t|=0,n||qn(e,t,this.length);for(var r=this[e],i=1,a=0;++a<t&&(i*=256);)r+=this[e+a]*i;return r>=(i*=128)&&(r-=Math.pow(2,8*t)),r},mn.prototype.readIntBE=function(e,t,n){e|=0,t|=0,n||qn(e,t,this.length);for(var r=t,i=1,a=this[e+--r];r>0&&(i*=256);)a+=this[e+--r]*i;return a>=(i*=128)&&(a-=Math.pow(2,8*t)),a},mn.prototype.readInt8=function(e,t){return t||qn(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},mn.prototype.readInt16LE=function(e,t){t||qn(e,2,this.length);var n=this[e]|this[e+1]<<8;return 32768&n?4294901760|n:n},mn.prototype.readInt16BE=function(e,t){t||qn(e,2,this.length);var n=this[e+1]|this[e]<<8;return 32768&n?4294901760|n:n},mn.prototype.readInt32LE=function(e,t){return t||qn(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},mn.prototype.readInt32BE=function(e,t){return t||qn(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},mn.prototype.readFloatLE=function(e,t){return t||qn(e,4,this.length),un(this,e,!0,23,4)},mn.prototype.readFloatBE=function(e,t){return t||qn(e,4,this.length),un(this,e,!1,23,4)},mn.prototype.readDoubleLE=function(e,t){return t||qn(e,8,this.length),un(this,e,!0,52,8)},mn.prototype.readDoubleBE=function(e,t){return t||qn(e,8,this.length),un(this,e,!1,52,8)},mn.prototype.writeUIntLE=function(e,t,n,r){(e=+e,t|=0,n|=0,r)||zn(this,e,t,n,Math.pow(2,8*n)-1,0);var i=1,a=0;for(this[t]=255&e;++a<n&&(i*=256);)this[t+a]=e/i&255;return t+n},mn.prototype.writeUIntBE=function(e,t,n,r){(e=+e,t|=0,n|=0,r)||zn(this,e,t,n,Math.pow(2,8*n)-1,0);var i=n-1,a=1;for(this[t+i]=255&e;--i>=0&&(a*=256);)this[t+i]=e/a&255;return t+n},mn.prototype.writeUInt8=function(e,t,n){return e=+e,t|=0,n||zn(this,e,t,1,255,0),mn.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},mn.prototype.writeUInt16LE=function(e,t,n){return e=+e,t|=0,n||zn(this,e,t,2,65535,0),mn.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):Hn(this,e,t,!0),t+2},mn.prototype.writeUInt16BE=function(e,t,n){return e=+e,t|=0,n||zn(this,e,t,2,65535,0),mn.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):Hn(this,e,t,!1),t+2},mn.prototype.writeUInt32LE=function(e,t,n){return e=+e,t|=0,n||zn(this,e,t,4,4294967295,0),mn.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):Gn(this,e,t,!0),t+4},mn.prototype.writeUInt32BE=function(e,t,n){return e=+e,t|=0,n||zn(this,e,t,4,4294967295,0),mn.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):Gn(this,e,t,!1),t+4},mn.prototype.writeIntLE=function(e,t,n,r){if(e=+e,t|=0,!r){var i=Math.pow(2,8*n-1);zn(this,e,t,n,i-1,-i)}var a=0,o=1,s=0;for(this[t]=255&e;++a<n&&(o*=256);)e<0&&0===s&&0!==this[t+a-1]&&(s=1),this[t+a]=(e/o>>0)-s&255;return t+n},mn.prototype.writeIntBE=function(e,t,n,r){if(e=+e,t|=0,!r){var i=Math.pow(2,8*n-1);zn(this,e,t,n,i-1,-i)}var a=n-1,o=1,s=0;for(this[t+a]=255&e;--a>=0&&(o*=256);)e<0&&0===s&&0!==this[t+a+1]&&(s=1),this[t+a]=(e/o>>0)-s&255;return t+n},mn.prototype.writeInt8=function(e,t,n){return e=+e,t|=0,n||zn(this,e,t,1,127,-128),mn.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},mn.prototype.writeInt16LE=function(e,t,n){return e=+e,t|=0,n||zn(this,e,t,2,32767,-32768),mn.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):Hn(this,e,t,!0),t+2},mn.prototype.writeInt16BE=function(e,t,n){return e=+e,t|=0,n||zn(this,e,t,2,32767,-32768),mn.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):Hn(this,e,t,!1),t+2},mn.prototype.writeInt32LE=function(e,t,n){return e=+e,t|=0,n||zn(this,e,t,4,2147483647,-2147483648),mn.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):Gn(this,e,t,!0),t+4},mn.prototype.writeInt32BE=function(e,t,n){return e=+e,t|=0,n||zn(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),mn.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):Gn(this,e,t,!1),t+4},mn.prototype.writeFloatLE=function(e,t,n){return Kn(this,e,t,!0,n)},mn.prototype.writeFloatBE=function(e,t,n){return Kn(this,e,t,!1,n)},mn.prototype.writeDoubleLE=function(e,t,n){return Wn(this,e,t,!0,n)},mn.prototype.writeDoubleBE=function(e,t,n){return Wn(this,e,t,!1,n)},mn.prototype.copy=function(e,t,n,r){if(n||(n=0),r||0===r||(r=this.length),t>=e.length&&(t=e.length),t||(t=0),r>0&&r<n&&(r=n),r===n)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("sourceStart out of bounds");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),e.length-t<r-n&&(r=e.length-t+n);var i,a=r-n;if(this===e&&n<t&&t<r)for(i=a-1;i>=0;--i)e[i+t]=this[i+n];else if(a<1e3||!mn.TYPED_ARRAY_SUPPORT)for(i=0;i<a;++i)e[i+t]=this[i+n];else Uint8Array.prototype.set.call(e,this.subarray(n,n+a),t);return a},mn.prototype.fill=function(e,t,n,r){if("string"==typeof e){if("string"==typeof t?(r=t,t=0,n=this.length):"string"==typeof n&&(r=n,n=this.length),1===e.length){var i=e.charCodeAt(0);i<256&&(e=i)}if(void 0!==r&&"string"!=typeof r)throw new TypeError("encoding must be a string");if("string"==typeof r&&!mn.isEncoding(r))throw new TypeError("Unknown encoding: "+r)}else"number"==typeof e&&(e&=255);if(t<0||this.length<t||this.length<n)throw new RangeError("Out of range index");if(n<=t)return this;var a;if(t>>>=0,n=void 0===n?this.length:n>>>0,e||(e=0),"number"==typeof e)for(a=t;a<n;++a)this[a]=e;else{var o=En(e)?e:Jn(new mn(e,r).toString()),s=o.length;for(a=0;a<n-t;++a)this[a+t]=o[a%s]}return this};var Xn=/[^+\/0-9A-Za-z-_]/g;function $n(e){return e<16?"0"+e.toString(16):e.toString(16)}function Jn(e,t){var n;t=t||1/0;for(var r=e.length,i=null,a=[],o=0;o<r;++o){if((n=e.charCodeAt(o))>55295&&n<57344){if(!i){if(n>56319){(t-=3)>-1&&a.push(239,191,189);continue}if(o+1===r){(t-=3)>-1&&a.push(239,191,189);continue}i=n;continue}if(n<56320){(t-=3)>-1&&a.push(239,191,189),i=n;continue}n=65536+(i-55296<<10|n-56320)}else i&&(t-=3)>-1&&a.push(239,191,189);if(i=null,n<128){if((t-=1)<0)break;a.push(n)}else if(n<2048){if((t-=2)<0)break;a.push(n>>6|192,63&n|128)}else if(n<65536){if((t-=3)<0)break;a.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;a.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return a}function Yn(e){return function(e){var t,n,r,i,a,o;an||on();var s=e.length;if(s%4>0)throw new Error("Invalid string. Length must be a multiple of 4");a="="===e[s-2]?2:"="===e[s-1]?1:0,o=new rn(3*s/4-a),r=a>0?s-4:s;var c=0;for(t=0,n=0;t<r;t+=4,n+=3)i=nn[e.charCodeAt(t)]<<18|nn[e.charCodeAt(t+1)]<<12|nn[e.charCodeAt(t+2)]<<6|nn[e.charCodeAt(t+3)],o[c++]=i>>16&255,o[c++]=i>>8&255,o[c++]=255&i;return 2===a?(i=nn[e.charCodeAt(t)]<<2|nn[e.charCodeAt(t+1)]>>4,o[c++]=255&i):1===a&&(i=nn[e.charCodeAt(t)]<<10|nn[e.charCodeAt(t+1)]<<4|nn[e.charCodeAt(t+2)]>>2,o[c++]=i>>8&255,o[c++]=255&i),o}(function(e){if((e=function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}(e).replace(Xn,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function Qn(e,t,n,r){for(var i=0;i<r&&!(i+n>=t.length||i>=e.length);++i)t[i+n]=e[i];return i}function Zn(e){return null!=e&&(!!e._isBuffer||er(e)||function(e){return"function"==typeof e.readFloatLE&&"function"==typeof e.slice&&er(e.slice(0,0))}(e))}function er(e){return!!e.constructor&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)}var tr=Qt(Object.freeze({__proto__:null,Buffer:mn,INSPECT_MAX_BYTES:50,SlowBuffer:function(e){return+e!=e&&(e=0),mn.alloc(+e)},isBuffer:Zn,kMaxLength:pn}));!function(e){!function(e,t){function n(e,t){if(!e)throw new Error(t||"Assertion failed")}function r(e,t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}function i(e,t,n){if(i.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&("le"!==t&&"be"!==t||(n=t,t=10),this._init(e||0,t||10,n||"be"))}var a;"object"==typeof e?e.exports=i:t.BN=i,i.BN=i,i.wordSize=26;try{a="undefined"!=typeof window&&void 0!==window.Buffer?window.Buffer:tr.Buffer}catch(e){}function o(e,t){var r=e.charCodeAt(t);return r>=48&&r<=57?r-48:r>=65&&r<=70?r-55:r>=97&&r<=102?r-87:void n(!1,"Invalid character in "+e)}function s(e,t,n){var r=o(e,n);return n-1>=t&&(r|=o(e,n-1)<<4),r}function c(e,t,r,i){for(var a=0,o=0,s=Math.min(e.length,r),c=t;c<s;c++){var u=e.charCodeAt(c)-48;a*=i,o=u>=49?u-49+10:u>=17?u-17+10:u,n(u>=0&&o<i,"Invalid character"),a+=o}return a}function u(e,t){e.words=t.words,e.length=t.length,e.negative=t.negative,e.red=t.red}if(i.isBN=function(e){return e instanceof i||null!==e&&"object"==typeof e&&e.constructor.wordSize===i.wordSize&&Array.isArray(e.words)},i.max=function(e,t){return e.cmp(t)>0?e:t},i.min=function(e,t){return e.cmp(t)<0?e:t},i.prototype._init=function(e,t,r){if("number"==typeof e)return this._initNumber(e,t,r);if("object"==typeof e)return this._initArray(e,t,r);"hex"===t&&(t=16),n(t===(0|t)&&t>=2&&t<=36);var i=0;"-"===(e=e.toString().replace(/\s+/g,""))[0]&&(i++,this.negative=1),i<e.length&&(16===t?this._parseHex(e,i,r):(this._parseBase(e,t,i),"le"===r&&this._initArray(this.toArray(),t,r)))},i.prototype._initNumber=function(e,t,r){e<0&&(this.negative=1,e=-e),e<67108864?(this.words=[67108863&e],this.length=1):e<4503599627370496?(this.words=[67108863&e,e/67108864&67108863],this.length=2):(n(e<9007199254740992),this.words=[67108863&e,e/67108864&67108863,1],this.length=3),"le"===r&&this._initArray(this.toArray(),t,r)},i.prototype._initArray=function(e,t,r){if(n("number"==typeof e.length),e.length<=0)return this.words=[0],this.length=1,this;this.length=Math.ceil(e.length/3),this.words=new Array(this.length);for(var i=0;i<this.length;i++)this.words[i]=0;var a,o,s=0;if("be"===r)for(i=e.length-1,a=0;i>=0;i-=3)o=e[i]|e[i-1]<<8|e[i-2]<<16,this.words[a]|=o<<s&67108863,this.words[a+1]=o>>>26-s&67108863,(s+=24)>=26&&(s-=26,a++);else if("le"===r)for(i=0,a=0;i<e.length;i+=3)o=e[i]|e[i+1]<<8|e[i+2]<<16,this.words[a]|=o<<s&67108863,this.words[a+1]=o>>>26-s&67108863,(s+=24)>=26&&(s-=26,a++);return this._strip()},i.prototype._parseHex=function(e,t,n){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var r=0;r<this.length;r++)this.words[r]=0;var i,a=0,o=0;if("be"===n)for(r=e.length-1;r>=t;r-=2)i=s(e,t,r)<<a,this.words[o]|=67108863&i,a>=18?(a-=18,o+=1,this.words[o]|=i>>>26):a+=8;else for(r=(e.length-t)%2==0?t+1:t;r<e.length;r+=2)i=s(e,t,r)<<a,this.words[o]|=67108863&i,a>=18?(a-=18,o+=1,this.words[o]|=i>>>26):a+=8;this._strip()},i.prototype._parseBase=function(e,t,n){this.words=[0],this.length=1;for(var r=0,i=1;i<=67108863;i*=t)r++;r--,i=i/t|0;for(var a=e.length-n,o=a%r,s=Math.min(a,a-o)+n,u=0,f=n;f<s;f+=r)u=c(e,f,f+r,t),this.imuln(i),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u);if(0!==o){var d=1;for(u=c(e,f,e.length,t),f=0;f<o;f++)d*=t;this.imuln(d),this.words[0]+u<67108864?this.words[0]+=u:this._iaddn(u)}this._strip()},i.prototype.copy=function(e){e.words=new Array(this.length);for(var t=0;t<this.length;t++)e.words[t]=this.words[t];e.length=this.length,e.negative=this.negative,e.red=this.red},i.prototype._move=function(e){u(e,this)},i.prototype.clone=function(){var e=new i(null);return this.copy(e),e},i.prototype._expand=function(e){for(;this.length<e;)this.words[this.length++]=0;return this},i.prototype._strip=function(){for(;this.length>1&&0===this.words[this.length-1];)this.length--;return this._normSign()},i.prototype._normSign=function(){return 1===this.length&&0===this.words[0]&&(this.negative=0),this},"undefined"!=typeof Symbol&&"function"==typeof Symbol.for)try{i.prototype[Symbol.for("nodejs.util.inspect.custom")]=f}catch(e){i.prototype.inspect=f}else i.prototype.inspect=f;function f(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"}var d=["","0","00","000","0000","00000","000000","0000000","00000000","000000000","0000000000","00000000000","000000000000","0000000000000","00000000000000","000000000000000","0000000000000000","00000000000000000","000000000000000000","0000000000000000000","00000000000000000000","000000000000000000000","0000000000000000000000","00000000000000000000000","000000000000000000000000","0000000000000000000000000"],l=[0,0,25,16,12,11,10,9,8,8,7,7,7,7,6,6,6,6,6,6,6,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5],p=[0,0,33554432,43046721,16777216,48828125,60466176,40353607,16777216,43046721,1e7,19487171,35831808,62748517,7529536,11390625,16777216,24137569,34012224,47045881,64e6,4084101,5153632,6436343,7962624,9765625,11881376,14348907,17210368,20511149,243e5,28629151,33554432,39135393,45435424,52521875,60466176];i.prototype.toString=function(e,t){var r;if(t=0|t||1,16===(e=e||10)||"hex"===e){r="";for(var i=0,a=0,o=0;o<this.length;o++){var s=this.words[o],c=(16777215&(s<<i|a)).toString(16);a=s>>>24-i&16777215,(i+=2)>=26&&(i-=26,o--),r=0!==a||o!==this.length-1?d[6-c.length]+c+r:c+r}for(0!==a&&(r=a.toString(16)+r);r.length%t!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}if(e===(0|e)&&e>=2&&e<=36){var u=l[e],f=p[e];r="";var h=this.clone();for(h.negative=0;!h.isZero();){var b=h.modrn(f).toString(e);r=(h=h.idivn(f)).isZero()?b+r:d[u-b.length]+b+r}for(this.isZero()&&(r="0"+r);r.length%t!=0;)r="0"+r;return 0!==this.negative&&(r="-"+r),r}n(!1,"Base should be between 2 and 36")},i.prototype.toNumber=function(){var e=this.words[0];return 2===this.length?e+=67108864*this.words[1]:3===this.length&&1===this.words[2]?e+=4503599627370496+67108864*this.words[1]:this.length>2&&n(!1,"Number can only safely store up to 53 bits"),0!==this.negative?-e:e},i.prototype.toJSON=function(){return this.toString(16,2)},a&&(i.prototype.toBuffer=function(e,t){return this.toArrayLike(a,e,t)}),i.prototype.toArray=function(e,t){return this.toArrayLike(Array,e,t)};function h(e,t,n){n.negative=t.negative^e.negative;var r=e.length+t.length|0;n.length=r,r=r-1|0;var i=0|e.words[0],a=0|t.words[0],o=i*a,s=67108863&o,c=o/67108864|0;n.words[0]=s;for(var u=1;u<r;u++){for(var f=c>>>26,d=67108863&c,l=Math.min(u,t.length-1),p=Math.max(0,u-e.length+1);p<=l;p++){var h=u-p|0;f+=(o=(i=0|e.words[h])*(a=0|t.words[p])+d)/67108864|0,d=67108863&o}n.words[u]=0|d,c=0|f}return 0!==c?n.words[u]=0|c:n.length--,n._strip()}i.prototype.toArrayLike=function(e,t,r){this._strip();var i=this.byteLength(),a=r||Math.max(1,i);n(i<=a,"byte array longer than desired length"),n(a>0,"Requested array length <= 0");var o=function(e,t){return e.allocUnsafe?e.allocUnsafe(t):new e(t)}(e,a);return this["_toArrayLike"+("le"===t?"LE":"BE")](o,i),o},i.prototype._toArrayLikeLE=function(e,t){for(var n=0,r=0,i=0,a=0;i<this.length;i++){var o=this.words[i]<<a|r;e[n++]=255&o,n<e.length&&(e[n++]=o>>8&255),n<e.length&&(e[n++]=o>>16&255),6===a?(n<e.length&&(e[n++]=o>>24&255),r=0,a=0):(r=o>>>24,a+=2)}if(n<e.length)for(e[n++]=r;n<e.length;)e[n++]=0},i.prototype._toArrayLikeBE=function(e,t){for(var n=e.length-1,r=0,i=0,a=0;i<this.length;i++){var o=this.words[i]<<a|r;e[n--]=255&o,n>=0&&(e[n--]=o>>8&255),n>=0&&(e[n--]=o>>16&255),6===a?(n>=0&&(e[n--]=o>>24&255),r=0,a=0):(r=o>>>24,a+=2)}if(n>=0)for(e[n--]=r;n>=0;)e[n--]=0},Math.clz32?i.prototype._countBits=function(e){return 32-Math.clz32(e)}:i.prototype._countBits=function(e){var t=e,n=0;return t>=4096&&(n+=13,t>>>=13),t>=64&&(n+=7,t>>>=7),t>=8&&(n+=4,t>>>=4),t>=2&&(n+=2,t>>>=2),n+t},i.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,n=0;return 0==(8191&t)&&(n+=13,t>>>=13),0==(127&t)&&(n+=7,t>>>=7),0==(15&t)&&(n+=4,t>>>=4),0==(3&t)&&(n+=2,t>>>=2),0==(1&t)&&n++,n},i.prototype.bitLength=function(){var e=this.words[this.length-1],t=this._countBits(e);return 26*(this.length-1)+t},i.prototype.zeroBits=function(){if(this.isZero())return 0;for(var e=0,t=0;t<this.length;t++){var n=this._zeroBits(this.words[t]);if(e+=n,26!==n)break}return e},i.prototype.byteLength=function(){return Math.ceil(this.bitLength()/8)},i.prototype.toTwos=function(e){return 0!==this.negative?this.abs().inotn(e).iaddn(1):this.clone()},i.prototype.fromTwos=function(e){return this.testn(e-1)?this.notn(e).iaddn(1).ineg():this.clone()},i.prototype.isNeg=function(){return 0!==this.negative},i.prototype.neg=function(){return this.clone().ineg()},i.prototype.ineg=function(){return this.isZero()||(this.negative^=1),this},i.prototype.iuor=function(e){for(;this.length<e.length;)this.words[this.length++]=0;for(var t=0;t<e.length;t++)this.words[t]=this.words[t]|e.words[t];return this._strip()},i.prototype.ior=function(e){return n(0==(this.negative|e.negative)),this.iuor(e)},i.prototype.or=function(e){return this.length>e.length?this.clone().ior(e):e.clone().ior(this)},i.prototype.uor=function(e){return this.length>e.length?this.clone().iuor(e):e.clone().iuor(this)},i.prototype.iuand=function(e){var t;t=this.length>e.length?e:this;for(var n=0;n<t.length;n++)this.words[n]=this.words[n]&e.words[n];return this.length=t.length,this._strip()},i.prototype.iand=function(e){return n(0==(this.negative|e.negative)),this.iuand(e)},i.prototype.and=function(e){return this.length>e.length?this.clone().iand(e):e.clone().iand(this)},i.prototype.uand=function(e){return this.length>e.length?this.clone().iuand(e):e.clone().iuand(this)},i.prototype.iuxor=function(e){var t,n;this.length>e.length?(t=this,n=e):(t=e,n=this);for(var r=0;r<n.length;r++)this.words[r]=t.words[r]^n.words[r];if(this!==t)for(;r<t.length;r++)this.words[r]=t.words[r];return this.length=t.length,this._strip()},i.prototype.ixor=function(e){return n(0==(this.negative|e.negative)),this.iuxor(e)},i.prototype.xor=function(e){return this.length>e.length?this.clone().ixor(e):e.clone().ixor(this)},i.prototype.uxor=function(e){return this.length>e.length?this.clone().iuxor(e):e.clone().iuxor(this)},i.prototype.inotn=function(e){n("number"==typeof e&&e>=0);var t=0|Math.ceil(e/26),r=e%26;this._expand(t),r>0&&t--;for(var i=0;i<t;i++)this.words[i]=67108863&~this.words[i];return r>0&&(this.words[i]=~this.words[i]&67108863>>26-r),this._strip()},i.prototype.notn=function(e){return this.clone().inotn(e)},i.prototype.setn=function(e,t){n("number"==typeof e&&e>=0);var r=e/26|0,i=e%26;return this._expand(r+1),this.words[r]=t?this.words[r]|1<<i:this.words[r]&~(1<<i),this._strip()},i.prototype.iadd=function(e){var t,n,r;if(0!==this.negative&&0===e.negative)return this.negative=0,t=this.isub(e),this.negative^=1,this._normSign();if(0===this.negative&&0!==e.negative)return e.negative=0,t=this.isub(e),e.negative=1,t._normSign();this.length>e.length?(n=this,r=e):(n=e,r=this);for(var i=0,a=0;a<r.length;a++)t=(0|n.words[a])+(0|r.words[a])+i,this.words[a]=67108863&t,i=t>>>26;for(;0!==i&&a<n.length;a++)t=(0|n.words[a])+i,this.words[a]=67108863&t,i=t>>>26;if(this.length=n.length,0!==i)this.words[this.length]=i,this.length++;else if(n!==this)for(;a<n.length;a++)this.words[a]=n.words[a];return this},i.prototype.add=function(e){var t;return 0!==e.negative&&0===this.negative?(e.negative=0,t=this.sub(e),e.negative^=1,t):0===e.negative&&0!==this.negative?(this.negative=0,t=e.sub(this),this.negative=1,t):this.length>e.length?this.clone().iadd(e):e.clone().iadd(this)},i.prototype.isub=function(e){if(0!==e.negative){e.negative=0;var t=this.iadd(e);return e.negative=1,t._normSign()}if(0!==this.negative)return this.negative=0,this.iadd(e),this.negative=1,this._normSign();var n,r,i=this.cmp(e);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(n=this,r=e):(n=e,r=this);for(var a=0,o=0;o<r.length;o++)a=(t=(0|n.words[o])-(0|r.words[o])+a)>>26,this.words[o]=67108863&t;for(;0!==a&&o<n.length;o++)a=(t=(0|n.words[o])+a)>>26,this.words[o]=67108863&t;if(0===a&&o<n.length&&n!==this)for(;o<n.length;o++)this.words[o]=n.words[o];return this.length=Math.max(this.length,o),n!==this&&(this.negative=1),this._strip()},i.prototype.sub=function(e){return this.clone().isub(e)};var b=function(e,t,n){var r,i,a,o=e.words,s=t.words,c=n.words,u=0,f=0|o[0],d=8191&f,l=f>>>13,p=0|o[1],h=8191&p,b=p>>>13,m=0|o[2],y=8191&m,g=m>>>13,v=0|o[3],w=8191&v,_=v>>>13,E=0|o[4],T=8191&E,A=E>>>13,R=0|o[5],S=8191&R,k=R>>>13,I=0|o[6],O=8191&I,x=I>>>13,C=0|o[7],M=8191&C,P=C>>>13,N=0|o[8],B=8191&N,D=N>>>13,F=0|o[9],L=8191&F,U=F>>>13,j=0|s[0],q=8191&j,z=j>>>13,H=0|s[1],G=8191&H,V=H>>>13,K=0|s[2],W=8191&K,X=K>>>13,$=0|s[3],J=8191&$,Y=$>>>13,Q=0|s[4],Z=8191&Q,ee=Q>>>13,te=0|s[5],ne=8191&te,re=te>>>13,ie=0|s[6],ae=8191&ie,oe=ie>>>13,se=0|s[7],ce=8191&se,ue=se>>>13,fe=0|s[8],de=8191&fe,le=fe>>>13,pe=0|s[9],he=8191&pe,be=pe>>>13;n.negative=e.negative^t.negative,n.length=19;var me=(u+(r=Math.imul(d,q))|0)+((8191&(i=(i=Math.imul(d,z))+Math.imul(l,q)|0))<<13)|0;u=((a=Math.imul(l,z))+(i>>>13)|0)+(me>>>26)|0,me&=67108863,r=Math.imul(h,q),i=(i=Math.imul(h,z))+Math.imul(b,q)|0,a=Math.imul(b,z);var ye=(u+(r=r+Math.imul(d,G)|0)|0)+((8191&(i=(i=i+Math.imul(d,V)|0)+Math.imul(l,G)|0))<<13)|0;u=((a=a+Math.imul(l,V)|0)+(i>>>13)|0)+(ye>>>26)|0,ye&=67108863,r=Math.imul(y,q),i=(i=Math.imul(y,z))+Math.imul(g,q)|0,a=Math.imul(g,z),r=r+Math.imul(h,G)|0,i=(i=i+Math.imul(h,V)|0)+Math.imul(b,G)|0,a=a+Math.imul(b,V)|0;var ge=(u+(r=r+Math.imul(d,W)|0)|0)+((8191&(i=(i=i+Math.imul(d,X)|0)+Math.imul(l,W)|0))<<13)|0;u=((a=a+Math.imul(l,X)|0)+(i>>>13)|0)+(ge>>>26)|0,ge&=67108863,r=Math.imul(w,q),i=(i=Math.imul(w,z))+Math.imul(_,q)|0,a=Math.imul(_,z),r=r+Math.imul(y,G)|0,i=(i=i+Math.imul(y,V)|0)+Math.imul(g,G)|0,a=a+Math.imul(g,V)|0,r=r+Math.imul(h,W)|0,i=(i=i+Math.imul(h,X)|0)+Math.imul(b,W)|0,a=a+Math.imul(b,X)|0;var ve=(u+(r=r+Math.imul(d,J)|0)|0)+((8191&(i=(i=i+Math.imul(d,Y)|0)+Math.imul(l,J)|0))<<13)|0;u=((a=a+Math.imul(l,Y)|0)+(i>>>13)|0)+(ve>>>26)|0,ve&=67108863,r=Math.imul(T,q),i=(i=Math.imul(T,z))+Math.imul(A,q)|0,a=Math.imul(A,z),r=r+Math.imul(w,G)|0,i=(i=i+Math.imul(w,V)|0)+Math.imul(_,G)|0,a=a+Math.imul(_,V)|0,r=r+Math.imul(y,W)|0,i=(i=i+Math.imul(y,X)|0)+Math.imul(g,W)|0,a=a+Math.imul(g,X)|0,r=r+Math.imul(h,J)|0,i=(i=i+Math.imul(h,Y)|0)+Math.imul(b,J)|0,a=a+Math.imul(b,Y)|0;var we=(u+(r=r+Math.imul(d,Z)|0)|0)+((8191&(i=(i=i+Math.imul(d,ee)|0)+Math.imul(l,Z)|0))<<13)|0;u=((a=a+Math.imul(l,ee)|0)+(i>>>13)|0)+(we>>>26)|0,we&=67108863,r=Math.imul(S,q),i=(i=Math.imul(S,z))+Math.imul(k,q)|0,a=Math.imul(k,z),r=r+Math.imul(T,G)|0,i=(i=i+Math.imul(T,V)|0)+Math.imul(A,G)|0,a=a+Math.imul(A,V)|0,r=r+Math.imul(w,W)|0,i=(i=i+Math.imul(w,X)|0)+Math.imul(_,W)|0,a=a+Math.imul(_,X)|0,r=r+Math.imul(y,J)|0,i=(i=i+Math.imul(y,Y)|0)+Math.imul(g,J)|0,a=a+Math.imul(g,Y)|0,r=r+Math.imul(h,Z)|0,i=(i=i+Math.imul(h,ee)|0)+Math.imul(b,Z)|0,a=a+Math.imul(b,ee)|0;var _e=(u+(r=r+Math.imul(d,ne)|0)|0)+((8191&(i=(i=i+Math.imul(d,re)|0)+Math.imul(l,ne)|0))<<13)|0;u=((a=a+Math.imul(l,re)|0)+(i>>>13)|0)+(_e>>>26)|0,_e&=67108863,r=Math.imul(O,q),i=(i=Math.imul(O,z))+Math.imul(x,q)|0,a=Math.imul(x,z),r=r+Math.imul(S,G)|0,i=(i=i+Math.imul(S,V)|0)+Math.imul(k,G)|0,a=a+Math.imul(k,V)|0,r=r+Math.imul(T,W)|0,i=(i=i+Math.imul(T,X)|0)+Math.imul(A,W)|0,a=a+Math.imul(A,X)|0,r=r+Math.imul(w,J)|0,i=(i=i+Math.imul(w,Y)|0)+Math.imul(_,J)|0,a=a+Math.imul(_,Y)|0,r=r+Math.imul(y,Z)|0,i=(i=i+Math.imul(y,ee)|0)+Math.imul(g,Z)|0,a=a+Math.imul(g,ee)|0,r=r+Math.imul(h,ne)|0,i=(i=i+Math.imul(h,re)|0)+Math.imul(b,ne)|0,a=a+Math.imul(b,re)|0;var Ee=(u+(r=r+Math.imul(d,ae)|0)|0)+((8191&(i=(i=i+Math.imul(d,oe)|0)+Math.imul(l,ae)|0))<<13)|0;u=((a=a+Math.imul(l,oe)|0)+(i>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,r=Math.imul(M,q),i=(i=Math.imul(M,z))+Math.imul(P,q)|0,a=Math.imul(P,z),r=r+Math.imul(O,G)|0,i=(i=i+Math.imul(O,V)|0)+Math.imul(x,G)|0,a=a+Math.imul(x,V)|0,r=r+Math.imul(S,W)|0,i=(i=i+Math.imul(S,X)|0)+Math.imul(k,W)|0,a=a+Math.imul(k,X)|0,r=r+Math.imul(T,J)|0,i=(i=i+Math.imul(T,Y)|0)+Math.imul(A,J)|0,a=a+Math.imul(A,Y)|0,r=r+Math.imul(w,Z)|0,i=(i=i+Math.imul(w,ee)|0)+Math.imul(_,Z)|0,a=a+Math.imul(_,ee)|0,r=r+Math.imul(y,ne)|0,i=(i=i+Math.imul(y,re)|0)+Math.imul(g,ne)|0,a=a+Math.imul(g,re)|0,r=r+Math.imul(h,ae)|0,i=(i=i+Math.imul(h,oe)|0)+Math.imul(b,ae)|0,a=a+Math.imul(b,oe)|0;var Te=(u+(r=r+Math.imul(d,ce)|0)|0)+((8191&(i=(i=i+Math.imul(d,ue)|0)+Math.imul(l,ce)|0))<<13)|0;u=((a=a+Math.imul(l,ue)|0)+(i>>>13)|0)+(Te>>>26)|0,Te&=67108863,r=Math.imul(B,q),i=(i=Math.imul(B,z))+Math.imul(D,q)|0,a=Math.imul(D,z),r=r+Math.imul(M,G)|0,i=(i=i+Math.imul(M,V)|0)+Math.imul(P,G)|0,a=a+Math.imul(P,V)|0,r=r+Math.imul(O,W)|0,i=(i=i+Math.imul(O,X)|0)+Math.imul(x,W)|0,a=a+Math.imul(x,X)|0,r=r+Math.imul(S,J)|0,i=(i=i+Math.imul(S,Y)|0)+Math.imul(k,J)|0,a=a+Math.imul(k,Y)|0,r=r+Math.imul(T,Z)|0,i=(i=i+Math.imul(T,ee)|0)+Math.imul(A,Z)|0,a=a+Math.imul(A,ee)|0,r=r+Math.imul(w,ne)|0,i=(i=i+Math.imul(w,re)|0)+Math.imul(_,ne)|0,a=a+Math.imul(_,re)|0,r=r+Math.imul(y,ae)|0,i=(i=i+Math.imul(y,oe)|0)+Math.imul(g,ae)|0,a=a+Math.imul(g,oe)|0,r=r+Math.imul(h,ce)|0,i=(i=i+Math.imul(h,ue)|0)+Math.imul(b,ce)|0,a=a+Math.imul(b,ue)|0;var Ae=(u+(r=r+Math.imul(d,de)|0)|0)+((8191&(i=(i=i+Math.imul(d,le)|0)+Math.imul(l,de)|0))<<13)|0;u=((a=a+Math.imul(l,le)|0)+(i>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,r=Math.imul(L,q),i=(i=Math.imul(L,z))+Math.imul(U,q)|0,a=Math.imul(U,z),r=r+Math.imul(B,G)|0,i=(i=i+Math.imul(B,V)|0)+Math.imul(D,G)|0,a=a+Math.imul(D,V)|0,r=r+Math.imul(M,W)|0,i=(i=i+Math.imul(M,X)|0)+Math.imul(P,W)|0,a=a+Math.imul(P,X)|0,r=r+Math.imul(O,J)|0,i=(i=i+Math.imul(O,Y)|0)+Math.imul(x,J)|0,a=a+Math.imul(x,Y)|0,r=r+Math.imul(S,Z)|0,i=(i=i+Math.imul(S,ee)|0)+Math.imul(k,Z)|0,a=a+Math.imul(k,ee)|0,r=r+Math.imul(T,ne)|0,i=(i=i+Math.imul(T,re)|0)+Math.imul(A,ne)|0,a=a+Math.imul(A,re)|0,r=r+Math.imul(w,ae)|0,i=(i=i+Math.imul(w,oe)|0)+Math.imul(_,ae)|0,a=a+Math.imul(_,oe)|0,r=r+Math.imul(y,ce)|0,i=(i=i+Math.imul(y,ue)|0)+Math.imul(g,ce)|0,a=a+Math.imul(g,ue)|0,r=r+Math.imul(h,de)|0,i=(i=i+Math.imul(h,le)|0)+Math.imul(b,de)|0,a=a+Math.imul(b,le)|0;var Re=(u+(r=r+Math.imul(d,he)|0)|0)+((8191&(i=(i=i+Math.imul(d,be)|0)+Math.imul(l,he)|0))<<13)|0;u=((a=a+Math.imul(l,be)|0)+(i>>>13)|0)+(Re>>>26)|0,Re&=67108863,r=Math.imul(L,G),i=(i=Math.imul(L,V))+Math.imul(U,G)|0,a=Math.imul(U,V),r=r+Math.imul(B,W)|0,i=(i=i+Math.imul(B,X)|0)+Math.imul(D,W)|0,a=a+Math.imul(D,X)|0,r=r+Math.imul(M,J)|0,i=(i=i+Math.imul(M,Y)|0)+Math.imul(P,J)|0,a=a+Math.imul(P,Y)|0,r=r+Math.imul(O,Z)|0,i=(i=i+Math.imul(O,ee)|0)+Math.imul(x,Z)|0,a=a+Math.imul(x,ee)|0,r=r+Math.imul(S,ne)|0,i=(i=i+Math.imul(S,re)|0)+Math.imul(k,ne)|0,a=a+Math.imul(k,re)|0,r=r+Math.imul(T,ae)|0,i=(i=i+Math.imul(T,oe)|0)+Math.imul(A,ae)|0,a=a+Math.imul(A,oe)|0,r=r+Math.imul(w,ce)|0,i=(i=i+Math.imul(w,ue)|0)+Math.imul(_,ce)|0,a=a+Math.imul(_,ue)|0,r=r+Math.imul(y,de)|0,i=(i=i+Math.imul(y,le)|0)+Math.imul(g,de)|0,a=a+Math.imul(g,le)|0;var Se=(u+(r=r+Math.imul(h,he)|0)|0)+((8191&(i=(i=i+Math.imul(h,be)|0)+Math.imul(b,he)|0))<<13)|0;u=((a=a+Math.imul(b,be)|0)+(i>>>13)|0)+(Se>>>26)|0,Se&=67108863,r=Math.imul(L,W),i=(i=Math.imul(L,X))+Math.imul(U,W)|0,a=Math.imul(U,X),r=r+Math.imul(B,J)|0,i=(i=i+Math.imul(B,Y)|0)+Math.imul(D,J)|0,a=a+Math.imul(D,Y)|0,r=r+Math.imul(M,Z)|0,i=(i=i+Math.imul(M,ee)|0)+Math.imul(P,Z)|0,a=a+Math.imul(P,ee)|0,r=r+Math.imul(O,ne)|0,i=(i=i+Math.imul(O,re)|0)+Math.imul(x,ne)|0,a=a+Math.imul(x,re)|0,r=r+Math.imul(S,ae)|0,i=(i=i+Math.imul(S,oe)|0)+Math.imul(k,ae)|0,a=a+Math.imul(k,oe)|0,r=r+Math.imul(T,ce)|0,i=(i=i+Math.imul(T,ue)|0)+Math.imul(A,ce)|0,a=a+Math.imul(A,ue)|0,r=r+Math.imul(w,de)|0,i=(i=i+Math.imul(w,le)|0)+Math.imul(_,de)|0,a=a+Math.imul(_,le)|0;var ke=(u+(r=r+Math.imul(y,he)|0)|0)+((8191&(i=(i=i+Math.imul(y,be)|0)+Math.imul(g,he)|0))<<13)|0;u=((a=a+Math.imul(g,be)|0)+(i>>>13)|0)+(ke>>>26)|0,ke&=67108863,r=Math.imul(L,J),i=(i=Math.imul(L,Y))+Math.imul(U,J)|0,a=Math.imul(U,Y),r=r+Math.imul(B,Z)|0,i=(i=i+Math.imul(B,ee)|0)+Math.imul(D,Z)|0,a=a+Math.imul(D,ee)|0,r=r+Math.imul(M,ne)|0,i=(i=i+Math.imul(M,re)|0)+Math.imul(P,ne)|0,a=a+Math.imul(P,re)|0,r=r+Math.imul(O,ae)|0,i=(i=i+Math.imul(O,oe)|0)+Math.imul(x,ae)|0,a=a+Math.imul(x,oe)|0,r=r+Math.imul(S,ce)|0,i=(i=i+Math.imul(S,ue)|0)+Math.imul(k,ce)|0,a=a+Math.imul(k,ue)|0,r=r+Math.imul(T,de)|0,i=(i=i+Math.imul(T,le)|0)+Math.imul(A,de)|0,a=a+Math.imul(A,le)|0;var Ie=(u+(r=r+Math.imul(w,he)|0)|0)+((8191&(i=(i=i+Math.imul(w,be)|0)+Math.imul(_,he)|0))<<13)|0;u=((a=a+Math.imul(_,be)|0)+(i>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,r=Math.imul(L,Z),i=(i=Math.imul(L,ee))+Math.imul(U,Z)|0,a=Math.imul(U,ee),r=r+Math.imul(B,ne)|0,i=(i=i+Math.imul(B,re)|0)+Math.imul(D,ne)|0,a=a+Math.imul(D,re)|0,r=r+Math.imul(M,ae)|0,i=(i=i+Math.imul(M,oe)|0)+Math.imul(P,ae)|0,a=a+Math.imul(P,oe)|0,r=r+Math.imul(O,ce)|0,i=(i=i+Math.imul(O,ue)|0)+Math.imul(x,ce)|0,a=a+Math.imul(x,ue)|0,r=r+Math.imul(S,de)|0,i=(i=i+Math.imul(S,le)|0)+Math.imul(k,de)|0,a=a+Math.imul(k,le)|0;var Oe=(u+(r=r+Math.imul(T,he)|0)|0)+((8191&(i=(i=i+Math.imul(T,be)|0)+Math.imul(A,he)|0))<<13)|0;u=((a=a+Math.imul(A,be)|0)+(i>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,r=Math.imul(L,ne),i=(i=Math.imul(L,re))+Math.imul(U,ne)|0,a=Math.imul(U,re),r=r+Math.imul(B,ae)|0,i=(i=i+Math.imul(B,oe)|0)+Math.imul(D,ae)|0,a=a+Math.imul(D,oe)|0,r=r+Math.imul(M,ce)|0,i=(i=i+Math.imul(M,ue)|0)+Math.imul(P,ce)|0,a=a+Math.imul(P,ue)|0,r=r+Math.imul(O,de)|0,i=(i=i+Math.imul(O,le)|0)+Math.imul(x,de)|0,a=a+Math.imul(x,le)|0;var xe=(u+(r=r+Math.imul(S,he)|0)|0)+((8191&(i=(i=i+Math.imul(S,be)|0)+Math.imul(k,he)|0))<<13)|0;u=((a=a+Math.imul(k,be)|0)+(i>>>13)|0)+(xe>>>26)|0,xe&=67108863,r=Math.imul(L,ae),i=(i=Math.imul(L,oe))+Math.imul(U,ae)|0,a=Math.imul(U,oe),r=r+Math.imul(B,ce)|0,i=(i=i+Math.imul(B,ue)|0)+Math.imul(D,ce)|0,a=a+Math.imul(D,ue)|0,r=r+Math.imul(M,de)|0,i=(i=i+Math.imul(M,le)|0)+Math.imul(P,de)|0,a=a+Math.imul(P,le)|0;var Ce=(u+(r=r+Math.imul(O,he)|0)|0)+((8191&(i=(i=i+Math.imul(O,be)|0)+Math.imul(x,he)|0))<<13)|0;u=((a=a+Math.imul(x,be)|0)+(i>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,r=Math.imul(L,ce),i=(i=Math.imul(L,ue))+Math.imul(U,ce)|0,a=Math.imul(U,ue),r=r+Math.imul(B,de)|0,i=(i=i+Math.imul(B,le)|0)+Math.imul(D,de)|0,a=a+Math.imul(D,le)|0;var Me=(u+(r=r+Math.imul(M,he)|0)|0)+((8191&(i=(i=i+Math.imul(M,be)|0)+Math.imul(P,he)|0))<<13)|0;u=((a=a+Math.imul(P,be)|0)+(i>>>13)|0)+(Me>>>26)|0,Me&=67108863,r=Math.imul(L,de),i=(i=Math.imul(L,le))+Math.imul(U,de)|0,a=Math.imul(U,le);var Pe=(u+(r=r+Math.imul(B,he)|0)|0)+((8191&(i=(i=i+Math.imul(B,be)|0)+Math.imul(D,he)|0))<<13)|0;u=((a=a+Math.imul(D,be)|0)+(i>>>13)|0)+(Pe>>>26)|0,Pe&=67108863;var Ne=(u+(r=Math.imul(L,he))|0)+((8191&(i=(i=Math.imul(L,be))+Math.imul(U,he)|0))<<13)|0;return u=((a=Math.imul(U,be))+(i>>>13)|0)+(Ne>>>26)|0,Ne&=67108863,c[0]=me,c[1]=ye,c[2]=ge,c[3]=ve,c[4]=we,c[5]=_e,c[6]=Ee,c[7]=Te,c[8]=Ae,c[9]=Re,c[10]=Se,c[11]=ke,c[12]=Ie,c[13]=Oe,c[14]=xe,c[15]=Ce,c[16]=Me,c[17]=Pe,c[18]=Ne,0!==u&&(c[19]=u,n.length++),n};function m(e,t,n){n.negative=t.negative^e.negative,n.length=e.length+t.length;for(var r=0,i=0,a=0;a<n.length-1;a++){var o=i;i=0;for(var s=67108863&r,c=Math.min(a,t.length-1),u=Math.max(0,a-e.length+1);u<=c;u++){var f=a-u,d=(0|e.words[f])*(0|t.words[u]),l=67108863&d;s=67108863&(l=l+s|0),i+=(o=(o=o+(d/67108864|0)|0)+(l>>>26)|0)>>>26,o&=67108863}n.words[a]=s,r=o,o=i}return 0!==r?n.words[a]=r:n.length--,n._strip()}function y(e,t,n){return m(e,t,n)}Math.imul||(b=h),i.prototype.mulTo=function(e,t){var n=this.length+e.length;return 10===this.length&&10===e.length?b(this,e,t):n<63?h(this,e,t):n<1024?m(this,e,t):y(this,e,t)},i.prototype.mul=function(e){var t=new i(null);return t.words=new Array(this.length+e.length),this.mulTo(e,t)},i.prototype.mulf=function(e){var t=new i(null);return t.words=new Array(this.length+e.length),y(this,e,t)},i.prototype.imul=function(e){return this.clone().mulTo(e,this)},i.prototype.imuln=function(e){var t=e<0;t&&(e=-e),n("number"==typeof e),n(e<67108864);for(var r=0,i=0;i<this.length;i++){var a=(0|this.words[i])*e,o=(67108863&a)+(67108863&r);r>>=26,r+=a/67108864|0,r+=o>>>26,this.words[i]=67108863&o}return 0!==r&&(this.words[i]=r,this.length++),t?this.ineg():this},i.prototype.muln=function(e){return this.clone().imuln(e)},i.prototype.sqr=function(){return this.mul(this)},i.prototype.isqr=function(){return this.imul(this.clone())},i.prototype.pow=function(e){var t=function(e){for(var t=new Array(e.bitLength()),n=0;n<t.length;n++){var r=n/26|0,i=n%26;t[n]=e.words[r]>>>i&1}return t}(e);if(0===t.length)return new i(1);for(var n=this,r=0;r<t.length&&0===t[r];r++,n=n.sqr());if(++r<t.length)for(var a=n.sqr();r<t.length;r++,a=a.sqr())0!==t[r]&&(n=n.mul(a));return n},i.prototype.iushln=function(e){n("number"==typeof e&&e>=0);var t,r=e%26,i=(e-r)/26,a=67108863>>>26-r<<26-r;if(0!==r){var o=0;for(t=0;t<this.length;t++){var s=this.words[t]&a,c=(0|this.words[t])-s<<r;this.words[t]=c|o,o=s>>>26-r}o&&(this.words[t]=o,this.length++)}if(0!==i){for(t=this.length-1;t>=0;t--)this.words[t+i]=this.words[t];for(t=0;t<i;t++)this.words[t]=0;this.length+=i}return this._strip()},i.prototype.ishln=function(e){return n(0===this.negative),this.iushln(e)},i.prototype.iushrn=function(e,t,r){var i;n("number"==typeof e&&e>=0),i=t?(t-t%26)/26:0;var a=e%26,o=Math.min((e-a)/26,this.length),s=67108863^67108863>>>a<<a,c=r;if(i-=o,i=Math.max(0,i),c){for(var u=0;u<o;u++)c.words[u]=this.words[u];c.length=o}if(0===o);else if(this.length>o)for(this.length-=o,u=0;u<this.length;u++)this.words[u]=this.words[u+o];else this.words[0]=0,this.length=1;var f=0;for(u=this.length-1;u>=0&&(0!==f||u>=i);u--){var d=0|this.words[u];this.words[u]=f<<26-a|d>>>a,f=d&s}return c&&0!==f&&(c.words[c.length++]=f),0===this.length&&(this.words[0]=0,this.length=1),this._strip()},i.prototype.ishrn=function(e,t,r){return n(0===this.negative),this.iushrn(e,t,r)},i.prototype.shln=function(e){return this.clone().ishln(e)},i.prototype.ushln=function(e){return this.clone().iushln(e)},i.prototype.shrn=function(e){return this.clone().ishrn(e)},i.prototype.ushrn=function(e){return this.clone().iushrn(e)},i.prototype.testn=function(e){n("number"==typeof e&&e>=0);var t=e%26,r=(e-t)/26,i=1<<t;return!(this.length<=r)&&!!(this.words[r]&i)},i.prototype.imaskn=function(e){n("number"==typeof e&&e>=0);var t=e%26,r=(e-t)/26;if(n(0===this.negative,"imaskn works only with positive numbers"),this.length<=r)return this;if(0!==t&&r++,this.length=Math.min(r,this.length),0!==t){var i=67108863^67108863>>>t<<t;this.words[this.length-1]&=i}return this._strip()},i.prototype.maskn=function(e){return this.clone().imaskn(e)},i.prototype.iaddn=function(e){return n("number"==typeof e),n(e<67108864),e<0?this.isubn(-e):0!==this.negative?1===this.length&&(0|this.words[0])<=e?(this.words[0]=e-(0|this.words[0]),this.negative=0,this):(this.negative=0,this.isubn(e),this.negative=1,this):this._iaddn(e)},i.prototype._iaddn=function(e){this.words[0]+=e;for(var t=0;t<this.length&&this.words[t]>=67108864;t++)this.words[t]-=67108864,t===this.length-1?this.words[t+1]=1:this.words[t+1]++;return this.length=Math.max(this.length,t+1),this},i.prototype.isubn=function(e){if(n("number"==typeof e),n(e<67108864),e<0)return this.iaddn(-e);if(0!==this.negative)return this.negative=0,this.iaddn(e),this.negative=1,this;if(this.words[0]-=e,1===this.length&&this.words[0]<0)this.words[0]=-this.words[0],this.negative=1;else for(var t=0;t<this.length&&this.words[t]<0;t++)this.words[t]+=67108864,this.words[t+1]-=1;return this._strip()},i.prototype.addn=function(e){return this.clone().iaddn(e)},i.prototype.subn=function(e){return this.clone().isubn(e)},i.prototype.iabs=function(){return this.negative=0,this},i.prototype.abs=function(){return this.clone().iabs()},i.prototype._ishlnsubmul=function(e,t,r){var i,a,o=e.length+r;this._expand(o);var s=0;for(i=0;i<e.length;i++){a=(0|this.words[i+r])+s;var c=(0|e.words[i])*t;s=((a-=67108863&c)>>26)-(c/67108864|0),this.words[i+r]=67108863&a}for(;i<this.length-r;i++)s=(a=(0|this.words[i+r])+s)>>26,this.words[i+r]=67108863&a;if(0===s)return this._strip();for(n(-1===s),s=0,i=0;i<this.length;i++)s=(a=-(0|this.words[i])+s)>>26,this.words[i]=67108863&a;return this.negative=1,this._strip()},i.prototype._wordDiv=function(e,t){var n=(this.length,e.length),r=this.clone(),a=e,o=0|a.words[a.length-1];0!==(n=26-this._countBits(o))&&(a=a.ushln(n),r.iushln(n),o=0|a.words[a.length-1]);var s,c=r.length-a.length;if("mod"!==t){(s=new i(null)).length=c+1,s.words=new Array(s.length);for(var u=0;u<s.length;u++)s.words[u]=0}var f=r.clone()._ishlnsubmul(a,1,c);0===f.negative&&(r=f,s&&(s.words[c]=1));for(var d=c-1;d>=0;d--){var l=67108864*(0|r.words[a.length+d])+(0|r.words[a.length+d-1]);for(l=Math.min(l/o|0,67108863),r._ishlnsubmul(a,l,d);0!==r.negative;)l--,r.negative=0,r._ishlnsubmul(a,1,d),r.isZero()||(r.negative^=1);s&&(s.words[d]=l)}return s&&s._strip(),r._strip(),"div"!==t&&0!==n&&r.iushrn(n),{div:s||null,mod:r}},i.prototype.divmod=function(e,t,r){return n(!e.isZero()),this.isZero()?{div:new i(0),mod:new i(0)}:0!==this.negative&&0===e.negative?(s=this.neg().divmod(e,t),"mod"!==t&&(a=s.div.neg()),"div"!==t&&(o=s.mod.neg(),r&&0!==o.negative&&o.iadd(e)),{div:a,mod:o}):0===this.negative&&0!==e.negative?(s=this.divmod(e.neg(),t),"mod"!==t&&(a=s.div.neg()),{div:a,mod:s.mod}):0!=(this.negative&e.negative)?(s=this.neg().divmod(e.neg(),t),"div"!==t&&(o=s.mod.neg(),r&&0!==o.negative&&o.isub(e)),{div:s.div,mod:o}):e.length>this.length||this.cmp(e)<0?{div:new i(0),mod:this}:1===e.length?"div"===t?{div:this.divn(e.words[0]),mod:null}:"mod"===t?{div:null,mod:new i(this.modrn(e.words[0]))}:{div:this.divn(e.words[0]),mod:new i(this.modrn(e.words[0]))}:this._wordDiv(e,t);var a,o,s},i.prototype.div=function(e){return this.divmod(e,"div",!1).div},i.prototype.mod=function(e){return this.divmod(e,"mod",!1).mod},i.prototype.umod=function(e){return this.divmod(e,"mod",!0).mod},i.prototype.divRound=function(e){var t=this.divmod(e);if(t.mod.isZero())return t.div;var n=0!==t.div.negative?t.mod.isub(e):t.mod,r=e.ushrn(1),i=e.andln(1),a=n.cmp(r);return a<0||1===i&&0===a?t.div:0!==t.div.negative?t.div.isubn(1):t.div.iaddn(1)},i.prototype.modrn=function(e){var t=e<0;t&&(e=-e),n(e<=67108863);for(var r=(1<<26)%e,i=0,a=this.length-1;a>=0;a--)i=(r*i+(0|this.words[a]))%e;return t?-i:i},i.prototype.modn=function(e){return this.modrn(e)},i.prototype.idivn=function(e){var t=e<0;t&&(e=-e),n(e<=67108863);for(var r=0,i=this.length-1;i>=0;i--){var a=(0|this.words[i])+67108864*r;this.words[i]=a/e|0,r=a%e}return this._strip(),t?this.ineg():this},i.prototype.divn=function(e){return this.clone().idivn(e)},i.prototype.egcd=function(e){n(0===e.negative),n(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var a=new i(1),o=new i(0),s=new i(0),c=new i(1),u=0;t.isEven()&&r.isEven();)t.iushrn(1),r.iushrn(1),++u;for(var f=r.clone(),d=t.clone();!t.isZero();){for(var l=0,p=1;0==(t.words[0]&p)&&l<26;++l,p<<=1);if(l>0)for(t.iushrn(l);l-- >0;)(a.isOdd()||o.isOdd())&&(a.iadd(f),o.isub(d)),a.iushrn(1),o.iushrn(1);for(var h=0,b=1;0==(r.words[0]&b)&&h<26;++h,b<<=1);if(h>0)for(r.iushrn(h);h-- >0;)(s.isOdd()||c.isOdd())&&(s.iadd(f),c.isub(d)),s.iushrn(1),c.iushrn(1);t.cmp(r)>=0?(t.isub(r),a.isub(s),o.isub(c)):(r.isub(t),s.isub(a),c.isub(o))}return{a:s,b:c,gcd:r.iushln(u)}},i.prototype._invmp=function(e){n(0===e.negative),n(!e.isZero());var t=this,r=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var a,o=new i(1),s=new i(0),c=r.clone();t.cmpn(1)>0&&r.cmpn(1)>0;){for(var u=0,f=1;0==(t.words[0]&f)&&u<26;++u,f<<=1);if(u>0)for(t.iushrn(u);u-- >0;)o.isOdd()&&o.iadd(c),o.iushrn(1);for(var d=0,l=1;0==(r.words[0]&l)&&d<26;++d,l<<=1);if(d>0)for(r.iushrn(d);d-- >0;)s.isOdd()&&s.iadd(c),s.iushrn(1);t.cmp(r)>=0?(t.isub(r),o.isub(s)):(r.isub(t),s.isub(o))}return(a=0===t.cmpn(1)?o:s).cmpn(0)<0&&a.iadd(e),a},i.prototype.gcd=function(e){if(this.isZero())return e.abs();if(e.isZero())return this.abs();var t=this.clone(),n=e.clone();t.negative=0,n.negative=0;for(var r=0;t.isEven()&&n.isEven();r++)t.iushrn(1),n.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;n.isEven();)n.iushrn(1);var i=t.cmp(n);if(i<0){var a=t;t=n,n=a}else if(0===i||0===n.cmpn(1))break;t.isub(n)}return n.iushln(r)},i.prototype.invm=function(e){return this.egcd(e).a.umod(e)},i.prototype.isEven=function(){return 0==(1&this.words[0])},i.prototype.isOdd=function(){return 1==(1&this.words[0])},i.prototype.andln=function(e){return this.words[0]&e},i.prototype.bincn=function(e){n("number"==typeof e);var t=e%26,r=(e-t)/26,i=1<<t;if(this.length<=r)return this._expand(r+1),this.words[r]|=i,this;for(var a=i,o=r;0!==a&&o<this.length;o++){var s=0|this.words[o];a=(s+=a)>>>26,s&=67108863,this.words[o]=s}return 0!==a&&(this.words[o]=a,this.length++),this},i.prototype.isZero=function(){return 1===this.length&&0===this.words[0]},i.prototype.cmpn=function(e){var t,r=e<0;if(0!==this.negative&&!r)return-1;if(0===this.negative&&r)return 1;if(this._strip(),this.length>1)t=1;else{r&&(e=-e),n(e<=67108863,"Number is too big");var i=0|this.words[0];t=i===e?0:i<e?-1:1}return 0!==this.negative?0|-t:t},i.prototype.cmp=function(e){if(0!==this.negative&&0===e.negative)return-1;if(0===this.negative&&0!==e.negative)return 1;var t=this.ucmp(e);return 0!==this.negative?0|-t:t},i.prototype.ucmp=function(e){if(this.length>e.length)return 1;if(this.length<e.length)return-1;for(var t=0,n=this.length-1;n>=0;n--){var r=0|this.words[n],i=0|e.words[n];if(r!==i){r<i?t=-1:r>i&&(t=1);break}}return t},i.prototype.gtn=function(e){return 1===this.cmpn(e)},i.prototype.gt=function(e){return 1===this.cmp(e)},i.prototype.gten=function(e){return this.cmpn(e)>=0},i.prototype.gte=function(e){return this.cmp(e)>=0},i.prototype.ltn=function(e){return-1===this.cmpn(e)},i.prototype.lt=function(e){return-1===this.cmp(e)},i.prototype.lten=function(e){return this.cmpn(e)<=0},i.prototype.lte=function(e){return this.cmp(e)<=0},i.prototype.eqn=function(e){return 0===this.cmpn(e)},i.prototype.eq=function(e){return 0===this.cmp(e)},i.red=function(e){return new A(e)},i.prototype.toRed=function(e){return n(!this.red,"Already a number in reduction context"),n(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},i.prototype.fromRed=function(){return n(this.red,"fromRed works only with numbers in reduction context"),this.red.convertFrom(this)},i.prototype._forceRed=function(e){return this.red=e,this},i.prototype.forceRed=function(e){return n(!this.red,"Already a number in reduction context"),this._forceRed(e)},i.prototype.redAdd=function(e){return n(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},i.prototype.redIAdd=function(e){return n(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},i.prototype.redSub=function(e){return n(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},i.prototype.redISub=function(e){return n(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},i.prototype.redShl=function(e){return n(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},i.prototype.redMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},i.prototype.redIMul=function(e){return n(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},i.prototype.redSqr=function(){return n(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},i.prototype.redISqr=function(){return n(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},i.prototype.redSqrt=function(){return n(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},i.prototype.redInvm=function(){return n(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},i.prototype.redNeg=function(){return n(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},i.prototype.redPow=function(e){return n(this.red&&!e.red,"redPow(normalNum)"),this.red._verify1(this),this.red.pow(this,e)};var g={k256:null,p224:null,p192:null,p25519:null};function v(e,t){this.name=e,this.p=new i(t,16),this.n=this.p.bitLength(),this.k=new i(1).iushln(this.n).isub(this.p),this.tmp=this._tmp()}function w(){v.call(this,"k256","ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f")}function _(){v.call(this,"p224","ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001")}function E(){v.call(this,"p192","ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff")}function T(){v.call(this,"25519","7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed")}function A(e){if("string"==typeof e){var t=i._prime(e);this.m=t.p,this.prime=t}else n(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function R(e){A.call(this,e),this.shift=this.m.bitLength(),this.shift%26!=0&&(this.shift+=26-this.shift%26),this.r=new i(1).iushln(this.shift),this.r2=this.imod(this.r.sqr()),this.rinv=this.r._invmp(this.m),this.minv=this.rinv.mul(this.r).isubn(1).div(this.m),this.minv=this.minv.umod(this.r),this.minv=this.r.sub(this.minv)}v.prototype._tmp=function(){var e=new i(null);return e.words=new Array(Math.ceil(this.n/13)),e},v.prototype.ireduce=function(e){var t,n=e;do{this.split(n,this.tmp),t=(n=(n=this.imulK(n)).iadd(this.tmp)).bitLength()}while(t>this.n);var r=t<this.n?-1:n.ucmp(this.p);return 0===r?(n.words[0]=0,n.length=1):r>0?n.isub(this.p):void 0!==n.strip?n.strip():n._strip(),n},v.prototype.split=function(e,t){e.iushrn(this.n,0,t)},v.prototype.imulK=function(e){return e.imul(this.k)},r(w,v),w.prototype.split=function(e,t){for(var n=4194303,r=Math.min(e.length,9),i=0;i<r;i++)t.words[i]=e.words[i];if(t.length=r,e.length<=9)return e.words[0]=0,void(e.length=1);var a=e.words[9];for(t.words[t.length++]=a&n,i=10;i<e.length;i++){var o=0|e.words[i];e.words[i-10]=(o&n)<<4|a>>>22,a=o}a>>>=22,e.words[i-10]=a,0===a&&e.length>10?e.length-=10:e.length-=9},w.prototype.imulK=function(e){e.words[e.length]=0,e.words[e.length+1]=0,e.length+=2;for(var t=0,n=0;n<e.length;n++){var r=0|e.words[n];t+=977*r,e.words[n]=67108863&t,t=64*r+(t/67108864|0)}return 0===e.words[e.length-1]&&(e.length--,0===e.words[e.length-1]&&e.length--),e},r(_,v),r(E,v),r(T,v),T.prototype.imulK=function(e){for(var t=0,n=0;n<e.length;n++){var r=19*(0|e.words[n])+t,i=67108863&r;r>>>=26,e.words[n]=i,t=r}return 0!==t&&(e.words[e.length++]=t),e},i._prime=function(e){if(g[e])return g[e];var t;if("k256"===e)t=new w;else if("p224"===e)t=new _;else if("p192"===e)t=new E;else{if("p25519"!==e)throw new Error("Unknown prime "+e);t=new T}return g[e]=t,t},A.prototype._verify1=function(e){n(0===e.negative,"red works only with positives"),n(e.red,"red works only with red numbers")},A.prototype._verify2=function(e,t){n(0==(e.negative|t.negative),"red works only with positives"),n(e.red&&e.red===t.red,"red works only with red numbers")},A.prototype.imod=function(e){return this.prime?this.prime.ireduce(e)._forceRed(this):(u(e,e.umod(this.m)._forceRed(this)),e)},A.prototype.neg=function(e){return e.isZero()?e.clone():this.m.sub(e)._forceRed(this)},A.prototype.add=function(e,t){this._verify2(e,t);var n=e.add(t);return n.cmp(this.m)>=0&&n.isub(this.m),n._forceRed(this)},A.prototype.iadd=function(e,t){this._verify2(e,t);var n=e.iadd(t);return n.cmp(this.m)>=0&&n.isub(this.m),n},A.prototype.sub=function(e,t){this._verify2(e,t);var n=e.sub(t);return n.cmpn(0)<0&&n.iadd(this.m),n._forceRed(this)},A.prototype.isub=function(e,t){this._verify2(e,t);var n=e.isub(t);return n.cmpn(0)<0&&n.iadd(this.m),n},A.prototype.shl=function(e,t){return this._verify1(e),this.imod(e.ushln(t))},A.prototype.imul=function(e,t){return this._verify2(e,t),this.imod(e.imul(t))},A.prototype.mul=function(e,t){return this._verify2(e,t),this.imod(e.mul(t))},A.prototype.isqr=function(e){return this.imul(e,e.clone())},A.prototype.sqr=function(e){return this.mul(e,e)},A.prototype.sqrt=function(e){if(e.isZero())return e.clone();var t=this.m.andln(3);if(n(t%2==1),3===t){var r=this.m.add(new i(1)).iushrn(2);return this.pow(e,r)}for(var a=this.m.subn(1),o=0;!a.isZero()&&0===a.andln(1);)o++,a.iushrn(1);n(!a.isZero());var s=new i(1).toRed(this),c=s.redNeg(),u=this.m.subn(1).iushrn(1),f=this.m.bitLength();for(f=new i(2*f*f).toRed(this);0!==this.pow(f,u).cmp(c);)f.redIAdd(c);for(var d=this.pow(f,a),l=this.pow(e,a.addn(1).iushrn(1)),p=this.pow(e,a),h=o;0!==p.cmp(s);){for(var b=p,m=0;0!==b.cmp(s);m++)b=b.redSqr();n(m<h);var y=this.pow(d,new i(1).iushln(h-m-1));l=l.redMul(y),d=y.redSqr(),p=p.redMul(d),h=m}return l},A.prototype.invm=function(e){var t=e._invmp(this.m);return 0!==t.negative?(t.negative=0,this.imod(t).redNeg()):this.imod(t)},A.prototype.pow=function(e,t){if(t.isZero())return new i(1).toRed(this);if(0===t.cmpn(1))return e.clone();var n=new Array(16);n[0]=new i(1).toRed(this),n[1]=e;for(var r=2;r<n.length;r++)n[r]=this.mul(n[r-1],e);var a=n[0],o=0,s=0,c=t.bitLength()%26;for(0===c&&(c=26),r=t.length-1;r>=0;r--){for(var u=t.words[r],f=c-1;f>=0;f--){var d=u>>f&1;a!==n[0]&&(a=this.sqr(a)),0!==d||0!==o?(o<<=1,o|=d,(4===++s||0===r&&0===f)&&(a=this.mul(a,n[o]),s=0,o=0)):s=0}c=26}return a},A.prototype.convertTo=function(e){var t=e.umod(this.m);return t===e?t.clone():t},A.prototype.convertFrom=function(e){var t=e.clone();return t.red=null,t},i.mont=function(e){return new R(e)},r(R,A),R.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},R.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},R.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var n=e.imul(t),r=n.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=n.isub(r).iushrn(this.shift),a=i;return i.cmp(this.m)>=0?a=i.isub(this.m):i.cmpn(0)<0&&(a=i.iadd(this.m)),a._forceRed(this)},R.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new i(0)._forceRed(this);var n=e.mul(t),r=n.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),a=n.isub(r).iushrn(this.shift),o=a;return a.cmp(this.m)>=0?o=a.isub(this.m):a.cmpn(0)<0&&(o=a.iadd(this.m)),o._forceRed(this)},R.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(e,Jt)}(Zt);var nr=Zt.exports,rr=Yt(nr);let ir=!1,ar=!1;const or={debug:1,default:2,info:2,warning:3,error:4,off:5};let sr=or.default,cr=null;const ur=function(){try{const e=[];if(["NFD","NFC","NFKD","NFKC"].forEach((t=>{try{if("test"!=="test".normalize(t))throw new Error("bad normalize")}catch(n){e.push(t)}})),e.length)throw new Error("missing "+e.join(", "));if(String.fromCharCode(233).normalize("NFD")!==String.fromCharCode(101,769))throw new Error("broken implementation")}catch(e){return e.message}return null}();var fr,dr;!function(e){e.DEBUG="DEBUG",e.INFO="INFO",e.WARNING="WARNING",e.ERROR="ERROR",e.OFF="OFF"}(fr||(fr={})),function(e){e.UNKNOWN_ERROR="UNKNOWN_ERROR",e.NOT_IMPLEMENTED="NOT_IMPLEMENTED",e.UNSUPPORTED_OPERATION="UNSUPPORTED_OPERATION",e.NETWORK_ERROR="NETWORK_ERROR",e.SERVER_ERROR="SERVER_ERROR",e.TIMEOUT="TIMEOUT",e.BUFFER_OVERRUN="BUFFER_OVERRUN",e.NUMERIC_FAULT="NUMERIC_FAULT",e.MISSING_NEW="MISSING_NEW",e.INVALID_ARGUMENT="INVALID_ARGUMENT",e.MISSING_ARGUMENT="MISSING_ARGUMENT",e.UNEXPECTED_ARGUMENT="UNEXPECTED_ARGUMENT",e.CALL_EXCEPTION="CALL_EXCEPTION",e.INSUFFICIENT_FUNDS="INSUFFICIENT_FUNDS",e.NONCE_EXPIRED="NONCE_EXPIRED",e.REPLACEMENT_UNDERPRICED="REPLACEMENT_UNDERPRICED",e.UNPREDICTABLE_GAS_LIMIT="UNPREDICTABLE_GAS_LIMIT",e.TRANSACTION_REPLACED="TRANSACTION_REPLACED",e.ACTION_REJECTED="ACTION_REJECTED"}(dr||(dr={}));const lr="0123456789abcdef";let pr=class e{constructor(e){Object.defineProperty(this,"version",{enumerable:!0,value:e,writable:!1})}_log(e,t){const n=e.toLowerCase();null==or[n]&&this.throwArgumentError("invalid log level name","logLevel",e),sr>or[n]||console.log.apply(console,t)}debug(...t){this._log(e.levels.DEBUG,t)}info(...t){this._log(e.levels.INFO,t)}warn(...t){this._log(e.levels.WARNING,t)}makeError(t,n,r){if(ar)return this.makeError("censored error",n,{});n||(n=e.errors.UNKNOWN_ERROR),r||(r={});const i=[];Object.keys(r).forEach((e=>{const t=r[e];try{if(t instanceof Uint8Array){let n="";for(let e=0;e<t.length;e++)n+=lr[t[e]>>4],n+=lr[15&t[e]];i.push(e+"=Uint8Array(0x"+n+")")}else i.push(e+"="+JSON.stringify(t))}catch(t){i.push(e+"="+JSON.stringify(r[e].toString()))}})),i.push(`code=${n}`),i.push(`version=${this.version}`);const a=t;let o="";switch(n){case dr.NUMERIC_FAULT:{o="NUMERIC_FAULT";const e=t;switch(e){case"overflow":case"underflow":case"division-by-zero":o+="-"+e;break;case"negative-power":case"negative-width":o+="-unsupported";break;case"unbound-bitwise-result":o+="-unbound-result"}break}case dr.CALL_EXCEPTION:case dr.INSUFFICIENT_FUNDS:case dr.MISSING_NEW:case dr.NONCE_EXPIRED:case dr.REPLACEMENT_UNDERPRICED:case dr.TRANSACTION_REPLACED:case dr.UNPREDICTABLE_GAS_LIMIT:o=n}o&&(t+=" [ See: https://links.ethers.org/v5-errors-"+o+" ]"),i.length&&(t+=" ("+i.join(", ")+")");const s=new Error(t);return s.reason=a,s.code=n,Object.keys(r).forEach((function(e){s[e]=r[e]})),s}throwError(e,t,n){throw this.makeError(e,t,n)}throwArgumentError(t,n,r){return this.throwError(t,e.errors.INVALID_ARGUMENT,{argument:n,value:r})}assert(e,t,n,r){e||this.throwError(t,n,r)}assertArgument(e,t,n,r){e||this.throwArgumentError(t,n,r)}checkNormalize(t){ur&&this.throwError("platform missing String.prototype.normalize",e.errors.UNSUPPORTED_OPERATION,{operation:"String.prototype.normalize",form:ur})}checkSafeUint53(t,n){"number"==typeof t&&(null==n&&(n="value not safe"),(t<0||t>=9007199254740991)&&this.throwError(n,e.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"out-of-safe-range",value:t}),t%1&&this.throwError(n,e.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"non-integer",value:t}))}checkArgumentCount(t,n,r){r=r?": "+r:"",t<n&&this.throwError("missing argument"+r,e.errors.MISSING_ARGUMENT,{count:t,expectedCount:n}),t>n&&this.throwError("too many arguments"+r,e.errors.UNEXPECTED_ARGUMENT,{count:t,expectedCount:n})}checkNew(t,n){t!==Object&&null!=t||this.throwError("missing new",e.errors.MISSING_NEW,{name:n.name})}checkAbstract(t,n){t===n?this.throwError("cannot instantiate abstract class "+JSON.stringify(n.name)+" directly; use a sub-class",e.errors.UNSUPPORTED_OPERATION,{name:t.name,operation:"new"}):t!==Object&&null!=t||this.throwError("missing new",e.errors.MISSING_NEW,{name:n.name})}static globalLogger(){return cr||(cr=new e("logger/5.7.0")),cr}static setCensorship(t,n){if(!t&&n&&this.globalLogger().throwError("cannot permanently disable censorship",e.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"}),ir){if(!t)return;this.globalLogger().throwError("error censorship permanent",e.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"})}ar=!!t,ir=!!n}static setLogLevel(t){const n=or[t.toLowerCase()];null!=n?sr=n:e.globalLogger().warn("invalid log level - "+t)}static from(t){return new e(t)}};pr.errors=dr,pr.levels=fr;var hr=Object.freeze({__proto__:null,get ErrorCode(){return dr},get LogLevel(){return fr},Logger:pr});const br=new pr("bytes/5.7.0");function mr(e){return!!e.toHexString}function yr(e){return e.slice||(e.slice=function(){const t=Array.prototype.slice.call(arguments);return yr(new Uint8Array(Array.prototype.slice.apply(e,t)))}),e}function gr(e){return Rr(e)&&!(e.length%2)||wr(e)}function vr(e){return"number"==typeof e&&e==e&&e%1==0}function wr(e){if(null==e)return!1;if(e.constructor===Uint8Array)return!0;if("string"==typeof e)return!1;if(!vr(e.length)||e.length<0)return!1;for(let t=0;t<e.length;t++){const n=e[t];if(!vr(n)||n<0||n>=256)return!1}return!0}function _r(e,t){if(t||(t={}),"number"==typeof e){br.checkSafeUint53(e,"invalid arrayify value");const t=[];for(;e;)t.unshift(255&e),e=parseInt(String(e/256));return 0===t.length&&t.push(0),yr(new Uint8Array(t))}if(t.allowMissingPrefix&&"string"==typeof e&&"0x"!==e.substring(0,2)&&(e="0x"+e),mr(e)&&(e=e.toHexString()),Rr(e)){let n=e.substring(2);n.length%2&&("left"===t.hexPad?n="0"+n:"right"===t.hexPad?n+="0":br.throwArgumentError("hex data is odd-length","value",e));const r=[];for(let e=0;e<n.length;e+=2)r.push(parseInt(n.substring(e,e+2),16));return yr(new Uint8Array(r))}return wr(e)?yr(new Uint8Array(e)):br.throwArgumentError("invalid arrayify value","value",e)}function Er(e){const t=e.map((e=>_r(e))),n=t.reduce(((e,t)=>e+t.length),0),r=new Uint8Array(n);return t.reduce(((e,t)=>(r.set(t,e),e+t.length)),0),yr(r)}function Tr(e){let t=_r(e);if(0===t.length)return t;let n=0;for(;n<t.length&&0===t[n];)n++;return n&&(t=t.slice(n)),t}function Ar(e,t){(e=_r(e)).length>t&&br.throwArgumentError("value out of range","value",arguments[0]);const n=new Uint8Array(t);return n.set(e,t-e.length),yr(n)}function Rr(e,t){return!("string"!=typeof e||!e.match(/^0x[0-9A-Fa-f]*$/))&&(!t||e.length===2+2*t)}const Sr="0123456789abcdef";function kr(e,t){if(t||(t={}),"number"==typeof e){br.checkSafeUint53(e,"invalid hexlify value");let t="";for(;e;)t=Sr[15&e]+t,e=Math.floor(e/16);return t.length?(t.length%2&&(t="0"+t),"0x"+t):"0x00"}if("bigint"==typeof e)return(e=e.toString(16)).length%2?"0x0"+e:"0x"+e;if(t.allowMissingPrefix&&"string"==typeof e&&"0x"!==e.substring(0,2)&&(e="0x"+e),mr(e))return e.toHexString();if(Rr(e))return e.length%2&&("left"===t.hexPad?e="0x0"+e.substring(2):"right"===t.hexPad?e+="0":br.throwArgumentError("hex data is odd-length","value",e)),e.toLowerCase();if(wr(e)){let t="0x";for(let n=0;n<e.length;n++){let r=e[n];t+=Sr[(240&r)>>4]+Sr[15&r]}return t}return br.throwArgumentError("invalid hexlify value","value",e)}function Ir(e){if("string"!=typeof e)e=kr(e);else if(!Rr(e)||e.length%2)return null;return(e.length-2)/2}function Or(e,t,n){return"string"!=typeof e?e=kr(e):(!Rr(e)||e.length%2)&&br.throwArgumentError("invalid hexData","value",e),t=2+2*t,null!=n?"0x"+e.substring(t,2+2*n):"0x"+e.substring(t)}function xr(e){let t="0x";return e.forEach((e=>{t+=kr(e).substring(2)})),t}function Cr(e){const t=Mr(kr(e,{hexPad:"left"}));return"0x"===t?"0x0":t}function Mr(e){"string"!=typeof e&&(e=kr(e)),Rr(e)||br.throwArgumentError("invalid hex string","value",e),e=e.substring(2);let t=0;for(;t<e.length&&"0"===e[t];)t++;return"0x"+e.substring(t)}function Pr(e,t){for("string"!=typeof e?e=kr(e):Rr(e)||br.throwArgumentError("invalid hex string","value",e),e.length>2*t+2&&br.throwArgumentError("value out of range","value",arguments[1]);e.length<2*t+2;)e="0x0"+e.substring(2);return e}function Nr(e){const t={r:"0x",s:"0x",_vs:"0x",recoveryParam:0,v:0,yParityAndS:"0x",compact:"0x"};if(gr(e)){let n=_r(e);64===n.length?(t.v=27+(n[32]>>7),n[32]&=127,t.r=kr(n.slice(0,32)),t.s=kr(n.slice(32,64))):65===n.length?(t.r=kr(n.slice(0,32)),t.s=kr(n.slice(32,64)),t.v=n[64]):br.throwArgumentError("invalid signature string","signature",e),t.v<27&&(0===t.v||1===t.v?t.v+=27:br.throwArgumentError("signature invalid v byte","signature",e)),t.recoveryParam=1-t.v%2,t.recoveryParam&&(n[32]|=128),t._vs=kr(n.slice(32,64))}else{if(t.r=e.r,t.s=e.s,t.v=e.v,t.recoveryParam=e.recoveryParam,t._vs=e._vs,null!=t._vs){const n=Ar(_r(t._vs),32);t._vs=kr(n);const r=n[0]>=128?1:0;null==t.recoveryParam?t.recoveryParam=r:t.recoveryParam!==r&&br.throwArgumentError("signature recoveryParam mismatch _vs","signature",e),n[0]&=127;const i=kr(n);null==t.s?t.s=i:t.s!==i&&br.throwArgumentError("signature v mismatch _vs","signature",e)}if(null==t.recoveryParam)null==t.v?br.throwArgumentError("signature missing v and recoveryParam","signature",e):0===t.v||1===t.v?t.recoveryParam=t.v:t.recoveryParam=1-t.v%2;else if(null==t.v)t.v=27+t.recoveryParam;else{const n=0===t.v||1===t.v?t.v:1-t.v%2;t.recoveryParam!==n&&br.throwArgumentError("signature recoveryParam mismatch v","signature",e)}null!=t.r&&Rr(t.r)?t.r=Pr(t.r,32):br.throwArgumentError("signature missing or invalid r","signature",e),null!=t.s&&Rr(t.s)?t.s=Pr(t.s,32):br.throwArgumentError("signature missing or invalid s","signature",e);const n=_r(t.s);n[0]>=128&&br.throwArgumentError("signature s out of range","signature",e),t.recoveryParam&&(n[0]|=128);const r=kr(n);t._vs&&(Rr(t._vs)||br.throwArgumentError("signature invalid _vs","signature",e),t._vs=Pr(t._vs,32)),null==t._vs?t._vs=r:t._vs!==r&&br.throwArgumentError("signature _vs mismatch v and s","signature",e)}return t.yParityAndS=t._vs,t.compact=t.r+t.yParityAndS.substring(2),t}function Br(e){return kr(Er([(e=Nr(e)).r,e.s,e.recoveryParam?"0x1c":"0x1b"]))}var Dr=Object.freeze({__proto__:null,arrayify:_r,concat:Er,hexConcat:xr,hexDataLength:Ir,hexDataSlice:Or,hexStripZeros:Mr,hexValue:Cr,hexZeroPad:Pr,hexlify:kr,isBytes:wr,isBytesLike:gr,isHexString:Rr,joinSignature:Br,splitSignature:Nr,stripZeros:Tr,zeroPad:Ar});const Fr="bignumber/5.7.0";var Lr=rr.BN;const Ur=new pr(Fr),jr={},qr=9007199254740991;let zr=!1,Hr=class e{constructor(e,t){e!==jr&&Ur.throwError("cannot call constructor directly; use BigNumber.from",pr.errors.UNSUPPORTED_OPERATION,{operation:"new (BigNumber)"}),this._hex=t,this._isBigNumber=!0,Object.freeze(this)}fromTwos(e){return Vr(Kr(this).fromTwos(e))}toTwos(e){return Vr(Kr(this).toTwos(e))}abs(){return"-"===this._hex[0]?e.from(this._hex.substring(1)):this}add(e){return Vr(Kr(this).add(Kr(e)))}sub(e){return Vr(Kr(this).sub(Kr(e)))}div(t){return e.from(t).isZero()&&Wr("division-by-zero","div"),Vr(Kr(this).div(Kr(t)))}mul(e){return Vr(Kr(this).mul(Kr(e)))}mod(e){const t=Kr(e);return t.isNeg()&&Wr("division-by-zero","mod"),Vr(Kr(this).umod(t))}pow(e){const t=Kr(e);return t.isNeg()&&Wr("negative-power","pow"),Vr(Kr(this).pow(t))}and(e){const t=Kr(e);return(this.isNegative()||t.isNeg())&&Wr("unbound-bitwise-result","and"),Vr(Kr(this).and(t))}or(e){const t=Kr(e);return(this.isNegative()||t.isNeg())&&Wr("unbound-bitwise-result","or"),Vr(Kr(this).or(t))}xor(e){const t=Kr(e);return(this.isNegative()||t.isNeg())&&Wr("unbound-bitwise-result","xor"),Vr(Kr(this).xor(t))}mask(e){return(this.isNegative()||e<0)&&Wr("negative-width","mask"),Vr(Kr(this).maskn(e))}shl(e){return(this.isNegative()||e<0)&&Wr("negative-width","shl"),Vr(Kr(this).shln(e))}shr(e){return(this.isNegative()||e<0)&&Wr("negative-width","shr"),Vr(Kr(this).shrn(e))}eq(e){return Kr(this).eq(Kr(e))}lt(e){return Kr(this).lt(Kr(e))}lte(e){return Kr(this).lte(Kr(e))}gt(e){return Kr(this).gt(Kr(e))}gte(e){return Kr(this).gte(Kr(e))}isNegative(){return"-"===this._hex[0]}isZero(){return Kr(this).isZero()}toNumber(){try{return Kr(this).toNumber()}catch(e){Wr("overflow","toNumber",this.toString())}return null}toBigInt(){try{return BigInt(this.toString())}catch(e){}return Ur.throwError("this platform does not support BigInt",pr.errors.UNSUPPORTED_OPERATION,{value:this.toString()})}toString(){return arguments.length>0&&(10===arguments[0]?zr||(zr=!0,Ur.warn("BigNumber.toString does not accept any parameters; base-10 is assumed")):16===arguments[0]?Ur.throwError("BigNumber.toString does not accept any parameters; use bigNumber.toHexString()",pr.errors.UNEXPECTED_ARGUMENT,{}):Ur.throwError("BigNumber.toString does not accept parameters",pr.errors.UNEXPECTED_ARGUMENT,{})),Kr(this).toString(10)}toHexString(){return this._hex}toJSON(e){return{type:"BigNumber",hex:this.toHexString()}}static from(t){if(t instanceof e)return t;if("string"==typeof t)return t.match(/^-?0x[0-9a-f]+$/i)?new e(jr,Gr(t)):t.match(/^-?[0-9]+$/)?new e(jr,Gr(new Lr(t))):Ur.throwArgumentError("invalid BigNumber string","value",t);if("number"==typeof t)return t%1&&Wr("underflow","BigNumber.from",t),(t>=qr||t<=-qr)&&Wr("overflow","BigNumber.from",t),e.from(String(t));const n=t;if("bigint"==typeof n)return e.from(n.toString());if(wr(n))return e.from(kr(n));if(n)if(n.toHexString){const t=n.toHexString();if("string"==typeof t)return e.from(t)}else{let t=n._hex;if(null==t&&"BigNumber"===n.type&&(t=n.hex),"string"==typeof t&&(Rr(t)||"-"===t[0]&&Rr(t.substring(1))))return e.from(t)}return Ur.throwArgumentError("invalid BigNumber value","value",t)}static isBigNumber(e){return!(!e||!e._isBigNumber)}};function Gr(e){if("string"!=typeof e)return Gr(e.toString(16));if("-"===e[0])return"-"===(e=e.substring(1))[0]&&Ur.throwArgumentError("invalid hex","value",e),"0x00"===(e=Gr(e))?e:"-"+e;if("0x"!==e.substring(0,2)&&(e="0x"+e),"0x"===e)return"0x00";for(e.length%2&&(e="0x0"+e.substring(2));e.length>4&&"0x00"===e.substring(0,4);)e="0x"+e.substring(4);return e}function Vr(e){return Hr.from(Gr(e))}function Kr(e){const t=Hr.from(e).toHexString();return"-"===t[0]?new Lr("-"+t.substring(3),16):new Lr(t.substring(2),16)}function Wr(e,t,n){const r={fault:e,operation:t};return null!=n&&(r.value=n),Ur.throwError(e,pr.errors.NUMERIC_FAULT,r)}const Xr=new pr(Fr),$r={},Jr=Hr.from(0),Yr=Hr.from(-1);function Qr(e,t,n,r){const i={fault:t,operation:n};return void 0!==r&&(i.value=r),Xr.throwError(e,pr.errors.NUMERIC_FAULT,i)}let Zr="0";for(;Zr.length<256;)Zr+=Zr;function ei(e){if("number"!=typeof e)try{e=Hr.from(e).toNumber()}catch(e){}return"number"==typeof e&&e>=0&&e<=256&&!(e%1)?"1"+Zr.substring(0,e):Xr.throwArgumentError("invalid decimal size","decimals",e)}function ti(e,t){null==t&&(t=0);const n=ei(t),r=(e=Hr.from(e)).lt(Jr);r&&(e=e.mul(Yr));let i=e.mod(n).toString();for(;i.length<n.length-1;)i="0"+i;i=i.match(/^([0-9]*[1-9]|0)(0*)/)[1];const a=e.div(n).toString();return e=1===n.length?a:a+"."+i,r&&(e="-"+e),e}function ni(e,t){null==t&&(t=0);const n=ei(t);"string"==typeof e&&e.match(/^-?[0-9.]+$/)||Xr.throwArgumentError("invalid decimal value","value",e);const r="-"===e.substring(0,1);r&&(e=e.substring(1)),"."===e&&Xr.throwArgumentError("missing value","value",e);const i=e.split(".");i.length>2&&Xr.throwArgumentError("too many decimal points","value",e);let a=i[0],o=i[1];for(a||(a="0"),o||(o="0");"0"===o[o.length-1];)o=o.substring(0,o.length-1);for(o.length>n.length-1&&Qr("fractional component exceeds decimals","underflow","parseFixed"),""===o&&(o="0");o.length<n.length-1;)o+="0";const s=Hr.from(a),c=Hr.from(o);let u=s.mul(n).add(c);return r&&(u=u.mul(Yr)),u}class ri{constructor(e,t,n,r){e!==$r&&Xr.throwError("cannot use FixedFormat constructor; use FixedFormat.from",pr.errors.UNSUPPORTED_OPERATION,{operation:"new FixedFormat"}),this.signed=t,this.width=n,this.decimals=r,this.name=(t?"":"u")+"fixed"+String(n)+"x"+String(r),this._multiplier=ei(r),Object.freeze(this)}static from(e){if(e instanceof ri)return e;"number"==typeof e&&(e=`fixed128x${e}`);let t=!0,n=128,r=18;if("string"==typeof e)if("fixed"===e);else if("ufixed"===e)t=!1;else{const i=e.match(/^(u?)fixed([0-9]+)x([0-9]+)$/);i||Xr.throwArgumentError("invalid fixed format","format",e),t="u"!==i[1],n=parseInt(i[2]),r=parseInt(i[3])}else if(e){const i=(t,n,r)=>null==e[t]?r:(typeof e[t]!==n&&Xr.throwArgumentError("invalid fixed format ("+t+" not "+n+")","format."+t,e[t]),e[t]);t=i("signed","boolean",t),n=i("width","number",n),r=i("decimals","number",r)}return n%8&&Xr.throwArgumentError("invalid fixed format width (not byte aligned)","format.width",n),r>80&&Xr.throwArgumentError("invalid fixed format (decimals too large)","format.decimals",r),new ri($r,t,n,r)}}class ii{constructor(e,t,n,r){e!==$r&&Xr.throwError("cannot use FixedNumber constructor; use FixedNumber.from",pr.errors.UNSUPPORTED_OPERATION,{operation:"new FixedFormat"}),this.format=r,this._hex=t,this._value=n,this._isFixedNumber=!0,Object.freeze(this)}_checkFormat(e){this.format.name!==e.format.name&&Xr.throwArgumentError("incompatible format; use fixedNumber.toFormat","other",e)}addUnsafe(e){this._checkFormat(e);const t=ni(this._value,this.format.decimals),n=ni(e._value,e.format.decimals);return ii.fromValue(t.add(n),this.format.decimals,this.format)}subUnsafe(e){this._checkFormat(e);const t=ni(this._value,this.format.decimals),n=ni(e._value,e.format.decimals);return ii.fromValue(t.sub(n),this.format.decimals,this.format)}mulUnsafe(e){this._checkFormat(e);const t=ni(this._value,this.format.decimals),n=ni(e._value,e.format.decimals);return ii.fromValue(t.mul(n).div(this.format._multiplier),this.format.decimals,this.format)}divUnsafe(e){this._checkFormat(e);const t=ni(this._value,this.format.decimals),n=ni(e._value,e.format.decimals);return ii.fromValue(t.mul(this.format._multiplier).div(n),this.format.decimals,this.format)}floor(){const e=this.toString().split(".");1===e.length&&e.push("0");let t=ii.from(e[0],this.format);const n=!e[1].match(/^(0*)$/);return this.isNegative()&&n&&(t=t.subUnsafe(ai.toFormat(t.format))),t}ceiling(){const e=this.toString().split(".");1===e.length&&e.push("0");let t=ii.from(e[0],this.format);const n=!e[1].match(/^(0*)$/);return!this.isNegative()&&n&&(t=t.addUnsafe(ai.toFormat(t.format))),t}round(e){null==e&&(e=0);const t=this.toString().split(".");if(1===t.length&&t.push("0"),(e<0||e>80||e%1)&&Xr.throwArgumentError("invalid decimal count","decimals",e),t[1].length<=e)return this;const n=ii.from("1"+Zr.substring(0,e),this.format),r=oi.toFormat(this.format);return this.mulUnsafe(n).addUnsafe(r).floor().divUnsafe(n)}isZero(){return"0.0"===this._value||"0"===this._value}isNegative(){return"-"===this._value[0]}toString(){return this._value}toHexString(e){if(null==e)return this._hex;e%8&&Xr.throwArgumentError("invalid byte width","width",e);return Pr(Hr.from(this._hex).fromTwos(this.format.width).toTwos(e).toHexString(),e/8)}toUnsafeFloat(){return parseFloat(this.toString())}toFormat(e){return ii.fromString(this._value,e)}static fromValue(e,t,n){return null!=n||null==t||function(e){return null!=e&&(Hr.isBigNumber(e)||"number"==typeof e&&e%1==0||"string"==typeof e&&!!e.match(/^-?[0-9]+$/)||Rr(e)||"bigint"==typeof e||wr(e))}(t)||(n=t,t=null),null==t&&(t=0),null==n&&(n="fixed"),ii.fromString(ti(e,t),ri.from(n))}static fromString(e,t){null==t&&(t="fixed");const n=ri.from(t),r=ni(e,n.decimals);!n.signed&&r.lt(Jr)&&Qr("unsigned value cannot be negative","overflow","value",e);let i=null;n.signed?i=r.toTwos(n.width).toHexString():(i=r.toHexString(),i=Pr(i,n.width/8));const a=ti(r,n.decimals);return new ii($r,i,a,n)}static fromBytes(e,t){null==t&&(t="fixed");const n=ri.from(t);if(_r(e).length>n.width/8)throw new Error("overflow");let r=Hr.from(e);n.signed&&(r=r.fromTwos(n.width));const i=r.toTwos((n.signed?0:1)+n.width).toHexString(),a=ti(r,n.decimals);return new ii($r,i,a,n)}static from(e,t){if("string"==typeof e)return ii.fromString(e,t);if(wr(e))return ii.fromBytes(e,t);try{return ii.fromValue(e,0,t)}catch(e){if(e.code!==pr.errors.INVALID_ARGUMENT)throw e}return Xr.throwArgumentError("invalid FixedNumber value","value",e)}static isFixedNumber(e){return!(!e||!e._isFixedNumber)}}const ai=ii.from(1),oi=ii.from("0.5");var si=function(e,t,n,r){return new(n||(n=Promise))((function(i,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(o,s)}c((r=r.apply(e,t||[])).next())}))};const ci=new pr("properties/5.7.0");function ui(e,t,n){Object.defineProperty(e,t,{enumerable:!0,value:n,writable:!1})}function fi(e,t){for(let n=0;n<32;n++){if(e[t])return e[t];if(!e.prototype||"object"!=typeof e.prototype)break;e=Object.getPrototypeOf(e.prototype).constructor}return null}function di(e){return si(this,void 0,void 0,(function*(){const t=Object.keys(e).map((t=>{const n=e[t];return Promise.resolve(n).then((e=>({key:t,value:e})))}));return(yield Promise.all(t)).reduce(((e,t)=>(e[t.key]=t.value,e)),{})}))}function li(e,t){e&&"object"==typeof e||ci.throwArgumentError("invalid object","object",e),Object.keys(e).forEach((n=>{t[n]||ci.throwArgumentError("invalid object key - "+n,"transaction:"+n,e)}))}function pi(e){const t={};for(const n in e)t[n]=e[n];return t}const hi={bigint:!0,boolean:!0,function:!0,number:!0,string:!0};function bi(e){if(null==e||hi[typeof e])return!0;if(Array.isArray(e)||"object"==typeof e){if(!Object.isFrozen(e))return!1;const t=Object.keys(e);for(let n=0;n<t.length;n++){let r=null;try{r=e[t[n]]}catch(e){continue}if(!bi(r))return!1}return!0}return ci.throwArgumentError("Cannot deepCopy "+typeof e,"object",e)}function mi(e){if(bi(e))return e;if(Array.isArray(e))return Object.freeze(e.map((e=>yi(e))));if("object"==typeof e){const t={};for(const n in e){const r=e[n];void 0!==r&&ui(t,n,yi(r))}return t}return ci.throwArgumentError("Cannot deepCopy "+typeof e,"object",e)}function yi(e){return mi(e)}let gi=class{constructor(e){for(const t in e)this[t]=yi(e[t])}};var vi=Object.freeze({__proto__:null,Description:gi,checkProperties:li,deepCopy:yi,defineReadOnly:ui,getStatic:fi,resolveProperties:di,shallowCopy:pi});const wi="abi/5.7.0",_i=new pr(wi),Ei={};let Ti={calldata:!0,memory:!0,storage:!0},Ai={calldata:!0,memory:!0};function Ri(e,t){if("bytes"===e||"string"===e){if(Ti[t])return!0}else if("address"===e){if("payable"===t)return!0}else if((e.indexOf("[")>=0||"tuple"===e)&&Ai[t])return!0;return(Ti[t]||"payable"===t)&&_i.throwArgumentError("invalid modifier","name",t),!1}function Si(e,t){for(let n in t)ui(e,n,t[n])}const ki=Object.freeze({sighash:"sighash",minimal:"minimal",full:"full",json:"json"}),Ii=new RegExp(/^(.*)\[([0-9]*)\]$/);let Oi=class e{constructor(t,n){t!==Ei&&_i.throwError("use fromString",pr.errors.UNSUPPORTED_OPERATION,{operation:"new ParamType()"}),Si(this,n);let r=this.type.match(Ii);Si(this,r?{arrayLength:parseInt(r[2]||"-1"),arrayChildren:e.fromObject({type:r[1],components:this.components}),baseType:"array"}:{arrayLength:null,arrayChildren:null,baseType:null!=this.components?"tuple":this.type}),this._isParamType=!0,Object.freeze(this)}format(e){if(e||(e=ki.sighash),ki[e]||_i.throwArgumentError("invalid format type","format",e),e===ki.json){let t={type:"tuple"===this.baseType?"tuple":this.type,name:this.name||void 0};return"boolean"==typeof this.indexed&&(t.indexed=this.indexed),this.components&&(t.components=this.components.map((t=>JSON.parse(t.format(e))))),JSON.stringify(t)}let t="";return"array"===this.baseType?(t+=this.arrayChildren.format(e),t+="["+(this.arrayLength<0?"":String(this.arrayLength))+"]"):"tuple"===this.baseType?(e!==ki.sighash&&(t+=this.type),t+="("+this.components.map((t=>t.format(e))).join(e===ki.full?", ":",")+")"):t+=this.type,e!==ki.sighash&&(!0===this.indexed&&(t+=" indexed"),e===ki.full&&this.name&&(t+=" "+this.name)),t}static from(t,n){return"string"==typeof t?e.fromString(t,n):e.fromObject(t)}static fromObject(t){return e.isParamType(t)?t:new e(Ei,{name:t.name||null,type:ji(t.type),indexed:null==t.indexed?null:!!t.indexed,components:t.components?t.components.map(e.fromObject):null})}static fromString(t,n){return r=function(e,t){let n=e;function r(t){_i.throwArgumentError(`unexpected character at position ${t}`,"param",e)}function i(e){let n={type:"",name:"",parent:e,state:{allowType:!0}};return t&&(n.indexed=!1),n}e=e.replace(/\s/g," ");let a={type:"",name:"",state:{allowType:!0}},o=a;for(let n=0;n<e.length;n++){let a=e[n];switch(a){case"(":o.state.allowType&&""===o.type?o.type="tuple":o.state.allowParams||r(n),o.state.allowType=!1,o.type=ji(o.type),o.components=[i(o)],o=o.components[0];break;case")":delete o.state,"indexed"===o.name&&(t||r(n),o.indexed=!0,o.name=""),Ri(o.type,o.name)&&(o.name=""),o.type=ji(o.type);let e=o;o=o.parent,o||r(n),delete e.parent,o.state.allowParams=!1,o.state.allowName=!0,o.state.allowArray=!0;break;case",":delete o.state,"indexed"===o.name&&(t||r(n),o.indexed=!0,o.name=""),Ri(o.type,o.name)&&(o.name=""),o.type=ji(o.type);let s=i(o.parent);o.parent.components.push(s),delete o.parent,o=s;break;case" ":o.state.allowType&&""!==o.type&&(o.type=ji(o.type),delete o.state.allowType,o.state.allowName=!0,o.state.allowParams=!0),o.state.allowName&&""!==o.name&&("indexed"===o.name?(t||r(n),o.indexed&&r(n),o.indexed=!0,o.name=""):Ri(o.type,o.name)?o.name="":o.state.allowName=!1);break;case"[":o.state.allowArray||r(n),o.type+=a,o.state.allowArray=!1,o.state.allowName=!1,o.state.readArray=!0;break;case"]":o.state.readArray||r(n),o.type+=a,o.state.readArray=!1,o.state.allowArray=!0,o.state.allowName=!0;break;default:o.state.allowType?(o.type+=a,o.state.allowParams=!0,o.state.allowArray=!0):o.state.allowName?(o.name+=a,delete o.state.allowArray):o.state.readArray?o.type+=a:r(n)}}return o.parent&&_i.throwArgumentError("unexpected eof","param",e),delete a.state,"indexed"===o.name?(t||r(n.length-7),o.indexed&&r(n.length-7),o.indexed=!0,o.name=""):Ri(o.type,o.name)&&(o.name=""),a.type=ji(a.type),a}(t,!!n),e.fromObject({name:r.name,type:r.type,indexed:r.indexed,components:r.components});var r}static isParamType(e){return!(null==e||!e._isParamType)}};function xi(e,t){return function(e){e=e.trim();let t=[],n="",r=0;for(let i=0;i<e.length;i++){let a=e[i];","===a&&0===r?(t.push(n),n=""):(n+=a,"("===a?r++:")"===a&&(r--,-1===r&&_i.throwArgumentError("unbalanced parenthesis","value",e)))}n&&t.push(n);return t}(e).map((e=>Oi.fromString(e,t)))}let Ci=class e{constructor(e,t){e!==Ei&&_i.throwError("use a static from method",pr.errors.UNSUPPORTED_OPERATION,{operation:"new Fragment()"}),Si(this,t),this._isFragment=!0,Object.freeze(this)}static from(t){return e.isFragment(t)?t:"string"==typeof t?e.fromString(t):e.fromObject(t)}static fromObject(t){if(e.isFragment(t))return t;switch(t.type){case"function":return Fi.fromObject(t);case"event":return Mi.fromObject(t);case"constructor":return Di.fromObject(t);case"error":return Ui.fromObject(t);case"fallback":case"receive":return null}return _i.throwArgumentError("invalid fragment object","value",t)}static fromString(e){return"event"===(e=(e=(e=e.replace(/\s/g," ")).replace(/\(/g," (").replace(/\)/g,") ").replace(/\s+/g," ")).trim()).split(" ")[0]?Mi.fromString(e.substring(5).trim()):"function"===e.split(" ")[0]?Fi.fromString(e.substring(8).trim()):"constructor"===e.split("(")[0].trim()?Di.fromString(e.trim()):"error"===e.split(" ")[0]?Ui.fromString(e.substring(5).trim()):_i.throwArgumentError("unsupported fragment","value",e)}static isFragment(e){return!(!e||!e._isFragment)}},Mi=class e extends Ci{format(e){if(e||(e=ki.sighash),ki[e]||_i.throwArgumentError("invalid format type","format",e),e===ki.json)return JSON.stringify({type:"event",anonymous:this.anonymous,name:this.name,inputs:this.inputs.map((t=>JSON.parse(t.format(e))))});let t="";return e!==ki.sighash&&(t+="event "),t+=this.name+"("+this.inputs.map((t=>t.format(e))).join(e===ki.full?", ":",")+") ",e!==ki.sighash&&this.anonymous&&(t+="anonymous "),t.trim()}static from(t){return"string"==typeof t?e.fromString(t):e.fromObject(t)}static fromObject(t){if(e.isEventFragment(t))return t;"event"!==t.type&&_i.throwArgumentError("invalid event object","value",t);const n={name:zi(t.name),anonymous:t.anonymous,inputs:t.inputs?t.inputs.map(Oi.fromObject):[],type:"event"};return new e(Ei,n)}static fromString(t){let n=t.match(Hi);n||_i.throwArgumentError("invalid event string","value",t);let r=!1;return n[3].split(" ").forEach((e=>{switch(e.trim()){case"anonymous":r=!0;break;case"":break;default:_i.warn("unknown modifier: "+e)}})),e.fromObject({name:n[1].trim(),anonymous:r,inputs:xi(n[2],!0),type:"event"})}static isEventFragment(e){return e&&e._isFragment&&"event"===e.type}};function Pi(e,t){t.gas=null;let n=e.split("@");return 1!==n.length?(n.length>2&&_i.throwArgumentError("invalid human-readable ABI signature","value",e),n[1].match(/^[0-9]+$/)||_i.throwArgumentError("invalid human-readable ABI signature gas","value",e),t.gas=Hr.from(n[1]),n[0]):e}function Ni(e,t){t.constant=!1,t.payable=!1,t.stateMutability="nonpayable",e.split(" ").forEach((e=>{switch(e.trim()){case"constant":t.constant=!0;break;case"payable":t.payable=!0,t.stateMutability="payable";break;case"nonpayable":t.payable=!1,t.stateMutability="nonpayable";break;case"pure":t.constant=!0,t.stateMutability="pure";break;case"view":t.constant=!0,t.stateMutability="view";break;case"external":case"public":case"":break;default:console.log("unknown modifier: "+e)}}))}function Bi(e){let t={constant:!1,payable:!0,stateMutability:"payable"};return null!=e.stateMutability?(t.stateMutability=e.stateMutability,t.constant="view"===t.stateMutability||"pure"===t.stateMutability,null!=e.constant&&!!e.constant!==t.constant&&_i.throwArgumentError("cannot have constant function with mutability "+t.stateMutability,"value",e),t.payable="payable"===t.stateMutability,null!=e.payable&&!!e.payable!==t.payable&&_i.throwArgumentError("cannot have payable function with mutability "+t.stateMutability,"value",e)):null!=e.payable?(t.payable=!!e.payable,null!=e.constant||t.payable||"constructor"===e.type||_i.throwArgumentError("unable to determine stateMutability","value",e),t.constant=!!e.constant,t.constant?t.stateMutability="view":t.stateMutability=t.payable?"payable":"nonpayable",t.payable&&t.constant&&_i.throwArgumentError("cannot have constant payable function","value",e)):null!=e.constant?(t.constant=!!e.constant,t.payable=!t.constant,t.stateMutability=t.constant?"view":"payable"):"constructor"!==e.type&&_i.throwArgumentError("unable to determine stateMutability","value",e),t}let Di=class e extends Ci{format(e){if(e||(e=ki.sighash),ki[e]||_i.throwArgumentError("invalid format type","format",e),e===ki.json)return JSON.stringify({type:"constructor",stateMutability:"nonpayable"!==this.stateMutability?this.stateMutability:void 0,payable:this.payable,gas:this.gas?this.gas.toNumber():void 0,inputs:this.inputs.map((t=>JSON.parse(t.format(e))))});e===ki.sighash&&_i.throwError("cannot format a constructor for sighash",pr.errors.UNSUPPORTED_OPERATION,{operation:"format(sighash)"});let t="constructor("+this.inputs.map((t=>t.format(e))).join(e===ki.full?", ":",")+") ";return this.stateMutability&&"nonpayable"!==this.stateMutability&&(t+=this.stateMutability+" "),t.trim()}static from(t){return"string"==typeof t?e.fromString(t):e.fromObject(t)}static fromObject(t){if(e.isConstructorFragment(t))return t;"constructor"!==t.type&&_i.throwArgumentError("invalid constructor object","value",t);let n=Bi(t);n.constant&&_i.throwArgumentError("constructor cannot be constant","value",t);const r={name:null,type:t.type,inputs:t.inputs?t.inputs.map(Oi.fromObject):[],payable:n.payable,stateMutability:n.stateMutability,gas:t.gas?Hr.from(t.gas):null};return new e(Ei,r)}static fromString(t){let n={type:"constructor"},r=(t=Pi(t,n)).match(Hi);return r&&"constructor"===r[1].trim()||_i.throwArgumentError("invalid constructor string","value",t),n.inputs=xi(r[2].trim(),!1),Ni(r[3].trim(),n),e.fromObject(n)}static isConstructorFragment(e){return e&&e._isFragment&&"constructor"===e.type}},Fi=class e extends Di{format(e){if(e||(e=ki.sighash),ki[e]||_i.throwArgumentError("invalid format type","format",e),e===ki.json)return JSON.stringify({type:"function",name:this.name,constant:this.constant,stateMutability:"nonpayable"!==this.stateMutability?this.stateMutability:void 0,payable:this.payable,gas:this.gas?this.gas.toNumber():void 0,inputs:this.inputs.map((t=>JSON.parse(t.format(e)))),outputs:this.outputs.map((t=>JSON.parse(t.format(e))))});let t="";return e!==ki.sighash&&(t+="function "),t+=this.name+"("+this.inputs.map((t=>t.format(e))).join(e===ki.full?", ":",")+") ",e!==ki.sighash&&(this.stateMutability?"nonpayable"!==this.stateMutability&&(t+=this.stateMutability+" "):this.constant&&(t+="view "),this.outputs&&this.outputs.length&&(t+="returns ("+this.outputs.map((t=>t.format(e))).join(", ")+") "),null!=this.gas&&(t+="@"+this.gas.toString()+" ")),t.trim()}static from(t){return"string"==typeof t?e.fromString(t):e.fromObject(t)}static fromObject(t){if(e.isFunctionFragment(t))return t;"function"!==t.type&&_i.throwArgumentError("invalid function object","value",t);let n=Bi(t);const r={type:t.type,name:zi(t.name),constant:n.constant,inputs:t.inputs?t.inputs.map(Oi.fromObject):[],outputs:t.outputs?t.outputs.map(Oi.fromObject):[],payable:n.payable,stateMutability:n.stateMutability,gas:t.gas?Hr.from(t.gas):null};return new e(Ei,r)}static fromString(t){let n={type:"function"},r=(t=Pi(t,n)).split(" returns ");r.length>2&&_i.throwArgumentError("invalid function string","value",t);let i=r[0].match(Hi);if(i||_i.throwArgumentError("invalid function signature","value",t),n.name=i[1].trim(),n.name&&zi(n.name),n.inputs=xi(i[2],!1),Ni(i[3].trim(),n),r.length>1){let e=r[1].match(Hi);""==e[1].trim()&&""==e[3].trim()||_i.throwArgumentError("unexpected tokens","value",t),n.outputs=xi(e[2],!1)}else n.outputs=[];return e.fromObject(n)}static isFunctionFragment(e){return e&&e._isFragment&&"function"===e.type}};function Li(e){const t=e.format();return"Error(string)"!==t&&"Panic(uint256)"!==t||_i.throwArgumentError(`cannot specify user defined ${t} error`,"fragment",e),e}let Ui=class e extends Ci{format(e){if(e||(e=ki.sighash),ki[e]||_i.throwArgumentError("invalid format type","format",e),e===ki.json)return JSON.stringify({type:"error",name:this.name,inputs:this.inputs.map((t=>JSON.parse(t.format(e))))});let t="";return e!==ki.sighash&&(t+="error "),t+=this.name+"("+this.inputs.map((t=>t.format(e))).join(e===ki.full?", ":",")+") ",t.trim()}static from(t){return"string"==typeof t?e.fromString(t):e.fromObject(t)}static fromObject(t){if(e.isErrorFragment(t))return t;"error"!==t.type&&_i.throwArgumentError("invalid error object","value",t);const n={type:t.type,name:zi(t.name),inputs:t.inputs?t.inputs.map(Oi.fromObject):[]};return Li(new e(Ei,n))}static fromString(t){let n={type:"error"},r=t.match(Hi);return r||_i.throwArgumentError("invalid error signature","value",t),n.name=r[1].trim(),n.name&&zi(n.name),n.inputs=xi(r[2],!1),Li(e.fromObject(n))}static isErrorFragment(e){return e&&e._isFragment&&"error"===e.type}};function ji(e){return e.match(/^uint($|[^1-9])/)?e="uint256"+e.substring(4):e.match(/^int($|[^1-9])/)&&(e="int256"+e.substring(3)),e}const qi=new RegExp("^[a-zA-Z$_][a-zA-Z0-9$_]*$");function zi(e){return e&&e.match(qi)||_i.throwArgumentError(`invalid identifier "${e}"`,"value",e),e}const Hi=new RegExp("^([^)(]*)\\((.*)\\)([^)(]*)$");const Gi=new pr(wi);function Vi(e){const t=[],n=function(e,r){if(Array.isArray(r))for(let i in r){const a=e.slice();a.push(i);try{n(a,r[i])}catch(e){t.push({path:a,error:e})}}};return n([],e),t}let Ki=class{constructor(e,t,n,r){this.name=e,this.type=t,this.localName=n,this.dynamic=r}_throwError(e,t){Gi.throwArgumentError(e,this.localName,t)}},Wi=class{constructor(e){ui(this,"wordSize",e||32),this._data=[],this._dataLength=0,this._padding=new Uint8Array(e)}get data(){return xr(this._data)}get length(){return this._dataLength}_writeData(e){return this._data.push(e),this._dataLength+=e.length,e.length}appendWriter(e){return this._writeData(Er(e._data))}writeBytes(e){let t=_r(e);const n=t.length%this.wordSize;return n&&(t=Er([t,this._padding.slice(n)])),this._writeData(t)}_getValue(e){let t=_r(Hr.from(e));return t.length>this.wordSize&&Gi.throwError("value out-of-bounds",pr.errors.BUFFER_OVERRUN,{length:this.wordSize,offset:t.length}),t.length%this.wordSize&&(t=Er([this._padding.slice(t.length%this.wordSize),t])),t}writeValue(e){return this._writeData(this._getValue(e))}writeUpdatableValue(){const e=this._data.length;return this._data.push(this._padding),this._dataLength+=this.wordSize,t=>{this._data[e]=this._getValue(t)}}};var Xi={exports:{}};
|
|
2
2
|
/**
|
|
3
3
|
* [js-sha3]{@link https://github.com/emn178/js-sha3}
|
|
4
4
|
*
|
|
@@ -28,7 +28,7 @@ e.exports=n=function(){return r},e.exports.__esModule=!0,e.exports.default=e.exp
|
|
|
28
28
|
* @author Chen, Yi-Cyuan [emn178@gmail.com]
|
|
29
29
|
* @copyright Chen, Yi-Cyuan 2015-2018
|
|
30
30
|
* @license MIT
|
|
31
|
-
*/oM=sM,function(){var e="input is invalid type",t="object"==typeof window,n=t?window:{};n.JS_SHA3_NO_WINDOW&&(t=!1);var r=!t&&"object"==typeof self;!n.JS_SHA3_NO_NODE_JS&&"object"==typeof process&&process.versions&&process.versions.node?n=YO:r&&(n=self);var i=!n.JS_SHA3_NO_COMMON_JS&&oM.exports,a=!n.JS_SHA3_NO_ARRAY_BUFFER&&"undefined"!=typeof ArrayBuffer,o="0123456789abcdef".split(""),s=[4,1024,262144,67108864],c=[0,8,16,24],u=[1,0,32898,0,32906,2147483648,2147516416,2147483648,32907,0,2147483649,0,2147516545,2147483648,32777,2147483648,138,0,136,0,2147516425,0,2147483658,0,2147516555,0,139,2147483648,32905,2147483648,32771,2147483648,32770,2147483648,128,2147483648,32778,0,2147483658,2147483648,2147516545,2147483648,32896,2147483648,2147483649,0,2147516424,2147483648],f=[224,256,384,512],d=[128,256],l=["hex","buffer","arrayBuffer","array","digest"],p={128:168,256:136};!n.JS_SHA3_NO_NODE_JS&&Array.isArray||(Array.isArray=function(e){return"[object Array]"===Object.prototype.toString.call(e)}),!a||!n.JS_SHA3_NO_ARRAY_BUFFER_IS_VIEW&&ArrayBuffer.isView||(ArrayBuffer.isView=function(e){return"object"==typeof e&&e.buffer&&e.buffer.constructor===ArrayBuffer});for(var h=function(e,t,n){return function(r){return new O(e,t,e).update(r)[n]()}},b=function(e,t,n){return function(r,i){return new O(e,t,i).update(r)[n]()}},m=function(e,t,n){return function(t,r,i,a){return _["cshake"+e].update(t,r,i,a)[n]()}},y=function(e,t,n){return function(t,r,i,a){return _["kmac"+e].update(t,r,i,a)[n]()}},g=function(e,t,n,r){for(var i=0;i<l.length;++i){var a=l[i];e[a]=t(n,r,a)}return e},v=function(e,t){var n=h(e,t,"hex");return n.create=function(){return new O(e,t,e)},n.update=function(e){return n.create().update(e)},g(n,h,e,t)},w=[{name:"keccak",padding:[1,256,65536,16777216],bits:f,createMethod:v},{name:"sha3",padding:[6,1536,393216,100663296],bits:f,createMethod:v},{name:"shake",padding:[31,7936,2031616,520093696],bits:d,createMethod:function(e,t){var n=b(e,t,"hex");return n.create=function(n){return new O(e,t,n)},n.update=function(e,t){return n.create(t).update(e)},g(n,b,e,t)}},{name:"cshake",padding:s,bits:d,createMethod:function(e,t){var n=p[e],r=m(e,0,"hex");return r.create=function(r,i,a){return i||a?new O(e,t,r).bytepad([i,a],n):_["shake"+e].create(r)},r.update=function(e,t,n,i){return r.create(t,n,i).update(e)},g(r,m,e,t)}},{name:"kmac",padding:s,bits:d,createMethod:function(e,t){var n=p[e],r=y(e,0,"hex");return r.create=function(r,i,a){return new x(e,t,i).bytepad(["KMAC",a],n).bytepad([r],n)},r.update=function(e,t,n,i){return r.create(e,n,i).update(t)},g(r,y,e,t)}}],_={},E=[],T=0;T<w.length;++T)for(var A=w[T],R=A.bits,S=0;S<R.length;++S){var k=A.name+"_"+R[S];if(E.push(k),_[k]=A.createMethod(R[S],A.padding),"sha3"!==A.name){var I=A.name+R[S];E.push(I),_[I]=_[k]}}function O(e,t,n){this.blocks=[],this.s=[],this.padding=t,this.outputBits=n,this.reset=!0,this.finalized=!1,this.block=0,this.start=0,this.blockCount=1600-(e<<1)>>5,this.byteCount=this.blockCount<<2,this.outputBlocks=n>>5,this.extraBytes=(31&n)>>3;for(var r=0;r<50;++r)this.s[r]=0}function x(e,t,n){O.call(this,e,t,n)}O.prototype.update=function(t){if(this.finalized)throw new Error("finalize already called");var n,r=typeof t;if("string"!==r){if("object"!==r)throw new Error(e);if(null===t)throw new Error(e);if(a&&t.constructor===ArrayBuffer)t=new Uint8Array(t);else if(!(Array.isArray(t)||a&&ArrayBuffer.isView(t)))throw new Error(e);n=!0}for(var i,o,s=this.blocks,u=this.byteCount,f=t.length,d=this.blockCount,l=0,p=this.s;l<f;){if(this.reset)for(this.reset=!1,s[0]=this.block,i=1;i<d+1;++i)s[i]=0;if(n)for(i=this.start;l<f&&i<u;++l)s[i>>2]|=t[l]<<c[3&i++];else for(i=this.start;l<f&&i<u;++l)(o=t.charCodeAt(l))<128?s[i>>2]|=o<<c[3&i++]:o<2048?(s[i>>2]|=(192|o>>6)<<c[3&i++],s[i>>2]|=(128|63&o)<<c[3&i++]):o<55296||o>=57344?(s[i>>2]|=(224|o>>12)<<c[3&i++],s[i>>2]|=(128|o>>6&63)<<c[3&i++],s[i>>2]|=(128|63&o)<<c[3&i++]):(o=65536+((1023&o)<<10|1023&t.charCodeAt(++l)),s[i>>2]|=(240|o>>18)<<c[3&i++],s[i>>2]|=(128|o>>12&63)<<c[3&i++],s[i>>2]|=(128|o>>6&63)<<c[3&i++],s[i>>2]|=(128|63&o)<<c[3&i++]);if(this.lastByteIndex=i,i>=u){for(this.start=i-u,this.block=s[d],i=0;i<d;++i)p[i]^=s[i];C(p),this.reset=!0}else this.start=i}return this},O.prototype.encode=function(e,t){var n=255&e,r=1,i=[n];for(n=255&(e>>=8);n>0;)i.unshift(n),n=255&(e>>=8),++r;return t?i.push(r):i.unshift(r),this.update(i),i.length},O.prototype.encodeString=function(t){var n,r=typeof t;if("string"!==r){if("object"!==r)throw new Error(e);if(null===t)throw new Error(e);if(a&&t.constructor===ArrayBuffer)t=new Uint8Array(t);else if(!(Array.isArray(t)||a&&ArrayBuffer.isView(t)))throw new Error(e);n=!0}var i=0,o=t.length;if(n)i=o;else for(var s=0;s<t.length;++s){var c=t.charCodeAt(s);c<128?i+=1:c<2048?i+=2:c<55296||c>=57344?i+=3:(c=65536+((1023&c)<<10|1023&t.charCodeAt(++s)),i+=4)}return i+=this.encode(8*i),this.update(t),i},O.prototype.bytepad=function(e,t){for(var n=this.encode(t),r=0;r<e.length;++r)n+=this.encodeString(e[r]);var i=t-n%t,a=[];return a.length=i,this.update(a),this},O.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var e=this.blocks,t=this.lastByteIndex,n=this.blockCount,r=this.s;if(e[t>>2]|=this.padding[3&t],this.lastByteIndex===this.byteCount)for(e[0]=e[n],t=1;t<n+1;++t)e[t]=0;for(e[n-1]|=2147483648,t=0;t<n;++t)r[t]^=e[t];C(r)}},O.prototype.toString=O.prototype.hex=function(){this.finalize();for(var e,t=this.blockCount,n=this.s,r=this.outputBlocks,i=this.extraBytes,a=0,s=0,c="";s<r;){for(a=0;a<t&&s<r;++a,++s)e=n[a],c+=o[e>>4&15]+o[15&e]+o[e>>12&15]+o[e>>8&15]+o[e>>20&15]+o[e>>16&15]+o[e>>28&15]+o[e>>24&15];s%t==0&&(C(n),a=0)}return i&&(e=n[a],c+=o[e>>4&15]+o[15&e],i>1&&(c+=o[e>>12&15]+o[e>>8&15]),i>2&&(c+=o[e>>20&15]+o[e>>16&15])),c},O.prototype.arrayBuffer=function(){this.finalize();var e,t=this.blockCount,n=this.s,r=this.outputBlocks,i=this.extraBytes,a=0,o=0,s=this.outputBits>>3;e=i?new ArrayBuffer(r+1<<2):new ArrayBuffer(s);for(var c=new Uint32Array(e);o<r;){for(a=0;a<t&&o<r;++a,++o)c[o]=n[a];o%t==0&&C(n)}return i&&(c[a]=n[a],e=e.slice(0,s)),e},O.prototype.buffer=O.prototype.arrayBuffer,O.prototype.digest=O.prototype.array=function(){this.finalize();for(var e,t,n=this.blockCount,r=this.s,i=this.outputBlocks,a=this.extraBytes,o=0,s=0,c=[];s<i;){for(o=0;o<n&&s<i;++o,++s)e=s<<2,t=r[o],c[e]=255&t,c[e+1]=t>>8&255,c[e+2]=t>>16&255,c[e+3]=t>>24&255;s%n==0&&C(r)}return a&&(e=s<<2,t=r[o],c[e]=255&t,a>1&&(c[e+1]=t>>8&255),a>2&&(c[e+2]=t>>16&255)),c},x.prototype=new O,x.prototype.finalize=function(){return this.encode(this.outputBits,!0),O.prototype.finalize.call(this)};var C=function(e){var t,n,r,i,a,o,s,c,f,d,l,p,h,b,m,y,g,v,w,_,E,T,A,R,S,k,I,O,x,C,M,P,N,B,D,F,L,U,j,q,z,H,G,V,K,W,X,$,J,Y,Q,Z,ee,te,ne,re,ie,ae,oe,se,ce,ue,fe;for(r=0;r<48;r+=2)i=e[0]^e[10]^e[20]^e[30]^e[40],a=e[1]^e[11]^e[21]^e[31]^e[41],o=e[2]^e[12]^e[22]^e[32]^e[42],s=e[3]^e[13]^e[23]^e[33]^e[43],c=e[4]^e[14]^e[24]^e[34]^e[44],f=e[5]^e[15]^e[25]^e[35]^e[45],d=e[6]^e[16]^e[26]^e[36]^e[46],l=e[7]^e[17]^e[27]^e[37]^e[47],t=(p=e[8]^e[18]^e[28]^e[38]^e[48])^(o<<1|s>>>31),n=(h=e[9]^e[19]^e[29]^e[39]^e[49])^(s<<1|o>>>31),e[0]^=t,e[1]^=n,e[10]^=t,e[11]^=n,e[20]^=t,e[21]^=n,e[30]^=t,e[31]^=n,e[40]^=t,e[41]^=n,t=i^(c<<1|f>>>31),n=a^(f<<1|c>>>31),e[2]^=t,e[3]^=n,e[12]^=t,e[13]^=n,e[22]^=t,e[23]^=n,e[32]^=t,e[33]^=n,e[42]^=t,e[43]^=n,t=o^(d<<1|l>>>31),n=s^(l<<1|d>>>31),e[4]^=t,e[5]^=n,e[14]^=t,e[15]^=n,e[24]^=t,e[25]^=n,e[34]^=t,e[35]^=n,e[44]^=t,e[45]^=n,t=c^(p<<1|h>>>31),n=f^(h<<1|p>>>31),e[6]^=t,e[7]^=n,e[16]^=t,e[17]^=n,e[26]^=t,e[27]^=n,e[36]^=t,e[37]^=n,e[46]^=t,e[47]^=n,t=d^(i<<1|a>>>31),n=l^(a<<1|i>>>31),e[8]^=t,e[9]^=n,e[18]^=t,e[19]^=n,e[28]^=t,e[29]^=n,e[38]^=t,e[39]^=n,e[48]^=t,e[49]^=n,b=e[0],m=e[1],W=e[11]<<4|e[10]>>>28,X=e[10]<<4|e[11]>>>28,O=e[20]<<3|e[21]>>>29,x=e[21]<<3|e[20]>>>29,se=e[31]<<9|e[30]>>>23,ce=e[30]<<9|e[31]>>>23,H=e[40]<<18|e[41]>>>14,G=e[41]<<18|e[40]>>>14,B=e[2]<<1|e[3]>>>31,D=e[3]<<1|e[2]>>>31,y=e[13]<<12|e[12]>>>20,g=e[12]<<12|e[13]>>>20,$=e[22]<<10|e[23]>>>22,J=e[23]<<10|e[22]>>>22,C=e[33]<<13|e[32]>>>19,M=e[32]<<13|e[33]>>>19,ue=e[42]<<2|e[43]>>>30,fe=e[43]<<2|e[42]>>>30,te=e[5]<<30|e[4]>>>2,ne=e[4]<<30|e[5]>>>2,F=e[14]<<6|e[15]>>>26,L=e[15]<<6|e[14]>>>26,v=e[25]<<11|e[24]>>>21,w=e[24]<<11|e[25]>>>21,Y=e[34]<<15|e[35]>>>17,Q=e[35]<<15|e[34]>>>17,P=e[45]<<29|e[44]>>>3,N=e[44]<<29|e[45]>>>3,R=e[6]<<28|e[7]>>>4,S=e[7]<<28|e[6]>>>4,re=e[17]<<23|e[16]>>>9,ie=e[16]<<23|e[17]>>>9,U=e[26]<<25|e[27]>>>7,j=e[27]<<25|e[26]>>>7,_=e[36]<<21|e[37]>>>11,E=e[37]<<21|e[36]>>>11,Z=e[47]<<24|e[46]>>>8,ee=e[46]<<24|e[47]>>>8,V=e[8]<<27|e[9]>>>5,K=e[9]<<27|e[8]>>>5,k=e[18]<<20|e[19]>>>12,I=e[19]<<20|e[18]>>>12,ae=e[29]<<7|e[28]>>>25,oe=e[28]<<7|e[29]>>>25,q=e[38]<<8|e[39]>>>24,z=e[39]<<8|e[38]>>>24,T=e[48]<<14|e[49]>>>18,A=e[49]<<14|e[48]>>>18,e[0]=b^~y&v,e[1]=m^~g&w,e[10]=R^~k&O,e[11]=S^~I&x,e[20]=B^~F&U,e[21]=D^~L&j,e[30]=V^~W&$,e[31]=K^~X&J,e[40]=te^~re&ae,e[41]=ne^~ie&oe,e[2]=y^~v&_,e[3]=g^~w&E,e[12]=k^~O&C,e[13]=I^~x&M,e[22]=F^~U&q,e[23]=L^~j&z,e[32]=W^~$&Y,e[33]=X^~J&Q,e[42]=re^~ae&se,e[43]=ie^~oe&ce,e[4]=v^~_&T,e[5]=w^~E&A,e[14]=O^~C&P,e[15]=x^~M&N,e[24]=U^~q&H,e[25]=j^~z&G,e[34]=$^~Y&Z,e[35]=J^~Q&ee,e[44]=ae^~se&ue,e[45]=oe^~ce&fe,e[6]=_^~T&b,e[7]=E^~A&m,e[16]=C^~P&R,e[17]=M^~N&S,e[26]=q^~H&B,e[27]=z^~G&D,e[36]=Y^~Z&V,e[37]=Q^~ee&K,e[46]=se^~ue&te,e[47]=ce^~fe&ne,e[8]=T^~b&y,e[9]=A^~m&g,e[18]=P^~R&k,e[19]=N^~S&I,e[28]=H^~B&F,e[29]=G^~D&L,e[38]=Z^~V&W,e[39]=ee^~K&X,e[48]=ue^~te&re,e[49]=fe^~ne&ie,e[0]^=u[r],e[1]^=u[r+1]};if(i)oM.exports=_;else for(T=0;T<E.length;++T)n[E[T]]=_[E[T]]}();var cM=sM.exports;function uM(e){return"0x"+cM.keccak_256(_r(e))}let fM=!1,dM=!1;const lM={debug:1,default:2,info:2,warning:3,error:4,off:5};let pM=lM.default,hM=null;const bM=function(){try{const e=[];if(["NFD","NFC","NFKD","NFKC"].forEach((t=>{try{if("test"!=="test".normalize(t))throw new Error("bad normalize")}catch(n){e.push(t)}})),e.length)throw new Error("missing "+e.join(", "));if(String.fromCharCode(233).normalize("NFD")!==String.fromCharCode(101,769))throw new Error("broken implementation")}catch(e){return e.message}return null}();var mM,yM;!function(e){e.DEBUG="DEBUG",e.INFO="INFO",e.WARNING="WARNING",e.ERROR="ERROR",e.OFF="OFF"}(mM||(mM={})),function(e){e.UNKNOWN_ERROR="UNKNOWN_ERROR",e.NOT_IMPLEMENTED="NOT_IMPLEMENTED",e.UNSUPPORTED_OPERATION="UNSUPPORTED_OPERATION",e.NETWORK_ERROR="NETWORK_ERROR",e.SERVER_ERROR="SERVER_ERROR",e.TIMEOUT="TIMEOUT",e.BUFFER_OVERRUN="BUFFER_OVERRUN",e.NUMERIC_FAULT="NUMERIC_FAULT",e.MISSING_NEW="MISSING_NEW",e.INVALID_ARGUMENT="INVALID_ARGUMENT",e.MISSING_ARGUMENT="MISSING_ARGUMENT",e.UNEXPECTED_ARGUMENT="UNEXPECTED_ARGUMENT",e.CALL_EXCEPTION="CALL_EXCEPTION",e.INSUFFICIENT_FUNDS="INSUFFICIENT_FUNDS",e.NONCE_EXPIRED="NONCE_EXPIRED",e.REPLACEMENT_UNDERPRICED="REPLACEMENT_UNDERPRICED",e.UNPREDICTABLE_GAS_LIMIT="UNPREDICTABLE_GAS_LIMIT",e.TRANSACTION_REPLACED="TRANSACTION_REPLACED",e.ACTION_REJECTED="ACTION_REJECTED"}(yM||(yM={}));const gM="0123456789abcdef";let vM=class e{constructor(e){Object.defineProperty(this,"version",{enumerable:!0,value:e,writable:!1})}_log(e,t){const n=e.toLowerCase();null==lM[n]&&this.throwArgumentError("invalid log level name","logLevel",e),pM>lM[n]||console.log.apply(console,t)}debug(...t){this._log(e.levels.DEBUG,t)}info(...t){this._log(e.levels.INFO,t)}warn(...t){this._log(e.levels.WARNING,t)}makeError(t,n,r){if(dM)return this.makeError("censored error",n,{});n||(n=e.errors.UNKNOWN_ERROR),r||(r={});const i=[];Object.keys(r).forEach((e=>{const t=r[e];try{if(t instanceof Uint8Array){let n="";for(let e=0;e<t.length;e++)n+=gM[t[e]>>4],n+=gM[15&t[e]];i.push(e+"=Uint8Array(0x"+n+")")}else i.push(e+"="+JSON.stringify(t))}catch(t){i.push(e+"="+JSON.stringify(r[e].toString()))}})),i.push(`code=${n}`),i.push(`version=${this.version}`);const a=t;let o="";switch(n){case yM.NUMERIC_FAULT:{o="NUMERIC_FAULT";const e=t;switch(e){case"overflow":case"underflow":case"division-by-zero":o+="-"+e;break;case"negative-power":case"negative-width":o+="-unsupported";break;case"unbound-bitwise-result":o+="-unbound-result"}break}case yM.CALL_EXCEPTION:case yM.INSUFFICIENT_FUNDS:case yM.MISSING_NEW:case yM.NONCE_EXPIRED:case yM.REPLACEMENT_UNDERPRICED:case yM.TRANSACTION_REPLACED:case yM.UNPREDICTABLE_GAS_LIMIT:o=n}o&&(t+=" [ See: https://links.ethers.org/v5-errors-"+o+" ]"),i.length&&(t+=" ("+i.join(", ")+")");const s=new Error(t);return s.reason=a,s.code=n,Object.keys(r).forEach((function(e){s[e]=r[e]})),s}throwError(e,t,n){throw this.makeError(e,t,n)}throwArgumentError(t,n,r){return this.throwError(t,e.errors.INVALID_ARGUMENT,{argument:n,value:r})}assert(e,t,n,r){e||this.throwError(t,n,r)}assertArgument(e,t,n,r){e||this.throwArgumentError(t,n,r)}checkNormalize(t){bM&&this.throwError("platform missing String.prototype.normalize",e.errors.UNSUPPORTED_OPERATION,{operation:"String.prototype.normalize",form:bM})}checkSafeUint53(t,n){"number"==typeof t&&(null==n&&(n="value not safe"),(t<0||t>=9007199254740991)&&this.throwError(n,e.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"out-of-safe-range",value:t}),t%1&&this.throwError(n,e.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"non-integer",value:t}))}checkArgumentCount(t,n,r){r=r?": "+r:"",t<n&&this.throwError("missing argument"+r,e.errors.MISSING_ARGUMENT,{count:t,expectedCount:n}),t>n&&this.throwError("too many arguments"+r,e.errors.UNEXPECTED_ARGUMENT,{count:t,expectedCount:n})}checkNew(t,n){t!==Object&&null!=t||this.throwError("missing new",e.errors.MISSING_NEW,{name:n.name})}checkAbstract(t,n){t===n?this.throwError("cannot instantiate abstract class "+JSON.stringify(n.name)+" directly; use a sub-class",e.errors.UNSUPPORTED_OPERATION,{name:t.name,operation:"new"}):t!==Object&&null!=t||this.throwError("missing new",e.errors.MISSING_NEW,{name:n.name})}static globalLogger(){return hM||(hM=new e("logger/5.7.0")),hM}static setCensorship(t,n){if(!t&&n&&this.globalLogger().throwError("cannot permanently disable censorship",e.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"}),fM){if(!t)return;this.globalLogger().throwError("error censorship permanent",e.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"})}dM=!!t,fM=!!n}static setLogLevel(t){const n=lM[t.toLowerCase()];null!=n?pM=n:e.globalLogger().warn("invalid log level - "+t)}static from(t){return new e(t)}};vM.errors=yM,vM.levels=mM;var wM=rr.BN;const _M=new vM("bignumber/5.7.0"),EM={};let TM=!1,AM=class e{constructor(e,t){e!==EM&&_M.throwError("cannot call constructor directly; use BigNumber.from",vM.errors.UNSUPPORTED_OPERATION,{operation:"new (BigNumber)"}),this._hex=t,this._isBigNumber=!0,Object.freeze(this)}fromTwos(e){return SM(kM(this).fromTwos(e))}toTwos(e){return SM(kM(this).toTwos(e))}abs(){return"-"===this._hex[0]?e.from(this._hex.substring(1)):this}add(e){return SM(kM(this).add(kM(e)))}sub(e){return SM(kM(this).sub(kM(e)))}div(t){return e.from(t).isZero()&&IM("division-by-zero","div"),SM(kM(this).div(kM(t)))}mul(e){return SM(kM(this).mul(kM(e)))}mod(e){const t=kM(e);return t.isNeg()&&IM("division-by-zero","mod"),SM(kM(this).umod(t))}pow(e){const t=kM(e);return t.isNeg()&&IM("negative-power","pow"),SM(kM(this).pow(t))}and(e){const t=kM(e);return(this.isNegative()||t.isNeg())&&IM("unbound-bitwise-result","and"),SM(kM(this).and(t))}or(e){const t=kM(e);return(this.isNegative()||t.isNeg())&&IM("unbound-bitwise-result","or"),SM(kM(this).or(t))}xor(e){const t=kM(e);return(this.isNegative()||t.isNeg())&&IM("unbound-bitwise-result","xor"),SM(kM(this).xor(t))}mask(e){return(this.isNegative()||e<0)&&IM("negative-width","mask"),SM(kM(this).maskn(e))}shl(e){return(this.isNegative()||e<0)&&IM("negative-width","shl"),SM(kM(this).shln(e))}shr(e){return(this.isNegative()||e<0)&&IM("negative-width","shr"),SM(kM(this).shrn(e))}eq(e){return kM(this).eq(kM(e))}lt(e){return kM(this).lt(kM(e))}lte(e){return kM(this).lte(kM(e))}gt(e){return kM(this).gt(kM(e))}gte(e){return kM(this).gte(kM(e))}isNegative(){return"-"===this._hex[0]}isZero(){return kM(this).isZero()}toNumber(){try{return kM(this).toNumber()}catch(e){IM("overflow","toNumber",this.toString())}return null}toBigInt(){try{return BigInt(this.toString())}catch(e){}return _M.throwError("this platform does not support BigInt",vM.errors.UNSUPPORTED_OPERATION,{value:this.toString()})}toString(){return arguments.length>0&&(10===arguments[0]?TM||(TM=!0,_M.warn("BigNumber.toString does not accept any parameters; base-10 is assumed")):16===arguments[0]?_M.throwError("BigNumber.toString does not accept any parameters; use bigNumber.toHexString()",vM.errors.UNEXPECTED_ARGUMENT,{}):_M.throwError("BigNumber.toString does not accept parameters",vM.errors.UNEXPECTED_ARGUMENT,{})),kM(this).toString(10)}toHexString(){return this._hex}toJSON(e){return{type:"BigNumber",hex:this.toHexString()}}static from(t){if(t instanceof e)return t;if("string"==typeof t)return t.match(/^-?0x[0-9a-f]+$/i)?new e(EM,RM(t)):t.match(/^-?[0-9]+$/)?new e(EM,RM(new wM(t))):_M.throwArgumentError("invalid BigNumber string","value",t);if("number"==typeof t)return t%1&&IM("underflow","BigNumber.from",t),(t>=9007199254740991||t<=-9007199254740991)&&IM("overflow","BigNumber.from",t),e.from(String(t));const n=t;if("bigint"==typeof n)return e.from(n.toString());if(wr(n))return e.from(kr(n));if(n)if(n.toHexString){const t=n.toHexString();if("string"==typeof t)return e.from(t)}else{let t=n._hex;if(null==t&&"BigNumber"===n.type&&(t=n.hex),"string"==typeof t&&(Rr(t)||"-"===t[0]&&Rr(t.substring(1))))return e.from(t)}return _M.throwArgumentError("invalid BigNumber value","value",t)}static isBigNumber(e){return!(!e||!e._isBigNumber)}};function RM(e){if("string"!=typeof e)return RM(e.toString(16));if("-"===e[0])return"-"===(e=e.substring(1))[0]&&_M.throwArgumentError("invalid hex","value",e),"0x00"===(e=RM(e))?e:"-"+e;if("0x"!==e.substring(0,2)&&(e="0x"+e),"0x"===e)return"0x00";for(e.length%2&&(e="0x0"+e.substring(2));e.length>4&&"0x00"===e.substring(0,4);)e="0x"+e.substring(4);return e}function SM(e){return AM.from(RM(e))}function kM(e){const t=AM.from(e).toHexString();return"-"===t[0]?new wM("-"+t.substring(3),16):new wM(t.substring(2),16)}function IM(e,t,n){const r={fault:e,operation:t};return null!=n&&(r.value=n),_M.throwError(e,vM.errors.NUMERIC_FAULT,r)}const OM=new vM("bignumber/5.7.0"),xM={},CM=AM.from(0),MM=AM.from(-1);function PM(e,t,n,r){const i={fault:t,operation:n};return void 0!==r&&(i.value=r),OM.throwError(e,vM.errors.NUMERIC_FAULT,i)}let NM="0";for(;NM.length<256;)NM+=NM;function BM(e){if("number"!=typeof e)try{e=AM.from(e).toNumber()}catch(e){}return"number"==typeof e&&e>=0&&e<=256&&!(e%1)?"1"+NM.substring(0,e):OM.throwArgumentError("invalid decimal size","decimals",e)}function DM(e,t){null==t&&(t=0);const n=BM(t),r=(e=AM.from(e)).lt(CM);r&&(e=e.mul(MM));let i=e.mod(n).toString();for(;i.length<n.length-1;)i="0"+i;i=i.match(/^([0-9]*[1-9]|0)(0*)/)[1];const a=e.div(n).toString();return e=1===n.length?a:a+"."+i,r&&(e="-"+e),e}function FM(e,t){null==t&&(t=0);const n=BM(t);"string"==typeof e&&e.match(/^-?[0-9.]+$/)||OM.throwArgumentError("invalid decimal value","value",e);const r="-"===e.substring(0,1);r&&(e=e.substring(1)),"."===e&&OM.throwArgumentError("missing value","value",e);const i=e.split(".");i.length>2&&OM.throwArgumentError("too many decimal points","value",e);let a=i[0],o=i[1];for(a||(a="0"),o||(o="0");"0"===o[o.length-1];)o=o.substring(0,o.length-1);for(o.length>n.length-1&&PM("fractional component exceeds decimals","underflow","parseFixed"),""===o&&(o="0");o.length<n.length-1;)o+="0";const s=AM.from(a),c=AM.from(o);let u=s.mul(n).add(c);return r&&(u=u.mul(MM)),u}let LM=class e{constructor(e,t,n,r){e!==xM&&OM.throwError("cannot use FixedFormat constructor; use FixedFormat.from",vM.errors.UNSUPPORTED_OPERATION,{operation:"new FixedFormat"}),this.signed=t,this.width=n,this.decimals=r,this.name=(t?"":"u")+"fixed"+String(n)+"x"+String(r),this._multiplier=BM(r),Object.freeze(this)}static from(t){if(t instanceof e)return t;"number"==typeof t&&(t=`fixed128x${t}`);let n=!0,r=128,i=18;if("string"==typeof t)if("fixed"===t);else if("ufixed"===t)n=!1;else{const e=t.match(/^(u?)fixed([0-9]+)x([0-9]+)$/);e||OM.throwArgumentError("invalid fixed format","format",t),n="u"!==e[1],r=parseInt(e[2]),i=parseInt(e[3])}else if(t){const e=(e,n,r)=>null==t[e]?r:(typeof t[e]!==n&&OM.throwArgumentError("invalid fixed format ("+e+" not "+n+")","format."+e,t[e]),t[e]);n=e("signed","boolean",n),r=e("width","number",r),i=e("decimals","number",i)}return r%8&&OM.throwArgumentError("invalid fixed format width (not byte aligned)","format.width",r),i>80&&OM.throwArgumentError("invalid fixed format (decimals too large)","format.decimals",i),new e(xM,n,r,i)}},UM=class e{constructor(e,t,n,r){e!==xM&&OM.throwError("cannot use FixedNumber constructor; use FixedNumber.from",vM.errors.UNSUPPORTED_OPERATION,{operation:"new FixedFormat"}),this.format=r,this._hex=t,this._value=n,this._isFixedNumber=!0,Object.freeze(this)}_checkFormat(e){this.format.name!==e.format.name&&OM.throwArgumentError("incompatible format; use fixedNumber.toFormat","other",e)}addUnsafe(t){this._checkFormat(t);const n=FM(this._value,this.format.decimals),r=FM(t._value,t.format.decimals);return e.fromValue(n.add(r),this.format.decimals,this.format)}subUnsafe(t){this._checkFormat(t);const n=FM(this._value,this.format.decimals),r=FM(t._value,t.format.decimals);return e.fromValue(n.sub(r),this.format.decimals,this.format)}mulUnsafe(t){this._checkFormat(t);const n=FM(this._value,this.format.decimals),r=FM(t._value,t.format.decimals);return e.fromValue(n.mul(r).div(this.format._multiplier),this.format.decimals,this.format)}divUnsafe(t){this._checkFormat(t);const n=FM(this._value,this.format.decimals),r=FM(t._value,t.format.decimals);return e.fromValue(n.mul(this.format._multiplier).div(r),this.format.decimals,this.format)}floor(){const t=this.toString().split(".");1===t.length&&t.push("0");let n=e.from(t[0],this.format);const r=!t[1].match(/^(0*)$/);return this.isNegative()&&r&&(n=n.subUnsafe(jM.toFormat(n.format))),n}ceiling(){const t=this.toString().split(".");1===t.length&&t.push("0");let n=e.from(t[0],this.format);const r=!t[1].match(/^(0*)$/);return!this.isNegative()&&r&&(n=n.addUnsafe(jM.toFormat(n.format))),n}round(t){null==t&&(t=0);const n=this.toString().split(".");if(1===n.length&&n.push("0"),(t<0||t>80||t%1)&&OM.throwArgumentError("invalid decimal count","decimals",t),n[1].length<=t)return this;const r=e.from("1"+NM.substring(0,t),this.format),i=qM.toFormat(this.format);return this.mulUnsafe(r).addUnsafe(i).floor().divUnsafe(r)}isZero(){return"0.0"===this._value||"0"===this._value}isNegative(){return"-"===this._value[0]}toString(){return this._value}toHexString(e){if(null==e)return this._hex;e%8&&OM.throwArgumentError("invalid byte width","width",e);return Pr(AM.from(this._hex).fromTwos(this.format.width).toTwos(e).toHexString(),e/8)}toUnsafeFloat(){return parseFloat(this.toString())}toFormat(t){return e.fromString(this._value,t)}static fromValue(t,n,r){return null!=r||null==n||function(e){return null!=e&&(AM.isBigNumber(e)||"number"==typeof e&&e%1==0||"string"==typeof e&&!!e.match(/^-?[0-9]+$/)||Rr(e)||"bigint"==typeof e||wr(e))}(n)||(r=n,n=null),null==n&&(n=0),null==r&&(r="fixed"),e.fromString(DM(t,n),LM.from(r))}static fromString(t,n){null==n&&(n="fixed");const r=LM.from(n),i=FM(t,r.decimals);!r.signed&&i.lt(CM)&&PM("unsigned value cannot be negative","overflow","value",t);let a=null;r.signed?a=i.toTwos(r.width).toHexString():(a=i.toHexString(),a=Pr(a,r.width/8));const o=DM(i,r.decimals);return new e(xM,a,o,r)}static fromBytes(t,n){null==n&&(n="fixed");const r=LM.from(n);if(_r(t).length>r.width/8)throw new Error("overflow");let i=AM.from(t);r.signed&&(i=i.fromTwos(r.width));const a=i.toTwos((r.signed?0:1)+r.width).toHexString(),o=DM(i,r.decimals);return new e(xM,a,o,r)}static from(t,n){if("string"==typeof t)return e.fromString(t,n);if(wr(t))return e.fromBytes(t,n);try{return e.fromValue(t,0,n)}catch(t){if(t.code!==vM.errors.INVALID_ARGUMENT)throw t}return OM.throwArgumentError("invalid FixedNumber value","value",t)}static isFixedNumber(e){return!(!e||!e._isFixedNumber)}};const jM=UM.from(1),qM=UM.from("0.5"),zM=new vM("strings/5.7.0");var HM,GM;function VM(e,t=HM.current){t!=HM.current&&(zM.checkNormalize(),e=e.normalize(t));let n=[];for(let t=0;t<e.length;t++){const r=e.charCodeAt(t);if(r<128)n.push(r);else if(r<2048)n.push(r>>6|192),n.push(63&r|128);else if(55296==(64512&r)){t++;const i=e.charCodeAt(t);if(t>=e.length||56320!=(64512&i))throw new Error("invalid utf-8 string");const a=65536+((1023&r)<<10)+(1023&i);n.push(a>>18|240),n.push(a>>12&63|128),n.push(a>>6&63|128),n.push(63&a|128)}else n.push(r>>12|224),n.push(r>>6&63|128),n.push(63&r|128)}return _r(n)}function KM(e,t){t||(t=function(e){return[parseInt(e,16)]});let n=0,r={};return e.split(",").forEach((e=>{let i=e.split(":");n+=parseInt(i[0],16),r[n]=t(i[1])})),r}function WM(e){let t=0;return e.split(",").map((e=>{let n=e.split("-");1===n.length?n[1]="0":""===n[1]&&(n[1]="1");let r=t+parseInt(n[0],16);return t=parseInt(n[1],16),{l:r,h:t}}))}function XM(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function $M(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?XM(Object(n),!0).forEach((function(t){xO(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):XM(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function JM(e,t,n){return YM.apply(this,arguments)}function YM(){return(YM=JO(tx.mark((function e(t,n,r){var i,a,o,s,c,u,f,d;return tx.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=n.users.map((function(e){return{ether_key:e.user,tokens:e.tokens.map((function(e){return $M({id:e.id,blueprint:e.blueprint},e.royalties&&e.royalties.length>0&&{royalties:e.royalties.map((function(e){return{recipient:e.recipient,percentage:e.percentage}}))})}))}})),a=n.royalties,o=$M($M({contract_address:n.contract_address},a&&a.length>0&&{royalties:a.map((function(e){return{recipient:e.recipient,percentage:e.percentage}}))}),{},{users:i,auth_signature:""}),s=uM(VM(JSON.stringify(o))),e.next=6,ax(s,t);case 6:return c=e.sent,u=$M($M({users:o.users.map((function(e){return{user:e.ether_key,tokens:e.tokens}}))},a&&a.length>0&&{royalties:a}),{},{contract_address:n.contract_address,auth_signature:c}),f={mintTokensRequestV2:[u]},e.next=11,r.mintTokens(f);case 11:return d=e.sent,e.abrupt("return",d.data);case 13:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function QM(e){switch(e.type){case"ERC721":return{type:"ERC721",data:{token_id:e.tokenId,token_address:e.tokenAddress}};case"ERC20":return{type:"ERC20",data:{token_address:e.tokenAddress}};case"ETH":return{type:"ETH",data:{decimals:18}}}}function ZM(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return eP(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?eP(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}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 a,o=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==n.return||n.return()}finally{if(s)throw a}}}}function eP(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function tP(e){return nP.apply(this,arguments)}function nP(){return(nP=JO(tx.mark((function e(t){var n,r,i,a,o,s,c,u,f,d,l,p,h,b,m;return tx.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.ethSigner,i=t.starkSigner,a=t.request,o=t.transfersApi,e.next=3,r.getAddress();case 3:return s=e.sent,c="ERC721"===a.type?"1":a.amount,e.next=7,o.getSignableTransferV1({getSignableTransferRequest:{sender:s,token:QM(a),amount:c,receiver:a.receiver}});case 7:return u=e.sent,f=u.data,d=f.signable_message,l=f.payload_hash,e.next=11,ax(d,r);case 11:return p=e.sent,e.next=14,i.signMessage(l);case 14:return h=e.sent,b={sender_stark_key:u.data.sender_stark_key,sender_vault_id:u.data.sender_vault_id,receiver_stark_key:u.data.receiver_stark_key,receiver_vault_id:u.data.receiver_vault_id,asset_id:u.data.asset_id,amount:u.data.amount,nonce:u.data.nonce,expiration_timestamp:u.data.expiration_timestamp,stark_signature:h},e.next=18,o.createTransferV1({createTransferRequest:b,xImxEthAddress:s,xImxEthSignature:p});case 18:return m=e.sent,e.abrupt("return",{sent_signature:null==m?void 0:m.data.sent_signature,status:null==m||null===(n=m.data.status)||void 0===n?void 0:n.toString(),time:null==m?void 0:m.data.time,transfer_id:null==m?void 0:m.data.transfer_id});case 20:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function rP(e){return iP.apply(this,arguments)}function iP(){return(iP=JO(tx.mark((function e(t){var n,r,i,a,o,s,c,u,f,d,l,p,h,b,m,y,g;return tx.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.ethSigner,r=t.starkSigner,i=t.request,a=t.transfersApi,e.next=3,n.getAddress();case 3:return o=e.sent,s=i.map((function(e){return{amount:"1",token:QM({type:"ERC721",tokenId:e.tokenId,tokenAddress:e.tokenAddress}),receiver:e.receiver}})),e.next=7,a.getSignableTransfer({getSignableTransferRequestV2:{sender_ether_key:o,signable_requests:s}});case 7:if(c=e.sent,void 0!==(u=c.data.signable_message)){e.next=11;break}throw new Error("Invalid response from Signable registration offchain");case 11:return e.next=13,ax(u,n);case 13:f=e.sent,d=[],l=ZM(c.data.signable_responses),e.prev=16,l.s();case 18:if((p=l.n()).done){e.next=27;break}return h=p.value,e.next=22,r.signMessage(h.payload_hash);case 22:b=e.sent,m={sender_vault_id:h.sender_vault_id,receiver_stark_key:h.receiver_stark_key,receiver_vault_id:h.receiver_vault_id,asset_id:h.asset_id,amount:h.amount,nonce:h.nonce,expiration_timestamp:h.expiration_timestamp,stark_signature:b},d.push(m);case 25:e.next=18;break;case 27:e.next=32;break;case 29:e.prev=29,e.t0=e.catch(16),l.e(e.t0);case 32:return e.prev=32,l.f(),e.finish(32);case 35:return y={sender_stark_key:c.data.sender_stark_key,requests:d},e.next=38,a.createTransfer({createTransferRequestV2:y,xImxEthAddress:o,xImxEthSignature:f});case 38:return g=e.sent,e.abrupt("return",{transfer_ids:null==g?void 0:g.data.transfer_ids});case 40:case"end":return e.stop()}}),e,null,[[16,29,32,35]])})))).apply(this,arguments)}!function(e){e.current="",e.NFC="NFC",e.NFD="NFD",e.NFKC="NFKC",e.NFKD="NFKD"}(HM||(HM={})),function(e){e.UNEXPECTED_CONTINUE="unexpected continuation byte",e.BAD_PREFIX="bad codepoint prefix",e.OVERRUN="string overrun",e.MISSING_CONTINUE="missing continuation byte",e.OUT_OF_RANGE="out of UTF-8 range",e.UTF16_SURROGATE="UTF-16 surrogate",e.OVERLONG="overlong representation"}(GM||(GM={})),WM("221,13-1b,5f-,40-10,51-f,11-3,3-3,2-2,2-4,8,2,15,2d,28-8,88,48,27-,3-5,11-20,27-,8,28,3-5,12,18,b-a,1c-4,6-16,2-d,2-2,2,1b-4,17-9,8f-,10,f,1f-2,1c-34,33-14e,4,36-,13-,6-2,1a-f,4,9-,3-,17,8,2-2,5-,2,8-,3-,4-8,2-3,3,6-,16-6,2-,7-3,3-,17,8,3,3,3-,2,6-3,3-,4-a,5,2-6,10-b,4,8,2,4,17,8,3,6-,b,4,4-,2-e,2-4,b-10,4,9-,3-,17,8,3-,5-,9-2,3-,4-7,3-3,3,4-3,c-10,3,7-2,4,5-2,3,2,3-2,3-2,4-2,9,4-3,6-2,4,5-8,2-e,d-d,4,9,4,18,b,6-3,8,4,5-6,3-8,3-3,b-11,3,9,4,18,b,6-3,8,4,5-6,3-6,2,3-3,b-11,3,9,4,18,11-3,7-,4,5-8,2-7,3-3,b-11,3,13-2,19,a,2-,8-2,2-3,7,2,9-11,4-b,3b-3,1e-24,3,2-,3,2-,2-5,5,8,4,2,2-,3,e,4-,6,2,7-,b-,3-21,49,23-5,1c-3,9,25,10-,2-2f,23,6,3,8-2,5-5,1b-45,27-9,2a-,2-3,5b-4,45-4,53-5,8,40,2,5-,8,2,5-,28,2,5-,20,2,5-,8,2,5-,8,8,18,20,2,5-,8,28,14-5,1d-22,56-b,277-8,1e-2,52-e,e,8-a,18-8,15-b,e,4,3-b,5e-2,b-15,10,b-5,59-7,2b-555,9d-3,5b-5,17-,7-,27-,7-,9,2,2,2,20-,36,10,f-,7,14-,4,a,54-3,2-6,6-5,9-,1c-10,13-1d,1c-14,3c-,10-6,32-b,240-30,28-18,c-14,a0,115-,3,66-,b-76,5,5-,1d,24,2,5-2,2,8-,35-2,19,f-10,1d-3,311-37f,1b,5a-b,d7-19,d-3,41,57-,68-4,29-3,5f,29-37,2e-2,25-c,2c-2,4e-3,30,78-3,64-,20,19b7-49,51a7-59,48e-2,38-738,2ba5-5b,222f-,3c-94,8-b,6-4,1b,6,2,3,3,6d-20,16e-f,41-,37-7,2e-2,11-f,5-b,18-,b,14,5-3,6,88-,2,bf-2,7-,7-,7-,4-2,8,8-9,8-2ff,20,5-b,1c-b4,27-,27-cbb1,f7-9,28-2,b5-221,56,48,3-,2-,3-,5,d,2,5,3,42,5-,9,8,1d,5,6,2-2,8,153-3,123-3,33-27fd,a6da-5128,21f-5df,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3,2-1d,61-ff7d"),"ad,34f,1806,180b,180c,180d,200b,200c,200d,2060,feff".split(",").map((e=>parseInt(e,16))),KM("b5:3bc,c3:ff,7:73,2:253,5:254,3:256,1:257,5:259,1:25b,3:260,1:263,2:269,1:268,5:26f,1:272,2:275,7:280,3:283,5:288,3:28a,1:28b,5:292,3f:195,1:1bf,29:19e,125:3b9,8b:3b2,1:3b8,1:3c5,3:3c6,1:3c0,1a:3ba,1:3c1,1:3c3,2:3b8,1:3b5,1bc9:3b9,1c:1f76,1:1f77,f:1f7a,1:1f7b,d:1f78,1:1f79,1:1f7c,1:1f7d,107:63,5:25b,4:68,1:68,1:68,3:69,1:69,1:6c,3:6e,4:70,1:71,1:72,1:72,1:72,7:7a,2:3c9,2:7a,2:6b,1:e5,1:62,1:63,3:65,1:66,2:6d,b:3b3,1:3c0,6:64,1b574:3b8,1a:3c3,20:3b8,1a:3c3,20:3b8,1a:3c3,20:3b8,1a:3c3,20:3b8,1a:3c3"),KM("179:1,2:1,2:1,5:1,2:1,a:4f,a:1,8:1,2:1,2:1,3:1,5:1,3:1,4:1,2:1,3:1,4:1,8:2,1:1,2:2,1:1,2:2,27:2,195:26,2:25,1:25,1:25,2:40,2:3f,1:3f,33:1,11:-6,1:-9,1ac7:-3a,6d:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,b:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,c:-8,2:-8,2:-8,2:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,49:-8,1:-8,1:-4a,1:-4a,d:-56,1:-56,1:-56,1:-56,d:-8,1:-8,f:-8,1:-8,3:-7"),KM("df:00730073,51:00690307,19:02BC006E,a7:006A030C,18a:002003B9,16:03B903080301,20:03C503080301,1d7:05650582,190f:00680331,1:00740308,1:0077030A,1:0079030A,1:006102BE,b6:03C50313,2:03C503130300,2:03C503130301,2:03C503130342,2a:1F0003B9,1:1F0103B9,1:1F0203B9,1:1F0303B9,1:1F0403B9,1:1F0503B9,1:1F0603B9,1:1F0703B9,1:1F0003B9,1:1F0103B9,1:1F0203B9,1:1F0303B9,1:1F0403B9,1:1F0503B9,1:1F0603B9,1:1F0703B9,1:1F2003B9,1:1F2103B9,1:1F2203B9,1:1F2303B9,1:1F2403B9,1:1F2503B9,1:1F2603B9,1:1F2703B9,1:1F2003B9,1:1F2103B9,1:1F2203B9,1:1F2303B9,1:1F2403B9,1:1F2503B9,1:1F2603B9,1:1F2703B9,1:1F6003B9,1:1F6103B9,1:1F6203B9,1:1F6303B9,1:1F6403B9,1:1F6503B9,1:1F6603B9,1:1F6703B9,1:1F6003B9,1:1F6103B9,1:1F6203B9,1:1F6303B9,1:1F6403B9,1:1F6503B9,1:1F6603B9,1:1F6703B9,3:1F7003B9,1:03B103B9,1:03AC03B9,2:03B10342,1:03B1034203B9,5:03B103B9,6:1F7403B9,1:03B703B9,1:03AE03B9,2:03B70342,1:03B7034203B9,5:03B703B9,6:03B903080300,1:03B903080301,3:03B90342,1:03B903080342,b:03C503080300,1:03C503080301,1:03C10313,2:03C50342,1:03C503080342,b:1F7C03B9,1:03C903B9,1:03CE03B9,2:03C90342,1:03C9034203B9,5:03C903B9,ac:00720073,5b:00B00063,6:00B00066,d:006E006F,a:0073006D,1:00740065006C,1:0074006D,124f:006800700061,2:00610075,2:006F0076,b:00700061,1:006E0061,1:03BC0061,1:006D0061,1:006B0061,1:006B0062,1:006D0062,1:00670062,3:00700066,1:006E0066,1:03BC0066,4:0068007A,1:006B0068007A,1:006D0068007A,1:00670068007A,1:00740068007A,15:00700061,1:006B00700061,1:006D00700061,1:006700700061,8:00700076,1:006E0076,1:03BC0076,1:006D0076,1:006B0076,1:006D0076,1:00700077,1:006E0077,1:03BC0077,1:006D0077,1:006B0077,1:006D0077,1:006B03C9,1:006D03C9,2:00620071,3:00632215006B0067,1:0063006F002E,1:00640062,1:00670079,2:00680070,2:006B006B,1:006B006D,9:00700068,2:00700070006D,1:00700072,2:00730076,1:00770062,c723:00660066,1:00660069,1:0066006C,1:006600660069,1:00660066006C,1:00730074,1:00730074,d:05740576,1:05740565,1:0574056B,1:057E0576,1:0574056D",(function(e){if(e.length%4!=0)throw new Error("bad data");let t=[];for(let n=0;n<e.length;n+=4)t.push(parseInt(e.substring(n,n+4),16));return t})),WM("80-20,2a0-,39c,32,f71,18e,7f2-f,19-7,30-4,7-5,f81-b,5,a800-20ff,4d1-1f,110,fa-6,d174-7,2e84-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,2,1f-5f,ff7f-20001");const aP=new vM("units/5.7.0"),oP=["wei","kwei","mwei","gwei","szabo","finney","ether"];function sP(e,t){if("string"!=typeof e&&aP.throwArgumentError("value must be a string","value",e),"string"==typeof t){const e=oP.indexOf(t);-1!==e&&(t=3*e)}return FM(e,null!=t?t:18)}function cP(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function uP(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?cP(Object(n),!0).forEach((function(t){xO(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):cP(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function fP(e,t,n,r,i,a,o){return dP.apply(this,arguments)}function dP(){return(dP=JO(tx.mark((function e(t,n,r,i,a,o,s){var c,u,f;return tx.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t.getAddress();case 2:return c=e.sent,e.next=5,iM(c,i,s);case 5:return u=e.sent,e.next=8,o.populateTransaction.registerAndDepositEth(c,i,u.operator_signature,r,a);case 8:return f=e.sent,e.abrupt("return",t.sendTransaction(uP(uP({},f),{},{value:n})));case 10:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function lP(e,t,n,r,i,a){return pP.apply(this,arguments)}function pP(){return(pP=JO(tx.mark((function e(t,n,r,i,a,o){var s;return tx.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,o.populateTransaction["deposit(uint256,uint256,uint256)"](i,r,a);case 2:return s=e.sent,e.abrupt("return",t.sendTransaction(uP(uP({},s),{},{value:n})));case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function hP(e,t,n,r,i,a){return bP.apply(this,arguments)}function bP(){return(bP=JO(tx.mark((function e(t,n,r,i,a,o){var s,c,u,f,d,l,p,h,b,m,y;return tx.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t.getAddress();case 2:return s=e.sent,c={decimals:18},u=sP(n.amount,"wei"),f={user:s,token:{type:n.type,data:c},amount:u.toString()},e.next=8,r.getSignableDeposit({getSignableDepositRequest:f});case 8:return d=e.sent,e.next=11,a.encodeAsset({assetType:"asset",encodeAssetRequest:{token:{type:n.type}}});case 11:return l=e.sent,p=l.data.asset_type,h=d.data.stark_key,b=d.data.vault_id,m=FO.connect(o.ethConfiguration.coreContractAddress,t),y=WO.connect(o.ethConfiguration.registrationContractAddress,t),e.next=19,nM(h,y);case 19:if(e.sent){e.next=24;break}return e.abrupt("return",fP(t,u,p,h,b,m,i));case 24:return e.abrupt("return",lP(t,u,p,h,b,m));case 25:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function mP(e,t,n,r,i,a){return yP.apply(this,arguments)}function yP(){return(yP=JO(tx.mark((function e(t,n,r,i,a,o){var s;return tx.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,o.populateTransaction.depositERC20(i,r,a,n);case 2:return s=e.sent,e.abrupt("return",t.sendTransaction(s));case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function gP(e,t,n,r,i,a,o){return vP.apply(this,arguments)}function vP(){return(vP=JO(tx.mark((function e(t,n,r,i,a,o,s){var c,u,f;return tx.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t.getAddress();case 2:return c=e.sent,e.next=5,iM(c,i,s);case 5:return u=e.sent,e.next=8,o.populateTransaction.registerAndDepositERC20(c,i,u.operator_signature,r,a,n);case 8:return f=e.sent,e.abrupt("return",t.sendTransaction(f));case 10:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function wP(e,t,n,r,i,a,o){return _P.apply(this,arguments)}function _P(){return(_P=JO(tx.mark((function e(t,n,r,i,a,o,s){var c,u,f,d,l,p,h,b,m,y,g,v,w,_,E,T;return tx.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t.getAddress();case 2:return c=e.sent,e.next=5,a.getToken({address:n.tokenAddress});case 5:return u=e.sent,f=parseInt(u.data.decimals),d={decimals:f,token_address:n.tokenAddress},l=sP(n.amount,0),p=MO.connect(n.tokenAddress,t),e.next=12,p.populateTransaction.approve(s.ethConfiguration.coreContractAddress,l);case 12:return h=e.sent,e.next=15,t.sendTransaction(h);case 15:return b={user:c,token:{type:n.type,data:d},amount:l.toString()},e.next=18,r.getSignableDeposit({getSignableDepositRequest:b});case 18:return m=e.sent,e.next=21,o.encodeAsset({assetType:"asset",encodeAssetRequest:{token:{type:n.type,data:{token_address:n.tokenAddress}}}});case 21:return y=e.sent,g=y.data.asset_type,v=m.data.stark_key,w=m.data.vault_id,_=AM.from(m.data.amount),E=FO.connect(s.ethConfiguration.coreContractAddress,t),T=WO.connect(s.ethConfiguration.registrationContractAddress,t),e.next=30,nM(v,T);case 30:if(e.sent){e.next=35;break}return e.abrupt("return",gP(t,_,g,v,w,E,i));case 35:return e.abrupt("return",mP(t,_,g,v,w,E));case 36:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function EP(e,t,n,r,i,a){return TP.apply(this,arguments)}function TP(){return(TP=JO(tx.mark((function e(t,n,r,i,a,o){var s;return tx.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,o.populateTransaction.depositNft(i,r,a,n);case 2:return s=e.sent,e.abrupt("return",t.sendTransaction(s));case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function AP(e,t,n,r,i,a){return RP.apply(this,arguments)}function RP(){return(RP=JO(tx.mark((function e(t,n,r,i,a,o){var s,c,u,f,d,l,p,h,b,m,y,g,v,w;return tx.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t.getAddress();case 2:return s=e.sent,c={token_address:n.tokenAddress,token_id:n.tokenId},u={user:s,token:{type:n.type,data:c},amount:"1".toString()},e.next=8,r.getSignableDeposit({getSignableDepositRequest:u});case 8:return f=e.sent,e.next=11,a.encodeAsset({assetType:"asset",encodeAssetRequest:{token:{type:n.type,data:{token_address:n.tokenAddress,token_id:n.tokenId}}}});case 11:return d=e.sent,l=d.data.asset_type,p=f.data.stark_key,h=f.data.vault_id,b=FO.connect(o.ethConfiguration.coreContractAddress,t),m=WO.connect(o.ethConfiguration.registrationContractAddress,t),e.next=19,nM(p,m);case 19:return y=e.sent,g=NO.connect(n.tokenAddress,t),v=o.ethConfiguration.coreContractAddress,e.next=24,g.isApprovedForAll(s,v);case 24:if(e.sent){e.next=28;break}return e.next=28,g.setApprovalForAll(v,!0);case 28:if(y){e.next=34;break}return e.next=31,iM(s,p,i);case 31:return w=e.sent,e.next=34,b.registerUser(s,p,w.operator_signature);case 34:return e.abrupt("return",EP(t,n.tokenId,l,p,h,b));case 35:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var SP=function(e){if(void 0!==e)return e;throw new Error("undefined field exception")};function kP(e){return IP.apply(this,arguments)}function IP(){return(IP=JO(tx.mark((function e(t){var n,r,i,a,o,s,c,u,f,d,l,p,h;return tx.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.ethSigner,r=t.starkSigner,i=t.withdrawalsApi,a="ERC721"===t.type?"1":t.amount,e.t0=i,e.next=5,n.getAddress();case 5:return e.t1=e.sent,e.t2=QM(t),e.t3=a,e.t4={user:e.t1,token:e.t2,amount:e.t3},e.t5={getSignableWithdrawalRequest:e.t4},e.next=12,e.t0.getSignableWithdrawal.call(e.t0,e.t5);case 12:return o=e.sent,s=o.data,c=s.signable_message,u=s.payload_hash,e.next=16,r.signMessage(u);case 16:return f=e.sent,e.next=19,ux(c,n);case 19:return d=e.sent,l=d.ethAddress,p=d.ethSignature,e.next=24,i.createWithdrawal({createWithdrawalRequest:{stark_key:SP(o.data.stark_key),amount:a,asset_id:SP(o.data.asset_id),vault_id:SP(o.data.vault_id),nonce:SP(o.data.nonce),stark_signature:f},xImxEthAddress:l,xImxEthSignature:p});case 24:return h=e.sent,e.abrupt("return",h.data);case 26:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function OP(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function xP(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?OP(Object(n),!0).forEach((function(t){xO(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):OP(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function CP(e,t,n,r){return MP.apply(this,arguments)}function MP(){return(MP=JO(tx.mark((function e(t,n,r,i){var a;return tx.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,r.encodeAsset({assetType:t,encodeAssetRequest:{token:xP({type:n},i&&{data:i})}});case 2:return a=e.sent,e.abrupt("return",a.data);case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function PP(e,t,n,r,i){return NP.apply(this,arguments)}function NP(){return(NP=JO(tx.mark((function e(t,n,r,i,a){var o,s,c;return tx.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t.getAddress();case 2:return o=e.sent,e.next=5,iM(o,r,a);case 5:return s=e.sent,e.next=8,i.populateTransaction.registerAndWithdraw(o,r,s.operator_signature,n);case 8:return c=e.sent,e.abrupt("return",t.sendTransaction(c));case 10:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function BP(e,t,n,r){return DP.apply(this,arguments)}function DP(){return(DP=JO(tx.mark((function e(t,n,r,i){var a;return tx.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,i.populateTransaction.withdraw(r,n);case 2:return a=e.sent,e.abrupt("return",t.sendTransaction(a));case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function FP(e,t,n,r,i,a){return LP.apply(this,arguments)}function LP(){return(LP=JO(tx.mark((function e(t,n,r,i,a,o){var s,c,u;return tx.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,CP("asset","ERC20",i,{token_address:r.tokenAddress});case 2:return s=e.sent,c=FO.connect(o.ethConfiguration.coreContractAddress,t),u=WO.connect(o.ethConfiguration.registrationContractAddress,t),e.next=7,nM(n,u);case 7:if(e.sent){e.next=12;break}return e.abrupt("return",PP(t,s.asset_type,n,u,a));case 12:return e.abrupt("return",BP(t,s.asset_type,n,c));case 13:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function UP(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function jP(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?UP(Object(n),!0).forEach((function(t){xO(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):UP(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function qP(e,t,n,r,i){return zP.apply(this,arguments)}function zP(){return(zP=JO(tx.mark((function e(t,n,r,i,a){var o;return tx.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,a.populateTransaction.withdrawAndMint(r,n,i);case 2:return o=e.sent,e.abrupt("return",t.sendTransaction(o));case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function HP(e,t,n,r,i,a){return GP.apply(this,arguments)}function GP(){return(GP=JO(tx.mark((function e(t,n,r,i,a,o){var s,c,u;return tx.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t.getAddress();case 2:return s=e.sent,e.next=5,iM(s,r,o);case 5:return c=e.sent,e.next=8,a.populateTransaction.regsiterAndWithdrawAndMint(s,r,c.operator_signature,n,i);case 8:return u=e.sent,e.abrupt("return",t.sendTransaction(u));case 10:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function VP(e){var t=e.data.id,n=e.data.blueprint||"";return Rm(nm("{".concat(t,"}:{").concat(n,"}")))}function KP(e,t,n,r,i,a){return WP.apply(this,arguments)}function WP(){return(WP=JO(tx.mark((function e(t,n,r,i,a,o){var s,c,u,f;return tx.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,CP("mintable-asset","ERC721",i,jP({id:r.data.id,token_address:r.data.tokenAddress},r.data.blueprint&&{blueprint:r.data.blueprint}));case 2:return s=e.sent,c=VP(r),u=FO.connect(o.ethConfiguration.coreContractAddress,t),f=WO.connect(o.ethConfiguration.registrationContractAddress,t),e.next=8,nM(n,f);case 8:if(e.sent){e.next=13;break}return e.abrupt("return",HP(t,s.asset_type,n,c,f,a));case 13:return e.abrupt("return",qP(t,s.asset_type,n,c,u));case 14:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function XP(e,t,n,r,i,a){return $P.apply(this,arguments)}function $P(){return($P=JO(tx.mark((function e(t,n,r,i,a,o){var s,c,u;return tx.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t.getAddress();case 2:return s=e.sent,e.next=5,iM(s,r,o);case 5:return c=e.sent,e.next=8,a.populateTransaction.registerAndWithdrawNft(s,r,c.operator_signature,n,i);case 8:return u=e.sent,e.abrupt("return",t.sendTransaction(u));case 10:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function JP(e,t,n,r,i){return YP.apply(this,arguments)}function YP(){return(YP=JO(tx.mark((function e(t,n,r,i,a){var o;return tx.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,a.populateTransaction.withdrawNft(r,n,i);case 2:return o=e.sent,e.abrupt("return",t.sendTransaction(o));case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function QP(e,t,n,r,i,a){return ZP.apply(this,arguments)}function ZP(){return(ZP=JO(tx.mark((function e(t,n,r,i,a,o){var s,c,u;return tx.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,CP("asset","ERC721",i,{token_id:r.tokenId,token_address:r.tokenAddress});case 2:return s=e.sent,c=FO.connect(o.ethConfiguration.coreContractAddress,t),u=WO.connect(o.ethConfiguration.registrationContractAddress,t),e.next=7,nM(n,u);case 7:if(e.sent){e.next=12;break}return e.abrupt("return",XP(t,s.asset_type,n,r.tokenId,u,a));case 12:return e.abrupt("return",JP(t,s.asset_type,n,r.tokenId,c));case 13:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function eN(e,t,n,r,i,a,o){return tN.apply(this,arguments)}function tN(){return(tN=JO(tx.mark((function e(t,n,r,i,a,o,s){var c,u;return tx.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return c=r.tokenAddress,u=r.tokenId,e.next=4,a.getMintableTokenDetailsByClientTokenId({tokenAddress:c,tokenId:u}).then((function(e){return KP(t,n,{type:"ERC721",data:{id:u,tokenAddress:c,blueprint:e.data.blueprint}},i,o,s)})).catch((function(e){var a;if(404===(null===(a=e.response)||void 0===a?void 0:a.status))return QP(t,n,r,i,o,s);throw e}));case 4:return e.abrupt("return",e.sent);case 5:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function nN(e,t,n,r,i){return rN.apply(this,arguments)}function rN(){return(rN=JO(tx.mark((function e(t,n,r,i,a){var o,s,c;return tx.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t.getAddress();case 2:return o=e.sent,e.next=5,iM(o,r,a);case 5:return s=e.sent,e.next=8,i.populateTransaction.registerAndWithdraw(o,r,s.operator_signature,n);case 8:return c=e.sent,e.abrupt("return",t.sendTransaction(c));case 10:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function iN(e,t,n,r){return aN.apply(this,arguments)}function aN(){return(aN=JO(tx.mark((function e(t,n,r,i){var a;return tx.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,i.populateTransaction.withdraw(r,n);case 2:return a=e.sent,e.abrupt("return",t.sendTransaction(a));case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function oN(e,t,n,r,i){return sN.apply(this,arguments)}function sN(){return(sN=JO(tx.mark((function e(t,n,r,i,a){var o,s,c;return tx.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,CP("asset","ETH",r);case 2:return o=e.sent,s=FO.connect(a.ethConfiguration.coreContractAddress,t),c=WO.connect(a.ethConfiguration.registrationContractAddress,t),e.next=7,nM(n,c);case 7:if(e.sent){e.next=12;break}return e.abrupt("return",nN(t,o.asset_type,n,c,i));case 12:return e.abrupt("return",iN(t,o.asset_type,n,s));case 13:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function cN(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function uN(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?cN(Object(n),!0).forEach((function(t){xO(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):cN(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function fN(e){return dN.apply(this,arguments)}function dN(){return(dN=JO(tx.mark((function e(t){var n,r,i,a,o,s,c,u,f,d,l,p,h,b,m,y,g;return tx.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.ethSigner,r=t.starkSigner,i=t.request,a=t.ordersApi,e.next=3,n.getAddress();case 3:return o=e.sent,s="ERC721"===i.sell.type?"1":i.sell.amount,c="ERC721"===i.buy.type?"1":i.buy.amount,u={user:o,amount_buy:c,token_buy:QM(i.buy),amount_sell:s,token_sell:QM(i.sell),fees:i.fees,expiration_timestamp:i.expiration_timestamp,split_fees:!0},e.next=9,a.getSignableOrder({getSignableOrderRequestV3:u});case 9:return f=e.sent,d=f.data,l=d.signable_message,p=d.payload_hash,e.next=13,ax(l,n);case 13:return h=e.sent,e.next=16,r.signMessage(p);case 16:return b=e.sent,m=f.data,y={createOrderRequest:{amount_buy:m.amount_buy,amount_sell:m.amount_sell,asset_id_buy:m.asset_id_buy,asset_id_sell:m.asset_id_sell,expiration_timestamp:m.expiration_timestamp,include_fees:!0,fees:i.fees,nonce:m.nonce,stark_key:m.stark_key,stark_signature:b,vault_id_buy:m.vault_id_buy,vault_id_sell:m.vault_id_sell},xImxEthAddress:o,xImxEthSignature:h},e.next=21,a.createOrderV3(y);case 21:return g=e.sent,e.abrupt("return",uN({},g.data));case 23:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function lN(e){return pN.apply(this,arguments)}function pN(){return(pN=JO(tx.mark((function e(t){var n,r,i,a,o,s,c,u,f,d,l,p;return tx.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.ethSigner,r=t.starkSigner,i=t.request,a=t.ordersApi,e.next=3,a.getSignableCancelOrderV3({getSignableCancelOrderRequest:{order_id:i.order_id}});case 3:return o=e.sent,s=o.data,c=s.signable_message,u=s.payload_hash,e.next=7,ax(c,n);case 7:return f=e.sent,e.next=10,r.signMessage(u);case 10:return d=e.sent,e.next=13,n.getAddress();case 13:return l=e.sent,e.next=16,a.cancelOrderV3({id:i.order_id.toString(),cancelOrderRequest:{order_id:i.order_id,stark_signature:d},xImxEthAddress:l,xImxEthSignature:f});case 16:return p=e.sent,e.abrupt("return",{order_id:p.data.order_id,status:p.data.status});case 18:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function hN(e){return bN.apply(this,arguments)}function bN(){return(bN=JO(tx.mark((function e(t){var n,r,i,a,o,s,c,u,f,d,l,p;return tx.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.ethSigner,r=t.starkSigner,i=t.request,a=t.tradesApi,e.next=3,n.getAddress();case 3:return o=e.sent,e.next=6,a.getSignableTrade({getSignableTradeRequest:{user:o,order_id:i.order_id,fees:i.fees}});case 6:return s=e.sent,c=s.data,u=c.signable_message,f=c.payload_hash,e.next=10,ax(u,n);case 10:return d=e.sent,e.next=13,r.signMessage(f);case 13:return l=e.sent,e.next=16,a.createTradeV3({createTradeRequest:{amount_buy:s.data.amount_buy,amount_sell:s.data.amount_sell,asset_id_buy:s.data.asset_id_buy,asset_id_sell:s.data.asset_id_sell,expiration_timestamp:s.data.expiration_timestamp,fee_info:s.data.fee_info,fees:i.fees,include_fees:!0,nonce:s.data.nonce,order_id:i.order_id,stark_key:s.data.stark_key,vault_id_buy:s.data.vault_id_buy,vault_id_sell:s.data.vault_id_sell,stark_signature:l},xImxEthAddress:o,xImxEthSignature:d});case 16:return p=e.sent,e.abrupt("return",p.data);case 18:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function mN(e){return yN.apply(this,arguments)}function yN(){return(yN=JO(tx.mark((function e(t){var n,r,i,a,o,s,c,u,f,d,l,p,h,b,m;return tx.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.ethSigner,i=t.starkSigner,a=t.request,o=t.exchangesApi,e.next=3,r.getAddress();case 3:return s=e.sent,c=a.amount,e.next=7,o.getExchangeSignableTransfer({id:a.transactionID,getSignableTransferRequest:{sender:s,token:QM(a),amount:c,receiver:a.receiver}});case 7:return u=e.sent,f=u.data,d=f.signable_message,l=f.payload_hash,e.next=11,ax(d,r);case 11:return p=e.sent,e.next=14,i.signMessage(l);case 14:return h=e.sent,b={sender_stark_key:u.data.sender_stark_key,sender_vault_id:u.data.sender_vault_id,receiver_stark_key:u.data.receiver_stark_key,receiver_vault_id:u.data.receiver_vault_id,asset_id:u.data.asset_id,amount:u.data.amount,nonce:u.data.nonce,expiration_timestamp:u.data.expiration_timestamp,stark_signature:h},e.next=18,o.createExchangeTransfer({id:a.transactionID,createTransferRequest:b,xImxEthAddress:s,xImxEthSignature:p});case 18:return m=e.sent,e.abrupt("return",{sent_signature:null==m?void 0:m.data.sent_signature,status:null==m||null===(n=m.data.status)||void 0===n?void 0:n.toString(),time:null==m?void 0:m.data.time,transfer_id:null==m?void 0:m.data.transfer_id});case 20:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function gN(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function vN(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?gN(Object(n),!0).forEach((function(t){xO(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):gN(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var wN=function(){function e(t){kO(this,e),this.config=t;var n=t.apiConfiguration;this.config=t,this.depositsApi=new eC(n),this.encodingApi=new iC(n),this.mintsApi=new wC(n),this.ordersApi=new IC(n),this.tokensApi=new DC(n),this.tradesApi=new jC(n),this.transfersApi=new GC(n),this.usersApi=new XC(n),this.withdrawalsApi=new QC(n),this.projectsApi=new MC(n),this.collectionsApi=new Jx(n),this.metadataApi=new lC(n),this.metadataRefreshesApi=new mC(n),this.exchangesApi=new cC(n)}var t,n,r,i,a,o,s,c,u,f,d,l,p,h,b,m,y,g,v,w,_,E,T,A,R,S,k,I;return OO(e,[{key:"isChainValid",value:function(e){return e===this.config.ethConfiguration.chainID}},{key:"validateChain",value:(I=JO(tx.mark((function e(t){var n;return tx.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t.getChainId();case 2:if(n=e.sent,this.isChainValid(n)){e.next=5;break}throw new Error("The wallet used for this operation is not from the correct network.");case 5:case"end":return e.stop()}}),e,this)}))),function(e){return I.apply(this,arguments)})},{key:"registerOffchain",value:(k=JO(tx.mark((function e(t){return tx.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.validateChain(t.ethSigner);case 2:return e.abrupt("return",eM(vN(vN({},t),{},{usersApi:this.usersApi})));case 3:case"end":return e.stop()}}),e,this)}))),function(e){return k.apply(this,arguments)})},{key:"isRegisteredOnchain",value:(S=JO(tx.mark((function e(t){var n,r;return tx.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.validateChain(t.ethSigner);case 2:return n=WO.connect(this.config.ethConfiguration.registrationContractAddress,t.ethSigner),e.next=5,t.starkSigner.getAddress();case 5:return r=e.sent,e.abrupt("return",nM(r,n));case 7:case"end":return e.stop()}}),e,this)}))),function(e){return S.apply(this,arguments)})},{key:"mint",value:(R=JO(tx.mark((function e(t,n){return tx.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.validateChain(t);case 2:return e.abrupt("return",JM(t,n,this.mintsApi));case 3:case"end":return e.stop()}}),e,this)}))),function(e,t){return R.apply(this,arguments)})},{key:"transfer",value:(A=JO(tx.mark((function e(t,n){return tx.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.validateChain(t.ethSigner);case 2:return e.abrupt("return",tP(vN(vN({},t),{},{request:n,transfersApi:this.transfersApi})));case 3:case"end":return e.stop()}}),e,this)}))),function(e,t){return A.apply(this,arguments)})},{key:"exchangeTransfer",value:(T=JO(tx.mark((function e(t,n){return tx.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.validateChain(t.ethSigner);case 2:return e.abrupt("return",mN(vN(vN({},t),{},{request:n,exchangesApi:this.exchangesApi})));case 3:case"end":return e.stop()}}),e,this)}))),function(e,t){return T.apply(this,arguments)})},{key:"batchNftTransfer",value:(E=JO(tx.mark((function e(t,n){return tx.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.validateChain(t.ethSigner);case 2:return e.abrupt("return",rP(vN(vN({},t),{},{request:n,transfersApi:this.transfersApi})));case 3:case"end":return e.stop()}}),e,this)}))),function(e,t){return E.apply(this,arguments)})},{key:"deposit",value:(_=JO(tx.mark((function e(t,n){return tx.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:e.t0=n.type,e.next="ETH"===e.t0?3:"ERC20"===e.t0?4:"ERC721"===e.t0?5:6;break;case 3:return e.abrupt("return",this.depositEth(t,n));case 4:return e.abrupt("return",this.depositERC20(t,n));case 5:return e.abrupt("return",this.depositERC721(t,n));case 6:case"end":return e.stop()}}),e,this)}))),function(e,t){return _.apply(this,arguments)})},{key:"depositEth",value:(w=JO(tx.mark((function e(t,n){return tx.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.validateChain(t);case 2:return e.abrupt("return",hP(t,n,this.depositsApi,this.usersApi,this.encodingApi,this.config));case 3:case"end":return e.stop()}}),e,this)}))),function(e,t){return w.apply(this,arguments)})},{key:"depositERC20",value:(v=JO(tx.mark((function e(t,n){return tx.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.validateChain(t);case 2:return e.abrupt("return",wP(t,n,this.depositsApi,this.usersApi,this.tokensApi,this.encodingApi,this.config));case 3:case"end":return e.stop()}}),e,this)}))),function(e,t){return v.apply(this,arguments)})},{key:"depositERC721",value:(g=JO(tx.mark((function e(t,n){return tx.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.validateChain(t);case 2:return e.abrupt("return",AP(t,n,this.depositsApi,this.usersApi,this.encodingApi,this.config));case 3:case"end":return e.stop()}}),e,this)}))),function(e,t){return g.apply(this,arguments)})},{key:"prepareWithdrawal",value:(y=JO(tx.mark((function e(t,n){return tx.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.validateChain(t.ethSigner);case 2:return e.abrupt("return",kP(vN(vN(vN({},t),n),{},{withdrawalsApi:this.withdrawalsApi})));case 3:case"end":return e.stop()}}),e,this)}))),function(e,t){return y.apply(this,arguments)})},{key:"completeWithdrawal",value:function(e,t,n){switch(n.type){case"ETH":return this.completeEthWithdrawal(e,t);case"ERC20":return this.completeERC20Withdrawal(e,t,n);case"ERC721":return this.completeERC721Withdrawal(e,t,n)}}},{key:"completeEthWithdrawal",value:(m=JO(tx.mark((function e(t,n){return tx.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.validateChain(t);case 2:return e.abrupt("return",oN(t,n,this.encodingApi,this.usersApi,this.config));case 3:case"end":return e.stop()}}),e,this)}))),function(e,t){return m.apply(this,arguments)})},{key:"completeERC20Withdrawal",value:(b=JO(tx.mark((function e(t,n,r){return tx.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.validateChain(t);case 2:return e.abrupt("return",FP(t,n,r,this.encodingApi,this.usersApi,this.config));case 3:case"end":return e.stop()}}),e,this)}))),function(e,t,n){return b.apply(this,arguments)})},{key:"completeERC721Withdrawal",value:function(){var e=JO(tx.mark((function e(t,n,r){return tx.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.validateChain(t);case 2:return e.abrupt("return",eN(t,n,r,this.encodingApi,this.mintsApi,this.usersApi,this.config));case 3:case"end":return e.stop()}}),e,this)})));return function(t,n,r){return e.apply(this,arguments)}}()},{key:"createOrder",value:(h=JO(tx.mark((function e(t,n){return tx.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.validateChain(t.ethSigner);case 2:return e.abrupt("return",fN(vN(vN({},t),{},{request:n,ordersApi:this.ordersApi})));case 3:case"end":return e.stop()}}),e,this)}))),function(e,t){return h.apply(this,arguments)})},{key:"cancelOrder",value:(p=JO(tx.mark((function e(t,n){return tx.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.validateChain(t.ethSigner);case 2:return e.abrupt("return",lN(vN(vN({},t),{},{request:n,ordersApi:this.ordersApi})));case 3:case"end":return e.stop()}}),e,this)}))),function(e,t){return p.apply(this,arguments)})},{key:"createTrade",value:(l=JO(tx.mark((function e(t,n){return tx.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.validateChain(t.ethSigner);case 2:return e.abrupt("return",hN(vN(vN({},t),{},{request:n,tradesApi:this.tradesApi})));case 3:case"end":return e.stop()}}),e,this)}))),function(e,t){return l.apply(this,arguments)})},{key:"createProject",value:(d=JO(tx.mark((function e(t,n){var r;return tx.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,sx(t);case 2:return r=e.sent,e.abrupt("return",this.projectsApi.createProject({iMXSignature:r.signature,iMXTimestamp:r.timestamp,createProjectRequest:n}));case 4:case"end":return e.stop()}}),e,this)}))),function(e,t){return d.apply(this,arguments)})},{key:"getProject",value:(f=JO(tx.mark((function e(t,n){var r;return tx.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,sx(t);case 2:return r=e.sent,e.abrupt("return",this.projectsApi.getProject({id:n,iMXSignature:r.signature,iMXTimestamp:r.timestamp}));case 4:case"end":return e.stop()}}),e,this)}))),function(e,t){return f.apply(this,arguments)})},{key:"getProjects",value:(u=JO(tx.mark((function e(t,n,r,i,a){var o;return tx.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,sx(t);case 2:return o=e.sent,e.abrupt("return",this.projectsApi.getProjects({iMXSignature:o.signature,iMXTimestamp:o.timestamp,pageSize:n,cursor:r,orderBy:i,direction:a}));case 4:case"end":return e.stop()}}),e,this)}))),function(e,t,n,r,i){return u.apply(this,arguments)})},{key:"createCollection",value:(c=JO(tx.mark((function e(t,n){var r;return tx.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,sx(t);case 2:return r=e.sent,e.abrupt("return",this.collectionsApi.createCollection({iMXSignature:r.signature,iMXTimestamp:r.timestamp,createCollectionRequest:n}));case 4:case"end":return e.stop()}}),e,this)}))),function(e,t){return c.apply(this,arguments)})},{key:"updateCollection",value:(s=JO(tx.mark((function e(t,n,r){var i;return tx.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,sx(t);case 2:return i=e.sent,e.abrupt("return",this.collectionsApi.updateCollection({iMXSignature:i.signature,iMXTimestamp:i.timestamp,address:n,updateCollectionRequest:r}));case 4:case"end":return e.stop()}}),e,this)}))),function(e,t,n){return s.apply(this,arguments)})},{key:"addMetadataSchemaToCollection",value:(o=JO(tx.mark((function e(t,n,r){var i;return tx.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,sx(t);case 2:return i=e.sent,e.abrupt("return",this.metadataApi.addMetadataSchemaToCollection({iMXSignature:i.signature,iMXTimestamp:i.timestamp,addMetadataSchemaToCollectionRequest:r,address:n}));case 4:case"end":return e.stop()}}),e,this)}))),function(e,t,n){return o.apply(this,arguments)})},{key:"updateMetadataSchemaByName",value:(a=JO(tx.mark((function e(t,n,r,i){var a;return tx.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,sx(t);case 2:return a=e.sent,e.abrupt("return",this.metadataApi.updateMetadataSchemaByName({iMXSignature:a.signature,iMXTimestamp:a.timestamp,address:n,name:r,metadataSchemaRequest:i}));case 4:case"end":return e.stop()}}),e,this)}))),function(e,t,n,r){return a.apply(this,arguments)})},{key:"listMetadataRefreshes",value:(i=JO(tx.mark((function e(t,n,r,i){var a,o;return tx.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,sx(t);case 2:return a=e.sent,e.next=5,t.getAddress();case 5:return o=e.sent,e.abrupt("return",this.metadataRefreshesApi.getAListOfMetadataRefreshes({xImxEthSignature:a.signature,xImxEthTimestamp:a.timestamp,xImxEthAddress:o,collectionAddress:n,pageSize:r,cursor:i}));case 7:case"end":return e.stop()}}),e,this)}))),function(e,t,n,r){return i.apply(this,arguments)})},{key:"getMetadataRefreshErrors",value:(r=JO(tx.mark((function e(t,n,r,i){var a,o;return tx.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,sx(t);case 2:return a=e.sent,e.next=5,t.getAddress();case 5:return o=e.sent,e.abrupt("return",this.metadataRefreshesApi.getMetadataRefreshErrors({xImxEthSignature:a.signature,xImxEthTimestamp:a.timestamp,xImxEthAddress:o,refreshId:n,pageSize:r,cursor:i}));case 7:case"end":return e.stop()}}),e,this)}))),function(e,t,n,i){return r.apply(this,arguments)})},{key:"getMetadataRefreshResults",value:(n=JO(tx.mark((function e(t,n){var r,i;return tx.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,sx(t);case 2:return r=e.sent,e.next=5,t.getAddress();case 5:return i=e.sent,e.abrupt("return",this.metadataRefreshesApi.getMetadataRefreshResults({xImxEthSignature:r.signature,xImxEthTimestamp:r.timestamp,xImxEthAddress:i,refreshId:n}));case 7:case"end":return e.stop()}}),e,this)}))),function(e,t){return n.apply(this,arguments)})},{key:"createMetadataRefresh",value:(t=JO(tx.mark((function e(t,n){var r,i;return tx.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,sx(t);case 2:return r=e.sent,e.next=5,t.getAddress();case 5:return i=e.sent,e.abrupt("return",this.metadataRefreshesApi.requestAMetadataRefresh({xImxEthSignature:r.signature,xImxEthTimestamp:r.timestamp,xImxEthAddress:i,createMetadataRefreshRequest:n}));case 7:case"end":return e.stop()}}),e,this)}))),function(e,n){return t.apply(this,arguments)})}]),e}();var _N=function(e){qO(n,Sx(Error));var t=function(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=LO(e);if(t){var i=LO(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return GO(this,n)}}(n);function n(e){var r,i=e.code,a=e.details,o=e.message;return kO(this,n),(r=t.call(this,o)).code=i,r.details=a,r}return OO(n)}();function EN(e){if(SO.isAxiosError(e)&&e.response){var t,n,r,i=e.response.data;return i.code&&i.message?new _N({code:i.code,details:i.details,message:i.message}):new _N({code:null!==(t=null!==(n=e.code)&&void 0!==n?n:null===(r=e.response)||void 0===r?void 0:r.status.toString())&&void 0!==t?t:"unknown_error_code",message:String(e)})}return new _N({code:"unknown_error_code",message:String(e)})}var TN=function(){function e(t){kO(this,e),this.depositsApi=new eC(t.apiConfiguration),this.mintsApi=new wC(t.apiConfiguration),this.ordersApi=new IC(t.apiConfiguration),this.tokensApi=new DC(t.apiConfiguration),this.tradesApi=new jC(t.apiConfiguration),this.transfersApi=new GC(t.apiConfiguration),this.exchangeApi=new cC(t.apiConfiguration),this.usersApi=new XC(t.apiConfiguration),this.withdrawalsApi=new QC(t.apiConfiguration),this.balanceApi=new Kx(t.apiConfiguration),this.assetApi=new zx(t.apiConfiguration),this.collectionApi=new Jx(t.apiConfiguration),this.metadataApi=new lC(t.apiConfiguration),this.metadataRefreshesApi=new mC(t.apiConfiguration),this.nftCheckoutPrimaryApi=new AC(t.apiConfiguration),this.projectsApi=new MC(t.apiConfiguration),this.workflows=new wN(t)}var t,n,r;return OO(e,[{key:"deposit",value:function(e,t){return this.workflows.deposit(e,t).catch((function(e){throw EN(e)}))}},{key:"getDeposit",value:function(e){return this.depositsApi.getDeposit(e).then((function(e){return e.data})).catch((function(e){throw EN(e)}))}},{key:"listDeposits",value:function(e){return this.depositsApi.listDeposits(e).then((function(e){return e.data})).catch((function(e){throw EN(e)}))}},{key:"registerOffchain",value:function(e){return this.workflows.registerOffchain(e).catch((function(e){throw EN(e)}))}},{key:"isRegisteredOnchain",value:function(e){return this.workflows.isRegisteredOnchain(e).catch((function(e){throw EN(e)}))}},{key:"getUser",value:function(e){return this.usersApi.getUsers({user:e}).then((function(e){return e.data})).catch((function(e){throw EN(e)}))}},{key:"getAsset",value:function(e){return this.assetApi.getAsset(e).then((function(e){return e.data})).catch((function(e){throw EN(e)}))}},{key:"listAssets",value:function(e){return this.assetApi.listAssets(e).then((function(e){return e.data})).catch((function(e){throw EN(e)}))}},{key:"createCollection",value:function(e,t){return this.workflows.createCollection(e,t).then((function(e){return e.data})).catch((function(e){throw EN(e)}))}},{key:"getCollection",value:function(e){return this.collectionApi.getCollection(e).then((function(e){return e.data})).catch((function(e){throw EN(e)}))}},{key:"listCollectionFilters",value:function(e){return this.collectionApi.listCollectionFilters(e).then((function(e){return e.data})).catch((function(e){throw EN(e)}))}},{key:"listCollections",value:function(e){return this.collectionApi.listCollections(e).then((function(e){return e.data})).catch((function(e){throw EN(e)}))}},{key:"updateCollection",value:function(e,t,n){return this.workflows.updateCollection(e,t,n).then((function(e){return e.data})).catch((function(e){throw EN(e)}))}},{key:"addMetadataSchemaToCollection",value:function(e,t,n){return this.workflows.addMetadataSchemaToCollection(e,t,n).then((function(e){return e.data})).catch((function(e){throw EN(e)}))}},{key:"getMetadataSchema",value:function(e){return this.metadataApi.getMetadataSchema(e).then((function(e){return e.data})).catch((function(e){throw EN(e)}))}},{key:"updateMetadataSchemaByName",value:function(e,t,n,r){return this.workflows.updateMetadataSchemaByName(e,t,n,r).then((function(e){return e.data})).catch((function(e){throw EN(e)}))}},{key:"listMetadataRefreshes",value:function(e,t,n,r){return this.workflows.listMetadataRefreshes(e,t,n,r).then((function(e){return e.data})).catch((function(e){throw EN(e)}))}},{key:"getMetadataRefreshErrors",value:function(e,t,n,r){return this.workflows.getMetadataRefreshErrors(e,t,n,r).then((function(e){return e.data})).catch((function(e){throw EN(e)}))}},{key:"getMetadataRefreshResults",value:function(e,t){return this.workflows.getMetadataRefreshResults(e,t).then((function(e){return e.data})).catch((function(e){throw EN(e)}))}},{key:"createMetadataRefresh",value:function(e,t){return this.workflows.createMetadataRefresh(e,t).then((function(e){return e.data})).catch((function(e){throw EN(e)}))}},{key:"createProject",value:(r=JO(tx.mark((function e(t,n){return tx.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.workflows.createProject(t,n).then((function(e){return e.data})).catch((function(e){throw EN(e)})));case 1:case"end":return e.stop()}}),e,this)}))),function(e,t){return r.apply(this,arguments)})},{key:"getProject",value:(n=JO(tx.mark((function e(t,n){return tx.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.workflows.getProject(t,n).then((function(e){return e.data})).catch((function(e){throw EN(e)})));case 1:case"end":return e.stop()}}),e,this)}))),function(e,t){return n.apply(this,arguments)})},{key:"getProjects",value:(t=JO(tx.mark((function e(t,n,r,i,a){return tx.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.workflows.getProjects(t,n,r,i,a).then((function(e){return e.data})).catch((function(e){throw EN(e)})));case 1:case"end":return e.stop()}}),e,this)}))),function(e,n,r,i,a){return t.apply(this,arguments)})},{key:"getBalance",value:function(e){return this.balanceApi.getBalance(e).then((function(e){return e.data})).catch((function(e){throw EN(e)}))}},{key:"listBalances",value:function(e){return this.balanceApi.listBalances(e).then((function(e){return e.data})).catch((function(e){throw EN(e)}))}},{key:"getMint",value:function(e){return this.mintsApi.getMint(e).then((function(e){return e.data})).catch((function(e){throw EN(e)}))}},{key:"listMints",value:function(e){return this.mintsApi.listMints(e).then((function(e){return e.data})).catch((function(e){throw EN(e)}))}},{key:"mint",value:function(e,t){return this.workflows.mint(e,t).catch((function(e){throw EN(e)}))}},{key:"listWithdrawals",value:function(e){return this.withdrawalsApi.listWithdrawals(e).then((function(e){return e.data})).catch((function(e){throw EN(e)}))}},{key:"getWithdrawal",value:function(e){return this.withdrawalsApi.getWithdrawal(e).then((function(e){return e.data})).catch((function(e){throw EN(e)}))}},{key:"prepareWithdrawal",value:function(e,t){return this.workflows.prepareWithdrawal(e,t).catch((function(e){throw EN(e)}))}},{key:"completeWithdrawal",value:function(e,t,n){return this.workflows.completeWithdrawal(e,t,n).catch((function(e){throw EN(e)}))}},{key:"getOrder",value:function(e){return this.ordersApi.getOrderV3(e).then((function(e){return e.data})).catch((function(e){throw EN(e)}))}},{key:"listOrders",value:function(e){return this.ordersApi.listOrdersV3(e).then((function(e){return e.data})).catch((function(e){throw EN(e)}))}},{key:"createOrder",value:function(e,t){return this.workflows.createOrder(e,t).catch((function(e){throw EN(e)}))}},{key:"cancelOrder",value:function(e,t){return this.workflows.cancelOrder(e,t).catch((function(e){throw EN(e)}))}},{key:"getTrade",value:function(e){return this.tradesApi.getTrade(e).then((function(e){return e.data})).catch((function(e){throw EN(e)}))}},{key:"listTrades",value:function(e){return this.tradesApi.listTradesV3(e).then((function(e){return e.data})).catch((function(e){throw EN(e)}))}},{key:"createTrade",value:function(e,t){return this.workflows.createTrade(e,t).catch((function(e){throw EN(e)}))}},{key:"getToken",value:function(e){return this.tokensApi.getToken(e).then((function(e){return e.data})).catch((function(e){throw EN(e)}))}},{key:"listTokens",value:function(e){return this.tokensApi.listTokens(e).then((function(e){return e.data})).catch((function(e){throw EN(e)}))}},{key:"getTransfer",value:function(e){return this.transfersApi.getTransfer(e).then((function(e){return e.data})).catch((function(e){throw EN(e)}))}},{key:"listTransfers",value:function(e){return this.transfersApi.listTransfers(e).then((function(e){return e.data})).catch((function(e){throw EN(e)}))}},{key:"transfer",value:function(e,t){return this.workflows.transfer(e,t).catch((function(e){throw EN(e)}))}},{key:"batchNftTransfer",value:function(e,t){return this.workflows.batchNftTransfer(e,t).catch((function(e){throw EN(e)}))}},{key:"createExchange",value:function(e){return this.exchangeApi.createExchange(e).catch((function(e){throw EN(e)}))}},{key:"getExchange",value:function(e){return this.exchangeApi.getExchange(e).catch((function(e){throw EN(e)}))}},{key:"getExchanges",value:function(e){return this.exchangeApi.getExchanges(e).catch((function(e){throw EN(e)}))}},{key:"exchangeTransfer",value:function(e,t){return this.workflows.exchangeTransfer(e,t).catch((function(e){throw EN(e)}))}},{key:"createNftPrimary",value:function(e){return this.nftCheckoutPrimaryApi.createNftPrimary(e).catch((function(e){throw EN(e)}))}},{key:"getCurrenciesNFTCheckoutPrimary",value:function(e){return this.nftCheckoutPrimaryApi.getCurrenciesNFTCheckoutPrimary(e).catch((function(e){throw EN(e)}))}},{key:"getNftPrimaryTransaction",value:function(e){return this.nftCheckoutPrimaryApi.getNftPrimaryTransaction(e).catch((function(e){throw EN(e)}))}},{key:"getNftPrimaryTransactions",value:function(e){return this.nftCheckoutPrimaryApi.getNftPrimaryTransactions(e).catch((function(e){throw EN(e)}))}}]),e}();function AN(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function RN(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?AN(Object(n),!0).forEach((function(t){xO(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):AN(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var SN={"x-sdk-version":"imx-core-sdk-ts-".concat("2.0.2")},kN=function(e){var t=e.coreContractAddress,n=e.registrationContractAddress,r=e.chainID,i=e.basePath,a=e.headers,o=e.sdkVersion;if(!i.trim())throw Error("basePath can not be empty");return o&&(SN["x-sdk-version"]=o),a=RN(RN({},a||{}),SN),{apiConfiguration:new ZC({basePath:i,baseOptions:{headers:a}}),ethConfiguration:{coreContractAddress:t,registrationContractAddress:n,chainID:r}}},IN={get PRODUCTION(){return kN({basePath:"https://api.x.immutable.com",chainID:1,coreContractAddress:"0x5FDCCA53617f4d2b9134B29090C87D01058e27e9",registrationContractAddress:"0x72a06bf2a1CE5e39cBA06c0CAb824960B587d64c"})},get SANDBOX(){return kN({basePath:"https://api.sandbox.x.immutable.com",chainID:5,coreContractAddress:"0x7917eDb51ecD6CdB3F9854c3cc593F33de10c623",registrationContractAddress:"0x1C97Ada273C9A52253f463042f29117090Cd7D83"})},createConfig:kN},ON=new rr("08000000 00000010 ffffffff ffffffff b781126d cae7b232 1e66a241 adc64d2f",16);new Im.ec(new Im.curves.PresetCurve({type:"short",prime:null,p:"08000000 00000011 00000000 00000000 00000000 00000000 00000000 00000001",a:"00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000001",b:"06f21413 efbe40de 150e596d 72f7a8c5 609ad26c 15c915c1 f4cdfcb9 9cee9e89",n:ON.toString("hex"),hash:Lu.sha256,gRed:!1,g:["1ef15c18599971b7beced415a40f0c7deacfd9b0d1819e03d723d8bc943cfca","5668060aa49730b7be4801df46ec62de53ecd11abe43a32873000c36e8dc1f"]}));var xN=function(){var e=new rr("1 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000",16);return e.sub(e.mod(ON))};function CN(e,t){return new rr(Lu.sha256().update(Jb(Em(e)+gm(rm(t),2))).digest("hex"),16)}function MN(e){for(var t=xN(),n=CN(e.toString("hex",64),0),r=0;n.gte(t);r++)n=CN(n.toString("hex"),r);return n.umod(ON).toString("hex")}function PN(e){for(var t=xN(),n=CN(e.toString("hex",64),0),r=1;n.gte(t);r++)n=CN(n.toString("hex"),r);return n.umod(ON).toString("hex")}function NN(e){var t=xN();return CN(e.toString("hex",64),0).gte(t)}function BN(e){return DN.apply(this,arguments)}function DN(){return(DN=JO(tx.mark((function e(t){var n,r;return tx.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,n=new TN(IN.PRODUCTION),e.next=4,n.getUser(t);case 4:if(!((r=e.sent).accounts.length>0)){e.next=7;break}return e.abrupt("return",{starkPublicKey:r.accounts[0],accountNotFound:!1});case 7:e.next=14;break;case 9:if(e.prev=9,e.t0=e.catch(0),!(e.t0 instanceof _N&&"account_not_found"==e.t0.code)){e.next=13;break}return e.abrupt("return",{starkPublicKey:"",accountNotFound:!0});case 13:throw e.t0;case 14:case"end":return e.stop()}}),e,null,[[0,9]])})))).apply(this,arguments)}function FN(e,t){var n=qk.hdkey.fromMasterSeed(Buffer.from(e.slice(2),"hex")).derivePath(t).getWallet().getPrivateKey();return new rr(n)}function LN(e,t,n){return UN.apply(this,arguments)}function UN(){return(UN=JO(tx.mark((function e(t,n,r){var i,a,o,s,c,u,f,d;return tx.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=FN(t,n),a=PN(i),NN(i)){e.next=4;break}return e.abrupt("return",a);case 4:return e.next=6,BN(r);case 6:if(void 0!==(o=e.sent)){e.next=9;break}throw new Error("Error fetching stark public key from IMX");case 9:if(!o.accountNotFound){e.next=11;break}return e.abrupt("return",a);case 11:return s=new rr(Em(o.starkPublicKey),16),e.next=14,Ax(a).getAddress();case 14:if(c=e.sent,!s.eq(new rr(Em(c),16))){e.next=17;break}return e.abrupt("return",a);case 17:return u=MN(i),e.next=20,Ax(u).getAddress();case 20:if(c=e.sent,!s.eq(new rr(Em(c),16))){e.next=23;break}return e.abrupt("return",u);case 23:return f=Ex(t,n),d=_x(f),e.next=27,Ax(d).getAddress();case 27:if(c=e.sent,!s.eq(new rr(Em(c),16))){e.next=30;break}return e.abrupt("return",d);case 30:throw new Error("Can not deterministically generate stark private key - please contact support");case 31:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function jN(e){return qN.apply(this,arguments)}function qN(){return(qN=JO(tx.mark((function e(t){var n,r,i,a,o;return tx.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t.getAddress();case 2:return n=e.sent.toLowerCase(),e.next=5,t.signMessage("Only sign this request if you’ve initiated an action with Immutable X.");case 5:return r=e.sent,i=Nr(r).s,a=vx("starkex","immutablex",n,"1"),e.next=10,LN(i,a,n);case 10:return o=e.sent,e.abrupt("return",o.padStart(64,"0"));case 12:case"end":return e.stop()}}),e)})))).apply(this,arguments)}vM.errors.INSUFFICIENT_FUNDS,vM.errors.NONCE_EXPIRED,vM.errors.REPLACEMENT_UNDERPRICED;const zN=({basePath:e,chainID:t,coreContractAddress:n,registrationContractAddress:r})=>IN.createConfig({basePath:e,chainID:t,coreContractAddress:n,registrationContractAddress:r,sdkVersion:"ts-immutable-sdk-0.20.1-alpha.1"}),HN=()=>zN({basePath:"https://api.sandbox.x.immutable.com",chainID:5,coreContractAddress:"0x7917eDb51ecD6CdB3F9854c3cc593F33de10c623",registrationContractAddress:"0x1C97Ada273C9A52253f463042f29117090Cd7D83"});class GN{immutableXConfig;baseConfig;constructor({baseConfig:e,overrides:n}){if(this.baseConfig=e,n)this.immutableXConfig=n.immutableXConfig;else switch(e.environment){case t.SANDBOX:this.immutableXConfig=HN();break;case t.PRODUCTION:this.immutableXConfig=zN({basePath:"https://api.x.immutable.com",chainID:1,coreContractAddress:"0x5FDCCA53617f4d2b9134B29090C87D01058e27e9",registrationContractAddress:"0x72a06bf2a1CE5e39cBA06c0CAb824960B587d64c"});break;default:this.immutableXConfig=HN()}}}class VN{immutableX;depositsApi;mintsApi;ordersApi;tokensApi;tradesApi;transfersApi;exchangeApi;nftCheckoutPrimaryApi;usersApi;withdrawalsApi;balanceApi;assetApi;collectionApi;metadataApi;metadataRefreshesApi;projectsApi;constructor(e){const t=new GN(e);this.immutableX=new TN(t.immutableXConfig),this.depositsApi=this.immutableX.depositsApi,this.mintsApi=this.immutableX.mintsApi,this.ordersApi=this.immutableX.ordersApi,this.tokensApi=this.immutableX.tokensApi,this.tradesApi=this.immutableX.tradesApi,this.transfersApi=this.immutableX.transfersApi,this.exchangeApi=this.immutableX.exchangeApi,this.usersApi=this.immutableX.usersApi,this.withdrawalsApi=this.immutableX.withdrawalsApi,this.balanceApi=this.immutableX.balanceApi,this.assetApi=this.immutableX.assetApi,this.collectionApi=this.immutableX.collectionApi,this.metadataApi=this.immutableX.metadataApi,this.metadataRefreshesApi=this.immutableX.metadataRefreshesApi,this.nftCheckoutPrimaryApi=this.immutableX.nftCheckoutPrimaryApi,this.projectsApi=this.immutableX.projectsApi}getDeposit(e){return this.immutableX.getDeposit(e)}listDeposits(e){return this.immutableX.listDeposits(e)}getUser(e){return this.immutableX.getUser(e)}getAsset(e){return this.immutableX.getAsset(e)}listAssets(e){return this.immutableX.listAssets(e)}createCollection(e,t){return this.immutableX.createCollection(e,t)}getCollection(e){return this.immutableX.getCollection(e)}listCollectionFilters(e){return this.immutableX.listCollectionFilters(e)}listCollections(e){return this.collectionApi.listCollections(e).then((e=>e.data))}updateCollection(e,t,n){return this.immutableX.updateCollection(e,t,n)}addMetadataSchemaToCollection(e,t,n){return this.immutableX.addMetadataSchemaToCollection(e,t,n)}getMetadataSchema(e){return this.immutableX.getMetadataSchema(e)}updateMetadataSchemaByName(e,t,n,r){return this.immutableX.updateMetadataSchemaByName(e,t,n,r)}listMetadataRefreshes(e,t,n,r){return this.immutableX.listMetadataRefreshes(e,t,n,r)}getMetadataRefreshErrors(e,t,n,r){return this.immutableX.getMetadataRefreshErrors(e,t,n,r)}getMetadataRefreshResults(e,t){return this.immutableX.getMetadataRefreshResults(e,t)}createMetadataRefresh(e,t){return this.immutableX.createMetadataRefresh(e,t)}async createProject(e,t){return this.immutableX.createProject(e,t)}async getProject(e,t){return this.immutableX.getProject(e,t)}async getProjects(e,t,n,r,i){return this.immutableX.getProjects(e,t,n,r,i)}getBalance(e){return this.immutableX.getBalance(e)}listBalances(e){return this.immutableX.listBalances(e)}getMint(e){return this.immutableX.getMint(e)}listMints(e){return this.immutableX.listMints(e)}mint(e,t){return this.immutableX.mint(e,t)}listWithdrawals(e){return this.immutableX.listWithdrawals(e)}getWithdrawal(e){return this.immutableX.getWithdrawal(e)}getOrder(e){return this.immutableX.getOrder(e)}listOrders(e){return this.immutableX.listOrders(e)}getTrade(e){return this.immutableX.getTrade(e)}listTrades(e){return this.immutableX.listTrades(e)}getToken(e){return this.immutableX.getToken(e)}listTokens(e){return this.immutableX.listTokens(e)}getTransfer(e){return this.immutableX.getTransfer(e)}listTransfers(e){return this.immutableX.listTransfers(e)}createExchange(e){return this.immutableX.createExchange(e).then((e=>e.data))}getExchange(e){return this.immutableX.getExchange(e).then((e=>e.data))}getExchanges(e){return this.immutableX.getExchanges(e).then((e=>e.data))}exchangeTransfer(e,t){return this.immutableX.exchangeTransfer(e,t)}createNftPrimary(e){return this.immutableX.createNftPrimary(e).then((e=>e.data))}getCurrenciesNFTCheckoutPrimary(e){return this.immutableX.getCurrenciesNFTCheckoutPrimary(e).then((e=>e.data))}getNftPrimaryTransaction(e){return this.immutableX.getNftPrimaryTransaction(e).then((e=>e.data))}getNftPrimaryTransactions(e){return this.immutableX.getNftPrimaryTransactions(e).then((e=>e.data))}}var KN=Object.freeze({__proto__:null,IMXError:_N,ImmutableXClient:VN,imxClientCreateStarkSigner:Ax,imxClientGenerateLegacyStarkPrivateKey:jN});var WN={exports:{}};!function(e,t){e.exports=function(){var e=e||function(e,t){var n;if("undefined"!=typeof window&&window.crypto&&(n=window.crypto),"undefined"!=typeof self&&self.crypto&&(n=self.crypto),"undefined"!=typeof globalThis&&globalThis.crypto&&(n=globalThis.crypto),!n&&"undefined"!=typeof window&&window.msCrypto&&(n=window.msCrypto),!n&&void 0!==Jt&&Jt.crypto&&(n=Jt.crypto),!n)try{n=Dm}catch(e){}var r=function(){if(n){if("function"==typeof n.getRandomValues)try{return n.getRandomValues(new Uint32Array(1))[0]}catch(e){}if("function"==typeof n.randomBytes)try{return n.randomBytes(4).readInt32LE()}catch(e){}}throw new Error("Native crypto module could not be used to get secure random number.")},i=Object.create||function(){function e(){}return function(t){var n;return e.prototype=t,n=new e,e.prototype=null,n}}(),a={},o=a.lib={},s=o.Base={extend:function(e){var t=i(this);return e&&t.mixIn(e),t.hasOwnProperty("init")&&this.init!==t.init||(t.init=function(){t.$super.init.apply(this,arguments)}),t.init.prototype=t,t.$super=this,t},create:function(){var e=this.extend();return e.init.apply(e,arguments),e},init:function(){},mixIn:function(e){for(var t in e)e.hasOwnProperty(t)&&(this[t]=e[t]);e.hasOwnProperty("toString")&&(this.toString=e.toString)},clone:function(){return this.init.prototype.extend(this)}},c=o.WordArray=s.extend({init:function(e,n){e=this.words=e||[],this.sigBytes=n!=t?n:4*e.length},toString:function(e){return(e||f).stringify(this)},concat:function(e){var t=this.words,n=e.words,r=this.sigBytes,i=e.sigBytes;if(this.clamp(),r%4)for(var a=0;a<i;a++){var o=n[a>>>2]>>>24-a%4*8&255;t[r+a>>>2]|=o<<24-(r+a)%4*8}else for(var s=0;s<i;s+=4)t[r+s>>>2]=n[s>>>2];return this.sigBytes+=i,this},clamp:function(){var t=this.words,n=this.sigBytes;t[n>>>2]&=4294967295<<32-n%4*8,t.length=e.ceil(n/4)},clone:function(){var e=s.clone.call(this);return e.words=this.words.slice(0),e},random:function(e){for(var t=[],n=0;n<e;n+=4)t.push(r());return new c.init(t,e)}}),u=a.enc={},f=u.Hex={stringify:function(e){for(var t=e.words,n=e.sigBytes,r=[],i=0;i<n;i++){var a=t[i>>>2]>>>24-i%4*8&255;r.push((a>>>4).toString(16)),r.push((15&a).toString(16))}return r.join("")},parse:function(e){for(var t=e.length,n=[],r=0;r<t;r+=2)n[r>>>3]|=parseInt(e.substr(r,2),16)<<24-r%8*4;return new c.init(n,t/2)}},d=u.Latin1={stringify:function(e){for(var t=e.words,n=e.sigBytes,r=[],i=0;i<n;i++){var a=t[i>>>2]>>>24-i%4*8&255;r.push(String.fromCharCode(a))}return r.join("")},parse:function(e){for(var t=e.length,n=[],r=0;r<t;r++)n[r>>>2]|=(255&e.charCodeAt(r))<<24-r%4*8;return new c.init(n,t)}},l=u.Utf8={stringify:function(e){try{return decodeURIComponent(escape(d.stringify(e)))}catch(e){throw new Error("Malformed UTF-8 data")}},parse:function(e){return d.parse(unescape(encodeURIComponent(e)))}},p=o.BufferedBlockAlgorithm=s.extend({reset:function(){this._data=new c.init,this._nDataBytes=0},_append:function(e){"string"==typeof e&&(e=l.parse(e)),this._data.concat(e),this._nDataBytes+=e.sigBytes},_process:function(t){var n,r=this._data,i=r.words,a=r.sigBytes,o=this.blockSize,s=a/(4*o),u=(s=t?e.ceil(s):e.max((0|s)-this._minBufferSize,0))*o,f=e.min(4*u,a);if(u){for(var d=0;d<u;d+=o)this._doProcessBlock(i,d);n=i.splice(0,u),r.sigBytes-=f}return new c.init(n,f)},clone:function(){var e=s.clone.call(this);return e._data=this._data.clone(),e},_minBufferSize:0});o.Hasher=p.extend({cfg:s.extend(),init:function(e){this.cfg=this.cfg.extend(e),this.reset()},reset:function(){p.reset.call(this),this._doReset()},update:function(e){return this._append(e),this._process(),this},finalize:function(e){return e&&this._append(e),this._doFinalize()},blockSize:16,_createHelper:function(e){return function(t,n){return new e.init(n).finalize(t)}},_createHmacHelper:function(e){return function(t,n){return new h.HMAC.init(e,n).finalize(t)}}});var h=a.algo={};return a}(Math);return e}()}(WN);var XN=WN.exports,$N=Yt(XN),JN={exports:{}};!function(e,t){e.exports=function(e){return function(t){var n=e,r=n.lib,i=r.WordArray,a=r.Hasher,o=n.algo,s=[],c=[];!function(){function e(e){for(var n=t.sqrt(e),r=2;r<=n;r++)if(!(e%r))return!1;return!0}function n(e){return 4294967296*(e-(0|e))|0}for(var r=2,i=0;i<64;)e(r)&&(i<8&&(s[i]=n(t.pow(r,.5))),c[i]=n(t.pow(r,1/3)),i++),r++}();var u=[],f=o.SHA256=a.extend({_doReset:function(){this._hash=new i.init(s.slice(0))},_doProcessBlock:function(e,t){for(var n=this._hash.words,r=n[0],i=n[1],a=n[2],o=n[3],s=n[4],f=n[5],d=n[6],l=n[7],p=0;p<64;p++){if(p<16)u[p]=0|e[t+p];else{var h=u[p-15],b=(h<<25|h>>>7)^(h<<14|h>>>18)^h>>>3,m=u[p-2],y=(m<<15|m>>>17)^(m<<13|m>>>19)^m>>>10;u[p]=b+u[p-7]+y+u[p-16]}var g=r&i^r&a^i&a,v=(r<<30|r>>>2)^(r<<19|r>>>13)^(r<<10|r>>>22),w=l+((s<<26|s>>>6)^(s<<21|s>>>11)^(s<<7|s>>>25))+(s&f^~s&d)+c[p]+u[p];l=d,d=f,f=s,s=o+w|0,o=a,a=i,i=r,r=w+(v+g)|0}n[0]=n[0]+r|0,n[1]=n[1]+i|0,n[2]=n[2]+a|0,n[3]=n[3]+o|0,n[4]=n[4]+s|0,n[5]=n[5]+f|0,n[6]=n[6]+d|0,n[7]=n[7]+l|0},_doFinalize:function(){var e=this._data,n=e.words,r=8*this._nDataBytes,i=8*e.sigBytes;return n[i>>>5]|=128<<24-i%32,n[14+(i+64>>>9<<4)]=t.floor(r/4294967296),n[15+(i+64>>>9<<4)]=r,e.sigBytes=4*n.length,this._process(),this._hash},clone:function(){var e=a.clone.call(this);return e._hash=this._hash.clone(),e}});n.SHA256=a._createHelper(f),n.HmacSHA256=a._createHmacHelper(f)}(Math),e.SHA256}(XN)}(JN);var YN=Yt(JN.exports),QN={exports:{}};!function(e,t){e.exports=function(e){return function(){var t=e,n=t.lib.WordArray;function r(e,t,r){for(var i=[],a=0,o=0;o<t;o++)if(o%4){var s=r[e.charCodeAt(o-1)]<<o%4*2|r[e.charCodeAt(o)]>>>6-o%4*2;i[a>>>2]|=s<<24-a%4*8,a++}return n.create(i,a)}t.enc.Base64={stringify:function(e){var t=e.words,n=e.sigBytes,r=this._map;e.clamp();for(var i=[],a=0;a<n;a+=3)for(var o=(t[a>>>2]>>>24-a%4*8&255)<<16|(t[a+1>>>2]>>>24-(a+1)%4*8&255)<<8|t[a+2>>>2]>>>24-(a+2)%4*8&255,s=0;s<4&&a+.75*s<n;s++)i.push(r.charAt(o>>>6*(3-s)&63));var c=r.charAt(64);if(c)for(;i.length%4;)i.push(c);return i.join("")},parse:function(e){var t=e.length,n=this._map,i=this._reverseMap;if(!i){i=this._reverseMap=[];for(var a=0;a<n.length;a++)i[n.charCodeAt(a)]=a}var o=n.charAt(64);if(o){var s=e.indexOf(o);-1!==s&&(t=s)}return r(e,t,i)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="}}(),e.enc.Base64}(XN)}(QN);var ZN=Yt(QN.exports),eB={exports:{}};!function(e,t){e.exports=function(e){return e.enc.Utf8}(XN)}(eB);var tB=Yt(eB.exports);function nB(e){this.message=e}nB.prototype=new Error,nB.prototype.name="InvalidCharacterError";var rB="undefined"!=typeof window&&window.atob&&window.atob.bind(window)||function(e){var t=String(e).replace(/=+$/,"");if(t.length%4==1)throw new nB("'atob' failed: The string to be decoded is not correctly encoded.");for(var n,r,i=0,a=0,o="";r=t.charAt(a++);~r&&(n=i%4?64*n+r:r,i++%4)?o+=String.fromCharCode(255&n>>(-2*i&6)):0)r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(r);return o};function iB(e){this.message=e}function aB(e,t){if("string"!=typeof e)throw new iB("Invalid token specified");var n=!0===(t=t||{}).header?0:1;try{return JSON.parse(function(e){var t=e.replace(/-/g,"+").replace(/_/g,"/");switch(t.length%4){case 0:break;case 2:t+="==";break;case 3:t+="=";break;default:throw"Illegal base64url string!"}try{return function(e){return decodeURIComponent(rB(e).replace(/(.)/g,(function(e,t){var n=t.charCodeAt(0).toString(16).toUpperCase();return n.length<2&&(n="0"+n),"%"+n})))}(t)}catch(e){return rB(t)}}(e.split(".")[n]))}catch(e){throw new iB("Invalid token specified: "+e.message)}}iB.prototype=new Error,iB.prototype.name="InvalidTokenError";var oB,sB,cB,uB={debug:()=>{},info:()=>{},warn:()=>{},error:()=>{}},fB=(e=>(e[e.NONE=0]="NONE",e[e.ERROR=1]="ERROR",e[e.WARN=2]="WARN",e[e.INFO=3]="INFO",e[e.DEBUG=4]="DEBUG",e))(fB||{});(cB=fB||(fB={})).reset=function(){oB=3,sB=uB},cB.setLevel=function(e){if(!(0<=e&&e<=4))throw new Error("Invalid log level");oB=e},cB.setLogger=function(e){sB=e};var dB=class{constructor(e){this._name=e}debug(...e){oB>=4&&sB.debug(dB._format(this._name,this._method),...e)}info(...e){oB>=3&&sB.info(dB._format(this._name,this._method),...e)}warn(...e){oB>=2&&sB.warn(dB._format(this._name,this._method),...e)}error(...e){oB>=1&&sB.error(dB._format(this._name,this._method),...e)}throw(e){throw this.error(e),e}create(e){const t=Object.create(this);return t._method=e,t.debug("begin"),t}static createStatic(e,t){const n=new dB(`${e}.${t}`);return n.debug("begin"),n}static _format(e,t){const n=`[${e}]`;return t?`${n} ${t}:`:n}static debug(e,...t){oB>=4&&sB.debug(dB._format(e),...t)}static info(e,...t){oB>=3&&sB.info(dB._format(e),...t)}static warn(e,...t){oB>=2&&sB.warn(dB._format(e),...t)}static error(e,...t){oB>=1&&sB.error(dB._format(e),...t)}};fB.reset();var lB=class{static _randomWord(){return $N.lib.WordArray.random(1).words[0]}static generateUUIDv4(){const e="10000000-1000-4000-8000-100000000000".replace(/[018]/g,(e=>(+e^lB._randomWord()&15>>+e/4).toString(16)));return e.replace(/-/g,"")}static generateCodeVerifier(){return lB.generateUUIDv4()+lB.generateUUIDv4()+lB.generateUUIDv4()}static generateCodeChallenge(e){try{const t=YN(e);return ZN.stringify(t).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}catch(e){throw dB.error("CryptoUtils.generateCodeChallenge",e),e}}static generateBasicAuth(e,t){const n=tB.parse([e,t].join(":"));return ZN.stringify(n)}},pB=class{constructor(e){this._name=e,this._logger=new dB(`Event('${this._name}')`),this._callbacks=[]}addHandler(e){return this._callbacks.push(e),()=>this.removeHandler(e)}removeHandler(e){const t=this._callbacks.lastIndexOf(e);t>=0&&this._callbacks.splice(t,1)}raise(...e){this._logger.debug("raise:",...e);for(const t of this._callbacks)t(...e)}},hB=class{static decode(e){try{return aB(e)}catch(e){throw dB.error("JwtUtils.decode",e),e}}},bB=class{static center({...e}){var t;return null==e.width&&(e.width=null!=(t=[800,720,600,480].find((e=>e<=window.outerWidth/1.618)))?t:360),null!=e.left||(e.left=Math.max(0,Math.round(window.screenX+(window.outerWidth-e.width)/2))),null!=e.height&&(null!=e.top||(e.top=Math.max(0,Math.round(window.screenY+(window.outerHeight-e.height)/2)))),e}static serialize(e){return Object.entries(e).filter((([,e])=>null!=e)).map((([e,t])=>`${e}=${"boolean"!=typeof t?t:t?"yes":"no"}`)).join(",")}},mB=class extends pB{constructor(){super(...arguments),this._logger=new dB(`Timer('${this._name}')`),this._timerHandle=null,this._expiration=0,this._callback=()=>{const e=this._expiration-mB.getEpochTime();this._logger.debug("timer completes in",e),this._expiration<=mB.getEpochTime()&&(this.cancel(),super.raise())}}static getEpochTime(){return Math.floor(Date.now()/1e3)}init(e){const t=this._logger.create("init");e=Math.max(Math.floor(e),1);const n=mB.getEpochTime()+e;if(this.expiration===n&&this._timerHandle)return void t.debug("skipping since already initialized for expiration at",this.expiration);this.cancel(),t.debug("using duration",e),this._expiration=n;const r=Math.min(e,5);this._timerHandle=setInterval(this._callback,1e3*r)}get expiration(){return this._expiration}cancel(){this._logger.create("cancel"),this._timerHandle&&(clearInterval(this._timerHandle),this._timerHandle=null)}},yB=class{static readParams(e,t="query"){if(!e)throw new TypeError("Invalid URL");const n=new URL(e,"http://127.0.0.1")["fragment"===t?"hash":"search"];return new URLSearchParams(n.slice(1))}},gB=class extends Error{constructor(e,t){var n,r,i;if(super(e.error_description||e.error||""),this.form=t,this.name="ErrorResponse",!e.error)throw dB.error("ErrorResponse","No error passed"),new Error("No error passed");this.error=e.error,this.error_description=null!=(n=e.error_description)?n:null,this.error_uri=null!=(r=e.error_uri)?r:null,this.state=e.userState,this.session_state=null!=(i=e.session_state)?i:null}},vB=class extends Error{constructor(e){super(e),this.name="ErrorTimeout"}},wB=class{constructor(e){this._logger=new dB("AccessTokenEvents"),this._expiringTimer=new mB("Access token expiring"),this._expiredTimer=new mB("Access token expired"),this._expiringNotificationTimeInSeconds=e.expiringNotificationTimeInSeconds}load(e){const t=this._logger.create("load");if(e.access_token&&void 0!==e.expires_in){const n=e.expires_in;if(t.debug("access token present, remaining duration:",n),n>0){let e=n-this._expiringNotificationTimeInSeconds;e<=0&&(e=1),t.debug("registering expiring timer, raising in",e,"seconds"),this._expiringTimer.init(e)}else t.debug("canceling existing expiring timer because we're past expiration."),this._expiringTimer.cancel();const r=n+1;t.debug("registering expired timer, raising in",r,"seconds"),this._expiredTimer.init(r)}else this._expiringTimer.cancel(),this._expiredTimer.cancel()}unload(){this._logger.debug("unload: canceling existing access token timers"),this._expiringTimer.cancel(),this._expiredTimer.cancel()}addAccessTokenExpiring(e){return this._expiringTimer.addHandler(e)}removeAccessTokenExpiring(e){this._expiringTimer.removeHandler(e)}addAccessTokenExpired(e){return this._expiredTimer.addHandler(e)}removeAccessTokenExpired(e){this._expiredTimer.removeHandler(e)}},_B=class{constructor(){this._logger=new dB("InMemoryWebStorage"),this._data={}}clear(){this._logger.create("clear"),this._data={}}getItem(e){return this._logger.create(`getItem('${e}')`),this._data[e]}setItem(e,t){this._logger.create(`setItem('${e}')`),this._data[e]=t}removeItem(e){this._logger.create(`removeItem('${e}')`),delete this._data[e]}get length(){return Object.getOwnPropertyNames(this._data).length}key(e){return Object.getOwnPropertyNames(this._data)[e]}},EB=class{constructor(e=[],t=null,n={}){this._jwtHandler=t,this._extraHeaders=n,this._logger=new dB("JsonService"),this._contentTypes=[],this._contentTypes.push(...e,"application/json"),t&&this._contentTypes.push("application/jwt")}async fetchWithTimeout(e,t={}){const{timeoutInSeconds:n,...r}=t;if(!n)return await fetch(e,r);const i=new AbortController,a=setTimeout((()=>i.abort()),1e3*n);try{return await fetch(e,{...t,signal:i.signal})}catch(e){if(e instanceof DOMException&&"AbortError"===e.name)throw new vB("Network timed out");throw e}finally{clearTimeout(a)}}async getJson(e,{token:t,credentials:n}={}){const r=this._logger.create("getJson"),i={Accept:this._contentTypes.join(", ")};let a;t&&(r.debug("token passed, setting Authorization header"),i.Authorization="Bearer "+t),this.appendExtraHeaders(i);try{r.debug("url:",e),a=await this.fetchWithTimeout(e,{method:"GET",headers:i,credentials:n})}catch(e){throw r.error("Network Error"),e}r.debug("HTTP response received, status",a.status);const o=a.headers.get("Content-Type");if(o&&!this._contentTypes.find((e=>o.startsWith(e)))&&r.throw(new Error(`Invalid response Content-Type: ${null!=o?o:"undefined"}, from URL: ${e}`)),a.ok&&this._jwtHandler&&(null==o?void 0:o.startsWith("application/jwt")))return await this._jwtHandler(await a.text());let s;try{s=await a.json()}catch(e){if(r.error("Error parsing JSON response",e),a.ok)throw e;throw new Error(`${a.statusText} (${a.status})`)}if(!a.ok){if(r.error("Error from server:",s),s.error)throw new gB(s);throw new Error(`${a.statusText} (${a.status}): ${JSON.stringify(s)}`)}return s}async postForm(e,{body:t,basicAuth:n,timeoutInSeconds:r,initCredentials:i}){const a=this._logger.create("postForm"),o={Accept:this._contentTypes.join(", "),"Content-Type":"application/x-www-form-urlencoded"};let s;void 0!==n&&(o.Authorization="Basic "+n),this.appendExtraHeaders(o);try{a.debug("url:",e),s=await this.fetchWithTimeout(e,{method:"POST",headers:o,body:t,timeoutInSeconds:r,credentials:i})}catch(e){throw a.error("Network error"),e}a.debug("HTTP response received, status",s.status);const c=s.headers.get("Content-Type");if(c&&!this._contentTypes.find((e=>c.startsWith(e))))throw new Error(`Invalid response Content-Type: ${null!=c?c:"undefined"}, from URL: ${e}`);const u=await s.text();let f={};if(u)try{f=JSON.parse(u)}catch(e){if(a.error("Error parsing JSON response",e),s.ok)throw e;throw new Error(`${s.statusText} (${s.status})`)}if(!s.ok){if(a.error("Error from server:",f),f.error)throw new gB(f,t);throw new Error(`${s.statusText} (${s.status}): ${JSON.stringify(f)}`)}return f}appendExtraHeaders(e){const t=this._logger.create("appendExtraHeaders"),n=Object.keys(this._extraHeaders),r=["authorization","accept","content-type"];0!==n.length&&n.forEach((n=>{if(r.includes(n.toLocaleLowerCase()))return void t.warn("Protected header could not be overridden",n,r);const i="function"==typeof this._extraHeaders[n]?this._extraHeaders[n]():this._extraHeaders[n];i&&""!==i&&(e[n]=i)}))}},TB=class{constructor({prefix:e="oidc.",store:t=localStorage}={}){this._logger=new dB("WebStorageStateStore"),this._store=t,this._prefix=e}async set(e,t){this._logger.create(`set('${e}')`),e=this._prefix+e,await this._store.setItem(e,t)}async get(e){this._logger.create(`get('${e}')`),e=this._prefix+e;return await this._store.getItem(e)}async remove(e){this._logger.create(`remove('${e}')`),e=this._prefix+e;const t=await this._store.getItem(e);return await this._store.removeItem(e),t}async getAllKeys(){this._logger.create("getAllKeys");const e=await this._store.length,t=[];for(let n=0;n<e;n++){const e=await this._store.key(n);e&&0===e.indexOf(this._prefix)&&t.push(e.substr(this._prefix.length))}return t}},AB=class{constructor({authority:e,metadataUrl:t,metadata:n,signingKeys:r,metadataSeed:i,client_id:a,client_secret:o,response_type:s="code",scope:c="openid",redirect_uri:u,post_logout_redirect_uri:f,client_authentication:d="client_secret_post",prompt:l,display:p,max_age:h,ui_locales:b,acr_values:m,resource:y,response_mode:g="query",filterProtocolClaims:v=!0,loadUserInfo:w=!1,staleStateAgeInSeconds:_=900,clockSkewInSeconds:E=300,userInfoJwtIssuer:T="OP",mergeClaims:A=!1,disablePKCE:R=!1,stateStore:S,refreshTokenCredentials:k,revokeTokenAdditionalContentTypes:I,fetchRequestCredentials:O,refreshTokenAllowedScope:x,extraQueryParams:C={},extraTokenParams:M={},extraHeaders:P={}}){if(this.authority=e,t?this.metadataUrl=t:(this.metadataUrl=e,e&&(this.metadataUrl.endsWith("/")||(this.metadataUrl+="/"),this.metadataUrl+=".well-known/openid-configuration")),this.metadata=n,this.metadataSeed=i,this.signingKeys=r,this.client_id=a,this.client_secret=o,this.response_type=s,this.scope=c,this.redirect_uri=u,this.post_logout_redirect_uri=f,this.client_authentication=d,this.prompt=l,this.display=p,this.max_age=h,this.ui_locales=b,this.acr_values=m,this.resource=y,this.response_mode=g,this.filterProtocolClaims=null==v||v,this.loadUserInfo=!!w,this.staleStateAgeInSeconds=_,this.clockSkewInSeconds=E,this.userInfoJwtIssuer=T,this.mergeClaims=!!A,this.disablePKCE=!!R,this.revokeTokenAdditionalContentTypes=I,O&&k&&console.warn("Both fetchRequestCredentials and refreshTokenCredentials is set. Only fetchRequestCredentials will be used."),this.fetchRequestCredentials=O||(k||"same-origin"),S)this.stateStore=S;else{const e="undefined"!=typeof window?window.localStorage:new _B;this.stateStore=new TB({store:e})}this.refreshTokenAllowedScope=x,this.extraQueryParams=C,this.extraTokenParams=M,this.extraHeaders=P}},RB=class{constructor(e,t){this._settings=e,this._metadataService=t,this._logger=new dB("TokenClient"),this._jsonService=new EB(this._settings.revokeTokenAdditionalContentTypes,null,this._settings.extraHeaders)}async exchangeCode({grant_type:e="authorization_code",redirect_uri:t=this._settings.redirect_uri,client_id:n=this._settings.client_id,client_secret:r=this._settings.client_secret,...i}){const a=this._logger.create("exchangeCode");n||a.throw(new Error("A client_id is required")),t||a.throw(new Error("A redirect_uri is required")),i.code||a.throw(new Error("A code is required"));const o=new URLSearchParams({grant_type:e,redirect_uri:t});for(const[e,t]of Object.entries(i))null!=t&&o.set(e,t);let s;switch(this._settings.client_authentication){case"client_secret_basic":if(!r)throw a.throw(new Error("A client_secret is required")),null;s=lB.generateBasicAuth(n,r);break;case"client_secret_post":o.append("client_id",n),r&&o.append("client_secret",r)}const c=await this._metadataService.getTokenEndpoint(!1);a.debug("got token endpoint");const u=await this._jsonService.postForm(c,{body:o,basicAuth:s,initCredentials:this._settings.fetchRequestCredentials});return a.debug("got response"),u}async exchangeCredentials({grant_type:e="password",client_id:t=this._settings.client_id,client_secret:n=this._settings.client_secret,scope:r=this._settings.scope,...i}){const a=this._logger.create("exchangeCredentials");t||a.throw(new Error("A client_id is required"));const o=new URLSearchParams({grant_type:e,scope:r});for(const[e,t]of Object.entries(i))null!=t&&o.set(e,t);let s;switch(this._settings.client_authentication){case"client_secret_basic":if(!n)throw a.throw(new Error("A client_secret is required")),null;s=lB.generateBasicAuth(t,n);break;case"client_secret_post":o.append("client_id",t),n&&o.append("client_secret",n)}const c=await this._metadataService.getTokenEndpoint(!1);a.debug("got token endpoint");const u=await this._jsonService.postForm(c,{body:o,basicAuth:s,initCredentials:this._settings.fetchRequestCredentials});return a.debug("got response"),u}async exchangeRefreshToken({grant_type:e="refresh_token",client_id:t=this._settings.client_id,client_secret:n=this._settings.client_secret,timeoutInSeconds:r,...i}){const a=this._logger.create("exchangeRefreshToken");t||a.throw(new Error("A client_id is required")),i.refresh_token||a.throw(new Error("A refresh_token is required"));const o=new URLSearchParams({grant_type:e});for(const[e,t]of Object.entries(i))null!=t&&o.set(e,t);let s;switch(this._settings.client_authentication){case"client_secret_basic":if(!n)throw a.throw(new Error("A client_secret is required")),null;s=lB.generateBasicAuth(t,n);break;case"client_secret_post":o.append("client_id",t),n&&o.append("client_secret",n)}const c=await this._metadataService.getTokenEndpoint(!1);a.debug("got token endpoint");const u=await this._jsonService.postForm(c,{body:o,basicAuth:s,timeoutInSeconds:r,initCredentials:this._settings.fetchRequestCredentials});return a.debug("got response"),u}async revoke(e){var t;const n=this._logger.create("revoke");e.token||n.throw(new Error("A token is required"));const r=await this._metadataService.getRevocationEndpoint(!1);n.debug(`got revocation endpoint, revoking ${null!=(t=e.token_type_hint)?t:"default token type"}`);const i=new URLSearchParams;for(const[t,n]of Object.entries(e))null!=n&&i.set(t,n);i.set("client_id",this._settings.client_id),this._settings.client_secret&&i.set("client_secret",this._settings.client_secret),await this._jsonService.postForm(r,{body:i}),n.debug("got response")}},SB=class{constructor(e){this.id=e.id||lB.generateUUIDv4(),this.data=e.data,e.created&&e.created>0?this.created=e.created:this.created=mB.getEpochTime(),this.request_type=e.request_type}toStorageString(){return new dB("State").create("toStorageString"),JSON.stringify({id:this.id,data:this.data,created:this.created,request_type:this.request_type})}static fromStorageString(e){return dB.createStatic("State","fromStorageString"),new SB(JSON.parse(e))}static async clearStaleState(e,t){const n=dB.createStatic("State","clearStaleState"),r=mB.getEpochTime()-t,i=await e.getAllKeys();n.debug("got keys",i);for(let t=0;t<i.length;t++){const a=i[t],o=await e.get(a);let s=!1;if(o)try{const e=SB.fromStorageString(o);n.debug("got item from key:",a,e.created),e.created<=r&&(s=!0)}catch(e){n.error("Error parsing state for key:",a,e),s=!0}else n.debug("no item in storage for key:",a),s=!0;s&&(n.debug("removed item for key:",a),e.remove(a))}}},kB=class extends SB{constructor(e){super(e),!0===e.code_verifier?this.code_verifier=lB.generateCodeVerifier():e.code_verifier&&(this.code_verifier=e.code_verifier),this.code_verifier&&(this.code_challenge=lB.generateCodeChallenge(this.code_verifier)),this.authority=e.authority,this.client_id=e.client_id,this.redirect_uri=e.redirect_uri,this.scope=e.scope,this.client_secret=e.client_secret,this.extraTokenParams=e.extraTokenParams,this.response_mode=e.response_mode,this.skipUserInfo=e.skipUserInfo}toStorageString(){return new dB("SigninState").create("toStorageString"),JSON.stringify({id:this.id,data:this.data,created:this.created,request_type:this.request_type,code_verifier:this.code_verifier,authority:this.authority,client_id:this.client_id,redirect_uri:this.redirect_uri,scope:this.scope,client_secret:this.client_secret,extraTokenParams:this.extraTokenParams,response_mode:this.response_mode,skipUserInfo:this.skipUserInfo})}static fromStorageString(e){dB.createStatic("SigninState","fromStorageString");const t=JSON.parse(e);return new kB(t)}},IB=class{constructor(e){this.access_token="",this.token_type="",this.profile={},this.state=e.get("state"),this.session_state=e.get("session_state"),this.error=e.get("error"),this.error_description=e.get("error_description"),this.error_uri=e.get("error_uri"),this.code=e.get("code")}get expires_in(){if(void 0!==this.expires_at)return this.expires_at-mB.getEpochTime()}set expires_in(e){"string"==typeof e&&(e=Number(e)),void 0!==e&&e>=0&&(this.expires_at=Math.floor(e)+mB.getEpochTime())}get isOpenId(){var e;return(null==(e=this.scope)?void 0:e.split(" ").includes("openid"))||!!this.id_token}},OB=["nbf","jti","auth_time","nonce","acr","amr","azp","at_hash"],xB=["sub","iss","aud","exp","iat"],CB=class{constructor(e){var t;this.id_token=e.id_token,this.session_state=null!=(t=e.session_state)?t:null,this.access_token=e.access_token,this.refresh_token=e.refresh_token,this.token_type=e.token_type,this.scope=e.scope,this.profile=e.profile,this.expires_at=e.expires_at,this.state=e.userState}get expires_in(){if(void 0!==this.expires_at)return this.expires_at-mB.getEpochTime()}set expires_in(e){void 0!==e&&(this.expires_at=Math.floor(e)+mB.getEpochTime())}get expired(){const e=this.expires_in;if(void 0!==e)return e<=0}get scopes(){var e,t;return null!=(t=null==(e=this.scope)?void 0:e.split(" "))?t:[]}toStorageString(){return new dB("User").create("toStorageString"),JSON.stringify({id_token:this.id_token,session_state:this.session_state,access_token:this.access_token,refresh_token:this.refresh_token,token_type:this.token_type,scope:this.scope,profile:this.profile,expires_at:this.expires_at})}static fromStorageString(e){return dB.createStatic("User","fromStorageString"),new CB(JSON.parse(e))}},MB="oidc-client",PB=class{constructor(){this._abort=new pB("Window navigation aborted"),this._disposeHandlers=new Set,this._window=null}async navigate(e){const t=this._logger.create("navigate");if(!this._window)throw new Error("Attempted to navigate on a disposed window");t.debug("setting URL in window"),this._window.location.replace(e.url);const{url:n,keepOpen:r}=await new Promise(((n,r)=>{const i=i=>{var a;const o=i.data,s=null!=(a=e.scriptOrigin)?a:window.location.origin;if(i.origin===s&&(null==o?void 0:o.source)===MB){try{const n=yB.readParams(o.url,e.response_mode).get("state");if(n||t.warn("no state found in response url"),i.source!==this._window&&n!==e.state)return}catch(e){this._dispose(),r(new Error("Invalid response from window"))}n(o)}};window.addEventListener("message",i,!1),this._disposeHandlers.add((()=>window.removeEventListener("message",i,!1))),this._disposeHandlers.add(this._abort.addHandler((e=>{this._dispose(),r(e)})))}));return t.debug("got response from window"),this._dispose(),r||this.close(),{url:n}}_dispose(){this._logger.create("_dispose");for(const e of this._disposeHandlers)e();this._disposeHandlers.clear()}static _notifyParent(e,t,n=!1,r=window.location.origin){e.postMessage({source:MB,url:t,keepOpen:n},r)}},NB={location:!1,toolbar:!1,height:640},BB="_blank",DB=60,FB=2,LB=10,UB=class extends AB{constructor(e){const{popup_redirect_uri:t=e.redirect_uri,popup_post_logout_redirect_uri:n=e.post_logout_redirect_uri,popupWindowFeatures:r=NB,popupWindowTarget:i=BB,redirectMethod:a="assign",redirectTarget:o="self",iframeNotifyParentOrigin:s=e.iframeNotifyParentOrigin,iframeScriptOrigin:c=e.iframeScriptOrigin,silent_redirect_uri:u=e.redirect_uri,silentRequestTimeoutInSeconds:f=LB,automaticSilentRenew:d=!0,validateSubOnSilentRenew:l=!0,includeIdTokenInSilentRenew:p=!1,monitorSession:h=!1,monitorAnonymousSession:b=!1,checkSessionIntervalInSeconds:m=FB,query_status_response_type:y="code",stopCheckSessionOnError:g=!0,revokeTokenTypes:v=["access_token","refresh_token"],revokeTokensOnSignout:w=!1,includeIdTokenInSilentSignout:_=!1,accessTokenExpiringNotificationTimeInSeconds:E=DB,userStore:T}=e;if(super(e),this.popup_redirect_uri=t,this.popup_post_logout_redirect_uri=n,this.popupWindowFeatures=r,this.popupWindowTarget=i,this.redirectMethod=a,this.redirectTarget=o,this.iframeNotifyParentOrigin=s,this.iframeScriptOrigin=c,this.silent_redirect_uri=u,this.silentRequestTimeoutInSeconds=f,this.automaticSilentRenew=d,this.validateSubOnSilentRenew=l,this.includeIdTokenInSilentRenew=p,this.monitorSession=h,this.monitorAnonymousSession=b,this.checkSessionIntervalInSeconds=m,this.stopCheckSessionOnError=g,this.query_status_response_type=y,this.revokeTokenTypes=v,this.revokeTokensOnSignout=w,this.includeIdTokenInSilentSignout=_,this.accessTokenExpiringNotificationTimeInSeconds=E,T)this.userStore=T;else{const e="undefined"!=typeof window?window.sessionStorage:new _B;this.userStore=new TB({store:e})}}},jB=class extends PB{constructor({silentRequestTimeoutInSeconds:e=LB}){super(),this._logger=new dB("IFrameWindow"),this._timeoutInSeconds=e,this._frame=jB.createHiddenIframe(),this._window=this._frame.contentWindow}static createHiddenIframe(){const e=window.document.createElement("iframe");return e.style.visibility="hidden",e.style.position="fixed",e.style.left="-1000px",e.style.top="0",e.width="0",e.height="0",e.setAttribute("sandbox","allow-scripts allow-same-origin allow-forms"),window.document.body.appendChild(e),e}async navigate(e){this._logger.debug("navigate: Using timeout of:",this._timeoutInSeconds);const t=setTimeout((()=>this._abort.raise(new vB("IFrame timed out without a response"))),1e3*this._timeoutInSeconds);return this._disposeHandlers.add((()=>clearTimeout(t))),await super.navigate(e)}close(){var e;this._frame&&(this._frame.parentNode&&(this._frame.addEventListener("load",(e=>{var t;const n=e.target;null==(t=n.parentNode)||t.removeChild(n),this._abort.raise(new Error("IFrame removed from DOM"))}),!0),null==(e=this._frame.contentWindow)||e.location.replace("about:blank")),this._frame=null),this._window=null}static notifyParent(e,t){return super._notifyParent(window.parent,e,!1,t)}},qB=class extends PB{constructor({popupWindowTarget:e=BB,popupWindowFeatures:t={}}){super(),this._logger=new dB("PopupWindow");const n=bB.center({...NB,...t});this._window=window.open(void 0,e,bB.serialize(n))}async navigate(e){var t;null==(t=this._window)||t.focus();const n=setInterval((()=>{this._window&&!this._window.closed||this._abort.raise(new Error("Popup closed by user"))}),500);return this._disposeHandlers.add((()=>clearInterval(n))),await super.navigate(e)}close(){this._window&&(this._window.closed||(this._window.close(),this._abort.raise(new Error("Popup closed")))),this._window=null}static notifyOpener(e,t){if(!window.opener)throw new Error("No window.opener. Can't complete notification.");return super._notifyParent(window.opener,e,t)}},zB=class extends wB{constructor(e){super({expiringNotificationTimeInSeconds:e.accessTokenExpiringNotificationTimeInSeconds}),this._logger=new dB("UserManagerEvents"),this._userLoaded=new pB("User loaded"),this._userUnloaded=new pB("User unloaded"),this._silentRenewError=new pB("Silent renew error"),this._userSignedIn=new pB("User signed in"),this._userSignedOut=new pB("User signed out"),this._userSessionChanged=new pB("User session changed")}load(e,t=!0){super.load(e),t&&this._userLoaded.raise(e)}unload(){super.unload(),this._userUnloaded.raise()}addUserLoaded(e){return this._userLoaded.addHandler(e)}removeUserLoaded(e){return this._userLoaded.removeHandler(e)}addUserUnloaded(e){return this._userUnloaded.addHandler(e)}removeUserUnloaded(e){return this._userUnloaded.removeHandler(e)}addSilentRenewError(e){return this._silentRenewError.addHandler(e)}removeSilentRenewError(e){return this._silentRenewError.removeHandler(e)}_raiseSilentRenewError(e){this._silentRenewError.raise(e)}addUserSignedIn(e){return this._userSignedIn.addHandler(e)}removeUserSignedIn(e){this._userSignedIn.removeHandler(e)}_raiseUserSignedIn(){this._userSignedIn.raise()}addUserSignedOut(e){return this._userSignedOut.addHandler(e)}removeUserSignedOut(e){this._userSignedOut.removeHandler(e)}_raiseUserSignedOut(){this._userSignedOut.raise()}addUserSessionChanged(e){return this._userSessionChanged.addHandler(e)}removeUserSessionChanged(e){this._userSessionChanged.removeHandler(e)}_raiseUserSessionChanged(){this._userSessionChanged.raise()}},HB=(e=>(e.MissingApiKey="MISSING_API_KEY",e.ModalNotReady="MODAL_NOT_READY",e.MalformedResponse="MALFORMED_RESPONSE",e.InvalidArgument="INVALID_ARGUMENT",e.ExtensionNotInitialized="EXTENSION_NOT_INITIALIZED",e.IncompatibleExtensions="INCOMPATIBLE_EXTENSIONS",e))(HB||{}),GB=(e=>(e.SyncWeb3Method="SYNC_WEB3_METHOD",e.DuplicateIframe="DUPLICATE_IFRAME",e.ReactNativeEndpointConfiguration="REACT_NATIVE_ENDPOINT_CONFIGURATION",e.DeprecationNotice="DEPRECATION_NOTICE",e))(GB||{}),VB=(e=>(e[e.ParseError=-32700]="ParseError",e[e.InvalidRequest=-32600]="InvalidRequest",e[e.MethodNotFound=-32601]="MethodNotFound",e[e.InvalidParams=-32602]="InvalidParams",e[e.InternalError=-32603]="InternalError",e[e.MagicLinkFailedVerification=-1e4]="MagicLinkFailedVerification",e[e.MagicLinkExpired=-10001]="MagicLinkExpired",e[e.MagicLinkRateLimited=-10002]="MagicLinkRateLimited",e[e.MagicLinkInvalidRedirectURL=-10006]="MagicLinkInvalidRedirectURL",e[e.UserAlreadyLoggedIn=-10003]="UserAlreadyLoggedIn",e[e.UpdateEmailFailed=-10004]="UpdateEmailFailed",e[e.UserRequestEditEmail=-10005]="UserRequestEditEmail",e[e.InactiveRecipient=-10010]="InactiveRecipient",e[e.AccessDeniedToUser=-10011]="AccessDeniedToUser",e))(VB||{}),KB=(e=>(e.LoginWithSms="magic_auth_login_with_sms",e.LoginWithEmailOTP="magic_auth_login_with_email_otp",e.LoginWithMagicLink="magic_auth_login_with_magic_link",e.LoginWithCredential="magic_auth_login_with_credential",e.GetIdToken="magic_auth_get_id_token",e.GenerateIdToken="magic_auth_generate_id_token",e.GetMetadata="magic_auth_get_metadata",e.IsLoggedIn="magic_auth_is_logged_in",e.Logout="magic_auth_logout",e.UpdateEmail="magic_auth_update_email",e.UserSettings="magic_auth_settings",e.UserSettingsTestMode="magic_auth_settings_testing_mode",e.LoginWithSmsTestMode="magic_auth_login_with_sms_testing_mode",e.LoginWithEmailOTPTestMode="magic_auth_login_with_email_otp_testing_mode",e.LoginWithMagicLinkTestMode="magic_login_with_magic_link_testing_mode",e.LoginWithCredentialTestMode="magic_auth_login_with_credential_testing_mode",e.GetIdTokenTestMode="magic_auth_get_id_token_testing_mode",e.GenerateIdTokenTestMode="magic_auth_generate_id_token_testing_mode",e.GetMetadataTestMode="magic_auth_get_metadata_testing_mode",e.IsLoggedInTestMode="magic_auth_is_logged_in_testing_mode",e.LogoutTestMode="magic_auth_logout_testing_mode",e.UpdateEmailTestMode="magic_auth_update_email_testing_mode",e.IntermediaryEvent="magic_intermediary_event",e.RequestAccounts="eth_requestAccounts",e.GetInfo="mc_get_wallet_info",e.ShowUI="mc_wallet",e.NFTPurchase="magic_nft_purchase",e.RequestUserInfoWithUI="mc_request_user_info",e.Disconnect="mc_disconnect",e.UpdatePhoneNumber="magic_auth_update_phone_number",e.UpdatePhoneNumberTestMode="magic_auth_update_phone_number_testing_mode",e.RecoverAccount="magic_auth_recover_account",e.RecoverAccountTestMode="magic_auth_recover_account_testing_mode",e))(KB||{}),WB=(e=>(e.MAGIC_HANDLE_RESPONSE="MAGIC_HANDLE_RESPONSE",e.MAGIC_OVERLAY_READY="MAGIC_OVERLAY_READY",e.MAGIC_SHOW_OVERLAY="MAGIC_SHOW_OVERLAY",e.MAGIC_HIDE_OVERLAY="MAGIC_HIDE_OVERLAY",e.MAGIC_HANDLE_EVENT="MAGIC_HANDLE_EVENT",e))(WB||{}),XB=(e=>(e.MAGIC_HANDLE_REQUEST="MAGIC_HANDLE_REQUEST",e))(XB||{}),$B=(e=>(e.Harmony="HARMONY",e))($B||{}),JB=Object.create,YB=Object.defineProperty,QB=Object.defineProperties,ZB=Object.getOwnPropertyDescriptor,eD=Object.getOwnPropertyDescriptors,tD=Object.getOwnPropertyNames,nD=Object.getOwnPropertySymbols,rD=Object.getPrototypeOf,iD=Object.prototype.hasOwnProperty,aD=Object.prototype.propertyIsEnumerable,oD=(e,t,n)=>t in e?YB(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,sD=(e,t)=>{for(var n in t||(t={}))iD.call(t,n)&&oD(e,n,t[n]);if(nD)for(var n of nD(t))aD.call(t,n)&&oD(e,n,t[n]);return e},cD=(e,t,n)=>new Promise(((r,i)=>{var a=e=>{try{s(n.next(e))}catch(e){i(e)}},o=e=>{try{s(n.throw(e))}catch(e){i(e)}},s=e=>e.done?r(e.value):Promise.resolve(e.value).then(a,o);s((n=n.apply(e,t)).next())})),uD=((e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports))(((e,t)=>{var n=Object.prototype.hasOwnProperty,r="~";function i(){}function a(e,t,n){this.fn=e,this.context=t,this.once=n||!1}function o(e,t,n,i,o){if("function"!=typeof n)throw new TypeError("The listener must be a function");var s=new a(n,i||e,o),c=r?r+t:t;return e._events[c]?e._events[c].fn?e._events[c]=[e._events[c],s]:e._events[c].push(s):(e._events[c]=s,e._eventsCount++),e}function s(e,t){0==--e._eventsCount?e._events=new i:delete e._events[t]}function c(){this._events=new i,this._eventsCount=0}Object.create&&(i.prototype=Object.create(null),(new i).__proto__||(r=!1)),c.prototype.eventNames=function(){var e,t,i=[];if(0===this._eventsCount)return i;for(t in e=this._events)n.call(e,t)&&i.push(r?t.slice(1):t);return Object.getOwnPropertySymbols?i.concat(Object.getOwnPropertySymbols(e)):i},c.prototype.listeners=function(e){var t=r?r+e:e,n=this._events[t];if(!n)return[];if(n.fn)return[n.fn];for(var i=0,a=n.length,o=new Array(a);i<a;i++)o[i]=n[i].fn;return o},c.prototype.listenerCount=function(e){var t=r?r+e:e,n=this._events[t];return n?n.fn?1:n.length:0},c.prototype.emit=function(e,t,n,i,a,o){var s=r?r+e:e;if(!this._events[s])return!1;var c,u,f=this._events[s],d=arguments.length;if(f.fn){switch(f.once&&this.removeListener(e,f.fn,void 0,!0),d){case 1:return f.fn.call(f.context),!0;case 2:return f.fn.call(f.context,t),!0;case 3:return f.fn.call(f.context,t,n),!0;case 4:return f.fn.call(f.context,t,n,i),!0;case 5:return f.fn.call(f.context,t,n,i,a),!0;case 6:return f.fn.call(f.context,t,n,i,a,o),!0}for(u=1,c=new Array(d-1);u<d;u++)c[u-1]=arguments[u];f.fn.apply(f.context,c)}else{var l,p=f.length;for(u=0;u<p;u++)switch(f[u].once&&this.removeListener(e,f[u].fn,void 0,!0),d){case 1:f[u].fn.call(f[u].context);break;case 2:f[u].fn.call(f[u].context,t);break;case 3:f[u].fn.call(f[u].context,t,n);break;case 4:f[u].fn.call(f[u].context,t,n,i);break;default:if(!c)for(l=1,c=new Array(d-1);l<d;l++)c[l-1]=arguments[l];f[u].fn.apply(f[u].context,c)}}return!0},c.prototype.on=function(e,t,n){return o(this,e,t,n,!1)},c.prototype.once=function(e,t,n){return o(this,e,t,n,!0)},c.prototype.removeListener=function(e,t,n,i){var a=r?r+e:e;if(!this._events[a])return this;if(!t)return s(this,a),this;var o=this._events[a];if(o.fn)o.fn===t&&(!i||o.once)&&(!n||o.context===n)&&s(this,a);else{for(var c=0,u=[],f=o.length;c<f;c++)(o[c].fn!==t||i&&!o[c].once||n&&o[c].context!==n)&&u.push(o[c]);u.length?this._events[a]=1===u.length?u[0]:u:s(this,a)}return this},c.prototype.removeAllListeners=function(e){var t;return e?(t=r?r+e:e,this._events[t]&&s(this,t)):(this._events=new i,this._eventsCount=0),this},c.prototype.off=c.prototype.removeListener,c.prototype.addListener=c.prototype.on,c.prefixed=r,c.EventEmitter=c,typeof t<"u"&&(t.exports=c)}));var fD={SEMVER_SPEC_VERSION:"2.0.0",MAX_LENGTH:256,MAX_SAFE_INTEGER:Number.MAX_SAFE_INTEGER||9007199254740991,MAX_SAFE_COMPONENT_LENGTH:16},dD="object"==typeof process&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...e)=>console.error("SEMVER",...e):()=>{},lD=dD,pD=function(e){let t={exports:{}};return e(t,t.exports),t.exports}((function(e,t){let{MAX_SAFE_COMPONENT_LENGTH:n}=fD,r=(t=e.exports={}).re=[],i=t.src=[],a=t.t={},o=0,s=(e,t,n)=>{let s=o++;lD(s,t),a[e]=s,i[s]=t,r[s]=new RegExp(t,n?"g":void 0)};s("NUMERICIDENTIFIER","0|[1-9]\\d*"),s("NUMERICIDENTIFIERLOOSE","[0-9]+"),s("NONNUMERICIDENTIFIER","\\d*[a-zA-Z-][a-zA-Z0-9-]*"),s("MAINVERSION",`(${i[a.NUMERICIDENTIFIER]})\\.(${i[a.NUMERICIDENTIFIER]})\\.(${i[a.NUMERICIDENTIFIER]})`),s("MAINVERSIONLOOSE",`(${i[a.NUMERICIDENTIFIERLOOSE]})\\.(${i[a.NUMERICIDENTIFIERLOOSE]})\\.(${i[a.NUMERICIDENTIFIERLOOSE]})`),s("PRERELEASEIDENTIFIER",`(?:${i[a.NUMERICIDENTIFIER]}|${i[a.NONNUMERICIDENTIFIER]})`),s("PRERELEASEIDENTIFIERLOOSE",`(?:${i[a.NUMERICIDENTIFIERLOOSE]}|${i[a.NONNUMERICIDENTIFIER]})`),s("PRERELEASE",`(?:-(${i[a.PRERELEASEIDENTIFIER]}(?:\\.${i[a.PRERELEASEIDENTIFIER]})*))`),s("PRERELEASELOOSE",`(?:-?(${i[a.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${i[a.PRERELEASEIDENTIFIERLOOSE]})*))`),s("BUILDIDENTIFIER","[0-9A-Za-z-]+"),s("BUILD",`(?:\\+(${i[a.BUILDIDENTIFIER]}(?:\\.${i[a.BUILDIDENTIFIER]})*))`),s("FULLPLAIN",`v?${i[a.MAINVERSION]}${i[a.PRERELEASE]}?${i[a.BUILD]}?`),s("FULL",`^${i[a.FULLPLAIN]}$`),s("LOOSEPLAIN",`[v=\\s]*${i[a.MAINVERSIONLOOSE]}${i[a.PRERELEASELOOSE]}?${i[a.BUILD]}?`),s("LOOSE",`^${i[a.LOOSEPLAIN]}$`),s("GTLT","((?:<|>)?=?)"),s("XRANGEIDENTIFIERLOOSE",`${i[a.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),s("XRANGEIDENTIFIER",`${i[a.NUMERICIDENTIFIER]}|x|X|\\*`),s("XRANGEPLAIN",`[v=\\s]*(${i[a.XRANGEIDENTIFIER]})(?:\\.(${i[a.XRANGEIDENTIFIER]})(?:\\.(${i[a.XRANGEIDENTIFIER]})(?:${i[a.PRERELEASE]})?${i[a.BUILD]}?)?)?`),s("XRANGEPLAINLOOSE",`[v=\\s]*(${i[a.XRANGEIDENTIFIERLOOSE]})(?:\\.(${i[a.XRANGEIDENTIFIERLOOSE]})(?:\\.(${i[a.XRANGEIDENTIFIERLOOSE]})(?:${i[a.PRERELEASELOOSE]})?${i[a.BUILD]}?)?)?`),s("XRANGE",`^${i[a.GTLT]}\\s*${i[a.XRANGEPLAIN]}$`),s("XRANGELOOSE",`^${i[a.GTLT]}\\s*${i[a.XRANGEPLAINLOOSE]}$`),s("COERCE",`(^|[^\\d])(\\d{1,${n}})(?:\\.(\\d{1,${n}}))?(?:\\.(\\d{1,${n}}))?(?:$|[^\\d])`),s("COERCERTL",i[a.COERCE],!0),s("LONETILDE","(?:~>?)"),s("TILDETRIM",`(\\s*)${i[a.LONETILDE]}\\s+`,!0),t.tildeTrimReplace="$1~",s("TILDE",`^${i[a.LONETILDE]}${i[a.XRANGEPLAIN]}$`),s("TILDELOOSE",`^${i[a.LONETILDE]}${i[a.XRANGEPLAINLOOSE]}$`),s("LONECARET","(?:\\^)"),s("CARETTRIM",`(\\s*)${i[a.LONECARET]}\\s+`,!0),t.caretTrimReplace="$1^",s("CARET",`^${i[a.LONECARET]}${i[a.XRANGEPLAIN]}$`),s("CARETLOOSE",`^${i[a.LONECARET]}${i[a.XRANGEPLAINLOOSE]}$`),s("COMPARATORLOOSE",`^${i[a.GTLT]}\\s*(${i[a.LOOSEPLAIN]})$|^$`),s("COMPARATOR",`^${i[a.GTLT]}\\s*(${i[a.FULLPLAIN]})$|^$`),s("COMPARATORTRIM",`(\\s*)${i[a.GTLT]}\\s*(${i[a.LOOSEPLAIN]}|${i[a.XRANGEPLAIN]})`,!0),t.comparatorTrimReplace="$1$2$3",s("HYPHENRANGE",`^\\s*(${i[a.XRANGEPLAIN]})\\s+-\\s+(${i[a.XRANGEPLAIN]})\\s*$`),s("HYPHENRANGELOOSE",`^\\s*(${i[a.XRANGEPLAINLOOSE]})\\s+-\\s+(${i[a.XRANGEPLAINLOOSE]})\\s*$`),s("STAR","(<|>)?=?\\s*\\*"),s("GTE0","^\\s*>=\\s*0.0.0\\s*$"),s("GTE0PRE","^\\s*>=\\s*0.0.0-0\\s*$")})),hD=/^[0-9]+$/,bD=(e,t)=>{let n=hD.test(e),r=hD.test(t);return n&&r&&(e=+e,t=+t),e===t?0:n&&!r?-1:r&&!n?1:e<t?-1:1},mD={compareIdentifiers:bD,rcompareIdentifiers:(e,t)=>bD(t,e)},{MAX_LENGTH:yD,MAX_SAFE_INTEGER:gD}=fD,{re:vD,t:wD}=pD,{compareIdentifiers:_D}=mD,ED=class{constructor(e,t){if(t&&"object"==typeof t||(t={loose:!!t,includePrerelease:!1}),e instanceof ED){if(e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease)return e;e=e.version}else if("string"!=typeof e)throw new TypeError(`Invalid Version: ${e}`);if(e.length>yD)throw new TypeError(`version is longer than ${yD} characters`);lD("SemVer",e,t),this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease;let n=e.trim().match(t.loose?vD[wD.LOOSE]:vD[wD.FULL]);if(!n)throw new TypeError(`Invalid Version: ${e}`);if(this.raw=e,this.major=+n[1],this.minor=+n[2],this.patch=+n[3],this.major>gD||this.major<0)throw new TypeError("Invalid major version");if(this.minor>gD||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>gD||this.patch<0)throw new TypeError("Invalid patch version");n[4]?this.prerelease=n[4].split(".").map((e=>{if(/^[0-9]+$/.test(e)){let t=+e;if(t>=0&&t<gD)return t}return e})):this.prerelease=[],this.build=n[5]?n[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(e){if(lD("SemVer.compare",this.version,this.options,e),!(e instanceof ED)){if("string"==typeof e&&e===this.version)return 0;e=new ED(e,this.options)}return e.version===this.version?0:this.compareMain(e)||this.comparePre(e)}compareMain(e){return e instanceof ED||(e=new ED(e,this.options)),_D(this.major,e.major)||_D(this.minor,e.minor)||_D(this.patch,e.patch)}comparePre(e){if(e instanceof ED||(e=new ED(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{let n=this.prerelease[t],r=e.prerelease[t];if(lD("prerelease compare",t,n,r),void 0===n&&void 0===r)return 0;if(void 0===r)return 1;if(void 0===n)return-1;if(n!==r)return _D(n,r)}while(++t)}compareBuild(e){e instanceof ED||(e=new ED(e,this.options));let t=0;do{let n=this.build[t],r=e.build[t];if(lD("prerelease compare",t,n,r),void 0===n&&void 0===r)return 0;if(void 0===r)return 1;if(void 0===n)return-1;if(n!==r)return _D(n,r)}while(++t)}inc(e,t){switch(e){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",t);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",t);break;case"prepatch":this.prerelease.length=0,this.inc("patch",t),this.inc("pre",t);break;case"prerelease":0===this.prerelease.length&&this.inc("patch",t),this.inc("pre",t);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":if(0===this.prerelease.length)this.prerelease=[0];else{let e=this.prerelease.length;for(;--e>=0;)"number"==typeof this.prerelease[e]&&(this.prerelease[e]++,e=-2);-1===e&&this.prerelease.push(0)}t&&(this.prerelease[0]===t?isNaN(this.prerelease[1])&&(this.prerelease=[t,0]):this.prerelease=[t,0]);break;default:throw new Error(`invalid increment argument: ${e}`)}return this.format(),this.raw=this.version,this}},TD=(e,t,n)=>new ED(e,n).compare(new ED(t,n)),AD=(e,t,n)=>0===TD(e,t,n),RD=(e,t,n)=>0!==TD(e,t,n),SD=(e,t,n)=>TD(e,t,n)>0,kD=(e,t,n)=>TD(e,t,n)>=0,ID=(e,t,n)=>TD(e,t,n)<0,OD=(e,t,n)=>TD(e,t,n)<=0,xD=(e,t,n,r)=>{switch(t){case"===":return"object"==typeof e&&(e=e.version),"object"==typeof n&&(n=n.version),e===n;case"!==":return"object"==typeof e&&(e=e.version),"object"==typeof n&&(n=n.version),e!==n;case"":case"=":case"==":return AD(e,n,r);case"!=":return RD(e,n,r);case">":return SD(e,n,r);case">=":return kD(e,n,r);case"<":return ID(e,n,r);case"<=":return OD(e,n,r);default:throw new TypeError(`Invalid operator: ${t}`)}},CD=Symbol("SemVer ANY"),MD=class{static get ANY(){return CD}constructor(e,t){if(t&&"object"==typeof t||(t={loose:!!t,includePrerelease:!1}),e instanceof MD){if(e.loose===!!t.loose)return e;e=e.value}lD("comparator",e,t),this.options=t,this.loose=!!t.loose,this.parse(e),this.semver===CD?this.value="":this.value=this.operator+this.semver.version,lD("comp",this)}parse(e){let t=this.options.loose?PD[ND.COMPARATORLOOSE]:PD[ND.COMPARATOR],n=e.match(t);if(!n)throw new TypeError(`Invalid comparator: ${e}`);this.operator=void 0!==n[1]?n[1]:"","="===this.operator&&(this.operator=""),n[2]?this.semver=new ED(n[2],this.options.loose):this.semver=CD}toString(){return this.value}test(e){if(lD("Comparator.test",e,this.options.loose),this.semver===CD||e===CD)return!0;if("string"==typeof e)try{e=new ED(e,this.options)}catch(e){return!1}return xD(e,this.operator,this.semver,this.options)}intersects(e,t){if(!(e instanceof MD))throw new TypeError("a Comparator is required");if(t&&"object"==typeof t||(t={loose:!!t,includePrerelease:!1}),""===this.operator)return""===this.value||new BD(e.value,t).test(this.value);if(""===e.operator)return""===e.value||new BD(this.value,t).test(e.semver);let n=!(">="!==this.operator&&">"!==this.operator||">="!==e.operator&&">"!==e.operator),r=!("<="!==this.operator&&"<"!==this.operator||"<="!==e.operator&&"<"!==e.operator),i=this.semver.version===e.semver.version,a=!(">="!==this.operator&&"<="!==this.operator||">="!==e.operator&&"<="!==e.operator),o=xD(this.semver,"<",e.semver,t)&&(">="===this.operator||">"===this.operator)&&("<="===e.operator||"<"===e.operator),s=xD(this.semver,">",e.semver,t)&&("<="===this.operator||"<"===this.operator)&&(">="===e.operator||">"===e.operator);return n||r||i&&a||o||s}},{re:PD,t:ND}=pD,BD=class{constructor(e,t){if(t&&"object"==typeof t||(t={loose:!!t,includePrerelease:!1}),e instanceof BD)return e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease?e:new BD(e.raw,t);if(e instanceof MD)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,this.set=e.split(/\s*\|\|\s*/).map((e=>this.parseRange(e.trim()))).filter((e=>e.length)),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${e}`);this.format()}format(){return this.range=this.set.map((e=>e.join(" ").trim())).join("||").trim(),this.range}toString(){return this.range}parseRange(e){let{loose:t}=this.options;e=e.trim();let n=t?DD[FD.HYPHENRANGELOOSE]:DD[FD.HYPHENRANGE];e=e.replace(n,QD(this.options.includePrerelease)),lD("hyphen replace",e),e=e.replace(DD[FD.COMPARATORTRIM],LD),lD("comparator trim",e,DD[FD.COMPARATORTRIM]),e=(e=(e=e.replace(DD[FD.TILDETRIM],UD)).replace(DD[FD.CARETTRIM],jD)).split(/\s+/).join(" ");let r=t?DD[FD.COMPARATORLOOSE]:DD[FD.COMPARATOR];return e.split(" ").map((e=>zD(e,this.options))).join(" ").split(/\s+/).map((e=>YD(e,this.options))).filter(this.options.loose?e=>!!e.match(r):()=>!0).map((e=>new MD(e,this.options)))}intersects(e,t){if(!(e instanceof BD))throw new TypeError("a Range is required");return this.set.some((n=>qD(n,t)&&e.set.some((e=>qD(e,t)&&n.every((n=>e.every((e=>n.intersects(e,t)))))))))}test(e){if(!e)return!1;if("string"==typeof e)try{e=new ED(e,this.options)}catch(e){return!1}for(let t=0;t<this.set.length;t++)if(ZD(this.set[t],e,this.options))return!0;return!1}},{re:DD,t:FD,comparatorTrimReplace:LD,tildeTrimReplace:UD,caretTrimReplace:jD}=pD,qD=(e,t)=>{let n=!0,r=e.slice(),i=r.pop();for(;n&&r.length;)n=r.every((e=>i.intersects(e,t))),i=r.pop();return n},zD=(e,t)=>(lD("comp",e,t),e=KD(e,t),lD("caret",e),e=GD(e,t),lD("tildes",e),e=XD(e,t),lD("xrange",e),e=JD(e,t),lD("stars",e),e),HD=e=>!e||"x"===e.toLowerCase()||"*"===e,GD=(e,t)=>e.trim().split(/\s+/).map((e=>VD(e,t))).join(" "),VD=(e,t)=>{let n=t.loose?DD[FD.TILDELOOSE]:DD[FD.TILDE];return e.replace(n,((t,n,r,i,a)=>{let o;return lD("tilde",e,t,n,r,i,a),HD(n)?o="":HD(r)?o=`>=${n}.0.0 <${+n+1}.0.0-0`:HD(i)?o=`>=${n}.${r}.0 <${n}.${+r+1}.0-0`:a?(lD("replaceTilde pr",a),o=`>=${n}.${r}.${i}-${a} <${n}.${+r+1}.0-0`):o=`>=${n}.${r}.${i} <${n}.${+r+1}.0-0`,lD("tilde return",o),o}))},KD=(e,t)=>e.trim().split(/\s+/).map((e=>WD(e,t))).join(" "),WD=(e,t)=>{lD("caret",e,t);let n=t.loose?DD[FD.CARETLOOSE]:DD[FD.CARET],r=t.includePrerelease?"-0":"";return e.replace(n,((t,n,i,a,o)=>{let s;return lD("caret",e,t,n,i,a,o),HD(n)?s="":HD(i)?s=`>=${n}.0.0${r} <${+n+1}.0.0-0`:HD(a)?s="0"===n?`>=${n}.${i}.0${r} <${n}.${+i+1}.0-0`:`>=${n}.${i}.0${r} <${+n+1}.0.0-0`:o?(lD("replaceCaret pr",o),s="0"===n?"0"===i?`>=${n}.${i}.${a}-${o} <${n}.${i}.${+a+1}-0`:`>=${n}.${i}.${a}-${o} <${n}.${+i+1}.0-0`:`>=${n}.${i}.${a}-${o} <${+n+1}.0.0-0`):(lD("no pr"),s="0"===n?"0"===i?`>=${n}.${i}.${a}${r} <${n}.${i}.${+a+1}-0`:`>=${n}.${i}.${a}${r} <${n}.${+i+1}.0-0`:`>=${n}.${i}.${a} <${+n+1}.0.0-0`),lD("caret return",s),s}))},XD=(e,t)=>(lD("replaceXRanges",e,t),e.split(/\s+/).map((e=>$D(e,t))).join(" ")),$D=(e,t)=>{e=e.trim();let n=t.loose?DD[FD.XRANGELOOSE]:DD[FD.XRANGE];return e.replace(n,((n,r,i,a,o,s)=>{lD("xRange",e,n,r,i,a,o,s);let c=HD(i),u=c||HD(a),f=u||HD(o),d=f;return"="===r&&d&&(r=""),s=t.includePrerelease?"-0":"",c?n=">"===r||"<"===r?"<0.0.0-0":"*":r&&d?(u&&(a=0),o=0,">"===r?(r=">=",u?(i=+i+1,a=0,o=0):(a=+a+1,o=0)):"<="===r&&(r="<",u?i=+i+1:a=+a+1),"<"===r&&(s="-0"),n=`${r+i}.${a}.${o}${s}`):u?n=`>=${i}.0.0${s} <${+i+1}.0.0-0`:f&&(n=`>=${i}.${a}.0${s} <${i}.${+a+1}.0-0`),lD("xRange return",n),n}))},JD=(e,t)=>(lD("replaceStars",e,t),e.trim().replace(DD[FD.STAR],"")),YD=(e,t)=>(lD("replaceGTE0",e,t),e.trim().replace(DD[t.includePrerelease?FD.GTE0PRE:FD.GTE0],"")),QD=e=>(t,n,r,i,a,o,s,c,u,f,d,l,p)=>`${n=HD(r)?"":HD(i)?`>=${r}.0.0${e?"-0":""}`:HD(a)?`>=${r}.${i}.0${e?"-0":""}`:o?`>=${n}`:`>=${n}${e?"-0":""}`} ${c=HD(u)?"":HD(f)?`<${+u+1}.0.0-0`:HD(d)?`<${u}.${+f+1}.0-0`:l?`<=${u}.${f}.${d}-${l}`:e?`<${u}.${f}.${+d+1}-0`:`<=${c}`}`.trim(),ZD=(e,t,n)=>{for(let n=0;n<e.length;n++)if(!e[n].test(t))return!1;if(t.prerelease.length&&!n.includePrerelease){for(let n=0;n<e.length;n++)if(lD(e[n].semver),e[n].semver!==MD.ANY&&e[n].semver.prerelease.length>0){let r=e[n].semver;if(r.major===t.major&&r.minor===t.minor&&r.patch===t.patch)return!0}return!1}return!0},eF=(e,t,n)=>{try{t=new BD(t,n)}catch(e){return!1}return t.test(e)},{MAX_LENGTH:tF}=fD,{re:nF,t:rF}=pD,iF=(e,t)=>{if(t&&"object"==typeof t||(t={loose:!!t,includePrerelease:!1}),e instanceof ED)return e;if("string"!=typeof e||e.length>tF||!(t.loose?nF[rF.LOOSE]:nF[rF.FULL]).test(e))return null;try{return new ED(e,t)}catch(e){return null}},{re:aF,t:oF}=pD,sF=(e,t)=>{if(e instanceof ED)return e;if("number"==typeof e&&(e=String(e)),"string"!=typeof e)return null;let n=null;if((t=t||{}).rtl){let t;for(;(t=aF[oF.COERCERTL].exec(e))&&(!n||n.index+n[0].length!==e.length);)n&&t.index+t[0].length===n.index+n[0].length||(n=t),aF[oF.COERCERTL].lastIndex=t.index+t[1].length+t[2].length;aF[oF.COERCERTL].lastIndex=-1}else n=e.match(aF[oF.COERCE]);return null===n?null:iF(`${n[2]}.${n[3]||"0"}.${n[4]||"0"}`,t)};function cF(e){return String.fromCharCode(parseInt(e.slice(1),16))}function uF(e){return`%${`00${e.charCodeAt(0).toString(16)}`.slice(-2)}`}function fF(e){return function(e){return btoa(encodeURIComponent(e).replace(/%[0-9A-F]{2}/g,cF))}(JSON.stringify(e))}function dF(e){return JSON.parse(function(e){return decodeURIComponent(Array.from(atob(e),uF).join(""))}(e))}function lF(e){return void 0===e}function pF(e){return function(e){return null===e}(e)||lF(e)}function hF(e){if(!e)return!0;for(let t in e)if(Object.hasOwnProperty.call(e,t))return!1;return!0}var bF={};var mF={"magic-sdk":"magic-sdk","@magic-sdk/react-native":"magic-sdk-rn","@magic-sdk/react-native-bare":"magic-sdk-rn-bare","@magic-sdk/react-native-expo":"magic-sdk-rn-expo"},yF=class extends Error{constructor(e,t){super(`Magic SDK Error: [${e}] ${t}`),this.code=e,this.rawMessage=t,this.__proto__=Error,Object.setPrototypeOf(this,yF.prototype)}},gF=class extends Error{constructor(e){super(),this.__proto__=Error;let t=Number(null==e?void 0:e.code);this.rawMessage=(null==e?void 0:e.message)||"Internal error",this.code=function(e){return!pF(e)&&"number"==typeof e&&Object.values(VB).includes(e)}(t)?t:VB.InternalError,this.message=`Magic RPC Error: [${this.code}] ${this.rawMessage}`,this.data=(null==e?void 0:e.data)||void 0,Object.setPrototypeOf(this,gF.prototype)}},vF=class{constructor(e,t){this.code=e,this.rawMessage=t,this.message=`Magic SDK Warning: [${e}] ${t}`}log(){console.warn(this.message)}},wF=class extends Error{constructor(e,t,n,r){super(`Magic Extension Error (${e.name}): [${t}] ${n}`),this.code=t,this.rawMessage=n,this.data=r,this.__proto__=Error,Object.setPrototypeOf(this,wF.prototype)}},_F=class{constructor(e,t,n){this.code=t,this.rawMessage=n,this.message=`Magic Extension Warning (${e.name}): [${t}] ${n}`}log(){console.warn(this.message)}};function EF(){return new yF(HB.MissingApiKey,"Please provide an API key that you acquired from the Magic developer dashboard.")}function TF(){return new yF(HB.MalformedResponse,"Response from the Magic iframe is malformed.")}function AF(e){return new yF(HB.ExtensionNotInitialized,`Extensions must be initialized with a Magic SDK instance before \`Extension.${e}\` can be accessed. Do not invoke \`Extension.${e}\` inside an extension constructor.`)}function RF(e){let t=`Some extensions are incompatible with \`${bF.sdkName}@${bF.version}\`:`;return e.filter((e=>void 0!==e.compat&&null!==e.compat)).forEach((e=>{let n=e.compat[bF.sdkName];"string"==typeof n?t+=`\n - Extension \`${e.name}\` supports version(s) \`${n}\``:n||(t+=`\n - Extension \`${e.name}\` does not support ${bF.platform} environments.`)})),new yF(HB.IncompatibleExtensions,t)}function SF(e){return new yF(HB.InvalidArgument,`Invalid ${(e=>{let t=e+1,n=t%10,r=t%100;return 1===n&&11!==r?`${t}st`:2===n&&12!==r?`${t}nd`:3===n&&13!==r?`${t}rd`:`${t}th`})(e.argument)} argument given to \`${e.procedure}\`.\n Expected: \`${e.expected}\`\n Received: \`${e.received}\``)}function kF(){return new vF(GB.ReactNativeEndpointConfiguration,`CUSTOM DOMAINS ARE NOT SUPPORTED WHEN USING MAGIC SDK WITH REACT NATIVE! The \`endpoint\` parameter SHOULD NOT be provided. The Magic \`<iframe>\` is automatically wrapped by a WebView pointed at \`${bF.defaultEndpoint}\`. Changing this default behavior will lead to unexpected results and potentially security-threatening bugs.`)}var IF=function*(){let e=0;for(;;)e<Number.MAX_SAFE_INTEGER?yield++e:e=0}();function OF(){return IF.next().value}var xF=Symbol("Payload pre-processed by Magic SDK");function CF(e){return Object.defineProperty(e,xF,{value:!0,enumerable:!1}),e}function MF(e){var t,n,r;return function(e){return!!e[xF]}(e)||(e.jsonrpc=null!=(t=e.jsonrpc)?t:"2.0",e.id=OF(),e.method=null!=(n=e.method)?n:"noop",e.params=null!=(r=e.params)?r:[],CF(e)),e}function PF(e,t=[]){return CF({params:t,method:e,jsonrpc:"2.0",id:OF()})}var NF=class{constructor(e){e instanceof NF?(this._jsonrpc=e.payload.jsonrpc,this._id=e.payload.id,this._result=e.payload.result,this._error=e.payload.error):function(e){return!pF(e)&&!(lF(e.jsonrpc)||lF(e.id)||lF(e.result)&&lF(e.error))}(e)?(this._jsonrpc=e.jsonrpc,this._id=e.id,this._result=e.result,this._error=e.error):(this._jsonrpc=e.jsonrpc,this._id=e.id,this._result=void 0,this._error=void 0)}applyError(e){return this._error=e,this}applyResult(e){return this._result=e,this}get hasError(){return void 0!==this._error&&null!==this._error}get hasResult(){return void 0!==this._result}get payload(){return{jsonrpc:this._jsonrpc,id:this._id,result:this._result,error:this._error}}},BF=((e,t,n)=>(n=null!=e?JB(rD(e)):{},((e,t,n,r)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let i of tD(t))!iD.call(e,i)&&i!==n&&YB(e,i,{get:()=>t[i],enumerable:!(r=ZB(t,i))||r.enumerable});return e})(!t&&e&&e.__esModule?n:YB(n,"default",{value:e,enumerable:!0}),e)))(uD()),DF=class extends BF.default{};function FF(){let e=new DF;return{emitter:e,createChainingEmitterMethod:(t,n)=>(...r)=>(e[t].apply(e,r),n),createBoundEmitterMethod:t=>(...n)=>e[t].apply(e,n)}}var LF=Symbol("isPromiEvent");function UF(e){return!!e[LF]}function jF(e){let t=qF(e),{createBoundEmitterMethod:n,createChainingEmitterMethod:r}=FF(),i=Symbol("Promise.then"),a=Symbol("Promise.catch"),o=Symbol("Promise.finally"),s=(e,t)=>(...n)=>{let r=t[e].apply(t,n);return c(r)},c=e=>Object.assign(e,{[LF]:!0,[i]:e[i]||e.then,[a]:e[a]||e.catch,[o]:e[o]||e.finally,then:s(i,e),catch:s(a,e),finally:s(o,e),on:r("on",e),once:r("once",e),addListener:r("addListener",e),off:r("off",e),removeListener:r("removeListener",e),removeAllListeners:r("removeAllListeners",e),emit:n("emit"),eventNames:n("eventNames"),listeners:n("listeners"),listenerCount:n("listenerCount")}),u=c(t.then((e=>(u.emit("done",e),u.emit("settled"),e)),(e=>{throw u.emit("error",e),u.emit("settled"),e})));return u}function qF(e){return new Promise(((t,n)=>{let r=e(t,n);Promise.resolve(r).catch(n)}))}var zF,HF=class{constructor(e){this.sdk=e}get overlay(){return this.sdk.overlay}request(e){let t=this.overlay.post(XB.MAGIC_HANDLE_REQUEST,MF(e)),n=jF(((e,n)=>{t.then((t=>{if(r(),t.hasError)n(new gF(t.payload.error));else{if(!t.hasResult)throw TF();e(t.payload.result)}})).catch((e=>{r(),n(e)}))})),r=this.overlay.on(WB.MAGIC_HANDLE_EVENT,(t=>{var r;let{response:i}=t.data;if(i.id===e.id&&(null==(r=i.result)?void 0:r.event)){let{event:e,params:t=[]}=i.result;n.emit(e,...t)}}));return n}createIntermediaryEvent(e,t){return n=>{let r=PF(KB.IntermediaryEvent,[{payloadId:t,eventType:e,args:n}]);this.request(r)}}},GF=class extends HF{loginWithMagicLink(e){let{email:t,showUI:n=!0,redirectURI:r}=e,i=PF(this.sdk.testMode?KB.LoginWithMagicLinkTestMode:KB.LoginWithMagicLink,[{email:t,showUI:n,redirectURI:r}]);return this.request(i)}loginWithSMS(e){let{phoneNumber:t}=e,n=PF(this.sdk.testMode?KB.LoginWithSmsTestMode:KB.LoginWithSms,[{phoneNumber:t,showUI:!0}]);return this.request(n)}loginWithEmailOTP(e){let{email:t,showUI:n}=e,r=PF(this.sdk.testMode?KB.LoginWithEmailOTPTestMode:KB.LoginWithEmailOTP,[{email:t,showUI:n}]);if(!n){let e=this.request(r);return e&&e.on("otp-input-sent",(e=>{this.createIntermediaryEvent("verify-email-otp",r.id)(e)})),e}return this.request(r)}loginWithCredential(e){let t=null!=e?e:"";if(!e&&"web"===bF.platform){t=window.location.search;let e=window.location.origin+window.location.pathname;window.history.replaceState(null,"",e)}let n=PF(this.sdk.testMode?KB.LoginWithCredentialTestMode:KB.LoginWithCredential,[t]);return this.request(n)}},VF={};function KF(e){return(...t)=>cD(this,null,(function*(){return zF||(zF=yield bF.configureStorage()),yield zF.ready(),zF[e](...t)}))}((e,t)=>{for(var n in t)YB(e,n,{get:t[n],enumerable:!0})})(VF,{clear:()=>JF,getItem:()=>WF,iterate:()=>eL,key:()=>QF,keys:()=>ZF,length:()=>YF,removeItem:()=>$F,setItem:()=>XF});var WF=KF("getItem"),XF=KF("setItem"),$F=KF("removeItem"),JF=KF("clear"),YF=KF("length"),QF=KF("key"),ZF=KF("keys"),eL=KF("iterate");function tL(){let e=window.crypto.getRandomValues(new Uint8Array(16));e[6]=15&e[6]|64,e[8]=191&e[8]|128;let t="";return t+=e[0].toString(16),t+=e[1].toString(16),t+=e[2].toString(16),t+=e[3].toString(16),t+="-",t+=e[4].toString(16),t+=e[5].toString(16),t+="-",t+=e[6].toString(16),t+=e[7].toString(16),t+="-",t+=e[8].toString(16),t+=e[9].toString(16),t+="-",t+=e[10].toString(16),t+=e[11].toString(16),t+=e[12].toString(16),t+=e[13].toString(16),t+=e[14].toString(16),t+=e[15].toString(16),t}var nL="STORE_KEY_PRIVATE_KEY",rL="STORE_KEY_PUBLIC_JWK",iL="ECDSA",aL="P-256",oL={name:iL,namedCurve:aL},sL={name:iL,namedCurve:aL};function cL(){$F(rL),$F(nL)}function uL(){return cD(this,null,(function*(){let e=yield function(){return cD(this,null,(function*(){if(function(){let e="undefined"!=typeof window&&!!window.crypto,t=e&&!!window.crypto.subtle;return e&&t}())return(yield WF(rL))||(yield function(){return cD(this,null,(function*(){let e=null,{subtle:t}=window.crypto,n=yield t.generateKey(oL,!0,["sign"]),r=yield t.exportKey("jwk",n.privateKey);e=yield t.exportKey("jwk",n.publicKey);let i=yield t.importKey("jwk",r,sL,!1,["sign"]);yield XF(nL,i),yield XF(rL,e)}))}()),WF(rL);console.info("webcrypto is not supported")}))}();if(!e)return void console.info("unable to create public key or webcrypto is unsupported");let{subtle:t}=window.crypto,n=yield WF(nL);if(!n||!t)return void console.info("unable to find private key or webcrypto unsupported");let r={iat:Math.floor((new Date).getTime()/1e3),jti:tL()},i={typ:"dpop+jwt",alg:"ES256",jwk:e},a=fL(JSON.stringify(i)),o=fL(JSON.stringify(r)),s=function(e){return(new TextEncoder).encode(e)}(`${a}.${o}`),c={name:iL,hash:{name:"SHA-256"}},u=function(e){let t="";return e.forEach((e=>{t+=String.fromCharCode(e)})),dL(t)}(new Uint8Array(yield t.sign(c,n,s)));return`${a}.${o}.${u}`}))}function fL(e){return dL(function(e){return encodeURIComponent(e).replace(/%([0-9A-F]{2})/g,((e,t)=>String.fromCharCode(parseInt(t,16))))}(e))}function dL(e){return btoa(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+/g,"")}var lL=class extends HF{getIdToken(e){let t=PF(this.sdk.testMode?KB.GetIdTokenTestMode:KB.GetIdToken,[e]);return this.request(t)}generateIdToken(e){let t=PF(this.sdk.testMode?KB.GenerateIdTokenTestMode:KB.GenerateIdToken,[e]);return this.request(t)}getMetadata(){let e=PF(this.sdk.testMode?KB.GetMetadataTestMode:KB.GetMetadata);return this.request(e)}updateEmail(e){let{email:t,showUI:n=!0}=e,r=PF(this.sdk.testMode?KB.UpdateEmailTestMode:KB.UpdateEmail,[{email:t,showUI:n}]);return this.request(r)}isLoggedIn(){let e=PF(this.sdk.testMode?KB.IsLoggedInTestMode:KB.IsLoggedIn);return this.request(e)}logout(){cL();let e=PF(this.sdk.testMode?KB.LogoutTestMode:KB.Logout);return this.request(e)}showSettings(){let e=PF(this.sdk.testMode?KB.UserSettingsTestMode:KB.UserSettings);return this.request(e)}updatePhoneNumber(){let e=PF(this.sdk.testMode?KB.UpdatePhoneNumberTestMode:KB.UpdatePhoneNumber);return this.request(e)}recoverAccount(e){let t=PF(this.sdk.testMode?KB.RecoverAccountTestMode:KB.RecoverAccount,[e]);return this.request(t)}},pL=class extends HF{connectWithUI(){let e=PF(KB.RequestAccounts);return this.request(e)}showUI(){let e=PF(KB.ShowUI);return this.request(e)}getInfo(){let e=PF(KB.GetInfo);return this.request(e)}requestUserInfoWithUI(e){let t=PF(KB.RequestUserInfoWithUI,e?[e]:[]);return this.request(t)}disconnect(){cL();let e=PF(KB.Disconnect);return this.request(e)}},{createBoundEmitterMethod:hL,createChainingEmitterMethod:bL}=FF(),mL=class extends HF{constructor(){super(...arguments),this.isMagic=!0,this.on=bL("on",this),this.once=bL("once",this),this.addListener=bL("addListener",this),this.off=bL("off",this),this.removeListener=bL("removeListener",this),this.removeAllListeners=bL("removeAllListeners",this),this.emit=hL("emit"),this.eventNames=hL("eventNames"),this.listeners=hL("listeners"),this.listenerCount=hL("listenerCount")}sendAsync(e,t){if(!t)throw SF({procedure:"Magic.rpcProvider.sendAsync",argument:1,expected:"function",received:null===t?"null":typeof t});if(Array.isArray(e))this.overlay.post(XB.MAGIC_HANDLE_REQUEST,e.map((e=>{let t=MF(e);return this.prefixPayloadMethodForTestMode(t),t}))).then((e=>{t(null,e.map((e=>((e,t)=>QB(e,eD(t)))(sD({},e.payload),{error:e.hasError?new gF(e.payload.error):null}))))}));else{let n=MF(e);this.prefixPayloadMethodForTestMode(n),this.overlay.post(XB.MAGIC_HANDLE_REQUEST,n).then((e=>{t(e.hasError?new gF(e.payload.error):null,e.payload)}))}}send(e,t){if("string"==typeof e){let n=PF(e,Array.isArray(t)?t:[]);return this.request(n)}if(Array.isArray(e)||t)return void this.sendAsync(e,t);let n=new vF(GB.SyncWeb3Method,"Non-async web3 methods are deprecated in web3 > 1.0 and are not supported by the Magic web3 provider. Please use an async method instead.");return n.log(),new NF(e).applyError({code:-32603,message:n.rawMessage}).payload}enable(){let e=PF("eth_accounts");return this.request(e)}request(e){return this.prefixPayloadMethodForTestMode(e),super.request(e)}prefixPayloadMethodForTestMode(e){this.sdk.testMode&&(e.method=`testMode/eth/${e.method}`)}};function yL(e,t){return t?new URL(e,t):new URL(e)}var gL=["request","overlay","sdk"];function vL(e){let t=Object.getPrototypeOf(e),n=[t];for(;t!==HF.prototype;)t=Object.getPrototypeOf(t),n.push(t);return n}var wL=class extends HF{constructor(){super(void 0),this.__sdk_access_field_descriptors__=new Map,this.__is_initialized__=!1,this.utils={createPromiEvent:jF,isPromiEvent:UF,encodeJSON:fF,decodeJSON:dF,createJsonRpcRequestPayload:PF,standardizeJsonRpcRequestPayload:MF,storage:VF};let e=[this,...vL(this)];gL.forEach((t=>{let n=e.map((e=>Object.getOwnPropertyDescriptor(e,t))),r=n.findIndex((e=>!!e)),i=r>0,a=n[r];a&&(this.__sdk_access_field_descriptors__.set(t,{descriptor:a,isPrototypeField:i}),Object.defineProperty(this,t,{configurable:!0,get:()=>{throw AF(t)}}))}))}init(e){this.__is_initialized__||(gL.forEach((e=>{if(this.__sdk_access_field_descriptors__.has(e)){let{descriptor:t,isPrototypeField:n}=this.__sdk_access_field_descriptors__.get(e);n?delete this[e]:Object.defineProperty(this,e,t)}})),this.sdk=e,this.__is_initialized__=!0)}createDeprecationWarning(e){let{method:t,removalVersion:n,useInstead:r}=e;return new _F(this,"DEPRECATION_NOTICE",`\`${t}\` will be removed from this Extension in version \`${n}\`.${r?` Use \`${r}\` instead.`:""}`)}createWarning(e,t){return new _F(this,e,t)}createError(e,t,n){return new wF(this,e,t,n)}},_L=class extends wL{};_L.Internal=class extends wL{},_L.Anonymous="anonymous extension";var EL=class extends HF{purchase(e){let t=PF(KB.NFTPurchase,[e]);return this.request(t)}};function TL(e){return!e.compat||null==e.compat[bF.sdkName]||("string"==typeof e.compat[bF.sdkName]?eF(sF(bF.version),e.compat[bF.sdkName]):!!e.compat[bF.sdkName])}function AL(e){var t;let n=null!=(t=null==e?void 0:e.extensions)?t:[],r={},i=[];if(Array.isArray(n)?n.forEach((e=>{TL(e)?(e.init(this),(e.name||e.name!==_L.Anonymous)&&(this[e.name]=e),e instanceof _L.Internal&&(hF(e.config)||(r[e.name]=e.config))):i.push(e)})):Object.keys(n).forEach((e=>{if(TL(n[e])){n[e].init(this);let t=n[e];this[e]=t,t instanceof _L.Internal&&(hF(t.config)||(r[n[e].name]=t.config))}else i.push(n[e])})),i.length)throw RF(i);return r}var RL=class{constructor(e,t){var n;if(this.apiKey=e,!e)throw EF();"react-native"===bF.platform&&(null==t?void 0:t.endpoint)&&kF().log();let{defaultEndpoint:r,version:i}=bF;this.testMode=!(null==t||!t.testMode),this.endpoint=yL(null!=(n=null==t?void 0:t.endpoint)?n:r).origin,this.auth=new GF(this),this.user=new lL(this),this.wallet=new pL(this),this.nft=new EL(this),this.rpcProvider=new mL(this);let a=AL.call(this,t);this.parameters=fF(sD({API_KEY:this.apiKey,DOMAIN_ORIGIN:window.location?window.location.origin:"",ETH_NETWORK:null==t?void 0:t.network,host:yL(this.endpoint).host,sdk:mF[bF.sdkName],version:i,ext:hF(a)?void 0:a,locale:(null==t?void 0:t.locale)||"en_US"},bF.bundleId?{bundleId:bF.bundleId}:{}))}get overlay(){if(!RL.__overlays__.has(this.parameters)){let e=new bF.ViewController(this.endpoint,this.parameters);e.init(),RL.__overlays__.set(this.parameters,e)}return RL.__overlays__.get(this.parameters)}preload(){return cD(this,null,(function*(){yield this.overlay.ready}))}},SL=RL;function kL(e,t){var n;let r=null==(n=t.data.response)?void 0:n.id,i=function(e,t){return t&&Array.isArray(e)?e.find((e=>e.id===t)):e}(e,r);if(r&&i){return{id:r,response:new NF(i).applyResult(t.data.response.result).applyError(t.data.response.error)}}return{}}SL.__overlays__=new Map;var IL=class{constructor(e,t){this.endpoint=e,this.parameters=t,this.messageHandlers=new Set,this.ready=this.waitForReady(),this.listen()}post(e,t){return cD(this,null,(function*(){return qF((n=>cD(this,null,(function*(){yield this.ready;let r=[],i=Array.isArray(t)?t.map((e=>e.id)):[],a=yield function(e,t){return cD(this,null,(function*(){let n,r=yield WF("rt");if("web"===bF.platform)try{n=yield uL()}catch(e){console.error("webcrypto error",e)}return n?r?{msgType:e,payload:t,jwt:n,rt:r}:{msgType:e,payload:t,jwt:n}:{msgType:e,payload:t}}))}(`${e}-${this.parameters}`,t);yield this._post(a);let o=this.on(WB.MAGIC_HANDLE_RESPONSE,(e=>a=>{let{id:o,response:s}=kL(t,a);(function(e){cD(this,null,(function*(){!e.data.rt||(yield XF("rt",e.data.rt))}))})(a),o&&s&&Array.isArray(t)&&i.includes(o)?(r.push(s),r.length===t.length&&(e(),n(r))):o&&s&&!Array.isArray(t)&&o===t.id&&(e(),n(s))})((()=>o())))}))))}))}on(e,t){let n=t.bind(window),r=t=>{t.data.msgType===`${e}-${this.parameters}`&&n(t)};return this.messageHandlers.add(r),()=>this.messageHandlers.delete(r)}waitForReady(){return new Promise((e=>{this.on(WB.MAGIC_OVERLAY_READY,(()=>e()))}))}listen(){this.on(WB.MAGIC_HIDE_OVERLAY,(()=>{this.hideOverlay()})),this.on(WB.MAGIC_SHOW_OVERLAY,(()=>{this.showOverlay()}))}},OL=Object.create,xL=Object.defineProperty,CL=Object.getOwnPropertyDescriptor,ML=Object.getOwnPropertyNames,PL=Object.getPrototypeOf,NL=Object.prototype.hasOwnProperty,BL=(e=>"undefined"!=typeof require?require:"undefined"!=typeof Proxy?new Proxy(e,{get:(e,t)=>("undefined"!=typeof require?require:e)[t]}):e)((function(e){if("undefined"!=typeof require)return require.apply(this,arguments);throw new Error('Dynamic require of "'+e+'" is not supported')})),DL=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),FL=(e,t,n)=>(n=null!=e?OL(PL(e)):{},((e,t,n,r)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let i of ML(t))!NL.call(e,i)&&i!==n&&xL(e,i,{get:()=>t[i],enumerable:!(r=CL(t,i))||r.enumerable});return e})(!t&&e&&e.__esModule?n:xL(n,"default",{value:e,enumerable:!0}),e)),LL=(e,t,n)=>new Promise(((r,i)=>{var a=e=>{try{s(n.next(e))}catch(e){i(e)}},o=e=>{try{s(n.throw(e))}catch(e){i(e)}},s=e=>e.done?r(e.value):Promise.resolve(e.value).then(a,o);s((n=n.apply(e,t)).next())})),UL=DL(((e,t)=>{!function(n){if("object"==typeof e&&typeof t<"u")t.exports=n();else if("function"==typeof define&&define.amd)define([],n);else{(typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:this).localforage=n()}}((function(){return function e(t,n,r){function i(o,s){if(!n[o]){if(!t[o]){var c="function"==typeof BL&&BL;if(!s&&c)return c(o,!0);if(a)return a(o,!0);var u=new Error("Cannot find module '"+o+"'");throw u.code="MODULE_NOT_FOUND",u}var f=n[o]={exports:{}};t[o][0].call(f.exports,(function(e){return i(t[o][1][e]||e)}),f,f.exports,e,t,n,r)}return n[o].exports}for(var a="function"==typeof BL&&BL,o=0;o<r.length;o++)i(r[o]);return i}({1:[function(e,t,n){(function(e){var n,r=e.MutationObserver||e.WebKitMutationObserver;if(r){var i=0,a=new r(f),o=e.document.createTextNode("");a.observe(o,{characterData:!0}),n=function(){o.data=i=++i%2}}else if(!e.setImmediate&&typeof e.MessageChannel<"u"){var s=new e.MessageChannel;s.port1.onmessage=f,n=function(){s.port2.postMessage(0)}}else n="document"in e&&"onreadystatechange"in e.document.createElement("script")?function(){var t=e.document.createElement("script");t.onreadystatechange=function(){f(),t.onreadystatechange=null,t.parentNode.removeChild(t),t=null},e.document.documentElement.appendChild(t)}:function(){setTimeout(f,0)};var c,u=[];function f(){c=!0;for(var e,t,n=u.length;n;){for(t=u,u=[],e=-1;++e<n;)t[e]();n=u.length}c=!1}t.exports=function(e){1===u.push(e)&&!c&&n()}}).call(this,typeof global<"u"?global:typeof self<"u"?self:typeof window<"u"?window:{})},{}],2:[function(e,t,n){var r=e(1);function i(){}var a={},o=["REJECTED"],s=["FULFILLED"],c=["PENDING"];function u(e){if("function"!=typeof e)throw new TypeError("resolver must be a function");this.state=c,this.queue=[],this.outcome=void 0,e!==i&&p(this,e)}function f(e,t,n){this.promise=e,"function"==typeof t&&(this.onFulfilled=t,this.callFulfilled=this.otherCallFulfilled),"function"==typeof n&&(this.onRejected=n,this.callRejected=this.otherCallRejected)}function d(e,t,n){r((function(){var r;try{r=t(n)}catch(t){return a.reject(e,t)}r===e?a.reject(e,new TypeError("Cannot resolve promise with itself")):a.resolve(e,r)}))}function l(e){var t=e&&e.then;if(e&&("object"==typeof e||"function"==typeof e)&&"function"==typeof t)return function(){t.apply(e,arguments)}}function p(e,t){var n=!1;function r(t){n||(n=!0,a.reject(e,t))}function i(t){n||(n=!0,a.resolve(e,t))}var o=h((function(){t(i,r)}));"error"===o.status&&r(o.value)}function h(e,t){var n={};try{n.value=e(t),n.status="success"}catch(e){n.status="error",n.value=e}return n}t.exports=u,u.prototype.catch=function(e){return this.then(null,e)},u.prototype.then=function(e,t){if("function"!=typeof e&&this.state===s||"function"!=typeof t&&this.state===o)return this;var n=new this.constructor(i);this.state!==c?d(n,this.state===s?e:t,this.outcome):this.queue.push(new f(n,e,t));return n},f.prototype.callFulfilled=function(e){a.resolve(this.promise,e)},f.prototype.otherCallFulfilled=function(e){d(this.promise,this.onFulfilled,e)},f.prototype.callRejected=function(e){a.reject(this.promise,e)},f.prototype.otherCallRejected=function(e){d(this.promise,this.onRejected,e)},a.resolve=function(e,t){var n=h(l,t);if("error"===n.status)return a.reject(e,n.value);var r=n.value;if(r)p(e,r);else{e.state=s,e.outcome=t;for(var i=-1,o=e.queue.length;++i<o;)e.queue[i].callFulfilled(t)}return e},a.reject=function(e,t){e.state=o,e.outcome=t;for(var n=-1,r=e.queue.length;++n<r;)e.queue[n].callRejected(t);return e},u.resolve=function(e){return e instanceof this?e:a.resolve(new this(i),e)},u.reject=function(e){var t=new this(i);return a.reject(t,e)},u.all=function(e){var t=this;if("[object Array]"!==Object.prototype.toString.call(e))return this.reject(new TypeError("must be an array"));var n=e.length,r=!1;if(!n)return this.resolve([]);for(var o=new Array(n),s=0,c=-1,u=new this(i);++c<n;)f(e[c],c);return u;function f(e,i){t.resolve(e).then((function(e){o[i]=e,++s===n&&!r&&(r=!0,a.resolve(u,o))}),(function(e){r||(r=!0,a.reject(u,e))}))}},u.race=function(e){var t=this;if("[object Array]"!==Object.prototype.toString.call(e))return this.reject(new TypeError("must be an array"));var n=e.length,r=!1;if(!n)return this.resolve([]);for(var o=-1,s=new this(i);++o<n;)c(e[o]);return s;function c(e){t.resolve(e).then((function(e){r||(r=!0,a.resolve(s,e))}),(function(e){r||(r=!0,a.reject(s,e))}))}}},{1:1}],3:[function(e,t,n){(function(t){"function"!=typeof t.Promise&&(t.Promise=e(2))}).call(this,typeof global<"u"?global:typeof self<"u"?self:typeof window<"u"?window:{})},{2:2}],4:[function(e,t,n){var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};var i=function(){try{if(typeof indexedDB<"u")return indexedDB;if(typeof webkitIndexedDB<"u")return webkitIndexedDB;if(typeof mozIndexedDB<"u")return mozIndexedDB;if(typeof OIndexedDB<"u")return OIndexedDB;if(typeof msIndexedDB<"u")return msIndexedDB}catch{return}}();function a(e,t){e=e||[],t=t||{};try{return new Blob(e,t)}catch(i){if("TypeError"!==i.name)throw i;for(var n=new(typeof BlobBuilder<"u"?BlobBuilder:typeof MSBlobBuilder<"u"?MSBlobBuilder:typeof MozBlobBuilder<"u"?MozBlobBuilder:WebKitBlobBuilder),r=0;r<e.length;r+=1)n.append(e[r]);return n.getBlob(t.type)}}typeof Promise>"u"&&e(3);var o=Promise;function s(e,t){t&&e.then((function(e){t(null,e)}),(function(e){t(e)}))}function c(e,t,n){"function"==typeof t&&e.then(t),"function"==typeof n&&e.catch(n)}function u(e){return"string"!=typeof e&&(console.warn(e+" used as a key, but it is not a string."),e=String(e)),e}function f(){if(arguments.length&&"function"==typeof arguments[arguments.length-1])return arguments[arguments.length-1]}var d="local-forage-detect-blob-support",l=void 0,p={},h=Object.prototype.toString,b="readonly",m="readwrite";function y(e){return"boolean"==typeof l?o.resolve(l):function(e){return new o((function(t){var n=e.transaction(d,m),r=a([""]);n.objectStore(d).put(r,"key"),n.onabort=function(e){e.preventDefault(),e.stopPropagation(),t(!1)},n.oncomplete=function(){var e=navigator.userAgent.match(/Chrome\/(\d+)/),n=navigator.userAgent.match(/Edge\//);t(n||!e||parseInt(e[1],10)>=43)}})).catch((function(){return!1}))}(e).then((function(e){return l=e}))}function g(e){var t=p[e.name],n={};n.promise=new o((function(e,t){n.resolve=e,n.reject=t})),t.deferredOperations.push(n),t.dbReady?t.dbReady=t.dbReady.then((function(){return n.promise})):t.dbReady=n.promise}function v(e){var t=p[e.name].deferredOperations.pop();if(t)return t.resolve(),t.promise}function w(e,t){var n=p[e.name].deferredOperations.pop();if(n)return n.reject(t),n.promise}function _(e,t){return new o((function(n,r){if(p[e.name]=p[e.name]||{forages:[],db:null,dbReady:null,deferredOperations:[]},e.db){if(!t)return n(e.db);g(e),e.db.close()}var a=[e.name];t&&a.push(e.version);var o=i.open.apply(i,a);t&&(o.onupgradeneeded=function(t){var n=o.result;try{n.createObjectStore(e.storeName),t.oldVersion<=1&&n.createObjectStore(d)}catch(n){if("ConstraintError"!==n.name)throw n;console.warn('The database "'+e.name+'" has been upgraded from version '+t.oldVersion+" to version "+t.newVersion+', but the storage "'+e.storeName+'" already exists.')}}),o.onerror=function(e){e.preventDefault(),r(o.error)},o.onsuccess=function(){var t=o.result;t.onversionchange=function(e){e.target.close()},n(t),v(e)}}))}function E(e){return _(e,!1)}function T(e){return _(e,!0)}function A(e,t){if(!e.db)return!0;var n=!e.db.objectStoreNames.contains(e.storeName),r=e.version<e.db.version,i=e.version>e.db.version;if(r&&(e.version!==t&&console.warn('The database "'+e.name+"\" can't be downgraded from version "+e.db.version+" to version "+e.version+"."),e.version=e.db.version),i||n){if(n){var a=e.db.version+1;a>e.version&&(e.version=a)}return!0}return!1}function R(e){var t=function(e){for(var t=e.length,n=new ArrayBuffer(t),r=new Uint8Array(n),i=0;i<t;i++)r[i]=e.charCodeAt(i);return n}(atob(e.data));return a([t],{type:e.type})}function S(e){return e&&e.__local_forage_encoded_blob}function k(e){var t=this,n=t._initReady().then((function(){var e=p[t._dbInfo.name];if(e&&e.dbReady)return e.dbReady}));return c(n,e,e),n}function I(e,t,n,r){void 0===r&&(r=1);try{var i=e.db.transaction(e.storeName,t);n(null,i)}catch(i){if(r>0&&(!e.db||"InvalidStateError"===i.name||"NotFoundError"===i.name))return o.resolve().then((function(){if(!e.db||"NotFoundError"===i.name&&!e.db.objectStoreNames.contains(e.storeName)&&e.version<=e.db.version)return e.db&&(e.version=e.db.version+1),T(e)})).then((function(){return function(e){g(e);for(var t=p[e.name],n=t.forages,r=0;r<n.length;r++){var i=n[r];i._dbInfo.db&&(i._dbInfo.db.close(),i._dbInfo.db=null)}return e.db=null,E(e).then((function(t){return e.db=t,A(e)?T(e):t})).then((function(r){e.db=t.db=r;for(var i=0;i<n.length;i++)n[i]._dbInfo.db=r})).catch((function(t){throw w(e,t),t}))}(e).then((function(){I(e,t,n,r-1)}))})).catch(n);n(i)}}var O={_driver:"asyncStorage",_initStorage:function(e){var t=this,n={db:null};if(e)for(var r in e)n[r]=e[r];var i=p[n.name];i||(i={forages:[],db:null,dbReady:null,deferredOperations:[]},p[n.name]=i),i.forages.push(t),t._initReady||(t._initReady=t.ready,t.ready=k);var a=[];function s(){return o.resolve()}for(var c=0;c<i.forages.length;c++){var u=i.forages[c];u!==t&&a.push(u._initReady().catch(s))}var f=i.forages.slice(0);return o.all(a).then((function(){return n.db=i.db,E(n)})).then((function(e){return n.db=e,A(n,t._defaultConfig.version)?T(n):e})).then((function(e){n.db=i.db=e,t._dbInfo=n;for(var r=0;r<f.length;r++){var a=f[r];a!==t&&(a._dbInfo.db=n.db,a._dbInfo.version=n.version)}}))},_support:function(){try{if(!i||!i.open)return!1;var e=typeof openDatabase<"u"&&/(Safari|iPhone|iPad|iPod)/.test(navigator.userAgent)&&!/Chrome/.test(navigator.userAgent)&&!/BlackBerry/.test(navigator.platform),t="function"==typeof fetch&&-1!==fetch.toString().indexOf("[native code");return(!e||t)&&typeof indexedDB<"u"&&typeof IDBKeyRange<"u"}catch{return!1}}(),iterate:function(e,t){var n=this,r=new o((function(t,r){n.ready().then((function(){I(n._dbInfo,b,(function(i,a){if(i)return r(i);try{var o=a.objectStore(n._dbInfo.storeName).openCursor(),s=1;o.onsuccess=function(){var n=o.result;if(n){var r=n.value;S(r)&&(r=R(r));var i=e(r,n.key,s++);void 0!==i?t(i):n.continue()}else t()},o.onerror=function(){r(o.error)}}catch(e){r(e)}}))})).catch(r)}));return s(r,t),r},getItem:function(e,t){var n=this;e=u(e);var r=new o((function(t,r){n.ready().then((function(){I(n._dbInfo,b,(function(i,a){if(i)return r(i);try{var o=a.objectStore(n._dbInfo.storeName).get(e);o.onsuccess=function(){var e=o.result;void 0===e&&(e=null),S(e)&&(e=R(e)),t(e)},o.onerror=function(){r(o.error)}}catch(e){r(e)}}))})).catch(r)}));return s(r,t),r},setItem:function(e,t,n){var r=this;e=u(e);var i=new o((function(n,i){var a;r.ready().then((function(){return a=r._dbInfo,"[object Blob]"===h.call(t)?y(a.db).then((function(e){return e?t:function(e){return new o((function(t,n){var r=new FileReader;r.onerror=n,r.onloadend=function(n){var r=btoa(n.target.result||"");t({__local_forage_encoded_blob:!0,data:r,type:e.type})},r.readAsBinaryString(e)}))}(t)})):t})).then((function(t){I(r._dbInfo,m,(function(a,o){if(a)return i(a);try{var s=o.objectStore(r._dbInfo.storeName);null===t&&(t=void 0);var c=s.put(t,e);o.oncomplete=function(){void 0===t&&(t=null),n(t)},o.onabort=o.onerror=function(){var e=c.error?c.error:c.transaction.error;i(e)}}catch(e){i(e)}}))})).catch(i)}));return s(i,n),i},removeItem:function(e,t){var n=this;e=u(e);var r=new o((function(t,r){n.ready().then((function(){I(n._dbInfo,m,(function(i,a){if(i)return r(i);try{var o=a.objectStore(n._dbInfo.storeName).delete(e);a.oncomplete=function(){t()},a.onerror=function(){r(o.error)},a.onabort=function(){var e=o.error?o.error:o.transaction.error;r(e)}}catch(e){r(e)}}))})).catch(r)}));return s(r,t),r},clear:function(e){var t=this,n=new o((function(e,n){t.ready().then((function(){I(t._dbInfo,m,(function(r,i){if(r)return n(r);try{var a=i.objectStore(t._dbInfo.storeName).clear();i.oncomplete=function(){e()},i.onabort=i.onerror=function(){var e=a.error?a.error:a.transaction.error;n(e)}}catch(e){n(e)}}))})).catch(n)}));return s(n,e),n},length:function(e){var t=this,n=new o((function(e,n){t.ready().then((function(){I(t._dbInfo,b,(function(r,i){if(r)return n(r);try{var a=i.objectStore(t._dbInfo.storeName).count();a.onsuccess=function(){e(a.result)},a.onerror=function(){n(a.error)}}catch(e){n(e)}}))})).catch(n)}));return s(n,e),n},key:function(e,t){var n=this,r=new o((function(t,r){e<0?t(null):n.ready().then((function(){I(n._dbInfo,b,(function(i,a){if(i)return r(i);try{var o=a.objectStore(n._dbInfo.storeName),s=!1,c=o.openKeyCursor();c.onsuccess=function(){var n=c.result;n?0===e||s?t(n.key):(s=!0,n.advance(e)):t(null)},c.onerror=function(){r(c.error)}}catch(e){r(e)}}))})).catch(r)}));return s(r,t),r},keys:function(e){var t=this,n=new o((function(e,n){t.ready().then((function(){I(t._dbInfo,b,(function(r,i){if(r)return n(r);try{var a=i.objectStore(t._dbInfo.storeName).openKeyCursor(),o=[];a.onsuccess=function(){var t=a.result;t?(o.push(t.key),t.continue()):e(o)},a.onerror=function(){n(a.error)}}catch(e){n(e)}}))})).catch(n)}));return s(n,e),n},dropInstance:function(e,t){t=f.apply(this,arguments);var n,r=this.config();if((e="function"!=typeof e&&e||{}).name||(e.name=e.name||r.name,e.storeName=e.storeName||r.storeName),e.name){var a=e.name===r.name&&this._dbInfo.db?o.resolve(this._dbInfo.db):E(e).then((function(t){var n=p[e.name],r=n.forages;n.db=t;for(var i=0;i<r.length;i++)r[i]._dbInfo.db=t;return t}));n=e.storeName?a.then((function(t){if(t.objectStoreNames.contains(e.storeName)){var n=t.version+1;g(e);var r=p[e.name],a=r.forages;t.close();for(var s=0;s<a.length;s++){var c=a[s];c._dbInfo.db=null,c._dbInfo.version=n}var u=new o((function(t,r){var a=i.open(e.name,n);a.onerror=function(e){a.result.close(),r(e)},a.onupgradeneeded=function(){a.result.deleteObjectStore(e.storeName)},a.onsuccess=function(){var e=a.result;e.close(),t(e)}}));return u.then((function(e){r.db=e;for(var t=0;t<a.length;t++){var n=a[t];n._dbInfo.db=e,v(n._dbInfo)}})).catch((function(t){throw(w(e,t)||o.resolve()).catch((function(){})),t}))}})):a.then((function(t){g(e);var n=p[e.name],r=n.forages;t.close();for(var a=0;a<r.length;a++){r[a]._dbInfo.db=null}var s=new o((function(t,n){var r=i.deleteDatabase(e.name);r.onerror=function(){var e=r.result;e&&e.close(),n(r.error)},r.onblocked=function(){console.warn('dropInstance blocked for database "'+e.name+'" until all open connections are closed')},r.onsuccess=function(){var e=r.result;e&&e.close(),t(e)}}));return s.then((function(e){n.db=e;for(var t=0;t<r.length;t++){v(r[t]._dbInfo)}})).catch((function(t){throw(w(e,t)||o.resolve()).catch((function(){})),t}))}))}else n=o.reject("Invalid arguments");return s(n,t),n}};var x="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",C=/^~~local_forage_type~([^~]+)~/,M="__lfsc__:",P="arbf",N="blob",B="si08",D="ui08",F="uic8",L="si16",U="si32",j="ur16",q="ui32",z="fl32",H="fl64",G=Object.prototype.toString;function V(e){var t,n,r,i,a,o=.75*e.length,s=e.length,c=0;"="===e[e.length-1]&&(o--,"="===e[e.length-2]&&o--);var u=new ArrayBuffer(o),f=new Uint8Array(u);for(t=0;t<s;t+=4)n=x.indexOf(e[t]),r=x.indexOf(e[t+1]),i=x.indexOf(e[t+2]),a=x.indexOf(e[t+3]),f[c++]=n<<2|r>>4,f[c++]=(15&r)<<4|i>>2,f[c++]=(3&i)<<6|63&a;return u}function K(e){var t,n=new Uint8Array(e),r="";for(t=0;t<n.length;t+=3)r+=x[n[t]>>2],r+=x[(3&n[t])<<4|n[t+1]>>4],r+=x[(15&n[t+1])<<2|n[t+2]>>6],r+=x[63&n[t+2]];return n.length%3==2?r=r.substring(0,r.length-1)+"=":n.length%3==1&&(r=r.substring(0,r.length-2)+"=="),r}var W={serialize:function(e,t){var n="";if(e&&(n=G.call(e)),e&&("[object ArrayBuffer]"===n||e.buffer&&"[object ArrayBuffer]"===G.call(e.buffer))){var r,i=M;e instanceof ArrayBuffer?(r=e,i+=P):(r=e.buffer,"[object Int8Array]"===n?i+=B:"[object Uint8Array]"===n?i+=D:"[object Uint8ClampedArray]"===n?i+=F:"[object Int16Array]"===n?i+=L:"[object Uint16Array]"===n?i+=j:"[object Int32Array]"===n?i+=U:"[object Uint32Array]"===n?i+=q:"[object Float32Array]"===n?i+=z:"[object Float64Array]"===n?i+=H:t(new Error("Failed to get type for BinaryArray"))),t(i+K(r))}else if("[object Blob]"===n){var a=new FileReader;a.onload=function(){var n="~~local_forage_type~"+e.type+"~"+K(this.result);t(M+N+n)},a.readAsArrayBuffer(e)}else try{t(JSON.stringify(e))}catch(n){console.error("Couldn't convert value into a JSON string: ",e),t(null,n)}},deserialize:function(e){if(e.substring(0,9)!==M)return JSON.parse(e);var t,n=e.substring(13),r=e.substring(9,13);if(r===N&&C.test(n)){var i=n.match(C);t=i[1],n=n.substring(i[0].length)}var o=V(n);switch(r){case P:return o;case N:return a([o],{type:t});case B:return new Int8Array(o);case D:return new Uint8Array(o);case F:return new Uint8ClampedArray(o);case L:return new Int16Array(o);case j:return new Uint16Array(o);case U:return new Int32Array(o);case q:return new Uint32Array(o);case z:return new Float32Array(o);case H:return new Float64Array(o);default:throw new Error("Unkown type: "+r)}},stringToBuffer:V,bufferToString:K};function X(e,t,n,r){e.executeSql("CREATE TABLE IF NOT EXISTS "+t.storeName+" (id INTEGER PRIMARY KEY, key unique, value)",[],n,r)}function $(e,t,n,r,i,a){e.executeSql(n,r,i,(function(e,o){o.code===o.SYNTAX_ERR?e.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name = ?",[t.storeName],(function(e,s){s.rows.length?a(e,o):X(e,t,(function(){e.executeSql(n,r,i,a)}),a)}),a):a(e,o)}),a)}function J(e,t,n,r){var i=this;e=u(e);var a=new o((function(a,o){i.ready().then((function(){void 0===t&&(t=null);var s=t,c=i._dbInfo;c.serializer.serialize(t,(function(t,u){u?o(u):c.db.transaction((function(n){$(n,c,"INSERT OR REPLACE INTO "+c.storeName+" (key, value) VALUES (?, ?)",[e,t],(function(){a(s)}),(function(e,t){o(t)}))}),(function(t){if(t.code===t.QUOTA_ERR){if(r>0)return void a(J.apply(i,[e,s,n,r-1]));o(t)}}))}))})).catch(o)}));return s(a,n),a}var Y={_driver:"webSQLStorage",_initStorage:function(e){var t=this,n={db:null};if(e)for(var r in e)n[r]="string"!=typeof e[r]?e[r].toString():e[r];var i=new o((function(e,r){try{n.db=openDatabase(n.name,String(n.version),n.description,n.size)}catch(e){return r(e)}n.db.transaction((function(i){X(i,n,(function(){t._dbInfo=n,e()}),(function(e,t){r(t)}))}),r)}));return n.serializer=W,i},_support:"function"==typeof openDatabase,iterate:function(e,t){var n=this,r=new o((function(t,r){n.ready().then((function(){var i=n._dbInfo;i.db.transaction((function(n){$(n,i,"SELECT * FROM "+i.storeName,[],(function(n,r){for(var a=r.rows,o=a.length,s=0;s<o;s++){var c=a.item(s),u=c.value;if(u&&(u=i.serializer.deserialize(u)),void 0!==(u=e(u,c.key,s+1)))return void t(u)}t()}),(function(e,t){r(t)}))}))})).catch(r)}));return s(r,t),r},getItem:function(e,t){var n=this;e=u(e);var r=new o((function(t,r){n.ready().then((function(){var i=n._dbInfo;i.db.transaction((function(n){$(n,i,"SELECT * FROM "+i.storeName+" WHERE key = ? LIMIT 1",[e],(function(e,n){var r=n.rows.length?n.rows.item(0).value:null;r&&(r=i.serializer.deserialize(r)),t(r)}),(function(e,t){r(t)}))}))})).catch(r)}));return s(r,t),r},setItem:function(e,t,n){return J.apply(this,[e,t,n,1])},removeItem:function(e,t){var n=this;e=u(e);var r=new o((function(t,r){n.ready().then((function(){var i=n._dbInfo;i.db.transaction((function(n){$(n,i,"DELETE FROM "+i.storeName+" WHERE key = ?",[e],(function(){t()}),(function(e,t){r(t)}))}))})).catch(r)}));return s(r,t),r},clear:function(e){var t=this,n=new o((function(e,n){t.ready().then((function(){var r=t._dbInfo;r.db.transaction((function(t){$(t,r,"DELETE FROM "+r.storeName,[],(function(){e()}),(function(e,t){n(t)}))}))})).catch(n)}));return s(n,e),n},length:function(e){var t=this,n=new o((function(e,n){t.ready().then((function(){var r=t._dbInfo;r.db.transaction((function(t){$(t,r,"SELECT COUNT(key) as c FROM "+r.storeName,[],(function(t,n){var r=n.rows.item(0).c;e(r)}),(function(e,t){n(t)}))}))})).catch(n)}));return s(n,e),n},key:function(e,t){var n=this,r=new o((function(t,r){n.ready().then((function(){var i=n._dbInfo;i.db.transaction((function(n){$(n,i,"SELECT key FROM "+i.storeName+" WHERE id = ? LIMIT 1",[e+1],(function(e,n){var r=n.rows.length?n.rows.item(0).key:null;t(r)}),(function(e,t){r(t)}))}))})).catch(r)}));return s(r,t),r},keys:function(e){var t=this,n=new o((function(e,n){t.ready().then((function(){var r=t._dbInfo;r.db.transaction((function(t){$(t,r,"SELECT key FROM "+r.storeName,[],(function(t,n){for(var r=[],i=0;i<n.rows.length;i++)r.push(n.rows.item(i).key);e(r)}),(function(e,t){n(t)}))}))})).catch(n)}));return s(n,e),n},dropInstance:function(e,t){t=f.apply(this,arguments);var n=this.config();(e="function"!=typeof e&&e||{}).name||(e.name=e.name||n.name,e.storeName=e.storeName||n.storeName);var r,i=this;return r=e.name?new o((function(t){var r;r=e.name===n.name?i._dbInfo.db:openDatabase(e.name,"","",0),e.storeName?t({db:r,storeNames:[e.storeName]}):t(function(e){return new o((function(t,n){e.transaction((function(r){r.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name <> '__WebKitDatabaseInfoTable__'",[],(function(n,r){for(var i=[],a=0;a<r.rows.length;a++)i.push(r.rows.item(a).name);t({db:e,storeNames:i})}),(function(e,t){n(t)}))}),(function(e){n(e)}))}))}(r))})).then((function(e){return new o((function(t,n){e.db.transaction((function(r){function i(e){return new o((function(t,n){r.executeSql("DROP TABLE IF EXISTS "+e,[],(function(){t()}),(function(e,t){n(t)}))}))}for(var a=[],s=0,c=e.storeNames.length;s<c;s++)a.push(i(e.storeNames[s]));o.all(a).then((function(){t()})).catch((function(e){n(e)}))}),(function(e){n(e)}))}))})):o.reject("Invalid arguments"),s(r,t),r}};function Q(e,t){var n=e.name+"/";return e.storeName!==t.storeName&&(n+=e.storeName+"/"),n}function Z(){return!function(){var e="_localforage_support_test";try{return localStorage.setItem(e,!0),localStorage.removeItem(e),!1}catch{return!0}}()||localStorage.length>0}var ee={_driver:"localStorageWrapper",_initStorage:function(e){var t={};if(e)for(var n in e)t[n]=e[n];return t.keyPrefix=Q(e,this._defaultConfig),Z()?(this._dbInfo=t,t.serializer=W,o.resolve()):o.reject()},_support:function(){try{return typeof localStorage<"u"&&"setItem"in localStorage&&!!localStorage.setItem}catch{return!1}}(),iterate:function(e,t){var n=this,r=n.ready().then((function(){for(var t=n._dbInfo,r=t.keyPrefix,i=r.length,a=localStorage.length,o=1,s=0;s<a;s++){var c=localStorage.key(s);if(0===c.indexOf(r)){var u=localStorage.getItem(c);if(u&&(u=t.serializer.deserialize(u)),void 0!==(u=e(u,c.substring(i),o++)))return u}}}));return s(r,t),r},getItem:function(e,t){var n=this;e=u(e);var r=n.ready().then((function(){var t=n._dbInfo,r=localStorage.getItem(t.keyPrefix+e);return r&&(r=t.serializer.deserialize(r)),r}));return s(r,t),r},setItem:function(e,t,n){var r=this;e=u(e);var i=r.ready().then((function(){void 0===t&&(t=null);var n=t;return new o((function(i,a){var o=r._dbInfo;o.serializer.serialize(t,(function(t,r){if(r)a(r);else try{localStorage.setItem(o.keyPrefix+e,t),i(n)}catch(e){("QuotaExceededError"===e.name||"NS_ERROR_DOM_QUOTA_REACHED"===e.name)&&a(e),a(e)}}))}))}));return s(i,n),i},removeItem:function(e,t){var n=this;e=u(e);var r=n.ready().then((function(){var t=n._dbInfo;localStorage.removeItem(t.keyPrefix+e)}));return s(r,t),r},clear:function(e){var t=this,n=t.ready().then((function(){for(var e=t._dbInfo.keyPrefix,n=localStorage.length-1;n>=0;n--){var r=localStorage.key(n);0===r.indexOf(e)&&localStorage.removeItem(r)}}));return s(n,e),n},length:function(e){var t=this.keys().then((function(e){return e.length}));return s(t,e),t},key:function(e,t){var n=this,r=n.ready().then((function(){var t,r=n._dbInfo;try{t=localStorage.key(e)}catch{t=null}return t&&(t=t.substring(r.keyPrefix.length)),t}));return s(r,t),r},keys:function(e){var t=this,n=t.ready().then((function(){for(var e=t._dbInfo,n=localStorage.length,r=[],i=0;i<n;i++){var a=localStorage.key(i);0===a.indexOf(e.keyPrefix)&&r.push(a.substring(e.keyPrefix.length))}return r}));return s(n,e),n},dropInstance:function(e,t){if(t=f.apply(this,arguments),!(e="function"!=typeof e&&e||{}).name){var n=this.config();e.name=e.name||n.name,e.storeName=e.storeName||n.storeName}var r,i=this;return r=e.name?new o((function(t){e.storeName?t(Q(e,i._defaultConfig)):t(e.name+"/")})).then((function(e){for(var t=localStorage.length-1;t>=0;t--){var n=localStorage.key(t);0===n.indexOf(e)&&localStorage.removeItem(n)}})):o.reject("Invalid arguments"),s(r,t),r}},te=function(e,t){return e===t||"number"==typeof e&&"number"==typeof t&&isNaN(e)&&isNaN(t)},ne=function(e,t){for(var n=e.length,r=0;r<n;){if(te(e[r],t))return!0;r++}return!1},re=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)},ie={},ae={},oe={INDEXEDDB:O,WEBSQL:Y,LOCALSTORAGE:ee},se=[oe.INDEXEDDB._driver,oe.WEBSQL._driver,oe.LOCALSTORAGE._driver],ce=["dropInstance"],ue=["clear","getItem","iterate","key","keys","length","removeItem","setItem"].concat(ce),fe={description:"",driver:se.slice(),name:"localforage",size:4980736,storeName:"keyvaluepairs",version:1};function de(e,t){e[t]=function(){var n=arguments;return e.ready().then((function(){return e[t].apply(e,n)}))}}function le(){for(var e=1;e<arguments.length;e++){var t=arguments[e];if(t)for(var n in t)t.hasOwnProperty(n)&&(re(t[n])?arguments[0][n]=t[n].slice():arguments[0][n]=t[n])}return arguments[0]}var pe=function(){function e(t){for(var n in function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),oe)if(oe.hasOwnProperty(n)){var r=oe[n],i=r._driver;this[n]=i,ie[i]||this.defineDriver(r)}this._defaultConfig=le({},fe),this._config=le({},this._defaultConfig,t),this._driverSet=null,this._initDriver=null,this._ready=!1,this._dbInfo=null,this._wrapLibraryMethodsWithReady(),this.setDriver(this._config.driver).catch((function(){}))}return e.prototype.config=function(e){if("object"===(typeof e>"u"?"undefined":r(e))){if(this._ready)return new Error("Can't call config() after localforage has been used.");for(var t in e){if("storeName"===t&&(e[t]=e[t].replace(/\W/g,"_")),"version"===t&&"number"!=typeof e[t])return new Error("Database version must be a number.");this._config[t]=e[t]}return!("driver"in e)||!e.driver||this.setDriver(this._config.driver)}return"string"==typeof e?this._config[e]:this._config},e.prototype.defineDriver=function(e,t,n){var r=new o((function(t,n){try{var r=e._driver,i=new Error("Custom driver not compliant; see https://mozilla.github.io/localForage/#definedriver");if(!e._driver)return void n(i);for(var a=ue.concat("_initStorage"),c=0,u=a.length;c<u;c++){var f=a[c];if((!ne(ce,f)||e[f])&&"function"!=typeof e[f])return void n(i)}!function(){for(var t=function(e){return function(){var t=new Error("Method "+e+" is not implemented by the current driver"),n=o.reject(t);return s(n,arguments[arguments.length-1]),n}},n=0,r=ce.length;n<r;n++){var i=ce[n];e[i]||(e[i]=t(i))}}();var d=function(n){ie[r]&&console.info("Redefining LocalForage driver: "+r),ie[r]=e,ae[r]=n,t()};"_support"in e?e._support&&"function"==typeof e._support?e._support().then(d,n):d(!!e._support):d(!0)}catch(e){n(e)}}));return c(r,t,n),r},e.prototype.driver=function(){return this._driver||null},e.prototype.getDriver=function(e,t,n){var r=ie[e]?o.resolve(ie[e]):o.reject(new Error("Driver not found."));return c(r,t,n),r},e.prototype.getSerializer=function(e){var t=o.resolve(W);return c(t,e),t},e.prototype.ready=function(e){var t=this,n=t._driverSet.then((function(){return null===t._ready&&(t._ready=t._initDriver()),t._ready}));return c(n,e,e),n},e.prototype.setDriver=function(e,t,n){var r=this;re(e)||(e=[e]);var i=this._getSupportedDrivers(e);function a(){r._config.driver=r.driver()}function s(e){return r._extend(e),a(),r._ready=r._initStorage(r._config),r._ready}var u=null!==this._driverSet?this._driverSet.catch((function(){return o.resolve()})):o.resolve();return this._driverSet=u.then((function(){var e=i[0];return r._dbInfo=null,r._ready=null,r.getDriver(e).then((function(e){r._driver=e._driver,a(),r._wrapLibraryMethodsWithReady(),r._initDriver=function(e){return function(){var t=0;return function n(){for(;t<e.length;){var i=e[t];return t++,r._dbInfo=null,r._ready=null,r.getDriver(i).then(s).catch(n)}a();var c=new Error("No available storage method found.");return r._driverSet=o.reject(c),r._driverSet}()}}(i)}))})).catch((function(){a();var e=new Error("No available storage method found.");return r._driverSet=o.reject(e),r._driverSet})),c(this._driverSet,t,n),this._driverSet},e.prototype.supports=function(e){return!!ae[e]},e.prototype._extend=function(e){le(this,e)},e.prototype._getSupportedDrivers=function(e){for(var t=[],n=0,r=e.length;n<r;n++){var i=e[n];this.supports(i)&&t.push(i)}return t},e.prototype._wrapLibraryMethodsWithReady=function(){for(var e=0,t=ue.length;e<t;e++)de(this,ue[e])},e.prototype.createInstance=function(t){return new e(t)},e}(),he=new pe;t.exports=he},{3:3}]},{},[4])(4)}))})),jL=DL(((e,t)=>{!function(n,r){"object"==typeof e&&typeof t<"u"?r(e):"function"==typeof define&&define.amd?define("localforage-driver-memory",["exports"],r):r(n.LocalforageDriverMemory={})}(typeof self<"u"?self:e,(function(e){var t=/^~~local_forage_type~([^~]+)~/,n=Object.prototype.toString;function r(e){var t=.75*e.length,n=e.length;"="===e[e.length-1]&&(t--,"="===e[e.length-2]&&t--);for(var r=new ArrayBuffer(t),i=new Uint8Array(r),a=0,o=0;a<n;a+=4){var s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".indexOf(e[a]),c="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".indexOf(e[a+1]),u="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".indexOf(e[a+2]),f="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".indexOf(e[a+3]);i[o++]=s<<2|c>>4,i[o++]=(15&c)<<4|u>>2,i[o++]=(3&u)<<6|63&f}return r}function i(e){for(var t=new Uint8Array(e),n="",r=0;r<t.length;r+=3)n+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[t[r]>>2],n+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[(3&t[r])<<4|t[r+1]>>4],n+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[(15&t[r+1])<<2|t[r+2]>>6],n+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[63&t[r+2]];return t.length%3==2?n=n.substring(0,n.length-1)+"=":t.length%3==1&&(n=n.substring(0,n.length-2)+"=="),n}function a(e){var t,n;if(null===e||"object"!=typeof e||"isActiveClone"in e)return e;var r=e instanceof Date?new Date(e):e.constructor();try{for(var i=function(e){var t="function"==typeof Symbol&&e[Symbol.iterator],n=0;return t?t.call(e):{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}}}(Object.keys(e)),o=i.next();!o.done;o=i.next()){var s=o.value;Object.prototype.hasOwnProperty.call(e,s)&&(e.isActiveClone=null,r[s]=a(e[s]),delete e.isActiveClone)}}catch(e){t={error:e}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(t)throw t.error}}return r}function o(e,t){return(e.name||t.name)+"/"+(e.storeName||t.storeName)+"/"}function s(e,t){t&&e.then((function(e){t(null,e)}),(function(e){t(e)}))}function c(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];if(arguments.length&&"function"==typeof arguments[arguments.length-1])return arguments[arguments.length-1]}function u(e,t){var n,r=this;if(t=c.apply(this,arguments),!(e="function"!=typeof e&&e||{}).name){var i=this.config();e.name=e.name||i.name,e.storeName=e.storeName||i.storeName}return n=e.name?new Promise((function(t){e.storeName?t(o(e,r._defaultConfig)):t(e.name+"/")})):Promise.reject("Invalid arguments"),{promise:n,callback:t}}function f(e){return"string"!=typeof e&&(console.warn(e+" used as a key, but it is not a string."),e=String(e)),e}var d={bufferToString:i,deserialize:function(e){if("__lfsc__:"!==e.substring(0,9))return JSON.parse(e);var n,i=e.substring(13),a=e.substring(9,13);if("blob"===a&&t.test(i)){var o=i.match(t);n=o[1],i=i.substring(o[0].length)}var s=r(i);switch(a){case"arbf":return s;case"blob":return function(e,t){e=e||[],t=t||{};try{return new Blob(e,t)}catch(i){if("TypeError"!==i.name)throw i;for(var n=new(typeof BlobBuilder<"u"?BlobBuilder:typeof MSBlobBuilder<"u"?MSBlobBuilder:typeof MozBlobBuilder<"u"?MozBlobBuilder:WebKitBlobBuilder),r=0;r<e.length;r+=1)n.append(e[r]);return n.getBlob(t.type)}}([s],{type:n});case"si08":return new Int8Array(s);case"ui08":return new Uint8Array(s);case"uic8":return new Uint8ClampedArray(s);case"si16":return new Int16Array(s);case"ur16":return new Uint16Array(s);case"si32":return new Int32Array(s);case"ui32":return new Uint32Array(s);case"fl32":return new Float32Array(s);case"fl64":return new Float64Array(s);default:throw new Error("Unkown type: "+a)}},serialize:function(e,t){var r="";if(e&&(r=n.call(e)),e&&("[object ArrayBuffer]"===r||e.buffer&&"[object ArrayBuffer]"===n.call(e.buffer))){var a=void 0,o="__lfsc__:";e instanceof ArrayBuffer?(a=e,o+="arbf"):(a=e.buffer,"[object Int8Array]"===r?o+="si08":"[object Uint8Array]"===r?o+="ui08":"[object Uint8ClampedArray]"===r?o+="uic8":"[object Int16Array]"===r?o+="si16":"[object Uint16Array]"===r?o+="ur16":"[object Int32Array]"===r?o+="si32":"[object Uint32Array]"===r?o+="ui32":"[object Float32Array]"===r?o+="fl32":"[object Float64Array]"===r?o+="fl64":t(new Error("Failed to get type for BinaryArray"))),t(o+i(a))}else if("[object Blob]"===r){var s=new FileReader;s.onload=function(){var n="~~local_forage_type~"+e.type+"~"+i(this.result);t("__lfsc__:blob"+n)},s.readAsArrayBuffer(e)}else try{t(JSON.stringify(e))}catch(n){console.error("Couldn't convert value into a JSON string: ",e),t(null,n)}},stringToBuffer:r},l={},p=function(){function e(e){this.kp=e,this.data={}}return e.resolve=function(t){return l[t]||(l[t]=new e(t)),l[t]},e.prototype.clear=function(){this.data={}},e.prototype.drop=function(){this.clear(),delete l[this.kp]},e.prototype.get=function(e){return this.data[e]},e.prototype.key=function(e){return this.keys()[e]},e.prototype.keys=function(){return Object.keys(this.data)},e.prototype.rm=function(e){delete this.data[e]},e.prototype.set=function(e,t){this.data[e]=t},e}();e._support=!0,e._driver="localforage-driver-memory",e._initStorage=function(e){var t=e?a(e):{},n=o(t,this._defaultConfig),r=p.resolve(n);return this._dbInfo=t,this._dbInfo.serializer=d,this._dbInfo.keyPrefix=n,this._dbInfo.mStore=r,Promise.resolve()},e.clear=function(e){var t=this,n=this.ready().then((function(){t._dbInfo.mStore.clear()}));return s(n,e),n},e.dropInstance=function(e,t){var n=u.apply(this,arguments),r=n.promise,i=n.callback,a=r.then((function(e){p.resolve(e).drop()}));return s(a,i),r},e.getItem=function(e,t){var n=this;e=f(e);var r=this.ready().then((function(){var t=n._dbInfo.mStore.get(e);return null==t?null:n._dbInfo.serializer.deserialize(t)}));return s(r,t),r},e.iterate=function(e,t){var n=this,r=this.ready().then((function(){for(var t=n._dbInfo.mStore,r=t.keys(),i=0;i<r.length;i++){var a=t.get(r[i]);if(a&&(a=n._dbInfo.serializer.deserialize(a)),void 0!==(a=e(a,r[i],i+1)))return a}}));return s(r,t),r},e.key=function(e,t){var n=this,r=this.ready().then((function(){var t;try{void 0===(t=n._dbInfo.mStore.key(e))&&(t=null)}catch{t=null}return t}));return s(r,t),r},e.keys=function(e){var t=this,n=this.ready().then((function(){return t._dbInfo.mStore.keys()}));return s(n,e),n},e.length=function(e){var t=this.keys().then((function(e){return e.length}));return s(t,e),t},e.removeItem=function(e,t){var n=this;e=f(e);var r=this.ready().then((function(){n._dbInfo.mStore.rm(e)}));return s(r,t),r},e.setItem=function(e,t,n){var r=this;e=f(e);var i=this.ready().then((function(){void 0===t&&(t=null);var n=t;return new Promise((function(i,a){r._dbInfo.serializer.serialize(t,(function(t,o){if(o)a(o);else try{r._dbInfo.mStore.set(e,t),i(n)}catch(e){a(e)}}))}))}));return s(i,n),i},Object.defineProperty(e,"__esModule",{value:!0})}))})),qL=FL(UL()),zL=FL(jL()),HL={display:"none",position:"fixed",top:"0",right:"0",width:"100%",height:"100%",borderRadius:"0",border:"none",zIndex:"2147483647"};var GL=function(e,t){return Object.assign(bF,t),e}(SL,{platform:"web",sdkName:"magic-sdk",version:"13.6.2",defaultEndpoint:"https://auth.magic.link/",ViewController:class extends IL{constructor(){super(...arguments),this.activeElement=null}init(){this.test="hello",this.iframe=new Promise((e=>{let t=()=>{if(function(e){let t=[].slice.call(document.querySelectorAll(".magic-iframe"));return Boolean(t.find((t=>t.src.includes(e))))}(encodeURIComponent(this.parameters)))new vF(GB.DuplicateIframe,"Duplicate iframes found.").log();else{let t=document.createElement("iframe");t.classList.add("magic-iframe"),t.dataset.magicIframeLabel=yL(this.endpoint).host,t.title="Secure Modal",t.src=yL(`/send?params=${encodeURIComponent(this.parameters)}`,this.endpoint).href,function(e){for(let[t,n]of Object.entries(HL))e.style[t]=n}(t),document.body.appendChild(t),e(t)}};["loaded","interactive","complete"].includes(document.readyState)?t():window.addEventListener("load",t,!1)})),window.addEventListener("message",(e=>{var t;if(e.origin===this.endpoint&&e.data&&e.data.msgType&&this.messageHandlers.size){e.data.response=null!=(t=e.data.response)?t:{};for(let t of this.messageHandlers.values())t(e)}}))}showOverlay(){return LL(this,null,(function*(){let e=yield this.iframe;e.style.display="block",this.activeElement=document.activeElement,e.focus()}))}hideOverlay(){return LL(this,null,(function*(){var e;(yield this.iframe).style.display="none",null!=(e=this.activeElement)&&e.focus&&this.activeElement.focus(),this.activeElement=null}))}_post(e){return LL(this,null,(function*(){let t=yield this.iframe;if(!t||!t.contentWindow)throw new yF(HB.ModalNotReady,"Modal is not ready.");t.contentWindow.postMessage(e,this.endpoint)}))}},configureStorage:()=>LL(void 0,null,(function*(){let e=qL.default.createInstance({name:"MagicAuthLocalStorageDB",storeName:"MagicAuthLocalStorage"});return yield e.defineDriver(zL),yield e.setDriver([qL.default.INDEXEDDB,qL.default.LOCALSTORAGE,zL._driver]),e}))}),VL=(e=>(e.LoginWithOIDC="magic_auth_login_with_oidc",e))(VL||{}),KL=class extends _L.Internal{constructor(){super(...arguments),this.name="openid",this.config={}}loginWithOIDC(e){let t=this.utils.createJsonRpcRequestPayload("magic_auth_login_with_oidc",[e]);return this.request(t)}};function WL(e,t){return function(){return e.apply(t,arguments)}}const{toString:XL}=Object.prototype,{getPrototypeOf:$L}=Object,JL=(e=>t=>{const n=XL.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),YL=e=>(e=e.toLowerCase(),t=>JL(t)===e),QL=e=>t=>typeof t===e,{isArray:ZL}=Array,eU=QL("undefined");const tU=YL("ArrayBuffer");const nU=QL("string"),rU=QL("function"),iU=QL("number"),aU=e=>null!==e&&"object"==typeof e,oU=e=>{if("object"!==JL(e))return!1;const t=$L(e);return!(null!==t&&t!==Object.prototype&&null!==Object.getPrototypeOf(t)||Symbol.toStringTag in e||Symbol.iterator in e)},sU=YL("Date"),cU=YL("File"),uU=YL("Blob"),fU=YL("FileList"),dU=YL("URLSearchParams");function lU(e,t,{allOwnKeys:n=!1}={}){if(null==e)return;let r,i;if("object"!=typeof e&&(e=[e]),ZL(e))for(r=0,i=e.length;r<i;r++)t.call(null,e[r],r,e);else{const i=n?Object.getOwnPropertyNames(e):Object.keys(e),a=i.length;let o;for(r=0;r<a;r++)o=i[r],t.call(null,e[o],o,e)}}function pU(e,t){t=t.toLowerCase();const n=Object.keys(e);let r,i=n.length;for(;i-- >0;)if(r=n[i],t===r.toLowerCase())return r;return null}const hU="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:global,bU=e=>!eU(e)&&e!==hU;const mU=(e=>t=>e&&t instanceof e)("undefined"!=typeof Uint8Array&&$L(Uint8Array)),yU=YL("HTMLFormElement"),gU=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),vU=YL("RegExp"),wU=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};lU(n,((n,i)=>{!1!==t(n,i,e)&&(r[i]=n)})),Object.defineProperties(e,r)},_U="abcdefghijklmnopqrstuvwxyz",EU="0123456789",TU={DIGIT:EU,ALPHA:_U,ALPHA_DIGIT:_U+_U.toUpperCase()+EU};const AU=YL("AsyncFunction");var RU={isArray:ZL,isArrayBuffer:tU,isBuffer:function(e){return null!==e&&!eU(e)&&null!==e.constructor&&!eU(e.constructor)&&rU(e.constructor.isBuffer)&&e.constructor.isBuffer(e)},isFormData:e=>{let t;return e&&("function"==typeof FormData&&e instanceof FormData||rU(e.append)&&("formdata"===(t=JL(e))||"object"===t&&rU(e.toString)&&"[object FormData]"===e.toString()))},isArrayBufferView:function(e){let t;return t="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&tU(e.buffer),t},isString:nU,isNumber:iU,isBoolean:e=>!0===e||!1===e,isObject:aU,isPlainObject:oU,isUndefined:eU,isDate:sU,isFile:cU,isBlob:uU,isRegExp:vU,isFunction:rU,isStream:e=>aU(e)&&rU(e.pipe),isURLSearchParams:dU,isTypedArray:mU,isFileList:fU,forEach:lU,merge:function e(){const{caseless:t}=bU(this)&&this||{},n={},r=(r,i)=>{const a=t&&pU(n,i)||i;oU(n[a])&&oU(r)?n[a]=e(n[a],r):oU(r)?n[a]=e({},r):ZL(r)?n[a]=r.slice():n[a]=r};for(let e=0,t=arguments.length;e<t;e++)arguments[e]&&lU(arguments[e],r);return n},extend:(e,t,n,{allOwnKeys:r}={})=>(lU(t,((t,r)=>{n&&rU(t)?e[r]=WL(t,n):e[r]=t}),{allOwnKeys:r}),e),trim:e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),stripBOM:e=>(65279===e.charCodeAt(0)&&(e=e.slice(1)),e),inherits:(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},toFlatObject:(e,t,n,r)=>{let i,a,o;const s={};if(t=t||{},null==e)return t;do{for(i=Object.getOwnPropertyNames(e),a=i.length;a-- >0;)o=i[a],r&&!r(o,e,t)||s[o]||(t[o]=e[o],s[o]=!0);e=!1!==n&&$L(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},kindOf:JL,kindOfTest:YL,endsWith:(e,t,n)=>{e=String(e),(void 0===n||n>e.length)&&(n=e.length),n-=t.length;const r=e.indexOf(t,n);return-1!==r&&r===n},toArray:e=>{if(!e)return null;if(ZL(e))return e;let t=e.length;if(!iU(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},forEachEntry:(e,t)=>{const n=(e&&e[Symbol.iterator]).call(e);let r;for(;(r=n.next())&&!r.done;){const n=r.value;t.call(e,n[0],n[1])}},matchAll:(e,t)=>{let n;const r=[];for(;null!==(n=e.exec(t));)r.push(n);return r},isHTMLForm:yU,hasOwnProperty:gU,hasOwnProp:gU,reduceDescriptors:wU,freezeMethods:e=>{wU(e,((t,n)=>{if(rU(e)&&-1!==["arguments","caller","callee"].indexOf(n))return!1;const r=e[n];rU(r)&&(t.enumerable=!1,"writable"in t?t.writable=!1:t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")}))}))},toObjectSet:(e,t)=>{const n={},r=e=>{e.forEach((e=>{n[e]=!0}))};return ZL(e)?r(e):r(String(e).split(t)),n},toCamelCase:e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,(function(e,t,n){return t.toUpperCase()+n})),noop:()=>{},toFiniteNumber:(e,t)=>(e=+e,Number.isFinite(e)?e:t),findKey:pU,global:hU,isContextDefined:bU,ALPHABET:TU,generateString:(e=16,t=TU.ALPHA_DIGIT)=>{let n="";const{length:r}=t;for(;e--;)n+=t[Math.random()*r|0];return n},isSpecCompliantForm:function(e){return!!(e&&rU(e.append)&&"FormData"===e[Symbol.toStringTag]&&e[Symbol.iterator])},toJSONObject:e=>{const t=new Array(10),n=(e,r)=>{if(aU(e)){if(t.indexOf(e)>=0)return;if(!("toJSON"in e)){t[r]=e;const i=ZL(e)?[]:{};return lU(e,((e,t)=>{const a=n(e,r+1);!eU(a)&&(i[t]=a)})),t[r]=void 0,i}}return e};return n(e,0)},isAsyncFn:AU,isThenable:e=>e&&(aU(e)||rU(e))&&rU(e.then)&&rU(e.catch)};function SU(e,t,n,r,i){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack,this.message=e,this.name="AxiosError",t&&(this.code=t),n&&(this.config=n),r&&(this.request=r),i&&(this.response=i)}RU.inherits(SU,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:RU.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});const kU=SU.prototype,IU={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach((e=>{IU[e]={value:e}})),Object.defineProperties(SU,IU),Object.defineProperty(kU,"isAxiosError",{value:!0}),SU.from=(e,t,n,r,i,a)=>{const o=Object.create(kU);return RU.toFlatObject(e,o,(function(e){return e!==Error.prototype}),(e=>"isAxiosError"!==e)),SU.call(o,e.message,t,n,r,i),o.cause=e,o.name=e.name,a&&Object.assign(o,a),o};function OU(e){return RU.isPlainObject(e)||RU.isArray(e)}function xU(e){return RU.endsWith(e,"[]")?e.slice(0,-2):e}function CU(e,t,n){return e?e.concat(t).map((function(e,t){return e=xU(e),!n&&t?"["+e+"]":e})).join(n?".":""):t}const MU=RU.toFlatObject(RU,{},null,(function(e){return/^is[A-Z]/.test(e)}));function PU(e,t,n){if(!RU.isObject(e))throw new TypeError("target must be an object");t=t||new FormData;const r=(n=RU.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,(function(e,t){return!RU.isUndefined(t[e])}))).metaTokens,i=n.visitor||u,a=n.dots,o=n.indexes,s=(n.Blob||"undefined"!=typeof Blob&&Blob)&&RU.isSpecCompliantForm(t);if(!RU.isFunction(i))throw new TypeError("visitor must be a function");function c(e){if(null===e)return"";if(RU.isDate(e))return e.toISOString();if(!s&&RU.isBlob(e))throw new SU("Blob is not supported. Use a Buffer instead.");return RU.isArrayBuffer(e)||RU.isTypedArray(e)?s&&"function"==typeof Blob?new Blob([e]):Buffer.from(e):e}function u(e,n,i){let s=e;if(e&&!i&&"object"==typeof e)if(RU.endsWith(n,"{}"))n=r?n:n.slice(0,-2),e=JSON.stringify(e);else if(RU.isArray(e)&&function(e){return RU.isArray(e)&&!e.some(OU)}(e)||(RU.isFileList(e)||RU.endsWith(n,"[]"))&&(s=RU.toArray(e)))return n=xU(n),s.forEach((function(e,r){!RU.isUndefined(e)&&null!==e&&t.append(!0===o?CU([n],r,a):null===o?n:n+"[]",c(e))})),!1;return!!OU(e)||(t.append(CU(i,n,a),c(e)),!1)}const f=[],d=Object.assign(MU,{defaultVisitor:u,convertValue:c,isVisitable:OU});if(!RU.isObject(e))throw new TypeError("data must be an object");return function e(n,r){if(!RU.isUndefined(n)){if(-1!==f.indexOf(n))throw Error("Circular reference detected in "+r.join("."));f.push(n),RU.forEach(n,(function(n,a){!0===(!(RU.isUndefined(n)||null===n)&&i.call(t,n,RU.isString(a)?a.trim():a,r,d))&&e(n,r?r.concat(a):[a])})),f.pop()}}(e),t}function NU(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,(function(e){return t[e]}))}function BU(e,t){this._pairs=[],e&&PU(e,this,t)}const DU=BU.prototype;function FU(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function LU(e,t,n){if(!t)return e;const r=n&&n.encode||FU,i=n&&n.serialize;let a;if(a=i?i(t,n):RU.isURLSearchParams(t)?t.toString():new BU(t,n).toString(r),a){const t=e.indexOf("#");-1!==t&&(e=e.slice(0,t)),e+=(-1===e.indexOf("?")?"?":"&")+a}return e}DU.append=function(e,t){this._pairs.push([e,t])},DU.toString=function(e){const t=e?function(t){return e.call(this,t,NU)}:NU;return this._pairs.map((function(e){return t(e[0])+"="+t(e[1])}),"").join("&")};var UU=class{constructor(){this.handlers=[]}use(e,t,n){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!n&&n.synchronous,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){RU.forEach(this.handlers,(function(t){null!==t&&e(t)}))}},jU={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1};var qU={isBrowser:!0,classes:{URLSearchParams:"undefined"!=typeof URLSearchParams?URLSearchParams:BU,FormData:"undefined"!=typeof FormData?FormData:null,Blob:"undefined"!=typeof Blob?Blob:null},isStandardBrowserEnv:(()=>{let e;return("undefined"==typeof navigator||"ReactNative"!==(e=navigator.product)&&"NativeScript"!==e&&"NS"!==e)&&("undefined"!=typeof window&&"undefined"!=typeof document)})(),isStandardBrowserWebWorkerEnv:"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,protocols:["http","https","file","blob","url","data"]};function zU(e){function t(e,n,r,i){let a=e[i++];const o=Number.isFinite(+a),s=i>=e.length;if(a=!a&&RU.isArray(r)?r.length:a,s)return RU.hasOwnProp(r,a)?r[a]=[r[a],n]:r[a]=n,!o;r[a]&&RU.isObject(r[a])||(r[a]=[]);return t(e,n,r[a],i)&&RU.isArray(r[a])&&(r[a]=function(e){const t={},n=Object.keys(e);let r;const i=n.length;let a;for(r=0;r<i;r++)a=n[r],t[a]=e[a];return t}(r[a])),!o}if(RU.isFormData(e)&&RU.isFunction(e.entries)){const n={};return RU.forEachEntry(e,((e,r)=>{t(function(e){return RU.matchAll(/\w+|\[(\w*)]/g,e).map((e=>"[]"===e[0]?"":e[1]||e[0]))}(e),r,n,0)})),n}return null}const HU={"Content-Type":void 0};const GU={transitional:jU,adapter:["xhr","http"],transformRequest:[function(e,t){const n=t.getContentType()||"",r=n.indexOf("application/json")>-1,i=RU.isObject(e);i&&RU.isHTMLForm(e)&&(e=new FormData(e));if(RU.isFormData(e))return r&&r?JSON.stringify(zU(e)):e;if(RU.isArrayBuffer(e)||RU.isBuffer(e)||RU.isStream(e)||RU.isFile(e)||RU.isBlob(e))return e;if(RU.isArrayBufferView(e))return e.buffer;if(RU.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let a;if(i){if(n.indexOf("application/x-www-form-urlencoded")>-1)return function(e,t){return PU(e,new qU.classes.URLSearchParams,Object.assign({visitor:function(e,t,n,r){return qU.isNode&&RU.isBuffer(e)?(this.append(t,e.toString("base64")),!1):r.defaultVisitor.apply(this,arguments)}},t))}(e,this.formSerializer).toString();if((a=RU.isFileList(e))||n.indexOf("multipart/form-data")>-1){const t=this.env&&this.env.FormData;return PU(a?{"files[]":e}:e,t&&new t,this.formSerializer)}}return i||r?(t.setContentType("application/json",!1),function(e,t,n){if(RU.isString(e))try{return(t||JSON.parse)(e),RU.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(n||JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){const t=this.transitional||GU.transitional,n=t&&t.forcedJSONParsing,r="json"===this.responseType;if(e&&RU.isString(e)&&(n&&!this.responseType||r)){const n=!(t&&t.silentJSONParsing)&&r;try{return JSON.parse(e)}catch(e){if(n){if("SyntaxError"===e.name)throw SU.from(e,SU.ERR_BAD_RESPONSE,this,null,this.response);throw e}}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:qU.classes.FormData,Blob:qU.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};RU.forEach(["delete","get","head"],(function(e){GU.headers[e]={}})),RU.forEach(["post","put","patch"],(function(e){GU.headers[e]=RU.merge(HU)}));var VU=GU;const KU=RU.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]);const WU=Symbol("internals");function XU(e){return e&&String(e).trim().toLowerCase()}function $U(e){return!1===e||null==e?e:RU.isArray(e)?e.map($U):String(e)}function JU(e,t,n,r,i){return RU.isFunction(r)?r.call(this,t,n):(i&&(t=n),RU.isString(t)?RU.isString(r)?-1!==t.indexOf(r):RU.isRegExp(r)?r.test(t):void 0:void 0)}class YU{constructor(e){e&&this.set(e)}set(e,t,n){const r=this;function i(e,t,n){const i=XU(t);if(!i)throw new Error("header name must be a non-empty string");const a=RU.findKey(r,i);(!a||void 0===r[a]||!0===n||void 0===n&&!1!==r[a])&&(r[a||t]=$U(e))}const a=(e,t)=>RU.forEach(e,((e,n)=>i(e,n,t)));return RU.isPlainObject(e)||e instanceof this.constructor?a(e,t):RU.isString(e)&&(e=e.trim())&&!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim())?a((e=>{const t={};let n,r,i;return e&&e.split("\n").forEach((function(e){i=e.indexOf(":"),n=e.substring(0,i).trim().toLowerCase(),r=e.substring(i+1).trim(),!n||t[n]&&KU[n]||("set-cookie"===n?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)})),t})(e),t):null!=e&&i(t,e,n),this}get(e,t){if(e=XU(e)){const n=RU.findKey(this,e);if(n){const e=this[n];if(!t)return e;if(!0===t)return function(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(e);)t[r[1]]=r[2];return t}(e);if(RU.isFunction(t))return t.call(this,e,n);if(RU.isRegExp(t))return t.exec(e);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=XU(e)){const n=RU.findKey(this,e);return!(!n||void 0===this[n]||t&&!JU(0,this[n],n,t))}return!1}delete(e,t){const n=this;let r=!1;function i(e){if(e=XU(e)){const i=RU.findKey(n,e);!i||t&&!JU(0,n[i],i,t)||(delete n[i],r=!0)}}return RU.isArray(e)?e.forEach(i):i(e),r}clear(e){const t=Object.keys(this);let n=t.length,r=!1;for(;n--;){const i=t[n];e&&!JU(0,this[i],i,e,!0)||(delete this[i],r=!0)}return r}normalize(e){const t=this,n={};return RU.forEach(this,((r,i)=>{const a=RU.findKey(n,i);if(a)return t[a]=$U(r),void delete t[i];const o=e?function(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,((e,t,n)=>t.toUpperCase()+n))}(i):String(i).trim();o!==i&&delete t[i],t[o]=$U(r),n[o]=!0})),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const t=Object.create(null);return RU.forEach(this,((n,r)=>{null!=n&&!1!==n&&(t[r]=e&&RU.isArray(n)?n.join(", "):n)})),t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map((([e,t])=>e+": "+t)).join("\n")}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...t){const n=new this(e);return t.forEach((e=>n.set(e))),n}static accessor(e){const t=(this[WU]=this[WU]={accessors:{}}).accessors,n=this.prototype;function r(e){const r=XU(e);t[r]||(!function(e,t){const n=RU.toCamelCase(" "+t);["get","set","has"].forEach((r=>{Object.defineProperty(e,r+n,{value:function(e,n,i){return this[r].call(this,t,e,n,i)},configurable:!0})}))}(n,e),t[r]=!0)}return RU.isArray(e)?e.forEach(r):r(e),this}}YU.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),RU.freezeMethods(YU.prototype),RU.freezeMethods(YU);var QU=YU;function ZU(e,t){const n=this||VU,r=t||n,i=QU.from(r.headers);let a=r.data;return RU.forEach(e,(function(e){a=e.call(n,a,i.normalize(),t?t.status:void 0)})),i.normalize(),a}function ej(e){return!(!e||!e.__CANCEL__)}function tj(e,t,n){SU.call(this,null==e?"canceled":e,SU.ERR_CANCELED,t,n),this.name="CanceledError"}RU.inherits(tj,SU,{__CANCEL__:!0});var nj=qU.isStandardBrowserEnv?{write:function(e,t,n,r,i,a){const o=[];o.push(e+"="+encodeURIComponent(t)),RU.isNumber(n)&&o.push("expires="+new Date(n).toGMTString()),RU.isString(r)&&o.push("path="+r),RU.isString(i)&&o.push("domain="+i),!0===a&&o.push("secure"),document.cookie=o.join("; ")},read:function(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove:function(e){this.write(e,"",Date.now()-864e5)}}:{write:function(){},read:function(){return null},remove:function(){}};function rj(e,t){return e&&!/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)?function(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e}(e,t):t}var ij=qU.isStandardBrowserEnv?function(){const e=/(msie|trident)/i.test(navigator.userAgent),t=document.createElement("a");let n;function r(n){let r=n;return e&&(t.setAttribute("href",r),r=t.href),t.setAttribute("href",r),{href:t.href,protocol:t.protocol?t.protocol.replace(/:$/,""):"",host:t.host,search:t.search?t.search.replace(/^\?/,""):"",hash:t.hash?t.hash.replace(/^#/,""):"",hostname:t.hostname,port:t.port,pathname:"/"===t.pathname.charAt(0)?t.pathname:"/"+t.pathname}}return n=r(window.location.href),function(e){const t=RU.isString(e)?r(e):e;return t.protocol===n.protocol&&t.host===n.host}}():function(){return!0};function aj(e,t){let n=0;const r=function(e,t){e=e||10;const n=new Array(e),r=new Array(e);let i,a=0,o=0;return t=void 0!==t?t:1e3,function(s){const c=Date.now(),u=r[o];i||(i=c),n[a]=s,r[a]=c;let f=o,d=0;for(;f!==a;)d+=n[f++],f%=e;if(a=(a+1)%e,a===o&&(o=(o+1)%e),c-i<t)return;const l=u&&c-u;return l?Math.round(1e3*d/l):void 0}}(50,250);return i=>{const a=i.loaded,o=i.lengthComputable?i.total:void 0,s=a-n,c=r(s);n=a;const u={loaded:a,total:o,progress:o?a/o:void 0,bytes:s,rate:c||void 0,estimated:c&&o&&a<=o?(o-a)/c:void 0,event:i};u[t?"download":"upload"]=!0,e(u)}}var oj="undefined"!=typeof XMLHttpRequest&&function(e){return new Promise((function(t,n){let r=e.data;const i=QU.from(e.headers).normalize(),a=e.responseType;let o;function s(){e.cancelToken&&e.cancelToken.unsubscribe(o),e.signal&&e.signal.removeEventListener("abort",o)}RU.isFormData(r)&&(qU.isStandardBrowserEnv||qU.isStandardBrowserWebWorkerEnv?i.setContentType(!1):i.setContentType("multipart/form-data;",!1));let c=new XMLHttpRequest;if(e.auth){const t=e.auth.username||"",n=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";i.set("Authorization","Basic "+btoa(t+":"+n))}const u=rj(e.baseURL,e.url);function f(){if(!c)return;const r=QU.from("getAllResponseHeaders"in c&&c.getAllResponseHeaders());!function(e,t,n){const r=n.config.validateStatus;n.status&&r&&!r(n.status)?t(new SU("Request failed with status code "+n.status,[SU.ERR_BAD_REQUEST,SU.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n)):e(n)}((function(e){t(e),s()}),(function(e){n(e),s()}),{data:a&&"text"!==a&&"json"!==a?c.response:c.responseText,status:c.status,statusText:c.statusText,headers:r,config:e,request:c}),c=null}if(c.open(e.method.toUpperCase(),LU(u,e.params,e.paramsSerializer),!0),c.timeout=e.timeout,"onloadend"in c?c.onloadend=f:c.onreadystatechange=function(){c&&4===c.readyState&&(0!==c.status||c.responseURL&&0===c.responseURL.indexOf("file:"))&&setTimeout(f)},c.onabort=function(){c&&(n(new SU("Request aborted",SU.ECONNABORTED,e,c)),c=null)},c.onerror=function(){n(new SU("Network Error",SU.ERR_NETWORK,e,c)),c=null},c.ontimeout=function(){let t=e.timeout?"timeout of "+e.timeout+"ms exceeded":"timeout exceeded";const r=e.transitional||jU;e.timeoutErrorMessage&&(t=e.timeoutErrorMessage),n(new SU(t,r.clarifyTimeoutError?SU.ETIMEDOUT:SU.ECONNABORTED,e,c)),c=null},qU.isStandardBrowserEnv){const t=(e.withCredentials||ij(u))&&e.xsrfCookieName&&nj.read(e.xsrfCookieName);t&&i.set(e.xsrfHeaderName,t)}void 0===r&&i.setContentType(null),"setRequestHeader"in c&&RU.forEach(i.toJSON(),(function(e,t){c.setRequestHeader(t,e)})),RU.isUndefined(e.withCredentials)||(c.withCredentials=!!e.withCredentials),a&&"json"!==a&&(c.responseType=e.responseType),"function"==typeof e.onDownloadProgress&&c.addEventListener("progress",aj(e.onDownloadProgress,!0)),"function"==typeof e.onUploadProgress&&c.upload&&c.upload.addEventListener("progress",aj(e.onUploadProgress)),(e.cancelToken||e.signal)&&(o=t=>{c&&(n(!t||t.type?new tj(null,e,c):t),c.abort(),c=null)},e.cancelToken&&e.cancelToken.subscribe(o),e.signal&&(e.signal.aborted?o():e.signal.addEventListener("abort",o)));const d=function(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}(u);d&&-1===qU.protocols.indexOf(d)?n(new SU("Unsupported protocol "+d+":",SU.ERR_BAD_REQUEST,e)):c.send(r||null)}))};const sj={http:null,xhr:oj};RU.forEach(sj,((e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch(e){}Object.defineProperty(e,"adapterName",{value:t})}}));var cj=e=>{e=RU.isArray(e)?e:[e];const{length:t}=e;let n,r;for(let i=0;i<t&&(n=e[i],!(r=RU.isString(n)?sj[n.toLowerCase()]:n));i++);if(!r){if(!1===r)throw new SU(`Adapter ${n} is not supported by the environment`,"ERR_NOT_SUPPORT");throw new Error(RU.hasOwnProp(sj,n)?`Adapter '${n}' is not available in the build`:`Unknown adapter '${n}'`)}if(!RU.isFunction(r))throw new TypeError("adapter is not a function");return r};function uj(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new tj(null,e)}function fj(e){uj(e),e.headers=QU.from(e.headers),e.data=ZU.call(e,e.transformRequest),-1!==["post","put","patch"].indexOf(e.method)&&e.headers.setContentType("application/x-www-form-urlencoded",!1);return cj(e.adapter||VU.adapter)(e).then((function(t){return uj(e),t.data=ZU.call(e,e.transformResponse,t),t.headers=QU.from(t.headers),t}),(function(t){return ej(t)||(uj(e),t&&t.response&&(t.response.data=ZU.call(e,e.transformResponse,t.response),t.response.headers=QU.from(t.response.headers))),Promise.reject(t)}))}const dj=e=>e instanceof QU?e.toJSON():e;function lj(e,t){t=t||{};const n={};function r(e,t,n){return RU.isPlainObject(e)&&RU.isPlainObject(t)?RU.merge.call({caseless:n},e,t):RU.isPlainObject(t)?RU.merge({},t):RU.isArray(t)?t.slice():t}function i(e,t,n){return RU.isUndefined(t)?RU.isUndefined(e)?void 0:r(void 0,e,n):r(e,t,n)}function a(e,t){if(!RU.isUndefined(t))return r(void 0,t)}function o(e,t){return RU.isUndefined(t)?RU.isUndefined(e)?void 0:r(void 0,e):r(void 0,t)}function s(n,i,a){return a in t?r(n,i):a in e?r(void 0,n):void 0}const c={url:a,method:a,data:a,baseURL:o,transformRequest:o,transformResponse:o,paramsSerializer:o,timeout:o,timeoutMessage:o,withCredentials:o,adapter:o,responseType:o,xsrfCookieName:o,xsrfHeaderName:o,onUploadProgress:o,onDownloadProgress:o,decompress:o,maxContentLength:o,maxBodyLength:o,beforeRedirect:o,transport:o,httpAgent:o,httpsAgent:o,cancelToken:o,socketPath:o,responseEncoding:o,validateStatus:s,headers:(e,t)=>i(dj(e),dj(t),!0)};return RU.forEach(Object.keys(Object.assign({},e,t)),(function(r){const a=c[r]||i,o=a(e[r],t[r],r);RU.isUndefined(o)&&a!==s||(n[r]=o)})),n}const pj="1.4.0",hj={};["object","boolean","number","function","string","symbol"].forEach(((e,t)=>{hj[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}}));const bj={};hj.transitional=function(e,t,n){function r(e,t){return"[Axios v1.4.0] Transitional option '"+e+"'"+t+(n?". "+n:"")}return(n,i,a)=>{if(!1===e)throw new SU(r(i," has been removed"+(t?" in "+t:"")),SU.ERR_DEPRECATED);return t&&!bj[i]&&(bj[i]=!0,console.warn(r(i," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(n,i,a)}};var mj={assertOptions:function(e,t,n){if("object"!=typeof e)throw new SU("options must be an object",SU.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let i=r.length;for(;i-- >0;){const a=r[i],o=t[a];if(o){const t=e[a],n=void 0===t||o(t,a,e);if(!0!==n)throw new SU("option "+a+" must be "+n,SU.ERR_BAD_OPTION_VALUE)}else if(!0!==n)throw new SU("Unknown option "+a,SU.ERR_BAD_OPTION)}},validators:hj};const yj=mj.validators;class gj{constructor(e){this.defaults=e,this.interceptors={request:new UU,response:new UU}}request(e,t){"string"==typeof e?(t=t||{}).url=e:t=e||{},t=lj(this.defaults,t);const{transitional:n,paramsSerializer:r,headers:i}=t;let a;void 0!==n&&mj.assertOptions(n,{silentJSONParsing:yj.transitional(yj.boolean),forcedJSONParsing:yj.transitional(yj.boolean),clarifyTimeoutError:yj.transitional(yj.boolean)},!1),null!=r&&(RU.isFunction(r)?t.paramsSerializer={serialize:r}:mj.assertOptions(r,{encode:yj.function,serialize:yj.function},!0)),t.method=(t.method||this.defaults.method||"get").toLowerCase(),a=i&&RU.merge(i.common,i[t.method]),a&&RU.forEach(["delete","get","head","post","put","patch","common"],(e=>{delete i[e]})),t.headers=QU.concat(a,i);const o=[];let s=!0;this.interceptors.request.forEach((function(e){"function"==typeof e.runWhen&&!1===e.runWhen(t)||(s=s&&e.synchronous,o.unshift(e.fulfilled,e.rejected))}));const c=[];let u;this.interceptors.response.forEach((function(e){c.push(e.fulfilled,e.rejected)}));let f,d=0;if(!s){const e=[fj.bind(this),void 0];for(e.unshift.apply(e,o),e.push.apply(e,c),f=e.length,u=Promise.resolve(t);d<f;)u=u.then(e[d++],e[d++]);return u}f=o.length;let l=t;for(d=0;d<f;){const e=o[d++],t=o[d++];try{l=e(l)}catch(e){t.call(this,e);break}}try{u=fj.call(this,l)}catch(e){return Promise.reject(e)}for(d=0,f=c.length;d<f;)u=u.then(c[d++],c[d++]);return u}getUri(e){return LU(rj((e=lj(this.defaults,e)).baseURL,e.url),e.params,e.paramsSerializer)}}RU.forEach(["delete","get","head","options"],(function(e){gj.prototype[e]=function(t,n){return this.request(lj(n||{},{method:e,url:t,data:(n||{}).data}))}})),RU.forEach(["post","put","patch"],(function(e){function t(t){return function(n,r,i){return this.request(lj(i||{},{method:e,headers:t?{"Content-Type":"multipart/form-data"}:{},url:n,data:r}))}}gj.prototype[e]=t(),gj.prototype[e+"Form"]=t(!0)}));var vj=gj;class wj{constructor(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");let t;this.promise=new Promise((function(e){t=e}));const n=this;this.promise.then((e=>{if(!n._listeners)return;let t=n._listeners.length;for(;t-- >0;)n._listeners[t](e);n._listeners=null})),this.promise.then=e=>{let t;const r=new Promise((e=>{n.subscribe(e),t=e})).then(e);return r.cancel=function(){n.unsubscribe(t)},r},e((function(e,r,i){n.reason||(n.reason=new tj(e,r,i),t(n.reason))}))}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){this.reason?e(this.reason):this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const t=this._listeners.indexOf(e);-1!==t&&this._listeners.splice(t,1)}static source(){let e;const t=new wj((function(t){e=t}));return{token:t,cancel:e}}}var _j=wj;const Ej={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(Ej).forEach((([e,t])=>{Ej[t]=e}));var Tj=Ej;const Aj=function e(t){const n=new vj(t),r=WL(vj.prototype.request,n);return RU.extend(r,vj.prototype,n,{allOwnKeys:!0}),RU.extend(r,n,null,{allOwnKeys:!0}),r.create=function(n){return e(lj(t,n))},r}(VU);Aj.Axios=vj,Aj.CanceledError=tj,Aj.CancelToken=_j,Aj.isCancel=ej,Aj.VERSION=pj,Aj.toFormData=PU,Aj.AxiosError=SU,Aj.Cancel=Aj.CanceledError,Aj.all=function(e){return Promise.all(e)},Aj.spread=function(e){return function(t){return e.apply(null,t)}},Aj.isAxiosError=function(e){return RU.isObject(e)&&!0===e.isAxiosError},Aj.mergeConfig=lj,Aj.AxiosHeaders=QU,Aj.formToJSON=e=>zU(RU.isHTMLForm(e)?new FormData(e):e),Aj.HttpStatusCode=Tj,Aj.default=Aj;var Rj=Aj;const Sj="https://guardian.sandbox.imtbl.com".replace(/\/+$/,"");class kj{basePath;axios;configuration;constructor(e,t=Sj,n=Rj){this.basePath=t,this.axios=n,e&&(this.configuration=e,this.basePath=e.basePath||this.basePath)}}class Ij extends Error{field;name="RequiredError";constructor(e,t){super(t),this.field=e}}const Oj="https://example.com",xj=function(e,t,n){if(null==n)throw new Ij(t,`Required parameter ${t} was null or undefined when calling ${e}.`)},Cj=async function(e,t){if(t&&t.accessToken){const n="function"==typeof t.accessToken?await t.accessToken():await t.accessToken;e.Authorization="Bearer "+n}};function Mj(e,t,n=""){"object"==typeof t?Array.isArray(t)?t.forEach((t=>Mj(e,t,n))):Object.keys(t).forEach((r=>Mj(e,t[r],`${n}${""!==n?".":""}${r}`))):e.has(n)?e.append(n,t):e.set(n,t)}const Pj=function(e,...t){const n=new URLSearchParams(e.search);Mj(n,t),e.search=n.toString()},Nj=function(e,t,n){const r="string"!=typeof e;return(r&&n&&n.isJsonMime?n.isJsonMime(t.headers["Content-Type"]):r)?JSON.stringify(void 0!==e?e:{}):e||""},Bj=function(e){return e.pathname+e.search+e.hash},Dj=function(e,t,n,r){return(i=t,a=n)=>{const o={...e.options,url:(r?.basePath||a)+e.url};return i.request(o)}},Fj=function(e){const t=function(e){return{approvePendingMessage:async(t,n={})=>{xj("approvePendingMessage","messageID",t);const r="/guardian/v1/messages/{messageID}/approve".replace("{messageID}",encodeURIComponent(String(t))),i=new URL(r,Oj);let a;e&&(a=e.baseOptions);const o={method:"POST",...a,...n},s={};await Cj(s,e),Pj(i,{});let c=a&&a.headers?a.headers:{};return o.headers={...s,...c,...n.headers},{url:Bj(i),options:o}},evaluateMessage:async(t,n={})=>{xj("evaluateMessage","messageEvaluationRequest",t);const r=new URL("/guardian/v1/messages/evaluate",Oj);let i;e&&(i=e.baseOptions);const a={method:"POST",...i,...n},o={};await Cj(o,e),o["Content-Type"]="application/json",Pj(r,{});let s=i&&i.headers?i.headers:{};return a.headers={...o,...s,...n.headers},a.data=Nj(t,a,e),{url:Bj(r),options:a}},getMessageByID:async(t,n={})=>{xj("getMessageByID","messageID",t);const r="/guardian/v1/messages/{messageID}".replace("{messageID}",encodeURIComponent(String(t))),i=new URL(r,Oj);let a;e&&(a=e.baseOptions);const o={method:"GET",...a,...n},s={};await Cj(s,e),Pj(i,{});let c=a&&a.headers?a.headers:{};return o.headers={...s,...c,...n.headers},{url:Bj(i),options:o}}}}(e);return{async approvePendingMessage(n,r){const i=await t.approvePendingMessage(n,r);return Dj(i,Rj,Sj,e)},async evaluateMessage(n,r){const i=await t.evaluateMessage(n,r);return Dj(i,Rj,Sj,e)},async getMessageByID(n,r){const i=await t.getMessageByID(n,r);return Dj(i,Rj,Sj,e)}}};class Lj extends kj{approvePendingMessage(e,t){return Fj(this.configuration).approvePendingMessage(e.messageID,t).then((e=>e(this.axios,this.basePath)))}evaluateMessage(e,t){return Fj(this.configuration).evaluateMessage(e.messageEvaluationRequest,t).then((e=>e(this.axios,this.basePath)))}getMessageByID(e,t){return Fj(this.configuration).getMessageByID(e.messageID,t).then((e=>e(this.axios,this.basePath)))}}const Uj=function(e){const t=function(e){return{approvePendingTransaction:async(t,n,r={})=>{xj("approvePendingTransaction","payloadHash",t),xj("approvePendingTransaction","transactionApprovalRequest",n);const i="/guardian/v1/transactions/{payloadHash}/approve".replace("{payloadHash}",encodeURIComponent(String(t))),a=new URL(i,Oj);let o;e&&(o=e.baseOptions);const s={method:"POST",...o,...r},c={};await Cj(c,e),c["Content-Type"]="application/json",Pj(a,{});let u=o&&o.headers?o.headers:{};return s.headers={...c,...u,...r.headers},s.data=Nj(n,s,e),{url:Bj(a),options:s}},evaluateTransaction:async(t,n,r={})=>{xj("evaluateTransaction","id",t),xj("evaluateTransaction","transactionEvaluationRequest",n);const i="/guardian/v1/transactions/{id}/evaluate".replace("{id}",encodeURIComponent(String(t))),a=new URL(i,Oj);let o;e&&(o=e.baseOptions);const s={method:"POST",...o,...r},c={};await Cj(c,e),c["Content-Type"]="application/json",Pj(a,{});let u=o&&o.headers?o.headers:{};return s.headers={...c,...u,...r.headers},s.data=Nj(n,s,e),{url:Bj(a),options:s}},getTransactionByID:async(t,n,r,i={})=>{xj("getTransactionByID","transactionID",t),xj("getTransactionByID","chainType",n);const a="/guardian/v1/transactions/{transactionID}".replace("{transactionID}",encodeURIComponent(String(t))),o=new URL(a,Oj);let s;e&&(s=e.baseOptions);const c={method:"GET",...s,...i},u={},f={};await Cj(u,e),void 0!==n&&(f.chainType=n),void 0!==r&&(f.chainID=r),Pj(o,f);let d=s&&s.headers?s.headers:{};return c.headers={...u,...d,...i.headers},{url:Bj(o),options:c}}}}(e);return{async approvePendingTransaction(n,r,i){const a=await t.approvePendingTransaction(n,r,i);return Dj(a,Rj,Sj,e)},async evaluateTransaction(n,r,i){const a=await t.evaluateTransaction(n,r,i);return Dj(a,Rj,Sj,e)},async getTransactionByID(n,r,i,a){const o=await t.getTransactionByID(n,r,i,a);return Dj(o,Rj,Sj,e)}}};class jj extends kj{approvePendingTransaction(e,t){return Uj(this.configuration).approvePendingTransaction(e.payloadHash,e.transactionApprovalRequest,t).then((e=>e(this.axios,this.basePath)))}evaluateTransaction(e,t){return Uj(this.configuration).evaluateTransaction(e.id,e.transactionEvaluationRequest,t).then((e=>e(this.axios,this.basePath)))}getTransactionByID(e,t){return Uj(this.configuration).getTransactionByID(e.transactionID,e.chainType,e.chainID,t).then((e=>e(this.axios,this.basePath)))}}class qj{apiKey;username;password;accessToken;basePath;baseOptions;formDataCtor;constructor(e={}){this.apiKey=e.apiKey,this.username=e.username,this.password=e.password,this.accessToken=e.accessToken,this.basePath=e.basePath,this.baseOptions=e.baseOptions,this.formDataCtor=e.formDataCtor}isJsonMime(e){const t=new RegExp("^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$","i");return null!==e&&(t.test(e)||"application/json-patch+json"===e.toLowerCase())}}const zj="starkex",Hj="evm";function Gj(e){const t=-1!==new rr(e,16).cmp(new rr(27))?new rr(e,16).sub(new rr(27)).toNumber():new rr(e,16).toNumber();return e.trim()?t:void 0}async function Vj(e,t){const n=function(e,t=64){const n=Em(e);return{r:new rr(n.substring(0,t),"hex"),s:new rr(n.substring(t,2*t),"hex"),recoveryParam:Gj(n.substring(2*t,2*t+2))}}(await t.signMessage(e));return Am(wm((r=n).r.toString(16),64)+wm(r.s.toString(16),64)+wm(r.recoveryParam?.toString(16)||"",2));var r}function Kj(e){switch(e.type){case"ERC721":return{type:"ERC721",data:{token_id:e.tokenId,token_address:e.tokenAddress}};case"ERC20":return{type:"ERC20",data:{token_address:e.tokenAddress}};default:return{type:"ETH",data:{decimals:18}}}}const Wj={erc1271:Object.freeze({__proto__:null,abi:[{type:"function",name:"isValidSignature",constant:!0,inputs:[{type:"bytes32"},{type:"bytes"}],outputs:[{type:"bytes4"}],payable:!1,stateMutability:"view"}],returns:{isValidSignatureBytes32:"0x1626ba7e"}}),factory:Object.freeze({__proto__:null,abi:[{type:"function",name:"deploy",constant:!1,inputs:[{type:"address"},{type:"bytes32"}],outputs:[],payable:!0,stateMutability:"payable"}]}),mainModule:Object.freeze({__proto__:null,abi:[{type:"function",name:"nonce",constant:!0,inputs:[],outputs:[{type:"uint256"}],payable:!1,stateMutability:"view"},{type:"function",name:"readNonce",constant:!0,inputs:[{type:"uint256"}],outputs:[{type:"uint256"}],payable:!1,stateMutability:"view"},{type:"function",name:"updateImplementation",constant:!1,inputs:[{type:"address"}],outputs:[],payable:!1,stateMutability:"nonpayable"},{type:"function",name:"selfExecute",constant:!1,inputs:[{components:[{type:"bool",name:"delegateCall"},{type:"bool",name:"revertOnError"},{type:"uint256",name:"gasLimit"},{type:"address",name:"target"},{type:"uint256",name:"value"},{type:"bytes",name:"data"}],type:"tuple[]"}],outputs:[],payable:!1,stateMutability:"nonpayable"},{type:"function",name:"execute",constant:!1,inputs:[{components:[{type:"bool",name:"delegateCall"},{type:"bool",name:"revertOnError"},{type:"uint256",name:"gasLimit"},{type:"address",name:"target"},{type:"uint256",name:"value"},{type:"bytes",name:"data"}],type:"tuple[]"},{type:"uint256"},{type:"bytes"}],outputs:[],payable:!1,stateMutability:"nonpayable"},{type:"function",name:"createContract",inputs:[{type:"bytes"}],payable:!0,stateMutability:"payable"}]}),mainModuleUpgradable:Object.freeze({__proto__:null,abi:[{type:"function",name:"updateImageHash",constant:!0,inputs:[{type:"bytes32"}],outputs:[],payable:!1,stateMutability:"view"},{type:"function",name:"imageHash",constant:!0,inputs:[],outputs:[{type:"bytes32"}],payable:!1,stateMutability:"view"}]}),sequenceUtils:Object.freeze({__proto__:null,abi:[{inputs:[{internalType:"address",name:"_factory",type:"address"},{internalType:"address",name:"_mainModule",type:"address"}],stateMutability:"nonpayable",type:"constructor"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"_wallet",type:"address"},{indexed:!0,internalType:"bytes32",name:"_imageHash",type:"bytes32"},{indexed:!1,internalType:"uint256",name:"_threshold",type:"uint256"},{indexed:!1,internalType:"bytes",name:"_signers",type:"bytes"}],name:"RequiredConfig",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"_wallet",type:"address"},{indexed:!0,internalType:"address",name:"_signer",type:"address"}],name:"RequiredSigner",type:"event"},{inputs:[{internalType:"address",name:"_addr",type:"address"}],name:"callBalanceOf",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"callBlockNumber",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"_i",type:"uint256"}],name:"callBlockhash",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[],name:"callChainId",outputs:[{internalType:"uint256",name:"id",type:"uint256"}],stateMutability:"pure",type:"function"},{inputs:[{internalType:"address",name:"_addr",type:"address"}],name:"callCode",outputs:[{internalType:"bytes",name:"code",type:"bytes"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"_addr",type:"address"}],name:"callCodeHash",outputs:[{internalType:"bytes32",name:"codeHash",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"_addr",type:"address"}],name:"callCodeSize",outputs:[{internalType:"uint256",name:"size",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"callCoinbase",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"callDifficulty",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"callGasLeft",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"callGasLimit",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"callGasPrice",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"callOrigin",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"callTimestamp",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"",type:"address"}],name:"knownImageHashes",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"",type:"bytes32"}],name:"lastImageHashUpdate",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"",type:"address"}],name:"lastSignerUpdate",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"",type:"address"}],name:"lastWalletUpdate",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{components:[{internalType:"bool",name:"delegateCall",type:"bool"},{internalType:"bool",name:"revertOnError",type:"bool"},{internalType:"uint256",name:"gasLimit",type:"uint256"},{internalType:"address",name:"target",type:"address"},{internalType:"uint256",name:"value",type:"uint256"},{internalType:"bytes",name:"data",type:"bytes"}],internalType:"struct IModuleCalls.Transaction[]",name:"_txs",type:"tuple[]"}],name:"multiCall",outputs:[{internalType:"bool[]",name:"_successes",type:"bool[]"},{internalType:"bytes[]",name:"_results",type:"bytes[]"}],stateMutability:"payable",type:"function"},{inputs:[{internalType:"address",name:"_wallet",type:"address"},{internalType:"uint256",name:"_threshold",type:"uint256"},{components:[{internalType:"uint256",name:"weight",type:"uint256"},{internalType:"address",name:"signer",type:"address"}],internalType:"struct RequireUtils.Member[]",name:"_members",type:"tuple[]"},{internalType:"bool",name:"_index",type:"bool"}],name:"publishConfig",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"_wallet",type:"address"},{internalType:"bytes32",name:"_hash",type:"bytes32"},{internalType:"uint256",name:"_sizeMembers",type:"uint256"},{internalType:"bytes",name:"_signature",type:"bytes"},{internalType:"bool",name:"_index",type:"bool"}],name:"publishInitialSigners",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"_wallet",type:"address"},{internalType:"uint256",name:"_nonce",type:"uint256"}],name:"requireMinNonce",outputs:[],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"_expiration",type:"uint256"}],name:"requireNonExpired",outputs:[],stateMutability:"view",type:"function"}]}),requireFreshSigner:Object.freeze({__proto__:null,abi:[{inputs:[{internalType:"address",name:"",type:"address"}],name:"requireFreshSigner",outputs:[],stateMutability:"nonpayable",type:"function"}]})};function Xj(){return Xj=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Xj.apply(this,arguments)}var $j;!function(e){e[e.DEBUG=1]="DEBUG",e[e.INFO=2]="INFO",e[e.WARN=3]="WARN",e[e.ERROR=4]="ERROR",e[e.DISABLED=5]="DISABLED"}($j||($j={}));function Jj(e,t){return function(...n){const r=Array.prototype.slice.call(n);return new Promise((async(n,i)=>{try{r.push(((e,t)=>e?i(e):n(t))),await e.apply(t,r)}catch(e){i(e)}}))}}new class{constructor(e){this.config=e,this.logLevel=void 0,this.configure(e)}configure(e){switch(this.config=Xj({},this.config,e),this.config.logLevel){case"DEBUG":this.logLevel=$j.DEBUG;break;case"INFO":default:this.logLevel=$j.INFO;break;case"WARN":this.logLevel=$j.WARN;break;case"ERROR":this.logLevel=$j.ERROR;break;case"DISABLED":this.logLevel=$j.DISABLED}void 0===this.config.silence&&(this.config.silence=!1)}debug(e,...t){!0!==this.config.silence&&this.logLevel===$j.DEBUG&&console.log(e,...t)}info(e,...t){!0!==this.config.silence&&this.logLevel<=$j.INFO&&console.log(e,...t)}warn(e,...t){!0!==this.config.silence&&this.logLevel<=$j.WARN&&(console.warn(e,...t),this.config.onwarn&&this.config.onwarn(e,t))}error(e,...t){!0!==this.config.silence&&this.logLevel<=$j.ERROR&&(console.error(e,...t),this.config.onerror&&this.config.onerror(e,t))}}({logLevel:"INFO",silence:!0});const Yj=(e=0,t=Number.MAX_SAFE_INTEGER)=>(e=Math.ceil(e),t=Math.floor(t),Math.floor(Math.random()*(t-e+1))+e);function Qj(){return Qj=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Qj.apply(this,arguments)}const Zj=(e,t=!1)=>(((e,t=!1,n=!1)=>{if(!e)throw new Error("invalid network config: empty config");const r=[];if(Array.isArray(e)?r.push(...e):r.push(e),0===r.length){if(t)throw new Error("invalid network config: empty config");return!1}const i=r.map((e=>e.chainId)).sort(),a=i.filter(((e,t)=>i.indexOf(e)!==t));if(a.length>0){if(t)throw new Error(`invalid network config: duplicate chainIds ${a}`);return!1}r.forEach((e=>e.name=e.name.toLowerCase()));const o=r.map((e=>e.name)).sort(),s=o.filter(((e,t)=>o.indexOf(e)!==t));if(s.length>0){if(t)throw new Error(`invalid network config: duplicate network names ${s}`);return!1}let c=!1,u=!1;for(let e=0;e<r.length;e++){const i=r[e];if(!(i.rpcUrl&&""!==i.rpcUrl||i.provider)){if(t)throw new Error(`invalid network config for chainId ${i.chainId}: rpcUrl or provider must be provided`);return!1}if(!n&&!i.relayer){if(t)throw new Error(`invalid network config for chainId ${i.chainId}: relayer must be provided`);return!1}if(i.isDefaultChain){if(c){if(t)throw new Error(`invalid network config for chainId ${i.chainId}: DefaultChain is already set by another config`);return!1}c=!0}if(i.isAuthChain){if(u&&t)throw new Error(`invalid network config for chainId ${i.chainId}: AuthChain is already set by another config`);u=!0}}if(!c){if(t)throw new Error("invalid network config: DefaultChain must be set");return!1}if(!u){if(t)throw new Error("invalid network config: AuthChain must be set");return!1}})(e,!0,t),e),eq=e=>Zj(tq(e)),tq=e=>{if(!e)return[];const t=e.sort(((e,t)=>e.chainId===t.chainId?0:e.chainId<t.chainId?-1:1)),n=t.findIndex((e=>e.isDefaultChain));n>0&&t.splice(0,0,t.splice(n,1)[0]);const r=t.findIndex((e=>e.isAuthChain&&!0!==e.isDefaultChain));return r>0&&t.splice(1,0,t.splice(r,1)[0]),t},nq=(e,t)=>"string"==typeof e?(t=t||{},e.replace(/\$\{\s*([$#@\-\d\w]+)\s*\}/gim,(function(e,n){let r=t[n];return r="function"==typeof r?r():null==r?"":"object"==typeof r||"symbol"==typeof r?r.toString():r.valueOf(),r}))):"";let rq;!function(e){e[e.MAINNET=1]="MAINNET",e[e.ROPSTEN=3]="ROPSTEN",e[e.RINKEBY=4]="RINKEBY",e[e.GOERLI=5]="GOERLI",e[e.KOVAN=42]="KOVAN",e[e.POLYGON=137]="POLYGON",e[e.POLYGON_MUMBAI=80001]="POLYGON_MUMBAI",e[e.POLYGON_ZKEVM=1101]="POLYGON_ZKEVM",e[e.BSC=56]="BSC",e[e.BSC_TESTNET=97]="BSC_TESTNET",e[e.OPTIMISM=10]="OPTIMISM",e[e.OPTIMISM_TESTNET=69]="OPTIMISM_TESTNET",e[e.ARBITRUM=42161]="ARBITRUM",e[e.ARBITRUM_GOERLI=421613]="ARBITRUM_GOERLI",e[e.ARBITRUM_NOVA=42170]="ARBITRUM_NOVA",e[e.AVALANCHE=43114]="AVALANCHE",e[e.AVALANCHE_TESTNET=43113]="AVALANCHE_TESTNET",e[e.FANTOM=250]="FANTOM",e[e.FANTOM_TESTNET=4002]="FANTOM_TESTNET",e[e.GNOSIS=100]="GNOSIS",e[e.AURORA=1313161554]="AURORA",e[e.AURORA_TESTNET=1313161556]="AURORA_TESTNET",e[e.BASE_GOERLI=84531]="BASE_GOERLI"}(rq||(rq={}));const iq=e=>nq("https://${network}-indexer.sequence.app",{network:e}),aq=e=>nq("https://${network}-relayer.sequence.app",{network:e}),oq=e=>nq("https://nodes.sequence.app/${network}",{network:e}),sq={[rq.MAINNET]:{chainId:rq.MAINNET,name:"mainnet",title:"Ethereum",blockExplorer:{name:"Etherscan",rootUrl:"https://etherscan.io/"},ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e"},[rq.ROPSTEN]:{chainId:rq.ROPSTEN,name:"ropsten",title:"Ropsten",testnet:!0,blockExplorer:{name:"Etherscan (Ropsten)",rootUrl:"https://ropsten.etherscan.io/"},ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e"},[rq.RINKEBY]:{chainId:rq.RINKEBY,name:"rinkeby",title:"Rinkeby",testnet:!0,blockExplorer:{name:"Etherscan (Rinkeby)",rootUrl:"https://rinkeby.etherscan.io/"},ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",disabled:!0},[rq.GOERLI]:{chainId:rq.GOERLI,name:"goerli",title:"Goerli",testnet:!0,blockExplorer:{name:"Etherscan (Goerli)",rootUrl:"https://goerli.etherscan.io/"},ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e"},[rq.KOVAN]:{chainId:rq.KOVAN,name:"kovan",title:"Kovan",testnet:!0,blockExplorer:{name:"Etherscan (Kovan)",rootUrl:"https://kovan.etherscan.io/"}},[rq.POLYGON]:{chainId:rq.POLYGON,name:"polygon",title:"Polygon",blockExplorer:{name:"Polygonscan",rootUrl:"https://polygonscan.com/"}},[rq.POLYGON_MUMBAI]:{chainId:rq.POLYGON_MUMBAI,name:"mumbai",title:"Polygon Mumbai",testnet:!0,blockExplorer:{name:"Polygonscan (Mumbai)",rootUrl:"https://mumbai.polygonscan.com/"}},[rq.POLYGON_ZKEVM]:{chainId:rq.POLYGON_ZKEVM,name:"polygon-zkevm",title:"Polygon zkEVM",blockExplorer:{name:"Polygonscan (zkEVM)",rootUrl:"https://zkevm.polygonscan.com/"}},[rq.BSC]:{chainId:rq.BSC,name:"bsc",title:"BNB Smart Chain",blockExplorer:{name:"BSCScan",rootUrl:"https://bscscan.com/"}},[rq.BSC_TESTNET]:{chainId:rq.BSC_TESTNET,name:"bsc-testnet",title:"BNB Smart Chain Testnet",testnet:!0,blockExplorer:{name:"BSCScan (Testnet)",rootUrl:"https://testnet.bscscan.com/"}},[rq.OPTIMISM]:{chainId:rq.OPTIMISM,name:"optimism",title:"Optimism",blockExplorer:{name:"Etherscan (Optimism)",rootUrl:"https://optimistic.etherscan.io/"}},[rq.OPTIMISM_TESTNET]:{chainId:rq.OPTIMISM_TESTNET,name:"optimism-testnet",title:"Optimistic Kovan",testnet:!0,blockExplorer:{name:"Etherscan (Optimism Testnet)",rootUrl:"https://kovan-optimistic.etherscan.io/"}},[rq.ARBITRUM]:{chainId:rq.ARBITRUM,name:"arbitrum",title:"Arbitrum One",blockExplorer:{name:"Arbiscan",rootUrl:"https://arbiscan.io/"}},[rq.ARBITRUM_GOERLI]:{chainId:rq.ARBITRUM_GOERLI,name:"arbitrum-goerli",title:"Arbitrum Goerli",testnet:!0,blockExplorer:{name:"Arbiscan (Testnet)",rootUrl:"https://testnet.arbiscan.io/"}},[rq.ARBITRUM_NOVA]:{chainId:rq.ARBITRUM_NOVA,name:"arbitrum-nova",title:"Arbitrum Nova",blockExplorer:{name:"Nova Explorer",rootUrl:"https://nova-explorer.arbitrum.io/"}},[rq.AVALANCHE]:{chainId:rq.AVALANCHE,name:"avalanche",title:"Avalanche",blockExplorer:{name:"Snowtrace",rootUrl:"https://snowtrace.io/"}},[rq.AVALANCHE_TESTNET]:{chainId:rq.AVALANCHE_TESTNET,name:"avalanche-testnet",title:"Avalanche Testnet",testnet:!0,blockExplorer:{name:"Snowtrace (Testnet)",rootUrl:"https://testnet.snowtrace.io/"}},[rq.FANTOM]:{chainId:rq.FANTOM,name:"fantom",title:"Fantom",blockExplorer:{name:"FTMScan",rootUrl:"https://ftmscan.com/"}},[rq.FANTOM_TESTNET]:{chainId:rq.FANTOM_TESTNET,name:"fantom-testnet",title:"Fantom Testnet",testnet:!0,blockExplorer:{name:"FTMScan (Testnet)",rootUrl:"https://testnet.ftmscan.com/"}},[rq.GNOSIS]:{chainId:rq.GNOSIS,name:"gnosis",title:"Gnosis Chain",blockExplorer:{name:"Gnosis Chain Explorer",rootUrl:"https://blockscout.com/xdai/mainnet/"}},[rq.AURORA]:{chainId:rq.AURORA,name:"aurora",title:"Aurora",blockExplorer:{name:"Aurora Explorer",rootUrl:"https://aurorascan.dev/"}},[rq.AURORA_TESTNET]:{chainId:rq.AURORA_TESTNET,name:"aurora-testnet",title:"Aurora Testnet",blockExplorer:{name:"Aurora Explorer (Testnet)",rootUrl:"https://testnet.aurorascan.dev/"}},[rq.BASE_GOERLI]:{chainId:rq.BASE_GOERLI,name:"base-goerli",title:"Base Goerli",blockExplorer:{name:"Base Goerli Explorer",rootUrl:"https://goerli.basescan.org/"}}};eq([Qj({},sq[rq.MAINNET],{rpcUrl:oq("mainnet"),relayer:{url:aq("mainnet")},indexerUrl:iq("mainnet")}),Qj({},sq[rq.POLYGON],{rpcUrl:oq("polygon"),relayer:{url:aq("polygon")},indexerUrl:iq("polygon"),isDefaultChain:!0,isAuthChain:!0}),Qj({},sq[rq.BSC],{rpcUrl:oq("bsc"),indexerUrl:iq("bsc"),relayer:{url:aq("bsc")}}),Qj({},sq[rq.AVALANCHE],{rpcUrl:oq("avalanche"),indexerUrl:iq("avalanche"),relayer:{url:aq("avalanche")}}),Qj({},sq[rq.ARBITRUM],{rpcUrl:oq("arbitrum"),indexerUrl:iq("arbitrum"),relayer:{url:aq("arbitrum")}}),Qj({},sq[rq.ARBITRUM_NOVA],{rpcUrl:oq("arbitrum-nova"),indexerUrl:iq("arbitrum-nova"),relayer:{url:aq("arbitrum-nova")}}),Qj({},sq[rq.OPTIMISM],{rpcUrl:oq("optimism"),indexerUrl:iq("optimism"),relayer:{url:aq("optimism")}}),Qj({},sq[rq.POLYGON_ZKEVM],{rpcUrl:oq("polygon-zkevm"),indexerUrl:iq("polygon-zkevm"),relayer:{url:aq("polygon-zkevm")}}),Qj({},sq[rq.GNOSIS],{rpcUrl:oq("gnosis"),indexerUrl:iq("gnosis"),relayer:{url:aq("gnosis")}})]),eq([Qj({},sq[rq.RINKEBY],{rpcUrl:oq("rinkeby"),relayer:{url:aq("rinkeby")},indexerUrl:iq("rinkeby")}),Qj({},sq[rq.GOERLI],{rpcUrl:oq("goerli"),relayer:{url:aq("goerli")},indexerUrl:iq("goerli")}),Qj({},sq[rq.POLYGON_MUMBAI],{rpcUrl:oq("mumbai"),relayer:{url:aq("mumbai")},indexerUrl:iq("mumbai"),isDefaultChain:!0,isAuthChain:!0}),Qj({},sq[rq.BSC_TESTNET],{rpcUrl:oq("bsc-testnet"),relayer:{url:aq("bsc-testnet")},indexerUrl:iq("bsc-testnet")}),Qj({},sq[rq.ARBITRUM_GOERLI],{rpcUrl:oq("arbitrum-goerli"),relayer:{url:aq("arbitrum-goerli")},indexerUrl:iq("arbitrum-goerli")}),Qj({},sq[rq.BASE_GOERLI],{rpcUrl:oq("base-goerli"),relayer:{url:aq("base-goerli")},indexerUrl:iq("base-goerli")})]);const cq="2.0";function uq(){return uq=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},uq.apply(this,arguments)}let fq;function dq(e,t){return e.reduce((function(e,n,r){return t(n,r)?e[0].push(n):e[1].push(n),e}),[[],[]])}!function(e){e.ethCall="eth_call",e.ethGetBalance="eth_getBalance",e.ethGetCode="eth_getCode"}(fq||(fq={}));const lq={batchSize:50,timeWindow:50,contract:"0xd130B43062D875a4B7aF3f8fc036Bc6e9D3E1B3E",verbose:!1};let pq=class e{constructor(t){var n=this;if(this.batchableJsonRpcMethods=[fq.ethCall,fq.ethGetCode,fq.ethGetBalance],this.multicallInterface=new Ss(Wj.sequenceUtils.abi),this.options=void 0,this.timeout=void 0,this.queue=[],this.scheduleExecution=()=>{this.queue.length>0&&(this.timeout&&clearTimeout(this.timeout),this.timeout=setTimeout(this.run,this.options.timeWindow))},this.handle=(e,t,n)=>this.batchableJsonRpcMethods.find((e=>e===t.method))?(this.queue.push({request:t,callback:n,next:e}),this.options.verbose&&console.log("Scheduling call",t.method),void this.scheduleExecution()):(this.options.verbose&&console.log("Forwarded call",t.method),e(t,n)),this.run=async function(){n.options.verbose&&console.log("Processing multicall");const e=Math.min(n.options.batchSize,n.queue.length);if(0===e)return;if(1===e)return n.forward(n.queue[0]),n.queue=[],void(n.options.verbose&&console.log("Skip multicall, single item"));n.options.verbose&&console.log("Resolving",e);var t=n.queue.slice(0,e);n.queue=e===n.queue.length?[]:n.queue.slice(e),n.options.verbose&&console.log("Updated queue",n.queue.length),0!==n.queue.length&&n.scheduleExecution();const r=t[0].next;let i;var[t,a]=dq(t,(e=>{try{if(e.next!==r)return!1;switch(e.request.method){case fq.ethCall:if(e.request.params[0].from||e.request.params[0].gasPrice||e.request.params[0].value)return!1;case fq.ethGetBalance:case fq.ethGetCode:const t=function(e){if(void 0===e)return"latest";switch(e){case"earliest":case"latest":case"pending":return e}return Hr.from(e)}(e.request.params[1]);if(void 0===i&&(i=t),!function(e,t){return e===t||(Hr.isBigNumber(e)?!!Hr.isBigNumber(t)&&e.eq(t):!Hr.isBigNumber(t)&&e===t)}(t,i))return!1}return!0}catch(e){return!1}}));if(0!==a.length&&(n.options.verbose&&console.log("Forwarding incompatible calls",a.length),n.forward(a),0===t.length))return;let o=t.map((e=>{try{switch(e.request.method){case fq.ethCall:return{delegateCall:!1,revertOnError:!1,target:e.request.params[0].to,data:e.request.params[0].data,gasLimit:e.request.params[0].gas?e.request.params[0].gas:0,value:0};case fq.ethGetCode:return{delegateCall:!1,revertOnError:!1,target:n.options.contract,gasLimit:0,value:0,data:n.multicallInterface.encodeFunctionData(n.multicallInterface.getFunction("callCode"),[e.request.params[0]])};case fq.ethGetBalance:return{delegateCall:!1,revertOnError:!1,target:n.options.contract,gasLimit:0,value:0,data:n.multicallInterface.encodeFunctionData(n.multicallInterface.getFunction("callBalanceOf"),[e.request.params[0]])};default:return null}}catch(e){return null}}));var[t,a]=dq(t,((e,t)=>void 0!==o[t]));if(o=o.filter((e=>e)),0!==a.length&&(n.options.verbose&&console.log("Forwarding calls on error",a.length),n.forward(a),0===t.length))return;let s;try{s=n.multicallInterface.encodeFunctionData(n.multicallInterface.getFunction("multiCall"),[o])}catch(e){return void n.forward(t)}const c=Yj(),u=await async function(e,t){try{return await e}catch(e){return t instanceof Function?t(e):t}}(Jj(r)({id:c,jsonrpc:cq,method:fq.ethCall,params:[{to:n.options.contract,value:0,data:s},Hr.isBigNumber(i)?i.toNumber():i]}),(e=>({jsonrpc:cq,id:c,result:void 0,error:e})));if(u.error)return n.forward(t);let f;try{f=n.multicallInterface.decodeFunctionResult(n.multicallInterface.getFunction("multiCall"),u.result)}catch(e){return void n.forward(t)}n.options.verbose&&console.log("Got response for",t.length),t.forEach(((e,t)=>{if(f[0][t])switch(e.request.method){case fq.ethCall:e.callback(void 0,{jsonrpc:e.request.jsonrpc,id:e.request.id,result:f[1][t]});break;case fq.ethGetCode:e.callback(void 0,{jsonrpc:e.request.jsonrpc,id:e.request.id,result:wo.decode(["bytes"],f[1][t])[0]});break;case fq.ethGetBalance:e.callback(void 0,{jsonrpc:e.request.jsonrpc,id:e.request.id,result:wo.decode(["uint256"],f[1][t])[0]})}else n.forward(e)}))},this.options=t?uq({},e.DefaultOptions,t):e.DefaultOptions,this.options.batchSize<=0)throw new Error(`Invalid batch size of ${this.options.batchSize}`)}forward(e){Array.isArray(e)?e.forEach((e=>e.next(e.request,e.callback))):e.next(e.request,e.callback)}static isMulticall(t){return t&&void 0!==t.handle&&void 0!==t.conf&&e.isMulticallOptions(t.options)}static isMulticallOptions(e){return void 0!==e&&void 0!==e.batchSize&&void 0!==e.timeWindow&&void 0!==e.contract}};pq.DefaultOptions=uq({},lq);const hq=["getNetwork","getBlockNumber","getGasPrice","getTransactionCount","getStorageAt","sendTransaction","estimateGas","getBlock","getTransaction","getTransactionReceipt","getLogs","emit","litenerCount","addListener","removeListener","waitForTransaction","detectNetwork","getBlockWithTransactions"];var bq=Object.freeze({__proto__:null,ProxyMethods:hq,MulticallProvider:class extends Lp{constructor(e,t){var n;super(e.getNetwork()),n=this,this.provider=e,this.multicall=void 0,this.listenerCount=this.provider.listenerCount,this.getResolver=async function(e){const t=n.provider;if(t.getResolver){const r=await t.getResolver(await e);return r?new Bp(n,r.address,r.name):null}return t.getResolver(await e)},this.next=async function(e,t){try{switch(e.method){case fq.ethCall:n.callback(e,t,await n.provider.call(e.params[0],e.params[1]));break;case fq.ethGetCode:n.callback(e,t,await n.provider.getCode(e.params[0],e.params[1]));break;case fq.ethGetBalance:n.callback(e,t,await n.provider.getBalance(e.params[0],e.params[1]))}}catch(r){n.callback(e,t,void 0,r)}},this.multicall=pq.isMulticall(t)?t:new pq(t),hq.forEach((t=>{void 0!==e[t]&&(this[t]=(...n)=>e[t](...n))}))}callback(e,t,n,r){t(r,{jsonrpc:cq,id:e.id,result:n,error:r})}async call(e,t){return this.rpcCall(fq.ethCall,e,t)}async getCode(e,t){return this.rpcCall(fq.ethGetCode,e,t)}async getBalance(e,t){return this.rpcCall(fq.ethGetBalance,e,t)}async rpcCall(e,...t){const n=Yj();return(await Jj(this.multicall.handle)(this.next,{jsonrpc:cq,id:n,method:e,params:t})).result}},MulticallExternalProvider:class{constructor(e,t){if(this.provider=e,this.multicall=void 0,this.multicall=pq.isMulticall(t)?t:new pq(t),e.send){const t=async function(t,n){e.send(t,n)};this.send=(e,n)=>{this.multicall.handle(t,e,n)}}if(e.sendAsync){const t=async function(t,n){e.sendAsync(t,n)};this.sendAsync=(e,n)=>{this.multicall.handle(t,e,n)}}}get isMetaMask(){return this.provider.isMetaMask}get isStatus(){return this.provider.isStatus}},multicallMiddleware:e=>t=>{const n=pq.isMulticall(e)?e:new pq(e);return(e,r)=>n.handle(t,e,r)}}),mq=Object.freeze({__proto__:null,Multicall:pq,providers:bq});let yq,gq;try{yq=localStorage}catch(e){const t=new Map;yq={getItem:e=>{var n;return null!=(n=t.get(e))?n:null},setItem:(e,n)=>t.set(e,n),removeItem:e=>t.delete(e)}}function vq(e){return void 0!==e.address&&!function(e){return wq(e)||_q(e)||Eq(e)}(e)}function wq(e){const t=e;return void 0!==t.signature&&void 0===t.address}function _q(e){const t=e;return void 0!==t.r&&void 0!==t.s&&void 0!==t.v&&void 0!==t.t}function Eq(e){const t=e;return void 0!==t.address&&void 0!==t.signature}!function(e){e[e.EOA=0]="EOA",e[e.Address=1]="Address",e[e.Full=2]="Full"}(gq||(gq={}));const Tq=e=>{if("string"!=typeof e)return e;const t=e.replace("0x",""),n=Hr.from(`0x${t.slice(0,4)}`).toNumber(),r=[];for(let e=4;e<t.length;){const n=Hr.from(t.slice(e,e+2)).toNumber();e+=2;const i=Hr.from(`0x${t.slice(e,e+2)}`).toNumber();switch(e+=2,n){case gq.Address:const n=la(t.slice(e,e+40));e+=40,r.push({weight:i,address:n});break;case gq.EOA:const a=_r(`0x${t.slice(e,e+132)}`);e+=132;const o=Nr(a.slice(0,65)),s=o.r,c=o.s,u=o.v,f=Hr.from(a[a.length-1]).toNumber();r.push({weight:i,signature:a,r:s,s:c,v:u,t:f});break;case gq.Full:const d=la(t.slice(e,e+40));e+=40;const l=Hr.from(`0x${t.slice(e,e+4)}`).mul(2).toNumber();e+=4;const p=_r(`0x${t.slice(e,e+l)}`);e+=l,r.push({weight:i,address:d,signature:p});break;default:throw Error("Signature type not supported")}}return{threshold:n,signers:r}},Aq=e=>{if("string"==typeof e)return Aq(Tq(e));const t=e.signers.map((e=>{if(vq(e))return ub(["uint8","uint8","address"],[gq.Address,e.weight,e.address]);if(_q(e))return ub(["uint8","uint8","bytes32","bytes32","uint8","uint8"],[gq.EOA,e.weight,e.r,e.s,e.v,e.t]);if(Eq(e)){const t=_r(e.signature).length;return ub(["uint8","uint8","address","uint16","bytes"],[gq.Full,e.weight,e.address,t,e.signature])}if(wq(e))return ub(["uint8","uint8","bytes"],[gq.EOA,e.weight,e.signature]);throw Error("Unkwnown signature part type")}));return ub(["uint16",...Array(t.length).fill("bytes")],[e.threshold,...t])};var Rq;!function(e){e.AUTHENTICATION_ERROR="AUTHENTICATION_ERROR",e.INVALID_CONFIGURATION="INVALID_CONFIGURATION",e.WALLET_CONNECTION_ERROR="WALLET_CONNECTION_ERROR",e.NOT_LOGGED_IN_ERROR="NOT_LOGGED_IN_ERROR",e.SILENT_LOGIN_ERROR="SILENT_LOGIN_ERROR",e.REFRESH_TOKEN_ERROR="REFRESH_TOKEN_ERROR",e.USER_REGISTRATION_ERROR="USER_REGISTRATION_ERROR",e.LOGOUT_ERROR="LOGOUT_ERROR",e.TRANSFER_ERROR="TRANSFER_ERROR",e.CREATE_ORDER_ERROR="CREATE_ORDER_ERROR",e.CANCEL_ORDER_ERROR="CANCEL_ORDER_ERROR",e.EXCHANGE_TRANSFER_ERROR="EXCHANGE_TRANSFER_ERROR",e.CREATE_TRADE_ERROR="CREATE_TRADE_ERROR",e.OPERATION_NOT_SUPPORTED_ERROR="OPERATION_NOT_SUPPORTED_ERROR"}(Rq||(Rq={}));class Sq extends Error{type;constructor(e,t){super(e),this.type=t}}const kq=async(e,t)=>{try{return await e()}catch(e){let n;throw n=Ke(e)&&e.response?.data&&function(e){return"code"in e&&"message"in e}(e.response.data)?e.response.data.message:e.message,new Sq(n,t)}},Iq="passport_credentials",Oq="pkce_state",xq="pkce_verifier";class Cq{saveCredentials(e){if(!this.areValid(e))throw Error("Invalid credentials.");localStorage.setItem(Iq,JSON.stringify(e))}getCredentials(){const e=localStorage.getItem(Iq);return e?JSON.parse(e):null}areValid(e){if(e){const t=this.isTokenValid(e.access_token),n=this.isTokenValid(e.id_token);return t&&n}return!1}isTokenValid(e){try{const t=aB(e).exp??0;return t>Date.now()/1e3+3600}catch(e){return!1}}clearCredentials(){localStorage.removeItem(Iq)}savePKCEData(e){localStorage.setItem(Oq,e.state),localStorage.setItem(xq,e.verifier)}getPKCEData(){const e=localStorage.getItem(Oq),t=localStorage.getItem(xq);return e&&t?{state:e,verifier:t}:null}}const Mq={headers:{"Content-Type":"application/x-www-form-urlencoded"}};function Pq(e){return new Promise((t=>{setTimeout(t,e)}))}class Nq{userManager;config;deviceCredentialsManager;logoutMode;constructor(e){this.config=e,this.userManager=new class{constructor(e){this._logger=new dB("UserManager"),this.settings=new UB(e),this._client=new class{constructor(e){this._logger=new dB("OidcClient"),this.settings=new AB(e),this.metadataService=new class{constructor(e){this._settings=e,this._logger=new dB("MetadataService"),this._signingKeys=null,this._metadata=null,this._metadataUrl=this._settings.metadataUrl,this._jsonService=new EB(["application/jwk-set+json"],null,this._settings.extraHeaders),this._settings.signingKeys&&(this._logger.debug("using signingKeys from settings"),this._signingKeys=this._settings.signingKeys),this._settings.metadata&&(this._logger.debug("using metadata from settings"),this._metadata=this._settings.metadata),this._settings.fetchRequestCredentials&&(this._logger.debug("using fetchRequestCredentials from settings"),this._fetchRequestCredentials=this._settings.fetchRequestCredentials)}resetSigningKeys(){this._signingKeys=null}async getMetadata(){const e=this._logger.create("getMetadata");if(this._metadata)return e.debug("using cached values"),this._metadata;if(!this._metadataUrl)throw e.throw(new Error("No authority or metadataUrl configured on settings")),null;e.debug("getting metadata from",this._metadataUrl);const t=await this._jsonService.getJson(this._metadataUrl,{credentials:this._fetchRequestCredentials});return e.debug("merging remote JSON with seed metadata"),this._metadata=Object.assign({},this._settings.metadataSeed,t),this._metadata}getIssuer(){return this._getMetadataProperty("issuer")}getAuthorizationEndpoint(){return this._getMetadataProperty("authorization_endpoint")}getUserInfoEndpoint(){return this._getMetadataProperty("userinfo_endpoint")}getTokenEndpoint(e=!0){return this._getMetadataProperty("token_endpoint",e)}getCheckSessionIframe(){return this._getMetadataProperty("check_session_iframe",!0)}getEndSessionEndpoint(){return this._getMetadataProperty("end_session_endpoint",!0)}getRevocationEndpoint(e=!0){return this._getMetadataProperty("revocation_endpoint",e)}getKeysEndpoint(e=!0){return this._getMetadataProperty("jwks_uri",e)}async _getMetadataProperty(e,t=!1){const n=this._logger.create(`_getMetadataProperty('${e}')`),r=await this.getMetadata();if(n.debug("resolved"),void 0===r[e]){if(!0===t)return void n.warn("Metadata does not contain optional property");n.throw(new Error("Metadata does not contain property "+e))}return r[e]}async getSigningKeys(){const e=this._logger.create("getSigningKeys");if(this._signingKeys)return e.debug("returning signingKeys from cache"),this._signingKeys;const t=await this.getKeysEndpoint(!1);e.debug("got jwks_uri",t);const n=await this._jsonService.getJson(t);if(e.debug("got key set",n),!Array.isArray(n.keys))throw e.throw(new Error("Missing keys on keyset")),null;return this._signingKeys=n.keys,this._signingKeys}}(this.settings),this._claimsService=new class{constructor(e){this._settings=e,this._logger=new dB("ClaimsService")}filterProtocolClaims(e){const t={...e};if(this._settings.filterProtocolClaims){let e;e=Array.isArray(this._settings.filterProtocolClaims)?this._settings.filterProtocolClaims:OB;for(const n of e)xB.includes(n)||delete t[n]}return t}mergeClaims(e,t){const n={...e};for(const[e,r]of Object.entries(t))for(const t of Array.isArray(r)?r:[r]){const r=n[e];r?Array.isArray(r)?r.includes(t)||r.push(t):n[e]!==t&&("object"==typeof t&&this._settings.mergeClaims?n[e]=this.mergeClaims(r,t):n[e]=[r,t]):n[e]=t}return n}}(this.settings),this._validator=new class{constructor(e,t,n){this._settings=e,this._metadataService=t,this._claimsService=n,this._logger=new dB("ResponseValidator"),this._userInfoService=new class{constructor(e,t){this._settings=e,this._metadataService=t,this._logger=new dB("UserInfoService"),this._getClaimsFromJwt=async e=>{const t=this._logger.create("_getClaimsFromJwt");try{const n=hB.decode(e);return t.debug("JWT decoding successful"),n}catch(e){throw t.error("Error parsing JWT response"),e}},this._jsonService=new EB(void 0,this._getClaimsFromJwt,this._settings.extraHeaders)}async getClaims(e){const t=this._logger.create("getClaims");e||this._logger.throw(new Error("No token passed"));const n=await this._metadataService.getUserInfoEndpoint();t.debug("got userinfo url",n);const r=await this._jsonService.getJson(n,{token:e,credentials:this._settings.fetchRequestCredentials});return t.debug("got claims",r),r}}(this._settings,this._metadataService),this._tokenClient=new RB(this._settings,this._metadataService)}async validateSigninResponse(e,t){const n=this._logger.create("validateSigninResponse");this._processSigninState(e,t),n.debug("state processed"),await this._processCode(e,t),n.debug("code processed"),e.isOpenId&&this._validateIdTokenAttributes(e),n.debug("tokens validated"),await this._processClaims(e,null==t?void 0:t.skipUserInfo,e.isOpenId),n.debug("claims processed")}async validateCredentialsResponse(e,t){const n=this._logger.create("validateCredentialsResponse");e.isOpenId&&this._validateIdTokenAttributes(e),n.debug("tokens validated"),await this._processClaims(e,t,e.isOpenId),n.debug("claims processed")}async validateRefreshResponse(e,t){const n=this._logger.create("validateRefreshResponse");e.userState=t.data,null!=e.session_state||(e.session_state=t.session_state),null!=e.scope||(e.scope=t.scope),e.isOpenId&&e.id_token&&(this._validateIdTokenAttributes(e,t.id_token),n.debug("ID Token validated")),e.id_token||(e.id_token=t.id_token,e.profile=t.profile);const r=e.isOpenId&&!!e.id_token;await this._processClaims(e,!1,r),n.debug("claims processed")}validateSignoutResponse(e,t){const n=this._logger.create("validateSignoutResponse");if(t.id!==e.state&&n.throw(new Error("State does not match")),n.debug("state validated"),e.userState=t.data,e.error)throw n.warn("Response was error",e.error),new gB(e)}_processSigninState(e,t){const n=this._logger.create("_processSigninState");if(t.id!==e.state&&n.throw(new Error("State does not match")),t.client_id||n.throw(new Error("No client_id on state")),t.authority||n.throw(new Error("No authority on state")),this._settings.authority!==t.authority&&n.throw(new Error("authority mismatch on settings vs. signin state")),this._settings.client_id&&this._settings.client_id!==t.client_id&&n.throw(new Error("client_id mismatch on settings vs. signin state")),n.debug("state validated"),e.userState=t.data,null!=e.scope||(e.scope=t.scope),e.error)throw n.warn("Response was error",e.error),new gB(e);t.code_verifier&&!e.code&&n.throw(new Error("Expected code in response"))}async _processClaims(e,t=!1,n=!0){const r=this._logger.create("_processClaims");if(e.profile=this._claimsService.filterProtocolClaims(e.profile),t||!this._settings.loadUserInfo||!e.access_token)return void r.debug("not loading user info");r.debug("loading user info");const i=await this._userInfoService.getClaims(e.access_token);r.debug("user info claims received from user info endpoint"),n&&i.sub!==e.profile.sub&&r.throw(new Error("subject from UserInfo response does not match subject in ID Token")),e.profile=this._claimsService.mergeClaims(e.profile,this._claimsService.filterProtocolClaims(i)),r.debug("user info claims received, updated profile:",e.profile)}async _processCode(e,t){const n=this._logger.create("_processCode");if(e.code){n.debug("Validating code");const r=await this._tokenClient.exchangeCode({client_id:t.client_id,client_secret:t.client_secret,code:e.code,redirect_uri:t.redirect_uri,code_verifier:t.code_verifier,...t.extraTokenParams});Object.assign(e,r)}else n.debug("No code to process")}_validateIdTokenAttributes(e,t){var n;const r=this._logger.create("_validateIdTokenAttributes");r.debug("decoding ID Token JWT");const i=hB.decode(null!=(n=e.id_token)?n:"");if(i.sub||r.throw(new Error("ID Token is missing a subject claim")),t){const e=hB.decode(t);i.sub!==e.sub&&r.throw(new Error("sub in id_token does not match current sub")),i.auth_time&&i.auth_time!==e.auth_time&&r.throw(new Error("auth_time in id_token does not match original auth_time")),i.azp&&i.azp!==e.azp&&r.throw(new Error("azp in id_token does not match original azp")),!i.azp&&e.azp&&r.throw(new Error("azp not in id_token, but present in original id_token"))}e.profile=i}}(this.settings,this.metadataService,this._claimsService),this._tokenClient=new RB(this.settings,this.metadataService)}async createSigninRequest({state:e,request:t,request_uri:n,request_type:r,id_token_hint:i,login_hint:a,skipUserInfo:o,nonce:s,response_type:c=this.settings.response_type,scope:u=this.settings.scope,redirect_uri:f=this.settings.redirect_uri,prompt:d=this.settings.prompt,display:l=this.settings.display,max_age:p=this.settings.max_age,ui_locales:h=this.settings.ui_locales,acr_values:b=this.settings.acr_values,resource:m=this.settings.resource,response_mode:y=this.settings.response_mode,extraQueryParams:g=this.settings.extraQueryParams,extraTokenParams:v=this.settings.extraTokenParams}){const w=this._logger.create("createSigninRequest");if("code"!==c)throw new Error("Only the Authorization Code flow (with PKCE) is supported");const _=await this.metadataService.getAuthorizationEndpoint();w.debug("Received authorization endpoint",_);const E=new class{constructor({url:e,authority:t,client_id:n,redirect_uri:r,response_type:i,scope:a,state_data:o,response_mode:s,request_type:c,client_secret:u,nonce:f,resource:d,skipUserInfo:l,extraQueryParams:p,extraTokenParams:h,disablePKCE:b,...m}){if(this._logger=new dB("SigninRequest"),!e)throw this._logger.error("ctor: No url passed"),new Error("url");if(!n)throw this._logger.error("ctor: No client_id passed"),new Error("client_id");if(!r)throw this._logger.error("ctor: No redirect_uri passed"),new Error("redirect_uri");if(!i)throw this._logger.error("ctor: No response_type passed"),new Error("response_type");if(!a)throw this._logger.error("ctor: No scope passed"),new Error("scope");if(!t)throw this._logger.error("ctor: No authority passed"),new Error("authority");this.state=new kB({data:o,request_type:c,code_verifier:!b,client_id:n,authority:t,redirect_uri:r,response_mode:s,client_secret:u,scope:a,extraTokenParams:h,skipUserInfo:l});const y=new URL(e);y.searchParams.append("client_id",n),y.searchParams.append("redirect_uri",r),y.searchParams.append("response_type",i),y.searchParams.append("scope",a),f&&y.searchParams.append("nonce",f),y.searchParams.append("state",this.state.id),this.state.code_challenge&&(y.searchParams.append("code_challenge",this.state.code_challenge),y.searchParams.append("code_challenge_method","S256")),d&&(Array.isArray(d)?d:[d]).forEach((e=>y.searchParams.append("resource",e)));for(const[e,t]of Object.entries({response_mode:s,...m,...p}))null!=t&&y.searchParams.append(e,t.toString());this.url=y.href}}({url:_,authority:this.settings.authority,client_id:this.settings.client_id,redirect_uri:f,response_type:c,scope:u,state_data:e,prompt:d,display:l,max_age:p,ui_locales:h,id_token_hint:i,login_hint:a,acr_values:b,resource:m,request:t,request_uri:n,extraQueryParams:g,extraTokenParams:v,request_type:r,response_mode:y,client_secret:this.settings.client_secret,skipUserInfo:o,nonce:s,disablePKCE:this.settings.disablePKCE});await this.clearStaleState();const T=E.state;return await this.settings.stateStore.set(T.id,T.toStorageString()),E}async readSigninResponseState(e,t=!1){const n=this._logger.create("readSigninResponseState"),r=new IB(yB.readParams(e,this.settings.response_mode));if(!r.state)throw n.throw(new Error("No state in response")),null;const i=await this.settings.stateStore[t?"remove":"get"](r.state);if(!i)throw n.throw(new Error("No matching state found in storage")),null;return{state:kB.fromStorageString(i),response:r}}async processSigninResponse(e){const t=this._logger.create("processSigninResponse"),{state:n,response:r}=await this.readSigninResponseState(e,!0);return t.debug("received state from storage; validating response"),await this._validator.validateSigninResponse(r,n),r}async processResourceOwnerPasswordCredentials({username:e,password:t,skipUserInfo:n=!1,extraTokenParams:r={}}){const i=await this._tokenClient.exchangeCredentials({username:e,password:t,...r}),a=new IB(new URLSearchParams);return Object.assign(a,i),await this._validator.validateCredentialsResponse(a,n),a}async useRefreshToken({state:e,timeoutInSeconds:t}){var n;const r=this._logger.create("useRefreshToken");let i;if(void 0===this.settings.refreshTokenAllowedScope)i=e.scope;else{const t=this.settings.refreshTokenAllowedScope.split(" ");i=((null==(n=e.scope)?void 0:n.split(" "))||[]).filter((e=>t.includes(e))).join(" ")}const a=await this._tokenClient.exchangeRefreshToken({refresh_token:e.refresh_token,scope:i,timeoutInSeconds:t}),o=new IB(new URLSearchParams);return Object.assign(o,a),r.debug("validating response",o),await this._validator.validateRefreshResponse(o,{...e,scope:i}),o}async createSignoutRequest({state:e,id_token_hint:t,request_type:n,post_logout_redirect_uri:r=this.settings.post_logout_redirect_uri,extraQueryParams:i=this.settings.extraQueryParams}={}){const a=this._logger.create("createSignoutRequest"),o=await this.metadataService.getEndSessionEndpoint();if(!o)throw a.throw(new Error("No end session endpoint")),null;a.debug("Received end session endpoint",o);const s=new class{constructor({url:e,state_data:t,id_token_hint:n,post_logout_redirect_uri:r,extraQueryParams:i,request_type:a}){if(this._logger=new dB("SignoutRequest"),!e)throw this._logger.error("ctor: No url passed"),new Error("url");const o=new URL(e);n&&o.searchParams.append("id_token_hint",n),r&&(o.searchParams.append("post_logout_redirect_uri",r),t&&(this.state=new SB({data:t,request_type:a}),o.searchParams.append("state",this.state.id)));for(const[e,t]of Object.entries({...i}))null!=t&&o.searchParams.append(e,t.toString());this.url=o.href}}({url:o,id_token_hint:t,post_logout_redirect_uri:r,state_data:e,extraQueryParams:i,request_type:n});await this.clearStaleState();const c=s.state;return c&&(a.debug("Signout request has state to persist"),await this.settings.stateStore.set(c.id,c.toStorageString())),s}async readSignoutResponseState(e,t=!1){const n=this._logger.create("readSignoutResponseState"),r=new class{constructor(e){this.state=e.get("state"),this.error=e.get("error"),this.error_description=e.get("error_description"),this.error_uri=e.get("error_uri")}}(yB.readParams(e,this.settings.response_mode));if(!r.state){if(n.debug("No state in response"),r.error)throw n.warn("Response was error:",r.error),new gB(r);return{state:void 0,response:r}}const i=await this.settings.stateStore[t?"remove":"get"](r.state);if(!i)throw n.throw(new Error("No matching state found in storage")),null;return{state:SB.fromStorageString(i),response:r}}async processSignoutResponse(e){const t=this._logger.create("processSignoutResponse"),{state:n,response:r}=await this.readSignoutResponseState(e,!0);return n?(t.debug("Received state from storage; validating response"),this._validator.validateSignoutResponse(r,n)):t.debug("No state from storage; skipping response validation"),r}clearStaleState(){return this._logger.create("clearStaleState"),SB.clearStaleState(this.settings.stateStore,this.settings.staleStateAgeInSeconds)}async revokeToken(e,t){return this._logger.create("revokeToken"),await this._tokenClient.revoke({token:e,token_type_hint:t})}}(e),this._redirectNavigator=new class{constructor(e){this._settings=e,this._logger=new dB("RedirectNavigator")}async prepare({redirectMethod:e=this._settings.redirectMethod,redirectTarget:t=this._settings.redirectTarget}){var n;this._logger.create("prepare");let r=window.self;"top"===t&&(r=null!=(n=window.top)?n:window.self);const i=r.location[e].bind(r.location);let a;return{navigate:async e=>{this._logger.create("navigate");const t=new Promise(((e,t)=>{a=t}));return i(e.url),await t},close:()=>{this._logger.create("close"),null==a||a(new Error("Redirect aborted")),r.stop()}}}}(this.settings),this._popupNavigator=new class{constructor(e){this._settings=e,this._logger=new dB("PopupNavigator")}async prepare({popupWindowFeatures:e=this._settings.popupWindowFeatures,popupWindowTarget:t=this._settings.popupWindowTarget}){return new qB({popupWindowFeatures:e,popupWindowTarget:t})}async callback(e,t=!1){this._logger.create("callback"),qB.notifyOpener(e,t)}}(this.settings),this._iframeNavigator=new class{constructor(e){this._settings=e,this._logger=new dB("IFrameNavigator")}async prepare({silentRequestTimeoutInSeconds:e=this._settings.silentRequestTimeoutInSeconds}){return new jB({silentRequestTimeoutInSeconds:e})}async callback(e){this._logger.create("callback"),jB.notifyParent(e,this._settings.iframeNotifyParentOrigin)}}(this.settings),this._events=new zB(this.settings),this._silentRenewService=new class{constructor(e){this._userManager=e,this._logger=new dB("SilentRenewService"),this._isStarted=!1,this._retryTimer=new mB("Retry Silent Renew"),this._tokenExpiring=async()=>{const e=this._logger.create("_tokenExpiring");try{await this._userManager.signinSilent(),e.debug("silent token renewal successful")}catch(t){if(t instanceof vB)return e.warn("ErrorTimeout from signinSilent:",t,"retry in 5s"),void this._retryTimer.init(5);e.error("Error from signinSilent:",t),this._userManager.events._raiseSilentRenewError(t)}}}async start(){const e=this._logger.create("start");if(!this._isStarted){this._isStarted=!0,this._userManager.events.addAccessTokenExpiring(this._tokenExpiring),this._retryTimer.addHandler(this._tokenExpiring);try{await this._userManager.getUser()}catch(t){e.error("getUser error",t)}}}stop(){this._isStarted&&(this._retryTimer.cancel(),this._retryTimer.removeHandler(this._tokenExpiring),this._userManager.events.removeAccessTokenExpiring(this._tokenExpiring),this._isStarted=!1)}}(this),this.settings.automaticSilentRenew&&this.startSilentRenew(),this._sessionMonitor=null,this.settings.monitorSession&&(this._sessionMonitor=new class{constructor(e){this._userManager=e,this._logger=new dB("SessionMonitor"),this._start=async e=>{const t=e.session_state;if(!t)return;const n=this._logger.create("_start");if(e.profile?(this._sub=e.profile.sub,this._sid=e.profile.sid,n.debug("session_state",t,", sub",this._sub)):(this._sub=void 0,this._sid=void 0,n.debug("session_state",t,", anonymous user")),this._checkSessionIFrame)this._checkSessionIFrame.start(t);else try{const e=await this._userManager.metadataService.getCheckSessionIframe();if(e){n.debug("initializing check session iframe");const r=this._userManager.settings.client_id,i=this._userManager.settings.checkSessionIntervalInSeconds,a=this._userManager.settings.stopCheckSessionOnError,o=new class{constructor(e,t,n,r,i){this._callback=e,this._client_id=t,this._intervalInSeconds=r,this._stopOnError=i,this._logger=new dB("CheckSessionIFrame"),this._timer=null,this._session_state=null,this._message=e=>{e.origin===this._frame_origin&&e.source===this._frame.contentWindow&&("error"===e.data?(this._logger.error("error message from check session op iframe"),this._stopOnError&&this.stop()):"changed"===e.data?(this._logger.debug("changed message from check session op iframe"),this.stop(),this._callback()):this._logger.debug(e.data+" message from check session op iframe"))};const a=new URL(n);this._frame_origin=a.origin,this._frame=window.document.createElement("iframe"),this._frame.style.visibility="hidden",this._frame.style.position="fixed",this._frame.style.left="-1000px",this._frame.style.top="0",this._frame.width="0",this._frame.height="0",this._frame.src=a.href}load(){return new Promise((e=>{this._frame.onload=()=>{e()},window.document.body.appendChild(this._frame),window.addEventListener("message",this._message,!1)}))}start(e){if(this._session_state===e)return;this._logger.create("start"),this.stop(),this._session_state=e;const t=()=>{this._frame.contentWindow&&this._session_state&&this._frame.contentWindow.postMessage(this._client_id+" "+this._session_state,this._frame_origin)};t(),this._timer=setInterval(t,1e3*this._intervalInSeconds)}stop(){this._logger.create("stop"),this._session_state=null,this._timer&&(clearInterval(this._timer),this._timer=null)}}(this._callback,r,e,i,a);await o.load(),this._checkSessionIFrame=o,o.start(t)}else n.warn("no check session iframe found in the metadata")}catch(e){n.error("Error from getCheckSessionIframe:",e instanceof Error?e.message:e)}},this._stop=()=>{const e=this._logger.create("_stop");if(this._sub=void 0,this._sid=void 0,this._checkSessionIFrame&&this._checkSessionIFrame.stop(),this._userManager.settings.monitorAnonymousSession){const t=setInterval((async()=>{clearInterval(t);try{const e=await this._userManager.querySessionStatus();if(e){const t={session_state:e.session_state,profile:e.sub&&e.sid?{sub:e.sub,sid:e.sid}:null};this._start(t)}}catch(t){e.error("error from querySessionStatus",t instanceof Error?t.message:t)}}),1e3)}},this._callback=async()=>{const e=this._logger.create("_callback");try{const t=await this._userManager.querySessionStatus();let n=!0;t&&this._checkSessionIFrame?t.sub===this._sub?(n=!1,this._checkSessionIFrame.start(t.session_state),t.sid===this._sid?e.debug("same sub still logged in at OP, restarting check session iframe; session_state",t.session_state):(e.debug("same sub still logged in at OP, session state has changed, restarting check session iframe; session_state",t.session_state),this._userManager.events._raiseUserSessionChanged())):e.debug("different subject signed into OP",t.sub):e.debug("subject no longer signed into OP"),n?this._sub?this._userManager.events._raiseUserSignedOut():this._userManager.events._raiseUserSignedIn():e.debug("no change in session detected, no event to raise")}catch(t){this._sub&&(e.debug("Error calling queryCurrentSigninSession; raising signed out event",t),this._userManager.events._raiseUserSignedOut())}},e||this._logger.throw(new Error("No user manager passed")),this._userManager.events.addUserLoaded(this._start),this._userManager.events.addUserUnloaded(this._stop),this._init().catch((e=>{this._logger.error(e)}))}async _init(){this._logger.create("_init");const e=await this._userManager.getUser();if(e)this._start(e);else if(this._userManager.settings.monitorAnonymousSession){const e=await this._userManager.querySessionStatus();if(e){const t={session_state:e.session_state,profile:e.sub&&e.sid?{sub:e.sub,sid:e.sid}:null};this._start(t)}}}}(this))}get events(){return this._events}get metadataService(){return this._client.metadataService}async getUser(){const e=this._logger.create("getUser"),t=await this._loadUser();return t?(e.info("user loaded"),this._events.load(t,!1),t):(e.info("user not found in storage"),null)}async removeUser(){const e=this._logger.create("removeUser");await this.storeUser(null),e.info("user removed from storage"),this._events.unload()}async signinRedirect(e={}){this._logger.create("signinRedirect");const{redirectMethod:t,...n}=e,r=await this._redirectNavigator.prepare({redirectMethod:t});await this._signinStart({request_type:"si:r",...n},r)}async signinRedirectCallback(e=window.location.href){const t=this._logger.create("signinRedirectCallback"),n=await this._signinEnd(e);return n.profile&&n.profile.sub?t.info("success, signed in subject",n.profile.sub):t.info("no subject"),n}async signinResourceOwnerCredentials({username:e,password:t,skipUserInfo:n=!1}){const r=this._logger.create("signinResourceOwnerCredential"),i=await this._client.processResourceOwnerPasswordCredentials({username:e,password:t,skipUserInfo:n,extraTokenParams:this.settings.extraTokenParams});r.debug("got signin response");const a=await this._buildUser(i);return a.profile&&a.profile.sub?r.info("success, signed in subject",a.profile.sub):r.info("no subject"),a}async signinPopup(e={}){const t=this._logger.create("signinPopup"),{popupWindowFeatures:n,popupWindowTarget:r,...i}=e,a=this.settings.popup_redirect_uri;a||t.throw(new Error("No popup_redirect_uri configured"));const o=await this._popupNavigator.prepare({popupWindowFeatures:n,popupWindowTarget:r}),s=await this._signin({request_type:"si:p",redirect_uri:a,display:"popup",...i},o);return s&&(s.profile&&s.profile.sub?t.info("success, signed in subject",s.profile.sub):t.info("no subject")),s}async signinPopupCallback(e=window.location.href,t=!1){const n=this._logger.create("signinPopupCallback");await this._popupNavigator.callback(e,t),n.info("success")}async signinSilent(e={}){var t;const n=this._logger.create("signinSilent"),{silentRequestTimeoutInSeconds:r,...i}=e;let a=await this._loadUser();if(null==a?void 0:a.refresh_token){n.debug("using refresh token");const e=new class{constructor(e){this.refresh_token=e.refresh_token,this.id_token=e.id_token,this.session_state=e.session_state,this.scope=e.scope,this.profile=e.profile,this.data=e.state}}(a);return await this._useRefreshToken(e)}const o=this.settings.silent_redirect_uri;let s;o||n.throw(new Error("No silent_redirect_uri configured")),a&&this.settings.validateSubOnSilentRenew&&(n.debug("subject prior to silent renew:",a.profile.sub),s=a.profile.sub);const c=await this._iframeNavigator.prepare({silentRequestTimeoutInSeconds:r});return a=await this._signin({request_type:"si:s",redirect_uri:o,prompt:"none",id_token_hint:this.settings.includeIdTokenInSilentRenew?null==a?void 0:a.id_token:void 0,...i},c,s),a&&((null==(t=a.profile)?void 0:t.sub)?n.info("success, signed in subject",a.profile.sub):n.info("no subject")),a}async _useRefreshToken(e){const t=await this._client.useRefreshToken({state:e,timeoutInSeconds:this.settings.silentRequestTimeoutInSeconds}),n=new CB({...e,...t});return await this.storeUser(n),this._events.load(n),n}async signinSilentCallback(e=window.location.href){const t=this._logger.create("signinSilentCallback");await this._iframeNavigator.callback(e),t.info("success")}async signinCallback(e=window.location.href){const{state:t}=await this._client.readSigninResponseState(e);switch(t.request_type){case"si:r":return await this.signinRedirectCallback(e);case"si:p":return await this.signinPopupCallback(e);case"si:s":return await this.signinSilentCallback(e);default:throw new Error("invalid response_type in state")}}async signoutCallback(e=window.location.href,t=!1){const{state:n}=await this._client.readSignoutResponseState(e);if(n)switch(n.request_type){case"so:r":await this.signoutRedirectCallback(e);break;case"so:p":await this.signoutPopupCallback(e,t);break;case"so:s":await this.signoutSilentCallback(e);break;default:throw new Error("invalid response_type in state")}}async querySessionStatus(e={}){const t=this._logger.create("querySessionStatus"),{silentRequestTimeoutInSeconds:n,...r}=e,i=this.settings.silent_redirect_uri;i||t.throw(new Error("No silent_redirect_uri configured"));const a=await this._loadUser(),o=await this._iframeNavigator.prepare({silentRequestTimeoutInSeconds:n}),s=await this._signinStart({request_type:"si:s",redirect_uri:i,prompt:"none",id_token_hint:this.settings.includeIdTokenInSilentRenew?null==a?void 0:a.id_token:void 0,response_type:this.settings.query_status_response_type,scope:"openid",skipUserInfo:!0,...r},o);try{const e=await this._client.processSigninResponse(s.url);return t.debug("got signin response"),e.session_state&&e.profile.sub?(t.info("success for subject",e.profile.sub),{session_state:e.session_state,sub:e.profile.sub,sid:e.profile.sid}):(t.info("success, user not authenticated"),null)}catch(e){if(this.settings.monitorAnonymousSession&&e instanceof gB)switch(e.error){case"login_required":case"consent_required":case"interaction_required":case"account_selection_required":return t.info("success for anonymous user"),{session_state:e.session_state}}throw e}}async _signin(e,t,n){const r=await this._signinStart(e,t);return await this._signinEnd(r.url,n)}async _signinStart(e,t){const n=this._logger.create("_signinStart");try{const r=await this._client.createSigninRequest(e);return n.debug("got signin request"),await t.navigate({url:r.url,state:r.state.id,response_mode:r.state.response_mode,scriptOrigin:this.settings.iframeScriptOrigin})}catch(e){throw n.debug("error after preparing navigator, closing navigator window"),t.close(),e}}async _signinEnd(e,t){const n=this._logger.create("_signinEnd"),r=await this._client.processSigninResponse(e);return n.debug("got signin response"),await this._buildUser(r,t)}async _buildUser(e,t){const n=this._logger.create("_buildUser"),r=new CB(e);if(t){if(t!==r.profile.sub)throw n.debug("current user does not match user returned from signin. sub from signin:",r.profile.sub),new gB({...e,error:"login_required"});n.debug("current user matches user returned from signin")}return await this.storeUser(r),n.debug("user stored"),this._events.load(r),r}async signoutRedirect(e={}){const t=this._logger.create("signoutRedirect"),{redirectMethod:n,...r}=e,i=await this._redirectNavigator.prepare({redirectMethod:n});await this._signoutStart({request_type:"so:r",post_logout_redirect_uri:this.settings.post_logout_redirect_uri,...r},i),t.info("success")}async signoutRedirectCallback(e=window.location.href){const t=this._logger.create("signoutRedirectCallback"),n=await this._signoutEnd(e);return t.info("success"),n}async signoutPopup(e={}){const t=this._logger.create("signoutPopup"),{popupWindowFeatures:n,popupWindowTarget:r,...i}=e,a=this.settings.popup_post_logout_redirect_uri,o=await this._popupNavigator.prepare({popupWindowFeatures:n,popupWindowTarget:r});await this._signout({request_type:"so:p",post_logout_redirect_uri:a,state:null==a?void 0:{},...i},o),t.info("success")}async signoutPopupCallback(e=window.location.href,t=!1){const n=this._logger.create("signoutPopupCallback");await this._popupNavigator.callback(e,t),n.info("success")}async _signout(e,t){const n=await this._signoutStart(e,t);return await this._signoutEnd(n.url)}async _signoutStart(e={},t){var n;const r=this._logger.create("_signoutStart");try{const i=await this._loadUser();r.debug("loaded current user from storage"),this.settings.revokeTokensOnSignout&&await this._revokeInternal(i);const a=e.id_token_hint||i&&i.id_token;a&&(r.debug("setting id_token_hint in signout request"),e.id_token_hint=a),await this.removeUser(),r.debug("user removed, creating signout request");const o=await this._client.createSignoutRequest(e);return r.debug("got signout request"),await t.navigate({url:o.url,state:null==(n=o.state)?void 0:n.id})}catch(e){throw r.debug("error after preparing navigator, closing navigator window"),t.close(),e}}async _signoutEnd(e){const t=this._logger.create("_signoutEnd"),n=await this._client.processSignoutResponse(e);return t.debug("got signout response"),n}async signoutSilent(e={}){var t;const n=this._logger.create("signoutSilent"),{silentRequestTimeoutInSeconds:r,...i}=e,a=this.settings.includeIdTokenInSilentSignout?null==(t=await this._loadUser())?void 0:t.id_token:void 0,o=this.settings.popup_post_logout_redirect_uri,s=await this._iframeNavigator.prepare({silentRequestTimeoutInSeconds:r});await this._signout({request_type:"so:s",post_logout_redirect_uri:o,id_token_hint:a,...i},s),n.info("success")}async signoutSilentCallback(e=window.location.href){const t=this._logger.create("signoutSilentCallback");await this._iframeNavigator.callback(e),t.info("success")}async revokeTokens(e){const t=await this._loadUser();await this._revokeInternal(t,e)}async _revokeInternal(e,t=this.settings.revokeTokenTypes){const n=this._logger.create("_revokeInternal");if(!e)return;const r=t.filter((t=>"string"==typeof e[t]));if(r.length){for(const t of r)await this._client.revokeToken(e[t],t),n.info(`${t} revoked successfully`),"access_token"!==t&&(e[t]=null);await this.storeUser(e),n.debug("user stored"),this._events.load(e)}else n.debug("no need to revoke due to no token(s)")}startSilentRenew(){this._logger.create("startSilentRenew"),this._silentRenewService.start()}stopSilentRenew(){this._silentRenewService.stop()}get _userStoreKey(){return`user:${this.settings.authority}:${this.settings.client_id}`}async _loadUser(){const e=this._logger.create("_loadUser"),t=await this.settings.userStore.get(this._userStoreKey);return t?(e.debug("user storageString loaded"),CB.fromStorageString(t)):(e.debug("no user storageString"),null)}async storeUser(e){const t=this._logger.create("storeUser");if(e){t.debug("storing user");const n=e.toStorageString();await this.settings.userStore.set(this._userStoreKey,n)}else this._logger.debug("removing user"),await this.settings.userStore.remove(this._userStoreKey)}async clearStaleState(){await this._client.clearStaleState()}}((({oidcConfiguration:e,authenticationDomain:t})=>{const n="undefined"!=typeof window?window.localStorage:new _B,r=new TB({store:n}),i={authority:t,redirect_uri:e.redirectUri,popup_redirect_uri:e.redirectUri,client_id:e.clientId,metadata:{authorization_endpoint:`${t}/authorize`,token_endpoint:`${t}/oauth/token`,userinfo_endpoint:`${t}/userinfo`,end_session_endpoint:`${t}/v2/logout?returnTo=${encodeURIComponent(e.logoutRedirectUri)}&client_id=${e.clientId}`},mergeClaims:!0,loadUserInfo:!0,scope:e.scope,userStore:r};return e.audience&&(i.extraQueryParams={audience:e.audience}),i})(e)),this.deviceCredentialsManager=new Cq,this.logoutMode=e.oidcConfiguration.logoutMode||"redirect"}static mapOidcUserToDomainModel=e=>{const t=e.profile?.passport,n={expired:e.expired,idToken:e.id_token,accessToken:e.access_token,refreshToken:e.refresh_token,profile:{sub:e.profile.sub,email:e.profile.email,nickname:e.profile.nickname}};return t?.imx_eth_address&&(n.imx={ethAddress:t?.imx_eth_address,starkAddress:t?.imx_stark_address,userAdminAddress:t?.imx_user_admin_address}),t?.zkevm_eth_address&&(n.zkEvm={ethAddress:t?.zkevm_eth_address,userAdminAddress:t?.zkevm_user_admin_address}),n};static mapDeviceTokenResponseToDomainUserModel=e=>{const t=aB(e.id_token),n={idToken:e.id_token,accessToken:e.access_token,refreshToken:e.refresh_token,profile:{sub:t.sub,email:t.email,nickname:t.nickname}};return t?.passport?.imx_eth_address&&(n.imx={ethAddress:t?.passport?.imx_eth_address,starkAddress:t?.passport?.imx_stark_address,userAdminAddress:t?.passport?.imx_user_admin_address}),t?.passport?.zkevm_eth_address&&(n.zkEvm={ethAddress:t?.passport?.zkevm_eth_address,userAdminAddress:t?.passport?.zkevm_user_admin_address}),n};async login(){return kq((async()=>{const e=await this.userManager.signinPopup({popupWindowFeatures:{width:410,height:450}});return Nq.mapOidcUserToDomainModel(e)}),Rq.AUTHENTICATION_ERROR)}async loginCallback(){return kq((async()=>this.userManager.signinPopupCallback()),Rq.AUTHENTICATION_ERROR)}async loginWithDeviceFlow(){return kq((async()=>{const e=await Fe.post(`${this.config.authenticationDomain}/oauth/device/code`,{client_id:this.config.oidcConfiguration.clientId,scope:this.config.oidcConfiguration.scope,audience:this.config.oidcConfiguration.audience},Mq);return{code:e.data.user_code,deviceCode:e.data.device_code,url:e.data.verification_uri_complete,interval:e.data.interval}}),Rq.AUTHENTICATION_ERROR)}async connectImxDeviceFlow(e,t,n){return kq((async()=>{const r=Date.now();for(;;){if(null!=n&&Date.now()-r>n)throw new Error("Timed out");await Pq(1e3*t);try{const t=await this.getDeviceFlowToken(e),n=Nq.mapDeviceTokenResponseToDomainUserModel(t);return n.imx?.ethAddress&&n.imx?.starkAddress&&n.imx?.userAdminAddress&&this.deviceCredentialsManager.saveCredentials(t),n}catch(e){if(!Fe.isAxiosError(e))throw e;{const t=e.response?.data;switch(t.error){case"authorization_pending":case"slow_down":break;case"expired_token":throw new Error("Token expired, please log in again");case"access_denied":throw new Error("User denied access");default:throw new Error("Error getting token")}}}}throw new Error("Failed to get credentials")}),Rq.AUTHENTICATION_ERROR)}async getDeviceFlowToken(e){return(await Fe.post(`${this.config.authenticationDomain}/oauth/token`,{client_id:this.config.oidcConfiguration.clientId,grant_type:"urn:ietf:params:oauth:grant-type:device_code",device_code:e},Mq)).data}static base64URLEncode(e){return e.toString("base64").replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}static sha256(e){return(void 0)("sha256").update(e).digest()}getPKCEAuthorizationUrl(){const e=Nq.base64URLEncode((void 0)(32)),t=Nq.base64URLEncode(Nq.sha256(e)),n=Nq.base64URLEncode((void 0)(32));return this.deviceCredentialsManager.savePKCEData({state:n,verifier:e}),`${this.config.authenticationDomain}/authorize?response_type=code&code_challenge=${t}&code_challenge_method=S256&client_id=${this.config.oidcConfiguration.clientId}&redirect_uri=${this.config.oidcConfiguration.redirectUri}&scope=${this.config.oidcConfiguration.scope}&state=${n}&audience=${this.config.oidcConfiguration.audience}`}async connectImxPKCEFlow(e,t){return kq((async()=>{const n=this.deviceCredentialsManager.getPKCEData();if(!n)throw new Error("No code verifier or state for PKCE");if(t!==n.state)throw new Error("Provided state does not match stored state");const r=await this.getPKCEToken(e,n.verifier),i=Nq.mapDeviceTokenResponseToDomainUserModel(r);return i.imx?.ethAddress&&i.imx?.starkAddress&&i.imx?.userAdminAddress&&this.deviceCredentialsManager.saveCredentials(r),i}),Rq.AUTHENTICATION_ERROR)}async getPKCEToken(e,t){return(await Fe.post(`${this.config.authenticationDomain}/oauth/token`,{client_id:this.config.oidcConfiguration.clientId,grant_type:"authorization_code",code_verifier:t,code:e,redirect_uri:this.config.oidcConfiguration.redirectUri},Mq)).data}async connectImxWithCredentials(e){return kq((async()=>{if(this.deviceCredentialsManager.areValid(e))return Nq.mapDeviceTokenResponseToDomainUserModel(e);const t=e?.refresh_token??null;if(t){return await this.refreshToken(t)}return null}),Rq.AUTHENTICATION_ERROR)}async refreshToken(e){const t=(await Fe.post(`${this.config.authenticationDomain}/oauth/token`,{client_id:this.config.oidcConfiguration.clientId,grant_type:"refresh_token",refresh_token:e},Mq)).data;return Nq.mapDeviceTokenResponseToDomainUserModel(t)}async logout(){return kq((async()=>"silent"===this.logoutMode?this.userManager.signoutSilent():this.userManager.signoutRedirect()),Rq.LOGOUT_ERROR)}async logoutSilentCallback(e){return this.userManager.signoutSilentCallback(e)}async logoutDeviceFlow(){return kq((async()=>{this.deviceCredentialsManager.clearCredentials()}),Rq.LOGOUT_ERROR)}async loginSilent(){return kq((async()=>{if(!await this.getUser())return null;const e=await this.userManager.signinSilent();return e?Nq.mapOidcUserToDomainModel(e):null}),Rq.SILENT_LOGIN_ERROR)}async getUser(){return kq((async()=>{const e=await this.userManager.getUser();if(e)return Nq.mapOidcUserToDomainModel(e);const t=this.deviceCredentialsManager.getCredentials();return t?Nq.mapDeviceTokenResponseToDomainUserModel(t):null}),Rq.NOT_LOGGED_IN_ERROR)}async getUserDeviceFlow(){return kq((async()=>{const e=this.deviceCredentialsManager.getCredentials();return e?Nq.mapDeviceTokenResponseToDomainUserModel(e):null}),Rq.NOT_LOGGED_IN_ERROR)}checkStoredDeviceFlowCredentials(){return this.deviceCredentialsManager.getCredentials()}}class Bq{config;magicClient;constructor(e){this.config=e}async login(e,t){return kq((async()=>(this.magicClient=new GL(this.config.magicPublishableApiKey,{extensions:[new KL],network:t}),await this.magicClient.openid.loginWithOIDC({jwt:e,providerId:this.config.magicProviderId}),this.magicClient.rpcProvider)),Rq.WALLET_CONNECTION_ERROR)}async logout(){this.magicClient?.user&&await this.magicClient.user.logout()}}const Dq=1e3,Fq=3,Lq=async(e,t)=>{const{retries:n=Fq,interval:r=Dq,finalErr:i=Error("Retry failed"),finallyFn:a=(()=>{})}=t||{};try{return await e()}catch(t){return n<=0?Promise.reject(i):(await(o=r,new Promise((e=>{setTimeout((()=>e()),o)}))),Lq(e,{retries:n-1,finalErr:i,finallyFn:a}))}finally{n<=0&&a()}var o};var Uq,jq;!function(e){e[e.USER_REJECTED_REQUEST=4001]="USER_REJECTED_REQUEST",e[e.UNAUTHORIZED=4100]="UNAUTHORIZED",e[e.UNSUPPORTED_METHOD=4200]="UNSUPPORTED_METHOD",e[e.DISCONNECTED=4900]="DISCONNECTED"}(Uq||(Uq={})),function(e){e[e.RPC_SERVER_ERROR=-32e3]="RPC_SERVER_ERROR",e[e.INVALID_REQUEST=-32600]="INVALID_REQUEST",e[e.METHOD_NOT_FOUND=-32601]="METHOD_NOT_FOUND",e[e.INVALID_PARAMS=-32602]="INVALID_PARAMS",e[e.INTERNAL_ERROR=-32603]="INTERNAL_ERROR",e[e.PARSE_ERROR=-32700]="PARSE_ERROR",e[e.TRANSACTION_REJECTED=-32003]="TRANSACTION_REJECTED"}(jq||(jq={}));class qq extends Error{message;code;constructor(e,t){super(t),this.message=t,this.code=e}}const zq="Transaction requires confirmation but this functionality is not supported in this environment. Please contact Immutable support if you need to enable this feature.",Hq=e=>Hr.from(e).toString();class Gq{transactionAPI;messageAPI;confirmationScreen;imxEtherAddress;crossSdkBridgeEnabled;constructor({accessToken:e,confirmationScreen:t,imxEtherAddress:n,config:r}){const i=new qj({accessToken:e,basePath:r.imxPublicApiDomain});this.confirmationScreen=t,this.transactionAPI=new jj(new qj(i)),this.imxEtherAddress=n,this.crossSdkBridgeEnabled=r.crossSdkBridgeEnabled,this.messageAPI=new Lj(i)}withConfirmationScreen(e){return t=>this.withConfirmationScreenTask(e)(t)()}withConfirmationScreenTask(e){return t=>async()=>{this.confirmationScreen.loading(e);try{return await t()}catch(e){throw this.confirmationScreen.closeWindow(),e}}}withDefaultConfirmationScreenTask(e){return this.withConfirmationScreenTask()(e)}async validate({payloadHash:e}){if(!(await Lq((async()=>this.transactionAPI.getTransactionByID({transactionID:e,chainType:"starkex"})),{finallyFn:()=>{this.confirmationScreen.closeWindow()}})).data.id)throw new Error("Transaction doesn't exists");const t=await this.transactionAPI.evaluateTransaction({id:e,transactionEvaluationRequest:{chainType:"starkex"}}),{confirmationRequired:n}=t.data;if(n){if(this.crossSdkBridgeEnabled)throw new Error(zq);if(!(await this.confirmationScreen.requestConfirmation(e,this.imxEtherAddress,zj)).confirmed)throw new Error("Transaction rejected by user")}else this.confirmationScreen.closeWindow()}async evaluateEVMTransaction({chainId:e,nonce:t,user:n,metaTransactions:r}){const i={Authorization:`Bearer ${n.accessToken}`},a=(e=>{try{return e.map((e=>({delegateCall:!0===e.delegateCall,revertOnError:!0===e.revertOnError,gasLimit:e.gasLimit?Hq(e.gasLimit):"0",target:e.to??Oa,value:e.value?Hq(e.value):"0",data:e.data?e.data.toString():"0x"})))}catch(e){const t=e instanceof Error?e.message:String(e);throw new qq(jq.INVALID_PARAMS,`Transaction failed to parsing: ${t}`)}})(r);try{return(await this.transactionAPI.evaluateTransaction({id:"evm",transactionEvaluationRequest:{chainType:"evm",chainId:e,transactionData:{nonce:t,userAddress:n.zkEvm.ethAddress,metaTransactions:a}}},{headers:i})).data}catch(e){const t=e instanceof Error?e.message:String(e);throw new qq(jq.INTERNAL_ERROR,`Transaction failed to validate with error: ${t}`)}}async validateEVMTransaction({chainId:e,nonce:t,user:n,metaTransactions:r}){const i=await this.evaluateEVMTransaction({chainId:e,nonce:t,user:n,metaTransactions:r}),{confirmationRequired:a,transactionId:o}=i;if(a&&this.crossSdkBridgeEnabled)throw new qq(jq.TRANSACTION_REJECTED,zq);if(a&&o){if(!(await this.confirmationScreen.requestConfirmation(o,this.imxEtherAddress,Hj,e)).confirmed)throw new qq(jq.TRANSACTION_REJECTED,"Transaction rejected by user")}else this.confirmationScreen.closeWindow()}async evaluateMessage({chainID:e,payload:t,user:n}){try{return(await this.messageAPI.evaluateMessage({messageEvaluationRequest:{chainID:e,payload:t}},{headers:{Authorization:`Bearer ${n.accessToken}`}})).data}catch(e){const t=e instanceof Error?e.message:String(e);throw new qq(jq.INTERNAL_ERROR,`Message failed to validate with error: ${t}`)}}async validateMessage({chainID:e,payload:t,user:n}){const{messageId:r,confirmationRequired:i}=await this.evaluateMessage({chainID:e,payload:t,user:n});if(i&&this.crossSdkBridgeEnabled)throw new qq(jq.TRANSACTION_REJECTED,zq);if(i&&r){if(!(await this.confirmationScreen.requestMessageConfirmation(r)).confirmed)throw new qq(jq.TRANSACTION_REJECTED,"Signature rejected by user")}else this.confirmationScreen.closeWindow()}}var Vq,Kq;!function(e){e.LOGGED_OUT="loggedOut"}(Vq||(Vq={})),function(e){e.PRODUCTION="mainnet",e.SANDBOX="goerli"}(Kq||(Kq={}));const Wq="ERC721";const Xq="ERC721";class $q{user;starkSigner;immutableXClient;confirmationScreen;guardianClient;constructor({user:e,starkSigner:t,immutableXClient:n,confirmationScreen:r,config:i,passportEventEmitter:a}){this.user=e,this.starkSigner=t,this.immutableXClient=n,this.confirmationScreen=r,this.guardianClient=new Gq({accessToken:e.accessToken,confirmationScreen:r,imxEtherAddress:e.imx.ethAddress,config:i}),a.on(Vq.LOGGED_OUT,this.handleLogout)}handleLogout=()=>{this.user=void 0,this.starkSigner=void 0};checkIsLoggedIn(){if(void 0===this.user||void 0===this.starkSigner)throw new Sq("User has been logged out",Rq.NOT_LOGGED_IN_ERROR)}async transfer(e){return this.checkIsLoggedIn(),async function({request:e,transfersApi:t,starkSigner:n,user:r,guardianClient:i}){return kq(i.withDefaultConfirmationScreenTask((async()=>{const a=e.type===Xq?"1":e.amount,o={sender:r.imx.ethAddress,token:Kj(e),amount:a,receiver:e.receiver},s={Authorization:`Bearer ${r.accessToken}`},c=await t.getSignableTransferV1({getSignableTransferRequest:o},{headers:s});await i.validate({payloadHash:c.data.payload_hash});const u=c.data,{payload_hash:f}=u,d=await n.signMessage(f),l=await n.getAddress(),p={createTransferRequest:{sender_stark_key:u.sender_stark_key||l,sender_vault_id:u.sender_vault_id,receiver_stark_key:u.receiver_stark_key,receiver_vault_id:u.receiver_vault_id,asset_id:u.asset_id,amount:u.amount,nonce:u.nonce,expiration_timestamp:u.expiration_timestamp,stark_signature:d}},{data:h}=await t.createTransferV1(p,{headers:s});return{sent_signature:h.sent_signature,status:h.status?.toString(),time:h.time,transfer_id:h.transfer_id}})),Rq.TRANSFER_ERROR)}({request:e,user:this.user,starkSigner:this.starkSigner,transfersApi:this.immutableXClient.transfersApi,guardianClient:this.guardianClient})}registerOffchain(){throw new Sq("Operation not supported",Rq.OPERATION_NOT_SUPPORTED_ERROR)}isRegisteredOnchain(){throw new Sq("Operation not supported",Rq.OPERATION_NOT_SUPPORTED_ERROR)}createOrder(e){return this.checkIsLoggedIn(),async function({starkSigner:e,user:t,request:n,ordersApi:r,guardianClient:i}){return kq(i.withDefaultConfirmationScreenTask((async()=>{const{ethAddress:a}=t.imx,o=n.sell.type===Wq?"1":n.sell.amount,s=n.buy.type===Wq?"1":n.buy.amount,c={Authorization:`Bearer ${t.accessToken}`},u={user:a,amount_buy:s,token_buy:Kj(n.buy),amount_sell:o,token_sell:Kj(n.sell),fees:n.fees,split_fees:!0,expiration_timestamp:n.expiration_timestamp},f=await r.getSignableOrder({getSignableOrderRequestV3:u},{headers:c});await i.validate({payloadHash:f.data.payload_hash});const{payload_hash:d}=f.data,l=await e.signMessage(d),p=f.data,h={createOrderRequest:{include_fees:!0,fees:n.fees,stark_signature:l,amount_buy:p.amount_buy,amount_sell:p.amount_sell,asset_id_buy:p.asset_id_buy,asset_id_sell:p.asset_id_sell,expiration_timestamp:p.expiration_timestamp,nonce:p.nonce,stark_key:p.stark_key,vault_id_buy:p.vault_id_buy,vault_id_sell:p.vault_id_sell}};return{...(await r.createOrderV3(h,{headers:c})).data}})),Rq.CREATE_ORDER_ERROR)}({request:e,user:this.user,starkSigner:this.starkSigner,ordersApi:this.immutableXClient.ordersApi,guardianClient:this.guardianClient})}cancelOrder(e){return this.checkIsLoggedIn(),async function({user:e,starkSigner:t,request:n,ordersApi:r,guardianClient:i}){return kq(i.withDefaultConfirmationScreenTask((async()=>{const a={order_id:n.order_id},o={Authorization:`Bearer ${e.accessToken}`},s=await r.getSignableCancelOrderV3({getSignableCancelOrderRequest:a},{headers:o});await i.validate({payloadHash:s.data.payload_hash});const{payload_hash:c}=s.data,u=await t.signMessage(c),f=await r.cancelOrderV3({id:n.order_id.toString(),cancelOrderRequest:{order_id:n.order_id,stark_signature:u}},{headers:o});return{order_id:f.data.order_id,status:f.data.status}})),Rq.CANCEL_ORDER_ERROR)}({request:e,user:this.user,starkSigner:this.starkSigner,ordersApi:this.immutableXClient.ordersApi,guardianClient:this.guardianClient})}createTrade(e){return this.checkIsLoggedIn(),async function({request:e,tradesApi:t,user:n,starkSigner:r,guardianClient:i}){return kq(i.withDefaultConfirmationScreenTask((async()=>{const{ethAddress:a}=n.imx,o={expiration_timestamp:e.expiration_timestamp,fees:e.fees,order_id:e.order_id,user:a},s={Authorization:`Bearer ${n.accessToken}`},c=await t.getSignableTrade({getSignableTradeRequest:o},{headers:s});await i.validate({payloadHash:c.data.payload_hash});const{payload_hash:u}=c.data,f=await r.signMessage(u),{data:d}=c,l={createTradeRequest:{include_fees:!0,fees:e?.fees,stark_signature:f,order_id:e?.order_id,fee_info:d.fee_info,amount_buy:d.amount_buy,amount_sell:d.amount_sell,asset_id_buy:d.asset_id_buy,asset_id_sell:d.asset_id_sell,expiration_timestamp:d.expiration_timestamp,nonce:d.nonce,stark_key:d.stark_key,vault_id_buy:d.vault_id_buy,vault_id_sell:d.vault_id_sell}},{data:p}=await t.createTradeV3(l,{headers:s});return p})),Rq.CREATE_TRADE_ERROR)}({request:e,user:this.user,starkSigner:this.starkSigner,tradesApi:this.immutableXClient.tradesApi,guardianClient:this.guardianClient})}batchNftTransfer(e){return this.checkIsLoggedIn(),async function({user:e,starkSigner:t,request:n,transfersApi:r,guardianClient:i}){return kq(i.withConfirmationScreenTask({width:480,height:784})((async()=>{const{ethAddress:a}=e.imx,o={sender_ether_key:a,signable_requests:n.map((e=>({amount:"1",token:Kj({type:Xq,tokenId:e.tokenId,tokenAddress:e.tokenAddress}),receiver:e.receiver})))},s={Authorization:`Bearer ${e.accessToken}`},c=await r.getSignableTransfer({getSignableTransferRequestV2:o},{headers:s});await i.validate({payloadHash:c.data.signable_responses[0]?.payload_hash});const u=await Promise.all(c.data.signable_responses.map((async e=>{const n=await t.signMessage(e.payload_hash);return{sender_vault_id:e.sender_vault_id,receiver_stark_key:e.receiver_stark_key,receiver_vault_id:e.receiver_vault_id,asset_id:e.asset_id,amount:e.amount,nonce:e.nonce,expiration_timestamp:e.expiration_timestamp,stark_signature:n}}))),f={sender_stark_key:c.data.sender_stark_key,requests:u},d=await r.createTransfer({createTransferRequestV2:f},{headers:s});return{transfer_ids:d?.data.transfer_ids}})),Rq.TRANSFER_ERROR)}({request:e,user:this.user,starkSigner:this.starkSigner,transfersApi:this.immutableXClient.transfersApi,guardianClient:this.guardianClient})}exchangeTransfer(e){return this.checkIsLoggedIn(),async function({user:e,starkSigner:t,request:n,exchangesApi:r}){return kq((async()=>{const{ethAddress:i}=e.imx,a=n.amount,o=await r.getExchangeSignableTransfer({id:n.transactionID,getSignableTransferRequest:{sender:i,token:Kj(n),amount:a,receiver:n.receiver}}),s=await t.getAddress(),{payload_hash:c}=o.data,u=await t.signMessage(c),f={sender_stark_key:o.data.sender_stark_key||s,sender_vault_id:o.data.sender_vault_id,receiver_stark_key:o.data.receiver_stark_key,receiver_vault_id:o.data.receiver_vault_id,asset_id:o.data.asset_id,amount:o.data.amount,nonce:o.data.nonce,expiration_timestamp:o.data.expiration_timestamp,stark_signature:u},d={Authorization:`Bearer ${e.accessToken}`},l=await r.createExchangeTransfer({id:n.transactionID,createTransferRequest:f},{headers:d});return{sent_signature:l?.data.sent_signature,status:l?.data.status?.toString(),time:l?.data.time,transfer_id:l?.data.transfer_id}}),Rq.EXCHANGE_TRANSFER_ERROR)}({request:e,user:this.user,starkSigner:this.starkSigner,exchangesApi:this.immutableXClient.exchangeApi})}deposit(e){throw new Sq("Operation not supported",Rq.OPERATION_NOT_SUPPORTED_ERROR)}prepareWithdrawal(e){throw new Sq("Operation not supported",Rq.OPERATION_NOT_SUPPORTED_ERROR)}completeWithdrawal(e,t){throw new Sq("Operation not supported",Rq.OPERATION_NOT_SUPPORTED_ERROR)}getAddress(){return this.checkIsLoggedIn(),Promise.resolve(this.user.imx.ethAddress)}}class Jq{authManager;config;confirmationScreen;immutableXClient;magicAdapter;passportEventEmitter;constructor({authManager:e,config:t,confirmationScreen:n,immutableXClient:r,magicAdapter:i,passportEventEmitter:a}){this.authManager=e,this.config=t,this.confirmationScreen=n,this.immutableXClient=r,this.magicAdapter=i,this.passportEventEmitter=a}async getProvider(){const e=await this.authManager.login();return this.createProviderInstance(e)}async getProviderSilent(){const e=await this.authManager.loginSilent();return e?this.createProviderInstance(e):null}async getProviderWithDeviceFlow(e,t,n){const r=await this.authManager.connectImxDeviceFlow(e,t,n);return this.createProviderInstance(r)}async getProviderWithPKCEFlow(e,t){const n=await this.authManager.connectImxPKCEFlow(e,t);return this.createProviderInstance(n)}async getProviderWithCredentials(e){const t=await this.authManager.connectImxWithCredentials(e);return t?this.createProviderInstance(t):null}async createProviderInstance(e){if(!e.idToken)throw new Sq("Failed to initialise",Rq.WALLET_CONNECTION_ERROR);const t=await this.magicAdapter.login(e.idToken,this.config.network),n=new Zh(t).getSigner(),r=await(async e=>kq((async()=>Ax(await jN(e))),Rq.WALLET_CONNECTION_ERROR))(n);if(!e.imx?.ethAddress){const t=await this.registerStarkEx(n,r,e.accessToken);return new $q({user:t,starkSigner:r,immutableXClient:this.immutableXClient,confirmationScreen:this.confirmationScreen,config:this.config,passportEventEmitter:this.passportEventEmitter})}return new $q({user:e,starkSigner:r,immutableXClient:this.immutableXClient,confirmationScreen:this.confirmationScreen,config:this.config,passportEventEmitter:this.passportEventEmitter})}async registerStarkEx(e,t,n){return kq((async()=>{await async function({ethSigner:e,starkSigner:t,usersApi:n},r){return kq((async()=>{const i=await e.getAddress(),a=await t.getAddress(),o=await n.getSignableRegistrationOffchain({getSignableRegistrationRequest:{ether_key:i,stark_key:a}}),{signable_message:s,payload_hash:c}=o.data,u=await Vj(s,e),f=await t.signMessage(c);return(await n.registerPassportUser({authorization:`Bearer ${r}`,registerPassportUserRequest:{eth_signature:u,ether_key:i,stark_signature:f,stark_key:a}})).statusText}),Rq.USER_REGISTRATION_ERROR)}({ethSigner:e,starkSigner:t,usersApi:this.immutableXClient.usersApi},n);return await Lq((async()=>{const e=await this.authManager.loginSilent();return!!e?.imx?e:Promise.reject(new Error("user wallet addresses not exist"))}))}),Rq.REFRESH_TOKEN_ERROR)}}const Yq=(e,t,n)=>{const r=t.map((t=>!e[t]&&t)).filter((e=>e)).join(", ");if(""!==r){throw new Sq(n?`${n} - ${r} cannot be null`:`${r} cannot be null`,Rq.INVALID_CONFIGURATION)}};class Qq{network;authenticationDomain;passportDomain;imxPublicApiDomain;magicPublishableApiKey;magicProviderId;oidcConfiguration;baseConfig;zkEvmRpcUrl;relayerUrl;multiRollupConfig;crossSdkBridgeEnabled;constructor({baseConfig:e,overrides:n,crossSdkBridgeEnabled:r,...i}){if(Yq(i,["clientId","logoutRedirectUri","redirectUri"]),this.oidcConfiguration=i,this.baseConfig=e,this.crossSdkBridgeEnabled=r||!1,n)Yq(n,["network","authenticationDomain","passportDomain","magicPublishableApiKey","magicProviderId","zkEvmRpcUrl","relayerUrl","imxPublicApiDomain","indexerMrBasePath","orderBookMrBasePath","passportMrBasePath"],"overrides"),this.network=n.network,this.authenticationDomain=n.authenticationDomain,this.passportDomain=n.passportDomain,this.imxPublicApiDomain=n.imxPublicApiDomain,this.magicPublishableApiKey=n.magicPublishableApiKey,this.magicProviderId=n.magicProviderId,this.zkEvmRpcUrl=n.zkEvmRpcUrl,this.relayerUrl=n.relayerUrl,this.multiRollupConfig={indexer:Ut({basePath:n.indexerMrBasePath}),orderBook:Ut({basePath:n.orderBookMrBasePath}),passport:Ut({basePath:n.passportMrBasePath})};else switch(e.environment){case t.PRODUCTION:this.network=Kq.PRODUCTION,this.authenticationDomain="https://auth.immutable.com",this.magicPublishableApiKey="pk_live_10F423798A540ED7",this.magicProviderId="fSMzaRQ4O7p4fttl7pCyGVtJS_G70P8SNsLXtPPGHo0=",this.passportDomain="https://passport.immutable.com",this.imxPublicApiDomain="https://api.immutable.com",this.zkEvmRpcUrl="",this.relayerUrl="https://api.immutable.com/relayer-mr",this.multiRollupConfig=jt();break;case t.SANDBOX:default:this.network=Kq.SANDBOX,this.authenticationDomain="https://auth.immutable.com",this.magicPublishableApiKey="pk_live_10F423798A540ED7",this.magicProviderId="fSMzaRQ4O7p4fttl7pCyGVtJS_G70P8SNsLXtPPGHo0=",this.passportDomain="https://passport.sandbox.immutable.com",this.imxPublicApiDomain="https://api.sandbox.immutable.com",this.zkEvmRpcUrl="https://rpc.testnet.immutable.com",this.relayerUrl="https://api.sandbox.immutable.com/relayer-mr",this.multiRollupConfig=qt()}}}var Zq;!function(e){e.CONFIRMATION_WINDOW_READY="confirmation_window_ready",e.TRANSACTION_CONFIRMED="transaction_confirmed",e.TRANSACTION_ERROR="transaction_error",e.MESSAGE_CONFIRMED="message_confirmed",e.MESSAGE_REJECTED="message_rejected",e.LOGOUT_SUCCESS="logout_success"}(Zq||(Zq={}));const ez="imx_passport_confirmation";class tz{config;confirmationWindow;constructor(e){this.config=e}requestConfirmation(e,t,n,r){return new Promise(((i,a)=>{const o=({data:e,origin:t})=>{if(t===this.config.passportDomain&&e.eventType===ez)switch(e.messageType){case Zq.CONFIRMATION_WINDOW_READY:break;case Zq.TRANSACTION_CONFIRMED:i({confirmed:!0});break;case Zq.TRANSACTION_ERROR:a(new Error("Transaction error"));break;default:a(new Error("Unsupported message type"))}};if(!this.confirmationWindow)return void i({confirmed:!1});window.addEventListener("message",o);let s="";s=n===zj?`${this.config.passportDomain}/transaction-confirmation/transaction?transactionId=${e}&imxEtherAddress=${t}&chainType=starkex`:`${this.config.passportDomain}/transaction-confirmation/zkevm?transactionId=${e}&imxEtherAddress=${t}&chainType=evm&chainId=${r}`,this.showConfirmationScreen(s,o,i)}))}requestMessageConfirmation(e){return new Promise(((t,n)=>{const r=({data:e,origin:r})=>{if(r===this.config.passportDomain&&e.eventType===ez)switch(e.messageType){case Zq.CONFIRMATION_WINDOW_READY:break;case Zq.MESSAGE_CONFIRMED:t({confirmed:!0});break;case Zq.MESSAGE_REJECTED:n(new Error("Message rejected"));break;default:n(new Error("Unsupported message type"))}};if(!this.confirmationWindow)return void t({confirmed:!1});window.addEventListener("message",r);const i=`${this.config.passportDomain}/transaction-confirmation/zkevm/message?messageID=${e}`;this.showConfirmationScreen(i,r,t)}))}loading(e){this.config.crossSdkBridgeEnabled||(this.confirmationWindow=(({url:e,title:t,width:n,height:r})=>{const i=Math.max(0,Math.round(window.screenX+(window.outerWidth-n)/2)),a=Math.max(0,Math.round(window.screenY+(window.outerHeight-r)/2)),o=window.open(e,t,`\n scrollbars=yes,\n width=${n}, \n height=${r}, \n top=${a}, \n left=${i}\n `);if(!o)throw new Error("Failed to open confirmation screen");return o.focus(),o})({url:`${this.config.passportDomain}/transaction-confirmation/loading`,title:"Confirm this transaction",width:e?.width||480,height:e?.height||380}))}closeWindow(){this.confirmationWindow?.close()}logout(){return new Promise(((e,t)=>{const n=document.createElement("iframe");n.setAttribute("id","passport-confirm"),n.setAttribute("src",`${this.config.passportDomain}/transaction-confirmation/logout`),n.setAttribute("style","display: none; position: absolute;width:0px;height:0px;border:0;");const r=({data:i,origin:a})=>{a===this.config.passportDomain&&i.eventType===ez&&(window.removeEventListener("message",r),n.remove(),i.messageType===Zq.LOGOUT_SUCCESS&&e({logout:!0}),t(new Error("Unsupported logout type")))};window.addEventListener("message",r),document.body.appendChild(n)}))}showConfirmationScreen(e,t,n){this.confirmationWindow.location.href=e;const r=setInterval((()=>{this.confirmationWindow?.closed&&(clearInterval(r),window.removeEventListener("message",t),n({confirmed:!1}))}),1e3)}}var nz,rz;!function(e){e.PENDING="PENDING",e.SUBMITTED="SUBMITTED",e.SUCCESSFUL="SUCCESSFUL",e.REVERTED="REVERTED",e.FAILED="FAILED"}(nz||(nz={})),function(e){e.ACCOUNTS_CHANGED="accountsChanged"}(rz||(rz={}));class iz{emitter=new g_;emit(e,...t){this.emitter.emit(e,...t)}on(e,t){this.emitter.on(e,t)}removeListener(e,t){this.emitter.removeListener(e,t)}}const az=(e,t,n)=>ub(["string","uint256","address","bytes32"],["",e,t,n]),oz=async(e,t,n,r,i)=>{const a=e.map((e=>({delegateCall:!0===e.delegateCall,revertOnError:!0===e.revertOnError,gasLimit:e.gasLimit??Ca,target:e.to??Oa,value:e.value??Ca,data:e.data??[]})));const o=function(e,t){return Ji(wo.encode(["uint256","tuple(\n bool delegateCall,\n bool revertOnError,\n uint256 gasLimit,\n address target,\n uint256 value,\n bytes data\n)[]"],[e,t]))}(t,a),s=_r(Ji(az(n,r,o))),c=await i.signMessage(s),u=Aq({threshold:1,signers:[{weight:1,signature:`${c}02`}]}),f=new Ss(Wj.mainModule.abi);return f.encodeFunctionData(f.getFunction("execute"),[a,t,u])},sz=async(e,t,n,r,i)=>{const a={...e.types};delete a.EIP712Domain;const o=ys.hash(e.domain,a,e.message),s=_r(Ji(az(n,r,o))),c=`${await i.signMessage(s)}02`,{signers:u}=(e=>Tq(`0000${e}`))(t);return Aq({threshold:2,signers:[...u,{weight:1,signature:c}]})},cz=e=>`eip155:${e}`;class uz{config;jsonRpcProvider;user;constructor({config:e,jsonRpcProvider:t,user:n}){this.config=e,this.jsonRpcProvider=t,this.user=n}async postToRelayer(e){const t={id:1,jsonrpc:"2.0",...e},n=await fetch(`${this.config.relayerUrl}/v1/transactions`,{method:"POST",headers:{Authorization:`Bearer ${this.user.accessToken}`,"Content-Type":"application/json"},body:JSON.stringify(t)}),r=await n.json();if(r.error)throw r.error;return r}async ethSendTransaction(e,t){const{chainId:n}=await this.jsonRpcProvider.ready,r={method:"eth_sendTransaction",params:[{to:e,data:t,chainId:cz(n)}]},{result:i}=await this.postToRelayer(r);return i}async imGetTransactionByHash(e){const t={method:"im_getTransactionByHash",params:[e]},{result:n}=await this.postToRelayer(t);return n}async imGetFeeOptions(e,t){const{chainId:n}=await this.jsonRpcProvider.ready,r={method:"im_getFeeOptions",params:[{userAddress:e,data:t,chainId:cz(n)}]},{result:i}=await this.postToRelayer(r);return i}async imSignTypedData(e,t){const{chainId:n}=await this.jsonRpcProvider.ready,r={method:"im_signTypedData",params:[{address:e,eip712Payload:t,chainId:cz(n)}]},{result:i}=await this.postToRelayer(r);return i}}const fz=async({authManager:e,config:t,magicAdapter:n,multiRollupApiClients:r})=>{const i=await e.getUser()||await e.getUserDeviceFlow()||await e.login();if(!i.idToken)throw new Error("User is missing idToken");const a=await n.login(i.idToken,t.network);if(!i.zkEvm){const n=await async function({authManager:e,config:t,magicProvider:n,multiRollupApiClients:r,accessToken:i}){const a=new Zh(n).getSigner(),o=await a.getAddress(),s=await Vj("Only sign this message from Immutable Passport",a),c={Authorization:`Bearer ${i}`};try{await r.passportApi.createCounterfactualAddress({createCounterfactualAddressRequest:{ethereumAddress:o,ethereumSignature:s}},{headers:c})}catch(e){throw new qq(jq.INTERNAL_ERROR,`Failed to create counterfactual address: ${e}`)}let u;if(t.crossSdkBridgeEnabled){const t=e.checkStoredDeviceFlowCredentials();if(!t||!t.refresh_token)throw new qq(jq.INTERNAL_ERROR,"Cross SDK bridge: Failed to refresh user details");u=await e.refreshToken(t.refresh_token)}else u=await e.loginSilent();if(!u?.zkEvm)throw new qq(jq.INTERNAL_ERROR,"Failed to refresh user details");return u}({authManager:e,config:t,magicProvider:a,multiRollupApiClients:r,accessToken:i.accessToken});return{user:n,magicProvider:a}}return{user:i,magicProvider:a}},dz=({params:e,magicProvider:t,jsonRpcProvider:n,relayerClient:r,guardianClient:i,user:a})=>i.withConfirmationScreen({width:480,height:520})((async()=>{const o=e[0];if(!o.to)throw new qq(jq.INVALID_PARAMS,'eth_sendTransaction requires a "to" field');const{chainId:s}=await n.ready,c=Hr.from(s),u=new Zh(t).getSigner(),f=await(async(e,t)=>{const n=await e.send("eth_getCode",[t,"latest"]);if(n&&"0x"!==n)return new ud(t,Wj.mainModule.abi,e).nonce();return 0})(n,a.zkEvm.ethAddress),d={to:o.to,data:o.data,nonce:f,value:o.value,revertOnError:!0},l=await oz([d],f,c,a.zkEvm.ethAddress,u),p=(await r.imGetFeeOptions(a.zkEvm.ethAddress,l)).find((e=>"IMX"===e.tokenSymbol));if(!p)throw new Error("Failed to retrieve fees for IMX token");const h={nonce:f,to:p.recipientAddress,value:p.tokenPrice,revertOnError:!0};await i.validateEVMTransaction({chainId:cz(s),nonce:Hq(f),user:a,metaTransactions:[d,h]});const b=await oz([d,h],f,c,a.zkEvm.ethAddress,u),m=await r.ethSendTransaction(a.zkEvm.ethAddress,b),y=await Lq((async()=>{const e=await r.imGetTransactionByHash(m);if(e.status===nz.PENDING)throw new Error;return e}),{retries:30,interval:1e3,finalErr:new qq(jq.RPC_SERVER_ERROR,"transaction hash not generated in time")});if(![nz.SUBMITTED,nz.SUCCESSFUL].includes(y.status)){let e=`Transaction failed to submit with status ${y.status}.`;throw y.statusMessage&&(e+=` Error message: ${y.statusMessage}`),new qq(jq.RPC_SERVER_ERROR,e)}return y.hash})),lz=["types","domain","primaryType","message"],pz=(e,t)=>{let n;if("string"==typeof e)try{n=JSON.parse(e)}catch(e){throw new qq(jq.INVALID_PARAMS,`Failed to parse typed data JSON: ${e}`)}else{if("object"!=typeof e)throw new qq(jq.INVALID_PARAMS,`Invalid typed data argument: ${e}`);n=e}if(!(e=>lz.every((t=>t in e)))(n))throw new qq(jq.INVALID_PARAMS,`Invalid typed data argument. The following properties are required: ${lz.join(", ")}`);const r=n.domain?.chainId;if(r&&("string"==typeof r&&(r.startsWith("0x")?n.domain.chainId=parseInt(r,16):n.domain.chainId=parseInt(r,10)),n.domain.chainId!==t))throw new qq(jq.INVALID_PARAMS,`Invalid chainId, expected ${t}`);return n};class hz{authManager;config;confirmationScreen;magicAdapter;multiRollupApiClients;jsonRpcProvider;eventEmitter;guardianClient;relayerClient;magicProvider;user;isPassport=!0;constructor({authManager:e,magicAdapter:t,config:n,confirmationScreen:r,multiRollupApiClients:i,passportEventEmitter:a}){this.authManager=e,this.magicAdapter=t,this.config=n,this.confirmationScreen=r,this.jsonRpcProvider=new Yp(this.config.zkEvmRpcUrl),this.multiRollupApiClients=i,this.eventEmitter=new iz,a.on(Vq.LOGGED_OUT,this.handleLogout)}handleLogout=()=>{const e=this.isLoggedIn();this.magicProvider=void 0,this.user=void 0,this.relayerClient=void 0,this.guardianClient=void 0,e&&this.eventEmitter.emit(rz.ACCOUNTS_CHANGED,[])};isLoggedIn(){return void 0!==this.magicProvider&&void 0!==this.user&&void 0!==this.relayerClient&&void 0!==this.guardianClient}async performRequest(e){switch(e.method){case"eth_requestAccounts":{if(this.isLoggedIn())return[this.user.zkEvm.ethAddress];const{magicProvider:e,user:t}=await fz({authManager:this.authManager,config:this.config,magicAdapter:this.magicAdapter,multiRollupApiClients:this.multiRollupApiClients});return this.user=t,this.magicProvider=e,this.relayerClient=new uz({config:this.config,jsonRpcProvider:this.jsonRpcProvider,user:this.user}),this.guardianClient=new Gq({accessToken:this.user.accessToken,confirmationScreen:this.confirmationScreen,imxEtherAddress:this.user.zkEvm.ethAddress,config:this.config}),this.eventEmitter.emit(rz.ACCOUNTS_CHANGED,[this.user.zkEvm.ethAddress]),[this.user.zkEvm.ethAddress]}case"eth_sendTransaction":if(!this.isLoggedIn())throw new qq(Uq.UNAUTHORIZED,"Unauthorised - call eth_requestAccounts first");return dz({params:e.params||[],magicProvider:this.magicProvider,guardianClient:this.guardianClient,jsonRpcProvider:this.jsonRpcProvider,relayerClient:this.relayerClient,user:this.user});case"eth_accounts":return this.isLoggedIn()?[this.user.zkEvm.ethAddress]:[];case"eth_signTypedData":case"eth_signTypedData_v4":if(!this.isLoggedIn())throw new qq(Uq.UNAUTHORIZED,"Unauthorised - call eth_requestAccounts first");return(async({params:e,method:t,magicProvider:n,jsonRpcProvider:r,relayerClient:i,guardianClient:a,user:o})=>a.withConfirmationScreen({width:480,height:730})((async()=>{const s=e[0],c=e[1];if(!s||!c)throw new qq(jq.INVALID_PARAMS,`${t} requires an address and a typed data JSON`);const{chainId:u}=await r.ready,f=pz(c,u);await a.validateMessage({chainID:String(u),payload:f,user:o});const d=await i.imSignTypedData(s,f),l=new Zh(n).getSigner();return sz(f,d,Hr.from(u),s,l)})))({method:e.method,params:e.params||[],magicProvider:this.magicProvider,jsonRpcProvider:this.jsonRpcProvider,relayerClient:this.relayerClient,user:this.user,guardianClient:this.guardianClient});case"eth_gasPrice":case"eth_getBalance":case"eth_getCode":case"eth_getStorageAt":case"eth_estimateGas":case"eth_call":case"eth_blockNumber":case"eth_chainId":case"eth_getBlockByHash":case"eth_getBlockByNumber":case"eth_getTransactionByHash":case"eth_getTransactionReceipt":case"eth_getTransactionCount":return this.jsonRpcProvider.send(e.method,e.params||[]);default:throw new qq(Uq.UNSUPPORTED_METHOD,"Method not supported")}}async performJsonRpcRequest(e){const{id:t,jsonrpc:n}=e;try{return{id:t,jsonrpc:n,result:await this.performRequest(e)}}catch(e){let r;return r=e instanceof qq?e:e instanceof Error?new qq(jq.INTERNAL_ERROR,e.message):new qq(jq.INTERNAL_ERROR,"Internal error"),{id:t,jsonrpc:n,error:r}}}async request(e){try{return this.performRequest(e)}catch(e){if(e instanceof qq)throw e;if(e instanceof Error)throw new qq(jq.INTERNAL_ERROR,e.message);throw new qq(jq.INTERNAL_ERROR,"Internal error")}}sendAsync(e,t){if(!t)throw new Error("No callback provided");Array.isArray(e)?Promise.all(e.map(this.performJsonRpcRequest)).then((e=>{t(null,e)})).catch((e=>{t(e,[])})):this.performJsonRpcRequest(e).then((e=>{t(null,e)})).catch((e=>{t(e,null)}))}async send(e,t,n){if("string"==typeof e)return"function"==typeof t?this.sendAsync({method:e,params:[]},t):n?this.sendAsync({method:e,params:Array.isArray(t)?t:[]},n):this.request({method:e,params:Array.isArray(t)?t:[]});if("function"==typeof t)return this.sendAsync(e,t);if(!Array.isArray(e)&&"object"==typeof e)return this.performJsonRpcRequest(e);throw new qq(jq.INVALID_REQUEST,"Invalid request")}on(e,t){this.eventEmitter.on(e,t)}removeListener(e,t){this.eventEmitter.removeListener(e,t)}}var bz=Object.freeze({__proto__:null,JsonRpcError:qq,get Networks(){return Kq},Passport:class{authManager;config;confirmationScreen;immutableXClient;magicAdapter;multiRollupApiClients;passportImxProviderFactory;passportEventEmitter;constructor(e){this.config=new Qq(e),this.authManager=new Nq(this.config),this.magicAdapter=new Bq(this.config),this.confirmationScreen=new tz(this.config),this.immutableXClient=e.overrides?.immutableXClient||new VN({baseConfig:e.baseConfig}),this.multiRollupApiClients=new Ft(this.config.multiRollupConfig),this.passportEventEmitter=new iz,this.passportImxProviderFactory=new Jq({authManager:this.authManager,config:this.config,confirmationScreen:this.confirmationScreen,immutableXClient:this.immutableXClient,magicAdapter:this.magicAdapter,passportEventEmitter:this.passportEventEmitter})}async connectImxSilent(){return this.passportImxProviderFactory.getProviderSilent()}async connectImx(){return this.passportImxProviderFactory.getProvider()}async loginWithDeviceFlow(){return this.authManager.loginWithDeviceFlow()}async connectImxDeviceFlow(e,t,n){return this.passportImxProviderFactory.getProviderWithDeviceFlow(e,t,n)}getPKCEAuthorizationUrl(){return this.authManager.getPKCEAuthorizationUrl()}async connectImxPKCEFlow(e,t){return this.passportImxProviderFactory.getProviderWithPKCEFlow(e,t)}checkStoredDeviceFlowCredentials(){return this.authManager.checkStoredDeviceFlowCredentials()}async connectImxWithCredentials(e){return this.passportImxProviderFactory.getProviderWithCredentials(e)}connectEvm(){if(this.config.network===Kq.PRODUCTION)throw new Error("EVM is not supported on production network");return new hz({passportEventEmitter:this.passportEventEmitter,authManager:this.authManager,magicAdapter:this.magicAdapter,config:this.config,confirmationScreen:this.confirmationScreen,multiRollupApiClients:this.multiRollupApiClients})}async loginCallback(){return this.authManager.loginCallback()}async logout(){await this.authManager.logout(),await this.confirmationScreen.logout(),await this.magicAdapter.logout(),this.passportEventEmitter.emit(Vq.LOGGED_OUT)}async logoutSilentCallback(e){return this.authManager.logoutSilentCallback(e)}async logoutDeviceFlow(){return this.authManager.logoutDeviceFlow()}async getUserInfo(){const e=await this.authManager.getUser();return e?.profile}async getUserInfoDeviceFlow(){const e=await this.authManager.getUserDeviceFlow();return e?.profile}async getIdToken(){const e=await this.authManager.getUser();return e?.idToken}async getAccessToken(){const e=await this.authManager.getUser();return e?.accessToken}async getLinkedAddresses(){const e=await this.authManager.getUser();if(!e?.profile.sub)return[];const t={Authorization:`Bearer ${e.accessToken}`};return(await this.multiRollupApiClients.passportApi.getLinkedAddresses({userId:e?.profile.sub},{headers:t})).data.linkedAddresses}},PassportError:Sq,get ProviderErrorCode(){return Uq},get ProviderEvent(){return rz},get RpcErrorCode(){return jq}}),mz=Yt("object"==typeof self?self.FormData:window.FormData),yz={},gz={},vz=Qt(mq),wz=Qt(Rb),_z={},Ez=Qt(ks),Tz=Qt(ya),Az=Qt(Ro),Rz=Qt(bd),Sz=Qt(Dr),kz=Qt(gs),Iz=Qt(Vd),Oz=Qt(Il),xz=Qt(Yi),Cz=Qt(hr),Mz=Qt(_d),Pz=Qt(lb),Nz=Qt(Yd),Bz=Qt(vi),Dz=Qt(oa),Fz=Qt(Of),Lz=Qt(po),Uz=Qt(Wf),jz=Qt(wb),qz=Qt(Nl),zz=Qt(Ql);!function(e){var t=Jt&&Jt.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),n=Jt&&Jt.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),r=Jt&&Jt.__importStar||function(e){if(e&&e.__esModule)return e;var r={};if(null!=e)for(var i in e)"default"!==i&&Object.prototype.hasOwnProperty.call(e,i)&&t(r,e,i);return n(r,e),r};Object.defineProperty(e,"__esModule",{value:!0}),e.formatBytes32String=e.Utf8ErrorFuncs=e.toUtf8String=e.toUtf8CodePoints=e.toUtf8Bytes=e._toEscapedUtf8String=e.nameprep=e.hexDataSlice=e.hexDataLength=e.hexZeroPad=e.hexValue=e.hexStripZeros=e.hexConcat=e.isHexString=e.hexlify=e.base64=e.base58=e.TransactionDescription=e.LogDescription=e.Interface=e.SigningKey=e.HDNode=e.defaultPath=e.isBytesLike=e.isBytes=e.zeroPad=e.stripZeros=e.concat=e.arrayify=e.shallowCopy=e.resolveProperties=e.getStatic=e.defineReadOnly=e.deepCopy=e.checkProperties=e.poll=e.fetchJson=e._fetchData=e.RLP=e.Logger=e.checkResultErrors=e.FormatTypes=e.ParamType=e.FunctionFragment=e.EventFragment=e.ErrorFragment=e.ConstructorFragment=e.Fragment=e.defaultAbiCoder=e.AbiCoder=void 0,e.Indexed=e.Utf8ErrorReason=e.UnicodeNormalizationForm=e.SupportedAlgorithm=e.mnemonicToSeed=e.isValidMnemonic=e.entropyToMnemonic=e.mnemonicToEntropy=e.getAccountPath=e.verifyTypedData=e.verifyMessage=e.recoverPublicKey=e.computePublicKey=e.recoverAddress=e.computeAddress=e.getJsonWalletAddress=e.TransactionTypes=e.serializeTransaction=e.parseTransaction=e.accessListify=e.joinSignature=e.splitSignature=e.soliditySha256=e.solidityKeccak256=e.solidityPack=e.shuffled=e.randomBytes=e.sha512=e.sha256=e.ripemd160=e.keccak256=e.computeHmac=e.commify=e.parseUnits=e.formatUnits=e.parseEther=e.formatEther=e.isAddress=e.getCreate2Address=e.getContractAddress=e.getIcapAddress=e.getAddress=e._TypedDataEncoder=e.id=e.isValidName=e.namehash=e.hashMessage=e.dnsEncode=e.parseBytes32String=void 0;var i=Ez;Object.defineProperty(e,"AbiCoder",{enumerable:!0,get:function(){return i.AbiCoder}}),Object.defineProperty(e,"checkResultErrors",{enumerable:!0,get:function(){return i.checkResultErrors}}),Object.defineProperty(e,"ConstructorFragment",{enumerable:!0,get:function(){return i.ConstructorFragment}}),Object.defineProperty(e,"defaultAbiCoder",{enumerable:!0,get:function(){return i.defaultAbiCoder}}),Object.defineProperty(e,"ErrorFragment",{enumerable:!0,get:function(){return i.ErrorFragment}}),Object.defineProperty(e,"EventFragment",{enumerable:!0,get:function(){return i.EventFragment}}),Object.defineProperty(e,"FormatTypes",{enumerable:!0,get:function(){return i.FormatTypes}}),Object.defineProperty(e,"Fragment",{enumerable:!0,get:function(){return i.Fragment}}),Object.defineProperty(e,"FunctionFragment",{enumerable:!0,get:function(){return i.FunctionFragment}}),Object.defineProperty(e,"Indexed",{enumerable:!0,get:function(){return i.Indexed}}),Object.defineProperty(e,"Interface",{enumerable:!0,get:function(){return i.Interface}}),Object.defineProperty(e,"LogDescription",{enumerable:!0,get:function(){return i.LogDescription}}),Object.defineProperty(e,"ParamType",{enumerable:!0,get:function(){return i.ParamType}}),Object.defineProperty(e,"TransactionDescription",{enumerable:!0,get:function(){return i.TransactionDescription}});var a=Tz;Object.defineProperty(e,"getAddress",{enumerable:!0,get:function(){return a.getAddress}}),Object.defineProperty(e,"getCreate2Address",{enumerable:!0,get:function(){return a.getCreate2Address}}),Object.defineProperty(e,"getContractAddress",{enumerable:!0,get:function(){return a.getContractAddress}}),Object.defineProperty(e,"getIcapAddress",{enumerable:!0,get:function(){return a.getIcapAddress}}),Object.defineProperty(e,"isAddress",{enumerable:!0,get:function(){return a.isAddress}});var o=r(Az);e.base64=o;var s=Rz;Object.defineProperty(e,"base58",{enumerable:!0,get:function(){return s.Base58}});var c=Sz;Object.defineProperty(e,"arrayify",{enumerable:!0,get:function(){return c.arrayify}}),Object.defineProperty(e,"concat",{enumerable:!0,get:function(){return c.concat}}),Object.defineProperty(e,"hexConcat",{enumerable:!0,get:function(){return c.hexConcat}}),Object.defineProperty(e,"hexDataSlice",{enumerable:!0,get:function(){return c.hexDataSlice}}),Object.defineProperty(e,"hexDataLength",{enumerable:!0,get:function(){return c.hexDataLength}}),Object.defineProperty(e,"hexlify",{enumerable:!0,get:function(){return c.hexlify}}),Object.defineProperty(e,"hexStripZeros",{enumerable:!0,get:function(){return c.hexStripZeros}}),Object.defineProperty(e,"hexValue",{enumerable:!0,get:function(){return c.hexValue}}),Object.defineProperty(e,"hexZeroPad",{enumerable:!0,get:function(){return c.hexZeroPad}}),Object.defineProperty(e,"isBytes",{enumerable:!0,get:function(){return c.isBytes}}),Object.defineProperty(e,"isBytesLike",{enumerable:!0,get:function(){return c.isBytesLike}}),Object.defineProperty(e,"isHexString",{enumerable:!0,get:function(){return c.isHexString}}),Object.defineProperty(e,"joinSignature",{enumerable:!0,get:function(){return c.joinSignature}}),Object.defineProperty(e,"zeroPad",{enumerable:!0,get:function(){return c.zeroPad}}),Object.defineProperty(e,"splitSignature",{enumerable:!0,get:function(){return c.splitSignature}}),Object.defineProperty(e,"stripZeros",{enumerable:!0,get:function(){return c.stripZeros}});var u=kz;Object.defineProperty(e,"_TypedDataEncoder",{enumerable:!0,get:function(){return u._TypedDataEncoder}}),Object.defineProperty(e,"dnsEncode",{enumerable:!0,get:function(){return u.dnsEncode}}),Object.defineProperty(e,"hashMessage",{enumerable:!0,get:function(){return u.hashMessage}}),Object.defineProperty(e,"id",{enumerable:!0,get:function(){return u.id}}),Object.defineProperty(e,"isValidName",{enumerable:!0,get:function(){return u.isValidName}}),Object.defineProperty(e,"namehash",{enumerable:!0,get:function(){return u.namehash}});var f=Iz;Object.defineProperty(e,"defaultPath",{enumerable:!0,get:function(){return f.defaultPath}}),Object.defineProperty(e,"entropyToMnemonic",{enumerable:!0,get:function(){return f.entropyToMnemonic}}),Object.defineProperty(e,"getAccountPath",{enumerable:!0,get:function(){return f.getAccountPath}}),Object.defineProperty(e,"HDNode",{enumerable:!0,get:function(){return f.HDNode}}),Object.defineProperty(e,"isValidMnemonic",{enumerable:!0,get:function(){return f.isValidMnemonic}}),Object.defineProperty(e,"mnemonicToEntropy",{enumerable:!0,get:function(){return f.mnemonicToEntropy}}),Object.defineProperty(e,"mnemonicToSeed",{enumerable:!0,get:function(){return f.mnemonicToSeed}});var d=Oz;Object.defineProperty(e,"getJsonWalletAddress",{enumerable:!0,get:function(){return d.getJsonWalletAddress}});var l=xz;Object.defineProperty(e,"keccak256",{enumerable:!0,get:function(){return l.keccak256}});var p=Cz;Object.defineProperty(e,"Logger",{enumerable:!0,get:function(){return p.Logger}});var h=Mz;Object.defineProperty(e,"computeHmac",{enumerable:!0,get:function(){return h.computeHmac}}),Object.defineProperty(e,"ripemd160",{enumerable:!0,get:function(){return h.ripemd160}}),Object.defineProperty(e,"sha256",{enumerable:!0,get:function(){return h.sha256}}),Object.defineProperty(e,"sha512",{enumerable:!0,get:function(){return h.sha512}});var b=Pz;Object.defineProperty(e,"solidityKeccak256",{enumerable:!0,get:function(){return b.keccak256}}),Object.defineProperty(e,"solidityPack",{enumerable:!0,get:function(){return b.pack}}),Object.defineProperty(e,"soliditySha256",{enumerable:!0,get:function(){return b.sha256}});var m=Nz;Object.defineProperty(e,"randomBytes",{enumerable:!0,get:function(){return m.randomBytes}}),Object.defineProperty(e,"shuffled",{enumerable:!0,get:function(){return m.shuffled}});var y=Bz;Object.defineProperty(e,"checkProperties",{enumerable:!0,get:function(){return y.checkProperties}}),Object.defineProperty(e,"deepCopy",{enumerable:!0,get:function(){return y.deepCopy}}),Object.defineProperty(e,"defineReadOnly",{enumerable:!0,get:function(){return y.defineReadOnly}}),Object.defineProperty(e,"getStatic",{enumerable:!0,get:function(){return y.getStatic}}),Object.defineProperty(e,"resolveProperties",{enumerable:!0,get:function(){return y.resolveProperties}}),Object.defineProperty(e,"shallowCopy",{enumerable:!0,get:function(){return y.shallowCopy}});var g=r(Dz);e.RLP=g;var v=Fz;Object.defineProperty(e,"computePublicKey",{enumerable:!0,get:function(){return v.computePublicKey}}),Object.defineProperty(e,"recoverPublicKey",{enumerable:!0,get:function(){return v.recoverPublicKey}}),Object.defineProperty(e,"SigningKey",{enumerable:!0,get:function(){return v.SigningKey}});var w=Lz;Object.defineProperty(e,"formatBytes32String",{enumerable:!0,get:function(){return w.formatBytes32String}}),Object.defineProperty(e,"nameprep",{enumerable:!0,get:function(){return w.nameprep}}),Object.defineProperty(e,"parseBytes32String",{enumerable:!0,get:function(){return w.parseBytes32String}}),Object.defineProperty(e,"_toEscapedUtf8String",{enumerable:!0,get:function(){return w._toEscapedUtf8String}}),Object.defineProperty(e,"toUtf8Bytes",{enumerable:!0,get:function(){return w.toUtf8Bytes}}),Object.defineProperty(e,"toUtf8CodePoints",{enumerable:!0,get:function(){return w.toUtf8CodePoints}}),Object.defineProperty(e,"toUtf8String",{enumerable:!0,get:function(){return w.toUtf8String}}),Object.defineProperty(e,"Utf8ErrorFuncs",{enumerable:!0,get:function(){return w.Utf8ErrorFuncs}});var _=Uz;Object.defineProperty(e,"accessListify",{enumerable:!0,get:function(){return _.accessListify}}),Object.defineProperty(e,"computeAddress",{enumerable:!0,get:function(){return _.computeAddress}}),Object.defineProperty(e,"parseTransaction",{enumerable:!0,get:function(){return _.parse}}),Object.defineProperty(e,"recoverAddress",{enumerable:!0,get:function(){return _.recoverAddress}}),Object.defineProperty(e,"serializeTransaction",{enumerable:!0,get:function(){return _.serialize}}),Object.defineProperty(e,"TransactionTypes",{enumerable:!0,get:function(){return _.TransactionTypes}});var E=jz;Object.defineProperty(e,"commify",{enumerable:!0,get:function(){return E.commify}}),Object.defineProperty(e,"formatEther",{enumerable:!0,get:function(){return E.formatEther}}),Object.defineProperty(e,"parseEther",{enumerable:!0,get:function(){return E.parseEther}}),Object.defineProperty(e,"formatUnits",{enumerable:!0,get:function(){return E.formatUnits}}),Object.defineProperty(e,"parseUnits",{enumerable:!0,get:function(){return E.parseUnits}});var T=qz;Object.defineProperty(e,"verifyMessage",{enumerable:!0,get:function(){return T.verifyMessage}}),Object.defineProperty(e,"verifyTypedData",{enumerable:!0,get:function(){return T.verifyTypedData}});var A=zz;Object.defineProperty(e,"_fetchData",{enumerable:!0,get:function(){return A._fetchData}}),Object.defineProperty(e,"fetchJson",{enumerable:!0,get:function(){return A.fetchJson}}),Object.defineProperty(e,"poll",{enumerable:!0,get:function(){return A.poll}});var R=Mz;Object.defineProperty(e,"SupportedAlgorithm",{enumerable:!0,get:function(){return R.SupportedAlgorithm}});var S=Lz;Object.defineProperty(e,"UnicodeNormalizationForm",{enumerable:!0,get:function(){return S.UnicodeNormalizationForm}}),Object.defineProperty(e,"Utf8ErrorReason",{enumerable:!0,get:function(){return S.Utf8ErrorReason}})}(_z);var Hz={};Object.defineProperty(Hz,"__esModule",{value:!0}),Hz.DomainRegistryABI=void 0;Hz.DomainRegistryABI=[{inputs:[{internalType:"string",name:"domain",type:"string"}],name:"DomainAlreadyRegistered",type:"error"},{inputs:[{internalType:"bytes4",name:"tag",type:"bytes4"},{internalType:"uint256",name:"maxIndex",type:"uint256"},{internalType:"uint256",name:"suppliedIndex",type:"uint256"}],name:"DomainIndexOutOfRange",type:"error"},{anonymous:!1,inputs:[{indexed:!1,internalType:"string",name:"domain",type:"string"},{indexed:!1,internalType:"bytes4",name:"tag",type:"bytes4"},{indexed:!1,internalType:"uint256",name:"index",type:"uint256"}],name:"DomainRegistered",type:"event"},{inputs:[{internalType:"bytes4",name:"tag",type:"bytes4"},{internalType:"uint256",name:"index",type:"uint256"}],name:"getDomain",outputs:[{internalType:"string",name:"domain",type:"string"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes4",name:"tag",type:"bytes4"}],name:"getDomains",outputs:[{internalType:"string[]",name:"domains",type:"string[]"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes4",name:"tag",type:"bytes4"}],name:"getNumberOfDomains",outputs:[{internalType:"uint256",name:"totalDomains",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"string",name:"domain",type:"string"}],name:"setDomain",outputs:[{internalType:"bytes4",name:"tag",type:"bytes4"}],stateMutability:"nonpayable",type:"function"}];var Gz={};Object.defineProperty(Gz,"__esModule",{value:!0}),Gz.SeaportABIv14=void 0;Gz.SeaportABIv14=[{inputs:[{internalType:"address",name:"conduitController",type:"address"}],stateMutability:"nonpayable",type:"constructor"},{inputs:[],name:"BadContractSignature",type:"error"},{inputs:[],name:"BadFraction",type:"error"},{inputs:[{internalType:"address",name:"token",type:"address"},{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"BadReturnValueFromERC20OnTransfer",type:"error"},{inputs:[{internalType:"uint8",name:"v",type:"uint8"}],name:"BadSignatureV",type:"error"},{inputs:[],name:"CannotCancelOrder",type:"error"},{inputs:[],name:"ConsiderationCriteriaResolverOutOfRange",type:"error"},{inputs:[],name:"ConsiderationLengthNotEqualToTotalOriginal",type:"error"},{inputs:[{internalType:"uint256",name:"orderIndex",type:"uint256"},{internalType:"uint256",name:"considerationIndex",type:"uint256"},{internalType:"uint256",name:"shortfallAmount",type:"uint256"}],name:"ConsiderationNotMet",type:"error"},{inputs:[],name:"CriteriaNotEnabledForItem",type:"error"},{inputs:[{internalType:"address",name:"token",type:"address"},{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256[]",name:"identifiers",type:"uint256[]"},{internalType:"uint256[]",name:"amounts",type:"uint256[]"}],name:"ERC1155BatchTransferGenericFailure",type:"error"},{inputs:[{internalType:"address",name:"account",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"EtherTransferGenericFailure",type:"error"},{inputs:[],name:"InexactFraction",type:"error"},{inputs:[],name:"InsufficientEtherSupplied",type:"error"},{inputs:[],name:"Invalid1155BatchTransferEncoding",type:"error"},{inputs:[],name:"InvalidBasicOrderParameterEncoding",type:"error"},{inputs:[{internalType:"address",name:"conduit",type:"address"}],name:"InvalidCallToConduit",type:"error"},{inputs:[{internalType:"bytes32",name:"conduitKey",type:"bytes32"},{internalType:"address",name:"conduit",type:"address"}],name:"InvalidConduit",type:"error"},{inputs:[{internalType:"bytes32",name:"orderHash",type:"bytes32"}],name:"InvalidContractOrder",type:"error"},{inputs:[{internalType:"uint256",name:"amount",type:"uint256"}],name:"InvalidERC721TransferAmount",type:"error"},{inputs:[],name:"InvalidFulfillmentComponentData",type:"error"},{inputs:[{internalType:"uint256",name:"value",type:"uint256"}],name:"InvalidMsgValue",type:"error"},{inputs:[],name:"InvalidNativeOfferItem",type:"error"},{inputs:[],name:"InvalidProof",type:"error"},{inputs:[{internalType:"bytes32",name:"orderHash",type:"bytes32"}],name:"InvalidRestrictedOrder",type:"error"},{inputs:[],name:"InvalidSignature",type:"error"},{inputs:[],name:"InvalidSigner",type:"error"},{inputs:[{internalType:"uint256",name:"startTime",type:"uint256"},{internalType:"uint256",name:"endTime",type:"uint256"}],name:"InvalidTime",type:"error"},{inputs:[{internalType:"uint256",name:"fulfillmentIndex",type:"uint256"}],name:"MismatchedFulfillmentOfferAndConsiderationComponents",type:"error"},{inputs:[{internalType:"enum Side",name:"side",type:"uint8"}],name:"MissingFulfillmentComponentOnAggregation",type:"error"},{inputs:[],name:"MissingItemAmount",type:"error"},{inputs:[],name:"MissingOriginalConsiderationItems",type:"error"},{inputs:[{internalType:"address",name:"account",type:"address"}],name:"NoContract",type:"error"},{inputs:[],name:"NoReentrantCalls",type:"error"},{inputs:[],name:"NoSpecifiedOrdersAvailable",type:"error"},{inputs:[],name:"OfferAndConsiderationRequiredOnFulfillment",type:"error"},{inputs:[],name:"OfferCriteriaResolverOutOfRange",type:"error"},{inputs:[{internalType:"bytes32",name:"orderHash",type:"bytes32"}],name:"OrderAlreadyFilled",type:"error"},{inputs:[{internalType:"enum Side",name:"side",type:"uint8"}],name:"OrderCriteriaResolverOutOfRange",type:"error"},{inputs:[{internalType:"bytes32",name:"orderHash",type:"bytes32"}],name:"OrderIsCancelled",type:"error"},{inputs:[{internalType:"bytes32",name:"orderHash",type:"bytes32"}],name:"OrderPartiallyFilled",type:"error"},{inputs:[],name:"PartialFillsNotEnabledForOrder",type:"error"},{inputs:[{internalType:"address",name:"token",type:"address"},{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"identifier",type:"uint256"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"TokenTransferGenericFailure",type:"error"},{inputs:[{internalType:"uint256",name:"orderIndex",type:"uint256"},{internalType:"uint256",name:"considerationIndex",type:"uint256"}],name:"UnresolvedConsiderationCriteria",type:"error"},{inputs:[{internalType:"uint256",name:"orderIndex",type:"uint256"},{internalType:"uint256",name:"offerIndex",type:"uint256"}],name:"UnresolvedOfferCriteria",type:"error"},{inputs:[],name:"UnusedItemParameters",type:"error"},{anonymous:!1,inputs:[{indexed:!1,internalType:"uint256",name:"newCounter",type:"uint256"},{indexed:!0,internalType:"address",name:"offerer",type:"address"}],name:"CounterIncremented",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"bytes32",name:"orderHash",type:"bytes32"},{indexed:!0,internalType:"address",name:"offerer",type:"address"},{indexed:!0,internalType:"address",name:"zone",type:"address"}],name:"OrderCancelled",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"bytes32",name:"orderHash",type:"bytes32"},{indexed:!0,internalType:"address",name:"offerer",type:"address"},{indexed:!0,internalType:"address",name:"zone",type:"address"},{indexed:!1,internalType:"address",name:"recipient",type:"address"},{components:[{internalType:"enum ItemType",name:"itemType",type:"uint8"},{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"identifier",type:"uint256"},{internalType:"uint256",name:"amount",type:"uint256"}],indexed:!1,internalType:"struct SpentItem[]",name:"offer",type:"tuple[]"},{components:[{internalType:"enum ItemType",name:"itemType",type:"uint8"},{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"identifier",type:"uint256"},{internalType:"uint256",name:"amount",type:"uint256"},{internalType:"address payable",name:"recipient",type:"address"}],indexed:!1,internalType:"struct ReceivedItem[]",name:"consideration",type:"tuple[]"}],name:"OrderFulfilled",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"bytes32",name:"orderHash",type:"bytes32"},{components:[{internalType:"address",name:"offerer",type:"address"},{internalType:"address",name:"zone",type:"address"},{components:[{internalType:"enum ItemType",name:"itemType",type:"uint8"},{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"identifierOrCriteria",type:"uint256"},{internalType:"uint256",name:"startAmount",type:"uint256"},{internalType:"uint256",name:"endAmount",type:"uint256"}],internalType:"struct OfferItem[]",name:"offer",type:"tuple[]"},{components:[{internalType:"enum ItemType",name:"itemType",type:"uint8"},{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"identifierOrCriteria",type:"uint256"},{internalType:"uint256",name:"startAmount",type:"uint256"},{internalType:"uint256",name:"endAmount",type:"uint256"},{internalType:"address payable",name:"recipient",type:"address"}],internalType:"struct ConsiderationItem[]",name:"consideration",type:"tuple[]"},{internalType:"enum OrderType",name:"orderType",type:"uint8"},{internalType:"uint256",name:"startTime",type:"uint256"},{internalType:"uint256",name:"endTime",type:"uint256"},{internalType:"bytes32",name:"zoneHash",type:"bytes32"},{internalType:"uint256",name:"salt",type:"uint256"},{internalType:"bytes32",name:"conduitKey",type:"bytes32"},{internalType:"uint256",name:"totalOriginalConsiderationItems",type:"uint256"}],indexed:!1,internalType:"struct OrderParameters",name:"orderParameters",type:"tuple"}],name:"OrderValidated",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"bytes32[]",name:"orderHashes",type:"bytes32[]"}],name:"OrdersMatched",type:"event"},{inputs:[{components:[{internalType:"address",name:"offerer",type:"address"},{internalType:"address",name:"zone",type:"address"},{components:[{internalType:"enum ItemType",name:"itemType",type:"uint8"},{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"identifierOrCriteria",type:"uint256"},{internalType:"uint256",name:"startAmount",type:"uint256"},{internalType:"uint256",name:"endAmount",type:"uint256"}],internalType:"struct OfferItem[]",name:"offer",type:"tuple[]"},{components:[{internalType:"enum ItemType",name:"itemType",type:"uint8"},{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"identifierOrCriteria",type:"uint256"},{internalType:"uint256",name:"startAmount",type:"uint256"},{internalType:"uint256",name:"endAmount",type:"uint256"},{internalType:"address payable",name:"recipient",type:"address"}],internalType:"struct ConsiderationItem[]",name:"consideration",type:"tuple[]"},{internalType:"enum OrderType",name:"orderType",type:"uint8"},{internalType:"uint256",name:"startTime",type:"uint256"},{internalType:"uint256",name:"endTime",type:"uint256"},{internalType:"bytes32",name:"zoneHash",type:"bytes32"},{internalType:"uint256",name:"salt",type:"uint256"},{internalType:"bytes32",name:"conduitKey",type:"bytes32"},{internalType:"uint256",name:"counter",type:"uint256"}],internalType:"struct OrderComponents[]",name:"orders",type:"tuple[]"}],name:"cancel",outputs:[{internalType:"bool",name:"cancelled",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{components:[{components:[{internalType:"address",name:"offerer",type:"address"},{internalType:"address",name:"zone",type:"address"},{components:[{internalType:"enum ItemType",name:"itemType",type:"uint8"},{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"identifierOrCriteria",type:"uint256"},{internalType:"uint256",name:"startAmount",type:"uint256"},{internalType:"uint256",name:"endAmount",type:"uint256"}],internalType:"struct OfferItem[]",name:"offer",type:"tuple[]"},{components:[{internalType:"enum ItemType",name:"itemType",type:"uint8"},{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"identifierOrCriteria",type:"uint256"},{internalType:"uint256",name:"startAmount",type:"uint256"},{internalType:"uint256",name:"endAmount",type:"uint256"},{internalType:"address payable",name:"recipient",type:"address"}],internalType:"struct ConsiderationItem[]",name:"consideration",type:"tuple[]"},{internalType:"enum OrderType",name:"orderType",type:"uint8"},{internalType:"uint256",name:"startTime",type:"uint256"},{internalType:"uint256",name:"endTime",type:"uint256"},{internalType:"bytes32",name:"zoneHash",type:"bytes32"},{internalType:"uint256",name:"salt",type:"uint256"},{internalType:"bytes32",name:"conduitKey",type:"bytes32"},{internalType:"uint256",name:"totalOriginalConsiderationItems",type:"uint256"}],internalType:"struct OrderParameters",name:"parameters",type:"tuple"},{internalType:"uint120",name:"numerator",type:"uint120"},{internalType:"uint120",name:"denominator",type:"uint120"},{internalType:"bytes",name:"signature",type:"bytes"},{internalType:"bytes",name:"extraData",type:"bytes"}],internalType:"struct AdvancedOrder",name:"advancedOrder",type:"tuple"},{components:[{internalType:"uint256",name:"orderIndex",type:"uint256"},{internalType:"enum Side",name:"side",type:"uint8"},{internalType:"uint256",name:"index",type:"uint256"},{internalType:"uint256",name:"identifier",type:"uint256"},{internalType:"bytes32[]",name:"criteriaProof",type:"bytes32[]"}],internalType:"struct CriteriaResolver[]",name:"criteriaResolvers",type:"tuple[]"},{internalType:"bytes32",name:"fulfillerConduitKey",type:"bytes32"},{internalType:"address",name:"recipient",type:"address"}],name:"fulfillAdvancedOrder",outputs:[{internalType:"bool",name:"fulfilled",type:"bool"}],stateMutability:"payable",type:"function"},{inputs:[{components:[{components:[{internalType:"address",name:"offerer",type:"address"},{internalType:"address",name:"zone",type:"address"},{components:[{internalType:"enum ItemType",name:"itemType",type:"uint8"},{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"identifierOrCriteria",type:"uint256"},{internalType:"uint256",name:"startAmount",type:"uint256"},{internalType:"uint256",name:"endAmount",type:"uint256"}],internalType:"struct OfferItem[]",name:"offer",type:"tuple[]"},{components:[{internalType:"enum ItemType",name:"itemType",type:"uint8"},{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"identifierOrCriteria",type:"uint256"},{internalType:"uint256",name:"startAmount",type:"uint256"},{internalType:"uint256",name:"endAmount",type:"uint256"},{internalType:"address payable",name:"recipient",type:"address"}],internalType:"struct ConsiderationItem[]",name:"consideration",type:"tuple[]"},{internalType:"enum OrderType",name:"orderType",type:"uint8"},{internalType:"uint256",name:"startTime",type:"uint256"},{internalType:"uint256",name:"endTime",type:"uint256"},{internalType:"bytes32",name:"zoneHash",type:"bytes32"},{internalType:"uint256",name:"salt",type:"uint256"},{internalType:"bytes32",name:"conduitKey",type:"bytes32"},{internalType:"uint256",name:"totalOriginalConsiderationItems",type:"uint256"}],internalType:"struct OrderParameters",name:"parameters",type:"tuple"},{internalType:"uint120",name:"numerator",type:"uint120"},{internalType:"uint120",name:"denominator",type:"uint120"},{internalType:"bytes",name:"signature",type:"bytes"},{internalType:"bytes",name:"extraData",type:"bytes"}],internalType:"struct AdvancedOrder[]",name:"advancedOrders",type:"tuple[]"},{components:[{internalType:"uint256",name:"orderIndex",type:"uint256"},{internalType:"enum Side",name:"side",type:"uint8"},{internalType:"uint256",name:"index",type:"uint256"},{internalType:"uint256",name:"identifier",type:"uint256"},{internalType:"bytes32[]",name:"criteriaProof",type:"bytes32[]"}],internalType:"struct CriteriaResolver[]",name:"criteriaResolvers",type:"tuple[]"},{components:[{internalType:"uint256",name:"orderIndex",type:"uint256"},{internalType:"uint256",name:"itemIndex",type:"uint256"}],internalType:"struct FulfillmentComponent[][]",name:"offerFulfillments",type:"tuple[][]"},{components:[{internalType:"uint256",name:"orderIndex",type:"uint256"},{internalType:"uint256",name:"itemIndex",type:"uint256"}],internalType:"struct FulfillmentComponent[][]",name:"considerationFulfillments",type:"tuple[][]"},{internalType:"bytes32",name:"fulfillerConduitKey",type:"bytes32"},{internalType:"address",name:"recipient",type:"address"},{internalType:"uint256",name:"maximumFulfilled",type:"uint256"}],name:"fulfillAvailableAdvancedOrders",outputs:[{internalType:"bool[]",name:"availableOrders",type:"bool[]"},{components:[{components:[{internalType:"enum ItemType",name:"itemType",type:"uint8"},{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"identifier",type:"uint256"},{internalType:"uint256",name:"amount",type:"uint256"},{internalType:"address payable",name:"recipient",type:"address"}],internalType:"struct ReceivedItem",name:"item",type:"tuple"},{internalType:"address",name:"offerer",type:"address"},{internalType:"bytes32",name:"conduitKey",type:"bytes32"}],internalType:"struct Execution[]",name:"executions",type:"tuple[]"}],stateMutability:"payable",type:"function"},{inputs:[{components:[{components:[{internalType:"address",name:"offerer",type:"address"},{internalType:"address",name:"zone",type:"address"},{components:[{internalType:"enum ItemType",name:"itemType",type:"uint8"},{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"identifierOrCriteria",type:"uint256"},{internalType:"uint256",name:"startAmount",type:"uint256"},{internalType:"uint256",name:"endAmount",type:"uint256"}],internalType:"struct OfferItem[]",name:"offer",type:"tuple[]"},{components:[{internalType:"enum ItemType",name:"itemType",type:"uint8"},{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"identifierOrCriteria",type:"uint256"},{internalType:"uint256",name:"startAmount",type:"uint256"},{internalType:"uint256",name:"endAmount",type:"uint256"},{internalType:"address payable",name:"recipient",type:"address"}],internalType:"struct ConsiderationItem[]",name:"consideration",type:"tuple[]"},{internalType:"enum OrderType",name:"orderType",type:"uint8"},{internalType:"uint256",name:"startTime",type:"uint256"},{internalType:"uint256",name:"endTime",type:"uint256"},{internalType:"bytes32",name:"zoneHash",type:"bytes32"},{internalType:"uint256",name:"salt",type:"uint256"},{internalType:"bytes32",name:"conduitKey",type:"bytes32"},{internalType:"uint256",name:"totalOriginalConsiderationItems",type:"uint256"}],internalType:"struct OrderParameters",name:"parameters",type:"tuple"},{internalType:"bytes",name:"signature",type:"bytes"}],internalType:"struct Order[]",name:"orders",type:"tuple[]"},{components:[{internalType:"uint256",name:"orderIndex",type:"uint256"},{internalType:"uint256",name:"itemIndex",type:"uint256"}],internalType:"struct FulfillmentComponent[][]",name:"offerFulfillments",type:"tuple[][]"},{components:[{internalType:"uint256",name:"orderIndex",type:"uint256"},{internalType:"uint256",name:"itemIndex",type:"uint256"}],internalType:"struct FulfillmentComponent[][]",name:"considerationFulfillments",type:"tuple[][]"},{internalType:"bytes32",name:"fulfillerConduitKey",type:"bytes32"},{internalType:"uint256",name:"maximumFulfilled",type:"uint256"}],name:"fulfillAvailableOrders",outputs:[{internalType:"bool[]",name:"availableOrders",type:"bool[]"},{components:[{components:[{internalType:"enum ItemType",name:"itemType",type:"uint8"},{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"identifier",type:"uint256"},{internalType:"uint256",name:"amount",type:"uint256"},{internalType:"address payable",name:"recipient",type:"address"}],internalType:"struct ReceivedItem",name:"item",type:"tuple"},{internalType:"address",name:"offerer",type:"address"},{internalType:"bytes32",name:"conduitKey",type:"bytes32"}],internalType:"struct Execution[]",name:"executions",type:"tuple[]"}],stateMutability:"payable",type:"function"},{inputs:[{components:[{internalType:"address",name:"considerationToken",type:"address"},{internalType:"uint256",name:"considerationIdentifier",type:"uint256"},{internalType:"uint256",name:"considerationAmount",type:"uint256"},{internalType:"address payable",name:"offerer",type:"address"},{internalType:"address",name:"zone",type:"address"},{internalType:"address",name:"offerToken",type:"address"},{internalType:"uint256",name:"offerIdentifier",type:"uint256"},{internalType:"uint256",name:"offerAmount",type:"uint256"},{internalType:"enum BasicOrderType",name:"basicOrderType",type:"uint8"},{internalType:"uint256",name:"startTime",type:"uint256"},{internalType:"uint256",name:"endTime",type:"uint256"},{internalType:"bytes32",name:"zoneHash",type:"bytes32"},{internalType:"uint256",name:"salt",type:"uint256"},{internalType:"bytes32",name:"offererConduitKey",type:"bytes32"},{internalType:"bytes32",name:"fulfillerConduitKey",type:"bytes32"},{internalType:"uint256",name:"totalOriginalAdditionalRecipients",type:"uint256"},{components:[{internalType:"uint256",name:"amount",type:"uint256"},{internalType:"address payable",name:"recipient",type:"address"}],internalType:"struct AdditionalRecipient[]",name:"additionalRecipients",type:"tuple[]"},{internalType:"bytes",name:"signature",type:"bytes"}],internalType:"struct BasicOrderParameters",name:"parameters",type:"tuple"}],name:"fulfillBasicOrder",outputs:[{internalType:"bool",name:"fulfilled",type:"bool"}],stateMutability:"payable",type:"function"},{inputs:[{components:[{components:[{internalType:"address",name:"offerer",type:"address"},{internalType:"address",name:"zone",type:"address"},{components:[{internalType:"enum ItemType",name:"itemType",type:"uint8"},{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"identifierOrCriteria",type:"uint256"},{internalType:"uint256",name:"startAmount",type:"uint256"},{internalType:"uint256",name:"endAmount",type:"uint256"}],internalType:"struct OfferItem[]",name:"offer",type:"tuple[]"},{components:[{internalType:"enum ItemType",name:"itemType",type:"uint8"},{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"identifierOrCriteria",type:"uint256"},{internalType:"uint256",name:"startAmount",type:"uint256"},{internalType:"uint256",name:"endAmount",type:"uint256"},{internalType:"address payable",name:"recipient",type:"address"}],internalType:"struct ConsiderationItem[]",name:"consideration",type:"tuple[]"},{internalType:"enum OrderType",name:"orderType",type:"uint8"},{internalType:"uint256",name:"startTime",type:"uint256"},{internalType:"uint256",name:"endTime",type:"uint256"},{internalType:"bytes32",name:"zoneHash",type:"bytes32"},{internalType:"uint256",name:"salt",type:"uint256"},{internalType:"bytes32",name:"conduitKey",type:"bytes32"},{internalType:"uint256",name:"totalOriginalConsiderationItems",type:"uint256"}],internalType:"struct OrderParameters",name:"parameters",type:"tuple"},{internalType:"bytes",name:"signature",type:"bytes"}],internalType:"struct Order",name:"order",type:"tuple"},{internalType:"bytes32",name:"fulfillerConduitKey",type:"bytes32"}],name:"fulfillOrder",outputs:[{internalType:"bool",name:"fulfilled",type:"bool"}],stateMutability:"payable",type:"function"},{inputs:[{internalType:"address",name:"contractOfferer",type:"address"}],name:"getContractOffererNonce",outputs:[{internalType:"uint256",name:"nonce",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"offerer",type:"address"}],name:"getCounter",outputs:[{internalType:"uint256",name:"counter",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{components:[{internalType:"address",name:"offerer",type:"address"},{internalType:"address",name:"zone",type:"address"},{components:[{internalType:"enum ItemType",name:"itemType",type:"uint8"},{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"identifierOrCriteria",type:"uint256"},{internalType:"uint256",name:"startAmount",type:"uint256"},{internalType:"uint256",name:"endAmount",type:"uint256"}],internalType:"struct OfferItem[]",name:"offer",type:"tuple[]"},{components:[{internalType:"enum ItemType",name:"itemType",type:"uint8"},{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"identifierOrCriteria",type:"uint256"},{internalType:"uint256",name:"startAmount",type:"uint256"},{internalType:"uint256",name:"endAmount",type:"uint256"},{internalType:"address payable",name:"recipient",type:"address"}],internalType:"struct ConsiderationItem[]",name:"consideration",type:"tuple[]"},{internalType:"enum OrderType",name:"orderType",type:"uint8"},{internalType:"uint256",name:"startTime",type:"uint256"},{internalType:"uint256",name:"endTime",type:"uint256"},{internalType:"bytes32",name:"zoneHash",type:"bytes32"},{internalType:"uint256",name:"salt",type:"uint256"},{internalType:"bytes32",name:"conduitKey",type:"bytes32"},{internalType:"uint256",name:"counter",type:"uint256"}],internalType:"struct OrderComponents",name:"order",type:"tuple"}],name:"getOrderHash",outputs:[{internalType:"bytes32",name:"orderHash",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"orderHash",type:"bytes32"}],name:"getOrderStatus",outputs:[{internalType:"bool",name:"isValidated",type:"bool"},{internalType:"bool",name:"isCancelled",type:"bool"},{internalType:"uint256",name:"totalFilled",type:"uint256"},{internalType:"uint256",name:"totalSize",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"incrementCounter",outputs:[{internalType:"uint256",name:"newCounter",type:"uint256"}],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"information",outputs:[{internalType:"string",name:"version",type:"string"},{internalType:"bytes32",name:"domainSeparator",type:"bytes32"},{internalType:"address",name:"conduitController",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{components:[{components:[{internalType:"address",name:"offerer",type:"address"},{internalType:"address",name:"zone",type:"address"},{components:[{internalType:"enum ItemType",name:"itemType",type:"uint8"},{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"identifierOrCriteria",type:"uint256"},{internalType:"uint256",name:"startAmount",type:"uint256"},{internalType:"uint256",name:"endAmount",type:"uint256"}],internalType:"struct OfferItem[]",name:"offer",type:"tuple[]"},{components:[{internalType:"enum ItemType",name:"itemType",type:"uint8"},{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"identifierOrCriteria",type:"uint256"},{internalType:"uint256",name:"startAmount",type:"uint256"},{internalType:"uint256",name:"endAmount",type:"uint256"},{internalType:"address payable",name:"recipient",type:"address"}],internalType:"struct ConsiderationItem[]",name:"consideration",type:"tuple[]"},{internalType:"enum OrderType",name:"orderType",type:"uint8"},{internalType:"uint256",name:"startTime",type:"uint256"},{internalType:"uint256",name:"endTime",type:"uint256"},{internalType:"bytes32",name:"zoneHash",type:"bytes32"},{internalType:"uint256",name:"salt",type:"uint256"},{internalType:"bytes32",name:"conduitKey",type:"bytes32"},{internalType:"uint256",name:"totalOriginalConsiderationItems",type:"uint256"}],internalType:"struct OrderParameters",name:"parameters",type:"tuple"},{internalType:"uint120",name:"numerator",type:"uint120"},{internalType:"uint120",name:"denominator",type:"uint120"},{internalType:"bytes",name:"signature",type:"bytes"},{internalType:"bytes",name:"extraData",type:"bytes"}],internalType:"struct AdvancedOrder[]",name:"orders",type:"tuple[]"},{components:[{internalType:"uint256",name:"orderIndex",type:"uint256"},{internalType:"enum Side",name:"side",type:"uint8"},{internalType:"uint256",name:"index",type:"uint256"},{internalType:"uint256",name:"identifier",type:"uint256"},{internalType:"bytes32[]",name:"criteriaProof",type:"bytes32[]"}],internalType:"struct CriteriaResolver[]",name:"criteriaResolvers",type:"tuple[]"},{components:[{components:[{internalType:"uint256",name:"orderIndex",type:"uint256"},{internalType:"uint256",name:"itemIndex",type:"uint256"}],internalType:"struct FulfillmentComponent[]",name:"offerComponents",type:"tuple[]"},{components:[{internalType:"uint256",name:"orderIndex",type:"uint256"},{internalType:"uint256",name:"itemIndex",type:"uint256"}],internalType:"struct FulfillmentComponent[]",name:"considerationComponents",type:"tuple[]"}],internalType:"struct Fulfillment[]",name:"fulfillments",type:"tuple[]"},{internalType:"address",name:"recipient",type:"address"}],name:"matchAdvancedOrders",outputs:[{components:[{components:[{internalType:"enum ItemType",name:"itemType",type:"uint8"},{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"identifier",type:"uint256"},{internalType:"uint256",name:"amount",type:"uint256"},{internalType:"address payable",name:"recipient",type:"address"}],internalType:"struct ReceivedItem",name:"item",type:"tuple"},{internalType:"address",name:"offerer",type:"address"},{internalType:"bytes32",name:"conduitKey",type:"bytes32"}],internalType:"struct Execution[]",name:"executions",type:"tuple[]"}],stateMutability:"payable",type:"function"},{inputs:[{components:[{components:[{internalType:"address",name:"offerer",type:"address"},{internalType:"address",name:"zone",type:"address"},{components:[{internalType:"enum ItemType",name:"itemType",type:"uint8"},{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"identifierOrCriteria",type:"uint256"},{internalType:"uint256",name:"startAmount",type:"uint256"},{internalType:"uint256",name:"endAmount",type:"uint256"}],internalType:"struct OfferItem[]",name:"offer",type:"tuple[]"},{components:[{internalType:"enum ItemType",name:"itemType",type:"uint8"},{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"identifierOrCriteria",type:"uint256"},{internalType:"uint256",name:"startAmount",type:"uint256"},{internalType:"uint256",name:"endAmount",type:"uint256"},{internalType:"address payable",name:"recipient",type:"address"}],internalType:"struct ConsiderationItem[]",name:"consideration",type:"tuple[]"},{internalType:"enum OrderType",name:"orderType",type:"uint8"},{internalType:"uint256",name:"startTime",type:"uint256"},{internalType:"uint256",name:"endTime",type:"uint256"},{internalType:"bytes32",name:"zoneHash",type:"bytes32"},{internalType:"uint256",name:"salt",type:"uint256"},{internalType:"bytes32",name:"conduitKey",type:"bytes32"},{internalType:"uint256",name:"totalOriginalConsiderationItems",type:"uint256"}],internalType:"struct OrderParameters",name:"parameters",type:"tuple"},{internalType:"bytes",name:"signature",type:"bytes"}],internalType:"struct Order[]",name:"orders",type:"tuple[]"},{components:[{components:[{internalType:"uint256",name:"orderIndex",type:"uint256"},{internalType:"uint256",name:"itemIndex",type:"uint256"}],internalType:"struct FulfillmentComponent[]",name:"offerComponents",type:"tuple[]"},{components:[{internalType:"uint256",name:"orderIndex",type:"uint256"},{internalType:"uint256",name:"itemIndex",type:"uint256"}],internalType:"struct FulfillmentComponent[]",name:"considerationComponents",type:"tuple[]"}],internalType:"struct Fulfillment[]",name:"fulfillments",type:"tuple[]"}],name:"matchOrders",outputs:[{components:[{components:[{internalType:"enum ItemType",name:"itemType",type:"uint8"},{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"identifier",type:"uint256"},{internalType:"uint256",name:"amount",type:"uint256"},{internalType:"address payable",name:"recipient",type:"address"}],internalType:"struct ReceivedItem",name:"item",type:"tuple"},{internalType:"address",name:"offerer",type:"address"},{internalType:"bytes32",name:"conduitKey",type:"bytes32"}],internalType:"struct Execution[]",name:"executions",type:"tuple[]"}],stateMutability:"payable",type:"function"},{inputs:[],name:"name",outputs:[{internalType:"string",name:"contractName",type:"string"}],stateMutability:"view",type:"function"},{inputs:[{components:[{components:[{internalType:"address",name:"offerer",type:"address"},{internalType:"address",name:"zone",type:"address"},{components:[{internalType:"enum ItemType",name:"itemType",type:"uint8"},{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"identifierOrCriteria",type:"uint256"},{internalType:"uint256",name:"startAmount",type:"uint256"},{internalType:"uint256",name:"endAmount",type:"uint256"}],internalType:"struct OfferItem[]",name:"offer",type:"tuple[]"},{components:[{internalType:"enum ItemType",name:"itemType",type:"uint8"},{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"identifierOrCriteria",type:"uint256"},{internalType:"uint256",name:"startAmount",type:"uint256"},{internalType:"uint256",name:"endAmount",type:"uint256"},{internalType:"address payable",name:"recipient",type:"address"}],internalType:"struct ConsiderationItem[]",name:"consideration",type:"tuple[]"},{internalType:"enum OrderType",name:"orderType",type:"uint8"},{internalType:"uint256",name:"startTime",type:"uint256"},{internalType:"uint256",name:"endTime",type:"uint256"},{internalType:"bytes32",name:"zoneHash",type:"bytes32"},{internalType:"uint256",name:"salt",type:"uint256"},{internalType:"bytes32",name:"conduitKey",type:"bytes32"},{internalType:"uint256",name:"totalOriginalConsiderationItems",type:"uint256"}],internalType:"struct OrderParameters",name:"parameters",type:"tuple"},{internalType:"bytes",name:"signature",type:"bytes"}],internalType:"struct Order[]",name:"orders",type:"tuple[]"}],name:"validate",outputs:[{internalType:"bool",name:"validated",type:"bool"}],stateMutability:"nonpayable",type:"function"},{stateMutability:"payable",type:"receive"}];var Vz={};!function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.DOMAIN_REGISTRY_ADDRESS=e.CROSS_CHAIN_SEAPORT_V1_5_ADDRESS=e.CROSS_CHAIN_SEAPORT_V1_4_ADDRESS=e.KNOWN_CONDUIT_KEYS_TO_CONDUIT=e.NO_CONDUIT=e.ONE_HUNDRED_PERCENT_BP=e.MAX_INT=e.BasicOrderRouteType=e.Side=e.ItemType=e.OrderType=e.EIP_712_BULK_ORDER_TYPE=e.EIP_712_ORDER_TYPE=e.OPENSEA_CONDUIT_ADDRESS=e.OPENSEA_CONDUIT_KEY=e.SEAPORT_CONTRACT_VERSION_V1_5=e.SEAPORT_CONTRACT_VERSION_V1_4=e.SEAPORT_CONTRACT_NAME=void 0;const t=wz;var n,r,i,a;e.SEAPORT_CONTRACT_NAME="Seaport",e.SEAPORT_CONTRACT_VERSION_V1_4="1.4",e.SEAPORT_CONTRACT_VERSION_V1_5="1.5",e.OPENSEA_CONDUIT_KEY="0x0000007b02230091a7ed01230072f7006a004d60a8d4e71d599b8104250f0000",e.OPENSEA_CONDUIT_ADDRESS="0x1e0049783f008a0085193e00003d00cd54003c71",e.EIP_712_ORDER_TYPE={OrderComponents:[{name:"offerer",type:"address"},{name:"zone",type:"address"},{name:"offer",type:"OfferItem[]"},{name:"consideration",type:"ConsiderationItem[]"},{name:"orderType",type:"uint8"},{name:"startTime",type:"uint256"},{name:"endTime",type:"uint256"},{name:"zoneHash",type:"bytes32"},{name:"salt",type:"uint256"},{name:"conduitKey",type:"bytes32"},{name:"counter",type:"uint256"}],OfferItem:[{name:"itemType",type:"uint8"},{name:"token",type:"address"},{name:"identifierOrCriteria",type:"uint256"},{name:"startAmount",type:"uint256"},{name:"endAmount",type:"uint256"}],ConsiderationItem:[{name:"itemType",type:"uint8"},{name:"token",type:"address"},{name:"identifierOrCriteria",type:"uint256"},{name:"startAmount",type:"uint256"},{name:"endAmount",type:"uint256"},{name:"recipient",type:"address"}]},e.EIP_712_BULK_ORDER_TYPE={BulkOrder:[{name:"tree",type:"OrderComponents[2][2][2][2][2][2][2]"}],OrderComponents:[{name:"offerer",type:"address"},{name:"zone",type:"address"},{name:"offer",type:"OfferItem[]"},{name:"consideration",type:"ConsiderationItem[]"},{name:"orderType",type:"uint8"},{name:"startTime",type:"uint256"},{name:"endTime",type:"uint256"},{name:"zoneHash",type:"bytes32"},{name:"salt",type:"uint256"},{name:"conduitKey",type:"bytes32"},{name:"counter",type:"uint256"}],OfferItem:[{name:"itemType",type:"uint8"},{name:"token",type:"address"},{name:"identifierOrCriteria",type:"uint256"},{name:"startAmount",type:"uint256"},{name:"endAmount",type:"uint256"}],ConsiderationItem:[{name:"itemType",type:"uint8"},{name:"token",type:"address"},{name:"identifierOrCriteria",type:"uint256"},{name:"startAmount",type:"uint256"},{name:"endAmount",type:"uint256"},{name:"recipient",type:"address"}]},function(e){e[e.FULL_OPEN=0]="FULL_OPEN",e[e.PARTIAL_OPEN=1]="PARTIAL_OPEN",e[e.FULL_RESTRICTED=2]="FULL_RESTRICTED",e[e.PARTIAL_RESTRICTED=3]="PARTIAL_RESTRICTED"}(n||(e.OrderType=n={})),function(e){e[e.NATIVE=0]="NATIVE",e[e.ERC20=1]="ERC20",e[e.ERC721=2]="ERC721",e[e.ERC1155=3]="ERC1155",e[e.ERC721_WITH_CRITERIA=4]="ERC721_WITH_CRITERIA",e[e.ERC1155_WITH_CRITERIA=5]="ERC1155_WITH_CRITERIA"}(r||(e.ItemType=r={})),function(e){e[e.OFFER=0]="OFFER",e[e.CONSIDERATION=1]="CONSIDERATION"}(i||(e.Side=i={})),function(e){e[e.ETH_TO_ERC721=0]="ETH_TO_ERC721",e[e.ETH_TO_ERC1155=1]="ETH_TO_ERC1155",e[e.ERC20_TO_ERC721=2]="ERC20_TO_ERC721",e[e.ERC20_TO_ERC1155=3]="ERC20_TO_ERC1155",e[e.ERC721_TO_ERC20=4]="ERC721_TO_ERC20",e[e.ERC1155_TO_ERC20=5]="ERC1155_TO_ERC20"}(a||(e.BasicOrderRouteType=a={})),e.MAX_INT=t.BigNumber.from("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"),e.ONE_HUNDRED_PERCENT_BP=1e4,e.NO_CONDUIT="0x0000000000000000000000000000000000000000000000000000000000000000",e.KNOWN_CONDUIT_KEYS_TO_CONDUIT={[e.OPENSEA_CONDUIT_KEY]:e.OPENSEA_CONDUIT_ADDRESS},e.CROSS_CHAIN_SEAPORT_V1_4_ADDRESS="0x00000000000001ad428e4906aE43D8F9852d0dD6",e.CROSS_CHAIN_SEAPORT_V1_5_ADDRESS="0x00000000000000ADc04C56Bf30aC9d3c0aAF14dC",e.DOMAIN_REGISTRY_ADDRESS="0x000000000DaD0DE04D2B2D4a5A74581EBA94124A"}(Vz);var Kz={},Wz={};Object.defineProperty(Wz,"__esModule",{value:!0}),Wz.ERC20ABI=void 0;Wz.ERC20ABI=[{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"owner",type:"address"},{indexed:!0,internalType:"address",name:"spender",type:"address"},{indexed:!1,internalType:"uint256",name:"amount",type:"uint256"}],name:"Approval",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"from",type:"address"},{indexed:!0,internalType:"address",name:"to",type:"address"},{indexed:!1,internalType:"uint256",name:"amount",type:"uint256"}],name:"Transfer",type:"event"},{inputs:[],name:"DOMAIN_SEPARATOR",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[],name:"PERMIT_TYPEHASH",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"",type:"address"},{internalType:"address",name:"",type:"address"}],name:"allowance",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"spender",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"approve",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"",type:"address"}],name:"balanceOf",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"decimals",outputs:[{internalType:"uint8",name:"",type:"uint8"}],stateMutability:"view",type:"function"},{inputs:[],name:"name",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"",type:"address"}],name:"nonces",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"owner",type:"address"},{internalType:"address",name:"spender",type:"address"},{internalType:"uint256",name:"value",type:"uint256"},{internalType:"uint256",name:"deadline",type:"uint256"},{internalType:"uint8",name:"v",type:"uint8"},{internalType:"bytes32",name:"r",type:"bytes32"},{internalType:"bytes32",name:"s",type:"bytes32"}],name:"permit",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"symbol",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[],name:"totalSupply",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"transfer",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"transferFrom",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"}];var Xz={};Object.defineProperty(Xz,"__esModule",{value:!0}),Xz.ERC721ABI=void 0;Xz.ERC721ABI=[{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"owner",type:"address"},{indexed:!0,internalType:"address",name:"spender",type:"address"},{indexed:!0,internalType:"uint256",name:"id",type:"uint256"}],name:"Approval",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"owner",type:"address"},{indexed:!0,internalType:"address",name:"operator",type:"address"},{indexed:!1,internalType:"bool",name:"approved",type:"bool"}],name:"ApprovalForAll",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"from",type:"address"},{indexed:!0,internalType:"address",name:"to",type:"address"},{indexed:!0,internalType:"uint256",name:"id",type:"uint256"}],name:"Transfer",type:"event"},{inputs:[{internalType:"address",name:"spender",type:"address"},{internalType:"uint256",name:"id",type:"uint256"}],name:"approve",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"",type:"address"}],name:"balanceOf",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"",type:"uint256"}],name:"getApproved",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"",type:"address"},{internalType:"address",name:"",type:"address"}],name:"isApprovedForAll",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[],name:"name",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"",type:"uint256"}],name:"ownerOf",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"id",type:"uint256"}],name:"safeTransferFrom",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"id",type:"uint256"},{internalType:"bytes",name:"data",type:"bytes"}],name:"safeTransferFrom",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"operator",type:"address"},{internalType:"bool",name:"approved",type:"bool"}],name:"setApprovalForAll",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes4",name:"interfaceId",type:"bytes4"}],name:"supportsInterface",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"pure",type:"function"},{inputs:[],name:"symbol",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"id",type:"uint256"}],name:"tokenURI",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"id",type:"uint256"}],name:"transferFrom",outputs:[],stateMutability:"nonpayable",type:"function"}];var $z,Jz={},Yz={};function Qz(){if($z)return Yz;$z=1,Object.defineProperty(Yz,"__esModule",{value:!0}),Yz.getItemToCriteriaMap=Yz.generateCriteriaResolvers=void 0;const e=Vz,t=tH();Yz.generateCriteriaResolvers=({orders:n,offerCriterias:r=[[]],considerationCriterias:i=[[]]})=>{const a=n.flatMap(((n,r)=>n.parameters.offer.map(((t,n)=>({orderIndex:r,item:t,index:n,side:e.Side.OFFER}))).filter((({item:e})=>(0,t.isCriteriaItem)(e.itemType))))),o=n.flatMap(((n,r)=>n.parameters.consideration.map(((t,n)=>({orderIndex:r,item:t,index:n,side:e.Side.CONSIDERATION}))).filter((({item:e})=>(0,t.isCriteriaItem)(e.itemType))))),s=(e,t)=>e.map((({orderIndex:e,item:n,index:r,side:i})=>{const a=n.identifierOrCriteria||"0",o=t[e][r];return{orderIndex:e,index:r,side:i,identifier:o.identifier,criteriaProof:"0"===a?[]:o.proof}}));return[...s(a,r),...s(o,i)]};return Yz.getItemToCriteriaMap=(e,n)=>{const r=[...n];return e.reduce(((e,n)=>((0,t.isCriteriaItem)(n.itemType)&&e.set(n,r.shift()),e)),new Map)},Yz}var Zz,eH={};function tH(){return Zz||(Zz=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.getMaximumSizeForOrder=e.getSummedTokenAndIdentifierAmounts=e.getPresentItemAmount=e.isCriteriaItem=e.isErc1155Item=e.isErc721Item=e.isErc20Item=e.isNativeCurrencyItem=e.isCurrencyItem=void 0;const t=wz,n=Vz,r=Qz(),i=eH;e.isCurrencyItem=({itemType:e})=>[n.ItemType.NATIVE,n.ItemType.ERC20].includes(e);e.isNativeCurrencyItem=({itemType:e})=>e===n.ItemType.NATIVE;e.isErc20Item=e=>e===n.ItemType.ERC20;e.isErc721Item=e=>[n.ItemType.ERC721,n.ItemType.ERC721_WITH_CRITERIA].includes(e);e.isErc1155Item=e=>[n.ItemType.ERC1155,n.ItemType.ERC1155_WITH_CRITERIA].includes(e);e.isCriteriaItem=e=>[n.ItemType.ERC721_WITH_CRITERIA,n.ItemType.ERC1155_WITH_CRITERIA].includes(e);e.getPresentItemAmount=({startAmount:e,endAmount:n,timeBasedItemParams:r})=>{const i=t.BigNumber.from(e),a=t.BigNumber.from(n);if(!r)return i.gt(a)?i:a;const{isConsiderationItem:o,currentBlockTimestamp:s,ascendingAmountTimestampBuffer:c,startTime:u,endTime:f}=r,d=t.BigNumber.from(f).sub(u),l=a.gt(e),p=t.BigNumber.from(l?s+c:s);if(p.lt(u))return i;const h=(p.gt(f)?t.BigNumber.from(f):p).sub(u),b=d.sub(h);return i.mul(b).add(a.mul(h)).add(o?d.sub(1):0).div(d)};e.getSummedTokenAndIdentifierAmounts=({items:n,criterias:i,timeBasedItemParams:a})=>{const o=(0,r.getItemToCriteriaMap)(n,i),s=n.reduce(((n,r)=>{var i,s,c,u;const f=null!==(s=null===(i=o.get(r))||void 0===i?void 0:i.identifier)&&void 0!==s?s:r.identifierOrCriteria;return Object.assign(Object.assign({},n),{[r.token]:Object.assign(Object.assign({},n[r.token]),{[f]:(null!==(u=null===(c=n[r.token])||void 0===c?void 0:c[f])&&void 0!==u?u:t.BigNumber.from(0)).add((0,e.getPresentItemAmount)({startAmount:r.startAmount,endAmount:r.endAmount,timeBasedItemParams:a}))})})}),{});return s};e.getMaximumSizeForOrder=({parameters:{offer:e,consideration:t}})=>{const n=[...e,...t].flatMap((({startAmount:e,endAmount:t})=>[e,t]));return(0,i.findGcd)(n)}}(Jz)),Jz}!function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.findGcd=e.gcd=void 0;const t=wz;e.gcd=(n,r)=>{const i=t.BigNumber.from(n),a=t.BigNumber.from(r);return i.eq(0)?a:(0,e.gcd)(a.mod(n),i)};e.findGcd=n=>{let r=t.BigNumber.from(n[0]);for(let t=1;t<n.length;t++)if(r=(0,e.gcd)(n[t],r),r.eq(1))return r;return r}}(eH);var nH={};!function(e){var t=Jt&&Jt.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(o,s)}c((r=r.apply(e,t||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0}),e.getTagFromDomain=e.getTransactionMethods=e.executeAllActions=void 0;const n=_z;e.executeAllActions=e=>t(void 0,void 0,void 0,(function*(){for(let t=0;t<e.length-1;t++){const n=e[t];if("approval"===n.type){const e=yield n.transactionMethods.transact();yield e.wait()}}const t=e[e.length-1];switch(t.type){case"create":return t.createOrder();case"createBulk":return t.createBulkOrders();default:return t.transactionMethods.transact()}}));e.getTransactionMethods=(n,r,i,a)=>{const o=i[i.length-1];let s;(e=>{const t=["gasLimit","gasPrice","maxFeePerGas","maxPriorityFeePerGas","nonce","type","accessList","customData","ccipReadEnabled","value","blockTag","CallOverrides"];return void 0===e||Object.keys(e).every((e=>t.includes(e)))})(o)&&(s=o,i.pop());const c=o=>t(void 0,void 0,void 0,(function*(){const t=Object.assign(Object.assign({},s),o),c=yield n.populateTransaction[r](...i,t);if(a){const t=(0,e.getTagFromDomain)(a);c.data=c.data+t}return c}));return{callStatic:e=>{const t=Object.assign(Object.assign({},s),e);return n.callStatic[r](...i,t)},estimateGas:e=>{const t=Object.assign(Object.assign({},s),e);return n.estimateGas[r](...i,t)},transact:e=>t(void 0,void 0,void 0,(function*(){const t=Object.assign(Object.assign({},s),e),r=yield c(t);return n.signer.sendTransaction(r)})),buildTransaction:c}};e.getTagFromDomain=e=>(0,n.keccak256)((0,n.toUtf8Bytes)(e)).slice(2,10)}(nH);var rH=Jt&&Jt.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(o,s)}c((r=r.apply(e,t||[])).next())}))};Object.defineProperty(Kz,"__esModule",{value:!0}),Kz.getApprovalActions=Kz.approvedItemAmount=void 0;const iH=wz,aH=Wz,oH=Xz,sH=Vz,cH=tH(),uH=nH;Kz.approvedItemAmount=(e,t,n,r)=>rH(void 0,void 0,void 0,(function*(){if((0,cH.isErc721Item)(t.itemType)||(0,cH.isErc1155Item)(t.itemType)){return new iH.Contract(t.token,oH.ERC721ABI,r).isApprovedForAll(e,n).then((e=>e?sH.MAX_INT:iH.BigNumber.from(0)))}if(t.itemType===sH.ItemType.ERC20){return new iH.Contract(t.token,aH.ERC20ABI,r).allowance(e,n)}return sH.MAX_INT})),Kz.getApprovalActions=function(e,t,n){return e.filter(((t,n)=>n===e.length-1||e[n+1].token!==t.token)).map((({token:e,operator:r,itemType:i,identifierOrCriteria:a,requiredApprovedAmount:o})=>{const s=(0,cH.isErc1155Item)(i);if((0,cH.isErc721Item)(i)||s){const o=new iH.Contract(e,oH.ERC721ABI,n);return{type:"approval",token:e,identifierOrCriteria:a,itemType:i,operator:r,transactionMethods:(0,uH.getTransactionMethods)(o.connect(n),t&&!s?"approve":"setApprovalForAll",[r,!(t&&!s)||a])}}{const s=new iH.Contract(e,aH.ERC20ABI,n);return{type:"approval",token:e,identifierOrCriteria:a,itemType:i,transactionMethods:(0,uH.getTransactionMethods)(s.connect(n),"approve",[r,t?o:sH.MAX_INT]),operator:r}}}))};var fH={},dH={},lH={};Object.defineProperty(lH,"__esModule",{value:!0}),lH.ERC1155ABI=void 0;lH.ERC1155ABI=[{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"owner",type:"address"},{indexed:!0,internalType:"address",name:"operator",type:"address"},{indexed:!1,internalType:"bool",name:"approved",type:"bool"}],name:"ApprovalForAll",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"operator",type:"address"},{indexed:!0,internalType:"address",name:"from",type:"address"},{indexed:!0,internalType:"address",name:"to",type:"address"},{indexed:!1,internalType:"uint256[]",name:"ids",type:"uint256[]"},{indexed:!1,internalType:"uint256[]",name:"amounts",type:"uint256[]"}],name:"TransferBatch",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"operator",type:"address"},{indexed:!0,internalType:"address",name:"from",type:"address"},{indexed:!0,internalType:"address",name:"to",type:"address"},{indexed:!1,internalType:"uint256",name:"id",type:"uint256"},{indexed:!1,internalType:"uint256",name:"amount",type:"uint256"}],name:"TransferSingle",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"string",name:"value",type:"string"},{indexed:!0,internalType:"uint256",name:"id",type:"uint256"}],name:"URI",type:"event"},{inputs:[{internalType:"address",name:"",type:"address"},{internalType:"uint256",name:"",type:"uint256"}],name:"balanceOf",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address[]",name:"owners",type:"address[]"},{internalType:"uint256[]",name:"ids",type:"uint256[]"}],name:"balanceOfBatch",outputs:[{internalType:"uint256[]",name:"balances",type:"uint256[]"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"",type:"address"},{internalType:"address",name:"",type:"address"}],name:"isApprovedForAll",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256[]",name:"ids",type:"uint256[]"},{internalType:"uint256[]",name:"amounts",type:"uint256[]"},{internalType:"bytes",name:"data",type:"bytes"}],name:"safeBatchTransferFrom",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"id",type:"uint256"},{internalType:"uint256",name:"amount",type:"uint256"},{internalType:"bytes",name:"data",type:"bytes"}],name:"safeTransferFrom",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"operator",type:"address"},{internalType:"bool",name:"approved",type:"bool"}],name:"setApprovalForAll",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes4",name:"interfaceId",type:"bytes4"}],name:"supportsInterface",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"pure",type:"function"},{inputs:[{internalType:"uint256",name:"id",type:"uint256"}],name:"uri",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"}];var pH=Jt&&Jt.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(o,s)}c((r=r.apply(e,t||[])).next())}))};Object.defineProperty(dH,"__esModule",{value:!0}),dH.balanceOf=void 0;const hH=wz,bH=lH,mH=Wz,yH=Xz,gH=Vz,vH=tH();dH.balanceOf=(e,t,n,r)=>pH(void 0,void 0,void 0,(function*(){if((0,vH.isErc721Item)(t.itemType)){const i=new hH.Contract(t.token,yH.ERC721ABI,n);return t.itemType===gH.ItemType.ERC721_WITH_CRITERIA?r?i.ownerOf(r.identifier).then((t=>hH.BigNumber.from(Number(t.toLowerCase()===e.toLowerCase())))):i.balanceOf(e):i.ownerOf(t.identifierOrCriteria).then((t=>hH.BigNumber.from(Number(t.toLowerCase()===e.toLowerCase()))))}if((0,vH.isErc1155Item)(t.itemType)){const i=new hH.Contract(t.token,bH.ERC1155ABI,n);if(t.itemType===gH.ItemType.ERC1155_WITH_CRITERIA){if(!r){const e=hH.BigNumber.from(t.startAmount),n=hH.BigNumber.from(t.endAmount);return e.gt(n)?e:n}return i.balanceOf(e,r.identifier)}return i.balanceOf(e,t.identifierOrCriteria)}if((0,vH.isErc20Item)(t.itemType)){return new hH.Contract(t.token,mH.ERC20ABI,n).balanceOf(e)}return n.getBalance(e)})),function(e){var t=Jt&&Jt.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(o,s)}c((r=r.apply(e,t||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0}),e.validateStandardFulfillBalancesAndApprovals=e.validateBasicFulfillBalancesAndApprovals=e.validateOfferBalancesAndApprovals=e.getInsufficientBalanceAndApprovalAmounts=e.getBalancesAndApprovals=void 0;const n=wz,r=Vz,i=Kz,a=dH,o=Qz(),s=tH(),c=(e,t,n)=>{const r=e.find((({token:e,identifierOrCriteria:r})=>t.toLowerCase()===e.toLowerCase()&&r.toLowerCase()===n.toLowerCase()));if(!r)throw new Error("Balances and approvals didn't contain all tokens and identifiers");return r};e.getBalancesAndApprovals=({owner:e,items:c,criterias:u,operator:f,multicallProvider:d})=>t(void 0,void 0,void 0,(function*(){const l=(0,o.getItemToCriteriaMap)(c,u);return Promise.all(c.map((o=>t(void 0,void 0,void 0,(function*(){var t,c;let u=Promise.resolve(n.BigNumber.from(0));return u=(0,s.isErc721Item)(o.itemType)||(0,s.isErc1155Item)(o.itemType)||(0,s.isErc20Item)(o.itemType)?(0,i.approvedItemAmount)(e,o,f,d):Promise.resolve(r.MAX_INT),{token:o.token,identifierOrCriteria:null!==(c=null===(t=l.get(o))||void 0===t?void 0:t.identifier)&&void 0!==c?c:o.identifierOrCriteria,balance:yield(0,a.balanceOf)(e,o,d,l.get(o)),approvedAmount:yield u,itemType:o.itemType}})))))}));e.getInsufficientBalanceAndApprovalAmounts=({balancesAndApprovals:e,tokenAndIdentifierAmounts:t,operator:n})=>{const r=[...Object.entries(t).map((([e,t])=>Object.entries(t).map((([t,n])=>[e,t,n]))))].flat(),i=t=>r.filter((([n,r,i])=>c(e,n,r)[t].lt(i))).map((([n,r,i])=>{const a=c(e,n,r);return{token:n,identifierOrCriteria:r,requiredAmount:i,amountHave:a[t],itemType:a.itemType}})),[a,o]=[i("balance"),i("approvedAmount").map((e=>({token:e.token,identifierOrCriteria:e.identifierOrCriteria,approvedAmount:e.amountHave,requiredApprovedAmount:e.requiredAmount,itemType:e.itemType,operator:n})))];return{insufficientBalances:a,insufficientApprovals:o}};e.validateOfferBalancesAndApprovals=({offer:t,criterias:n,balancesAndApprovals:r,timeBasedItemParams:i,throwOnInsufficientBalances:a=!0,throwOnInsufficientApprovals:o,operator:c})=>{const{insufficientBalances:u,insufficientApprovals:f}=(0,e.getInsufficientBalanceAndApprovalAmounts)({balancesAndApprovals:r,tokenAndIdentifierAmounts:(0,s.getSummedTokenAndIdentifierAmounts)({items:t,criterias:n,timeBasedItemParams:i?Object.assign(Object.assign({},i),{isConsiderationItem:!1}):void 0}),operator:c});if(a&&u.length>0)throw new Error("The offerer does not have the amount needed to create or fulfill.");if(o&&f.length>0)throw new Error("The offerer does not have the sufficient approvals.");return f};e.validateBasicFulfillBalancesAndApprovals=({offer:t,consideration:n,offererBalancesAndApprovals:r,fulfillerBalancesAndApprovals:i,timeBasedItemParams:a,offererOperator:o,fulfillerOperator:c})=>{(0,e.validateOfferBalancesAndApprovals)({offer:t,criterias:[],balancesAndApprovals:r,timeBasedItemParams:a,throwOnInsufficientApprovals:!0,operator:o});const u=n.filter((e=>e.itemType!==t[0].itemType)),{insufficientBalances:f,insufficientApprovals:d}=(0,e.getInsufficientBalanceAndApprovalAmounts)({balancesAndApprovals:i,tokenAndIdentifierAmounts:(0,s.getSummedTokenAndIdentifierAmounts)({items:u,criterias:[],timeBasedItemParams:Object.assign(Object.assign({},a),{isConsiderationItem:!0})}),operator:c});if(f.length>0)throw new Error("The fulfiller does not have the balances needed to fulfill.");return d};e.validateStandardFulfillBalancesAndApprovals=({offer:t,consideration:n,offerCriteria:r,considerationCriteria:i,offererBalancesAndApprovals:a,fulfillerBalancesAndApprovals:o,timeBasedItemParams:c,offererOperator:f,fulfillerOperator:d})=>{(0,e.validateOfferBalancesAndApprovals)({offer:t,criterias:r,balancesAndApprovals:a,timeBasedItemParams:c,throwOnInsufficientApprovals:!0,operator:f});const l=u({items:t,criterias:r,balancesAndApprovals:o,timeBasedItemParams:c}),{insufficientBalances:p,insufficientApprovals:h}=(0,e.getInsufficientBalanceAndApprovalAmounts)({balancesAndApprovals:l,tokenAndIdentifierAmounts:(0,s.getSummedTokenAndIdentifierAmounts)({items:n,criterias:i,timeBasedItemParams:Object.assign(Object.assign({},c),{isConsiderationItem:!0})}),operator:d});if(p.length>0)throw new Error("The fulfiller does not have the balances needed to fulfill.");return h};const u=({items:e,criterias:t,timeBasedItemParams:n,balancesAndApprovals:r})=>{const i=(0,s.getSummedTokenAndIdentifierAmounts)({items:e,criterias:t,timeBasedItemParams:Object.assign(Object.assign({},n),{isConsiderationItem:!1})}),a=r.map((e=>Object.assign({},e)));return Object.entries(i).forEach((([e,t])=>Object.entries(t).forEach((([t,n])=>{const r=c(a,e,t),i=a.indexOf(r);a[i].balance=a[i].balance.add(n)})))),a}}(fH);var wH,_H={},EH={},TH={},AH={},RH={exports:{}},SH={exports:{}};function kH(){return wH||(wH=1,function(e,t){e.exports=function(){var e=e||function(e,t){var n=Object.create||function(){function e(){}return function(t){var n;return e.prototype=t,n=new e,e.prototype=null,n}}(),r={},i=r.lib={},a=i.Base={extend:function(e){var t=n(this);return e&&t.mixIn(e),t.hasOwnProperty("init")&&this.init!==t.init||(t.init=function(){t.$super.init.apply(this,arguments)}),t.init.prototype=t,t.$super=this,t},create:function(){var e=this.extend();return e.init.apply(e,arguments),e},init:function(){},mixIn:function(e){for(var t in e)e.hasOwnProperty(t)&&(this[t]=e[t]);e.hasOwnProperty("toString")&&(this.toString=e.toString)},clone:function(){return this.init.prototype.extend(this)}},o=i.WordArray=a.extend({init:function(e,n){e=this.words=e||[],this.sigBytes=n!=t?n:4*e.length},toString:function(e){return(e||c).stringify(this)},concat:function(e){var t=this.words,n=e.words,r=this.sigBytes,i=e.sigBytes;if(this.clamp(),r%4)for(var a=0;a<i;a++){var o=n[a>>>2]>>>24-a%4*8&255;t[r+a>>>2]|=o<<24-(r+a)%4*8}else for(a=0;a<i;a+=4)t[r+a>>>2]=n[a>>>2];return this.sigBytes+=i,this},clamp:function(){var t=this.words,n=this.sigBytes;t[n>>>2]&=4294967295<<32-n%4*8,t.length=e.ceil(n/4)},clone:function(){var e=a.clone.call(this);return e.words=this.words.slice(0),e},random:function(t){for(var n,r=[],i=function(t){var n=987654321,r=4294967295;return function(){var i=((n=36969*(65535&n)+(n>>16)&r)<<16)+(t=18e3*(65535&t)+(t>>16)&r)&r;return i/=4294967296,(i+=.5)*(e.random()>.5?1:-1)}},a=0;a<t;a+=4){var s=i(4294967296*(n||e.random()));n=987654071*s(),r.push(4294967296*s()|0)}return new o.init(r,t)}}),s=r.enc={},c=s.Hex={stringify:function(e){for(var t=e.words,n=e.sigBytes,r=[],i=0;i<n;i++){var a=t[i>>>2]>>>24-i%4*8&255;r.push((a>>>4).toString(16)),r.push((15&a).toString(16))}return r.join("")},parse:function(e){for(var t=e.length,n=[],r=0;r<t;r+=2)n[r>>>3]|=parseInt(e.substr(r,2),16)<<24-r%8*4;return new o.init(n,t/2)}},u=s.Latin1={stringify:function(e){for(var t=e.words,n=e.sigBytes,r=[],i=0;i<n;i++){var a=t[i>>>2]>>>24-i%4*8&255;r.push(String.fromCharCode(a))}return r.join("")},parse:function(e){for(var t=e.length,n=[],r=0;r<t;r++)n[r>>>2]|=(255&e.charCodeAt(r))<<24-r%4*8;return new o.init(n,t)}},f=s.Utf8={stringify:function(e){try{return decodeURIComponent(escape(u.stringify(e)))}catch(e){throw new Error("Malformed UTF-8 data")}},parse:function(e){return u.parse(unescape(encodeURIComponent(e)))}},d=i.BufferedBlockAlgorithm=a.extend({reset:function(){this._data=new o.init,this._nDataBytes=0},_append:function(e){"string"==typeof e&&(e=f.parse(e)),this._data.concat(e),this._nDataBytes+=e.sigBytes},_process:function(t){var n=this._data,r=n.words,i=n.sigBytes,a=this.blockSize,s=i/(4*a),c=(s=t?e.ceil(s):e.max((0|s)-this._minBufferSize,0))*a,u=e.min(4*c,i);if(c){for(var f=0;f<c;f+=a)this._doProcessBlock(r,f);var d=r.splice(0,c);n.sigBytes-=u}return new o.init(d,u)},clone:function(){var e=a.clone.call(this);return e._data=this._data.clone(),e},_minBufferSize:0});i.Hasher=d.extend({cfg:a.extend(),init:function(e){this.cfg=this.cfg.extend(e),this.reset()},reset:function(){d.reset.call(this),this._doReset()},update:function(e){return this._append(e),this._process(),this},finalize:function(e){return e&&this._append(e),this._doFinalize()},blockSize:16,_createHelper:function(e){return function(t,n){return new e.init(n).finalize(t)}},_createHmacHelper:function(e){return function(t,n){return new l.HMAC.init(e,n).finalize(t)}}});var l=r.algo={};return r}(Math);return e}()}(SH)),SH.exports}!function(e,t){e.exports=function(e){return function(t){var n=e,r=n.lib,i=r.WordArray,a=r.Hasher,o=n.algo,s=[],c=[];!function(){function e(e){for(var n=t.sqrt(e),r=2;r<=n;r++)if(!(e%r))return!1;return!0}function n(e){return 4294967296*(e-(0|e))|0}for(var r=2,i=0;i<64;)e(r)&&(i<8&&(s[i]=n(t.pow(r,.5))),c[i]=n(t.pow(r,1/3)),i++),r++}();var u=[],f=o.SHA256=a.extend({_doReset:function(){this._hash=new i.init(s.slice(0))},_doProcessBlock:function(e,t){for(var n=this._hash.words,r=n[0],i=n[1],a=n[2],o=n[3],s=n[4],f=n[5],d=n[6],l=n[7],p=0;p<64;p++){if(p<16)u[p]=0|e[t+p];else{var h=u[p-15],b=(h<<25|h>>>7)^(h<<14|h>>>18)^h>>>3,m=u[p-2],y=(m<<15|m>>>17)^(m<<13|m>>>19)^m>>>10;u[p]=b+u[p-7]+y+u[p-16]}var g=r&i^r&a^i&a,v=(r<<30|r>>>2)^(r<<19|r>>>13)^(r<<10|r>>>22),w=l+((s<<26|s>>>6)^(s<<21|s>>>11)^(s<<7|s>>>25))+(s&f^~s&d)+c[p]+u[p];l=d,d=f,f=s,s=o+w|0,o=a,a=i,i=r,r=w+(v+g)|0}n[0]=n[0]+r|0,n[1]=n[1]+i|0,n[2]=n[2]+a|0,n[3]=n[3]+o|0,n[4]=n[4]+s|0,n[5]=n[5]+f|0,n[6]=n[6]+d|0,n[7]=n[7]+l|0},_doFinalize:function(){var e=this._data,n=e.words,r=8*this._nDataBytes,i=8*e.sigBytes;return n[i>>>5]|=128<<24-i%32,n[14+(i+64>>>9<<4)]=t.floor(r/4294967296),n[15+(i+64>>>9<<4)]=r,e.sigBytes=4*n.length,this._process(),this._hash},clone:function(){var e=a.clone.call(this);return e._hash=this._hash.clone(),e}});n.SHA256=a._createHelper(f),n.HmacSHA256=a._createHmacHelper(f)}(Math),e.SHA256}(kH())}(RH);var IH=RH.exports,OH={exports:{}};!function(e,t){e.exports=function(){function e(e,t){var n=t?"└":"├";return n+=e?"─ ":"──┐"}function t(e,t){var n=[];for(var r in e)e.hasOwnProperty(r)&&(t&&"function"==typeof e[r]||n.push(r));return n}function n(r,i,a,o,s,c,u){var f,d,l="",p=0,h=o.slice(0);if(h.push([i,a])&&o.length>0&&(o.forEach((function(e,t){t>0&&(l+=(e[1]?" ":"│")+" "),d||e[0]!==i||(d=!0)})),l+=e(r,a)+r,s&&("object"!=typeof i||i instanceof Date)&&(l+=": "+i),d&&(l+=" (circular ref.)"),u(l)),!d&&"object"==typeof i){var b=t(i,c);b.forEach((function(e){f=++p===b.length,n(e,i[e],f,h,s,c,u)}))}}var r={asLines:function(e,t,r,i){n(".",e,!1,[],t,"function"!=typeof r&&r,i||r)},asTree:function(e,t,r){var i="";return n(".",e,!1,[],t,r,(function(e){i+=e+"\n"})),i}};return r}()}(OH);var xH,CH=OH.exports,MH={},PH={exports:{}},NH={exports:{}};function BH(){return xH||(xH=1,function(e,t){e.exports=function(e){return function(t){var n=e,r=n.lib,i=r.Base,a=r.WordArray,o=n.x64={};o.Word=i.extend({init:function(e,t){this.high=e,this.low=t}}),o.WordArray=i.extend({init:function(e,n){e=this.words=e||[],this.sigBytes=n!=t?n:8*e.length},toX32:function(){for(var e=this.words,t=e.length,n=[],r=0;r<t;r++){var i=e[r];n.push(i.high),n.push(i.low)}return a.create(n,this.sigBytes)},clone:function(){for(var e=i.clone.call(this),t=e.words=this.words.slice(0),n=t.length,r=0;r<n;r++)t[r]=t[r].clone();return e}})}(),e}(kH())}(NH)),NH.exports}var DH,FH={exports:{}};function LH(){return DH||(DH=1,function(e,t){e.exports=function(e){return function(){if("function"==typeof ArrayBuffer){var t=e.lib.WordArray,n=t.init,r=t.init=function(e){if(e instanceof ArrayBuffer&&(e=new Uint8Array(e)),(e instanceof Int8Array||"undefined"!=typeof Uint8ClampedArray&&e instanceof Uint8ClampedArray||e instanceof Int16Array||e instanceof Uint16Array||e instanceof Int32Array||e instanceof Uint32Array||e instanceof Float32Array||e instanceof Float64Array)&&(e=new Uint8Array(e.buffer,e.byteOffset,e.byteLength)),e instanceof Uint8Array){for(var t=e.byteLength,r=[],i=0;i<t;i++)r[i>>>2]|=e[i]<<24-i%4*8;n.call(this,r,t)}else n.apply(this,arguments)};r.prototype=t}}(),e.lib.WordArray}(kH())}(FH)),FH.exports}var UH,jH={exports:{}};function qH(){return UH||(UH=1,function(e,t){e.exports=function(e){return function(){var t=e,n=t.lib.WordArray,r=t.enc;function i(e){return e<<8&4278255360|e>>>8&16711935}r.Utf16=r.Utf16BE={stringify:function(e){for(var t=e.words,n=e.sigBytes,r=[],i=0;i<n;i+=2){var a=t[i>>>2]>>>16-i%4*8&65535;r.push(String.fromCharCode(a))}return r.join("")},parse:function(e){for(var t=e.length,r=[],i=0;i<t;i++)r[i>>>1]|=e.charCodeAt(i)<<16-i%2*16;return n.create(r,2*t)}},r.Utf16LE={stringify:function(e){for(var t=e.words,n=e.sigBytes,r=[],a=0;a<n;a+=2){var o=i(t[a>>>2]>>>16-a%4*8&65535);r.push(String.fromCharCode(o))}return r.join("")},parse:function(e){for(var t=e.length,r=[],a=0;a<t;a++)r[a>>>1]|=i(e.charCodeAt(a)<<16-a%2*16);return n.create(r,2*t)}}}(),e.enc.Utf16}(kH())}(jH)),jH.exports}var zH,HH={exports:{}};function GH(){return zH||(zH=1,function(e,t){e.exports=function(e){return function(){var t=e,n=t.lib.WordArray;function r(e,t,r){for(var i=[],a=0,o=0;o<t;o++)if(o%4){var s=r[e.charCodeAt(o-1)]<<o%4*2,c=r[e.charCodeAt(o)]>>>6-o%4*2;i[a>>>2]|=(s|c)<<24-a%4*8,a++}return n.create(i,a)}t.enc.Base64={stringify:function(e){var t=e.words,n=e.sigBytes,r=this._map;e.clamp();for(var i=[],a=0;a<n;a+=3)for(var o=(t[a>>>2]>>>24-a%4*8&255)<<16|(t[a+1>>>2]>>>24-(a+1)%4*8&255)<<8|t[a+2>>>2]>>>24-(a+2)%4*8&255,s=0;s<4&&a+.75*s<n;s++)i.push(r.charAt(o>>>6*(3-s)&63));var c=r.charAt(64);if(c)for(;i.length%4;)i.push(c);return i.join("")},parse:function(e){var t=e.length,n=this._map,i=this._reverseMap;if(!i){i=this._reverseMap=[];for(var a=0;a<n.length;a++)i[n.charCodeAt(a)]=a}var o=n.charAt(64);if(o){var s=e.indexOf(o);-1!==s&&(t=s)}return r(e,t,i)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="}}(),e.enc.Base64}(kH())}(HH)),HH.exports}var VH,KH={exports:{}};function WH(){return VH||(VH=1,function(e,t){e.exports=function(e){return function(t){var n=e,r=n.lib,i=r.WordArray,a=r.Hasher,o=n.algo,s=[];!function(){for(var e=0;e<64;e++)s[e]=4294967296*t.abs(t.sin(e+1))|0}();var c=o.MD5=a.extend({_doReset:function(){this._hash=new i.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(e,t){for(var n=0;n<16;n++){var r=t+n,i=e[r];e[r]=16711935&(i<<8|i>>>24)|4278255360&(i<<24|i>>>8)}var a=this._hash.words,o=e[t+0],c=e[t+1],p=e[t+2],h=e[t+3],b=e[t+4],m=e[t+5],y=e[t+6],g=e[t+7],v=e[t+8],w=e[t+9],_=e[t+10],E=e[t+11],T=e[t+12],A=e[t+13],R=e[t+14],S=e[t+15],k=a[0],I=a[1],O=a[2],x=a[3];k=u(k,I,O,x,o,7,s[0]),x=u(x,k,I,O,c,12,s[1]),O=u(O,x,k,I,p,17,s[2]),I=u(I,O,x,k,h,22,s[3]),k=u(k,I,O,x,b,7,s[4]),x=u(x,k,I,O,m,12,s[5]),O=u(O,x,k,I,y,17,s[6]),I=u(I,O,x,k,g,22,s[7]),k=u(k,I,O,x,v,7,s[8]),x=u(x,k,I,O,w,12,s[9]),O=u(O,x,k,I,_,17,s[10]),I=u(I,O,x,k,E,22,s[11]),k=u(k,I,O,x,T,7,s[12]),x=u(x,k,I,O,A,12,s[13]),O=u(O,x,k,I,R,17,s[14]),k=f(k,I=u(I,O,x,k,S,22,s[15]),O,x,c,5,s[16]),x=f(x,k,I,O,y,9,s[17]),O=f(O,x,k,I,E,14,s[18]),I=f(I,O,x,k,o,20,s[19]),k=f(k,I,O,x,m,5,s[20]),x=f(x,k,I,O,_,9,s[21]),O=f(O,x,k,I,S,14,s[22]),I=f(I,O,x,k,b,20,s[23]),k=f(k,I,O,x,w,5,s[24]),x=f(x,k,I,O,R,9,s[25]),O=f(O,x,k,I,h,14,s[26]),I=f(I,O,x,k,v,20,s[27]),k=f(k,I,O,x,A,5,s[28]),x=f(x,k,I,O,p,9,s[29]),O=f(O,x,k,I,g,14,s[30]),k=d(k,I=f(I,O,x,k,T,20,s[31]),O,x,m,4,s[32]),x=d(x,k,I,O,v,11,s[33]),O=d(O,x,k,I,E,16,s[34]),I=d(I,O,x,k,R,23,s[35]),k=d(k,I,O,x,c,4,s[36]),x=d(x,k,I,O,b,11,s[37]),O=d(O,x,k,I,g,16,s[38]),I=d(I,O,x,k,_,23,s[39]),k=d(k,I,O,x,A,4,s[40]),x=d(x,k,I,O,o,11,s[41]),O=d(O,x,k,I,h,16,s[42]),I=d(I,O,x,k,y,23,s[43]),k=d(k,I,O,x,w,4,s[44]),x=d(x,k,I,O,T,11,s[45]),O=d(O,x,k,I,S,16,s[46]),k=l(k,I=d(I,O,x,k,p,23,s[47]),O,x,o,6,s[48]),x=l(x,k,I,O,g,10,s[49]),O=l(O,x,k,I,R,15,s[50]),I=l(I,O,x,k,m,21,s[51]),k=l(k,I,O,x,T,6,s[52]),x=l(x,k,I,O,h,10,s[53]),O=l(O,x,k,I,_,15,s[54]),I=l(I,O,x,k,c,21,s[55]),k=l(k,I,O,x,v,6,s[56]),x=l(x,k,I,O,S,10,s[57]),O=l(O,x,k,I,y,15,s[58]),I=l(I,O,x,k,A,21,s[59]),k=l(k,I,O,x,b,6,s[60]),x=l(x,k,I,O,E,10,s[61]),O=l(O,x,k,I,p,15,s[62]),I=l(I,O,x,k,w,21,s[63]),a[0]=a[0]+k|0,a[1]=a[1]+I|0,a[2]=a[2]+O|0,a[3]=a[3]+x|0},_doFinalize:function(){var e=this._data,n=e.words,r=8*this._nDataBytes,i=8*e.sigBytes;n[i>>>5]|=128<<24-i%32;var a=t.floor(r/4294967296),o=r;n[15+(i+64>>>9<<4)]=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8),n[14+(i+64>>>9<<4)]=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8),e.sigBytes=4*(n.length+1),this._process();for(var s=this._hash,c=s.words,u=0;u<4;u++){var f=c[u];c[u]=16711935&(f<<8|f>>>24)|4278255360&(f<<24|f>>>8)}return s},clone:function(){var e=a.clone.call(this);return e._hash=this._hash.clone(),e}});function u(e,t,n,r,i,a,o){var s=e+(t&n|~t&r)+i+o;return(s<<a|s>>>32-a)+t}function f(e,t,n,r,i,a,o){var s=e+(t&r|n&~r)+i+o;return(s<<a|s>>>32-a)+t}function d(e,t,n,r,i,a,o){var s=e+(t^n^r)+i+o;return(s<<a|s>>>32-a)+t}function l(e,t,n,r,i,a,o){var s=e+(n^(t|~r))+i+o;return(s<<a|s>>>32-a)+t}n.MD5=a._createHelper(c),n.HmacMD5=a._createHmacHelper(c)}(Math),e.MD5}(kH())}(KH)),KH.exports}var XH,$H={exports:{}};function JH(){return XH||(XH=1,function(e,t){e.exports=function(e){return function(){var t=e,n=t.lib,r=n.WordArray,i=n.Hasher,a=t.algo,o=[],s=a.SHA1=i.extend({_doReset:function(){this._hash=new r.init([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(e,t){for(var n=this._hash.words,r=n[0],i=n[1],a=n[2],s=n[3],c=n[4],u=0;u<80;u++){if(u<16)o[u]=0|e[t+u];else{var f=o[u-3]^o[u-8]^o[u-14]^o[u-16];o[u]=f<<1|f>>>31}var d=(r<<5|r>>>27)+c+o[u];d+=u<20?1518500249+(i&a|~i&s):u<40?1859775393+(i^a^s):u<60?(i&a|i&s|a&s)-1894007588:(i^a^s)-899497514,c=s,s=a,a=i<<30|i>>>2,i=r,r=d}n[0]=n[0]+r|0,n[1]=n[1]+i|0,n[2]=n[2]+a|0,n[3]=n[3]+s|0,n[4]=n[4]+c|0},_doFinalize:function(){var e=this._data,t=e.words,n=8*this._nDataBytes,r=8*e.sigBytes;return t[r>>>5]|=128<<24-r%32,t[14+(r+64>>>9<<4)]=Math.floor(n/4294967296),t[15+(r+64>>>9<<4)]=n,e.sigBytes=4*t.length,this._process(),this._hash},clone:function(){var e=i.clone.call(this);return e._hash=this._hash.clone(),e}});t.SHA1=i._createHelper(s),t.HmacSHA1=i._createHmacHelper(s)}(),e.SHA1}(kH())}($H)),$H.exports}var YH,QH={exports:{}};var ZH,eG={exports:{}};function tG(){return ZH||(ZH=1,function(e,t){e.exports=function(e){return function(){var t=e,n=t.lib.Hasher,r=t.x64,i=r.Word,a=r.WordArray,o=t.algo;function s(){return i.create.apply(i,arguments)}var c=[s(1116352408,3609767458),s(1899447441,602891725),s(3049323471,3964484399),s(3921009573,2173295548),s(961987163,4081628472),s(1508970993,3053834265),s(2453635748,2937671579),s(2870763221,3664609560),s(3624381080,2734883394),s(310598401,1164996542),s(607225278,1323610764),s(1426881987,3590304994),s(1925078388,4068182383),s(2162078206,991336113),s(2614888103,633803317),s(3248222580,3479774868),s(3835390401,2666613458),s(4022224774,944711139),s(264347078,2341262773),s(604807628,2007800933),s(770255983,1495990901),s(1249150122,1856431235),s(1555081692,3175218132),s(1996064986,2198950837),s(2554220882,3999719339),s(2821834349,766784016),s(2952996808,2566594879),s(3210313671,3203337956),s(3336571891,1034457026),s(3584528711,2466948901),s(113926993,3758326383),s(338241895,168717936),s(666307205,1188179964),s(773529912,1546045734),s(1294757372,1522805485),s(1396182291,2643833823),s(1695183700,2343527390),s(1986661051,1014477480),s(2177026350,1206759142),s(2456956037,344077627),s(2730485921,1290863460),s(2820302411,3158454273),s(3259730800,3505952657),s(3345764771,106217008),s(3516065817,3606008344),s(3600352804,1432725776),s(4094571909,1467031594),s(275423344,851169720),s(430227734,3100823752),s(506948616,1363258195),s(659060556,3750685593),s(883997877,3785050280),s(958139571,3318307427),s(1322822218,3812723403),s(1537002063,2003034995),s(1747873779,3602036899),s(1955562222,1575990012),s(2024104815,1125592928),s(2227730452,2716904306),s(2361852424,442776044),s(2428436474,593698344),s(2756734187,3733110249),s(3204031479,2999351573),s(3329325298,3815920427),s(3391569614,3928383900),s(3515267271,566280711),s(3940187606,3454069534),s(4118630271,4000239992),s(116418474,1914138554),s(174292421,2731055270),s(289380356,3203993006),s(460393269,320620315),s(685471733,587496836),s(852142971,1086792851),s(1017036298,365543100),s(1126000580,2618297676),s(1288033470,3409855158),s(1501505948,4234509866),s(1607167915,987167468),s(1816402316,1246189591)],u=[];!function(){for(var e=0;e<80;e++)u[e]=s()}();var f=o.SHA512=n.extend({_doReset:function(){this._hash=new a.init([new i.init(1779033703,4089235720),new i.init(3144134277,2227873595),new i.init(1013904242,4271175723),new i.init(2773480762,1595750129),new i.init(1359893119,2917565137),new i.init(2600822924,725511199),new i.init(528734635,4215389547),new i.init(1541459225,327033209)])},_doProcessBlock:function(e,t){for(var n=this._hash.words,r=n[0],i=n[1],a=n[2],o=n[3],s=n[4],f=n[5],d=n[6],l=n[7],p=r.high,h=r.low,b=i.high,m=i.low,y=a.high,g=a.low,v=o.high,w=o.low,_=s.high,E=s.low,T=f.high,A=f.low,R=d.high,S=d.low,k=l.high,I=l.low,O=p,x=h,C=b,M=m,P=y,N=g,B=v,D=w,F=_,L=E,U=T,j=A,q=R,z=S,H=k,G=I,V=0;V<80;V++){var K=u[V];if(V<16)var W=K.high=0|e[t+2*V],X=K.low=0|e[t+2*V+1];else{var $=u[V-15],J=$.high,Y=$.low,Q=(J>>>1|Y<<31)^(J>>>8|Y<<24)^J>>>7,Z=(Y>>>1|J<<31)^(Y>>>8|J<<24)^(Y>>>7|J<<25),ee=u[V-2],te=ee.high,ne=ee.low,re=(te>>>19|ne<<13)^(te<<3|ne>>>29)^te>>>6,ie=(ne>>>19|te<<13)^(ne<<3|te>>>29)^(ne>>>6|te<<26),ae=u[V-7],oe=ae.high,se=ae.low,ce=u[V-16],ue=ce.high,fe=ce.low;W=(W=(W=Q+oe+((X=Z+se)>>>0<Z>>>0?1:0))+re+((X+=ie)>>>0<ie>>>0?1:0))+ue+((X+=fe)>>>0<fe>>>0?1:0),K.high=W,K.low=X}var de,le=F&U^~F&q,pe=L&j^~L&z,he=O&C^O&P^C&P,be=x&M^x&N^M&N,me=(O>>>28|x<<4)^(O<<30|x>>>2)^(O<<25|x>>>7),ye=(x>>>28|O<<4)^(x<<30|O>>>2)^(x<<25|O>>>7),ge=(F>>>14|L<<18)^(F>>>18|L<<14)^(F<<23|L>>>9),ve=(L>>>14|F<<18)^(L>>>18|F<<14)^(L<<23|F>>>9),we=c[V],_e=we.high,Ee=we.low,Te=H+ge+((de=G+ve)>>>0<G>>>0?1:0),Ae=ye+be;H=q,G=z,q=U,z=j,U=F,j=L,F=B+(Te=(Te=(Te=Te+le+((de+=pe)>>>0<pe>>>0?1:0))+_e+((de+=Ee)>>>0<Ee>>>0?1:0))+W+((de+=X)>>>0<X>>>0?1:0))+((L=D+de|0)>>>0<D>>>0?1:0)|0,B=P,D=N,P=C,N=M,C=O,M=x,O=Te+(me+he+(Ae>>>0<ye>>>0?1:0))+((x=de+Ae|0)>>>0<de>>>0?1:0)|0}h=r.low=h+x,r.high=p+O+(h>>>0<x>>>0?1:0),m=i.low=m+M,i.high=b+C+(m>>>0<M>>>0?1:0),g=a.low=g+N,a.high=y+P+(g>>>0<N>>>0?1:0),w=o.low=w+D,o.high=v+B+(w>>>0<D>>>0?1:0),E=s.low=E+L,s.high=_+F+(E>>>0<L>>>0?1:0),A=f.low=A+j,f.high=T+U+(A>>>0<j>>>0?1:0),S=d.low=S+z,d.high=R+q+(S>>>0<z>>>0?1:0),I=l.low=I+G,l.high=k+H+(I>>>0<G>>>0?1:0)},_doFinalize:function(){var e=this._data,t=e.words,n=8*this._nDataBytes,r=8*e.sigBytes;return t[r>>>5]|=128<<24-r%32,t[30+(r+128>>>10<<5)]=Math.floor(n/4294967296),t[31+(r+128>>>10<<5)]=n,e.sigBytes=4*t.length,this._process(),this._hash.toX32()},clone:function(){var e=n.clone.call(this);return e._hash=this._hash.clone(),e},blockSize:32});t.SHA512=n._createHelper(f),t.HmacSHA512=n._createHmacHelper(f)}(),e.SHA512}(kH(),BH())}(eG)),eG.exports}var nG,rG={exports:{}};var iG,aG={exports:{}};function oG(){return iG||(iG=1,function(e,t){e.exports=function(e){return function(t){var n=e,r=n.lib,i=r.WordArray,a=r.Hasher,o=n.x64.Word,s=n.algo,c=[],u=[],f=[];!function(){for(var e=1,t=0,n=0;n<24;n++){c[e+5*t]=(n+1)*(n+2)/2%64;var r=(2*e+3*t)%5;e=t%5,t=r}for(e=0;e<5;e++)for(t=0;t<5;t++)u[e+5*t]=t+(2*e+3*t)%5*5;for(var i=1,a=0;a<24;a++){for(var s=0,d=0,l=0;l<7;l++){if(1&i){var p=(1<<l)-1;p<32?d^=1<<p:s^=1<<p-32}128&i?i=i<<1^113:i<<=1}f[a]=o.create(s,d)}}();var d=[];!function(){for(var e=0;e<25;e++)d[e]=o.create()}();var l=s.SHA3=a.extend({cfg:a.cfg.extend({outputLength:512}),_doReset:function(){for(var e=this._state=[],t=0;t<25;t++)e[t]=new o.init;this.blockSize=(1600-2*this.cfg.outputLength)/32},_doProcessBlock:function(e,t){for(var n=this._state,r=this.blockSize/2,i=0;i<r;i++){var a=e[t+2*i],o=e[t+2*i+1];a=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8),o=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8),(I=n[i]).high^=o,I.low^=a}for(var s=0;s<24;s++){for(var l=0;l<5;l++){for(var p=0,h=0,b=0;b<5;b++)p^=(I=n[l+5*b]).high,h^=I.low;var m=d[l];m.high=p,m.low=h}for(l=0;l<5;l++){var y=d[(l+4)%5],g=d[(l+1)%5],v=g.high,w=g.low;for(p=y.high^(v<<1|w>>>31),h=y.low^(w<<1|v>>>31),b=0;b<5;b++)(I=n[l+5*b]).high^=p,I.low^=h}for(var _=1;_<25;_++){var E=(I=n[_]).high,T=I.low,A=c[_];A<32?(p=E<<A|T>>>32-A,h=T<<A|E>>>32-A):(p=T<<A-32|E>>>64-A,h=E<<A-32|T>>>64-A);var R=d[u[_]];R.high=p,R.low=h}var S=d[0],k=n[0];for(S.high=k.high,S.low=k.low,l=0;l<5;l++)for(b=0;b<5;b++){var I=n[_=l+5*b],O=d[_],x=d[(l+1)%5+5*b],C=d[(l+2)%5+5*b];I.high=O.high^~x.high&C.high,I.low=O.low^~x.low&C.low}I=n[0];var M=f[s];I.high^=M.high,I.low^=M.low}},_doFinalize:function(){var e=this._data,n=e.words;this._nDataBytes;var r=8*e.sigBytes,a=32*this.blockSize;n[r>>>5]|=1<<24-r%32,n[(t.ceil((r+1)/a)*a>>>5)-1]|=128,e.sigBytes=4*n.length,this._process();for(var o=this._state,s=this.cfg.outputLength/8,c=s/8,u=[],f=0;f<c;f++){var d=o[f],l=d.high,p=d.low;l=16711935&(l<<8|l>>>24)|4278255360&(l<<24|l>>>8),p=16711935&(p<<8|p>>>24)|4278255360&(p<<24|p>>>8),u.push(p),u.push(l)}return new i.init(u,s)},clone:function(){for(var e=a.clone.call(this),t=e._state=this._state.slice(0),n=0;n<25;n++)t[n]=t[n].clone();return e}});n.SHA3=a._createHelper(l),n.HmacSHA3=a._createHmacHelper(l)}(Math),e.SHA3}(kH(),BH())}(aG)),aG.exports}var sG,cG={exports:{}};var uG,fG={exports:{}};function dG(){return uG||(uG=1,function(e,t){e.exports=function(e){!function(){var t=e,n=t.lib.Base,r=t.enc.Utf8;t.algo.HMAC=n.extend({init:function(e,t){e=this._hasher=new e.init,"string"==typeof t&&(t=r.parse(t));var n=e.blockSize,i=4*n;t.sigBytes>i&&(t=e.finalize(t)),t.clamp();for(var a=this._oKey=t.clone(),o=this._iKey=t.clone(),s=a.words,c=o.words,u=0;u<n;u++)s[u]^=1549556828,c[u]^=909522486;a.sigBytes=o.sigBytes=i,this.reset()},reset:function(){var e=this._hasher;e.reset(),e.update(this._iKey)},update:function(e){return this._hasher.update(e),this},finalize:function(e){var t=this._hasher,n=t.finalize(e);return t.reset(),t.finalize(this._oKey.clone().concat(n))}})}()}(kH())}(fG)),fG.exports}var lG,pG={exports:{}};var hG,bG={exports:{}};function mG(){return hG||(hG=1,function(e,t){e.exports=function(e){return function(){var t=e,n=t.lib,r=n.Base,i=n.WordArray,a=t.algo,o=a.MD5,s=a.EvpKDF=r.extend({cfg:r.extend({keySize:4,hasher:o,iterations:1}),init:function(e){this.cfg=this.cfg.extend(e)},compute:function(e,t){for(var n=this.cfg,r=n.hasher.create(),a=i.create(),o=a.words,s=n.keySize,c=n.iterations;o.length<s;){u&&r.update(u);var u=r.update(e).finalize(t);r.reset();for(var f=1;f<c;f++)u=r.finalize(u),r.reset();a.concat(u)}return a.sigBytes=4*s,a}});t.EvpKDF=function(e,t,n){return s.create(n).compute(e,t)}}(),e.EvpKDF}(kH(),JH(),dG())}(bG)),bG.exports}var yG,gG={exports:{}};function vG(){return yG||(yG=1,function(e,t){e.exports=function(e){e.lib.Cipher||function(t){var n=e,r=n.lib,i=r.Base,a=r.WordArray,o=r.BufferedBlockAlgorithm,s=n.enc;s.Utf8;var c=s.Base64,u=n.algo.EvpKDF,f=r.Cipher=o.extend({cfg:i.extend(),createEncryptor:function(e,t){return this.create(this._ENC_XFORM_MODE,e,t)},createDecryptor:function(e,t){return this.create(this._DEC_XFORM_MODE,e,t)},init:function(e,t,n){this.cfg=this.cfg.extend(n),this._xformMode=e,this._key=t,this.reset()},reset:function(){o.reset.call(this),this._doReset()},process:function(e){return this._append(e),this._process()},finalize:function(e){return e&&this._append(e),this._doFinalize()},keySize:4,ivSize:4,_ENC_XFORM_MODE:1,_DEC_XFORM_MODE:2,_createHelper:function(){function e(e){return"string"==typeof e?v:y}return function(t){return{encrypt:function(n,r,i){return e(r).encrypt(t,n,r,i)},decrypt:function(n,r,i){return e(r).decrypt(t,n,r,i)}}}}()});r.StreamCipher=f.extend({_doFinalize:function(){return this._process(!0)},blockSize:1});var d=n.mode={},l=r.BlockCipherMode=i.extend({createEncryptor:function(e,t){return this.Encryptor.create(e,t)},createDecryptor:function(e,t){return this.Decryptor.create(e,t)},init:function(e,t){this._cipher=e,this._iv=t}}),p=d.CBC=function(){var e=l.extend();function n(e,n,r){var i=this._iv;if(i){var a=i;this._iv=t}else a=this._prevBlock;for(var o=0;o<r;o++)e[n+o]^=a[o]}return e.Encryptor=e.extend({processBlock:function(e,t){var r=this._cipher,i=r.blockSize;n.call(this,e,t,i),r.encryptBlock(e,t),this._prevBlock=e.slice(t,t+i)}}),e.Decryptor=e.extend({processBlock:function(e,t){var r=this._cipher,i=r.blockSize,a=e.slice(t,t+i);r.decryptBlock(e,t),n.call(this,e,t,i),this._prevBlock=a}}),e}(),h=(n.pad={}).Pkcs7={pad:function(e,t){for(var n=4*t,r=n-e.sigBytes%n,i=r<<24|r<<16|r<<8|r,o=[],s=0;s<r;s+=4)o.push(i);var c=a.create(o,r);e.concat(c)},unpad:function(e){var t=255&e.words[e.sigBytes-1>>>2];e.sigBytes-=t}};r.BlockCipher=f.extend({cfg:f.cfg.extend({mode:p,padding:h}),reset:function(){f.reset.call(this);var e=this.cfg,t=e.iv,n=e.mode;if(this._xformMode==this._ENC_XFORM_MODE)var r=n.createEncryptor;else r=n.createDecryptor,this._minBufferSize=1;this._mode&&this._mode.__creator==r?this._mode.init(this,t&&t.words):(this._mode=r.call(n,this,t&&t.words),this._mode.__creator=r)},_doProcessBlock:function(e,t){this._mode.processBlock(e,t)},_doFinalize:function(){var e=this.cfg.padding;if(this._xformMode==this._ENC_XFORM_MODE){e.pad(this._data,this.blockSize);var t=this._process(!0)}else t=this._process(!0),e.unpad(t);return t},blockSize:4});var b=r.CipherParams=i.extend({init:function(e){this.mixIn(e)},toString:function(e){return(e||this.formatter).stringify(this)}}),m=(n.format={}).OpenSSL={stringify:function(e){var t=e.ciphertext,n=e.salt;if(n)var r=a.create([1398893684,1701076831]).concat(n).concat(t);else r=t;return r.toString(c)},parse:function(e){var t=c.parse(e),n=t.words;if(1398893684==n[0]&&1701076831==n[1]){var r=a.create(n.slice(2,4));n.splice(0,4),t.sigBytes-=16}return b.create({ciphertext:t,salt:r})}},y=r.SerializableCipher=i.extend({cfg:i.extend({format:m}),encrypt:function(e,t,n,r){r=this.cfg.extend(r);var i=e.createEncryptor(n,r),a=i.finalize(t),o=i.cfg;return b.create({ciphertext:a,key:n,iv:o.iv,algorithm:e,mode:o.mode,padding:o.padding,blockSize:e.blockSize,formatter:r.format})},decrypt:function(e,t,n,r){return r=this.cfg.extend(r),t=this._parse(t,r.format),e.createDecryptor(n,r).finalize(t.ciphertext)},_parse:function(e,t){return"string"==typeof e?t.parse(e,this):e}}),g=(n.kdf={}).OpenSSL={execute:function(e,t,n,r){r||(r=a.random(8));var i=u.create({keySize:t+n}).compute(e,r),o=a.create(i.words.slice(t),4*n);return i.sigBytes=4*t,b.create({key:i,iv:o,salt:r})}},v=r.PasswordBasedCipher=y.extend({cfg:y.cfg.extend({kdf:g}),encrypt:function(e,t,n,r){var i=(r=this.cfg.extend(r)).kdf.execute(n,e.keySize,e.ivSize);r.iv=i.iv;var a=y.encrypt.call(this,e,t,i.key,r);return a.mixIn(i),a},decrypt:function(e,t,n,r){r=this.cfg.extend(r),t=this._parse(t,r.format);var i=r.kdf.execute(n,e.keySize,e.ivSize,t.salt);return r.iv=i.iv,y.decrypt.call(this,e,t,i.key,r)}})}()}(kH(),mG())}(gG)),gG.exports}var wG,_G={exports:{}};function EG(){return wG||(wG=1,function(e,t){e.exports=function(e){return e.mode.CFB=function(){var t=e.lib.BlockCipherMode.extend();function n(e,t,n,r){var i=this._iv;if(i){var a=i.slice(0);this._iv=void 0}else a=this._prevBlock;r.encryptBlock(a,0);for(var o=0;o<n;o++)e[t+o]^=a[o]}return t.Encryptor=t.extend({processBlock:function(e,t){var r=this._cipher,i=r.blockSize;n.call(this,e,t,i,r),this._prevBlock=e.slice(t,t+i)}}),t.Decryptor=t.extend({processBlock:function(e,t){var r=this._cipher,i=r.blockSize,a=e.slice(t,t+i);n.call(this,e,t,i,r),this._prevBlock=a}}),t}(),e.mode.CFB}(kH(),vG())}(_G)),_G.exports}var TG,AG={exports:{}};function RG(){return TG||(TG=1,function(e,t){e.exports=function(e){return e.mode.CTR=(t=e.lib.BlockCipherMode.extend(),n=t.Encryptor=t.extend({processBlock:function(e,t){var n=this._cipher,r=n.blockSize,i=this._iv,a=this._counter;i&&(a=this._counter=i.slice(0),this._iv=void 0);var o=a.slice(0);n.encryptBlock(o,0),a[r-1]=a[r-1]+1|0;for(var s=0;s<r;s++)e[t+s]^=o[s]}}),t.Decryptor=n,t),e.mode.CTR;var t,n}(kH(),vG())}(AG)),AG.exports}var SG,kG={exports:{}};function IG(){return SG||(SG=1,function(e,t){e.exports=function(e){
|
|
31
|
+
*/oM=sM,function(){var e="input is invalid type",t="object"==typeof window,n=t?window:{};n.JS_SHA3_NO_WINDOW&&(t=!1);var r=!t&&"object"==typeof self;!n.JS_SHA3_NO_NODE_JS&&"object"==typeof process&&process.versions&&process.versions.node?n=YO:r&&(n=self);var i=!n.JS_SHA3_NO_COMMON_JS&&oM.exports,a=!n.JS_SHA3_NO_ARRAY_BUFFER&&"undefined"!=typeof ArrayBuffer,o="0123456789abcdef".split(""),s=[4,1024,262144,67108864],c=[0,8,16,24],u=[1,0,32898,0,32906,2147483648,2147516416,2147483648,32907,0,2147483649,0,2147516545,2147483648,32777,2147483648,138,0,136,0,2147516425,0,2147483658,0,2147516555,0,139,2147483648,32905,2147483648,32771,2147483648,32770,2147483648,128,2147483648,32778,0,2147483658,2147483648,2147516545,2147483648,32896,2147483648,2147483649,0,2147516424,2147483648],f=[224,256,384,512],d=[128,256],l=["hex","buffer","arrayBuffer","array","digest"],p={128:168,256:136};!n.JS_SHA3_NO_NODE_JS&&Array.isArray||(Array.isArray=function(e){return"[object Array]"===Object.prototype.toString.call(e)}),!a||!n.JS_SHA3_NO_ARRAY_BUFFER_IS_VIEW&&ArrayBuffer.isView||(ArrayBuffer.isView=function(e){return"object"==typeof e&&e.buffer&&e.buffer.constructor===ArrayBuffer});for(var h=function(e,t,n){return function(r){return new O(e,t,e).update(r)[n]()}},b=function(e,t,n){return function(r,i){return new O(e,t,i).update(r)[n]()}},m=function(e,t,n){return function(t,r,i,a){return _["cshake"+e].update(t,r,i,a)[n]()}},y=function(e,t,n){return function(t,r,i,a){return _["kmac"+e].update(t,r,i,a)[n]()}},g=function(e,t,n,r){for(var i=0;i<l.length;++i){var a=l[i];e[a]=t(n,r,a)}return e},v=function(e,t){var n=h(e,t,"hex");return n.create=function(){return new O(e,t,e)},n.update=function(e){return n.create().update(e)},g(n,h,e,t)},w=[{name:"keccak",padding:[1,256,65536,16777216],bits:f,createMethod:v},{name:"sha3",padding:[6,1536,393216,100663296],bits:f,createMethod:v},{name:"shake",padding:[31,7936,2031616,520093696],bits:d,createMethod:function(e,t){var n=b(e,t,"hex");return n.create=function(n){return new O(e,t,n)},n.update=function(e,t){return n.create(t).update(e)},g(n,b,e,t)}},{name:"cshake",padding:s,bits:d,createMethod:function(e,t){var n=p[e],r=m(e,0,"hex");return r.create=function(r,i,a){return i||a?new O(e,t,r).bytepad([i,a],n):_["shake"+e].create(r)},r.update=function(e,t,n,i){return r.create(t,n,i).update(e)},g(r,m,e,t)}},{name:"kmac",padding:s,bits:d,createMethod:function(e,t){var n=p[e],r=y(e,0,"hex");return r.create=function(r,i,a){return new x(e,t,i).bytepad(["KMAC",a],n).bytepad([r],n)},r.update=function(e,t,n,i){return r.create(e,n,i).update(t)},g(r,y,e,t)}}],_={},E=[],T=0;T<w.length;++T)for(var A=w[T],R=A.bits,S=0;S<R.length;++S){var k=A.name+"_"+R[S];if(E.push(k),_[k]=A.createMethod(R[S],A.padding),"sha3"!==A.name){var I=A.name+R[S];E.push(I),_[I]=_[k]}}function O(e,t,n){this.blocks=[],this.s=[],this.padding=t,this.outputBits=n,this.reset=!0,this.finalized=!1,this.block=0,this.start=0,this.blockCount=1600-(e<<1)>>5,this.byteCount=this.blockCount<<2,this.outputBlocks=n>>5,this.extraBytes=(31&n)>>3;for(var r=0;r<50;++r)this.s[r]=0}function x(e,t,n){O.call(this,e,t,n)}O.prototype.update=function(t){if(this.finalized)throw new Error("finalize already called");var n,r=typeof t;if("string"!==r){if("object"!==r)throw new Error(e);if(null===t)throw new Error(e);if(a&&t.constructor===ArrayBuffer)t=new Uint8Array(t);else if(!(Array.isArray(t)||a&&ArrayBuffer.isView(t)))throw new Error(e);n=!0}for(var i,o,s=this.blocks,u=this.byteCount,f=t.length,d=this.blockCount,l=0,p=this.s;l<f;){if(this.reset)for(this.reset=!1,s[0]=this.block,i=1;i<d+1;++i)s[i]=0;if(n)for(i=this.start;l<f&&i<u;++l)s[i>>2]|=t[l]<<c[3&i++];else for(i=this.start;l<f&&i<u;++l)(o=t.charCodeAt(l))<128?s[i>>2]|=o<<c[3&i++]:o<2048?(s[i>>2]|=(192|o>>6)<<c[3&i++],s[i>>2]|=(128|63&o)<<c[3&i++]):o<55296||o>=57344?(s[i>>2]|=(224|o>>12)<<c[3&i++],s[i>>2]|=(128|o>>6&63)<<c[3&i++],s[i>>2]|=(128|63&o)<<c[3&i++]):(o=65536+((1023&o)<<10|1023&t.charCodeAt(++l)),s[i>>2]|=(240|o>>18)<<c[3&i++],s[i>>2]|=(128|o>>12&63)<<c[3&i++],s[i>>2]|=(128|o>>6&63)<<c[3&i++],s[i>>2]|=(128|63&o)<<c[3&i++]);if(this.lastByteIndex=i,i>=u){for(this.start=i-u,this.block=s[d],i=0;i<d;++i)p[i]^=s[i];C(p),this.reset=!0}else this.start=i}return this},O.prototype.encode=function(e,t){var n=255&e,r=1,i=[n];for(n=255&(e>>=8);n>0;)i.unshift(n),n=255&(e>>=8),++r;return t?i.push(r):i.unshift(r),this.update(i),i.length},O.prototype.encodeString=function(t){var n,r=typeof t;if("string"!==r){if("object"!==r)throw new Error(e);if(null===t)throw new Error(e);if(a&&t.constructor===ArrayBuffer)t=new Uint8Array(t);else if(!(Array.isArray(t)||a&&ArrayBuffer.isView(t)))throw new Error(e);n=!0}var i=0,o=t.length;if(n)i=o;else for(var s=0;s<t.length;++s){var c=t.charCodeAt(s);c<128?i+=1:c<2048?i+=2:c<55296||c>=57344?i+=3:(c=65536+((1023&c)<<10|1023&t.charCodeAt(++s)),i+=4)}return i+=this.encode(8*i),this.update(t),i},O.prototype.bytepad=function(e,t){for(var n=this.encode(t),r=0;r<e.length;++r)n+=this.encodeString(e[r]);var i=t-n%t,a=[];return a.length=i,this.update(a),this},O.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var e=this.blocks,t=this.lastByteIndex,n=this.blockCount,r=this.s;if(e[t>>2]|=this.padding[3&t],this.lastByteIndex===this.byteCount)for(e[0]=e[n],t=1;t<n+1;++t)e[t]=0;for(e[n-1]|=2147483648,t=0;t<n;++t)r[t]^=e[t];C(r)}},O.prototype.toString=O.prototype.hex=function(){this.finalize();for(var e,t=this.blockCount,n=this.s,r=this.outputBlocks,i=this.extraBytes,a=0,s=0,c="";s<r;){for(a=0;a<t&&s<r;++a,++s)e=n[a],c+=o[e>>4&15]+o[15&e]+o[e>>12&15]+o[e>>8&15]+o[e>>20&15]+o[e>>16&15]+o[e>>28&15]+o[e>>24&15];s%t==0&&(C(n),a=0)}return i&&(e=n[a],c+=o[e>>4&15]+o[15&e],i>1&&(c+=o[e>>12&15]+o[e>>8&15]),i>2&&(c+=o[e>>20&15]+o[e>>16&15])),c},O.prototype.arrayBuffer=function(){this.finalize();var e,t=this.blockCount,n=this.s,r=this.outputBlocks,i=this.extraBytes,a=0,o=0,s=this.outputBits>>3;e=i?new ArrayBuffer(r+1<<2):new ArrayBuffer(s);for(var c=new Uint32Array(e);o<r;){for(a=0;a<t&&o<r;++a,++o)c[o]=n[a];o%t==0&&C(n)}return i&&(c[a]=n[a],e=e.slice(0,s)),e},O.prototype.buffer=O.prototype.arrayBuffer,O.prototype.digest=O.prototype.array=function(){this.finalize();for(var e,t,n=this.blockCount,r=this.s,i=this.outputBlocks,a=this.extraBytes,o=0,s=0,c=[];s<i;){for(o=0;o<n&&s<i;++o,++s)e=s<<2,t=r[o],c[e]=255&t,c[e+1]=t>>8&255,c[e+2]=t>>16&255,c[e+3]=t>>24&255;s%n==0&&C(r)}return a&&(e=s<<2,t=r[o],c[e]=255&t,a>1&&(c[e+1]=t>>8&255),a>2&&(c[e+2]=t>>16&255)),c},x.prototype=new O,x.prototype.finalize=function(){return this.encode(this.outputBits,!0),O.prototype.finalize.call(this)};var C=function(e){var t,n,r,i,a,o,s,c,f,d,l,p,h,b,m,y,g,v,w,_,E,T,A,R,S,k,I,O,x,C,M,P,N,B,D,F,L,U,j,q,z,H,G,V,K,W,X,$,J,Y,Q,Z,ee,te,ne,re,ie,ae,oe,se,ce,ue,fe;for(r=0;r<48;r+=2)i=e[0]^e[10]^e[20]^e[30]^e[40],a=e[1]^e[11]^e[21]^e[31]^e[41],o=e[2]^e[12]^e[22]^e[32]^e[42],s=e[3]^e[13]^e[23]^e[33]^e[43],c=e[4]^e[14]^e[24]^e[34]^e[44],f=e[5]^e[15]^e[25]^e[35]^e[45],d=e[6]^e[16]^e[26]^e[36]^e[46],l=e[7]^e[17]^e[27]^e[37]^e[47],t=(p=e[8]^e[18]^e[28]^e[38]^e[48])^(o<<1|s>>>31),n=(h=e[9]^e[19]^e[29]^e[39]^e[49])^(s<<1|o>>>31),e[0]^=t,e[1]^=n,e[10]^=t,e[11]^=n,e[20]^=t,e[21]^=n,e[30]^=t,e[31]^=n,e[40]^=t,e[41]^=n,t=i^(c<<1|f>>>31),n=a^(f<<1|c>>>31),e[2]^=t,e[3]^=n,e[12]^=t,e[13]^=n,e[22]^=t,e[23]^=n,e[32]^=t,e[33]^=n,e[42]^=t,e[43]^=n,t=o^(d<<1|l>>>31),n=s^(l<<1|d>>>31),e[4]^=t,e[5]^=n,e[14]^=t,e[15]^=n,e[24]^=t,e[25]^=n,e[34]^=t,e[35]^=n,e[44]^=t,e[45]^=n,t=c^(p<<1|h>>>31),n=f^(h<<1|p>>>31),e[6]^=t,e[7]^=n,e[16]^=t,e[17]^=n,e[26]^=t,e[27]^=n,e[36]^=t,e[37]^=n,e[46]^=t,e[47]^=n,t=d^(i<<1|a>>>31),n=l^(a<<1|i>>>31),e[8]^=t,e[9]^=n,e[18]^=t,e[19]^=n,e[28]^=t,e[29]^=n,e[38]^=t,e[39]^=n,e[48]^=t,e[49]^=n,b=e[0],m=e[1],W=e[11]<<4|e[10]>>>28,X=e[10]<<4|e[11]>>>28,O=e[20]<<3|e[21]>>>29,x=e[21]<<3|e[20]>>>29,se=e[31]<<9|e[30]>>>23,ce=e[30]<<9|e[31]>>>23,H=e[40]<<18|e[41]>>>14,G=e[41]<<18|e[40]>>>14,B=e[2]<<1|e[3]>>>31,D=e[3]<<1|e[2]>>>31,y=e[13]<<12|e[12]>>>20,g=e[12]<<12|e[13]>>>20,$=e[22]<<10|e[23]>>>22,J=e[23]<<10|e[22]>>>22,C=e[33]<<13|e[32]>>>19,M=e[32]<<13|e[33]>>>19,ue=e[42]<<2|e[43]>>>30,fe=e[43]<<2|e[42]>>>30,te=e[5]<<30|e[4]>>>2,ne=e[4]<<30|e[5]>>>2,F=e[14]<<6|e[15]>>>26,L=e[15]<<6|e[14]>>>26,v=e[25]<<11|e[24]>>>21,w=e[24]<<11|e[25]>>>21,Y=e[34]<<15|e[35]>>>17,Q=e[35]<<15|e[34]>>>17,P=e[45]<<29|e[44]>>>3,N=e[44]<<29|e[45]>>>3,R=e[6]<<28|e[7]>>>4,S=e[7]<<28|e[6]>>>4,re=e[17]<<23|e[16]>>>9,ie=e[16]<<23|e[17]>>>9,U=e[26]<<25|e[27]>>>7,j=e[27]<<25|e[26]>>>7,_=e[36]<<21|e[37]>>>11,E=e[37]<<21|e[36]>>>11,Z=e[47]<<24|e[46]>>>8,ee=e[46]<<24|e[47]>>>8,V=e[8]<<27|e[9]>>>5,K=e[9]<<27|e[8]>>>5,k=e[18]<<20|e[19]>>>12,I=e[19]<<20|e[18]>>>12,ae=e[29]<<7|e[28]>>>25,oe=e[28]<<7|e[29]>>>25,q=e[38]<<8|e[39]>>>24,z=e[39]<<8|e[38]>>>24,T=e[48]<<14|e[49]>>>18,A=e[49]<<14|e[48]>>>18,e[0]=b^~y&v,e[1]=m^~g&w,e[10]=R^~k&O,e[11]=S^~I&x,e[20]=B^~F&U,e[21]=D^~L&j,e[30]=V^~W&$,e[31]=K^~X&J,e[40]=te^~re&ae,e[41]=ne^~ie&oe,e[2]=y^~v&_,e[3]=g^~w&E,e[12]=k^~O&C,e[13]=I^~x&M,e[22]=F^~U&q,e[23]=L^~j&z,e[32]=W^~$&Y,e[33]=X^~J&Q,e[42]=re^~ae&se,e[43]=ie^~oe&ce,e[4]=v^~_&T,e[5]=w^~E&A,e[14]=O^~C&P,e[15]=x^~M&N,e[24]=U^~q&H,e[25]=j^~z&G,e[34]=$^~Y&Z,e[35]=J^~Q&ee,e[44]=ae^~se&ue,e[45]=oe^~ce&fe,e[6]=_^~T&b,e[7]=E^~A&m,e[16]=C^~P&R,e[17]=M^~N&S,e[26]=q^~H&B,e[27]=z^~G&D,e[36]=Y^~Z&V,e[37]=Q^~ee&K,e[46]=se^~ue&te,e[47]=ce^~fe&ne,e[8]=T^~b&y,e[9]=A^~m&g,e[18]=P^~R&k,e[19]=N^~S&I,e[28]=H^~B&F,e[29]=G^~D&L,e[38]=Z^~V&W,e[39]=ee^~K&X,e[48]=ue^~te&re,e[49]=fe^~ne&ie,e[0]^=u[r],e[1]^=u[r+1]};if(i)oM.exports=_;else for(T=0;T<E.length;++T)n[E[T]]=_[E[T]]}();var cM=sM.exports;function uM(e){return"0x"+cM.keccak_256(_r(e))}let fM=!1,dM=!1;const lM={debug:1,default:2,info:2,warning:3,error:4,off:5};let pM=lM.default,hM=null;const bM=function(){try{const e=[];if(["NFD","NFC","NFKD","NFKC"].forEach((t=>{try{if("test"!=="test".normalize(t))throw new Error("bad normalize")}catch(n){e.push(t)}})),e.length)throw new Error("missing "+e.join(", "));if(String.fromCharCode(233).normalize("NFD")!==String.fromCharCode(101,769))throw new Error("broken implementation")}catch(e){return e.message}return null}();var mM,yM;!function(e){e.DEBUG="DEBUG",e.INFO="INFO",e.WARNING="WARNING",e.ERROR="ERROR",e.OFF="OFF"}(mM||(mM={})),function(e){e.UNKNOWN_ERROR="UNKNOWN_ERROR",e.NOT_IMPLEMENTED="NOT_IMPLEMENTED",e.UNSUPPORTED_OPERATION="UNSUPPORTED_OPERATION",e.NETWORK_ERROR="NETWORK_ERROR",e.SERVER_ERROR="SERVER_ERROR",e.TIMEOUT="TIMEOUT",e.BUFFER_OVERRUN="BUFFER_OVERRUN",e.NUMERIC_FAULT="NUMERIC_FAULT",e.MISSING_NEW="MISSING_NEW",e.INVALID_ARGUMENT="INVALID_ARGUMENT",e.MISSING_ARGUMENT="MISSING_ARGUMENT",e.UNEXPECTED_ARGUMENT="UNEXPECTED_ARGUMENT",e.CALL_EXCEPTION="CALL_EXCEPTION",e.INSUFFICIENT_FUNDS="INSUFFICIENT_FUNDS",e.NONCE_EXPIRED="NONCE_EXPIRED",e.REPLACEMENT_UNDERPRICED="REPLACEMENT_UNDERPRICED",e.UNPREDICTABLE_GAS_LIMIT="UNPREDICTABLE_GAS_LIMIT",e.TRANSACTION_REPLACED="TRANSACTION_REPLACED",e.ACTION_REJECTED="ACTION_REJECTED"}(yM||(yM={}));const gM="0123456789abcdef";let vM=class e{constructor(e){Object.defineProperty(this,"version",{enumerable:!0,value:e,writable:!1})}_log(e,t){const n=e.toLowerCase();null==lM[n]&&this.throwArgumentError("invalid log level name","logLevel",e),pM>lM[n]||console.log.apply(console,t)}debug(...t){this._log(e.levels.DEBUG,t)}info(...t){this._log(e.levels.INFO,t)}warn(...t){this._log(e.levels.WARNING,t)}makeError(t,n,r){if(dM)return this.makeError("censored error",n,{});n||(n=e.errors.UNKNOWN_ERROR),r||(r={});const i=[];Object.keys(r).forEach((e=>{const t=r[e];try{if(t instanceof Uint8Array){let n="";for(let e=0;e<t.length;e++)n+=gM[t[e]>>4],n+=gM[15&t[e]];i.push(e+"=Uint8Array(0x"+n+")")}else i.push(e+"="+JSON.stringify(t))}catch(t){i.push(e+"="+JSON.stringify(r[e].toString()))}})),i.push(`code=${n}`),i.push(`version=${this.version}`);const a=t;let o="";switch(n){case yM.NUMERIC_FAULT:{o="NUMERIC_FAULT";const e=t;switch(e){case"overflow":case"underflow":case"division-by-zero":o+="-"+e;break;case"negative-power":case"negative-width":o+="-unsupported";break;case"unbound-bitwise-result":o+="-unbound-result"}break}case yM.CALL_EXCEPTION:case yM.INSUFFICIENT_FUNDS:case yM.MISSING_NEW:case yM.NONCE_EXPIRED:case yM.REPLACEMENT_UNDERPRICED:case yM.TRANSACTION_REPLACED:case yM.UNPREDICTABLE_GAS_LIMIT:o=n}o&&(t+=" [ See: https://links.ethers.org/v5-errors-"+o+" ]"),i.length&&(t+=" ("+i.join(", ")+")");const s=new Error(t);return s.reason=a,s.code=n,Object.keys(r).forEach((function(e){s[e]=r[e]})),s}throwError(e,t,n){throw this.makeError(e,t,n)}throwArgumentError(t,n,r){return this.throwError(t,e.errors.INVALID_ARGUMENT,{argument:n,value:r})}assert(e,t,n,r){e||this.throwError(t,n,r)}assertArgument(e,t,n,r){e||this.throwArgumentError(t,n,r)}checkNormalize(t){bM&&this.throwError("platform missing String.prototype.normalize",e.errors.UNSUPPORTED_OPERATION,{operation:"String.prototype.normalize",form:bM})}checkSafeUint53(t,n){"number"==typeof t&&(null==n&&(n="value not safe"),(t<0||t>=9007199254740991)&&this.throwError(n,e.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"out-of-safe-range",value:t}),t%1&&this.throwError(n,e.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"non-integer",value:t}))}checkArgumentCount(t,n,r){r=r?": "+r:"",t<n&&this.throwError("missing argument"+r,e.errors.MISSING_ARGUMENT,{count:t,expectedCount:n}),t>n&&this.throwError("too many arguments"+r,e.errors.UNEXPECTED_ARGUMENT,{count:t,expectedCount:n})}checkNew(t,n){t!==Object&&null!=t||this.throwError("missing new",e.errors.MISSING_NEW,{name:n.name})}checkAbstract(t,n){t===n?this.throwError("cannot instantiate abstract class "+JSON.stringify(n.name)+" directly; use a sub-class",e.errors.UNSUPPORTED_OPERATION,{name:t.name,operation:"new"}):t!==Object&&null!=t||this.throwError("missing new",e.errors.MISSING_NEW,{name:n.name})}static globalLogger(){return hM||(hM=new e("logger/5.7.0")),hM}static setCensorship(t,n){if(!t&&n&&this.globalLogger().throwError("cannot permanently disable censorship",e.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"}),fM){if(!t)return;this.globalLogger().throwError("error censorship permanent",e.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"})}dM=!!t,fM=!!n}static setLogLevel(t){const n=lM[t.toLowerCase()];null!=n?pM=n:e.globalLogger().warn("invalid log level - "+t)}static from(t){return new e(t)}};vM.errors=yM,vM.levels=mM;var wM=rr.BN;const _M=new vM("bignumber/5.7.0"),EM={};let TM=!1,AM=class e{constructor(e,t){e!==EM&&_M.throwError("cannot call constructor directly; use BigNumber.from",vM.errors.UNSUPPORTED_OPERATION,{operation:"new (BigNumber)"}),this._hex=t,this._isBigNumber=!0,Object.freeze(this)}fromTwos(e){return SM(kM(this).fromTwos(e))}toTwos(e){return SM(kM(this).toTwos(e))}abs(){return"-"===this._hex[0]?e.from(this._hex.substring(1)):this}add(e){return SM(kM(this).add(kM(e)))}sub(e){return SM(kM(this).sub(kM(e)))}div(t){return e.from(t).isZero()&&IM("division-by-zero","div"),SM(kM(this).div(kM(t)))}mul(e){return SM(kM(this).mul(kM(e)))}mod(e){const t=kM(e);return t.isNeg()&&IM("division-by-zero","mod"),SM(kM(this).umod(t))}pow(e){const t=kM(e);return t.isNeg()&&IM("negative-power","pow"),SM(kM(this).pow(t))}and(e){const t=kM(e);return(this.isNegative()||t.isNeg())&&IM("unbound-bitwise-result","and"),SM(kM(this).and(t))}or(e){const t=kM(e);return(this.isNegative()||t.isNeg())&&IM("unbound-bitwise-result","or"),SM(kM(this).or(t))}xor(e){const t=kM(e);return(this.isNegative()||t.isNeg())&&IM("unbound-bitwise-result","xor"),SM(kM(this).xor(t))}mask(e){return(this.isNegative()||e<0)&&IM("negative-width","mask"),SM(kM(this).maskn(e))}shl(e){return(this.isNegative()||e<0)&&IM("negative-width","shl"),SM(kM(this).shln(e))}shr(e){return(this.isNegative()||e<0)&&IM("negative-width","shr"),SM(kM(this).shrn(e))}eq(e){return kM(this).eq(kM(e))}lt(e){return kM(this).lt(kM(e))}lte(e){return kM(this).lte(kM(e))}gt(e){return kM(this).gt(kM(e))}gte(e){return kM(this).gte(kM(e))}isNegative(){return"-"===this._hex[0]}isZero(){return kM(this).isZero()}toNumber(){try{return kM(this).toNumber()}catch(e){IM("overflow","toNumber",this.toString())}return null}toBigInt(){try{return BigInt(this.toString())}catch(e){}return _M.throwError("this platform does not support BigInt",vM.errors.UNSUPPORTED_OPERATION,{value:this.toString()})}toString(){return arguments.length>0&&(10===arguments[0]?TM||(TM=!0,_M.warn("BigNumber.toString does not accept any parameters; base-10 is assumed")):16===arguments[0]?_M.throwError("BigNumber.toString does not accept any parameters; use bigNumber.toHexString()",vM.errors.UNEXPECTED_ARGUMENT,{}):_M.throwError("BigNumber.toString does not accept parameters",vM.errors.UNEXPECTED_ARGUMENT,{})),kM(this).toString(10)}toHexString(){return this._hex}toJSON(e){return{type:"BigNumber",hex:this.toHexString()}}static from(t){if(t instanceof e)return t;if("string"==typeof t)return t.match(/^-?0x[0-9a-f]+$/i)?new e(EM,RM(t)):t.match(/^-?[0-9]+$/)?new e(EM,RM(new wM(t))):_M.throwArgumentError("invalid BigNumber string","value",t);if("number"==typeof t)return t%1&&IM("underflow","BigNumber.from",t),(t>=9007199254740991||t<=-9007199254740991)&&IM("overflow","BigNumber.from",t),e.from(String(t));const n=t;if("bigint"==typeof n)return e.from(n.toString());if(wr(n))return e.from(kr(n));if(n)if(n.toHexString){const t=n.toHexString();if("string"==typeof t)return e.from(t)}else{let t=n._hex;if(null==t&&"BigNumber"===n.type&&(t=n.hex),"string"==typeof t&&(Rr(t)||"-"===t[0]&&Rr(t.substring(1))))return e.from(t)}return _M.throwArgumentError("invalid BigNumber value","value",t)}static isBigNumber(e){return!(!e||!e._isBigNumber)}};function RM(e){if("string"!=typeof e)return RM(e.toString(16));if("-"===e[0])return"-"===(e=e.substring(1))[0]&&_M.throwArgumentError("invalid hex","value",e),"0x00"===(e=RM(e))?e:"-"+e;if("0x"!==e.substring(0,2)&&(e="0x"+e),"0x"===e)return"0x00";for(e.length%2&&(e="0x0"+e.substring(2));e.length>4&&"0x00"===e.substring(0,4);)e="0x"+e.substring(4);return e}function SM(e){return AM.from(RM(e))}function kM(e){const t=AM.from(e).toHexString();return"-"===t[0]?new wM("-"+t.substring(3),16):new wM(t.substring(2),16)}function IM(e,t,n){const r={fault:e,operation:t};return null!=n&&(r.value=n),_M.throwError(e,vM.errors.NUMERIC_FAULT,r)}const OM=new vM("bignumber/5.7.0"),xM={},CM=AM.from(0),MM=AM.from(-1);function PM(e,t,n,r){const i={fault:t,operation:n};return void 0!==r&&(i.value=r),OM.throwError(e,vM.errors.NUMERIC_FAULT,i)}let NM="0";for(;NM.length<256;)NM+=NM;function BM(e){if("number"!=typeof e)try{e=AM.from(e).toNumber()}catch(e){}return"number"==typeof e&&e>=0&&e<=256&&!(e%1)?"1"+NM.substring(0,e):OM.throwArgumentError("invalid decimal size","decimals",e)}function DM(e,t){null==t&&(t=0);const n=BM(t),r=(e=AM.from(e)).lt(CM);r&&(e=e.mul(MM));let i=e.mod(n).toString();for(;i.length<n.length-1;)i="0"+i;i=i.match(/^([0-9]*[1-9]|0)(0*)/)[1];const a=e.div(n).toString();return e=1===n.length?a:a+"."+i,r&&(e="-"+e),e}function FM(e,t){null==t&&(t=0);const n=BM(t);"string"==typeof e&&e.match(/^-?[0-9.]+$/)||OM.throwArgumentError("invalid decimal value","value",e);const r="-"===e.substring(0,1);r&&(e=e.substring(1)),"."===e&&OM.throwArgumentError("missing value","value",e);const i=e.split(".");i.length>2&&OM.throwArgumentError("too many decimal points","value",e);let a=i[0],o=i[1];for(a||(a="0"),o||(o="0");"0"===o[o.length-1];)o=o.substring(0,o.length-1);for(o.length>n.length-1&&PM("fractional component exceeds decimals","underflow","parseFixed"),""===o&&(o="0");o.length<n.length-1;)o+="0";const s=AM.from(a),c=AM.from(o);let u=s.mul(n).add(c);return r&&(u=u.mul(MM)),u}let LM=class e{constructor(e,t,n,r){e!==xM&&OM.throwError("cannot use FixedFormat constructor; use FixedFormat.from",vM.errors.UNSUPPORTED_OPERATION,{operation:"new FixedFormat"}),this.signed=t,this.width=n,this.decimals=r,this.name=(t?"":"u")+"fixed"+String(n)+"x"+String(r),this._multiplier=BM(r),Object.freeze(this)}static from(t){if(t instanceof e)return t;"number"==typeof t&&(t=`fixed128x${t}`);let n=!0,r=128,i=18;if("string"==typeof t)if("fixed"===t);else if("ufixed"===t)n=!1;else{const e=t.match(/^(u?)fixed([0-9]+)x([0-9]+)$/);e||OM.throwArgumentError("invalid fixed format","format",t),n="u"!==e[1],r=parseInt(e[2]),i=parseInt(e[3])}else if(t){const e=(e,n,r)=>null==t[e]?r:(typeof t[e]!==n&&OM.throwArgumentError("invalid fixed format ("+e+" not "+n+")","format."+e,t[e]),t[e]);n=e("signed","boolean",n),r=e("width","number",r),i=e("decimals","number",i)}return r%8&&OM.throwArgumentError("invalid fixed format width (not byte aligned)","format.width",r),i>80&&OM.throwArgumentError("invalid fixed format (decimals too large)","format.decimals",i),new e(xM,n,r,i)}},UM=class e{constructor(e,t,n,r){e!==xM&&OM.throwError("cannot use FixedNumber constructor; use FixedNumber.from",vM.errors.UNSUPPORTED_OPERATION,{operation:"new FixedFormat"}),this.format=r,this._hex=t,this._value=n,this._isFixedNumber=!0,Object.freeze(this)}_checkFormat(e){this.format.name!==e.format.name&&OM.throwArgumentError("incompatible format; use fixedNumber.toFormat","other",e)}addUnsafe(t){this._checkFormat(t);const n=FM(this._value,this.format.decimals),r=FM(t._value,t.format.decimals);return e.fromValue(n.add(r),this.format.decimals,this.format)}subUnsafe(t){this._checkFormat(t);const n=FM(this._value,this.format.decimals),r=FM(t._value,t.format.decimals);return e.fromValue(n.sub(r),this.format.decimals,this.format)}mulUnsafe(t){this._checkFormat(t);const n=FM(this._value,this.format.decimals),r=FM(t._value,t.format.decimals);return e.fromValue(n.mul(r).div(this.format._multiplier),this.format.decimals,this.format)}divUnsafe(t){this._checkFormat(t);const n=FM(this._value,this.format.decimals),r=FM(t._value,t.format.decimals);return e.fromValue(n.mul(this.format._multiplier).div(r),this.format.decimals,this.format)}floor(){const t=this.toString().split(".");1===t.length&&t.push("0");let n=e.from(t[0],this.format);const r=!t[1].match(/^(0*)$/);return this.isNegative()&&r&&(n=n.subUnsafe(jM.toFormat(n.format))),n}ceiling(){const t=this.toString().split(".");1===t.length&&t.push("0");let n=e.from(t[0],this.format);const r=!t[1].match(/^(0*)$/);return!this.isNegative()&&r&&(n=n.addUnsafe(jM.toFormat(n.format))),n}round(t){null==t&&(t=0);const n=this.toString().split(".");if(1===n.length&&n.push("0"),(t<0||t>80||t%1)&&OM.throwArgumentError("invalid decimal count","decimals",t),n[1].length<=t)return this;const r=e.from("1"+NM.substring(0,t),this.format),i=qM.toFormat(this.format);return this.mulUnsafe(r).addUnsafe(i).floor().divUnsafe(r)}isZero(){return"0.0"===this._value||"0"===this._value}isNegative(){return"-"===this._value[0]}toString(){return this._value}toHexString(e){if(null==e)return this._hex;e%8&&OM.throwArgumentError("invalid byte width","width",e);return Pr(AM.from(this._hex).fromTwos(this.format.width).toTwos(e).toHexString(),e/8)}toUnsafeFloat(){return parseFloat(this.toString())}toFormat(t){return e.fromString(this._value,t)}static fromValue(t,n,r){return null!=r||null==n||function(e){return null!=e&&(AM.isBigNumber(e)||"number"==typeof e&&e%1==0||"string"==typeof e&&!!e.match(/^-?[0-9]+$/)||Rr(e)||"bigint"==typeof e||wr(e))}(n)||(r=n,n=null),null==n&&(n=0),null==r&&(r="fixed"),e.fromString(DM(t,n),LM.from(r))}static fromString(t,n){null==n&&(n="fixed");const r=LM.from(n),i=FM(t,r.decimals);!r.signed&&i.lt(CM)&&PM("unsigned value cannot be negative","overflow","value",t);let a=null;r.signed?a=i.toTwos(r.width).toHexString():(a=i.toHexString(),a=Pr(a,r.width/8));const o=DM(i,r.decimals);return new e(xM,a,o,r)}static fromBytes(t,n){null==n&&(n="fixed");const r=LM.from(n);if(_r(t).length>r.width/8)throw new Error("overflow");let i=AM.from(t);r.signed&&(i=i.fromTwos(r.width));const a=i.toTwos((r.signed?0:1)+r.width).toHexString(),o=DM(i,r.decimals);return new e(xM,a,o,r)}static from(t,n){if("string"==typeof t)return e.fromString(t,n);if(wr(t))return e.fromBytes(t,n);try{return e.fromValue(t,0,n)}catch(t){if(t.code!==vM.errors.INVALID_ARGUMENT)throw t}return OM.throwArgumentError("invalid FixedNumber value","value",t)}static isFixedNumber(e){return!(!e||!e._isFixedNumber)}};const jM=UM.from(1),qM=UM.from("0.5"),zM=new vM("strings/5.7.0");var HM,GM;function VM(e,t=HM.current){t!=HM.current&&(zM.checkNormalize(),e=e.normalize(t));let n=[];for(let t=0;t<e.length;t++){const r=e.charCodeAt(t);if(r<128)n.push(r);else if(r<2048)n.push(r>>6|192),n.push(63&r|128);else if(55296==(64512&r)){t++;const i=e.charCodeAt(t);if(t>=e.length||56320!=(64512&i))throw new Error("invalid utf-8 string");const a=65536+((1023&r)<<10)+(1023&i);n.push(a>>18|240),n.push(a>>12&63|128),n.push(a>>6&63|128),n.push(63&a|128)}else n.push(r>>12|224),n.push(r>>6&63|128),n.push(63&r|128)}return _r(n)}function KM(e,t){t||(t=function(e){return[parseInt(e,16)]});let n=0,r={};return e.split(",").forEach((e=>{let i=e.split(":");n+=parseInt(i[0],16),r[n]=t(i[1])})),r}function WM(e){let t=0;return e.split(",").map((e=>{let n=e.split("-");1===n.length?n[1]="0":""===n[1]&&(n[1]="1");let r=t+parseInt(n[0],16);return t=parseInt(n[1],16),{l:r,h:t}}))}function XM(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function $M(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?XM(Object(n),!0).forEach((function(t){xO(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):XM(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function JM(e,t,n){return YM.apply(this,arguments)}function YM(){return(YM=JO(tx.mark((function e(t,n,r){var i,a,o,s,c,u,f,d;return tx.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=n.users.map((function(e){return{ether_key:e.user,tokens:e.tokens.map((function(e){return $M({id:e.id,blueprint:e.blueprint},e.royalties&&e.royalties.length>0&&{royalties:e.royalties.map((function(e){return{recipient:e.recipient,percentage:e.percentage}}))})}))}})),a=n.royalties,o=$M($M({contract_address:n.contract_address},a&&a.length>0&&{royalties:a.map((function(e){return{recipient:e.recipient,percentage:e.percentage}}))}),{},{users:i,auth_signature:""}),s=uM(VM(JSON.stringify(o))),e.next=6,ax(s,t);case 6:return c=e.sent,u=$M($M({users:o.users.map((function(e){return{user:e.ether_key,tokens:e.tokens}}))},a&&a.length>0&&{royalties:a}),{},{contract_address:n.contract_address,auth_signature:c}),f={mintTokensRequestV2:[u]},e.next=11,r.mintTokens(f);case 11:return d=e.sent,e.abrupt("return",d.data);case 13:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function QM(e){switch(e.type){case"ERC721":return{type:"ERC721",data:{token_id:e.tokenId,token_address:e.tokenAddress}};case"ERC20":return{type:"ERC20",data:{token_address:e.tokenAddress}};case"ETH":return{type:"ETH",data:{decimals:18}}}}function ZM(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=function(e,t){if(e){if("string"==typeof e)return eP(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?eP(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}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 a,o=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==n.return||n.return()}finally{if(s)throw a}}}}function eP(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function tP(e){return nP.apply(this,arguments)}function nP(){return(nP=JO(tx.mark((function e(t){var n,r,i,a,o,s,c,u,f,d,l,p,h,b,m;return tx.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.ethSigner,i=t.starkSigner,a=t.request,o=t.transfersApi,e.next=3,r.getAddress();case 3:return s=e.sent,c="ERC721"===a.type?"1":a.amount,e.next=7,o.getSignableTransferV1({getSignableTransferRequest:{sender:s,token:QM(a),amount:c,receiver:a.receiver}});case 7:return u=e.sent,f=u.data,d=f.signable_message,l=f.payload_hash,e.next=11,ax(d,r);case 11:return p=e.sent,e.next=14,i.signMessage(l);case 14:return h=e.sent,b={sender_stark_key:u.data.sender_stark_key,sender_vault_id:u.data.sender_vault_id,receiver_stark_key:u.data.receiver_stark_key,receiver_vault_id:u.data.receiver_vault_id,asset_id:u.data.asset_id,amount:u.data.amount,nonce:u.data.nonce,expiration_timestamp:u.data.expiration_timestamp,stark_signature:h},e.next=18,o.createTransferV1({createTransferRequest:b,xImxEthAddress:s,xImxEthSignature:p});case 18:return m=e.sent,e.abrupt("return",{sent_signature:null==m?void 0:m.data.sent_signature,status:null==m||null===(n=m.data.status)||void 0===n?void 0:n.toString(),time:null==m?void 0:m.data.time,transfer_id:null==m?void 0:m.data.transfer_id});case 20:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function rP(e){return iP.apply(this,arguments)}function iP(){return(iP=JO(tx.mark((function e(t){var n,r,i,a,o,s,c,u,f,d,l,p,h,b,m,y,g;return tx.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.ethSigner,r=t.starkSigner,i=t.request,a=t.transfersApi,e.next=3,n.getAddress();case 3:return o=e.sent,s=i.map((function(e){return{amount:"1",token:QM({type:"ERC721",tokenId:e.tokenId,tokenAddress:e.tokenAddress}),receiver:e.receiver}})),e.next=7,a.getSignableTransfer({getSignableTransferRequestV2:{sender_ether_key:o,signable_requests:s}});case 7:if(c=e.sent,void 0!==(u=c.data.signable_message)){e.next=11;break}throw new Error("Invalid response from Signable registration offchain");case 11:return e.next=13,ax(u,n);case 13:f=e.sent,d=[],l=ZM(c.data.signable_responses),e.prev=16,l.s();case 18:if((p=l.n()).done){e.next=27;break}return h=p.value,e.next=22,r.signMessage(h.payload_hash);case 22:b=e.sent,m={sender_vault_id:h.sender_vault_id,receiver_stark_key:h.receiver_stark_key,receiver_vault_id:h.receiver_vault_id,asset_id:h.asset_id,amount:h.amount,nonce:h.nonce,expiration_timestamp:h.expiration_timestamp,stark_signature:b},d.push(m);case 25:e.next=18;break;case 27:e.next=32;break;case 29:e.prev=29,e.t0=e.catch(16),l.e(e.t0);case 32:return e.prev=32,l.f(),e.finish(32);case 35:return y={sender_stark_key:c.data.sender_stark_key,requests:d},e.next=38,a.createTransfer({createTransferRequestV2:y,xImxEthAddress:o,xImxEthSignature:f});case 38:return g=e.sent,e.abrupt("return",{transfer_ids:null==g?void 0:g.data.transfer_ids});case 40:case"end":return e.stop()}}),e,null,[[16,29,32,35]])})))).apply(this,arguments)}!function(e){e.current="",e.NFC="NFC",e.NFD="NFD",e.NFKC="NFKC",e.NFKD="NFKD"}(HM||(HM={})),function(e){e.UNEXPECTED_CONTINUE="unexpected continuation byte",e.BAD_PREFIX="bad codepoint prefix",e.OVERRUN="string overrun",e.MISSING_CONTINUE="missing continuation byte",e.OUT_OF_RANGE="out of UTF-8 range",e.UTF16_SURROGATE="UTF-16 surrogate",e.OVERLONG="overlong representation"}(GM||(GM={})),WM("221,13-1b,5f-,40-10,51-f,11-3,3-3,2-2,2-4,8,2,15,2d,28-8,88,48,27-,3-5,11-20,27-,8,28,3-5,12,18,b-a,1c-4,6-16,2-d,2-2,2,1b-4,17-9,8f-,10,f,1f-2,1c-34,33-14e,4,36-,13-,6-2,1a-f,4,9-,3-,17,8,2-2,5-,2,8-,3-,4-8,2-3,3,6-,16-6,2-,7-3,3-,17,8,3,3,3-,2,6-3,3-,4-a,5,2-6,10-b,4,8,2,4,17,8,3,6-,b,4,4-,2-e,2-4,b-10,4,9-,3-,17,8,3-,5-,9-2,3-,4-7,3-3,3,4-3,c-10,3,7-2,4,5-2,3,2,3-2,3-2,4-2,9,4-3,6-2,4,5-8,2-e,d-d,4,9,4,18,b,6-3,8,4,5-6,3-8,3-3,b-11,3,9,4,18,b,6-3,8,4,5-6,3-6,2,3-3,b-11,3,9,4,18,11-3,7-,4,5-8,2-7,3-3,b-11,3,13-2,19,a,2-,8-2,2-3,7,2,9-11,4-b,3b-3,1e-24,3,2-,3,2-,2-5,5,8,4,2,2-,3,e,4-,6,2,7-,b-,3-21,49,23-5,1c-3,9,25,10-,2-2f,23,6,3,8-2,5-5,1b-45,27-9,2a-,2-3,5b-4,45-4,53-5,8,40,2,5-,8,2,5-,28,2,5-,20,2,5-,8,2,5-,8,8,18,20,2,5-,8,28,14-5,1d-22,56-b,277-8,1e-2,52-e,e,8-a,18-8,15-b,e,4,3-b,5e-2,b-15,10,b-5,59-7,2b-555,9d-3,5b-5,17-,7-,27-,7-,9,2,2,2,20-,36,10,f-,7,14-,4,a,54-3,2-6,6-5,9-,1c-10,13-1d,1c-14,3c-,10-6,32-b,240-30,28-18,c-14,a0,115-,3,66-,b-76,5,5-,1d,24,2,5-2,2,8-,35-2,19,f-10,1d-3,311-37f,1b,5a-b,d7-19,d-3,41,57-,68-4,29-3,5f,29-37,2e-2,25-c,2c-2,4e-3,30,78-3,64-,20,19b7-49,51a7-59,48e-2,38-738,2ba5-5b,222f-,3c-94,8-b,6-4,1b,6,2,3,3,6d-20,16e-f,41-,37-7,2e-2,11-f,5-b,18-,b,14,5-3,6,88-,2,bf-2,7-,7-,7-,4-2,8,8-9,8-2ff,20,5-b,1c-b4,27-,27-cbb1,f7-9,28-2,b5-221,56,48,3-,2-,3-,5,d,2,5,3,42,5-,9,8,1d,5,6,2-2,8,153-3,123-3,33-27fd,a6da-5128,21f-5df,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3,2-1d,61-ff7d"),"ad,34f,1806,180b,180c,180d,200b,200c,200d,2060,feff".split(",").map((e=>parseInt(e,16))),KM("b5:3bc,c3:ff,7:73,2:253,5:254,3:256,1:257,5:259,1:25b,3:260,1:263,2:269,1:268,5:26f,1:272,2:275,7:280,3:283,5:288,3:28a,1:28b,5:292,3f:195,1:1bf,29:19e,125:3b9,8b:3b2,1:3b8,1:3c5,3:3c6,1:3c0,1a:3ba,1:3c1,1:3c3,2:3b8,1:3b5,1bc9:3b9,1c:1f76,1:1f77,f:1f7a,1:1f7b,d:1f78,1:1f79,1:1f7c,1:1f7d,107:63,5:25b,4:68,1:68,1:68,3:69,1:69,1:6c,3:6e,4:70,1:71,1:72,1:72,1:72,7:7a,2:3c9,2:7a,2:6b,1:e5,1:62,1:63,3:65,1:66,2:6d,b:3b3,1:3c0,6:64,1b574:3b8,1a:3c3,20:3b8,1a:3c3,20:3b8,1a:3c3,20:3b8,1a:3c3,20:3b8,1a:3c3"),KM("179:1,2:1,2:1,5:1,2:1,a:4f,a:1,8:1,2:1,2:1,3:1,5:1,3:1,4:1,2:1,3:1,4:1,8:2,1:1,2:2,1:1,2:2,27:2,195:26,2:25,1:25,1:25,2:40,2:3f,1:3f,33:1,11:-6,1:-9,1ac7:-3a,6d:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,b:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,c:-8,2:-8,2:-8,2:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,49:-8,1:-8,1:-4a,1:-4a,d:-56,1:-56,1:-56,1:-56,d:-8,1:-8,f:-8,1:-8,3:-7"),KM("df:00730073,51:00690307,19:02BC006E,a7:006A030C,18a:002003B9,16:03B903080301,20:03C503080301,1d7:05650582,190f:00680331,1:00740308,1:0077030A,1:0079030A,1:006102BE,b6:03C50313,2:03C503130300,2:03C503130301,2:03C503130342,2a:1F0003B9,1:1F0103B9,1:1F0203B9,1:1F0303B9,1:1F0403B9,1:1F0503B9,1:1F0603B9,1:1F0703B9,1:1F0003B9,1:1F0103B9,1:1F0203B9,1:1F0303B9,1:1F0403B9,1:1F0503B9,1:1F0603B9,1:1F0703B9,1:1F2003B9,1:1F2103B9,1:1F2203B9,1:1F2303B9,1:1F2403B9,1:1F2503B9,1:1F2603B9,1:1F2703B9,1:1F2003B9,1:1F2103B9,1:1F2203B9,1:1F2303B9,1:1F2403B9,1:1F2503B9,1:1F2603B9,1:1F2703B9,1:1F6003B9,1:1F6103B9,1:1F6203B9,1:1F6303B9,1:1F6403B9,1:1F6503B9,1:1F6603B9,1:1F6703B9,1:1F6003B9,1:1F6103B9,1:1F6203B9,1:1F6303B9,1:1F6403B9,1:1F6503B9,1:1F6603B9,1:1F6703B9,3:1F7003B9,1:03B103B9,1:03AC03B9,2:03B10342,1:03B1034203B9,5:03B103B9,6:1F7403B9,1:03B703B9,1:03AE03B9,2:03B70342,1:03B7034203B9,5:03B703B9,6:03B903080300,1:03B903080301,3:03B90342,1:03B903080342,b:03C503080300,1:03C503080301,1:03C10313,2:03C50342,1:03C503080342,b:1F7C03B9,1:03C903B9,1:03CE03B9,2:03C90342,1:03C9034203B9,5:03C903B9,ac:00720073,5b:00B00063,6:00B00066,d:006E006F,a:0073006D,1:00740065006C,1:0074006D,124f:006800700061,2:00610075,2:006F0076,b:00700061,1:006E0061,1:03BC0061,1:006D0061,1:006B0061,1:006B0062,1:006D0062,1:00670062,3:00700066,1:006E0066,1:03BC0066,4:0068007A,1:006B0068007A,1:006D0068007A,1:00670068007A,1:00740068007A,15:00700061,1:006B00700061,1:006D00700061,1:006700700061,8:00700076,1:006E0076,1:03BC0076,1:006D0076,1:006B0076,1:006D0076,1:00700077,1:006E0077,1:03BC0077,1:006D0077,1:006B0077,1:006D0077,1:006B03C9,1:006D03C9,2:00620071,3:00632215006B0067,1:0063006F002E,1:00640062,1:00670079,2:00680070,2:006B006B,1:006B006D,9:00700068,2:00700070006D,1:00700072,2:00730076,1:00770062,c723:00660066,1:00660069,1:0066006C,1:006600660069,1:00660066006C,1:00730074,1:00730074,d:05740576,1:05740565,1:0574056B,1:057E0576,1:0574056D",(function(e){if(e.length%4!=0)throw new Error("bad data");let t=[];for(let n=0;n<e.length;n+=4)t.push(parseInt(e.substring(n,n+4),16));return t})),WM("80-20,2a0-,39c,32,f71,18e,7f2-f,19-7,30-4,7-5,f81-b,5,a800-20ff,4d1-1f,110,fa-6,d174-7,2e84-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,2,1f-5f,ff7f-20001");const aP=new vM("units/5.7.0"),oP=["wei","kwei","mwei","gwei","szabo","finney","ether"];function sP(e,t){if("string"!=typeof e&&aP.throwArgumentError("value must be a string","value",e),"string"==typeof t){const e=oP.indexOf(t);-1!==e&&(t=3*e)}return FM(e,null!=t?t:18)}function cP(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function uP(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?cP(Object(n),!0).forEach((function(t){xO(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):cP(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function fP(e,t,n,r,i,a,o){return dP.apply(this,arguments)}function dP(){return(dP=JO(tx.mark((function e(t,n,r,i,a,o,s){var c,u,f;return tx.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t.getAddress();case 2:return c=e.sent,e.next=5,iM(c,i,s);case 5:return u=e.sent,e.next=8,o.populateTransaction.registerAndDepositEth(c,i,u.operator_signature,r,a);case 8:return f=e.sent,e.abrupt("return",t.sendTransaction(uP(uP({},f),{},{value:n})));case 10:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function lP(e,t,n,r,i,a){return pP.apply(this,arguments)}function pP(){return(pP=JO(tx.mark((function e(t,n,r,i,a,o){var s;return tx.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,o.populateTransaction["deposit(uint256,uint256,uint256)"](i,r,a);case 2:return s=e.sent,e.abrupt("return",t.sendTransaction(uP(uP({},s),{},{value:n})));case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function hP(e,t,n,r,i,a){return bP.apply(this,arguments)}function bP(){return(bP=JO(tx.mark((function e(t,n,r,i,a,o){var s,c,u,f,d,l,p,h,b,m,y;return tx.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t.getAddress();case 2:return s=e.sent,c={decimals:18},u=sP(n.amount,"wei"),f={user:s,token:{type:n.type,data:c},amount:u.toString()},e.next=8,r.getSignableDeposit({getSignableDepositRequest:f});case 8:return d=e.sent,e.next=11,a.encodeAsset({assetType:"asset",encodeAssetRequest:{token:{type:n.type}}});case 11:return l=e.sent,p=l.data.asset_type,h=d.data.stark_key,b=d.data.vault_id,m=FO.connect(o.ethConfiguration.coreContractAddress,t),y=WO.connect(o.ethConfiguration.registrationContractAddress,t),e.next=19,nM(h,y);case 19:if(e.sent){e.next=24;break}return e.abrupt("return",fP(t,u,p,h,b,m,i));case 24:return e.abrupt("return",lP(t,u,p,h,b,m));case 25:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function mP(e,t,n,r,i,a){return yP.apply(this,arguments)}function yP(){return(yP=JO(tx.mark((function e(t,n,r,i,a,o){var s;return tx.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,o.populateTransaction.depositERC20(i,r,a,n);case 2:return s=e.sent,e.abrupt("return",t.sendTransaction(s));case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function gP(e,t,n,r,i,a,o){return vP.apply(this,arguments)}function vP(){return(vP=JO(tx.mark((function e(t,n,r,i,a,o,s){var c,u,f;return tx.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t.getAddress();case 2:return c=e.sent,e.next=5,iM(c,i,s);case 5:return u=e.sent,e.next=8,o.populateTransaction.registerAndDepositERC20(c,i,u.operator_signature,r,a,n);case 8:return f=e.sent,e.abrupt("return",t.sendTransaction(f));case 10:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function wP(e,t,n,r,i,a,o){return _P.apply(this,arguments)}function _P(){return(_P=JO(tx.mark((function e(t,n,r,i,a,o,s){var c,u,f,d,l,p,h,b,m,y,g,v,w,_,E,T;return tx.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t.getAddress();case 2:return c=e.sent,e.next=5,a.getToken({address:n.tokenAddress});case 5:return u=e.sent,f=parseInt(u.data.decimals),d={decimals:f,token_address:n.tokenAddress},l=sP(n.amount,0),p=MO.connect(n.tokenAddress,t),e.next=12,p.populateTransaction.approve(s.ethConfiguration.coreContractAddress,l);case 12:return h=e.sent,e.next=15,t.sendTransaction(h);case 15:return b={user:c,token:{type:n.type,data:d},amount:l.toString()},e.next=18,r.getSignableDeposit({getSignableDepositRequest:b});case 18:return m=e.sent,e.next=21,o.encodeAsset({assetType:"asset",encodeAssetRequest:{token:{type:n.type,data:{token_address:n.tokenAddress}}}});case 21:return y=e.sent,g=y.data.asset_type,v=m.data.stark_key,w=m.data.vault_id,_=AM.from(m.data.amount),E=FO.connect(s.ethConfiguration.coreContractAddress,t),T=WO.connect(s.ethConfiguration.registrationContractAddress,t),e.next=30,nM(v,T);case 30:if(e.sent){e.next=35;break}return e.abrupt("return",gP(t,_,g,v,w,E,i));case 35:return e.abrupt("return",mP(t,_,g,v,w,E));case 36:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function EP(e,t,n,r,i,a){return TP.apply(this,arguments)}function TP(){return(TP=JO(tx.mark((function e(t,n,r,i,a,o){var s;return tx.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,o.populateTransaction.depositNft(i,r,a,n);case 2:return s=e.sent,e.abrupt("return",t.sendTransaction(s));case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function AP(e,t,n,r,i,a){return RP.apply(this,arguments)}function RP(){return(RP=JO(tx.mark((function e(t,n,r,i,a,o){var s,c,u,f,d,l,p,h,b,m,y,g,v,w;return tx.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t.getAddress();case 2:return s=e.sent,c={token_address:n.tokenAddress,token_id:n.tokenId},u={user:s,token:{type:n.type,data:c},amount:"1".toString()},e.next=8,r.getSignableDeposit({getSignableDepositRequest:u});case 8:return f=e.sent,e.next=11,a.encodeAsset({assetType:"asset",encodeAssetRequest:{token:{type:n.type,data:{token_address:n.tokenAddress,token_id:n.tokenId}}}});case 11:return d=e.sent,l=d.data.asset_type,p=f.data.stark_key,h=f.data.vault_id,b=FO.connect(o.ethConfiguration.coreContractAddress,t),m=WO.connect(o.ethConfiguration.registrationContractAddress,t),e.next=19,nM(p,m);case 19:return y=e.sent,g=NO.connect(n.tokenAddress,t),v=o.ethConfiguration.coreContractAddress,e.next=24,g.isApprovedForAll(s,v);case 24:if(e.sent){e.next=28;break}return e.next=28,g.setApprovalForAll(v,!0);case 28:if(y){e.next=34;break}return e.next=31,iM(s,p,i);case 31:return w=e.sent,e.next=34,b.registerUser(s,p,w.operator_signature);case 34:return e.abrupt("return",EP(t,n.tokenId,l,p,h,b));case 35:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var SP=function(e){if(void 0!==e)return e;throw new Error("undefined field exception")};function kP(e){return IP.apply(this,arguments)}function IP(){return(IP=JO(tx.mark((function e(t){var n,r,i,a,o,s,c,u,f,d,l,p,h;return tx.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.ethSigner,r=t.starkSigner,i=t.withdrawalsApi,a="ERC721"===t.type?"1":t.amount,e.t0=i,e.next=5,n.getAddress();case 5:return e.t1=e.sent,e.t2=QM(t),e.t3=a,e.t4={user:e.t1,token:e.t2,amount:e.t3},e.t5={getSignableWithdrawalRequest:e.t4},e.next=12,e.t0.getSignableWithdrawal.call(e.t0,e.t5);case 12:return o=e.sent,s=o.data,c=s.signable_message,u=s.payload_hash,e.next=16,r.signMessage(u);case 16:return f=e.sent,e.next=19,ux(c,n);case 19:return d=e.sent,l=d.ethAddress,p=d.ethSignature,e.next=24,i.createWithdrawal({createWithdrawalRequest:{stark_key:SP(o.data.stark_key),amount:a,asset_id:SP(o.data.asset_id),vault_id:SP(o.data.vault_id),nonce:SP(o.data.nonce),stark_signature:f},xImxEthAddress:l,xImxEthSignature:p});case 24:return h=e.sent,e.abrupt("return",h.data);case 26:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function OP(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function xP(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?OP(Object(n),!0).forEach((function(t){xO(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):OP(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function CP(e,t,n,r){return MP.apply(this,arguments)}function MP(){return(MP=JO(tx.mark((function e(t,n,r,i){var a;return tx.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,r.encodeAsset({assetType:t,encodeAssetRequest:{token:xP({type:n},i&&{data:i})}});case 2:return a=e.sent,e.abrupt("return",a.data);case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function PP(e,t,n,r,i){return NP.apply(this,arguments)}function NP(){return(NP=JO(tx.mark((function e(t,n,r,i,a){var o,s,c;return tx.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t.getAddress();case 2:return o=e.sent,e.next=5,iM(o,r,a);case 5:return s=e.sent,e.next=8,i.populateTransaction.registerAndWithdraw(o,r,s.operator_signature,n);case 8:return c=e.sent,e.abrupt("return",t.sendTransaction(c));case 10:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function BP(e,t,n,r){return DP.apply(this,arguments)}function DP(){return(DP=JO(tx.mark((function e(t,n,r,i){var a;return tx.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,i.populateTransaction.withdraw(r,n);case 2:return a=e.sent,e.abrupt("return",t.sendTransaction(a));case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function FP(e,t,n,r,i,a){return LP.apply(this,arguments)}function LP(){return(LP=JO(tx.mark((function e(t,n,r,i,a,o){var s,c,u;return tx.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,CP("asset","ERC20",i,{token_address:r.tokenAddress});case 2:return s=e.sent,c=FO.connect(o.ethConfiguration.coreContractAddress,t),u=WO.connect(o.ethConfiguration.registrationContractAddress,t),e.next=7,nM(n,u);case 7:if(e.sent){e.next=12;break}return e.abrupt("return",PP(t,s.asset_type,n,u,a));case 12:return e.abrupt("return",BP(t,s.asset_type,n,c));case 13:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function UP(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function jP(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?UP(Object(n),!0).forEach((function(t){xO(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):UP(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function qP(e,t,n,r,i){return zP.apply(this,arguments)}function zP(){return(zP=JO(tx.mark((function e(t,n,r,i,a){var o;return tx.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,a.populateTransaction.withdrawAndMint(r,n,i);case 2:return o=e.sent,e.abrupt("return",t.sendTransaction(o));case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function HP(e,t,n,r,i,a){return GP.apply(this,arguments)}function GP(){return(GP=JO(tx.mark((function e(t,n,r,i,a,o){var s,c,u;return tx.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t.getAddress();case 2:return s=e.sent,e.next=5,iM(s,r,o);case 5:return c=e.sent,e.next=8,a.populateTransaction.regsiterAndWithdrawAndMint(s,r,c.operator_signature,n,i);case 8:return u=e.sent,e.abrupt("return",t.sendTransaction(u));case 10:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function VP(e){var t=e.data.id,n=e.data.blueprint||"";return Rm(nm("{".concat(t,"}:{").concat(n,"}")))}function KP(e,t,n,r,i,a){return WP.apply(this,arguments)}function WP(){return(WP=JO(tx.mark((function e(t,n,r,i,a,o){var s,c,u,f;return tx.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,CP("mintable-asset","ERC721",i,jP({id:r.data.id,token_address:r.data.tokenAddress},r.data.blueprint&&{blueprint:r.data.blueprint}));case 2:return s=e.sent,c=VP(r),u=FO.connect(o.ethConfiguration.coreContractAddress,t),f=WO.connect(o.ethConfiguration.registrationContractAddress,t),e.next=8,nM(n,f);case 8:if(e.sent){e.next=13;break}return e.abrupt("return",HP(t,s.asset_type,n,c,f,a));case 13:return e.abrupt("return",qP(t,s.asset_type,n,c,u));case 14:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function XP(e,t,n,r,i,a){return $P.apply(this,arguments)}function $P(){return($P=JO(tx.mark((function e(t,n,r,i,a,o){var s,c,u;return tx.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t.getAddress();case 2:return s=e.sent,e.next=5,iM(s,r,o);case 5:return c=e.sent,e.next=8,a.populateTransaction.registerAndWithdrawNft(s,r,c.operator_signature,n,i);case 8:return u=e.sent,e.abrupt("return",t.sendTransaction(u));case 10:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function JP(e,t,n,r,i){return YP.apply(this,arguments)}function YP(){return(YP=JO(tx.mark((function e(t,n,r,i,a){var o;return tx.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,a.populateTransaction.withdrawNft(r,n,i);case 2:return o=e.sent,e.abrupt("return",t.sendTransaction(o));case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function QP(e,t,n,r,i,a){return ZP.apply(this,arguments)}function ZP(){return(ZP=JO(tx.mark((function e(t,n,r,i,a,o){var s,c,u;return tx.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,CP("asset","ERC721",i,{token_id:r.tokenId,token_address:r.tokenAddress});case 2:return s=e.sent,c=FO.connect(o.ethConfiguration.coreContractAddress,t),u=WO.connect(o.ethConfiguration.registrationContractAddress,t),e.next=7,nM(n,u);case 7:if(e.sent){e.next=12;break}return e.abrupt("return",XP(t,s.asset_type,n,r.tokenId,u,a));case 12:return e.abrupt("return",JP(t,s.asset_type,n,r.tokenId,c));case 13:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function eN(e,t,n,r,i,a,o){return tN.apply(this,arguments)}function tN(){return(tN=JO(tx.mark((function e(t,n,r,i,a,o,s){var c,u;return tx.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return c=r.tokenAddress,u=r.tokenId,e.next=4,a.getMintableTokenDetailsByClientTokenId({tokenAddress:c,tokenId:u}).then((function(e){return KP(t,n,{type:"ERC721",data:{id:u,tokenAddress:c,blueprint:e.data.blueprint}},i,o,s)})).catch((function(e){var a;if(404===(null===(a=e.response)||void 0===a?void 0:a.status))return QP(t,n,r,i,o,s);throw e}));case 4:return e.abrupt("return",e.sent);case 5:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function nN(e,t,n,r,i){return rN.apply(this,arguments)}function rN(){return(rN=JO(tx.mark((function e(t,n,r,i,a){var o,s,c;return tx.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t.getAddress();case 2:return o=e.sent,e.next=5,iM(o,r,a);case 5:return s=e.sent,e.next=8,i.populateTransaction.registerAndWithdraw(o,r,s.operator_signature,n);case 8:return c=e.sent,e.abrupt("return",t.sendTransaction(c));case 10:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function iN(e,t,n,r){return aN.apply(this,arguments)}function aN(){return(aN=JO(tx.mark((function e(t,n,r,i){var a;return tx.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,i.populateTransaction.withdraw(r,n);case 2:return a=e.sent,e.abrupt("return",t.sendTransaction(a));case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function oN(e,t,n,r,i){return sN.apply(this,arguments)}function sN(){return(sN=JO(tx.mark((function e(t,n,r,i,a){var o,s,c;return tx.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,CP("asset","ETH",r);case 2:return o=e.sent,s=FO.connect(a.ethConfiguration.coreContractAddress,t),c=WO.connect(a.ethConfiguration.registrationContractAddress,t),e.next=7,nM(n,c);case 7:if(e.sent){e.next=12;break}return e.abrupt("return",nN(t,o.asset_type,n,c,i));case 12:return e.abrupt("return",iN(t,o.asset_type,n,s));case 13:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function cN(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function uN(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?cN(Object(n),!0).forEach((function(t){xO(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):cN(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function fN(e){return dN.apply(this,arguments)}function dN(){return(dN=JO(tx.mark((function e(t){var n,r,i,a,o,s,c,u,f,d,l,p,h,b,m,y,g;return tx.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.ethSigner,r=t.starkSigner,i=t.request,a=t.ordersApi,e.next=3,n.getAddress();case 3:return o=e.sent,s="ERC721"===i.sell.type?"1":i.sell.amount,c="ERC721"===i.buy.type?"1":i.buy.amount,u={user:o,amount_buy:c,token_buy:QM(i.buy),amount_sell:s,token_sell:QM(i.sell),fees:i.fees,expiration_timestamp:i.expiration_timestamp,split_fees:!0},e.next=9,a.getSignableOrder({getSignableOrderRequestV3:u});case 9:return f=e.sent,d=f.data,l=d.signable_message,p=d.payload_hash,e.next=13,ax(l,n);case 13:return h=e.sent,e.next=16,r.signMessage(p);case 16:return b=e.sent,m=f.data,y={createOrderRequest:{amount_buy:m.amount_buy,amount_sell:m.amount_sell,asset_id_buy:m.asset_id_buy,asset_id_sell:m.asset_id_sell,expiration_timestamp:m.expiration_timestamp,include_fees:!0,fees:i.fees,nonce:m.nonce,stark_key:m.stark_key,stark_signature:b,vault_id_buy:m.vault_id_buy,vault_id_sell:m.vault_id_sell},xImxEthAddress:o,xImxEthSignature:h},e.next=21,a.createOrderV3(y);case 21:return g=e.sent,e.abrupt("return",uN({},g.data));case 23:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function lN(e){return pN.apply(this,arguments)}function pN(){return(pN=JO(tx.mark((function e(t){var n,r,i,a,o,s,c,u,f,d,l,p;return tx.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.ethSigner,r=t.starkSigner,i=t.request,a=t.ordersApi,e.next=3,a.getSignableCancelOrderV3({getSignableCancelOrderRequest:{order_id:i.order_id}});case 3:return o=e.sent,s=o.data,c=s.signable_message,u=s.payload_hash,e.next=7,ax(c,n);case 7:return f=e.sent,e.next=10,r.signMessage(u);case 10:return d=e.sent,e.next=13,n.getAddress();case 13:return l=e.sent,e.next=16,a.cancelOrderV3({id:i.order_id.toString(),cancelOrderRequest:{order_id:i.order_id,stark_signature:d},xImxEthAddress:l,xImxEthSignature:f});case 16:return p=e.sent,e.abrupt("return",{order_id:p.data.order_id,status:p.data.status});case 18:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function hN(e){return bN.apply(this,arguments)}function bN(){return(bN=JO(tx.mark((function e(t){var n,r,i,a,o,s,c,u,f,d,l,p;return tx.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.ethSigner,r=t.starkSigner,i=t.request,a=t.tradesApi,e.next=3,n.getAddress();case 3:return o=e.sent,e.next=6,a.getSignableTrade({getSignableTradeRequest:{user:o,order_id:i.order_id,fees:i.fees}});case 6:return s=e.sent,c=s.data,u=c.signable_message,f=c.payload_hash,e.next=10,ax(u,n);case 10:return d=e.sent,e.next=13,r.signMessage(f);case 13:return l=e.sent,e.next=16,a.createTradeV3({createTradeRequest:{amount_buy:s.data.amount_buy,amount_sell:s.data.amount_sell,asset_id_buy:s.data.asset_id_buy,asset_id_sell:s.data.asset_id_sell,expiration_timestamp:s.data.expiration_timestamp,fee_info:s.data.fee_info,fees:i.fees,include_fees:!0,nonce:s.data.nonce,order_id:i.order_id,stark_key:s.data.stark_key,vault_id_buy:s.data.vault_id_buy,vault_id_sell:s.data.vault_id_sell,stark_signature:l},xImxEthAddress:o,xImxEthSignature:d});case 16:return p=e.sent,e.abrupt("return",p.data);case 18:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function mN(e){return yN.apply(this,arguments)}function yN(){return(yN=JO(tx.mark((function e(t){var n,r,i,a,o,s,c,u,f,d,l,p,h,b,m;return tx.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.ethSigner,i=t.starkSigner,a=t.request,o=t.exchangesApi,e.next=3,r.getAddress();case 3:return s=e.sent,c=a.amount,e.next=7,o.getExchangeSignableTransfer({id:a.transactionID,getSignableTransferRequest:{sender:s,token:QM(a),amount:c,receiver:a.receiver}});case 7:return u=e.sent,f=u.data,d=f.signable_message,l=f.payload_hash,e.next=11,ax(d,r);case 11:return p=e.sent,e.next=14,i.signMessage(l);case 14:return h=e.sent,b={sender_stark_key:u.data.sender_stark_key,sender_vault_id:u.data.sender_vault_id,receiver_stark_key:u.data.receiver_stark_key,receiver_vault_id:u.data.receiver_vault_id,asset_id:u.data.asset_id,amount:u.data.amount,nonce:u.data.nonce,expiration_timestamp:u.data.expiration_timestamp,stark_signature:h},e.next=18,o.createExchangeTransfer({id:a.transactionID,createTransferRequest:b,xImxEthAddress:s,xImxEthSignature:p});case 18:return m=e.sent,e.abrupt("return",{sent_signature:null==m?void 0:m.data.sent_signature,status:null==m||null===(n=m.data.status)||void 0===n?void 0:n.toString(),time:null==m?void 0:m.data.time,transfer_id:null==m?void 0:m.data.transfer_id});case 20:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function gN(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function vN(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?gN(Object(n),!0).forEach((function(t){xO(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):gN(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var wN=function(){function e(t){kO(this,e),this.config=t;var n=t.apiConfiguration;this.config=t,this.depositsApi=new eC(n),this.encodingApi=new iC(n),this.mintsApi=new wC(n),this.ordersApi=new IC(n),this.tokensApi=new DC(n),this.tradesApi=new jC(n),this.transfersApi=new GC(n),this.usersApi=new XC(n),this.withdrawalsApi=new QC(n),this.projectsApi=new MC(n),this.collectionsApi=new Jx(n),this.metadataApi=new lC(n),this.metadataRefreshesApi=new mC(n),this.exchangesApi=new cC(n)}var t,n,r,i,a,o,s,c,u,f,d,l,p,h,b,m,y,g,v,w,_,E,T,A,R,S,k,I;return OO(e,[{key:"isChainValid",value:function(e){return e===this.config.ethConfiguration.chainID}},{key:"validateChain",value:(I=JO(tx.mark((function e(t){var n;return tx.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t.getChainId();case 2:if(n=e.sent,this.isChainValid(n)){e.next=5;break}throw new Error("The wallet used for this operation is not from the correct network.");case 5:case"end":return e.stop()}}),e,this)}))),function(e){return I.apply(this,arguments)})},{key:"registerOffchain",value:(k=JO(tx.mark((function e(t){return tx.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.validateChain(t.ethSigner);case 2:return e.abrupt("return",eM(vN(vN({},t),{},{usersApi:this.usersApi})));case 3:case"end":return e.stop()}}),e,this)}))),function(e){return k.apply(this,arguments)})},{key:"isRegisteredOnchain",value:(S=JO(tx.mark((function e(t){var n,r;return tx.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.validateChain(t.ethSigner);case 2:return n=WO.connect(this.config.ethConfiguration.registrationContractAddress,t.ethSigner),e.next=5,t.starkSigner.getAddress();case 5:return r=e.sent,e.abrupt("return",nM(r,n));case 7:case"end":return e.stop()}}),e,this)}))),function(e){return S.apply(this,arguments)})},{key:"mint",value:(R=JO(tx.mark((function e(t,n){return tx.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.validateChain(t);case 2:return e.abrupt("return",JM(t,n,this.mintsApi));case 3:case"end":return e.stop()}}),e,this)}))),function(e,t){return R.apply(this,arguments)})},{key:"transfer",value:(A=JO(tx.mark((function e(t,n){return tx.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.validateChain(t.ethSigner);case 2:return e.abrupt("return",tP(vN(vN({},t),{},{request:n,transfersApi:this.transfersApi})));case 3:case"end":return e.stop()}}),e,this)}))),function(e,t){return A.apply(this,arguments)})},{key:"exchangeTransfer",value:(T=JO(tx.mark((function e(t,n){return tx.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.validateChain(t.ethSigner);case 2:return e.abrupt("return",mN(vN(vN({},t),{},{request:n,exchangesApi:this.exchangesApi})));case 3:case"end":return e.stop()}}),e,this)}))),function(e,t){return T.apply(this,arguments)})},{key:"batchNftTransfer",value:(E=JO(tx.mark((function e(t,n){return tx.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.validateChain(t.ethSigner);case 2:return e.abrupt("return",rP(vN(vN({},t),{},{request:n,transfersApi:this.transfersApi})));case 3:case"end":return e.stop()}}),e,this)}))),function(e,t){return E.apply(this,arguments)})},{key:"deposit",value:(_=JO(tx.mark((function e(t,n){return tx.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:e.t0=n.type,e.next="ETH"===e.t0?3:"ERC20"===e.t0?4:"ERC721"===e.t0?5:6;break;case 3:return e.abrupt("return",this.depositEth(t,n));case 4:return e.abrupt("return",this.depositERC20(t,n));case 5:return e.abrupt("return",this.depositERC721(t,n));case 6:case"end":return e.stop()}}),e,this)}))),function(e,t){return _.apply(this,arguments)})},{key:"depositEth",value:(w=JO(tx.mark((function e(t,n){return tx.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.validateChain(t);case 2:return e.abrupt("return",hP(t,n,this.depositsApi,this.usersApi,this.encodingApi,this.config));case 3:case"end":return e.stop()}}),e,this)}))),function(e,t){return w.apply(this,arguments)})},{key:"depositERC20",value:(v=JO(tx.mark((function e(t,n){return tx.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.validateChain(t);case 2:return e.abrupt("return",wP(t,n,this.depositsApi,this.usersApi,this.tokensApi,this.encodingApi,this.config));case 3:case"end":return e.stop()}}),e,this)}))),function(e,t){return v.apply(this,arguments)})},{key:"depositERC721",value:(g=JO(tx.mark((function e(t,n){return tx.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.validateChain(t);case 2:return e.abrupt("return",AP(t,n,this.depositsApi,this.usersApi,this.encodingApi,this.config));case 3:case"end":return e.stop()}}),e,this)}))),function(e,t){return g.apply(this,arguments)})},{key:"prepareWithdrawal",value:(y=JO(tx.mark((function e(t,n){return tx.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.validateChain(t.ethSigner);case 2:return e.abrupt("return",kP(vN(vN(vN({},t),n),{},{withdrawalsApi:this.withdrawalsApi})));case 3:case"end":return e.stop()}}),e,this)}))),function(e,t){return y.apply(this,arguments)})},{key:"completeWithdrawal",value:function(e,t,n){switch(n.type){case"ETH":return this.completeEthWithdrawal(e,t);case"ERC20":return this.completeERC20Withdrawal(e,t,n);case"ERC721":return this.completeERC721Withdrawal(e,t,n)}}},{key:"completeEthWithdrawal",value:(m=JO(tx.mark((function e(t,n){return tx.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.validateChain(t);case 2:return e.abrupt("return",oN(t,n,this.encodingApi,this.usersApi,this.config));case 3:case"end":return e.stop()}}),e,this)}))),function(e,t){return m.apply(this,arguments)})},{key:"completeERC20Withdrawal",value:(b=JO(tx.mark((function e(t,n,r){return tx.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.validateChain(t);case 2:return e.abrupt("return",FP(t,n,r,this.encodingApi,this.usersApi,this.config));case 3:case"end":return e.stop()}}),e,this)}))),function(e,t,n){return b.apply(this,arguments)})},{key:"completeERC721Withdrawal",value:function(){var e=JO(tx.mark((function e(t,n,r){return tx.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.validateChain(t);case 2:return e.abrupt("return",eN(t,n,r,this.encodingApi,this.mintsApi,this.usersApi,this.config));case 3:case"end":return e.stop()}}),e,this)})));return function(t,n,r){return e.apply(this,arguments)}}()},{key:"createOrder",value:(h=JO(tx.mark((function e(t,n){return tx.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.validateChain(t.ethSigner);case 2:return e.abrupt("return",fN(vN(vN({},t),{},{request:n,ordersApi:this.ordersApi})));case 3:case"end":return e.stop()}}),e,this)}))),function(e,t){return h.apply(this,arguments)})},{key:"cancelOrder",value:(p=JO(tx.mark((function e(t,n){return tx.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.validateChain(t.ethSigner);case 2:return e.abrupt("return",lN(vN(vN({},t),{},{request:n,ordersApi:this.ordersApi})));case 3:case"end":return e.stop()}}),e,this)}))),function(e,t){return p.apply(this,arguments)})},{key:"createTrade",value:(l=JO(tx.mark((function e(t,n){return tx.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.validateChain(t.ethSigner);case 2:return e.abrupt("return",hN(vN(vN({},t),{},{request:n,tradesApi:this.tradesApi})));case 3:case"end":return e.stop()}}),e,this)}))),function(e,t){return l.apply(this,arguments)})},{key:"createProject",value:(d=JO(tx.mark((function e(t,n){var r;return tx.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,sx(t);case 2:return r=e.sent,e.abrupt("return",this.projectsApi.createProject({iMXSignature:r.signature,iMXTimestamp:r.timestamp,createProjectRequest:n}));case 4:case"end":return e.stop()}}),e,this)}))),function(e,t){return d.apply(this,arguments)})},{key:"getProject",value:(f=JO(tx.mark((function e(t,n){var r;return tx.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,sx(t);case 2:return r=e.sent,e.abrupt("return",this.projectsApi.getProject({id:n,iMXSignature:r.signature,iMXTimestamp:r.timestamp}));case 4:case"end":return e.stop()}}),e,this)}))),function(e,t){return f.apply(this,arguments)})},{key:"getProjects",value:(u=JO(tx.mark((function e(t,n,r,i,a){var o;return tx.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,sx(t);case 2:return o=e.sent,e.abrupt("return",this.projectsApi.getProjects({iMXSignature:o.signature,iMXTimestamp:o.timestamp,pageSize:n,cursor:r,orderBy:i,direction:a}));case 4:case"end":return e.stop()}}),e,this)}))),function(e,t,n,r,i){return u.apply(this,arguments)})},{key:"createCollection",value:(c=JO(tx.mark((function e(t,n){var r;return tx.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,sx(t);case 2:return r=e.sent,e.abrupt("return",this.collectionsApi.createCollection({iMXSignature:r.signature,iMXTimestamp:r.timestamp,createCollectionRequest:n}));case 4:case"end":return e.stop()}}),e,this)}))),function(e,t){return c.apply(this,arguments)})},{key:"updateCollection",value:(s=JO(tx.mark((function e(t,n,r){var i;return tx.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,sx(t);case 2:return i=e.sent,e.abrupt("return",this.collectionsApi.updateCollection({iMXSignature:i.signature,iMXTimestamp:i.timestamp,address:n,updateCollectionRequest:r}));case 4:case"end":return e.stop()}}),e,this)}))),function(e,t,n){return s.apply(this,arguments)})},{key:"addMetadataSchemaToCollection",value:(o=JO(tx.mark((function e(t,n,r){var i;return tx.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,sx(t);case 2:return i=e.sent,e.abrupt("return",this.metadataApi.addMetadataSchemaToCollection({iMXSignature:i.signature,iMXTimestamp:i.timestamp,addMetadataSchemaToCollectionRequest:r,address:n}));case 4:case"end":return e.stop()}}),e,this)}))),function(e,t,n){return o.apply(this,arguments)})},{key:"updateMetadataSchemaByName",value:(a=JO(tx.mark((function e(t,n,r,i){var a;return tx.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,sx(t);case 2:return a=e.sent,e.abrupt("return",this.metadataApi.updateMetadataSchemaByName({iMXSignature:a.signature,iMXTimestamp:a.timestamp,address:n,name:r,metadataSchemaRequest:i}));case 4:case"end":return e.stop()}}),e,this)}))),function(e,t,n,r){return a.apply(this,arguments)})},{key:"listMetadataRefreshes",value:(i=JO(tx.mark((function e(t,n,r,i){var a,o;return tx.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,sx(t);case 2:return a=e.sent,e.next=5,t.getAddress();case 5:return o=e.sent,e.abrupt("return",this.metadataRefreshesApi.getAListOfMetadataRefreshes({xImxEthSignature:a.signature,xImxEthTimestamp:a.timestamp,xImxEthAddress:o,collectionAddress:n,pageSize:r,cursor:i}));case 7:case"end":return e.stop()}}),e,this)}))),function(e,t,n,r){return i.apply(this,arguments)})},{key:"getMetadataRefreshErrors",value:(r=JO(tx.mark((function e(t,n,r,i){var a,o;return tx.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,sx(t);case 2:return a=e.sent,e.next=5,t.getAddress();case 5:return o=e.sent,e.abrupt("return",this.metadataRefreshesApi.getMetadataRefreshErrors({xImxEthSignature:a.signature,xImxEthTimestamp:a.timestamp,xImxEthAddress:o,refreshId:n,pageSize:r,cursor:i}));case 7:case"end":return e.stop()}}),e,this)}))),function(e,t,n,i){return r.apply(this,arguments)})},{key:"getMetadataRefreshResults",value:(n=JO(tx.mark((function e(t,n){var r,i;return tx.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,sx(t);case 2:return r=e.sent,e.next=5,t.getAddress();case 5:return i=e.sent,e.abrupt("return",this.metadataRefreshesApi.getMetadataRefreshResults({xImxEthSignature:r.signature,xImxEthTimestamp:r.timestamp,xImxEthAddress:i,refreshId:n}));case 7:case"end":return e.stop()}}),e,this)}))),function(e,t){return n.apply(this,arguments)})},{key:"createMetadataRefresh",value:(t=JO(tx.mark((function e(t,n){var r,i;return tx.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,sx(t);case 2:return r=e.sent,e.next=5,t.getAddress();case 5:return i=e.sent,e.abrupt("return",this.metadataRefreshesApi.requestAMetadataRefresh({xImxEthSignature:r.signature,xImxEthTimestamp:r.timestamp,xImxEthAddress:i,createMetadataRefreshRequest:n}));case 7:case"end":return e.stop()}}),e,this)}))),function(e,n){return t.apply(this,arguments)})}]),e}();var _N=function(e){qO(n,Sx(Error));var t=function(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=LO(e);if(t){var i=LO(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return GO(this,n)}}(n);function n(e){var r,i=e.code,a=e.details,o=e.message;return kO(this,n),(r=t.call(this,o)).code=i,r.details=a,r}return OO(n)}();function EN(e){if(SO.isAxiosError(e)&&e.response){var t,n,r,i=e.response.data;return i.code&&i.message?new _N({code:i.code,details:i.details,message:i.message}):new _N({code:null!==(t=null!==(n=e.code)&&void 0!==n?n:null===(r=e.response)||void 0===r?void 0:r.status.toString())&&void 0!==t?t:"unknown_error_code",message:String(e)})}return new _N({code:"unknown_error_code",message:String(e)})}var TN=function(){function e(t){kO(this,e),this.depositsApi=new eC(t.apiConfiguration),this.mintsApi=new wC(t.apiConfiguration),this.ordersApi=new IC(t.apiConfiguration),this.tokensApi=new DC(t.apiConfiguration),this.tradesApi=new jC(t.apiConfiguration),this.transfersApi=new GC(t.apiConfiguration),this.exchangeApi=new cC(t.apiConfiguration),this.usersApi=new XC(t.apiConfiguration),this.withdrawalsApi=new QC(t.apiConfiguration),this.balanceApi=new Kx(t.apiConfiguration),this.assetApi=new zx(t.apiConfiguration),this.collectionApi=new Jx(t.apiConfiguration),this.metadataApi=new lC(t.apiConfiguration),this.metadataRefreshesApi=new mC(t.apiConfiguration),this.nftCheckoutPrimaryApi=new AC(t.apiConfiguration),this.projectsApi=new MC(t.apiConfiguration),this.workflows=new wN(t)}var t,n,r;return OO(e,[{key:"deposit",value:function(e,t){return this.workflows.deposit(e,t).catch((function(e){throw EN(e)}))}},{key:"getDeposit",value:function(e){return this.depositsApi.getDeposit(e).then((function(e){return e.data})).catch((function(e){throw EN(e)}))}},{key:"listDeposits",value:function(e){return this.depositsApi.listDeposits(e).then((function(e){return e.data})).catch((function(e){throw EN(e)}))}},{key:"registerOffchain",value:function(e){return this.workflows.registerOffchain(e).catch((function(e){throw EN(e)}))}},{key:"isRegisteredOnchain",value:function(e){return this.workflows.isRegisteredOnchain(e).catch((function(e){throw EN(e)}))}},{key:"getUser",value:function(e){return this.usersApi.getUsers({user:e}).then((function(e){return e.data})).catch((function(e){throw EN(e)}))}},{key:"getAsset",value:function(e){return this.assetApi.getAsset(e).then((function(e){return e.data})).catch((function(e){throw EN(e)}))}},{key:"listAssets",value:function(e){return this.assetApi.listAssets(e).then((function(e){return e.data})).catch((function(e){throw EN(e)}))}},{key:"createCollection",value:function(e,t){return this.workflows.createCollection(e,t).then((function(e){return e.data})).catch((function(e){throw EN(e)}))}},{key:"getCollection",value:function(e){return this.collectionApi.getCollection(e).then((function(e){return e.data})).catch((function(e){throw EN(e)}))}},{key:"listCollectionFilters",value:function(e){return this.collectionApi.listCollectionFilters(e).then((function(e){return e.data})).catch((function(e){throw EN(e)}))}},{key:"listCollections",value:function(e){return this.collectionApi.listCollections(e).then((function(e){return e.data})).catch((function(e){throw EN(e)}))}},{key:"updateCollection",value:function(e,t,n){return this.workflows.updateCollection(e,t,n).then((function(e){return e.data})).catch((function(e){throw EN(e)}))}},{key:"addMetadataSchemaToCollection",value:function(e,t,n){return this.workflows.addMetadataSchemaToCollection(e,t,n).then((function(e){return e.data})).catch((function(e){throw EN(e)}))}},{key:"getMetadataSchema",value:function(e){return this.metadataApi.getMetadataSchema(e).then((function(e){return e.data})).catch((function(e){throw EN(e)}))}},{key:"updateMetadataSchemaByName",value:function(e,t,n,r){return this.workflows.updateMetadataSchemaByName(e,t,n,r).then((function(e){return e.data})).catch((function(e){throw EN(e)}))}},{key:"listMetadataRefreshes",value:function(e,t,n,r){return this.workflows.listMetadataRefreshes(e,t,n,r).then((function(e){return e.data})).catch((function(e){throw EN(e)}))}},{key:"getMetadataRefreshErrors",value:function(e,t,n,r){return this.workflows.getMetadataRefreshErrors(e,t,n,r).then((function(e){return e.data})).catch((function(e){throw EN(e)}))}},{key:"getMetadataRefreshResults",value:function(e,t){return this.workflows.getMetadataRefreshResults(e,t).then((function(e){return e.data})).catch((function(e){throw EN(e)}))}},{key:"createMetadataRefresh",value:function(e,t){return this.workflows.createMetadataRefresh(e,t).then((function(e){return e.data})).catch((function(e){throw EN(e)}))}},{key:"createProject",value:(r=JO(tx.mark((function e(t,n){return tx.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.workflows.createProject(t,n).then((function(e){return e.data})).catch((function(e){throw EN(e)})));case 1:case"end":return e.stop()}}),e,this)}))),function(e,t){return r.apply(this,arguments)})},{key:"getProject",value:(n=JO(tx.mark((function e(t,n){return tx.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.workflows.getProject(t,n).then((function(e){return e.data})).catch((function(e){throw EN(e)})));case 1:case"end":return e.stop()}}),e,this)}))),function(e,t){return n.apply(this,arguments)})},{key:"getProjects",value:(t=JO(tx.mark((function e(t,n,r,i,a){return tx.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.workflows.getProjects(t,n,r,i,a).then((function(e){return e.data})).catch((function(e){throw EN(e)})));case 1:case"end":return e.stop()}}),e,this)}))),function(e,n,r,i,a){return t.apply(this,arguments)})},{key:"getBalance",value:function(e){return this.balanceApi.getBalance(e).then((function(e){return e.data})).catch((function(e){throw EN(e)}))}},{key:"listBalances",value:function(e){return this.balanceApi.listBalances(e).then((function(e){return e.data})).catch((function(e){throw EN(e)}))}},{key:"getMint",value:function(e){return this.mintsApi.getMint(e).then((function(e){return e.data})).catch((function(e){throw EN(e)}))}},{key:"listMints",value:function(e){return this.mintsApi.listMints(e).then((function(e){return e.data})).catch((function(e){throw EN(e)}))}},{key:"mint",value:function(e,t){return this.workflows.mint(e,t).catch((function(e){throw EN(e)}))}},{key:"listWithdrawals",value:function(e){return this.withdrawalsApi.listWithdrawals(e).then((function(e){return e.data})).catch((function(e){throw EN(e)}))}},{key:"getWithdrawal",value:function(e){return this.withdrawalsApi.getWithdrawal(e).then((function(e){return e.data})).catch((function(e){throw EN(e)}))}},{key:"prepareWithdrawal",value:function(e,t){return this.workflows.prepareWithdrawal(e,t).catch((function(e){throw EN(e)}))}},{key:"completeWithdrawal",value:function(e,t,n){return this.workflows.completeWithdrawal(e,t,n).catch((function(e){throw EN(e)}))}},{key:"getOrder",value:function(e){return this.ordersApi.getOrderV3(e).then((function(e){return e.data})).catch((function(e){throw EN(e)}))}},{key:"listOrders",value:function(e){return this.ordersApi.listOrdersV3(e).then((function(e){return e.data})).catch((function(e){throw EN(e)}))}},{key:"createOrder",value:function(e,t){return this.workflows.createOrder(e,t).catch((function(e){throw EN(e)}))}},{key:"cancelOrder",value:function(e,t){return this.workflows.cancelOrder(e,t).catch((function(e){throw EN(e)}))}},{key:"getTrade",value:function(e){return this.tradesApi.getTrade(e).then((function(e){return e.data})).catch((function(e){throw EN(e)}))}},{key:"listTrades",value:function(e){return this.tradesApi.listTradesV3(e).then((function(e){return e.data})).catch((function(e){throw EN(e)}))}},{key:"createTrade",value:function(e,t){return this.workflows.createTrade(e,t).catch((function(e){throw EN(e)}))}},{key:"getToken",value:function(e){return this.tokensApi.getToken(e).then((function(e){return e.data})).catch((function(e){throw EN(e)}))}},{key:"listTokens",value:function(e){return this.tokensApi.listTokens(e).then((function(e){return e.data})).catch((function(e){throw EN(e)}))}},{key:"getTransfer",value:function(e){return this.transfersApi.getTransfer(e).then((function(e){return e.data})).catch((function(e){throw EN(e)}))}},{key:"listTransfers",value:function(e){return this.transfersApi.listTransfers(e).then((function(e){return e.data})).catch((function(e){throw EN(e)}))}},{key:"transfer",value:function(e,t){return this.workflows.transfer(e,t).catch((function(e){throw EN(e)}))}},{key:"batchNftTransfer",value:function(e,t){return this.workflows.batchNftTransfer(e,t).catch((function(e){throw EN(e)}))}},{key:"createExchange",value:function(e){return this.exchangeApi.createExchange(e).catch((function(e){throw EN(e)}))}},{key:"getExchange",value:function(e){return this.exchangeApi.getExchange(e).catch((function(e){throw EN(e)}))}},{key:"getExchanges",value:function(e){return this.exchangeApi.getExchanges(e).catch((function(e){throw EN(e)}))}},{key:"exchangeTransfer",value:function(e,t){return this.workflows.exchangeTransfer(e,t).catch((function(e){throw EN(e)}))}},{key:"createNftPrimary",value:function(e){return this.nftCheckoutPrimaryApi.createNftPrimary(e).catch((function(e){throw EN(e)}))}},{key:"getCurrenciesNFTCheckoutPrimary",value:function(e){return this.nftCheckoutPrimaryApi.getCurrenciesNFTCheckoutPrimary(e).catch((function(e){throw EN(e)}))}},{key:"getNftPrimaryTransaction",value:function(e){return this.nftCheckoutPrimaryApi.getNftPrimaryTransaction(e).catch((function(e){throw EN(e)}))}},{key:"getNftPrimaryTransactions",value:function(e){return this.nftCheckoutPrimaryApi.getNftPrimaryTransactions(e).catch((function(e){throw EN(e)}))}}]),e}();function AN(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function RN(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?AN(Object(n),!0).forEach((function(t){xO(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):AN(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}var SN={"x-sdk-version":"imx-core-sdk-ts-".concat("2.0.2")},kN=function(e){var t=e.coreContractAddress,n=e.registrationContractAddress,r=e.chainID,i=e.basePath,a=e.headers,o=e.sdkVersion;if(!i.trim())throw Error("basePath can not be empty");return o&&(SN["x-sdk-version"]=o),a=RN(RN({},a||{}),SN),{apiConfiguration:new ZC({basePath:i,baseOptions:{headers:a}}),ethConfiguration:{coreContractAddress:t,registrationContractAddress:n,chainID:r}}},IN={get PRODUCTION(){return kN({basePath:"https://api.x.immutable.com",chainID:1,coreContractAddress:"0x5FDCCA53617f4d2b9134B29090C87D01058e27e9",registrationContractAddress:"0x72a06bf2a1CE5e39cBA06c0CAb824960B587d64c"})},get SANDBOX(){return kN({basePath:"https://api.sandbox.x.immutable.com",chainID:5,coreContractAddress:"0x7917eDb51ecD6CdB3F9854c3cc593F33de10c623",registrationContractAddress:"0x1C97Ada273C9A52253f463042f29117090Cd7D83"})},createConfig:kN},ON=new rr("08000000 00000010 ffffffff ffffffff b781126d cae7b232 1e66a241 adc64d2f",16);new Im.ec(new Im.curves.PresetCurve({type:"short",prime:null,p:"08000000 00000011 00000000 00000000 00000000 00000000 00000000 00000001",a:"00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000001",b:"06f21413 efbe40de 150e596d 72f7a8c5 609ad26c 15c915c1 f4cdfcb9 9cee9e89",n:ON.toString("hex"),hash:Lu.sha256,gRed:!1,g:["1ef15c18599971b7beced415a40f0c7deacfd9b0d1819e03d723d8bc943cfca","5668060aa49730b7be4801df46ec62de53ecd11abe43a32873000c36e8dc1f"]}));var xN=function(){var e=new rr("1 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000",16);return e.sub(e.mod(ON))};function CN(e,t){return new rr(Lu.sha256().update(Jb(Em(e)+gm(rm(t),2))).digest("hex"),16)}function MN(e){for(var t=xN(),n=CN(e.toString("hex",64),0),r=0;n.gte(t);r++)n=CN(n.toString("hex"),r);return n.umod(ON).toString("hex")}function PN(e){for(var t=xN(),n=CN(e.toString("hex",64),0),r=1;n.gte(t);r++)n=CN(n.toString("hex"),r);return n.umod(ON).toString("hex")}function NN(e){var t=xN();return CN(e.toString("hex",64),0).gte(t)}function BN(e){return DN.apply(this,arguments)}function DN(){return(DN=JO(tx.mark((function e(t){var n,r;return tx.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,n=new TN(IN.PRODUCTION),e.next=4,n.getUser(t);case 4:if(!((r=e.sent).accounts.length>0)){e.next=7;break}return e.abrupt("return",{starkPublicKey:r.accounts[0],accountNotFound:!1});case 7:e.next=14;break;case 9:if(e.prev=9,e.t0=e.catch(0),!(e.t0 instanceof _N&&"account_not_found"==e.t0.code)){e.next=13;break}return e.abrupt("return",{starkPublicKey:"",accountNotFound:!0});case 13:throw e.t0;case 14:case"end":return e.stop()}}),e,null,[[0,9]])})))).apply(this,arguments)}function FN(e,t){var n=qk.hdkey.fromMasterSeed(Buffer.from(e.slice(2),"hex")).derivePath(t).getWallet().getPrivateKey();return new rr(n)}function LN(e,t,n){return UN.apply(this,arguments)}function UN(){return(UN=JO(tx.mark((function e(t,n,r){var i,a,o,s,c,u,f,d;return tx.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=FN(t,n),a=PN(i),NN(i)){e.next=4;break}return e.abrupt("return",a);case 4:return e.next=6,BN(r);case 6:if(void 0!==(o=e.sent)){e.next=9;break}throw new Error("Error fetching stark public key from IMX");case 9:if(!o.accountNotFound){e.next=11;break}return e.abrupt("return",a);case 11:return s=new rr(Em(o.starkPublicKey),16),e.next=14,Ax(a).getAddress();case 14:if(c=e.sent,!s.eq(new rr(Em(c),16))){e.next=17;break}return e.abrupt("return",a);case 17:return u=MN(i),e.next=20,Ax(u).getAddress();case 20:if(c=e.sent,!s.eq(new rr(Em(c),16))){e.next=23;break}return e.abrupt("return",u);case 23:return f=Ex(t,n),d=_x(f),e.next=27,Ax(d).getAddress();case 27:if(c=e.sent,!s.eq(new rr(Em(c),16))){e.next=30;break}return e.abrupt("return",d);case 30:throw new Error("Can not deterministically generate stark private key - please contact support");case 31:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function jN(e){return qN.apply(this,arguments)}function qN(){return(qN=JO(tx.mark((function e(t){var n,r,i,a,o;return tx.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t.getAddress();case 2:return n=e.sent.toLowerCase(),e.next=5,t.signMessage("Only sign this request if you’ve initiated an action with Immutable X.");case 5:return r=e.sent,i=Nr(r).s,a=vx("starkex","immutablex",n,"1"),e.next=10,LN(i,a,n);case 10:return o=e.sent,e.abrupt("return",o.padStart(64,"0"));case 12:case"end":return e.stop()}}),e)})))).apply(this,arguments)}vM.errors.INSUFFICIENT_FUNDS,vM.errors.NONCE_EXPIRED,vM.errors.REPLACEMENT_UNDERPRICED;const zN=({basePath:e,chainID:t,coreContractAddress:n,registrationContractAddress:r})=>IN.createConfig({basePath:e,chainID:t,coreContractAddress:n,registrationContractAddress:r,sdkVersion:"ts-immutable-sdk-0.21.0"}),HN=()=>zN({basePath:"https://api.sandbox.x.immutable.com",chainID:5,coreContractAddress:"0x7917eDb51ecD6CdB3F9854c3cc593F33de10c623",registrationContractAddress:"0x1C97Ada273C9A52253f463042f29117090Cd7D83"});class GN{immutableXConfig;baseConfig;constructor({baseConfig:e,overrides:n}){if(this.baseConfig=e,n)this.immutableXConfig=n.immutableXConfig;else switch(e.environment){case t.SANDBOX:this.immutableXConfig=HN();break;case t.PRODUCTION:this.immutableXConfig=zN({basePath:"https://api.x.immutable.com",chainID:1,coreContractAddress:"0x5FDCCA53617f4d2b9134B29090C87D01058e27e9",registrationContractAddress:"0x72a06bf2a1CE5e39cBA06c0CAb824960B587d64c"});break;default:this.immutableXConfig=HN()}}}class VN{immutableX;depositsApi;mintsApi;ordersApi;tokensApi;tradesApi;transfersApi;exchangeApi;nftCheckoutPrimaryApi;usersApi;withdrawalsApi;balanceApi;assetApi;collectionApi;metadataApi;metadataRefreshesApi;projectsApi;constructor(e){const t=new GN(e);this.immutableX=new TN(t.immutableXConfig),this.depositsApi=this.immutableX.depositsApi,this.mintsApi=this.immutableX.mintsApi,this.ordersApi=this.immutableX.ordersApi,this.tokensApi=this.immutableX.tokensApi,this.tradesApi=this.immutableX.tradesApi,this.transfersApi=this.immutableX.transfersApi,this.exchangeApi=this.immutableX.exchangeApi,this.usersApi=this.immutableX.usersApi,this.withdrawalsApi=this.immutableX.withdrawalsApi,this.balanceApi=this.immutableX.balanceApi,this.assetApi=this.immutableX.assetApi,this.collectionApi=this.immutableX.collectionApi,this.metadataApi=this.immutableX.metadataApi,this.metadataRefreshesApi=this.immutableX.metadataRefreshesApi,this.nftCheckoutPrimaryApi=this.immutableX.nftCheckoutPrimaryApi,this.projectsApi=this.immutableX.projectsApi}getDeposit(e){return this.immutableX.getDeposit(e)}listDeposits(e){return this.immutableX.listDeposits(e)}getUser(e){return this.immutableX.getUser(e)}getAsset(e){return this.immutableX.getAsset(e)}listAssets(e){return this.immutableX.listAssets(e)}createCollection(e,t){return this.immutableX.createCollection(e,t)}getCollection(e){return this.immutableX.getCollection(e)}listCollectionFilters(e){return this.immutableX.listCollectionFilters(e)}listCollections(e){return this.collectionApi.listCollections(e).then((e=>e.data))}updateCollection(e,t,n){return this.immutableX.updateCollection(e,t,n)}addMetadataSchemaToCollection(e,t,n){return this.immutableX.addMetadataSchemaToCollection(e,t,n)}getMetadataSchema(e){return this.immutableX.getMetadataSchema(e)}updateMetadataSchemaByName(e,t,n,r){return this.immutableX.updateMetadataSchemaByName(e,t,n,r)}listMetadataRefreshes(e,t,n,r){return this.immutableX.listMetadataRefreshes(e,t,n,r)}getMetadataRefreshErrors(e,t,n,r){return this.immutableX.getMetadataRefreshErrors(e,t,n,r)}getMetadataRefreshResults(e,t){return this.immutableX.getMetadataRefreshResults(e,t)}createMetadataRefresh(e,t){return this.immutableX.createMetadataRefresh(e,t)}async createProject(e,t){return this.immutableX.createProject(e,t)}async getProject(e,t){return this.immutableX.getProject(e,t)}async getProjects(e,t,n,r,i){return this.immutableX.getProjects(e,t,n,r,i)}getBalance(e){return this.immutableX.getBalance(e)}listBalances(e){return this.immutableX.listBalances(e)}getMint(e){return this.immutableX.getMint(e)}listMints(e){return this.immutableX.listMints(e)}mint(e,t){return this.immutableX.mint(e,t)}listWithdrawals(e){return this.immutableX.listWithdrawals(e)}getWithdrawal(e){return this.immutableX.getWithdrawal(e)}getOrder(e){return this.immutableX.getOrder(e)}listOrders(e){return this.immutableX.listOrders(e)}getTrade(e){return this.immutableX.getTrade(e)}listTrades(e){return this.immutableX.listTrades(e)}getToken(e){return this.immutableX.getToken(e)}listTokens(e){return this.immutableX.listTokens(e)}getTransfer(e){return this.immutableX.getTransfer(e)}listTransfers(e){return this.immutableX.listTransfers(e)}createExchange(e){return this.immutableX.createExchange(e).then((e=>e.data))}getExchange(e){return this.immutableX.getExchange(e).then((e=>e.data))}getExchanges(e){return this.immutableX.getExchanges(e).then((e=>e.data))}exchangeTransfer(e,t){return this.immutableX.exchangeTransfer(e,t)}createNftPrimary(e){return this.immutableX.createNftPrimary(e).then((e=>e.data))}getCurrenciesNFTCheckoutPrimary(e){return this.immutableX.getCurrenciesNFTCheckoutPrimary(e).then((e=>e.data))}getNftPrimaryTransaction(e){return this.immutableX.getNftPrimaryTransaction(e).then((e=>e.data))}getNftPrimaryTransactions(e){return this.immutableX.getNftPrimaryTransactions(e).then((e=>e.data))}}var KN=Object.freeze({__proto__:null,IMXError:_N,ImmutableXClient:VN,imxClientCreateStarkSigner:Ax,imxClientGenerateLegacyStarkPrivateKey:jN});var WN={exports:{}};!function(e,t){e.exports=function(){var e=e||function(e,t){var n;if("undefined"!=typeof window&&window.crypto&&(n=window.crypto),"undefined"!=typeof self&&self.crypto&&(n=self.crypto),"undefined"!=typeof globalThis&&globalThis.crypto&&(n=globalThis.crypto),!n&&"undefined"!=typeof window&&window.msCrypto&&(n=window.msCrypto),!n&&void 0!==Jt&&Jt.crypto&&(n=Jt.crypto),!n)try{n=Dm}catch(e){}var r=function(){if(n){if("function"==typeof n.getRandomValues)try{return n.getRandomValues(new Uint32Array(1))[0]}catch(e){}if("function"==typeof n.randomBytes)try{return n.randomBytes(4).readInt32LE()}catch(e){}}throw new Error("Native crypto module could not be used to get secure random number.")},i=Object.create||function(){function e(){}return function(t){var n;return e.prototype=t,n=new e,e.prototype=null,n}}(),a={},o=a.lib={},s=o.Base={extend:function(e){var t=i(this);return e&&t.mixIn(e),t.hasOwnProperty("init")&&this.init!==t.init||(t.init=function(){t.$super.init.apply(this,arguments)}),t.init.prototype=t,t.$super=this,t},create:function(){var e=this.extend();return e.init.apply(e,arguments),e},init:function(){},mixIn:function(e){for(var t in e)e.hasOwnProperty(t)&&(this[t]=e[t]);e.hasOwnProperty("toString")&&(this.toString=e.toString)},clone:function(){return this.init.prototype.extend(this)}},c=o.WordArray=s.extend({init:function(e,n){e=this.words=e||[],this.sigBytes=n!=t?n:4*e.length},toString:function(e){return(e||f).stringify(this)},concat:function(e){var t=this.words,n=e.words,r=this.sigBytes,i=e.sigBytes;if(this.clamp(),r%4)for(var a=0;a<i;a++){var o=n[a>>>2]>>>24-a%4*8&255;t[r+a>>>2]|=o<<24-(r+a)%4*8}else for(var s=0;s<i;s+=4)t[r+s>>>2]=n[s>>>2];return this.sigBytes+=i,this},clamp:function(){var t=this.words,n=this.sigBytes;t[n>>>2]&=4294967295<<32-n%4*8,t.length=e.ceil(n/4)},clone:function(){var e=s.clone.call(this);return e.words=this.words.slice(0),e},random:function(e){for(var t=[],n=0;n<e;n+=4)t.push(r());return new c.init(t,e)}}),u=a.enc={},f=u.Hex={stringify:function(e){for(var t=e.words,n=e.sigBytes,r=[],i=0;i<n;i++){var a=t[i>>>2]>>>24-i%4*8&255;r.push((a>>>4).toString(16)),r.push((15&a).toString(16))}return r.join("")},parse:function(e){for(var t=e.length,n=[],r=0;r<t;r+=2)n[r>>>3]|=parseInt(e.substr(r,2),16)<<24-r%8*4;return new c.init(n,t/2)}},d=u.Latin1={stringify:function(e){for(var t=e.words,n=e.sigBytes,r=[],i=0;i<n;i++){var a=t[i>>>2]>>>24-i%4*8&255;r.push(String.fromCharCode(a))}return r.join("")},parse:function(e){for(var t=e.length,n=[],r=0;r<t;r++)n[r>>>2]|=(255&e.charCodeAt(r))<<24-r%4*8;return new c.init(n,t)}},l=u.Utf8={stringify:function(e){try{return decodeURIComponent(escape(d.stringify(e)))}catch(e){throw new Error("Malformed UTF-8 data")}},parse:function(e){return d.parse(unescape(encodeURIComponent(e)))}},p=o.BufferedBlockAlgorithm=s.extend({reset:function(){this._data=new c.init,this._nDataBytes=0},_append:function(e){"string"==typeof e&&(e=l.parse(e)),this._data.concat(e),this._nDataBytes+=e.sigBytes},_process:function(t){var n,r=this._data,i=r.words,a=r.sigBytes,o=this.blockSize,s=a/(4*o),u=(s=t?e.ceil(s):e.max((0|s)-this._minBufferSize,0))*o,f=e.min(4*u,a);if(u){for(var d=0;d<u;d+=o)this._doProcessBlock(i,d);n=i.splice(0,u),r.sigBytes-=f}return new c.init(n,f)},clone:function(){var e=s.clone.call(this);return e._data=this._data.clone(),e},_minBufferSize:0});o.Hasher=p.extend({cfg:s.extend(),init:function(e){this.cfg=this.cfg.extend(e),this.reset()},reset:function(){p.reset.call(this),this._doReset()},update:function(e){return this._append(e),this._process(),this},finalize:function(e){return e&&this._append(e),this._doFinalize()},blockSize:16,_createHelper:function(e){return function(t,n){return new e.init(n).finalize(t)}},_createHmacHelper:function(e){return function(t,n){return new h.HMAC.init(e,n).finalize(t)}}});var h=a.algo={};return a}(Math);return e}()}(WN);var XN=WN.exports,$N=Yt(XN),JN={exports:{}};!function(e,t){e.exports=function(e){return function(t){var n=e,r=n.lib,i=r.WordArray,a=r.Hasher,o=n.algo,s=[],c=[];!function(){function e(e){for(var n=t.sqrt(e),r=2;r<=n;r++)if(!(e%r))return!1;return!0}function n(e){return 4294967296*(e-(0|e))|0}for(var r=2,i=0;i<64;)e(r)&&(i<8&&(s[i]=n(t.pow(r,.5))),c[i]=n(t.pow(r,1/3)),i++),r++}();var u=[],f=o.SHA256=a.extend({_doReset:function(){this._hash=new i.init(s.slice(0))},_doProcessBlock:function(e,t){for(var n=this._hash.words,r=n[0],i=n[1],a=n[2],o=n[3],s=n[4],f=n[5],d=n[6],l=n[7],p=0;p<64;p++){if(p<16)u[p]=0|e[t+p];else{var h=u[p-15],b=(h<<25|h>>>7)^(h<<14|h>>>18)^h>>>3,m=u[p-2],y=(m<<15|m>>>17)^(m<<13|m>>>19)^m>>>10;u[p]=b+u[p-7]+y+u[p-16]}var g=r&i^r&a^i&a,v=(r<<30|r>>>2)^(r<<19|r>>>13)^(r<<10|r>>>22),w=l+((s<<26|s>>>6)^(s<<21|s>>>11)^(s<<7|s>>>25))+(s&f^~s&d)+c[p]+u[p];l=d,d=f,f=s,s=o+w|0,o=a,a=i,i=r,r=w+(v+g)|0}n[0]=n[0]+r|0,n[1]=n[1]+i|0,n[2]=n[2]+a|0,n[3]=n[3]+o|0,n[4]=n[4]+s|0,n[5]=n[5]+f|0,n[6]=n[6]+d|0,n[7]=n[7]+l|0},_doFinalize:function(){var e=this._data,n=e.words,r=8*this._nDataBytes,i=8*e.sigBytes;return n[i>>>5]|=128<<24-i%32,n[14+(i+64>>>9<<4)]=t.floor(r/4294967296),n[15+(i+64>>>9<<4)]=r,e.sigBytes=4*n.length,this._process(),this._hash},clone:function(){var e=a.clone.call(this);return e._hash=this._hash.clone(),e}});n.SHA256=a._createHelper(f),n.HmacSHA256=a._createHmacHelper(f)}(Math),e.SHA256}(XN)}(JN);var YN=Yt(JN.exports),QN={exports:{}};!function(e,t){e.exports=function(e){return function(){var t=e,n=t.lib.WordArray;function r(e,t,r){for(var i=[],a=0,o=0;o<t;o++)if(o%4){var s=r[e.charCodeAt(o-1)]<<o%4*2|r[e.charCodeAt(o)]>>>6-o%4*2;i[a>>>2]|=s<<24-a%4*8,a++}return n.create(i,a)}t.enc.Base64={stringify:function(e){var t=e.words,n=e.sigBytes,r=this._map;e.clamp();for(var i=[],a=0;a<n;a+=3)for(var o=(t[a>>>2]>>>24-a%4*8&255)<<16|(t[a+1>>>2]>>>24-(a+1)%4*8&255)<<8|t[a+2>>>2]>>>24-(a+2)%4*8&255,s=0;s<4&&a+.75*s<n;s++)i.push(r.charAt(o>>>6*(3-s)&63));var c=r.charAt(64);if(c)for(;i.length%4;)i.push(c);return i.join("")},parse:function(e){var t=e.length,n=this._map,i=this._reverseMap;if(!i){i=this._reverseMap=[];for(var a=0;a<n.length;a++)i[n.charCodeAt(a)]=a}var o=n.charAt(64);if(o){var s=e.indexOf(o);-1!==s&&(t=s)}return r(e,t,i)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="}}(),e.enc.Base64}(XN)}(QN);var ZN=Yt(QN.exports),eB={exports:{}};!function(e,t){e.exports=function(e){return e.enc.Utf8}(XN)}(eB);var tB=Yt(eB.exports);function nB(e){this.message=e}nB.prototype=new Error,nB.prototype.name="InvalidCharacterError";var rB="undefined"!=typeof window&&window.atob&&window.atob.bind(window)||function(e){var t=String(e).replace(/=+$/,"");if(t.length%4==1)throw new nB("'atob' failed: The string to be decoded is not correctly encoded.");for(var n,r,i=0,a=0,o="";r=t.charAt(a++);~r&&(n=i%4?64*n+r:r,i++%4)?o+=String.fromCharCode(255&n>>(-2*i&6)):0)r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(r);return o};function iB(e){this.message=e}function aB(e,t){if("string"!=typeof e)throw new iB("Invalid token specified");var n=!0===(t=t||{}).header?0:1;try{return JSON.parse(function(e){var t=e.replace(/-/g,"+").replace(/_/g,"/");switch(t.length%4){case 0:break;case 2:t+="==";break;case 3:t+="=";break;default:throw"Illegal base64url string!"}try{return function(e){return decodeURIComponent(rB(e).replace(/(.)/g,(function(e,t){var n=t.charCodeAt(0).toString(16).toUpperCase();return n.length<2&&(n="0"+n),"%"+n})))}(t)}catch(e){return rB(t)}}(e.split(".")[n]))}catch(e){throw new iB("Invalid token specified: "+e.message)}}iB.prototype=new Error,iB.prototype.name="InvalidTokenError";var oB,sB,cB,uB={debug:()=>{},info:()=>{},warn:()=>{},error:()=>{}},fB=(e=>(e[e.NONE=0]="NONE",e[e.ERROR=1]="ERROR",e[e.WARN=2]="WARN",e[e.INFO=3]="INFO",e[e.DEBUG=4]="DEBUG",e))(fB||{});(cB=fB||(fB={})).reset=function(){oB=3,sB=uB},cB.setLevel=function(e){if(!(0<=e&&e<=4))throw new Error("Invalid log level");oB=e},cB.setLogger=function(e){sB=e};var dB=class{constructor(e){this._name=e}debug(...e){oB>=4&&sB.debug(dB._format(this._name,this._method),...e)}info(...e){oB>=3&&sB.info(dB._format(this._name,this._method),...e)}warn(...e){oB>=2&&sB.warn(dB._format(this._name,this._method),...e)}error(...e){oB>=1&&sB.error(dB._format(this._name,this._method),...e)}throw(e){throw this.error(e),e}create(e){const t=Object.create(this);return t._method=e,t.debug("begin"),t}static createStatic(e,t){const n=new dB(`${e}.${t}`);return n.debug("begin"),n}static _format(e,t){const n=`[${e}]`;return t?`${n} ${t}:`:n}static debug(e,...t){oB>=4&&sB.debug(dB._format(e),...t)}static info(e,...t){oB>=3&&sB.info(dB._format(e),...t)}static warn(e,...t){oB>=2&&sB.warn(dB._format(e),...t)}static error(e,...t){oB>=1&&sB.error(dB._format(e),...t)}};fB.reset();var lB=class{static _randomWord(){return $N.lib.WordArray.random(1).words[0]}static generateUUIDv4(){const e="10000000-1000-4000-8000-100000000000".replace(/[018]/g,(e=>(+e^lB._randomWord()&15>>+e/4).toString(16)));return e.replace(/-/g,"")}static generateCodeVerifier(){return lB.generateUUIDv4()+lB.generateUUIDv4()+lB.generateUUIDv4()}static generateCodeChallenge(e){try{const t=YN(e);return ZN.stringify(t).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}catch(e){throw dB.error("CryptoUtils.generateCodeChallenge",e),e}}static generateBasicAuth(e,t){const n=tB.parse([e,t].join(":"));return ZN.stringify(n)}},pB=class{constructor(e){this._name=e,this._logger=new dB(`Event('${this._name}')`),this._callbacks=[]}addHandler(e){return this._callbacks.push(e),()=>this.removeHandler(e)}removeHandler(e){const t=this._callbacks.lastIndexOf(e);t>=0&&this._callbacks.splice(t,1)}raise(...e){this._logger.debug("raise:",...e);for(const t of this._callbacks)t(...e)}},hB=class{static decode(e){try{return aB(e)}catch(e){throw dB.error("JwtUtils.decode",e),e}}},bB=class{static center({...e}){var t;return null==e.width&&(e.width=null!=(t=[800,720,600,480].find((e=>e<=window.outerWidth/1.618)))?t:360),null!=e.left||(e.left=Math.max(0,Math.round(window.screenX+(window.outerWidth-e.width)/2))),null!=e.height&&(null!=e.top||(e.top=Math.max(0,Math.round(window.screenY+(window.outerHeight-e.height)/2)))),e}static serialize(e){return Object.entries(e).filter((([,e])=>null!=e)).map((([e,t])=>`${e}=${"boolean"!=typeof t?t:t?"yes":"no"}`)).join(",")}},mB=class extends pB{constructor(){super(...arguments),this._logger=new dB(`Timer('${this._name}')`),this._timerHandle=null,this._expiration=0,this._callback=()=>{const e=this._expiration-mB.getEpochTime();this._logger.debug("timer completes in",e),this._expiration<=mB.getEpochTime()&&(this.cancel(),super.raise())}}static getEpochTime(){return Math.floor(Date.now()/1e3)}init(e){const t=this._logger.create("init");e=Math.max(Math.floor(e),1);const n=mB.getEpochTime()+e;if(this.expiration===n&&this._timerHandle)return void t.debug("skipping since already initialized for expiration at",this.expiration);this.cancel(),t.debug("using duration",e),this._expiration=n;const r=Math.min(e,5);this._timerHandle=setInterval(this._callback,1e3*r)}get expiration(){return this._expiration}cancel(){this._logger.create("cancel"),this._timerHandle&&(clearInterval(this._timerHandle),this._timerHandle=null)}},yB=class{static readParams(e,t="query"){if(!e)throw new TypeError("Invalid URL");const n=new URL(e,"http://127.0.0.1")["fragment"===t?"hash":"search"];return new URLSearchParams(n.slice(1))}},gB=class extends Error{constructor(e,t){var n,r,i;if(super(e.error_description||e.error||""),this.form=t,this.name="ErrorResponse",!e.error)throw dB.error("ErrorResponse","No error passed"),new Error("No error passed");this.error=e.error,this.error_description=null!=(n=e.error_description)?n:null,this.error_uri=null!=(r=e.error_uri)?r:null,this.state=e.userState,this.session_state=null!=(i=e.session_state)?i:null}},vB=class extends Error{constructor(e){super(e),this.name="ErrorTimeout"}},wB=class{constructor(e){this._logger=new dB("AccessTokenEvents"),this._expiringTimer=new mB("Access token expiring"),this._expiredTimer=new mB("Access token expired"),this._expiringNotificationTimeInSeconds=e.expiringNotificationTimeInSeconds}load(e){const t=this._logger.create("load");if(e.access_token&&void 0!==e.expires_in){const n=e.expires_in;if(t.debug("access token present, remaining duration:",n),n>0){let e=n-this._expiringNotificationTimeInSeconds;e<=0&&(e=1),t.debug("registering expiring timer, raising in",e,"seconds"),this._expiringTimer.init(e)}else t.debug("canceling existing expiring timer because we're past expiration."),this._expiringTimer.cancel();const r=n+1;t.debug("registering expired timer, raising in",r,"seconds"),this._expiredTimer.init(r)}else this._expiringTimer.cancel(),this._expiredTimer.cancel()}unload(){this._logger.debug("unload: canceling existing access token timers"),this._expiringTimer.cancel(),this._expiredTimer.cancel()}addAccessTokenExpiring(e){return this._expiringTimer.addHandler(e)}removeAccessTokenExpiring(e){this._expiringTimer.removeHandler(e)}addAccessTokenExpired(e){return this._expiredTimer.addHandler(e)}removeAccessTokenExpired(e){this._expiredTimer.removeHandler(e)}},_B=class{constructor(){this._logger=new dB("InMemoryWebStorage"),this._data={}}clear(){this._logger.create("clear"),this._data={}}getItem(e){return this._logger.create(`getItem('${e}')`),this._data[e]}setItem(e,t){this._logger.create(`setItem('${e}')`),this._data[e]=t}removeItem(e){this._logger.create(`removeItem('${e}')`),delete this._data[e]}get length(){return Object.getOwnPropertyNames(this._data).length}key(e){return Object.getOwnPropertyNames(this._data)[e]}},EB=class{constructor(e=[],t=null,n={}){this._jwtHandler=t,this._extraHeaders=n,this._logger=new dB("JsonService"),this._contentTypes=[],this._contentTypes.push(...e,"application/json"),t&&this._contentTypes.push("application/jwt")}async fetchWithTimeout(e,t={}){const{timeoutInSeconds:n,...r}=t;if(!n)return await fetch(e,r);const i=new AbortController,a=setTimeout((()=>i.abort()),1e3*n);try{return await fetch(e,{...t,signal:i.signal})}catch(e){if(e instanceof DOMException&&"AbortError"===e.name)throw new vB("Network timed out");throw e}finally{clearTimeout(a)}}async getJson(e,{token:t,credentials:n}={}){const r=this._logger.create("getJson"),i={Accept:this._contentTypes.join(", ")};let a;t&&(r.debug("token passed, setting Authorization header"),i.Authorization="Bearer "+t),this.appendExtraHeaders(i);try{r.debug("url:",e),a=await this.fetchWithTimeout(e,{method:"GET",headers:i,credentials:n})}catch(e){throw r.error("Network Error"),e}r.debug("HTTP response received, status",a.status);const o=a.headers.get("Content-Type");if(o&&!this._contentTypes.find((e=>o.startsWith(e)))&&r.throw(new Error(`Invalid response Content-Type: ${null!=o?o:"undefined"}, from URL: ${e}`)),a.ok&&this._jwtHandler&&(null==o?void 0:o.startsWith("application/jwt")))return await this._jwtHandler(await a.text());let s;try{s=await a.json()}catch(e){if(r.error("Error parsing JSON response",e),a.ok)throw e;throw new Error(`${a.statusText} (${a.status})`)}if(!a.ok){if(r.error("Error from server:",s),s.error)throw new gB(s);throw new Error(`${a.statusText} (${a.status}): ${JSON.stringify(s)}`)}return s}async postForm(e,{body:t,basicAuth:n,timeoutInSeconds:r,initCredentials:i}){const a=this._logger.create("postForm"),o={Accept:this._contentTypes.join(", "),"Content-Type":"application/x-www-form-urlencoded"};let s;void 0!==n&&(o.Authorization="Basic "+n),this.appendExtraHeaders(o);try{a.debug("url:",e),s=await this.fetchWithTimeout(e,{method:"POST",headers:o,body:t,timeoutInSeconds:r,credentials:i})}catch(e){throw a.error("Network error"),e}a.debug("HTTP response received, status",s.status);const c=s.headers.get("Content-Type");if(c&&!this._contentTypes.find((e=>c.startsWith(e))))throw new Error(`Invalid response Content-Type: ${null!=c?c:"undefined"}, from URL: ${e}`);const u=await s.text();let f={};if(u)try{f=JSON.parse(u)}catch(e){if(a.error("Error parsing JSON response",e),s.ok)throw e;throw new Error(`${s.statusText} (${s.status})`)}if(!s.ok){if(a.error("Error from server:",f),f.error)throw new gB(f,t);throw new Error(`${s.statusText} (${s.status}): ${JSON.stringify(f)}`)}return f}appendExtraHeaders(e){const t=this._logger.create("appendExtraHeaders"),n=Object.keys(this._extraHeaders),r=["authorization","accept","content-type"];0!==n.length&&n.forEach((n=>{if(r.includes(n.toLocaleLowerCase()))return void t.warn("Protected header could not be overridden",n,r);const i="function"==typeof this._extraHeaders[n]?this._extraHeaders[n]():this._extraHeaders[n];i&&""!==i&&(e[n]=i)}))}},TB=class{constructor({prefix:e="oidc.",store:t=localStorage}={}){this._logger=new dB("WebStorageStateStore"),this._store=t,this._prefix=e}async set(e,t){this._logger.create(`set('${e}')`),e=this._prefix+e,await this._store.setItem(e,t)}async get(e){this._logger.create(`get('${e}')`),e=this._prefix+e;return await this._store.getItem(e)}async remove(e){this._logger.create(`remove('${e}')`),e=this._prefix+e;const t=await this._store.getItem(e);return await this._store.removeItem(e),t}async getAllKeys(){this._logger.create("getAllKeys");const e=await this._store.length,t=[];for(let n=0;n<e;n++){const e=await this._store.key(n);e&&0===e.indexOf(this._prefix)&&t.push(e.substr(this._prefix.length))}return t}},AB=class{constructor({authority:e,metadataUrl:t,metadata:n,signingKeys:r,metadataSeed:i,client_id:a,client_secret:o,response_type:s="code",scope:c="openid",redirect_uri:u,post_logout_redirect_uri:f,client_authentication:d="client_secret_post",prompt:l,display:p,max_age:h,ui_locales:b,acr_values:m,resource:y,response_mode:g="query",filterProtocolClaims:v=!0,loadUserInfo:w=!1,staleStateAgeInSeconds:_=900,clockSkewInSeconds:E=300,userInfoJwtIssuer:T="OP",mergeClaims:A=!1,disablePKCE:R=!1,stateStore:S,refreshTokenCredentials:k,revokeTokenAdditionalContentTypes:I,fetchRequestCredentials:O,refreshTokenAllowedScope:x,extraQueryParams:C={},extraTokenParams:M={},extraHeaders:P={}}){if(this.authority=e,t?this.metadataUrl=t:(this.metadataUrl=e,e&&(this.metadataUrl.endsWith("/")||(this.metadataUrl+="/"),this.metadataUrl+=".well-known/openid-configuration")),this.metadata=n,this.metadataSeed=i,this.signingKeys=r,this.client_id=a,this.client_secret=o,this.response_type=s,this.scope=c,this.redirect_uri=u,this.post_logout_redirect_uri=f,this.client_authentication=d,this.prompt=l,this.display=p,this.max_age=h,this.ui_locales=b,this.acr_values=m,this.resource=y,this.response_mode=g,this.filterProtocolClaims=null==v||v,this.loadUserInfo=!!w,this.staleStateAgeInSeconds=_,this.clockSkewInSeconds=E,this.userInfoJwtIssuer=T,this.mergeClaims=!!A,this.disablePKCE=!!R,this.revokeTokenAdditionalContentTypes=I,O&&k&&console.warn("Both fetchRequestCredentials and refreshTokenCredentials is set. Only fetchRequestCredentials will be used."),this.fetchRequestCredentials=O||(k||"same-origin"),S)this.stateStore=S;else{const e="undefined"!=typeof window?window.localStorage:new _B;this.stateStore=new TB({store:e})}this.refreshTokenAllowedScope=x,this.extraQueryParams=C,this.extraTokenParams=M,this.extraHeaders=P}},RB=class{constructor(e,t){this._settings=e,this._metadataService=t,this._logger=new dB("TokenClient"),this._jsonService=new EB(this._settings.revokeTokenAdditionalContentTypes,null,this._settings.extraHeaders)}async exchangeCode({grant_type:e="authorization_code",redirect_uri:t=this._settings.redirect_uri,client_id:n=this._settings.client_id,client_secret:r=this._settings.client_secret,...i}){const a=this._logger.create("exchangeCode");n||a.throw(new Error("A client_id is required")),t||a.throw(new Error("A redirect_uri is required")),i.code||a.throw(new Error("A code is required"));const o=new URLSearchParams({grant_type:e,redirect_uri:t});for(const[e,t]of Object.entries(i))null!=t&&o.set(e,t);let s;switch(this._settings.client_authentication){case"client_secret_basic":if(!r)throw a.throw(new Error("A client_secret is required")),null;s=lB.generateBasicAuth(n,r);break;case"client_secret_post":o.append("client_id",n),r&&o.append("client_secret",r)}const c=await this._metadataService.getTokenEndpoint(!1);a.debug("got token endpoint");const u=await this._jsonService.postForm(c,{body:o,basicAuth:s,initCredentials:this._settings.fetchRequestCredentials});return a.debug("got response"),u}async exchangeCredentials({grant_type:e="password",client_id:t=this._settings.client_id,client_secret:n=this._settings.client_secret,scope:r=this._settings.scope,...i}){const a=this._logger.create("exchangeCredentials");t||a.throw(new Error("A client_id is required"));const o=new URLSearchParams({grant_type:e,scope:r});for(const[e,t]of Object.entries(i))null!=t&&o.set(e,t);let s;switch(this._settings.client_authentication){case"client_secret_basic":if(!n)throw a.throw(new Error("A client_secret is required")),null;s=lB.generateBasicAuth(t,n);break;case"client_secret_post":o.append("client_id",t),n&&o.append("client_secret",n)}const c=await this._metadataService.getTokenEndpoint(!1);a.debug("got token endpoint");const u=await this._jsonService.postForm(c,{body:o,basicAuth:s,initCredentials:this._settings.fetchRequestCredentials});return a.debug("got response"),u}async exchangeRefreshToken({grant_type:e="refresh_token",client_id:t=this._settings.client_id,client_secret:n=this._settings.client_secret,timeoutInSeconds:r,...i}){const a=this._logger.create("exchangeRefreshToken");t||a.throw(new Error("A client_id is required")),i.refresh_token||a.throw(new Error("A refresh_token is required"));const o=new URLSearchParams({grant_type:e});for(const[e,t]of Object.entries(i))null!=t&&o.set(e,t);let s;switch(this._settings.client_authentication){case"client_secret_basic":if(!n)throw a.throw(new Error("A client_secret is required")),null;s=lB.generateBasicAuth(t,n);break;case"client_secret_post":o.append("client_id",t),n&&o.append("client_secret",n)}const c=await this._metadataService.getTokenEndpoint(!1);a.debug("got token endpoint");const u=await this._jsonService.postForm(c,{body:o,basicAuth:s,timeoutInSeconds:r,initCredentials:this._settings.fetchRequestCredentials});return a.debug("got response"),u}async revoke(e){var t;const n=this._logger.create("revoke");e.token||n.throw(new Error("A token is required"));const r=await this._metadataService.getRevocationEndpoint(!1);n.debug(`got revocation endpoint, revoking ${null!=(t=e.token_type_hint)?t:"default token type"}`);const i=new URLSearchParams;for(const[t,n]of Object.entries(e))null!=n&&i.set(t,n);i.set("client_id",this._settings.client_id),this._settings.client_secret&&i.set("client_secret",this._settings.client_secret),await this._jsonService.postForm(r,{body:i}),n.debug("got response")}},SB=class{constructor(e){this.id=e.id||lB.generateUUIDv4(),this.data=e.data,e.created&&e.created>0?this.created=e.created:this.created=mB.getEpochTime(),this.request_type=e.request_type}toStorageString(){return new dB("State").create("toStorageString"),JSON.stringify({id:this.id,data:this.data,created:this.created,request_type:this.request_type})}static fromStorageString(e){return dB.createStatic("State","fromStorageString"),new SB(JSON.parse(e))}static async clearStaleState(e,t){const n=dB.createStatic("State","clearStaleState"),r=mB.getEpochTime()-t,i=await e.getAllKeys();n.debug("got keys",i);for(let t=0;t<i.length;t++){const a=i[t],o=await e.get(a);let s=!1;if(o)try{const e=SB.fromStorageString(o);n.debug("got item from key:",a,e.created),e.created<=r&&(s=!0)}catch(e){n.error("Error parsing state for key:",a,e),s=!0}else n.debug("no item in storage for key:",a),s=!0;s&&(n.debug("removed item for key:",a),e.remove(a))}}},kB=class extends SB{constructor(e){super(e),!0===e.code_verifier?this.code_verifier=lB.generateCodeVerifier():e.code_verifier&&(this.code_verifier=e.code_verifier),this.code_verifier&&(this.code_challenge=lB.generateCodeChallenge(this.code_verifier)),this.authority=e.authority,this.client_id=e.client_id,this.redirect_uri=e.redirect_uri,this.scope=e.scope,this.client_secret=e.client_secret,this.extraTokenParams=e.extraTokenParams,this.response_mode=e.response_mode,this.skipUserInfo=e.skipUserInfo}toStorageString(){return new dB("SigninState").create("toStorageString"),JSON.stringify({id:this.id,data:this.data,created:this.created,request_type:this.request_type,code_verifier:this.code_verifier,authority:this.authority,client_id:this.client_id,redirect_uri:this.redirect_uri,scope:this.scope,client_secret:this.client_secret,extraTokenParams:this.extraTokenParams,response_mode:this.response_mode,skipUserInfo:this.skipUserInfo})}static fromStorageString(e){dB.createStatic("SigninState","fromStorageString");const t=JSON.parse(e);return new kB(t)}},IB=class{constructor(e){this.access_token="",this.token_type="",this.profile={},this.state=e.get("state"),this.session_state=e.get("session_state"),this.error=e.get("error"),this.error_description=e.get("error_description"),this.error_uri=e.get("error_uri"),this.code=e.get("code")}get expires_in(){if(void 0!==this.expires_at)return this.expires_at-mB.getEpochTime()}set expires_in(e){"string"==typeof e&&(e=Number(e)),void 0!==e&&e>=0&&(this.expires_at=Math.floor(e)+mB.getEpochTime())}get isOpenId(){var e;return(null==(e=this.scope)?void 0:e.split(" ").includes("openid"))||!!this.id_token}},OB=["nbf","jti","auth_time","nonce","acr","amr","azp","at_hash"],xB=["sub","iss","aud","exp","iat"],CB=class{constructor(e){var t;this.id_token=e.id_token,this.session_state=null!=(t=e.session_state)?t:null,this.access_token=e.access_token,this.refresh_token=e.refresh_token,this.token_type=e.token_type,this.scope=e.scope,this.profile=e.profile,this.expires_at=e.expires_at,this.state=e.userState}get expires_in(){if(void 0!==this.expires_at)return this.expires_at-mB.getEpochTime()}set expires_in(e){void 0!==e&&(this.expires_at=Math.floor(e)+mB.getEpochTime())}get expired(){const e=this.expires_in;if(void 0!==e)return e<=0}get scopes(){var e,t;return null!=(t=null==(e=this.scope)?void 0:e.split(" "))?t:[]}toStorageString(){return new dB("User").create("toStorageString"),JSON.stringify({id_token:this.id_token,session_state:this.session_state,access_token:this.access_token,refresh_token:this.refresh_token,token_type:this.token_type,scope:this.scope,profile:this.profile,expires_at:this.expires_at})}static fromStorageString(e){return dB.createStatic("User","fromStorageString"),new CB(JSON.parse(e))}},MB="oidc-client",PB=class{constructor(){this._abort=new pB("Window navigation aborted"),this._disposeHandlers=new Set,this._window=null}async navigate(e){const t=this._logger.create("navigate");if(!this._window)throw new Error("Attempted to navigate on a disposed window");t.debug("setting URL in window"),this._window.location.replace(e.url);const{url:n,keepOpen:r}=await new Promise(((n,r)=>{const i=i=>{var a;const o=i.data,s=null!=(a=e.scriptOrigin)?a:window.location.origin;if(i.origin===s&&(null==o?void 0:o.source)===MB){try{const n=yB.readParams(o.url,e.response_mode).get("state");if(n||t.warn("no state found in response url"),i.source!==this._window&&n!==e.state)return}catch(e){this._dispose(),r(new Error("Invalid response from window"))}n(o)}};window.addEventListener("message",i,!1),this._disposeHandlers.add((()=>window.removeEventListener("message",i,!1))),this._disposeHandlers.add(this._abort.addHandler((e=>{this._dispose(),r(e)})))}));return t.debug("got response from window"),this._dispose(),r||this.close(),{url:n}}_dispose(){this._logger.create("_dispose");for(const e of this._disposeHandlers)e();this._disposeHandlers.clear()}static _notifyParent(e,t,n=!1,r=window.location.origin){e.postMessage({source:MB,url:t,keepOpen:n},r)}},NB={location:!1,toolbar:!1,height:640},BB="_blank",DB=60,FB=2,LB=10,UB=class extends AB{constructor(e){const{popup_redirect_uri:t=e.redirect_uri,popup_post_logout_redirect_uri:n=e.post_logout_redirect_uri,popupWindowFeatures:r=NB,popupWindowTarget:i=BB,redirectMethod:a="assign",redirectTarget:o="self",iframeNotifyParentOrigin:s=e.iframeNotifyParentOrigin,iframeScriptOrigin:c=e.iframeScriptOrigin,silent_redirect_uri:u=e.redirect_uri,silentRequestTimeoutInSeconds:f=LB,automaticSilentRenew:d=!0,validateSubOnSilentRenew:l=!0,includeIdTokenInSilentRenew:p=!1,monitorSession:h=!1,monitorAnonymousSession:b=!1,checkSessionIntervalInSeconds:m=FB,query_status_response_type:y="code",stopCheckSessionOnError:g=!0,revokeTokenTypes:v=["access_token","refresh_token"],revokeTokensOnSignout:w=!1,includeIdTokenInSilentSignout:_=!1,accessTokenExpiringNotificationTimeInSeconds:E=DB,userStore:T}=e;if(super(e),this.popup_redirect_uri=t,this.popup_post_logout_redirect_uri=n,this.popupWindowFeatures=r,this.popupWindowTarget=i,this.redirectMethod=a,this.redirectTarget=o,this.iframeNotifyParentOrigin=s,this.iframeScriptOrigin=c,this.silent_redirect_uri=u,this.silentRequestTimeoutInSeconds=f,this.automaticSilentRenew=d,this.validateSubOnSilentRenew=l,this.includeIdTokenInSilentRenew=p,this.monitorSession=h,this.monitorAnonymousSession=b,this.checkSessionIntervalInSeconds=m,this.stopCheckSessionOnError=g,this.query_status_response_type=y,this.revokeTokenTypes=v,this.revokeTokensOnSignout=w,this.includeIdTokenInSilentSignout=_,this.accessTokenExpiringNotificationTimeInSeconds=E,T)this.userStore=T;else{const e="undefined"!=typeof window?window.sessionStorage:new _B;this.userStore=new TB({store:e})}}},jB=class extends PB{constructor({silentRequestTimeoutInSeconds:e=LB}){super(),this._logger=new dB("IFrameWindow"),this._timeoutInSeconds=e,this._frame=jB.createHiddenIframe(),this._window=this._frame.contentWindow}static createHiddenIframe(){const e=window.document.createElement("iframe");return e.style.visibility="hidden",e.style.position="fixed",e.style.left="-1000px",e.style.top="0",e.width="0",e.height="0",e.setAttribute("sandbox","allow-scripts allow-same-origin allow-forms"),window.document.body.appendChild(e),e}async navigate(e){this._logger.debug("navigate: Using timeout of:",this._timeoutInSeconds);const t=setTimeout((()=>this._abort.raise(new vB("IFrame timed out without a response"))),1e3*this._timeoutInSeconds);return this._disposeHandlers.add((()=>clearTimeout(t))),await super.navigate(e)}close(){var e;this._frame&&(this._frame.parentNode&&(this._frame.addEventListener("load",(e=>{var t;const n=e.target;null==(t=n.parentNode)||t.removeChild(n),this._abort.raise(new Error("IFrame removed from DOM"))}),!0),null==(e=this._frame.contentWindow)||e.location.replace("about:blank")),this._frame=null),this._window=null}static notifyParent(e,t){return super._notifyParent(window.parent,e,!1,t)}},qB=class extends PB{constructor({popupWindowTarget:e=BB,popupWindowFeatures:t={}}){super(),this._logger=new dB("PopupWindow");const n=bB.center({...NB,...t});this._window=window.open(void 0,e,bB.serialize(n))}async navigate(e){var t;null==(t=this._window)||t.focus();const n=setInterval((()=>{this._window&&!this._window.closed||this._abort.raise(new Error("Popup closed by user"))}),500);return this._disposeHandlers.add((()=>clearInterval(n))),await super.navigate(e)}close(){this._window&&(this._window.closed||(this._window.close(),this._abort.raise(new Error("Popup closed")))),this._window=null}static notifyOpener(e,t){if(!window.opener)throw new Error("No window.opener. Can't complete notification.");return super._notifyParent(window.opener,e,t)}},zB=class extends wB{constructor(e){super({expiringNotificationTimeInSeconds:e.accessTokenExpiringNotificationTimeInSeconds}),this._logger=new dB("UserManagerEvents"),this._userLoaded=new pB("User loaded"),this._userUnloaded=new pB("User unloaded"),this._silentRenewError=new pB("Silent renew error"),this._userSignedIn=new pB("User signed in"),this._userSignedOut=new pB("User signed out"),this._userSessionChanged=new pB("User session changed")}load(e,t=!0){super.load(e),t&&this._userLoaded.raise(e)}unload(){super.unload(),this._userUnloaded.raise()}addUserLoaded(e){return this._userLoaded.addHandler(e)}removeUserLoaded(e){return this._userLoaded.removeHandler(e)}addUserUnloaded(e){return this._userUnloaded.addHandler(e)}removeUserUnloaded(e){return this._userUnloaded.removeHandler(e)}addSilentRenewError(e){return this._silentRenewError.addHandler(e)}removeSilentRenewError(e){return this._silentRenewError.removeHandler(e)}_raiseSilentRenewError(e){this._silentRenewError.raise(e)}addUserSignedIn(e){return this._userSignedIn.addHandler(e)}removeUserSignedIn(e){this._userSignedIn.removeHandler(e)}_raiseUserSignedIn(){this._userSignedIn.raise()}addUserSignedOut(e){return this._userSignedOut.addHandler(e)}removeUserSignedOut(e){this._userSignedOut.removeHandler(e)}_raiseUserSignedOut(){this._userSignedOut.raise()}addUserSessionChanged(e){return this._userSessionChanged.addHandler(e)}removeUserSessionChanged(e){this._userSessionChanged.removeHandler(e)}_raiseUserSessionChanged(){this._userSessionChanged.raise()}},HB=(e=>(e.MissingApiKey="MISSING_API_KEY",e.ModalNotReady="MODAL_NOT_READY",e.MalformedResponse="MALFORMED_RESPONSE",e.InvalidArgument="INVALID_ARGUMENT",e.ExtensionNotInitialized="EXTENSION_NOT_INITIALIZED",e.IncompatibleExtensions="INCOMPATIBLE_EXTENSIONS",e))(HB||{}),GB=(e=>(e.SyncWeb3Method="SYNC_WEB3_METHOD",e.DuplicateIframe="DUPLICATE_IFRAME",e.ReactNativeEndpointConfiguration="REACT_NATIVE_ENDPOINT_CONFIGURATION",e.DeprecationNotice="DEPRECATION_NOTICE",e))(GB||{}),VB=(e=>(e[e.ParseError=-32700]="ParseError",e[e.InvalidRequest=-32600]="InvalidRequest",e[e.MethodNotFound=-32601]="MethodNotFound",e[e.InvalidParams=-32602]="InvalidParams",e[e.InternalError=-32603]="InternalError",e[e.MagicLinkFailedVerification=-1e4]="MagicLinkFailedVerification",e[e.MagicLinkExpired=-10001]="MagicLinkExpired",e[e.MagicLinkRateLimited=-10002]="MagicLinkRateLimited",e[e.MagicLinkInvalidRedirectURL=-10006]="MagicLinkInvalidRedirectURL",e[e.UserAlreadyLoggedIn=-10003]="UserAlreadyLoggedIn",e[e.UpdateEmailFailed=-10004]="UpdateEmailFailed",e[e.UserRequestEditEmail=-10005]="UserRequestEditEmail",e[e.InactiveRecipient=-10010]="InactiveRecipient",e[e.AccessDeniedToUser=-10011]="AccessDeniedToUser",e))(VB||{}),KB=(e=>(e.LoginWithSms="magic_auth_login_with_sms",e.LoginWithEmailOTP="magic_auth_login_with_email_otp",e.LoginWithMagicLink="magic_auth_login_with_magic_link",e.LoginWithCredential="magic_auth_login_with_credential",e.GetIdToken="magic_auth_get_id_token",e.GenerateIdToken="magic_auth_generate_id_token",e.GetMetadata="magic_auth_get_metadata",e.IsLoggedIn="magic_auth_is_logged_in",e.Logout="magic_auth_logout",e.UpdateEmail="magic_auth_update_email",e.UserSettings="magic_auth_settings",e.UserSettingsTestMode="magic_auth_settings_testing_mode",e.LoginWithSmsTestMode="magic_auth_login_with_sms_testing_mode",e.LoginWithEmailOTPTestMode="magic_auth_login_with_email_otp_testing_mode",e.LoginWithMagicLinkTestMode="magic_login_with_magic_link_testing_mode",e.LoginWithCredentialTestMode="magic_auth_login_with_credential_testing_mode",e.GetIdTokenTestMode="magic_auth_get_id_token_testing_mode",e.GenerateIdTokenTestMode="magic_auth_generate_id_token_testing_mode",e.GetMetadataTestMode="magic_auth_get_metadata_testing_mode",e.IsLoggedInTestMode="magic_auth_is_logged_in_testing_mode",e.LogoutTestMode="magic_auth_logout_testing_mode",e.UpdateEmailTestMode="magic_auth_update_email_testing_mode",e.IntermediaryEvent="magic_intermediary_event",e.RequestAccounts="eth_requestAccounts",e.GetInfo="mc_get_wallet_info",e.ShowUI="mc_wallet",e.NFTPurchase="magic_nft_purchase",e.RequestUserInfoWithUI="mc_request_user_info",e.Disconnect="mc_disconnect",e.UpdatePhoneNumber="magic_auth_update_phone_number",e.UpdatePhoneNumberTestMode="magic_auth_update_phone_number_testing_mode",e.RecoverAccount="magic_auth_recover_account",e.RecoverAccountTestMode="magic_auth_recover_account_testing_mode",e))(KB||{}),WB=(e=>(e.MAGIC_HANDLE_RESPONSE="MAGIC_HANDLE_RESPONSE",e.MAGIC_OVERLAY_READY="MAGIC_OVERLAY_READY",e.MAGIC_SHOW_OVERLAY="MAGIC_SHOW_OVERLAY",e.MAGIC_HIDE_OVERLAY="MAGIC_HIDE_OVERLAY",e.MAGIC_HANDLE_EVENT="MAGIC_HANDLE_EVENT",e))(WB||{}),XB=(e=>(e.MAGIC_HANDLE_REQUEST="MAGIC_HANDLE_REQUEST",e))(XB||{}),$B=(e=>(e.Harmony="HARMONY",e))($B||{}),JB=Object.create,YB=Object.defineProperty,QB=Object.defineProperties,ZB=Object.getOwnPropertyDescriptor,eD=Object.getOwnPropertyDescriptors,tD=Object.getOwnPropertyNames,nD=Object.getOwnPropertySymbols,rD=Object.getPrototypeOf,iD=Object.prototype.hasOwnProperty,aD=Object.prototype.propertyIsEnumerable,oD=(e,t,n)=>t in e?YB(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,sD=(e,t)=>{for(var n in t||(t={}))iD.call(t,n)&&oD(e,n,t[n]);if(nD)for(var n of nD(t))aD.call(t,n)&&oD(e,n,t[n]);return e},cD=(e,t,n)=>new Promise(((r,i)=>{var a=e=>{try{s(n.next(e))}catch(e){i(e)}},o=e=>{try{s(n.throw(e))}catch(e){i(e)}},s=e=>e.done?r(e.value):Promise.resolve(e.value).then(a,o);s((n=n.apply(e,t)).next())})),uD=((e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports))(((e,t)=>{var n=Object.prototype.hasOwnProperty,r="~";function i(){}function a(e,t,n){this.fn=e,this.context=t,this.once=n||!1}function o(e,t,n,i,o){if("function"!=typeof n)throw new TypeError("The listener must be a function");var s=new a(n,i||e,o),c=r?r+t:t;return e._events[c]?e._events[c].fn?e._events[c]=[e._events[c],s]:e._events[c].push(s):(e._events[c]=s,e._eventsCount++),e}function s(e,t){0==--e._eventsCount?e._events=new i:delete e._events[t]}function c(){this._events=new i,this._eventsCount=0}Object.create&&(i.prototype=Object.create(null),(new i).__proto__||(r=!1)),c.prototype.eventNames=function(){var e,t,i=[];if(0===this._eventsCount)return i;for(t in e=this._events)n.call(e,t)&&i.push(r?t.slice(1):t);return Object.getOwnPropertySymbols?i.concat(Object.getOwnPropertySymbols(e)):i},c.prototype.listeners=function(e){var t=r?r+e:e,n=this._events[t];if(!n)return[];if(n.fn)return[n.fn];for(var i=0,a=n.length,o=new Array(a);i<a;i++)o[i]=n[i].fn;return o},c.prototype.listenerCount=function(e){var t=r?r+e:e,n=this._events[t];return n?n.fn?1:n.length:0},c.prototype.emit=function(e,t,n,i,a,o){var s=r?r+e:e;if(!this._events[s])return!1;var c,u,f=this._events[s],d=arguments.length;if(f.fn){switch(f.once&&this.removeListener(e,f.fn,void 0,!0),d){case 1:return f.fn.call(f.context),!0;case 2:return f.fn.call(f.context,t),!0;case 3:return f.fn.call(f.context,t,n),!0;case 4:return f.fn.call(f.context,t,n,i),!0;case 5:return f.fn.call(f.context,t,n,i,a),!0;case 6:return f.fn.call(f.context,t,n,i,a,o),!0}for(u=1,c=new Array(d-1);u<d;u++)c[u-1]=arguments[u];f.fn.apply(f.context,c)}else{var l,p=f.length;for(u=0;u<p;u++)switch(f[u].once&&this.removeListener(e,f[u].fn,void 0,!0),d){case 1:f[u].fn.call(f[u].context);break;case 2:f[u].fn.call(f[u].context,t);break;case 3:f[u].fn.call(f[u].context,t,n);break;case 4:f[u].fn.call(f[u].context,t,n,i);break;default:if(!c)for(l=1,c=new Array(d-1);l<d;l++)c[l-1]=arguments[l];f[u].fn.apply(f[u].context,c)}}return!0},c.prototype.on=function(e,t,n){return o(this,e,t,n,!1)},c.prototype.once=function(e,t,n){return o(this,e,t,n,!0)},c.prototype.removeListener=function(e,t,n,i){var a=r?r+e:e;if(!this._events[a])return this;if(!t)return s(this,a),this;var o=this._events[a];if(o.fn)o.fn===t&&(!i||o.once)&&(!n||o.context===n)&&s(this,a);else{for(var c=0,u=[],f=o.length;c<f;c++)(o[c].fn!==t||i&&!o[c].once||n&&o[c].context!==n)&&u.push(o[c]);u.length?this._events[a]=1===u.length?u[0]:u:s(this,a)}return this},c.prototype.removeAllListeners=function(e){var t;return e?(t=r?r+e:e,this._events[t]&&s(this,t)):(this._events=new i,this._eventsCount=0),this},c.prototype.off=c.prototype.removeListener,c.prototype.addListener=c.prototype.on,c.prefixed=r,c.EventEmitter=c,typeof t<"u"&&(t.exports=c)}));var fD={SEMVER_SPEC_VERSION:"2.0.0",MAX_LENGTH:256,MAX_SAFE_INTEGER:Number.MAX_SAFE_INTEGER||9007199254740991,MAX_SAFE_COMPONENT_LENGTH:16},dD="object"==typeof process&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...e)=>console.error("SEMVER",...e):()=>{},lD=dD,pD=function(e){let t={exports:{}};return e(t,t.exports),t.exports}((function(e,t){let{MAX_SAFE_COMPONENT_LENGTH:n}=fD,r=(t=e.exports={}).re=[],i=t.src=[],a=t.t={},o=0,s=(e,t,n)=>{let s=o++;lD(s,t),a[e]=s,i[s]=t,r[s]=new RegExp(t,n?"g":void 0)};s("NUMERICIDENTIFIER","0|[1-9]\\d*"),s("NUMERICIDENTIFIERLOOSE","[0-9]+"),s("NONNUMERICIDENTIFIER","\\d*[a-zA-Z-][a-zA-Z0-9-]*"),s("MAINVERSION",`(${i[a.NUMERICIDENTIFIER]})\\.(${i[a.NUMERICIDENTIFIER]})\\.(${i[a.NUMERICIDENTIFIER]})`),s("MAINVERSIONLOOSE",`(${i[a.NUMERICIDENTIFIERLOOSE]})\\.(${i[a.NUMERICIDENTIFIERLOOSE]})\\.(${i[a.NUMERICIDENTIFIERLOOSE]})`),s("PRERELEASEIDENTIFIER",`(?:${i[a.NUMERICIDENTIFIER]}|${i[a.NONNUMERICIDENTIFIER]})`),s("PRERELEASEIDENTIFIERLOOSE",`(?:${i[a.NUMERICIDENTIFIERLOOSE]}|${i[a.NONNUMERICIDENTIFIER]})`),s("PRERELEASE",`(?:-(${i[a.PRERELEASEIDENTIFIER]}(?:\\.${i[a.PRERELEASEIDENTIFIER]})*))`),s("PRERELEASELOOSE",`(?:-?(${i[a.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${i[a.PRERELEASEIDENTIFIERLOOSE]})*))`),s("BUILDIDENTIFIER","[0-9A-Za-z-]+"),s("BUILD",`(?:\\+(${i[a.BUILDIDENTIFIER]}(?:\\.${i[a.BUILDIDENTIFIER]})*))`),s("FULLPLAIN",`v?${i[a.MAINVERSION]}${i[a.PRERELEASE]}?${i[a.BUILD]}?`),s("FULL",`^${i[a.FULLPLAIN]}$`),s("LOOSEPLAIN",`[v=\\s]*${i[a.MAINVERSIONLOOSE]}${i[a.PRERELEASELOOSE]}?${i[a.BUILD]}?`),s("LOOSE",`^${i[a.LOOSEPLAIN]}$`),s("GTLT","((?:<|>)?=?)"),s("XRANGEIDENTIFIERLOOSE",`${i[a.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`),s("XRANGEIDENTIFIER",`${i[a.NUMERICIDENTIFIER]}|x|X|\\*`),s("XRANGEPLAIN",`[v=\\s]*(${i[a.XRANGEIDENTIFIER]})(?:\\.(${i[a.XRANGEIDENTIFIER]})(?:\\.(${i[a.XRANGEIDENTIFIER]})(?:${i[a.PRERELEASE]})?${i[a.BUILD]}?)?)?`),s("XRANGEPLAINLOOSE",`[v=\\s]*(${i[a.XRANGEIDENTIFIERLOOSE]})(?:\\.(${i[a.XRANGEIDENTIFIERLOOSE]})(?:\\.(${i[a.XRANGEIDENTIFIERLOOSE]})(?:${i[a.PRERELEASELOOSE]})?${i[a.BUILD]}?)?)?`),s("XRANGE",`^${i[a.GTLT]}\\s*${i[a.XRANGEPLAIN]}$`),s("XRANGELOOSE",`^${i[a.GTLT]}\\s*${i[a.XRANGEPLAINLOOSE]}$`),s("COERCE",`(^|[^\\d])(\\d{1,${n}})(?:\\.(\\d{1,${n}}))?(?:\\.(\\d{1,${n}}))?(?:$|[^\\d])`),s("COERCERTL",i[a.COERCE],!0),s("LONETILDE","(?:~>?)"),s("TILDETRIM",`(\\s*)${i[a.LONETILDE]}\\s+`,!0),t.tildeTrimReplace="$1~",s("TILDE",`^${i[a.LONETILDE]}${i[a.XRANGEPLAIN]}$`),s("TILDELOOSE",`^${i[a.LONETILDE]}${i[a.XRANGEPLAINLOOSE]}$`),s("LONECARET","(?:\\^)"),s("CARETTRIM",`(\\s*)${i[a.LONECARET]}\\s+`,!0),t.caretTrimReplace="$1^",s("CARET",`^${i[a.LONECARET]}${i[a.XRANGEPLAIN]}$`),s("CARETLOOSE",`^${i[a.LONECARET]}${i[a.XRANGEPLAINLOOSE]}$`),s("COMPARATORLOOSE",`^${i[a.GTLT]}\\s*(${i[a.LOOSEPLAIN]})$|^$`),s("COMPARATOR",`^${i[a.GTLT]}\\s*(${i[a.FULLPLAIN]})$|^$`),s("COMPARATORTRIM",`(\\s*)${i[a.GTLT]}\\s*(${i[a.LOOSEPLAIN]}|${i[a.XRANGEPLAIN]})`,!0),t.comparatorTrimReplace="$1$2$3",s("HYPHENRANGE",`^\\s*(${i[a.XRANGEPLAIN]})\\s+-\\s+(${i[a.XRANGEPLAIN]})\\s*$`),s("HYPHENRANGELOOSE",`^\\s*(${i[a.XRANGEPLAINLOOSE]})\\s+-\\s+(${i[a.XRANGEPLAINLOOSE]})\\s*$`),s("STAR","(<|>)?=?\\s*\\*"),s("GTE0","^\\s*>=\\s*0.0.0\\s*$"),s("GTE0PRE","^\\s*>=\\s*0.0.0-0\\s*$")})),hD=/^[0-9]+$/,bD=(e,t)=>{let n=hD.test(e),r=hD.test(t);return n&&r&&(e=+e,t=+t),e===t?0:n&&!r?-1:r&&!n?1:e<t?-1:1},mD={compareIdentifiers:bD,rcompareIdentifiers:(e,t)=>bD(t,e)},{MAX_LENGTH:yD,MAX_SAFE_INTEGER:gD}=fD,{re:vD,t:wD}=pD,{compareIdentifiers:_D}=mD,ED=class{constructor(e,t){if(t&&"object"==typeof t||(t={loose:!!t,includePrerelease:!1}),e instanceof ED){if(e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease)return e;e=e.version}else if("string"!=typeof e)throw new TypeError(`Invalid Version: ${e}`);if(e.length>yD)throw new TypeError(`version is longer than ${yD} characters`);lD("SemVer",e,t),this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease;let n=e.trim().match(t.loose?vD[wD.LOOSE]:vD[wD.FULL]);if(!n)throw new TypeError(`Invalid Version: ${e}`);if(this.raw=e,this.major=+n[1],this.minor=+n[2],this.patch=+n[3],this.major>gD||this.major<0)throw new TypeError("Invalid major version");if(this.minor>gD||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>gD||this.patch<0)throw new TypeError("Invalid patch version");n[4]?this.prerelease=n[4].split(".").map((e=>{if(/^[0-9]+$/.test(e)){let t=+e;if(t>=0&&t<gD)return t}return e})):this.prerelease=[],this.build=n[5]?n[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(e){if(lD("SemVer.compare",this.version,this.options,e),!(e instanceof ED)){if("string"==typeof e&&e===this.version)return 0;e=new ED(e,this.options)}return e.version===this.version?0:this.compareMain(e)||this.comparePre(e)}compareMain(e){return e instanceof ED||(e=new ED(e,this.options)),_D(this.major,e.major)||_D(this.minor,e.minor)||_D(this.patch,e.patch)}comparePre(e){if(e instanceof ED||(e=new ED(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{let n=this.prerelease[t],r=e.prerelease[t];if(lD("prerelease compare",t,n,r),void 0===n&&void 0===r)return 0;if(void 0===r)return 1;if(void 0===n)return-1;if(n!==r)return _D(n,r)}while(++t)}compareBuild(e){e instanceof ED||(e=new ED(e,this.options));let t=0;do{let n=this.build[t],r=e.build[t];if(lD("prerelease compare",t,n,r),void 0===n&&void 0===r)return 0;if(void 0===r)return 1;if(void 0===n)return-1;if(n!==r)return _D(n,r)}while(++t)}inc(e,t){switch(e){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",t);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",t);break;case"prepatch":this.prerelease.length=0,this.inc("patch",t),this.inc("pre",t);break;case"prerelease":0===this.prerelease.length&&this.inc("patch",t),this.inc("pre",t);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":if(0===this.prerelease.length)this.prerelease=[0];else{let e=this.prerelease.length;for(;--e>=0;)"number"==typeof this.prerelease[e]&&(this.prerelease[e]++,e=-2);-1===e&&this.prerelease.push(0)}t&&(this.prerelease[0]===t?isNaN(this.prerelease[1])&&(this.prerelease=[t,0]):this.prerelease=[t,0]);break;default:throw new Error(`invalid increment argument: ${e}`)}return this.format(),this.raw=this.version,this}},TD=(e,t,n)=>new ED(e,n).compare(new ED(t,n)),AD=(e,t,n)=>0===TD(e,t,n),RD=(e,t,n)=>0!==TD(e,t,n),SD=(e,t,n)=>TD(e,t,n)>0,kD=(e,t,n)=>TD(e,t,n)>=0,ID=(e,t,n)=>TD(e,t,n)<0,OD=(e,t,n)=>TD(e,t,n)<=0,xD=(e,t,n,r)=>{switch(t){case"===":return"object"==typeof e&&(e=e.version),"object"==typeof n&&(n=n.version),e===n;case"!==":return"object"==typeof e&&(e=e.version),"object"==typeof n&&(n=n.version),e!==n;case"":case"=":case"==":return AD(e,n,r);case"!=":return RD(e,n,r);case">":return SD(e,n,r);case">=":return kD(e,n,r);case"<":return ID(e,n,r);case"<=":return OD(e,n,r);default:throw new TypeError(`Invalid operator: ${t}`)}},CD=Symbol("SemVer ANY"),MD=class{static get ANY(){return CD}constructor(e,t){if(t&&"object"==typeof t||(t={loose:!!t,includePrerelease:!1}),e instanceof MD){if(e.loose===!!t.loose)return e;e=e.value}lD("comparator",e,t),this.options=t,this.loose=!!t.loose,this.parse(e),this.semver===CD?this.value="":this.value=this.operator+this.semver.version,lD("comp",this)}parse(e){let t=this.options.loose?PD[ND.COMPARATORLOOSE]:PD[ND.COMPARATOR],n=e.match(t);if(!n)throw new TypeError(`Invalid comparator: ${e}`);this.operator=void 0!==n[1]?n[1]:"","="===this.operator&&(this.operator=""),n[2]?this.semver=new ED(n[2],this.options.loose):this.semver=CD}toString(){return this.value}test(e){if(lD("Comparator.test",e,this.options.loose),this.semver===CD||e===CD)return!0;if("string"==typeof e)try{e=new ED(e,this.options)}catch(e){return!1}return xD(e,this.operator,this.semver,this.options)}intersects(e,t){if(!(e instanceof MD))throw new TypeError("a Comparator is required");if(t&&"object"==typeof t||(t={loose:!!t,includePrerelease:!1}),""===this.operator)return""===this.value||new BD(e.value,t).test(this.value);if(""===e.operator)return""===e.value||new BD(this.value,t).test(e.semver);let n=!(">="!==this.operator&&">"!==this.operator||">="!==e.operator&&">"!==e.operator),r=!("<="!==this.operator&&"<"!==this.operator||"<="!==e.operator&&"<"!==e.operator),i=this.semver.version===e.semver.version,a=!(">="!==this.operator&&"<="!==this.operator||">="!==e.operator&&"<="!==e.operator),o=xD(this.semver,"<",e.semver,t)&&(">="===this.operator||">"===this.operator)&&("<="===e.operator||"<"===e.operator),s=xD(this.semver,">",e.semver,t)&&("<="===this.operator||"<"===this.operator)&&(">="===e.operator||">"===e.operator);return n||r||i&&a||o||s}},{re:PD,t:ND}=pD,BD=class{constructor(e,t){if(t&&"object"==typeof t||(t={loose:!!t,includePrerelease:!1}),e instanceof BD)return e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease?e:new BD(e.raw,t);if(e instanceof MD)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,this.set=e.split(/\s*\|\|\s*/).map((e=>this.parseRange(e.trim()))).filter((e=>e.length)),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${e}`);this.format()}format(){return this.range=this.set.map((e=>e.join(" ").trim())).join("||").trim(),this.range}toString(){return this.range}parseRange(e){let{loose:t}=this.options;e=e.trim();let n=t?DD[FD.HYPHENRANGELOOSE]:DD[FD.HYPHENRANGE];e=e.replace(n,QD(this.options.includePrerelease)),lD("hyphen replace",e),e=e.replace(DD[FD.COMPARATORTRIM],LD),lD("comparator trim",e,DD[FD.COMPARATORTRIM]),e=(e=(e=e.replace(DD[FD.TILDETRIM],UD)).replace(DD[FD.CARETTRIM],jD)).split(/\s+/).join(" ");let r=t?DD[FD.COMPARATORLOOSE]:DD[FD.COMPARATOR];return e.split(" ").map((e=>zD(e,this.options))).join(" ").split(/\s+/).map((e=>YD(e,this.options))).filter(this.options.loose?e=>!!e.match(r):()=>!0).map((e=>new MD(e,this.options)))}intersects(e,t){if(!(e instanceof BD))throw new TypeError("a Range is required");return this.set.some((n=>qD(n,t)&&e.set.some((e=>qD(e,t)&&n.every((n=>e.every((e=>n.intersects(e,t)))))))))}test(e){if(!e)return!1;if("string"==typeof e)try{e=new ED(e,this.options)}catch(e){return!1}for(let t=0;t<this.set.length;t++)if(ZD(this.set[t],e,this.options))return!0;return!1}},{re:DD,t:FD,comparatorTrimReplace:LD,tildeTrimReplace:UD,caretTrimReplace:jD}=pD,qD=(e,t)=>{let n=!0,r=e.slice(),i=r.pop();for(;n&&r.length;)n=r.every((e=>i.intersects(e,t))),i=r.pop();return n},zD=(e,t)=>(lD("comp",e,t),e=KD(e,t),lD("caret",e),e=GD(e,t),lD("tildes",e),e=XD(e,t),lD("xrange",e),e=JD(e,t),lD("stars",e),e),HD=e=>!e||"x"===e.toLowerCase()||"*"===e,GD=(e,t)=>e.trim().split(/\s+/).map((e=>VD(e,t))).join(" "),VD=(e,t)=>{let n=t.loose?DD[FD.TILDELOOSE]:DD[FD.TILDE];return e.replace(n,((t,n,r,i,a)=>{let o;return lD("tilde",e,t,n,r,i,a),HD(n)?o="":HD(r)?o=`>=${n}.0.0 <${+n+1}.0.0-0`:HD(i)?o=`>=${n}.${r}.0 <${n}.${+r+1}.0-0`:a?(lD("replaceTilde pr",a),o=`>=${n}.${r}.${i}-${a} <${n}.${+r+1}.0-0`):o=`>=${n}.${r}.${i} <${n}.${+r+1}.0-0`,lD("tilde return",o),o}))},KD=(e,t)=>e.trim().split(/\s+/).map((e=>WD(e,t))).join(" "),WD=(e,t)=>{lD("caret",e,t);let n=t.loose?DD[FD.CARETLOOSE]:DD[FD.CARET],r=t.includePrerelease?"-0":"";return e.replace(n,((t,n,i,a,o)=>{let s;return lD("caret",e,t,n,i,a,o),HD(n)?s="":HD(i)?s=`>=${n}.0.0${r} <${+n+1}.0.0-0`:HD(a)?s="0"===n?`>=${n}.${i}.0${r} <${n}.${+i+1}.0-0`:`>=${n}.${i}.0${r} <${+n+1}.0.0-0`:o?(lD("replaceCaret pr",o),s="0"===n?"0"===i?`>=${n}.${i}.${a}-${o} <${n}.${i}.${+a+1}-0`:`>=${n}.${i}.${a}-${o} <${n}.${+i+1}.0-0`:`>=${n}.${i}.${a}-${o} <${+n+1}.0.0-0`):(lD("no pr"),s="0"===n?"0"===i?`>=${n}.${i}.${a}${r} <${n}.${i}.${+a+1}-0`:`>=${n}.${i}.${a}${r} <${n}.${+i+1}.0-0`:`>=${n}.${i}.${a} <${+n+1}.0.0-0`),lD("caret return",s),s}))},XD=(e,t)=>(lD("replaceXRanges",e,t),e.split(/\s+/).map((e=>$D(e,t))).join(" ")),$D=(e,t)=>{e=e.trim();let n=t.loose?DD[FD.XRANGELOOSE]:DD[FD.XRANGE];return e.replace(n,((n,r,i,a,o,s)=>{lD("xRange",e,n,r,i,a,o,s);let c=HD(i),u=c||HD(a),f=u||HD(o),d=f;return"="===r&&d&&(r=""),s=t.includePrerelease?"-0":"",c?n=">"===r||"<"===r?"<0.0.0-0":"*":r&&d?(u&&(a=0),o=0,">"===r?(r=">=",u?(i=+i+1,a=0,o=0):(a=+a+1,o=0)):"<="===r&&(r="<",u?i=+i+1:a=+a+1),"<"===r&&(s="-0"),n=`${r+i}.${a}.${o}${s}`):u?n=`>=${i}.0.0${s} <${+i+1}.0.0-0`:f&&(n=`>=${i}.${a}.0${s} <${i}.${+a+1}.0-0`),lD("xRange return",n),n}))},JD=(e,t)=>(lD("replaceStars",e,t),e.trim().replace(DD[FD.STAR],"")),YD=(e,t)=>(lD("replaceGTE0",e,t),e.trim().replace(DD[t.includePrerelease?FD.GTE0PRE:FD.GTE0],"")),QD=e=>(t,n,r,i,a,o,s,c,u,f,d,l,p)=>`${n=HD(r)?"":HD(i)?`>=${r}.0.0${e?"-0":""}`:HD(a)?`>=${r}.${i}.0${e?"-0":""}`:o?`>=${n}`:`>=${n}${e?"-0":""}`} ${c=HD(u)?"":HD(f)?`<${+u+1}.0.0-0`:HD(d)?`<${u}.${+f+1}.0-0`:l?`<=${u}.${f}.${d}-${l}`:e?`<${u}.${f}.${+d+1}-0`:`<=${c}`}`.trim(),ZD=(e,t,n)=>{for(let n=0;n<e.length;n++)if(!e[n].test(t))return!1;if(t.prerelease.length&&!n.includePrerelease){for(let n=0;n<e.length;n++)if(lD(e[n].semver),e[n].semver!==MD.ANY&&e[n].semver.prerelease.length>0){let r=e[n].semver;if(r.major===t.major&&r.minor===t.minor&&r.patch===t.patch)return!0}return!1}return!0},eF=(e,t,n)=>{try{t=new BD(t,n)}catch(e){return!1}return t.test(e)},{MAX_LENGTH:tF}=fD,{re:nF,t:rF}=pD,iF=(e,t)=>{if(t&&"object"==typeof t||(t={loose:!!t,includePrerelease:!1}),e instanceof ED)return e;if("string"!=typeof e||e.length>tF||!(t.loose?nF[rF.LOOSE]:nF[rF.FULL]).test(e))return null;try{return new ED(e,t)}catch(e){return null}},{re:aF,t:oF}=pD,sF=(e,t)=>{if(e instanceof ED)return e;if("number"==typeof e&&(e=String(e)),"string"!=typeof e)return null;let n=null;if((t=t||{}).rtl){let t;for(;(t=aF[oF.COERCERTL].exec(e))&&(!n||n.index+n[0].length!==e.length);)n&&t.index+t[0].length===n.index+n[0].length||(n=t),aF[oF.COERCERTL].lastIndex=t.index+t[1].length+t[2].length;aF[oF.COERCERTL].lastIndex=-1}else n=e.match(aF[oF.COERCE]);return null===n?null:iF(`${n[2]}.${n[3]||"0"}.${n[4]||"0"}`,t)};function cF(e){return String.fromCharCode(parseInt(e.slice(1),16))}function uF(e){return`%${`00${e.charCodeAt(0).toString(16)}`.slice(-2)}`}function fF(e){return function(e){return btoa(encodeURIComponent(e).replace(/%[0-9A-F]{2}/g,cF))}(JSON.stringify(e))}function dF(e){return JSON.parse(function(e){return decodeURIComponent(Array.from(atob(e),uF).join(""))}(e))}function lF(e){return void 0===e}function pF(e){return function(e){return null===e}(e)||lF(e)}function hF(e){if(!e)return!0;for(let t in e)if(Object.hasOwnProperty.call(e,t))return!1;return!0}var bF={};var mF={"magic-sdk":"magic-sdk","@magic-sdk/react-native":"magic-sdk-rn","@magic-sdk/react-native-bare":"magic-sdk-rn-bare","@magic-sdk/react-native-expo":"magic-sdk-rn-expo"},yF=class extends Error{constructor(e,t){super(`Magic SDK Error: [${e}] ${t}`),this.code=e,this.rawMessage=t,this.__proto__=Error,Object.setPrototypeOf(this,yF.prototype)}},gF=class extends Error{constructor(e){super(),this.__proto__=Error;let t=Number(null==e?void 0:e.code);this.rawMessage=(null==e?void 0:e.message)||"Internal error",this.code=function(e){return!pF(e)&&"number"==typeof e&&Object.values(VB).includes(e)}(t)?t:VB.InternalError,this.message=`Magic RPC Error: [${this.code}] ${this.rawMessage}`,this.data=(null==e?void 0:e.data)||void 0,Object.setPrototypeOf(this,gF.prototype)}},vF=class{constructor(e,t){this.code=e,this.rawMessage=t,this.message=`Magic SDK Warning: [${e}] ${t}`}log(){console.warn(this.message)}},wF=class extends Error{constructor(e,t,n,r){super(`Magic Extension Error (${e.name}): [${t}] ${n}`),this.code=t,this.rawMessage=n,this.data=r,this.__proto__=Error,Object.setPrototypeOf(this,wF.prototype)}},_F=class{constructor(e,t,n){this.code=t,this.rawMessage=n,this.message=`Magic Extension Warning (${e.name}): [${t}] ${n}`}log(){console.warn(this.message)}};function EF(){return new yF(HB.MissingApiKey,"Please provide an API key that you acquired from the Magic developer dashboard.")}function TF(){return new yF(HB.MalformedResponse,"Response from the Magic iframe is malformed.")}function AF(e){return new yF(HB.ExtensionNotInitialized,`Extensions must be initialized with a Magic SDK instance before \`Extension.${e}\` can be accessed. Do not invoke \`Extension.${e}\` inside an extension constructor.`)}function RF(e){let t=`Some extensions are incompatible with \`${bF.sdkName}@${bF.version}\`:`;return e.filter((e=>void 0!==e.compat&&null!==e.compat)).forEach((e=>{let n=e.compat[bF.sdkName];"string"==typeof n?t+=`\n - Extension \`${e.name}\` supports version(s) \`${n}\``:n||(t+=`\n - Extension \`${e.name}\` does not support ${bF.platform} environments.`)})),new yF(HB.IncompatibleExtensions,t)}function SF(e){return new yF(HB.InvalidArgument,`Invalid ${(e=>{let t=e+1,n=t%10,r=t%100;return 1===n&&11!==r?`${t}st`:2===n&&12!==r?`${t}nd`:3===n&&13!==r?`${t}rd`:`${t}th`})(e.argument)} argument given to \`${e.procedure}\`.\n Expected: \`${e.expected}\`\n Received: \`${e.received}\``)}function kF(){return new vF(GB.ReactNativeEndpointConfiguration,`CUSTOM DOMAINS ARE NOT SUPPORTED WHEN USING MAGIC SDK WITH REACT NATIVE! The \`endpoint\` parameter SHOULD NOT be provided. The Magic \`<iframe>\` is automatically wrapped by a WebView pointed at \`${bF.defaultEndpoint}\`. Changing this default behavior will lead to unexpected results and potentially security-threatening bugs.`)}var IF=function*(){let e=0;for(;;)e<Number.MAX_SAFE_INTEGER?yield++e:e=0}();function OF(){return IF.next().value}var xF=Symbol("Payload pre-processed by Magic SDK");function CF(e){return Object.defineProperty(e,xF,{value:!0,enumerable:!1}),e}function MF(e){var t,n,r;return function(e){return!!e[xF]}(e)||(e.jsonrpc=null!=(t=e.jsonrpc)?t:"2.0",e.id=OF(),e.method=null!=(n=e.method)?n:"noop",e.params=null!=(r=e.params)?r:[],CF(e)),e}function PF(e,t=[]){return CF({params:t,method:e,jsonrpc:"2.0",id:OF()})}var NF=class{constructor(e){e instanceof NF?(this._jsonrpc=e.payload.jsonrpc,this._id=e.payload.id,this._result=e.payload.result,this._error=e.payload.error):function(e){return!pF(e)&&!(lF(e.jsonrpc)||lF(e.id)||lF(e.result)&&lF(e.error))}(e)?(this._jsonrpc=e.jsonrpc,this._id=e.id,this._result=e.result,this._error=e.error):(this._jsonrpc=e.jsonrpc,this._id=e.id,this._result=void 0,this._error=void 0)}applyError(e){return this._error=e,this}applyResult(e){return this._result=e,this}get hasError(){return void 0!==this._error&&null!==this._error}get hasResult(){return void 0!==this._result}get payload(){return{jsonrpc:this._jsonrpc,id:this._id,result:this._result,error:this._error}}},BF=((e,t,n)=>(n=null!=e?JB(rD(e)):{},((e,t,n,r)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let i of tD(t))!iD.call(e,i)&&i!==n&&YB(e,i,{get:()=>t[i],enumerable:!(r=ZB(t,i))||r.enumerable});return e})(!t&&e&&e.__esModule?n:YB(n,"default",{value:e,enumerable:!0}),e)))(uD()),DF=class extends BF.default{};function FF(){let e=new DF;return{emitter:e,createChainingEmitterMethod:(t,n)=>(...r)=>(e[t].apply(e,r),n),createBoundEmitterMethod:t=>(...n)=>e[t].apply(e,n)}}var LF=Symbol("isPromiEvent");function UF(e){return!!e[LF]}function jF(e){let t=qF(e),{createBoundEmitterMethod:n,createChainingEmitterMethod:r}=FF(),i=Symbol("Promise.then"),a=Symbol("Promise.catch"),o=Symbol("Promise.finally"),s=(e,t)=>(...n)=>{let r=t[e].apply(t,n);return c(r)},c=e=>Object.assign(e,{[LF]:!0,[i]:e[i]||e.then,[a]:e[a]||e.catch,[o]:e[o]||e.finally,then:s(i,e),catch:s(a,e),finally:s(o,e),on:r("on",e),once:r("once",e),addListener:r("addListener",e),off:r("off",e),removeListener:r("removeListener",e),removeAllListeners:r("removeAllListeners",e),emit:n("emit"),eventNames:n("eventNames"),listeners:n("listeners"),listenerCount:n("listenerCount")}),u=c(t.then((e=>(u.emit("done",e),u.emit("settled"),e)),(e=>{throw u.emit("error",e),u.emit("settled"),e})));return u}function qF(e){return new Promise(((t,n)=>{let r=e(t,n);Promise.resolve(r).catch(n)}))}var zF,HF=class{constructor(e){this.sdk=e}get overlay(){return this.sdk.overlay}request(e){let t=this.overlay.post(XB.MAGIC_HANDLE_REQUEST,MF(e)),n=jF(((e,n)=>{t.then((t=>{if(r(),t.hasError)n(new gF(t.payload.error));else{if(!t.hasResult)throw TF();e(t.payload.result)}})).catch((e=>{r(),n(e)}))})),r=this.overlay.on(WB.MAGIC_HANDLE_EVENT,(t=>{var r;let{response:i}=t.data;if(i.id===e.id&&(null==(r=i.result)?void 0:r.event)){let{event:e,params:t=[]}=i.result;n.emit(e,...t)}}));return n}createIntermediaryEvent(e,t){return n=>{let r=PF(KB.IntermediaryEvent,[{payloadId:t,eventType:e,args:n}]);this.request(r)}}},GF=class extends HF{loginWithMagicLink(e){let{email:t,showUI:n=!0,redirectURI:r}=e,i=PF(this.sdk.testMode?KB.LoginWithMagicLinkTestMode:KB.LoginWithMagicLink,[{email:t,showUI:n,redirectURI:r}]);return this.request(i)}loginWithSMS(e){let{phoneNumber:t}=e,n=PF(this.sdk.testMode?KB.LoginWithSmsTestMode:KB.LoginWithSms,[{phoneNumber:t,showUI:!0}]);return this.request(n)}loginWithEmailOTP(e){let{email:t,showUI:n}=e,r=PF(this.sdk.testMode?KB.LoginWithEmailOTPTestMode:KB.LoginWithEmailOTP,[{email:t,showUI:n}]);if(!n){let e=this.request(r);return e&&e.on("otp-input-sent",(e=>{this.createIntermediaryEvent("verify-email-otp",r.id)(e)})),e}return this.request(r)}loginWithCredential(e){let t=null!=e?e:"";if(!e&&"web"===bF.platform){t=window.location.search;let e=window.location.origin+window.location.pathname;window.history.replaceState(null,"",e)}let n=PF(this.sdk.testMode?KB.LoginWithCredentialTestMode:KB.LoginWithCredential,[t]);return this.request(n)}},VF={};function KF(e){return(...t)=>cD(this,null,(function*(){return zF||(zF=yield bF.configureStorage()),yield zF.ready(),zF[e](...t)}))}((e,t)=>{for(var n in t)YB(e,n,{get:t[n],enumerable:!0})})(VF,{clear:()=>JF,getItem:()=>WF,iterate:()=>eL,key:()=>QF,keys:()=>ZF,length:()=>YF,removeItem:()=>$F,setItem:()=>XF});var WF=KF("getItem"),XF=KF("setItem"),$F=KF("removeItem"),JF=KF("clear"),YF=KF("length"),QF=KF("key"),ZF=KF("keys"),eL=KF("iterate");function tL(){let e=window.crypto.getRandomValues(new Uint8Array(16));e[6]=15&e[6]|64,e[8]=191&e[8]|128;let t="";return t+=e[0].toString(16),t+=e[1].toString(16),t+=e[2].toString(16),t+=e[3].toString(16),t+="-",t+=e[4].toString(16),t+=e[5].toString(16),t+="-",t+=e[6].toString(16),t+=e[7].toString(16),t+="-",t+=e[8].toString(16),t+=e[9].toString(16),t+="-",t+=e[10].toString(16),t+=e[11].toString(16),t+=e[12].toString(16),t+=e[13].toString(16),t+=e[14].toString(16),t+=e[15].toString(16),t}var nL="STORE_KEY_PRIVATE_KEY",rL="STORE_KEY_PUBLIC_JWK",iL="ECDSA",aL="P-256",oL={name:iL,namedCurve:aL},sL={name:iL,namedCurve:aL};function cL(){$F(rL),$F(nL)}function uL(){return cD(this,null,(function*(){let e=yield function(){return cD(this,null,(function*(){if(function(){let e="undefined"!=typeof window&&!!window.crypto,t=e&&!!window.crypto.subtle;return e&&t}())return(yield WF(rL))||(yield function(){return cD(this,null,(function*(){let e=null,{subtle:t}=window.crypto,n=yield t.generateKey(oL,!0,["sign"]),r=yield t.exportKey("jwk",n.privateKey);e=yield t.exportKey("jwk",n.publicKey);let i=yield t.importKey("jwk",r,sL,!1,["sign"]);yield XF(nL,i),yield XF(rL,e)}))}()),WF(rL);console.info("webcrypto is not supported")}))}();if(!e)return void console.info("unable to create public key or webcrypto is unsupported");let{subtle:t}=window.crypto,n=yield WF(nL);if(!n||!t)return void console.info("unable to find private key or webcrypto unsupported");let r={iat:Math.floor((new Date).getTime()/1e3),jti:tL()},i={typ:"dpop+jwt",alg:"ES256",jwk:e},a=fL(JSON.stringify(i)),o=fL(JSON.stringify(r)),s=function(e){return(new TextEncoder).encode(e)}(`${a}.${o}`),c={name:iL,hash:{name:"SHA-256"}},u=function(e){let t="";return e.forEach((e=>{t+=String.fromCharCode(e)})),dL(t)}(new Uint8Array(yield t.sign(c,n,s)));return`${a}.${o}.${u}`}))}function fL(e){return dL(function(e){return encodeURIComponent(e).replace(/%([0-9A-F]{2})/g,((e,t)=>String.fromCharCode(parseInt(t,16))))}(e))}function dL(e){return btoa(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+/g,"")}var lL=class extends HF{getIdToken(e){let t=PF(this.sdk.testMode?KB.GetIdTokenTestMode:KB.GetIdToken,[e]);return this.request(t)}generateIdToken(e){let t=PF(this.sdk.testMode?KB.GenerateIdTokenTestMode:KB.GenerateIdToken,[e]);return this.request(t)}getMetadata(){let e=PF(this.sdk.testMode?KB.GetMetadataTestMode:KB.GetMetadata);return this.request(e)}updateEmail(e){let{email:t,showUI:n=!0}=e,r=PF(this.sdk.testMode?KB.UpdateEmailTestMode:KB.UpdateEmail,[{email:t,showUI:n}]);return this.request(r)}isLoggedIn(){let e=PF(this.sdk.testMode?KB.IsLoggedInTestMode:KB.IsLoggedIn);return this.request(e)}logout(){cL();let e=PF(this.sdk.testMode?KB.LogoutTestMode:KB.Logout);return this.request(e)}showSettings(){let e=PF(this.sdk.testMode?KB.UserSettingsTestMode:KB.UserSettings);return this.request(e)}updatePhoneNumber(){let e=PF(this.sdk.testMode?KB.UpdatePhoneNumberTestMode:KB.UpdatePhoneNumber);return this.request(e)}recoverAccount(e){let t=PF(this.sdk.testMode?KB.RecoverAccountTestMode:KB.RecoverAccount,[e]);return this.request(t)}},pL=class extends HF{connectWithUI(){let e=PF(KB.RequestAccounts);return this.request(e)}showUI(){let e=PF(KB.ShowUI);return this.request(e)}getInfo(){let e=PF(KB.GetInfo);return this.request(e)}requestUserInfoWithUI(e){let t=PF(KB.RequestUserInfoWithUI,e?[e]:[]);return this.request(t)}disconnect(){cL();let e=PF(KB.Disconnect);return this.request(e)}},{createBoundEmitterMethod:hL,createChainingEmitterMethod:bL}=FF(),mL=class extends HF{constructor(){super(...arguments),this.isMagic=!0,this.on=bL("on",this),this.once=bL("once",this),this.addListener=bL("addListener",this),this.off=bL("off",this),this.removeListener=bL("removeListener",this),this.removeAllListeners=bL("removeAllListeners",this),this.emit=hL("emit"),this.eventNames=hL("eventNames"),this.listeners=hL("listeners"),this.listenerCount=hL("listenerCount")}sendAsync(e,t){if(!t)throw SF({procedure:"Magic.rpcProvider.sendAsync",argument:1,expected:"function",received:null===t?"null":typeof t});if(Array.isArray(e))this.overlay.post(XB.MAGIC_HANDLE_REQUEST,e.map((e=>{let t=MF(e);return this.prefixPayloadMethodForTestMode(t),t}))).then((e=>{t(null,e.map((e=>((e,t)=>QB(e,eD(t)))(sD({},e.payload),{error:e.hasError?new gF(e.payload.error):null}))))}));else{let n=MF(e);this.prefixPayloadMethodForTestMode(n),this.overlay.post(XB.MAGIC_HANDLE_REQUEST,n).then((e=>{t(e.hasError?new gF(e.payload.error):null,e.payload)}))}}send(e,t){if("string"==typeof e){let n=PF(e,Array.isArray(t)?t:[]);return this.request(n)}if(Array.isArray(e)||t)return void this.sendAsync(e,t);let n=new vF(GB.SyncWeb3Method,"Non-async web3 methods are deprecated in web3 > 1.0 and are not supported by the Magic web3 provider. Please use an async method instead.");return n.log(),new NF(e).applyError({code:-32603,message:n.rawMessage}).payload}enable(){let e=PF("eth_accounts");return this.request(e)}request(e){return this.prefixPayloadMethodForTestMode(e),super.request(e)}prefixPayloadMethodForTestMode(e){this.sdk.testMode&&(e.method=`testMode/eth/${e.method}`)}};function yL(e,t){return t?new URL(e,t):new URL(e)}var gL=["request","overlay","sdk"];function vL(e){let t=Object.getPrototypeOf(e),n=[t];for(;t!==HF.prototype;)t=Object.getPrototypeOf(t),n.push(t);return n}var wL=class extends HF{constructor(){super(void 0),this.__sdk_access_field_descriptors__=new Map,this.__is_initialized__=!1,this.utils={createPromiEvent:jF,isPromiEvent:UF,encodeJSON:fF,decodeJSON:dF,createJsonRpcRequestPayload:PF,standardizeJsonRpcRequestPayload:MF,storage:VF};let e=[this,...vL(this)];gL.forEach((t=>{let n=e.map((e=>Object.getOwnPropertyDescriptor(e,t))),r=n.findIndex((e=>!!e)),i=r>0,a=n[r];a&&(this.__sdk_access_field_descriptors__.set(t,{descriptor:a,isPrototypeField:i}),Object.defineProperty(this,t,{configurable:!0,get:()=>{throw AF(t)}}))}))}init(e){this.__is_initialized__||(gL.forEach((e=>{if(this.__sdk_access_field_descriptors__.has(e)){let{descriptor:t,isPrototypeField:n}=this.__sdk_access_field_descriptors__.get(e);n?delete this[e]:Object.defineProperty(this,e,t)}})),this.sdk=e,this.__is_initialized__=!0)}createDeprecationWarning(e){let{method:t,removalVersion:n,useInstead:r}=e;return new _F(this,"DEPRECATION_NOTICE",`\`${t}\` will be removed from this Extension in version \`${n}\`.${r?` Use \`${r}\` instead.`:""}`)}createWarning(e,t){return new _F(this,e,t)}createError(e,t,n){return new wF(this,e,t,n)}},_L=class extends wL{};_L.Internal=class extends wL{},_L.Anonymous="anonymous extension";var EL=class extends HF{purchase(e){let t=PF(KB.NFTPurchase,[e]);return this.request(t)}};function TL(e){return!e.compat||null==e.compat[bF.sdkName]||("string"==typeof e.compat[bF.sdkName]?eF(sF(bF.version),e.compat[bF.sdkName]):!!e.compat[bF.sdkName])}function AL(e){var t;let n=null!=(t=null==e?void 0:e.extensions)?t:[],r={},i=[];if(Array.isArray(n)?n.forEach((e=>{TL(e)?(e.init(this),(e.name||e.name!==_L.Anonymous)&&(this[e.name]=e),e instanceof _L.Internal&&(hF(e.config)||(r[e.name]=e.config))):i.push(e)})):Object.keys(n).forEach((e=>{if(TL(n[e])){n[e].init(this);let t=n[e];this[e]=t,t instanceof _L.Internal&&(hF(t.config)||(r[n[e].name]=t.config))}else i.push(n[e])})),i.length)throw RF(i);return r}var RL=class{constructor(e,t){var n;if(this.apiKey=e,!e)throw EF();"react-native"===bF.platform&&(null==t?void 0:t.endpoint)&&kF().log();let{defaultEndpoint:r,version:i}=bF;this.testMode=!(null==t||!t.testMode),this.endpoint=yL(null!=(n=null==t?void 0:t.endpoint)?n:r).origin,this.auth=new GF(this),this.user=new lL(this),this.wallet=new pL(this),this.nft=new EL(this),this.rpcProvider=new mL(this);let a=AL.call(this,t);this.parameters=fF(sD({API_KEY:this.apiKey,DOMAIN_ORIGIN:window.location?window.location.origin:"",ETH_NETWORK:null==t?void 0:t.network,host:yL(this.endpoint).host,sdk:mF[bF.sdkName],version:i,ext:hF(a)?void 0:a,locale:(null==t?void 0:t.locale)||"en_US"},bF.bundleId?{bundleId:bF.bundleId}:{}))}get overlay(){if(!RL.__overlays__.has(this.parameters)){let e=new bF.ViewController(this.endpoint,this.parameters);e.init(),RL.__overlays__.set(this.parameters,e)}return RL.__overlays__.get(this.parameters)}preload(){return cD(this,null,(function*(){yield this.overlay.ready}))}},SL=RL;function kL(e,t){var n;let r=null==(n=t.data.response)?void 0:n.id,i=function(e,t){return t&&Array.isArray(e)?e.find((e=>e.id===t)):e}(e,r);if(r&&i){return{id:r,response:new NF(i).applyResult(t.data.response.result).applyError(t.data.response.error)}}return{}}SL.__overlays__=new Map;var IL=class{constructor(e,t){this.endpoint=e,this.parameters=t,this.messageHandlers=new Set,this.ready=this.waitForReady(),this.listen()}post(e,t){return cD(this,null,(function*(){return qF((n=>cD(this,null,(function*(){yield this.ready;let r=[],i=Array.isArray(t)?t.map((e=>e.id)):[],a=yield function(e,t){return cD(this,null,(function*(){let n,r=yield WF("rt");if("web"===bF.platform)try{n=yield uL()}catch(e){console.error("webcrypto error",e)}return n?r?{msgType:e,payload:t,jwt:n,rt:r}:{msgType:e,payload:t,jwt:n}:{msgType:e,payload:t}}))}(`${e}-${this.parameters}`,t);yield this._post(a);let o=this.on(WB.MAGIC_HANDLE_RESPONSE,(e=>a=>{let{id:o,response:s}=kL(t,a);(function(e){cD(this,null,(function*(){!e.data.rt||(yield XF("rt",e.data.rt))}))})(a),o&&s&&Array.isArray(t)&&i.includes(o)?(r.push(s),r.length===t.length&&(e(),n(r))):o&&s&&!Array.isArray(t)&&o===t.id&&(e(),n(s))})((()=>o())))}))))}))}on(e,t){let n=t.bind(window),r=t=>{t.data.msgType===`${e}-${this.parameters}`&&n(t)};return this.messageHandlers.add(r),()=>this.messageHandlers.delete(r)}waitForReady(){return new Promise((e=>{this.on(WB.MAGIC_OVERLAY_READY,(()=>e()))}))}listen(){this.on(WB.MAGIC_HIDE_OVERLAY,(()=>{this.hideOverlay()})),this.on(WB.MAGIC_SHOW_OVERLAY,(()=>{this.showOverlay()}))}},OL=Object.create,xL=Object.defineProperty,CL=Object.getOwnPropertyDescriptor,ML=Object.getOwnPropertyNames,PL=Object.getPrototypeOf,NL=Object.prototype.hasOwnProperty,BL=(e=>"undefined"!=typeof require?require:"undefined"!=typeof Proxy?new Proxy(e,{get:(e,t)=>("undefined"!=typeof require?require:e)[t]}):e)((function(e){if("undefined"!=typeof require)return require.apply(this,arguments);throw new Error('Dynamic require of "'+e+'" is not supported')})),DL=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),FL=(e,t,n)=>(n=null!=e?OL(PL(e)):{},((e,t,n,r)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let i of ML(t))!NL.call(e,i)&&i!==n&&xL(e,i,{get:()=>t[i],enumerable:!(r=CL(t,i))||r.enumerable});return e})(!t&&e&&e.__esModule?n:xL(n,"default",{value:e,enumerable:!0}),e)),LL=(e,t,n)=>new Promise(((r,i)=>{var a=e=>{try{s(n.next(e))}catch(e){i(e)}},o=e=>{try{s(n.throw(e))}catch(e){i(e)}},s=e=>e.done?r(e.value):Promise.resolve(e.value).then(a,o);s((n=n.apply(e,t)).next())})),UL=DL(((e,t)=>{!function(n){if("object"==typeof e&&typeof t<"u")t.exports=n();else if("function"==typeof define&&define.amd)define([],n);else{(typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:this).localforage=n()}}((function(){return function e(t,n,r){function i(o,s){if(!n[o]){if(!t[o]){var c="function"==typeof BL&&BL;if(!s&&c)return c(o,!0);if(a)return a(o,!0);var u=new Error("Cannot find module '"+o+"'");throw u.code="MODULE_NOT_FOUND",u}var f=n[o]={exports:{}};t[o][0].call(f.exports,(function(e){return i(t[o][1][e]||e)}),f,f.exports,e,t,n,r)}return n[o].exports}for(var a="function"==typeof BL&&BL,o=0;o<r.length;o++)i(r[o]);return i}({1:[function(e,t,n){(function(e){var n,r=e.MutationObserver||e.WebKitMutationObserver;if(r){var i=0,a=new r(f),o=e.document.createTextNode("");a.observe(o,{characterData:!0}),n=function(){o.data=i=++i%2}}else if(!e.setImmediate&&typeof e.MessageChannel<"u"){var s=new e.MessageChannel;s.port1.onmessage=f,n=function(){s.port2.postMessage(0)}}else n="document"in e&&"onreadystatechange"in e.document.createElement("script")?function(){var t=e.document.createElement("script");t.onreadystatechange=function(){f(),t.onreadystatechange=null,t.parentNode.removeChild(t),t=null},e.document.documentElement.appendChild(t)}:function(){setTimeout(f,0)};var c,u=[];function f(){c=!0;for(var e,t,n=u.length;n;){for(t=u,u=[],e=-1;++e<n;)t[e]();n=u.length}c=!1}t.exports=function(e){1===u.push(e)&&!c&&n()}}).call(this,typeof global<"u"?global:typeof self<"u"?self:typeof window<"u"?window:{})},{}],2:[function(e,t,n){var r=e(1);function i(){}var a={},o=["REJECTED"],s=["FULFILLED"],c=["PENDING"];function u(e){if("function"!=typeof e)throw new TypeError("resolver must be a function");this.state=c,this.queue=[],this.outcome=void 0,e!==i&&p(this,e)}function f(e,t,n){this.promise=e,"function"==typeof t&&(this.onFulfilled=t,this.callFulfilled=this.otherCallFulfilled),"function"==typeof n&&(this.onRejected=n,this.callRejected=this.otherCallRejected)}function d(e,t,n){r((function(){var r;try{r=t(n)}catch(t){return a.reject(e,t)}r===e?a.reject(e,new TypeError("Cannot resolve promise with itself")):a.resolve(e,r)}))}function l(e){var t=e&&e.then;if(e&&("object"==typeof e||"function"==typeof e)&&"function"==typeof t)return function(){t.apply(e,arguments)}}function p(e,t){var n=!1;function r(t){n||(n=!0,a.reject(e,t))}function i(t){n||(n=!0,a.resolve(e,t))}var o=h((function(){t(i,r)}));"error"===o.status&&r(o.value)}function h(e,t){var n={};try{n.value=e(t),n.status="success"}catch(e){n.status="error",n.value=e}return n}t.exports=u,u.prototype.catch=function(e){return this.then(null,e)},u.prototype.then=function(e,t){if("function"!=typeof e&&this.state===s||"function"!=typeof t&&this.state===o)return this;var n=new this.constructor(i);this.state!==c?d(n,this.state===s?e:t,this.outcome):this.queue.push(new f(n,e,t));return n},f.prototype.callFulfilled=function(e){a.resolve(this.promise,e)},f.prototype.otherCallFulfilled=function(e){d(this.promise,this.onFulfilled,e)},f.prototype.callRejected=function(e){a.reject(this.promise,e)},f.prototype.otherCallRejected=function(e){d(this.promise,this.onRejected,e)},a.resolve=function(e,t){var n=h(l,t);if("error"===n.status)return a.reject(e,n.value);var r=n.value;if(r)p(e,r);else{e.state=s,e.outcome=t;for(var i=-1,o=e.queue.length;++i<o;)e.queue[i].callFulfilled(t)}return e},a.reject=function(e,t){e.state=o,e.outcome=t;for(var n=-1,r=e.queue.length;++n<r;)e.queue[n].callRejected(t);return e},u.resolve=function(e){return e instanceof this?e:a.resolve(new this(i),e)},u.reject=function(e){var t=new this(i);return a.reject(t,e)},u.all=function(e){var t=this;if("[object Array]"!==Object.prototype.toString.call(e))return this.reject(new TypeError("must be an array"));var n=e.length,r=!1;if(!n)return this.resolve([]);for(var o=new Array(n),s=0,c=-1,u=new this(i);++c<n;)f(e[c],c);return u;function f(e,i){t.resolve(e).then((function(e){o[i]=e,++s===n&&!r&&(r=!0,a.resolve(u,o))}),(function(e){r||(r=!0,a.reject(u,e))}))}},u.race=function(e){var t=this;if("[object Array]"!==Object.prototype.toString.call(e))return this.reject(new TypeError("must be an array"));var n=e.length,r=!1;if(!n)return this.resolve([]);for(var o=-1,s=new this(i);++o<n;)c(e[o]);return s;function c(e){t.resolve(e).then((function(e){r||(r=!0,a.resolve(s,e))}),(function(e){r||(r=!0,a.reject(s,e))}))}}},{1:1}],3:[function(e,t,n){(function(t){"function"!=typeof t.Promise&&(t.Promise=e(2))}).call(this,typeof global<"u"?global:typeof self<"u"?self:typeof window<"u"?window:{})},{2:2}],4:[function(e,t,n){var r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e};var i=function(){try{if(typeof indexedDB<"u")return indexedDB;if(typeof webkitIndexedDB<"u")return webkitIndexedDB;if(typeof mozIndexedDB<"u")return mozIndexedDB;if(typeof OIndexedDB<"u")return OIndexedDB;if(typeof msIndexedDB<"u")return msIndexedDB}catch{return}}();function a(e,t){e=e||[],t=t||{};try{return new Blob(e,t)}catch(i){if("TypeError"!==i.name)throw i;for(var n=new(typeof BlobBuilder<"u"?BlobBuilder:typeof MSBlobBuilder<"u"?MSBlobBuilder:typeof MozBlobBuilder<"u"?MozBlobBuilder:WebKitBlobBuilder),r=0;r<e.length;r+=1)n.append(e[r]);return n.getBlob(t.type)}}typeof Promise>"u"&&e(3);var o=Promise;function s(e,t){t&&e.then((function(e){t(null,e)}),(function(e){t(e)}))}function c(e,t,n){"function"==typeof t&&e.then(t),"function"==typeof n&&e.catch(n)}function u(e){return"string"!=typeof e&&(console.warn(e+" used as a key, but it is not a string."),e=String(e)),e}function f(){if(arguments.length&&"function"==typeof arguments[arguments.length-1])return arguments[arguments.length-1]}var d="local-forage-detect-blob-support",l=void 0,p={},h=Object.prototype.toString,b="readonly",m="readwrite";function y(e){return"boolean"==typeof l?o.resolve(l):function(e){return new o((function(t){var n=e.transaction(d,m),r=a([""]);n.objectStore(d).put(r,"key"),n.onabort=function(e){e.preventDefault(),e.stopPropagation(),t(!1)},n.oncomplete=function(){var e=navigator.userAgent.match(/Chrome\/(\d+)/),n=navigator.userAgent.match(/Edge\//);t(n||!e||parseInt(e[1],10)>=43)}})).catch((function(){return!1}))}(e).then((function(e){return l=e}))}function g(e){var t=p[e.name],n={};n.promise=new o((function(e,t){n.resolve=e,n.reject=t})),t.deferredOperations.push(n),t.dbReady?t.dbReady=t.dbReady.then((function(){return n.promise})):t.dbReady=n.promise}function v(e){var t=p[e.name].deferredOperations.pop();if(t)return t.resolve(),t.promise}function w(e,t){var n=p[e.name].deferredOperations.pop();if(n)return n.reject(t),n.promise}function _(e,t){return new o((function(n,r){if(p[e.name]=p[e.name]||{forages:[],db:null,dbReady:null,deferredOperations:[]},e.db){if(!t)return n(e.db);g(e),e.db.close()}var a=[e.name];t&&a.push(e.version);var o=i.open.apply(i,a);t&&(o.onupgradeneeded=function(t){var n=o.result;try{n.createObjectStore(e.storeName),t.oldVersion<=1&&n.createObjectStore(d)}catch(n){if("ConstraintError"!==n.name)throw n;console.warn('The database "'+e.name+'" has been upgraded from version '+t.oldVersion+" to version "+t.newVersion+', but the storage "'+e.storeName+'" already exists.')}}),o.onerror=function(e){e.preventDefault(),r(o.error)},o.onsuccess=function(){var t=o.result;t.onversionchange=function(e){e.target.close()},n(t),v(e)}}))}function E(e){return _(e,!1)}function T(e){return _(e,!0)}function A(e,t){if(!e.db)return!0;var n=!e.db.objectStoreNames.contains(e.storeName),r=e.version<e.db.version,i=e.version>e.db.version;if(r&&(e.version!==t&&console.warn('The database "'+e.name+"\" can't be downgraded from version "+e.db.version+" to version "+e.version+"."),e.version=e.db.version),i||n){if(n){var a=e.db.version+1;a>e.version&&(e.version=a)}return!0}return!1}function R(e){var t=function(e){for(var t=e.length,n=new ArrayBuffer(t),r=new Uint8Array(n),i=0;i<t;i++)r[i]=e.charCodeAt(i);return n}(atob(e.data));return a([t],{type:e.type})}function S(e){return e&&e.__local_forage_encoded_blob}function k(e){var t=this,n=t._initReady().then((function(){var e=p[t._dbInfo.name];if(e&&e.dbReady)return e.dbReady}));return c(n,e,e),n}function I(e,t,n,r){void 0===r&&(r=1);try{var i=e.db.transaction(e.storeName,t);n(null,i)}catch(i){if(r>0&&(!e.db||"InvalidStateError"===i.name||"NotFoundError"===i.name))return o.resolve().then((function(){if(!e.db||"NotFoundError"===i.name&&!e.db.objectStoreNames.contains(e.storeName)&&e.version<=e.db.version)return e.db&&(e.version=e.db.version+1),T(e)})).then((function(){return function(e){g(e);for(var t=p[e.name],n=t.forages,r=0;r<n.length;r++){var i=n[r];i._dbInfo.db&&(i._dbInfo.db.close(),i._dbInfo.db=null)}return e.db=null,E(e).then((function(t){return e.db=t,A(e)?T(e):t})).then((function(r){e.db=t.db=r;for(var i=0;i<n.length;i++)n[i]._dbInfo.db=r})).catch((function(t){throw w(e,t),t}))}(e).then((function(){I(e,t,n,r-1)}))})).catch(n);n(i)}}var O={_driver:"asyncStorage",_initStorage:function(e){var t=this,n={db:null};if(e)for(var r in e)n[r]=e[r];var i=p[n.name];i||(i={forages:[],db:null,dbReady:null,deferredOperations:[]},p[n.name]=i),i.forages.push(t),t._initReady||(t._initReady=t.ready,t.ready=k);var a=[];function s(){return o.resolve()}for(var c=0;c<i.forages.length;c++){var u=i.forages[c];u!==t&&a.push(u._initReady().catch(s))}var f=i.forages.slice(0);return o.all(a).then((function(){return n.db=i.db,E(n)})).then((function(e){return n.db=e,A(n,t._defaultConfig.version)?T(n):e})).then((function(e){n.db=i.db=e,t._dbInfo=n;for(var r=0;r<f.length;r++){var a=f[r];a!==t&&(a._dbInfo.db=n.db,a._dbInfo.version=n.version)}}))},_support:function(){try{if(!i||!i.open)return!1;var e=typeof openDatabase<"u"&&/(Safari|iPhone|iPad|iPod)/.test(navigator.userAgent)&&!/Chrome/.test(navigator.userAgent)&&!/BlackBerry/.test(navigator.platform),t="function"==typeof fetch&&-1!==fetch.toString().indexOf("[native code");return(!e||t)&&typeof indexedDB<"u"&&typeof IDBKeyRange<"u"}catch{return!1}}(),iterate:function(e,t){var n=this,r=new o((function(t,r){n.ready().then((function(){I(n._dbInfo,b,(function(i,a){if(i)return r(i);try{var o=a.objectStore(n._dbInfo.storeName).openCursor(),s=1;o.onsuccess=function(){var n=o.result;if(n){var r=n.value;S(r)&&(r=R(r));var i=e(r,n.key,s++);void 0!==i?t(i):n.continue()}else t()},o.onerror=function(){r(o.error)}}catch(e){r(e)}}))})).catch(r)}));return s(r,t),r},getItem:function(e,t){var n=this;e=u(e);var r=new o((function(t,r){n.ready().then((function(){I(n._dbInfo,b,(function(i,a){if(i)return r(i);try{var o=a.objectStore(n._dbInfo.storeName).get(e);o.onsuccess=function(){var e=o.result;void 0===e&&(e=null),S(e)&&(e=R(e)),t(e)},o.onerror=function(){r(o.error)}}catch(e){r(e)}}))})).catch(r)}));return s(r,t),r},setItem:function(e,t,n){var r=this;e=u(e);var i=new o((function(n,i){var a;r.ready().then((function(){return a=r._dbInfo,"[object Blob]"===h.call(t)?y(a.db).then((function(e){return e?t:function(e){return new o((function(t,n){var r=new FileReader;r.onerror=n,r.onloadend=function(n){var r=btoa(n.target.result||"");t({__local_forage_encoded_blob:!0,data:r,type:e.type})},r.readAsBinaryString(e)}))}(t)})):t})).then((function(t){I(r._dbInfo,m,(function(a,o){if(a)return i(a);try{var s=o.objectStore(r._dbInfo.storeName);null===t&&(t=void 0);var c=s.put(t,e);o.oncomplete=function(){void 0===t&&(t=null),n(t)},o.onabort=o.onerror=function(){var e=c.error?c.error:c.transaction.error;i(e)}}catch(e){i(e)}}))})).catch(i)}));return s(i,n),i},removeItem:function(e,t){var n=this;e=u(e);var r=new o((function(t,r){n.ready().then((function(){I(n._dbInfo,m,(function(i,a){if(i)return r(i);try{var o=a.objectStore(n._dbInfo.storeName).delete(e);a.oncomplete=function(){t()},a.onerror=function(){r(o.error)},a.onabort=function(){var e=o.error?o.error:o.transaction.error;r(e)}}catch(e){r(e)}}))})).catch(r)}));return s(r,t),r},clear:function(e){var t=this,n=new o((function(e,n){t.ready().then((function(){I(t._dbInfo,m,(function(r,i){if(r)return n(r);try{var a=i.objectStore(t._dbInfo.storeName).clear();i.oncomplete=function(){e()},i.onabort=i.onerror=function(){var e=a.error?a.error:a.transaction.error;n(e)}}catch(e){n(e)}}))})).catch(n)}));return s(n,e),n},length:function(e){var t=this,n=new o((function(e,n){t.ready().then((function(){I(t._dbInfo,b,(function(r,i){if(r)return n(r);try{var a=i.objectStore(t._dbInfo.storeName).count();a.onsuccess=function(){e(a.result)},a.onerror=function(){n(a.error)}}catch(e){n(e)}}))})).catch(n)}));return s(n,e),n},key:function(e,t){var n=this,r=new o((function(t,r){e<0?t(null):n.ready().then((function(){I(n._dbInfo,b,(function(i,a){if(i)return r(i);try{var o=a.objectStore(n._dbInfo.storeName),s=!1,c=o.openKeyCursor();c.onsuccess=function(){var n=c.result;n?0===e||s?t(n.key):(s=!0,n.advance(e)):t(null)},c.onerror=function(){r(c.error)}}catch(e){r(e)}}))})).catch(r)}));return s(r,t),r},keys:function(e){var t=this,n=new o((function(e,n){t.ready().then((function(){I(t._dbInfo,b,(function(r,i){if(r)return n(r);try{var a=i.objectStore(t._dbInfo.storeName).openKeyCursor(),o=[];a.onsuccess=function(){var t=a.result;t?(o.push(t.key),t.continue()):e(o)},a.onerror=function(){n(a.error)}}catch(e){n(e)}}))})).catch(n)}));return s(n,e),n},dropInstance:function(e,t){t=f.apply(this,arguments);var n,r=this.config();if((e="function"!=typeof e&&e||{}).name||(e.name=e.name||r.name,e.storeName=e.storeName||r.storeName),e.name){var a=e.name===r.name&&this._dbInfo.db?o.resolve(this._dbInfo.db):E(e).then((function(t){var n=p[e.name],r=n.forages;n.db=t;for(var i=0;i<r.length;i++)r[i]._dbInfo.db=t;return t}));n=e.storeName?a.then((function(t){if(t.objectStoreNames.contains(e.storeName)){var n=t.version+1;g(e);var r=p[e.name],a=r.forages;t.close();for(var s=0;s<a.length;s++){var c=a[s];c._dbInfo.db=null,c._dbInfo.version=n}var u=new o((function(t,r){var a=i.open(e.name,n);a.onerror=function(e){a.result.close(),r(e)},a.onupgradeneeded=function(){a.result.deleteObjectStore(e.storeName)},a.onsuccess=function(){var e=a.result;e.close(),t(e)}}));return u.then((function(e){r.db=e;for(var t=0;t<a.length;t++){var n=a[t];n._dbInfo.db=e,v(n._dbInfo)}})).catch((function(t){throw(w(e,t)||o.resolve()).catch((function(){})),t}))}})):a.then((function(t){g(e);var n=p[e.name],r=n.forages;t.close();for(var a=0;a<r.length;a++){r[a]._dbInfo.db=null}var s=new o((function(t,n){var r=i.deleteDatabase(e.name);r.onerror=function(){var e=r.result;e&&e.close(),n(r.error)},r.onblocked=function(){console.warn('dropInstance blocked for database "'+e.name+'" until all open connections are closed')},r.onsuccess=function(){var e=r.result;e&&e.close(),t(e)}}));return s.then((function(e){n.db=e;for(var t=0;t<r.length;t++){v(r[t]._dbInfo)}})).catch((function(t){throw(w(e,t)||o.resolve()).catch((function(){})),t}))}))}else n=o.reject("Invalid arguments");return s(n,t),n}};var x="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",C=/^~~local_forage_type~([^~]+)~/,M="__lfsc__:",P="arbf",N="blob",B="si08",D="ui08",F="uic8",L="si16",U="si32",j="ur16",q="ui32",z="fl32",H="fl64",G=Object.prototype.toString;function V(e){var t,n,r,i,a,o=.75*e.length,s=e.length,c=0;"="===e[e.length-1]&&(o--,"="===e[e.length-2]&&o--);var u=new ArrayBuffer(o),f=new Uint8Array(u);for(t=0;t<s;t+=4)n=x.indexOf(e[t]),r=x.indexOf(e[t+1]),i=x.indexOf(e[t+2]),a=x.indexOf(e[t+3]),f[c++]=n<<2|r>>4,f[c++]=(15&r)<<4|i>>2,f[c++]=(3&i)<<6|63&a;return u}function K(e){var t,n=new Uint8Array(e),r="";for(t=0;t<n.length;t+=3)r+=x[n[t]>>2],r+=x[(3&n[t])<<4|n[t+1]>>4],r+=x[(15&n[t+1])<<2|n[t+2]>>6],r+=x[63&n[t+2]];return n.length%3==2?r=r.substring(0,r.length-1)+"=":n.length%3==1&&(r=r.substring(0,r.length-2)+"=="),r}var W={serialize:function(e,t){var n="";if(e&&(n=G.call(e)),e&&("[object ArrayBuffer]"===n||e.buffer&&"[object ArrayBuffer]"===G.call(e.buffer))){var r,i=M;e instanceof ArrayBuffer?(r=e,i+=P):(r=e.buffer,"[object Int8Array]"===n?i+=B:"[object Uint8Array]"===n?i+=D:"[object Uint8ClampedArray]"===n?i+=F:"[object Int16Array]"===n?i+=L:"[object Uint16Array]"===n?i+=j:"[object Int32Array]"===n?i+=U:"[object Uint32Array]"===n?i+=q:"[object Float32Array]"===n?i+=z:"[object Float64Array]"===n?i+=H:t(new Error("Failed to get type for BinaryArray"))),t(i+K(r))}else if("[object Blob]"===n){var a=new FileReader;a.onload=function(){var n="~~local_forage_type~"+e.type+"~"+K(this.result);t(M+N+n)},a.readAsArrayBuffer(e)}else try{t(JSON.stringify(e))}catch(n){console.error("Couldn't convert value into a JSON string: ",e),t(null,n)}},deserialize:function(e){if(e.substring(0,9)!==M)return JSON.parse(e);var t,n=e.substring(13),r=e.substring(9,13);if(r===N&&C.test(n)){var i=n.match(C);t=i[1],n=n.substring(i[0].length)}var o=V(n);switch(r){case P:return o;case N:return a([o],{type:t});case B:return new Int8Array(o);case D:return new Uint8Array(o);case F:return new Uint8ClampedArray(o);case L:return new Int16Array(o);case j:return new Uint16Array(o);case U:return new Int32Array(o);case q:return new Uint32Array(o);case z:return new Float32Array(o);case H:return new Float64Array(o);default:throw new Error("Unkown type: "+r)}},stringToBuffer:V,bufferToString:K};function X(e,t,n,r){e.executeSql("CREATE TABLE IF NOT EXISTS "+t.storeName+" (id INTEGER PRIMARY KEY, key unique, value)",[],n,r)}function $(e,t,n,r,i,a){e.executeSql(n,r,i,(function(e,o){o.code===o.SYNTAX_ERR?e.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name = ?",[t.storeName],(function(e,s){s.rows.length?a(e,o):X(e,t,(function(){e.executeSql(n,r,i,a)}),a)}),a):a(e,o)}),a)}function J(e,t,n,r){var i=this;e=u(e);var a=new o((function(a,o){i.ready().then((function(){void 0===t&&(t=null);var s=t,c=i._dbInfo;c.serializer.serialize(t,(function(t,u){u?o(u):c.db.transaction((function(n){$(n,c,"INSERT OR REPLACE INTO "+c.storeName+" (key, value) VALUES (?, ?)",[e,t],(function(){a(s)}),(function(e,t){o(t)}))}),(function(t){if(t.code===t.QUOTA_ERR){if(r>0)return void a(J.apply(i,[e,s,n,r-1]));o(t)}}))}))})).catch(o)}));return s(a,n),a}var Y={_driver:"webSQLStorage",_initStorage:function(e){var t=this,n={db:null};if(e)for(var r in e)n[r]="string"!=typeof e[r]?e[r].toString():e[r];var i=new o((function(e,r){try{n.db=openDatabase(n.name,String(n.version),n.description,n.size)}catch(e){return r(e)}n.db.transaction((function(i){X(i,n,(function(){t._dbInfo=n,e()}),(function(e,t){r(t)}))}),r)}));return n.serializer=W,i},_support:"function"==typeof openDatabase,iterate:function(e,t){var n=this,r=new o((function(t,r){n.ready().then((function(){var i=n._dbInfo;i.db.transaction((function(n){$(n,i,"SELECT * FROM "+i.storeName,[],(function(n,r){for(var a=r.rows,o=a.length,s=0;s<o;s++){var c=a.item(s),u=c.value;if(u&&(u=i.serializer.deserialize(u)),void 0!==(u=e(u,c.key,s+1)))return void t(u)}t()}),(function(e,t){r(t)}))}))})).catch(r)}));return s(r,t),r},getItem:function(e,t){var n=this;e=u(e);var r=new o((function(t,r){n.ready().then((function(){var i=n._dbInfo;i.db.transaction((function(n){$(n,i,"SELECT * FROM "+i.storeName+" WHERE key = ? LIMIT 1",[e],(function(e,n){var r=n.rows.length?n.rows.item(0).value:null;r&&(r=i.serializer.deserialize(r)),t(r)}),(function(e,t){r(t)}))}))})).catch(r)}));return s(r,t),r},setItem:function(e,t,n){return J.apply(this,[e,t,n,1])},removeItem:function(e,t){var n=this;e=u(e);var r=new o((function(t,r){n.ready().then((function(){var i=n._dbInfo;i.db.transaction((function(n){$(n,i,"DELETE FROM "+i.storeName+" WHERE key = ?",[e],(function(){t()}),(function(e,t){r(t)}))}))})).catch(r)}));return s(r,t),r},clear:function(e){var t=this,n=new o((function(e,n){t.ready().then((function(){var r=t._dbInfo;r.db.transaction((function(t){$(t,r,"DELETE FROM "+r.storeName,[],(function(){e()}),(function(e,t){n(t)}))}))})).catch(n)}));return s(n,e),n},length:function(e){var t=this,n=new o((function(e,n){t.ready().then((function(){var r=t._dbInfo;r.db.transaction((function(t){$(t,r,"SELECT COUNT(key) as c FROM "+r.storeName,[],(function(t,n){var r=n.rows.item(0).c;e(r)}),(function(e,t){n(t)}))}))})).catch(n)}));return s(n,e),n},key:function(e,t){var n=this,r=new o((function(t,r){n.ready().then((function(){var i=n._dbInfo;i.db.transaction((function(n){$(n,i,"SELECT key FROM "+i.storeName+" WHERE id = ? LIMIT 1",[e+1],(function(e,n){var r=n.rows.length?n.rows.item(0).key:null;t(r)}),(function(e,t){r(t)}))}))})).catch(r)}));return s(r,t),r},keys:function(e){var t=this,n=new o((function(e,n){t.ready().then((function(){var r=t._dbInfo;r.db.transaction((function(t){$(t,r,"SELECT key FROM "+r.storeName,[],(function(t,n){for(var r=[],i=0;i<n.rows.length;i++)r.push(n.rows.item(i).key);e(r)}),(function(e,t){n(t)}))}))})).catch(n)}));return s(n,e),n},dropInstance:function(e,t){t=f.apply(this,arguments);var n=this.config();(e="function"!=typeof e&&e||{}).name||(e.name=e.name||n.name,e.storeName=e.storeName||n.storeName);var r,i=this;return r=e.name?new o((function(t){var r;r=e.name===n.name?i._dbInfo.db:openDatabase(e.name,"","",0),e.storeName?t({db:r,storeNames:[e.storeName]}):t(function(e){return new o((function(t,n){e.transaction((function(r){r.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name <> '__WebKitDatabaseInfoTable__'",[],(function(n,r){for(var i=[],a=0;a<r.rows.length;a++)i.push(r.rows.item(a).name);t({db:e,storeNames:i})}),(function(e,t){n(t)}))}),(function(e){n(e)}))}))}(r))})).then((function(e){return new o((function(t,n){e.db.transaction((function(r){function i(e){return new o((function(t,n){r.executeSql("DROP TABLE IF EXISTS "+e,[],(function(){t()}),(function(e,t){n(t)}))}))}for(var a=[],s=0,c=e.storeNames.length;s<c;s++)a.push(i(e.storeNames[s]));o.all(a).then((function(){t()})).catch((function(e){n(e)}))}),(function(e){n(e)}))}))})):o.reject("Invalid arguments"),s(r,t),r}};function Q(e,t){var n=e.name+"/";return e.storeName!==t.storeName&&(n+=e.storeName+"/"),n}function Z(){return!function(){var e="_localforage_support_test";try{return localStorage.setItem(e,!0),localStorage.removeItem(e),!1}catch{return!0}}()||localStorage.length>0}var ee={_driver:"localStorageWrapper",_initStorage:function(e){var t={};if(e)for(var n in e)t[n]=e[n];return t.keyPrefix=Q(e,this._defaultConfig),Z()?(this._dbInfo=t,t.serializer=W,o.resolve()):o.reject()},_support:function(){try{return typeof localStorage<"u"&&"setItem"in localStorage&&!!localStorage.setItem}catch{return!1}}(),iterate:function(e,t){var n=this,r=n.ready().then((function(){for(var t=n._dbInfo,r=t.keyPrefix,i=r.length,a=localStorage.length,o=1,s=0;s<a;s++){var c=localStorage.key(s);if(0===c.indexOf(r)){var u=localStorage.getItem(c);if(u&&(u=t.serializer.deserialize(u)),void 0!==(u=e(u,c.substring(i),o++)))return u}}}));return s(r,t),r},getItem:function(e,t){var n=this;e=u(e);var r=n.ready().then((function(){var t=n._dbInfo,r=localStorage.getItem(t.keyPrefix+e);return r&&(r=t.serializer.deserialize(r)),r}));return s(r,t),r},setItem:function(e,t,n){var r=this;e=u(e);var i=r.ready().then((function(){void 0===t&&(t=null);var n=t;return new o((function(i,a){var o=r._dbInfo;o.serializer.serialize(t,(function(t,r){if(r)a(r);else try{localStorage.setItem(o.keyPrefix+e,t),i(n)}catch(e){("QuotaExceededError"===e.name||"NS_ERROR_DOM_QUOTA_REACHED"===e.name)&&a(e),a(e)}}))}))}));return s(i,n),i},removeItem:function(e,t){var n=this;e=u(e);var r=n.ready().then((function(){var t=n._dbInfo;localStorage.removeItem(t.keyPrefix+e)}));return s(r,t),r},clear:function(e){var t=this,n=t.ready().then((function(){for(var e=t._dbInfo.keyPrefix,n=localStorage.length-1;n>=0;n--){var r=localStorage.key(n);0===r.indexOf(e)&&localStorage.removeItem(r)}}));return s(n,e),n},length:function(e){var t=this.keys().then((function(e){return e.length}));return s(t,e),t},key:function(e,t){var n=this,r=n.ready().then((function(){var t,r=n._dbInfo;try{t=localStorage.key(e)}catch{t=null}return t&&(t=t.substring(r.keyPrefix.length)),t}));return s(r,t),r},keys:function(e){var t=this,n=t.ready().then((function(){for(var e=t._dbInfo,n=localStorage.length,r=[],i=0;i<n;i++){var a=localStorage.key(i);0===a.indexOf(e.keyPrefix)&&r.push(a.substring(e.keyPrefix.length))}return r}));return s(n,e),n},dropInstance:function(e,t){if(t=f.apply(this,arguments),!(e="function"!=typeof e&&e||{}).name){var n=this.config();e.name=e.name||n.name,e.storeName=e.storeName||n.storeName}var r,i=this;return r=e.name?new o((function(t){e.storeName?t(Q(e,i._defaultConfig)):t(e.name+"/")})).then((function(e){for(var t=localStorage.length-1;t>=0;t--){var n=localStorage.key(t);0===n.indexOf(e)&&localStorage.removeItem(n)}})):o.reject("Invalid arguments"),s(r,t),r}},te=function(e,t){return e===t||"number"==typeof e&&"number"==typeof t&&isNaN(e)&&isNaN(t)},ne=function(e,t){for(var n=e.length,r=0;r<n;){if(te(e[r],t))return!0;r++}return!1},re=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)},ie={},ae={},oe={INDEXEDDB:O,WEBSQL:Y,LOCALSTORAGE:ee},se=[oe.INDEXEDDB._driver,oe.WEBSQL._driver,oe.LOCALSTORAGE._driver],ce=["dropInstance"],ue=["clear","getItem","iterate","key","keys","length","removeItem","setItem"].concat(ce),fe={description:"",driver:se.slice(),name:"localforage",size:4980736,storeName:"keyvaluepairs",version:1};function de(e,t){e[t]=function(){var n=arguments;return e.ready().then((function(){return e[t].apply(e,n)}))}}function le(){for(var e=1;e<arguments.length;e++){var t=arguments[e];if(t)for(var n in t)t.hasOwnProperty(n)&&(re(t[n])?arguments[0][n]=t[n].slice():arguments[0][n]=t[n])}return arguments[0]}var pe=function(){function e(t){for(var n in function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),oe)if(oe.hasOwnProperty(n)){var r=oe[n],i=r._driver;this[n]=i,ie[i]||this.defineDriver(r)}this._defaultConfig=le({},fe),this._config=le({},this._defaultConfig,t),this._driverSet=null,this._initDriver=null,this._ready=!1,this._dbInfo=null,this._wrapLibraryMethodsWithReady(),this.setDriver(this._config.driver).catch((function(){}))}return e.prototype.config=function(e){if("object"===(typeof e>"u"?"undefined":r(e))){if(this._ready)return new Error("Can't call config() after localforage has been used.");for(var t in e){if("storeName"===t&&(e[t]=e[t].replace(/\W/g,"_")),"version"===t&&"number"!=typeof e[t])return new Error("Database version must be a number.");this._config[t]=e[t]}return!("driver"in e)||!e.driver||this.setDriver(this._config.driver)}return"string"==typeof e?this._config[e]:this._config},e.prototype.defineDriver=function(e,t,n){var r=new o((function(t,n){try{var r=e._driver,i=new Error("Custom driver not compliant; see https://mozilla.github.io/localForage/#definedriver");if(!e._driver)return void n(i);for(var a=ue.concat("_initStorage"),c=0,u=a.length;c<u;c++){var f=a[c];if((!ne(ce,f)||e[f])&&"function"!=typeof e[f])return void n(i)}!function(){for(var t=function(e){return function(){var t=new Error("Method "+e+" is not implemented by the current driver"),n=o.reject(t);return s(n,arguments[arguments.length-1]),n}},n=0,r=ce.length;n<r;n++){var i=ce[n];e[i]||(e[i]=t(i))}}();var d=function(n){ie[r]&&console.info("Redefining LocalForage driver: "+r),ie[r]=e,ae[r]=n,t()};"_support"in e?e._support&&"function"==typeof e._support?e._support().then(d,n):d(!!e._support):d(!0)}catch(e){n(e)}}));return c(r,t,n),r},e.prototype.driver=function(){return this._driver||null},e.prototype.getDriver=function(e,t,n){var r=ie[e]?o.resolve(ie[e]):o.reject(new Error("Driver not found."));return c(r,t,n),r},e.prototype.getSerializer=function(e){var t=o.resolve(W);return c(t,e),t},e.prototype.ready=function(e){var t=this,n=t._driverSet.then((function(){return null===t._ready&&(t._ready=t._initDriver()),t._ready}));return c(n,e,e),n},e.prototype.setDriver=function(e,t,n){var r=this;re(e)||(e=[e]);var i=this._getSupportedDrivers(e);function a(){r._config.driver=r.driver()}function s(e){return r._extend(e),a(),r._ready=r._initStorage(r._config),r._ready}var u=null!==this._driverSet?this._driverSet.catch((function(){return o.resolve()})):o.resolve();return this._driverSet=u.then((function(){var e=i[0];return r._dbInfo=null,r._ready=null,r.getDriver(e).then((function(e){r._driver=e._driver,a(),r._wrapLibraryMethodsWithReady(),r._initDriver=function(e){return function(){var t=0;return function n(){for(;t<e.length;){var i=e[t];return t++,r._dbInfo=null,r._ready=null,r.getDriver(i).then(s).catch(n)}a();var c=new Error("No available storage method found.");return r._driverSet=o.reject(c),r._driverSet}()}}(i)}))})).catch((function(){a();var e=new Error("No available storage method found.");return r._driverSet=o.reject(e),r._driverSet})),c(this._driverSet,t,n),this._driverSet},e.prototype.supports=function(e){return!!ae[e]},e.prototype._extend=function(e){le(this,e)},e.prototype._getSupportedDrivers=function(e){for(var t=[],n=0,r=e.length;n<r;n++){var i=e[n];this.supports(i)&&t.push(i)}return t},e.prototype._wrapLibraryMethodsWithReady=function(){for(var e=0,t=ue.length;e<t;e++)de(this,ue[e])},e.prototype.createInstance=function(t){return new e(t)},e}(),he=new pe;t.exports=he},{3:3}]},{},[4])(4)}))})),jL=DL(((e,t)=>{!function(n,r){"object"==typeof e&&typeof t<"u"?r(e):"function"==typeof define&&define.amd?define("localforage-driver-memory",["exports"],r):r(n.LocalforageDriverMemory={})}(typeof self<"u"?self:e,(function(e){var t=/^~~local_forage_type~([^~]+)~/,n=Object.prototype.toString;function r(e){var t=.75*e.length,n=e.length;"="===e[e.length-1]&&(t--,"="===e[e.length-2]&&t--);for(var r=new ArrayBuffer(t),i=new Uint8Array(r),a=0,o=0;a<n;a+=4){var s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".indexOf(e[a]),c="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".indexOf(e[a+1]),u="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".indexOf(e[a+2]),f="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".indexOf(e[a+3]);i[o++]=s<<2|c>>4,i[o++]=(15&c)<<4|u>>2,i[o++]=(3&u)<<6|63&f}return r}function i(e){for(var t=new Uint8Array(e),n="",r=0;r<t.length;r+=3)n+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[t[r]>>2],n+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[(3&t[r])<<4|t[r+1]>>4],n+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[(15&t[r+1])<<2|t[r+2]>>6],n+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[63&t[r+2]];return t.length%3==2?n=n.substring(0,n.length-1)+"=":t.length%3==1&&(n=n.substring(0,n.length-2)+"=="),n}function a(e){var t,n;if(null===e||"object"!=typeof e||"isActiveClone"in e)return e;var r=e instanceof Date?new Date(e):e.constructor();try{for(var i=function(e){var t="function"==typeof Symbol&&e[Symbol.iterator],n=0;return t?t.call(e):{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}}}(Object.keys(e)),o=i.next();!o.done;o=i.next()){var s=o.value;Object.prototype.hasOwnProperty.call(e,s)&&(e.isActiveClone=null,r[s]=a(e[s]),delete e.isActiveClone)}}catch(e){t={error:e}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(t)throw t.error}}return r}function o(e,t){return(e.name||t.name)+"/"+(e.storeName||t.storeName)+"/"}function s(e,t){t&&e.then((function(e){t(null,e)}),(function(e){t(e)}))}function c(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];if(arguments.length&&"function"==typeof arguments[arguments.length-1])return arguments[arguments.length-1]}function u(e,t){var n,r=this;if(t=c.apply(this,arguments),!(e="function"!=typeof e&&e||{}).name){var i=this.config();e.name=e.name||i.name,e.storeName=e.storeName||i.storeName}return n=e.name?new Promise((function(t){e.storeName?t(o(e,r._defaultConfig)):t(e.name+"/")})):Promise.reject("Invalid arguments"),{promise:n,callback:t}}function f(e){return"string"!=typeof e&&(console.warn(e+" used as a key, but it is not a string."),e=String(e)),e}var d={bufferToString:i,deserialize:function(e){if("__lfsc__:"!==e.substring(0,9))return JSON.parse(e);var n,i=e.substring(13),a=e.substring(9,13);if("blob"===a&&t.test(i)){var o=i.match(t);n=o[1],i=i.substring(o[0].length)}var s=r(i);switch(a){case"arbf":return s;case"blob":return function(e,t){e=e||[],t=t||{};try{return new Blob(e,t)}catch(i){if("TypeError"!==i.name)throw i;for(var n=new(typeof BlobBuilder<"u"?BlobBuilder:typeof MSBlobBuilder<"u"?MSBlobBuilder:typeof MozBlobBuilder<"u"?MozBlobBuilder:WebKitBlobBuilder),r=0;r<e.length;r+=1)n.append(e[r]);return n.getBlob(t.type)}}([s],{type:n});case"si08":return new Int8Array(s);case"ui08":return new Uint8Array(s);case"uic8":return new Uint8ClampedArray(s);case"si16":return new Int16Array(s);case"ur16":return new Uint16Array(s);case"si32":return new Int32Array(s);case"ui32":return new Uint32Array(s);case"fl32":return new Float32Array(s);case"fl64":return new Float64Array(s);default:throw new Error("Unkown type: "+a)}},serialize:function(e,t){var r="";if(e&&(r=n.call(e)),e&&("[object ArrayBuffer]"===r||e.buffer&&"[object ArrayBuffer]"===n.call(e.buffer))){var a=void 0,o="__lfsc__:";e instanceof ArrayBuffer?(a=e,o+="arbf"):(a=e.buffer,"[object Int8Array]"===r?o+="si08":"[object Uint8Array]"===r?o+="ui08":"[object Uint8ClampedArray]"===r?o+="uic8":"[object Int16Array]"===r?o+="si16":"[object Uint16Array]"===r?o+="ur16":"[object Int32Array]"===r?o+="si32":"[object Uint32Array]"===r?o+="ui32":"[object Float32Array]"===r?o+="fl32":"[object Float64Array]"===r?o+="fl64":t(new Error("Failed to get type for BinaryArray"))),t(o+i(a))}else if("[object Blob]"===r){var s=new FileReader;s.onload=function(){var n="~~local_forage_type~"+e.type+"~"+i(this.result);t("__lfsc__:blob"+n)},s.readAsArrayBuffer(e)}else try{t(JSON.stringify(e))}catch(n){console.error("Couldn't convert value into a JSON string: ",e),t(null,n)}},stringToBuffer:r},l={},p=function(){function e(e){this.kp=e,this.data={}}return e.resolve=function(t){return l[t]||(l[t]=new e(t)),l[t]},e.prototype.clear=function(){this.data={}},e.prototype.drop=function(){this.clear(),delete l[this.kp]},e.prototype.get=function(e){return this.data[e]},e.prototype.key=function(e){return this.keys()[e]},e.prototype.keys=function(){return Object.keys(this.data)},e.prototype.rm=function(e){delete this.data[e]},e.prototype.set=function(e,t){this.data[e]=t},e}();e._support=!0,e._driver="localforage-driver-memory",e._initStorage=function(e){var t=e?a(e):{},n=o(t,this._defaultConfig),r=p.resolve(n);return this._dbInfo=t,this._dbInfo.serializer=d,this._dbInfo.keyPrefix=n,this._dbInfo.mStore=r,Promise.resolve()},e.clear=function(e){var t=this,n=this.ready().then((function(){t._dbInfo.mStore.clear()}));return s(n,e),n},e.dropInstance=function(e,t){var n=u.apply(this,arguments),r=n.promise,i=n.callback,a=r.then((function(e){p.resolve(e).drop()}));return s(a,i),r},e.getItem=function(e,t){var n=this;e=f(e);var r=this.ready().then((function(){var t=n._dbInfo.mStore.get(e);return null==t?null:n._dbInfo.serializer.deserialize(t)}));return s(r,t),r},e.iterate=function(e,t){var n=this,r=this.ready().then((function(){for(var t=n._dbInfo.mStore,r=t.keys(),i=0;i<r.length;i++){var a=t.get(r[i]);if(a&&(a=n._dbInfo.serializer.deserialize(a)),void 0!==(a=e(a,r[i],i+1)))return a}}));return s(r,t),r},e.key=function(e,t){var n=this,r=this.ready().then((function(){var t;try{void 0===(t=n._dbInfo.mStore.key(e))&&(t=null)}catch{t=null}return t}));return s(r,t),r},e.keys=function(e){var t=this,n=this.ready().then((function(){return t._dbInfo.mStore.keys()}));return s(n,e),n},e.length=function(e){var t=this.keys().then((function(e){return e.length}));return s(t,e),t},e.removeItem=function(e,t){var n=this;e=f(e);var r=this.ready().then((function(){n._dbInfo.mStore.rm(e)}));return s(r,t),r},e.setItem=function(e,t,n){var r=this;e=f(e);var i=this.ready().then((function(){void 0===t&&(t=null);var n=t;return new Promise((function(i,a){r._dbInfo.serializer.serialize(t,(function(t,o){if(o)a(o);else try{r._dbInfo.mStore.set(e,t),i(n)}catch(e){a(e)}}))}))}));return s(i,n),i},Object.defineProperty(e,"__esModule",{value:!0})}))})),qL=FL(UL()),zL=FL(jL()),HL={display:"none",position:"fixed",top:"0",right:"0",width:"100%",height:"100%",borderRadius:"0",border:"none",zIndex:"2147483647"};var GL=function(e,t){return Object.assign(bF,t),e}(SL,{platform:"web",sdkName:"magic-sdk",version:"13.6.2",defaultEndpoint:"https://auth.magic.link/",ViewController:class extends IL{constructor(){super(...arguments),this.activeElement=null}init(){this.test="hello",this.iframe=new Promise((e=>{let t=()=>{if(function(e){let t=[].slice.call(document.querySelectorAll(".magic-iframe"));return Boolean(t.find((t=>t.src.includes(e))))}(encodeURIComponent(this.parameters)))new vF(GB.DuplicateIframe,"Duplicate iframes found.").log();else{let t=document.createElement("iframe");t.classList.add("magic-iframe"),t.dataset.magicIframeLabel=yL(this.endpoint).host,t.title="Secure Modal",t.src=yL(`/send?params=${encodeURIComponent(this.parameters)}`,this.endpoint).href,function(e){for(let[t,n]of Object.entries(HL))e.style[t]=n}(t),document.body.appendChild(t),e(t)}};["loaded","interactive","complete"].includes(document.readyState)?t():window.addEventListener("load",t,!1)})),window.addEventListener("message",(e=>{var t;if(e.origin===this.endpoint&&e.data&&e.data.msgType&&this.messageHandlers.size){e.data.response=null!=(t=e.data.response)?t:{};for(let t of this.messageHandlers.values())t(e)}}))}showOverlay(){return LL(this,null,(function*(){let e=yield this.iframe;e.style.display="block",this.activeElement=document.activeElement,e.focus()}))}hideOverlay(){return LL(this,null,(function*(){var e;(yield this.iframe).style.display="none",null!=(e=this.activeElement)&&e.focus&&this.activeElement.focus(),this.activeElement=null}))}_post(e){return LL(this,null,(function*(){let t=yield this.iframe;if(!t||!t.contentWindow)throw new yF(HB.ModalNotReady,"Modal is not ready.");t.contentWindow.postMessage(e,this.endpoint)}))}},configureStorage:()=>LL(void 0,null,(function*(){let e=qL.default.createInstance({name:"MagicAuthLocalStorageDB",storeName:"MagicAuthLocalStorage"});return yield e.defineDriver(zL),yield e.setDriver([qL.default.INDEXEDDB,qL.default.LOCALSTORAGE,zL._driver]),e}))}),VL=(e=>(e.LoginWithOIDC="magic_auth_login_with_oidc",e))(VL||{}),KL=class extends _L.Internal{constructor(){super(...arguments),this.name="openid",this.config={}}loginWithOIDC(e){let t=this.utils.createJsonRpcRequestPayload("magic_auth_login_with_oidc",[e]);return this.request(t)}};function WL(e,t){return function(){return e.apply(t,arguments)}}const{toString:XL}=Object.prototype,{getPrototypeOf:$L}=Object,JL=(e=>t=>{const n=XL.call(t);return e[n]||(e[n]=n.slice(8,-1).toLowerCase())})(Object.create(null)),YL=e=>(e=e.toLowerCase(),t=>JL(t)===e),QL=e=>t=>typeof t===e,{isArray:ZL}=Array,eU=QL("undefined");const tU=YL("ArrayBuffer");const nU=QL("string"),rU=QL("function"),iU=QL("number"),aU=e=>null!==e&&"object"==typeof e,oU=e=>{if("object"!==JL(e))return!1;const t=$L(e);return!(null!==t&&t!==Object.prototype&&null!==Object.getPrototypeOf(t)||Symbol.toStringTag in e||Symbol.iterator in e)},sU=YL("Date"),cU=YL("File"),uU=YL("Blob"),fU=YL("FileList"),dU=YL("URLSearchParams");function lU(e,t,{allOwnKeys:n=!1}={}){if(null==e)return;let r,i;if("object"!=typeof e&&(e=[e]),ZL(e))for(r=0,i=e.length;r<i;r++)t.call(null,e[r],r,e);else{const i=n?Object.getOwnPropertyNames(e):Object.keys(e),a=i.length;let o;for(r=0;r<a;r++)o=i[r],t.call(null,e[o],o,e)}}function pU(e,t){t=t.toLowerCase();const n=Object.keys(e);let r,i=n.length;for(;i-- >0;)if(r=n[i],t===r.toLowerCase())return r;return null}const hU="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:global,bU=e=>!eU(e)&&e!==hU;const mU=(e=>t=>e&&t instanceof e)("undefined"!=typeof Uint8Array&&$L(Uint8Array)),yU=YL("HTMLFormElement"),gU=(({hasOwnProperty:e})=>(t,n)=>e.call(t,n))(Object.prototype),vU=YL("RegExp"),wU=(e,t)=>{const n=Object.getOwnPropertyDescriptors(e),r={};lU(n,((n,i)=>{!1!==t(n,i,e)&&(r[i]=n)})),Object.defineProperties(e,r)},_U="abcdefghijklmnopqrstuvwxyz",EU="0123456789",TU={DIGIT:EU,ALPHA:_U,ALPHA_DIGIT:_U+_U.toUpperCase()+EU};const AU=YL("AsyncFunction");var RU={isArray:ZL,isArrayBuffer:tU,isBuffer:function(e){return null!==e&&!eU(e)&&null!==e.constructor&&!eU(e.constructor)&&rU(e.constructor.isBuffer)&&e.constructor.isBuffer(e)},isFormData:e=>{let t;return e&&("function"==typeof FormData&&e instanceof FormData||rU(e.append)&&("formdata"===(t=JL(e))||"object"===t&&rU(e.toString)&&"[object FormData]"===e.toString()))},isArrayBufferView:function(e){let t;return t="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&tU(e.buffer),t},isString:nU,isNumber:iU,isBoolean:e=>!0===e||!1===e,isObject:aU,isPlainObject:oU,isUndefined:eU,isDate:sU,isFile:cU,isBlob:uU,isRegExp:vU,isFunction:rU,isStream:e=>aU(e)&&rU(e.pipe),isURLSearchParams:dU,isTypedArray:mU,isFileList:fU,forEach:lU,merge:function e(){const{caseless:t}=bU(this)&&this||{},n={},r=(r,i)=>{const a=t&&pU(n,i)||i;oU(n[a])&&oU(r)?n[a]=e(n[a],r):oU(r)?n[a]=e({},r):ZL(r)?n[a]=r.slice():n[a]=r};for(let e=0,t=arguments.length;e<t;e++)arguments[e]&&lU(arguments[e],r);return n},extend:(e,t,n,{allOwnKeys:r}={})=>(lU(t,((t,r)=>{n&&rU(t)?e[r]=WL(t,n):e[r]=t}),{allOwnKeys:r}),e),trim:e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),stripBOM:e=>(65279===e.charCodeAt(0)&&(e=e.slice(1)),e),inherits:(e,t,n,r)=>{e.prototype=Object.create(t.prototype,r),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),n&&Object.assign(e.prototype,n)},toFlatObject:(e,t,n,r)=>{let i,a,o;const s={};if(t=t||{},null==e)return t;do{for(i=Object.getOwnPropertyNames(e),a=i.length;a-- >0;)o=i[a],r&&!r(o,e,t)||s[o]||(t[o]=e[o],s[o]=!0);e=!1!==n&&$L(e)}while(e&&(!n||n(e,t))&&e!==Object.prototype);return t},kindOf:JL,kindOfTest:YL,endsWith:(e,t,n)=>{e=String(e),(void 0===n||n>e.length)&&(n=e.length),n-=t.length;const r=e.indexOf(t,n);return-1!==r&&r===n},toArray:e=>{if(!e)return null;if(ZL(e))return e;let t=e.length;if(!iU(t))return null;const n=new Array(t);for(;t-- >0;)n[t]=e[t];return n},forEachEntry:(e,t)=>{const n=(e&&e[Symbol.iterator]).call(e);let r;for(;(r=n.next())&&!r.done;){const n=r.value;t.call(e,n[0],n[1])}},matchAll:(e,t)=>{let n;const r=[];for(;null!==(n=e.exec(t));)r.push(n);return r},isHTMLForm:yU,hasOwnProperty:gU,hasOwnProp:gU,reduceDescriptors:wU,freezeMethods:e=>{wU(e,((t,n)=>{if(rU(e)&&-1!==["arguments","caller","callee"].indexOf(n))return!1;const r=e[n];rU(r)&&(t.enumerable=!1,"writable"in t?t.writable=!1:t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+n+"'")}))}))},toObjectSet:(e,t)=>{const n={},r=e=>{e.forEach((e=>{n[e]=!0}))};return ZL(e)?r(e):r(String(e).split(t)),n},toCamelCase:e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,(function(e,t,n){return t.toUpperCase()+n})),noop:()=>{},toFiniteNumber:(e,t)=>(e=+e,Number.isFinite(e)?e:t),findKey:pU,global:hU,isContextDefined:bU,ALPHABET:TU,generateString:(e=16,t=TU.ALPHA_DIGIT)=>{let n="";const{length:r}=t;for(;e--;)n+=t[Math.random()*r|0];return n},isSpecCompliantForm:function(e){return!!(e&&rU(e.append)&&"FormData"===e[Symbol.toStringTag]&&e[Symbol.iterator])},toJSONObject:e=>{const t=new Array(10),n=(e,r)=>{if(aU(e)){if(t.indexOf(e)>=0)return;if(!("toJSON"in e)){t[r]=e;const i=ZL(e)?[]:{};return lU(e,((e,t)=>{const a=n(e,r+1);!eU(a)&&(i[t]=a)})),t[r]=void 0,i}}return e};return n(e,0)},isAsyncFn:AU,isThenable:e=>e&&(aU(e)||rU(e))&&rU(e.then)&&rU(e.catch)};function SU(e,t,n,r,i){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack,this.message=e,this.name="AxiosError",t&&(this.code=t),n&&(this.config=n),r&&(this.request=r),i&&(this.response=i)}RU.inherits(SU,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:RU.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});const kU=SU.prototype,IU={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach((e=>{IU[e]={value:e}})),Object.defineProperties(SU,IU),Object.defineProperty(kU,"isAxiosError",{value:!0}),SU.from=(e,t,n,r,i,a)=>{const o=Object.create(kU);return RU.toFlatObject(e,o,(function(e){return e!==Error.prototype}),(e=>"isAxiosError"!==e)),SU.call(o,e.message,t,n,r,i),o.cause=e,o.name=e.name,a&&Object.assign(o,a),o};function OU(e){return RU.isPlainObject(e)||RU.isArray(e)}function xU(e){return RU.endsWith(e,"[]")?e.slice(0,-2):e}function CU(e,t,n){return e?e.concat(t).map((function(e,t){return e=xU(e),!n&&t?"["+e+"]":e})).join(n?".":""):t}const MU=RU.toFlatObject(RU,{},null,(function(e){return/^is[A-Z]/.test(e)}));function PU(e,t,n){if(!RU.isObject(e))throw new TypeError("target must be an object");t=t||new FormData;const r=(n=RU.toFlatObject(n,{metaTokens:!0,dots:!1,indexes:!1},!1,(function(e,t){return!RU.isUndefined(t[e])}))).metaTokens,i=n.visitor||u,a=n.dots,o=n.indexes,s=(n.Blob||"undefined"!=typeof Blob&&Blob)&&RU.isSpecCompliantForm(t);if(!RU.isFunction(i))throw new TypeError("visitor must be a function");function c(e){if(null===e)return"";if(RU.isDate(e))return e.toISOString();if(!s&&RU.isBlob(e))throw new SU("Blob is not supported. Use a Buffer instead.");return RU.isArrayBuffer(e)||RU.isTypedArray(e)?s&&"function"==typeof Blob?new Blob([e]):Buffer.from(e):e}function u(e,n,i){let s=e;if(e&&!i&&"object"==typeof e)if(RU.endsWith(n,"{}"))n=r?n:n.slice(0,-2),e=JSON.stringify(e);else if(RU.isArray(e)&&function(e){return RU.isArray(e)&&!e.some(OU)}(e)||(RU.isFileList(e)||RU.endsWith(n,"[]"))&&(s=RU.toArray(e)))return n=xU(n),s.forEach((function(e,r){!RU.isUndefined(e)&&null!==e&&t.append(!0===o?CU([n],r,a):null===o?n:n+"[]",c(e))})),!1;return!!OU(e)||(t.append(CU(i,n,a),c(e)),!1)}const f=[],d=Object.assign(MU,{defaultVisitor:u,convertValue:c,isVisitable:OU});if(!RU.isObject(e))throw new TypeError("data must be an object");return function e(n,r){if(!RU.isUndefined(n)){if(-1!==f.indexOf(n))throw Error("Circular reference detected in "+r.join("."));f.push(n),RU.forEach(n,(function(n,a){!0===(!(RU.isUndefined(n)||null===n)&&i.call(t,n,RU.isString(a)?a.trim():a,r,d))&&e(n,r?r.concat(a):[a])})),f.pop()}}(e),t}function NU(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,(function(e){return t[e]}))}function BU(e,t){this._pairs=[],e&&PU(e,this,t)}const DU=BU.prototype;function FU(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function LU(e,t,n){if(!t)return e;const r=n&&n.encode||FU,i=n&&n.serialize;let a;if(a=i?i(t,n):RU.isURLSearchParams(t)?t.toString():new BU(t,n).toString(r),a){const t=e.indexOf("#");-1!==t&&(e=e.slice(0,t)),e+=(-1===e.indexOf("?")?"?":"&")+a}return e}DU.append=function(e,t){this._pairs.push([e,t])},DU.toString=function(e){const t=e?function(t){return e.call(this,t,NU)}:NU;return this._pairs.map((function(e){return t(e[0])+"="+t(e[1])}),"").join("&")};var UU=class{constructor(){this.handlers=[]}use(e,t,n){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!n&&n.synchronous,runWhen:n?n.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){RU.forEach(this.handlers,(function(t){null!==t&&e(t)}))}},jU={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1};var qU={isBrowser:!0,classes:{URLSearchParams:"undefined"!=typeof URLSearchParams?URLSearchParams:BU,FormData:"undefined"!=typeof FormData?FormData:null,Blob:"undefined"!=typeof Blob?Blob:null},isStandardBrowserEnv:(()=>{let e;return("undefined"==typeof navigator||"ReactNative"!==(e=navigator.product)&&"NativeScript"!==e&&"NS"!==e)&&("undefined"!=typeof window&&"undefined"!=typeof document)})(),isStandardBrowserWebWorkerEnv:"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts,protocols:["http","https","file","blob","url","data"]};function zU(e){function t(e,n,r,i){let a=e[i++];const o=Number.isFinite(+a),s=i>=e.length;if(a=!a&&RU.isArray(r)?r.length:a,s)return RU.hasOwnProp(r,a)?r[a]=[r[a],n]:r[a]=n,!o;r[a]&&RU.isObject(r[a])||(r[a]=[]);return t(e,n,r[a],i)&&RU.isArray(r[a])&&(r[a]=function(e){const t={},n=Object.keys(e);let r;const i=n.length;let a;for(r=0;r<i;r++)a=n[r],t[a]=e[a];return t}(r[a])),!o}if(RU.isFormData(e)&&RU.isFunction(e.entries)){const n={};return RU.forEachEntry(e,((e,r)=>{t(function(e){return RU.matchAll(/\w+|\[(\w*)]/g,e).map((e=>"[]"===e[0]?"":e[1]||e[0]))}(e),r,n,0)})),n}return null}const HU={"Content-Type":void 0};const GU={transitional:jU,adapter:["xhr","http"],transformRequest:[function(e,t){const n=t.getContentType()||"",r=n.indexOf("application/json")>-1,i=RU.isObject(e);i&&RU.isHTMLForm(e)&&(e=new FormData(e));if(RU.isFormData(e))return r&&r?JSON.stringify(zU(e)):e;if(RU.isArrayBuffer(e)||RU.isBuffer(e)||RU.isStream(e)||RU.isFile(e)||RU.isBlob(e))return e;if(RU.isArrayBufferView(e))return e.buffer;if(RU.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let a;if(i){if(n.indexOf("application/x-www-form-urlencoded")>-1)return function(e,t){return PU(e,new qU.classes.URLSearchParams,Object.assign({visitor:function(e,t,n,r){return qU.isNode&&RU.isBuffer(e)?(this.append(t,e.toString("base64")),!1):r.defaultVisitor.apply(this,arguments)}},t))}(e,this.formSerializer).toString();if((a=RU.isFileList(e))||n.indexOf("multipart/form-data")>-1){const t=this.env&&this.env.FormData;return PU(a?{"files[]":e}:e,t&&new t,this.formSerializer)}}return i||r?(t.setContentType("application/json",!1),function(e,t,n){if(RU.isString(e))try{return(t||JSON.parse)(e),RU.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(n||JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){const t=this.transitional||GU.transitional,n=t&&t.forcedJSONParsing,r="json"===this.responseType;if(e&&RU.isString(e)&&(n&&!this.responseType||r)){const n=!(t&&t.silentJSONParsing)&&r;try{return JSON.parse(e)}catch(e){if(n){if("SyntaxError"===e.name)throw SU.from(e,SU.ERR_BAD_RESPONSE,this,null,this.response);throw e}}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:qU.classes.FormData,Blob:qU.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};RU.forEach(["delete","get","head"],(function(e){GU.headers[e]={}})),RU.forEach(["post","put","patch"],(function(e){GU.headers[e]=RU.merge(HU)}));var VU=GU;const KU=RU.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]);const WU=Symbol("internals");function XU(e){return e&&String(e).trim().toLowerCase()}function $U(e){return!1===e||null==e?e:RU.isArray(e)?e.map($U):String(e)}function JU(e,t,n,r,i){return RU.isFunction(r)?r.call(this,t,n):(i&&(t=n),RU.isString(t)?RU.isString(r)?-1!==t.indexOf(r):RU.isRegExp(r)?r.test(t):void 0:void 0)}class YU{constructor(e){e&&this.set(e)}set(e,t,n){const r=this;function i(e,t,n){const i=XU(t);if(!i)throw new Error("header name must be a non-empty string");const a=RU.findKey(r,i);(!a||void 0===r[a]||!0===n||void 0===n&&!1!==r[a])&&(r[a||t]=$U(e))}const a=(e,t)=>RU.forEach(e,((e,n)=>i(e,n,t)));return RU.isPlainObject(e)||e instanceof this.constructor?a(e,t):RU.isString(e)&&(e=e.trim())&&!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim())?a((e=>{const t={};let n,r,i;return e&&e.split("\n").forEach((function(e){i=e.indexOf(":"),n=e.substring(0,i).trim().toLowerCase(),r=e.substring(i+1).trim(),!n||t[n]&&KU[n]||("set-cookie"===n?t[n]?t[n].push(r):t[n]=[r]:t[n]=t[n]?t[n]+", "+r:r)})),t})(e),t):null!=e&&i(t,e,n),this}get(e,t){if(e=XU(e)){const n=RU.findKey(this,e);if(n){const e=this[n];if(!t)return e;if(!0===t)return function(e){const t=Object.create(null),n=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let r;for(;r=n.exec(e);)t[r[1]]=r[2];return t}(e);if(RU.isFunction(t))return t.call(this,e,n);if(RU.isRegExp(t))return t.exec(e);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=XU(e)){const n=RU.findKey(this,e);return!(!n||void 0===this[n]||t&&!JU(0,this[n],n,t))}return!1}delete(e,t){const n=this;let r=!1;function i(e){if(e=XU(e)){const i=RU.findKey(n,e);!i||t&&!JU(0,n[i],i,t)||(delete n[i],r=!0)}}return RU.isArray(e)?e.forEach(i):i(e),r}clear(e){const t=Object.keys(this);let n=t.length,r=!1;for(;n--;){const i=t[n];e&&!JU(0,this[i],i,e,!0)||(delete this[i],r=!0)}return r}normalize(e){const t=this,n={};return RU.forEach(this,((r,i)=>{const a=RU.findKey(n,i);if(a)return t[a]=$U(r),void delete t[i];const o=e?function(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,((e,t,n)=>t.toUpperCase()+n))}(i):String(i).trim();o!==i&&delete t[i],t[o]=$U(r),n[o]=!0})),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const t=Object.create(null);return RU.forEach(this,((n,r)=>{null!=n&&!1!==n&&(t[r]=e&&RU.isArray(n)?n.join(", "):n)})),t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map((([e,t])=>e+": "+t)).join("\n")}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...t){const n=new this(e);return t.forEach((e=>n.set(e))),n}static accessor(e){const t=(this[WU]=this[WU]={accessors:{}}).accessors,n=this.prototype;function r(e){const r=XU(e);t[r]||(!function(e,t){const n=RU.toCamelCase(" "+t);["get","set","has"].forEach((r=>{Object.defineProperty(e,r+n,{value:function(e,n,i){return this[r].call(this,t,e,n,i)},configurable:!0})}))}(n,e),t[r]=!0)}return RU.isArray(e)?e.forEach(r):r(e),this}}YU.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),RU.freezeMethods(YU.prototype),RU.freezeMethods(YU);var QU=YU;function ZU(e,t){const n=this||VU,r=t||n,i=QU.from(r.headers);let a=r.data;return RU.forEach(e,(function(e){a=e.call(n,a,i.normalize(),t?t.status:void 0)})),i.normalize(),a}function ej(e){return!(!e||!e.__CANCEL__)}function tj(e,t,n){SU.call(this,null==e?"canceled":e,SU.ERR_CANCELED,t,n),this.name="CanceledError"}RU.inherits(tj,SU,{__CANCEL__:!0});var nj=qU.isStandardBrowserEnv?{write:function(e,t,n,r,i,a){const o=[];o.push(e+"="+encodeURIComponent(t)),RU.isNumber(n)&&o.push("expires="+new Date(n).toGMTString()),RU.isString(r)&&o.push("path="+r),RU.isString(i)&&o.push("domain="+i),!0===a&&o.push("secure"),document.cookie=o.join("; ")},read:function(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove:function(e){this.write(e,"",Date.now()-864e5)}}:{write:function(){},read:function(){return null},remove:function(){}};function rj(e,t){return e&&!/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)?function(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e}(e,t):t}var ij=qU.isStandardBrowserEnv?function(){const e=/(msie|trident)/i.test(navigator.userAgent),t=document.createElement("a");let n;function r(n){let r=n;return e&&(t.setAttribute("href",r),r=t.href),t.setAttribute("href",r),{href:t.href,protocol:t.protocol?t.protocol.replace(/:$/,""):"",host:t.host,search:t.search?t.search.replace(/^\?/,""):"",hash:t.hash?t.hash.replace(/^#/,""):"",hostname:t.hostname,port:t.port,pathname:"/"===t.pathname.charAt(0)?t.pathname:"/"+t.pathname}}return n=r(window.location.href),function(e){const t=RU.isString(e)?r(e):e;return t.protocol===n.protocol&&t.host===n.host}}():function(){return!0};function aj(e,t){let n=0;const r=function(e,t){e=e||10;const n=new Array(e),r=new Array(e);let i,a=0,o=0;return t=void 0!==t?t:1e3,function(s){const c=Date.now(),u=r[o];i||(i=c),n[a]=s,r[a]=c;let f=o,d=0;for(;f!==a;)d+=n[f++],f%=e;if(a=(a+1)%e,a===o&&(o=(o+1)%e),c-i<t)return;const l=u&&c-u;return l?Math.round(1e3*d/l):void 0}}(50,250);return i=>{const a=i.loaded,o=i.lengthComputable?i.total:void 0,s=a-n,c=r(s);n=a;const u={loaded:a,total:o,progress:o?a/o:void 0,bytes:s,rate:c||void 0,estimated:c&&o&&a<=o?(o-a)/c:void 0,event:i};u[t?"download":"upload"]=!0,e(u)}}var oj="undefined"!=typeof XMLHttpRequest&&function(e){return new Promise((function(t,n){let r=e.data;const i=QU.from(e.headers).normalize(),a=e.responseType;let o;function s(){e.cancelToken&&e.cancelToken.unsubscribe(o),e.signal&&e.signal.removeEventListener("abort",o)}RU.isFormData(r)&&(qU.isStandardBrowserEnv||qU.isStandardBrowserWebWorkerEnv?i.setContentType(!1):i.setContentType("multipart/form-data;",!1));let c=new XMLHttpRequest;if(e.auth){const t=e.auth.username||"",n=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";i.set("Authorization","Basic "+btoa(t+":"+n))}const u=rj(e.baseURL,e.url);function f(){if(!c)return;const r=QU.from("getAllResponseHeaders"in c&&c.getAllResponseHeaders());!function(e,t,n){const r=n.config.validateStatus;n.status&&r&&!r(n.status)?t(new SU("Request failed with status code "+n.status,[SU.ERR_BAD_REQUEST,SU.ERR_BAD_RESPONSE][Math.floor(n.status/100)-4],n.config,n.request,n)):e(n)}((function(e){t(e),s()}),(function(e){n(e),s()}),{data:a&&"text"!==a&&"json"!==a?c.response:c.responseText,status:c.status,statusText:c.statusText,headers:r,config:e,request:c}),c=null}if(c.open(e.method.toUpperCase(),LU(u,e.params,e.paramsSerializer),!0),c.timeout=e.timeout,"onloadend"in c?c.onloadend=f:c.onreadystatechange=function(){c&&4===c.readyState&&(0!==c.status||c.responseURL&&0===c.responseURL.indexOf("file:"))&&setTimeout(f)},c.onabort=function(){c&&(n(new SU("Request aborted",SU.ECONNABORTED,e,c)),c=null)},c.onerror=function(){n(new SU("Network Error",SU.ERR_NETWORK,e,c)),c=null},c.ontimeout=function(){let t=e.timeout?"timeout of "+e.timeout+"ms exceeded":"timeout exceeded";const r=e.transitional||jU;e.timeoutErrorMessage&&(t=e.timeoutErrorMessage),n(new SU(t,r.clarifyTimeoutError?SU.ETIMEDOUT:SU.ECONNABORTED,e,c)),c=null},qU.isStandardBrowserEnv){const t=(e.withCredentials||ij(u))&&e.xsrfCookieName&&nj.read(e.xsrfCookieName);t&&i.set(e.xsrfHeaderName,t)}void 0===r&&i.setContentType(null),"setRequestHeader"in c&&RU.forEach(i.toJSON(),(function(e,t){c.setRequestHeader(t,e)})),RU.isUndefined(e.withCredentials)||(c.withCredentials=!!e.withCredentials),a&&"json"!==a&&(c.responseType=e.responseType),"function"==typeof e.onDownloadProgress&&c.addEventListener("progress",aj(e.onDownloadProgress,!0)),"function"==typeof e.onUploadProgress&&c.upload&&c.upload.addEventListener("progress",aj(e.onUploadProgress)),(e.cancelToken||e.signal)&&(o=t=>{c&&(n(!t||t.type?new tj(null,e,c):t),c.abort(),c=null)},e.cancelToken&&e.cancelToken.subscribe(o),e.signal&&(e.signal.aborted?o():e.signal.addEventListener("abort",o)));const d=function(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}(u);d&&-1===qU.protocols.indexOf(d)?n(new SU("Unsupported protocol "+d+":",SU.ERR_BAD_REQUEST,e)):c.send(r||null)}))};const sj={http:null,xhr:oj};RU.forEach(sj,((e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch(e){}Object.defineProperty(e,"adapterName",{value:t})}}));var cj=e=>{e=RU.isArray(e)?e:[e];const{length:t}=e;let n,r;for(let i=0;i<t&&(n=e[i],!(r=RU.isString(n)?sj[n.toLowerCase()]:n));i++);if(!r){if(!1===r)throw new SU(`Adapter ${n} is not supported by the environment`,"ERR_NOT_SUPPORT");throw new Error(RU.hasOwnProp(sj,n)?`Adapter '${n}' is not available in the build`:`Unknown adapter '${n}'`)}if(!RU.isFunction(r))throw new TypeError("adapter is not a function");return r};function uj(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new tj(null,e)}function fj(e){uj(e),e.headers=QU.from(e.headers),e.data=ZU.call(e,e.transformRequest),-1!==["post","put","patch"].indexOf(e.method)&&e.headers.setContentType("application/x-www-form-urlencoded",!1);return cj(e.adapter||VU.adapter)(e).then((function(t){return uj(e),t.data=ZU.call(e,e.transformResponse,t),t.headers=QU.from(t.headers),t}),(function(t){return ej(t)||(uj(e),t&&t.response&&(t.response.data=ZU.call(e,e.transformResponse,t.response),t.response.headers=QU.from(t.response.headers))),Promise.reject(t)}))}const dj=e=>e instanceof QU?e.toJSON():e;function lj(e,t){t=t||{};const n={};function r(e,t,n){return RU.isPlainObject(e)&&RU.isPlainObject(t)?RU.merge.call({caseless:n},e,t):RU.isPlainObject(t)?RU.merge({},t):RU.isArray(t)?t.slice():t}function i(e,t,n){return RU.isUndefined(t)?RU.isUndefined(e)?void 0:r(void 0,e,n):r(e,t,n)}function a(e,t){if(!RU.isUndefined(t))return r(void 0,t)}function o(e,t){return RU.isUndefined(t)?RU.isUndefined(e)?void 0:r(void 0,e):r(void 0,t)}function s(n,i,a){return a in t?r(n,i):a in e?r(void 0,n):void 0}const c={url:a,method:a,data:a,baseURL:o,transformRequest:o,transformResponse:o,paramsSerializer:o,timeout:o,timeoutMessage:o,withCredentials:o,adapter:o,responseType:o,xsrfCookieName:o,xsrfHeaderName:o,onUploadProgress:o,onDownloadProgress:o,decompress:o,maxContentLength:o,maxBodyLength:o,beforeRedirect:o,transport:o,httpAgent:o,httpsAgent:o,cancelToken:o,socketPath:o,responseEncoding:o,validateStatus:s,headers:(e,t)=>i(dj(e),dj(t),!0)};return RU.forEach(Object.keys(Object.assign({},e,t)),(function(r){const a=c[r]||i,o=a(e[r],t[r],r);RU.isUndefined(o)&&a!==s||(n[r]=o)})),n}const pj="1.4.0",hj={};["object","boolean","number","function","string","symbol"].forEach(((e,t)=>{hj[e]=function(n){return typeof n===e||"a"+(t<1?"n ":" ")+e}}));const bj={};hj.transitional=function(e,t,n){function r(e,t){return"[Axios v1.4.0] Transitional option '"+e+"'"+t+(n?". "+n:"")}return(n,i,a)=>{if(!1===e)throw new SU(r(i," has been removed"+(t?" in "+t:"")),SU.ERR_DEPRECATED);return t&&!bj[i]&&(bj[i]=!0,console.warn(r(i," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(n,i,a)}};var mj={assertOptions:function(e,t,n){if("object"!=typeof e)throw new SU("options must be an object",SU.ERR_BAD_OPTION_VALUE);const r=Object.keys(e);let i=r.length;for(;i-- >0;){const a=r[i],o=t[a];if(o){const t=e[a],n=void 0===t||o(t,a,e);if(!0!==n)throw new SU("option "+a+" must be "+n,SU.ERR_BAD_OPTION_VALUE)}else if(!0!==n)throw new SU("Unknown option "+a,SU.ERR_BAD_OPTION)}},validators:hj};const yj=mj.validators;class gj{constructor(e){this.defaults=e,this.interceptors={request:new UU,response:new UU}}request(e,t){"string"==typeof e?(t=t||{}).url=e:t=e||{},t=lj(this.defaults,t);const{transitional:n,paramsSerializer:r,headers:i}=t;let a;void 0!==n&&mj.assertOptions(n,{silentJSONParsing:yj.transitional(yj.boolean),forcedJSONParsing:yj.transitional(yj.boolean),clarifyTimeoutError:yj.transitional(yj.boolean)},!1),null!=r&&(RU.isFunction(r)?t.paramsSerializer={serialize:r}:mj.assertOptions(r,{encode:yj.function,serialize:yj.function},!0)),t.method=(t.method||this.defaults.method||"get").toLowerCase(),a=i&&RU.merge(i.common,i[t.method]),a&&RU.forEach(["delete","get","head","post","put","patch","common"],(e=>{delete i[e]})),t.headers=QU.concat(a,i);const o=[];let s=!0;this.interceptors.request.forEach((function(e){"function"==typeof e.runWhen&&!1===e.runWhen(t)||(s=s&&e.synchronous,o.unshift(e.fulfilled,e.rejected))}));const c=[];let u;this.interceptors.response.forEach((function(e){c.push(e.fulfilled,e.rejected)}));let f,d=0;if(!s){const e=[fj.bind(this),void 0];for(e.unshift.apply(e,o),e.push.apply(e,c),f=e.length,u=Promise.resolve(t);d<f;)u=u.then(e[d++],e[d++]);return u}f=o.length;let l=t;for(d=0;d<f;){const e=o[d++],t=o[d++];try{l=e(l)}catch(e){t.call(this,e);break}}try{u=fj.call(this,l)}catch(e){return Promise.reject(e)}for(d=0,f=c.length;d<f;)u=u.then(c[d++],c[d++]);return u}getUri(e){return LU(rj((e=lj(this.defaults,e)).baseURL,e.url),e.params,e.paramsSerializer)}}RU.forEach(["delete","get","head","options"],(function(e){gj.prototype[e]=function(t,n){return this.request(lj(n||{},{method:e,url:t,data:(n||{}).data}))}})),RU.forEach(["post","put","patch"],(function(e){function t(t){return function(n,r,i){return this.request(lj(i||{},{method:e,headers:t?{"Content-Type":"multipart/form-data"}:{},url:n,data:r}))}}gj.prototype[e]=t(),gj.prototype[e+"Form"]=t(!0)}));var vj=gj;class wj{constructor(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");let t;this.promise=new Promise((function(e){t=e}));const n=this;this.promise.then((e=>{if(!n._listeners)return;let t=n._listeners.length;for(;t-- >0;)n._listeners[t](e);n._listeners=null})),this.promise.then=e=>{let t;const r=new Promise((e=>{n.subscribe(e),t=e})).then(e);return r.cancel=function(){n.unsubscribe(t)},r},e((function(e,r,i){n.reason||(n.reason=new tj(e,r,i),t(n.reason))}))}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){this.reason?e(this.reason):this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const t=this._listeners.indexOf(e);-1!==t&&this._listeners.splice(t,1)}static source(){let e;const t=new wj((function(t){e=t}));return{token:t,cancel:e}}}var _j=wj;const Ej={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(Ej).forEach((([e,t])=>{Ej[t]=e}));var Tj=Ej;const Aj=function e(t){const n=new vj(t),r=WL(vj.prototype.request,n);return RU.extend(r,vj.prototype,n,{allOwnKeys:!0}),RU.extend(r,n,null,{allOwnKeys:!0}),r.create=function(n){return e(lj(t,n))},r}(VU);Aj.Axios=vj,Aj.CanceledError=tj,Aj.CancelToken=_j,Aj.isCancel=ej,Aj.VERSION=pj,Aj.toFormData=PU,Aj.AxiosError=SU,Aj.Cancel=Aj.CanceledError,Aj.all=function(e){return Promise.all(e)},Aj.spread=function(e){return function(t){return e.apply(null,t)}},Aj.isAxiosError=function(e){return RU.isObject(e)&&!0===e.isAxiosError},Aj.mergeConfig=lj,Aj.AxiosHeaders=QU,Aj.formToJSON=e=>zU(RU.isHTMLForm(e)?new FormData(e):e),Aj.HttpStatusCode=Tj,Aj.default=Aj;var Rj=Aj;const Sj="https://guardian.sandbox.imtbl.com".replace(/\/+$/,"");class kj{basePath;axios;configuration;constructor(e,t=Sj,n=Rj){this.basePath=t,this.axios=n,e&&(this.configuration=e,this.basePath=e.basePath||this.basePath)}}class Ij extends Error{field;name="RequiredError";constructor(e,t){super(t),this.field=e}}const Oj="https://example.com",xj=function(e,t,n){if(null==n)throw new Ij(t,`Required parameter ${t} was null or undefined when calling ${e}.`)},Cj=async function(e,t){if(t&&t.accessToken){const n="function"==typeof t.accessToken?await t.accessToken():await t.accessToken;e.Authorization="Bearer "+n}};function Mj(e,t,n=""){"object"==typeof t?Array.isArray(t)?t.forEach((t=>Mj(e,t,n))):Object.keys(t).forEach((r=>Mj(e,t[r],`${n}${""!==n?".":""}${r}`))):e.has(n)?e.append(n,t):e.set(n,t)}const Pj=function(e,...t){const n=new URLSearchParams(e.search);Mj(n,t),e.search=n.toString()},Nj=function(e,t,n){const r="string"!=typeof e;return(r&&n&&n.isJsonMime?n.isJsonMime(t.headers["Content-Type"]):r)?JSON.stringify(void 0!==e?e:{}):e||""},Bj=function(e){return e.pathname+e.search+e.hash},Dj=function(e,t,n,r){return(i=t,a=n)=>{const o={...e.options,url:(r?.basePath||a)+e.url};return i.request(o)}},Fj=function(e){const t=function(e){return{approvePendingMessage:async(t,n={})=>{xj("approvePendingMessage","messageID",t);const r="/guardian/v1/messages/{messageID}/approve".replace("{messageID}",encodeURIComponent(String(t))),i=new URL(r,Oj);let a;e&&(a=e.baseOptions);const o={method:"POST",...a,...n},s={};await Cj(s,e),Pj(i,{});let c=a&&a.headers?a.headers:{};return o.headers={...s,...c,...n.headers},{url:Bj(i),options:o}},evaluateMessage:async(t,n={})=>{xj("evaluateMessage","messageEvaluationRequest",t);const r=new URL("/guardian/v1/messages/evaluate",Oj);let i;e&&(i=e.baseOptions);const a={method:"POST",...i,...n},o={};await Cj(o,e),o["Content-Type"]="application/json",Pj(r,{});let s=i&&i.headers?i.headers:{};return a.headers={...o,...s,...n.headers},a.data=Nj(t,a,e),{url:Bj(r),options:a}},getMessageByID:async(t,n={})=>{xj("getMessageByID","messageID",t);const r="/guardian/v1/messages/{messageID}".replace("{messageID}",encodeURIComponent(String(t))),i=new URL(r,Oj);let a;e&&(a=e.baseOptions);const o={method:"GET",...a,...n},s={};await Cj(s,e),Pj(i,{});let c=a&&a.headers?a.headers:{};return o.headers={...s,...c,...n.headers},{url:Bj(i),options:o}}}}(e);return{async approvePendingMessage(n,r){const i=await t.approvePendingMessage(n,r);return Dj(i,Rj,Sj,e)},async evaluateMessage(n,r){const i=await t.evaluateMessage(n,r);return Dj(i,Rj,Sj,e)},async getMessageByID(n,r){const i=await t.getMessageByID(n,r);return Dj(i,Rj,Sj,e)}}};class Lj extends kj{approvePendingMessage(e,t){return Fj(this.configuration).approvePendingMessage(e.messageID,t).then((e=>e(this.axios,this.basePath)))}evaluateMessage(e,t){return Fj(this.configuration).evaluateMessage(e.messageEvaluationRequest,t).then((e=>e(this.axios,this.basePath)))}getMessageByID(e,t){return Fj(this.configuration).getMessageByID(e.messageID,t).then((e=>e(this.axios,this.basePath)))}}const Uj=function(e){const t=function(e){return{approvePendingTransaction:async(t,n,r={})=>{xj("approvePendingTransaction","payloadHash",t),xj("approvePendingTransaction","transactionApprovalRequest",n);const i="/guardian/v1/transactions/{payloadHash}/approve".replace("{payloadHash}",encodeURIComponent(String(t))),a=new URL(i,Oj);let o;e&&(o=e.baseOptions);const s={method:"POST",...o,...r},c={};await Cj(c,e),c["Content-Type"]="application/json",Pj(a,{});let u=o&&o.headers?o.headers:{};return s.headers={...c,...u,...r.headers},s.data=Nj(n,s,e),{url:Bj(a),options:s}},evaluateTransaction:async(t,n,r={})=>{xj("evaluateTransaction","id",t),xj("evaluateTransaction","transactionEvaluationRequest",n);const i="/guardian/v1/transactions/{id}/evaluate".replace("{id}",encodeURIComponent(String(t))),a=new URL(i,Oj);let o;e&&(o=e.baseOptions);const s={method:"POST",...o,...r},c={};await Cj(c,e),c["Content-Type"]="application/json",Pj(a,{});let u=o&&o.headers?o.headers:{};return s.headers={...c,...u,...r.headers},s.data=Nj(n,s,e),{url:Bj(a),options:s}},getTransactionByID:async(t,n,r,i={})=>{xj("getTransactionByID","transactionID",t),xj("getTransactionByID","chainType",n);const a="/guardian/v1/transactions/{transactionID}".replace("{transactionID}",encodeURIComponent(String(t))),o=new URL(a,Oj);let s;e&&(s=e.baseOptions);const c={method:"GET",...s,...i},u={},f={};await Cj(u,e),void 0!==n&&(f.chainType=n),void 0!==r&&(f.chainID=r),Pj(o,f);let d=s&&s.headers?s.headers:{};return c.headers={...u,...d,...i.headers},{url:Bj(o),options:c}}}}(e);return{async approvePendingTransaction(n,r,i){const a=await t.approvePendingTransaction(n,r,i);return Dj(a,Rj,Sj,e)},async evaluateTransaction(n,r,i){const a=await t.evaluateTransaction(n,r,i);return Dj(a,Rj,Sj,e)},async getTransactionByID(n,r,i,a){const o=await t.getTransactionByID(n,r,i,a);return Dj(o,Rj,Sj,e)}}};class jj extends kj{approvePendingTransaction(e,t){return Uj(this.configuration).approvePendingTransaction(e.payloadHash,e.transactionApprovalRequest,t).then((e=>e(this.axios,this.basePath)))}evaluateTransaction(e,t){return Uj(this.configuration).evaluateTransaction(e.id,e.transactionEvaluationRequest,t).then((e=>e(this.axios,this.basePath)))}getTransactionByID(e,t){return Uj(this.configuration).getTransactionByID(e.transactionID,e.chainType,e.chainID,t).then((e=>e(this.axios,this.basePath)))}}class qj{apiKey;username;password;accessToken;basePath;baseOptions;formDataCtor;constructor(e={}){this.apiKey=e.apiKey,this.username=e.username,this.password=e.password,this.accessToken=e.accessToken,this.basePath=e.basePath,this.baseOptions=e.baseOptions,this.formDataCtor=e.formDataCtor}isJsonMime(e){const t=new RegExp("^(application/json|[^;/ \t]+/[^;/ \t]+[+]json)[ \t]*(;.*)?$","i");return null!==e&&(t.test(e)||"application/json-patch+json"===e.toLowerCase())}}const zj="starkex",Hj="evm";function Gj(e){const t=-1!==new rr(e,16).cmp(new rr(27))?new rr(e,16).sub(new rr(27)).toNumber():new rr(e,16).toNumber();return e.trim()?t:void 0}async function Vj(e,t){const n=function(e,t=64){const n=Em(e);return{r:new rr(n.substring(0,t),"hex"),s:new rr(n.substring(t,2*t),"hex"),recoveryParam:Gj(n.substring(2*t,2*t+2))}}(await t.signMessage(e));return Am(wm((r=n).r.toString(16),64)+wm(r.s.toString(16),64)+wm(r.recoveryParam?.toString(16)||"",2));var r}function Kj(e){switch(e.type){case"ERC721":return{type:"ERC721",data:{token_id:e.tokenId,token_address:e.tokenAddress}};case"ERC20":return{type:"ERC20",data:{token_address:e.tokenAddress}};default:return{type:"ETH",data:{decimals:18}}}}const Wj={erc1271:Object.freeze({__proto__:null,abi:[{type:"function",name:"isValidSignature",constant:!0,inputs:[{type:"bytes32"},{type:"bytes"}],outputs:[{type:"bytes4"}],payable:!1,stateMutability:"view"}],returns:{isValidSignatureBytes32:"0x1626ba7e"}}),factory:Object.freeze({__proto__:null,abi:[{type:"function",name:"deploy",constant:!1,inputs:[{type:"address"},{type:"bytes32"}],outputs:[],payable:!0,stateMutability:"payable"}]}),mainModule:Object.freeze({__proto__:null,abi:[{type:"function",name:"nonce",constant:!0,inputs:[],outputs:[{type:"uint256"}],payable:!1,stateMutability:"view"},{type:"function",name:"readNonce",constant:!0,inputs:[{type:"uint256"}],outputs:[{type:"uint256"}],payable:!1,stateMutability:"view"},{type:"function",name:"updateImplementation",constant:!1,inputs:[{type:"address"}],outputs:[],payable:!1,stateMutability:"nonpayable"},{type:"function",name:"selfExecute",constant:!1,inputs:[{components:[{type:"bool",name:"delegateCall"},{type:"bool",name:"revertOnError"},{type:"uint256",name:"gasLimit"},{type:"address",name:"target"},{type:"uint256",name:"value"},{type:"bytes",name:"data"}],type:"tuple[]"}],outputs:[],payable:!1,stateMutability:"nonpayable"},{type:"function",name:"execute",constant:!1,inputs:[{components:[{type:"bool",name:"delegateCall"},{type:"bool",name:"revertOnError"},{type:"uint256",name:"gasLimit"},{type:"address",name:"target"},{type:"uint256",name:"value"},{type:"bytes",name:"data"}],type:"tuple[]"},{type:"uint256"},{type:"bytes"}],outputs:[],payable:!1,stateMutability:"nonpayable"},{type:"function",name:"createContract",inputs:[{type:"bytes"}],payable:!0,stateMutability:"payable"}]}),mainModuleUpgradable:Object.freeze({__proto__:null,abi:[{type:"function",name:"updateImageHash",constant:!0,inputs:[{type:"bytes32"}],outputs:[],payable:!1,stateMutability:"view"},{type:"function",name:"imageHash",constant:!0,inputs:[],outputs:[{type:"bytes32"}],payable:!1,stateMutability:"view"}]}),sequenceUtils:Object.freeze({__proto__:null,abi:[{inputs:[{internalType:"address",name:"_factory",type:"address"},{internalType:"address",name:"_mainModule",type:"address"}],stateMutability:"nonpayable",type:"constructor"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"_wallet",type:"address"},{indexed:!0,internalType:"bytes32",name:"_imageHash",type:"bytes32"},{indexed:!1,internalType:"uint256",name:"_threshold",type:"uint256"},{indexed:!1,internalType:"bytes",name:"_signers",type:"bytes"}],name:"RequiredConfig",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"_wallet",type:"address"},{indexed:!0,internalType:"address",name:"_signer",type:"address"}],name:"RequiredSigner",type:"event"},{inputs:[{internalType:"address",name:"_addr",type:"address"}],name:"callBalanceOf",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"callBlockNumber",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"_i",type:"uint256"}],name:"callBlockhash",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[],name:"callChainId",outputs:[{internalType:"uint256",name:"id",type:"uint256"}],stateMutability:"pure",type:"function"},{inputs:[{internalType:"address",name:"_addr",type:"address"}],name:"callCode",outputs:[{internalType:"bytes",name:"code",type:"bytes"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"_addr",type:"address"}],name:"callCodeHash",outputs:[{internalType:"bytes32",name:"codeHash",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"_addr",type:"address"}],name:"callCodeSize",outputs:[{internalType:"uint256",name:"size",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"callCoinbase",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"callDifficulty",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"callGasLeft",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"callGasLimit",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"callGasPrice",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"callOrigin",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[],name:"callTimestamp",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"",type:"address"}],name:"knownImageHashes",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"",type:"bytes32"}],name:"lastImageHashUpdate",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"",type:"address"}],name:"lastSignerUpdate",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"",type:"address"}],name:"lastWalletUpdate",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{components:[{internalType:"bool",name:"delegateCall",type:"bool"},{internalType:"bool",name:"revertOnError",type:"bool"},{internalType:"uint256",name:"gasLimit",type:"uint256"},{internalType:"address",name:"target",type:"address"},{internalType:"uint256",name:"value",type:"uint256"},{internalType:"bytes",name:"data",type:"bytes"}],internalType:"struct IModuleCalls.Transaction[]",name:"_txs",type:"tuple[]"}],name:"multiCall",outputs:[{internalType:"bool[]",name:"_successes",type:"bool[]"},{internalType:"bytes[]",name:"_results",type:"bytes[]"}],stateMutability:"payable",type:"function"},{inputs:[{internalType:"address",name:"_wallet",type:"address"},{internalType:"uint256",name:"_threshold",type:"uint256"},{components:[{internalType:"uint256",name:"weight",type:"uint256"},{internalType:"address",name:"signer",type:"address"}],internalType:"struct RequireUtils.Member[]",name:"_members",type:"tuple[]"},{internalType:"bool",name:"_index",type:"bool"}],name:"publishConfig",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"_wallet",type:"address"},{internalType:"bytes32",name:"_hash",type:"bytes32"},{internalType:"uint256",name:"_sizeMembers",type:"uint256"},{internalType:"bytes",name:"_signature",type:"bytes"},{internalType:"bool",name:"_index",type:"bool"}],name:"publishInitialSigners",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"_wallet",type:"address"},{internalType:"uint256",name:"_nonce",type:"uint256"}],name:"requireMinNonce",outputs:[],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"_expiration",type:"uint256"}],name:"requireNonExpired",outputs:[],stateMutability:"view",type:"function"}]}),requireFreshSigner:Object.freeze({__proto__:null,abi:[{inputs:[{internalType:"address",name:"",type:"address"}],name:"requireFreshSigner",outputs:[],stateMutability:"nonpayable",type:"function"}]})};function Xj(){return Xj=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Xj.apply(this,arguments)}var $j;!function(e){e[e.DEBUG=1]="DEBUG",e[e.INFO=2]="INFO",e[e.WARN=3]="WARN",e[e.ERROR=4]="ERROR",e[e.DISABLED=5]="DISABLED"}($j||($j={}));function Jj(e,t){return function(...n){const r=Array.prototype.slice.call(n);return new Promise((async(n,i)=>{try{r.push(((e,t)=>e?i(e):n(t))),await e.apply(t,r)}catch(e){i(e)}}))}}new class{constructor(e){this.config=e,this.logLevel=void 0,this.configure(e)}configure(e){switch(this.config=Xj({},this.config,e),this.config.logLevel){case"DEBUG":this.logLevel=$j.DEBUG;break;case"INFO":default:this.logLevel=$j.INFO;break;case"WARN":this.logLevel=$j.WARN;break;case"ERROR":this.logLevel=$j.ERROR;break;case"DISABLED":this.logLevel=$j.DISABLED}void 0===this.config.silence&&(this.config.silence=!1)}debug(e,...t){!0!==this.config.silence&&this.logLevel===$j.DEBUG&&console.log(e,...t)}info(e,...t){!0!==this.config.silence&&this.logLevel<=$j.INFO&&console.log(e,...t)}warn(e,...t){!0!==this.config.silence&&this.logLevel<=$j.WARN&&(console.warn(e,...t),this.config.onwarn&&this.config.onwarn(e,t))}error(e,...t){!0!==this.config.silence&&this.logLevel<=$j.ERROR&&(console.error(e,...t),this.config.onerror&&this.config.onerror(e,t))}}({logLevel:"INFO",silence:!0});const Yj=(e=0,t=Number.MAX_SAFE_INTEGER)=>(e=Math.ceil(e),t=Math.floor(t),Math.floor(Math.random()*(t-e+1))+e);function Qj(){return Qj=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Qj.apply(this,arguments)}const Zj=(e,t=!1)=>(((e,t=!1,n=!1)=>{if(!e)throw new Error("invalid network config: empty config");const r=[];if(Array.isArray(e)?r.push(...e):r.push(e),0===r.length){if(t)throw new Error("invalid network config: empty config");return!1}const i=r.map((e=>e.chainId)).sort(),a=i.filter(((e,t)=>i.indexOf(e)!==t));if(a.length>0){if(t)throw new Error(`invalid network config: duplicate chainIds ${a}`);return!1}r.forEach((e=>e.name=e.name.toLowerCase()));const o=r.map((e=>e.name)).sort(),s=o.filter(((e,t)=>o.indexOf(e)!==t));if(s.length>0){if(t)throw new Error(`invalid network config: duplicate network names ${s}`);return!1}let c=!1,u=!1;for(let e=0;e<r.length;e++){const i=r[e];if(!(i.rpcUrl&&""!==i.rpcUrl||i.provider)){if(t)throw new Error(`invalid network config for chainId ${i.chainId}: rpcUrl or provider must be provided`);return!1}if(!n&&!i.relayer){if(t)throw new Error(`invalid network config for chainId ${i.chainId}: relayer must be provided`);return!1}if(i.isDefaultChain){if(c){if(t)throw new Error(`invalid network config for chainId ${i.chainId}: DefaultChain is already set by another config`);return!1}c=!0}if(i.isAuthChain){if(u&&t)throw new Error(`invalid network config for chainId ${i.chainId}: AuthChain is already set by another config`);u=!0}}if(!c){if(t)throw new Error("invalid network config: DefaultChain must be set");return!1}if(!u){if(t)throw new Error("invalid network config: AuthChain must be set");return!1}})(e,!0,t),e),eq=e=>Zj(tq(e)),tq=e=>{if(!e)return[];const t=e.sort(((e,t)=>e.chainId===t.chainId?0:e.chainId<t.chainId?-1:1)),n=t.findIndex((e=>e.isDefaultChain));n>0&&t.splice(0,0,t.splice(n,1)[0]);const r=t.findIndex((e=>e.isAuthChain&&!0!==e.isDefaultChain));return r>0&&t.splice(1,0,t.splice(r,1)[0]),t},nq=(e,t)=>"string"==typeof e?(t=t||{},e.replace(/\$\{\s*([$#@\-\d\w]+)\s*\}/gim,(function(e,n){let r=t[n];return r="function"==typeof r?r():null==r?"":"object"==typeof r||"symbol"==typeof r?r.toString():r.valueOf(),r}))):"";let rq;!function(e){e[e.MAINNET=1]="MAINNET",e[e.ROPSTEN=3]="ROPSTEN",e[e.RINKEBY=4]="RINKEBY",e[e.GOERLI=5]="GOERLI",e[e.KOVAN=42]="KOVAN",e[e.POLYGON=137]="POLYGON",e[e.POLYGON_MUMBAI=80001]="POLYGON_MUMBAI",e[e.POLYGON_ZKEVM=1101]="POLYGON_ZKEVM",e[e.BSC=56]="BSC",e[e.BSC_TESTNET=97]="BSC_TESTNET",e[e.OPTIMISM=10]="OPTIMISM",e[e.OPTIMISM_TESTNET=69]="OPTIMISM_TESTNET",e[e.ARBITRUM=42161]="ARBITRUM",e[e.ARBITRUM_GOERLI=421613]="ARBITRUM_GOERLI",e[e.ARBITRUM_NOVA=42170]="ARBITRUM_NOVA",e[e.AVALANCHE=43114]="AVALANCHE",e[e.AVALANCHE_TESTNET=43113]="AVALANCHE_TESTNET",e[e.FANTOM=250]="FANTOM",e[e.FANTOM_TESTNET=4002]="FANTOM_TESTNET",e[e.GNOSIS=100]="GNOSIS",e[e.AURORA=1313161554]="AURORA",e[e.AURORA_TESTNET=1313161556]="AURORA_TESTNET",e[e.BASE_GOERLI=84531]="BASE_GOERLI"}(rq||(rq={}));const iq=e=>nq("https://${network}-indexer.sequence.app",{network:e}),aq=e=>nq("https://${network}-relayer.sequence.app",{network:e}),oq=e=>nq("https://nodes.sequence.app/${network}",{network:e}),sq={[rq.MAINNET]:{chainId:rq.MAINNET,name:"mainnet",title:"Ethereum",blockExplorer:{name:"Etherscan",rootUrl:"https://etherscan.io/"},ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e"},[rq.ROPSTEN]:{chainId:rq.ROPSTEN,name:"ropsten",title:"Ropsten",testnet:!0,blockExplorer:{name:"Etherscan (Ropsten)",rootUrl:"https://ropsten.etherscan.io/"},ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e"},[rq.RINKEBY]:{chainId:rq.RINKEBY,name:"rinkeby",title:"Rinkeby",testnet:!0,blockExplorer:{name:"Etherscan (Rinkeby)",rootUrl:"https://rinkeby.etherscan.io/"},ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",disabled:!0},[rq.GOERLI]:{chainId:rq.GOERLI,name:"goerli",title:"Goerli",testnet:!0,blockExplorer:{name:"Etherscan (Goerli)",rootUrl:"https://goerli.etherscan.io/"},ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e"},[rq.KOVAN]:{chainId:rq.KOVAN,name:"kovan",title:"Kovan",testnet:!0,blockExplorer:{name:"Etherscan (Kovan)",rootUrl:"https://kovan.etherscan.io/"}},[rq.POLYGON]:{chainId:rq.POLYGON,name:"polygon",title:"Polygon",blockExplorer:{name:"Polygonscan",rootUrl:"https://polygonscan.com/"}},[rq.POLYGON_MUMBAI]:{chainId:rq.POLYGON_MUMBAI,name:"mumbai",title:"Polygon Mumbai",testnet:!0,blockExplorer:{name:"Polygonscan (Mumbai)",rootUrl:"https://mumbai.polygonscan.com/"}},[rq.POLYGON_ZKEVM]:{chainId:rq.POLYGON_ZKEVM,name:"polygon-zkevm",title:"Polygon zkEVM",blockExplorer:{name:"Polygonscan (zkEVM)",rootUrl:"https://zkevm.polygonscan.com/"}},[rq.BSC]:{chainId:rq.BSC,name:"bsc",title:"BNB Smart Chain",blockExplorer:{name:"BSCScan",rootUrl:"https://bscscan.com/"}},[rq.BSC_TESTNET]:{chainId:rq.BSC_TESTNET,name:"bsc-testnet",title:"BNB Smart Chain Testnet",testnet:!0,blockExplorer:{name:"BSCScan (Testnet)",rootUrl:"https://testnet.bscscan.com/"}},[rq.OPTIMISM]:{chainId:rq.OPTIMISM,name:"optimism",title:"Optimism",blockExplorer:{name:"Etherscan (Optimism)",rootUrl:"https://optimistic.etherscan.io/"}},[rq.OPTIMISM_TESTNET]:{chainId:rq.OPTIMISM_TESTNET,name:"optimism-testnet",title:"Optimistic Kovan",testnet:!0,blockExplorer:{name:"Etherscan (Optimism Testnet)",rootUrl:"https://kovan-optimistic.etherscan.io/"}},[rq.ARBITRUM]:{chainId:rq.ARBITRUM,name:"arbitrum",title:"Arbitrum One",blockExplorer:{name:"Arbiscan",rootUrl:"https://arbiscan.io/"}},[rq.ARBITRUM_GOERLI]:{chainId:rq.ARBITRUM_GOERLI,name:"arbitrum-goerli",title:"Arbitrum Goerli",testnet:!0,blockExplorer:{name:"Arbiscan (Testnet)",rootUrl:"https://testnet.arbiscan.io/"}},[rq.ARBITRUM_NOVA]:{chainId:rq.ARBITRUM_NOVA,name:"arbitrum-nova",title:"Arbitrum Nova",blockExplorer:{name:"Nova Explorer",rootUrl:"https://nova-explorer.arbitrum.io/"}},[rq.AVALANCHE]:{chainId:rq.AVALANCHE,name:"avalanche",title:"Avalanche",blockExplorer:{name:"Snowtrace",rootUrl:"https://snowtrace.io/"}},[rq.AVALANCHE_TESTNET]:{chainId:rq.AVALANCHE_TESTNET,name:"avalanche-testnet",title:"Avalanche Testnet",testnet:!0,blockExplorer:{name:"Snowtrace (Testnet)",rootUrl:"https://testnet.snowtrace.io/"}},[rq.FANTOM]:{chainId:rq.FANTOM,name:"fantom",title:"Fantom",blockExplorer:{name:"FTMScan",rootUrl:"https://ftmscan.com/"}},[rq.FANTOM_TESTNET]:{chainId:rq.FANTOM_TESTNET,name:"fantom-testnet",title:"Fantom Testnet",testnet:!0,blockExplorer:{name:"FTMScan (Testnet)",rootUrl:"https://testnet.ftmscan.com/"}},[rq.GNOSIS]:{chainId:rq.GNOSIS,name:"gnosis",title:"Gnosis Chain",blockExplorer:{name:"Gnosis Chain Explorer",rootUrl:"https://blockscout.com/xdai/mainnet/"}},[rq.AURORA]:{chainId:rq.AURORA,name:"aurora",title:"Aurora",blockExplorer:{name:"Aurora Explorer",rootUrl:"https://aurorascan.dev/"}},[rq.AURORA_TESTNET]:{chainId:rq.AURORA_TESTNET,name:"aurora-testnet",title:"Aurora Testnet",blockExplorer:{name:"Aurora Explorer (Testnet)",rootUrl:"https://testnet.aurorascan.dev/"}},[rq.BASE_GOERLI]:{chainId:rq.BASE_GOERLI,name:"base-goerli",title:"Base Goerli",blockExplorer:{name:"Base Goerli Explorer",rootUrl:"https://goerli.basescan.org/"}}};eq([Qj({},sq[rq.MAINNET],{rpcUrl:oq("mainnet"),relayer:{url:aq("mainnet")},indexerUrl:iq("mainnet")}),Qj({},sq[rq.POLYGON],{rpcUrl:oq("polygon"),relayer:{url:aq("polygon")},indexerUrl:iq("polygon"),isDefaultChain:!0,isAuthChain:!0}),Qj({},sq[rq.BSC],{rpcUrl:oq("bsc"),indexerUrl:iq("bsc"),relayer:{url:aq("bsc")}}),Qj({},sq[rq.AVALANCHE],{rpcUrl:oq("avalanche"),indexerUrl:iq("avalanche"),relayer:{url:aq("avalanche")}}),Qj({},sq[rq.ARBITRUM],{rpcUrl:oq("arbitrum"),indexerUrl:iq("arbitrum"),relayer:{url:aq("arbitrum")}}),Qj({},sq[rq.ARBITRUM_NOVA],{rpcUrl:oq("arbitrum-nova"),indexerUrl:iq("arbitrum-nova"),relayer:{url:aq("arbitrum-nova")}}),Qj({},sq[rq.OPTIMISM],{rpcUrl:oq("optimism"),indexerUrl:iq("optimism"),relayer:{url:aq("optimism")}}),Qj({},sq[rq.POLYGON_ZKEVM],{rpcUrl:oq("polygon-zkevm"),indexerUrl:iq("polygon-zkevm"),relayer:{url:aq("polygon-zkevm")}}),Qj({},sq[rq.GNOSIS],{rpcUrl:oq("gnosis"),indexerUrl:iq("gnosis"),relayer:{url:aq("gnosis")}})]),eq([Qj({},sq[rq.RINKEBY],{rpcUrl:oq("rinkeby"),relayer:{url:aq("rinkeby")},indexerUrl:iq("rinkeby")}),Qj({},sq[rq.GOERLI],{rpcUrl:oq("goerli"),relayer:{url:aq("goerli")},indexerUrl:iq("goerli")}),Qj({},sq[rq.POLYGON_MUMBAI],{rpcUrl:oq("mumbai"),relayer:{url:aq("mumbai")},indexerUrl:iq("mumbai"),isDefaultChain:!0,isAuthChain:!0}),Qj({},sq[rq.BSC_TESTNET],{rpcUrl:oq("bsc-testnet"),relayer:{url:aq("bsc-testnet")},indexerUrl:iq("bsc-testnet")}),Qj({},sq[rq.ARBITRUM_GOERLI],{rpcUrl:oq("arbitrum-goerli"),relayer:{url:aq("arbitrum-goerli")},indexerUrl:iq("arbitrum-goerli")}),Qj({},sq[rq.BASE_GOERLI],{rpcUrl:oq("base-goerli"),relayer:{url:aq("base-goerli")},indexerUrl:iq("base-goerli")})]);const cq="2.0";function uq(){return uq=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},uq.apply(this,arguments)}let fq;function dq(e,t){return e.reduce((function(e,n,r){return t(n,r)?e[0].push(n):e[1].push(n),e}),[[],[]])}!function(e){e.ethCall="eth_call",e.ethGetBalance="eth_getBalance",e.ethGetCode="eth_getCode"}(fq||(fq={}));const lq={batchSize:50,timeWindow:50,contract:"0xd130B43062D875a4B7aF3f8fc036Bc6e9D3E1B3E",verbose:!1};let pq=class e{constructor(t){var n=this;if(this.batchableJsonRpcMethods=[fq.ethCall,fq.ethGetCode,fq.ethGetBalance],this.multicallInterface=new Ss(Wj.sequenceUtils.abi),this.options=void 0,this.timeout=void 0,this.queue=[],this.scheduleExecution=()=>{this.queue.length>0&&(this.timeout&&clearTimeout(this.timeout),this.timeout=setTimeout(this.run,this.options.timeWindow))},this.handle=(e,t,n)=>this.batchableJsonRpcMethods.find((e=>e===t.method))?(this.queue.push({request:t,callback:n,next:e}),this.options.verbose&&console.log("Scheduling call",t.method),void this.scheduleExecution()):(this.options.verbose&&console.log("Forwarded call",t.method),e(t,n)),this.run=async function(){n.options.verbose&&console.log("Processing multicall");const e=Math.min(n.options.batchSize,n.queue.length);if(0===e)return;if(1===e)return n.forward(n.queue[0]),n.queue=[],void(n.options.verbose&&console.log("Skip multicall, single item"));n.options.verbose&&console.log("Resolving",e);var t=n.queue.slice(0,e);n.queue=e===n.queue.length?[]:n.queue.slice(e),n.options.verbose&&console.log("Updated queue",n.queue.length),0!==n.queue.length&&n.scheduleExecution();const r=t[0].next;let i;var[t,a]=dq(t,(e=>{try{if(e.next!==r)return!1;switch(e.request.method){case fq.ethCall:if(e.request.params[0].from||e.request.params[0].gasPrice||e.request.params[0].value)return!1;case fq.ethGetBalance:case fq.ethGetCode:const t=function(e){if(void 0===e)return"latest";switch(e){case"earliest":case"latest":case"pending":return e}return Hr.from(e)}(e.request.params[1]);if(void 0===i&&(i=t),!function(e,t){return e===t||(Hr.isBigNumber(e)?!!Hr.isBigNumber(t)&&e.eq(t):!Hr.isBigNumber(t)&&e===t)}(t,i))return!1}return!0}catch(e){return!1}}));if(0!==a.length&&(n.options.verbose&&console.log("Forwarding incompatible calls",a.length),n.forward(a),0===t.length))return;let o=t.map((e=>{try{switch(e.request.method){case fq.ethCall:return{delegateCall:!1,revertOnError:!1,target:e.request.params[0].to,data:e.request.params[0].data,gasLimit:e.request.params[0].gas?e.request.params[0].gas:0,value:0};case fq.ethGetCode:return{delegateCall:!1,revertOnError:!1,target:n.options.contract,gasLimit:0,value:0,data:n.multicallInterface.encodeFunctionData(n.multicallInterface.getFunction("callCode"),[e.request.params[0]])};case fq.ethGetBalance:return{delegateCall:!1,revertOnError:!1,target:n.options.contract,gasLimit:0,value:0,data:n.multicallInterface.encodeFunctionData(n.multicallInterface.getFunction("callBalanceOf"),[e.request.params[0]])};default:return null}}catch(e){return null}}));var[t,a]=dq(t,((e,t)=>void 0!==o[t]));if(o=o.filter((e=>e)),0!==a.length&&(n.options.verbose&&console.log("Forwarding calls on error",a.length),n.forward(a),0===t.length))return;let s;try{s=n.multicallInterface.encodeFunctionData(n.multicallInterface.getFunction("multiCall"),[o])}catch(e){return void n.forward(t)}const c=Yj(),u=await async function(e,t){try{return await e}catch(e){return t instanceof Function?t(e):t}}(Jj(r)({id:c,jsonrpc:cq,method:fq.ethCall,params:[{to:n.options.contract,value:0,data:s},Hr.isBigNumber(i)?i.toNumber():i]}),(e=>({jsonrpc:cq,id:c,result:void 0,error:e})));if(u.error)return n.forward(t);let f;try{f=n.multicallInterface.decodeFunctionResult(n.multicallInterface.getFunction("multiCall"),u.result)}catch(e){return void n.forward(t)}n.options.verbose&&console.log("Got response for",t.length),t.forEach(((e,t)=>{if(f[0][t])switch(e.request.method){case fq.ethCall:e.callback(void 0,{jsonrpc:e.request.jsonrpc,id:e.request.id,result:f[1][t]});break;case fq.ethGetCode:e.callback(void 0,{jsonrpc:e.request.jsonrpc,id:e.request.id,result:wo.decode(["bytes"],f[1][t])[0]});break;case fq.ethGetBalance:e.callback(void 0,{jsonrpc:e.request.jsonrpc,id:e.request.id,result:wo.decode(["uint256"],f[1][t])[0]})}else n.forward(e)}))},this.options=t?uq({},e.DefaultOptions,t):e.DefaultOptions,this.options.batchSize<=0)throw new Error(`Invalid batch size of ${this.options.batchSize}`)}forward(e){Array.isArray(e)?e.forEach((e=>e.next(e.request,e.callback))):e.next(e.request,e.callback)}static isMulticall(t){return t&&void 0!==t.handle&&void 0!==t.conf&&e.isMulticallOptions(t.options)}static isMulticallOptions(e){return void 0!==e&&void 0!==e.batchSize&&void 0!==e.timeWindow&&void 0!==e.contract}};pq.DefaultOptions=uq({},lq);const hq=["getNetwork","getBlockNumber","getGasPrice","getTransactionCount","getStorageAt","sendTransaction","estimateGas","getBlock","getTransaction","getTransactionReceipt","getLogs","emit","litenerCount","addListener","removeListener","waitForTransaction","detectNetwork","getBlockWithTransactions"];var bq=Object.freeze({__proto__:null,ProxyMethods:hq,MulticallProvider:class extends Lp{constructor(e,t){var n;super(e.getNetwork()),n=this,this.provider=e,this.multicall=void 0,this.listenerCount=this.provider.listenerCount,this.getResolver=async function(e){const t=n.provider;if(t.getResolver){const r=await t.getResolver(await e);return r?new Bp(n,r.address,r.name):null}return t.getResolver(await e)},this.next=async function(e,t){try{switch(e.method){case fq.ethCall:n.callback(e,t,await n.provider.call(e.params[0],e.params[1]));break;case fq.ethGetCode:n.callback(e,t,await n.provider.getCode(e.params[0],e.params[1]));break;case fq.ethGetBalance:n.callback(e,t,await n.provider.getBalance(e.params[0],e.params[1]))}}catch(r){n.callback(e,t,void 0,r)}},this.multicall=pq.isMulticall(t)?t:new pq(t),hq.forEach((t=>{void 0!==e[t]&&(this[t]=(...n)=>e[t](...n))}))}callback(e,t,n,r){t(r,{jsonrpc:cq,id:e.id,result:n,error:r})}async call(e,t){return this.rpcCall(fq.ethCall,e,t)}async getCode(e,t){return this.rpcCall(fq.ethGetCode,e,t)}async getBalance(e,t){return this.rpcCall(fq.ethGetBalance,e,t)}async rpcCall(e,...t){const n=Yj();return(await Jj(this.multicall.handle)(this.next,{jsonrpc:cq,id:n,method:e,params:t})).result}},MulticallExternalProvider:class{constructor(e,t){if(this.provider=e,this.multicall=void 0,this.multicall=pq.isMulticall(t)?t:new pq(t),e.send){const t=async function(t,n){e.send(t,n)};this.send=(e,n)=>{this.multicall.handle(t,e,n)}}if(e.sendAsync){const t=async function(t,n){e.sendAsync(t,n)};this.sendAsync=(e,n)=>{this.multicall.handle(t,e,n)}}}get isMetaMask(){return this.provider.isMetaMask}get isStatus(){return this.provider.isStatus}},multicallMiddleware:e=>t=>{const n=pq.isMulticall(e)?e:new pq(e);return(e,r)=>n.handle(t,e,r)}}),mq=Object.freeze({__proto__:null,Multicall:pq,providers:bq});let yq,gq;try{yq=localStorage}catch(e){const t=new Map;yq={getItem:e=>{var n;return null!=(n=t.get(e))?n:null},setItem:(e,n)=>t.set(e,n),removeItem:e=>t.delete(e)}}function vq(e){return void 0!==e.address&&!function(e){return wq(e)||_q(e)||Eq(e)}(e)}function wq(e){const t=e;return void 0!==t.signature&&void 0===t.address}function _q(e){const t=e;return void 0!==t.r&&void 0!==t.s&&void 0!==t.v&&void 0!==t.t}function Eq(e){const t=e;return void 0!==t.address&&void 0!==t.signature}!function(e){e[e.EOA=0]="EOA",e[e.Address=1]="Address",e[e.Full=2]="Full"}(gq||(gq={}));const Tq=e=>{if("string"!=typeof e)return e;const t=e.replace("0x",""),n=Hr.from(`0x${t.slice(0,4)}`).toNumber(),r=[];for(let e=4;e<t.length;){const n=Hr.from(t.slice(e,e+2)).toNumber();e+=2;const i=Hr.from(`0x${t.slice(e,e+2)}`).toNumber();switch(e+=2,n){case gq.Address:const n=la(t.slice(e,e+40));e+=40,r.push({weight:i,address:n});break;case gq.EOA:const a=_r(`0x${t.slice(e,e+132)}`);e+=132;const o=Nr(a.slice(0,65)),s=o.r,c=o.s,u=o.v,f=Hr.from(a[a.length-1]).toNumber();r.push({weight:i,signature:a,r:s,s:c,v:u,t:f});break;case gq.Full:const d=la(t.slice(e,e+40));e+=40;const l=Hr.from(`0x${t.slice(e,e+4)}`).mul(2).toNumber();e+=4;const p=_r(`0x${t.slice(e,e+l)}`);e+=l,r.push({weight:i,address:d,signature:p});break;default:throw Error("Signature type not supported")}}return{threshold:n,signers:r}},Aq=e=>{if("string"==typeof e)return Aq(Tq(e));const t=e.signers.map((e=>{if(vq(e))return ub(["uint8","uint8","address"],[gq.Address,e.weight,e.address]);if(_q(e))return ub(["uint8","uint8","bytes32","bytes32","uint8","uint8"],[gq.EOA,e.weight,e.r,e.s,e.v,e.t]);if(Eq(e)){const t=_r(e.signature).length;return ub(["uint8","uint8","address","uint16","bytes"],[gq.Full,e.weight,e.address,t,e.signature])}if(wq(e))return ub(["uint8","uint8","bytes"],[gq.EOA,e.weight,e.signature]);throw Error("Unkwnown signature part type")}));return ub(["uint16",...Array(t.length).fill("bytes")],[e.threshold,...t])};var Rq;!function(e){e.AUTHENTICATION_ERROR="AUTHENTICATION_ERROR",e.INVALID_CONFIGURATION="INVALID_CONFIGURATION",e.WALLET_CONNECTION_ERROR="WALLET_CONNECTION_ERROR",e.NOT_LOGGED_IN_ERROR="NOT_LOGGED_IN_ERROR",e.SILENT_LOGIN_ERROR="SILENT_LOGIN_ERROR",e.REFRESH_TOKEN_ERROR="REFRESH_TOKEN_ERROR",e.USER_REGISTRATION_ERROR="USER_REGISTRATION_ERROR",e.LOGOUT_ERROR="LOGOUT_ERROR",e.TRANSFER_ERROR="TRANSFER_ERROR",e.CREATE_ORDER_ERROR="CREATE_ORDER_ERROR",e.CANCEL_ORDER_ERROR="CANCEL_ORDER_ERROR",e.EXCHANGE_TRANSFER_ERROR="EXCHANGE_TRANSFER_ERROR",e.CREATE_TRADE_ERROR="CREATE_TRADE_ERROR",e.OPERATION_NOT_SUPPORTED_ERROR="OPERATION_NOT_SUPPORTED_ERROR"}(Rq||(Rq={}));class Sq extends Error{type;constructor(e,t){super(e),this.type=t}}const kq=async(e,t)=>{try{return await e()}catch(e){let n;throw n=Ke(e)&&e.response?.data&&function(e){return"code"in e&&"message"in e}(e.response.data)?e.response.data.message:e.message,new Sq(n,t)}},Iq="passport_credentials",Oq="pkce_state",xq="pkce_verifier";class Cq{saveCredentials(e){if(!this.areValid(e))throw Error("Invalid credentials.");localStorage.setItem(Iq,JSON.stringify(e))}getCredentials(){const e=localStorage.getItem(Iq);return e?JSON.parse(e):null}areValid(e){if(e){const t=this.isTokenValid(e.access_token),n=this.isTokenValid(e.id_token);return t&&n}return!1}isTokenValid(e){try{const t=aB(e).exp??0;return t>Date.now()/1e3+3600}catch(e){return!1}}clearCredentials(){localStorage.removeItem(Iq)}savePKCEData(e){localStorage.setItem(Oq,e.state),localStorage.setItem(xq,e.verifier)}getPKCEData(){const e=localStorage.getItem(Oq),t=localStorage.getItem(xq);return e&&t?{state:e,verifier:t}:null}}const Mq={headers:{"Content-Type":"application/x-www-form-urlencoded"}};function Pq(e){return new Promise((t=>{setTimeout(t,e)}))}class Nq{userManager;config;deviceCredentialsManager;logoutMode;constructor(e){this.config=e,this.userManager=new class{constructor(e){this._logger=new dB("UserManager"),this.settings=new UB(e),this._client=new class{constructor(e){this._logger=new dB("OidcClient"),this.settings=new AB(e),this.metadataService=new class{constructor(e){this._settings=e,this._logger=new dB("MetadataService"),this._signingKeys=null,this._metadata=null,this._metadataUrl=this._settings.metadataUrl,this._jsonService=new EB(["application/jwk-set+json"],null,this._settings.extraHeaders),this._settings.signingKeys&&(this._logger.debug("using signingKeys from settings"),this._signingKeys=this._settings.signingKeys),this._settings.metadata&&(this._logger.debug("using metadata from settings"),this._metadata=this._settings.metadata),this._settings.fetchRequestCredentials&&(this._logger.debug("using fetchRequestCredentials from settings"),this._fetchRequestCredentials=this._settings.fetchRequestCredentials)}resetSigningKeys(){this._signingKeys=null}async getMetadata(){const e=this._logger.create("getMetadata");if(this._metadata)return e.debug("using cached values"),this._metadata;if(!this._metadataUrl)throw e.throw(new Error("No authority or metadataUrl configured on settings")),null;e.debug("getting metadata from",this._metadataUrl);const t=await this._jsonService.getJson(this._metadataUrl,{credentials:this._fetchRequestCredentials});return e.debug("merging remote JSON with seed metadata"),this._metadata=Object.assign({},this._settings.metadataSeed,t),this._metadata}getIssuer(){return this._getMetadataProperty("issuer")}getAuthorizationEndpoint(){return this._getMetadataProperty("authorization_endpoint")}getUserInfoEndpoint(){return this._getMetadataProperty("userinfo_endpoint")}getTokenEndpoint(e=!0){return this._getMetadataProperty("token_endpoint",e)}getCheckSessionIframe(){return this._getMetadataProperty("check_session_iframe",!0)}getEndSessionEndpoint(){return this._getMetadataProperty("end_session_endpoint",!0)}getRevocationEndpoint(e=!0){return this._getMetadataProperty("revocation_endpoint",e)}getKeysEndpoint(e=!0){return this._getMetadataProperty("jwks_uri",e)}async _getMetadataProperty(e,t=!1){const n=this._logger.create(`_getMetadataProperty('${e}')`),r=await this.getMetadata();if(n.debug("resolved"),void 0===r[e]){if(!0===t)return void n.warn("Metadata does not contain optional property");n.throw(new Error("Metadata does not contain property "+e))}return r[e]}async getSigningKeys(){const e=this._logger.create("getSigningKeys");if(this._signingKeys)return e.debug("returning signingKeys from cache"),this._signingKeys;const t=await this.getKeysEndpoint(!1);e.debug("got jwks_uri",t);const n=await this._jsonService.getJson(t);if(e.debug("got key set",n),!Array.isArray(n.keys))throw e.throw(new Error("Missing keys on keyset")),null;return this._signingKeys=n.keys,this._signingKeys}}(this.settings),this._claimsService=new class{constructor(e){this._settings=e,this._logger=new dB("ClaimsService")}filterProtocolClaims(e){const t={...e};if(this._settings.filterProtocolClaims){let e;e=Array.isArray(this._settings.filterProtocolClaims)?this._settings.filterProtocolClaims:OB;for(const n of e)xB.includes(n)||delete t[n]}return t}mergeClaims(e,t){const n={...e};for(const[e,r]of Object.entries(t))for(const t of Array.isArray(r)?r:[r]){const r=n[e];r?Array.isArray(r)?r.includes(t)||r.push(t):n[e]!==t&&("object"==typeof t&&this._settings.mergeClaims?n[e]=this.mergeClaims(r,t):n[e]=[r,t]):n[e]=t}return n}}(this.settings),this._validator=new class{constructor(e,t,n){this._settings=e,this._metadataService=t,this._claimsService=n,this._logger=new dB("ResponseValidator"),this._userInfoService=new class{constructor(e,t){this._settings=e,this._metadataService=t,this._logger=new dB("UserInfoService"),this._getClaimsFromJwt=async e=>{const t=this._logger.create("_getClaimsFromJwt");try{const n=hB.decode(e);return t.debug("JWT decoding successful"),n}catch(e){throw t.error("Error parsing JWT response"),e}},this._jsonService=new EB(void 0,this._getClaimsFromJwt,this._settings.extraHeaders)}async getClaims(e){const t=this._logger.create("getClaims");e||this._logger.throw(new Error("No token passed"));const n=await this._metadataService.getUserInfoEndpoint();t.debug("got userinfo url",n);const r=await this._jsonService.getJson(n,{token:e,credentials:this._settings.fetchRequestCredentials});return t.debug("got claims",r),r}}(this._settings,this._metadataService),this._tokenClient=new RB(this._settings,this._metadataService)}async validateSigninResponse(e,t){const n=this._logger.create("validateSigninResponse");this._processSigninState(e,t),n.debug("state processed"),await this._processCode(e,t),n.debug("code processed"),e.isOpenId&&this._validateIdTokenAttributes(e),n.debug("tokens validated"),await this._processClaims(e,null==t?void 0:t.skipUserInfo,e.isOpenId),n.debug("claims processed")}async validateCredentialsResponse(e,t){const n=this._logger.create("validateCredentialsResponse");e.isOpenId&&this._validateIdTokenAttributes(e),n.debug("tokens validated"),await this._processClaims(e,t,e.isOpenId),n.debug("claims processed")}async validateRefreshResponse(e,t){const n=this._logger.create("validateRefreshResponse");e.userState=t.data,null!=e.session_state||(e.session_state=t.session_state),null!=e.scope||(e.scope=t.scope),e.isOpenId&&e.id_token&&(this._validateIdTokenAttributes(e,t.id_token),n.debug("ID Token validated")),e.id_token||(e.id_token=t.id_token,e.profile=t.profile);const r=e.isOpenId&&!!e.id_token;await this._processClaims(e,!1,r),n.debug("claims processed")}validateSignoutResponse(e,t){const n=this._logger.create("validateSignoutResponse");if(t.id!==e.state&&n.throw(new Error("State does not match")),n.debug("state validated"),e.userState=t.data,e.error)throw n.warn("Response was error",e.error),new gB(e)}_processSigninState(e,t){const n=this._logger.create("_processSigninState");if(t.id!==e.state&&n.throw(new Error("State does not match")),t.client_id||n.throw(new Error("No client_id on state")),t.authority||n.throw(new Error("No authority on state")),this._settings.authority!==t.authority&&n.throw(new Error("authority mismatch on settings vs. signin state")),this._settings.client_id&&this._settings.client_id!==t.client_id&&n.throw(new Error("client_id mismatch on settings vs. signin state")),n.debug("state validated"),e.userState=t.data,null!=e.scope||(e.scope=t.scope),e.error)throw n.warn("Response was error",e.error),new gB(e);t.code_verifier&&!e.code&&n.throw(new Error("Expected code in response"))}async _processClaims(e,t=!1,n=!0){const r=this._logger.create("_processClaims");if(e.profile=this._claimsService.filterProtocolClaims(e.profile),t||!this._settings.loadUserInfo||!e.access_token)return void r.debug("not loading user info");r.debug("loading user info");const i=await this._userInfoService.getClaims(e.access_token);r.debug("user info claims received from user info endpoint"),n&&i.sub!==e.profile.sub&&r.throw(new Error("subject from UserInfo response does not match subject in ID Token")),e.profile=this._claimsService.mergeClaims(e.profile,this._claimsService.filterProtocolClaims(i)),r.debug("user info claims received, updated profile:",e.profile)}async _processCode(e,t){const n=this._logger.create("_processCode");if(e.code){n.debug("Validating code");const r=await this._tokenClient.exchangeCode({client_id:t.client_id,client_secret:t.client_secret,code:e.code,redirect_uri:t.redirect_uri,code_verifier:t.code_verifier,...t.extraTokenParams});Object.assign(e,r)}else n.debug("No code to process")}_validateIdTokenAttributes(e,t){var n;const r=this._logger.create("_validateIdTokenAttributes");r.debug("decoding ID Token JWT");const i=hB.decode(null!=(n=e.id_token)?n:"");if(i.sub||r.throw(new Error("ID Token is missing a subject claim")),t){const e=hB.decode(t);i.sub!==e.sub&&r.throw(new Error("sub in id_token does not match current sub")),i.auth_time&&i.auth_time!==e.auth_time&&r.throw(new Error("auth_time in id_token does not match original auth_time")),i.azp&&i.azp!==e.azp&&r.throw(new Error("azp in id_token does not match original azp")),!i.azp&&e.azp&&r.throw(new Error("azp not in id_token, but present in original id_token"))}e.profile=i}}(this.settings,this.metadataService,this._claimsService),this._tokenClient=new RB(this.settings,this.metadataService)}async createSigninRequest({state:e,request:t,request_uri:n,request_type:r,id_token_hint:i,login_hint:a,skipUserInfo:o,nonce:s,response_type:c=this.settings.response_type,scope:u=this.settings.scope,redirect_uri:f=this.settings.redirect_uri,prompt:d=this.settings.prompt,display:l=this.settings.display,max_age:p=this.settings.max_age,ui_locales:h=this.settings.ui_locales,acr_values:b=this.settings.acr_values,resource:m=this.settings.resource,response_mode:y=this.settings.response_mode,extraQueryParams:g=this.settings.extraQueryParams,extraTokenParams:v=this.settings.extraTokenParams}){const w=this._logger.create("createSigninRequest");if("code"!==c)throw new Error("Only the Authorization Code flow (with PKCE) is supported");const _=await this.metadataService.getAuthorizationEndpoint();w.debug("Received authorization endpoint",_);const E=new class{constructor({url:e,authority:t,client_id:n,redirect_uri:r,response_type:i,scope:a,state_data:o,response_mode:s,request_type:c,client_secret:u,nonce:f,resource:d,skipUserInfo:l,extraQueryParams:p,extraTokenParams:h,disablePKCE:b,...m}){if(this._logger=new dB("SigninRequest"),!e)throw this._logger.error("ctor: No url passed"),new Error("url");if(!n)throw this._logger.error("ctor: No client_id passed"),new Error("client_id");if(!r)throw this._logger.error("ctor: No redirect_uri passed"),new Error("redirect_uri");if(!i)throw this._logger.error("ctor: No response_type passed"),new Error("response_type");if(!a)throw this._logger.error("ctor: No scope passed"),new Error("scope");if(!t)throw this._logger.error("ctor: No authority passed"),new Error("authority");this.state=new kB({data:o,request_type:c,code_verifier:!b,client_id:n,authority:t,redirect_uri:r,response_mode:s,client_secret:u,scope:a,extraTokenParams:h,skipUserInfo:l});const y=new URL(e);y.searchParams.append("client_id",n),y.searchParams.append("redirect_uri",r),y.searchParams.append("response_type",i),y.searchParams.append("scope",a),f&&y.searchParams.append("nonce",f),y.searchParams.append("state",this.state.id),this.state.code_challenge&&(y.searchParams.append("code_challenge",this.state.code_challenge),y.searchParams.append("code_challenge_method","S256")),d&&(Array.isArray(d)?d:[d]).forEach((e=>y.searchParams.append("resource",e)));for(const[e,t]of Object.entries({response_mode:s,...m,...p}))null!=t&&y.searchParams.append(e,t.toString());this.url=y.href}}({url:_,authority:this.settings.authority,client_id:this.settings.client_id,redirect_uri:f,response_type:c,scope:u,state_data:e,prompt:d,display:l,max_age:p,ui_locales:h,id_token_hint:i,login_hint:a,acr_values:b,resource:m,request:t,request_uri:n,extraQueryParams:g,extraTokenParams:v,request_type:r,response_mode:y,client_secret:this.settings.client_secret,skipUserInfo:o,nonce:s,disablePKCE:this.settings.disablePKCE});await this.clearStaleState();const T=E.state;return await this.settings.stateStore.set(T.id,T.toStorageString()),E}async readSigninResponseState(e,t=!1){const n=this._logger.create("readSigninResponseState"),r=new IB(yB.readParams(e,this.settings.response_mode));if(!r.state)throw n.throw(new Error("No state in response")),null;const i=await this.settings.stateStore[t?"remove":"get"](r.state);if(!i)throw n.throw(new Error("No matching state found in storage")),null;return{state:kB.fromStorageString(i),response:r}}async processSigninResponse(e){const t=this._logger.create("processSigninResponse"),{state:n,response:r}=await this.readSigninResponseState(e,!0);return t.debug("received state from storage; validating response"),await this._validator.validateSigninResponse(r,n),r}async processResourceOwnerPasswordCredentials({username:e,password:t,skipUserInfo:n=!1,extraTokenParams:r={}}){const i=await this._tokenClient.exchangeCredentials({username:e,password:t,...r}),a=new IB(new URLSearchParams);return Object.assign(a,i),await this._validator.validateCredentialsResponse(a,n),a}async useRefreshToken({state:e,timeoutInSeconds:t}){var n;const r=this._logger.create("useRefreshToken");let i;if(void 0===this.settings.refreshTokenAllowedScope)i=e.scope;else{const t=this.settings.refreshTokenAllowedScope.split(" ");i=((null==(n=e.scope)?void 0:n.split(" "))||[]).filter((e=>t.includes(e))).join(" ")}const a=await this._tokenClient.exchangeRefreshToken({refresh_token:e.refresh_token,scope:i,timeoutInSeconds:t}),o=new IB(new URLSearchParams);return Object.assign(o,a),r.debug("validating response",o),await this._validator.validateRefreshResponse(o,{...e,scope:i}),o}async createSignoutRequest({state:e,id_token_hint:t,request_type:n,post_logout_redirect_uri:r=this.settings.post_logout_redirect_uri,extraQueryParams:i=this.settings.extraQueryParams}={}){const a=this._logger.create("createSignoutRequest"),o=await this.metadataService.getEndSessionEndpoint();if(!o)throw a.throw(new Error("No end session endpoint")),null;a.debug("Received end session endpoint",o);const s=new class{constructor({url:e,state_data:t,id_token_hint:n,post_logout_redirect_uri:r,extraQueryParams:i,request_type:a}){if(this._logger=new dB("SignoutRequest"),!e)throw this._logger.error("ctor: No url passed"),new Error("url");const o=new URL(e);n&&o.searchParams.append("id_token_hint",n),r&&(o.searchParams.append("post_logout_redirect_uri",r),t&&(this.state=new SB({data:t,request_type:a}),o.searchParams.append("state",this.state.id)));for(const[e,t]of Object.entries({...i}))null!=t&&o.searchParams.append(e,t.toString());this.url=o.href}}({url:o,id_token_hint:t,post_logout_redirect_uri:r,state_data:e,extraQueryParams:i,request_type:n});await this.clearStaleState();const c=s.state;return c&&(a.debug("Signout request has state to persist"),await this.settings.stateStore.set(c.id,c.toStorageString())),s}async readSignoutResponseState(e,t=!1){const n=this._logger.create("readSignoutResponseState"),r=new class{constructor(e){this.state=e.get("state"),this.error=e.get("error"),this.error_description=e.get("error_description"),this.error_uri=e.get("error_uri")}}(yB.readParams(e,this.settings.response_mode));if(!r.state){if(n.debug("No state in response"),r.error)throw n.warn("Response was error:",r.error),new gB(r);return{state:void 0,response:r}}const i=await this.settings.stateStore[t?"remove":"get"](r.state);if(!i)throw n.throw(new Error("No matching state found in storage")),null;return{state:SB.fromStorageString(i),response:r}}async processSignoutResponse(e){const t=this._logger.create("processSignoutResponse"),{state:n,response:r}=await this.readSignoutResponseState(e,!0);return n?(t.debug("Received state from storage; validating response"),this._validator.validateSignoutResponse(r,n)):t.debug("No state from storage; skipping response validation"),r}clearStaleState(){return this._logger.create("clearStaleState"),SB.clearStaleState(this.settings.stateStore,this.settings.staleStateAgeInSeconds)}async revokeToken(e,t){return this._logger.create("revokeToken"),await this._tokenClient.revoke({token:e,token_type_hint:t})}}(e),this._redirectNavigator=new class{constructor(e){this._settings=e,this._logger=new dB("RedirectNavigator")}async prepare({redirectMethod:e=this._settings.redirectMethod,redirectTarget:t=this._settings.redirectTarget}){var n;this._logger.create("prepare");let r=window.self;"top"===t&&(r=null!=(n=window.top)?n:window.self);const i=r.location[e].bind(r.location);let a;return{navigate:async e=>{this._logger.create("navigate");const t=new Promise(((e,t)=>{a=t}));return i(e.url),await t},close:()=>{this._logger.create("close"),null==a||a(new Error("Redirect aborted")),r.stop()}}}}(this.settings),this._popupNavigator=new class{constructor(e){this._settings=e,this._logger=new dB("PopupNavigator")}async prepare({popupWindowFeatures:e=this._settings.popupWindowFeatures,popupWindowTarget:t=this._settings.popupWindowTarget}){return new qB({popupWindowFeatures:e,popupWindowTarget:t})}async callback(e,t=!1){this._logger.create("callback"),qB.notifyOpener(e,t)}}(this.settings),this._iframeNavigator=new class{constructor(e){this._settings=e,this._logger=new dB("IFrameNavigator")}async prepare({silentRequestTimeoutInSeconds:e=this._settings.silentRequestTimeoutInSeconds}){return new jB({silentRequestTimeoutInSeconds:e})}async callback(e){this._logger.create("callback"),jB.notifyParent(e,this._settings.iframeNotifyParentOrigin)}}(this.settings),this._events=new zB(this.settings),this._silentRenewService=new class{constructor(e){this._userManager=e,this._logger=new dB("SilentRenewService"),this._isStarted=!1,this._retryTimer=new mB("Retry Silent Renew"),this._tokenExpiring=async()=>{const e=this._logger.create("_tokenExpiring");try{await this._userManager.signinSilent(),e.debug("silent token renewal successful")}catch(t){if(t instanceof vB)return e.warn("ErrorTimeout from signinSilent:",t,"retry in 5s"),void this._retryTimer.init(5);e.error("Error from signinSilent:",t),this._userManager.events._raiseSilentRenewError(t)}}}async start(){const e=this._logger.create("start");if(!this._isStarted){this._isStarted=!0,this._userManager.events.addAccessTokenExpiring(this._tokenExpiring),this._retryTimer.addHandler(this._tokenExpiring);try{await this._userManager.getUser()}catch(t){e.error("getUser error",t)}}}stop(){this._isStarted&&(this._retryTimer.cancel(),this._retryTimer.removeHandler(this._tokenExpiring),this._userManager.events.removeAccessTokenExpiring(this._tokenExpiring),this._isStarted=!1)}}(this),this.settings.automaticSilentRenew&&this.startSilentRenew(),this._sessionMonitor=null,this.settings.monitorSession&&(this._sessionMonitor=new class{constructor(e){this._userManager=e,this._logger=new dB("SessionMonitor"),this._start=async e=>{const t=e.session_state;if(!t)return;const n=this._logger.create("_start");if(e.profile?(this._sub=e.profile.sub,this._sid=e.profile.sid,n.debug("session_state",t,", sub",this._sub)):(this._sub=void 0,this._sid=void 0,n.debug("session_state",t,", anonymous user")),this._checkSessionIFrame)this._checkSessionIFrame.start(t);else try{const e=await this._userManager.metadataService.getCheckSessionIframe();if(e){n.debug("initializing check session iframe");const r=this._userManager.settings.client_id,i=this._userManager.settings.checkSessionIntervalInSeconds,a=this._userManager.settings.stopCheckSessionOnError,o=new class{constructor(e,t,n,r,i){this._callback=e,this._client_id=t,this._intervalInSeconds=r,this._stopOnError=i,this._logger=new dB("CheckSessionIFrame"),this._timer=null,this._session_state=null,this._message=e=>{e.origin===this._frame_origin&&e.source===this._frame.contentWindow&&("error"===e.data?(this._logger.error("error message from check session op iframe"),this._stopOnError&&this.stop()):"changed"===e.data?(this._logger.debug("changed message from check session op iframe"),this.stop(),this._callback()):this._logger.debug(e.data+" message from check session op iframe"))};const a=new URL(n);this._frame_origin=a.origin,this._frame=window.document.createElement("iframe"),this._frame.style.visibility="hidden",this._frame.style.position="fixed",this._frame.style.left="-1000px",this._frame.style.top="0",this._frame.width="0",this._frame.height="0",this._frame.src=a.href}load(){return new Promise((e=>{this._frame.onload=()=>{e()},window.document.body.appendChild(this._frame),window.addEventListener("message",this._message,!1)}))}start(e){if(this._session_state===e)return;this._logger.create("start"),this.stop(),this._session_state=e;const t=()=>{this._frame.contentWindow&&this._session_state&&this._frame.contentWindow.postMessage(this._client_id+" "+this._session_state,this._frame_origin)};t(),this._timer=setInterval(t,1e3*this._intervalInSeconds)}stop(){this._logger.create("stop"),this._session_state=null,this._timer&&(clearInterval(this._timer),this._timer=null)}}(this._callback,r,e,i,a);await o.load(),this._checkSessionIFrame=o,o.start(t)}else n.warn("no check session iframe found in the metadata")}catch(e){n.error("Error from getCheckSessionIframe:",e instanceof Error?e.message:e)}},this._stop=()=>{const e=this._logger.create("_stop");if(this._sub=void 0,this._sid=void 0,this._checkSessionIFrame&&this._checkSessionIFrame.stop(),this._userManager.settings.monitorAnonymousSession){const t=setInterval((async()=>{clearInterval(t);try{const e=await this._userManager.querySessionStatus();if(e){const t={session_state:e.session_state,profile:e.sub&&e.sid?{sub:e.sub,sid:e.sid}:null};this._start(t)}}catch(t){e.error("error from querySessionStatus",t instanceof Error?t.message:t)}}),1e3)}},this._callback=async()=>{const e=this._logger.create("_callback");try{const t=await this._userManager.querySessionStatus();let n=!0;t&&this._checkSessionIFrame?t.sub===this._sub?(n=!1,this._checkSessionIFrame.start(t.session_state),t.sid===this._sid?e.debug("same sub still logged in at OP, restarting check session iframe; session_state",t.session_state):(e.debug("same sub still logged in at OP, session state has changed, restarting check session iframe; session_state",t.session_state),this._userManager.events._raiseUserSessionChanged())):e.debug("different subject signed into OP",t.sub):e.debug("subject no longer signed into OP"),n?this._sub?this._userManager.events._raiseUserSignedOut():this._userManager.events._raiseUserSignedIn():e.debug("no change in session detected, no event to raise")}catch(t){this._sub&&(e.debug("Error calling queryCurrentSigninSession; raising signed out event",t),this._userManager.events._raiseUserSignedOut())}},e||this._logger.throw(new Error("No user manager passed")),this._userManager.events.addUserLoaded(this._start),this._userManager.events.addUserUnloaded(this._stop),this._init().catch((e=>{this._logger.error(e)}))}async _init(){this._logger.create("_init");const e=await this._userManager.getUser();if(e)this._start(e);else if(this._userManager.settings.monitorAnonymousSession){const e=await this._userManager.querySessionStatus();if(e){const t={session_state:e.session_state,profile:e.sub&&e.sid?{sub:e.sub,sid:e.sid}:null};this._start(t)}}}}(this))}get events(){return this._events}get metadataService(){return this._client.metadataService}async getUser(){const e=this._logger.create("getUser"),t=await this._loadUser();return t?(e.info("user loaded"),this._events.load(t,!1),t):(e.info("user not found in storage"),null)}async removeUser(){const e=this._logger.create("removeUser");await this.storeUser(null),e.info("user removed from storage"),this._events.unload()}async signinRedirect(e={}){this._logger.create("signinRedirect");const{redirectMethod:t,...n}=e,r=await this._redirectNavigator.prepare({redirectMethod:t});await this._signinStart({request_type:"si:r",...n},r)}async signinRedirectCallback(e=window.location.href){const t=this._logger.create("signinRedirectCallback"),n=await this._signinEnd(e);return n.profile&&n.profile.sub?t.info("success, signed in subject",n.profile.sub):t.info("no subject"),n}async signinResourceOwnerCredentials({username:e,password:t,skipUserInfo:n=!1}){const r=this._logger.create("signinResourceOwnerCredential"),i=await this._client.processResourceOwnerPasswordCredentials({username:e,password:t,skipUserInfo:n,extraTokenParams:this.settings.extraTokenParams});r.debug("got signin response");const a=await this._buildUser(i);return a.profile&&a.profile.sub?r.info("success, signed in subject",a.profile.sub):r.info("no subject"),a}async signinPopup(e={}){const t=this._logger.create("signinPopup"),{popupWindowFeatures:n,popupWindowTarget:r,...i}=e,a=this.settings.popup_redirect_uri;a||t.throw(new Error("No popup_redirect_uri configured"));const o=await this._popupNavigator.prepare({popupWindowFeatures:n,popupWindowTarget:r}),s=await this._signin({request_type:"si:p",redirect_uri:a,display:"popup",...i},o);return s&&(s.profile&&s.profile.sub?t.info("success, signed in subject",s.profile.sub):t.info("no subject")),s}async signinPopupCallback(e=window.location.href,t=!1){const n=this._logger.create("signinPopupCallback");await this._popupNavigator.callback(e,t),n.info("success")}async signinSilent(e={}){var t;const n=this._logger.create("signinSilent"),{silentRequestTimeoutInSeconds:r,...i}=e;let a=await this._loadUser();if(null==a?void 0:a.refresh_token){n.debug("using refresh token");const e=new class{constructor(e){this.refresh_token=e.refresh_token,this.id_token=e.id_token,this.session_state=e.session_state,this.scope=e.scope,this.profile=e.profile,this.data=e.state}}(a);return await this._useRefreshToken(e)}const o=this.settings.silent_redirect_uri;let s;o||n.throw(new Error("No silent_redirect_uri configured")),a&&this.settings.validateSubOnSilentRenew&&(n.debug("subject prior to silent renew:",a.profile.sub),s=a.profile.sub);const c=await this._iframeNavigator.prepare({silentRequestTimeoutInSeconds:r});return a=await this._signin({request_type:"si:s",redirect_uri:o,prompt:"none",id_token_hint:this.settings.includeIdTokenInSilentRenew?null==a?void 0:a.id_token:void 0,...i},c,s),a&&((null==(t=a.profile)?void 0:t.sub)?n.info("success, signed in subject",a.profile.sub):n.info("no subject")),a}async _useRefreshToken(e){const t=await this._client.useRefreshToken({state:e,timeoutInSeconds:this.settings.silentRequestTimeoutInSeconds}),n=new CB({...e,...t});return await this.storeUser(n),this._events.load(n),n}async signinSilentCallback(e=window.location.href){const t=this._logger.create("signinSilentCallback");await this._iframeNavigator.callback(e),t.info("success")}async signinCallback(e=window.location.href){const{state:t}=await this._client.readSigninResponseState(e);switch(t.request_type){case"si:r":return await this.signinRedirectCallback(e);case"si:p":return await this.signinPopupCallback(e);case"si:s":return await this.signinSilentCallback(e);default:throw new Error("invalid response_type in state")}}async signoutCallback(e=window.location.href,t=!1){const{state:n}=await this._client.readSignoutResponseState(e);if(n)switch(n.request_type){case"so:r":await this.signoutRedirectCallback(e);break;case"so:p":await this.signoutPopupCallback(e,t);break;case"so:s":await this.signoutSilentCallback(e);break;default:throw new Error("invalid response_type in state")}}async querySessionStatus(e={}){const t=this._logger.create("querySessionStatus"),{silentRequestTimeoutInSeconds:n,...r}=e,i=this.settings.silent_redirect_uri;i||t.throw(new Error("No silent_redirect_uri configured"));const a=await this._loadUser(),o=await this._iframeNavigator.prepare({silentRequestTimeoutInSeconds:n}),s=await this._signinStart({request_type:"si:s",redirect_uri:i,prompt:"none",id_token_hint:this.settings.includeIdTokenInSilentRenew?null==a?void 0:a.id_token:void 0,response_type:this.settings.query_status_response_type,scope:"openid",skipUserInfo:!0,...r},o);try{const e=await this._client.processSigninResponse(s.url);return t.debug("got signin response"),e.session_state&&e.profile.sub?(t.info("success for subject",e.profile.sub),{session_state:e.session_state,sub:e.profile.sub,sid:e.profile.sid}):(t.info("success, user not authenticated"),null)}catch(e){if(this.settings.monitorAnonymousSession&&e instanceof gB)switch(e.error){case"login_required":case"consent_required":case"interaction_required":case"account_selection_required":return t.info("success for anonymous user"),{session_state:e.session_state}}throw e}}async _signin(e,t,n){const r=await this._signinStart(e,t);return await this._signinEnd(r.url,n)}async _signinStart(e,t){const n=this._logger.create("_signinStart");try{const r=await this._client.createSigninRequest(e);return n.debug("got signin request"),await t.navigate({url:r.url,state:r.state.id,response_mode:r.state.response_mode,scriptOrigin:this.settings.iframeScriptOrigin})}catch(e){throw n.debug("error after preparing navigator, closing navigator window"),t.close(),e}}async _signinEnd(e,t){const n=this._logger.create("_signinEnd"),r=await this._client.processSigninResponse(e);return n.debug("got signin response"),await this._buildUser(r,t)}async _buildUser(e,t){const n=this._logger.create("_buildUser"),r=new CB(e);if(t){if(t!==r.profile.sub)throw n.debug("current user does not match user returned from signin. sub from signin:",r.profile.sub),new gB({...e,error:"login_required"});n.debug("current user matches user returned from signin")}return await this.storeUser(r),n.debug("user stored"),this._events.load(r),r}async signoutRedirect(e={}){const t=this._logger.create("signoutRedirect"),{redirectMethod:n,...r}=e,i=await this._redirectNavigator.prepare({redirectMethod:n});await this._signoutStart({request_type:"so:r",post_logout_redirect_uri:this.settings.post_logout_redirect_uri,...r},i),t.info("success")}async signoutRedirectCallback(e=window.location.href){const t=this._logger.create("signoutRedirectCallback"),n=await this._signoutEnd(e);return t.info("success"),n}async signoutPopup(e={}){const t=this._logger.create("signoutPopup"),{popupWindowFeatures:n,popupWindowTarget:r,...i}=e,a=this.settings.popup_post_logout_redirect_uri,o=await this._popupNavigator.prepare({popupWindowFeatures:n,popupWindowTarget:r});await this._signout({request_type:"so:p",post_logout_redirect_uri:a,state:null==a?void 0:{},...i},o),t.info("success")}async signoutPopupCallback(e=window.location.href,t=!1){const n=this._logger.create("signoutPopupCallback");await this._popupNavigator.callback(e,t),n.info("success")}async _signout(e,t){const n=await this._signoutStart(e,t);return await this._signoutEnd(n.url)}async _signoutStart(e={},t){var n;const r=this._logger.create("_signoutStart");try{const i=await this._loadUser();r.debug("loaded current user from storage"),this.settings.revokeTokensOnSignout&&await this._revokeInternal(i);const a=e.id_token_hint||i&&i.id_token;a&&(r.debug("setting id_token_hint in signout request"),e.id_token_hint=a),await this.removeUser(),r.debug("user removed, creating signout request");const o=await this._client.createSignoutRequest(e);return r.debug("got signout request"),await t.navigate({url:o.url,state:null==(n=o.state)?void 0:n.id})}catch(e){throw r.debug("error after preparing navigator, closing navigator window"),t.close(),e}}async _signoutEnd(e){const t=this._logger.create("_signoutEnd"),n=await this._client.processSignoutResponse(e);return t.debug("got signout response"),n}async signoutSilent(e={}){var t;const n=this._logger.create("signoutSilent"),{silentRequestTimeoutInSeconds:r,...i}=e,a=this.settings.includeIdTokenInSilentSignout?null==(t=await this._loadUser())?void 0:t.id_token:void 0,o=this.settings.popup_post_logout_redirect_uri,s=await this._iframeNavigator.prepare({silentRequestTimeoutInSeconds:r});await this._signout({request_type:"so:s",post_logout_redirect_uri:o,id_token_hint:a,...i},s),n.info("success")}async signoutSilentCallback(e=window.location.href){const t=this._logger.create("signoutSilentCallback");await this._iframeNavigator.callback(e),t.info("success")}async revokeTokens(e){const t=await this._loadUser();await this._revokeInternal(t,e)}async _revokeInternal(e,t=this.settings.revokeTokenTypes){const n=this._logger.create("_revokeInternal");if(!e)return;const r=t.filter((t=>"string"==typeof e[t]));if(r.length){for(const t of r)await this._client.revokeToken(e[t],t),n.info(`${t} revoked successfully`),"access_token"!==t&&(e[t]=null);await this.storeUser(e),n.debug("user stored"),this._events.load(e)}else n.debug("no need to revoke due to no token(s)")}startSilentRenew(){this._logger.create("startSilentRenew"),this._silentRenewService.start()}stopSilentRenew(){this._silentRenewService.stop()}get _userStoreKey(){return`user:${this.settings.authority}:${this.settings.client_id}`}async _loadUser(){const e=this._logger.create("_loadUser"),t=await this.settings.userStore.get(this._userStoreKey);return t?(e.debug("user storageString loaded"),CB.fromStorageString(t)):(e.debug("no user storageString"),null)}async storeUser(e){const t=this._logger.create("storeUser");if(e){t.debug("storing user");const n=e.toStorageString();await this.settings.userStore.set(this._userStoreKey,n)}else this._logger.debug("removing user"),await this.settings.userStore.remove(this._userStoreKey)}async clearStaleState(){await this._client.clearStaleState()}}((({oidcConfiguration:e,authenticationDomain:t})=>{const n="undefined"!=typeof window?window.localStorage:new _B,r=new TB({store:n}),i={authority:t,redirect_uri:e.redirectUri,popup_redirect_uri:e.redirectUri,client_id:e.clientId,metadata:{authorization_endpoint:`${t}/authorize`,token_endpoint:`${t}/oauth/token`,userinfo_endpoint:`${t}/userinfo`,end_session_endpoint:`${t}/v2/logout?returnTo=${encodeURIComponent(e.logoutRedirectUri)}&client_id=${e.clientId}`},mergeClaims:!0,loadUserInfo:!0,scope:e.scope,userStore:r};return e.audience&&(i.extraQueryParams={audience:e.audience}),i})(e)),this.deviceCredentialsManager=new Cq,this.logoutMode=e.oidcConfiguration.logoutMode||"redirect"}static mapOidcUserToDomainModel=e=>{const t=e.profile?.passport,n={expired:e.expired,idToken:e.id_token,accessToken:e.access_token,refreshToken:e.refresh_token,profile:{sub:e.profile.sub,email:e.profile.email,nickname:e.profile.nickname}};return t?.imx_eth_address&&(n.imx={ethAddress:t?.imx_eth_address,starkAddress:t?.imx_stark_address,userAdminAddress:t?.imx_user_admin_address}),t?.zkevm_eth_address&&(n.zkEvm={ethAddress:t?.zkevm_eth_address,userAdminAddress:t?.zkevm_user_admin_address}),n};static mapDeviceTokenResponseToDomainUserModel=e=>{const t=aB(e.id_token),n={idToken:e.id_token,accessToken:e.access_token,refreshToken:e.refresh_token,profile:{sub:t.sub,email:t.email,nickname:t.nickname}};return t?.passport?.imx_eth_address&&(n.imx={ethAddress:t?.passport?.imx_eth_address,starkAddress:t?.passport?.imx_stark_address,userAdminAddress:t?.passport?.imx_user_admin_address}),t?.passport?.zkevm_eth_address&&(n.zkEvm={ethAddress:t?.passport?.zkevm_eth_address,userAdminAddress:t?.passport?.zkevm_user_admin_address}),n};async login(){return kq((async()=>{const e=await this.userManager.signinPopup({popupWindowFeatures:{width:410,height:450}});return Nq.mapOidcUserToDomainModel(e)}),Rq.AUTHENTICATION_ERROR)}async loginCallback(){return kq((async()=>this.userManager.signinPopupCallback()),Rq.AUTHENTICATION_ERROR)}async loginWithDeviceFlow(){return kq((async()=>{const e=await Fe.post(`${this.config.authenticationDomain}/oauth/device/code`,{client_id:this.config.oidcConfiguration.clientId,scope:this.config.oidcConfiguration.scope,audience:this.config.oidcConfiguration.audience},Mq);return{code:e.data.user_code,deviceCode:e.data.device_code,url:e.data.verification_uri_complete,interval:e.data.interval}}),Rq.AUTHENTICATION_ERROR)}async connectImxDeviceFlow(e,t,n){return kq((async()=>{const r=Date.now();for(;;){if(null!=n&&Date.now()-r>n)throw new Error("Timed out");await Pq(1e3*t);try{const t=await this.getDeviceFlowToken(e),n=Nq.mapDeviceTokenResponseToDomainUserModel(t);return n.imx?.ethAddress&&n.imx?.starkAddress&&n.imx?.userAdminAddress&&this.deviceCredentialsManager.saveCredentials(t),n}catch(e){if(!Fe.isAxiosError(e))throw e;{const t=e.response?.data;switch(t.error){case"authorization_pending":case"slow_down":break;case"expired_token":throw new Error("Token expired, please log in again");case"access_denied":throw new Error("User denied access");default:throw new Error("Error getting token")}}}}throw new Error("Failed to get credentials")}),Rq.AUTHENTICATION_ERROR)}async getDeviceFlowToken(e){return(await Fe.post(`${this.config.authenticationDomain}/oauth/token`,{client_id:this.config.oidcConfiguration.clientId,grant_type:"urn:ietf:params:oauth:grant-type:device_code",device_code:e},Mq)).data}static base64URLEncode(e){return e.toString("base64").replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}static sha256(e){return(void 0)("sha256").update(e).digest()}getPKCEAuthorizationUrl(){const e=Nq.base64URLEncode((void 0)(32)),t=Nq.base64URLEncode(Nq.sha256(e)),n=Nq.base64URLEncode((void 0)(32));return this.deviceCredentialsManager.savePKCEData({state:n,verifier:e}),`${this.config.authenticationDomain}/authorize?response_type=code&code_challenge=${t}&code_challenge_method=S256&client_id=${this.config.oidcConfiguration.clientId}&redirect_uri=${this.config.oidcConfiguration.redirectUri}&scope=${this.config.oidcConfiguration.scope}&state=${n}&audience=${this.config.oidcConfiguration.audience}`}async connectImxPKCEFlow(e,t){return kq((async()=>{const n=this.deviceCredentialsManager.getPKCEData();if(!n)throw new Error("No code verifier or state for PKCE");if(t!==n.state)throw new Error("Provided state does not match stored state");const r=await this.getPKCEToken(e,n.verifier),i=Nq.mapDeviceTokenResponseToDomainUserModel(r);return i.imx?.ethAddress&&i.imx?.starkAddress&&i.imx?.userAdminAddress&&this.deviceCredentialsManager.saveCredentials(r),i}),Rq.AUTHENTICATION_ERROR)}async getPKCEToken(e,t){return(await Fe.post(`${this.config.authenticationDomain}/oauth/token`,{client_id:this.config.oidcConfiguration.clientId,grant_type:"authorization_code",code_verifier:t,code:e,redirect_uri:this.config.oidcConfiguration.redirectUri},Mq)).data}async connectImxWithCredentials(e){return kq((async()=>{if(this.deviceCredentialsManager.areValid(e))return Nq.mapDeviceTokenResponseToDomainUserModel(e);const t=e?.refresh_token??null;if(t){return await this.refreshToken(t)}return null}),Rq.AUTHENTICATION_ERROR)}async refreshToken(e){const t=(await Fe.post(`${this.config.authenticationDomain}/oauth/token`,{client_id:this.config.oidcConfiguration.clientId,grant_type:"refresh_token",refresh_token:e},Mq)).data;return Nq.mapDeviceTokenResponseToDomainUserModel(t)}async logout(){return kq((async()=>"silent"===this.logoutMode?this.userManager.signoutSilent():this.userManager.signoutRedirect()),Rq.LOGOUT_ERROR)}async logoutSilentCallback(e){return this.userManager.signoutSilentCallback(e)}async logoutDeviceFlow(){return kq((async()=>{this.deviceCredentialsManager.clearCredentials()}),Rq.LOGOUT_ERROR)}async loginSilent(){return kq((async()=>{if(!await this.getUser())return null;const e=await this.userManager.signinSilent();return e?Nq.mapOidcUserToDomainModel(e):null}),Rq.SILENT_LOGIN_ERROR)}async getUser(){return kq((async()=>{const e=await this.userManager.getUser();if(e)return Nq.mapOidcUserToDomainModel(e);const t=this.deviceCredentialsManager.getCredentials();return t?Nq.mapDeviceTokenResponseToDomainUserModel(t):null}),Rq.NOT_LOGGED_IN_ERROR)}async getUserDeviceFlow(){return kq((async()=>{const e=this.deviceCredentialsManager.getCredentials();return e?Nq.mapDeviceTokenResponseToDomainUserModel(e):null}),Rq.NOT_LOGGED_IN_ERROR)}checkStoredDeviceFlowCredentials(){return this.deviceCredentialsManager.getCredentials()}}class Bq{config;magicClient;constructor(e){this.config=e}async login(e,t){return kq((async()=>(this.magicClient=new GL(this.config.magicPublishableApiKey,{extensions:[new KL],network:t}),await this.magicClient.openid.loginWithOIDC({jwt:e,providerId:this.config.magicProviderId}),this.magicClient.rpcProvider)),Rq.WALLET_CONNECTION_ERROR)}async logout(){this.magicClient?.user&&await this.magicClient.user.logout()}}const Dq=1e3,Fq=3,Lq=async(e,t)=>{const{retries:n=Fq,interval:r=Dq,finalErr:i=Error("Retry failed"),finallyFn:a=(()=>{})}=t||{};try{return await e()}catch(t){return n<=0?Promise.reject(i):(await(o=r,new Promise((e=>{setTimeout((()=>e()),o)}))),Lq(e,{retries:n-1,finalErr:i,finallyFn:a}))}finally{n<=0&&a()}var o};var Uq,jq;!function(e){e[e.USER_REJECTED_REQUEST=4001]="USER_REJECTED_REQUEST",e[e.UNAUTHORIZED=4100]="UNAUTHORIZED",e[e.UNSUPPORTED_METHOD=4200]="UNSUPPORTED_METHOD",e[e.DISCONNECTED=4900]="DISCONNECTED"}(Uq||(Uq={})),function(e){e[e.RPC_SERVER_ERROR=-32e3]="RPC_SERVER_ERROR",e[e.INVALID_REQUEST=-32600]="INVALID_REQUEST",e[e.METHOD_NOT_FOUND=-32601]="METHOD_NOT_FOUND",e[e.INVALID_PARAMS=-32602]="INVALID_PARAMS",e[e.INTERNAL_ERROR=-32603]="INTERNAL_ERROR",e[e.PARSE_ERROR=-32700]="PARSE_ERROR",e[e.TRANSACTION_REJECTED=-32003]="TRANSACTION_REJECTED"}(jq||(jq={}));class qq extends Error{message;code;constructor(e,t){super(t),this.message=t,this.code=e}}const zq="Transaction requires confirmation but this functionality is not supported in this environment. Please contact Immutable support if you need to enable this feature.",Hq=e=>Hr.from(e).toString();class Gq{transactionAPI;messageAPI;confirmationScreen;imxEtherAddress;crossSdkBridgeEnabled;constructor({accessToken:e,confirmationScreen:t,imxEtherAddress:n,config:r}){const i=new qj({accessToken:e,basePath:r.imxPublicApiDomain});this.confirmationScreen=t,this.transactionAPI=new jj(new qj(i)),this.imxEtherAddress=n,this.crossSdkBridgeEnabled=r.crossSdkBridgeEnabled,this.messageAPI=new Lj(i)}withConfirmationScreen(e){return t=>this.withConfirmationScreenTask(e)(t)()}withConfirmationScreenTask(e){return t=>async()=>{this.confirmationScreen.loading(e);try{return await t()}catch(e){throw this.confirmationScreen.closeWindow(),e}}}withDefaultConfirmationScreenTask(e){return this.withConfirmationScreenTask()(e)}async validate({payloadHash:e}){if(!(await Lq((async()=>this.transactionAPI.getTransactionByID({transactionID:e,chainType:"starkex"})),{finallyFn:()=>{this.confirmationScreen.closeWindow()}})).data.id)throw new Error("Transaction doesn't exists");const t=await this.transactionAPI.evaluateTransaction({id:e,transactionEvaluationRequest:{chainType:"starkex"}}),{confirmationRequired:n}=t.data;if(n){if(this.crossSdkBridgeEnabled)throw new Error(zq);if(!(await this.confirmationScreen.requestConfirmation(e,this.imxEtherAddress,zj)).confirmed)throw new Error("Transaction rejected by user")}else this.confirmationScreen.closeWindow()}async evaluateEVMTransaction({chainId:e,nonce:t,user:n,metaTransactions:r}){const i={Authorization:`Bearer ${n.accessToken}`},a=(e=>{try{return e.map((e=>({delegateCall:!0===e.delegateCall,revertOnError:!0===e.revertOnError,gasLimit:e.gasLimit?Hq(e.gasLimit):"0",target:e.to??Oa,value:e.value?Hq(e.value):"0",data:e.data?e.data.toString():"0x"})))}catch(e){const t=e instanceof Error?e.message:String(e);throw new qq(jq.INVALID_PARAMS,`Transaction failed to parsing: ${t}`)}})(r);try{return(await this.transactionAPI.evaluateTransaction({id:"evm",transactionEvaluationRequest:{chainType:"evm",chainId:e,transactionData:{nonce:t,userAddress:n.zkEvm.ethAddress,metaTransactions:a}}},{headers:i})).data}catch(e){const t=e instanceof Error?e.message:String(e);throw new qq(jq.INTERNAL_ERROR,`Transaction failed to validate with error: ${t}`)}}async validateEVMTransaction({chainId:e,nonce:t,user:n,metaTransactions:r}){const i=await this.evaluateEVMTransaction({chainId:e,nonce:t,user:n,metaTransactions:r}),{confirmationRequired:a,transactionId:o}=i;if(a&&this.crossSdkBridgeEnabled)throw new qq(jq.TRANSACTION_REJECTED,zq);if(a&&o){if(!(await this.confirmationScreen.requestConfirmation(o,this.imxEtherAddress,Hj,e)).confirmed)throw new qq(jq.TRANSACTION_REJECTED,"Transaction rejected by user")}else this.confirmationScreen.closeWindow()}async evaluateMessage({chainID:e,payload:t,user:n}){try{return(await this.messageAPI.evaluateMessage({messageEvaluationRequest:{chainID:e,payload:t}},{headers:{Authorization:`Bearer ${n.accessToken}`}})).data}catch(e){const t=e instanceof Error?e.message:String(e);throw new qq(jq.INTERNAL_ERROR,`Message failed to validate with error: ${t}`)}}async validateMessage({chainID:e,payload:t,user:n}){const{messageId:r,confirmationRequired:i}=await this.evaluateMessage({chainID:e,payload:t,user:n});if(i&&this.crossSdkBridgeEnabled)throw new qq(jq.TRANSACTION_REJECTED,zq);if(i&&r){if(!(await this.confirmationScreen.requestMessageConfirmation(r)).confirmed)throw new qq(jq.TRANSACTION_REJECTED,"Signature rejected by user")}else this.confirmationScreen.closeWindow()}}var Vq,Kq;!function(e){e.LOGGED_OUT="loggedOut"}(Vq||(Vq={})),function(e){e.PRODUCTION="mainnet",e.SANDBOX="goerli"}(Kq||(Kq={}));const Wq="ERC721";const Xq="ERC721";class $q{user;starkSigner;immutableXClient;confirmationScreen;guardianClient;constructor({user:e,starkSigner:t,immutableXClient:n,confirmationScreen:r,config:i,passportEventEmitter:a}){this.user=e,this.starkSigner=t,this.immutableXClient=n,this.confirmationScreen=r,this.guardianClient=new Gq({accessToken:e.accessToken,confirmationScreen:r,imxEtherAddress:e.imx.ethAddress,config:i}),a.on(Vq.LOGGED_OUT,this.handleLogout)}handleLogout=()=>{this.user=void 0,this.starkSigner=void 0};checkIsLoggedIn(){if(void 0===this.user||void 0===this.starkSigner)throw new Sq("User has been logged out",Rq.NOT_LOGGED_IN_ERROR)}async transfer(e){return this.checkIsLoggedIn(),async function({request:e,transfersApi:t,starkSigner:n,user:r,guardianClient:i}){return kq(i.withDefaultConfirmationScreenTask((async()=>{const a=e.type===Xq?"1":e.amount,o={sender:r.imx.ethAddress,token:Kj(e),amount:a,receiver:e.receiver},s={Authorization:`Bearer ${r.accessToken}`},c=await t.getSignableTransferV1({getSignableTransferRequest:o},{headers:s});await i.validate({payloadHash:c.data.payload_hash});const u=c.data,{payload_hash:f}=u,d=await n.signMessage(f),l=await n.getAddress(),p={createTransferRequest:{sender_stark_key:u.sender_stark_key||l,sender_vault_id:u.sender_vault_id,receiver_stark_key:u.receiver_stark_key,receiver_vault_id:u.receiver_vault_id,asset_id:u.asset_id,amount:u.amount,nonce:u.nonce,expiration_timestamp:u.expiration_timestamp,stark_signature:d}},{data:h}=await t.createTransferV1(p,{headers:s});return{sent_signature:h.sent_signature,status:h.status?.toString(),time:h.time,transfer_id:h.transfer_id}})),Rq.TRANSFER_ERROR)}({request:e,user:this.user,starkSigner:this.starkSigner,transfersApi:this.immutableXClient.transfersApi,guardianClient:this.guardianClient})}registerOffchain(){throw new Sq("Operation not supported",Rq.OPERATION_NOT_SUPPORTED_ERROR)}isRegisteredOnchain(){throw new Sq("Operation not supported",Rq.OPERATION_NOT_SUPPORTED_ERROR)}createOrder(e){return this.checkIsLoggedIn(),async function({starkSigner:e,user:t,request:n,ordersApi:r,guardianClient:i}){return kq(i.withDefaultConfirmationScreenTask((async()=>{const{ethAddress:a}=t.imx,o=n.sell.type===Wq?"1":n.sell.amount,s=n.buy.type===Wq?"1":n.buy.amount,c={Authorization:`Bearer ${t.accessToken}`},u={user:a,amount_buy:s,token_buy:Kj(n.buy),amount_sell:o,token_sell:Kj(n.sell),fees:n.fees,split_fees:!0,expiration_timestamp:n.expiration_timestamp},f=await r.getSignableOrder({getSignableOrderRequestV3:u},{headers:c});await i.validate({payloadHash:f.data.payload_hash});const{payload_hash:d}=f.data,l=await e.signMessage(d),p=f.data,h={createOrderRequest:{include_fees:!0,fees:n.fees,stark_signature:l,amount_buy:p.amount_buy,amount_sell:p.amount_sell,asset_id_buy:p.asset_id_buy,asset_id_sell:p.asset_id_sell,expiration_timestamp:p.expiration_timestamp,nonce:p.nonce,stark_key:p.stark_key,vault_id_buy:p.vault_id_buy,vault_id_sell:p.vault_id_sell}};return{...(await r.createOrderV3(h,{headers:c})).data}})),Rq.CREATE_ORDER_ERROR)}({request:e,user:this.user,starkSigner:this.starkSigner,ordersApi:this.immutableXClient.ordersApi,guardianClient:this.guardianClient})}cancelOrder(e){return this.checkIsLoggedIn(),async function({user:e,starkSigner:t,request:n,ordersApi:r,guardianClient:i}){return kq(i.withDefaultConfirmationScreenTask((async()=>{const a={order_id:n.order_id},o={Authorization:`Bearer ${e.accessToken}`},s=await r.getSignableCancelOrderV3({getSignableCancelOrderRequest:a},{headers:o});await i.validate({payloadHash:s.data.payload_hash});const{payload_hash:c}=s.data,u=await t.signMessage(c),f=await r.cancelOrderV3({id:n.order_id.toString(),cancelOrderRequest:{order_id:n.order_id,stark_signature:u}},{headers:o});return{order_id:f.data.order_id,status:f.data.status}})),Rq.CANCEL_ORDER_ERROR)}({request:e,user:this.user,starkSigner:this.starkSigner,ordersApi:this.immutableXClient.ordersApi,guardianClient:this.guardianClient})}createTrade(e){return this.checkIsLoggedIn(),async function({request:e,tradesApi:t,user:n,starkSigner:r,guardianClient:i}){return kq(i.withDefaultConfirmationScreenTask((async()=>{const{ethAddress:a}=n.imx,o={expiration_timestamp:e.expiration_timestamp,fees:e.fees,order_id:e.order_id,user:a},s={Authorization:`Bearer ${n.accessToken}`},c=await t.getSignableTrade({getSignableTradeRequest:o},{headers:s});await i.validate({payloadHash:c.data.payload_hash});const{payload_hash:u}=c.data,f=await r.signMessage(u),{data:d}=c,l={createTradeRequest:{include_fees:!0,fees:e?.fees,stark_signature:f,order_id:e?.order_id,fee_info:d.fee_info,amount_buy:d.amount_buy,amount_sell:d.amount_sell,asset_id_buy:d.asset_id_buy,asset_id_sell:d.asset_id_sell,expiration_timestamp:d.expiration_timestamp,nonce:d.nonce,stark_key:d.stark_key,vault_id_buy:d.vault_id_buy,vault_id_sell:d.vault_id_sell}},{data:p}=await t.createTradeV3(l,{headers:s});return p})),Rq.CREATE_TRADE_ERROR)}({request:e,user:this.user,starkSigner:this.starkSigner,tradesApi:this.immutableXClient.tradesApi,guardianClient:this.guardianClient})}batchNftTransfer(e){return this.checkIsLoggedIn(),async function({user:e,starkSigner:t,request:n,transfersApi:r,guardianClient:i}){return kq(i.withConfirmationScreenTask({width:480,height:784})((async()=>{const{ethAddress:a}=e.imx,o={sender_ether_key:a,signable_requests:n.map((e=>({amount:"1",token:Kj({type:Xq,tokenId:e.tokenId,tokenAddress:e.tokenAddress}),receiver:e.receiver})))},s={Authorization:`Bearer ${e.accessToken}`},c=await r.getSignableTransfer({getSignableTransferRequestV2:o},{headers:s});await i.validate({payloadHash:c.data.signable_responses[0]?.payload_hash});const u=await Promise.all(c.data.signable_responses.map((async e=>{const n=await t.signMessage(e.payload_hash);return{sender_vault_id:e.sender_vault_id,receiver_stark_key:e.receiver_stark_key,receiver_vault_id:e.receiver_vault_id,asset_id:e.asset_id,amount:e.amount,nonce:e.nonce,expiration_timestamp:e.expiration_timestamp,stark_signature:n}}))),f={sender_stark_key:c.data.sender_stark_key,requests:u},d=await r.createTransfer({createTransferRequestV2:f},{headers:s});return{transfer_ids:d?.data.transfer_ids}})),Rq.TRANSFER_ERROR)}({request:e,user:this.user,starkSigner:this.starkSigner,transfersApi:this.immutableXClient.transfersApi,guardianClient:this.guardianClient})}exchangeTransfer(e){return this.checkIsLoggedIn(),async function({user:e,starkSigner:t,request:n,exchangesApi:r}){return kq((async()=>{const{ethAddress:i}=e.imx,a=n.amount,o=await r.getExchangeSignableTransfer({id:n.transactionID,getSignableTransferRequest:{sender:i,token:Kj(n),amount:a,receiver:n.receiver}}),s=await t.getAddress(),{payload_hash:c}=o.data,u=await t.signMessage(c),f={sender_stark_key:o.data.sender_stark_key||s,sender_vault_id:o.data.sender_vault_id,receiver_stark_key:o.data.receiver_stark_key,receiver_vault_id:o.data.receiver_vault_id,asset_id:o.data.asset_id,amount:o.data.amount,nonce:o.data.nonce,expiration_timestamp:o.data.expiration_timestamp,stark_signature:u},d={Authorization:`Bearer ${e.accessToken}`},l=await r.createExchangeTransfer({id:n.transactionID,createTransferRequest:f},{headers:d});return{sent_signature:l?.data.sent_signature,status:l?.data.status?.toString(),time:l?.data.time,transfer_id:l?.data.transfer_id}}),Rq.EXCHANGE_TRANSFER_ERROR)}({request:e,user:this.user,starkSigner:this.starkSigner,exchangesApi:this.immutableXClient.exchangeApi})}deposit(e){throw new Sq("Operation not supported",Rq.OPERATION_NOT_SUPPORTED_ERROR)}prepareWithdrawal(e){throw new Sq("Operation not supported",Rq.OPERATION_NOT_SUPPORTED_ERROR)}completeWithdrawal(e,t){throw new Sq("Operation not supported",Rq.OPERATION_NOT_SUPPORTED_ERROR)}getAddress(){return this.checkIsLoggedIn(),Promise.resolve(this.user.imx.ethAddress)}}class Jq{authManager;config;confirmationScreen;immutableXClient;magicAdapter;passportEventEmitter;constructor({authManager:e,config:t,confirmationScreen:n,immutableXClient:r,magicAdapter:i,passportEventEmitter:a}){this.authManager=e,this.config=t,this.confirmationScreen=n,this.immutableXClient=r,this.magicAdapter=i,this.passportEventEmitter=a}async getProvider(){const e=await this.authManager.login();return this.createProviderInstance(e)}async getProviderSilent(){const e=await this.authManager.loginSilent();return e?this.createProviderInstance(e):null}async getProviderWithDeviceFlow(e,t,n){const r=await this.authManager.connectImxDeviceFlow(e,t,n);return this.createProviderInstance(r)}async getProviderWithPKCEFlow(e,t){const n=await this.authManager.connectImxPKCEFlow(e,t);return this.createProviderInstance(n)}async getProviderWithCredentials(e){const t=await this.authManager.connectImxWithCredentials(e);return t?this.createProviderInstance(t):null}async createProviderInstance(e){if(!e.idToken)throw new Sq("Failed to initialise",Rq.WALLET_CONNECTION_ERROR);const t=await this.magicAdapter.login(e.idToken,this.config.network),n=new Zh(t).getSigner(),r=await(async e=>kq((async()=>Ax(await jN(e))),Rq.WALLET_CONNECTION_ERROR))(n);if(!e.imx?.ethAddress){const t=await this.registerStarkEx(n,r,e.accessToken);return new $q({user:t,starkSigner:r,immutableXClient:this.immutableXClient,confirmationScreen:this.confirmationScreen,config:this.config,passportEventEmitter:this.passportEventEmitter})}return new $q({user:e,starkSigner:r,immutableXClient:this.immutableXClient,confirmationScreen:this.confirmationScreen,config:this.config,passportEventEmitter:this.passportEventEmitter})}async registerStarkEx(e,t,n){return kq((async()=>{await async function({ethSigner:e,starkSigner:t,usersApi:n},r){return kq((async()=>{const i=await e.getAddress(),a=await t.getAddress(),o=await n.getSignableRegistrationOffchain({getSignableRegistrationRequest:{ether_key:i,stark_key:a}}),{signable_message:s,payload_hash:c}=o.data,u=await Vj(s,e),f=await t.signMessage(c);return(await n.registerPassportUser({authorization:`Bearer ${r}`,registerPassportUserRequest:{eth_signature:u,ether_key:i,stark_signature:f,stark_key:a}})).statusText}),Rq.USER_REGISTRATION_ERROR)}({ethSigner:e,starkSigner:t,usersApi:this.immutableXClient.usersApi},n);return await Lq((async()=>{const e=await this.authManager.loginSilent();return!!e?.imx?e:Promise.reject(new Error("user wallet addresses not exist"))}))}),Rq.REFRESH_TOKEN_ERROR)}}const Yq=(e,t,n)=>{const r=t.map((t=>!e[t]&&t)).filter((e=>e)).join(", ");if(""!==r){throw new Sq(n?`${n} - ${r} cannot be null`:`${r} cannot be null`,Rq.INVALID_CONFIGURATION)}};class Qq{network;authenticationDomain;passportDomain;imxPublicApiDomain;magicPublishableApiKey;magicProviderId;oidcConfiguration;baseConfig;zkEvmRpcUrl;relayerUrl;multiRollupConfig;crossSdkBridgeEnabled;constructor({baseConfig:e,overrides:n,crossSdkBridgeEnabled:r,...i}){if(Yq(i,["clientId","logoutRedirectUri","redirectUri"]),this.oidcConfiguration=i,this.baseConfig=e,this.crossSdkBridgeEnabled=r||!1,n)Yq(n,["network","authenticationDomain","passportDomain","magicPublishableApiKey","magicProviderId","zkEvmRpcUrl","relayerUrl","imxPublicApiDomain","indexerMrBasePath","orderBookMrBasePath","passportMrBasePath"],"overrides"),this.network=n.network,this.authenticationDomain=n.authenticationDomain,this.passportDomain=n.passportDomain,this.imxPublicApiDomain=n.imxPublicApiDomain,this.magicPublishableApiKey=n.magicPublishableApiKey,this.magicProviderId=n.magicProviderId,this.zkEvmRpcUrl=n.zkEvmRpcUrl,this.relayerUrl=n.relayerUrl,this.multiRollupConfig={indexer:Ut({basePath:n.indexerMrBasePath}),orderBook:Ut({basePath:n.orderBookMrBasePath}),passport:Ut({basePath:n.passportMrBasePath})};else switch(e.environment){case t.PRODUCTION:this.network=Kq.PRODUCTION,this.authenticationDomain="https://auth.immutable.com",this.magicPublishableApiKey="pk_live_10F423798A540ED7",this.magicProviderId="fSMzaRQ4O7p4fttl7pCyGVtJS_G70P8SNsLXtPPGHo0=",this.passportDomain="https://passport.immutable.com",this.imxPublicApiDomain="https://api.immutable.com",this.zkEvmRpcUrl="",this.relayerUrl="https://api.immutable.com/relayer-mr",this.multiRollupConfig=jt();break;case t.SANDBOX:default:this.network=Kq.SANDBOX,this.authenticationDomain="https://auth.immutable.com",this.magicPublishableApiKey="pk_live_10F423798A540ED7",this.magicProviderId="fSMzaRQ4O7p4fttl7pCyGVtJS_G70P8SNsLXtPPGHo0=",this.passportDomain="https://passport.sandbox.immutable.com",this.imxPublicApiDomain="https://api.sandbox.immutable.com",this.zkEvmRpcUrl="https://rpc.testnet.immutable.com",this.relayerUrl="https://api.sandbox.immutable.com/relayer-mr",this.multiRollupConfig=qt()}}}var Zq;!function(e){e.CONFIRMATION_WINDOW_READY="confirmation_window_ready",e.TRANSACTION_CONFIRMED="transaction_confirmed",e.TRANSACTION_ERROR="transaction_error",e.MESSAGE_CONFIRMED="message_confirmed",e.MESSAGE_REJECTED="message_rejected",e.LOGOUT_SUCCESS="logout_success"}(Zq||(Zq={}));const ez="imx_passport_confirmation";class tz{config;confirmationWindow;constructor(e){this.config=e}requestConfirmation(e,t,n,r){return new Promise(((i,a)=>{const o=({data:e,origin:t})=>{if(t===this.config.passportDomain&&e.eventType===ez)switch(e.messageType){case Zq.CONFIRMATION_WINDOW_READY:break;case Zq.TRANSACTION_CONFIRMED:i({confirmed:!0});break;case Zq.TRANSACTION_ERROR:a(new Error("Transaction error"));break;default:a(new Error("Unsupported message type"))}};if(!this.confirmationWindow)return void i({confirmed:!1});window.addEventListener("message",o);let s="";s=n===zj?`${this.config.passportDomain}/transaction-confirmation/transaction?transactionId=${e}&imxEtherAddress=${t}&chainType=starkex`:`${this.config.passportDomain}/transaction-confirmation/zkevm?transactionId=${e}&imxEtherAddress=${t}&chainType=evm&chainId=${r}`,this.showConfirmationScreen(s,o,i)}))}requestMessageConfirmation(e){return new Promise(((t,n)=>{const r=({data:e,origin:r})=>{if(r===this.config.passportDomain&&e.eventType===ez)switch(e.messageType){case Zq.CONFIRMATION_WINDOW_READY:break;case Zq.MESSAGE_CONFIRMED:t({confirmed:!0});break;case Zq.MESSAGE_REJECTED:n(new Error("Message rejected"));break;default:n(new Error("Unsupported message type"))}};if(!this.confirmationWindow)return void t({confirmed:!1});window.addEventListener("message",r);const i=`${this.config.passportDomain}/transaction-confirmation/zkevm/message?messageID=${e}`;this.showConfirmationScreen(i,r,t)}))}loading(e){this.config.crossSdkBridgeEnabled||(this.confirmationWindow=(({url:e,title:t,width:n,height:r})=>{const i=Math.max(0,Math.round(window.screenX+(window.outerWidth-n)/2)),a=Math.max(0,Math.round(window.screenY+(window.outerHeight-r)/2)),o=window.open(e,t,`\n scrollbars=yes,\n width=${n}, \n height=${r}, \n top=${a}, \n left=${i}\n `);if(!o)throw new Error("Failed to open confirmation screen");return o.focus(),o})({url:`${this.config.passportDomain}/transaction-confirmation/loading`,title:"Confirm this transaction",width:e?.width||480,height:e?.height||380}))}closeWindow(){this.confirmationWindow?.close()}logout(){return new Promise(((e,t)=>{const n=document.createElement("iframe");n.setAttribute("id","passport-confirm"),n.setAttribute("src",`${this.config.passportDomain}/transaction-confirmation/logout`),n.setAttribute("style","display: none; position: absolute;width:0px;height:0px;border:0;");const r=({data:i,origin:a})=>{a===this.config.passportDomain&&i.eventType===ez&&(window.removeEventListener("message",r),n.remove(),i.messageType===Zq.LOGOUT_SUCCESS&&e({logout:!0}),t(new Error("Unsupported logout type")))};window.addEventListener("message",r),document.body.appendChild(n)}))}showConfirmationScreen(e,t,n){this.confirmationWindow.location.href=e;const r=setInterval((()=>{this.confirmationWindow?.closed&&(clearInterval(r),window.removeEventListener("message",t),n({confirmed:!1}))}),1e3)}}var nz,rz;!function(e){e.PENDING="PENDING",e.SUBMITTED="SUBMITTED",e.SUCCESSFUL="SUCCESSFUL",e.REVERTED="REVERTED",e.FAILED="FAILED"}(nz||(nz={})),function(e){e.ACCOUNTS_CHANGED="accountsChanged"}(rz||(rz={}));class iz{emitter=new g_;emit(e,...t){this.emitter.emit(e,...t)}on(e,t){this.emitter.on(e,t)}removeListener(e,t){this.emitter.removeListener(e,t)}}const az=(e,t,n)=>ub(["string","uint256","address","bytes32"],["",e,t,n]),oz=async(e,t,n,r,i)=>{const a=e.map((e=>({delegateCall:!0===e.delegateCall,revertOnError:!0===e.revertOnError,gasLimit:e.gasLimit??Ca,target:e.to??Oa,value:e.value??Ca,data:e.data??[]})));const o=function(e,t){return Ji(wo.encode(["uint256","tuple(\n bool delegateCall,\n bool revertOnError,\n uint256 gasLimit,\n address target,\n uint256 value,\n bytes data\n)[]"],[e,t]))}(t,a),s=_r(Ji(az(n,r,o))),c=await i.signMessage(s),u=Aq({threshold:1,signers:[{weight:1,signature:`${c}02`}]}),f=new Ss(Wj.mainModule.abi);return f.encodeFunctionData(f.getFunction("execute"),[a,t,u])},sz=async(e,t,n,r,i)=>{const a={...e.types};delete a.EIP712Domain;const o=ys.hash(e.domain,a,e.message),s=_r(Ji(az(n,r,o))),c=`${await i.signMessage(s)}02`,{signers:u}=(e=>Tq(`0000${e}`))(t);return Aq({threshold:2,signers:[...u,{weight:1,signature:c}]})},cz=e=>`eip155:${e}`;class uz{config;jsonRpcProvider;user;constructor({config:e,jsonRpcProvider:t,user:n}){this.config=e,this.jsonRpcProvider=t,this.user=n}async postToRelayer(e){const t={id:1,jsonrpc:"2.0",...e},n=await fetch(`${this.config.relayerUrl}/v1/transactions`,{method:"POST",headers:{Authorization:`Bearer ${this.user.accessToken}`,"Content-Type":"application/json"},body:JSON.stringify(t)}),r=await n.json();if(r.error)throw r.error;return r}async ethSendTransaction(e,t){const{chainId:n}=await this.jsonRpcProvider.ready,r={method:"eth_sendTransaction",params:[{to:e,data:t,chainId:cz(n)}]},{result:i}=await this.postToRelayer(r);return i}async imGetTransactionByHash(e){const t={method:"im_getTransactionByHash",params:[e]},{result:n}=await this.postToRelayer(t);return n}async imGetFeeOptions(e,t){const{chainId:n}=await this.jsonRpcProvider.ready,r={method:"im_getFeeOptions",params:[{userAddress:e,data:t,chainId:cz(n)}]},{result:i}=await this.postToRelayer(r);return i}async imSignTypedData(e,t){const{chainId:n}=await this.jsonRpcProvider.ready,r={method:"im_signTypedData",params:[{address:e,eip712Payload:t,chainId:cz(n)}]},{result:i}=await this.postToRelayer(r);return i}}const fz=async({authManager:e,config:t,magicAdapter:n,multiRollupApiClients:r})=>{const i=await e.getUser()||await e.getUserDeviceFlow()||await e.login();if(!i.idToken)throw new Error("User is missing idToken");const a=await n.login(i.idToken,t.network);if(!i.zkEvm){const n=await async function({authManager:e,config:t,magicProvider:n,multiRollupApiClients:r,accessToken:i}){const a=new Zh(n).getSigner(),o=await a.getAddress(),s=await Vj("Only sign this message from Immutable Passport",a),c={Authorization:`Bearer ${i}`};try{await r.passportApi.createCounterfactualAddress({createCounterfactualAddressRequest:{ethereumAddress:o,ethereumSignature:s}},{headers:c})}catch(e){throw new qq(jq.INTERNAL_ERROR,`Failed to create counterfactual address: ${e}`)}let u;if(t.crossSdkBridgeEnabled){const t=e.checkStoredDeviceFlowCredentials();if(!t||!t.refresh_token)throw new qq(jq.INTERNAL_ERROR,"Cross SDK bridge: Failed to refresh user details");u=await e.refreshToken(t.refresh_token)}else u=await e.loginSilent();if(!u?.zkEvm)throw new qq(jq.INTERNAL_ERROR,"Failed to refresh user details");return u}({authManager:e,config:t,magicProvider:a,multiRollupApiClients:r,accessToken:i.accessToken});return{user:n,magicProvider:a}}return{user:i,magicProvider:a}},dz=({params:e,magicProvider:t,jsonRpcProvider:n,relayerClient:r,guardianClient:i,user:a})=>i.withConfirmationScreen({width:480,height:520})((async()=>{const o=e[0];if(!o.to)throw new qq(jq.INVALID_PARAMS,'eth_sendTransaction requires a "to" field');const{chainId:s}=await n.ready,c=Hr.from(s),u=new Zh(t).getSigner(),f=await(async(e,t)=>{const n=await e.send("eth_getCode",[t,"latest"]);if(n&&"0x"!==n)return new ud(t,Wj.mainModule.abi,e).nonce();return 0})(n,a.zkEvm.ethAddress),d={to:o.to,data:o.data,nonce:f,value:o.value,revertOnError:!0},l=await oz([d],f,c,a.zkEvm.ethAddress,u),p=(await r.imGetFeeOptions(a.zkEvm.ethAddress,l)).find((e=>"IMX"===e.tokenSymbol));if(!p)throw new Error("Failed to retrieve fees for IMX token");const h={nonce:f,to:p.recipientAddress,value:p.tokenPrice,revertOnError:!0};await i.validateEVMTransaction({chainId:cz(s),nonce:Hq(f),user:a,metaTransactions:[d,h]});const b=await oz([d,h],f,c,a.zkEvm.ethAddress,u),m=await r.ethSendTransaction(a.zkEvm.ethAddress,b),y=await Lq((async()=>{const e=await r.imGetTransactionByHash(m);if(e.status===nz.PENDING)throw new Error;return e}),{retries:30,interval:1e3,finalErr:new qq(jq.RPC_SERVER_ERROR,"transaction hash not generated in time")});if(![nz.SUBMITTED,nz.SUCCESSFUL].includes(y.status)){let e=`Transaction failed to submit with status ${y.status}.`;throw y.statusMessage&&(e+=` Error message: ${y.statusMessage}`),new qq(jq.RPC_SERVER_ERROR,e)}return y.hash})),lz=["types","domain","primaryType","message"],pz=(e,t)=>{let n;if("string"==typeof e)try{n=JSON.parse(e)}catch(e){throw new qq(jq.INVALID_PARAMS,`Failed to parse typed data JSON: ${e}`)}else{if("object"!=typeof e)throw new qq(jq.INVALID_PARAMS,`Invalid typed data argument: ${e}`);n=e}if(!(e=>lz.every((t=>t in e)))(n))throw new qq(jq.INVALID_PARAMS,`Invalid typed data argument. The following properties are required: ${lz.join(", ")}`);const r=n.domain?.chainId;if(r&&("string"==typeof r&&(r.startsWith("0x")?n.domain.chainId=parseInt(r,16):n.domain.chainId=parseInt(r,10)),n.domain.chainId!==t))throw new qq(jq.INVALID_PARAMS,`Invalid chainId, expected ${t}`);return n};class hz{authManager;config;confirmationScreen;magicAdapter;multiRollupApiClients;jsonRpcProvider;eventEmitter;guardianClient;relayerClient;magicProvider;user;isPassport=!0;constructor({authManager:e,magicAdapter:t,config:n,confirmationScreen:r,multiRollupApiClients:i,passportEventEmitter:a}){this.authManager=e,this.magicAdapter=t,this.config=n,this.confirmationScreen=r,this.jsonRpcProvider=new Yp(this.config.zkEvmRpcUrl),this.multiRollupApiClients=i,this.eventEmitter=new iz,a.on(Vq.LOGGED_OUT,this.handleLogout)}handleLogout=()=>{const e=this.isLoggedIn();this.magicProvider=void 0,this.user=void 0,this.relayerClient=void 0,this.guardianClient=void 0,e&&this.eventEmitter.emit(rz.ACCOUNTS_CHANGED,[])};isLoggedIn(){return void 0!==this.magicProvider&&void 0!==this.user&&void 0!==this.relayerClient&&void 0!==this.guardianClient}async performRequest(e){switch(e.method){case"eth_requestAccounts":{if(this.isLoggedIn())return[this.user.zkEvm.ethAddress];const{magicProvider:e,user:t}=await fz({authManager:this.authManager,config:this.config,magicAdapter:this.magicAdapter,multiRollupApiClients:this.multiRollupApiClients});return this.user=t,this.magicProvider=e,this.relayerClient=new uz({config:this.config,jsonRpcProvider:this.jsonRpcProvider,user:this.user}),this.guardianClient=new Gq({accessToken:this.user.accessToken,confirmationScreen:this.confirmationScreen,imxEtherAddress:this.user.zkEvm.ethAddress,config:this.config}),this.eventEmitter.emit(rz.ACCOUNTS_CHANGED,[this.user.zkEvm.ethAddress]),[this.user.zkEvm.ethAddress]}case"eth_sendTransaction":if(!this.isLoggedIn())throw new qq(Uq.UNAUTHORIZED,"Unauthorised - call eth_requestAccounts first");return dz({params:e.params||[],magicProvider:this.magicProvider,guardianClient:this.guardianClient,jsonRpcProvider:this.jsonRpcProvider,relayerClient:this.relayerClient,user:this.user});case"eth_accounts":return this.isLoggedIn()?[this.user.zkEvm.ethAddress]:[];case"eth_signTypedData":case"eth_signTypedData_v4":if(!this.isLoggedIn())throw new qq(Uq.UNAUTHORIZED,"Unauthorised - call eth_requestAccounts first");return(async({params:e,method:t,magicProvider:n,jsonRpcProvider:r,relayerClient:i,guardianClient:a,user:o})=>a.withConfirmationScreen({width:480,height:730})((async()=>{const s=e[0],c=e[1];if(!s||!c)throw new qq(jq.INVALID_PARAMS,`${t} requires an address and a typed data JSON`);const{chainId:u}=await r.ready,f=pz(c,u);await a.validateMessage({chainID:String(u),payload:f,user:o});const d=await i.imSignTypedData(s,f),l=new Zh(n).getSigner();return sz(f,d,Hr.from(u),s,l)})))({method:e.method,params:e.params||[],magicProvider:this.magicProvider,jsonRpcProvider:this.jsonRpcProvider,relayerClient:this.relayerClient,user:this.user,guardianClient:this.guardianClient});case"eth_gasPrice":case"eth_getBalance":case"eth_getCode":case"eth_getStorageAt":case"eth_estimateGas":case"eth_call":case"eth_blockNumber":case"eth_chainId":case"eth_getBlockByHash":case"eth_getBlockByNumber":case"eth_getTransactionByHash":case"eth_getTransactionReceipt":case"eth_getTransactionCount":return this.jsonRpcProvider.send(e.method,e.params||[]);default:throw new qq(Uq.UNSUPPORTED_METHOD,"Method not supported")}}async performJsonRpcRequest(e){const{id:t,jsonrpc:n}=e;try{return{id:t,jsonrpc:n,result:await this.performRequest(e)}}catch(e){let r;return r=e instanceof qq?e:e instanceof Error?new qq(jq.INTERNAL_ERROR,e.message):new qq(jq.INTERNAL_ERROR,"Internal error"),{id:t,jsonrpc:n,error:r}}}async request(e){try{return this.performRequest(e)}catch(e){if(e instanceof qq)throw e;if(e instanceof Error)throw new qq(jq.INTERNAL_ERROR,e.message);throw new qq(jq.INTERNAL_ERROR,"Internal error")}}sendAsync(e,t){if(!t)throw new Error("No callback provided");Array.isArray(e)?Promise.all(e.map(this.performJsonRpcRequest)).then((e=>{t(null,e)})).catch((e=>{t(e,[])})):this.performJsonRpcRequest(e).then((e=>{t(null,e)})).catch((e=>{t(e,null)}))}async send(e,t,n){if("string"==typeof e)return"function"==typeof t?this.sendAsync({method:e,params:[]},t):n?this.sendAsync({method:e,params:Array.isArray(t)?t:[]},n):this.request({method:e,params:Array.isArray(t)?t:[]});if("function"==typeof t)return this.sendAsync(e,t);if(!Array.isArray(e)&&"object"==typeof e)return this.performJsonRpcRequest(e);throw new qq(jq.INVALID_REQUEST,"Invalid request")}on(e,t){this.eventEmitter.on(e,t)}removeListener(e,t){this.eventEmitter.removeListener(e,t)}}var bz=Object.freeze({__proto__:null,JsonRpcError:qq,get Networks(){return Kq},Passport:class{authManager;config;confirmationScreen;immutableXClient;magicAdapter;multiRollupApiClients;passportImxProviderFactory;passportEventEmitter;constructor(e){this.config=new Qq(e),this.authManager=new Nq(this.config),this.magicAdapter=new Bq(this.config),this.confirmationScreen=new tz(this.config),this.immutableXClient=e.overrides?.immutableXClient||new VN({baseConfig:e.baseConfig}),this.multiRollupApiClients=new Ft(this.config.multiRollupConfig),this.passportEventEmitter=new iz,this.passportImxProviderFactory=new Jq({authManager:this.authManager,config:this.config,confirmationScreen:this.confirmationScreen,immutableXClient:this.immutableXClient,magicAdapter:this.magicAdapter,passportEventEmitter:this.passportEventEmitter})}async connectImxSilent(){return this.passportImxProviderFactory.getProviderSilent()}async connectImx(){return this.passportImxProviderFactory.getProvider()}async loginWithDeviceFlow(){return this.authManager.loginWithDeviceFlow()}async connectImxDeviceFlow(e,t,n){return this.passportImxProviderFactory.getProviderWithDeviceFlow(e,t,n)}getPKCEAuthorizationUrl(){return this.authManager.getPKCEAuthorizationUrl()}async connectImxPKCEFlow(e,t){return this.passportImxProviderFactory.getProviderWithPKCEFlow(e,t)}checkStoredDeviceFlowCredentials(){return this.authManager.checkStoredDeviceFlowCredentials()}async connectImxWithCredentials(e){return this.passportImxProviderFactory.getProviderWithCredentials(e)}connectEvm(){if(this.config.network===Kq.PRODUCTION)throw new Error("EVM is not supported on production network");return new hz({passportEventEmitter:this.passportEventEmitter,authManager:this.authManager,magicAdapter:this.magicAdapter,config:this.config,confirmationScreen:this.confirmationScreen,multiRollupApiClients:this.multiRollupApiClients})}async loginCallback(){return this.authManager.loginCallback()}async logout(){await this.authManager.logout(),await this.confirmationScreen.logout(),await this.magicAdapter.logout(),this.passportEventEmitter.emit(Vq.LOGGED_OUT)}async logoutSilentCallback(e){return this.authManager.logoutSilentCallback(e)}async logoutDeviceFlow(){return this.authManager.logoutDeviceFlow()}async getUserInfo(){const e=await this.authManager.getUser();return e?.profile}async getUserInfoDeviceFlow(){const e=await this.authManager.getUserDeviceFlow();return e?.profile}async getIdToken(){const e=await this.authManager.getUser();return e?.idToken}async getAccessToken(){const e=await this.authManager.getUser();return e?.accessToken}async getLinkedAddresses(){const e=await this.authManager.getUser();if(!e?.profile.sub)return[];const t={Authorization:`Bearer ${e.accessToken}`};return(await this.multiRollupApiClients.passportApi.getLinkedAddresses({userId:e?.profile.sub},{headers:t})).data.linkedAddresses}},PassportError:Sq,get ProviderErrorCode(){return Uq},get ProviderEvent(){return rz},get RpcErrorCode(){return jq}}),mz=Yt("object"==typeof self?self.FormData:window.FormData),yz={},gz={},vz=Qt(mq),wz=Qt(Rb),_z={},Ez=Qt(ks),Tz=Qt(ya),Az=Qt(Ro),Rz=Qt(bd),Sz=Qt(Dr),kz=Qt(gs),Iz=Qt(Vd),Oz=Qt(Il),xz=Qt(Yi),Cz=Qt(hr),Mz=Qt(_d),Pz=Qt(lb),Nz=Qt(Yd),Bz=Qt(vi),Dz=Qt(oa),Fz=Qt(Of),Lz=Qt(po),Uz=Qt(Wf),jz=Qt(wb),qz=Qt(Nl),zz=Qt(Ql);!function(e){var t=Jt&&Jt.__createBinding||(Object.create?function(e,t,n,r){void 0===r&&(r=n),Object.defineProperty(e,r,{enumerable:!0,get:function(){return t[n]}})}:function(e,t,n,r){void 0===r&&(r=n),e[r]=t[n]}),n=Jt&&Jt.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),r=Jt&&Jt.__importStar||function(e){if(e&&e.__esModule)return e;var r={};if(null!=e)for(var i in e)"default"!==i&&Object.prototype.hasOwnProperty.call(e,i)&&t(r,e,i);return n(r,e),r};Object.defineProperty(e,"__esModule",{value:!0}),e.formatBytes32String=e.Utf8ErrorFuncs=e.toUtf8String=e.toUtf8CodePoints=e.toUtf8Bytes=e._toEscapedUtf8String=e.nameprep=e.hexDataSlice=e.hexDataLength=e.hexZeroPad=e.hexValue=e.hexStripZeros=e.hexConcat=e.isHexString=e.hexlify=e.base64=e.base58=e.TransactionDescription=e.LogDescription=e.Interface=e.SigningKey=e.HDNode=e.defaultPath=e.isBytesLike=e.isBytes=e.zeroPad=e.stripZeros=e.concat=e.arrayify=e.shallowCopy=e.resolveProperties=e.getStatic=e.defineReadOnly=e.deepCopy=e.checkProperties=e.poll=e.fetchJson=e._fetchData=e.RLP=e.Logger=e.checkResultErrors=e.FormatTypes=e.ParamType=e.FunctionFragment=e.EventFragment=e.ErrorFragment=e.ConstructorFragment=e.Fragment=e.defaultAbiCoder=e.AbiCoder=void 0,e.Indexed=e.Utf8ErrorReason=e.UnicodeNormalizationForm=e.SupportedAlgorithm=e.mnemonicToSeed=e.isValidMnemonic=e.entropyToMnemonic=e.mnemonicToEntropy=e.getAccountPath=e.verifyTypedData=e.verifyMessage=e.recoverPublicKey=e.computePublicKey=e.recoverAddress=e.computeAddress=e.getJsonWalletAddress=e.TransactionTypes=e.serializeTransaction=e.parseTransaction=e.accessListify=e.joinSignature=e.splitSignature=e.soliditySha256=e.solidityKeccak256=e.solidityPack=e.shuffled=e.randomBytes=e.sha512=e.sha256=e.ripemd160=e.keccak256=e.computeHmac=e.commify=e.parseUnits=e.formatUnits=e.parseEther=e.formatEther=e.isAddress=e.getCreate2Address=e.getContractAddress=e.getIcapAddress=e.getAddress=e._TypedDataEncoder=e.id=e.isValidName=e.namehash=e.hashMessage=e.dnsEncode=e.parseBytes32String=void 0;var i=Ez;Object.defineProperty(e,"AbiCoder",{enumerable:!0,get:function(){return i.AbiCoder}}),Object.defineProperty(e,"checkResultErrors",{enumerable:!0,get:function(){return i.checkResultErrors}}),Object.defineProperty(e,"ConstructorFragment",{enumerable:!0,get:function(){return i.ConstructorFragment}}),Object.defineProperty(e,"defaultAbiCoder",{enumerable:!0,get:function(){return i.defaultAbiCoder}}),Object.defineProperty(e,"ErrorFragment",{enumerable:!0,get:function(){return i.ErrorFragment}}),Object.defineProperty(e,"EventFragment",{enumerable:!0,get:function(){return i.EventFragment}}),Object.defineProperty(e,"FormatTypes",{enumerable:!0,get:function(){return i.FormatTypes}}),Object.defineProperty(e,"Fragment",{enumerable:!0,get:function(){return i.Fragment}}),Object.defineProperty(e,"FunctionFragment",{enumerable:!0,get:function(){return i.FunctionFragment}}),Object.defineProperty(e,"Indexed",{enumerable:!0,get:function(){return i.Indexed}}),Object.defineProperty(e,"Interface",{enumerable:!0,get:function(){return i.Interface}}),Object.defineProperty(e,"LogDescription",{enumerable:!0,get:function(){return i.LogDescription}}),Object.defineProperty(e,"ParamType",{enumerable:!0,get:function(){return i.ParamType}}),Object.defineProperty(e,"TransactionDescription",{enumerable:!0,get:function(){return i.TransactionDescription}});var a=Tz;Object.defineProperty(e,"getAddress",{enumerable:!0,get:function(){return a.getAddress}}),Object.defineProperty(e,"getCreate2Address",{enumerable:!0,get:function(){return a.getCreate2Address}}),Object.defineProperty(e,"getContractAddress",{enumerable:!0,get:function(){return a.getContractAddress}}),Object.defineProperty(e,"getIcapAddress",{enumerable:!0,get:function(){return a.getIcapAddress}}),Object.defineProperty(e,"isAddress",{enumerable:!0,get:function(){return a.isAddress}});var o=r(Az);e.base64=o;var s=Rz;Object.defineProperty(e,"base58",{enumerable:!0,get:function(){return s.Base58}});var c=Sz;Object.defineProperty(e,"arrayify",{enumerable:!0,get:function(){return c.arrayify}}),Object.defineProperty(e,"concat",{enumerable:!0,get:function(){return c.concat}}),Object.defineProperty(e,"hexConcat",{enumerable:!0,get:function(){return c.hexConcat}}),Object.defineProperty(e,"hexDataSlice",{enumerable:!0,get:function(){return c.hexDataSlice}}),Object.defineProperty(e,"hexDataLength",{enumerable:!0,get:function(){return c.hexDataLength}}),Object.defineProperty(e,"hexlify",{enumerable:!0,get:function(){return c.hexlify}}),Object.defineProperty(e,"hexStripZeros",{enumerable:!0,get:function(){return c.hexStripZeros}}),Object.defineProperty(e,"hexValue",{enumerable:!0,get:function(){return c.hexValue}}),Object.defineProperty(e,"hexZeroPad",{enumerable:!0,get:function(){return c.hexZeroPad}}),Object.defineProperty(e,"isBytes",{enumerable:!0,get:function(){return c.isBytes}}),Object.defineProperty(e,"isBytesLike",{enumerable:!0,get:function(){return c.isBytesLike}}),Object.defineProperty(e,"isHexString",{enumerable:!0,get:function(){return c.isHexString}}),Object.defineProperty(e,"joinSignature",{enumerable:!0,get:function(){return c.joinSignature}}),Object.defineProperty(e,"zeroPad",{enumerable:!0,get:function(){return c.zeroPad}}),Object.defineProperty(e,"splitSignature",{enumerable:!0,get:function(){return c.splitSignature}}),Object.defineProperty(e,"stripZeros",{enumerable:!0,get:function(){return c.stripZeros}});var u=kz;Object.defineProperty(e,"_TypedDataEncoder",{enumerable:!0,get:function(){return u._TypedDataEncoder}}),Object.defineProperty(e,"dnsEncode",{enumerable:!0,get:function(){return u.dnsEncode}}),Object.defineProperty(e,"hashMessage",{enumerable:!0,get:function(){return u.hashMessage}}),Object.defineProperty(e,"id",{enumerable:!0,get:function(){return u.id}}),Object.defineProperty(e,"isValidName",{enumerable:!0,get:function(){return u.isValidName}}),Object.defineProperty(e,"namehash",{enumerable:!0,get:function(){return u.namehash}});var f=Iz;Object.defineProperty(e,"defaultPath",{enumerable:!0,get:function(){return f.defaultPath}}),Object.defineProperty(e,"entropyToMnemonic",{enumerable:!0,get:function(){return f.entropyToMnemonic}}),Object.defineProperty(e,"getAccountPath",{enumerable:!0,get:function(){return f.getAccountPath}}),Object.defineProperty(e,"HDNode",{enumerable:!0,get:function(){return f.HDNode}}),Object.defineProperty(e,"isValidMnemonic",{enumerable:!0,get:function(){return f.isValidMnemonic}}),Object.defineProperty(e,"mnemonicToEntropy",{enumerable:!0,get:function(){return f.mnemonicToEntropy}}),Object.defineProperty(e,"mnemonicToSeed",{enumerable:!0,get:function(){return f.mnemonicToSeed}});var d=Oz;Object.defineProperty(e,"getJsonWalletAddress",{enumerable:!0,get:function(){return d.getJsonWalletAddress}});var l=xz;Object.defineProperty(e,"keccak256",{enumerable:!0,get:function(){return l.keccak256}});var p=Cz;Object.defineProperty(e,"Logger",{enumerable:!0,get:function(){return p.Logger}});var h=Mz;Object.defineProperty(e,"computeHmac",{enumerable:!0,get:function(){return h.computeHmac}}),Object.defineProperty(e,"ripemd160",{enumerable:!0,get:function(){return h.ripemd160}}),Object.defineProperty(e,"sha256",{enumerable:!0,get:function(){return h.sha256}}),Object.defineProperty(e,"sha512",{enumerable:!0,get:function(){return h.sha512}});var b=Pz;Object.defineProperty(e,"solidityKeccak256",{enumerable:!0,get:function(){return b.keccak256}}),Object.defineProperty(e,"solidityPack",{enumerable:!0,get:function(){return b.pack}}),Object.defineProperty(e,"soliditySha256",{enumerable:!0,get:function(){return b.sha256}});var m=Nz;Object.defineProperty(e,"randomBytes",{enumerable:!0,get:function(){return m.randomBytes}}),Object.defineProperty(e,"shuffled",{enumerable:!0,get:function(){return m.shuffled}});var y=Bz;Object.defineProperty(e,"checkProperties",{enumerable:!0,get:function(){return y.checkProperties}}),Object.defineProperty(e,"deepCopy",{enumerable:!0,get:function(){return y.deepCopy}}),Object.defineProperty(e,"defineReadOnly",{enumerable:!0,get:function(){return y.defineReadOnly}}),Object.defineProperty(e,"getStatic",{enumerable:!0,get:function(){return y.getStatic}}),Object.defineProperty(e,"resolveProperties",{enumerable:!0,get:function(){return y.resolveProperties}}),Object.defineProperty(e,"shallowCopy",{enumerable:!0,get:function(){return y.shallowCopy}});var g=r(Dz);e.RLP=g;var v=Fz;Object.defineProperty(e,"computePublicKey",{enumerable:!0,get:function(){return v.computePublicKey}}),Object.defineProperty(e,"recoverPublicKey",{enumerable:!0,get:function(){return v.recoverPublicKey}}),Object.defineProperty(e,"SigningKey",{enumerable:!0,get:function(){return v.SigningKey}});var w=Lz;Object.defineProperty(e,"formatBytes32String",{enumerable:!0,get:function(){return w.formatBytes32String}}),Object.defineProperty(e,"nameprep",{enumerable:!0,get:function(){return w.nameprep}}),Object.defineProperty(e,"parseBytes32String",{enumerable:!0,get:function(){return w.parseBytes32String}}),Object.defineProperty(e,"_toEscapedUtf8String",{enumerable:!0,get:function(){return w._toEscapedUtf8String}}),Object.defineProperty(e,"toUtf8Bytes",{enumerable:!0,get:function(){return w.toUtf8Bytes}}),Object.defineProperty(e,"toUtf8CodePoints",{enumerable:!0,get:function(){return w.toUtf8CodePoints}}),Object.defineProperty(e,"toUtf8String",{enumerable:!0,get:function(){return w.toUtf8String}}),Object.defineProperty(e,"Utf8ErrorFuncs",{enumerable:!0,get:function(){return w.Utf8ErrorFuncs}});var _=Uz;Object.defineProperty(e,"accessListify",{enumerable:!0,get:function(){return _.accessListify}}),Object.defineProperty(e,"computeAddress",{enumerable:!0,get:function(){return _.computeAddress}}),Object.defineProperty(e,"parseTransaction",{enumerable:!0,get:function(){return _.parse}}),Object.defineProperty(e,"recoverAddress",{enumerable:!0,get:function(){return _.recoverAddress}}),Object.defineProperty(e,"serializeTransaction",{enumerable:!0,get:function(){return _.serialize}}),Object.defineProperty(e,"TransactionTypes",{enumerable:!0,get:function(){return _.TransactionTypes}});var E=jz;Object.defineProperty(e,"commify",{enumerable:!0,get:function(){return E.commify}}),Object.defineProperty(e,"formatEther",{enumerable:!0,get:function(){return E.formatEther}}),Object.defineProperty(e,"parseEther",{enumerable:!0,get:function(){return E.parseEther}}),Object.defineProperty(e,"formatUnits",{enumerable:!0,get:function(){return E.formatUnits}}),Object.defineProperty(e,"parseUnits",{enumerable:!0,get:function(){return E.parseUnits}});var T=qz;Object.defineProperty(e,"verifyMessage",{enumerable:!0,get:function(){return T.verifyMessage}}),Object.defineProperty(e,"verifyTypedData",{enumerable:!0,get:function(){return T.verifyTypedData}});var A=zz;Object.defineProperty(e,"_fetchData",{enumerable:!0,get:function(){return A._fetchData}}),Object.defineProperty(e,"fetchJson",{enumerable:!0,get:function(){return A.fetchJson}}),Object.defineProperty(e,"poll",{enumerable:!0,get:function(){return A.poll}});var R=Mz;Object.defineProperty(e,"SupportedAlgorithm",{enumerable:!0,get:function(){return R.SupportedAlgorithm}});var S=Lz;Object.defineProperty(e,"UnicodeNormalizationForm",{enumerable:!0,get:function(){return S.UnicodeNormalizationForm}}),Object.defineProperty(e,"Utf8ErrorReason",{enumerable:!0,get:function(){return S.Utf8ErrorReason}})}(_z);var Hz={};Object.defineProperty(Hz,"__esModule",{value:!0}),Hz.DomainRegistryABI=void 0;Hz.DomainRegistryABI=[{inputs:[{internalType:"string",name:"domain",type:"string"}],name:"DomainAlreadyRegistered",type:"error"},{inputs:[{internalType:"bytes4",name:"tag",type:"bytes4"},{internalType:"uint256",name:"maxIndex",type:"uint256"},{internalType:"uint256",name:"suppliedIndex",type:"uint256"}],name:"DomainIndexOutOfRange",type:"error"},{anonymous:!1,inputs:[{indexed:!1,internalType:"string",name:"domain",type:"string"},{indexed:!1,internalType:"bytes4",name:"tag",type:"bytes4"},{indexed:!1,internalType:"uint256",name:"index",type:"uint256"}],name:"DomainRegistered",type:"event"},{inputs:[{internalType:"bytes4",name:"tag",type:"bytes4"},{internalType:"uint256",name:"index",type:"uint256"}],name:"getDomain",outputs:[{internalType:"string",name:"domain",type:"string"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes4",name:"tag",type:"bytes4"}],name:"getDomains",outputs:[{internalType:"string[]",name:"domains",type:"string[]"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes4",name:"tag",type:"bytes4"}],name:"getNumberOfDomains",outputs:[{internalType:"uint256",name:"totalDomains",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"string",name:"domain",type:"string"}],name:"setDomain",outputs:[{internalType:"bytes4",name:"tag",type:"bytes4"}],stateMutability:"nonpayable",type:"function"}];var Gz={};Object.defineProperty(Gz,"__esModule",{value:!0}),Gz.SeaportABIv14=void 0;Gz.SeaportABIv14=[{inputs:[{internalType:"address",name:"conduitController",type:"address"}],stateMutability:"nonpayable",type:"constructor"},{inputs:[],name:"BadContractSignature",type:"error"},{inputs:[],name:"BadFraction",type:"error"},{inputs:[{internalType:"address",name:"token",type:"address"},{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"BadReturnValueFromERC20OnTransfer",type:"error"},{inputs:[{internalType:"uint8",name:"v",type:"uint8"}],name:"BadSignatureV",type:"error"},{inputs:[],name:"CannotCancelOrder",type:"error"},{inputs:[],name:"ConsiderationCriteriaResolverOutOfRange",type:"error"},{inputs:[],name:"ConsiderationLengthNotEqualToTotalOriginal",type:"error"},{inputs:[{internalType:"uint256",name:"orderIndex",type:"uint256"},{internalType:"uint256",name:"considerationIndex",type:"uint256"},{internalType:"uint256",name:"shortfallAmount",type:"uint256"}],name:"ConsiderationNotMet",type:"error"},{inputs:[],name:"CriteriaNotEnabledForItem",type:"error"},{inputs:[{internalType:"address",name:"token",type:"address"},{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256[]",name:"identifiers",type:"uint256[]"},{internalType:"uint256[]",name:"amounts",type:"uint256[]"}],name:"ERC1155BatchTransferGenericFailure",type:"error"},{inputs:[{internalType:"address",name:"account",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"EtherTransferGenericFailure",type:"error"},{inputs:[],name:"InexactFraction",type:"error"},{inputs:[],name:"InsufficientEtherSupplied",type:"error"},{inputs:[],name:"Invalid1155BatchTransferEncoding",type:"error"},{inputs:[],name:"InvalidBasicOrderParameterEncoding",type:"error"},{inputs:[{internalType:"address",name:"conduit",type:"address"}],name:"InvalidCallToConduit",type:"error"},{inputs:[{internalType:"bytes32",name:"conduitKey",type:"bytes32"},{internalType:"address",name:"conduit",type:"address"}],name:"InvalidConduit",type:"error"},{inputs:[{internalType:"bytes32",name:"orderHash",type:"bytes32"}],name:"InvalidContractOrder",type:"error"},{inputs:[{internalType:"uint256",name:"amount",type:"uint256"}],name:"InvalidERC721TransferAmount",type:"error"},{inputs:[],name:"InvalidFulfillmentComponentData",type:"error"},{inputs:[{internalType:"uint256",name:"value",type:"uint256"}],name:"InvalidMsgValue",type:"error"},{inputs:[],name:"InvalidNativeOfferItem",type:"error"},{inputs:[],name:"InvalidProof",type:"error"},{inputs:[{internalType:"bytes32",name:"orderHash",type:"bytes32"}],name:"InvalidRestrictedOrder",type:"error"},{inputs:[],name:"InvalidSignature",type:"error"},{inputs:[],name:"InvalidSigner",type:"error"},{inputs:[{internalType:"uint256",name:"startTime",type:"uint256"},{internalType:"uint256",name:"endTime",type:"uint256"}],name:"InvalidTime",type:"error"},{inputs:[{internalType:"uint256",name:"fulfillmentIndex",type:"uint256"}],name:"MismatchedFulfillmentOfferAndConsiderationComponents",type:"error"},{inputs:[{internalType:"enum Side",name:"side",type:"uint8"}],name:"MissingFulfillmentComponentOnAggregation",type:"error"},{inputs:[],name:"MissingItemAmount",type:"error"},{inputs:[],name:"MissingOriginalConsiderationItems",type:"error"},{inputs:[{internalType:"address",name:"account",type:"address"}],name:"NoContract",type:"error"},{inputs:[],name:"NoReentrantCalls",type:"error"},{inputs:[],name:"NoSpecifiedOrdersAvailable",type:"error"},{inputs:[],name:"OfferAndConsiderationRequiredOnFulfillment",type:"error"},{inputs:[],name:"OfferCriteriaResolverOutOfRange",type:"error"},{inputs:[{internalType:"bytes32",name:"orderHash",type:"bytes32"}],name:"OrderAlreadyFilled",type:"error"},{inputs:[{internalType:"enum Side",name:"side",type:"uint8"}],name:"OrderCriteriaResolverOutOfRange",type:"error"},{inputs:[{internalType:"bytes32",name:"orderHash",type:"bytes32"}],name:"OrderIsCancelled",type:"error"},{inputs:[{internalType:"bytes32",name:"orderHash",type:"bytes32"}],name:"OrderPartiallyFilled",type:"error"},{inputs:[],name:"PartialFillsNotEnabledForOrder",type:"error"},{inputs:[{internalType:"address",name:"token",type:"address"},{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"identifier",type:"uint256"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"TokenTransferGenericFailure",type:"error"},{inputs:[{internalType:"uint256",name:"orderIndex",type:"uint256"},{internalType:"uint256",name:"considerationIndex",type:"uint256"}],name:"UnresolvedConsiderationCriteria",type:"error"},{inputs:[{internalType:"uint256",name:"orderIndex",type:"uint256"},{internalType:"uint256",name:"offerIndex",type:"uint256"}],name:"UnresolvedOfferCriteria",type:"error"},{inputs:[],name:"UnusedItemParameters",type:"error"},{anonymous:!1,inputs:[{indexed:!1,internalType:"uint256",name:"newCounter",type:"uint256"},{indexed:!0,internalType:"address",name:"offerer",type:"address"}],name:"CounterIncremented",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"bytes32",name:"orderHash",type:"bytes32"},{indexed:!0,internalType:"address",name:"offerer",type:"address"},{indexed:!0,internalType:"address",name:"zone",type:"address"}],name:"OrderCancelled",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"bytes32",name:"orderHash",type:"bytes32"},{indexed:!0,internalType:"address",name:"offerer",type:"address"},{indexed:!0,internalType:"address",name:"zone",type:"address"},{indexed:!1,internalType:"address",name:"recipient",type:"address"},{components:[{internalType:"enum ItemType",name:"itemType",type:"uint8"},{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"identifier",type:"uint256"},{internalType:"uint256",name:"amount",type:"uint256"}],indexed:!1,internalType:"struct SpentItem[]",name:"offer",type:"tuple[]"},{components:[{internalType:"enum ItemType",name:"itemType",type:"uint8"},{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"identifier",type:"uint256"},{internalType:"uint256",name:"amount",type:"uint256"},{internalType:"address payable",name:"recipient",type:"address"}],indexed:!1,internalType:"struct ReceivedItem[]",name:"consideration",type:"tuple[]"}],name:"OrderFulfilled",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"bytes32",name:"orderHash",type:"bytes32"},{components:[{internalType:"address",name:"offerer",type:"address"},{internalType:"address",name:"zone",type:"address"},{components:[{internalType:"enum ItemType",name:"itemType",type:"uint8"},{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"identifierOrCriteria",type:"uint256"},{internalType:"uint256",name:"startAmount",type:"uint256"},{internalType:"uint256",name:"endAmount",type:"uint256"}],internalType:"struct OfferItem[]",name:"offer",type:"tuple[]"},{components:[{internalType:"enum ItemType",name:"itemType",type:"uint8"},{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"identifierOrCriteria",type:"uint256"},{internalType:"uint256",name:"startAmount",type:"uint256"},{internalType:"uint256",name:"endAmount",type:"uint256"},{internalType:"address payable",name:"recipient",type:"address"}],internalType:"struct ConsiderationItem[]",name:"consideration",type:"tuple[]"},{internalType:"enum OrderType",name:"orderType",type:"uint8"},{internalType:"uint256",name:"startTime",type:"uint256"},{internalType:"uint256",name:"endTime",type:"uint256"},{internalType:"bytes32",name:"zoneHash",type:"bytes32"},{internalType:"uint256",name:"salt",type:"uint256"},{internalType:"bytes32",name:"conduitKey",type:"bytes32"},{internalType:"uint256",name:"totalOriginalConsiderationItems",type:"uint256"}],indexed:!1,internalType:"struct OrderParameters",name:"orderParameters",type:"tuple"}],name:"OrderValidated",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"bytes32[]",name:"orderHashes",type:"bytes32[]"}],name:"OrdersMatched",type:"event"},{inputs:[{components:[{internalType:"address",name:"offerer",type:"address"},{internalType:"address",name:"zone",type:"address"},{components:[{internalType:"enum ItemType",name:"itemType",type:"uint8"},{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"identifierOrCriteria",type:"uint256"},{internalType:"uint256",name:"startAmount",type:"uint256"},{internalType:"uint256",name:"endAmount",type:"uint256"}],internalType:"struct OfferItem[]",name:"offer",type:"tuple[]"},{components:[{internalType:"enum ItemType",name:"itemType",type:"uint8"},{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"identifierOrCriteria",type:"uint256"},{internalType:"uint256",name:"startAmount",type:"uint256"},{internalType:"uint256",name:"endAmount",type:"uint256"},{internalType:"address payable",name:"recipient",type:"address"}],internalType:"struct ConsiderationItem[]",name:"consideration",type:"tuple[]"},{internalType:"enum OrderType",name:"orderType",type:"uint8"},{internalType:"uint256",name:"startTime",type:"uint256"},{internalType:"uint256",name:"endTime",type:"uint256"},{internalType:"bytes32",name:"zoneHash",type:"bytes32"},{internalType:"uint256",name:"salt",type:"uint256"},{internalType:"bytes32",name:"conduitKey",type:"bytes32"},{internalType:"uint256",name:"counter",type:"uint256"}],internalType:"struct OrderComponents[]",name:"orders",type:"tuple[]"}],name:"cancel",outputs:[{internalType:"bool",name:"cancelled",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{components:[{components:[{internalType:"address",name:"offerer",type:"address"},{internalType:"address",name:"zone",type:"address"},{components:[{internalType:"enum ItemType",name:"itemType",type:"uint8"},{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"identifierOrCriteria",type:"uint256"},{internalType:"uint256",name:"startAmount",type:"uint256"},{internalType:"uint256",name:"endAmount",type:"uint256"}],internalType:"struct OfferItem[]",name:"offer",type:"tuple[]"},{components:[{internalType:"enum ItemType",name:"itemType",type:"uint8"},{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"identifierOrCriteria",type:"uint256"},{internalType:"uint256",name:"startAmount",type:"uint256"},{internalType:"uint256",name:"endAmount",type:"uint256"},{internalType:"address payable",name:"recipient",type:"address"}],internalType:"struct ConsiderationItem[]",name:"consideration",type:"tuple[]"},{internalType:"enum OrderType",name:"orderType",type:"uint8"},{internalType:"uint256",name:"startTime",type:"uint256"},{internalType:"uint256",name:"endTime",type:"uint256"},{internalType:"bytes32",name:"zoneHash",type:"bytes32"},{internalType:"uint256",name:"salt",type:"uint256"},{internalType:"bytes32",name:"conduitKey",type:"bytes32"},{internalType:"uint256",name:"totalOriginalConsiderationItems",type:"uint256"}],internalType:"struct OrderParameters",name:"parameters",type:"tuple"},{internalType:"uint120",name:"numerator",type:"uint120"},{internalType:"uint120",name:"denominator",type:"uint120"},{internalType:"bytes",name:"signature",type:"bytes"},{internalType:"bytes",name:"extraData",type:"bytes"}],internalType:"struct AdvancedOrder",name:"advancedOrder",type:"tuple"},{components:[{internalType:"uint256",name:"orderIndex",type:"uint256"},{internalType:"enum Side",name:"side",type:"uint8"},{internalType:"uint256",name:"index",type:"uint256"},{internalType:"uint256",name:"identifier",type:"uint256"},{internalType:"bytes32[]",name:"criteriaProof",type:"bytes32[]"}],internalType:"struct CriteriaResolver[]",name:"criteriaResolvers",type:"tuple[]"},{internalType:"bytes32",name:"fulfillerConduitKey",type:"bytes32"},{internalType:"address",name:"recipient",type:"address"}],name:"fulfillAdvancedOrder",outputs:[{internalType:"bool",name:"fulfilled",type:"bool"}],stateMutability:"payable",type:"function"},{inputs:[{components:[{components:[{internalType:"address",name:"offerer",type:"address"},{internalType:"address",name:"zone",type:"address"},{components:[{internalType:"enum ItemType",name:"itemType",type:"uint8"},{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"identifierOrCriteria",type:"uint256"},{internalType:"uint256",name:"startAmount",type:"uint256"},{internalType:"uint256",name:"endAmount",type:"uint256"}],internalType:"struct OfferItem[]",name:"offer",type:"tuple[]"},{components:[{internalType:"enum ItemType",name:"itemType",type:"uint8"},{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"identifierOrCriteria",type:"uint256"},{internalType:"uint256",name:"startAmount",type:"uint256"},{internalType:"uint256",name:"endAmount",type:"uint256"},{internalType:"address payable",name:"recipient",type:"address"}],internalType:"struct ConsiderationItem[]",name:"consideration",type:"tuple[]"},{internalType:"enum OrderType",name:"orderType",type:"uint8"},{internalType:"uint256",name:"startTime",type:"uint256"},{internalType:"uint256",name:"endTime",type:"uint256"},{internalType:"bytes32",name:"zoneHash",type:"bytes32"},{internalType:"uint256",name:"salt",type:"uint256"},{internalType:"bytes32",name:"conduitKey",type:"bytes32"},{internalType:"uint256",name:"totalOriginalConsiderationItems",type:"uint256"}],internalType:"struct OrderParameters",name:"parameters",type:"tuple"},{internalType:"uint120",name:"numerator",type:"uint120"},{internalType:"uint120",name:"denominator",type:"uint120"},{internalType:"bytes",name:"signature",type:"bytes"},{internalType:"bytes",name:"extraData",type:"bytes"}],internalType:"struct AdvancedOrder[]",name:"advancedOrders",type:"tuple[]"},{components:[{internalType:"uint256",name:"orderIndex",type:"uint256"},{internalType:"enum Side",name:"side",type:"uint8"},{internalType:"uint256",name:"index",type:"uint256"},{internalType:"uint256",name:"identifier",type:"uint256"},{internalType:"bytes32[]",name:"criteriaProof",type:"bytes32[]"}],internalType:"struct CriteriaResolver[]",name:"criteriaResolvers",type:"tuple[]"},{components:[{internalType:"uint256",name:"orderIndex",type:"uint256"},{internalType:"uint256",name:"itemIndex",type:"uint256"}],internalType:"struct FulfillmentComponent[][]",name:"offerFulfillments",type:"tuple[][]"},{components:[{internalType:"uint256",name:"orderIndex",type:"uint256"},{internalType:"uint256",name:"itemIndex",type:"uint256"}],internalType:"struct FulfillmentComponent[][]",name:"considerationFulfillments",type:"tuple[][]"},{internalType:"bytes32",name:"fulfillerConduitKey",type:"bytes32"},{internalType:"address",name:"recipient",type:"address"},{internalType:"uint256",name:"maximumFulfilled",type:"uint256"}],name:"fulfillAvailableAdvancedOrders",outputs:[{internalType:"bool[]",name:"availableOrders",type:"bool[]"},{components:[{components:[{internalType:"enum ItemType",name:"itemType",type:"uint8"},{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"identifier",type:"uint256"},{internalType:"uint256",name:"amount",type:"uint256"},{internalType:"address payable",name:"recipient",type:"address"}],internalType:"struct ReceivedItem",name:"item",type:"tuple"},{internalType:"address",name:"offerer",type:"address"},{internalType:"bytes32",name:"conduitKey",type:"bytes32"}],internalType:"struct Execution[]",name:"executions",type:"tuple[]"}],stateMutability:"payable",type:"function"},{inputs:[{components:[{components:[{internalType:"address",name:"offerer",type:"address"},{internalType:"address",name:"zone",type:"address"},{components:[{internalType:"enum ItemType",name:"itemType",type:"uint8"},{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"identifierOrCriteria",type:"uint256"},{internalType:"uint256",name:"startAmount",type:"uint256"},{internalType:"uint256",name:"endAmount",type:"uint256"}],internalType:"struct OfferItem[]",name:"offer",type:"tuple[]"},{components:[{internalType:"enum ItemType",name:"itemType",type:"uint8"},{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"identifierOrCriteria",type:"uint256"},{internalType:"uint256",name:"startAmount",type:"uint256"},{internalType:"uint256",name:"endAmount",type:"uint256"},{internalType:"address payable",name:"recipient",type:"address"}],internalType:"struct ConsiderationItem[]",name:"consideration",type:"tuple[]"},{internalType:"enum OrderType",name:"orderType",type:"uint8"},{internalType:"uint256",name:"startTime",type:"uint256"},{internalType:"uint256",name:"endTime",type:"uint256"},{internalType:"bytes32",name:"zoneHash",type:"bytes32"},{internalType:"uint256",name:"salt",type:"uint256"},{internalType:"bytes32",name:"conduitKey",type:"bytes32"},{internalType:"uint256",name:"totalOriginalConsiderationItems",type:"uint256"}],internalType:"struct OrderParameters",name:"parameters",type:"tuple"},{internalType:"bytes",name:"signature",type:"bytes"}],internalType:"struct Order[]",name:"orders",type:"tuple[]"},{components:[{internalType:"uint256",name:"orderIndex",type:"uint256"},{internalType:"uint256",name:"itemIndex",type:"uint256"}],internalType:"struct FulfillmentComponent[][]",name:"offerFulfillments",type:"tuple[][]"},{components:[{internalType:"uint256",name:"orderIndex",type:"uint256"},{internalType:"uint256",name:"itemIndex",type:"uint256"}],internalType:"struct FulfillmentComponent[][]",name:"considerationFulfillments",type:"tuple[][]"},{internalType:"bytes32",name:"fulfillerConduitKey",type:"bytes32"},{internalType:"uint256",name:"maximumFulfilled",type:"uint256"}],name:"fulfillAvailableOrders",outputs:[{internalType:"bool[]",name:"availableOrders",type:"bool[]"},{components:[{components:[{internalType:"enum ItemType",name:"itemType",type:"uint8"},{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"identifier",type:"uint256"},{internalType:"uint256",name:"amount",type:"uint256"},{internalType:"address payable",name:"recipient",type:"address"}],internalType:"struct ReceivedItem",name:"item",type:"tuple"},{internalType:"address",name:"offerer",type:"address"},{internalType:"bytes32",name:"conduitKey",type:"bytes32"}],internalType:"struct Execution[]",name:"executions",type:"tuple[]"}],stateMutability:"payable",type:"function"},{inputs:[{components:[{internalType:"address",name:"considerationToken",type:"address"},{internalType:"uint256",name:"considerationIdentifier",type:"uint256"},{internalType:"uint256",name:"considerationAmount",type:"uint256"},{internalType:"address payable",name:"offerer",type:"address"},{internalType:"address",name:"zone",type:"address"},{internalType:"address",name:"offerToken",type:"address"},{internalType:"uint256",name:"offerIdentifier",type:"uint256"},{internalType:"uint256",name:"offerAmount",type:"uint256"},{internalType:"enum BasicOrderType",name:"basicOrderType",type:"uint8"},{internalType:"uint256",name:"startTime",type:"uint256"},{internalType:"uint256",name:"endTime",type:"uint256"},{internalType:"bytes32",name:"zoneHash",type:"bytes32"},{internalType:"uint256",name:"salt",type:"uint256"},{internalType:"bytes32",name:"offererConduitKey",type:"bytes32"},{internalType:"bytes32",name:"fulfillerConduitKey",type:"bytes32"},{internalType:"uint256",name:"totalOriginalAdditionalRecipients",type:"uint256"},{components:[{internalType:"uint256",name:"amount",type:"uint256"},{internalType:"address payable",name:"recipient",type:"address"}],internalType:"struct AdditionalRecipient[]",name:"additionalRecipients",type:"tuple[]"},{internalType:"bytes",name:"signature",type:"bytes"}],internalType:"struct BasicOrderParameters",name:"parameters",type:"tuple"}],name:"fulfillBasicOrder",outputs:[{internalType:"bool",name:"fulfilled",type:"bool"}],stateMutability:"payable",type:"function"},{inputs:[{components:[{components:[{internalType:"address",name:"offerer",type:"address"},{internalType:"address",name:"zone",type:"address"},{components:[{internalType:"enum ItemType",name:"itemType",type:"uint8"},{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"identifierOrCriteria",type:"uint256"},{internalType:"uint256",name:"startAmount",type:"uint256"},{internalType:"uint256",name:"endAmount",type:"uint256"}],internalType:"struct OfferItem[]",name:"offer",type:"tuple[]"},{components:[{internalType:"enum ItemType",name:"itemType",type:"uint8"},{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"identifierOrCriteria",type:"uint256"},{internalType:"uint256",name:"startAmount",type:"uint256"},{internalType:"uint256",name:"endAmount",type:"uint256"},{internalType:"address payable",name:"recipient",type:"address"}],internalType:"struct ConsiderationItem[]",name:"consideration",type:"tuple[]"},{internalType:"enum OrderType",name:"orderType",type:"uint8"},{internalType:"uint256",name:"startTime",type:"uint256"},{internalType:"uint256",name:"endTime",type:"uint256"},{internalType:"bytes32",name:"zoneHash",type:"bytes32"},{internalType:"uint256",name:"salt",type:"uint256"},{internalType:"bytes32",name:"conduitKey",type:"bytes32"},{internalType:"uint256",name:"totalOriginalConsiderationItems",type:"uint256"}],internalType:"struct OrderParameters",name:"parameters",type:"tuple"},{internalType:"bytes",name:"signature",type:"bytes"}],internalType:"struct Order",name:"order",type:"tuple"},{internalType:"bytes32",name:"fulfillerConduitKey",type:"bytes32"}],name:"fulfillOrder",outputs:[{internalType:"bool",name:"fulfilled",type:"bool"}],stateMutability:"payable",type:"function"},{inputs:[{internalType:"address",name:"contractOfferer",type:"address"}],name:"getContractOffererNonce",outputs:[{internalType:"uint256",name:"nonce",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"offerer",type:"address"}],name:"getCounter",outputs:[{internalType:"uint256",name:"counter",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{components:[{internalType:"address",name:"offerer",type:"address"},{internalType:"address",name:"zone",type:"address"},{components:[{internalType:"enum ItemType",name:"itemType",type:"uint8"},{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"identifierOrCriteria",type:"uint256"},{internalType:"uint256",name:"startAmount",type:"uint256"},{internalType:"uint256",name:"endAmount",type:"uint256"}],internalType:"struct OfferItem[]",name:"offer",type:"tuple[]"},{components:[{internalType:"enum ItemType",name:"itemType",type:"uint8"},{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"identifierOrCriteria",type:"uint256"},{internalType:"uint256",name:"startAmount",type:"uint256"},{internalType:"uint256",name:"endAmount",type:"uint256"},{internalType:"address payable",name:"recipient",type:"address"}],internalType:"struct ConsiderationItem[]",name:"consideration",type:"tuple[]"},{internalType:"enum OrderType",name:"orderType",type:"uint8"},{internalType:"uint256",name:"startTime",type:"uint256"},{internalType:"uint256",name:"endTime",type:"uint256"},{internalType:"bytes32",name:"zoneHash",type:"bytes32"},{internalType:"uint256",name:"salt",type:"uint256"},{internalType:"bytes32",name:"conduitKey",type:"bytes32"},{internalType:"uint256",name:"counter",type:"uint256"}],internalType:"struct OrderComponents",name:"order",type:"tuple"}],name:"getOrderHash",outputs:[{internalType:"bytes32",name:"orderHash",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"orderHash",type:"bytes32"}],name:"getOrderStatus",outputs:[{internalType:"bool",name:"isValidated",type:"bool"},{internalType:"bool",name:"isCancelled",type:"bool"},{internalType:"uint256",name:"totalFilled",type:"uint256"},{internalType:"uint256",name:"totalSize",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"incrementCounter",outputs:[{internalType:"uint256",name:"newCounter",type:"uint256"}],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"information",outputs:[{internalType:"string",name:"version",type:"string"},{internalType:"bytes32",name:"domainSeparator",type:"bytes32"},{internalType:"address",name:"conduitController",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{components:[{components:[{internalType:"address",name:"offerer",type:"address"},{internalType:"address",name:"zone",type:"address"},{components:[{internalType:"enum ItemType",name:"itemType",type:"uint8"},{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"identifierOrCriteria",type:"uint256"},{internalType:"uint256",name:"startAmount",type:"uint256"},{internalType:"uint256",name:"endAmount",type:"uint256"}],internalType:"struct OfferItem[]",name:"offer",type:"tuple[]"},{components:[{internalType:"enum ItemType",name:"itemType",type:"uint8"},{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"identifierOrCriteria",type:"uint256"},{internalType:"uint256",name:"startAmount",type:"uint256"},{internalType:"uint256",name:"endAmount",type:"uint256"},{internalType:"address payable",name:"recipient",type:"address"}],internalType:"struct ConsiderationItem[]",name:"consideration",type:"tuple[]"},{internalType:"enum OrderType",name:"orderType",type:"uint8"},{internalType:"uint256",name:"startTime",type:"uint256"},{internalType:"uint256",name:"endTime",type:"uint256"},{internalType:"bytes32",name:"zoneHash",type:"bytes32"},{internalType:"uint256",name:"salt",type:"uint256"},{internalType:"bytes32",name:"conduitKey",type:"bytes32"},{internalType:"uint256",name:"totalOriginalConsiderationItems",type:"uint256"}],internalType:"struct OrderParameters",name:"parameters",type:"tuple"},{internalType:"uint120",name:"numerator",type:"uint120"},{internalType:"uint120",name:"denominator",type:"uint120"},{internalType:"bytes",name:"signature",type:"bytes"},{internalType:"bytes",name:"extraData",type:"bytes"}],internalType:"struct AdvancedOrder[]",name:"orders",type:"tuple[]"},{components:[{internalType:"uint256",name:"orderIndex",type:"uint256"},{internalType:"enum Side",name:"side",type:"uint8"},{internalType:"uint256",name:"index",type:"uint256"},{internalType:"uint256",name:"identifier",type:"uint256"},{internalType:"bytes32[]",name:"criteriaProof",type:"bytes32[]"}],internalType:"struct CriteriaResolver[]",name:"criteriaResolvers",type:"tuple[]"},{components:[{components:[{internalType:"uint256",name:"orderIndex",type:"uint256"},{internalType:"uint256",name:"itemIndex",type:"uint256"}],internalType:"struct FulfillmentComponent[]",name:"offerComponents",type:"tuple[]"},{components:[{internalType:"uint256",name:"orderIndex",type:"uint256"},{internalType:"uint256",name:"itemIndex",type:"uint256"}],internalType:"struct FulfillmentComponent[]",name:"considerationComponents",type:"tuple[]"}],internalType:"struct Fulfillment[]",name:"fulfillments",type:"tuple[]"},{internalType:"address",name:"recipient",type:"address"}],name:"matchAdvancedOrders",outputs:[{components:[{components:[{internalType:"enum ItemType",name:"itemType",type:"uint8"},{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"identifier",type:"uint256"},{internalType:"uint256",name:"amount",type:"uint256"},{internalType:"address payable",name:"recipient",type:"address"}],internalType:"struct ReceivedItem",name:"item",type:"tuple"},{internalType:"address",name:"offerer",type:"address"},{internalType:"bytes32",name:"conduitKey",type:"bytes32"}],internalType:"struct Execution[]",name:"executions",type:"tuple[]"}],stateMutability:"payable",type:"function"},{inputs:[{components:[{components:[{internalType:"address",name:"offerer",type:"address"},{internalType:"address",name:"zone",type:"address"},{components:[{internalType:"enum ItemType",name:"itemType",type:"uint8"},{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"identifierOrCriteria",type:"uint256"},{internalType:"uint256",name:"startAmount",type:"uint256"},{internalType:"uint256",name:"endAmount",type:"uint256"}],internalType:"struct OfferItem[]",name:"offer",type:"tuple[]"},{components:[{internalType:"enum ItemType",name:"itemType",type:"uint8"},{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"identifierOrCriteria",type:"uint256"},{internalType:"uint256",name:"startAmount",type:"uint256"},{internalType:"uint256",name:"endAmount",type:"uint256"},{internalType:"address payable",name:"recipient",type:"address"}],internalType:"struct ConsiderationItem[]",name:"consideration",type:"tuple[]"},{internalType:"enum OrderType",name:"orderType",type:"uint8"},{internalType:"uint256",name:"startTime",type:"uint256"},{internalType:"uint256",name:"endTime",type:"uint256"},{internalType:"bytes32",name:"zoneHash",type:"bytes32"},{internalType:"uint256",name:"salt",type:"uint256"},{internalType:"bytes32",name:"conduitKey",type:"bytes32"},{internalType:"uint256",name:"totalOriginalConsiderationItems",type:"uint256"}],internalType:"struct OrderParameters",name:"parameters",type:"tuple"},{internalType:"bytes",name:"signature",type:"bytes"}],internalType:"struct Order[]",name:"orders",type:"tuple[]"},{components:[{components:[{internalType:"uint256",name:"orderIndex",type:"uint256"},{internalType:"uint256",name:"itemIndex",type:"uint256"}],internalType:"struct FulfillmentComponent[]",name:"offerComponents",type:"tuple[]"},{components:[{internalType:"uint256",name:"orderIndex",type:"uint256"},{internalType:"uint256",name:"itemIndex",type:"uint256"}],internalType:"struct FulfillmentComponent[]",name:"considerationComponents",type:"tuple[]"}],internalType:"struct Fulfillment[]",name:"fulfillments",type:"tuple[]"}],name:"matchOrders",outputs:[{components:[{components:[{internalType:"enum ItemType",name:"itemType",type:"uint8"},{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"identifier",type:"uint256"},{internalType:"uint256",name:"amount",type:"uint256"},{internalType:"address payable",name:"recipient",type:"address"}],internalType:"struct ReceivedItem",name:"item",type:"tuple"},{internalType:"address",name:"offerer",type:"address"},{internalType:"bytes32",name:"conduitKey",type:"bytes32"}],internalType:"struct Execution[]",name:"executions",type:"tuple[]"}],stateMutability:"payable",type:"function"},{inputs:[],name:"name",outputs:[{internalType:"string",name:"contractName",type:"string"}],stateMutability:"view",type:"function"},{inputs:[{components:[{components:[{internalType:"address",name:"offerer",type:"address"},{internalType:"address",name:"zone",type:"address"},{components:[{internalType:"enum ItemType",name:"itemType",type:"uint8"},{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"identifierOrCriteria",type:"uint256"},{internalType:"uint256",name:"startAmount",type:"uint256"},{internalType:"uint256",name:"endAmount",type:"uint256"}],internalType:"struct OfferItem[]",name:"offer",type:"tuple[]"},{components:[{internalType:"enum ItemType",name:"itemType",type:"uint8"},{internalType:"address",name:"token",type:"address"},{internalType:"uint256",name:"identifierOrCriteria",type:"uint256"},{internalType:"uint256",name:"startAmount",type:"uint256"},{internalType:"uint256",name:"endAmount",type:"uint256"},{internalType:"address payable",name:"recipient",type:"address"}],internalType:"struct ConsiderationItem[]",name:"consideration",type:"tuple[]"},{internalType:"enum OrderType",name:"orderType",type:"uint8"},{internalType:"uint256",name:"startTime",type:"uint256"},{internalType:"uint256",name:"endTime",type:"uint256"},{internalType:"bytes32",name:"zoneHash",type:"bytes32"},{internalType:"uint256",name:"salt",type:"uint256"},{internalType:"bytes32",name:"conduitKey",type:"bytes32"},{internalType:"uint256",name:"totalOriginalConsiderationItems",type:"uint256"}],internalType:"struct OrderParameters",name:"parameters",type:"tuple"},{internalType:"bytes",name:"signature",type:"bytes"}],internalType:"struct Order[]",name:"orders",type:"tuple[]"}],name:"validate",outputs:[{internalType:"bool",name:"validated",type:"bool"}],stateMutability:"nonpayable",type:"function"},{stateMutability:"payable",type:"receive"}];var Vz={};!function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.DOMAIN_REGISTRY_ADDRESS=e.CROSS_CHAIN_SEAPORT_V1_5_ADDRESS=e.CROSS_CHAIN_SEAPORT_V1_4_ADDRESS=e.KNOWN_CONDUIT_KEYS_TO_CONDUIT=e.NO_CONDUIT=e.ONE_HUNDRED_PERCENT_BP=e.MAX_INT=e.BasicOrderRouteType=e.Side=e.ItemType=e.OrderType=e.EIP_712_BULK_ORDER_TYPE=e.EIP_712_ORDER_TYPE=e.OPENSEA_CONDUIT_ADDRESS=e.OPENSEA_CONDUIT_KEY=e.SEAPORT_CONTRACT_VERSION_V1_5=e.SEAPORT_CONTRACT_VERSION_V1_4=e.SEAPORT_CONTRACT_NAME=void 0;const t=wz;var n,r,i,a;e.SEAPORT_CONTRACT_NAME="Seaport",e.SEAPORT_CONTRACT_VERSION_V1_4="1.4",e.SEAPORT_CONTRACT_VERSION_V1_5="1.5",e.OPENSEA_CONDUIT_KEY="0x0000007b02230091a7ed01230072f7006a004d60a8d4e71d599b8104250f0000",e.OPENSEA_CONDUIT_ADDRESS="0x1e0049783f008a0085193e00003d00cd54003c71",e.EIP_712_ORDER_TYPE={OrderComponents:[{name:"offerer",type:"address"},{name:"zone",type:"address"},{name:"offer",type:"OfferItem[]"},{name:"consideration",type:"ConsiderationItem[]"},{name:"orderType",type:"uint8"},{name:"startTime",type:"uint256"},{name:"endTime",type:"uint256"},{name:"zoneHash",type:"bytes32"},{name:"salt",type:"uint256"},{name:"conduitKey",type:"bytes32"},{name:"counter",type:"uint256"}],OfferItem:[{name:"itemType",type:"uint8"},{name:"token",type:"address"},{name:"identifierOrCriteria",type:"uint256"},{name:"startAmount",type:"uint256"},{name:"endAmount",type:"uint256"}],ConsiderationItem:[{name:"itemType",type:"uint8"},{name:"token",type:"address"},{name:"identifierOrCriteria",type:"uint256"},{name:"startAmount",type:"uint256"},{name:"endAmount",type:"uint256"},{name:"recipient",type:"address"}]},e.EIP_712_BULK_ORDER_TYPE={BulkOrder:[{name:"tree",type:"OrderComponents[2][2][2][2][2][2][2]"}],OrderComponents:[{name:"offerer",type:"address"},{name:"zone",type:"address"},{name:"offer",type:"OfferItem[]"},{name:"consideration",type:"ConsiderationItem[]"},{name:"orderType",type:"uint8"},{name:"startTime",type:"uint256"},{name:"endTime",type:"uint256"},{name:"zoneHash",type:"bytes32"},{name:"salt",type:"uint256"},{name:"conduitKey",type:"bytes32"},{name:"counter",type:"uint256"}],OfferItem:[{name:"itemType",type:"uint8"},{name:"token",type:"address"},{name:"identifierOrCriteria",type:"uint256"},{name:"startAmount",type:"uint256"},{name:"endAmount",type:"uint256"}],ConsiderationItem:[{name:"itemType",type:"uint8"},{name:"token",type:"address"},{name:"identifierOrCriteria",type:"uint256"},{name:"startAmount",type:"uint256"},{name:"endAmount",type:"uint256"},{name:"recipient",type:"address"}]},function(e){e[e.FULL_OPEN=0]="FULL_OPEN",e[e.PARTIAL_OPEN=1]="PARTIAL_OPEN",e[e.FULL_RESTRICTED=2]="FULL_RESTRICTED",e[e.PARTIAL_RESTRICTED=3]="PARTIAL_RESTRICTED"}(n||(e.OrderType=n={})),function(e){e[e.NATIVE=0]="NATIVE",e[e.ERC20=1]="ERC20",e[e.ERC721=2]="ERC721",e[e.ERC1155=3]="ERC1155",e[e.ERC721_WITH_CRITERIA=4]="ERC721_WITH_CRITERIA",e[e.ERC1155_WITH_CRITERIA=5]="ERC1155_WITH_CRITERIA"}(r||(e.ItemType=r={})),function(e){e[e.OFFER=0]="OFFER",e[e.CONSIDERATION=1]="CONSIDERATION"}(i||(e.Side=i={})),function(e){e[e.ETH_TO_ERC721=0]="ETH_TO_ERC721",e[e.ETH_TO_ERC1155=1]="ETH_TO_ERC1155",e[e.ERC20_TO_ERC721=2]="ERC20_TO_ERC721",e[e.ERC20_TO_ERC1155=3]="ERC20_TO_ERC1155",e[e.ERC721_TO_ERC20=4]="ERC721_TO_ERC20",e[e.ERC1155_TO_ERC20=5]="ERC1155_TO_ERC20"}(a||(e.BasicOrderRouteType=a={})),e.MAX_INT=t.BigNumber.from("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"),e.ONE_HUNDRED_PERCENT_BP=1e4,e.NO_CONDUIT="0x0000000000000000000000000000000000000000000000000000000000000000",e.KNOWN_CONDUIT_KEYS_TO_CONDUIT={[e.OPENSEA_CONDUIT_KEY]:e.OPENSEA_CONDUIT_ADDRESS},e.CROSS_CHAIN_SEAPORT_V1_4_ADDRESS="0x00000000000001ad428e4906aE43D8F9852d0dD6",e.CROSS_CHAIN_SEAPORT_V1_5_ADDRESS="0x00000000000000ADc04C56Bf30aC9d3c0aAF14dC",e.DOMAIN_REGISTRY_ADDRESS="0x000000000DaD0DE04D2B2D4a5A74581EBA94124A"}(Vz);var Kz={},Wz={};Object.defineProperty(Wz,"__esModule",{value:!0}),Wz.ERC20ABI=void 0;Wz.ERC20ABI=[{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"owner",type:"address"},{indexed:!0,internalType:"address",name:"spender",type:"address"},{indexed:!1,internalType:"uint256",name:"amount",type:"uint256"}],name:"Approval",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"from",type:"address"},{indexed:!0,internalType:"address",name:"to",type:"address"},{indexed:!1,internalType:"uint256",name:"amount",type:"uint256"}],name:"Transfer",type:"event"},{inputs:[],name:"DOMAIN_SEPARATOR",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[],name:"PERMIT_TYPEHASH",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"",type:"address"},{internalType:"address",name:"",type:"address"}],name:"allowance",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"spender",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"approve",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"",type:"address"}],name:"balanceOf",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"decimals",outputs:[{internalType:"uint8",name:"",type:"uint8"}],stateMutability:"view",type:"function"},{inputs:[],name:"name",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"",type:"address"}],name:"nonces",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"owner",type:"address"},{internalType:"address",name:"spender",type:"address"},{internalType:"uint256",name:"value",type:"uint256"},{internalType:"uint256",name:"deadline",type:"uint256"},{internalType:"uint8",name:"v",type:"uint8"},{internalType:"bytes32",name:"r",type:"bytes32"},{internalType:"bytes32",name:"s",type:"bytes32"}],name:"permit",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"symbol",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[],name:"totalSupply",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"transfer",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"transferFrom",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"}];var Xz={};Object.defineProperty(Xz,"__esModule",{value:!0}),Xz.ERC721ABI=void 0;Xz.ERC721ABI=[{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"owner",type:"address"},{indexed:!0,internalType:"address",name:"spender",type:"address"},{indexed:!0,internalType:"uint256",name:"id",type:"uint256"}],name:"Approval",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"owner",type:"address"},{indexed:!0,internalType:"address",name:"operator",type:"address"},{indexed:!1,internalType:"bool",name:"approved",type:"bool"}],name:"ApprovalForAll",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"from",type:"address"},{indexed:!0,internalType:"address",name:"to",type:"address"},{indexed:!0,internalType:"uint256",name:"id",type:"uint256"}],name:"Transfer",type:"event"},{inputs:[{internalType:"address",name:"spender",type:"address"},{internalType:"uint256",name:"id",type:"uint256"}],name:"approve",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"",type:"address"}],name:"balanceOf",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"",type:"uint256"}],name:"getApproved",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"",type:"address"},{internalType:"address",name:"",type:"address"}],name:"isApprovedForAll",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[],name:"name",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"",type:"uint256"}],name:"ownerOf",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"id",type:"uint256"}],name:"safeTransferFrom",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"id",type:"uint256"},{internalType:"bytes",name:"data",type:"bytes"}],name:"safeTransferFrom",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"operator",type:"address"},{internalType:"bool",name:"approved",type:"bool"}],name:"setApprovalForAll",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes4",name:"interfaceId",type:"bytes4"}],name:"supportsInterface",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"pure",type:"function"},{inputs:[],name:"symbol",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"id",type:"uint256"}],name:"tokenURI",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"id",type:"uint256"}],name:"transferFrom",outputs:[],stateMutability:"nonpayable",type:"function"}];var $z,Jz={},Yz={};function Qz(){if($z)return Yz;$z=1,Object.defineProperty(Yz,"__esModule",{value:!0}),Yz.getItemToCriteriaMap=Yz.generateCriteriaResolvers=void 0;const e=Vz,t=tH();Yz.generateCriteriaResolvers=({orders:n,offerCriterias:r=[[]],considerationCriterias:i=[[]]})=>{const a=n.flatMap(((n,r)=>n.parameters.offer.map(((t,n)=>({orderIndex:r,item:t,index:n,side:e.Side.OFFER}))).filter((({item:e})=>(0,t.isCriteriaItem)(e.itemType))))),o=n.flatMap(((n,r)=>n.parameters.consideration.map(((t,n)=>({orderIndex:r,item:t,index:n,side:e.Side.CONSIDERATION}))).filter((({item:e})=>(0,t.isCriteriaItem)(e.itemType))))),s=(e,t)=>e.map((({orderIndex:e,item:n,index:r,side:i})=>{const a=n.identifierOrCriteria||"0",o=t[e][r];return{orderIndex:e,index:r,side:i,identifier:o.identifier,criteriaProof:"0"===a?[]:o.proof}}));return[...s(a,r),...s(o,i)]};return Yz.getItemToCriteriaMap=(e,n)=>{const r=[...n];return e.reduce(((e,n)=>((0,t.isCriteriaItem)(n.itemType)&&e.set(n,r.shift()),e)),new Map)},Yz}var Zz,eH={};function tH(){return Zz||(Zz=1,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.getMaximumSizeForOrder=e.getSummedTokenAndIdentifierAmounts=e.getPresentItemAmount=e.isCriteriaItem=e.isErc1155Item=e.isErc721Item=e.isErc20Item=e.isNativeCurrencyItem=e.isCurrencyItem=void 0;const t=wz,n=Vz,r=Qz(),i=eH;e.isCurrencyItem=({itemType:e})=>[n.ItemType.NATIVE,n.ItemType.ERC20].includes(e);e.isNativeCurrencyItem=({itemType:e})=>e===n.ItemType.NATIVE;e.isErc20Item=e=>e===n.ItemType.ERC20;e.isErc721Item=e=>[n.ItemType.ERC721,n.ItemType.ERC721_WITH_CRITERIA].includes(e);e.isErc1155Item=e=>[n.ItemType.ERC1155,n.ItemType.ERC1155_WITH_CRITERIA].includes(e);e.isCriteriaItem=e=>[n.ItemType.ERC721_WITH_CRITERIA,n.ItemType.ERC1155_WITH_CRITERIA].includes(e);e.getPresentItemAmount=({startAmount:e,endAmount:n,timeBasedItemParams:r})=>{const i=t.BigNumber.from(e),a=t.BigNumber.from(n);if(!r)return i.gt(a)?i:a;const{isConsiderationItem:o,currentBlockTimestamp:s,ascendingAmountTimestampBuffer:c,startTime:u,endTime:f}=r,d=t.BigNumber.from(f).sub(u),l=a.gt(e),p=t.BigNumber.from(l?s+c:s);if(p.lt(u))return i;const h=(p.gt(f)?t.BigNumber.from(f):p).sub(u),b=d.sub(h);return i.mul(b).add(a.mul(h)).add(o?d.sub(1):0).div(d)};e.getSummedTokenAndIdentifierAmounts=({items:n,criterias:i,timeBasedItemParams:a})=>{const o=(0,r.getItemToCriteriaMap)(n,i),s=n.reduce(((n,r)=>{var i,s,c,u;const f=null!==(s=null===(i=o.get(r))||void 0===i?void 0:i.identifier)&&void 0!==s?s:r.identifierOrCriteria;return Object.assign(Object.assign({},n),{[r.token]:Object.assign(Object.assign({},n[r.token]),{[f]:(null!==(u=null===(c=n[r.token])||void 0===c?void 0:c[f])&&void 0!==u?u:t.BigNumber.from(0)).add((0,e.getPresentItemAmount)({startAmount:r.startAmount,endAmount:r.endAmount,timeBasedItemParams:a}))})})}),{});return s};e.getMaximumSizeForOrder=({parameters:{offer:e,consideration:t}})=>{const n=[...e,...t].flatMap((({startAmount:e,endAmount:t})=>[e,t]));return(0,i.findGcd)(n)}}(Jz)),Jz}!function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.findGcd=e.gcd=void 0;const t=wz;e.gcd=(n,r)=>{const i=t.BigNumber.from(n),a=t.BigNumber.from(r);return i.eq(0)?a:(0,e.gcd)(a.mod(n),i)};e.findGcd=n=>{let r=t.BigNumber.from(n[0]);for(let t=1;t<n.length;t++)if(r=(0,e.gcd)(n[t],r),r.eq(1))return r;return r}}(eH);var nH={};!function(e){var t=Jt&&Jt.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(o,s)}c((r=r.apply(e,t||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0}),e.getTagFromDomain=e.getTransactionMethods=e.executeAllActions=void 0;const n=_z;e.executeAllActions=e=>t(void 0,void 0,void 0,(function*(){for(let t=0;t<e.length-1;t++){const n=e[t];if("approval"===n.type){const e=yield n.transactionMethods.transact();yield e.wait()}}const t=e[e.length-1];switch(t.type){case"create":return t.createOrder();case"createBulk":return t.createBulkOrders();default:return t.transactionMethods.transact()}}));e.getTransactionMethods=(n,r,i,a)=>{const o=i[i.length-1];let s;(e=>{const t=["gasLimit","gasPrice","maxFeePerGas","maxPriorityFeePerGas","nonce","type","accessList","customData","ccipReadEnabled","value","blockTag","CallOverrides"];return void 0===e||Object.keys(e).every((e=>t.includes(e)))})(o)&&(s=o,i.pop());const c=o=>t(void 0,void 0,void 0,(function*(){const t=Object.assign(Object.assign({},s),o),c=yield n.populateTransaction[r](...i,t);if(a){const t=(0,e.getTagFromDomain)(a);c.data=c.data+t}return c}));return{callStatic:e=>{const t=Object.assign(Object.assign({},s),e);return n.callStatic[r](...i,t)},estimateGas:e=>{const t=Object.assign(Object.assign({},s),e);return n.estimateGas[r](...i,t)},transact:e=>t(void 0,void 0,void 0,(function*(){const t=Object.assign(Object.assign({},s),e),r=yield c(t);return n.signer.sendTransaction(r)})),buildTransaction:c}};e.getTagFromDomain=e=>(0,n.keccak256)((0,n.toUtf8Bytes)(e)).slice(2,10)}(nH);var rH=Jt&&Jt.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(o,s)}c((r=r.apply(e,t||[])).next())}))};Object.defineProperty(Kz,"__esModule",{value:!0}),Kz.getApprovalActions=Kz.approvedItemAmount=void 0;const iH=wz,aH=Wz,oH=Xz,sH=Vz,cH=tH(),uH=nH;Kz.approvedItemAmount=(e,t,n,r)=>rH(void 0,void 0,void 0,(function*(){if((0,cH.isErc721Item)(t.itemType)||(0,cH.isErc1155Item)(t.itemType)){return new iH.Contract(t.token,oH.ERC721ABI,r).isApprovedForAll(e,n).then((e=>e?sH.MAX_INT:iH.BigNumber.from(0)))}if(t.itemType===sH.ItemType.ERC20){return new iH.Contract(t.token,aH.ERC20ABI,r).allowance(e,n)}return sH.MAX_INT})),Kz.getApprovalActions=function(e,t,n){return e.filter(((t,n)=>n===e.length-1||e[n+1].token!==t.token)).map((({token:e,operator:r,itemType:i,identifierOrCriteria:a,requiredApprovedAmount:o})=>{const s=(0,cH.isErc1155Item)(i);if((0,cH.isErc721Item)(i)||s){const o=new iH.Contract(e,oH.ERC721ABI,n);return{type:"approval",token:e,identifierOrCriteria:a,itemType:i,operator:r,transactionMethods:(0,uH.getTransactionMethods)(o.connect(n),t&&!s?"approve":"setApprovalForAll",[r,!(t&&!s)||a])}}{const s=new iH.Contract(e,aH.ERC20ABI,n);return{type:"approval",token:e,identifierOrCriteria:a,itemType:i,transactionMethods:(0,uH.getTransactionMethods)(s.connect(n),"approve",[r,t?o:sH.MAX_INT]),operator:r}}}))};var fH={},dH={},lH={};Object.defineProperty(lH,"__esModule",{value:!0}),lH.ERC1155ABI=void 0;lH.ERC1155ABI=[{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"owner",type:"address"},{indexed:!0,internalType:"address",name:"operator",type:"address"},{indexed:!1,internalType:"bool",name:"approved",type:"bool"}],name:"ApprovalForAll",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"operator",type:"address"},{indexed:!0,internalType:"address",name:"from",type:"address"},{indexed:!0,internalType:"address",name:"to",type:"address"},{indexed:!1,internalType:"uint256[]",name:"ids",type:"uint256[]"},{indexed:!1,internalType:"uint256[]",name:"amounts",type:"uint256[]"}],name:"TransferBatch",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"operator",type:"address"},{indexed:!0,internalType:"address",name:"from",type:"address"},{indexed:!0,internalType:"address",name:"to",type:"address"},{indexed:!1,internalType:"uint256",name:"id",type:"uint256"},{indexed:!1,internalType:"uint256",name:"amount",type:"uint256"}],name:"TransferSingle",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"string",name:"value",type:"string"},{indexed:!0,internalType:"uint256",name:"id",type:"uint256"}],name:"URI",type:"event"},{inputs:[{internalType:"address",name:"",type:"address"},{internalType:"uint256",name:"",type:"uint256"}],name:"balanceOf",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address[]",name:"owners",type:"address[]"},{internalType:"uint256[]",name:"ids",type:"uint256[]"}],name:"balanceOfBatch",outputs:[{internalType:"uint256[]",name:"balances",type:"uint256[]"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"",type:"address"},{internalType:"address",name:"",type:"address"}],name:"isApprovedForAll",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256[]",name:"ids",type:"uint256[]"},{internalType:"uint256[]",name:"amounts",type:"uint256[]"},{internalType:"bytes",name:"data",type:"bytes"}],name:"safeBatchTransferFrom",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"id",type:"uint256"},{internalType:"uint256",name:"amount",type:"uint256"},{internalType:"bytes",name:"data",type:"bytes"}],name:"safeTransferFrom",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"operator",type:"address"},{internalType:"bool",name:"approved",type:"bool"}],name:"setApprovalForAll",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes4",name:"interfaceId",type:"bytes4"}],name:"supportsInterface",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"pure",type:"function"},{inputs:[{internalType:"uint256",name:"id",type:"uint256"}],name:"uri",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"}];var pH=Jt&&Jt.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(o,s)}c((r=r.apply(e,t||[])).next())}))};Object.defineProperty(dH,"__esModule",{value:!0}),dH.balanceOf=void 0;const hH=wz,bH=lH,mH=Wz,yH=Xz,gH=Vz,vH=tH();dH.balanceOf=(e,t,n,r)=>pH(void 0,void 0,void 0,(function*(){if((0,vH.isErc721Item)(t.itemType)){const i=new hH.Contract(t.token,yH.ERC721ABI,n);return t.itemType===gH.ItemType.ERC721_WITH_CRITERIA?r?i.ownerOf(r.identifier).then((t=>hH.BigNumber.from(Number(t.toLowerCase()===e.toLowerCase())))):i.balanceOf(e):i.ownerOf(t.identifierOrCriteria).then((t=>hH.BigNumber.from(Number(t.toLowerCase()===e.toLowerCase()))))}if((0,vH.isErc1155Item)(t.itemType)){const i=new hH.Contract(t.token,bH.ERC1155ABI,n);if(t.itemType===gH.ItemType.ERC1155_WITH_CRITERIA){if(!r){const e=hH.BigNumber.from(t.startAmount),n=hH.BigNumber.from(t.endAmount);return e.gt(n)?e:n}return i.balanceOf(e,r.identifier)}return i.balanceOf(e,t.identifierOrCriteria)}if((0,vH.isErc20Item)(t.itemType)){return new hH.Contract(t.token,mH.ERC20ABI,n).balanceOf(e)}return n.getBalance(e)})),function(e){var t=Jt&&Jt.__awaiter||function(e,t,n,r){return new(n||(n=Promise))((function(i,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(o,s)}c((r=r.apply(e,t||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0}),e.validateStandardFulfillBalancesAndApprovals=e.validateBasicFulfillBalancesAndApprovals=e.validateOfferBalancesAndApprovals=e.getInsufficientBalanceAndApprovalAmounts=e.getBalancesAndApprovals=void 0;const n=wz,r=Vz,i=Kz,a=dH,o=Qz(),s=tH(),c=(e,t,n)=>{const r=e.find((({token:e,identifierOrCriteria:r})=>t.toLowerCase()===e.toLowerCase()&&r.toLowerCase()===n.toLowerCase()));if(!r)throw new Error("Balances and approvals didn't contain all tokens and identifiers");return r};e.getBalancesAndApprovals=({owner:e,items:c,criterias:u,operator:f,multicallProvider:d})=>t(void 0,void 0,void 0,(function*(){const l=(0,o.getItemToCriteriaMap)(c,u);return Promise.all(c.map((o=>t(void 0,void 0,void 0,(function*(){var t,c;let u=Promise.resolve(n.BigNumber.from(0));return u=(0,s.isErc721Item)(o.itemType)||(0,s.isErc1155Item)(o.itemType)||(0,s.isErc20Item)(o.itemType)?(0,i.approvedItemAmount)(e,o,f,d):Promise.resolve(r.MAX_INT),{token:o.token,identifierOrCriteria:null!==(c=null===(t=l.get(o))||void 0===t?void 0:t.identifier)&&void 0!==c?c:o.identifierOrCriteria,balance:yield(0,a.balanceOf)(e,o,d,l.get(o)),approvedAmount:yield u,itemType:o.itemType}})))))}));e.getInsufficientBalanceAndApprovalAmounts=({balancesAndApprovals:e,tokenAndIdentifierAmounts:t,operator:n})=>{const r=[...Object.entries(t).map((([e,t])=>Object.entries(t).map((([t,n])=>[e,t,n]))))].flat(),i=t=>r.filter((([n,r,i])=>c(e,n,r)[t].lt(i))).map((([n,r,i])=>{const a=c(e,n,r);return{token:n,identifierOrCriteria:r,requiredAmount:i,amountHave:a[t],itemType:a.itemType}})),[a,o]=[i("balance"),i("approvedAmount").map((e=>({token:e.token,identifierOrCriteria:e.identifierOrCriteria,approvedAmount:e.amountHave,requiredApprovedAmount:e.requiredAmount,itemType:e.itemType,operator:n})))];return{insufficientBalances:a,insufficientApprovals:o}};e.validateOfferBalancesAndApprovals=({offer:t,criterias:n,balancesAndApprovals:r,timeBasedItemParams:i,throwOnInsufficientBalances:a=!0,throwOnInsufficientApprovals:o,operator:c})=>{const{insufficientBalances:u,insufficientApprovals:f}=(0,e.getInsufficientBalanceAndApprovalAmounts)({balancesAndApprovals:r,tokenAndIdentifierAmounts:(0,s.getSummedTokenAndIdentifierAmounts)({items:t,criterias:n,timeBasedItemParams:i?Object.assign(Object.assign({},i),{isConsiderationItem:!1}):void 0}),operator:c});if(a&&u.length>0)throw new Error("The offerer does not have the amount needed to create or fulfill.");if(o&&f.length>0)throw new Error("The offerer does not have the sufficient approvals.");return f};e.validateBasicFulfillBalancesAndApprovals=({offer:t,consideration:n,offererBalancesAndApprovals:r,fulfillerBalancesAndApprovals:i,timeBasedItemParams:a,offererOperator:o,fulfillerOperator:c})=>{(0,e.validateOfferBalancesAndApprovals)({offer:t,criterias:[],balancesAndApprovals:r,timeBasedItemParams:a,throwOnInsufficientApprovals:!0,operator:o});const u=n.filter((e=>e.itemType!==t[0].itemType)),{insufficientBalances:f,insufficientApprovals:d}=(0,e.getInsufficientBalanceAndApprovalAmounts)({balancesAndApprovals:i,tokenAndIdentifierAmounts:(0,s.getSummedTokenAndIdentifierAmounts)({items:u,criterias:[],timeBasedItemParams:Object.assign(Object.assign({},a),{isConsiderationItem:!0})}),operator:c});if(f.length>0)throw new Error("The fulfiller does not have the balances needed to fulfill.");return d};e.validateStandardFulfillBalancesAndApprovals=({offer:t,consideration:n,offerCriteria:r,considerationCriteria:i,offererBalancesAndApprovals:a,fulfillerBalancesAndApprovals:o,timeBasedItemParams:c,offererOperator:f,fulfillerOperator:d})=>{(0,e.validateOfferBalancesAndApprovals)({offer:t,criterias:r,balancesAndApprovals:a,timeBasedItemParams:c,throwOnInsufficientApprovals:!0,operator:f});const l=u({items:t,criterias:r,balancesAndApprovals:o,timeBasedItemParams:c}),{insufficientBalances:p,insufficientApprovals:h}=(0,e.getInsufficientBalanceAndApprovalAmounts)({balancesAndApprovals:l,tokenAndIdentifierAmounts:(0,s.getSummedTokenAndIdentifierAmounts)({items:n,criterias:i,timeBasedItemParams:Object.assign(Object.assign({},c),{isConsiderationItem:!0})}),operator:d});if(p.length>0)throw new Error("The fulfiller does not have the balances needed to fulfill.");return h};const u=({items:e,criterias:t,timeBasedItemParams:n,balancesAndApprovals:r})=>{const i=(0,s.getSummedTokenAndIdentifierAmounts)({items:e,criterias:t,timeBasedItemParams:Object.assign(Object.assign({},n),{isConsiderationItem:!1})}),a=r.map((e=>Object.assign({},e)));return Object.entries(i).forEach((([e,t])=>Object.entries(t).forEach((([t,n])=>{const r=c(a,e,t),i=a.indexOf(r);a[i].balance=a[i].balance.add(n)})))),a}}(fH);var wH,_H={},EH={},TH={},AH={},RH={exports:{}},SH={exports:{}};function kH(){return wH||(wH=1,function(e,t){e.exports=function(){var e=e||function(e,t){var n=Object.create||function(){function e(){}return function(t){var n;return e.prototype=t,n=new e,e.prototype=null,n}}(),r={},i=r.lib={},a=i.Base={extend:function(e){var t=n(this);return e&&t.mixIn(e),t.hasOwnProperty("init")&&this.init!==t.init||(t.init=function(){t.$super.init.apply(this,arguments)}),t.init.prototype=t,t.$super=this,t},create:function(){var e=this.extend();return e.init.apply(e,arguments),e},init:function(){},mixIn:function(e){for(var t in e)e.hasOwnProperty(t)&&(this[t]=e[t]);e.hasOwnProperty("toString")&&(this.toString=e.toString)},clone:function(){return this.init.prototype.extend(this)}},o=i.WordArray=a.extend({init:function(e,n){e=this.words=e||[],this.sigBytes=n!=t?n:4*e.length},toString:function(e){return(e||c).stringify(this)},concat:function(e){var t=this.words,n=e.words,r=this.sigBytes,i=e.sigBytes;if(this.clamp(),r%4)for(var a=0;a<i;a++){var o=n[a>>>2]>>>24-a%4*8&255;t[r+a>>>2]|=o<<24-(r+a)%4*8}else for(a=0;a<i;a+=4)t[r+a>>>2]=n[a>>>2];return this.sigBytes+=i,this},clamp:function(){var t=this.words,n=this.sigBytes;t[n>>>2]&=4294967295<<32-n%4*8,t.length=e.ceil(n/4)},clone:function(){var e=a.clone.call(this);return e.words=this.words.slice(0),e},random:function(t){for(var n,r=[],i=function(t){var n=987654321,r=4294967295;return function(){var i=((n=36969*(65535&n)+(n>>16)&r)<<16)+(t=18e3*(65535&t)+(t>>16)&r)&r;return i/=4294967296,(i+=.5)*(e.random()>.5?1:-1)}},a=0;a<t;a+=4){var s=i(4294967296*(n||e.random()));n=987654071*s(),r.push(4294967296*s()|0)}return new o.init(r,t)}}),s=r.enc={},c=s.Hex={stringify:function(e){for(var t=e.words,n=e.sigBytes,r=[],i=0;i<n;i++){var a=t[i>>>2]>>>24-i%4*8&255;r.push((a>>>4).toString(16)),r.push((15&a).toString(16))}return r.join("")},parse:function(e){for(var t=e.length,n=[],r=0;r<t;r+=2)n[r>>>3]|=parseInt(e.substr(r,2),16)<<24-r%8*4;return new o.init(n,t/2)}},u=s.Latin1={stringify:function(e){for(var t=e.words,n=e.sigBytes,r=[],i=0;i<n;i++){var a=t[i>>>2]>>>24-i%4*8&255;r.push(String.fromCharCode(a))}return r.join("")},parse:function(e){for(var t=e.length,n=[],r=0;r<t;r++)n[r>>>2]|=(255&e.charCodeAt(r))<<24-r%4*8;return new o.init(n,t)}},f=s.Utf8={stringify:function(e){try{return decodeURIComponent(escape(u.stringify(e)))}catch(e){throw new Error("Malformed UTF-8 data")}},parse:function(e){return u.parse(unescape(encodeURIComponent(e)))}},d=i.BufferedBlockAlgorithm=a.extend({reset:function(){this._data=new o.init,this._nDataBytes=0},_append:function(e){"string"==typeof e&&(e=f.parse(e)),this._data.concat(e),this._nDataBytes+=e.sigBytes},_process:function(t){var n=this._data,r=n.words,i=n.sigBytes,a=this.blockSize,s=i/(4*a),c=(s=t?e.ceil(s):e.max((0|s)-this._minBufferSize,0))*a,u=e.min(4*c,i);if(c){for(var f=0;f<c;f+=a)this._doProcessBlock(r,f);var d=r.splice(0,c);n.sigBytes-=u}return new o.init(d,u)},clone:function(){var e=a.clone.call(this);return e._data=this._data.clone(),e},_minBufferSize:0});i.Hasher=d.extend({cfg:a.extend(),init:function(e){this.cfg=this.cfg.extend(e),this.reset()},reset:function(){d.reset.call(this),this._doReset()},update:function(e){return this._append(e),this._process(),this},finalize:function(e){return e&&this._append(e),this._doFinalize()},blockSize:16,_createHelper:function(e){return function(t,n){return new e.init(n).finalize(t)}},_createHmacHelper:function(e){return function(t,n){return new l.HMAC.init(e,n).finalize(t)}}});var l=r.algo={};return r}(Math);return e}()}(SH)),SH.exports}!function(e,t){e.exports=function(e){return function(t){var n=e,r=n.lib,i=r.WordArray,a=r.Hasher,o=n.algo,s=[],c=[];!function(){function e(e){for(var n=t.sqrt(e),r=2;r<=n;r++)if(!(e%r))return!1;return!0}function n(e){return 4294967296*(e-(0|e))|0}for(var r=2,i=0;i<64;)e(r)&&(i<8&&(s[i]=n(t.pow(r,.5))),c[i]=n(t.pow(r,1/3)),i++),r++}();var u=[],f=o.SHA256=a.extend({_doReset:function(){this._hash=new i.init(s.slice(0))},_doProcessBlock:function(e,t){for(var n=this._hash.words,r=n[0],i=n[1],a=n[2],o=n[3],s=n[4],f=n[5],d=n[6],l=n[7],p=0;p<64;p++){if(p<16)u[p]=0|e[t+p];else{var h=u[p-15],b=(h<<25|h>>>7)^(h<<14|h>>>18)^h>>>3,m=u[p-2],y=(m<<15|m>>>17)^(m<<13|m>>>19)^m>>>10;u[p]=b+u[p-7]+y+u[p-16]}var g=r&i^r&a^i&a,v=(r<<30|r>>>2)^(r<<19|r>>>13)^(r<<10|r>>>22),w=l+((s<<26|s>>>6)^(s<<21|s>>>11)^(s<<7|s>>>25))+(s&f^~s&d)+c[p]+u[p];l=d,d=f,f=s,s=o+w|0,o=a,a=i,i=r,r=w+(v+g)|0}n[0]=n[0]+r|0,n[1]=n[1]+i|0,n[2]=n[2]+a|0,n[3]=n[3]+o|0,n[4]=n[4]+s|0,n[5]=n[5]+f|0,n[6]=n[6]+d|0,n[7]=n[7]+l|0},_doFinalize:function(){var e=this._data,n=e.words,r=8*this._nDataBytes,i=8*e.sigBytes;return n[i>>>5]|=128<<24-i%32,n[14+(i+64>>>9<<4)]=t.floor(r/4294967296),n[15+(i+64>>>9<<4)]=r,e.sigBytes=4*n.length,this._process(),this._hash},clone:function(){var e=a.clone.call(this);return e._hash=this._hash.clone(),e}});n.SHA256=a._createHelper(f),n.HmacSHA256=a._createHmacHelper(f)}(Math),e.SHA256}(kH())}(RH);var IH=RH.exports,OH={exports:{}};!function(e,t){e.exports=function(){function e(e,t){var n=t?"└":"├";return n+=e?"─ ":"──┐"}function t(e,t){var n=[];for(var r in e)e.hasOwnProperty(r)&&(t&&"function"==typeof e[r]||n.push(r));return n}function n(r,i,a,o,s,c,u){var f,d,l="",p=0,h=o.slice(0);if(h.push([i,a])&&o.length>0&&(o.forEach((function(e,t){t>0&&(l+=(e[1]?" ":"│")+" "),d||e[0]!==i||(d=!0)})),l+=e(r,a)+r,s&&("object"!=typeof i||i instanceof Date)&&(l+=": "+i),d&&(l+=" (circular ref.)"),u(l)),!d&&"object"==typeof i){var b=t(i,c);b.forEach((function(e){f=++p===b.length,n(e,i[e],f,h,s,c,u)}))}}var r={asLines:function(e,t,r,i){n(".",e,!1,[],t,"function"!=typeof r&&r,i||r)},asTree:function(e,t,r){var i="";return n(".",e,!1,[],t,r,(function(e){i+=e+"\n"})),i}};return r}()}(OH);var xH,CH=OH.exports,MH={},PH={exports:{}},NH={exports:{}};function BH(){return xH||(xH=1,function(e,t){e.exports=function(e){return function(t){var n=e,r=n.lib,i=r.Base,a=r.WordArray,o=n.x64={};o.Word=i.extend({init:function(e,t){this.high=e,this.low=t}}),o.WordArray=i.extend({init:function(e,n){e=this.words=e||[],this.sigBytes=n!=t?n:8*e.length},toX32:function(){for(var e=this.words,t=e.length,n=[],r=0;r<t;r++){var i=e[r];n.push(i.high),n.push(i.low)}return a.create(n,this.sigBytes)},clone:function(){for(var e=i.clone.call(this),t=e.words=this.words.slice(0),n=t.length,r=0;r<n;r++)t[r]=t[r].clone();return e}})}(),e}(kH())}(NH)),NH.exports}var DH,FH={exports:{}};function LH(){return DH||(DH=1,function(e,t){e.exports=function(e){return function(){if("function"==typeof ArrayBuffer){var t=e.lib.WordArray,n=t.init,r=t.init=function(e){if(e instanceof ArrayBuffer&&(e=new Uint8Array(e)),(e instanceof Int8Array||"undefined"!=typeof Uint8ClampedArray&&e instanceof Uint8ClampedArray||e instanceof Int16Array||e instanceof Uint16Array||e instanceof Int32Array||e instanceof Uint32Array||e instanceof Float32Array||e instanceof Float64Array)&&(e=new Uint8Array(e.buffer,e.byteOffset,e.byteLength)),e instanceof Uint8Array){for(var t=e.byteLength,r=[],i=0;i<t;i++)r[i>>>2]|=e[i]<<24-i%4*8;n.call(this,r,t)}else n.apply(this,arguments)};r.prototype=t}}(),e.lib.WordArray}(kH())}(FH)),FH.exports}var UH,jH={exports:{}};function qH(){return UH||(UH=1,function(e,t){e.exports=function(e){return function(){var t=e,n=t.lib.WordArray,r=t.enc;function i(e){return e<<8&4278255360|e>>>8&16711935}r.Utf16=r.Utf16BE={stringify:function(e){for(var t=e.words,n=e.sigBytes,r=[],i=0;i<n;i+=2){var a=t[i>>>2]>>>16-i%4*8&65535;r.push(String.fromCharCode(a))}return r.join("")},parse:function(e){for(var t=e.length,r=[],i=0;i<t;i++)r[i>>>1]|=e.charCodeAt(i)<<16-i%2*16;return n.create(r,2*t)}},r.Utf16LE={stringify:function(e){for(var t=e.words,n=e.sigBytes,r=[],a=0;a<n;a+=2){var o=i(t[a>>>2]>>>16-a%4*8&65535);r.push(String.fromCharCode(o))}return r.join("")},parse:function(e){for(var t=e.length,r=[],a=0;a<t;a++)r[a>>>1]|=i(e.charCodeAt(a)<<16-a%2*16);return n.create(r,2*t)}}}(),e.enc.Utf16}(kH())}(jH)),jH.exports}var zH,HH={exports:{}};function GH(){return zH||(zH=1,function(e,t){e.exports=function(e){return function(){var t=e,n=t.lib.WordArray;function r(e,t,r){for(var i=[],a=0,o=0;o<t;o++)if(o%4){var s=r[e.charCodeAt(o-1)]<<o%4*2,c=r[e.charCodeAt(o)]>>>6-o%4*2;i[a>>>2]|=(s|c)<<24-a%4*8,a++}return n.create(i,a)}t.enc.Base64={stringify:function(e){var t=e.words,n=e.sigBytes,r=this._map;e.clamp();for(var i=[],a=0;a<n;a+=3)for(var o=(t[a>>>2]>>>24-a%4*8&255)<<16|(t[a+1>>>2]>>>24-(a+1)%4*8&255)<<8|t[a+2>>>2]>>>24-(a+2)%4*8&255,s=0;s<4&&a+.75*s<n;s++)i.push(r.charAt(o>>>6*(3-s)&63));var c=r.charAt(64);if(c)for(;i.length%4;)i.push(c);return i.join("")},parse:function(e){var t=e.length,n=this._map,i=this._reverseMap;if(!i){i=this._reverseMap=[];for(var a=0;a<n.length;a++)i[n.charCodeAt(a)]=a}var o=n.charAt(64);if(o){var s=e.indexOf(o);-1!==s&&(t=s)}return r(e,t,i)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="}}(),e.enc.Base64}(kH())}(HH)),HH.exports}var VH,KH={exports:{}};function WH(){return VH||(VH=1,function(e,t){e.exports=function(e){return function(t){var n=e,r=n.lib,i=r.WordArray,a=r.Hasher,o=n.algo,s=[];!function(){for(var e=0;e<64;e++)s[e]=4294967296*t.abs(t.sin(e+1))|0}();var c=o.MD5=a.extend({_doReset:function(){this._hash=new i.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(e,t){for(var n=0;n<16;n++){var r=t+n,i=e[r];e[r]=16711935&(i<<8|i>>>24)|4278255360&(i<<24|i>>>8)}var a=this._hash.words,o=e[t+0],c=e[t+1],p=e[t+2],h=e[t+3],b=e[t+4],m=e[t+5],y=e[t+6],g=e[t+7],v=e[t+8],w=e[t+9],_=e[t+10],E=e[t+11],T=e[t+12],A=e[t+13],R=e[t+14],S=e[t+15],k=a[0],I=a[1],O=a[2],x=a[3];k=u(k,I,O,x,o,7,s[0]),x=u(x,k,I,O,c,12,s[1]),O=u(O,x,k,I,p,17,s[2]),I=u(I,O,x,k,h,22,s[3]),k=u(k,I,O,x,b,7,s[4]),x=u(x,k,I,O,m,12,s[5]),O=u(O,x,k,I,y,17,s[6]),I=u(I,O,x,k,g,22,s[7]),k=u(k,I,O,x,v,7,s[8]),x=u(x,k,I,O,w,12,s[9]),O=u(O,x,k,I,_,17,s[10]),I=u(I,O,x,k,E,22,s[11]),k=u(k,I,O,x,T,7,s[12]),x=u(x,k,I,O,A,12,s[13]),O=u(O,x,k,I,R,17,s[14]),k=f(k,I=u(I,O,x,k,S,22,s[15]),O,x,c,5,s[16]),x=f(x,k,I,O,y,9,s[17]),O=f(O,x,k,I,E,14,s[18]),I=f(I,O,x,k,o,20,s[19]),k=f(k,I,O,x,m,5,s[20]),x=f(x,k,I,O,_,9,s[21]),O=f(O,x,k,I,S,14,s[22]),I=f(I,O,x,k,b,20,s[23]),k=f(k,I,O,x,w,5,s[24]),x=f(x,k,I,O,R,9,s[25]),O=f(O,x,k,I,h,14,s[26]),I=f(I,O,x,k,v,20,s[27]),k=f(k,I,O,x,A,5,s[28]),x=f(x,k,I,O,p,9,s[29]),O=f(O,x,k,I,g,14,s[30]),k=d(k,I=f(I,O,x,k,T,20,s[31]),O,x,m,4,s[32]),x=d(x,k,I,O,v,11,s[33]),O=d(O,x,k,I,E,16,s[34]),I=d(I,O,x,k,R,23,s[35]),k=d(k,I,O,x,c,4,s[36]),x=d(x,k,I,O,b,11,s[37]),O=d(O,x,k,I,g,16,s[38]),I=d(I,O,x,k,_,23,s[39]),k=d(k,I,O,x,A,4,s[40]),x=d(x,k,I,O,o,11,s[41]),O=d(O,x,k,I,h,16,s[42]),I=d(I,O,x,k,y,23,s[43]),k=d(k,I,O,x,w,4,s[44]),x=d(x,k,I,O,T,11,s[45]),O=d(O,x,k,I,S,16,s[46]),k=l(k,I=d(I,O,x,k,p,23,s[47]),O,x,o,6,s[48]),x=l(x,k,I,O,g,10,s[49]),O=l(O,x,k,I,R,15,s[50]),I=l(I,O,x,k,m,21,s[51]),k=l(k,I,O,x,T,6,s[52]),x=l(x,k,I,O,h,10,s[53]),O=l(O,x,k,I,_,15,s[54]),I=l(I,O,x,k,c,21,s[55]),k=l(k,I,O,x,v,6,s[56]),x=l(x,k,I,O,S,10,s[57]),O=l(O,x,k,I,y,15,s[58]),I=l(I,O,x,k,A,21,s[59]),k=l(k,I,O,x,b,6,s[60]),x=l(x,k,I,O,E,10,s[61]),O=l(O,x,k,I,p,15,s[62]),I=l(I,O,x,k,w,21,s[63]),a[0]=a[0]+k|0,a[1]=a[1]+I|0,a[2]=a[2]+O|0,a[3]=a[3]+x|0},_doFinalize:function(){var e=this._data,n=e.words,r=8*this._nDataBytes,i=8*e.sigBytes;n[i>>>5]|=128<<24-i%32;var a=t.floor(r/4294967296),o=r;n[15+(i+64>>>9<<4)]=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8),n[14+(i+64>>>9<<4)]=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8),e.sigBytes=4*(n.length+1),this._process();for(var s=this._hash,c=s.words,u=0;u<4;u++){var f=c[u];c[u]=16711935&(f<<8|f>>>24)|4278255360&(f<<24|f>>>8)}return s},clone:function(){var e=a.clone.call(this);return e._hash=this._hash.clone(),e}});function u(e,t,n,r,i,a,o){var s=e+(t&n|~t&r)+i+o;return(s<<a|s>>>32-a)+t}function f(e,t,n,r,i,a,o){var s=e+(t&r|n&~r)+i+o;return(s<<a|s>>>32-a)+t}function d(e,t,n,r,i,a,o){var s=e+(t^n^r)+i+o;return(s<<a|s>>>32-a)+t}function l(e,t,n,r,i,a,o){var s=e+(n^(t|~r))+i+o;return(s<<a|s>>>32-a)+t}n.MD5=a._createHelper(c),n.HmacMD5=a._createHmacHelper(c)}(Math),e.MD5}(kH())}(KH)),KH.exports}var XH,$H={exports:{}};function JH(){return XH||(XH=1,function(e,t){e.exports=function(e){return function(){var t=e,n=t.lib,r=n.WordArray,i=n.Hasher,a=t.algo,o=[],s=a.SHA1=i.extend({_doReset:function(){this._hash=new r.init([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(e,t){for(var n=this._hash.words,r=n[0],i=n[1],a=n[2],s=n[3],c=n[4],u=0;u<80;u++){if(u<16)o[u]=0|e[t+u];else{var f=o[u-3]^o[u-8]^o[u-14]^o[u-16];o[u]=f<<1|f>>>31}var d=(r<<5|r>>>27)+c+o[u];d+=u<20?1518500249+(i&a|~i&s):u<40?1859775393+(i^a^s):u<60?(i&a|i&s|a&s)-1894007588:(i^a^s)-899497514,c=s,s=a,a=i<<30|i>>>2,i=r,r=d}n[0]=n[0]+r|0,n[1]=n[1]+i|0,n[2]=n[2]+a|0,n[3]=n[3]+s|0,n[4]=n[4]+c|0},_doFinalize:function(){var e=this._data,t=e.words,n=8*this._nDataBytes,r=8*e.sigBytes;return t[r>>>5]|=128<<24-r%32,t[14+(r+64>>>9<<4)]=Math.floor(n/4294967296),t[15+(r+64>>>9<<4)]=n,e.sigBytes=4*t.length,this._process(),this._hash},clone:function(){var e=i.clone.call(this);return e._hash=this._hash.clone(),e}});t.SHA1=i._createHelper(s),t.HmacSHA1=i._createHmacHelper(s)}(),e.SHA1}(kH())}($H)),$H.exports}var YH,QH={exports:{}};var ZH,eG={exports:{}};function tG(){return ZH||(ZH=1,function(e,t){e.exports=function(e){return function(){var t=e,n=t.lib.Hasher,r=t.x64,i=r.Word,a=r.WordArray,o=t.algo;function s(){return i.create.apply(i,arguments)}var c=[s(1116352408,3609767458),s(1899447441,602891725),s(3049323471,3964484399),s(3921009573,2173295548),s(961987163,4081628472),s(1508970993,3053834265),s(2453635748,2937671579),s(2870763221,3664609560),s(3624381080,2734883394),s(310598401,1164996542),s(607225278,1323610764),s(1426881987,3590304994),s(1925078388,4068182383),s(2162078206,991336113),s(2614888103,633803317),s(3248222580,3479774868),s(3835390401,2666613458),s(4022224774,944711139),s(264347078,2341262773),s(604807628,2007800933),s(770255983,1495990901),s(1249150122,1856431235),s(1555081692,3175218132),s(1996064986,2198950837),s(2554220882,3999719339),s(2821834349,766784016),s(2952996808,2566594879),s(3210313671,3203337956),s(3336571891,1034457026),s(3584528711,2466948901),s(113926993,3758326383),s(338241895,168717936),s(666307205,1188179964),s(773529912,1546045734),s(1294757372,1522805485),s(1396182291,2643833823),s(1695183700,2343527390),s(1986661051,1014477480),s(2177026350,1206759142),s(2456956037,344077627),s(2730485921,1290863460),s(2820302411,3158454273),s(3259730800,3505952657),s(3345764771,106217008),s(3516065817,3606008344),s(3600352804,1432725776),s(4094571909,1467031594),s(275423344,851169720),s(430227734,3100823752),s(506948616,1363258195),s(659060556,3750685593),s(883997877,3785050280),s(958139571,3318307427),s(1322822218,3812723403),s(1537002063,2003034995),s(1747873779,3602036899),s(1955562222,1575990012),s(2024104815,1125592928),s(2227730452,2716904306),s(2361852424,442776044),s(2428436474,593698344),s(2756734187,3733110249),s(3204031479,2999351573),s(3329325298,3815920427),s(3391569614,3928383900),s(3515267271,566280711),s(3940187606,3454069534),s(4118630271,4000239992),s(116418474,1914138554),s(174292421,2731055270),s(289380356,3203993006),s(460393269,320620315),s(685471733,587496836),s(852142971,1086792851),s(1017036298,365543100),s(1126000580,2618297676),s(1288033470,3409855158),s(1501505948,4234509866),s(1607167915,987167468),s(1816402316,1246189591)],u=[];!function(){for(var e=0;e<80;e++)u[e]=s()}();var f=o.SHA512=n.extend({_doReset:function(){this._hash=new a.init([new i.init(1779033703,4089235720),new i.init(3144134277,2227873595),new i.init(1013904242,4271175723),new i.init(2773480762,1595750129),new i.init(1359893119,2917565137),new i.init(2600822924,725511199),new i.init(528734635,4215389547),new i.init(1541459225,327033209)])},_doProcessBlock:function(e,t){for(var n=this._hash.words,r=n[0],i=n[1],a=n[2],o=n[3],s=n[4],f=n[5],d=n[6],l=n[7],p=r.high,h=r.low,b=i.high,m=i.low,y=a.high,g=a.low,v=o.high,w=o.low,_=s.high,E=s.low,T=f.high,A=f.low,R=d.high,S=d.low,k=l.high,I=l.low,O=p,x=h,C=b,M=m,P=y,N=g,B=v,D=w,F=_,L=E,U=T,j=A,q=R,z=S,H=k,G=I,V=0;V<80;V++){var K=u[V];if(V<16)var W=K.high=0|e[t+2*V],X=K.low=0|e[t+2*V+1];else{var $=u[V-15],J=$.high,Y=$.low,Q=(J>>>1|Y<<31)^(J>>>8|Y<<24)^J>>>7,Z=(Y>>>1|J<<31)^(Y>>>8|J<<24)^(Y>>>7|J<<25),ee=u[V-2],te=ee.high,ne=ee.low,re=(te>>>19|ne<<13)^(te<<3|ne>>>29)^te>>>6,ie=(ne>>>19|te<<13)^(ne<<3|te>>>29)^(ne>>>6|te<<26),ae=u[V-7],oe=ae.high,se=ae.low,ce=u[V-16],ue=ce.high,fe=ce.low;W=(W=(W=Q+oe+((X=Z+se)>>>0<Z>>>0?1:0))+re+((X+=ie)>>>0<ie>>>0?1:0))+ue+((X+=fe)>>>0<fe>>>0?1:0),K.high=W,K.low=X}var de,le=F&U^~F&q,pe=L&j^~L&z,he=O&C^O&P^C&P,be=x&M^x&N^M&N,me=(O>>>28|x<<4)^(O<<30|x>>>2)^(O<<25|x>>>7),ye=(x>>>28|O<<4)^(x<<30|O>>>2)^(x<<25|O>>>7),ge=(F>>>14|L<<18)^(F>>>18|L<<14)^(F<<23|L>>>9),ve=(L>>>14|F<<18)^(L>>>18|F<<14)^(L<<23|F>>>9),we=c[V],_e=we.high,Ee=we.low,Te=H+ge+((de=G+ve)>>>0<G>>>0?1:0),Ae=ye+be;H=q,G=z,q=U,z=j,U=F,j=L,F=B+(Te=(Te=(Te=Te+le+((de+=pe)>>>0<pe>>>0?1:0))+_e+((de+=Ee)>>>0<Ee>>>0?1:0))+W+((de+=X)>>>0<X>>>0?1:0))+((L=D+de|0)>>>0<D>>>0?1:0)|0,B=P,D=N,P=C,N=M,C=O,M=x,O=Te+(me+he+(Ae>>>0<ye>>>0?1:0))+((x=de+Ae|0)>>>0<de>>>0?1:0)|0}h=r.low=h+x,r.high=p+O+(h>>>0<x>>>0?1:0),m=i.low=m+M,i.high=b+C+(m>>>0<M>>>0?1:0),g=a.low=g+N,a.high=y+P+(g>>>0<N>>>0?1:0),w=o.low=w+D,o.high=v+B+(w>>>0<D>>>0?1:0),E=s.low=E+L,s.high=_+F+(E>>>0<L>>>0?1:0),A=f.low=A+j,f.high=T+U+(A>>>0<j>>>0?1:0),S=d.low=S+z,d.high=R+q+(S>>>0<z>>>0?1:0),I=l.low=I+G,l.high=k+H+(I>>>0<G>>>0?1:0)},_doFinalize:function(){var e=this._data,t=e.words,n=8*this._nDataBytes,r=8*e.sigBytes;return t[r>>>5]|=128<<24-r%32,t[30+(r+128>>>10<<5)]=Math.floor(n/4294967296),t[31+(r+128>>>10<<5)]=n,e.sigBytes=4*t.length,this._process(),this._hash.toX32()},clone:function(){var e=n.clone.call(this);return e._hash=this._hash.clone(),e},blockSize:32});t.SHA512=n._createHelper(f),t.HmacSHA512=n._createHmacHelper(f)}(),e.SHA512}(kH(),BH())}(eG)),eG.exports}var nG,rG={exports:{}};var iG,aG={exports:{}};function oG(){return iG||(iG=1,function(e,t){e.exports=function(e){return function(t){var n=e,r=n.lib,i=r.WordArray,a=r.Hasher,o=n.x64.Word,s=n.algo,c=[],u=[],f=[];!function(){for(var e=1,t=0,n=0;n<24;n++){c[e+5*t]=(n+1)*(n+2)/2%64;var r=(2*e+3*t)%5;e=t%5,t=r}for(e=0;e<5;e++)for(t=0;t<5;t++)u[e+5*t]=t+(2*e+3*t)%5*5;for(var i=1,a=0;a<24;a++){for(var s=0,d=0,l=0;l<7;l++){if(1&i){var p=(1<<l)-1;p<32?d^=1<<p:s^=1<<p-32}128&i?i=i<<1^113:i<<=1}f[a]=o.create(s,d)}}();var d=[];!function(){for(var e=0;e<25;e++)d[e]=o.create()}();var l=s.SHA3=a.extend({cfg:a.cfg.extend({outputLength:512}),_doReset:function(){for(var e=this._state=[],t=0;t<25;t++)e[t]=new o.init;this.blockSize=(1600-2*this.cfg.outputLength)/32},_doProcessBlock:function(e,t){for(var n=this._state,r=this.blockSize/2,i=0;i<r;i++){var a=e[t+2*i],o=e[t+2*i+1];a=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8),o=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8),(I=n[i]).high^=o,I.low^=a}for(var s=0;s<24;s++){for(var l=0;l<5;l++){for(var p=0,h=0,b=0;b<5;b++)p^=(I=n[l+5*b]).high,h^=I.low;var m=d[l];m.high=p,m.low=h}for(l=0;l<5;l++){var y=d[(l+4)%5],g=d[(l+1)%5],v=g.high,w=g.low;for(p=y.high^(v<<1|w>>>31),h=y.low^(w<<1|v>>>31),b=0;b<5;b++)(I=n[l+5*b]).high^=p,I.low^=h}for(var _=1;_<25;_++){var E=(I=n[_]).high,T=I.low,A=c[_];A<32?(p=E<<A|T>>>32-A,h=T<<A|E>>>32-A):(p=T<<A-32|E>>>64-A,h=E<<A-32|T>>>64-A);var R=d[u[_]];R.high=p,R.low=h}var S=d[0],k=n[0];for(S.high=k.high,S.low=k.low,l=0;l<5;l++)for(b=0;b<5;b++){var I=n[_=l+5*b],O=d[_],x=d[(l+1)%5+5*b],C=d[(l+2)%5+5*b];I.high=O.high^~x.high&C.high,I.low=O.low^~x.low&C.low}I=n[0];var M=f[s];I.high^=M.high,I.low^=M.low}},_doFinalize:function(){var e=this._data,n=e.words;this._nDataBytes;var r=8*e.sigBytes,a=32*this.blockSize;n[r>>>5]|=1<<24-r%32,n[(t.ceil((r+1)/a)*a>>>5)-1]|=128,e.sigBytes=4*n.length,this._process();for(var o=this._state,s=this.cfg.outputLength/8,c=s/8,u=[],f=0;f<c;f++){var d=o[f],l=d.high,p=d.low;l=16711935&(l<<8|l>>>24)|4278255360&(l<<24|l>>>8),p=16711935&(p<<8|p>>>24)|4278255360&(p<<24|p>>>8),u.push(p),u.push(l)}return new i.init(u,s)},clone:function(){for(var e=a.clone.call(this),t=e._state=this._state.slice(0),n=0;n<25;n++)t[n]=t[n].clone();return e}});n.SHA3=a._createHelper(l),n.HmacSHA3=a._createHmacHelper(l)}(Math),e.SHA3}(kH(),BH())}(aG)),aG.exports}var sG,cG={exports:{}};var uG,fG={exports:{}};function dG(){return uG||(uG=1,function(e,t){e.exports=function(e){!function(){var t=e,n=t.lib.Base,r=t.enc.Utf8;t.algo.HMAC=n.extend({init:function(e,t){e=this._hasher=new e.init,"string"==typeof t&&(t=r.parse(t));var n=e.blockSize,i=4*n;t.sigBytes>i&&(t=e.finalize(t)),t.clamp();for(var a=this._oKey=t.clone(),o=this._iKey=t.clone(),s=a.words,c=o.words,u=0;u<n;u++)s[u]^=1549556828,c[u]^=909522486;a.sigBytes=o.sigBytes=i,this.reset()},reset:function(){var e=this._hasher;e.reset(),e.update(this._iKey)},update:function(e){return this._hasher.update(e),this},finalize:function(e){var t=this._hasher,n=t.finalize(e);return t.reset(),t.finalize(this._oKey.clone().concat(n))}})}()}(kH())}(fG)),fG.exports}var lG,pG={exports:{}};var hG,bG={exports:{}};function mG(){return hG||(hG=1,function(e,t){e.exports=function(e){return function(){var t=e,n=t.lib,r=n.Base,i=n.WordArray,a=t.algo,o=a.MD5,s=a.EvpKDF=r.extend({cfg:r.extend({keySize:4,hasher:o,iterations:1}),init:function(e){this.cfg=this.cfg.extend(e)},compute:function(e,t){for(var n=this.cfg,r=n.hasher.create(),a=i.create(),o=a.words,s=n.keySize,c=n.iterations;o.length<s;){u&&r.update(u);var u=r.update(e).finalize(t);r.reset();for(var f=1;f<c;f++)u=r.finalize(u),r.reset();a.concat(u)}return a.sigBytes=4*s,a}});t.EvpKDF=function(e,t,n){return s.create(n).compute(e,t)}}(),e.EvpKDF}(kH(),JH(),dG())}(bG)),bG.exports}var yG,gG={exports:{}};function vG(){return yG||(yG=1,function(e,t){e.exports=function(e){e.lib.Cipher||function(t){var n=e,r=n.lib,i=r.Base,a=r.WordArray,o=r.BufferedBlockAlgorithm,s=n.enc;s.Utf8;var c=s.Base64,u=n.algo.EvpKDF,f=r.Cipher=o.extend({cfg:i.extend(),createEncryptor:function(e,t){return this.create(this._ENC_XFORM_MODE,e,t)},createDecryptor:function(e,t){return this.create(this._DEC_XFORM_MODE,e,t)},init:function(e,t,n){this.cfg=this.cfg.extend(n),this._xformMode=e,this._key=t,this.reset()},reset:function(){o.reset.call(this),this._doReset()},process:function(e){return this._append(e),this._process()},finalize:function(e){return e&&this._append(e),this._doFinalize()},keySize:4,ivSize:4,_ENC_XFORM_MODE:1,_DEC_XFORM_MODE:2,_createHelper:function(){function e(e){return"string"==typeof e?v:y}return function(t){return{encrypt:function(n,r,i){return e(r).encrypt(t,n,r,i)},decrypt:function(n,r,i){return e(r).decrypt(t,n,r,i)}}}}()});r.StreamCipher=f.extend({_doFinalize:function(){return this._process(!0)},blockSize:1});var d=n.mode={},l=r.BlockCipherMode=i.extend({createEncryptor:function(e,t){return this.Encryptor.create(e,t)},createDecryptor:function(e,t){return this.Decryptor.create(e,t)},init:function(e,t){this._cipher=e,this._iv=t}}),p=d.CBC=function(){var e=l.extend();function n(e,n,r){var i=this._iv;if(i){var a=i;this._iv=t}else a=this._prevBlock;for(var o=0;o<r;o++)e[n+o]^=a[o]}return e.Encryptor=e.extend({processBlock:function(e,t){var r=this._cipher,i=r.blockSize;n.call(this,e,t,i),r.encryptBlock(e,t),this._prevBlock=e.slice(t,t+i)}}),e.Decryptor=e.extend({processBlock:function(e,t){var r=this._cipher,i=r.blockSize,a=e.slice(t,t+i);r.decryptBlock(e,t),n.call(this,e,t,i),this._prevBlock=a}}),e}(),h=(n.pad={}).Pkcs7={pad:function(e,t){for(var n=4*t,r=n-e.sigBytes%n,i=r<<24|r<<16|r<<8|r,o=[],s=0;s<r;s+=4)o.push(i);var c=a.create(o,r);e.concat(c)},unpad:function(e){var t=255&e.words[e.sigBytes-1>>>2];e.sigBytes-=t}};r.BlockCipher=f.extend({cfg:f.cfg.extend({mode:p,padding:h}),reset:function(){f.reset.call(this);var e=this.cfg,t=e.iv,n=e.mode;if(this._xformMode==this._ENC_XFORM_MODE)var r=n.createEncryptor;else r=n.createDecryptor,this._minBufferSize=1;this._mode&&this._mode.__creator==r?this._mode.init(this,t&&t.words):(this._mode=r.call(n,this,t&&t.words),this._mode.__creator=r)},_doProcessBlock:function(e,t){this._mode.processBlock(e,t)},_doFinalize:function(){var e=this.cfg.padding;if(this._xformMode==this._ENC_XFORM_MODE){e.pad(this._data,this.blockSize);var t=this._process(!0)}else t=this._process(!0),e.unpad(t);return t},blockSize:4});var b=r.CipherParams=i.extend({init:function(e){this.mixIn(e)},toString:function(e){return(e||this.formatter).stringify(this)}}),m=(n.format={}).OpenSSL={stringify:function(e){var t=e.ciphertext,n=e.salt;if(n)var r=a.create([1398893684,1701076831]).concat(n).concat(t);else r=t;return r.toString(c)},parse:function(e){var t=c.parse(e),n=t.words;if(1398893684==n[0]&&1701076831==n[1]){var r=a.create(n.slice(2,4));n.splice(0,4),t.sigBytes-=16}return b.create({ciphertext:t,salt:r})}},y=r.SerializableCipher=i.extend({cfg:i.extend({format:m}),encrypt:function(e,t,n,r){r=this.cfg.extend(r);var i=e.createEncryptor(n,r),a=i.finalize(t),o=i.cfg;return b.create({ciphertext:a,key:n,iv:o.iv,algorithm:e,mode:o.mode,padding:o.padding,blockSize:e.blockSize,formatter:r.format})},decrypt:function(e,t,n,r){return r=this.cfg.extend(r),t=this._parse(t,r.format),e.createDecryptor(n,r).finalize(t.ciphertext)},_parse:function(e,t){return"string"==typeof e?t.parse(e,this):e}}),g=(n.kdf={}).OpenSSL={execute:function(e,t,n,r){r||(r=a.random(8));var i=u.create({keySize:t+n}).compute(e,r),o=a.create(i.words.slice(t),4*n);return i.sigBytes=4*t,b.create({key:i,iv:o,salt:r})}},v=r.PasswordBasedCipher=y.extend({cfg:y.cfg.extend({kdf:g}),encrypt:function(e,t,n,r){var i=(r=this.cfg.extend(r)).kdf.execute(n,e.keySize,e.ivSize);r.iv=i.iv;var a=y.encrypt.call(this,e,t,i.key,r);return a.mixIn(i),a},decrypt:function(e,t,n,r){r=this.cfg.extend(r),t=this._parse(t,r.format);var i=r.kdf.execute(n,e.keySize,e.ivSize,t.salt);return r.iv=i.iv,y.decrypt.call(this,e,t,i.key,r)}})}()}(kH(),mG())}(gG)),gG.exports}var wG,_G={exports:{}};function EG(){return wG||(wG=1,function(e,t){e.exports=function(e){return e.mode.CFB=function(){var t=e.lib.BlockCipherMode.extend();function n(e,t,n,r){var i=this._iv;if(i){var a=i.slice(0);this._iv=void 0}else a=this._prevBlock;r.encryptBlock(a,0);for(var o=0;o<n;o++)e[t+o]^=a[o]}return t.Encryptor=t.extend({processBlock:function(e,t){var r=this._cipher,i=r.blockSize;n.call(this,e,t,i,r),this._prevBlock=e.slice(t,t+i)}}),t.Decryptor=t.extend({processBlock:function(e,t){var r=this._cipher,i=r.blockSize,a=e.slice(t,t+i);n.call(this,e,t,i,r),this._prevBlock=a}}),t}(),e.mode.CFB}(kH(),vG())}(_G)),_G.exports}var TG,AG={exports:{}};function RG(){return TG||(TG=1,function(e,t){e.exports=function(e){return e.mode.CTR=(t=e.lib.BlockCipherMode.extend(),n=t.Encryptor=t.extend({processBlock:function(e,t){var n=this._cipher,r=n.blockSize,i=this._iv,a=this._counter;i&&(a=this._counter=i.slice(0),this._iv=void 0);var o=a.slice(0);n.encryptBlock(o,0),a[r-1]=a[r-1]+1|0;for(var s=0;s<r;s++)e[t+s]^=o[s]}}),t.Decryptor=n,t),e.mode.CTR;var t,n}(kH(),vG())}(AG)),AG.exports}var SG,kG={exports:{}};function IG(){return SG||(SG=1,function(e,t){e.exports=function(e){
|
|
32
32
|
/** @preserve
|
|
33
33
|
* Counter block mode compatible with Dr Brian Gladman fileenc.c
|
|
34
34
|
* derived from CryptoJS.mode.CTR
|
|
@@ -63,5 +63,5 @@ return function(t){var n=e,r=n.lib,i=r.WordArray,a=r.Hasher,o=n.algo,s=i.create(
|
|
|
63
63
|
*
|
|
64
64
|
* This source code is licensed under the MIT license found in the
|
|
65
65
|
* LICENSE file in the root directory of this source tree.
|
|
66
|
-
*/w3.exports=function(){if(A3)return _3;A3=1;var e=R3,t=Symbol.for("react.element"),n=Symbol.for("react.fragment"),r=Object.prototype.hasOwnProperty,i=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,a={key:!0,ref:!0,__self:!0,__source:!0};function o(e,n,o){var s,c={},u=null,f=null;for(s in void 0!==o&&(u=""+o),void 0!==n.key&&(u=""+n.key),void 0!==n.ref&&(f=n.ref),n)r.call(n,s)&&!a.hasOwnProperty(s)&&(c[s]=n[s]);if(e&&e.defaultProps)for(s in n=e.defaultProps)void 0===c[s]&&(c[s]=n[s]);return{$$typeof:t,type:e,key:u,ref:f,props:c,_owner:i.current}}return _3.Fragment=n,_3.jsx=o,_3.jsxs=o,_3}();var S3=w3.exports;function k3(e,t,n,r){Object.defineProperty(e,t,{get:n,set:r,enumerable:!0,configurable:!0})}const I3=()=>"0.20.1-alpha.1";var O3,x3;k3({},"IMTBLWidgetEvents",(()=>O3)),(x3=O3||(O3={})).IMTBL_CONNECT_WIDGET_EVENT="imtbl-connect-widget",x3.IMTBL_WALLET_WIDGET_EVENT="imtbl-wallet-widget",x3.IMTBL_SWAP_WIDGET_EVENT="imtbl-swap-widget",x3.IMTBL_BRIDGE_WIDGET_EVENT="imtbl-bridge-widget",x3.IMTBL_ONRAMP_WIDGET_EVENT="imtbl-onramp-widget";var C3,M3;k3({},"ConnectEventType",(()=>C3)),(M3=C3||(C3={})).CLOSE_WIDGET="close-widget",M3.SUCCESS="success",M3.FAILURE="failure";var P3,N3;k3({},"WalletEventType",(()=>P3)),(N3=P3||(P3={})).CLOSE_WIDGET="close-widget",N3.NETWORK_SWITCH="network-switch",N3.DISCONNECT_WALLET="disconnect-wallet";var B3,D3;k3({},"SwapEventType",(()=>B3)),(D3=B3||(B3={})).CLOSE_WIDGET="close-widget",D3.SUCCESS="success",D3.FAILURE="failure",D3.REJECTED="rejected";var F3,L3;k3({},"BridgeEventType",(()=>F3)),(L3=F3||(F3={})).CLOSE_WIDGET="close-widget",L3.SUCCESS="success",L3.FAILURE="failure";var U3,j3;k3({},"OrchestrationEventType",(()=>U3)),(j3=U3||(U3={})).REQUEST_CONNECT="request-connect",j3.REQUEST_WALLET="request-wallet",j3.REQUEST_SWAP="request-swap",j3.REQUEST_BRIDGE="request-bridge",j3.REQUEST_ONRAMP="request-onramp";var q3,z3;k3({},"OnRampEventType",(()=>q3)),(z3=q3||(q3={})).CLOSE_WIDGET="close-widget",z3.SUCCESS="success",z3.FAILURE="failure";var H3,G3,V3,K3,W3={};k3(W3,"WidgetTheme",(()=>H3)),k3(W3,"CheckoutWidgetTagNames",(()=>V3)),(G3=H3||(H3={})).LIGHT="light",G3.DARK="dark",(K3=V3||(V3={})).CONNECT="imtbl-connect",K3.WALLET="imtbl-wallet",K3.SWAP="imtbl-swap",K3.BRIDGE="imtbl-bridge",K3.ONRAMP="imtbl-onramp";function X3(e,t){if(!t)return void console.error("no provider parsed");if(void 0===window)return void console.error("missing window object: please run Checkout client side");let n=0;let r;const i=()=>{try{const n=document.getElementsByTagName(e);n[0].setProvider(t),window.clearInterval(r)}catch(e){n++,n>=10&&(window.clearInterval(r),console.error("failed to set the provider"))}};r=window.setInterval(i,10),i()}function $3(e,t){if(!t)return void console.error("no passport provided");if(void 0===window)return void console.error("missing window object: please run Checkout client side");let n=0;let r;const i=()=>{try{const n=document.getElementsByTagName(e);n[0].addPassportOption(t),window.clearInterval(r)}catch(e){n++,n>=10&&(window.clearInterval(r),console.error("failed to set the provider"))}};r=window.setInterval(i,10),i()}function J3(e){const{walletProvider:t,fromContractAddress:n,amount:r,provider:i,passport:a}=e;R3.useEffect((()=>{i&&X3(V3.BRIDGE,i),a&&$3(V3.BRIDGE,a)}),[i,a]);const o=window.ImtblCheckoutWidgetConfig;return S3.jsx("imtbl-bridge",{widgetConfig:o,walletProvider:t,fromContractAddress:n??"",amount:r??""})}k3({},"BridgeReact",(()=>J3));function Y3({passport:e}){const t=window.ImtblCheckoutWidgetConfig;return R3.useEffect((()=>{e&&$3(V3.CONNECT,e)}),[e]),S3.jsx("imtbl-connect",{widgetConfig:t})}k3({},"ConnectReact",(()=>Y3));function Q3(e){const{walletProvider:t,fromContractAddress:n,amount:r,toContractAddress:i,provider:a,passport:o}=e;R3.useEffect((()=>{a&&X3(V3.SWAP,a),o&&$3(V3.SWAP,o)}),[a,o]);const s=window.ImtblCheckoutWidgetConfig;return S3.jsx("imtbl-swap",{widgetConfig:s,walletProvider:t,fromContractAddress:n??"",toContractAddress:i??"",amount:r??""})}k3({},"SwapReact",(()=>Q3));function Z3(e){const{walletProvider:t,provider:n,passport:r}=e;R3.useEffect((()=>{n&&X3(V3.WALLET,n),r&&$3(V3.WALLET,r)}),[n,r]);const i=window.ImtblCheckoutWidgetConfig;return S3.jsx("imtbl-wallet",{widgetConfig:i,walletProvider:t})}k3({},"WalletReact",(()=>Z3));function e4(e){const{walletProvider:t,amount:n,provider:r,passport:i,contractAddress:a}=e;R3.useEffect((()=>{r&&X3(V3.ONRAMP,r),i&&$3(V3.ONRAMP,i)}),[r,i]);const o=window.ImtblCheckoutWidgetConfig;return S3.jsx("imtbl-onramp",{widgetConfig:o,walletProvider:t,amount:n??"",contractAddress:a??""})}k3({},"OnRampReact",(()=>e4));var t4=Object.freeze({__proto__:null,get BridgeEventType(){return F3},BridgeReact:J3,get CheckoutWidgetTagNames(){return V3},CheckoutWidgets:function(e){if(void 0===window)return void console.error("missing window object: please run Checkout client side");if(void 0===document)return void console.error("missing document object: please run Checkout client side");const t=document.createElement("script"),n=function(e){const t=I3();if(void 0===e||void 0===e.major)return t;if(!Number.isInteger(e.major)||e.major<0)return t;if(void 0!==e.minor&&e.minor<0)return t;if(void 0!==e.patch&&e.patch<0)return t;if(0===e.major&&void 0===e.minor)return t;if(0===e.major&&0===e.minor&&void 0===e.patch)return t;if(0===e.major&&void 0===e.minor&&void 0===e.patch)return t;if(0===e.major&&0===e.minor&&0===e.patch)return t;let n=e.major.toString();return void 0===e.minor||(Number.isInteger(e.minor)&&(n+=`.${e.minor.toString()}`),void 0===e.patch||(Number.isInteger(e.patch)&&(n+=`.${e.patch.toString()}`),void 0===e.prerelease||"alpha"!==e.prerelease||("alpha"===e.prerelease&&(n+=`-${e.prerelease}`),void 0===e.build||Number.isInteger(e.build)&&e.build>=0&&(n+=`.${e.build.toString()}`)))),n}(e?.version);let r=`https://cdn.jsdelivr.net/npm/@imtbl/sdk@${n}/dist/browser/checkout.js`;t.setAttribute("src",r),document.head.appendChild(t),window.ImtblCheckoutWidgetConfig=JSON.stringify(e)},get ConnectEventType(){return C3},ConnectReact:Y3,get IMTBLWidgetEvents(){return O3},get OnRampEventType(){return q3},OnRampReact:e4,get OrchestrationEventType(){return U3},get SwapEventType(){return B3},SwapReact:Q3,UpdateConfig:function(e){void 0!==window?window.ImtblCheckoutWidgetConfig=JSON.stringify(e):console.error("missing document object: please run Checkout client side")},get WalletEventType(){return P3},WalletReact:Z3,get WidgetTheme(){return H3}});const n4=[{inputs:[{internalType:"string",name:"name_",type:"string"},{internalType:"string",name:"symbol_",type:"string"}],stateMutability:"nonpayable",type:"constructor"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"owner",type:"address"},{indexed:!0,internalType:"address",name:"spender",type:"address"},{indexed:!1,internalType:"uint256",name:"value",type:"uint256"}],name:"Approval",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"from",type:"address"},{indexed:!0,internalType:"address",name:"to",type:"address"},{indexed:!1,internalType:"uint256",name:"value",type:"uint256"}],name:"Transfer",type:"event"},{inputs:[{internalType:"address",name:"owner",type:"address"},{internalType:"address",name:"spender",type:"address"}],name:"allowance",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"spender",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"approve",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"account",type:"address"}],name:"balanceOf",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"decimals",outputs:[{internalType:"uint8",name:"",type:"uint8"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"spender",type:"address"},{internalType:"uint256",name:"subtractedValue",type:"uint256"}],name:"decreaseAllowance",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"spender",type:"address"},{internalType:"uint256",name:"addedValue",type:"uint256"}],name:"increaseAllowance",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"name",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[],name:"symbol",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[],name:"totalSupply",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"transfer",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"transferFrom",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"}],r4="0x60806040523480156200001157600080fd5b50604051620017ec380380620017ec8339818101604052810190620000379190620001f6565b8160039081620000489190620004c6565b5080600490816200005a9190620004c6565b505050620005ad565b6000604051905090565b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b620000cc8262000081565b810181811067ffffffffffffffff82111715620000ee57620000ed62000092565b5b80604052505050565b60006200010362000063565b9050620001118282620000c1565b919050565b600067ffffffffffffffff82111562000134576200013362000092565b5b6200013f8262000081565b9050602081019050919050565b60005b838110156200016c5780820151818401526020810190506200014f565b60008484015250505050565b60006200018f620001898462000116565b620000f7565b905082815260208101848484011115620001ae57620001ad6200007c565b5b620001bb8482856200014c565b509392505050565b600082601f830112620001db57620001da62000077565b5b8151620001ed84826020860162000178565b91505092915050565b6000806040838503121562000210576200020f6200006d565b5b600083015167ffffffffffffffff81111562000231576200023062000072565b5b6200023f85828601620001c3565b925050602083015167ffffffffffffffff81111562000263576200026262000072565b5b6200027185828601620001c3565b9150509250929050565b600081519050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b60006002820490506001821680620002ce57607f821691505b602082108103620002e457620002e362000286565b5b50919050565b60008190508160005260206000209050919050565b60006020601f8301049050919050565b600082821b905092915050565b6000600883026200034e7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff826200030f565b6200035a86836200030f565b95508019841693508086168417925050509392505050565b6000819050919050565b6000819050919050565b6000620003a7620003a16200039b8462000372565b6200037c565b62000372565b9050919050565b6000819050919050565b620003c38362000386565b620003db620003d282620003ae565b8484546200031c565b825550505050565b600090565b620003f2620003e3565b620003ff818484620003b8565b505050565b5b8181101562000427576200041b600082620003e8565b60018101905062000405565b5050565b601f82111562000476576200044081620002ea565b6200044b84620002ff565b810160208510156200045b578190505b620004736200046a85620002ff565b83018262000404565b50505b505050565b600082821c905092915050565b60006200049b600019846008026200047b565b1980831691505092915050565b6000620004b6838362000488565b9150826002028217905092915050565b620004d1826200027b565b67ffffffffffffffff811115620004ed57620004ec62000092565b5b620004f98254620002b5565b620005068282856200042b565b600060209050601f8311600181146200053e576000841562000529578287015190505b620005358582620004a8565b865550620005a5565b601f1984166200054e86620002ea565b60005b82811015620005785784890151825560018201915060208501945060208101905062000551565b8683101562000598578489015162000594601f89168262000488565b8355505b6001600288020188555050505b505050505050565b61122f80620005bd6000396000f3fe608060405234801561001057600080fd5b50600436106100a95760003560e01c80633950935111610071578063395093511461016857806370a082311461019857806395d89b41146101c8578063a457c2d7146101e6578063a9059cbb14610216578063dd62ed3e14610246576100a9565b806306fdde03146100ae578063095ea7b3146100cc57806318160ddd146100fc57806323b872dd1461011a578063313ce5671461014a575b600080fd5b6100b6610276565b6040516100c39190610b0c565b60405180910390f35b6100e660048036038101906100e19190610bc7565b610308565b6040516100f39190610c22565b60405180910390f35b61010461032b565b6040516101119190610c4c565b60405180910390f35b610134600480360381019061012f9190610c67565b610335565b6040516101419190610c22565b60405180910390f35b610152610364565b60405161015f9190610cd6565b60405180910390f35b610182600480360381019061017d9190610bc7565b61036d565b60405161018f9190610c22565b60405180910390f35b6101b260048036038101906101ad9190610cf1565b6103a4565b6040516101bf9190610c4c565b60405180910390f35b6101d06103ec565b6040516101dd9190610b0c565b60405180910390f35b61020060048036038101906101fb9190610bc7565b61047e565b60405161020d9190610c22565b60405180910390f35b610230600480360381019061022b9190610bc7565b6104f5565b60405161023d9190610c22565b60405180910390f35b610260600480360381019061025b9190610d1e565b610518565b60405161026d9190610c4c565b60405180910390f35b60606003805461028590610d8d565b80601f01602080910402602001604051908101604052809291908181526020018280546102b190610d8d565b80156102fe5780601f106102d3576101008083540402835291602001916102fe565b820191906000526020600020905b8154815290600101906020018083116102e157829003601f168201915b5050505050905090565b60008061031361059f565b90506103208185856105a7565b600191505092915050565b6000600254905090565b60008061034061059f565b905061034d858285610770565b6103588585856107fc565b60019150509392505050565b60006012905090565b60008061037861059f565b905061039981858561038a8589610518565b6103949190610ded565b6105a7565b600191505092915050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6060600480546103fb90610d8d565b80601f016020809104026020016040519081016040528092919081815260200182805461042790610d8d565b80156104745780601f1061044957610100808354040283529160200191610474565b820191906000526020600020905b81548152906001019060200180831161045757829003601f168201915b5050505050905090565b60008061048961059f565b905060006104978286610518565b9050838110156104dc576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016104d390610e93565b60405180910390fd5b6104e982868684036105a7565b60019250505092915050565b60008061050061059f565b905061050d8185856107fc565b600191505092915050565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1603610616576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161060d90610f25565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1603610685576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161067c90610fb7565b60405180910390fd5b80600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516107639190610c4c565b60405180910390a3505050565b600061077c8484610518565b90507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff81146107f657818110156107e8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107df90611023565b60405180910390fd5b6107f584848484036105a7565b5b50505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff160361086b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610862906110b5565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16036108da576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108d190611147565b60405180910390fd5b6108e5838383610a72565b60008060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490508181101561096b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610962906111d9565b60405180910390fd5b8181036000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef84604051610a599190610c4c565b60405180910390a3610a6c848484610a77565b50505050565b505050565b505050565b600081519050919050565b600082825260208201905092915050565b60005b83811015610ab6578082015181840152602081019050610a9b565b60008484015250505050565b6000601f19601f8301169050919050565b6000610ade82610a7c565b610ae88185610a87565b9350610af8818560208601610a98565b610b0181610ac2565b840191505092915050565b60006020820190508181036000830152610b268184610ad3565b905092915050565b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000610b5e82610b33565b9050919050565b610b6e81610b53565b8114610b7957600080fd5b50565b600081359050610b8b81610b65565b92915050565b6000819050919050565b610ba481610b91565b8114610baf57600080fd5b50565b600081359050610bc181610b9b565b92915050565b60008060408385031215610bde57610bdd610b2e565b5b6000610bec85828601610b7c565b9250506020610bfd85828601610bb2565b9150509250929050565b60008115159050919050565b610c1c81610c07565b82525050565b6000602082019050610c376000830184610c13565b92915050565b610c4681610b91565b82525050565b6000602082019050610c616000830184610c3d565b92915050565b600080600060608486031215610c8057610c7f610b2e565b5b6000610c8e86828701610b7c565b9350506020610c9f86828701610b7c565b9250506040610cb086828701610bb2565b9150509250925092565b600060ff82169050919050565b610cd081610cba565b82525050565b6000602082019050610ceb6000830184610cc7565b92915050565b600060208284031215610d0757610d06610b2e565b5b6000610d1584828501610b7c565b91505092915050565b60008060408385031215610d3557610d34610b2e565b5b6000610d4385828601610b7c565b9250506020610d5485828601610b7c565b9150509250929050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b60006002820490506001821680610da557607f821691505b602082108103610db857610db7610d5e565b5b50919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000610df882610b91565b9150610e0383610b91565b9250828201905080821115610e1b57610e1a610dbe565b5b92915050565b7f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f7760008201527f207a65726f000000000000000000000000000000000000000000000000000000602082015250565b6000610e7d602583610a87565b9150610e8882610e21565b604082019050919050565b60006020820190508181036000830152610eac81610e70565b9050919050565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b6000610f0f602483610a87565b9150610f1a82610eb3565b604082019050919050565b60006020820190508181036000830152610f3e81610f02565b9050919050565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b6000610fa1602283610a87565b9150610fac82610f45565b604082019050919050565b60006020820190508181036000830152610fd081610f94565b9050919050565b7f45524332303a20696e73756666696369656e7420616c6c6f77616e6365000000600082015250565b600061100d601d83610a87565b915061101882610fd7565b602082019050919050565b6000602082019050818103600083015261103c81611000565b9050919050565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b600061109f602583610a87565b91506110aa82611043565b604082019050919050565b600060208201905081810360008301526110ce81611092565b9050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b6000611131602383610a87565b915061113c826110d5565b604082019050919050565b6000602082019050818103600083015261116081611124565b9050919050565b7f45524332303a207472616e7366657220616d6f756e742065786365656473206260008201527f616c616e63650000000000000000000000000000000000000000000000000000602082015250565b60006111c3602683610a87565b91506111ce82611167565b604082019050919050565b600060208201905081810360008301526111f2816111b6565b905091905056fea26469706673582212204188b273199f085e1921ec1a1fa55abdee2e425960bda675a51fac85acd9972064736f6c63430008110033";class i4 extends fd{constructor(...e){e.length>1?super(...e):super(n4,r4,e[0])}deploy(e,t,n){return super.deploy(e,t,n||{})}getDeployTransaction(e,t,n){return super.getDeployTransaction(e,t,n||{})}attach(e){return super.attach(e)}connect(e){return super.connect(e)}static bytecode=r4;static abi=n4;static createInterface(){return new Ss(n4)}static connect(e,t){return new ud(e,n4,t)}}const a4=[{inputs:[{internalType:"address",name:"owner_",type:"address"},{internalType:"string",name:"name_",type:"string"},{internalType:"string",name:"symbol_",type:"string"},{internalType:"string",name:"baseURI_",type:"string"},{internalType:"string",name:"contractURI_",type:"string"},{internalType:"address",name:"operatorAllowlist_",type:"address"},{internalType:"address",name:"royaltyReceiver_",type:"address"},{internalType:"uint96",name:"feeNumerator_",type:"uint96"}],stateMutability:"nonpayable",type:"constructor"},{inputs:[],name:"AllowlistDoesNotImplementIOperatorAllowlist",type:"error"},{inputs:[{internalType:"address",name:"target",type:"address"}],name:"ApproveTargetNotInAllowlist",type:"error"},{inputs:[{internalType:"address",name:"approver",type:"address"}],name:"ApproverNotInAllowlist",type:"error"},{inputs:[{internalType:"address",name:"caller",type:"address"}],name:"CallerNotInAllowlist",type:"error"},{inputs:[{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"IImmutableERC721IDAboveThreshold",type:"error"},{inputs:[{internalType:"uint256",name:"tokenId",type:"uint256"},{internalType:"address",name:"currentOwner",type:"address"}],name:"IImmutableERC721MismatchedTokenOwner",type:"error"},{inputs:[],name:"IImmutableERC721MismatchedTransferLengths",type:"error"},{inputs:[{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"IImmutableERC721NotOwnerOrOperator",type:"error"},{inputs:[],name:"IImmutableERC721SendingToZerothAddress",type:"error"},{inputs:[{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"IImmutableERC721TokenAlreadyBurned",type:"error"},{inputs:[],name:"InvalidShortString",type:"error"},{inputs:[],name:"InvalidSignature",type:"error"},{inputs:[],name:"PermitExpired",type:"error"},{inputs:[],name:"SignerCannotBeZerothAddress",type:"error"},{inputs:[{internalType:"string",name:"str",type:"string"}],name:"StringTooLong",type:"error"},{inputs:[{internalType:"address",name:"from",type:"address"}],name:"TransferFromNotInAllowlist",type:"error"},{inputs:[{internalType:"address",name:"to",type:"address"}],name:"TransferToNotInAllowlist",type:"error"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"owner",type:"address"},{indexed:!0,internalType:"address",name:"approved",type:"address"},{indexed:!0,internalType:"uint256",name:"tokenId",type:"uint256"}],name:"Approval",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"owner",type:"address"},{indexed:!0,internalType:"address",name:"operator",type:"address"},{indexed:!1,internalType:"bool",name:"approved",type:"bool"}],name:"ApprovalForAll",type:"event"},{anonymous:!1,inputs:[],name:"EIP712DomainChanged",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"address",name:"oldRegistry",type:"address"},{indexed:!1,internalType:"address",name:"newRegistry",type:"address"}],name:"OperatorAllowlistRegistryUpdated",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"role",type:"bytes32"},{indexed:!0,internalType:"bytes32",name:"previousAdminRole",type:"bytes32"},{indexed:!0,internalType:"bytes32",name:"newAdminRole",type:"bytes32"}],name:"RoleAdminChanged",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"role",type:"bytes32"},{indexed:!0,internalType:"address",name:"account",type:"address"},{indexed:!0,internalType:"address",name:"sender",type:"address"}],name:"RoleGranted",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"role",type:"bytes32"},{indexed:!0,internalType:"address",name:"account",type:"address"},{indexed:!0,internalType:"address",name:"sender",type:"address"}],name:"RoleRevoked",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"from",type:"address"},{indexed:!0,internalType:"address",name:"to",type:"address"},{indexed:!0,internalType:"uint256",name:"tokenId",type:"uint256"}],name:"Transfer",type:"event"},{inputs:[],name:"DEFAULT_ADMIN_ROLE",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[],name:"DOMAIN_SEPARATOR",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[],name:"MINTER_ROLE",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"approve",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"owner",type:"address"}],name:"balanceOf",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"baseURI",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[],name:"bulkMintThreshold",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"pure",type:"function"},{inputs:[{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"burn",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256[]",name:"tokenIDs",type:"uint256[]"}],name:"burnBatch",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"contractURI",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[],name:"eip712Domain",outputs:[{internalType:"bytes1",name:"fields",type:"bytes1"},{internalType:"string",name:"name",type:"string"},{internalType:"string",name:"version",type:"string"},{internalType:"uint256",name:"chainId",type:"uint256"},{internalType:"address",name:"verifyingContract",type:"address"},{internalType:"bytes32",name:"salt",type:"bytes32"},{internalType:"uint256[]",name:"extensions",type:"uint256[]"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"exists",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[],name:"getAdmins",outputs:[{internalType:"address[]",name:"",type:"address[]"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"getApproved",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"role",type:"bytes32"}],name:"getRoleAdmin",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"role",type:"bytes32"},{internalType:"uint256",name:"index",type:"uint256"}],name:"getRoleMember",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"role",type:"bytes32"}],name:"getRoleMemberCount",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"user",type:"address"}],name:"grantMinterRole",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes32",name:"role",type:"bytes32"},{internalType:"address",name:"account",type:"address"}],name:"grantRole",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes32",name:"role",type:"bytes32"},{internalType:"address",name:"account",type:"address"}],name:"hasRole",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"owner",type:"address"},{internalType:"address",name:"operator",type:"address"}],name:"isApprovedForAll",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"mint",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{components:[{internalType:"address",name:"to",type:"address"},{internalType:"uint256[]",name:"tokenIds",type:"uint256[]"}],internalType:"struct ERC721Hybrid.IDMint[]",name:"mints",type:"tuple[]"}],name:"mintBatch",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{components:[{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"quantity",type:"uint256"}],internalType:"struct ERC721Hybrid.Mint[]",name:"mints",type:"tuple[]"}],name:"mintBatchByQuantity",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"quantity",type:"uint256"}],name:"mintByQuantity",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"name",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"nonces",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"operatorAllowlist",outputs:[{internalType:"contract IOperatorAllowlist",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"ownerOf",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"spender",type:"address"},{internalType:"uint256",name:"tokenId",type:"uint256"},{internalType:"uint256",name:"deadline",type:"uint256"},{internalType:"bytes",name:"sig",type:"bytes"}],name:"permit",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes32",name:"role",type:"bytes32"},{internalType:"address",name:"account",type:"address"}],name:"renounceRole",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"user",type:"address"}],name:"revokeMinterRole",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes32",name:"role",type:"bytes32"},{internalType:"address",name:"account",type:"address"}],name:"revokeRole",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"tokenId",type:"uint256"},{internalType:"uint256",name:"salePrice",type:"uint256"}],name:"royaltyInfo",outputs:[{internalType:"address",name:"",type:"address"},{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"owner",type:"address"},{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"safeBurn",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{components:[{internalType:"address",name:"owner",type:"address"},{internalType:"uint256[]",name:"tokenIds",type:"uint256[]"}],internalType:"struct ERC721Hybrid.IDBurn[]",name:"burns",type:"tuple[]"}],name:"safeBurnBatch",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"safeMint",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{components:[{internalType:"address",name:"to",type:"address"},{internalType:"uint256[]",name:"tokenIds",type:"uint256[]"}],internalType:"struct ERC721Hybrid.IDMint[]",name:"mints",type:"tuple[]"}],name:"safeMintBatch",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{components:[{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"quantity",type:"uint256"}],internalType:"struct ERC721Hybrid.Mint[]",name:"mints",type:"tuple[]"}],name:"safeMintBatchByQuantity",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"quantity",type:"uint256"}],name:"safeMintByQuantity",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"safeTransferFrom",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"tokenId",type:"uint256"},{internalType:"bytes",name:"_data",type:"bytes"}],name:"safeTransferFrom",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{components:[{internalType:"address",name:"from",type:"address"},{internalType:"address[]",name:"tos",type:"address[]"},{internalType:"uint256[]",name:"tokenIds",type:"uint256[]"}],internalType:"struct ERC721Hybrid.TransferRequest",name:"tr",type:"tuple"}],name:"safeTransferFromBatch",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"operator",type:"address"},{internalType:"bool",name:"approved",type:"bool"}],name:"setApprovalForAll",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"string",name:"baseURI_",type:"string"}],name:"setBaseURI",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"string",name:"_contractURI",type:"string"}],name:"setContractURI",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"receiver",type:"address"},{internalType:"uint96",name:"feeNumerator",type:"uint96"}],name:"setDefaultRoyaltyReceiver",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"tokenId",type:"uint256"},{internalType:"address",name:"receiver",type:"address"},{internalType:"uint96",name:"feeNumerator",type:"uint96"}],name:"setNFTRoyaltyReceiver",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256[]",name:"tokenIds",type:"uint256[]"},{internalType:"address",name:"receiver",type:"address"},{internalType:"uint96",name:"feeNumerator",type:"uint96"}],name:"setNFTRoyaltyReceiverBatch",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"_operatorAllowlist",type:"address"}],name:"setOperatorAllowlistRegistry",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes4",name:"interfaceId",type:"bytes4"}],name:"supportsInterface",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[],name:"symbol",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"tokenURI",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[],name:"totalSupply",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"transferFrom",outputs:[],stateMutability:"nonpayable",type:"function"}],o4="0x61016060405260006013553480156200001757600080fd5b5060405162005dfc38038062005dfc8339810160408190526200003a91620006cb565b8787878787878787868681604051806040016040528060018152602001603160f81b81525083838181838381600690816200007691906200085e565b5060076200008582826200085e565b50506801000000000000000060095550600d620000a383826200085e565b50600e620000b282826200085e565b5050505050620000d2601583620001e160201b620012111790919060201c565b61012052620000ef816016620001e1602090811b6200121117901c565b61014052815160208084019190912060e052815190820120610100524660a0526200017d60e05161010051604080517f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f60208201529081019290925260608201524660808201523060a082015260009060c00160405160208183030381529060405280519060200120905090565b60805250503060c0525062000196905060008962000231565b620001a2828262000274565b620001ad8362000379565b6019620001bb86826200085e565b506018620001ca85826200085e565b5050505050505050505050505050505050620009a8565b60006020835110156200020157620001f98362000472565b90506200022b565b826200021883620004b560201b620012421760201c565b906200022590826200085e565b5060ff90505b92915050565b620002488282620004b860201b620012451760201c565b60008281526001602090815260409091206200026f918390620012c962000559821b17901c565b505050565b6127106001600160601b0382161115620002e85760405162461bcd60e51b815260206004820152602a60248201527f455243323938313a20726f79616c7479206665652077696c6c206578636565646044820152692073616c65507269636560b01b60648201526084015b60405180910390fd5b6001600160a01b038216620003405760405162461bcd60e51b815260206004820152601960248201527f455243323938313a20696e76616c6964207265636569766572000000000000006044820152606401620002df565b604080518082019091526001600160a01b039092168083526001600160601b039091166020909201829052600160a01b90910217600355565b6040516301ffc9a760e01b81526305a3b80960e01b60048201526001600160a01b038216906301ffc9a790602401602060405180830381865afa158015620003c5573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620003eb91906200092a565b620004095760405163d6f93fb760e01b815260040160405180910390fd5b600254604080516001600160a01b03928316815291831660208301527f3edc37a14cc8047c7c8a3f354311efe86c14848efd4e3765a3e1e57eea04ea76910160405180910390a1600280546001600160a01b0319166001600160a01b0392909216919091179055565b600080829050601f81511115620004a0578260405163305a27a960e01b8152600401620002df91906200094e565b8051620004ad8262000983565b179392505050565b90565b6000828152602081815260408083206001600160a01b038516845290915290205460ff1662000555576000828152602081815260408083206001600160a01b03851684529091529020805460ff19166001179055620005143390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45b5050565b600062000570836001600160a01b03841662000577565b9392505050565b6000818152600183016020526040812054620005c0575081546001818101845560008481526020808220909301849055845484825282860190935260409020919091556200022b565b5060006200022b565b80516001600160a01b0381168114620005e157600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60005b8381101562000619578181015183820152602001620005ff565b50506000910152565b600082601f8301126200063457600080fd5b81516001600160401b0380821115620006515762000651620005e6565b604051601f8301601f19908116603f011681019082821181831017156200067c576200067c620005e6565b816040528381528660208588010111156200069657600080fd5b620006a9846020830160208901620005fc565b9695505050505050565b80516001600160601b0381168114620005e157600080fd5b600080600080600080600080610100898b031215620006e957600080fd5b620006f489620005c9565b60208a01519098506001600160401b03808211156200071257600080fd5b620007208c838d0162000622565b985060408b01519150808211156200073757600080fd5b620007458c838d0162000622565b975060608b01519150808211156200075c57600080fd5b6200076a8c838d0162000622565b965060808b01519150808211156200078157600080fd5b50620007908b828c0162000622565b945050620007a160a08a01620005c9565b9250620007b160c08a01620005c9565b9150620007c160e08a01620006b3565b90509295985092959890939650565b600181811c90821680620007e557607f821691505b6020821081036200080657634e487b7160e01b600052602260045260246000fd5b50919050565b601f8211156200026f57600081815260208120601f850160051c81016020861015620008355750805b601f850160051c820191505b81811015620008565782815560010162000841565b505050505050565b81516001600160401b038111156200087a576200087a620005e6565b62000892816200088b8454620007d0565b846200080c565b602080601f831160018114620008ca5760008415620008b15750858301515b600019600386901b1c1916600185901b17855562000856565b600085815260208120601f198616915b82811015620008fb57888601518255948401946001909101908401620008da565b50858210156200091a5787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b6000602082840312156200093d57600080fd5b815180151581146200057057600080fd5b60208152600082518060208401526200096f816040850160208701620005fc565b601f01601f19169190910160400192915050565b80516020808301519190811015620008065760001960209190910360031b1b16919050565b60805160a05160c05160e0516101005161012051610140516153f962000a036000396000610db301526000610d88015260006118740152600061184c015260006117a7015260006117d1015260006117fb01526153f96000f3fe608060405234801561001057600080fd5b506004361061035c5760003560e01c806369e2f0fb116101d3578063a217fddf11610104578063d547741f116100a2578063e4e18f6d1161007c578063e4e18f6d14610771578063e8a3d48514610784578063e985e9c51461078c578063eea987681461079f57600080fd5b8063d547741f14610738578063e19278591461074b578063e4623c1b1461075e57600080fd5b8063b88d4fde116100de578063b88d4fde146106ea578063c87b56dd146106fd578063ca15c87314610710578063d53913931461072357600080fd5b8063a217fddf146106bc578063a22cb465146106c4578063a7012816146106d757600080fd5b80639010d07c1161017157806395d89b411161014b57806395d89b411461067b5780639e2641a3146106835780639f15d70014610696578063a1448194146106a957600080fd5b80639010d07c1461064257806391d1485414610655578063938e3d7b1461066857600080fd5b8063745a41bc116101ad578063745a41bc146105ee57806374f16a811461060157806384b0196e14610614578063885e7a081461062f57600080fd5b806369e2f0fb146105c05780636c0360eb146105d357806370a08231146105db57600080fd5b80632d2c5a8b116102ad57806342842e0e1161024b5780634f558e79116102255780634f558e791461057457806355f804b314610587578063567e40751461059a5780636352211e146105ad57600080fd5b806342842e0e1461053b57806342966c681461054e578063439aed341461056157600080fd5b80633644e515116102875780633644e515146104fa57806336568abe146105025780633dd1eb611461051557806340c10f191461052857600080fd5b80632d2c5a8b146104bf5780632f2ff15d146104d257806331ae450b146104e557600080fd5b806318160ddd1161031a57806323b872dd116102f457806323b872dd14610444578063248a9ca31461045757806329326f291461047a5780632a55205a1461048d57600080fd5b806318160ddd1461041f5780631f8ebbd114610427578063234af0461461043157600080fd5b80628ad9461461036157806301ffc9a71461037657806306fdde031461039e578063081812fc146103b3578063095ea7b3146103de578063141a468c146103f1575b600080fd5b61037461036f36600461444e565b6107b2565b005b61038961038436600461449e565b610888565b60405190151581526020015b60405180910390f35b6103a6610899565b604051610395919061450b565b6103c66103c136600461451e565b6108a8565b6040516001600160a01b039091168152602001610395565b6103746103ec36600461454e565b6108c8565b6104116103ff36600461451e565b60009081526017602052604090205490565b604051908152602001610395565b6104116108e8565b600160401b610411565b61037461043f36600461471a565b6108ff565b610374610452366004614762565b610920565b61041161046536600461451e565b60009081526020819052604090206001015490565b6002546103c6906001600160a01b031681565b6104a061049b36600461479e565b610947565b604080516001600160a01b039093168352602083019190915201610395565b6103746104cd3660046147c0565b6109f5565b6103746104e036600461487c565b610a16565b6104ed610a3b565b60405161039591906148a8565b610411610ae9565b61037461051036600461487c565b610af3565b6103746105233660046148f5565b610b72565b61037461053636600461454e565b610b95565b610374610549366004614762565b610bb7565b61037461055c36600461451e565b610bd2565b61037461056f366004614927565b610c09565b61038961058236600461451e565b610c32565b6103746105953660046149ba565b610c3d565b6103746105a836600461454e565b610c54565b6103c66105bb36600461451e565b610c76565b6103746105ce3660046148f5565b610c96565b6103a6610cb9565b6104116105e93660046148f5565b610d47565b6103746105fc366004614a22565b610d65565b61037461060f36600461471a565b610d71565b61061c610d7a565b6040516103959796959493929190614a82565b61037461063d366004614b18565b610e03565b6103c661065036600461479e565b610e18565b61038961066336600461487c565b610e37565b6103746106763660046149ba565b610e60565b6103a6610e77565b61037461069136600461471a565b610e81565b6103746106a436600461454e565b610ea2565b6103746106b736600461454e565b610efc565b610411600081565b6103746106d2366004614b50565b610f1e565b6103746106e5366004614bcb565b61106f565b6103746106f8366004614c2f565b6110cf565b6103a661070b36600461451e565b6110f8565b61041161071e36600461451e565b611103565b6104116a4d494e5445525f524f4c4560a81b81565b61037461074636600461487c565b61111a565b6103746107593660046147c0565b61113f565b61037461076c366004614c7e565b611160565b61037461077f3660046148f5565b61119e565b6103a66111b2565b61038961079a366004614cbf565b6111bf565b6103746107ad36600461454e565b6111ef565b6107bf6020820182614ce9565b90506107ce6040830183614ce9565b9050146107ee5760405163359a1bc360e01b815260040160405180910390fd5b60005b6107fe6040830183614ce9565b90508110156108845761087261081760208401846148f5565b6108246020850185614ce9565b8481811061083457610834614d32565b905060200201602081019061084991906148f5565b6108566040860186614ce9565b8581811061086657610866614d32565b90506020020135610bb7565b8061087c81614d5e565b9150506107f1565b5050565b6000610893826112de565b92915050565b60606108a3611303565b905090565b6000600160401b8210156108bf5761089382611395565b610893826113bc565b600160401b8110156108de576108848282611447565b6108848282611557565b60006013546108f561165f565b6108a39190614d77565b6a4d494e5445525f524f4c4560a81b6109178161167b565b61088482611685565b600160401b81101561093c576109378383836116d4565b505050565b610937838383611704565b60008281526004602090815260408083208151808301909252546001600160a01b038116808352600160a01b9091046001600160601b03169282019290925282916109bc5750604080518082019091526003546001600160a01b0381168252600160a01b90046001600160601b031660208201525b6020810151600090612710906109db906001600160601b031687614d8a565b6109e59190614da1565b91519350909150505b9250929050565b6a4d494e5445525f524f4c4560a81b610a0d8161167b565b61088482611729565b600082815260208190526040902060010154610a318161167b565b6109378383611778565b60606000610a4881611103565b90506000816001600160401b03811115610a6457610a64614578565b604051908082528060200260200182016040528015610a8d578160200160208202803683370190505b50905060005b82811015610ae257610aa6600082610e18565b828281518110610ab857610ab8614d32565b6001600160a01b039092166020928302919091019091015280610ada81614d5e565b915050610a93565b5092915050565b60006108a361179a565b6001600160a01b0381163314610b685760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b60648201526084015b60405180910390fd5b61088482826118c5565b6000610b7d8161167b565b6108846a4d494e5445525f524f4c4560a81b83610a16565b6a4d494e5445525f524f4c4560a81b610bad8161167b565b61093783836118e7565b610937838383604051806020016040528060008152506110cf565b610bdd335b8261196e565b610bfd57604051630247e3a960e01b815260048101829052602401610b5f565b610c0681611990565b50565b6a4d494e5445525f524f4c4560a81b610c218161167b565b610c2c8484846119e3565b50505050565b600061089382611aae565b6000610c488161167b565b60196109378382614e43565b6a4d494e5445525f524f4c4560a81b610c6c8161167b565b6109378383611b0b565b6000600160401b821015610c8d5761089382611b15565b61089382611b75565b6000610ca18161167b565b6108846a4d494e5445525f524f4c4560a81b8361111a565b60198054610cc690614dc3565b80601f0160208091040260200160405190810160405280929190818152602001828054610cf290614dc3565b8015610d3f5780601f10610d1457610100808354040283529160200191610d3f565b820191906000526020600020905b815481529060010190602001808311610d2257829003601f168201915b505050505081565b6000610d5282611b89565b610d5b83611c54565b6108939190614d77565b610c2c84848484611cda565b610c0681611dc3565b600060608082808083610dae7f00000000000000000000000000000000000000000000000000000000000000006015611e4f565b610dd97f00000000000000000000000000000000000000000000000000000000000000006016611e4f565b60408051600080825260208201909252600f60f81b9b939a50919850469750309650945092509050565b6000610e0e8161167b565b6109378383611ef3565b6000828152600160205260408120610e309083611fad565b9392505050565b6000918252602082815260408084206001600160a01b0393909316845291905290205460ff1690565b6000610e6b8161167b565b60186109378382614e43565b60606108a3611fb9565b6a4d494e5445525f524f4c4560a81b610e998161167b565b61088482611fc8565b6000610ead82610c76565b9050826001600160a01b0316816001600160a01b031614610ef357604051634fefd56160e01b8152600481018390526001600160a01b0382166024820152604401610b5f565b61093782610bd2565b6a4d494e5445525f524f4c4560a81b610f148161167b565b6109378383612017565b81333b15801590610f9857506002546040516305a3b80960e01b81523360048201526001600160a01b03909116906305a3b80990602401602060405180830381865afa158015610f72573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f969190614f02565b155b15610fb85760405163f6fa4cbd60e01b8152336004820152602401610b5f565b6001600160a01b0381163b1580159061103c57506002546040516305a3b80960e01b81526001600160a01b038381166004830152909116906305a3b80990602401602060405180830381865afa158015611016573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061103a9190614f02565b155b15611065576040516341b8d58160e11b81526001600160a01b0382166004820152602401610b5f565b6109378383612085565b6a4d494e5445525f524f4c4560a81b6110878161167b565b60005b848110156110c7576110b58686838181106110a7576110a7614d32565b9050602002013585856119e3565b806110bf81614d5e565b91505061108a565b505050505050565b600160401b8210156110ec576110e78484848461208f565b610c2c565b610c2c848484846120c2565b6060610893826120e7565b60008181526001602052604081206108939061214d565b6000828152602081905260409020600101546111358161167b565b61093783836118c5565b6a4d494e5445525f524f4c4560a81b6111578161167b565b61088482612157565b60005b818110156109375761118c83838381811061118057611180614d32565b90506020020135610bd2565b8061119681614d5e565b915050611163565b60006111a98161167b565b610884826121a6565b60188054610cc690614dc3565b6001600160a01b03808316600090815260126020908152604080832093851683529290529081205460ff16610e30565b6a4d494e5445525f524f4c4560a81b6112078161167b565b610937838361229b565b600060208351101561122d57611226836122a5565b9050610893565b816112388482614e43565b5060ff9050610893565b90565b61124f8282610e37565b610884576000828152602081815260408083206001600160a01b03851684529091529020805460ff191660011790556112853390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b6000610e30836001600160a01b0384166122e3565b60006001600160e01b03198216635604e22560e01b1480610893575061089382612332565b6060600d805461131290614dc3565b80601f016020809104026020016040519081016040528092919081815260200182805461133e90614dc3565b801561138b5780601f106113605761010080835404028352916020019161138b565b820191906000526020600020905b81548152906001019060200180831161136e57829003601f168201915b5050505050905090565b60006113a08261233d565b506000908152601160205260409020546001600160a01b031690565b60006113c782611aae565b61142b5760405162461bcd60e51b815260206004820152602f60248201527f4552433732315073693a20617070726f76656420717565727920666f72206e6f60448201526e3732bc34b9ba32b73a103a37b5b2b760891b6064820152608401610b5f565b506000908152600a60205260409020546001600160a01b031690565b600061145282611b15565b9050806001600160a01b0316836001600160a01b0316036114bf5760405162461bcd60e51b815260206004820152602160248201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e656044820152603960f91b6064820152608401610b5f565b336001600160a01b03821614806114db57506114db81336111bf565b61154d5760405162461bcd60e51b815260206004820152603d60248201527f4552433732313a20617070726f76652063616c6c6572206973206e6f7420746f60448201527f6b656e206f776e6572206f7220617070726f76656420666f7220616c6c0000006064820152608401610b5f565b610937838361238d565b600061156282610c76565b9050806001600160a01b0316836001600160a01b0316036115d15760405162461bcd60e51b8152602060048201526024808201527f4552433732315073693a20617070726f76616c20746f2063757272656e74206f6044820152633bb732b960e11b6064820152608401610b5f565b336001600160a01b03821614806115ed57506115ed81336111bf565b61154d5760405162461bcd60e51b815260206004820152603b60248201527f4552433732315073693a20617070726f76652063616c6c6572206973206e6f7460448201527f206f776e6572206e6f7220617070726f76656420666f7220616c6c00000000006064820152608401610b5f565b60006116696124de565b611671612548565b6108a39190614f1f565b610c06813361255c565b60005b81518110156108845760008282815181106116a5576116a5614d32565b602002602001015190506116c1816000015182602001516125b5565b50806116cc81614d5e565b915050611688565b6116dd33610bd7565b6116f95760405162461bcd60e51b8152600401610b5f90614f32565b6109378383836125f6565b61170d33610bd7565b6116f95760405162461bcd60e51b8152600401610b5f90614f7f565b60005b815181101561088457600082828151811061174957611749614d32565b6020026020010151905061176581600001518260200151611b0b565b508061177081614d5e565b91505061172c565b6117828282611245565b600082815260016020526040902061093790826112c9565b6000306001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161480156117f357507f000000000000000000000000000000000000000000000000000000000000000046145b1561181d57507f000000000000000000000000000000000000000000000000000000000000000090565b6108a3604080517f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f60208201527f0000000000000000000000000000000000000000000000000000000000000000918101919091527f000000000000000000000000000000000000000000000000000000000000000060608201524660808201523060a082015260009060c00160405160208183030381529060405280519060200120905090565b6118cf82826127fd565b60008281526001602052604090206109379082612862565b600160401b811061190e5760405163b73c99f560e01b815260048101829052602401610b5f565b600881901c600090815260146020526040902054600160ff83161b161561194b576040516305dcda1160e51b815260048101829052602401610b5f565b6119558282612877565b6013805490600061196583614d5e565b91905055505050565b6000600160401b8210156119865761122683836129d2565b610e308383612a31565b600160401b8110156119da576119a581612af6565b600881901c60009081526014602052604081208054600160ff85161b17905560138054916119d283614fd3565b919050555050565b610c0681612b79565b6127106001600160601b0382161115611a0e5760405162461bcd60e51b8152600401610b5f90614fea565b6001600160a01b038216611a645760405162461bcd60e51b815260206004820152601b60248201527f455243323938313a20496e76616c696420706172616d657465727300000000006044820152606401610b5f565b6040805180820182526001600160a01b0393841681526001600160601b0392831660208083019182526000968752600490529190942093519051909116600160a01b029116179055565b6000600160401b821015611b02576000828152600f60205260409020546001600160a01b0316158015906108935750600882901c600090815260146020526040902054600160ff84161b1615151592915050565b61089382612bbb565b6108848282612bf0565b6000818152600f60205260408120546001600160a01b0316806108935760405162461bcd60e51b8152602060048201526018602482015277115490cdcc8c4e881a5b9d985b1a59081d1bdad95b88125160421b6044820152606401610b5f565b600080611b8183612c0a565b509392505050565b60006001600160a01b038216611bf75760405162461bcd60e51b815260206004820152602d60248201527f4552433732315073693a2062616c616e636520717565727920666f722074686560448201526c207a65726f206164647265737360981b6064820152608401610b5f565b6000600160401b5b600954811015610ae257611c1281611aae565b15611c4457611c2081610c76565b6001600160a01b0316846001600160a01b031603611c4457611c4182614d5e565b91505b611c4d81614d5e565b9050611bff565b60006001600160a01b038216611cbe5760405162461bcd60e51b815260206004820152602960248201527f4552433732313a2061646472657373207a65726f206973206e6f7420612076616044820152683634b21037bbb732b960b91b6064820152608401610b5f565b506001600160a01b031660009081526010602052604090205490565b42821015611cfb5760405163068568f360e21b815260040160405180910390fd5b6000611d08858585612ca1565b9050611d1d611d1685610c76565b8284612d7a565b15611d3257611d2c858561238d565b50610c2c565b60008251604003611d7957611d7282611d4e8560006020612e84565b611d5790615034565b611d648660206040612e84565b611d6d90615034565b612f91565b9050611da5565b8251604103611d8c57611d728284612fae565b604051638baa579f60e01b815260040160405180910390fd5b611daf8186612fca565b15611d8c57611dbe868661238d565b6110c7565b60005b8151811015610884576000828281518110611de357611de3614d32565b6020026020010151905060005b816020015151811015611e3a57611e28826000015183602001518381518110611e1b57611e1b614d32565b6020026020010151610ea2565b80611e3281614d5e565b915050611df0565b50508080611e4790614d5e565b915050611dc6565b606060ff8314611e625761122683612fe9565b818054611e6e90614dc3565b80601f0160208091040260200160405190810160405280929190818152602001828054611e9a90614dc3565b8015611ee75780601f10611ebc57610100808354040283529160200191611ee7565b820191906000526020600020905b815481529060010190602001808311611eca57829003601f168201915b50505050509050610893565b6127106001600160601b0382161115611f1e5760405162461bcd60e51b8152600401610b5f90614fea565b6001600160a01b038216611f745760405162461bcd60e51b815260206004820152601960248201527f455243323938313a20696e76616c6964207265636569766572000000000000006044820152606401610b5f565b604080518082019091526001600160a01b039092168083526001600160601b039091166020909201829052600160a01b90910217600355565b6000610e308383613028565b6060600e805461131290614dc3565b60005b8151811015610884576000828281518110611fe857611fe8614d32565b6020026020010151905061200481600001518260200151613052565b508061200f81614d5e565b915050611fcb565b600160401b811061203e5760405163b73c99f560e01b815260048101829052602401610b5f565b600881901c600090815260146020526040902054600160ff83161b161561207b576040516305dcda1160e51b815260048101829052602401610b5f565b6119558282613093565b61088482826130ad565b61209a335b8361196e565b6120b65760405162461bcd60e51b8152600401610b5f90614f32565b610c2c848484846130b8565b6120cb33612094565b6120b65760405162461bcd60e51b8152600401610b5f90614f7f565b60606120f28261233d565b60006120fc6130dc565b9050600081511161211c5760405180602001604052806000815250610e30565b80612126846130eb565b604051602001612137929190615058565b6040516020818303038152906040529392505050565b6000610893825490565b60005b815181101561088457600082828151811061217757612177614d32565b602002602001015190506121938160000151826020015161229b565b508061219e81614d5e565b91505061215a565b6040516301ffc9a760e01b81526305a3b80960e01b60048201526001600160a01b038216906301ffc9a790602401602060405180830381865afa1580156121f1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906122159190614f02565b6122325760405163d6f93fb760e01b815260040160405180910390fd5b600254604080516001600160a01b03928316815291831660208301527f3edc37a14cc8047c7c8a3f354311efe86c14848efd4e3765a3e1e57eea04ea76910160405180910390a1600280546001600160a01b0319166001600160a01b0392909216919091179055565b610884828261317d565b600080829050601f815111156122d0578260405163305a27a960e01b8152600401610b5f919061450b565b80516122db82615034565b179392505050565b600081815260018301602052604081205461232a57508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155610893565b506000610893565b6000610893826132f6565b61234681611aae565b610c065760405162461bcd60e51b8152602060048201526018602482015277115490cdcc8c4e881a5b9d985b1a59081d1bdad95b88125160421b6044820152606401610b5f565b81333b1580159061240757506002546040516305a3b80960e01b81523360048201526001600160a01b03909116906305a3b80990602401602060405180830381865afa1580156123e1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906124059190614f02565b155b156124275760405163f6fa4cbd60e01b8152336004820152602401610b5f565b6001600160a01b0381163b158015906124ab57506002546040516305a3b80960e01b81526001600160a01b038381166004830152909116906305a3b80990602401602060405180830381865afa158015612485573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906124a99190614f02565b155b156124d4576040516341b8d58160e11b81526001600160a01b0382166004820152602401610b5f565b6109378383613336565b6009546000906701000000000000009082906124fe9060081c6001614d77565b9050815b81811015612542576000818152600c602052604090205461252281613356565b61252c9086614d77565b945050808061253a90614d5e565b915050612502565b50505090565b6000600160401b6009546108a39190614f1f565b6125668282610e37565b6108845761257381613375565b61257e836020613387565b60405160200161258f929190615087565b60408051601f198184030181529082905262461bcd60e51b8252610b5f9160040161450b565b60005b8151811015610937576125e4838383815181106125d7576125d7614d32565b6020026020010151612017565b806125ee81614d5e565b9150506125b8565b828233321480159061267157506002546040516305a3b80960e01b81523360048201526001600160a01b03909116906305a3b80990602401602060405180830381865afa15801561264b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061266f9190614f02565b155b156126915760405163937db65f60e01b8152336004820152602401610b5f565b6001600160a01b0382163b1580159061271557506002546040516305a3b80960e01b81526001600160a01b038481166004830152909116906305a3b80990602401602060405180830381865afa1580156126ef573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906127139190614f02565b155b1561273e5760405163f934453160e01b81526001600160a01b0383166004820152602401610b5f565b6001600160a01b0381163b158015906127c257506002546040516305a3b80960e01b81526001600160a01b038381166004830152909116906305a3b80990602401602060405180830381865afa15801561279c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906127c09190614f02565b155b156127eb57604051632a67242160e11b81526001600160a01b0382166004820152602401610b5f565b6127f6858585613522565b5050505050565b6128078282610e37565b15610884576000828152602081815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b6000610e30836001600160a01b03841661354c565b6001600160a01b0382166128cd5760405162461bcd60e51b815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f20616464726573736044820152606401610b5f565b6128d681611aae565b156129235760405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e746564000000006044820152606401610b5f565b61292c81611aae565b156129795760405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e746564000000006044820152606401610b5f565b6001600160a01b038216600081815260106020908152604080832080546001019055848352600f90915280822080546001600160a01b0319168417905551839291906000805160206152a4833981519152908290a45050565b6000806129de83611b15565b9050806001600160a01b0316846001600160a01b03161480612a055750612a0581856111bf565b80612a295750836001600160a01b0316612a1e846108a8565b6001600160a01b0316145b949350505050565b6000612a3c82611aae565b612aa05760405162461bcd60e51b815260206004820152602f60248201527f4552433732315073693a206f70657261746f7220717565727920666f72206e6f60448201526e3732bc34b9ba32b73a103a37b5b2b760891b6064820152608401610b5f565b6000612aab83610c76565b9050806001600160a01b0316846001600160a01b03161480612ae65750836001600160a01b0316612adb846108a8565b6001600160a01b0316145b80612a295750612a2981856111bf565b6000612b0182611b15565b9050612b0c82611b15565b600083815260116020908152604080832080546001600160a01b03199081169091556001600160a01b038516808552601084528285208054600019019055878552600f909352818420805490911690555192935084926000805160206152a4833981519152908390a45050565b6000612b8482610c76565b9050612b91600c8361363f565b60405182906000906001600160a01b038416906000805160206152a4833981519152908390a45050565b600881901c6000908152600c6020526040812054600160ff1b60ff84161c1615612be757506000919050565b6108938261366b565b61088482826040518060200160405280600081525061368a565b600080612c1683611aae565b612c775760405162461bcd60e51b815260206004820152602c60248201527f4552433732315073693a206f776e657220717565727920666f72206e6f6e657860448201526b34b9ba32b73a103a37b5b2b760a11b6064820152608401610b5f565b612c80836136cb565b6000818152600860205260409020546001600160a01b031694909350915050565b6000612a29604051602001612d0f90660a0cae4dad2e8560cb1b81527f61646472657373207370656e6465722c75696e7432353620746f6b656e49642c60078201527f75696e74323536206e6f6e63652c75696e7432353620646561646c696e652900602782015260460190565b60408051808303601f19018152828252805160209182012060008881526017835283902054918401526001600160a01b0388169183019190915260608201869052608082015260a0810184905260c001604051602081830303815290604052805190602001206136d8565b6000806000856001600160a01b0316631626ba7e60e01b8686604051602401612da49291906150fc565b60408051601f198184030181529181526020820180516001600160e01b03166001600160e01b0319909416939093179092529051612de29190615115565b600060405180830381855afa9150503d8060008114612e1d576040519150601f19603f3d011682016040523d82523d6000602084013e612e22565b606091505b5091509150818015612e35575080516020145b15612e7857600081806020019051810190612e509190615131565b90506374eca2c160e11b6001600160e01b0319821601612e765760019350505050610e30565b505b50600095945050505050565b606081612e9281601f614d77565b1015612ed15760405162461bcd60e51b815260206004820152600e60248201526d736c6963655f6f766572666c6f7760901b6044820152606401610b5f565b612edb8284614d77565b84511015612f1f5760405162461bcd60e51b8152602060048201526011602482015270736c6963655f6f75744f66426f756e647360781b6044820152606401610b5f565b606082158015612f3e5760405191506000825260208201604052612f88565b6040519150601f8416801560200281840101858101878315602002848b0101015b81831015612f77578051835260209283019201612f5f565b5050858452601f01601f1916604052505b50949350505050565b6000806000612fa1868686613705565b91509150612f888161373e565b6000806000612fbd8585613888565b91509150611b818161373e565b60006001600160a01b03831615801590610e305750610e30838361196e565b60606000612ff6836138ca565b604080516020808252818301909252919250600091906020820181803683375050509182525060208101929092525090565b600082600001828154811061303f5761303f614d32565b9060005260206000200154905092915050565b60005b8151811015610937576130818383838151811061307457613074614d32565b60200260200101516118e7565b8061308b81614d5e565b915050613055565b6108848282604051806020016040528060008152506138f2565b6108843383836138fd565b600160401b8210156130d0576110e7848484846139cb565b610c2c848484846139fe565b60606019805461131290614dc3565b606060006130f883613a17565b60010190506000816001600160401b0381111561311757613117614578565b6040519080825280601f01601f191660200182016040528015613141576020820181803683370190505b5090508181016020015b600019016f181899199a1a9b1b9c1cb0b131b232b360811b600a86061a8153600a850494508461314b57509392505050565b600061318860095490565b9050600082116131e85760405162461bcd60e51b815260206004820152602560248201527f4552433732315073693a207175616e74697479206d7573742062652067726561604482015264074657220360dc1b6064820152608401610b5f565b6001600160a01b03831661324a5760405162461bcd60e51b815260206004820152602360248201527f4552433732315073693a206d696e7420746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610b5f565b816009600082825461325c9190614d77565b9091555050600081815260086020526040902080546001600160a01b0319166001600160a01b03851617905561329360058261363f565b6000806132a08484614d77565b90506001600160a01b0385169150828260006000805160206152a4833981519152600080a4600183015b8181146132f057808360006000805160206152a4833981519152600080a46001016132ca565b506127f6565b60006001600160e01b031982166380ac58cd60e01b148061332757506001600160e01b03198216635b5e139f60e01b145b80610893575061089382613aef565b600160401b81101561334c576108848282613b2f565b6108848282613b9d565b60005b811561337057600019820190911690600101613359565b919050565b60606108936001600160a01b03831660145b60606000613396836002614d8a565b6133a1906002614d77565b6001600160401b038111156133b8576133b8614578565b6040519080825280601f01601f1916602001820160405280156133e2576020820181803683370190505b509050600360fc1b816000815181106133fd576133fd614d32565b60200101906001600160f81b031916908160001a905350600f60fb1b8160018151811061342c5761342c614d32565b60200101906001600160f81b031916908160001a9053506000613450846002614d8a565b61345b906001614d77565b90505b60018111156134d3576f181899199a1a9b1b9c1cb0b131b232b360811b85600f166010811061348f5761348f614d32565b1a60f81b8282815181106134a5576134a5614d32565b60200101906001600160f81b031916908160001a90535060049490941c936134cc81614fd3565b905061345e565b508315610e305760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152606401610b5f565b600081815260176020526040812080549161353c83614d5e565b9190505550610937838383613bd2565b60008181526001830160205260408120548015613635576000613570600183614f1f565b855490915060009061358490600190614f1f565b90508181146135e95760008660000182815481106135a4576135a4614d32565b90600052602060002001549050808760000184815481106135c7576135c7614d32565b6000918252602080832090910192909255918252600188019052604090208390555b85548690806135fa576135fa61514e565b600190038181906000526020600020016000905590558560010160008681526020019081526020016000206000905560019350505050610893565b6000915050610893565b600881901c600090815260209290925260409091208054600160ff1b60ff9093169290921c9091179055565b600061367660095490565b82108015610893575050600160401b111590565b600061369560095490565b90506136a1848461317d565b6136af600085838686613bf4565b610c2c5760405162461bcd60e51b8152600401610b5f90615164565b6000610893600583613d2b565b60006108936136e561179a565b8360405161190160f01b8152600281019290925260228201526042902090565b6000806001600160ff1b0383168161372260ff86901c601b614d77565b905061373087828885613e23565b935093505050935093915050565b6000816004811115613752576137526151b9565b0361375a5750565b600181600481111561376e5761376e6151b9565b036137bb5760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e617475726500000000000000006044820152606401610b5f565b60028160048111156137cf576137cf6151b9565b0361381c5760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152606401610b5f565b6003816004811115613830576138306151b9565b03610c065760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c604482015261756560f01b6064820152608401610b5f565b60008082516041036138be5760208301516040840151606085015160001a6138b287828585613e23565b945094505050506109ee565b506000905060026109ee565b600060ff8216601f81111561089357604051632cd44ac360e21b815260040160405180910390fd5b610937838383613ee7565b816001600160a01b0316836001600160a01b03160361395e5760405162461bcd60e51b815260206004820152601960248201527f4552433732313a20617070726f766520746f2063616c6c6572000000000000006044820152606401610b5f565b6001600160a01b03838116600081815260126020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b6139d68484846125f6565b6139e284848484613f1a565b610c2c5760405162461bcd60e51b8152600401610b5f906151cf565b613a098484846125f6565b6136af848484600185613bf4565b60008072184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b8310613a565772184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b830492506040015b6d04ee2d6d415b85acef81000000008310613a82576d04ee2d6d415b85acef8100000000830492506020015b662386f26fc100008310613aa057662386f26fc10000830492506010015b6305f5e1008310613ab8576305f5e100830492506008015b6127108310613acc57612710830492506004015b60648310613ade576064830492506002015b600a83106108935760010192915050565b60006001600160e01b031982166380ac58cd60e01b1480613b2057506001600160e01b03198216635b5e139f60e01b145b80610893575061089382614013565b600081815260116020526040902080546001600160a01b0319166001600160a01b0384169081179091558190613b6482611b15565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b6000818152600a6020526040902080546001600160a01b0319166001600160a01b0384169081179091558190613b6482610c76565b600160401b811015613be957610937838383614038565b61093783838361418a565b60006001600160a01b0385163b15613d1e57506001835b613c158486614d77565b811015613d1857604051630a85bd0160e11b81526001600160a01b0387169063150b7a0290613c4e9033908b9086908990600401615221565b6020604051808303816000875af1925050508015613c89575060408051601f3d908101601f19168201909252613c8691810190615131565b60015b613ce6573d808015613cb7576040519150601f19603f3d011682016040523d82523d6000602084013e613cbc565b606091505b508051600003613cde5760405162461bcd60e51b8152600401610b5f90615164565b805181602001fd5b828015613d0357506001600160e01b03198116630a85bd0160e11b145b92505080613d1081614d5e565b915050613c0b565b50613d22565b5060015b95945050505050565b600881901c60008181526020849052604081205490919060ff808516919082181c8015613d6d57613d5b81614362565b60ff168203600884901b179350613e1a565b60008311613dda5760405162461bcd60e51b815260206004820152603460248201527f4269744d6170733a205468652073657420626974206265666f7265207468652060448201527334b73232bc103237b2b9b713ba1032bc34b9ba1760611b6064820152608401610b5f565b506000199091016000818152602086905260409020549091908015613e1557613e0281614362565b60ff0360ff16600884901b179350613e1a565b613d6d565b50505092915050565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0831115613e5a5750600090506003613ede565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015613eae573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b038116613ed757600060019250925050613ede565b9150600090505b94509492505050565b613ef183836143cc565b613efe6000848484613f1a565b6109375760405162461bcd60e51b8152600401610b5f906151cf565b60006001600160a01b0384163b1561400857604051630a85bd0160e11b81526001600160a01b0385169063150b7a0290613f5e903390899088908890600401615221565b6020604051808303816000875af1925050508015613f99575060408051601f3d908101601f19168201909252613f9691810190615131565b60015b613fee573d808015613fc7576040519150601f19603f3d011682016040523d82523d6000602084013e613fcc565b606091505b508051600003613cde5760405162461bcd60e51b8152600401610b5f906151cf565b6001600160e01b031916630a85bd0160e11b149050612a29565b506001949350505050565b60006001600160e01b0319821663152a902d60e11b14806108935750610893826143d6565b826001600160a01b031661404b82611b15565b6001600160a01b0316146140715760405162461bcd60e51b8152600401610b5f9061525e565b6001600160a01b0382166140d35760405162461bcd60e51b8152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f206164646044820152637265737360e01b6064820152608401610b5f565b826001600160a01b03166140e682611b15565b6001600160a01b03161461410c5760405162461bcd60e51b8152600401610b5f9061525e565b600081815260116020908152604080832080546001600160a01b03199081169091556001600160a01b0387811680865260108552838620805460001901905590871680865283862080546001019055868652600f90945282852080549092168417909155905184936000805160206152a483398151915291a4505050565b60008061419683612c0a565b91509150846001600160a01b0316826001600160a01b0316146142105760405162461bcd60e51b815260206004820152602c60248201527f4552433732315073693a207472616e73666572206f6620746f6b656e2074686160448201526b3a1034b9903737ba1037bbb760a11b6064820152608401610b5f565b6001600160a01b0384166142765760405162461bcd60e51b815260206004820152602760248201527f4552433732315073693a207472616e7366657220746f20746865207a65726f206044820152666164647265737360c81b6064820152608401610b5f565b61428160008461238d565b600061428e846001614d77565b600881901c600090815260056020526040902054909150600160ff1b60ff83161c161580156142be575060095481105b156142f557600081815260086020526040902080546001600160a01b0319166001600160a01b0388161790556142f560058261363f565b600084815260086020526040902080546001600160a01b0319166001600160a01b03871617905581841461432e5761432e60058561363f565b83856001600160a01b0316876001600160a01b03166000805160206152a483398151915260405160405180910390a46110c7565b600060405180610120016040528061010081526020016152c4610100913960f87e818283848586878898a8b8c8d8e8f929395969799a9b9d9e9faaeb6bedeeff6143ab856143e1565b02901c815181106143be576143be614d32565b016020015160f81c92915050565b6108848282612877565b6000610893826143f9565b60008082116143ef57600080fd5b5060008190031690565b60006001600160e01b03198216635a05180f60e01b148061089357506108938260006001600160e01b03198216637965db0b60e01b148061089357506301ffc9a760e01b6001600160e01b0319831614610893565b60006020828403121561446057600080fd5b81356001600160401b0381111561447657600080fd5b820160608185031215610e3057600080fd5b6001600160e01b031981168114610c0657600080fd5b6000602082840312156144b057600080fd5b8135610e3081614488565b60005b838110156144d65781810151838201526020016144be565b50506000910152565b600081518084526144f78160208601602086016144bb565b601f01601f19169290920160200192915050565b602081526000610e3060208301846144df565b60006020828403121561453057600080fd5b5035919050565b80356001600160a01b038116811461337057600080fd5b6000806040838503121561456157600080fd5b61456a83614537565b946020939093013593505050565b634e487b7160e01b600052604160045260246000fd5b604080519081016001600160401b03811182821017156145b0576145b0614578565b60405290565b604051601f8201601f191681016001600160401b03811182821017156145de576145de614578565b604052919050565b60006001600160401b038211156145ff576145ff614578565b5060051b60200190565b600061461c614617846145e6565b6145b6565b8381529050602080820190600585811b85018781111561463b57600080fd5b855b8181101561470e5780356001600160401b038082111561465d5760008081fd5b908801906040828c0312156146725760008081fd5b61467a61458e565b61468383614537565b815286830135828111156146975760008081fd5b8084019350508b601f8401126146af57600091508182fd5b823591506146bf614617836145e6565b82815291861b8301870191878101908d8411156146dc5760008081fd5b938801935b838510156146fa578435825293880193908801906146e1565b82890152508752505093830193830161463d565b50505050509392505050565b60006020828403121561472c57600080fd5b81356001600160401b0381111561474257600080fd5b8201601f8101841361475357600080fd5b612a2984823560208401614609565b60008060006060848603121561477757600080fd5b61478084614537565b925061478e60208501614537565b9150604084013590509250925092565b600080604083850312156147b157600080fd5b50508035926020909101359150565b600060208083850312156147d357600080fd5b82356001600160401b038111156147e957600080fd5b8301601f810185136147fa57600080fd5b8035614808614617826145e6565b81815260069190911b8201830190838101908783111561482757600080fd5b928401925b8284101561487157604084890312156148455760008081fd5b61484d61458e565b61485685614537565b8152848601358682015282526040909301929084019061482c565b979650505050505050565b6000806040838503121561488f57600080fd5b8235915061489f60208401614537565b90509250929050565b6020808252825182820181905260009190848201906040850190845b818110156148e95783516001600160a01b0316835292840192918401916001016148c4565b50909695505050505050565b60006020828403121561490757600080fd5b610e3082614537565b80356001600160601b038116811461337057600080fd5b60008060006060848603121561493c57600080fd5b8335925061494c60208501614537565b915061495a60408501614910565b90509250925092565b60006001600160401b0383111561497c5761497c614578565b61498f601f8401601f19166020016145b6565b90508281528383830111156149a357600080fd5b828260208301376000602084830101529392505050565b6000602082840312156149cc57600080fd5b81356001600160401b038111156149e257600080fd5b8201601f810184136149f357600080fd5b612a2984823560208401614963565b600082601f830112614a1357600080fd5b610e3083833560208501614963565b60008060008060808587031215614a3857600080fd5b614a4185614537565b9350602085013592506040850135915060608501356001600160401b03811115614a6a57600080fd5b614a7687828801614a02565b91505092959194509250565b60ff60f81b881681526000602060e081840152614aa260e084018a6144df565b8381036040850152614ab4818a6144df565b606085018990526001600160a01b038816608086015260a0850187905284810360c0860152855180825283870192509083019060005b81811015614b0657835183529284019291840191600101614aea565b50909c9b505050505050505050505050565b60008060408385031215614b2b57600080fd5b614b3483614537565b915061489f60208401614910565b8015158114610c0657600080fd5b60008060408385031215614b6357600080fd5b614b6c83614537565b91506020830135614b7c81614b42565b809150509250929050565b60008083601f840112614b9957600080fd5b5081356001600160401b03811115614bb057600080fd5b6020830191508360208260051b85010111156109ee57600080fd5b60008060008060608587031215614be157600080fd5b84356001600160401b03811115614bf757600080fd5b614c0387828801614b87565b9095509350614c16905060208601614537565b9150614c2460408601614910565b905092959194509250565b60008060008060808587031215614c4557600080fd5b614c4e85614537565b9350614c5c60208601614537565b92506040850135915060608501356001600160401b03811115614a6a57600080fd5b60008060208385031215614c9157600080fd5b82356001600160401b03811115614ca757600080fd5b614cb385828601614b87565b90969095509350505050565b60008060408385031215614cd257600080fd5b614cdb83614537565b915061489f60208401614537565b6000808335601e19843603018112614d0057600080fd5b8301803591506001600160401b03821115614d1a57600080fd5b6020019150600581901b36038213156109ee57600080fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b600060018201614d7057614d70614d48565b5060010190565b8082018082111561089357610893614d48565b808202811582820484141761089357610893614d48565b600082614dbe57634e487b7160e01b600052601260045260246000fd5b500490565b600181811c90821680614dd757607f821691505b602082108103614df757634e487b7160e01b600052602260045260246000fd5b50919050565b601f82111561093757600081815260208120601f850160051c81016020861015614e245750805b601f850160051c820191505b818110156110c757828155600101614e30565b81516001600160401b03811115614e5c57614e5c614578565b614e7081614e6a8454614dc3565b84614dfd565b602080601f831160018114614ea55760008415614e8d5750858301515b600019600386901b1c1916600185901b1785556110c7565b600085815260208120601f198616915b82811015614ed457888601518255948401946001909101908401614eb5565b5085821015614ef25787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b600060208284031215614f1457600080fd5b8151610e3081614b42565b8181038181111561089357610893614d48565b6020808252602d908201527f4552433732313a2063616c6c6572206973206e6f7420746f6b656e206f776e6560408201526c1c881bdc88185c1c1c9bdd9959609a1b606082015260800190565b60208082526034908201527f4552433732315073693a207472616e736665722063616c6c6572206973206e6f6040820152731d081bdddb995c881b9bdc88185c1c1c9bdd995960621b606082015260800190565b600081614fe257614fe2614d48565b506000190190565b6020808252602a908201527f455243323938313a20726f79616c7479206665652077696c6c206578636565646040820152692073616c65507269636560b01b606082015260800190565b80516020808301519190811015614df75760001960209190910360031b1b16919050565b6000835161506a8184602088016144bb565b83519083019061507e8183602088016144bb565b01949350505050565b7f416363657373436f6e74726f6c3a206163636f756e74200000000000000000008152600083516150bf8160178501602088016144bb565b7001034b99036b4b9b9b4b733903937b6329607d1b60179184019182015283516150f08160288401602088016144bb565b01602801949350505050565b828152604060208201526000612a2960408301846144df565b600082516151278184602087016144bb565b9190910192915050565b60006020828403121561514357600080fd5b8151610e3081614488565b634e487b7160e01b600052603160045260246000fd5b60208082526035908201527f4552433732315073693a207472616e7366657220746f206e6f6e20455243373260408201527418a932b1b2b4bb32b91034b6b83632b6b2b73a32b960591b606082015260800190565b634e487b7160e01b600052602160045260246000fd5b60208082526032908201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560408201527131b2b4bb32b91034b6b83632b6b2b73a32b960711b606082015260800190565b6001600160a01b0385811682528416602082015260408101839052608060608201819052600090615254908301846144df565b9695505050505050565b60208082526025908201527f4552433732313a207472616e736665722066726f6d20696e636f72726563742060408201526437bbb732b960d91b60608201526080019056feddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef0001020903110a19042112290b311a3905412245134d2a550c5d32651b6d3a7506264262237d468514804e8d2b95569d0d495ea533a966b11c886eb93bc176c9071727374353637324837e9b47af86c7155181ad4fd18ed32c9096db57d59ee30e2e4a6a5f92a6be3498aae067ddb2eb1d5989b56fd7baf33ca0c2ee77e5caf7ff0810182028303840444c545c646c7425617c847f8c949c48a4a8b087b8c0c816365272829aaec650acd0d28fdad4e22d6991bd97dfdcea58b4d6f29fede4f6fe0f1f2f3f4b5b6b607b8b93a3a7b7bf357199c5abcfd9e168bcdee9b3f1ecf5fd1e3e5a7a8aa2b670c4ced8bbe8f0f4fc3d79a1c3cde7effb78cce6facbf9f8a26469706673582212207c1340e2d1c7a6af058cbb35c7f1065a255bd81a470929fa89ee68ccabc5922664736f6c63430008110033";class s4 extends fd{constructor(...e){e.length>1?super(...e):super(a4,o4,e[0])}deploy(e,t,n,r,i,a,o,s,c){return super.deploy(e,t,n,r,i,a,o,s,c||{})}getDeployTransaction(e,t,n,r,i,a,o,s,c){return super.getDeployTransaction(e,t,n,r,i,a,o,s,c||{})}attach(e){return super.attach(e)}connect(e){return super.connect(e)}static bytecode=o4;static abi=a4;static createInterface(){return new Ss(a4)}static connect(e,t){return new ud(e,a4,t)}}const c4=[{inputs:[{internalType:"address",name:"owner",type:"address"},{internalType:"string",name:"name_",type:"string"},{internalType:"string",name:"symbol_",type:"string"},{internalType:"string",name:"baseURI_",type:"string"},{internalType:"string",name:"contractURI_",type:"string"},{internalType:"address",name:"_operatorAllowlist",type:"address"},{internalType:"address",name:"_receiver",type:"address"},{internalType:"uint96",name:"_feeNumerator",type:"uint96"}],stateMutability:"nonpayable",type:"constructor"},{inputs:[],name:"AllowlistDoesNotImplementIOperatorAllowlist",type:"error"},{inputs:[{internalType:"address",name:"target",type:"address"}],name:"ApproveTargetNotInAllowlist",type:"error"},{inputs:[{internalType:"address",name:"approver",type:"address"}],name:"ApproverNotInAllowlist",type:"error"},{inputs:[{internalType:"address",name:"caller",type:"address"}],name:"CallerNotInAllowlist",type:"error"},{inputs:[{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"IImmutableERC721IDAboveThreshold",type:"error"},{inputs:[{internalType:"uint256",name:"tokenId",type:"uint256"},{internalType:"address",name:"currentOwner",type:"address"}],name:"IImmutableERC721MismatchedTokenOwner",type:"error"},{inputs:[],name:"IImmutableERC721MismatchedTransferLengths",type:"error"},{inputs:[{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"IImmutableERC721NotOwnerOrOperator",type:"error"},{inputs:[],name:"IImmutableERC721SendingToZerothAddress",type:"error"},{inputs:[{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"IImmutableERC721TokenAlreadyBurned",type:"error"},{inputs:[],name:"InvalidShortString",type:"error"},{inputs:[],name:"InvalidSignature",type:"error"},{inputs:[],name:"PermitExpired",type:"error"},{inputs:[],name:"SignerCannotBeZerothAddress",type:"error"},{inputs:[{internalType:"string",name:"str",type:"string"}],name:"StringTooLong",type:"error"},{inputs:[{internalType:"address",name:"from",type:"address"}],name:"TransferFromNotInAllowlist",type:"error"},{inputs:[{internalType:"address",name:"to",type:"address"}],name:"TransferToNotInAllowlist",type:"error"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"owner",type:"address"},{indexed:!0,internalType:"address",name:"approved",type:"address"},{indexed:!0,internalType:"uint256",name:"tokenId",type:"uint256"}],name:"Approval",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"owner",type:"address"},{indexed:!0,internalType:"address",name:"operator",type:"address"},{indexed:!1,internalType:"bool",name:"approved",type:"bool"}],name:"ApprovalForAll",type:"event"},{anonymous:!1,inputs:[],name:"EIP712DomainChanged",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"address",name:"oldRegistry",type:"address"},{indexed:!1,internalType:"address",name:"newRegistry",type:"address"}],name:"OperatorAllowlistRegistryUpdated",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"role",type:"bytes32"},{indexed:!0,internalType:"bytes32",name:"previousAdminRole",type:"bytes32"},{indexed:!0,internalType:"bytes32",name:"newAdminRole",type:"bytes32"}],name:"RoleAdminChanged",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"role",type:"bytes32"},{indexed:!0,internalType:"address",name:"account",type:"address"},{indexed:!0,internalType:"address",name:"sender",type:"address"}],name:"RoleGranted",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"role",type:"bytes32"},{indexed:!0,internalType:"address",name:"account",type:"address"},{indexed:!0,internalType:"address",name:"sender",type:"address"}],name:"RoleRevoked",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"from",type:"address"},{indexed:!0,internalType:"address",name:"to",type:"address"},{indexed:!0,internalType:"uint256",name:"tokenId",type:"uint256"}],name:"Transfer",type:"event"},{inputs:[],name:"DEFAULT_ADMIN_ROLE",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[],name:"DOMAIN_SEPARATOR",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[],name:"MINTER_ROLE",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[{components:[{internalType:"address",name:"owner",type:"address"},{internalType:"uint256[]",name:"tokenIds",type:"uint256[]"}],internalType:"struct ImmutableERC721Base.IDBurn[]",name:"burns",type:"tuple[]"}],name:"_safeBurnBatch",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"_totalSupply",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"approve",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"owner",type:"address"}],name:"balanceOf",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"baseURI",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"burn",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256[]",name:"tokenIDs",type:"uint256[]"}],name:"burnBatch",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"contractURI",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[],name:"eip712Domain",outputs:[{internalType:"bytes1",name:"fields",type:"bytes1"},{internalType:"string",name:"name",type:"string"},{internalType:"string",name:"version",type:"string"},{internalType:"uint256",name:"chainId",type:"uint256"},{internalType:"address",name:"verifyingContract",type:"address"},{internalType:"bytes32",name:"salt",type:"bytes32"},{internalType:"uint256[]",name:"extensions",type:"uint256[]"}],stateMutability:"view",type:"function"},{inputs:[],name:"getAdmins",outputs:[{internalType:"address[]",name:"",type:"address[]"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"getApproved",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"role",type:"bytes32"}],name:"getRoleAdmin",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"role",type:"bytes32"},{internalType:"uint256",name:"index",type:"uint256"}],name:"getRoleMember",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"role",type:"bytes32"}],name:"getRoleMemberCount",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"user",type:"address"}],name:"grantMinterRole",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes32",name:"role",type:"bytes32"},{internalType:"address",name:"account",type:"address"}],name:"grantRole",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes32",name:"role",type:"bytes32"},{internalType:"address",name:"account",type:"address"}],name:"hasRole",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"owner",type:"address"},{internalType:"address",name:"operator",type:"address"}],name:"isApprovedForAll",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"tokenID",type:"uint256"}],name:"mint",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{components:[{internalType:"address",name:"to",type:"address"},{internalType:"uint256[]",name:"tokenIds",type:"uint256[]"}],internalType:"struct ImmutableERC721Base.IDMint[]",name:"mintRequests",type:"tuple[]"}],name:"mintBatch",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"name",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"nonces",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"operatorAllowlist",outputs:[{internalType:"contract IOperatorAllowlist",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"ownerOf",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"spender",type:"address"},{internalType:"uint256",name:"tokenId",type:"uint256"},{internalType:"uint256",name:"deadline",type:"uint256"},{internalType:"bytes",name:"sig",type:"bytes"}],name:"permit",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes32",name:"role",type:"bytes32"},{internalType:"address",name:"account",type:"address"}],name:"renounceRole",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"user",type:"address"}],name:"revokeMinterRole",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes32",name:"role",type:"bytes32"},{internalType:"address",name:"account",type:"address"}],name:"revokeRole",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"tokenId",type:"uint256"},{internalType:"uint256",name:"salePrice",type:"uint256"}],name:"royaltyInfo",outputs:[{internalType:"address",name:"",type:"address"},{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"owner",type:"address"},{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"safeBurn",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{components:[{internalType:"address",name:"owner",type:"address"},{internalType:"uint256[]",name:"tokenIds",type:"uint256[]"}],internalType:"struct ImmutableERC721Base.IDBurn[]",name:"burns",type:"tuple[]"}],name:"safeBurnBatch",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"tokenID",type:"uint256"}],name:"safeMint",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{components:[{internalType:"address",name:"to",type:"address"},{internalType:"uint256[]",name:"tokenIds",type:"uint256[]"}],internalType:"struct ImmutableERC721Base.IDMint[]",name:"mintRequests",type:"tuple[]"}],name:"safeMintBatch",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"safeTransferFrom",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"tokenId",type:"uint256"},{internalType:"bytes",name:"data",type:"bytes"}],name:"safeTransferFrom",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{components:[{internalType:"address",name:"from",type:"address"},{internalType:"address[]",name:"tos",type:"address[]"},{internalType:"uint256[]",name:"tokenIds",type:"uint256[]"}],internalType:"struct ImmutableERC721Base.TransferRequest",name:"tr",type:"tuple"}],name:"safeTransferFromBatch",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"operator",type:"address"},{internalType:"bool",name:"approved",type:"bool"}],name:"setApprovalForAll",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"string",name:"baseURI_",type:"string"}],name:"setBaseURI",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"string",name:"_contractURI",type:"string"}],name:"setContractURI",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"receiver",type:"address"},{internalType:"uint96",name:"feeNumerator",type:"uint96"}],name:"setDefaultRoyaltyReceiver",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"tokenId",type:"uint256"},{internalType:"address",name:"receiver",type:"address"},{internalType:"uint96",name:"feeNumerator",type:"uint96"}],name:"setNFTRoyaltyReceiver",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256[]",name:"tokenIds",type:"uint256[]"},{internalType:"address",name:"receiver",type:"address"},{internalType:"uint96",name:"feeNumerator",type:"uint96"}],name:"setNFTRoyaltyReceiverBatch",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"_operatorAllowlist",type:"address"}],name:"setOperatorAllowlistRegistry",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes4",name:"interfaceId",type:"bytes4"}],name:"supportsInterface",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[],name:"symbol",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"tokenURI",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[],name:"totalSupply",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"transferFrom",outputs:[],stateMutability:"nonpayable",type:"function"}],u4="0x6101606040523480156200001257600080fd5b5060405162004b3738038062004b37833981016040819052620000359162000693565b8787878787878787868681604051806040016040528060018152602001603160f81b815250838381600390816200006d919062000826565b5060046200007c828262000826565b5050506200009a600983620001a960201b620014771790919060201c565b61012052620000b781600a620001a9602090811b6200147717901c565b61014052815160208084019190912060e052815190820120610100524660a0526200014560e05161010051604080517f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f60208201529081019290925260608201524660808201523060a082015260009060c00160405160208183030381529060405280519060200120905090565b60805250503060c052506200015e9050600089620001f9565b6200016a82826200023c565b620001758362000341565b600f62000183868262000826565b50600e62000192858262000826565b505050505050505050505050505050505062000970565b6000602083511015620001c957620001c1836200043a565b9050620001f3565b82620001e0836200047d60201b620014a81760201c565b90620001ed908262000826565b5060ff90505b92915050565b6200021082826200048060201b620014ab1760201c565b6000828152600160209081526040909120620002379183906200152f62000521821b17901c565b505050565b6127106001600160601b0382161115620002b05760405162461bcd60e51b815260206004820152602a60248201527f455243323938313a20726f79616c7479206665652077696c6c206578636565646044820152692073616c65507269636560b01b60648201526084015b60405180910390fd5b6001600160a01b038216620003085760405162461bcd60e51b815260206004820152601960248201527f455243323938313a20696e76616c6964207265636569766572000000000000006044820152606401620002a7565b604080518082019091526001600160a01b039092168083526001600160601b039091166020909201829052600160a01b90910217600c55565b6040516301ffc9a760e01b81526305a3b80960e01b60048201526001600160a01b038216906301ffc9a790602401602060405180830381865afa1580156200038d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620003b39190620008f2565b620003d15760405163d6f93fb760e01b815260040160405180910390fd5b600254604080516001600160a01b03928316815291831660208301527f3edc37a14cc8047c7c8a3f354311efe86c14848efd4e3765a3e1e57eea04ea76910160405180910390a1600280546001600160a01b0319166001600160a01b0392909216919091179055565b600080829050601f8151111562000468578260405163305a27a960e01b8152600401620002a7919062000916565b805162000475826200094b565b179392505050565b90565b6000828152602081815260408083206001600160a01b038516845290915290205460ff166200051d576000828152602081815260408083206001600160a01b03851684529091529020805460ff19166001179055620004dc3390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45b5050565b600062000538836001600160a01b0384166200053f565b9392505050565b60008181526001830160205260408120546200058857508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155620001f3565b506000620001f3565b80516001600160a01b0381168114620005a957600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60005b83811015620005e1578181015183820152602001620005c7565b50506000910152565b600082601f830112620005fc57600080fd5b81516001600160401b0380821115620006195762000619620005ae565b604051601f8301601f19908116603f01168101908282118183101715620006445762000644620005ae565b816040528381528660208588010111156200065e57600080fd5b62000671846020830160208901620005c4565b9695505050505050565b80516001600160601b0381168114620005a957600080fd5b600080600080600080600080610100898b031215620006b157600080fd5b620006bc8962000591565b60208a01519098506001600160401b0380821115620006da57600080fd5b620006e88c838d01620005ea565b985060408b0151915080821115620006ff57600080fd5b6200070d8c838d01620005ea565b975060608b01519150808211156200072457600080fd5b620007328c838d01620005ea565b965060808b01519150808211156200074957600080fd5b50620007588b828c01620005ea565b9450506200076960a08a0162000591565b92506200077960c08a0162000591565b91506200078960e08a016200067b565b90509295985092959890939650565b600181811c90821680620007ad57607f821691505b602082108103620007ce57634e487b7160e01b600052602260045260246000fd5b50919050565b601f8211156200023757600081815260208120601f850160051c81016020861015620007fd5750805b601f850160051c820191505b818110156200081e5782815560010162000809565b505050505050565b81516001600160401b03811115620008425762000842620005ae565b6200085a8162000853845462000798565b84620007d4565b602080601f831160018114620008925760008415620008795750858301515b600019600386901b1c1916600185901b1785556200081e565b600085815260208120601f198616915b82811015620008c357888601518255948401946001909101908401620008a2565b5085821015620008e25787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b6000602082840312156200090557600080fd5b815180151581146200053857600080fd5b602081526000825180602084015262000937816040850160208701620005c4565b601f01601f19169190910160400192915050565b80516020808301519190811015620007ce5760001960209190910360031b1b16919050565b60805160a05160c05160e05161010051610120516101405161416c620009cb6000396000610fdc01526000610fb101526000611b3401526000611b0c01526000611a6701526000611a9101526000611abb015261416c6000f3fe608060405234801561001057600080fd5b50600436106102f05760003560e01c806369e2f0fb1161019d578063a1448194116100e9578063ca15c873116100a2578063e4623c1b1161007c578063e4623c1b146106b8578063e4e18f6d146106cb578063e8a3d485146106de578063e985e9c5146106e657600080fd5b8063ca15c8731461067d578063d539139314610690578063d547741f146106a557600080fd5b8063a144819414610616578063a217fddf14610629578063a22cb46514610631578063a701281614610644578063b88d4fde14610657578063c87b56dd1461066a57600080fd5b8063885e7a0811610156578063938e3d7b11610130578063938e3d7b146105d557806395d89b41146105e85780639e2641a3146105f05780639f15d7001461060357600080fd5b8063885e7a081461059c5780639010d07c146105af57806391d14854146105c257600080fd5b806369e2f0fb1461052d5780636c0360eb1461054057806370a0823114610548578063745a41bc1461055b57806374f16a811461056e57806384b0196e1461058157600080fd5b80632f2ff15d1161025c5780633eaaf86b1161021557806342966c68116101ef57806342966c68146104e1578063439aed34146104f457806355f804b3146105075780636352211e1461051a57600080fd5b80633eaaf86b146104b257806340c10f19146104bb57806342842e0e146104ce57600080fd5b80632f2ff15d1461044957806331ae450b1461045c5780633644e5151461047157806336568abe146104795780633dd1eb611461048c5780633e769acd1461049f57600080fd5b806318160ddd116102ae57806318160ddd146103b3578063234af046146103bb57806323b872dd146103ce578063248a9ca3146103e157806329326f29146104045780632a55205a1461041757600080fd5b80628ad946146102f557806301ffc9a71461030a57806306fdde0314610332578063081812fc14610347578063095ea7b314610372578063141a468c14610385575b600080fd5b610308610303366004613441565b610722565b005b61031d610318366004613491565b6107f8565b60405190151581526020015b60405180910390f35b61033a610809565b60405161032991906134fe565b61035a610355366004613511565b61089b565b6040516001600160a01b039091168152602001610329565b610308610380366004613546565b6108c2565b6103a5610393366004613511565b6000908152600b602052604090205490565b604051908152602001610329565b6010546103a5565b6103086103c9366004613712565b6109dc565b6103086103dc36600461375a565b610a34565b6103a56103ef366004613511565b60009081526020819052604090206001015490565b60025461035a906001600160a01b031681565b61042a610425366004613796565b610a66565b604080516001600160a01b039093168352602083019190915201610329565b6103086104573660046137b8565b610b14565b610464610b39565b60405161032991906137e4565b6103a5610be7565b6103086104873660046137b8565b610bf6565b61030861049a366004613831565b610c70565b6103086104ad366004613712565b610c93565b6103a560105481565b6103086104c9366004613546565b610d1f565b6103086104dc36600461375a565b610d5b565b6103086104ef366004613511565b610d76565b610308610502366004613863565b610db4565b6103086105153660046138f6565b610ddd565b61035a610528366004613511565b610df4565b61030861053b366004613831565b610e54565b61033a610e77565b6103a5610556366004613831565b610f05565b61030861056936600461395e565b610f8b565b61030861057c366004613712565b610f97565b610589610fa3565b60405161032997969594939291906139be565b6103086105aa366004613a54565b61102c565b61035a6105bd366004613796565b611041565b61031d6105d03660046137b8565b611060565b6103086105e33660046138f6565b611089565b61033a6110a0565b6103086105fe366004613712565b6110af565b610308610611366004613546565b611107565b610308610624366004613546565b611161565b6103a5600081565b61030861063f366004613a8c565b611193565b610308610652366004613b07565b6112e4565b610308610665366004613b6b565b611344565b61033a610678366004613511565b611376565b6103a561068b366004613511565b6113dc565b6103a56a4d494e5445525f524f4c4560a81b81565b6103086106b33660046137b8565b6113f3565b6103086106c6366004613bba565b611418565b6103086106d9366004613831565b611456565b61033a61146a565b61031d6106f4366004613bfb565b6001600160a01b03918216600090815260086020908152604080832093909416825291909152205460ff1690565b61072f6020820182613c25565b905061073e6040830183613c25565b90501461075e5760405163359a1bc360e01b815260040160405180910390fd5b60005b61076e6040830183613c25565b90508110156107f4576107e26107876020840184613831565b6107946020850185613c25565b848181106107a4576107a4613c6e565b90506020020160208101906107b99190613831565b6107c66040860186613c25565b858181106107d6576107d6613c6e565b90506020020135610d5b565b806107ec81613c9a565b915050610761565b5050565b600061080382611544565b92915050565b60606003805461081890613cb3565b80601f016020809104026020016040519081016040528092919081815260200182805461084490613cb3565b80156108915780601f1061086657610100808354040283529160200191610891565b820191906000526020600020905b81548152906001019060200180831161087457829003601f168201915b5050505050905090565b60006108a682611569565b506000908152600760205260409020546001600160a01b031690565b60006108cd82610df4565b9050806001600160a01b0316836001600160a01b03160361093f5760405162461bcd60e51b815260206004820152602160248201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e656044820152603960f91b60648201526084015b60405180910390fd5b336001600160a01b038216148061095b575061095b81336106f4565b6109cd5760405162461bcd60e51b815260206004820152603d60248201527f4552433732313a20617070726f76652063616c6c6572206973206e6f7420746f60448201527f6b656e206f776e6572206f7220617070726f76656420666f7220616c6c0000006064820152608401610936565b6109d783836115c8565b505050565b6a4d494e5445525f524f4c4560a81b6109f481611719565b60005b82518110156109d757610a22838281518110610a1557610a15613c6e565b6020026020010151611723565b80610a2c81613c9a565b9150506109f7565b610a3f335b826117b2565b610a5b5760405162461bcd60e51b815260040161093690613ced565b6109d7838383611831565b6000828152600d602090815260408083208151808301909252546001600160a01b038116808352600160a01b9091046001600160601b0316928201929092528291610adb575060408051808201909152600c546001600160a01b0381168252600160a01b90046001600160601b031660208201525b602081015160009061271090610afa906001600160601b031687613d3a565b610b049190613d51565b91519350909150505b9250929050565b600082815260208190526040902060010154610b2f81611719565b6109d78383611a38565b60606000610b46816113dc565b90506000816001600160401b03811115610b6257610b62613570565b604051908082528060200260200182016040528015610b8b578160200160208202803683370190505b50905060005b82811015610be057610ba4600082611041565b828281518110610bb657610bb6613c6e565b6001600160a01b039092166020928302919091019091015280610bd881613c9a565b915050610b91565b5092915050565b6000610bf1611a5a565b905090565b6001600160a01b0381163314610c665760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b6064820152608401610936565b6107f48282611b85565b6000610c7b81611719565b6107f46a4d494e5445525f524f4c4560a81b83610b14565b60005b81518110156107f4576000828281518110610cb357610cb3613c6e565b6020026020010151905060005b816020015151811015610d0a57610cf8826000015183602001518381518110610ceb57610ceb613c6e565b6020026020010151611107565b80610d0281613c9a565b915050610cc0565b50508080610d1790613c9a565b915050610c96565b6a4d494e5445525f524f4c4560a81b610d3781611719565b610d418383611ba7565b60108054906000610d5183613c9a565b9190505550505050565b6109d783838360405180602001604052806000815250611344565b610d7f81611bee565b600881901c60009081526011602052604081208054600160ff85161b1790556010805491610dac83613d73565b919050555050565b6a4d494e5445525f524f4c4560a81b610dcc81611719565b610dd7848484611c1c565b50505050565b6000610de881611719565b600f6109d78382613dd0565b6000818152600560205260408120546001600160a01b0316806108035760405162461bcd60e51b8152602060048201526018602482015277115490cdcc8c4e881a5b9d985b1a59081d1bdad95b88125160421b6044820152606401610936565b6000610e5f81611719565b6107f46a4d494e5445525f524f4c4560a81b836113f3565b600f8054610e8490613cb3565b80601f0160208091040260200160405190810160405280929190818152602001828054610eb090613cb3565b8015610efd5780601f10610ed257610100808354040283529160200191610efd565b820191906000526020600020905b815481529060010190602001808311610ee057829003601f168201915b505050505081565b60006001600160a01b038216610f6f5760405162461bcd60e51b815260206004820152602960248201527f4552433732313a2061646472657373207a65726f206973206e6f7420612076616044820152683634b21037bbb732b960b91b6064820152608401610936565b506001600160a01b031660009081526006602052604090205490565b610dd784848484611ce7565b610fa081610c93565b50565b600060608082808083610fd77f00000000000000000000000000000000000000000000000000000000000000006009611dd0565b6110027f0000000000000000000000000000000000000000000000000000000000000000600a611dd0565b60408051600080825260208201909252600f60f81b9b939a50919850469750309650945092509050565b600061103781611719565b6109d78383611e74565b60008281526001602052604081206110599083611f2e565b9392505050565b6000918252602082815260408084206001600160a01b0393909316845291905290205460ff1690565b600061109481611719565b600e6109d78382613dd0565b60606004805461081890613cb3565b6a4d494e5445525f524f4c4560a81b6110c781611719565b60005b82518110156109d7576110f58382815181106110e8576110e8613c6e565b6020026020010151611f3a565b806110ff81613c9a565b9150506110ca565b600061111282610df4565b9050826001600160a01b0316816001600160a01b03161461115857604051634fefd56160e01b8152600481018390526001600160a01b0382166024820152604401610936565b6109d782610d76565b6a4d494e5445525f524f4c4560a81b61117981611719565b610d41838360405180602001604052806000815250611fb0565b81333b1580159061120d57506002546040516305a3b80960e01b81523360048201526001600160a01b03909116906305a3b80990602401602060405180830381865afa1580156111e7573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061120b9190613e8f565b155b1561122d5760405163f6fa4cbd60e01b8152336004820152602401610936565b6001600160a01b0381163b158015906112b157506002546040516305a3b80960e01b81526001600160a01b038381166004830152909116906305a3b80990602401602060405180830381865afa15801561128b573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112af9190613e8f565b155b156112da576040516341b8d58160e11b81526001600160a01b0382166004820152602401610936565b6109d78383611fe3565b6a4d494e5445525f524f4c4560a81b6112fc81611719565b60005b8481101561133c5761132a86868381811061131c5761131c613c6e565b905060200201358585611c1c565b8061133481613c9a565b9150506112ff565b505050505050565b61134e33836117b2565b61136a5760405162461bcd60e51b815260040161093690613ced565b610dd784848484611fee565b606061138182611569565b600061138b612021565b905060008151116113ab5760405180602001604052806000815250611059565b806113b584612030565b6040516020016113c6929190613eac565b6040516020818303038152906040529392505050565b6000818152600160205260408120610803906120c2565b60008281526020819052604090206001015461140e81611719565b6109d78383611b85565b60005b818110156109d75761144483838381811061143857611438613c6e565b90506020020135610d76565b8061144e81613c9a565b91505061141b565b600061146181611719565b6107f4826120cc565b600e8054610e8490613cb3565b60006020835110156114935761148c836121c1565b9050610803565b8161149e8482613dd0565b5060ff9050610803565b90565b6114b58282611060565b6107f4576000828152602081815260408083206001600160a01b03851684529091529020805460ff191660011790556114eb3390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b6000611059836001600160a01b0384166121ff565b60006001600160e01b0319821663152a902d60e11b148061080357506108038261224e565b6000818152600560205260409020546001600160a01b0316610fa05760405162461bcd60e51b8152602060048201526018602482015277115490cdcc8c4e881a5b9d985b1a59081d1bdad95b88125160421b6044820152606401610936565b81333b1580159061164257506002546040516305a3b80960e01b81523360048201526001600160a01b03909116906305a3b80990602401602060405180830381865afa15801561161c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116409190613e8f565b155b156116625760405163f6fa4cbd60e01b8152336004820152602401610936565b6001600160a01b0381163b158015906116e657506002546040516305a3b80960e01b81526001600160a01b038381166004830152909116906305a3b80990602401602060405180830381865afa1580156116c0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116e49190613e8f565b155b1561170f576040516341b8d58160e11b81526001600160a01b0382166004820152602401610936565b6109d78383612273565b610fa081336122e1565b80516001600160a01b031661174b576040516331c3e52960e11b815260040160405180910390fd5b60005b8160200151518110156117985761178682600001518360200151838151811061177957611779613c6e565b602002602001015161233a565b8061179081613c9a565b91505061174e565b508060200151516010546117ac9190613edb565b60105550565b6000806117be83610df4565b9050806001600160a01b0316846001600160a01b0316148061180557506001600160a01b0380821660009081526008602090815260408083209388168352929052205460ff165b806118295750836001600160a01b031661181e8461089b565b6001600160a01b0316145b949350505050565b82823332148015906118ac57506002546040516305a3b80960e01b81523360048201526001600160a01b03909116906305a3b80990602401602060405180830381865afa158015611886573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118aa9190613e8f565b155b156118cc5760405163937db65f60e01b8152336004820152602401610936565b6001600160a01b0382163b1580159061195057506002546040516305a3b80960e01b81526001600160a01b038481166004830152909116906305a3b80990602401602060405180830381865afa15801561192a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061194e9190613e8f565b155b156119795760405163f934453160e01b81526001600160a01b0383166004820152602401610936565b6001600160a01b0381163b158015906119fd57506002546040516305a3b80960e01b81526001600160a01b038381166004830152909116906305a3b80990602401602060405180830381865afa1580156119d7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906119fb9190613e8f565b155b15611a2657604051632a67242160e11b81526001600160a01b0382166004820152602401610936565b611a31858585612381565b5050505050565b611a4282826114ab565b60008281526001602052604090206109d7908261152f565b6000306001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016148015611ab357507f000000000000000000000000000000000000000000000000000000000000000046145b15611add57507f000000000000000000000000000000000000000000000000000000000000000090565b610bf1604080517f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f60208201527f0000000000000000000000000000000000000000000000000000000000000000918101919091527f000000000000000000000000000000000000000000000000000000000000000060608201524660808201523060a082015260009060c00160405160208183030381529060405280519060200120905090565b611b8f82826123ab565b60008281526001602052604090206109d79082612410565b600881901c600090815260116020526040902054600160ff83161b1615611be4576040516305dcda1160e51b815260048101829052602401610936565b6107f48282612425565b611bf733610a39565b611c135760405162461bcd60e51b815260040161093690613ced565b610fa0816125b0565b6127106001600160601b0382161115611c475760405162461bcd60e51b815260040161093690613eee565b6001600160a01b038216611c9d5760405162461bcd60e51b815260206004820152601b60248201527f455243323938313a20496e76616c696420706172616d657465727300000000006044820152606401610936565b6040805180820182526001600160a01b0393841681526001600160601b0392831660208083019182526000968752600d90529190942093519051909116600160a01b029116179055565b42821015611d085760405163068568f360e21b815260040160405180910390fd5b6000611d15858585612645565b9050611d2a611d2385610df4565b828461271e565b15611d3f57611d3985856115c8565b50610dd7565b60008251604003611d8657611d7f82611d5b8560006020612828565b611d6490613f38565b611d718660206040612828565b611d7a90613f38565b612935565b9050611db2565b8251604103611d9957611d7f8284612952565b604051638baa579f60e01b815260040160405180910390fd5b611dbc8186612976565b15611d9957611dcb86866115c8565b61133c565b606060ff8314611de35761148c83612995565b818054611def90613cb3565b80601f0160208091040260200160405190810160405280929190818152602001828054611e1b90613cb3565b8015611e685780601f10611e3d57610100808354040283529160200191611e68565b820191906000526020600020905b815481529060010190602001808311611e4b57829003601f168201915b50505050509050610803565b6127106001600160601b0382161115611e9f5760405162461bcd60e51b815260040161093690613eee565b6001600160a01b038216611ef55760405162461bcd60e51b815260206004820152601960248201527f455243323938313a20696e76616c6964207265636569766572000000000000006044820152606401610936565b604080518082019091526001600160a01b039092168083526001600160601b039091166020909201829052600160a01b90910217600c55565b600061105983836129d4565b80516001600160a01b031615611f63576040516331c3e52960e11b815260040160405180910390fd5b60005b81602001515181101561179857611f9e826000015183602001518381518110611f9157611f91613c6e565b6020026020010151611ba7565b80611fa881613c9a565b915050611f66565b611fba8383611ba7565b611fc760008484846129fe565b6109d75760405162461bcd60e51b815260040161093690613f5c565b6107f4338383612aff565b611ff9848484611831565b612005848484846129fe565b610dd75760405162461bcd60e51b815260040161093690613f5c565b6060600f805461081890613cb3565b6060600061203d83612bcd565b60010190506000816001600160401b0381111561205c5761205c613570565b6040519080825280601f01601f191660200182016040528015612086576020820181803683370190505b5090508181016020015b600019016f181899199a1a9b1b9c1cb0b131b232b360811b600a86061a8153600a850494508461209057509392505050565b6000610803825490565b6040516301ffc9a760e01b81526305a3b80960e01b60048201526001600160a01b038216906301ffc9a790602401602060405180830381865afa158015612117573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061213b9190613e8f565b6121585760405163d6f93fb760e01b815260040160405180910390fd5b600254604080516001600160a01b03928316815291831660208301527f3edc37a14cc8047c7c8a3f354311efe86c14848efd4e3765a3e1e57eea04ea76910160405180910390a1600280546001600160a01b0319166001600160a01b0392909216919091179055565b600080829050601f815111156121ec578260405163305a27a960e01b815260040161093691906134fe565b80516121f782613f38565b179392505050565b600081815260018301602052604081205461224657508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155610803565b506000610803565b60006001600160e01b03198216635604e22560e01b1480610803575061080382612ca5565b600081815260076020526040902080546001600160a01b0319166001600160a01b03841690811790915581906122a882610df4565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b6122eb8282611060565b6107f4576122f881612ce5565b612303836020612cf7565b604051602001612314929190613fae565b60408051601f198184030181529082905262461bcd60e51b8252610936916004016134fe565b600881901c600090815260116020526040902054600160ff83161b1615612377576040516305dcda1160e51b815260048101829052602401610936565b6107f48282612e92565b6000818152600b6020526040812080549161239b83613c9a565b91905055506109d7838383612eac565b6123b58282611060565b156107f4576000828152602081815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b6000611059836001600160a01b038416613010565b6001600160a01b03821661247b5760405162461bcd60e51b815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f20616464726573736044820152606401610936565b6000818152600560205260409020546001600160a01b0316156124e05760405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e746564000000006044820152606401610936565b6000818152600560205260409020546001600160a01b0316156125455760405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e746564000000006044820152606401610936565b6001600160a01b038216600081815260066020908152604080832080546001019055848352600590915280822080546001600160a01b0319168417905551839291907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a45050565b60006125bb82610df4565b90506125c682610df4565b600083815260076020908152604080832080546001600160a01b03199081169091556001600160a01b0385168085526006845282852080546000190190558785526005909352818420805490911690555192935084927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908390a45050565b60006118296040516020016126b390660a0cae4dad2e8560cb1b81527f61646472657373207370656e6465722c75696e7432353620746f6b656e49642c60078201527f75696e74323536206e6f6e63652c75696e7432353620646561646c696e652900602782015260460190565b60408051808303601f1901815282825280516020918201206000888152600b835283902054918401526001600160a01b0388169183019190915260608201869052608082015260a0810184905260c00160405160208183030381529060405280519060200120613103565b6000806000856001600160a01b0316631626ba7e60e01b8686604051602401612748929190614023565b60408051601f198184030181529181526020820180516001600160e01b03166001600160e01b0319909416939093179092529051612786919061403c565b600060405180830381855afa9150503d80600081146127c1576040519150601f19603f3d011682016040523d82523d6000602084013e6127c6565b606091505b50915091508180156127d9575080516020145b1561281c576000818060200190518101906127f49190614058565b90506374eca2c160e11b6001600160e01b031982160161281a5760019350505050611059565b505b50600095945050505050565b60608161283681601f613edb565b10156128755760405162461bcd60e51b815260206004820152600e60248201526d736c6963655f6f766572666c6f7760901b6044820152606401610936565b61287f8284613edb565b845110156128c35760405162461bcd60e51b8152602060048201526011602482015270736c6963655f6f75744f66426f756e647360781b6044820152606401610936565b6060821580156128e2576040519150600082526020820160405261292c565b6040519150601f8416801560200281840101858101878315602002848b0101015b8183101561291b578051835260209283019201612903565b5050858452601f01601f1916604052505b50949350505050565b6000806000612945868686613130565b9150915061292c81613169565b600080600061296185856132b3565b9150915061296e81613169565b509392505050565b60006001600160a01b03831615801590611059575061105983836117b2565b606060006129a2836132f5565b604080516020808252818301909252919250600091906020820181803683375050509182525060208101929092525090565b60008260000182815481106129eb576129eb613c6e565b9060005260206000200154905092915050565b60006001600160a01b0384163b15612af457604051630a85bd0160e11b81526001600160a01b0385169063150b7a0290612a42903390899088908890600401614075565b6020604051808303816000875af1925050508015612a7d575060408051601f3d908101601f19168201909252612a7a91810190614058565b60015b612ada573d808015612aab576040519150601f19603f3d011682016040523d82523d6000602084013e612ab0565b606091505b508051600003612ad25760405162461bcd60e51b815260040161093690613f5c565b805181602001fd5b6001600160e01b031916630a85bd0160e11b149050611829565b506001949350505050565b816001600160a01b0316836001600160a01b031603612b605760405162461bcd60e51b815260206004820152601960248201527f4552433732313a20617070726f766520746f2063616c6c6572000000000000006044820152606401610936565b6001600160a01b03838116600081815260086020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b60008072184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b8310612c0c5772184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b830492506040015b6d04ee2d6d415b85acef81000000008310612c38576d04ee2d6d415b85acef8100000000830492506020015b662386f26fc100008310612c5657662386f26fc10000830492506010015b6305f5e1008310612c6e576305f5e100830492506008015b6127108310612c8257612710830492506004015b60648310612c94576064830492506002015b600a83106108035760010192915050565b60006001600160e01b031982166380ac58cd60e01b1480612cd657506001600160e01b03198216635b5e139f60e01b145b8061080357506108038261331d565b60606108036001600160a01b03831660145b60606000612d06836002613d3a565b612d11906002613edb565b6001600160401b03811115612d2857612d28613570565b6040519080825280601f01601f191660200182016040528015612d52576020820181803683370190505b509050600360fc1b81600081518110612d6d57612d6d613c6e565b60200101906001600160f81b031916908160001a905350600f60fb1b81600181518110612d9c57612d9c613c6e565b60200101906001600160f81b031916908160001a9053506000612dc0846002613d3a565b612dcb906001613edb565b90505b6001811115612e43576f181899199a1a9b1b9c1cb0b131b232b360811b85600f1660108110612dff57612dff613c6e565b1a60f81b828281518110612e1557612e15613c6e565b60200101906001600160f81b031916908160001a90535060049490941c93612e3c81613d73565b9050612dce565b5083156110595760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152606401610936565b6107f4828260405180602001604052806000815250611fb0565b826001600160a01b0316612ebf82610df4565b6001600160a01b031614612ee55760405162461bcd60e51b8152600401610936906140b2565b6001600160a01b038216612f475760405162461bcd60e51b8152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f206164646044820152637265737360e01b6064820152608401610936565b826001600160a01b0316612f5a82610df4565b6001600160a01b031614612f805760405162461bcd60e51b8152600401610936906140b2565b600081815260076020908152604080832080546001600160a01b03199081169091556001600160a01b0387811680865260068552838620805460001901905590871680865283862080546001019055868652600590945282852080549092168417909155905184937fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4505050565b600081815260018301602052604081205480156130f95760006130346001836140f7565b8554909150600090613048906001906140f7565b90508181146130ad57600086600001828154811061306857613068613c6e565b906000526020600020015490508087600001848154811061308b5761308b613c6e565b6000918252602080832090910192909255918252600188019052604090208390555b85548690806130be576130be61410a565b600190038181906000526020600020016000905590558560010160008681526020019081526020016000206000905560019350505050610803565b6000915050610803565b6000610803613110611a5a565b8360405161190160f01b8152600281019290925260228201526042902090565b6000806001600160ff1b0383168161314d60ff86901c601b613edb565b905061315b87828885613328565b935093505050935093915050565b600081600481111561317d5761317d614120565b036131855750565b600181600481111561319957613199614120565b036131e65760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e617475726500000000000000006044820152606401610936565b60028160048111156131fa576131fa614120565b036132475760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152606401610936565b600381600481111561325b5761325b614120565b03610fa05760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c604482015261756560f01b6064820152608401610936565b60008082516041036132e95760208301516040840151606085015160001a6132dd87828585613328565b94509450505050610b0d565b50600090506002610b0d565b600060ff8216601f81111561080357604051632cd44ac360e21b815260040160405180910390fd5b6000610803826133ec565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a083111561335f57506000905060036133e3565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa1580156133b3573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b0381166133dc576000600192509250506133e3565b9150600090505b94509492505050565b60006001600160e01b03198216635a05180f60e01b148061080357506108038260006001600160e01b03198216637965db0b60e01b148061080357506301ffc9a760e01b6001600160e01b0319831614610803565b60006020828403121561345357600080fd5b81356001600160401b0381111561346957600080fd5b82016060818503121561105957600080fd5b6001600160e01b031981168114610fa057600080fd5b6000602082840312156134a357600080fd5b81356110598161347b565b60005b838110156134c95781810151838201526020016134b1565b50506000910152565b600081518084526134ea8160208601602086016134ae565b601f01601f19169290920160200192915050565b60208152600061105960208301846134d2565b60006020828403121561352357600080fd5b5035919050565b80356001600160a01b038116811461354157600080fd5b919050565b6000806040838503121561355957600080fd5b6135628361352a565b946020939093013593505050565b634e487b7160e01b600052604160045260246000fd5b604080519081016001600160401b03811182821017156135a8576135a8613570565b60405290565b604051601f8201601f191681016001600160401b03811182821017156135d6576135d6613570565b604052919050565b60006001600160401b038211156135f7576135f7613570565b5060051b60200190565b600061361461360f846135de565b6135ae565b8381529050602080820190600585811b85018781111561363357600080fd5b855b818110156137065780356001600160401b03808211156136555760008081fd5b908801906040828c03121561366a5760008081fd5b613672613586565b61367b8361352a565b8152868301358281111561368f5760008081fd5b8084019350508b601f8401126136a757600091508182fd5b823591506136b761360f836135de565b82815291861b8301870191878101908d8411156136d45760008081fd5b938801935b838510156136f2578435825293880193908801906136d9565b828901525087525050938301938301613635565b50505050509392505050565b60006020828403121561372457600080fd5b81356001600160401b0381111561373a57600080fd5b8201601f8101841361374b57600080fd5b61182984823560208401613601565b60008060006060848603121561376f57600080fd5b6137788461352a565b92506137866020850161352a565b9150604084013590509250925092565b600080604083850312156137a957600080fd5b50508035926020909101359150565b600080604083850312156137cb57600080fd5b823591506137db6020840161352a565b90509250929050565b6020808252825182820181905260009190848201906040850190845b818110156138255783516001600160a01b031683529284019291840191600101613800565b50909695505050505050565b60006020828403121561384357600080fd5b6110598261352a565b80356001600160601b038116811461354157600080fd5b60008060006060848603121561387857600080fd5b833592506138886020850161352a565b91506138966040850161384c565b90509250925092565b60006001600160401b038311156138b8576138b8613570565b6138cb601f8401601f19166020016135ae565b90508281528383830111156138df57600080fd5b828260208301376000602084830101529392505050565b60006020828403121561390857600080fd5b81356001600160401b0381111561391e57600080fd5b8201601f8101841361392f57600080fd5b6118298482356020840161389f565b600082601f83011261394f57600080fd5b6110598383356020850161389f565b6000806000806080858703121561397457600080fd5b61397d8561352a565b9350602085013592506040850135915060608501356001600160401b038111156139a657600080fd5b6139b28782880161393e565b91505092959194509250565b60ff60f81b881681526000602060e0818401526139de60e084018a6134d2565b83810360408501526139f0818a6134d2565b606085018990526001600160a01b038816608086015260a0850187905284810360c0860152855180825283870192509083019060005b81811015613a4257835183529284019291840191600101613a26565b50909c9b505050505050505050505050565b60008060408385031215613a6757600080fd5b613a708361352a565b91506137db6020840161384c565b8015158114610fa057600080fd5b60008060408385031215613a9f57600080fd5b613aa88361352a565b91506020830135613ab881613a7e565b809150509250929050565b60008083601f840112613ad557600080fd5b5081356001600160401b03811115613aec57600080fd5b6020830191508360208260051b8501011115610b0d57600080fd5b60008060008060608587031215613b1d57600080fd5b84356001600160401b03811115613b3357600080fd5b613b3f87828801613ac3565b9095509350613b5290506020860161352a565b9150613b606040860161384c565b905092959194509250565b60008060008060808587031215613b8157600080fd5b613b8a8561352a565b9350613b986020860161352a565b92506040850135915060608501356001600160401b038111156139a657600080fd5b60008060208385031215613bcd57600080fd5b82356001600160401b03811115613be357600080fd5b613bef85828601613ac3565b90969095509350505050565b60008060408385031215613c0e57600080fd5b613c178361352a565b91506137db6020840161352a565b6000808335601e19843603018112613c3c57600080fd5b8301803591506001600160401b03821115613c5657600080fd5b6020019150600581901b3603821315610b0d57600080fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b600060018201613cac57613cac613c84565b5060010190565b600181811c90821680613cc757607f821691505b602082108103613ce757634e487b7160e01b600052602260045260246000fd5b50919050565b6020808252602d908201527f4552433732313a2063616c6c6572206973206e6f7420746f6b656e206f776e6560408201526c1c881bdc88185c1c1c9bdd9959609a1b606082015260800190565b808202811582820484141761080357610803613c84565b600082613d6e57634e487b7160e01b600052601260045260246000fd5b500490565b600081613d8257613d82613c84565b506000190190565b601f8211156109d757600081815260208120601f850160051c81016020861015613db15750805b601f850160051c820191505b8181101561133c57828155600101613dbd565b81516001600160401b03811115613de957613de9613570565b613dfd81613df78454613cb3565b84613d8a565b602080601f831160018114613e325760008415613e1a5750858301515b600019600386901b1c1916600185901b17855561133c565b600085815260208120601f198616915b82811015613e6157888601518255948401946001909101908401613e42565b5085821015613e7f5787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b600060208284031215613ea157600080fd5b815161105981613a7e565b60008351613ebe8184602088016134ae565b835190830190613ed28183602088016134ae565b01949350505050565b8082018082111561080357610803613c84565b6020808252602a908201527f455243323938313a20726f79616c7479206665652077696c6c206578636565646040820152692073616c65507269636560b01b606082015260800190565b80516020808301519190811015613ce75760001960209190910360031b1b16919050565b60208082526032908201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560408201527131b2b4bb32b91034b6b83632b6b2b73a32b960711b606082015260800190565b7f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000815260008351613fe68160178501602088016134ae565b7001034b99036b4b9b9b4b733903937b6329607d1b60179184019182015283516140178160288401602088016134ae565b01602801949350505050565b82815260406020820152600061182960408301846134d2565b6000825161404e8184602087016134ae565b9190910192915050565b60006020828403121561406a57600080fd5b81516110598161347b565b6001600160a01b03858116825284166020820152604081018390526080606082018190526000906140a8908301846134d2565b9695505050505050565b60208082526025908201527f4552433732313a207472616e736665722066726f6d20696e636f72726563742060408201526437bbb732b960d91b606082015260800190565b8181038181111561080357610803613c84565b634e487b7160e01b600052603160045260246000fd5b634e487b7160e01b600052602160045260246000fdfea2646970667358221220c47aea78e02adda7e8a36138892c3ed2fc9b754ce58545603813e5750b053f0764736f6c63430008110033";class f4 extends fd{constructor(...e){e.length>1?super(...e):super(c4,u4,e[0])}deploy(e,t,n,r,i,a,o,s,c){return super.deploy(e,t,n,r,i,a,o,s,c||{})}getDeployTransaction(e,t,n,r,i,a,o,s,c){return super.getDeployTransaction(e,t,n,r,i,a,o,s,c||{})}attach(e){return super.attach(e)}connect(e){return super.connect(e)}static bytecode=u4;static abi=c4;static createInterface(){return new Ss(c4)}static connect(e,t){return new ud(e,c4,t)}}var d4=Object.freeze({__proto__:null,ERC20:class{contract;constructor(e){const t=new i4;this.contract=t.attach(e)}async totalSupply(e,t={}){return this.contract.connect(e).totalSupply(t)}async balanceOf(e,t,n={}){return this.contract.connect(e).balanceOf(t,n)}async allowance(e,t,n,r={}){return this.contract.connect(e).allowance(t,n,r)}async populateTransfer(e,t,n){return this.contract.populateTransaction.transfer(e,t,n)}async populateApprove(e,t,n={}){return this.contract.populateTransaction.approve(e,t,n)}async populateTransferFrom(e,t,n,r={}){return this.contract.populateTransaction.transferFrom(e,t,n,r)}}});var l4=Object.freeze({__proto__:null,ERC721:class{contract;constructor(e){const t=new s4;this.contract=t.attach(e)}async DEFAULT_ADMIN_ROLE(e,t={}){return await this.contract.connect(e).DEFAULT_ADMIN_ROLE(t)}async DOMAIN_SEPARATOR(e,t){return await this.contract.connect(e).DOMAIN_SEPARATOR(t)}async MINTER_ROLE(e,t={}){return await this.contract.connect(e).MINTER_ROLE(t)}async balanceOf(e,t,n={}){return await this.contract.connect(e).balanceOf(t,n)}async baseURI(e,t={}){return await this.contract.connect(e).baseURI(t)}async contractURI(e,t={}){return await this.contract.connect(e).contractURI(t)}async eip712Domain(e,t){return await this.contract.eip712Domain(t)}async getAdmins(e,t={}){return await this.contract.connect(e).getAdmins(t)}async getApproved(e,t,n={}){return await this.contract.connect(e).getApproved(t,n)}async getRoleAdmin(e,t,n={}){return await this.contract.connect(e).getRoleAdmin(t,n)}async getRoleMember(e,t,n,r={}){return await this.contract.connect(e).getRoleMember(t,n,r)}async getRoleMemberCount(e,t,n={}){return await this.contract.connect(e).getRoleMemberCount(t,n)}async hasRole(e,t,n,r={}){return await this.contract.connect(e).hasRole(t,n,r)}async isApprovedForAll(e,t,n,r={}){return await this.contract.connect(e).isApprovedForAll(t,n,r)}async name(e,t={}){return await this.contract.connect(e).name(t)}async ownerOf(e,t,n={}){return await this.contract.connect(e).ownerOf(t,n)}async nonces(e,t,n){return await this.contract.connect(e).nonces(t,n)}async operatorAllowlist(e,t={}){return await this.contract.connect(e).operatorAllowlist(t)}async royaltyInfo(e,t,n,r={}){return await this.contract.connect(e).royaltyInfo(t,n,r)}async symbol(e,t={}){return await this.contract.connect(e).symbol(t)}async tokenURI(e,t,n={}){return await this.contract.connect(e).tokenURI(t,n)}async totalSupply(e,t={}){return await this.contract.connect(e).totalSupply(t)}async populateApprove(e,t,n={}){return await this.contract.populateTransaction.approve(e,t,n)}async populatePermit(e,t,n,r,i={}){return await this.contract.populateTransaction.permit(e,t,n,r,i)}async populateBurn(e,t={}){return await this.contract.populateTransaction.burn(e,t)}async populateBurnBatch(e,t={}){return await this.contract.populateTransaction.burnBatch(e,t)}async populateSafeBurn(e,t,n={}){return await this.contract.populateTransaction.safeBurn(e,t,n)}async populateSafeBurnBatch(e,t={}){return await this.contract.populateTransaction.safeBurnBatch(e,t)}async populateGrantMinterRole(e,t={}){return await this.contract.populateTransaction.grantMinterRole(e,t)}async populateGrantRole(e,t,n={}){return await this.contract.populateTransaction.grantRole(e,t,n)}async populateMint(e,t,n={}){return await this.contract.populateTransaction.mint(e,t,n)}async populateSafeMint(e,t,n={}){return await this.contract.populateTransaction.safeMint(e,t,n)}async populateMintByQuantity(e,t,n={}){return await this.contract.populateTransaction.mintByQuantity(e,t,n)}async populateSafeMintByQuantity(e,t,n={}){return await this.contract.populateTransaction.safeMintByQuantity(e,t,n)}async populateMintBatchByQuantity(e,t={}){return await this.contract.populateTransaction.mintBatchByQuantity(e,t)}async populateSafeMintBatchByQuantity(e,t={}){return await this.contract.populateTransaction.safeMintBatchByQuantity(e,t)}async populateMintBatch(e,t={}){return await this.contract.populateTransaction.mintBatch(e,t)}async populateSafeMintBatch(e,t={}){return await this.contract.populateTransaction.safeMintBatch(e,t)}async populateRenounceRole(e,t,n={}){return await this.contract.populateTransaction.renounceRole(e,t,n)}async populateRevokeMinterRole(e,t={}){return await this.contract.populateTransaction.revokeMinterRole(e,t)}async populateRevokeRole(e,t,n={}){return await this.contract.populateTransaction.revokeRole(e,t,n)}async populateSafeTransferFromBatch(e,t={}){return await this.contract.populateTransaction.safeTransferFromBatch(e,t)}async"populateSafeTransferFrom(address,address,uint256)"(e,t,n,r={}){return await this.contract.populateTransaction["safeTransferFrom(address,address,uint256)"](e,t,n,r)}async"populateSafeTransferFrom(address,address,uint256,bytes)"(e,t,n,r,i={}){return await this.contract.populateTransaction["safeTransferFrom(address,address,uint256,bytes)"](e,t,n,r,i)}async populateSetApprovalForAll(e,t,n={}){return await this.contract.populateTransaction.setApprovalForAll(e,t,n)}async populateSetBaseURI(e,t={}){return await this.contract.populateTransaction.setBaseURI(e,t)}async populateSetContractURI(e,t={}){return await this.contract.populateTransaction.setContractURI(e,t)}async populateSetDefaultRoyaltyReceiver(e,t,n={}){return await this.contract.populateTransaction.setDefaultRoyaltyReceiver(e,t,n)}async populateSetNFTRoyaltyReceiver(e,t,n,r={}){return await this.contract.populateTransaction.setNFTRoyaltyReceiver(e,t,n,r)}async populateSetNFTRoyaltyReceiverBatch(e,t,n,r={}){return await this.contract.populateTransaction.setNFTRoyaltyReceiverBatch(e,t,n,r)}async populateSetOperatorAllowlistRegistry(e,t={}){return await this.contract.populateTransaction.setOperatorAllowlistRegistry(e,t)}}});var p4=Object.freeze({__proto__:null,ERC721MintByID:class{contract;constructor(e){const t=new f4;this.contract=t.attach(e)}async DEFAULT_ADMIN_ROLE(e,t={}){return await this.contract.connect(e).DEFAULT_ADMIN_ROLE(t)}async MINTER_ROLE(e,t={}){return await this.contract.connect(e).MINTER_ROLE(t)}async balanceOf(e,t,n={}){return await this.contract.connect(e).balanceOf(t,n)}async baseURI(e,t={}){return await this.contract.connect(e).baseURI(t)}async contractURI(e,t={}){return await this.contract.connect(e).contractURI(t)}async getAdmins(e,t={}){return await this.contract.connect(e).getAdmins(t)}async getApproved(e,t,n={}){return await this.contract.connect(e).getApproved(t,n)}async getRoleAdmin(e,t,n={}){return await this.contract.connect(e).getRoleAdmin(t,n)}async getRoleMember(e,t,n,r={}){return await this.contract.connect(e).getRoleMember(t,n,r)}async getRoleMemberCount(e,t,n={}){return await this.contract.connect(e).getRoleMemberCount(t,n)}async hasRole(e,t,n,r={}){return await this.contract.connect(e).hasRole(t,n,r)}async isApprovedForAll(e,t,n,r={}){return await this.contract.connect(e).isApprovedForAll(t,n,r)}async name(e,t={}){return await this.contract.connect(e).name(t)}async ownerOf(e,t,n={}){return await this.contract.connect(e).ownerOf(t,n)}async nonces(e,t,n){return await this.contract.connect(e).nonces(t,n)}async operatorAllowlist(e,t={}){return await this.contract.connect(e).operatorAllowlist(t)}async royaltyInfo(e,t,n,r={}){return await this.contract.connect(e).royaltyInfo(t,n,r)}async symbol(e,t={}){return await this.contract.connect(e).symbol(t)}async tokenURI(e,t,n={}){return await this.contract.connect(e).tokenURI(t,n)}async totalSupply(e,t={}){return await this.contract.connect(e).totalSupply(t)}async populateApprove(e,t,n={}){return await this.contract.populateTransaction.approve(e,t,n)}async populatePermit(e,t,n,r,i={}){return await this.contract.populateTransaction.permit(e,t,n,r,i)}async populateBurn(e,t={}){return await this.contract.populateTransaction.burn(e,t)}async populateBurnBatch(e,t={}){return await this.contract.populateTransaction.burnBatch(e,t)}async populateGrantMinterRole(e,t={}){return await this.contract.populateTransaction.grantMinterRole(e,t)}async populateGrantRole(e,t,n={}){return await this.contract.populateTransaction.grantRole(e,t,n)}async populateMint(e,t,n={}){return await this.contract.populateTransaction.mint(e,t,n)}async populateSafeMintBatch(e,t={}){return await this.contract.populateTransaction.safeMintBatch(e,t)}async populateSafeBurn(e,t,n={}){return await this.contract.populateTransaction.safeBurn(e,t,n)}async populateSafeBurnBatch(e,t={}){return await this.contract.populateTransaction.safeBurnBatch(e,t)}async populateRenounceRole(e,t,n={}){return await this.contract.populateTransaction.renounceRole(e,t,n)}async populateRevokeMinterRole(e,t={}){return await this.contract.populateTransaction.revokeMinterRole(e,t)}async populateRevokeRole(e,t,n={}){return await this.contract.populateTransaction.revokeRole(e,t,n)}async populateSafeTransferFromBatch(e,t={}){return await this.contract.populateTransaction.safeTransferFromBatch(e,t)}async"populateSafeTransferFrom(address,address,uint256)"(e,t,n,r={}){return await this.contract.populateTransaction["safeTransferFrom(address,address,uint256)"](e,t,n,r)}async"populateSafeTransferFrom(address,address,uint256,bytes)"(e,t,n,r,i={}){return await this.contract.populateTransaction["safeTransferFrom(address,address,uint256,bytes)"](e,t,n,r,i)}async populateSetApprovalForAll(e,t,n={}){return await this.contract.populateTransaction.setApprovalForAll(e,t,n)}async populateSetBaseURI(e,t={}){return await this.contract.populateTransaction.setBaseURI(e,t)}async populateSetContractURI(e,t={}){return await this.contract.populateTransaction.setContractURI(e,t)}async populateSetDefaultRoyaltyReceiver(e,t,n={}){return await this.contract.populateTransaction.setDefaultRoyaltyReceiver(e,t,n)}async populateSetNFTRoyaltyReceiver(e,t,n,r={}){return await this.contract.populateTransaction.setNFTRoyaltyReceiver(e,t,n,r)}async populateSetNFTRoyaltyReceiverBatch(e,t,n,r={}){return await this.contract.populateTransaction.setNFTRoyaltyReceiverBatch(e,t,n,r)}async populateSetOperatorAllowlistRegistry(e,t={}){return await this.contract.populateTransaction.setOperatorAllowlistRegistry(e,t)}}});e.blockchainData=$t,e.checkoutSdk=v3,e.checkoutWidgets=t4,e.config=r,e.erc20=d4,e.erc721=l4,e.erc721MintById=p4,e.immutablexClient=KN,e.orderbook=cW,e.passport=bz,e.provider=HW}));
|
|
66
|
+
*/w3.exports=function(){if(A3)return _3;A3=1;var e=R3,t=Symbol.for("react.element"),n=Symbol.for("react.fragment"),r=Object.prototype.hasOwnProperty,i=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,a={key:!0,ref:!0,__self:!0,__source:!0};function o(e,n,o){var s,c={},u=null,f=null;for(s in void 0!==o&&(u=""+o),void 0!==n.key&&(u=""+n.key),void 0!==n.ref&&(f=n.ref),n)r.call(n,s)&&!a.hasOwnProperty(s)&&(c[s]=n[s]);if(e&&e.defaultProps)for(s in n=e.defaultProps)void 0===c[s]&&(c[s]=n[s]);return{$$typeof:t,type:e,key:u,ref:f,props:c,_owner:i.current}}return _3.Fragment=n,_3.jsx=o,_3.jsxs=o,_3}();var S3=w3.exports;function k3(e,t,n,r){Object.defineProperty(e,t,{get:n,set:r,enumerable:!0,configurable:!0})}const I3=()=>"0.21.0";var O3,x3;k3({},"IMTBLWidgetEvents",(()=>O3)),(x3=O3||(O3={})).IMTBL_CONNECT_WIDGET_EVENT="imtbl-connect-widget",x3.IMTBL_WALLET_WIDGET_EVENT="imtbl-wallet-widget",x3.IMTBL_SWAP_WIDGET_EVENT="imtbl-swap-widget",x3.IMTBL_BRIDGE_WIDGET_EVENT="imtbl-bridge-widget",x3.IMTBL_ONRAMP_WIDGET_EVENT="imtbl-onramp-widget";var C3,M3;k3({},"ConnectEventType",(()=>C3)),(M3=C3||(C3={})).CLOSE_WIDGET="close-widget",M3.SUCCESS="success",M3.FAILURE="failure";var P3,N3;k3({},"WalletEventType",(()=>P3)),(N3=P3||(P3={})).CLOSE_WIDGET="close-widget",N3.NETWORK_SWITCH="network-switch",N3.DISCONNECT_WALLET="disconnect-wallet";var B3,D3;k3({},"SwapEventType",(()=>B3)),(D3=B3||(B3={})).CLOSE_WIDGET="close-widget",D3.SUCCESS="success",D3.FAILURE="failure",D3.REJECTED="rejected";var F3,L3;k3({},"BridgeEventType",(()=>F3)),(L3=F3||(F3={})).CLOSE_WIDGET="close-widget",L3.SUCCESS="success",L3.FAILURE="failure";var U3,j3;k3({},"OrchestrationEventType",(()=>U3)),(j3=U3||(U3={})).REQUEST_CONNECT="request-connect",j3.REQUEST_WALLET="request-wallet",j3.REQUEST_SWAP="request-swap",j3.REQUEST_BRIDGE="request-bridge",j3.REQUEST_ONRAMP="request-onramp";var q3,z3;k3({},"OnRampEventType",(()=>q3)),(z3=q3||(q3={})).CLOSE_WIDGET="close-widget",z3.SUCCESS="success",z3.FAILURE="failure";var H3,G3,V3,K3,W3={};k3(W3,"WidgetTheme",(()=>H3)),k3(W3,"CheckoutWidgetTagNames",(()=>V3)),(G3=H3||(H3={})).LIGHT="light",G3.DARK="dark",(K3=V3||(V3={})).CONNECT="imtbl-connect",K3.WALLET="imtbl-wallet",K3.SWAP="imtbl-swap",K3.BRIDGE="imtbl-bridge",K3.ONRAMP="imtbl-onramp";function X3(e,t){if(!t)return void console.error("no provider parsed");if(void 0===window)return void console.error("missing window object: please run Checkout client side");let n=0;let r;const i=()=>{try{const n=document.getElementsByTagName(e);n[0].setProvider(t),window.clearInterval(r)}catch(e){n++,n>=10&&(window.clearInterval(r),console.error("failed to set the provider"))}};r=window.setInterval(i,10),i()}function $3(e,t){if(!t)return void console.error("no passport provided");if(void 0===window)return void console.error("missing window object: please run Checkout client side");let n=0;let r;const i=()=>{try{const n=document.getElementsByTagName(e);n[0].addPassportOption(t),window.clearInterval(r)}catch(e){n++,n>=10&&(window.clearInterval(r),console.error("failed to set the provider"))}};r=window.setInterval(i,10),i()}function J3(e){const{walletProvider:t,fromContractAddress:n,amount:r,provider:i,passport:a}=e;R3.useEffect((()=>{i&&X3(V3.BRIDGE,i),a&&$3(V3.BRIDGE,a)}),[i,a]);const o=window.ImtblCheckoutWidgetConfig;return S3.jsx("imtbl-bridge",{widgetConfig:o,walletProvider:t,fromContractAddress:n??"",amount:r??""})}k3({},"BridgeReact",(()=>J3));function Y3({passport:e}){const t=window.ImtblCheckoutWidgetConfig;return R3.useEffect((()=>{e&&$3(V3.CONNECT,e)}),[e]),S3.jsx("imtbl-connect",{widgetConfig:t})}k3({},"ConnectReact",(()=>Y3));function Q3(e){const{walletProvider:t,fromContractAddress:n,amount:r,toContractAddress:i,provider:a,passport:o}=e;R3.useEffect((()=>{a&&X3(V3.SWAP,a),o&&$3(V3.SWAP,o)}),[a,o]);const s=window.ImtblCheckoutWidgetConfig;return S3.jsx("imtbl-swap",{widgetConfig:s,walletProvider:t,fromContractAddress:n??"",toContractAddress:i??"",amount:r??""})}k3({},"SwapReact",(()=>Q3));function Z3(e){const{walletProvider:t,provider:n,passport:r}=e;R3.useEffect((()=>{n&&X3(V3.WALLET,n),r&&$3(V3.WALLET,r)}),[n,r]);const i=window.ImtblCheckoutWidgetConfig;return S3.jsx("imtbl-wallet",{widgetConfig:i,walletProvider:t})}k3({},"WalletReact",(()=>Z3));function e4(e){const{walletProvider:t,amount:n,provider:r,passport:i,contractAddress:a}=e;R3.useEffect((()=>{r&&X3(V3.ONRAMP,r),i&&$3(V3.ONRAMP,i)}),[r,i]);const o=window.ImtblCheckoutWidgetConfig;return S3.jsx("imtbl-onramp",{widgetConfig:o,walletProvider:t,amount:n??"",contractAddress:a??""})}k3({},"OnRampReact",(()=>e4));var t4=Object.freeze({__proto__:null,get BridgeEventType(){return F3},BridgeReact:J3,get CheckoutWidgetTagNames(){return V3},CheckoutWidgets:function(e){if(void 0===window)return void console.error("missing window object: please run Checkout client side");if(void 0===document)return void console.error("missing document object: please run Checkout client side");const t=document.createElement("script"),n=function(e){const t=I3();if(void 0===e||void 0===e.major)return t;if(!Number.isInteger(e.major)||e.major<0)return t;if(void 0!==e.minor&&e.minor<0)return t;if(void 0!==e.patch&&e.patch<0)return t;if(0===e.major&&void 0===e.minor)return t;if(0===e.major&&0===e.minor&&void 0===e.patch)return t;if(0===e.major&&void 0===e.minor&&void 0===e.patch)return t;if(0===e.major&&0===e.minor&&0===e.patch)return t;let n=e.major.toString();return void 0===e.minor||(Number.isInteger(e.minor)&&(n+=`.${e.minor.toString()}`),void 0===e.patch||(Number.isInteger(e.patch)&&(n+=`.${e.patch.toString()}`),void 0===e.prerelease||"alpha"!==e.prerelease||("alpha"===e.prerelease&&(n+=`-${e.prerelease}`),void 0===e.build||Number.isInteger(e.build)&&e.build>=0&&(n+=`.${e.build.toString()}`)))),n}(e?.version);let r=`https://cdn.jsdelivr.net/npm/@imtbl/sdk@${n}/dist/browser/checkout.js`;t.setAttribute("src",r),document.head.appendChild(t),window.ImtblCheckoutWidgetConfig=JSON.stringify(e)},get ConnectEventType(){return C3},ConnectReact:Y3,get IMTBLWidgetEvents(){return O3},get OnRampEventType(){return q3},OnRampReact:e4,get OrchestrationEventType(){return U3},get SwapEventType(){return B3},SwapReact:Q3,UpdateConfig:function(e){void 0!==window?window.ImtblCheckoutWidgetConfig=JSON.stringify(e):console.error("missing document object: please run Checkout client side")},get WalletEventType(){return P3},WalletReact:Z3,get WidgetTheme(){return H3}});const n4=[{inputs:[{internalType:"string",name:"name_",type:"string"},{internalType:"string",name:"symbol_",type:"string"}],stateMutability:"nonpayable",type:"constructor"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"owner",type:"address"},{indexed:!0,internalType:"address",name:"spender",type:"address"},{indexed:!1,internalType:"uint256",name:"value",type:"uint256"}],name:"Approval",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"from",type:"address"},{indexed:!0,internalType:"address",name:"to",type:"address"},{indexed:!1,internalType:"uint256",name:"value",type:"uint256"}],name:"Transfer",type:"event"},{inputs:[{internalType:"address",name:"owner",type:"address"},{internalType:"address",name:"spender",type:"address"}],name:"allowance",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"spender",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"approve",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"account",type:"address"}],name:"balanceOf",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"decimals",outputs:[{internalType:"uint8",name:"",type:"uint8"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"spender",type:"address"},{internalType:"uint256",name:"subtractedValue",type:"uint256"}],name:"decreaseAllowance",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"spender",type:"address"},{internalType:"uint256",name:"addedValue",type:"uint256"}],name:"increaseAllowance",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"name",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[],name:"symbol",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[],name:"totalSupply",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"transfer",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"amount",type:"uint256"}],name:"transferFrom",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"nonpayable",type:"function"}],r4="0x60806040523480156200001157600080fd5b50604051620017ec380380620017ec8339818101604052810190620000379190620001f6565b8160039081620000489190620004c6565b5080600490816200005a9190620004c6565b505050620005ad565b6000604051905090565b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b620000cc8262000081565b810181811067ffffffffffffffff82111715620000ee57620000ed62000092565b5b80604052505050565b60006200010362000063565b9050620001118282620000c1565b919050565b600067ffffffffffffffff82111562000134576200013362000092565b5b6200013f8262000081565b9050602081019050919050565b60005b838110156200016c5780820151818401526020810190506200014f565b60008484015250505050565b60006200018f620001898462000116565b620000f7565b905082815260208101848484011115620001ae57620001ad6200007c565b5b620001bb8482856200014c565b509392505050565b600082601f830112620001db57620001da62000077565b5b8151620001ed84826020860162000178565b91505092915050565b6000806040838503121562000210576200020f6200006d565b5b600083015167ffffffffffffffff81111562000231576200023062000072565b5b6200023f85828601620001c3565b925050602083015167ffffffffffffffff81111562000263576200026262000072565b5b6200027185828601620001c3565b9150509250929050565b600081519050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b60006002820490506001821680620002ce57607f821691505b602082108103620002e457620002e362000286565b5b50919050565b60008190508160005260206000209050919050565b60006020601f8301049050919050565b600082821b905092915050565b6000600883026200034e7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff826200030f565b6200035a86836200030f565b95508019841693508086168417925050509392505050565b6000819050919050565b6000819050919050565b6000620003a7620003a16200039b8462000372565b6200037c565b62000372565b9050919050565b6000819050919050565b620003c38362000386565b620003db620003d282620003ae565b8484546200031c565b825550505050565b600090565b620003f2620003e3565b620003ff818484620003b8565b505050565b5b8181101562000427576200041b600082620003e8565b60018101905062000405565b5050565b601f82111562000476576200044081620002ea565b6200044b84620002ff565b810160208510156200045b578190505b620004736200046a85620002ff565b83018262000404565b50505b505050565b600082821c905092915050565b60006200049b600019846008026200047b565b1980831691505092915050565b6000620004b6838362000488565b9150826002028217905092915050565b620004d1826200027b565b67ffffffffffffffff811115620004ed57620004ec62000092565b5b620004f98254620002b5565b620005068282856200042b565b600060209050601f8311600181146200053e576000841562000529578287015190505b620005358582620004a8565b865550620005a5565b601f1984166200054e86620002ea565b60005b82811015620005785784890151825560018201915060208501945060208101905062000551565b8683101562000598578489015162000594601f89168262000488565b8355505b6001600288020188555050505b505050505050565b61122f80620005bd6000396000f3fe608060405234801561001057600080fd5b50600436106100a95760003560e01c80633950935111610071578063395093511461016857806370a082311461019857806395d89b41146101c8578063a457c2d7146101e6578063a9059cbb14610216578063dd62ed3e14610246576100a9565b806306fdde03146100ae578063095ea7b3146100cc57806318160ddd146100fc57806323b872dd1461011a578063313ce5671461014a575b600080fd5b6100b6610276565b6040516100c39190610b0c565b60405180910390f35b6100e660048036038101906100e19190610bc7565b610308565b6040516100f39190610c22565b60405180910390f35b61010461032b565b6040516101119190610c4c565b60405180910390f35b610134600480360381019061012f9190610c67565b610335565b6040516101419190610c22565b60405180910390f35b610152610364565b60405161015f9190610cd6565b60405180910390f35b610182600480360381019061017d9190610bc7565b61036d565b60405161018f9190610c22565b60405180910390f35b6101b260048036038101906101ad9190610cf1565b6103a4565b6040516101bf9190610c4c565b60405180910390f35b6101d06103ec565b6040516101dd9190610b0c565b60405180910390f35b61020060048036038101906101fb9190610bc7565b61047e565b60405161020d9190610c22565b60405180910390f35b610230600480360381019061022b9190610bc7565b6104f5565b60405161023d9190610c22565b60405180910390f35b610260600480360381019061025b9190610d1e565b610518565b60405161026d9190610c4c565b60405180910390f35b60606003805461028590610d8d565b80601f01602080910402602001604051908101604052809291908181526020018280546102b190610d8d565b80156102fe5780601f106102d3576101008083540402835291602001916102fe565b820191906000526020600020905b8154815290600101906020018083116102e157829003601f168201915b5050505050905090565b60008061031361059f565b90506103208185856105a7565b600191505092915050565b6000600254905090565b60008061034061059f565b905061034d858285610770565b6103588585856107fc565b60019150509392505050565b60006012905090565b60008061037861059f565b905061039981858561038a8589610518565b6103949190610ded565b6105a7565b600191505092915050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6060600480546103fb90610d8d565b80601f016020809104026020016040519081016040528092919081815260200182805461042790610d8d565b80156104745780601f1061044957610100808354040283529160200191610474565b820191906000526020600020905b81548152906001019060200180831161045757829003601f168201915b5050505050905090565b60008061048961059f565b905060006104978286610518565b9050838110156104dc576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016104d390610e93565b60405180910390fd5b6104e982868684036105a7565b60019250505092915050565b60008061050061059f565b905061050d8185856107fc565b600191505092915050565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1603610616576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161060d90610f25565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1603610685576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161067c90610fb7565b60405180910390fd5b80600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516107639190610c4c565b60405180910390a3505050565b600061077c8484610518565b90507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff81146107f657818110156107e8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107df90611023565b60405180910390fd5b6107f584848484036105a7565b5b50505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff160361086b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610862906110b5565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16036108da576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108d190611147565b60405180910390fd5b6108e5838383610a72565b60008060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490508181101561096b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610962906111d9565b60405180910390fd5b8181036000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef84604051610a599190610c4c565b60405180910390a3610a6c848484610a77565b50505050565b505050565b505050565b600081519050919050565b600082825260208201905092915050565b60005b83811015610ab6578082015181840152602081019050610a9b565b60008484015250505050565b6000601f19601f8301169050919050565b6000610ade82610a7c565b610ae88185610a87565b9350610af8818560208601610a98565b610b0181610ac2565b840191505092915050565b60006020820190508181036000830152610b268184610ad3565b905092915050565b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000610b5e82610b33565b9050919050565b610b6e81610b53565b8114610b7957600080fd5b50565b600081359050610b8b81610b65565b92915050565b6000819050919050565b610ba481610b91565b8114610baf57600080fd5b50565b600081359050610bc181610b9b565b92915050565b60008060408385031215610bde57610bdd610b2e565b5b6000610bec85828601610b7c565b9250506020610bfd85828601610bb2565b9150509250929050565b60008115159050919050565b610c1c81610c07565b82525050565b6000602082019050610c376000830184610c13565b92915050565b610c4681610b91565b82525050565b6000602082019050610c616000830184610c3d565b92915050565b600080600060608486031215610c8057610c7f610b2e565b5b6000610c8e86828701610b7c565b9350506020610c9f86828701610b7c565b9250506040610cb086828701610bb2565b9150509250925092565b600060ff82169050919050565b610cd081610cba565b82525050565b6000602082019050610ceb6000830184610cc7565b92915050565b600060208284031215610d0757610d06610b2e565b5b6000610d1584828501610b7c565b91505092915050565b60008060408385031215610d3557610d34610b2e565b5b6000610d4385828601610b7c565b9250506020610d5485828601610b7c565b9150509250929050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b60006002820490506001821680610da557607f821691505b602082108103610db857610db7610d5e565b5b50919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000610df882610b91565b9150610e0383610b91565b9250828201905080821115610e1b57610e1a610dbe565b5b92915050565b7f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f7760008201527f207a65726f000000000000000000000000000000000000000000000000000000602082015250565b6000610e7d602583610a87565b9150610e8882610e21565b604082019050919050565b60006020820190508181036000830152610eac81610e70565b9050919050565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b6000610f0f602483610a87565b9150610f1a82610eb3565b604082019050919050565b60006020820190508181036000830152610f3e81610f02565b9050919050565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b6000610fa1602283610a87565b9150610fac82610f45565b604082019050919050565b60006020820190508181036000830152610fd081610f94565b9050919050565b7f45524332303a20696e73756666696369656e7420616c6c6f77616e6365000000600082015250565b600061100d601d83610a87565b915061101882610fd7565b602082019050919050565b6000602082019050818103600083015261103c81611000565b9050919050565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b600061109f602583610a87565b91506110aa82611043565b604082019050919050565b600060208201905081810360008301526110ce81611092565b9050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b6000611131602383610a87565b915061113c826110d5565b604082019050919050565b6000602082019050818103600083015261116081611124565b9050919050565b7f45524332303a207472616e7366657220616d6f756e742065786365656473206260008201527f616c616e63650000000000000000000000000000000000000000000000000000602082015250565b60006111c3602683610a87565b91506111ce82611167565b604082019050919050565b600060208201905081810360008301526111f2816111b6565b905091905056fea26469706673582212204188b273199f085e1921ec1a1fa55abdee2e425960bda675a51fac85acd9972064736f6c63430008110033";class i4 extends fd{constructor(...e){e.length>1?super(...e):super(n4,r4,e[0])}deploy(e,t,n){return super.deploy(e,t,n||{})}getDeployTransaction(e,t,n){return super.getDeployTransaction(e,t,n||{})}attach(e){return super.attach(e)}connect(e){return super.connect(e)}static bytecode=r4;static abi=n4;static createInterface(){return new Ss(n4)}static connect(e,t){return new ud(e,n4,t)}}const a4=[{inputs:[{internalType:"address",name:"owner_",type:"address"},{internalType:"string",name:"name_",type:"string"},{internalType:"string",name:"symbol_",type:"string"},{internalType:"string",name:"baseURI_",type:"string"},{internalType:"string",name:"contractURI_",type:"string"},{internalType:"address",name:"operatorAllowlist_",type:"address"},{internalType:"address",name:"royaltyReceiver_",type:"address"},{internalType:"uint96",name:"feeNumerator_",type:"uint96"}],stateMutability:"nonpayable",type:"constructor"},{inputs:[],name:"AllowlistDoesNotImplementIOperatorAllowlist",type:"error"},{inputs:[{internalType:"address",name:"target",type:"address"}],name:"ApproveTargetNotInAllowlist",type:"error"},{inputs:[{internalType:"address",name:"approver",type:"address"}],name:"ApproverNotInAllowlist",type:"error"},{inputs:[{internalType:"address",name:"caller",type:"address"}],name:"CallerNotInAllowlist",type:"error"},{inputs:[{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"IImmutableERC721IDAboveThreshold",type:"error"},{inputs:[{internalType:"uint256",name:"tokenId",type:"uint256"},{internalType:"address",name:"currentOwner",type:"address"}],name:"IImmutableERC721MismatchedTokenOwner",type:"error"},{inputs:[],name:"IImmutableERC721MismatchedTransferLengths",type:"error"},{inputs:[{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"IImmutableERC721NotOwnerOrOperator",type:"error"},{inputs:[],name:"IImmutableERC721SendingToZerothAddress",type:"error"},{inputs:[{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"IImmutableERC721TokenAlreadyBurned",type:"error"},{inputs:[],name:"InvalidShortString",type:"error"},{inputs:[],name:"InvalidSignature",type:"error"},{inputs:[],name:"PermitExpired",type:"error"},{inputs:[],name:"SignerCannotBeZerothAddress",type:"error"},{inputs:[{internalType:"string",name:"str",type:"string"}],name:"StringTooLong",type:"error"},{inputs:[{internalType:"address",name:"from",type:"address"}],name:"TransferFromNotInAllowlist",type:"error"},{inputs:[{internalType:"address",name:"to",type:"address"}],name:"TransferToNotInAllowlist",type:"error"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"owner",type:"address"},{indexed:!0,internalType:"address",name:"approved",type:"address"},{indexed:!0,internalType:"uint256",name:"tokenId",type:"uint256"}],name:"Approval",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"owner",type:"address"},{indexed:!0,internalType:"address",name:"operator",type:"address"},{indexed:!1,internalType:"bool",name:"approved",type:"bool"}],name:"ApprovalForAll",type:"event"},{anonymous:!1,inputs:[],name:"EIP712DomainChanged",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"address",name:"oldRegistry",type:"address"},{indexed:!1,internalType:"address",name:"newRegistry",type:"address"}],name:"OperatorAllowlistRegistryUpdated",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"role",type:"bytes32"},{indexed:!0,internalType:"bytes32",name:"previousAdminRole",type:"bytes32"},{indexed:!0,internalType:"bytes32",name:"newAdminRole",type:"bytes32"}],name:"RoleAdminChanged",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"role",type:"bytes32"},{indexed:!0,internalType:"address",name:"account",type:"address"},{indexed:!0,internalType:"address",name:"sender",type:"address"}],name:"RoleGranted",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"role",type:"bytes32"},{indexed:!0,internalType:"address",name:"account",type:"address"},{indexed:!0,internalType:"address",name:"sender",type:"address"}],name:"RoleRevoked",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"from",type:"address"},{indexed:!0,internalType:"address",name:"to",type:"address"},{indexed:!0,internalType:"uint256",name:"tokenId",type:"uint256"}],name:"Transfer",type:"event"},{inputs:[],name:"DEFAULT_ADMIN_ROLE",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[],name:"DOMAIN_SEPARATOR",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[],name:"MINTER_ROLE",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"approve",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"owner",type:"address"}],name:"balanceOf",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"baseURI",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[],name:"bulkMintThreshold",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"pure",type:"function"},{inputs:[{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"burn",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256[]",name:"tokenIDs",type:"uint256[]"}],name:"burnBatch",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"contractURI",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[],name:"eip712Domain",outputs:[{internalType:"bytes1",name:"fields",type:"bytes1"},{internalType:"string",name:"name",type:"string"},{internalType:"string",name:"version",type:"string"},{internalType:"uint256",name:"chainId",type:"uint256"},{internalType:"address",name:"verifyingContract",type:"address"},{internalType:"bytes32",name:"salt",type:"bytes32"},{internalType:"uint256[]",name:"extensions",type:"uint256[]"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"exists",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[],name:"getAdmins",outputs:[{internalType:"address[]",name:"",type:"address[]"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"getApproved",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"role",type:"bytes32"}],name:"getRoleAdmin",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"role",type:"bytes32"},{internalType:"uint256",name:"index",type:"uint256"}],name:"getRoleMember",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"role",type:"bytes32"}],name:"getRoleMemberCount",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"user",type:"address"}],name:"grantMinterRole",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes32",name:"role",type:"bytes32"},{internalType:"address",name:"account",type:"address"}],name:"grantRole",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes32",name:"role",type:"bytes32"},{internalType:"address",name:"account",type:"address"}],name:"hasRole",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"owner",type:"address"},{internalType:"address",name:"operator",type:"address"}],name:"isApprovedForAll",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"mint",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{components:[{internalType:"address",name:"to",type:"address"},{internalType:"uint256[]",name:"tokenIds",type:"uint256[]"}],internalType:"struct ERC721Hybrid.IDMint[]",name:"mints",type:"tuple[]"}],name:"mintBatch",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{components:[{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"quantity",type:"uint256"}],internalType:"struct ERC721Hybrid.Mint[]",name:"mints",type:"tuple[]"}],name:"mintBatchByQuantity",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"quantity",type:"uint256"}],name:"mintByQuantity",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"name",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"nonces",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"operatorAllowlist",outputs:[{internalType:"contract IOperatorAllowlist",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"ownerOf",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"spender",type:"address"},{internalType:"uint256",name:"tokenId",type:"uint256"},{internalType:"uint256",name:"deadline",type:"uint256"},{internalType:"bytes",name:"sig",type:"bytes"}],name:"permit",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes32",name:"role",type:"bytes32"},{internalType:"address",name:"account",type:"address"}],name:"renounceRole",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"user",type:"address"}],name:"revokeMinterRole",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes32",name:"role",type:"bytes32"},{internalType:"address",name:"account",type:"address"}],name:"revokeRole",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"tokenId",type:"uint256"},{internalType:"uint256",name:"salePrice",type:"uint256"}],name:"royaltyInfo",outputs:[{internalType:"address",name:"",type:"address"},{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"owner",type:"address"},{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"safeBurn",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{components:[{internalType:"address",name:"owner",type:"address"},{internalType:"uint256[]",name:"tokenIds",type:"uint256[]"}],internalType:"struct ERC721Hybrid.IDBurn[]",name:"burns",type:"tuple[]"}],name:"safeBurnBatch",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"safeMint",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{components:[{internalType:"address",name:"to",type:"address"},{internalType:"uint256[]",name:"tokenIds",type:"uint256[]"}],internalType:"struct ERC721Hybrid.IDMint[]",name:"mints",type:"tuple[]"}],name:"safeMintBatch",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{components:[{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"quantity",type:"uint256"}],internalType:"struct ERC721Hybrid.Mint[]",name:"mints",type:"tuple[]"}],name:"safeMintBatchByQuantity",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"quantity",type:"uint256"}],name:"safeMintByQuantity",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"safeTransferFrom",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"tokenId",type:"uint256"},{internalType:"bytes",name:"_data",type:"bytes"}],name:"safeTransferFrom",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{components:[{internalType:"address",name:"from",type:"address"},{internalType:"address[]",name:"tos",type:"address[]"},{internalType:"uint256[]",name:"tokenIds",type:"uint256[]"}],internalType:"struct ERC721Hybrid.TransferRequest",name:"tr",type:"tuple"}],name:"safeTransferFromBatch",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"operator",type:"address"},{internalType:"bool",name:"approved",type:"bool"}],name:"setApprovalForAll",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"string",name:"baseURI_",type:"string"}],name:"setBaseURI",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"string",name:"_contractURI",type:"string"}],name:"setContractURI",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"receiver",type:"address"},{internalType:"uint96",name:"feeNumerator",type:"uint96"}],name:"setDefaultRoyaltyReceiver",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"tokenId",type:"uint256"},{internalType:"address",name:"receiver",type:"address"},{internalType:"uint96",name:"feeNumerator",type:"uint96"}],name:"setNFTRoyaltyReceiver",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256[]",name:"tokenIds",type:"uint256[]"},{internalType:"address",name:"receiver",type:"address"},{internalType:"uint96",name:"feeNumerator",type:"uint96"}],name:"setNFTRoyaltyReceiverBatch",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"_operatorAllowlist",type:"address"}],name:"setOperatorAllowlistRegistry",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes4",name:"interfaceId",type:"bytes4"}],name:"supportsInterface",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[],name:"symbol",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"tokenURI",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[],name:"totalSupply",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"transferFrom",outputs:[],stateMutability:"nonpayable",type:"function"}],o4="0x61016060405260006013553480156200001757600080fd5b5060405162005dfc38038062005dfc8339810160408190526200003a91620006cb565b8787878787878787868681604051806040016040528060018152602001603160f81b81525083838181838381600690816200007691906200085e565b5060076200008582826200085e565b50506801000000000000000060095550600d620000a383826200085e565b50600e620000b282826200085e565b5050505050620000d2601583620001e160201b620012111790919060201c565b61012052620000ef816016620001e1602090811b6200121117901c565b61014052815160208084019190912060e052815190820120610100524660a0526200017d60e05161010051604080517f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f60208201529081019290925260608201524660808201523060a082015260009060c00160405160208183030381529060405280519060200120905090565b60805250503060c0525062000196905060008962000231565b620001a2828262000274565b620001ad8362000379565b6019620001bb86826200085e565b506018620001ca85826200085e565b5050505050505050505050505050505050620009a8565b60006020835110156200020157620001f98362000472565b90506200022b565b826200021883620004b560201b620012421760201c565b906200022590826200085e565b5060ff90505b92915050565b620002488282620004b860201b620012451760201c565b60008281526001602090815260409091206200026f918390620012c962000559821b17901c565b505050565b6127106001600160601b0382161115620002e85760405162461bcd60e51b815260206004820152602a60248201527f455243323938313a20726f79616c7479206665652077696c6c206578636565646044820152692073616c65507269636560b01b60648201526084015b60405180910390fd5b6001600160a01b038216620003405760405162461bcd60e51b815260206004820152601960248201527f455243323938313a20696e76616c6964207265636569766572000000000000006044820152606401620002df565b604080518082019091526001600160a01b039092168083526001600160601b039091166020909201829052600160a01b90910217600355565b6040516301ffc9a760e01b81526305a3b80960e01b60048201526001600160a01b038216906301ffc9a790602401602060405180830381865afa158015620003c5573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620003eb91906200092a565b620004095760405163d6f93fb760e01b815260040160405180910390fd5b600254604080516001600160a01b03928316815291831660208301527f3edc37a14cc8047c7c8a3f354311efe86c14848efd4e3765a3e1e57eea04ea76910160405180910390a1600280546001600160a01b0319166001600160a01b0392909216919091179055565b600080829050601f81511115620004a0578260405163305a27a960e01b8152600401620002df91906200094e565b8051620004ad8262000983565b179392505050565b90565b6000828152602081815260408083206001600160a01b038516845290915290205460ff1662000555576000828152602081815260408083206001600160a01b03851684529091529020805460ff19166001179055620005143390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45b5050565b600062000570836001600160a01b03841662000577565b9392505050565b6000818152600183016020526040812054620005c0575081546001818101845560008481526020808220909301849055845484825282860190935260409020919091556200022b565b5060006200022b565b80516001600160a01b0381168114620005e157600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60005b8381101562000619578181015183820152602001620005ff565b50506000910152565b600082601f8301126200063457600080fd5b81516001600160401b0380821115620006515762000651620005e6565b604051601f8301601f19908116603f011681019082821181831017156200067c576200067c620005e6565b816040528381528660208588010111156200069657600080fd5b620006a9846020830160208901620005fc565b9695505050505050565b80516001600160601b0381168114620005e157600080fd5b600080600080600080600080610100898b031215620006e957600080fd5b620006f489620005c9565b60208a01519098506001600160401b03808211156200071257600080fd5b620007208c838d0162000622565b985060408b01519150808211156200073757600080fd5b620007458c838d0162000622565b975060608b01519150808211156200075c57600080fd5b6200076a8c838d0162000622565b965060808b01519150808211156200078157600080fd5b50620007908b828c0162000622565b945050620007a160a08a01620005c9565b9250620007b160c08a01620005c9565b9150620007c160e08a01620006b3565b90509295985092959890939650565b600181811c90821680620007e557607f821691505b6020821081036200080657634e487b7160e01b600052602260045260246000fd5b50919050565b601f8211156200026f57600081815260208120601f850160051c81016020861015620008355750805b601f850160051c820191505b81811015620008565782815560010162000841565b505050505050565b81516001600160401b038111156200087a576200087a620005e6565b62000892816200088b8454620007d0565b846200080c565b602080601f831160018114620008ca5760008415620008b15750858301515b600019600386901b1c1916600185901b17855562000856565b600085815260208120601f198616915b82811015620008fb57888601518255948401946001909101908401620008da565b50858210156200091a5787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b6000602082840312156200093d57600080fd5b815180151581146200057057600080fd5b60208152600082518060208401526200096f816040850160208701620005fc565b601f01601f19169190910160400192915050565b80516020808301519190811015620008065760001960209190910360031b1b16919050565b60805160a05160c05160e0516101005161012051610140516153f962000a036000396000610db301526000610d88015260006118740152600061184c015260006117a7015260006117d1015260006117fb01526153f96000f3fe608060405234801561001057600080fd5b506004361061035c5760003560e01c806369e2f0fb116101d3578063a217fddf11610104578063d547741f116100a2578063e4e18f6d1161007c578063e4e18f6d14610771578063e8a3d48514610784578063e985e9c51461078c578063eea987681461079f57600080fd5b8063d547741f14610738578063e19278591461074b578063e4623c1b1461075e57600080fd5b8063b88d4fde116100de578063b88d4fde146106ea578063c87b56dd146106fd578063ca15c87314610710578063d53913931461072357600080fd5b8063a217fddf146106bc578063a22cb465146106c4578063a7012816146106d757600080fd5b80639010d07c1161017157806395d89b411161014b57806395d89b411461067b5780639e2641a3146106835780639f15d70014610696578063a1448194146106a957600080fd5b80639010d07c1461064257806391d1485414610655578063938e3d7b1461066857600080fd5b8063745a41bc116101ad578063745a41bc146105ee57806374f16a811461060157806384b0196e14610614578063885e7a081461062f57600080fd5b806369e2f0fb146105c05780636c0360eb146105d357806370a08231146105db57600080fd5b80632d2c5a8b116102ad57806342842e0e1161024b5780634f558e79116102255780634f558e791461057457806355f804b314610587578063567e40751461059a5780636352211e146105ad57600080fd5b806342842e0e1461053b57806342966c681461054e578063439aed341461056157600080fd5b80633644e515116102875780633644e515146104fa57806336568abe146105025780633dd1eb611461051557806340c10f191461052857600080fd5b80632d2c5a8b146104bf5780632f2ff15d146104d257806331ae450b146104e557600080fd5b806318160ddd1161031a57806323b872dd116102f457806323b872dd14610444578063248a9ca31461045757806329326f291461047a5780632a55205a1461048d57600080fd5b806318160ddd1461041f5780631f8ebbd114610427578063234af0461461043157600080fd5b80628ad9461461036157806301ffc9a71461037657806306fdde031461039e578063081812fc146103b3578063095ea7b3146103de578063141a468c146103f1575b600080fd5b61037461036f36600461444e565b6107b2565b005b61038961038436600461449e565b610888565b60405190151581526020015b60405180910390f35b6103a6610899565b604051610395919061450b565b6103c66103c136600461451e565b6108a8565b6040516001600160a01b039091168152602001610395565b6103746103ec36600461454e565b6108c8565b6104116103ff36600461451e565b60009081526017602052604090205490565b604051908152602001610395565b6104116108e8565b600160401b610411565b61037461043f36600461471a565b6108ff565b610374610452366004614762565b610920565b61041161046536600461451e565b60009081526020819052604090206001015490565b6002546103c6906001600160a01b031681565b6104a061049b36600461479e565b610947565b604080516001600160a01b039093168352602083019190915201610395565b6103746104cd3660046147c0565b6109f5565b6103746104e036600461487c565b610a16565b6104ed610a3b565b60405161039591906148a8565b610411610ae9565b61037461051036600461487c565b610af3565b6103746105233660046148f5565b610b72565b61037461053636600461454e565b610b95565b610374610549366004614762565b610bb7565b61037461055c36600461451e565b610bd2565b61037461056f366004614927565b610c09565b61038961058236600461451e565b610c32565b6103746105953660046149ba565b610c3d565b6103746105a836600461454e565b610c54565b6103c66105bb36600461451e565b610c76565b6103746105ce3660046148f5565b610c96565b6103a6610cb9565b6104116105e93660046148f5565b610d47565b6103746105fc366004614a22565b610d65565b61037461060f36600461471a565b610d71565b61061c610d7a565b6040516103959796959493929190614a82565b61037461063d366004614b18565b610e03565b6103c661065036600461479e565b610e18565b61038961066336600461487c565b610e37565b6103746106763660046149ba565b610e60565b6103a6610e77565b61037461069136600461471a565b610e81565b6103746106a436600461454e565b610ea2565b6103746106b736600461454e565b610efc565b610411600081565b6103746106d2366004614b50565b610f1e565b6103746106e5366004614bcb565b61106f565b6103746106f8366004614c2f565b6110cf565b6103a661070b36600461451e565b6110f8565b61041161071e36600461451e565b611103565b6104116a4d494e5445525f524f4c4560a81b81565b61037461074636600461487c565b61111a565b6103746107593660046147c0565b61113f565b61037461076c366004614c7e565b611160565b61037461077f3660046148f5565b61119e565b6103a66111b2565b61038961079a366004614cbf565b6111bf565b6103746107ad36600461454e565b6111ef565b6107bf6020820182614ce9565b90506107ce6040830183614ce9565b9050146107ee5760405163359a1bc360e01b815260040160405180910390fd5b60005b6107fe6040830183614ce9565b90508110156108845761087261081760208401846148f5565b6108246020850185614ce9565b8481811061083457610834614d32565b905060200201602081019061084991906148f5565b6108566040860186614ce9565b8581811061086657610866614d32565b90506020020135610bb7565b8061087c81614d5e565b9150506107f1565b5050565b6000610893826112de565b92915050565b60606108a3611303565b905090565b6000600160401b8210156108bf5761089382611395565b610893826113bc565b600160401b8110156108de576108848282611447565b6108848282611557565b60006013546108f561165f565b6108a39190614d77565b6a4d494e5445525f524f4c4560a81b6109178161167b565b61088482611685565b600160401b81101561093c576109378383836116d4565b505050565b610937838383611704565b60008281526004602090815260408083208151808301909252546001600160a01b038116808352600160a01b9091046001600160601b03169282019290925282916109bc5750604080518082019091526003546001600160a01b0381168252600160a01b90046001600160601b031660208201525b6020810151600090612710906109db906001600160601b031687614d8a565b6109e59190614da1565b91519350909150505b9250929050565b6a4d494e5445525f524f4c4560a81b610a0d8161167b565b61088482611729565b600082815260208190526040902060010154610a318161167b565b6109378383611778565b60606000610a4881611103565b90506000816001600160401b03811115610a6457610a64614578565b604051908082528060200260200182016040528015610a8d578160200160208202803683370190505b50905060005b82811015610ae257610aa6600082610e18565b828281518110610ab857610ab8614d32565b6001600160a01b039092166020928302919091019091015280610ada81614d5e565b915050610a93565b5092915050565b60006108a361179a565b6001600160a01b0381163314610b685760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b60648201526084015b60405180910390fd5b61088482826118c5565b6000610b7d8161167b565b6108846a4d494e5445525f524f4c4560a81b83610a16565b6a4d494e5445525f524f4c4560a81b610bad8161167b565b61093783836118e7565b610937838383604051806020016040528060008152506110cf565b610bdd335b8261196e565b610bfd57604051630247e3a960e01b815260048101829052602401610b5f565b610c0681611990565b50565b6a4d494e5445525f524f4c4560a81b610c218161167b565b610c2c8484846119e3565b50505050565b600061089382611aae565b6000610c488161167b565b60196109378382614e43565b6a4d494e5445525f524f4c4560a81b610c6c8161167b565b6109378383611b0b565b6000600160401b821015610c8d5761089382611b15565b61089382611b75565b6000610ca18161167b565b6108846a4d494e5445525f524f4c4560a81b8361111a565b60198054610cc690614dc3565b80601f0160208091040260200160405190810160405280929190818152602001828054610cf290614dc3565b8015610d3f5780601f10610d1457610100808354040283529160200191610d3f565b820191906000526020600020905b815481529060010190602001808311610d2257829003601f168201915b505050505081565b6000610d5282611b89565b610d5b83611c54565b6108939190614d77565b610c2c84848484611cda565b610c0681611dc3565b600060608082808083610dae7f00000000000000000000000000000000000000000000000000000000000000006015611e4f565b610dd97f00000000000000000000000000000000000000000000000000000000000000006016611e4f565b60408051600080825260208201909252600f60f81b9b939a50919850469750309650945092509050565b6000610e0e8161167b565b6109378383611ef3565b6000828152600160205260408120610e309083611fad565b9392505050565b6000918252602082815260408084206001600160a01b0393909316845291905290205460ff1690565b6000610e6b8161167b565b60186109378382614e43565b60606108a3611fb9565b6a4d494e5445525f524f4c4560a81b610e998161167b565b61088482611fc8565b6000610ead82610c76565b9050826001600160a01b0316816001600160a01b031614610ef357604051634fefd56160e01b8152600481018390526001600160a01b0382166024820152604401610b5f565b61093782610bd2565b6a4d494e5445525f524f4c4560a81b610f148161167b565b6109378383612017565b81333b15801590610f9857506002546040516305a3b80960e01b81523360048201526001600160a01b03909116906305a3b80990602401602060405180830381865afa158015610f72573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f969190614f02565b155b15610fb85760405163f6fa4cbd60e01b8152336004820152602401610b5f565b6001600160a01b0381163b1580159061103c57506002546040516305a3b80960e01b81526001600160a01b038381166004830152909116906305a3b80990602401602060405180830381865afa158015611016573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061103a9190614f02565b155b15611065576040516341b8d58160e11b81526001600160a01b0382166004820152602401610b5f565b6109378383612085565b6a4d494e5445525f524f4c4560a81b6110878161167b565b60005b848110156110c7576110b58686838181106110a7576110a7614d32565b9050602002013585856119e3565b806110bf81614d5e565b91505061108a565b505050505050565b600160401b8210156110ec576110e78484848461208f565b610c2c565b610c2c848484846120c2565b6060610893826120e7565b60008181526001602052604081206108939061214d565b6000828152602081905260409020600101546111358161167b565b61093783836118c5565b6a4d494e5445525f524f4c4560a81b6111578161167b565b61088482612157565b60005b818110156109375761118c83838381811061118057611180614d32565b90506020020135610bd2565b8061119681614d5e565b915050611163565b60006111a98161167b565b610884826121a6565b60188054610cc690614dc3565b6001600160a01b03808316600090815260126020908152604080832093851683529290529081205460ff16610e30565b6a4d494e5445525f524f4c4560a81b6112078161167b565b610937838361229b565b600060208351101561122d57611226836122a5565b9050610893565b816112388482614e43565b5060ff9050610893565b90565b61124f8282610e37565b610884576000828152602081815260408083206001600160a01b03851684529091529020805460ff191660011790556112853390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b6000610e30836001600160a01b0384166122e3565b60006001600160e01b03198216635604e22560e01b1480610893575061089382612332565b6060600d805461131290614dc3565b80601f016020809104026020016040519081016040528092919081815260200182805461133e90614dc3565b801561138b5780601f106113605761010080835404028352916020019161138b565b820191906000526020600020905b81548152906001019060200180831161136e57829003601f168201915b5050505050905090565b60006113a08261233d565b506000908152601160205260409020546001600160a01b031690565b60006113c782611aae565b61142b5760405162461bcd60e51b815260206004820152602f60248201527f4552433732315073693a20617070726f76656420717565727920666f72206e6f60448201526e3732bc34b9ba32b73a103a37b5b2b760891b6064820152608401610b5f565b506000908152600a60205260409020546001600160a01b031690565b600061145282611b15565b9050806001600160a01b0316836001600160a01b0316036114bf5760405162461bcd60e51b815260206004820152602160248201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e656044820152603960f91b6064820152608401610b5f565b336001600160a01b03821614806114db57506114db81336111bf565b61154d5760405162461bcd60e51b815260206004820152603d60248201527f4552433732313a20617070726f76652063616c6c6572206973206e6f7420746f60448201527f6b656e206f776e6572206f7220617070726f76656420666f7220616c6c0000006064820152608401610b5f565b610937838361238d565b600061156282610c76565b9050806001600160a01b0316836001600160a01b0316036115d15760405162461bcd60e51b8152602060048201526024808201527f4552433732315073693a20617070726f76616c20746f2063757272656e74206f6044820152633bb732b960e11b6064820152608401610b5f565b336001600160a01b03821614806115ed57506115ed81336111bf565b61154d5760405162461bcd60e51b815260206004820152603b60248201527f4552433732315073693a20617070726f76652063616c6c6572206973206e6f7460448201527f206f776e6572206e6f7220617070726f76656420666f7220616c6c00000000006064820152608401610b5f565b60006116696124de565b611671612548565b6108a39190614f1f565b610c06813361255c565b60005b81518110156108845760008282815181106116a5576116a5614d32565b602002602001015190506116c1816000015182602001516125b5565b50806116cc81614d5e565b915050611688565b6116dd33610bd7565b6116f95760405162461bcd60e51b8152600401610b5f90614f32565b6109378383836125f6565b61170d33610bd7565b6116f95760405162461bcd60e51b8152600401610b5f90614f7f565b60005b815181101561088457600082828151811061174957611749614d32565b6020026020010151905061176581600001518260200151611b0b565b508061177081614d5e565b91505061172c565b6117828282611245565b600082815260016020526040902061093790826112c9565b6000306001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161480156117f357507f000000000000000000000000000000000000000000000000000000000000000046145b1561181d57507f000000000000000000000000000000000000000000000000000000000000000090565b6108a3604080517f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f60208201527f0000000000000000000000000000000000000000000000000000000000000000918101919091527f000000000000000000000000000000000000000000000000000000000000000060608201524660808201523060a082015260009060c00160405160208183030381529060405280519060200120905090565b6118cf82826127fd565b60008281526001602052604090206109379082612862565b600160401b811061190e5760405163b73c99f560e01b815260048101829052602401610b5f565b600881901c600090815260146020526040902054600160ff83161b161561194b576040516305dcda1160e51b815260048101829052602401610b5f565b6119558282612877565b6013805490600061196583614d5e565b91905055505050565b6000600160401b8210156119865761122683836129d2565b610e308383612a31565b600160401b8110156119da576119a581612af6565b600881901c60009081526014602052604081208054600160ff85161b17905560138054916119d283614fd3565b919050555050565b610c0681612b79565b6127106001600160601b0382161115611a0e5760405162461bcd60e51b8152600401610b5f90614fea565b6001600160a01b038216611a645760405162461bcd60e51b815260206004820152601b60248201527f455243323938313a20496e76616c696420706172616d657465727300000000006044820152606401610b5f565b6040805180820182526001600160a01b0393841681526001600160601b0392831660208083019182526000968752600490529190942093519051909116600160a01b029116179055565b6000600160401b821015611b02576000828152600f60205260409020546001600160a01b0316158015906108935750600882901c600090815260146020526040902054600160ff84161b1615151592915050565b61089382612bbb565b6108848282612bf0565b6000818152600f60205260408120546001600160a01b0316806108935760405162461bcd60e51b8152602060048201526018602482015277115490cdcc8c4e881a5b9d985b1a59081d1bdad95b88125160421b6044820152606401610b5f565b600080611b8183612c0a565b509392505050565b60006001600160a01b038216611bf75760405162461bcd60e51b815260206004820152602d60248201527f4552433732315073693a2062616c616e636520717565727920666f722074686560448201526c207a65726f206164647265737360981b6064820152608401610b5f565b6000600160401b5b600954811015610ae257611c1281611aae565b15611c4457611c2081610c76565b6001600160a01b0316846001600160a01b031603611c4457611c4182614d5e565b91505b611c4d81614d5e565b9050611bff565b60006001600160a01b038216611cbe5760405162461bcd60e51b815260206004820152602960248201527f4552433732313a2061646472657373207a65726f206973206e6f7420612076616044820152683634b21037bbb732b960b91b6064820152608401610b5f565b506001600160a01b031660009081526010602052604090205490565b42821015611cfb5760405163068568f360e21b815260040160405180910390fd5b6000611d08858585612ca1565b9050611d1d611d1685610c76565b8284612d7a565b15611d3257611d2c858561238d565b50610c2c565b60008251604003611d7957611d7282611d4e8560006020612e84565b611d5790615034565b611d648660206040612e84565b611d6d90615034565b612f91565b9050611da5565b8251604103611d8c57611d728284612fae565b604051638baa579f60e01b815260040160405180910390fd5b611daf8186612fca565b15611d8c57611dbe868661238d565b6110c7565b60005b8151811015610884576000828281518110611de357611de3614d32565b6020026020010151905060005b816020015151811015611e3a57611e28826000015183602001518381518110611e1b57611e1b614d32565b6020026020010151610ea2565b80611e3281614d5e565b915050611df0565b50508080611e4790614d5e565b915050611dc6565b606060ff8314611e625761122683612fe9565b818054611e6e90614dc3565b80601f0160208091040260200160405190810160405280929190818152602001828054611e9a90614dc3565b8015611ee75780601f10611ebc57610100808354040283529160200191611ee7565b820191906000526020600020905b815481529060010190602001808311611eca57829003601f168201915b50505050509050610893565b6127106001600160601b0382161115611f1e5760405162461bcd60e51b8152600401610b5f90614fea565b6001600160a01b038216611f745760405162461bcd60e51b815260206004820152601960248201527f455243323938313a20696e76616c6964207265636569766572000000000000006044820152606401610b5f565b604080518082019091526001600160a01b039092168083526001600160601b039091166020909201829052600160a01b90910217600355565b6000610e308383613028565b6060600e805461131290614dc3565b60005b8151811015610884576000828281518110611fe857611fe8614d32565b6020026020010151905061200481600001518260200151613052565b508061200f81614d5e565b915050611fcb565b600160401b811061203e5760405163b73c99f560e01b815260048101829052602401610b5f565b600881901c600090815260146020526040902054600160ff83161b161561207b576040516305dcda1160e51b815260048101829052602401610b5f565b6119558282613093565b61088482826130ad565b61209a335b8361196e565b6120b65760405162461bcd60e51b8152600401610b5f90614f32565b610c2c848484846130b8565b6120cb33612094565b6120b65760405162461bcd60e51b8152600401610b5f90614f7f565b60606120f28261233d565b60006120fc6130dc565b9050600081511161211c5760405180602001604052806000815250610e30565b80612126846130eb565b604051602001612137929190615058565b6040516020818303038152906040529392505050565b6000610893825490565b60005b815181101561088457600082828151811061217757612177614d32565b602002602001015190506121938160000151826020015161229b565b508061219e81614d5e565b91505061215a565b6040516301ffc9a760e01b81526305a3b80960e01b60048201526001600160a01b038216906301ffc9a790602401602060405180830381865afa1580156121f1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906122159190614f02565b6122325760405163d6f93fb760e01b815260040160405180910390fd5b600254604080516001600160a01b03928316815291831660208301527f3edc37a14cc8047c7c8a3f354311efe86c14848efd4e3765a3e1e57eea04ea76910160405180910390a1600280546001600160a01b0319166001600160a01b0392909216919091179055565b610884828261317d565b600080829050601f815111156122d0578260405163305a27a960e01b8152600401610b5f919061450b565b80516122db82615034565b179392505050565b600081815260018301602052604081205461232a57508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155610893565b506000610893565b6000610893826132f6565b61234681611aae565b610c065760405162461bcd60e51b8152602060048201526018602482015277115490cdcc8c4e881a5b9d985b1a59081d1bdad95b88125160421b6044820152606401610b5f565b81333b1580159061240757506002546040516305a3b80960e01b81523360048201526001600160a01b03909116906305a3b80990602401602060405180830381865afa1580156123e1573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906124059190614f02565b155b156124275760405163f6fa4cbd60e01b8152336004820152602401610b5f565b6001600160a01b0381163b158015906124ab57506002546040516305a3b80960e01b81526001600160a01b038381166004830152909116906305a3b80990602401602060405180830381865afa158015612485573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906124a99190614f02565b155b156124d4576040516341b8d58160e11b81526001600160a01b0382166004820152602401610b5f565b6109378383613336565b6009546000906701000000000000009082906124fe9060081c6001614d77565b9050815b81811015612542576000818152600c602052604090205461252281613356565b61252c9086614d77565b945050808061253a90614d5e565b915050612502565b50505090565b6000600160401b6009546108a39190614f1f565b6125668282610e37565b6108845761257381613375565b61257e836020613387565b60405160200161258f929190615087565b60408051601f198184030181529082905262461bcd60e51b8252610b5f9160040161450b565b60005b8151811015610937576125e4838383815181106125d7576125d7614d32565b6020026020010151612017565b806125ee81614d5e565b9150506125b8565b828233321480159061267157506002546040516305a3b80960e01b81523360048201526001600160a01b03909116906305a3b80990602401602060405180830381865afa15801561264b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061266f9190614f02565b155b156126915760405163937db65f60e01b8152336004820152602401610b5f565b6001600160a01b0382163b1580159061271557506002546040516305a3b80960e01b81526001600160a01b038481166004830152909116906305a3b80990602401602060405180830381865afa1580156126ef573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906127139190614f02565b155b1561273e5760405163f934453160e01b81526001600160a01b0383166004820152602401610b5f565b6001600160a01b0381163b158015906127c257506002546040516305a3b80960e01b81526001600160a01b038381166004830152909116906305a3b80990602401602060405180830381865afa15801561279c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906127c09190614f02565b155b156127eb57604051632a67242160e11b81526001600160a01b0382166004820152602401610b5f565b6127f6858585613522565b5050505050565b6128078282610e37565b15610884576000828152602081815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b6000610e30836001600160a01b03841661354c565b6001600160a01b0382166128cd5760405162461bcd60e51b815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f20616464726573736044820152606401610b5f565b6128d681611aae565b156129235760405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e746564000000006044820152606401610b5f565b61292c81611aae565b156129795760405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e746564000000006044820152606401610b5f565b6001600160a01b038216600081815260106020908152604080832080546001019055848352600f90915280822080546001600160a01b0319168417905551839291906000805160206152a4833981519152908290a45050565b6000806129de83611b15565b9050806001600160a01b0316846001600160a01b03161480612a055750612a0581856111bf565b80612a295750836001600160a01b0316612a1e846108a8565b6001600160a01b0316145b949350505050565b6000612a3c82611aae565b612aa05760405162461bcd60e51b815260206004820152602f60248201527f4552433732315073693a206f70657261746f7220717565727920666f72206e6f60448201526e3732bc34b9ba32b73a103a37b5b2b760891b6064820152608401610b5f565b6000612aab83610c76565b9050806001600160a01b0316846001600160a01b03161480612ae65750836001600160a01b0316612adb846108a8565b6001600160a01b0316145b80612a295750612a2981856111bf565b6000612b0182611b15565b9050612b0c82611b15565b600083815260116020908152604080832080546001600160a01b03199081169091556001600160a01b038516808552601084528285208054600019019055878552600f909352818420805490911690555192935084926000805160206152a4833981519152908390a45050565b6000612b8482610c76565b9050612b91600c8361363f565b60405182906000906001600160a01b038416906000805160206152a4833981519152908390a45050565b600881901c6000908152600c6020526040812054600160ff1b60ff84161c1615612be757506000919050565b6108938261366b565b61088482826040518060200160405280600081525061368a565b600080612c1683611aae565b612c775760405162461bcd60e51b815260206004820152602c60248201527f4552433732315073693a206f776e657220717565727920666f72206e6f6e657860448201526b34b9ba32b73a103a37b5b2b760a11b6064820152608401610b5f565b612c80836136cb565b6000818152600860205260409020546001600160a01b031694909350915050565b6000612a29604051602001612d0f90660a0cae4dad2e8560cb1b81527f61646472657373207370656e6465722c75696e7432353620746f6b656e49642c60078201527f75696e74323536206e6f6e63652c75696e7432353620646561646c696e652900602782015260460190565b60408051808303601f19018152828252805160209182012060008881526017835283902054918401526001600160a01b0388169183019190915260608201869052608082015260a0810184905260c001604051602081830303815290604052805190602001206136d8565b6000806000856001600160a01b0316631626ba7e60e01b8686604051602401612da49291906150fc565b60408051601f198184030181529181526020820180516001600160e01b03166001600160e01b0319909416939093179092529051612de29190615115565b600060405180830381855afa9150503d8060008114612e1d576040519150601f19603f3d011682016040523d82523d6000602084013e612e22565b606091505b5091509150818015612e35575080516020145b15612e7857600081806020019051810190612e509190615131565b90506374eca2c160e11b6001600160e01b0319821601612e765760019350505050610e30565b505b50600095945050505050565b606081612e9281601f614d77565b1015612ed15760405162461bcd60e51b815260206004820152600e60248201526d736c6963655f6f766572666c6f7760901b6044820152606401610b5f565b612edb8284614d77565b84511015612f1f5760405162461bcd60e51b8152602060048201526011602482015270736c6963655f6f75744f66426f756e647360781b6044820152606401610b5f565b606082158015612f3e5760405191506000825260208201604052612f88565b6040519150601f8416801560200281840101858101878315602002848b0101015b81831015612f77578051835260209283019201612f5f565b5050858452601f01601f1916604052505b50949350505050565b6000806000612fa1868686613705565b91509150612f888161373e565b6000806000612fbd8585613888565b91509150611b818161373e565b60006001600160a01b03831615801590610e305750610e30838361196e565b60606000612ff6836138ca565b604080516020808252818301909252919250600091906020820181803683375050509182525060208101929092525090565b600082600001828154811061303f5761303f614d32565b9060005260206000200154905092915050565b60005b8151811015610937576130818383838151811061307457613074614d32565b60200260200101516118e7565b8061308b81614d5e565b915050613055565b6108848282604051806020016040528060008152506138f2565b6108843383836138fd565b600160401b8210156130d0576110e7848484846139cb565b610c2c848484846139fe565b60606019805461131290614dc3565b606060006130f883613a17565b60010190506000816001600160401b0381111561311757613117614578565b6040519080825280601f01601f191660200182016040528015613141576020820181803683370190505b5090508181016020015b600019016f181899199a1a9b1b9c1cb0b131b232b360811b600a86061a8153600a850494508461314b57509392505050565b600061318860095490565b9050600082116131e85760405162461bcd60e51b815260206004820152602560248201527f4552433732315073693a207175616e74697479206d7573742062652067726561604482015264074657220360dc1b6064820152608401610b5f565b6001600160a01b03831661324a5760405162461bcd60e51b815260206004820152602360248201527f4552433732315073693a206d696e7420746f20746865207a65726f206164647260448201526265737360e81b6064820152608401610b5f565b816009600082825461325c9190614d77565b9091555050600081815260086020526040902080546001600160a01b0319166001600160a01b03851617905561329360058261363f565b6000806132a08484614d77565b90506001600160a01b0385169150828260006000805160206152a4833981519152600080a4600183015b8181146132f057808360006000805160206152a4833981519152600080a46001016132ca565b506127f6565b60006001600160e01b031982166380ac58cd60e01b148061332757506001600160e01b03198216635b5e139f60e01b145b80610893575061089382613aef565b600160401b81101561334c576108848282613b2f565b6108848282613b9d565b60005b811561337057600019820190911690600101613359565b919050565b60606108936001600160a01b03831660145b60606000613396836002614d8a565b6133a1906002614d77565b6001600160401b038111156133b8576133b8614578565b6040519080825280601f01601f1916602001820160405280156133e2576020820181803683370190505b509050600360fc1b816000815181106133fd576133fd614d32565b60200101906001600160f81b031916908160001a905350600f60fb1b8160018151811061342c5761342c614d32565b60200101906001600160f81b031916908160001a9053506000613450846002614d8a565b61345b906001614d77565b90505b60018111156134d3576f181899199a1a9b1b9c1cb0b131b232b360811b85600f166010811061348f5761348f614d32565b1a60f81b8282815181106134a5576134a5614d32565b60200101906001600160f81b031916908160001a90535060049490941c936134cc81614fd3565b905061345e565b508315610e305760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152606401610b5f565b600081815260176020526040812080549161353c83614d5e565b9190505550610937838383613bd2565b60008181526001830160205260408120548015613635576000613570600183614f1f565b855490915060009061358490600190614f1f565b90508181146135e95760008660000182815481106135a4576135a4614d32565b90600052602060002001549050808760000184815481106135c7576135c7614d32565b6000918252602080832090910192909255918252600188019052604090208390555b85548690806135fa576135fa61514e565b600190038181906000526020600020016000905590558560010160008681526020019081526020016000206000905560019350505050610893565b6000915050610893565b600881901c600090815260209290925260409091208054600160ff1b60ff9093169290921c9091179055565b600061367660095490565b82108015610893575050600160401b111590565b600061369560095490565b90506136a1848461317d565b6136af600085838686613bf4565b610c2c5760405162461bcd60e51b8152600401610b5f90615164565b6000610893600583613d2b565b60006108936136e561179a565b8360405161190160f01b8152600281019290925260228201526042902090565b6000806001600160ff1b0383168161372260ff86901c601b614d77565b905061373087828885613e23565b935093505050935093915050565b6000816004811115613752576137526151b9565b0361375a5750565b600181600481111561376e5761376e6151b9565b036137bb5760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e617475726500000000000000006044820152606401610b5f565b60028160048111156137cf576137cf6151b9565b0361381c5760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152606401610b5f565b6003816004811115613830576138306151b9565b03610c065760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c604482015261756560f01b6064820152608401610b5f565b60008082516041036138be5760208301516040840151606085015160001a6138b287828585613e23565b945094505050506109ee565b506000905060026109ee565b600060ff8216601f81111561089357604051632cd44ac360e21b815260040160405180910390fd5b610937838383613ee7565b816001600160a01b0316836001600160a01b03160361395e5760405162461bcd60e51b815260206004820152601960248201527f4552433732313a20617070726f766520746f2063616c6c6572000000000000006044820152606401610b5f565b6001600160a01b03838116600081815260126020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b6139d68484846125f6565b6139e284848484613f1a565b610c2c5760405162461bcd60e51b8152600401610b5f906151cf565b613a098484846125f6565b6136af848484600185613bf4565b60008072184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b8310613a565772184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b830492506040015b6d04ee2d6d415b85acef81000000008310613a82576d04ee2d6d415b85acef8100000000830492506020015b662386f26fc100008310613aa057662386f26fc10000830492506010015b6305f5e1008310613ab8576305f5e100830492506008015b6127108310613acc57612710830492506004015b60648310613ade576064830492506002015b600a83106108935760010192915050565b60006001600160e01b031982166380ac58cd60e01b1480613b2057506001600160e01b03198216635b5e139f60e01b145b80610893575061089382614013565b600081815260116020526040902080546001600160a01b0319166001600160a01b0384169081179091558190613b6482611b15565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b6000818152600a6020526040902080546001600160a01b0319166001600160a01b0384169081179091558190613b6482610c76565b600160401b811015613be957610937838383614038565b61093783838361418a565b60006001600160a01b0385163b15613d1e57506001835b613c158486614d77565b811015613d1857604051630a85bd0160e11b81526001600160a01b0387169063150b7a0290613c4e9033908b9086908990600401615221565b6020604051808303816000875af1925050508015613c89575060408051601f3d908101601f19168201909252613c8691810190615131565b60015b613ce6573d808015613cb7576040519150601f19603f3d011682016040523d82523d6000602084013e613cbc565b606091505b508051600003613cde5760405162461bcd60e51b8152600401610b5f90615164565b805181602001fd5b828015613d0357506001600160e01b03198116630a85bd0160e11b145b92505080613d1081614d5e565b915050613c0b565b50613d22565b5060015b95945050505050565b600881901c60008181526020849052604081205490919060ff808516919082181c8015613d6d57613d5b81614362565b60ff168203600884901b179350613e1a565b60008311613dda5760405162461bcd60e51b815260206004820152603460248201527f4269744d6170733a205468652073657420626974206265666f7265207468652060448201527334b73232bc103237b2b9b713ba1032bc34b9ba1760611b6064820152608401610b5f565b506000199091016000818152602086905260409020549091908015613e1557613e0281614362565b60ff0360ff16600884901b179350613e1a565b613d6d565b50505092915050565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0831115613e5a5750600090506003613ede565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015613eae573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b038116613ed757600060019250925050613ede565b9150600090505b94509492505050565b613ef183836143cc565b613efe6000848484613f1a565b6109375760405162461bcd60e51b8152600401610b5f906151cf565b60006001600160a01b0384163b1561400857604051630a85bd0160e11b81526001600160a01b0385169063150b7a0290613f5e903390899088908890600401615221565b6020604051808303816000875af1925050508015613f99575060408051601f3d908101601f19168201909252613f9691810190615131565b60015b613fee573d808015613fc7576040519150601f19603f3d011682016040523d82523d6000602084013e613fcc565b606091505b508051600003613cde5760405162461bcd60e51b8152600401610b5f906151cf565b6001600160e01b031916630a85bd0160e11b149050612a29565b506001949350505050565b60006001600160e01b0319821663152a902d60e11b14806108935750610893826143d6565b826001600160a01b031661404b82611b15565b6001600160a01b0316146140715760405162461bcd60e51b8152600401610b5f9061525e565b6001600160a01b0382166140d35760405162461bcd60e51b8152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f206164646044820152637265737360e01b6064820152608401610b5f565b826001600160a01b03166140e682611b15565b6001600160a01b03161461410c5760405162461bcd60e51b8152600401610b5f9061525e565b600081815260116020908152604080832080546001600160a01b03199081169091556001600160a01b0387811680865260108552838620805460001901905590871680865283862080546001019055868652600f90945282852080549092168417909155905184936000805160206152a483398151915291a4505050565b60008061419683612c0a565b91509150846001600160a01b0316826001600160a01b0316146142105760405162461bcd60e51b815260206004820152602c60248201527f4552433732315073693a207472616e73666572206f6620746f6b656e2074686160448201526b3a1034b9903737ba1037bbb760a11b6064820152608401610b5f565b6001600160a01b0384166142765760405162461bcd60e51b815260206004820152602760248201527f4552433732315073693a207472616e7366657220746f20746865207a65726f206044820152666164647265737360c81b6064820152608401610b5f565b61428160008461238d565b600061428e846001614d77565b600881901c600090815260056020526040902054909150600160ff1b60ff83161c161580156142be575060095481105b156142f557600081815260086020526040902080546001600160a01b0319166001600160a01b0388161790556142f560058261363f565b600084815260086020526040902080546001600160a01b0319166001600160a01b03871617905581841461432e5761432e60058561363f565b83856001600160a01b0316876001600160a01b03166000805160206152a483398151915260405160405180910390a46110c7565b600060405180610120016040528061010081526020016152c4610100913960f87e818283848586878898a8b8c8d8e8f929395969799a9b9d9e9faaeb6bedeeff6143ab856143e1565b02901c815181106143be576143be614d32565b016020015160f81c92915050565b6108848282612877565b6000610893826143f9565b60008082116143ef57600080fd5b5060008190031690565b60006001600160e01b03198216635a05180f60e01b148061089357506108938260006001600160e01b03198216637965db0b60e01b148061089357506301ffc9a760e01b6001600160e01b0319831614610893565b60006020828403121561446057600080fd5b81356001600160401b0381111561447657600080fd5b820160608185031215610e3057600080fd5b6001600160e01b031981168114610c0657600080fd5b6000602082840312156144b057600080fd5b8135610e3081614488565b60005b838110156144d65781810151838201526020016144be565b50506000910152565b600081518084526144f78160208601602086016144bb565b601f01601f19169290920160200192915050565b602081526000610e3060208301846144df565b60006020828403121561453057600080fd5b5035919050565b80356001600160a01b038116811461337057600080fd5b6000806040838503121561456157600080fd5b61456a83614537565b946020939093013593505050565b634e487b7160e01b600052604160045260246000fd5b604080519081016001600160401b03811182821017156145b0576145b0614578565b60405290565b604051601f8201601f191681016001600160401b03811182821017156145de576145de614578565b604052919050565b60006001600160401b038211156145ff576145ff614578565b5060051b60200190565b600061461c614617846145e6565b6145b6565b8381529050602080820190600585811b85018781111561463b57600080fd5b855b8181101561470e5780356001600160401b038082111561465d5760008081fd5b908801906040828c0312156146725760008081fd5b61467a61458e565b61468383614537565b815286830135828111156146975760008081fd5b8084019350508b601f8401126146af57600091508182fd5b823591506146bf614617836145e6565b82815291861b8301870191878101908d8411156146dc5760008081fd5b938801935b838510156146fa578435825293880193908801906146e1565b82890152508752505093830193830161463d565b50505050509392505050565b60006020828403121561472c57600080fd5b81356001600160401b0381111561474257600080fd5b8201601f8101841361475357600080fd5b612a2984823560208401614609565b60008060006060848603121561477757600080fd5b61478084614537565b925061478e60208501614537565b9150604084013590509250925092565b600080604083850312156147b157600080fd5b50508035926020909101359150565b600060208083850312156147d357600080fd5b82356001600160401b038111156147e957600080fd5b8301601f810185136147fa57600080fd5b8035614808614617826145e6565b81815260069190911b8201830190838101908783111561482757600080fd5b928401925b8284101561487157604084890312156148455760008081fd5b61484d61458e565b61485685614537565b8152848601358682015282526040909301929084019061482c565b979650505050505050565b6000806040838503121561488f57600080fd5b8235915061489f60208401614537565b90509250929050565b6020808252825182820181905260009190848201906040850190845b818110156148e95783516001600160a01b0316835292840192918401916001016148c4565b50909695505050505050565b60006020828403121561490757600080fd5b610e3082614537565b80356001600160601b038116811461337057600080fd5b60008060006060848603121561493c57600080fd5b8335925061494c60208501614537565b915061495a60408501614910565b90509250925092565b60006001600160401b0383111561497c5761497c614578565b61498f601f8401601f19166020016145b6565b90508281528383830111156149a357600080fd5b828260208301376000602084830101529392505050565b6000602082840312156149cc57600080fd5b81356001600160401b038111156149e257600080fd5b8201601f810184136149f357600080fd5b612a2984823560208401614963565b600082601f830112614a1357600080fd5b610e3083833560208501614963565b60008060008060808587031215614a3857600080fd5b614a4185614537565b9350602085013592506040850135915060608501356001600160401b03811115614a6a57600080fd5b614a7687828801614a02565b91505092959194509250565b60ff60f81b881681526000602060e081840152614aa260e084018a6144df565b8381036040850152614ab4818a6144df565b606085018990526001600160a01b038816608086015260a0850187905284810360c0860152855180825283870192509083019060005b81811015614b0657835183529284019291840191600101614aea565b50909c9b505050505050505050505050565b60008060408385031215614b2b57600080fd5b614b3483614537565b915061489f60208401614910565b8015158114610c0657600080fd5b60008060408385031215614b6357600080fd5b614b6c83614537565b91506020830135614b7c81614b42565b809150509250929050565b60008083601f840112614b9957600080fd5b5081356001600160401b03811115614bb057600080fd5b6020830191508360208260051b85010111156109ee57600080fd5b60008060008060608587031215614be157600080fd5b84356001600160401b03811115614bf757600080fd5b614c0387828801614b87565b9095509350614c16905060208601614537565b9150614c2460408601614910565b905092959194509250565b60008060008060808587031215614c4557600080fd5b614c4e85614537565b9350614c5c60208601614537565b92506040850135915060608501356001600160401b03811115614a6a57600080fd5b60008060208385031215614c9157600080fd5b82356001600160401b03811115614ca757600080fd5b614cb385828601614b87565b90969095509350505050565b60008060408385031215614cd257600080fd5b614cdb83614537565b915061489f60208401614537565b6000808335601e19843603018112614d0057600080fd5b8301803591506001600160401b03821115614d1a57600080fd5b6020019150600581901b36038213156109ee57600080fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b600060018201614d7057614d70614d48565b5060010190565b8082018082111561089357610893614d48565b808202811582820484141761089357610893614d48565b600082614dbe57634e487b7160e01b600052601260045260246000fd5b500490565b600181811c90821680614dd757607f821691505b602082108103614df757634e487b7160e01b600052602260045260246000fd5b50919050565b601f82111561093757600081815260208120601f850160051c81016020861015614e245750805b601f850160051c820191505b818110156110c757828155600101614e30565b81516001600160401b03811115614e5c57614e5c614578565b614e7081614e6a8454614dc3565b84614dfd565b602080601f831160018114614ea55760008415614e8d5750858301515b600019600386901b1c1916600185901b1785556110c7565b600085815260208120601f198616915b82811015614ed457888601518255948401946001909101908401614eb5565b5085821015614ef25787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b600060208284031215614f1457600080fd5b8151610e3081614b42565b8181038181111561089357610893614d48565b6020808252602d908201527f4552433732313a2063616c6c6572206973206e6f7420746f6b656e206f776e6560408201526c1c881bdc88185c1c1c9bdd9959609a1b606082015260800190565b60208082526034908201527f4552433732315073693a207472616e736665722063616c6c6572206973206e6f6040820152731d081bdddb995c881b9bdc88185c1c1c9bdd995960621b606082015260800190565b600081614fe257614fe2614d48565b506000190190565b6020808252602a908201527f455243323938313a20726f79616c7479206665652077696c6c206578636565646040820152692073616c65507269636560b01b606082015260800190565b80516020808301519190811015614df75760001960209190910360031b1b16919050565b6000835161506a8184602088016144bb565b83519083019061507e8183602088016144bb565b01949350505050565b7f416363657373436f6e74726f6c3a206163636f756e74200000000000000000008152600083516150bf8160178501602088016144bb565b7001034b99036b4b9b9b4b733903937b6329607d1b60179184019182015283516150f08160288401602088016144bb565b01602801949350505050565b828152604060208201526000612a2960408301846144df565b600082516151278184602087016144bb565b9190910192915050565b60006020828403121561514357600080fd5b8151610e3081614488565b634e487b7160e01b600052603160045260246000fd5b60208082526035908201527f4552433732315073693a207472616e7366657220746f206e6f6e20455243373260408201527418a932b1b2b4bb32b91034b6b83632b6b2b73a32b960591b606082015260800190565b634e487b7160e01b600052602160045260246000fd5b60208082526032908201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560408201527131b2b4bb32b91034b6b83632b6b2b73a32b960711b606082015260800190565b6001600160a01b0385811682528416602082015260408101839052608060608201819052600090615254908301846144df565b9695505050505050565b60208082526025908201527f4552433732313a207472616e736665722066726f6d20696e636f72726563742060408201526437bbb732b960d91b60608201526080019056feddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef0001020903110a19042112290b311a3905412245134d2a550c5d32651b6d3a7506264262237d468514804e8d2b95569d0d495ea533a966b11c886eb93bc176c9071727374353637324837e9b47af86c7155181ad4fd18ed32c9096db57d59ee30e2e4a6a5f92a6be3498aae067ddb2eb1d5989b56fd7baf33ca0c2ee77e5caf7ff0810182028303840444c545c646c7425617c847f8c949c48a4a8b087b8c0c816365272829aaec650acd0d28fdad4e22d6991bd97dfdcea58b4d6f29fede4f6fe0f1f2f3f4b5b6b607b8b93a3a7b7bf357199c5abcfd9e168bcdee9b3f1ecf5fd1e3e5a7a8aa2b670c4ced8bbe8f0f4fc3d79a1c3cde7effb78cce6facbf9f8a26469706673582212207c1340e2d1c7a6af058cbb35c7f1065a255bd81a470929fa89ee68ccabc5922664736f6c63430008110033";class s4 extends fd{constructor(...e){e.length>1?super(...e):super(a4,o4,e[0])}deploy(e,t,n,r,i,a,o,s,c){return super.deploy(e,t,n,r,i,a,o,s,c||{})}getDeployTransaction(e,t,n,r,i,a,o,s,c){return super.getDeployTransaction(e,t,n,r,i,a,o,s,c||{})}attach(e){return super.attach(e)}connect(e){return super.connect(e)}static bytecode=o4;static abi=a4;static createInterface(){return new Ss(a4)}static connect(e,t){return new ud(e,a4,t)}}const c4=[{inputs:[{internalType:"address",name:"owner",type:"address"},{internalType:"string",name:"name_",type:"string"},{internalType:"string",name:"symbol_",type:"string"},{internalType:"string",name:"baseURI_",type:"string"},{internalType:"string",name:"contractURI_",type:"string"},{internalType:"address",name:"_operatorAllowlist",type:"address"},{internalType:"address",name:"_receiver",type:"address"},{internalType:"uint96",name:"_feeNumerator",type:"uint96"}],stateMutability:"nonpayable",type:"constructor"},{inputs:[],name:"AllowlistDoesNotImplementIOperatorAllowlist",type:"error"},{inputs:[{internalType:"address",name:"target",type:"address"}],name:"ApproveTargetNotInAllowlist",type:"error"},{inputs:[{internalType:"address",name:"approver",type:"address"}],name:"ApproverNotInAllowlist",type:"error"},{inputs:[{internalType:"address",name:"caller",type:"address"}],name:"CallerNotInAllowlist",type:"error"},{inputs:[{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"IImmutableERC721IDAboveThreshold",type:"error"},{inputs:[{internalType:"uint256",name:"tokenId",type:"uint256"},{internalType:"address",name:"currentOwner",type:"address"}],name:"IImmutableERC721MismatchedTokenOwner",type:"error"},{inputs:[],name:"IImmutableERC721MismatchedTransferLengths",type:"error"},{inputs:[{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"IImmutableERC721NotOwnerOrOperator",type:"error"},{inputs:[],name:"IImmutableERC721SendingToZerothAddress",type:"error"},{inputs:[{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"IImmutableERC721TokenAlreadyBurned",type:"error"},{inputs:[],name:"InvalidShortString",type:"error"},{inputs:[],name:"InvalidSignature",type:"error"},{inputs:[],name:"PermitExpired",type:"error"},{inputs:[],name:"SignerCannotBeZerothAddress",type:"error"},{inputs:[{internalType:"string",name:"str",type:"string"}],name:"StringTooLong",type:"error"},{inputs:[{internalType:"address",name:"from",type:"address"}],name:"TransferFromNotInAllowlist",type:"error"},{inputs:[{internalType:"address",name:"to",type:"address"}],name:"TransferToNotInAllowlist",type:"error"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"owner",type:"address"},{indexed:!0,internalType:"address",name:"approved",type:"address"},{indexed:!0,internalType:"uint256",name:"tokenId",type:"uint256"}],name:"Approval",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"owner",type:"address"},{indexed:!0,internalType:"address",name:"operator",type:"address"},{indexed:!1,internalType:"bool",name:"approved",type:"bool"}],name:"ApprovalForAll",type:"event"},{anonymous:!1,inputs:[],name:"EIP712DomainChanged",type:"event"},{anonymous:!1,inputs:[{indexed:!1,internalType:"address",name:"oldRegistry",type:"address"},{indexed:!1,internalType:"address",name:"newRegistry",type:"address"}],name:"OperatorAllowlistRegistryUpdated",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"role",type:"bytes32"},{indexed:!0,internalType:"bytes32",name:"previousAdminRole",type:"bytes32"},{indexed:!0,internalType:"bytes32",name:"newAdminRole",type:"bytes32"}],name:"RoleAdminChanged",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"role",type:"bytes32"},{indexed:!0,internalType:"address",name:"account",type:"address"},{indexed:!0,internalType:"address",name:"sender",type:"address"}],name:"RoleGranted",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"bytes32",name:"role",type:"bytes32"},{indexed:!0,internalType:"address",name:"account",type:"address"},{indexed:!0,internalType:"address",name:"sender",type:"address"}],name:"RoleRevoked",type:"event"},{anonymous:!1,inputs:[{indexed:!0,internalType:"address",name:"from",type:"address"},{indexed:!0,internalType:"address",name:"to",type:"address"},{indexed:!0,internalType:"uint256",name:"tokenId",type:"uint256"}],name:"Transfer",type:"event"},{inputs:[],name:"DEFAULT_ADMIN_ROLE",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[],name:"DOMAIN_SEPARATOR",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[],name:"MINTER_ROLE",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[{components:[{internalType:"address",name:"owner",type:"address"},{internalType:"uint256[]",name:"tokenIds",type:"uint256[]"}],internalType:"struct ImmutableERC721Base.IDBurn[]",name:"burns",type:"tuple[]"}],name:"_safeBurnBatch",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"_totalSupply",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"approve",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"owner",type:"address"}],name:"balanceOf",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"baseURI",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"burn",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256[]",name:"tokenIDs",type:"uint256[]"}],name:"burnBatch",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"contractURI",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[],name:"eip712Domain",outputs:[{internalType:"bytes1",name:"fields",type:"bytes1"},{internalType:"string",name:"name",type:"string"},{internalType:"string",name:"version",type:"string"},{internalType:"uint256",name:"chainId",type:"uint256"},{internalType:"address",name:"verifyingContract",type:"address"},{internalType:"bytes32",name:"salt",type:"bytes32"},{internalType:"uint256[]",name:"extensions",type:"uint256[]"}],stateMutability:"view",type:"function"},{inputs:[],name:"getAdmins",outputs:[{internalType:"address[]",name:"",type:"address[]"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"getApproved",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"role",type:"bytes32"}],name:"getRoleAdmin",outputs:[{internalType:"bytes32",name:"",type:"bytes32"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"role",type:"bytes32"},{internalType:"uint256",name:"index",type:"uint256"}],name:"getRoleMember",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"bytes32",name:"role",type:"bytes32"}],name:"getRoleMemberCount",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"user",type:"address"}],name:"grantMinterRole",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes32",name:"role",type:"bytes32"},{internalType:"address",name:"account",type:"address"}],name:"grantRole",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes32",name:"role",type:"bytes32"},{internalType:"address",name:"account",type:"address"}],name:"hasRole",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"owner",type:"address"},{internalType:"address",name:"operator",type:"address"}],name:"isApprovedForAll",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"tokenID",type:"uint256"}],name:"mint",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{components:[{internalType:"address",name:"to",type:"address"},{internalType:"uint256[]",name:"tokenIds",type:"uint256[]"}],internalType:"struct ImmutableERC721Base.IDMint[]",name:"mintRequests",type:"tuple[]"}],name:"mintBatch",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"name",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"nonces",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[],name:"operatorAllowlist",outputs:[{internalType:"contract IOperatorAllowlist",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"ownerOf",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"spender",type:"address"},{internalType:"uint256",name:"tokenId",type:"uint256"},{internalType:"uint256",name:"deadline",type:"uint256"},{internalType:"bytes",name:"sig",type:"bytes"}],name:"permit",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes32",name:"role",type:"bytes32"},{internalType:"address",name:"account",type:"address"}],name:"renounceRole",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"user",type:"address"}],name:"revokeMinterRole",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes32",name:"role",type:"bytes32"},{internalType:"address",name:"account",type:"address"}],name:"revokeRole",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"tokenId",type:"uint256"},{internalType:"uint256",name:"salePrice",type:"uint256"}],name:"royaltyInfo",outputs:[{internalType:"address",name:"",type:"address"},{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"owner",type:"address"},{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"safeBurn",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{components:[{internalType:"address",name:"owner",type:"address"},{internalType:"uint256[]",name:"tokenIds",type:"uint256[]"}],internalType:"struct ImmutableERC721Base.IDBurn[]",name:"burns",type:"tuple[]"}],name:"safeBurnBatch",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"tokenID",type:"uint256"}],name:"safeMint",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{components:[{internalType:"address",name:"to",type:"address"},{internalType:"uint256[]",name:"tokenIds",type:"uint256[]"}],internalType:"struct ImmutableERC721Base.IDMint[]",name:"mintRequests",type:"tuple[]"}],name:"safeMintBatch",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"safeTransferFrom",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"tokenId",type:"uint256"},{internalType:"bytes",name:"data",type:"bytes"}],name:"safeTransferFrom",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{components:[{internalType:"address",name:"from",type:"address"},{internalType:"address[]",name:"tos",type:"address[]"},{internalType:"uint256[]",name:"tokenIds",type:"uint256[]"}],internalType:"struct ImmutableERC721Base.TransferRequest",name:"tr",type:"tuple"}],name:"safeTransferFromBatch",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"operator",type:"address"},{internalType:"bool",name:"approved",type:"bool"}],name:"setApprovalForAll",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"string",name:"baseURI_",type:"string"}],name:"setBaseURI",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"string",name:"_contractURI",type:"string"}],name:"setContractURI",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"receiver",type:"address"},{internalType:"uint96",name:"feeNumerator",type:"uint96"}],name:"setDefaultRoyaltyReceiver",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256",name:"tokenId",type:"uint256"},{internalType:"address",name:"receiver",type:"address"},{internalType:"uint96",name:"feeNumerator",type:"uint96"}],name:"setNFTRoyaltyReceiver",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"uint256[]",name:"tokenIds",type:"uint256[]"},{internalType:"address",name:"receiver",type:"address"},{internalType:"uint96",name:"feeNumerator",type:"uint96"}],name:"setNFTRoyaltyReceiverBatch",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"address",name:"_operatorAllowlist",type:"address"}],name:"setOperatorAllowlistRegistry",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[{internalType:"bytes4",name:"interfaceId",type:"bytes4"}],name:"supportsInterface",outputs:[{internalType:"bool",name:"",type:"bool"}],stateMutability:"view",type:"function"},{inputs:[],name:"symbol",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"tokenURI",outputs:[{internalType:"string",name:"",type:"string"}],stateMutability:"view",type:"function"},{inputs:[],name:"totalSupply",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"from",type:"address"},{internalType:"address",name:"to",type:"address"},{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"transferFrom",outputs:[],stateMutability:"nonpayable",type:"function"}],u4="0x6101606040523480156200001257600080fd5b5060405162004b3738038062004b37833981016040819052620000359162000693565b8787878787878787868681604051806040016040528060018152602001603160f81b815250838381600390816200006d919062000826565b5060046200007c828262000826565b5050506200009a600983620001a960201b620014771790919060201c565b61012052620000b781600a620001a9602090811b6200147717901c565b61014052815160208084019190912060e052815190820120610100524660a0526200014560e05161010051604080517f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f60208201529081019290925260608201524660808201523060a082015260009060c00160405160208183030381529060405280519060200120905090565b60805250503060c052506200015e9050600089620001f9565b6200016a82826200023c565b620001758362000341565b600f62000183868262000826565b50600e62000192858262000826565b505050505050505050505050505050505062000970565b6000602083511015620001c957620001c1836200043a565b9050620001f3565b82620001e0836200047d60201b620014a81760201c565b90620001ed908262000826565b5060ff90505b92915050565b6200021082826200048060201b620014ab1760201c565b6000828152600160209081526040909120620002379183906200152f62000521821b17901c565b505050565b6127106001600160601b0382161115620002b05760405162461bcd60e51b815260206004820152602a60248201527f455243323938313a20726f79616c7479206665652077696c6c206578636565646044820152692073616c65507269636560b01b60648201526084015b60405180910390fd5b6001600160a01b038216620003085760405162461bcd60e51b815260206004820152601960248201527f455243323938313a20696e76616c6964207265636569766572000000000000006044820152606401620002a7565b604080518082019091526001600160a01b039092168083526001600160601b039091166020909201829052600160a01b90910217600c55565b6040516301ffc9a760e01b81526305a3b80960e01b60048201526001600160a01b038216906301ffc9a790602401602060405180830381865afa1580156200038d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620003b39190620008f2565b620003d15760405163d6f93fb760e01b815260040160405180910390fd5b600254604080516001600160a01b03928316815291831660208301527f3edc37a14cc8047c7c8a3f354311efe86c14848efd4e3765a3e1e57eea04ea76910160405180910390a1600280546001600160a01b0319166001600160a01b0392909216919091179055565b600080829050601f8151111562000468578260405163305a27a960e01b8152600401620002a7919062000916565b805162000475826200094b565b179392505050565b90565b6000828152602081815260408083206001600160a01b038516845290915290205460ff166200051d576000828152602081815260408083206001600160a01b03851684529091529020805460ff19166001179055620004dc3390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45b5050565b600062000538836001600160a01b0384166200053f565b9392505050565b60008181526001830160205260408120546200058857508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155620001f3565b506000620001f3565b80516001600160a01b0381168114620005a957600080fd5b919050565b634e487b7160e01b600052604160045260246000fd5b60005b83811015620005e1578181015183820152602001620005c7565b50506000910152565b600082601f830112620005fc57600080fd5b81516001600160401b0380821115620006195762000619620005ae565b604051601f8301601f19908116603f01168101908282118183101715620006445762000644620005ae565b816040528381528660208588010111156200065e57600080fd5b62000671846020830160208901620005c4565b9695505050505050565b80516001600160601b0381168114620005a957600080fd5b600080600080600080600080610100898b031215620006b157600080fd5b620006bc8962000591565b60208a01519098506001600160401b0380821115620006da57600080fd5b620006e88c838d01620005ea565b985060408b0151915080821115620006ff57600080fd5b6200070d8c838d01620005ea565b975060608b01519150808211156200072457600080fd5b620007328c838d01620005ea565b965060808b01519150808211156200074957600080fd5b50620007588b828c01620005ea565b9450506200076960a08a0162000591565b92506200077960c08a0162000591565b91506200078960e08a016200067b565b90509295985092959890939650565b600181811c90821680620007ad57607f821691505b602082108103620007ce57634e487b7160e01b600052602260045260246000fd5b50919050565b601f8211156200023757600081815260208120601f850160051c81016020861015620007fd5750805b601f850160051c820191505b818110156200081e5782815560010162000809565b505050505050565b81516001600160401b03811115620008425762000842620005ae565b6200085a8162000853845462000798565b84620007d4565b602080601f831160018114620008925760008415620008795750858301515b600019600386901b1c1916600185901b1785556200081e565b600085815260208120601f198616915b82811015620008c357888601518255948401946001909101908401620008a2565b5085821015620008e25787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b6000602082840312156200090557600080fd5b815180151581146200053857600080fd5b602081526000825180602084015262000937816040850160208701620005c4565b601f01601f19169190910160400192915050565b80516020808301519190811015620007ce5760001960209190910360031b1b16919050565b60805160a05160c05160e05161010051610120516101405161416c620009cb6000396000610fdc01526000610fb101526000611b3401526000611b0c01526000611a6701526000611a9101526000611abb015261416c6000f3fe608060405234801561001057600080fd5b50600436106102f05760003560e01c806369e2f0fb1161019d578063a1448194116100e9578063ca15c873116100a2578063e4623c1b1161007c578063e4623c1b146106b8578063e4e18f6d146106cb578063e8a3d485146106de578063e985e9c5146106e657600080fd5b8063ca15c8731461067d578063d539139314610690578063d547741f146106a557600080fd5b8063a144819414610616578063a217fddf14610629578063a22cb46514610631578063a701281614610644578063b88d4fde14610657578063c87b56dd1461066a57600080fd5b8063885e7a0811610156578063938e3d7b11610130578063938e3d7b146105d557806395d89b41146105e85780639e2641a3146105f05780639f15d7001461060357600080fd5b8063885e7a081461059c5780639010d07c146105af57806391d14854146105c257600080fd5b806369e2f0fb1461052d5780636c0360eb1461054057806370a0823114610548578063745a41bc1461055b57806374f16a811461056e57806384b0196e1461058157600080fd5b80632f2ff15d1161025c5780633eaaf86b1161021557806342966c68116101ef57806342966c68146104e1578063439aed34146104f457806355f804b3146105075780636352211e1461051a57600080fd5b80633eaaf86b146104b257806340c10f19146104bb57806342842e0e146104ce57600080fd5b80632f2ff15d1461044957806331ae450b1461045c5780633644e5151461047157806336568abe146104795780633dd1eb611461048c5780633e769acd1461049f57600080fd5b806318160ddd116102ae57806318160ddd146103b3578063234af046146103bb57806323b872dd146103ce578063248a9ca3146103e157806329326f29146104045780632a55205a1461041757600080fd5b80628ad946146102f557806301ffc9a71461030a57806306fdde0314610332578063081812fc14610347578063095ea7b314610372578063141a468c14610385575b600080fd5b610308610303366004613441565b610722565b005b61031d610318366004613491565b6107f8565b60405190151581526020015b60405180910390f35b61033a610809565b60405161032991906134fe565b61035a610355366004613511565b61089b565b6040516001600160a01b039091168152602001610329565b610308610380366004613546565b6108c2565b6103a5610393366004613511565b6000908152600b602052604090205490565b604051908152602001610329565b6010546103a5565b6103086103c9366004613712565b6109dc565b6103086103dc36600461375a565b610a34565b6103a56103ef366004613511565b60009081526020819052604090206001015490565b60025461035a906001600160a01b031681565b61042a610425366004613796565b610a66565b604080516001600160a01b039093168352602083019190915201610329565b6103086104573660046137b8565b610b14565b610464610b39565b60405161032991906137e4565b6103a5610be7565b6103086104873660046137b8565b610bf6565b61030861049a366004613831565b610c70565b6103086104ad366004613712565b610c93565b6103a560105481565b6103086104c9366004613546565b610d1f565b6103086104dc36600461375a565b610d5b565b6103086104ef366004613511565b610d76565b610308610502366004613863565b610db4565b6103086105153660046138f6565b610ddd565b61035a610528366004613511565b610df4565b61030861053b366004613831565b610e54565b61033a610e77565b6103a5610556366004613831565b610f05565b61030861056936600461395e565b610f8b565b61030861057c366004613712565b610f97565b610589610fa3565b60405161032997969594939291906139be565b6103086105aa366004613a54565b61102c565b61035a6105bd366004613796565b611041565b61031d6105d03660046137b8565b611060565b6103086105e33660046138f6565b611089565b61033a6110a0565b6103086105fe366004613712565b6110af565b610308610611366004613546565b611107565b610308610624366004613546565b611161565b6103a5600081565b61030861063f366004613a8c565b611193565b610308610652366004613b07565b6112e4565b610308610665366004613b6b565b611344565b61033a610678366004613511565b611376565b6103a561068b366004613511565b6113dc565b6103a56a4d494e5445525f524f4c4560a81b81565b6103086106b33660046137b8565b6113f3565b6103086106c6366004613bba565b611418565b6103086106d9366004613831565b611456565b61033a61146a565b61031d6106f4366004613bfb565b6001600160a01b03918216600090815260086020908152604080832093909416825291909152205460ff1690565b61072f6020820182613c25565b905061073e6040830183613c25565b90501461075e5760405163359a1bc360e01b815260040160405180910390fd5b60005b61076e6040830183613c25565b90508110156107f4576107e26107876020840184613831565b6107946020850185613c25565b848181106107a4576107a4613c6e565b90506020020160208101906107b99190613831565b6107c66040860186613c25565b858181106107d6576107d6613c6e565b90506020020135610d5b565b806107ec81613c9a565b915050610761565b5050565b600061080382611544565b92915050565b60606003805461081890613cb3565b80601f016020809104026020016040519081016040528092919081815260200182805461084490613cb3565b80156108915780601f1061086657610100808354040283529160200191610891565b820191906000526020600020905b81548152906001019060200180831161087457829003601f168201915b5050505050905090565b60006108a682611569565b506000908152600760205260409020546001600160a01b031690565b60006108cd82610df4565b9050806001600160a01b0316836001600160a01b03160361093f5760405162461bcd60e51b815260206004820152602160248201527f4552433732313a20617070726f76616c20746f2063757272656e74206f776e656044820152603960f91b60648201526084015b60405180910390fd5b336001600160a01b038216148061095b575061095b81336106f4565b6109cd5760405162461bcd60e51b815260206004820152603d60248201527f4552433732313a20617070726f76652063616c6c6572206973206e6f7420746f60448201527f6b656e206f776e6572206f7220617070726f76656420666f7220616c6c0000006064820152608401610936565b6109d783836115c8565b505050565b6a4d494e5445525f524f4c4560a81b6109f481611719565b60005b82518110156109d757610a22838281518110610a1557610a15613c6e565b6020026020010151611723565b80610a2c81613c9a565b9150506109f7565b610a3f335b826117b2565b610a5b5760405162461bcd60e51b815260040161093690613ced565b6109d7838383611831565b6000828152600d602090815260408083208151808301909252546001600160a01b038116808352600160a01b9091046001600160601b0316928201929092528291610adb575060408051808201909152600c546001600160a01b0381168252600160a01b90046001600160601b031660208201525b602081015160009061271090610afa906001600160601b031687613d3a565b610b049190613d51565b91519350909150505b9250929050565b600082815260208190526040902060010154610b2f81611719565b6109d78383611a38565b60606000610b46816113dc565b90506000816001600160401b03811115610b6257610b62613570565b604051908082528060200260200182016040528015610b8b578160200160208202803683370190505b50905060005b82811015610be057610ba4600082611041565b828281518110610bb657610bb6613c6e565b6001600160a01b039092166020928302919091019091015280610bd881613c9a565b915050610b91565b5092915050565b6000610bf1611a5a565b905090565b6001600160a01b0381163314610c665760405162461bcd60e51b815260206004820152602f60248201527f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560448201526e103937b632b9903337b91039b2b63360891b6064820152608401610936565b6107f48282611b85565b6000610c7b81611719565b6107f46a4d494e5445525f524f4c4560a81b83610b14565b60005b81518110156107f4576000828281518110610cb357610cb3613c6e565b6020026020010151905060005b816020015151811015610d0a57610cf8826000015183602001518381518110610ceb57610ceb613c6e565b6020026020010151611107565b80610d0281613c9a565b915050610cc0565b50508080610d1790613c9a565b915050610c96565b6a4d494e5445525f524f4c4560a81b610d3781611719565b610d418383611ba7565b60108054906000610d5183613c9a565b9190505550505050565b6109d783838360405180602001604052806000815250611344565b610d7f81611bee565b600881901c60009081526011602052604081208054600160ff85161b1790556010805491610dac83613d73565b919050555050565b6a4d494e5445525f524f4c4560a81b610dcc81611719565b610dd7848484611c1c565b50505050565b6000610de881611719565b600f6109d78382613dd0565b6000818152600560205260408120546001600160a01b0316806108035760405162461bcd60e51b8152602060048201526018602482015277115490cdcc8c4e881a5b9d985b1a59081d1bdad95b88125160421b6044820152606401610936565b6000610e5f81611719565b6107f46a4d494e5445525f524f4c4560a81b836113f3565b600f8054610e8490613cb3565b80601f0160208091040260200160405190810160405280929190818152602001828054610eb090613cb3565b8015610efd5780601f10610ed257610100808354040283529160200191610efd565b820191906000526020600020905b815481529060010190602001808311610ee057829003601f168201915b505050505081565b60006001600160a01b038216610f6f5760405162461bcd60e51b815260206004820152602960248201527f4552433732313a2061646472657373207a65726f206973206e6f7420612076616044820152683634b21037bbb732b960b91b6064820152608401610936565b506001600160a01b031660009081526006602052604090205490565b610dd784848484611ce7565b610fa081610c93565b50565b600060608082808083610fd77f00000000000000000000000000000000000000000000000000000000000000006009611dd0565b6110027f0000000000000000000000000000000000000000000000000000000000000000600a611dd0565b60408051600080825260208201909252600f60f81b9b939a50919850469750309650945092509050565b600061103781611719565b6109d78383611e74565b60008281526001602052604081206110599083611f2e565b9392505050565b6000918252602082815260408084206001600160a01b0393909316845291905290205460ff1690565b600061109481611719565b600e6109d78382613dd0565b60606004805461081890613cb3565b6a4d494e5445525f524f4c4560a81b6110c781611719565b60005b82518110156109d7576110f58382815181106110e8576110e8613c6e565b6020026020010151611f3a565b806110ff81613c9a565b9150506110ca565b600061111282610df4565b9050826001600160a01b0316816001600160a01b03161461115857604051634fefd56160e01b8152600481018390526001600160a01b0382166024820152604401610936565b6109d782610d76565b6a4d494e5445525f524f4c4560a81b61117981611719565b610d41838360405180602001604052806000815250611fb0565b81333b1580159061120d57506002546040516305a3b80960e01b81523360048201526001600160a01b03909116906305a3b80990602401602060405180830381865afa1580156111e7573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061120b9190613e8f565b155b1561122d5760405163f6fa4cbd60e01b8152336004820152602401610936565b6001600160a01b0381163b158015906112b157506002546040516305a3b80960e01b81526001600160a01b038381166004830152909116906305a3b80990602401602060405180830381865afa15801561128b573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112af9190613e8f565b155b156112da576040516341b8d58160e11b81526001600160a01b0382166004820152602401610936565b6109d78383611fe3565b6a4d494e5445525f524f4c4560a81b6112fc81611719565b60005b8481101561133c5761132a86868381811061131c5761131c613c6e565b905060200201358585611c1c565b8061133481613c9a565b9150506112ff565b505050505050565b61134e33836117b2565b61136a5760405162461bcd60e51b815260040161093690613ced565b610dd784848484611fee565b606061138182611569565b600061138b612021565b905060008151116113ab5760405180602001604052806000815250611059565b806113b584612030565b6040516020016113c6929190613eac565b6040516020818303038152906040529392505050565b6000818152600160205260408120610803906120c2565b60008281526020819052604090206001015461140e81611719565b6109d78383611b85565b60005b818110156109d75761144483838381811061143857611438613c6e565b90506020020135610d76565b8061144e81613c9a565b91505061141b565b600061146181611719565b6107f4826120cc565b600e8054610e8490613cb3565b60006020835110156114935761148c836121c1565b9050610803565b8161149e8482613dd0565b5060ff9050610803565b90565b6114b58282611060565b6107f4576000828152602081815260408083206001600160a01b03851684529091529020805460ff191660011790556114eb3390565b6001600160a01b0316816001600160a01b0316837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45050565b6000611059836001600160a01b0384166121ff565b60006001600160e01b0319821663152a902d60e11b148061080357506108038261224e565b6000818152600560205260409020546001600160a01b0316610fa05760405162461bcd60e51b8152602060048201526018602482015277115490cdcc8c4e881a5b9d985b1a59081d1bdad95b88125160421b6044820152606401610936565b81333b1580159061164257506002546040516305a3b80960e01b81523360048201526001600160a01b03909116906305a3b80990602401602060405180830381865afa15801561161c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116409190613e8f565b155b156116625760405163f6fa4cbd60e01b8152336004820152602401610936565b6001600160a01b0381163b158015906116e657506002546040516305a3b80960e01b81526001600160a01b038381166004830152909116906305a3b80990602401602060405180830381865afa1580156116c0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116e49190613e8f565b155b1561170f576040516341b8d58160e11b81526001600160a01b0382166004820152602401610936565b6109d78383612273565b610fa081336122e1565b80516001600160a01b031661174b576040516331c3e52960e11b815260040160405180910390fd5b60005b8160200151518110156117985761178682600001518360200151838151811061177957611779613c6e565b602002602001015161233a565b8061179081613c9a565b91505061174e565b508060200151516010546117ac9190613edb565b60105550565b6000806117be83610df4565b9050806001600160a01b0316846001600160a01b0316148061180557506001600160a01b0380821660009081526008602090815260408083209388168352929052205460ff165b806118295750836001600160a01b031661181e8461089b565b6001600160a01b0316145b949350505050565b82823332148015906118ac57506002546040516305a3b80960e01b81523360048201526001600160a01b03909116906305a3b80990602401602060405180830381865afa158015611886573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118aa9190613e8f565b155b156118cc5760405163937db65f60e01b8152336004820152602401610936565b6001600160a01b0382163b1580159061195057506002546040516305a3b80960e01b81526001600160a01b038481166004830152909116906305a3b80990602401602060405180830381865afa15801561192a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061194e9190613e8f565b155b156119795760405163f934453160e01b81526001600160a01b0383166004820152602401610936565b6001600160a01b0381163b158015906119fd57506002546040516305a3b80960e01b81526001600160a01b038381166004830152909116906305a3b80990602401602060405180830381865afa1580156119d7573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906119fb9190613e8f565b155b15611a2657604051632a67242160e11b81526001600160a01b0382166004820152602401610936565b611a31858585612381565b5050505050565b611a4282826114ab565b60008281526001602052604090206109d7908261152f565b6000306001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016148015611ab357507f000000000000000000000000000000000000000000000000000000000000000046145b15611add57507f000000000000000000000000000000000000000000000000000000000000000090565b610bf1604080517f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f60208201527f0000000000000000000000000000000000000000000000000000000000000000918101919091527f000000000000000000000000000000000000000000000000000000000000000060608201524660808201523060a082015260009060c00160405160208183030381529060405280519060200120905090565b611b8f82826123ab565b60008281526001602052604090206109d79082612410565b600881901c600090815260116020526040902054600160ff83161b1615611be4576040516305dcda1160e51b815260048101829052602401610936565b6107f48282612425565b611bf733610a39565b611c135760405162461bcd60e51b815260040161093690613ced565b610fa0816125b0565b6127106001600160601b0382161115611c475760405162461bcd60e51b815260040161093690613eee565b6001600160a01b038216611c9d5760405162461bcd60e51b815260206004820152601b60248201527f455243323938313a20496e76616c696420706172616d657465727300000000006044820152606401610936565b6040805180820182526001600160a01b0393841681526001600160601b0392831660208083019182526000968752600d90529190942093519051909116600160a01b029116179055565b42821015611d085760405163068568f360e21b815260040160405180910390fd5b6000611d15858585612645565b9050611d2a611d2385610df4565b828461271e565b15611d3f57611d3985856115c8565b50610dd7565b60008251604003611d8657611d7f82611d5b8560006020612828565b611d6490613f38565b611d718660206040612828565b611d7a90613f38565b612935565b9050611db2565b8251604103611d9957611d7f8284612952565b604051638baa579f60e01b815260040160405180910390fd5b611dbc8186612976565b15611d9957611dcb86866115c8565b61133c565b606060ff8314611de35761148c83612995565b818054611def90613cb3565b80601f0160208091040260200160405190810160405280929190818152602001828054611e1b90613cb3565b8015611e685780601f10611e3d57610100808354040283529160200191611e68565b820191906000526020600020905b815481529060010190602001808311611e4b57829003601f168201915b50505050509050610803565b6127106001600160601b0382161115611e9f5760405162461bcd60e51b815260040161093690613eee565b6001600160a01b038216611ef55760405162461bcd60e51b815260206004820152601960248201527f455243323938313a20696e76616c6964207265636569766572000000000000006044820152606401610936565b604080518082019091526001600160a01b039092168083526001600160601b039091166020909201829052600160a01b90910217600c55565b600061105983836129d4565b80516001600160a01b031615611f63576040516331c3e52960e11b815260040160405180910390fd5b60005b81602001515181101561179857611f9e826000015183602001518381518110611f9157611f91613c6e565b6020026020010151611ba7565b80611fa881613c9a565b915050611f66565b611fba8383611ba7565b611fc760008484846129fe565b6109d75760405162461bcd60e51b815260040161093690613f5c565b6107f4338383612aff565b611ff9848484611831565b612005848484846129fe565b610dd75760405162461bcd60e51b815260040161093690613f5c565b6060600f805461081890613cb3565b6060600061203d83612bcd565b60010190506000816001600160401b0381111561205c5761205c613570565b6040519080825280601f01601f191660200182016040528015612086576020820181803683370190505b5090508181016020015b600019016f181899199a1a9b1b9c1cb0b131b232b360811b600a86061a8153600a850494508461209057509392505050565b6000610803825490565b6040516301ffc9a760e01b81526305a3b80960e01b60048201526001600160a01b038216906301ffc9a790602401602060405180830381865afa158015612117573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061213b9190613e8f565b6121585760405163d6f93fb760e01b815260040160405180910390fd5b600254604080516001600160a01b03928316815291831660208301527f3edc37a14cc8047c7c8a3f354311efe86c14848efd4e3765a3e1e57eea04ea76910160405180910390a1600280546001600160a01b0319166001600160a01b0392909216919091179055565b600080829050601f815111156121ec578260405163305a27a960e01b815260040161093691906134fe565b80516121f782613f38565b179392505050565b600081815260018301602052604081205461224657508154600181810184556000848152602080822090930184905584548482528286019093526040902091909155610803565b506000610803565b60006001600160e01b03198216635604e22560e01b1480610803575061080382612ca5565b600081815260076020526040902080546001600160a01b0319166001600160a01b03841690811790915581906122a882610df4565b6001600160a01b03167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b6122eb8282611060565b6107f4576122f881612ce5565b612303836020612cf7565b604051602001612314929190613fae565b60408051601f198184030181529082905262461bcd60e51b8252610936916004016134fe565b600881901c600090815260116020526040902054600160ff83161b1615612377576040516305dcda1160e51b815260048101829052602401610936565b6107f48282612e92565b6000818152600b6020526040812080549161239b83613c9a565b91905055506109d7838383612eac565b6123b58282611060565b156107f4576000828152602081815260408083206001600160a01b0385168085529252808320805460ff1916905551339285917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45050565b6000611059836001600160a01b038416613010565b6001600160a01b03821661247b5760405162461bcd60e51b815260206004820181905260248201527f4552433732313a206d696e7420746f20746865207a65726f20616464726573736044820152606401610936565b6000818152600560205260409020546001600160a01b0316156124e05760405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e746564000000006044820152606401610936565b6000818152600560205260409020546001600160a01b0316156125455760405162461bcd60e51b815260206004820152601c60248201527f4552433732313a20746f6b656e20616c7265616479206d696e746564000000006044820152606401610936565b6001600160a01b038216600081815260066020908152604080832080546001019055848352600590915280822080546001600160a01b0319168417905551839291907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908290a45050565b60006125bb82610df4565b90506125c682610df4565b600083815260076020908152604080832080546001600160a01b03199081169091556001600160a01b0385168085526006845282852080546000190190558785526005909352818420805490911690555192935084927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef908390a45050565b60006118296040516020016126b390660a0cae4dad2e8560cb1b81527f61646472657373207370656e6465722c75696e7432353620746f6b656e49642c60078201527f75696e74323536206e6f6e63652c75696e7432353620646561646c696e652900602782015260460190565b60408051808303601f1901815282825280516020918201206000888152600b835283902054918401526001600160a01b0388169183019190915260608201869052608082015260a0810184905260c00160405160208183030381529060405280519060200120613103565b6000806000856001600160a01b0316631626ba7e60e01b8686604051602401612748929190614023565b60408051601f198184030181529181526020820180516001600160e01b03166001600160e01b0319909416939093179092529051612786919061403c565b600060405180830381855afa9150503d80600081146127c1576040519150601f19603f3d011682016040523d82523d6000602084013e6127c6565b606091505b50915091508180156127d9575080516020145b1561281c576000818060200190518101906127f49190614058565b90506374eca2c160e11b6001600160e01b031982160161281a5760019350505050611059565b505b50600095945050505050565b60608161283681601f613edb565b10156128755760405162461bcd60e51b815260206004820152600e60248201526d736c6963655f6f766572666c6f7760901b6044820152606401610936565b61287f8284613edb565b845110156128c35760405162461bcd60e51b8152602060048201526011602482015270736c6963655f6f75744f66426f756e647360781b6044820152606401610936565b6060821580156128e2576040519150600082526020820160405261292c565b6040519150601f8416801560200281840101858101878315602002848b0101015b8183101561291b578051835260209283019201612903565b5050858452601f01601f1916604052505b50949350505050565b6000806000612945868686613130565b9150915061292c81613169565b600080600061296185856132b3565b9150915061296e81613169565b509392505050565b60006001600160a01b03831615801590611059575061105983836117b2565b606060006129a2836132f5565b604080516020808252818301909252919250600091906020820181803683375050509182525060208101929092525090565b60008260000182815481106129eb576129eb613c6e565b9060005260206000200154905092915050565b60006001600160a01b0384163b15612af457604051630a85bd0160e11b81526001600160a01b0385169063150b7a0290612a42903390899088908890600401614075565b6020604051808303816000875af1925050508015612a7d575060408051601f3d908101601f19168201909252612a7a91810190614058565b60015b612ada573d808015612aab576040519150601f19603f3d011682016040523d82523d6000602084013e612ab0565b606091505b508051600003612ad25760405162461bcd60e51b815260040161093690613f5c565b805181602001fd5b6001600160e01b031916630a85bd0160e11b149050611829565b506001949350505050565b816001600160a01b0316836001600160a01b031603612b605760405162461bcd60e51b815260206004820152601960248201527f4552433732313a20617070726f766520746f2063616c6c6572000000000000006044820152606401610936565b6001600160a01b03838116600081815260086020908152604080832094871680845294825291829020805460ff191686151590811790915591519182527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31910160405180910390a3505050565b60008072184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b8310612c0c5772184f03e93ff9f4daa797ed6e38ed64bf6a1f0160401b830492506040015b6d04ee2d6d415b85acef81000000008310612c38576d04ee2d6d415b85acef8100000000830492506020015b662386f26fc100008310612c5657662386f26fc10000830492506010015b6305f5e1008310612c6e576305f5e100830492506008015b6127108310612c8257612710830492506004015b60648310612c94576064830492506002015b600a83106108035760010192915050565b60006001600160e01b031982166380ac58cd60e01b1480612cd657506001600160e01b03198216635b5e139f60e01b145b8061080357506108038261331d565b60606108036001600160a01b03831660145b60606000612d06836002613d3a565b612d11906002613edb565b6001600160401b03811115612d2857612d28613570565b6040519080825280601f01601f191660200182016040528015612d52576020820181803683370190505b509050600360fc1b81600081518110612d6d57612d6d613c6e565b60200101906001600160f81b031916908160001a905350600f60fb1b81600181518110612d9c57612d9c613c6e565b60200101906001600160f81b031916908160001a9053506000612dc0846002613d3a565b612dcb906001613edb565b90505b6001811115612e43576f181899199a1a9b1b9c1cb0b131b232b360811b85600f1660108110612dff57612dff613c6e565b1a60f81b828281518110612e1557612e15613c6e565b60200101906001600160f81b031916908160001a90535060049490941c93612e3c81613d73565b9050612dce565b5083156110595760405162461bcd60e51b815260206004820181905260248201527f537472696e67733a20686578206c656e67746820696e73756666696369656e746044820152606401610936565b6107f4828260405180602001604052806000815250611fb0565b826001600160a01b0316612ebf82610df4565b6001600160a01b031614612ee55760405162461bcd60e51b8152600401610936906140b2565b6001600160a01b038216612f475760405162461bcd60e51b8152602060048201526024808201527f4552433732313a207472616e7366657220746f20746865207a65726f206164646044820152637265737360e01b6064820152608401610936565b826001600160a01b0316612f5a82610df4565b6001600160a01b031614612f805760405162461bcd60e51b8152600401610936906140b2565b600081815260076020908152604080832080546001600160a01b03199081169091556001600160a01b0387811680865260068552838620805460001901905590871680865283862080546001019055868652600590945282852080549092168417909155905184937fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef91a4505050565b600081815260018301602052604081205480156130f95760006130346001836140f7565b8554909150600090613048906001906140f7565b90508181146130ad57600086600001828154811061306857613068613c6e565b906000526020600020015490508087600001848154811061308b5761308b613c6e565b6000918252602080832090910192909255918252600188019052604090208390555b85548690806130be576130be61410a565b600190038181906000526020600020016000905590558560010160008681526020019081526020016000206000905560019350505050610803565b6000915050610803565b6000610803613110611a5a565b8360405161190160f01b8152600281019290925260228201526042902090565b6000806001600160ff1b0383168161314d60ff86901c601b613edb565b905061315b87828885613328565b935093505050935093915050565b600081600481111561317d5761317d614120565b036131855750565b600181600481111561319957613199614120565b036131e65760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e617475726500000000000000006044820152606401610936565b60028160048111156131fa576131fa614120565b036132475760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e677468006044820152606401610936565b600381600481111561325b5761325b614120565b03610fa05760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c604482015261756560f01b6064820152608401610936565b60008082516041036132e95760208301516040840151606085015160001a6132dd87828585613328565b94509450505050610b0d565b50600090506002610b0d565b600060ff8216601f81111561080357604051632cd44ac360e21b815260040160405180910390fd5b6000610803826133ec565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a083111561335f57506000905060036133e3565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa1580156133b3573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b0381166133dc576000600192509250506133e3565b9150600090505b94509492505050565b60006001600160e01b03198216635a05180f60e01b148061080357506108038260006001600160e01b03198216637965db0b60e01b148061080357506301ffc9a760e01b6001600160e01b0319831614610803565b60006020828403121561345357600080fd5b81356001600160401b0381111561346957600080fd5b82016060818503121561105957600080fd5b6001600160e01b031981168114610fa057600080fd5b6000602082840312156134a357600080fd5b81356110598161347b565b60005b838110156134c95781810151838201526020016134b1565b50506000910152565b600081518084526134ea8160208601602086016134ae565b601f01601f19169290920160200192915050565b60208152600061105960208301846134d2565b60006020828403121561352357600080fd5b5035919050565b80356001600160a01b038116811461354157600080fd5b919050565b6000806040838503121561355957600080fd5b6135628361352a565b946020939093013593505050565b634e487b7160e01b600052604160045260246000fd5b604080519081016001600160401b03811182821017156135a8576135a8613570565b60405290565b604051601f8201601f191681016001600160401b03811182821017156135d6576135d6613570565b604052919050565b60006001600160401b038211156135f7576135f7613570565b5060051b60200190565b600061361461360f846135de565b6135ae565b8381529050602080820190600585811b85018781111561363357600080fd5b855b818110156137065780356001600160401b03808211156136555760008081fd5b908801906040828c03121561366a5760008081fd5b613672613586565b61367b8361352a565b8152868301358281111561368f5760008081fd5b8084019350508b601f8401126136a757600091508182fd5b823591506136b761360f836135de565b82815291861b8301870191878101908d8411156136d45760008081fd5b938801935b838510156136f2578435825293880193908801906136d9565b828901525087525050938301938301613635565b50505050509392505050565b60006020828403121561372457600080fd5b81356001600160401b0381111561373a57600080fd5b8201601f8101841361374b57600080fd5b61182984823560208401613601565b60008060006060848603121561376f57600080fd5b6137788461352a565b92506137866020850161352a565b9150604084013590509250925092565b600080604083850312156137a957600080fd5b50508035926020909101359150565b600080604083850312156137cb57600080fd5b823591506137db6020840161352a565b90509250929050565b6020808252825182820181905260009190848201906040850190845b818110156138255783516001600160a01b031683529284019291840191600101613800565b50909695505050505050565b60006020828403121561384357600080fd5b6110598261352a565b80356001600160601b038116811461354157600080fd5b60008060006060848603121561387857600080fd5b833592506138886020850161352a565b91506138966040850161384c565b90509250925092565b60006001600160401b038311156138b8576138b8613570565b6138cb601f8401601f19166020016135ae565b90508281528383830111156138df57600080fd5b828260208301376000602084830101529392505050565b60006020828403121561390857600080fd5b81356001600160401b0381111561391e57600080fd5b8201601f8101841361392f57600080fd5b6118298482356020840161389f565b600082601f83011261394f57600080fd5b6110598383356020850161389f565b6000806000806080858703121561397457600080fd5b61397d8561352a565b9350602085013592506040850135915060608501356001600160401b038111156139a657600080fd5b6139b28782880161393e565b91505092959194509250565b60ff60f81b881681526000602060e0818401526139de60e084018a6134d2565b83810360408501526139f0818a6134d2565b606085018990526001600160a01b038816608086015260a0850187905284810360c0860152855180825283870192509083019060005b81811015613a4257835183529284019291840191600101613a26565b50909c9b505050505050505050505050565b60008060408385031215613a6757600080fd5b613a708361352a565b91506137db6020840161384c565b8015158114610fa057600080fd5b60008060408385031215613a9f57600080fd5b613aa88361352a565b91506020830135613ab881613a7e565b809150509250929050565b60008083601f840112613ad557600080fd5b5081356001600160401b03811115613aec57600080fd5b6020830191508360208260051b8501011115610b0d57600080fd5b60008060008060608587031215613b1d57600080fd5b84356001600160401b03811115613b3357600080fd5b613b3f87828801613ac3565b9095509350613b5290506020860161352a565b9150613b606040860161384c565b905092959194509250565b60008060008060808587031215613b8157600080fd5b613b8a8561352a565b9350613b986020860161352a565b92506040850135915060608501356001600160401b038111156139a657600080fd5b60008060208385031215613bcd57600080fd5b82356001600160401b03811115613be357600080fd5b613bef85828601613ac3565b90969095509350505050565b60008060408385031215613c0e57600080fd5b613c178361352a565b91506137db6020840161352a565b6000808335601e19843603018112613c3c57600080fd5b8301803591506001600160401b03821115613c5657600080fd5b6020019150600581901b3603821315610b0d57600080fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b600060018201613cac57613cac613c84565b5060010190565b600181811c90821680613cc757607f821691505b602082108103613ce757634e487b7160e01b600052602260045260246000fd5b50919050565b6020808252602d908201527f4552433732313a2063616c6c6572206973206e6f7420746f6b656e206f776e6560408201526c1c881bdc88185c1c1c9bdd9959609a1b606082015260800190565b808202811582820484141761080357610803613c84565b600082613d6e57634e487b7160e01b600052601260045260246000fd5b500490565b600081613d8257613d82613c84565b506000190190565b601f8211156109d757600081815260208120601f850160051c81016020861015613db15750805b601f850160051c820191505b8181101561133c57828155600101613dbd565b81516001600160401b03811115613de957613de9613570565b613dfd81613df78454613cb3565b84613d8a565b602080601f831160018114613e325760008415613e1a5750858301515b600019600386901b1c1916600185901b17855561133c565b600085815260208120601f198616915b82811015613e6157888601518255948401946001909101908401613e42565b5085821015613e7f5787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b600060208284031215613ea157600080fd5b815161105981613a7e565b60008351613ebe8184602088016134ae565b835190830190613ed28183602088016134ae565b01949350505050565b8082018082111561080357610803613c84565b6020808252602a908201527f455243323938313a20726f79616c7479206665652077696c6c206578636565646040820152692073616c65507269636560b01b606082015260800190565b80516020808301519190811015613ce75760001960209190910360031b1b16919050565b60208082526032908201527f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560408201527131b2b4bb32b91034b6b83632b6b2b73a32b960711b606082015260800190565b7f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000815260008351613fe68160178501602088016134ae565b7001034b99036b4b9b9b4b733903937b6329607d1b60179184019182015283516140178160288401602088016134ae565b01602801949350505050565b82815260406020820152600061182960408301846134d2565b6000825161404e8184602087016134ae565b9190910192915050565b60006020828403121561406a57600080fd5b81516110598161347b565b6001600160a01b03858116825284166020820152604081018390526080606082018190526000906140a8908301846134d2565b9695505050505050565b60208082526025908201527f4552433732313a207472616e736665722066726f6d20696e636f72726563742060408201526437bbb732b960d91b606082015260800190565b8181038181111561080357610803613c84565b634e487b7160e01b600052603160045260246000fd5b634e487b7160e01b600052602160045260246000fdfea2646970667358221220c47aea78e02adda7e8a36138892c3ed2fc9b754ce58545603813e5750b053f0764736f6c63430008110033";class f4 extends fd{constructor(...e){e.length>1?super(...e):super(c4,u4,e[0])}deploy(e,t,n,r,i,a,o,s,c){return super.deploy(e,t,n,r,i,a,o,s,c||{})}getDeployTransaction(e,t,n,r,i,a,o,s,c){return super.getDeployTransaction(e,t,n,r,i,a,o,s,c||{})}attach(e){return super.attach(e)}connect(e){return super.connect(e)}static bytecode=u4;static abi=c4;static createInterface(){return new Ss(c4)}static connect(e,t){return new ud(e,c4,t)}}var d4=Object.freeze({__proto__:null,ERC20:class{contract;constructor(e){const t=new i4;this.contract=t.attach(e)}async totalSupply(e,t={}){return this.contract.connect(e).totalSupply(t)}async balanceOf(e,t,n={}){return this.contract.connect(e).balanceOf(t,n)}async allowance(e,t,n,r={}){return this.contract.connect(e).allowance(t,n,r)}async populateTransfer(e,t,n){return this.contract.populateTransaction.transfer(e,t,n)}async populateApprove(e,t,n={}){return this.contract.populateTransaction.approve(e,t,n)}async populateTransferFrom(e,t,n,r={}){return this.contract.populateTransaction.transferFrom(e,t,n,r)}}});var l4=Object.freeze({__proto__:null,ERC721:class{contract;constructor(e){const t=new s4;this.contract=t.attach(e)}async DEFAULT_ADMIN_ROLE(e,t={}){return await this.contract.connect(e).DEFAULT_ADMIN_ROLE(t)}async DOMAIN_SEPARATOR(e,t){return await this.contract.connect(e).DOMAIN_SEPARATOR(t)}async MINTER_ROLE(e,t={}){return await this.contract.connect(e).MINTER_ROLE(t)}async balanceOf(e,t,n={}){return await this.contract.connect(e).balanceOf(t,n)}async baseURI(e,t={}){return await this.contract.connect(e).baseURI(t)}async contractURI(e,t={}){return await this.contract.connect(e).contractURI(t)}async eip712Domain(e,t){return await this.contract.eip712Domain(t)}async getAdmins(e,t={}){return await this.contract.connect(e).getAdmins(t)}async getApproved(e,t,n={}){return await this.contract.connect(e).getApproved(t,n)}async getRoleAdmin(e,t,n={}){return await this.contract.connect(e).getRoleAdmin(t,n)}async getRoleMember(e,t,n,r={}){return await this.contract.connect(e).getRoleMember(t,n,r)}async getRoleMemberCount(e,t,n={}){return await this.contract.connect(e).getRoleMemberCount(t,n)}async hasRole(e,t,n,r={}){return await this.contract.connect(e).hasRole(t,n,r)}async isApprovedForAll(e,t,n,r={}){return await this.contract.connect(e).isApprovedForAll(t,n,r)}async name(e,t={}){return await this.contract.connect(e).name(t)}async ownerOf(e,t,n={}){return await this.contract.connect(e).ownerOf(t,n)}async nonces(e,t,n){return await this.contract.connect(e).nonces(t,n)}async operatorAllowlist(e,t={}){return await this.contract.connect(e).operatorAllowlist(t)}async royaltyInfo(e,t,n,r={}){return await this.contract.connect(e).royaltyInfo(t,n,r)}async symbol(e,t={}){return await this.contract.connect(e).symbol(t)}async tokenURI(e,t,n={}){return await this.contract.connect(e).tokenURI(t,n)}async totalSupply(e,t={}){return await this.contract.connect(e).totalSupply(t)}async populateApprove(e,t,n={}){return await this.contract.populateTransaction.approve(e,t,n)}async populatePermit(e,t,n,r,i={}){return await this.contract.populateTransaction.permit(e,t,n,r,i)}async populateBurn(e,t={}){return await this.contract.populateTransaction.burn(e,t)}async populateBurnBatch(e,t={}){return await this.contract.populateTransaction.burnBatch(e,t)}async populateSafeBurn(e,t,n={}){return await this.contract.populateTransaction.safeBurn(e,t,n)}async populateSafeBurnBatch(e,t={}){return await this.contract.populateTransaction.safeBurnBatch(e,t)}async populateGrantMinterRole(e,t={}){return await this.contract.populateTransaction.grantMinterRole(e,t)}async populateGrantRole(e,t,n={}){return await this.contract.populateTransaction.grantRole(e,t,n)}async populateMint(e,t,n={}){return await this.contract.populateTransaction.mint(e,t,n)}async populateSafeMint(e,t,n={}){return await this.contract.populateTransaction.safeMint(e,t,n)}async populateMintByQuantity(e,t,n={}){return await this.contract.populateTransaction.mintByQuantity(e,t,n)}async populateSafeMintByQuantity(e,t,n={}){return await this.contract.populateTransaction.safeMintByQuantity(e,t,n)}async populateMintBatchByQuantity(e,t={}){return await this.contract.populateTransaction.mintBatchByQuantity(e,t)}async populateSafeMintBatchByQuantity(e,t={}){return await this.contract.populateTransaction.safeMintBatchByQuantity(e,t)}async populateMintBatch(e,t={}){return await this.contract.populateTransaction.mintBatch(e,t)}async populateSafeMintBatch(e,t={}){return await this.contract.populateTransaction.safeMintBatch(e,t)}async populateRenounceRole(e,t,n={}){return await this.contract.populateTransaction.renounceRole(e,t,n)}async populateRevokeMinterRole(e,t={}){return await this.contract.populateTransaction.revokeMinterRole(e,t)}async populateRevokeRole(e,t,n={}){return await this.contract.populateTransaction.revokeRole(e,t,n)}async populateSafeTransferFromBatch(e,t={}){return await this.contract.populateTransaction.safeTransferFromBatch(e,t)}async"populateSafeTransferFrom(address,address,uint256)"(e,t,n,r={}){return await this.contract.populateTransaction["safeTransferFrom(address,address,uint256)"](e,t,n,r)}async"populateSafeTransferFrom(address,address,uint256,bytes)"(e,t,n,r,i={}){return await this.contract.populateTransaction["safeTransferFrom(address,address,uint256,bytes)"](e,t,n,r,i)}async populateSetApprovalForAll(e,t,n={}){return await this.contract.populateTransaction.setApprovalForAll(e,t,n)}async populateSetBaseURI(e,t={}){return await this.contract.populateTransaction.setBaseURI(e,t)}async populateSetContractURI(e,t={}){return await this.contract.populateTransaction.setContractURI(e,t)}async populateSetDefaultRoyaltyReceiver(e,t,n={}){return await this.contract.populateTransaction.setDefaultRoyaltyReceiver(e,t,n)}async populateSetNFTRoyaltyReceiver(e,t,n,r={}){return await this.contract.populateTransaction.setNFTRoyaltyReceiver(e,t,n,r)}async populateSetNFTRoyaltyReceiverBatch(e,t,n,r={}){return await this.contract.populateTransaction.setNFTRoyaltyReceiverBatch(e,t,n,r)}async populateSetOperatorAllowlistRegistry(e,t={}){return await this.contract.populateTransaction.setOperatorAllowlistRegistry(e,t)}}});var p4=Object.freeze({__proto__:null,ERC721MintByID:class{contract;constructor(e){const t=new f4;this.contract=t.attach(e)}async DEFAULT_ADMIN_ROLE(e,t={}){return await this.contract.connect(e).DEFAULT_ADMIN_ROLE(t)}async MINTER_ROLE(e,t={}){return await this.contract.connect(e).MINTER_ROLE(t)}async balanceOf(e,t,n={}){return await this.contract.connect(e).balanceOf(t,n)}async baseURI(e,t={}){return await this.contract.connect(e).baseURI(t)}async contractURI(e,t={}){return await this.contract.connect(e).contractURI(t)}async getAdmins(e,t={}){return await this.contract.connect(e).getAdmins(t)}async getApproved(e,t,n={}){return await this.contract.connect(e).getApproved(t,n)}async getRoleAdmin(e,t,n={}){return await this.contract.connect(e).getRoleAdmin(t,n)}async getRoleMember(e,t,n,r={}){return await this.contract.connect(e).getRoleMember(t,n,r)}async getRoleMemberCount(e,t,n={}){return await this.contract.connect(e).getRoleMemberCount(t,n)}async hasRole(e,t,n,r={}){return await this.contract.connect(e).hasRole(t,n,r)}async isApprovedForAll(e,t,n,r={}){return await this.contract.connect(e).isApprovedForAll(t,n,r)}async name(e,t={}){return await this.contract.connect(e).name(t)}async ownerOf(e,t,n={}){return await this.contract.connect(e).ownerOf(t,n)}async nonces(e,t,n){return await this.contract.connect(e).nonces(t,n)}async operatorAllowlist(e,t={}){return await this.contract.connect(e).operatorAllowlist(t)}async royaltyInfo(e,t,n,r={}){return await this.contract.connect(e).royaltyInfo(t,n,r)}async symbol(e,t={}){return await this.contract.connect(e).symbol(t)}async tokenURI(e,t,n={}){return await this.contract.connect(e).tokenURI(t,n)}async totalSupply(e,t={}){return await this.contract.connect(e).totalSupply(t)}async populateApprove(e,t,n={}){return await this.contract.populateTransaction.approve(e,t,n)}async populatePermit(e,t,n,r,i={}){return await this.contract.populateTransaction.permit(e,t,n,r,i)}async populateBurn(e,t={}){return await this.contract.populateTransaction.burn(e,t)}async populateBurnBatch(e,t={}){return await this.contract.populateTransaction.burnBatch(e,t)}async populateGrantMinterRole(e,t={}){return await this.contract.populateTransaction.grantMinterRole(e,t)}async populateGrantRole(e,t,n={}){return await this.contract.populateTransaction.grantRole(e,t,n)}async populateMint(e,t,n={}){return await this.contract.populateTransaction.mint(e,t,n)}async populateSafeMintBatch(e,t={}){return await this.contract.populateTransaction.safeMintBatch(e,t)}async populateSafeBurn(e,t,n={}){return await this.contract.populateTransaction.safeBurn(e,t,n)}async populateSafeBurnBatch(e,t={}){return await this.contract.populateTransaction.safeBurnBatch(e,t)}async populateRenounceRole(e,t,n={}){return await this.contract.populateTransaction.renounceRole(e,t,n)}async populateRevokeMinterRole(e,t={}){return await this.contract.populateTransaction.revokeMinterRole(e,t)}async populateRevokeRole(e,t,n={}){return await this.contract.populateTransaction.revokeRole(e,t,n)}async populateSafeTransferFromBatch(e,t={}){return await this.contract.populateTransaction.safeTransferFromBatch(e,t)}async"populateSafeTransferFrom(address,address,uint256)"(e,t,n,r={}){return await this.contract.populateTransaction["safeTransferFrom(address,address,uint256)"](e,t,n,r)}async"populateSafeTransferFrom(address,address,uint256,bytes)"(e,t,n,r,i={}){return await this.contract.populateTransaction["safeTransferFrom(address,address,uint256,bytes)"](e,t,n,r,i)}async populateSetApprovalForAll(e,t,n={}){return await this.contract.populateTransaction.setApprovalForAll(e,t,n)}async populateSetBaseURI(e,t={}){return await this.contract.populateTransaction.setBaseURI(e,t)}async populateSetContractURI(e,t={}){return await this.contract.populateTransaction.setContractURI(e,t)}async populateSetDefaultRoyaltyReceiver(e,t,n={}){return await this.contract.populateTransaction.setDefaultRoyaltyReceiver(e,t,n)}async populateSetNFTRoyaltyReceiver(e,t,n,r={}){return await this.contract.populateTransaction.setNFTRoyaltyReceiver(e,t,n,r)}async populateSetNFTRoyaltyReceiverBatch(e,t,n,r={}){return await this.contract.populateTransaction.setNFTRoyaltyReceiverBatch(e,t,n,r)}async populateSetOperatorAllowlistRegistry(e,t={}){return await this.contract.populateTransaction.setOperatorAllowlistRegistry(e,t)}}});e.blockchainData=$t,e.checkoutSdk=v3,e.checkoutWidgets=t4,e.config=r,e.erc20=d4,e.erc721=l4,e.erc721MintById=p4,e.immutablexClient=KN,e.orderbook=cW,e.passport=bz,e.provider=HW}));
|
|
67
67
|
//# sourceMappingURL=index.browser.js.map
|