@imtbl/sdk 0.3.1-alpha → 0.3.2-alpha

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.
@@ -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";e.Environment=void 0,function(e){e.PRODUCTION="production",e.SANDBOX="sandbox"}(e.Environment||(e.Environment={}));class t{environment;apiKey;constructor(e){this.environment=e.environment,this.apiKey=e.apiKey}}function r(e,t){return function(){return e.apply(t,arguments)}}const{toString:n}=Object.prototype,{getPrototypeOf:i}=Object,a=(o=Object.create(null),e=>{const t=n.call(e);return o[t]||(o[t]=t.slice(8,-1).toLowerCase())});var o;const s=e=>(e=e.toLowerCase(),t=>a(t)===e),u=e=>t=>typeof t===e,{isArray:f}=Array,c=u("undefined");const l=s("ArrayBuffer");const d=u("string"),p=u("function"),h=u("number"),m=e=>null!==e&&"object"==typeof e,y=e=>{if("object"!==a(e))return!1;const t=i(e);return!(null!==t&&t!==Object.prototype&&null!==Object.getPrototypeOf(t)||Symbol.toStringTag in e||Symbol.iterator in e)},b=s("Date"),g=s("File"),v=s("Blob"),w=s("FileList"),_=s("URLSearchParams");function E(e,t,{allOwnKeys:r=!1}={}){if(null==e)return;let n,i;if("object"!=typeof e&&(e=[e]),f(e))for(n=0,i=e.length;n<i;n++)t.call(null,e[n],n,e);else{const i=r?Object.getOwnPropertyNames(e):Object.keys(e),a=i.length;let o;for(n=0;n<a;n++)o=i[n],t.call(null,e[o],o,e)}}function T(e,t){t=t.toLowerCase();const r=Object.keys(e);let n,i=r.length;for(;i-- >0;)if(n=r[i],t===n.toLowerCase())return n;return null}const A="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:global,S=e=>!c(e)&&e!==A;const k=(O="undefined"!=typeof Uint8Array&&i(Uint8Array),e=>O&&e instanceof O);var O;const R=s("HTMLFormElement"),x=(({hasOwnProperty:e})=>(t,r)=>e.call(t,r))(Object.prototype),I=s("RegExp"),C=(e,t)=>{const r=Object.getOwnPropertyDescriptors(e),n={};E(r,((r,i)=>{!1!==t(r,i,e)&&(n[i]=r)})),Object.defineProperties(e,n)},N="abcdefghijklmnopqrstuvwxyz",P="0123456789",M={DIGIT:P,ALPHA:N,ALPHA_DIGIT:N+N.toUpperCase()+P};const B=s("AsyncFunction");var D={isArray:f,isArrayBuffer:l,isBuffer:function(e){return null!==e&&!c(e)&&null!==e.constructor&&!c(e.constructor)&&p(e.constructor.isBuffer)&&e.constructor.isBuffer(e)},isFormData:e=>{let t;return e&&("function"==typeof FormData&&e instanceof FormData||p(e.append)&&("formdata"===(t=a(e))||"object"===t&&p(e.toString)&&"[object FormData]"===e.toString()))},isArrayBufferView:function(e){let t;return t="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&l(e.buffer),t},isString:d,isNumber:h,isBoolean:e=>!0===e||!1===e,isObject:m,isPlainObject:y,isUndefined:c,isDate:b,isFile:g,isBlob:v,isRegExp:I,isFunction:p,isStream:e=>m(e)&&p(e.pipe),isURLSearchParams:_,isTypedArray:k,isFileList:w,forEach:E,merge:function e(){const{caseless:t}=S(this)&&this||{},r={},n=(n,i)=>{const a=t&&T(r,i)||i;y(r[a])&&y(n)?r[a]=e(r[a],n):y(n)?r[a]=e({},n):f(n)?r[a]=n.slice():r[a]=n};for(let e=0,t=arguments.length;e<t;e++)arguments[e]&&E(arguments[e],n);return r},extend:(e,t,n,{allOwnKeys:i}={})=>(E(t,((t,i)=>{n&&p(t)?e[i]=r(t,n):e[i]=t}),{allOwnKeys:i}),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,r,n)=>{e.prototype=Object.create(t.prototype,n),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),r&&Object.assign(e.prototype,r)},toFlatObject:(e,t,r,n)=>{let a,o,s;const u={};if(t=t||{},null==e)return t;do{for(a=Object.getOwnPropertyNames(e),o=a.length;o-- >0;)s=a[o],n&&!n(s,e,t)||u[s]||(t[s]=e[s],u[s]=!0);e=!1!==r&&i(e)}while(e&&(!r||r(e,t))&&e!==Object.prototype);return t},kindOf:a,kindOfTest:s,endsWith:(e,t,r)=>{e=String(e),(void 0===r||r>e.length)&&(r=e.length),r-=t.length;const n=e.indexOf(t,r);return-1!==n&&n===r},toArray:e=>{if(!e)return null;if(f(e))return e;let t=e.length;if(!h(t))return null;const r=new Array(t);for(;t-- >0;)r[t]=e[t];return r},forEachEntry:(e,t)=>{const r=(e&&e[Symbol.iterator]).call(e);let n;for(;(n=r.next())&&!n.done;){const r=n.value;t.call(e,r[0],r[1])}},matchAll:(e,t)=>{let r;const n=[];for(;null!==(r=e.exec(t));)n.push(r);return n},isHTMLForm:R,hasOwnProperty:x,hasOwnProp:x,reduceDescriptors:C,freezeMethods:e=>{C(e,((t,r)=>{if(p(e)&&-1!==["arguments","caller","callee"].indexOf(r))return!1;const n=e[r];p(n)&&(t.enumerable=!1,"writable"in t?t.writable=!1:t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+r+"'")}))}))},toObjectSet:(e,t)=>{const r={},n=e=>{e.forEach((e=>{r[e]=!0}))};return f(e)?n(e):n(String(e).split(t)),r},toCamelCase:e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,(function(e,t,r){return t.toUpperCase()+r})),noop:()=>{},toFiniteNumber:(e,t)=>(e=+e,Number.isFinite(e)?e:t),findKey:T,global:A,isContextDefined:S,ALPHABET:M,generateString:(e=16,t=M.ALPHA_DIGIT)=>{let r="";const{length:n}=t;for(;e--;)r+=t[Math.random()*n|0];return r},isSpecCompliantForm:function(e){return!!(e&&p(e.append)&&"FormData"===e[Symbol.toStringTag]&&e[Symbol.iterator])},toJSONObject:e=>{const t=new Array(10),r=(e,n)=>{if(m(e)){if(t.indexOf(e)>=0)return;if(!("toJSON"in e)){t[n]=e;const i=f(e)?[]:{};return E(e,((e,t)=>{const a=r(e,n+1);!c(a)&&(i[t]=a)})),t[n]=void 0,i}}return e};return r(e,0)},isAsyncFn:B,isThenable:e=>e&&(m(e)||p(e))&&p(e.then)&&p(e.catch)};function F(e,t,r,n,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),r&&(this.config=r),n&&(this.request=n),i&&(this.response=i)}D.inherits(F,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:D.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});const L=F.prototype,U={};["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=>{U[e]={value:e}})),Object.defineProperties(F,U),Object.defineProperty(L,"isAxiosError",{value:!0}),F.from=(e,t,r,n,i,a)=>{const o=Object.create(L);return D.toFlatObject(e,o,(function(e){return e!==Error.prototype}),(e=>"isAxiosError"!==e)),F.call(o,e.message,t,r,n,i),o.cause=e,o.name=e.name,a&&Object.assign(o,a),o};function j(e){return D.isPlainObject(e)||D.isArray(e)}function q(e){return D.endsWith(e,"[]")?e.slice(0,-2):e}function z(e,t,r){return e?e.concat(t).map((function(e,t){return e=q(e),!r&&t?"["+e+"]":e})).join(r?".":""):t}const H=D.toFlatObject(D,{},null,(function(e){return/^is[A-Z]/.test(e)}));function V(e,t,r){if(!D.isObject(e))throw new TypeError("target must be an object");t=t||new FormData;const n=(r=D.toFlatObject(r,{metaTokens:!0,dots:!1,indexes:!1},!1,(function(e,t){return!D.isUndefined(t[e])}))).metaTokens,i=r.visitor||f,a=r.dots,o=r.indexes,s=(r.Blob||"undefined"!=typeof Blob&&Blob)&&D.isSpecCompliantForm(t);if(!D.isFunction(i))throw new TypeError("visitor must be a function");function u(e){if(null===e)return"";if(D.isDate(e))return e.toISOString();if(!s&&D.isBlob(e))throw new F("Blob is not supported. Use a Buffer instead.");return D.isArrayBuffer(e)||D.isTypedArray(e)?s&&"function"==typeof Blob?new Blob([e]):Buffer.from(e):e}function f(e,r,i){let s=e;if(e&&!i&&"object"==typeof e)if(D.endsWith(r,"{}"))r=n?r:r.slice(0,-2),e=JSON.stringify(e);else if(D.isArray(e)&&function(e){return D.isArray(e)&&!e.some(j)}(e)||(D.isFileList(e)||D.endsWith(r,"[]"))&&(s=D.toArray(e)))return r=q(r),s.forEach((function(e,n){!D.isUndefined(e)&&null!==e&&t.append(!0===o?z([r],n,a):null===o?r:r+"[]",u(e))})),!1;return!!j(e)||(t.append(z(i,r,a),u(e)),!1)}const c=[],l=Object.assign(H,{defaultVisitor:f,convertValue:u,isVisitable:j});if(!D.isObject(e))throw new TypeError("data must be an object");return function e(r,n){if(!D.isUndefined(r)){if(-1!==c.indexOf(r))throw Error("Circular reference detected in "+n.join("."));c.push(r),D.forEach(r,(function(r,a){!0===(!(D.isUndefined(r)||null===r)&&i.call(t,r,D.isString(a)?a.trim():a,n,l))&&e(r,n?n.concat(a):[a])})),c.pop()}}(e),t}function G(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,(function(e){return t[e]}))}function W(e,t){this._pairs=[],e&&V(e,this,t)}const K=W.prototype;function X(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function $(e,t,r){if(!t)return e;const n=r&&r.encode||X,i=r&&r.serialize;let a;if(a=i?i(t,r):D.isURLSearchParams(t)?t.toString():new W(t,r).toString(n),a){const t=e.indexOf("#");-1!==t&&(e=e.slice(0,t)),e+=(-1===e.indexOf("?")?"?":"&")+a}return e}K.append=function(e,t){this._pairs.push([e,t])},K.toString=function(e){const t=e?function(t){return e.call(this,t,G)}:G;return this._pairs.map((function(e){return t(e[0])+"="+t(e[1])}),"").join("&")};var J=class{constructor(){this.handlers=[]}use(e,t,r){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!r&&r.synchronous,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){D.forEach(this.handlers,(function(t){null!==t&&e(t)}))}},Y={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1};var Q={isBrowser:!0,classes:{URLSearchParams:"undefined"!=typeof URLSearchParams?URLSearchParams:W,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 Z(e){function t(e,r,n,i){let a=e[i++];const o=Number.isFinite(+a),s=i>=e.length;if(a=!a&&D.isArray(n)?n.length:a,s)return D.hasOwnProp(n,a)?n[a]=[n[a],r]:n[a]=r,!o;n[a]&&D.isObject(n[a])||(n[a]=[]);return t(e,r,n[a],i)&&D.isArray(n[a])&&(n[a]=function(e){const t={},r=Object.keys(e);let n;const i=r.length;let a;for(n=0;n<i;n++)a=r[n],t[a]=e[a];return t}(n[a])),!o}if(D.isFormData(e)&&D.isFunction(e.entries)){const r={};return D.forEachEntry(e,((e,n)=>{t(function(e){return D.matchAll(/\w+|\[(\w*)]/g,e).map((e=>"[]"===e[0]?"":e[1]||e[0]))}(e),n,r,0)})),r}return null}const ee={"Content-Type":void 0};const te={transitional:Y,adapter:["xhr","http"],transformRequest:[function(e,t){const r=t.getContentType()||"",n=r.indexOf("application/json")>-1,i=D.isObject(e);i&&D.isHTMLForm(e)&&(e=new FormData(e));if(D.isFormData(e))return n&&n?JSON.stringify(Z(e)):e;if(D.isArrayBuffer(e)||D.isBuffer(e)||D.isStream(e)||D.isFile(e)||D.isBlob(e))return e;if(D.isArrayBufferView(e))return e.buffer;if(D.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let a;if(i){if(r.indexOf("application/x-www-form-urlencoded")>-1)return function(e,t){return V(e,new Q.classes.URLSearchParams,Object.assign({visitor:function(e,t,r,n){return Q.isNode&&D.isBuffer(e)?(this.append(t,e.toString("base64")),!1):n.defaultVisitor.apply(this,arguments)}},t))}(e,this.formSerializer).toString();if((a=D.isFileList(e))||r.indexOf("multipart/form-data")>-1){const t=this.env&&this.env.FormData;return V(a?{"files[]":e}:e,t&&new t,this.formSerializer)}}return i||n?(t.setContentType("application/json",!1),function(e,t,r){if(D.isString(e))try{return(t||JSON.parse)(e),D.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(r||JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){const t=this.transitional||te.transitional,r=t&&t.forcedJSONParsing,n="json"===this.responseType;if(e&&D.isString(e)&&(r&&!this.responseType||n)){const r=!(t&&t.silentJSONParsing)&&n;try{return JSON.parse(e)}catch(e){if(r){if("SyntaxError"===e.name)throw F.from(e,F.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:Q.classes.FormData,Blob:Q.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};D.forEach(["delete","get","head"],(function(e){te.headers[e]={}})),D.forEach(["post","put","patch"],(function(e){te.headers[e]=D.merge(ee)}));var re=te;const ne=D.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 ie=Symbol("internals");function ae(e){return e&&String(e).trim().toLowerCase()}function oe(e){return!1===e||null==e?e:D.isArray(e)?e.map(oe):String(e)}function se(e,t,r,n,i){return D.isFunction(n)?n.call(this,t,r):(i&&(t=r),D.isString(t)?D.isString(n)?-1!==t.indexOf(n):D.isRegExp(n)?n.test(t):void 0:void 0)}let ue=class{constructor(e){e&&this.set(e)}set(e,t,r){const n=this;function i(e,t,r){const i=ae(t);if(!i)throw new Error("header name must be a non-empty string");const a=D.findKey(n,i);(!a||void 0===n[a]||!0===r||void 0===r&&!1!==n[a])&&(n[a||t]=oe(e))}const a=(e,t)=>D.forEach(e,((e,r)=>i(e,r,t)));return D.isPlainObject(e)||e instanceof this.constructor?a(e,t):D.isString(e)&&(e=e.trim())&&!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim())?a((e=>{const t={};let r,n,i;return e&&e.split("\n").forEach((function(e){i=e.indexOf(":"),r=e.substring(0,i).trim().toLowerCase(),n=e.substring(i+1).trim(),!r||t[r]&&ne[r]||("set-cookie"===r?t[r]?t[r].push(n):t[r]=[n]:t[r]=t[r]?t[r]+", "+n:n)})),t})(e),t):null!=e&&i(t,e,r),this}get(e,t){if(e=ae(e)){const r=D.findKey(this,e);if(r){const e=this[r];if(!t)return e;if(!0===t)return function(e){const t=Object.create(null),r=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let n;for(;n=r.exec(e);)t[n[1]]=n[2];return t}(e);if(D.isFunction(t))return t.call(this,e,r);if(D.isRegExp(t))return t.exec(e);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=ae(e)){const r=D.findKey(this,e);return!(!r||void 0===this[r]||t&&!se(0,this[r],r,t))}return!1}delete(e,t){const r=this;let n=!1;function i(e){if(e=ae(e)){const i=D.findKey(r,e);!i||t&&!se(0,r[i],i,t)||(delete r[i],n=!0)}}return D.isArray(e)?e.forEach(i):i(e),n}clear(e){const t=Object.keys(this);let r=t.length,n=!1;for(;r--;){const i=t[r];e&&!se(0,this[i],i,e,!0)||(delete this[i],n=!0)}return n}normalize(e){const t=this,r={};return D.forEach(this,((n,i)=>{const a=D.findKey(r,i);if(a)return t[a]=oe(n),void delete t[i];const o=e?function(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,((e,t,r)=>t.toUpperCase()+r))}(i):String(i).trim();o!==i&&delete t[i],t[o]=oe(n),r[o]=!0})),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const t=Object.create(null);return D.forEach(this,((r,n)=>{null!=r&&!1!==r&&(t[n]=e&&D.isArray(r)?r.join(", "):r)})),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 r=new this(e);return t.forEach((e=>r.set(e))),r}static accessor(e){const t=(this[ie]=this[ie]={accessors:{}}).accessors,r=this.prototype;function n(e){const n=ae(e);t[n]||(!function(e,t){const r=D.toCamelCase(" "+t);["get","set","has"].forEach((n=>{Object.defineProperty(e,n+r,{value:function(e,r,i){return this[n].call(this,t,e,r,i)},configurable:!0})}))}(r,e),t[n]=!0)}return D.isArray(e)?e.forEach(n):n(e),this}};ue.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),D.freezeMethods(ue.prototype),D.freezeMethods(ue);var fe=ue;function ce(e,t){const r=this||re,n=t||r,i=fe.from(n.headers);let a=n.data;return D.forEach(e,(function(e){a=e.call(r,a,i.normalize(),t?t.status:void 0)})),i.normalize(),a}function le(e){return!(!e||!e.__CANCEL__)}function de(e,t,r){F.call(this,null==e?"canceled":e,F.ERR_CANCELED,t,r),this.name="CanceledError"}D.inherits(de,F,{__CANCEL__:!0});var pe=Q.isStandardBrowserEnv?{write:function(e,t,r,n,i,a){const o=[];o.push(e+"="+encodeURIComponent(t)),D.isNumber(r)&&o.push("expires="+new Date(r).toGMTString()),D.isString(n)&&o.push("path="+n),D.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 he(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 me=Q.isStandardBrowserEnv?function(){const e=/(msie|trident)/i.test(navigator.userAgent),t=document.createElement("a");let r;function n(r){let n=r;return e&&(t.setAttribute("href",n),n=t.href),t.setAttribute("href",n),{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 r=n(window.location.href),function(e){const t=D.isString(e)?n(e):e;return t.protocol===r.protocol&&t.host===r.host}}():function(){return!0};function ye(e,t){let r=0;const n=function(e,t){e=e||10;const r=new Array(e),n=new Array(e);let i,a=0,o=0;return t=void 0!==t?t:1e3,function(s){const u=Date.now(),f=n[o];i||(i=u),r[a]=s,n[a]=u;let c=o,l=0;for(;c!==a;)l+=r[c++],c%=e;if(a=(a+1)%e,a===o&&(o=(o+1)%e),u-i<t)return;const d=f&&u-f;return d?Math.round(1e3*l/d):void 0}}(50,250);return i=>{const a=i.loaded,o=i.lengthComputable?i.total:void 0,s=a-r,u=n(s);r=a;const f={loaded:a,total:o,progress:o?a/o:void 0,bytes:s,rate:u||void 0,estimated:u&&o&&a<=o?(o-a)/u:void 0,event:i};f[t?"download":"upload"]=!0,e(f)}}var be="undefined"!=typeof XMLHttpRequest&&function(e){return new Promise((function(t,r){let n=e.data;const i=fe.from(e.headers).normalize(),a=e.responseType;let o;function s(){e.cancelToken&&e.cancelToken.unsubscribe(o),e.signal&&e.signal.removeEventListener("abort",o)}D.isFormData(n)&&(Q.isStandardBrowserEnv||Q.isStandardBrowserWebWorkerEnv?i.setContentType(!1):i.setContentType("multipart/form-data;",!1));let u=new XMLHttpRequest;if(e.auth){const t=e.auth.username||"",r=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";i.set("Authorization","Basic "+btoa(t+":"+r))}const f=he(e.baseURL,e.url);function c(){if(!u)return;const n=fe.from("getAllResponseHeaders"in u&&u.getAllResponseHeaders());!function(e,t,r){const n=r.config.validateStatus;r.status&&n&&!n(r.status)?t(new F("Request failed with status code "+r.status,[F.ERR_BAD_REQUEST,F.ERR_BAD_RESPONSE][Math.floor(r.status/100)-4],r.config,r.request,r)):e(r)}((function(e){t(e),s()}),(function(e){r(e),s()}),{data:a&&"text"!==a&&"json"!==a?u.response:u.responseText,status:u.status,statusText:u.statusText,headers:n,config:e,request:u}),u=null}if(u.open(e.method.toUpperCase(),$(f,e.params,e.paramsSerializer),!0),u.timeout=e.timeout,"onloadend"in u?u.onloadend=c:u.onreadystatechange=function(){u&&4===u.readyState&&(0!==u.status||u.responseURL&&0===u.responseURL.indexOf("file:"))&&setTimeout(c)},u.onabort=function(){u&&(r(new F("Request aborted",F.ECONNABORTED,e,u)),u=null)},u.onerror=function(){r(new F("Network Error",F.ERR_NETWORK,e,u)),u=null},u.ontimeout=function(){let t=e.timeout?"timeout of "+e.timeout+"ms exceeded":"timeout exceeded";const n=e.transitional||Y;e.timeoutErrorMessage&&(t=e.timeoutErrorMessage),r(new F(t,n.clarifyTimeoutError?F.ETIMEDOUT:F.ECONNABORTED,e,u)),u=null},Q.isStandardBrowserEnv){const t=(e.withCredentials||me(f))&&e.xsrfCookieName&&pe.read(e.xsrfCookieName);t&&i.set(e.xsrfHeaderName,t)}void 0===n&&i.setContentType(null),"setRequestHeader"in u&&D.forEach(i.toJSON(),(function(e,t){u.setRequestHeader(t,e)})),D.isUndefined(e.withCredentials)||(u.withCredentials=!!e.withCredentials),a&&"json"!==a&&(u.responseType=e.responseType),"function"==typeof e.onDownloadProgress&&u.addEventListener("progress",ye(e.onDownloadProgress,!0)),"function"==typeof e.onUploadProgress&&u.upload&&u.upload.addEventListener("progress",ye(e.onUploadProgress)),(e.cancelToken||e.signal)&&(o=t=>{u&&(r(!t||t.type?new de(null,e,u):t),u.abort(),u=null)},e.cancelToken&&e.cancelToken.subscribe(o),e.signal&&(e.signal.aborted?o():e.signal.addEventListener("abort",o)));const l=function(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}(f);l&&-1===Q.protocols.indexOf(l)?r(new F("Unsupported protocol "+l+":",F.ERR_BAD_REQUEST,e)):u.send(n||null)}))};const ge={http:null,xhr:be};D.forEach(ge,((e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch(e){}Object.defineProperty(e,"adapterName",{value:t})}}));var ve=e=>{e=D.isArray(e)?e:[e];const{length:t}=e;let r,n;for(let i=0;i<t&&(r=e[i],!(n=D.isString(r)?ge[r.toLowerCase()]:r));i++);if(!n){if(!1===n)throw new F(`Adapter ${r} is not supported by the environment`,"ERR_NOT_SUPPORT");throw new Error(D.hasOwnProp(ge,r)?`Adapter '${r}' is not available in the build`:`Unknown adapter '${r}'`)}if(!D.isFunction(n))throw new TypeError("adapter is not a function");return n};function we(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new de(null,e)}function _e(e){we(e),e.headers=fe.from(e.headers),e.data=ce.call(e,e.transformRequest),-1!==["post","put","patch"].indexOf(e.method)&&e.headers.setContentType("application/x-www-form-urlencoded",!1);return ve(e.adapter||re.adapter)(e).then((function(t){return we(e),t.data=ce.call(e,e.transformResponse,t),t.headers=fe.from(t.headers),t}),(function(t){return le(t)||(we(e),t&&t.response&&(t.response.data=ce.call(e,e.transformResponse,t.response),t.response.headers=fe.from(t.response.headers))),Promise.reject(t)}))}const Ee=e=>e instanceof fe?e.toJSON():e;function Te(e,t){t=t||{};const r={};function n(e,t,r){return D.isPlainObject(e)&&D.isPlainObject(t)?D.merge.call({caseless:r},e,t):D.isPlainObject(t)?D.merge({},t):D.isArray(t)?t.slice():t}function i(e,t,r){return D.isUndefined(t)?D.isUndefined(e)?void 0:n(void 0,e,r):n(e,t,r)}function a(e,t){if(!D.isUndefined(t))return n(void 0,t)}function o(e,t){return D.isUndefined(t)?D.isUndefined(e)?void 0:n(void 0,e):n(void 0,t)}function s(r,i,a){return a in t?n(r,i):a in e?n(void 0,r):void 0}const u={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(Ee(e),Ee(t),!0)};return D.forEach(Object.keys(Object.assign({},e,t)),(function(n){const a=u[n]||i,o=a(e[n],t[n],n);D.isUndefined(o)&&a!==s||(r[n]=o)})),r}const Ae="1.4.0",Se={};["object","boolean","number","function","string","symbol"].forEach(((e,t)=>{Se[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}}));const ke={};Se.transitional=function(e,t,r){function n(e,t){return"[Axios v1.4.0] Transitional option '"+e+"'"+t+(r?". "+r:"")}return(r,i,a)=>{if(!1===e)throw new F(n(i," has been removed"+(t?" in "+t:"")),F.ERR_DEPRECATED);return t&&!ke[i]&&(ke[i]=!0,console.warn(n(i," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(r,i,a)}};var Oe={assertOptions:function(e,t,r){if("object"!=typeof e)throw new F("options must be an object",F.ERR_BAD_OPTION_VALUE);const n=Object.keys(e);let i=n.length;for(;i-- >0;){const a=n[i],o=t[a];if(o){const t=e[a],r=void 0===t||o(t,a,e);if(!0!==r)throw new F("option "+a+" must be "+r,F.ERR_BAD_OPTION_VALUE)}else if(!0!==r)throw new F("Unknown option "+a,F.ERR_BAD_OPTION)}},validators:Se};const Re=Oe.validators;let xe=class{constructor(e){this.defaults=e,this.interceptors={request:new J,response:new J}}request(e,t){"string"==typeof e?(t=t||{}).url=e:t=e||{},t=Te(this.defaults,t);const{transitional:r,paramsSerializer:n,headers:i}=t;let a;void 0!==r&&Oe.assertOptions(r,{silentJSONParsing:Re.transitional(Re.boolean),forcedJSONParsing:Re.transitional(Re.boolean),clarifyTimeoutError:Re.transitional(Re.boolean)},!1),null!=n&&(D.isFunction(n)?t.paramsSerializer={serialize:n}:Oe.assertOptions(n,{encode:Re.function,serialize:Re.function},!0)),t.method=(t.method||this.defaults.method||"get").toLowerCase(),a=i&&D.merge(i.common,i[t.method]),a&&D.forEach(["delete","get","head","post","put","patch","common"],(e=>{delete i[e]})),t.headers=fe.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 u=[];let f;this.interceptors.response.forEach((function(e){u.push(e.fulfilled,e.rejected)}));let c,l=0;if(!s){const e=[_e.bind(this),void 0];for(e.unshift.apply(e,o),e.push.apply(e,u),c=e.length,f=Promise.resolve(t);l<c;)f=f.then(e[l++],e[l++]);return f}c=o.length;let d=t;for(l=0;l<c;){const e=o[l++],t=o[l++];try{d=e(d)}catch(e){t.call(this,e);break}}try{f=_e.call(this,d)}catch(e){return Promise.reject(e)}for(l=0,c=u.length;l<c;)f=f.then(u[l++],u[l++]);return f}getUri(e){return $(he((e=Te(this.defaults,e)).baseURL,e.url),e.params,e.paramsSerializer)}};D.forEach(["delete","get","head","options"],(function(e){xe.prototype[e]=function(t,r){return this.request(Te(r||{},{method:e,url:t,data:(r||{}).data}))}})),D.forEach(["post","put","patch"],(function(e){function t(t){return function(r,n,i){return this.request(Te(i||{},{method:e,headers:t?{"Content-Type":"multipart/form-data"}:{},url:r,data:n}))}}xe.prototype[e]=t(),xe.prototype[e+"Form"]=t(!0)}));var Ie=xe;var Ce=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 r=this;this.promise.then((e=>{if(!r._listeners)return;let t=r._listeners.length;for(;t-- >0;)r._listeners[t](e);r._listeners=null})),this.promise.then=e=>{let t;const n=new Promise((e=>{r.subscribe(e),t=e})).then(e);return n.cancel=function(){r.unsubscribe(t)},n},e((function(e,n,i){r.reason||(r.reason=new de(e,n,i),t(r.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 r=new e((function(e){t=e}));return{token:r,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 Pe=Ne;const Me=function e(t){const n=new Ie(t),i=r(Ie.prototype.request,n);return D.extend(i,Ie.prototype,n,{allOwnKeys:!0}),D.extend(i,n,null,{allOwnKeys:!0}),i.create=function(r){return e(Te(t,r))},i}(re);Me.Axios=Ie,Me.CanceledError=de,Me.CancelToken=Ce,Me.isCancel=le,Me.VERSION=Ae,Me.toFormData=V,Me.AxiosError=F,Me.Cancel=Me.CanceledError,Me.all=function(e){return Promise.all(e)},Me.spread=function(e){return function(t){return e.apply(null,t)}},Me.isAxiosError=function(e){return D.isObject(e)&&!0===e.isAxiosError},Me.mergeConfig=Te,Me.AxiosHeaders=fe,Me.formToJSON=e=>Z(D.isHTMLForm(e)?new FormData(e):e),Me.HttpStatusCode=Pe,Me.default=Me;var Be=Me;const De="https://indexer-mr.sandbox.imtbl.com".replace(/\/+$/,"");let Fe=class{basePath;axios;configuration;constructor(e,t=De,r=Be){this.basePath=t,this.axios=r,e&&(this.configuration=e,this.basePath=e.basePath||this.basePath)}},Le=class extends Error{field;name="RequiredError";constructor(e,t){super(t),this.field=e}};const Ue="https://example.com",je=function(e,t,r){if(null==r)throw new Le(t,`Required parameter ${t} was null or undefined when calling ${e}.`)};function qe(e,t,r=""){"object"==typeof t?Array.isArray(t)?t.forEach((t=>qe(e,t,r))):Object.keys(t).forEach((n=>qe(e,t[n],`${r}${""!==r?".":""}${n}`))):e.has(r)?e.append(r,t):e.set(r,t)}const ze=function(e,...t){const r=new URLSearchParams(e.search);qe(r,t),e.search=r.toString()},He=function(e,t,r){const n="string"!=typeof e;return(n&&r&&r.isJsonMime?r.isJsonMime(t.headers["Content-Type"]):n)?JSON.stringify(void 0!==e?e:{}):e||""},Ve=function(e){return e.pathname+e.search+e.hash},Ge=function(e,t,r,n){return(i=t,a=r)=>{const o={...e.options,url:(n?.basePath||a)+e.url};return i.request(o)}},We=function(e){return{getActivity:async(t,r,n={})=>{je("getActivity","chainName",t),je("getActivity","activityId",r);const i="/v1/chains/{chain_name}/activities/{activity_id}".replace("{chain_name}",encodeURIComponent(String(t))).replace("{activity_id}",encodeURIComponent(String(r))),a=new URL(i,Ue);let o;e&&(o=e.baseOptions);const s={method:"GET",...o,...n};ze(a,{});let u=o&&o.headers?o.headers:{};return s.headers={...u,...n.headers},{url:Ve(a),options:s}},listActivities:async(t,r,n,i,a,o,s,u,f,c,l={})=>{je("listActivities","chainName",t);const d="/v1/chains/{chain_name}/activities".replace("{chain_name}",encodeURIComponent(String(t))),p=new URL(d,Ue);let h;e&&(h=e.baseOptions);const m={method:"GET",...h,...l},y={};void 0!==r&&(y.contract_address=r),void 0!==n&&(y.token_id=n),void 0!==i&&(y.account_address=i),void 0!==a&&(y.activity_type=a),void 0!==o&&(y.from_indexed_at=o instanceof Date?o.toISOString():o),void 0!==s&&(y.to_indexed_at=s instanceof Date?s.toISOString():s),void 0!==u&&(y.transaction_hash=u),void 0!==f&&(y.page_cursor=f),void 0!==c&&(y.page_size=c),ze(p,y);let b=h&&h.headers?h.headers:{};return m.headers={...b,...l.headers},{url:Ve(p),options:m}}}},Ke=function(e){const t=We(e);return{async getActivity(r,n,i){const a=await t.getActivity(r,n,i);return Ge(a,Be,De,e)},async listActivities(r,n,i,a,o,s,u,f,c,l,d){const p=await t.listActivities(r,n,i,a,o,s,u,f,c,l,d);return Ge(p,Be,De,e)}}};class Xe extends Fe{getActivity(e,t){return Ke(this.configuration).getActivity(e.chainName,e.activityId,t).then((e=>e(this.axios,this.basePath)))}listActivities(e,t){return Ke(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 $e=function(e){return{listChains:async(t,r,n={})=>{const i=new URL("/v1/chains",Ue);let a;e&&(a=e.baseOptions);const o={method:"GET",...a,...n},s={};void 0!==t&&(s.page_cursor=t),void 0!==r&&(s.page_size=r),ze(i,s);let u=a&&a.headers?a.headers:{};return o.headers={...u,...n.headers},{url:Ve(i),options:o}}}},Je=function(e){const t=$e(e);return{async listChains(r,n,i){const a=await t.listChains(r,n,i);return Ge(a,Be,De,e)}}};class Ye extends Fe{listChains(e={},t){return Je(this.configuration).listChains(e.pageCursor,e.pageSize,t).then((e=>e(this.axios,this.basePath)))}}const Qe=function(e){return{getCollection:async(t,r,n={})=>{je("getCollection","contractAddress",t),je("getCollection","chainName",r);const i="/v1/chains/{chain_name}/collections/{contract_address}".replace("{contract_address}",encodeURIComponent(String(t))).replace("{chain_name}",encodeURIComponent(String(r))),a=new URL(i,Ue);let o;e&&(o=e.baseOptions);const s={method:"GET",...o,...n};ze(a,{});let u=o&&o.headers?o.headers:{};return s.headers={...u,...n.headers},{url:Ve(a),options:s}},listCollections:async(t,r,n,i={})=>{je("listCollections","chainName",t);const a="/v1/chains/{chain_name}/collections".replace("{chain_name}",encodeURIComponent(String(t))),o=new URL(a,Ue);let s;e&&(s=e.baseOptions);const u={method:"GET",...s,...i},f={};void 0!==r&&(f.page_cursor=r),void 0!==n&&(f.page_size=n),ze(o,f);let c=s&&s.headers?s.headers:{};return u.headers={...c,...i.headers},{url:Ve(o),options:u}}}},Ze=function(e){const t=Qe(e);return{async getCollection(r,n,i){const a=await t.getCollection(r,n,i);return Ge(a,Be,De,e)},async listCollections(r,n,i,a){const o=await t.listCollections(r,n,i,a);return Ge(o,Be,De,e)}}};class et extends Fe{getCollection(e,t){return Ze(this.configuration).getCollection(e.contractAddress,e.chainName,t).then((e=>e(this.axios,this.basePath)))}listCollections(e,t){return Ze(this.configuration).listCollections(e.chainName,e.pageCursor,e.pageSize,t).then((e=>e(this.axios,this.basePath)))}}const tt=function(e){return{listNFTOwners:async(t,r,n,i,a,o={})=>{je("listNFTOwners","contractAddress",t),je("listNFTOwners","tokenId",r),je("listNFTOwners","chainName",n);const s="/v1/chains/{chain_name}/collections/{contract_address}/nfts/{token_id}/owners".replace("{contract_address}",encodeURIComponent(String(t))).replace("{token_id}",encodeURIComponent(String(r))).replace("{chain_name}",encodeURIComponent(String(n))),u=new URL(s,Ue);let f;e&&(f=e.baseOptions);const c={method:"GET",...f,...o},l={};void 0!==i&&(l.page_cursor=i),void 0!==a&&(l.page_size=a),ze(u,l);let d=f&&f.headers?f.headers:{};return c.headers={...d,...o.headers},{url:Ve(u),options:c}}}},rt=function(e){const t=tt(e);return{async listNFTOwners(r,n,i,a,o,s){const u=await t.listNFTOwners(r,n,i,a,o,s);return Ge(u,Be,De,e)}}};class nt extends Fe{listNFTOwners(e,t){return rt(this.configuration).listNFTOwners(e.contractAddress,e.tokenId,e.chainName,e.pageCursor,e.pageSize,t).then((e=>e(this.axios,this.basePath)))}}const it=function(e){return{getNFT:async(t,r,n,i={})=>{je("getNFT","contractAddress",t),je("getNFT","tokenId",r),je("getNFT","chainName",n);const a="/v1/chains/{chain_name}/collections/{contract_address}/nfts/{token_id}".replace("{contract_address}",encodeURIComponent(String(t))).replace("{token_id}",encodeURIComponent(String(r))).replace("{chain_name}",encodeURIComponent(String(n))),o=new URL(a,Ue);let s;e&&(s=e.baseOptions);const u={method:"GET",...s,...i};ze(o,{});let f=s&&s.headers?s.headers:{};return u.headers={...f,...i.headers},{url:Ve(o),options:u}},listNFTs:async(t,r,n,i,a={})=>{je("listNFTs","contractAddress",t),je("listNFTs","chainName",r);const o="/v1/chains/{chain_name}/collections/{contract_address}/nfts".replace("{contract_address}",encodeURIComponent(String(t))).replace("{chain_name}",encodeURIComponent(String(r))),s=new URL(o,Ue);let u;e&&(u=e.baseOptions);const f={method:"GET",...u,...a},c={};void 0!==n&&(c.page_cursor=n),void 0!==i&&(c.page_size=i),ze(s,c);let l=u&&u.headers?u.headers:{};return f.headers={...l,...a.headers},{url:Ve(s),options:f}},listNFTsByAccountAddress:async(t,r,n,i,a,o={})=>{je("listNFTsByAccountAddress","accountAddress",t),je("listNFTsByAccountAddress","chainName",r);const s="/v1/chains/{chain_name}/accounts/{account_address}/nfts".replace("{account_address}",encodeURIComponent(String(t))).replace("{chain_name}",encodeURIComponent(String(r))),u=new URL(s,Ue);let f;e&&(f=e.baseOptions);const c={method:"GET",...f,...o},l={};void 0!==n&&(l.contract_address=n),void 0!==i&&(l.page_cursor=i),void 0!==a&&(l.page_size=a),ze(u,l);let d=f&&f.headers?f.headers:{};return c.headers={...d,...o.headers},{url:Ve(u),options:c}}}},at=function(e){const t=it(e);return{async getNFT(r,n,i,a){const o=await t.getNFT(r,n,i,a);return Ge(o,Be,De,e)},async listNFTs(r,n,i,a,o){const s=await t.listNFTs(r,n,i,a,o);return Ge(s,Be,De,e)},async listNFTsByAccountAddress(r,n,i,a,o,s){const u=await t.listNFTsByAccountAddress(r,n,i,a,o,s);return Ge(u,Be,De,e)}}};class ot extends Fe{getNFT(e,t){return at(this.configuration).getNFT(e.contractAddress,e.tokenId,e.chainName,t).then((e=>e(this.axios,this.basePath)))}listNFTs(e,t){return at(this.configuration).listNFTs(e.contractAddress,e.chainName,e.pageCursor,e.pageSize,t).then((e=>e(this.axios,this.basePath)))}listNFTsByAccountAddress(e,t){return at(this.configuration).listNFTsByAccountAddress(e.accountAddress,e.chainName,e.contractAddress,e.pageCursor,e.pageSize,t).then((e=>e(this.axios,this.basePath)))}}const st=function(e){return{createListing:async(t,r,n={})=>{je("createListing","chainName",t),je("createListing","createListingRequestBody",r);const i="/v1/chains/{chain_name}/orders/listings".replace("{chain_name}",encodeURIComponent(String(t))),a=new URL(i,Ue);let o;e&&(o=e.baseOptions);const s={method:"POST",...o,...n},u={};u["Content-Type"]="application/json",ze(a,{});let f=o&&o.headers?o.headers:{};return s.headers={...u,...f,...n.headers},s.data=He(r,s,e),{url:Ve(a),options:s}},getListing:async(t,r,n={})=>{je("getListing","chainName",t),je("getListing","listingId",r);const i="/v1/chains/{chain_name}/orders/listings/{listing_id}".replace("{chain_name}",encodeURIComponent(String(t))).replace("{listing_id}",encodeURIComponent(String(r))),a=new URL(i,Ue);let o;e&&(o=e.baseOptions);const s={method:"GET",...o,...n};ze(a,{});let u=o&&o.headers?o.headers:{};return s.headers={...u,...n.headers},{url:Ve(a),options:s}},listListings:async(t,r,n,i,a,o,s,u,f,c={})=>{je("listListings","chainName",t);const l="/v1/chains/{chain_name}/orders/listings".replace("{chain_name}",encodeURIComponent(String(t))),d=new URL(l,Ue);let p;e&&(p=e.baseOptions);const h={method:"GET",...p,...c},m={};void 0!==r&&(m.status=r),void 0!==n&&(m.sell_item_contract_address=n),void 0!==i&&(m.buy_item_contract_address=i),void 0!==a&&(m.sell_item_token_id=a),void 0!==o&&(m.page_size=o),void 0!==s&&(m.sort_by=s),void 0!==u&&(m.sort_direction=u),void 0!==f&&(m.page_cursor=f),ze(d,m);let y=p&&p.headers?p.headers:{};return h.headers={...y,...c.headers},{url:Ve(d),options:h}}}},ut=function(e){const t=st(e);return{async createListing(r,n,i){const a=await t.createListing(r,n,i);return Ge(a,Be,De,e)},async getListing(r,n,i){const a=await t.getListing(r,n,i);return Ge(a,Be,De,e)},async listListings(r,n,i,a,o,s,u,f,c,l){const d=await t.listListings(r,n,i,a,o,s,u,f,c,l);return Ge(d,Be,De,e)}}};class ft extends Fe{createListing(e,t){return ut(this.configuration).createListing(e.chainName,e.createListingRequestBody,t).then((e=>e(this.axios,this.basePath)))}getListing(e,t){return ut(this.configuration).getListing(e.chainName,e.listingId,t).then((e=>e(this.axios,this.basePath)))}listListings(e,t){return ut(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)))}}const ct=function(e){return{createCounterfactualAddress:async(t,r={})=>{je("createCounterfactualAddress","createCounterfactualAddressRequest",t);const n=new URL("/passport-mr/v1/counterfactual-address",Ue);let i;e&&(i=e.baseOptions);const a={method:"POST",...i,...r},o={};await async function(e,t){if(t&&t.accessToken){const r="function"==typeof t.accessToken?await t.accessToken():await t.accessToken;e.Authorization="Bearer "+r}}(o,e),o["Content-Type"]="application/json",ze(n,{});let s=i&&i.headers?i.headers:{};return a.headers={...o,...s,...r.headers},a.data=He(t,a,e),{url:Ve(n),options:a}}}},lt=function(e){const t=ct(e);return{async createCounterfactualAddress(r,n){const i=await t.createCounterfactualAddress(r,n);return Ge(i,Be,De,e)}}};class dt extends Fe{createCounterfactualAddress(e,t){return lt(this.configuration).createCounterfactualAddress(e.createCounterfactualAddressRequest,t).then((e=>e(this.axios,this.basePath)))}}const pt=function(e){return{getERC20Token:async(t,r,n={})=>{je("getERC20Token","contractAddress",t),je("getERC20Token","chainName",r);const i="/v1/chains/{chain_name}/tokens/{contract_address}".replace("{contract_address}",encodeURIComponent(String(t))).replace("{chain_name}",encodeURIComponent(String(r))),a=new URL(i,Ue);let o;e&&(o=e.baseOptions);const s={method:"GET",...o,...n};ze(a,{});let u=o&&o.headers?o.headers:{};return s.headers={...u,...n.headers},{url:Ve(a),options:s}},listERC20Tokens:async(t,r,n,i={})=>{je("listERC20Tokens","chainName",t);const a="/v1/chains/{chain_name}/tokens".replace("{chain_name}",encodeURIComponent(String(t))),o=new URL(a,Ue);let s;e&&(s=e.baseOptions);const u={method:"GET",...s,...i},f={};void 0!==r&&(f.page_cursor=r),void 0!==n&&(f.page_size=n),ze(o,f);let c=s&&s.headers?s.headers:{};return u.headers={...c,...i.headers},{url:Ve(o),options:u}}}},ht=function(e){const t=pt(e);return{async getERC20Token(r,n,i){const a=await t.getERC20Token(r,n,i);return Ge(a,Be,De,e)},async listERC20Tokens(r,n,i,a){const o=await t.listERC20Tokens(r,n,i,a);return Ge(o,Be,De,e)}}};var mt=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:Xe,ActivitiesApiAxiosParamCreator:We,ActivitiesApiFactory:function(e,t,r){const n=Ke(e);return{getActivity:(e,i,a)=>n.getActivity(e,i,a).then((e=>e(r,t))),listActivities:(e,i,a,o,s,u,f,c,l,d,p)=>n.listActivities(e,i,a,o,s,u,f,c,l,d,p).then((e=>e(r,t)))}},ActivitiesApiFp:Ke,ActivityType:{Mint:"mint",Burn:"burn",Transfer:"transfer",Sale:"sale"},ChainsApi:Ye,ChainsApiAxiosParamCreator:$e,ChainsApiFactory:function(e,t,r){const n=Je(e);return{listChains:(e,i,a)=>n.listChains(e,i,a).then((e=>e(r,t)))}},ChainsApiFp:Je,CollectionContractType:{Erc721:"ERC721"},CollectionsApi:et,CollectionsApiAxiosParamCreator:Qe,CollectionsApiFactory:function(e,t,r){const n=Ze(e);return{getCollection:(e,i,a)=>n.getCollection(e,i,a).then((e=>e(r,t))),listCollections:(e,i,a,o)=>n.listCollections(e,i,a,o).then((e=>e(r,t)))}},CollectionsApiFp:Ze,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())}},CreateOrderProtocolDataOrderTypeEnum:{FullRestricted:"FULL_RESTRICTED"},ERC20ItemItemTypeEnum:{Erc20:"ERC20"},ERC721ItemItemTypeEnum:{Erc721:"ERC721"},FeeFeeTypeEnum:{Royalty:"ROYALTY"},NFTContractType:{Erc721:"ERC721"},NativeItemItemTypeEnum:{Native:"NATIVE"},NftOwnersApi:nt,NftOwnersApiAxiosParamCreator:tt,NftOwnersApiFactory:function(e,t,r){const n=rt(e);return{listNFTOwners:(e,i,a,o,s,u)=>n.listNFTOwners(e,i,a,o,s,u).then((e=>e(r,t)))}},NftOwnersApiFp:rt,NftsApi:ot,NftsApiAxiosParamCreator:it,NftsApiFactory:function(e,t,r){const n=at(e);return{getNFT:(e,i,a,o)=>n.getNFT(e,i,a,o).then((e=>e(r,t))),listNFTs:(e,i,a,o,s)=>n.listNFTs(e,i,a,o,s).then((e=>e(r,t))),listNFTsByAccountAddress:(e,i,a,o,s,u)=>n.listNFTsByAccountAddress(e,i,a,o,s,u).then((e=>e(r,t)))}},NftsApiFp:at,OrderStatus:{Pending:"PENDING",Active:"ACTIVE",Inactive:"INACTIVE",Filled:"FILLED",Cancelled:"CANCELLED",Expired:"EXPIRED"},OrdersApi:ft,OrdersApiAxiosParamCreator:st,OrdersApiFactory:function(e,t,r){const n=ut(e);return{createListing:(e,i,a)=>n.createListing(e,i,a).then((e=>e(r,t))),getListing:(e,i,a)=>n.getListing(e,i,a).then((e=>e(r,t))),listListings:(e,i,a,o,s,u,f,c,l,d)=>n.listListings(e,i,a,o,s,u,f,c,l,d).then((e=>e(r,t)))}},OrdersApiFp:ut,PassportApi:dt,PassportApiAxiosParamCreator:ct,PassportApiFactory:function(e,t,r){const n=lt(e);return{createCounterfactualAddress:(e,i)=>n.createCounterfactualAddress(e,i).then((e=>e(r,t)))}},PassportApiFp:lt,SaleFeeTypeEnum:{Royalty:"ROYALTY"},TokenContractType:{Erc20:"ERC20"},TokensApi:class extends Fe{getERC20Token(e,t){return ht(this.configuration).getERC20Token(e.contractAddress,e.chainName,t).then((e=>e(this.axios,this.basePath)))}listERC20Tokens(e,t){return ht(this.configuration).listERC20Tokens(e.chainName,e.pageCursor,e.pageSize,t).then((e=>e(this.axios,this.basePath)))}},TokensApiAxiosParamCreator:pt,TokensApiFactory:function(e,t,r){const n=ht(e);return{getERC20Token:(e,i,a)=>n.getERC20Token(e,i,a).then((e=>e(r,t))),listERC20Tokens:(e,i,a,o)=>n.listERC20Tokens(e,i,a,o).then((e=>e(r,t)))}},TokensApiFp:ht});class yt{config;activitiesApi;chainsApi;collectionApi;nftOwnersApi;nftsApi;ordersApi;passportApi;constructor(e){this.config=e,this.activitiesApi=new Xe(e.indexer),this.chainsApi=new Ye(e.indexer),this.collectionApi=new et(e.indexer),this.nftOwnersApi=new nt(e.indexer),this.nftsApi=new ot(e.indexer),this.ordersApi=new ft(e.orderBook),this.passportApi=new dt(e.passport)}}const bt={"x-sdk-version":"ts-immutable-sdk-0.3.1-alpha"},gt=({basePath:e,headers:t})=>{if(!e.trim())throw Error("basePath can not be empty");const r={basePath:e,baseOptions:{headers:{...bt,...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())}}(r)},vt=()=>({indexer:gt({basePath:"https://indexer-mr.imtbl.com"}),orderBook:gt({basePath:"https://order-book-mr.imtbl.com"}),passport:gt({basePath:"https://api.immutable.com"})}),wt=()=>({indexer:gt({basePath:"https://indexer-mr.sandbox.imtbl.com"}),orderBook:gt({basePath:"https://order-book-mr.sandbox.imtbl.com"}),passport:gt({basePath:"https://api.sandbox.immutable.com"})});function _t(e,t){return function(){return e.apply(t,arguments)}}const{toString:Et}=Object.prototype,{getPrototypeOf:Tt}=Object,At=(e=>t=>{const r=Et.call(t);return e[r]||(e[r]=r.slice(8,-1).toLowerCase())})(Object.create(null)),St=e=>(e=e.toLowerCase(),t=>At(t)===e),kt=e=>t=>typeof t===e,{isArray:Ot}=Array,Rt=kt("undefined");const xt=St("ArrayBuffer");const It=kt("string"),Ct=kt("function"),Nt=kt("number"),Pt=e=>null!==e&&"object"==typeof e,Mt=e=>{if("object"!==At(e))return!1;const t=Tt(e);return!(null!==t&&t!==Object.prototype&&null!==Object.getPrototypeOf(t)||Symbol.toStringTag in e||Symbol.iterator in e)},Bt=St("Date"),Dt=St("File"),Ft=St("Blob"),Lt=St("FileList"),Ut=St("URLSearchParams");function jt(e,t,{allOwnKeys:r=!1}={}){if(null==e)return;let n,i;if("object"!=typeof e&&(e=[e]),Ot(e))for(n=0,i=e.length;n<i;n++)t.call(null,e[n],n,e);else{const i=r?Object.getOwnPropertyNames(e):Object.keys(e),a=i.length;let o;for(n=0;n<a;n++)o=i[n],t.call(null,e[o],o,e)}}function qt(e,t){t=t.toLowerCase();const r=Object.keys(e);let n,i=r.length;for(;i-- >0;)if(n=r[i],t===n.toLowerCase())return n;return null}const zt="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:global,Ht=e=>!Rt(e)&&e!==zt;const Vt=(e=>t=>e&&t instanceof e)("undefined"!=typeof Uint8Array&&Tt(Uint8Array)),Gt=St("HTMLFormElement"),Wt=(({hasOwnProperty:e})=>(t,r)=>e.call(t,r))(Object.prototype),Kt=St("RegExp"),Xt=(e,t)=>{const r=Object.getOwnPropertyDescriptors(e),n={};jt(r,((r,i)=>{!1!==t(r,i,e)&&(n[i]=r)})),Object.defineProperties(e,n)},$t="abcdefghijklmnopqrstuvwxyz",Jt="0123456789",Yt={DIGIT:Jt,ALPHA:$t,ALPHA_DIGIT:$t+$t.toUpperCase()+Jt};const Qt=St("AsyncFunction");var Zt={isArray:Ot,isArrayBuffer:xt,isBuffer:function(e){return null!==e&&!Rt(e)&&null!==e.constructor&&!Rt(e.constructor)&&Ct(e.constructor.isBuffer)&&e.constructor.isBuffer(e)},isFormData:e=>{let t;return e&&("function"==typeof FormData&&e instanceof FormData||Ct(e.append)&&("formdata"===(t=At(e))||"object"===t&&Ct(e.toString)&&"[object FormData]"===e.toString()))},isArrayBufferView:function(e){let t;return t="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&xt(e.buffer),t},isString:It,isNumber:Nt,isBoolean:e=>!0===e||!1===e,isObject:Pt,isPlainObject:Mt,isUndefined:Rt,isDate:Bt,isFile:Dt,isBlob:Ft,isRegExp:Kt,isFunction:Ct,isStream:e=>Pt(e)&&Ct(e.pipe),isURLSearchParams:Ut,isTypedArray:Vt,isFileList:Lt,forEach:jt,merge:function e(){const{caseless:t}=Ht(this)&&this||{},r={},n=(n,i)=>{const a=t&&qt(r,i)||i;Mt(r[a])&&Mt(n)?r[a]=e(r[a],n):Mt(n)?r[a]=e({},n):Ot(n)?r[a]=n.slice():r[a]=n};for(let e=0,t=arguments.length;e<t;e++)arguments[e]&&jt(arguments[e],n);return r},extend:(e,t,r,{allOwnKeys:n}={})=>(jt(t,((t,n)=>{r&&Ct(t)?e[n]=_t(t,r):e[n]=t}),{allOwnKeys:n}),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,r,n)=>{e.prototype=Object.create(t.prototype,n),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),r&&Object.assign(e.prototype,r)},toFlatObject:(e,t,r,n)=>{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],n&&!n(o,e,t)||s[o]||(t[o]=e[o],s[o]=!0);e=!1!==r&&Tt(e)}while(e&&(!r||r(e,t))&&e!==Object.prototype);return t},kindOf:At,kindOfTest:St,endsWith:(e,t,r)=>{e=String(e),(void 0===r||r>e.length)&&(r=e.length),r-=t.length;const n=e.indexOf(t,r);return-1!==n&&n===r},toArray:e=>{if(!e)return null;if(Ot(e))return e;let t=e.length;if(!Nt(t))return null;const r=new Array(t);for(;t-- >0;)r[t]=e[t];return r},forEachEntry:(e,t)=>{const r=(e&&e[Symbol.iterator]).call(e);let n;for(;(n=r.next())&&!n.done;){const r=n.value;t.call(e,r[0],r[1])}},matchAll:(e,t)=>{let r;const n=[];for(;null!==(r=e.exec(t));)n.push(r);return n},isHTMLForm:Gt,hasOwnProperty:Wt,hasOwnProp:Wt,reduceDescriptors:Xt,freezeMethods:e=>{Xt(e,((t,r)=>{if(Ct(e)&&-1!==["arguments","caller","callee"].indexOf(r))return!1;const n=e[r];Ct(n)&&(t.enumerable=!1,"writable"in t?t.writable=!1:t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+r+"'")}))}))},toObjectSet:(e,t)=>{const r={},n=e=>{e.forEach((e=>{r[e]=!0}))};return Ot(e)?n(e):n(String(e).split(t)),r},toCamelCase:e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,(function(e,t,r){return t.toUpperCase()+r})),noop:()=>{},toFiniteNumber:(e,t)=>(e=+e,Number.isFinite(e)?e:t),findKey:qt,global:zt,isContextDefined:Ht,ALPHABET:Yt,generateString:(e=16,t=Yt.ALPHA_DIGIT)=>{let r="";const{length:n}=t;for(;e--;)r+=t[Math.random()*n|0];return r},isSpecCompliantForm:function(e){return!!(e&&Ct(e.append)&&"FormData"===e[Symbol.toStringTag]&&e[Symbol.iterator])},toJSONObject:e=>{const t=new Array(10),r=(e,n)=>{if(Pt(e)){if(t.indexOf(e)>=0)return;if(!("toJSON"in e)){t[n]=e;const i=Ot(e)?[]:{};return jt(e,((e,t)=>{const a=r(e,n+1);!Rt(a)&&(i[t]=a)})),t[n]=void 0,i}}return e};return r(e,0)},isAsyncFn:Qt,isThenable:e=>e&&(Pt(e)||Ct(e))&&Ct(e.then)&&Ct(e.catch)};function er(e,t,r,n,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),r&&(this.config=r),n&&(this.request=n),i&&(this.response=i)}Zt.inherits(er,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:Zt.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});const tr=er.prototype,rr={};["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=>{rr[e]={value:e}})),Object.defineProperties(er,rr),Object.defineProperty(tr,"isAxiosError",{value:!0}),er.from=(e,t,r,n,i,a)=>{const o=Object.create(tr);return Zt.toFlatObject(e,o,(function(e){return e!==Error.prototype}),(e=>"isAxiosError"!==e)),er.call(o,e.message,t,r,n,i),o.cause=e,o.name=e.name,a&&Object.assign(o,a),o};function nr(e){return Zt.isPlainObject(e)||Zt.isArray(e)}function ir(e){return Zt.endsWith(e,"[]")?e.slice(0,-2):e}function ar(e,t,r){return e?e.concat(t).map((function(e,t){return e=ir(e),!r&&t?"["+e+"]":e})).join(r?".":""):t}const or=Zt.toFlatObject(Zt,{},null,(function(e){return/^is[A-Z]/.test(e)}));function sr(e,t,r){if(!Zt.isObject(e))throw new TypeError("target must be an object");t=t||new FormData;const n=(r=Zt.toFlatObject(r,{metaTokens:!0,dots:!1,indexes:!1},!1,(function(e,t){return!Zt.isUndefined(t[e])}))).metaTokens,i=r.visitor||f,a=r.dots,o=r.indexes,s=(r.Blob||"undefined"!=typeof Blob&&Blob)&&Zt.isSpecCompliantForm(t);if(!Zt.isFunction(i))throw new TypeError("visitor must be a function");function u(e){if(null===e)return"";if(Zt.isDate(e))return e.toISOString();if(!s&&Zt.isBlob(e))throw new er("Blob is not supported. Use a Buffer instead.");return Zt.isArrayBuffer(e)||Zt.isTypedArray(e)?s&&"function"==typeof Blob?new Blob([e]):Buffer.from(e):e}function f(e,r,i){let s=e;if(e&&!i&&"object"==typeof e)if(Zt.endsWith(r,"{}"))r=n?r:r.slice(0,-2),e=JSON.stringify(e);else if(Zt.isArray(e)&&function(e){return Zt.isArray(e)&&!e.some(nr)}(e)||(Zt.isFileList(e)||Zt.endsWith(r,"[]"))&&(s=Zt.toArray(e)))return r=ir(r),s.forEach((function(e,n){!Zt.isUndefined(e)&&null!==e&&t.append(!0===o?ar([r],n,a):null===o?r:r+"[]",u(e))})),!1;return!!nr(e)||(t.append(ar(i,r,a),u(e)),!1)}const c=[],l=Object.assign(or,{defaultVisitor:f,convertValue:u,isVisitable:nr});if(!Zt.isObject(e))throw new TypeError("data must be an object");return function e(r,n){if(!Zt.isUndefined(r)){if(-1!==c.indexOf(r))throw Error("Circular reference detected in "+n.join("."));c.push(r),Zt.forEach(r,(function(r,a){!0===(!(Zt.isUndefined(r)||null===r)&&i.call(t,r,Zt.isString(a)?a.trim():a,n,l))&&e(r,n?n.concat(a):[a])})),c.pop()}}(e),t}function ur(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,(function(e){return t[e]}))}function fr(e,t){this._pairs=[],e&&sr(e,this,t)}const cr=fr.prototype;function lr(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function dr(e,t,r){if(!t)return e;const n=r&&r.encode||lr,i=r&&r.serialize;let a;if(a=i?i(t,r):Zt.isURLSearchParams(t)?t.toString():new fr(t,r).toString(n),a){const t=e.indexOf("#");-1!==t&&(e=e.slice(0,t)),e+=(-1===e.indexOf("?")?"?":"&")+a}return e}cr.append=function(e,t){this._pairs.push([e,t])},cr.toString=function(e){const t=e?function(t){return e.call(this,t,ur)}:ur;return this._pairs.map((function(e){return t(e[0])+"="+t(e[1])}),"").join("&")};var pr=class{constructor(){this.handlers=[]}use(e,t,r){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!r&&r.synchronous,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){Zt.forEach(this.handlers,(function(t){null!==t&&e(t)}))}},hr={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1};var mr={isBrowser:!0,classes:{URLSearchParams:"undefined"!=typeof URLSearchParams?URLSearchParams:fr,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 yr(e){function t(e,r,n,i){let a=e[i++];const o=Number.isFinite(+a),s=i>=e.length;if(a=!a&&Zt.isArray(n)?n.length:a,s)return Zt.hasOwnProp(n,a)?n[a]=[n[a],r]:n[a]=r,!o;n[a]&&Zt.isObject(n[a])||(n[a]=[]);return t(e,r,n[a],i)&&Zt.isArray(n[a])&&(n[a]=function(e){const t={},r=Object.keys(e);let n;const i=r.length;let a;for(n=0;n<i;n++)a=r[n],t[a]=e[a];return t}(n[a])),!o}if(Zt.isFormData(e)&&Zt.isFunction(e.entries)){const r={};return Zt.forEachEntry(e,((e,n)=>{t(function(e){return Zt.matchAll(/\w+|\[(\w*)]/g,e).map((e=>"[]"===e[0]?"":e[1]||e[0]))}(e),n,r,0)})),r}return null}const br={"Content-Type":void 0};const gr={transitional:hr,adapter:["xhr","http"],transformRequest:[function(e,t){const r=t.getContentType()||"",n=r.indexOf("application/json")>-1,i=Zt.isObject(e);i&&Zt.isHTMLForm(e)&&(e=new FormData(e));if(Zt.isFormData(e))return n&&n?JSON.stringify(yr(e)):e;if(Zt.isArrayBuffer(e)||Zt.isBuffer(e)||Zt.isStream(e)||Zt.isFile(e)||Zt.isBlob(e))return e;if(Zt.isArrayBufferView(e))return e.buffer;if(Zt.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let a;if(i){if(r.indexOf("application/x-www-form-urlencoded")>-1)return function(e,t){return sr(e,new mr.classes.URLSearchParams,Object.assign({visitor:function(e,t,r,n){return mr.isNode&&Zt.isBuffer(e)?(this.append(t,e.toString("base64")),!1):n.defaultVisitor.apply(this,arguments)}},t))}(e,this.formSerializer).toString();if((a=Zt.isFileList(e))||r.indexOf("multipart/form-data")>-1){const t=this.env&&this.env.FormData;return sr(a?{"files[]":e}:e,t&&new t,this.formSerializer)}}return i||n?(t.setContentType("application/json",!1),function(e,t,r){if(Zt.isString(e))try{return(t||JSON.parse)(e),Zt.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(r||JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){const t=this.transitional||gr.transitional,r=t&&t.forcedJSONParsing,n="json"===this.responseType;if(e&&Zt.isString(e)&&(r&&!this.responseType||n)){const r=!(t&&t.silentJSONParsing)&&n;try{return JSON.parse(e)}catch(e){if(r){if("SyntaxError"===e.name)throw er.from(e,er.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:mr.classes.FormData,Blob:mr.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};Zt.forEach(["delete","get","head"],(function(e){gr.headers[e]={}})),Zt.forEach(["post","put","patch"],(function(e){gr.headers[e]=Zt.merge(br)}));var vr=gr;const wr=Zt.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 _r=Symbol("internals");function Er(e){return e&&String(e).trim().toLowerCase()}function Tr(e){return!1===e||null==e?e:Zt.isArray(e)?e.map(Tr):String(e)}function Ar(e,t,r,n,i){return Zt.isFunction(n)?n.call(this,t,r):(i&&(t=r),Zt.isString(t)?Zt.isString(n)?-1!==t.indexOf(n):Zt.isRegExp(n)?n.test(t):void 0:void 0)}let Sr=class{constructor(e){e&&this.set(e)}set(e,t,r){const n=this;function i(e,t,r){const i=Er(t);if(!i)throw new Error("header name must be a non-empty string");const a=Zt.findKey(n,i);(!a||void 0===n[a]||!0===r||void 0===r&&!1!==n[a])&&(n[a||t]=Tr(e))}const a=(e,t)=>Zt.forEach(e,((e,r)=>i(e,r,t)));return Zt.isPlainObject(e)||e instanceof this.constructor?a(e,t):Zt.isString(e)&&(e=e.trim())&&!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim())?a((e=>{const t={};let r,n,i;return e&&e.split("\n").forEach((function(e){i=e.indexOf(":"),r=e.substring(0,i).trim().toLowerCase(),n=e.substring(i+1).trim(),!r||t[r]&&wr[r]||("set-cookie"===r?t[r]?t[r].push(n):t[r]=[n]:t[r]=t[r]?t[r]+", "+n:n)})),t})(e),t):null!=e&&i(t,e,r),this}get(e,t){if(e=Er(e)){const r=Zt.findKey(this,e);if(r){const e=this[r];if(!t)return e;if(!0===t)return function(e){const t=Object.create(null),r=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let n;for(;n=r.exec(e);)t[n[1]]=n[2];return t}(e);if(Zt.isFunction(t))return t.call(this,e,r);if(Zt.isRegExp(t))return t.exec(e);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=Er(e)){const r=Zt.findKey(this,e);return!(!r||void 0===this[r]||t&&!Ar(0,this[r],r,t))}return!1}delete(e,t){const r=this;let n=!1;function i(e){if(e=Er(e)){const i=Zt.findKey(r,e);!i||t&&!Ar(0,r[i],i,t)||(delete r[i],n=!0)}}return Zt.isArray(e)?e.forEach(i):i(e),n}clear(e){const t=Object.keys(this);let r=t.length,n=!1;for(;r--;){const i=t[r];e&&!Ar(0,this[i],i,e,!0)||(delete this[i],n=!0)}return n}normalize(e){const t=this,r={};return Zt.forEach(this,((n,i)=>{const a=Zt.findKey(r,i);if(a)return t[a]=Tr(n),void delete t[i];const o=e?function(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,((e,t,r)=>t.toUpperCase()+r))}(i):String(i).trim();o!==i&&delete t[i],t[o]=Tr(n),r[o]=!0})),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const t=Object.create(null);return Zt.forEach(this,((r,n)=>{null!=r&&!1!==r&&(t[n]=e&&Zt.isArray(r)?r.join(", "):r)})),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 r=new this(e);return t.forEach((e=>r.set(e))),r}static accessor(e){const t=(this[_r]=this[_r]={accessors:{}}).accessors,r=this.prototype;function n(e){const n=Er(e);t[n]||(!function(e,t){const r=Zt.toCamelCase(" "+t);["get","set","has"].forEach((n=>{Object.defineProperty(e,n+r,{value:function(e,r,i){return this[n].call(this,t,e,r,i)},configurable:!0})}))}(r,e),t[n]=!0)}return Zt.isArray(e)?e.forEach(n):n(e),this}};Sr.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),Zt.freezeMethods(Sr.prototype),Zt.freezeMethods(Sr);var kr=Sr;function Or(e,t){const r=this||vr,n=t||r,i=kr.from(n.headers);let a=n.data;return Zt.forEach(e,(function(e){a=e.call(r,a,i.normalize(),t?t.status:void 0)})),i.normalize(),a}function Rr(e){return!(!e||!e.__CANCEL__)}function xr(e,t,r){er.call(this,null==e?"canceled":e,er.ERR_CANCELED,t,r),this.name="CanceledError"}Zt.inherits(xr,er,{__CANCEL__:!0});var Ir=mr.isStandardBrowserEnv?{write:function(e,t,r,n,i,a){const o=[];o.push(e+"="+encodeURIComponent(t)),Zt.isNumber(r)&&o.push("expires="+new Date(r).toGMTString()),Zt.isString(n)&&o.push("path="+n),Zt.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 Cr(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 Nr=mr.isStandardBrowserEnv?function(){const e=/(msie|trident)/i.test(navigator.userAgent),t=document.createElement("a");let r;function n(r){let n=r;return e&&(t.setAttribute("href",n),n=t.href),t.setAttribute("href",n),{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 r=n(window.location.href),function(e){const t=Zt.isString(e)?n(e):e;return t.protocol===r.protocol&&t.host===r.host}}():function(){return!0};function Pr(e,t){let r=0;const n=function(e,t){e=e||10;const r=new Array(e),n=new Array(e);let i,a=0,o=0;return t=void 0!==t?t:1e3,function(s){const u=Date.now(),f=n[o];i||(i=u),r[a]=s,n[a]=u;let c=o,l=0;for(;c!==a;)l+=r[c++],c%=e;if(a=(a+1)%e,a===o&&(o=(o+1)%e),u-i<t)return;const d=f&&u-f;return d?Math.round(1e3*l/d):void 0}}(50,250);return i=>{const a=i.loaded,o=i.lengthComputable?i.total:void 0,s=a-r,u=n(s);r=a;const f={loaded:a,total:o,progress:o?a/o:void 0,bytes:s,rate:u||void 0,estimated:u&&o&&a<=o?(o-a)/u:void 0,event:i};f[t?"download":"upload"]=!0,e(f)}}var Mr="undefined"!=typeof XMLHttpRequest&&function(e){return new Promise((function(t,r){let n=e.data;const i=kr.from(e.headers).normalize(),a=e.responseType;let o;function s(){e.cancelToken&&e.cancelToken.unsubscribe(o),e.signal&&e.signal.removeEventListener("abort",o)}Zt.isFormData(n)&&(mr.isStandardBrowserEnv||mr.isStandardBrowserWebWorkerEnv?i.setContentType(!1):i.setContentType("multipart/form-data;",!1));let u=new XMLHttpRequest;if(e.auth){const t=e.auth.username||"",r=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";i.set("Authorization","Basic "+btoa(t+":"+r))}const f=Cr(e.baseURL,e.url);function c(){if(!u)return;const n=kr.from("getAllResponseHeaders"in u&&u.getAllResponseHeaders());!function(e,t,r){const n=r.config.validateStatus;r.status&&n&&!n(r.status)?t(new er("Request failed with status code "+r.status,[er.ERR_BAD_REQUEST,er.ERR_BAD_RESPONSE][Math.floor(r.status/100)-4],r.config,r.request,r)):e(r)}((function(e){t(e),s()}),(function(e){r(e),s()}),{data:a&&"text"!==a&&"json"!==a?u.response:u.responseText,status:u.status,statusText:u.statusText,headers:n,config:e,request:u}),u=null}if(u.open(e.method.toUpperCase(),dr(f,e.params,e.paramsSerializer),!0),u.timeout=e.timeout,"onloadend"in u?u.onloadend=c:u.onreadystatechange=function(){u&&4===u.readyState&&(0!==u.status||u.responseURL&&0===u.responseURL.indexOf("file:"))&&setTimeout(c)},u.onabort=function(){u&&(r(new er("Request aborted",er.ECONNABORTED,e,u)),u=null)},u.onerror=function(){r(new er("Network Error",er.ERR_NETWORK,e,u)),u=null},u.ontimeout=function(){let t=e.timeout?"timeout of "+e.timeout+"ms exceeded":"timeout exceeded";const n=e.transitional||hr;e.timeoutErrorMessage&&(t=e.timeoutErrorMessage),r(new er(t,n.clarifyTimeoutError?er.ETIMEDOUT:er.ECONNABORTED,e,u)),u=null},mr.isStandardBrowserEnv){const t=(e.withCredentials||Nr(f))&&e.xsrfCookieName&&Ir.read(e.xsrfCookieName);t&&i.set(e.xsrfHeaderName,t)}void 0===n&&i.setContentType(null),"setRequestHeader"in u&&Zt.forEach(i.toJSON(),(function(e,t){u.setRequestHeader(t,e)})),Zt.isUndefined(e.withCredentials)||(u.withCredentials=!!e.withCredentials),a&&"json"!==a&&(u.responseType=e.responseType),"function"==typeof e.onDownloadProgress&&u.addEventListener("progress",Pr(e.onDownloadProgress,!0)),"function"==typeof e.onUploadProgress&&u.upload&&u.upload.addEventListener("progress",Pr(e.onUploadProgress)),(e.cancelToken||e.signal)&&(o=t=>{u&&(r(!t||t.type?new xr(null,e,u):t),u.abort(),u=null)},e.cancelToken&&e.cancelToken.subscribe(o),e.signal&&(e.signal.aborted?o():e.signal.addEventListener("abort",o)));const l=function(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}(f);l&&-1===mr.protocols.indexOf(l)?r(new er("Unsupported protocol "+l+":",er.ERR_BAD_REQUEST,e)):u.send(n||null)}))};const Br={http:null,xhr:Mr};Zt.forEach(Br,((e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch(e){}Object.defineProperty(e,"adapterName",{value:t})}}));var Dr=e=>{e=Zt.isArray(e)?e:[e];const{length:t}=e;let r,n;for(let i=0;i<t&&(r=e[i],!(n=Zt.isString(r)?Br[r.toLowerCase()]:r));i++);if(!n){if(!1===n)throw new er(`Adapter ${r} is not supported by the environment`,"ERR_NOT_SUPPORT");throw new Error(Zt.hasOwnProp(Br,r)?`Adapter '${r}' is not available in the build`:`Unknown adapter '${r}'`)}if(!Zt.isFunction(n))throw new TypeError("adapter is not a function");return n};function Fr(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new xr(null,e)}function Lr(e){Fr(e),e.headers=kr.from(e.headers),e.data=Or.call(e,e.transformRequest),-1!==["post","put","patch"].indexOf(e.method)&&e.headers.setContentType("application/x-www-form-urlencoded",!1);return Dr(e.adapter||vr.adapter)(e).then((function(t){return Fr(e),t.data=Or.call(e,e.transformResponse,t),t.headers=kr.from(t.headers),t}),(function(t){return Rr(t)||(Fr(e),t&&t.response&&(t.response.data=Or.call(e,e.transformResponse,t.response),t.response.headers=kr.from(t.response.headers))),Promise.reject(t)}))}const Ur=e=>e instanceof kr?e.toJSON():e;function jr(e,t){t=t||{};const r={};function n(e,t,r){return Zt.isPlainObject(e)&&Zt.isPlainObject(t)?Zt.merge.call({caseless:r},e,t):Zt.isPlainObject(t)?Zt.merge({},t):Zt.isArray(t)?t.slice():t}function i(e,t,r){return Zt.isUndefined(t)?Zt.isUndefined(e)?void 0:n(void 0,e,r):n(e,t,r)}function a(e,t){if(!Zt.isUndefined(t))return n(void 0,t)}function o(e,t){return Zt.isUndefined(t)?Zt.isUndefined(e)?void 0:n(void 0,e):n(void 0,t)}function s(r,i,a){return a in t?n(r,i):a in e?n(void 0,r):void 0}const u={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(Ur(e),Ur(t),!0)};return Zt.forEach(Object.keys(Object.assign({},e,t)),(function(n){const a=u[n]||i,o=a(e[n],t[n],n);Zt.isUndefined(o)&&a!==s||(r[n]=o)})),r}const qr="1.4.0",zr={};["object","boolean","number","function","string","symbol"].forEach(((e,t)=>{zr[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}}));const Hr={};zr.transitional=function(e,t,r){function n(e,t){return"[Axios v1.4.0] Transitional option '"+e+"'"+t+(r?". "+r:"")}return(r,i,a)=>{if(!1===e)throw new er(n(i," has been removed"+(t?" in "+t:"")),er.ERR_DEPRECATED);return t&&!Hr[i]&&(Hr[i]=!0,console.warn(n(i," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(r,i,a)}};var Vr={assertOptions:function(e,t,r){if("object"!=typeof e)throw new er("options must be an object",er.ERR_BAD_OPTION_VALUE);const n=Object.keys(e);let i=n.length;for(;i-- >0;){const a=n[i],o=t[a];if(o){const t=e[a],r=void 0===t||o(t,a,e);if(!0!==r)throw new er("option "+a+" must be "+r,er.ERR_BAD_OPTION_VALUE)}else if(!0!==r)throw new er("Unknown option "+a,er.ERR_BAD_OPTION)}},validators:zr};const Gr=Vr.validators;let Wr=class{constructor(e){this.defaults=e,this.interceptors={request:new pr,response:new pr}}request(e,t){"string"==typeof e?(t=t||{}).url=e:t=e||{},t=jr(this.defaults,t);const{transitional:r,paramsSerializer:n,headers:i}=t;let a;void 0!==r&&Vr.assertOptions(r,{silentJSONParsing:Gr.transitional(Gr.boolean),forcedJSONParsing:Gr.transitional(Gr.boolean),clarifyTimeoutError:Gr.transitional(Gr.boolean)},!1),null!=n&&(Zt.isFunction(n)?t.paramsSerializer={serialize:n}:Vr.assertOptions(n,{encode:Gr.function,serialize:Gr.function},!0)),t.method=(t.method||this.defaults.method||"get").toLowerCase(),a=i&&Zt.merge(i.common,i[t.method]),a&&Zt.forEach(["delete","get","head","post","put","patch","common"],(e=>{delete i[e]})),t.headers=kr.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 u=[];let f;this.interceptors.response.forEach((function(e){u.push(e.fulfilled,e.rejected)}));let c,l=0;if(!s){const e=[Lr.bind(this),void 0];for(e.unshift.apply(e,o),e.push.apply(e,u),c=e.length,f=Promise.resolve(t);l<c;)f=f.then(e[l++],e[l++]);return f}c=o.length;let d=t;for(l=0;l<c;){const e=o[l++],t=o[l++];try{d=e(d)}catch(e){t.call(this,e);break}}try{f=Lr.call(this,d)}catch(e){return Promise.reject(e)}for(l=0,c=u.length;l<c;)f=f.then(u[l++],u[l++]);return f}getUri(e){return dr(Cr((e=jr(this.defaults,e)).baseURL,e.url),e.params,e.paramsSerializer)}};Zt.forEach(["delete","get","head","options"],(function(e){Wr.prototype[e]=function(t,r){return this.request(jr(r||{},{method:e,url:t,data:(r||{}).data}))}})),Zt.forEach(["post","put","patch"],(function(e){function t(t){return function(r,n,i){return this.request(jr(i||{},{method:e,headers:t?{"Content-Type":"multipart/form-data"}:{},url:r,data:n}))}}Wr.prototype[e]=t(),Wr.prototype[e+"Form"]=t(!0)}));var Kr=Wr;var Xr=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 r=this;this.promise.then((e=>{if(!r._listeners)return;let t=r._listeners.length;for(;t-- >0;)r._listeners[t](e);r._listeners=null})),this.promise.then=e=>{let t;const n=new Promise((e=>{r.subscribe(e),t=e})).then(e);return n.cancel=function(){r.unsubscribe(t)},n},e((function(e,n,i){r.reason||(r.reason=new xr(e,n,i),t(r.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 r=new e((function(e){t=e}));return{token:r,cancel:t}}};const $r={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($r).forEach((([e,t])=>{$r[t]=e}));var Jr=$r;const Yr=function e(t){const r=new Kr(t),n=_t(Kr.prototype.request,r);return Zt.extend(n,Kr.prototype,r,{allOwnKeys:!0}),Zt.extend(n,r,null,{allOwnKeys:!0}),n.create=function(r){return e(jr(t,r))},n}(vr);Yr.Axios=Kr,Yr.CanceledError=xr,Yr.CancelToken=Xr,Yr.isCancel=Rr,Yr.VERSION=qr,Yr.toFormData=sr,Yr.AxiosError=er,Yr.Cancel=Yr.CanceledError,Yr.all=function(e){return Promise.all(e)},Yr.spread=function(e){return function(t){return e.apply(null,t)}},Yr.isAxiosError=function(e){return Zt.isObject(e)&&!0===e.isAxiosError},Yr.mergeConfig=jr,Yr.AxiosHeaders=kr,Yr.formToJSON=e=>yr(Zt.isHTMLForm(e)?new FormData(e):e),Yr.HttpStatusCode=Jr,Yr.default=Yr;var Qr=Yr;class Zr extends Error{code;details;link;traceId;constructor({message:e,code:t,details:r,link:n,trace_id:i}){super(e),this.code=t,this.details=r,this.link=n,this.traceId=i}}const en={sdkVersion:"ts-immutable-sdk-multi-rollup-api-client-0.3.1-alpha"},tn=({basePath:e,headers:t})=>{if(!e.trim())throw Error("basePath can not be empty");const r={basePath:e,baseOptions:{headers:{...t||{},...en}}};return new mt.Configuration(r)},rn=()=>tn({basePath:"https://indexer-mr.sandbox.imtbl.com"});class nn{apiConfig;baseConfig;constructor({baseConfig:t,overrides:r}){if(this.baseConfig=t,r)this.apiConfig=tn(r);else switch(t.environment){case e.Environment.SANDBOX:this.apiConfig=rn();break;case e.Environment.PRODUCTION:this.apiConfig=tn({basePath:"https://indexer-mr.imtbl.com"});break;default:this.apiConfig=rn()}}}function an(e){if(Qr.isAxiosError(e)&&e.response){const t=e.response.data;return t.code&&t.message?new Zr({code:t.code,message:t.message,details:t.details||null,link:t.link||"",trace_id:t.trace_id||""}):new Zr({code:e.code??e.response?.status.toString()??"unknown_error_code",message:String(e),details:null,link:"",trace_id:""})}return new Zr({code:"unknown_error_code",message:String(e),details:null,link:"",trace_id:""})}var on="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function sn(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function un(e){if(e.__esModule)return e;var t=e.default;if("function"==typeof t){var r=function e(){if(this instanceof e){var r=[null];return r.push.apply(r,arguments),new(Function.bind.apply(t,r))}return t.apply(this,arguments)};r.prototype=t.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(e).forEach((function(t){var n=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(r,t,n.get?n:{enumerable:!0,get:function(){return e[t]}})})),r}var fn={exports:{}},cn="undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},ln=[],dn=[],pn="undefined"!=typeof Uint8Array?Uint8Array:Array,hn=!1;function mn(){hn=!0;for(var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",t=0;t<64;++t)ln[t]=e[t],dn[e.charCodeAt(t)]=t;dn["-".charCodeAt(0)]=62,dn["_".charCodeAt(0)]=63}function yn(e,t,r){for(var n,i,a=[],o=t;o<r;o+=3)n=(e[o]<<16)+(e[o+1]<<8)+e[o+2],a.push(ln[(i=n)>>18&63]+ln[i>>12&63]+ln[i>>6&63]+ln[63&i]);return a.join("")}function bn(e){var t;hn||mn();for(var r=e.length,n=r%3,i="",a=[],o=16383,s=0,u=r-n;s<u;s+=o)a.push(yn(e,s,s+o>u?u:s+o));return 1===n?(t=e[r-1],i+=ln[t>>2],i+=ln[t<<4&63],i+="=="):2===n&&(t=(e[r-2]<<8)+e[r-1],i+=ln[t>>10],i+=ln[t>>4&63],i+=ln[t<<2&63],i+="="),a.push(i),a.join("")}function gn(e,t,r,n,i){var a,o,s=8*i-n-1,u=(1<<s)-1,f=u>>1,c=-7,l=r?i-1:0,d=r?-1:1,p=e[t+l];for(l+=d,a=p&(1<<-c)-1,p>>=-c,c+=s;c>0;a=256*a+e[t+l],l+=d,c-=8);for(o=a&(1<<-c)-1,a>>=-c,c+=n;c>0;o=256*o+e[t+l],l+=d,c-=8);if(0===a)a=1-f;else{if(a===u)return o?NaN:1/0*(p?-1:1);o+=Math.pow(2,n),a-=f}return(p?-1:1)*o*Math.pow(2,a-n)}function vn(e,t,r,n,i,a){var o,s,u,f=8*a-i-1,c=(1<<f)-1,l=c>>1,d=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,p=n?0:a-1,h=n?1:-1,m=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=c):(o=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-o))<1&&(o--,u*=2),(t+=o+l>=1?d/u:d*Math.pow(2,1-l))*u>=2&&(o++,u/=2),o+l>=c?(s=0,o=c):o+l>=1?(s=(t*u-1)*Math.pow(2,i),o+=l):(s=t*Math.pow(2,l-1)*Math.pow(2,i),o=0));i>=8;e[r+p]=255&s,p+=h,s/=256,i-=8);for(o=o<<i|s,f+=i;f>0;e[r+p]=255&o,p+=h,o/=256,f-=8);e[r+p-h]|=128*m}var wn={}.toString,_n=Array.isArray||function(e){return"[object Array]"==wn.call(e)};Sn.TYPED_ARRAY_SUPPORT=void 0===cn.TYPED_ARRAY_SUPPORT||cn.TYPED_ARRAY_SUPPORT;var En=Tn();function Tn(){return Sn.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function An(e,t){if(Tn()<t)throw new RangeError("Invalid typed array length");return Sn.TYPED_ARRAY_SUPPORT?(e=new Uint8Array(t)).__proto__=Sn.prototype:(null===e&&(e=new Sn(t)),e.length=t),e}function Sn(e,t,r){if(!(Sn.TYPED_ARRAY_SUPPORT||this instanceof Sn))return new Sn(e,t,r);if("number"==typeof e){if("string"==typeof t)throw new Error("If encoding is specified then the first argument must be a string");return Rn(this,e)}return kn(this,e,t,r)}function kn(e,t,r,n){if("number"==typeof t)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&t instanceof ArrayBuffer?function(e,t,r,n){if(t.byteLength,r<0||t.byteLength<r)throw new RangeError("'offset' is out of bounds");if(t.byteLength<r+(n||0))throw new RangeError("'length' is out of bounds");t=void 0===r&&void 0===n?new Uint8Array(t):void 0===n?new Uint8Array(t,r):new Uint8Array(t,r,n);Sn.TYPED_ARRAY_SUPPORT?(e=t).__proto__=Sn.prototype:e=xn(e,t);return e}(e,t,r,n):"string"==typeof t?function(e,t,r){"string"==typeof r&&""!==r||(r="utf8");if(!Sn.isEncoding(r))throw new TypeError('"encoding" must be a valid string encoding');var n=0|Nn(t,r);e=An(e,n);var i=e.write(t,r);i!==n&&(e=e.slice(0,i));return e}(e,t,r):function(e,t){if(Cn(t)){var r=0|In(t.length);return 0===(e=An(e,r)).length||t.copy(e,0,0,r),e}if(t){if("undefined"!=typeof ArrayBuffer&&t.buffer instanceof ArrayBuffer||"length"in t)return"number"!=typeof t.length||(n=t.length)!=n?An(e,0):xn(e,t);if("Buffer"===t.type&&_n(t.data))return xn(e,t.data)}var n;throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(e,t)}function On(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 Rn(e,t){if(On(t),e=An(e,t<0?0:0|In(t)),!Sn.TYPED_ARRAY_SUPPORT)for(var r=0;r<t;++r)e[r]=0;return e}function xn(e,t){var r=t.length<0?0:0|In(t.length);e=An(e,r);for(var n=0;n<r;n+=1)e[n]=255&t[n];return e}function In(e){if(e>=Tn())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+Tn().toString(16)+" bytes");return 0|e}function Cn(e){return!(null==e||!e._isBuffer)}function Nn(e,t){if(Cn(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 r=e.length;if(0===r)return 0;for(var n=!1;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return ai(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return oi(e).length;default:if(n)return ai(e).length;t=(""+t).toLowerCase(),n=!0}}function Pn(e,t,r){var n=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return Xn(this,t,r);case"utf8":case"utf-8":return Vn(this,t,r);case"ascii":return Wn(this,t,r);case"latin1":case"binary":return Kn(this,t,r);case"base64":return Hn(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return $n(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}function Mn(e,t,r){var n=e[t];e[t]=e[r],e[r]=n}function Bn(e,t,r,n,i){if(0===e.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,isNaN(r)&&(r=i?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(i)return-1;r=e.length-1}else if(r<0){if(!i)return-1;r=0}if("string"==typeof t&&(t=Sn.from(t,n)),Cn(t))return 0===t.length?-1:Dn(e,t,r,n,i);if("number"==typeof t)return t&=255,Sn.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):Dn(e,[t],r,n,i);throw new TypeError("val must be string, number or Buffer")}function Dn(e,t,r,n,i){var a,o=1,s=e.length,u=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return-1;o=2,s/=2,u/=2,r/=2}function f(e,t){return 1===o?e[t]:e.readUInt16BE(t*o)}if(i){var c=-1;for(a=r;a<s;a++)if(f(e,a)===f(t,-1===c?0:a-c)){if(-1===c&&(c=a),a-c+1===u)return c*o}else-1!==c&&(a-=a-c),c=-1}else for(r+u>s&&(r=s-u),a=r;a>=0;a--){for(var l=!0,d=0;d<u;d++)if(f(e,a+d)!==f(t,d)){l=!1;break}if(l)return a}return-1}function Fn(e,t,r,n){r=Number(r)||0;var i=e.length-r;n?(n=Number(n))>i&&(n=i):n=i;var a=t.length;if(a%2!=0)throw new TypeError("Invalid hex string");n>a/2&&(n=a/2);for(var o=0;o<n;++o){var s=parseInt(t.substr(2*o,2),16);if(isNaN(s))return o;e[r+o]=s}return o}function Ln(e,t,r,n){return si(ai(t,e.length-r),e,r,n)}function Un(e,t,r,n){return si(function(e){for(var t=[],r=0;r<e.length;++r)t.push(255&e.charCodeAt(r));return t}(t),e,r,n)}function jn(e,t,r,n){return Un(e,t,r,n)}function qn(e,t,r,n){return si(oi(t),e,r,n)}function zn(e,t,r,n){return si(function(e,t){for(var r,n,i,a=[],o=0;o<e.length&&!((t-=2)<0);++o)n=(r=e.charCodeAt(o))>>8,i=r%256,a.push(i),a.push(n);return a}(t,e.length-r),e,r,n)}function Hn(e,t,r){return 0===t&&r===e.length?bn(e):bn(e.slice(t,r))}function Vn(e,t,r){r=Math.min(e.length,r);for(var n=[],i=t;i<r;){var a,o,s,u,f=e[i],c=null,l=f>239?4:f>223?3:f>191?2:1;if(i+l<=r)switch(l){case 1:f<128&&(c=f);break;case 2:128==(192&(a=e[i+1]))&&(u=(31&f)<<6|63&a)>127&&(c=u);break;case 3:a=e[i+1],o=e[i+2],128==(192&a)&&128==(192&o)&&(u=(15&f)<<12|(63&a)<<6|63&o)>2047&&(u<55296||u>57343)&&(c=u);break;case 4:a=e[i+1],o=e[i+2],s=e[i+3],128==(192&a)&&128==(192&o)&&128==(192&s)&&(u=(15&f)<<18|(63&a)<<12|(63&o)<<6|63&s)>65535&&u<1114112&&(c=u)}null===c?(c=65533,l=1):c>65535&&(c-=65536,n.push(c>>>10&1023|55296),c=56320|1023&c),n.push(c),i+=l}return function(e){var t=e.length;if(t<=Gn)return String.fromCharCode.apply(String,e);var r="",n=0;for(;n<t;)r+=String.fromCharCode.apply(String,e.slice(n,n+=Gn));return r}(n)}Sn.poolSize=8192,Sn._augment=function(e){return e.__proto__=Sn.prototype,e},Sn.from=function(e,t,r){return kn(null,e,t,r)},Sn.TYPED_ARRAY_SUPPORT&&(Sn.prototype.__proto__=Uint8Array.prototype,Sn.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&Sn[Symbol.species]),Sn.alloc=function(e,t,r){return function(e,t,r,n){return On(t),t<=0?An(e,t):void 0!==r?"string"==typeof n?An(e,t).fill(r,n):An(e,t).fill(r):An(e,t)}(null,e,t,r)},Sn.allocUnsafe=function(e){return Rn(null,e)},Sn.allocUnsafeSlow=function(e){return Rn(null,e)},Sn.isBuffer=ui,Sn.compare=function(e,t){if(!Cn(e)||!Cn(t))throw new TypeError("Arguments must be Buffers");if(e===t)return 0;for(var r=e.length,n=t.length,i=0,a=Math.min(r,n);i<a;++i)if(e[i]!==t[i]){r=e[i],n=t[i];break}return r<n?-1:n<r?1:0},Sn.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}},Sn.concat=function(e,t){if(!_n(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return Sn.alloc(0);var r;if(void 0===t)for(t=0,r=0;r<e.length;++r)t+=e[r].length;var n=Sn.allocUnsafe(t),i=0;for(r=0;r<e.length;++r){var a=e[r];if(!Cn(a))throw new TypeError('"list" argument must be an Array of Buffers');a.copy(n,i),i+=a.length}return n},Sn.byteLength=Nn,Sn.prototype._isBuffer=!0,Sn.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)Mn(this,t,t+1);return this},Sn.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)Mn(this,t,t+3),Mn(this,t+1,t+2);return this},Sn.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)Mn(this,t,t+7),Mn(this,t+1,t+6),Mn(this,t+2,t+5),Mn(this,t+3,t+4);return this},Sn.prototype.toString=function(){var e=0|this.length;return 0===e?"":0===arguments.length?Vn(this,0,e):Pn.apply(this,arguments)},Sn.prototype.equals=function(e){if(!Cn(e))throw new TypeError("Argument must be a Buffer");return this===e||0===Sn.compare(this,e)},Sn.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+">"},Sn.prototype.compare=function(e,t,r,n,i){if(!Cn(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),t<0||r>e.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&t>=r)return 0;if(n>=i)return-1;if(t>=r)return 1;if(this===e)return 0;for(var a=(i>>>=0)-(n>>>=0),o=(r>>>=0)-(t>>>=0),s=Math.min(a,o),u=this.slice(n,i),f=e.slice(t,r),c=0;c<s;++c)if(u[c]!==f[c]){a=u[c],o=f[c];break}return a<o?-1:o<a?1:0},Sn.prototype.includes=function(e,t,r){return-1!==this.indexOf(e,t,r)},Sn.prototype.indexOf=function(e,t,r){return Bn(this,e,t,r,!0)},Sn.prototype.lastIndexOf=function(e,t,r){return Bn(this,e,t,r,!1)},Sn.prototype.write=function(e,t,r,n){if(void 0===t)n="utf8",r=this.length,t=0;else if(void 0===r&&"string"==typeof t)n=t,r=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t|=0,isFinite(r)?(r|=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}var i=this.length-t;if((void 0===r||r>i)&&(r=i),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var a=!1;;)switch(n){case"hex":return Fn(this,e,t,r);case"utf8":case"utf-8":return Ln(this,e,t,r);case"ascii":return Un(this,e,t,r);case"latin1":case"binary":return jn(this,e,t,r);case"base64":return qn(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return zn(this,e,t,r);default:if(a)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),a=!0}},Sn.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var Gn=4096;function Wn(e,t,r){var n="";r=Math.min(e.length,r);for(var i=t;i<r;++i)n+=String.fromCharCode(127&e[i]);return n}function Kn(e,t,r){var n="";r=Math.min(e.length,r);for(var i=t;i<r;++i)n+=String.fromCharCode(e[i]);return n}function Xn(e,t,r){var n=e.length;(!t||t<0)&&(t=0),(!r||r<0||r>n)&&(r=n);for(var i="",a=t;a<r;++a)i+=ii(e[a]);return i}function $n(e,t,r){for(var n=e.slice(t,r),i="",a=0;a<n.length;a+=2)i+=String.fromCharCode(n[a]+256*n[a+1]);return i}function Jn(e,t,r){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(e+t>r)throw new RangeError("Trying to access beyond buffer length")}function Yn(e,t,r,n,i,a){if(!Cn(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(r+n>e.length)throw new RangeError("Index out of range")}function Qn(e,t,r,n){t<0&&(t=65535+t+1);for(var i=0,a=Math.min(e.length-r,2);i<a;++i)e[r+i]=(t&255<<8*(n?i:1-i))>>>8*(n?i:1-i)}function Zn(e,t,r,n){t<0&&(t=4294967295+t+1);for(var i=0,a=Math.min(e.length-r,4);i<a;++i)e[r+i]=t>>>8*(n?i:3-i)&255}function ei(e,t,r,n,i,a){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function ti(e,t,r,n,i){return i||ei(e,0,r,4),vn(e,t,r,n,23,4),r+4}function ri(e,t,r,n,i){return i||ei(e,0,r,8),vn(e,t,r,n,52,8),r+8}Sn.prototype.slice=function(e,t){var r,n=this.length;if((e=~~e)<0?(e+=n)<0&&(e=0):e>n&&(e=n),(t=void 0===t?n:~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),t<e&&(t=e),Sn.TYPED_ARRAY_SUPPORT)(r=this.subarray(e,t)).__proto__=Sn.prototype;else{var i=t-e;r=new Sn(i,void 0);for(var a=0;a<i;++a)r[a]=this[a+e]}return r},Sn.prototype.readUIntLE=function(e,t,r){e|=0,t|=0,r||Jn(e,t,this.length);for(var n=this[e],i=1,a=0;++a<t&&(i*=256);)n+=this[e+a]*i;return n},Sn.prototype.readUIntBE=function(e,t,r){e|=0,t|=0,r||Jn(e,t,this.length);for(var n=this[e+--t],i=1;t>0&&(i*=256);)n+=this[e+--t]*i;return n},Sn.prototype.readUInt8=function(e,t){return t||Jn(e,1,this.length),this[e]},Sn.prototype.readUInt16LE=function(e,t){return t||Jn(e,2,this.length),this[e]|this[e+1]<<8},Sn.prototype.readUInt16BE=function(e,t){return t||Jn(e,2,this.length),this[e]<<8|this[e+1]},Sn.prototype.readUInt32LE=function(e,t){return t||Jn(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},Sn.prototype.readUInt32BE=function(e,t){return t||Jn(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},Sn.prototype.readIntLE=function(e,t,r){e|=0,t|=0,r||Jn(e,t,this.length);for(var n=this[e],i=1,a=0;++a<t&&(i*=256);)n+=this[e+a]*i;return n>=(i*=128)&&(n-=Math.pow(2,8*t)),n},Sn.prototype.readIntBE=function(e,t,r){e|=0,t|=0,r||Jn(e,t,this.length);for(var n=t,i=1,a=this[e+--n];n>0&&(i*=256);)a+=this[e+--n]*i;return a>=(i*=128)&&(a-=Math.pow(2,8*t)),a},Sn.prototype.readInt8=function(e,t){return t||Jn(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},Sn.prototype.readInt16LE=function(e,t){t||Jn(e,2,this.length);var r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},Sn.prototype.readInt16BE=function(e,t){t||Jn(e,2,this.length);var r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},Sn.prototype.readInt32LE=function(e,t){return t||Jn(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},Sn.prototype.readInt32BE=function(e,t){return t||Jn(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},Sn.prototype.readFloatLE=function(e,t){return t||Jn(e,4,this.length),gn(this,e,!0,23,4)},Sn.prototype.readFloatBE=function(e,t){return t||Jn(e,4,this.length),gn(this,e,!1,23,4)},Sn.prototype.readDoubleLE=function(e,t){return t||Jn(e,8,this.length),gn(this,e,!0,52,8)},Sn.prototype.readDoubleBE=function(e,t){return t||Jn(e,8,this.length),gn(this,e,!1,52,8)},Sn.prototype.writeUIntLE=function(e,t,r,n){(e=+e,t|=0,r|=0,n)||Yn(this,e,t,r,Math.pow(2,8*r)-1,0);var i=1,a=0;for(this[t]=255&e;++a<r&&(i*=256);)this[t+a]=e/i&255;return t+r},Sn.prototype.writeUIntBE=function(e,t,r,n){(e=+e,t|=0,r|=0,n)||Yn(this,e,t,r,Math.pow(2,8*r)-1,0);var i=r-1,a=1;for(this[t+i]=255&e;--i>=0&&(a*=256);)this[t+i]=e/a&255;return t+r},Sn.prototype.writeUInt8=function(e,t,r){return e=+e,t|=0,r||Yn(this,e,t,1,255,0),Sn.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},Sn.prototype.writeUInt16LE=function(e,t,r){return e=+e,t|=0,r||Yn(this,e,t,2,65535,0),Sn.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):Qn(this,e,t,!0),t+2},Sn.prototype.writeUInt16BE=function(e,t,r){return e=+e,t|=0,r||Yn(this,e,t,2,65535,0),Sn.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):Qn(this,e,t,!1),t+2},Sn.prototype.writeUInt32LE=function(e,t,r){return e=+e,t|=0,r||Yn(this,e,t,4,4294967295,0),Sn.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):Zn(this,e,t,!0),t+4},Sn.prototype.writeUInt32BE=function(e,t,r){return e=+e,t|=0,r||Yn(this,e,t,4,4294967295,0),Sn.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):Zn(this,e,t,!1),t+4},Sn.prototype.writeIntLE=function(e,t,r,n){if(e=+e,t|=0,!n){var i=Math.pow(2,8*r-1);Yn(this,e,t,r,i-1,-i)}var a=0,o=1,s=0;for(this[t]=255&e;++a<r&&(o*=256);)e<0&&0===s&&0!==this[t+a-1]&&(s=1),this[t+a]=(e/o>>0)-s&255;return t+r},Sn.prototype.writeIntBE=function(e,t,r,n){if(e=+e,t|=0,!n){var i=Math.pow(2,8*r-1);Yn(this,e,t,r,i-1,-i)}var a=r-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+r},Sn.prototype.writeInt8=function(e,t,r){return e=+e,t|=0,r||Yn(this,e,t,1,127,-128),Sn.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},Sn.prototype.writeInt16LE=function(e,t,r){return e=+e,t|=0,r||Yn(this,e,t,2,32767,-32768),Sn.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):Qn(this,e,t,!0),t+2},Sn.prototype.writeInt16BE=function(e,t,r){return e=+e,t|=0,r||Yn(this,e,t,2,32767,-32768),Sn.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):Qn(this,e,t,!1),t+2},Sn.prototype.writeInt32LE=function(e,t,r){return e=+e,t|=0,r||Yn(this,e,t,4,2147483647,-2147483648),Sn.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):Zn(this,e,t,!0),t+4},Sn.prototype.writeInt32BE=function(e,t,r){return e=+e,t|=0,r||Yn(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),Sn.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):Zn(this,e,t,!1),t+4},Sn.prototype.writeFloatLE=function(e,t,r){return ti(this,e,t,!0,r)},Sn.prototype.writeFloatBE=function(e,t,r){return ti(this,e,t,!1,r)},Sn.prototype.writeDoubleLE=function(e,t,r){return ri(this,e,t,!0,r)},Sn.prototype.writeDoubleBE=function(e,t,r){return ri(this,e,t,!1,r)},Sn.prototype.copy=function(e,t,r,n){if(r||(r=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n<r&&(n=r),n===r)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t<n-r&&(n=e.length-t+r);var i,a=n-r;if(this===e&&r<t&&t<n)for(i=a-1;i>=0;--i)e[i+t]=this[i+r];else if(a<1e3||!Sn.TYPED_ARRAY_SUPPORT)for(i=0;i<a;++i)e[i+t]=this[i+r];else Uint8Array.prototype.set.call(e,this.subarray(r,r+a),t);return a},Sn.prototype.fill=function(e,t,r,n){if("string"==typeof e){if("string"==typeof t?(n=t,t=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),1===e.length){var i=e.charCodeAt(0);i<256&&(e=i)}if(void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!Sn.isEncoding(n))throw new TypeError("Unknown encoding: "+n)}else"number"==typeof e&&(e&=255);if(t<0||this.length<t||this.length<r)throw new RangeError("Out of range index");if(r<=t)return this;var a;if(t>>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(a=t;a<r;++a)this[a]=e;else{var o=Cn(e)?e:ai(new Sn(e,n).toString()),s=o.length;for(a=0;a<r-t;++a)this[a+t]=o[a%s]}return this};var ni=/[^+\/0-9A-Za-z-_]/g;function ii(e){return e<16?"0"+e.toString(16):e.toString(16)}function ai(e,t){var r;t=t||1/0;for(var n=e.length,i=null,a=[],o=0;o<n;++o){if((r=e.charCodeAt(o))>55295&&r<57344){if(!i){if(r>56319){(t-=3)>-1&&a.push(239,191,189);continue}if(o+1===n){(t-=3)>-1&&a.push(239,191,189);continue}i=r;continue}if(r<56320){(t-=3)>-1&&a.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(t-=3)>-1&&a.push(239,191,189);if(i=null,r<128){if((t-=1)<0)break;a.push(r)}else if(r<2048){if((t-=2)<0)break;a.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;a.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;a.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return a}function oi(e){return function(e){var t,r,n,i,a,o;hn||mn();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 pn(3*s/4-a),n=a>0?s-4:s;var u=0;for(t=0,r=0;t<n;t+=4,r+=3)i=dn[e.charCodeAt(t)]<<18|dn[e.charCodeAt(t+1)]<<12|dn[e.charCodeAt(t+2)]<<6|dn[e.charCodeAt(t+3)],o[u++]=i>>16&255,o[u++]=i>>8&255,o[u++]=255&i;return 2===a?(i=dn[e.charCodeAt(t)]<<2|dn[e.charCodeAt(t+1)]>>4,o[u++]=255&i):1===a&&(i=dn[e.charCodeAt(t)]<<10|dn[e.charCodeAt(t+1)]<<4|dn[e.charCodeAt(t+2)]>>2,o[u++]=i>>8&255,o[u++]=255&i),o}(function(e){if((e=function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}(e).replace(ni,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function si(e,t,r,n){for(var i=0;i<n&&!(i+r>=t.length||i>=e.length);++i)t[i+r]=e[i];return i}function ui(e){return null!=e&&(!!e._isBuffer||fi(e)||function(e){return"function"==typeof e.readFloatLE&&"function"==typeof e.slice&&fi(e.slice(0,0))}(e))}function fi(e){return!!e.constructor&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)}var ci=un(Object.freeze({__proto__:null,Buffer:Sn,INSPECT_MAX_BYTES:50,SlowBuffer:function(e){return+e!=e&&(e=0),Sn.alloc(+e)},isBuffer:ui,kMaxLength:En}));!function(e){!function(e,t){function r(e,t){if(!e)throw new Error(t||"Assertion failed")}function n(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}function i(e,t,r){if(i.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&("le"!==t&&"be"!==t||(r=t,t=10),this._init(e||0,t||10,r||"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:ci.Buffer}catch(e){}function o(e,t){var n=e.charCodeAt(t);return n>=48&&n<=57?n-48:n>=65&&n<=70?n-55:n>=97&&n<=102?n-87:void r(!1,"Invalid character in "+e)}function s(e,t,r){var n=o(e,r);return r-1>=t&&(n|=o(e,r-1)<<4),n}function u(e,t,n,i){for(var a=0,o=0,s=Math.min(e.length,n),u=t;u<s;u++){var f=e.charCodeAt(u)-48;a*=i,o=f>=49?f-49+10:f>=17?f-17+10:f,r(f>=0&&o<i,"Invalid character"),a+=o}return a}function f(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,n){if("number"==typeof e)return this._initNumber(e,t,n);if("object"==typeof e)return this._initArray(e,t,n);"hex"===t&&(t=16),r(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,n):(this._parseBase(e,t,i),"le"===n&&this._initArray(this.toArray(),t,n)))},i.prototype._initNumber=function(e,t,n){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):(r(e<9007199254740992),this.words=[67108863&e,e/67108864&67108863,1],this.length=3),"le"===n&&this._initArray(this.toArray(),t,n)},i.prototype._initArray=function(e,t,n){if(r("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"===n)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"===n)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,r){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var n=0;n<this.length;n++)this.words[n]=0;var i,a=0,o=0;if("be"===r)for(n=e.length-1;n>=t;n-=2)i=s(e,t,n)<<a,this.words[o]|=67108863&i,a>=18?(a-=18,o+=1,this.words[o]|=i>>>26):a+=8;else for(n=(e.length-t)%2==0?t+1:t;n<e.length;n+=2)i=s(e,t,n)<<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,r){this.words=[0],this.length=1;for(var n=0,i=1;i<=67108863;i*=t)n++;n--,i=i/t|0;for(var a=e.length-r,o=a%n,s=Math.min(a,a-o)+r,f=0,c=r;c<s;c+=n)f=u(e,c,c+n,t),this.imuln(i),this.words[0]+f<67108864?this.words[0]+=f:this._iaddn(f);if(0!==o){var l=1;for(f=u(e,c,e.length,t),c=0;c<o;c++)l*=t;this.imuln(l),this.words[0]+f<67108864?this.words[0]+=f:this._iaddn(f)}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){f(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")]=c}catch(e){i.prototype.inspect=c}else i.prototype.inspect=c;function c(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"}var l=["","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"],d=[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 n;if(t=0|t||1,16===(e=e||10)||"hex"===e){n="";for(var i=0,a=0,o=0;o<this.length;o++){var s=this.words[o],u=(16777215&(s<<i|a)).toString(16);a=s>>>24-i&16777215,(i+=2)>=26&&(i-=26,o--),n=0!==a||o!==this.length-1?l[6-u.length]+u+n:u+n}for(0!==a&&(n=a.toString(16)+n);n.length%t!=0;)n="0"+n;return 0!==this.negative&&(n="-"+n),n}if(e===(0|e)&&e>=2&&e<=36){var f=d[e],c=p[e];n="";var h=this.clone();for(h.negative=0;!h.isZero();){var m=h.modrn(c).toString(e);n=(h=h.idivn(c)).isZero()?m+n:l[f-m.length]+m+n}for(this.isZero()&&(n="0"+n);n.length%t!=0;)n="0"+n;return 0!==this.negative&&(n="-"+n),n}r(!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&&r(!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,r){r.negative=t.negative^e.negative;var n=e.length+t.length|0;r.length=n,n=n-1|0;var i=0|e.words[0],a=0|t.words[0],o=i*a,s=67108863&o,u=o/67108864|0;r.words[0]=s;for(var f=1;f<n;f++){for(var c=u>>>26,l=67108863&u,d=Math.min(f,t.length-1),p=Math.max(0,f-e.length+1);p<=d;p++){var h=f-p|0;c+=(o=(i=0|e.words[h])*(a=0|t.words[p])+l)/67108864|0,l=67108863&o}r.words[f]=0|l,u=0|c}return 0!==u?r.words[f]=0|u:r.length--,r._strip()}i.prototype.toArrayLike=function(e,t,n){this._strip();var i=this.byteLength(),a=n||Math.max(1,i);r(i<=a,"byte array longer than desired length"),r(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 r=0,n=0,i=0,a=0;i<this.length;i++){var o=this.words[i]<<a|n;e[r++]=255&o,r<e.length&&(e[r++]=o>>8&255),r<e.length&&(e[r++]=o>>16&255),6===a?(r<e.length&&(e[r++]=o>>24&255),n=0,a=0):(n=o>>>24,a+=2)}if(r<e.length)for(e[r++]=n;r<e.length;)e[r++]=0},i.prototype._toArrayLikeBE=function(e,t){for(var r=e.length-1,n=0,i=0,a=0;i<this.length;i++){var o=this.words[i]<<a|n;e[r--]=255&o,r>=0&&(e[r--]=o>>8&255),r>=0&&(e[r--]=o>>16&255),6===a?(r>=0&&(e[r--]=o>>24&255),n=0,a=0):(n=o>>>24,a+=2)}if(r>=0)for(e[r--]=n;r>=0;)e[r--]=0},Math.clz32?i.prototype._countBits=function(e){return 32-Math.clz32(e)}:i.prototype._countBits=function(e){var t=e,r=0;return t>=4096&&(r+=13,t>>>=13),t>=64&&(r+=7,t>>>=7),t>=8&&(r+=4,t>>>=4),t>=2&&(r+=2,t>>>=2),r+t},i.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,r=0;return 0==(8191&t)&&(r+=13,t>>>=13),0==(127&t)&&(r+=7,t>>>=7),0==(15&t)&&(r+=4,t>>>=4),0==(3&t)&&(r+=2,t>>>=2),0==(1&t)&&r++,r},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 r=this._zeroBits(this.words[t]);if(e+=r,26!==r)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 r(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 r=0;r<t.length;r++)this.words[r]=this.words[r]&e.words[r];return this.length=t.length,this._strip()},i.prototype.iand=function(e){return r(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,r;this.length>e.length?(t=this,r=e):(t=e,r=this);for(var n=0;n<r.length;n++)this.words[n]=t.words[n]^r.words[n];if(this!==t)for(;n<t.length;n++)this.words[n]=t.words[n];return this.length=t.length,this._strip()},i.prototype.ixor=function(e){return r(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){r("number"==typeof e&&e>=0);var t=0|Math.ceil(e/26),n=e%26;this._expand(t),n>0&&t--;for(var i=0;i<t;i++)this.words[i]=67108863&~this.words[i];return n>0&&(this.words[i]=~this.words[i]&67108863>>26-n),this._strip()},i.prototype.notn=function(e){return this.clone().inotn(e)},i.prototype.setn=function(e,t){r("number"==typeof e&&e>=0);var n=e/26|0,i=e%26;return this._expand(n+1),this.words[n]=t?this.words[n]|1<<i:this.words[n]&~(1<<i),this._strip()},i.prototype.iadd=function(e){var t,r,n;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?(r=this,n=e):(r=e,n=this);for(var i=0,a=0;a<n.length;a++)t=(0|r.words[a])+(0|n.words[a])+i,this.words[a]=67108863&t,i=t>>>26;for(;0!==i&&a<r.length;a++)t=(0|r.words[a])+i,this.words[a]=67108863&t,i=t>>>26;if(this.length=r.length,0!==i)this.words[this.length]=i,this.length++;else if(r!==this)for(;a<r.length;a++)this.words[a]=r.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 r,n,i=this.cmp(e);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(r=this,n=e):(r=e,n=this);for(var a=0,o=0;o<n.length;o++)a=(t=(0|r.words[o])-(0|n.words[o])+a)>>26,this.words[o]=67108863&t;for(;0!==a&&o<r.length;o++)a=(t=(0|r.words[o])+a)>>26,this.words[o]=67108863&t;if(0===a&&o<r.length&&r!==this)for(;o<r.length;o++)this.words[o]=r.words[o];return this.length=Math.max(this.length,o),r!==this&&(this.negative=1),this._strip()},i.prototype.sub=function(e){return this.clone().isub(e)};var m=function(e,t,r){var n,i,a,o=e.words,s=t.words,u=r.words,f=0,c=0|o[0],l=8191&c,d=c>>>13,p=0|o[1],h=8191&p,m=p>>>13,y=0|o[2],b=8191&y,g=y>>>13,v=0|o[3],w=8191&v,_=v>>>13,E=0|o[4],T=8191&E,A=E>>>13,S=0|o[5],k=8191&S,O=S>>>13,R=0|o[6],x=8191&R,I=R>>>13,C=0|o[7],N=8191&C,P=C>>>13,M=0|o[8],B=8191&M,D=M>>>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],V=8191&H,G=H>>>13,W=0|s[2],K=8191&W,X=W>>>13,$=0|s[3],J=8191&$,Y=$>>>13,Q=0|s[4],Z=8191&Q,ee=Q>>>13,te=0|s[5],re=8191&te,ne=te>>>13,ie=0|s[6],ae=8191&ie,oe=ie>>>13,se=0|s[7],ue=8191&se,fe=se>>>13,ce=0|s[8],le=8191&ce,de=ce>>>13,pe=0|s[9],he=8191&pe,me=pe>>>13;r.negative=e.negative^t.negative,r.length=19;var ye=(f+(n=Math.imul(l,q))|0)+((8191&(i=(i=Math.imul(l,z))+Math.imul(d,q)|0))<<13)|0;f=((a=Math.imul(d,z))+(i>>>13)|0)+(ye>>>26)|0,ye&=67108863,n=Math.imul(h,q),i=(i=Math.imul(h,z))+Math.imul(m,q)|0,a=Math.imul(m,z);var be=(f+(n=n+Math.imul(l,V)|0)|0)+((8191&(i=(i=i+Math.imul(l,G)|0)+Math.imul(d,V)|0))<<13)|0;f=((a=a+Math.imul(d,G)|0)+(i>>>13)|0)+(be>>>26)|0,be&=67108863,n=Math.imul(b,q),i=(i=Math.imul(b,z))+Math.imul(g,q)|0,a=Math.imul(g,z),n=n+Math.imul(h,V)|0,i=(i=i+Math.imul(h,G)|0)+Math.imul(m,V)|0,a=a+Math.imul(m,G)|0;var ge=(f+(n=n+Math.imul(l,K)|0)|0)+((8191&(i=(i=i+Math.imul(l,X)|0)+Math.imul(d,K)|0))<<13)|0;f=((a=a+Math.imul(d,X)|0)+(i>>>13)|0)+(ge>>>26)|0,ge&=67108863,n=Math.imul(w,q),i=(i=Math.imul(w,z))+Math.imul(_,q)|0,a=Math.imul(_,z),n=n+Math.imul(b,V)|0,i=(i=i+Math.imul(b,G)|0)+Math.imul(g,V)|0,a=a+Math.imul(g,G)|0,n=n+Math.imul(h,K)|0,i=(i=i+Math.imul(h,X)|0)+Math.imul(m,K)|0,a=a+Math.imul(m,X)|0;var ve=(f+(n=n+Math.imul(l,J)|0)|0)+((8191&(i=(i=i+Math.imul(l,Y)|0)+Math.imul(d,J)|0))<<13)|0;f=((a=a+Math.imul(d,Y)|0)+(i>>>13)|0)+(ve>>>26)|0,ve&=67108863,n=Math.imul(T,q),i=(i=Math.imul(T,z))+Math.imul(A,q)|0,a=Math.imul(A,z),n=n+Math.imul(w,V)|0,i=(i=i+Math.imul(w,G)|0)+Math.imul(_,V)|0,a=a+Math.imul(_,G)|0,n=n+Math.imul(b,K)|0,i=(i=i+Math.imul(b,X)|0)+Math.imul(g,K)|0,a=a+Math.imul(g,X)|0,n=n+Math.imul(h,J)|0,i=(i=i+Math.imul(h,Y)|0)+Math.imul(m,J)|0,a=a+Math.imul(m,Y)|0;var we=(f+(n=n+Math.imul(l,Z)|0)|0)+((8191&(i=(i=i+Math.imul(l,ee)|0)+Math.imul(d,Z)|0))<<13)|0;f=((a=a+Math.imul(d,ee)|0)+(i>>>13)|0)+(we>>>26)|0,we&=67108863,n=Math.imul(k,q),i=(i=Math.imul(k,z))+Math.imul(O,q)|0,a=Math.imul(O,z),n=n+Math.imul(T,V)|0,i=(i=i+Math.imul(T,G)|0)+Math.imul(A,V)|0,a=a+Math.imul(A,G)|0,n=n+Math.imul(w,K)|0,i=(i=i+Math.imul(w,X)|0)+Math.imul(_,K)|0,a=a+Math.imul(_,X)|0,n=n+Math.imul(b,J)|0,i=(i=i+Math.imul(b,Y)|0)+Math.imul(g,J)|0,a=a+Math.imul(g,Y)|0,n=n+Math.imul(h,Z)|0,i=(i=i+Math.imul(h,ee)|0)+Math.imul(m,Z)|0,a=a+Math.imul(m,ee)|0;var _e=(f+(n=n+Math.imul(l,re)|0)|0)+((8191&(i=(i=i+Math.imul(l,ne)|0)+Math.imul(d,re)|0))<<13)|0;f=((a=a+Math.imul(d,ne)|0)+(i>>>13)|0)+(_e>>>26)|0,_e&=67108863,n=Math.imul(x,q),i=(i=Math.imul(x,z))+Math.imul(I,q)|0,a=Math.imul(I,z),n=n+Math.imul(k,V)|0,i=(i=i+Math.imul(k,G)|0)+Math.imul(O,V)|0,a=a+Math.imul(O,G)|0,n=n+Math.imul(T,K)|0,i=(i=i+Math.imul(T,X)|0)+Math.imul(A,K)|0,a=a+Math.imul(A,X)|0,n=n+Math.imul(w,J)|0,i=(i=i+Math.imul(w,Y)|0)+Math.imul(_,J)|0,a=a+Math.imul(_,Y)|0,n=n+Math.imul(b,Z)|0,i=(i=i+Math.imul(b,ee)|0)+Math.imul(g,Z)|0,a=a+Math.imul(g,ee)|0,n=n+Math.imul(h,re)|0,i=(i=i+Math.imul(h,ne)|0)+Math.imul(m,re)|0,a=a+Math.imul(m,ne)|0;var Ee=(f+(n=n+Math.imul(l,ae)|0)|0)+((8191&(i=(i=i+Math.imul(l,oe)|0)+Math.imul(d,ae)|0))<<13)|0;f=((a=a+Math.imul(d,oe)|0)+(i>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,n=Math.imul(N,q),i=(i=Math.imul(N,z))+Math.imul(P,q)|0,a=Math.imul(P,z),n=n+Math.imul(x,V)|0,i=(i=i+Math.imul(x,G)|0)+Math.imul(I,V)|0,a=a+Math.imul(I,G)|0,n=n+Math.imul(k,K)|0,i=(i=i+Math.imul(k,X)|0)+Math.imul(O,K)|0,a=a+Math.imul(O,X)|0,n=n+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,n=n+Math.imul(w,Z)|0,i=(i=i+Math.imul(w,ee)|0)+Math.imul(_,Z)|0,a=a+Math.imul(_,ee)|0,n=n+Math.imul(b,re)|0,i=(i=i+Math.imul(b,ne)|0)+Math.imul(g,re)|0,a=a+Math.imul(g,ne)|0,n=n+Math.imul(h,ae)|0,i=(i=i+Math.imul(h,oe)|0)+Math.imul(m,ae)|0,a=a+Math.imul(m,oe)|0;var Te=(f+(n=n+Math.imul(l,ue)|0)|0)+((8191&(i=(i=i+Math.imul(l,fe)|0)+Math.imul(d,ue)|0))<<13)|0;f=((a=a+Math.imul(d,fe)|0)+(i>>>13)|0)+(Te>>>26)|0,Te&=67108863,n=Math.imul(B,q),i=(i=Math.imul(B,z))+Math.imul(D,q)|0,a=Math.imul(D,z),n=n+Math.imul(N,V)|0,i=(i=i+Math.imul(N,G)|0)+Math.imul(P,V)|0,a=a+Math.imul(P,G)|0,n=n+Math.imul(x,K)|0,i=(i=i+Math.imul(x,X)|0)+Math.imul(I,K)|0,a=a+Math.imul(I,X)|0,n=n+Math.imul(k,J)|0,i=(i=i+Math.imul(k,Y)|0)+Math.imul(O,J)|0,a=a+Math.imul(O,Y)|0,n=n+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,n=n+Math.imul(w,re)|0,i=(i=i+Math.imul(w,ne)|0)+Math.imul(_,re)|0,a=a+Math.imul(_,ne)|0,n=n+Math.imul(b,ae)|0,i=(i=i+Math.imul(b,oe)|0)+Math.imul(g,ae)|0,a=a+Math.imul(g,oe)|0,n=n+Math.imul(h,ue)|0,i=(i=i+Math.imul(h,fe)|0)+Math.imul(m,ue)|0,a=a+Math.imul(m,fe)|0;var Ae=(f+(n=n+Math.imul(l,le)|0)|0)+((8191&(i=(i=i+Math.imul(l,de)|0)+Math.imul(d,le)|0))<<13)|0;f=((a=a+Math.imul(d,de)|0)+(i>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,n=Math.imul(L,q),i=(i=Math.imul(L,z))+Math.imul(U,q)|0,a=Math.imul(U,z),n=n+Math.imul(B,V)|0,i=(i=i+Math.imul(B,G)|0)+Math.imul(D,V)|0,a=a+Math.imul(D,G)|0,n=n+Math.imul(N,K)|0,i=(i=i+Math.imul(N,X)|0)+Math.imul(P,K)|0,a=a+Math.imul(P,X)|0,n=n+Math.imul(x,J)|0,i=(i=i+Math.imul(x,Y)|0)+Math.imul(I,J)|0,a=a+Math.imul(I,Y)|0,n=n+Math.imul(k,Z)|0,i=(i=i+Math.imul(k,ee)|0)+Math.imul(O,Z)|0,a=a+Math.imul(O,ee)|0,n=n+Math.imul(T,re)|0,i=(i=i+Math.imul(T,ne)|0)+Math.imul(A,re)|0,a=a+Math.imul(A,ne)|0,n=n+Math.imul(w,ae)|0,i=(i=i+Math.imul(w,oe)|0)+Math.imul(_,ae)|0,a=a+Math.imul(_,oe)|0,n=n+Math.imul(b,ue)|0,i=(i=i+Math.imul(b,fe)|0)+Math.imul(g,ue)|0,a=a+Math.imul(g,fe)|0,n=n+Math.imul(h,le)|0,i=(i=i+Math.imul(h,de)|0)+Math.imul(m,le)|0,a=a+Math.imul(m,de)|0;var Se=(f+(n=n+Math.imul(l,he)|0)|0)+((8191&(i=(i=i+Math.imul(l,me)|0)+Math.imul(d,he)|0))<<13)|0;f=((a=a+Math.imul(d,me)|0)+(i>>>13)|0)+(Se>>>26)|0,Se&=67108863,n=Math.imul(L,V),i=(i=Math.imul(L,G))+Math.imul(U,V)|0,a=Math.imul(U,G),n=n+Math.imul(B,K)|0,i=(i=i+Math.imul(B,X)|0)+Math.imul(D,K)|0,a=a+Math.imul(D,X)|0,n=n+Math.imul(N,J)|0,i=(i=i+Math.imul(N,Y)|0)+Math.imul(P,J)|0,a=a+Math.imul(P,Y)|0,n=n+Math.imul(x,Z)|0,i=(i=i+Math.imul(x,ee)|0)+Math.imul(I,Z)|0,a=a+Math.imul(I,ee)|0,n=n+Math.imul(k,re)|0,i=(i=i+Math.imul(k,ne)|0)+Math.imul(O,re)|0,a=a+Math.imul(O,ne)|0,n=n+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,n=n+Math.imul(w,ue)|0,i=(i=i+Math.imul(w,fe)|0)+Math.imul(_,ue)|0,a=a+Math.imul(_,fe)|0,n=n+Math.imul(b,le)|0,i=(i=i+Math.imul(b,de)|0)+Math.imul(g,le)|0,a=a+Math.imul(g,de)|0;var ke=(f+(n=n+Math.imul(h,he)|0)|0)+((8191&(i=(i=i+Math.imul(h,me)|0)+Math.imul(m,he)|0))<<13)|0;f=((a=a+Math.imul(m,me)|0)+(i>>>13)|0)+(ke>>>26)|0,ke&=67108863,n=Math.imul(L,K),i=(i=Math.imul(L,X))+Math.imul(U,K)|0,a=Math.imul(U,X),n=n+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,n=n+Math.imul(N,Z)|0,i=(i=i+Math.imul(N,ee)|0)+Math.imul(P,Z)|0,a=a+Math.imul(P,ee)|0,n=n+Math.imul(x,re)|0,i=(i=i+Math.imul(x,ne)|0)+Math.imul(I,re)|0,a=a+Math.imul(I,ne)|0,n=n+Math.imul(k,ae)|0,i=(i=i+Math.imul(k,oe)|0)+Math.imul(O,ae)|0,a=a+Math.imul(O,oe)|0,n=n+Math.imul(T,ue)|0,i=(i=i+Math.imul(T,fe)|0)+Math.imul(A,ue)|0,a=a+Math.imul(A,fe)|0,n=n+Math.imul(w,le)|0,i=(i=i+Math.imul(w,de)|0)+Math.imul(_,le)|0,a=a+Math.imul(_,de)|0;var Oe=(f+(n=n+Math.imul(b,he)|0)|0)+((8191&(i=(i=i+Math.imul(b,me)|0)+Math.imul(g,he)|0))<<13)|0;f=((a=a+Math.imul(g,me)|0)+(i>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,n=Math.imul(L,J),i=(i=Math.imul(L,Y))+Math.imul(U,J)|0,a=Math.imul(U,Y),n=n+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,n=n+Math.imul(N,re)|0,i=(i=i+Math.imul(N,ne)|0)+Math.imul(P,re)|0,a=a+Math.imul(P,ne)|0,n=n+Math.imul(x,ae)|0,i=(i=i+Math.imul(x,oe)|0)+Math.imul(I,ae)|0,a=a+Math.imul(I,oe)|0,n=n+Math.imul(k,ue)|0,i=(i=i+Math.imul(k,fe)|0)+Math.imul(O,ue)|0,a=a+Math.imul(O,fe)|0,n=n+Math.imul(T,le)|0,i=(i=i+Math.imul(T,de)|0)+Math.imul(A,le)|0,a=a+Math.imul(A,de)|0;var Re=(f+(n=n+Math.imul(w,he)|0)|0)+((8191&(i=(i=i+Math.imul(w,me)|0)+Math.imul(_,he)|0))<<13)|0;f=((a=a+Math.imul(_,me)|0)+(i>>>13)|0)+(Re>>>26)|0,Re&=67108863,n=Math.imul(L,Z),i=(i=Math.imul(L,ee))+Math.imul(U,Z)|0,a=Math.imul(U,ee),n=n+Math.imul(B,re)|0,i=(i=i+Math.imul(B,ne)|0)+Math.imul(D,re)|0,a=a+Math.imul(D,ne)|0,n=n+Math.imul(N,ae)|0,i=(i=i+Math.imul(N,oe)|0)+Math.imul(P,ae)|0,a=a+Math.imul(P,oe)|0,n=n+Math.imul(x,ue)|0,i=(i=i+Math.imul(x,fe)|0)+Math.imul(I,ue)|0,a=a+Math.imul(I,fe)|0,n=n+Math.imul(k,le)|0,i=(i=i+Math.imul(k,de)|0)+Math.imul(O,le)|0,a=a+Math.imul(O,de)|0;var xe=(f+(n=n+Math.imul(T,he)|0)|0)+((8191&(i=(i=i+Math.imul(T,me)|0)+Math.imul(A,he)|0))<<13)|0;f=((a=a+Math.imul(A,me)|0)+(i>>>13)|0)+(xe>>>26)|0,xe&=67108863,n=Math.imul(L,re),i=(i=Math.imul(L,ne))+Math.imul(U,re)|0,a=Math.imul(U,ne),n=n+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,n=n+Math.imul(N,ue)|0,i=(i=i+Math.imul(N,fe)|0)+Math.imul(P,ue)|0,a=a+Math.imul(P,fe)|0,n=n+Math.imul(x,le)|0,i=(i=i+Math.imul(x,de)|0)+Math.imul(I,le)|0,a=a+Math.imul(I,de)|0;var Ie=(f+(n=n+Math.imul(k,he)|0)|0)+((8191&(i=(i=i+Math.imul(k,me)|0)+Math.imul(O,he)|0))<<13)|0;f=((a=a+Math.imul(O,me)|0)+(i>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,n=Math.imul(L,ae),i=(i=Math.imul(L,oe))+Math.imul(U,ae)|0,a=Math.imul(U,oe),n=n+Math.imul(B,ue)|0,i=(i=i+Math.imul(B,fe)|0)+Math.imul(D,ue)|0,a=a+Math.imul(D,fe)|0,n=n+Math.imul(N,le)|0,i=(i=i+Math.imul(N,de)|0)+Math.imul(P,le)|0,a=a+Math.imul(P,de)|0;var Ce=(f+(n=n+Math.imul(x,he)|0)|0)+((8191&(i=(i=i+Math.imul(x,me)|0)+Math.imul(I,he)|0))<<13)|0;f=((a=a+Math.imul(I,me)|0)+(i>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,n=Math.imul(L,ue),i=(i=Math.imul(L,fe))+Math.imul(U,ue)|0,a=Math.imul(U,fe),n=n+Math.imul(B,le)|0,i=(i=i+Math.imul(B,de)|0)+Math.imul(D,le)|0,a=a+Math.imul(D,de)|0;var Ne=(f+(n=n+Math.imul(N,he)|0)|0)+((8191&(i=(i=i+Math.imul(N,me)|0)+Math.imul(P,he)|0))<<13)|0;f=((a=a+Math.imul(P,me)|0)+(i>>>13)|0)+(Ne>>>26)|0,Ne&=67108863,n=Math.imul(L,le),i=(i=Math.imul(L,de))+Math.imul(U,le)|0,a=Math.imul(U,de);var Pe=(f+(n=n+Math.imul(B,he)|0)|0)+((8191&(i=(i=i+Math.imul(B,me)|0)+Math.imul(D,he)|0))<<13)|0;f=((a=a+Math.imul(D,me)|0)+(i>>>13)|0)+(Pe>>>26)|0,Pe&=67108863;var Me=(f+(n=Math.imul(L,he))|0)+((8191&(i=(i=Math.imul(L,me))+Math.imul(U,he)|0))<<13)|0;return f=((a=Math.imul(U,me))+(i>>>13)|0)+(Me>>>26)|0,Me&=67108863,u[0]=ye,u[1]=be,u[2]=ge,u[3]=ve,u[4]=we,u[5]=_e,u[6]=Ee,u[7]=Te,u[8]=Ae,u[9]=Se,u[10]=ke,u[11]=Oe,u[12]=Re,u[13]=xe,u[14]=Ie,u[15]=Ce,u[16]=Ne,u[17]=Pe,u[18]=Me,0!==f&&(u[19]=f,r.length++),r};function y(e,t,r){r.negative=t.negative^e.negative,r.length=e.length+t.length;for(var n=0,i=0,a=0;a<r.length-1;a++){var o=i;i=0;for(var s=67108863&n,u=Math.min(a,t.length-1),f=Math.max(0,a-e.length+1);f<=u;f++){var c=a-f,l=(0|e.words[c])*(0|t.words[f]),d=67108863&l;s=67108863&(d=d+s|0),i+=(o=(o=o+(l/67108864|0)|0)+(d>>>26)|0)>>>26,o&=67108863}r.words[a]=s,n=o,o=i}return 0!==n?r.words[a]=n:r.length--,r._strip()}function b(e,t,r){return y(e,t,r)}Math.imul||(m=h),i.prototype.mulTo=function(e,t){var r=this.length+e.length;return 10===this.length&&10===e.length?m(this,e,t):r<63?h(this,e,t):r<1024?y(this,e,t):b(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),b(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),r("number"==typeof e),r(e<67108864);for(var n=0,i=0;i<this.length;i++){var a=(0|this.words[i])*e,o=(67108863&a)+(67108863&n);n>>=26,n+=a/67108864|0,n+=o>>>26,this.words[i]=67108863&o}return 0!==n&&(this.words[i]=n,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()),r=0;r<t.length;r++){var n=r/26|0,i=r%26;t[r]=e.words[n]>>>i&1}return t}(e);if(0===t.length)return new i(1);for(var r=this,n=0;n<t.length&&0===t[n];n++,r=r.sqr());if(++n<t.length)for(var a=r.sqr();n<t.length;n++,a=a.sqr())0!==t[n]&&(r=r.mul(a));return r},i.prototype.iushln=function(e){r("number"==typeof e&&e>=0);var t,n=e%26,i=(e-n)/26,a=67108863>>>26-n<<26-n;if(0!==n){var o=0;for(t=0;t<this.length;t++){var s=this.words[t]&a,u=(0|this.words[t])-s<<n;this.words[t]=u|o,o=s>>>26-n}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 r(0===this.negative),this.iushln(e)},i.prototype.iushrn=function(e,t,n){var i;r("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,u=n;if(i-=o,i=Math.max(0,i),u){for(var f=0;f<o;f++)u.words[f]=this.words[f];u.length=o}if(0===o);else if(this.length>o)for(this.length-=o,f=0;f<this.length;f++)this.words[f]=this.words[f+o];else this.words[0]=0,this.length=1;var c=0;for(f=this.length-1;f>=0&&(0!==c||f>=i);f--){var l=0|this.words[f];this.words[f]=c<<26-a|l>>>a,c=l&s}return u&&0!==c&&(u.words[u.length++]=c),0===this.length&&(this.words[0]=0,this.length=1),this._strip()},i.prototype.ishrn=function(e,t,n){return r(0===this.negative),this.iushrn(e,t,n)},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){r("number"==typeof e&&e>=0);var t=e%26,n=(e-t)/26,i=1<<t;return!(this.length<=n)&&!!(this.words[n]&i)},i.prototype.imaskn=function(e){r("number"==typeof e&&e>=0);var t=e%26,n=(e-t)/26;if(r(0===this.negative,"imaskn works only with positive numbers"),this.length<=n)return this;if(0!==t&&n++,this.length=Math.min(n,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 r("number"==typeof e),r(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(r("number"==typeof e),r(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,n){var i,a,o=e.length+n;this._expand(o);var s=0;for(i=0;i<e.length;i++){a=(0|this.words[i+n])+s;var u=(0|e.words[i])*t;s=((a-=67108863&u)>>26)-(u/67108864|0),this.words[i+n]=67108863&a}for(;i<this.length-n;i++)s=(a=(0|this.words[i+n])+s)>>26,this.words[i+n]=67108863&a;if(0===s)return this._strip();for(r(-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 r=(this.length,e.length),n=this.clone(),a=e,o=0|a.words[a.length-1];0!==(r=26-this._countBits(o))&&(a=a.ushln(r),n.iushln(r),o=0|a.words[a.length-1]);var s,u=n.length-a.length;if("mod"!==t){(s=new i(null)).length=u+1,s.words=new Array(s.length);for(var f=0;f<s.length;f++)s.words[f]=0}var c=n.clone()._ishlnsubmul(a,1,u);0===c.negative&&(n=c,s&&(s.words[u]=1));for(var l=u-1;l>=0;l--){var d=67108864*(0|n.words[a.length+l])+(0|n.words[a.length+l-1]);for(d=Math.min(d/o|0,67108863),n._ishlnsubmul(a,d,l);0!==n.negative;)d--,n.negative=0,n._ishlnsubmul(a,1,l),n.isZero()||(n.negative^=1);s&&(s.words[l]=d)}return s&&s._strip(),n._strip(),"div"!==t&&0!==r&&n.iushrn(r),{div:s||null,mod:n}},i.prototype.divmod=function(e,t,n){return r(!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(),n&&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(),n&&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 r=0!==t.div.negative?t.mod.isub(e):t.mod,n=e.ushrn(1),i=e.andln(1),a=r.cmp(n);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),r(e<=67108863);for(var n=(1<<26)%e,i=0,a=this.length-1;a>=0;a--)i=(n*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),r(e<=67108863);for(var n=0,i=this.length-1;i>=0;i--){var a=(0|this.words[i])+67108864*n;this.words[i]=a/e|0,n=a%e}return this._strip(),t?this.ineg():this},i.prototype.divn=function(e){return this.clone().idivn(e)},i.prototype.egcd=function(e){r(0===e.negative),r(!e.isZero());var t=this,n=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),u=new i(1),f=0;t.isEven()&&n.isEven();)t.iushrn(1),n.iushrn(1),++f;for(var c=n.clone(),l=t.clone();!t.isZero();){for(var d=0,p=1;0==(t.words[0]&p)&&d<26;++d,p<<=1);if(d>0)for(t.iushrn(d);d-- >0;)(a.isOdd()||o.isOdd())&&(a.iadd(c),o.isub(l)),a.iushrn(1),o.iushrn(1);for(var h=0,m=1;0==(n.words[0]&m)&&h<26;++h,m<<=1);if(h>0)for(n.iushrn(h);h-- >0;)(s.isOdd()||u.isOdd())&&(s.iadd(c),u.isub(l)),s.iushrn(1),u.iushrn(1);t.cmp(n)>=0?(t.isub(n),a.isub(s),o.isub(u)):(n.isub(t),s.isub(a),u.isub(o))}return{a:s,b:u,gcd:n.iushln(f)}},i.prototype._invmp=function(e){r(0===e.negative),r(!e.isZero());var t=this,n=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var a,o=new i(1),s=new i(0),u=n.clone();t.cmpn(1)>0&&n.cmpn(1)>0;){for(var f=0,c=1;0==(t.words[0]&c)&&f<26;++f,c<<=1);if(f>0)for(t.iushrn(f);f-- >0;)o.isOdd()&&o.iadd(u),o.iushrn(1);for(var l=0,d=1;0==(n.words[0]&d)&&l<26;++l,d<<=1);if(l>0)for(n.iushrn(l);l-- >0;)s.isOdd()&&s.iadd(u),s.iushrn(1);t.cmp(n)>=0?(t.isub(n),o.isub(s)):(n.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(),r=e.clone();t.negative=0,r.negative=0;for(var n=0;t.isEven()&&r.isEven();n++)t.iushrn(1),r.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;r.isEven();)r.iushrn(1);var i=t.cmp(r);if(i<0){var a=t;t=r,r=a}else if(0===i||0===r.cmpn(1))break;t.isub(r)}return r.iushln(n)},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){r("number"==typeof e);var t=e%26,n=(e-t)/26,i=1<<t;if(this.length<=n)return this._expand(n+1),this.words[n]|=i,this;for(var a=i,o=n;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,n=e<0;if(0!==this.negative&&!n)return-1;if(0===this.negative&&n)return 1;if(this._strip(),this.length>1)t=1;else{n&&(e=-e),r(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,r=this.length-1;r>=0;r--){var n=0|this.words[r],i=0|e.words[r];if(n!==i){n<i?t=-1:n>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 r(!this.red,"Already a number in reduction context"),r(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},i.prototype.fromRed=function(){return r(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 r(!this.red,"Already a number in reduction context"),this._forceRed(e)},i.prototype.redAdd=function(e){return r(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},i.prototype.redIAdd=function(e){return r(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},i.prototype.redSub=function(e){return r(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},i.prototype.redISub=function(e){return r(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},i.prototype.redShl=function(e){return r(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},i.prototype.redMul=function(e){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},i.prototype.redIMul=function(e){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},i.prototype.redSqr=function(){return r(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},i.prototype.redISqr=function(){return r(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},i.prototype.redSqrt=function(){return r(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},i.prototype.redInvm=function(){return r(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},i.prototype.redNeg=function(){return r(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},i.prototype.redPow=function(e){return r(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 r(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function S(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,r=e;do{this.split(r,this.tmp),t=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(t>this.n);var n=t<this.n?-1:r.ucmp(this.p);return 0===n?(r.words[0]=0,r.length=1):n>0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},v.prototype.split=function(e,t){e.iushrn(this.n,0,t)},v.prototype.imulK=function(e){return e.imul(this.k)},n(w,v),w.prototype.split=function(e,t){for(var r=4194303,n=Math.min(e.length,9),i=0;i<n;i++)t.words[i]=e.words[i];if(t.length=n,e.length<=9)return e.words[0]=0,void(e.length=1);var a=e.words[9];for(t.words[t.length++]=a&r,i=10;i<e.length;i++){var o=0|e.words[i];e.words[i-10]=(o&r)<<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,r=0;r<e.length;r++){var n=0|e.words[r];t+=977*n,e.words[r]=67108863&t,t=64*n+(t/67108864|0)}return 0===e.words[e.length-1]&&(e.length--,0===e.words[e.length-1]&&e.length--),e},n(_,v),n(E,v),n(T,v),T.prototype.imulK=function(e){for(var t=0,r=0;r<e.length;r++){var n=19*(0|e.words[r])+t,i=67108863&n;n>>>=26,e.words[r]=i,t=n}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){r(0===e.negative,"red works only with positives"),r(e.red,"red works only with red numbers")},A.prototype._verify2=function(e,t){r(0==(e.negative|t.negative),"red works only with positives"),r(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):(f(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 r=e.add(t);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},A.prototype.iadd=function(e,t){this._verify2(e,t);var r=e.iadd(t);return r.cmp(this.m)>=0&&r.isub(this.m),r},A.prototype.sub=function(e,t){this._verify2(e,t);var r=e.sub(t);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},A.prototype.isub=function(e,t){this._verify2(e,t);var r=e.isub(t);return r.cmpn(0)<0&&r.iadd(this.m),r},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(r(t%2==1),3===t){var n=this.m.add(new i(1)).iushrn(2);return this.pow(e,n)}for(var a=this.m.subn(1),o=0;!a.isZero()&&0===a.andln(1);)o++,a.iushrn(1);r(!a.isZero());var s=new i(1).toRed(this),u=s.redNeg(),f=this.m.subn(1).iushrn(1),c=this.m.bitLength();for(c=new i(2*c*c).toRed(this);0!==this.pow(c,f).cmp(u);)c.redIAdd(u);for(var l=this.pow(c,a),d=this.pow(e,a.addn(1).iushrn(1)),p=this.pow(e,a),h=o;0!==p.cmp(s);){for(var m=p,y=0;0!==m.cmp(s);y++)m=m.redSqr();r(y<h);var b=this.pow(l,new i(1).iushln(h-y-1));d=d.redMul(b),l=b.redSqr(),p=p.redMul(l),h=y}return d},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 r=new Array(16);r[0]=new i(1).toRed(this),r[1]=e;for(var n=2;n<r.length;n++)r[n]=this.mul(r[n-1],e);var a=r[0],o=0,s=0,u=t.bitLength()%26;for(0===u&&(u=26),n=t.length-1;n>=0;n--){for(var f=t.words[n],c=u-1;c>=0;c--){var l=f>>c&1;a!==r[0]&&(a=this.sqr(a)),0!==l||0!==o?(o<<=1,o|=l,(4===++s||0===n&&0===c)&&(a=this.mul(a,r[o]),s=0,o=0)):s=0}u=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 S(e)},n(S,A),S.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},S.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},S.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var r=e.imul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).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)},S.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new i(0)._forceRed(this);var r=e.mul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),a=r.isub(n).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)},S.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(e,on)}(fn);var li=fn.exports,di=sn(li);let pi=!1,hi=!1;const mi={debug:1,default:2,info:2,warning:3,error:4,off:5};let yi=mi.default,bi=null;const gi=function(){try{const e=[];if(["NFD","NFC","NFKD","NFKC"].forEach((t=>{try{if("test"!=="test".normalize(t))throw new Error("bad normalize")}catch(r){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 vi,wi;!function(e){e.DEBUG="DEBUG",e.INFO="INFO",e.WARNING="WARNING",e.ERROR="ERROR",e.OFF="OFF"}(vi||(vi={})),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"}(wi||(wi={}));const _i="0123456789abcdef";let Ei=class e{constructor(e){Object.defineProperty(this,"version",{enumerable:!0,value:e,writable:!1})}_log(e,t){const r=e.toLowerCase();null==mi[r]&&this.throwArgumentError("invalid log level name","logLevel",e),yi>mi[r]||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,r,n){if(hi)return this.makeError("censored error",r,{});r||(r=e.errors.UNKNOWN_ERROR),n||(n={});const i=[];Object.keys(n).forEach((e=>{const t=n[e];try{if(t instanceof Uint8Array){let r="";for(let e=0;e<t.length;e++)r+=_i[t[e]>>4],r+=_i[15&t[e]];i.push(e+"=Uint8Array(0x"+r+")")}else i.push(e+"="+JSON.stringify(t))}catch(t){i.push(e+"="+JSON.stringify(n[e].toString()))}})),i.push(`code=${r}`),i.push(`version=${this.version}`);const a=t;let o="";switch(r){case wi.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 wi.CALL_EXCEPTION:case wi.INSUFFICIENT_FUNDS:case wi.MISSING_NEW:case wi.NONCE_EXPIRED:case wi.REPLACEMENT_UNDERPRICED:case wi.TRANSACTION_REPLACED:case wi.UNPREDICTABLE_GAS_LIMIT:o=r}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=r,Object.keys(n).forEach((function(e){s[e]=n[e]})),s}throwError(e,t,r){throw this.makeError(e,t,r)}throwArgumentError(t,r,n){return this.throwError(t,e.errors.INVALID_ARGUMENT,{argument:r,value:n})}assert(e,t,r,n){e||this.throwError(t,r,n)}assertArgument(e,t,r,n){e||this.throwArgumentError(t,r,n)}checkNormalize(t){gi&&this.throwError("platform missing String.prototype.normalize",e.errors.UNSUPPORTED_OPERATION,{operation:"String.prototype.normalize",form:gi})}checkSafeUint53(t,r){"number"==typeof t&&(null==r&&(r="value not safe"),(t<0||t>=9007199254740991)&&this.throwError(r,e.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"out-of-safe-range",value:t}),t%1&&this.throwError(r,e.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"non-integer",value:t}))}checkArgumentCount(t,r,n){n=n?": "+n:"",t<r&&this.throwError("missing argument"+n,e.errors.MISSING_ARGUMENT,{count:t,expectedCount:r}),t>r&&this.throwError("too many arguments"+n,e.errors.UNEXPECTED_ARGUMENT,{count:t,expectedCount:r})}checkNew(t,r){t!==Object&&null!=t||this.throwError("missing new",e.errors.MISSING_NEW,{name:r.name})}checkAbstract(t,r){t===r?this.throwError("cannot instantiate abstract class "+JSON.stringify(r.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:r.name})}static globalLogger(){return bi||(bi=new e("logger/5.7.0")),bi}static setCensorship(t,r){if(!t&&r&&this.globalLogger().throwError("cannot permanently disable censorship",e.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"}),pi){if(!t)return;this.globalLogger().throwError("error censorship permanent",e.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"})}hi=!!t,pi=!!r}static setLogLevel(t){const r=mi[t.toLowerCase()];null!=r?yi=r:e.globalLogger().warn("invalid log level - "+t)}static from(t){return new e(t)}};Ei.errors=wi,Ei.levels=vi;var Ti=Object.freeze({__proto__:null,get ErrorCode(){return wi},get LogLevel(){return vi},Logger:Ei});const Ai=new Ei("bytes/5.7.0");function Si(e){return!!e.toHexString}function ki(e){return e.slice||(e.slice=function(){const t=Array.prototype.slice.call(arguments);return ki(new Uint8Array(Array.prototype.slice.apply(e,t)))}),e}function Oi(e){return Mi(e)&&!(e.length%2)||xi(e)}function Ri(e){return"number"==typeof e&&e==e&&e%1==0}function xi(e){if(null==e)return!1;if(e.constructor===Uint8Array)return!0;if("string"==typeof e)return!1;if(!Ri(e.length)||e.length<0)return!1;for(let t=0;t<e.length;t++){const r=e[t];if(!Ri(r)||r<0||r>=256)return!1}return!0}function Ii(e,t){if(t||(t={}),"number"==typeof e){Ai.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),ki(new Uint8Array(t))}if(t.allowMissingPrefix&&"string"==typeof e&&"0x"!==e.substring(0,2)&&(e="0x"+e),Si(e)&&(e=e.toHexString()),Mi(e)){let r=e.substring(2);r.length%2&&("left"===t.hexPad?r="0"+r:"right"===t.hexPad?r+="0":Ai.throwArgumentError("hex data is odd-length","value",e));const n=[];for(let e=0;e<r.length;e+=2)n.push(parseInt(r.substring(e,e+2),16));return ki(new Uint8Array(n))}return xi(e)?ki(new Uint8Array(e)):Ai.throwArgumentError("invalid arrayify value","value",e)}function Ci(e){const t=e.map((e=>Ii(e))),r=t.reduce(((e,t)=>e+t.length),0),n=new Uint8Array(r);return t.reduce(((e,t)=>(n.set(t,e),e+t.length)),0),ki(n)}function Ni(e){let t=Ii(e);if(0===t.length)return t;let r=0;for(;r<t.length&&0===t[r];)r++;return r&&(t=t.slice(r)),t}function Pi(e,t){(e=Ii(e)).length>t&&Ai.throwArgumentError("value out of range","value",arguments[0]);const r=new Uint8Array(t);return r.set(e,t-e.length),ki(r)}function Mi(e,t){return!("string"!=typeof e||!e.match(/^0x[0-9A-Fa-f]*$/))&&(!t||e.length===2+2*t)}const Bi="0123456789abcdef";function Di(e,t){if(t||(t={}),"number"==typeof e){Ai.checkSafeUint53(e,"invalid hexlify value");let t="";for(;e;)t=Bi[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),Si(e))return e.toHexString();if(Mi(e))return e.length%2&&("left"===t.hexPad?e="0x0"+e.substring(2):"right"===t.hexPad?e+="0":Ai.throwArgumentError("hex data is odd-length","value",e)),e.toLowerCase();if(xi(e)){let t="0x";for(let r=0;r<e.length;r++){let n=e[r];t+=Bi[(240&n)>>4]+Bi[15&n]}return t}return Ai.throwArgumentError("invalid hexlify value","value",e)}function Fi(e){if("string"!=typeof e)e=Di(e);else if(!Mi(e)||e.length%2)return null;return(e.length-2)/2}function Li(e,t,r){return"string"!=typeof e?e=Di(e):(!Mi(e)||e.length%2)&&Ai.throwArgumentError("invalid hexData","value",e),t=2+2*t,null!=r?"0x"+e.substring(t,2+2*r):"0x"+e.substring(t)}function Ui(e){let t="0x";return e.forEach((e=>{t+=Di(e).substring(2)})),t}function ji(e){const t=qi(Di(e,{hexPad:"left"}));return"0x"===t?"0x0":t}function qi(e){"string"!=typeof e&&(e=Di(e)),Mi(e)||Ai.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 zi(e,t){for("string"!=typeof e?e=Di(e):Mi(e)||Ai.throwArgumentError("invalid hex string","value",e),e.length>2*t+2&&Ai.throwArgumentError("value out of range","value",arguments[1]);e.length<2*t+2;)e="0x0"+e.substring(2);return e}function Hi(e){const t={r:"0x",s:"0x",_vs:"0x",recoveryParam:0,v:0,yParityAndS:"0x",compact:"0x"};if(Oi(e)){let r=Ii(e);64===r.length?(t.v=27+(r[32]>>7),r[32]&=127,t.r=Di(r.slice(0,32)),t.s=Di(r.slice(32,64))):65===r.length?(t.r=Di(r.slice(0,32)),t.s=Di(r.slice(32,64)),t.v=r[64]):Ai.throwArgumentError("invalid signature string","signature",e),t.v<27&&(0===t.v||1===t.v?t.v+=27:Ai.throwArgumentError("signature invalid v byte","signature",e)),t.recoveryParam=1-t.v%2,t.recoveryParam&&(r[32]|=128),t._vs=Di(r.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 r=Pi(Ii(t._vs),32);t._vs=Di(r);const n=r[0]>=128?1:0;null==t.recoveryParam?t.recoveryParam=n:t.recoveryParam!==n&&Ai.throwArgumentError("signature recoveryParam mismatch _vs","signature",e),r[0]&=127;const i=Di(r);null==t.s?t.s=i:t.s!==i&&Ai.throwArgumentError("signature v mismatch _vs","signature",e)}if(null==t.recoveryParam)null==t.v?Ai.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 r=0===t.v||1===t.v?t.v:1-t.v%2;t.recoveryParam!==r&&Ai.throwArgumentError("signature recoveryParam mismatch v","signature",e)}null!=t.r&&Mi(t.r)?t.r=zi(t.r,32):Ai.throwArgumentError("signature missing or invalid r","signature",e),null!=t.s&&Mi(t.s)?t.s=zi(t.s,32):Ai.throwArgumentError("signature missing or invalid s","signature",e);const r=Ii(t.s);r[0]>=128&&Ai.throwArgumentError("signature s out of range","signature",e),t.recoveryParam&&(r[0]|=128);const n=Di(r);t._vs&&(Mi(t._vs)||Ai.throwArgumentError("signature invalid _vs","signature",e),t._vs=zi(t._vs,32)),null==t._vs?t._vs=n:t._vs!==n&&Ai.throwArgumentError("signature _vs mismatch v and s","signature",e)}return t.yParityAndS=t._vs,t.compact=t.r+t.yParityAndS.substring(2),t}function Vi(e){return Di(Ci([(e=Hi(e)).r,e.s,e.recoveryParam?"0x1c":"0x1b"]))}var Gi=Object.freeze({__proto__:null,arrayify:Ii,concat:Ci,hexConcat:Ui,hexDataLength:Fi,hexDataSlice:Li,hexStripZeros:qi,hexValue:ji,hexZeroPad:zi,hexlify:Di,isBytes:xi,isBytesLike:Oi,isHexString:Mi,joinSignature:Vi,splitSignature:Hi,stripZeros:Ni,zeroPad:Pi});const Wi="bignumber/5.7.0";var Ki=di.BN;const Xi=new Ei(Wi),$i={},Ji=9007199254740991;let Yi=!1,Qi=class e{constructor(e,t){e!==$i&&Xi.throwError("cannot call constructor directly; use BigNumber.from",Ei.errors.UNSUPPORTED_OPERATION,{operation:"new (BigNumber)"}),this._hex=t,this._isBigNumber=!0,Object.freeze(this)}fromTwos(e){return ea(ta(this).fromTwos(e))}toTwos(e){return ea(ta(this).toTwos(e))}abs(){return"-"===this._hex[0]?e.from(this._hex.substring(1)):this}add(e){return ea(ta(this).add(ta(e)))}sub(e){return ea(ta(this).sub(ta(e)))}div(t){return e.from(t).isZero()&&ra("division-by-zero","div"),ea(ta(this).div(ta(t)))}mul(e){return ea(ta(this).mul(ta(e)))}mod(e){const t=ta(e);return t.isNeg()&&ra("division-by-zero","mod"),ea(ta(this).umod(t))}pow(e){const t=ta(e);return t.isNeg()&&ra("negative-power","pow"),ea(ta(this).pow(t))}and(e){const t=ta(e);return(this.isNegative()||t.isNeg())&&ra("unbound-bitwise-result","and"),ea(ta(this).and(t))}or(e){const t=ta(e);return(this.isNegative()||t.isNeg())&&ra("unbound-bitwise-result","or"),ea(ta(this).or(t))}xor(e){const t=ta(e);return(this.isNegative()||t.isNeg())&&ra("unbound-bitwise-result","xor"),ea(ta(this).xor(t))}mask(e){return(this.isNegative()||e<0)&&ra("negative-width","mask"),ea(ta(this).maskn(e))}shl(e){return(this.isNegative()||e<0)&&ra("negative-width","shl"),ea(ta(this).shln(e))}shr(e){return(this.isNegative()||e<0)&&ra("negative-width","shr"),ea(ta(this).shrn(e))}eq(e){return ta(this).eq(ta(e))}lt(e){return ta(this).lt(ta(e))}lte(e){return ta(this).lte(ta(e))}gt(e){return ta(this).gt(ta(e))}gte(e){return ta(this).gte(ta(e))}isNegative(){return"-"===this._hex[0]}isZero(){return ta(this).isZero()}toNumber(){try{return ta(this).toNumber()}catch(e){ra("overflow","toNumber",this.toString())}return null}toBigInt(){try{return BigInt(this.toString())}catch(e){}return Xi.throwError("this platform does not support BigInt",Ei.errors.UNSUPPORTED_OPERATION,{value:this.toString()})}toString(){return arguments.length>0&&(10===arguments[0]?Yi||(Yi=!0,Xi.warn("BigNumber.toString does not accept any parameters; base-10 is assumed")):16===arguments[0]?Xi.throwError("BigNumber.toString does not accept any parameters; use bigNumber.toHexString()",Ei.errors.UNEXPECTED_ARGUMENT,{}):Xi.throwError("BigNumber.toString does not accept parameters",Ei.errors.UNEXPECTED_ARGUMENT,{})),ta(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($i,Zi(t)):t.match(/^-?[0-9]+$/)?new e($i,Zi(new Ki(t))):Xi.throwArgumentError("invalid BigNumber string","value",t);if("number"==typeof t)return t%1&&ra("underflow","BigNumber.from",t),(t>=Ji||t<=-Ji)&&ra("overflow","BigNumber.from",t),e.from(String(t));const r=t;if("bigint"==typeof r)return e.from(r.toString());if(xi(r))return e.from(Di(r));if(r)if(r.toHexString){const t=r.toHexString();if("string"==typeof t)return e.from(t)}else{let t=r._hex;if(null==t&&"BigNumber"===r.type&&(t=r.hex),"string"==typeof t&&(Mi(t)||"-"===t[0]&&Mi(t.substring(1))))return e.from(t)}return Xi.throwArgumentError("invalid BigNumber value","value",t)}static isBigNumber(e){return!(!e||!e._isBigNumber)}};function Zi(e){if("string"!=typeof e)return Zi(e.toString(16));if("-"===e[0])return"-"===(e=e.substring(1))[0]&&Xi.throwArgumentError("invalid hex","value",e),"0x00"===(e=Zi(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 ea(e){return Qi.from(Zi(e))}function ta(e){const t=Qi.from(e).toHexString();return"-"===t[0]?new Ki("-"+t.substring(3),16):new Ki(t.substring(2),16)}function ra(e,t,r){const n={fault:e,operation:t};return null!=r&&(n.value=r),Xi.throwError(e,Ei.errors.NUMERIC_FAULT,n)}const na=new Ei(Wi),ia={},aa=Qi.from(0),oa=Qi.from(-1);function sa(e,t,r,n){const i={fault:t,operation:r};return void 0!==n&&(i.value=n),na.throwError(e,Ei.errors.NUMERIC_FAULT,i)}let ua="0";for(;ua.length<256;)ua+=ua;function fa(e){if("number"!=typeof e)try{e=Qi.from(e).toNumber()}catch(e){}return"number"==typeof e&&e>=0&&e<=256&&!(e%1)?"1"+ua.substring(0,e):na.throwArgumentError("invalid decimal size","decimals",e)}function ca(e,t){null==t&&(t=0);const r=fa(t),n=(e=Qi.from(e)).lt(aa);n&&(e=e.mul(oa));let i=e.mod(r).toString();for(;i.length<r.length-1;)i="0"+i;i=i.match(/^([0-9]*[1-9]|0)(0*)/)[1];const a=e.div(r).toString();return e=1===r.length?a:a+"."+i,n&&(e="-"+e),e}function la(e,t){null==t&&(t=0);const r=fa(t);"string"==typeof e&&e.match(/^-?[0-9.]+$/)||na.throwArgumentError("invalid decimal value","value",e);const n="-"===e.substring(0,1);n&&(e=e.substring(1)),"."===e&&na.throwArgumentError("missing value","value",e);const i=e.split(".");i.length>2&&na.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>r.length-1&&sa("fractional component exceeds decimals","underflow","parseFixed"),""===o&&(o="0");o.length<r.length-1;)o+="0";const s=Qi.from(a),u=Qi.from(o);let f=s.mul(r).add(u);return n&&(f=f.mul(oa)),f}class da{constructor(e,t,r,n){e!==ia&&na.throwError("cannot use FixedFormat constructor; use FixedFormat.from",Ei.errors.UNSUPPORTED_OPERATION,{operation:"new FixedFormat"}),this.signed=t,this.width=r,this.decimals=n,this.name=(t?"":"u")+"fixed"+String(r)+"x"+String(n),this._multiplier=fa(n),Object.freeze(this)}static from(e){if(e instanceof da)return e;"number"==typeof e&&(e=`fixed128x${e}`);let t=!0,r=128,n=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||na.throwArgumentError("invalid fixed format","format",e),t="u"!==i[1],r=parseInt(i[2]),n=parseInt(i[3])}else if(e){const i=(t,r,n)=>null==e[t]?n:(typeof e[t]!==r&&na.throwArgumentError("invalid fixed format ("+t+" not "+r+")","format."+t,e[t]),e[t]);t=i("signed","boolean",t),r=i("width","number",r),n=i("decimals","number",n)}return r%8&&na.throwArgumentError("invalid fixed format width (not byte aligned)","format.width",r),n>80&&na.throwArgumentError("invalid fixed format (decimals too large)","format.decimals",n),new da(ia,t,r,n)}}class pa{constructor(e,t,r,n){e!==ia&&na.throwError("cannot use FixedNumber constructor; use FixedNumber.from",Ei.errors.UNSUPPORTED_OPERATION,{operation:"new FixedFormat"}),this.format=n,this._hex=t,this._value=r,this._isFixedNumber=!0,Object.freeze(this)}_checkFormat(e){this.format.name!==e.format.name&&na.throwArgumentError("incompatible format; use fixedNumber.toFormat","other",e)}addUnsafe(e){this._checkFormat(e);const t=la(this._value,this.format.decimals),r=la(e._value,e.format.decimals);return pa.fromValue(t.add(r),this.format.decimals,this.format)}subUnsafe(e){this._checkFormat(e);const t=la(this._value,this.format.decimals),r=la(e._value,e.format.decimals);return pa.fromValue(t.sub(r),this.format.decimals,this.format)}mulUnsafe(e){this._checkFormat(e);const t=la(this._value,this.format.decimals),r=la(e._value,e.format.decimals);return pa.fromValue(t.mul(r).div(this.format._multiplier),this.format.decimals,this.format)}divUnsafe(e){this._checkFormat(e);const t=la(this._value,this.format.decimals),r=la(e._value,e.format.decimals);return pa.fromValue(t.mul(this.format._multiplier).div(r),this.format.decimals,this.format)}floor(){const e=this.toString().split(".");1===e.length&&e.push("0");let t=pa.from(e[0],this.format);const r=!e[1].match(/^(0*)$/);return this.isNegative()&&r&&(t=t.subUnsafe(ha.toFormat(t.format))),t}ceiling(){const e=this.toString().split(".");1===e.length&&e.push("0");let t=pa.from(e[0],this.format);const r=!e[1].match(/^(0*)$/);return!this.isNegative()&&r&&(t=t.addUnsafe(ha.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)&&na.throwArgumentError("invalid decimal count","decimals",e),t[1].length<=e)return this;const r=pa.from("1"+ua.substring(0,e),this.format),n=ma.toFormat(this.format);return this.mulUnsafe(r).addUnsafe(n).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&&na.throwArgumentError("invalid byte width","width",e);return zi(Qi.from(this._hex).fromTwos(this.format.width).toTwos(e).toHexString(),e/8)}toUnsafeFloat(){return parseFloat(this.toString())}toFormat(e){return pa.fromString(this._value,e)}static fromValue(e,t,r){return null!=r||null==t||function(e){return null!=e&&(Qi.isBigNumber(e)||"number"==typeof e&&e%1==0||"string"==typeof e&&!!e.match(/^-?[0-9]+$/)||Mi(e)||"bigint"==typeof e||xi(e))}(t)||(r=t,t=null),null==t&&(t=0),null==r&&(r="fixed"),pa.fromString(ca(e,t),da.from(r))}static fromString(e,t){null==t&&(t="fixed");const r=da.from(t),n=la(e,r.decimals);!r.signed&&n.lt(aa)&&sa("unsigned value cannot be negative","overflow","value",e);let i=null;r.signed?i=n.toTwos(r.width).toHexString():(i=n.toHexString(),i=zi(i,r.width/8));const a=ca(n,r.decimals);return new pa(ia,i,a,r)}static fromBytes(e,t){null==t&&(t="fixed");const r=da.from(t);if(Ii(e).length>r.width/8)throw new Error("overflow");let n=Qi.from(e);r.signed&&(n=n.fromTwos(r.width));const i=n.toTwos((r.signed?0:1)+r.width).toHexString(),a=ca(n,r.decimals);return new pa(ia,i,a,r)}static from(e,t){if("string"==typeof e)return pa.fromString(e,t);if(xi(e))return pa.fromBytes(e,t);try{return pa.fromValue(e,0,t)}catch(e){if(e.code!==Ei.errors.INVALID_ARGUMENT)throw e}return na.throwArgumentError("invalid FixedNumber value","value",e)}static isFixedNumber(e){return!(!e||!e._isFixedNumber)}}const ha=pa.from(1),ma=pa.from("0.5");var ya=function(e,t,r,n){return new(r||(r=Promise))((function(i,a){function o(e){try{u(n.next(e))}catch(e){a(e)}}function s(e){try{u(n.throw(e))}catch(e){a(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(o,s)}u((n=n.apply(e,t||[])).next())}))};const ba=new Ei("properties/5.7.0");function ga(e,t,r){Object.defineProperty(e,t,{enumerable:!0,value:r,writable:!1})}function va(e,t){for(let r=0;r<32;r++){if(e[t])return e[t];if(!e.prototype||"object"!=typeof e.prototype)break;e=Object.getPrototypeOf(e.prototype).constructor}return null}function wa(e){return ya(this,void 0,void 0,(function*(){const t=Object.keys(e).map((t=>{const r=e[t];return Promise.resolve(r).then((e=>({key:t,value:e})))}));return(yield Promise.all(t)).reduce(((e,t)=>(e[t.key]=t.value,e)),{})}))}function _a(e,t){e&&"object"==typeof e||ba.throwArgumentError("invalid object","object",e),Object.keys(e).forEach((r=>{t[r]||ba.throwArgumentError("invalid object key - "+r,"transaction:"+r,e)}))}function Ea(e){const t={};for(const r in e)t[r]=e[r];return t}const Ta={bigint:!0,boolean:!0,function:!0,number:!0,string:!0};function Aa(e){if(null==e||Ta[typeof e])return!0;if(Array.isArray(e)||"object"==typeof e){if(!Object.isFrozen(e))return!1;const t=Object.keys(e);for(let r=0;r<t.length;r++){let n=null;try{n=e[t[r]]}catch(e){continue}if(!Aa(n))return!1}return!0}return ba.throwArgumentError("Cannot deepCopy "+typeof e,"object",e)}function Sa(e){if(Aa(e))return e;if(Array.isArray(e))return Object.freeze(e.map((e=>ka(e))));if("object"==typeof e){const t={};for(const r in e){const n=e[r];void 0!==n&&ga(t,r,ka(n))}return t}return ba.throwArgumentError("Cannot deepCopy "+typeof e,"object",e)}function ka(e){return Sa(e)}let Oa=class{constructor(e){for(const t in e)this[t]=ka(e[t])}};var Ra=Object.freeze({__proto__:null,Description:Oa,checkProperties:_a,deepCopy:ka,defineReadOnly:ga,getStatic:va,resolveProperties:wa,shallowCopy:Ea});const xa="abi/5.7.0",Ia=new Ei(xa),Ca={};let Na={calldata:!0,memory:!0,storage:!0},Pa={calldata:!0,memory:!0};function Ma(e,t){if("bytes"===e||"string"===e){if(Na[t])return!0}else if("address"===e){if("payable"===t)return!0}else if((e.indexOf("[")>=0||"tuple"===e)&&Pa[t])return!0;return(Na[t]||"payable"===t)&&Ia.throwArgumentError("invalid modifier","name",t),!1}function Ba(e,t){for(let r in t)ga(e,r,t[r])}const Da=Object.freeze({sighash:"sighash",minimal:"minimal",full:"full",json:"json"}),Fa=new RegExp(/^(.*)\[([0-9]*)\]$/);let La=class e{constructor(t,r){t!==Ca&&Ia.throwError("use fromString",Ei.errors.UNSUPPORTED_OPERATION,{operation:"new ParamType()"}),Ba(this,r);let n=this.type.match(Fa);Ba(this,n?{arrayLength:parseInt(n[2]||"-1"),arrayChildren:e.fromObject({type:n[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=Da.sighash),Da[e]||Ia.throwArgumentError("invalid format type","format",e),e===Da.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!==Da.sighash&&(t+=this.type),t+="("+this.components.map((t=>t.format(e))).join(e===Da.full?", ":",")+")"):t+=this.type,e!==Da.sighash&&(!0===this.indexed&&(t+=" indexed"),e===Da.full&&this.name&&(t+=" "+this.name)),t}static from(t,r){return"string"==typeof t?e.fromString(t,r):e.fromObject(t)}static fromObject(t){return e.isParamType(t)?t:new e(Ca,{name:t.name||null,type:$a(t.type),indexed:null==t.indexed?null:!!t.indexed,components:t.components?t.components.map(e.fromObject):null})}static fromString(t,r){return n=function(e,t){let r=e;function n(t){Ia.throwArgumentError(`unexpected character at position ${t}`,"param",e)}function i(e){let r={type:"",name:"",parent:e,state:{allowType:!0}};return t&&(r.indexed=!1),r}e=e.replace(/\s/g," ");let a={type:"",name:"",state:{allowType:!0}},o=a;for(let r=0;r<e.length;r++){let a=e[r];switch(a){case"(":o.state.allowType&&""===o.type?o.type="tuple":o.state.allowParams||n(r),o.state.allowType=!1,o.type=$a(o.type),o.components=[i(o)],o=o.components[0];break;case")":delete o.state,"indexed"===o.name&&(t||n(r),o.indexed=!0,o.name=""),Ma(o.type,o.name)&&(o.name=""),o.type=$a(o.type);let e=o;o=o.parent,o||n(r),delete e.parent,o.state.allowParams=!1,o.state.allowName=!0,o.state.allowArray=!0;break;case",":delete o.state,"indexed"===o.name&&(t||n(r),o.indexed=!0,o.name=""),Ma(o.type,o.name)&&(o.name=""),o.type=$a(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=$a(o.type),delete o.state.allowType,o.state.allowName=!0,o.state.allowParams=!0),o.state.allowName&&""!==o.name&&("indexed"===o.name?(t||n(r),o.indexed&&n(r),o.indexed=!0,o.name=""):Ma(o.type,o.name)?o.name="":o.state.allowName=!1);break;case"[":o.state.allowArray||n(r),o.type+=a,o.state.allowArray=!1,o.state.allowName=!1,o.state.readArray=!0;break;case"]":o.state.readArray||n(r),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:n(r)}}return o.parent&&Ia.throwArgumentError("unexpected eof","param",e),delete a.state,"indexed"===o.name?(t||n(r.length-7),o.indexed&&n(r.length-7),o.indexed=!0,o.name=""):Ma(o.type,o.name)&&(o.name=""),a.type=$a(a.type),a}(t,!!r),e.fromObject({name:n.name,type:n.type,indexed:n.indexed,components:n.components});var n}static isParamType(e){return!(null==e||!e._isParamType)}};function Ua(e,t){return function(e){e=e.trim();let t=[],r="",n=0;for(let i=0;i<e.length;i++){let a=e[i];","===a&&0===n?(t.push(r),r=""):(r+=a,"("===a?n++:")"===a&&(n--,-1===n&&Ia.throwArgumentError("unbalanced parenthesis","value",e)))}r&&t.push(r);return t}(e).map((e=>La.fromString(e,t)))}let ja=class e{constructor(e,t){e!==Ca&&Ia.throwError("use a static from method",Ei.errors.UNSUPPORTED_OPERATION,{operation:"new Fragment()"}),Ba(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 Wa.fromObject(t);case"event":return qa.fromObject(t);case"constructor":return Ga.fromObject(t);case"error":return Xa.fromObject(t);case"fallback":case"receive":return null}return Ia.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]?qa.fromString(e.substring(5).trim()):"function"===e.split(" ")[0]?Wa.fromString(e.substring(8).trim()):"constructor"===e.split("(")[0].trim()?Ga.fromString(e.trim()):"error"===e.split(" ")[0]?Xa.fromString(e.substring(5).trim()):Ia.throwArgumentError("unsupported fragment","value",e)}static isFragment(e){return!(!e||!e._isFragment)}},qa=class e extends ja{format(e){if(e||(e=Da.sighash),Da[e]||Ia.throwArgumentError("invalid format type","format",e),e===Da.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!==Da.sighash&&(t+="event "),t+=this.name+"("+this.inputs.map((t=>t.format(e))).join(e===Da.full?", ":",")+") ",e!==Da.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&&Ia.throwArgumentError("invalid event object","value",t);const r={name:Ya(t.name),anonymous:t.anonymous,inputs:t.inputs?t.inputs.map(La.fromObject):[],type:"event"};return new e(Ca,r)}static fromString(t){let r=t.match(Qa);r||Ia.throwArgumentError("invalid event string","value",t);let n=!1;return r[3].split(" ").forEach((e=>{switch(e.trim()){case"anonymous":n=!0;break;case"":break;default:Ia.warn("unknown modifier: "+e)}})),e.fromObject({name:r[1].trim(),anonymous:n,inputs:Ua(r[2],!0),type:"event"})}static isEventFragment(e){return e&&e._isFragment&&"event"===e.type}};function za(e,t){t.gas=null;let r=e.split("@");return 1!==r.length?(r.length>2&&Ia.throwArgumentError("invalid human-readable ABI signature","value",e),r[1].match(/^[0-9]+$/)||Ia.throwArgumentError("invalid human-readable ABI signature gas","value",e),t.gas=Qi.from(r[1]),r[0]):e}function Ha(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 Va(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&&Ia.throwArgumentError("cannot have constant function with mutability "+t.stateMutability,"value",e),t.payable="payable"===t.stateMutability,null!=e.payable&&!!e.payable!==t.payable&&Ia.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||Ia.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&&Ia.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&&Ia.throwArgumentError("unable to determine stateMutability","value",e),t}let Ga=class e extends ja{format(e){if(e||(e=Da.sighash),Da[e]||Ia.throwArgumentError("invalid format type","format",e),e===Da.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===Da.sighash&&Ia.throwError("cannot format a constructor for sighash",Ei.errors.UNSUPPORTED_OPERATION,{operation:"format(sighash)"});let t="constructor("+this.inputs.map((t=>t.format(e))).join(e===Da.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&&Ia.throwArgumentError("invalid constructor object","value",t);let r=Va(t);r.constant&&Ia.throwArgumentError("constructor cannot be constant","value",t);const n={name:null,type:t.type,inputs:t.inputs?t.inputs.map(La.fromObject):[],payable:r.payable,stateMutability:r.stateMutability,gas:t.gas?Qi.from(t.gas):null};return new e(Ca,n)}static fromString(t){let r={type:"constructor"},n=(t=za(t,r)).match(Qa);return n&&"constructor"===n[1].trim()||Ia.throwArgumentError("invalid constructor string","value",t),r.inputs=Ua(n[2].trim(),!1),Ha(n[3].trim(),r),e.fromObject(r)}static isConstructorFragment(e){return e&&e._isFragment&&"constructor"===e.type}},Wa=class e extends Ga{format(e){if(e||(e=Da.sighash),Da[e]||Ia.throwArgumentError("invalid format type","format",e),e===Da.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!==Da.sighash&&(t+="function "),t+=this.name+"("+this.inputs.map((t=>t.format(e))).join(e===Da.full?", ":",")+") ",e!==Da.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&&Ia.throwArgumentError("invalid function object","value",t);let r=Va(t);const n={type:t.type,name:Ya(t.name),constant:r.constant,inputs:t.inputs?t.inputs.map(La.fromObject):[],outputs:t.outputs?t.outputs.map(La.fromObject):[],payable:r.payable,stateMutability:r.stateMutability,gas:t.gas?Qi.from(t.gas):null};return new e(Ca,n)}static fromString(t){let r={type:"function"},n=(t=za(t,r)).split(" returns ");n.length>2&&Ia.throwArgumentError("invalid function string","value",t);let i=n[0].match(Qa);if(i||Ia.throwArgumentError("invalid function signature","value",t),r.name=i[1].trim(),r.name&&Ya(r.name),r.inputs=Ua(i[2],!1),Ha(i[3].trim(),r),n.length>1){let e=n[1].match(Qa);""==e[1].trim()&&""==e[3].trim()||Ia.throwArgumentError("unexpected tokens","value",t),r.outputs=Ua(e[2],!1)}else r.outputs=[];return e.fromObject(r)}static isFunctionFragment(e){return e&&e._isFragment&&"function"===e.type}};function Ka(e){const t=e.format();return"Error(string)"!==t&&"Panic(uint256)"!==t||Ia.throwArgumentError(`cannot specify user defined ${t} error`,"fragment",e),e}let Xa=class e extends ja{format(e){if(e||(e=Da.sighash),Da[e]||Ia.throwArgumentError("invalid format type","format",e),e===Da.json)return JSON.stringify({type:"error",name:this.name,inputs:this.inputs.map((t=>JSON.parse(t.format(e))))});let t="";return e!==Da.sighash&&(t+="error "),t+=this.name+"("+this.inputs.map((t=>t.format(e))).join(e===Da.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&&Ia.throwArgumentError("invalid error object","value",t);const r={type:t.type,name:Ya(t.name),inputs:t.inputs?t.inputs.map(La.fromObject):[]};return Ka(new e(Ca,r))}static fromString(t){let r={type:"error"},n=t.match(Qa);return n||Ia.throwArgumentError("invalid error signature","value",t),r.name=n[1].trim(),r.name&&Ya(r.name),r.inputs=Ua(n[2],!1),Ka(e.fromObject(r))}static isErrorFragment(e){return e&&e._isFragment&&"error"===e.type}};function $a(e){return e.match(/^uint($|[^1-9])/)?e="uint256"+e.substring(4):e.match(/^int($|[^1-9])/)&&(e="int256"+e.substring(3)),e}const Ja=new RegExp("^[a-zA-Z$_][a-zA-Z0-9$_]*$");function Ya(e){return e&&e.match(Ja)||Ia.throwArgumentError(`invalid identifier "${e}"`,"value",e),e}const Qa=new RegExp("^([^)(]*)\\((.*)\\)([^)(]*)$");const Za=new Ei(xa);function eo(e){const t=[],r=function(e,n){if(Array.isArray(n))for(let i in n){const a=e.slice();a.push(i);try{r(a,n[i])}catch(e){t.push({path:a,error:e})}}};return r([],e),t}let to=class{constructor(e,t,r,n){this.name=e,this.type=t,this.localName=r,this.dynamic=n}_throwError(e,t){Za.throwArgumentError(e,this.localName,t)}},ro=class{constructor(e){ga(this,"wordSize",e||32),this._data=[],this._dataLength=0,this._padding=new Uint8Array(e)}get data(){return Ui(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(Ci(e._data))}writeBytes(e){let t=Ii(e);const r=t.length%this.wordSize;return r&&(t=Ci([t,this._padding.slice(r)])),this._writeData(t)}_getValue(e){let t=Ii(Qi.from(e));return t.length>this.wordSize&&Za.throwError("value out-of-bounds",Ei.errors.BUFFER_OVERRUN,{length:this.wordSize,offset:t.length}),t.length%this.wordSize&&(t=Ci([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 no={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";e.Environment=void 0,function(e){e.PRODUCTION="production",e.SANDBOX="sandbox"}(e.Environment||(e.Environment={}));class t{environment;apiKey;constructor(e){this.environment=e.environment,this.apiKey=e.apiKey}}function r(e,t){return function(){return e.apply(t,arguments)}}const{toString:n}=Object.prototype,{getPrototypeOf:i}=Object,a=(o=Object.create(null),e=>{const t=n.call(e);return o[t]||(o[t]=t.slice(8,-1).toLowerCase())});var o;const s=e=>(e=e.toLowerCase(),t=>a(t)===e),u=e=>t=>typeof t===e,{isArray:f}=Array,c=u("undefined");const l=s("ArrayBuffer");const d=u("string"),p=u("function"),h=u("number"),m=e=>null!==e&&"object"==typeof e,y=e=>{if("object"!==a(e))return!1;const t=i(e);return!(null!==t&&t!==Object.prototype&&null!==Object.getPrototypeOf(t)||Symbol.toStringTag in e||Symbol.iterator in e)},b=s("Date"),g=s("File"),v=s("Blob"),w=s("FileList"),_=s("URLSearchParams");function E(e,t,{allOwnKeys:r=!1}={}){if(null==e)return;let n,i;if("object"!=typeof e&&(e=[e]),f(e))for(n=0,i=e.length;n<i;n++)t.call(null,e[n],n,e);else{const i=r?Object.getOwnPropertyNames(e):Object.keys(e),a=i.length;let o;for(n=0;n<a;n++)o=i[n],t.call(null,e[o],o,e)}}function T(e,t){t=t.toLowerCase();const r=Object.keys(e);let n,i=r.length;for(;i-- >0;)if(n=r[i],t===n.toLowerCase())return n;return null}const A="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:global,S=e=>!c(e)&&e!==A;const k=(O="undefined"!=typeof Uint8Array&&i(Uint8Array),e=>O&&e instanceof O);var O;const R=s("HTMLFormElement"),x=(({hasOwnProperty:e})=>(t,r)=>e.call(t,r))(Object.prototype),I=s("RegExp"),C=(e,t)=>{const r=Object.getOwnPropertyDescriptors(e),n={};E(r,((r,i)=>{!1!==t(r,i,e)&&(n[i]=r)})),Object.defineProperties(e,n)},N="abcdefghijklmnopqrstuvwxyz",P="0123456789",M={DIGIT:P,ALPHA:N,ALPHA_DIGIT:N+N.toUpperCase()+P};const B=s("AsyncFunction");var D={isArray:f,isArrayBuffer:l,isBuffer:function(e){return null!==e&&!c(e)&&null!==e.constructor&&!c(e.constructor)&&p(e.constructor.isBuffer)&&e.constructor.isBuffer(e)},isFormData:e=>{let t;return e&&("function"==typeof FormData&&e instanceof FormData||p(e.append)&&("formdata"===(t=a(e))||"object"===t&&p(e.toString)&&"[object FormData]"===e.toString()))},isArrayBufferView:function(e){let t;return t="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&l(e.buffer),t},isString:d,isNumber:h,isBoolean:e=>!0===e||!1===e,isObject:m,isPlainObject:y,isUndefined:c,isDate:b,isFile:g,isBlob:v,isRegExp:I,isFunction:p,isStream:e=>m(e)&&p(e.pipe),isURLSearchParams:_,isTypedArray:k,isFileList:w,forEach:E,merge:function e(){const{caseless:t}=S(this)&&this||{},r={},n=(n,i)=>{const a=t&&T(r,i)||i;y(r[a])&&y(n)?r[a]=e(r[a],n):y(n)?r[a]=e({},n):f(n)?r[a]=n.slice():r[a]=n};for(let e=0,t=arguments.length;e<t;e++)arguments[e]&&E(arguments[e],n);return r},extend:(e,t,n,{allOwnKeys:i}={})=>(E(t,((t,i)=>{n&&p(t)?e[i]=r(t,n):e[i]=t}),{allOwnKeys:i}),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,r,n)=>{e.prototype=Object.create(t.prototype,n),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),r&&Object.assign(e.prototype,r)},toFlatObject:(e,t,r,n)=>{let a,o,s;const u={};if(t=t||{},null==e)return t;do{for(a=Object.getOwnPropertyNames(e),o=a.length;o-- >0;)s=a[o],n&&!n(s,e,t)||u[s]||(t[s]=e[s],u[s]=!0);e=!1!==r&&i(e)}while(e&&(!r||r(e,t))&&e!==Object.prototype);return t},kindOf:a,kindOfTest:s,endsWith:(e,t,r)=>{e=String(e),(void 0===r||r>e.length)&&(r=e.length),r-=t.length;const n=e.indexOf(t,r);return-1!==n&&n===r},toArray:e=>{if(!e)return null;if(f(e))return e;let t=e.length;if(!h(t))return null;const r=new Array(t);for(;t-- >0;)r[t]=e[t];return r},forEachEntry:(e,t)=>{const r=(e&&e[Symbol.iterator]).call(e);let n;for(;(n=r.next())&&!n.done;){const r=n.value;t.call(e,r[0],r[1])}},matchAll:(e,t)=>{let r;const n=[];for(;null!==(r=e.exec(t));)n.push(r);return n},isHTMLForm:R,hasOwnProperty:x,hasOwnProp:x,reduceDescriptors:C,freezeMethods:e=>{C(e,((t,r)=>{if(p(e)&&-1!==["arguments","caller","callee"].indexOf(r))return!1;const n=e[r];p(n)&&(t.enumerable=!1,"writable"in t?t.writable=!1:t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+r+"'")}))}))},toObjectSet:(e,t)=>{const r={},n=e=>{e.forEach((e=>{r[e]=!0}))};return f(e)?n(e):n(String(e).split(t)),r},toCamelCase:e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,(function(e,t,r){return t.toUpperCase()+r})),noop:()=>{},toFiniteNumber:(e,t)=>(e=+e,Number.isFinite(e)?e:t),findKey:T,global:A,isContextDefined:S,ALPHABET:M,generateString:(e=16,t=M.ALPHA_DIGIT)=>{let r="";const{length:n}=t;for(;e--;)r+=t[Math.random()*n|0];return r},isSpecCompliantForm:function(e){return!!(e&&p(e.append)&&"FormData"===e[Symbol.toStringTag]&&e[Symbol.iterator])},toJSONObject:e=>{const t=new Array(10),r=(e,n)=>{if(m(e)){if(t.indexOf(e)>=0)return;if(!("toJSON"in e)){t[n]=e;const i=f(e)?[]:{};return E(e,((e,t)=>{const a=r(e,n+1);!c(a)&&(i[t]=a)})),t[n]=void 0,i}}return e};return r(e,0)},isAsyncFn:B,isThenable:e=>e&&(m(e)||p(e))&&p(e.then)&&p(e.catch)};function F(e,t,r,n,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),r&&(this.config=r),n&&(this.request=n),i&&(this.response=i)}D.inherits(F,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:D.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});const L=F.prototype,U={};["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=>{U[e]={value:e}})),Object.defineProperties(F,U),Object.defineProperty(L,"isAxiosError",{value:!0}),F.from=(e,t,r,n,i,a)=>{const o=Object.create(L);return D.toFlatObject(e,o,(function(e){return e!==Error.prototype}),(e=>"isAxiosError"!==e)),F.call(o,e.message,t,r,n,i),o.cause=e,o.name=e.name,a&&Object.assign(o,a),o};function j(e){return D.isPlainObject(e)||D.isArray(e)}function q(e){return D.endsWith(e,"[]")?e.slice(0,-2):e}function z(e,t,r){return e?e.concat(t).map((function(e,t){return e=q(e),!r&&t?"["+e+"]":e})).join(r?".":""):t}const H=D.toFlatObject(D,{},null,(function(e){return/^is[A-Z]/.test(e)}));function V(e,t,r){if(!D.isObject(e))throw new TypeError("target must be an object");t=t||new FormData;const n=(r=D.toFlatObject(r,{metaTokens:!0,dots:!1,indexes:!1},!1,(function(e,t){return!D.isUndefined(t[e])}))).metaTokens,i=r.visitor||f,a=r.dots,o=r.indexes,s=(r.Blob||"undefined"!=typeof Blob&&Blob)&&D.isSpecCompliantForm(t);if(!D.isFunction(i))throw new TypeError("visitor must be a function");function u(e){if(null===e)return"";if(D.isDate(e))return e.toISOString();if(!s&&D.isBlob(e))throw new F("Blob is not supported. Use a Buffer instead.");return D.isArrayBuffer(e)||D.isTypedArray(e)?s&&"function"==typeof Blob?new Blob([e]):Buffer.from(e):e}function f(e,r,i){let s=e;if(e&&!i&&"object"==typeof e)if(D.endsWith(r,"{}"))r=n?r:r.slice(0,-2),e=JSON.stringify(e);else if(D.isArray(e)&&function(e){return D.isArray(e)&&!e.some(j)}(e)||(D.isFileList(e)||D.endsWith(r,"[]"))&&(s=D.toArray(e)))return r=q(r),s.forEach((function(e,n){!D.isUndefined(e)&&null!==e&&t.append(!0===o?z([r],n,a):null===o?r:r+"[]",u(e))})),!1;return!!j(e)||(t.append(z(i,r,a),u(e)),!1)}const c=[],l=Object.assign(H,{defaultVisitor:f,convertValue:u,isVisitable:j});if(!D.isObject(e))throw new TypeError("data must be an object");return function e(r,n){if(!D.isUndefined(r)){if(-1!==c.indexOf(r))throw Error("Circular reference detected in "+n.join("."));c.push(r),D.forEach(r,(function(r,a){!0===(!(D.isUndefined(r)||null===r)&&i.call(t,r,D.isString(a)?a.trim():a,n,l))&&e(r,n?n.concat(a):[a])})),c.pop()}}(e),t}function G(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,(function(e){return t[e]}))}function W(e,t){this._pairs=[],e&&V(e,this,t)}const K=W.prototype;function X(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function $(e,t,r){if(!t)return e;const n=r&&r.encode||X,i=r&&r.serialize;let a;if(a=i?i(t,r):D.isURLSearchParams(t)?t.toString():new W(t,r).toString(n),a){const t=e.indexOf("#");-1!==t&&(e=e.slice(0,t)),e+=(-1===e.indexOf("?")?"?":"&")+a}return e}K.append=function(e,t){this._pairs.push([e,t])},K.toString=function(e){const t=e?function(t){return e.call(this,t,G)}:G;return this._pairs.map((function(e){return t(e[0])+"="+t(e[1])}),"").join("&")};var J=class{constructor(){this.handlers=[]}use(e,t,r){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!r&&r.synchronous,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){D.forEach(this.handlers,(function(t){null!==t&&e(t)}))}},Y={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1};var Q={isBrowser:!0,classes:{URLSearchParams:"undefined"!=typeof URLSearchParams?URLSearchParams:W,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 Z(e){function t(e,r,n,i){let a=e[i++];const o=Number.isFinite(+a),s=i>=e.length;if(a=!a&&D.isArray(n)?n.length:a,s)return D.hasOwnProp(n,a)?n[a]=[n[a],r]:n[a]=r,!o;n[a]&&D.isObject(n[a])||(n[a]=[]);return t(e,r,n[a],i)&&D.isArray(n[a])&&(n[a]=function(e){const t={},r=Object.keys(e);let n;const i=r.length;let a;for(n=0;n<i;n++)a=r[n],t[a]=e[a];return t}(n[a])),!o}if(D.isFormData(e)&&D.isFunction(e.entries)){const r={};return D.forEachEntry(e,((e,n)=>{t(function(e){return D.matchAll(/\w+|\[(\w*)]/g,e).map((e=>"[]"===e[0]?"":e[1]||e[0]))}(e),n,r,0)})),r}return null}const ee={"Content-Type":void 0};const te={transitional:Y,adapter:["xhr","http"],transformRequest:[function(e,t){const r=t.getContentType()||"",n=r.indexOf("application/json")>-1,i=D.isObject(e);i&&D.isHTMLForm(e)&&(e=new FormData(e));if(D.isFormData(e))return n&&n?JSON.stringify(Z(e)):e;if(D.isArrayBuffer(e)||D.isBuffer(e)||D.isStream(e)||D.isFile(e)||D.isBlob(e))return e;if(D.isArrayBufferView(e))return e.buffer;if(D.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let a;if(i){if(r.indexOf("application/x-www-form-urlencoded")>-1)return function(e,t){return V(e,new Q.classes.URLSearchParams,Object.assign({visitor:function(e,t,r,n){return Q.isNode&&D.isBuffer(e)?(this.append(t,e.toString("base64")),!1):n.defaultVisitor.apply(this,arguments)}},t))}(e,this.formSerializer).toString();if((a=D.isFileList(e))||r.indexOf("multipart/form-data")>-1){const t=this.env&&this.env.FormData;return V(a?{"files[]":e}:e,t&&new t,this.formSerializer)}}return i||n?(t.setContentType("application/json",!1),function(e,t,r){if(D.isString(e))try{return(t||JSON.parse)(e),D.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(r||JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){const t=this.transitional||te.transitional,r=t&&t.forcedJSONParsing,n="json"===this.responseType;if(e&&D.isString(e)&&(r&&!this.responseType||n)){const r=!(t&&t.silentJSONParsing)&&n;try{return JSON.parse(e)}catch(e){if(r){if("SyntaxError"===e.name)throw F.from(e,F.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:Q.classes.FormData,Blob:Q.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};D.forEach(["delete","get","head"],(function(e){te.headers[e]={}})),D.forEach(["post","put","patch"],(function(e){te.headers[e]=D.merge(ee)}));var re=te;const ne=D.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 ie=Symbol("internals");function ae(e){return e&&String(e).trim().toLowerCase()}function oe(e){return!1===e||null==e?e:D.isArray(e)?e.map(oe):String(e)}function se(e,t,r,n,i){return D.isFunction(n)?n.call(this,t,r):(i&&(t=r),D.isString(t)?D.isString(n)?-1!==t.indexOf(n):D.isRegExp(n)?n.test(t):void 0:void 0)}let ue=class{constructor(e){e&&this.set(e)}set(e,t,r){const n=this;function i(e,t,r){const i=ae(t);if(!i)throw new Error("header name must be a non-empty string");const a=D.findKey(n,i);(!a||void 0===n[a]||!0===r||void 0===r&&!1!==n[a])&&(n[a||t]=oe(e))}const a=(e,t)=>D.forEach(e,((e,r)=>i(e,r,t)));return D.isPlainObject(e)||e instanceof this.constructor?a(e,t):D.isString(e)&&(e=e.trim())&&!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim())?a((e=>{const t={};let r,n,i;return e&&e.split("\n").forEach((function(e){i=e.indexOf(":"),r=e.substring(0,i).trim().toLowerCase(),n=e.substring(i+1).trim(),!r||t[r]&&ne[r]||("set-cookie"===r?t[r]?t[r].push(n):t[r]=[n]:t[r]=t[r]?t[r]+", "+n:n)})),t})(e),t):null!=e&&i(t,e,r),this}get(e,t){if(e=ae(e)){const r=D.findKey(this,e);if(r){const e=this[r];if(!t)return e;if(!0===t)return function(e){const t=Object.create(null),r=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let n;for(;n=r.exec(e);)t[n[1]]=n[2];return t}(e);if(D.isFunction(t))return t.call(this,e,r);if(D.isRegExp(t))return t.exec(e);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=ae(e)){const r=D.findKey(this,e);return!(!r||void 0===this[r]||t&&!se(0,this[r],r,t))}return!1}delete(e,t){const r=this;let n=!1;function i(e){if(e=ae(e)){const i=D.findKey(r,e);!i||t&&!se(0,r[i],i,t)||(delete r[i],n=!0)}}return D.isArray(e)?e.forEach(i):i(e),n}clear(e){const t=Object.keys(this);let r=t.length,n=!1;for(;r--;){const i=t[r];e&&!se(0,this[i],i,e,!0)||(delete this[i],n=!0)}return n}normalize(e){const t=this,r={};return D.forEach(this,((n,i)=>{const a=D.findKey(r,i);if(a)return t[a]=oe(n),void delete t[i];const o=e?function(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,((e,t,r)=>t.toUpperCase()+r))}(i):String(i).trim();o!==i&&delete t[i],t[o]=oe(n),r[o]=!0})),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const t=Object.create(null);return D.forEach(this,((r,n)=>{null!=r&&!1!==r&&(t[n]=e&&D.isArray(r)?r.join(", "):r)})),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 r=new this(e);return t.forEach((e=>r.set(e))),r}static accessor(e){const t=(this[ie]=this[ie]={accessors:{}}).accessors,r=this.prototype;function n(e){const n=ae(e);t[n]||(!function(e,t){const r=D.toCamelCase(" "+t);["get","set","has"].forEach((n=>{Object.defineProperty(e,n+r,{value:function(e,r,i){return this[n].call(this,t,e,r,i)},configurable:!0})}))}(r,e),t[n]=!0)}return D.isArray(e)?e.forEach(n):n(e),this}};ue.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),D.freezeMethods(ue.prototype),D.freezeMethods(ue);var fe=ue;function ce(e,t){const r=this||re,n=t||r,i=fe.from(n.headers);let a=n.data;return D.forEach(e,(function(e){a=e.call(r,a,i.normalize(),t?t.status:void 0)})),i.normalize(),a}function le(e){return!(!e||!e.__CANCEL__)}function de(e,t,r){F.call(this,null==e?"canceled":e,F.ERR_CANCELED,t,r),this.name="CanceledError"}D.inherits(de,F,{__CANCEL__:!0});var pe=Q.isStandardBrowserEnv?{write:function(e,t,r,n,i,a){const o=[];o.push(e+"="+encodeURIComponent(t)),D.isNumber(r)&&o.push("expires="+new Date(r).toGMTString()),D.isString(n)&&o.push("path="+n),D.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 he(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 me=Q.isStandardBrowserEnv?function(){const e=/(msie|trident)/i.test(navigator.userAgent),t=document.createElement("a");let r;function n(r){let n=r;return e&&(t.setAttribute("href",n),n=t.href),t.setAttribute("href",n),{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 r=n(window.location.href),function(e){const t=D.isString(e)?n(e):e;return t.protocol===r.protocol&&t.host===r.host}}():function(){return!0};function ye(e,t){let r=0;const n=function(e,t){e=e||10;const r=new Array(e),n=new Array(e);let i,a=0,o=0;return t=void 0!==t?t:1e3,function(s){const u=Date.now(),f=n[o];i||(i=u),r[a]=s,n[a]=u;let c=o,l=0;for(;c!==a;)l+=r[c++],c%=e;if(a=(a+1)%e,a===o&&(o=(o+1)%e),u-i<t)return;const d=f&&u-f;return d?Math.round(1e3*l/d):void 0}}(50,250);return i=>{const a=i.loaded,o=i.lengthComputable?i.total:void 0,s=a-r,u=n(s);r=a;const f={loaded:a,total:o,progress:o?a/o:void 0,bytes:s,rate:u||void 0,estimated:u&&o&&a<=o?(o-a)/u:void 0,event:i};f[t?"download":"upload"]=!0,e(f)}}var be="undefined"!=typeof XMLHttpRequest&&function(e){return new Promise((function(t,r){let n=e.data;const i=fe.from(e.headers).normalize(),a=e.responseType;let o;function s(){e.cancelToken&&e.cancelToken.unsubscribe(o),e.signal&&e.signal.removeEventListener("abort",o)}D.isFormData(n)&&(Q.isStandardBrowserEnv||Q.isStandardBrowserWebWorkerEnv?i.setContentType(!1):i.setContentType("multipart/form-data;",!1));let u=new XMLHttpRequest;if(e.auth){const t=e.auth.username||"",r=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";i.set("Authorization","Basic "+btoa(t+":"+r))}const f=he(e.baseURL,e.url);function c(){if(!u)return;const n=fe.from("getAllResponseHeaders"in u&&u.getAllResponseHeaders());!function(e,t,r){const n=r.config.validateStatus;r.status&&n&&!n(r.status)?t(new F("Request failed with status code "+r.status,[F.ERR_BAD_REQUEST,F.ERR_BAD_RESPONSE][Math.floor(r.status/100)-4],r.config,r.request,r)):e(r)}((function(e){t(e),s()}),(function(e){r(e),s()}),{data:a&&"text"!==a&&"json"!==a?u.response:u.responseText,status:u.status,statusText:u.statusText,headers:n,config:e,request:u}),u=null}if(u.open(e.method.toUpperCase(),$(f,e.params,e.paramsSerializer),!0),u.timeout=e.timeout,"onloadend"in u?u.onloadend=c:u.onreadystatechange=function(){u&&4===u.readyState&&(0!==u.status||u.responseURL&&0===u.responseURL.indexOf("file:"))&&setTimeout(c)},u.onabort=function(){u&&(r(new F("Request aborted",F.ECONNABORTED,e,u)),u=null)},u.onerror=function(){r(new F("Network Error",F.ERR_NETWORK,e,u)),u=null},u.ontimeout=function(){let t=e.timeout?"timeout of "+e.timeout+"ms exceeded":"timeout exceeded";const n=e.transitional||Y;e.timeoutErrorMessage&&(t=e.timeoutErrorMessage),r(new F(t,n.clarifyTimeoutError?F.ETIMEDOUT:F.ECONNABORTED,e,u)),u=null},Q.isStandardBrowserEnv){const t=(e.withCredentials||me(f))&&e.xsrfCookieName&&pe.read(e.xsrfCookieName);t&&i.set(e.xsrfHeaderName,t)}void 0===n&&i.setContentType(null),"setRequestHeader"in u&&D.forEach(i.toJSON(),(function(e,t){u.setRequestHeader(t,e)})),D.isUndefined(e.withCredentials)||(u.withCredentials=!!e.withCredentials),a&&"json"!==a&&(u.responseType=e.responseType),"function"==typeof e.onDownloadProgress&&u.addEventListener("progress",ye(e.onDownloadProgress,!0)),"function"==typeof e.onUploadProgress&&u.upload&&u.upload.addEventListener("progress",ye(e.onUploadProgress)),(e.cancelToken||e.signal)&&(o=t=>{u&&(r(!t||t.type?new de(null,e,u):t),u.abort(),u=null)},e.cancelToken&&e.cancelToken.subscribe(o),e.signal&&(e.signal.aborted?o():e.signal.addEventListener("abort",o)));const l=function(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}(f);l&&-1===Q.protocols.indexOf(l)?r(new F("Unsupported protocol "+l+":",F.ERR_BAD_REQUEST,e)):u.send(n||null)}))};const ge={http:null,xhr:be};D.forEach(ge,((e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch(e){}Object.defineProperty(e,"adapterName",{value:t})}}));var ve=e=>{e=D.isArray(e)?e:[e];const{length:t}=e;let r,n;for(let i=0;i<t&&(r=e[i],!(n=D.isString(r)?ge[r.toLowerCase()]:r));i++);if(!n){if(!1===n)throw new F(`Adapter ${r} is not supported by the environment`,"ERR_NOT_SUPPORT");throw new Error(D.hasOwnProp(ge,r)?`Adapter '${r}' is not available in the build`:`Unknown adapter '${r}'`)}if(!D.isFunction(n))throw new TypeError("adapter is not a function");return n};function we(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new de(null,e)}function _e(e){we(e),e.headers=fe.from(e.headers),e.data=ce.call(e,e.transformRequest),-1!==["post","put","patch"].indexOf(e.method)&&e.headers.setContentType("application/x-www-form-urlencoded",!1);return ve(e.adapter||re.adapter)(e).then((function(t){return we(e),t.data=ce.call(e,e.transformResponse,t),t.headers=fe.from(t.headers),t}),(function(t){return le(t)||(we(e),t&&t.response&&(t.response.data=ce.call(e,e.transformResponse,t.response),t.response.headers=fe.from(t.response.headers))),Promise.reject(t)}))}const Ee=e=>e instanceof fe?e.toJSON():e;function Te(e,t){t=t||{};const r={};function n(e,t,r){return D.isPlainObject(e)&&D.isPlainObject(t)?D.merge.call({caseless:r},e,t):D.isPlainObject(t)?D.merge({},t):D.isArray(t)?t.slice():t}function i(e,t,r){return D.isUndefined(t)?D.isUndefined(e)?void 0:n(void 0,e,r):n(e,t,r)}function a(e,t){if(!D.isUndefined(t))return n(void 0,t)}function o(e,t){return D.isUndefined(t)?D.isUndefined(e)?void 0:n(void 0,e):n(void 0,t)}function s(r,i,a){return a in t?n(r,i):a in e?n(void 0,r):void 0}const u={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(Ee(e),Ee(t),!0)};return D.forEach(Object.keys(Object.assign({},e,t)),(function(n){const a=u[n]||i,o=a(e[n],t[n],n);D.isUndefined(o)&&a!==s||(r[n]=o)})),r}const Ae="1.4.0",Se={};["object","boolean","number","function","string","symbol"].forEach(((e,t)=>{Se[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}}));const ke={};Se.transitional=function(e,t,r){function n(e,t){return"[Axios v1.4.0] Transitional option '"+e+"'"+t+(r?". "+r:"")}return(r,i,a)=>{if(!1===e)throw new F(n(i," has been removed"+(t?" in "+t:"")),F.ERR_DEPRECATED);return t&&!ke[i]&&(ke[i]=!0,console.warn(n(i," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(r,i,a)}};var Oe={assertOptions:function(e,t,r){if("object"!=typeof e)throw new F("options must be an object",F.ERR_BAD_OPTION_VALUE);const n=Object.keys(e);let i=n.length;for(;i-- >0;){const a=n[i],o=t[a];if(o){const t=e[a],r=void 0===t||o(t,a,e);if(!0!==r)throw new F("option "+a+" must be "+r,F.ERR_BAD_OPTION_VALUE)}else if(!0!==r)throw new F("Unknown option "+a,F.ERR_BAD_OPTION)}},validators:Se};const Re=Oe.validators;let xe=class{constructor(e){this.defaults=e,this.interceptors={request:new J,response:new J}}request(e,t){"string"==typeof e?(t=t||{}).url=e:t=e||{},t=Te(this.defaults,t);const{transitional:r,paramsSerializer:n,headers:i}=t;let a;void 0!==r&&Oe.assertOptions(r,{silentJSONParsing:Re.transitional(Re.boolean),forcedJSONParsing:Re.transitional(Re.boolean),clarifyTimeoutError:Re.transitional(Re.boolean)},!1),null!=n&&(D.isFunction(n)?t.paramsSerializer={serialize:n}:Oe.assertOptions(n,{encode:Re.function,serialize:Re.function},!0)),t.method=(t.method||this.defaults.method||"get").toLowerCase(),a=i&&D.merge(i.common,i[t.method]),a&&D.forEach(["delete","get","head","post","put","patch","common"],(e=>{delete i[e]})),t.headers=fe.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 u=[];let f;this.interceptors.response.forEach((function(e){u.push(e.fulfilled,e.rejected)}));let c,l=0;if(!s){const e=[_e.bind(this),void 0];for(e.unshift.apply(e,o),e.push.apply(e,u),c=e.length,f=Promise.resolve(t);l<c;)f=f.then(e[l++],e[l++]);return f}c=o.length;let d=t;for(l=0;l<c;){const e=o[l++],t=o[l++];try{d=e(d)}catch(e){t.call(this,e);break}}try{f=_e.call(this,d)}catch(e){return Promise.reject(e)}for(l=0,c=u.length;l<c;)f=f.then(u[l++],u[l++]);return f}getUri(e){return $(he((e=Te(this.defaults,e)).baseURL,e.url),e.params,e.paramsSerializer)}};D.forEach(["delete","get","head","options"],(function(e){xe.prototype[e]=function(t,r){return this.request(Te(r||{},{method:e,url:t,data:(r||{}).data}))}})),D.forEach(["post","put","patch"],(function(e){function t(t){return function(r,n,i){return this.request(Te(i||{},{method:e,headers:t?{"Content-Type":"multipart/form-data"}:{},url:r,data:n}))}}xe.prototype[e]=t(),xe.prototype[e+"Form"]=t(!0)}));var Ie=xe;var Ce=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 r=this;this.promise.then((e=>{if(!r._listeners)return;let t=r._listeners.length;for(;t-- >0;)r._listeners[t](e);r._listeners=null})),this.promise.then=e=>{let t;const n=new Promise((e=>{r.subscribe(e),t=e})).then(e);return n.cancel=function(){r.unsubscribe(t)},n},e((function(e,n,i){r.reason||(r.reason=new de(e,n,i),t(r.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 r=new e((function(e){t=e}));return{token:r,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 Pe=Ne;const Me=function e(t){const n=new Ie(t),i=r(Ie.prototype.request,n);return D.extend(i,Ie.prototype,n,{allOwnKeys:!0}),D.extend(i,n,null,{allOwnKeys:!0}),i.create=function(r){return e(Te(t,r))},i}(re);Me.Axios=Ie,Me.CanceledError=de,Me.CancelToken=Ce,Me.isCancel=le,Me.VERSION=Ae,Me.toFormData=V,Me.AxiosError=F,Me.Cancel=Me.CanceledError,Me.all=function(e){return Promise.all(e)},Me.spread=function(e){return function(t){return e.apply(null,t)}},Me.isAxiosError=function(e){return D.isObject(e)&&!0===e.isAxiosError},Me.mergeConfig=Te,Me.AxiosHeaders=fe,Me.formToJSON=e=>Z(D.isHTMLForm(e)?new FormData(e):e),Me.HttpStatusCode=Pe,Me.default=Me;var Be=Me;const De="https://indexer-mr.sandbox.imtbl.com".replace(/\/+$/,"");let Fe=class{basePath;axios;configuration;constructor(e,t=De,r=Be){this.basePath=t,this.axios=r,e&&(this.configuration=e,this.basePath=e.basePath||this.basePath)}},Le=class extends Error{field;name="RequiredError";constructor(e,t){super(t),this.field=e}};const Ue="https://example.com",je=function(e,t,r){if(null==r)throw new Le(t,`Required parameter ${t} was null or undefined when calling ${e}.`)};function qe(e,t,r=""){"object"==typeof t?Array.isArray(t)?t.forEach((t=>qe(e,t,r))):Object.keys(t).forEach((n=>qe(e,t[n],`${r}${""!==r?".":""}${n}`))):e.has(r)?e.append(r,t):e.set(r,t)}const ze=function(e,...t){const r=new URLSearchParams(e.search);qe(r,t),e.search=r.toString()},He=function(e,t,r){const n="string"!=typeof e;return(n&&r&&r.isJsonMime?r.isJsonMime(t.headers["Content-Type"]):n)?JSON.stringify(void 0!==e?e:{}):e||""},Ve=function(e){return e.pathname+e.search+e.hash},Ge=function(e,t,r,n){return(i=t,a=r)=>{const o={...e.options,url:(n?.basePath||a)+e.url};return i.request(o)}},We=function(e){return{getActivity:async(t,r,n={})=>{je("getActivity","chainName",t),je("getActivity","activityId",r);const i="/v1/chains/{chain_name}/activities/{activity_id}".replace("{chain_name}",encodeURIComponent(String(t))).replace("{activity_id}",encodeURIComponent(String(r))),a=new URL(i,Ue);let o;e&&(o=e.baseOptions);const s={method:"GET",...o,...n};ze(a,{});let u=o&&o.headers?o.headers:{};return s.headers={...u,...n.headers},{url:Ve(a),options:s}},listActivities:async(t,r,n,i,a,o,s,u,f,c,l={})=>{je("listActivities","chainName",t);const d="/v1/chains/{chain_name}/activities".replace("{chain_name}",encodeURIComponent(String(t))),p=new URL(d,Ue);let h;e&&(h=e.baseOptions);const m={method:"GET",...h,...l},y={};void 0!==r&&(y.contract_address=r),void 0!==n&&(y.token_id=n),void 0!==i&&(y.account_address=i),void 0!==a&&(y.activity_type=a),void 0!==o&&(y.from_indexed_at=o instanceof Date?o.toISOString():o),void 0!==s&&(y.to_indexed_at=s instanceof Date?s.toISOString():s),void 0!==u&&(y.transaction_hash=u),void 0!==f&&(y.page_cursor=f),void 0!==c&&(y.page_size=c),ze(p,y);let b=h&&h.headers?h.headers:{};return m.headers={...b,...l.headers},{url:Ve(p),options:m}}}},Ke=function(e){const t=We(e);return{async getActivity(r,n,i){const a=await t.getActivity(r,n,i);return Ge(a,Be,De,e)},async listActivities(r,n,i,a,o,s,u,f,c,l,d){const p=await t.listActivities(r,n,i,a,o,s,u,f,c,l,d);return Ge(p,Be,De,e)}}};class Xe extends Fe{getActivity(e,t){return Ke(this.configuration).getActivity(e.chainName,e.activityId,t).then((e=>e(this.axios,this.basePath)))}listActivities(e,t){return Ke(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 $e=function(e){return{listChains:async(t,r,n={})=>{const i=new URL("/v1/chains",Ue);let a;e&&(a=e.baseOptions);const o={method:"GET",...a,...n},s={};void 0!==t&&(s.page_cursor=t),void 0!==r&&(s.page_size=r),ze(i,s);let u=a&&a.headers?a.headers:{};return o.headers={...u,...n.headers},{url:Ve(i),options:o}}}},Je=function(e){const t=$e(e);return{async listChains(r,n,i){const a=await t.listChains(r,n,i);return Ge(a,Be,De,e)}}};class Ye extends Fe{listChains(e={},t){return Je(this.configuration).listChains(e.pageCursor,e.pageSize,t).then((e=>e(this.axios,this.basePath)))}}const Qe=function(e){return{getCollection:async(t,r,n={})=>{je("getCollection","contractAddress",t),je("getCollection","chainName",r);const i="/v1/chains/{chain_name}/collections/{contract_address}".replace("{contract_address}",encodeURIComponent(String(t))).replace("{chain_name}",encodeURIComponent(String(r))),a=new URL(i,Ue);let o;e&&(o=e.baseOptions);const s={method:"GET",...o,...n};ze(a,{});let u=o&&o.headers?o.headers:{};return s.headers={...u,...n.headers},{url:Ve(a),options:s}},listCollections:async(t,r,n,i={})=>{je("listCollections","chainName",t);const a="/v1/chains/{chain_name}/collections".replace("{chain_name}",encodeURIComponent(String(t))),o=new URL(a,Ue);let s;e&&(s=e.baseOptions);const u={method:"GET",...s,...i},f={};void 0!==r&&(f.page_cursor=r),void 0!==n&&(f.page_size=n),ze(o,f);let c=s&&s.headers?s.headers:{};return u.headers={...c,...i.headers},{url:Ve(o),options:u}}}},Ze=function(e){const t=Qe(e);return{async getCollection(r,n,i){const a=await t.getCollection(r,n,i);return Ge(a,Be,De,e)},async listCollections(r,n,i,a){const o=await t.listCollections(r,n,i,a);return Ge(o,Be,De,e)}}};class et extends Fe{getCollection(e,t){return Ze(this.configuration).getCollection(e.contractAddress,e.chainName,t).then((e=>e(this.axios,this.basePath)))}listCollections(e,t){return Ze(this.configuration).listCollections(e.chainName,e.pageCursor,e.pageSize,t).then((e=>e(this.axios,this.basePath)))}}const tt=function(e){return{listNFTOwners:async(t,r,n,i,a,o={})=>{je("listNFTOwners","contractAddress",t),je("listNFTOwners","tokenId",r),je("listNFTOwners","chainName",n);const s="/v1/chains/{chain_name}/collections/{contract_address}/nfts/{token_id}/owners".replace("{contract_address}",encodeURIComponent(String(t))).replace("{token_id}",encodeURIComponent(String(r))).replace("{chain_name}",encodeURIComponent(String(n))),u=new URL(s,Ue);let f;e&&(f=e.baseOptions);const c={method:"GET",...f,...o},l={};void 0!==i&&(l.page_cursor=i),void 0!==a&&(l.page_size=a),ze(u,l);let d=f&&f.headers?f.headers:{};return c.headers={...d,...o.headers},{url:Ve(u),options:c}}}},rt=function(e){const t=tt(e);return{async listNFTOwners(r,n,i,a,o,s){const u=await t.listNFTOwners(r,n,i,a,o,s);return Ge(u,Be,De,e)}}};class nt extends Fe{listNFTOwners(e,t){return rt(this.configuration).listNFTOwners(e.contractAddress,e.tokenId,e.chainName,e.pageCursor,e.pageSize,t).then((e=>e(this.axios,this.basePath)))}}const it=function(e){return{getNFT:async(t,r,n,i={})=>{je("getNFT","contractAddress",t),je("getNFT","tokenId",r),je("getNFT","chainName",n);const a="/v1/chains/{chain_name}/collections/{contract_address}/nfts/{token_id}".replace("{contract_address}",encodeURIComponent(String(t))).replace("{token_id}",encodeURIComponent(String(r))).replace("{chain_name}",encodeURIComponent(String(n))),o=new URL(a,Ue);let s;e&&(s=e.baseOptions);const u={method:"GET",...s,...i};ze(o,{});let f=s&&s.headers?s.headers:{};return u.headers={...f,...i.headers},{url:Ve(o),options:u}},listNFTs:async(t,r,n,i,a={})=>{je("listNFTs","contractAddress",t),je("listNFTs","chainName",r);const o="/v1/chains/{chain_name}/collections/{contract_address}/nfts".replace("{contract_address}",encodeURIComponent(String(t))).replace("{chain_name}",encodeURIComponent(String(r))),s=new URL(o,Ue);let u;e&&(u=e.baseOptions);const f={method:"GET",...u,...a},c={};void 0!==n&&(c.page_cursor=n),void 0!==i&&(c.page_size=i),ze(s,c);let l=u&&u.headers?u.headers:{};return f.headers={...l,...a.headers},{url:Ve(s),options:f}},listNFTsByAccountAddress:async(t,r,n,i,a,o={})=>{je("listNFTsByAccountAddress","accountAddress",t),je("listNFTsByAccountAddress","chainName",r);const s="/v1/chains/{chain_name}/accounts/{account_address}/nfts".replace("{account_address}",encodeURIComponent(String(t))).replace("{chain_name}",encodeURIComponent(String(r))),u=new URL(s,Ue);let f;e&&(f=e.baseOptions);const c={method:"GET",...f,...o},l={};void 0!==n&&(l.contract_address=n),void 0!==i&&(l.page_cursor=i),void 0!==a&&(l.page_size=a),ze(u,l);let d=f&&f.headers?f.headers:{};return c.headers={...d,...o.headers},{url:Ve(u),options:c}}}},at=function(e){const t=it(e);return{async getNFT(r,n,i,a){const o=await t.getNFT(r,n,i,a);return Ge(o,Be,De,e)},async listNFTs(r,n,i,a,o){const s=await t.listNFTs(r,n,i,a,o);return Ge(s,Be,De,e)},async listNFTsByAccountAddress(r,n,i,a,o,s){const u=await t.listNFTsByAccountAddress(r,n,i,a,o,s);return Ge(u,Be,De,e)}}};class ot extends Fe{getNFT(e,t){return at(this.configuration).getNFT(e.contractAddress,e.tokenId,e.chainName,t).then((e=>e(this.axios,this.basePath)))}listNFTs(e,t){return at(this.configuration).listNFTs(e.contractAddress,e.chainName,e.pageCursor,e.pageSize,t).then((e=>e(this.axios,this.basePath)))}listNFTsByAccountAddress(e,t){return at(this.configuration).listNFTsByAccountAddress(e.accountAddress,e.chainName,e.contractAddress,e.pageCursor,e.pageSize,t).then((e=>e(this.axios,this.basePath)))}}const st=function(e){return{createListing:async(t,r,n={})=>{je("createListing","chainName",t),je("createListing","createListingRequestBody",r);const i="/v1/chains/{chain_name}/orders/listings".replace("{chain_name}",encodeURIComponent(String(t))),a=new URL(i,Ue);let o;e&&(o=e.baseOptions);const s={method:"POST",...o,...n},u={};u["Content-Type"]="application/json",ze(a,{});let f=o&&o.headers?o.headers:{};return s.headers={...u,...f,...n.headers},s.data=He(r,s,e),{url:Ve(a),options:s}},getListing:async(t,r,n={})=>{je("getListing","chainName",t),je("getListing","listingId",r);const i="/v1/chains/{chain_name}/orders/listings/{listing_id}".replace("{chain_name}",encodeURIComponent(String(t))).replace("{listing_id}",encodeURIComponent(String(r))),a=new URL(i,Ue);let o;e&&(o=e.baseOptions);const s={method:"GET",...o,...n};ze(a,{});let u=o&&o.headers?o.headers:{};return s.headers={...u,...n.headers},{url:Ve(a),options:s}},listListings:async(t,r,n,i,a,o,s,u,f,c={})=>{je("listListings","chainName",t);const l="/v1/chains/{chain_name}/orders/listings".replace("{chain_name}",encodeURIComponent(String(t))),d=new URL(l,Ue);let p;e&&(p=e.baseOptions);const h={method:"GET",...p,...c},m={};void 0!==r&&(m.status=r),void 0!==n&&(m.sell_item_contract_address=n),void 0!==i&&(m.buy_item_contract_address=i),void 0!==a&&(m.sell_item_token_id=a),void 0!==o&&(m.page_size=o),void 0!==s&&(m.sort_by=s),void 0!==u&&(m.sort_direction=u),void 0!==f&&(m.page_cursor=f),ze(d,m);let y=p&&p.headers?p.headers:{};return h.headers={...y,...c.headers},{url:Ve(d),options:h}}}},ut=function(e){const t=st(e);return{async createListing(r,n,i){const a=await t.createListing(r,n,i);return Ge(a,Be,De,e)},async getListing(r,n,i){const a=await t.getListing(r,n,i);return Ge(a,Be,De,e)},async listListings(r,n,i,a,o,s,u,f,c,l){const d=await t.listListings(r,n,i,a,o,s,u,f,c,l);return Ge(d,Be,De,e)}}};class ft extends Fe{createListing(e,t){return ut(this.configuration).createListing(e.chainName,e.createListingRequestBody,t).then((e=>e(this.axios,this.basePath)))}getListing(e,t){return ut(this.configuration).getListing(e.chainName,e.listingId,t).then((e=>e(this.axios,this.basePath)))}listListings(e,t){return ut(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)))}}const ct=function(e){return{createCounterfactualAddress:async(t,r={})=>{je("createCounterfactualAddress","createCounterfactualAddressRequest",t);const n=new URL("/passport-mr/v1/counterfactual-address",Ue);let i;e&&(i=e.baseOptions);const a={method:"POST",...i,...r},o={};await async function(e,t){if(t&&t.accessToken){const r="function"==typeof t.accessToken?await t.accessToken():await t.accessToken;e.Authorization="Bearer "+r}}(o,e),o["Content-Type"]="application/json",ze(n,{});let s=i&&i.headers?i.headers:{};return a.headers={...o,...s,...r.headers},a.data=He(t,a,e),{url:Ve(n),options:a}}}},lt=function(e){const t=ct(e);return{async createCounterfactualAddress(r,n){const i=await t.createCounterfactualAddress(r,n);return Ge(i,Be,De,e)}}};class dt extends Fe{createCounterfactualAddress(e,t){return lt(this.configuration).createCounterfactualAddress(e.createCounterfactualAddressRequest,t).then((e=>e(this.axios,this.basePath)))}}const pt=function(e){return{getERC20Token:async(t,r,n={})=>{je("getERC20Token","contractAddress",t),je("getERC20Token","chainName",r);const i="/v1/chains/{chain_name}/tokens/{contract_address}".replace("{contract_address}",encodeURIComponent(String(t))).replace("{chain_name}",encodeURIComponent(String(r))),a=new URL(i,Ue);let o;e&&(o=e.baseOptions);const s={method:"GET",...o,...n};ze(a,{});let u=o&&o.headers?o.headers:{};return s.headers={...u,...n.headers},{url:Ve(a),options:s}},listERC20Tokens:async(t,r,n,i={})=>{je("listERC20Tokens","chainName",t);const a="/v1/chains/{chain_name}/tokens".replace("{chain_name}",encodeURIComponent(String(t))),o=new URL(a,Ue);let s;e&&(s=e.baseOptions);const u={method:"GET",...s,...i},f={};void 0!==r&&(f.page_cursor=r),void 0!==n&&(f.page_size=n),ze(o,f);let c=s&&s.headers?s.headers:{};return u.headers={...c,...i.headers},{url:Ve(o),options:u}}}},ht=function(e){const t=pt(e);return{async getERC20Token(r,n,i){const a=await t.getERC20Token(r,n,i);return Ge(a,Be,De,e)},async listERC20Tokens(r,n,i,a){const o=await t.listERC20Tokens(r,n,i,a);return Ge(o,Be,De,e)}}};var mt=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:Xe,ActivitiesApiAxiosParamCreator:We,ActivitiesApiFactory:function(e,t,r){const n=Ke(e);return{getActivity:(e,i,a)=>n.getActivity(e,i,a).then((e=>e(r,t))),listActivities:(e,i,a,o,s,u,f,c,l,d,p)=>n.listActivities(e,i,a,o,s,u,f,c,l,d,p).then((e=>e(r,t)))}},ActivitiesApiFp:Ke,ActivityType:{Mint:"mint",Burn:"burn",Transfer:"transfer",Sale:"sale"},ChainsApi:Ye,ChainsApiAxiosParamCreator:$e,ChainsApiFactory:function(e,t,r){const n=Je(e);return{listChains:(e,i,a)=>n.listChains(e,i,a).then((e=>e(r,t)))}},ChainsApiFp:Je,CollectionContractType:{Erc721:"ERC721"},CollectionsApi:et,CollectionsApiAxiosParamCreator:Qe,CollectionsApiFactory:function(e,t,r){const n=Ze(e);return{getCollection:(e,i,a)=>n.getCollection(e,i,a).then((e=>e(r,t))),listCollections:(e,i,a,o)=>n.listCollections(e,i,a,o).then((e=>e(r,t)))}},CollectionsApiFp:Ze,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())}},CreateOrderProtocolDataOrderTypeEnum:{FullRestricted:"FULL_RESTRICTED"},ERC20ItemItemTypeEnum:{Erc20:"ERC20"},ERC721ItemItemTypeEnum:{Erc721:"ERC721"},FeeFeeTypeEnum:{Royalty:"ROYALTY"},NFTContractType:{Erc721:"ERC721"},NativeItemItemTypeEnum:{Native:"NATIVE"},NftOwnersApi:nt,NftOwnersApiAxiosParamCreator:tt,NftOwnersApiFactory:function(e,t,r){const n=rt(e);return{listNFTOwners:(e,i,a,o,s,u)=>n.listNFTOwners(e,i,a,o,s,u).then((e=>e(r,t)))}},NftOwnersApiFp:rt,NftsApi:ot,NftsApiAxiosParamCreator:it,NftsApiFactory:function(e,t,r){const n=at(e);return{getNFT:(e,i,a,o)=>n.getNFT(e,i,a,o).then((e=>e(r,t))),listNFTs:(e,i,a,o,s)=>n.listNFTs(e,i,a,o,s).then((e=>e(r,t))),listNFTsByAccountAddress:(e,i,a,o,s,u)=>n.listNFTsByAccountAddress(e,i,a,o,s,u).then((e=>e(r,t)))}},NftsApiFp:at,OrderStatus:{Pending:"PENDING",Active:"ACTIVE",Inactive:"INACTIVE",Filled:"FILLED",Cancelled:"CANCELLED",Expired:"EXPIRED"},OrdersApi:ft,OrdersApiAxiosParamCreator:st,OrdersApiFactory:function(e,t,r){const n=ut(e);return{createListing:(e,i,a)=>n.createListing(e,i,a).then((e=>e(r,t))),getListing:(e,i,a)=>n.getListing(e,i,a).then((e=>e(r,t))),listListings:(e,i,a,o,s,u,f,c,l,d)=>n.listListings(e,i,a,o,s,u,f,c,l,d).then((e=>e(r,t)))}},OrdersApiFp:ut,PassportApi:dt,PassportApiAxiosParamCreator:ct,PassportApiFactory:function(e,t,r){const n=lt(e);return{createCounterfactualAddress:(e,i)=>n.createCounterfactualAddress(e,i).then((e=>e(r,t)))}},PassportApiFp:lt,SaleFeeTypeEnum:{Royalty:"ROYALTY"},TokenContractType:{Erc20:"ERC20"},TokensApi:class extends Fe{getERC20Token(e,t){return ht(this.configuration).getERC20Token(e.contractAddress,e.chainName,t).then((e=>e(this.axios,this.basePath)))}listERC20Tokens(e,t){return ht(this.configuration).listERC20Tokens(e.chainName,e.pageCursor,e.pageSize,t).then((e=>e(this.axios,this.basePath)))}},TokensApiAxiosParamCreator:pt,TokensApiFactory:function(e,t,r){const n=ht(e);return{getERC20Token:(e,i,a)=>n.getERC20Token(e,i,a).then((e=>e(r,t))),listERC20Tokens:(e,i,a,o)=>n.listERC20Tokens(e,i,a,o).then((e=>e(r,t)))}},TokensApiFp:ht});class yt{config;activitiesApi;chainsApi;collectionApi;nftOwnersApi;nftsApi;ordersApi;passportApi;constructor(e){this.config=e,this.activitiesApi=new Xe(e.indexer),this.chainsApi=new Ye(e.indexer),this.collectionApi=new et(e.indexer),this.nftOwnersApi=new nt(e.indexer),this.nftsApi=new ot(e.indexer),this.ordersApi=new ft(e.orderBook),this.passportApi=new dt(e.passport)}}const bt={"x-sdk-version":"ts-immutable-sdk-0.3.2-alpha"},gt=({basePath:e,headers:t})=>{if(!e.trim())throw Error("basePath can not be empty");const r={basePath:e,baseOptions:{headers:{...bt,...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())}}(r)},vt=()=>({indexer:gt({basePath:"https://indexer-mr.imtbl.com"}),orderBook:gt({basePath:"https://order-book-mr.imtbl.com"}),passport:gt({basePath:"https://api.immutable.com"})}),wt=()=>({indexer:gt({basePath:"https://indexer-mr.sandbox.imtbl.com"}),orderBook:gt({basePath:"https://order-book-mr.sandbox.imtbl.com"}),passport:gt({basePath:"https://api.sandbox.immutable.com"})});function _t(e,t){return function(){return e.apply(t,arguments)}}const{toString:Et}=Object.prototype,{getPrototypeOf:Tt}=Object,At=(e=>t=>{const r=Et.call(t);return e[r]||(e[r]=r.slice(8,-1).toLowerCase())})(Object.create(null)),St=e=>(e=e.toLowerCase(),t=>At(t)===e),kt=e=>t=>typeof t===e,{isArray:Ot}=Array,Rt=kt("undefined");const xt=St("ArrayBuffer");const It=kt("string"),Ct=kt("function"),Nt=kt("number"),Pt=e=>null!==e&&"object"==typeof e,Mt=e=>{if("object"!==At(e))return!1;const t=Tt(e);return!(null!==t&&t!==Object.prototype&&null!==Object.getPrototypeOf(t)||Symbol.toStringTag in e||Symbol.iterator in e)},Bt=St("Date"),Dt=St("File"),Ft=St("Blob"),Lt=St("FileList"),Ut=St("URLSearchParams");function jt(e,t,{allOwnKeys:r=!1}={}){if(null==e)return;let n,i;if("object"!=typeof e&&(e=[e]),Ot(e))for(n=0,i=e.length;n<i;n++)t.call(null,e[n],n,e);else{const i=r?Object.getOwnPropertyNames(e):Object.keys(e),a=i.length;let o;for(n=0;n<a;n++)o=i[n],t.call(null,e[o],o,e)}}function qt(e,t){t=t.toLowerCase();const r=Object.keys(e);let n,i=r.length;for(;i-- >0;)if(n=r[i],t===n.toLowerCase())return n;return null}const zt="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:global,Ht=e=>!Rt(e)&&e!==zt;const Vt=(e=>t=>e&&t instanceof e)("undefined"!=typeof Uint8Array&&Tt(Uint8Array)),Gt=St("HTMLFormElement"),Wt=(({hasOwnProperty:e})=>(t,r)=>e.call(t,r))(Object.prototype),Kt=St("RegExp"),Xt=(e,t)=>{const r=Object.getOwnPropertyDescriptors(e),n={};jt(r,((r,i)=>{!1!==t(r,i,e)&&(n[i]=r)})),Object.defineProperties(e,n)},$t="abcdefghijklmnopqrstuvwxyz",Jt="0123456789",Yt={DIGIT:Jt,ALPHA:$t,ALPHA_DIGIT:$t+$t.toUpperCase()+Jt};const Qt=St("AsyncFunction");var Zt={isArray:Ot,isArrayBuffer:xt,isBuffer:function(e){return null!==e&&!Rt(e)&&null!==e.constructor&&!Rt(e.constructor)&&Ct(e.constructor.isBuffer)&&e.constructor.isBuffer(e)},isFormData:e=>{let t;return e&&("function"==typeof FormData&&e instanceof FormData||Ct(e.append)&&("formdata"===(t=At(e))||"object"===t&&Ct(e.toString)&&"[object FormData]"===e.toString()))},isArrayBufferView:function(e){let t;return t="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&xt(e.buffer),t},isString:It,isNumber:Nt,isBoolean:e=>!0===e||!1===e,isObject:Pt,isPlainObject:Mt,isUndefined:Rt,isDate:Bt,isFile:Dt,isBlob:Ft,isRegExp:Kt,isFunction:Ct,isStream:e=>Pt(e)&&Ct(e.pipe),isURLSearchParams:Ut,isTypedArray:Vt,isFileList:Lt,forEach:jt,merge:function e(){const{caseless:t}=Ht(this)&&this||{},r={},n=(n,i)=>{const a=t&&qt(r,i)||i;Mt(r[a])&&Mt(n)?r[a]=e(r[a],n):Mt(n)?r[a]=e({},n):Ot(n)?r[a]=n.slice():r[a]=n};for(let e=0,t=arguments.length;e<t;e++)arguments[e]&&jt(arguments[e],n);return r},extend:(e,t,r,{allOwnKeys:n}={})=>(jt(t,((t,n)=>{r&&Ct(t)?e[n]=_t(t,r):e[n]=t}),{allOwnKeys:n}),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,r,n)=>{e.prototype=Object.create(t.prototype,n),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),r&&Object.assign(e.prototype,r)},toFlatObject:(e,t,r,n)=>{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],n&&!n(o,e,t)||s[o]||(t[o]=e[o],s[o]=!0);e=!1!==r&&Tt(e)}while(e&&(!r||r(e,t))&&e!==Object.prototype);return t},kindOf:At,kindOfTest:St,endsWith:(e,t,r)=>{e=String(e),(void 0===r||r>e.length)&&(r=e.length),r-=t.length;const n=e.indexOf(t,r);return-1!==n&&n===r},toArray:e=>{if(!e)return null;if(Ot(e))return e;let t=e.length;if(!Nt(t))return null;const r=new Array(t);for(;t-- >0;)r[t]=e[t];return r},forEachEntry:(e,t)=>{const r=(e&&e[Symbol.iterator]).call(e);let n;for(;(n=r.next())&&!n.done;){const r=n.value;t.call(e,r[0],r[1])}},matchAll:(e,t)=>{let r;const n=[];for(;null!==(r=e.exec(t));)n.push(r);return n},isHTMLForm:Gt,hasOwnProperty:Wt,hasOwnProp:Wt,reduceDescriptors:Xt,freezeMethods:e=>{Xt(e,((t,r)=>{if(Ct(e)&&-1!==["arguments","caller","callee"].indexOf(r))return!1;const n=e[r];Ct(n)&&(t.enumerable=!1,"writable"in t?t.writable=!1:t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+r+"'")}))}))},toObjectSet:(e,t)=>{const r={},n=e=>{e.forEach((e=>{r[e]=!0}))};return Ot(e)?n(e):n(String(e).split(t)),r},toCamelCase:e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,(function(e,t,r){return t.toUpperCase()+r})),noop:()=>{},toFiniteNumber:(e,t)=>(e=+e,Number.isFinite(e)?e:t),findKey:qt,global:zt,isContextDefined:Ht,ALPHABET:Yt,generateString:(e=16,t=Yt.ALPHA_DIGIT)=>{let r="";const{length:n}=t;for(;e--;)r+=t[Math.random()*n|0];return r},isSpecCompliantForm:function(e){return!!(e&&Ct(e.append)&&"FormData"===e[Symbol.toStringTag]&&e[Symbol.iterator])},toJSONObject:e=>{const t=new Array(10),r=(e,n)=>{if(Pt(e)){if(t.indexOf(e)>=0)return;if(!("toJSON"in e)){t[n]=e;const i=Ot(e)?[]:{};return jt(e,((e,t)=>{const a=r(e,n+1);!Rt(a)&&(i[t]=a)})),t[n]=void 0,i}}return e};return r(e,0)},isAsyncFn:Qt,isThenable:e=>e&&(Pt(e)||Ct(e))&&Ct(e.then)&&Ct(e.catch)};function er(e,t,r,n,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),r&&(this.config=r),n&&(this.request=n),i&&(this.response=i)}Zt.inherits(er,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:Zt.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});const tr=er.prototype,rr={};["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=>{rr[e]={value:e}})),Object.defineProperties(er,rr),Object.defineProperty(tr,"isAxiosError",{value:!0}),er.from=(e,t,r,n,i,a)=>{const o=Object.create(tr);return Zt.toFlatObject(e,o,(function(e){return e!==Error.prototype}),(e=>"isAxiosError"!==e)),er.call(o,e.message,t,r,n,i),o.cause=e,o.name=e.name,a&&Object.assign(o,a),o};function nr(e){return Zt.isPlainObject(e)||Zt.isArray(e)}function ir(e){return Zt.endsWith(e,"[]")?e.slice(0,-2):e}function ar(e,t,r){return e?e.concat(t).map((function(e,t){return e=ir(e),!r&&t?"["+e+"]":e})).join(r?".":""):t}const or=Zt.toFlatObject(Zt,{},null,(function(e){return/^is[A-Z]/.test(e)}));function sr(e,t,r){if(!Zt.isObject(e))throw new TypeError("target must be an object");t=t||new FormData;const n=(r=Zt.toFlatObject(r,{metaTokens:!0,dots:!1,indexes:!1},!1,(function(e,t){return!Zt.isUndefined(t[e])}))).metaTokens,i=r.visitor||f,a=r.dots,o=r.indexes,s=(r.Blob||"undefined"!=typeof Blob&&Blob)&&Zt.isSpecCompliantForm(t);if(!Zt.isFunction(i))throw new TypeError("visitor must be a function");function u(e){if(null===e)return"";if(Zt.isDate(e))return e.toISOString();if(!s&&Zt.isBlob(e))throw new er("Blob is not supported. Use a Buffer instead.");return Zt.isArrayBuffer(e)||Zt.isTypedArray(e)?s&&"function"==typeof Blob?new Blob([e]):Buffer.from(e):e}function f(e,r,i){let s=e;if(e&&!i&&"object"==typeof e)if(Zt.endsWith(r,"{}"))r=n?r:r.slice(0,-2),e=JSON.stringify(e);else if(Zt.isArray(e)&&function(e){return Zt.isArray(e)&&!e.some(nr)}(e)||(Zt.isFileList(e)||Zt.endsWith(r,"[]"))&&(s=Zt.toArray(e)))return r=ir(r),s.forEach((function(e,n){!Zt.isUndefined(e)&&null!==e&&t.append(!0===o?ar([r],n,a):null===o?r:r+"[]",u(e))})),!1;return!!nr(e)||(t.append(ar(i,r,a),u(e)),!1)}const c=[],l=Object.assign(or,{defaultVisitor:f,convertValue:u,isVisitable:nr});if(!Zt.isObject(e))throw new TypeError("data must be an object");return function e(r,n){if(!Zt.isUndefined(r)){if(-1!==c.indexOf(r))throw Error("Circular reference detected in "+n.join("."));c.push(r),Zt.forEach(r,(function(r,a){!0===(!(Zt.isUndefined(r)||null===r)&&i.call(t,r,Zt.isString(a)?a.trim():a,n,l))&&e(r,n?n.concat(a):[a])})),c.pop()}}(e),t}function ur(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,(function(e){return t[e]}))}function fr(e,t){this._pairs=[],e&&sr(e,this,t)}const cr=fr.prototype;function lr(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function dr(e,t,r){if(!t)return e;const n=r&&r.encode||lr,i=r&&r.serialize;let a;if(a=i?i(t,r):Zt.isURLSearchParams(t)?t.toString():new fr(t,r).toString(n),a){const t=e.indexOf("#");-1!==t&&(e=e.slice(0,t)),e+=(-1===e.indexOf("?")?"?":"&")+a}return e}cr.append=function(e,t){this._pairs.push([e,t])},cr.toString=function(e){const t=e?function(t){return e.call(this,t,ur)}:ur;return this._pairs.map((function(e){return t(e[0])+"="+t(e[1])}),"").join("&")};var pr=class{constructor(){this.handlers=[]}use(e,t,r){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!r&&r.synchronous,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){Zt.forEach(this.handlers,(function(t){null!==t&&e(t)}))}},hr={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1};var mr={isBrowser:!0,classes:{URLSearchParams:"undefined"!=typeof URLSearchParams?URLSearchParams:fr,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 yr(e){function t(e,r,n,i){let a=e[i++];const o=Number.isFinite(+a),s=i>=e.length;if(a=!a&&Zt.isArray(n)?n.length:a,s)return Zt.hasOwnProp(n,a)?n[a]=[n[a],r]:n[a]=r,!o;n[a]&&Zt.isObject(n[a])||(n[a]=[]);return t(e,r,n[a],i)&&Zt.isArray(n[a])&&(n[a]=function(e){const t={},r=Object.keys(e);let n;const i=r.length;let a;for(n=0;n<i;n++)a=r[n],t[a]=e[a];return t}(n[a])),!o}if(Zt.isFormData(e)&&Zt.isFunction(e.entries)){const r={};return Zt.forEachEntry(e,((e,n)=>{t(function(e){return Zt.matchAll(/\w+|\[(\w*)]/g,e).map((e=>"[]"===e[0]?"":e[1]||e[0]))}(e),n,r,0)})),r}return null}const br={"Content-Type":void 0};const gr={transitional:hr,adapter:["xhr","http"],transformRequest:[function(e,t){const r=t.getContentType()||"",n=r.indexOf("application/json")>-1,i=Zt.isObject(e);i&&Zt.isHTMLForm(e)&&(e=new FormData(e));if(Zt.isFormData(e))return n&&n?JSON.stringify(yr(e)):e;if(Zt.isArrayBuffer(e)||Zt.isBuffer(e)||Zt.isStream(e)||Zt.isFile(e)||Zt.isBlob(e))return e;if(Zt.isArrayBufferView(e))return e.buffer;if(Zt.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let a;if(i){if(r.indexOf("application/x-www-form-urlencoded")>-1)return function(e,t){return sr(e,new mr.classes.URLSearchParams,Object.assign({visitor:function(e,t,r,n){return mr.isNode&&Zt.isBuffer(e)?(this.append(t,e.toString("base64")),!1):n.defaultVisitor.apply(this,arguments)}},t))}(e,this.formSerializer).toString();if((a=Zt.isFileList(e))||r.indexOf("multipart/form-data")>-1){const t=this.env&&this.env.FormData;return sr(a?{"files[]":e}:e,t&&new t,this.formSerializer)}}return i||n?(t.setContentType("application/json",!1),function(e,t,r){if(Zt.isString(e))try{return(t||JSON.parse)(e),Zt.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(r||JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){const t=this.transitional||gr.transitional,r=t&&t.forcedJSONParsing,n="json"===this.responseType;if(e&&Zt.isString(e)&&(r&&!this.responseType||n)){const r=!(t&&t.silentJSONParsing)&&n;try{return JSON.parse(e)}catch(e){if(r){if("SyntaxError"===e.name)throw er.from(e,er.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:mr.classes.FormData,Blob:mr.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};Zt.forEach(["delete","get","head"],(function(e){gr.headers[e]={}})),Zt.forEach(["post","put","patch"],(function(e){gr.headers[e]=Zt.merge(br)}));var vr=gr;const wr=Zt.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 _r=Symbol("internals");function Er(e){return e&&String(e).trim().toLowerCase()}function Tr(e){return!1===e||null==e?e:Zt.isArray(e)?e.map(Tr):String(e)}function Ar(e,t,r,n,i){return Zt.isFunction(n)?n.call(this,t,r):(i&&(t=r),Zt.isString(t)?Zt.isString(n)?-1!==t.indexOf(n):Zt.isRegExp(n)?n.test(t):void 0:void 0)}let Sr=class{constructor(e){e&&this.set(e)}set(e,t,r){const n=this;function i(e,t,r){const i=Er(t);if(!i)throw new Error("header name must be a non-empty string");const a=Zt.findKey(n,i);(!a||void 0===n[a]||!0===r||void 0===r&&!1!==n[a])&&(n[a||t]=Tr(e))}const a=(e,t)=>Zt.forEach(e,((e,r)=>i(e,r,t)));return Zt.isPlainObject(e)||e instanceof this.constructor?a(e,t):Zt.isString(e)&&(e=e.trim())&&!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim())?a((e=>{const t={};let r,n,i;return e&&e.split("\n").forEach((function(e){i=e.indexOf(":"),r=e.substring(0,i).trim().toLowerCase(),n=e.substring(i+1).trim(),!r||t[r]&&wr[r]||("set-cookie"===r?t[r]?t[r].push(n):t[r]=[n]:t[r]=t[r]?t[r]+", "+n:n)})),t})(e),t):null!=e&&i(t,e,r),this}get(e,t){if(e=Er(e)){const r=Zt.findKey(this,e);if(r){const e=this[r];if(!t)return e;if(!0===t)return function(e){const t=Object.create(null),r=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let n;for(;n=r.exec(e);)t[n[1]]=n[2];return t}(e);if(Zt.isFunction(t))return t.call(this,e,r);if(Zt.isRegExp(t))return t.exec(e);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=Er(e)){const r=Zt.findKey(this,e);return!(!r||void 0===this[r]||t&&!Ar(0,this[r],r,t))}return!1}delete(e,t){const r=this;let n=!1;function i(e){if(e=Er(e)){const i=Zt.findKey(r,e);!i||t&&!Ar(0,r[i],i,t)||(delete r[i],n=!0)}}return Zt.isArray(e)?e.forEach(i):i(e),n}clear(e){const t=Object.keys(this);let r=t.length,n=!1;for(;r--;){const i=t[r];e&&!Ar(0,this[i],i,e,!0)||(delete this[i],n=!0)}return n}normalize(e){const t=this,r={};return Zt.forEach(this,((n,i)=>{const a=Zt.findKey(r,i);if(a)return t[a]=Tr(n),void delete t[i];const o=e?function(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,((e,t,r)=>t.toUpperCase()+r))}(i):String(i).trim();o!==i&&delete t[i],t[o]=Tr(n),r[o]=!0})),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const t=Object.create(null);return Zt.forEach(this,((r,n)=>{null!=r&&!1!==r&&(t[n]=e&&Zt.isArray(r)?r.join(", "):r)})),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 r=new this(e);return t.forEach((e=>r.set(e))),r}static accessor(e){const t=(this[_r]=this[_r]={accessors:{}}).accessors,r=this.prototype;function n(e){const n=Er(e);t[n]||(!function(e,t){const r=Zt.toCamelCase(" "+t);["get","set","has"].forEach((n=>{Object.defineProperty(e,n+r,{value:function(e,r,i){return this[n].call(this,t,e,r,i)},configurable:!0})}))}(r,e),t[n]=!0)}return Zt.isArray(e)?e.forEach(n):n(e),this}};Sr.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),Zt.freezeMethods(Sr.prototype),Zt.freezeMethods(Sr);var kr=Sr;function Or(e,t){const r=this||vr,n=t||r,i=kr.from(n.headers);let a=n.data;return Zt.forEach(e,(function(e){a=e.call(r,a,i.normalize(),t?t.status:void 0)})),i.normalize(),a}function Rr(e){return!(!e||!e.__CANCEL__)}function xr(e,t,r){er.call(this,null==e?"canceled":e,er.ERR_CANCELED,t,r),this.name="CanceledError"}Zt.inherits(xr,er,{__CANCEL__:!0});var Ir=mr.isStandardBrowserEnv?{write:function(e,t,r,n,i,a){const o=[];o.push(e+"="+encodeURIComponent(t)),Zt.isNumber(r)&&o.push("expires="+new Date(r).toGMTString()),Zt.isString(n)&&o.push("path="+n),Zt.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 Cr(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 Nr=mr.isStandardBrowserEnv?function(){const e=/(msie|trident)/i.test(navigator.userAgent),t=document.createElement("a");let r;function n(r){let n=r;return e&&(t.setAttribute("href",n),n=t.href),t.setAttribute("href",n),{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 r=n(window.location.href),function(e){const t=Zt.isString(e)?n(e):e;return t.protocol===r.protocol&&t.host===r.host}}():function(){return!0};function Pr(e,t){let r=0;const n=function(e,t){e=e||10;const r=new Array(e),n=new Array(e);let i,a=0,o=0;return t=void 0!==t?t:1e3,function(s){const u=Date.now(),f=n[o];i||(i=u),r[a]=s,n[a]=u;let c=o,l=0;for(;c!==a;)l+=r[c++],c%=e;if(a=(a+1)%e,a===o&&(o=(o+1)%e),u-i<t)return;const d=f&&u-f;return d?Math.round(1e3*l/d):void 0}}(50,250);return i=>{const a=i.loaded,o=i.lengthComputable?i.total:void 0,s=a-r,u=n(s);r=a;const f={loaded:a,total:o,progress:o?a/o:void 0,bytes:s,rate:u||void 0,estimated:u&&o&&a<=o?(o-a)/u:void 0,event:i};f[t?"download":"upload"]=!0,e(f)}}var Mr="undefined"!=typeof XMLHttpRequest&&function(e){return new Promise((function(t,r){let n=e.data;const i=kr.from(e.headers).normalize(),a=e.responseType;let o;function s(){e.cancelToken&&e.cancelToken.unsubscribe(o),e.signal&&e.signal.removeEventListener("abort",o)}Zt.isFormData(n)&&(mr.isStandardBrowserEnv||mr.isStandardBrowserWebWorkerEnv?i.setContentType(!1):i.setContentType("multipart/form-data;",!1));let u=new XMLHttpRequest;if(e.auth){const t=e.auth.username||"",r=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";i.set("Authorization","Basic "+btoa(t+":"+r))}const f=Cr(e.baseURL,e.url);function c(){if(!u)return;const n=kr.from("getAllResponseHeaders"in u&&u.getAllResponseHeaders());!function(e,t,r){const n=r.config.validateStatus;r.status&&n&&!n(r.status)?t(new er("Request failed with status code "+r.status,[er.ERR_BAD_REQUEST,er.ERR_BAD_RESPONSE][Math.floor(r.status/100)-4],r.config,r.request,r)):e(r)}((function(e){t(e),s()}),(function(e){r(e),s()}),{data:a&&"text"!==a&&"json"!==a?u.response:u.responseText,status:u.status,statusText:u.statusText,headers:n,config:e,request:u}),u=null}if(u.open(e.method.toUpperCase(),dr(f,e.params,e.paramsSerializer),!0),u.timeout=e.timeout,"onloadend"in u?u.onloadend=c:u.onreadystatechange=function(){u&&4===u.readyState&&(0!==u.status||u.responseURL&&0===u.responseURL.indexOf("file:"))&&setTimeout(c)},u.onabort=function(){u&&(r(new er("Request aborted",er.ECONNABORTED,e,u)),u=null)},u.onerror=function(){r(new er("Network Error",er.ERR_NETWORK,e,u)),u=null},u.ontimeout=function(){let t=e.timeout?"timeout of "+e.timeout+"ms exceeded":"timeout exceeded";const n=e.transitional||hr;e.timeoutErrorMessage&&(t=e.timeoutErrorMessage),r(new er(t,n.clarifyTimeoutError?er.ETIMEDOUT:er.ECONNABORTED,e,u)),u=null},mr.isStandardBrowserEnv){const t=(e.withCredentials||Nr(f))&&e.xsrfCookieName&&Ir.read(e.xsrfCookieName);t&&i.set(e.xsrfHeaderName,t)}void 0===n&&i.setContentType(null),"setRequestHeader"in u&&Zt.forEach(i.toJSON(),(function(e,t){u.setRequestHeader(t,e)})),Zt.isUndefined(e.withCredentials)||(u.withCredentials=!!e.withCredentials),a&&"json"!==a&&(u.responseType=e.responseType),"function"==typeof e.onDownloadProgress&&u.addEventListener("progress",Pr(e.onDownloadProgress,!0)),"function"==typeof e.onUploadProgress&&u.upload&&u.upload.addEventListener("progress",Pr(e.onUploadProgress)),(e.cancelToken||e.signal)&&(o=t=>{u&&(r(!t||t.type?new xr(null,e,u):t),u.abort(),u=null)},e.cancelToken&&e.cancelToken.subscribe(o),e.signal&&(e.signal.aborted?o():e.signal.addEventListener("abort",o)));const l=function(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}(f);l&&-1===mr.protocols.indexOf(l)?r(new er("Unsupported protocol "+l+":",er.ERR_BAD_REQUEST,e)):u.send(n||null)}))};const Br={http:null,xhr:Mr};Zt.forEach(Br,((e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch(e){}Object.defineProperty(e,"adapterName",{value:t})}}));var Dr=e=>{e=Zt.isArray(e)?e:[e];const{length:t}=e;let r,n;for(let i=0;i<t&&(r=e[i],!(n=Zt.isString(r)?Br[r.toLowerCase()]:r));i++);if(!n){if(!1===n)throw new er(`Adapter ${r} is not supported by the environment`,"ERR_NOT_SUPPORT");throw new Error(Zt.hasOwnProp(Br,r)?`Adapter '${r}' is not available in the build`:`Unknown adapter '${r}'`)}if(!Zt.isFunction(n))throw new TypeError("adapter is not a function");return n};function Fr(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new xr(null,e)}function Lr(e){Fr(e),e.headers=kr.from(e.headers),e.data=Or.call(e,e.transformRequest),-1!==["post","put","patch"].indexOf(e.method)&&e.headers.setContentType("application/x-www-form-urlencoded",!1);return Dr(e.adapter||vr.adapter)(e).then((function(t){return Fr(e),t.data=Or.call(e,e.transformResponse,t),t.headers=kr.from(t.headers),t}),(function(t){return Rr(t)||(Fr(e),t&&t.response&&(t.response.data=Or.call(e,e.transformResponse,t.response),t.response.headers=kr.from(t.response.headers))),Promise.reject(t)}))}const Ur=e=>e instanceof kr?e.toJSON():e;function jr(e,t){t=t||{};const r={};function n(e,t,r){return Zt.isPlainObject(e)&&Zt.isPlainObject(t)?Zt.merge.call({caseless:r},e,t):Zt.isPlainObject(t)?Zt.merge({},t):Zt.isArray(t)?t.slice():t}function i(e,t,r){return Zt.isUndefined(t)?Zt.isUndefined(e)?void 0:n(void 0,e,r):n(e,t,r)}function a(e,t){if(!Zt.isUndefined(t))return n(void 0,t)}function o(e,t){return Zt.isUndefined(t)?Zt.isUndefined(e)?void 0:n(void 0,e):n(void 0,t)}function s(r,i,a){return a in t?n(r,i):a in e?n(void 0,r):void 0}const u={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(Ur(e),Ur(t),!0)};return Zt.forEach(Object.keys(Object.assign({},e,t)),(function(n){const a=u[n]||i,o=a(e[n],t[n],n);Zt.isUndefined(o)&&a!==s||(r[n]=o)})),r}const qr="1.4.0",zr={};["object","boolean","number","function","string","symbol"].forEach(((e,t)=>{zr[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}}));const Hr={};zr.transitional=function(e,t,r){function n(e,t){return"[Axios v1.4.0] Transitional option '"+e+"'"+t+(r?". "+r:"")}return(r,i,a)=>{if(!1===e)throw new er(n(i," has been removed"+(t?" in "+t:"")),er.ERR_DEPRECATED);return t&&!Hr[i]&&(Hr[i]=!0,console.warn(n(i," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(r,i,a)}};var Vr={assertOptions:function(e,t,r){if("object"!=typeof e)throw new er("options must be an object",er.ERR_BAD_OPTION_VALUE);const n=Object.keys(e);let i=n.length;for(;i-- >0;){const a=n[i],o=t[a];if(o){const t=e[a],r=void 0===t||o(t,a,e);if(!0!==r)throw new er("option "+a+" must be "+r,er.ERR_BAD_OPTION_VALUE)}else if(!0!==r)throw new er("Unknown option "+a,er.ERR_BAD_OPTION)}},validators:zr};const Gr=Vr.validators;let Wr=class{constructor(e){this.defaults=e,this.interceptors={request:new pr,response:new pr}}request(e,t){"string"==typeof e?(t=t||{}).url=e:t=e||{},t=jr(this.defaults,t);const{transitional:r,paramsSerializer:n,headers:i}=t;let a;void 0!==r&&Vr.assertOptions(r,{silentJSONParsing:Gr.transitional(Gr.boolean),forcedJSONParsing:Gr.transitional(Gr.boolean),clarifyTimeoutError:Gr.transitional(Gr.boolean)},!1),null!=n&&(Zt.isFunction(n)?t.paramsSerializer={serialize:n}:Vr.assertOptions(n,{encode:Gr.function,serialize:Gr.function},!0)),t.method=(t.method||this.defaults.method||"get").toLowerCase(),a=i&&Zt.merge(i.common,i[t.method]),a&&Zt.forEach(["delete","get","head","post","put","patch","common"],(e=>{delete i[e]})),t.headers=kr.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 u=[];let f;this.interceptors.response.forEach((function(e){u.push(e.fulfilled,e.rejected)}));let c,l=0;if(!s){const e=[Lr.bind(this),void 0];for(e.unshift.apply(e,o),e.push.apply(e,u),c=e.length,f=Promise.resolve(t);l<c;)f=f.then(e[l++],e[l++]);return f}c=o.length;let d=t;for(l=0;l<c;){const e=o[l++],t=o[l++];try{d=e(d)}catch(e){t.call(this,e);break}}try{f=Lr.call(this,d)}catch(e){return Promise.reject(e)}for(l=0,c=u.length;l<c;)f=f.then(u[l++],u[l++]);return f}getUri(e){return dr(Cr((e=jr(this.defaults,e)).baseURL,e.url),e.params,e.paramsSerializer)}};Zt.forEach(["delete","get","head","options"],(function(e){Wr.prototype[e]=function(t,r){return this.request(jr(r||{},{method:e,url:t,data:(r||{}).data}))}})),Zt.forEach(["post","put","patch"],(function(e){function t(t){return function(r,n,i){return this.request(jr(i||{},{method:e,headers:t?{"Content-Type":"multipart/form-data"}:{},url:r,data:n}))}}Wr.prototype[e]=t(),Wr.prototype[e+"Form"]=t(!0)}));var Kr=Wr;var Xr=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 r=this;this.promise.then((e=>{if(!r._listeners)return;let t=r._listeners.length;for(;t-- >0;)r._listeners[t](e);r._listeners=null})),this.promise.then=e=>{let t;const n=new Promise((e=>{r.subscribe(e),t=e})).then(e);return n.cancel=function(){r.unsubscribe(t)},n},e((function(e,n,i){r.reason||(r.reason=new xr(e,n,i),t(r.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 r=new e((function(e){t=e}));return{token:r,cancel:t}}};const $r={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($r).forEach((([e,t])=>{$r[t]=e}));var Jr=$r;const Yr=function e(t){const r=new Kr(t),n=_t(Kr.prototype.request,r);return Zt.extend(n,Kr.prototype,r,{allOwnKeys:!0}),Zt.extend(n,r,null,{allOwnKeys:!0}),n.create=function(r){return e(jr(t,r))},n}(vr);Yr.Axios=Kr,Yr.CanceledError=xr,Yr.CancelToken=Xr,Yr.isCancel=Rr,Yr.VERSION=qr,Yr.toFormData=sr,Yr.AxiosError=er,Yr.Cancel=Yr.CanceledError,Yr.all=function(e){return Promise.all(e)},Yr.spread=function(e){return function(t){return e.apply(null,t)}},Yr.isAxiosError=function(e){return Zt.isObject(e)&&!0===e.isAxiosError},Yr.mergeConfig=jr,Yr.AxiosHeaders=kr,Yr.formToJSON=e=>yr(Zt.isHTMLForm(e)?new FormData(e):e),Yr.HttpStatusCode=Jr,Yr.default=Yr;var Qr=Yr;class Zr extends Error{code;details;link;traceId;constructor({message:e,code:t,details:r,link:n,trace_id:i}){super(e),this.code=t,this.details=r,this.link=n,this.traceId=i}}const en={sdkVersion:"ts-immutable-sdk-multi-rollup-api-client-0.3.2-alpha"},tn=({basePath:e,headers:t})=>{if(!e.trim())throw Error("basePath can not be empty");const r={basePath:e,baseOptions:{headers:{...t||{},...en}}};return new mt.Configuration(r)},rn=()=>tn({basePath:"https://indexer-mr.sandbox.imtbl.com"});class nn{apiConfig;baseConfig;constructor({baseConfig:t,overrides:r}){if(this.baseConfig=t,r)this.apiConfig=tn(r);else switch(t.environment){case e.Environment.SANDBOX:this.apiConfig=rn();break;case e.Environment.PRODUCTION:this.apiConfig=tn({basePath:"https://indexer-mr.imtbl.com"});break;default:this.apiConfig=rn()}}}function an(e){if(Qr.isAxiosError(e)&&e.response){const t=e.response.data;return t.code&&t.message?new Zr({code:t.code,message:t.message,details:t.details||null,link:t.link||"",trace_id:t.trace_id||""}):new Zr({code:e.code??e.response?.status.toString()??"unknown_error_code",message:String(e),details:null,link:"",trace_id:""})}return new Zr({code:"unknown_error_code",message:String(e),details:null,link:"",trace_id:""})}var on="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function sn(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function un(e){if(e.__esModule)return e;var t=e.default;if("function"==typeof t){var r=function e(){if(this instanceof e){var r=[null];return r.push.apply(r,arguments),new(Function.bind.apply(t,r))}return t.apply(this,arguments)};r.prototype=t.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(e).forEach((function(t){var n=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(r,t,n.get?n:{enumerable:!0,get:function(){return e[t]}})})),r}var fn={exports:{}},cn="undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},ln=[],dn=[],pn="undefined"!=typeof Uint8Array?Uint8Array:Array,hn=!1;function mn(){hn=!0;for(var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",t=0;t<64;++t)ln[t]=e[t],dn[e.charCodeAt(t)]=t;dn["-".charCodeAt(0)]=62,dn["_".charCodeAt(0)]=63}function yn(e,t,r){for(var n,i,a=[],o=t;o<r;o+=3)n=(e[o]<<16)+(e[o+1]<<8)+e[o+2],a.push(ln[(i=n)>>18&63]+ln[i>>12&63]+ln[i>>6&63]+ln[63&i]);return a.join("")}function bn(e){var t;hn||mn();for(var r=e.length,n=r%3,i="",a=[],o=16383,s=0,u=r-n;s<u;s+=o)a.push(yn(e,s,s+o>u?u:s+o));return 1===n?(t=e[r-1],i+=ln[t>>2],i+=ln[t<<4&63],i+="=="):2===n&&(t=(e[r-2]<<8)+e[r-1],i+=ln[t>>10],i+=ln[t>>4&63],i+=ln[t<<2&63],i+="="),a.push(i),a.join("")}function gn(e,t,r,n,i){var a,o,s=8*i-n-1,u=(1<<s)-1,f=u>>1,c=-7,l=r?i-1:0,d=r?-1:1,p=e[t+l];for(l+=d,a=p&(1<<-c)-1,p>>=-c,c+=s;c>0;a=256*a+e[t+l],l+=d,c-=8);for(o=a&(1<<-c)-1,a>>=-c,c+=n;c>0;o=256*o+e[t+l],l+=d,c-=8);if(0===a)a=1-f;else{if(a===u)return o?NaN:1/0*(p?-1:1);o+=Math.pow(2,n),a-=f}return(p?-1:1)*o*Math.pow(2,a-n)}function vn(e,t,r,n,i,a){var o,s,u,f=8*a-i-1,c=(1<<f)-1,l=c>>1,d=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,p=n?0:a-1,h=n?1:-1,m=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=c):(o=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-o))<1&&(o--,u*=2),(t+=o+l>=1?d/u:d*Math.pow(2,1-l))*u>=2&&(o++,u/=2),o+l>=c?(s=0,o=c):o+l>=1?(s=(t*u-1)*Math.pow(2,i),o+=l):(s=t*Math.pow(2,l-1)*Math.pow(2,i),o=0));i>=8;e[r+p]=255&s,p+=h,s/=256,i-=8);for(o=o<<i|s,f+=i;f>0;e[r+p]=255&o,p+=h,o/=256,f-=8);e[r+p-h]|=128*m}var wn={}.toString,_n=Array.isArray||function(e){return"[object Array]"==wn.call(e)};Sn.TYPED_ARRAY_SUPPORT=void 0===cn.TYPED_ARRAY_SUPPORT||cn.TYPED_ARRAY_SUPPORT;var En=Tn();function Tn(){return Sn.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function An(e,t){if(Tn()<t)throw new RangeError("Invalid typed array length");return Sn.TYPED_ARRAY_SUPPORT?(e=new Uint8Array(t)).__proto__=Sn.prototype:(null===e&&(e=new Sn(t)),e.length=t),e}function Sn(e,t,r){if(!(Sn.TYPED_ARRAY_SUPPORT||this instanceof Sn))return new Sn(e,t,r);if("number"==typeof e){if("string"==typeof t)throw new Error("If encoding is specified then the first argument must be a string");return Rn(this,e)}return kn(this,e,t,r)}function kn(e,t,r,n){if("number"==typeof t)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&t instanceof ArrayBuffer?function(e,t,r,n){if(t.byteLength,r<0||t.byteLength<r)throw new RangeError("'offset' is out of bounds");if(t.byteLength<r+(n||0))throw new RangeError("'length' is out of bounds");t=void 0===r&&void 0===n?new Uint8Array(t):void 0===n?new Uint8Array(t,r):new Uint8Array(t,r,n);Sn.TYPED_ARRAY_SUPPORT?(e=t).__proto__=Sn.prototype:e=xn(e,t);return e}(e,t,r,n):"string"==typeof t?function(e,t,r){"string"==typeof r&&""!==r||(r="utf8");if(!Sn.isEncoding(r))throw new TypeError('"encoding" must be a valid string encoding');var n=0|Nn(t,r);e=An(e,n);var i=e.write(t,r);i!==n&&(e=e.slice(0,i));return e}(e,t,r):function(e,t){if(Cn(t)){var r=0|In(t.length);return 0===(e=An(e,r)).length||t.copy(e,0,0,r),e}if(t){if("undefined"!=typeof ArrayBuffer&&t.buffer instanceof ArrayBuffer||"length"in t)return"number"!=typeof t.length||(n=t.length)!=n?An(e,0):xn(e,t);if("Buffer"===t.type&&_n(t.data))return xn(e,t.data)}var n;throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(e,t)}function On(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 Rn(e,t){if(On(t),e=An(e,t<0?0:0|In(t)),!Sn.TYPED_ARRAY_SUPPORT)for(var r=0;r<t;++r)e[r]=0;return e}function xn(e,t){var r=t.length<0?0:0|In(t.length);e=An(e,r);for(var n=0;n<r;n+=1)e[n]=255&t[n];return e}function In(e){if(e>=Tn())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+Tn().toString(16)+" bytes");return 0|e}function Cn(e){return!(null==e||!e._isBuffer)}function Nn(e,t){if(Cn(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 r=e.length;if(0===r)return 0;for(var n=!1;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return ai(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return oi(e).length;default:if(n)return ai(e).length;t=(""+t).toLowerCase(),n=!0}}function Pn(e,t,r){var n=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return Xn(this,t,r);case"utf8":case"utf-8":return Vn(this,t,r);case"ascii":return Wn(this,t,r);case"latin1":case"binary":return Kn(this,t,r);case"base64":return Hn(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return $n(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}function Mn(e,t,r){var n=e[t];e[t]=e[r],e[r]=n}function Bn(e,t,r,n,i){if(0===e.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,isNaN(r)&&(r=i?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(i)return-1;r=e.length-1}else if(r<0){if(!i)return-1;r=0}if("string"==typeof t&&(t=Sn.from(t,n)),Cn(t))return 0===t.length?-1:Dn(e,t,r,n,i);if("number"==typeof t)return t&=255,Sn.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):Dn(e,[t],r,n,i);throw new TypeError("val must be string, number or Buffer")}function Dn(e,t,r,n,i){var a,o=1,s=e.length,u=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return-1;o=2,s/=2,u/=2,r/=2}function f(e,t){return 1===o?e[t]:e.readUInt16BE(t*o)}if(i){var c=-1;for(a=r;a<s;a++)if(f(e,a)===f(t,-1===c?0:a-c)){if(-1===c&&(c=a),a-c+1===u)return c*o}else-1!==c&&(a-=a-c),c=-1}else for(r+u>s&&(r=s-u),a=r;a>=0;a--){for(var l=!0,d=0;d<u;d++)if(f(e,a+d)!==f(t,d)){l=!1;break}if(l)return a}return-1}function Fn(e,t,r,n){r=Number(r)||0;var i=e.length-r;n?(n=Number(n))>i&&(n=i):n=i;var a=t.length;if(a%2!=0)throw new TypeError("Invalid hex string");n>a/2&&(n=a/2);for(var o=0;o<n;++o){var s=parseInt(t.substr(2*o,2),16);if(isNaN(s))return o;e[r+o]=s}return o}function Ln(e,t,r,n){return si(ai(t,e.length-r),e,r,n)}function Un(e,t,r,n){return si(function(e){for(var t=[],r=0;r<e.length;++r)t.push(255&e.charCodeAt(r));return t}(t),e,r,n)}function jn(e,t,r,n){return Un(e,t,r,n)}function qn(e,t,r,n){return si(oi(t),e,r,n)}function zn(e,t,r,n){return si(function(e,t){for(var r,n,i,a=[],o=0;o<e.length&&!((t-=2)<0);++o)n=(r=e.charCodeAt(o))>>8,i=r%256,a.push(i),a.push(n);return a}(t,e.length-r),e,r,n)}function Hn(e,t,r){return 0===t&&r===e.length?bn(e):bn(e.slice(t,r))}function Vn(e,t,r){r=Math.min(e.length,r);for(var n=[],i=t;i<r;){var a,o,s,u,f=e[i],c=null,l=f>239?4:f>223?3:f>191?2:1;if(i+l<=r)switch(l){case 1:f<128&&(c=f);break;case 2:128==(192&(a=e[i+1]))&&(u=(31&f)<<6|63&a)>127&&(c=u);break;case 3:a=e[i+1],o=e[i+2],128==(192&a)&&128==(192&o)&&(u=(15&f)<<12|(63&a)<<6|63&o)>2047&&(u<55296||u>57343)&&(c=u);break;case 4:a=e[i+1],o=e[i+2],s=e[i+3],128==(192&a)&&128==(192&o)&&128==(192&s)&&(u=(15&f)<<18|(63&a)<<12|(63&o)<<6|63&s)>65535&&u<1114112&&(c=u)}null===c?(c=65533,l=1):c>65535&&(c-=65536,n.push(c>>>10&1023|55296),c=56320|1023&c),n.push(c),i+=l}return function(e){var t=e.length;if(t<=Gn)return String.fromCharCode.apply(String,e);var r="",n=0;for(;n<t;)r+=String.fromCharCode.apply(String,e.slice(n,n+=Gn));return r}(n)}Sn.poolSize=8192,Sn._augment=function(e){return e.__proto__=Sn.prototype,e},Sn.from=function(e,t,r){return kn(null,e,t,r)},Sn.TYPED_ARRAY_SUPPORT&&(Sn.prototype.__proto__=Uint8Array.prototype,Sn.__proto__=Uint8Array,"undefined"!=typeof Symbol&&Symbol.species&&Sn[Symbol.species]),Sn.alloc=function(e,t,r){return function(e,t,r,n){return On(t),t<=0?An(e,t):void 0!==r?"string"==typeof n?An(e,t).fill(r,n):An(e,t).fill(r):An(e,t)}(null,e,t,r)},Sn.allocUnsafe=function(e){return Rn(null,e)},Sn.allocUnsafeSlow=function(e){return Rn(null,e)},Sn.isBuffer=ui,Sn.compare=function(e,t){if(!Cn(e)||!Cn(t))throw new TypeError("Arguments must be Buffers");if(e===t)return 0;for(var r=e.length,n=t.length,i=0,a=Math.min(r,n);i<a;++i)if(e[i]!==t[i]){r=e[i],n=t[i];break}return r<n?-1:n<r?1:0},Sn.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}},Sn.concat=function(e,t){if(!_n(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return Sn.alloc(0);var r;if(void 0===t)for(t=0,r=0;r<e.length;++r)t+=e[r].length;var n=Sn.allocUnsafe(t),i=0;for(r=0;r<e.length;++r){var a=e[r];if(!Cn(a))throw new TypeError('"list" argument must be an Array of Buffers');a.copy(n,i),i+=a.length}return n},Sn.byteLength=Nn,Sn.prototype._isBuffer=!0,Sn.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)Mn(this,t,t+1);return this},Sn.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)Mn(this,t,t+3),Mn(this,t+1,t+2);return this},Sn.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)Mn(this,t,t+7),Mn(this,t+1,t+6),Mn(this,t+2,t+5),Mn(this,t+3,t+4);return this},Sn.prototype.toString=function(){var e=0|this.length;return 0===e?"":0===arguments.length?Vn(this,0,e):Pn.apply(this,arguments)},Sn.prototype.equals=function(e){if(!Cn(e))throw new TypeError("Argument must be a Buffer");return this===e||0===Sn.compare(this,e)},Sn.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+">"},Sn.prototype.compare=function(e,t,r,n,i){if(!Cn(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),t<0||r>e.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&t>=r)return 0;if(n>=i)return-1;if(t>=r)return 1;if(this===e)return 0;for(var a=(i>>>=0)-(n>>>=0),o=(r>>>=0)-(t>>>=0),s=Math.min(a,o),u=this.slice(n,i),f=e.slice(t,r),c=0;c<s;++c)if(u[c]!==f[c]){a=u[c],o=f[c];break}return a<o?-1:o<a?1:0},Sn.prototype.includes=function(e,t,r){return-1!==this.indexOf(e,t,r)},Sn.prototype.indexOf=function(e,t,r){return Bn(this,e,t,r,!0)},Sn.prototype.lastIndexOf=function(e,t,r){return Bn(this,e,t,r,!1)},Sn.prototype.write=function(e,t,r,n){if(void 0===t)n="utf8",r=this.length,t=0;else if(void 0===r&&"string"==typeof t)n=t,r=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t|=0,isFinite(r)?(r|=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}var i=this.length-t;if((void 0===r||r>i)&&(r=i),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var a=!1;;)switch(n){case"hex":return Fn(this,e,t,r);case"utf8":case"utf-8":return Ln(this,e,t,r);case"ascii":return Un(this,e,t,r);case"latin1":case"binary":return jn(this,e,t,r);case"base64":return qn(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return zn(this,e,t,r);default:if(a)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),a=!0}},Sn.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var Gn=4096;function Wn(e,t,r){var n="";r=Math.min(e.length,r);for(var i=t;i<r;++i)n+=String.fromCharCode(127&e[i]);return n}function Kn(e,t,r){var n="";r=Math.min(e.length,r);for(var i=t;i<r;++i)n+=String.fromCharCode(e[i]);return n}function Xn(e,t,r){var n=e.length;(!t||t<0)&&(t=0),(!r||r<0||r>n)&&(r=n);for(var i="",a=t;a<r;++a)i+=ii(e[a]);return i}function $n(e,t,r){for(var n=e.slice(t,r),i="",a=0;a<n.length;a+=2)i+=String.fromCharCode(n[a]+256*n[a+1]);return i}function Jn(e,t,r){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(e+t>r)throw new RangeError("Trying to access beyond buffer length")}function Yn(e,t,r,n,i,a){if(!Cn(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(r+n>e.length)throw new RangeError("Index out of range")}function Qn(e,t,r,n){t<0&&(t=65535+t+1);for(var i=0,a=Math.min(e.length-r,2);i<a;++i)e[r+i]=(t&255<<8*(n?i:1-i))>>>8*(n?i:1-i)}function Zn(e,t,r,n){t<0&&(t=4294967295+t+1);for(var i=0,a=Math.min(e.length-r,4);i<a;++i)e[r+i]=t>>>8*(n?i:3-i)&255}function ei(e,t,r,n,i,a){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function ti(e,t,r,n,i){return i||ei(e,0,r,4),vn(e,t,r,n,23,4),r+4}function ri(e,t,r,n,i){return i||ei(e,0,r,8),vn(e,t,r,n,52,8),r+8}Sn.prototype.slice=function(e,t){var r,n=this.length;if((e=~~e)<0?(e+=n)<0&&(e=0):e>n&&(e=n),(t=void 0===t?n:~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),t<e&&(t=e),Sn.TYPED_ARRAY_SUPPORT)(r=this.subarray(e,t)).__proto__=Sn.prototype;else{var i=t-e;r=new Sn(i,void 0);for(var a=0;a<i;++a)r[a]=this[a+e]}return r},Sn.prototype.readUIntLE=function(e,t,r){e|=0,t|=0,r||Jn(e,t,this.length);for(var n=this[e],i=1,a=0;++a<t&&(i*=256);)n+=this[e+a]*i;return n},Sn.prototype.readUIntBE=function(e,t,r){e|=0,t|=0,r||Jn(e,t,this.length);for(var n=this[e+--t],i=1;t>0&&(i*=256);)n+=this[e+--t]*i;return n},Sn.prototype.readUInt8=function(e,t){return t||Jn(e,1,this.length),this[e]},Sn.prototype.readUInt16LE=function(e,t){return t||Jn(e,2,this.length),this[e]|this[e+1]<<8},Sn.prototype.readUInt16BE=function(e,t){return t||Jn(e,2,this.length),this[e]<<8|this[e+1]},Sn.prototype.readUInt32LE=function(e,t){return t||Jn(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},Sn.prototype.readUInt32BE=function(e,t){return t||Jn(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},Sn.prototype.readIntLE=function(e,t,r){e|=0,t|=0,r||Jn(e,t,this.length);for(var n=this[e],i=1,a=0;++a<t&&(i*=256);)n+=this[e+a]*i;return n>=(i*=128)&&(n-=Math.pow(2,8*t)),n},Sn.prototype.readIntBE=function(e,t,r){e|=0,t|=0,r||Jn(e,t,this.length);for(var n=t,i=1,a=this[e+--n];n>0&&(i*=256);)a+=this[e+--n]*i;return a>=(i*=128)&&(a-=Math.pow(2,8*t)),a},Sn.prototype.readInt8=function(e,t){return t||Jn(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},Sn.prototype.readInt16LE=function(e,t){t||Jn(e,2,this.length);var r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},Sn.prototype.readInt16BE=function(e,t){t||Jn(e,2,this.length);var r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},Sn.prototype.readInt32LE=function(e,t){return t||Jn(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},Sn.prototype.readInt32BE=function(e,t){return t||Jn(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},Sn.prototype.readFloatLE=function(e,t){return t||Jn(e,4,this.length),gn(this,e,!0,23,4)},Sn.prototype.readFloatBE=function(e,t){return t||Jn(e,4,this.length),gn(this,e,!1,23,4)},Sn.prototype.readDoubleLE=function(e,t){return t||Jn(e,8,this.length),gn(this,e,!0,52,8)},Sn.prototype.readDoubleBE=function(e,t){return t||Jn(e,8,this.length),gn(this,e,!1,52,8)},Sn.prototype.writeUIntLE=function(e,t,r,n){(e=+e,t|=0,r|=0,n)||Yn(this,e,t,r,Math.pow(2,8*r)-1,0);var i=1,a=0;for(this[t]=255&e;++a<r&&(i*=256);)this[t+a]=e/i&255;return t+r},Sn.prototype.writeUIntBE=function(e,t,r,n){(e=+e,t|=0,r|=0,n)||Yn(this,e,t,r,Math.pow(2,8*r)-1,0);var i=r-1,a=1;for(this[t+i]=255&e;--i>=0&&(a*=256);)this[t+i]=e/a&255;return t+r},Sn.prototype.writeUInt8=function(e,t,r){return e=+e,t|=0,r||Yn(this,e,t,1,255,0),Sn.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},Sn.prototype.writeUInt16LE=function(e,t,r){return e=+e,t|=0,r||Yn(this,e,t,2,65535,0),Sn.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):Qn(this,e,t,!0),t+2},Sn.prototype.writeUInt16BE=function(e,t,r){return e=+e,t|=0,r||Yn(this,e,t,2,65535,0),Sn.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):Qn(this,e,t,!1),t+2},Sn.prototype.writeUInt32LE=function(e,t,r){return e=+e,t|=0,r||Yn(this,e,t,4,4294967295,0),Sn.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):Zn(this,e,t,!0),t+4},Sn.prototype.writeUInt32BE=function(e,t,r){return e=+e,t|=0,r||Yn(this,e,t,4,4294967295,0),Sn.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):Zn(this,e,t,!1),t+4},Sn.prototype.writeIntLE=function(e,t,r,n){if(e=+e,t|=0,!n){var i=Math.pow(2,8*r-1);Yn(this,e,t,r,i-1,-i)}var a=0,o=1,s=0;for(this[t]=255&e;++a<r&&(o*=256);)e<0&&0===s&&0!==this[t+a-1]&&(s=1),this[t+a]=(e/o>>0)-s&255;return t+r},Sn.prototype.writeIntBE=function(e,t,r,n){if(e=+e,t|=0,!n){var i=Math.pow(2,8*r-1);Yn(this,e,t,r,i-1,-i)}var a=r-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+r},Sn.prototype.writeInt8=function(e,t,r){return e=+e,t|=0,r||Yn(this,e,t,1,127,-128),Sn.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},Sn.prototype.writeInt16LE=function(e,t,r){return e=+e,t|=0,r||Yn(this,e,t,2,32767,-32768),Sn.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):Qn(this,e,t,!0),t+2},Sn.prototype.writeInt16BE=function(e,t,r){return e=+e,t|=0,r||Yn(this,e,t,2,32767,-32768),Sn.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):Qn(this,e,t,!1),t+2},Sn.prototype.writeInt32LE=function(e,t,r){return e=+e,t|=0,r||Yn(this,e,t,4,2147483647,-2147483648),Sn.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):Zn(this,e,t,!0),t+4},Sn.prototype.writeInt32BE=function(e,t,r){return e=+e,t|=0,r||Yn(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),Sn.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):Zn(this,e,t,!1),t+4},Sn.prototype.writeFloatLE=function(e,t,r){return ti(this,e,t,!0,r)},Sn.prototype.writeFloatBE=function(e,t,r){return ti(this,e,t,!1,r)},Sn.prototype.writeDoubleLE=function(e,t,r){return ri(this,e,t,!0,r)},Sn.prototype.writeDoubleBE=function(e,t,r){return ri(this,e,t,!1,r)},Sn.prototype.copy=function(e,t,r,n){if(r||(r=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n<r&&(n=r),n===r)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t<n-r&&(n=e.length-t+r);var i,a=n-r;if(this===e&&r<t&&t<n)for(i=a-1;i>=0;--i)e[i+t]=this[i+r];else if(a<1e3||!Sn.TYPED_ARRAY_SUPPORT)for(i=0;i<a;++i)e[i+t]=this[i+r];else Uint8Array.prototype.set.call(e,this.subarray(r,r+a),t);return a},Sn.prototype.fill=function(e,t,r,n){if("string"==typeof e){if("string"==typeof t?(n=t,t=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),1===e.length){var i=e.charCodeAt(0);i<256&&(e=i)}if(void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!Sn.isEncoding(n))throw new TypeError("Unknown encoding: "+n)}else"number"==typeof e&&(e&=255);if(t<0||this.length<t||this.length<r)throw new RangeError("Out of range index");if(r<=t)return this;var a;if(t>>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(a=t;a<r;++a)this[a]=e;else{var o=Cn(e)?e:ai(new Sn(e,n).toString()),s=o.length;for(a=0;a<r-t;++a)this[a+t]=o[a%s]}return this};var ni=/[^+\/0-9A-Za-z-_]/g;function ii(e){return e<16?"0"+e.toString(16):e.toString(16)}function ai(e,t){var r;t=t||1/0;for(var n=e.length,i=null,a=[],o=0;o<n;++o){if((r=e.charCodeAt(o))>55295&&r<57344){if(!i){if(r>56319){(t-=3)>-1&&a.push(239,191,189);continue}if(o+1===n){(t-=3)>-1&&a.push(239,191,189);continue}i=r;continue}if(r<56320){(t-=3)>-1&&a.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(t-=3)>-1&&a.push(239,191,189);if(i=null,r<128){if((t-=1)<0)break;a.push(r)}else if(r<2048){if((t-=2)<0)break;a.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;a.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;a.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return a}function oi(e){return function(e){var t,r,n,i,a,o;hn||mn();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 pn(3*s/4-a),n=a>0?s-4:s;var u=0;for(t=0,r=0;t<n;t+=4,r+=3)i=dn[e.charCodeAt(t)]<<18|dn[e.charCodeAt(t+1)]<<12|dn[e.charCodeAt(t+2)]<<6|dn[e.charCodeAt(t+3)],o[u++]=i>>16&255,o[u++]=i>>8&255,o[u++]=255&i;return 2===a?(i=dn[e.charCodeAt(t)]<<2|dn[e.charCodeAt(t+1)]>>4,o[u++]=255&i):1===a&&(i=dn[e.charCodeAt(t)]<<10|dn[e.charCodeAt(t+1)]<<4|dn[e.charCodeAt(t+2)]>>2,o[u++]=i>>8&255,o[u++]=255&i),o}(function(e){if((e=function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}(e).replace(ni,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function si(e,t,r,n){for(var i=0;i<n&&!(i+r>=t.length||i>=e.length);++i)t[i+r]=e[i];return i}function ui(e){return null!=e&&(!!e._isBuffer||fi(e)||function(e){return"function"==typeof e.readFloatLE&&"function"==typeof e.slice&&fi(e.slice(0,0))}(e))}function fi(e){return!!e.constructor&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)}var ci=un(Object.freeze({__proto__:null,Buffer:Sn,INSPECT_MAX_BYTES:50,SlowBuffer:function(e){return+e!=e&&(e=0),Sn.alloc(+e)},isBuffer:ui,kMaxLength:En}));!function(e){!function(e,t){function r(e,t){if(!e)throw new Error(t||"Assertion failed")}function n(e,t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}function i(e,t,r){if(i.isBN(e))return e;this.negative=0,this.words=null,this.length=0,this.red=null,null!==e&&("le"!==t&&"be"!==t||(r=t,t=10),this._init(e||0,t||10,r||"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:ci.Buffer}catch(e){}function o(e,t){var n=e.charCodeAt(t);return n>=48&&n<=57?n-48:n>=65&&n<=70?n-55:n>=97&&n<=102?n-87:void r(!1,"Invalid character in "+e)}function s(e,t,r){var n=o(e,r);return r-1>=t&&(n|=o(e,r-1)<<4),n}function u(e,t,n,i){for(var a=0,o=0,s=Math.min(e.length,n),u=t;u<s;u++){var f=e.charCodeAt(u)-48;a*=i,o=f>=49?f-49+10:f>=17?f-17+10:f,r(f>=0&&o<i,"Invalid character"),a+=o}return a}function f(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,n){if("number"==typeof e)return this._initNumber(e,t,n);if("object"==typeof e)return this._initArray(e,t,n);"hex"===t&&(t=16),r(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,n):(this._parseBase(e,t,i),"le"===n&&this._initArray(this.toArray(),t,n)))},i.prototype._initNumber=function(e,t,n){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):(r(e<9007199254740992),this.words=[67108863&e,e/67108864&67108863,1],this.length=3),"le"===n&&this._initArray(this.toArray(),t,n)},i.prototype._initArray=function(e,t,n){if(r("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"===n)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"===n)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,r){this.length=Math.ceil((e.length-t)/6),this.words=new Array(this.length);for(var n=0;n<this.length;n++)this.words[n]=0;var i,a=0,o=0;if("be"===r)for(n=e.length-1;n>=t;n-=2)i=s(e,t,n)<<a,this.words[o]|=67108863&i,a>=18?(a-=18,o+=1,this.words[o]|=i>>>26):a+=8;else for(n=(e.length-t)%2==0?t+1:t;n<e.length;n+=2)i=s(e,t,n)<<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,r){this.words=[0],this.length=1;for(var n=0,i=1;i<=67108863;i*=t)n++;n--,i=i/t|0;for(var a=e.length-r,o=a%n,s=Math.min(a,a-o)+r,f=0,c=r;c<s;c+=n)f=u(e,c,c+n,t),this.imuln(i),this.words[0]+f<67108864?this.words[0]+=f:this._iaddn(f);if(0!==o){var l=1;for(f=u(e,c,e.length,t),c=0;c<o;c++)l*=t;this.imuln(l),this.words[0]+f<67108864?this.words[0]+=f:this._iaddn(f)}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){f(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")]=c}catch(e){i.prototype.inspect=c}else i.prototype.inspect=c;function c(){return(this.red?"<BN-R: ":"<BN: ")+this.toString(16)+">"}var l=["","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"],d=[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 n;if(t=0|t||1,16===(e=e||10)||"hex"===e){n="";for(var i=0,a=0,o=0;o<this.length;o++){var s=this.words[o],u=(16777215&(s<<i|a)).toString(16);a=s>>>24-i&16777215,(i+=2)>=26&&(i-=26,o--),n=0!==a||o!==this.length-1?l[6-u.length]+u+n:u+n}for(0!==a&&(n=a.toString(16)+n);n.length%t!=0;)n="0"+n;return 0!==this.negative&&(n="-"+n),n}if(e===(0|e)&&e>=2&&e<=36){var f=d[e],c=p[e];n="";var h=this.clone();for(h.negative=0;!h.isZero();){var m=h.modrn(c).toString(e);n=(h=h.idivn(c)).isZero()?m+n:l[f-m.length]+m+n}for(this.isZero()&&(n="0"+n);n.length%t!=0;)n="0"+n;return 0!==this.negative&&(n="-"+n),n}r(!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&&r(!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,r){r.negative=t.negative^e.negative;var n=e.length+t.length|0;r.length=n,n=n-1|0;var i=0|e.words[0],a=0|t.words[0],o=i*a,s=67108863&o,u=o/67108864|0;r.words[0]=s;for(var f=1;f<n;f++){for(var c=u>>>26,l=67108863&u,d=Math.min(f,t.length-1),p=Math.max(0,f-e.length+1);p<=d;p++){var h=f-p|0;c+=(o=(i=0|e.words[h])*(a=0|t.words[p])+l)/67108864|0,l=67108863&o}r.words[f]=0|l,u=0|c}return 0!==u?r.words[f]=0|u:r.length--,r._strip()}i.prototype.toArrayLike=function(e,t,n){this._strip();var i=this.byteLength(),a=n||Math.max(1,i);r(i<=a,"byte array longer than desired length"),r(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 r=0,n=0,i=0,a=0;i<this.length;i++){var o=this.words[i]<<a|n;e[r++]=255&o,r<e.length&&(e[r++]=o>>8&255),r<e.length&&(e[r++]=o>>16&255),6===a?(r<e.length&&(e[r++]=o>>24&255),n=0,a=0):(n=o>>>24,a+=2)}if(r<e.length)for(e[r++]=n;r<e.length;)e[r++]=0},i.prototype._toArrayLikeBE=function(e,t){for(var r=e.length-1,n=0,i=0,a=0;i<this.length;i++){var o=this.words[i]<<a|n;e[r--]=255&o,r>=0&&(e[r--]=o>>8&255),r>=0&&(e[r--]=o>>16&255),6===a?(r>=0&&(e[r--]=o>>24&255),n=0,a=0):(n=o>>>24,a+=2)}if(r>=0)for(e[r--]=n;r>=0;)e[r--]=0},Math.clz32?i.prototype._countBits=function(e){return 32-Math.clz32(e)}:i.prototype._countBits=function(e){var t=e,r=0;return t>=4096&&(r+=13,t>>>=13),t>=64&&(r+=7,t>>>=7),t>=8&&(r+=4,t>>>=4),t>=2&&(r+=2,t>>>=2),r+t},i.prototype._zeroBits=function(e){if(0===e)return 26;var t=e,r=0;return 0==(8191&t)&&(r+=13,t>>>=13),0==(127&t)&&(r+=7,t>>>=7),0==(15&t)&&(r+=4,t>>>=4),0==(3&t)&&(r+=2,t>>>=2),0==(1&t)&&r++,r},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 r=this._zeroBits(this.words[t]);if(e+=r,26!==r)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 r(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 r=0;r<t.length;r++)this.words[r]=this.words[r]&e.words[r];return this.length=t.length,this._strip()},i.prototype.iand=function(e){return r(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,r;this.length>e.length?(t=this,r=e):(t=e,r=this);for(var n=0;n<r.length;n++)this.words[n]=t.words[n]^r.words[n];if(this!==t)for(;n<t.length;n++)this.words[n]=t.words[n];return this.length=t.length,this._strip()},i.prototype.ixor=function(e){return r(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){r("number"==typeof e&&e>=0);var t=0|Math.ceil(e/26),n=e%26;this._expand(t),n>0&&t--;for(var i=0;i<t;i++)this.words[i]=67108863&~this.words[i];return n>0&&(this.words[i]=~this.words[i]&67108863>>26-n),this._strip()},i.prototype.notn=function(e){return this.clone().inotn(e)},i.prototype.setn=function(e,t){r("number"==typeof e&&e>=0);var n=e/26|0,i=e%26;return this._expand(n+1),this.words[n]=t?this.words[n]|1<<i:this.words[n]&~(1<<i),this._strip()},i.prototype.iadd=function(e){var t,r,n;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?(r=this,n=e):(r=e,n=this);for(var i=0,a=0;a<n.length;a++)t=(0|r.words[a])+(0|n.words[a])+i,this.words[a]=67108863&t,i=t>>>26;for(;0!==i&&a<r.length;a++)t=(0|r.words[a])+i,this.words[a]=67108863&t,i=t>>>26;if(this.length=r.length,0!==i)this.words[this.length]=i,this.length++;else if(r!==this)for(;a<r.length;a++)this.words[a]=r.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 r,n,i=this.cmp(e);if(0===i)return this.negative=0,this.length=1,this.words[0]=0,this;i>0?(r=this,n=e):(r=e,n=this);for(var a=0,o=0;o<n.length;o++)a=(t=(0|r.words[o])-(0|n.words[o])+a)>>26,this.words[o]=67108863&t;for(;0!==a&&o<r.length;o++)a=(t=(0|r.words[o])+a)>>26,this.words[o]=67108863&t;if(0===a&&o<r.length&&r!==this)for(;o<r.length;o++)this.words[o]=r.words[o];return this.length=Math.max(this.length,o),r!==this&&(this.negative=1),this._strip()},i.prototype.sub=function(e){return this.clone().isub(e)};var m=function(e,t,r){var n,i,a,o=e.words,s=t.words,u=r.words,f=0,c=0|o[0],l=8191&c,d=c>>>13,p=0|o[1],h=8191&p,m=p>>>13,y=0|o[2],b=8191&y,g=y>>>13,v=0|o[3],w=8191&v,_=v>>>13,E=0|o[4],T=8191&E,A=E>>>13,S=0|o[5],k=8191&S,O=S>>>13,R=0|o[6],x=8191&R,I=R>>>13,C=0|o[7],N=8191&C,P=C>>>13,M=0|o[8],B=8191&M,D=M>>>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],V=8191&H,G=H>>>13,W=0|s[2],K=8191&W,X=W>>>13,$=0|s[3],J=8191&$,Y=$>>>13,Q=0|s[4],Z=8191&Q,ee=Q>>>13,te=0|s[5],re=8191&te,ne=te>>>13,ie=0|s[6],ae=8191&ie,oe=ie>>>13,se=0|s[7],ue=8191&se,fe=se>>>13,ce=0|s[8],le=8191&ce,de=ce>>>13,pe=0|s[9],he=8191&pe,me=pe>>>13;r.negative=e.negative^t.negative,r.length=19;var ye=(f+(n=Math.imul(l,q))|0)+((8191&(i=(i=Math.imul(l,z))+Math.imul(d,q)|0))<<13)|0;f=((a=Math.imul(d,z))+(i>>>13)|0)+(ye>>>26)|0,ye&=67108863,n=Math.imul(h,q),i=(i=Math.imul(h,z))+Math.imul(m,q)|0,a=Math.imul(m,z);var be=(f+(n=n+Math.imul(l,V)|0)|0)+((8191&(i=(i=i+Math.imul(l,G)|0)+Math.imul(d,V)|0))<<13)|0;f=((a=a+Math.imul(d,G)|0)+(i>>>13)|0)+(be>>>26)|0,be&=67108863,n=Math.imul(b,q),i=(i=Math.imul(b,z))+Math.imul(g,q)|0,a=Math.imul(g,z),n=n+Math.imul(h,V)|0,i=(i=i+Math.imul(h,G)|0)+Math.imul(m,V)|0,a=a+Math.imul(m,G)|0;var ge=(f+(n=n+Math.imul(l,K)|0)|0)+((8191&(i=(i=i+Math.imul(l,X)|0)+Math.imul(d,K)|0))<<13)|0;f=((a=a+Math.imul(d,X)|0)+(i>>>13)|0)+(ge>>>26)|0,ge&=67108863,n=Math.imul(w,q),i=(i=Math.imul(w,z))+Math.imul(_,q)|0,a=Math.imul(_,z),n=n+Math.imul(b,V)|0,i=(i=i+Math.imul(b,G)|0)+Math.imul(g,V)|0,a=a+Math.imul(g,G)|0,n=n+Math.imul(h,K)|0,i=(i=i+Math.imul(h,X)|0)+Math.imul(m,K)|0,a=a+Math.imul(m,X)|0;var ve=(f+(n=n+Math.imul(l,J)|0)|0)+((8191&(i=(i=i+Math.imul(l,Y)|0)+Math.imul(d,J)|0))<<13)|0;f=((a=a+Math.imul(d,Y)|0)+(i>>>13)|0)+(ve>>>26)|0,ve&=67108863,n=Math.imul(T,q),i=(i=Math.imul(T,z))+Math.imul(A,q)|0,a=Math.imul(A,z),n=n+Math.imul(w,V)|0,i=(i=i+Math.imul(w,G)|0)+Math.imul(_,V)|0,a=a+Math.imul(_,G)|0,n=n+Math.imul(b,K)|0,i=(i=i+Math.imul(b,X)|0)+Math.imul(g,K)|0,a=a+Math.imul(g,X)|0,n=n+Math.imul(h,J)|0,i=(i=i+Math.imul(h,Y)|0)+Math.imul(m,J)|0,a=a+Math.imul(m,Y)|0;var we=(f+(n=n+Math.imul(l,Z)|0)|0)+((8191&(i=(i=i+Math.imul(l,ee)|0)+Math.imul(d,Z)|0))<<13)|0;f=((a=a+Math.imul(d,ee)|0)+(i>>>13)|0)+(we>>>26)|0,we&=67108863,n=Math.imul(k,q),i=(i=Math.imul(k,z))+Math.imul(O,q)|0,a=Math.imul(O,z),n=n+Math.imul(T,V)|0,i=(i=i+Math.imul(T,G)|0)+Math.imul(A,V)|0,a=a+Math.imul(A,G)|0,n=n+Math.imul(w,K)|0,i=(i=i+Math.imul(w,X)|0)+Math.imul(_,K)|0,a=a+Math.imul(_,X)|0,n=n+Math.imul(b,J)|0,i=(i=i+Math.imul(b,Y)|0)+Math.imul(g,J)|0,a=a+Math.imul(g,Y)|0,n=n+Math.imul(h,Z)|0,i=(i=i+Math.imul(h,ee)|0)+Math.imul(m,Z)|0,a=a+Math.imul(m,ee)|0;var _e=(f+(n=n+Math.imul(l,re)|0)|0)+((8191&(i=(i=i+Math.imul(l,ne)|0)+Math.imul(d,re)|0))<<13)|0;f=((a=a+Math.imul(d,ne)|0)+(i>>>13)|0)+(_e>>>26)|0,_e&=67108863,n=Math.imul(x,q),i=(i=Math.imul(x,z))+Math.imul(I,q)|0,a=Math.imul(I,z),n=n+Math.imul(k,V)|0,i=(i=i+Math.imul(k,G)|0)+Math.imul(O,V)|0,a=a+Math.imul(O,G)|0,n=n+Math.imul(T,K)|0,i=(i=i+Math.imul(T,X)|0)+Math.imul(A,K)|0,a=a+Math.imul(A,X)|0,n=n+Math.imul(w,J)|0,i=(i=i+Math.imul(w,Y)|0)+Math.imul(_,J)|0,a=a+Math.imul(_,Y)|0,n=n+Math.imul(b,Z)|0,i=(i=i+Math.imul(b,ee)|0)+Math.imul(g,Z)|0,a=a+Math.imul(g,ee)|0,n=n+Math.imul(h,re)|0,i=(i=i+Math.imul(h,ne)|0)+Math.imul(m,re)|0,a=a+Math.imul(m,ne)|0;var Ee=(f+(n=n+Math.imul(l,ae)|0)|0)+((8191&(i=(i=i+Math.imul(l,oe)|0)+Math.imul(d,ae)|0))<<13)|0;f=((a=a+Math.imul(d,oe)|0)+(i>>>13)|0)+(Ee>>>26)|0,Ee&=67108863,n=Math.imul(N,q),i=(i=Math.imul(N,z))+Math.imul(P,q)|0,a=Math.imul(P,z),n=n+Math.imul(x,V)|0,i=(i=i+Math.imul(x,G)|0)+Math.imul(I,V)|0,a=a+Math.imul(I,G)|0,n=n+Math.imul(k,K)|0,i=(i=i+Math.imul(k,X)|0)+Math.imul(O,K)|0,a=a+Math.imul(O,X)|0,n=n+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,n=n+Math.imul(w,Z)|0,i=(i=i+Math.imul(w,ee)|0)+Math.imul(_,Z)|0,a=a+Math.imul(_,ee)|0,n=n+Math.imul(b,re)|0,i=(i=i+Math.imul(b,ne)|0)+Math.imul(g,re)|0,a=a+Math.imul(g,ne)|0,n=n+Math.imul(h,ae)|0,i=(i=i+Math.imul(h,oe)|0)+Math.imul(m,ae)|0,a=a+Math.imul(m,oe)|0;var Te=(f+(n=n+Math.imul(l,ue)|0)|0)+((8191&(i=(i=i+Math.imul(l,fe)|0)+Math.imul(d,ue)|0))<<13)|0;f=((a=a+Math.imul(d,fe)|0)+(i>>>13)|0)+(Te>>>26)|0,Te&=67108863,n=Math.imul(B,q),i=(i=Math.imul(B,z))+Math.imul(D,q)|0,a=Math.imul(D,z),n=n+Math.imul(N,V)|0,i=(i=i+Math.imul(N,G)|0)+Math.imul(P,V)|0,a=a+Math.imul(P,G)|0,n=n+Math.imul(x,K)|0,i=(i=i+Math.imul(x,X)|0)+Math.imul(I,K)|0,a=a+Math.imul(I,X)|0,n=n+Math.imul(k,J)|0,i=(i=i+Math.imul(k,Y)|0)+Math.imul(O,J)|0,a=a+Math.imul(O,Y)|0,n=n+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,n=n+Math.imul(w,re)|0,i=(i=i+Math.imul(w,ne)|0)+Math.imul(_,re)|0,a=a+Math.imul(_,ne)|0,n=n+Math.imul(b,ae)|0,i=(i=i+Math.imul(b,oe)|0)+Math.imul(g,ae)|0,a=a+Math.imul(g,oe)|0,n=n+Math.imul(h,ue)|0,i=(i=i+Math.imul(h,fe)|0)+Math.imul(m,ue)|0,a=a+Math.imul(m,fe)|0;var Ae=(f+(n=n+Math.imul(l,le)|0)|0)+((8191&(i=(i=i+Math.imul(l,de)|0)+Math.imul(d,le)|0))<<13)|0;f=((a=a+Math.imul(d,de)|0)+(i>>>13)|0)+(Ae>>>26)|0,Ae&=67108863,n=Math.imul(L,q),i=(i=Math.imul(L,z))+Math.imul(U,q)|0,a=Math.imul(U,z),n=n+Math.imul(B,V)|0,i=(i=i+Math.imul(B,G)|0)+Math.imul(D,V)|0,a=a+Math.imul(D,G)|0,n=n+Math.imul(N,K)|0,i=(i=i+Math.imul(N,X)|0)+Math.imul(P,K)|0,a=a+Math.imul(P,X)|0,n=n+Math.imul(x,J)|0,i=(i=i+Math.imul(x,Y)|0)+Math.imul(I,J)|0,a=a+Math.imul(I,Y)|0,n=n+Math.imul(k,Z)|0,i=(i=i+Math.imul(k,ee)|0)+Math.imul(O,Z)|0,a=a+Math.imul(O,ee)|0,n=n+Math.imul(T,re)|0,i=(i=i+Math.imul(T,ne)|0)+Math.imul(A,re)|0,a=a+Math.imul(A,ne)|0,n=n+Math.imul(w,ae)|0,i=(i=i+Math.imul(w,oe)|0)+Math.imul(_,ae)|0,a=a+Math.imul(_,oe)|0,n=n+Math.imul(b,ue)|0,i=(i=i+Math.imul(b,fe)|0)+Math.imul(g,ue)|0,a=a+Math.imul(g,fe)|0,n=n+Math.imul(h,le)|0,i=(i=i+Math.imul(h,de)|0)+Math.imul(m,le)|0,a=a+Math.imul(m,de)|0;var Se=(f+(n=n+Math.imul(l,he)|0)|0)+((8191&(i=(i=i+Math.imul(l,me)|0)+Math.imul(d,he)|0))<<13)|0;f=((a=a+Math.imul(d,me)|0)+(i>>>13)|0)+(Se>>>26)|0,Se&=67108863,n=Math.imul(L,V),i=(i=Math.imul(L,G))+Math.imul(U,V)|0,a=Math.imul(U,G),n=n+Math.imul(B,K)|0,i=(i=i+Math.imul(B,X)|0)+Math.imul(D,K)|0,a=a+Math.imul(D,X)|0,n=n+Math.imul(N,J)|0,i=(i=i+Math.imul(N,Y)|0)+Math.imul(P,J)|0,a=a+Math.imul(P,Y)|0,n=n+Math.imul(x,Z)|0,i=(i=i+Math.imul(x,ee)|0)+Math.imul(I,Z)|0,a=a+Math.imul(I,ee)|0,n=n+Math.imul(k,re)|0,i=(i=i+Math.imul(k,ne)|0)+Math.imul(O,re)|0,a=a+Math.imul(O,ne)|0,n=n+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,n=n+Math.imul(w,ue)|0,i=(i=i+Math.imul(w,fe)|0)+Math.imul(_,ue)|0,a=a+Math.imul(_,fe)|0,n=n+Math.imul(b,le)|0,i=(i=i+Math.imul(b,de)|0)+Math.imul(g,le)|0,a=a+Math.imul(g,de)|0;var ke=(f+(n=n+Math.imul(h,he)|0)|0)+((8191&(i=(i=i+Math.imul(h,me)|0)+Math.imul(m,he)|0))<<13)|0;f=((a=a+Math.imul(m,me)|0)+(i>>>13)|0)+(ke>>>26)|0,ke&=67108863,n=Math.imul(L,K),i=(i=Math.imul(L,X))+Math.imul(U,K)|0,a=Math.imul(U,X),n=n+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,n=n+Math.imul(N,Z)|0,i=(i=i+Math.imul(N,ee)|0)+Math.imul(P,Z)|0,a=a+Math.imul(P,ee)|0,n=n+Math.imul(x,re)|0,i=(i=i+Math.imul(x,ne)|0)+Math.imul(I,re)|0,a=a+Math.imul(I,ne)|0,n=n+Math.imul(k,ae)|0,i=(i=i+Math.imul(k,oe)|0)+Math.imul(O,ae)|0,a=a+Math.imul(O,oe)|0,n=n+Math.imul(T,ue)|0,i=(i=i+Math.imul(T,fe)|0)+Math.imul(A,ue)|0,a=a+Math.imul(A,fe)|0,n=n+Math.imul(w,le)|0,i=(i=i+Math.imul(w,de)|0)+Math.imul(_,le)|0,a=a+Math.imul(_,de)|0;var Oe=(f+(n=n+Math.imul(b,he)|0)|0)+((8191&(i=(i=i+Math.imul(b,me)|0)+Math.imul(g,he)|0))<<13)|0;f=((a=a+Math.imul(g,me)|0)+(i>>>13)|0)+(Oe>>>26)|0,Oe&=67108863,n=Math.imul(L,J),i=(i=Math.imul(L,Y))+Math.imul(U,J)|0,a=Math.imul(U,Y),n=n+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,n=n+Math.imul(N,re)|0,i=(i=i+Math.imul(N,ne)|0)+Math.imul(P,re)|0,a=a+Math.imul(P,ne)|0,n=n+Math.imul(x,ae)|0,i=(i=i+Math.imul(x,oe)|0)+Math.imul(I,ae)|0,a=a+Math.imul(I,oe)|0,n=n+Math.imul(k,ue)|0,i=(i=i+Math.imul(k,fe)|0)+Math.imul(O,ue)|0,a=a+Math.imul(O,fe)|0,n=n+Math.imul(T,le)|0,i=(i=i+Math.imul(T,de)|0)+Math.imul(A,le)|0,a=a+Math.imul(A,de)|0;var Re=(f+(n=n+Math.imul(w,he)|0)|0)+((8191&(i=(i=i+Math.imul(w,me)|0)+Math.imul(_,he)|0))<<13)|0;f=((a=a+Math.imul(_,me)|0)+(i>>>13)|0)+(Re>>>26)|0,Re&=67108863,n=Math.imul(L,Z),i=(i=Math.imul(L,ee))+Math.imul(U,Z)|0,a=Math.imul(U,ee),n=n+Math.imul(B,re)|0,i=(i=i+Math.imul(B,ne)|0)+Math.imul(D,re)|0,a=a+Math.imul(D,ne)|0,n=n+Math.imul(N,ae)|0,i=(i=i+Math.imul(N,oe)|0)+Math.imul(P,ae)|0,a=a+Math.imul(P,oe)|0,n=n+Math.imul(x,ue)|0,i=(i=i+Math.imul(x,fe)|0)+Math.imul(I,ue)|0,a=a+Math.imul(I,fe)|0,n=n+Math.imul(k,le)|0,i=(i=i+Math.imul(k,de)|0)+Math.imul(O,le)|0,a=a+Math.imul(O,de)|0;var xe=(f+(n=n+Math.imul(T,he)|0)|0)+((8191&(i=(i=i+Math.imul(T,me)|0)+Math.imul(A,he)|0))<<13)|0;f=((a=a+Math.imul(A,me)|0)+(i>>>13)|0)+(xe>>>26)|0,xe&=67108863,n=Math.imul(L,re),i=(i=Math.imul(L,ne))+Math.imul(U,re)|0,a=Math.imul(U,ne),n=n+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,n=n+Math.imul(N,ue)|0,i=(i=i+Math.imul(N,fe)|0)+Math.imul(P,ue)|0,a=a+Math.imul(P,fe)|0,n=n+Math.imul(x,le)|0,i=(i=i+Math.imul(x,de)|0)+Math.imul(I,le)|0,a=a+Math.imul(I,de)|0;var Ie=(f+(n=n+Math.imul(k,he)|0)|0)+((8191&(i=(i=i+Math.imul(k,me)|0)+Math.imul(O,he)|0))<<13)|0;f=((a=a+Math.imul(O,me)|0)+(i>>>13)|0)+(Ie>>>26)|0,Ie&=67108863,n=Math.imul(L,ae),i=(i=Math.imul(L,oe))+Math.imul(U,ae)|0,a=Math.imul(U,oe),n=n+Math.imul(B,ue)|0,i=(i=i+Math.imul(B,fe)|0)+Math.imul(D,ue)|0,a=a+Math.imul(D,fe)|0,n=n+Math.imul(N,le)|0,i=(i=i+Math.imul(N,de)|0)+Math.imul(P,le)|0,a=a+Math.imul(P,de)|0;var Ce=(f+(n=n+Math.imul(x,he)|0)|0)+((8191&(i=(i=i+Math.imul(x,me)|0)+Math.imul(I,he)|0))<<13)|0;f=((a=a+Math.imul(I,me)|0)+(i>>>13)|0)+(Ce>>>26)|0,Ce&=67108863,n=Math.imul(L,ue),i=(i=Math.imul(L,fe))+Math.imul(U,ue)|0,a=Math.imul(U,fe),n=n+Math.imul(B,le)|0,i=(i=i+Math.imul(B,de)|0)+Math.imul(D,le)|0,a=a+Math.imul(D,de)|0;var Ne=(f+(n=n+Math.imul(N,he)|0)|0)+((8191&(i=(i=i+Math.imul(N,me)|0)+Math.imul(P,he)|0))<<13)|0;f=((a=a+Math.imul(P,me)|0)+(i>>>13)|0)+(Ne>>>26)|0,Ne&=67108863,n=Math.imul(L,le),i=(i=Math.imul(L,de))+Math.imul(U,le)|0,a=Math.imul(U,de);var Pe=(f+(n=n+Math.imul(B,he)|0)|0)+((8191&(i=(i=i+Math.imul(B,me)|0)+Math.imul(D,he)|0))<<13)|0;f=((a=a+Math.imul(D,me)|0)+(i>>>13)|0)+(Pe>>>26)|0,Pe&=67108863;var Me=(f+(n=Math.imul(L,he))|0)+((8191&(i=(i=Math.imul(L,me))+Math.imul(U,he)|0))<<13)|0;return f=((a=Math.imul(U,me))+(i>>>13)|0)+(Me>>>26)|0,Me&=67108863,u[0]=ye,u[1]=be,u[2]=ge,u[3]=ve,u[4]=we,u[5]=_e,u[6]=Ee,u[7]=Te,u[8]=Ae,u[9]=Se,u[10]=ke,u[11]=Oe,u[12]=Re,u[13]=xe,u[14]=Ie,u[15]=Ce,u[16]=Ne,u[17]=Pe,u[18]=Me,0!==f&&(u[19]=f,r.length++),r};function y(e,t,r){r.negative=t.negative^e.negative,r.length=e.length+t.length;for(var n=0,i=0,a=0;a<r.length-1;a++){var o=i;i=0;for(var s=67108863&n,u=Math.min(a,t.length-1),f=Math.max(0,a-e.length+1);f<=u;f++){var c=a-f,l=(0|e.words[c])*(0|t.words[f]),d=67108863&l;s=67108863&(d=d+s|0),i+=(o=(o=o+(l/67108864|0)|0)+(d>>>26)|0)>>>26,o&=67108863}r.words[a]=s,n=o,o=i}return 0!==n?r.words[a]=n:r.length--,r._strip()}function b(e,t,r){return y(e,t,r)}Math.imul||(m=h),i.prototype.mulTo=function(e,t){var r=this.length+e.length;return 10===this.length&&10===e.length?m(this,e,t):r<63?h(this,e,t):r<1024?y(this,e,t):b(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),b(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),r("number"==typeof e),r(e<67108864);for(var n=0,i=0;i<this.length;i++){var a=(0|this.words[i])*e,o=(67108863&a)+(67108863&n);n>>=26,n+=a/67108864|0,n+=o>>>26,this.words[i]=67108863&o}return 0!==n&&(this.words[i]=n,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()),r=0;r<t.length;r++){var n=r/26|0,i=r%26;t[r]=e.words[n]>>>i&1}return t}(e);if(0===t.length)return new i(1);for(var r=this,n=0;n<t.length&&0===t[n];n++,r=r.sqr());if(++n<t.length)for(var a=r.sqr();n<t.length;n++,a=a.sqr())0!==t[n]&&(r=r.mul(a));return r},i.prototype.iushln=function(e){r("number"==typeof e&&e>=0);var t,n=e%26,i=(e-n)/26,a=67108863>>>26-n<<26-n;if(0!==n){var o=0;for(t=0;t<this.length;t++){var s=this.words[t]&a,u=(0|this.words[t])-s<<n;this.words[t]=u|o,o=s>>>26-n}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 r(0===this.negative),this.iushln(e)},i.prototype.iushrn=function(e,t,n){var i;r("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,u=n;if(i-=o,i=Math.max(0,i),u){for(var f=0;f<o;f++)u.words[f]=this.words[f];u.length=o}if(0===o);else if(this.length>o)for(this.length-=o,f=0;f<this.length;f++)this.words[f]=this.words[f+o];else this.words[0]=0,this.length=1;var c=0;for(f=this.length-1;f>=0&&(0!==c||f>=i);f--){var l=0|this.words[f];this.words[f]=c<<26-a|l>>>a,c=l&s}return u&&0!==c&&(u.words[u.length++]=c),0===this.length&&(this.words[0]=0,this.length=1),this._strip()},i.prototype.ishrn=function(e,t,n){return r(0===this.negative),this.iushrn(e,t,n)},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){r("number"==typeof e&&e>=0);var t=e%26,n=(e-t)/26,i=1<<t;return!(this.length<=n)&&!!(this.words[n]&i)},i.prototype.imaskn=function(e){r("number"==typeof e&&e>=0);var t=e%26,n=(e-t)/26;if(r(0===this.negative,"imaskn works only with positive numbers"),this.length<=n)return this;if(0!==t&&n++,this.length=Math.min(n,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 r("number"==typeof e),r(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(r("number"==typeof e),r(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,n){var i,a,o=e.length+n;this._expand(o);var s=0;for(i=0;i<e.length;i++){a=(0|this.words[i+n])+s;var u=(0|e.words[i])*t;s=((a-=67108863&u)>>26)-(u/67108864|0),this.words[i+n]=67108863&a}for(;i<this.length-n;i++)s=(a=(0|this.words[i+n])+s)>>26,this.words[i+n]=67108863&a;if(0===s)return this._strip();for(r(-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 r=(this.length,e.length),n=this.clone(),a=e,o=0|a.words[a.length-1];0!==(r=26-this._countBits(o))&&(a=a.ushln(r),n.iushln(r),o=0|a.words[a.length-1]);var s,u=n.length-a.length;if("mod"!==t){(s=new i(null)).length=u+1,s.words=new Array(s.length);for(var f=0;f<s.length;f++)s.words[f]=0}var c=n.clone()._ishlnsubmul(a,1,u);0===c.negative&&(n=c,s&&(s.words[u]=1));for(var l=u-1;l>=0;l--){var d=67108864*(0|n.words[a.length+l])+(0|n.words[a.length+l-1]);for(d=Math.min(d/o|0,67108863),n._ishlnsubmul(a,d,l);0!==n.negative;)d--,n.negative=0,n._ishlnsubmul(a,1,l),n.isZero()||(n.negative^=1);s&&(s.words[l]=d)}return s&&s._strip(),n._strip(),"div"!==t&&0!==r&&n.iushrn(r),{div:s||null,mod:n}},i.prototype.divmod=function(e,t,n){return r(!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(),n&&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(),n&&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 r=0!==t.div.negative?t.mod.isub(e):t.mod,n=e.ushrn(1),i=e.andln(1),a=r.cmp(n);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),r(e<=67108863);for(var n=(1<<26)%e,i=0,a=this.length-1;a>=0;a--)i=(n*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),r(e<=67108863);for(var n=0,i=this.length-1;i>=0;i--){var a=(0|this.words[i])+67108864*n;this.words[i]=a/e|0,n=a%e}return this._strip(),t?this.ineg():this},i.prototype.divn=function(e){return this.clone().idivn(e)},i.prototype.egcd=function(e){r(0===e.negative),r(!e.isZero());var t=this,n=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),u=new i(1),f=0;t.isEven()&&n.isEven();)t.iushrn(1),n.iushrn(1),++f;for(var c=n.clone(),l=t.clone();!t.isZero();){for(var d=0,p=1;0==(t.words[0]&p)&&d<26;++d,p<<=1);if(d>0)for(t.iushrn(d);d-- >0;)(a.isOdd()||o.isOdd())&&(a.iadd(c),o.isub(l)),a.iushrn(1),o.iushrn(1);for(var h=0,m=1;0==(n.words[0]&m)&&h<26;++h,m<<=1);if(h>0)for(n.iushrn(h);h-- >0;)(s.isOdd()||u.isOdd())&&(s.iadd(c),u.isub(l)),s.iushrn(1),u.iushrn(1);t.cmp(n)>=0?(t.isub(n),a.isub(s),o.isub(u)):(n.isub(t),s.isub(a),u.isub(o))}return{a:s,b:u,gcd:n.iushln(f)}},i.prototype._invmp=function(e){r(0===e.negative),r(!e.isZero());var t=this,n=e.clone();t=0!==t.negative?t.umod(e):t.clone();for(var a,o=new i(1),s=new i(0),u=n.clone();t.cmpn(1)>0&&n.cmpn(1)>0;){for(var f=0,c=1;0==(t.words[0]&c)&&f<26;++f,c<<=1);if(f>0)for(t.iushrn(f);f-- >0;)o.isOdd()&&o.iadd(u),o.iushrn(1);for(var l=0,d=1;0==(n.words[0]&d)&&l<26;++l,d<<=1);if(l>0)for(n.iushrn(l);l-- >0;)s.isOdd()&&s.iadd(u),s.iushrn(1);t.cmp(n)>=0?(t.isub(n),o.isub(s)):(n.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(),r=e.clone();t.negative=0,r.negative=0;for(var n=0;t.isEven()&&r.isEven();n++)t.iushrn(1),r.iushrn(1);for(;;){for(;t.isEven();)t.iushrn(1);for(;r.isEven();)r.iushrn(1);var i=t.cmp(r);if(i<0){var a=t;t=r,r=a}else if(0===i||0===r.cmpn(1))break;t.isub(r)}return r.iushln(n)},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){r("number"==typeof e);var t=e%26,n=(e-t)/26,i=1<<t;if(this.length<=n)return this._expand(n+1),this.words[n]|=i,this;for(var a=i,o=n;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,n=e<0;if(0!==this.negative&&!n)return-1;if(0===this.negative&&n)return 1;if(this._strip(),this.length>1)t=1;else{n&&(e=-e),r(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,r=this.length-1;r>=0;r--){var n=0|this.words[r],i=0|e.words[r];if(n!==i){n<i?t=-1:n>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 r(!this.red,"Already a number in reduction context"),r(0===this.negative,"red works only with positives"),e.convertTo(this)._forceRed(e)},i.prototype.fromRed=function(){return r(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 r(!this.red,"Already a number in reduction context"),this._forceRed(e)},i.prototype.redAdd=function(e){return r(this.red,"redAdd works only with red numbers"),this.red.add(this,e)},i.prototype.redIAdd=function(e){return r(this.red,"redIAdd works only with red numbers"),this.red.iadd(this,e)},i.prototype.redSub=function(e){return r(this.red,"redSub works only with red numbers"),this.red.sub(this,e)},i.prototype.redISub=function(e){return r(this.red,"redISub works only with red numbers"),this.red.isub(this,e)},i.prototype.redShl=function(e){return r(this.red,"redShl works only with red numbers"),this.red.shl(this,e)},i.prototype.redMul=function(e){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.mul(this,e)},i.prototype.redIMul=function(e){return r(this.red,"redMul works only with red numbers"),this.red._verify2(this,e),this.red.imul(this,e)},i.prototype.redSqr=function(){return r(this.red,"redSqr works only with red numbers"),this.red._verify1(this),this.red.sqr(this)},i.prototype.redISqr=function(){return r(this.red,"redISqr works only with red numbers"),this.red._verify1(this),this.red.isqr(this)},i.prototype.redSqrt=function(){return r(this.red,"redSqrt works only with red numbers"),this.red._verify1(this),this.red.sqrt(this)},i.prototype.redInvm=function(){return r(this.red,"redInvm works only with red numbers"),this.red._verify1(this),this.red.invm(this)},i.prototype.redNeg=function(){return r(this.red,"redNeg works only with red numbers"),this.red._verify1(this),this.red.neg(this)},i.prototype.redPow=function(e){return r(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 r(e.gtn(1),"modulus must be greater than 1"),this.m=e,this.prime=null}function S(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,r=e;do{this.split(r,this.tmp),t=(r=(r=this.imulK(r)).iadd(this.tmp)).bitLength()}while(t>this.n);var n=t<this.n?-1:r.ucmp(this.p);return 0===n?(r.words[0]=0,r.length=1):n>0?r.isub(this.p):void 0!==r.strip?r.strip():r._strip(),r},v.prototype.split=function(e,t){e.iushrn(this.n,0,t)},v.prototype.imulK=function(e){return e.imul(this.k)},n(w,v),w.prototype.split=function(e,t){for(var r=4194303,n=Math.min(e.length,9),i=0;i<n;i++)t.words[i]=e.words[i];if(t.length=n,e.length<=9)return e.words[0]=0,void(e.length=1);var a=e.words[9];for(t.words[t.length++]=a&r,i=10;i<e.length;i++){var o=0|e.words[i];e.words[i-10]=(o&r)<<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,r=0;r<e.length;r++){var n=0|e.words[r];t+=977*n,e.words[r]=67108863&t,t=64*n+(t/67108864|0)}return 0===e.words[e.length-1]&&(e.length--,0===e.words[e.length-1]&&e.length--),e},n(_,v),n(E,v),n(T,v),T.prototype.imulK=function(e){for(var t=0,r=0;r<e.length;r++){var n=19*(0|e.words[r])+t,i=67108863&n;n>>>=26,e.words[r]=i,t=n}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){r(0===e.negative,"red works only with positives"),r(e.red,"red works only with red numbers")},A.prototype._verify2=function(e,t){r(0==(e.negative|t.negative),"red works only with positives"),r(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):(f(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 r=e.add(t);return r.cmp(this.m)>=0&&r.isub(this.m),r._forceRed(this)},A.prototype.iadd=function(e,t){this._verify2(e,t);var r=e.iadd(t);return r.cmp(this.m)>=0&&r.isub(this.m),r},A.prototype.sub=function(e,t){this._verify2(e,t);var r=e.sub(t);return r.cmpn(0)<0&&r.iadd(this.m),r._forceRed(this)},A.prototype.isub=function(e,t){this._verify2(e,t);var r=e.isub(t);return r.cmpn(0)<0&&r.iadd(this.m),r},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(r(t%2==1),3===t){var n=this.m.add(new i(1)).iushrn(2);return this.pow(e,n)}for(var a=this.m.subn(1),o=0;!a.isZero()&&0===a.andln(1);)o++,a.iushrn(1);r(!a.isZero());var s=new i(1).toRed(this),u=s.redNeg(),f=this.m.subn(1).iushrn(1),c=this.m.bitLength();for(c=new i(2*c*c).toRed(this);0!==this.pow(c,f).cmp(u);)c.redIAdd(u);for(var l=this.pow(c,a),d=this.pow(e,a.addn(1).iushrn(1)),p=this.pow(e,a),h=o;0!==p.cmp(s);){for(var m=p,y=0;0!==m.cmp(s);y++)m=m.redSqr();r(y<h);var b=this.pow(l,new i(1).iushln(h-y-1));d=d.redMul(b),l=b.redSqr(),p=p.redMul(l),h=y}return d},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 r=new Array(16);r[0]=new i(1).toRed(this),r[1]=e;for(var n=2;n<r.length;n++)r[n]=this.mul(r[n-1],e);var a=r[0],o=0,s=0,u=t.bitLength()%26;for(0===u&&(u=26),n=t.length-1;n>=0;n--){for(var f=t.words[n],c=u-1;c>=0;c--){var l=f>>c&1;a!==r[0]&&(a=this.sqr(a)),0!==l||0!==o?(o<<=1,o|=l,(4===++s||0===n&&0===c)&&(a=this.mul(a,r[o]),s=0,o=0)):s=0}u=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 S(e)},n(S,A),S.prototype.convertTo=function(e){return this.imod(e.ushln(this.shift))},S.prototype.convertFrom=function(e){var t=this.imod(e.mul(this.rinv));return t.red=null,t},S.prototype.imul=function(e,t){if(e.isZero()||t.isZero())return e.words[0]=0,e.length=1,e;var r=e.imul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),i=r.isub(n).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)},S.prototype.mul=function(e,t){if(e.isZero()||t.isZero())return new i(0)._forceRed(this);var r=e.mul(t),n=r.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m),a=r.isub(n).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)},S.prototype.invm=function(e){return this.imod(e._invmp(this.m).mul(this.r2))._forceRed(this)}}(e,on)}(fn);var li=fn.exports,di=sn(li);let pi=!1,hi=!1;const mi={debug:1,default:2,info:2,warning:3,error:4,off:5};let yi=mi.default,bi=null;const gi=function(){try{const e=[];if(["NFD","NFC","NFKD","NFKC"].forEach((t=>{try{if("test"!=="test".normalize(t))throw new Error("bad normalize")}catch(r){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 vi,wi;!function(e){e.DEBUG="DEBUG",e.INFO="INFO",e.WARNING="WARNING",e.ERROR="ERROR",e.OFF="OFF"}(vi||(vi={})),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"}(wi||(wi={}));const _i="0123456789abcdef";let Ei=class e{constructor(e){Object.defineProperty(this,"version",{enumerable:!0,value:e,writable:!1})}_log(e,t){const r=e.toLowerCase();null==mi[r]&&this.throwArgumentError("invalid log level name","logLevel",e),yi>mi[r]||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,r,n){if(hi)return this.makeError("censored error",r,{});r||(r=e.errors.UNKNOWN_ERROR),n||(n={});const i=[];Object.keys(n).forEach((e=>{const t=n[e];try{if(t instanceof Uint8Array){let r="";for(let e=0;e<t.length;e++)r+=_i[t[e]>>4],r+=_i[15&t[e]];i.push(e+"=Uint8Array(0x"+r+")")}else i.push(e+"="+JSON.stringify(t))}catch(t){i.push(e+"="+JSON.stringify(n[e].toString()))}})),i.push(`code=${r}`),i.push(`version=${this.version}`);const a=t;let o="";switch(r){case wi.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 wi.CALL_EXCEPTION:case wi.INSUFFICIENT_FUNDS:case wi.MISSING_NEW:case wi.NONCE_EXPIRED:case wi.REPLACEMENT_UNDERPRICED:case wi.TRANSACTION_REPLACED:case wi.UNPREDICTABLE_GAS_LIMIT:o=r}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=r,Object.keys(n).forEach((function(e){s[e]=n[e]})),s}throwError(e,t,r){throw this.makeError(e,t,r)}throwArgumentError(t,r,n){return this.throwError(t,e.errors.INVALID_ARGUMENT,{argument:r,value:n})}assert(e,t,r,n){e||this.throwError(t,r,n)}assertArgument(e,t,r,n){e||this.throwArgumentError(t,r,n)}checkNormalize(t){gi&&this.throwError("platform missing String.prototype.normalize",e.errors.UNSUPPORTED_OPERATION,{operation:"String.prototype.normalize",form:gi})}checkSafeUint53(t,r){"number"==typeof t&&(null==r&&(r="value not safe"),(t<0||t>=9007199254740991)&&this.throwError(r,e.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"out-of-safe-range",value:t}),t%1&&this.throwError(r,e.errors.NUMERIC_FAULT,{operation:"checkSafeInteger",fault:"non-integer",value:t}))}checkArgumentCount(t,r,n){n=n?": "+n:"",t<r&&this.throwError("missing argument"+n,e.errors.MISSING_ARGUMENT,{count:t,expectedCount:r}),t>r&&this.throwError("too many arguments"+n,e.errors.UNEXPECTED_ARGUMENT,{count:t,expectedCount:r})}checkNew(t,r){t!==Object&&null!=t||this.throwError("missing new",e.errors.MISSING_NEW,{name:r.name})}checkAbstract(t,r){t===r?this.throwError("cannot instantiate abstract class "+JSON.stringify(r.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:r.name})}static globalLogger(){return bi||(bi=new e("logger/5.7.0")),bi}static setCensorship(t,r){if(!t&&r&&this.globalLogger().throwError("cannot permanently disable censorship",e.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"}),pi){if(!t)return;this.globalLogger().throwError("error censorship permanent",e.errors.UNSUPPORTED_OPERATION,{operation:"setCensorship"})}hi=!!t,pi=!!r}static setLogLevel(t){const r=mi[t.toLowerCase()];null!=r?yi=r:e.globalLogger().warn("invalid log level - "+t)}static from(t){return new e(t)}};Ei.errors=wi,Ei.levels=vi;var Ti=Object.freeze({__proto__:null,get ErrorCode(){return wi},get LogLevel(){return vi},Logger:Ei});const Ai=new Ei("bytes/5.7.0");function Si(e){return!!e.toHexString}function ki(e){return e.slice||(e.slice=function(){const t=Array.prototype.slice.call(arguments);return ki(new Uint8Array(Array.prototype.slice.apply(e,t)))}),e}function Oi(e){return Mi(e)&&!(e.length%2)||xi(e)}function Ri(e){return"number"==typeof e&&e==e&&e%1==0}function xi(e){if(null==e)return!1;if(e.constructor===Uint8Array)return!0;if("string"==typeof e)return!1;if(!Ri(e.length)||e.length<0)return!1;for(let t=0;t<e.length;t++){const r=e[t];if(!Ri(r)||r<0||r>=256)return!1}return!0}function Ii(e,t){if(t||(t={}),"number"==typeof e){Ai.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),ki(new Uint8Array(t))}if(t.allowMissingPrefix&&"string"==typeof e&&"0x"!==e.substring(0,2)&&(e="0x"+e),Si(e)&&(e=e.toHexString()),Mi(e)){let r=e.substring(2);r.length%2&&("left"===t.hexPad?r="0"+r:"right"===t.hexPad?r+="0":Ai.throwArgumentError("hex data is odd-length","value",e));const n=[];for(let e=0;e<r.length;e+=2)n.push(parseInt(r.substring(e,e+2),16));return ki(new Uint8Array(n))}return xi(e)?ki(new Uint8Array(e)):Ai.throwArgumentError("invalid arrayify value","value",e)}function Ci(e){const t=e.map((e=>Ii(e))),r=t.reduce(((e,t)=>e+t.length),0),n=new Uint8Array(r);return t.reduce(((e,t)=>(n.set(t,e),e+t.length)),0),ki(n)}function Ni(e){let t=Ii(e);if(0===t.length)return t;let r=0;for(;r<t.length&&0===t[r];)r++;return r&&(t=t.slice(r)),t}function Pi(e,t){(e=Ii(e)).length>t&&Ai.throwArgumentError("value out of range","value",arguments[0]);const r=new Uint8Array(t);return r.set(e,t-e.length),ki(r)}function Mi(e,t){return!("string"!=typeof e||!e.match(/^0x[0-9A-Fa-f]*$/))&&(!t||e.length===2+2*t)}const Bi="0123456789abcdef";function Di(e,t){if(t||(t={}),"number"==typeof e){Ai.checkSafeUint53(e,"invalid hexlify value");let t="";for(;e;)t=Bi[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),Si(e))return e.toHexString();if(Mi(e))return e.length%2&&("left"===t.hexPad?e="0x0"+e.substring(2):"right"===t.hexPad?e+="0":Ai.throwArgumentError("hex data is odd-length","value",e)),e.toLowerCase();if(xi(e)){let t="0x";for(let r=0;r<e.length;r++){let n=e[r];t+=Bi[(240&n)>>4]+Bi[15&n]}return t}return Ai.throwArgumentError("invalid hexlify value","value",e)}function Fi(e){if("string"!=typeof e)e=Di(e);else if(!Mi(e)||e.length%2)return null;return(e.length-2)/2}function Li(e,t,r){return"string"!=typeof e?e=Di(e):(!Mi(e)||e.length%2)&&Ai.throwArgumentError("invalid hexData","value",e),t=2+2*t,null!=r?"0x"+e.substring(t,2+2*r):"0x"+e.substring(t)}function Ui(e){let t="0x";return e.forEach((e=>{t+=Di(e).substring(2)})),t}function ji(e){const t=qi(Di(e,{hexPad:"left"}));return"0x"===t?"0x0":t}function qi(e){"string"!=typeof e&&(e=Di(e)),Mi(e)||Ai.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 zi(e,t){for("string"!=typeof e?e=Di(e):Mi(e)||Ai.throwArgumentError("invalid hex string","value",e),e.length>2*t+2&&Ai.throwArgumentError("value out of range","value",arguments[1]);e.length<2*t+2;)e="0x0"+e.substring(2);return e}function Hi(e){const t={r:"0x",s:"0x",_vs:"0x",recoveryParam:0,v:0,yParityAndS:"0x",compact:"0x"};if(Oi(e)){let r=Ii(e);64===r.length?(t.v=27+(r[32]>>7),r[32]&=127,t.r=Di(r.slice(0,32)),t.s=Di(r.slice(32,64))):65===r.length?(t.r=Di(r.slice(0,32)),t.s=Di(r.slice(32,64)),t.v=r[64]):Ai.throwArgumentError("invalid signature string","signature",e),t.v<27&&(0===t.v||1===t.v?t.v+=27:Ai.throwArgumentError("signature invalid v byte","signature",e)),t.recoveryParam=1-t.v%2,t.recoveryParam&&(r[32]|=128),t._vs=Di(r.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 r=Pi(Ii(t._vs),32);t._vs=Di(r);const n=r[0]>=128?1:0;null==t.recoveryParam?t.recoveryParam=n:t.recoveryParam!==n&&Ai.throwArgumentError("signature recoveryParam mismatch _vs","signature",e),r[0]&=127;const i=Di(r);null==t.s?t.s=i:t.s!==i&&Ai.throwArgumentError("signature v mismatch _vs","signature",e)}if(null==t.recoveryParam)null==t.v?Ai.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 r=0===t.v||1===t.v?t.v:1-t.v%2;t.recoveryParam!==r&&Ai.throwArgumentError("signature recoveryParam mismatch v","signature",e)}null!=t.r&&Mi(t.r)?t.r=zi(t.r,32):Ai.throwArgumentError("signature missing or invalid r","signature",e),null!=t.s&&Mi(t.s)?t.s=zi(t.s,32):Ai.throwArgumentError("signature missing or invalid s","signature",e);const r=Ii(t.s);r[0]>=128&&Ai.throwArgumentError("signature s out of range","signature",e),t.recoveryParam&&(r[0]|=128);const n=Di(r);t._vs&&(Mi(t._vs)||Ai.throwArgumentError("signature invalid _vs","signature",e),t._vs=zi(t._vs,32)),null==t._vs?t._vs=n:t._vs!==n&&Ai.throwArgumentError("signature _vs mismatch v and s","signature",e)}return t.yParityAndS=t._vs,t.compact=t.r+t.yParityAndS.substring(2),t}function Vi(e){return Di(Ci([(e=Hi(e)).r,e.s,e.recoveryParam?"0x1c":"0x1b"]))}var Gi=Object.freeze({__proto__:null,arrayify:Ii,concat:Ci,hexConcat:Ui,hexDataLength:Fi,hexDataSlice:Li,hexStripZeros:qi,hexValue:ji,hexZeroPad:zi,hexlify:Di,isBytes:xi,isBytesLike:Oi,isHexString:Mi,joinSignature:Vi,splitSignature:Hi,stripZeros:Ni,zeroPad:Pi});const Wi="bignumber/5.7.0";var Ki=di.BN;const Xi=new Ei(Wi),$i={},Ji=9007199254740991;let Yi=!1,Qi=class e{constructor(e,t){e!==$i&&Xi.throwError("cannot call constructor directly; use BigNumber.from",Ei.errors.UNSUPPORTED_OPERATION,{operation:"new (BigNumber)"}),this._hex=t,this._isBigNumber=!0,Object.freeze(this)}fromTwos(e){return ea(ta(this).fromTwos(e))}toTwos(e){return ea(ta(this).toTwos(e))}abs(){return"-"===this._hex[0]?e.from(this._hex.substring(1)):this}add(e){return ea(ta(this).add(ta(e)))}sub(e){return ea(ta(this).sub(ta(e)))}div(t){return e.from(t).isZero()&&ra("division-by-zero","div"),ea(ta(this).div(ta(t)))}mul(e){return ea(ta(this).mul(ta(e)))}mod(e){const t=ta(e);return t.isNeg()&&ra("division-by-zero","mod"),ea(ta(this).umod(t))}pow(e){const t=ta(e);return t.isNeg()&&ra("negative-power","pow"),ea(ta(this).pow(t))}and(e){const t=ta(e);return(this.isNegative()||t.isNeg())&&ra("unbound-bitwise-result","and"),ea(ta(this).and(t))}or(e){const t=ta(e);return(this.isNegative()||t.isNeg())&&ra("unbound-bitwise-result","or"),ea(ta(this).or(t))}xor(e){const t=ta(e);return(this.isNegative()||t.isNeg())&&ra("unbound-bitwise-result","xor"),ea(ta(this).xor(t))}mask(e){return(this.isNegative()||e<0)&&ra("negative-width","mask"),ea(ta(this).maskn(e))}shl(e){return(this.isNegative()||e<0)&&ra("negative-width","shl"),ea(ta(this).shln(e))}shr(e){return(this.isNegative()||e<0)&&ra("negative-width","shr"),ea(ta(this).shrn(e))}eq(e){return ta(this).eq(ta(e))}lt(e){return ta(this).lt(ta(e))}lte(e){return ta(this).lte(ta(e))}gt(e){return ta(this).gt(ta(e))}gte(e){return ta(this).gte(ta(e))}isNegative(){return"-"===this._hex[0]}isZero(){return ta(this).isZero()}toNumber(){try{return ta(this).toNumber()}catch(e){ra("overflow","toNumber",this.toString())}return null}toBigInt(){try{return BigInt(this.toString())}catch(e){}return Xi.throwError("this platform does not support BigInt",Ei.errors.UNSUPPORTED_OPERATION,{value:this.toString()})}toString(){return arguments.length>0&&(10===arguments[0]?Yi||(Yi=!0,Xi.warn("BigNumber.toString does not accept any parameters; base-10 is assumed")):16===arguments[0]?Xi.throwError("BigNumber.toString does not accept any parameters; use bigNumber.toHexString()",Ei.errors.UNEXPECTED_ARGUMENT,{}):Xi.throwError("BigNumber.toString does not accept parameters",Ei.errors.UNEXPECTED_ARGUMENT,{})),ta(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($i,Zi(t)):t.match(/^-?[0-9]+$/)?new e($i,Zi(new Ki(t))):Xi.throwArgumentError("invalid BigNumber string","value",t);if("number"==typeof t)return t%1&&ra("underflow","BigNumber.from",t),(t>=Ji||t<=-Ji)&&ra("overflow","BigNumber.from",t),e.from(String(t));const r=t;if("bigint"==typeof r)return e.from(r.toString());if(xi(r))return e.from(Di(r));if(r)if(r.toHexString){const t=r.toHexString();if("string"==typeof t)return e.from(t)}else{let t=r._hex;if(null==t&&"BigNumber"===r.type&&(t=r.hex),"string"==typeof t&&(Mi(t)||"-"===t[0]&&Mi(t.substring(1))))return e.from(t)}return Xi.throwArgumentError("invalid BigNumber value","value",t)}static isBigNumber(e){return!(!e||!e._isBigNumber)}};function Zi(e){if("string"!=typeof e)return Zi(e.toString(16));if("-"===e[0])return"-"===(e=e.substring(1))[0]&&Xi.throwArgumentError("invalid hex","value",e),"0x00"===(e=Zi(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 ea(e){return Qi.from(Zi(e))}function ta(e){const t=Qi.from(e).toHexString();return"-"===t[0]?new Ki("-"+t.substring(3),16):new Ki(t.substring(2),16)}function ra(e,t,r){const n={fault:e,operation:t};return null!=r&&(n.value=r),Xi.throwError(e,Ei.errors.NUMERIC_FAULT,n)}const na=new Ei(Wi),ia={},aa=Qi.from(0),oa=Qi.from(-1);function sa(e,t,r,n){const i={fault:t,operation:r};return void 0!==n&&(i.value=n),na.throwError(e,Ei.errors.NUMERIC_FAULT,i)}let ua="0";for(;ua.length<256;)ua+=ua;function fa(e){if("number"!=typeof e)try{e=Qi.from(e).toNumber()}catch(e){}return"number"==typeof e&&e>=0&&e<=256&&!(e%1)?"1"+ua.substring(0,e):na.throwArgumentError("invalid decimal size","decimals",e)}function ca(e,t){null==t&&(t=0);const r=fa(t),n=(e=Qi.from(e)).lt(aa);n&&(e=e.mul(oa));let i=e.mod(r).toString();for(;i.length<r.length-1;)i="0"+i;i=i.match(/^([0-9]*[1-9]|0)(0*)/)[1];const a=e.div(r).toString();return e=1===r.length?a:a+"."+i,n&&(e="-"+e),e}function la(e,t){null==t&&(t=0);const r=fa(t);"string"==typeof e&&e.match(/^-?[0-9.]+$/)||na.throwArgumentError("invalid decimal value","value",e);const n="-"===e.substring(0,1);n&&(e=e.substring(1)),"."===e&&na.throwArgumentError("missing value","value",e);const i=e.split(".");i.length>2&&na.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>r.length-1&&sa("fractional component exceeds decimals","underflow","parseFixed"),""===o&&(o="0");o.length<r.length-1;)o+="0";const s=Qi.from(a),u=Qi.from(o);let f=s.mul(r).add(u);return n&&(f=f.mul(oa)),f}class da{constructor(e,t,r,n){e!==ia&&na.throwError("cannot use FixedFormat constructor; use FixedFormat.from",Ei.errors.UNSUPPORTED_OPERATION,{operation:"new FixedFormat"}),this.signed=t,this.width=r,this.decimals=n,this.name=(t?"":"u")+"fixed"+String(r)+"x"+String(n),this._multiplier=fa(n),Object.freeze(this)}static from(e){if(e instanceof da)return e;"number"==typeof e&&(e=`fixed128x${e}`);let t=!0,r=128,n=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||na.throwArgumentError("invalid fixed format","format",e),t="u"!==i[1],r=parseInt(i[2]),n=parseInt(i[3])}else if(e){const i=(t,r,n)=>null==e[t]?n:(typeof e[t]!==r&&na.throwArgumentError("invalid fixed format ("+t+" not "+r+")","format."+t,e[t]),e[t]);t=i("signed","boolean",t),r=i("width","number",r),n=i("decimals","number",n)}return r%8&&na.throwArgumentError("invalid fixed format width (not byte aligned)","format.width",r),n>80&&na.throwArgumentError("invalid fixed format (decimals too large)","format.decimals",n),new da(ia,t,r,n)}}class pa{constructor(e,t,r,n){e!==ia&&na.throwError("cannot use FixedNumber constructor; use FixedNumber.from",Ei.errors.UNSUPPORTED_OPERATION,{operation:"new FixedFormat"}),this.format=n,this._hex=t,this._value=r,this._isFixedNumber=!0,Object.freeze(this)}_checkFormat(e){this.format.name!==e.format.name&&na.throwArgumentError("incompatible format; use fixedNumber.toFormat","other",e)}addUnsafe(e){this._checkFormat(e);const t=la(this._value,this.format.decimals),r=la(e._value,e.format.decimals);return pa.fromValue(t.add(r),this.format.decimals,this.format)}subUnsafe(e){this._checkFormat(e);const t=la(this._value,this.format.decimals),r=la(e._value,e.format.decimals);return pa.fromValue(t.sub(r),this.format.decimals,this.format)}mulUnsafe(e){this._checkFormat(e);const t=la(this._value,this.format.decimals),r=la(e._value,e.format.decimals);return pa.fromValue(t.mul(r).div(this.format._multiplier),this.format.decimals,this.format)}divUnsafe(e){this._checkFormat(e);const t=la(this._value,this.format.decimals),r=la(e._value,e.format.decimals);return pa.fromValue(t.mul(this.format._multiplier).div(r),this.format.decimals,this.format)}floor(){const e=this.toString().split(".");1===e.length&&e.push("0");let t=pa.from(e[0],this.format);const r=!e[1].match(/^(0*)$/);return this.isNegative()&&r&&(t=t.subUnsafe(ha.toFormat(t.format))),t}ceiling(){const e=this.toString().split(".");1===e.length&&e.push("0");let t=pa.from(e[0],this.format);const r=!e[1].match(/^(0*)$/);return!this.isNegative()&&r&&(t=t.addUnsafe(ha.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)&&na.throwArgumentError("invalid decimal count","decimals",e),t[1].length<=e)return this;const r=pa.from("1"+ua.substring(0,e),this.format),n=ma.toFormat(this.format);return this.mulUnsafe(r).addUnsafe(n).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&&na.throwArgumentError("invalid byte width","width",e);return zi(Qi.from(this._hex).fromTwos(this.format.width).toTwos(e).toHexString(),e/8)}toUnsafeFloat(){return parseFloat(this.toString())}toFormat(e){return pa.fromString(this._value,e)}static fromValue(e,t,r){return null!=r||null==t||function(e){return null!=e&&(Qi.isBigNumber(e)||"number"==typeof e&&e%1==0||"string"==typeof e&&!!e.match(/^-?[0-9]+$/)||Mi(e)||"bigint"==typeof e||xi(e))}(t)||(r=t,t=null),null==t&&(t=0),null==r&&(r="fixed"),pa.fromString(ca(e,t),da.from(r))}static fromString(e,t){null==t&&(t="fixed");const r=da.from(t),n=la(e,r.decimals);!r.signed&&n.lt(aa)&&sa("unsigned value cannot be negative","overflow","value",e);let i=null;r.signed?i=n.toTwos(r.width).toHexString():(i=n.toHexString(),i=zi(i,r.width/8));const a=ca(n,r.decimals);return new pa(ia,i,a,r)}static fromBytes(e,t){null==t&&(t="fixed");const r=da.from(t);if(Ii(e).length>r.width/8)throw new Error("overflow");let n=Qi.from(e);r.signed&&(n=n.fromTwos(r.width));const i=n.toTwos((r.signed?0:1)+r.width).toHexString(),a=ca(n,r.decimals);return new pa(ia,i,a,r)}static from(e,t){if("string"==typeof e)return pa.fromString(e,t);if(xi(e))return pa.fromBytes(e,t);try{return pa.fromValue(e,0,t)}catch(e){if(e.code!==Ei.errors.INVALID_ARGUMENT)throw e}return na.throwArgumentError("invalid FixedNumber value","value",e)}static isFixedNumber(e){return!(!e||!e._isFixedNumber)}}const ha=pa.from(1),ma=pa.from("0.5");var ya=function(e,t,r,n){return new(r||(r=Promise))((function(i,a){function o(e){try{u(n.next(e))}catch(e){a(e)}}function s(e){try{u(n.throw(e))}catch(e){a(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(o,s)}u((n=n.apply(e,t||[])).next())}))};const ba=new Ei("properties/5.7.0");function ga(e,t,r){Object.defineProperty(e,t,{enumerable:!0,value:r,writable:!1})}function va(e,t){for(let r=0;r<32;r++){if(e[t])return e[t];if(!e.prototype||"object"!=typeof e.prototype)break;e=Object.getPrototypeOf(e.prototype).constructor}return null}function wa(e){return ya(this,void 0,void 0,(function*(){const t=Object.keys(e).map((t=>{const r=e[t];return Promise.resolve(r).then((e=>({key:t,value:e})))}));return(yield Promise.all(t)).reduce(((e,t)=>(e[t.key]=t.value,e)),{})}))}function _a(e,t){e&&"object"==typeof e||ba.throwArgumentError("invalid object","object",e),Object.keys(e).forEach((r=>{t[r]||ba.throwArgumentError("invalid object key - "+r,"transaction:"+r,e)}))}function Ea(e){const t={};for(const r in e)t[r]=e[r];return t}const Ta={bigint:!0,boolean:!0,function:!0,number:!0,string:!0};function Aa(e){if(null==e||Ta[typeof e])return!0;if(Array.isArray(e)||"object"==typeof e){if(!Object.isFrozen(e))return!1;const t=Object.keys(e);for(let r=0;r<t.length;r++){let n=null;try{n=e[t[r]]}catch(e){continue}if(!Aa(n))return!1}return!0}return ba.throwArgumentError("Cannot deepCopy "+typeof e,"object",e)}function Sa(e){if(Aa(e))return e;if(Array.isArray(e))return Object.freeze(e.map((e=>ka(e))));if("object"==typeof e){const t={};for(const r in e){const n=e[r];void 0!==n&&ga(t,r,ka(n))}return t}return ba.throwArgumentError("Cannot deepCopy "+typeof e,"object",e)}function ka(e){return Sa(e)}let Oa=class{constructor(e){for(const t in e)this[t]=ka(e[t])}};var Ra=Object.freeze({__proto__:null,Description:Oa,checkProperties:_a,deepCopy:ka,defineReadOnly:ga,getStatic:va,resolveProperties:wa,shallowCopy:Ea});const xa="abi/5.7.0",Ia=new Ei(xa),Ca={};let Na={calldata:!0,memory:!0,storage:!0},Pa={calldata:!0,memory:!0};function Ma(e,t){if("bytes"===e||"string"===e){if(Na[t])return!0}else if("address"===e){if("payable"===t)return!0}else if((e.indexOf("[")>=0||"tuple"===e)&&Pa[t])return!0;return(Na[t]||"payable"===t)&&Ia.throwArgumentError("invalid modifier","name",t),!1}function Ba(e,t){for(let r in t)ga(e,r,t[r])}const Da=Object.freeze({sighash:"sighash",minimal:"minimal",full:"full",json:"json"}),Fa=new RegExp(/^(.*)\[([0-9]*)\]$/);let La=class e{constructor(t,r){t!==Ca&&Ia.throwError("use fromString",Ei.errors.UNSUPPORTED_OPERATION,{operation:"new ParamType()"}),Ba(this,r);let n=this.type.match(Fa);Ba(this,n?{arrayLength:parseInt(n[2]||"-1"),arrayChildren:e.fromObject({type:n[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=Da.sighash),Da[e]||Ia.throwArgumentError("invalid format type","format",e),e===Da.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!==Da.sighash&&(t+=this.type),t+="("+this.components.map((t=>t.format(e))).join(e===Da.full?", ":",")+")"):t+=this.type,e!==Da.sighash&&(!0===this.indexed&&(t+=" indexed"),e===Da.full&&this.name&&(t+=" "+this.name)),t}static from(t,r){return"string"==typeof t?e.fromString(t,r):e.fromObject(t)}static fromObject(t){return e.isParamType(t)?t:new e(Ca,{name:t.name||null,type:$a(t.type),indexed:null==t.indexed?null:!!t.indexed,components:t.components?t.components.map(e.fromObject):null})}static fromString(t,r){return n=function(e,t){let r=e;function n(t){Ia.throwArgumentError(`unexpected character at position ${t}`,"param",e)}function i(e){let r={type:"",name:"",parent:e,state:{allowType:!0}};return t&&(r.indexed=!1),r}e=e.replace(/\s/g," ");let a={type:"",name:"",state:{allowType:!0}},o=a;for(let r=0;r<e.length;r++){let a=e[r];switch(a){case"(":o.state.allowType&&""===o.type?o.type="tuple":o.state.allowParams||n(r),o.state.allowType=!1,o.type=$a(o.type),o.components=[i(o)],o=o.components[0];break;case")":delete o.state,"indexed"===o.name&&(t||n(r),o.indexed=!0,o.name=""),Ma(o.type,o.name)&&(o.name=""),o.type=$a(o.type);let e=o;o=o.parent,o||n(r),delete e.parent,o.state.allowParams=!1,o.state.allowName=!0,o.state.allowArray=!0;break;case",":delete o.state,"indexed"===o.name&&(t||n(r),o.indexed=!0,o.name=""),Ma(o.type,o.name)&&(o.name=""),o.type=$a(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=$a(o.type),delete o.state.allowType,o.state.allowName=!0,o.state.allowParams=!0),o.state.allowName&&""!==o.name&&("indexed"===o.name?(t||n(r),o.indexed&&n(r),o.indexed=!0,o.name=""):Ma(o.type,o.name)?o.name="":o.state.allowName=!1);break;case"[":o.state.allowArray||n(r),o.type+=a,o.state.allowArray=!1,o.state.allowName=!1,o.state.readArray=!0;break;case"]":o.state.readArray||n(r),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:n(r)}}return o.parent&&Ia.throwArgumentError("unexpected eof","param",e),delete a.state,"indexed"===o.name?(t||n(r.length-7),o.indexed&&n(r.length-7),o.indexed=!0,o.name=""):Ma(o.type,o.name)&&(o.name=""),a.type=$a(a.type),a}(t,!!r),e.fromObject({name:n.name,type:n.type,indexed:n.indexed,components:n.components});var n}static isParamType(e){return!(null==e||!e._isParamType)}};function Ua(e,t){return function(e){e=e.trim();let t=[],r="",n=0;for(let i=0;i<e.length;i++){let a=e[i];","===a&&0===n?(t.push(r),r=""):(r+=a,"("===a?n++:")"===a&&(n--,-1===n&&Ia.throwArgumentError("unbalanced parenthesis","value",e)))}r&&t.push(r);return t}(e).map((e=>La.fromString(e,t)))}let ja=class e{constructor(e,t){e!==Ca&&Ia.throwError("use a static from method",Ei.errors.UNSUPPORTED_OPERATION,{operation:"new Fragment()"}),Ba(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 Wa.fromObject(t);case"event":return qa.fromObject(t);case"constructor":return Ga.fromObject(t);case"error":return Xa.fromObject(t);case"fallback":case"receive":return null}return Ia.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]?qa.fromString(e.substring(5).trim()):"function"===e.split(" ")[0]?Wa.fromString(e.substring(8).trim()):"constructor"===e.split("(")[0].trim()?Ga.fromString(e.trim()):"error"===e.split(" ")[0]?Xa.fromString(e.substring(5).trim()):Ia.throwArgumentError("unsupported fragment","value",e)}static isFragment(e){return!(!e||!e._isFragment)}},qa=class e extends ja{format(e){if(e||(e=Da.sighash),Da[e]||Ia.throwArgumentError("invalid format type","format",e),e===Da.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!==Da.sighash&&(t+="event "),t+=this.name+"("+this.inputs.map((t=>t.format(e))).join(e===Da.full?", ":",")+") ",e!==Da.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&&Ia.throwArgumentError("invalid event object","value",t);const r={name:Ya(t.name),anonymous:t.anonymous,inputs:t.inputs?t.inputs.map(La.fromObject):[],type:"event"};return new e(Ca,r)}static fromString(t){let r=t.match(Qa);r||Ia.throwArgumentError("invalid event string","value",t);let n=!1;return r[3].split(" ").forEach((e=>{switch(e.trim()){case"anonymous":n=!0;break;case"":break;default:Ia.warn("unknown modifier: "+e)}})),e.fromObject({name:r[1].trim(),anonymous:n,inputs:Ua(r[2],!0),type:"event"})}static isEventFragment(e){return e&&e._isFragment&&"event"===e.type}};function za(e,t){t.gas=null;let r=e.split("@");return 1!==r.length?(r.length>2&&Ia.throwArgumentError("invalid human-readable ABI signature","value",e),r[1].match(/^[0-9]+$/)||Ia.throwArgumentError("invalid human-readable ABI signature gas","value",e),t.gas=Qi.from(r[1]),r[0]):e}function Ha(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 Va(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&&Ia.throwArgumentError("cannot have constant function with mutability "+t.stateMutability,"value",e),t.payable="payable"===t.stateMutability,null!=e.payable&&!!e.payable!==t.payable&&Ia.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||Ia.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&&Ia.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&&Ia.throwArgumentError("unable to determine stateMutability","value",e),t}let Ga=class e extends ja{format(e){if(e||(e=Da.sighash),Da[e]||Ia.throwArgumentError("invalid format type","format",e),e===Da.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===Da.sighash&&Ia.throwError("cannot format a constructor for sighash",Ei.errors.UNSUPPORTED_OPERATION,{operation:"format(sighash)"});let t="constructor("+this.inputs.map((t=>t.format(e))).join(e===Da.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&&Ia.throwArgumentError("invalid constructor object","value",t);let r=Va(t);r.constant&&Ia.throwArgumentError("constructor cannot be constant","value",t);const n={name:null,type:t.type,inputs:t.inputs?t.inputs.map(La.fromObject):[],payable:r.payable,stateMutability:r.stateMutability,gas:t.gas?Qi.from(t.gas):null};return new e(Ca,n)}static fromString(t){let r={type:"constructor"},n=(t=za(t,r)).match(Qa);return n&&"constructor"===n[1].trim()||Ia.throwArgumentError("invalid constructor string","value",t),r.inputs=Ua(n[2].trim(),!1),Ha(n[3].trim(),r),e.fromObject(r)}static isConstructorFragment(e){return e&&e._isFragment&&"constructor"===e.type}},Wa=class e extends Ga{format(e){if(e||(e=Da.sighash),Da[e]||Ia.throwArgumentError("invalid format type","format",e),e===Da.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!==Da.sighash&&(t+="function "),t+=this.name+"("+this.inputs.map((t=>t.format(e))).join(e===Da.full?", ":",")+") ",e!==Da.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&&Ia.throwArgumentError("invalid function object","value",t);let r=Va(t);const n={type:t.type,name:Ya(t.name),constant:r.constant,inputs:t.inputs?t.inputs.map(La.fromObject):[],outputs:t.outputs?t.outputs.map(La.fromObject):[],payable:r.payable,stateMutability:r.stateMutability,gas:t.gas?Qi.from(t.gas):null};return new e(Ca,n)}static fromString(t){let r={type:"function"},n=(t=za(t,r)).split(" returns ");n.length>2&&Ia.throwArgumentError("invalid function string","value",t);let i=n[0].match(Qa);if(i||Ia.throwArgumentError("invalid function signature","value",t),r.name=i[1].trim(),r.name&&Ya(r.name),r.inputs=Ua(i[2],!1),Ha(i[3].trim(),r),n.length>1){let e=n[1].match(Qa);""==e[1].trim()&&""==e[3].trim()||Ia.throwArgumentError("unexpected tokens","value",t),r.outputs=Ua(e[2],!1)}else r.outputs=[];return e.fromObject(r)}static isFunctionFragment(e){return e&&e._isFragment&&"function"===e.type}};function Ka(e){const t=e.format();return"Error(string)"!==t&&"Panic(uint256)"!==t||Ia.throwArgumentError(`cannot specify user defined ${t} error`,"fragment",e),e}let Xa=class e extends ja{format(e){if(e||(e=Da.sighash),Da[e]||Ia.throwArgumentError("invalid format type","format",e),e===Da.json)return JSON.stringify({type:"error",name:this.name,inputs:this.inputs.map((t=>JSON.parse(t.format(e))))});let t="";return e!==Da.sighash&&(t+="error "),t+=this.name+"("+this.inputs.map((t=>t.format(e))).join(e===Da.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&&Ia.throwArgumentError("invalid error object","value",t);const r={type:t.type,name:Ya(t.name),inputs:t.inputs?t.inputs.map(La.fromObject):[]};return Ka(new e(Ca,r))}static fromString(t){let r={type:"error"},n=t.match(Qa);return n||Ia.throwArgumentError("invalid error signature","value",t),r.name=n[1].trim(),r.name&&Ya(r.name),r.inputs=Ua(n[2],!1),Ka(e.fromObject(r))}static isErrorFragment(e){return e&&e._isFragment&&"error"===e.type}};function $a(e){return e.match(/^uint($|[^1-9])/)?e="uint256"+e.substring(4):e.match(/^int($|[^1-9])/)&&(e="int256"+e.substring(3)),e}const Ja=new RegExp("^[a-zA-Z$_][a-zA-Z0-9$_]*$");function Ya(e){return e&&e.match(Ja)||Ia.throwArgumentError(`invalid identifier "${e}"`,"value",e),e}const Qa=new RegExp("^([^)(]*)\\((.*)\\)([^)(]*)$");const Za=new Ei(xa);function eo(e){const t=[],r=function(e,n){if(Array.isArray(n))for(let i in n){const a=e.slice();a.push(i);try{r(a,n[i])}catch(e){t.push({path:a,error:e})}}};return r([],e),t}let to=class{constructor(e,t,r,n){this.name=e,this.type=t,this.localName=r,this.dynamic=n}_throwError(e,t){Za.throwArgumentError(e,this.localName,t)}},ro=class{constructor(e){ga(this,"wordSize",e||32),this._data=[],this._dataLength=0,this._padding=new Uint8Array(e)}get data(){return Ui(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(Ci(e._data))}writeBytes(e){let t=Ii(e);const r=t.length%this.wordSize;return r&&(t=Ci([t,this._padding.slice(r)])),this._writeData(t)}_getValue(e){let t=Ii(Qi.from(e));return t.length>this.wordSize&&Za.throwError("value out-of-bounds",Ei.errors.BUFFER_OVERRUN,{length:this.wordSize,offset:t.length}),t.length%this.wordSize&&(t=Ci([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 no={exports:{}};
2
2
  /**
3
3
  * [js-sha3]{@link https://github.com/emn178/js-sha3}
4
4
  *
@@ -28,7 +28,7 @@ e.exports=r=function(){return n},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
- */IP=CP,function(){var e="input is invalid type",t="object"==typeof window,r=t?window:{};r.JS_SHA3_NO_WINDOW&&(t=!1);var n=!t&&"object"==typeof self;!r.JS_SHA3_NO_NODE_JS&&"object"==typeof process&&process.versions&&process.versions.node?r=uC:n&&(r=self);var i=!r.JS_SHA3_NO_COMMON_JS&&IP.exports,a=!r.JS_SHA3_NO_ARRAY_BUFFER&&"undefined"!=typeof ArrayBuffer,o="0123456789abcdef".split(""),s=[4,1024,262144,67108864],u=[0,8,16,24],f=[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],c=[224,256,384,512],l=[128,256],d=["hex","buffer","arrayBuffer","array","digest"],p={128:168,256:136};!r.JS_SHA3_NO_NODE_JS&&Array.isArray||(Array.isArray=function(e){return"[object Array]"===Object.prototype.toString.call(e)}),!a||!r.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,r){return function(n){return new x(e,t,e).update(n)[r]()}},m=function(e,t,r){return function(n,i){return new x(e,t,i).update(n)[r]()}},y=function(e,t,r){return function(t,n,i,a){return _["cshake"+e].update(t,n,i,a)[r]()}},b=function(e,t,r){return function(t,n,i,a){return _["kmac"+e].update(t,n,i,a)[r]()}},g=function(e,t,r,n){for(var i=0;i<d.length;++i){var a=d[i];e[a]=t(r,n,a)}return e},v=function(e,t){var r=h(e,t,"hex");return r.create=function(){return new x(e,t,e)},r.update=function(e){return r.create().update(e)},g(r,h,e,t)},w=[{name:"keccak",padding:[1,256,65536,16777216],bits:c,createMethod:v},{name:"sha3",padding:[6,1536,393216,100663296],bits:c,createMethod:v},{name:"shake",padding:[31,7936,2031616,520093696],bits:l,createMethod:function(e,t){var r=m(e,t,"hex");return r.create=function(r){return new x(e,t,r)},r.update=function(e,t){return r.create(t).update(e)},g(r,m,e,t)}},{name:"cshake",padding:s,bits:l,createMethod:function(e,t){var r=p[e],n=y(e,0,"hex");return n.create=function(n,i,a){return i||a?new x(e,t,n).bytepad([i,a],r):_["shake"+e].create(n)},n.update=function(e,t,r,i){return n.create(t,r,i).update(e)},g(n,y,e,t)}},{name:"kmac",padding:s,bits:l,createMethod:function(e,t){var r=p[e],n=b(e,0,"hex");return n.create=function(n,i,a){return new I(e,t,i).bytepad(["KMAC",a],r).bytepad([n],r)},n.update=function(e,t,r,i){return n.create(e,r,i).update(t)},g(n,b,e,t)}}],_={},E=[],T=0;T<w.length;++T)for(var A=w[T],S=A.bits,k=0;k<S.length;++k){var O=A.name+"_"+S[k];if(E.push(O),_[O]=A.createMethod(S[k],A.padding),"sha3"!==A.name){var R=A.name+S[k];E.push(R),_[R]=_[O]}}function x(e,t,r){this.blocks=[],this.s=[],this.padding=t,this.outputBits=r,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=r>>5,this.extraBytes=(31&r)>>3;for(var n=0;n<50;++n)this.s[n]=0}function I(e,t,r){x.call(this,e,t,r)}x.prototype.update=function(t){if(this.finalized)throw new Error("finalize already called");var r,n=typeof t;if("string"!==n){if("object"!==n)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);r=!0}for(var i,o,s=this.blocks,f=this.byteCount,c=t.length,l=this.blockCount,d=0,p=this.s;d<c;){if(this.reset)for(this.reset=!1,s[0]=this.block,i=1;i<l+1;++i)s[i]=0;if(r)for(i=this.start;d<c&&i<f;++d)s[i>>2]|=t[d]<<u[3&i++];else for(i=this.start;d<c&&i<f;++d)(o=t.charCodeAt(d))<128?s[i>>2]|=o<<u[3&i++]:o<2048?(s[i>>2]|=(192|o>>6)<<u[3&i++],s[i>>2]|=(128|63&o)<<u[3&i++]):o<55296||o>=57344?(s[i>>2]|=(224|o>>12)<<u[3&i++],s[i>>2]|=(128|o>>6&63)<<u[3&i++],s[i>>2]|=(128|63&o)<<u[3&i++]):(o=65536+((1023&o)<<10|1023&t.charCodeAt(++d)),s[i>>2]|=(240|o>>18)<<u[3&i++],s[i>>2]|=(128|o>>12&63)<<u[3&i++],s[i>>2]|=(128|o>>6&63)<<u[3&i++],s[i>>2]|=(128|63&o)<<u[3&i++]);if(this.lastByteIndex=i,i>=f){for(this.start=i-f,this.block=s[l],i=0;i<l;++i)p[i]^=s[i];C(p),this.reset=!0}else this.start=i}return this},x.prototype.encode=function(e,t){var r=255&e,n=1,i=[r];for(r=255&(e>>=8);r>0;)i.unshift(r),r=255&(e>>=8),++n;return t?i.push(n):i.unshift(n),this.update(i),i.length},x.prototype.encodeString=function(t){var r,n=typeof t;if("string"!==n){if("object"!==n)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);r=!0}var i=0,o=t.length;if(r)i=o;else for(var s=0;s<t.length;++s){var u=t.charCodeAt(s);u<128?i+=1:u<2048?i+=2:u<55296||u>=57344?i+=3:(u=65536+((1023&u)<<10|1023&t.charCodeAt(++s)),i+=4)}return i+=this.encode(8*i),this.update(t),i},x.prototype.bytepad=function(e,t){for(var r=this.encode(t),n=0;n<e.length;++n)r+=this.encodeString(e[n]);var i=t-r%t,a=[];return a.length=i,this.update(a),this},x.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var e=this.blocks,t=this.lastByteIndex,r=this.blockCount,n=this.s;if(e[t>>2]|=this.padding[3&t],this.lastByteIndex===this.byteCount)for(e[0]=e[r],t=1;t<r+1;++t)e[t]=0;for(e[r-1]|=2147483648,t=0;t<r;++t)n[t]^=e[t];C(n)}},x.prototype.toString=x.prototype.hex=function(){this.finalize();for(var e,t=this.blockCount,r=this.s,n=this.outputBlocks,i=this.extraBytes,a=0,s=0,u="";s<n;){for(a=0;a<t&&s<n;++a,++s)e=r[a],u+=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(r),a=0)}return i&&(e=r[a],u+=o[e>>4&15]+o[15&e],i>1&&(u+=o[e>>12&15]+o[e>>8&15]),i>2&&(u+=o[e>>20&15]+o[e>>16&15])),u},x.prototype.arrayBuffer=function(){this.finalize();var e,t=this.blockCount,r=this.s,n=this.outputBlocks,i=this.extraBytes,a=0,o=0,s=this.outputBits>>3;e=i?new ArrayBuffer(n+1<<2):new ArrayBuffer(s);for(var u=new Uint32Array(e);o<n;){for(a=0;a<t&&o<n;++a,++o)u[o]=r[a];o%t==0&&C(r)}return i&&(u[a]=r[a],e=e.slice(0,s)),e},x.prototype.buffer=x.prototype.arrayBuffer,x.prototype.digest=x.prototype.array=function(){this.finalize();for(var e,t,r=this.blockCount,n=this.s,i=this.outputBlocks,a=this.extraBytes,o=0,s=0,u=[];s<i;){for(o=0;o<r&&s<i;++o,++s)e=s<<2,t=n[o],u[e]=255&t,u[e+1]=t>>8&255,u[e+2]=t>>16&255,u[e+3]=t>>24&255;s%r==0&&C(n)}return a&&(e=s<<2,t=n[o],u[e]=255&t,a>1&&(u[e+1]=t>>8&255),a>2&&(u[e+2]=t>>16&255)),u},I.prototype=new x,I.prototype.finalize=function(){return this.encode(this.outputBits,!0),x.prototype.finalize.call(this)};var C=function(e){var t,r,n,i,a,o,s,u,c,l,d,p,h,m,y,b,g,v,w,_,E,T,A,S,k,O,R,x,I,C,N,P,M,B,D,F,L,U,j,q,z,H,V,G,W,K,X,$,J,Y,Q,Z,ee,te,re,ne,ie,ae,oe,se,ue,fe,ce;for(n=0;n<48;n+=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],u=e[4]^e[14]^e[24]^e[34]^e[44],c=e[5]^e[15]^e[25]^e[35]^e[45],l=e[6]^e[16]^e[26]^e[36]^e[46],d=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),r=(h=e[9]^e[19]^e[29]^e[39]^e[49])^(s<<1|o>>>31),e[0]^=t,e[1]^=r,e[10]^=t,e[11]^=r,e[20]^=t,e[21]^=r,e[30]^=t,e[31]^=r,e[40]^=t,e[41]^=r,t=i^(u<<1|c>>>31),r=a^(c<<1|u>>>31),e[2]^=t,e[3]^=r,e[12]^=t,e[13]^=r,e[22]^=t,e[23]^=r,e[32]^=t,e[33]^=r,e[42]^=t,e[43]^=r,t=o^(l<<1|d>>>31),r=s^(d<<1|l>>>31),e[4]^=t,e[5]^=r,e[14]^=t,e[15]^=r,e[24]^=t,e[25]^=r,e[34]^=t,e[35]^=r,e[44]^=t,e[45]^=r,t=u^(p<<1|h>>>31),r=c^(h<<1|p>>>31),e[6]^=t,e[7]^=r,e[16]^=t,e[17]^=r,e[26]^=t,e[27]^=r,e[36]^=t,e[37]^=r,e[46]^=t,e[47]^=r,t=l^(i<<1|a>>>31),r=d^(a<<1|i>>>31),e[8]^=t,e[9]^=r,e[18]^=t,e[19]^=r,e[28]^=t,e[29]^=r,e[38]^=t,e[39]^=r,e[48]^=t,e[49]^=r,m=e[0],y=e[1],K=e[11]<<4|e[10]>>>28,X=e[10]<<4|e[11]>>>28,x=e[20]<<3|e[21]>>>29,I=e[21]<<3|e[20]>>>29,se=e[31]<<9|e[30]>>>23,ue=e[30]<<9|e[31]>>>23,H=e[40]<<18|e[41]>>>14,V=e[41]<<18|e[40]>>>14,B=e[2]<<1|e[3]>>>31,D=e[3]<<1|e[2]>>>31,b=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,N=e[32]<<13|e[33]>>>19,fe=e[42]<<2|e[43]>>>30,ce=e[43]<<2|e[42]>>>30,te=e[5]<<30|e[4]>>>2,re=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,M=e[44]<<29|e[45]>>>3,S=e[6]<<28|e[7]>>>4,k=e[7]<<28|e[6]>>>4,ne=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,G=e[8]<<27|e[9]>>>5,W=e[9]<<27|e[8]>>>5,O=e[18]<<20|e[19]>>>12,R=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]=m^~b&v,e[1]=y^~g&w,e[10]=S^~O&x,e[11]=k^~R&I,e[20]=B^~F&U,e[21]=D^~L&j,e[30]=G^~K&$,e[31]=W^~X&J,e[40]=te^~ne&ae,e[41]=re^~ie&oe,e[2]=b^~v&_,e[3]=g^~w&E,e[12]=O^~x&C,e[13]=R^~I&N,e[22]=F^~U&q,e[23]=L^~j&z,e[32]=K^~$&Y,e[33]=X^~J&Q,e[42]=ne^~ae&se,e[43]=ie^~oe&ue,e[4]=v^~_&T,e[5]=w^~E&A,e[14]=x^~C&P,e[15]=I^~N&M,e[24]=U^~q&H,e[25]=j^~z&V,e[34]=$^~Y&Z,e[35]=J^~Q&ee,e[44]=ae^~se&fe,e[45]=oe^~ue&ce,e[6]=_^~T&m,e[7]=E^~A&y,e[16]=C^~P&S,e[17]=N^~M&k,e[26]=q^~H&B,e[27]=z^~V&D,e[36]=Y^~Z&G,e[37]=Q^~ee&W,e[46]=se^~fe&te,e[47]=ue^~ce&re,e[8]=T^~m&b,e[9]=A^~y&g,e[18]=P^~S&O,e[19]=M^~k&R,e[28]=H^~B&F,e[29]=V^~D&L,e[38]=Z^~G&K,e[39]=ee^~W&X,e[48]=fe^~te&ne,e[49]=ce^~re&ie,e[0]^=f[n],e[1]^=f[n+1]};if(i)IP.exports=_;else for(T=0;T<E.length;++T)r[E[T]]=_[E[T]]}();var NP=CP.exports;function PP(e){return"0x"+NP.keccak_256(Ii(e))}var MP=di.BN;const BP=new bP("bignumber/5.7.0"),DP={};let FP=!1;class LP{constructor(e,t){e!==DP&&BP.throwError("cannot call constructor directly; use BigNumber.from",bP.errors.UNSUPPORTED_OPERATION,{operation:"new (BigNumber)"}),this._hex=t,this._isBigNumber=!0,Object.freeze(this)}fromTwos(e){return jP(qP(this).fromTwos(e))}toTwos(e){return jP(qP(this).toTwos(e))}abs(){return"-"===this._hex[0]?LP.from(this._hex.substring(1)):this}add(e){return jP(qP(this).add(qP(e)))}sub(e){return jP(qP(this).sub(qP(e)))}div(e){return LP.from(e).isZero()&&zP("division-by-zero","div"),jP(qP(this).div(qP(e)))}mul(e){return jP(qP(this).mul(qP(e)))}mod(e){const t=qP(e);return t.isNeg()&&zP("division-by-zero","mod"),jP(qP(this).umod(t))}pow(e){const t=qP(e);return t.isNeg()&&zP("negative-power","pow"),jP(qP(this).pow(t))}and(e){const t=qP(e);return(this.isNegative()||t.isNeg())&&zP("unbound-bitwise-result","and"),jP(qP(this).and(t))}or(e){const t=qP(e);return(this.isNegative()||t.isNeg())&&zP("unbound-bitwise-result","or"),jP(qP(this).or(t))}xor(e){const t=qP(e);return(this.isNegative()||t.isNeg())&&zP("unbound-bitwise-result","xor"),jP(qP(this).xor(t))}mask(e){return(this.isNegative()||e<0)&&zP("negative-width","mask"),jP(qP(this).maskn(e))}shl(e){return(this.isNegative()||e<0)&&zP("negative-width","shl"),jP(qP(this).shln(e))}shr(e){return(this.isNegative()||e<0)&&zP("negative-width","shr"),jP(qP(this).shrn(e))}eq(e){return qP(this).eq(qP(e))}lt(e){return qP(this).lt(qP(e))}lte(e){return qP(this).lte(qP(e))}gt(e){return qP(this).gt(qP(e))}gte(e){return qP(this).gte(qP(e))}isNegative(){return"-"===this._hex[0]}isZero(){return qP(this).isZero()}toNumber(){try{return qP(this).toNumber()}catch(e){zP("overflow","toNumber",this.toString())}return null}toBigInt(){try{return BigInt(this.toString())}catch(e){}return BP.throwError("this platform does not support BigInt",bP.errors.UNSUPPORTED_OPERATION,{value:this.toString()})}toString(){return arguments.length>0&&(10===arguments[0]?FP||(FP=!0,BP.warn("BigNumber.toString does not accept any parameters; base-10 is assumed")):16===arguments[0]?BP.throwError("BigNumber.toString does not accept any parameters; use bigNumber.toHexString()",bP.errors.UNEXPECTED_ARGUMENT,{}):BP.throwError("BigNumber.toString does not accept parameters",bP.errors.UNEXPECTED_ARGUMENT,{})),qP(this).toString(10)}toHexString(){return this._hex}toJSON(e){return{type:"BigNumber",hex:this.toHexString()}}static from(e){if(e instanceof LP)return e;if("string"==typeof e)return e.match(/^-?0x[0-9a-f]+$/i)?new LP(DP,UP(e)):e.match(/^-?[0-9]+$/)?new LP(DP,UP(new MP(e))):BP.throwArgumentError("invalid BigNumber string","value",e);if("number"==typeof e)return e%1&&zP("underflow","BigNumber.from",e),(e>=9007199254740991||e<=-9007199254740991)&&zP("overflow","BigNumber.from",e),LP.from(String(e));const t=e;if("bigint"==typeof t)return LP.from(t.toString());if(xi(t))return LP.from(Di(t));if(t)if(t.toHexString){const e=t.toHexString();if("string"==typeof e)return LP.from(e)}else{let e=t._hex;if(null==e&&"BigNumber"===t.type&&(e=t.hex),"string"==typeof e&&(Mi(e)||"-"===e[0]&&Mi(e.substring(1))))return LP.from(e)}return BP.throwArgumentError("invalid BigNumber value","value",e)}static isBigNumber(e){return!(!e||!e._isBigNumber)}}function UP(e){if("string"!=typeof e)return UP(e.toString(16));if("-"===e[0])return"-"===(e=e.substring(1))[0]&&BP.throwArgumentError("invalid hex","value",e),"0x00"===(e=UP(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 jP(e){return LP.from(UP(e))}function qP(e){const t=LP.from(e).toHexString();return"-"===t[0]?new MP("-"+t.substring(3),16):new MP(t.substring(2),16)}function zP(e,t,r){const n={fault:e,operation:t};return null!=r&&(n.value=r),BP.throwError(e,bP.errors.NUMERIC_FAULT,n)}const HP=new bP("bignumber/5.7.0"),VP={},GP=LP.from(0),WP=LP.from(-1);function KP(e,t,r,n){const i={fault:t,operation:r};return void 0!==n&&(i.value=n),HP.throwError(e,bP.errors.NUMERIC_FAULT,i)}let XP="0";for(;XP.length<256;)XP+=XP;function $P(e){if("number"!=typeof e)try{e=LP.from(e).toNumber()}catch(e){}return"number"==typeof e&&e>=0&&e<=256&&!(e%1)?"1"+XP.substring(0,e):HP.throwArgumentError("invalid decimal size","decimals",e)}function JP(e,t){null==t&&(t=0);const r=$P(t),n=(e=LP.from(e)).lt(GP);n&&(e=e.mul(WP));let i=e.mod(r).toString();for(;i.length<r.length-1;)i="0"+i;i=i.match(/^([0-9]*[1-9]|0)(0*)/)[1];const a=e.div(r).toString();return e=1===r.length?a:a+"."+i,n&&(e="-"+e),e}function YP(e,t){null==t&&(t=0);const r=$P(t);"string"==typeof e&&e.match(/^-?[0-9.]+$/)||HP.throwArgumentError("invalid decimal value","value",e);const n="-"===e.substring(0,1);n&&(e=e.substring(1)),"."===e&&HP.throwArgumentError("missing value","value",e);const i=e.split(".");i.length>2&&HP.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>r.length-1&&KP("fractional component exceeds decimals","underflow","parseFixed"),""===o&&(o="0");o.length<r.length-1;)o+="0";const s=LP.from(a),u=LP.from(o);let f=s.mul(r).add(u);return n&&(f=f.mul(WP)),f}class QP{constructor(e,t,r,n){e!==VP&&HP.throwError("cannot use FixedFormat constructor; use FixedFormat.from",bP.errors.UNSUPPORTED_OPERATION,{operation:"new FixedFormat"}),this.signed=t,this.width=r,this.decimals=n,this.name=(t?"":"u")+"fixed"+String(r)+"x"+String(n),this._multiplier=$P(n),Object.freeze(this)}static from(e){if(e instanceof QP)return e;"number"==typeof e&&(e=`fixed128x${e}`);let t=!0,r=128,n=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||HP.throwArgumentError("invalid fixed format","format",e),t="u"!==i[1],r=parseInt(i[2]),n=parseInt(i[3])}else if(e){const i=(t,r,n)=>null==e[t]?n:(typeof e[t]!==r&&HP.throwArgumentError("invalid fixed format ("+t+" not "+r+")","format."+t,e[t]),e[t]);t=i("signed","boolean",t),r=i("width","number",r),n=i("decimals","number",n)}return r%8&&HP.throwArgumentError("invalid fixed format width (not byte aligned)","format.width",r),n>80&&HP.throwArgumentError("invalid fixed format (decimals too large)","format.decimals",n),new QP(VP,t,r,n)}}class ZP{constructor(e,t,r,n){e!==VP&&HP.throwError("cannot use FixedNumber constructor; use FixedNumber.from",bP.errors.UNSUPPORTED_OPERATION,{operation:"new FixedFormat"}),this.format=n,this._hex=t,this._value=r,this._isFixedNumber=!0,Object.freeze(this)}_checkFormat(e){this.format.name!==e.format.name&&HP.throwArgumentError("incompatible format; use fixedNumber.toFormat","other",e)}addUnsafe(e){this._checkFormat(e);const t=YP(this._value,this.format.decimals),r=YP(e._value,e.format.decimals);return ZP.fromValue(t.add(r),this.format.decimals,this.format)}subUnsafe(e){this._checkFormat(e);const t=YP(this._value,this.format.decimals),r=YP(e._value,e.format.decimals);return ZP.fromValue(t.sub(r),this.format.decimals,this.format)}mulUnsafe(e){this._checkFormat(e);const t=YP(this._value,this.format.decimals),r=YP(e._value,e.format.decimals);return ZP.fromValue(t.mul(r).div(this.format._multiplier),this.format.decimals,this.format)}divUnsafe(e){this._checkFormat(e);const t=YP(this._value,this.format.decimals),r=YP(e._value,e.format.decimals);return ZP.fromValue(t.mul(this.format._multiplier).div(r),this.format.decimals,this.format)}floor(){const e=this.toString().split(".");1===e.length&&e.push("0");let t=ZP.from(e[0],this.format);const r=!e[1].match(/^(0*)$/);return this.isNegative()&&r&&(t=t.subUnsafe(eM.toFormat(t.format))),t}ceiling(){const e=this.toString().split(".");1===e.length&&e.push("0");let t=ZP.from(e[0],this.format);const r=!e[1].match(/^(0*)$/);return!this.isNegative()&&r&&(t=t.addUnsafe(eM.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)&&HP.throwArgumentError("invalid decimal count","decimals",e),t[1].length<=e)return this;const r=ZP.from("1"+XP.substring(0,e),this.format),n=tM.toFormat(this.format);return this.mulUnsafe(r).addUnsafe(n).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&&HP.throwArgumentError("invalid byte width","width",e);return zi(LP.from(this._hex).fromTwos(this.format.width).toTwos(e).toHexString(),e/8)}toUnsafeFloat(){return parseFloat(this.toString())}toFormat(e){return ZP.fromString(this._value,e)}static fromValue(e,t,r){return null!=r||null==t||function(e){return null!=e&&(LP.isBigNumber(e)||"number"==typeof e&&e%1==0||"string"==typeof e&&!!e.match(/^-?[0-9]+$/)||Mi(e)||"bigint"==typeof e||xi(e))}(t)||(r=t,t=null),null==t&&(t=0),null==r&&(r="fixed"),ZP.fromString(JP(e,t),QP.from(r))}static fromString(e,t){null==t&&(t="fixed");const r=QP.from(t),n=YP(e,r.decimals);!r.signed&&n.lt(GP)&&KP("unsigned value cannot be negative","overflow","value",e);let i=null;r.signed?i=n.toTwos(r.width).toHexString():(i=n.toHexString(),i=zi(i,r.width/8));const a=JP(n,r.decimals);return new ZP(VP,i,a,r)}static fromBytes(e,t){null==t&&(t="fixed");const r=QP.from(t);if(Ii(e).length>r.width/8)throw new Error("overflow");let n=LP.from(e);r.signed&&(n=n.fromTwos(r.width));const i=n.toTwos((r.signed?0:1)+r.width).toHexString(),a=JP(n,r.decimals);return new ZP(VP,i,a,r)}static from(e,t){if("string"==typeof e)return ZP.fromString(e,t);if(xi(e))return ZP.fromBytes(e,t);try{return ZP.fromValue(e,0,t)}catch(e){if(e.code!==bP.errors.INVALID_ARGUMENT)throw e}return HP.throwArgumentError("invalid FixedNumber value","value",e)}static isFixedNumber(e){return!(!e||!e._isFixedNumber)}}const eM=ZP.from(1),tM=ZP.from("0.5"),rM=new bP("strings/5.7.0");var nM,iM;function aM(e,t=nM.current){t!=nM.current&&(rM.checkNormalize(),e=e.normalize(t));let r=[];for(let t=0;t<e.length;t++){const n=e.charCodeAt(t);if(n<128)r.push(n);else if(n<2048)r.push(n>>6|192),r.push(63&n|128);else if(55296==(64512&n)){t++;const i=e.charCodeAt(t);if(t>=e.length||56320!=(64512&i))throw new Error("invalid utf-8 string");const a=65536+((1023&n)<<10)+(1023&i);r.push(a>>18|240),r.push(a>>12&63|128),r.push(a>>6&63|128),r.push(63&a|128)}else r.push(n>>12|224),r.push(n>>6&63|128),r.push(63&n|128)}return Ii(r)}function oM(e,t){t||(t=function(e){return[parseInt(e,16)]});let r=0,n={};return e.split(",").forEach((e=>{let i=e.split(":");r+=parseInt(i[0],16),n[r]=t(i[1])})),n}function sM(e){let t=0;return e.split(",").map((e=>{let r=e.split("-");1===r.length?r[1]="0":""===r[1]&&(r[1]="1");let n=t+parseInt(r[0],16);return t=parseInt(r[1],16),{l:n,h:t}}))}function uM(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function fM(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?uM(Object(r),!0).forEach((function(t){qI(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):uM(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function cM(e,t,r){return lM.apply(this,arguments)}function lM(){return lM=sC(dC.mark((function e(t,r,n){var i,a,o,s,u,f,c,l;return dC.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=r.users.map((function(e){return{ether_key:e.user,tokens:e.tokens.map((function(e){return fM({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=r.royalties,o=fM(fM({contract_address:r.contract_address},a&&a.length>0&&{royalties:a.map((function(e){return{recipient:e.recipient,percentage:e.percentage}}))}),{},{users:i,auth_signature:""}),s=PP(aM(JSON.stringify(o))),e.next=6,yC(s,t);case 6:return u=e.sent,f=fM(fM({users:o.users.map((function(e){return{user:e.ether_key,tokens:e.tokens}}))},a&&a.length>0&&{royalties:a}),{},{contract_address:r.contract_address,auth_signature:u}),c={mintTokensRequestV2:[f]},e.next=11,n.mintTokens(c);case 11:return l=e.sent,e.abrupt("return",l.data);case 13:case"end":return e.stop()}}),e)}))),lM.apply(this,arguments)}function dM(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 pM(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(e){if("string"==typeof e)return hM(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?hM(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},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(){r=r.call(e)},n:function(){var e=r.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==r.return||r.return()}finally{if(s)throw a}}}}function hM(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function mM(e){return yM.apply(this,arguments)}function yM(){return(yM=sC(dC.mark((function e(t){var r,n,i,a,o,s,u,f,c,l,d,p,h,m,y;return dC.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.ethSigner,i=t.starkSigner,a=t.request,o=t.transfersApi,e.next=3,n.getAddress();case 3:return s=e.sent,u="ERC721"===a.type?"1":a.amount,e.next=7,o.getSignableTransferV1({getSignableTransferRequest:{sender:s,token:dM(a),amount:u,receiver:a.receiver}});case 7:return f=e.sent,c=f.data,l=c.signable_message,d=c.payload_hash,e.next=11,yC(l,n);case 11:return p=e.sent,e.next=14,i.signMessage(d);case 14:return h=e.sent,m={sender_stark_key:f.data.sender_stark_key,sender_vault_id:f.data.sender_vault_id,receiver_stark_key:f.data.receiver_stark_key,receiver_vault_id:f.data.receiver_vault_id,asset_id:f.data.asset_id,amount:f.data.amount,nonce:f.data.nonce,expiration_timestamp:f.data.expiration_timestamp,stark_signature:h},e.next=18,o.createTransferV1({createTransferRequest:m,xImxEthAddress:s,xImxEthSignature:p});case 18:return y=e.sent,e.abrupt("return",{sent_signature:null==y?void 0:y.data.sent_signature,status:null==y||null===(r=y.data.status)||void 0===r?void 0:r.toString(),time:null==y?void 0:y.data.time,transfer_id:null==y?void 0:y.data.transfer_id});case 20:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function bM(e){return gM.apply(this,arguments)}function gM(){return(gM=sC(dC.mark((function e(t){var r,n,i,a,o,s,u,f,c,l,d,p,h,m,y,b,g;return dC.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.ethSigner,n=t.starkSigner,i=t.request,a=t.transfersApi,e.next=3,r.getAddress();case 3:return o=e.sent,s=i.map((function(e){return{amount:"1",token:dM({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(u=e.sent,void 0!==(f=u.data.signable_message)){e.next=11;break}throw new Error("Invalid response from Signable registration offchain");case 11:return e.next=13,yC(f,r);case 13:c=e.sent,l=[],d=pM(u.data.signable_responses),e.prev=16,d.s();case 18:if((p=d.n()).done){e.next=27;break}return h=p.value,e.next=22,n.signMessage(h.payload_hash);case 22:m=e.sent,y={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:m},l.push(y);case 25:e.next=18;break;case 27:e.next=32;break;case 29:e.prev=29,e.t0=e.catch(16),d.e(e.t0);case 32:return e.prev=32,d.f(),e.finish(32);case 35:return b={sender_stark_key:u.data.sender_stark_key,requests:l},e.next=38,a.createTransfer({createTransferRequestV2:b,xImxEthAddress:o,xImxEthSignature:c});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"}(nM||(nM={})),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"}(iM||(iM={})),sM("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))),oM("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"),oM("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"),oM("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 r=0;r<e.length;r+=4)t.push(parseInt(e.substring(r,r+4),16));return t})),sM("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 vM=new bP("units/5.7.0"),wM=["wei","kwei","mwei","gwei","szabo","finney","ether"];function _M(e,t){if("string"!=typeof e&&vM.throwArgumentError("value must be a string","value",e),"string"==typeof t){const e=wM.indexOf(t);-1!==e&&(t=3*e)}return YP(e,null!=t?t:18)}function EM(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function TM(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?EM(Object(r),!0).forEach((function(t){qI(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):EM(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function AM(e,t,r,n,i,a,o){return SM.apply(this,arguments)}function SM(){return(SM=sC(dC.mark((function e(t,r,n,i,a,o,s){var u,f,c;return dC.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t.getAddress();case 2:return u=e.sent,e.next=5,RP(u,i,s);case 5:return f=e.sent,e.next=8,o.populateTransaction.registerAndDepositEth(u,i,f.operator_signature,n,a);case 8:return c=e.sent,e.abrupt("return",t.sendTransaction(TM(TM({},c),{},{value:r})));case 10:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function kM(e,t,r,n,i,a){return OM.apply(this,arguments)}function OM(){return(OM=sC(dC.mark((function e(t,r,n,i,a,o){var s;return dC.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,o.populateTransaction["deposit(uint256,uint256,uint256)"](i,n,a);case 2:return s=e.sent,e.abrupt("return",t.sendTransaction(TM(TM({},s),{},{value:r})));case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function RM(e,t,r,n,i,a){return xM.apply(this,arguments)}function xM(){return(xM=sC(dC.mark((function e(t,r,n,i,a,o){var s,u,f,c,l,d,p,h,m,y,b;return dC.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t.getAddress();case 2:return s=e.sent,u={decimals:18},f=_M(r.amount,"wei"),c={user:s,token:{type:r.type,data:u},amount:f.toString()},e.next=8,n.getSignableDeposit({getSignableDepositRequest:c});case 8:return l=e.sent,e.next=11,a.encodeAsset({assetType:"asset",encodeAssetRequest:{token:{type:r.type}}});case 11:return d=e.sent,p=d.data.asset_type,h=l.data.stark_key,m=l.data.vault_id,y=XI.connect(o.ethConfiguration.coreContractAddress,t),b=iC.connect(o.ethConfiguration.registrationContractAddress,t),e.next=19,kP(h,b);case 19:if(e.sent){e.next=24;break}return e.abrupt("return",AM(t,f,p,h,m,y,i));case 24:return e.abrupt("return",kM(t,f,p,h,m,y));case 25:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function IM(e,t,r,n,i,a){return CM.apply(this,arguments)}function CM(){return(CM=sC(dC.mark((function e(t,r,n,i,a,o){var s;return dC.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,o.populateTransaction.depositERC20(i,n,a,r);case 2:return s=e.sent,e.abrupt("return",t.sendTransaction(s));case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function NM(e,t,r,n,i,a,o){return PM.apply(this,arguments)}function PM(){return(PM=sC(dC.mark((function e(t,r,n,i,a,o,s){var u,f,c;return dC.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t.getAddress();case 2:return u=e.sent,e.next=5,RP(u,i,s);case 5:return f=e.sent,e.next=8,o.populateTransaction.registerAndDepositERC20(u,i,f.operator_signature,n,a,r);case 8:return c=e.sent,e.abrupt("return",t.sendTransaction(c));case 10:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function MM(e,t,r,n,i,a,o){return BM.apply(this,arguments)}function BM(){return(BM=sC(dC.mark((function e(t,r,n,i,a,o,s){var u,f,c,l,d,p,h,m,y,b,g,v,w,_,E,T;return dC.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t.getAddress();case 2:return u=e.sent,e.next=5,a.getToken({address:r.tokenAddress});case 5:return f=e.sent,c=parseInt(f.data.decimals),l={decimals:c,token_address:r.tokenAddress},d=_M(r.amount,0),p=HI.connect(r.tokenAddress,t),e.next=12,p.populateTransaction.approve(s.ethConfiguration.coreContractAddress,d);case 12:return h=e.sent,e.next=15,t.sendTransaction(h);case 15:return m={user:u,token:{type:r.type,data:l},amount:d.toString()},e.next=18,n.getSignableDeposit({getSignableDepositRequest:m});case 18:return y=e.sent,e.next=21,o.encodeAsset({assetType:"asset",encodeAssetRequest:{token:{type:r.type,data:{token_address:r.tokenAddress}}}});case 21:return b=e.sent,g=b.data.asset_type,v=y.data.stark_key,w=y.data.vault_id,_=LP.from(y.data.amount),E=XI.connect(s.ethConfiguration.coreContractAddress,t),T=iC.connect(s.ethConfiguration.registrationContractAddress,t),e.next=30,kP(v,T);case 30:if(e.sent){e.next=35;break}return e.abrupt("return",NM(t,_,g,v,w,E,i));case 35:return e.abrupt("return",IM(t,_,g,v,w,E));case 36:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function DM(e,t,r,n,i,a){return FM.apply(this,arguments)}function FM(){return(FM=sC(dC.mark((function e(t,r,n,i,a,o){var s;return dC.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,o.populateTransaction.depositNft(i,n,a,r);case 2:return s=e.sent,e.abrupt("return",t.sendTransaction(s));case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function LM(e,t,r,n,i,a){return UM.apply(this,arguments)}function UM(){return(UM=sC(dC.mark((function e(t,r,n,i,a,o){var s,u,f,c,l,d,p,h,m,y,b,g,v,w;return dC.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t.getAddress();case 2:return s=e.sent,u={token_address:r.tokenAddress,token_id:r.tokenId},f={user:s,token:{type:r.type,data:u},amount:"1".toString()},e.next=8,n.getSignableDeposit({getSignableDepositRequest:f});case 8:return c=e.sent,e.next=11,a.encodeAsset({assetType:"asset",encodeAssetRequest:{token:{type:r.type,data:{token_address:r.tokenAddress,token_id:r.tokenId}}}});case 11:return l=e.sent,d=l.data.asset_type,p=c.data.stark_key,h=c.data.vault_id,m=XI.connect(o.ethConfiguration.coreContractAddress,t),y=iC.connect(o.ethConfiguration.registrationContractAddress,t),e.next=19,kP(p,y);case 19:return b=e.sent,g=GI.connect(r.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(b){e.next=34;break}return e.next=31,RP(s,p,i);case 31:return w=e.sent,e.next=34,m.registerUser(s,p,w.operator_signature);case 34:return e.abrupt("return",DM(t,r.tokenId,d,p,h,m));case 35:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var jM=function(e){if(void 0!==e)return e;throw new Error("undefined field exception")};function qM(e){return zM.apply(this,arguments)}function zM(){return(zM=sC(dC.mark((function e(t){var r,n,i,a,o,s,u,f,c,l,d,p,h;return dC.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.ethSigner,n=t.starkSigner,i=t.withdrawalsApi,a="ERC721"===t.type?"1":t.amount,e.t0=i,e.next=5,r.getAddress();case 5:return e.t1=e.sent,e.t2=dM(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,u=s.signable_message,f=s.payload_hash,e.next=16,n.signMessage(f);case 16:return c=e.sent,e.next=19,wC(u,r);case 19:return l=e.sent,d=l.ethAddress,p=l.ethSignature,e.next=24,i.createWithdrawal({createWithdrawalRequest:{stark_key:jM(o.data.stark_key),amount:a,asset_id:jM(o.data.asset_id),vault_id:jM(o.data.vault_id),nonce:jM(o.data.nonce),stark_signature:c},xImxEthAddress:d,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 HM(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function VM(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?HM(Object(r),!0).forEach((function(t){qI(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):HM(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function GM(e,t,r,n){return WM.apply(this,arguments)}function WM(){return(WM=sC(dC.mark((function e(t,r,n,i){var a;return dC.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,n.encodeAsset({assetType:t,encodeAssetRequest:{token:VM({type:r},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 KM(e,t,r,n,i){return XM.apply(this,arguments)}function XM(){return(XM=sC(dC.mark((function e(t,r,n,i,a){var o,s,u;return dC.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,RP(o,n,a);case 5:return s=e.sent,e.next=8,i.populateTransaction.registerAndWithdraw(o,n,s.operator_signature,r);case 8:return u=e.sent,e.abrupt("return",t.sendTransaction(u));case 10:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function $M(e,t,r,n){return JM.apply(this,arguments)}function JM(){return(JM=sC(dC.mark((function e(t,r,n,i){var a;return dC.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,i.populateTransaction.withdraw(n,r);case 2:return a=e.sent,e.abrupt("return",t.sendTransaction(a));case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function YM(e,t,r,n,i,a){return QM.apply(this,arguments)}function QM(){return(QM=sC(dC.mark((function e(t,r,n,i,a,o){var s,u,f;return dC.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,GM("asset","ERC20",i,{token_address:n.tokenAddress});case 2:return s=e.sent,u=XI.connect(o.ethConfiguration.coreContractAddress,t),f=iC.connect(o.ethConfiguration.registrationContractAddress,t),e.next=7,kP(r,f);case 7:if(e.sent){e.next=12;break}return e.abrupt("return",KM(t,s.asset_type,r,f,a));case 12:return e.abrupt("return",$M(t,s.asset_type,r,u));case 13:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function ZM(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function eB(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ZM(Object(r),!0).forEach((function(t){qI(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ZM(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function tB(e,t,r,n,i){return rB.apply(this,arguments)}function rB(){return(rB=sC(dC.mark((function e(t,r,n,i,a){var o;return dC.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,a.populateTransaction.withdrawAndMint(n,r,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 nB(e,t,r,n,i,a){return iB.apply(this,arguments)}function iB(){return(iB=sC(dC.mark((function e(t,r,n,i,a,o){var s,u,f;return dC.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,RP(s,n,o);case 5:return u=e.sent,e.next=8,a.populateTransaction.regsiterAndWithdrawAndMint(s,n,u.operator_signature,r,i);case 8:return f=e.sent,e.abrupt("return",t.sendTransaction(f));case 10:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function aB(e){var t=e.data.id,r=e.data.blueprint||"";return Mb(lb("{".concat(t,"}:{").concat(r,"}")))}function oB(e,t,r,n,i,a){return sB.apply(this,arguments)}function sB(){return(sB=sC(dC.mark((function e(t,r,n,i,a,o){var s,u,f,c;return dC.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,GM("mintable-asset","ERC721",i,eB({id:n.data.id,token_address:n.data.tokenAddress},n.data.blueprint&&{blueprint:n.data.blueprint}));case 2:return s=e.sent,u=aB(n),f=XI.connect(o.ethConfiguration.coreContractAddress,t),c=iC.connect(o.ethConfiguration.registrationContractAddress,t),e.next=8,kP(r,c);case 8:if(e.sent){e.next=13;break}return e.abrupt("return",nB(t,s.asset_type,r,u,c,a));case 13:return e.abrupt("return",tB(t,s.asset_type,r,u,f));case 14:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function uB(e,t,r,n,i,a){return fB.apply(this,arguments)}function fB(){return(fB=sC(dC.mark((function e(t,r,n,i,a,o){var s,u,f;return dC.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,RP(s,n,o);case 5:return u=e.sent,e.next=8,a.populateTransaction.registerAndWithdrawNft(s,n,u.operator_signature,r,i);case 8:return f=e.sent,e.abrupt("return",t.sendTransaction(f));case 10:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function cB(e,t,r,n,i){return lB.apply(this,arguments)}function lB(){return(lB=sC(dC.mark((function e(t,r,n,i,a){var o;return dC.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,a.populateTransaction.withdrawNft(n,r,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 dB(e,t,r,n,i,a){return pB.apply(this,arguments)}function pB(){return(pB=sC(dC.mark((function e(t,r,n,i,a,o){var s,u,f;return dC.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,GM("asset","ERC721",i,{token_id:n.tokenId,token_address:n.tokenAddress});case 2:return s=e.sent,u=XI.connect(o.ethConfiguration.coreContractAddress,t),f=iC.connect(o.ethConfiguration.registrationContractAddress,t),e.next=7,kP(r,f);case 7:if(e.sent){e.next=12;break}return e.abrupt("return",uB(t,s.asset_type,r,n.tokenId,f,a));case 12:return e.abrupt("return",cB(t,s.asset_type,r,n.tokenId,u));case 13:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function hB(e,t,r,n,i,a,o){return mB.apply(this,arguments)}function mB(){return(mB=sC(dC.mark((function e(t,r,n,i,a,o,s){var u,f;return dC.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return u=n.tokenAddress,f=n.tokenId,e.next=4,a.getMintableTokenDetailsByClientTokenId({tokenAddress:u,tokenId:f}).then((function(e){return oB(t,r,{type:"ERC721",data:{id:f,tokenAddress:u,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 dB(t,r,n,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 yB(e,t,r,n,i){return bB.apply(this,arguments)}function bB(){return(bB=sC(dC.mark((function e(t,r,n,i,a){var o,s,u;return dC.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,RP(o,n,a);case 5:return s=e.sent,e.next=8,i.populateTransaction.registerAndWithdraw(o,n,s.operator_signature,r);case 8:return u=e.sent,e.abrupt("return",t.sendTransaction(u));case 10:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function gB(e,t,r,n){return vB.apply(this,arguments)}function vB(){return(vB=sC(dC.mark((function e(t,r,n,i){var a;return dC.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,i.populateTransaction.withdraw(n,r);case 2:return a=e.sent,e.abrupt("return",t.sendTransaction(a));case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function wB(e,t,r,n,i){return _B.apply(this,arguments)}function _B(){return(_B=sC(dC.mark((function e(t,r,n,i,a){var o,s,u;return dC.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,GM("asset","ETH",n);case 2:return o=e.sent,s=XI.connect(a.ethConfiguration.coreContractAddress,t),u=iC.connect(a.ethConfiguration.registrationContractAddress,t),e.next=7,kP(r,u);case 7:if(e.sent){e.next=12;break}return e.abrupt("return",yB(t,o.asset_type,r,u,i));case 12:return e.abrupt("return",gB(t,o.asset_type,r,s));case 13:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function EB(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function TB(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?EB(Object(r),!0).forEach((function(t){qI(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):EB(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function AB(e){return SB.apply(this,arguments)}function SB(){return(SB=sC(dC.mark((function e(t){var r,n,i,a,o,s,u,f,c,l,d,p,h,m,y,b,g;return dC.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.ethSigner,n=t.starkSigner,i=t.request,a=t.ordersApi,e.next=3,r.getAddress();case 3:return o=e.sent,s="ERC721"===i.sell.type?"1":i.sell.amount,u="ERC721"===i.buy.type?"1":i.buy.amount,f={user:o,amount_buy:u,token_buy:dM(i.buy),amount_sell:s,token_sell:dM(i.sell),fees:i.fees,expiration_timestamp:i.expiration_timestamp,split_fees:!0},e.next=9,a.getSignableOrder({getSignableOrderRequestV3:f});case 9:return c=e.sent,l=c.data,d=l.signable_message,p=l.payload_hash,e.next=13,yC(d,r);case 13:return h=e.sent,e.next=16,n.signMessage(p);case 16:return m=e.sent,y=c.data,b={createOrderRequest:{amount_buy:y.amount_buy,amount_sell:y.amount_sell,asset_id_buy:y.asset_id_buy,asset_id_sell:y.asset_id_sell,expiration_timestamp:y.expiration_timestamp,include_fees:!0,fees:i.fees,nonce:y.nonce,stark_key:y.stark_key,stark_signature:m,vault_id_buy:y.vault_id_buy,vault_id_sell:y.vault_id_sell},xImxEthAddress:o,xImxEthSignature:h},e.next=21,a.createOrderV3(b);case 21:return g=e.sent,e.abrupt("return",TB({},g.data));case 23:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function kB(e){return OB.apply(this,arguments)}function OB(){return(OB=sC(dC.mark((function e(t){var r,n,i,a,o,s,u,f,c,l,d,p;return dC.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.ethSigner,n=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,u=s.signable_message,f=s.payload_hash,e.next=7,yC(u,r);case 7:return c=e.sent,e.next=10,n.signMessage(f);case 10:return l=e.sent,e.next=13,r.getAddress();case 13:return d=e.sent,e.next=16,a.cancelOrderV3({id:i.order_id.toString(),cancelOrderRequest:{order_id:i.order_id,stark_signature:l},xImxEthAddress:d,xImxEthSignature:c});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 RB(e){return xB.apply(this,arguments)}function xB(){return(xB=sC(dC.mark((function e(t){var r,n,i,a,o,s,u,f,c,l,d,p;return dC.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.ethSigner,n=t.starkSigner,i=t.request,a=t.tradesApi,e.next=3,r.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,u=s.data,f=u.signable_message,c=u.payload_hash,e.next=10,yC(f,r);case 10:return l=e.sent,e.next=13,n.signMessage(c);case 13:return d=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:d},xImxEthAddress:o,xImxEthSignature:l});case 16:return p=e.sent,e.abrupt("return",p.data);case 18:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function IB(e){return CB.apply(this,arguments)}function CB(){return(CB=sC(dC.mark((function e(t){var r,n,i,a,o,s,u,f,c,l,d,p,h,m,y;return dC.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.ethSigner,i=t.starkSigner,a=t.request,o=t.exchangesApi,e.next=3,n.getAddress();case 3:return s=e.sent,u=a.amount,e.next=7,o.getExchangeSignableTransfer({id:a.transactionID,getSignableTransferRequest:{sender:s,token:dM(a),amount:u,receiver:a.receiver}});case 7:return f=e.sent,c=f.data,l=c.signable_message,d=c.payload_hash,e.next=11,yC(l,n);case 11:return p=e.sent,e.next=14,i.signMessage(d);case 14:return h=e.sent,m={sender_stark_key:f.data.sender_stark_key,sender_vault_id:f.data.sender_vault_id,receiver_stark_key:f.data.receiver_stark_key,receiver_vault_id:f.data.receiver_vault_id,asset_id:f.data.asset_id,amount:f.data.amount,nonce:f.data.nonce,expiration_timestamp:f.data.expiration_timestamp,stark_signature:h},e.next=18,o.createExchangeTransfer({id:a.transactionID,createTransferRequest:m,xImxEthAddress:s,xImxEthSignature:p});case 18:return y=e.sent,e.abrupt("return",{sent_signature:null==y?void 0:y.data.sent_signature,status:null==y||null===(r=y.data.status)||void 0===r?void 0:r.toString(),time:null==y?void 0:y.data.time,transfer_id:null==y?void 0:y.data.transfer_id});case 20:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function NB(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function PB(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?NB(Object(r),!0).forEach((function(t){qI(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):NB(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var MB=function(){function e(t){LI(this,e),this.config=t;var r=t.apiConfiguration;this.config=t,this.depositsApi=new uN(r),this.encodingApi=new dN(r),this.mintsApi=new RN(r),this.ordersApi=new DN(r),this.tokensApi=new VN(r),this.tradesApi=new XN(r),this.transfersApi=new QN(r),this.usersApi=new rP(r),this.withdrawalsApi=new oP(r),this.projectsApi=new jN(r),this.collectionsApi=new iN(r),this.metadataApi=new wN(r),this.metadataRefreshesApi=new AN(r),this.exchangesApi=new yN(r)}var t,r,n,i,a,o,s,u,f,c,l,d,p,h,m,y,b,g,v,w,_,E,T,A,S,k,O,R;return jI(e,[{key:"isChainValid",value:function(e){return e===this.config.ethConfiguration.chainID}},{key:"validateChain",value:(R=sC(dC.mark((function e(t){var r;return dC.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t.getChainId();case 2:if(r=e.sent,this.isChainValid(r)){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 R.apply(this,arguments)})},{key:"registerOffchain",value:(O=sC(dC.mark((function e(t){return dC.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",AP(PB(PB({},t),{},{usersApi:this.usersApi})));case 3:case"end":return e.stop()}}),e,this)}))),function(e){return O.apply(this,arguments)})},{key:"isRegisteredOnchain",value:(k=sC(dC.mark((function e(t){var r,n;return dC.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.validateChain(t.ethSigner);case 2:return r=iC.connect(this.config.ethConfiguration.registrationContractAddress,t.ethSigner),e.next=5,t.starkSigner.getAddress();case 5:return n=e.sent,e.abrupt("return",kP(n,r));case 7:case"end":return e.stop()}}),e,this)}))),function(e){return k.apply(this,arguments)})},{key:"mint",value:(S=sC(dC.mark((function e(t,r){return dC.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.validateChain(t);case 2:return e.abrupt("return",cM(t,r,this.mintsApi));case 3:case"end":return e.stop()}}),e,this)}))),function(e,t){return S.apply(this,arguments)})},{key:"transfer",value:(A=sC(dC.mark((function e(t,r){return dC.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",mM(PB(PB({},t),{},{request:r,transfersApi:this.transfersApi})));case 3:case"end":return e.stop()}}),e,this)}))),function(e,t){return A.apply(this,arguments)})},{key:"exchangeTransfer",value:(T=sC(dC.mark((function e(t,r){return dC.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",IB(PB(PB({},t),{},{request:r,exchangesApi:this.exchangesApi})));case 3:case"end":return e.stop()}}),e,this)}))),function(e,t){return T.apply(this,arguments)})},{key:"batchNftTransfer",value:(E=sC(dC.mark((function e(t,r){return dC.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",bM(PB(PB({},t),{},{request:r,transfersApi:this.transfersApi})));case 3:case"end":return e.stop()}}),e,this)}))),function(e,t){return E.apply(this,arguments)})},{key:"deposit",value:(_=sC(dC.mark((function e(t,r){return dC.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:e.t0=r.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,r));case 4:return e.abrupt("return",this.depositERC20(t,r));case 5:return e.abrupt("return",this.depositERC721(t,r));case 6:case"end":return e.stop()}}),e,this)}))),function(e,t){return _.apply(this,arguments)})},{key:"depositEth",value:(w=sC(dC.mark((function e(t,r){return dC.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.validateChain(t);case 2:return e.abrupt("return",RM(t,r,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=sC(dC.mark((function e(t,r){return dC.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.validateChain(t);case 2:return e.abrupt("return",MM(t,r,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=sC(dC.mark((function e(t,r){return dC.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.validateChain(t);case 2:return e.abrupt("return",LM(t,r,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:(b=sC(dC.mark((function e(t,r){return dC.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",qM(PB(PB(PB({},t),r),{},{withdrawalsApi:this.withdrawalsApi})));case 3:case"end":return e.stop()}}),e,this)}))),function(e,t){return b.apply(this,arguments)})},{key:"completeWithdrawal",value:function(e,t,r){switch(r.type){case"ETH":return this.completeEthWithdrawal(e,t);case"ERC20":return this.completeERC20Withdrawal(e,t,r);case"ERC721":return this.completeERC721Withdrawal(e,t,r)}}},{key:"completeEthWithdrawal",value:(y=sC(dC.mark((function e(t,r){return dC.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.validateChain(t);case 2:return e.abrupt("return",wB(t,r,this.encodingApi,this.usersApi,this.config));case 3:case"end":return e.stop()}}),e,this)}))),function(e,t){return y.apply(this,arguments)})},{key:"completeERC20Withdrawal",value:(m=sC(dC.mark((function e(t,r,n){return dC.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.validateChain(t);case 2:return e.abrupt("return",YM(t,r,n,this.encodingApi,this.usersApi,this.config));case 3:case"end":return e.stop()}}),e,this)}))),function(e,t,r){return m.apply(this,arguments)})},{key:"completeERC721Withdrawal",value:function(){var e=sC(dC.mark((function e(t,r,n){return dC.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.validateChain(t);case 2:return e.abrupt("return",hB(t,r,n,this.encodingApi,this.mintsApi,this.usersApi,this.config));case 3:case"end":return e.stop()}}),e,this)})));return function(t,r,n){return e.apply(this,arguments)}}()},{key:"createOrder",value:(h=sC(dC.mark((function e(t,r){return dC.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",AB(PB(PB({},t),{},{request:r,ordersApi:this.ordersApi})));case 3:case"end":return e.stop()}}),e,this)}))),function(e,t){return h.apply(this,arguments)})},{key:"cancelOrder",value:(p=sC(dC.mark((function e(t,r){return dC.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",kB(PB(PB({},t),{},{request:r,ordersApi:this.ordersApi})));case 3:case"end":return e.stop()}}),e,this)}))),function(e,t){return p.apply(this,arguments)})},{key:"createTrade",value:(d=sC(dC.mark((function e(t,r){return dC.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",RB(PB(PB({},t),{},{request:r,tradesApi:this.tradesApi})));case 3:case"end":return e.stop()}}),e,this)}))),function(e,t){return d.apply(this,arguments)})},{key:"createProject",value:(l=sC(dC.mark((function e(t,r){var n;return dC.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,gC(t);case 2:return n=e.sent,e.abrupt("return",this.projectsApi.createProject({iMXSignature:n.signature,iMXTimestamp:n.timestamp,createProjectRequest:r}));case 4:case"end":return e.stop()}}),e,this)}))),function(e,t){return l.apply(this,arguments)})},{key:"getProject",value:(c=sC(dC.mark((function e(t,r){var n;return dC.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,gC(t);case 2:return n=e.sent,e.abrupt("return",this.projectsApi.getProject({id:r,iMXSignature:n.signature,iMXTimestamp:n.timestamp}));case 4:case"end":return e.stop()}}),e,this)}))),function(e,t){return c.apply(this,arguments)})},{key:"getProjects",value:(f=sC(dC.mark((function e(t,r,n,i,a){var o;return dC.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,gC(t);case 2:return o=e.sent,e.abrupt("return",this.projectsApi.getProjects({iMXSignature:o.signature,iMXTimestamp:o.timestamp,pageSize:r,cursor:n,orderBy:i,direction:a}));case 4:case"end":return e.stop()}}),e,this)}))),function(e,t,r,n,i){return f.apply(this,arguments)})},{key:"createCollection",value:(u=sC(dC.mark((function e(t,r){var n;return dC.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,gC(t);case 2:return n=e.sent,e.abrupt("return",this.collectionsApi.createCollection({iMXSignature:n.signature,iMXTimestamp:n.timestamp,createCollectionRequest:r}));case 4:case"end":return e.stop()}}),e,this)}))),function(e,t){return u.apply(this,arguments)})},{key:"updateCollection",value:(s=sC(dC.mark((function e(t,r,n){var i;return dC.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,gC(t);case 2:return i=e.sent,e.abrupt("return",this.collectionsApi.updateCollection({iMXSignature:i.signature,iMXTimestamp:i.timestamp,address:r,updateCollectionRequest:n}));case 4:case"end":return e.stop()}}),e,this)}))),function(e,t,r){return s.apply(this,arguments)})},{key:"addMetadataSchemaToCollection",value:(o=sC(dC.mark((function e(t,r,n){var i;return dC.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,gC(t);case 2:return i=e.sent,e.abrupt("return",this.metadataApi.addMetadataSchemaToCollection({iMXSignature:i.signature,iMXTimestamp:i.timestamp,addMetadataSchemaToCollectionRequest:n,address:r}));case 4:case"end":return e.stop()}}),e,this)}))),function(e,t,r){return o.apply(this,arguments)})},{key:"updateMetadataSchemaByName",value:(a=sC(dC.mark((function e(t,r,n,i){var a;return dC.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,gC(t);case 2:return a=e.sent,e.abrupt("return",this.metadataApi.updateMetadataSchemaByName({iMXSignature:a.signature,iMXTimestamp:a.timestamp,address:r,name:n,metadataSchemaRequest:i}));case 4:case"end":return e.stop()}}),e,this)}))),function(e,t,r,n){return a.apply(this,arguments)})},{key:"listMetadataRefreshes",value:(i=sC(dC.mark((function e(t,r,n,i){var a,o;return dC.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,gC(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:r,pageSize:n,cursor:i}));case 7:case"end":return e.stop()}}),e,this)}))),function(e,t,r,n){return i.apply(this,arguments)})},{key:"getMetadataRefreshErrors",value:(n=sC(dC.mark((function e(t,r,n,i){var a,o;return dC.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,gC(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:r,pageSize:n,cursor:i}));case 7:case"end":return e.stop()}}),e,this)}))),function(e,t,r,i){return n.apply(this,arguments)})},{key:"getMetadataRefreshResults",value:(r=sC(dC.mark((function e(t,r){var n,i;return dC.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,gC(t);case 2:return n=e.sent,e.next=5,t.getAddress();case 5:return i=e.sent,e.abrupt("return",this.metadataRefreshesApi.getMetadataRefreshResults({xImxEthSignature:n.signature,xImxEthTimestamp:n.timestamp,xImxEthAddress:i,refreshId:r}));case 7:case"end":return e.stop()}}),e,this)}))),function(e,t){return r.apply(this,arguments)})},{key:"createMetadataRefresh",value:(t=sC(dC.mark((function e(t,r){var n,i;return dC.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,gC(t);case 2:return n=e.sent,e.next=5,t.getAddress();case 5:return i=e.sent,e.abrupt("return",this.metadataRefreshesApi.requestAMetadataRefresh({xImxEthSignature:n.signature,xImxEthTimestamp:n.timestamp,xImxEthAddress:i,createMetadataRefreshRequest:r}));case 7:case"end":return e.stop()}}),e,this)}))),function(e,r){return t.apply(this,arguments)})}]),e}();function BB(e){if(FI.isAxiosError(e)&&e.response){var t,r,n,i=e.response.data;return i.code&&i.message?new gP({code:i.code,details:i.details,message:i.message}):new gP({code:null!==(t=null!==(r=e.code)&&void 0!==r?r:null===(n=e.response)||void 0===n?void 0:n.status.toString())&&void 0!==t?t:"unknown_error_code",message:String(e)})}return new gP({code:"unknown_error_code",message:String(e)})}var DB=function(){function e(t){LI(this,e),this.depositsApi=new uN(t.apiConfiguration),this.mintsApi=new RN(t.apiConfiguration),this.ordersApi=new DN(t.apiConfiguration),this.tokensApi=new VN(t.apiConfiguration),this.tradesApi=new XN(t.apiConfiguration),this.transfersApi=new QN(t.apiConfiguration),this.exchangeApi=new yN(t.apiConfiguration),this.usersApi=new rP(t.apiConfiguration),this.withdrawalsApi=new oP(t.apiConfiguration),this.balanceApi=new eN(t.apiConfiguration),this.assetApi=new JC(t.apiConfiguration),this.collectionApi=new iN(t.apiConfiguration),this.metadataApi=new wN(t.apiConfiguration),this.metadataRefreshesApi=new AN(t.apiConfiguration),this.nftCheckoutPrimaryApi=new NN(t.apiConfiguration),this.projectsApi=new jN(t.apiConfiguration),this.workflows=new MB(t)}var t,r,n;return jI(e,[{key:"deposit",value:function(e,t){return this.workflows.deposit(e,t).catch((function(e){throw BB(e)}))}},{key:"getDeposit",value:function(e){return this.depositsApi.getDeposit(e).then((function(e){return e.data})).catch((function(e){throw BB(e)}))}},{key:"listDeposits",value:function(e){return this.depositsApi.listDeposits(e).then((function(e){return e.data})).catch((function(e){throw BB(e)}))}},{key:"registerOffchain",value:function(e){return this.workflows.registerOffchain(e).catch((function(e){throw BB(e)}))}},{key:"isRegisteredOnchain",value:function(e){return this.workflows.isRegisteredOnchain(e).catch((function(e){throw BB(e)}))}},{key:"getUser",value:function(e){return this.usersApi.getUsers({user:e}).then((function(e){return e.data})).catch((function(e){throw BB(e)}))}},{key:"getAsset",value:function(e){return this.assetApi.getAsset(e).then((function(e){return e.data})).catch((function(e){throw BB(e)}))}},{key:"listAssets",value:function(e){return this.assetApi.listAssets(e).then((function(e){return e.data})).catch((function(e){throw BB(e)}))}},{key:"createCollection",value:function(e,t){return this.workflows.createCollection(e,t).then((function(e){return e.data})).catch((function(e){throw BB(e)}))}},{key:"getCollection",value:function(e){return this.collectionApi.getCollection(e).then((function(e){return e.data})).catch((function(e){throw BB(e)}))}},{key:"listCollectionFilters",value:function(e){return this.collectionApi.listCollectionFilters(e).then((function(e){return e.data})).catch((function(e){throw BB(e)}))}},{key:"listCollections",value:function(e){return this.collectionApi.listCollections(e).then((function(e){return e.data})).catch((function(e){throw BB(e)}))}},{key:"updateCollection",value:function(e,t,r){return this.workflows.updateCollection(e,t,r).then((function(e){return e.data})).catch((function(e){throw BB(e)}))}},{key:"addMetadataSchemaToCollection",value:function(e,t,r){return this.workflows.addMetadataSchemaToCollection(e,t,r).then((function(e){return e.data})).catch((function(e){throw BB(e)}))}},{key:"getMetadataSchema",value:function(e){return this.metadataApi.getMetadataSchema(e).then((function(e){return e.data})).catch((function(e){throw BB(e)}))}},{key:"updateMetadataSchemaByName",value:function(e,t,r,n){return this.workflows.updateMetadataSchemaByName(e,t,r,n).then((function(e){return e.data})).catch((function(e){throw BB(e)}))}},{key:"listMetadataRefreshes",value:function(e,t,r,n){return this.workflows.listMetadataRefreshes(e,t,r,n).then((function(e){return e.data})).catch((function(e){throw BB(e)}))}},{key:"getMetadataRefreshErrors",value:function(e,t,r,n){return this.workflows.getMetadataRefreshErrors(e,t,r,n).then((function(e){return e.data})).catch((function(e){throw BB(e)}))}},{key:"getMetadataRefreshResults",value:function(e,t){return this.workflows.getMetadataRefreshResults(e,t).then((function(e){return e.data})).catch((function(e){throw BB(e)}))}},{key:"createMetadataRefresh",value:function(e,t){return this.workflows.createMetadataRefresh(e,t).then((function(e){return e.data})).catch((function(e){throw BB(e)}))}},{key:"createProject",value:(n=sC(dC.mark((function e(t,r){return dC.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.workflows.createProject(t,r).then((function(e){return e.data})).catch((function(e){throw BB(e)})));case 1:case"end":return e.stop()}}),e,this)}))),function(e,t){return n.apply(this,arguments)})},{key:"getProject",value:(r=sC(dC.mark((function e(t,r){return dC.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.workflows.getProject(t,r).then((function(e){return e.data})).catch((function(e){throw BB(e)})));case 1:case"end":return e.stop()}}),e,this)}))),function(e,t){return r.apply(this,arguments)})},{key:"getProjects",value:(t=sC(dC.mark((function e(t,r,n,i,a){return dC.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.workflows.getProjects(t,r,n,i,a).then((function(e){return e.data})).catch((function(e){throw BB(e)})));case 1:case"end":return e.stop()}}),e,this)}))),function(e,r,n,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 BB(e)}))}},{key:"listBalances",value:function(e){return this.balanceApi.listBalances(e).then((function(e){return e.data})).catch((function(e){throw BB(e)}))}},{key:"getMint",value:function(e){return this.mintsApi.getMint(e).then((function(e){return e.data})).catch((function(e){throw BB(e)}))}},{key:"listMints",value:function(e){return this.mintsApi.listMints(e).then((function(e){return e.data})).catch((function(e){throw BB(e)}))}},{key:"mint",value:function(e,t){return this.workflows.mint(e,t).catch((function(e){throw BB(e)}))}},{key:"listWithdrawals",value:function(e){return this.withdrawalsApi.listWithdrawals(e).then((function(e){return e.data})).catch((function(e){throw BB(e)}))}},{key:"getWithdrawal",value:function(e){return this.withdrawalsApi.getWithdrawal(e).then((function(e){return e.data})).catch((function(e){throw BB(e)}))}},{key:"prepareWithdrawal",value:function(e,t){return this.workflows.prepareWithdrawal(e,t).catch((function(e){throw BB(e)}))}},{key:"completeWithdrawal",value:function(e,t,r){return this.workflows.completeWithdrawal(e,t,r).catch((function(e){throw BB(e)}))}},{key:"getOrder",value:function(e){return this.ordersApi.getOrderV3(e).then((function(e){return e.data})).catch((function(e){throw BB(e)}))}},{key:"listOrders",value:function(e){return this.ordersApi.listOrdersV3(e).then((function(e){return e.data})).catch((function(e){throw BB(e)}))}},{key:"createOrder",value:function(e,t){return this.workflows.createOrder(e,t).catch((function(e){throw BB(e)}))}},{key:"cancelOrder",value:function(e,t){return this.workflows.cancelOrder(e,t).catch((function(e){throw BB(e)}))}},{key:"getTrade",value:function(e){return this.tradesApi.getTrade(e).then((function(e){return e.data})).catch((function(e){throw BB(e)}))}},{key:"listTrades",value:function(e){return this.tradesApi.listTradesV3(e).then((function(e){return e.data})).catch((function(e){throw BB(e)}))}},{key:"createTrade",value:function(e,t){return this.workflows.createTrade(e,t).catch((function(e){throw BB(e)}))}},{key:"getToken",value:function(e){return this.tokensApi.getToken(e).then((function(e){return e.data})).catch((function(e){throw BB(e)}))}},{key:"listTokens",value:function(e){return this.tokensApi.listTokens(e).then((function(e){return e.data})).catch((function(e){throw BB(e)}))}},{key:"getTransfer",value:function(e){return this.transfersApi.getTransfer(e).then((function(e){return e.data})).catch((function(e){throw BB(e)}))}},{key:"listTransfers",value:function(e){return this.transfersApi.listTransfers(e).then((function(e){return e.data})).catch((function(e){throw BB(e)}))}},{key:"transfer",value:function(e,t){return this.workflows.transfer(e,t).catch((function(e){throw BB(e)}))}},{key:"batchNftTransfer",value:function(e,t){return this.workflows.batchNftTransfer(e,t).catch((function(e){throw BB(e)}))}},{key:"createExchange",value:function(e){return this.exchangeApi.createExchange(e).catch((function(e){throw BB(e)}))}},{key:"getExchange",value:function(e){return this.exchangeApi.getExchange(e).catch((function(e){throw BB(e)}))}},{key:"getExchanges",value:function(e){return this.exchangeApi.getExchanges(e).catch((function(e){throw BB(e)}))}},{key:"exchangeTransfer",value:function(e,t){return this.workflows.exchangeTransfer(e,t).catch((function(e){throw BB(e)}))}},{key:"createNftPrimary",value:function(e){return this.nftCheckoutPrimaryApi.createNftPrimary(e).catch((function(e){throw BB(e)}))}},{key:"getCurrenciesNFTCheckoutPrimary",value:function(e){return this.nftCheckoutPrimaryApi.getCurrenciesNFTCheckoutPrimary(e).catch((function(e){throw BB(e)}))}},{key:"getNftPrimaryTransaction",value:function(e){return this.nftCheckoutPrimaryApi.getNftPrimaryTransaction(e).catch((function(e){throw BB(e)}))}},{key:"getNftPrimaryTransactions",value:function(e){return this.nftCheckoutPrimaryApi.getNftPrimaryTransactions(e).catch((function(e){throw BB(e)}))}}]),e}();const FB=({basePath:e,chainID:t,coreContractAddress:r,registrationContractAddress:n})=>TP.createConfig({basePath:e,chainID:t,coreContractAddress:r,registrationContractAddress:n,sdkVersion:"ts-immutable-sdk-0.3.1-alpha"}),LB=()=>FB({basePath:"https://api.sandbox.x.immutable.com",chainID:5,coreContractAddress:"0x7917eDb51ecD6CdB3F9854c3cc593F33de10c623",registrationContractAddress:"0x1C97Ada273C9A52253f463042f29117090Cd7D83"});class UB{immutableXConfig;baseConfig;constructor({baseConfig:t,overrides:r}){if(this.baseConfig=t,r)this.immutableXConfig=r.immutableXConfig;else switch(t.environment){case e.Environment.SANDBOX:this.immutableXConfig=LB();break;case e.Environment.PRODUCTION:this.immutableXConfig=FB({basePath:"https://api.x.immutable.com",chainID:1,coreContractAddress:"0x5FDCCA53617f4d2b9134B29090C87D01058e27e9",registrationContractAddress:"0x72a06bf2a1CE5e39cBA06c0CAb824960B587d64c"});break;default:this.immutableXConfig=LB()}}}class jB{immutableX;depositsApi;mintsApi;ordersApi;tokensApi;tradesApi;transfersApi;exchangeApi;nftCheckoutPrimaryApi;usersApi;withdrawalsApi;balanceApi;assetApi;collectionApi;metadataApi;metadataRefreshesApi;projectsApi;constructor(e){const t=new UB(e);this.immutableX=new DB(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,r){return this.immutableX.updateCollection(e,t,r)}addMetadataSchemaToCollection(e,t,r){return this.immutableX.addMetadataSchemaToCollection(e,t,r)}getMetadataSchema(e){return this.immutableX.getMetadataSchema(e)}updateMetadataSchemaByName(e,t,r,n){return this.immutableX.updateMetadataSchemaByName(e,t,r,n)}listMetadataRefreshes(e,t,r,n){return this.immutableX.listMetadataRefreshes(e,t,r,n)}getMetadataRefreshErrors(e,t,r,n){return this.immutableX.getMetadataRefreshErrors(e,t,r,n)}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,r,n,i){return this.immutableX.getProjects(e,t,r,n,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 qB={exports:{}};!function(e,t){e.exports=function(){var e=e||function(e,t){var r;if("undefined"!=typeof window&&window.crypto&&(r=window.crypto),"undefined"!=typeof self&&self.crypto&&(r=self.crypto),"undefined"!=typeof globalThis&&globalThis.crypto&&(r=globalThis.crypto),!r&&"undefined"!=typeof window&&window.msCrypto&&(r=window.msCrypto),!r&&void 0!==on&&on.crypto&&(r=on.crypto),!r)try{r=Gb}catch(e){}var n=function(){if(r){if("function"==typeof r.getRandomValues)try{return r.getRandomValues(new Uint32Array(1))[0]}catch(e){}if("function"==typeof r.randomBytes)try{return r.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 r;return e.prototype=t,r=new e,e.prototype=null,r}}(),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)}},u=o.WordArray=s.extend({init:function(e,r){e=this.words=e||[],this.sigBytes=r!=t?r:4*e.length},toString:function(e){return(e||c).stringify(this)},concat:function(e){var t=this.words,r=e.words,n=this.sigBytes,i=e.sigBytes;if(this.clamp(),n%4)for(var a=0;a<i;a++){var o=r[a>>>2]>>>24-a%4*8&255;t[n+a>>>2]|=o<<24-(n+a)%4*8}else for(var s=0;s<i;s+=4)t[n+s>>>2]=r[s>>>2];return this.sigBytes+=i,this},clamp:function(){var t=this.words,r=this.sigBytes;t[r>>>2]&=4294967295<<32-r%4*8,t.length=e.ceil(r/4)},clone:function(){var e=s.clone.call(this);return e.words=this.words.slice(0),e},random:function(e){for(var t=[],r=0;r<e;r+=4)t.push(n());return new u.init(t,e)}}),f=a.enc={},c=f.Hex={stringify:function(e){for(var t=e.words,r=e.sigBytes,n=[],i=0;i<r;i++){var a=t[i>>>2]>>>24-i%4*8&255;n.push((a>>>4).toString(16)),n.push((15&a).toString(16))}return n.join("")},parse:function(e){for(var t=e.length,r=[],n=0;n<t;n+=2)r[n>>>3]|=parseInt(e.substr(n,2),16)<<24-n%8*4;return new u.init(r,t/2)}},l=f.Latin1={stringify:function(e){for(var t=e.words,r=e.sigBytes,n=[],i=0;i<r;i++){var a=t[i>>>2]>>>24-i%4*8&255;n.push(String.fromCharCode(a))}return n.join("")},parse:function(e){for(var t=e.length,r=[],n=0;n<t;n++)r[n>>>2]|=(255&e.charCodeAt(n))<<24-n%4*8;return new u.init(r,t)}},d=f.Utf8={stringify:function(e){try{return decodeURIComponent(escape(l.stringify(e)))}catch(e){throw new Error("Malformed UTF-8 data")}},parse:function(e){return l.parse(unescape(encodeURIComponent(e)))}},p=o.BufferedBlockAlgorithm=s.extend({reset:function(){this._data=new u.init,this._nDataBytes=0},_append:function(e){"string"==typeof e&&(e=d.parse(e)),this._data.concat(e),this._nDataBytes+=e.sigBytes},_process:function(t){var r,n=this._data,i=n.words,a=n.sigBytes,o=this.blockSize,s=a/(4*o),f=(s=t?e.ceil(s):e.max((0|s)-this._minBufferSize,0))*o,c=e.min(4*f,a);if(f){for(var l=0;l<f;l+=o)this._doProcessBlock(i,l);r=i.splice(0,f),n.sigBytes-=c}return new u.init(r,c)},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,r){return new e.init(r).finalize(t)}},_createHmacHelper:function(e){return function(t,r){return new h.HMAC.init(e,r).finalize(t)}}});var h=a.algo={};return a}(Math);return e}()}(qB);var zB=qB.exports,HB=sn(zB),VB={exports:{}};!function(e,t){e.exports=function(e){return function(t){var r=e,n=r.lib,i=n.WordArray,a=n.Hasher,o=r.algo,s=[],u=[];!function(){function e(e){for(var r=t.sqrt(e),n=2;n<=r;n++)if(!(e%n))return!1;return!0}function r(e){return 4294967296*(e-(0|e))|0}for(var n=2,i=0;i<64;)e(n)&&(i<8&&(s[i]=r(t.pow(n,.5))),u[i]=r(t.pow(n,1/3)),i++),n++}();var f=[],c=o.SHA256=a.extend({_doReset:function(){this._hash=new i.init(s.slice(0))},_doProcessBlock:function(e,t){for(var r=this._hash.words,n=r[0],i=r[1],a=r[2],o=r[3],s=r[4],c=r[5],l=r[6],d=r[7],p=0;p<64;p++){if(p<16)f[p]=0|e[t+p];else{var h=f[p-15],m=(h<<25|h>>>7)^(h<<14|h>>>18)^h>>>3,y=f[p-2],b=(y<<15|y>>>17)^(y<<13|y>>>19)^y>>>10;f[p]=m+f[p-7]+b+f[p-16]}var g=n&i^n&a^i&a,v=(n<<30|n>>>2)^(n<<19|n>>>13)^(n<<10|n>>>22),w=d+((s<<26|s>>>6)^(s<<21|s>>>11)^(s<<7|s>>>25))+(s&c^~s&l)+u[p]+f[p];d=l,l=c,c=s,s=o+w|0,o=a,a=i,i=n,n=w+(v+g)|0}r[0]=r[0]+n|0,r[1]=r[1]+i|0,r[2]=r[2]+a|0,r[3]=r[3]+o|0,r[4]=r[4]+s|0,r[5]=r[5]+c|0,r[6]=r[6]+l|0,r[7]=r[7]+d|0},_doFinalize:function(){var e=this._data,r=e.words,n=8*this._nDataBytes,i=8*e.sigBytes;return r[i>>>5]|=128<<24-i%32,r[14+(i+64>>>9<<4)]=t.floor(n/4294967296),r[15+(i+64>>>9<<4)]=n,e.sigBytes=4*r.length,this._process(),this._hash},clone:function(){var e=a.clone.call(this);return e._hash=this._hash.clone(),e}});r.SHA256=a._createHelper(c),r.HmacSHA256=a._createHmacHelper(c)}(Math),e.SHA256}(zB)}(VB);var GB=sn(VB.exports),WB={exports:{}};!function(e,t){e.exports=function(e){return function(){var t=e,r=t.lib.WordArray;function n(e,t,n){for(var i=[],a=0,o=0;o<t;o++)if(o%4){var s=n[e.charCodeAt(o-1)]<<o%4*2|n[e.charCodeAt(o)]>>>6-o%4*2;i[a>>>2]|=s<<24-a%4*8,a++}return r.create(i,a)}t.enc.Base64={stringify:function(e){var t=e.words,r=e.sigBytes,n=this._map;e.clamp();for(var i=[],a=0;a<r;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<r;s++)i.push(n.charAt(o>>>6*(3-s)&63));var u=n.charAt(64);if(u)for(;i.length%4;)i.push(u);return i.join("")},parse:function(e){var t=e.length,r=this._map,i=this._reverseMap;if(!i){i=this._reverseMap=[];for(var a=0;a<r.length;a++)i[r.charCodeAt(a)]=a}var o=r.charAt(64);if(o){var s=e.indexOf(o);-1!==s&&(t=s)}return n(e,t,i)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="}}(),e.enc.Base64}(zB)}(WB);var KB=sn(WB.exports),XB={exports:{}};!function(e,t){e.exports=function(e){return e.enc.Utf8}(zB)}(XB);var $B=sn(XB.exports);function JB(e){this.message=e}JB.prototype=new Error,JB.prototype.name="InvalidCharacterError";var YB="undefined"!=typeof window&&window.atob&&window.atob.bind(window)||function(e){var t=String(e).replace(/=+$/,"");if(t.length%4==1)throw new JB("'atob' failed: The string to be decoded is not correctly encoded.");for(var r,n,i=0,a=0,o="";n=t.charAt(a++);~n&&(r=i%4?64*r+n:n,i++%4)?o+=String.fromCharCode(255&r>>(-2*i&6)):0)n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(n);return o};function QB(e){this.message=e}function ZB(e,t){if("string"!=typeof e)throw new QB("Invalid token specified");var r=!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(YB(e).replace(/(.)/g,(function(e,t){var r=t.charCodeAt(0).toString(16).toUpperCase();return r.length<2&&(r="0"+r),"%"+r})))}(t)}catch(e){return YB(t)}}(e.split(".")[r]))}catch(e){throw new QB("Invalid token specified: "+e.message)}}QB.prototype=new Error,QB.prototype.name="InvalidTokenError";var eD,tD,rD,nD={debug:()=>{},info:()=>{},warn:()=>{},error:()=>{}},iD=(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))(iD||{});(rD=iD||(iD={})).reset=function(){eD=3,tD=nD},rD.setLevel=function(e){if(!(0<=e&&e<=4))throw new Error("Invalid log level");eD=e},rD.setLogger=function(e){tD=e};var aD=class{constructor(e){this._name=e}debug(...e){eD>=4&&tD.debug(aD._format(this._name,this._method),...e)}info(...e){eD>=3&&tD.info(aD._format(this._name,this._method),...e)}warn(...e){eD>=2&&tD.warn(aD._format(this._name,this._method),...e)}error(...e){eD>=1&&tD.error(aD._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 r=new aD(`${e}.${t}`);return r.debug("begin"),r}static _format(e,t){const r=`[${e}]`;return t?`${r} ${t}:`:r}static debug(e,...t){eD>=4&&tD.debug(aD._format(e),...t)}static info(e,...t){eD>=3&&tD.info(aD._format(e),...t)}static warn(e,...t){eD>=2&&tD.warn(aD._format(e),...t)}static error(e,...t){eD>=1&&tD.error(aD._format(e),...t)}};iD.reset();var oD=class{static _randomWord(){return HB.lib.WordArray.random(1).words[0]}static generateUUIDv4(){const e="10000000-1000-4000-8000-100000000000".replace(/[018]/g,(e=>(+e^oD._randomWord()&15>>+e/4).toString(16)));return e.replace(/-/g,"")}static generateCodeVerifier(){return oD.generateUUIDv4()+oD.generateUUIDv4()+oD.generateUUIDv4()}static generateCodeChallenge(e){try{const t=GB(e);return KB.stringify(t).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}catch(e){throw aD.error("CryptoUtils.generateCodeChallenge",e),e}}static generateBasicAuth(e,t){const r=$B.parse([e,t].join(":"));return KB.stringify(r)}},sD=class{constructor(e){this._name=e,this._logger=new aD(`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)}},uD=class{static decode(e){try{return ZB(e)}catch(e){throw aD.error("JwtUtils.decode",e),e}}},fD=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(",")}},cD=class extends sD{constructor(){super(...arguments),this._logger=new aD(`Timer('${this._name}')`),this._timerHandle=null,this._expiration=0,this._callback=()=>{const e=this._expiration-cD.getEpochTime();this._logger.debug("timer completes in",e),this._expiration<=cD.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 r=cD.getEpochTime()+e;if(this.expiration===r&&this._timerHandle)return void t.debug("skipping since already initialized for expiration at",this.expiration);this.cancel(),t.debug("using duration",e),this._expiration=r;const n=Math.min(e,5);this._timerHandle=setInterval(this._callback,1e3*n)}get expiration(){return this._expiration}cancel(){this._logger.create("cancel"),this._timerHandle&&(clearInterval(this._timerHandle),this._timerHandle=null)}},lD=class{static readParams(e,t="query"){if(!e)throw new TypeError("Invalid URL");const r=new URL(e,"http://127.0.0.1")["fragment"===t?"hash":"search"];return new URLSearchParams(r.slice(1))}},dD=class extends Error{constructor(e,t){var r,n,i;if(super(e.error_description||e.error||""),this.form=t,this.name="ErrorResponse",!e.error)throw aD.error("ErrorResponse","No error passed"),new Error("No error passed");this.error=e.error,this.error_description=null!=(r=e.error_description)?r:null,this.error_uri=null!=(n=e.error_uri)?n:null,this.state=e.userState,this.session_state=null!=(i=e.session_state)?i:null}},pD=class extends Error{constructor(e){super(e),this.name="ErrorTimeout"}},hD=class{constructor(e){this._logger=new aD("AccessTokenEvents"),this._expiringTimer=new cD("Access token expiring"),this._expiredTimer=new cD("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 r=e.expires_in;if(t.debug("access token present, remaining duration:",r),r>0){let e=r-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 n=r+1;t.debug("registering expired timer, raising in",n,"seconds"),this._expiredTimer.init(n)}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)}},mD=class{constructor(){this._logger=new aD("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]}},yD=class{constructor(e=[],t=null,r={}){this._jwtHandler=t,this._extraHeaders=r,this._logger=new aD("JsonService"),this._contentTypes=[],this._contentTypes.push(...e,"application/json"),t&&this._contentTypes.push("application/jwt")}async fetchWithTimeout(e,t={}){const{timeoutInSeconds:r,...n}=t;if(!r)return await fetch(e,n);const i=new AbortController,a=setTimeout((()=>i.abort()),1e3*r);try{return await fetch(e,{...t,signal:i.signal})}catch(e){if(e instanceof DOMException&&"AbortError"===e.name)throw new pD("Network timed out");throw e}finally{clearTimeout(a)}}async getJson(e,{token:t,credentials:r}={}){const n=this._logger.create("getJson"),i={Accept:this._contentTypes.join(", ")};let a;t&&(n.debug("token passed, setting Authorization header"),i.Authorization="Bearer "+t),this.appendExtraHeaders(i);try{n.debug("url:",e),a=await this.fetchWithTimeout(e,{method:"GET",headers:i,credentials:r})}catch(e){throw n.error("Network Error"),e}n.debug("HTTP response received, status",a.status);const o=a.headers.get("Content-Type");if(o&&!this._contentTypes.find((e=>o.startsWith(e)))&&n.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(n.error("Error parsing JSON response",e),a.ok)throw e;throw new Error(`${a.statusText} (${a.status})`)}if(!a.ok){if(n.error("Error from server:",s),s.error)throw new dD(s);throw new Error(`${a.statusText} (${a.status}): ${JSON.stringify(s)}`)}return s}async postForm(e,{body:t,basicAuth:r,timeoutInSeconds:n,initCredentials:i}){const a=this._logger.create("postForm"),o={Accept:this._contentTypes.join(", "),"Content-Type":"application/x-www-form-urlencoded"};let s;void 0!==r&&(o.Authorization="Basic "+r),this.appendExtraHeaders(o);try{a.debug("url:",e),s=await this.fetchWithTimeout(e,{method:"POST",headers:o,body:t,timeoutInSeconds:n,credentials:i})}catch(e){throw a.error("Network error"),e}a.debug("HTTP response received, status",s.status);const u=s.headers.get("Content-Type");if(u&&!this._contentTypes.find((e=>u.startsWith(e))))throw new Error(`Invalid response Content-Type: ${null!=u?u:"undefined"}, from URL: ${e}`);const f=await s.text();let c={};if(f)try{c=JSON.parse(f)}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:",c),c.error)throw new dD(c,t);throw new Error(`${s.statusText} (${s.status}): ${JSON.stringify(c)}`)}return c}appendExtraHeaders(e){const t=this._logger.create("appendExtraHeaders"),r=Object.keys(this._extraHeaders),n=["authorization","accept","content-type"];0!==r.length&&r.forEach((r=>{if(n.includes(r.toLocaleLowerCase()))return void t.warn("Protected header could not be overridden",r,n);const i="function"==typeof this._extraHeaders[r]?this._extraHeaders[r]():this._extraHeaders[r];i&&""!==i&&(e[r]=i)}))}},bD=class{constructor({prefix:e="oidc.",store:t=localStorage}={}){this._logger=new aD("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 r=0;r<e;r++){const e=await this._store.key(r);e&&0===e.indexOf(this._prefix)&&t.push(e.substr(this._prefix.length))}return t}},gD=class{constructor({authority:e,metadataUrl:t,metadata:r,signingKeys:n,metadataSeed:i,client_id:a,client_secret:o,response_type:s="code",scope:u="openid",redirect_uri:f,post_logout_redirect_uri:c,client_authentication:l="client_secret_post",prompt:d,display:p,max_age:h,ui_locales:m,acr_values:y,resource:b,response_mode:g="query",filterProtocolClaims:v=!0,loadUserInfo:w=!1,staleStateAgeInSeconds:_=900,clockSkewInSeconds:E=300,userInfoJwtIssuer:T="OP",mergeClaims:A=!1,disablePKCE:S=!1,stateStore:k,refreshTokenCredentials:O,revokeTokenAdditionalContentTypes:R,fetchRequestCredentials:x,refreshTokenAllowedScope:I,extraQueryParams:C={},extraTokenParams:N={},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=r,this.metadataSeed=i,this.signingKeys=n,this.client_id=a,this.client_secret=o,this.response_type=s,this.scope=u,this.redirect_uri=f,this.post_logout_redirect_uri=c,this.client_authentication=l,this.prompt=d,this.display=p,this.max_age=h,this.ui_locales=m,this.acr_values=y,this.resource=b,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=!!S,this.revokeTokenAdditionalContentTypes=R,x&&O&&console.warn("Both fetchRequestCredentials and refreshTokenCredentials is set. Only fetchRequestCredentials will be used."),this.fetchRequestCredentials=x||(O||"same-origin"),k)this.stateStore=k;else{const e="undefined"!=typeof window?window.localStorage:new mD;this.stateStore=new bD({store:e})}this.refreshTokenAllowedScope=I,this.extraQueryParams=C,this.extraTokenParams=N,this.extraHeaders=P}},vD=class{constructor(e,t){this._settings=e,this._metadataService=t,this._logger=new aD("TokenClient"),this._jsonService=new yD(this._settings.revokeTokenAdditionalContentTypes,null,this._settings.extraHeaders)}async exchangeCode({grant_type:e="authorization_code",redirect_uri:t=this._settings.redirect_uri,client_id:r=this._settings.client_id,client_secret:n=this._settings.client_secret,...i}){const a=this._logger.create("exchangeCode");r||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(!n)throw a.throw(new Error("A client_secret is required")),null;s=oD.generateBasicAuth(r,n);break;case"client_secret_post":o.append("client_id",r),n&&o.append("client_secret",n)}const u=await this._metadataService.getTokenEndpoint(!1);a.debug("got token endpoint");const f=await this._jsonService.postForm(u,{body:o,basicAuth:s,initCredentials:this._settings.fetchRequestCredentials});return a.debug("got response"),f}async exchangeCredentials({grant_type:e="password",client_id:t=this._settings.client_id,client_secret:r=this._settings.client_secret,scope:n=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:n});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=oD.generateBasicAuth(t,r);break;case"client_secret_post":o.append("client_id",t),r&&o.append("client_secret",r)}const u=await this._metadataService.getTokenEndpoint(!1);a.debug("got token endpoint");const f=await this._jsonService.postForm(u,{body:o,basicAuth:s,initCredentials:this._settings.fetchRequestCredentials});return a.debug("got response"),f}async exchangeRefreshToken({grant_type:e="refresh_token",client_id:t=this._settings.client_id,client_secret:r=this._settings.client_secret,timeoutInSeconds:n,...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(!r)throw a.throw(new Error("A client_secret is required")),null;s=oD.generateBasicAuth(t,r);break;case"client_secret_post":o.append("client_id",t),r&&o.append("client_secret",r)}const u=await this._metadataService.getTokenEndpoint(!1);a.debug("got token endpoint");const f=await this._jsonService.postForm(u,{body:o,basicAuth:s,timeoutInSeconds:n,initCredentials:this._settings.fetchRequestCredentials});return a.debug("got response"),f}async revoke(e){var t;const r=this._logger.create("revoke");e.token||r.throw(new Error("A token is required"));const n=await this._metadataService.getRevocationEndpoint(!1);r.debug(`got revocation endpoint, revoking ${null!=(t=e.token_type_hint)?t:"default token type"}`);const i=new URLSearchParams;for(const[t,r]of Object.entries(e))null!=r&&i.set(t,r);i.set("client_id",this._settings.client_id),this._settings.client_secret&&i.set("client_secret",this._settings.client_secret),await this._jsonService.postForm(n,{body:i}),r.debug("got response")}},wD=class{constructor(e){this.id=e.id||oD.generateUUIDv4(),this.data=e.data,e.created&&e.created>0?this.created=e.created:this.created=cD.getEpochTime(),this.request_type=e.request_type}toStorageString(){return new aD("State").create("toStorageString"),JSON.stringify({id:this.id,data:this.data,created:this.created,request_type:this.request_type})}static fromStorageString(e){return aD.createStatic("State","fromStorageString"),new wD(JSON.parse(e))}static async clearStaleState(e,t){const r=aD.createStatic("State","clearStaleState"),n=cD.getEpochTime()-t,i=await e.getAllKeys();r.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=wD.fromStorageString(o);r.debug("got item from key:",a,e.created),e.created<=n&&(s=!0)}catch(e){r.error("Error parsing state for key:",a,e),s=!0}else r.debug("no item in storage for key:",a),s=!0;s&&(r.debug("removed item for key:",a),e.remove(a))}}},_D=class extends wD{constructor(e){super(e),!0===e.code_verifier?this.code_verifier=oD.generateCodeVerifier():e.code_verifier&&(this.code_verifier=e.code_verifier),this.code_verifier&&(this.code_challenge=oD.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 aD("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){aD.createStatic("SigninState","fromStorageString");const t=JSON.parse(e);return new _D(t)}},ED=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-cD.getEpochTime()}set expires_in(e){"string"==typeof e&&(e=Number(e)),void 0!==e&&e>=0&&(this.expires_at=Math.floor(e)+cD.getEpochTime())}get isOpenId(){var e;return(null==(e=this.scope)?void 0:e.split(" ").includes("openid"))||!!this.id_token}},TD=["nbf","jti","auth_time","nonce","acr","amr","azp","at_hash"],AD=["sub","iss","aud","exp","iat"],SD=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-cD.getEpochTime()}set expires_in(e){void 0!==e&&(this.expires_at=Math.floor(e)+cD.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 aD("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 aD.createStatic("User","fromStorageString"),new SD(JSON.parse(e))}},kD="oidc-client",OD=class{constructor(){this._abort=new sD("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:r,keepOpen:n}=await new Promise(((r,n)=>{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)===kD){try{const r=lD.readParams(o.url,e.response_mode).get("state");if(r||t.warn("no state found in response url"),i.source!==this._window&&r!==e.state)return}catch(e){this._dispose(),n(new Error("Invalid response from window"))}r(o)}};window.addEventListener("message",i,!1),this._disposeHandlers.add((()=>window.removeEventListener("message",i,!1))),this._disposeHandlers.add(this._abort.addHandler((e=>{this._dispose(),n(e)})))}));return t.debug("got response from window"),this._dispose(),n||this.close(),{url:r}}_dispose(){this._logger.create("_dispose");for(const e of this._disposeHandlers)e();this._disposeHandlers.clear()}static _notifyParent(e,t,r=!1,n=window.location.origin){e.postMessage({source:kD,url:t,keepOpen:r},n)}},RD={location:!1,toolbar:!1,height:640},xD="_blank",ID=60,CD=2,ND=10,PD=class extends gD{constructor(e){const{popup_redirect_uri:t=e.redirect_uri,popup_post_logout_redirect_uri:r=e.post_logout_redirect_uri,popupWindowFeatures:n=RD,popupWindowTarget:i=xD,redirectMethod:a="assign",redirectTarget:o="self",iframeNotifyParentOrigin:s=e.iframeNotifyParentOrigin,iframeScriptOrigin:u=e.iframeScriptOrigin,silent_redirect_uri:f=e.redirect_uri,silentRequestTimeoutInSeconds:c=ND,automaticSilentRenew:l=!0,validateSubOnSilentRenew:d=!0,includeIdTokenInSilentRenew:p=!1,monitorSession:h=!1,monitorAnonymousSession:m=!1,checkSessionIntervalInSeconds:y=CD,query_status_response_type:b="code",stopCheckSessionOnError:g=!0,revokeTokenTypes:v=["access_token","refresh_token"],revokeTokensOnSignout:w=!1,includeIdTokenInSilentSignout:_=!1,accessTokenExpiringNotificationTimeInSeconds:E=ID,userStore:T}=e;if(super(e),this.popup_redirect_uri=t,this.popup_post_logout_redirect_uri=r,this.popupWindowFeatures=n,this.popupWindowTarget=i,this.redirectMethod=a,this.redirectTarget=o,this.iframeNotifyParentOrigin=s,this.iframeScriptOrigin=u,this.silent_redirect_uri=f,this.silentRequestTimeoutInSeconds=c,this.automaticSilentRenew=l,this.validateSubOnSilentRenew=d,this.includeIdTokenInSilentRenew=p,this.monitorSession=h,this.monitorAnonymousSession=m,this.checkSessionIntervalInSeconds=y,this.stopCheckSessionOnError=g,this.query_status_response_type=b,this.revokeTokenTypes=v,this.revokeTokensOnSignout=w,this.includeIdTokenInSilentSignout=_,this.accessTokenExpiringNotificationTimeInSeconds=E,T)this.userStore=T;else{const e="undefined"!=typeof window?window.sessionStorage:new mD;this.userStore=new bD({store:e})}}},MD=class extends OD{constructor({silentRequestTimeoutInSeconds:e=ND}){super(),this._logger=new aD("IFrameWindow"),this._timeoutInSeconds=e,this._frame=MD.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 pD("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 r=e.target;null==(t=r.parentNode)||t.removeChild(r),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)}},BD=class extends OD{constructor({popupWindowTarget:e=xD,popupWindowFeatures:t={}}){super(),this._logger=new aD("PopupWindow");const r=fD.center({...RD,...t});this._window=window.open(void 0,e,fD.serialize(r))}async navigate(e){var t;null==(t=this._window)||t.focus();const r=setInterval((()=>{this._window&&!this._window.closed||this._abort.raise(new Error("Popup closed by user"))}),500);return this._disposeHandlers.add((()=>clearInterval(r))),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)}},DD=class extends hD{constructor(e){super({expiringNotificationTimeInSeconds:e.accessTokenExpiringNotificationTimeInSeconds}),this._logger=new aD("UserManagerEvents"),this._userLoaded=new sD("User loaded"),this._userUnloaded=new sD("User unloaded"),this._silentRenewError=new sD("Silent renew error"),this._userSignedIn=new sD("User signed in"),this._userSignedOut=new sD("User signed out"),this._userSessionChanged=new sD("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()}},FD=(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))(FD||{}),LD=(e=>(e.SyncWeb3Method="SYNC_WEB3_METHOD",e.DuplicateIframe="DUPLICATE_IFRAME",e.ReactNativeEndpointConfiguration="REACT_NATIVE_ENDPOINT_CONFIGURATION",e.DeprecationNotice="DEPRECATION_NOTICE",e))(LD||{}),UD=(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))(UD||{}),jD=(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))(jD||{}),qD=(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))(qD||{}),zD=(e=>(e.MAGIC_HANDLE_REQUEST="MAGIC_HANDLE_REQUEST",e))(zD||{}),HD=(e=>(e.Harmony="HARMONY",e))(HD||{}),VD=Object.create,GD=Object.defineProperty,WD=Object.defineProperties,KD=Object.getOwnPropertyDescriptor,XD=Object.getOwnPropertyDescriptors,$D=Object.getOwnPropertyNames,JD=Object.getOwnPropertySymbols,YD=Object.getPrototypeOf,QD=Object.prototype.hasOwnProperty,ZD=Object.prototype.propertyIsEnumerable,eF=(e,t,r)=>t in e?GD(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,tF=(e,t)=>{for(var r in t||(t={}))QD.call(t,r)&&eF(e,r,t[r]);if(JD)for(var r of JD(t))ZD.call(t,r)&&eF(e,r,t[r]);return e},rF=(e,t,r)=>new Promise(((n,i)=>{var a=e=>{try{s(r.next(e))}catch(e){i(e)}},o=e=>{try{s(r.throw(e))}catch(e){i(e)}},s=e=>e.done?n(e.value):Promise.resolve(e.value).then(a,o);s((r=r.apply(e,t)).next())})),nF=((e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports))(((e,t)=>{var r=Object.prototype.hasOwnProperty,n="~";function i(){}function a(e,t,r){this.fn=e,this.context=t,this.once=r||!1}function o(e,t,r,i,o){if("function"!=typeof r)throw new TypeError("The listener must be a function");var s=new a(r,i||e,o),u=n?n+t:t;return e._events[u]?e._events[u].fn?e._events[u]=[e._events[u],s]:e._events[u].push(s):(e._events[u]=s,e._eventsCount++),e}function s(e,t){0==--e._eventsCount?e._events=new i:delete e._events[t]}function u(){this._events=new i,this._eventsCount=0}Object.create&&(i.prototype=Object.create(null),(new i).__proto__||(n=!1)),u.prototype.eventNames=function(){var e,t,i=[];if(0===this._eventsCount)return i;for(t in e=this._events)r.call(e,t)&&i.push(n?t.slice(1):t);return Object.getOwnPropertySymbols?i.concat(Object.getOwnPropertySymbols(e)):i},u.prototype.listeners=function(e){var t=n?n+e:e,r=this._events[t];if(!r)return[];if(r.fn)return[r.fn];for(var i=0,a=r.length,o=new Array(a);i<a;i++)o[i]=r[i].fn;return o},u.prototype.listenerCount=function(e){var t=n?n+e:e,r=this._events[t];return r?r.fn?1:r.length:0},u.prototype.emit=function(e,t,r,i,a,o){var s=n?n+e:e;if(!this._events[s])return!1;var u,f,c=this._events[s],l=arguments.length;if(c.fn){switch(c.once&&this.removeListener(e,c.fn,void 0,!0),l){case 1:return c.fn.call(c.context),!0;case 2:return c.fn.call(c.context,t),!0;case 3:return c.fn.call(c.context,t,r),!0;case 4:return c.fn.call(c.context,t,r,i),!0;case 5:return c.fn.call(c.context,t,r,i,a),!0;case 6:return c.fn.call(c.context,t,r,i,a,o),!0}for(f=1,u=new Array(l-1);f<l;f++)u[f-1]=arguments[f];c.fn.apply(c.context,u)}else{var d,p=c.length;for(f=0;f<p;f++)switch(c[f].once&&this.removeListener(e,c[f].fn,void 0,!0),l){case 1:c[f].fn.call(c[f].context);break;case 2:c[f].fn.call(c[f].context,t);break;case 3:c[f].fn.call(c[f].context,t,r);break;case 4:c[f].fn.call(c[f].context,t,r,i);break;default:if(!u)for(d=1,u=new Array(l-1);d<l;d++)u[d-1]=arguments[d];c[f].fn.apply(c[f].context,u)}}return!0},u.prototype.on=function(e,t,r){return o(this,e,t,r,!1)},u.prototype.once=function(e,t,r){return o(this,e,t,r,!0)},u.prototype.removeListener=function(e,t,r,i){var a=n?n+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)&&(!r||o.context===r)&&s(this,a);else{for(var u=0,f=[],c=o.length;u<c;u++)(o[u].fn!==t||i&&!o[u].once||r&&o[u].context!==r)&&f.push(o[u]);f.length?this._events[a]=1===f.length?f[0]:f:s(this,a)}return this},u.prototype.removeAllListeners=function(e){var t;return e?(t=n?n+e:e,this._events[t]&&s(this,t)):(this._events=new i,this._eventsCount=0),this},u.prototype.off=u.prototype.removeListener,u.prototype.addListener=u.prototype.on,u.prefixed=n,u.EventEmitter=u,typeof t<"u"&&(t.exports=u)}));var iF={SEMVER_SPEC_VERSION:"2.0.0",MAX_LENGTH:256,MAX_SAFE_INTEGER:Number.MAX_SAFE_INTEGER||9007199254740991,MAX_SAFE_COMPONENT_LENGTH:16},aF="object"==typeof process&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...e)=>console.error("SEMVER",...e):()=>{},oF=aF,sF=function(e){let t={exports:{}};return e(t,t.exports),t.exports}((function(e,t){let{MAX_SAFE_COMPONENT_LENGTH:r}=iF,n=(t=e.exports={}).re=[],i=t.src=[],a=t.t={},o=0,s=(e,t,r)=>{let s=o++;oF(s,t),a[e]=s,i[s]=t,n[s]=new RegExp(t,r?"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,${r}})(?:\\.(\\d{1,${r}}))?(?:\\.(\\d{1,${r}}))?(?:$|[^\\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*$")})),uF=/^[0-9]+$/,fF=(e,t)=>{let r=uF.test(e),n=uF.test(t);return r&&n&&(e=+e,t=+t),e===t?0:r&&!n?-1:n&&!r?1:e<t?-1:1},cF={compareIdentifiers:fF,rcompareIdentifiers:(e,t)=>fF(t,e)},{MAX_LENGTH:lF,MAX_SAFE_INTEGER:dF}=iF,{re:pF,t:hF}=sF,{compareIdentifiers:mF}=cF,yF=class{constructor(e,t){if(t&&"object"==typeof t||(t={loose:!!t,includePrerelease:!1}),e instanceof yF){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>lF)throw new TypeError(`version is longer than ${lF} characters`);oF("SemVer",e,t),this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease;let r=e.trim().match(t.loose?pF[hF.LOOSE]:pF[hF.FULL]);if(!r)throw new TypeError(`Invalid Version: ${e}`);if(this.raw=e,this.major=+r[1],this.minor=+r[2],this.patch=+r[3],this.major>dF||this.major<0)throw new TypeError("Invalid major version");if(this.minor>dF||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>dF||this.patch<0)throw new TypeError("Invalid patch version");r[4]?this.prerelease=r[4].split(".").map((e=>{if(/^[0-9]+$/.test(e)){let t=+e;if(t>=0&&t<dF)return t}return e})):this.prerelease=[],this.build=r[5]?r[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(e){if(oF("SemVer.compare",this.version,this.options,e),!(e instanceof yF)){if("string"==typeof e&&e===this.version)return 0;e=new yF(e,this.options)}return e.version===this.version?0:this.compareMain(e)||this.comparePre(e)}compareMain(e){return e instanceof yF||(e=new yF(e,this.options)),mF(this.major,e.major)||mF(this.minor,e.minor)||mF(this.patch,e.patch)}comparePre(e){if(e instanceof yF||(e=new yF(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 r=this.prerelease[t],n=e.prerelease[t];if(oF("prerelease compare",t,r,n),void 0===r&&void 0===n)return 0;if(void 0===n)return 1;if(void 0===r)return-1;if(r!==n)return mF(r,n)}while(++t)}compareBuild(e){e instanceof yF||(e=new yF(e,this.options));let t=0;do{let r=this.build[t],n=e.build[t];if(oF("prerelease compare",t,r,n),void 0===r&&void 0===n)return 0;if(void 0===n)return 1;if(void 0===r)return-1;if(r!==n)return mF(r,n)}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}},bF=(e,t,r)=>new yF(e,r).compare(new yF(t,r)),gF=(e,t,r)=>0===bF(e,t,r),vF=(e,t,r)=>0!==bF(e,t,r),wF=(e,t,r)=>bF(e,t,r)>0,_F=(e,t,r)=>bF(e,t,r)>=0,EF=(e,t,r)=>bF(e,t,r)<0,TF=(e,t,r)=>bF(e,t,r)<=0,AF=(e,t,r,n)=>{switch(t){case"===":return"object"==typeof e&&(e=e.version),"object"==typeof r&&(r=r.version),e===r;case"!==":return"object"==typeof e&&(e=e.version),"object"==typeof r&&(r=r.version),e!==r;case"":case"=":case"==":return gF(e,r,n);case"!=":return vF(e,r,n);case">":return wF(e,r,n);case">=":return _F(e,r,n);case"<":return EF(e,r,n);case"<=":return TF(e,r,n);default:throw new TypeError(`Invalid operator: ${t}`)}},SF=Symbol("SemVer ANY"),kF=class{static get ANY(){return SF}constructor(e,t){if(t&&"object"==typeof t||(t={loose:!!t,includePrerelease:!1}),e instanceof kF){if(e.loose===!!t.loose)return e;e=e.value}oF("comparator",e,t),this.options=t,this.loose=!!t.loose,this.parse(e),this.semver===SF?this.value="":this.value=this.operator+this.semver.version,oF("comp",this)}parse(e){let t=this.options.loose?OF[RF.COMPARATORLOOSE]:OF[RF.COMPARATOR],r=e.match(t);if(!r)throw new TypeError(`Invalid comparator: ${e}`);this.operator=void 0!==r[1]?r[1]:"","="===this.operator&&(this.operator=""),r[2]?this.semver=new yF(r[2],this.options.loose):this.semver=SF}toString(){return this.value}test(e){if(oF("Comparator.test",e,this.options.loose),this.semver===SF||e===SF)return!0;if("string"==typeof e)try{e=new yF(e,this.options)}catch(e){return!1}return AF(e,this.operator,this.semver,this.options)}intersects(e,t){if(!(e instanceof kF))throw new TypeError("a Comparator is required");if(t&&"object"==typeof t||(t={loose:!!t,includePrerelease:!1}),""===this.operator)return""===this.value||new xF(e.value,t).test(this.value);if(""===e.operator)return""===e.value||new xF(this.value,t).test(e.semver);let r=!(">="!==this.operator&&">"!==this.operator||">="!==e.operator&&">"!==e.operator),n=!("<="!==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=AF(this.semver,"<",e.semver,t)&&(">="===this.operator||">"===this.operator)&&("<="===e.operator||"<"===e.operator),s=AF(this.semver,">",e.semver,t)&&("<="===this.operator||"<"===this.operator)&&(">="===e.operator||">"===e.operator);return r||n||i&&a||o||s}},{re:OF,t:RF}=sF,xF=class{constructor(e,t){if(t&&"object"==typeof t||(t={loose:!!t,includePrerelease:!1}),e instanceof xF)return e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease?e:new xF(e.raw,t);if(e instanceof kF)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 r=t?IF[CF.HYPHENRANGELOOSE]:IF[CF.HYPHENRANGE];e=e.replace(r,WF(this.options.includePrerelease)),oF("hyphen replace",e),e=e.replace(IF[CF.COMPARATORTRIM],NF),oF("comparator trim",e,IF[CF.COMPARATORTRIM]),e=(e=(e=e.replace(IF[CF.TILDETRIM],PF)).replace(IF[CF.CARETTRIM],MF)).split(/\s+/).join(" ");let n=t?IF[CF.COMPARATORLOOSE]:IF[CF.COMPARATOR];return e.split(" ").map((e=>DF(e,this.options))).join(" ").split(/\s+/).map((e=>GF(e,this.options))).filter(this.options.loose?e=>!!e.match(n):()=>!0).map((e=>new kF(e,this.options)))}intersects(e,t){if(!(e instanceof xF))throw new TypeError("a Range is required");return this.set.some((r=>BF(r,t)&&e.set.some((e=>BF(e,t)&&r.every((r=>e.every((e=>r.intersects(e,t)))))))))}test(e){if(!e)return!1;if("string"==typeof e)try{e=new yF(e,this.options)}catch(e){return!1}for(let t=0;t<this.set.length;t++)if(KF(this.set[t],e,this.options))return!0;return!1}},{re:IF,t:CF,comparatorTrimReplace:NF,tildeTrimReplace:PF,caretTrimReplace:MF}=sF,BF=(e,t)=>{let r=!0,n=e.slice(),i=n.pop();for(;r&&n.length;)r=n.every((e=>i.intersects(e,t))),i=n.pop();return r},DF=(e,t)=>(oF("comp",e,t),e=jF(e,t),oF("caret",e),e=LF(e,t),oF("tildes",e),e=zF(e,t),oF("xrange",e),e=VF(e,t),oF("stars",e),e),FF=e=>!e||"x"===e.toLowerCase()||"*"===e,LF=(e,t)=>e.trim().split(/\s+/).map((e=>UF(e,t))).join(" "),UF=(e,t)=>{let r=t.loose?IF[CF.TILDELOOSE]:IF[CF.TILDE];return e.replace(r,((t,r,n,i,a)=>{let o;return oF("tilde",e,t,r,n,i,a),FF(r)?o="":FF(n)?o=`>=${r}.0.0 <${+r+1}.0.0-0`:FF(i)?o=`>=${r}.${n}.0 <${r}.${+n+1}.0-0`:a?(oF("replaceTilde pr",a),o=`>=${r}.${n}.${i}-${a} <${r}.${+n+1}.0-0`):o=`>=${r}.${n}.${i} <${r}.${+n+1}.0-0`,oF("tilde return",o),o}))},jF=(e,t)=>e.trim().split(/\s+/).map((e=>qF(e,t))).join(" "),qF=(e,t)=>{oF("caret",e,t);let r=t.loose?IF[CF.CARETLOOSE]:IF[CF.CARET],n=t.includePrerelease?"-0":"";return e.replace(r,((t,r,i,a,o)=>{let s;return oF("caret",e,t,r,i,a,o),FF(r)?s="":FF(i)?s=`>=${r}.0.0${n} <${+r+1}.0.0-0`:FF(a)?s="0"===r?`>=${r}.${i}.0${n} <${r}.${+i+1}.0-0`:`>=${r}.${i}.0${n} <${+r+1}.0.0-0`:o?(oF("replaceCaret pr",o),s="0"===r?"0"===i?`>=${r}.${i}.${a}-${o} <${r}.${i}.${+a+1}-0`:`>=${r}.${i}.${a}-${o} <${r}.${+i+1}.0-0`:`>=${r}.${i}.${a}-${o} <${+r+1}.0.0-0`):(oF("no pr"),s="0"===r?"0"===i?`>=${r}.${i}.${a}${n} <${r}.${i}.${+a+1}-0`:`>=${r}.${i}.${a}${n} <${r}.${+i+1}.0-0`:`>=${r}.${i}.${a} <${+r+1}.0.0-0`),oF("caret return",s),s}))},zF=(e,t)=>(oF("replaceXRanges",e,t),e.split(/\s+/).map((e=>HF(e,t))).join(" ")),HF=(e,t)=>{e=e.trim();let r=t.loose?IF[CF.XRANGELOOSE]:IF[CF.XRANGE];return e.replace(r,((r,n,i,a,o,s)=>{oF("xRange",e,r,n,i,a,o,s);let u=FF(i),f=u||FF(a),c=f||FF(o),l=c;return"="===n&&l&&(n=""),s=t.includePrerelease?"-0":"",u?r=">"===n||"<"===n?"<0.0.0-0":"*":n&&l?(f&&(a=0),o=0,">"===n?(n=">=",f?(i=+i+1,a=0,o=0):(a=+a+1,o=0)):"<="===n&&(n="<",f?i=+i+1:a=+a+1),"<"===n&&(s="-0"),r=`${n+i}.${a}.${o}${s}`):f?r=`>=${i}.0.0${s} <${+i+1}.0.0-0`:c&&(r=`>=${i}.${a}.0${s} <${i}.${+a+1}.0-0`),oF("xRange return",r),r}))},VF=(e,t)=>(oF("replaceStars",e,t),e.trim().replace(IF[CF.STAR],"")),GF=(e,t)=>(oF("replaceGTE0",e,t),e.trim().replace(IF[t.includePrerelease?CF.GTE0PRE:CF.GTE0],"")),WF=e=>(t,r,n,i,a,o,s,u,f,c,l,d,p)=>`${r=FF(n)?"":FF(i)?`>=${n}.0.0${e?"-0":""}`:FF(a)?`>=${n}.${i}.0${e?"-0":""}`:o?`>=${r}`:`>=${r}${e?"-0":""}`} ${u=FF(f)?"":FF(c)?`<${+f+1}.0.0-0`:FF(l)?`<${f}.${+c+1}.0-0`:d?`<=${f}.${c}.${l}-${d}`:e?`<${f}.${c}.${+l+1}-0`:`<=${u}`}`.trim(),KF=(e,t,r)=>{for(let r=0;r<e.length;r++)if(!e[r].test(t))return!1;if(t.prerelease.length&&!r.includePrerelease){for(let r=0;r<e.length;r++)if(oF(e[r].semver),e[r].semver!==kF.ANY&&e[r].semver.prerelease.length>0){let n=e[r].semver;if(n.major===t.major&&n.minor===t.minor&&n.patch===t.patch)return!0}return!1}return!0},XF=(e,t,r)=>{try{t=new xF(t,r)}catch(e){return!1}return t.test(e)},{MAX_LENGTH:$F}=iF,{re:JF,t:YF}=sF,QF=(e,t)=>{if(t&&"object"==typeof t||(t={loose:!!t,includePrerelease:!1}),e instanceof yF)return e;if("string"!=typeof e||e.length>$F||!(t.loose?JF[YF.LOOSE]:JF[YF.FULL]).test(e))return null;try{return new yF(e,t)}catch(e){return null}},{re:ZF,t:eL}=sF,tL=(e,t)=>{if(e instanceof yF)return e;if("number"==typeof e&&(e=String(e)),"string"!=typeof e)return null;let r=null;if((t=t||{}).rtl){let t;for(;(t=ZF[eL.COERCERTL].exec(e))&&(!r||r.index+r[0].length!==e.length);)r&&t.index+t[0].length===r.index+r[0].length||(r=t),ZF[eL.COERCERTL].lastIndex=t.index+t[1].length+t[2].length;ZF[eL.COERCERTL].lastIndex=-1}else r=e.match(ZF[eL.COERCE]);return null===r?null:QF(`${r[2]}.${r[3]||"0"}.${r[4]||"0"}`,t)};function rL(e){return String.fromCharCode(parseInt(e.slice(1),16))}function nL(e){return`%${`00${e.charCodeAt(0).toString(16)}`.slice(-2)}`}function iL(e){return function(e){return btoa(encodeURIComponent(e).replace(/%[0-9A-F]{2}/g,rL))}(JSON.stringify(e))}function aL(e){return JSON.parse(function(e){return decodeURIComponent(Array.from(atob(e),nL).join(""))}(e))}function oL(e){return void 0===e}function sL(e){return function(e){return null===e}(e)||oL(e)}function uL(e){if(!e)return!0;for(let t in e)if(Object.hasOwnProperty.call(e,t))return!1;return!0}var fL={};var cL={"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"},lL=class extends Error{constructor(e,t){super(`Magic SDK Error: [${e}] ${t}`),this.code=e,this.rawMessage=t,this.__proto__=Error,Object.setPrototypeOf(this,lL.prototype)}},dL=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!sL(e)&&"number"==typeof e&&Object.values(UD).includes(e)}(t)?t:UD.InternalError,this.message=`Magic RPC Error: [${this.code}] ${this.rawMessage}`,this.data=(null==e?void 0:e.data)||void 0,Object.setPrototypeOf(this,dL.prototype)}},pL=class{constructor(e,t){this.code=e,this.rawMessage=t,this.message=`Magic SDK Warning: [${e}] ${t}`}log(){console.warn(this.message)}},hL=class extends Error{constructor(e,t,r,n){super(`Magic Extension Error (${e.name}): [${t}] ${r}`),this.code=t,this.rawMessage=r,this.data=n,this.__proto__=Error,Object.setPrototypeOf(this,hL.prototype)}},mL=class{constructor(e,t,r){this.code=t,this.rawMessage=r,this.message=`Magic Extension Warning (${e.name}): [${t}] ${r}`}log(){console.warn(this.message)}};function yL(){return new lL(FD.MissingApiKey,"Please provide an API key that you acquired from the Magic developer dashboard.")}function bL(){return new lL(FD.MalformedResponse,"Response from the Magic iframe is malformed.")}function gL(e){return new lL(FD.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 vL(e){let t=`Some extensions are incompatible with \`${fL.sdkName}@${fL.version}\`:`;return e.filter((e=>void 0!==e.compat&&null!==e.compat)).forEach((e=>{let r=e.compat[fL.sdkName];"string"==typeof r?t+=`\n - Extension \`${e.name}\` supports version(s) \`${r}\``:r||(t+=`\n - Extension \`${e.name}\` does not support ${fL.platform} environments.`)})),new lL(FD.IncompatibleExtensions,t)}function wL(e){return new lL(FD.InvalidArgument,`Invalid ${(e=>{let t=e+1,r=t%10,n=t%100;return 1===r&&11!==n?`${t}st`:2===r&&12!==n?`${t}nd`:3===r&&13!==n?`${t}rd`:`${t}th`})(e.argument)} argument given to \`${e.procedure}\`.\n Expected: \`${e.expected}\`\n Received: \`${e.received}\``)}function _L(){return new pL(LD.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 \`${fL.defaultEndpoint}\`. Changing this default behavior will lead to unexpected results and potentially security-threatening bugs.`)}var EL=function*(){let e=0;for(;;)e<Number.MAX_SAFE_INTEGER?yield++e:e=0}();function TL(){return EL.next().value}var AL=Symbol("Payload pre-processed by Magic SDK");function SL(e){return Object.defineProperty(e,AL,{value:!0,enumerable:!1}),e}function kL(e){var t,r,n;return function(e){return!!e[AL]}(e)||(e.jsonrpc=null!=(t=e.jsonrpc)?t:"2.0",e.id=TL(),e.method=null!=(r=e.method)?r:"noop",e.params=null!=(n=e.params)?n:[],SL(e)),e}function OL(e,t=[]){return SL({params:t,method:e,jsonrpc:"2.0",id:TL()})}var RL=class{constructor(e){e instanceof RL?(this._jsonrpc=e.payload.jsonrpc,this._id=e.payload.id,this._result=e.payload.result,this._error=e.payload.error):function(e){return!sL(e)&&!(oL(e.jsonrpc)||oL(e.id)||oL(e.result)&&oL(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}}},xL=((e,t,r)=>(r=null!=e?VD(YD(e)):{},((e,t,r,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let i of $D(t))!QD.call(e,i)&&i!==r&&GD(e,i,{get:()=>t[i],enumerable:!(n=KD(t,i))||n.enumerable});return e})(!t&&e&&e.__esModule?r:GD(r,"default",{value:e,enumerable:!0}),e)))(nF()),IL=class extends xL.default{};function CL(){let e=new IL;return{emitter:e,createChainingEmitterMethod:(t,r)=>(...n)=>(e[t].apply(e,n),r),createBoundEmitterMethod:t=>(...r)=>e[t].apply(e,r)}}var NL=Symbol("isPromiEvent");function PL(e){return!!e[NL]}function ML(e){let t=BL(e),{createBoundEmitterMethod:r,createChainingEmitterMethod:n}=CL(),i=Symbol("Promise.then"),a=Symbol("Promise.catch"),o=Symbol("Promise.finally"),s=(e,t)=>(...r)=>{let n=t[e].apply(t,r);return u(n)},u=e=>Object.assign(e,{[NL]:!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:n("on",e),once:n("once",e),addListener:n("addListener",e),off:n("off",e),removeListener:n("removeListener",e),removeAllListeners:n("removeAllListeners",e),emit:r("emit"),eventNames:r("eventNames"),listeners:r("listeners"),listenerCount:r("listenerCount")}),f=u(t.then((e=>(f.emit("done",e),f.emit("settled"),e)),(e=>{throw f.emit("error",e),f.emit("settled"),e})));return f}function BL(e){return new Promise(((t,r)=>{let n=e(t,r);Promise.resolve(n).catch(r)}))}var DL,FL=class{constructor(e){this.sdk=e}get overlay(){return this.sdk.overlay}request(e){let t=this.overlay.post(zD.MAGIC_HANDLE_REQUEST,kL(e)),r=ML(((e,r)=>{t.then((t=>{if(n(),t.hasError)r(new dL(t.payload.error));else{if(!t.hasResult)throw bL();e(t.payload.result)}})).catch((e=>{n(),r(e)}))})),n=this.overlay.on(qD.MAGIC_HANDLE_EVENT,(t=>{var n;let{response:i}=t.data;if(i.id===e.id&&(null==(n=i.result)?void 0:n.event)){let{event:e,params:t=[]}=i.result;r.emit(e,...t)}}));return r}createIntermediaryEvent(e,t){return r=>{let n=OL(jD.IntermediaryEvent,[{payloadId:t,eventType:e,args:r}]);this.request(n)}}},LL=class extends FL{loginWithMagicLink(e){let{email:t,showUI:r=!0,redirectURI:n}=e,i=OL(this.sdk.testMode?jD.LoginWithMagicLinkTestMode:jD.LoginWithMagicLink,[{email:t,showUI:r,redirectURI:n}]);return this.request(i)}loginWithSMS(e){let{phoneNumber:t}=e,r=OL(this.sdk.testMode?jD.LoginWithSmsTestMode:jD.LoginWithSms,[{phoneNumber:t,showUI:!0}]);return this.request(r)}loginWithEmailOTP(e){let{email:t,showUI:r}=e,n=OL(this.sdk.testMode?jD.LoginWithEmailOTPTestMode:jD.LoginWithEmailOTP,[{email:t,showUI:r}]);if(!r){let e=this.request(n);return e&&e.on("otp-input-sent",(e=>{this.createIntermediaryEvent("verify-email-otp",n.id)(e)})),e}return this.request(n)}loginWithCredential(e){let t=null!=e?e:"";if(!e&&"web"===fL.platform){t=window.location.search;let e=window.location.origin+window.location.pathname;window.history.replaceState(null,"",e)}let r=OL(this.sdk.testMode?jD.LoginWithCredentialTestMode:jD.LoginWithCredential,[t]);return this.request(r)}},UL={};function jL(e){return(...t)=>rF(this,null,(function*(){return DL||(DL=yield fL.configureStorage()),yield DL.ready(),DL[e](...t)}))}((e,t)=>{for(var r in t)GD(e,r,{get:t[r],enumerable:!0})})(UL,{clear:()=>VL,getItem:()=>qL,iterate:()=>XL,key:()=>WL,keys:()=>KL,length:()=>GL,removeItem:()=>HL,setItem:()=>zL});var qL=jL("getItem"),zL=jL("setItem"),HL=jL("removeItem"),VL=jL("clear"),GL=jL("length"),WL=jL("key"),KL=jL("keys"),XL=jL("iterate");function $L(){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 JL="STORE_KEY_PRIVATE_KEY",YL="STORE_KEY_PUBLIC_JWK",QL="ECDSA",ZL="P-256",eU={name:QL,namedCurve:ZL},tU={name:QL,namedCurve:ZL};function rU(){HL(YL),HL(JL)}function nU(){return rF(this,null,(function*(){let e=yield function(){return rF(this,null,(function*(){if(function(){let e="undefined"!=typeof window&&!!window.crypto,t=e&&!!window.crypto.subtle;return e&&t}())return(yield qL(YL))||(yield function(){return rF(this,null,(function*(){let e=null,{subtle:t}=window.crypto,r=yield t.generateKey(eU,!0,["sign"]),n=yield t.exportKey("jwk",r.privateKey);e=yield t.exportKey("jwk",r.publicKey);let i=yield t.importKey("jwk",n,tU,!1,["sign"]);yield zL(JL,i),yield zL(YL,e)}))}()),qL(YL);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,r=yield qL(JL);if(!r||!t)return void console.info("unable to find private key or webcrypto unsupported");let n={iat:Math.floor((new Date).getTime()/1e3),jti:$L()},i={typ:"dpop+jwt",alg:"ES256",jwk:e},a=iU(JSON.stringify(i)),o=iU(JSON.stringify(n)),s=function(e){return(new TextEncoder).encode(e)}(`${a}.${o}`),u={name:QL,hash:{name:"SHA-256"}},f=function(e){let t="";return e.forEach((e=>{t+=String.fromCharCode(e)})),aU(t)}(new Uint8Array(yield t.sign(u,r,s)));return`${a}.${o}.${f}`}))}function iU(e){return aU(function(e){return encodeURIComponent(e).replace(/%([0-9A-F]{2})/g,((e,t)=>String.fromCharCode(parseInt(t,16))))}(e))}function aU(e){return btoa(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+/g,"")}var oU=class extends FL{getIdToken(e){let t=OL(this.sdk.testMode?jD.GetIdTokenTestMode:jD.GetIdToken,[e]);return this.request(t)}generateIdToken(e){let t=OL(this.sdk.testMode?jD.GenerateIdTokenTestMode:jD.GenerateIdToken,[e]);return this.request(t)}getMetadata(){let e=OL(this.sdk.testMode?jD.GetMetadataTestMode:jD.GetMetadata);return this.request(e)}updateEmail(e){let{email:t,showUI:r=!0}=e,n=OL(this.sdk.testMode?jD.UpdateEmailTestMode:jD.UpdateEmail,[{email:t,showUI:r}]);return this.request(n)}isLoggedIn(){let e=OL(this.sdk.testMode?jD.IsLoggedInTestMode:jD.IsLoggedIn);return this.request(e)}logout(){rU();let e=OL(this.sdk.testMode?jD.LogoutTestMode:jD.Logout);return this.request(e)}showSettings(){let e=OL(this.sdk.testMode?jD.UserSettingsTestMode:jD.UserSettings);return this.request(e)}updatePhoneNumber(){let e=OL(this.sdk.testMode?jD.UpdatePhoneNumberTestMode:jD.UpdatePhoneNumber);return this.request(e)}recoverAccount(e){let t=OL(this.sdk.testMode?jD.RecoverAccountTestMode:jD.RecoverAccount,[e]);return this.request(t)}},sU=class extends FL{connectWithUI(){let e=OL(jD.RequestAccounts);return this.request(e)}showUI(){let e=OL(jD.ShowUI);return this.request(e)}getInfo(){let e=OL(jD.GetInfo);return this.request(e)}requestUserInfoWithUI(e){let t=OL(jD.RequestUserInfoWithUI,e?[e]:[]);return this.request(t)}disconnect(){rU();let e=OL(jD.Disconnect);return this.request(e)}},{createBoundEmitterMethod:uU,createChainingEmitterMethod:fU}=CL(),cU=class extends FL{constructor(){super(...arguments),this.isMagic=!0,this.on=fU("on",this),this.once=fU("once",this),this.addListener=fU("addListener",this),this.off=fU("off",this),this.removeListener=fU("removeListener",this),this.removeAllListeners=fU("removeAllListeners",this),this.emit=uU("emit"),this.eventNames=uU("eventNames"),this.listeners=uU("listeners"),this.listenerCount=uU("listenerCount")}sendAsync(e,t){if(!t)throw wL({procedure:"Magic.rpcProvider.sendAsync",argument:1,expected:"function",received:null===t?"null":typeof t});if(Array.isArray(e))this.overlay.post(zD.MAGIC_HANDLE_REQUEST,e.map((e=>{let t=kL(e);return this.prefixPayloadMethodForTestMode(t),t}))).then((e=>{t(null,e.map((e=>((e,t)=>WD(e,XD(t)))(tF({},e.payload),{error:e.hasError?new dL(e.payload.error):null}))))}));else{let r=kL(e);this.prefixPayloadMethodForTestMode(r),this.overlay.post(zD.MAGIC_HANDLE_REQUEST,r).then((e=>{t(e.hasError?new dL(e.payload.error):null,e.payload)}))}}send(e,t){if("string"==typeof e){let r=OL(e,Array.isArray(t)?t:[]);return this.request(r)}if(Array.isArray(e)||t)return void this.sendAsync(e,t);let r=new pL(LD.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 r.log(),new RL(e).applyError({code:-32603,message:r.rawMessage}).payload}enable(){let e=OL("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 lU(e,t){return t?new URL(e,t):new URL(e)}var dU=["request","overlay","sdk"];function pU(e){let t=Object.getPrototypeOf(e),r=[t];for(;t!==FL.prototype;)t=Object.getPrototypeOf(t),r.push(t);return r}var hU=class extends FL{constructor(){super(void 0),this.__sdk_access_field_descriptors__=new Map,this.__is_initialized__=!1,this.utils={createPromiEvent:ML,isPromiEvent:PL,encodeJSON:iL,decodeJSON:aL,createJsonRpcRequestPayload:OL,standardizeJsonRpcRequestPayload:kL,storage:UL};let e=[this,...pU(this)];dU.forEach((t=>{let r=e.map((e=>Object.getOwnPropertyDescriptor(e,t))),n=r.findIndex((e=>!!e)),i=n>0,a=r[n];a&&(this.__sdk_access_field_descriptors__.set(t,{descriptor:a,isPrototypeField:i}),Object.defineProperty(this,t,{configurable:!0,get:()=>{throw gL(t)}}))}))}init(e){this.__is_initialized__||(dU.forEach((e=>{if(this.__sdk_access_field_descriptors__.has(e)){let{descriptor:t,isPrototypeField:r}=this.__sdk_access_field_descriptors__.get(e);r?delete this[e]:Object.defineProperty(this,e,t)}})),this.sdk=e,this.__is_initialized__=!0)}createDeprecationWarning(e){let{method:t,removalVersion:r,useInstead:n}=e;return new mL(this,"DEPRECATION_NOTICE",`\`${t}\` will be removed from this Extension in version \`${r}\`.${n?` Use \`${n}\` instead.`:""}`)}createWarning(e,t){return new mL(this,e,t)}createError(e,t,r){return new hL(this,e,t,r)}},mU=class extends hU{};mU.Internal=class extends hU{},mU.Anonymous="anonymous extension";var yU=class extends FL{purchase(e){let t=OL(jD.NFTPurchase,[e]);return this.request(t)}};function bU(e){return!e.compat||null==e.compat[fL.sdkName]||("string"==typeof e.compat[fL.sdkName]?XF(tL(fL.version),e.compat[fL.sdkName]):!!e.compat[fL.sdkName])}function gU(e){var t;let r=null!=(t=null==e?void 0:e.extensions)?t:[],n={},i=[];if(Array.isArray(r)?r.forEach((e=>{bU(e)?(e.init(this),(e.name||e.name!==mU.Anonymous)&&(this[e.name]=e),e instanceof mU.Internal&&(uL(e.config)||(n[e.name]=e.config))):i.push(e)})):Object.keys(r).forEach((e=>{if(bU(r[e])){r[e].init(this);let t=r[e];this[e]=t,t instanceof mU.Internal&&(uL(t.config)||(n[r[e].name]=t.config))}else i.push(r[e])})),i.length)throw vL(i);return n}var vU=class{constructor(e,t){var r;if(this.apiKey=e,!e)throw yL();"react-native"===fL.platform&&(null==t?void 0:t.endpoint)&&_L().log();let{defaultEndpoint:n,version:i}=fL;this.testMode=!(null==t||!t.testMode),this.endpoint=lU(null!=(r=null==t?void 0:t.endpoint)?r:n).origin,this.auth=new LL(this),this.user=new oU(this),this.wallet=new sU(this),this.nft=new yU(this),this.rpcProvider=new cU(this);let a=gU.call(this,t);this.parameters=iL(tF({API_KEY:this.apiKey,DOMAIN_ORIGIN:window.location?window.location.origin:"",ETH_NETWORK:null==t?void 0:t.network,host:lU(this.endpoint).host,sdk:cL[fL.sdkName],version:i,ext:uL(a)?void 0:a,locale:(null==t?void 0:t.locale)||"en_US"},fL.bundleId?{bundleId:fL.bundleId}:{}))}get overlay(){if(!vU.__overlays__.has(this.parameters)){let e=new fL.ViewController(this.endpoint,this.parameters);e.init(),vU.__overlays__.set(this.parameters,e)}return vU.__overlays__.get(this.parameters)}preload(){return rF(this,null,(function*(){yield this.overlay.ready}))}},wU=vU;function _U(e,t){var r;let n=null==(r=t.data.response)?void 0:r.id,i=function(e,t){return t&&Array.isArray(e)?e.find((e=>e.id===t)):e}(e,n);if(n&&i){return{id:n,response:new RL(i).applyResult(t.data.response.result).applyError(t.data.response.error)}}return{}}wU.__overlays__=new Map;var EU=class{constructor(e,t){this.endpoint=e,this.parameters=t,this.messageHandlers=new Set,this.ready=this.waitForReady(),this.listen()}post(e,t){return rF(this,null,(function*(){return BL((r=>rF(this,null,(function*(){yield this.ready;let n=[],i=Array.isArray(t)?t.map((e=>e.id)):[],a=yield function(e,t){return rF(this,null,(function*(){let r,n=yield qL("rt");if("web"===fL.platform)try{r=yield nU()}catch(e){console.error("webcrypto error",e)}return r?n?{msgType:e,payload:t,jwt:r,rt:n}:{msgType:e,payload:t,jwt:r}:{msgType:e,payload:t}}))}(`${e}-${this.parameters}`,t);yield this._post(a);let o=this.on(qD.MAGIC_HANDLE_RESPONSE,(e=>a=>{let{id:o,response:s}=_U(t,a);(function(e){rF(this,null,(function*(){!e.data.rt||(yield zL("rt",e.data.rt))}))})(a),o&&s&&Array.isArray(t)&&i.includes(o)?(n.push(s),n.length===t.length&&(e(),r(n))):o&&s&&!Array.isArray(t)&&o===t.id&&(e(),r(s))})((()=>o())))}))))}))}on(e,t){let r=t.bind(window),n=t=>{t.data.msgType===`${e}-${this.parameters}`&&r(t)};return this.messageHandlers.add(n),()=>this.messageHandlers.delete(n)}waitForReady(){return new Promise((e=>{this.on(qD.MAGIC_OVERLAY_READY,(()=>e()))}))}listen(){this.on(qD.MAGIC_HIDE_OVERLAY,(()=>{this.hideOverlay()})),this.on(qD.MAGIC_SHOW_OVERLAY,(()=>{this.showOverlay()}))}},TU=Object.create,AU=Object.defineProperty,SU=Object.getOwnPropertyDescriptor,kU=Object.getOwnPropertyNames,OU=Object.getPrototypeOf,RU=Object.prototype.hasOwnProperty,xU=(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')})),IU=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),CU=(e,t,r)=>(r=null!=e?TU(OU(e)):{},((e,t,r,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let i of kU(t))!RU.call(e,i)&&i!==r&&AU(e,i,{get:()=>t[i],enumerable:!(n=SU(t,i))||n.enumerable});return e})(!t&&e&&e.__esModule?r:AU(r,"default",{value:e,enumerable:!0}),e)),NU=(e,t,r)=>new Promise(((n,i)=>{var a=e=>{try{s(r.next(e))}catch(e){i(e)}},o=e=>{try{s(r.throw(e))}catch(e){i(e)}},s=e=>e.done?n(e.value):Promise.resolve(e.value).then(a,o);s((r=r.apply(e,t)).next())})),PU=IU(((e,t)=>{!function(r){if("object"==typeof e&&typeof t<"u")t.exports=r();else if("function"==typeof define&&define.amd)define([],r);else{(typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:this).localforage=r()}}((function(){return function e(t,r,n){function i(o,s){if(!r[o]){if(!t[o]){var u="function"==typeof xU&&xU;if(!s&&u)return u(o,!0);if(a)return a(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var c=r[o]={exports:{}};t[o][0].call(c.exports,(function(e){return i(t[o][1][e]||e)}),c,c.exports,e,t,r,n)}return r[o].exports}for(var a="function"==typeof xU&&xU,o=0;o<n.length;o++)i(n[o]);return i}({1:[function(e,t,r){(function(e){var r,n=e.MutationObserver||e.WebKitMutationObserver;if(n){var i=0,a=new n(c),o=e.document.createTextNode("");a.observe(o,{characterData:!0}),r=function(){o.data=i=++i%2}}else if(!e.setImmediate&&typeof e.MessageChannel<"u"){var s=new e.MessageChannel;s.port1.onmessage=c,r=function(){s.port2.postMessage(0)}}else r="document"in e&&"onreadystatechange"in e.document.createElement("script")?function(){var t=e.document.createElement("script");t.onreadystatechange=function(){c(),t.onreadystatechange=null,t.parentNode.removeChild(t),t=null},e.document.documentElement.appendChild(t)}:function(){setTimeout(c,0)};var u,f=[];function c(){u=!0;for(var e,t,r=f.length;r;){for(t=f,f=[],e=-1;++e<r;)t[e]();r=f.length}u=!1}t.exports=function(e){1===f.push(e)&&!u&&r()}}).call(this,typeof global<"u"?global:typeof self<"u"?self:typeof window<"u"?window:{})},{}],2:[function(e,t,r){var n=e(1);function i(){}var a={},o=["REJECTED"],s=["FULFILLED"],u=["PENDING"];function f(e){if("function"!=typeof e)throw new TypeError("resolver must be a function");this.state=u,this.queue=[],this.outcome=void 0,e!==i&&p(this,e)}function c(e,t,r){this.promise=e,"function"==typeof t&&(this.onFulfilled=t,this.callFulfilled=this.otherCallFulfilled),"function"==typeof r&&(this.onRejected=r,this.callRejected=this.otherCallRejected)}function l(e,t,r){n((function(){var n;try{n=t(r)}catch(t){return a.reject(e,t)}n===e?a.reject(e,new TypeError("Cannot resolve promise with itself")):a.resolve(e,n)}))}function d(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 r=!1;function n(t){r||(r=!0,a.reject(e,t))}function i(t){r||(r=!0,a.resolve(e,t))}var o=h((function(){t(i,n)}));"error"===o.status&&n(o.value)}function h(e,t){var r={};try{r.value=e(t),r.status="success"}catch(e){r.status="error",r.value=e}return r}t.exports=f,f.prototype.catch=function(e){return this.then(null,e)},f.prototype.then=function(e,t){if("function"!=typeof e&&this.state===s||"function"!=typeof t&&this.state===o)return this;var r=new this.constructor(i);this.state!==u?l(r,this.state===s?e:t,this.outcome):this.queue.push(new c(r,e,t));return r},c.prototype.callFulfilled=function(e){a.resolve(this.promise,e)},c.prototype.otherCallFulfilled=function(e){l(this.promise,this.onFulfilled,e)},c.prototype.callRejected=function(e){a.reject(this.promise,e)},c.prototype.otherCallRejected=function(e){l(this.promise,this.onRejected,e)},a.resolve=function(e,t){var r=h(d,t);if("error"===r.status)return a.reject(e,r.value);var n=r.value;if(n)p(e,n);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 r=-1,n=e.queue.length;++r<n;)e.queue[r].callRejected(t);return e},f.resolve=function(e){return e instanceof this?e:a.resolve(new this(i),e)},f.reject=function(e){var t=new this(i);return a.reject(t,e)},f.all=function(e){var t=this;if("[object Array]"!==Object.prototype.toString.call(e))return this.reject(new TypeError("must be an array"));var r=e.length,n=!1;if(!r)return this.resolve([]);for(var o=new Array(r),s=0,u=-1,f=new this(i);++u<r;)c(e[u],u);return f;function c(e,i){t.resolve(e).then((function(e){o[i]=e,++s===r&&!n&&(n=!0,a.resolve(f,o))}),(function(e){n||(n=!0,a.reject(f,e))}))}},f.race=function(e){var t=this;if("[object Array]"!==Object.prototype.toString.call(e))return this.reject(new TypeError("must be an array"));var r=e.length,n=!1;if(!r)return this.resolve([]);for(var o=-1,s=new this(i);++o<r;)u(e[o]);return s;function u(e){t.resolve(e).then((function(e){n||(n=!0,a.resolve(s,e))}),(function(e){n||(n=!0,a.reject(s,e))}))}}},{1:1}],3:[function(e,t,r){(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,r){var n="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 r=new(typeof BlobBuilder<"u"?BlobBuilder:typeof MSBlobBuilder<"u"?MSBlobBuilder:typeof MozBlobBuilder<"u"?MozBlobBuilder:WebKitBlobBuilder),n=0;n<e.length;n+=1)r.append(e[n]);return r.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 u(e,t,r){"function"==typeof t&&e.then(t),"function"==typeof r&&e.catch(r)}function f(e){return"string"!=typeof e&&(console.warn(e+" used as a key, but it is not a string."),e=String(e)),e}function c(){if(arguments.length&&"function"==typeof arguments[arguments.length-1])return arguments[arguments.length-1]}var l="local-forage-detect-blob-support",d=void 0,p={},h=Object.prototype.toString,m="readonly",y="readwrite";function b(e){return"boolean"==typeof d?o.resolve(d):function(e){return new o((function(t){var r=e.transaction(l,y),n=a([""]);r.objectStore(l).put(n,"key"),r.onabort=function(e){e.preventDefault(),e.stopPropagation(),t(!1)},r.oncomplete=function(){var e=navigator.userAgent.match(/Chrome\/(\d+)/),r=navigator.userAgent.match(/Edge\//);t(r||!e||parseInt(e[1],10)>=43)}})).catch((function(){return!1}))}(e).then((function(e){return d=e}))}function g(e){var t=p[e.name],r={};r.promise=new o((function(e,t){r.resolve=e,r.reject=t})),t.deferredOperations.push(r),t.dbReady?t.dbReady=t.dbReady.then((function(){return r.promise})):t.dbReady=r.promise}function v(e){var t=p[e.name].deferredOperations.pop();if(t)return t.resolve(),t.promise}function w(e,t){var r=p[e.name].deferredOperations.pop();if(r)return r.reject(t),r.promise}function _(e,t){return new o((function(r,n){if(p[e.name]=p[e.name]||{forages:[],db:null,dbReady:null,deferredOperations:[]},e.db){if(!t)return r(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 r=o.result;try{r.createObjectStore(e.storeName),t.oldVersion<=1&&r.createObjectStore(l)}catch(r){if("ConstraintError"!==r.name)throw r;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(),n(o.error)},o.onsuccess=function(){var t=o.result;t.onversionchange=function(e){e.target.close()},r(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 r=!e.db.objectStoreNames.contains(e.storeName),n=e.version<e.db.version,i=e.version>e.db.version;if(n&&(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||r){if(r){var a=e.db.version+1;a>e.version&&(e.version=a)}return!0}return!1}function S(e){var t=function(e){for(var t=e.length,r=new ArrayBuffer(t),n=new Uint8Array(r),i=0;i<t;i++)n[i]=e.charCodeAt(i);return r}(atob(e.data));return a([t],{type:e.type})}function k(e){return e&&e.__local_forage_encoded_blob}function O(e){var t=this,r=t._initReady().then((function(){var e=p[t._dbInfo.name];if(e&&e.dbReady)return e.dbReady}));return u(r,e,e),r}function R(e,t,r,n){void 0===n&&(n=1);try{var i=e.db.transaction(e.storeName,t);r(null,i)}catch(i){if(n>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],r=t.forages,n=0;n<r.length;n++){var i=r[n];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(n){e.db=t.db=n;for(var i=0;i<r.length;i++)r[i]._dbInfo.db=n})).catch((function(t){throw w(e,t),t}))}(e).then((function(){R(e,t,r,n-1)}))})).catch(r);r(i)}}var x={_driver:"asyncStorage",_initStorage:function(e){var t=this,r={db:null};if(e)for(var n in e)r[n]=e[n];var i=p[r.name];i||(i={forages:[],db:null,dbReady:null,deferredOperations:[]},p[r.name]=i),i.forages.push(t),t._initReady||(t._initReady=t.ready,t.ready=O);var a=[];function s(){return o.resolve()}for(var u=0;u<i.forages.length;u++){var f=i.forages[u];f!==t&&a.push(f._initReady().catch(s))}var c=i.forages.slice(0);return o.all(a).then((function(){return r.db=i.db,E(r)})).then((function(e){return r.db=e,A(r,t._defaultConfig.version)?T(r):e})).then((function(e){r.db=i.db=e,t._dbInfo=r;for(var n=0;n<c.length;n++){var a=c[n];a!==t&&(a._dbInfo.db=r.db,a._dbInfo.version=r.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 r=this,n=new o((function(t,n){r.ready().then((function(){R(r._dbInfo,m,(function(i,a){if(i)return n(i);try{var o=a.objectStore(r._dbInfo.storeName).openCursor(),s=1;o.onsuccess=function(){var r=o.result;if(r){var n=r.value;k(n)&&(n=S(n));var i=e(n,r.key,s++);void 0!==i?t(i):r.continue()}else t()},o.onerror=function(){n(o.error)}}catch(e){n(e)}}))})).catch(n)}));return s(n,t),n},getItem:function(e,t){var r=this;e=f(e);var n=new o((function(t,n){r.ready().then((function(){R(r._dbInfo,m,(function(i,a){if(i)return n(i);try{var o=a.objectStore(r._dbInfo.storeName).get(e);o.onsuccess=function(){var e=o.result;void 0===e&&(e=null),k(e)&&(e=S(e)),t(e)},o.onerror=function(){n(o.error)}}catch(e){n(e)}}))})).catch(n)}));return s(n,t),n},setItem:function(e,t,r){var n=this;e=f(e);var i=new o((function(r,i){var a;n.ready().then((function(){return a=n._dbInfo,"[object Blob]"===h.call(t)?b(a.db).then((function(e){return e?t:function(e){return new o((function(t,r){var n=new FileReader;n.onerror=r,n.onloadend=function(r){var n=btoa(r.target.result||"");t({__local_forage_encoded_blob:!0,data:n,type:e.type})},n.readAsBinaryString(e)}))}(t)})):t})).then((function(t){R(n._dbInfo,y,(function(a,o){if(a)return i(a);try{var s=o.objectStore(n._dbInfo.storeName);null===t&&(t=void 0);var u=s.put(t,e);o.oncomplete=function(){void 0===t&&(t=null),r(t)},o.onabort=o.onerror=function(){var e=u.error?u.error:u.transaction.error;i(e)}}catch(e){i(e)}}))})).catch(i)}));return s(i,r),i},removeItem:function(e,t){var r=this;e=f(e);var n=new o((function(t,n){r.ready().then((function(){R(r._dbInfo,y,(function(i,a){if(i)return n(i);try{var o=a.objectStore(r._dbInfo.storeName).delete(e);a.oncomplete=function(){t()},a.onerror=function(){n(o.error)},a.onabort=function(){var e=o.error?o.error:o.transaction.error;n(e)}}catch(e){n(e)}}))})).catch(n)}));return s(n,t),n},clear:function(e){var t=this,r=new o((function(e,r){t.ready().then((function(){R(t._dbInfo,y,(function(n,i){if(n)return r(n);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;r(e)}}catch(e){r(e)}}))})).catch(r)}));return s(r,e),r},length:function(e){var t=this,r=new o((function(e,r){t.ready().then((function(){R(t._dbInfo,m,(function(n,i){if(n)return r(n);try{var a=i.objectStore(t._dbInfo.storeName).count();a.onsuccess=function(){e(a.result)},a.onerror=function(){r(a.error)}}catch(e){r(e)}}))})).catch(r)}));return s(r,e),r},key:function(e,t){var r=this,n=new o((function(t,n){e<0?t(null):r.ready().then((function(){R(r._dbInfo,m,(function(i,a){if(i)return n(i);try{var o=a.objectStore(r._dbInfo.storeName),s=!1,u=o.openKeyCursor();u.onsuccess=function(){var r=u.result;r?0===e||s?t(r.key):(s=!0,r.advance(e)):t(null)},u.onerror=function(){n(u.error)}}catch(e){n(e)}}))})).catch(n)}));return s(n,t),n},keys:function(e){var t=this,r=new o((function(e,r){t.ready().then((function(){R(t._dbInfo,m,(function(n,i){if(n)return r(n);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(){r(a.error)}}catch(e){r(e)}}))})).catch(r)}));return s(r,e),r},dropInstance:function(e,t){t=c.apply(this,arguments);var r,n=this.config();if((e="function"!=typeof e&&e||{}).name||(e.name=e.name||n.name,e.storeName=e.storeName||n.storeName),e.name){var a=e.name===n.name&&this._dbInfo.db?o.resolve(this._dbInfo.db):E(e).then((function(t){var r=p[e.name],n=r.forages;r.db=t;for(var i=0;i<n.length;i++)n[i]._dbInfo.db=t;return t}));r=e.storeName?a.then((function(t){if(t.objectStoreNames.contains(e.storeName)){var r=t.version+1;g(e);var n=p[e.name],a=n.forages;t.close();for(var s=0;s<a.length;s++){var u=a[s];u._dbInfo.db=null,u._dbInfo.version=r}var f=new o((function(t,n){var a=i.open(e.name,r);a.onerror=function(e){a.result.close(),n(e)},a.onupgradeneeded=function(){a.result.deleteObjectStore(e.storeName)},a.onsuccess=function(){var e=a.result;e.close(),t(e)}}));return f.then((function(e){n.db=e;for(var t=0;t<a.length;t++){var r=a[t];r._dbInfo.db=e,v(r._dbInfo)}})).catch((function(t){throw(w(e,t)||o.resolve()).catch((function(){})),t}))}})):a.then((function(t){g(e);var r=p[e.name],n=r.forages;t.close();for(var a=0;a<n.length;a++){n[a]._dbInfo.db=null}var s=new o((function(t,r){var n=i.deleteDatabase(e.name);n.onerror=function(){var e=n.result;e&&e.close(),r(n.error)},n.onblocked=function(){console.warn('dropInstance blocked for database "'+e.name+'" until all open connections are closed')},n.onsuccess=function(){var e=n.result;e&&e.close(),t(e)}}));return s.then((function(e){r.db=e;for(var t=0;t<n.length;t++){v(n[t]._dbInfo)}})).catch((function(t){throw(w(e,t)||o.resolve()).catch((function(){})),t}))}))}else r=o.reject("Invalid arguments");return s(r,t),r}};var I="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",C=/^~~local_forage_type~([^~]+)~/,N="__lfsc__:",P="arbf",M="blob",B="si08",D="ui08",F="uic8",L="si16",U="si32",j="ur16",q="ui32",z="fl32",H="fl64",V=Object.prototype.toString;function G(e){var t,r,n,i,a,o=.75*e.length,s=e.length,u=0;"="===e[e.length-1]&&(o--,"="===e[e.length-2]&&o--);var f=new ArrayBuffer(o),c=new Uint8Array(f);for(t=0;t<s;t+=4)r=I.indexOf(e[t]),n=I.indexOf(e[t+1]),i=I.indexOf(e[t+2]),a=I.indexOf(e[t+3]),c[u++]=r<<2|n>>4,c[u++]=(15&n)<<4|i>>2,c[u++]=(3&i)<<6|63&a;return f}function W(e){var t,r=new Uint8Array(e),n="";for(t=0;t<r.length;t+=3)n+=I[r[t]>>2],n+=I[(3&r[t])<<4|r[t+1]>>4],n+=I[(15&r[t+1])<<2|r[t+2]>>6],n+=I[63&r[t+2]];return r.length%3==2?n=n.substring(0,n.length-1)+"=":r.length%3==1&&(n=n.substring(0,n.length-2)+"=="),n}var K={serialize:function(e,t){var r="";if(e&&(r=V.call(e)),e&&("[object ArrayBuffer]"===r||e.buffer&&"[object ArrayBuffer]"===V.call(e.buffer))){var n,i=N;e instanceof ArrayBuffer?(n=e,i+=P):(n=e.buffer,"[object Int8Array]"===r?i+=B:"[object Uint8Array]"===r?i+=D:"[object Uint8ClampedArray]"===r?i+=F:"[object Int16Array]"===r?i+=L:"[object Uint16Array]"===r?i+=j:"[object Int32Array]"===r?i+=U:"[object Uint32Array]"===r?i+=q:"[object Float32Array]"===r?i+=z:"[object Float64Array]"===r?i+=H:t(new Error("Failed to get type for BinaryArray"))),t(i+W(n))}else if("[object Blob]"===r){var a=new FileReader;a.onload=function(){var r="~~local_forage_type~"+e.type+"~"+W(this.result);t(N+M+r)},a.readAsArrayBuffer(e)}else try{t(JSON.stringify(e))}catch(r){console.error("Couldn't convert value into a JSON string: ",e),t(null,r)}},deserialize:function(e){if(e.substring(0,9)!==N)return JSON.parse(e);var t,r=e.substring(13),n=e.substring(9,13);if(n===M&&C.test(r)){var i=r.match(C);t=i[1],r=r.substring(i[0].length)}var o=G(r);switch(n){case P:return o;case M: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: "+n)}},stringToBuffer:G,bufferToString:W};function X(e,t,r,n){e.executeSql("CREATE TABLE IF NOT EXISTS "+t.storeName+" (id INTEGER PRIMARY KEY, key unique, value)",[],r,n)}function $(e,t,r,n,i,a){e.executeSql(r,n,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(r,n,i,a)}),a)}),a):a(e,o)}),a)}function J(e,t,r,n){var i=this;e=f(e);var a=new o((function(a,o){i.ready().then((function(){void 0===t&&(t=null);var s=t,u=i._dbInfo;u.serializer.serialize(t,(function(t,f){f?o(f):u.db.transaction((function(r){$(r,u,"INSERT OR REPLACE INTO "+u.storeName+" (key, value) VALUES (?, ?)",[e,t],(function(){a(s)}),(function(e,t){o(t)}))}),(function(t){if(t.code===t.QUOTA_ERR){if(n>0)return void a(J.apply(i,[e,s,r,n-1]));o(t)}}))}))})).catch(o)}));return s(a,r),a}var Y={_driver:"webSQLStorage",_initStorage:function(e){var t=this,r={db:null};if(e)for(var n in e)r[n]="string"!=typeof e[n]?e[n].toString():e[n];var i=new o((function(e,n){try{r.db=openDatabase(r.name,String(r.version),r.description,r.size)}catch(e){return n(e)}r.db.transaction((function(i){X(i,r,(function(){t._dbInfo=r,e()}),(function(e,t){n(t)}))}),n)}));return r.serializer=K,i},_support:"function"==typeof openDatabase,iterate:function(e,t){var r=this,n=new o((function(t,n){r.ready().then((function(){var i=r._dbInfo;i.db.transaction((function(r){$(r,i,"SELECT * FROM "+i.storeName,[],(function(r,n){for(var a=n.rows,o=a.length,s=0;s<o;s++){var u=a.item(s),f=u.value;if(f&&(f=i.serializer.deserialize(f)),void 0!==(f=e(f,u.key,s+1)))return void t(f)}t()}),(function(e,t){n(t)}))}))})).catch(n)}));return s(n,t),n},getItem:function(e,t){var r=this;e=f(e);var n=new o((function(t,n){r.ready().then((function(){var i=r._dbInfo;i.db.transaction((function(r){$(r,i,"SELECT * FROM "+i.storeName+" WHERE key = ? LIMIT 1",[e],(function(e,r){var n=r.rows.length?r.rows.item(0).value:null;n&&(n=i.serializer.deserialize(n)),t(n)}),(function(e,t){n(t)}))}))})).catch(n)}));return s(n,t),n},setItem:function(e,t,r){return J.apply(this,[e,t,r,1])},removeItem:function(e,t){var r=this;e=f(e);var n=new o((function(t,n){r.ready().then((function(){var i=r._dbInfo;i.db.transaction((function(r){$(r,i,"DELETE FROM "+i.storeName+" WHERE key = ?",[e],(function(){t()}),(function(e,t){n(t)}))}))})).catch(n)}));return s(n,t),n},clear:function(e){var t=this,r=new o((function(e,r){t.ready().then((function(){var n=t._dbInfo;n.db.transaction((function(t){$(t,n,"DELETE FROM "+n.storeName,[],(function(){e()}),(function(e,t){r(t)}))}))})).catch(r)}));return s(r,e),r},length:function(e){var t=this,r=new o((function(e,r){t.ready().then((function(){var n=t._dbInfo;n.db.transaction((function(t){$(t,n,"SELECT COUNT(key) as c FROM "+n.storeName,[],(function(t,r){var n=r.rows.item(0).c;e(n)}),(function(e,t){r(t)}))}))})).catch(r)}));return s(r,e),r},key:function(e,t){var r=this,n=new o((function(t,n){r.ready().then((function(){var i=r._dbInfo;i.db.transaction((function(r){$(r,i,"SELECT key FROM "+i.storeName+" WHERE id = ? LIMIT 1",[e+1],(function(e,r){var n=r.rows.length?r.rows.item(0).key:null;t(n)}),(function(e,t){n(t)}))}))})).catch(n)}));return s(n,t),n},keys:function(e){var t=this,r=new o((function(e,r){t.ready().then((function(){var n=t._dbInfo;n.db.transaction((function(t){$(t,n,"SELECT key FROM "+n.storeName,[],(function(t,r){for(var n=[],i=0;i<r.rows.length;i++)n.push(r.rows.item(i).key);e(n)}),(function(e,t){r(t)}))}))})).catch(r)}));return s(r,e),r},dropInstance:function(e,t){t=c.apply(this,arguments);var r=this.config();(e="function"!=typeof e&&e||{}).name||(e.name=e.name||r.name,e.storeName=e.storeName||r.storeName);var n,i=this;return n=e.name?new o((function(t){var n;n=e.name===r.name?i._dbInfo.db:openDatabase(e.name,"","",0),e.storeName?t({db:n,storeNames:[e.storeName]}):t(function(e){return new o((function(t,r){e.transaction((function(n){n.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name <> '__WebKitDatabaseInfoTable__'",[],(function(r,n){for(var i=[],a=0;a<n.rows.length;a++)i.push(n.rows.item(a).name);t({db:e,storeNames:i})}),(function(e,t){r(t)}))}),(function(e){r(e)}))}))}(n))})).then((function(e){return new o((function(t,r){e.db.transaction((function(n){function i(e){return new o((function(t,r){n.executeSql("DROP TABLE IF EXISTS "+e,[],(function(){t()}),(function(e,t){r(t)}))}))}for(var a=[],s=0,u=e.storeNames.length;s<u;s++)a.push(i(e.storeNames[s]));o.all(a).then((function(){t()})).catch((function(e){r(e)}))}),(function(e){r(e)}))}))})):o.reject("Invalid arguments"),s(n,t),n}};function Q(e,t){var r=e.name+"/";return e.storeName!==t.storeName&&(r+=e.storeName+"/"),r}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 r in e)t[r]=e[r];return t.keyPrefix=Q(e,this._defaultConfig),Z()?(this._dbInfo=t,t.serializer=K,o.resolve()):o.reject()},_support:function(){try{return typeof localStorage<"u"&&"setItem"in localStorage&&!!localStorage.setItem}catch{return!1}}(),iterate:function(e,t){var r=this,n=r.ready().then((function(){for(var t=r._dbInfo,n=t.keyPrefix,i=n.length,a=localStorage.length,o=1,s=0;s<a;s++){var u=localStorage.key(s);if(0===u.indexOf(n)){var f=localStorage.getItem(u);if(f&&(f=t.serializer.deserialize(f)),void 0!==(f=e(f,u.substring(i),o++)))return f}}}));return s(n,t),n},getItem:function(e,t){var r=this;e=f(e);var n=r.ready().then((function(){var t=r._dbInfo,n=localStorage.getItem(t.keyPrefix+e);return n&&(n=t.serializer.deserialize(n)),n}));return s(n,t),n},setItem:function(e,t,r){var n=this;e=f(e);var i=n.ready().then((function(){void 0===t&&(t=null);var r=t;return new o((function(i,a){var o=n._dbInfo;o.serializer.serialize(t,(function(t,n){if(n)a(n);else try{localStorage.setItem(o.keyPrefix+e,t),i(r)}catch(e){("QuotaExceededError"===e.name||"NS_ERROR_DOM_QUOTA_REACHED"===e.name)&&a(e),a(e)}}))}))}));return s(i,r),i},removeItem:function(e,t){var r=this;e=f(e);var n=r.ready().then((function(){var t=r._dbInfo;localStorage.removeItem(t.keyPrefix+e)}));return s(n,t),n},clear:function(e){var t=this,r=t.ready().then((function(){for(var e=t._dbInfo.keyPrefix,r=localStorage.length-1;r>=0;r--){var n=localStorage.key(r);0===n.indexOf(e)&&localStorage.removeItem(n)}}));return s(r,e),r},length:function(e){var t=this.keys().then((function(e){return e.length}));return s(t,e),t},key:function(e,t){var r=this,n=r.ready().then((function(){var t,n=r._dbInfo;try{t=localStorage.key(e)}catch{t=null}return t&&(t=t.substring(n.keyPrefix.length)),t}));return s(n,t),n},keys:function(e){var t=this,r=t.ready().then((function(){for(var e=t._dbInfo,r=localStorage.length,n=[],i=0;i<r;i++){var a=localStorage.key(i);0===a.indexOf(e.keyPrefix)&&n.push(a.substring(e.keyPrefix.length))}return n}));return s(r,e),r},dropInstance:function(e,t){if(t=c.apply(this,arguments),!(e="function"!=typeof e&&e||{}).name){var r=this.config();e.name=e.name||r.name,e.storeName=e.storeName||r.storeName}var n,i=this;return n=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 r=localStorage.key(t);0===r.indexOf(e)&&localStorage.removeItem(r)}})):o.reject("Invalid arguments"),s(n,t),n}},te=function(e,t){return e===t||"number"==typeof e&&"number"==typeof t&&isNaN(e)&&isNaN(t)},re=function(e,t){for(var r=e.length,n=0;n<r;){if(te(e[n],t))return!0;n++}return!1},ne=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)},ie={},ae={},oe={INDEXEDDB:x,WEBSQL:Y,LOCALSTORAGE:ee},se=[oe.INDEXEDDB._driver,oe.WEBSQL._driver,oe.LOCALSTORAGE._driver],ue=["dropInstance"],fe=["clear","getItem","iterate","key","keys","length","removeItem","setItem"].concat(ue),ce={description:"",driver:se.slice(),name:"localforage",size:4980736,storeName:"keyvaluepairs",version:1};function le(e,t){e[t]=function(){var r=arguments;return e.ready().then((function(){return e[t].apply(e,r)}))}}function de(){for(var e=1;e<arguments.length;e++){var t=arguments[e];if(t)for(var r in t)t.hasOwnProperty(r)&&(ne(t[r])?arguments[0][r]=t[r].slice():arguments[0][r]=t[r])}return arguments[0]}var pe=function(){function e(t){for(var r in function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),oe)if(oe.hasOwnProperty(r)){var n=oe[r],i=n._driver;this[r]=i,ie[i]||this.defineDriver(n)}this._defaultConfig=de({},ce),this._config=de({},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":n(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,r){var n=new o((function(t,r){try{var n=e._driver,i=new Error("Custom driver not compliant; see https://mozilla.github.io/localForage/#definedriver");if(!e._driver)return void r(i);for(var a=fe.concat("_initStorage"),u=0,f=a.length;u<f;u++){var c=a[u];if((!re(ue,c)||e[c])&&"function"!=typeof e[c])return void r(i)}!function(){for(var t=function(e){return function(){var t=new Error("Method "+e+" is not implemented by the current driver"),r=o.reject(t);return s(r,arguments[arguments.length-1]),r}},r=0,n=ue.length;r<n;r++){var i=ue[r];e[i]||(e[i]=t(i))}}();var l=function(r){ie[n]&&console.info("Redefining LocalForage driver: "+n),ie[n]=e,ae[n]=r,t()};"_support"in e?e._support&&"function"==typeof e._support?e._support().then(l,r):l(!!e._support):l(!0)}catch(e){r(e)}}));return u(n,t,r),n},e.prototype.driver=function(){return this._driver||null},e.prototype.getDriver=function(e,t,r){var n=ie[e]?o.resolve(ie[e]):o.reject(new Error("Driver not found."));return u(n,t,r),n},e.prototype.getSerializer=function(e){var t=o.resolve(K);return u(t,e),t},e.prototype.ready=function(e){var t=this,r=t._driverSet.then((function(){return null===t._ready&&(t._ready=t._initDriver()),t._ready}));return u(r,e,e),r},e.prototype.setDriver=function(e,t,r){var n=this;ne(e)||(e=[e]);var i=this._getSupportedDrivers(e);function a(){n._config.driver=n.driver()}function s(e){return n._extend(e),a(),n._ready=n._initStorage(n._config),n._ready}var f=null!==this._driverSet?this._driverSet.catch((function(){return o.resolve()})):o.resolve();return this._driverSet=f.then((function(){var e=i[0];return n._dbInfo=null,n._ready=null,n.getDriver(e).then((function(e){n._driver=e._driver,a(),n._wrapLibraryMethodsWithReady(),n._initDriver=function(e){return function(){var t=0;return function r(){for(;t<e.length;){var i=e[t];return t++,n._dbInfo=null,n._ready=null,n.getDriver(i).then(s).catch(r)}a();var u=new Error("No available storage method found.");return n._driverSet=o.reject(u),n._driverSet}()}}(i)}))})).catch((function(){a();var e=new Error("No available storage method found.");return n._driverSet=o.reject(e),n._driverSet})),u(this._driverSet,t,r),this._driverSet},e.prototype.supports=function(e){return!!ae[e]},e.prototype._extend=function(e){de(this,e)},e.prototype._getSupportedDrivers=function(e){for(var t=[],r=0,n=e.length;r<n;r++){var i=e[r];this.supports(i)&&t.push(i)}return t},e.prototype._wrapLibraryMethodsWithReady=function(){for(var e=0,t=fe.length;e<t;e++)le(this,fe[e])},e.prototype.createInstance=function(t){return new e(t)},e}(),he=new pe;t.exports=he},{3:3}]},{},[4])(4)}))})),MU=IU(((e,t)=>{!function(r,n){"object"==typeof e&&typeof t<"u"?n(e):"function"==typeof define&&define.amd?define("localforage-driver-memory",["exports"],n):n(r.LocalforageDriverMemory={})}(typeof self<"u"?self:e,(function(e){var t=/^~~local_forage_type~([^~]+)~/,r=Object.prototype.toString;function n(e){var t=.75*e.length,r=e.length;"="===e[e.length-1]&&(t--,"="===e[e.length-2]&&t--);for(var n=new ArrayBuffer(t),i=new Uint8Array(n),a=0,o=0;a<r;a+=4){var s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".indexOf(e[a]),u="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".indexOf(e[a+1]),f="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".indexOf(e[a+2]),c="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".indexOf(e[a+3]);i[o++]=s<<2|u>>4,i[o++]=(15&u)<<4|f>>2,i[o++]=(3&f)<<6|63&c}return n}function i(e){for(var t=new Uint8Array(e),r="",n=0;n<t.length;n+=3)r+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[t[n]>>2],r+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[(3&t[n])<<4|t[n+1]>>4],r+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[(15&t[n+1])<<2|t[n+2]>>6],r+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[63&t[n+2]];return t.length%3==2?r=r.substring(0,r.length-1)+"=":t.length%3==1&&(r=r.substring(0,r.length-2)+"=="),r}function a(e){var t,r;if(null===e||"object"!=typeof e||"isActiveClone"in e)return e;var n=e instanceof Date?new Date(e):e.constructor();try{for(var i=function(e){var t="function"==typeof Symbol&&e[Symbol.iterator],r=0;return t?t.call(e):{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],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,n[s]=a(e[s]),delete e.isActiveClone)}}catch(e){t={error:e}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(t)throw t.error}}return n}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 u(){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 f(e,t){var r,n=this;if(t=u.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 r=e.name?new Promise((function(t){e.storeName?t(o(e,n._defaultConfig)):t(e.name+"/")})):Promise.reject("Invalid arguments"),{promise:r,callback:t}}function c(e){return"string"!=typeof e&&(console.warn(e+" used as a key, but it is not a string."),e=String(e)),e}var l={bufferToString:i,deserialize:function(e){if("__lfsc__:"!==e.substring(0,9))return JSON.parse(e);var r,i=e.substring(13),a=e.substring(9,13);if("blob"===a&&t.test(i)){var o=i.match(t);r=o[1],i=i.substring(o[0].length)}var s=n(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 r=new(typeof BlobBuilder<"u"?BlobBuilder:typeof MSBlobBuilder<"u"?MSBlobBuilder:typeof MozBlobBuilder<"u"?MozBlobBuilder:WebKitBlobBuilder),n=0;n<e.length;n+=1)r.append(e[n]);return r.getBlob(t.type)}}([s],{type:r});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 n="";if(e&&(n=r.call(e)),e&&("[object ArrayBuffer]"===n||e.buffer&&"[object ArrayBuffer]"===r.call(e.buffer))){var a=void 0,o="__lfsc__:";e instanceof ArrayBuffer?(a=e,o+="arbf"):(a=e.buffer,"[object Int8Array]"===n?o+="si08":"[object Uint8Array]"===n?o+="ui08":"[object Uint8ClampedArray]"===n?o+="uic8":"[object Int16Array]"===n?o+="si16":"[object Uint16Array]"===n?o+="ur16":"[object Int32Array]"===n?o+="si32":"[object Uint32Array]"===n?o+="ui32":"[object Float32Array]"===n?o+="fl32":"[object Float64Array]"===n?o+="fl64":t(new Error("Failed to get type for BinaryArray"))),t(o+i(a))}else if("[object Blob]"===n){var s=new FileReader;s.onload=function(){var r="~~local_forage_type~"+e.type+"~"+i(this.result);t("__lfsc__:blob"+r)},s.readAsArrayBuffer(e)}else try{t(JSON.stringify(e))}catch(r){console.error("Couldn't convert value into a JSON string: ",e),t(null,r)}},stringToBuffer:n},d={},p=function(){function e(e){this.kp=e,this.data={}}return e.resolve=function(t){return d[t]||(d[t]=new e(t)),d[t]},e.prototype.clear=function(){this.data={}},e.prototype.drop=function(){this.clear(),delete d[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):{},r=o(t,this._defaultConfig),n=p.resolve(r);return this._dbInfo=t,this._dbInfo.serializer=l,this._dbInfo.keyPrefix=r,this._dbInfo.mStore=n,Promise.resolve()},e.clear=function(e){var t=this,r=this.ready().then((function(){t._dbInfo.mStore.clear()}));return s(r,e),r},e.dropInstance=function(e,t){var r=f.apply(this,arguments),n=r.promise,i=r.callback,a=n.then((function(e){p.resolve(e).drop()}));return s(a,i),n},e.getItem=function(e,t){var r=this;e=c(e);var n=this.ready().then((function(){var t=r._dbInfo.mStore.get(e);return null==t?null:r._dbInfo.serializer.deserialize(t)}));return s(n,t),n},e.iterate=function(e,t){var r=this,n=this.ready().then((function(){for(var t=r._dbInfo.mStore,n=t.keys(),i=0;i<n.length;i++){var a=t.get(n[i]);if(a&&(a=r._dbInfo.serializer.deserialize(a)),void 0!==(a=e(a,n[i],i+1)))return a}}));return s(n,t),n},e.key=function(e,t){var r=this,n=this.ready().then((function(){var t;try{void 0===(t=r._dbInfo.mStore.key(e))&&(t=null)}catch{t=null}return t}));return s(n,t),n},e.keys=function(e){var t=this,r=this.ready().then((function(){return t._dbInfo.mStore.keys()}));return s(r,e),r},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 r=this;e=c(e);var n=this.ready().then((function(){r._dbInfo.mStore.rm(e)}));return s(n,t),n},e.setItem=function(e,t,r){var n=this;e=c(e);var i=this.ready().then((function(){void 0===t&&(t=null);var r=t;return new Promise((function(i,a){n._dbInfo.serializer.serialize(t,(function(t,o){if(o)a(o);else try{n._dbInfo.mStore.set(e,t),i(r)}catch(e){a(e)}}))}))}));return s(i,r),i},Object.defineProperty(e,"__esModule",{value:!0})}))})),BU=CU(PU()),DU=CU(MU()),FU={display:"none",position:"fixed",top:"0",right:"0",width:"100%",height:"100%",borderRadius:"0",border:"none",zIndex:"2147483647"};var LU=function(e,t){return Object.assign(fL,t),e}(wU,{platform:"web",sdkName:"magic-sdk",version:"13.6.2",defaultEndpoint:"https://auth.magic.link/",ViewController:class extends EU{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 pL(LD.DuplicateIframe,"Duplicate iframes found.").log();else{let t=document.createElement("iframe");t.classList.add("magic-iframe"),t.dataset.magicIframeLabel=lU(this.endpoint).host,t.title="Secure Modal",t.src=lU(`/send?params=${encodeURIComponent(this.parameters)}`,this.endpoint).href,function(e){for(let[t,r]of Object.entries(FU))e.style[t]=r}(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 NU(this,null,(function*(){let e=yield this.iframe;e.style.display="block",this.activeElement=document.activeElement,e.focus()}))}hideOverlay(){return NU(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 NU(this,null,(function*(){let t=yield this.iframe;if(!t||!t.contentWindow)throw new lL(FD.ModalNotReady,"Modal is not ready.");t.contentWindow.postMessage(e,this.endpoint)}))}},configureStorage:()=>NU(void 0,null,(function*(){let e=BU.default.createInstance({name:"MagicAuthLocalStorageDB",storeName:"MagicAuthLocalStorage"});return yield e.defineDriver(DU),yield e.setDriver([BU.default.INDEXEDDB,BU.default.LOCALSTORAGE,DU._driver]),e}))}),UU=(e=>(e.LoginWithOIDC="magic_auth_login_with_oidc",e))(UU||{}),jU=class extends mU.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 qU(e,t){return function(){return e.apply(t,arguments)}}const{toString:zU}=Object.prototype,{getPrototypeOf:HU}=Object,VU=(e=>t=>{const r=zU.call(t);return e[r]||(e[r]=r.slice(8,-1).toLowerCase())})(Object.create(null)),GU=e=>(e=e.toLowerCase(),t=>VU(t)===e),WU=e=>t=>typeof t===e,{isArray:KU}=Array,XU=WU("undefined");const $U=GU("ArrayBuffer");const JU=WU("string"),YU=WU("function"),QU=WU("number"),ZU=e=>null!==e&&"object"==typeof e,ej=e=>{if("object"!==VU(e))return!1;const t=HU(e);return!(null!==t&&t!==Object.prototype&&null!==Object.getPrototypeOf(t)||Symbol.toStringTag in e||Symbol.iterator in e)},tj=GU("Date"),rj=GU("File"),nj=GU("Blob"),ij=GU("FileList"),aj=GU("URLSearchParams");function oj(e,t,{allOwnKeys:r=!1}={}){if(null==e)return;let n,i;if("object"!=typeof e&&(e=[e]),KU(e))for(n=0,i=e.length;n<i;n++)t.call(null,e[n],n,e);else{const i=r?Object.getOwnPropertyNames(e):Object.keys(e),a=i.length;let o;for(n=0;n<a;n++)o=i[n],t.call(null,e[o],o,e)}}function sj(e,t){t=t.toLowerCase();const r=Object.keys(e);let n,i=r.length;for(;i-- >0;)if(n=r[i],t===n.toLowerCase())return n;return null}const uj="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:global,fj=e=>!XU(e)&&e!==uj;const cj=(e=>t=>e&&t instanceof e)("undefined"!=typeof Uint8Array&&HU(Uint8Array)),lj=GU("HTMLFormElement"),dj=(({hasOwnProperty:e})=>(t,r)=>e.call(t,r))(Object.prototype),pj=GU("RegExp"),hj=(e,t)=>{const r=Object.getOwnPropertyDescriptors(e),n={};oj(r,((r,i)=>{!1!==t(r,i,e)&&(n[i]=r)})),Object.defineProperties(e,n)},mj="abcdefghijklmnopqrstuvwxyz",yj="0123456789",bj={DIGIT:yj,ALPHA:mj,ALPHA_DIGIT:mj+mj.toUpperCase()+yj};const gj=GU("AsyncFunction");var vj={isArray:KU,isArrayBuffer:$U,isBuffer:function(e){return null!==e&&!XU(e)&&null!==e.constructor&&!XU(e.constructor)&&YU(e.constructor.isBuffer)&&e.constructor.isBuffer(e)},isFormData:e=>{let t;return e&&("function"==typeof FormData&&e instanceof FormData||YU(e.append)&&("formdata"===(t=VU(e))||"object"===t&&YU(e.toString)&&"[object FormData]"===e.toString()))},isArrayBufferView:function(e){let t;return t="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&$U(e.buffer),t},isString:JU,isNumber:QU,isBoolean:e=>!0===e||!1===e,isObject:ZU,isPlainObject:ej,isUndefined:XU,isDate:tj,isFile:rj,isBlob:nj,isRegExp:pj,isFunction:YU,isStream:e=>ZU(e)&&YU(e.pipe),isURLSearchParams:aj,isTypedArray:cj,isFileList:ij,forEach:oj,merge:function e(){const{caseless:t}=fj(this)&&this||{},r={},n=(n,i)=>{const a=t&&sj(r,i)||i;ej(r[a])&&ej(n)?r[a]=e(r[a],n):ej(n)?r[a]=e({},n):KU(n)?r[a]=n.slice():r[a]=n};for(let e=0,t=arguments.length;e<t;e++)arguments[e]&&oj(arguments[e],n);return r},extend:(e,t,r,{allOwnKeys:n}={})=>(oj(t,((t,n)=>{r&&YU(t)?e[n]=qU(t,r):e[n]=t}),{allOwnKeys:n}),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,r,n)=>{e.prototype=Object.create(t.prototype,n),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),r&&Object.assign(e.prototype,r)},toFlatObject:(e,t,r,n)=>{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],n&&!n(o,e,t)||s[o]||(t[o]=e[o],s[o]=!0);e=!1!==r&&HU(e)}while(e&&(!r||r(e,t))&&e!==Object.prototype);return t},kindOf:VU,kindOfTest:GU,endsWith:(e,t,r)=>{e=String(e),(void 0===r||r>e.length)&&(r=e.length),r-=t.length;const n=e.indexOf(t,r);return-1!==n&&n===r},toArray:e=>{if(!e)return null;if(KU(e))return e;let t=e.length;if(!QU(t))return null;const r=new Array(t);for(;t-- >0;)r[t]=e[t];return r},forEachEntry:(e,t)=>{const r=(e&&e[Symbol.iterator]).call(e);let n;for(;(n=r.next())&&!n.done;){const r=n.value;t.call(e,r[0],r[1])}},matchAll:(e,t)=>{let r;const n=[];for(;null!==(r=e.exec(t));)n.push(r);return n},isHTMLForm:lj,hasOwnProperty:dj,hasOwnProp:dj,reduceDescriptors:hj,freezeMethods:e=>{hj(e,((t,r)=>{if(YU(e)&&-1!==["arguments","caller","callee"].indexOf(r))return!1;const n=e[r];YU(n)&&(t.enumerable=!1,"writable"in t?t.writable=!1:t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+r+"'")}))}))},toObjectSet:(e,t)=>{const r={},n=e=>{e.forEach((e=>{r[e]=!0}))};return KU(e)?n(e):n(String(e).split(t)),r},toCamelCase:e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,(function(e,t,r){return t.toUpperCase()+r})),noop:()=>{},toFiniteNumber:(e,t)=>(e=+e,Number.isFinite(e)?e:t),findKey:sj,global:uj,isContextDefined:fj,ALPHABET:bj,generateString:(e=16,t=bj.ALPHA_DIGIT)=>{let r="";const{length:n}=t;for(;e--;)r+=t[Math.random()*n|0];return r},isSpecCompliantForm:function(e){return!!(e&&YU(e.append)&&"FormData"===e[Symbol.toStringTag]&&e[Symbol.iterator])},toJSONObject:e=>{const t=new Array(10),r=(e,n)=>{if(ZU(e)){if(t.indexOf(e)>=0)return;if(!("toJSON"in e)){t[n]=e;const i=KU(e)?[]:{};return oj(e,((e,t)=>{const a=r(e,n+1);!XU(a)&&(i[t]=a)})),t[n]=void 0,i}}return e};return r(e,0)},isAsyncFn:gj,isThenable:e=>e&&(ZU(e)||YU(e))&&YU(e.then)&&YU(e.catch)};function wj(e,t,r,n,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),r&&(this.config=r),n&&(this.request=n),i&&(this.response=i)}vj.inherits(wj,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:vj.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});const _j=wj.prototype,Ej={};["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=>{Ej[e]={value:e}})),Object.defineProperties(wj,Ej),Object.defineProperty(_j,"isAxiosError",{value:!0}),wj.from=(e,t,r,n,i,a)=>{const o=Object.create(_j);return vj.toFlatObject(e,o,(function(e){return e!==Error.prototype}),(e=>"isAxiosError"!==e)),wj.call(o,e.message,t,r,n,i),o.cause=e,o.name=e.name,a&&Object.assign(o,a),o};function Tj(e){return vj.isPlainObject(e)||vj.isArray(e)}function Aj(e){return vj.endsWith(e,"[]")?e.slice(0,-2):e}function Sj(e,t,r){return e?e.concat(t).map((function(e,t){return e=Aj(e),!r&&t?"["+e+"]":e})).join(r?".":""):t}const kj=vj.toFlatObject(vj,{},null,(function(e){return/^is[A-Z]/.test(e)}));function Oj(e,t,r){if(!vj.isObject(e))throw new TypeError("target must be an object");t=t||new FormData;const n=(r=vj.toFlatObject(r,{metaTokens:!0,dots:!1,indexes:!1},!1,(function(e,t){return!vj.isUndefined(t[e])}))).metaTokens,i=r.visitor||f,a=r.dots,o=r.indexes,s=(r.Blob||"undefined"!=typeof Blob&&Blob)&&vj.isSpecCompliantForm(t);if(!vj.isFunction(i))throw new TypeError("visitor must be a function");function u(e){if(null===e)return"";if(vj.isDate(e))return e.toISOString();if(!s&&vj.isBlob(e))throw new wj("Blob is not supported. Use a Buffer instead.");return vj.isArrayBuffer(e)||vj.isTypedArray(e)?s&&"function"==typeof Blob?new Blob([e]):Buffer.from(e):e}function f(e,r,i){let s=e;if(e&&!i&&"object"==typeof e)if(vj.endsWith(r,"{}"))r=n?r:r.slice(0,-2),e=JSON.stringify(e);else if(vj.isArray(e)&&function(e){return vj.isArray(e)&&!e.some(Tj)}(e)||(vj.isFileList(e)||vj.endsWith(r,"[]"))&&(s=vj.toArray(e)))return r=Aj(r),s.forEach((function(e,n){!vj.isUndefined(e)&&null!==e&&t.append(!0===o?Sj([r],n,a):null===o?r:r+"[]",u(e))})),!1;return!!Tj(e)||(t.append(Sj(i,r,a),u(e)),!1)}const c=[],l=Object.assign(kj,{defaultVisitor:f,convertValue:u,isVisitable:Tj});if(!vj.isObject(e))throw new TypeError("data must be an object");return function e(r,n){if(!vj.isUndefined(r)){if(-1!==c.indexOf(r))throw Error("Circular reference detected in "+n.join("."));c.push(r),vj.forEach(r,(function(r,a){!0===(!(vj.isUndefined(r)||null===r)&&i.call(t,r,vj.isString(a)?a.trim():a,n,l))&&e(r,n?n.concat(a):[a])})),c.pop()}}(e),t}function Rj(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,(function(e){return t[e]}))}function xj(e,t){this._pairs=[],e&&Oj(e,this,t)}const Ij=xj.prototype;function Cj(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function Nj(e,t,r){if(!t)return e;const n=r&&r.encode||Cj,i=r&&r.serialize;let a;if(a=i?i(t,r):vj.isURLSearchParams(t)?t.toString():new xj(t,r).toString(n),a){const t=e.indexOf("#");-1!==t&&(e=e.slice(0,t)),e+=(-1===e.indexOf("?")?"?":"&")+a}return e}Ij.append=function(e,t){this._pairs.push([e,t])},Ij.toString=function(e){const t=e?function(t){return e.call(this,t,Rj)}:Rj;return this._pairs.map((function(e){return t(e[0])+"="+t(e[1])}),"").join("&")};var Pj=class{constructor(){this.handlers=[]}use(e,t,r){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!r&&r.synchronous,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){vj.forEach(this.handlers,(function(t){null!==t&&e(t)}))}},Mj={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1};var Bj={isBrowser:!0,classes:{URLSearchParams:"undefined"!=typeof URLSearchParams?URLSearchParams:xj,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 Dj(e){function t(e,r,n,i){let a=e[i++];const o=Number.isFinite(+a),s=i>=e.length;if(a=!a&&vj.isArray(n)?n.length:a,s)return vj.hasOwnProp(n,a)?n[a]=[n[a],r]:n[a]=r,!o;n[a]&&vj.isObject(n[a])||(n[a]=[]);return t(e,r,n[a],i)&&vj.isArray(n[a])&&(n[a]=function(e){const t={},r=Object.keys(e);let n;const i=r.length;let a;for(n=0;n<i;n++)a=r[n],t[a]=e[a];return t}(n[a])),!o}if(vj.isFormData(e)&&vj.isFunction(e.entries)){const r={};return vj.forEachEntry(e,((e,n)=>{t(function(e){return vj.matchAll(/\w+|\[(\w*)]/g,e).map((e=>"[]"===e[0]?"":e[1]||e[0]))}(e),n,r,0)})),r}return null}const Fj={"Content-Type":void 0};const Lj={transitional:Mj,adapter:["xhr","http"],transformRequest:[function(e,t){const r=t.getContentType()||"",n=r.indexOf("application/json")>-1,i=vj.isObject(e);i&&vj.isHTMLForm(e)&&(e=new FormData(e));if(vj.isFormData(e))return n&&n?JSON.stringify(Dj(e)):e;if(vj.isArrayBuffer(e)||vj.isBuffer(e)||vj.isStream(e)||vj.isFile(e)||vj.isBlob(e))return e;if(vj.isArrayBufferView(e))return e.buffer;if(vj.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let a;if(i){if(r.indexOf("application/x-www-form-urlencoded")>-1)return function(e,t){return Oj(e,new Bj.classes.URLSearchParams,Object.assign({visitor:function(e,t,r,n){return Bj.isNode&&vj.isBuffer(e)?(this.append(t,e.toString("base64")),!1):n.defaultVisitor.apply(this,arguments)}},t))}(e,this.formSerializer).toString();if((a=vj.isFileList(e))||r.indexOf("multipart/form-data")>-1){const t=this.env&&this.env.FormData;return Oj(a?{"files[]":e}:e,t&&new t,this.formSerializer)}}return i||n?(t.setContentType("application/json",!1),function(e,t,r){if(vj.isString(e))try{return(t||JSON.parse)(e),vj.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(r||JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){const t=this.transitional||Lj.transitional,r=t&&t.forcedJSONParsing,n="json"===this.responseType;if(e&&vj.isString(e)&&(r&&!this.responseType||n)){const r=!(t&&t.silentJSONParsing)&&n;try{return JSON.parse(e)}catch(e){if(r){if("SyntaxError"===e.name)throw wj.from(e,wj.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:Bj.classes.FormData,Blob:Bj.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};vj.forEach(["delete","get","head"],(function(e){Lj.headers[e]={}})),vj.forEach(["post","put","patch"],(function(e){Lj.headers[e]=vj.merge(Fj)}));var Uj=Lj;const jj=vj.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 qj=Symbol("internals");function zj(e){return e&&String(e).trim().toLowerCase()}function Hj(e){return!1===e||null==e?e:vj.isArray(e)?e.map(Hj):String(e)}function Vj(e,t,r,n,i){return vj.isFunction(n)?n.call(this,t,r):(i&&(t=r),vj.isString(t)?vj.isString(n)?-1!==t.indexOf(n):vj.isRegExp(n)?n.test(t):void 0:void 0)}class Gj{constructor(e){e&&this.set(e)}set(e,t,r){const n=this;function i(e,t,r){const i=zj(t);if(!i)throw new Error("header name must be a non-empty string");const a=vj.findKey(n,i);(!a||void 0===n[a]||!0===r||void 0===r&&!1!==n[a])&&(n[a||t]=Hj(e))}const a=(e,t)=>vj.forEach(e,((e,r)=>i(e,r,t)));return vj.isPlainObject(e)||e instanceof this.constructor?a(e,t):vj.isString(e)&&(e=e.trim())&&!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim())?a((e=>{const t={};let r,n,i;return e&&e.split("\n").forEach((function(e){i=e.indexOf(":"),r=e.substring(0,i).trim().toLowerCase(),n=e.substring(i+1).trim(),!r||t[r]&&jj[r]||("set-cookie"===r?t[r]?t[r].push(n):t[r]=[n]:t[r]=t[r]?t[r]+", "+n:n)})),t})(e),t):null!=e&&i(t,e,r),this}get(e,t){if(e=zj(e)){const r=vj.findKey(this,e);if(r){const e=this[r];if(!t)return e;if(!0===t)return function(e){const t=Object.create(null),r=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let n;for(;n=r.exec(e);)t[n[1]]=n[2];return t}(e);if(vj.isFunction(t))return t.call(this,e,r);if(vj.isRegExp(t))return t.exec(e);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=zj(e)){const r=vj.findKey(this,e);return!(!r||void 0===this[r]||t&&!Vj(0,this[r],r,t))}return!1}delete(e,t){const r=this;let n=!1;function i(e){if(e=zj(e)){const i=vj.findKey(r,e);!i||t&&!Vj(0,r[i],i,t)||(delete r[i],n=!0)}}return vj.isArray(e)?e.forEach(i):i(e),n}clear(e){const t=Object.keys(this);let r=t.length,n=!1;for(;r--;){const i=t[r];e&&!Vj(0,this[i],i,e,!0)||(delete this[i],n=!0)}return n}normalize(e){const t=this,r={};return vj.forEach(this,((n,i)=>{const a=vj.findKey(r,i);if(a)return t[a]=Hj(n),void delete t[i];const o=e?function(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,((e,t,r)=>t.toUpperCase()+r))}(i):String(i).trim();o!==i&&delete t[i],t[o]=Hj(n),r[o]=!0})),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const t=Object.create(null);return vj.forEach(this,((r,n)=>{null!=r&&!1!==r&&(t[n]=e&&vj.isArray(r)?r.join(", "):r)})),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 r=new this(e);return t.forEach((e=>r.set(e))),r}static accessor(e){const t=(this[qj]=this[qj]={accessors:{}}).accessors,r=this.prototype;function n(e){const n=zj(e);t[n]||(!function(e,t){const r=vj.toCamelCase(" "+t);["get","set","has"].forEach((n=>{Object.defineProperty(e,n+r,{value:function(e,r,i){return this[n].call(this,t,e,r,i)},configurable:!0})}))}(r,e),t[n]=!0)}return vj.isArray(e)?e.forEach(n):n(e),this}}Gj.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),vj.freezeMethods(Gj.prototype),vj.freezeMethods(Gj);var Wj=Gj;function Kj(e,t){const r=this||Uj,n=t||r,i=Wj.from(n.headers);let a=n.data;return vj.forEach(e,(function(e){a=e.call(r,a,i.normalize(),t?t.status:void 0)})),i.normalize(),a}function Xj(e){return!(!e||!e.__CANCEL__)}function $j(e,t,r){wj.call(this,null==e?"canceled":e,wj.ERR_CANCELED,t,r),this.name="CanceledError"}vj.inherits($j,wj,{__CANCEL__:!0});var Jj=Bj.isStandardBrowserEnv?{write:function(e,t,r,n,i,a){const o=[];o.push(e+"="+encodeURIComponent(t)),vj.isNumber(r)&&o.push("expires="+new Date(r).toGMTString()),vj.isString(n)&&o.push("path="+n),vj.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 Yj(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 Qj=Bj.isStandardBrowserEnv?function(){const e=/(msie|trident)/i.test(navigator.userAgent),t=document.createElement("a");let r;function n(r){let n=r;return e&&(t.setAttribute("href",n),n=t.href),t.setAttribute("href",n),{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 r=n(window.location.href),function(e){const t=vj.isString(e)?n(e):e;return t.protocol===r.protocol&&t.host===r.host}}():function(){return!0};function Zj(e,t){let r=0;const n=function(e,t){e=e||10;const r=new Array(e),n=new Array(e);let i,a=0,o=0;return t=void 0!==t?t:1e3,function(s){const u=Date.now(),f=n[o];i||(i=u),r[a]=s,n[a]=u;let c=o,l=0;for(;c!==a;)l+=r[c++],c%=e;if(a=(a+1)%e,a===o&&(o=(o+1)%e),u-i<t)return;const d=f&&u-f;return d?Math.round(1e3*l/d):void 0}}(50,250);return i=>{const a=i.loaded,o=i.lengthComputable?i.total:void 0,s=a-r,u=n(s);r=a;const f={loaded:a,total:o,progress:o?a/o:void 0,bytes:s,rate:u||void 0,estimated:u&&o&&a<=o?(o-a)/u:void 0,event:i};f[t?"download":"upload"]=!0,e(f)}}var eq="undefined"!=typeof XMLHttpRequest&&function(e){return new Promise((function(t,r){let n=e.data;const i=Wj.from(e.headers).normalize(),a=e.responseType;let o;function s(){e.cancelToken&&e.cancelToken.unsubscribe(o),e.signal&&e.signal.removeEventListener("abort",o)}vj.isFormData(n)&&(Bj.isStandardBrowserEnv||Bj.isStandardBrowserWebWorkerEnv?i.setContentType(!1):i.setContentType("multipart/form-data;",!1));let u=new XMLHttpRequest;if(e.auth){const t=e.auth.username||"",r=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";i.set("Authorization","Basic "+btoa(t+":"+r))}const f=Yj(e.baseURL,e.url);function c(){if(!u)return;const n=Wj.from("getAllResponseHeaders"in u&&u.getAllResponseHeaders());!function(e,t,r){const n=r.config.validateStatus;r.status&&n&&!n(r.status)?t(new wj("Request failed with status code "+r.status,[wj.ERR_BAD_REQUEST,wj.ERR_BAD_RESPONSE][Math.floor(r.status/100)-4],r.config,r.request,r)):e(r)}((function(e){t(e),s()}),(function(e){r(e),s()}),{data:a&&"text"!==a&&"json"!==a?u.response:u.responseText,status:u.status,statusText:u.statusText,headers:n,config:e,request:u}),u=null}if(u.open(e.method.toUpperCase(),Nj(f,e.params,e.paramsSerializer),!0),u.timeout=e.timeout,"onloadend"in u?u.onloadend=c:u.onreadystatechange=function(){u&&4===u.readyState&&(0!==u.status||u.responseURL&&0===u.responseURL.indexOf("file:"))&&setTimeout(c)},u.onabort=function(){u&&(r(new wj("Request aborted",wj.ECONNABORTED,e,u)),u=null)},u.onerror=function(){r(new wj("Network Error",wj.ERR_NETWORK,e,u)),u=null},u.ontimeout=function(){let t=e.timeout?"timeout of "+e.timeout+"ms exceeded":"timeout exceeded";const n=e.transitional||Mj;e.timeoutErrorMessage&&(t=e.timeoutErrorMessage),r(new wj(t,n.clarifyTimeoutError?wj.ETIMEDOUT:wj.ECONNABORTED,e,u)),u=null},Bj.isStandardBrowserEnv){const t=(e.withCredentials||Qj(f))&&e.xsrfCookieName&&Jj.read(e.xsrfCookieName);t&&i.set(e.xsrfHeaderName,t)}void 0===n&&i.setContentType(null),"setRequestHeader"in u&&vj.forEach(i.toJSON(),(function(e,t){u.setRequestHeader(t,e)})),vj.isUndefined(e.withCredentials)||(u.withCredentials=!!e.withCredentials),a&&"json"!==a&&(u.responseType=e.responseType),"function"==typeof e.onDownloadProgress&&u.addEventListener("progress",Zj(e.onDownloadProgress,!0)),"function"==typeof e.onUploadProgress&&u.upload&&u.upload.addEventListener("progress",Zj(e.onUploadProgress)),(e.cancelToken||e.signal)&&(o=t=>{u&&(r(!t||t.type?new $j(null,e,u):t),u.abort(),u=null)},e.cancelToken&&e.cancelToken.subscribe(o),e.signal&&(e.signal.aborted?o():e.signal.addEventListener("abort",o)));const l=function(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}(f);l&&-1===Bj.protocols.indexOf(l)?r(new wj("Unsupported protocol "+l+":",wj.ERR_BAD_REQUEST,e)):u.send(n||null)}))};const tq={http:null,xhr:eq};vj.forEach(tq,((e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch(e){}Object.defineProperty(e,"adapterName",{value:t})}}));var rq=e=>{e=vj.isArray(e)?e:[e];const{length:t}=e;let r,n;for(let i=0;i<t&&(r=e[i],!(n=vj.isString(r)?tq[r.toLowerCase()]:r));i++);if(!n){if(!1===n)throw new wj(`Adapter ${r} is not supported by the environment`,"ERR_NOT_SUPPORT");throw new Error(vj.hasOwnProp(tq,r)?`Adapter '${r}' is not available in the build`:`Unknown adapter '${r}'`)}if(!vj.isFunction(n))throw new TypeError("adapter is not a function");return n};function nq(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new $j(null,e)}function iq(e){nq(e),e.headers=Wj.from(e.headers),e.data=Kj.call(e,e.transformRequest),-1!==["post","put","patch"].indexOf(e.method)&&e.headers.setContentType("application/x-www-form-urlencoded",!1);return rq(e.adapter||Uj.adapter)(e).then((function(t){return nq(e),t.data=Kj.call(e,e.transformResponse,t),t.headers=Wj.from(t.headers),t}),(function(t){return Xj(t)||(nq(e),t&&t.response&&(t.response.data=Kj.call(e,e.transformResponse,t.response),t.response.headers=Wj.from(t.response.headers))),Promise.reject(t)}))}const aq=e=>e instanceof Wj?e.toJSON():e;function oq(e,t){t=t||{};const r={};function n(e,t,r){return vj.isPlainObject(e)&&vj.isPlainObject(t)?vj.merge.call({caseless:r},e,t):vj.isPlainObject(t)?vj.merge({},t):vj.isArray(t)?t.slice():t}function i(e,t,r){return vj.isUndefined(t)?vj.isUndefined(e)?void 0:n(void 0,e,r):n(e,t,r)}function a(e,t){if(!vj.isUndefined(t))return n(void 0,t)}function o(e,t){return vj.isUndefined(t)?vj.isUndefined(e)?void 0:n(void 0,e):n(void 0,t)}function s(r,i,a){return a in t?n(r,i):a in e?n(void 0,r):void 0}const u={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(aq(e),aq(t),!0)};return vj.forEach(Object.keys(Object.assign({},e,t)),(function(n){const a=u[n]||i,o=a(e[n],t[n],n);vj.isUndefined(o)&&a!==s||(r[n]=o)})),r}const sq="1.4.0",uq={};["object","boolean","number","function","string","symbol"].forEach(((e,t)=>{uq[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}}));const fq={};uq.transitional=function(e,t,r){function n(e,t){return"[Axios v1.4.0] Transitional option '"+e+"'"+t+(r?". "+r:"")}return(r,i,a)=>{if(!1===e)throw new wj(n(i," has been removed"+(t?" in "+t:"")),wj.ERR_DEPRECATED);return t&&!fq[i]&&(fq[i]=!0,console.warn(n(i," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(r,i,a)}};var cq={assertOptions:function(e,t,r){if("object"!=typeof e)throw new wj("options must be an object",wj.ERR_BAD_OPTION_VALUE);const n=Object.keys(e);let i=n.length;for(;i-- >0;){const a=n[i],o=t[a];if(o){const t=e[a],r=void 0===t||o(t,a,e);if(!0!==r)throw new wj("option "+a+" must be "+r,wj.ERR_BAD_OPTION_VALUE)}else if(!0!==r)throw new wj("Unknown option "+a,wj.ERR_BAD_OPTION)}},validators:uq};const lq=cq.validators;class dq{constructor(e){this.defaults=e,this.interceptors={request:new Pj,response:new Pj}}request(e,t){"string"==typeof e?(t=t||{}).url=e:t=e||{},t=oq(this.defaults,t);const{transitional:r,paramsSerializer:n,headers:i}=t;let a;void 0!==r&&cq.assertOptions(r,{silentJSONParsing:lq.transitional(lq.boolean),forcedJSONParsing:lq.transitional(lq.boolean),clarifyTimeoutError:lq.transitional(lq.boolean)},!1),null!=n&&(vj.isFunction(n)?t.paramsSerializer={serialize:n}:cq.assertOptions(n,{encode:lq.function,serialize:lq.function},!0)),t.method=(t.method||this.defaults.method||"get").toLowerCase(),a=i&&vj.merge(i.common,i[t.method]),a&&vj.forEach(["delete","get","head","post","put","patch","common"],(e=>{delete i[e]})),t.headers=Wj.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 u=[];let f;this.interceptors.response.forEach((function(e){u.push(e.fulfilled,e.rejected)}));let c,l=0;if(!s){const e=[iq.bind(this),void 0];for(e.unshift.apply(e,o),e.push.apply(e,u),c=e.length,f=Promise.resolve(t);l<c;)f=f.then(e[l++],e[l++]);return f}c=o.length;let d=t;for(l=0;l<c;){const e=o[l++],t=o[l++];try{d=e(d)}catch(e){t.call(this,e);break}}try{f=iq.call(this,d)}catch(e){return Promise.reject(e)}for(l=0,c=u.length;l<c;)f=f.then(u[l++],u[l++]);return f}getUri(e){return Nj(Yj((e=oq(this.defaults,e)).baseURL,e.url),e.params,e.paramsSerializer)}}vj.forEach(["delete","get","head","options"],(function(e){dq.prototype[e]=function(t,r){return this.request(oq(r||{},{method:e,url:t,data:(r||{}).data}))}})),vj.forEach(["post","put","patch"],(function(e){function t(t){return function(r,n,i){return this.request(oq(i||{},{method:e,headers:t?{"Content-Type":"multipart/form-data"}:{},url:r,data:n}))}}dq.prototype[e]=t(),dq.prototype[e+"Form"]=t(!0)}));var pq=dq;class hq{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 r=this;this.promise.then((e=>{if(!r._listeners)return;let t=r._listeners.length;for(;t-- >0;)r._listeners[t](e);r._listeners=null})),this.promise.then=e=>{let t;const n=new Promise((e=>{r.subscribe(e),t=e})).then(e);return n.cancel=function(){r.unsubscribe(t)},n},e((function(e,n,i){r.reason||(r.reason=new $j(e,n,i),t(r.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 hq((function(t){e=t}));return{token:t,cancel:e}}}var mq=hq;const yq={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(yq).forEach((([e,t])=>{yq[t]=e}));var bq=yq;const gq=function e(t){const r=new pq(t),n=qU(pq.prototype.request,r);return vj.extend(n,pq.prototype,r,{allOwnKeys:!0}),vj.extend(n,r,null,{allOwnKeys:!0}),n.create=function(r){return e(oq(t,r))},n}(Uj);gq.Axios=pq,gq.CanceledError=$j,gq.CancelToken=mq,gq.isCancel=Xj,gq.VERSION=sq,gq.toFormData=Oj,gq.AxiosError=wj,gq.Cancel=gq.CanceledError,gq.all=function(e){return Promise.all(e)},gq.spread=function(e){return function(t){return e.apply(null,t)}},gq.isAxiosError=function(e){return vj.isObject(e)&&!0===e.isAxiosError},gq.mergeConfig=oq,gq.AxiosHeaders=Wj,gq.formToJSON=e=>Dj(vj.isHTMLForm(e)?new FormData(e):e),gq.HttpStatusCode=bq,gq.default=gq;var vq=gq;const wq="https://guardian.sandbox.imtbl.com".replace(/\/+$/,"");class _q{basePath;axios;configuration;constructor(e,t=wq,r=vq){this.basePath=t,this.axios=r,e&&(this.configuration=e,this.basePath=e.basePath||this.basePath)}}class Eq extends Error{field;name="RequiredError";constructor(e,t){super(t),this.field=e}}const Tq="https://example.com",Aq=function(e,t,r){if(null==r)throw new Eq(t,`Required parameter ${t} was null or undefined when calling ${e}.`)},Sq=async function(e,t){if(t&&t.accessToken){const r="function"==typeof t.accessToken?await t.accessToken():await t.accessToken;e.Authorization="Bearer "+r}};function kq(e,t,r=""){"object"==typeof t?Array.isArray(t)?t.forEach((t=>kq(e,t,r))):Object.keys(t).forEach((n=>kq(e,t[n],`${r}${""!==r?".":""}${n}`))):e.has(r)?e.append(r,t):e.set(r,t)}const Oq=function(e,...t){const r=new URLSearchParams(e.search);kq(r,t),e.search=r.toString()},Rq=function(e,t,r){const n="string"!=typeof e;return(n&&r&&r.isJsonMime?r.isJsonMime(t.headers["Content-Type"]):n)?JSON.stringify(void 0!==e?e:{}):e||""},xq=function(e){return e.pathname+e.search+e.hash},Iq=function(e,t,r,n){return(i=t,a=r)=>{const o={...e.options,url:(n?.basePath||a)+e.url};return i.request(o)}},Cq=function(e){const t=function(e){return{approvePendingTransaction:async(t,r,n={})=>{Aq("approvePendingTransaction","payloadHash",t),Aq("approvePendingTransaction","transactionApprovalRequest",r);const i="/guardian/v1/transactions/{payloadHash}/approve".replace("{payloadHash}",encodeURIComponent(String(t))),a=new URL(i,Tq);let o;e&&(o=e.baseOptions);const s={method:"POST",...o,...n},u={};await Sq(u,e),u["Content-Type"]="application/json",Oq(a,{});let f=o&&o.headers?o.headers:{};return s.headers={...u,...f,...n.headers},s.data=Rq(r,s,e),{url:xq(a),options:s}},evaluateTransaction:async(t,r,n={})=>{Aq("evaluateTransaction","id",t),Aq("evaluateTransaction","transactionEvaluationRequest",r);const i="/guardian/v1/transactions/{id}/evaluate".replace("{id}",encodeURIComponent(String(t))),a=new URL(i,Tq);let o;e&&(o=e.baseOptions);const s={method:"POST",...o,...n},u={};await Sq(u,e),u["Content-Type"]="application/json",Oq(a,{});let f=o&&o.headers?o.headers:{};return s.headers={...u,...f,...n.headers},s.data=Rq(r,s,e),{url:xq(a),options:s}},getTransactionByID:async(t,r,n,i={})=>{Aq("getTransactionByID","transactionID",t),Aq("getTransactionByID","chainType",r);const a="/guardian/v1/transactions/{transactionID}".replace("{transactionID}",encodeURIComponent(String(t))),o=new URL(a,Tq);let s;e&&(s=e.baseOptions);const u={method:"GET",...s,...i},f={},c={};await Sq(f,e),void 0!==r&&(c.chainType=r),void 0!==n&&(c.chainID=n),Oq(o,c);let l=s&&s.headers?s.headers:{};return u.headers={...f,...l,...i.headers},{url:xq(o),options:u}}}}(e);return{async approvePendingTransaction(r,n,i){const a=await t.approvePendingTransaction(r,n,i);return Iq(a,vq,wq,e)},async evaluateTransaction(r,n,i){const a=await t.evaluateTransaction(r,n,i);return Iq(a,vq,wq,e)},async getTransactionByID(r,n,i,a){const o=await t.getTransactionByID(r,n,i,a);return Iq(o,vq,wq,e)}}};class Nq extends _q{approvePendingTransaction(e,t){return Cq(this.configuration).approvePendingTransaction(e.payloadHash,e.transactionApprovalRequest,t).then((e=>e(this.axios,this.basePath)))}evaluateTransaction(e,t){return Cq(this.configuration).evaluateTransaction(e.id,e.transactionEvaluationRequest,t).then((e=>e(this.axios,this.basePath)))}getTransactionByID(e,t){return Cq(this.configuration).getTransactionByID(e.transactionID,e.chainType,e.chainID,t).then((e=>e(this.axios,this.basePath)))}}class Pq{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())}}function Mq(e){const t=-1!==new di(e,16).cmp(new di(27))?new di(e,16).sub(new di(27)).toNumber():new di(e,16).toNumber();return e.trim()?t:void 0}async function Bq(e,t){const r=function(e,t=64){const r=Cb(e);return{r:new di(r.substring(0,t),"hex"),s:new di(r.substring(t,2*t),"hex"),recoveryParam:Mq(r.substring(2*t,2*t+2))}}(await t.signMessage(e));return Pb(xb((n=r).r.toString(16),64)+xb(n.s.toString(16),64)+xb(n.recoveryParam?.toString(16)||"",2));var n}function Dq(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 Fq={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 Lq(){return Lq=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Lq.apply(this,arguments)}var Uq;!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"}(Uq||(Uq={}));function jq(e,t){return function(...r){const n=Array.prototype.slice.call(r);return new Promise((async(r,i)=>{try{n.push(((e,t)=>e?i(e):r(t))),await e.apply(t,n)}catch(e){i(e)}}))}}new class{constructor(e){this.config=e,this.logLevel=void 0,this.configure(e)}configure(e){switch(this.config=Lq({},this.config,e),this.config.logLevel){case"DEBUG":this.logLevel=Uq.DEBUG;break;case"INFO":default:this.logLevel=Uq.INFO;break;case"WARN":this.logLevel=Uq.WARN;break;case"ERROR":this.logLevel=Uq.ERROR;break;case"DISABLED":this.logLevel=Uq.DISABLED}void 0===this.config.silence&&(this.config.silence=!1)}debug(e,...t){!0!==this.config.silence&&this.logLevel===Uq.DEBUG&&console.log(e,...t)}info(e,...t){!0!==this.config.silence&&this.logLevel<=Uq.INFO&&console.log(e,...t)}warn(e,...t){!0!==this.config.silence&&this.logLevel<=Uq.WARN&&(console.warn(e,...t),this.config.onwarn&&this.config.onwarn(e,t))}error(e,...t){!0!==this.config.silence&&this.logLevel<=Uq.ERROR&&(console.error(e,...t),this.config.onerror&&this.config.onerror(e,t))}}({logLevel:"INFO",silence:!0});const qq=(e=0,t=Number.MAX_SAFE_INTEGER)=>(e=Math.ceil(e),t=Math.floor(t),Math.floor(Math.random()*(t-e+1))+e);function zq(){return zq=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},zq.apply(this,arguments)}const Hq=(e,t=!1)=>(((e,t=!1,r=!1)=>{if(!e)throw new Error("invalid network config: empty config");const n=[];if(Array.isArray(e)?n.push(...e):n.push(e),0===n.length){if(t)throw new Error("invalid network config: empty config");return!1}const i=n.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}n.forEach((e=>e.name=e.name.toLowerCase()));const o=n.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 u=!1,f=!1;for(let e=0;e<n.length;e++){const i=n[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(!r&&!i.relayer){if(t)throw new Error(`invalid network config for chainId ${i.chainId}: relayer must be provided`);return!1}if(i.isDefaultChain){if(u){if(t)throw new Error(`invalid network config for chainId ${i.chainId}: DefaultChain is already set by another config`);return!1}u=!0}if(i.isAuthChain){if(f&&t)throw new Error(`invalid network config for chainId ${i.chainId}: AuthChain is already set by another config`);f=!0}}if(!u){if(t)throw new Error("invalid network config: DefaultChain must be set");return!1}if(!f){if(t)throw new Error("invalid network config: AuthChain must be set");return!1}})(e,!0,t),e),Vq=e=>Hq(Gq(e)),Gq=e=>{if(!e)return[];const t=e.sort(((e,t)=>e.chainId===t.chainId?0:e.chainId<t.chainId?-1:1)),r=t.findIndex((e=>e.isDefaultChain));r>0&&t.splice(0,0,t.splice(r,1)[0]);const n=t.findIndex((e=>e.isAuthChain&&!0!==e.isDefaultChain));return n>0&&t.splice(1,0,t.splice(n,1)[0]),t},Wq=(e,t)=>"string"==typeof e?(t=t||{},e.replace(/\$\{\s*([$#@\-\d\w]+)\s*\}/gim,(function(e,r){let n=t[r];return n="function"==typeof n?n():null==n?"":"object"==typeof n||"symbol"==typeof n?n.toString():n.valueOf(),n}))):"";let Kq;!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"}(Kq||(Kq={}));const Xq=e=>Wq("https://${network}-indexer.sequence.app",{network:e}),$q=e=>Wq("https://${network}-relayer.sequence.app",{network:e}),Jq=e=>Wq("https://nodes.sequence.app/${network}",{network:e}),Yq={[Kq.MAINNET]:{chainId:Kq.MAINNET,name:"mainnet",title:"Ethereum",blockExplorer:{name:"Etherscan",rootUrl:"https://etherscan.io/"},ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e"},[Kq.ROPSTEN]:{chainId:Kq.ROPSTEN,name:"ropsten",title:"Ropsten",testnet:!0,blockExplorer:{name:"Etherscan (Ropsten)",rootUrl:"https://ropsten.etherscan.io/"},ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e"},[Kq.RINKEBY]:{chainId:Kq.RINKEBY,name:"rinkeby",title:"Rinkeby",testnet:!0,blockExplorer:{name:"Etherscan (Rinkeby)",rootUrl:"https://rinkeby.etherscan.io/"},ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",disabled:!0},[Kq.GOERLI]:{chainId:Kq.GOERLI,name:"goerli",title:"Goerli",testnet:!0,blockExplorer:{name:"Etherscan (Goerli)",rootUrl:"https://goerli.etherscan.io/"},ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e"},[Kq.KOVAN]:{chainId:Kq.KOVAN,name:"kovan",title:"Kovan",testnet:!0,blockExplorer:{name:"Etherscan (Kovan)",rootUrl:"https://kovan.etherscan.io/"}},[Kq.POLYGON]:{chainId:Kq.POLYGON,name:"polygon",title:"Polygon",blockExplorer:{name:"Polygonscan",rootUrl:"https://polygonscan.com/"}},[Kq.POLYGON_MUMBAI]:{chainId:Kq.POLYGON_MUMBAI,name:"mumbai",title:"Polygon Mumbai",testnet:!0,blockExplorer:{name:"Polygonscan (Mumbai)",rootUrl:"https://mumbai.polygonscan.com/"}},[Kq.POLYGON_ZKEVM]:{chainId:Kq.POLYGON_ZKEVM,name:"polygon-zkevm",title:"Polygon zkEVM",blockExplorer:{name:"Polygonscan (zkEVM)",rootUrl:"https://zkevm.polygonscan.com/"}},[Kq.BSC]:{chainId:Kq.BSC,name:"bsc",title:"BNB Smart Chain",blockExplorer:{name:"BSCScan",rootUrl:"https://bscscan.com/"}},[Kq.BSC_TESTNET]:{chainId:Kq.BSC_TESTNET,name:"bsc-testnet",title:"BNB Smart Chain Testnet",testnet:!0,blockExplorer:{name:"BSCScan (Testnet)",rootUrl:"https://testnet.bscscan.com/"}},[Kq.OPTIMISM]:{chainId:Kq.OPTIMISM,name:"optimism",title:"Optimism",blockExplorer:{name:"Etherscan (Optimism)",rootUrl:"https://optimistic.etherscan.io/"}},[Kq.OPTIMISM_TESTNET]:{chainId:Kq.OPTIMISM_TESTNET,name:"optimism-testnet",title:"Optimistic Kovan",testnet:!0,blockExplorer:{name:"Etherscan (Optimism Testnet)",rootUrl:"https://kovan-optimistic.etherscan.io/"}},[Kq.ARBITRUM]:{chainId:Kq.ARBITRUM,name:"arbitrum",title:"Arbitrum One",blockExplorer:{name:"Arbiscan",rootUrl:"https://arbiscan.io/"}},[Kq.ARBITRUM_GOERLI]:{chainId:Kq.ARBITRUM_GOERLI,name:"arbitrum-goerli",title:"Arbitrum Goerli",testnet:!0,blockExplorer:{name:"Arbiscan (Testnet)",rootUrl:"https://testnet.arbiscan.io/"}},[Kq.ARBITRUM_NOVA]:{chainId:Kq.ARBITRUM_NOVA,name:"arbitrum-nova",title:"Arbitrum Nova",blockExplorer:{name:"Nova Explorer",rootUrl:"https://nova-explorer.arbitrum.io/"}},[Kq.AVALANCHE]:{chainId:Kq.AVALANCHE,name:"avalanche",title:"Avalanche",blockExplorer:{name:"Snowtrace",rootUrl:"https://snowtrace.io/"}},[Kq.AVALANCHE_TESTNET]:{chainId:Kq.AVALANCHE_TESTNET,name:"avalanche-testnet",title:"Avalanche Testnet",testnet:!0,blockExplorer:{name:"Snowtrace (Testnet)",rootUrl:"https://testnet.snowtrace.io/"}},[Kq.FANTOM]:{chainId:Kq.FANTOM,name:"fantom",title:"Fantom",blockExplorer:{name:"FTMScan",rootUrl:"https://ftmscan.com/"}},[Kq.FANTOM_TESTNET]:{chainId:Kq.FANTOM_TESTNET,name:"fantom-testnet",title:"Fantom Testnet",testnet:!0,blockExplorer:{name:"FTMScan (Testnet)",rootUrl:"https://testnet.ftmscan.com/"}},[Kq.GNOSIS]:{chainId:Kq.GNOSIS,name:"gnosis",title:"Gnosis Chain",blockExplorer:{name:"Gnosis Chain Explorer",rootUrl:"https://blockscout.com/xdai/mainnet/"}},[Kq.AURORA]:{chainId:Kq.AURORA,name:"aurora",title:"Aurora",blockExplorer:{name:"Aurora Explorer",rootUrl:"https://aurorascan.dev/"}},[Kq.AURORA_TESTNET]:{chainId:Kq.AURORA_TESTNET,name:"aurora-testnet",title:"Aurora Testnet",blockExplorer:{name:"Aurora Explorer (Testnet)",rootUrl:"https://testnet.aurorascan.dev/"}},[Kq.BASE_GOERLI]:{chainId:Kq.BASE_GOERLI,name:"base-goerli",title:"Base Goerli",blockExplorer:{name:"Base Goerli Explorer",rootUrl:"https://goerli.basescan.org/"}}};Vq([zq({},Yq[Kq.MAINNET],{rpcUrl:Jq("mainnet"),relayer:{url:$q("mainnet")},indexerUrl:Xq("mainnet")}),zq({},Yq[Kq.POLYGON],{rpcUrl:Jq("polygon"),relayer:{url:$q("polygon")},indexerUrl:Xq("polygon"),isDefaultChain:!0,isAuthChain:!0}),zq({},Yq[Kq.BSC],{rpcUrl:Jq("bsc"),indexerUrl:Xq("bsc"),relayer:{url:$q("bsc")}}),zq({},Yq[Kq.AVALANCHE],{rpcUrl:Jq("avalanche"),indexerUrl:Xq("avalanche"),relayer:{url:$q("avalanche")}}),zq({},Yq[Kq.ARBITRUM],{rpcUrl:Jq("arbitrum"),indexerUrl:Xq("arbitrum"),relayer:{url:$q("arbitrum")}}),zq({},Yq[Kq.ARBITRUM_NOVA],{rpcUrl:Jq("arbitrum-nova"),indexerUrl:Xq("arbitrum-nova"),relayer:{url:$q("arbitrum-nova")}}),zq({},Yq[Kq.OPTIMISM],{rpcUrl:Jq("optimism"),indexerUrl:Xq("optimism"),relayer:{url:$q("optimism")}}),zq({},Yq[Kq.POLYGON_ZKEVM],{rpcUrl:Jq("polygon-zkevm"),indexerUrl:Xq("polygon-zkevm"),relayer:{url:$q("polygon-zkevm")}}),zq({},Yq[Kq.GNOSIS],{rpcUrl:Jq("gnosis"),indexerUrl:Xq("gnosis"),relayer:{url:$q("gnosis")}})]),Vq([zq({},Yq[Kq.RINKEBY],{rpcUrl:Jq("rinkeby"),relayer:{url:$q("rinkeby")},indexerUrl:Xq("rinkeby")}),zq({},Yq[Kq.GOERLI],{rpcUrl:Jq("goerli"),relayer:{url:$q("goerli")},indexerUrl:Xq("goerli")}),zq({},Yq[Kq.POLYGON_MUMBAI],{rpcUrl:Jq("mumbai"),relayer:{url:$q("mumbai")},indexerUrl:Xq("mumbai"),isDefaultChain:!0,isAuthChain:!0}),zq({},Yq[Kq.BSC_TESTNET],{rpcUrl:Jq("bsc-testnet"),relayer:{url:$q("bsc-testnet")},indexerUrl:Xq("bsc-testnet")}),zq({},Yq[Kq.ARBITRUM_GOERLI],{rpcUrl:Jq("arbitrum-goerli"),relayer:{url:$q("arbitrum-goerli")},indexerUrl:Xq("arbitrum-goerli")}),zq({},Yq[Kq.BASE_GOERLI],{rpcUrl:Jq("base-goerli"),relayer:{url:$q("base-goerli")},indexerUrl:Xq("base-goerli")})]);const Qq="2.0";function Zq(){return Zq=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Zq.apply(this,arguments)}let ez;function tz(e,t){return e.reduce((function(e,r,n){return t(r,n)?e[0].push(r):e[1].push(r),e}),[[],[]])}!function(e){e.ethCall="eth_call",e.ethGetBalance="eth_getBalance",e.ethGetCode="eth_getCode"}(ez||(ez={}));const rz={batchSize:50,timeWindow:50,contract:"0xd130B43062D875a4B7aF3f8fc036Bc6e9D3E1B3E",verbose:!1};let nz=class e{constructor(t){var r=this;if(this.batchableJsonRpcMethods=[ez.ethCall,ez.ethGetCode,ez.ethGetBalance],this.multicallInterface=new Bu(Fq.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,r)=>this.batchableJsonRpcMethods.find((e=>e===t.method))?(this.queue.push({request:t,callback:r,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,r)),this.run=async function(){r.options.verbose&&console.log("Processing multicall");const e=Math.min(r.options.batchSize,r.queue.length);if(0===e)return;if(1===e)return r.forward(r.queue[0]),r.queue=[],void(r.options.verbose&&console.log("Skip multicall, single item"));r.options.verbose&&console.log("Resolving",e);var t=r.queue.slice(0,e);r.queue=e===r.queue.length?[]:r.queue.slice(e),r.options.verbose&&console.log("Updated queue",r.queue.length),0!==r.queue.length&&r.scheduleExecution();const n=t[0].next;let i;var[t,a]=tz(t,(e=>{try{if(e.next!==n)return!1;switch(e.request.method){case ez.ethCall:if(e.request.params[0].from||e.request.params[0].gasPrice||e.request.params[0].value)return!1;case ez.ethGetBalance:case ez.ethGetCode:const t=function(e){if(void 0===e)return"latest";switch(e){case"earliest":case"latest":case"pending":return e}return Qi.from(e)}(e.request.params[1]);if(void 0===i&&(i=t),!function(e,t){return e===t||(Qi.isBigNumber(e)?!!Qi.isBigNumber(t)&&e.eq(t):!Qi.isBigNumber(t)&&e===t)}(t,i))return!1}return!0}catch(e){return!1}}));if(0!==a.length&&(r.options.verbose&&console.log("Forwarding incompatible calls",a.length),r.forward(a),0===t.length))return;let o=t.map((e=>{try{switch(e.request.method){case ez.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 ez.ethGetCode:return{delegateCall:!1,revertOnError:!1,target:r.options.contract,gasLimit:0,value:0,data:r.multicallInterface.encodeFunctionData(r.multicallInterface.getFunction("callCode"),[e.request.params[0]])};case ez.ethGetBalance:return{delegateCall:!1,revertOnError:!1,target:r.options.contract,gasLimit:0,value:0,data:r.multicallInterface.encodeFunctionData(r.multicallInterface.getFunction("callBalanceOf"),[e.request.params[0]])};default:return null}}catch(e){return null}}));var[t,a]=tz(t,((e,t)=>void 0!==o[t]));if(o=o.filter((e=>e)),0!==a.length&&(r.options.verbose&&console.log("Forwarding calls on error",a.length),r.forward(a),0===t.length))return;let s;try{s=r.multicallInterface.encodeFunctionData(r.multicallInterface.getFunction("multiCall"),[o])}catch(e){return void r.forward(t)}const u=qq(),f=await async function(e,t){try{return await e}catch(e){return t instanceof Function?t(e):t}}(jq(n)({id:u,jsonrpc:Qq,method:ez.ethCall,params:[{to:r.options.contract,value:0,data:s},Qi.isBigNumber(i)?i.toNumber():i]}),(e=>({jsonrpc:Qq,id:u,result:void 0,error:e})));if(f.error)return r.forward(t);let c;try{c=r.multicallInterface.decodeFunctionResult(r.multicallInterface.getFunction("multiCall"),f.result)}catch(e){return void r.forward(t)}r.options.verbose&&console.log("Got response for",t.length),t.forEach(((e,t)=>{if(c[0][t])switch(e.request.method){case ez.ethCall:e.callback(void 0,{jsonrpc:e.request.jsonrpc,id:e.request.id,result:c[1][t]});break;case ez.ethGetCode:e.callback(void 0,{jsonrpc:e.request.jsonrpc,id:e.request.id,result:xs.decode(["bytes"],c[1][t])[0]});break;case ez.ethGetBalance:e.callback(void 0,{jsonrpc:e.request.jsonrpc,id:e.request.id,result:xs.decode(["uint256"],c[1][t])[0]})}else r.forward(e)}))},this.options=t?Zq({},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}};nz.DefaultOptions=Zq({},rz);const iz=["getNetwork","getBlockNumber","getGasPrice","getTransactionCount","getStorageAt","sendTransaction","estimateGas","getBlock","getTransaction","getTransactionReceipt","getLogs","emit","litenerCount","addListener","removeListener","waitForTransaction","detectNetwork","getBlockWithTransactions"];var az=Object.freeze({__proto__:null,ProxyMethods:iz,MulticallProvider:class extends Kh{constructor(e,t){var r;super(e.getNetwork()),r=this,this.provider=e,this.multicall=void 0,this.listenerCount=this.provider.listenerCount,this.getResolver=async function(e){const t=r.provider;if(t.getResolver){const n=await t.getResolver(await e);return n?new Vh(r,n.address,n.name):null}return t.getResolver(await e)},this.next=async function(e,t){try{switch(e.method){case ez.ethCall:r.callback(e,t,await r.provider.call(e.params[0],e.params[1]));break;case ez.ethGetCode:r.callback(e,t,await r.provider.getCode(e.params[0],e.params[1]));break;case ez.ethGetBalance:r.callback(e,t,await r.provider.getBalance(e.params[0],e.params[1]))}}catch(n){r.callback(e,t,void 0,n)}},this.multicall=nz.isMulticall(t)?t:new nz(t),iz.forEach((t=>{void 0!==e[t]&&(this[t]=(...r)=>e[t](...r))}))}callback(e,t,r,n){t(n,{jsonrpc:Qq,id:e.id,result:r,error:n})}async call(e,t){return this.rpcCall(ez.ethCall,e,t)}async getCode(e,t){return this.rpcCall(ez.ethGetCode,e,t)}async getBalance(e,t){return this.rpcCall(ez.ethGetBalance,e,t)}async rpcCall(e,...t){const r=qq();return(await jq(this.multicall.handle)(this.next,{jsonrpc:Qq,id:r,method:e,params:t})).result}},MulticallExternalProvider:class{constructor(e,t){if(this.provider=e,this.multicall=void 0,this.multicall=nz.isMulticall(t)?t:new nz(t),e.send){const t=async function(t,r){e.send(t,r)};this.send=(e,r)=>{this.multicall.handle(t,e,r)}}if(e.sendAsync){const t=async function(t,r){e.sendAsync(t,r)};this.sendAsync=(e,r)=>{this.multicall.handle(t,e,r)}}}get isMetaMask(){return this.provider.isMetaMask}get isStatus(){return this.provider.isStatus}},multicallMiddleware:e=>t=>{const r=nz.isMulticall(e)?e:new nz(e);return(e,n)=>r.handle(t,e,n)}}),oz=Object.freeze({__proto__:null,Multicall:nz,providers:az});let sz,uz;try{sz=localStorage}catch(e){const t=new Map;sz={getItem:e=>{var r;return null!=(r=t.get(e))?r:null},setItem:(e,r)=>t.set(e,r),removeItem:e=>t.delete(e)}}function fz(e){return void 0!==e.address&&!function(e){return cz(e)||lz(e)||dz(e)}(e)}function cz(e){const t=e;return void 0!==t.signature&&void 0===t.address}function lz(e){const t=e;return void 0!==t.r&&void 0!==t.s&&void 0!==t.v&&void 0!==t.t}function dz(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"}(uz||(uz={}));const pz=e=>{if("string"==typeof e)return pz((e=>{if("string"!=typeof e)return e;const t=e.replace("0x",""),r=Qi.from(`0x${t.slice(0,4)}`).toNumber(),n=[];for(let e=4;e<t.length;){const r=Qi.from(t.slice(e,e+2)).toNumber();e+=2;const i=Qi.from(`0x${t.slice(e,e+2)}`).toNumber();switch(e+=2,r){case uz.Address:const r=Eo(t.slice(e,e+40));e+=40,n.push({weight:i,address:r});break;case uz.EOA:const a=Ii(`0x${t.slice(e,e+132)}`);e+=132;const o=Hi(a.slice(0,65)),s=o.r,u=o.s,f=o.v,c=Qi.from(a[a.length-1]).toNumber();n.push({weight:i,signature:a,r:s,s:u,v:f,t:c});break;case uz.Full:const l=Eo(t.slice(e,e+40));e+=40;const d=Qi.from(`0x${t.slice(e,e+4)}`).mul(2).toNumber();e+=4;const p=Ii(`0x${t.slice(e,e+d)}`);e+=d,n.push({weight:i,address:l,signature:p});break;default:throw Error("Signature type not supported")}}return{threshold:r,signers:n}})(e));const t=e.signers.map((e=>{if(fz(e))return gy(["uint8","uint8","address"],[uz.Address,e.weight,e.address]);if(lz(e))return gy(["uint8","uint8","bytes32","bytes32","uint8","uint8"],[uz.EOA,e.weight,e.r,e.s,e.v,e.t]);if(dz(e)){const t=Ii(e.signature).length;return gy(["uint8","uint8","address","uint16","bytes"],[uz.Full,e.weight,e.address,t,e.signature])}if(cz(e))return gy(["uint8","uint8","bytes"],[uz.EOA,e.weight,e.signature]);throw Error("Unkwnown signature part type")}));return gy(["uint16",...Array(t.length).fill("bytes")],[e.threshold,...t])};var hz;!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"}(hz||(hz={}));class mz extends Error{type;constructor(e,t){super(e),this.type=t}}const yz=async(e,t)=>{try{return await e()}catch(e){const r=`${t}: ${e.message}`||"UnknownError";throw new mz(r,t)}},bz="passport_credentials";class gz{saveCredentials(e){localStorage.setItem(bz,JSON.stringify(e))}getCredentials(){const e=localStorage.getItem(bz);return e?JSON.parse(e):null}areValid(e){if(e){const t=this.isTokenValid(e.access_token),r=this.isTokenValid(e.id_token);return t&&r}return!1}isTokenValid(e){return(ZB(e).exp??0)>Date.now()/1e3+3600}clearCredentials(){localStorage.removeItem(bz)}}const vz={headers:{"Content-Type":"application/x-www-form-urlencoded"}};function wz(e){return new Promise((t=>{setTimeout(t,e)}))}class _z{userManager;config;deviceCredentialsManager;logoutMode;constructor(e){this.config=e,this.userManager=new class{constructor(e){this._logger=new aD("UserManager"),this.settings=new PD(e),this._client=new class{constructor(e){this._logger=new aD("OidcClient"),this.settings=new gD(e),this.metadataService=new class{constructor(e){this._settings=e,this._logger=new aD("MetadataService"),this._signingKeys=null,this._metadata=null,this._metadataUrl=this._settings.metadataUrl,this._jsonService=new yD(["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 r=this._logger.create(`_getMetadataProperty('${e}')`),n=await this.getMetadata();if(r.debug("resolved"),void 0===n[e]){if(!0===t)return void r.warn("Metadata does not contain optional property");r.throw(new Error("Metadata does not contain property "+e))}return n[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 r=await this._jsonService.getJson(t);if(e.debug("got key set",r),!Array.isArray(r.keys))throw e.throw(new Error("Missing keys on keyset")),null;return this._signingKeys=r.keys,this._signingKeys}}(this.settings),this._claimsService=new class{constructor(e){this._settings=e,this._logger=new aD("ClaimsService")}filterProtocolClaims(e){const t={...e};if(this._settings.filterProtocolClaims){let e;e=Array.isArray(this._settings.filterProtocolClaims)?this._settings.filterProtocolClaims:TD;for(const r of e)AD.includes(r)||delete t[r]}return t}mergeClaims(e,t){const r={...e};for(const[e,n]of Object.entries(t))for(const t of Array.isArray(n)?n:[n]){const n=r[e];n?Array.isArray(n)?n.includes(t)||n.push(t):r[e]!==t&&("object"==typeof t&&this._settings.mergeClaims?r[e]=this.mergeClaims(n,t):r[e]=[n,t]):r[e]=t}return r}}(this.settings),this._validator=new class{constructor(e,t,r){this._settings=e,this._metadataService=t,this._claimsService=r,this._logger=new aD("ResponseValidator"),this._userInfoService=new class{constructor(e,t){this._settings=e,this._metadataService=t,this._logger=new aD("UserInfoService"),this._getClaimsFromJwt=async e=>{const t=this._logger.create("_getClaimsFromJwt");try{const r=uD.decode(e);return t.debug("JWT decoding successful"),r}catch(e){throw t.error("Error parsing JWT response"),e}},this._jsonService=new yD(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 r=await this._metadataService.getUserInfoEndpoint();t.debug("got userinfo url",r);const n=await this._jsonService.getJson(r,{token:e,credentials:this._settings.fetchRequestCredentials});return t.debug("got claims",n),n}}(this._settings,this._metadataService),this._tokenClient=new vD(this._settings,this._metadataService)}async validateSigninResponse(e,t){const r=this._logger.create("validateSigninResponse");this._processSigninState(e,t),r.debug("state processed"),await this._processCode(e,t),r.debug("code processed"),e.isOpenId&&this._validateIdTokenAttributes(e),r.debug("tokens validated"),await this._processClaims(e,null==t?void 0:t.skipUserInfo,e.isOpenId),r.debug("claims processed")}async validateCredentialsResponse(e,t){const r=this._logger.create("validateCredentialsResponse");e.isOpenId&&this._validateIdTokenAttributes(e),r.debug("tokens validated"),await this._processClaims(e,t,e.isOpenId),r.debug("claims processed")}async validateRefreshResponse(e,t){const r=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),r.debug("ID Token validated")),e.id_token||(e.id_token=t.id_token,e.profile=t.profile);const n=e.isOpenId&&!!e.id_token;await this._processClaims(e,!1,n),r.debug("claims processed")}validateSignoutResponse(e,t){const r=this._logger.create("validateSignoutResponse");if(t.id!==e.state&&r.throw(new Error("State does not match")),r.debug("state validated"),e.userState=t.data,e.error)throw r.warn("Response was error",e.error),new dD(e)}_processSigninState(e,t){const r=this._logger.create("_processSigninState");if(t.id!==e.state&&r.throw(new Error("State does not match")),t.client_id||r.throw(new Error("No client_id on state")),t.authority||r.throw(new Error("No authority on state")),this._settings.authority!==t.authority&&r.throw(new Error("authority mismatch on settings vs. signin state")),this._settings.client_id&&this._settings.client_id!==t.client_id&&r.throw(new Error("client_id mismatch on settings vs. signin state")),r.debug("state validated"),e.userState=t.data,null!=e.scope||(e.scope=t.scope),e.error)throw r.warn("Response was error",e.error),new dD(e);t.code_verifier&&!e.code&&r.throw(new Error("Expected code in response"))}async _processClaims(e,t=!1,r=!0){const n=this._logger.create("_processClaims");if(e.profile=this._claimsService.filterProtocolClaims(e.profile),t||!this._settings.loadUserInfo||!e.access_token)return void n.debug("not loading user info");n.debug("loading user info");const i=await this._userInfoService.getClaims(e.access_token);n.debug("user info claims received from user info endpoint"),r&&i.sub!==e.profile.sub&&n.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)),n.debug("user info claims received, updated profile:",e.profile)}async _processCode(e,t){const r=this._logger.create("_processCode");if(e.code){r.debug("Validating code");const n=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,n)}else r.debug("No code to process")}_validateIdTokenAttributes(e,t){var r;const n=this._logger.create("_validateIdTokenAttributes");n.debug("decoding ID Token JWT");const i=uD.decode(null!=(r=e.id_token)?r:"");if(i.sub||n.throw(new Error("ID Token is missing a subject claim")),t){const e=uD.decode(t);i.sub!==e.sub&&n.throw(new Error("sub in id_token does not match current sub")),i.auth_time&&i.auth_time!==e.auth_time&&n.throw(new Error("auth_time in id_token does not match original auth_time")),i.azp&&i.azp!==e.azp&&n.throw(new Error("azp in id_token does not match original azp")),!i.azp&&e.azp&&n.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 vD(this.settings,this.metadataService)}async createSigninRequest({state:e,request:t,request_uri:r,request_type:n,id_token_hint:i,login_hint:a,skipUserInfo:o,nonce:s,response_type:u=this.settings.response_type,scope:f=this.settings.scope,redirect_uri:c=this.settings.redirect_uri,prompt:l=this.settings.prompt,display:d=this.settings.display,max_age:p=this.settings.max_age,ui_locales:h=this.settings.ui_locales,acr_values:m=this.settings.acr_values,resource:y=this.settings.resource,response_mode:b=this.settings.response_mode,extraQueryParams:g=this.settings.extraQueryParams,extraTokenParams:v=this.settings.extraTokenParams}){const w=this._logger.create("createSigninRequest");if("code"!==u)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:r,redirect_uri:n,response_type:i,scope:a,state_data:o,response_mode:s,request_type:u,client_secret:f,nonce:c,resource:l,skipUserInfo:d,extraQueryParams:p,extraTokenParams:h,disablePKCE:m,...y}){if(this._logger=new aD("SigninRequest"),!e)throw this._logger.error("ctor: No url passed"),new Error("url");if(!r)throw this._logger.error("ctor: No client_id passed"),new Error("client_id");if(!n)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 _D({data:o,request_type:u,code_verifier:!m,client_id:r,authority:t,redirect_uri:n,response_mode:s,client_secret:f,scope:a,extraTokenParams:h,skipUserInfo:d});const b=new URL(e);b.searchParams.append("client_id",r),b.searchParams.append("redirect_uri",n),b.searchParams.append("response_type",i),b.searchParams.append("scope",a),c&&b.searchParams.append("nonce",c),b.searchParams.append("state",this.state.id),this.state.code_challenge&&(b.searchParams.append("code_challenge",this.state.code_challenge),b.searchParams.append("code_challenge_method","S256")),l&&(Array.isArray(l)?l:[l]).forEach((e=>b.searchParams.append("resource",e)));for(const[e,t]of Object.entries({response_mode:s,...y,...p}))null!=t&&b.searchParams.append(e,t.toString());this.url=b.href}}({url:_,authority:this.settings.authority,client_id:this.settings.client_id,redirect_uri:c,response_type:u,scope:f,state_data:e,prompt:l,display:d,max_age:p,ui_locales:h,id_token_hint:i,login_hint:a,acr_values:m,resource:y,request:t,request_uri:r,extraQueryParams:g,extraTokenParams:v,request_type:n,response_mode:b,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 r=this._logger.create("readSigninResponseState"),n=new ED(lD.readParams(e,this.settings.response_mode));if(!n.state)throw r.throw(new Error("No state in response")),null;const i=await this.settings.stateStore[t?"remove":"get"](n.state);if(!i)throw r.throw(new Error("No matching state found in storage")),null;return{state:_D.fromStorageString(i),response:n}}async processSigninResponse(e){const t=this._logger.create("processSigninResponse"),{state:r,response:n}=await this.readSigninResponseState(e,!0);return t.debug("received state from storage; validating response"),await this._validator.validateSigninResponse(n,r),n}async processResourceOwnerPasswordCredentials({username:e,password:t,skipUserInfo:r=!1,extraTokenParams:n={}}){const i=await this._tokenClient.exchangeCredentials({username:e,password:t,...n}),a=new ED(new URLSearchParams);return Object.assign(a,i),await this._validator.validateCredentialsResponse(a,r),a}async useRefreshToken({state:e,timeoutInSeconds:t}){var r;const n=this._logger.create("useRefreshToken");let i;if(void 0===this.settings.refreshTokenAllowedScope)i=e.scope;else{const t=this.settings.refreshTokenAllowedScope.split(" ");i=((null==(r=e.scope)?void 0:r.split(" "))||[]).filter((e=>t.includes(e))).join(" ")}const a=await this._tokenClient.exchangeRefreshToken({refresh_token:e.refresh_token,scope:i,timeoutInSeconds:t}),o=new ED(new URLSearchParams);return Object.assign(o,a),n.debug("validating response",o),await this._validator.validateRefreshResponse(o,{...e,scope:i}),o}async createSignoutRequest({state:e,id_token_hint:t,request_type:r,post_logout_redirect_uri:n=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:r,post_logout_redirect_uri:n,extraQueryParams:i,request_type:a}){if(this._logger=new aD("SignoutRequest"),!e)throw this._logger.error("ctor: No url passed"),new Error("url");const o=new URL(e);r&&o.searchParams.append("id_token_hint",r),n&&(o.searchParams.append("post_logout_redirect_uri",n),t&&(this.state=new wD({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:n,state_data:e,extraQueryParams:i,request_type:r});await this.clearStaleState();const u=s.state;return u&&(a.debug("Signout request has state to persist"),await this.settings.stateStore.set(u.id,u.toStorageString())),s}async readSignoutResponseState(e,t=!1){const r=this._logger.create("readSignoutResponseState"),n=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")}}(lD.readParams(e,this.settings.response_mode));if(!n.state){if(r.debug("No state in response"),n.error)throw r.warn("Response was error:",n.error),new dD(n);return{state:void 0,response:n}}const i=await this.settings.stateStore[t?"remove":"get"](n.state);if(!i)throw r.throw(new Error("No matching state found in storage")),null;return{state:wD.fromStorageString(i),response:n}}async processSignoutResponse(e){const t=this._logger.create("processSignoutResponse"),{state:r,response:n}=await this.readSignoutResponseState(e,!0);return r?(t.debug("Received state from storage; validating response"),this._validator.validateSignoutResponse(n,r)):t.debug("No state from storage; skipping response validation"),n}clearStaleState(){return this._logger.create("clearStaleState"),wD.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 aD("RedirectNavigator")}async prepare({redirectMethod:e=this._settings.redirectMethod,redirectTarget:t=this._settings.redirectTarget}){var r;this._logger.create("prepare");let n=window.self;"top"===t&&(n=null!=(r=window.top)?r:window.self);const i=n.location[e].bind(n.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")),n.stop()}}}}(this.settings),this._popupNavigator=new class{constructor(e){this._settings=e,this._logger=new aD("PopupNavigator")}async prepare({popupWindowFeatures:e=this._settings.popupWindowFeatures,popupWindowTarget:t=this._settings.popupWindowTarget}){return new BD({popupWindowFeatures:e,popupWindowTarget:t})}async callback(e,t=!1){this._logger.create("callback"),BD.notifyOpener(e,t)}}(this.settings),this._iframeNavigator=new class{constructor(e){this._settings=e,this._logger=new aD("IFrameNavigator")}async prepare({silentRequestTimeoutInSeconds:e=this._settings.silentRequestTimeoutInSeconds}){return new MD({silentRequestTimeoutInSeconds:e})}async callback(e){this._logger.create("callback"),MD.notifyParent(e,this._settings.iframeNotifyParentOrigin)}}(this.settings),this._events=new DD(this.settings),this._silentRenewService=new class{constructor(e){this._userManager=e,this._logger=new aD("SilentRenewService"),this._isStarted=!1,this._retryTimer=new cD("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 pD)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 aD("SessionMonitor"),this._start=async e=>{const t=e.session_state;if(!t)return;const r=this._logger.create("_start");if(e.profile?(this._sub=e.profile.sub,this._sid=e.profile.sid,r.debug("session_state",t,", sub",this._sub)):(this._sub=void 0,this._sid=void 0,r.debug("session_state",t,", anonymous user")),this._checkSessionIFrame)this._checkSessionIFrame.start(t);else try{const e=await this._userManager.metadataService.getCheckSessionIframe();if(e){r.debug("initializing check session iframe");const n=this._userManager.settings.client_id,i=this._userManager.settings.checkSessionIntervalInSeconds,a=this._userManager.settings.stopCheckSessionOnError,o=new class{constructor(e,t,r,n,i){this._callback=e,this._client_id=t,this._intervalInSeconds=n,this._stopOnError=i,this._logger=new aD("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(r);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,n,e,i,a);await o.load(),this._checkSessionIFrame=o,o.start(t)}else r.warn("no check session iframe found in the metadata")}catch(e){r.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 r=!0;t&&this._checkSessionIFrame?t.sub===this._sub?(r=!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"),r?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,...r}=e,n=await this._redirectNavigator.prepare({redirectMethod:t});await this._signinStart({request_type:"si:r",...r},n)}async signinRedirectCallback(e=window.location.href){const t=this._logger.create("signinRedirectCallback"),r=await this._signinEnd(e);return r.profile&&r.profile.sub?t.info("success, signed in subject",r.profile.sub):t.info("no subject"),r}async signinResourceOwnerCredentials({username:e,password:t,skipUserInfo:r=!1}){const n=this._logger.create("signinResourceOwnerCredential"),i=await this._client.processResourceOwnerPasswordCredentials({username:e,password:t,skipUserInfo:r,extraTokenParams:this.settings.extraTokenParams});n.debug("got signin response");const a=await this._buildUser(i);return a.profile&&a.profile.sub?n.info("success, signed in subject",a.profile.sub):n.info("no subject"),a}async signinPopup(e={}){const t=this._logger.create("signinPopup"),{popupWindowFeatures:r,popupWindowTarget:n,...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:r,popupWindowTarget:n}),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 r=this._logger.create("signinPopupCallback");await this._popupNavigator.callback(e,t),r.info("success")}async signinSilent(e={}){var t;const r=this._logger.create("signinSilent"),{silentRequestTimeoutInSeconds:n,...i}=e;let a=await this._loadUser();if(null==a?void 0:a.refresh_token){r.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||r.throw(new Error("No silent_redirect_uri configured")),a&&this.settings.validateSubOnSilentRenew&&(r.debug("subject prior to silent renew:",a.profile.sub),s=a.profile.sub);const u=await this._iframeNavigator.prepare({silentRequestTimeoutInSeconds:n});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},u,s),a&&((null==(t=a.profile)?void 0:t.sub)?r.info("success, signed in subject",a.profile.sub):r.info("no subject")),a}async _useRefreshToken(e){const t=await this._client.useRefreshToken({state:e,timeoutInSeconds:this.settings.silentRequestTimeoutInSeconds}),r=new SD({...e,...t});return await this.storeUser(r),this._events.load(r),r}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:r}=await this._client.readSignoutResponseState(e);if(r)switch(r.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:r,...n}=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:r}),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,...n},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 dD)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,r){const n=await this._signinStart(e,t);return await this._signinEnd(n.url,r)}async _signinStart(e,t){const r=this._logger.create("_signinStart");try{const n=await this._client.createSigninRequest(e);return r.debug("got signin request"),await t.navigate({url:n.url,state:n.state.id,response_mode:n.state.response_mode,scriptOrigin:this.settings.iframeScriptOrigin})}catch(e){throw r.debug("error after preparing navigator, closing navigator window"),t.close(),e}}async _signinEnd(e,t){const r=this._logger.create("_signinEnd"),n=await this._client.processSigninResponse(e);return r.debug("got signin response"),await this._buildUser(n,t)}async _buildUser(e,t){const r=this._logger.create("_buildUser"),n=new SD(e);if(t){if(t!==n.profile.sub)throw r.debug("current user does not match user returned from signin. sub from signin:",n.profile.sub),new dD({...e,error:"login_required"});r.debug("current user matches user returned from signin")}return await this.storeUser(n),r.debug("user stored"),this._events.load(n),n}async signoutRedirect(e={}){const t=this._logger.create("signoutRedirect"),{redirectMethod:r,...n}=e,i=await this._redirectNavigator.prepare({redirectMethod:r});await this._signoutStart({request_type:"so:r",post_logout_redirect_uri:this.settings.post_logout_redirect_uri,...n},i),t.info("success")}async signoutRedirectCallback(e=window.location.href){const t=this._logger.create("signoutRedirectCallback"),r=await this._signoutEnd(e);return t.info("success"),r}async signoutPopup(e={}){const t=this._logger.create("signoutPopup"),{popupWindowFeatures:r,popupWindowTarget:n,...i}=e,a=this.settings.popup_post_logout_redirect_uri,o=await this._popupNavigator.prepare({popupWindowFeatures:r,popupWindowTarget:n});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 r=this._logger.create("signoutPopupCallback");await this._popupNavigator.callback(e,t),r.info("success")}async _signout(e,t){const r=await this._signoutStart(e,t);return await this._signoutEnd(r.url)}async _signoutStart(e={},t){var r;const n=this._logger.create("_signoutStart");try{const i=await this._loadUser();n.debug("loaded current user from storage"),this.settings.revokeTokensOnSignout&&await this._revokeInternal(i);const a=e.id_token_hint||i&&i.id_token;a&&(n.debug("setting id_token_hint in signout request"),e.id_token_hint=a),await this.removeUser(),n.debug("user removed, creating signout request");const o=await this._client.createSignoutRequest(e);return n.debug("got signout request"),await t.navigate({url:o.url,state:null==(r=o.state)?void 0:r.id})}catch(e){throw n.debug("error after preparing navigator, closing navigator window"),t.close(),e}}async _signoutEnd(e){const t=this._logger.create("_signoutEnd"),r=await this._client.processSignoutResponse(e);return t.debug("got signout response"),r}async signoutSilent(e={}){var t;const r=this._logger.create("signoutSilent"),{silentRequestTimeoutInSeconds:n,...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:n});await this._signout({request_type:"so:s",post_logout_redirect_uri:o,id_token_hint:a,...i},s),r.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 r=this._logger.create("_revokeInternal");if(!e)return;const n=t.filter((t=>"string"==typeof e[t]));if(n.length){for(const t of n)await this._client.revokeToken(e[t],t),r.info(`${t} revoked successfully`),"access_token"!==t&&(e[t]=null);await this.storeUser(e),r.debug("user stored"),this._events.load(e)}else r.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"),SD.fromStorageString(t)):(e.debug("no user storageString"),null)}async storeUser(e){const t=this._logger.create("storeUser");if(e){t.debug("storing user");const r=e.toStorageString();await this.settings.userStore.set(this._userStoreKey,r)}else this._logger.debug("removing user"),await this.settings.userStore.remove(this._userStoreKey)}async clearStaleState(){await this._client.clearStaleState()}}((({oidcConfiguration:e,authenticationDomain:t})=>{const r={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};return e.audience&&(r.extraQueryParams={audience:e.audience}),r})(e)),this.deviceCredentialsManager=new gz,this.logoutMode=e.oidcConfiguration.logoutMode||"redirect"}static mapOidcUserToDomainModel=e=>{const t=e.profile?.passport,r={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&&(r.imx={ethAddress:t?.imx_eth_address,starkAddress:t?.imx_stark_address,userAdminAddress:t?.imx_user_admin_address}),t?.zkevm_eth_address&&(r.zkEvm={ethAddress:t?.zkevm_eth_address,userAdminAddress:t?.zkevm_user_admin_address}),r};static mapDeviceTokenResponseToDomainUserModel=e=>{const t=ZB(e.id_token),r={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&&(r.imx={ethAddress:t?.passport?.imx_eth_address,starkAddress:t?.passport?.imx_stark_address,userAdminAddress:t?.passport?.imx_user_admin_address}),r};async login(){return yz((async()=>{const e=await this.userManager.signinPopup({popupWindowFeatures:{width:410,height:450}});return _z.mapOidcUserToDomainModel(e)}),hz.AUTHENTICATION_ERROR)}async loginCallback(){return yz((async()=>this.userManager.signinPopupCallback()),hz.AUTHENTICATION_ERROR)}async loginWithDeviceFlow(){return yz((async()=>{const e=await Qr.post(`${this.config.authenticationDomain}/oauth/device/code`,{client_id:this.config.oidcConfiguration.clientId,scope:this.config.oidcConfiguration.scope,audience:this.config.oidcConfiguration.audience},vz);return{code:e.data.user_code,deviceCode:e.data.device_code,url:e.data.verification_uri_complete,interval:e.data.interval}}),hz.AUTHENTICATION_ERROR)}async connectImxDeviceFlow(e,t,r){return yz((async()=>{const n=Date.now();for(;;){if(null!=r&&Date.now()-n>r)throw new Error("Timed out");await wz(1e3*t);try{const t=await this.getDeviceFlowToken(e),r=_z.mapDeviceTokenResponseToDomainUserModel(t);return r.imx?.ethAddress&&r.imx?.starkAddress&&r.imx?.userAdminAddress&&this.deviceCredentialsManager.saveCredentials(t),r}catch(e){if(!Qr.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")}),hz.AUTHENTICATION_ERROR)}async getDeviceFlowToken(e){return(await Qr.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},vz)).data}async connectImxWithCredentials(e){return yz((async()=>{if(this.deviceCredentialsManager.areValid(e))return _z.mapDeviceTokenResponseToDomainUserModel(e);const t=e?.refresh_token??null;if(t){const e=await this.refreshToken(t);return _z.mapDeviceTokenResponseToDomainUserModel(e)}return null}),hz.AUTHENTICATION_ERROR)}async refreshToken(e){return(await Qr.post(`${this.config.authenticationDomain}/oauth/token`,{client_id:this.config.oidcConfiguration.clientId,grant_type:"refresh_token",refresh_token:e},vz)).data}async logout(){return yz((async()=>"silent"===this.logoutMode?this.userManager.signoutSilent():this.userManager.signoutRedirect()),hz.LOGOUT_ERROR)}async logoutSilentCallback(e){return this.userManager.signoutSilentCallback(e)}async logoutDeviceFlow(){return yz((async()=>{this.deviceCredentialsManager.clearCredentials()}),hz.LOGOUT_ERROR)}async loginSilent(){return yz((async()=>{if(!await this.getUser())return null;const e=await this.userManager.signinSilent();return e?_z.mapOidcUserToDomainModel(e):null}),hz.SILENT_LOGIN_ERROR)}async getUser(){return yz((async()=>{const e=await this.userManager.getUser();if(e)return _z.mapOidcUserToDomainModel(e);const t=this.deviceCredentialsManager.getCredentials();return t?_z.mapDeviceTokenResponseToDomainUserModel(t):null}),hz.NOT_LOGGED_IN_ERROR)}async getUserDeviceFlow(){return yz((async()=>{const e=this.deviceCredentialsManager.getCredentials();return e?_z.mapDeviceTokenResponseToDomainUserModel(e):null}),hz.NOT_LOGGED_IN_ERROR)}checkStoredDeviceFlowCredentials(){return this.deviceCredentialsManager.getCredentials()}}class Ez{config;constructor(e){this.config=e}async login(e,t){return yz((async()=>{const r=new LU(this.config.magicPublishableApiKey,{extensions:[new jU],network:t});return await r.openid.loginWithOIDC({jwt:e,providerId:this.config.magicProviderId}),r.rpcProvider}),hz.WALLET_CONNECTION_ERROR)}}const Tz=1e3,Az=3,Sz=async(e,t)=>{const{retries:r=Az,interval:n=Tz,finalErr:i=Error("Retry failed"),finallyFn:a=(()=>{})}=t||{};try{return await e()}catch(t){return r<=0?Promise.reject(i):(await(o=n,new Promise((e=>{setTimeout((()=>e()),o)}))),Sz(e,{retries:r-1,finalErr:i,finallyFn:a}))}finally{r<=0&&a()}var o};class kz{transactionAPI;confirmationScreen;imxEtherAddress;constructor({imxPublicApiDomain:e,accessToken:t,confirmationScreen:r,imxEtherAddress:n}){this.confirmationScreen=r,this.transactionAPI=new Nq(new Pq({accessToken:t,basePath:e})),this.imxEtherAddress=n}loading(e){this.confirmationScreen.loading(e)}async validate({payloadHash:e}){if(!(await Sz((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:r}=t.data;if(r){if(!(await this.confirmationScreen.startGuardianTransaction(e,this.imxEtherAddress)).confirmed)throw new Error("Transaction rejected by user")}else this.confirmationScreen.closeWindow()}}const Oz="ERC721";const Rz="ERC721";class xz{user;starkSigner;immutableXClient;confirmationScreen;guardianClient;constructor({user:e,starkSigner:t,immutableXClient:r,imxPublicApiDomain:n,confirmationScreen:i}){this.user=e,this.starkSigner=t,this.immutableXClient=r,this.confirmationScreen=i,this.guardianClient=new kz({imxPublicApiDomain:n,accessToken:e.accessToken,confirmationScreen:i,imxEtherAddress:e.imx.ethAddress})}async transfer(e){return async function({request:e,transfersApi:t,starkSigner:r,user:n,guardianClient:i}){return yz((async()=>{i.loading();const a=e.type===Rz?"1":e.amount,o={sender:n.imx.ethAddress,token:Dq(e),amount:a,receiver:e.receiver},s={Authorization:`Bearer ${n.accessToken}`},u=await t.getSignableTransferV1({getSignableTransferRequest:o},{headers:s});await i.validate({payloadHash:u.data.payload_hash});const f=u.data,{payload_hash:c}=f,l=await r.signMessage(c),d=await r.getAddress(),p={createTransferRequest:{sender_stark_key:f.sender_stark_key||d,sender_vault_id:f.sender_vault_id,receiver_stark_key:f.receiver_stark_key,receiver_vault_id:f.receiver_vault_id,asset_id:f.asset_id,amount:f.amount,nonce:f.nonce,expiration_timestamp:f.expiration_timestamp,stark_signature:l}},{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}}),hz.TRANSFER_ERROR)}({request:e,user:this.user,starkSigner:this.starkSigner,transfersApi:this.immutableXClient.transfersApi,guardianClient:this.guardianClient})}registerOffchain(){throw new mz("Operation not supported",hz.OPERATION_NOT_SUPPORTED_ERROR)}isRegisteredOnchain(){throw new mz("Operation not supported",hz.OPERATION_NOT_SUPPORTED_ERROR)}createOrder(e){return async function({starkSigner:e,user:t,request:r,ordersApi:n,guardianClient:i}){return yz((async()=>{i.loading();const{ethAddress:a}=t.imx,o=r.sell.type===Oz?"1":r.sell.amount,s=r.buy.type===Oz?"1":r.buy.amount,u={Authorization:`Bearer ${t.accessToken}`},f={user:a,amount_buy:s,token_buy:Dq(r.buy),amount_sell:o,token_sell:Dq(r.sell),fees:r.fees,split_fees:!0,expiration_timestamp:r.expiration_timestamp},c=await n.getSignableOrder({getSignableOrderRequestV3:f},{headers:u});await i.validate({payloadHash:c.data.payload_hash});const{payload_hash:l}=c.data,d=await e.signMessage(l),p=c.data,h={createOrderRequest:{include_fees:!0,fees:r.fees,stark_signature:d,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 n.createOrderV3(h,{headers:u})).data}}),hz.CREATE_ORDER_ERROR)}({request:e,user:this.user,starkSigner:this.starkSigner,ordersApi:this.immutableXClient.ordersApi,guardianClient:this.guardianClient})}cancelOrder(e){return async function({user:e,starkSigner:t,request:r,ordersApi:n,guardianClient:i}){return yz((async()=>{i.loading();const a={order_id:r.order_id},o={Authorization:`Bearer ${e.accessToken}`},s=await n.getSignableCancelOrderV3({getSignableCancelOrderRequest:a},{headers:o});await i.validate({payloadHash:s.data.payload_hash});const{payload_hash:u}=s.data,f=await t.signMessage(u),c=await n.cancelOrderV3({id:r.order_id.toString(),cancelOrderRequest:{order_id:r.order_id,stark_signature:f}},{headers:o});return{order_id:c.data.order_id,status:c.data.status}}),hz.CANCEL_ORDER_ERROR)}({request:e,user:this.user,starkSigner:this.starkSigner,ordersApi:this.immutableXClient.ordersApi,guardianClient:this.guardianClient})}createTrade(e){return async function({request:e,tradesApi:t,user:r,starkSigner:n,guardianClient:i}){return yz((async()=>{i.loading();const{ethAddress:a}=r.imx,o={expiration_timestamp:e.expiration_timestamp,fees:e.fees,order_id:e.order_id,user:a},s={Authorization:`Bearer ${r.accessToken}`},u=await t.getSignableTrade({getSignableTradeRequest:o},{headers:s});await i.validate({payloadHash:u.data.payload_hash});const{payload_hash:f}=u.data,c=await n.signMessage(f),{data:l}=u,d={createTradeRequest:{include_fees:!0,fees:e?.fees,stark_signature:c,order_id:e?.order_id,fee_info:l.fee_info,amount_buy:l.amount_buy,amount_sell:l.amount_sell,asset_id_buy:l.asset_id_buy,asset_id_sell:l.asset_id_sell,expiration_timestamp:l.expiration_timestamp,nonce:l.nonce,stark_key:l.stark_key,vault_id_buy:l.vault_id_buy,vault_id_sell:l.vault_id_sell}},{data:p}=await t.createTradeV3(d,{headers:s});return p}),hz.CREATE_TRADE_ERROR)}({request:e,user:this.user,starkSigner:this.starkSigner,tradesApi:this.immutableXClient.tradesApi,guardianClient:this.guardianClient})}batchNftTransfer(e){return async function({user:e,starkSigner:t,request:r,transfersApi:n,guardianClient:i}){return yz((async()=>{i.loading({width:480,height:784});const{ethAddress:a}=e.imx,o={sender_ether_key:a,signable_requests:r.map((e=>({amount:"1",token:Dq({type:Rz,tokenId:e.tokenId,tokenAddress:e.tokenAddress}),receiver:e.receiver})))},s={Authorization:`Bearer ${e.accessToken}`},u=await n.getSignableTransfer({getSignableTransferRequestV2:o},{headers:s});await i.validate({payloadHash:u.data.signable_responses[0]?.payload_hash});const f=await Promise.all(u.data.signable_responses.map((async e=>{const r=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:r}}))),c={sender_stark_key:u.data.sender_stark_key,requests:f},l=await n.createTransfer({createTransferRequestV2:c},{headers:s});return{transfer_ids:l?.data.transfer_ids}}),hz.TRANSFER_ERROR)}({request:e,user:this.user,starkSigner:this.starkSigner,transfersApi:this.immutableXClient.transfersApi,guardianClient:this.guardianClient})}exchangeTransfer(e){return async function({user:e,starkSigner:t,request:r,exchangesApi:n}){return yz((async()=>{const{ethAddress:i}=e.imx,a=r.amount,o=await n.getExchangeSignableTransfer({id:r.transactionID,getSignableTransferRequest:{sender:i,token:Dq(r),amount:a,receiver:r.receiver}}),s=await t.getAddress(),{payload_hash:u}=o.data,f=await t.signMessage(u),c={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:f},l={Authorization:`Bearer ${e.accessToken}`},d=await n.createExchangeTransfer({id:r.transactionID,createTransferRequest:c},{headers:l});return{sent_signature:d?.data.sent_signature,status:d?.data.status?.toString(),time:d?.data.time,transfer_id:d?.data.transfer_id}}),hz.EXCHANGE_TRANSFER_ERROR)}({request:e,user:this.user,starkSigner:this.starkSigner,exchangesApi:this.immutableXClient.exchangeApi})}deposit(e){throw new mz("Operation not supported",hz.OPERATION_NOT_SUPPORTED_ERROR)}prepareWithdrawal(e){throw new mz("Operation not supported",hz.OPERATION_NOT_SUPPORTED_ERROR)}completeWithdrawal(e,t){throw new mz("Operation not supported",hz.OPERATION_NOT_SUPPORTED_ERROR)}getAddress(){return Promise.resolve(this.user.imx.ethAddress)}}class Iz{authManager;config;confirmationScreen;immutableXClient;magicAdapter;constructor({authManager:e,config:t,confirmationScreen:r,immutableXClient:n,magicAdapter:i}){this.authManager=e,this.config=t,this.confirmationScreen=r,this.immutableXClient=n,this.magicAdapter=i}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,r){const n=await this.authManager.connectImxDeviceFlow(e,t,r);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 mz("Failed to initialise",hz.WALLET_CONNECTION_ERROR);const t=await this.magicAdapter.login(e.idToken,this.config.network),r=new uy(t).getSigner(),n=await(async e=>yz((async()=>NC(await xC(e))),hz.WALLET_CONNECTION_ERROR))(r);if(!e.imx?.ethAddress){const t=await this.registerStarkEx(r,n,e.accessToken);return new xz({user:t,starkSigner:n,immutableXClient:this.immutableXClient,imxPublicApiDomain:this.config.imxPublicApiDomain,confirmationScreen:this.confirmationScreen})}return new xz({user:e,starkSigner:n,immutableXClient:this.immutableXClient,imxPublicApiDomain:this.config.imxPublicApiDomain,confirmationScreen:this.confirmationScreen})}async registerStarkEx(e,t,r){return yz((async()=>{await async function({ethSigner:e,starkSigner:t,usersApi:r},n){return yz((async()=>{const i=await e.getAddress(),a=await t.getAddress(),o=await r.getSignableRegistrationOffchain({getSignableRegistrationRequest:{ether_key:i,stark_key:a}}),{signable_message:s,payload_hash:u}=o.data,f=await Bq(s,e),c=await t.signMessage(u);return(await r.registerPassportUser({authorization:`Bearer ${n}`,registerPassportUserRequest:{eth_signature:f,ether_key:i,stark_signature:c,stark_key:a}})).statusText}),hz.USER_REGISTRATION_ERROR)}({ethSigner:e,starkSigner:t,usersApi:this.immutableXClient.usersApi},r);return await Sz((async()=>{const e=await this.authManager.loginSilent();return!!e?.imx?e:Promise.reject(new Error("user wallet addresses not exist"))}))}),hz.REFRESH_TOKEN_ERROR)}}var Cz;e.Networks=void 0,(Cz=e.Networks||(e.Networks={})).PRODUCTION="mainnet",Cz.SANDBOX="goerli";const Nz=(e,t,r)=>{const n=t.map((t=>!e[t]&&t)).filter((e=>e)).join(", ");if(""!==n){throw new mz(r?`${r} - ${n} cannot be null`:`${n} cannot be null`,hz.INVALID_CONFIGURATION)}};class Pz{network;authenticationDomain;passportDomain;imxPublicApiDomain;magicPublishableApiKey;magicProviderId;oidcConfiguration;baseConfig;zkEvmChainId;zkEvmRpcUrl;relayerUrl;multiRollupConfig;constructor({baseConfig:t,overrides:r,...n}){if(Nz(n,["clientId","logoutRedirectUri","redirectUri"]),this.oidcConfiguration=n,this.baseConfig=t,r)Nz(r,["network","authenticationDomain","passportDomain","magicPublishableApiKey","magicProviderId","zkEvmRpcUrl","zkEvmChainId","relayerUrl","imxPublicApiDomain","indexerMrBasePath","orderBookMrBasePath","passportMrBasePath"],"overrides"),this.network=r.network,this.authenticationDomain=r.authenticationDomain,this.passportDomain=r.passportDomain,this.imxPublicApiDomain=r.imxPublicApiDomain,this.magicPublishableApiKey=r.magicPublishableApiKey,this.magicProviderId=r.magicProviderId,this.zkEvmRpcUrl=r.zkEvmRpcUrl,this.zkEvmChainId=r.zkEvmChainId,this.relayerUrl=r.relayerUrl,this.multiRollupConfig={indexer:gt({basePath:r.indexerMrBasePath}),orderBook:gt({basePath:r.orderBookMrBasePath}),passport:gt({basePath:r.passportMrBasePath})};else switch(t.environment){case e.Environment.PRODUCTION:this.network=e.Networks.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.zkEvmChainId="",this.relayerUrl="https://api.immutable.com/relayer-mr",this.multiRollupConfig=vt();break;case e.Environment.SANDBOX:default:this.network=e.Networks.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://zkevm-rpc.sandbox.x.immutable.com",this.zkEvmChainId="eip155:13392",this.relayerUrl="https://api.sandbox.immutable.com/relayer-mr",this.multiRollupConfig=wt()}}}var Mz,Bz,Dz;!function(e){e.CONFIRMATION_WINDOW_READY="confirmation_window_ready",e.TRANSACTION_CONFIRMED="transaction_confirmed",e.TRANSACTION_ERROR="transaction_error"}(Mz||(Mz={})),function(e){e.TRANSACTION_START="transaction_start"}(Bz||(Bz={})),function(e){e.cancelOrder="delete:v1/orders",e.createOrder="post:v1/orders",e.createTrade="post:v1/trades",e.createTransfer="post:v1/transfers",e.createBatchTransfer="post:v2/transfers"}(Dz||(Dz={}));const Fz="imx_passport_confirmation",Lz=({url:e,title:t,width:r,height:n})=>{const i=Math.max(0,Math.round(window.screenX+(window.outerWidth-r)/2)),a=Math.max(0,Math.round(window.screenY+(window.outerHeight-n)/2)),o=window.open(e,t,`\n scrollbars=yes,\n width=${r}, \n height=${n}, \n top=${a}, \n left=${i}\n `);if(!o)throw new Error("Failed to open confirmation screen");return o.focus(),o},Uz="Confirm this transaction";class jz{config;confirmationWindow;constructor(e){this.config=e}postMessage(e,t,r){e.postMessage({eventType:Fz,accessToken:t,...r},this.config.passportDomain)}startTransaction(e,t,r){return new Promise(((n,i)=>{const a=({data:r,origin:a})=>{if(a===this.config.passportDomain&&r.eventType===Fz)switch(r.messageType){case Mz.CONFIRMATION_WINDOW_READY:this.postMessage(o,e,{messageType:Bz.TRANSACTION_START,messageData:t});break;case Mz.TRANSACTION_CONFIRMED:n({confirmed:!0});break;case Mz.TRANSACTION_ERROR:i(new Error("Transaction error"));break;default:i(new Error("Unsupported message type"))}};window.addEventListener("message",a);const o=Lz({url:`${this.config.passportDomain}/transaction-confirmation`,title:Uz,width:r?.width||480,height:r?.height||380}),s=setInterval((()=>{o.closed&&(clearInterval(s),window.removeEventListener("message",a),n({confirmed:!1}))}),1e3)}))}startGuardianTransaction(e,t){return new Promise(((r,n)=>{const i=({data:e,origin:t})=>{if(t===this.config.passportDomain&&e.eventType===Fz)switch(e.messageType){case Mz.CONFIRMATION_WINDOW_READY:break;case Mz.TRANSACTION_CONFIRMED:r({confirmed:!0});break;case Mz.TRANSACTION_ERROR:n(new Error("Transaction error"));break;default:n(new Error("Unsupported message type"))}};if(window.addEventListener("message",i),!this.confirmationWindow)return void r({confirmed:!1});this.confirmationWindow.location.href=`${this.config.passportDomain}/transaction-confirmation/transaction.html?transactionId=${e}&imxEtherAddress=${t}&chainType=starkex`;const a=setInterval((()=>{this.confirmationWindow?.closed&&(clearInterval(a),window.removeEventListener("message",i),r({confirmed:!1}))}),1e3)}))}loading(e){this.confirmationWindow=Lz({url:`${this.config.passportDomain}/transaction-confirmation/loading.html`,title:Uz,width:e?.width||480,height:e?.height||380})}closeWindow(){this.confirmationWindow?.close()}}var qz,zz,Hz;!function(e){e.PENDING="PENDING",e.SUBMITTED="SUBMITTED",e.SUCCESSFUL="SUCCESSFUL",e.REVERTED="REVERTED",e.FAILED="FAILED"}(qz||(qz={})),e.ProviderEvent=void 0,(e.ProviderEvent||(e.ProviderEvent={})).ACCOUNTS_CHANGED="accountsChanged";class Vz{emitter=new kE;emit(e,...t){this.emitter.emit(e,...t)}on(e,t){this.emitter.on(e,t)}removeListener(e,t){this.emitter.removeListener(e,t)}}class Gz{config;constructor({config:e}){this.config=e}async postToRelayer(e){const t={id:1,jsonrpc:"2.0",...e},r=await fetch(`${this.config.relayerUrl}/v1/transactions`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)}),n=await r.json();if(n.error)throw n.error;return n}async ethSendTransaction(e,t){const r={method:"eth_sendTransaction",params:[{to:e,data:t,chainId:this.config.zkEvmChainId.toString()}]},{result:n}=await this.postToRelayer(r);return n}async imGetTransactionByHash(e){const t={method:"im_getTransactionByHash",params:[e]},{result:r}=await this.postToRelayer(t);return r}async imGetFeeOptions(e,t){const r={method:"im_getFeeOptions",params:[{userAddress:e,data:t,chainId:this.config.zkEvmChainId.toString()}]},{result:n}=await this.postToRelayer(r);return n}}e.ProviderErrorCode=void 0,(zz=e.ProviderErrorCode||(e.ProviderErrorCode={}))[zz.USER_REJECTED_REQUEST=4001]="USER_REJECTED_REQUEST",zz[zz.UNAUTHORIZED=4100]="UNAUTHORIZED",zz[zz.UNSUPPORTED_METHOD=4200]="UNSUPPORTED_METHOD",zz[zz.DISCONNECTED=4900]="DISCONNECTED",e.RpcErrorCode=void 0,(Hz=e.RpcErrorCode||(e.RpcErrorCode={}))[Hz.RPC_SERVER_ERROR=-32e3]="RPC_SERVER_ERROR",Hz[Hz.INVALID_REQUEST=-32600]="INVALID_REQUEST",Hz[Hz.METHOD_NOT_FOUND=-32601]="METHOD_NOT_FOUND",Hz[Hz.INVALID_PARAMS=-32602]="INVALID_PARAMS",Hz[Hz.INTERNAL_ERROR=-32603]="INTERNAL_ERROR",Hz[Hz.PARSE_ERROR=-32700]="PARSE_ERROR";class Wz extends Error{message;code;constructor(e,t){super(t),this.message=t,this.code=e}}const Kz=async({authManager:t,config:r,magicAdapter:n,multiRollupApiClients:i})=>{const a=await t.getUser()||await t.login();if(!a.idToken)throw new Error("User is missing idToken");const o=await n.login(a.idToken,r.network);if(!a.zkEvm){const r=await async function({authManager:t,magicProvider:r,multiRollupApiClients:n,accessToken:i}){const a=new uy(r).getSigner(),o=await a.getAddress(),s=await Bq("Only sign this message from Immutable Passport",a),u={Authorization:`Bearer ${i}`};try{await n.passportApi.createCounterfactualAddress({createCounterfactualAddressRequest:{ethereumAddress:o,ethereumSignature:s}},{headers:u})}catch(t){throw new Wz(e.RpcErrorCode.INTERNAL_ERROR,`Failed to create counterfactual address: ${t}`)}const f=await t.loginSilent();if(!f?.zkEvm)throw new Wz(e.RpcErrorCode.INTERNAL_ERROR,"Failed to refresh user details");return f}({authManager:t,magicProvider:o,multiRollupApiClients:i,accessToken:a.accessToken});return{user:r,magicProvider:o}}return{user:a,magicProvider:o}};const Xz=async(e,t,r,n,i)=>{const a=e.map((e=>({delegateCall:!0===e.delegateCall,revertOnError:!0===e.revertOnError,gasLimit:e.gasLimit??qo,target:e.to??Uo,value:e.value??qo,data:e.data??[]})));const o=function(e,t){return ao(xs.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=Ii(ao(gy(["string","uint256","address","bytes32"],["",r,n,o]))),u=await i.signMessage(s),f=pz({threshold:1,signers:[{weight:1,signature:`${u}02`}]}),c=new Bu(Fq.mainModule.abi);return c.encodeFunctionData(c.getFunction("execute"),[a,t,f])},$z=e=>Qi.from(e).toNumber(),Jz=async({transactionAPI:t,chainId:r,nonce:n,user:i,metaTransactions:a})=>{const o={Authorization:`Bearer ${i.accessToken}`},s=(t=>{try{return t.map((e=>({delegateCall:!0===e.delegateCall,revertOnError:!0===e.revertOnError,gasLimit:e.gasLimit?$z(e.gasLimit).toString():"0",target:e.to??Uo,value:e.value?$z(e.value).toString():"0",data:e.data?e.data.toString():"0x00"})))}catch(t){const r=t instanceof Error?t.message:String(t);throw new Wz(e.RpcErrorCode.INVALID_PARAMS,`Transaction failed to parsing: ${r}`)}})(a);try{await t.evaluateTransaction({id:"evm",transactionEvaluationRequest:{chainType:"evm",chainId:r,transactionData:{nonce:n,userAddress:i.zkEvm.ethAddress,metaTransactions:s}}},{headers:o})}catch(t){const r=t instanceof Error?t.message:String(t);throw new Wz(e.RpcErrorCode.INTERNAL_ERROR,`Transaction failed to validate with error: ${r}`)}},Yz=async({params:t,magicProvider:r,jsonRpcProvider:n,relayerClient:i,transactionAPI:a,config:o,user:s})=>{const u=t[0];if(!u.to)throw new Wz(e.RpcErrorCode.INVALID_PARAMS,'eth_sendTransaction requires a "to" field');const f=(e=>{const t=e.split(":");if(2!==t.length)throw new Error("Invalid configuration, chain ID is not in CAIP-2 format");return Qi.from(t[1])})(o.zkEvmChainId),c=new uy(r).getSigner(),l=await(async(e,t)=>{const r=await e.send("eth_getCode",[t,"latest"]);if(r&&"0x"!==r)return new gd(t,Fq.mainModule.abi,e).nonce();return 0})(n,s.zkEvm.ethAddress),d={to:u.to,data:u.data,nonce:l,value:u.value,revertOnError:!0},p=await Xz([d],l,f,s.zkEvm.ethAddress,c),h=(await i.imGetFeeOptions(s.zkEvm.ethAddress,p)).find((e=>"IMX"===e.tokenSymbol));if(!h)throw new Error("Failed to retrieve fees for IMX token");const m={nonce:l,to:h.recipientAddress,value:h.tokenPrice,revertOnError:!0};await Jz({transactionAPI:a,chainId:o.zkEvmChainId,nonce:$z(l),user:s,metaTransactions:[d,m]});const y=await Xz([d,m],l,f,s.zkEvm.ethAddress,c),b=await i.ethSendTransaction(s.zkEvm.ethAddress,y),g=await Sz((async()=>{const e=await i.imGetTransactionByHash(b);if(e.status===qz.PENDING)throw new Error;return e}),{retries:30,interval:1e3,finalErr:new Wz(e.RpcErrorCode.RPC_SERVER_ERROR,"transaction hash not generated in time")});if(![qz.SUBMITTED,qz.SUCCESSFUL].includes(g.status))throw new Wz(e.RpcErrorCode.RPC_SERVER_ERROR,`Transaction failed to submit with status ${g.status}`);return g.hash};class Qz{authManager;config;confirmationScreen;magicAdapter;relayerClient;transactionAPI;multiRollupApiClients;jsonRpcProvider;eventEmitter;magicProvider;user;constructor({authManager:e,magicAdapter:t,config:r,confirmationScreen:n,multiRollupApiClients:i}){this.authManager=e,this.magicAdapter=t,this.config=r,this.confirmationScreen=n,this.relayerClient=new Gz({config:r}),this.transactionAPI=new Nq(new Pq({basePath:this.config.imxPublicApiDomain})),this.jsonRpcProvider=new om(this.config.zkEvmRpcUrl),this.multiRollupApiClients=i,this.eventEmitter=new Vz}isLoggedIn(){return void 0!==this.magicProvider&&void 0!==this.user}async performRequest(t){switch(t.method){case"eth_requestAccounts":{if(this.isLoggedIn())return[this.user.zkEvm.ethAddress];const{magicProvider:t,user:r}=await Kz({authManager:this.authManager,config:this.config,magicAdapter:this.magicAdapter,multiRollupApiClients:this.multiRollupApiClients});return this.user=r,this.magicProvider=t,this.eventEmitter.emit(e.ProviderEvent.ACCOUNTS_CHANGED,[this.user.zkEvm.ethAddress]),[this.user.zkEvm.ethAddress]}case"eth_sendTransaction":if(!this.isLoggedIn())throw new Wz(e.ProviderErrorCode.UNAUTHORIZED,"Unauthorised - call eth_requestAccounts first");return Yz({params:t.params||[],magicProvider:this.magicProvider,transactionAPI:this.transactionAPI,jsonRpcProvider:this.jsonRpcProvider,config:this.config,relayerClient:this.relayerClient,user:this.user});case"eth_accounts":return this.isLoggedIn()?[this.user.zkEvm.ethAddress]:[];case"eth_gasPrice":case"eth_getBalance":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(t.method,t.params||[]);default:throw new Wz(e.ProviderErrorCode.UNSUPPORTED_METHOD,"Method not supported")}}async performJsonRpcRequest(t){const{id:r,jsonrpc:n}=t;try{return{id:r,jsonrpc:n,result:await this.performRequest(t)}}catch(t){let i;return i=t instanceof Wz?t:t instanceof Error?new Wz(e.RpcErrorCode.INTERNAL_ERROR,t.message):new Wz(e.RpcErrorCode.INTERNAL_ERROR,"Internal error"),{id:r,jsonrpc:n,error:i}}}async request(t){try{return this.performRequest(t)}catch(t){if(t instanceof Wz)throw t;if(t instanceof Error)throw new Wz(e.RpcErrorCode.INTERNAL_ERROR,t.message);throw new Wz(e.RpcErrorCode.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(t,r,n){if("string"==typeof t)return"function"==typeof r?this.sendAsync({method:t,params:[]},r):n?this.sendAsync({method:t,params:Array.isArray(r)?r:[]},n):this.request({method:t,params:Array.isArray(r)?r:[]});if("function"==typeof r)return this.sendAsync(t,r);if(!Array.isArray(t)&&"object"==typeof t)return this.performJsonRpcRequest(t);throw new Wz(e.RpcErrorCode.INVALID_REQUEST,"Invalid request")}on(e,t){this.eventEmitter.on(e,t)}removeListener(e,t){this.eventEmitter.removeListener(e,t)}}var Zz=sn("object"==typeof self?self.FormData:window.FormData),eH={},tH={},rH=un(oz),nH=un(My),iH={},aH=un(Du),oH=un(Oo),sH=un(Ms),uH=un(Ad),fH=un(Gi),cH=un(Ou),lH=un(ep),dH=un(Fp),pH=un(oo),hH=un(Ti),mH=un(Id),yH=un(_y),bH=un(op),gH=un(Ra),vH=un(yo),wH=un(Ll),_H=un(Es),EH=un(rd),TH=un(xy),AH=un(Hp),SH=un(sh);!function(e){var t=on&&on.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),r=on&&on.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),n=on&&on.__importStar||function(e){if(e&&e.__esModule)return e;var n={};if(null!=e)for(var i in e)"default"!==i&&Object.prototype.hasOwnProperty.call(e,i)&&t(n,e,i);return r(n,e),n};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=aH;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=oH;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=n(sH);e.base64=o;var s=uH;Object.defineProperty(e,"base58",{enumerable:!0,get:function(){return s.Base58}});var u=fH;Object.defineProperty(e,"arrayify",{enumerable:!0,get:function(){return u.arrayify}}),Object.defineProperty(e,"concat",{enumerable:!0,get:function(){return u.concat}}),Object.defineProperty(e,"hexConcat",{enumerable:!0,get:function(){return u.hexConcat}}),Object.defineProperty(e,"hexDataSlice",{enumerable:!0,get:function(){return u.hexDataSlice}}),Object.defineProperty(e,"hexDataLength",{enumerable:!0,get:function(){return u.hexDataLength}}),Object.defineProperty(e,"hexlify",{enumerable:!0,get:function(){return u.hexlify}}),Object.defineProperty(e,"hexStripZeros",{enumerable:!0,get:function(){return u.hexStripZeros}}),Object.defineProperty(e,"hexValue",{enumerable:!0,get:function(){return u.hexValue}}),Object.defineProperty(e,"hexZeroPad",{enumerable:!0,get:function(){return u.hexZeroPad}}),Object.defineProperty(e,"isBytes",{enumerable:!0,get:function(){return u.isBytes}}),Object.defineProperty(e,"isBytesLike",{enumerable:!0,get:function(){return u.isBytesLike}}),Object.defineProperty(e,"isHexString",{enumerable:!0,get:function(){return u.isHexString}}),Object.defineProperty(e,"joinSignature",{enumerable:!0,get:function(){return u.joinSignature}}),Object.defineProperty(e,"zeroPad",{enumerable:!0,get:function(){return u.zeroPad}}),Object.defineProperty(e,"splitSignature",{enumerable:!0,get:function(){return u.splitSignature}}),Object.defineProperty(e,"stripZeros",{enumerable:!0,get:function(){return u.stripZeros}});var f=cH;Object.defineProperty(e,"_TypedDataEncoder",{enumerable:!0,get:function(){return f._TypedDataEncoder}}),Object.defineProperty(e,"dnsEncode",{enumerable:!0,get:function(){return f.dnsEncode}}),Object.defineProperty(e,"hashMessage",{enumerable:!0,get:function(){return f.hashMessage}}),Object.defineProperty(e,"id",{enumerable:!0,get:function(){return f.id}}),Object.defineProperty(e,"isValidName",{enumerable:!0,get:function(){return f.isValidName}}),Object.defineProperty(e,"namehash",{enumerable:!0,get:function(){return f.namehash}});var c=lH;Object.defineProperty(e,"defaultPath",{enumerable:!0,get:function(){return c.defaultPath}}),Object.defineProperty(e,"entropyToMnemonic",{enumerable:!0,get:function(){return c.entropyToMnemonic}}),Object.defineProperty(e,"getAccountPath",{enumerable:!0,get:function(){return c.getAccountPath}}),Object.defineProperty(e,"HDNode",{enumerable:!0,get:function(){return c.HDNode}}),Object.defineProperty(e,"isValidMnemonic",{enumerable:!0,get:function(){return c.isValidMnemonic}}),Object.defineProperty(e,"mnemonicToEntropy",{enumerable:!0,get:function(){return c.mnemonicToEntropy}}),Object.defineProperty(e,"mnemonicToSeed",{enumerable:!0,get:function(){return c.mnemonicToSeed}});var l=dH;Object.defineProperty(e,"getJsonWalletAddress",{enumerable:!0,get:function(){return l.getJsonWalletAddress}});var d=pH;Object.defineProperty(e,"keccak256",{enumerable:!0,get:function(){return d.keccak256}});var p=hH;Object.defineProperty(e,"Logger",{enumerable:!0,get:function(){return p.Logger}});var h=mH;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 m=yH;Object.defineProperty(e,"solidityKeccak256",{enumerable:!0,get:function(){return m.keccak256}}),Object.defineProperty(e,"solidityPack",{enumerable:!0,get:function(){return m.pack}}),Object.defineProperty(e,"soliditySha256",{enumerable:!0,get:function(){return m.sha256}});var y=bH;Object.defineProperty(e,"randomBytes",{enumerable:!0,get:function(){return y.randomBytes}}),Object.defineProperty(e,"shuffled",{enumerable:!0,get:function(){return y.shuffled}});var b=gH;Object.defineProperty(e,"checkProperties",{enumerable:!0,get:function(){return b.checkProperties}}),Object.defineProperty(e,"deepCopy",{enumerable:!0,get:function(){return b.deepCopy}}),Object.defineProperty(e,"defineReadOnly",{enumerable:!0,get:function(){return b.defineReadOnly}}),Object.defineProperty(e,"getStatic",{enumerable:!0,get:function(){return b.getStatic}}),Object.defineProperty(e,"resolveProperties",{enumerable:!0,get:function(){return b.resolveProperties}}),Object.defineProperty(e,"shallowCopy",{enumerable:!0,get:function(){return b.shallowCopy}});var g=n(vH);e.RLP=g;var v=wH;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=_H;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 _=EH;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=TH;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=AH;Object.defineProperty(e,"verifyMessage",{enumerable:!0,get:function(){return T.verifyMessage}}),Object.defineProperty(e,"verifyTypedData",{enumerable:!0,get:function(){return T.verifyTypedData}});var A=SH;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 S=mH;Object.defineProperty(e,"SupportedAlgorithm",{enumerable:!0,get:function(){return S.SupportedAlgorithm}});var k=_H;Object.defineProperty(e,"UnicodeNormalizationForm",{enumerable:!0,get:function(){return k.UnicodeNormalizationForm}}),Object.defineProperty(e,"Utf8ErrorReason",{enumerable:!0,get:function(){return k.Utf8ErrorReason}})}(iH);var kH={};Object.defineProperty(kH,"__esModule",{value:!0}),kH.DomainRegistryABI=void 0;kH.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 OH={};Object.defineProperty(OH,"__esModule",{value:!0}),OH.SeaportABIv14=void 0;OH.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 RH={};!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=nH;var r,n,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"}(r||(e.OrderType=r={})),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"}(n||(e.ItemType=n={})),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"}(RH);var xH={},IH={};Object.defineProperty(IH,"__esModule",{value:!0}),IH.ERC20ABI=void 0;IH.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 CH={};Object.defineProperty(CH,"__esModule",{value:!0}),CH.ERC721ABI=void 0;CH.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 NH,PH={},MH={};function BH(){if(NH)return MH;NH=1,Object.defineProperty(MH,"__esModule",{value:!0}),MH.getItemToCriteriaMap=MH.generateCriteriaResolvers=void 0;const e=RH,t=LH();MH.generateCriteriaResolvers=({orders:r,offerCriterias:n=[[]],considerationCriterias:i=[[]]})=>{const a=r.flatMap(((r,n)=>r.parameters.offer.map(((t,r)=>({orderIndex:n,item:t,index:r,side:e.Side.OFFER}))).filter((({item:e})=>(0,t.isCriteriaItem)(e.itemType))))),o=r.flatMap(((r,n)=>r.parameters.consideration.map(((t,r)=>({orderIndex:n,item:t,index:r,side:e.Side.CONSIDERATION}))).filter((({item:e})=>(0,t.isCriteriaItem)(e.itemType))))),s=(e,t)=>e.map((({orderIndex:e,item:r,index:n,side:i})=>{const a=r.identifierOrCriteria||"0",o=t[e][n];return{orderIndex:e,index:n,side:i,identifier:o.identifier,criteriaProof:"0"===a?[]:o.proof}}));return[...s(a,n),...s(o,i)]};return MH.getItemToCriteriaMap=(e,r)=>{const n=[...r];return e.reduce(((e,r)=>((0,t.isCriteriaItem)(r.itemType)&&e.set(r,n.shift()),e)),new Map)},MH}var DH,FH={};function LH(){return DH||(DH=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=nH,r=RH,n=BH(),i=FH;e.isCurrencyItem=({itemType:e})=>[r.ItemType.NATIVE,r.ItemType.ERC20].includes(e);e.isNativeCurrencyItem=({itemType:e})=>e===r.ItemType.NATIVE;e.isErc20Item=e=>e===r.ItemType.ERC20;e.isErc721Item=e=>[r.ItemType.ERC721,r.ItemType.ERC721_WITH_CRITERIA].includes(e);e.isErc1155Item=e=>[r.ItemType.ERC1155,r.ItemType.ERC1155_WITH_CRITERIA].includes(e);e.isCriteriaItem=e=>[r.ItemType.ERC721_WITH_CRITERIA,r.ItemType.ERC1155_WITH_CRITERIA].includes(e);e.getPresentItemAmount=({startAmount:e,endAmount:r,timeBasedItemParams:n})=>{const i=t.BigNumber.from(e),a=t.BigNumber.from(r);if(!n)return i.gt(a)?i:a;const{isConsiderationItem:o,currentBlockTimestamp:s,ascendingAmountTimestampBuffer:u,startTime:f,endTime:c}=n,l=t.BigNumber.from(c).sub(f),d=a.gt(e),p=t.BigNumber.from(d?s+u:s);if(p.lt(f))return i;const h=(p.gt(c)?t.BigNumber.from(c):p).sub(f),m=l.sub(h);return i.mul(m).add(a.mul(h)).add(o?l.sub(1):0).div(l)};e.getSummedTokenAndIdentifierAmounts=({items:r,criterias:i,timeBasedItemParams:a})=>{const o=(0,n.getItemToCriteriaMap)(r,i),s=r.reduce(((r,n)=>{var i,s,u,f;const c=null!==(s=null===(i=o.get(n))||void 0===i?void 0:i.identifier)&&void 0!==s?s:n.identifierOrCriteria;return Object.assign(Object.assign({},r),{[n.token]:Object.assign(Object.assign({},r[n.token]),{[c]:(null!==(f=null===(u=r[n.token])||void 0===u?void 0:u[c])&&void 0!==f?f:t.BigNumber.from(0)).add((0,e.getPresentItemAmount)({startAmount:n.startAmount,endAmount:n.endAmount,timeBasedItemParams:a}))})})}),{});return s};e.getMaximumSizeForOrder=({parameters:{offer:e,consideration:t}})=>{const r=[...e,...t].flatMap((({startAmount:e,endAmount:t})=>[e,t]));return(0,i.findGcd)(r)}}(PH)),PH}!function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.findGcd=e.gcd=void 0;const t=nH;e.gcd=(r,n)=>{const i=t.BigNumber.from(r),a=t.BigNumber.from(n);return i.eq(0)?a:(0,e.gcd)(a.mod(r),i)};e.findGcd=r=>{let n=t.BigNumber.from(r[0]);for(let t=1;t<r.length;t++)if(n=(0,e.gcd)(r[t],n),n.eq(1))return n;return n}}(FH);var UH={};!function(e){var t=on&&on.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,a){function o(e){try{u(n.next(e))}catch(e){a(e)}}function s(e){try{u(n.throw(e))}catch(e){a(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(o,s)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0}),e.getTagFromDomain=e.getTransactionMethods=e.executeAllActions=void 0;const r=iH;e.executeAllActions=e=>t(void 0,void 0,void 0,(function*(){for(let t=0;t<e.length-1;t++){const r=e[t];if("approval"===r.type){const e=yield r.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=(r,n,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 u=o=>t(void 0,void 0,void 0,(function*(){const t=Object.assign(Object.assign({},s),o),u=yield r.populateTransaction[n](...i,t);if(a){const t=(0,e.getTagFromDomain)(a);u.data=u.data+t}return u}));return{callStatic:e=>{const t=Object.assign(Object.assign({},s),e);return r.callStatic[n](...i,t)},estimateGas:e=>{const t=Object.assign(Object.assign({},s),e);return r.estimateGas[n](...i,t)},transact:e=>t(void 0,void 0,void 0,(function*(){const t=Object.assign(Object.assign({},s),e),n=yield u(t);return r.signer.sendTransaction(n)})),buildTransaction:u}};e.getTagFromDomain=e=>(0,r.keccak256)((0,r.toUtf8Bytes)(e)).slice(2,10)}(UH);var jH=on&&on.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,a){function o(e){try{u(n.next(e))}catch(e){a(e)}}function s(e){try{u(n.throw(e))}catch(e){a(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(o,s)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(xH,"__esModule",{value:!0}),xH.getApprovalActions=xH.approvedItemAmount=void 0;const qH=nH,zH=IH,HH=CH,VH=RH,GH=LH(),WH=UH;xH.approvedItemAmount=(e,t,r,n)=>jH(void 0,void 0,void 0,(function*(){if((0,GH.isErc721Item)(t.itemType)||(0,GH.isErc1155Item)(t.itemType)){return new qH.Contract(t.token,HH.ERC721ABI,n).isApprovedForAll(e,r).then((e=>e?VH.MAX_INT:qH.BigNumber.from(0)))}if(t.itemType===VH.ItemType.ERC20){return new qH.Contract(t.token,zH.ERC20ABI,n).allowance(e,r)}return VH.MAX_INT})),xH.getApprovalActions=function(e,t,r){return e.filter(((t,r)=>r===e.length-1||e[r+1].token!==t.token)).map((({token:e,operator:n,itemType:i,identifierOrCriteria:a,requiredApprovedAmount:o})=>{const s=(0,GH.isErc1155Item)(i);if((0,GH.isErc721Item)(i)||s){const o=new qH.Contract(e,HH.ERC721ABI,r);return{type:"approval",token:e,identifierOrCriteria:a,itemType:i,operator:n,transactionMethods:(0,WH.getTransactionMethods)(o.connect(r),t&&!s?"approve":"setApprovalForAll",[n,!(t&&!s)||a])}}{const s=new qH.Contract(e,zH.ERC20ABI,r);return{type:"approval",token:e,identifierOrCriteria:a,itemType:i,transactionMethods:(0,WH.getTransactionMethods)(s.connect(r),"approve",[n,t?o:VH.MAX_INT]),operator:n}}}))};var KH={},XH={},$H={};Object.defineProperty($H,"__esModule",{value:!0}),$H.ERC1155ABI=void 0;$H.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 JH=on&&on.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,a){function o(e){try{u(n.next(e))}catch(e){a(e)}}function s(e){try{u(n.throw(e))}catch(e){a(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(o,s)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(XH,"__esModule",{value:!0}),XH.balanceOf=void 0;const YH=nH,QH=$H,ZH=IH,eV=CH,tV=RH,rV=LH();XH.balanceOf=(e,t,r,n)=>JH(void 0,void 0,void 0,(function*(){if((0,rV.isErc721Item)(t.itemType)){const i=new YH.Contract(t.token,eV.ERC721ABI,r);return t.itemType===tV.ItemType.ERC721_WITH_CRITERIA?n?i.ownerOf(n.identifier).then((t=>YH.BigNumber.from(Number(t.toLowerCase()===e.toLowerCase())))):i.balanceOf(e):i.ownerOf(t.identifierOrCriteria).then((t=>YH.BigNumber.from(Number(t.toLowerCase()===e.toLowerCase()))))}if((0,rV.isErc1155Item)(t.itemType)){const i=new YH.Contract(t.token,QH.ERC1155ABI,r);if(t.itemType===tV.ItemType.ERC1155_WITH_CRITERIA){if(!n){const e=YH.BigNumber.from(t.startAmount),r=YH.BigNumber.from(t.endAmount);return e.gt(r)?e:r}return i.balanceOf(e,n.identifier)}return i.balanceOf(e,t.identifierOrCriteria)}if((0,rV.isErc20Item)(t.itemType)){return new YH.Contract(t.token,ZH.ERC20ABI,r).balanceOf(e)}return r.getBalance(e)})),function(e){var t=on&&on.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,a){function o(e){try{u(n.next(e))}catch(e){a(e)}}function s(e){try{u(n.throw(e))}catch(e){a(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(o,s)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0}),e.validateStandardFulfillBalancesAndApprovals=e.validateBasicFulfillBalancesAndApprovals=e.validateOfferBalancesAndApprovals=e.getInsufficientBalanceAndApprovalAmounts=e.getBalancesAndApprovals=void 0;const r=nH,n=RH,i=xH,a=XH,o=BH(),s=LH(),u=(e,t,r)=>{const n=e.find((({token:e,identifierOrCriteria:n})=>t.toLowerCase()===e.toLowerCase()&&n.toLowerCase()===r.toLowerCase()));if(!n)throw new Error("Balances and approvals didn't contain all tokens and identifiers");return n};e.getBalancesAndApprovals=({owner:e,items:u,criterias:f,operator:c,multicallProvider:l})=>t(void 0,void 0,void 0,(function*(){const d=(0,o.getItemToCriteriaMap)(u,f);return Promise.all(u.map((o=>t(void 0,void 0,void 0,(function*(){var t,u;let f=Promise.resolve(r.BigNumber.from(0));return f=(0,s.isErc721Item)(o.itemType)||(0,s.isErc1155Item)(o.itemType)||(0,s.isErc20Item)(o.itemType)?(0,i.approvedItemAmount)(e,o,c,l):Promise.resolve(n.MAX_INT),{token:o.token,identifierOrCriteria:null!==(u=null===(t=d.get(o))||void 0===t?void 0:t.identifier)&&void 0!==u?u:o.identifierOrCriteria,balance:yield(0,a.balanceOf)(e,o,l,d.get(o)),approvedAmount:yield f,itemType:o.itemType}})))))}));e.getInsufficientBalanceAndApprovalAmounts=({balancesAndApprovals:e,tokenAndIdentifierAmounts:t,operator:r})=>{const n=[...Object.entries(t).map((([e,t])=>Object.entries(t).map((([t,r])=>[e,t,r]))))].flat(),i=t=>n.filter((([r,n,i])=>u(e,r,n)[t].lt(i))).map((([r,n,i])=>{const a=u(e,r,n);return{token:r,identifierOrCriteria:n,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:r})))];return{insufficientBalances:a,insufficientApprovals:o}};e.validateOfferBalancesAndApprovals=({offer:t,criterias:r,balancesAndApprovals:n,timeBasedItemParams:i,throwOnInsufficientBalances:a=!0,throwOnInsufficientApprovals:o,operator:u})=>{const{insufficientBalances:f,insufficientApprovals:c}=(0,e.getInsufficientBalanceAndApprovalAmounts)({balancesAndApprovals:n,tokenAndIdentifierAmounts:(0,s.getSummedTokenAndIdentifierAmounts)({items:t,criterias:r,timeBasedItemParams:i?Object.assign(Object.assign({},i),{isConsiderationItem:!1}):void 0}),operator:u});if(a&&f.length>0)throw new Error("The offerer does not have the amount needed to create or fulfill.");if(o&&c.length>0)throw new Error("The offerer does not have the sufficient approvals.");return c};e.validateBasicFulfillBalancesAndApprovals=({offer:t,consideration:r,offererBalancesAndApprovals:n,fulfillerBalancesAndApprovals:i,timeBasedItemParams:a,offererOperator:o,fulfillerOperator:u})=>{(0,e.validateOfferBalancesAndApprovals)({offer:t,criterias:[],balancesAndApprovals:n,timeBasedItemParams:a,throwOnInsufficientApprovals:!0,operator:o});const f=r.filter((e=>e.itemType!==t[0].itemType)),{insufficientBalances:c,insufficientApprovals:l}=(0,e.getInsufficientBalanceAndApprovalAmounts)({balancesAndApprovals:i,tokenAndIdentifierAmounts:(0,s.getSummedTokenAndIdentifierAmounts)({items:f,criterias:[],timeBasedItemParams:Object.assign(Object.assign({},a),{isConsiderationItem:!0})}),operator:u});if(c.length>0)throw new Error("The fulfiller does not have the balances needed to fulfill.");return l};e.validateStandardFulfillBalancesAndApprovals=({offer:t,consideration:r,offerCriteria:n,considerationCriteria:i,offererBalancesAndApprovals:a,fulfillerBalancesAndApprovals:o,timeBasedItemParams:u,offererOperator:c,fulfillerOperator:l})=>{(0,e.validateOfferBalancesAndApprovals)({offer:t,criterias:n,balancesAndApprovals:a,timeBasedItemParams:u,throwOnInsufficientApprovals:!0,operator:c});const d=f({items:t,criterias:n,balancesAndApprovals:o,timeBasedItemParams:u}),{insufficientBalances:p,insufficientApprovals:h}=(0,e.getInsufficientBalanceAndApprovalAmounts)({balancesAndApprovals:d,tokenAndIdentifierAmounts:(0,s.getSummedTokenAndIdentifierAmounts)({items:r,criterias:i,timeBasedItemParams:Object.assign(Object.assign({},u),{isConsiderationItem:!0})}),operator:l});if(p.length>0)throw new Error("The fulfiller does not have the balances needed to fulfill.");return h};const f=({items:e,criterias:t,timeBasedItemParams:r,balancesAndApprovals:n})=>{const i=(0,s.getSummedTokenAndIdentifierAmounts)({items:e,criterias:t,timeBasedItemParams:Object.assign(Object.assign({},r),{isConsiderationItem:!1})}),a=n.map((e=>Object.assign({},e)));return Object.entries(i).forEach((([e,t])=>Object.entries(t).forEach((([t,r])=>{const n=u(a,e,t),i=a.indexOf(n);a[i].balance=a[i].balance.add(r)})))),a}}(KH);var nV,iV={},aV={},oV={},sV={},uV={exports:{}},fV={exports:{}};function cV(){return nV||(nV=1,function(e,t){e.exports=function(){var e=e||function(e,t){var r=Object.create||function(){function e(){}return function(t){var r;return e.prototype=t,r=new e,e.prototype=null,r}}(),n={},i=n.lib={},a=i.Base={extend:function(e){var t=r(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,r){e=this.words=e||[],this.sigBytes=r!=t?r:4*e.length},toString:function(e){return(e||u).stringify(this)},concat:function(e){var t=this.words,r=e.words,n=this.sigBytes,i=e.sigBytes;if(this.clamp(),n%4)for(var a=0;a<i;a++){var o=r[a>>>2]>>>24-a%4*8&255;t[n+a>>>2]|=o<<24-(n+a)%4*8}else for(a=0;a<i;a+=4)t[n+a>>>2]=r[a>>>2];return this.sigBytes+=i,this},clamp:function(){var t=this.words,r=this.sigBytes;t[r>>>2]&=4294967295<<32-r%4*8,t.length=e.ceil(r/4)},clone:function(){var e=a.clone.call(this);return e.words=this.words.slice(0),e},random:function(t){for(var r,n=[],i=function(t){var r=987654321,n=4294967295;return function(){var i=((r=36969*(65535&r)+(r>>16)&n)<<16)+(t=18e3*(65535&t)+(t>>16)&n)&n;return i/=4294967296,(i+=.5)*(e.random()>.5?1:-1)}},a=0;a<t;a+=4){var s=i(4294967296*(r||e.random()));r=987654071*s(),n.push(4294967296*s()|0)}return new o.init(n,t)}}),s=n.enc={},u=s.Hex={stringify:function(e){for(var t=e.words,r=e.sigBytes,n=[],i=0;i<r;i++){var a=t[i>>>2]>>>24-i%4*8&255;n.push((a>>>4).toString(16)),n.push((15&a).toString(16))}return n.join("")},parse:function(e){for(var t=e.length,r=[],n=0;n<t;n+=2)r[n>>>3]|=parseInt(e.substr(n,2),16)<<24-n%8*4;return new o.init(r,t/2)}},f=s.Latin1={stringify:function(e){for(var t=e.words,r=e.sigBytes,n=[],i=0;i<r;i++){var a=t[i>>>2]>>>24-i%4*8&255;n.push(String.fromCharCode(a))}return n.join("")},parse:function(e){for(var t=e.length,r=[],n=0;n<t;n++)r[n>>>2]|=(255&e.charCodeAt(n))<<24-n%4*8;return new o.init(r,t)}},c=s.Utf8={stringify:function(e){try{return decodeURIComponent(escape(f.stringify(e)))}catch(e){throw new Error("Malformed UTF-8 data")}},parse:function(e){return f.parse(unescape(encodeURIComponent(e)))}},l=i.BufferedBlockAlgorithm=a.extend({reset:function(){this._data=new o.init,this._nDataBytes=0},_append:function(e){"string"==typeof e&&(e=c.parse(e)),this._data.concat(e),this._nDataBytes+=e.sigBytes},_process:function(t){var r=this._data,n=r.words,i=r.sigBytes,a=this.blockSize,s=i/(4*a),u=(s=t?e.ceil(s):e.max((0|s)-this._minBufferSize,0))*a,f=e.min(4*u,i);if(u){for(var c=0;c<u;c+=a)this._doProcessBlock(n,c);var l=n.splice(0,u);r.sigBytes-=f}return new o.init(l,f)},clone:function(){var e=a.clone.call(this);return e._data=this._data.clone(),e},_minBufferSize:0});i.Hasher=l.extend({cfg:a.extend(),init:function(e){this.cfg=this.cfg.extend(e),this.reset()},reset:function(){l.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,r){return new e.init(r).finalize(t)}},_createHmacHelper:function(e){return function(t,r){return new d.HMAC.init(e,r).finalize(t)}}});var d=n.algo={};return n}(Math);return e}()}(fV)),fV.exports}!function(e,t){e.exports=function(e){return function(t){var r=e,n=r.lib,i=n.WordArray,a=n.Hasher,o=r.algo,s=[],u=[];!function(){function e(e){for(var r=t.sqrt(e),n=2;n<=r;n++)if(!(e%n))return!1;return!0}function r(e){return 4294967296*(e-(0|e))|0}for(var n=2,i=0;i<64;)e(n)&&(i<8&&(s[i]=r(t.pow(n,.5))),u[i]=r(t.pow(n,1/3)),i++),n++}();var f=[],c=o.SHA256=a.extend({_doReset:function(){this._hash=new i.init(s.slice(0))},_doProcessBlock:function(e,t){for(var r=this._hash.words,n=r[0],i=r[1],a=r[2],o=r[3],s=r[4],c=r[5],l=r[6],d=r[7],p=0;p<64;p++){if(p<16)f[p]=0|e[t+p];else{var h=f[p-15],m=(h<<25|h>>>7)^(h<<14|h>>>18)^h>>>3,y=f[p-2],b=(y<<15|y>>>17)^(y<<13|y>>>19)^y>>>10;f[p]=m+f[p-7]+b+f[p-16]}var g=n&i^n&a^i&a,v=(n<<30|n>>>2)^(n<<19|n>>>13)^(n<<10|n>>>22),w=d+((s<<26|s>>>6)^(s<<21|s>>>11)^(s<<7|s>>>25))+(s&c^~s&l)+u[p]+f[p];d=l,l=c,c=s,s=o+w|0,o=a,a=i,i=n,n=w+(v+g)|0}r[0]=r[0]+n|0,r[1]=r[1]+i|0,r[2]=r[2]+a|0,r[3]=r[3]+o|0,r[4]=r[4]+s|0,r[5]=r[5]+c|0,r[6]=r[6]+l|0,r[7]=r[7]+d|0},_doFinalize:function(){var e=this._data,r=e.words,n=8*this._nDataBytes,i=8*e.sigBytes;return r[i>>>5]|=128<<24-i%32,r[14+(i+64>>>9<<4)]=t.floor(n/4294967296),r[15+(i+64>>>9<<4)]=n,e.sigBytes=4*r.length,this._process(),this._hash},clone:function(){var e=a.clone.call(this);return e._hash=this._hash.clone(),e}});r.SHA256=a._createHelper(c),r.HmacSHA256=a._createHmacHelper(c)}(Math),e.SHA256}(cV())}(uV);var lV=uV.exports,dV={exports:{}};!function(e,t){e.exports=function(){function e(e,t){var r=t?"└":"├";return r+=e?"─ ":"──┐"}function t(e,t){var r=[];for(var n in e)e.hasOwnProperty(n)&&(t&&"function"==typeof e[n]||r.push(n));return r}function r(n,i,a,o,s,u,f){var c,l,d="",p=0,h=o.slice(0);if(h.push([i,a])&&o.length>0&&(o.forEach((function(e,t){t>0&&(d+=(e[1]?" ":"│")+" "),l||e[0]!==i||(l=!0)})),d+=e(n,a)+n,s&&("object"!=typeof i||i instanceof Date)&&(d+=": "+i),l&&(d+=" (circular ref.)"),f(d)),!l&&"object"==typeof i){var m=t(i,u);m.forEach((function(e){c=++p===m.length,r(e,i[e],c,h,s,u,f)}))}}var n={asLines:function(e,t,n,i){r(".",e,!1,[],t,"function"!=typeof n&&n,i||n)},asTree:function(e,t,n){var i="";return r(".",e,!1,[],t,n,(function(e){i+=e+"\n"})),i}};return n}()}(dV);var pV,hV=dV.exports,mV={},yV={exports:{}},bV={exports:{}};function gV(){return pV||(pV=1,function(e,t){e.exports=function(e){return function(t){var r=e,n=r.lib,i=n.Base,a=n.WordArray,o=r.x64={};o.Word=i.extend({init:function(e,t){this.high=e,this.low=t}}),o.WordArray=i.extend({init:function(e,r){e=this.words=e||[],this.sigBytes=r!=t?r:8*e.length},toX32:function(){for(var e=this.words,t=e.length,r=[],n=0;n<t;n++){var i=e[n];r.push(i.high),r.push(i.low)}return a.create(r,this.sigBytes)},clone:function(){for(var e=i.clone.call(this),t=e.words=this.words.slice(0),r=t.length,n=0;n<r;n++)t[n]=t[n].clone();return e}})}(),e}(cV())}(bV)),bV.exports}var vV,wV={exports:{}};function _V(){return vV||(vV=1,function(e,t){e.exports=function(e){return function(){if("function"==typeof ArrayBuffer){var t=e.lib.WordArray,r=t.init,n=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,n=[],i=0;i<t;i++)n[i>>>2]|=e[i]<<24-i%4*8;r.call(this,n,t)}else r.apply(this,arguments)};n.prototype=t}}(),e.lib.WordArray}(cV())}(wV)),wV.exports}var EV,TV={exports:{}};function AV(){return EV||(EV=1,function(e,t){e.exports=function(e){return function(){var t=e,r=t.lib.WordArray,n=t.enc;function i(e){return e<<8&4278255360|e>>>8&16711935}n.Utf16=n.Utf16BE={stringify:function(e){for(var t=e.words,r=e.sigBytes,n=[],i=0;i<r;i+=2){var a=t[i>>>2]>>>16-i%4*8&65535;n.push(String.fromCharCode(a))}return n.join("")},parse:function(e){for(var t=e.length,n=[],i=0;i<t;i++)n[i>>>1]|=e.charCodeAt(i)<<16-i%2*16;return r.create(n,2*t)}},n.Utf16LE={stringify:function(e){for(var t=e.words,r=e.sigBytes,n=[],a=0;a<r;a+=2){var o=i(t[a>>>2]>>>16-a%4*8&65535);n.push(String.fromCharCode(o))}return n.join("")},parse:function(e){for(var t=e.length,n=[],a=0;a<t;a++)n[a>>>1]|=i(e.charCodeAt(a)<<16-a%2*16);return r.create(n,2*t)}}}(),e.enc.Utf16}(cV())}(TV)),TV.exports}var SV,kV={exports:{}};function OV(){return SV||(SV=1,function(e,t){e.exports=function(e){return function(){var t=e,r=t.lib.WordArray;function n(e,t,n){for(var i=[],a=0,o=0;o<t;o++)if(o%4){var s=n[e.charCodeAt(o-1)]<<o%4*2,u=n[e.charCodeAt(o)]>>>6-o%4*2;i[a>>>2]|=(s|u)<<24-a%4*8,a++}return r.create(i,a)}t.enc.Base64={stringify:function(e){var t=e.words,r=e.sigBytes,n=this._map;e.clamp();for(var i=[],a=0;a<r;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<r;s++)i.push(n.charAt(o>>>6*(3-s)&63));var u=n.charAt(64);if(u)for(;i.length%4;)i.push(u);return i.join("")},parse:function(e){var t=e.length,r=this._map,i=this._reverseMap;if(!i){i=this._reverseMap=[];for(var a=0;a<r.length;a++)i[r.charCodeAt(a)]=a}var o=r.charAt(64);if(o){var s=e.indexOf(o);-1!==s&&(t=s)}return n(e,t,i)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="}}(),e.enc.Base64}(cV())}(kV)),kV.exports}var RV,xV={exports:{}};function IV(){return RV||(RV=1,function(e,t){e.exports=function(e){return function(t){var r=e,n=r.lib,i=n.WordArray,a=n.Hasher,o=r.algo,s=[];!function(){for(var e=0;e<64;e++)s[e]=4294967296*t.abs(t.sin(e+1))|0}();var u=o.MD5=a.extend({_doReset:function(){this._hash=new i.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(e,t){for(var r=0;r<16;r++){var n=t+r,i=e[n];e[n]=16711935&(i<<8|i>>>24)|4278255360&(i<<24|i>>>8)}var a=this._hash.words,o=e[t+0],u=e[t+1],p=e[t+2],h=e[t+3],m=e[t+4],y=e[t+5],b=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],S=e[t+14],k=e[t+15],O=a[0],R=a[1],x=a[2],I=a[3];O=f(O,R,x,I,o,7,s[0]),I=f(I,O,R,x,u,12,s[1]),x=f(x,I,O,R,p,17,s[2]),R=f(R,x,I,O,h,22,s[3]),O=f(O,R,x,I,m,7,s[4]),I=f(I,O,R,x,y,12,s[5]),x=f(x,I,O,R,b,17,s[6]),R=f(R,x,I,O,g,22,s[7]),O=f(O,R,x,I,v,7,s[8]),I=f(I,O,R,x,w,12,s[9]),x=f(x,I,O,R,_,17,s[10]),R=f(R,x,I,O,E,22,s[11]),O=f(O,R,x,I,T,7,s[12]),I=f(I,O,R,x,A,12,s[13]),x=f(x,I,O,R,S,17,s[14]),O=c(O,R=f(R,x,I,O,k,22,s[15]),x,I,u,5,s[16]),I=c(I,O,R,x,b,9,s[17]),x=c(x,I,O,R,E,14,s[18]),R=c(R,x,I,O,o,20,s[19]),O=c(O,R,x,I,y,5,s[20]),I=c(I,O,R,x,_,9,s[21]),x=c(x,I,O,R,k,14,s[22]),R=c(R,x,I,O,m,20,s[23]),O=c(O,R,x,I,w,5,s[24]),I=c(I,O,R,x,S,9,s[25]),x=c(x,I,O,R,h,14,s[26]),R=c(R,x,I,O,v,20,s[27]),O=c(O,R,x,I,A,5,s[28]),I=c(I,O,R,x,p,9,s[29]),x=c(x,I,O,R,g,14,s[30]),O=l(O,R=c(R,x,I,O,T,20,s[31]),x,I,y,4,s[32]),I=l(I,O,R,x,v,11,s[33]),x=l(x,I,O,R,E,16,s[34]),R=l(R,x,I,O,S,23,s[35]),O=l(O,R,x,I,u,4,s[36]),I=l(I,O,R,x,m,11,s[37]),x=l(x,I,O,R,g,16,s[38]),R=l(R,x,I,O,_,23,s[39]),O=l(O,R,x,I,A,4,s[40]),I=l(I,O,R,x,o,11,s[41]),x=l(x,I,O,R,h,16,s[42]),R=l(R,x,I,O,b,23,s[43]),O=l(O,R,x,I,w,4,s[44]),I=l(I,O,R,x,T,11,s[45]),x=l(x,I,O,R,k,16,s[46]),O=d(O,R=l(R,x,I,O,p,23,s[47]),x,I,o,6,s[48]),I=d(I,O,R,x,g,10,s[49]),x=d(x,I,O,R,S,15,s[50]),R=d(R,x,I,O,y,21,s[51]),O=d(O,R,x,I,T,6,s[52]),I=d(I,O,R,x,h,10,s[53]),x=d(x,I,O,R,_,15,s[54]),R=d(R,x,I,O,u,21,s[55]),O=d(O,R,x,I,v,6,s[56]),I=d(I,O,R,x,k,10,s[57]),x=d(x,I,O,R,b,15,s[58]),R=d(R,x,I,O,A,21,s[59]),O=d(O,R,x,I,m,6,s[60]),I=d(I,O,R,x,E,10,s[61]),x=d(x,I,O,R,p,15,s[62]),R=d(R,x,I,O,w,21,s[63]),a[0]=a[0]+O|0,a[1]=a[1]+R|0,a[2]=a[2]+x|0,a[3]=a[3]+I|0},_doFinalize:function(){var e=this._data,r=e.words,n=8*this._nDataBytes,i=8*e.sigBytes;r[i>>>5]|=128<<24-i%32;var a=t.floor(n/4294967296),o=n;r[15+(i+64>>>9<<4)]=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8),r[14+(i+64>>>9<<4)]=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8),e.sigBytes=4*(r.length+1),this._process();for(var s=this._hash,u=s.words,f=0;f<4;f++){var c=u[f];u[f]=16711935&(c<<8|c>>>24)|4278255360&(c<<24|c>>>8)}return s},clone:function(){var e=a.clone.call(this);return e._hash=this._hash.clone(),e}});function f(e,t,r,n,i,a,o){var s=e+(t&r|~t&n)+i+o;return(s<<a|s>>>32-a)+t}function c(e,t,r,n,i,a,o){var s=e+(t&n|r&~n)+i+o;return(s<<a|s>>>32-a)+t}function l(e,t,r,n,i,a,o){var s=e+(t^r^n)+i+o;return(s<<a|s>>>32-a)+t}function d(e,t,r,n,i,a,o){var s=e+(r^(t|~n))+i+o;return(s<<a|s>>>32-a)+t}r.MD5=a._createHelper(u),r.HmacMD5=a._createHmacHelper(u)}(Math),e.MD5}(cV())}(xV)),xV.exports}var CV,NV={exports:{}};function PV(){return CV||(CV=1,function(e,t){e.exports=function(e){return function(){var t=e,r=t.lib,n=r.WordArray,i=r.Hasher,a=t.algo,o=[],s=a.SHA1=i.extend({_doReset:function(){this._hash=new n.init([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(e,t){for(var r=this._hash.words,n=r[0],i=r[1],a=r[2],s=r[3],u=r[4],f=0;f<80;f++){if(f<16)o[f]=0|e[t+f];else{var c=o[f-3]^o[f-8]^o[f-14]^o[f-16];o[f]=c<<1|c>>>31}var l=(n<<5|n>>>27)+u+o[f];l+=f<20?1518500249+(i&a|~i&s):f<40?1859775393+(i^a^s):f<60?(i&a|i&s|a&s)-1894007588:(i^a^s)-899497514,u=s,s=a,a=i<<30|i>>>2,i=n,n=l}r[0]=r[0]+n|0,r[1]=r[1]+i|0,r[2]=r[2]+a|0,r[3]=r[3]+s|0,r[4]=r[4]+u|0},_doFinalize:function(){var e=this._data,t=e.words,r=8*this._nDataBytes,n=8*e.sigBytes;return t[n>>>5]|=128<<24-n%32,t[14+(n+64>>>9<<4)]=Math.floor(r/4294967296),t[15+(n+64>>>9<<4)]=r,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}(cV())}(NV)),NV.exports}var MV,BV={exports:{}};var DV,FV={exports:{}};function LV(){return DV||(DV=1,function(e,t){e.exports=function(e){return function(){var t=e,r=t.lib.Hasher,n=t.x64,i=n.Word,a=n.WordArray,o=t.algo;function s(){return i.create.apply(i,arguments)}var u=[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)],f=[];!function(){for(var e=0;e<80;e++)f[e]=s()}();var c=o.SHA512=r.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 r=this._hash.words,n=r[0],i=r[1],a=r[2],o=r[3],s=r[4],c=r[5],l=r[6],d=r[7],p=n.high,h=n.low,m=i.high,y=i.low,b=a.high,g=a.low,v=o.high,w=o.low,_=s.high,E=s.low,T=c.high,A=c.low,S=l.high,k=l.low,O=d.high,R=d.low,x=p,I=h,C=m,N=y,P=b,M=g,B=v,D=w,F=_,L=E,U=T,j=A,q=S,z=k,H=O,V=R,G=0;G<80;G++){var W=f[G];if(G<16)var K=W.high=0|e[t+2*G],X=W.low=0|e[t+2*G+1];else{var $=f[G-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=f[G-2],te=ee.high,re=ee.low,ne=(te>>>19|re<<13)^(te<<3|re>>>29)^te>>>6,ie=(re>>>19|te<<13)^(re<<3|te>>>29)^(re>>>6|te<<26),ae=f[G-7],oe=ae.high,se=ae.low,ue=f[G-16],fe=ue.high,ce=ue.low;K=(K=(K=Q+oe+((X=Z+se)>>>0<Z>>>0?1:0))+ne+((X+=ie)>>>0<ie>>>0?1:0))+fe+((X+=ce)>>>0<ce>>>0?1:0),W.high=K,W.low=X}var le,de=F&U^~F&q,pe=L&j^~L&z,he=x&C^x&P^C&P,me=I&N^I&M^N&M,ye=(x>>>28|I<<4)^(x<<30|I>>>2)^(x<<25|I>>>7),be=(I>>>28|x<<4)^(I<<30|x>>>2)^(I<<25|x>>>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=u[G],_e=we.high,Ee=we.low,Te=H+ge+((le=V+ve)>>>0<V>>>0?1:0),Ae=be+me;H=q,V=z,q=U,z=j,U=F,j=L,F=B+(Te=(Te=(Te=Te+de+((le+=pe)>>>0<pe>>>0?1:0))+_e+((le+=Ee)>>>0<Ee>>>0?1:0))+K+((le+=X)>>>0<X>>>0?1:0))+((L=D+le|0)>>>0<D>>>0?1:0)|0,B=P,D=M,P=C,M=N,C=x,N=I,x=Te+(ye+he+(Ae>>>0<be>>>0?1:0))+((I=le+Ae|0)>>>0<le>>>0?1:0)|0}h=n.low=h+I,n.high=p+x+(h>>>0<I>>>0?1:0),y=i.low=y+N,i.high=m+C+(y>>>0<N>>>0?1:0),g=a.low=g+M,a.high=b+P+(g>>>0<M>>>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=c.low=A+j,c.high=T+U+(A>>>0<j>>>0?1:0),k=l.low=k+z,l.high=S+q+(k>>>0<z>>>0?1:0),R=d.low=R+V,d.high=O+H+(R>>>0<V>>>0?1:0)},_doFinalize:function(){var e=this._data,t=e.words,r=8*this._nDataBytes,n=8*e.sigBytes;return t[n>>>5]|=128<<24-n%32,t[30+(n+128>>>10<<5)]=Math.floor(r/4294967296),t[31+(n+128>>>10<<5)]=r,e.sigBytes=4*t.length,this._process(),this._hash.toX32()},clone:function(){var e=r.clone.call(this);return e._hash=this._hash.clone(),e},blockSize:32});t.SHA512=r._createHelper(c),t.HmacSHA512=r._createHmacHelper(c)}(),e.SHA512}(cV(),gV())}(FV)),FV.exports}var UV,jV={exports:{}};var qV,zV={exports:{}};function HV(){return qV||(qV=1,function(e,t){e.exports=function(e){return function(t){var r=e,n=r.lib,i=n.WordArray,a=n.Hasher,o=r.x64.Word,s=r.algo,u=[],f=[],c=[];!function(){for(var e=1,t=0,r=0;r<24;r++){u[e+5*t]=(r+1)*(r+2)/2%64;var n=(2*e+3*t)%5;e=t%5,t=n}for(e=0;e<5;e++)for(t=0;t<5;t++)f[e+5*t]=t+(2*e+3*t)%5*5;for(var i=1,a=0;a<24;a++){for(var s=0,l=0,d=0;d<7;d++){if(1&i){var p=(1<<d)-1;p<32?l^=1<<p:s^=1<<p-32}128&i?i=i<<1^113:i<<=1}c[a]=o.create(s,l)}}();var l=[];!function(){for(var e=0;e<25;e++)l[e]=o.create()}();var d=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 r=this._state,n=this.blockSize/2,i=0;i<n;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),(R=r[i]).high^=o,R.low^=a}for(var s=0;s<24;s++){for(var d=0;d<5;d++){for(var p=0,h=0,m=0;m<5;m++)p^=(R=r[d+5*m]).high,h^=R.low;var y=l[d];y.high=p,y.low=h}for(d=0;d<5;d++){var b=l[(d+4)%5],g=l[(d+1)%5],v=g.high,w=g.low;for(p=b.high^(v<<1|w>>>31),h=b.low^(w<<1|v>>>31),m=0;m<5;m++)(R=r[d+5*m]).high^=p,R.low^=h}for(var _=1;_<25;_++){var E=(R=r[_]).high,T=R.low,A=u[_];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 S=l[f[_]];S.high=p,S.low=h}var k=l[0],O=r[0];for(k.high=O.high,k.low=O.low,d=0;d<5;d++)for(m=0;m<5;m++){var R=r[_=d+5*m],x=l[_],I=l[(d+1)%5+5*m],C=l[(d+2)%5+5*m];R.high=x.high^~I.high&C.high,R.low=x.low^~I.low&C.low}R=r[0];var N=c[s];R.high^=N.high,R.low^=N.low}},_doFinalize:function(){var e=this._data,r=e.words;this._nDataBytes;var n=8*e.sigBytes,a=32*this.blockSize;r[n>>>5]|=1<<24-n%32,r[(t.ceil((n+1)/a)*a>>>5)-1]|=128,e.sigBytes=4*r.length,this._process();for(var o=this._state,s=this.cfg.outputLength/8,u=s/8,f=[],c=0;c<u;c++){var l=o[c],d=l.high,p=l.low;d=16711935&(d<<8|d>>>24)|4278255360&(d<<24|d>>>8),p=16711935&(p<<8|p>>>24)|4278255360&(p<<24|p>>>8),f.push(p),f.push(d)}return new i.init(f,s)},clone:function(){for(var e=a.clone.call(this),t=e._state=this._state.slice(0),r=0;r<25;r++)t[r]=t[r].clone();return e}});r.SHA3=a._createHelper(d),r.HmacSHA3=a._createHmacHelper(d)}(Math),e.SHA3}(cV(),gV())}(zV)),zV.exports}var VV,GV={exports:{}};var WV,KV={exports:{}};function XV(){return WV||(WV=1,function(e,t){e.exports=function(e){!function(){var t=e,r=t.lib.Base,n=t.enc.Utf8;t.algo.HMAC=r.extend({init:function(e,t){e=this._hasher=new e.init,"string"==typeof t&&(t=n.parse(t));var r=e.blockSize,i=4*r;t.sigBytes>i&&(t=e.finalize(t)),t.clamp();for(var a=this._oKey=t.clone(),o=this._iKey=t.clone(),s=a.words,u=o.words,f=0;f<r;f++)s[f]^=1549556828,u[f]^=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,r=t.finalize(e);return t.reset(),t.finalize(this._oKey.clone().concat(r))}})}()}(cV())}(KV)),KV.exports}var $V,JV={exports:{}};var YV,QV={exports:{}};function ZV(){return YV||(YV=1,function(e,t){e.exports=function(e){return function(){var t=e,r=t.lib,n=r.Base,i=r.WordArray,a=t.algo,o=a.MD5,s=a.EvpKDF=n.extend({cfg:n.extend({keySize:4,hasher:o,iterations:1}),init:function(e){this.cfg=this.cfg.extend(e)},compute:function(e,t){for(var r=this.cfg,n=r.hasher.create(),a=i.create(),o=a.words,s=r.keySize,u=r.iterations;o.length<s;){f&&n.update(f);var f=n.update(e).finalize(t);n.reset();for(var c=1;c<u;c++)f=n.finalize(f),n.reset();a.concat(f)}return a.sigBytes=4*s,a}});t.EvpKDF=function(e,t,r){return s.create(r).compute(e,t)}}(),e.EvpKDF}(cV(),PV(),XV())}(QV)),QV.exports}var eG,tG={exports:{}};function rG(){return eG||(eG=1,function(e,t){e.exports=function(e){e.lib.Cipher||function(t){var r=e,n=r.lib,i=n.Base,a=n.WordArray,o=n.BufferedBlockAlgorithm,s=r.enc;s.Utf8;var u=s.Base64,f=r.algo.EvpKDF,c=n.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,r){this.cfg=this.cfg.extend(r),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:b}return function(t){return{encrypt:function(r,n,i){return e(n).encrypt(t,r,n,i)},decrypt:function(r,n,i){return e(n).decrypt(t,r,n,i)}}}}()});n.StreamCipher=c.extend({_doFinalize:function(){return this._process(!0)},blockSize:1});var l=r.mode={},d=n.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=l.CBC=function(){var e=d.extend();function r(e,r,n){var i=this._iv;if(i){var a=i;this._iv=t}else a=this._prevBlock;for(var o=0;o<n;o++)e[r+o]^=a[o]}return e.Encryptor=e.extend({processBlock:function(e,t){var n=this._cipher,i=n.blockSize;r.call(this,e,t,i),n.encryptBlock(e,t),this._prevBlock=e.slice(t,t+i)}}),e.Decryptor=e.extend({processBlock:function(e,t){var n=this._cipher,i=n.blockSize,a=e.slice(t,t+i);n.decryptBlock(e,t),r.call(this,e,t,i),this._prevBlock=a}}),e}(),h=(r.pad={}).Pkcs7={pad:function(e,t){for(var r=4*t,n=r-e.sigBytes%r,i=n<<24|n<<16|n<<8|n,o=[],s=0;s<n;s+=4)o.push(i);var u=a.create(o,n);e.concat(u)},unpad:function(e){var t=255&e.words[e.sigBytes-1>>>2];e.sigBytes-=t}};n.BlockCipher=c.extend({cfg:c.cfg.extend({mode:p,padding:h}),reset:function(){c.reset.call(this);var e=this.cfg,t=e.iv,r=e.mode;if(this._xformMode==this._ENC_XFORM_MODE)var n=r.createEncryptor;else n=r.createDecryptor,this._minBufferSize=1;this._mode&&this._mode.__creator==n?this._mode.init(this,t&&t.words):(this._mode=n.call(r,this,t&&t.words),this._mode.__creator=n)},_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 m=n.CipherParams=i.extend({init:function(e){this.mixIn(e)},toString:function(e){return(e||this.formatter).stringify(this)}}),y=(r.format={}).OpenSSL={stringify:function(e){var t=e.ciphertext,r=e.salt;if(r)var n=a.create([1398893684,1701076831]).concat(r).concat(t);else n=t;return n.toString(u)},parse:function(e){var t=u.parse(e),r=t.words;if(1398893684==r[0]&&1701076831==r[1]){var n=a.create(r.slice(2,4));r.splice(0,4),t.sigBytes-=16}return m.create({ciphertext:t,salt:n})}},b=n.SerializableCipher=i.extend({cfg:i.extend({format:y}),encrypt:function(e,t,r,n){n=this.cfg.extend(n);var i=e.createEncryptor(r,n),a=i.finalize(t),o=i.cfg;return m.create({ciphertext:a,key:r,iv:o.iv,algorithm:e,mode:o.mode,padding:o.padding,blockSize:e.blockSize,formatter:n.format})},decrypt:function(e,t,r,n){return n=this.cfg.extend(n),t=this._parse(t,n.format),e.createDecryptor(r,n).finalize(t.ciphertext)},_parse:function(e,t){return"string"==typeof e?t.parse(e,this):e}}),g=(r.kdf={}).OpenSSL={execute:function(e,t,r,n){n||(n=a.random(8));var i=f.create({keySize:t+r}).compute(e,n),o=a.create(i.words.slice(t),4*r);return i.sigBytes=4*t,m.create({key:i,iv:o,salt:n})}},v=n.PasswordBasedCipher=b.extend({cfg:b.cfg.extend({kdf:g}),encrypt:function(e,t,r,n){var i=(n=this.cfg.extend(n)).kdf.execute(r,e.keySize,e.ivSize);n.iv=i.iv;var a=b.encrypt.call(this,e,t,i.key,n);return a.mixIn(i),a},decrypt:function(e,t,r,n){n=this.cfg.extend(n),t=this._parse(t,n.format);var i=n.kdf.execute(r,e.keySize,e.ivSize,t.salt);return n.iv=i.iv,b.decrypt.call(this,e,t,i.key,n)}})}()}(cV(),ZV())}(tG)),tG.exports}var nG,iG={exports:{}};function aG(){return nG||(nG=1,function(e,t){e.exports=function(e){return e.mode.CFB=function(){var t=e.lib.BlockCipherMode.extend();function r(e,t,r,n){var i=this._iv;if(i){var a=i.slice(0);this._iv=void 0}else a=this._prevBlock;n.encryptBlock(a,0);for(var o=0;o<r;o++)e[t+o]^=a[o]}return t.Encryptor=t.extend({processBlock:function(e,t){var n=this._cipher,i=n.blockSize;r.call(this,e,t,i,n),this._prevBlock=e.slice(t,t+i)}}),t.Decryptor=t.extend({processBlock:function(e,t){var n=this._cipher,i=n.blockSize,a=e.slice(t,t+i);r.call(this,e,t,i,n),this._prevBlock=a}}),t}(),e.mode.CFB}(cV(),rG())}(iG)),iG.exports}var oG,sG={exports:{}};function uG(){return oG||(oG=1,function(e,t){e.exports=function(e){return e.mode.CTR=(t=e.lib.BlockCipherMode.extend(),r=t.Encryptor=t.extend({processBlock:function(e,t){var r=this._cipher,n=r.blockSize,i=this._iv,a=this._counter;i&&(a=this._counter=i.slice(0),this._iv=void 0);var o=a.slice(0);r.encryptBlock(o,0),a[n-1]=a[n-1]+1|0;for(var s=0;s<n;s++)e[t+s]^=o[s]}}),t.Decryptor=r,t),e.mode.CTR;var t,r}(cV(),rG())}(sG)),sG.exports}var fG,cG={exports:{}};function lG(){return fG||(fG=1,function(e,t){e.exports=function(e){
31
+ */IP=CP,function(){var e="input is invalid type",t="object"==typeof window,r=t?window:{};r.JS_SHA3_NO_WINDOW&&(t=!1);var n=!t&&"object"==typeof self;!r.JS_SHA3_NO_NODE_JS&&"object"==typeof process&&process.versions&&process.versions.node?r=uC:n&&(r=self);var i=!r.JS_SHA3_NO_COMMON_JS&&IP.exports,a=!r.JS_SHA3_NO_ARRAY_BUFFER&&"undefined"!=typeof ArrayBuffer,o="0123456789abcdef".split(""),s=[4,1024,262144,67108864],u=[0,8,16,24],f=[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],c=[224,256,384,512],l=[128,256],d=["hex","buffer","arrayBuffer","array","digest"],p={128:168,256:136};!r.JS_SHA3_NO_NODE_JS&&Array.isArray||(Array.isArray=function(e){return"[object Array]"===Object.prototype.toString.call(e)}),!a||!r.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,r){return function(n){return new x(e,t,e).update(n)[r]()}},m=function(e,t,r){return function(n,i){return new x(e,t,i).update(n)[r]()}},y=function(e,t,r){return function(t,n,i,a){return _["cshake"+e].update(t,n,i,a)[r]()}},b=function(e,t,r){return function(t,n,i,a){return _["kmac"+e].update(t,n,i,a)[r]()}},g=function(e,t,r,n){for(var i=0;i<d.length;++i){var a=d[i];e[a]=t(r,n,a)}return e},v=function(e,t){var r=h(e,t,"hex");return r.create=function(){return new x(e,t,e)},r.update=function(e){return r.create().update(e)},g(r,h,e,t)},w=[{name:"keccak",padding:[1,256,65536,16777216],bits:c,createMethod:v},{name:"sha3",padding:[6,1536,393216,100663296],bits:c,createMethod:v},{name:"shake",padding:[31,7936,2031616,520093696],bits:l,createMethod:function(e,t){var r=m(e,t,"hex");return r.create=function(r){return new x(e,t,r)},r.update=function(e,t){return r.create(t).update(e)},g(r,m,e,t)}},{name:"cshake",padding:s,bits:l,createMethod:function(e,t){var r=p[e],n=y(e,0,"hex");return n.create=function(n,i,a){return i||a?new x(e,t,n).bytepad([i,a],r):_["shake"+e].create(n)},n.update=function(e,t,r,i){return n.create(t,r,i).update(e)},g(n,y,e,t)}},{name:"kmac",padding:s,bits:l,createMethod:function(e,t){var r=p[e],n=b(e,0,"hex");return n.create=function(n,i,a){return new I(e,t,i).bytepad(["KMAC",a],r).bytepad([n],r)},n.update=function(e,t,r,i){return n.create(e,r,i).update(t)},g(n,b,e,t)}}],_={},E=[],T=0;T<w.length;++T)for(var A=w[T],S=A.bits,k=0;k<S.length;++k){var O=A.name+"_"+S[k];if(E.push(O),_[O]=A.createMethod(S[k],A.padding),"sha3"!==A.name){var R=A.name+S[k];E.push(R),_[R]=_[O]}}function x(e,t,r){this.blocks=[],this.s=[],this.padding=t,this.outputBits=r,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=r>>5,this.extraBytes=(31&r)>>3;for(var n=0;n<50;++n)this.s[n]=0}function I(e,t,r){x.call(this,e,t,r)}x.prototype.update=function(t){if(this.finalized)throw new Error("finalize already called");var r,n=typeof t;if("string"!==n){if("object"!==n)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);r=!0}for(var i,o,s=this.blocks,f=this.byteCount,c=t.length,l=this.blockCount,d=0,p=this.s;d<c;){if(this.reset)for(this.reset=!1,s[0]=this.block,i=1;i<l+1;++i)s[i]=0;if(r)for(i=this.start;d<c&&i<f;++d)s[i>>2]|=t[d]<<u[3&i++];else for(i=this.start;d<c&&i<f;++d)(o=t.charCodeAt(d))<128?s[i>>2]|=o<<u[3&i++]:o<2048?(s[i>>2]|=(192|o>>6)<<u[3&i++],s[i>>2]|=(128|63&o)<<u[3&i++]):o<55296||o>=57344?(s[i>>2]|=(224|o>>12)<<u[3&i++],s[i>>2]|=(128|o>>6&63)<<u[3&i++],s[i>>2]|=(128|63&o)<<u[3&i++]):(o=65536+((1023&o)<<10|1023&t.charCodeAt(++d)),s[i>>2]|=(240|o>>18)<<u[3&i++],s[i>>2]|=(128|o>>12&63)<<u[3&i++],s[i>>2]|=(128|o>>6&63)<<u[3&i++],s[i>>2]|=(128|63&o)<<u[3&i++]);if(this.lastByteIndex=i,i>=f){for(this.start=i-f,this.block=s[l],i=0;i<l;++i)p[i]^=s[i];C(p),this.reset=!0}else this.start=i}return this},x.prototype.encode=function(e,t){var r=255&e,n=1,i=[r];for(r=255&(e>>=8);r>0;)i.unshift(r),r=255&(e>>=8),++n;return t?i.push(n):i.unshift(n),this.update(i),i.length},x.prototype.encodeString=function(t){var r,n=typeof t;if("string"!==n){if("object"!==n)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);r=!0}var i=0,o=t.length;if(r)i=o;else for(var s=0;s<t.length;++s){var u=t.charCodeAt(s);u<128?i+=1:u<2048?i+=2:u<55296||u>=57344?i+=3:(u=65536+((1023&u)<<10|1023&t.charCodeAt(++s)),i+=4)}return i+=this.encode(8*i),this.update(t),i},x.prototype.bytepad=function(e,t){for(var r=this.encode(t),n=0;n<e.length;++n)r+=this.encodeString(e[n]);var i=t-r%t,a=[];return a.length=i,this.update(a),this},x.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var e=this.blocks,t=this.lastByteIndex,r=this.blockCount,n=this.s;if(e[t>>2]|=this.padding[3&t],this.lastByteIndex===this.byteCount)for(e[0]=e[r],t=1;t<r+1;++t)e[t]=0;for(e[r-1]|=2147483648,t=0;t<r;++t)n[t]^=e[t];C(n)}},x.prototype.toString=x.prototype.hex=function(){this.finalize();for(var e,t=this.blockCount,r=this.s,n=this.outputBlocks,i=this.extraBytes,a=0,s=0,u="";s<n;){for(a=0;a<t&&s<n;++a,++s)e=r[a],u+=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(r),a=0)}return i&&(e=r[a],u+=o[e>>4&15]+o[15&e],i>1&&(u+=o[e>>12&15]+o[e>>8&15]),i>2&&(u+=o[e>>20&15]+o[e>>16&15])),u},x.prototype.arrayBuffer=function(){this.finalize();var e,t=this.blockCount,r=this.s,n=this.outputBlocks,i=this.extraBytes,a=0,o=0,s=this.outputBits>>3;e=i?new ArrayBuffer(n+1<<2):new ArrayBuffer(s);for(var u=new Uint32Array(e);o<n;){for(a=0;a<t&&o<n;++a,++o)u[o]=r[a];o%t==0&&C(r)}return i&&(u[a]=r[a],e=e.slice(0,s)),e},x.prototype.buffer=x.prototype.arrayBuffer,x.prototype.digest=x.prototype.array=function(){this.finalize();for(var e,t,r=this.blockCount,n=this.s,i=this.outputBlocks,a=this.extraBytes,o=0,s=0,u=[];s<i;){for(o=0;o<r&&s<i;++o,++s)e=s<<2,t=n[o],u[e]=255&t,u[e+1]=t>>8&255,u[e+2]=t>>16&255,u[e+3]=t>>24&255;s%r==0&&C(n)}return a&&(e=s<<2,t=n[o],u[e]=255&t,a>1&&(u[e+1]=t>>8&255),a>2&&(u[e+2]=t>>16&255)),u},I.prototype=new x,I.prototype.finalize=function(){return this.encode(this.outputBits,!0),x.prototype.finalize.call(this)};var C=function(e){var t,r,n,i,a,o,s,u,c,l,d,p,h,m,y,b,g,v,w,_,E,T,A,S,k,O,R,x,I,C,N,P,M,B,D,F,L,U,j,q,z,H,V,G,W,K,X,$,J,Y,Q,Z,ee,te,re,ne,ie,ae,oe,se,ue,fe,ce;for(n=0;n<48;n+=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],u=e[4]^e[14]^e[24]^e[34]^e[44],c=e[5]^e[15]^e[25]^e[35]^e[45],l=e[6]^e[16]^e[26]^e[36]^e[46],d=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),r=(h=e[9]^e[19]^e[29]^e[39]^e[49])^(s<<1|o>>>31),e[0]^=t,e[1]^=r,e[10]^=t,e[11]^=r,e[20]^=t,e[21]^=r,e[30]^=t,e[31]^=r,e[40]^=t,e[41]^=r,t=i^(u<<1|c>>>31),r=a^(c<<1|u>>>31),e[2]^=t,e[3]^=r,e[12]^=t,e[13]^=r,e[22]^=t,e[23]^=r,e[32]^=t,e[33]^=r,e[42]^=t,e[43]^=r,t=o^(l<<1|d>>>31),r=s^(d<<1|l>>>31),e[4]^=t,e[5]^=r,e[14]^=t,e[15]^=r,e[24]^=t,e[25]^=r,e[34]^=t,e[35]^=r,e[44]^=t,e[45]^=r,t=u^(p<<1|h>>>31),r=c^(h<<1|p>>>31),e[6]^=t,e[7]^=r,e[16]^=t,e[17]^=r,e[26]^=t,e[27]^=r,e[36]^=t,e[37]^=r,e[46]^=t,e[47]^=r,t=l^(i<<1|a>>>31),r=d^(a<<1|i>>>31),e[8]^=t,e[9]^=r,e[18]^=t,e[19]^=r,e[28]^=t,e[29]^=r,e[38]^=t,e[39]^=r,e[48]^=t,e[49]^=r,m=e[0],y=e[1],K=e[11]<<4|e[10]>>>28,X=e[10]<<4|e[11]>>>28,x=e[20]<<3|e[21]>>>29,I=e[21]<<3|e[20]>>>29,se=e[31]<<9|e[30]>>>23,ue=e[30]<<9|e[31]>>>23,H=e[40]<<18|e[41]>>>14,V=e[41]<<18|e[40]>>>14,B=e[2]<<1|e[3]>>>31,D=e[3]<<1|e[2]>>>31,b=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,N=e[32]<<13|e[33]>>>19,fe=e[42]<<2|e[43]>>>30,ce=e[43]<<2|e[42]>>>30,te=e[5]<<30|e[4]>>>2,re=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,M=e[44]<<29|e[45]>>>3,S=e[6]<<28|e[7]>>>4,k=e[7]<<28|e[6]>>>4,ne=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,G=e[8]<<27|e[9]>>>5,W=e[9]<<27|e[8]>>>5,O=e[18]<<20|e[19]>>>12,R=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]=m^~b&v,e[1]=y^~g&w,e[10]=S^~O&x,e[11]=k^~R&I,e[20]=B^~F&U,e[21]=D^~L&j,e[30]=G^~K&$,e[31]=W^~X&J,e[40]=te^~ne&ae,e[41]=re^~ie&oe,e[2]=b^~v&_,e[3]=g^~w&E,e[12]=O^~x&C,e[13]=R^~I&N,e[22]=F^~U&q,e[23]=L^~j&z,e[32]=K^~$&Y,e[33]=X^~J&Q,e[42]=ne^~ae&se,e[43]=ie^~oe&ue,e[4]=v^~_&T,e[5]=w^~E&A,e[14]=x^~C&P,e[15]=I^~N&M,e[24]=U^~q&H,e[25]=j^~z&V,e[34]=$^~Y&Z,e[35]=J^~Q&ee,e[44]=ae^~se&fe,e[45]=oe^~ue&ce,e[6]=_^~T&m,e[7]=E^~A&y,e[16]=C^~P&S,e[17]=N^~M&k,e[26]=q^~H&B,e[27]=z^~V&D,e[36]=Y^~Z&G,e[37]=Q^~ee&W,e[46]=se^~fe&te,e[47]=ue^~ce&re,e[8]=T^~m&b,e[9]=A^~y&g,e[18]=P^~S&O,e[19]=M^~k&R,e[28]=H^~B&F,e[29]=V^~D&L,e[38]=Z^~G&K,e[39]=ee^~W&X,e[48]=fe^~te&ne,e[49]=ce^~re&ie,e[0]^=f[n],e[1]^=f[n+1]};if(i)IP.exports=_;else for(T=0;T<E.length;++T)r[E[T]]=_[E[T]]}();var NP=CP.exports;function PP(e){return"0x"+NP.keccak_256(Ii(e))}var MP=di.BN;const BP=new bP("bignumber/5.7.0"),DP={};let FP=!1;class LP{constructor(e,t){e!==DP&&BP.throwError("cannot call constructor directly; use BigNumber.from",bP.errors.UNSUPPORTED_OPERATION,{operation:"new (BigNumber)"}),this._hex=t,this._isBigNumber=!0,Object.freeze(this)}fromTwos(e){return jP(qP(this).fromTwos(e))}toTwos(e){return jP(qP(this).toTwos(e))}abs(){return"-"===this._hex[0]?LP.from(this._hex.substring(1)):this}add(e){return jP(qP(this).add(qP(e)))}sub(e){return jP(qP(this).sub(qP(e)))}div(e){return LP.from(e).isZero()&&zP("division-by-zero","div"),jP(qP(this).div(qP(e)))}mul(e){return jP(qP(this).mul(qP(e)))}mod(e){const t=qP(e);return t.isNeg()&&zP("division-by-zero","mod"),jP(qP(this).umod(t))}pow(e){const t=qP(e);return t.isNeg()&&zP("negative-power","pow"),jP(qP(this).pow(t))}and(e){const t=qP(e);return(this.isNegative()||t.isNeg())&&zP("unbound-bitwise-result","and"),jP(qP(this).and(t))}or(e){const t=qP(e);return(this.isNegative()||t.isNeg())&&zP("unbound-bitwise-result","or"),jP(qP(this).or(t))}xor(e){const t=qP(e);return(this.isNegative()||t.isNeg())&&zP("unbound-bitwise-result","xor"),jP(qP(this).xor(t))}mask(e){return(this.isNegative()||e<0)&&zP("negative-width","mask"),jP(qP(this).maskn(e))}shl(e){return(this.isNegative()||e<0)&&zP("negative-width","shl"),jP(qP(this).shln(e))}shr(e){return(this.isNegative()||e<0)&&zP("negative-width","shr"),jP(qP(this).shrn(e))}eq(e){return qP(this).eq(qP(e))}lt(e){return qP(this).lt(qP(e))}lte(e){return qP(this).lte(qP(e))}gt(e){return qP(this).gt(qP(e))}gte(e){return qP(this).gte(qP(e))}isNegative(){return"-"===this._hex[0]}isZero(){return qP(this).isZero()}toNumber(){try{return qP(this).toNumber()}catch(e){zP("overflow","toNumber",this.toString())}return null}toBigInt(){try{return BigInt(this.toString())}catch(e){}return BP.throwError("this platform does not support BigInt",bP.errors.UNSUPPORTED_OPERATION,{value:this.toString()})}toString(){return arguments.length>0&&(10===arguments[0]?FP||(FP=!0,BP.warn("BigNumber.toString does not accept any parameters; base-10 is assumed")):16===arguments[0]?BP.throwError("BigNumber.toString does not accept any parameters; use bigNumber.toHexString()",bP.errors.UNEXPECTED_ARGUMENT,{}):BP.throwError("BigNumber.toString does not accept parameters",bP.errors.UNEXPECTED_ARGUMENT,{})),qP(this).toString(10)}toHexString(){return this._hex}toJSON(e){return{type:"BigNumber",hex:this.toHexString()}}static from(e){if(e instanceof LP)return e;if("string"==typeof e)return e.match(/^-?0x[0-9a-f]+$/i)?new LP(DP,UP(e)):e.match(/^-?[0-9]+$/)?new LP(DP,UP(new MP(e))):BP.throwArgumentError("invalid BigNumber string","value",e);if("number"==typeof e)return e%1&&zP("underflow","BigNumber.from",e),(e>=9007199254740991||e<=-9007199254740991)&&zP("overflow","BigNumber.from",e),LP.from(String(e));const t=e;if("bigint"==typeof t)return LP.from(t.toString());if(xi(t))return LP.from(Di(t));if(t)if(t.toHexString){const e=t.toHexString();if("string"==typeof e)return LP.from(e)}else{let e=t._hex;if(null==e&&"BigNumber"===t.type&&(e=t.hex),"string"==typeof e&&(Mi(e)||"-"===e[0]&&Mi(e.substring(1))))return LP.from(e)}return BP.throwArgumentError("invalid BigNumber value","value",e)}static isBigNumber(e){return!(!e||!e._isBigNumber)}}function UP(e){if("string"!=typeof e)return UP(e.toString(16));if("-"===e[0])return"-"===(e=e.substring(1))[0]&&BP.throwArgumentError("invalid hex","value",e),"0x00"===(e=UP(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 jP(e){return LP.from(UP(e))}function qP(e){const t=LP.from(e).toHexString();return"-"===t[0]?new MP("-"+t.substring(3),16):new MP(t.substring(2),16)}function zP(e,t,r){const n={fault:e,operation:t};return null!=r&&(n.value=r),BP.throwError(e,bP.errors.NUMERIC_FAULT,n)}const HP=new bP("bignumber/5.7.0"),VP={},GP=LP.from(0),WP=LP.from(-1);function KP(e,t,r,n){const i={fault:t,operation:r};return void 0!==n&&(i.value=n),HP.throwError(e,bP.errors.NUMERIC_FAULT,i)}let XP="0";for(;XP.length<256;)XP+=XP;function $P(e){if("number"!=typeof e)try{e=LP.from(e).toNumber()}catch(e){}return"number"==typeof e&&e>=0&&e<=256&&!(e%1)?"1"+XP.substring(0,e):HP.throwArgumentError("invalid decimal size","decimals",e)}function JP(e,t){null==t&&(t=0);const r=$P(t),n=(e=LP.from(e)).lt(GP);n&&(e=e.mul(WP));let i=e.mod(r).toString();for(;i.length<r.length-1;)i="0"+i;i=i.match(/^([0-9]*[1-9]|0)(0*)/)[1];const a=e.div(r).toString();return e=1===r.length?a:a+"."+i,n&&(e="-"+e),e}function YP(e,t){null==t&&(t=0);const r=$P(t);"string"==typeof e&&e.match(/^-?[0-9.]+$/)||HP.throwArgumentError("invalid decimal value","value",e);const n="-"===e.substring(0,1);n&&(e=e.substring(1)),"."===e&&HP.throwArgumentError("missing value","value",e);const i=e.split(".");i.length>2&&HP.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>r.length-1&&KP("fractional component exceeds decimals","underflow","parseFixed"),""===o&&(o="0");o.length<r.length-1;)o+="0";const s=LP.from(a),u=LP.from(o);let f=s.mul(r).add(u);return n&&(f=f.mul(WP)),f}class QP{constructor(e,t,r,n){e!==VP&&HP.throwError("cannot use FixedFormat constructor; use FixedFormat.from",bP.errors.UNSUPPORTED_OPERATION,{operation:"new FixedFormat"}),this.signed=t,this.width=r,this.decimals=n,this.name=(t?"":"u")+"fixed"+String(r)+"x"+String(n),this._multiplier=$P(n),Object.freeze(this)}static from(e){if(e instanceof QP)return e;"number"==typeof e&&(e=`fixed128x${e}`);let t=!0,r=128,n=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||HP.throwArgumentError("invalid fixed format","format",e),t="u"!==i[1],r=parseInt(i[2]),n=parseInt(i[3])}else if(e){const i=(t,r,n)=>null==e[t]?n:(typeof e[t]!==r&&HP.throwArgumentError("invalid fixed format ("+t+" not "+r+")","format."+t,e[t]),e[t]);t=i("signed","boolean",t),r=i("width","number",r),n=i("decimals","number",n)}return r%8&&HP.throwArgumentError("invalid fixed format width (not byte aligned)","format.width",r),n>80&&HP.throwArgumentError("invalid fixed format (decimals too large)","format.decimals",n),new QP(VP,t,r,n)}}class ZP{constructor(e,t,r,n){e!==VP&&HP.throwError("cannot use FixedNumber constructor; use FixedNumber.from",bP.errors.UNSUPPORTED_OPERATION,{operation:"new FixedFormat"}),this.format=n,this._hex=t,this._value=r,this._isFixedNumber=!0,Object.freeze(this)}_checkFormat(e){this.format.name!==e.format.name&&HP.throwArgumentError("incompatible format; use fixedNumber.toFormat","other",e)}addUnsafe(e){this._checkFormat(e);const t=YP(this._value,this.format.decimals),r=YP(e._value,e.format.decimals);return ZP.fromValue(t.add(r),this.format.decimals,this.format)}subUnsafe(e){this._checkFormat(e);const t=YP(this._value,this.format.decimals),r=YP(e._value,e.format.decimals);return ZP.fromValue(t.sub(r),this.format.decimals,this.format)}mulUnsafe(e){this._checkFormat(e);const t=YP(this._value,this.format.decimals),r=YP(e._value,e.format.decimals);return ZP.fromValue(t.mul(r).div(this.format._multiplier),this.format.decimals,this.format)}divUnsafe(e){this._checkFormat(e);const t=YP(this._value,this.format.decimals),r=YP(e._value,e.format.decimals);return ZP.fromValue(t.mul(this.format._multiplier).div(r),this.format.decimals,this.format)}floor(){const e=this.toString().split(".");1===e.length&&e.push("0");let t=ZP.from(e[0],this.format);const r=!e[1].match(/^(0*)$/);return this.isNegative()&&r&&(t=t.subUnsafe(eM.toFormat(t.format))),t}ceiling(){const e=this.toString().split(".");1===e.length&&e.push("0");let t=ZP.from(e[0],this.format);const r=!e[1].match(/^(0*)$/);return!this.isNegative()&&r&&(t=t.addUnsafe(eM.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)&&HP.throwArgumentError("invalid decimal count","decimals",e),t[1].length<=e)return this;const r=ZP.from("1"+XP.substring(0,e),this.format),n=tM.toFormat(this.format);return this.mulUnsafe(r).addUnsafe(n).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&&HP.throwArgumentError("invalid byte width","width",e);return zi(LP.from(this._hex).fromTwos(this.format.width).toTwos(e).toHexString(),e/8)}toUnsafeFloat(){return parseFloat(this.toString())}toFormat(e){return ZP.fromString(this._value,e)}static fromValue(e,t,r){return null!=r||null==t||function(e){return null!=e&&(LP.isBigNumber(e)||"number"==typeof e&&e%1==0||"string"==typeof e&&!!e.match(/^-?[0-9]+$/)||Mi(e)||"bigint"==typeof e||xi(e))}(t)||(r=t,t=null),null==t&&(t=0),null==r&&(r="fixed"),ZP.fromString(JP(e,t),QP.from(r))}static fromString(e,t){null==t&&(t="fixed");const r=QP.from(t),n=YP(e,r.decimals);!r.signed&&n.lt(GP)&&KP("unsigned value cannot be negative","overflow","value",e);let i=null;r.signed?i=n.toTwos(r.width).toHexString():(i=n.toHexString(),i=zi(i,r.width/8));const a=JP(n,r.decimals);return new ZP(VP,i,a,r)}static fromBytes(e,t){null==t&&(t="fixed");const r=QP.from(t);if(Ii(e).length>r.width/8)throw new Error("overflow");let n=LP.from(e);r.signed&&(n=n.fromTwos(r.width));const i=n.toTwos((r.signed?0:1)+r.width).toHexString(),a=JP(n,r.decimals);return new ZP(VP,i,a,r)}static from(e,t){if("string"==typeof e)return ZP.fromString(e,t);if(xi(e))return ZP.fromBytes(e,t);try{return ZP.fromValue(e,0,t)}catch(e){if(e.code!==bP.errors.INVALID_ARGUMENT)throw e}return HP.throwArgumentError("invalid FixedNumber value","value",e)}static isFixedNumber(e){return!(!e||!e._isFixedNumber)}}const eM=ZP.from(1),tM=ZP.from("0.5"),rM=new bP("strings/5.7.0");var nM,iM;function aM(e,t=nM.current){t!=nM.current&&(rM.checkNormalize(),e=e.normalize(t));let r=[];for(let t=0;t<e.length;t++){const n=e.charCodeAt(t);if(n<128)r.push(n);else if(n<2048)r.push(n>>6|192),r.push(63&n|128);else if(55296==(64512&n)){t++;const i=e.charCodeAt(t);if(t>=e.length||56320!=(64512&i))throw new Error("invalid utf-8 string");const a=65536+((1023&n)<<10)+(1023&i);r.push(a>>18|240),r.push(a>>12&63|128),r.push(a>>6&63|128),r.push(63&a|128)}else r.push(n>>12|224),r.push(n>>6&63|128),r.push(63&n|128)}return Ii(r)}function oM(e,t){t||(t=function(e){return[parseInt(e,16)]});let r=0,n={};return e.split(",").forEach((e=>{let i=e.split(":");r+=parseInt(i[0],16),n[r]=t(i[1])})),n}function sM(e){let t=0;return e.split(",").map((e=>{let r=e.split("-");1===r.length?r[1]="0":""===r[1]&&(r[1]="1");let n=t+parseInt(r[0],16);return t=parseInt(r[1],16),{l:n,h:t}}))}function uM(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function fM(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?uM(Object(r),!0).forEach((function(t){qI(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):uM(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function cM(e,t,r){return lM.apply(this,arguments)}function lM(){return lM=sC(dC.mark((function e(t,r,n){var i,a,o,s,u,f,c,l;return dC.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=r.users.map((function(e){return{ether_key:e.user,tokens:e.tokens.map((function(e){return fM({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=r.royalties,o=fM(fM({contract_address:r.contract_address},a&&a.length>0&&{royalties:a.map((function(e){return{recipient:e.recipient,percentage:e.percentage}}))}),{},{users:i,auth_signature:""}),s=PP(aM(JSON.stringify(o))),e.next=6,yC(s,t);case 6:return u=e.sent,f=fM(fM({users:o.users.map((function(e){return{user:e.ether_key,tokens:e.tokens}}))},a&&a.length>0&&{royalties:a}),{},{contract_address:r.contract_address,auth_signature:u}),c={mintTokensRequestV2:[f]},e.next=11,n.mintTokens(c);case 11:return l=e.sent,e.abrupt("return",l.data);case 13:case"end":return e.stop()}}),e)}))),lM.apply(this,arguments)}function dM(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 pM(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(e){if("string"==typeof e)return hM(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?hM(e,t):void 0}}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},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(){r=r.call(e)},n:function(){var e=r.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==r.return||r.return()}finally{if(s)throw a}}}}function hM(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function mM(e){return yM.apply(this,arguments)}function yM(){return(yM=sC(dC.mark((function e(t){var r,n,i,a,o,s,u,f,c,l,d,p,h,m,y;return dC.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.ethSigner,i=t.starkSigner,a=t.request,o=t.transfersApi,e.next=3,n.getAddress();case 3:return s=e.sent,u="ERC721"===a.type?"1":a.amount,e.next=7,o.getSignableTransferV1({getSignableTransferRequest:{sender:s,token:dM(a),amount:u,receiver:a.receiver}});case 7:return f=e.sent,c=f.data,l=c.signable_message,d=c.payload_hash,e.next=11,yC(l,n);case 11:return p=e.sent,e.next=14,i.signMessage(d);case 14:return h=e.sent,m={sender_stark_key:f.data.sender_stark_key,sender_vault_id:f.data.sender_vault_id,receiver_stark_key:f.data.receiver_stark_key,receiver_vault_id:f.data.receiver_vault_id,asset_id:f.data.asset_id,amount:f.data.amount,nonce:f.data.nonce,expiration_timestamp:f.data.expiration_timestamp,stark_signature:h},e.next=18,o.createTransferV1({createTransferRequest:m,xImxEthAddress:s,xImxEthSignature:p});case 18:return y=e.sent,e.abrupt("return",{sent_signature:null==y?void 0:y.data.sent_signature,status:null==y||null===(r=y.data.status)||void 0===r?void 0:r.toString(),time:null==y?void 0:y.data.time,transfer_id:null==y?void 0:y.data.transfer_id});case 20:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function bM(e){return gM.apply(this,arguments)}function gM(){return(gM=sC(dC.mark((function e(t){var r,n,i,a,o,s,u,f,c,l,d,p,h,m,y,b,g;return dC.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.ethSigner,n=t.starkSigner,i=t.request,a=t.transfersApi,e.next=3,r.getAddress();case 3:return o=e.sent,s=i.map((function(e){return{amount:"1",token:dM({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(u=e.sent,void 0!==(f=u.data.signable_message)){e.next=11;break}throw new Error("Invalid response from Signable registration offchain");case 11:return e.next=13,yC(f,r);case 13:c=e.sent,l=[],d=pM(u.data.signable_responses),e.prev=16,d.s();case 18:if((p=d.n()).done){e.next=27;break}return h=p.value,e.next=22,n.signMessage(h.payload_hash);case 22:m=e.sent,y={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:m},l.push(y);case 25:e.next=18;break;case 27:e.next=32;break;case 29:e.prev=29,e.t0=e.catch(16),d.e(e.t0);case 32:return e.prev=32,d.f(),e.finish(32);case 35:return b={sender_stark_key:u.data.sender_stark_key,requests:l},e.next=38,a.createTransfer({createTransferRequestV2:b,xImxEthAddress:o,xImxEthSignature:c});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"}(nM||(nM={})),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"}(iM||(iM={})),sM("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))),oM("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"),oM("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"),oM("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 r=0;r<e.length;r+=4)t.push(parseInt(e.substring(r,r+4),16));return t})),sM("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 vM=new bP("units/5.7.0"),wM=["wei","kwei","mwei","gwei","szabo","finney","ether"];function _M(e,t){if("string"!=typeof e&&vM.throwArgumentError("value must be a string","value",e),"string"==typeof t){const e=wM.indexOf(t);-1!==e&&(t=3*e)}return YP(e,null!=t?t:18)}function EM(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function TM(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?EM(Object(r),!0).forEach((function(t){qI(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):EM(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function AM(e,t,r,n,i,a,o){return SM.apply(this,arguments)}function SM(){return(SM=sC(dC.mark((function e(t,r,n,i,a,o,s){var u,f,c;return dC.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t.getAddress();case 2:return u=e.sent,e.next=5,RP(u,i,s);case 5:return f=e.sent,e.next=8,o.populateTransaction.registerAndDepositEth(u,i,f.operator_signature,n,a);case 8:return c=e.sent,e.abrupt("return",t.sendTransaction(TM(TM({},c),{},{value:r})));case 10:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function kM(e,t,r,n,i,a){return OM.apply(this,arguments)}function OM(){return(OM=sC(dC.mark((function e(t,r,n,i,a,o){var s;return dC.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,o.populateTransaction["deposit(uint256,uint256,uint256)"](i,n,a);case 2:return s=e.sent,e.abrupt("return",t.sendTransaction(TM(TM({},s),{},{value:r})));case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function RM(e,t,r,n,i,a){return xM.apply(this,arguments)}function xM(){return(xM=sC(dC.mark((function e(t,r,n,i,a,o){var s,u,f,c,l,d,p,h,m,y,b;return dC.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t.getAddress();case 2:return s=e.sent,u={decimals:18},f=_M(r.amount,"wei"),c={user:s,token:{type:r.type,data:u},amount:f.toString()},e.next=8,n.getSignableDeposit({getSignableDepositRequest:c});case 8:return l=e.sent,e.next=11,a.encodeAsset({assetType:"asset",encodeAssetRequest:{token:{type:r.type}}});case 11:return d=e.sent,p=d.data.asset_type,h=l.data.stark_key,m=l.data.vault_id,y=XI.connect(o.ethConfiguration.coreContractAddress,t),b=iC.connect(o.ethConfiguration.registrationContractAddress,t),e.next=19,kP(h,b);case 19:if(e.sent){e.next=24;break}return e.abrupt("return",AM(t,f,p,h,m,y,i));case 24:return e.abrupt("return",kM(t,f,p,h,m,y));case 25:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function IM(e,t,r,n,i,a){return CM.apply(this,arguments)}function CM(){return(CM=sC(dC.mark((function e(t,r,n,i,a,o){var s;return dC.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,o.populateTransaction.depositERC20(i,n,a,r);case 2:return s=e.sent,e.abrupt("return",t.sendTransaction(s));case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function NM(e,t,r,n,i,a,o){return PM.apply(this,arguments)}function PM(){return(PM=sC(dC.mark((function e(t,r,n,i,a,o,s){var u,f,c;return dC.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t.getAddress();case 2:return u=e.sent,e.next=5,RP(u,i,s);case 5:return f=e.sent,e.next=8,o.populateTransaction.registerAndDepositERC20(u,i,f.operator_signature,n,a,r);case 8:return c=e.sent,e.abrupt("return",t.sendTransaction(c));case 10:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function MM(e,t,r,n,i,a,o){return BM.apply(this,arguments)}function BM(){return(BM=sC(dC.mark((function e(t,r,n,i,a,o,s){var u,f,c,l,d,p,h,m,y,b,g,v,w,_,E,T;return dC.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t.getAddress();case 2:return u=e.sent,e.next=5,a.getToken({address:r.tokenAddress});case 5:return f=e.sent,c=parseInt(f.data.decimals),l={decimals:c,token_address:r.tokenAddress},d=_M(r.amount,0),p=HI.connect(r.tokenAddress,t),e.next=12,p.populateTransaction.approve(s.ethConfiguration.coreContractAddress,d);case 12:return h=e.sent,e.next=15,t.sendTransaction(h);case 15:return m={user:u,token:{type:r.type,data:l},amount:d.toString()},e.next=18,n.getSignableDeposit({getSignableDepositRequest:m});case 18:return y=e.sent,e.next=21,o.encodeAsset({assetType:"asset",encodeAssetRequest:{token:{type:r.type,data:{token_address:r.tokenAddress}}}});case 21:return b=e.sent,g=b.data.asset_type,v=y.data.stark_key,w=y.data.vault_id,_=LP.from(y.data.amount),E=XI.connect(s.ethConfiguration.coreContractAddress,t),T=iC.connect(s.ethConfiguration.registrationContractAddress,t),e.next=30,kP(v,T);case 30:if(e.sent){e.next=35;break}return e.abrupt("return",NM(t,_,g,v,w,E,i));case 35:return e.abrupt("return",IM(t,_,g,v,w,E));case 36:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function DM(e,t,r,n,i,a){return FM.apply(this,arguments)}function FM(){return(FM=sC(dC.mark((function e(t,r,n,i,a,o){var s;return dC.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,o.populateTransaction.depositNft(i,n,a,r);case 2:return s=e.sent,e.abrupt("return",t.sendTransaction(s));case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function LM(e,t,r,n,i,a){return UM.apply(this,arguments)}function UM(){return(UM=sC(dC.mark((function e(t,r,n,i,a,o){var s,u,f,c,l,d,p,h,m,y,b,g,v,w;return dC.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t.getAddress();case 2:return s=e.sent,u={token_address:r.tokenAddress,token_id:r.tokenId},f={user:s,token:{type:r.type,data:u},amount:"1".toString()},e.next=8,n.getSignableDeposit({getSignableDepositRequest:f});case 8:return c=e.sent,e.next=11,a.encodeAsset({assetType:"asset",encodeAssetRequest:{token:{type:r.type,data:{token_address:r.tokenAddress,token_id:r.tokenId}}}});case 11:return l=e.sent,d=l.data.asset_type,p=c.data.stark_key,h=c.data.vault_id,m=XI.connect(o.ethConfiguration.coreContractAddress,t),y=iC.connect(o.ethConfiguration.registrationContractAddress,t),e.next=19,kP(p,y);case 19:return b=e.sent,g=GI.connect(r.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(b){e.next=34;break}return e.next=31,RP(s,p,i);case 31:return w=e.sent,e.next=34,m.registerUser(s,p,w.operator_signature);case 34:return e.abrupt("return",DM(t,r.tokenId,d,p,h,m));case 35:case"end":return e.stop()}}),e)})))).apply(this,arguments)}var jM=function(e){if(void 0!==e)return e;throw new Error("undefined field exception")};function qM(e){return zM.apply(this,arguments)}function zM(){return(zM=sC(dC.mark((function e(t){var r,n,i,a,o,s,u,f,c,l,d,p,h;return dC.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.ethSigner,n=t.starkSigner,i=t.withdrawalsApi,a="ERC721"===t.type?"1":t.amount,e.t0=i,e.next=5,r.getAddress();case 5:return e.t1=e.sent,e.t2=dM(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,u=s.signable_message,f=s.payload_hash,e.next=16,n.signMessage(f);case 16:return c=e.sent,e.next=19,wC(u,r);case 19:return l=e.sent,d=l.ethAddress,p=l.ethSignature,e.next=24,i.createWithdrawal({createWithdrawalRequest:{stark_key:jM(o.data.stark_key),amount:a,asset_id:jM(o.data.asset_id),vault_id:jM(o.data.vault_id),nonce:jM(o.data.nonce),stark_signature:c},xImxEthAddress:d,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 HM(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function VM(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?HM(Object(r),!0).forEach((function(t){qI(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):HM(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function GM(e,t,r,n){return WM.apply(this,arguments)}function WM(){return(WM=sC(dC.mark((function e(t,r,n,i){var a;return dC.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,n.encodeAsset({assetType:t,encodeAssetRequest:{token:VM({type:r},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 KM(e,t,r,n,i){return XM.apply(this,arguments)}function XM(){return(XM=sC(dC.mark((function e(t,r,n,i,a){var o,s,u;return dC.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,RP(o,n,a);case 5:return s=e.sent,e.next=8,i.populateTransaction.registerAndWithdraw(o,n,s.operator_signature,r);case 8:return u=e.sent,e.abrupt("return",t.sendTransaction(u));case 10:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function $M(e,t,r,n){return JM.apply(this,arguments)}function JM(){return(JM=sC(dC.mark((function e(t,r,n,i){var a;return dC.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,i.populateTransaction.withdraw(n,r);case 2:return a=e.sent,e.abrupt("return",t.sendTransaction(a));case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function YM(e,t,r,n,i,a){return QM.apply(this,arguments)}function QM(){return(QM=sC(dC.mark((function e(t,r,n,i,a,o){var s,u,f;return dC.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,GM("asset","ERC20",i,{token_address:n.tokenAddress});case 2:return s=e.sent,u=XI.connect(o.ethConfiguration.coreContractAddress,t),f=iC.connect(o.ethConfiguration.registrationContractAddress,t),e.next=7,kP(r,f);case 7:if(e.sent){e.next=12;break}return e.abrupt("return",KM(t,s.asset_type,r,f,a));case 12:return e.abrupt("return",$M(t,s.asset_type,r,u));case 13:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function ZM(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function eB(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ZM(Object(r),!0).forEach((function(t){qI(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ZM(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function tB(e,t,r,n,i){return rB.apply(this,arguments)}function rB(){return(rB=sC(dC.mark((function e(t,r,n,i,a){var o;return dC.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,a.populateTransaction.withdrawAndMint(n,r,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 nB(e,t,r,n,i,a){return iB.apply(this,arguments)}function iB(){return(iB=sC(dC.mark((function e(t,r,n,i,a,o){var s,u,f;return dC.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,RP(s,n,o);case 5:return u=e.sent,e.next=8,a.populateTransaction.regsiterAndWithdrawAndMint(s,n,u.operator_signature,r,i);case 8:return f=e.sent,e.abrupt("return",t.sendTransaction(f));case 10:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function aB(e){var t=e.data.id,r=e.data.blueprint||"";return Mb(lb("{".concat(t,"}:{").concat(r,"}")))}function oB(e,t,r,n,i,a){return sB.apply(this,arguments)}function sB(){return(sB=sC(dC.mark((function e(t,r,n,i,a,o){var s,u,f,c;return dC.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,GM("mintable-asset","ERC721",i,eB({id:n.data.id,token_address:n.data.tokenAddress},n.data.blueprint&&{blueprint:n.data.blueprint}));case 2:return s=e.sent,u=aB(n),f=XI.connect(o.ethConfiguration.coreContractAddress,t),c=iC.connect(o.ethConfiguration.registrationContractAddress,t),e.next=8,kP(r,c);case 8:if(e.sent){e.next=13;break}return e.abrupt("return",nB(t,s.asset_type,r,u,c,a));case 13:return e.abrupt("return",tB(t,s.asset_type,r,u,f));case 14:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function uB(e,t,r,n,i,a){return fB.apply(this,arguments)}function fB(){return(fB=sC(dC.mark((function e(t,r,n,i,a,o){var s,u,f;return dC.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,RP(s,n,o);case 5:return u=e.sent,e.next=8,a.populateTransaction.registerAndWithdrawNft(s,n,u.operator_signature,r,i);case 8:return f=e.sent,e.abrupt("return",t.sendTransaction(f));case 10:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function cB(e,t,r,n,i){return lB.apply(this,arguments)}function lB(){return(lB=sC(dC.mark((function e(t,r,n,i,a){var o;return dC.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,a.populateTransaction.withdrawNft(n,r,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 dB(e,t,r,n,i,a){return pB.apply(this,arguments)}function pB(){return(pB=sC(dC.mark((function e(t,r,n,i,a,o){var s,u,f;return dC.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,GM("asset","ERC721",i,{token_id:n.tokenId,token_address:n.tokenAddress});case 2:return s=e.sent,u=XI.connect(o.ethConfiguration.coreContractAddress,t),f=iC.connect(o.ethConfiguration.registrationContractAddress,t),e.next=7,kP(r,f);case 7:if(e.sent){e.next=12;break}return e.abrupt("return",uB(t,s.asset_type,r,n.tokenId,f,a));case 12:return e.abrupt("return",cB(t,s.asset_type,r,n.tokenId,u));case 13:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function hB(e,t,r,n,i,a,o){return mB.apply(this,arguments)}function mB(){return(mB=sC(dC.mark((function e(t,r,n,i,a,o,s){var u,f;return dC.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return u=n.tokenAddress,f=n.tokenId,e.next=4,a.getMintableTokenDetailsByClientTokenId({tokenAddress:u,tokenId:f}).then((function(e){return oB(t,r,{type:"ERC721",data:{id:f,tokenAddress:u,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 dB(t,r,n,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 yB(e,t,r,n,i){return bB.apply(this,arguments)}function bB(){return(bB=sC(dC.mark((function e(t,r,n,i,a){var o,s,u;return dC.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,RP(o,n,a);case 5:return s=e.sent,e.next=8,i.populateTransaction.registerAndWithdraw(o,n,s.operator_signature,r);case 8:return u=e.sent,e.abrupt("return",t.sendTransaction(u));case 10:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function gB(e,t,r,n){return vB.apply(this,arguments)}function vB(){return(vB=sC(dC.mark((function e(t,r,n,i){var a;return dC.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,i.populateTransaction.withdraw(n,r);case 2:return a=e.sent,e.abrupt("return",t.sendTransaction(a));case 4:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function wB(e,t,r,n,i){return _B.apply(this,arguments)}function _B(){return(_B=sC(dC.mark((function e(t,r,n,i,a){var o,s,u;return dC.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,GM("asset","ETH",n);case 2:return o=e.sent,s=XI.connect(a.ethConfiguration.coreContractAddress,t),u=iC.connect(a.ethConfiguration.registrationContractAddress,t),e.next=7,kP(r,u);case 7:if(e.sent){e.next=12;break}return e.abrupt("return",yB(t,o.asset_type,r,u,i));case 12:return e.abrupt("return",gB(t,o.asset_type,r,s));case 13:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function EB(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function TB(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?EB(Object(r),!0).forEach((function(t){qI(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):EB(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function AB(e){return SB.apply(this,arguments)}function SB(){return(SB=sC(dC.mark((function e(t){var r,n,i,a,o,s,u,f,c,l,d,p,h,m,y,b,g;return dC.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.ethSigner,n=t.starkSigner,i=t.request,a=t.ordersApi,e.next=3,r.getAddress();case 3:return o=e.sent,s="ERC721"===i.sell.type?"1":i.sell.amount,u="ERC721"===i.buy.type?"1":i.buy.amount,f={user:o,amount_buy:u,token_buy:dM(i.buy),amount_sell:s,token_sell:dM(i.sell),fees:i.fees,expiration_timestamp:i.expiration_timestamp,split_fees:!0},e.next=9,a.getSignableOrder({getSignableOrderRequestV3:f});case 9:return c=e.sent,l=c.data,d=l.signable_message,p=l.payload_hash,e.next=13,yC(d,r);case 13:return h=e.sent,e.next=16,n.signMessage(p);case 16:return m=e.sent,y=c.data,b={createOrderRequest:{amount_buy:y.amount_buy,amount_sell:y.amount_sell,asset_id_buy:y.asset_id_buy,asset_id_sell:y.asset_id_sell,expiration_timestamp:y.expiration_timestamp,include_fees:!0,fees:i.fees,nonce:y.nonce,stark_key:y.stark_key,stark_signature:m,vault_id_buy:y.vault_id_buy,vault_id_sell:y.vault_id_sell},xImxEthAddress:o,xImxEthSignature:h},e.next=21,a.createOrderV3(b);case 21:return g=e.sent,e.abrupt("return",TB({},g.data));case 23:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function kB(e){return OB.apply(this,arguments)}function OB(){return(OB=sC(dC.mark((function e(t){var r,n,i,a,o,s,u,f,c,l,d,p;return dC.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.ethSigner,n=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,u=s.signable_message,f=s.payload_hash,e.next=7,yC(u,r);case 7:return c=e.sent,e.next=10,n.signMessage(f);case 10:return l=e.sent,e.next=13,r.getAddress();case 13:return d=e.sent,e.next=16,a.cancelOrderV3({id:i.order_id.toString(),cancelOrderRequest:{order_id:i.order_id,stark_signature:l},xImxEthAddress:d,xImxEthSignature:c});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 RB(e){return xB.apply(this,arguments)}function xB(){return(xB=sC(dC.mark((function e(t){var r,n,i,a,o,s,u,f,c,l,d,p;return dC.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.ethSigner,n=t.starkSigner,i=t.request,a=t.tradesApi,e.next=3,r.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,u=s.data,f=u.signable_message,c=u.payload_hash,e.next=10,yC(f,r);case 10:return l=e.sent,e.next=13,n.signMessage(c);case 13:return d=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:d},xImxEthAddress:o,xImxEthSignature:l});case 16:return p=e.sent,e.abrupt("return",p.data);case 18:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function IB(e){return CB.apply(this,arguments)}function CB(){return(CB=sC(dC.mark((function e(t){var r,n,i,a,o,s,u,f,c,l,d,p,h,m,y;return dC.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=t.ethSigner,i=t.starkSigner,a=t.request,o=t.exchangesApi,e.next=3,n.getAddress();case 3:return s=e.sent,u=a.amount,e.next=7,o.getExchangeSignableTransfer({id:a.transactionID,getSignableTransferRequest:{sender:s,token:dM(a),amount:u,receiver:a.receiver}});case 7:return f=e.sent,c=f.data,l=c.signable_message,d=c.payload_hash,e.next=11,yC(l,n);case 11:return p=e.sent,e.next=14,i.signMessage(d);case 14:return h=e.sent,m={sender_stark_key:f.data.sender_stark_key,sender_vault_id:f.data.sender_vault_id,receiver_stark_key:f.data.receiver_stark_key,receiver_vault_id:f.data.receiver_vault_id,asset_id:f.data.asset_id,amount:f.data.amount,nonce:f.data.nonce,expiration_timestamp:f.data.expiration_timestamp,stark_signature:h},e.next=18,o.createExchangeTransfer({id:a.transactionID,createTransferRequest:m,xImxEthAddress:s,xImxEthSignature:p});case 18:return y=e.sent,e.abrupt("return",{sent_signature:null==y?void 0:y.data.sent_signature,status:null==y||null===(r=y.data.status)||void 0===r?void 0:r.toString(),time:null==y?void 0:y.data.time,transfer_id:null==y?void 0:y.data.transfer_id});case 20:case"end":return e.stop()}}),e)})))).apply(this,arguments)}function NB(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function PB(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?NB(Object(r),!0).forEach((function(t){qI(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):NB(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var MB=function(){function e(t){LI(this,e),this.config=t;var r=t.apiConfiguration;this.config=t,this.depositsApi=new uN(r),this.encodingApi=new dN(r),this.mintsApi=new RN(r),this.ordersApi=new DN(r),this.tokensApi=new VN(r),this.tradesApi=new XN(r),this.transfersApi=new QN(r),this.usersApi=new rP(r),this.withdrawalsApi=new oP(r),this.projectsApi=new jN(r),this.collectionsApi=new iN(r),this.metadataApi=new wN(r),this.metadataRefreshesApi=new AN(r),this.exchangesApi=new yN(r)}var t,r,n,i,a,o,s,u,f,c,l,d,p,h,m,y,b,g,v,w,_,E,T,A,S,k,O,R;return jI(e,[{key:"isChainValid",value:function(e){return e===this.config.ethConfiguration.chainID}},{key:"validateChain",value:(R=sC(dC.mark((function e(t){var r;return dC.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,t.getChainId();case 2:if(r=e.sent,this.isChainValid(r)){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 R.apply(this,arguments)})},{key:"registerOffchain",value:(O=sC(dC.mark((function e(t){return dC.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",AP(PB(PB({},t),{},{usersApi:this.usersApi})));case 3:case"end":return e.stop()}}),e,this)}))),function(e){return O.apply(this,arguments)})},{key:"isRegisteredOnchain",value:(k=sC(dC.mark((function e(t){var r,n;return dC.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.validateChain(t.ethSigner);case 2:return r=iC.connect(this.config.ethConfiguration.registrationContractAddress,t.ethSigner),e.next=5,t.starkSigner.getAddress();case 5:return n=e.sent,e.abrupt("return",kP(n,r));case 7:case"end":return e.stop()}}),e,this)}))),function(e){return k.apply(this,arguments)})},{key:"mint",value:(S=sC(dC.mark((function e(t,r){return dC.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.validateChain(t);case 2:return e.abrupt("return",cM(t,r,this.mintsApi));case 3:case"end":return e.stop()}}),e,this)}))),function(e,t){return S.apply(this,arguments)})},{key:"transfer",value:(A=sC(dC.mark((function e(t,r){return dC.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",mM(PB(PB({},t),{},{request:r,transfersApi:this.transfersApi})));case 3:case"end":return e.stop()}}),e,this)}))),function(e,t){return A.apply(this,arguments)})},{key:"exchangeTransfer",value:(T=sC(dC.mark((function e(t,r){return dC.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",IB(PB(PB({},t),{},{request:r,exchangesApi:this.exchangesApi})));case 3:case"end":return e.stop()}}),e,this)}))),function(e,t){return T.apply(this,arguments)})},{key:"batchNftTransfer",value:(E=sC(dC.mark((function e(t,r){return dC.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",bM(PB(PB({},t),{},{request:r,transfersApi:this.transfersApi})));case 3:case"end":return e.stop()}}),e,this)}))),function(e,t){return E.apply(this,arguments)})},{key:"deposit",value:(_=sC(dC.mark((function e(t,r){return dC.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:e.t0=r.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,r));case 4:return e.abrupt("return",this.depositERC20(t,r));case 5:return e.abrupt("return",this.depositERC721(t,r));case 6:case"end":return e.stop()}}),e,this)}))),function(e,t){return _.apply(this,arguments)})},{key:"depositEth",value:(w=sC(dC.mark((function e(t,r){return dC.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.validateChain(t);case 2:return e.abrupt("return",RM(t,r,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=sC(dC.mark((function e(t,r){return dC.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.validateChain(t);case 2:return e.abrupt("return",MM(t,r,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=sC(dC.mark((function e(t,r){return dC.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.validateChain(t);case 2:return e.abrupt("return",LM(t,r,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:(b=sC(dC.mark((function e(t,r){return dC.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",qM(PB(PB(PB({},t),r),{},{withdrawalsApi:this.withdrawalsApi})));case 3:case"end":return e.stop()}}),e,this)}))),function(e,t){return b.apply(this,arguments)})},{key:"completeWithdrawal",value:function(e,t,r){switch(r.type){case"ETH":return this.completeEthWithdrawal(e,t);case"ERC20":return this.completeERC20Withdrawal(e,t,r);case"ERC721":return this.completeERC721Withdrawal(e,t,r)}}},{key:"completeEthWithdrawal",value:(y=sC(dC.mark((function e(t,r){return dC.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.validateChain(t);case 2:return e.abrupt("return",wB(t,r,this.encodingApi,this.usersApi,this.config));case 3:case"end":return e.stop()}}),e,this)}))),function(e,t){return y.apply(this,arguments)})},{key:"completeERC20Withdrawal",value:(m=sC(dC.mark((function e(t,r,n){return dC.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.validateChain(t);case 2:return e.abrupt("return",YM(t,r,n,this.encodingApi,this.usersApi,this.config));case 3:case"end":return e.stop()}}),e,this)}))),function(e,t,r){return m.apply(this,arguments)})},{key:"completeERC721Withdrawal",value:function(){var e=sC(dC.mark((function e(t,r,n){return dC.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.validateChain(t);case 2:return e.abrupt("return",hB(t,r,n,this.encodingApi,this.mintsApi,this.usersApi,this.config));case 3:case"end":return e.stop()}}),e,this)})));return function(t,r,n){return e.apply(this,arguments)}}()},{key:"createOrder",value:(h=sC(dC.mark((function e(t,r){return dC.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",AB(PB(PB({},t),{},{request:r,ordersApi:this.ordersApi})));case 3:case"end":return e.stop()}}),e,this)}))),function(e,t){return h.apply(this,arguments)})},{key:"cancelOrder",value:(p=sC(dC.mark((function e(t,r){return dC.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",kB(PB(PB({},t),{},{request:r,ordersApi:this.ordersApi})));case 3:case"end":return e.stop()}}),e,this)}))),function(e,t){return p.apply(this,arguments)})},{key:"createTrade",value:(d=sC(dC.mark((function e(t,r){return dC.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",RB(PB(PB({},t),{},{request:r,tradesApi:this.tradesApi})));case 3:case"end":return e.stop()}}),e,this)}))),function(e,t){return d.apply(this,arguments)})},{key:"createProject",value:(l=sC(dC.mark((function e(t,r){var n;return dC.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,gC(t);case 2:return n=e.sent,e.abrupt("return",this.projectsApi.createProject({iMXSignature:n.signature,iMXTimestamp:n.timestamp,createProjectRequest:r}));case 4:case"end":return e.stop()}}),e,this)}))),function(e,t){return l.apply(this,arguments)})},{key:"getProject",value:(c=sC(dC.mark((function e(t,r){var n;return dC.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,gC(t);case 2:return n=e.sent,e.abrupt("return",this.projectsApi.getProject({id:r,iMXSignature:n.signature,iMXTimestamp:n.timestamp}));case 4:case"end":return e.stop()}}),e,this)}))),function(e,t){return c.apply(this,arguments)})},{key:"getProjects",value:(f=sC(dC.mark((function e(t,r,n,i,a){var o;return dC.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,gC(t);case 2:return o=e.sent,e.abrupt("return",this.projectsApi.getProjects({iMXSignature:o.signature,iMXTimestamp:o.timestamp,pageSize:r,cursor:n,orderBy:i,direction:a}));case 4:case"end":return e.stop()}}),e,this)}))),function(e,t,r,n,i){return f.apply(this,arguments)})},{key:"createCollection",value:(u=sC(dC.mark((function e(t,r){var n;return dC.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,gC(t);case 2:return n=e.sent,e.abrupt("return",this.collectionsApi.createCollection({iMXSignature:n.signature,iMXTimestamp:n.timestamp,createCollectionRequest:r}));case 4:case"end":return e.stop()}}),e,this)}))),function(e,t){return u.apply(this,arguments)})},{key:"updateCollection",value:(s=sC(dC.mark((function e(t,r,n){var i;return dC.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,gC(t);case 2:return i=e.sent,e.abrupt("return",this.collectionsApi.updateCollection({iMXSignature:i.signature,iMXTimestamp:i.timestamp,address:r,updateCollectionRequest:n}));case 4:case"end":return e.stop()}}),e,this)}))),function(e,t,r){return s.apply(this,arguments)})},{key:"addMetadataSchemaToCollection",value:(o=sC(dC.mark((function e(t,r,n){var i;return dC.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,gC(t);case 2:return i=e.sent,e.abrupt("return",this.metadataApi.addMetadataSchemaToCollection({iMXSignature:i.signature,iMXTimestamp:i.timestamp,addMetadataSchemaToCollectionRequest:n,address:r}));case 4:case"end":return e.stop()}}),e,this)}))),function(e,t,r){return o.apply(this,arguments)})},{key:"updateMetadataSchemaByName",value:(a=sC(dC.mark((function e(t,r,n,i){var a;return dC.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,gC(t);case 2:return a=e.sent,e.abrupt("return",this.metadataApi.updateMetadataSchemaByName({iMXSignature:a.signature,iMXTimestamp:a.timestamp,address:r,name:n,metadataSchemaRequest:i}));case 4:case"end":return e.stop()}}),e,this)}))),function(e,t,r,n){return a.apply(this,arguments)})},{key:"listMetadataRefreshes",value:(i=sC(dC.mark((function e(t,r,n,i){var a,o;return dC.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,gC(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:r,pageSize:n,cursor:i}));case 7:case"end":return e.stop()}}),e,this)}))),function(e,t,r,n){return i.apply(this,arguments)})},{key:"getMetadataRefreshErrors",value:(n=sC(dC.mark((function e(t,r,n,i){var a,o;return dC.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,gC(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:r,pageSize:n,cursor:i}));case 7:case"end":return e.stop()}}),e,this)}))),function(e,t,r,i){return n.apply(this,arguments)})},{key:"getMetadataRefreshResults",value:(r=sC(dC.mark((function e(t,r){var n,i;return dC.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,gC(t);case 2:return n=e.sent,e.next=5,t.getAddress();case 5:return i=e.sent,e.abrupt("return",this.metadataRefreshesApi.getMetadataRefreshResults({xImxEthSignature:n.signature,xImxEthTimestamp:n.timestamp,xImxEthAddress:i,refreshId:r}));case 7:case"end":return e.stop()}}),e,this)}))),function(e,t){return r.apply(this,arguments)})},{key:"createMetadataRefresh",value:(t=sC(dC.mark((function e(t,r){var n,i;return dC.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,gC(t);case 2:return n=e.sent,e.next=5,t.getAddress();case 5:return i=e.sent,e.abrupt("return",this.metadataRefreshesApi.requestAMetadataRefresh({xImxEthSignature:n.signature,xImxEthTimestamp:n.timestamp,xImxEthAddress:i,createMetadataRefreshRequest:r}));case 7:case"end":return e.stop()}}),e,this)}))),function(e,r){return t.apply(this,arguments)})}]),e}();function BB(e){if(FI.isAxiosError(e)&&e.response){var t,r,n,i=e.response.data;return i.code&&i.message?new gP({code:i.code,details:i.details,message:i.message}):new gP({code:null!==(t=null!==(r=e.code)&&void 0!==r?r:null===(n=e.response)||void 0===n?void 0:n.status.toString())&&void 0!==t?t:"unknown_error_code",message:String(e)})}return new gP({code:"unknown_error_code",message:String(e)})}var DB=function(){function e(t){LI(this,e),this.depositsApi=new uN(t.apiConfiguration),this.mintsApi=new RN(t.apiConfiguration),this.ordersApi=new DN(t.apiConfiguration),this.tokensApi=new VN(t.apiConfiguration),this.tradesApi=new XN(t.apiConfiguration),this.transfersApi=new QN(t.apiConfiguration),this.exchangeApi=new yN(t.apiConfiguration),this.usersApi=new rP(t.apiConfiguration),this.withdrawalsApi=new oP(t.apiConfiguration),this.balanceApi=new eN(t.apiConfiguration),this.assetApi=new JC(t.apiConfiguration),this.collectionApi=new iN(t.apiConfiguration),this.metadataApi=new wN(t.apiConfiguration),this.metadataRefreshesApi=new AN(t.apiConfiguration),this.nftCheckoutPrimaryApi=new NN(t.apiConfiguration),this.projectsApi=new jN(t.apiConfiguration),this.workflows=new MB(t)}var t,r,n;return jI(e,[{key:"deposit",value:function(e,t){return this.workflows.deposit(e,t).catch((function(e){throw BB(e)}))}},{key:"getDeposit",value:function(e){return this.depositsApi.getDeposit(e).then((function(e){return e.data})).catch((function(e){throw BB(e)}))}},{key:"listDeposits",value:function(e){return this.depositsApi.listDeposits(e).then((function(e){return e.data})).catch((function(e){throw BB(e)}))}},{key:"registerOffchain",value:function(e){return this.workflows.registerOffchain(e).catch((function(e){throw BB(e)}))}},{key:"isRegisteredOnchain",value:function(e){return this.workflows.isRegisteredOnchain(e).catch((function(e){throw BB(e)}))}},{key:"getUser",value:function(e){return this.usersApi.getUsers({user:e}).then((function(e){return e.data})).catch((function(e){throw BB(e)}))}},{key:"getAsset",value:function(e){return this.assetApi.getAsset(e).then((function(e){return e.data})).catch((function(e){throw BB(e)}))}},{key:"listAssets",value:function(e){return this.assetApi.listAssets(e).then((function(e){return e.data})).catch((function(e){throw BB(e)}))}},{key:"createCollection",value:function(e,t){return this.workflows.createCollection(e,t).then((function(e){return e.data})).catch((function(e){throw BB(e)}))}},{key:"getCollection",value:function(e){return this.collectionApi.getCollection(e).then((function(e){return e.data})).catch((function(e){throw BB(e)}))}},{key:"listCollectionFilters",value:function(e){return this.collectionApi.listCollectionFilters(e).then((function(e){return e.data})).catch((function(e){throw BB(e)}))}},{key:"listCollections",value:function(e){return this.collectionApi.listCollections(e).then((function(e){return e.data})).catch((function(e){throw BB(e)}))}},{key:"updateCollection",value:function(e,t,r){return this.workflows.updateCollection(e,t,r).then((function(e){return e.data})).catch((function(e){throw BB(e)}))}},{key:"addMetadataSchemaToCollection",value:function(e,t,r){return this.workflows.addMetadataSchemaToCollection(e,t,r).then((function(e){return e.data})).catch((function(e){throw BB(e)}))}},{key:"getMetadataSchema",value:function(e){return this.metadataApi.getMetadataSchema(e).then((function(e){return e.data})).catch((function(e){throw BB(e)}))}},{key:"updateMetadataSchemaByName",value:function(e,t,r,n){return this.workflows.updateMetadataSchemaByName(e,t,r,n).then((function(e){return e.data})).catch((function(e){throw BB(e)}))}},{key:"listMetadataRefreshes",value:function(e,t,r,n){return this.workflows.listMetadataRefreshes(e,t,r,n).then((function(e){return e.data})).catch((function(e){throw BB(e)}))}},{key:"getMetadataRefreshErrors",value:function(e,t,r,n){return this.workflows.getMetadataRefreshErrors(e,t,r,n).then((function(e){return e.data})).catch((function(e){throw BB(e)}))}},{key:"getMetadataRefreshResults",value:function(e,t){return this.workflows.getMetadataRefreshResults(e,t).then((function(e){return e.data})).catch((function(e){throw BB(e)}))}},{key:"createMetadataRefresh",value:function(e,t){return this.workflows.createMetadataRefresh(e,t).then((function(e){return e.data})).catch((function(e){throw BB(e)}))}},{key:"createProject",value:(n=sC(dC.mark((function e(t,r){return dC.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.workflows.createProject(t,r).then((function(e){return e.data})).catch((function(e){throw BB(e)})));case 1:case"end":return e.stop()}}),e,this)}))),function(e,t){return n.apply(this,arguments)})},{key:"getProject",value:(r=sC(dC.mark((function e(t,r){return dC.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.workflows.getProject(t,r).then((function(e){return e.data})).catch((function(e){throw BB(e)})));case 1:case"end":return e.stop()}}),e,this)}))),function(e,t){return r.apply(this,arguments)})},{key:"getProjects",value:(t=sC(dC.mark((function e(t,r,n,i,a){return dC.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.workflows.getProjects(t,r,n,i,a).then((function(e){return e.data})).catch((function(e){throw BB(e)})));case 1:case"end":return e.stop()}}),e,this)}))),function(e,r,n,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 BB(e)}))}},{key:"listBalances",value:function(e){return this.balanceApi.listBalances(e).then((function(e){return e.data})).catch((function(e){throw BB(e)}))}},{key:"getMint",value:function(e){return this.mintsApi.getMint(e).then((function(e){return e.data})).catch((function(e){throw BB(e)}))}},{key:"listMints",value:function(e){return this.mintsApi.listMints(e).then((function(e){return e.data})).catch((function(e){throw BB(e)}))}},{key:"mint",value:function(e,t){return this.workflows.mint(e,t).catch((function(e){throw BB(e)}))}},{key:"listWithdrawals",value:function(e){return this.withdrawalsApi.listWithdrawals(e).then((function(e){return e.data})).catch((function(e){throw BB(e)}))}},{key:"getWithdrawal",value:function(e){return this.withdrawalsApi.getWithdrawal(e).then((function(e){return e.data})).catch((function(e){throw BB(e)}))}},{key:"prepareWithdrawal",value:function(e,t){return this.workflows.prepareWithdrawal(e,t).catch((function(e){throw BB(e)}))}},{key:"completeWithdrawal",value:function(e,t,r){return this.workflows.completeWithdrawal(e,t,r).catch((function(e){throw BB(e)}))}},{key:"getOrder",value:function(e){return this.ordersApi.getOrderV3(e).then((function(e){return e.data})).catch((function(e){throw BB(e)}))}},{key:"listOrders",value:function(e){return this.ordersApi.listOrdersV3(e).then((function(e){return e.data})).catch((function(e){throw BB(e)}))}},{key:"createOrder",value:function(e,t){return this.workflows.createOrder(e,t).catch((function(e){throw BB(e)}))}},{key:"cancelOrder",value:function(e,t){return this.workflows.cancelOrder(e,t).catch((function(e){throw BB(e)}))}},{key:"getTrade",value:function(e){return this.tradesApi.getTrade(e).then((function(e){return e.data})).catch((function(e){throw BB(e)}))}},{key:"listTrades",value:function(e){return this.tradesApi.listTradesV3(e).then((function(e){return e.data})).catch((function(e){throw BB(e)}))}},{key:"createTrade",value:function(e,t){return this.workflows.createTrade(e,t).catch((function(e){throw BB(e)}))}},{key:"getToken",value:function(e){return this.tokensApi.getToken(e).then((function(e){return e.data})).catch((function(e){throw BB(e)}))}},{key:"listTokens",value:function(e){return this.tokensApi.listTokens(e).then((function(e){return e.data})).catch((function(e){throw BB(e)}))}},{key:"getTransfer",value:function(e){return this.transfersApi.getTransfer(e).then((function(e){return e.data})).catch((function(e){throw BB(e)}))}},{key:"listTransfers",value:function(e){return this.transfersApi.listTransfers(e).then((function(e){return e.data})).catch((function(e){throw BB(e)}))}},{key:"transfer",value:function(e,t){return this.workflows.transfer(e,t).catch((function(e){throw BB(e)}))}},{key:"batchNftTransfer",value:function(e,t){return this.workflows.batchNftTransfer(e,t).catch((function(e){throw BB(e)}))}},{key:"createExchange",value:function(e){return this.exchangeApi.createExchange(e).catch((function(e){throw BB(e)}))}},{key:"getExchange",value:function(e){return this.exchangeApi.getExchange(e).catch((function(e){throw BB(e)}))}},{key:"getExchanges",value:function(e){return this.exchangeApi.getExchanges(e).catch((function(e){throw BB(e)}))}},{key:"exchangeTransfer",value:function(e,t){return this.workflows.exchangeTransfer(e,t).catch((function(e){throw BB(e)}))}},{key:"createNftPrimary",value:function(e){return this.nftCheckoutPrimaryApi.createNftPrimary(e).catch((function(e){throw BB(e)}))}},{key:"getCurrenciesNFTCheckoutPrimary",value:function(e){return this.nftCheckoutPrimaryApi.getCurrenciesNFTCheckoutPrimary(e).catch((function(e){throw BB(e)}))}},{key:"getNftPrimaryTransaction",value:function(e){return this.nftCheckoutPrimaryApi.getNftPrimaryTransaction(e).catch((function(e){throw BB(e)}))}},{key:"getNftPrimaryTransactions",value:function(e){return this.nftCheckoutPrimaryApi.getNftPrimaryTransactions(e).catch((function(e){throw BB(e)}))}}]),e}();const FB=({basePath:e,chainID:t,coreContractAddress:r,registrationContractAddress:n})=>TP.createConfig({basePath:e,chainID:t,coreContractAddress:r,registrationContractAddress:n,sdkVersion:"ts-immutable-sdk-0.3.2-alpha"}),LB=()=>FB({basePath:"https://api.sandbox.x.immutable.com",chainID:5,coreContractAddress:"0x7917eDb51ecD6CdB3F9854c3cc593F33de10c623",registrationContractAddress:"0x1C97Ada273C9A52253f463042f29117090Cd7D83"});class UB{immutableXConfig;baseConfig;constructor({baseConfig:t,overrides:r}){if(this.baseConfig=t,r)this.immutableXConfig=r.immutableXConfig;else switch(t.environment){case e.Environment.SANDBOX:this.immutableXConfig=LB();break;case e.Environment.PRODUCTION:this.immutableXConfig=FB({basePath:"https://api.x.immutable.com",chainID:1,coreContractAddress:"0x5FDCCA53617f4d2b9134B29090C87D01058e27e9",registrationContractAddress:"0x72a06bf2a1CE5e39cBA06c0CAb824960B587d64c"});break;default:this.immutableXConfig=LB()}}}class jB{immutableX;depositsApi;mintsApi;ordersApi;tokensApi;tradesApi;transfersApi;exchangeApi;nftCheckoutPrimaryApi;usersApi;withdrawalsApi;balanceApi;assetApi;collectionApi;metadataApi;metadataRefreshesApi;projectsApi;constructor(e){const t=new UB(e);this.immutableX=new DB(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,r){return this.immutableX.updateCollection(e,t,r)}addMetadataSchemaToCollection(e,t,r){return this.immutableX.addMetadataSchemaToCollection(e,t,r)}getMetadataSchema(e){return this.immutableX.getMetadataSchema(e)}updateMetadataSchemaByName(e,t,r,n){return this.immutableX.updateMetadataSchemaByName(e,t,r,n)}listMetadataRefreshes(e,t,r,n){return this.immutableX.listMetadataRefreshes(e,t,r,n)}getMetadataRefreshErrors(e,t,r,n){return this.immutableX.getMetadataRefreshErrors(e,t,r,n)}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,r,n,i){return this.immutableX.getProjects(e,t,r,n,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 qB={exports:{}};!function(e,t){e.exports=function(){var e=e||function(e,t){var r;if("undefined"!=typeof window&&window.crypto&&(r=window.crypto),"undefined"!=typeof self&&self.crypto&&(r=self.crypto),"undefined"!=typeof globalThis&&globalThis.crypto&&(r=globalThis.crypto),!r&&"undefined"!=typeof window&&window.msCrypto&&(r=window.msCrypto),!r&&void 0!==on&&on.crypto&&(r=on.crypto),!r)try{r=Gb}catch(e){}var n=function(){if(r){if("function"==typeof r.getRandomValues)try{return r.getRandomValues(new Uint32Array(1))[0]}catch(e){}if("function"==typeof r.randomBytes)try{return r.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 r;return e.prototype=t,r=new e,e.prototype=null,r}}(),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)}},u=o.WordArray=s.extend({init:function(e,r){e=this.words=e||[],this.sigBytes=r!=t?r:4*e.length},toString:function(e){return(e||c).stringify(this)},concat:function(e){var t=this.words,r=e.words,n=this.sigBytes,i=e.sigBytes;if(this.clamp(),n%4)for(var a=0;a<i;a++){var o=r[a>>>2]>>>24-a%4*8&255;t[n+a>>>2]|=o<<24-(n+a)%4*8}else for(var s=0;s<i;s+=4)t[n+s>>>2]=r[s>>>2];return this.sigBytes+=i,this},clamp:function(){var t=this.words,r=this.sigBytes;t[r>>>2]&=4294967295<<32-r%4*8,t.length=e.ceil(r/4)},clone:function(){var e=s.clone.call(this);return e.words=this.words.slice(0),e},random:function(e){for(var t=[],r=0;r<e;r+=4)t.push(n());return new u.init(t,e)}}),f=a.enc={},c=f.Hex={stringify:function(e){for(var t=e.words,r=e.sigBytes,n=[],i=0;i<r;i++){var a=t[i>>>2]>>>24-i%4*8&255;n.push((a>>>4).toString(16)),n.push((15&a).toString(16))}return n.join("")},parse:function(e){for(var t=e.length,r=[],n=0;n<t;n+=2)r[n>>>3]|=parseInt(e.substr(n,2),16)<<24-n%8*4;return new u.init(r,t/2)}},l=f.Latin1={stringify:function(e){for(var t=e.words,r=e.sigBytes,n=[],i=0;i<r;i++){var a=t[i>>>2]>>>24-i%4*8&255;n.push(String.fromCharCode(a))}return n.join("")},parse:function(e){for(var t=e.length,r=[],n=0;n<t;n++)r[n>>>2]|=(255&e.charCodeAt(n))<<24-n%4*8;return new u.init(r,t)}},d=f.Utf8={stringify:function(e){try{return decodeURIComponent(escape(l.stringify(e)))}catch(e){throw new Error("Malformed UTF-8 data")}},parse:function(e){return l.parse(unescape(encodeURIComponent(e)))}},p=o.BufferedBlockAlgorithm=s.extend({reset:function(){this._data=new u.init,this._nDataBytes=0},_append:function(e){"string"==typeof e&&(e=d.parse(e)),this._data.concat(e),this._nDataBytes+=e.sigBytes},_process:function(t){var r,n=this._data,i=n.words,a=n.sigBytes,o=this.blockSize,s=a/(4*o),f=(s=t?e.ceil(s):e.max((0|s)-this._minBufferSize,0))*o,c=e.min(4*f,a);if(f){for(var l=0;l<f;l+=o)this._doProcessBlock(i,l);r=i.splice(0,f),n.sigBytes-=c}return new u.init(r,c)},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,r){return new e.init(r).finalize(t)}},_createHmacHelper:function(e){return function(t,r){return new h.HMAC.init(e,r).finalize(t)}}});var h=a.algo={};return a}(Math);return e}()}(qB);var zB=qB.exports,HB=sn(zB),VB={exports:{}};!function(e,t){e.exports=function(e){return function(t){var r=e,n=r.lib,i=n.WordArray,a=n.Hasher,o=r.algo,s=[],u=[];!function(){function e(e){for(var r=t.sqrt(e),n=2;n<=r;n++)if(!(e%n))return!1;return!0}function r(e){return 4294967296*(e-(0|e))|0}for(var n=2,i=0;i<64;)e(n)&&(i<8&&(s[i]=r(t.pow(n,.5))),u[i]=r(t.pow(n,1/3)),i++),n++}();var f=[],c=o.SHA256=a.extend({_doReset:function(){this._hash=new i.init(s.slice(0))},_doProcessBlock:function(e,t){for(var r=this._hash.words,n=r[0],i=r[1],a=r[2],o=r[3],s=r[4],c=r[5],l=r[6],d=r[7],p=0;p<64;p++){if(p<16)f[p]=0|e[t+p];else{var h=f[p-15],m=(h<<25|h>>>7)^(h<<14|h>>>18)^h>>>3,y=f[p-2],b=(y<<15|y>>>17)^(y<<13|y>>>19)^y>>>10;f[p]=m+f[p-7]+b+f[p-16]}var g=n&i^n&a^i&a,v=(n<<30|n>>>2)^(n<<19|n>>>13)^(n<<10|n>>>22),w=d+((s<<26|s>>>6)^(s<<21|s>>>11)^(s<<7|s>>>25))+(s&c^~s&l)+u[p]+f[p];d=l,l=c,c=s,s=o+w|0,o=a,a=i,i=n,n=w+(v+g)|0}r[0]=r[0]+n|0,r[1]=r[1]+i|0,r[2]=r[2]+a|0,r[3]=r[3]+o|0,r[4]=r[4]+s|0,r[5]=r[5]+c|0,r[6]=r[6]+l|0,r[7]=r[7]+d|0},_doFinalize:function(){var e=this._data,r=e.words,n=8*this._nDataBytes,i=8*e.sigBytes;return r[i>>>5]|=128<<24-i%32,r[14+(i+64>>>9<<4)]=t.floor(n/4294967296),r[15+(i+64>>>9<<4)]=n,e.sigBytes=4*r.length,this._process(),this._hash},clone:function(){var e=a.clone.call(this);return e._hash=this._hash.clone(),e}});r.SHA256=a._createHelper(c),r.HmacSHA256=a._createHmacHelper(c)}(Math),e.SHA256}(zB)}(VB);var GB=sn(VB.exports),WB={exports:{}};!function(e,t){e.exports=function(e){return function(){var t=e,r=t.lib.WordArray;function n(e,t,n){for(var i=[],a=0,o=0;o<t;o++)if(o%4){var s=n[e.charCodeAt(o-1)]<<o%4*2|n[e.charCodeAt(o)]>>>6-o%4*2;i[a>>>2]|=s<<24-a%4*8,a++}return r.create(i,a)}t.enc.Base64={stringify:function(e){var t=e.words,r=e.sigBytes,n=this._map;e.clamp();for(var i=[],a=0;a<r;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<r;s++)i.push(n.charAt(o>>>6*(3-s)&63));var u=n.charAt(64);if(u)for(;i.length%4;)i.push(u);return i.join("")},parse:function(e){var t=e.length,r=this._map,i=this._reverseMap;if(!i){i=this._reverseMap=[];for(var a=0;a<r.length;a++)i[r.charCodeAt(a)]=a}var o=r.charAt(64);if(o){var s=e.indexOf(o);-1!==s&&(t=s)}return n(e,t,i)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="}}(),e.enc.Base64}(zB)}(WB);var KB=sn(WB.exports),XB={exports:{}};!function(e,t){e.exports=function(e){return e.enc.Utf8}(zB)}(XB);var $B=sn(XB.exports);function JB(e){this.message=e}JB.prototype=new Error,JB.prototype.name="InvalidCharacterError";var YB="undefined"!=typeof window&&window.atob&&window.atob.bind(window)||function(e){var t=String(e).replace(/=+$/,"");if(t.length%4==1)throw new JB("'atob' failed: The string to be decoded is not correctly encoded.");for(var r,n,i=0,a=0,o="";n=t.charAt(a++);~n&&(r=i%4?64*r+n:n,i++%4)?o+=String.fromCharCode(255&r>>(-2*i&6)):0)n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(n);return o};function QB(e){this.message=e}function ZB(e,t){if("string"!=typeof e)throw new QB("Invalid token specified");var r=!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(YB(e).replace(/(.)/g,(function(e,t){var r=t.charCodeAt(0).toString(16).toUpperCase();return r.length<2&&(r="0"+r),"%"+r})))}(t)}catch(e){return YB(t)}}(e.split(".")[r]))}catch(e){throw new QB("Invalid token specified: "+e.message)}}QB.prototype=new Error,QB.prototype.name="InvalidTokenError";var eD,tD,rD,nD={debug:()=>{},info:()=>{},warn:()=>{},error:()=>{}},iD=(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))(iD||{});(rD=iD||(iD={})).reset=function(){eD=3,tD=nD},rD.setLevel=function(e){if(!(0<=e&&e<=4))throw new Error("Invalid log level");eD=e},rD.setLogger=function(e){tD=e};var aD=class{constructor(e){this._name=e}debug(...e){eD>=4&&tD.debug(aD._format(this._name,this._method),...e)}info(...e){eD>=3&&tD.info(aD._format(this._name,this._method),...e)}warn(...e){eD>=2&&tD.warn(aD._format(this._name,this._method),...e)}error(...e){eD>=1&&tD.error(aD._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 r=new aD(`${e}.${t}`);return r.debug("begin"),r}static _format(e,t){const r=`[${e}]`;return t?`${r} ${t}:`:r}static debug(e,...t){eD>=4&&tD.debug(aD._format(e),...t)}static info(e,...t){eD>=3&&tD.info(aD._format(e),...t)}static warn(e,...t){eD>=2&&tD.warn(aD._format(e),...t)}static error(e,...t){eD>=1&&tD.error(aD._format(e),...t)}};iD.reset();var oD=class{static _randomWord(){return HB.lib.WordArray.random(1).words[0]}static generateUUIDv4(){const e="10000000-1000-4000-8000-100000000000".replace(/[018]/g,(e=>(+e^oD._randomWord()&15>>+e/4).toString(16)));return e.replace(/-/g,"")}static generateCodeVerifier(){return oD.generateUUIDv4()+oD.generateUUIDv4()+oD.generateUUIDv4()}static generateCodeChallenge(e){try{const t=GB(e);return KB.stringify(t).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}catch(e){throw aD.error("CryptoUtils.generateCodeChallenge",e),e}}static generateBasicAuth(e,t){const r=$B.parse([e,t].join(":"));return KB.stringify(r)}},sD=class{constructor(e){this._name=e,this._logger=new aD(`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)}},uD=class{static decode(e){try{return ZB(e)}catch(e){throw aD.error("JwtUtils.decode",e),e}}},fD=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(",")}},cD=class extends sD{constructor(){super(...arguments),this._logger=new aD(`Timer('${this._name}')`),this._timerHandle=null,this._expiration=0,this._callback=()=>{const e=this._expiration-cD.getEpochTime();this._logger.debug("timer completes in",e),this._expiration<=cD.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 r=cD.getEpochTime()+e;if(this.expiration===r&&this._timerHandle)return void t.debug("skipping since already initialized for expiration at",this.expiration);this.cancel(),t.debug("using duration",e),this._expiration=r;const n=Math.min(e,5);this._timerHandle=setInterval(this._callback,1e3*n)}get expiration(){return this._expiration}cancel(){this._logger.create("cancel"),this._timerHandle&&(clearInterval(this._timerHandle),this._timerHandle=null)}},lD=class{static readParams(e,t="query"){if(!e)throw new TypeError("Invalid URL");const r=new URL(e,"http://127.0.0.1")["fragment"===t?"hash":"search"];return new URLSearchParams(r.slice(1))}},dD=class extends Error{constructor(e,t){var r,n,i;if(super(e.error_description||e.error||""),this.form=t,this.name="ErrorResponse",!e.error)throw aD.error("ErrorResponse","No error passed"),new Error("No error passed");this.error=e.error,this.error_description=null!=(r=e.error_description)?r:null,this.error_uri=null!=(n=e.error_uri)?n:null,this.state=e.userState,this.session_state=null!=(i=e.session_state)?i:null}},pD=class extends Error{constructor(e){super(e),this.name="ErrorTimeout"}},hD=class{constructor(e){this._logger=new aD("AccessTokenEvents"),this._expiringTimer=new cD("Access token expiring"),this._expiredTimer=new cD("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 r=e.expires_in;if(t.debug("access token present, remaining duration:",r),r>0){let e=r-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 n=r+1;t.debug("registering expired timer, raising in",n,"seconds"),this._expiredTimer.init(n)}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)}},mD=class{constructor(){this._logger=new aD("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]}},yD=class{constructor(e=[],t=null,r={}){this._jwtHandler=t,this._extraHeaders=r,this._logger=new aD("JsonService"),this._contentTypes=[],this._contentTypes.push(...e,"application/json"),t&&this._contentTypes.push("application/jwt")}async fetchWithTimeout(e,t={}){const{timeoutInSeconds:r,...n}=t;if(!r)return await fetch(e,n);const i=new AbortController,a=setTimeout((()=>i.abort()),1e3*r);try{return await fetch(e,{...t,signal:i.signal})}catch(e){if(e instanceof DOMException&&"AbortError"===e.name)throw new pD("Network timed out");throw e}finally{clearTimeout(a)}}async getJson(e,{token:t,credentials:r}={}){const n=this._logger.create("getJson"),i={Accept:this._contentTypes.join(", ")};let a;t&&(n.debug("token passed, setting Authorization header"),i.Authorization="Bearer "+t),this.appendExtraHeaders(i);try{n.debug("url:",e),a=await this.fetchWithTimeout(e,{method:"GET",headers:i,credentials:r})}catch(e){throw n.error("Network Error"),e}n.debug("HTTP response received, status",a.status);const o=a.headers.get("Content-Type");if(o&&!this._contentTypes.find((e=>o.startsWith(e)))&&n.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(n.error("Error parsing JSON response",e),a.ok)throw e;throw new Error(`${a.statusText} (${a.status})`)}if(!a.ok){if(n.error("Error from server:",s),s.error)throw new dD(s);throw new Error(`${a.statusText} (${a.status}): ${JSON.stringify(s)}`)}return s}async postForm(e,{body:t,basicAuth:r,timeoutInSeconds:n,initCredentials:i}){const a=this._logger.create("postForm"),o={Accept:this._contentTypes.join(", "),"Content-Type":"application/x-www-form-urlencoded"};let s;void 0!==r&&(o.Authorization="Basic "+r),this.appendExtraHeaders(o);try{a.debug("url:",e),s=await this.fetchWithTimeout(e,{method:"POST",headers:o,body:t,timeoutInSeconds:n,credentials:i})}catch(e){throw a.error("Network error"),e}a.debug("HTTP response received, status",s.status);const u=s.headers.get("Content-Type");if(u&&!this._contentTypes.find((e=>u.startsWith(e))))throw new Error(`Invalid response Content-Type: ${null!=u?u:"undefined"}, from URL: ${e}`);const f=await s.text();let c={};if(f)try{c=JSON.parse(f)}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:",c),c.error)throw new dD(c,t);throw new Error(`${s.statusText} (${s.status}): ${JSON.stringify(c)}`)}return c}appendExtraHeaders(e){const t=this._logger.create("appendExtraHeaders"),r=Object.keys(this._extraHeaders),n=["authorization","accept","content-type"];0!==r.length&&r.forEach((r=>{if(n.includes(r.toLocaleLowerCase()))return void t.warn("Protected header could not be overridden",r,n);const i="function"==typeof this._extraHeaders[r]?this._extraHeaders[r]():this._extraHeaders[r];i&&""!==i&&(e[r]=i)}))}},bD=class{constructor({prefix:e="oidc.",store:t=localStorage}={}){this._logger=new aD("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 r=0;r<e;r++){const e=await this._store.key(r);e&&0===e.indexOf(this._prefix)&&t.push(e.substr(this._prefix.length))}return t}},gD=class{constructor({authority:e,metadataUrl:t,metadata:r,signingKeys:n,metadataSeed:i,client_id:a,client_secret:o,response_type:s="code",scope:u="openid",redirect_uri:f,post_logout_redirect_uri:c,client_authentication:l="client_secret_post",prompt:d,display:p,max_age:h,ui_locales:m,acr_values:y,resource:b,response_mode:g="query",filterProtocolClaims:v=!0,loadUserInfo:w=!1,staleStateAgeInSeconds:_=900,clockSkewInSeconds:E=300,userInfoJwtIssuer:T="OP",mergeClaims:A=!1,disablePKCE:S=!1,stateStore:k,refreshTokenCredentials:O,revokeTokenAdditionalContentTypes:R,fetchRequestCredentials:x,refreshTokenAllowedScope:I,extraQueryParams:C={},extraTokenParams:N={},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=r,this.metadataSeed=i,this.signingKeys=n,this.client_id=a,this.client_secret=o,this.response_type=s,this.scope=u,this.redirect_uri=f,this.post_logout_redirect_uri=c,this.client_authentication=l,this.prompt=d,this.display=p,this.max_age=h,this.ui_locales=m,this.acr_values=y,this.resource=b,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=!!S,this.revokeTokenAdditionalContentTypes=R,x&&O&&console.warn("Both fetchRequestCredentials and refreshTokenCredentials is set. Only fetchRequestCredentials will be used."),this.fetchRequestCredentials=x||(O||"same-origin"),k)this.stateStore=k;else{const e="undefined"!=typeof window?window.localStorage:new mD;this.stateStore=new bD({store:e})}this.refreshTokenAllowedScope=I,this.extraQueryParams=C,this.extraTokenParams=N,this.extraHeaders=P}},vD=class{constructor(e,t){this._settings=e,this._metadataService=t,this._logger=new aD("TokenClient"),this._jsonService=new yD(this._settings.revokeTokenAdditionalContentTypes,null,this._settings.extraHeaders)}async exchangeCode({grant_type:e="authorization_code",redirect_uri:t=this._settings.redirect_uri,client_id:r=this._settings.client_id,client_secret:n=this._settings.client_secret,...i}){const a=this._logger.create("exchangeCode");r||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(!n)throw a.throw(new Error("A client_secret is required")),null;s=oD.generateBasicAuth(r,n);break;case"client_secret_post":o.append("client_id",r),n&&o.append("client_secret",n)}const u=await this._metadataService.getTokenEndpoint(!1);a.debug("got token endpoint");const f=await this._jsonService.postForm(u,{body:o,basicAuth:s,initCredentials:this._settings.fetchRequestCredentials});return a.debug("got response"),f}async exchangeCredentials({grant_type:e="password",client_id:t=this._settings.client_id,client_secret:r=this._settings.client_secret,scope:n=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:n});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=oD.generateBasicAuth(t,r);break;case"client_secret_post":o.append("client_id",t),r&&o.append("client_secret",r)}const u=await this._metadataService.getTokenEndpoint(!1);a.debug("got token endpoint");const f=await this._jsonService.postForm(u,{body:o,basicAuth:s,initCredentials:this._settings.fetchRequestCredentials});return a.debug("got response"),f}async exchangeRefreshToken({grant_type:e="refresh_token",client_id:t=this._settings.client_id,client_secret:r=this._settings.client_secret,timeoutInSeconds:n,...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(!r)throw a.throw(new Error("A client_secret is required")),null;s=oD.generateBasicAuth(t,r);break;case"client_secret_post":o.append("client_id",t),r&&o.append("client_secret",r)}const u=await this._metadataService.getTokenEndpoint(!1);a.debug("got token endpoint");const f=await this._jsonService.postForm(u,{body:o,basicAuth:s,timeoutInSeconds:n,initCredentials:this._settings.fetchRequestCredentials});return a.debug("got response"),f}async revoke(e){var t;const r=this._logger.create("revoke");e.token||r.throw(new Error("A token is required"));const n=await this._metadataService.getRevocationEndpoint(!1);r.debug(`got revocation endpoint, revoking ${null!=(t=e.token_type_hint)?t:"default token type"}`);const i=new URLSearchParams;for(const[t,r]of Object.entries(e))null!=r&&i.set(t,r);i.set("client_id",this._settings.client_id),this._settings.client_secret&&i.set("client_secret",this._settings.client_secret),await this._jsonService.postForm(n,{body:i}),r.debug("got response")}},wD=class{constructor(e){this.id=e.id||oD.generateUUIDv4(),this.data=e.data,e.created&&e.created>0?this.created=e.created:this.created=cD.getEpochTime(),this.request_type=e.request_type}toStorageString(){return new aD("State").create("toStorageString"),JSON.stringify({id:this.id,data:this.data,created:this.created,request_type:this.request_type})}static fromStorageString(e){return aD.createStatic("State","fromStorageString"),new wD(JSON.parse(e))}static async clearStaleState(e,t){const r=aD.createStatic("State","clearStaleState"),n=cD.getEpochTime()-t,i=await e.getAllKeys();r.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=wD.fromStorageString(o);r.debug("got item from key:",a,e.created),e.created<=n&&(s=!0)}catch(e){r.error("Error parsing state for key:",a,e),s=!0}else r.debug("no item in storage for key:",a),s=!0;s&&(r.debug("removed item for key:",a),e.remove(a))}}},_D=class extends wD{constructor(e){super(e),!0===e.code_verifier?this.code_verifier=oD.generateCodeVerifier():e.code_verifier&&(this.code_verifier=e.code_verifier),this.code_verifier&&(this.code_challenge=oD.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 aD("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){aD.createStatic("SigninState","fromStorageString");const t=JSON.parse(e);return new _D(t)}},ED=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-cD.getEpochTime()}set expires_in(e){"string"==typeof e&&(e=Number(e)),void 0!==e&&e>=0&&(this.expires_at=Math.floor(e)+cD.getEpochTime())}get isOpenId(){var e;return(null==(e=this.scope)?void 0:e.split(" ").includes("openid"))||!!this.id_token}},TD=["nbf","jti","auth_time","nonce","acr","amr","azp","at_hash"],AD=["sub","iss","aud","exp","iat"],SD=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-cD.getEpochTime()}set expires_in(e){void 0!==e&&(this.expires_at=Math.floor(e)+cD.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 aD("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 aD.createStatic("User","fromStorageString"),new SD(JSON.parse(e))}},kD="oidc-client",OD=class{constructor(){this._abort=new sD("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:r,keepOpen:n}=await new Promise(((r,n)=>{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)===kD){try{const r=lD.readParams(o.url,e.response_mode).get("state");if(r||t.warn("no state found in response url"),i.source!==this._window&&r!==e.state)return}catch(e){this._dispose(),n(new Error("Invalid response from window"))}r(o)}};window.addEventListener("message",i,!1),this._disposeHandlers.add((()=>window.removeEventListener("message",i,!1))),this._disposeHandlers.add(this._abort.addHandler((e=>{this._dispose(),n(e)})))}));return t.debug("got response from window"),this._dispose(),n||this.close(),{url:r}}_dispose(){this._logger.create("_dispose");for(const e of this._disposeHandlers)e();this._disposeHandlers.clear()}static _notifyParent(e,t,r=!1,n=window.location.origin){e.postMessage({source:kD,url:t,keepOpen:r},n)}},RD={location:!1,toolbar:!1,height:640},xD="_blank",ID=60,CD=2,ND=10,PD=class extends gD{constructor(e){const{popup_redirect_uri:t=e.redirect_uri,popup_post_logout_redirect_uri:r=e.post_logout_redirect_uri,popupWindowFeatures:n=RD,popupWindowTarget:i=xD,redirectMethod:a="assign",redirectTarget:o="self",iframeNotifyParentOrigin:s=e.iframeNotifyParentOrigin,iframeScriptOrigin:u=e.iframeScriptOrigin,silent_redirect_uri:f=e.redirect_uri,silentRequestTimeoutInSeconds:c=ND,automaticSilentRenew:l=!0,validateSubOnSilentRenew:d=!0,includeIdTokenInSilentRenew:p=!1,monitorSession:h=!1,monitorAnonymousSession:m=!1,checkSessionIntervalInSeconds:y=CD,query_status_response_type:b="code",stopCheckSessionOnError:g=!0,revokeTokenTypes:v=["access_token","refresh_token"],revokeTokensOnSignout:w=!1,includeIdTokenInSilentSignout:_=!1,accessTokenExpiringNotificationTimeInSeconds:E=ID,userStore:T}=e;if(super(e),this.popup_redirect_uri=t,this.popup_post_logout_redirect_uri=r,this.popupWindowFeatures=n,this.popupWindowTarget=i,this.redirectMethod=a,this.redirectTarget=o,this.iframeNotifyParentOrigin=s,this.iframeScriptOrigin=u,this.silent_redirect_uri=f,this.silentRequestTimeoutInSeconds=c,this.automaticSilentRenew=l,this.validateSubOnSilentRenew=d,this.includeIdTokenInSilentRenew=p,this.monitorSession=h,this.monitorAnonymousSession=m,this.checkSessionIntervalInSeconds=y,this.stopCheckSessionOnError=g,this.query_status_response_type=b,this.revokeTokenTypes=v,this.revokeTokensOnSignout=w,this.includeIdTokenInSilentSignout=_,this.accessTokenExpiringNotificationTimeInSeconds=E,T)this.userStore=T;else{const e="undefined"!=typeof window?window.sessionStorage:new mD;this.userStore=new bD({store:e})}}},MD=class extends OD{constructor({silentRequestTimeoutInSeconds:e=ND}){super(),this._logger=new aD("IFrameWindow"),this._timeoutInSeconds=e,this._frame=MD.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 pD("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 r=e.target;null==(t=r.parentNode)||t.removeChild(r),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)}},BD=class extends OD{constructor({popupWindowTarget:e=xD,popupWindowFeatures:t={}}){super(),this._logger=new aD("PopupWindow");const r=fD.center({...RD,...t});this._window=window.open(void 0,e,fD.serialize(r))}async navigate(e){var t;null==(t=this._window)||t.focus();const r=setInterval((()=>{this._window&&!this._window.closed||this._abort.raise(new Error("Popup closed by user"))}),500);return this._disposeHandlers.add((()=>clearInterval(r))),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)}},DD=class extends hD{constructor(e){super({expiringNotificationTimeInSeconds:e.accessTokenExpiringNotificationTimeInSeconds}),this._logger=new aD("UserManagerEvents"),this._userLoaded=new sD("User loaded"),this._userUnloaded=new sD("User unloaded"),this._silentRenewError=new sD("Silent renew error"),this._userSignedIn=new sD("User signed in"),this._userSignedOut=new sD("User signed out"),this._userSessionChanged=new sD("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()}},FD=(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))(FD||{}),LD=(e=>(e.SyncWeb3Method="SYNC_WEB3_METHOD",e.DuplicateIframe="DUPLICATE_IFRAME",e.ReactNativeEndpointConfiguration="REACT_NATIVE_ENDPOINT_CONFIGURATION",e.DeprecationNotice="DEPRECATION_NOTICE",e))(LD||{}),UD=(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))(UD||{}),jD=(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))(jD||{}),qD=(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))(qD||{}),zD=(e=>(e.MAGIC_HANDLE_REQUEST="MAGIC_HANDLE_REQUEST",e))(zD||{}),HD=(e=>(e.Harmony="HARMONY",e))(HD||{}),VD=Object.create,GD=Object.defineProperty,WD=Object.defineProperties,KD=Object.getOwnPropertyDescriptor,XD=Object.getOwnPropertyDescriptors,$D=Object.getOwnPropertyNames,JD=Object.getOwnPropertySymbols,YD=Object.getPrototypeOf,QD=Object.prototype.hasOwnProperty,ZD=Object.prototype.propertyIsEnumerable,eF=(e,t,r)=>t in e?GD(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,tF=(e,t)=>{for(var r in t||(t={}))QD.call(t,r)&&eF(e,r,t[r]);if(JD)for(var r of JD(t))ZD.call(t,r)&&eF(e,r,t[r]);return e},rF=(e,t,r)=>new Promise(((n,i)=>{var a=e=>{try{s(r.next(e))}catch(e){i(e)}},o=e=>{try{s(r.throw(e))}catch(e){i(e)}},s=e=>e.done?n(e.value):Promise.resolve(e.value).then(a,o);s((r=r.apply(e,t)).next())})),nF=((e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports))(((e,t)=>{var r=Object.prototype.hasOwnProperty,n="~";function i(){}function a(e,t,r){this.fn=e,this.context=t,this.once=r||!1}function o(e,t,r,i,o){if("function"!=typeof r)throw new TypeError("The listener must be a function");var s=new a(r,i||e,o),u=n?n+t:t;return e._events[u]?e._events[u].fn?e._events[u]=[e._events[u],s]:e._events[u].push(s):(e._events[u]=s,e._eventsCount++),e}function s(e,t){0==--e._eventsCount?e._events=new i:delete e._events[t]}function u(){this._events=new i,this._eventsCount=0}Object.create&&(i.prototype=Object.create(null),(new i).__proto__||(n=!1)),u.prototype.eventNames=function(){var e,t,i=[];if(0===this._eventsCount)return i;for(t in e=this._events)r.call(e,t)&&i.push(n?t.slice(1):t);return Object.getOwnPropertySymbols?i.concat(Object.getOwnPropertySymbols(e)):i},u.prototype.listeners=function(e){var t=n?n+e:e,r=this._events[t];if(!r)return[];if(r.fn)return[r.fn];for(var i=0,a=r.length,o=new Array(a);i<a;i++)o[i]=r[i].fn;return o},u.prototype.listenerCount=function(e){var t=n?n+e:e,r=this._events[t];return r?r.fn?1:r.length:0},u.prototype.emit=function(e,t,r,i,a,o){var s=n?n+e:e;if(!this._events[s])return!1;var u,f,c=this._events[s],l=arguments.length;if(c.fn){switch(c.once&&this.removeListener(e,c.fn,void 0,!0),l){case 1:return c.fn.call(c.context),!0;case 2:return c.fn.call(c.context,t),!0;case 3:return c.fn.call(c.context,t,r),!0;case 4:return c.fn.call(c.context,t,r,i),!0;case 5:return c.fn.call(c.context,t,r,i,a),!0;case 6:return c.fn.call(c.context,t,r,i,a,o),!0}for(f=1,u=new Array(l-1);f<l;f++)u[f-1]=arguments[f];c.fn.apply(c.context,u)}else{var d,p=c.length;for(f=0;f<p;f++)switch(c[f].once&&this.removeListener(e,c[f].fn,void 0,!0),l){case 1:c[f].fn.call(c[f].context);break;case 2:c[f].fn.call(c[f].context,t);break;case 3:c[f].fn.call(c[f].context,t,r);break;case 4:c[f].fn.call(c[f].context,t,r,i);break;default:if(!u)for(d=1,u=new Array(l-1);d<l;d++)u[d-1]=arguments[d];c[f].fn.apply(c[f].context,u)}}return!0},u.prototype.on=function(e,t,r){return o(this,e,t,r,!1)},u.prototype.once=function(e,t,r){return o(this,e,t,r,!0)},u.prototype.removeListener=function(e,t,r,i){var a=n?n+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)&&(!r||o.context===r)&&s(this,a);else{for(var u=0,f=[],c=o.length;u<c;u++)(o[u].fn!==t||i&&!o[u].once||r&&o[u].context!==r)&&f.push(o[u]);f.length?this._events[a]=1===f.length?f[0]:f:s(this,a)}return this},u.prototype.removeAllListeners=function(e){var t;return e?(t=n?n+e:e,this._events[t]&&s(this,t)):(this._events=new i,this._eventsCount=0),this},u.prototype.off=u.prototype.removeListener,u.prototype.addListener=u.prototype.on,u.prefixed=n,u.EventEmitter=u,typeof t<"u"&&(t.exports=u)}));var iF={SEMVER_SPEC_VERSION:"2.0.0",MAX_LENGTH:256,MAX_SAFE_INTEGER:Number.MAX_SAFE_INTEGER||9007199254740991,MAX_SAFE_COMPONENT_LENGTH:16},aF="object"==typeof process&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...e)=>console.error("SEMVER",...e):()=>{},oF=aF,sF=function(e){let t={exports:{}};return e(t,t.exports),t.exports}((function(e,t){let{MAX_SAFE_COMPONENT_LENGTH:r}=iF,n=(t=e.exports={}).re=[],i=t.src=[],a=t.t={},o=0,s=(e,t,r)=>{let s=o++;oF(s,t),a[e]=s,i[s]=t,n[s]=new RegExp(t,r?"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,${r}})(?:\\.(\\d{1,${r}}))?(?:\\.(\\d{1,${r}}))?(?:$|[^\\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*$")})),uF=/^[0-9]+$/,fF=(e,t)=>{let r=uF.test(e),n=uF.test(t);return r&&n&&(e=+e,t=+t),e===t?0:r&&!n?-1:n&&!r?1:e<t?-1:1},cF={compareIdentifiers:fF,rcompareIdentifiers:(e,t)=>fF(t,e)},{MAX_LENGTH:lF,MAX_SAFE_INTEGER:dF}=iF,{re:pF,t:hF}=sF,{compareIdentifiers:mF}=cF,yF=class{constructor(e,t){if(t&&"object"==typeof t||(t={loose:!!t,includePrerelease:!1}),e instanceof yF){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>lF)throw new TypeError(`version is longer than ${lF} characters`);oF("SemVer",e,t),this.options=t,this.loose=!!t.loose,this.includePrerelease=!!t.includePrerelease;let r=e.trim().match(t.loose?pF[hF.LOOSE]:pF[hF.FULL]);if(!r)throw new TypeError(`Invalid Version: ${e}`);if(this.raw=e,this.major=+r[1],this.minor=+r[2],this.patch=+r[3],this.major>dF||this.major<0)throw new TypeError("Invalid major version");if(this.minor>dF||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>dF||this.patch<0)throw new TypeError("Invalid patch version");r[4]?this.prerelease=r[4].split(".").map((e=>{if(/^[0-9]+$/.test(e)){let t=+e;if(t>=0&&t<dF)return t}return e})):this.prerelease=[],this.build=r[5]?r[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(e){if(oF("SemVer.compare",this.version,this.options,e),!(e instanceof yF)){if("string"==typeof e&&e===this.version)return 0;e=new yF(e,this.options)}return e.version===this.version?0:this.compareMain(e)||this.comparePre(e)}compareMain(e){return e instanceof yF||(e=new yF(e,this.options)),mF(this.major,e.major)||mF(this.minor,e.minor)||mF(this.patch,e.patch)}comparePre(e){if(e instanceof yF||(e=new yF(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 r=this.prerelease[t],n=e.prerelease[t];if(oF("prerelease compare",t,r,n),void 0===r&&void 0===n)return 0;if(void 0===n)return 1;if(void 0===r)return-1;if(r!==n)return mF(r,n)}while(++t)}compareBuild(e){e instanceof yF||(e=new yF(e,this.options));let t=0;do{let r=this.build[t],n=e.build[t];if(oF("prerelease compare",t,r,n),void 0===r&&void 0===n)return 0;if(void 0===n)return 1;if(void 0===r)return-1;if(r!==n)return mF(r,n)}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}},bF=(e,t,r)=>new yF(e,r).compare(new yF(t,r)),gF=(e,t,r)=>0===bF(e,t,r),vF=(e,t,r)=>0!==bF(e,t,r),wF=(e,t,r)=>bF(e,t,r)>0,_F=(e,t,r)=>bF(e,t,r)>=0,EF=(e,t,r)=>bF(e,t,r)<0,TF=(e,t,r)=>bF(e,t,r)<=0,AF=(e,t,r,n)=>{switch(t){case"===":return"object"==typeof e&&(e=e.version),"object"==typeof r&&(r=r.version),e===r;case"!==":return"object"==typeof e&&(e=e.version),"object"==typeof r&&(r=r.version),e!==r;case"":case"=":case"==":return gF(e,r,n);case"!=":return vF(e,r,n);case">":return wF(e,r,n);case">=":return _F(e,r,n);case"<":return EF(e,r,n);case"<=":return TF(e,r,n);default:throw new TypeError(`Invalid operator: ${t}`)}},SF=Symbol("SemVer ANY"),kF=class{static get ANY(){return SF}constructor(e,t){if(t&&"object"==typeof t||(t={loose:!!t,includePrerelease:!1}),e instanceof kF){if(e.loose===!!t.loose)return e;e=e.value}oF("comparator",e,t),this.options=t,this.loose=!!t.loose,this.parse(e),this.semver===SF?this.value="":this.value=this.operator+this.semver.version,oF("comp",this)}parse(e){let t=this.options.loose?OF[RF.COMPARATORLOOSE]:OF[RF.COMPARATOR],r=e.match(t);if(!r)throw new TypeError(`Invalid comparator: ${e}`);this.operator=void 0!==r[1]?r[1]:"","="===this.operator&&(this.operator=""),r[2]?this.semver=new yF(r[2],this.options.loose):this.semver=SF}toString(){return this.value}test(e){if(oF("Comparator.test",e,this.options.loose),this.semver===SF||e===SF)return!0;if("string"==typeof e)try{e=new yF(e,this.options)}catch(e){return!1}return AF(e,this.operator,this.semver,this.options)}intersects(e,t){if(!(e instanceof kF))throw new TypeError("a Comparator is required");if(t&&"object"==typeof t||(t={loose:!!t,includePrerelease:!1}),""===this.operator)return""===this.value||new xF(e.value,t).test(this.value);if(""===e.operator)return""===e.value||new xF(this.value,t).test(e.semver);let r=!(">="!==this.operator&&">"!==this.operator||">="!==e.operator&&">"!==e.operator),n=!("<="!==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=AF(this.semver,"<",e.semver,t)&&(">="===this.operator||">"===this.operator)&&("<="===e.operator||"<"===e.operator),s=AF(this.semver,">",e.semver,t)&&("<="===this.operator||"<"===this.operator)&&(">="===e.operator||">"===e.operator);return r||n||i&&a||o||s}},{re:OF,t:RF}=sF,xF=class{constructor(e,t){if(t&&"object"==typeof t||(t={loose:!!t,includePrerelease:!1}),e instanceof xF)return e.loose===!!t.loose&&e.includePrerelease===!!t.includePrerelease?e:new xF(e.raw,t);if(e instanceof kF)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 r=t?IF[CF.HYPHENRANGELOOSE]:IF[CF.HYPHENRANGE];e=e.replace(r,WF(this.options.includePrerelease)),oF("hyphen replace",e),e=e.replace(IF[CF.COMPARATORTRIM],NF),oF("comparator trim",e,IF[CF.COMPARATORTRIM]),e=(e=(e=e.replace(IF[CF.TILDETRIM],PF)).replace(IF[CF.CARETTRIM],MF)).split(/\s+/).join(" ");let n=t?IF[CF.COMPARATORLOOSE]:IF[CF.COMPARATOR];return e.split(" ").map((e=>DF(e,this.options))).join(" ").split(/\s+/).map((e=>GF(e,this.options))).filter(this.options.loose?e=>!!e.match(n):()=>!0).map((e=>new kF(e,this.options)))}intersects(e,t){if(!(e instanceof xF))throw new TypeError("a Range is required");return this.set.some((r=>BF(r,t)&&e.set.some((e=>BF(e,t)&&r.every((r=>e.every((e=>r.intersects(e,t)))))))))}test(e){if(!e)return!1;if("string"==typeof e)try{e=new yF(e,this.options)}catch(e){return!1}for(let t=0;t<this.set.length;t++)if(KF(this.set[t],e,this.options))return!0;return!1}},{re:IF,t:CF,comparatorTrimReplace:NF,tildeTrimReplace:PF,caretTrimReplace:MF}=sF,BF=(e,t)=>{let r=!0,n=e.slice(),i=n.pop();for(;r&&n.length;)r=n.every((e=>i.intersects(e,t))),i=n.pop();return r},DF=(e,t)=>(oF("comp",e,t),e=jF(e,t),oF("caret",e),e=LF(e,t),oF("tildes",e),e=zF(e,t),oF("xrange",e),e=VF(e,t),oF("stars",e),e),FF=e=>!e||"x"===e.toLowerCase()||"*"===e,LF=(e,t)=>e.trim().split(/\s+/).map((e=>UF(e,t))).join(" "),UF=(e,t)=>{let r=t.loose?IF[CF.TILDELOOSE]:IF[CF.TILDE];return e.replace(r,((t,r,n,i,a)=>{let o;return oF("tilde",e,t,r,n,i,a),FF(r)?o="":FF(n)?o=`>=${r}.0.0 <${+r+1}.0.0-0`:FF(i)?o=`>=${r}.${n}.0 <${r}.${+n+1}.0-0`:a?(oF("replaceTilde pr",a),o=`>=${r}.${n}.${i}-${a} <${r}.${+n+1}.0-0`):o=`>=${r}.${n}.${i} <${r}.${+n+1}.0-0`,oF("tilde return",o),o}))},jF=(e,t)=>e.trim().split(/\s+/).map((e=>qF(e,t))).join(" "),qF=(e,t)=>{oF("caret",e,t);let r=t.loose?IF[CF.CARETLOOSE]:IF[CF.CARET],n=t.includePrerelease?"-0":"";return e.replace(r,((t,r,i,a,o)=>{let s;return oF("caret",e,t,r,i,a,o),FF(r)?s="":FF(i)?s=`>=${r}.0.0${n} <${+r+1}.0.0-0`:FF(a)?s="0"===r?`>=${r}.${i}.0${n} <${r}.${+i+1}.0-0`:`>=${r}.${i}.0${n} <${+r+1}.0.0-0`:o?(oF("replaceCaret pr",o),s="0"===r?"0"===i?`>=${r}.${i}.${a}-${o} <${r}.${i}.${+a+1}-0`:`>=${r}.${i}.${a}-${o} <${r}.${+i+1}.0-0`:`>=${r}.${i}.${a}-${o} <${+r+1}.0.0-0`):(oF("no pr"),s="0"===r?"0"===i?`>=${r}.${i}.${a}${n} <${r}.${i}.${+a+1}-0`:`>=${r}.${i}.${a}${n} <${r}.${+i+1}.0-0`:`>=${r}.${i}.${a} <${+r+1}.0.0-0`),oF("caret return",s),s}))},zF=(e,t)=>(oF("replaceXRanges",e,t),e.split(/\s+/).map((e=>HF(e,t))).join(" ")),HF=(e,t)=>{e=e.trim();let r=t.loose?IF[CF.XRANGELOOSE]:IF[CF.XRANGE];return e.replace(r,((r,n,i,a,o,s)=>{oF("xRange",e,r,n,i,a,o,s);let u=FF(i),f=u||FF(a),c=f||FF(o),l=c;return"="===n&&l&&(n=""),s=t.includePrerelease?"-0":"",u?r=">"===n||"<"===n?"<0.0.0-0":"*":n&&l?(f&&(a=0),o=0,">"===n?(n=">=",f?(i=+i+1,a=0,o=0):(a=+a+1,o=0)):"<="===n&&(n="<",f?i=+i+1:a=+a+1),"<"===n&&(s="-0"),r=`${n+i}.${a}.${o}${s}`):f?r=`>=${i}.0.0${s} <${+i+1}.0.0-0`:c&&(r=`>=${i}.${a}.0${s} <${i}.${+a+1}.0-0`),oF("xRange return",r),r}))},VF=(e,t)=>(oF("replaceStars",e,t),e.trim().replace(IF[CF.STAR],"")),GF=(e,t)=>(oF("replaceGTE0",e,t),e.trim().replace(IF[t.includePrerelease?CF.GTE0PRE:CF.GTE0],"")),WF=e=>(t,r,n,i,a,o,s,u,f,c,l,d,p)=>`${r=FF(n)?"":FF(i)?`>=${n}.0.0${e?"-0":""}`:FF(a)?`>=${n}.${i}.0${e?"-0":""}`:o?`>=${r}`:`>=${r}${e?"-0":""}`} ${u=FF(f)?"":FF(c)?`<${+f+1}.0.0-0`:FF(l)?`<${f}.${+c+1}.0-0`:d?`<=${f}.${c}.${l}-${d}`:e?`<${f}.${c}.${+l+1}-0`:`<=${u}`}`.trim(),KF=(e,t,r)=>{for(let r=0;r<e.length;r++)if(!e[r].test(t))return!1;if(t.prerelease.length&&!r.includePrerelease){for(let r=0;r<e.length;r++)if(oF(e[r].semver),e[r].semver!==kF.ANY&&e[r].semver.prerelease.length>0){let n=e[r].semver;if(n.major===t.major&&n.minor===t.minor&&n.patch===t.patch)return!0}return!1}return!0},XF=(e,t,r)=>{try{t=new xF(t,r)}catch(e){return!1}return t.test(e)},{MAX_LENGTH:$F}=iF,{re:JF,t:YF}=sF,QF=(e,t)=>{if(t&&"object"==typeof t||(t={loose:!!t,includePrerelease:!1}),e instanceof yF)return e;if("string"!=typeof e||e.length>$F||!(t.loose?JF[YF.LOOSE]:JF[YF.FULL]).test(e))return null;try{return new yF(e,t)}catch(e){return null}},{re:ZF,t:eL}=sF,tL=(e,t)=>{if(e instanceof yF)return e;if("number"==typeof e&&(e=String(e)),"string"!=typeof e)return null;let r=null;if((t=t||{}).rtl){let t;for(;(t=ZF[eL.COERCERTL].exec(e))&&(!r||r.index+r[0].length!==e.length);)r&&t.index+t[0].length===r.index+r[0].length||(r=t),ZF[eL.COERCERTL].lastIndex=t.index+t[1].length+t[2].length;ZF[eL.COERCERTL].lastIndex=-1}else r=e.match(ZF[eL.COERCE]);return null===r?null:QF(`${r[2]}.${r[3]||"0"}.${r[4]||"0"}`,t)};function rL(e){return String.fromCharCode(parseInt(e.slice(1),16))}function nL(e){return`%${`00${e.charCodeAt(0).toString(16)}`.slice(-2)}`}function iL(e){return function(e){return btoa(encodeURIComponent(e).replace(/%[0-9A-F]{2}/g,rL))}(JSON.stringify(e))}function aL(e){return JSON.parse(function(e){return decodeURIComponent(Array.from(atob(e),nL).join(""))}(e))}function oL(e){return void 0===e}function sL(e){return function(e){return null===e}(e)||oL(e)}function uL(e){if(!e)return!0;for(let t in e)if(Object.hasOwnProperty.call(e,t))return!1;return!0}var fL={};var cL={"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"},lL=class extends Error{constructor(e,t){super(`Magic SDK Error: [${e}] ${t}`),this.code=e,this.rawMessage=t,this.__proto__=Error,Object.setPrototypeOf(this,lL.prototype)}},dL=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!sL(e)&&"number"==typeof e&&Object.values(UD).includes(e)}(t)?t:UD.InternalError,this.message=`Magic RPC Error: [${this.code}] ${this.rawMessage}`,this.data=(null==e?void 0:e.data)||void 0,Object.setPrototypeOf(this,dL.prototype)}},pL=class{constructor(e,t){this.code=e,this.rawMessage=t,this.message=`Magic SDK Warning: [${e}] ${t}`}log(){console.warn(this.message)}},hL=class extends Error{constructor(e,t,r,n){super(`Magic Extension Error (${e.name}): [${t}] ${r}`),this.code=t,this.rawMessage=r,this.data=n,this.__proto__=Error,Object.setPrototypeOf(this,hL.prototype)}},mL=class{constructor(e,t,r){this.code=t,this.rawMessage=r,this.message=`Magic Extension Warning (${e.name}): [${t}] ${r}`}log(){console.warn(this.message)}};function yL(){return new lL(FD.MissingApiKey,"Please provide an API key that you acquired from the Magic developer dashboard.")}function bL(){return new lL(FD.MalformedResponse,"Response from the Magic iframe is malformed.")}function gL(e){return new lL(FD.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 vL(e){let t=`Some extensions are incompatible with \`${fL.sdkName}@${fL.version}\`:`;return e.filter((e=>void 0!==e.compat&&null!==e.compat)).forEach((e=>{let r=e.compat[fL.sdkName];"string"==typeof r?t+=`\n - Extension \`${e.name}\` supports version(s) \`${r}\``:r||(t+=`\n - Extension \`${e.name}\` does not support ${fL.platform} environments.`)})),new lL(FD.IncompatibleExtensions,t)}function wL(e){return new lL(FD.InvalidArgument,`Invalid ${(e=>{let t=e+1,r=t%10,n=t%100;return 1===r&&11!==n?`${t}st`:2===r&&12!==n?`${t}nd`:3===r&&13!==n?`${t}rd`:`${t}th`})(e.argument)} argument given to \`${e.procedure}\`.\n Expected: \`${e.expected}\`\n Received: \`${e.received}\``)}function _L(){return new pL(LD.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 \`${fL.defaultEndpoint}\`. Changing this default behavior will lead to unexpected results and potentially security-threatening bugs.`)}var EL=function*(){let e=0;for(;;)e<Number.MAX_SAFE_INTEGER?yield++e:e=0}();function TL(){return EL.next().value}var AL=Symbol("Payload pre-processed by Magic SDK");function SL(e){return Object.defineProperty(e,AL,{value:!0,enumerable:!1}),e}function kL(e){var t,r,n;return function(e){return!!e[AL]}(e)||(e.jsonrpc=null!=(t=e.jsonrpc)?t:"2.0",e.id=TL(),e.method=null!=(r=e.method)?r:"noop",e.params=null!=(n=e.params)?n:[],SL(e)),e}function OL(e,t=[]){return SL({params:t,method:e,jsonrpc:"2.0",id:TL()})}var RL=class{constructor(e){e instanceof RL?(this._jsonrpc=e.payload.jsonrpc,this._id=e.payload.id,this._result=e.payload.result,this._error=e.payload.error):function(e){return!sL(e)&&!(oL(e.jsonrpc)||oL(e.id)||oL(e.result)&&oL(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}}},xL=((e,t,r)=>(r=null!=e?VD(YD(e)):{},((e,t,r,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let i of $D(t))!QD.call(e,i)&&i!==r&&GD(e,i,{get:()=>t[i],enumerable:!(n=KD(t,i))||n.enumerable});return e})(!t&&e&&e.__esModule?r:GD(r,"default",{value:e,enumerable:!0}),e)))(nF()),IL=class extends xL.default{};function CL(){let e=new IL;return{emitter:e,createChainingEmitterMethod:(t,r)=>(...n)=>(e[t].apply(e,n),r),createBoundEmitterMethod:t=>(...r)=>e[t].apply(e,r)}}var NL=Symbol("isPromiEvent");function PL(e){return!!e[NL]}function ML(e){let t=BL(e),{createBoundEmitterMethod:r,createChainingEmitterMethod:n}=CL(),i=Symbol("Promise.then"),a=Symbol("Promise.catch"),o=Symbol("Promise.finally"),s=(e,t)=>(...r)=>{let n=t[e].apply(t,r);return u(n)},u=e=>Object.assign(e,{[NL]:!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:n("on",e),once:n("once",e),addListener:n("addListener",e),off:n("off",e),removeListener:n("removeListener",e),removeAllListeners:n("removeAllListeners",e),emit:r("emit"),eventNames:r("eventNames"),listeners:r("listeners"),listenerCount:r("listenerCount")}),f=u(t.then((e=>(f.emit("done",e),f.emit("settled"),e)),(e=>{throw f.emit("error",e),f.emit("settled"),e})));return f}function BL(e){return new Promise(((t,r)=>{let n=e(t,r);Promise.resolve(n).catch(r)}))}var DL,FL=class{constructor(e){this.sdk=e}get overlay(){return this.sdk.overlay}request(e){let t=this.overlay.post(zD.MAGIC_HANDLE_REQUEST,kL(e)),r=ML(((e,r)=>{t.then((t=>{if(n(),t.hasError)r(new dL(t.payload.error));else{if(!t.hasResult)throw bL();e(t.payload.result)}})).catch((e=>{n(),r(e)}))})),n=this.overlay.on(qD.MAGIC_HANDLE_EVENT,(t=>{var n;let{response:i}=t.data;if(i.id===e.id&&(null==(n=i.result)?void 0:n.event)){let{event:e,params:t=[]}=i.result;r.emit(e,...t)}}));return r}createIntermediaryEvent(e,t){return r=>{let n=OL(jD.IntermediaryEvent,[{payloadId:t,eventType:e,args:r}]);this.request(n)}}},LL=class extends FL{loginWithMagicLink(e){let{email:t,showUI:r=!0,redirectURI:n}=e,i=OL(this.sdk.testMode?jD.LoginWithMagicLinkTestMode:jD.LoginWithMagicLink,[{email:t,showUI:r,redirectURI:n}]);return this.request(i)}loginWithSMS(e){let{phoneNumber:t}=e,r=OL(this.sdk.testMode?jD.LoginWithSmsTestMode:jD.LoginWithSms,[{phoneNumber:t,showUI:!0}]);return this.request(r)}loginWithEmailOTP(e){let{email:t,showUI:r}=e,n=OL(this.sdk.testMode?jD.LoginWithEmailOTPTestMode:jD.LoginWithEmailOTP,[{email:t,showUI:r}]);if(!r){let e=this.request(n);return e&&e.on("otp-input-sent",(e=>{this.createIntermediaryEvent("verify-email-otp",n.id)(e)})),e}return this.request(n)}loginWithCredential(e){let t=null!=e?e:"";if(!e&&"web"===fL.platform){t=window.location.search;let e=window.location.origin+window.location.pathname;window.history.replaceState(null,"",e)}let r=OL(this.sdk.testMode?jD.LoginWithCredentialTestMode:jD.LoginWithCredential,[t]);return this.request(r)}},UL={};function jL(e){return(...t)=>rF(this,null,(function*(){return DL||(DL=yield fL.configureStorage()),yield DL.ready(),DL[e](...t)}))}((e,t)=>{for(var r in t)GD(e,r,{get:t[r],enumerable:!0})})(UL,{clear:()=>VL,getItem:()=>qL,iterate:()=>XL,key:()=>WL,keys:()=>KL,length:()=>GL,removeItem:()=>HL,setItem:()=>zL});var qL=jL("getItem"),zL=jL("setItem"),HL=jL("removeItem"),VL=jL("clear"),GL=jL("length"),WL=jL("key"),KL=jL("keys"),XL=jL("iterate");function $L(){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 JL="STORE_KEY_PRIVATE_KEY",YL="STORE_KEY_PUBLIC_JWK",QL="ECDSA",ZL="P-256",eU={name:QL,namedCurve:ZL},tU={name:QL,namedCurve:ZL};function rU(){HL(YL),HL(JL)}function nU(){return rF(this,null,(function*(){let e=yield function(){return rF(this,null,(function*(){if(function(){let e="undefined"!=typeof window&&!!window.crypto,t=e&&!!window.crypto.subtle;return e&&t}())return(yield qL(YL))||(yield function(){return rF(this,null,(function*(){let e=null,{subtle:t}=window.crypto,r=yield t.generateKey(eU,!0,["sign"]),n=yield t.exportKey("jwk",r.privateKey);e=yield t.exportKey("jwk",r.publicKey);let i=yield t.importKey("jwk",n,tU,!1,["sign"]);yield zL(JL,i),yield zL(YL,e)}))}()),qL(YL);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,r=yield qL(JL);if(!r||!t)return void console.info("unable to find private key or webcrypto unsupported");let n={iat:Math.floor((new Date).getTime()/1e3),jti:$L()},i={typ:"dpop+jwt",alg:"ES256",jwk:e},a=iU(JSON.stringify(i)),o=iU(JSON.stringify(n)),s=function(e){return(new TextEncoder).encode(e)}(`${a}.${o}`),u={name:QL,hash:{name:"SHA-256"}},f=function(e){let t="";return e.forEach((e=>{t+=String.fromCharCode(e)})),aU(t)}(new Uint8Array(yield t.sign(u,r,s)));return`${a}.${o}.${f}`}))}function iU(e){return aU(function(e){return encodeURIComponent(e).replace(/%([0-9A-F]{2})/g,((e,t)=>String.fromCharCode(parseInt(t,16))))}(e))}function aU(e){return btoa(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+/g,"")}var oU=class extends FL{getIdToken(e){let t=OL(this.sdk.testMode?jD.GetIdTokenTestMode:jD.GetIdToken,[e]);return this.request(t)}generateIdToken(e){let t=OL(this.sdk.testMode?jD.GenerateIdTokenTestMode:jD.GenerateIdToken,[e]);return this.request(t)}getMetadata(){let e=OL(this.sdk.testMode?jD.GetMetadataTestMode:jD.GetMetadata);return this.request(e)}updateEmail(e){let{email:t,showUI:r=!0}=e,n=OL(this.sdk.testMode?jD.UpdateEmailTestMode:jD.UpdateEmail,[{email:t,showUI:r}]);return this.request(n)}isLoggedIn(){let e=OL(this.sdk.testMode?jD.IsLoggedInTestMode:jD.IsLoggedIn);return this.request(e)}logout(){rU();let e=OL(this.sdk.testMode?jD.LogoutTestMode:jD.Logout);return this.request(e)}showSettings(){let e=OL(this.sdk.testMode?jD.UserSettingsTestMode:jD.UserSettings);return this.request(e)}updatePhoneNumber(){let e=OL(this.sdk.testMode?jD.UpdatePhoneNumberTestMode:jD.UpdatePhoneNumber);return this.request(e)}recoverAccount(e){let t=OL(this.sdk.testMode?jD.RecoverAccountTestMode:jD.RecoverAccount,[e]);return this.request(t)}},sU=class extends FL{connectWithUI(){let e=OL(jD.RequestAccounts);return this.request(e)}showUI(){let e=OL(jD.ShowUI);return this.request(e)}getInfo(){let e=OL(jD.GetInfo);return this.request(e)}requestUserInfoWithUI(e){let t=OL(jD.RequestUserInfoWithUI,e?[e]:[]);return this.request(t)}disconnect(){rU();let e=OL(jD.Disconnect);return this.request(e)}},{createBoundEmitterMethod:uU,createChainingEmitterMethod:fU}=CL(),cU=class extends FL{constructor(){super(...arguments),this.isMagic=!0,this.on=fU("on",this),this.once=fU("once",this),this.addListener=fU("addListener",this),this.off=fU("off",this),this.removeListener=fU("removeListener",this),this.removeAllListeners=fU("removeAllListeners",this),this.emit=uU("emit"),this.eventNames=uU("eventNames"),this.listeners=uU("listeners"),this.listenerCount=uU("listenerCount")}sendAsync(e,t){if(!t)throw wL({procedure:"Magic.rpcProvider.sendAsync",argument:1,expected:"function",received:null===t?"null":typeof t});if(Array.isArray(e))this.overlay.post(zD.MAGIC_HANDLE_REQUEST,e.map((e=>{let t=kL(e);return this.prefixPayloadMethodForTestMode(t),t}))).then((e=>{t(null,e.map((e=>((e,t)=>WD(e,XD(t)))(tF({},e.payload),{error:e.hasError?new dL(e.payload.error):null}))))}));else{let r=kL(e);this.prefixPayloadMethodForTestMode(r),this.overlay.post(zD.MAGIC_HANDLE_REQUEST,r).then((e=>{t(e.hasError?new dL(e.payload.error):null,e.payload)}))}}send(e,t){if("string"==typeof e){let r=OL(e,Array.isArray(t)?t:[]);return this.request(r)}if(Array.isArray(e)||t)return void this.sendAsync(e,t);let r=new pL(LD.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 r.log(),new RL(e).applyError({code:-32603,message:r.rawMessage}).payload}enable(){let e=OL("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 lU(e,t){return t?new URL(e,t):new URL(e)}var dU=["request","overlay","sdk"];function pU(e){let t=Object.getPrototypeOf(e),r=[t];for(;t!==FL.prototype;)t=Object.getPrototypeOf(t),r.push(t);return r}var hU=class extends FL{constructor(){super(void 0),this.__sdk_access_field_descriptors__=new Map,this.__is_initialized__=!1,this.utils={createPromiEvent:ML,isPromiEvent:PL,encodeJSON:iL,decodeJSON:aL,createJsonRpcRequestPayload:OL,standardizeJsonRpcRequestPayload:kL,storage:UL};let e=[this,...pU(this)];dU.forEach((t=>{let r=e.map((e=>Object.getOwnPropertyDescriptor(e,t))),n=r.findIndex((e=>!!e)),i=n>0,a=r[n];a&&(this.__sdk_access_field_descriptors__.set(t,{descriptor:a,isPrototypeField:i}),Object.defineProperty(this,t,{configurable:!0,get:()=>{throw gL(t)}}))}))}init(e){this.__is_initialized__||(dU.forEach((e=>{if(this.__sdk_access_field_descriptors__.has(e)){let{descriptor:t,isPrototypeField:r}=this.__sdk_access_field_descriptors__.get(e);r?delete this[e]:Object.defineProperty(this,e,t)}})),this.sdk=e,this.__is_initialized__=!0)}createDeprecationWarning(e){let{method:t,removalVersion:r,useInstead:n}=e;return new mL(this,"DEPRECATION_NOTICE",`\`${t}\` will be removed from this Extension in version \`${r}\`.${n?` Use \`${n}\` instead.`:""}`)}createWarning(e,t){return new mL(this,e,t)}createError(e,t,r){return new hL(this,e,t,r)}},mU=class extends hU{};mU.Internal=class extends hU{},mU.Anonymous="anonymous extension";var yU=class extends FL{purchase(e){let t=OL(jD.NFTPurchase,[e]);return this.request(t)}};function bU(e){return!e.compat||null==e.compat[fL.sdkName]||("string"==typeof e.compat[fL.sdkName]?XF(tL(fL.version),e.compat[fL.sdkName]):!!e.compat[fL.sdkName])}function gU(e){var t;let r=null!=(t=null==e?void 0:e.extensions)?t:[],n={},i=[];if(Array.isArray(r)?r.forEach((e=>{bU(e)?(e.init(this),(e.name||e.name!==mU.Anonymous)&&(this[e.name]=e),e instanceof mU.Internal&&(uL(e.config)||(n[e.name]=e.config))):i.push(e)})):Object.keys(r).forEach((e=>{if(bU(r[e])){r[e].init(this);let t=r[e];this[e]=t,t instanceof mU.Internal&&(uL(t.config)||(n[r[e].name]=t.config))}else i.push(r[e])})),i.length)throw vL(i);return n}var vU=class{constructor(e,t){var r;if(this.apiKey=e,!e)throw yL();"react-native"===fL.platform&&(null==t?void 0:t.endpoint)&&_L().log();let{defaultEndpoint:n,version:i}=fL;this.testMode=!(null==t||!t.testMode),this.endpoint=lU(null!=(r=null==t?void 0:t.endpoint)?r:n).origin,this.auth=new LL(this),this.user=new oU(this),this.wallet=new sU(this),this.nft=new yU(this),this.rpcProvider=new cU(this);let a=gU.call(this,t);this.parameters=iL(tF({API_KEY:this.apiKey,DOMAIN_ORIGIN:window.location?window.location.origin:"",ETH_NETWORK:null==t?void 0:t.network,host:lU(this.endpoint).host,sdk:cL[fL.sdkName],version:i,ext:uL(a)?void 0:a,locale:(null==t?void 0:t.locale)||"en_US"},fL.bundleId?{bundleId:fL.bundleId}:{}))}get overlay(){if(!vU.__overlays__.has(this.parameters)){let e=new fL.ViewController(this.endpoint,this.parameters);e.init(),vU.__overlays__.set(this.parameters,e)}return vU.__overlays__.get(this.parameters)}preload(){return rF(this,null,(function*(){yield this.overlay.ready}))}},wU=vU;function _U(e,t){var r;let n=null==(r=t.data.response)?void 0:r.id,i=function(e,t){return t&&Array.isArray(e)?e.find((e=>e.id===t)):e}(e,n);if(n&&i){return{id:n,response:new RL(i).applyResult(t.data.response.result).applyError(t.data.response.error)}}return{}}wU.__overlays__=new Map;var EU=class{constructor(e,t){this.endpoint=e,this.parameters=t,this.messageHandlers=new Set,this.ready=this.waitForReady(),this.listen()}post(e,t){return rF(this,null,(function*(){return BL((r=>rF(this,null,(function*(){yield this.ready;let n=[],i=Array.isArray(t)?t.map((e=>e.id)):[],a=yield function(e,t){return rF(this,null,(function*(){let r,n=yield qL("rt");if("web"===fL.platform)try{r=yield nU()}catch(e){console.error("webcrypto error",e)}return r?n?{msgType:e,payload:t,jwt:r,rt:n}:{msgType:e,payload:t,jwt:r}:{msgType:e,payload:t}}))}(`${e}-${this.parameters}`,t);yield this._post(a);let o=this.on(qD.MAGIC_HANDLE_RESPONSE,(e=>a=>{let{id:o,response:s}=_U(t,a);(function(e){rF(this,null,(function*(){!e.data.rt||(yield zL("rt",e.data.rt))}))})(a),o&&s&&Array.isArray(t)&&i.includes(o)?(n.push(s),n.length===t.length&&(e(),r(n))):o&&s&&!Array.isArray(t)&&o===t.id&&(e(),r(s))})((()=>o())))}))))}))}on(e,t){let r=t.bind(window),n=t=>{t.data.msgType===`${e}-${this.parameters}`&&r(t)};return this.messageHandlers.add(n),()=>this.messageHandlers.delete(n)}waitForReady(){return new Promise((e=>{this.on(qD.MAGIC_OVERLAY_READY,(()=>e()))}))}listen(){this.on(qD.MAGIC_HIDE_OVERLAY,(()=>{this.hideOverlay()})),this.on(qD.MAGIC_SHOW_OVERLAY,(()=>{this.showOverlay()}))}},TU=Object.create,AU=Object.defineProperty,SU=Object.getOwnPropertyDescriptor,kU=Object.getOwnPropertyNames,OU=Object.getPrototypeOf,RU=Object.prototype.hasOwnProperty,xU=(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')})),IU=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),CU=(e,t,r)=>(r=null!=e?TU(OU(e)):{},((e,t,r,n)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let i of kU(t))!RU.call(e,i)&&i!==r&&AU(e,i,{get:()=>t[i],enumerable:!(n=SU(t,i))||n.enumerable});return e})(!t&&e&&e.__esModule?r:AU(r,"default",{value:e,enumerable:!0}),e)),NU=(e,t,r)=>new Promise(((n,i)=>{var a=e=>{try{s(r.next(e))}catch(e){i(e)}},o=e=>{try{s(r.throw(e))}catch(e){i(e)}},s=e=>e.done?n(e.value):Promise.resolve(e.value).then(a,o);s((r=r.apply(e,t)).next())})),PU=IU(((e,t)=>{!function(r){if("object"==typeof e&&typeof t<"u")t.exports=r();else if("function"==typeof define&&define.amd)define([],r);else{(typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:this).localforage=r()}}((function(){return function e(t,r,n){function i(o,s){if(!r[o]){if(!t[o]){var u="function"==typeof xU&&xU;if(!s&&u)return u(o,!0);if(a)return a(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var c=r[o]={exports:{}};t[o][0].call(c.exports,(function(e){return i(t[o][1][e]||e)}),c,c.exports,e,t,r,n)}return r[o].exports}for(var a="function"==typeof xU&&xU,o=0;o<n.length;o++)i(n[o]);return i}({1:[function(e,t,r){(function(e){var r,n=e.MutationObserver||e.WebKitMutationObserver;if(n){var i=0,a=new n(c),o=e.document.createTextNode("");a.observe(o,{characterData:!0}),r=function(){o.data=i=++i%2}}else if(!e.setImmediate&&typeof e.MessageChannel<"u"){var s=new e.MessageChannel;s.port1.onmessage=c,r=function(){s.port2.postMessage(0)}}else r="document"in e&&"onreadystatechange"in e.document.createElement("script")?function(){var t=e.document.createElement("script");t.onreadystatechange=function(){c(),t.onreadystatechange=null,t.parentNode.removeChild(t),t=null},e.document.documentElement.appendChild(t)}:function(){setTimeout(c,0)};var u,f=[];function c(){u=!0;for(var e,t,r=f.length;r;){for(t=f,f=[],e=-1;++e<r;)t[e]();r=f.length}u=!1}t.exports=function(e){1===f.push(e)&&!u&&r()}}).call(this,typeof global<"u"?global:typeof self<"u"?self:typeof window<"u"?window:{})},{}],2:[function(e,t,r){var n=e(1);function i(){}var a={},o=["REJECTED"],s=["FULFILLED"],u=["PENDING"];function f(e){if("function"!=typeof e)throw new TypeError("resolver must be a function");this.state=u,this.queue=[],this.outcome=void 0,e!==i&&p(this,e)}function c(e,t,r){this.promise=e,"function"==typeof t&&(this.onFulfilled=t,this.callFulfilled=this.otherCallFulfilled),"function"==typeof r&&(this.onRejected=r,this.callRejected=this.otherCallRejected)}function l(e,t,r){n((function(){var n;try{n=t(r)}catch(t){return a.reject(e,t)}n===e?a.reject(e,new TypeError("Cannot resolve promise with itself")):a.resolve(e,n)}))}function d(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 r=!1;function n(t){r||(r=!0,a.reject(e,t))}function i(t){r||(r=!0,a.resolve(e,t))}var o=h((function(){t(i,n)}));"error"===o.status&&n(o.value)}function h(e,t){var r={};try{r.value=e(t),r.status="success"}catch(e){r.status="error",r.value=e}return r}t.exports=f,f.prototype.catch=function(e){return this.then(null,e)},f.prototype.then=function(e,t){if("function"!=typeof e&&this.state===s||"function"!=typeof t&&this.state===o)return this;var r=new this.constructor(i);this.state!==u?l(r,this.state===s?e:t,this.outcome):this.queue.push(new c(r,e,t));return r},c.prototype.callFulfilled=function(e){a.resolve(this.promise,e)},c.prototype.otherCallFulfilled=function(e){l(this.promise,this.onFulfilled,e)},c.prototype.callRejected=function(e){a.reject(this.promise,e)},c.prototype.otherCallRejected=function(e){l(this.promise,this.onRejected,e)},a.resolve=function(e,t){var r=h(d,t);if("error"===r.status)return a.reject(e,r.value);var n=r.value;if(n)p(e,n);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 r=-1,n=e.queue.length;++r<n;)e.queue[r].callRejected(t);return e},f.resolve=function(e){return e instanceof this?e:a.resolve(new this(i),e)},f.reject=function(e){var t=new this(i);return a.reject(t,e)},f.all=function(e){var t=this;if("[object Array]"!==Object.prototype.toString.call(e))return this.reject(new TypeError("must be an array"));var r=e.length,n=!1;if(!r)return this.resolve([]);for(var o=new Array(r),s=0,u=-1,f=new this(i);++u<r;)c(e[u],u);return f;function c(e,i){t.resolve(e).then((function(e){o[i]=e,++s===r&&!n&&(n=!0,a.resolve(f,o))}),(function(e){n||(n=!0,a.reject(f,e))}))}},f.race=function(e){var t=this;if("[object Array]"!==Object.prototype.toString.call(e))return this.reject(new TypeError("must be an array"));var r=e.length,n=!1;if(!r)return this.resolve([]);for(var o=-1,s=new this(i);++o<r;)u(e[o]);return s;function u(e){t.resolve(e).then((function(e){n||(n=!0,a.resolve(s,e))}),(function(e){n||(n=!0,a.reject(s,e))}))}}},{1:1}],3:[function(e,t,r){(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,r){var n="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 r=new(typeof BlobBuilder<"u"?BlobBuilder:typeof MSBlobBuilder<"u"?MSBlobBuilder:typeof MozBlobBuilder<"u"?MozBlobBuilder:WebKitBlobBuilder),n=0;n<e.length;n+=1)r.append(e[n]);return r.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 u(e,t,r){"function"==typeof t&&e.then(t),"function"==typeof r&&e.catch(r)}function f(e){return"string"!=typeof e&&(console.warn(e+" used as a key, but it is not a string."),e=String(e)),e}function c(){if(arguments.length&&"function"==typeof arguments[arguments.length-1])return arguments[arguments.length-1]}var l="local-forage-detect-blob-support",d=void 0,p={},h=Object.prototype.toString,m="readonly",y="readwrite";function b(e){return"boolean"==typeof d?o.resolve(d):function(e){return new o((function(t){var r=e.transaction(l,y),n=a([""]);r.objectStore(l).put(n,"key"),r.onabort=function(e){e.preventDefault(),e.stopPropagation(),t(!1)},r.oncomplete=function(){var e=navigator.userAgent.match(/Chrome\/(\d+)/),r=navigator.userAgent.match(/Edge\//);t(r||!e||parseInt(e[1],10)>=43)}})).catch((function(){return!1}))}(e).then((function(e){return d=e}))}function g(e){var t=p[e.name],r={};r.promise=new o((function(e,t){r.resolve=e,r.reject=t})),t.deferredOperations.push(r),t.dbReady?t.dbReady=t.dbReady.then((function(){return r.promise})):t.dbReady=r.promise}function v(e){var t=p[e.name].deferredOperations.pop();if(t)return t.resolve(),t.promise}function w(e,t){var r=p[e.name].deferredOperations.pop();if(r)return r.reject(t),r.promise}function _(e,t){return new o((function(r,n){if(p[e.name]=p[e.name]||{forages:[],db:null,dbReady:null,deferredOperations:[]},e.db){if(!t)return r(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 r=o.result;try{r.createObjectStore(e.storeName),t.oldVersion<=1&&r.createObjectStore(l)}catch(r){if("ConstraintError"!==r.name)throw r;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(),n(o.error)},o.onsuccess=function(){var t=o.result;t.onversionchange=function(e){e.target.close()},r(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 r=!e.db.objectStoreNames.contains(e.storeName),n=e.version<e.db.version,i=e.version>e.db.version;if(n&&(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||r){if(r){var a=e.db.version+1;a>e.version&&(e.version=a)}return!0}return!1}function S(e){var t=function(e){for(var t=e.length,r=new ArrayBuffer(t),n=new Uint8Array(r),i=0;i<t;i++)n[i]=e.charCodeAt(i);return r}(atob(e.data));return a([t],{type:e.type})}function k(e){return e&&e.__local_forage_encoded_blob}function O(e){var t=this,r=t._initReady().then((function(){var e=p[t._dbInfo.name];if(e&&e.dbReady)return e.dbReady}));return u(r,e,e),r}function R(e,t,r,n){void 0===n&&(n=1);try{var i=e.db.transaction(e.storeName,t);r(null,i)}catch(i){if(n>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],r=t.forages,n=0;n<r.length;n++){var i=r[n];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(n){e.db=t.db=n;for(var i=0;i<r.length;i++)r[i]._dbInfo.db=n})).catch((function(t){throw w(e,t),t}))}(e).then((function(){R(e,t,r,n-1)}))})).catch(r);r(i)}}var x={_driver:"asyncStorage",_initStorage:function(e){var t=this,r={db:null};if(e)for(var n in e)r[n]=e[n];var i=p[r.name];i||(i={forages:[],db:null,dbReady:null,deferredOperations:[]},p[r.name]=i),i.forages.push(t),t._initReady||(t._initReady=t.ready,t.ready=O);var a=[];function s(){return o.resolve()}for(var u=0;u<i.forages.length;u++){var f=i.forages[u];f!==t&&a.push(f._initReady().catch(s))}var c=i.forages.slice(0);return o.all(a).then((function(){return r.db=i.db,E(r)})).then((function(e){return r.db=e,A(r,t._defaultConfig.version)?T(r):e})).then((function(e){r.db=i.db=e,t._dbInfo=r;for(var n=0;n<c.length;n++){var a=c[n];a!==t&&(a._dbInfo.db=r.db,a._dbInfo.version=r.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 r=this,n=new o((function(t,n){r.ready().then((function(){R(r._dbInfo,m,(function(i,a){if(i)return n(i);try{var o=a.objectStore(r._dbInfo.storeName).openCursor(),s=1;o.onsuccess=function(){var r=o.result;if(r){var n=r.value;k(n)&&(n=S(n));var i=e(n,r.key,s++);void 0!==i?t(i):r.continue()}else t()},o.onerror=function(){n(o.error)}}catch(e){n(e)}}))})).catch(n)}));return s(n,t),n},getItem:function(e,t){var r=this;e=f(e);var n=new o((function(t,n){r.ready().then((function(){R(r._dbInfo,m,(function(i,a){if(i)return n(i);try{var o=a.objectStore(r._dbInfo.storeName).get(e);o.onsuccess=function(){var e=o.result;void 0===e&&(e=null),k(e)&&(e=S(e)),t(e)},o.onerror=function(){n(o.error)}}catch(e){n(e)}}))})).catch(n)}));return s(n,t),n},setItem:function(e,t,r){var n=this;e=f(e);var i=new o((function(r,i){var a;n.ready().then((function(){return a=n._dbInfo,"[object Blob]"===h.call(t)?b(a.db).then((function(e){return e?t:function(e){return new o((function(t,r){var n=new FileReader;n.onerror=r,n.onloadend=function(r){var n=btoa(r.target.result||"");t({__local_forage_encoded_blob:!0,data:n,type:e.type})},n.readAsBinaryString(e)}))}(t)})):t})).then((function(t){R(n._dbInfo,y,(function(a,o){if(a)return i(a);try{var s=o.objectStore(n._dbInfo.storeName);null===t&&(t=void 0);var u=s.put(t,e);o.oncomplete=function(){void 0===t&&(t=null),r(t)},o.onabort=o.onerror=function(){var e=u.error?u.error:u.transaction.error;i(e)}}catch(e){i(e)}}))})).catch(i)}));return s(i,r),i},removeItem:function(e,t){var r=this;e=f(e);var n=new o((function(t,n){r.ready().then((function(){R(r._dbInfo,y,(function(i,a){if(i)return n(i);try{var o=a.objectStore(r._dbInfo.storeName).delete(e);a.oncomplete=function(){t()},a.onerror=function(){n(o.error)},a.onabort=function(){var e=o.error?o.error:o.transaction.error;n(e)}}catch(e){n(e)}}))})).catch(n)}));return s(n,t),n},clear:function(e){var t=this,r=new o((function(e,r){t.ready().then((function(){R(t._dbInfo,y,(function(n,i){if(n)return r(n);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;r(e)}}catch(e){r(e)}}))})).catch(r)}));return s(r,e),r},length:function(e){var t=this,r=new o((function(e,r){t.ready().then((function(){R(t._dbInfo,m,(function(n,i){if(n)return r(n);try{var a=i.objectStore(t._dbInfo.storeName).count();a.onsuccess=function(){e(a.result)},a.onerror=function(){r(a.error)}}catch(e){r(e)}}))})).catch(r)}));return s(r,e),r},key:function(e,t){var r=this,n=new o((function(t,n){e<0?t(null):r.ready().then((function(){R(r._dbInfo,m,(function(i,a){if(i)return n(i);try{var o=a.objectStore(r._dbInfo.storeName),s=!1,u=o.openKeyCursor();u.onsuccess=function(){var r=u.result;r?0===e||s?t(r.key):(s=!0,r.advance(e)):t(null)},u.onerror=function(){n(u.error)}}catch(e){n(e)}}))})).catch(n)}));return s(n,t),n},keys:function(e){var t=this,r=new o((function(e,r){t.ready().then((function(){R(t._dbInfo,m,(function(n,i){if(n)return r(n);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(){r(a.error)}}catch(e){r(e)}}))})).catch(r)}));return s(r,e),r},dropInstance:function(e,t){t=c.apply(this,arguments);var r,n=this.config();if((e="function"!=typeof e&&e||{}).name||(e.name=e.name||n.name,e.storeName=e.storeName||n.storeName),e.name){var a=e.name===n.name&&this._dbInfo.db?o.resolve(this._dbInfo.db):E(e).then((function(t){var r=p[e.name],n=r.forages;r.db=t;for(var i=0;i<n.length;i++)n[i]._dbInfo.db=t;return t}));r=e.storeName?a.then((function(t){if(t.objectStoreNames.contains(e.storeName)){var r=t.version+1;g(e);var n=p[e.name],a=n.forages;t.close();for(var s=0;s<a.length;s++){var u=a[s];u._dbInfo.db=null,u._dbInfo.version=r}var f=new o((function(t,n){var a=i.open(e.name,r);a.onerror=function(e){a.result.close(),n(e)},a.onupgradeneeded=function(){a.result.deleteObjectStore(e.storeName)},a.onsuccess=function(){var e=a.result;e.close(),t(e)}}));return f.then((function(e){n.db=e;for(var t=0;t<a.length;t++){var r=a[t];r._dbInfo.db=e,v(r._dbInfo)}})).catch((function(t){throw(w(e,t)||o.resolve()).catch((function(){})),t}))}})):a.then((function(t){g(e);var r=p[e.name],n=r.forages;t.close();for(var a=0;a<n.length;a++){n[a]._dbInfo.db=null}var s=new o((function(t,r){var n=i.deleteDatabase(e.name);n.onerror=function(){var e=n.result;e&&e.close(),r(n.error)},n.onblocked=function(){console.warn('dropInstance blocked for database "'+e.name+'" until all open connections are closed')},n.onsuccess=function(){var e=n.result;e&&e.close(),t(e)}}));return s.then((function(e){r.db=e;for(var t=0;t<n.length;t++){v(n[t]._dbInfo)}})).catch((function(t){throw(w(e,t)||o.resolve()).catch((function(){})),t}))}))}else r=o.reject("Invalid arguments");return s(r,t),r}};var I="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",C=/^~~local_forage_type~([^~]+)~/,N="__lfsc__:",P="arbf",M="blob",B="si08",D="ui08",F="uic8",L="si16",U="si32",j="ur16",q="ui32",z="fl32",H="fl64",V=Object.prototype.toString;function G(e){var t,r,n,i,a,o=.75*e.length,s=e.length,u=0;"="===e[e.length-1]&&(o--,"="===e[e.length-2]&&o--);var f=new ArrayBuffer(o),c=new Uint8Array(f);for(t=0;t<s;t+=4)r=I.indexOf(e[t]),n=I.indexOf(e[t+1]),i=I.indexOf(e[t+2]),a=I.indexOf(e[t+3]),c[u++]=r<<2|n>>4,c[u++]=(15&n)<<4|i>>2,c[u++]=(3&i)<<6|63&a;return f}function W(e){var t,r=new Uint8Array(e),n="";for(t=0;t<r.length;t+=3)n+=I[r[t]>>2],n+=I[(3&r[t])<<4|r[t+1]>>4],n+=I[(15&r[t+1])<<2|r[t+2]>>6],n+=I[63&r[t+2]];return r.length%3==2?n=n.substring(0,n.length-1)+"=":r.length%3==1&&(n=n.substring(0,n.length-2)+"=="),n}var K={serialize:function(e,t){var r="";if(e&&(r=V.call(e)),e&&("[object ArrayBuffer]"===r||e.buffer&&"[object ArrayBuffer]"===V.call(e.buffer))){var n,i=N;e instanceof ArrayBuffer?(n=e,i+=P):(n=e.buffer,"[object Int8Array]"===r?i+=B:"[object Uint8Array]"===r?i+=D:"[object Uint8ClampedArray]"===r?i+=F:"[object Int16Array]"===r?i+=L:"[object Uint16Array]"===r?i+=j:"[object Int32Array]"===r?i+=U:"[object Uint32Array]"===r?i+=q:"[object Float32Array]"===r?i+=z:"[object Float64Array]"===r?i+=H:t(new Error("Failed to get type for BinaryArray"))),t(i+W(n))}else if("[object Blob]"===r){var a=new FileReader;a.onload=function(){var r="~~local_forage_type~"+e.type+"~"+W(this.result);t(N+M+r)},a.readAsArrayBuffer(e)}else try{t(JSON.stringify(e))}catch(r){console.error("Couldn't convert value into a JSON string: ",e),t(null,r)}},deserialize:function(e){if(e.substring(0,9)!==N)return JSON.parse(e);var t,r=e.substring(13),n=e.substring(9,13);if(n===M&&C.test(r)){var i=r.match(C);t=i[1],r=r.substring(i[0].length)}var o=G(r);switch(n){case P:return o;case M: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: "+n)}},stringToBuffer:G,bufferToString:W};function X(e,t,r,n){e.executeSql("CREATE TABLE IF NOT EXISTS "+t.storeName+" (id INTEGER PRIMARY KEY, key unique, value)",[],r,n)}function $(e,t,r,n,i,a){e.executeSql(r,n,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(r,n,i,a)}),a)}),a):a(e,o)}),a)}function J(e,t,r,n){var i=this;e=f(e);var a=new o((function(a,o){i.ready().then((function(){void 0===t&&(t=null);var s=t,u=i._dbInfo;u.serializer.serialize(t,(function(t,f){f?o(f):u.db.transaction((function(r){$(r,u,"INSERT OR REPLACE INTO "+u.storeName+" (key, value) VALUES (?, ?)",[e,t],(function(){a(s)}),(function(e,t){o(t)}))}),(function(t){if(t.code===t.QUOTA_ERR){if(n>0)return void a(J.apply(i,[e,s,r,n-1]));o(t)}}))}))})).catch(o)}));return s(a,r),a}var Y={_driver:"webSQLStorage",_initStorage:function(e){var t=this,r={db:null};if(e)for(var n in e)r[n]="string"!=typeof e[n]?e[n].toString():e[n];var i=new o((function(e,n){try{r.db=openDatabase(r.name,String(r.version),r.description,r.size)}catch(e){return n(e)}r.db.transaction((function(i){X(i,r,(function(){t._dbInfo=r,e()}),(function(e,t){n(t)}))}),n)}));return r.serializer=K,i},_support:"function"==typeof openDatabase,iterate:function(e,t){var r=this,n=new o((function(t,n){r.ready().then((function(){var i=r._dbInfo;i.db.transaction((function(r){$(r,i,"SELECT * FROM "+i.storeName,[],(function(r,n){for(var a=n.rows,o=a.length,s=0;s<o;s++){var u=a.item(s),f=u.value;if(f&&(f=i.serializer.deserialize(f)),void 0!==(f=e(f,u.key,s+1)))return void t(f)}t()}),(function(e,t){n(t)}))}))})).catch(n)}));return s(n,t),n},getItem:function(e,t){var r=this;e=f(e);var n=new o((function(t,n){r.ready().then((function(){var i=r._dbInfo;i.db.transaction((function(r){$(r,i,"SELECT * FROM "+i.storeName+" WHERE key = ? LIMIT 1",[e],(function(e,r){var n=r.rows.length?r.rows.item(0).value:null;n&&(n=i.serializer.deserialize(n)),t(n)}),(function(e,t){n(t)}))}))})).catch(n)}));return s(n,t),n},setItem:function(e,t,r){return J.apply(this,[e,t,r,1])},removeItem:function(e,t){var r=this;e=f(e);var n=new o((function(t,n){r.ready().then((function(){var i=r._dbInfo;i.db.transaction((function(r){$(r,i,"DELETE FROM "+i.storeName+" WHERE key = ?",[e],(function(){t()}),(function(e,t){n(t)}))}))})).catch(n)}));return s(n,t),n},clear:function(e){var t=this,r=new o((function(e,r){t.ready().then((function(){var n=t._dbInfo;n.db.transaction((function(t){$(t,n,"DELETE FROM "+n.storeName,[],(function(){e()}),(function(e,t){r(t)}))}))})).catch(r)}));return s(r,e),r},length:function(e){var t=this,r=new o((function(e,r){t.ready().then((function(){var n=t._dbInfo;n.db.transaction((function(t){$(t,n,"SELECT COUNT(key) as c FROM "+n.storeName,[],(function(t,r){var n=r.rows.item(0).c;e(n)}),(function(e,t){r(t)}))}))})).catch(r)}));return s(r,e),r},key:function(e,t){var r=this,n=new o((function(t,n){r.ready().then((function(){var i=r._dbInfo;i.db.transaction((function(r){$(r,i,"SELECT key FROM "+i.storeName+" WHERE id = ? LIMIT 1",[e+1],(function(e,r){var n=r.rows.length?r.rows.item(0).key:null;t(n)}),(function(e,t){n(t)}))}))})).catch(n)}));return s(n,t),n},keys:function(e){var t=this,r=new o((function(e,r){t.ready().then((function(){var n=t._dbInfo;n.db.transaction((function(t){$(t,n,"SELECT key FROM "+n.storeName,[],(function(t,r){for(var n=[],i=0;i<r.rows.length;i++)n.push(r.rows.item(i).key);e(n)}),(function(e,t){r(t)}))}))})).catch(r)}));return s(r,e),r},dropInstance:function(e,t){t=c.apply(this,arguments);var r=this.config();(e="function"!=typeof e&&e||{}).name||(e.name=e.name||r.name,e.storeName=e.storeName||r.storeName);var n,i=this;return n=e.name?new o((function(t){var n;n=e.name===r.name?i._dbInfo.db:openDatabase(e.name,"","",0),e.storeName?t({db:n,storeNames:[e.storeName]}):t(function(e){return new o((function(t,r){e.transaction((function(n){n.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name <> '__WebKitDatabaseInfoTable__'",[],(function(r,n){for(var i=[],a=0;a<n.rows.length;a++)i.push(n.rows.item(a).name);t({db:e,storeNames:i})}),(function(e,t){r(t)}))}),(function(e){r(e)}))}))}(n))})).then((function(e){return new o((function(t,r){e.db.transaction((function(n){function i(e){return new o((function(t,r){n.executeSql("DROP TABLE IF EXISTS "+e,[],(function(){t()}),(function(e,t){r(t)}))}))}for(var a=[],s=0,u=e.storeNames.length;s<u;s++)a.push(i(e.storeNames[s]));o.all(a).then((function(){t()})).catch((function(e){r(e)}))}),(function(e){r(e)}))}))})):o.reject("Invalid arguments"),s(n,t),n}};function Q(e,t){var r=e.name+"/";return e.storeName!==t.storeName&&(r+=e.storeName+"/"),r}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 r in e)t[r]=e[r];return t.keyPrefix=Q(e,this._defaultConfig),Z()?(this._dbInfo=t,t.serializer=K,o.resolve()):o.reject()},_support:function(){try{return typeof localStorage<"u"&&"setItem"in localStorage&&!!localStorage.setItem}catch{return!1}}(),iterate:function(e,t){var r=this,n=r.ready().then((function(){for(var t=r._dbInfo,n=t.keyPrefix,i=n.length,a=localStorage.length,o=1,s=0;s<a;s++){var u=localStorage.key(s);if(0===u.indexOf(n)){var f=localStorage.getItem(u);if(f&&(f=t.serializer.deserialize(f)),void 0!==(f=e(f,u.substring(i),o++)))return f}}}));return s(n,t),n},getItem:function(e,t){var r=this;e=f(e);var n=r.ready().then((function(){var t=r._dbInfo,n=localStorage.getItem(t.keyPrefix+e);return n&&(n=t.serializer.deserialize(n)),n}));return s(n,t),n},setItem:function(e,t,r){var n=this;e=f(e);var i=n.ready().then((function(){void 0===t&&(t=null);var r=t;return new o((function(i,a){var o=n._dbInfo;o.serializer.serialize(t,(function(t,n){if(n)a(n);else try{localStorage.setItem(o.keyPrefix+e,t),i(r)}catch(e){("QuotaExceededError"===e.name||"NS_ERROR_DOM_QUOTA_REACHED"===e.name)&&a(e),a(e)}}))}))}));return s(i,r),i},removeItem:function(e,t){var r=this;e=f(e);var n=r.ready().then((function(){var t=r._dbInfo;localStorage.removeItem(t.keyPrefix+e)}));return s(n,t),n},clear:function(e){var t=this,r=t.ready().then((function(){for(var e=t._dbInfo.keyPrefix,r=localStorage.length-1;r>=0;r--){var n=localStorage.key(r);0===n.indexOf(e)&&localStorage.removeItem(n)}}));return s(r,e),r},length:function(e){var t=this.keys().then((function(e){return e.length}));return s(t,e),t},key:function(e,t){var r=this,n=r.ready().then((function(){var t,n=r._dbInfo;try{t=localStorage.key(e)}catch{t=null}return t&&(t=t.substring(n.keyPrefix.length)),t}));return s(n,t),n},keys:function(e){var t=this,r=t.ready().then((function(){for(var e=t._dbInfo,r=localStorage.length,n=[],i=0;i<r;i++){var a=localStorage.key(i);0===a.indexOf(e.keyPrefix)&&n.push(a.substring(e.keyPrefix.length))}return n}));return s(r,e),r},dropInstance:function(e,t){if(t=c.apply(this,arguments),!(e="function"!=typeof e&&e||{}).name){var r=this.config();e.name=e.name||r.name,e.storeName=e.storeName||r.storeName}var n,i=this;return n=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 r=localStorage.key(t);0===r.indexOf(e)&&localStorage.removeItem(r)}})):o.reject("Invalid arguments"),s(n,t),n}},te=function(e,t){return e===t||"number"==typeof e&&"number"==typeof t&&isNaN(e)&&isNaN(t)},re=function(e,t){for(var r=e.length,n=0;n<r;){if(te(e[n],t))return!0;n++}return!1},ne=Array.isArray||function(e){return"[object Array]"===Object.prototype.toString.call(e)},ie={},ae={},oe={INDEXEDDB:x,WEBSQL:Y,LOCALSTORAGE:ee},se=[oe.INDEXEDDB._driver,oe.WEBSQL._driver,oe.LOCALSTORAGE._driver],ue=["dropInstance"],fe=["clear","getItem","iterate","key","keys","length","removeItem","setItem"].concat(ue),ce={description:"",driver:se.slice(),name:"localforage",size:4980736,storeName:"keyvaluepairs",version:1};function le(e,t){e[t]=function(){var r=arguments;return e.ready().then((function(){return e[t].apply(e,r)}))}}function de(){for(var e=1;e<arguments.length;e++){var t=arguments[e];if(t)for(var r in t)t.hasOwnProperty(r)&&(ne(t[r])?arguments[0][r]=t[r].slice():arguments[0][r]=t[r])}return arguments[0]}var pe=function(){function e(t){for(var r in function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),oe)if(oe.hasOwnProperty(r)){var n=oe[r],i=n._driver;this[r]=i,ie[i]||this.defineDriver(n)}this._defaultConfig=de({},ce),this._config=de({},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":n(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,r){var n=new o((function(t,r){try{var n=e._driver,i=new Error("Custom driver not compliant; see https://mozilla.github.io/localForage/#definedriver");if(!e._driver)return void r(i);for(var a=fe.concat("_initStorage"),u=0,f=a.length;u<f;u++){var c=a[u];if((!re(ue,c)||e[c])&&"function"!=typeof e[c])return void r(i)}!function(){for(var t=function(e){return function(){var t=new Error("Method "+e+" is not implemented by the current driver"),r=o.reject(t);return s(r,arguments[arguments.length-1]),r}},r=0,n=ue.length;r<n;r++){var i=ue[r];e[i]||(e[i]=t(i))}}();var l=function(r){ie[n]&&console.info("Redefining LocalForage driver: "+n),ie[n]=e,ae[n]=r,t()};"_support"in e?e._support&&"function"==typeof e._support?e._support().then(l,r):l(!!e._support):l(!0)}catch(e){r(e)}}));return u(n,t,r),n},e.prototype.driver=function(){return this._driver||null},e.prototype.getDriver=function(e,t,r){var n=ie[e]?o.resolve(ie[e]):o.reject(new Error("Driver not found."));return u(n,t,r),n},e.prototype.getSerializer=function(e){var t=o.resolve(K);return u(t,e),t},e.prototype.ready=function(e){var t=this,r=t._driverSet.then((function(){return null===t._ready&&(t._ready=t._initDriver()),t._ready}));return u(r,e,e),r},e.prototype.setDriver=function(e,t,r){var n=this;ne(e)||(e=[e]);var i=this._getSupportedDrivers(e);function a(){n._config.driver=n.driver()}function s(e){return n._extend(e),a(),n._ready=n._initStorage(n._config),n._ready}var f=null!==this._driverSet?this._driverSet.catch((function(){return o.resolve()})):o.resolve();return this._driverSet=f.then((function(){var e=i[0];return n._dbInfo=null,n._ready=null,n.getDriver(e).then((function(e){n._driver=e._driver,a(),n._wrapLibraryMethodsWithReady(),n._initDriver=function(e){return function(){var t=0;return function r(){for(;t<e.length;){var i=e[t];return t++,n._dbInfo=null,n._ready=null,n.getDriver(i).then(s).catch(r)}a();var u=new Error("No available storage method found.");return n._driverSet=o.reject(u),n._driverSet}()}}(i)}))})).catch((function(){a();var e=new Error("No available storage method found.");return n._driverSet=o.reject(e),n._driverSet})),u(this._driverSet,t,r),this._driverSet},e.prototype.supports=function(e){return!!ae[e]},e.prototype._extend=function(e){de(this,e)},e.prototype._getSupportedDrivers=function(e){for(var t=[],r=0,n=e.length;r<n;r++){var i=e[r];this.supports(i)&&t.push(i)}return t},e.prototype._wrapLibraryMethodsWithReady=function(){for(var e=0,t=fe.length;e<t;e++)le(this,fe[e])},e.prototype.createInstance=function(t){return new e(t)},e}(),he=new pe;t.exports=he},{3:3}]},{},[4])(4)}))})),MU=IU(((e,t)=>{!function(r,n){"object"==typeof e&&typeof t<"u"?n(e):"function"==typeof define&&define.amd?define("localforage-driver-memory",["exports"],n):n(r.LocalforageDriverMemory={})}(typeof self<"u"?self:e,(function(e){var t=/^~~local_forage_type~([^~]+)~/,r=Object.prototype.toString;function n(e){var t=.75*e.length,r=e.length;"="===e[e.length-1]&&(t--,"="===e[e.length-2]&&t--);for(var n=new ArrayBuffer(t),i=new Uint8Array(n),a=0,o=0;a<r;a+=4){var s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".indexOf(e[a]),u="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".indexOf(e[a+1]),f="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".indexOf(e[a+2]),c="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".indexOf(e[a+3]);i[o++]=s<<2|u>>4,i[o++]=(15&u)<<4|f>>2,i[o++]=(3&f)<<6|63&c}return n}function i(e){for(var t=new Uint8Array(e),r="",n=0;n<t.length;n+=3)r+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[t[n]>>2],r+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[(3&t[n])<<4|t[n+1]>>4],r+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[(15&t[n+1])<<2|t[n+2]>>6],r+="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"[63&t[n+2]];return t.length%3==2?r=r.substring(0,r.length-1)+"=":t.length%3==1&&(r=r.substring(0,r.length-2)+"=="),r}function a(e){var t,r;if(null===e||"object"!=typeof e||"isActiveClone"in e)return e;var n=e instanceof Date?new Date(e):e.constructor();try{for(var i=function(e){var t="function"==typeof Symbol&&e[Symbol.iterator],r=0;return t?t.call(e):{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],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,n[s]=a(e[s]),delete e.isActiveClone)}}catch(e){t={error:e}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(t)throw t.error}}return n}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 u(){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 f(e,t){var r,n=this;if(t=u.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 r=e.name?new Promise((function(t){e.storeName?t(o(e,n._defaultConfig)):t(e.name+"/")})):Promise.reject("Invalid arguments"),{promise:r,callback:t}}function c(e){return"string"!=typeof e&&(console.warn(e+" used as a key, but it is not a string."),e=String(e)),e}var l={bufferToString:i,deserialize:function(e){if("__lfsc__:"!==e.substring(0,9))return JSON.parse(e);var r,i=e.substring(13),a=e.substring(9,13);if("blob"===a&&t.test(i)){var o=i.match(t);r=o[1],i=i.substring(o[0].length)}var s=n(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 r=new(typeof BlobBuilder<"u"?BlobBuilder:typeof MSBlobBuilder<"u"?MSBlobBuilder:typeof MozBlobBuilder<"u"?MozBlobBuilder:WebKitBlobBuilder),n=0;n<e.length;n+=1)r.append(e[n]);return r.getBlob(t.type)}}([s],{type:r});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 n="";if(e&&(n=r.call(e)),e&&("[object ArrayBuffer]"===n||e.buffer&&"[object ArrayBuffer]"===r.call(e.buffer))){var a=void 0,o="__lfsc__:";e instanceof ArrayBuffer?(a=e,o+="arbf"):(a=e.buffer,"[object Int8Array]"===n?o+="si08":"[object Uint8Array]"===n?o+="ui08":"[object Uint8ClampedArray]"===n?o+="uic8":"[object Int16Array]"===n?o+="si16":"[object Uint16Array]"===n?o+="ur16":"[object Int32Array]"===n?o+="si32":"[object Uint32Array]"===n?o+="ui32":"[object Float32Array]"===n?o+="fl32":"[object Float64Array]"===n?o+="fl64":t(new Error("Failed to get type for BinaryArray"))),t(o+i(a))}else if("[object Blob]"===n){var s=new FileReader;s.onload=function(){var r="~~local_forage_type~"+e.type+"~"+i(this.result);t("__lfsc__:blob"+r)},s.readAsArrayBuffer(e)}else try{t(JSON.stringify(e))}catch(r){console.error("Couldn't convert value into a JSON string: ",e),t(null,r)}},stringToBuffer:n},d={},p=function(){function e(e){this.kp=e,this.data={}}return e.resolve=function(t){return d[t]||(d[t]=new e(t)),d[t]},e.prototype.clear=function(){this.data={}},e.prototype.drop=function(){this.clear(),delete d[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):{},r=o(t,this._defaultConfig),n=p.resolve(r);return this._dbInfo=t,this._dbInfo.serializer=l,this._dbInfo.keyPrefix=r,this._dbInfo.mStore=n,Promise.resolve()},e.clear=function(e){var t=this,r=this.ready().then((function(){t._dbInfo.mStore.clear()}));return s(r,e),r},e.dropInstance=function(e,t){var r=f.apply(this,arguments),n=r.promise,i=r.callback,a=n.then((function(e){p.resolve(e).drop()}));return s(a,i),n},e.getItem=function(e,t){var r=this;e=c(e);var n=this.ready().then((function(){var t=r._dbInfo.mStore.get(e);return null==t?null:r._dbInfo.serializer.deserialize(t)}));return s(n,t),n},e.iterate=function(e,t){var r=this,n=this.ready().then((function(){for(var t=r._dbInfo.mStore,n=t.keys(),i=0;i<n.length;i++){var a=t.get(n[i]);if(a&&(a=r._dbInfo.serializer.deserialize(a)),void 0!==(a=e(a,n[i],i+1)))return a}}));return s(n,t),n},e.key=function(e,t){var r=this,n=this.ready().then((function(){var t;try{void 0===(t=r._dbInfo.mStore.key(e))&&(t=null)}catch{t=null}return t}));return s(n,t),n},e.keys=function(e){var t=this,r=this.ready().then((function(){return t._dbInfo.mStore.keys()}));return s(r,e),r},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 r=this;e=c(e);var n=this.ready().then((function(){r._dbInfo.mStore.rm(e)}));return s(n,t),n},e.setItem=function(e,t,r){var n=this;e=c(e);var i=this.ready().then((function(){void 0===t&&(t=null);var r=t;return new Promise((function(i,a){n._dbInfo.serializer.serialize(t,(function(t,o){if(o)a(o);else try{n._dbInfo.mStore.set(e,t),i(r)}catch(e){a(e)}}))}))}));return s(i,r),i},Object.defineProperty(e,"__esModule",{value:!0})}))})),BU=CU(PU()),DU=CU(MU()),FU={display:"none",position:"fixed",top:"0",right:"0",width:"100%",height:"100%",borderRadius:"0",border:"none",zIndex:"2147483647"};var LU=function(e,t){return Object.assign(fL,t),e}(wU,{platform:"web",sdkName:"magic-sdk",version:"13.6.2",defaultEndpoint:"https://auth.magic.link/",ViewController:class extends EU{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 pL(LD.DuplicateIframe,"Duplicate iframes found.").log();else{let t=document.createElement("iframe");t.classList.add("magic-iframe"),t.dataset.magicIframeLabel=lU(this.endpoint).host,t.title="Secure Modal",t.src=lU(`/send?params=${encodeURIComponent(this.parameters)}`,this.endpoint).href,function(e){for(let[t,r]of Object.entries(FU))e.style[t]=r}(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 NU(this,null,(function*(){let e=yield this.iframe;e.style.display="block",this.activeElement=document.activeElement,e.focus()}))}hideOverlay(){return NU(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 NU(this,null,(function*(){let t=yield this.iframe;if(!t||!t.contentWindow)throw new lL(FD.ModalNotReady,"Modal is not ready.");t.contentWindow.postMessage(e,this.endpoint)}))}},configureStorage:()=>NU(void 0,null,(function*(){let e=BU.default.createInstance({name:"MagicAuthLocalStorageDB",storeName:"MagicAuthLocalStorage"});return yield e.defineDriver(DU),yield e.setDriver([BU.default.INDEXEDDB,BU.default.LOCALSTORAGE,DU._driver]),e}))}),UU=(e=>(e.LoginWithOIDC="magic_auth_login_with_oidc",e))(UU||{}),jU=class extends mU.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 qU(e,t){return function(){return e.apply(t,arguments)}}const{toString:zU}=Object.prototype,{getPrototypeOf:HU}=Object,VU=(e=>t=>{const r=zU.call(t);return e[r]||(e[r]=r.slice(8,-1).toLowerCase())})(Object.create(null)),GU=e=>(e=e.toLowerCase(),t=>VU(t)===e),WU=e=>t=>typeof t===e,{isArray:KU}=Array,XU=WU("undefined");const $U=GU("ArrayBuffer");const JU=WU("string"),YU=WU("function"),QU=WU("number"),ZU=e=>null!==e&&"object"==typeof e,ej=e=>{if("object"!==VU(e))return!1;const t=HU(e);return!(null!==t&&t!==Object.prototype&&null!==Object.getPrototypeOf(t)||Symbol.toStringTag in e||Symbol.iterator in e)},tj=GU("Date"),rj=GU("File"),nj=GU("Blob"),ij=GU("FileList"),aj=GU("URLSearchParams");function oj(e,t,{allOwnKeys:r=!1}={}){if(null==e)return;let n,i;if("object"!=typeof e&&(e=[e]),KU(e))for(n=0,i=e.length;n<i;n++)t.call(null,e[n],n,e);else{const i=r?Object.getOwnPropertyNames(e):Object.keys(e),a=i.length;let o;for(n=0;n<a;n++)o=i[n],t.call(null,e[o],o,e)}}function sj(e,t){t=t.toLowerCase();const r=Object.keys(e);let n,i=r.length;for(;i-- >0;)if(n=r[i],t===n.toLowerCase())return n;return null}const uj="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:global,fj=e=>!XU(e)&&e!==uj;const cj=(e=>t=>e&&t instanceof e)("undefined"!=typeof Uint8Array&&HU(Uint8Array)),lj=GU("HTMLFormElement"),dj=(({hasOwnProperty:e})=>(t,r)=>e.call(t,r))(Object.prototype),pj=GU("RegExp"),hj=(e,t)=>{const r=Object.getOwnPropertyDescriptors(e),n={};oj(r,((r,i)=>{!1!==t(r,i,e)&&(n[i]=r)})),Object.defineProperties(e,n)},mj="abcdefghijklmnopqrstuvwxyz",yj="0123456789",bj={DIGIT:yj,ALPHA:mj,ALPHA_DIGIT:mj+mj.toUpperCase()+yj};const gj=GU("AsyncFunction");var vj={isArray:KU,isArrayBuffer:$U,isBuffer:function(e){return null!==e&&!XU(e)&&null!==e.constructor&&!XU(e.constructor)&&YU(e.constructor.isBuffer)&&e.constructor.isBuffer(e)},isFormData:e=>{let t;return e&&("function"==typeof FormData&&e instanceof FormData||YU(e.append)&&("formdata"===(t=VU(e))||"object"===t&&YU(e.toString)&&"[object FormData]"===e.toString()))},isArrayBufferView:function(e){let t;return t="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&$U(e.buffer),t},isString:JU,isNumber:QU,isBoolean:e=>!0===e||!1===e,isObject:ZU,isPlainObject:ej,isUndefined:XU,isDate:tj,isFile:rj,isBlob:nj,isRegExp:pj,isFunction:YU,isStream:e=>ZU(e)&&YU(e.pipe),isURLSearchParams:aj,isTypedArray:cj,isFileList:ij,forEach:oj,merge:function e(){const{caseless:t}=fj(this)&&this||{},r={},n=(n,i)=>{const a=t&&sj(r,i)||i;ej(r[a])&&ej(n)?r[a]=e(r[a],n):ej(n)?r[a]=e({},n):KU(n)?r[a]=n.slice():r[a]=n};for(let e=0,t=arguments.length;e<t;e++)arguments[e]&&oj(arguments[e],n);return r},extend:(e,t,r,{allOwnKeys:n}={})=>(oj(t,((t,n)=>{r&&YU(t)?e[n]=qU(t,r):e[n]=t}),{allOwnKeys:n}),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,r,n)=>{e.prototype=Object.create(t.prototype,n),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),r&&Object.assign(e.prototype,r)},toFlatObject:(e,t,r,n)=>{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],n&&!n(o,e,t)||s[o]||(t[o]=e[o],s[o]=!0);e=!1!==r&&HU(e)}while(e&&(!r||r(e,t))&&e!==Object.prototype);return t},kindOf:VU,kindOfTest:GU,endsWith:(e,t,r)=>{e=String(e),(void 0===r||r>e.length)&&(r=e.length),r-=t.length;const n=e.indexOf(t,r);return-1!==n&&n===r},toArray:e=>{if(!e)return null;if(KU(e))return e;let t=e.length;if(!QU(t))return null;const r=new Array(t);for(;t-- >0;)r[t]=e[t];return r},forEachEntry:(e,t)=>{const r=(e&&e[Symbol.iterator]).call(e);let n;for(;(n=r.next())&&!n.done;){const r=n.value;t.call(e,r[0],r[1])}},matchAll:(e,t)=>{let r;const n=[];for(;null!==(r=e.exec(t));)n.push(r);return n},isHTMLForm:lj,hasOwnProperty:dj,hasOwnProp:dj,reduceDescriptors:hj,freezeMethods:e=>{hj(e,((t,r)=>{if(YU(e)&&-1!==["arguments","caller","callee"].indexOf(r))return!1;const n=e[r];YU(n)&&(t.enumerable=!1,"writable"in t?t.writable=!1:t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+r+"'")}))}))},toObjectSet:(e,t)=>{const r={},n=e=>{e.forEach((e=>{r[e]=!0}))};return KU(e)?n(e):n(String(e).split(t)),r},toCamelCase:e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,(function(e,t,r){return t.toUpperCase()+r})),noop:()=>{},toFiniteNumber:(e,t)=>(e=+e,Number.isFinite(e)?e:t),findKey:sj,global:uj,isContextDefined:fj,ALPHABET:bj,generateString:(e=16,t=bj.ALPHA_DIGIT)=>{let r="";const{length:n}=t;for(;e--;)r+=t[Math.random()*n|0];return r},isSpecCompliantForm:function(e){return!!(e&&YU(e.append)&&"FormData"===e[Symbol.toStringTag]&&e[Symbol.iterator])},toJSONObject:e=>{const t=new Array(10),r=(e,n)=>{if(ZU(e)){if(t.indexOf(e)>=0)return;if(!("toJSON"in e)){t[n]=e;const i=KU(e)?[]:{};return oj(e,((e,t)=>{const a=r(e,n+1);!XU(a)&&(i[t]=a)})),t[n]=void 0,i}}return e};return r(e,0)},isAsyncFn:gj,isThenable:e=>e&&(ZU(e)||YU(e))&&YU(e.then)&&YU(e.catch)};function wj(e,t,r,n,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),r&&(this.config=r),n&&(this.request=n),i&&(this.response=i)}vj.inherits(wj,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:vj.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});const _j=wj.prototype,Ej={};["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=>{Ej[e]={value:e}})),Object.defineProperties(wj,Ej),Object.defineProperty(_j,"isAxiosError",{value:!0}),wj.from=(e,t,r,n,i,a)=>{const o=Object.create(_j);return vj.toFlatObject(e,o,(function(e){return e!==Error.prototype}),(e=>"isAxiosError"!==e)),wj.call(o,e.message,t,r,n,i),o.cause=e,o.name=e.name,a&&Object.assign(o,a),o};function Tj(e){return vj.isPlainObject(e)||vj.isArray(e)}function Aj(e){return vj.endsWith(e,"[]")?e.slice(0,-2):e}function Sj(e,t,r){return e?e.concat(t).map((function(e,t){return e=Aj(e),!r&&t?"["+e+"]":e})).join(r?".":""):t}const kj=vj.toFlatObject(vj,{},null,(function(e){return/^is[A-Z]/.test(e)}));function Oj(e,t,r){if(!vj.isObject(e))throw new TypeError("target must be an object");t=t||new FormData;const n=(r=vj.toFlatObject(r,{metaTokens:!0,dots:!1,indexes:!1},!1,(function(e,t){return!vj.isUndefined(t[e])}))).metaTokens,i=r.visitor||f,a=r.dots,o=r.indexes,s=(r.Blob||"undefined"!=typeof Blob&&Blob)&&vj.isSpecCompliantForm(t);if(!vj.isFunction(i))throw new TypeError("visitor must be a function");function u(e){if(null===e)return"";if(vj.isDate(e))return e.toISOString();if(!s&&vj.isBlob(e))throw new wj("Blob is not supported. Use a Buffer instead.");return vj.isArrayBuffer(e)||vj.isTypedArray(e)?s&&"function"==typeof Blob?new Blob([e]):Buffer.from(e):e}function f(e,r,i){let s=e;if(e&&!i&&"object"==typeof e)if(vj.endsWith(r,"{}"))r=n?r:r.slice(0,-2),e=JSON.stringify(e);else if(vj.isArray(e)&&function(e){return vj.isArray(e)&&!e.some(Tj)}(e)||(vj.isFileList(e)||vj.endsWith(r,"[]"))&&(s=vj.toArray(e)))return r=Aj(r),s.forEach((function(e,n){!vj.isUndefined(e)&&null!==e&&t.append(!0===o?Sj([r],n,a):null===o?r:r+"[]",u(e))})),!1;return!!Tj(e)||(t.append(Sj(i,r,a),u(e)),!1)}const c=[],l=Object.assign(kj,{defaultVisitor:f,convertValue:u,isVisitable:Tj});if(!vj.isObject(e))throw new TypeError("data must be an object");return function e(r,n){if(!vj.isUndefined(r)){if(-1!==c.indexOf(r))throw Error("Circular reference detected in "+n.join("."));c.push(r),vj.forEach(r,(function(r,a){!0===(!(vj.isUndefined(r)||null===r)&&i.call(t,r,vj.isString(a)?a.trim():a,n,l))&&e(r,n?n.concat(a):[a])})),c.pop()}}(e),t}function Rj(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,(function(e){return t[e]}))}function xj(e,t){this._pairs=[],e&&Oj(e,this,t)}const Ij=xj.prototype;function Cj(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function Nj(e,t,r){if(!t)return e;const n=r&&r.encode||Cj,i=r&&r.serialize;let a;if(a=i?i(t,r):vj.isURLSearchParams(t)?t.toString():new xj(t,r).toString(n),a){const t=e.indexOf("#");-1!==t&&(e=e.slice(0,t)),e+=(-1===e.indexOf("?")?"?":"&")+a}return e}Ij.append=function(e,t){this._pairs.push([e,t])},Ij.toString=function(e){const t=e?function(t){return e.call(this,t,Rj)}:Rj;return this._pairs.map((function(e){return t(e[0])+"="+t(e[1])}),"").join("&")};var Pj=class{constructor(){this.handlers=[]}use(e,t,r){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!r&&r.synchronous,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){vj.forEach(this.handlers,(function(t){null!==t&&e(t)}))}},Mj={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1};var Bj={isBrowser:!0,classes:{URLSearchParams:"undefined"!=typeof URLSearchParams?URLSearchParams:xj,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 Dj(e){function t(e,r,n,i){let a=e[i++];const o=Number.isFinite(+a),s=i>=e.length;if(a=!a&&vj.isArray(n)?n.length:a,s)return vj.hasOwnProp(n,a)?n[a]=[n[a],r]:n[a]=r,!o;n[a]&&vj.isObject(n[a])||(n[a]=[]);return t(e,r,n[a],i)&&vj.isArray(n[a])&&(n[a]=function(e){const t={},r=Object.keys(e);let n;const i=r.length;let a;for(n=0;n<i;n++)a=r[n],t[a]=e[a];return t}(n[a])),!o}if(vj.isFormData(e)&&vj.isFunction(e.entries)){const r={};return vj.forEachEntry(e,((e,n)=>{t(function(e){return vj.matchAll(/\w+|\[(\w*)]/g,e).map((e=>"[]"===e[0]?"":e[1]||e[0]))}(e),n,r,0)})),r}return null}const Fj={"Content-Type":void 0};const Lj={transitional:Mj,adapter:["xhr","http"],transformRequest:[function(e,t){const r=t.getContentType()||"",n=r.indexOf("application/json")>-1,i=vj.isObject(e);i&&vj.isHTMLForm(e)&&(e=new FormData(e));if(vj.isFormData(e))return n&&n?JSON.stringify(Dj(e)):e;if(vj.isArrayBuffer(e)||vj.isBuffer(e)||vj.isStream(e)||vj.isFile(e)||vj.isBlob(e))return e;if(vj.isArrayBufferView(e))return e.buffer;if(vj.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let a;if(i){if(r.indexOf("application/x-www-form-urlencoded")>-1)return function(e,t){return Oj(e,new Bj.classes.URLSearchParams,Object.assign({visitor:function(e,t,r,n){return Bj.isNode&&vj.isBuffer(e)?(this.append(t,e.toString("base64")),!1):n.defaultVisitor.apply(this,arguments)}},t))}(e,this.formSerializer).toString();if((a=vj.isFileList(e))||r.indexOf("multipart/form-data")>-1){const t=this.env&&this.env.FormData;return Oj(a?{"files[]":e}:e,t&&new t,this.formSerializer)}}return i||n?(t.setContentType("application/json",!1),function(e,t,r){if(vj.isString(e))try{return(t||JSON.parse)(e),vj.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(r||JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){const t=this.transitional||Lj.transitional,r=t&&t.forcedJSONParsing,n="json"===this.responseType;if(e&&vj.isString(e)&&(r&&!this.responseType||n)){const r=!(t&&t.silentJSONParsing)&&n;try{return JSON.parse(e)}catch(e){if(r){if("SyntaxError"===e.name)throw wj.from(e,wj.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:Bj.classes.FormData,Blob:Bj.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};vj.forEach(["delete","get","head"],(function(e){Lj.headers[e]={}})),vj.forEach(["post","put","patch"],(function(e){Lj.headers[e]=vj.merge(Fj)}));var Uj=Lj;const jj=vj.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 qj=Symbol("internals");function zj(e){return e&&String(e).trim().toLowerCase()}function Hj(e){return!1===e||null==e?e:vj.isArray(e)?e.map(Hj):String(e)}function Vj(e,t,r,n,i){return vj.isFunction(n)?n.call(this,t,r):(i&&(t=r),vj.isString(t)?vj.isString(n)?-1!==t.indexOf(n):vj.isRegExp(n)?n.test(t):void 0:void 0)}class Gj{constructor(e){e&&this.set(e)}set(e,t,r){const n=this;function i(e,t,r){const i=zj(t);if(!i)throw new Error("header name must be a non-empty string");const a=vj.findKey(n,i);(!a||void 0===n[a]||!0===r||void 0===r&&!1!==n[a])&&(n[a||t]=Hj(e))}const a=(e,t)=>vj.forEach(e,((e,r)=>i(e,r,t)));return vj.isPlainObject(e)||e instanceof this.constructor?a(e,t):vj.isString(e)&&(e=e.trim())&&!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim())?a((e=>{const t={};let r,n,i;return e&&e.split("\n").forEach((function(e){i=e.indexOf(":"),r=e.substring(0,i).trim().toLowerCase(),n=e.substring(i+1).trim(),!r||t[r]&&jj[r]||("set-cookie"===r?t[r]?t[r].push(n):t[r]=[n]:t[r]=t[r]?t[r]+", "+n:n)})),t})(e),t):null!=e&&i(t,e,r),this}get(e,t){if(e=zj(e)){const r=vj.findKey(this,e);if(r){const e=this[r];if(!t)return e;if(!0===t)return function(e){const t=Object.create(null),r=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let n;for(;n=r.exec(e);)t[n[1]]=n[2];return t}(e);if(vj.isFunction(t))return t.call(this,e,r);if(vj.isRegExp(t))return t.exec(e);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=zj(e)){const r=vj.findKey(this,e);return!(!r||void 0===this[r]||t&&!Vj(0,this[r],r,t))}return!1}delete(e,t){const r=this;let n=!1;function i(e){if(e=zj(e)){const i=vj.findKey(r,e);!i||t&&!Vj(0,r[i],i,t)||(delete r[i],n=!0)}}return vj.isArray(e)?e.forEach(i):i(e),n}clear(e){const t=Object.keys(this);let r=t.length,n=!1;for(;r--;){const i=t[r];e&&!Vj(0,this[i],i,e,!0)||(delete this[i],n=!0)}return n}normalize(e){const t=this,r={};return vj.forEach(this,((n,i)=>{const a=vj.findKey(r,i);if(a)return t[a]=Hj(n),void delete t[i];const o=e?function(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,((e,t,r)=>t.toUpperCase()+r))}(i):String(i).trim();o!==i&&delete t[i],t[o]=Hj(n),r[o]=!0})),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const t=Object.create(null);return vj.forEach(this,((r,n)=>{null!=r&&!1!==r&&(t[n]=e&&vj.isArray(r)?r.join(", "):r)})),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 r=new this(e);return t.forEach((e=>r.set(e))),r}static accessor(e){const t=(this[qj]=this[qj]={accessors:{}}).accessors,r=this.prototype;function n(e){const n=zj(e);t[n]||(!function(e,t){const r=vj.toCamelCase(" "+t);["get","set","has"].forEach((n=>{Object.defineProperty(e,n+r,{value:function(e,r,i){return this[n].call(this,t,e,r,i)},configurable:!0})}))}(r,e),t[n]=!0)}return vj.isArray(e)?e.forEach(n):n(e),this}}Gj.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),vj.freezeMethods(Gj.prototype),vj.freezeMethods(Gj);var Wj=Gj;function Kj(e,t){const r=this||Uj,n=t||r,i=Wj.from(n.headers);let a=n.data;return vj.forEach(e,(function(e){a=e.call(r,a,i.normalize(),t?t.status:void 0)})),i.normalize(),a}function Xj(e){return!(!e||!e.__CANCEL__)}function $j(e,t,r){wj.call(this,null==e?"canceled":e,wj.ERR_CANCELED,t,r),this.name="CanceledError"}vj.inherits($j,wj,{__CANCEL__:!0});var Jj=Bj.isStandardBrowserEnv?{write:function(e,t,r,n,i,a){const o=[];o.push(e+"="+encodeURIComponent(t)),vj.isNumber(r)&&o.push("expires="+new Date(r).toGMTString()),vj.isString(n)&&o.push("path="+n),vj.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 Yj(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 Qj=Bj.isStandardBrowserEnv?function(){const e=/(msie|trident)/i.test(navigator.userAgent),t=document.createElement("a");let r;function n(r){let n=r;return e&&(t.setAttribute("href",n),n=t.href),t.setAttribute("href",n),{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 r=n(window.location.href),function(e){const t=vj.isString(e)?n(e):e;return t.protocol===r.protocol&&t.host===r.host}}():function(){return!0};function Zj(e,t){let r=0;const n=function(e,t){e=e||10;const r=new Array(e),n=new Array(e);let i,a=0,o=0;return t=void 0!==t?t:1e3,function(s){const u=Date.now(),f=n[o];i||(i=u),r[a]=s,n[a]=u;let c=o,l=0;for(;c!==a;)l+=r[c++],c%=e;if(a=(a+1)%e,a===o&&(o=(o+1)%e),u-i<t)return;const d=f&&u-f;return d?Math.round(1e3*l/d):void 0}}(50,250);return i=>{const a=i.loaded,o=i.lengthComputable?i.total:void 0,s=a-r,u=n(s);r=a;const f={loaded:a,total:o,progress:o?a/o:void 0,bytes:s,rate:u||void 0,estimated:u&&o&&a<=o?(o-a)/u:void 0,event:i};f[t?"download":"upload"]=!0,e(f)}}var eq="undefined"!=typeof XMLHttpRequest&&function(e){return new Promise((function(t,r){let n=e.data;const i=Wj.from(e.headers).normalize(),a=e.responseType;let o;function s(){e.cancelToken&&e.cancelToken.unsubscribe(o),e.signal&&e.signal.removeEventListener("abort",o)}vj.isFormData(n)&&(Bj.isStandardBrowserEnv||Bj.isStandardBrowserWebWorkerEnv?i.setContentType(!1):i.setContentType("multipart/form-data;",!1));let u=new XMLHttpRequest;if(e.auth){const t=e.auth.username||"",r=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";i.set("Authorization","Basic "+btoa(t+":"+r))}const f=Yj(e.baseURL,e.url);function c(){if(!u)return;const n=Wj.from("getAllResponseHeaders"in u&&u.getAllResponseHeaders());!function(e,t,r){const n=r.config.validateStatus;r.status&&n&&!n(r.status)?t(new wj("Request failed with status code "+r.status,[wj.ERR_BAD_REQUEST,wj.ERR_BAD_RESPONSE][Math.floor(r.status/100)-4],r.config,r.request,r)):e(r)}((function(e){t(e),s()}),(function(e){r(e),s()}),{data:a&&"text"!==a&&"json"!==a?u.response:u.responseText,status:u.status,statusText:u.statusText,headers:n,config:e,request:u}),u=null}if(u.open(e.method.toUpperCase(),Nj(f,e.params,e.paramsSerializer),!0),u.timeout=e.timeout,"onloadend"in u?u.onloadend=c:u.onreadystatechange=function(){u&&4===u.readyState&&(0!==u.status||u.responseURL&&0===u.responseURL.indexOf("file:"))&&setTimeout(c)},u.onabort=function(){u&&(r(new wj("Request aborted",wj.ECONNABORTED,e,u)),u=null)},u.onerror=function(){r(new wj("Network Error",wj.ERR_NETWORK,e,u)),u=null},u.ontimeout=function(){let t=e.timeout?"timeout of "+e.timeout+"ms exceeded":"timeout exceeded";const n=e.transitional||Mj;e.timeoutErrorMessage&&(t=e.timeoutErrorMessage),r(new wj(t,n.clarifyTimeoutError?wj.ETIMEDOUT:wj.ECONNABORTED,e,u)),u=null},Bj.isStandardBrowserEnv){const t=(e.withCredentials||Qj(f))&&e.xsrfCookieName&&Jj.read(e.xsrfCookieName);t&&i.set(e.xsrfHeaderName,t)}void 0===n&&i.setContentType(null),"setRequestHeader"in u&&vj.forEach(i.toJSON(),(function(e,t){u.setRequestHeader(t,e)})),vj.isUndefined(e.withCredentials)||(u.withCredentials=!!e.withCredentials),a&&"json"!==a&&(u.responseType=e.responseType),"function"==typeof e.onDownloadProgress&&u.addEventListener("progress",Zj(e.onDownloadProgress,!0)),"function"==typeof e.onUploadProgress&&u.upload&&u.upload.addEventListener("progress",Zj(e.onUploadProgress)),(e.cancelToken||e.signal)&&(o=t=>{u&&(r(!t||t.type?new $j(null,e,u):t),u.abort(),u=null)},e.cancelToken&&e.cancelToken.subscribe(o),e.signal&&(e.signal.aborted?o():e.signal.addEventListener("abort",o)));const l=function(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}(f);l&&-1===Bj.protocols.indexOf(l)?r(new wj("Unsupported protocol "+l+":",wj.ERR_BAD_REQUEST,e)):u.send(n||null)}))};const tq={http:null,xhr:eq};vj.forEach(tq,((e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch(e){}Object.defineProperty(e,"adapterName",{value:t})}}));var rq=e=>{e=vj.isArray(e)?e:[e];const{length:t}=e;let r,n;for(let i=0;i<t&&(r=e[i],!(n=vj.isString(r)?tq[r.toLowerCase()]:r));i++);if(!n){if(!1===n)throw new wj(`Adapter ${r} is not supported by the environment`,"ERR_NOT_SUPPORT");throw new Error(vj.hasOwnProp(tq,r)?`Adapter '${r}' is not available in the build`:`Unknown adapter '${r}'`)}if(!vj.isFunction(n))throw new TypeError("adapter is not a function");return n};function nq(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new $j(null,e)}function iq(e){nq(e),e.headers=Wj.from(e.headers),e.data=Kj.call(e,e.transformRequest),-1!==["post","put","patch"].indexOf(e.method)&&e.headers.setContentType("application/x-www-form-urlencoded",!1);return rq(e.adapter||Uj.adapter)(e).then((function(t){return nq(e),t.data=Kj.call(e,e.transformResponse,t),t.headers=Wj.from(t.headers),t}),(function(t){return Xj(t)||(nq(e),t&&t.response&&(t.response.data=Kj.call(e,e.transformResponse,t.response),t.response.headers=Wj.from(t.response.headers))),Promise.reject(t)}))}const aq=e=>e instanceof Wj?e.toJSON():e;function oq(e,t){t=t||{};const r={};function n(e,t,r){return vj.isPlainObject(e)&&vj.isPlainObject(t)?vj.merge.call({caseless:r},e,t):vj.isPlainObject(t)?vj.merge({},t):vj.isArray(t)?t.slice():t}function i(e,t,r){return vj.isUndefined(t)?vj.isUndefined(e)?void 0:n(void 0,e,r):n(e,t,r)}function a(e,t){if(!vj.isUndefined(t))return n(void 0,t)}function o(e,t){return vj.isUndefined(t)?vj.isUndefined(e)?void 0:n(void 0,e):n(void 0,t)}function s(r,i,a){return a in t?n(r,i):a in e?n(void 0,r):void 0}const u={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(aq(e),aq(t),!0)};return vj.forEach(Object.keys(Object.assign({},e,t)),(function(n){const a=u[n]||i,o=a(e[n],t[n],n);vj.isUndefined(o)&&a!==s||(r[n]=o)})),r}const sq="1.4.0",uq={};["object","boolean","number","function","string","symbol"].forEach(((e,t)=>{uq[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}}));const fq={};uq.transitional=function(e,t,r){function n(e,t){return"[Axios v1.4.0] Transitional option '"+e+"'"+t+(r?". "+r:"")}return(r,i,a)=>{if(!1===e)throw new wj(n(i," has been removed"+(t?" in "+t:"")),wj.ERR_DEPRECATED);return t&&!fq[i]&&(fq[i]=!0,console.warn(n(i," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(r,i,a)}};var cq={assertOptions:function(e,t,r){if("object"!=typeof e)throw new wj("options must be an object",wj.ERR_BAD_OPTION_VALUE);const n=Object.keys(e);let i=n.length;for(;i-- >0;){const a=n[i],o=t[a];if(o){const t=e[a],r=void 0===t||o(t,a,e);if(!0!==r)throw new wj("option "+a+" must be "+r,wj.ERR_BAD_OPTION_VALUE)}else if(!0!==r)throw new wj("Unknown option "+a,wj.ERR_BAD_OPTION)}},validators:uq};const lq=cq.validators;class dq{constructor(e){this.defaults=e,this.interceptors={request:new Pj,response:new Pj}}request(e,t){"string"==typeof e?(t=t||{}).url=e:t=e||{},t=oq(this.defaults,t);const{transitional:r,paramsSerializer:n,headers:i}=t;let a;void 0!==r&&cq.assertOptions(r,{silentJSONParsing:lq.transitional(lq.boolean),forcedJSONParsing:lq.transitional(lq.boolean),clarifyTimeoutError:lq.transitional(lq.boolean)},!1),null!=n&&(vj.isFunction(n)?t.paramsSerializer={serialize:n}:cq.assertOptions(n,{encode:lq.function,serialize:lq.function},!0)),t.method=(t.method||this.defaults.method||"get").toLowerCase(),a=i&&vj.merge(i.common,i[t.method]),a&&vj.forEach(["delete","get","head","post","put","patch","common"],(e=>{delete i[e]})),t.headers=Wj.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 u=[];let f;this.interceptors.response.forEach((function(e){u.push(e.fulfilled,e.rejected)}));let c,l=0;if(!s){const e=[iq.bind(this),void 0];for(e.unshift.apply(e,o),e.push.apply(e,u),c=e.length,f=Promise.resolve(t);l<c;)f=f.then(e[l++],e[l++]);return f}c=o.length;let d=t;for(l=0;l<c;){const e=o[l++],t=o[l++];try{d=e(d)}catch(e){t.call(this,e);break}}try{f=iq.call(this,d)}catch(e){return Promise.reject(e)}for(l=0,c=u.length;l<c;)f=f.then(u[l++],u[l++]);return f}getUri(e){return Nj(Yj((e=oq(this.defaults,e)).baseURL,e.url),e.params,e.paramsSerializer)}}vj.forEach(["delete","get","head","options"],(function(e){dq.prototype[e]=function(t,r){return this.request(oq(r||{},{method:e,url:t,data:(r||{}).data}))}})),vj.forEach(["post","put","patch"],(function(e){function t(t){return function(r,n,i){return this.request(oq(i||{},{method:e,headers:t?{"Content-Type":"multipart/form-data"}:{},url:r,data:n}))}}dq.prototype[e]=t(),dq.prototype[e+"Form"]=t(!0)}));var pq=dq;class hq{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 r=this;this.promise.then((e=>{if(!r._listeners)return;let t=r._listeners.length;for(;t-- >0;)r._listeners[t](e);r._listeners=null})),this.promise.then=e=>{let t;const n=new Promise((e=>{r.subscribe(e),t=e})).then(e);return n.cancel=function(){r.unsubscribe(t)},n},e((function(e,n,i){r.reason||(r.reason=new $j(e,n,i),t(r.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 hq((function(t){e=t}));return{token:t,cancel:e}}}var mq=hq;const yq={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(yq).forEach((([e,t])=>{yq[t]=e}));var bq=yq;const gq=function e(t){const r=new pq(t),n=qU(pq.prototype.request,r);return vj.extend(n,pq.prototype,r,{allOwnKeys:!0}),vj.extend(n,r,null,{allOwnKeys:!0}),n.create=function(r){return e(oq(t,r))},n}(Uj);gq.Axios=pq,gq.CanceledError=$j,gq.CancelToken=mq,gq.isCancel=Xj,gq.VERSION=sq,gq.toFormData=Oj,gq.AxiosError=wj,gq.Cancel=gq.CanceledError,gq.all=function(e){return Promise.all(e)},gq.spread=function(e){return function(t){return e.apply(null,t)}},gq.isAxiosError=function(e){return vj.isObject(e)&&!0===e.isAxiosError},gq.mergeConfig=oq,gq.AxiosHeaders=Wj,gq.formToJSON=e=>Dj(vj.isHTMLForm(e)?new FormData(e):e),gq.HttpStatusCode=bq,gq.default=gq;var vq=gq;const wq="https://guardian.sandbox.imtbl.com".replace(/\/+$/,"");class _q{basePath;axios;configuration;constructor(e,t=wq,r=vq){this.basePath=t,this.axios=r,e&&(this.configuration=e,this.basePath=e.basePath||this.basePath)}}class Eq extends Error{field;name="RequiredError";constructor(e,t){super(t),this.field=e}}const Tq="https://example.com",Aq=function(e,t,r){if(null==r)throw new Eq(t,`Required parameter ${t} was null or undefined when calling ${e}.`)},Sq=async function(e,t){if(t&&t.accessToken){const r="function"==typeof t.accessToken?await t.accessToken():await t.accessToken;e.Authorization="Bearer "+r}};function kq(e,t,r=""){"object"==typeof t?Array.isArray(t)?t.forEach((t=>kq(e,t,r))):Object.keys(t).forEach((n=>kq(e,t[n],`${r}${""!==r?".":""}${n}`))):e.has(r)?e.append(r,t):e.set(r,t)}const Oq=function(e,...t){const r=new URLSearchParams(e.search);kq(r,t),e.search=r.toString()},Rq=function(e,t,r){const n="string"!=typeof e;return(n&&r&&r.isJsonMime?r.isJsonMime(t.headers["Content-Type"]):n)?JSON.stringify(void 0!==e?e:{}):e||""},xq=function(e){return e.pathname+e.search+e.hash},Iq=function(e,t,r,n){return(i=t,a=r)=>{const o={...e.options,url:(n?.basePath||a)+e.url};return i.request(o)}},Cq=function(e){const t=function(e){return{approvePendingTransaction:async(t,r,n={})=>{Aq("approvePendingTransaction","payloadHash",t),Aq("approvePendingTransaction","transactionApprovalRequest",r);const i="/guardian/v1/transactions/{payloadHash}/approve".replace("{payloadHash}",encodeURIComponent(String(t))),a=new URL(i,Tq);let o;e&&(o=e.baseOptions);const s={method:"POST",...o,...n},u={};await Sq(u,e),u["Content-Type"]="application/json",Oq(a,{});let f=o&&o.headers?o.headers:{};return s.headers={...u,...f,...n.headers},s.data=Rq(r,s,e),{url:xq(a),options:s}},evaluateTransaction:async(t,r,n={})=>{Aq("evaluateTransaction","id",t),Aq("evaluateTransaction","transactionEvaluationRequest",r);const i="/guardian/v1/transactions/{id}/evaluate".replace("{id}",encodeURIComponent(String(t))),a=new URL(i,Tq);let o;e&&(o=e.baseOptions);const s={method:"POST",...o,...n},u={};await Sq(u,e),u["Content-Type"]="application/json",Oq(a,{});let f=o&&o.headers?o.headers:{};return s.headers={...u,...f,...n.headers},s.data=Rq(r,s,e),{url:xq(a),options:s}},getTransactionByID:async(t,r,n,i={})=>{Aq("getTransactionByID","transactionID",t),Aq("getTransactionByID","chainType",r);const a="/guardian/v1/transactions/{transactionID}".replace("{transactionID}",encodeURIComponent(String(t))),o=new URL(a,Tq);let s;e&&(s=e.baseOptions);const u={method:"GET",...s,...i},f={},c={};await Sq(f,e),void 0!==r&&(c.chainType=r),void 0!==n&&(c.chainID=n),Oq(o,c);let l=s&&s.headers?s.headers:{};return u.headers={...f,...l,...i.headers},{url:xq(o),options:u}}}}(e);return{async approvePendingTransaction(r,n,i){const a=await t.approvePendingTransaction(r,n,i);return Iq(a,vq,wq,e)},async evaluateTransaction(r,n,i){const a=await t.evaluateTransaction(r,n,i);return Iq(a,vq,wq,e)},async getTransactionByID(r,n,i,a){const o=await t.getTransactionByID(r,n,i,a);return Iq(o,vq,wq,e)}}};class Nq extends _q{approvePendingTransaction(e,t){return Cq(this.configuration).approvePendingTransaction(e.payloadHash,e.transactionApprovalRequest,t).then((e=>e(this.axios,this.basePath)))}evaluateTransaction(e,t){return Cq(this.configuration).evaluateTransaction(e.id,e.transactionEvaluationRequest,t).then((e=>e(this.axios,this.basePath)))}getTransactionByID(e,t){return Cq(this.configuration).getTransactionByID(e.transactionID,e.chainType,e.chainID,t).then((e=>e(this.axios,this.basePath)))}}class Pq{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())}}function Mq(e){const t=-1!==new di(e,16).cmp(new di(27))?new di(e,16).sub(new di(27)).toNumber():new di(e,16).toNumber();return e.trim()?t:void 0}async function Bq(e,t){const r=function(e,t=64){const r=Cb(e);return{r:new di(r.substring(0,t),"hex"),s:new di(r.substring(t,2*t),"hex"),recoveryParam:Mq(r.substring(2*t,2*t+2))}}(await t.signMessage(e));return Pb(xb((n=r).r.toString(16),64)+xb(n.s.toString(16),64)+xb(n.recoveryParam?.toString(16)||"",2));var n}function Dq(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 Fq={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 Lq(){return Lq=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Lq.apply(this,arguments)}var Uq;!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"}(Uq||(Uq={}));function jq(e,t){return function(...r){const n=Array.prototype.slice.call(r);return new Promise((async(r,i)=>{try{n.push(((e,t)=>e?i(e):r(t))),await e.apply(t,n)}catch(e){i(e)}}))}}new class{constructor(e){this.config=e,this.logLevel=void 0,this.configure(e)}configure(e){switch(this.config=Lq({},this.config,e),this.config.logLevel){case"DEBUG":this.logLevel=Uq.DEBUG;break;case"INFO":default:this.logLevel=Uq.INFO;break;case"WARN":this.logLevel=Uq.WARN;break;case"ERROR":this.logLevel=Uq.ERROR;break;case"DISABLED":this.logLevel=Uq.DISABLED}void 0===this.config.silence&&(this.config.silence=!1)}debug(e,...t){!0!==this.config.silence&&this.logLevel===Uq.DEBUG&&console.log(e,...t)}info(e,...t){!0!==this.config.silence&&this.logLevel<=Uq.INFO&&console.log(e,...t)}warn(e,...t){!0!==this.config.silence&&this.logLevel<=Uq.WARN&&(console.warn(e,...t),this.config.onwarn&&this.config.onwarn(e,t))}error(e,...t){!0!==this.config.silence&&this.logLevel<=Uq.ERROR&&(console.error(e,...t),this.config.onerror&&this.config.onerror(e,t))}}({logLevel:"INFO",silence:!0});const qq=(e=0,t=Number.MAX_SAFE_INTEGER)=>(e=Math.ceil(e),t=Math.floor(t),Math.floor(Math.random()*(t-e+1))+e);function zq(){return zq=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},zq.apply(this,arguments)}const Hq=(e,t=!1)=>(((e,t=!1,r=!1)=>{if(!e)throw new Error("invalid network config: empty config");const n=[];if(Array.isArray(e)?n.push(...e):n.push(e),0===n.length){if(t)throw new Error("invalid network config: empty config");return!1}const i=n.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}n.forEach((e=>e.name=e.name.toLowerCase()));const o=n.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 u=!1,f=!1;for(let e=0;e<n.length;e++){const i=n[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(!r&&!i.relayer){if(t)throw new Error(`invalid network config for chainId ${i.chainId}: relayer must be provided`);return!1}if(i.isDefaultChain){if(u){if(t)throw new Error(`invalid network config for chainId ${i.chainId}: DefaultChain is already set by another config`);return!1}u=!0}if(i.isAuthChain){if(f&&t)throw new Error(`invalid network config for chainId ${i.chainId}: AuthChain is already set by another config`);f=!0}}if(!u){if(t)throw new Error("invalid network config: DefaultChain must be set");return!1}if(!f){if(t)throw new Error("invalid network config: AuthChain must be set");return!1}})(e,!0,t),e),Vq=e=>Hq(Gq(e)),Gq=e=>{if(!e)return[];const t=e.sort(((e,t)=>e.chainId===t.chainId?0:e.chainId<t.chainId?-1:1)),r=t.findIndex((e=>e.isDefaultChain));r>0&&t.splice(0,0,t.splice(r,1)[0]);const n=t.findIndex((e=>e.isAuthChain&&!0!==e.isDefaultChain));return n>0&&t.splice(1,0,t.splice(n,1)[0]),t},Wq=(e,t)=>"string"==typeof e?(t=t||{},e.replace(/\$\{\s*([$#@\-\d\w]+)\s*\}/gim,(function(e,r){let n=t[r];return n="function"==typeof n?n():null==n?"":"object"==typeof n||"symbol"==typeof n?n.toString():n.valueOf(),n}))):"";let Kq;!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"}(Kq||(Kq={}));const Xq=e=>Wq("https://${network}-indexer.sequence.app",{network:e}),$q=e=>Wq("https://${network}-relayer.sequence.app",{network:e}),Jq=e=>Wq("https://nodes.sequence.app/${network}",{network:e}),Yq={[Kq.MAINNET]:{chainId:Kq.MAINNET,name:"mainnet",title:"Ethereum",blockExplorer:{name:"Etherscan",rootUrl:"https://etherscan.io/"},ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e"},[Kq.ROPSTEN]:{chainId:Kq.ROPSTEN,name:"ropsten",title:"Ropsten",testnet:!0,blockExplorer:{name:"Etherscan (Ropsten)",rootUrl:"https://ropsten.etherscan.io/"},ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e"},[Kq.RINKEBY]:{chainId:Kq.RINKEBY,name:"rinkeby",title:"Rinkeby",testnet:!0,blockExplorer:{name:"Etherscan (Rinkeby)",rootUrl:"https://rinkeby.etherscan.io/"},ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",disabled:!0},[Kq.GOERLI]:{chainId:Kq.GOERLI,name:"goerli",title:"Goerli",testnet:!0,blockExplorer:{name:"Etherscan (Goerli)",rootUrl:"https://goerli.etherscan.io/"},ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e"},[Kq.KOVAN]:{chainId:Kq.KOVAN,name:"kovan",title:"Kovan",testnet:!0,blockExplorer:{name:"Etherscan (Kovan)",rootUrl:"https://kovan.etherscan.io/"}},[Kq.POLYGON]:{chainId:Kq.POLYGON,name:"polygon",title:"Polygon",blockExplorer:{name:"Polygonscan",rootUrl:"https://polygonscan.com/"}},[Kq.POLYGON_MUMBAI]:{chainId:Kq.POLYGON_MUMBAI,name:"mumbai",title:"Polygon Mumbai",testnet:!0,blockExplorer:{name:"Polygonscan (Mumbai)",rootUrl:"https://mumbai.polygonscan.com/"}},[Kq.POLYGON_ZKEVM]:{chainId:Kq.POLYGON_ZKEVM,name:"polygon-zkevm",title:"Polygon zkEVM",blockExplorer:{name:"Polygonscan (zkEVM)",rootUrl:"https://zkevm.polygonscan.com/"}},[Kq.BSC]:{chainId:Kq.BSC,name:"bsc",title:"BNB Smart Chain",blockExplorer:{name:"BSCScan",rootUrl:"https://bscscan.com/"}},[Kq.BSC_TESTNET]:{chainId:Kq.BSC_TESTNET,name:"bsc-testnet",title:"BNB Smart Chain Testnet",testnet:!0,blockExplorer:{name:"BSCScan (Testnet)",rootUrl:"https://testnet.bscscan.com/"}},[Kq.OPTIMISM]:{chainId:Kq.OPTIMISM,name:"optimism",title:"Optimism",blockExplorer:{name:"Etherscan (Optimism)",rootUrl:"https://optimistic.etherscan.io/"}},[Kq.OPTIMISM_TESTNET]:{chainId:Kq.OPTIMISM_TESTNET,name:"optimism-testnet",title:"Optimistic Kovan",testnet:!0,blockExplorer:{name:"Etherscan (Optimism Testnet)",rootUrl:"https://kovan-optimistic.etherscan.io/"}},[Kq.ARBITRUM]:{chainId:Kq.ARBITRUM,name:"arbitrum",title:"Arbitrum One",blockExplorer:{name:"Arbiscan",rootUrl:"https://arbiscan.io/"}},[Kq.ARBITRUM_GOERLI]:{chainId:Kq.ARBITRUM_GOERLI,name:"arbitrum-goerli",title:"Arbitrum Goerli",testnet:!0,blockExplorer:{name:"Arbiscan (Testnet)",rootUrl:"https://testnet.arbiscan.io/"}},[Kq.ARBITRUM_NOVA]:{chainId:Kq.ARBITRUM_NOVA,name:"arbitrum-nova",title:"Arbitrum Nova",blockExplorer:{name:"Nova Explorer",rootUrl:"https://nova-explorer.arbitrum.io/"}},[Kq.AVALANCHE]:{chainId:Kq.AVALANCHE,name:"avalanche",title:"Avalanche",blockExplorer:{name:"Snowtrace",rootUrl:"https://snowtrace.io/"}},[Kq.AVALANCHE_TESTNET]:{chainId:Kq.AVALANCHE_TESTNET,name:"avalanche-testnet",title:"Avalanche Testnet",testnet:!0,blockExplorer:{name:"Snowtrace (Testnet)",rootUrl:"https://testnet.snowtrace.io/"}},[Kq.FANTOM]:{chainId:Kq.FANTOM,name:"fantom",title:"Fantom",blockExplorer:{name:"FTMScan",rootUrl:"https://ftmscan.com/"}},[Kq.FANTOM_TESTNET]:{chainId:Kq.FANTOM_TESTNET,name:"fantom-testnet",title:"Fantom Testnet",testnet:!0,blockExplorer:{name:"FTMScan (Testnet)",rootUrl:"https://testnet.ftmscan.com/"}},[Kq.GNOSIS]:{chainId:Kq.GNOSIS,name:"gnosis",title:"Gnosis Chain",blockExplorer:{name:"Gnosis Chain Explorer",rootUrl:"https://blockscout.com/xdai/mainnet/"}},[Kq.AURORA]:{chainId:Kq.AURORA,name:"aurora",title:"Aurora",blockExplorer:{name:"Aurora Explorer",rootUrl:"https://aurorascan.dev/"}},[Kq.AURORA_TESTNET]:{chainId:Kq.AURORA_TESTNET,name:"aurora-testnet",title:"Aurora Testnet",blockExplorer:{name:"Aurora Explorer (Testnet)",rootUrl:"https://testnet.aurorascan.dev/"}},[Kq.BASE_GOERLI]:{chainId:Kq.BASE_GOERLI,name:"base-goerli",title:"Base Goerli",blockExplorer:{name:"Base Goerli Explorer",rootUrl:"https://goerli.basescan.org/"}}};Vq([zq({},Yq[Kq.MAINNET],{rpcUrl:Jq("mainnet"),relayer:{url:$q("mainnet")},indexerUrl:Xq("mainnet")}),zq({},Yq[Kq.POLYGON],{rpcUrl:Jq("polygon"),relayer:{url:$q("polygon")},indexerUrl:Xq("polygon"),isDefaultChain:!0,isAuthChain:!0}),zq({},Yq[Kq.BSC],{rpcUrl:Jq("bsc"),indexerUrl:Xq("bsc"),relayer:{url:$q("bsc")}}),zq({},Yq[Kq.AVALANCHE],{rpcUrl:Jq("avalanche"),indexerUrl:Xq("avalanche"),relayer:{url:$q("avalanche")}}),zq({},Yq[Kq.ARBITRUM],{rpcUrl:Jq("arbitrum"),indexerUrl:Xq("arbitrum"),relayer:{url:$q("arbitrum")}}),zq({},Yq[Kq.ARBITRUM_NOVA],{rpcUrl:Jq("arbitrum-nova"),indexerUrl:Xq("arbitrum-nova"),relayer:{url:$q("arbitrum-nova")}}),zq({},Yq[Kq.OPTIMISM],{rpcUrl:Jq("optimism"),indexerUrl:Xq("optimism"),relayer:{url:$q("optimism")}}),zq({},Yq[Kq.POLYGON_ZKEVM],{rpcUrl:Jq("polygon-zkevm"),indexerUrl:Xq("polygon-zkevm"),relayer:{url:$q("polygon-zkevm")}}),zq({},Yq[Kq.GNOSIS],{rpcUrl:Jq("gnosis"),indexerUrl:Xq("gnosis"),relayer:{url:$q("gnosis")}})]),Vq([zq({},Yq[Kq.RINKEBY],{rpcUrl:Jq("rinkeby"),relayer:{url:$q("rinkeby")},indexerUrl:Xq("rinkeby")}),zq({},Yq[Kq.GOERLI],{rpcUrl:Jq("goerli"),relayer:{url:$q("goerli")},indexerUrl:Xq("goerli")}),zq({},Yq[Kq.POLYGON_MUMBAI],{rpcUrl:Jq("mumbai"),relayer:{url:$q("mumbai")},indexerUrl:Xq("mumbai"),isDefaultChain:!0,isAuthChain:!0}),zq({},Yq[Kq.BSC_TESTNET],{rpcUrl:Jq("bsc-testnet"),relayer:{url:$q("bsc-testnet")},indexerUrl:Xq("bsc-testnet")}),zq({},Yq[Kq.ARBITRUM_GOERLI],{rpcUrl:Jq("arbitrum-goerli"),relayer:{url:$q("arbitrum-goerli")},indexerUrl:Xq("arbitrum-goerli")}),zq({},Yq[Kq.BASE_GOERLI],{rpcUrl:Jq("base-goerli"),relayer:{url:$q("base-goerli")},indexerUrl:Xq("base-goerli")})]);const Qq="2.0";function Zq(){return Zq=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},Zq.apply(this,arguments)}let ez;function tz(e,t){return e.reduce((function(e,r,n){return t(r,n)?e[0].push(r):e[1].push(r),e}),[[],[]])}!function(e){e.ethCall="eth_call",e.ethGetBalance="eth_getBalance",e.ethGetCode="eth_getCode"}(ez||(ez={}));const rz={batchSize:50,timeWindow:50,contract:"0xd130B43062D875a4B7aF3f8fc036Bc6e9D3E1B3E",verbose:!1};let nz=class e{constructor(t){var r=this;if(this.batchableJsonRpcMethods=[ez.ethCall,ez.ethGetCode,ez.ethGetBalance],this.multicallInterface=new Bu(Fq.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,r)=>this.batchableJsonRpcMethods.find((e=>e===t.method))?(this.queue.push({request:t,callback:r,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,r)),this.run=async function(){r.options.verbose&&console.log("Processing multicall");const e=Math.min(r.options.batchSize,r.queue.length);if(0===e)return;if(1===e)return r.forward(r.queue[0]),r.queue=[],void(r.options.verbose&&console.log("Skip multicall, single item"));r.options.verbose&&console.log("Resolving",e);var t=r.queue.slice(0,e);r.queue=e===r.queue.length?[]:r.queue.slice(e),r.options.verbose&&console.log("Updated queue",r.queue.length),0!==r.queue.length&&r.scheduleExecution();const n=t[0].next;let i;var[t,a]=tz(t,(e=>{try{if(e.next!==n)return!1;switch(e.request.method){case ez.ethCall:if(e.request.params[0].from||e.request.params[0].gasPrice||e.request.params[0].value)return!1;case ez.ethGetBalance:case ez.ethGetCode:const t=function(e){if(void 0===e)return"latest";switch(e){case"earliest":case"latest":case"pending":return e}return Qi.from(e)}(e.request.params[1]);if(void 0===i&&(i=t),!function(e,t){return e===t||(Qi.isBigNumber(e)?!!Qi.isBigNumber(t)&&e.eq(t):!Qi.isBigNumber(t)&&e===t)}(t,i))return!1}return!0}catch(e){return!1}}));if(0!==a.length&&(r.options.verbose&&console.log("Forwarding incompatible calls",a.length),r.forward(a),0===t.length))return;let o=t.map((e=>{try{switch(e.request.method){case ez.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 ez.ethGetCode:return{delegateCall:!1,revertOnError:!1,target:r.options.contract,gasLimit:0,value:0,data:r.multicallInterface.encodeFunctionData(r.multicallInterface.getFunction("callCode"),[e.request.params[0]])};case ez.ethGetBalance:return{delegateCall:!1,revertOnError:!1,target:r.options.contract,gasLimit:0,value:0,data:r.multicallInterface.encodeFunctionData(r.multicallInterface.getFunction("callBalanceOf"),[e.request.params[0]])};default:return null}}catch(e){return null}}));var[t,a]=tz(t,((e,t)=>void 0!==o[t]));if(o=o.filter((e=>e)),0!==a.length&&(r.options.verbose&&console.log("Forwarding calls on error",a.length),r.forward(a),0===t.length))return;let s;try{s=r.multicallInterface.encodeFunctionData(r.multicallInterface.getFunction("multiCall"),[o])}catch(e){return void r.forward(t)}const u=qq(),f=await async function(e,t){try{return await e}catch(e){return t instanceof Function?t(e):t}}(jq(n)({id:u,jsonrpc:Qq,method:ez.ethCall,params:[{to:r.options.contract,value:0,data:s},Qi.isBigNumber(i)?i.toNumber():i]}),(e=>({jsonrpc:Qq,id:u,result:void 0,error:e})));if(f.error)return r.forward(t);let c;try{c=r.multicallInterface.decodeFunctionResult(r.multicallInterface.getFunction("multiCall"),f.result)}catch(e){return void r.forward(t)}r.options.verbose&&console.log("Got response for",t.length),t.forEach(((e,t)=>{if(c[0][t])switch(e.request.method){case ez.ethCall:e.callback(void 0,{jsonrpc:e.request.jsonrpc,id:e.request.id,result:c[1][t]});break;case ez.ethGetCode:e.callback(void 0,{jsonrpc:e.request.jsonrpc,id:e.request.id,result:xs.decode(["bytes"],c[1][t])[0]});break;case ez.ethGetBalance:e.callback(void 0,{jsonrpc:e.request.jsonrpc,id:e.request.id,result:xs.decode(["uint256"],c[1][t])[0]})}else r.forward(e)}))},this.options=t?Zq({},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}};nz.DefaultOptions=Zq({},rz);const iz=["getNetwork","getBlockNumber","getGasPrice","getTransactionCount","getStorageAt","sendTransaction","estimateGas","getBlock","getTransaction","getTransactionReceipt","getLogs","emit","litenerCount","addListener","removeListener","waitForTransaction","detectNetwork","getBlockWithTransactions"];var az=Object.freeze({__proto__:null,ProxyMethods:iz,MulticallProvider:class extends Kh{constructor(e,t){var r;super(e.getNetwork()),r=this,this.provider=e,this.multicall=void 0,this.listenerCount=this.provider.listenerCount,this.getResolver=async function(e){const t=r.provider;if(t.getResolver){const n=await t.getResolver(await e);return n?new Vh(r,n.address,n.name):null}return t.getResolver(await e)},this.next=async function(e,t){try{switch(e.method){case ez.ethCall:r.callback(e,t,await r.provider.call(e.params[0],e.params[1]));break;case ez.ethGetCode:r.callback(e,t,await r.provider.getCode(e.params[0],e.params[1]));break;case ez.ethGetBalance:r.callback(e,t,await r.provider.getBalance(e.params[0],e.params[1]))}}catch(n){r.callback(e,t,void 0,n)}},this.multicall=nz.isMulticall(t)?t:new nz(t),iz.forEach((t=>{void 0!==e[t]&&(this[t]=(...r)=>e[t](...r))}))}callback(e,t,r,n){t(n,{jsonrpc:Qq,id:e.id,result:r,error:n})}async call(e,t){return this.rpcCall(ez.ethCall,e,t)}async getCode(e,t){return this.rpcCall(ez.ethGetCode,e,t)}async getBalance(e,t){return this.rpcCall(ez.ethGetBalance,e,t)}async rpcCall(e,...t){const r=qq();return(await jq(this.multicall.handle)(this.next,{jsonrpc:Qq,id:r,method:e,params:t})).result}},MulticallExternalProvider:class{constructor(e,t){if(this.provider=e,this.multicall=void 0,this.multicall=nz.isMulticall(t)?t:new nz(t),e.send){const t=async function(t,r){e.send(t,r)};this.send=(e,r)=>{this.multicall.handle(t,e,r)}}if(e.sendAsync){const t=async function(t,r){e.sendAsync(t,r)};this.sendAsync=(e,r)=>{this.multicall.handle(t,e,r)}}}get isMetaMask(){return this.provider.isMetaMask}get isStatus(){return this.provider.isStatus}},multicallMiddleware:e=>t=>{const r=nz.isMulticall(e)?e:new nz(e);return(e,n)=>r.handle(t,e,n)}}),oz=Object.freeze({__proto__:null,Multicall:nz,providers:az});let sz,uz;try{sz=localStorage}catch(e){const t=new Map;sz={getItem:e=>{var r;return null!=(r=t.get(e))?r:null},setItem:(e,r)=>t.set(e,r),removeItem:e=>t.delete(e)}}function fz(e){return void 0!==e.address&&!function(e){return cz(e)||lz(e)||dz(e)}(e)}function cz(e){const t=e;return void 0!==t.signature&&void 0===t.address}function lz(e){const t=e;return void 0!==t.r&&void 0!==t.s&&void 0!==t.v&&void 0!==t.t}function dz(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"}(uz||(uz={}));const pz=e=>{if("string"==typeof e)return pz((e=>{if("string"!=typeof e)return e;const t=e.replace("0x",""),r=Qi.from(`0x${t.slice(0,4)}`).toNumber(),n=[];for(let e=4;e<t.length;){const r=Qi.from(t.slice(e,e+2)).toNumber();e+=2;const i=Qi.from(`0x${t.slice(e,e+2)}`).toNumber();switch(e+=2,r){case uz.Address:const r=Eo(t.slice(e,e+40));e+=40,n.push({weight:i,address:r});break;case uz.EOA:const a=Ii(`0x${t.slice(e,e+132)}`);e+=132;const o=Hi(a.slice(0,65)),s=o.r,u=o.s,f=o.v,c=Qi.from(a[a.length-1]).toNumber();n.push({weight:i,signature:a,r:s,s:u,v:f,t:c});break;case uz.Full:const l=Eo(t.slice(e,e+40));e+=40;const d=Qi.from(`0x${t.slice(e,e+4)}`).mul(2).toNumber();e+=4;const p=Ii(`0x${t.slice(e,e+d)}`);e+=d,n.push({weight:i,address:l,signature:p});break;default:throw Error("Signature type not supported")}}return{threshold:r,signers:n}})(e));const t=e.signers.map((e=>{if(fz(e))return gy(["uint8","uint8","address"],[uz.Address,e.weight,e.address]);if(lz(e))return gy(["uint8","uint8","bytes32","bytes32","uint8","uint8"],[uz.EOA,e.weight,e.r,e.s,e.v,e.t]);if(dz(e)){const t=Ii(e.signature).length;return gy(["uint8","uint8","address","uint16","bytes"],[uz.Full,e.weight,e.address,t,e.signature])}if(cz(e))return gy(["uint8","uint8","bytes"],[uz.EOA,e.weight,e.signature]);throw Error("Unkwnown signature part type")}));return gy(["uint16",...Array(t.length).fill("bytes")],[e.threshold,...t])};var hz;!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"}(hz||(hz={}));class mz extends Error{type;constructor(e,t){super(e),this.type=t}}const yz=async(e,t)=>{try{return await e()}catch(e){const r=`${t}: ${e.message}`||"UnknownError";throw new mz(r,t)}},bz="passport_credentials";class gz{saveCredentials(e){localStorage.setItem(bz,JSON.stringify(e))}getCredentials(){const e=localStorage.getItem(bz);return e?JSON.parse(e):null}areValid(e){if(e){const t=this.isTokenValid(e.access_token),r=this.isTokenValid(e.id_token);return t&&r}return!1}isTokenValid(e){return(ZB(e).exp??0)>Date.now()/1e3+3600}clearCredentials(){localStorage.removeItem(bz)}}const vz={headers:{"Content-Type":"application/x-www-form-urlencoded"}};function wz(e){return new Promise((t=>{setTimeout(t,e)}))}class _z{userManager;config;deviceCredentialsManager;logoutMode;constructor(e){this.config=e,this.userManager=new class{constructor(e){this._logger=new aD("UserManager"),this.settings=new PD(e),this._client=new class{constructor(e){this._logger=new aD("OidcClient"),this.settings=new gD(e),this.metadataService=new class{constructor(e){this._settings=e,this._logger=new aD("MetadataService"),this._signingKeys=null,this._metadata=null,this._metadataUrl=this._settings.metadataUrl,this._jsonService=new yD(["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 r=this._logger.create(`_getMetadataProperty('${e}')`),n=await this.getMetadata();if(r.debug("resolved"),void 0===n[e]){if(!0===t)return void r.warn("Metadata does not contain optional property");r.throw(new Error("Metadata does not contain property "+e))}return n[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 r=await this._jsonService.getJson(t);if(e.debug("got key set",r),!Array.isArray(r.keys))throw e.throw(new Error("Missing keys on keyset")),null;return this._signingKeys=r.keys,this._signingKeys}}(this.settings),this._claimsService=new class{constructor(e){this._settings=e,this._logger=new aD("ClaimsService")}filterProtocolClaims(e){const t={...e};if(this._settings.filterProtocolClaims){let e;e=Array.isArray(this._settings.filterProtocolClaims)?this._settings.filterProtocolClaims:TD;for(const r of e)AD.includes(r)||delete t[r]}return t}mergeClaims(e,t){const r={...e};for(const[e,n]of Object.entries(t))for(const t of Array.isArray(n)?n:[n]){const n=r[e];n?Array.isArray(n)?n.includes(t)||n.push(t):r[e]!==t&&("object"==typeof t&&this._settings.mergeClaims?r[e]=this.mergeClaims(n,t):r[e]=[n,t]):r[e]=t}return r}}(this.settings),this._validator=new class{constructor(e,t,r){this._settings=e,this._metadataService=t,this._claimsService=r,this._logger=new aD("ResponseValidator"),this._userInfoService=new class{constructor(e,t){this._settings=e,this._metadataService=t,this._logger=new aD("UserInfoService"),this._getClaimsFromJwt=async e=>{const t=this._logger.create("_getClaimsFromJwt");try{const r=uD.decode(e);return t.debug("JWT decoding successful"),r}catch(e){throw t.error("Error parsing JWT response"),e}},this._jsonService=new yD(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 r=await this._metadataService.getUserInfoEndpoint();t.debug("got userinfo url",r);const n=await this._jsonService.getJson(r,{token:e,credentials:this._settings.fetchRequestCredentials});return t.debug("got claims",n),n}}(this._settings,this._metadataService),this._tokenClient=new vD(this._settings,this._metadataService)}async validateSigninResponse(e,t){const r=this._logger.create("validateSigninResponse");this._processSigninState(e,t),r.debug("state processed"),await this._processCode(e,t),r.debug("code processed"),e.isOpenId&&this._validateIdTokenAttributes(e),r.debug("tokens validated"),await this._processClaims(e,null==t?void 0:t.skipUserInfo,e.isOpenId),r.debug("claims processed")}async validateCredentialsResponse(e,t){const r=this._logger.create("validateCredentialsResponse");e.isOpenId&&this._validateIdTokenAttributes(e),r.debug("tokens validated"),await this._processClaims(e,t,e.isOpenId),r.debug("claims processed")}async validateRefreshResponse(e,t){const r=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),r.debug("ID Token validated")),e.id_token||(e.id_token=t.id_token,e.profile=t.profile);const n=e.isOpenId&&!!e.id_token;await this._processClaims(e,!1,n),r.debug("claims processed")}validateSignoutResponse(e,t){const r=this._logger.create("validateSignoutResponse");if(t.id!==e.state&&r.throw(new Error("State does not match")),r.debug("state validated"),e.userState=t.data,e.error)throw r.warn("Response was error",e.error),new dD(e)}_processSigninState(e,t){const r=this._logger.create("_processSigninState");if(t.id!==e.state&&r.throw(new Error("State does not match")),t.client_id||r.throw(new Error("No client_id on state")),t.authority||r.throw(new Error("No authority on state")),this._settings.authority!==t.authority&&r.throw(new Error("authority mismatch on settings vs. signin state")),this._settings.client_id&&this._settings.client_id!==t.client_id&&r.throw(new Error("client_id mismatch on settings vs. signin state")),r.debug("state validated"),e.userState=t.data,null!=e.scope||(e.scope=t.scope),e.error)throw r.warn("Response was error",e.error),new dD(e);t.code_verifier&&!e.code&&r.throw(new Error("Expected code in response"))}async _processClaims(e,t=!1,r=!0){const n=this._logger.create("_processClaims");if(e.profile=this._claimsService.filterProtocolClaims(e.profile),t||!this._settings.loadUserInfo||!e.access_token)return void n.debug("not loading user info");n.debug("loading user info");const i=await this._userInfoService.getClaims(e.access_token);n.debug("user info claims received from user info endpoint"),r&&i.sub!==e.profile.sub&&n.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)),n.debug("user info claims received, updated profile:",e.profile)}async _processCode(e,t){const r=this._logger.create("_processCode");if(e.code){r.debug("Validating code");const n=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,n)}else r.debug("No code to process")}_validateIdTokenAttributes(e,t){var r;const n=this._logger.create("_validateIdTokenAttributes");n.debug("decoding ID Token JWT");const i=uD.decode(null!=(r=e.id_token)?r:"");if(i.sub||n.throw(new Error("ID Token is missing a subject claim")),t){const e=uD.decode(t);i.sub!==e.sub&&n.throw(new Error("sub in id_token does not match current sub")),i.auth_time&&i.auth_time!==e.auth_time&&n.throw(new Error("auth_time in id_token does not match original auth_time")),i.azp&&i.azp!==e.azp&&n.throw(new Error("azp in id_token does not match original azp")),!i.azp&&e.azp&&n.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 vD(this.settings,this.metadataService)}async createSigninRequest({state:e,request:t,request_uri:r,request_type:n,id_token_hint:i,login_hint:a,skipUserInfo:o,nonce:s,response_type:u=this.settings.response_type,scope:f=this.settings.scope,redirect_uri:c=this.settings.redirect_uri,prompt:l=this.settings.prompt,display:d=this.settings.display,max_age:p=this.settings.max_age,ui_locales:h=this.settings.ui_locales,acr_values:m=this.settings.acr_values,resource:y=this.settings.resource,response_mode:b=this.settings.response_mode,extraQueryParams:g=this.settings.extraQueryParams,extraTokenParams:v=this.settings.extraTokenParams}){const w=this._logger.create("createSigninRequest");if("code"!==u)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:r,redirect_uri:n,response_type:i,scope:a,state_data:o,response_mode:s,request_type:u,client_secret:f,nonce:c,resource:l,skipUserInfo:d,extraQueryParams:p,extraTokenParams:h,disablePKCE:m,...y}){if(this._logger=new aD("SigninRequest"),!e)throw this._logger.error("ctor: No url passed"),new Error("url");if(!r)throw this._logger.error("ctor: No client_id passed"),new Error("client_id");if(!n)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 _D({data:o,request_type:u,code_verifier:!m,client_id:r,authority:t,redirect_uri:n,response_mode:s,client_secret:f,scope:a,extraTokenParams:h,skipUserInfo:d});const b=new URL(e);b.searchParams.append("client_id",r),b.searchParams.append("redirect_uri",n),b.searchParams.append("response_type",i),b.searchParams.append("scope",a),c&&b.searchParams.append("nonce",c),b.searchParams.append("state",this.state.id),this.state.code_challenge&&(b.searchParams.append("code_challenge",this.state.code_challenge),b.searchParams.append("code_challenge_method","S256")),l&&(Array.isArray(l)?l:[l]).forEach((e=>b.searchParams.append("resource",e)));for(const[e,t]of Object.entries({response_mode:s,...y,...p}))null!=t&&b.searchParams.append(e,t.toString());this.url=b.href}}({url:_,authority:this.settings.authority,client_id:this.settings.client_id,redirect_uri:c,response_type:u,scope:f,state_data:e,prompt:l,display:d,max_age:p,ui_locales:h,id_token_hint:i,login_hint:a,acr_values:m,resource:y,request:t,request_uri:r,extraQueryParams:g,extraTokenParams:v,request_type:n,response_mode:b,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 r=this._logger.create("readSigninResponseState"),n=new ED(lD.readParams(e,this.settings.response_mode));if(!n.state)throw r.throw(new Error("No state in response")),null;const i=await this.settings.stateStore[t?"remove":"get"](n.state);if(!i)throw r.throw(new Error("No matching state found in storage")),null;return{state:_D.fromStorageString(i),response:n}}async processSigninResponse(e){const t=this._logger.create("processSigninResponse"),{state:r,response:n}=await this.readSigninResponseState(e,!0);return t.debug("received state from storage; validating response"),await this._validator.validateSigninResponse(n,r),n}async processResourceOwnerPasswordCredentials({username:e,password:t,skipUserInfo:r=!1,extraTokenParams:n={}}){const i=await this._tokenClient.exchangeCredentials({username:e,password:t,...n}),a=new ED(new URLSearchParams);return Object.assign(a,i),await this._validator.validateCredentialsResponse(a,r),a}async useRefreshToken({state:e,timeoutInSeconds:t}){var r;const n=this._logger.create("useRefreshToken");let i;if(void 0===this.settings.refreshTokenAllowedScope)i=e.scope;else{const t=this.settings.refreshTokenAllowedScope.split(" ");i=((null==(r=e.scope)?void 0:r.split(" "))||[]).filter((e=>t.includes(e))).join(" ")}const a=await this._tokenClient.exchangeRefreshToken({refresh_token:e.refresh_token,scope:i,timeoutInSeconds:t}),o=new ED(new URLSearchParams);return Object.assign(o,a),n.debug("validating response",o),await this._validator.validateRefreshResponse(o,{...e,scope:i}),o}async createSignoutRequest({state:e,id_token_hint:t,request_type:r,post_logout_redirect_uri:n=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:r,post_logout_redirect_uri:n,extraQueryParams:i,request_type:a}){if(this._logger=new aD("SignoutRequest"),!e)throw this._logger.error("ctor: No url passed"),new Error("url");const o=new URL(e);r&&o.searchParams.append("id_token_hint",r),n&&(o.searchParams.append("post_logout_redirect_uri",n),t&&(this.state=new wD({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:n,state_data:e,extraQueryParams:i,request_type:r});await this.clearStaleState();const u=s.state;return u&&(a.debug("Signout request has state to persist"),await this.settings.stateStore.set(u.id,u.toStorageString())),s}async readSignoutResponseState(e,t=!1){const r=this._logger.create("readSignoutResponseState"),n=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")}}(lD.readParams(e,this.settings.response_mode));if(!n.state){if(r.debug("No state in response"),n.error)throw r.warn("Response was error:",n.error),new dD(n);return{state:void 0,response:n}}const i=await this.settings.stateStore[t?"remove":"get"](n.state);if(!i)throw r.throw(new Error("No matching state found in storage")),null;return{state:wD.fromStorageString(i),response:n}}async processSignoutResponse(e){const t=this._logger.create("processSignoutResponse"),{state:r,response:n}=await this.readSignoutResponseState(e,!0);return r?(t.debug("Received state from storage; validating response"),this._validator.validateSignoutResponse(n,r)):t.debug("No state from storage; skipping response validation"),n}clearStaleState(){return this._logger.create("clearStaleState"),wD.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 aD("RedirectNavigator")}async prepare({redirectMethod:e=this._settings.redirectMethod,redirectTarget:t=this._settings.redirectTarget}){var r;this._logger.create("prepare");let n=window.self;"top"===t&&(n=null!=(r=window.top)?r:window.self);const i=n.location[e].bind(n.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")),n.stop()}}}}(this.settings),this._popupNavigator=new class{constructor(e){this._settings=e,this._logger=new aD("PopupNavigator")}async prepare({popupWindowFeatures:e=this._settings.popupWindowFeatures,popupWindowTarget:t=this._settings.popupWindowTarget}){return new BD({popupWindowFeatures:e,popupWindowTarget:t})}async callback(e,t=!1){this._logger.create("callback"),BD.notifyOpener(e,t)}}(this.settings),this._iframeNavigator=new class{constructor(e){this._settings=e,this._logger=new aD("IFrameNavigator")}async prepare({silentRequestTimeoutInSeconds:e=this._settings.silentRequestTimeoutInSeconds}){return new MD({silentRequestTimeoutInSeconds:e})}async callback(e){this._logger.create("callback"),MD.notifyParent(e,this._settings.iframeNotifyParentOrigin)}}(this.settings),this._events=new DD(this.settings),this._silentRenewService=new class{constructor(e){this._userManager=e,this._logger=new aD("SilentRenewService"),this._isStarted=!1,this._retryTimer=new cD("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 pD)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 aD("SessionMonitor"),this._start=async e=>{const t=e.session_state;if(!t)return;const r=this._logger.create("_start");if(e.profile?(this._sub=e.profile.sub,this._sid=e.profile.sid,r.debug("session_state",t,", sub",this._sub)):(this._sub=void 0,this._sid=void 0,r.debug("session_state",t,", anonymous user")),this._checkSessionIFrame)this._checkSessionIFrame.start(t);else try{const e=await this._userManager.metadataService.getCheckSessionIframe();if(e){r.debug("initializing check session iframe");const n=this._userManager.settings.client_id,i=this._userManager.settings.checkSessionIntervalInSeconds,a=this._userManager.settings.stopCheckSessionOnError,o=new class{constructor(e,t,r,n,i){this._callback=e,this._client_id=t,this._intervalInSeconds=n,this._stopOnError=i,this._logger=new aD("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(r);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,n,e,i,a);await o.load(),this._checkSessionIFrame=o,o.start(t)}else r.warn("no check session iframe found in the metadata")}catch(e){r.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 r=!0;t&&this._checkSessionIFrame?t.sub===this._sub?(r=!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"),r?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,...r}=e,n=await this._redirectNavigator.prepare({redirectMethod:t});await this._signinStart({request_type:"si:r",...r},n)}async signinRedirectCallback(e=window.location.href){const t=this._logger.create("signinRedirectCallback"),r=await this._signinEnd(e);return r.profile&&r.profile.sub?t.info("success, signed in subject",r.profile.sub):t.info("no subject"),r}async signinResourceOwnerCredentials({username:e,password:t,skipUserInfo:r=!1}){const n=this._logger.create("signinResourceOwnerCredential"),i=await this._client.processResourceOwnerPasswordCredentials({username:e,password:t,skipUserInfo:r,extraTokenParams:this.settings.extraTokenParams});n.debug("got signin response");const a=await this._buildUser(i);return a.profile&&a.profile.sub?n.info("success, signed in subject",a.profile.sub):n.info("no subject"),a}async signinPopup(e={}){const t=this._logger.create("signinPopup"),{popupWindowFeatures:r,popupWindowTarget:n,...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:r,popupWindowTarget:n}),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 r=this._logger.create("signinPopupCallback");await this._popupNavigator.callback(e,t),r.info("success")}async signinSilent(e={}){var t;const r=this._logger.create("signinSilent"),{silentRequestTimeoutInSeconds:n,...i}=e;let a=await this._loadUser();if(null==a?void 0:a.refresh_token){r.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||r.throw(new Error("No silent_redirect_uri configured")),a&&this.settings.validateSubOnSilentRenew&&(r.debug("subject prior to silent renew:",a.profile.sub),s=a.profile.sub);const u=await this._iframeNavigator.prepare({silentRequestTimeoutInSeconds:n});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},u,s),a&&((null==(t=a.profile)?void 0:t.sub)?r.info("success, signed in subject",a.profile.sub):r.info("no subject")),a}async _useRefreshToken(e){const t=await this._client.useRefreshToken({state:e,timeoutInSeconds:this.settings.silentRequestTimeoutInSeconds}),r=new SD({...e,...t});return await this.storeUser(r),this._events.load(r),r}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:r}=await this._client.readSignoutResponseState(e);if(r)switch(r.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:r,...n}=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:r}),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,...n},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 dD)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,r){const n=await this._signinStart(e,t);return await this._signinEnd(n.url,r)}async _signinStart(e,t){const r=this._logger.create("_signinStart");try{const n=await this._client.createSigninRequest(e);return r.debug("got signin request"),await t.navigate({url:n.url,state:n.state.id,response_mode:n.state.response_mode,scriptOrigin:this.settings.iframeScriptOrigin})}catch(e){throw r.debug("error after preparing navigator, closing navigator window"),t.close(),e}}async _signinEnd(e,t){const r=this._logger.create("_signinEnd"),n=await this._client.processSigninResponse(e);return r.debug("got signin response"),await this._buildUser(n,t)}async _buildUser(e,t){const r=this._logger.create("_buildUser"),n=new SD(e);if(t){if(t!==n.profile.sub)throw r.debug("current user does not match user returned from signin. sub from signin:",n.profile.sub),new dD({...e,error:"login_required"});r.debug("current user matches user returned from signin")}return await this.storeUser(n),r.debug("user stored"),this._events.load(n),n}async signoutRedirect(e={}){const t=this._logger.create("signoutRedirect"),{redirectMethod:r,...n}=e,i=await this._redirectNavigator.prepare({redirectMethod:r});await this._signoutStart({request_type:"so:r",post_logout_redirect_uri:this.settings.post_logout_redirect_uri,...n},i),t.info("success")}async signoutRedirectCallback(e=window.location.href){const t=this._logger.create("signoutRedirectCallback"),r=await this._signoutEnd(e);return t.info("success"),r}async signoutPopup(e={}){const t=this._logger.create("signoutPopup"),{popupWindowFeatures:r,popupWindowTarget:n,...i}=e,a=this.settings.popup_post_logout_redirect_uri,o=await this._popupNavigator.prepare({popupWindowFeatures:r,popupWindowTarget:n});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 r=this._logger.create("signoutPopupCallback");await this._popupNavigator.callback(e,t),r.info("success")}async _signout(e,t){const r=await this._signoutStart(e,t);return await this._signoutEnd(r.url)}async _signoutStart(e={},t){var r;const n=this._logger.create("_signoutStart");try{const i=await this._loadUser();n.debug("loaded current user from storage"),this.settings.revokeTokensOnSignout&&await this._revokeInternal(i);const a=e.id_token_hint||i&&i.id_token;a&&(n.debug("setting id_token_hint in signout request"),e.id_token_hint=a),await this.removeUser(),n.debug("user removed, creating signout request");const o=await this._client.createSignoutRequest(e);return n.debug("got signout request"),await t.navigate({url:o.url,state:null==(r=o.state)?void 0:r.id})}catch(e){throw n.debug("error after preparing navigator, closing navigator window"),t.close(),e}}async _signoutEnd(e){const t=this._logger.create("_signoutEnd"),r=await this._client.processSignoutResponse(e);return t.debug("got signout response"),r}async signoutSilent(e={}){var t;const r=this._logger.create("signoutSilent"),{silentRequestTimeoutInSeconds:n,...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:n});await this._signout({request_type:"so:s",post_logout_redirect_uri:o,id_token_hint:a,...i},s),r.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 r=this._logger.create("_revokeInternal");if(!e)return;const n=t.filter((t=>"string"==typeof e[t]));if(n.length){for(const t of n)await this._client.revokeToken(e[t],t),r.info(`${t} revoked successfully`),"access_token"!==t&&(e[t]=null);await this.storeUser(e),r.debug("user stored"),this._events.load(e)}else r.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"),SD.fromStorageString(t)):(e.debug("no user storageString"),null)}async storeUser(e){const t=this._logger.create("storeUser");if(e){t.debug("storing user");const r=e.toStorageString();await this.settings.userStore.set(this._userStoreKey,r)}else this._logger.debug("removing user"),await this.settings.userStore.remove(this._userStoreKey)}async clearStaleState(){await this._client.clearStaleState()}}((({oidcConfiguration:e,authenticationDomain:t})=>{const r={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};return e.audience&&(r.extraQueryParams={audience:e.audience}),r})(e)),this.deviceCredentialsManager=new gz,this.logoutMode=e.oidcConfiguration.logoutMode||"redirect"}static mapOidcUserToDomainModel=e=>{const t=e.profile?.passport,r={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&&(r.imx={ethAddress:t?.imx_eth_address,starkAddress:t?.imx_stark_address,userAdminAddress:t?.imx_user_admin_address}),t?.zkevm_eth_address&&(r.zkEvm={ethAddress:t?.zkevm_eth_address,userAdminAddress:t?.zkevm_user_admin_address}),r};static mapDeviceTokenResponseToDomainUserModel=e=>{const t=ZB(e.id_token),r={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&&(r.imx={ethAddress:t?.passport?.imx_eth_address,starkAddress:t?.passport?.imx_stark_address,userAdminAddress:t?.passport?.imx_user_admin_address}),r};async login(){return yz((async()=>{const e=await this.userManager.signinPopup({popupWindowFeatures:{width:410,height:450}});return _z.mapOidcUserToDomainModel(e)}),hz.AUTHENTICATION_ERROR)}async loginCallback(){return yz((async()=>this.userManager.signinPopupCallback()),hz.AUTHENTICATION_ERROR)}async loginWithDeviceFlow(){return yz((async()=>{const e=await Qr.post(`${this.config.authenticationDomain}/oauth/device/code`,{client_id:this.config.oidcConfiguration.clientId,scope:this.config.oidcConfiguration.scope,audience:this.config.oidcConfiguration.audience},vz);return{code:e.data.user_code,deviceCode:e.data.device_code,url:e.data.verification_uri_complete,interval:e.data.interval}}),hz.AUTHENTICATION_ERROR)}async connectImxDeviceFlow(e,t,r){return yz((async()=>{const n=Date.now();for(;;){if(null!=r&&Date.now()-n>r)throw new Error("Timed out");await wz(1e3*t);try{const t=await this.getDeviceFlowToken(e),r=_z.mapDeviceTokenResponseToDomainUserModel(t);return r.imx?.ethAddress&&r.imx?.starkAddress&&r.imx?.userAdminAddress&&this.deviceCredentialsManager.saveCredentials(t),r}catch(e){if(!Qr.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")}),hz.AUTHENTICATION_ERROR)}async getDeviceFlowToken(e){return(await Qr.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},vz)).data}async connectImxWithCredentials(e){return yz((async()=>{if(this.deviceCredentialsManager.areValid(e))return _z.mapDeviceTokenResponseToDomainUserModel(e);const t=e?.refresh_token??null;if(t){const e=await this.refreshToken(t);return _z.mapDeviceTokenResponseToDomainUserModel(e)}return null}),hz.AUTHENTICATION_ERROR)}async refreshToken(e){return(await Qr.post(`${this.config.authenticationDomain}/oauth/token`,{client_id:this.config.oidcConfiguration.clientId,grant_type:"refresh_token",refresh_token:e},vz)).data}async logout(){return yz((async()=>"silent"===this.logoutMode?this.userManager.signoutSilent():this.userManager.signoutRedirect()),hz.LOGOUT_ERROR)}async logoutSilentCallback(e){return this.userManager.signoutSilentCallback(e)}async logoutDeviceFlow(){return yz((async()=>{this.deviceCredentialsManager.clearCredentials()}),hz.LOGOUT_ERROR)}async loginSilent(){return yz((async()=>{if(!await this.getUser())return null;const e=await this.userManager.signinSilent();return e?_z.mapOidcUserToDomainModel(e):null}),hz.SILENT_LOGIN_ERROR)}async getUser(){return yz((async()=>{const e=await this.userManager.getUser();if(e)return _z.mapOidcUserToDomainModel(e);const t=this.deviceCredentialsManager.getCredentials();return t?_z.mapDeviceTokenResponseToDomainUserModel(t):null}),hz.NOT_LOGGED_IN_ERROR)}async getUserDeviceFlow(){return yz((async()=>{const e=this.deviceCredentialsManager.getCredentials();return e?_z.mapDeviceTokenResponseToDomainUserModel(e):null}),hz.NOT_LOGGED_IN_ERROR)}checkStoredDeviceFlowCredentials(){return this.deviceCredentialsManager.getCredentials()}}class Ez{config;constructor(e){this.config=e}async login(e,t){return yz((async()=>{const r=new LU(this.config.magicPublishableApiKey,{extensions:[new jU],network:t});return await r.openid.loginWithOIDC({jwt:e,providerId:this.config.magicProviderId}),r.rpcProvider}),hz.WALLET_CONNECTION_ERROR)}}const Tz=1e3,Az=3,Sz=async(e,t)=>{const{retries:r=Az,interval:n=Tz,finalErr:i=Error("Retry failed"),finallyFn:a=(()=>{})}=t||{};try{return await e()}catch(t){return r<=0?Promise.reject(i):(await(o=n,new Promise((e=>{setTimeout((()=>e()),o)}))),Sz(e,{retries:r-1,finalErr:i,finallyFn:a}))}finally{r<=0&&a()}var o};class kz{transactionAPI;confirmationScreen;imxEtherAddress;constructor({imxPublicApiDomain:e,accessToken:t,confirmationScreen:r,imxEtherAddress:n}){this.confirmationScreen=r,this.transactionAPI=new Nq(new Pq({accessToken:t,basePath:e})),this.imxEtherAddress=n}loading(e){this.confirmationScreen.loading(e)}async validate({payloadHash:e}){if(!(await Sz((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:r}=t.data;if(r){if(!(await this.confirmationScreen.startGuardianTransaction(e,this.imxEtherAddress)).confirmed)throw new Error("Transaction rejected by user")}else this.confirmationScreen.closeWindow()}}const Oz="ERC721";const Rz="ERC721";class xz{user;starkSigner;immutableXClient;confirmationScreen;guardianClient;constructor({user:e,starkSigner:t,immutableXClient:r,imxPublicApiDomain:n,confirmationScreen:i}){this.user=e,this.starkSigner=t,this.immutableXClient=r,this.confirmationScreen=i,this.guardianClient=new kz({imxPublicApiDomain:n,accessToken:e.accessToken,confirmationScreen:i,imxEtherAddress:e.imx.ethAddress})}async transfer(e){return async function({request:e,transfersApi:t,starkSigner:r,user:n,guardianClient:i}){return yz((async()=>{i.loading();const a=e.type===Rz?"1":e.amount,o={sender:n.imx.ethAddress,token:Dq(e),amount:a,receiver:e.receiver},s={Authorization:`Bearer ${n.accessToken}`},u=await t.getSignableTransferV1({getSignableTransferRequest:o},{headers:s});await i.validate({payloadHash:u.data.payload_hash});const f=u.data,{payload_hash:c}=f,l=await r.signMessage(c),d=await r.getAddress(),p={createTransferRequest:{sender_stark_key:f.sender_stark_key||d,sender_vault_id:f.sender_vault_id,receiver_stark_key:f.receiver_stark_key,receiver_vault_id:f.receiver_vault_id,asset_id:f.asset_id,amount:f.amount,nonce:f.nonce,expiration_timestamp:f.expiration_timestamp,stark_signature:l}},{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}}),hz.TRANSFER_ERROR)}({request:e,user:this.user,starkSigner:this.starkSigner,transfersApi:this.immutableXClient.transfersApi,guardianClient:this.guardianClient})}registerOffchain(){throw new mz("Operation not supported",hz.OPERATION_NOT_SUPPORTED_ERROR)}isRegisteredOnchain(){throw new mz("Operation not supported",hz.OPERATION_NOT_SUPPORTED_ERROR)}createOrder(e){return async function({starkSigner:e,user:t,request:r,ordersApi:n,guardianClient:i}){return yz((async()=>{i.loading();const{ethAddress:a}=t.imx,o=r.sell.type===Oz?"1":r.sell.amount,s=r.buy.type===Oz?"1":r.buy.amount,u={Authorization:`Bearer ${t.accessToken}`},f={user:a,amount_buy:s,token_buy:Dq(r.buy),amount_sell:o,token_sell:Dq(r.sell),fees:r.fees,split_fees:!0,expiration_timestamp:r.expiration_timestamp},c=await n.getSignableOrder({getSignableOrderRequestV3:f},{headers:u});await i.validate({payloadHash:c.data.payload_hash});const{payload_hash:l}=c.data,d=await e.signMessage(l),p=c.data,h={createOrderRequest:{include_fees:!0,fees:r.fees,stark_signature:d,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 n.createOrderV3(h,{headers:u})).data}}),hz.CREATE_ORDER_ERROR)}({request:e,user:this.user,starkSigner:this.starkSigner,ordersApi:this.immutableXClient.ordersApi,guardianClient:this.guardianClient})}cancelOrder(e){return async function({user:e,starkSigner:t,request:r,ordersApi:n,guardianClient:i}){return yz((async()=>{i.loading();const a={order_id:r.order_id},o={Authorization:`Bearer ${e.accessToken}`},s=await n.getSignableCancelOrderV3({getSignableCancelOrderRequest:a},{headers:o});await i.validate({payloadHash:s.data.payload_hash});const{payload_hash:u}=s.data,f=await t.signMessage(u),c=await n.cancelOrderV3({id:r.order_id.toString(),cancelOrderRequest:{order_id:r.order_id,stark_signature:f}},{headers:o});return{order_id:c.data.order_id,status:c.data.status}}),hz.CANCEL_ORDER_ERROR)}({request:e,user:this.user,starkSigner:this.starkSigner,ordersApi:this.immutableXClient.ordersApi,guardianClient:this.guardianClient})}createTrade(e){return async function({request:e,tradesApi:t,user:r,starkSigner:n,guardianClient:i}){return yz((async()=>{i.loading();const{ethAddress:a}=r.imx,o={expiration_timestamp:e.expiration_timestamp,fees:e.fees,order_id:e.order_id,user:a},s={Authorization:`Bearer ${r.accessToken}`},u=await t.getSignableTrade({getSignableTradeRequest:o},{headers:s});await i.validate({payloadHash:u.data.payload_hash});const{payload_hash:f}=u.data,c=await n.signMessage(f),{data:l}=u,d={createTradeRequest:{include_fees:!0,fees:e?.fees,stark_signature:c,order_id:e?.order_id,fee_info:l.fee_info,amount_buy:l.amount_buy,amount_sell:l.amount_sell,asset_id_buy:l.asset_id_buy,asset_id_sell:l.asset_id_sell,expiration_timestamp:l.expiration_timestamp,nonce:l.nonce,stark_key:l.stark_key,vault_id_buy:l.vault_id_buy,vault_id_sell:l.vault_id_sell}},{data:p}=await t.createTradeV3(d,{headers:s});return p}),hz.CREATE_TRADE_ERROR)}({request:e,user:this.user,starkSigner:this.starkSigner,tradesApi:this.immutableXClient.tradesApi,guardianClient:this.guardianClient})}batchNftTransfer(e){return async function({user:e,starkSigner:t,request:r,transfersApi:n,guardianClient:i}){return yz((async()=>{i.loading({width:480,height:784});const{ethAddress:a}=e.imx,o={sender_ether_key:a,signable_requests:r.map((e=>({amount:"1",token:Dq({type:Rz,tokenId:e.tokenId,tokenAddress:e.tokenAddress}),receiver:e.receiver})))},s={Authorization:`Bearer ${e.accessToken}`},u=await n.getSignableTransfer({getSignableTransferRequestV2:o},{headers:s});await i.validate({payloadHash:u.data.signable_responses[0]?.payload_hash});const f=await Promise.all(u.data.signable_responses.map((async e=>{const r=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:r}}))),c={sender_stark_key:u.data.sender_stark_key,requests:f},l=await n.createTransfer({createTransferRequestV2:c},{headers:s});return{transfer_ids:l?.data.transfer_ids}}),hz.TRANSFER_ERROR)}({request:e,user:this.user,starkSigner:this.starkSigner,transfersApi:this.immutableXClient.transfersApi,guardianClient:this.guardianClient})}exchangeTransfer(e){return async function({user:e,starkSigner:t,request:r,exchangesApi:n}){return yz((async()=>{const{ethAddress:i}=e.imx,a=r.amount,o=await n.getExchangeSignableTransfer({id:r.transactionID,getSignableTransferRequest:{sender:i,token:Dq(r),amount:a,receiver:r.receiver}}),s=await t.getAddress(),{payload_hash:u}=o.data,f=await t.signMessage(u),c={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:f},l={Authorization:`Bearer ${e.accessToken}`},d=await n.createExchangeTransfer({id:r.transactionID,createTransferRequest:c},{headers:l});return{sent_signature:d?.data.sent_signature,status:d?.data.status?.toString(),time:d?.data.time,transfer_id:d?.data.transfer_id}}),hz.EXCHANGE_TRANSFER_ERROR)}({request:e,user:this.user,starkSigner:this.starkSigner,exchangesApi:this.immutableXClient.exchangeApi})}deposit(e){throw new mz("Operation not supported",hz.OPERATION_NOT_SUPPORTED_ERROR)}prepareWithdrawal(e){throw new mz("Operation not supported",hz.OPERATION_NOT_SUPPORTED_ERROR)}completeWithdrawal(e,t){throw new mz("Operation not supported",hz.OPERATION_NOT_SUPPORTED_ERROR)}getAddress(){return Promise.resolve(this.user.imx.ethAddress)}}class Iz{authManager;config;confirmationScreen;immutableXClient;magicAdapter;constructor({authManager:e,config:t,confirmationScreen:r,immutableXClient:n,magicAdapter:i}){this.authManager=e,this.config=t,this.confirmationScreen=r,this.immutableXClient=n,this.magicAdapter=i}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,r){const n=await this.authManager.connectImxDeviceFlow(e,t,r);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 mz("Failed to initialise",hz.WALLET_CONNECTION_ERROR);const t=await this.magicAdapter.login(e.idToken,this.config.network),r=new uy(t).getSigner(),n=await(async e=>yz((async()=>NC(await xC(e))),hz.WALLET_CONNECTION_ERROR))(r);if(!e.imx?.ethAddress){const t=await this.registerStarkEx(r,n,e.accessToken);return new xz({user:t,starkSigner:n,immutableXClient:this.immutableXClient,imxPublicApiDomain:this.config.imxPublicApiDomain,confirmationScreen:this.confirmationScreen})}return new xz({user:e,starkSigner:n,immutableXClient:this.immutableXClient,imxPublicApiDomain:this.config.imxPublicApiDomain,confirmationScreen:this.confirmationScreen})}async registerStarkEx(e,t,r){return yz((async()=>{await async function({ethSigner:e,starkSigner:t,usersApi:r},n){return yz((async()=>{const i=await e.getAddress(),a=await t.getAddress(),o=await r.getSignableRegistrationOffchain({getSignableRegistrationRequest:{ether_key:i,stark_key:a}}),{signable_message:s,payload_hash:u}=o.data,f=await Bq(s,e),c=await t.signMessage(u);return(await r.registerPassportUser({authorization:`Bearer ${n}`,registerPassportUserRequest:{eth_signature:f,ether_key:i,stark_signature:c,stark_key:a}})).statusText}),hz.USER_REGISTRATION_ERROR)}({ethSigner:e,starkSigner:t,usersApi:this.immutableXClient.usersApi},r);return await Sz((async()=>{const e=await this.authManager.loginSilent();return!!e?.imx?e:Promise.reject(new Error("user wallet addresses not exist"))}))}),hz.REFRESH_TOKEN_ERROR)}}var Cz;e.Networks=void 0,(Cz=e.Networks||(e.Networks={})).PRODUCTION="mainnet",Cz.SANDBOX="goerli";const Nz=(e,t,r)=>{const n=t.map((t=>!e[t]&&t)).filter((e=>e)).join(", ");if(""!==n){throw new mz(r?`${r} - ${n} cannot be null`:`${n} cannot be null`,hz.INVALID_CONFIGURATION)}};class Pz{network;authenticationDomain;passportDomain;imxPublicApiDomain;magicPublishableApiKey;magicProviderId;oidcConfiguration;baseConfig;zkEvmChainId;zkEvmRpcUrl;relayerUrl;multiRollupConfig;constructor({baseConfig:t,overrides:r,...n}){if(Nz(n,["clientId","logoutRedirectUri","redirectUri"]),this.oidcConfiguration=n,this.baseConfig=t,r)Nz(r,["network","authenticationDomain","passportDomain","magicPublishableApiKey","magicProviderId","zkEvmRpcUrl","zkEvmChainId","relayerUrl","imxPublicApiDomain","indexerMrBasePath","orderBookMrBasePath","passportMrBasePath"],"overrides"),this.network=r.network,this.authenticationDomain=r.authenticationDomain,this.passportDomain=r.passportDomain,this.imxPublicApiDomain=r.imxPublicApiDomain,this.magicPublishableApiKey=r.magicPublishableApiKey,this.magicProviderId=r.magicProviderId,this.zkEvmRpcUrl=r.zkEvmRpcUrl,this.zkEvmChainId=r.zkEvmChainId,this.relayerUrl=r.relayerUrl,this.multiRollupConfig={indexer:gt({basePath:r.indexerMrBasePath}),orderBook:gt({basePath:r.orderBookMrBasePath}),passport:gt({basePath:r.passportMrBasePath})};else switch(t.environment){case e.Environment.PRODUCTION:this.network=e.Networks.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.zkEvmChainId="",this.relayerUrl="https://api.immutable.com/relayer-mr",this.multiRollupConfig=vt();break;case e.Environment.SANDBOX:default:this.network=e.Networks.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://zkevm-rpc.sandbox.x.immutable.com",this.zkEvmChainId="eip155:13392",this.relayerUrl="https://api.sandbox.immutable.com/relayer-mr",this.multiRollupConfig=wt()}}}var Mz,Bz,Dz;!function(e){e.CONFIRMATION_WINDOW_READY="confirmation_window_ready",e.TRANSACTION_CONFIRMED="transaction_confirmed",e.TRANSACTION_ERROR="transaction_error"}(Mz||(Mz={})),function(e){e.TRANSACTION_START="transaction_start"}(Bz||(Bz={})),function(e){e.cancelOrder="delete:v1/orders",e.createOrder="post:v1/orders",e.createTrade="post:v1/trades",e.createTransfer="post:v1/transfers",e.createBatchTransfer="post:v2/transfers"}(Dz||(Dz={}));const Fz="imx_passport_confirmation",Lz=({url:e,title:t,width:r,height:n})=>{const i=Math.max(0,Math.round(window.screenX+(window.outerWidth-r)/2)),a=Math.max(0,Math.round(window.screenY+(window.outerHeight-n)/2)),o=window.open(e,t,`\n scrollbars=yes,\n width=${r}, \n height=${n}, \n top=${a}, \n left=${i}\n `);if(!o)throw new Error("Failed to open confirmation screen");return o.focus(),o},Uz="Confirm this transaction";class jz{config;confirmationWindow;constructor(e){this.config=e}postMessage(e,t,r){e.postMessage({eventType:Fz,accessToken:t,...r},this.config.passportDomain)}startTransaction(e,t,r){return new Promise(((n,i)=>{const a=({data:r,origin:a})=>{if(a===this.config.passportDomain&&r.eventType===Fz)switch(r.messageType){case Mz.CONFIRMATION_WINDOW_READY:this.postMessage(o,e,{messageType:Bz.TRANSACTION_START,messageData:t});break;case Mz.TRANSACTION_CONFIRMED:n({confirmed:!0});break;case Mz.TRANSACTION_ERROR:i(new Error("Transaction error"));break;default:i(new Error("Unsupported message type"))}};window.addEventListener("message",a);const o=Lz({url:`${this.config.passportDomain}/transaction-confirmation`,title:Uz,width:r?.width||480,height:r?.height||380}),s=setInterval((()=>{o.closed&&(clearInterval(s),window.removeEventListener("message",a),n({confirmed:!1}))}),1e3)}))}startGuardianTransaction(e,t){return new Promise(((r,n)=>{const i=({data:e,origin:t})=>{if(t===this.config.passportDomain&&e.eventType===Fz)switch(e.messageType){case Mz.CONFIRMATION_WINDOW_READY:break;case Mz.TRANSACTION_CONFIRMED:r({confirmed:!0});break;case Mz.TRANSACTION_ERROR:n(new Error("Transaction error"));break;default:n(new Error("Unsupported message type"))}};if(window.addEventListener("message",i),!this.confirmationWindow)return void r({confirmed:!1});this.confirmationWindow.location.href=`${this.config.passportDomain}/transaction-confirmation/transaction.html?transactionId=${e}&imxEtherAddress=${t}&chainType=starkex`;const a=setInterval((()=>{this.confirmationWindow?.closed&&(clearInterval(a),window.removeEventListener("message",i),r({confirmed:!1}))}),1e3)}))}loading(e){this.confirmationWindow=Lz({url:`${this.config.passportDomain}/transaction-confirmation/loading.html`,title:Uz,width:e?.width||480,height:e?.height||380})}closeWindow(){this.confirmationWindow?.close()}}var qz,zz,Hz;!function(e){e.PENDING="PENDING",e.SUBMITTED="SUBMITTED",e.SUCCESSFUL="SUCCESSFUL",e.REVERTED="REVERTED",e.FAILED="FAILED"}(qz||(qz={})),e.ProviderEvent=void 0,(e.ProviderEvent||(e.ProviderEvent={})).ACCOUNTS_CHANGED="accountsChanged";class Vz{emitter=new kE;emit(e,...t){this.emitter.emit(e,...t)}on(e,t){this.emitter.on(e,t)}removeListener(e,t){this.emitter.removeListener(e,t)}}class Gz{config;constructor({config:e}){this.config=e}async postToRelayer(e){const t={id:1,jsonrpc:"2.0",...e},r=await fetch(`${this.config.relayerUrl}/v1/transactions`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)}),n=await r.json();if(n.error)throw n.error;return n}async ethSendTransaction(e,t){const r={method:"eth_sendTransaction",params:[{to:e,data:t,chainId:this.config.zkEvmChainId.toString()}]},{result:n}=await this.postToRelayer(r);return n}async imGetTransactionByHash(e){const t={method:"im_getTransactionByHash",params:[e]},{result:r}=await this.postToRelayer(t);return r}async imGetFeeOptions(e,t){const r={method:"im_getFeeOptions",params:[{userAddress:e,data:t,chainId:this.config.zkEvmChainId.toString()}]},{result:n}=await this.postToRelayer(r);return n}}e.ProviderErrorCode=void 0,(zz=e.ProviderErrorCode||(e.ProviderErrorCode={}))[zz.USER_REJECTED_REQUEST=4001]="USER_REJECTED_REQUEST",zz[zz.UNAUTHORIZED=4100]="UNAUTHORIZED",zz[zz.UNSUPPORTED_METHOD=4200]="UNSUPPORTED_METHOD",zz[zz.DISCONNECTED=4900]="DISCONNECTED",e.RpcErrorCode=void 0,(Hz=e.RpcErrorCode||(e.RpcErrorCode={}))[Hz.RPC_SERVER_ERROR=-32e3]="RPC_SERVER_ERROR",Hz[Hz.INVALID_REQUEST=-32600]="INVALID_REQUEST",Hz[Hz.METHOD_NOT_FOUND=-32601]="METHOD_NOT_FOUND",Hz[Hz.INVALID_PARAMS=-32602]="INVALID_PARAMS",Hz[Hz.INTERNAL_ERROR=-32603]="INTERNAL_ERROR",Hz[Hz.PARSE_ERROR=-32700]="PARSE_ERROR";class Wz extends Error{message;code;constructor(e,t){super(t),this.message=t,this.code=e}}const Kz=async({authManager:t,config:r,magicAdapter:n,multiRollupApiClients:i})=>{const a=await t.getUser()||await t.login();if(!a.idToken)throw new Error("User is missing idToken");const o=await n.login(a.idToken,r.network);if(!a.zkEvm){const r=await async function({authManager:t,magicProvider:r,multiRollupApiClients:n,accessToken:i}){const a=new uy(r).getSigner(),o=await a.getAddress(),s=await Bq("Only sign this message from Immutable Passport",a),u={Authorization:`Bearer ${i}`};try{await n.passportApi.createCounterfactualAddress({createCounterfactualAddressRequest:{ethereumAddress:o,ethereumSignature:s}},{headers:u})}catch(t){throw new Wz(e.RpcErrorCode.INTERNAL_ERROR,`Failed to create counterfactual address: ${t}`)}const f=await t.loginSilent();if(!f?.zkEvm)throw new Wz(e.RpcErrorCode.INTERNAL_ERROR,"Failed to refresh user details");return f}({authManager:t,magicProvider:o,multiRollupApiClients:i,accessToken:a.accessToken});return{user:r,magicProvider:o}}return{user:a,magicProvider:o}};const Xz=async(e,t,r,n,i)=>{const a=e.map((e=>({delegateCall:!0===e.delegateCall,revertOnError:!0===e.revertOnError,gasLimit:e.gasLimit??qo,target:e.to??Uo,value:e.value??qo,data:e.data??[]})));const o=function(e,t){return ao(xs.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=Ii(ao(gy(["string","uint256","address","bytes32"],["",r,n,o]))),u=await i.signMessage(s),f=pz({threshold:1,signers:[{weight:1,signature:`${u}02`}]}),c=new Bu(Fq.mainModule.abi);return c.encodeFunctionData(c.getFunction("execute"),[a,t,f])},$z=e=>Qi.from(e).toNumber(),Jz=async({transactionAPI:t,chainId:r,nonce:n,user:i,metaTransactions:a})=>{const o={Authorization:`Bearer ${i.accessToken}`},s=(t=>{try{return t.map((e=>({delegateCall:!0===e.delegateCall,revertOnError:!0===e.revertOnError,gasLimit:e.gasLimit?$z(e.gasLimit).toString():"0",target:e.to??Uo,value:e.value?$z(e.value).toString():"0",data:e.data?e.data.toString():"0x00"})))}catch(t){const r=t instanceof Error?t.message:String(t);throw new Wz(e.RpcErrorCode.INVALID_PARAMS,`Transaction failed to parsing: ${r}`)}})(a);try{await t.evaluateTransaction({id:"evm",transactionEvaluationRequest:{chainType:"evm",chainId:r,transactionData:{nonce:n,userAddress:i.zkEvm.ethAddress,metaTransactions:s}}},{headers:o})}catch(t){const r=t instanceof Error?t.message:String(t);throw new Wz(e.RpcErrorCode.INTERNAL_ERROR,`Transaction failed to validate with error: ${r}`)}},Yz=async({params:t,magicProvider:r,jsonRpcProvider:n,relayerClient:i,transactionAPI:a,config:o,user:s})=>{const u=t[0];if(!u.to)throw new Wz(e.RpcErrorCode.INVALID_PARAMS,'eth_sendTransaction requires a "to" field');const f=(e=>{const t=e.split(":");if(2!==t.length)throw new Error("Invalid configuration, chain ID is not in CAIP-2 format");return Qi.from(t[1])})(o.zkEvmChainId),c=new uy(r).getSigner(),l=await(async(e,t)=>{const r=await e.send("eth_getCode",[t,"latest"]);if(r&&"0x"!==r)return new gd(t,Fq.mainModule.abi,e).nonce();return 0})(n,s.zkEvm.ethAddress),d={to:u.to,data:u.data,nonce:l,value:u.value,revertOnError:!0},p=await Xz([d],l,f,s.zkEvm.ethAddress,c),h=(await i.imGetFeeOptions(s.zkEvm.ethAddress,p)).find((e=>"IMX"===e.tokenSymbol));if(!h)throw new Error("Failed to retrieve fees for IMX token");const m={nonce:l,to:h.recipientAddress,value:h.tokenPrice,revertOnError:!0};await Jz({transactionAPI:a,chainId:o.zkEvmChainId,nonce:$z(l),user:s,metaTransactions:[d,m]});const y=await Xz([d,m],l,f,s.zkEvm.ethAddress,c),b=await i.ethSendTransaction(s.zkEvm.ethAddress,y),g=await Sz((async()=>{const e=await i.imGetTransactionByHash(b);if(e.status===qz.PENDING)throw new Error;return e}),{retries:30,interval:1e3,finalErr:new Wz(e.RpcErrorCode.RPC_SERVER_ERROR,"transaction hash not generated in time")});if(![qz.SUBMITTED,qz.SUCCESSFUL].includes(g.status))throw new Wz(e.RpcErrorCode.RPC_SERVER_ERROR,`Transaction failed to submit with status ${g.status}`);return g.hash};class Qz{authManager;config;confirmationScreen;magicAdapter;relayerClient;transactionAPI;multiRollupApiClients;jsonRpcProvider;eventEmitter;magicProvider;user;constructor({authManager:e,magicAdapter:t,config:r,confirmationScreen:n,multiRollupApiClients:i}){this.authManager=e,this.magicAdapter=t,this.config=r,this.confirmationScreen=n,this.relayerClient=new Gz({config:r}),this.transactionAPI=new Nq(new Pq({basePath:this.config.imxPublicApiDomain})),this.jsonRpcProvider=new om(this.config.zkEvmRpcUrl),this.multiRollupApiClients=i,this.eventEmitter=new Vz}isLoggedIn(){return void 0!==this.magicProvider&&void 0!==this.user}async performRequest(t){switch(t.method){case"eth_requestAccounts":{if(this.isLoggedIn())return[this.user.zkEvm.ethAddress];const{magicProvider:t,user:r}=await Kz({authManager:this.authManager,config:this.config,magicAdapter:this.magicAdapter,multiRollupApiClients:this.multiRollupApiClients});return this.user=r,this.magicProvider=t,this.eventEmitter.emit(e.ProviderEvent.ACCOUNTS_CHANGED,[this.user.zkEvm.ethAddress]),[this.user.zkEvm.ethAddress]}case"eth_sendTransaction":if(!this.isLoggedIn())throw new Wz(e.ProviderErrorCode.UNAUTHORIZED,"Unauthorised - call eth_requestAccounts first");return Yz({params:t.params||[],magicProvider:this.magicProvider,transactionAPI:this.transactionAPI,jsonRpcProvider:this.jsonRpcProvider,config:this.config,relayerClient:this.relayerClient,user:this.user});case"eth_accounts":return this.isLoggedIn()?[this.user.zkEvm.ethAddress]:[];case"eth_gasPrice":case"eth_getBalance":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(t.method,t.params||[]);default:throw new Wz(e.ProviderErrorCode.UNSUPPORTED_METHOD,"Method not supported")}}async performJsonRpcRequest(t){const{id:r,jsonrpc:n}=t;try{return{id:r,jsonrpc:n,result:await this.performRequest(t)}}catch(t){let i;return i=t instanceof Wz?t:t instanceof Error?new Wz(e.RpcErrorCode.INTERNAL_ERROR,t.message):new Wz(e.RpcErrorCode.INTERNAL_ERROR,"Internal error"),{id:r,jsonrpc:n,error:i}}}async request(t){try{return this.performRequest(t)}catch(t){if(t instanceof Wz)throw t;if(t instanceof Error)throw new Wz(e.RpcErrorCode.INTERNAL_ERROR,t.message);throw new Wz(e.RpcErrorCode.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(t,r,n){if("string"==typeof t)return"function"==typeof r?this.sendAsync({method:t,params:[]},r):n?this.sendAsync({method:t,params:Array.isArray(r)?r:[]},n):this.request({method:t,params:Array.isArray(r)?r:[]});if("function"==typeof r)return this.sendAsync(t,r);if(!Array.isArray(t)&&"object"==typeof t)return this.performJsonRpcRequest(t);throw new Wz(e.RpcErrorCode.INVALID_REQUEST,"Invalid request")}on(e,t){this.eventEmitter.on(e,t)}removeListener(e,t){this.eventEmitter.removeListener(e,t)}}var Zz=sn("object"==typeof self?self.FormData:window.FormData),eH={},tH={},rH=un(oz),nH=un(My),iH={},aH=un(Du),oH=un(Oo),sH=un(Ms),uH=un(Ad),fH=un(Gi),cH=un(Ou),lH=un(ep),dH=un(Fp),pH=un(oo),hH=un(Ti),mH=un(Id),yH=un(_y),bH=un(op),gH=un(Ra),vH=un(yo),wH=un(Ll),_H=un(Es),EH=un(rd),TH=un(xy),AH=un(Hp),SH=un(sh);!function(e){var t=on&&on.__createBinding||(Object.create?function(e,t,r,n){void 0===n&&(n=r),Object.defineProperty(e,n,{enumerable:!0,get:function(){return t[r]}})}:function(e,t,r,n){void 0===n&&(n=r),e[n]=t[r]}),r=on&&on.__setModuleDefault||(Object.create?function(e,t){Object.defineProperty(e,"default",{enumerable:!0,value:t})}:function(e,t){e.default=t}),n=on&&on.__importStar||function(e){if(e&&e.__esModule)return e;var n={};if(null!=e)for(var i in e)"default"!==i&&Object.prototype.hasOwnProperty.call(e,i)&&t(n,e,i);return r(n,e),n};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=aH;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=oH;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=n(sH);e.base64=o;var s=uH;Object.defineProperty(e,"base58",{enumerable:!0,get:function(){return s.Base58}});var u=fH;Object.defineProperty(e,"arrayify",{enumerable:!0,get:function(){return u.arrayify}}),Object.defineProperty(e,"concat",{enumerable:!0,get:function(){return u.concat}}),Object.defineProperty(e,"hexConcat",{enumerable:!0,get:function(){return u.hexConcat}}),Object.defineProperty(e,"hexDataSlice",{enumerable:!0,get:function(){return u.hexDataSlice}}),Object.defineProperty(e,"hexDataLength",{enumerable:!0,get:function(){return u.hexDataLength}}),Object.defineProperty(e,"hexlify",{enumerable:!0,get:function(){return u.hexlify}}),Object.defineProperty(e,"hexStripZeros",{enumerable:!0,get:function(){return u.hexStripZeros}}),Object.defineProperty(e,"hexValue",{enumerable:!0,get:function(){return u.hexValue}}),Object.defineProperty(e,"hexZeroPad",{enumerable:!0,get:function(){return u.hexZeroPad}}),Object.defineProperty(e,"isBytes",{enumerable:!0,get:function(){return u.isBytes}}),Object.defineProperty(e,"isBytesLike",{enumerable:!0,get:function(){return u.isBytesLike}}),Object.defineProperty(e,"isHexString",{enumerable:!0,get:function(){return u.isHexString}}),Object.defineProperty(e,"joinSignature",{enumerable:!0,get:function(){return u.joinSignature}}),Object.defineProperty(e,"zeroPad",{enumerable:!0,get:function(){return u.zeroPad}}),Object.defineProperty(e,"splitSignature",{enumerable:!0,get:function(){return u.splitSignature}}),Object.defineProperty(e,"stripZeros",{enumerable:!0,get:function(){return u.stripZeros}});var f=cH;Object.defineProperty(e,"_TypedDataEncoder",{enumerable:!0,get:function(){return f._TypedDataEncoder}}),Object.defineProperty(e,"dnsEncode",{enumerable:!0,get:function(){return f.dnsEncode}}),Object.defineProperty(e,"hashMessage",{enumerable:!0,get:function(){return f.hashMessage}}),Object.defineProperty(e,"id",{enumerable:!0,get:function(){return f.id}}),Object.defineProperty(e,"isValidName",{enumerable:!0,get:function(){return f.isValidName}}),Object.defineProperty(e,"namehash",{enumerable:!0,get:function(){return f.namehash}});var c=lH;Object.defineProperty(e,"defaultPath",{enumerable:!0,get:function(){return c.defaultPath}}),Object.defineProperty(e,"entropyToMnemonic",{enumerable:!0,get:function(){return c.entropyToMnemonic}}),Object.defineProperty(e,"getAccountPath",{enumerable:!0,get:function(){return c.getAccountPath}}),Object.defineProperty(e,"HDNode",{enumerable:!0,get:function(){return c.HDNode}}),Object.defineProperty(e,"isValidMnemonic",{enumerable:!0,get:function(){return c.isValidMnemonic}}),Object.defineProperty(e,"mnemonicToEntropy",{enumerable:!0,get:function(){return c.mnemonicToEntropy}}),Object.defineProperty(e,"mnemonicToSeed",{enumerable:!0,get:function(){return c.mnemonicToSeed}});var l=dH;Object.defineProperty(e,"getJsonWalletAddress",{enumerable:!0,get:function(){return l.getJsonWalletAddress}});var d=pH;Object.defineProperty(e,"keccak256",{enumerable:!0,get:function(){return d.keccak256}});var p=hH;Object.defineProperty(e,"Logger",{enumerable:!0,get:function(){return p.Logger}});var h=mH;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 m=yH;Object.defineProperty(e,"solidityKeccak256",{enumerable:!0,get:function(){return m.keccak256}}),Object.defineProperty(e,"solidityPack",{enumerable:!0,get:function(){return m.pack}}),Object.defineProperty(e,"soliditySha256",{enumerable:!0,get:function(){return m.sha256}});var y=bH;Object.defineProperty(e,"randomBytes",{enumerable:!0,get:function(){return y.randomBytes}}),Object.defineProperty(e,"shuffled",{enumerable:!0,get:function(){return y.shuffled}});var b=gH;Object.defineProperty(e,"checkProperties",{enumerable:!0,get:function(){return b.checkProperties}}),Object.defineProperty(e,"deepCopy",{enumerable:!0,get:function(){return b.deepCopy}}),Object.defineProperty(e,"defineReadOnly",{enumerable:!0,get:function(){return b.defineReadOnly}}),Object.defineProperty(e,"getStatic",{enumerable:!0,get:function(){return b.getStatic}}),Object.defineProperty(e,"resolveProperties",{enumerable:!0,get:function(){return b.resolveProperties}}),Object.defineProperty(e,"shallowCopy",{enumerable:!0,get:function(){return b.shallowCopy}});var g=n(vH);e.RLP=g;var v=wH;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=_H;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 _=EH;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=TH;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=AH;Object.defineProperty(e,"verifyMessage",{enumerable:!0,get:function(){return T.verifyMessage}}),Object.defineProperty(e,"verifyTypedData",{enumerable:!0,get:function(){return T.verifyTypedData}});var A=SH;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 S=mH;Object.defineProperty(e,"SupportedAlgorithm",{enumerable:!0,get:function(){return S.SupportedAlgorithm}});var k=_H;Object.defineProperty(e,"UnicodeNormalizationForm",{enumerable:!0,get:function(){return k.UnicodeNormalizationForm}}),Object.defineProperty(e,"Utf8ErrorReason",{enumerable:!0,get:function(){return k.Utf8ErrorReason}})}(iH);var kH={};Object.defineProperty(kH,"__esModule",{value:!0}),kH.DomainRegistryABI=void 0;kH.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 OH={};Object.defineProperty(OH,"__esModule",{value:!0}),OH.SeaportABIv14=void 0;OH.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 RH={};!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=nH;var r,n,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"}(r||(e.OrderType=r={})),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"}(n||(e.ItemType=n={})),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"}(RH);var xH={},IH={};Object.defineProperty(IH,"__esModule",{value:!0}),IH.ERC20ABI=void 0;IH.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 CH={};Object.defineProperty(CH,"__esModule",{value:!0}),CH.ERC721ABI=void 0;CH.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 NH,PH={},MH={};function BH(){if(NH)return MH;NH=1,Object.defineProperty(MH,"__esModule",{value:!0}),MH.getItemToCriteriaMap=MH.generateCriteriaResolvers=void 0;const e=RH,t=LH();MH.generateCriteriaResolvers=({orders:r,offerCriterias:n=[[]],considerationCriterias:i=[[]]})=>{const a=r.flatMap(((r,n)=>r.parameters.offer.map(((t,r)=>({orderIndex:n,item:t,index:r,side:e.Side.OFFER}))).filter((({item:e})=>(0,t.isCriteriaItem)(e.itemType))))),o=r.flatMap(((r,n)=>r.parameters.consideration.map(((t,r)=>({orderIndex:n,item:t,index:r,side:e.Side.CONSIDERATION}))).filter((({item:e})=>(0,t.isCriteriaItem)(e.itemType))))),s=(e,t)=>e.map((({orderIndex:e,item:r,index:n,side:i})=>{const a=r.identifierOrCriteria||"0",o=t[e][n];return{orderIndex:e,index:n,side:i,identifier:o.identifier,criteriaProof:"0"===a?[]:o.proof}}));return[...s(a,n),...s(o,i)]};return MH.getItemToCriteriaMap=(e,r)=>{const n=[...r];return e.reduce(((e,r)=>((0,t.isCriteriaItem)(r.itemType)&&e.set(r,n.shift()),e)),new Map)},MH}var DH,FH={};function LH(){return DH||(DH=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=nH,r=RH,n=BH(),i=FH;e.isCurrencyItem=({itemType:e})=>[r.ItemType.NATIVE,r.ItemType.ERC20].includes(e);e.isNativeCurrencyItem=({itemType:e})=>e===r.ItemType.NATIVE;e.isErc20Item=e=>e===r.ItemType.ERC20;e.isErc721Item=e=>[r.ItemType.ERC721,r.ItemType.ERC721_WITH_CRITERIA].includes(e);e.isErc1155Item=e=>[r.ItemType.ERC1155,r.ItemType.ERC1155_WITH_CRITERIA].includes(e);e.isCriteriaItem=e=>[r.ItemType.ERC721_WITH_CRITERIA,r.ItemType.ERC1155_WITH_CRITERIA].includes(e);e.getPresentItemAmount=({startAmount:e,endAmount:r,timeBasedItemParams:n})=>{const i=t.BigNumber.from(e),a=t.BigNumber.from(r);if(!n)return i.gt(a)?i:a;const{isConsiderationItem:o,currentBlockTimestamp:s,ascendingAmountTimestampBuffer:u,startTime:f,endTime:c}=n,l=t.BigNumber.from(c).sub(f),d=a.gt(e),p=t.BigNumber.from(d?s+u:s);if(p.lt(f))return i;const h=(p.gt(c)?t.BigNumber.from(c):p).sub(f),m=l.sub(h);return i.mul(m).add(a.mul(h)).add(o?l.sub(1):0).div(l)};e.getSummedTokenAndIdentifierAmounts=({items:r,criterias:i,timeBasedItemParams:a})=>{const o=(0,n.getItemToCriteriaMap)(r,i),s=r.reduce(((r,n)=>{var i,s,u,f;const c=null!==(s=null===(i=o.get(n))||void 0===i?void 0:i.identifier)&&void 0!==s?s:n.identifierOrCriteria;return Object.assign(Object.assign({},r),{[n.token]:Object.assign(Object.assign({},r[n.token]),{[c]:(null!==(f=null===(u=r[n.token])||void 0===u?void 0:u[c])&&void 0!==f?f:t.BigNumber.from(0)).add((0,e.getPresentItemAmount)({startAmount:n.startAmount,endAmount:n.endAmount,timeBasedItemParams:a}))})})}),{});return s};e.getMaximumSizeForOrder=({parameters:{offer:e,consideration:t}})=>{const r=[...e,...t].flatMap((({startAmount:e,endAmount:t})=>[e,t]));return(0,i.findGcd)(r)}}(PH)),PH}!function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.findGcd=e.gcd=void 0;const t=nH;e.gcd=(r,n)=>{const i=t.BigNumber.from(r),a=t.BigNumber.from(n);return i.eq(0)?a:(0,e.gcd)(a.mod(r),i)};e.findGcd=r=>{let n=t.BigNumber.from(r[0]);for(let t=1;t<r.length;t++)if(n=(0,e.gcd)(r[t],n),n.eq(1))return n;return n}}(FH);var UH={};!function(e){var t=on&&on.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,a){function o(e){try{u(n.next(e))}catch(e){a(e)}}function s(e){try{u(n.throw(e))}catch(e){a(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(o,s)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0}),e.getTagFromDomain=e.getTransactionMethods=e.executeAllActions=void 0;const r=iH;e.executeAllActions=e=>t(void 0,void 0,void 0,(function*(){for(let t=0;t<e.length-1;t++){const r=e[t];if("approval"===r.type){const e=yield r.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=(r,n,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 u=o=>t(void 0,void 0,void 0,(function*(){const t=Object.assign(Object.assign({},s),o),u=yield r.populateTransaction[n](...i,t);if(a){const t=(0,e.getTagFromDomain)(a);u.data=u.data+t}return u}));return{callStatic:e=>{const t=Object.assign(Object.assign({},s),e);return r.callStatic[n](...i,t)},estimateGas:e=>{const t=Object.assign(Object.assign({},s),e);return r.estimateGas[n](...i,t)},transact:e=>t(void 0,void 0,void 0,(function*(){const t=Object.assign(Object.assign({},s),e),n=yield u(t);return r.signer.sendTransaction(n)})),buildTransaction:u}};e.getTagFromDomain=e=>(0,r.keccak256)((0,r.toUtf8Bytes)(e)).slice(2,10)}(UH);var jH=on&&on.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,a){function o(e){try{u(n.next(e))}catch(e){a(e)}}function s(e){try{u(n.throw(e))}catch(e){a(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(o,s)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(xH,"__esModule",{value:!0}),xH.getApprovalActions=xH.approvedItemAmount=void 0;const qH=nH,zH=IH,HH=CH,VH=RH,GH=LH(),WH=UH;xH.approvedItemAmount=(e,t,r,n)=>jH(void 0,void 0,void 0,(function*(){if((0,GH.isErc721Item)(t.itemType)||(0,GH.isErc1155Item)(t.itemType)){return new qH.Contract(t.token,HH.ERC721ABI,n).isApprovedForAll(e,r).then((e=>e?VH.MAX_INT:qH.BigNumber.from(0)))}if(t.itemType===VH.ItemType.ERC20){return new qH.Contract(t.token,zH.ERC20ABI,n).allowance(e,r)}return VH.MAX_INT})),xH.getApprovalActions=function(e,t,r){return e.filter(((t,r)=>r===e.length-1||e[r+1].token!==t.token)).map((({token:e,operator:n,itemType:i,identifierOrCriteria:a,requiredApprovedAmount:o})=>{const s=(0,GH.isErc1155Item)(i);if((0,GH.isErc721Item)(i)||s){const o=new qH.Contract(e,HH.ERC721ABI,r);return{type:"approval",token:e,identifierOrCriteria:a,itemType:i,operator:n,transactionMethods:(0,WH.getTransactionMethods)(o.connect(r),t&&!s?"approve":"setApprovalForAll",[n,!(t&&!s)||a])}}{const s=new qH.Contract(e,zH.ERC20ABI,r);return{type:"approval",token:e,identifierOrCriteria:a,itemType:i,transactionMethods:(0,WH.getTransactionMethods)(s.connect(r),"approve",[n,t?o:VH.MAX_INT]),operator:n}}}))};var KH={},XH={},$H={};Object.defineProperty($H,"__esModule",{value:!0}),$H.ERC1155ABI=void 0;$H.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 JH=on&&on.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,a){function o(e){try{u(n.next(e))}catch(e){a(e)}}function s(e){try{u(n.throw(e))}catch(e){a(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(o,s)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(XH,"__esModule",{value:!0}),XH.balanceOf=void 0;const YH=nH,QH=$H,ZH=IH,eV=CH,tV=RH,rV=LH();XH.balanceOf=(e,t,r,n)=>JH(void 0,void 0,void 0,(function*(){if((0,rV.isErc721Item)(t.itemType)){const i=new YH.Contract(t.token,eV.ERC721ABI,r);return t.itemType===tV.ItemType.ERC721_WITH_CRITERIA?n?i.ownerOf(n.identifier).then((t=>YH.BigNumber.from(Number(t.toLowerCase()===e.toLowerCase())))):i.balanceOf(e):i.ownerOf(t.identifierOrCriteria).then((t=>YH.BigNumber.from(Number(t.toLowerCase()===e.toLowerCase()))))}if((0,rV.isErc1155Item)(t.itemType)){const i=new YH.Contract(t.token,QH.ERC1155ABI,r);if(t.itemType===tV.ItemType.ERC1155_WITH_CRITERIA){if(!n){const e=YH.BigNumber.from(t.startAmount),r=YH.BigNumber.from(t.endAmount);return e.gt(r)?e:r}return i.balanceOf(e,n.identifier)}return i.balanceOf(e,t.identifierOrCriteria)}if((0,rV.isErc20Item)(t.itemType)){return new YH.Contract(t.token,ZH.ERC20ABI,r).balanceOf(e)}return r.getBalance(e)})),function(e){var t=on&&on.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(i,a){function o(e){try{u(n.next(e))}catch(e){a(e)}}function s(e){try{u(n.throw(e))}catch(e){a(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(o,s)}u((n=n.apply(e,t||[])).next())}))};Object.defineProperty(e,"__esModule",{value:!0}),e.validateStandardFulfillBalancesAndApprovals=e.validateBasicFulfillBalancesAndApprovals=e.validateOfferBalancesAndApprovals=e.getInsufficientBalanceAndApprovalAmounts=e.getBalancesAndApprovals=void 0;const r=nH,n=RH,i=xH,a=XH,o=BH(),s=LH(),u=(e,t,r)=>{const n=e.find((({token:e,identifierOrCriteria:n})=>t.toLowerCase()===e.toLowerCase()&&n.toLowerCase()===r.toLowerCase()));if(!n)throw new Error("Balances and approvals didn't contain all tokens and identifiers");return n};e.getBalancesAndApprovals=({owner:e,items:u,criterias:f,operator:c,multicallProvider:l})=>t(void 0,void 0,void 0,(function*(){const d=(0,o.getItemToCriteriaMap)(u,f);return Promise.all(u.map((o=>t(void 0,void 0,void 0,(function*(){var t,u;let f=Promise.resolve(r.BigNumber.from(0));return f=(0,s.isErc721Item)(o.itemType)||(0,s.isErc1155Item)(o.itemType)||(0,s.isErc20Item)(o.itemType)?(0,i.approvedItemAmount)(e,o,c,l):Promise.resolve(n.MAX_INT),{token:o.token,identifierOrCriteria:null!==(u=null===(t=d.get(o))||void 0===t?void 0:t.identifier)&&void 0!==u?u:o.identifierOrCriteria,balance:yield(0,a.balanceOf)(e,o,l,d.get(o)),approvedAmount:yield f,itemType:o.itemType}})))))}));e.getInsufficientBalanceAndApprovalAmounts=({balancesAndApprovals:e,tokenAndIdentifierAmounts:t,operator:r})=>{const n=[...Object.entries(t).map((([e,t])=>Object.entries(t).map((([t,r])=>[e,t,r]))))].flat(),i=t=>n.filter((([r,n,i])=>u(e,r,n)[t].lt(i))).map((([r,n,i])=>{const a=u(e,r,n);return{token:r,identifierOrCriteria:n,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:r})))];return{insufficientBalances:a,insufficientApprovals:o}};e.validateOfferBalancesAndApprovals=({offer:t,criterias:r,balancesAndApprovals:n,timeBasedItemParams:i,throwOnInsufficientBalances:a=!0,throwOnInsufficientApprovals:o,operator:u})=>{const{insufficientBalances:f,insufficientApprovals:c}=(0,e.getInsufficientBalanceAndApprovalAmounts)({balancesAndApprovals:n,tokenAndIdentifierAmounts:(0,s.getSummedTokenAndIdentifierAmounts)({items:t,criterias:r,timeBasedItemParams:i?Object.assign(Object.assign({},i),{isConsiderationItem:!1}):void 0}),operator:u});if(a&&f.length>0)throw new Error("The offerer does not have the amount needed to create or fulfill.");if(o&&c.length>0)throw new Error("The offerer does not have the sufficient approvals.");return c};e.validateBasicFulfillBalancesAndApprovals=({offer:t,consideration:r,offererBalancesAndApprovals:n,fulfillerBalancesAndApprovals:i,timeBasedItemParams:a,offererOperator:o,fulfillerOperator:u})=>{(0,e.validateOfferBalancesAndApprovals)({offer:t,criterias:[],balancesAndApprovals:n,timeBasedItemParams:a,throwOnInsufficientApprovals:!0,operator:o});const f=r.filter((e=>e.itemType!==t[0].itemType)),{insufficientBalances:c,insufficientApprovals:l}=(0,e.getInsufficientBalanceAndApprovalAmounts)({balancesAndApprovals:i,tokenAndIdentifierAmounts:(0,s.getSummedTokenAndIdentifierAmounts)({items:f,criterias:[],timeBasedItemParams:Object.assign(Object.assign({},a),{isConsiderationItem:!0})}),operator:u});if(c.length>0)throw new Error("The fulfiller does not have the balances needed to fulfill.");return l};e.validateStandardFulfillBalancesAndApprovals=({offer:t,consideration:r,offerCriteria:n,considerationCriteria:i,offererBalancesAndApprovals:a,fulfillerBalancesAndApprovals:o,timeBasedItemParams:u,offererOperator:c,fulfillerOperator:l})=>{(0,e.validateOfferBalancesAndApprovals)({offer:t,criterias:n,balancesAndApprovals:a,timeBasedItemParams:u,throwOnInsufficientApprovals:!0,operator:c});const d=f({items:t,criterias:n,balancesAndApprovals:o,timeBasedItemParams:u}),{insufficientBalances:p,insufficientApprovals:h}=(0,e.getInsufficientBalanceAndApprovalAmounts)({balancesAndApprovals:d,tokenAndIdentifierAmounts:(0,s.getSummedTokenAndIdentifierAmounts)({items:r,criterias:i,timeBasedItemParams:Object.assign(Object.assign({},u),{isConsiderationItem:!0})}),operator:l});if(p.length>0)throw new Error("The fulfiller does not have the balances needed to fulfill.");return h};const f=({items:e,criterias:t,timeBasedItemParams:r,balancesAndApprovals:n})=>{const i=(0,s.getSummedTokenAndIdentifierAmounts)({items:e,criterias:t,timeBasedItemParams:Object.assign(Object.assign({},r),{isConsiderationItem:!1})}),a=n.map((e=>Object.assign({},e)));return Object.entries(i).forEach((([e,t])=>Object.entries(t).forEach((([t,r])=>{const n=u(a,e,t),i=a.indexOf(n);a[i].balance=a[i].balance.add(r)})))),a}}(KH);var nV,iV={},aV={},oV={},sV={},uV={exports:{}},fV={exports:{}};function cV(){return nV||(nV=1,function(e,t){e.exports=function(){var e=e||function(e,t){var r=Object.create||function(){function e(){}return function(t){var r;return e.prototype=t,r=new e,e.prototype=null,r}}(),n={},i=n.lib={},a=i.Base={extend:function(e){var t=r(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,r){e=this.words=e||[],this.sigBytes=r!=t?r:4*e.length},toString:function(e){return(e||u).stringify(this)},concat:function(e){var t=this.words,r=e.words,n=this.sigBytes,i=e.sigBytes;if(this.clamp(),n%4)for(var a=0;a<i;a++){var o=r[a>>>2]>>>24-a%4*8&255;t[n+a>>>2]|=o<<24-(n+a)%4*8}else for(a=0;a<i;a+=4)t[n+a>>>2]=r[a>>>2];return this.sigBytes+=i,this},clamp:function(){var t=this.words,r=this.sigBytes;t[r>>>2]&=4294967295<<32-r%4*8,t.length=e.ceil(r/4)},clone:function(){var e=a.clone.call(this);return e.words=this.words.slice(0),e},random:function(t){for(var r,n=[],i=function(t){var r=987654321,n=4294967295;return function(){var i=((r=36969*(65535&r)+(r>>16)&n)<<16)+(t=18e3*(65535&t)+(t>>16)&n)&n;return i/=4294967296,(i+=.5)*(e.random()>.5?1:-1)}},a=0;a<t;a+=4){var s=i(4294967296*(r||e.random()));r=987654071*s(),n.push(4294967296*s()|0)}return new o.init(n,t)}}),s=n.enc={},u=s.Hex={stringify:function(e){for(var t=e.words,r=e.sigBytes,n=[],i=0;i<r;i++){var a=t[i>>>2]>>>24-i%4*8&255;n.push((a>>>4).toString(16)),n.push((15&a).toString(16))}return n.join("")},parse:function(e){for(var t=e.length,r=[],n=0;n<t;n+=2)r[n>>>3]|=parseInt(e.substr(n,2),16)<<24-n%8*4;return new o.init(r,t/2)}},f=s.Latin1={stringify:function(e){for(var t=e.words,r=e.sigBytes,n=[],i=0;i<r;i++){var a=t[i>>>2]>>>24-i%4*8&255;n.push(String.fromCharCode(a))}return n.join("")},parse:function(e){for(var t=e.length,r=[],n=0;n<t;n++)r[n>>>2]|=(255&e.charCodeAt(n))<<24-n%4*8;return new o.init(r,t)}},c=s.Utf8={stringify:function(e){try{return decodeURIComponent(escape(f.stringify(e)))}catch(e){throw new Error("Malformed UTF-8 data")}},parse:function(e){return f.parse(unescape(encodeURIComponent(e)))}},l=i.BufferedBlockAlgorithm=a.extend({reset:function(){this._data=new o.init,this._nDataBytes=0},_append:function(e){"string"==typeof e&&(e=c.parse(e)),this._data.concat(e),this._nDataBytes+=e.sigBytes},_process:function(t){var r=this._data,n=r.words,i=r.sigBytes,a=this.blockSize,s=i/(4*a),u=(s=t?e.ceil(s):e.max((0|s)-this._minBufferSize,0))*a,f=e.min(4*u,i);if(u){for(var c=0;c<u;c+=a)this._doProcessBlock(n,c);var l=n.splice(0,u);r.sigBytes-=f}return new o.init(l,f)},clone:function(){var e=a.clone.call(this);return e._data=this._data.clone(),e},_minBufferSize:0});i.Hasher=l.extend({cfg:a.extend(),init:function(e){this.cfg=this.cfg.extend(e),this.reset()},reset:function(){l.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,r){return new e.init(r).finalize(t)}},_createHmacHelper:function(e){return function(t,r){return new d.HMAC.init(e,r).finalize(t)}}});var d=n.algo={};return n}(Math);return e}()}(fV)),fV.exports}!function(e,t){e.exports=function(e){return function(t){var r=e,n=r.lib,i=n.WordArray,a=n.Hasher,o=r.algo,s=[],u=[];!function(){function e(e){for(var r=t.sqrt(e),n=2;n<=r;n++)if(!(e%n))return!1;return!0}function r(e){return 4294967296*(e-(0|e))|0}for(var n=2,i=0;i<64;)e(n)&&(i<8&&(s[i]=r(t.pow(n,.5))),u[i]=r(t.pow(n,1/3)),i++),n++}();var f=[],c=o.SHA256=a.extend({_doReset:function(){this._hash=new i.init(s.slice(0))},_doProcessBlock:function(e,t){for(var r=this._hash.words,n=r[0],i=r[1],a=r[2],o=r[3],s=r[4],c=r[5],l=r[6],d=r[7],p=0;p<64;p++){if(p<16)f[p]=0|e[t+p];else{var h=f[p-15],m=(h<<25|h>>>7)^(h<<14|h>>>18)^h>>>3,y=f[p-2],b=(y<<15|y>>>17)^(y<<13|y>>>19)^y>>>10;f[p]=m+f[p-7]+b+f[p-16]}var g=n&i^n&a^i&a,v=(n<<30|n>>>2)^(n<<19|n>>>13)^(n<<10|n>>>22),w=d+((s<<26|s>>>6)^(s<<21|s>>>11)^(s<<7|s>>>25))+(s&c^~s&l)+u[p]+f[p];d=l,l=c,c=s,s=o+w|0,o=a,a=i,i=n,n=w+(v+g)|0}r[0]=r[0]+n|0,r[1]=r[1]+i|0,r[2]=r[2]+a|0,r[3]=r[3]+o|0,r[4]=r[4]+s|0,r[5]=r[5]+c|0,r[6]=r[6]+l|0,r[7]=r[7]+d|0},_doFinalize:function(){var e=this._data,r=e.words,n=8*this._nDataBytes,i=8*e.sigBytes;return r[i>>>5]|=128<<24-i%32,r[14+(i+64>>>9<<4)]=t.floor(n/4294967296),r[15+(i+64>>>9<<4)]=n,e.sigBytes=4*r.length,this._process(),this._hash},clone:function(){var e=a.clone.call(this);return e._hash=this._hash.clone(),e}});r.SHA256=a._createHelper(c),r.HmacSHA256=a._createHmacHelper(c)}(Math),e.SHA256}(cV())}(uV);var lV=uV.exports,dV={exports:{}};!function(e,t){e.exports=function(){function e(e,t){var r=t?"└":"├";return r+=e?"─ ":"──┐"}function t(e,t){var r=[];for(var n in e)e.hasOwnProperty(n)&&(t&&"function"==typeof e[n]||r.push(n));return r}function r(n,i,a,o,s,u,f){var c,l,d="",p=0,h=o.slice(0);if(h.push([i,a])&&o.length>0&&(o.forEach((function(e,t){t>0&&(d+=(e[1]?" ":"│")+" "),l||e[0]!==i||(l=!0)})),d+=e(n,a)+n,s&&("object"!=typeof i||i instanceof Date)&&(d+=": "+i),l&&(d+=" (circular ref.)"),f(d)),!l&&"object"==typeof i){var m=t(i,u);m.forEach((function(e){c=++p===m.length,r(e,i[e],c,h,s,u,f)}))}}var n={asLines:function(e,t,n,i){r(".",e,!1,[],t,"function"!=typeof n&&n,i||n)},asTree:function(e,t,n){var i="";return r(".",e,!1,[],t,n,(function(e){i+=e+"\n"})),i}};return n}()}(dV);var pV,hV=dV.exports,mV={},yV={exports:{}},bV={exports:{}};function gV(){return pV||(pV=1,function(e,t){e.exports=function(e){return function(t){var r=e,n=r.lib,i=n.Base,a=n.WordArray,o=r.x64={};o.Word=i.extend({init:function(e,t){this.high=e,this.low=t}}),o.WordArray=i.extend({init:function(e,r){e=this.words=e||[],this.sigBytes=r!=t?r:8*e.length},toX32:function(){for(var e=this.words,t=e.length,r=[],n=0;n<t;n++){var i=e[n];r.push(i.high),r.push(i.low)}return a.create(r,this.sigBytes)},clone:function(){for(var e=i.clone.call(this),t=e.words=this.words.slice(0),r=t.length,n=0;n<r;n++)t[n]=t[n].clone();return e}})}(),e}(cV())}(bV)),bV.exports}var vV,wV={exports:{}};function _V(){return vV||(vV=1,function(e,t){e.exports=function(e){return function(){if("function"==typeof ArrayBuffer){var t=e.lib.WordArray,r=t.init,n=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,n=[],i=0;i<t;i++)n[i>>>2]|=e[i]<<24-i%4*8;r.call(this,n,t)}else r.apply(this,arguments)};n.prototype=t}}(),e.lib.WordArray}(cV())}(wV)),wV.exports}var EV,TV={exports:{}};function AV(){return EV||(EV=1,function(e,t){e.exports=function(e){return function(){var t=e,r=t.lib.WordArray,n=t.enc;function i(e){return e<<8&4278255360|e>>>8&16711935}n.Utf16=n.Utf16BE={stringify:function(e){for(var t=e.words,r=e.sigBytes,n=[],i=0;i<r;i+=2){var a=t[i>>>2]>>>16-i%4*8&65535;n.push(String.fromCharCode(a))}return n.join("")},parse:function(e){for(var t=e.length,n=[],i=0;i<t;i++)n[i>>>1]|=e.charCodeAt(i)<<16-i%2*16;return r.create(n,2*t)}},n.Utf16LE={stringify:function(e){for(var t=e.words,r=e.sigBytes,n=[],a=0;a<r;a+=2){var o=i(t[a>>>2]>>>16-a%4*8&65535);n.push(String.fromCharCode(o))}return n.join("")},parse:function(e){for(var t=e.length,n=[],a=0;a<t;a++)n[a>>>1]|=i(e.charCodeAt(a)<<16-a%2*16);return r.create(n,2*t)}}}(),e.enc.Utf16}(cV())}(TV)),TV.exports}var SV,kV={exports:{}};function OV(){return SV||(SV=1,function(e,t){e.exports=function(e){return function(){var t=e,r=t.lib.WordArray;function n(e,t,n){for(var i=[],a=0,o=0;o<t;o++)if(o%4){var s=n[e.charCodeAt(o-1)]<<o%4*2,u=n[e.charCodeAt(o)]>>>6-o%4*2;i[a>>>2]|=(s|u)<<24-a%4*8,a++}return r.create(i,a)}t.enc.Base64={stringify:function(e){var t=e.words,r=e.sigBytes,n=this._map;e.clamp();for(var i=[],a=0;a<r;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<r;s++)i.push(n.charAt(o>>>6*(3-s)&63));var u=n.charAt(64);if(u)for(;i.length%4;)i.push(u);return i.join("")},parse:function(e){var t=e.length,r=this._map,i=this._reverseMap;if(!i){i=this._reverseMap=[];for(var a=0;a<r.length;a++)i[r.charCodeAt(a)]=a}var o=r.charAt(64);if(o){var s=e.indexOf(o);-1!==s&&(t=s)}return n(e,t,i)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="}}(),e.enc.Base64}(cV())}(kV)),kV.exports}var RV,xV={exports:{}};function IV(){return RV||(RV=1,function(e,t){e.exports=function(e){return function(t){var r=e,n=r.lib,i=n.WordArray,a=n.Hasher,o=r.algo,s=[];!function(){for(var e=0;e<64;e++)s[e]=4294967296*t.abs(t.sin(e+1))|0}();var u=o.MD5=a.extend({_doReset:function(){this._hash=new i.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(e,t){for(var r=0;r<16;r++){var n=t+r,i=e[n];e[n]=16711935&(i<<8|i>>>24)|4278255360&(i<<24|i>>>8)}var a=this._hash.words,o=e[t+0],u=e[t+1],p=e[t+2],h=e[t+3],m=e[t+4],y=e[t+5],b=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],S=e[t+14],k=e[t+15],O=a[0],R=a[1],x=a[2],I=a[3];O=f(O,R,x,I,o,7,s[0]),I=f(I,O,R,x,u,12,s[1]),x=f(x,I,O,R,p,17,s[2]),R=f(R,x,I,O,h,22,s[3]),O=f(O,R,x,I,m,7,s[4]),I=f(I,O,R,x,y,12,s[5]),x=f(x,I,O,R,b,17,s[6]),R=f(R,x,I,O,g,22,s[7]),O=f(O,R,x,I,v,7,s[8]),I=f(I,O,R,x,w,12,s[9]),x=f(x,I,O,R,_,17,s[10]),R=f(R,x,I,O,E,22,s[11]),O=f(O,R,x,I,T,7,s[12]),I=f(I,O,R,x,A,12,s[13]),x=f(x,I,O,R,S,17,s[14]),O=c(O,R=f(R,x,I,O,k,22,s[15]),x,I,u,5,s[16]),I=c(I,O,R,x,b,9,s[17]),x=c(x,I,O,R,E,14,s[18]),R=c(R,x,I,O,o,20,s[19]),O=c(O,R,x,I,y,5,s[20]),I=c(I,O,R,x,_,9,s[21]),x=c(x,I,O,R,k,14,s[22]),R=c(R,x,I,O,m,20,s[23]),O=c(O,R,x,I,w,5,s[24]),I=c(I,O,R,x,S,9,s[25]),x=c(x,I,O,R,h,14,s[26]),R=c(R,x,I,O,v,20,s[27]),O=c(O,R,x,I,A,5,s[28]),I=c(I,O,R,x,p,9,s[29]),x=c(x,I,O,R,g,14,s[30]),O=l(O,R=c(R,x,I,O,T,20,s[31]),x,I,y,4,s[32]),I=l(I,O,R,x,v,11,s[33]),x=l(x,I,O,R,E,16,s[34]),R=l(R,x,I,O,S,23,s[35]),O=l(O,R,x,I,u,4,s[36]),I=l(I,O,R,x,m,11,s[37]),x=l(x,I,O,R,g,16,s[38]),R=l(R,x,I,O,_,23,s[39]),O=l(O,R,x,I,A,4,s[40]),I=l(I,O,R,x,o,11,s[41]),x=l(x,I,O,R,h,16,s[42]),R=l(R,x,I,O,b,23,s[43]),O=l(O,R,x,I,w,4,s[44]),I=l(I,O,R,x,T,11,s[45]),x=l(x,I,O,R,k,16,s[46]),O=d(O,R=l(R,x,I,O,p,23,s[47]),x,I,o,6,s[48]),I=d(I,O,R,x,g,10,s[49]),x=d(x,I,O,R,S,15,s[50]),R=d(R,x,I,O,y,21,s[51]),O=d(O,R,x,I,T,6,s[52]),I=d(I,O,R,x,h,10,s[53]),x=d(x,I,O,R,_,15,s[54]),R=d(R,x,I,O,u,21,s[55]),O=d(O,R,x,I,v,6,s[56]),I=d(I,O,R,x,k,10,s[57]),x=d(x,I,O,R,b,15,s[58]),R=d(R,x,I,O,A,21,s[59]),O=d(O,R,x,I,m,6,s[60]),I=d(I,O,R,x,E,10,s[61]),x=d(x,I,O,R,p,15,s[62]),R=d(R,x,I,O,w,21,s[63]),a[0]=a[0]+O|0,a[1]=a[1]+R|0,a[2]=a[2]+x|0,a[3]=a[3]+I|0},_doFinalize:function(){var e=this._data,r=e.words,n=8*this._nDataBytes,i=8*e.sigBytes;r[i>>>5]|=128<<24-i%32;var a=t.floor(n/4294967296),o=n;r[15+(i+64>>>9<<4)]=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8),r[14+(i+64>>>9<<4)]=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8),e.sigBytes=4*(r.length+1),this._process();for(var s=this._hash,u=s.words,f=0;f<4;f++){var c=u[f];u[f]=16711935&(c<<8|c>>>24)|4278255360&(c<<24|c>>>8)}return s},clone:function(){var e=a.clone.call(this);return e._hash=this._hash.clone(),e}});function f(e,t,r,n,i,a,o){var s=e+(t&r|~t&n)+i+o;return(s<<a|s>>>32-a)+t}function c(e,t,r,n,i,a,o){var s=e+(t&n|r&~n)+i+o;return(s<<a|s>>>32-a)+t}function l(e,t,r,n,i,a,o){var s=e+(t^r^n)+i+o;return(s<<a|s>>>32-a)+t}function d(e,t,r,n,i,a,o){var s=e+(r^(t|~n))+i+o;return(s<<a|s>>>32-a)+t}r.MD5=a._createHelper(u),r.HmacMD5=a._createHmacHelper(u)}(Math),e.MD5}(cV())}(xV)),xV.exports}var CV,NV={exports:{}};function PV(){return CV||(CV=1,function(e,t){e.exports=function(e){return function(){var t=e,r=t.lib,n=r.WordArray,i=r.Hasher,a=t.algo,o=[],s=a.SHA1=i.extend({_doReset:function(){this._hash=new n.init([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(e,t){for(var r=this._hash.words,n=r[0],i=r[1],a=r[2],s=r[3],u=r[4],f=0;f<80;f++){if(f<16)o[f]=0|e[t+f];else{var c=o[f-3]^o[f-8]^o[f-14]^o[f-16];o[f]=c<<1|c>>>31}var l=(n<<5|n>>>27)+u+o[f];l+=f<20?1518500249+(i&a|~i&s):f<40?1859775393+(i^a^s):f<60?(i&a|i&s|a&s)-1894007588:(i^a^s)-899497514,u=s,s=a,a=i<<30|i>>>2,i=n,n=l}r[0]=r[0]+n|0,r[1]=r[1]+i|0,r[2]=r[2]+a|0,r[3]=r[3]+s|0,r[4]=r[4]+u|0},_doFinalize:function(){var e=this._data,t=e.words,r=8*this._nDataBytes,n=8*e.sigBytes;return t[n>>>5]|=128<<24-n%32,t[14+(n+64>>>9<<4)]=Math.floor(r/4294967296),t[15+(n+64>>>9<<4)]=r,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}(cV())}(NV)),NV.exports}var MV,BV={exports:{}};var DV,FV={exports:{}};function LV(){return DV||(DV=1,function(e,t){e.exports=function(e){return function(){var t=e,r=t.lib.Hasher,n=t.x64,i=n.Word,a=n.WordArray,o=t.algo;function s(){return i.create.apply(i,arguments)}var u=[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)],f=[];!function(){for(var e=0;e<80;e++)f[e]=s()}();var c=o.SHA512=r.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 r=this._hash.words,n=r[0],i=r[1],a=r[2],o=r[3],s=r[4],c=r[5],l=r[6],d=r[7],p=n.high,h=n.low,m=i.high,y=i.low,b=a.high,g=a.low,v=o.high,w=o.low,_=s.high,E=s.low,T=c.high,A=c.low,S=l.high,k=l.low,O=d.high,R=d.low,x=p,I=h,C=m,N=y,P=b,M=g,B=v,D=w,F=_,L=E,U=T,j=A,q=S,z=k,H=O,V=R,G=0;G<80;G++){var W=f[G];if(G<16)var K=W.high=0|e[t+2*G],X=W.low=0|e[t+2*G+1];else{var $=f[G-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=f[G-2],te=ee.high,re=ee.low,ne=(te>>>19|re<<13)^(te<<3|re>>>29)^te>>>6,ie=(re>>>19|te<<13)^(re<<3|te>>>29)^(re>>>6|te<<26),ae=f[G-7],oe=ae.high,se=ae.low,ue=f[G-16],fe=ue.high,ce=ue.low;K=(K=(K=Q+oe+((X=Z+se)>>>0<Z>>>0?1:0))+ne+((X+=ie)>>>0<ie>>>0?1:0))+fe+((X+=ce)>>>0<ce>>>0?1:0),W.high=K,W.low=X}var le,de=F&U^~F&q,pe=L&j^~L&z,he=x&C^x&P^C&P,me=I&N^I&M^N&M,ye=(x>>>28|I<<4)^(x<<30|I>>>2)^(x<<25|I>>>7),be=(I>>>28|x<<4)^(I<<30|x>>>2)^(I<<25|x>>>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=u[G],_e=we.high,Ee=we.low,Te=H+ge+((le=V+ve)>>>0<V>>>0?1:0),Ae=be+me;H=q,V=z,q=U,z=j,U=F,j=L,F=B+(Te=(Te=(Te=Te+de+((le+=pe)>>>0<pe>>>0?1:0))+_e+((le+=Ee)>>>0<Ee>>>0?1:0))+K+((le+=X)>>>0<X>>>0?1:0))+((L=D+le|0)>>>0<D>>>0?1:0)|0,B=P,D=M,P=C,M=N,C=x,N=I,x=Te+(ye+he+(Ae>>>0<be>>>0?1:0))+((I=le+Ae|0)>>>0<le>>>0?1:0)|0}h=n.low=h+I,n.high=p+x+(h>>>0<I>>>0?1:0),y=i.low=y+N,i.high=m+C+(y>>>0<N>>>0?1:0),g=a.low=g+M,a.high=b+P+(g>>>0<M>>>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=c.low=A+j,c.high=T+U+(A>>>0<j>>>0?1:0),k=l.low=k+z,l.high=S+q+(k>>>0<z>>>0?1:0),R=d.low=R+V,d.high=O+H+(R>>>0<V>>>0?1:0)},_doFinalize:function(){var e=this._data,t=e.words,r=8*this._nDataBytes,n=8*e.sigBytes;return t[n>>>5]|=128<<24-n%32,t[30+(n+128>>>10<<5)]=Math.floor(r/4294967296),t[31+(n+128>>>10<<5)]=r,e.sigBytes=4*t.length,this._process(),this._hash.toX32()},clone:function(){var e=r.clone.call(this);return e._hash=this._hash.clone(),e},blockSize:32});t.SHA512=r._createHelper(c),t.HmacSHA512=r._createHmacHelper(c)}(),e.SHA512}(cV(),gV())}(FV)),FV.exports}var UV,jV={exports:{}};var qV,zV={exports:{}};function HV(){return qV||(qV=1,function(e,t){e.exports=function(e){return function(t){var r=e,n=r.lib,i=n.WordArray,a=n.Hasher,o=r.x64.Word,s=r.algo,u=[],f=[],c=[];!function(){for(var e=1,t=0,r=0;r<24;r++){u[e+5*t]=(r+1)*(r+2)/2%64;var n=(2*e+3*t)%5;e=t%5,t=n}for(e=0;e<5;e++)for(t=0;t<5;t++)f[e+5*t]=t+(2*e+3*t)%5*5;for(var i=1,a=0;a<24;a++){for(var s=0,l=0,d=0;d<7;d++){if(1&i){var p=(1<<d)-1;p<32?l^=1<<p:s^=1<<p-32}128&i?i=i<<1^113:i<<=1}c[a]=o.create(s,l)}}();var l=[];!function(){for(var e=0;e<25;e++)l[e]=o.create()}();var d=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 r=this._state,n=this.blockSize/2,i=0;i<n;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),(R=r[i]).high^=o,R.low^=a}for(var s=0;s<24;s++){for(var d=0;d<5;d++){for(var p=0,h=0,m=0;m<5;m++)p^=(R=r[d+5*m]).high,h^=R.low;var y=l[d];y.high=p,y.low=h}for(d=0;d<5;d++){var b=l[(d+4)%5],g=l[(d+1)%5],v=g.high,w=g.low;for(p=b.high^(v<<1|w>>>31),h=b.low^(w<<1|v>>>31),m=0;m<5;m++)(R=r[d+5*m]).high^=p,R.low^=h}for(var _=1;_<25;_++){var E=(R=r[_]).high,T=R.low,A=u[_];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 S=l[f[_]];S.high=p,S.low=h}var k=l[0],O=r[0];for(k.high=O.high,k.low=O.low,d=0;d<5;d++)for(m=0;m<5;m++){var R=r[_=d+5*m],x=l[_],I=l[(d+1)%5+5*m],C=l[(d+2)%5+5*m];R.high=x.high^~I.high&C.high,R.low=x.low^~I.low&C.low}R=r[0];var N=c[s];R.high^=N.high,R.low^=N.low}},_doFinalize:function(){var e=this._data,r=e.words;this._nDataBytes;var n=8*e.sigBytes,a=32*this.blockSize;r[n>>>5]|=1<<24-n%32,r[(t.ceil((n+1)/a)*a>>>5)-1]|=128,e.sigBytes=4*r.length,this._process();for(var o=this._state,s=this.cfg.outputLength/8,u=s/8,f=[],c=0;c<u;c++){var l=o[c],d=l.high,p=l.low;d=16711935&(d<<8|d>>>24)|4278255360&(d<<24|d>>>8),p=16711935&(p<<8|p>>>24)|4278255360&(p<<24|p>>>8),f.push(p),f.push(d)}return new i.init(f,s)},clone:function(){for(var e=a.clone.call(this),t=e._state=this._state.slice(0),r=0;r<25;r++)t[r]=t[r].clone();return e}});r.SHA3=a._createHelper(d),r.HmacSHA3=a._createHmacHelper(d)}(Math),e.SHA3}(cV(),gV())}(zV)),zV.exports}var VV,GV={exports:{}};var WV,KV={exports:{}};function XV(){return WV||(WV=1,function(e,t){e.exports=function(e){!function(){var t=e,r=t.lib.Base,n=t.enc.Utf8;t.algo.HMAC=r.extend({init:function(e,t){e=this._hasher=new e.init,"string"==typeof t&&(t=n.parse(t));var r=e.blockSize,i=4*r;t.sigBytes>i&&(t=e.finalize(t)),t.clamp();for(var a=this._oKey=t.clone(),o=this._iKey=t.clone(),s=a.words,u=o.words,f=0;f<r;f++)s[f]^=1549556828,u[f]^=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,r=t.finalize(e);return t.reset(),t.finalize(this._oKey.clone().concat(r))}})}()}(cV())}(KV)),KV.exports}var $V,JV={exports:{}};var YV,QV={exports:{}};function ZV(){return YV||(YV=1,function(e,t){e.exports=function(e){return function(){var t=e,r=t.lib,n=r.Base,i=r.WordArray,a=t.algo,o=a.MD5,s=a.EvpKDF=n.extend({cfg:n.extend({keySize:4,hasher:o,iterations:1}),init:function(e){this.cfg=this.cfg.extend(e)},compute:function(e,t){for(var r=this.cfg,n=r.hasher.create(),a=i.create(),o=a.words,s=r.keySize,u=r.iterations;o.length<s;){f&&n.update(f);var f=n.update(e).finalize(t);n.reset();for(var c=1;c<u;c++)f=n.finalize(f),n.reset();a.concat(f)}return a.sigBytes=4*s,a}});t.EvpKDF=function(e,t,r){return s.create(r).compute(e,t)}}(),e.EvpKDF}(cV(),PV(),XV())}(QV)),QV.exports}var eG,tG={exports:{}};function rG(){return eG||(eG=1,function(e,t){e.exports=function(e){e.lib.Cipher||function(t){var r=e,n=r.lib,i=n.Base,a=n.WordArray,o=n.BufferedBlockAlgorithm,s=r.enc;s.Utf8;var u=s.Base64,f=r.algo.EvpKDF,c=n.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,r){this.cfg=this.cfg.extend(r),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:b}return function(t){return{encrypt:function(r,n,i){return e(n).encrypt(t,r,n,i)},decrypt:function(r,n,i){return e(n).decrypt(t,r,n,i)}}}}()});n.StreamCipher=c.extend({_doFinalize:function(){return this._process(!0)},blockSize:1});var l=r.mode={},d=n.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=l.CBC=function(){var e=d.extend();function r(e,r,n){var i=this._iv;if(i){var a=i;this._iv=t}else a=this._prevBlock;for(var o=0;o<n;o++)e[r+o]^=a[o]}return e.Encryptor=e.extend({processBlock:function(e,t){var n=this._cipher,i=n.blockSize;r.call(this,e,t,i),n.encryptBlock(e,t),this._prevBlock=e.slice(t,t+i)}}),e.Decryptor=e.extend({processBlock:function(e,t){var n=this._cipher,i=n.blockSize,a=e.slice(t,t+i);n.decryptBlock(e,t),r.call(this,e,t,i),this._prevBlock=a}}),e}(),h=(r.pad={}).Pkcs7={pad:function(e,t){for(var r=4*t,n=r-e.sigBytes%r,i=n<<24|n<<16|n<<8|n,o=[],s=0;s<n;s+=4)o.push(i);var u=a.create(o,n);e.concat(u)},unpad:function(e){var t=255&e.words[e.sigBytes-1>>>2];e.sigBytes-=t}};n.BlockCipher=c.extend({cfg:c.cfg.extend({mode:p,padding:h}),reset:function(){c.reset.call(this);var e=this.cfg,t=e.iv,r=e.mode;if(this._xformMode==this._ENC_XFORM_MODE)var n=r.createEncryptor;else n=r.createDecryptor,this._minBufferSize=1;this._mode&&this._mode.__creator==n?this._mode.init(this,t&&t.words):(this._mode=n.call(r,this,t&&t.words),this._mode.__creator=n)},_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 m=n.CipherParams=i.extend({init:function(e){this.mixIn(e)},toString:function(e){return(e||this.formatter).stringify(this)}}),y=(r.format={}).OpenSSL={stringify:function(e){var t=e.ciphertext,r=e.salt;if(r)var n=a.create([1398893684,1701076831]).concat(r).concat(t);else n=t;return n.toString(u)},parse:function(e){var t=u.parse(e),r=t.words;if(1398893684==r[0]&&1701076831==r[1]){var n=a.create(r.slice(2,4));r.splice(0,4),t.sigBytes-=16}return m.create({ciphertext:t,salt:n})}},b=n.SerializableCipher=i.extend({cfg:i.extend({format:y}),encrypt:function(e,t,r,n){n=this.cfg.extend(n);var i=e.createEncryptor(r,n),a=i.finalize(t),o=i.cfg;return m.create({ciphertext:a,key:r,iv:o.iv,algorithm:e,mode:o.mode,padding:o.padding,blockSize:e.blockSize,formatter:n.format})},decrypt:function(e,t,r,n){return n=this.cfg.extend(n),t=this._parse(t,n.format),e.createDecryptor(r,n).finalize(t.ciphertext)},_parse:function(e,t){return"string"==typeof e?t.parse(e,this):e}}),g=(r.kdf={}).OpenSSL={execute:function(e,t,r,n){n||(n=a.random(8));var i=f.create({keySize:t+r}).compute(e,n),o=a.create(i.words.slice(t),4*r);return i.sigBytes=4*t,m.create({key:i,iv:o,salt:n})}},v=n.PasswordBasedCipher=b.extend({cfg:b.cfg.extend({kdf:g}),encrypt:function(e,t,r,n){var i=(n=this.cfg.extend(n)).kdf.execute(r,e.keySize,e.ivSize);n.iv=i.iv;var a=b.encrypt.call(this,e,t,i.key,n);return a.mixIn(i),a},decrypt:function(e,t,r,n){n=this.cfg.extend(n),t=this._parse(t,n.format);var i=n.kdf.execute(r,e.keySize,e.ivSize,t.salt);return n.iv=i.iv,b.decrypt.call(this,e,t,i.key,n)}})}()}(cV(),ZV())}(tG)),tG.exports}var nG,iG={exports:{}};function aG(){return nG||(nG=1,function(e,t){e.exports=function(e){return e.mode.CFB=function(){var t=e.lib.BlockCipherMode.extend();function r(e,t,r,n){var i=this._iv;if(i){var a=i.slice(0);this._iv=void 0}else a=this._prevBlock;n.encryptBlock(a,0);for(var o=0;o<r;o++)e[t+o]^=a[o]}return t.Encryptor=t.extend({processBlock:function(e,t){var n=this._cipher,i=n.blockSize;r.call(this,e,t,i,n),this._prevBlock=e.slice(t,t+i)}}),t.Decryptor=t.extend({processBlock:function(e,t){var n=this._cipher,i=n.blockSize,a=e.slice(t,t+i);r.call(this,e,t,i,n),this._prevBlock=a}}),t}(),e.mode.CFB}(cV(),rG())}(iG)),iG.exports}var oG,sG={exports:{}};function uG(){return oG||(oG=1,function(e,t){e.exports=function(e){return e.mode.CTR=(t=e.lib.BlockCipherMode.extend(),r=t.Encryptor=t.extend({processBlock:function(e,t){var r=this._cipher,n=r.blockSize,i=this._iv,a=this._counter;i&&(a=this._counter=i.slice(0),this._iv=void 0);var o=a.slice(0);r.encryptBlock(o,0),a[n-1]=a[n-1]+1|0;for(var s=0;s<n;s++)e[t+s]^=o[s]}}),t.Decryptor=r,t),e.mode.CTR;var t,r}(cV(),rG())}(sG)),sG.exports}var fG,cG={exports:{}};function lG(){return fG||(fG=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
@@ -81,5 +81,5 @@ return function(t){var r=e,n=r.lib,i=n.WordArray,a=n.Hasher,o=r.algo,s=i.create(
81
81
  *
82
82
  * This source code is licensed under the MIT license found in the
83
83
  * LICENSE file in the root directory of this source tree.
84
- */"production"===process.env.NODE_ENV?$2.exports=function(){if(t3)return J2;t3=1;var e=r3,t=Symbol.for("react.element"),r=Symbol.for("react.fragment"),n=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,r,o){var s,u={},f=null,c=null;for(s in void 0!==o&&(f=""+o),void 0!==r.key&&(f=""+r.key),void 0!==r.ref&&(c=r.ref),r)n.call(r,s)&&!a.hasOwnProperty(s)&&(u[s]=r[s]);if(e&&e.defaultProps)for(s in r=e.defaultProps)void 0===u[s]&&(u[s]=r[s]);return{$$typeof:t,type:e,key:f,ref:c,props:u,_owner:i.current}}return J2.Fragment=r,J2.jsx=o,J2.jsxs=o,J2}():$2.exports=(n3||(n3=1,"production"!==process.env.NODE_ENV&&function(){var e=r3,t=Symbol.for("react.element"),r=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),a=Symbol.for("react.profiler"),o=Symbol.for("react.provider"),s=Symbol.for("react.context"),u=Symbol.for("react.forward_ref"),f=Symbol.for("react.suspense"),c=Symbol.for("react.suspense_list"),l=Symbol.for("react.memo"),d=Symbol.for("react.lazy"),p=Symbol.for("react.offscreen"),h=Symbol.iterator,m="@@iterator",y=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function b(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];!function(e,t,r){var n=y.ReactDebugCurrentFrame.getStackAddendum();""!==n&&(t+="%s",r=r.concat([n]));var i=r.map((function(e){return String(e)}));i.unshift("Warning: "+t),Function.prototype.apply.call(console[e],console,i)}("error",e,r)}var g,v=!1,w=!1,_=!1,E=!1,T=!1;function A(e){return e.displayName||"Context"}function S(e){if(null==e)return null;if("number"==typeof e.tag&&b("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),"function"==typeof e)return e.displayName||e.name||null;if("string"==typeof e)return e;switch(e){case n:return"Fragment";case r:return"Portal";case a:return"Profiler";case i:return"StrictMode";case f:return"Suspense";case c:return"SuspenseList"}if("object"==typeof e)switch(e.$$typeof){case s:return A(e)+".Consumer";case o:return A(e._context)+".Provider";case u:return function(e,t,r){var n=e.displayName;if(n)return n;var i=t.displayName||t.name||"";return""!==i?r+"("+i+")":r}(e,e.render,"ForwardRef");case l:var t=e.displayName||null;return null!==t?t:S(e.type)||"Memo";case d:var p=e,h=p._payload,m=p._init;try{return S(m(h))}catch(e){return null}}return null}g=Symbol.for("react.module.reference");var k,O,R,x,I,C,N,P=Object.assign,M=0;function B(){}B.__reactDisabledLog=!0;var D,F=y.ReactCurrentDispatcher;function L(e,t,r){if(void 0===D)try{throw Error()}catch(e){var n=e.stack.trim().match(/\n( *(at )?)/);D=n&&n[1]||""}return"\n"+D+e}var U,j=!1,q="function"==typeof WeakMap?WeakMap:Map;function z(e,t){if(!e||j)return"";var r,n=U.get(e);if(void 0!==n)return n;j=!0;var i,a=Error.prepareStackTrace;Error.prepareStackTrace=void 0,i=F.current,F.current=null,function(){if(0===M){k=console.log,O=console.info,R=console.warn,x=console.error,I=console.group,C=console.groupCollapsed,N=console.groupEnd;var e={configurable:!0,enumerable:!0,value:B,writable:!0};Object.defineProperties(console,{info:e,log:e,warn:e,error:e,group:e,groupCollapsed:e,groupEnd:e})}M++}();try{if(t){var o=function(){throw Error()};if(Object.defineProperty(o.prototype,"props",{set:function(){throw Error()}}),"object"==typeof Reflect&&Reflect.construct){try{Reflect.construct(o,[])}catch(e){r=e}Reflect.construct(e,[],o)}else{try{o.call()}catch(e){r=e}e.call(o.prototype)}}else{try{throw Error()}catch(e){r=e}e()}}catch(t){if(t&&r&&"string"==typeof t.stack){for(var s=t.stack.split("\n"),u=r.stack.split("\n"),f=s.length-1,c=u.length-1;f>=1&&c>=0&&s[f]!==u[c];)c--;for(;f>=1&&c>=0;f--,c--)if(s[f]!==u[c]){if(1!==f||1!==c)do{if(f--,--c<0||s[f]!==u[c]){var l="\n"+s[f].replace(" at new "," at ");return e.displayName&&l.includes("<anonymous>")&&(l=l.replace("<anonymous>",e.displayName)),"function"==typeof e&&U.set(e,l),l}}while(f>=1&&c>=0);break}}}finally{j=!1,F.current=i,function(){if(0==--M){var e={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:P({},e,{value:k}),info:P({},e,{value:O}),warn:P({},e,{value:R}),error:P({},e,{value:x}),group:P({},e,{value:I}),groupCollapsed:P({},e,{value:C}),groupEnd:P({},e,{value:N})})}M<0&&b("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}(),Error.prepareStackTrace=a}var d=e?e.displayName||e.name:"",p=d?L(d):"";return"function"==typeof e&&U.set(e,p),p}function H(e,t,r){if(null==e)return"";if("function"==typeof e)return z(e,function(e){var t=e.prototype;return!(!t||!t.isReactComponent)}(e));if("string"==typeof e)return L(e);switch(e){case f:return L("Suspense");case c:return L("SuspenseList")}if("object"==typeof e)switch(e.$$typeof){case u:return function(e,t,r){return z(e,!1)}(e.render);case l:return H(e.type,t,r);case d:var n=e,i=n._payload,a=n._init;try{return H(a(i),t,r)}catch(e){}}return""}U=new q;var V=Object.prototype.hasOwnProperty,G={},W=y.ReactDebugCurrentFrame;function K(e){if(e){var t=e._owner,r=H(e.type,e._source,t?t.type:null);W.setExtraStackFrame(r)}else W.setExtraStackFrame(null)}var X=Array.isArray;function $(e){return X(e)}function J(e){return""+e}function Y(e){if(function(e){try{return J(e),!1}catch(e){return!0}}(e))return b("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",function(e){return"function"==typeof Symbol&&Symbol.toStringTag&&e[Symbol.toStringTag]||e.constructor.name||"Object"}(e)),J(e)}var Q,Z,ee,te=y.ReactCurrentOwner,re={key:!0,ref:!0,__self:!0,__source:!0};ee={};var ne=function(e,r,n,i,a,o,s){var u={$$typeof:t,type:e,key:r,ref:n,props:s,_owner:o,_store:{}};return Object.defineProperty(u._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(u,"_self",{configurable:!1,enumerable:!1,writable:!1,value:i}),Object.defineProperty(u,"_source",{configurable:!1,enumerable:!1,writable:!1,value:a}),Object.freeze&&(Object.freeze(u.props),Object.freeze(u)),u};function ie(e,t,r,n,i){var a,o={},s=null,u=null;for(a in void 0!==r&&(Y(r),s=""+r),function(e){if(V.call(e,"key")){var t=Object.getOwnPropertyDescriptor(e,"key").get;if(t&&t.isReactWarning)return!1}return void 0!==e.key}(t)&&(Y(t.key),s=""+t.key),function(e){if(V.call(e,"ref")){var t=Object.getOwnPropertyDescriptor(e,"ref").get;if(t&&t.isReactWarning)return!1}return void 0!==e.ref}(t)&&(u=t.ref,function(e,t){if("string"==typeof e.ref&&te.current&&t&&te.current.stateNode!==t){var r=S(te.current.type);ee[r]||(b('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref',S(te.current.type),e.ref),ee[r]=!0)}}(t,i)),t)V.call(t,a)&&!re.hasOwnProperty(a)&&(o[a]=t[a]);if(e&&e.defaultProps){var f=e.defaultProps;for(a in f)void 0===o[a]&&(o[a]=f[a])}if(s||u){var c="function"==typeof e?e.displayName||e.name||"Unknown":e;s&&function(e,t){var r=function(){Q||(Q=!0,b("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",t))};r.isReactWarning=!0,Object.defineProperty(e,"key",{get:r,configurable:!0})}(o,c),u&&function(e,t){var r=function(){Z||(Z=!0,b("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",t))};r.isReactWarning=!0,Object.defineProperty(e,"ref",{get:r,configurable:!0})}(o,c)}return ne(e,s,u,i,n,te.current,o)}var ae,oe=y.ReactCurrentOwner,se=y.ReactDebugCurrentFrame;function ue(e){if(e){var t=e._owner,r=H(e.type,e._source,t?t.type:null);se.setExtraStackFrame(r)}else se.setExtraStackFrame(null)}function fe(e){return"object"==typeof e&&null!==e&&e.$$typeof===t}function ce(){if(oe.current){var e=S(oe.current.type);if(e)return"\n\nCheck the render method of `"+e+"`."}return""}ae=!1;var le={};function de(e,t){if(e._store&&!e._store.validated&&null==e.key){e._store.validated=!0;var r=function(e){var t=ce();if(!t){var r="string"==typeof e?e:e.displayName||e.name;r&&(t="\n\nCheck the top-level render call using <"+r+">.")}return t}(t);if(!le[r]){le[r]=!0;var n="";e&&e._owner&&e._owner!==oe.current&&(n=" It was passed a child from "+S(e._owner.type)+"."),ue(e),b('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',r,n),ue(null)}}}function pe(e,t){if("object"==typeof e)if($(e))for(var r=0;r<e.length;r++){var n=e[r];fe(n)&&de(n,t)}else if(fe(e))e._store&&(e._store.validated=!0);else if(e){var i=function(e){if(null===e||"object"!=typeof e)return null;var t=h&&e[h]||e[m];return"function"==typeof t?t:null}(e);if("function"==typeof i&&i!==e.entries)for(var a,o=i.call(e);!(a=o.next()).done;)fe(a.value)&&de(a.value,t)}}function he(e){var t,r=e.type;if(null!=r&&"string"!=typeof r){if("function"==typeof r)t=r.propTypes;else{if("object"!=typeof r||r.$$typeof!==u&&r.$$typeof!==l)return;t=r.propTypes}if(t){var n=S(r);!function(e,t,r,n,i){var a=Function.call.bind(V);for(var o in e)if(a(e,o)){var s=void 0;try{if("function"!=typeof e[o]){var u=Error((n||"React class")+": "+r+" type `"+o+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[o]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw u.name="Invariant Violation",u}s=e[o](t,o,n,r,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(e){s=e}!s||s instanceof Error||(K(i),b("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",n||"React class",r,o,typeof s),K(null)),s instanceof Error&&!(s.message in G)&&(G[s.message]=!0,K(i),b("Failed %s type: %s",r,s.message),K(null))}}(t,e.props,"prop",n,e)}else void 0===r.PropTypes||ae||(ae=!0,b("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",S(r)||"Unknown"));"function"!=typeof r.getDefaultProps||r.getDefaultProps.isReactClassApproved||b("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function me(e,r,h,m,y,A){var k=function(e){return"string"==typeof e||"function"==typeof e||!!(e===n||e===a||T||e===i||e===f||e===c||E||e===p||v||w||_)||"object"==typeof e&&null!==e&&(e.$$typeof===d||e.$$typeof===l||e.$$typeof===o||e.$$typeof===s||e.$$typeof===u||e.$$typeof===g||void 0!==e.getModuleId)}(e);if(!k){var O="";(void 0===e||"object"==typeof e&&null!==e&&0===Object.keys(e).length)&&(O+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var R,x=function(e){return void 0!==e?"\n\nCheck your code at "+e.fileName.replace(/^.*[\\\/]/,"")+":"+e.lineNumber+".":""}(y);O+=x||ce(),null===e?R="null":$(e)?R="array":void 0!==e&&e.$$typeof===t?(R="<"+(S(e.type)||"Unknown")+" />",O=" Did you accidentally export a JSX literal instead of a component?"):R=typeof e,b("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",R,O)}var I=ie(e,r,h,y,A);if(null==I)return I;if(k){var C=r.children;if(void 0!==C)if(m)if($(C)){for(var N=0;N<C.length;N++)pe(C[N],e);Object.freeze&&Object.freeze(C)}else b("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else pe(C,e)}return e===n?function(e){for(var t=Object.keys(e.props),r=0;r<t.length;r++){var n=t[r];if("children"!==n&&"key"!==n){ue(e),b("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",n),ue(null);break}}null!==e.ref&&(ue(e),b("Invalid attribute `ref` supplied to `React.Fragment`."),ue(null))}(I):he(I),I}var ye=function(e,t,r){return me(e,t,r,!1)},be=function(e,t,r){return me(e,t,r,!0)};i3.Fragment=n,i3.jsx=ye,i3.jsxs=be}()),i3);var a3=$2.exports;function o3(e,t,r,n){Object.defineProperty(e,t,{get:r,set:n,enumerable:!0,configurable:!0})}const s3=()=>"0.3.1-alpha";var u3;o3({},"IMTBLWidgetEvents",(()=>e.IMTBLWidgetEvents)),e.IMTBLWidgetEvents=void 0,(u3=e.IMTBLWidgetEvents||(e.IMTBLWidgetEvents={})).IMTBL_CONNECT_WIDGET_EVENT="imtbl-connect-widget",u3.IMTBL_WALLET_WIDGET_EVENT="imtbl-wallet-widget",u3.IMTBL_SWAP_WIDGET_EVENT="imtbl-swap-widget",u3.IMTBL_BRIDGE_WIDGET_EVENT="imtbl-bridge-widget";var f3;o3({},"ConnectEventType",(()=>e.ConnectEventType)),e.ConnectEventType=void 0,(f3=e.ConnectEventType||(e.ConnectEventType={})).CLOSE_WIDGET="close-widget",f3.SUCCESS="success",f3.FAILURE="failure";var c3;o3({},"WalletEventType",(()=>e.WalletEventType)),e.WalletEventType=void 0,(c3=e.WalletEventType||(e.WalletEventType={})).CLOSE_WIDGET="close-widget",c3.NETWORK_SWITCH="network-switch",c3.DISCONNECT_WALLET="disconnect-wallet";var l3;o3({},"SwapEventType",(()=>e.SwapEventType)),e.SwapEventType=void 0,(l3=e.SwapEventType||(e.SwapEventType={})).CLOSE_WIDGET="close-widget",l3.SUCCESS="success",l3.FAILURE="failure",l3.REJECTED="rejected";var d3;o3({},"BridgeEventType",(()=>e.BridgeEventType)),e.BridgeEventType=void 0,(d3=e.BridgeEventType||(e.BridgeEventType={})).CLOSE_WIDGET="close-widget",d3.SUCCESS="success",d3.FAILURE="failure";var p3;o3({},"OrchestrationEventType",(()=>e.OrchestrationEventType)),e.OrchestrationEventType=void 0,(p3=e.OrchestrationEventType||(e.OrchestrationEventType={})).REQUEST_CONNECT="request-connect",p3.REQUEST_WALLET="request-wallet",p3.REQUEST_SWAP="request-swap",p3.REQUEST_BRIDGE="request-bridge",p3.REQUEST_ONRAMP="request-onramp";var h3,m3,y3={};o3(y3,"WidgetTheme",(()=>e.WidgetTheme)),o3(y3,"CheckoutWidgetTagNames",(()=>e.CheckoutWidgetTagNames)),e.WidgetTheme=void 0,(h3=e.WidgetTheme||(e.WidgetTheme={})).LIGHT="light",h3.DARK="dark",h3.CUSTOM="custom",e.CheckoutWidgetTagNames=void 0,(m3=e.CheckoutWidgetTagNames||(e.CheckoutWidgetTagNames={})).CONNECT="imtbl-connect",m3.WALLET="imtbl-wallet",m3.SWAP="imtbl-swap",m3.BRIDGE="imtbl-bridge";function b3(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 r=0;let n;const i=()=>{try{const r=document.getElementsByTagName(e);r[0].setProvider(t),window.clearInterval(n)}catch(e){r++,r>=10&&(window.clearInterval(n),console.error("failed to set the provider"))}};n=window.setInterval(i,10),i()}function g3(t){const{walletProvider:r,fromContractAddress:n,amount:i,provider:a}=t;r3.useEffect((()=>{a&&b3(e.CheckoutWidgetTagNames.BRIDGE,a)}),[a]);const o=window.ImtblCheckoutWidgetConfig;return a3.jsx("imtbl-bridge",{widgetConfig:o,walletProvider:r,fromContractAddress:n??"",amount:i??""})}o3({},"BridgeReact",(()=>g3));function v3(){const e=window.ImtblCheckoutWidgetConfig;return a3.jsx("imtbl-connect",{widgetConfig:e})}o3({},"ConnectReact",(()=>v3));function w3(t){const{walletProvider:r,fromContractAddress:n,amount:i,toContractAddress:a,provider:o}=t;r3.useEffect((()=>{o&&b3(e.CheckoutWidgetTagNames.SWAP,o)}),[o]);const s=window.ImtblCheckoutWidgetConfig;return a3.jsx("imtbl-swap",{widgetConfig:s,walletProvider:r,fromContractAddress:n??"",toContractAddress:a??"",amount:i??""})}o3({},"SwapReact",(()=>w3));function _3(t){const{walletProvider:r,provider:n}=t;r3.useEffect((()=>{n&&b3(e.CheckoutWidgetTagNames.WALLET,n)}),[n]);const i=window.ImtblCheckoutWidgetConfig;return a3.jsx("imtbl-wallet",{widgetConfig:i,walletProvider:r})}o3({},"WalletReact",(()=>_3));const E3=[{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"}],T3="0x60806040523480156200001157600080fd5b50604051620017ec380380620017ec8339818101604052810190620000379190620001f6565b8160039081620000489190620004c6565b5080600490816200005a9190620004c6565b505050620005ad565b6000604051905090565b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b620000cc8262000081565b810181811067ffffffffffffffff82111715620000ee57620000ed62000092565b5b80604052505050565b60006200010362000063565b9050620001118282620000c1565b919050565b600067ffffffffffffffff82111562000134576200013362000092565b5b6200013f8262000081565b9050602081019050919050565b60005b838110156200016c5780820151818401526020810190506200014f565b60008484015250505050565b60006200018f620001898462000116565b620000f7565b905082815260208101848484011115620001ae57620001ad6200007c565b5b620001bb8482856200014c565b509392505050565b600082601f830112620001db57620001da62000077565b5b8151620001ed84826020860162000178565b91505092915050565b6000806040838503121562000210576200020f6200006d565b5b600083015167ffffffffffffffff81111562000231576200023062000072565b5b6200023f85828601620001c3565b925050602083015167ffffffffffffffff81111562000263576200026262000072565b5b6200027185828601620001c3565b9150509250929050565b600081519050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b60006002820490506001821680620002ce57607f821691505b602082108103620002e457620002e362000286565b5b50919050565b60008190508160005260206000209050919050565b60006020601f8301049050919050565b600082821b905092915050565b6000600883026200034e7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff826200030f565b6200035a86836200030f565b95508019841693508086168417925050509392505050565b6000819050919050565b6000819050919050565b6000620003a7620003a16200039b8462000372565b6200037c565b62000372565b9050919050565b6000819050919050565b620003c38362000386565b620003db620003d282620003ae565b8484546200031c565b825550505050565b600090565b620003f2620003e3565b620003ff818484620003b8565b505050565b5b8181101562000427576200041b600082620003e8565b60018101905062000405565b5050565b601f82111562000476576200044081620002ea565b6200044b84620002ff565b810160208510156200045b578190505b620004736200046a85620002ff565b83018262000404565b50505b505050565b600082821c905092915050565b60006200049b600019846008026200047b565b1980831691505092915050565b6000620004b6838362000488565b9150826002028217905092915050565b620004d1826200027b565b67ffffffffffffffff811115620004ed57620004ec62000092565b5b620004f98254620002b5565b620005068282856200042b565b600060209050601f8311600181146200053e576000841562000529578287015190505b620005358582620004a8565b865550620005a5565b601f1984166200054e86620002ea565b60005b82811015620005785784890151825560018201915060208501945060208101905062000551565b8683101562000598578489015162000594601f89168262000488565b8355505b6001600288020188555050505b505050505050565b61122f80620005bd6000396000f3fe608060405234801561001057600080fd5b50600436106100a95760003560e01c80633950935111610071578063395093511461016857806370a082311461019857806395d89b41146101c8578063a457c2d7146101e6578063a9059cbb14610216578063dd62ed3e14610246576100a9565b806306fdde03146100ae578063095ea7b3146100cc57806318160ddd146100fc57806323b872dd1461011a578063313ce5671461014a575b600080fd5b6100b6610276565b6040516100c39190610b0c565b60405180910390f35b6100e660048036038101906100e19190610bc7565b610308565b6040516100f39190610c22565b60405180910390f35b61010461032b565b6040516101119190610c4c565b60405180910390f35b610134600480360381019061012f9190610c67565b610335565b6040516101419190610c22565b60405180910390f35b610152610364565b60405161015f9190610cd6565b60405180910390f35b610182600480360381019061017d9190610bc7565b61036d565b60405161018f9190610c22565b60405180910390f35b6101b260048036038101906101ad9190610cf1565b6103a4565b6040516101bf9190610c4c565b60405180910390f35b6101d06103ec565b6040516101dd9190610b0c565b60405180910390f35b61020060048036038101906101fb9190610bc7565b61047e565b60405161020d9190610c22565b60405180910390f35b610230600480360381019061022b9190610bc7565b6104f5565b60405161023d9190610c22565b60405180910390f35b610260600480360381019061025b9190610d1e565b610518565b60405161026d9190610c4c565b60405180910390f35b60606003805461028590610d8d565b80601f01602080910402602001604051908101604052809291908181526020018280546102b190610d8d565b80156102fe5780601f106102d3576101008083540402835291602001916102fe565b820191906000526020600020905b8154815290600101906020018083116102e157829003601f168201915b5050505050905090565b60008061031361059f565b90506103208185856105a7565b600191505092915050565b6000600254905090565b60008061034061059f565b905061034d858285610770565b6103588585856107fc565b60019150509392505050565b60006012905090565b60008061037861059f565b905061039981858561038a8589610518565b6103949190610ded565b6105a7565b600191505092915050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6060600480546103fb90610d8d565b80601f016020809104026020016040519081016040528092919081815260200182805461042790610d8d565b80156104745780601f1061044957610100808354040283529160200191610474565b820191906000526020600020905b81548152906001019060200180831161045757829003601f168201915b5050505050905090565b60008061048961059f565b905060006104978286610518565b9050838110156104dc576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016104d390610e93565b60405180910390fd5b6104e982868684036105a7565b60019250505092915050565b60008061050061059f565b905061050d8185856107fc565b600191505092915050565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1603610616576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161060d90610f25565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1603610685576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161067c90610fb7565b60405180910390fd5b80600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516107639190610c4c565b60405180910390a3505050565b600061077c8484610518565b90507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff81146107f657818110156107e8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107df90611023565b60405180910390fd5b6107f584848484036105a7565b5b50505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff160361086b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610862906110b5565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16036108da576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108d190611147565b60405180910390fd5b6108e5838383610a72565b60008060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490508181101561096b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610962906111d9565b60405180910390fd5b8181036000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef84604051610a599190610c4c565b60405180910390a3610a6c848484610a77565b50505050565b505050565b505050565b600081519050919050565b600082825260208201905092915050565b60005b83811015610ab6578082015181840152602081019050610a9b565b60008484015250505050565b6000601f19601f8301169050919050565b6000610ade82610a7c565b610ae88185610a87565b9350610af8818560208601610a98565b610b0181610ac2565b840191505092915050565b60006020820190508181036000830152610b268184610ad3565b905092915050565b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000610b5e82610b33565b9050919050565b610b6e81610b53565b8114610b7957600080fd5b50565b600081359050610b8b81610b65565b92915050565b6000819050919050565b610ba481610b91565b8114610baf57600080fd5b50565b600081359050610bc181610b9b565b92915050565b60008060408385031215610bde57610bdd610b2e565b5b6000610bec85828601610b7c565b9250506020610bfd85828601610bb2565b9150509250929050565b60008115159050919050565b610c1c81610c07565b82525050565b6000602082019050610c376000830184610c13565b92915050565b610c4681610b91565b82525050565b6000602082019050610c616000830184610c3d565b92915050565b600080600060608486031215610c8057610c7f610b2e565b5b6000610c8e86828701610b7c565b9350506020610c9f86828701610b7c565b9250506040610cb086828701610bb2565b9150509250925092565b600060ff82169050919050565b610cd081610cba565b82525050565b6000602082019050610ceb6000830184610cc7565b92915050565b600060208284031215610d0757610d06610b2e565b5b6000610d1584828501610b7c565b91505092915050565b60008060408385031215610d3557610d34610b2e565b5b6000610d4385828601610b7c565b9250506020610d5485828601610b7c565b9150509250929050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b60006002820490506001821680610da557607f821691505b602082108103610db857610db7610d5e565b5b50919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000610df882610b91565b9150610e0383610b91565b9250828201905080821115610e1b57610e1a610dbe565b5b92915050565b7f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f7760008201527f207a65726f000000000000000000000000000000000000000000000000000000602082015250565b6000610e7d602583610a87565b9150610e8882610e21565b604082019050919050565b60006020820190508181036000830152610eac81610e70565b9050919050565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b6000610f0f602483610a87565b9150610f1a82610eb3565b604082019050919050565b60006020820190508181036000830152610f3e81610f02565b9050919050565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b6000610fa1602283610a87565b9150610fac82610f45565b604082019050919050565b60006020820190508181036000830152610fd081610f94565b9050919050565b7f45524332303a20696e73756666696369656e7420616c6c6f77616e6365000000600082015250565b600061100d601d83610a87565b915061101882610fd7565b602082019050919050565b6000602082019050818103600083015261103c81611000565b9050919050565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b600061109f602583610a87565b91506110aa82611043565b604082019050919050565b600060208201905081810360008301526110ce81611092565b9050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b6000611131602383610a87565b915061113c826110d5565b604082019050919050565b6000602082019050818103600083015261116081611124565b9050919050565b7f45524332303a207472616e7366657220616d6f756e742065786365656473206260008201527f616c616e63650000000000000000000000000000000000000000000000000000602082015250565b60006111c3602683610a87565b91506111ce82611167565b604082019050919050565b600060208201905081810360008301526111f2816111b6565b905091905056fea26469706673582212204188b273199f085e1921ec1a1fa55abdee2e425960bda675a51fac85acd9972064736f6c63430008110033";class A3 extends vd{constructor(...e){e.length>1?super(...e):super(E3,T3,e[0])}deploy(e,t,r){return super.deploy(e,t,r||{})}getDeployTransaction(e,t,r){return super.getDeployTransaction(e,t,r||{})}attach(e){return super.attach(e)}connect(e){return super.connect(e)}static bytecode=T3;static abi=E3;static createInterface(){return new Bu(E3)}static connect(e,t){return new gd(e,E3,t)}}const S3=[{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:"_receiver",type:"address"},{internalType:"uint96",name:"_feeNumerator",type:"uint96"}],stateMutability:"nonpayable",type:"constructor"},{inputs:[{internalType:"address",name:"target",type:"address"}],name:"ApproveTargetNotInAllowlist",type:"error"},{inputs:[{internalType:"address",name:"caller",type:"address"}],name:"CallerNotInAllowlist",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:[{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:!1,internalType:"address",name:"oldRegistry",type:"address"},{indexed:!1,internalType:"address",name:"newRegistry",type:"address"}],name:"RoyaltytAllowlistRegistryUpdated",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:"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:[{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"burn",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"contractURI",outputs:[{internalType:"string",name:"",type:"string"}],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:"amount",type:"uint256"}],name:"mint",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:"ownerOf",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",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:[],name:"royaltyAllowlist",outputs:[{internalType:"contract IRoyaltyAllowlist",name:"",type:"address"}],stateMutability:"view",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:"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:[{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:"_royaltyAllowlist",type:"address"}],name:"setRoyaltyAllowlistRegistry",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:"index",type:"uint256"}],name:"tokenByIndex",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"owner",type:"address"},{internalType:"uint256",name:"index",type:"uint256"}],name:"tokenOfOwnerByIndex",outputs:[{internalType:"uint256",name:"",type:"uint256"}],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"}],k3="0x60806040523480156200001157600080fd5b50604051620060d4380380620060d4833981810160405281019062000037919062000762565b868686868686868585816000908162000051919062000adc565b50806001908162000063919062000adc565b505050620000788282620000dc60201b60201c565b6200008d6000801b886200027f60201b60201c565b83601090816200009e919062000adc565b5082600f9081620000b0919062000adc565b50620000c86011620002c760201b620015f11760201c565b505050505050505050505050505062000cde565b620000ec620002dd60201b60201c565b6bffffffffffffffffffffffff16816bffffffffffffffffffffffff1611156200014d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401620001449062000c4a565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1603620001bf576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401620001b69062000cbc565b60405180910390fd5b60405180604001604052808373ffffffffffffffffffffffffffffffffffffffff168152602001826bffffffffffffffffffffffff16815250600d60008201518160000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060208201518160000160146101000a8154816bffffffffffffffffffffffff02191690836bffffffffffffffffffffffff1602179055509050505050565b620002968282620002e760201b620016071760201c565b620002c28160076000858152602001908152602001600020620003d960201b620016e81790919060201c565b505050565b6001816000016000828254019250508190555050565b6000612710905090565b620002f982826200041160201b60201c565b620003d55760016006600084815260200190815260200160002060000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055506200037a6200047c60201b60201c565b73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45b5050565b600062000409836000018373ffffffffffffffffffffffffffffffffffffffff1660001b6200048460201b60201c565b905092915050565b60006006600084815260200190815260200160002060000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16905092915050565b600033905090565b6000620004988383620004fe60201b60201c565b620004f3578260000182908060018154018082558091505060019003906000526020600020016000909190919091505582600001805490508360010160008481526020019081526020016000208190555060019050620004f8565b600090505b92915050565b600080836001016000848152602001908152602001600020541415905092915050565b6000604051905090565b600080fd5b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000620005628262000535565b9050919050565b620005748162000555565b81146200058057600080fd5b50565b600081519050620005948162000569565b92915050565b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b620005ef82620005a4565b810181811067ffffffffffffffff82111715620006115762000610620005b5565b5b80604052505050565b60006200062662000521565b9050620006348282620005e4565b919050565b600067ffffffffffffffff821115620006575762000656620005b5565b5b6200066282620005a4565b9050602081019050919050565b60005b838110156200068f57808201518184015260208101905062000672565b60008484015250505050565b6000620006b2620006ac8462000639565b6200061a565b905082815260208101848484011115620006d157620006d06200059f565b5b620006de8482856200066f565b509392505050565b600082601f830112620006fe57620006fd6200059a565b5b8151620007108482602086016200069b565b91505092915050565b60006bffffffffffffffffffffffff82169050919050565b6200073c8162000719565b81146200074857600080fd5b50565b6000815190506200075c8162000731565b92915050565b600080600080600080600060e0888a0312156200078457620007836200052b565b5b6000620007948a828b0162000583565b975050602088015167ffffffffffffffff811115620007b857620007b762000530565b5b620007c68a828b01620006e6565b965050604088015167ffffffffffffffff811115620007ea57620007e962000530565b5b620007f88a828b01620006e6565b955050606088015167ffffffffffffffff8111156200081c576200081b62000530565b5b6200082a8a828b01620006e6565b945050608088015167ffffffffffffffff8111156200084e576200084d62000530565b5b6200085c8a828b01620006e6565b93505060a06200086f8a828b0162000583565b92505060c0620008828a828b016200074b565b91505092959891949750929550565b600081519050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b60006002820490506001821680620008e457607f821691505b602082108103620008fa57620008f96200089c565b5b50919050565b60008190508160005260206000209050919050565b60006020601f8301049050919050565b600082821b905092915050565b600060088302620009647fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8262000925565b62000970868362000925565b95508019841693508086168417925050509392505050565b6000819050919050565b6000819050919050565b6000620009bd620009b7620009b18462000988565b62000992565b62000988565b9050919050565b6000819050919050565b620009d9836200099c565b620009f1620009e882620009c4565b84845462000932565b825550505050565b600090565b62000a08620009f9565b62000a15818484620009ce565b505050565b5b8181101562000a3d5762000a31600082620009fe565b60018101905062000a1b565b5050565b601f82111562000a8c5762000a568162000900565b62000a618462000915565b8101602085101562000a71578190505b62000a8962000a808562000915565b83018262000a1a565b50505b505050565b600082821c905092915050565b600062000ab16000198460080262000a91565b1980831691505092915050565b600062000acc838362000a9e565b9150826002028217905092915050565b62000ae78262000891565b67ffffffffffffffff81111562000b035762000b02620005b5565b5b62000b0f8254620008cb565b62000b1c82828562000a41565b600060209050601f83116001811462000b54576000841562000b3f578287015190505b62000b4b858262000abe565b86555062000bbb565b601f19841662000b648662000900565b60005b8281101562000b8e5784890151825560018201915060208501945060208101905062000b67565b8683101562000bae578489015162000baa601f89168262000a9e565b8355505b6001600288020188555050505b505050505050565b600082825260208201905092915050565b7f455243323938313a20726f79616c7479206665652077696c6c2065786365656460008201527f2073616c65507269636500000000000000000000000000000000000000000000602082015250565b600062000c32602a8362000bc3565b915062000c3f8262000bd4565b604082019050919050565b6000602082019050818103600083015262000c658162000c23565b9050919050565b7f455243323938313a20696e76616c696420726563656976657200000000000000600082015250565b600062000ca460198362000bc3565b915062000cb18262000c6c565b602082019050919050565b6000602082019050818103600083015262000cd78162000c95565b9050919050565b6153e68062000cee6000396000f3fe608060405234801561001057600080fd5b50600436106102275760003560e01c80636352211e1161013057806395d89b41116100b8578063ca15c8731161007c578063ca15c87314610697578063d5391393146106c7578063d547741f146106e5578063e8a3d48514610701578063e985e9c51461071f57610227565b806395d89b41146105f3578063a217fddf14610611578063a22cb4651461062f578063b88d4fde1461064b578063c87b56dd1461066757610227565b80636c0360eb116100ff5780636c0360eb1461052957806370a08231146105475780639010d07c1461057757806391d14854146105a7578063938e3d7b146105d757610227565b80636352211e146104a35780636588962a146104d357806369e2f0fb146104ef5780636b3a06321461050b57610227565b80632f745c59116101b357806340c10f191161018257806340c10f191461040357806342842e0e1461041f57806342966c681461043b5780634f6ccce71461045757806355f804b31461048757610227565b80632f745c591461037d57806331ae450b146103ad57806336568abe146103cb5780633dd1eb61146103e757610227565b806318160ddd116101fa57806318160ddd146102c657806323b872dd146102e4578063248a9ca3146103005780632a55205a146103305780632f2ff15d1461036157610227565b806301ffc9a71461022c57806306fdde031461025c578063081812fc1461027a578063095ea7b3146102aa575b600080fd5b61024660048036038101906102419190613a2e565b61074f565b6040516102539190613a76565b60405180910390f35b610264610761565b6040516102719190613b21565b60405180910390f35b610294600480360381019061028f9190613b79565b6107f3565b6040516102a19190613be7565b60405180910390f35b6102c460048036038101906102bf9190613c2e565b610839565b005b6102ce610847565b6040516102db9190613c7d565b60405180910390f35b6102fe60048036038101906102f99190613c98565b610854565b005b61031a60048036038101906103159190613d21565b6108b4565b6040516103279190613d5d565b60405180910390f35b61034a60048036038101906103459190613d78565b6108d4565b604051610358929190613db8565b60405180910390f35b61037b60048036038101906103769190613de1565b610abe565b005b61039760048036038101906103929190613c2e565b610adf565b6040516103a49190613c7d565b60405180910390f35b6103b5610b84565b6040516103c29190613edf565b60405180910390f35b6103e560048036038101906103e09190613de1565b610c64565b005b61040160048036038101906103fc9190613f01565b610ce7565b005b61041d60048036038101906104189190613c2e565b610d22565b005b61043960048036038101906104349190613c98565b610d7a565b005b61045560048036038101906104509190613b79565b610d9a565b005b610471600480360381019061046c9190613b79565b610df6565b60405161047e9190613c7d565b60405180910390f35b6104a1600480360381019061049c9190614063565b610e67565b005b6104bd60048036038101906104b89190613b79565b610e88565b6040516104ca9190613be7565b60405180910390f35b6104ed60048036038101906104e89190613f01565b610f0e565b005b61050960048036038101906105049190613f01565b611094565b005b6105136110cf565b604051610520919061410b565b60405180910390f35b6105316110f5565b60405161053e9190613b21565b60405180910390f35b610561600480360381019061055c9190613f01565b611183565b60405161056e9190613c7d565b60405180910390f35b610591600480360381019061058c9190614126565b61123a565b60405161059e9190613be7565b60405180910390f35b6105c160048036038101906105bc9190613de1565b611269565b6040516105ce9190613a76565b60405180910390f35b6105f160048036038101906105ec9190614063565b6112d4565b005b6105fb6112f5565b6040516106089190613b21565b60405180910390f35b610619611387565b6040516106269190613d5d565b60405180910390f35b61064960048036038101906106449190614192565b61138e565b005b61066560048036038101906106609190614273565b61139c565b005b610681600480360381019061067c9190613b79565b6113fe565b60405161068e9190613b21565b60405180910390f35b6106b160048036038101906106ac9190613d21565b611466565b6040516106be9190613c7d565b60405180910390f35b6106cf61148a565b6040516106dc9190613d5d565b60405180910390f35b6106ff60048036038101906106fa9190613de1565b6114ae565b005b6107096114cf565b6040516107169190613b21565b60405180910390f35b610739600480360381019061073491906142f6565b61155d565b6040516107469190613a76565b60405180910390f35b600061075a82611718565b9050919050565b60606000805461077090614365565b80601f016020809104026020016040519081016040528092919081815260200182805461079c90614365565b80156107e95780601f106107be576101008083540402835291602001916107e9565b820191906000526020600020905b8154815290600101906020018083116107cc57829003601f168201915b5050505050905090565b60006107fe82611792565b6004600083815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050919050565b61084382826117dd565b5050565b6000600b80549050905090565b61086561085f6117f4565b826117fc565b6108a4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161089b90614408565b60405180910390fd5b6108af838383611891565b505050565b600060066000838152602001908152602001600020600101549050919050565b6000806000600e60008681526020019081526020016000206040518060400160405290816000820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020016000820160149054906101000a90046bffffffffffffffffffffffff166bffffffffffffffffffffffff166bffffffffffffffffffffffff16815250509050600073ffffffffffffffffffffffffffffffffffffffff16816000015173ffffffffffffffffffffffffffffffffffffffff1603610a6957600d6040518060400160405290816000820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020016000820160149054906101000a90046bffffffffffffffffffffffff166bffffffffffffffffffffffff166bffffffffffffffffffffffff168152505090505b6000610a736118a1565b6bffffffffffffffffffffffff1682602001516bffffffffffffffffffffffff1686610a9f9190614457565b610aa991906144c8565b90508160000151819350935050509250929050565b610ac7826108b4565b610ad0816118ab565b610ada83836118bf565b505050565b6000610aea83611183565b8210610b2b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b229061456b565b60405180910390fd5b600960008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600083815260200190815260200160002054905092915050565b60606000610b946000801b611466565b905060008167ffffffffffffffff811115610bb257610bb1613f38565b5b604051908082528060200260200182016040528015610be05781602001602082028036833780820191505090505b50905060005b82811015610c5b57610bfb6000801b8261123a565b828281518110610c0e57610c0d61458b565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250508080610c53906145ba565b915050610be6565b50809250505090565b610c6c6117f4565b73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614610cd9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610cd090614674565b60405180910390fd5b610ce382826118f3565b5050565b6000801b610cf4816118ab565b610d1e7f4d494e5445525f524f4c4500000000000000000000000000000000000000000083610abe565b5050565b7f4d494e5445525f524f4c45000000000000000000000000000000000000000000610d4c816118ab565b60005b82811015610d7457610d6084611927565b508080610d6c906145ba565b915050610d4f565b50505050565b610d958383836040518060200160405280600081525061139c565b505050565b610dab610da56117f4565b826117fc565b610dea576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610de190614408565b60405180910390fd5b610df381611953565b50565b6000610e00610847565b8210610e41576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e3890614706565b60405180910390fd5b600b8281548110610e5557610e5461458b565b5b90600052602060002001549050919050565b6000801b610e74816118ab565b8160109081610e8391906148c8565b505050565b600080610e9483611aa1565b9050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1603610f05576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610efc906149e6565b60405180910390fd5b80915050919050565b6000801b610f1b816118ab565b8173ffffffffffffffffffffffffffffffffffffffff166301ffc9a77f05a3b809000000000000000000000000000000000000000000000000000000006040518263ffffffff1660e01b8152600401610f749190614a15565b602060405180830381865afa158015610f91573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610fb59190614a45565b610ff4576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610feb90614ae4565b60405180910390fd5b7f4a1d010d926ae0d4294a4afe61ae81bb378335fbf671e099a7138b5afeefdf84600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1683604051611047929190614b04565b60405180910390a181600860006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505050565b6000801b6110a1816118ab565b6110cb7f4d494e5445525f524f4c45000000000000000000000000000000000000000000836114ae565b5050565b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6010805461110290614365565b80601f016020809104026020016040519081016040528092919081815260200182805461112e90614365565b801561117b5780601f106111505761010080835404028352916020019161117b565b820191906000526020600020905b81548152906001019060200180831161115e57829003601f168201915b505050505081565b60008073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16036111f3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111ea90614b9f565b60405180910390fd5b600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b60006112618260076000868152602001908152602001600020611ade90919063ffffffff16565b905092915050565b60006006600084815260200190815260200160002060000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16905092915050565b6000801b6112e1816118ab565b81600f90816112f091906148c8565b505050565b60606001805461130490614365565b80601f016020809104026020016040519081016040528092919081815260200182805461133090614365565b801561137d5780601f106113525761010080835404028352916020019161137d565b820191906000526020600020905b81548152906001019060200180831161136057829003601f168201915b5050505050905090565b6000801b81565b6113988282611af8565b5050565b6113ad6113a76117f4565b836117fc565b6113ec576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016113e390614408565b60405180910390fd5b6113f884848484611b0f565b50505050565b606061140982611792565b6000611413611b6b565b90506000815111611433576040518060200160405280600081525061145e565b8061143d84611bfd565b60405160200161144e929190614bfb565b6040516020818303038152906040525b915050919050565b600061148360076000848152602001908152602001600020611ccb565b9050919050565b7f4d494e5445525f524f4c4500000000000000000000000000000000000000000081565b6114b7826108b4565b6114c0816118ab565b6114ca83836118f3565b505050565b600f80546114dc90614365565b80601f016020809104026020016040519081016040528092919081815260200182805461150890614365565b80156115555780601f1061152a57610100808354040283529160200191611555565b820191906000526020600020905b81548152906001019060200180831161153857829003601f168201915b505050505081565b6000600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16905092915050565b6001816000016000828254019250508190555050565b6116118282611269565b6116e45760016006600084815260200190815260200160002060000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055506116896117f4565b73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45b5050565b6000611710836000018373ffffffffffffffffffffffffffffffffffffffff1660001b611ce0565b905092915050565b60007f2a55205a000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916148061178b575061178a82611d50565b5b9050919050565b61179b81611dca565b6117da576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016117d1906149e6565b60405180910390fd5b50565b6117e682611e0b565b6117f08282611f64565b5050565b600033905090565b60008061180883610e88565b90508073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16148061184a5750611849818561155d565b5b8061188857508373ffffffffffffffffffffffffffffffffffffffff16611870846107f3565b73ffffffffffffffffffffffffffffffffffffffff16145b91505092915050565b61189c83838361207b565b505050565b6000612710905090565b6118bc816118b76117f4565b612093565b50565b6118c98282611607565b6118ee81600760008581526020019081526020016000206116e890919063ffffffff16565b505050565b6118fd8282612118565b61192281600760008581526020019081526020016000206121fa90919063ffffffff16565b505050565b600080611934601161222a565b90506119408382612238565b61194a60116115f1565b80915050919050565b600061195e82610e88565b905061196e816000846001612455565b61197782610e88565b90506004600083815260200190815260200160002060006101000a81549073ffffffffffffffffffffffffffffffffffffffff02191690556001600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825403925050819055506002600083815260200190815260200160002060006101000a81549073ffffffffffffffffffffffffffffffffffffffff021916905581600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a4611a9d816000846001612467565b5050565b60006002600083815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050919050565b6000611aed836000018361246d565b60001c905092915050565b611b0182611e0b565b611b0b8282612498565b5050565b611b1a848484611891565b611b26848484846124ae565b611b65576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b5c90614c91565b60405180910390fd5b50505050565b606060108054611b7a90614365565b80601f0160208091040260200160405190810160405280929190818152602001828054611ba690614365565b8015611bf35780601f10611bc857610100808354040283529160200191611bf3565b820191906000526020600020905b815481529060010190602001808311611bd657829003601f168201915b5050505050905090565b606060006001611c0c84612635565b01905060008167ffffffffffffffff811115611c2b57611c2a613f38565b5b6040519080825280601f01601f191660200182016040528015611c5d5781602001600182028036833780820191505090505b509050600082602001820190505b600115611cc0578080600190039150507f3031323334353637383961626364656600000000000000000000000000000000600a86061a8153600a8581611cb457611cb3614499565b5b04945060008503611c6b575b819350505050919050565b6000611cd982600001612788565b9050919050565b6000611cec8383612799565b611d45578260000182908060018154018082558091505060019003906000526020600020016000909190919091505582600001805490508360010160008481526020019081526020016000208190555060019050611d4a565b600090505b92915050565b60007f780e9d63000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19161480611dc35750611dc2826127bc565b5b9050919050565b60008073ffffffffffffffffffffffffffffffffffffffff16611dec83611aa1565b73ffffffffffffffffffffffffffffffffffffffff1614159050919050565b600073ffffffffffffffffffffffffffffffffffffffff16600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611f605760008173ffffffffffffffffffffffffffffffffffffffff163b1480611f1f5750600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166305a3b809826040518263ffffffff1660e01b8152600401611edd9190613be7565b602060405180830381865afa158015611efa573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611f1e9190614a45565b5b611f6157806040517f8371ab02000000000000000000000000000000000000000000000000000000008152600401611f579190613be7565b60405180910390fd5b5b50565b6000611f6f82610e88565b90508073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1603611fdf576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611fd690614d23565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff16611ffe6117f4565b73ffffffffffffffffffffffffffffffffffffffff16148061202d575061202c816120276117f4565b61155d565b5b61206c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161206390614db5565b60405180910390fd5b61207683836127ce565b505050565b612083612887565b61208e8383836129f3565b505050565b61209d8282611269565b612114576120aa81612cec565b6120b88360001c6020612d19565b6040516020016120c9929190614e6d565b6040516020818303038152906040526040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161210b9190613b21565b60405180910390fd5b5050565b6121228282611269565b156121f65760006006600084815260200190815260200160002060000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555061219b6117f4565b73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16837ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b60405160405180910390a45b5050565b6000612222836000018373ffffffffffffffffffffffffffffffffffffffff1660001b612f55565b905092915050565b600081600001549050919050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16036122a7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161229e90614ef3565b60405180910390fd5b6122b081611dca565b156122f0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016122e790614f5f565b60405180910390fd5b6122fe600083836001612455565b61230781611dca565b15612347576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161233e90614f5f565b60405180910390fd5b6001600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540192505081905550816002600083815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550808273ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a4612451600083836001612467565b5050565b61246184848484613069565b50505050565b50505050565b60008260000182815481106124855761248461458b565b5b9060005260206000200154905092915050565b6124aa6124a36117f4565b83836131c7565b5050565b60006124cf8473ffffffffffffffffffffffffffffffffffffffff16613333565b15612628578373ffffffffffffffffffffffffffffffffffffffff1663150b7a026124f86117f4565b8786866040518563ffffffff1660e01b815260040161251a9493929190614fd4565b6020604051808303816000875af192505050801561255657506040513d601f19601f820116820180604052508101906125539190615035565b60015b6125d8573d8060008114612586576040519150601f19603f3d011682016040523d82523d6000602084013e61258b565b606091505b5060008151036125d0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016125c790614c91565b60405180910390fd5b805181602001fd5b63150b7a0260e01b7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916817bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19161491505061262d565b600190505b949350505050565b600080600090507a184f03e93ff9f4daa797ed6e38ed64bf6a1f0100000000000000008310612693577a184f03e93ff9f4daa797ed6e38ed64bf6a1f010000000000000000838161268957612688614499565b5b0492506040810190505b6d04ee2d6d415b85acef810000000083106126d0576d04ee2d6d415b85acef810000000083816126c6576126c5614499565b5b0492506020810190505b662386f26fc1000083106126ff57662386f26fc1000083816126f5576126f4614499565b5b0492506010810190505b6305f5e1008310612728576305f5e100838161271e5761271d614499565b5b0492506008810190505b612710831061274d57612710838161274357612742614499565b5b0492506004810190505b60648310612770576064838161276657612765614499565b5b0492506002810190505b600a831061277f576001810190505b80915050919050565b600081600001805490509050919050565b600080836001016000848152602001908152602001600020541415905092915050565b60006127c782613356565b9050919050565b816004600083815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550808273ffffffffffffffffffffffffffffffffffffffff1661284183610e88565b73ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b600073ffffffffffffffffffffffffffffffffffffffff16600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146129f0573273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614806129af5750600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166305a3b809336040518263ffffffff1660e01b815260040161296d9190613be7565b602060405180830381865afa15801561298a573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906129ae9190614a45565b5b6129f157336040517f937db65f0000000000000000000000000000000000000000000000000000000081526004016129e79190613be7565b60405180910390fd5b5b565b8273ffffffffffffffffffffffffffffffffffffffff16612a1382610e88565b73ffffffffffffffffffffffffffffffffffffffff1614612a69576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612a60906150d4565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1603612ad8576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612acf90615166565b60405180910390fd5b612ae58383836001612455565b8273ffffffffffffffffffffffffffffffffffffffff16612b0582610e88565b73ffffffffffffffffffffffffffffffffffffffff1614612b5b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612b52906150d4565b60405180910390fd5b6004600082815260200190815260200160002060006101000a81549073ffffffffffffffffffffffffffffffffffffffff02191690556001600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825403925050819055506001600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540192505081905550816002600083815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550808273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a4612ce78383836001612467565b505050565b6060612d128273ffffffffffffffffffffffffffffffffffffffff16601460ff16612d19565b9050919050565b606060006002836002612d2c9190614457565b612d369190615186565b67ffffffffffffffff811115612d4f57612d4e613f38565b5b6040519080825280601f01601f191660200182016040528015612d815781602001600182028036833780820191505090505b5090507f300000000000000000000000000000000000000000000000000000000000000081600081518110612db957612db861458b565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053507f780000000000000000000000000000000000000000000000000000000000000081600181518110612e1d57612e1c61458b565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a90535060006001846002612e5d9190614457565b612e679190615186565b90505b6001811115612f07577f3031323334353637383961626364656600000000000000000000000000000000600f861660108110612ea957612ea861458b565b5b1a60f81b828281518110612ec057612ebf61458b565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350600485901c945080612f00906151ba565b9050612e6a565b5060008414612f4b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612f429061522f565b60405180910390fd5b8091505092915050565b6000808360010160008481526020019081526020016000205490506000811461305d576000600182612f87919061524f565b9050600060018660000180549050612f9f919061524f565b905081811461300e576000866000018281548110612fc057612fbf61458b565b5b9060005260206000200154905080876000018481548110612fe457612fe361458b565b5b90600052602060002001819055508387600101600083815260200190815260200160002081905550505b8560000180548061302257613021615283565b5b600190038181906000526020600020016000905590558560010160008681526020019081526020016000206000905560019350505050613063565b60009150505b92915050565b613075848484846133d0565b60018111156130b9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016130b090615324565b60405180910390fd5b6000829050600073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1603613100576130fb816134f6565b61313f565b8373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff161461313e5761313d858261353f565b5b5b600073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16036131815761317c816136ac565b6131c0565b8473ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16146131bf576131be848261377d565b5b5b5050505050565b8173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1603613235576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161322c90615390565b60405180910390fd5b80600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31836040516133269190613a76565b60405180910390a3505050565b6000808273ffffffffffffffffffffffffffffffffffffffff163b119050919050565b60007f5a05180f000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191614806133c957506133c8826137fc565b5b9050919050565b60018111156134f057600073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16146134645780600360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825461345c919061524f565b925050819055505b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16146134ef5780600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282546134e79190615186565b925050819055505b5b50505050565b600b80549050600c600083815260200190815260200160002081905550600b81908060018154018082558091505060019003906000526020600020016000909190919091505550565b6000600161354c84611183565b613556919061524f565b90506000600a600084815260200190815260200160002054905081811461363b576000600960008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600084815260200190815260200160002054905080600960008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008481526020019081526020016000208190555081600a600083815260200190815260200160002081905550505b600a600084815260200190815260200160002060009055600960008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008381526020019081526020016000206000905550505050565b60006001600b805490506136c0919061524f565b90506000600c60008481526020019081526020016000205490506000600b83815481106136f0576136ef61458b565b5b9060005260206000200154905080600b83815481106137125761371161458b565b5b906000526020600020018190555081600c600083815260200190815260200160002081905550600c600085815260200190815260200160002060009055600b80548061376157613760615283565b5b6001900381819060005260206000200160009055905550505050565b600061378883611183565b905081600960008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008381526020019081526020016000208190555080600a600084815260200190815260200160002081905550505050565b60007f7965db0b000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916148061386f575061386e82613876565b5b9050919050565b60007f80ac58cd000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916148061394157507f5b5e139f000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916145b80613951575061395082613958565b5b9050919050565b60007f01ffc9a7000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916149050919050565b6000604051905090565b600080fd5b600080fd5b60007fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b613a0b816139d6565b8114613a1657600080fd5b50565b600081359050613a2881613a02565b92915050565b600060208284031215613a4457613a436139cc565b5b6000613a5284828501613a19565b91505092915050565b60008115159050919050565b613a7081613a5b565b82525050565b6000602082019050613a8b6000830184613a67565b92915050565b600081519050919050565b600082825260208201905092915050565b60005b83811015613acb578082015181840152602081019050613ab0565b60008484015250505050565b6000601f19601f8301169050919050565b6000613af382613a91565b613afd8185613a9c565b9350613b0d818560208601613aad565b613b1681613ad7565b840191505092915050565b60006020820190508181036000830152613b3b8184613ae8565b905092915050565b6000819050919050565b613b5681613b43565b8114613b6157600080fd5b50565b600081359050613b7381613b4d565b92915050565b600060208284031215613b8f57613b8e6139cc565b5b6000613b9d84828501613b64565b91505092915050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000613bd182613ba6565b9050919050565b613be181613bc6565b82525050565b6000602082019050613bfc6000830184613bd8565b92915050565b613c0b81613bc6565b8114613c1657600080fd5b50565b600081359050613c2881613c02565b92915050565b60008060408385031215613c4557613c446139cc565b5b6000613c5385828601613c19565b9250506020613c6485828601613b64565b9150509250929050565b613c7781613b43565b82525050565b6000602082019050613c926000830184613c6e565b92915050565b600080600060608486031215613cb157613cb06139cc565b5b6000613cbf86828701613c19565b9350506020613cd086828701613c19565b9250506040613ce186828701613b64565b9150509250925092565b6000819050919050565b613cfe81613ceb565b8114613d0957600080fd5b50565b600081359050613d1b81613cf5565b92915050565b600060208284031215613d3757613d366139cc565b5b6000613d4584828501613d0c565b91505092915050565b613d5781613ceb565b82525050565b6000602082019050613d726000830184613d4e565b92915050565b60008060408385031215613d8f57613d8e6139cc565b5b6000613d9d85828601613b64565b9250506020613dae85828601613b64565b9150509250929050565b6000604082019050613dcd6000830185613bd8565b613dda6020830184613c6e565b9392505050565b60008060408385031215613df857613df76139cc565b5b6000613e0685828601613d0c565b9250506020613e1785828601613c19565b9150509250929050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b613e5681613bc6565b82525050565b6000613e688383613e4d565b60208301905092915050565b6000602082019050919050565b6000613e8c82613e21565b613e968185613e2c565b9350613ea183613e3d565b8060005b83811015613ed2578151613eb98882613e5c565b9750613ec483613e74565b925050600181019050613ea5565b5085935050505092915050565b60006020820190508181036000830152613ef98184613e81565b905092915050565b600060208284031215613f1757613f166139cc565b5b6000613f2584828501613c19565b91505092915050565b600080fd5b600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b613f7082613ad7565b810181811067ffffffffffffffff82111715613f8f57613f8e613f38565b5b80604052505050565b6000613fa26139c2565b9050613fae8282613f67565b919050565b600067ffffffffffffffff821115613fce57613fcd613f38565b5b613fd782613ad7565b9050602081019050919050565b82818337600083830152505050565b600061400661400184613fb3565b613f98565b90508281526020810184848401111561402257614021613f33565b5b61402d848285613fe4565b509392505050565b600082601f83011261404a57614049613f2e565b5b813561405a848260208601613ff3565b91505092915050565b600060208284031215614079576140786139cc565b5b600082013567ffffffffffffffff811115614097576140966139d1565b5b6140a384828501614035565b91505092915050565b6000819050919050565b60006140d16140cc6140c784613ba6565b6140ac565b613ba6565b9050919050565b60006140e3826140b6565b9050919050565b60006140f5826140d8565b9050919050565b614105816140ea565b82525050565b600060208201905061412060008301846140fc565b92915050565b6000806040838503121561413d5761413c6139cc565b5b600061414b85828601613d0c565b925050602061415c85828601613b64565b9150509250929050565b61416f81613a5b565b811461417a57600080fd5b50565b60008135905061418c81614166565b92915050565b600080604083850312156141a9576141a86139cc565b5b60006141b785828601613c19565b92505060206141c88582860161417d565b9150509250929050565b600067ffffffffffffffff8211156141ed576141ec613f38565b5b6141f682613ad7565b9050602081019050919050565b6000614216614211846141d2565b613f98565b90508281526020810184848401111561423257614231613f33565b5b61423d848285613fe4565b509392505050565b600082601f83011261425a57614259613f2e565b5b813561426a848260208601614203565b91505092915050565b6000806000806080858703121561428d5761428c6139cc565b5b600061429b87828801613c19565b94505060206142ac87828801613c19565b93505060406142bd87828801613b64565b925050606085013567ffffffffffffffff8111156142de576142dd6139d1565b5b6142ea87828801614245565b91505092959194509250565b6000806040838503121561430d5761430c6139cc565b5b600061431b85828601613c19565b925050602061432c85828601613c19565b9150509250929050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b6000600282049050600182168061437d57607f821691505b6020821081036143905761438f614336565b5b50919050565b7f4552433732313a2063616c6c6572206973206e6f7420746f6b656e206f776e6560008201527f72206f7220617070726f76656400000000000000000000000000000000000000602082015250565b60006143f2602d83613a9c565b91506143fd82614396565b604082019050919050565b60006020820190508181036000830152614421816143e5565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b600061446282613b43565b915061446d83613b43565b925082820261447b81613b43565b9150828204841483151761449257614491614428565b5b5092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b60006144d382613b43565b91506144de83613b43565b9250826144ee576144ed614499565b5b828204905092915050565b7f455243373231456e756d657261626c653a206f776e657220696e646578206f7560008201527f74206f6620626f756e6473000000000000000000000000000000000000000000602082015250565b6000614555602b83613a9c565b9150614560826144f9565b604082019050919050565b6000602082019050818103600083015261458481614548565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60006145c582613b43565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82036145f7576145f6614428565b5b600182019050919050565b7f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560008201527f20726f6c657320666f722073656c660000000000000000000000000000000000602082015250565b600061465e602f83613a9c565b915061466982614602565b604082019050919050565b6000602082019050818103600083015261468d81614651565b9050919050565b7f455243373231456e756d657261626c653a20676c6f62616c20696e646578206f60008201527f7574206f6620626f756e64730000000000000000000000000000000000000000602082015250565b60006146f0602c83613a9c565b91506146fb82614694565b604082019050919050565b6000602082019050818103600083015261471f816146e3565b9050919050565b60008190508160005260206000209050919050565b60006020601f8301049050919050565b600082821b905092915050565b6000600883026147887fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8261474b565b614792868361474b565b95508019841693508086168417925050509392505050565b60006147c56147c06147bb84613b43565b6140ac565b613b43565b9050919050565b6000819050919050565b6147df836147aa565b6147f36147eb826147cc565b848454614758565b825550505050565b600090565b6148086147fb565b6148138184846147d6565b505050565b5b818110156148375761482c600082614800565b600181019050614819565b5050565b601f82111561487c5761484d81614726565b6148568461473b565b81016020851015614865578190505b6148796148718561473b565b830182614818565b50505b505050565b600082821c905092915050565b600061489f60001984600802614881565b1980831691505092915050565b60006148b8838361488e565b9150826002028217905092915050565b6148d182613a91565b67ffffffffffffffff8111156148ea576148e9613f38565b5b6148f48254614365565b6148ff82828561483b565b600060209050601f8311600181146149325760008415614920578287015190505b61492a85826148ac565b865550614992565b601f19841661494086614726565b60005b8281101561496857848901518255600182019150602085019450602081019050614943565b868310156149855784890151614981601f89168261488e565b8355505b6001600288020188555050505b505050505050565b7f4552433732313a20696e76616c696420746f6b656e2049440000000000000000600082015250565b60006149d0601883613a9c565b91506149db8261499a565b602082019050919050565b600060208201905081810360008301526149ff816149c3565b9050919050565b614a0f816139d6565b82525050565b6000602082019050614a2a6000830184614a06565b92915050565b600081519050614a3f81614166565b92915050565b600060208284031215614a5b57614a5a6139cc565b5b6000614a6984828501614a30565b91505092915050565b7f636f6e747261637420646f6573206e6f7420696d706c656d656e742049526f7960008201527f616c7479416c6c6f776c69737400000000000000000000000000000000000000602082015250565b6000614ace602d83613a9c565b9150614ad982614a72565b604082019050919050565b60006020820190508181036000830152614afd81614ac1565b9050919050565b6000604082019050614b196000830185613bd8565b614b266020830184613bd8565b9392505050565b7f4552433732313a2061646472657373207a65726f206973206e6f74206120766160008201527f6c6964206f776e65720000000000000000000000000000000000000000000000602082015250565b6000614b89602983613a9c565b9150614b9482614b2d565b604082019050919050565b60006020820190508181036000830152614bb881614b7c565b9050919050565b600081905092915050565b6000614bd582613a91565b614bdf8185614bbf565b9350614bef818560208601613aad565b80840191505092915050565b6000614c078285614bca565b9150614c138284614bca565b91508190509392505050565b7f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560008201527f63656976657220696d706c656d656e7465720000000000000000000000000000602082015250565b6000614c7b603283613a9c565b9150614c8682614c1f565b604082019050919050565b60006020820190508181036000830152614caa81614c6e565b9050919050565b7f4552433732313a20617070726f76616c20746f2063757272656e74206f776e6560008201527f7200000000000000000000000000000000000000000000000000000000000000602082015250565b6000614d0d602183613a9c565b9150614d1882614cb1565b604082019050919050565b60006020820190508181036000830152614d3c81614d00565b9050919050565b7f4552433732313a20617070726f76652063616c6c6572206973206e6f7420746f60008201527f6b656e206f776e6572206f7220617070726f76656420666f7220616c6c000000602082015250565b6000614d9f603d83613a9c565b9150614daa82614d43565b604082019050919050565b60006020820190508181036000830152614dce81614d92565b9050919050565b7f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000600082015250565b6000614e0b601783614bbf565b9150614e1682614dd5565b601782019050919050565b7f206973206d697373696e6720726f6c6520000000000000000000000000000000600082015250565b6000614e57601183614bbf565b9150614e6282614e21565b601182019050919050565b6000614e7882614dfe565b9150614e848285614bca565b9150614e8f82614e4a565b9150614e9b8284614bca565b91508190509392505050565b7f4552433732313a206d696e7420746f20746865207a65726f2061646472657373600082015250565b6000614edd602083613a9c565b9150614ee882614ea7565b602082019050919050565b60006020820190508181036000830152614f0c81614ed0565b9050919050565b7f4552433732313a20746f6b656e20616c7265616479206d696e74656400000000600082015250565b6000614f49601c83613a9c565b9150614f5482614f13565b602082019050919050565b60006020820190508181036000830152614f7881614f3c565b9050919050565b600081519050919050565b600082825260208201905092915050565b6000614fa682614f7f565b614fb08185614f8a565b9350614fc0818560208601613aad565b614fc981613ad7565b840191505092915050565b6000608082019050614fe96000830187613bd8565b614ff66020830186613bd8565b6150036040830185613c6e565b81810360608301526150158184614f9b565b905095945050505050565b60008151905061502f81613a02565b92915050565b60006020828403121561504b5761504a6139cc565b5b600061505984828501615020565b91505092915050565b7f4552433732313a207472616e736665722066726f6d20696e636f72726563742060008201527f6f776e6572000000000000000000000000000000000000000000000000000000602082015250565b60006150be602583613a9c565b91506150c982615062565b604082019050919050565b600060208201905081810360008301526150ed816150b1565b9050919050565b7f4552433732313a207472616e7366657220746f20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b6000615150602483613a9c565b915061515b826150f4565b604082019050919050565b6000602082019050818103600083015261517f81615143565b9050919050565b600061519182613b43565b915061519c83613b43565b92508282019050808211156151b4576151b3614428565b5b92915050565b60006151c582613b43565b9150600082036151d8576151d7614428565b5b600182039050919050565b7f537472696e67733a20686578206c656e67746820696e73756666696369656e74600082015250565b6000615219602083613a9c565b9150615224826151e3565b602082019050919050565b600060208201905081810360008301526152488161520c565b9050919050565b600061525a82613b43565b915061526583613b43565b925082820390508181111561527d5761527c614428565b5b92915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603160045260246000fd5b7f455243373231456e756d657261626c653a20636f6e736563757469766520747260008201527f616e7366657273206e6f7420737570706f727465640000000000000000000000602082015250565b600061530e603583613a9c565b9150615319826152b2565b604082019050919050565b6000602082019050818103600083015261533d81615301565b9050919050565b7f4552433732313a20617070726f766520746f2063616c6c657200000000000000600082015250565b600061537a601983613a9c565b915061538582615344565b602082019050919050565b600060208201905081810360008301526153a98161536d565b905091905056fea2646970667358221220f2de678fa1f1a3fc28d8056ba46769331f91c7536f9259f07a82f3f97942823964736f6c63430008110033";class O3 extends vd{constructor(...e){e.length>1?super(...e):super(S3,k3,e[0])}deploy(e,t,r,n,i,a,o,s){return super.deploy(e,t,r,n,i,a,o,s||{})}getDeployTransaction(e,t,r,n,i,a,o,s){return super.getDeployTransaction(e,t,r,n,i,a,o,s||{})}attach(e){return super.attach(e)}connect(e){return super.connect(e)}static bytecode=k3;static abi=S3;static createInterface(){return new Bu(S3)}static connect(e,t){return new gd(e,S3,t)}}e.APIError=Zr,e.BlockchainData=class{config;activities;chains;collections;nfts;nftOwners;tokens;constructor(e){this.config=new nn(e),this.activities=new mt.ActivitiesApi(this.config.apiConfig),this.chains=new mt.ChainsApi(this.config.apiConfig),this.collections=new mt.CollectionsApi(this.config.apiConfig),this.nfts=new mt.NftsApi(this.config.apiConfig),this.nftOwners=new mt.NftOwnersApi(this.config.apiConfig),this.tokens=new mt.TokensApi(this.config.apiConfig)}async listActivities(e){return await this.activities.listActivities(e).then((e=>e.data)).catch((e=>{throw an(e)}))}async getActivity(e){return await this.activities.getActivity(e).then((e=>e.data)).catch((e=>{throw an(e)}))}async listChains(e){return await this.chains.listChains(e).then((e=>e.data)).catch((e=>{throw an(e)}))}async listCollections(e){return await this.collections.listCollections(e).then((e=>e.data)).catch((e=>{throw an(e)}))}async getCollection(e){return await this.collections.getCollection(e).then((e=>e.data)).catch((e=>{throw an(e)}))}async getNFT(e){return await this.nfts.getNFT(e).then((e=>e.data)).catch((e=>{throw an(e)}))}async listNFTs(e){return await this.nfts.listNFTs(e).then((e=>e.data)).catch((e=>{throw an(e)}))}async listNFTsByAccountAddress(e){return await this.nfts.listNFTsByAccountAddress(e).then((e=>e.data)).catch((e=>{throw an(e)}))}async listNFTOwners(e){return await this.nftOwners.listNFTOwners(e).then((e=>e.data)).catch((e=>{throw an(e)}))}async listTokens(e){return await this.tokens.listERC20Tokens(e).then((e=>e.data)).catch((e=>{throw an(e)}))}async getToken(e){return await this.tokens.getERC20Token(e).then((e=>e.data)).catch((e=>{throw an(e)}))}},e.BridgeReact=g3,e.CHECKOUT_API_BASE_URL=b2,e.Checkout=class{config;readOnlyProviders;constructor(e=K2){this.config=new z2(e),this.readOnlyProviders=new Map}async createProvider(e){return await N2(e.walletProvider)}async checkIsWalletConnected(t){return async function(t){if(!t?.provider?.request)throw new T2("Check wallet connection request failed",e.CheckoutErrorType.PROVIDER_REQUEST_FAILED_ERROR,{rpcMethod:p2.CHECK_CONNECTION});let r=[];try{r=await t.provider.request({method:p2.CHECK_CONNECTION,params:[]})}catch(t){throw new T2("Check wallet connection request failed",e.CheckoutErrorType.PROVIDER_REQUEST_FAILED_ERROR,{rpcMethod:p2.CHECK_CONNECTION})}return{isConnected:r&&r.length>0,walletAddress:r[0]??""}}(await M2(this.config,t.provider,{allowUnsupportedProvider:!0}))}async connect(t){const r=await M2(this.config,t.provider,{allowUnsupportedProvider:!0});await async function(t){return await A2((async()=>{if(!t||!t?.provider?.request)throw new T2("Incompatible provider",e.CheckoutErrorType.PROVIDER_REQUEST_MISSING_ERROR,{details:"Attempting to connect with an incompatible provider"});await t.provider.request({method:p2.CONNECT,params:[]})}),{type:e.CheckoutErrorType.USER_REJECTED_REQUEST_ERROR}),t}(r);return{provider:r,network:await O2(this.config,r)}}async switchNetwork(e){const t=await M2(this.config,e.provider,{allowUnsupportedProvider:!0,allowMistmatchedChainId:!0});return await R2(this.config,t,e.chainId)}async getBalance(e){const t=await M2(this.config,e.provider);return e.contractAddress&&""!==e.contractAddress?await C2(t,e.walletAddress,e.contractAddress):await I2(this.config,t,e.walletAddress)}async getAllBalances(t){const r=await M2(this.config,t.provider);return(async(t,r,n,i)=>{const a=await x2(t,{type:e.TokenFilterTypes.ALL,chainId:i}),o=[];return o.push(I2(t,r,n)),a.tokens.filter((e=>e.address)).forEach((e=>o.push(C2(r,n,e.address??"")))),{balances:(await Promise.allSettled(o)).filter((e=>"fulfilled"===e.status)).map((e=>e.value))}})(this.config,r,t.walletAddress,t.chainId)}async getNetworkAllowList(e){return await k2(this.config,e)}async getTokenAllowList(e){return await x2(this.config,e)}async getWalletAllowList(t){return await async function(t){const r=[],n=t.exclude?.map((e=>e.walletProvider))??[];let i=Object.values(e.WalletProviderName);0!==n.length&&(i=i.filter((e=>!n.includes(e))));for(const e of i)r.push({walletProvider:e,name:e});return{wallets:r}}(t)}async sendTransaction(t){const r=await M2(this.config,t.provider);return await(async(t,r)=>{try{return{transactionResponse:await t.getSigner().sendTransaction(r)}}catch(t){if(t.code===Py.errors.INSUFFICIENT_FUNDS)throw new T2(t.message,e.CheckoutErrorType.INSUFFICIENT_FUNDS);if(t.code===Py.errors.ACTION_REJECTED)throw new T2(t.message,e.CheckoutErrorType.USER_REJECTED_REQUEST_ERROR);if(t.code===Py.errors.UNPREDICTABLE_GAS_LIMIT)throw new T2(t.message,e.CheckoutErrorType.UNPREDICTABLE_GAS_LIMIT);throw new T2(t.message,e.CheckoutErrorType.TRANSACTION_FAILED)}})(r,t.transaction)}async getNetworkInfo(e){const t=await M2(this.config,e.provider,{allowUnsupportedProvider:!0,allowMistmatchedChainId:!0});return await O2(this.config,t)}static isWeb3Provider(e){return P2(e)}async gasEstimate(t){return this.readOnlyProviders=await async function(t,r){if(t.isProduction&&r?.has(e.ChainId.ETHEREUM))return r;if(r?.has(e.ChainId.SEPOLIA))return r;const n=new Map;return(await k2(t,{type:e.NetworkFilterTypes.ALL})).networks.forEach((e=>{const r=t.networkMap.get(e.chainId)?.rpcUrls[0],i=new om(r);n.set(e.chainId,i)})),n}(this.config,this.readOnlyProviders),await async function(t,r,n){switch(t.gasEstimateType){case e.GasEstimateType.BRIDGE_TO_L2:return await G2(r,n,t.isSpendingCapApprovalRequired,t.tokenAddress);case e.GasEstimateType.SWAP:return await W2(n);default:throw new T2("Invalid type provided for gasEstimateType",e.CheckoutErrorType.INVALID_GAS_ESTIMATE_TYPE)}}(t,this.readOnlyProviders,this.config)}},e.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"),r=function(e){const t=s3();if(void 0===e)return t;if(void 0===e.major||void 0===e.minor||void 0===e.patch||void 0===e.prerelease)return t;if(e.major<0)return t;if(e.minor<0)return t;if(e.patch<0)return t;if("alpha"!==e.prerelease)return t;if(0===e.major&&0===e.minor&&0===e.patch)return t;let r=t;return!Number.isNaN(e.major)&&e.major>=0&&(r=e.major.toString()),Number.isNaN(e.minor)||(r+=`.${e.minor.toString()}`),Number.isNaN(e.patch)||(r+=`.${e.patch.toString()}`),r+=`-${e.prerelease}`,void 0!==e.build&&e.build>0&&(r+=`.${e.build}`),r}(e?.version);let n=`https://cdn.jsdelivr.net/npm/@imtbl/sdk@${r}/dist/browser/checkout.js`;t.setAttribute("src",n),document.head.appendChild(t),window.ImtblCheckoutWidgetConfig=JSON.stringify(e)},e.ConnectReact=v3,e.ERC20=class{contract;constructor(e){const t=new A3;this.contract=t.attach(e)}async totalSupply(e,t={}){return this.contract.connect(e).totalSupply(t)}async balanceOf(e,t,r={}){return this.contract.connect(e).balanceOf(t,r)}async allowance(e,t,r,n={}){return this.contract.connect(e).allowance(t,r,n)}async populateTransfer(e,t,r){return this.contract.populateTransaction.transfer(e,t,r)}async populateApprove(e,t,r={}){return this.contract.populateTransaction.approve(e,t,r)}async populateTransferFrom(e,t,r,n={}){return this.contract.populateTransaction.transferFrom(e,t,r,n)}},e.ERC721PermissionedMintable=class{contract;constructor(e){const t=new O3;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,r={}){return await this.contract.connect(e).balanceOf(t,r)}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,r={}){return await this.contract.connect(e).getApproved(t,r)}async getRoleAdmin(e,t,r={}){return await this.contract.connect(e).getRoleAdmin(t,r)}async getRoleMember(e,t,r,n={}){return await this.contract.connect(e).getRoleMember(t,r,n)}async getRoleMemberCount(e,t,r={}){return await this.contract.connect(e).getRoleMemberCount(t,r)}async hasRole(e,t,r,n={}){return await this.contract.connect(e).hasRole(t,r,n)}async isApprovedForAll(e,t,r,n={}){return await this.contract.connect(e).isApprovedForAll(t,r,n)}async name(e,t={}){return await this.contract.connect(e).name(t)}async ownerOf(e,t,r={}){return await this.contract.connect(e).ownerOf(t,r)}async royaltyAllowlist(e,t={}){return await this.contract.connect(e).royaltyAllowlist(t)}async royaltyInfo(e,t,r,n={}){return await this.contract.connect(e).royaltyInfo(t,r,n)}async symbol(e,t={}){return await this.contract.connect(e).symbol(t)}async tokenByIndex(e,t,r={}){return await this.contract.connect(e).tokenByIndex(t,r)}async tokenOfOwnerByIndex(e,t,r,n={}){return await this.contract.connect(e).tokenOfOwnerByIndex(t,r,n)}async tokenURI(e,t,r={}){return await this.contract.connect(e).tokenURI(t,r)}async totalSupply(e,t={}){return await this.contract.connect(e).totalSupply(t)}async populateApprove(e,t,r={}){return await this.contract.populateTransaction.approve(e,t,r)}async populateBurn(e,t={}){return await this.contract.populateTransaction.burn(e,t)}async populateGrantMinterRole(e,t={}){return await this.contract.populateTransaction.grantMinterRole(e,t)}async populateGrantRole(e,t,r={}){return await this.contract.populateTransaction.grantRole(e,t,r)}async populateMint(e,t,r={}){return await this.contract.populateTransaction.mint(e,t,r)}async populateRenounceRole(e,t,r={}){return await this.contract.populateTransaction.renounceRole(e,t,r)}async populateRevokeMinterRole(e,t={}){return await this.contract.populateTransaction.revokeMinterRole(e,t)}async populateRevokeRole(e,t,r={}){return await this.contract.populateTransaction.revokeRole(e,t,r)}async"populateSafeTransferFrom(address,address,uint256)"(e,t,r,n={}){return await this.contract.populateTransaction["safeTransferFrom(address,address,uint256)"](e,t,r,n)}async"populateSafeTransferFrom(address,address,uint256,bytes)"(e,t,r,n,i={}){return await this.contract.populateTransaction["safeTransferFrom(address,address,uint256,bytes)"](e,t,r,n,i)}async populateSetApprovalForAll(e,t,r={}){return await this.contract.populateTransaction.setApprovalForAll(e,t,r)}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 populateSetRoyaltyAllowlistRegistry(e,t={}){return await this.contract.populateTransaction.setRoyaltyAllowlistRegistry(e,t)}},e.GenericIMXProvider=rX,e.ImmutableConfiguration=t,e.ImmutableXClient=jB,e.JsonRpcError=Wz,e.MetaMaskIMXProvider=vX,e.Orderbook=class{apiClient;seaport;orderbookConfig;constructor(t){const r={...function(t){switch(t){case e.Environment.SANDBOX:return{seaportContractAddress:"0x45E23dA18804F99Cf67408AeBE85F67c958381Ff",zoneContractAddress:"0x25b00b7eb97eab6194798E9B8eF63Aa526D5bd7E",apiEndpoint:"https://order-book-mr.sandbox.imtbl.com",chainName:"imtbl-zkevm-testnet",provider:new om("https://zkevm-rpc.sandbox.x.immutable.com")};case e.Environment.PRODUCTION:return{seaportContractAddress:"",zoneContractAddress:"",apiEndpoint:"https://order-book-mr.imtbl.com",chainName:"imtbl-zkevm-mainnet",provider:new om("https://zkevm-rpc.x.immutable.com")};default:return null}}(t.baseConfig.environment),...t.overrides};if(!r)throw new Error("Orderbook configuration not passed, please specify the environment under config.baseConfig.environment");this.orderbookConfig=r;const{apiEndpoint:n,chainName:i}=this.orderbookConfig;if(!n)throw new Error("API endpoint must be provided");this.apiClient=new MK(n,i,this.orderbookConfig.seaportContractAddress).create();const a=new UK(this.orderbookConfig.seaportContractAddress,this.orderbookConfig.provider);this.seaport=new NK(a,this.orderbookConfig.provider,this.orderbookConfig.seaportContractAddress,this.orderbookConfig.zoneContractAddress)}getListing(e){return this.apiClient.getListing(e)}listListings(e){return this.apiClient.listListings(e)}async prepareListing({makerAddress:e,sell:t,buy:r,orderExpiry:n}){const i=new LK(t.contractAddress,this.orderbookConfig.provider).create(),a=await i.royaltyInfo(t.tokenId,r.amount);return this.seaport.prepareSeaportOrder(e,t,r,a,new Date,n||new Date(Date.now()+63072e6))}createListing(e){return this.apiClient.createListing(e)}async fulfillOrder(e,t){const r=await this.apiClient.getListing(e);if(r.result.status!==AK.ACTIVE)throw new Error(`Cannot fulfil order that is not active. Current status: ${r.result.status}`);return this.seaport.fulfilOrder(r.result,t)}async cancelOrder(e,t){const r=await this.apiClient.getListing(e);if(r.result.status!==AK.ACTIVE&&r.result.status!==AK.INACTIVE&&r.result.status!==AK.PENDING)throw new Error(`Cannot cancel order with status ${r.result.status}`);if(r.result.account_address!==t.toLowerCase())throw new Error(`Only account ${r.result.account_address} can cancel order ${e}`);return{unsignedCancelOrderTransaction:await this.seaport.cancelOrder(r.result,t)}}},e.Passport=class{authManager;config;confirmationScreen;immutableXClient;magicAdapter;passportImxProviderFactory;multiRollupApiClients;constructor(e){this.config=new Pz(e),this.authManager=new _z(this.config),this.magicAdapter=new Ez(this.config),this.confirmationScreen=new jz(this.config),this.immutableXClient=e.overrides?.immutableXClient||new jB({baseConfig:e.baseConfig}),this.multiRollupApiClients=new yt(this.config.multiRollupConfig),this.passportImxProviderFactory=new Iz({authManager:this.authManager,config:this.config,confirmationScreen:this.confirmationScreen,immutableXClient:this.immutableXClient,magicAdapter:this.magicAdapter})}async connectImxSilent(){return this.passportImxProviderFactory.getProviderSilent()}async connectImx(){return this.passportImxProviderFactory.getProvider()}async loginWithDeviceFlow(){return this.authManager.loginWithDeviceFlow()}async connectImxDeviceFlow(e,t,r){return this.passportImxProviderFactory.getProviderWithDeviceFlow(e,t,r)}checkStoredDeviceFlowCredentials(){return this.authManager.checkStoredDeviceFlowCredentials()}async connectImxWithCredentials(e){return this.passportImxProviderFactory.getProviderWithCredentials(e)}connectEvm(){return new Qz({authManager:this.authManager,magicAdapter:this.magicAdapter,config:this.config,confirmationScreen:this.confirmationScreen,multiRollupApiClients:this.multiRollupApiClients})}async loginCallback(){return this.authManager.loginCallback()}async logout(){return this.authManager.logout()}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}},e.PassportError=mz,e.ProviderConfiguration=class{immutableXConfig;baseConfig;constructor({baseConfig:t,overrides:r}){if(this.baseConfig=t,r)this.immutableXConfig=r.immutableXConfig;else switch(t.environment){case e.Environment.SANDBOX:this.immutableXConfig=TP.SANDBOX;break;case e.Environment.PRODUCTION:this.immutableXConfig=TP.PRODUCTION}}},e.SwapReact=w3,e.UpdateConfig=function(e){void 0!==window?window.ImtblCheckoutWidgetConfig=JSON.stringify(e):console.error("missing document object: please run Checkout client side")},e.WalletReact=_3,e.imxClientCreateStarkSigner=NC,e.imxClientGenerateLegacyStarkPrivateKey=xC,e.module="orderbook"}));
84
+ */"production"===process.env.NODE_ENV?$2.exports=function(){if(t3)return J2;t3=1;var e=r3,t=Symbol.for("react.element"),r=Symbol.for("react.fragment"),n=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,r,o){var s,u={},f=null,c=null;for(s in void 0!==o&&(f=""+o),void 0!==r.key&&(f=""+r.key),void 0!==r.ref&&(c=r.ref),r)n.call(r,s)&&!a.hasOwnProperty(s)&&(u[s]=r[s]);if(e&&e.defaultProps)for(s in r=e.defaultProps)void 0===u[s]&&(u[s]=r[s]);return{$$typeof:t,type:e,key:f,ref:c,props:u,_owner:i.current}}return J2.Fragment=r,J2.jsx=o,J2.jsxs=o,J2}():$2.exports=(n3||(n3=1,"production"!==process.env.NODE_ENV&&function(){var e=r3,t=Symbol.for("react.element"),r=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),a=Symbol.for("react.profiler"),o=Symbol.for("react.provider"),s=Symbol.for("react.context"),u=Symbol.for("react.forward_ref"),f=Symbol.for("react.suspense"),c=Symbol.for("react.suspense_list"),l=Symbol.for("react.memo"),d=Symbol.for("react.lazy"),p=Symbol.for("react.offscreen"),h=Symbol.iterator,m="@@iterator",y=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function b(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];!function(e,t,r){var n=y.ReactDebugCurrentFrame.getStackAddendum();""!==n&&(t+="%s",r=r.concat([n]));var i=r.map((function(e){return String(e)}));i.unshift("Warning: "+t),Function.prototype.apply.call(console[e],console,i)}("error",e,r)}var g,v=!1,w=!1,_=!1,E=!1,T=!1;function A(e){return e.displayName||"Context"}function S(e){if(null==e)return null;if("number"==typeof e.tag&&b("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),"function"==typeof e)return e.displayName||e.name||null;if("string"==typeof e)return e;switch(e){case n:return"Fragment";case r:return"Portal";case a:return"Profiler";case i:return"StrictMode";case f:return"Suspense";case c:return"SuspenseList"}if("object"==typeof e)switch(e.$$typeof){case s:return A(e)+".Consumer";case o:return A(e._context)+".Provider";case u:return function(e,t,r){var n=e.displayName;if(n)return n;var i=t.displayName||t.name||"";return""!==i?r+"("+i+")":r}(e,e.render,"ForwardRef");case l:var t=e.displayName||null;return null!==t?t:S(e.type)||"Memo";case d:var p=e,h=p._payload,m=p._init;try{return S(m(h))}catch(e){return null}}return null}g=Symbol.for("react.module.reference");var k,O,R,x,I,C,N,P=Object.assign,M=0;function B(){}B.__reactDisabledLog=!0;var D,F=y.ReactCurrentDispatcher;function L(e,t,r){if(void 0===D)try{throw Error()}catch(e){var n=e.stack.trim().match(/\n( *(at )?)/);D=n&&n[1]||""}return"\n"+D+e}var U,j=!1,q="function"==typeof WeakMap?WeakMap:Map;function z(e,t){if(!e||j)return"";var r,n=U.get(e);if(void 0!==n)return n;j=!0;var i,a=Error.prepareStackTrace;Error.prepareStackTrace=void 0,i=F.current,F.current=null,function(){if(0===M){k=console.log,O=console.info,R=console.warn,x=console.error,I=console.group,C=console.groupCollapsed,N=console.groupEnd;var e={configurable:!0,enumerable:!0,value:B,writable:!0};Object.defineProperties(console,{info:e,log:e,warn:e,error:e,group:e,groupCollapsed:e,groupEnd:e})}M++}();try{if(t){var o=function(){throw Error()};if(Object.defineProperty(o.prototype,"props",{set:function(){throw Error()}}),"object"==typeof Reflect&&Reflect.construct){try{Reflect.construct(o,[])}catch(e){r=e}Reflect.construct(e,[],o)}else{try{o.call()}catch(e){r=e}e.call(o.prototype)}}else{try{throw Error()}catch(e){r=e}e()}}catch(t){if(t&&r&&"string"==typeof t.stack){for(var s=t.stack.split("\n"),u=r.stack.split("\n"),f=s.length-1,c=u.length-1;f>=1&&c>=0&&s[f]!==u[c];)c--;for(;f>=1&&c>=0;f--,c--)if(s[f]!==u[c]){if(1!==f||1!==c)do{if(f--,--c<0||s[f]!==u[c]){var l="\n"+s[f].replace(" at new "," at ");return e.displayName&&l.includes("<anonymous>")&&(l=l.replace("<anonymous>",e.displayName)),"function"==typeof e&&U.set(e,l),l}}while(f>=1&&c>=0);break}}}finally{j=!1,F.current=i,function(){if(0==--M){var e={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:P({},e,{value:k}),info:P({},e,{value:O}),warn:P({},e,{value:R}),error:P({},e,{value:x}),group:P({},e,{value:I}),groupCollapsed:P({},e,{value:C}),groupEnd:P({},e,{value:N})})}M<0&&b("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}(),Error.prepareStackTrace=a}var d=e?e.displayName||e.name:"",p=d?L(d):"";return"function"==typeof e&&U.set(e,p),p}function H(e,t,r){if(null==e)return"";if("function"==typeof e)return z(e,function(e){var t=e.prototype;return!(!t||!t.isReactComponent)}(e));if("string"==typeof e)return L(e);switch(e){case f:return L("Suspense");case c:return L("SuspenseList")}if("object"==typeof e)switch(e.$$typeof){case u:return function(e,t,r){return z(e,!1)}(e.render);case l:return H(e.type,t,r);case d:var n=e,i=n._payload,a=n._init;try{return H(a(i),t,r)}catch(e){}}return""}U=new q;var V=Object.prototype.hasOwnProperty,G={},W=y.ReactDebugCurrentFrame;function K(e){if(e){var t=e._owner,r=H(e.type,e._source,t?t.type:null);W.setExtraStackFrame(r)}else W.setExtraStackFrame(null)}var X=Array.isArray;function $(e){return X(e)}function J(e){return""+e}function Y(e){if(function(e){try{return J(e),!1}catch(e){return!0}}(e))return b("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",function(e){return"function"==typeof Symbol&&Symbol.toStringTag&&e[Symbol.toStringTag]||e.constructor.name||"Object"}(e)),J(e)}var Q,Z,ee,te=y.ReactCurrentOwner,re={key:!0,ref:!0,__self:!0,__source:!0};ee={};var ne=function(e,r,n,i,a,o,s){var u={$$typeof:t,type:e,key:r,ref:n,props:s,_owner:o,_store:{}};return Object.defineProperty(u._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(u,"_self",{configurable:!1,enumerable:!1,writable:!1,value:i}),Object.defineProperty(u,"_source",{configurable:!1,enumerable:!1,writable:!1,value:a}),Object.freeze&&(Object.freeze(u.props),Object.freeze(u)),u};function ie(e,t,r,n,i){var a,o={},s=null,u=null;for(a in void 0!==r&&(Y(r),s=""+r),function(e){if(V.call(e,"key")){var t=Object.getOwnPropertyDescriptor(e,"key").get;if(t&&t.isReactWarning)return!1}return void 0!==e.key}(t)&&(Y(t.key),s=""+t.key),function(e){if(V.call(e,"ref")){var t=Object.getOwnPropertyDescriptor(e,"ref").get;if(t&&t.isReactWarning)return!1}return void 0!==e.ref}(t)&&(u=t.ref,function(e,t){if("string"==typeof e.ref&&te.current&&t&&te.current.stateNode!==t){var r=S(te.current.type);ee[r]||(b('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref',S(te.current.type),e.ref),ee[r]=!0)}}(t,i)),t)V.call(t,a)&&!re.hasOwnProperty(a)&&(o[a]=t[a]);if(e&&e.defaultProps){var f=e.defaultProps;for(a in f)void 0===o[a]&&(o[a]=f[a])}if(s||u){var c="function"==typeof e?e.displayName||e.name||"Unknown":e;s&&function(e,t){var r=function(){Q||(Q=!0,b("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",t))};r.isReactWarning=!0,Object.defineProperty(e,"key",{get:r,configurable:!0})}(o,c),u&&function(e,t){var r=function(){Z||(Z=!0,b("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",t))};r.isReactWarning=!0,Object.defineProperty(e,"ref",{get:r,configurable:!0})}(o,c)}return ne(e,s,u,i,n,te.current,o)}var ae,oe=y.ReactCurrentOwner,se=y.ReactDebugCurrentFrame;function ue(e){if(e){var t=e._owner,r=H(e.type,e._source,t?t.type:null);se.setExtraStackFrame(r)}else se.setExtraStackFrame(null)}function fe(e){return"object"==typeof e&&null!==e&&e.$$typeof===t}function ce(){if(oe.current){var e=S(oe.current.type);if(e)return"\n\nCheck the render method of `"+e+"`."}return""}ae=!1;var le={};function de(e,t){if(e._store&&!e._store.validated&&null==e.key){e._store.validated=!0;var r=function(e){var t=ce();if(!t){var r="string"==typeof e?e:e.displayName||e.name;r&&(t="\n\nCheck the top-level render call using <"+r+">.")}return t}(t);if(!le[r]){le[r]=!0;var n="";e&&e._owner&&e._owner!==oe.current&&(n=" It was passed a child from "+S(e._owner.type)+"."),ue(e),b('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',r,n),ue(null)}}}function pe(e,t){if("object"==typeof e)if($(e))for(var r=0;r<e.length;r++){var n=e[r];fe(n)&&de(n,t)}else if(fe(e))e._store&&(e._store.validated=!0);else if(e){var i=function(e){if(null===e||"object"!=typeof e)return null;var t=h&&e[h]||e[m];return"function"==typeof t?t:null}(e);if("function"==typeof i&&i!==e.entries)for(var a,o=i.call(e);!(a=o.next()).done;)fe(a.value)&&de(a.value,t)}}function he(e){var t,r=e.type;if(null!=r&&"string"!=typeof r){if("function"==typeof r)t=r.propTypes;else{if("object"!=typeof r||r.$$typeof!==u&&r.$$typeof!==l)return;t=r.propTypes}if(t){var n=S(r);!function(e,t,r,n,i){var a=Function.call.bind(V);for(var o in e)if(a(e,o)){var s=void 0;try{if("function"!=typeof e[o]){var u=Error((n||"React class")+": "+r+" type `"+o+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[o]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw u.name="Invariant Violation",u}s=e[o](t,o,n,r,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(e){s=e}!s||s instanceof Error||(K(i),b("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",n||"React class",r,o,typeof s),K(null)),s instanceof Error&&!(s.message in G)&&(G[s.message]=!0,K(i),b("Failed %s type: %s",r,s.message),K(null))}}(t,e.props,"prop",n,e)}else void 0===r.PropTypes||ae||(ae=!0,b("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",S(r)||"Unknown"));"function"!=typeof r.getDefaultProps||r.getDefaultProps.isReactClassApproved||b("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function me(e,r,h,m,y,A){var k=function(e){return"string"==typeof e||"function"==typeof e||!!(e===n||e===a||T||e===i||e===f||e===c||E||e===p||v||w||_)||"object"==typeof e&&null!==e&&(e.$$typeof===d||e.$$typeof===l||e.$$typeof===o||e.$$typeof===s||e.$$typeof===u||e.$$typeof===g||void 0!==e.getModuleId)}(e);if(!k){var O="";(void 0===e||"object"==typeof e&&null!==e&&0===Object.keys(e).length)&&(O+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var R,x=function(e){return void 0!==e?"\n\nCheck your code at "+e.fileName.replace(/^.*[\\\/]/,"")+":"+e.lineNumber+".":""}(y);O+=x||ce(),null===e?R="null":$(e)?R="array":void 0!==e&&e.$$typeof===t?(R="<"+(S(e.type)||"Unknown")+" />",O=" Did you accidentally export a JSX literal instead of a component?"):R=typeof e,b("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",R,O)}var I=ie(e,r,h,y,A);if(null==I)return I;if(k){var C=r.children;if(void 0!==C)if(m)if($(C)){for(var N=0;N<C.length;N++)pe(C[N],e);Object.freeze&&Object.freeze(C)}else b("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else pe(C,e)}return e===n?function(e){for(var t=Object.keys(e.props),r=0;r<t.length;r++){var n=t[r];if("children"!==n&&"key"!==n){ue(e),b("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",n),ue(null);break}}null!==e.ref&&(ue(e),b("Invalid attribute `ref` supplied to `React.Fragment`."),ue(null))}(I):he(I),I}var ye=function(e,t,r){return me(e,t,r,!1)},be=function(e,t,r){return me(e,t,r,!0)};i3.Fragment=n,i3.jsx=ye,i3.jsxs=be}()),i3);var a3=$2.exports;function o3(e,t,r,n){Object.defineProperty(e,t,{get:r,set:n,enumerable:!0,configurable:!0})}const s3=()=>"0.3.2-alpha";var u3;o3({},"IMTBLWidgetEvents",(()=>e.IMTBLWidgetEvents)),e.IMTBLWidgetEvents=void 0,(u3=e.IMTBLWidgetEvents||(e.IMTBLWidgetEvents={})).IMTBL_CONNECT_WIDGET_EVENT="imtbl-connect-widget",u3.IMTBL_WALLET_WIDGET_EVENT="imtbl-wallet-widget",u3.IMTBL_SWAP_WIDGET_EVENT="imtbl-swap-widget",u3.IMTBL_BRIDGE_WIDGET_EVENT="imtbl-bridge-widget";var f3;o3({},"ConnectEventType",(()=>e.ConnectEventType)),e.ConnectEventType=void 0,(f3=e.ConnectEventType||(e.ConnectEventType={})).CLOSE_WIDGET="close-widget",f3.SUCCESS="success",f3.FAILURE="failure";var c3;o3({},"WalletEventType",(()=>e.WalletEventType)),e.WalletEventType=void 0,(c3=e.WalletEventType||(e.WalletEventType={})).CLOSE_WIDGET="close-widget",c3.NETWORK_SWITCH="network-switch",c3.DISCONNECT_WALLET="disconnect-wallet";var l3;o3({},"SwapEventType",(()=>e.SwapEventType)),e.SwapEventType=void 0,(l3=e.SwapEventType||(e.SwapEventType={})).CLOSE_WIDGET="close-widget",l3.SUCCESS="success",l3.FAILURE="failure",l3.REJECTED="rejected";var d3;o3({},"BridgeEventType",(()=>e.BridgeEventType)),e.BridgeEventType=void 0,(d3=e.BridgeEventType||(e.BridgeEventType={})).CLOSE_WIDGET="close-widget",d3.SUCCESS="success",d3.FAILURE="failure";var p3;o3({},"OrchestrationEventType",(()=>e.OrchestrationEventType)),e.OrchestrationEventType=void 0,(p3=e.OrchestrationEventType||(e.OrchestrationEventType={})).REQUEST_CONNECT="request-connect",p3.REQUEST_WALLET="request-wallet",p3.REQUEST_SWAP="request-swap",p3.REQUEST_BRIDGE="request-bridge",p3.REQUEST_ONRAMP="request-onramp";var h3,m3,y3={};o3(y3,"WidgetTheme",(()=>e.WidgetTheme)),o3(y3,"CheckoutWidgetTagNames",(()=>e.CheckoutWidgetTagNames)),e.WidgetTheme=void 0,(h3=e.WidgetTheme||(e.WidgetTheme={})).LIGHT="light",h3.DARK="dark",h3.CUSTOM="custom",e.CheckoutWidgetTagNames=void 0,(m3=e.CheckoutWidgetTagNames||(e.CheckoutWidgetTagNames={})).CONNECT="imtbl-connect",m3.WALLET="imtbl-wallet",m3.SWAP="imtbl-swap",m3.BRIDGE="imtbl-bridge";function b3(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 r=0;let n;const i=()=>{try{const r=document.getElementsByTagName(e);r[0].setProvider(t),window.clearInterval(n)}catch(e){r++,r>=10&&(window.clearInterval(n),console.error("failed to set the provider"))}};n=window.setInterval(i,10),i()}function g3(t){const{walletProvider:r,fromContractAddress:n,amount:i,provider:a}=t;r3.useEffect((()=>{a&&b3(e.CheckoutWidgetTagNames.BRIDGE,a)}),[a]);const o=window.ImtblCheckoutWidgetConfig;return a3.jsx("imtbl-bridge",{widgetConfig:o,walletProvider:r,fromContractAddress:n??"",amount:i??""})}o3({},"BridgeReact",(()=>g3));function v3(){const e=window.ImtblCheckoutWidgetConfig;return a3.jsx("imtbl-connect",{widgetConfig:e})}o3({},"ConnectReact",(()=>v3));function w3(t){const{walletProvider:r,fromContractAddress:n,amount:i,toContractAddress:a,provider:o}=t;r3.useEffect((()=>{o&&b3(e.CheckoutWidgetTagNames.SWAP,o)}),[o]);const s=window.ImtblCheckoutWidgetConfig;return a3.jsx("imtbl-swap",{widgetConfig:s,walletProvider:r,fromContractAddress:n??"",toContractAddress:a??"",amount:i??""})}o3({},"SwapReact",(()=>w3));function _3(t){const{walletProvider:r,provider:n}=t;r3.useEffect((()=>{n&&b3(e.CheckoutWidgetTagNames.WALLET,n)}),[n]);const i=window.ImtblCheckoutWidgetConfig;return a3.jsx("imtbl-wallet",{widgetConfig:i,walletProvider:r})}o3({},"WalletReact",(()=>_3));const E3=[{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"}],T3="0x60806040523480156200001157600080fd5b50604051620017ec380380620017ec8339818101604052810190620000379190620001f6565b8160039081620000489190620004c6565b5080600490816200005a9190620004c6565b505050620005ad565b6000604051905090565b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b620000cc8262000081565b810181811067ffffffffffffffff82111715620000ee57620000ed62000092565b5b80604052505050565b60006200010362000063565b9050620001118282620000c1565b919050565b600067ffffffffffffffff82111562000134576200013362000092565b5b6200013f8262000081565b9050602081019050919050565b60005b838110156200016c5780820151818401526020810190506200014f565b60008484015250505050565b60006200018f620001898462000116565b620000f7565b905082815260208101848484011115620001ae57620001ad6200007c565b5b620001bb8482856200014c565b509392505050565b600082601f830112620001db57620001da62000077565b5b8151620001ed84826020860162000178565b91505092915050565b6000806040838503121562000210576200020f6200006d565b5b600083015167ffffffffffffffff81111562000231576200023062000072565b5b6200023f85828601620001c3565b925050602083015167ffffffffffffffff81111562000263576200026262000072565b5b6200027185828601620001c3565b9150509250929050565b600081519050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b60006002820490506001821680620002ce57607f821691505b602082108103620002e457620002e362000286565b5b50919050565b60008190508160005260206000209050919050565b60006020601f8301049050919050565b600082821b905092915050565b6000600883026200034e7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff826200030f565b6200035a86836200030f565b95508019841693508086168417925050509392505050565b6000819050919050565b6000819050919050565b6000620003a7620003a16200039b8462000372565b6200037c565b62000372565b9050919050565b6000819050919050565b620003c38362000386565b620003db620003d282620003ae565b8484546200031c565b825550505050565b600090565b620003f2620003e3565b620003ff818484620003b8565b505050565b5b8181101562000427576200041b600082620003e8565b60018101905062000405565b5050565b601f82111562000476576200044081620002ea565b6200044b84620002ff565b810160208510156200045b578190505b620004736200046a85620002ff565b83018262000404565b50505b505050565b600082821c905092915050565b60006200049b600019846008026200047b565b1980831691505092915050565b6000620004b6838362000488565b9150826002028217905092915050565b620004d1826200027b565b67ffffffffffffffff811115620004ed57620004ec62000092565b5b620004f98254620002b5565b620005068282856200042b565b600060209050601f8311600181146200053e576000841562000529578287015190505b620005358582620004a8565b865550620005a5565b601f1984166200054e86620002ea565b60005b82811015620005785784890151825560018201915060208501945060208101905062000551565b8683101562000598578489015162000594601f89168262000488565b8355505b6001600288020188555050505b505050505050565b61122f80620005bd6000396000f3fe608060405234801561001057600080fd5b50600436106100a95760003560e01c80633950935111610071578063395093511461016857806370a082311461019857806395d89b41146101c8578063a457c2d7146101e6578063a9059cbb14610216578063dd62ed3e14610246576100a9565b806306fdde03146100ae578063095ea7b3146100cc57806318160ddd146100fc57806323b872dd1461011a578063313ce5671461014a575b600080fd5b6100b6610276565b6040516100c39190610b0c565b60405180910390f35b6100e660048036038101906100e19190610bc7565b610308565b6040516100f39190610c22565b60405180910390f35b61010461032b565b6040516101119190610c4c565b60405180910390f35b610134600480360381019061012f9190610c67565b610335565b6040516101419190610c22565b60405180910390f35b610152610364565b60405161015f9190610cd6565b60405180910390f35b610182600480360381019061017d9190610bc7565b61036d565b60405161018f9190610c22565b60405180910390f35b6101b260048036038101906101ad9190610cf1565b6103a4565b6040516101bf9190610c4c565b60405180910390f35b6101d06103ec565b6040516101dd9190610b0c565b60405180910390f35b61020060048036038101906101fb9190610bc7565b61047e565b60405161020d9190610c22565b60405180910390f35b610230600480360381019061022b9190610bc7565b6104f5565b60405161023d9190610c22565b60405180910390f35b610260600480360381019061025b9190610d1e565b610518565b60405161026d9190610c4c565b60405180910390f35b60606003805461028590610d8d565b80601f01602080910402602001604051908101604052809291908181526020018280546102b190610d8d565b80156102fe5780601f106102d3576101008083540402835291602001916102fe565b820191906000526020600020905b8154815290600101906020018083116102e157829003601f168201915b5050505050905090565b60008061031361059f565b90506103208185856105a7565b600191505092915050565b6000600254905090565b60008061034061059f565b905061034d858285610770565b6103588585856107fc565b60019150509392505050565b60006012905090565b60008061037861059f565b905061039981858561038a8589610518565b6103949190610ded565b6105a7565b600191505092915050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6060600480546103fb90610d8d565b80601f016020809104026020016040519081016040528092919081815260200182805461042790610d8d565b80156104745780601f1061044957610100808354040283529160200191610474565b820191906000526020600020905b81548152906001019060200180831161045757829003601f168201915b5050505050905090565b60008061048961059f565b905060006104978286610518565b9050838110156104dc576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016104d390610e93565b60405180910390fd5b6104e982868684036105a7565b60019250505092915050565b60008061050061059f565b905061050d8185856107fc565b600191505092915050565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1603610616576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161060d90610f25565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1603610685576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161067c90610fb7565b60405180910390fd5b80600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516107639190610c4c565b60405180910390a3505050565b600061077c8484610518565b90507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff81146107f657818110156107e8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107df90611023565b60405180910390fd5b6107f584848484036105a7565b5b50505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff160361086b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610862906110b5565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16036108da576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108d190611147565b60405180910390fd5b6108e5838383610a72565b60008060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490508181101561096b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610962906111d9565b60405180910390fd5b8181036000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef84604051610a599190610c4c565b60405180910390a3610a6c848484610a77565b50505050565b505050565b505050565b600081519050919050565b600082825260208201905092915050565b60005b83811015610ab6578082015181840152602081019050610a9b565b60008484015250505050565b6000601f19601f8301169050919050565b6000610ade82610a7c565b610ae88185610a87565b9350610af8818560208601610a98565b610b0181610ac2565b840191505092915050565b60006020820190508181036000830152610b268184610ad3565b905092915050565b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000610b5e82610b33565b9050919050565b610b6e81610b53565b8114610b7957600080fd5b50565b600081359050610b8b81610b65565b92915050565b6000819050919050565b610ba481610b91565b8114610baf57600080fd5b50565b600081359050610bc181610b9b565b92915050565b60008060408385031215610bde57610bdd610b2e565b5b6000610bec85828601610b7c565b9250506020610bfd85828601610bb2565b9150509250929050565b60008115159050919050565b610c1c81610c07565b82525050565b6000602082019050610c376000830184610c13565b92915050565b610c4681610b91565b82525050565b6000602082019050610c616000830184610c3d565b92915050565b600080600060608486031215610c8057610c7f610b2e565b5b6000610c8e86828701610b7c565b9350506020610c9f86828701610b7c565b9250506040610cb086828701610bb2565b9150509250925092565b600060ff82169050919050565b610cd081610cba565b82525050565b6000602082019050610ceb6000830184610cc7565b92915050565b600060208284031215610d0757610d06610b2e565b5b6000610d1584828501610b7c565b91505092915050565b60008060408385031215610d3557610d34610b2e565b5b6000610d4385828601610b7c565b9250506020610d5485828601610b7c565b9150509250929050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b60006002820490506001821680610da557607f821691505b602082108103610db857610db7610d5e565b5b50919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000610df882610b91565b9150610e0383610b91565b9250828201905080821115610e1b57610e1a610dbe565b5b92915050565b7f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f7760008201527f207a65726f000000000000000000000000000000000000000000000000000000602082015250565b6000610e7d602583610a87565b9150610e8882610e21565b604082019050919050565b60006020820190508181036000830152610eac81610e70565b9050919050565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b6000610f0f602483610a87565b9150610f1a82610eb3565b604082019050919050565b60006020820190508181036000830152610f3e81610f02565b9050919050565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b6000610fa1602283610a87565b9150610fac82610f45565b604082019050919050565b60006020820190508181036000830152610fd081610f94565b9050919050565b7f45524332303a20696e73756666696369656e7420616c6c6f77616e6365000000600082015250565b600061100d601d83610a87565b915061101882610fd7565b602082019050919050565b6000602082019050818103600083015261103c81611000565b9050919050565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b600061109f602583610a87565b91506110aa82611043565b604082019050919050565b600060208201905081810360008301526110ce81611092565b9050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b6000611131602383610a87565b915061113c826110d5565b604082019050919050565b6000602082019050818103600083015261116081611124565b9050919050565b7f45524332303a207472616e7366657220616d6f756e742065786365656473206260008201527f616c616e63650000000000000000000000000000000000000000000000000000602082015250565b60006111c3602683610a87565b91506111ce82611167565b604082019050919050565b600060208201905081810360008301526111f2816111b6565b905091905056fea26469706673582212204188b273199f085e1921ec1a1fa55abdee2e425960bda675a51fac85acd9972064736f6c63430008110033";class A3 extends vd{constructor(...e){e.length>1?super(...e):super(E3,T3,e[0])}deploy(e,t,r){return super.deploy(e,t,r||{})}getDeployTransaction(e,t,r){return super.getDeployTransaction(e,t,r||{})}attach(e){return super.attach(e)}connect(e){return super.connect(e)}static bytecode=T3;static abi=E3;static createInterface(){return new Bu(E3)}static connect(e,t){return new gd(e,E3,t)}}const S3=[{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:"_receiver",type:"address"},{internalType:"uint96",name:"_feeNumerator",type:"uint96"}],stateMutability:"nonpayable",type:"constructor"},{inputs:[{internalType:"address",name:"target",type:"address"}],name:"ApproveTargetNotInAllowlist",type:"error"},{inputs:[{internalType:"address",name:"caller",type:"address"}],name:"CallerNotInAllowlist",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:[{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:!1,internalType:"address",name:"oldRegistry",type:"address"},{indexed:!1,internalType:"address",name:"newRegistry",type:"address"}],name:"RoyaltytAllowlistRegistryUpdated",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:"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:[{internalType:"uint256",name:"tokenId",type:"uint256"}],name:"burn",outputs:[],stateMutability:"nonpayable",type:"function"},{inputs:[],name:"contractURI",outputs:[{internalType:"string",name:"",type:"string"}],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:"amount",type:"uint256"}],name:"mint",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:"ownerOf",outputs:[{internalType:"address",name:"",type:"address"}],stateMutability:"view",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:[],name:"royaltyAllowlist",outputs:[{internalType:"contract IRoyaltyAllowlist",name:"",type:"address"}],stateMutability:"view",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:"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:[{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:"_royaltyAllowlist",type:"address"}],name:"setRoyaltyAllowlistRegistry",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:"index",type:"uint256"}],name:"tokenByIndex",outputs:[{internalType:"uint256",name:"",type:"uint256"}],stateMutability:"view",type:"function"},{inputs:[{internalType:"address",name:"owner",type:"address"},{internalType:"uint256",name:"index",type:"uint256"}],name:"tokenOfOwnerByIndex",outputs:[{internalType:"uint256",name:"",type:"uint256"}],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"}],k3="0x60806040523480156200001157600080fd5b50604051620060d4380380620060d4833981810160405281019062000037919062000762565b868686868686868585816000908162000051919062000adc565b50806001908162000063919062000adc565b505050620000788282620000dc60201b60201c565b6200008d6000801b886200027f60201b60201c565b83601090816200009e919062000adc565b5082600f9081620000b0919062000adc565b50620000c86011620002c760201b620015f11760201c565b505050505050505050505050505062000cde565b620000ec620002dd60201b60201c565b6bffffffffffffffffffffffff16816bffffffffffffffffffffffff1611156200014d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401620001449062000c4a565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1603620001bf576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401620001b69062000cbc565b60405180910390fd5b60405180604001604052808373ffffffffffffffffffffffffffffffffffffffff168152602001826bffffffffffffffffffffffff16815250600d60008201518160000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060208201518160000160146101000a8154816bffffffffffffffffffffffff02191690836bffffffffffffffffffffffff1602179055509050505050565b620002968282620002e760201b620016071760201c565b620002c28160076000858152602001908152602001600020620003d960201b620016e81790919060201c565b505050565b6001816000016000828254019250508190555050565b6000612710905090565b620002f982826200041160201b60201c565b620003d55760016006600084815260200190815260200160002060000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055506200037a6200047c60201b60201c565b73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45b5050565b600062000409836000018373ffffffffffffffffffffffffffffffffffffffff1660001b6200048460201b60201c565b905092915050565b60006006600084815260200190815260200160002060000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16905092915050565b600033905090565b6000620004988383620004fe60201b60201c565b620004f3578260000182908060018154018082558091505060019003906000526020600020016000909190919091505582600001805490508360010160008481526020019081526020016000208190555060019050620004f8565b600090505b92915050565b600080836001016000848152602001908152602001600020541415905092915050565b6000604051905090565b600080fd5b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000620005628262000535565b9050919050565b620005748162000555565b81146200058057600080fd5b50565b600081519050620005948162000569565b92915050565b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b620005ef82620005a4565b810181811067ffffffffffffffff82111715620006115762000610620005b5565b5b80604052505050565b60006200062662000521565b9050620006348282620005e4565b919050565b600067ffffffffffffffff821115620006575762000656620005b5565b5b6200066282620005a4565b9050602081019050919050565b60005b838110156200068f57808201518184015260208101905062000672565b60008484015250505050565b6000620006b2620006ac8462000639565b6200061a565b905082815260208101848484011115620006d157620006d06200059f565b5b620006de8482856200066f565b509392505050565b600082601f830112620006fe57620006fd6200059a565b5b8151620007108482602086016200069b565b91505092915050565b60006bffffffffffffffffffffffff82169050919050565b6200073c8162000719565b81146200074857600080fd5b50565b6000815190506200075c8162000731565b92915050565b600080600080600080600060e0888a0312156200078457620007836200052b565b5b6000620007948a828b0162000583565b975050602088015167ffffffffffffffff811115620007b857620007b762000530565b5b620007c68a828b01620006e6565b965050604088015167ffffffffffffffff811115620007ea57620007e962000530565b5b620007f88a828b01620006e6565b955050606088015167ffffffffffffffff8111156200081c576200081b62000530565b5b6200082a8a828b01620006e6565b945050608088015167ffffffffffffffff8111156200084e576200084d62000530565b5b6200085c8a828b01620006e6565b93505060a06200086f8a828b0162000583565b92505060c0620008828a828b016200074b565b91505092959891949750929550565b600081519050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b60006002820490506001821680620008e457607f821691505b602082108103620008fa57620008f96200089c565b5b50919050565b60008190508160005260206000209050919050565b60006020601f8301049050919050565b600082821b905092915050565b600060088302620009647fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8262000925565b62000970868362000925565b95508019841693508086168417925050509392505050565b6000819050919050565b6000819050919050565b6000620009bd620009b7620009b18462000988565b62000992565b62000988565b9050919050565b6000819050919050565b620009d9836200099c565b620009f1620009e882620009c4565b84845462000932565b825550505050565b600090565b62000a08620009f9565b62000a15818484620009ce565b505050565b5b8181101562000a3d5762000a31600082620009fe565b60018101905062000a1b565b5050565b601f82111562000a8c5762000a568162000900565b62000a618462000915565b8101602085101562000a71578190505b62000a8962000a808562000915565b83018262000a1a565b50505b505050565b600082821c905092915050565b600062000ab16000198460080262000a91565b1980831691505092915050565b600062000acc838362000a9e565b9150826002028217905092915050565b62000ae78262000891565b67ffffffffffffffff81111562000b035762000b02620005b5565b5b62000b0f8254620008cb565b62000b1c82828562000a41565b600060209050601f83116001811462000b54576000841562000b3f578287015190505b62000b4b858262000abe565b86555062000bbb565b601f19841662000b648662000900565b60005b8281101562000b8e5784890151825560018201915060208501945060208101905062000b67565b8683101562000bae578489015162000baa601f89168262000a9e565b8355505b6001600288020188555050505b505050505050565b600082825260208201905092915050565b7f455243323938313a20726f79616c7479206665652077696c6c2065786365656460008201527f2073616c65507269636500000000000000000000000000000000000000000000602082015250565b600062000c32602a8362000bc3565b915062000c3f8262000bd4565b604082019050919050565b6000602082019050818103600083015262000c658162000c23565b9050919050565b7f455243323938313a20696e76616c696420726563656976657200000000000000600082015250565b600062000ca460198362000bc3565b915062000cb18262000c6c565b602082019050919050565b6000602082019050818103600083015262000cd78162000c95565b9050919050565b6153e68062000cee6000396000f3fe608060405234801561001057600080fd5b50600436106102275760003560e01c80636352211e1161013057806395d89b41116100b8578063ca15c8731161007c578063ca15c87314610697578063d5391393146106c7578063d547741f146106e5578063e8a3d48514610701578063e985e9c51461071f57610227565b806395d89b41146105f3578063a217fddf14610611578063a22cb4651461062f578063b88d4fde1461064b578063c87b56dd1461066757610227565b80636c0360eb116100ff5780636c0360eb1461052957806370a08231146105475780639010d07c1461057757806391d14854146105a7578063938e3d7b146105d757610227565b80636352211e146104a35780636588962a146104d357806369e2f0fb146104ef5780636b3a06321461050b57610227565b80632f745c59116101b357806340c10f191161018257806340c10f191461040357806342842e0e1461041f57806342966c681461043b5780634f6ccce71461045757806355f804b31461048757610227565b80632f745c591461037d57806331ae450b146103ad57806336568abe146103cb5780633dd1eb61146103e757610227565b806318160ddd116101fa57806318160ddd146102c657806323b872dd146102e4578063248a9ca3146103005780632a55205a146103305780632f2ff15d1461036157610227565b806301ffc9a71461022c57806306fdde031461025c578063081812fc1461027a578063095ea7b3146102aa575b600080fd5b61024660048036038101906102419190613a2e565b61074f565b6040516102539190613a76565b60405180910390f35b610264610761565b6040516102719190613b21565b60405180910390f35b610294600480360381019061028f9190613b79565b6107f3565b6040516102a19190613be7565b60405180910390f35b6102c460048036038101906102bf9190613c2e565b610839565b005b6102ce610847565b6040516102db9190613c7d565b60405180910390f35b6102fe60048036038101906102f99190613c98565b610854565b005b61031a60048036038101906103159190613d21565b6108b4565b6040516103279190613d5d565b60405180910390f35b61034a60048036038101906103459190613d78565b6108d4565b604051610358929190613db8565b60405180910390f35b61037b60048036038101906103769190613de1565b610abe565b005b61039760048036038101906103929190613c2e565b610adf565b6040516103a49190613c7d565b60405180910390f35b6103b5610b84565b6040516103c29190613edf565b60405180910390f35b6103e560048036038101906103e09190613de1565b610c64565b005b61040160048036038101906103fc9190613f01565b610ce7565b005b61041d60048036038101906104189190613c2e565b610d22565b005b61043960048036038101906104349190613c98565b610d7a565b005b61045560048036038101906104509190613b79565b610d9a565b005b610471600480360381019061046c9190613b79565b610df6565b60405161047e9190613c7d565b60405180910390f35b6104a1600480360381019061049c9190614063565b610e67565b005b6104bd60048036038101906104b89190613b79565b610e88565b6040516104ca9190613be7565b60405180910390f35b6104ed60048036038101906104e89190613f01565b610f0e565b005b61050960048036038101906105049190613f01565b611094565b005b6105136110cf565b604051610520919061410b565b60405180910390f35b6105316110f5565b60405161053e9190613b21565b60405180910390f35b610561600480360381019061055c9190613f01565b611183565b60405161056e9190613c7d565b60405180910390f35b610591600480360381019061058c9190614126565b61123a565b60405161059e9190613be7565b60405180910390f35b6105c160048036038101906105bc9190613de1565b611269565b6040516105ce9190613a76565b60405180910390f35b6105f160048036038101906105ec9190614063565b6112d4565b005b6105fb6112f5565b6040516106089190613b21565b60405180910390f35b610619611387565b6040516106269190613d5d565b60405180910390f35b61064960048036038101906106449190614192565b61138e565b005b61066560048036038101906106609190614273565b61139c565b005b610681600480360381019061067c9190613b79565b6113fe565b60405161068e9190613b21565b60405180910390f35b6106b160048036038101906106ac9190613d21565b611466565b6040516106be9190613c7d565b60405180910390f35b6106cf61148a565b6040516106dc9190613d5d565b60405180910390f35b6106ff60048036038101906106fa9190613de1565b6114ae565b005b6107096114cf565b6040516107169190613b21565b60405180910390f35b610739600480360381019061073491906142f6565b61155d565b6040516107469190613a76565b60405180910390f35b600061075a82611718565b9050919050565b60606000805461077090614365565b80601f016020809104026020016040519081016040528092919081815260200182805461079c90614365565b80156107e95780601f106107be576101008083540402835291602001916107e9565b820191906000526020600020905b8154815290600101906020018083116107cc57829003601f168201915b5050505050905090565b60006107fe82611792565b6004600083815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050919050565b61084382826117dd565b5050565b6000600b80549050905090565b61086561085f6117f4565b826117fc565b6108a4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161089b90614408565b60405180910390fd5b6108af838383611891565b505050565b600060066000838152602001908152602001600020600101549050919050565b6000806000600e60008681526020019081526020016000206040518060400160405290816000820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020016000820160149054906101000a90046bffffffffffffffffffffffff166bffffffffffffffffffffffff166bffffffffffffffffffffffff16815250509050600073ffffffffffffffffffffffffffffffffffffffff16816000015173ffffffffffffffffffffffffffffffffffffffff1603610a6957600d6040518060400160405290816000820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020016000820160149054906101000a90046bffffffffffffffffffffffff166bffffffffffffffffffffffff166bffffffffffffffffffffffff168152505090505b6000610a736118a1565b6bffffffffffffffffffffffff1682602001516bffffffffffffffffffffffff1686610a9f9190614457565b610aa991906144c8565b90508160000151819350935050509250929050565b610ac7826108b4565b610ad0816118ab565b610ada83836118bf565b505050565b6000610aea83611183565b8210610b2b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b229061456b565b60405180910390fd5b600960008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600083815260200190815260200160002054905092915050565b60606000610b946000801b611466565b905060008167ffffffffffffffff811115610bb257610bb1613f38565b5b604051908082528060200260200182016040528015610be05781602001602082028036833780820191505090505b50905060005b82811015610c5b57610bfb6000801b8261123a565b828281518110610c0e57610c0d61458b565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250508080610c53906145ba565b915050610be6565b50809250505090565b610c6c6117f4565b73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1614610cd9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610cd090614674565b60405180910390fd5b610ce382826118f3565b5050565b6000801b610cf4816118ab565b610d1e7f4d494e5445525f524f4c4500000000000000000000000000000000000000000083610abe565b5050565b7f4d494e5445525f524f4c45000000000000000000000000000000000000000000610d4c816118ab565b60005b82811015610d7457610d6084611927565b508080610d6c906145ba565b915050610d4f565b50505050565b610d958383836040518060200160405280600081525061139c565b505050565b610dab610da56117f4565b826117fc565b610dea576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610de190614408565b60405180910390fd5b610df381611953565b50565b6000610e00610847565b8210610e41576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e3890614706565b60405180910390fd5b600b8281548110610e5557610e5461458b565b5b90600052602060002001549050919050565b6000801b610e74816118ab565b8160109081610e8391906148c8565b505050565b600080610e9483611aa1565b9050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1603610f05576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610efc906149e6565b60405180910390fd5b80915050919050565b6000801b610f1b816118ab565b8173ffffffffffffffffffffffffffffffffffffffff166301ffc9a77f05a3b809000000000000000000000000000000000000000000000000000000006040518263ffffffff1660e01b8152600401610f749190614a15565b602060405180830381865afa158015610f91573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610fb59190614a45565b610ff4576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610feb90614ae4565b60405180910390fd5b7f4a1d010d926ae0d4294a4afe61ae81bb378335fbf671e099a7138b5afeefdf84600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1683604051611047929190614b04565b60405180910390a181600860006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505050565b6000801b6110a1816118ab565b6110cb7f4d494e5445525f524f4c45000000000000000000000000000000000000000000836114ae565b5050565b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6010805461110290614365565b80601f016020809104026020016040519081016040528092919081815260200182805461112e90614365565b801561117b5780601f106111505761010080835404028352916020019161117b565b820191906000526020600020905b81548152906001019060200180831161115e57829003601f168201915b505050505081565b60008073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16036111f3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111ea90614b9f565b60405180910390fd5b600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b60006112618260076000868152602001908152602001600020611ade90919063ffffffff16565b905092915050565b60006006600084815260200190815260200160002060000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16905092915050565b6000801b6112e1816118ab565b81600f90816112f091906148c8565b505050565b60606001805461130490614365565b80601f016020809104026020016040519081016040528092919081815260200182805461133090614365565b801561137d5780601f106113525761010080835404028352916020019161137d565b820191906000526020600020905b81548152906001019060200180831161136057829003601f168201915b5050505050905090565b6000801b81565b6113988282611af8565b5050565b6113ad6113a76117f4565b836117fc565b6113ec576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016113e390614408565b60405180910390fd5b6113f884848484611b0f565b50505050565b606061140982611792565b6000611413611b6b565b90506000815111611433576040518060200160405280600081525061145e565b8061143d84611bfd565b60405160200161144e929190614bfb565b6040516020818303038152906040525b915050919050565b600061148360076000848152602001908152602001600020611ccb565b9050919050565b7f4d494e5445525f524f4c4500000000000000000000000000000000000000000081565b6114b7826108b4565b6114c0816118ab565b6114ca83836118f3565b505050565b600f80546114dc90614365565b80601f016020809104026020016040519081016040528092919081815260200182805461150890614365565b80156115555780601f1061152a57610100808354040283529160200191611555565b820191906000526020600020905b81548152906001019060200180831161153857829003601f168201915b505050505081565b6000600560008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16905092915050565b6001816000016000828254019250508190555050565b6116118282611269565b6116e45760016006600084815260200190815260200160002060000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055506116896117f4565b73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45b5050565b6000611710836000018373ffffffffffffffffffffffffffffffffffffffff1660001b611ce0565b905092915050565b60007f2a55205a000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916148061178b575061178a82611d50565b5b9050919050565b61179b81611dca565b6117da576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016117d1906149e6565b60405180910390fd5b50565b6117e682611e0b565b6117f08282611f64565b5050565b600033905090565b60008061180883610e88565b90508073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16148061184a5750611849818561155d565b5b8061188857508373ffffffffffffffffffffffffffffffffffffffff16611870846107f3565b73ffffffffffffffffffffffffffffffffffffffff16145b91505092915050565b61189c83838361207b565b505050565b6000612710905090565b6118bc816118b76117f4565b612093565b50565b6118c98282611607565b6118ee81600760008581526020019081526020016000206116e890919063ffffffff16565b505050565b6118fd8282612118565b61192281600760008581526020019081526020016000206121fa90919063ffffffff16565b505050565b600080611934601161222a565b90506119408382612238565b61194a60116115f1565b80915050919050565b600061195e82610e88565b905061196e816000846001612455565b61197782610e88565b90506004600083815260200190815260200160002060006101000a81549073ffffffffffffffffffffffffffffffffffffffff02191690556001600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825403925050819055506002600083815260200190815260200160002060006101000a81549073ffffffffffffffffffffffffffffffffffffffff021916905581600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a4611a9d816000846001612467565b5050565b60006002600083815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050919050565b6000611aed836000018361246d565b60001c905092915050565b611b0182611e0b565b611b0b8282612498565b5050565b611b1a848484611891565b611b26848484846124ae565b611b65576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611b5c90614c91565b60405180910390fd5b50505050565b606060108054611b7a90614365565b80601f0160208091040260200160405190810160405280929190818152602001828054611ba690614365565b8015611bf35780601f10611bc857610100808354040283529160200191611bf3565b820191906000526020600020905b815481529060010190602001808311611bd657829003601f168201915b5050505050905090565b606060006001611c0c84612635565b01905060008167ffffffffffffffff811115611c2b57611c2a613f38565b5b6040519080825280601f01601f191660200182016040528015611c5d5781602001600182028036833780820191505090505b509050600082602001820190505b600115611cc0578080600190039150507f3031323334353637383961626364656600000000000000000000000000000000600a86061a8153600a8581611cb457611cb3614499565b5b04945060008503611c6b575b819350505050919050565b6000611cd982600001612788565b9050919050565b6000611cec8383612799565b611d45578260000182908060018154018082558091505060019003906000526020600020016000909190919091505582600001805490508360010160008481526020019081526020016000208190555060019050611d4a565b600090505b92915050565b60007f780e9d63000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19161480611dc35750611dc2826127bc565b5b9050919050565b60008073ffffffffffffffffffffffffffffffffffffffff16611dec83611aa1565b73ffffffffffffffffffffffffffffffffffffffff1614159050919050565b600073ffffffffffffffffffffffffffffffffffffffff16600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611f605760008173ffffffffffffffffffffffffffffffffffffffff163b1480611f1f5750600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166305a3b809826040518263ffffffff1660e01b8152600401611edd9190613be7565b602060405180830381865afa158015611efa573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611f1e9190614a45565b5b611f6157806040517f8371ab02000000000000000000000000000000000000000000000000000000008152600401611f579190613be7565b60405180910390fd5b5b50565b6000611f6f82610e88565b90508073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1603611fdf576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611fd690614d23565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff16611ffe6117f4565b73ffffffffffffffffffffffffffffffffffffffff16148061202d575061202c816120276117f4565b61155d565b5b61206c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161206390614db5565b60405180910390fd5b61207683836127ce565b505050565b612083612887565b61208e8383836129f3565b505050565b61209d8282611269565b612114576120aa81612cec565b6120b88360001c6020612d19565b6040516020016120c9929190614e6d565b6040516020818303038152906040526040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161210b9190613b21565b60405180910390fd5b5050565b6121228282611269565b156121f65760006006600084815260200190815260200160002060000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555061219b6117f4565b73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16837ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b60405160405180910390a45b5050565b6000612222836000018373ffffffffffffffffffffffffffffffffffffffff1660001b612f55565b905092915050565b600081600001549050919050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16036122a7576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161229e90614ef3565b60405180910390fd5b6122b081611dca565b156122f0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016122e790614f5f565b60405180910390fd5b6122fe600083836001612455565b61230781611dca565b15612347576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161233e90614f5f565b60405180910390fd5b6001600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540192505081905550816002600083815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550808273ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a4612451600083836001612467565b5050565b61246184848484613069565b50505050565b50505050565b60008260000182815481106124855761248461458b565b5b9060005260206000200154905092915050565b6124aa6124a36117f4565b83836131c7565b5050565b60006124cf8473ffffffffffffffffffffffffffffffffffffffff16613333565b15612628578373ffffffffffffffffffffffffffffffffffffffff1663150b7a026124f86117f4565b8786866040518563ffffffff1660e01b815260040161251a9493929190614fd4565b6020604051808303816000875af192505050801561255657506040513d601f19601f820116820180604052508101906125539190615035565b60015b6125d8573d8060008114612586576040519150601f19603f3d011682016040523d82523d6000602084013e61258b565b606091505b5060008151036125d0576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016125c790614c91565b60405180910390fd5b805181602001fd5b63150b7a0260e01b7bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916817bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19161491505061262d565b600190505b949350505050565b600080600090507a184f03e93ff9f4daa797ed6e38ed64bf6a1f0100000000000000008310612693577a184f03e93ff9f4daa797ed6e38ed64bf6a1f010000000000000000838161268957612688614499565b5b0492506040810190505b6d04ee2d6d415b85acef810000000083106126d0576d04ee2d6d415b85acef810000000083816126c6576126c5614499565b5b0492506020810190505b662386f26fc1000083106126ff57662386f26fc1000083816126f5576126f4614499565b5b0492506010810190505b6305f5e1008310612728576305f5e100838161271e5761271d614499565b5b0492506008810190505b612710831061274d57612710838161274357612742614499565b5b0492506004810190505b60648310612770576064838161276657612765614499565b5b0492506002810190505b600a831061277f576001810190505b80915050919050565b600081600001805490509050919050565b600080836001016000848152602001908152602001600020541415905092915050565b60006127c782613356565b9050919050565b816004600083815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550808273ffffffffffffffffffffffffffffffffffffffff1661284183610e88565b73ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92560405160405180910390a45050565b600073ffffffffffffffffffffffffffffffffffffffff16600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146129f0573273ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614806129af5750600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166305a3b809336040518263ffffffff1660e01b815260040161296d9190613be7565b602060405180830381865afa15801561298a573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906129ae9190614a45565b5b6129f157336040517f937db65f0000000000000000000000000000000000000000000000000000000081526004016129e79190613be7565b60405180910390fd5b5b565b8273ffffffffffffffffffffffffffffffffffffffff16612a1382610e88565b73ffffffffffffffffffffffffffffffffffffffff1614612a69576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612a60906150d4565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1603612ad8576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612acf90615166565b60405180910390fd5b612ae58383836001612455565b8273ffffffffffffffffffffffffffffffffffffffff16612b0582610e88565b73ffffffffffffffffffffffffffffffffffffffff1614612b5b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612b52906150d4565b60405180910390fd5b6004600082815260200190815260200160002060006101000a81549073ffffffffffffffffffffffffffffffffffffffff02191690556001600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825403925050819055506001600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282540192505081905550816002600083815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550808273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60405160405180910390a4612ce78383836001612467565b505050565b6060612d128273ffffffffffffffffffffffffffffffffffffffff16601460ff16612d19565b9050919050565b606060006002836002612d2c9190614457565b612d369190615186565b67ffffffffffffffff811115612d4f57612d4e613f38565b5b6040519080825280601f01601f191660200182016040528015612d815781602001600182028036833780820191505090505b5090507f300000000000000000000000000000000000000000000000000000000000000081600081518110612db957612db861458b565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053507f780000000000000000000000000000000000000000000000000000000000000081600181518110612e1d57612e1c61458b565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a90535060006001846002612e5d9190614457565b612e679190615186565b90505b6001811115612f07577f3031323334353637383961626364656600000000000000000000000000000000600f861660108110612ea957612ea861458b565b5b1a60f81b828281518110612ec057612ebf61458b565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350600485901c945080612f00906151ba565b9050612e6a565b5060008414612f4b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612f429061522f565b60405180910390fd5b8091505092915050565b6000808360010160008481526020019081526020016000205490506000811461305d576000600182612f87919061524f565b9050600060018660000180549050612f9f919061524f565b905081811461300e576000866000018281548110612fc057612fbf61458b565b5b9060005260206000200154905080876000018481548110612fe457612fe361458b565b5b90600052602060002001819055508387600101600083815260200190815260200160002081905550505b8560000180548061302257613021615283565b5b600190038181906000526020600020016000905590558560010160008681526020019081526020016000206000905560019350505050613063565b60009150505b92915050565b613075848484846133d0565b60018111156130b9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016130b090615324565b60405180910390fd5b6000829050600073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff1603613100576130fb816134f6565b61313f565b8373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff161461313e5761313d858261353f565b5b5b600073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16036131815761317c816136ac565b6131c0565b8473ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16146131bf576131be848261377d565b5b5b5050505050565b8173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1603613235576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161322c90615390565b60405180910390fd5b80600560008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c31836040516133269190613a76565b60405180910390a3505050565b6000808273ffffffffffffffffffffffffffffffffffffffff163b119050919050565b60007f5a05180f000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff191614806133c957506133c8826137fc565b5b9050919050565b60018111156134f057600073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16146134645780600360008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825461345c919061524f565b925050819055505b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16146134ef5780600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008282546134e79190615186565b925050819055505b5b50505050565b600b80549050600c600083815260200190815260200160002081905550600b81908060018154018082558091505060019003906000526020600020016000909190919091505550565b6000600161354c84611183565b613556919061524f565b90506000600a600084815260200190815260200160002054905081811461363b576000600960008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600084815260200190815260200160002054905080600960008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008481526020019081526020016000208190555081600a600083815260200190815260200160002081905550505b600a600084815260200190815260200160002060009055600960008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008381526020019081526020016000206000905550505050565b60006001600b805490506136c0919061524f565b90506000600c60008481526020019081526020016000205490506000600b83815481106136f0576136ef61458b565b5b9060005260206000200154905080600b83815481106137125761371161458b565b5b906000526020600020018190555081600c600083815260200190815260200160002081905550600c600085815260200190815260200160002060009055600b80548061376157613760615283565b5b6001900381819060005260206000200160009055905550505050565b600061378883611183565b905081600960008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008381526020019081526020016000208190555080600a600084815260200190815260200160002081905550505050565b60007f7965db0b000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916148061386f575061386e82613876565b5b9050919050565b60007f80ac58cd000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916148061394157507f5b5e139f000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916145b80613951575061395082613958565b5b9050919050565b60007f01ffc9a7000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916149050919050565b6000604051905090565b600080fd5b600080fd5b60007fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b613a0b816139d6565b8114613a1657600080fd5b50565b600081359050613a2881613a02565b92915050565b600060208284031215613a4457613a436139cc565b5b6000613a5284828501613a19565b91505092915050565b60008115159050919050565b613a7081613a5b565b82525050565b6000602082019050613a8b6000830184613a67565b92915050565b600081519050919050565b600082825260208201905092915050565b60005b83811015613acb578082015181840152602081019050613ab0565b60008484015250505050565b6000601f19601f8301169050919050565b6000613af382613a91565b613afd8185613a9c565b9350613b0d818560208601613aad565b613b1681613ad7565b840191505092915050565b60006020820190508181036000830152613b3b8184613ae8565b905092915050565b6000819050919050565b613b5681613b43565b8114613b6157600080fd5b50565b600081359050613b7381613b4d565b92915050565b600060208284031215613b8f57613b8e6139cc565b5b6000613b9d84828501613b64565b91505092915050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000613bd182613ba6565b9050919050565b613be181613bc6565b82525050565b6000602082019050613bfc6000830184613bd8565b92915050565b613c0b81613bc6565b8114613c1657600080fd5b50565b600081359050613c2881613c02565b92915050565b60008060408385031215613c4557613c446139cc565b5b6000613c5385828601613c19565b9250506020613c6485828601613b64565b9150509250929050565b613c7781613b43565b82525050565b6000602082019050613c926000830184613c6e565b92915050565b600080600060608486031215613cb157613cb06139cc565b5b6000613cbf86828701613c19565b9350506020613cd086828701613c19565b9250506040613ce186828701613b64565b9150509250925092565b6000819050919050565b613cfe81613ceb565b8114613d0957600080fd5b50565b600081359050613d1b81613cf5565b92915050565b600060208284031215613d3757613d366139cc565b5b6000613d4584828501613d0c565b91505092915050565b613d5781613ceb565b82525050565b6000602082019050613d726000830184613d4e565b92915050565b60008060408385031215613d8f57613d8e6139cc565b5b6000613d9d85828601613b64565b9250506020613dae85828601613b64565b9150509250929050565b6000604082019050613dcd6000830185613bd8565b613dda6020830184613c6e565b9392505050565b60008060408385031215613df857613df76139cc565b5b6000613e0685828601613d0c565b9250506020613e1785828601613c19565b9150509250929050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b613e5681613bc6565b82525050565b6000613e688383613e4d565b60208301905092915050565b6000602082019050919050565b6000613e8c82613e21565b613e968185613e2c565b9350613ea183613e3d565b8060005b83811015613ed2578151613eb98882613e5c565b9750613ec483613e74565b925050600181019050613ea5565b5085935050505092915050565b60006020820190508181036000830152613ef98184613e81565b905092915050565b600060208284031215613f1757613f166139cc565b5b6000613f2584828501613c19565b91505092915050565b600080fd5b600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b613f7082613ad7565b810181811067ffffffffffffffff82111715613f8f57613f8e613f38565b5b80604052505050565b6000613fa26139c2565b9050613fae8282613f67565b919050565b600067ffffffffffffffff821115613fce57613fcd613f38565b5b613fd782613ad7565b9050602081019050919050565b82818337600083830152505050565b600061400661400184613fb3565b613f98565b90508281526020810184848401111561402257614021613f33565b5b61402d848285613fe4565b509392505050565b600082601f83011261404a57614049613f2e565b5b813561405a848260208601613ff3565b91505092915050565b600060208284031215614079576140786139cc565b5b600082013567ffffffffffffffff811115614097576140966139d1565b5b6140a384828501614035565b91505092915050565b6000819050919050565b60006140d16140cc6140c784613ba6565b6140ac565b613ba6565b9050919050565b60006140e3826140b6565b9050919050565b60006140f5826140d8565b9050919050565b614105816140ea565b82525050565b600060208201905061412060008301846140fc565b92915050565b6000806040838503121561413d5761413c6139cc565b5b600061414b85828601613d0c565b925050602061415c85828601613b64565b9150509250929050565b61416f81613a5b565b811461417a57600080fd5b50565b60008135905061418c81614166565b92915050565b600080604083850312156141a9576141a86139cc565b5b60006141b785828601613c19565b92505060206141c88582860161417d565b9150509250929050565b600067ffffffffffffffff8211156141ed576141ec613f38565b5b6141f682613ad7565b9050602081019050919050565b6000614216614211846141d2565b613f98565b90508281526020810184848401111561423257614231613f33565b5b61423d848285613fe4565b509392505050565b600082601f83011261425a57614259613f2e565b5b813561426a848260208601614203565b91505092915050565b6000806000806080858703121561428d5761428c6139cc565b5b600061429b87828801613c19565b94505060206142ac87828801613c19565b93505060406142bd87828801613b64565b925050606085013567ffffffffffffffff8111156142de576142dd6139d1565b5b6142ea87828801614245565b91505092959194509250565b6000806040838503121561430d5761430c6139cc565b5b600061431b85828601613c19565b925050602061432c85828601613c19565b9150509250929050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b6000600282049050600182168061437d57607f821691505b6020821081036143905761438f614336565b5b50919050565b7f4552433732313a2063616c6c6572206973206e6f7420746f6b656e206f776e6560008201527f72206f7220617070726f76656400000000000000000000000000000000000000602082015250565b60006143f2602d83613a9c565b91506143fd82614396565b604082019050919050565b60006020820190508181036000830152614421816143e5565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b600061446282613b43565b915061446d83613b43565b925082820261447b81613b43565b9150828204841483151761449257614491614428565b5b5092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b60006144d382613b43565b91506144de83613b43565b9250826144ee576144ed614499565b5b828204905092915050565b7f455243373231456e756d657261626c653a206f776e657220696e646578206f7560008201527f74206f6620626f756e6473000000000000000000000000000000000000000000602082015250565b6000614555602b83613a9c565b9150614560826144f9565b604082019050919050565b6000602082019050818103600083015261458481614548565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60006145c582613b43565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82036145f7576145f6614428565b5b600182019050919050565b7f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560008201527f20726f6c657320666f722073656c660000000000000000000000000000000000602082015250565b600061465e602f83613a9c565b915061466982614602565b604082019050919050565b6000602082019050818103600083015261468d81614651565b9050919050565b7f455243373231456e756d657261626c653a20676c6f62616c20696e646578206f60008201527f7574206f6620626f756e64730000000000000000000000000000000000000000602082015250565b60006146f0602c83613a9c565b91506146fb82614694565b604082019050919050565b6000602082019050818103600083015261471f816146e3565b9050919050565b60008190508160005260206000209050919050565b60006020601f8301049050919050565b600082821b905092915050565b6000600883026147887fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8261474b565b614792868361474b565b95508019841693508086168417925050509392505050565b60006147c56147c06147bb84613b43565b6140ac565b613b43565b9050919050565b6000819050919050565b6147df836147aa565b6147f36147eb826147cc565b848454614758565b825550505050565b600090565b6148086147fb565b6148138184846147d6565b505050565b5b818110156148375761482c600082614800565b600181019050614819565b5050565b601f82111561487c5761484d81614726565b6148568461473b565b81016020851015614865578190505b6148796148718561473b565b830182614818565b50505b505050565b600082821c905092915050565b600061489f60001984600802614881565b1980831691505092915050565b60006148b8838361488e565b9150826002028217905092915050565b6148d182613a91565b67ffffffffffffffff8111156148ea576148e9613f38565b5b6148f48254614365565b6148ff82828561483b565b600060209050601f8311600181146149325760008415614920578287015190505b61492a85826148ac565b865550614992565b601f19841661494086614726565b60005b8281101561496857848901518255600182019150602085019450602081019050614943565b868310156149855784890151614981601f89168261488e565b8355505b6001600288020188555050505b505050505050565b7f4552433732313a20696e76616c696420746f6b656e2049440000000000000000600082015250565b60006149d0601883613a9c565b91506149db8261499a565b602082019050919050565b600060208201905081810360008301526149ff816149c3565b9050919050565b614a0f816139d6565b82525050565b6000602082019050614a2a6000830184614a06565b92915050565b600081519050614a3f81614166565b92915050565b600060208284031215614a5b57614a5a6139cc565b5b6000614a6984828501614a30565b91505092915050565b7f636f6e747261637420646f6573206e6f7420696d706c656d656e742049526f7960008201527f616c7479416c6c6f776c69737400000000000000000000000000000000000000602082015250565b6000614ace602d83613a9c565b9150614ad982614a72565b604082019050919050565b60006020820190508181036000830152614afd81614ac1565b9050919050565b6000604082019050614b196000830185613bd8565b614b266020830184613bd8565b9392505050565b7f4552433732313a2061646472657373207a65726f206973206e6f74206120766160008201527f6c6964206f776e65720000000000000000000000000000000000000000000000602082015250565b6000614b89602983613a9c565b9150614b9482614b2d565b604082019050919050565b60006020820190508181036000830152614bb881614b7c565b9050919050565b600081905092915050565b6000614bd582613a91565b614bdf8185614bbf565b9350614bef818560208601613aad565b80840191505092915050565b6000614c078285614bca565b9150614c138284614bca565b91508190509392505050565b7f4552433732313a207472616e7366657220746f206e6f6e20455243373231526560008201527f63656976657220696d706c656d656e7465720000000000000000000000000000602082015250565b6000614c7b603283613a9c565b9150614c8682614c1f565b604082019050919050565b60006020820190508181036000830152614caa81614c6e565b9050919050565b7f4552433732313a20617070726f76616c20746f2063757272656e74206f776e6560008201527f7200000000000000000000000000000000000000000000000000000000000000602082015250565b6000614d0d602183613a9c565b9150614d1882614cb1565b604082019050919050565b60006020820190508181036000830152614d3c81614d00565b9050919050565b7f4552433732313a20617070726f76652063616c6c6572206973206e6f7420746f60008201527f6b656e206f776e6572206f7220617070726f76656420666f7220616c6c000000602082015250565b6000614d9f603d83613a9c565b9150614daa82614d43565b604082019050919050565b60006020820190508181036000830152614dce81614d92565b9050919050565b7f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000600082015250565b6000614e0b601783614bbf565b9150614e1682614dd5565b601782019050919050565b7f206973206d697373696e6720726f6c6520000000000000000000000000000000600082015250565b6000614e57601183614bbf565b9150614e6282614e21565b601182019050919050565b6000614e7882614dfe565b9150614e848285614bca565b9150614e8f82614e4a565b9150614e9b8284614bca565b91508190509392505050565b7f4552433732313a206d696e7420746f20746865207a65726f2061646472657373600082015250565b6000614edd602083613a9c565b9150614ee882614ea7565b602082019050919050565b60006020820190508181036000830152614f0c81614ed0565b9050919050565b7f4552433732313a20746f6b656e20616c7265616479206d696e74656400000000600082015250565b6000614f49601c83613a9c565b9150614f5482614f13565b602082019050919050565b60006020820190508181036000830152614f7881614f3c565b9050919050565b600081519050919050565b600082825260208201905092915050565b6000614fa682614f7f565b614fb08185614f8a565b9350614fc0818560208601613aad565b614fc981613ad7565b840191505092915050565b6000608082019050614fe96000830187613bd8565b614ff66020830186613bd8565b6150036040830185613c6e565b81810360608301526150158184614f9b565b905095945050505050565b60008151905061502f81613a02565b92915050565b60006020828403121561504b5761504a6139cc565b5b600061505984828501615020565b91505092915050565b7f4552433732313a207472616e736665722066726f6d20696e636f72726563742060008201527f6f776e6572000000000000000000000000000000000000000000000000000000602082015250565b60006150be602583613a9c565b91506150c982615062565b604082019050919050565b600060208201905081810360008301526150ed816150b1565b9050919050565b7f4552433732313a207472616e7366657220746f20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b6000615150602483613a9c565b915061515b826150f4565b604082019050919050565b6000602082019050818103600083015261517f81615143565b9050919050565b600061519182613b43565b915061519c83613b43565b92508282019050808211156151b4576151b3614428565b5b92915050565b60006151c582613b43565b9150600082036151d8576151d7614428565b5b600182039050919050565b7f537472696e67733a20686578206c656e67746820696e73756666696369656e74600082015250565b6000615219602083613a9c565b9150615224826151e3565b602082019050919050565b600060208201905081810360008301526152488161520c565b9050919050565b600061525a82613b43565b915061526583613b43565b925082820390508181111561527d5761527c614428565b5b92915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603160045260246000fd5b7f455243373231456e756d657261626c653a20636f6e736563757469766520747260008201527f616e7366657273206e6f7420737570706f727465640000000000000000000000602082015250565b600061530e603583613a9c565b9150615319826152b2565b604082019050919050565b6000602082019050818103600083015261533d81615301565b9050919050565b7f4552433732313a20617070726f766520746f2063616c6c657200000000000000600082015250565b600061537a601983613a9c565b915061538582615344565b602082019050919050565b600060208201905081810360008301526153a98161536d565b905091905056fea2646970667358221220f2de678fa1f1a3fc28d8056ba46769331f91c7536f9259f07a82f3f97942823964736f6c63430008110033";class O3 extends vd{constructor(...e){e.length>1?super(...e):super(S3,k3,e[0])}deploy(e,t,r,n,i,a,o,s){return super.deploy(e,t,r,n,i,a,o,s||{})}getDeployTransaction(e,t,r,n,i,a,o,s){return super.getDeployTransaction(e,t,r,n,i,a,o,s||{})}attach(e){return super.attach(e)}connect(e){return super.connect(e)}static bytecode=k3;static abi=S3;static createInterface(){return new Bu(S3)}static connect(e,t){return new gd(e,S3,t)}}e.APIError=Zr,e.BlockchainData=class{config;activities;chains;collections;nfts;nftOwners;tokens;constructor(e){this.config=new nn(e),this.activities=new mt.ActivitiesApi(this.config.apiConfig),this.chains=new mt.ChainsApi(this.config.apiConfig),this.collections=new mt.CollectionsApi(this.config.apiConfig),this.nfts=new mt.NftsApi(this.config.apiConfig),this.nftOwners=new mt.NftOwnersApi(this.config.apiConfig),this.tokens=new mt.TokensApi(this.config.apiConfig)}async listActivities(e){return await this.activities.listActivities(e).then((e=>e.data)).catch((e=>{throw an(e)}))}async getActivity(e){return await this.activities.getActivity(e).then((e=>e.data)).catch((e=>{throw an(e)}))}async listChains(e){return await this.chains.listChains(e).then((e=>e.data)).catch((e=>{throw an(e)}))}async listCollections(e){return await this.collections.listCollections(e).then((e=>e.data)).catch((e=>{throw an(e)}))}async getCollection(e){return await this.collections.getCollection(e).then((e=>e.data)).catch((e=>{throw an(e)}))}async getNFT(e){return await this.nfts.getNFT(e).then((e=>e.data)).catch((e=>{throw an(e)}))}async listNFTs(e){return await this.nfts.listNFTs(e).then((e=>e.data)).catch((e=>{throw an(e)}))}async listNFTsByAccountAddress(e){return await this.nfts.listNFTsByAccountAddress(e).then((e=>e.data)).catch((e=>{throw an(e)}))}async listNFTOwners(e){return await this.nftOwners.listNFTOwners(e).then((e=>e.data)).catch((e=>{throw an(e)}))}async listTokens(e){return await this.tokens.listERC20Tokens(e).then((e=>e.data)).catch((e=>{throw an(e)}))}async getToken(e){return await this.tokens.getERC20Token(e).then((e=>e.data)).catch((e=>{throw an(e)}))}},e.BridgeReact=g3,e.CHECKOUT_API_BASE_URL=b2,e.Checkout=class{config;readOnlyProviders;constructor(e=K2){this.config=new z2(e),this.readOnlyProviders=new Map}async createProvider(e){return await N2(e.walletProvider)}async checkIsWalletConnected(t){return async function(t){if(!t?.provider?.request)throw new T2("Check wallet connection request failed",e.CheckoutErrorType.PROVIDER_REQUEST_FAILED_ERROR,{rpcMethod:p2.CHECK_CONNECTION});let r=[];try{r=await t.provider.request({method:p2.CHECK_CONNECTION,params:[]})}catch(t){throw new T2("Check wallet connection request failed",e.CheckoutErrorType.PROVIDER_REQUEST_FAILED_ERROR,{rpcMethod:p2.CHECK_CONNECTION})}return{isConnected:r&&r.length>0,walletAddress:r[0]??""}}(await M2(this.config,t.provider,{allowUnsupportedProvider:!0}))}async connect(t){const r=await M2(this.config,t.provider,{allowUnsupportedProvider:!0});await async function(t){return await A2((async()=>{if(!t||!t?.provider?.request)throw new T2("Incompatible provider",e.CheckoutErrorType.PROVIDER_REQUEST_MISSING_ERROR,{details:"Attempting to connect with an incompatible provider"});await t.provider.request({method:p2.CONNECT,params:[]})}),{type:e.CheckoutErrorType.USER_REJECTED_REQUEST_ERROR}),t}(r);return{provider:r,network:await O2(this.config,r)}}async switchNetwork(e){const t=await M2(this.config,e.provider,{allowUnsupportedProvider:!0,allowMistmatchedChainId:!0});return await R2(this.config,t,e.chainId)}async getBalance(e){const t=await M2(this.config,e.provider);return e.contractAddress&&""!==e.contractAddress?await C2(t,e.walletAddress,e.contractAddress):await I2(this.config,t,e.walletAddress)}async getAllBalances(t){const r=await M2(this.config,t.provider);return(async(t,r,n,i)=>{const a=await x2(t,{type:e.TokenFilterTypes.ALL,chainId:i}),o=[];return o.push(I2(t,r,n)),a.tokens.filter((e=>e.address)).forEach((e=>o.push(C2(r,n,e.address??"")))),{balances:(await Promise.allSettled(o)).filter((e=>"fulfilled"===e.status)).map((e=>e.value))}})(this.config,r,t.walletAddress,t.chainId)}async getNetworkAllowList(e){return await k2(this.config,e)}async getTokenAllowList(e){return await x2(this.config,e)}async getWalletAllowList(t){return await async function(t){const r=[],n=t.exclude?.map((e=>e.walletProvider))??[];let i=Object.values(e.WalletProviderName);0!==n.length&&(i=i.filter((e=>!n.includes(e))));for(const e of i)r.push({walletProvider:e,name:e});return{wallets:r}}(t)}async sendTransaction(t){const r=await M2(this.config,t.provider);return await(async(t,r)=>{try{return{transactionResponse:await t.getSigner().sendTransaction(r)}}catch(t){if(t.code===Py.errors.INSUFFICIENT_FUNDS)throw new T2(t.message,e.CheckoutErrorType.INSUFFICIENT_FUNDS);if(t.code===Py.errors.ACTION_REJECTED)throw new T2(t.message,e.CheckoutErrorType.USER_REJECTED_REQUEST_ERROR);if(t.code===Py.errors.UNPREDICTABLE_GAS_LIMIT)throw new T2(t.message,e.CheckoutErrorType.UNPREDICTABLE_GAS_LIMIT);throw new T2(t.message,e.CheckoutErrorType.TRANSACTION_FAILED)}})(r,t.transaction)}async getNetworkInfo(e){const t=await M2(this.config,e.provider,{allowUnsupportedProvider:!0,allowMistmatchedChainId:!0});return await O2(this.config,t)}static isWeb3Provider(e){return P2(e)}async gasEstimate(t){return this.readOnlyProviders=await async function(t,r){if(t.isProduction&&r?.has(e.ChainId.ETHEREUM))return r;if(r?.has(e.ChainId.SEPOLIA))return r;const n=new Map;return(await k2(t,{type:e.NetworkFilterTypes.ALL})).networks.forEach((e=>{const r=t.networkMap.get(e.chainId)?.rpcUrls[0],i=new om(r);n.set(e.chainId,i)})),n}(this.config,this.readOnlyProviders),await async function(t,r,n){switch(t.gasEstimateType){case e.GasEstimateType.BRIDGE_TO_L2:return await G2(r,n,t.isSpendingCapApprovalRequired,t.tokenAddress);case e.GasEstimateType.SWAP:return await W2(n);default:throw new T2("Invalid type provided for gasEstimateType",e.CheckoutErrorType.INVALID_GAS_ESTIMATE_TYPE)}}(t,this.readOnlyProviders,this.config)}},e.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"),r=function(e){const t=s3();if(void 0===e)return t;if(void 0===e.major||void 0===e.minor||void 0===e.patch||void 0===e.prerelease)return t;if(e.major<0)return t;if(e.minor<0)return t;if(e.patch<0)return t;if("alpha"!==e.prerelease)return t;if(0===e.major&&0===e.minor&&0===e.patch)return t;let r=t;return!Number.isNaN(e.major)&&e.major>=0&&(r=e.major.toString()),Number.isNaN(e.minor)||(r+=`.${e.minor.toString()}`),Number.isNaN(e.patch)||(r+=`.${e.patch.toString()}`),r+=`-${e.prerelease}`,void 0!==e.build&&e.build>0&&(r+=`.${e.build}`),r}(e?.version);let n=`https://cdn.jsdelivr.net/npm/@imtbl/sdk@${r}/dist/browser/checkout.js`;t.setAttribute("src",n),document.head.appendChild(t),window.ImtblCheckoutWidgetConfig=JSON.stringify(e)},e.ConnectReact=v3,e.ERC20=class{contract;constructor(e){const t=new A3;this.contract=t.attach(e)}async totalSupply(e,t={}){return this.contract.connect(e).totalSupply(t)}async balanceOf(e,t,r={}){return this.contract.connect(e).balanceOf(t,r)}async allowance(e,t,r,n={}){return this.contract.connect(e).allowance(t,r,n)}async populateTransfer(e,t,r){return this.contract.populateTransaction.transfer(e,t,r)}async populateApprove(e,t,r={}){return this.contract.populateTransaction.approve(e,t,r)}async populateTransferFrom(e,t,r,n={}){return this.contract.populateTransaction.transferFrom(e,t,r,n)}},e.ERC721PermissionedMintable=class{contract;constructor(e){const t=new O3;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,r={}){return await this.contract.connect(e).balanceOf(t,r)}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,r={}){return await this.contract.connect(e).getApproved(t,r)}async getRoleAdmin(e,t,r={}){return await this.contract.connect(e).getRoleAdmin(t,r)}async getRoleMember(e,t,r,n={}){return await this.contract.connect(e).getRoleMember(t,r,n)}async getRoleMemberCount(e,t,r={}){return await this.contract.connect(e).getRoleMemberCount(t,r)}async hasRole(e,t,r,n={}){return await this.contract.connect(e).hasRole(t,r,n)}async isApprovedForAll(e,t,r,n={}){return await this.contract.connect(e).isApprovedForAll(t,r,n)}async name(e,t={}){return await this.contract.connect(e).name(t)}async ownerOf(e,t,r={}){return await this.contract.connect(e).ownerOf(t,r)}async royaltyAllowlist(e,t={}){return await this.contract.connect(e).royaltyAllowlist(t)}async royaltyInfo(e,t,r,n={}){return await this.contract.connect(e).royaltyInfo(t,r,n)}async symbol(e,t={}){return await this.contract.connect(e).symbol(t)}async tokenByIndex(e,t,r={}){return await this.contract.connect(e).tokenByIndex(t,r)}async tokenOfOwnerByIndex(e,t,r,n={}){return await this.contract.connect(e).tokenOfOwnerByIndex(t,r,n)}async tokenURI(e,t,r={}){return await this.contract.connect(e).tokenURI(t,r)}async totalSupply(e,t={}){return await this.contract.connect(e).totalSupply(t)}async populateApprove(e,t,r={}){return await this.contract.populateTransaction.approve(e,t,r)}async populateBurn(e,t={}){return await this.contract.populateTransaction.burn(e,t)}async populateGrantMinterRole(e,t={}){return await this.contract.populateTransaction.grantMinterRole(e,t)}async populateGrantRole(e,t,r={}){return await this.contract.populateTransaction.grantRole(e,t,r)}async populateMint(e,t,r={}){return await this.contract.populateTransaction.mint(e,t,r)}async populateRenounceRole(e,t,r={}){return await this.contract.populateTransaction.renounceRole(e,t,r)}async populateRevokeMinterRole(e,t={}){return await this.contract.populateTransaction.revokeMinterRole(e,t)}async populateRevokeRole(e,t,r={}){return await this.contract.populateTransaction.revokeRole(e,t,r)}async"populateSafeTransferFrom(address,address,uint256)"(e,t,r,n={}){return await this.contract.populateTransaction["safeTransferFrom(address,address,uint256)"](e,t,r,n)}async"populateSafeTransferFrom(address,address,uint256,bytes)"(e,t,r,n,i={}){return await this.contract.populateTransaction["safeTransferFrom(address,address,uint256,bytes)"](e,t,r,n,i)}async populateSetApprovalForAll(e,t,r={}){return await this.contract.populateTransaction.setApprovalForAll(e,t,r)}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 populateSetRoyaltyAllowlistRegistry(e,t={}){return await this.contract.populateTransaction.setRoyaltyAllowlistRegistry(e,t)}},e.GenericIMXProvider=rX,e.ImmutableConfiguration=t,e.ImmutableXClient=jB,e.JsonRpcError=Wz,e.MetaMaskIMXProvider=vX,e.Orderbook=class{apiClient;seaport;orderbookConfig;constructor(t){const r={...function(t){switch(t){case e.Environment.SANDBOX:return{seaportContractAddress:"0x45E23dA18804F99Cf67408AeBE85F67c958381Ff",zoneContractAddress:"0x25b00b7eb97eab6194798E9B8eF63Aa526D5bd7E",apiEndpoint:"https://order-book-mr.sandbox.imtbl.com",chainName:"imtbl-zkevm-testnet",provider:new om("https://zkevm-rpc.sandbox.x.immutable.com")};case e.Environment.PRODUCTION:return{seaportContractAddress:"",zoneContractAddress:"",apiEndpoint:"https://order-book-mr.imtbl.com",chainName:"imtbl-zkevm-mainnet",provider:new om("https://zkevm-rpc.x.immutable.com")};default:return null}}(t.baseConfig.environment),...t.overrides};if(!r)throw new Error("Orderbook configuration not passed, please specify the environment under config.baseConfig.environment");this.orderbookConfig=r;const{apiEndpoint:n,chainName:i}=this.orderbookConfig;if(!n)throw new Error("API endpoint must be provided");this.apiClient=new MK(n,i,this.orderbookConfig.seaportContractAddress).create();const a=new UK(this.orderbookConfig.seaportContractAddress,this.orderbookConfig.provider);this.seaport=new NK(a,this.orderbookConfig.provider,this.orderbookConfig.seaportContractAddress,this.orderbookConfig.zoneContractAddress)}getListing(e){return this.apiClient.getListing(e)}listListings(e){return this.apiClient.listListings(e)}async prepareListing({makerAddress:e,sell:t,buy:r,orderExpiry:n}){const i=new LK(t.contractAddress,this.orderbookConfig.provider).create(),a=await i.royaltyInfo(t.tokenId,r.amount);return this.seaport.prepareSeaportOrder(e,t,r,a,new Date,n||new Date(Date.now()+63072e6))}createListing(e){return this.apiClient.createListing(e)}async fulfillOrder(e,t){const r=await this.apiClient.getListing(e);if(r.result.status!==AK.ACTIVE)throw new Error(`Cannot fulfil order that is not active. Current status: ${r.result.status}`);return this.seaport.fulfilOrder(r.result,t)}async cancelOrder(e,t){const r=await this.apiClient.getListing(e);if(r.result.status!==AK.ACTIVE&&r.result.status!==AK.INACTIVE&&r.result.status!==AK.PENDING)throw new Error(`Cannot cancel order with status ${r.result.status}`);if(r.result.account_address!==t.toLowerCase())throw new Error(`Only account ${r.result.account_address} can cancel order ${e}`);return{unsignedCancelOrderTransaction:await this.seaport.cancelOrder(r.result,t)}}},e.Passport=class{authManager;config;confirmationScreen;immutableXClient;magicAdapter;passportImxProviderFactory;multiRollupApiClients;constructor(e){this.config=new Pz(e),this.authManager=new _z(this.config),this.magicAdapter=new Ez(this.config),this.confirmationScreen=new jz(this.config),this.immutableXClient=e.overrides?.immutableXClient||new jB({baseConfig:e.baseConfig}),this.multiRollupApiClients=new yt(this.config.multiRollupConfig),this.passportImxProviderFactory=new Iz({authManager:this.authManager,config:this.config,confirmationScreen:this.confirmationScreen,immutableXClient:this.immutableXClient,magicAdapter:this.magicAdapter})}async connectImxSilent(){return this.passportImxProviderFactory.getProviderSilent()}async connectImx(){return this.passportImxProviderFactory.getProvider()}async loginWithDeviceFlow(){return this.authManager.loginWithDeviceFlow()}async connectImxDeviceFlow(e,t,r){return this.passportImxProviderFactory.getProviderWithDeviceFlow(e,t,r)}checkStoredDeviceFlowCredentials(){return this.authManager.checkStoredDeviceFlowCredentials()}async connectImxWithCredentials(e){return this.passportImxProviderFactory.getProviderWithCredentials(e)}connectEvm(){return new Qz({authManager:this.authManager,magicAdapter:this.magicAdapter,config:this.config,confirmationScreen:this.confirmationScreen,multiRollupApiClients:this.multiRollupApiClients})}async loginCallback(){return this.authManager.loginCallback()}async logout(){return this.authManager.logout()}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}},e.PassportError=mz,e.ProviderConfiguration=class{immutableXConfig;baseConfig;constructor({baseConfig:t,overrides:r}){if(this.baseConfig=t,r)this.immutableXConfig=r.immutableXConfig;else switch(t.environment){case e.Environment.SANDBOX:this.immutableXConfig=TP.SANDBOX;break;case e.Environment.PRODUCTION:this.immutableXConfig=TP.PRODUCTION}}},e.SwapReact=w3,e.UpdateConfig=function(e){void 0!==window?window.ImtblCheckoutWidgetConfig=JSON.stringify(e):console.error("missing document object: please run Checkout client side")},e.WalletReact=_3,e.imxClientCreateStarkSigner=NC,e.imxClientGenerateLegacyStarkPrivateKey=xC,e.module="orderbook"}));
85
85
  //# sourceMappingURL=index.browser.js.map