@reown/appkit-cdn 1.0.2 → 1.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{W3MFrameProviderSingleton-DyEiFdpq.js → W3MFrameProviderSingleton-ByMR2if0.js} +3389 -3542
- package/dist/{W3MFrameProviderSingleton-9N7Xjb4-.cjs → W3MFrameProviderSingleton-QMvIDuQ9.cjs} +36 -36
- package/dist/ethers.cjs +1 -1
- package/dist/ethers.js +133 -139
- package/dist/{hooks.module-DjNSWU32.cjs → hooks.module-B7uJtWgK.cjs} +1 -1
- package/dist/{hooks.module-BgSrACu5.js → hooks.module-Cc8hySTP.js} +1 -1
- package/dist/{index-DnJKKBCl.js → index-6X8YJouh.js} +2 -2
- package/dist/{index-BDP9SW0d.js → index-BORWocQH.js} +2 -2
- package/dist/{index-Cs0eLnEu.cjs → index-BY9wdxgf.cjs} +1 -1
- package/dist/{index-D_fyd8O3.js → index-BeyRJQ4w.js} +2 -2
- package/dist/{index-iqke2ukg.cjs → index-BxUpvuxL.cjs} +1 -1
- package/dist/{index-Bslsy8mP.cjs → index-C8qz9kCY.cjs} +1 -1
- package/dist/{index-CSN-mQVF.js → index-CVwzlj-7.js} +2 -2
- package/dist/{index-B-dJOHC4.js → index-Cvq37YY6.js} +1 -1
- package/dist/{index-DwKYRtI4.cjs → index-D2X0Qm-3.cjs} +1 -1
- package/dist/{index-DTO1KwGw.js → index-D2zHP4xy.js} +2 -2
- package/dist/{index-Bw9OMS3B.cjs → index-D5Be_LRa.cjs} +1 -1
- package/dist/{index-JGQ5x3fU.cjs → index-DGKRDdTn.cjs} +1 -1
- package/dist/{index-DzhspnbK.cjs → index-DS2tCoxB.cjs} +1 -1
- package/dist/{index-CDogBYT6.cjs → index-DatS1o_D.cjs} +1 -1
- package/dist/{index-BQcKnJi6.js → index-Ds2LQQcC.js} +2 -2
- package/dist/{index-CY9GXdH8.js → index-RP8m5fY-.js} +2 -2
- package/dist/{index.es-BUHHRWJS.cjs → index.es-DEYcd29M.cjs} +2 -2
- package/dist/{index.es-DKBx9MC0.js → index.es-gcREdjR5.js} +2 -2
- package/dist/{metamask-sdk-DW0pLP9m.cjs → metamask-sdk-B7mRWuUL.cjs} +1 -1
- package/dist/{metamask-sdk-DRkDynNt.js → metamask-sdk-DjTXJOf3.js} +1 -1
- package/dist/{native-BTEMDqpx.js → native-BIxNbjgj.js} +1 -1
- package/dist/{native-CM-ttrga.cjs → native-GRAmon80.cjs} +1 -1
- package/dist/{w3m-modal-VPikPCIA.js → w3m-modal-B3w1zQhA.js} +43 -43
- package/dist/{w3m-modal-mZmS_e_d.cjs → w3m-modal-DhxUNld7.cjs} +4 -4
- package/dist/{wagmi-BixRJnz_.js → wagmi-B6jaEzaj.js} +1620 -1621
- package/dist/{wagmi-BTPiDqk7.cjs → wagmi-Dtm-jEDI.cjs} +14 -14
- package/dist/wagmi.cjs +1 -1
- package/dist/wagmi.js +2 -2
- package/package.json +5 -5
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";const Ho=require("./W3MFrameProviderSingleton-
|
|
1
|
+
"use strict";const Ho=require("./W3MFrameProviderSingleton-QMvIDuQ9.cjs");var Hw={exports:{}};(function(yW,PL){(function(Ie,Pu){Pu(PL)})(Ho.commonjsGlobal,function(Ie){var Pu=typeof Ho.commonjsGlobal<"u"?Ho.commonjsGlobal:typeof self<"u"?self:typeof window<"u"?window:{},En=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof Ho.commonjsGlobal<"u"?Ho.commonjsGlobal:typeof self<"u"?self:{};function td(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function um(e){if(e.__esModule)return e;var t=e.default;if(typeof t=="function"){var n=function r(){return this instanceof r?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(r){var o=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(n,r,o.get?o:{enumerable:!0,get:function(){return e[r]}})}),n}var q6={exports:{}};(function(e,t){var n=typeof globalThis<"u"&&globalThis||typeof self<"u"&&self||En!==void 0&&En,r=function(){function i(){this.fetch=!1,this.DOMException=n.DOMException}return i.prototype=n,new i}();(function(i){(function(c){var g=i!==void 0&&i||typeof self<"u"&&self||g!==void 0&&g,_="URLSearchParams"in g,w="Symbol"in g&&"iterator"in Symbol,S="FileReader"in g&&"Blob"in g&&function(){try{return new Blob,!0}catch{return!1}}(),E="FormData"in g,T="ArrayBuffer"in g;if(T)var I=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],j=ArrayBuffer.isView||function(f){return f&&I.indexOf(Object.prototype.toString.call(f))>-1};function H(f){if(typeof f!="string"&&(f=String(f)),/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(f)||f==="")throw new TypeError('Invalid character in header field name: "'+f+'"');return f.toLowerCase()}function V(f){return typeof f!="string"&&(f=String(f)),f}function ee(f){var l={next:function(){var b=f.shift();return{done:b===void 0,value:b}}};return w&&(l[Symbol.iterator]=function(){return l}),l}function X(f){this.map={},f instanceof X?f.forEach(function(l,b){this.append(b,l)},this):Array.isArray(f)?f.forEach(function(l){this.append(l[0],l[1])},this):f&&Object.getOwnPropertyNames(f).forEach(function(l){this.append(l,f[l])},this)}function ue(f){if(f.bodyUsed)return Promise.reject(new TypeError("Already read"));f.bodyUsed=!0}function le(f){return new Promise(function(l,b){f.onload=function(){l(f.result)},f.onerror=function(){b(f.error)}})}function pe(f){var l=new FileReader,b=le(l);return l.readAsArrayBuffer(f),b}function Me(f){if(f.slice)return f.slice(0);var l=new Uint8Array(f.byteLength);return l.set(new Uint8Array(f)),l.buffer}function ye(){return this.bodyUsed=!1,this._initBody=function(f){var l;this.bodyUsed=this.bodyUsed,this._bodyInit=f,f?typeof f=="string"?this._bodyText=f:S&&Blob.prototype.isPrototypeOf(f)?this._bodyBlob=f:E&&FormData.prototype.isPrototypeOf(f)?this._bodyFormData=f:_&&URLSearchParams.prototype.isPrototypeOf(f)?this._bodyText=f.toString():T&&S&&(l=f)&&DataView.prototype.isPrototypeOf(l)?(this._bodyArrayBuffer=Me(f.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):T&&(ArrayBuffer.prototype.isPrototypeOf(f)||j(f))?this._bodyArrayBuffer=Me(f):this._bodyText=f=Object.prototype.toString.call(f):this._bodyText="",this.headers.get("content-type")||(typeof f=="string"?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):_&&URLSearchParams.prototype.isPrototypeOf(f)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},S&&(this.blob=function(){var f=ue(this);if(f)return f;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))},this.arrayBuffer=function(){if(this._bodyArrayBuffer){var f=ue(this);return f||(ArrayBuffer.isView(this._bodyArrayBuffer)?Promise.resolve(this._bodyArrayBuffer.buffer.slice(this._bodyArrayBuffer.byteOffset,this._bodyArrayBuffer.byteOffset+this._bodyArrayBuffer.byteLength)):Promise.resolve(this._bodyArrayBuffer))}return this.blob().then(pe)}),this.text=function(){var f,l,b,C=ue(this);if(C)return C;if(this._bodyBlob)return f=this._bodyBlob,l=new FileReader,b=le(l),l.readAsText(f),b;if(this._bodyArrayBuffer)return Promise.resolve(function(R){for(var L=new Uint8Array(R),B=new Array(L.length),K=0;K<L.length;K++)B[K]=String.fromCharCode(L[K]);return B.join("")}(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},E&&(this.formData=function(){return this.text().then(x)}),this.json=function(){return this.text().then(JSON.parse)},this}X.prototype.append=function(f,l){f=H(f),l=V(l);var b=this.map[f];this.map[f]=b?b+", "+l:l},X.prototype.delete=function(f){delete this.map[H(f)]},X.prototype.get=function(f){return f=H(f),this.has(f)?this.map[f]:null},X.prototype.has=function(f){return this.map.hasOwnProperty(H(f))},X.prototype.set=function(f,l){this.map[H(f)]=V(l)},X.prototype.forEach=function(f,l){for(var b in this.map)this.map.hasOwnProperty(b)&&f.call(l,this.map[b],b,this)},X.prototype.keys=function(){var f=[];return this.forEach(function(l,b){f.push(b)}),ee(f)},X.prototype.values=function(){var f=[];return this.forEach(function(l){f.push(l)}),ee(f)},X.prototype.entries=function(){var f=[];return this.forEach(function(l,b){f.push([b,l])}),ee(f)},w&&(X.prototype[Symbol.iterator]=X.prototype.entries);var Te=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function y(f,l){if(!(this instanceof y))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');var b=(l=l||{}).body;if(f instanceof y){if(f.bodyUsed)throw new TypeError("Already read");this.url=f.url,this.credentials=f.credentials,l.headers||(this.headers=new X(f.headers)),this.method=f.method,this.mode=f.mode,this.signal=f.signal,b||f._bodyInit==null||(b=f._bodyInit,f.bodyUsed=!0)}else this.url=String(f);if(this.credentials=l.credentials||this.credentials||"same-origin",!l.headers&&this.headers||(this.headers=new X(l.headers)),this.method=function(R){var L=R.toUpperCase();return Te.indexOf(L)>-1?L:R}(l.method||this.method||"GET"),this.mode=l.mode||this.mode||null,this.signal=l.signal||this.signal,this.referrer=null,(this.method==="GET"||this.method==="HEAD")&&b)throw new TypeError("Body not allowed for GET or HEAD requests");if(this._initBody(b),!(this.method!=="GET"&&this.method!=="HEAD"||l.cache!=="no-store"&&l.cache!=="no-cache")){var C=/([?&])_=[^&]*/;C.test(this.url)?this.url=this.url.replace(C,"$1_="+new Date().getTime()):this.url+=(/\?/.test(this.url)?"&":"?")+"_="+new Date().getTime()}}function x(f){var l=new FormData;return f.trim().split("&").forEach(function(b){if(b){var C=b.split("="),R=C.shift().replace(/\+/g," "),L=C.join("=").replace(/\+/g," ");l.append(decodeURIComponent(R),decodeURIComponent(L))}}),l}function d(f,l){if(!(this instanceof d))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');l||(l={}),this.type="default",this.status=l.status===void 0?200:l.status,this.ok=this.status>=200&&this.status<300,this.statusText=l.statusText===void 0?"":""+l.statusText,this.headers=new X(l.headers),this.url=l.url||"",this._initBody(f)}y.prototype.clone=function(){return new y(this,{body:this._bodyInit})},ye.call(y.prototype),ye.call(d.prototype),d.prototype.clone=function(){return new d(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new X(this.headers),url:this.url})},d.error=function(){var f=new d(null,{status:0,statusText:""});return f.type="error",f};var p=[301,302,303,307,308];d.redirect=function(f,l){if(p.indexOf(l)===-1)throw new RangeError("Invalid status code");return new d(null,{status:l,headers:{location:f}})},c.DOMException=g.DOMException;try{new c.DOMException}catch{c.DOMException=function(l,b){this.message=l,this.name=b;var C=Error(l);this.stack=C.stack},c.DOMException.prototype=Object.create(Error.prototype),c.DOMException.prototype.constructor=c.DOMException}function h(f,l){return new Promise(function(b,C){var R=new y(f,l);if(R.signal&&R.signal.aborted)return C(new c.DOMException("Aborted","AbortError"));var L=new XMLHttpRequest;function B(){L.abort()}L.onload=function(){var K,z,O={status:L.status,statusText:L.statusText,headers:(K=L.getAllResponseHeaders()||"",z=new X,K.replace(/\r?\n[\t ]+/g," ").split("\r").map(function(q){return q.indexOf(`
|
|
2
2
|
`)===0?q.substr(1,q.length):q}).forEach(function(q){var Y=q.split(":"),Q=Y.shift().trim();if(Q){var ae=Y.join(":").trim();z.append(Q,ae)}}),z)};O.url="responseURL"in L?L.responseURL:O.headers.get("X-Request-URL");var D="response"in L?L.response:L.responseText;setTimeout(function(){b(new d(D,O))},0)},L.onerror=function(){setTimeout(function(){C(new TypeError("Network request failed"))},0)},L.ontimeout=function(){setTimeout(function(){C(new TypeError("Network request failed"))},0)},L.onabort=function(){setTimeout(function(){C(new c.DOMException("Aborted","AbortError"))},0)},L.open(R.method,function(K){try{return K===""&&g.location.href?g.location.href:K}catch{return K}}(R.url),!0),R.credentials==="include"?L.withCredentials=!0:R.credentials==="omit"&&(L.withCredentials=!1),"responseType"in L&&(S?L.responseType="blob":T&&R.headers.get("Content-Type")&&R.headers.get("Content-Type").indexOf("application/octet-stream")!==-1&&(L.responseType="arraybuffer")),!l||typeof l.headers!="object"||l.headers instanceof X?R.headers.forEach(function(K,z){L.setRequestHeader(z,K)}):Object.getOwnPropertyNames(l.headers).forEach(function(K){L.setRequestHeader(K,V(l.headers[K]))}),R.signal&&(R.signal.addEventListener("abort",B),L.onreadystatechange=function(){L.readyState===4&&R.signal.removeEventListener("abort",B)}),L.send(R._bodyInit===void 0?null:R._bodyInit)})}h.polyfill=!0,g.fetch||(g.fetch=h,g.Headers=X,g.Request=y,g.Response=d),c.Headers=X,c.Request=y,c.Response=d,c.fetch=h})({})})(r),r.fetch.ponyfill=!0,delete r.fetch.polyfill;var o=n.fetch?n:r;(t=o.fetch).default=o.fetch,t.fetch=o.fetch,t.Headers=o.Headers,t.Request=o.Request,t.Response=o.Response,e.exports=t})(q6,q6.exports);var LL=td(q6.exports),Lu=[],ja=[],IL=typeof Uint8Array<"u"?Uint8Array:Array,H6=!1;function Ww(){H6=!0;for(var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",t=0;t<64;++t)Lu[t]=e[t],ja[e.charCodeAt(t)]=t;ja[45]=62,ja[95]=63}function OL(e,t,n){for(var r,o,i=[],c=t;c<n;c+=3)r=(e[c]<<16)+(e[c+1]<<8)+e[c+2],i.push(Lu[(o=r)>>18&63]+Lu[o>>12&63]+Lu[o>>6&63]+Lu[63&o]);return i.join("")}function $w(e){var t;H6||Ww();for(var n=e.length,r=n%3,o="",i=[],c=16383,g=0,_=n-r;g<_;g+=c)i.push(OL(e,g,g+c>_?_:g+c));return r===1?(t=e[n-1],o+=Lu[t>>2],o+=Lu[t<<4&63],o+="=="):r===2&&(t=(e[n-2]<<8)+e[n-1],o+=Lu[t>>10],o+=Lu[t>>4&63],o+=Lu[t<<2&63],o+="="),i.push(o),i.join("")}function lv(e,t,n,r,o){var i,c,g=8*o-r-1,_=(1<<g)-1,w=_>>1,S=-7,E=n?o-1:0,T=n?-1:1,I=e[t+E];for(E+=T,i=I&(1<<-S)-1,I>>=-S,S+=g;S>0;i=256*i+e[t+E],E+=T,S-=8);for(c=i&(1<<-S)-1,i>>=-S,S+=r;S>0;c=256*c+e[t+E],E+=T,S-=8);if(i===0)i=1-w;else{if(i===_)return c?NaN:1/0*(I?-1:1);c+=Math.pow(2,r),i-=w}return(I?-1:1)*c*Math.pow(2,i-r)}function Vw(e,t,n,r,o,i){var c,g,_,w=8*i-o-1,S=(1<<w)-1,E=S>>1,T=o===23?Math.pow(2,-24)-Math.pow(2,-77):0,I=r?0:i-1,j=r?1:-1,H=t<0||t===0&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(g=isNaN(t)?1:0,c=S):(c=Math.floor(Math.log(t)/Math.LN2),t*(_=Math.pow(2,-c))<1&&(c--,_*=2),(t+=c+E>=1?T/_:T*Math.pow(2,1-E))*_>=2&&(c++,_/=2),c+E>=S?(g=0,c=S):c+E>=1?(g=(t*_-1)*Math.pow(2,o),c+=E):(g=t*Math.pow(2,E-1)*Math.pow(2,o),c=0));o>=8;e[n+I]=255&g,I+=j,g/=256,o-=8);for(c=c<<o|g,w+=o;w>0;e[n+I]=255&c,I+=j,c/=256,w-=8);e[n+I-j]|=128*H}var NL={}.toString,Yw=Array.isArray||function(e){return NL.call(e)=="[object Array]"};ze.TYPED_ARRAY_SUPPORT=Pu.TYPED_ARRAY_SUPPORT===void 0||Pu.TYPED_ARRAY_SUPPORT;var DL=cv();function cv(){return ze.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function ql(e,t){if(cv()<t)throw new RangeError("Invalid typed array length");return ze.TYPED_ARRAY_SUPPORT?(e=new Uint8Array(t)).__proto__=ze.prototype:(e===null&&(e=new ze(t)),e.length=t),e}function ze(e,t,n){if(!(ze.TYPED_ARRAY_SUPPORT||this instanceof ze))return new ze(e,t,n);if(typeof e=="number"){if(typeof t=="string")throw new Error("If encoding is specified then the first argument must be a string");return W6(this,e)}return Gw(this,e,t,n)}function Gw(e,t,n,r){if(typeof t=="number")throw new TypeError('"value" argument must not be a number');return typeof ArrayBuffer<"u"&&t instanceof ArrayBuffer?function(o,i,c,g){if(i.byteLength,c<0||i.byteLength<c)throw new RangeError("'offset' is out of bounds");if(i.byteLength<c+(g||0))throw new RangeError("'length' is out of bounds");return i=c===void 0&&g===void 0?new Uint8Array(i):g===void 0?new Uint8Array(i,c):new Uint8Array(i,c,g),ze.TYPED_ARRAY_SUPPORT?(o=i).__proto__=ze.prototype:o=$6(o,i),o}(e,t,n,r):typeof t=="string"?function(o,i,c){if(typeof c=="string"&&c!==""||(c="utf8"),!ze.isEncoding(c))throw new TypeError('"encoding" must be a valid string encoding');var g=0|Qw(i,c);o=ql(o,g);var _=o.write(i,c);return _!==g&&(o=o.slice(0,_)),o}(e,t,n):function(o,i){if(Iu(i)){var c=0|V6(i.length);return(o=ql(o,c)).length===0||i.copy(o,0,0,c),o}if(i){if(typeof ArrayBuffer<"u"&&i.buffer instanceof ArrayBuffer||"length"in i)return typeof i.length!="number"||(g=i.length)!=g?ql(o,0):$6(o,i);if(i.type==="Buffer"&&Yw(i.data))return $6(o,i.data)}var g;throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(e,t)}function Zw(e){if(typeof e!="number")throw new TypeError('"size" argument must be a number');if(e<0)throw new RangeError('"size" argument must not be negative')}function W6(e,t){if(Zw(t),e=ql(e,t<0?0:0|V6(t)),!ze.TYPED_ARRAY_SUPPORT)for(var n=0;n<t;++n)e[n]=0;return e}function $6(e,t){var n=t.length<0?0:0|V6(t.length);e=ql(e,n);for(var r=0;r<n;r+=1)e[r]=255&t[r];return e}function V6(e){if(e>=cv())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+cv().toString(16)+" bytes");return 0|e}function Iu(e){return!(e==null||!e._isBuffer)}function Qw(e,t){if(Iu(e))return e.length;if(typeof ArrayBuffer<"u"&&typeof ArrayBuffer.isView=="function"&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;typeof e!="string"&&(e=""+e);var n=e.length;if(n===0)return 0;for(var r=!1;;)switch(t){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":case void 0:return hv(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return a_(e).length;default:if(r)return hv(e).length;t=(""+t).toLowerCase(),r=!0}}function BL(e,t,n){var r=!1;if((t===void 0||t<0)&&(t=0),t>this.length||((n===void 0||n>this.length)&&(n=this.length),n<=0)||(n>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return $L(this,t,n);case"utf8":case"utf-8":return t_(this,t,n);case"ascii":return HL(this,t,n);case"latin1":case"binary":return WL(this,t,n);case"base64":return qL(this,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return VL(this,t,n);default:if(r)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),r=!0}}function Df(e,t,n){var r=e[t];e[t]=e[n],e[n]=r}function Xw(e,t,n,r,o){if(e.length===0)return-1;if(typeof n=="string"?(r=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,isNaN(n)&&(n=o?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(o)return-1;n=e.length-1}else if(n<0){if(!o)return-1;n=0}if(typeof t=="string"&&(t=ze.from(t,r)),Iu(t))return t.length===0?-1:Jw(e,t,n,r,o);if(typeof t=="number")return t&=255,ze.TYPED_ARRAY_SUPPORT&&typeof Uint8Array.prototype.indexOf=="function"?o?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):Jw(e,[t],n,r,o);throw new TypeError("val must be string, number or Buffer")}function Jw(e,t,n,r,o){var i,c=1,g=e.length,_=t.length;if(r!==void 0&&((r=String(r).toLowerCase())==="ucs2"||r==="ucs-2"||r==="utf16le"||r==="utf-16le")){if(e.length<2||t.length<2)return-1;c=2,g/=2,_/=2,n/=2}function w(I,j){return c===1?I[j]:I.readUInt16BE(j*c)}if(o){var S=-1;for(i=n;i<g;i++)if(w(e,i)===w(t,S===-1?0:i-S)){if(S===-1&&(S=i),i-S+1===_)return S*c}else S!==-1&&(i-=i-S),S=-1}else for(n+_>g&&(n=g-_),i=n;i>=0;i--){for(var E=!0,T=0;T<_;T++)if(w(e,i+T)!==w(t,T)){E=!1;break}if(E)return i}return-1}function jL(e,t,n,r){n=Number(n)||0;var o=e.length-n;r?(r=Number(r))>o&&(r=o):r=o;var i=t.length;if(i%2!=0)throw new TypeError("Invalid hex string");r>i/2&&(r=i/2);for(var c=0;c<r;++c){var g=parseInt(t.substr(2*c,2),16);if(isNaN(g))return c;e[n+c]=g}return c}function zL(e,t,n,r){return pv(hv(t,e.length-n),e,n,r)}function e_(e,t,n,r){return pv(function(o){for(var i=[],c=0;c<o.length;++c)i.push(255&o.charCodeAt(c));return i}(t),e,n,r)}function UL(e,t,n,r){return e_(e,t,n,r)}function FL(e,t,n,r){return pv(a_(t),e,n,r)}function KL(e,t,n,r){return pv(function(o,i){for(var c,g,_,w=[],S=0;S<o.length&&!((i-=2)<0);++S)g=(c=o.charCodeAt(S))>>8,_=c%256,w.push(_),w.push(g);return w}(t,e.length-n),e,n,r)}function qL(e,t,n){return t===0&&n===e.length?$w(e):$w(e.slice(t,n))}function t_(e,t,n){n=Math.min(e.length,n);for(var r=[],o=t;o<n;){var i,c,g,_,w=e[o],S=null,E=w>239?4:w>223?3:w>191?2:1;if(o+E<=n)switch(E){case 1:w<128&&(S=w);break;case 2:(192&(i=e[o+1]))==128&&(_=(31&w)<<6|63&i)>127&&(S=_);break;case 3:i=e[o+1],c=e[o+2],(192&i)==128&&(192&c)==128&&(_=(15&w)<<12|(63&i)<<6|63&c)>2047&&(_<55296||_>57343)&&(S=_);break;case 4:i=e[o+1],c=e[o+2],g=e[o+3],(192&i)==128&&(192&c)==128&&(192&g)==128&&(_=(15&w)<<18|(63&i)<<12|(63&c)<<6|63&g)>65535&&_<1114112&&(S=_)}S===null?(S=65533,E=1):S>65535&&(S-=65536,r.push(S>>>10&1023|55296),S=56320|1023&S),r.push(S),o+=E}return function(T){var I=T.length;if(I<=n_)return String.fromCharCode.apply(String,T);for(var j="",H=0;H<I;)j+=String.fromCharCode.apply(String,T.slice(H,H+=n_));return j}(r)}ze.poolSize=8192,ze._augment=function(e){return e.__proto__=ze.prototype,e},ze.from=function(e,t,n){return Gw(null,e,t,n)},ze.TYPED_ARRAY_SUPPORT&&(ze.prototype.__proto__=Uint8Array.prototype,ze.__proto__=Uint8Array,typeof Symbol<"u"&&Symbol.species&&ze[Symbol.species]),ze.alloc=function(e,t,n){return function(r,o,i,c){return Zw(o),o<=0?ql(r,o):i!==void 0?typeof c=="string"?ql(r,o).fill(i,c):ql(r,o).fill(i):ql(r,o)}(null,e,t,n)},ze.allocUnsafe=function(e){return W6(null,e)},ze.allocUnsafeSlow=function(e){return W6(null,e)},ze.isBuffer=va,ze.compare=function(e,t){if(!Iu(e)||!Iu(t))throw new TypeError("Arguments must be Buffers");if(e===t)return 0;for(var n=e.length,r=t.length,o=0,i=Math.min(n,r);o<i;++o)if(e[o]!==t[o]){n=e[o],r=t[o];break}return n<r?-1:r<n?1:0},ze.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}},ze.concat=function(e,t){if(!Yw(e))throw new TypeError('"list" argument must be an Array of Buffers');if(e.length===0)return ze.alloc(0);var n;if(t===void 0)for(t=0,n=0;n<e.length;++n)t+=e[n].length;var r=ze.allocUnsafe(t),o=0;for(n=0;n<e.length;++n){var i=e[n];if(!Iu(i))throw new TypeError('"list" argument must be an Array of Buffers');i.copy(r,o),o+=i.length}return r},ze.byteLength=Qw,ze.prototype._isBuffer=!0,ze.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)Df(this,t,t+1);return this},ze.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)Df(this,t,t+3),Df(this,t+1,t+2);return this},ze.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)Df(this,t,t+7),Df(this,t+1,t+6),Df(this,t+2,t+5),Df(this,t+3,t+4);return this},ze.prototype.toString=function(){var e=0|this.length;return e===0?"":arguments.length===0?t_(this,0,e):BL.apply(this,arguments)},ze.prototype.equals=function(e){if(!Iu(e))throw new TypeError("Argument must be a Buffer");return this===e||ze.compare(this,e)===0},ze.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+">"},ze.prototype.compare=function(e,t,n,r,o){if(!Iu(e))throw new TypeError("Argument must be a Buffer");if(t===void 0&&(t=0),n===void 0&&(n=e?e.length:0),r===void 0&&(r=0),o===void 0&&(o=this.length),t<0||n>e.length||r<0||o>this.length)throw new RangeError("out of range index");if(r>=o&&t>=n)return 0;if(r>=o)return-1;if(t>=n)return 1;if(this===e)return 0;for(var i=(o>>>=0)-(r>>>=0),c=(n>>>=0)-(t>>>=0),g=Math.min(i,c),_=this.slice(r,o),w=e.slice(t,n),S=0;S<g;++S)if(_[S]!==w[S]){i=_[S],c=w[S];break}return i<c?-1:c<i?1:0},ze.prototype.includes=function(e,t,n){return this.indexOf(e,t,n)!==-1},ze.prototype.indexOf=function(e,t,n){return Xw(this,e,t,n,!0)},ze.prototype.lastIndexOf=function(e,t,n){return Xw(this,e,t,n,!1)},ze.prototype.write=function(e,t,n,r){if(t===void 0)r="utf8",n=this.length,t=0;else if(n===void 0&&typeof t=="string")r=t,n=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t|=0,isFinite(n)?(n|=0,r===void 0&&(r="utf8")):(r=n,n=void 0)}var o=this.length-t;if((n===void 0||n>o)&&(n=o),e.length>0&&(n<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");for(var i=!1;;)switch(r){case"hex":return jL(this,e,t,n);case"utf8":case"utf-8":return zL(this,e,t,n);case"ascii":return e_(this,e,t,n);case"latin1":case"binary":return UL(this,e,t,n);case"base64":return FL(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return KL(this,e,t,n);default:if(i)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),i=!0}},ze.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var n_=4096;function HL(e,t,n){var r="";n=Math.min(e.length,n);for(var o=t;o<n;++o)r+=String.fromCharCode(127&e[o]);return r}function WL(e,t,n){var r="";n=Math.min(e.length,n);for(var o=t;o<n;++o)r+=String.fromCharCode(e[o]);return r}function $L(e,t,n){var r=e.length;(!t||t<0)&&(t=0),(!n||n<0||n>r)&&(n=r);for(var o="",i=t;i<n;++i)o+=GL(e[i]);return o}function VL(e,t,n){for(var r=e.slice(t,n),o="",i=0;i<r.length;i+=2)o+=String.fromCharCode(r[i]+256*r[i+1]);return o}function _i(e,t,n){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(e+t>n)throw new RangeError("Trying to access beyond buffer length")}function Wo(e,t,n,r,o,i){if(!Iu(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>o||t<i)throw new RangeError('"value" argument is out of bounds');if(n+r>e.length)throw new RangeError("Index out of range")}function dv(e,t,n,r){t<0&&(t=65535+t+1);for(var o=0,i=Math.min(e.length-n,2);o<i;++o)e[n+o]=(t&255<<8*(r?o:1-o))>>>8*(r?o:1-o)}function fv(e,t,n,r){t<0&&(t=4294967295+t+1);for(var o=0,i=Math.min(e.length-n,4);o<i;++o)e[n+o]=t>>>8*(r?o:3-o)&255}function r_(e,t,n,r,o,i){if(n+r>e.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function i_(e,t,n,r,o){return o||r_(e,0,n,4),Vw(e,t,n,r,23,4),n+4}function o_(e,t,n,r,o){return o||r_(e,0,n,8),Vw(e,t,n,r,52,8),n+8}ze.prototype.slice=function(e,t){var n,r=this.length;if((e=~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),(t=t===void 0?r:~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),t<e&&(t=e),ze.TYPED_ARRAY_SUPPORT)(n=this.subarray(e,t)).__proto__=ze.prototype;else{var o=t-e;n=new ze(o,void 0);for(var i=0;i<o;++i)n[i]=this[i+e]}return n},ze.prototype.readUIntLE=function(e,t,n){e|=0,t|=0,n||_i(e,t,this.length);for(var r=this[e],o=1,i=0;++i<t&&(o*=256);)r+=this[e+i]*o;return r},ze.prototype.readUIntBE=function(e,t,n){e|=0,t|=0,n||_i(e,t,this.length);for(var r=this[e+--t],o=1;t>0&&(o*=256);)r+=this[e+--t]*o;return r},ze.prototype.readUInt8=function(e,t){return t||_i(e,1,this.length),this[e]},ze.prototype.readUInt16LE=function(e,t){return t||_i(e,2,this.length),this[e]|this[e+1]<<8},ze.prototype.readUInt16BE=function(e,t){return t||_i(e,2,this.length),this[e]<<8|this[e+1]},ze.prototype.readUInt32LE=function(e,t){return t||_i(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},ze.prototype.readUInt32BE=function(e,t){return t||_i(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},ze.prototype.readIntLE=function(e,t,n){e|=0,t|=0,n||_i(e,t,this.length);for(var r=this[e],o=1,i=0;++i<t&&(o*=256);)r+=this[e+i]*o;return r>=(o*=128)&&(r-=Math.pow(2,8*t)),r},ze.prototype.readIntBE=function(e,t,n){e|=0,t|=0,n||_i(e,t,this.length);for(var r=t,o=1,i=this[e+--r];r>0&&(o*=256);)i+=this[e+--r]*o;return i>=(o*=128)&&(i-=Math.pow(2,8*t)),i},ze.prototype.readInt8=function(e,t){return t||_i(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},ze.prototype.readInt16LE=function(e,t){t||_i(e,2,this.length);var n=this[e]|this[e+1]<<8;return 32768&n?4294901760|n:n},ze.prototype.readInt16BE=function(e,t){t||_i(e,2,this.length);var n=this[e+1]|this[e]<<8;return 32768&n?4294901760|n:n},ze.prototype.readInt32LE=function(e,t){return t||_i(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},ze.prototype.readInt32BE=function(e,t){return t||_i(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},ze.prototype.readFloatLE=function(e,t){return t||_i(e,4,this.length),lv(this,e,!0,23,4)},ze.prototype.readFloatBE=function(e,t){return t||_i(e,4,this.length),lv(this,e,!1,23,4)},ze.prototype.readDoubleLE=function(e,t){return t||_i(e,8,this.length),lv(this,e,!0,52,8)},ze.prototype.readDoubleBE=function(e,t){return t||_i(e,8,this.length),lv(this,e,!1,52,8)},ze.prototype.writeUIntLE=function(e,t,n,r){e=+e,t|=0,n|=0,r||Wo(this,e,t,n,Math.pow(2,8*n)-1,0);var o=1,i=0;for(this[t]=255&e;++i<n&&(o*=256);)this[t+i]=e/o&255;return t+n},ze.prototype.writeUIntBE=function(e,t,n,r){e=+e,t|=0,n|=0,r||Wo(this,e,t,n,Math.pow(2,8*n)-1,0);var o=n-1,i=1;for(this[t+o]=255&e;--o>=0&&(i*=256);)this[t+o]=e/i&255;return t+n},ze.prototype.writeUInt8=function(e,t,n){return e=+e,t|=0,n||Wo(this,e,t,1,255,0),ze.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},ze.prototype.writeUInt16LE=function(e,t,n){return e=+e,t|=0,n||Wo(this,e,t,2,65535,0),ze.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):dv(this,e,t,!0),t+2},ze.prototype.writeUInt16BE=function(e,t,n){return e=+e,t|=0,n||Wo(this,e,t,2,65535,0),ze.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):dv(this,e,t,!1),t+2},ze.prototype.writeUInt32LE=function(e,t,n){return e=+e,t|=0,n||Wo(this,e,t,4,4294967295,0),ze.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):fv(this,e,t,!0),t+4},ze.prototype.writeUInt32BE=function(e,t,n){return e=+e,t|=0,n||Wo(this,e,t,4,4294967295,0),ze.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):fv(this,e,t,!1),t+4},ze.prototype.writeIntLE=function(e,t,n,r){if(e=+e,t|=0,!r){var o=Math.pow(2,8*n-1);Wo(this,e,t,n,o-1,-o)}var i=0,c=1,g=0;for(this[t]=255&e;++i<n&&(c*=256);)e<0&&g===0&&this[t+i-1]!==0&&(g=1),this[t+i]=(e/c>>0)-g&255;return t+n},ze.prototype.writeIntBE=function(e,t,n,r){if(e=+e,t|=0,!r){var o=Math.pow(2,8*n-1);Wo(this,e,t,n,o-1,-o)}var i=n-1,c=1,g=0;for(this[t+i]=255&e;--i>=0&&(c*=256);)e<0&&g===0&&this[t+i+1]!==0&&(g=1),this[t+i]=(e/c>>0)-g&255;return t+n},ze.prototype.writeInt8=function(e,t,n){return e=+e,t|=0,n||Wo(this,e,t,1,127,-128),ze.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},ze.prototype.writeInt16LE=function(e,t,n){return e=+e,t|=0,n||Wo(this,e,t,2,32767,-32768),ze.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):dv(this,e,t,!0),t+2},ze.prototype.writeInt16BE=function(e,t,n){return e=+e,t|=0,n||Wo(this,e,t,2,32767,-32768),ze.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):dv(this,e,t,!1),t+2},ze.prototype.writeInt32LE=function(e,t,n){return e=+e,t|=0,n||Wo(this,e,t,4,2147483647,-2147483648),ze.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):fv(this,e,t,!0),t+4},ze.prototype.writeInt32BE=function(e,t,n){return e=+e,t|=0,n||Wo(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),ze.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):fv(this,e,t,!1),t+4},ze.prototype.writeFloatLE=function(e,t,n){return i_(this,e,t,!0,n)},ze.prototype.writeFloatBE=function(e,t,n){return i_(this,e,t,!1,n)},ze.prototype.writeDoubleLE=function(e,t,n){return o_(this,e,t,!0,n)},ze.prototype.writeDoubleBE=function(e,t,n){return o_(this,e,t,!1,n)},ze.prototype.copy=function(e,t,n,r){if(n||(n=0),r||r===0||(r=this.length),t>=e.length&&(t=e.length),t||(t=0),r>0&&r<n&&(r=n),r===n||e.length===0||this.length===0)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("sourceStart out of bounds");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),e.length-t<r-n&&(r=e.length-t+n);var o,i=r-n;if(this===e&&n<t&&t<r)for(o=i-1;o>=0;--o)e[o+t]=this[o+n];else if(i<1e3||!ze.TYPED_ARRAY_SUPPORT)for(o=0;o<i;++o)e[o+t]=this[o+n];else Uint8Array.prototype.set.call(e,this.subarray(n,n+i),t);return i},ze.prototype.fill=function(e,t,n,r){if(typeof e=="string"){if(typeof t=="string"?(r=t,t=0,n=this.length):typeof n=="string"&&(r=n,n=this.length),e.length===1){var o=e.charCodeAt(0);o<256&&(e=o)}if(r!==void 0&&typeof r!="string")throw new TypeError("encoding must be a string");if(typeof r=="string"&&!ze.isEncoding(r))throw new TypeError("Unknown encoding: "+r)}else typeof e=="number"&&(e&=255);if(t<0||this.length<t||this.length<n)throw new RangeError("Out of range index");if(n<=t)return this;var i;if(t>>>=0,n=n===void 0?this.length:n>>>0,e||(e=0),typeof e=="number")for(i=t;i<n;++i)this[i]=e;else{var c=Iu(e)?e:hv(new ze(e,r).toString()),g=c.length;for(i=0;i<n-t;++i)this[i+t]=c[i%g]}return this};var YL=/[^+\/0-9A-Za-z-_]/g;function GL(e){return e<16?"0"+e.toString(16):e.toString(16)}function hv(e,t){var n;t=t||1/0;for(var r=e.length,o=null,i=[],c=0;c<r;++c){if((n=e.charCodeAt(c))>55295&&n<57344){if(!o){if(n>56319){(t-=3)>-1&&i.push(239,191,189);continue}if(c+1===r){(t-=3)>-1&&i.push(239,191,189);continue}o=n;continue}if(n<56320){(t-=3)>-1&&i.push(239,191,189),o=n;continue}n=65536+(o-55296<<10|n-56320)}else o&&(t-=3)>-1&&i.push(239,191,189);if(o=null,n<128){if((t-=1)<0)break;i.push(n)}else if(n<2048){if((t-=2)<0)break;i.push(n>>6|192,63&n|128)}else if(n<65536){if((t-=3)<0)break;i.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;i.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return i}function a_(e){return function(t){var n,r,o,i,c,g;H6||Ww();var _=t.length;if(_%4>0)throw new Error("Invalid string. Length must be a multiple of 4");c=t[_-2]==="="?2:t[_-1]==="="?1:0,g=new IL(3*_/4-c),o=c>0?_-4:_;var w=0;for(n=0,r=0;n<o;n+=4,r+=3)i=ja[t.charCodeAt(n)]<<18|ja[t.charCodeAt(n+1)]<<12|ja[t.charCodeAt(n+2)]<<6|ja[t.charCodeAt(n+3)],g[w++]=i>>16&255,g[w++]=i>>8&255,g[w++]=255&i;return c===2?(i=ja[t.charCodeAt(n)]<<2|ja[t.charCodeAt(n+1)]>>4,g[w++]=255&i):c===1&&(i=ja[t.charCodeAt(n)]<<10|ja[t.charCodeAt(n+1)]<<4|ja[t.charCodeAt(n+2)]>>2,g[w++]=i>>8&255,g[w++]=255&i),g}(function(t){if((t=function(n){return n.trim?n.trim():n.replace(/^\s+|\s+$/g,"")}(t).replace(YL,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(e))}function pv(e,t,n,r){for(var o=0;o<r&&!(o+n>=t.length||o>=e.length);++o)t[o+n]=e[o];return o}function va(e){return e!=null&&(!!e._isBuffer||s_(e)||function(t){return typeof t.readFloatLE=="function"&&typeof t.slice=="function"&&s_(t.slice(0,0))}(e))}function s_(e){return!!e.constructor&&typeof e.constructor.isBuffer=="function"&&e.constructor.isBuffer(e)}var ZL=Object.freeze({__proto__:null,Buffer:ze,INSPECT_MAX_BYTES:50,SlowBuffer:function(e){return+e!=e&&(e=0),ze.alloc(+e)},isBuffer:va,kMaxLength:DL}),O0={},Y6={},G6={},xs=um(ZL),Pn={};function u_(){throw new Error("setTimeout has not been defined")}function l_(){throw new Error("clearTimeout has not been defined")}var nd=u_,rd=l_;function c_(e){if(nd===setTimeout)return setTimeout(e,0);if((nd===u_||!nd)&&setTimeout)return nd=setTimeout,setTimeout(e,0);try{return nd(e,0)}catch{try{return nd.call(null,e,0)}catch{return nd.call(this,e,0)}}}typeof Pu.setTimeout=="function"&&(nd=setTimeout),typeof Pu.clearTimeout=="function"&&(rd=clearTimeout);var Bf,Hl=[],N0=!1,mv=-1;function QL(){N0&&Bf&&(N0=!1,Bf.length?Hl=Bf.concat(Hl):mv=-1,Hl.length&&d_())}function d_(){if(!N0){var e=c_(QL);N0=!0;for(var t=Hl.length;t;){for(Bf=Hl,Hl=[];++mv<t;)Bf&&Bf[mv].run();mv=-1,t=Hl.length}Bf=null,N0=!1,function(n){if(rd===clearTimeout)return clearTimeout(n);if((rd===l_||!rd)&&clearTimeout)return rd=clearTimeout,clearTimeout(n);try{return rd(n)}catch{try{return rd.call(null,n)}catch{return rd.call(this,n)}}}(e)}}function xn(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];Hl.push(new f_(e,t)),Hl.length!==1||N0||c_(d_)}function f_(e,t){this.fun=e,this.array=t}f_.prototype.run=function(){this.fun.apply(null,this.array)};function jf(){}var XL=jf,JL=jf,eI=jf,tI=jf,nI=jf,rI=jf,iI=jf,D0=Pu.performance||{},oI=D0.now||D0.mozNow||D0.msNow||D0.oNow||D0.webkitNow||function(){return new Date().getTime()},aI=new Date,h_,vr={nextTick:xn,title:"browser",browser:!0,env:{},argv:[],version:"",versions:{},on:XL,addListener:JL,once:eI,off:tI,removeListener:nI,removeAllListeners:rI,emit:iI,binding:function(e){throw new Error("process.binding is not supported")},cwd:function(){return"/"},chdir:function(e){throw new Error("process.chdir is not supported")},umask:function(){return 0},hrtime:function(e){var t=.001*oI.call(D0),n=Math.floor(t),r=Math.floor(t%1*1e9);return e&&(n-=e[0],(r-=e[1])<0&&(n--,r+=1e9)),[n,r]},platform:"browser",release:{},config:{},uptime:function(){return(new Date-aI)/1e3}},Z6={exports:{}},Q6={exports:{}};function In(){return h_||(h_=1,function(e,t){var n=xs,r=n.Buffer;function o(c,g){for(var _ in c)g[_]=c[_]}function i(c,g,_){return r(c,g,_)}r.from&&r.alloc&&r.allocUnsafe&&r.allocUnsafeSlow?e.exports=n:(o(n,t),t.Buffer=i),i.prototype=Object.create(r.prototype),o(r,i),i.from=function(c,g,_){if(typeof c=="number")throw new TypeError("Argument must not be a number");return r(c,g,_)},i.alloc=function(c,g,_){if(typeof c!="number")throw new TypeError("Argument must be a number");var w=r(c);return g!==void 0?typeof _=="string"?w.fill(g,_):w.fill(g):w.fill(0),w},i.allocUnsafe=function(c){if(typeof c!="number")throw new TypeError("Argument must be a number");return r(c)},i.allocUnsafeSlow=function(c){if(typeof c!="number")throw new TypeError("Argument must be a number");return n.SlowBuffer(c)}}(Q6,Q6.exports)),Q6.exports}var X6=65536,sI=4294967295,uI=In().Buffer,gv=En.crypto||En.msCrypto;gv&&gv.getRandomValues?Z6.exports=function(e,t){if(e>sI)throw new RangeError("requested too many random bytes");var n=uI.allocUnsafe(e);if(e>0)if(e>X6)for(var r=0;r<e;r+=X6)gv.getRandomValues(n.slice(r,r+X6));else gv.getRandomValues(n);return typeof t=="function"?xn(function(){t(null,n)}):n}:Z6.exports=function(){throw new Error(`Secure random number generation is not supported by this browser.
|
|
3
3
|
Use Chrome, Firefox or Internet Explorer 11`)};var lm=Z6.exports,J6={exports:{}};typeof Object.create=="function"?J6.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:J6.exports=function(e,t){if(t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}};var On=J6.exports,e4={exports:{}};function id(){}function Nn(){Nn.init.call(this)}function p_(e){return e._maxListeners===void 0?Nn.defaultMaxListeners:e._maxListeners}function m_(e,t,n,r){var o,i,c;if(typeof n!="function")throw new TypeError('"listener" argument must be a function');if((i=e._events)?(i.newListener&&(e.emit("newListener",t,n.listener?n.listener:n),i=e._events),c=i[t]):(i=e._events=new id,e._eventsCount=0),c){if(typeof c=="function"?c=i[t]=r?[n,c]:[c,n]:r?c.unshift(n):c.push(n),!c.warned&&(o=p_(e))&&o>0&&c.length>o){c.warned=!0;var g=new Error("Possible EventEmitter memory leak detected. "+c.length+" "+t+" listeners added. Use emitter.setMaxListeners() to increase limit");g.name="MaxListenersExceededWarning",g.emitter=e,g.type=t,g.count=c.length,function(_){typeof console.warn=="function"?console.warn(_):console.log(_)}(g)}}else c=i[t]=n,++e._eventsCount;return e}function g_(e,t,n){var r=!1;function o(){e.removeListener(t,o),r||(r=!0,n.apply(e,arguments))}return o.listener=n,o}function v_(e){var t=this._events;if(t){var n=t[e];if(typeof n=="function")return 1;if(n)return n.length}return 0}function cm(e,t){for(var n=new Array(t);t--;)n[t]=e[t];return n}id.prototype=Object.create(null),Nn.EventEmitter=Nn,Nn.usingDomains=!1,Nn.prototype.domain=void 0,Nn.prototype._events=void 0,Nn.prototype._maxListeners=void 0,Nn.defaultMaxListeners=10,Nn.init=function(){this.domain=null,Nn.usingDomains&&(void 0).active,this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=new id,this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},Nn.prototype.setMaxListeners=function(e){if(typeof e!="number"||e<0||isNaN(e))throw new TypeError('"n" argument must be a positive number');return this._maxListeners=e,this},Nn.prototype.getMaxListeners=function(){return p_(this)},Nn.prototype.emit=function(e){var t,n,r,o,i,c,g,_=e==="error";if(c=this._events)_=_&&c.error==null;else if(!_)return!1;if(g=this.domain,_){if(t=arguments[1],!g){if(t instanceof Error)throw t;var w=new Error('Uncaught, unspecified "error" event. ('+t+")");throw w.context=t,w}return t||(t=new Error('Uncaught, unspecified "error" event')),t.domainEmitter=this,t.domain=g,t.domainThrown=!1,g.emit("error",t),!1}if(!(n=c[e]))return!1;var S=typeof n=="function";switch(r=arguments.length){case 1:(function(E,T,I){if(T)E.call(I);else for(var j=E.length,H=cm(E,j),V=0;V<j;++V)H[V].call(I)})(n,S,this);break;case 2:(function(E,T,I,j){if(T)E.call(I,j);else for(var H=E.length,V=cm(E,H),ee=0;ee<H;++ee)V[ee].call(I,j)})(n,S,this,arguments[1]);break;case 3:(function(E,T,I,j,H){if(T)E.call(I,j,H);else for(var V=E.length,ee=cm(E,V),X=0;X<V;++X)ee[X].call(I,j,H)})(n,S,this,arguments[1],arguments[2]);break;case 4:(function(E,T,I,j,H,V){if(T)E.call(I,j,H,V);else for(var ee=E.length,X=cm(E,ee),ue=0;ue<ee;++ue)X[ue].call(I,j,H,V)})(n,S,this,arguments[1],arguments[2],arguments[3]);break;default:for(o=new Array(r-1),i=1;i<r;i++)o[i-1]=arguments[i];(function(E,T,I,j){if(T)E.apply(I,j);else for(var H=E.length,V=cm(E,H),ee=0;ee<H;++ee)V[ee].apply(I,j)})(n,S,this,o)}return!0},Nn.prototype.addListener=function(e,t){return m_(this,e,t,!1)},Nn.prototype.on=Nn.prototype.addListener,Nn.prototype.prependListener=function(e,t){return m_(this,e,t,!0)},Nn.prototype.once=function(e,t){if(typeof t!="function")throw new TypeError('"listener" argument must be a function');return this.on(e,g_(this,e,t)),this},Nn.prototype.prependOnceListener=function(e,t){if(typeof t!="function")throw new TypeError('"listener" argument must be a function');return this.prependListener(e,g_(this,e,t)),this},Nn.prototype.removeListener=function(e,t){var n,r,o,i,c;if(typeof t!="function")throw new TypeError('"listener" argument must be a function');if(!(r=this._events))return this;if(!(n=r[e]))return this;if(n===t||n.listener&&n.listener===t)--this._eventsCount==0?this._events=new id:(delete r[e],r.removeListener&&this.emit("removeListener",e,n.listener||t));else if(typeof n!="function"){for(o=-1,i=n.length;i-- >0;)if(n[i]===t||n[i].listener&&n[i].listener===t){c=n[i].listener,o=i;break}if(o<0)return this;if(n.length===1){if(n[0]=void 0,--this._eventsCount==0)return this._events=new id,this;delete r[e]}else(function(g,_){for(var w=_,S=w+1,E=g.length;S<E;w+=1,S+=1)g[w]=g[S];g.pop()})(n,o);r.removeListener&&this.emit("removeListener",e,c||t)}return this},Nn.prototype.removeAllListeners=function(e){var t,n;if(!(n=this._events))return this;if(!n.removeListener)return arguments.length===0?(this._events=new id,this._eventsCount=0):n[e]&&(--this._eventsCount==0?this._events=new id:delete n[e]),this;if(arguments.length===0){for(var r,o=Object.keys(n),i=0;i<o.length;++i)(r=o[i])!=="removeListener"&&this.removeAllListeners(r);return this.removeAllListeners("removeListener"),this._events=new id,this._eventsCount=0,this}if(typeof(t=n[e])=="function")this.removeListener(e,t);else if(t)do this.removeListener(e,t[t.length-1]);while(t[0]);return this},Nn.prototype.listeners=function(e){var t,n,r=this._events;return n=r&&(t=r[e])?typeof t=="function"?[t.listener||t]:function(o){for(var i=new Array(o.length),c=0;c<i.length;++c)i[c]=o[c].listener||o[c];return i}(t):[],n},Nn.listenerCount=function(e,t){return typeof e.listenerCount=="function"?e.listenerCount(t):v_.call(e,t)},Nn.prototype.listenerCount=v_,Nn.prototype.eventNames=function(){return this._eventsCount>0?Reflect.ownKeys(this._events):[]};var t4=um(Object.freeze({__proto__:null,EventEmitter:Nn,default:Nn})),b_=t4.EventEmitter,od=typeof Object.create=="function"?function(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}:function(e,t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e},lI=/%[sdj%]/g;function vv(e){if(!fm(e)){for(var t=[],n=0;n<arguments.length;n++)t.push(Ou(arguments[n]));return t.join(" ")}n=1;for(var r=arguments,o=r.length,i=String(e).replace(lI,function(g){if(g==="%%")return"%";if(n>=o)return g;switch(g){case"%s":return String(r[n++]);case"%d":return Number(r[n++]);case"%j":try{return JSON.stringify(r[n++])}catch{return"[Circular]"}default:return g}}),c=r[n];n<o;c=r[++n])dm(c)||!zf(c)?i+=" "+c:i+=" "+Ou(c);return i}function bv(e,t){if(Nu(Pu.process))return function(){return bv(e,t).apply(this,arguments)};if(vr.noDeprecation===!0)return e;var n=!1;return function(){if(!n){if(vr.throwDeprecation)throw new Error(t);vr.traceDeprecation?console.trace(t):console.error(t),n=!0}return e.apply(this,arguments)}}var n4,yv={};function r4(e){return Nu(n4)&&(n4=vr.env.NODE_DEBUG||""),e=e.toUpperCase(),!yv[e]&&(new RegExp("\\b"+e+"\\b","i").test(n4)?yv[e]=function(){var t=vv.apply(null,arguments);console.error("%s %d: %s",e,0,t)}:yv[e]=function(){}),yv[e]}function Ou(e,t){var n={seen:[],stylize:dI};return arguments.length>=3&&(n.depth=arguments[2]),arguments.length>=4&&(n.colors=arguments[3]),_v(t)?n.showHidden=t:t&&c4(n,t),Nu(n.showHidden)&&(n.showHidden=!1),Nu(n.depth)&&(n.depth=2),Nu(n.colors)&&(n.colors=!1),Nu(n.customInspect)&&(n.customInspect=!0),n.colors&&(n.stylize=cI),wv(n,e,n.depth)}function cI(e,t){var n=Ou.styles[t];return n?"\x1B["+Ou.colors[n][0]+"m"+e+"\x1B["+Ou.colors[n][1]+"m":e}function dI(e,t){return e}function wv(e,t,n){if(e.customInspect&&t&&mm(t.inspect)&&t.inspect!==Ou&&(!t.constructor||t.constructor.prototype!==t)){var r=t.inspect(n,e);return fm(r)||(r=wv(e,r,n)),r}var o=function(T,I){if(Nu(I))return T.stylize("undefined","undefined");if(fm(I)){var j="'"+JSON.stringify(I).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return T.stylize(j,"string")}if(s4(I))return T.stylize(""+I,"number");if(_v(I))return T.stylize(""+I,"boolean");if(dm(I))return T.stylize("null","null")}(e,t);if(o)return o;var i=Object.keys(t),c=function(T){var I={};return T.forEach(function(j,H){I[j]=!0}),I}(i);if(e.showHidden&&(i=Object.getOwnPropertyNames(t)),pm(t)&&(i.indexOf("message")>=0||i.indexOf("description")>=0))return i4(t);if(i.length===0){if(mm(t)){var g=t.name?": "+t.name:"";return e.stylize("[Function"+g+"]","special")}if(hm(t))return e.stylize(RegExp.prototype.toString.call(t),"regexp");if(Sv(t))return e.stylize(Date.prototype.toString.call(t),"date");if(pm(t))return i4(t)}var _,w="",S=!1,E=["{","}"];return a4(t)&&(S=!0,E=["[","]"]),mm(t)&&(w=" [Function"+(t.name?": "+t.name:"")+"]"),hm(t)&&(w=" "+RegExp.prototype.toString.call(t)),Sv(t)&&(w=" "+Date.prototype.toUTCString.call(t)),pm(t)&&(w=" "+i4(t)),i.length!==0||S&&t.length!=0?n<0?hm(t)?e.stylize(RegExp.prototype.toString.call(t),"regexp"):e.stylize("[Object]","special"):(e.seen.push(t),_=S?function(T,I,j,H,V){for(var ee=[],X=0,ue=I.length;X<ue;++X)k_(I,String(X))?ee.push(o4(T,I,j,H,String(X),!0)):ee.push("");return V.forEach(function(le){le.match(/^\d+$/)||ee.push(o4(T,I,j,H,le,!0))}),ee}(e,t,n,c,i):i.map(function(T){return o4(e,t,n,c,T,S)}),e.seen.pop(),function(T,I,j){var H=T.reduce(function(V,ee){return ee.indexOf(`
|
|
4
4
|
`),V+ee.replace(/\u001b\[\d\d?m/g,"").length+1},0);return H>60?j[0]+(I===""?"":I+`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./W3MFrameProviderSingleton-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./W3MFrameProviderSingleton-QMvIDuQ9.cjs");function t(){if(typeof WebSocket<"u")return WebSocket;if(typeof e.global.WebSocket<"u")return e.global.WebSocket;if(typeof window.WebSocket<"u")return window.WebSocket;if(typeof self.WebSocket<"u")return self.WebSocket;throw new Error("`WebSocket` is not supported in this environment")}const o=t();exports.WebSocket=o;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { v, x as y, M as n,
|
|
2
|
-
const K =
|
|
1
|
+
import { v as g, x as y, M as n, h, O as f, b7 as C, p as m, D as k, y as S, R as c, V as x, Q as A, F as E, a as b, b as O, z as w, w as N, b8 as L } from "./W3MFrameProviderSingleton-ByMR2if0.js";
|
|
2
|
+
const K = g`
|
|
3
3
|
:host {
|
|
4
4
|
z-index: var(--w3m-z-index);
|
|
5
5
|
display: block;
|
|
@@ -124,17 +124,17 @@ const K = v`
|
|
|
124
124
|
}
|
|
125
125
|
}
|
|
126
126
|
`;
|
|
127
|
-
var d = function(u, e,
|
|
128
|
-
var
|
|
127
|
+
var d = function(u, e, i, t) {
|
|
128
|
+
var o = arguments.length, s = o < 3 ? e : t === null ? t = Object.getOwnPropertyDescriptor(e, i) : t, a;
|
|
129
129
|
if (typeof Reflect == "object" && typeof Reflect.decorate == "function")
|
|
130
|
-
|
|
130
|
+
s = Reflect.decorate(u, e, i, t);
|
|
131
131
|
else
|
|
132
|
-
for (var
|
|
133
|
-
(a = u[
|
|
134
|
-
return
|
|
132
|
+
for (var r = u.length - 1; r >= 0; r--)
|
|
133
|
+
(a = u[r]) && (s = (o < 3 ? a(s) : o > 3 ? a(e, i, s) : a(e, i)) || s);
|
|
134
|
+
return o > 3 && s && Object.defineProperty(e, i, s), s;
|
|
135
135
|
};
|
|
136
|
-
const
|
|
137
|
-
let
|
|
136
|
+
const v = "scroll-lock";
|
|
137
|
+
let l = class extends y {
|
|
138
138
|
constructor() {
|
|
139
139
|
super(), this.unsubscribe = [], this.abortController = void 0, this.open = n.state.open, this.caipAddress = h.state.activeCaipAddress, this.caipNetwork = h.state.activeCaipNetwork, this.isSiweEnabled = f.state.isSiweEnabled, this.shake = n.state.shake, this.initializeTheming(), C.prefetch(), this.unsubscribe.push(n.subscribeKey("open", (e) => e ? this.onOpen() : this.onClose()), n.subscribeKey("shake", (e) => this.shake = e), m.subscribeKey("siweStatus", (e) => this.onSiweStatusChange(e), "eip155"), h.subscribeKey("activeCaipNetwork", (e) => this.onNewNetwork(e)), h.subscribeKey("activeCaipAddress", (e) => this.onNewAddress(e)), f.subscribeKey("isSiweEnabled", (e) => this.isSiweEnabled = e)), k.sendEvent({ type: "track", event: "MODAL_LOADED" });
|
|
140
140
|
}
|
|
@@ -163,16 +163,16 @@ let r = class extends y {
|
|
|
163
163
|
e.target === e.currentTarget && await this.handleClose();
|
|
164
164
|
}
|
|
165
165
|
async handleClose() {
|
|
166
|
-
const e = c.state.view === "ConnectingSiwe",
|
|
166
|
+
const e = c.state.view === "ConnectingSiwe", i = c.state.view === "ApproveTransaction";
|
|
167
167
|
if (this.isSiweEnabled) {
|
|
168
|
-
const { SIWEController:
|
|
169
|
-
|
|
168
|
+
const { SIWEController: t } = await import("./index-6X8YJouh.js");
|
|
169
|
+
t.state.status !== "success" && (e || i) ? n.shake() : n.close();
|
|
170
170
|
} else
|
|
171
171
|
n.close();
|
|
172
172
|
}
|
|
173
173
|
initializeTheming() {
|
|
174
|
-
const { themeVariables: e, themeMode:
|
|
175
|
-
A(e,
|
|
174
|
+
const { themeVariables: e, themeMode: i } = L.state, t = x.getColorTheme(i);
|
|
175
|
+
A(e, t);
|
|
176
176
|
}
|
|
177
177
|
onClose() {
|
|
178
178
|
this.open = !1, this.classList.remove("open"), this.onScrollUnlock(), E.hide(), this.onRemoveKeyboardListener();
|
|
@@ -182,7 +182,7 @@ let r = class extends y {
|
|
|
182
182
|
}
|
|
183
183
|
onScrollLock() {
|
|
184
184
|
const e = document.createElement("style");
|
|
185
|
-
e.dataset.w3m =
|
|
185
|
+
e.dataset.w3m = v, e.textContent = `
|
|
186
186
|
body {
|
|
187
187
|
touch-action: none;
|
|
188
188
|
overflow: hidden;
|
|
@@ -194,19 +194,19 @@ let r = class extends y {
|
|
|
194
194
|
`, document.head.appendChild(e);
|
|
195
195
|
}
|
|
196
196
|
onScrollUnlock() {
|
|
197
|
-
const e = document.head.querySelector(`style[data-w3m="${
|
|
197
|
+
const e = document.head.querySelector(`style[data-w3m="${v}"]`);
|
|
198
198
|
e && e.remove();
|
|
199
199
|
}
|
|
200
200
|
onAddKeyboardListener() {
|
|
201
|
-
var
|
|
201
|
+
var i;
|
|
202
202
|
this.abortController = new AbortController();
|
|
203
|
-
const e = (
|
|
204
|
-
e == null || e.focus(), window.addEventListener("keydown", (
|
|
205
|
-
if (
|
|
203
|
+
const e = (i = this.shadowRoot) == null ? void 0 : i.querySelector("wui-card");
|
|
204
|
+
e == null || e.focus(), window.addEventListener("keydown", (t) => {
|
|
205
|
+
if (t.key === "Escape")
|
|
206
206
|
this.handleClose();
|
|
207
|
-
else if (
|
|
208
|
-
const { tagName:
|
|
209
|
-
|
|
207
|
+
else if (t.key === "Tab") {
|
|
208
|
+
const { tagName: o } = t.target;
|
|
209
|
+
o && !o.includes("W3M-") && !o.includes("WUI-") && (e == null || e.focus());
|
|
210
210
|
}
|
|
211
211
|
}, this.abortController);
|
|
212
212
|
}
|
|
@@ -219,24 +219,24 @@ let r = class extends y {
|
|
|
219
219
|
}
|
|
220
220
|
async onNewAddress(e) {
|
|
221
221
|
var s;
|
|
222
|
-
const
|
|
223
|
-
if (this.isSiweEnabled) {
|
|
224
|
-
const { SIWEController:
|
|
225
|
-
!
|
|
222
|
+
const i = this.caipAddress ? b.getPlainAddress(this.caipAddress) : void 0, t = e ? b.getPlainAddress(e) : void 0;
|
|
223
|
+
if (t && !(i === t) && this.isSiweEnabled) {
|
|
224
|
+
const { SIWEController: a } = await import("./index-6X8YJouh.js"), r = m.state.siweStatus === "success";
|
|
225
|
+
!i && t ? this.onSiweNavigation() : r && i && t && i !== t && (s = a.state._client) != null && s.options.signOutOnAccountChange && (await a.signOut(), this.onSiweNavigation());
|
|
226
226
|
}
|
|
227
|
-
this.caipAddress = e;
|
|
227
|
+
t || n.close(), this.caipAddress = e;
|
|
228
228
|
}
|
|
229
229
|
async onNewNetwork(e) {
|
|
230
|
-
var
|
|
230
|
+
var o, s, a, r;
|
|
231
231
|
if (!this.caipAddress) {
|
|
232
232
|
this.caipNetwork = e;
|
|
233
233
|
return;
|
|
234
234
|
}
|
|
235
|
-
const
|
|
236
|
-
if (
|
|
235
|
+
const i = (s = (o = this.caipNetwork) == null ? void 0 : o.id) == null ? void 0 : s.toString(), t = (a = e == null ? void 0 : e.id) == null ? void 0 : a.toString();
|
|
236
|
+
if (i && t && i !== t)
|
|
237
237
|
if (this.isSiweEnabled) {
|
|
238
|
-
const { SIWEController: p } = await import("./index-
|
|
239
|
-
(
|
|
238
|
+
const { SIWEController: p } = await import("./index-6X8YJouh.js");
|
|
239
|
+
(r = p.state._client) != null && r.options.signOutOnNetworkChange ? (await p.signOut(), this.onSiweNavigation()) : c.goBack();
|
|
240
240
|
} else
|
|
241
241
|
c.goBack();
|
|
242
242
|
this.caipNetwork = e;
|
|
@@ -248,25 +248,25 @@ let r = class extends y {
|
|
|
248
248
|
}) : c.goBack();
|
|
249
249
|
}
|
|
250
250
|
};
|
|
251
|
-
|
|
251
|
+
l.styles = K;
|
|
252
252
|
d([
|
|
253
253
|
w()
|
|
254
|
-
],
|
|
254
|
+
], l.prototype, "open", void 0);
|
|
255
255
|
d([
|
|
256
256
|
w()
|
|
257
|
-
],
|
|
257
|
+
], l.prototype, "caipAddress", void 0);
|
|
258
258
|
d([
|
|
259
259
|
w()
|
|
260
|
-
],
|
|
260
|
+
], l.prototype, "caipNetwork", void 0);
|
|
261
261
|
d([
|
|
262
262
|
w()
|
|
263
|
-
],
|
|
263
|
+
], l.prototype, "isSiweEnabled", void 0);
|
|
264
264
|
d([
|
|
265
265
|
w()
|
|
266
|
-
],
|
|
267
|
-
|
|
266
|
+
], l.prototype, "shake", void 0);
|
|
267
|
+
l = d([
|
|
268
268
|
N("w3m-modal")
|
|
269
|
-
],
|
|
269
|
+
], l);
|
|
270
270
|
export {
|
|
271
|
-
|
|
271
|
+
l as W3mModal
|
|
272
272
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./W3MFrameProviderSingleton-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./W3MFrameProviderSingleton-QMvIDuQ9.cjs"),u=t.i`
|
|
2
2
|
:host {
|
|
3
3
|
z-index: var(--w3m-z-index);
|
|
4
4
|
display: block;
|
|
@@ -122,7 +122,7 @@
|
|
|
122
122
|
height: var(--new-height);
|
|
123
123
|
}
|
|
124
124
|
}
|
|
125
|
-
`;var l=function(d,e,o
|
|
125
|
+
`;var l=function(d,e,i,o){var r=arguments.length,s=r<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,i):o,n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")s=Reflect.decorate(d,e,i,o);else for(var a=d.length-1;a>=0;a--)(n=d[a])&&(s=(r<3?n(s):r>3?n(e,i,s):n(e,i))||s);return r>3&&s&&Object.defineProperty(e,i,s),s};const h="scroll-lock";exports.W3mModal=class extends t.h{constructor(){super(),this.unsubscribe=[],this.abortController=void 0,this.open=t.ModalController.state.open,this.caipAddress=t.ChainController.state.activeCaipAddress,this.caipNetwork=t.ChainController.state.activeCaipNetwork,this.isSiweEnabled=t.OptionsController.state.isSiweEnabled,this.shake=t.ModalController.state.shake,this.initializeTheming(),t.ApiController.prefetch(),this.unsubscribe.push(t.ModalController.subscribeKey("open",e=>e?this.onOpen():this.onClose()),t.ModalController.subscribeKey("shake",e=>this.shake=e),t.AccountController.subscribeKey("siweStatus",e=>this.onSiweStatusChange(e),"eip155"),t.ChainController.subscribeKey("activeCaipNetwork",e=>this.onNewNetwork(e)),t.ChainController.subscribeKey("activeCaipAddress",e=>this.onNewAddress(e)),t.OptionsController.subscribeKey("isSiweEnabled",e=>this.isSiweEnabled=e)),t.EventsController.sendEvent({type:"track",event:"MODAL_LOADED"})}disconnectedCallback(){this.unsubscribe.forEach(e=>e()),this.onRemoveKeyboardListener()}render(){return this.open?t.ke`
|
|
126
126
|
<wui-flex @click=${this.onOverlayClick.bind(this)} data-testid="w3m-modal-overlay">
|
|
127
127
|
<wui-card
|
|
128
128
|
shake="${this.shake}"
|
|
@@ -137,7 +137,7 @@
|
|
|
137
137
|
</wui-card>
|
|
138
138
|
</wui-flex>
|
|
139
139
|
<w3m-tooltip></w3m-tooltip>
|
|
140
|
-
`:null}async onOverlayClick(e){e.target===e.currentTarget&&await this.handleClose()}async handleClose(){const e=t.RouterController.state.view==="ConnectingSiwe",
|
|
140
|
+
`:null}async onOverlayClick(e){e.target===e.currentTarget&&await this.handleClose()}async handleClose(){const e=t.RouterController.state.view==="ConnectingSiwe",i=t.RouterController.state.view==="ApproveTransaction";if(this.isSiweEnabled){const{SIWEController:o}=await Promise.resolve().then(()=>require("./index-D5Be_LRa.cjs"));o.state.status!=="success"&&(e||i)?t.ModalController.shake():t.ModalController.close()}else t.ModalController.close()}initializeTheming(){const{themeVariables:e,themeMode:i}=t.ThemeController.state,o=t.UiHelperUtil.getColorTheme(i);t.initializeTheming(e,o)}onClose(){this.open=!1,this.classList.remove("open"),this.onScrollUnlock(),t.SnackController.hide(),this.onRemoveKeyboardListener()}onOpen(){this.open=!0,this.classList.add("open"),this.onScrollLock(),this.onAddKeyboardListener()}onScrollLock(){const e=document.createElement("style");e.dataset.w3m=h,e.textContent=`
|
|
141
141
|
body {
|
|
142
142
|
touch-action: none;
|
|
143
143
|
overflow: hidden;
|
|
@@ -146,4 +146,4 @@
|
|
|
146
146
|
w3m-modal {
|
|
147
147
|
pointer-events: auto;
|
|
148
148
|
}
|
|
149
|
-
`,document.head.appendChild(e)}onScrollUnlock(){const e=document.head.querySelector(`style[data-w3m="${h}"]`);e&&e.remove()}onAddKeyboardListener(){var
|
|
149
|
+
`,document.head.appendChild(e)}onScrollUnlock(){const e=document.head.querySelector(`style[data-w3m="${h}"]`);e&&e.remove()}onAddKeyboardListener(){var i;this.abortController=new AbortController;const e=(i=this.shadowRoot)==null?void 0:i.querySelector("wui-card");e==null||e.focus(),window.addEventListener("keydown",o=>{if(o.key==="Escape")this.handleClose();else if(o.key==="Tab"){const{tagName:r}=o.target;r&&!r.includes("W3M-")&&!r.includes("WUI-")&&(e==null||e.focus())}},this.abortController)}onRemoveKeyboardListener(){var e;(e=this.abortController)==null||e.abort(),this.abortController=void 0}onSiweStatusChange(e){e==="success"&&t.ModalController.close()}async onNewAddress(e){var s;const i=this.caipAddress?t.CoreHelperUtil.getPlainAddress(this.caipAddress):void 0,o=e?t.CoreHelperUtil.getPlainAddress(e):void 0;if(o&&!(i===o)&&this.isSiweEnabled){const{SIWEController:n}=await Promise.resolve().then(()=>require("./index-D5Be_LRa.cjs")),a=t.AccountController.state.siweStatus==="success";!i&&o?this.onSiweNavigation():a&&i&&o&&i!==o&&(s=n.state._client)!=null&&s.options.signOutOnAccountChange&&(await n.signOut(),this.onSiweNavigation())}o||t.ModalController.close(),this.caipAddress=e}async onNewNetwork(e){var r,s,n,a;if(!this.caipAddress){this.caipNetwork=e;return}const i=(s=(r=this.caipNetwork)==null?void 0:r.id)==null?void 0:s.toString(),o=(n=e==null?void 0:e.id)==null?void 0:n.toString();if(i&&o&&i!==o)if(this.isSiweEnabled){const{SIWEController:c}=await Promise.resolve().then(()=>require("./index-D5Be_LRa.cjs"));(a=c.state._client)!=null&&a.options.signOutOnNetworkChange?(await c.signOut(),this.onSiweNavigation()):t.RouterController.goBack()}else t.RouterController.goBack();this.caipNetwork=e}onSiweNavigation(){const e=t.ChainController.state.activeChain===t.ConstantsUtil$1.CHAIN.EVM;!(t.AccountController.state.siweStatus==="success")&&e?this.open?t.RouterController.replace("ConnectingSiwe"):t.ModalController.open({view:"ConnectingSiwe"}):t.RouterController.goBack()}};exports.W3mModal.styles=u;l([t.r()],exports.W3mModal.prototype,"open",void 0);l([t.r()],exports.W3mModal.prototype,"caipAddress",void 0);l([t.r()],exports.W3mModal.prototype,"caipNetwork",void 0);l([t.r()],exports.W3mModal.prototype,"isSiweEnabled",void 0);l([t.r()],exports.W3mModal.prototype,"shake",void 0);exports.W3mModal=l([t.customElement("w3m-modal")],exports.W3mModal);
|