@frak-labs/components 0.0.4 → 0.0.5
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/README.md +1 -1
- package/cdn/components.js +17 -0
- package/package.json +17 -11
- package/dist/bundle/components.js +0 -17
package/README.md
CHANGED
|
@@ -15,7 +15,7 @@ To have more info about how does it works under the hood, you can check [this](h
|
|
|
15
15
|
Add the following script tag to your HTML file:
|
|
16
16
|
|
|
17
17
|
```html
|
|
18
|
-
<script src="https://cdn.jsdelivr.net/npm/@frak-labs/components
|
|
18
|
+
<script src="https://cdn.jsdelivr.net/npm/@frak-labs/components" defer="defer"></script>
|
|
19
19
|
```
|
|
20
20
|
|
|
21
21
|
## Quick start
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";var FrakComponents=(()=>{var Ho=Object.create;var Se=Object.defineProperty;var Lo=Object.getOwnPropertyDescriptor;var Uo=Object.getOwnPropertyNames;var Do=Object.getPrototypeOf,Oo=Object.prototype.hasOwnProperty;var Yt=(e=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(e,{get:(t,r)=>(typeof require<"u"?require:t)[r]}):e)(function(e){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+e+'" is not supported')});var B=(e,t)=>()=>(e&&(t=e(e=0)),t);var Zt=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),zo=(e,t)=>{for(var r in t)Se(e,r,{get:t[r],enumerable:!0})},Qt=(e,t,r,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of Uo(t))!Oo.call(e,n)&&n!==r&&Se(e,n,{get:()=>t[n],enumerable:!(o=Lo(t,n))||o.enumerable});return e};var Fe=(e,t,r)=>(r=e!=null?Ho(Do(e)):{},Qt(t||!e||!e.__esModule?Se(r,"default",{value:e,enumerable:!0}):r,e)),No=e=>Qt(Se({},"__esModule",{value:!0}),e);var rt=Zt((se,tt)=>{"use strict";(function(e,t){if(typeof se=="object"&&typeof tt=="object")tt.exports=t();else if(typeof define=="function"&&define.amd)define([],t);else{var r=t();for(var o in r)(typeof se=="object"?se:e)[o]=r[o]}})(se,()=>(()=>{"use strict";var e={48:function(r,o,n){var a=this&&this.__awaiter||function(u,y,i,p){return new(i||(i=Promise))(function(b,F){function g(h){try{R(p.next(h))}catch(_){F(_)}}function T(h){try{R(p.throw(h))}catch(_){F(_)}}function R(h){var _;h.done?b(h.value):(_=h.value,_ instanceof i?_:new i(function(E){E(_)})).then(g,T)}R((p=p.apply(u,y||[])).next())})},c=this&&this.__generator||function(u,y){var i,p,b,F,g={label:0,sent:function(){if(1&b[0])throw b[1];return b[1]},trys:[],ops:[]};return F={next:T(0),throw:T(1),return:T(2)},typeof Symbol=="function"&&(F[Symbol.iterator]=function(){return this}),F;function T(R){return function(h){return function(_){if(i)throw new TypeError("Generator is already executing.");for(;F&&(F=0,_[0]&&(g=0)),g;)try{if(i=1,p&&(b=2&_[0]?p.return:_[0]?p.throw||((b=p.return)&&b.call(p),0):p.next)&&!(b=b.call(p,_[1])).done)return b;switch(p=0,b&&(_=[2&_[0],b.value]),_[0]){case 0:case 1:b=_;break;case 4:return g.label++,{value:_[1],done:!1};case 5:g.label++,p=_[1],_=[0];continue;case 7:_=g.ops.pop(),g.trys.pop();continue;default:if(!((b=(b=g.trys).length>0&&b[b.length-1])||_[0]!==6&&_[0]!==2)){g=0;continue}if(_[0]===3&&(!b||_[1]>b[0]&&_[1]<b[3])){g.label=_[1];break}if(_[0]===6&&g.label<b[1]){g.label=b[1],b=_;break}if(b&&g.label<b[2]){g.label=b[2],g.ops.push(_);break}b[2]&&g.ops.pop(),g.trys.pop();continue}_=y.call(u,g)}catch(E){_=[6,E],p=0}finally{i=b=0}if(5&_[0])throw _[1];return{value:_[0]?_[1]:void 0,done:!0}}([R,h])}}};Object.defineProperty(o,"__esModule",{value:!0}),o.decompressFromUTF16=o.compressToUTF16=o.decompressFromBase64=o.compressToBase64=void 0;var f=n(304),l=n(134),x=new f.CompressorImpl,d=new l.DecompressorImpl,s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",m={};o.compressToBase64=function(u){return a(this,void 0,void 0,function(){var y;return c(this,function(i){switch(i.label){case 0:return u===null?[2,""]:[4,x.compress(u,6,function(p){return s.charAt(p)})];case 1:switch((y=i.sent()).length%4){default:case 0:return[2,y];case 1:return[2,y+"==="];case 2:return[2,y+"=="];case 3:return[2,y+"="]}return[2]}})})},o.decompressFromBase64=function(u){return a(this,void 0,void 0,function(){return c(this,function(y){switch(y.label){case 0:return u===null?[2,""]:u===""?[2,null]:[4,d.decompress(u.length,32,function(i){return function(p,b){if(!m[p]){m[p]={};for(var F=0;F<p.length;F++)m[p][p.charAt(F)]=F}return m[p][b]}(s,u.charAt(i))})];case 1:return[2,y.sent()]}})})},o.compressToUTF16=function(u){return a(this,void 0,void 0,function(){return c(this,function(y){switch(y.label){case 0:return u===null?[2,""]:[4,x.compress(u,15,function(i){return String.fromCharCode(i+32)})];case 1:return[2,y.sent()+" "]}})})},o.decompressFromUTF16=function(u){return a(this,void 0,void 0,function(){return c(this,function(y){switch(y.label){case 0:return u===null?[2,""]:u===""?[2,null]:[4,d.decompress(u.length,16384,function(i){return u.charCodeAt(i)-32})];case 1:return[2,y.sent()]}})})}},304:function(r,o,n){var a=this&&this.__awaiter||function(d,s,m,u){return new(m||(m=Promise))(function(y,i){function p(g){try{F(u.next(g))}catch(T){i(T)}}function b(g){try{F(u.throw(g))}catch(T){i(T)}}function F(g){var T;g.done?y(g.value):(T=g.value,T instanceof m?T:new m(function(R){R(T)})).then(p,b)}F((u=u.apply(d,s||[])).next())})},c=this&&this.__generator||function(d,s){var m,u,y,i,p={label:0,sent:function(){if(1&y[0])throw y[1];return y[1]},trys:[],ops:[]};return i={next:b(0),throw:b(1),return:b(2)},typeof Symbol=="function"&&(i[Symbol.iterator]=function(){return this}),i;function b(F){return function(g){return function(T){if(m)throw new TypeError("Generator is already executing.");for(;i&&(i=0,T[0]&&(p=0)),p;)try{if(m=1,u&&(y=2&T[0]?u.return:T[0]?u.throw||((y=u.return)&&y.call(u),0):u.next)&&!(y=y.call(u,T[1])).done)return y;switch(u=0,y&&(T=[2&T[0],y.value]),T[0]){case 0:case 1:y=T;break;case 4:return p.label++,{value:T[1],done:!1};case 5:p.label++,u=T[1],T=[0];continue;case 7:T=p.ops.pop(),p.trys.pop();continue;default:if(!((y=(y=p.trys).length>0&&y[y.length-1])||T[0]!==6&&T[0]!==2)){p=0;continue}if(T[0]===3&&(!y||T[1]>y[0]&&T[1]<y[3])){p.label=T[1];break}if(T[0]===6&&p.label<y[1]){p.label=y[1],y=T;break}if(y&&p.label<y[2]){p.label=y[2],p.ops.push(T);break}y[2]&&p.ops.pop(),p.trys.pop();continue}T=s.call(d,p)}catch(R){T=[6,R],u=0}finally{m=y=0}if(5&T[0])throw T[1];return{value:T[0]?T[1]:void 0,done:!0}}([F,g])}}};Object.defineProperty(o,"__esModule",{value:!0}),o.CompressorImpl=void 0;var f=n(658),l=[0,8,4,12,2,10,6,14,1,9,5,13,3,11,7,15],x=function(){function d(){}return d.writeValueToData=function(s,m,u,y,i){if(u%4!=0||s.dataPosition+u>y-1)for(var p=0;p<u;p++)s.dataVal=s.dataVal<<1|1&m,s.dataPosition==y-1?(s.dataPosition=0,s.data.push(i(s.dataVal)),s.dataVal=0):s.dataPosition++,m>>=1;else s.dataVal<<=u,s.dataVal|=function(b,F){for(var g=0,T=0;T<F;++T)g<<=4,g|=l[15&b],b>>=4;return g}(m,u/4),s.dataPosition+=u},d.writeWToDataVal=function(s,m,u){s.dictionaryToCreate.has(s.w)?(s.w.charCodeAt(0)<256?(d.writeValueToData(s,0,s.numBits,m,u),d.writeValueToData(s,s.w.charCodeAt(0),8,m,u)):(d.writeValueToData(s,1,s.numBits,m,u),d.writeValueToData(s,s.w.charCodeAt(0),16,m,u)),s.enlargeIn--,s.enlargeIn==0&&(s.enlargeIn=Math.pow(2,s.numBits),s.numBits++),s.dictionaryToCreate.delete(s.w)):d.writeValueToData(s,s.dictionary.get(s.w),s.numBits,m,u),s.enlargeIn--,s.enlargeIn==0&&(s.enlargeIn=Math.pow(2,s.numBits),s.numBits++)},d.loopIteration=function(s,m,u,y,i){var p=s.charAt(m);i.dictionary.has(p)||(i.dictionary.set(p,i.dictSize++),i.dictionaryToCreate.set(p,!0));var b=i.w+p;i.dictionary.has(b)?i.w=b:(this.writeWToDataVal(i,u,y),i.dictionary.set(b,i.dictSize++),i.w=String(p))},d.prototype.compress=function(s,m,u){var y=this;return new Promise(function(i){return a(y,void 0,void 0,function(){var p,b;return c(this,function(F){switch(F.label){case 0:if(s==null)return i(""),[2];p={data:[],dataPosition:0,dataVal:0,dictionary:new Map,dictionaryToCreate:new Map,dictSize:3,enlargeIn:2,numBits:2,w:""},b=0,F.label=1;case 1:return b<s.length?(d.loopIteration(s,b,m,u,p),b%1e4!=0?[3,3]:[4,(0,f.wait)()]):[3,4];case 2:F.sent(),F.label=3;case 3:return b+=1,[3,1];case 4:return p.w!==""&&d.writeWToDataVal(p,m,u),d.writeValueToData(p,2,p.numBits,m,u),p.dataVal<<=m-p.dataPosition,p.data.push(u(p.dataVal)),i(p.data.join("")),[2]}})})})},d}();o.CompressorImpl=x},134:function(r,o,n){var a=this&&this.__awaiter||function(x,d,s,m){return new(s||(s=Promise))(function(u,y){function i(F){try{b(m.next(F))}catch(g){y(g)}}function p(F){try{b(m.throw(F))}catch(g){y(g)}}function b(F){var g;F.done?u(F.value):(g=F.value,g instanceof s?g:new s(function(T){T(g)})).then(i,p)}b((m=m.apply(x,d||[])).next())})},c=this&&this.__generator||function(x,d){var s,m,u,y,i={label:0,sent:function(){if(1&u[0])throw u[1];return u[1]},trys:[],ops:[]};return y={next:p(0),throw:p(1),return:p(2)},typeof Symbol=="function"&&(y[Symbol.iterator]=function(){return this}),y;function p(b){return function(F){return function(g){if(s)throw new TypeError("Generator is already executing.");for(;y&&(y=0,g[0]&&(i=0)),i;)try{if(s=1,m&&(u=2&g[0]?m.return:g[0]?m.throw||((u=m.return)&&u.call(m),0):m.next)&&!(u=u.call(m,g[1])).done)return u;switch(m=0,u&&(g=[2&g[0],u.value]),g[0]){case 0:case 1:u=g;break;case 4:return i.label++,{value:g[1],done:!1};case 5:i.label++,m=g[1],g=[0];continue;case 7:g=i.ops.pop(),i.trys.pop();continue;default:if(!((u=(u=i.trys).length>0&&u[u.length-1])||g[0]!==6&&g[0]!==2)){i=0;continue}if(g[0]===3&&(!u||g[1]>u[0]&&g[1]<u[3])){i.label=g[1];break}if(g[0]===6&&i.label<u[1]){i.label=u[1],u=g;break}if(u&&i.label<u[2]){i.label=u[2],i.ops.push(g);break}u[2]&&i.ops.pop(),i.trys.pop();continue}g=d.call(x,i)}catch(T){g=[6,T],m=0}finally{s=u=0}if(5&g[0])throw g[1];return{value:g[0]?g[1]:void 0,done:!0}}([b,F])}}};Object.defineProperty(o,"__esModule",{value:!0}),o.DecompressorImpl=void 0;var f=n(658),l=function(){function x(){}return x.prototype.decompress=function(d,s,m){var u=this;return new Promise(function(y){return a(u,void 0,void 0,function(){var i,p,b;return c(this,function(F){switch(F.label){case 0:for(i={bits:0,c:null,dataIndex:1,dataPosition:s,dataVal:m(0),dictionary:new Map,dictSize:4,enlargeIn:4,entry:"",maxPower:Math.pow(2,2),numBits:3,power:1,resb:null,result:[],w:null},p=0;p<3;p+=1)i.dictionary.set(p,p);for(;i.power!=i.maxPower;)i.resb=i.dataVal&i.dataPosition,i.dataPosition>>=1,i.dataPosition==0&&(i.dataPosition=s,i.dataVal=m(i.dataIndex++)),i.bits|=(i.resb>0?1:0)*i.power,i.power<<=1;switch(i.bits){case 0:for(i.bits=0,i.maxPower=Math.pow(2,8),i.power=1;i.power!=i.maxPower;)i.resb=i.dataVal&i.dataPosition,i.dataPosition>>=1,i.dataPosition==0&&(i.dataPosition=s,i.dataVal=m(i.dataIndex++)),i.bits|=(i.resb>0?1:0)*i.power,i.power<<=1;i.c=String.fromCharCode(i.bits);break;case 1:for(i.bits=0,i.maxPower=Math.pow(2,16),i.power=1;i.power!==i.maxPower;)i.resb=i.dataVal&i.dataPosition,i.dataPosition>>=1,i.dataPosition===0&&(i.dataPosition=s,i.dataVal=m(i.dataIndex++)),i.bits|=(i.resb>0?1:0)*i.power,i.power<<=1;i.c=String.fromCharCode(i.bits);break;case 2:return y(""),[2]}i.dictionary[3]=i.c,i.w=i.c,i.result.push(i.c),b=1,F.label=1;case 1:return b%2e4!=0?[3,3]:[4,(0,f.wait)()];case 2:F.sent(),F.label=3;case 3:if(i.dataIndex>d)return y(""),[2];for(i.bits=0,i.maxPower=Math.pow(2,i.numBits),i.power=1;i.power!=i.maxPower;)i.resb=i.dataVal&i.dataPosition,i.dataPosition>>=1,i.dataPosition==0&&(i.dataPosition=s,i.dataVal=m(i.dataIndex++)),i.bits|=(i.resb>0?1:0)*i.power,i.power<<=1;switch(i.c=i.bits){case 0:for(i.bits=0,i.maxPower=Math.pow(2,8),i.power=1;i.power!==i.maxPower;)i.resb=i.dataVal&i.dataPosition,i.dataPosition>>=1,i.dataPosition==0&&(i.dataPosition=s,i.dataVal=m(i.dataIndex++)),i.bits|=(i.resb>0?1:0)*i.power,i.power<<=1;i.dictionary[i.dictSize++]=String.fromCharCode(i.bits),i.c=i.dictSize-1,i.enlargeIn--;break;case 1:for(i.bits=0,i.maxPower=Math.pow(2,16),i.power=1;i.power!==i.maxPower;)i.resb=i.dataVal&i.dataPosition,i.dataPosition>>=1,i.dataPosition==0&&(i.dataPosition=s,i.dataVal=m(i.dataIndex++)),i.bits|=(i.resb>0?1:0)*i.power,i.power<<=1;i.dictionary[i.dictSize++]=String.fromCharCode(i.bits),i.c=i.dictSize-1,i.enlargeIn--;break;case 2:return y(i.result.join("")),[2]}if(i.enlargeIn==0&&(i.enlargeIn=Math.pow(2,i.numBits),i.numBits++),i.dictionary[i.c])i.entry=i.dictionary[i.c];else{if(i.c!==i.dictSize)return y(null),[2];i.entry=i.w+i.w.charAt(0)}return i.result.push(i.entry),i.dictionary[i.dictSize++]=i.w+i.entry.charAt(0),i.enlargeIn--,i.w=i.entry,i.enlargeIn==0&&(i.enlargeIn=Math.pow(2,i.numBits),i.numBits++),b++,[3,1];case 4:return[2]}})})})},x}();o.DecompressorImpl=l},658:function(r,o){var n=this&&this.__awaiter||function(c,f,l,x){return new(l||(l=Promise))(function(d,s){function m(i){try{y(x.next(i))}catch(p){s(p)}}function u(i){try{y(x.throw(i))}catch(p){s(p)}}function y(i){var p;i.done?d(i.value):(p=i.value,p instanceof l?p:new l(function(b){b(p)})).then(m,u)}y((x=x.apply(c,f||[])).next())})},a=this&&this.__generator||function(c,f){var l,x,d,s,m={label:0,sent:function(){if(1&d[0])throw d[1];return d[1]},trys:[],ops:[]};return s={next:u(0),throw:u(1),return:u(2)},typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function u(y){return function(i){return function(p){if(l)throw new TypeError("Generator is already executing.");for(;s&&(s=0,p[0]&&(m=0)),m;)try{if(l=1,x&&(d=2&p[0]?x.return:p[0]?x.throw||((d=x.return)&&d.call(x),0):x.next)&&!(d=d.call(x,p[1])).done)return d;switch(x=0,d&&(p=[2&p[0],d.value]),p[0]){case 0:case 1:d=p;break;case 4:return m.label++,{value:p[1],done:!1};case 5:m.label++,x=p[1],p=[0];continue;case 7:p=m.ops.pop(),m.trys.pop();continue;default:if(!((d=(d=m.trys).length>0&&d[d.length-1])||p[0]!==6&&p[0]!==2)){m=0;continue}if(p[0]===3&&(!d||p[1]>d[0]&&p[1]<d[3])){m.label=p[1];break}if(p[0]===6&&m.label<d[1]){m.label=d[1],d=p;break}if(d&&m.label<d[2]){m.label=d[2],m.ops.push(p);break}d[2]&&m.ops.pop(),m.trys.pop();continue}p=f.call(c,m)}catch(b){p=[6,b],x=0}finally{l=d=0}if(5&p[0])throw p[1];return{value:p[0]?p[1]:void 0,done:!0}}([y,i])}}};Object.defineProperty(o,"__esModule",{value:!0}),o.wait=void 0,o.wait=function(){return n(this,void 0,void 0,function(){return a(this,function(c){return[2,new Promise(function(f){setTimeout(f,0)})]})})}}},t={};return function r(o){var n=t[o];if(n!==void 0)return n.exports;var a=t[o]={exports:{}};return e[o].call(a.exports,a,a.exports,r),a.exports}(48)})())});var ot=Zt((Un,Ee)=>{"use strict";(function(){"use strict";var e="input is invalid type",t=typeof window=="object",r=t?window:{};r.JS_SHA256_NO_WINDOW&&(t=!1);var o=!t&&typeof self=="object",n=!r.JS_SHA256_NO_NODE_JS&&typeof process=="object"&&process.versions&&process.versions.node;n?r=global:o&&(r=self);var a=!r.JS_SHA256_NO_COMMON_JS&&typeof Ee=="object"&&Ee.exports,c=typeof define=="function"&&define.amd,f=!r.JS_SHA256_NO_ARRAY_BUFFER&&typeof ArrayBuffer<"u",l="0123456789abcdef".split(""),x=[-2147483648,8388608,32768,128],d=[24,16,8,0],s=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],m=["hex","array","digest","arrayBuffer"],u=[];(r.JS_SHA256_NO_NODE_JS||!Array.isArray)&&(Array.isArray=function(h){return Object.prototype.toString.call(h)==="[object Array]"}),f&&(r.JS_SHA256_NO_ARRAY_BUFFER_IS_VIEW||!ArrayBuffer.isView)&&(ArrayBuffer.isView=function(h){return typeof h=="object"&&h.buffer&&h.buffer.constructor===ArrayBuffer});var y=function(h,_){return function(E){return new g(_,!0).update(E)[h]()}},i=function(h){var _=y("hex",h);n&&(_=p(_,h)),_.create=function(){return new g(h)},_.update=function(I){return _.create().update(I)};for(var E=0;E<m.length;++E){var S=m[E];_[S]=y(S,h)}return _},p=function(h,_){var E=Yt("crypto"),S=Yt("buffer").Buffer,I=_?"sha224":"sha256",w;S.from&&!r.JS_SHA256_NO_BUFFER_FROM?w=S.from:w=function(v){return new S(v)};var C=function(v){if(typeof v=="string")return E.createHash(I).update(v,"utf8").digest("hex");if(v==null)throw new Error(e);return v.constructor===ArrayBuffer&&(v=new Uint8Array(v)),Array.isArray(v)||ArrayBuffer.isView(v)||v.constructor===S?E.createHash(I).update(w(v)).digest("hex"):h(v)};return C},b=function(h,_){return function(E,S){return new T(E,_,!0).update(S)[h]()}},F=function(h){var _=b("hex",h);_.create=function(I){return new T(I,h)},_.update=function(I,w){return _.create(I).update(w)};for(var E=0;E<m.length;++E){var S=m[E];_[S]=b(S,h)}return _};function g(h,_){_?(u[0]=u[16]=u[1]=u[2]=u[3]=u[4]=u[5]=u[6]=u[7]=u[8]=u[9]=u[10]=u[11]=u[12]=u[13]=u[14]=u[15]=0,this.blocks=u):this.blocks=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],h?(this.h0=3238371032,this.h1=914150663,this.h2=812702999,this.h3=4144912697,this.h4=4290775857,this.h5=1750603025,this.h6=1694076839,this.h7=3204075428):(this.h0=1779033703,this.h1=3144134277,this.h2=1013904242,this.h3=2773480762,this.h4=1359893119,this.h5=2600822924,this.h6=528734635,this.h7=1541459225),this.block=this.start=this.bytes=this.hBytes=0,this.finalized=this.hashed=!1,this.first=!0,this.is224=h}g.prototype.update=function(h){if(!this.finalized){var _,E=typeof h;if(E!=="string"){if(E==="object"){if(h===null)throw new Error(e);if(f&&h.constructor===ArrayBuffer)h=new Uint8Array(h);else if(!Array.isArray(h)&&(!f||!ArrayBuffer.isView(h)))throw new Error(e)}else throw new Error(e);_=!0}for(var S,I=0,w,C=h.length,v=this.blocks;I<C;){if(this.hashed&&(this.hashed=!1,v[0]=this.block,this.block=v[16]=v[1]=v[2]=v[3]=v[4]=v[5]=v[6]=v[7]=v[8]=v[9]=v[10]=v[11]=v[12]=v[13]=v[14]=v[15]=0),_)for(w=this.start;I<C&&w<64;++I)v[w>>>2]|=h[I]<<d[w++&3];else for(w=this.start;I<C&&w<64;++I)S=h.charCodeAt(I),S<128?v[w>>>2]|=S<<d[w++&3]:S<2048?(v[w>>>2]|=(192|S>>>6)<<d[w++&3],v[w>>>2]|=(128|S&63)<<d[w++&3]):S<55296||S>=57344?(v[w>>>2]|=(224|S>>>12)<<d[w++&3],v[w>>>2]|=(128|S>>>6&63)<<d[w++&3],v[w>>>2]|=(128|S&63)<<d[w++&3]):(S=65536+((S&1023)<<10|h.charCodeAt(++I)&1023),v[w>>>2]|=(240|S>>>18)<<d[w++&3],v[w>>>2]|=(128|S>>>12&63)<<d[w++&3],v[w>>>2]|=(128|S>>>6&63)<<d[w++&3],v[w>>>2]|=(128|S&63)<<d[w++&3]);this.lastByteIndex=w,this.bytes+=w-this.start,w>=64?(this.block=v[16],this.start=w-64,this.hash(),this.hashed=!0):this.start=w}return this.bytes>4294967295&&(this.hBytes+=this.bytes/4294967296<<0,this.bytes=this.bytes%4294967296),this}},g.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var h=this.blocks,_=this.lastByteIndex;h[16]=this.block,h[_>>>2]|=x[_&3],this.block=h[16],_>=56&&(this.hashed||this.hash(),h[0]=this.block,h[16]=h[1]=h[2]=h[3]=h[4]=h[5]=h[6]=h[7]=h[8]=h[9]=h[10]=h[11]=h[12]=h[13]=h[14]=h[15]=0),h[14]=this.hBytes<<3|this.bytes>>>29,h[15]=this.bytes<<3,this.hash()}},g.prototype.hash=function(){var h=this.h0,_=this.h1,E=this.h2,S=this.h3,I=this.h4,w=this.h5,C=this.h6,v=this.h7,k=this.blocks,M,O,z,q,A,K,J,ae,Qe,et,ve;for(M=16;M<64;++M)A=k[M-15],O=(A>>>7|A<<25)^(A>>>18|A<<14)^A>>>3,A=k[M-2],z=(A>>>17|A<<15)^(A>>>19|A<<13)^A>>>10,k[M]=k[M-16]+O+k[M-7]+z<<0;for(ve=_&E,M=0;M<64;M+=4)this.first?(this.is224?(ae=300032,A=k[0]-1413257819,v=A-150054599<<0,S=A+24177077<<0):(ae=704751109,A=k[0]-210244248,v=A-1521486534<<0,S=A+143694565<<0),this.first=!1):(O=(h>>>2|h<<30)^(h>>>13|h<<19)^(h>>>22|h<<10),z=(I>>>6|I<<26)^(I>>>11|I<<21)^(I>>>25|I<<7),ae=h&_,q=ae^h&E^ve,J=I&w^~I&C,A=v+z+J+s[M]+k[M],K=O+q,v=S+A<<0,S=A+K<<0),O=(S>>>2|S<<30)^(S>>>13|S<<19)^(S>>>22|S<<10),z=(v>>>6|v<<26)^(v>>>11|v<<21)^(v>>>25|v<<7),Qe=S&h,q=Qe^S&_^ae,J=v&I^~v&w,A=C+z+J+s[M+1]+k[M+1],K=O+q,C=E+A<<0,E=A+K<<0,O=(E>>>2|E<<30)^(E>>>13|E<<19)^(E>>>22|E<<10),z=(C>>>6|C<<26)^(C>>>11|C<<21)^(C>>>25|C<<7),et=E&S,q=et^E&h^Qe,J=C&v^~C&I,A=w+z+J+s[M+2]+k[M+2],K=O+q,w=_+A<<0,_=A+K<<0,O=(_>>>2|_<<30)^(_>>>13|_<<19)^(_>>>22|_<<10),z=(w>>>6|w<<26)^(w>>>11|w<<21)^(w>>>25|w<<7),ve=_&E,q=ve^_&S^et,J=w&C^~w&v,A=I+z+J+s[M+3]+k[M+3],K=O+q,I=h+A<<0,h=A+K<<0,this.chromeBugWorkAround=!0;this.h0=this.h0+h<<0,this.h1=this.h1+_<<0,this.h2=this.h2+E<<0,this.h3=this.h3+S<<0,this.h4=this.h4+I<<0,this.h5=this.h5+w<<0,this.h6=this.h6+C<<0,this.h7=this.h7+v<<0},g.prototype.hex=function(){this.finalize();var h=this.h0,_=this.h1,E=this.h2,S=this.h3,I=this.h4,w=this.h5,C=this.h6,v=this.h7,k=l[h>>>28&15]+l[h>>>24&15]+l[h>>>20&15]+l[h>>>16&15]+l[h>>>12&15]+l[h>>>8&15]+l[h>>>4&15]+l[h&15]+l[_>>>28&15]+l[_>>>24&15]+l[_>>>20&15]+l[_>>>16&15]+l[_>>>12&15]+l[_>>>8&15]+l[_>>>4&15]+l[_&15]+l[E>>>28&15]+l[E>>>24&15]+l[E>>>20&15]+l[E>>>16&15]+l[E>>>12&15]+l[E>>>8&15]+l[E>>>4&15]+l[E&15]+l[S>>>28&15]+l[S>>>24&15]+l[S>>>20&15]+l[S>>>16&15]+l[S>>>12&15]+l[S>>>8&15]+l[S>>>4&15]+l[S&15]+l[I>>>28&15]+l[I>>>24&15]+l[I>>>20&15]+l[I>>>16&15]+l[I>>>12&15]+l[I>>>8&15]+l[I>>>4&15]+l[I&15]+l[w>>>28&15]+l[w>>>24&15]+l[w>>>20&15]+l[w>>>16&15]+l[w>>>12&15]+l[w>>>8&15]+l[w>>>4&15]+l[w&15]+l[C>>>28&15]+l[C>>>24&15]+l[C>>>20&15]+l[C>>>16&15]+l[C>>>12&15]+l[C>>>8&15]+l[C>>>4&15]+l[C&15];return this.is224||(k+=l[v>>>28&15]+l[v>>>24&15]+l[v>>>20&15]+l[v>>>16&15]+l[v>>>12&15]+l[v>>>8&15]+l[v>>>4&15]+l[v&15]),k},g.prototype.toString=g.prototype.hex,g.prototype.digest=function(){this.finalize();var h=this.h0,_=this.h1,E=this.h2,S=this.h3,I=this.h4,w=this.h5,C=this.h6,v=this.h7,k=[h>>>24&255,h>>>16&255,h>>>8&255,h&255,_>>>24&255,_>>>16&255,_>>>8&255,_&255,E>>>24&255,E>>>16&255,E>>>8&255,E&255,S>>>24&255,S>>>16&255,S>>>8&255,S&255,I>>>24&255,I>>>16&255,I>>>8&255,I&255,w>>>24&255,w>>>16&255,w>>>8&255,w&255,C>>>24&255,C>>>16&255,C>>>8&255,C&255];return this.is224||k.push(v>>>24&255,v>>>16&255,v>>>8&255,v&255),k},g.prototype.array=g.prototype.digest,g.prototype.arrayBuffer=function(){this.finalize();var h=new ArrayBuffer(this.is224?28:32),_=new DataView(h);return _.setUint32(0,this.h0),_.setUint32(4,this.h1),_.setUint32(8,this.h2),_.setUint32(12,this.h3),_.setUint32(16,this.h4),_.setUint32(20,this.h5),_.setUint32(24,this.h6),this.is224||_.setUint32(28,this.h7),h};function T(h,_,E){var S,I=typeof h;if(I==="string"){var w=[],C=h.length,v=0,k;for(S=0;S<C;++S)k=h.charCodeAt(S),k<128?w[v++]=k:k<2048?(w[v++]=192|k>>>6,w[v++]=128|k&63):k<55296||k>=57344?(w[v++]=224|k>>>12,w[v++]=128|k>>>6&63,w[v++]=128|k&63):(k=65536+((k&1023)<<10|h.charCodeAt(++S)&1023),w[v++]=240|k>>>18,w[v++]=128|k>>>12&63,w[v++]=128|k>>>6&63,w[v++]=128|k&63);h=w}else if(I==="object"){if(h===null)throw new Error(e);if(f&&h.constructor===ArrayBuffer)h=new Uint8Array(h);else if(!Array.isArray(h)&&(!f||!ArrayBuffer.isView(h)))throw new Error(e)}else throw new Error(e);h.length>64&&(h=new g(_,!0).update(h).array());var M=[],O=[];for(S=0;S<64;++S){var z=h[S]||0;M[S]=92^z,O[S]=54^z}g.call(this,_,E),this.update(O),this.oKeyPad=M,this.inner=!0,this.sharedMemory=E}T.prototype=new g,T.prototype.finalize=function(){if(g.prototype.finalize.call(this),this.inner){this.inner=!1;var h=this.array();g.call(this,this.is224,this.sharedMemory),this.update(this.oKeyPad),this.update(h),g.prototype.finalize.call(this)}};var R=i();R.sha256=R,R.sha224=i(!0),R.sha256.hmac=F(),R.sha224.hmac=F(!0),a?Ee.exports=R:(r.sha256=R.sha256,r.sha224=R.sha224,c&&define(function(){return R}))})()});function te(e,{strict:t=!0}={}){return!e||typeof e!="string"?!1:t?/^0x[0-9a-fA-F]*$/.test(e):e.startsWith("0x")}var Ae=B(()=>{"use strict"});function lt(e){return te(e,{strict:!1})?Math.ceil((e.length-2)/2):e.length}var sr=B(()=>{"use strict";Ae()});var ut,cr=B(()=>{"use strict";ut="2.21.55"});function lr(e,t){return t?.(e)?e:e&&typeof e=="object"&&"cause"in e&&e.cause!==void 0?lr(e.cause,t):t?null:e}var pt,N,ce=B(()=>{"use strict";cr();pt={getDocsUrl:({docsBaseUrl:e,docsPath:t="",docsSlug:r})=>t?`${e??"https://viem.sh"}${t}${r?`#${r}`:""}`:void 0,version:`viem@${ut}`},N=class e extends Error{constructor(t,r={}){let o=r.cause instanceof e?r.cause.details:r.cause?.message?r.cause.message:r.details,n=r.cause instanceof e&&r.cause.docsPath||r.docsPath,a=pt.getDocsUrl?.({...r,docsPath:n}),c=[t||"An error occurred.","",...r.metaMessages?[...r.metaMessages,""]:[],...a?[`Docs: ${a}`]:[],...o?[`Details: ${o}`]:[],...pt.version?[`Version: ${pt.version}`]:[]].join(`
|
|
2
|
+
`);super(c,r.cause?{cause:r.cause}:void 0),Object.defineProperty(this,"details",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsPath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"metaMessages",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shortMessage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"version",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"BaseError"}),this.details=o,this.docsPath=n,this.metaMessages=r.metaMessages,this.name=r.name??this.name,this.shortMessage=t,this.version=ut}walk(t){return lr(this,t)}}});var le,ur=B(()=>{"use strict";ce();le=class extends N{constructor({size:t,targetSize:r,type:o}){super(`${o.charAt(0).toUpperCase()}${o.slice(1).toLowerCase()} size (${t}) exceeds padding size (${r}).`,{name:"SizeExceedsPaddingSizeError"})}}});function V(e,{dir:t,size:r=32}={}){return typeof e=="string"?pr(e,{dir:t,size:r}):fr(e,{dir:t,size:r})}function pr(e,{dir:t,size:r=32}={}){if(r===null)return e;let o=e.replace("0x","");if(o.length>r*2)throw new le({size:Math.ceil(o.length/2),targetSize:r,type:"hex"});return`0x${o[t==="right"?"padEnd":"padStart"](r*2,"0")}`}function fr(e,{dir:t,size:r=32}={}){if(r===null)return e;if(e.length>r)throw new le({size:e.length,targetSize:r,type:"bytes"});let o=new Uint8Array(r);for(let n=0;n<r;n++){let a=t==="right";o[a?n:r-n-1]=e[a?n:e.length-n-1]}return o}var Pe=B(()=>{"use strict";ur()});var Re,Me,ft=B(()=>{"use strict";ce();Re=class extends N{constructor({max:t,min:r,signed:o,size:n,value:a}){super(`Number "${a}" is not in safe ${n?`${n*8}-bit ${o?"signed":"unsigned"} `:""}integer range ${t?`(${r} to ${t})`:`(above ${r})`}`,{name:"IntegerOutOfRangeError"})}},Me=class extends N{constructor({givenSize:t,maxSize:r}){super(`Size cannot exceed ${r} bytes. Given size: ${t} bytes.`,{name:"SizeOverflowError"})}}});function Y(e,{size:t}){if(lt(e)>t)throw new Me({givenSize:lt(e),maxSize:t})}var dt=B(()=>{"use strict";ft();sr()});function G(e,t={}){return typeof e=="number"||typeof e=="bigint"?Be(e,t):typeof e=="string"?mr(e,t):typeof e=="boolean"?dr(e,t):ue(e,t)}function dr(e,t={}){let r=`0x${Number(e)}`;return typeof t.size=="number"?(Y(r,{size:t.size}),V(r,{size:t.size})):r}function ue(e,t={}){let r="";for(let n=0;n<e.length;n++)r+=Wo[e[n]];let o=`0x${r}`;return typeof t.size=="number"?(Y(o,{size:t.size}),V(o,{dir:"right",size:t.size})):o}function Be(e,t={}){let{signed:r,size:o}=t,n=BigInt(e),a;o?r?a=(1n<<BigInt(o)*8n-1n)-1n:a=2n**(BigInt(o)*8n)-1n:typeof e=="number"&&(a=BigInt(Number.MAX_SAFE_INTEGER));let c=typeof a=="bigint"&&r?-a-1n:0;if(a&&n>a||n<c){let l=typeof e=="bigint"?"n":"";throw new Re({max:a?`${a}${l}`:void 0,min:`${c}${l}`,signed:r,size:o,value:`${e}${l}`})}let f=`0x${(r&&n<0?(1n<<BigInt(o*8))+BigInt(n):n).toString(16)}`;return o?V(f,{size:o}):f}function mr(e,t={}){let r=jo.encode(e);return ue(r,t)}var Wo,jo,He=B(()=>{"use strict";ft();Pe();dt();Wo=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));jo=new TextEncoder});function mt(e,t={}){return typeof e=="number"||typeof e=="bigint"?_r(e,t):typeof e=="boolean"?xr(e,t):te(e)?pe(e,t):Le(e,t)}function xr(e,t={}){let r=new Uint8Array(1);return r[0]=Number(e),typeof t.size=="number"?(Y(r,{size:t.size}),V(r,{size:t.size})):r}function hr(e){if(e>=W.zero&&e<=W.nine)return e-W.zero;if(e>=W.A&&e<=W.F)return e-(W.A-10);if(e>=W.a&&e<=W.f)return e-(W.a-10)}function pe(e,t={}){let r=e;t.size&&(Y(r,{size:t.size}),r=V(r,{dir:"right",size:t.size}));let o=r.slice(2);o.length%2&&(o=`0${o}`);let n=o.length/2,a=new Uint8Array(n);for(let c=0,f=0;c<n;c++){let l=hr(o.charCodeAt(f++)),x=hr(o.charCodeAt(f++));if(l===void 0||x===void 0)throw new N(`Invalid byte sequence ("${o[f-2]}${o[f-1]}" in "${o}").`);a[c]=l*16+x}return a}function _r(e,t){let r=Be(e,t);return pe(r)}function Le(e,t={}){let r=qo.encode(e);return typeof t.size=="number"?(Y(r,{size:t.size}),V(r,{dir:"right",size:t.size})):r}var qo,W,Ue=B(()=>{"use strict";ce();Ae();Pe();dt();He();qo=new TextEncoder;W={zero:48,nine:57,A:65,F:70,a:97,f:102}});function ht(e){if(!Number.isSafeInteger(e)||e<0)throw new Error("positive integer expected, got "+e)}function Ko(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name==="Uint8Array"}function fe(e,...t){if(!Ko(e))throw new Error("Uint8Array expected");if(t.length>0&&!t.includes(e.length))throw new Error("Uint8Array expected of length "+t+", got length="+e.length)}function xt(e,t=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(t&&e.finished)throw new Error("Hash#digest() has already been called")}function yr(e,t){fe(e);let r=t.outputLen;if(e.length<r)throw new Error("digestInto() expects output buffer of length at least "+r)}var _t=B(()=>{"use strict"});function Jo(e,t=!1){return t?{h:Number(e&De),l:Number(e>>gr&De)}:{h:Number(e>>gr&De)|0,l:Number(e&De)|0}}function br(e,t=!1){let r=new Uint32Array(e.length),o=new Uint32Array(e.length);for(let n=0;n<e.length;n++){let{h:a,l:c}=Jo(e[n],t);[r[n],o[n]]=[a,c]}return[r,o]}var De,gr,wr,vr,Sr,Fr,Tr=B(()=>{"use strict";De=BigInt(4294967295),gr=BigInt(32);wr=(e,t,r)=>e<<r|t>>>32-r,vr=(e,t,r)=>t<<r|e>>>32-r,Sr=(e,t,r)=>t<<r-32|e>>>64-r,Fr=(e,t,r)=>e<<r-32|t>>>64-r});function gt(e){for(let t=0;t<e.length;t++)e[t]=Go(e[t])}function Xo(e){if(typeof e!="string")throw new Error("utf8ToBytes expected string, got "+typeof e);return new Uint8Array(new TextEncoder().encode(e))}function ze(e){return typeof e=="string"&&(e=Xo(e)),fe(e),e}function Ir(e){let t=o=>e().update(ze(o)).digest(),r=e();return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=()=>e(),t}function Cr(e){let t=(o,n)=>e(n).update(ze(o)).digest(),r=e({});return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=o=>e(o),t}var Er,yt,Go,Oe,kr=B(()=>{"use strict";_t();Er=e=>new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4)),yt=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68,Go=e=>e<<24&4278190080|e<<8&16711680|e>>>8&65280|e>>>24&255;Oe=class{clone(){return this._cloneInto()}}});function nn(e,t=24){let r=new Uint32Array(10);for(let o=24-t;o<24;o++){for(let c=0;c<10;c++)r[c]=e[c]^e[c+10]^e[c+20]^e[c+30]^e[c+40];for(let c=0;c<10;c+=2){let f=(c+8)%10,l=(c+2)%10,x=r[l],d=r[l+1],s=Ar(x,d,1)^r[f],m=Pr(x,d,1)^r[f+1];for(let u=0;u<50;u+=10)e[c+u]^=s,e[c+u+1]^=m}let n=e[2],a=e[3];for(let c=0;c<24;c++){let f=Mr[c],l=Ar(n,a,f),x=Pr(n,a,f),d=Rr[c];n=e[d],a=e[d+1],e[d]=l,e[d+1]=x}for(let c=0;c<50;c+=10){for(let f=0;f<10;f++)r[f]=e[c+f];for(let f=0;f<10;f++)e[c+f]^=~r[(f+2)%10]&r[(f+4)%10]}e[0]^=rn[o],e[1]^=on[o]}r.fill(0)}var Rr,Mr,Br,Yo,de,Zo,Qo,en,tn,rn,on,Ar,Pr,Ne,X,Vi,$i,Wi,ji,qi,Hr,Ki,Ji,Lr,Gi,Xi,Ur=B(()=>{"use strict";_t();Tr();kr();Rr=[],Mr=[],Br=[],Yo=BigInt(0),de=BigInt(1),Zo=BigInt(2),Qo=BigInt(7),en=BigInt(256),tn=BigInt(113);for(let e=0,t=de,r=1,o=0;e<24;e++){[r,o]=[o,(2*r+3*o)%5],Rr.push(2*(5*o+r)),Mr.push((e+1)*(e+2)/2%64);let n=Yo;for(let a=0;a<7;a++)t=(t<<de^(t>>Qo)*tn)%en,t&Zo&&(n^=de<<(de<<BigInt(a))-de);Br.push(n)}[rn,on]=br(Br,!0),Ar=(e,t,r)=>r>32?Sr(e,t,r):wr(e,t,r),Pr=(e,t,r)=>r>32?Fr(e,t,r):vr(e,t,r);Ne=class e extends Oe{constructor(t,r,o,n=!1,a=24){if(super(),this.blockLen=t,this.suffix=r,this.outputLen=o,this.enableXOF=n,this.rounds=a,this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,ht(o),0>=this.blockLen||this.blockLen>=200)throw new Error("Sha3 supports only keccak-f1600 function");this.state=new Uint8Array(200),this.state32=Er(this.state)}keccak(){yt||gt(this.state32),nn(this.state32,this.rounds),yt||gt(this.state32),this.posOut=0,this.pos=0}update(t){xt(this);let{blockLen:r,state:o}=this;t=ze(t);let n=t.length;for(let a=0;a<n;){let c=Math.min(r-this.pos,n-a);for(let f=0;f<c;f++)o[this.pos++]^=t[a++];this.pos===r&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;let{state:t,suffix:r,pos:o,blockLen:n}=this;t[o]^=r,r&128&&o===n-1&&this.keccak(),t[n-1]^=128,this.keccak()}writeInto(t){xt(this,!1),fe(t),this.finish();let r=this.state,{blockLen:o}=this;for(let n=0,a=t.length;n<a;){this.posOut>=o&&this.keccak();let c=Math.min(o-this.posOut,a-n);t.set(r.subarray(this.posOut,this.posOut+c),n),this.posOut+=c,n+=c}return t}xofInto(t){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(t)}xof(t){return ht(t),this.xofInto(new Uint8Array(t))}digestInto(t){if(yr(t,this),this.finished)throw new Error("digest() was already called");return this.writeInto(t),this.destroy(),t}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,this.state.fill(0)}_cloneInto(t){let{blockLen:r,suffix:o,outputLen:n,rounds:a,enableXOF:c}=this;return t||(t=new e(r,o,n,c,a)),t.state32.set(this.state32),t.pos=this.pos,t.posOut=this.posOut,t.finished=this.finished,t.rounds=a,t.suffix=o,t.outputLen=n,t.enableXOF=c,t.destroyed=this.destroyed,t}},X=(e,t,r)=>Ir(()=>new Ne(t,e,r)),Vi=X(6,144,224/8),$i=X(6,136,256/8),Wi=X(6,104,384/8),ji=X(6,72,512/8),qi=X(1,144,224/8),Hr=X(1,136,256/8),Ki=X(1,104,384/8),Ji=X(1,72,512/8),Lr=(e,t,r)=>Cr((o={})=>new Ne(t,e,o.dkLen===void 0?r:o.dkLen,!0)),Gi=Lr(31,168,128/8),Xi=Lr(31,136,256/8)});function me(e,t){let r=t||"hex",o=Hr(te(e,{strict:!1})?mt(e):e);return r==="bytes"?o:G(o)}var bt=B(()=>{"use strict";Ur();Ae();Ue();He()});var he,Dr=B(()=>{"use strict";ce();he=class extends N{constructor({address:t}){super(`Address "${t}" is invalid.`,{metaMessages:["- Address must be a hex value of 20 bytes (40 hex characters).","- Address must match its checksum counterpart."],name:"InvalidAddressError"})}}});var re,wt=B(()=>{"use strict";re=class extends Map{constructor(t){super(),Object.defineProperty(this,"maxSize",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.maxSize=t}get(t){let r=super.get(t);return super.has(t)&&r!==void 0&&(this.delete(t),super.set(t,r)),r}set(t,r){if(super.set(t,r),this.maxSize&&this.size>this.maxSize){let o=this.keys().next().value;o&&this.delete(o)}return this}}});function Or(e,t){if(vt.has(`${e}.${t}`))return vt.get(`${e}.${t}`);let r=t?`${t}${e.toLowerCase()}`:e.substring(2).toLowerCase(),o=me(Le(r),"bytes"),n=(t?r.substring(`${t}0x`.length):r).split("");for(let c=0;c<40;c+=2)o[c>>1]>>4>=8&&n[c]&&(n[c]=n[c].toUpperCase()),(o[c>>1]&15)>=8&&n[c+1]&&(n[c+1]=n[c+1].toUpperCase());let a=`0x${n.join("")}`;return vt.set(`${e}.${t}`,a),a}var vt,zr=B(()=>{"use strict";Ue();bt();wt();vt=new re(8192)});function Ft(e,t){let{strict:r=!0}=t??{},o=`${e}.${r}`;if(St.has(o))return St.get(o);let n=an.test(e)?e.toLowerCase()===e?!0:r?Or(e)===e:!0:!1;return St.set(o,n),n}var an,St,Nr=B(()=>{"use strict";wt();zr();an=/^0x[a-fA-F0-9]{40}$/,St=new re(8192)});function Ve(e){return`0x${e.reduce((t,r)=>t+r.replace("0x",""),"")}`}var Vr=B(()=>{"use strict"});function Tt(e,t){if(!Ft(e,{strict:!1}))throw new he({address:e});if(!Ft(t,{strict:!1}))throw new he({address:t});return e.toLowerCase()===t.toLowerCase()}var $r=B(()=>{"use strict";Dr();Nr()});var An={};zo(An,{ButtonShare:()=>Ze});var U=class extends Error{constructor(r,o,n){super(o);this.code=r;this.data=n}};var Te=class extends U{constructor(t){super(D.internalError,t)}};var D={parseError:-32700,invalidRequest:-32600,methodNotFound:-32601,invalidParams:-32602,internalError:-32603,serverError:-32e3,clientNotConnected:-32001,configError:-32002,corruptedResponse:-32003,clientAborted:-32004,walletNotConnected:-32005,serverErrorForInteractionDelegation:-32006};var $=class{_promise;_resolve;_reject;constructor(){this._promise=new Promise((t,r)=>{this._resolve=t,this._reject=r})}get promise(){return this._promise}resolve=t=>{this._resolve?.(t)};reject=t=>{this._reject?.(t)}};var er=Fe(rt(),1),nt=Fe(ot(),1);async function Ie(e){let t=(0,nt.sha256)(JSON.stringify(e)),r={...e,validationHash:t},o=await tr(r),n=(0,nt.sha256)(o);return{compressed:o,compressedHash:n}}async function tr(e){return(0,er.compressToBase64)(JSON.stringify(e))}var rr=Fe(rt(),1),it=Fe(ot(),1);async function Ce(e){if(!(e?.compressed&&e?.compressedHash))throw new U(D.corruptedResponse,"Missing compressed data");let t=await or(e.compressed);if(!t)throw new U(D.corruptedResponse,"Invalid compressed data");if(!t?.validationHash)throw new U(D.corruptedResponse,"Missing validation hash");if((0,it.sha256)(e.compressed)!==e.compressedHash)throw new U(D.corruptedResponse,"Invalid compressed hash");let{validationHash:o,...n}=t;if((0,it.sha256)(JSON.stringify(n))!==t.validationHash)throw new U(D.corruptedResponse,"Invalid data validation hash");return t}async function or(e){let t=await(0,rr.decompressFromBase64)(e);try{return JSON.parse(t)}catch(r){return console.error("Invalid compressed data",{e:r,decompressed:t}),null}}var ee="nexus-wallet-backup";function nr(){let e=new Map;return{createChannel:t=>{let r=Math.random().toString(36).substring(7);return e.set(r,t),r},getRpcResolver:t=>e.get(t),removeChannel:t=>e.delete(t),destroy:()=>e.clear()}}var ke={id:"nexus-wallet",name:"nexus-wallet",allow:"publickey-credentials-get *; clipboard-write; web-share *",style:{width:"0",height:"0",border:"0",position:"absolute",zIndex:1e3,top:"-1000px",left:"-1000px"}};function at({walletBaseUrl:e,config:t}){let r=document.querySelector("#nexus-wallet");r&&r.remove();let o=document.createElement("iframe");return o.id=ke.id,o.name=ke.name,o.allow=ke.allow,o.style.zIndex=ke.style.zIndex.toString(),st({iframe:o,isVisible:!1}),document.body.appendChild(o),new Promise(n=>{o?.addEventListener("load",()=>n(o)),o.src=`${t?.walletUrl??e??"https://wallet.frak.id"}/listener`})}function st({iframe:e,isVisible:t}){if(!t){e.style.width="0",e.style.height="0",e.style.border="0",e.style.position="fixed",e.style.top="-1000px",e.style.left="-1000px";return}e.style.position="fixed",e.style.top="0",e.style.left="0",e.style.width="100%",e.style.height="100%",e.style.pointerEvents="auto"}function ir({iframe:e}){let t=new $;return{handleEvent:async o=>{switch(o.iframeLifecycle){case"connected":t.resolve(!0);break;case"do-backup":o.data.backup?localStorage.setItem(ee,o.data.backup):localStorage.removeItem(ee);break;case"remove-backup":localStorage.removeItem(ee);break;case"show":case"hide":st({iframe:e,isVisible:o.iframeLifecycle==="show"});break}},isConnected:t.promise}}function ar({frakWalletUrl:e,iframe:t,channelManager:r,iframeLifecycleManager:o}){if(typeof window>"u")throw new U(D.configError,"iframe client should be used in the browser");if(!t.contentWindow)throw new U(D.configError,"The iframe does not have a product window");let n=t.contentWindow,a=async l=>{if(!(l.origin&&URL.canParse(l.origin))||new URL(l.origin).origin.toLowerCase()!==new URL(e).origin.toLowerCase()||typeof l.data!="object")return;if("iframeLifecycle"in l.data){await o.handleEvent(l.data);return}if("clientLifecycle"in l.data){console.error("Client lifecycle event received on the client side, dismissing it");return}let x=l.data.id,d=r.getRpcResolver(x);d&&await d(l.data)};return window.addEventListener("message",a),{sendEvent:l=>{n.postMessage(l,{targetOrigin:e})},cleanup:()=>{window.removeEventListener("message",a)}}}function ct({config:e,iframe:t}){let r=nr(),o=ir({iframe:t}),n=ar({frakWalletUrl:e?.walletUrl??"https://wallet.frak.id",iframe:t,channelManager:r,iframeLifecycleManager:o}),a=async d=>{if(!await o.isConnected)throw new U(D.clientNotConnected,"The iframe provider isn't connected yet");let m=new $,u=r.createChannel(async i=>{let p=await Ce(i.data);p.error?m.reject(new U(p.error.code,p.error.message,p.error?.data)):m.resolve(p.result),r.removeChannel(u)}),y=await Ie(d);return n.sendEvent({id:u,topic:d.method,data:y}),m.promise},c=async(d,s)=>{if(!await o.isConnected)throw new U(D.clientNotConnected,"The iframe provider isn't connected yet");let u=r.createChannel(async i=>{let p=await Ce(i.data);if(p.result)s(p.result);else throw new Te("No valid result in the response")}),y=await Ie(d);n.sendEvent({id:u,topic:d.method,data:y})},f=Vo(n,o),l=async()=>{f(),r.destroy(),n.cleanup(),t.remove()},x=$o({config:e,messageHandler:n,lifecycleManager:o});return{config:e,waitForConnection:o.isConnected,waitForSetup:x,request:a,listenerRequest:c,destroy:l}}function Vo(e,t){let n,a,c=()=>e.sendEvent({iframeLifecycle:"heartbeat"});async function f(){c(),n=setInterval(c,100),a=setTimeout(()=>{l(),console.log("Heartbeat timeout: connection failed")},3e4),await t.isConnected,l()}function l(){n&&clearInterval(n),a&&clearTimeout(a)}return f(),l}async function $o({config:e,messageHandler:t,lifecycleManager:r}){await r.isConnected;let o=async()=>{let a=e.metadata.css;a&&t.sendEvent({clientLifecycle:"modal-css",data:{cssLink:a}})},n=async()=>{if(typeof window>"u")return;let a=window.localStorage.getItem(ee);a&&t.sendEvent({clientLifecycle:"restore-backup",data:{backup:a}})};await Promise.all([o(),n()])}Ue();He();Vr();$r();bt();Pe();var Et="fCtx";function sn(e){return btoa(Array.from(e,t=>String.fromCharCode(t)).join("")).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}function cn(e){let t=e.length%4;return Uint8Array.from(atob(e.replace(/-/g,"+").replace(/_/g,"/").padEnd(e.length+(t===0?0:4-t),"=")),r=>r.charCodeAt(0))}function Wr(e){if(e?.r)try{let t=pe(e.r);return sn(t)}catch(t){console.error("Error compressing Frak context",{e:t,context:e})}}function jr(e){if(!(!e||e.length===0))try{let t=cn(e);return{r:ue(t,{size:20})}}catch(t){console.error("Error decompressing Frak context",{e:t,context:e})}}function qr({url:e}){if(!e)return null;let r=new URL(e).searchParams.get(Et);return r?jr(r):null}function Kr({url:e,context:t}){if(!e)return null;let r=qr({url:e}),o=r?{...r,...t}:t;if(!o.r)return null;let n=Wr(o);if(!n)return null;let a=new URL(e);return a.searchParams.set(Et,n),a.toString()}function Jr(e){let t=new URL(e);return t.searchParams.delete(Et),t.toString()}function ln({url:e,context:t}){if(!window.location?.href||typeof window>"u"){console.error("No window found, can't update context");return}let r=e??window.location.href,o;t!==null?o=Kr({url:r,context:t}):o=Jr(r),o&&window.history.replaceState(null,"",o.toString())}var oe={compress:Wr,decompress:jr,parse:qr,update:Kr,remove:Jr,replaceUrl:ln};async function It({config:e}){let t=await at({config:e});if(!t){console.error("Failed to create iframe");return}let r=ct({config:e,iframe:t});if(await r.waitForSetup,!await r.waitForConnection){console.error("Failed to connect to client");return}return r}function Gr(e){document.readyState==="complete"||document.readyState==="interactive"?setTimeout(e,1):document.addEventListener?document.addEventListener("DOMContentLoaded",e):document.attachEvent("onreadystatechange",()=>{document.readyState==="complete"&&e()})}function Ct(e,t){if(!t)return e.request({method:"frak_listenToWalletStatus"}).then(n=>(Xr(n.interactionToken),n));let r=new $,o=!1;return e.listenerRequest({method:"frak_listenToWalletStatus"},n=>{t(n),Xr(n.interactionToken),o||(r.resolve(n),o=!0)}).then(()=>r.promise)}function Xr(e){typeof window>"u"||(e?window.sessionStorage.setItem("frak-wallet-interaction-token",e):window.sessionStorage.removeItem("frak.interaction-token"))}function Yr({domain:e}){let t=e??window.location.host;return me(G(t))}async function kt(e,{productId:t,interaction:r,validation:o}){let n=t??Yr(e.config);return await e.request({method:"frak_sendInteraction",params:[n,r,o]})}async function xe(e,{steps:t,metadata:r}){return await e.request({method:"frak_displayModal",params:[t,e.config.metadata.name,r]})}async function At(e){return await e.request({method:"frak_getProductInformation"})}function Pt(e,{metadata:t,login:r,openSession:o}){return $e(e,{steps:{login:r??{},openSession:o??{}},metadata:t})}function $e(e,t){function r(c){return $e(e,{...t,steps:{...t.steps,sendTransaction:c}})}function o(c){return $e(e,{...t,steps:{...t.steps,final:{...c,action:{key:"reward"}}}})}function n(c,f){return $e(e,{...t,steps:{...t.steps,final:{...f,action:{key:"sharing",options:c}}}})}async function a(){return await xe(e,t)}return{params:t,sendTx:r,reward:o,sharing:n,display:a}}var Rt={press:{openArticle:"0xc0a24ffb",readArticle:"0xd5bd0fbe"},dapp:{proofVerifiableStorageUpdate:"0x2ab2aeef",callableVerifiableStorageUpdate:"0xa07da986"},webshop:{open:"0xb311798f"},referral:{referred:"0x010cc3b9",createLink:"0xb2c0f17c"},purchase:{started:"0xd87e90c3",completed:"0x8403aeb4"}};var We={dapp:1,press:2,webshop:3,referral:30,purchase:31},Xa=Object.entries(We).reduce((e,[t,r])=>(e[t]=BigInt(1)<<BigInt(r),e),{});var Mt={createLink(){let e=Ve([Rt.referral.createLink,"0x"]);return{handlerTypeDenominator:G(We.referral),interactionData:e}},referred({referrer:e}){let t=Ve([Rt.referral.referred,V(e,{size:32})]);return{handlerTypeDenominator:G(We.referral),interactionData:t}}};async function Zr(e,{walletStatus:t,frakContext:r,modalConfig:o,productId:n,options:a}){let c=!1;async function f(){if(!c)return c=!0,pn(e,{modalConfig:o,walletStatus:t})}async function l(x){let d=Mt.referred({referrer:x});await kt(e,{productId:n,interaction:d})}try{let{status:x,currentWallet:d}=await un({initialWalletStatus:t,getFreshWalletStatus:f,pushReferralInteraction:l,frakContext:r});return oe.replaceUrl({url:window.location?.href,context:a?.alwaysAppendUrl?{r:d}:null}),x}catch(x){return console.log("Error processing referral",{error:x}),oe.replaceUrl({url:window.location?.href,context:a?.alwaysAppendUrl?{r:t?.wallet}:null}),fn(x)}}async function un({initialWalletStatus:e,getFreshWalletStatus:t,pushReferralInteraction:r,frakContext:o}){let n=e?.wallet;return o?.r?(n||(n=await t()),n&&Tt(o.r,n)?{status:"self-referral",currentWallet:n}:(e?.interactionSession||(n=await t()),await r(o.r),{status:"success",currentWallet:n})):{status:"no-referrer",currentWallet:n}}async function pn(e,{modalConfig:t,walletStatus:r}){return r?.interactionSession?r.wallet??void 0:t?(await xe(e,t))?.login?.wallet??void 0:void 0}function fn(e){if(e instanceof U)switch(e.code){case D.walletNotConnected:return"no-wallet";case D.serverErrorForInteractionDelegation:return"no-session";default:return"error"}return"error"}async function Bt(e,{productId:t,modalConfig:r,options:o}={}){let n=oe.parse({url:window.location.href}),a=await Ct(e);try{return await Zr(e,{walletStatus:a,frakContext:n,modalConfig:r,productId:t,options:o})}catch(c){console.warn("Error processing referral",{error:c})}}var Qr="frakClientReady",je;function eo(){let e=new CustomEvent(Qr);window.dispatchEvent(e)}function Ht(e,t){if(window.FrakSetup?.client&&e==="add"){t();return}(e==="add"?window.addEventListener:window.removeEventListener)(Qr,t,!1)}function to(e){je=Pt(e,window.FrakSetup?.modalConfig??{})}async function ro(e){if(!je){console.error("modalBuilderSteps not found");return}let t=await Bt(e,{modalConfig:je.reward().params});console.log("referral",t)}function oo(){return je}var ge,P,co,dn,Z,no,lo,Lt,uo,Ot,Ut,Dt,mn,ye={},po=[],hn=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,zt=Array.isArray;function j(e,t){for(var r in t)e[r]=t[r];return e}function Nt(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function Q(e,t,r){var o,n,a,c={};for(a in t)a=="key"?o=t[a]:a=="ref"?n=t[a]:c[a]=t[a];if(arguments.length>2&&(c.children=arguments.length>3?ge.call(arguments,2):r),typeof e=="function"&&e.defaultProps!=null)for(a in e.defaultProps)c[a]===void 0&&(c[a]=e.defaultProps[a]);return _e(e,c,o,n,null)}function _e(e,t,r,o,n){var a={type:e,props:t,key:r,ref:o,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:n??++co,__i:-1,__u:0};return n==null&&P.vnode!=null&&P.vnode(a),a}function ie(e){return e.children}function Ke(e,t){this.props=e,this.context=t}function ne(e,t){if(t==null)return e.__?ne(e.__,e.__i+1):null;for(var r;t<e.__k.length;t++)if((r=e.__k[t])!=null&&r.__e!=null)return r.__e;return typeof e.type=="function"?ne(e):null}function fo(e){var t,r;if((e=e.__)!=null&&e.__c!=null){for(e.__e=e.__c.base=null,t=0;t<e.__k.length;t++)if((r=e.__k[t])!=null&&r.__e!=null){e.__e=e.__c.base=r.__e;break}return fo(e)}}function io(e){(!e.__d&&(e.__d=!0)&&Z.push(e)&&!Je.__r++||no!==P.debounceRendering)&&((no=P.debounceRendering)||lo)(Je)}function Je(){var e,t,r,o,n,a,c,f;for(Z.sort(Lt);e=Z.shift();)e.__d&&(t=Z.length,o=void 0,a=(n=(r=e).__v).__e,c=[],f=[],r.__P&&((o=j({},n)).__v=n.__v+1,P.vnode&&P.vnode(o),Vt(r.__P,o,n,r.__n,r.__P.namespaceURI,32&n.__u?[a]:null,c,a??ne(n),!!(32&n.__u),f),o.__v=n.__v,o.__.__k[o.__i]=o,xo(c,o,f),o.__e!=a&&fo(o)),Z.length>t&&Z.sort(Lt));Je.__r=0}function mo(e,t,r,o,n,a,c,f,l,x,d){var s,m,u,y,i,p,b=o&&o.__k||po,F=t.length;for(l=xn(r,t,b,l,F),s=0;s<F;s++)(u=r.__k[s])!=null&&(m=u.__i===-1?ye:b[u.__i]||ye,u.__i=s,p=Vt(e,u,m,n,a,c,f,l,x,d),y=u.__e,u.ref&&m.ref!=u.ref&&(m.ref&&$t(m.ref,null,u),d.push(u.ref,u.__c||y,u)),i==null&&y!=null&&(i=y),4&u.__u||m.__k===u.__k?l=ho(u,l,e):typeof u.type=="function"&&p!==void 0?l=p:y&&(l=y.nextSibling),u.__u&=-7);return r.__e=i,l}function xn(e,t,r,o,n){var a,c,f,l,x,d=r.length,s=d,m=0;for(e.__k=new Array(n),a=0;a<n;a++)(c=t[a])!=null&&typeof c!="boolean"&&typeof c!="function"?(l=a+m,(c=e.__k[a]=typeof c=="string"||typeof c=="number"||typeof c=="bigint"||c.constructor==String?_e(null,c,null,null,null):zt(c)?_e(ie,{children:c},null,null,null):c.constructor===void 0&&c.__b>0?_e(c.type,c.props,c.key,c.ref?c.ref:null,c.__v):c).__=e,c.__b=e.__b+1,f=null,(x=c.__i=_n(c,r,l,s))!==-1&&(s--,(f=r[x])&&(f.__u|=2)),f==null||f.__v===null?(x==-1&&m--,typeof c.type!="function"&&(c.__u|=4)):x!=l&&(x==l-1?m--:x==l+1?m++:(x>l?m--:m++,c.__u|=4))):e.__k[a]=null;if(s)for(a=0;a<d;a++)(f=r[a])!=null&&!(2&f.__u)&&(f.__e==o&&(o=ne(f)),_o(f,f));return o}function ho(e,t,r){var o,n;if(typeof e.type=="function"){for(o=e.__k,n=0;o&&n<o.length;n++)o[n]&&(o[n].__=e,t=ho(o[n],t,r));return t}e.__e!=t&&(t&&e.type&&!r.contains(t)&&(t=ne(e)),r.insertBefore(e.__e,t||null),t=e.__e);do t=t&&t.nextSibling;while(t!=null&&t.nodeType==8);return t}function _n(e,t,r,o){var n,a,c=e.key,f=e.type,l=t[r];if(l===null||l&&c==l.key&&f===l.type&&!(2&l.__u))return r;if(o>(l!=null&&!(2&l.__u)?1:0))for(n=r-1,a=r+1;n>=0||a<t.length;){if(n>=0){if((l=t[n])&&!(2&l.__u)&&c==l.key&&f===l.type)return n;n--}if(a<t.length){if((l=t[a])&&!(2&l.__u)&&c==l.key&&f===l.type)return a;a++}}return-1}function ao(e,t,r){t[0]=="-"?e.setProperty(t,r??""):e[t]=r==null?"":typeof r!="number"||hn.test(t)?r:r+"px"}function qe(e,t,r,o,n){var a;e:if(t=="style")if(typeof r=="string")e.style.cssText=r;else{if(typeof o=="string"&&(e.style.cssText=o=""),o)for(t in o)r&&t in r||ao(e.style,t,"");if(r)for(t in r)o&&r[t]===o[t]||ao(e.style,t,r[t])}else if(t[0]=="o"&&t[1]=="n")a=t!=(t=t.replace(uo,"$1")),t=t.toLowerCase()in e||t=="onFocusOut"||t=="onFocusIn"?t.toLowerCase().slice(2):t.slice(2),e.l||(e.l={}),e.l[t+a]=r,r?o?r.u=o.u:(r.u=Ot,e.addEventListener(t,a?Dt:Ut,a)):e.removeEventListener(t,a?Dt:Ut,a);else{if(n=="http://www.w3.org/2000/svg")t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(t!="width"&&t!="height"&&t!="href"&&t!="list"&&t!="form"&&t!="tabIndex"&&t!="download"&&t!="rowSpan"&&t!="colSpan"&&t!="role"&&t!="popover"&&t in e)try{e[t]=r??"";break e}catch{}typeof r=="function"||(r==null||r===!1&&t[4]!="-"?e.removeAttribute(t):e.setAttribute(t,t=="popover"&&r==1?"":r))}}function so(e){return function(t){if(this.l){var r=this.l[t.type+e];if(t.t==null)t.t=Ot++;else if(t.t<r.u)return;return r(P.event?P.event(t):t)}}}function Vt(e,t,r,o,n,a,c,f,l,x){var d,s,m,u,y,i,p,b,F,g,T,R,h,_,E,S,I,w=t.type;if(t.constructor!==void 0)return null;128&r.__u&&(l=!!(32&r.__u),a=[f=t.__e=r.__e]),(d=P.__b)&&d(t);e:if(typeof w=="function")try{if(b=t.props,F="prototype"in w&&w.prototype.render,g=(d=w.contextType)&&o[d.__c],T=d?g?g.props.value:d.__:o,r.__c?p=(s=t.__c=r.__c).__=s.__E:(F?t.__c=s=new w(b,T):(t.__c=s=new Ke(b,T),s.constructor=w,s.render=gn),g&&g.sub(s),s.props=b,s.state||(s.state={}),s.context=T,s.__n=o,m=s.__d=!0,s.__h=[],s._sb=[]),F&&s.__s==null&&(s.__s=s.state),F&&w.getDerivedStateFromProps!=null&&(s.__s==s.state&&(s.__s=j({},s.__s)),j(s.__s,w.getDerivedStateFromProps(b,s.__s))),u=s.props,y=s.state,s.__v=t,m)F&&w.getDerivedStateFromProps==null&&s.componentWillMount!=null&&s.componentWillMount(),F&&s.componentDidMount!=null&&s.__h.push(s.componentDidMount);else{if(F&&w.getDerivedStateFromProps==null&&b!==u&&s.componentWillReceiveProps!=null&&s.componentWillReceiveProps(b,T),!s.__e&&(s.shouldComponentUpdate!=null&&s.shouldComponentUpdate(b,s.__s,T)===!1||t.__v==r.__v)){for(t.__v!=r.__v&&(s.props=b,s.state=s.__s,s.__d=!1),t.__e=r.__e,t.__k=r.__k,t.__k.some(function(C){C&&(C.__=t)}),R=0;R<s._sb.length;R++)s.__h.push(s._sb[R]);s._sb=[],s.__h.length&&c.push(s);break e}s.componentWillUpdate!=null&&s.componentWillUpdate(b,s.__s,T),F&&s.componentDidUpdate!=null&&s.__h.push(function(){s.componentDidUpdate(u,y,i)})}if(s.context=T,s.props=b,s.__P=e,s.__e=!1,h=P.__r,_=0,F){for(s.state=s.__s,s.__d=!1,h&&h(t),d=s.render(s.props,s.state,s.context),E=0;E<s._sb.length;E++)s.__h.push(s._sb[E]);s._sb=[]}else do s.__d=!1,h&&h(t),d=s.render(s.props,s.state,s.context),s.state=s.__s;while(s.__d&&++_<25);s.state=s.__s,s.getChildContext!=null&&(o=j(j({},o),s.getChildContext())),F&&!m&&s.getSnapshotBeforeUpdate!=null&&(i=s.getSnapshotBeforeUpdate(u,y)),f=mo(e,zt(S=d!=null&&d.type===ie&&d.key==null?d.props.children:d)?S:[S],t,r,o,n,a,c,f,l,x),s.base=t.__e,t.__u&=-161,s.__h.length&&c.push(s),p&&(s.__E=s.__=null)}catch(C){if(t.__v=null,l||a!=null)if(C.then){for(t.__u|=l?160:128;f&&f.nodeType==8&&f.nextSibling;)f=f.nextSibling;a[a.indexOf(f)]=null,t.__e=f}else for(I=a.length;I--;)Nt(a[I]);else t.__e=r.__e,t.__k=r.__k;P.__e(C,t,r)}else a==null&&t.__v==r.__v?(t.__k=r.__k,t.__e=r.__e):f=t.__e=yn(r.__e,t,r,o,n,a,c,l,x);return(d=P.diffed)&&d(t),128&t.__u?void 0:f}function xo(e,t,r){for(var o=0;o<r.length;o++)$t(r[o],r[++o],r[++o]);P.__c&&P.__c(t,e),e.some(function(n){try{e=n.__h,n.__h=[],e.some(function(a){a.call(n)})}catch(a){P.__e(a,n.__v)}})}function yn(e,t,r,o,n,a,c,f,l){var x,d,s,m,u,y,i,p=r.props,b=t.props,F=t.type;if(F=="svg"?n="http://www.w3.org/2000/svg":F=="math"?n="http://www.w3.org/1998/Math/MathML":n||(n="http://www.w3.org/1999/xhtml"),a!=null){for(x=0;x<a.length;x++)if((u=a[x])&&"setAttribute"in u==!!F&&(F?u.localName==F:u.nodeType==3)){e=u,a[x]=null;break}}if(e==null){if(F==null)return document.createTextNode(b);e=document.createElementNS(n,F,b.is&&b),f&&(P.__m&&P.__m(t,a),f=!1),a=null}if(F===null)p===b||f&&e.data===b||(e.data=b);else{if(a=a&&ge.call(e.childNodes),p=r.props||ye,!f&&a!=null)for(p={},x=0;x<e.attributes.length;x++)p[(u=e.attributes[x]).name]=u.value;for(x in p)if(u=p[x],x!="children"){if(x=="dangerouslySetInnerHTML")s=u;else if(!(x in b)){if(x=="value"&&"defaultValue"in b||x=="checked"&&"defaultChecked"in b)continue;qe(e,x,null,u,n)}}for(x in b)u=b[x],x=="children"?m=u:x=="dangerouslySetInnerHTML"?d=u:x=="value"?y=u:x=="checked"?i=u:f&&typeof u!="function"||p[x]===u||qe(e,x,u,p[x],n);if(d)f||s&&(d.__html===s.__html||d.__html===e.innerHTML)||(e.innerHTML=d.__html),t.__k=[];else if(s&&(e.innerHTML=""),mo(e,zt(m)?m:[m],t,r,o,F=="foreignObject"?"http://www.w3.org/1999/xhtml":n,a,c,a?a[0]:r.__k&&ne(r,0),f,l),a!=null)for(x=a.length;x--;)Nt(a[x]);f||(x="value",F=="progress"&&y==null?e.removeAttribute("value"):y!==void 0&&(y!==e[x]||F=="progress"&&!y||F=="option"&&y!==p[x])&&qe(e,x,y,p[x],n),x="checked",i!==void 0&&i!==e[x]&&qe(e,x,i,p[x],n))}return e}function $t(e,t,r){try{if(typeof e=="function"){var o=typeof e.__u=="function";o&&e.__u(),o&&t==null||(e.__u=e(t))}else e.current=t}catch(n){P.__e(n,r)}}function _o(e,t,r){var o,n;if(P.unmount&&P.unmount(e),(o=e.ref)&&(o.current&&o.current!==e.__e||$t(o,null,t)),(o=e.__c)!=null){if(o.componentWillUnmount)try{o.componentWillUnmount()}catch(a){P.__e(a,t)}o.base=o.__P=null}if(o=e.__k)for(n=0;n<o.length;n++)o[n]&&_o(o[n],t,r||typeof e.type!="function");r||Nt(e.__e),e.__c=e.__=e.__e=void 0}function gn(e,t,r){return this.constructor(e,r)}function be(e,t,r){var o,n,a,c;t==document&&(t=document.documentElement),P.__&&P.__(e,t),n=(o=typeof r=="function")?null:r&&r.__k||t.__k,a=[],c=[],Vt(t,e=(!o&&r||t).__k=Q(ie,null,[e]),n||ye,ye,t.namespaceURI,!o&&r?[r]:n?null:t.firstChild?ge.call(t.childNodes):null,a,!o&&r?r:n?n.__e:t.firstChild,o,c),xo(a,e,c)}function Wt(e,t){be(e,t,Wt)}function jt(e,t,r){var o,n,a,c,f=j({},e.props);for(a in e.type&&e.type.defaultProps&&(c=e.type.defaultProps),t)a=="key"?o=t[a]:a=="ref"?n=t[a]:f[a]=t[a]===void 0&&c!==void 0?c[a]:t[a];return arguments.length>2&&(f.children=arguments.length>3?ge.call(arguments,2):r),_e(e.type,f,o||e.key,n||e.ref,null)}ge=po.slice,P={__e:function(e,t,r,o){for(var n,a,c;t=t.__;)if((n=t.__c)&&!n.__)try{if((a=n.constructor)&&a.getDerivedStateFromError!=null&&(n.setState(a.getDerivedStateFromError(e)),c=n.__d),n.componentDidCatch!=null&&(n.componentDidCatch(e,o||{}),c=n.__d),c)return n.__E=n}catch(f){e=f}throw e}},co=0,dn=function(e){return e!=null&&e.constructor==null},Ke.prototype.setState=function(e,t){var r;r=this.__s!=null&&this.__s!==this.state?this.__s:this.__s=j({},this.state),typeof e=="function"&&(e=e(j({},r),this.props)),e&&j(r,e),e!=null&&this.__v&&(t&&this._sb.push(t),io(this))},Ke.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),io(this))},Ke.prototype.render=ie,Z=[],lo=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,Lt=function(e,t){return e.__v.__b-t.__v.__b},Je.__r=0,uo=/(PointerCapture)$|Capture$/i,Ot=0,Ut=so(!1),Dt=so(!0),mn=0;function qt(){return(qt=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o])}return e}).apply(this,arguments)}var bn=["context","children"];function wn(e){this.getChildContext=function(){return e.context};var t=e.children,r=function(o,n){if(o==null)return{};var a,c,f={},l=Object.keys(o);for(c=0;c<l.length;c++)n.indexOf(a=l[c])>=0||(f[a]=o[a]);return f}(e,bn);return jt(t,r)}function vn(){var e=new CustomEvent("_preact",{detail:{},bubbles:!0,cancelable:!0});this.dispatchEvent(e),this._vdom=Q(wn,qt({},this._props,{context:e.detail.context}),function t(r,o){if(r.nodeType===3)return r.data;if(r.nodeType!==1)return null;var n=[],a={},c=0,f=r.attributes,l=r.childNodes;for(c=f.length;c--;)f[c].name!=="slot"&&(a[f[c].name]=f[c].value,a[go(f[c].name)]=f[c].value);for(c=l.length;c--;){var x=t(l[c],null),d=l[c].slot;d?a[d]=Q(yo,{name:d},x):n[c]=x}var s=o?Q(yo,null,n):n;return Q(o||r.nodeName.toLowerCase(),a,s)}(this,this._vdomComponent)),(this.hasAttribute("hydrate")?Wt:be)(this._vdom,this._root)}function go(e){return e.replace(/-(\w)/g,function(t,r){return r?r.toUpperCase():""})}function Sn(e,t,r){if(this._vdom){var o={};o[e]=r=r??void 0,o[go(e)]=r,this._vdom=jt(this._vdom,o),be(this._vdom,this._root)}}function Fn(){be(this._vdom=null,this._root)}function yo(e,t){var r=this;return Q("slot",qt({},e,{ref:function(o){o?(r.ref=o,r._listener||(r._listener=function(n){n.stopPropagation(),n.detail.context=t},o.addEventListener("_preact",r._listener))):r.ref.removeEventListener("_preact",r._listener)}}))}function bo(e,t,r,o){function n(){var a=Reflect.construct(HTMLElement,[],n);return a._vdomComponent=e,a._root=o&&o.shadow?a.attachShadow({mode:o.mode||"open"}):a,a}return(n.prototype=Object.create(HTMLElement.prototype)).constructor=n,n.prototype.connectedCallback=vn,n.prototype.attributeChangedCallback=Sn,n.prototype.disconnectedCallback=Fn,r=r||e.observedAttributes||Object.keys(e.propTypes||{}),n.observedAttributes=r,r.forEach(function(a){Object.defineProperty(n.prototype,a,{get:function(){return this._vdom.props[a]},set:function(c){this._vdom?this.attributeChangedCallback(a,null,c):(this._props||(this._props={}),this._props[a]=c,this.connectedCallback());var f=typeof c;c!=null&&f!=="string"&&f!=="boolean"&&f!=="number"||this.setAttribute(a,c)}})}),customElements.define(t||e.tagName||e.displayName||e.name,n)}var we,H,Kt,wo,Xe=0,ko=[],L=P,vo=L.__b,So=L.__r,Fo=L.diffed,To=L.__c,Eo=L.unmount,Io=L.__;function Gt(e,t){L.__h&&L.__h(H,e,Xe||t),Xe=0;var r=H.__H||(H.__H={__:[],__h:[]});return e>=r.__.length&&r.__.push({}),r.__[e]}function Xt(e){return Xe=1,Tn(Mo,e)}function Tn(e,t,r){var o=Gt(we++,2);if(o.t=e,!o.__c&&(o.__=[r?r(t):Mo(void 0,t),function(f){var l=o.__N?o.__N[0]:o.__[0],x=o.t(l,f);l!==x&&(o.__N=[x,o.__[1]],o.__c.setState({}))}],o.__c=H,!H.u)){var n=function(f,l,x){if(!o.__c.__H)return!0;var d=o.__c.__H.__.filter(function(m){return!!m.__c});if(d.every(function(m){return!m.__N}))return!a||a.call(this,f,l,x);var s=o.__c.props!==f;return d.forEach(function(m){if(m.__N){var u=m.__[0];m.__=m.__N,m.__N=void 0,u!==m.__[0]&&(s=!0)}}),a&&a.call(this,f,l,x)||s};H.u=!0;var a=H.shouldComponentUpdate,c=H.componentWillUpdate;H.componentWillUpdate=function(f,l,x){if(this.__e){var d=a;a=void 0,n(f,l,x),a=d}c&&c.call(this,f,l,x)},H.shouldComponentUpdate=n}return o.__N||o.__}function Ao(e,t){var r=Gt(we++,3);!L.__s&&Ro(r.__H,t)&&(r.__=e,r.i=t,H.__H.__h.push(r))}function Ye(e,t){var r=Gt(we++,7);return Ro(r.__H,t)&&(r.__=e(),r.__H=t,r.__h=e),r.__}function Po(e,t){return Xe=8,Ye(function(){return e},t)}function En(){for(var e;e=ko.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(Ge),e.__H.__h.forEach(Jt),e.__H.__h=[]}catch(t){e.__H.__h=[],L.__e(t,e.__v)}}L.__b=function(e){H=null,vo&&vo(e)},L.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),Io&&Io(e,t)},L.__r=function(e){So&&So(e),we=0;var t=(H=e.__c).__H;t&&(Kt===H?(t.__h=[],H.__h=[],t.__.forEach(function(r){r.__N&&(r.__=r.__N),r.i=r.__N=void 0})):(t.__h.forEach(Ge),t.__h.forEach(Jt),t.__h=[],we=0)),Kt=H},L.diffed=function(e){Fo&&Fo(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(ko.push(t)!==1&&wo===L.requestAnimationFrame||((wo=L.requestAnimationFrame)||In)(En)),t.__H.__.forEach(function(r){r.i&&(r.__H=r.i),r.i=void 0})),Kt=H=null},L.__c=function(e,t){t.some(function(r){try{r.__h.forEach(Ge),r.__h=r.__h.filter(function(o){return!o.__||Jt(o)})}catch(o){t.some(function(n){n.__h&&(n.__h=[])}),t=[],L.__e(o,r.__v)}}),To&&To(e,t)},L.unmount=function(e){Eo&&Eo(e);var t,r=e.__c;r&&r.__H&&(r.__H.__.forEach(function(o){try{Ge(o)}catch(n){t=n}}),r.__H=void 0,t&&L.__e(t,r.__v))};var Co=typeof requestAnimationFrame=="function";function In(e){var t,r=function(){clearTimeout(o),Co&&cancelAnimationFrame(t),setTimeout(e)},o=setTimeout(r,100);Co&&(t=requestAnimationFrame(r))}function Ge(e){var t=H,r=e.__c;typeof r=="function"&&(e.__c=void 0,r()),H=t}function Jt(e){var t=H;e.__c=e.__(),H=t}function Ro(e,t){return!e||e.length!==t.length||t.some(function(r,o){return r!==e[o]})}function Mo(e,t){return typeof t=="function"?t(e):t}var Cn=0,ks=Array.isArray;function Bo(e,t,r,o,n,a){t||(t={});var c,f,l=t;"ref"in t&&(c=t.ref,delete t.ref);var x={type:e,props:l,key:r,ref:c,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--Cn,__i:-1,__u:0,__source:n,__self:a};if(typeof e=="function"&&(c=e.defaultProps))for(f in c)l[f]===void 0&&(l[f]=c[f]);return P.vnode&&P.vnode(x),x}function kn(){let e=oo();if(!e){console.error("modalBuilderSteps not found");return}e.sharing(window.FrakSetup?.modalShareConfig??{}).display()}function Ze({text:e="Share and earn!",classname:t="",useReward:r,noRewardText:o}){let n=Ye(()=>r!==void 0,[r]),[a,c]=Xt(!0),[f,l]=Xt(void 0),x=Po(()=>{if(c(!1),!n)return;let s=window.FrakSetup?.client;if(!s){console.warn("Frak client not ready yet");return}At(s).then(m=>{m?.estimatedEurReward&&l(`${m.estimatedEurReward} \u20AC`)})},[n]);Ao(()=>(Ht("add",x),()=>Ht("remove",x)),[x]);let d=Ye(()=>n?f?e.includes("{REWARD}")?e.replace("{REWARD}",f):`${e} ${f}`:o??e.replace("{REWARD}",""):e,[n,e,o,f]);return Bo("button",{type:"button",class:t,disabled:a,onClick:kn,children:d})}customElements.get("frak-button-share")||bo(Ze,"frak-button-share",["text"],{shadow:!1});Gr(async function(){if(!window.FrakSetup?.config){console.error("window.FrakSetup.config not found");return}let t=await It({config:window.FrakSetup.config});if(!t){console.error("Failed to create Frak client");return}window.FrakSetup.client=t,eo(),to(t),ro(t)});return No(An);})();
|
|
3
|
+
/*! Bundled license information:
|
|
4
|
+
|
|
5
|
+
js-sha256/src/sha256.js:
|
|
6
|
+
(**
|
|
7
|
+
* [js-sha256]{@link https://github.com/emn178/js-sha256}
|
|
8
|
+
*
|
|
9
|
+
* @version 0.11.0
|
|
10
|
+
* @author Chen, Yi-Cyuan [emn178@gmail.com]
|
|
11
|
+
* @copyright Chen, Yi-Cyuan 2014-2024
|
|
12
|
+
* @license MIT
|
|
13
|
+
*)
|
|
14
|
+
|
|
15
|
+
@noble/hashes/esm/utils.js:
|
|
16
|
+
(*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) *)
|
|
17
|
+
*/
|
package/package.json
CHANGED
|
@@ -11,17 +11,17 @@
|
|
|
11
11
|
"url": "https://twitter.com/QNivelais"
|
|
12
12
|
}
|
|
13
13
|
],
|
|
14
|
-
"version": "0.0.
|
|
14
|
+
"version": "0.0.5",
|
|
15
15
|
"description": "Frak Wallet components, helping any person to interact with the Frak wallet.",
|
|
16
16
|
"repository": {
|
|
17
17
|
"url": "https://github.com/frak-id/wallet",
|
|
18
|
-
"directory": "
|
|
18
|
+
"directory": "sdk/components"
|
|
19
19
|
},
|
|
20
|
-
"homepage": "https://docs.frak.id/
|
|
20
|
+
"homepage": "https://docs.frak.id/components",
|
|
21
21
|
"keywords": [
|
|
22
22
|
"frak-labs",
|
|
23
23
|
"nexus-wallet",
|
|
24
|
-
"erc-
|
|
24
|
+
"erc-frak",
|
|
25
25
|
"eip-4337",
|
|
26
26
|
"smart-wallet",
|
|
27
27
|
"components",
|
|
@@ -30,28 +30,34 @@
|
|
|
30
30
|
"license": "GNU GPL 3.0",
|
|
31
31
|
"sideEffects": false,
|
|
32
32
|
"private": false,
|
|
33
|
+
"publishConfig": {
|
|
34
|
+
"access": "public"
|
|
35
|
+
},
|
|
33
36
|
"type": "module",
|
|
34
|
-
"main": "dist/components.js",
|
|
35
37
|
"files": [
|
|
36
|
-
"/
|
|
38
|
+
"/cdn"
|
|
37
39
|
],
|
|
40
|
+
"main": "./cdn/components.js",
|
|
41
|
+
"browser": "./cdn/components.js",
|
|
38
42
|
"scripts": {
|
|
39
43
|
"lint": "biome lint .",
|
|
40
44
|
"format:check": "biome check .",
|
|
41
45
|
"format": "biome check --write .",
|
|
42
|
-
"clean": "rimraf
|
|
46
|
+
"clean": "rimraf cdn",
|
|
43
47
|
"build": "tsup",
|
|
44
|
-
"build:watch": "tsup --watch"
|
|
48
|
+
"build:watch": "tsup --watch",
|
|
49
|
+
"typecheck": "tsc --noEmit",
|
|
50
|
+
"prepublish": "bun run lint && bun run build",
|
|
51
|
+
"publish": "bun publish"
|
|
45
52
|
},
|
|
46
53
|
"dependencies": {
|
|
47
|
-
"preact": "^10.25.
|
|
54
|
+
"preact": "^10.25.2",
|
|
48
55
|
"preact-custom-element": "^4.3.0"
|
|
49
56
|
},
|
|
50
57
|
"devDependencies": {
|
|
51
|
-
"@total-typescript/tsconfig": "^1.0.4",
|
|
52
58
|
"@types/node": "^22",
|
|
53
59
|
"@types/preact-custom-element": "^4.0.4",
|
|
54
60
|
"tsup": "^8.3.5",
|
|
55
61
|
"typescript": "^5"
|
|
56
62
|
}
|
|
57
|
-
}
|
|
63
|
+
}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
"use strict";var FrakComponents=(()=>{var Ho=Object.create;var Ee=Object.defineProperty;var Lo=Object.getOwnPropertyDescriptor;var Uo=Object.getOwnPropertyNames;var Do=Object.getPrototypeOf,No=Object.prototype.hasOwnProperty;var Gt=(e=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(e,{get:(t,r)=>(typeof require<"u"?require:t)[r]}):e)(function(e){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+e+'" is not supported')});var B=(e,t)=>()=>(e&&(t=e(e=0)),t);var Xt=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),Oo=(e,t)=>{for(var r in t)Ee(e,r,{get:t[r],enumerable:!0})},Yt=(e,t,r,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of Uo(t))!No.call(e,n)&&n!==r&&Ee(e,n,{get:()=>t[n],enumerable:!(o=Lo(t,n))||o.enumerable});return e};var Fe=(e,t,r)=>(r=e!=null?Ho(Do(e)):{},Yt(t||!e||!e.__esModule?Ee(r,"default",{value:e,enumerable:!0}):r,e)),zo=e=>Yt(Ee({},"__esModule",{value:!0}),e);var ot=Xt((se,rt)=>{"use strict";(function(e,t){if(typeof se=="object"&&typeof rt=="object")rt.exports=t();else if(typeof define=="function"&&define.amd)define([],t);else{var r=t();for(var o in r)(typeof se=="object"?se:e)[o]=r[o]}})(se,()=>(()=>{"use strict";var e={48:function(r,o,n){var a=this&&this.__awaiter||function(u,_,i,p){return new(i||(i=Promise))(function(b,T){function g(m){try{P(p.next(m))}catch(y){T(y)}}function E(m){try{P(p.throw(m))}catch(y){T(y)}}function P(m){var y;m.done?b(m.value):(y=m.value,y instanceof i?y:new i(function(F){F(y)})).then(g,E)}P((p=p.apply(u,_||[])).next())})},c=this&&this.__generator||function(u,_){var i,p,b,T,g={label:0,sent:function(){if(1&b[0])throw b[1];return b[1]},trys:[],ops:[]};return T={next:E(0),throw:E(1),return:E(2)},typeof Symbol=="function"&&(T[Symbol.iterator]=function(){return this}),T;function E(P){return function(m){return function(y){if(i)throw new TypeError("Generator is already executing.");for(;T&&(T=0,y[0]&&(g=0)),g;)try{if(i=1,p&&(b=2&y[0]?p.return:y[0]?p.throw||((b=p.return)&&b.call(p),0):p.next)&&!(b=b.call(p,y[1])).done)return b;switch(p=0,b&&(y=[2&y[0],b.value]),y[0]){case 0:case 1:b=y;break;case 4:return g.label++,{value:y[1],done:!1};case 5:g.label++,p=y[1],y=[0];continue;case 7:y=g.ops.pop(),g.trys.pop();continue;default:if(!((b=(b=g.trys).length>0&&b[b.length-1])||y[0]!==6&&y[0]!==2)){g=0;continue}if(y[0]===3&&(!b||y[1]>b[0]&&y[1]<b[3])){g.label=y[1];break}if(y[0]===6&&g.label<b[1]){g.label=b[1],b=y;break}if(b&&g.label<b[2]){g.label=b[2],g.ops.push(y);break}b[2]&&g.ops.pop(),g.trys.pop();continue}y=_.call(u,g)}catch(F){y=[6,F],p=0}finally{i=b=0}if(5&y[0])throw y[1];return{value:y[0]?y[1]:void 0,done:!0}}([P,m])}}};Object.defineProperty(o,"__esModule",{value:!0}),o.decompressFromUTF16=o.compressToUTF16=o.decompressFromBase64=o.compressToBase64=void 0;var f=n(304),l=n(134),x=new f.CompressorImpl,d=new l.DecompressorImpl,s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",h={};o.compressToBase64=function(u){return a(this,void 0,void 0,function(){var _;return c(this,function(i){switch(i.label){case 0:return u===null?[2,""]:[4,x.compress(u,6,function(p){return s.charAt(p)})];case 1:switch((_=i.sent()).length%4){default:case 0:return[2,_];case 1:return[2,_+"==="];case 2:return[2,_+"=="];case 3:return[2,_+"="]}return[2]}})})},o.decompressFromBase64=function(u){return a(this,void 0,void 0,function(){return c(this,function(_){switch(_.label){case 0:return u===null?[2,""]:u===""?[2,null]:[4,d.decompress(u.length,32,function(i){return function(p,b){if(!h[p]){h[p]={};for(var T=0;T<p.length;T++)h[p][p.charAt(T)]=T}return h[p][b]}(s,u.charAt(i))})];case 1:return[2,_.sent()]}})})},o.compressToUTF16=function(u){return a(this,void 0,void 0,function(){return c(this,function(_){switch(_.label){case 0:return u===null?[2,""]:[4,x.compress(u,15,function(i){return String.fromCharCode(i+32)})];case 1:return[2,_.sent()+" "]}})})},o.decompressFromUTF16=function(u){return a(this,void 0,void 0,function(){return c(this,function(_){switch(_.label){case 0:return u===null?[2,""]:u===""?[2,null]:[4,d.decompress(u.length,16384,function(i){return u.charCodeAt(i)-32})];case 1:return[2,_.sent()]}})})}},304:function(r,o,n){var a=this&&this.__awaiter||function(d,s,h,u){return new(h||(h=Promise))(function(_,i){function p(g){try{T(u.next(g))}catch(E){i(E)}}function b(g){try{T(u.throw(g))}catch(E){i(E)}}function T(g){var E;g.done?_(g.value):(E=g.value,E instanceof h?E:new h(function(P){P(E)})).then(p,b)}T((u=u.apply(d,s||[])).next())})},c=this&&this.__generator||function(d,s){var h,u,_,i,p={label:0,sent:function(){if(1&_[0])throw _[1];return _[1]},trys:[],ops:[]};return i={next:b(0),throw:b(1),return:b(2)},typeof Symbol=="function"&&(i[Symbol.iterator]=function(){return this}),i;function b(T){return function(g){return function(E){if(h)throw new TypeError("Generator is already executing.");for(;i&&(i=0,E[0]&&(p=0)),p;)try{if(h=1,u&&(_=2&E[0]?u.return:E[0]?u.throw||((_=u.return)&&_.call(u),0):u.next)&&!(_=_.call(u,E[1])).done)return _;switch(u=0,_&&(E=[2&E[0],_.value]),E[0]){case 0:case 1:_=E;break;case 4:return p.label++,{value:E[1],done:!1};case 5:p.label++,u=E[1],E=[0];continue;case 7:E=p.ops.pop(),p.trys.pop();continue;default:if(!((_=(_=p.trys).length>0&&_[_.length-1])||E[0]!==6&&E[0]!==2)){p=0;continue}if(E[0]===3&&(!_||E[1]>_[0]&&E[1]<_[3])){p.label=E[1];break}if(E[0]===6&&p.label<_[1]){p.label=_[1],_=E;break}if(_&&p.label<_[2]){p.label=_[2],p.ops.push(E);break}_[2]&&p.ops.pop(),p.trys.pop();continue}E=s.call(d,p)}catch(P){E=[6,P],u=0}finally{h=_=0}if(5&E[0])throw E[1];return{value:E[0]?E[1]:void 0,done:!0}}([T,g])}}};Object.defineProperty(o,"__esModule",{value:!0}),o.CompressorImpl=void 0;var f=n(658),l=[0,8,4,12,2,10,6,14,1,9,5,13,3,11,7,15],x=function(){function d(){}return d.writeValueToData=function(s,h,u,_,i){if(u%4!=0||s.dataPosition+u>_-1)for(var p=0;p<u;p++)s.dataVal=s.dataVal<<1|1&h,s.dataPosition==_-1?(s.dataPosition=0,s.data.push(i(s.dataVal)),s.dataVal=0):s.dataPosition++,h>>=1;else s.dataVal<<=u,s.dataVal|=function(b,T){for(var g=0,E=0;E<T;++E)g<<=4,g|=l[15&b],b>>=4;return g}(h,u/4),s.dataPosition+=u},d.writeWToDataVal=function(s,h,u){s.dictionaryToCreate.has(s.w)?(s.w.charCodeAt(0)<256?(d.writeValueToData(s,0,s.numBits,h,u),d.writeValueToData(s,s.w.charCodeAt(0),8,h,u)):(d.writeValueToData(s,1,s.numBits,h,u),d.writeValueToData(s,s.w.charCodeAt(0),16,h,u)),s.enlargeIn--,s.enlargeIn==0&&(s.enlargeIn=Math.pow(2,s.numBits),s.numBits++),s.dictionaryToCreate.delete(s.w)):d.writeValueToData(s,s.dictionary.get(s.w),s.numBits,h,u),s.enlargeIn--,s.enlargeIn==0&&(s.enlargeIn=Math.pow(2,s.numBits),s.numBits++)},d.loopIteration=function(s,h,u,_,i){var p=s.charAt(h);i.dictionary.has(p)||(i.dictionary.set(p,i.dictSize++),i.dictionaryToCreate.set(p,!0));var b=i.w+p;i.dictionary.has(b)?i.w=b:(this.writeWToDataVal(i,u,_),i.dictionary.set(b,i.dictSize++),i.w=String(p))},d.prototype.compress=function(s,h,u){var _=this;return new Promise(function(i){return a(_,void 0,void 0,function(){var p,b;return c(this,function(T){switch(T.label){case 0:if(s==null)return i(""),[2];p={data:[],dataPosition:0,dataVal:0,dictionary:new Map,dictionaryToCreate:new Map,dictSize:3,enlargeIn:2,numBits:2,w:""},b=0,T.label=1;case 1:return b<s.length?(d.loopIteration(s,b,h,u,p),b%1e4!=0?[3,3]:[4,(0,f.wait)()]):[3,4];case 2:T.sent(),T.label=3;case 3:return b+=1,[3,1];case 4:return p.w!==""&&d.writeWToDataVal(p,h,u),d.writeValueToData(p,2,p.numBits,h,u),p.dataVal<<=h-p.dataPosition,p.data.push(u(p.dataVal)),i(p.data.join("")),[2]}})})})},d}();o.CompressorImpl=x},134:function(r,o,n){var a=this&&this.__awaiter||function(x,d,s,h){return new(s||(s=Promise))(function(u,_){function i(T){try{b(h.next(T))}catch(g){_(g)}}function p(T){try{b(h.throw(T))}catch(g){_(g)}}function b(T){var g;T.done?u(T.value):(g=T.value,g instanceof s?g:new s(function(E){E(g)})).then(i,p)}b((h=h.apply(x,d||[])).next())})},c=this&&this.__generator||function(x,d){var s,h,u,_,i={label:0,sent:function(){if(1&u[0])throw u[1];return u[1]},trys:[],ops:[]};return _={next:p(0),throw:p(1),return:p(2)},typeof Symbol=="function"&&(_[Symbol.iterator]=function(){return this}),_;function p(b){return function(T){return function(g){if(s)throw new TypeError("Generator is already executing.");for(;_&&(_=0,g[0]&&(i=0)),i;)try{if(s=1,h&&(u=2&g[0]?h.return:g[0]?h.throw||((u=h.return)&&u.call(h),0):h.next)&&!(u=u.call(h,g[1])).done)return u;switch(h=0,u&&(g=[2&g[0],u.value]),g[0]){case 0:case 1:u=g;break;case 4:return i.label++,{value:g[1],done:!1};case 5:i.label++,h=g[1],g=[0];continue;case 7:g=i.ops.pop(),i.trys.pop();continue;default:if(!((u=(u=i.trys).length>0&&u[u.length-1])||g[0]!==6&&g[0]!==2)){i=0;continue}if(g[0]===3&&(!u||g[1]>u[0]&&g[1]<u[3])){i.label=g[1];break}if(g[0]===6&&i.label<u[1]){i.label=u[1],u=g;break}if(u&&i.label<u[2]){i.label=u[2],i.ops.push(g);break}u[2]&&i.ops.pop(),i.trys.pop();continue}g=d.call(x,i)}catch(E){g=[6,E],h=0}finally{s=u=0}if(5&g[0])throw g[1];return{value:g[0]?g[1]:void 0,done:!0}}([b,T])}}};Object.defineProperty(o,"__esModule",{value:!0}),o.DecompressorImpl=void 0;var f=n(658),l=function(){function x(){}return x.prototype.decompress=function(d,s,h){var u=this;return new Promise(function(_){return a(u,void 0,void 0,function(){var i,p,b;return c(this,function(T){switch(T.label){case 0:for(i={bits:0,c:null,dataIndex:1,dataPosition:s,dataVal:h(0),dictionary:new Map,dictSize:4,enlargeIn:4,entry:"",maxPower:Math.pow(2,2),numBits:3,power:1,resb:null,result:[],w:null},p=0;p<3;p+=1)i.dictionary.set(p,p);for(;i.power!=i.maxPower;)i.resb=i.dataVal&i.dataPosition,i.dataPosition>>=1,i.dataPosition==0&&(i.dataPosition=s,i.dataVal=h(i.dataIndex++)),i.bits|=(i.resb>0?1:0)*i.power,i.power<<=1;switch(i.bits){case 0:for(i.bits=0,i.maxPower=Math.pow(2,8),i.power=1;i.power!=i.maxPower;)i.resb=i.dataVal&i.dataPosition,i.dataPosition>>=1,i.dataPosition==0&&(i.dataPosition=s,i.dataVal=h(i.dataIndex++)),i.bits|=(i.resb>0?1:0)*i.power,i.power<<=1;i.c=String.fromCharCode(i.bits);break;case 1:for(i.bits=0,i.maxPower=Math.pow(2,16),i.power=1;i.power!==i.maxPower;)i.resb=i.dataVal&i.dataPosition,i.dataPosition>>=1,i.dataPosition===0&&(i.dataPosition=s,i.dataVal=h(i.dataIndex++)),i.bits|=(i.resb>0?1:0)*i.power,i.power<<=1;i.c=String.fromCharCode(i.bits);break;case 2:return _(""),[2]}i.dictionary[3]=i.c,i.w=i.c,i.result.push(i.c),b=1,T.label=1;case 1:return b%2e4!=0?[3,3]:[4,(0,f.wait)()];case 2:T.sent(),T.label=3;case 3:if(i.dataIndex>d)return _(""),[2];for(i.bits=0,i.maxPower=Math.pow(2,i.numBits),i.power=1;i.power!=i.maxPower;)i.resb=i.dataVal&i.dataPosition,i.dataPosition>>=1,i.dataPosition==0&&(i.dataPosition=s,i.dataVal=h(i.dataIndex++)),i.bits|=(i.resb>0?1:0)*i.power,i.power<<=1;switch(i.c=i.bits){case 0:for(i.bits=0,i.maxPower=Math.pow(2,8),i.power=1;i.power!==i.maxPower;)i.resb=i.dataVal&i.dataPosition,i.dataPosition>>=1,i.dataPosition==0&&(i.dataPosition=s,i.dataVal=h(i.dataIndex++)),i.bits|=(i.resb>0?1:0)*i.power,i.power<<=1;i.dictionary[i.dictSize++]=String.fromCharCode(i.bits),i.c=i.dictSize-1,i.enlargeIn--;break;case 1:for(i.bits=0,i.maxPower=Math.pow(2,16),i.power=1;i.power!==i.maxPower;)i.resb=i.dataVal&i.dataPosition,i.dataPosition>>=1,i.dataPosition==0&&(i.dataPosition=s,i.dataVal=h(i.dataIndex++)),i.bits|=(i.resb>0?1:0)*i.power,i.power<<=1;i.dictionary[i.dictSize++]=String.fromCharCode(i.bits),i.c=i.dictSize-1,i.enlargeIn--;break;case 2:return _(i.result.join("")),[2]}if(i.enlargeIn==0&&(i.enlargeIn=Math.pow(2,i.numBits),i.numBits++),i.dictionary[i.c])i.entry=i.dictionary[i.c];else{if(i.c!==i.dictSize)return _(null),[2];i.entry=i.w+i.w.charAt(0)}return i.result.push(i.entry),i.dictionary[i.dictSize++]=i.w+i.entry.charAt(0),i.enlargeIn--,i.w=i.entry,i.enlargeIn==0&&(i.enlargeIn=Math.pow(2,i.numBits),i.numBits++),b++,[3,1];case 4:return[2]}})})})},x}();o.DecompressorImpl=l},658:function(r,o){var n=this&&this.__awaiter||function(c,f,l,x){return new(l||(l=Promise))(function(d,s){function h(i){try{_(x.next(i))}catch(p){s(p)}}function u(i){try{_(x.throw(i))}catch(p){s(p)}}function _(i){var p;i.done?d(i.value):(p=i.value,p instanceof l?p:new l(function(b){b(p)})).then(h,u)}_((x=x.apply(c,f||[])).next())})},a=this&&this.__generator||function(c,f){var l,x,d,s,h={label:0,sent:function(){if(1&d[0])throw d[1];return d[1]},trys:[],ops:[]};return s={next:u(0),throw:u(1),return:u(2)},typeof Symbol=="function"&&(s[Symbol.iterator]=function(){return this}),s;function u(_){return function(i){return function(p){if(l)throw new TypeError("Generator is already executing.");for(;s&&(s=0,p[0]&&(h=0)),h;)try{if(l=1,x&&(d=2&p[0]?x.return:p[0]?x.throw||((d=x.return)&&d.call(x),0):x.next)&&!(d=d.call(x,p[1])).done)return d;switch(x=0,d&&(p=[2&p[0],d.value]),p[0]){case 0:case 1:d=p;break;case 4:return h.label++,{value:p[1],done:!1};case 5:h.label++,x=p[1],p=[0];continue;case 7:p=h.ops.pop(),h.trys.pop();continue;default:if(!((d=(d=h.trys).length>0&&d[d.length-1])||p[0]!==6&&p[0]!==2)){h=0;continue}if(p[0]===3&&(!d||p[1]>d[0]&&p[1]<d[3])){h.label=p[1];break}if(p[0]===6&&h.label<d[1]){h.label=d[1],d=p;break}if(d&&h.label<d[2]){h.label=d[2],h.ops.push(p);break}d[2]&&h.ops.pop(),h.trys.pop();continue}p=f.call(c,h)}catch(b){p=[6,b],x=0}finally{l=d=0}if(5&p[0])throw p[1];return{value:p[0]?p[1]:void 0,done:!0}}([_,i])}}};Object.defineProperty(o,"__esModule",{value:!0}),o.wait=void 0,o.wait=function(){return n(this,void 0,void 0,function(){return a(this,function(c){return[2,new Promise(function(f){setTimeout(f,0)})]})})}}},t={};return function r(o){var n=t[o];if(n!==void 0)return n.exports;var a=t[o]={exports:{}};return e[o].call(a.exports,a,a.exports,r),a.exports}(48)})())});var nt=Xt(($n,Ce)=>{"use strict";(function(){"use strict";var e="input is invalid type",t=typeof window=="object",r=t?window:{};r.JS_SHA256_NO_WINDOW&&(t=!1);var o=!t&&typeof self=="object",n=!r.JS_SHA256_NO_NODE_JS&&typeof process=="object"&&process.versions&&process.versions.node;n?r=global:o&&(r=self);var a=!r.JS_SHA256_NO_COMMON_JS&&typeof Ce=="object"&&Ce.exports,c=typeof define=="function"&&define.amd,f=!r.JS_SHA256_NO_ARRAY_BUFFER&&typeof ArrayBuffer<"u",l="0123456789abcdef".split(""),x=[-2147483648,8388608,32768,128],d=[24,16,8,0],s=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],h=["hex","array","digest","arrayBuffer"],u=[];(r.JS_SHA256_NO_NODE_JS||!Array.isArray)&&(Array.isArray=function(m){return Object.prototype.toString.call(m)==="[object Array]"}),f&&(r.JS_SHA256_NO_ARRAY_BUFFER_IS_VIEW||!ArrayBuffer.isView)&&(ArrayBuffer.isView=function(m){return typeof m=="object"&&m.buffer&&m.buffer.constructor===ArrayBuffer});var _=function(m,y){return function(F){return new g(y,!0).update(F)[m]()}},i=function(m){var y=_("hex",m);n&&(y=p(y,m)),y.create=function(){return new g(m)},y.update=function(I){return y.create().update(I)};for(var F=0;F<h.length;++F){var S=h[F];y[S]=_(S,m)}return y},p=function(m,y){var F=Gt("crypto"),S=Gt("buffer").Buffer,I=y?"sha224":"sha256",w;S.from&&!r.JS_SHA256_NO_BUFFER_FROM?w=S.from:w=function(v){return new S(v)};var C=function(v){if(typeof v=="string")return F.createHash(I).update(v,"utf8").digest("hex");if(v==null)throw new Error(e);return v.constructor===ArrayBuffer&&(v=new Uint8Array(v)),Array.isArray(v)||ArrayBuffer.isView(v)||v.constructor===S?F.createHash(I).update(w(v)).digest("hex"):m(v)};return C},b=function(m,y){return function(F,S){return new E(F,y,!0).update(S)[m]()}},T=function(m){var y=b("hex",m);y.create=function(I){return new E(I,m)},y.update=function(I,w){return y.create(I).update(w)};for(var F=0;F<h.length;++F){var S=h[F];y[S]=b(S,m)}return y};function g(m,y){y?(u[0]=u[16]=u[1]=u[2]=u[3]=u[4]=u[5]=u[6]=u[7]=u[8]=u[9]=u[10]=u[11]=u[12]=u[13]=u[14]=u[15]=0,this.blocks=u):this.blocks=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],m?(this.h0=3238371032,this.h1=914150663,this.h2=812702999,this.h3=4144912697,this.h4=4290775857,this.h5=1750603025,this.h6=1694076839,this.h7=3204075428):(this.h0=1779033703,this.h1=3144134277,this.h2=1013904242,this.h3=2773480762,this.h4=1359893119,this.h5=2600822924,this.h6=528734635,this.h7=1541459225),this.block=this.start=this.bytes=this.hBytes=0,this.finalized=this.hashed=!1,this.first=!0,this.is224=m}g.prototype.update=function(m){if(!this.finalized){var y,F=typeof m;if(F!=="string"){if(F==="object"){if(m===null)throw new Error(e);if(f&&m.constructor===ArrayBuffer)m=new Uint8Array(m);else if(!Array.isArray(m)&&(!f||!ArrayBuffer.isView(m)))throw new Error(e)}else throw new Error(e);y=!0}for(var S,I=0,w,C=m.length,v=this.blocks;I<C;){if(this.hashed&&(this.hashed=!1,v[0]=this.block,this.block=v[16]=v[1]=v[2]=v[3]=v[4]=v[5]=v[6]=v[7]=v[8]=v[9]=v[10]=v[11]=v[12]=v[13]=v[14]=v[15]=0),y)for(w=this.start;I<C&&w<64;++I)v[w>>>2]|=m[I]<<d[w++&3];else for(w=this.start;I<C&&w<64;++I)S=m.charCodeAt(I),S<128?v[w>>>2]|=S<<d[w++&3]:S<2048?(v[w>>>2]|=(192|S>>>6)<<d[w++&3],v[w>>>2]|=(128|S&63)<<d[w++&3]):S<55296||S>=57344?(v[w>>>2]|=(224|S>>>12)<<d[w++&3],v[w>>>2]|=(128|S>>>6&63)<<d[w++&3],v[w>>>2]|=(128|S&63)<<d[w++&3]):(S=65536+((S&1023)<<10|m.charCodeAt(++I)&1023),v[w>>>2]|=(240|S>>>18)<<d[w++&3],v[w>>>2]|=(128|S>>>12&63)<<d[w++&3],v[w>>>2]|=(128|S>>>6&63)<<d[w++&3],v[w>>>2]|=(128|S&63)<<d[w++&3]);this.lastByteIndex=w,this.bytes+=w-this.start,w>=64?(this.block=v[16],this.start=w-64,this.hash(),this.hashed=!0):this.start=w}return this.bytes>4294967295&&(this.hBytes+=this.bytes/4294967296<<0,this.bytes=this.bytes%4294967296),this}},g.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var m=this.blocks,y=this.lastByteIndex;m[16]=this.block,m[y>>>2]|=x[y&3],this.block=m[16],y>=56&&(this.hashed||this.hash(),m[0]=this.block,m[16]=m[1]=m[2]=m[3]=m[4]=m[5]=m[6]=m[7]=m[8]=m[9]=m[10]=m[11]=m[12]=m[13]=m[14]=m[15]=0),m[14]=this.hBytes<<3|this.bytes>>>29,m[15]=this.bytes<<3,this.hash()}},g.prototype.hash=function(){var m=this.h0,y=this.h1,F=this.h2,S=this.h3,I=this.h4,w=this.h5,C=this.h6,v=this.h7,A=this.blocks,R,N,O,q,k,K,J,ae,et,tt,Te;for(R=16;R<64;++R)k=A[R-15],N=(k>>>7|k<<25)^(k>>>18|k<<14)^k>>>3,k=A[R-2],O=(k>>>17|k<<15)^(k>>>19|k<<13)^k>>>10,A[R]=A[R-16]+N+A[R-7]+O<<0;for(Te=y&F,R=0;R<64;R+=4)this.first?(this.is224?(ae=300032,k=A[0]-1413257819,v=k-150054599<<0,S=k+24177077<<0):(ae=704751109,k=A[0]-210244248,v=k-1521486534<<0,S=k+143694565<<0),this.first=!1):(N=(m>>>2|m<<30)^(m>>>13|m<<19)^(m>>>22|m<<10),O=(I>>>6|I<<26)^(I>>>11|I<<21)^(I>>>25|I<<7),ae=m&y,q=ae^m&F^Te,J=I&w^~I&C,k=v+O+J+s[R]+A[R],K=N+q,v=S+k<<0,S=k+K<<0),N=(S>>>2|S<<30)^(S>>>13|S<<19)^(S>>>22|S<<10),O=(v>>>6|v<<26)^(v>>>11|v<<21)^(v>>>25|v<<7),et=S&m,q=et^S&y^ae,J=v&I^~v&w,k=C+O+J+s[R+1]+A[R+1],K=N+q,C=F+k<<0,F=k+K<<0,N=(F>>>2|F<<30)^(F>>>13|F<<19)^(F>>>22|F<<10),O=(C>>>6|C<<26)^(C>>>11|C<<21)^(C>>>25|C<<7),tt=F&S,q=tt^F&m^et,J=C&v^~C&I,k=w+O+J+s[R+2]+A[R+2],K=N+q,w=y+k<<0,y=k+K<<0,N=(y>>>2|y<<30)^(y>>>13|y<<19)^(y>>>22|y<<10),O=(w>>>6|w<<26)^(w>>>11|w<<21)^(w>>>25|w<<7),Te=y&F,q=Te^y&S^tt,J=w&C^~w&v,k=I+O+J+s[R+3]+A[R+3],K=N+q,I=m+k<<0,m=k+K<<0,this.chromeBugWorkAround=!0;this.h0=this.h0+m<<0,this.h1=this.h1+y<<0,this.h2=this.h2+F<<0,this.h3=this.h3+S<<0,this.h4=this.h4+I<<0,this.h5=this.h5+w<<0,this.h6=this.h6+C<<0,this.h7=this.h7+v<<0},g.prototype.hex=function(){this.finalize();var m=this.h0,y=this.h1,F=this.h2,S=this.h3,I=this.h4,w=this.h5,C=this.h6,v=this.h7,A=l[m>>>28&15]+l[m>>>24&15]+l[m>>>20&15]+l[m>>>16&15]+l[m>>>12&15]+l[m>>>8&15]+l[m>>>4&15]+l[m&15]+l[y>>>28&15]+l[y>>>24&15]+l[y>>>20&15]+l[y>>>16&15]+l[y>>>12&15]+l[y>>>8&15]+l[y>>>4&15]+l[y&15]+l[F>>>28&15]+l[F>>>24&15]+l[F>>>20&15]+l[F>>>16&15]+l[F>>>12&15]+l[F>>>8&15]+l[F>>>4&15]+l[F&15]+l[S>>>28&15]+l[S>>>24&15]+l[S>>>20&15]+l[S>>>16&15]+l[S>>>12&15]+l[S>>>8&15]+l[S>>>4&15]+l[S&15]+l[I>>>28&15]+l[I>>>24&15]+l[I>>>20&15]+l[I>>>16&15]+l[I>>>12&15]+l[I>>>8&15]+l[I>>>4&15]+l[I&15]+l[w>>>28&15]+l[w>>>24&15]+l[w>>>20&15]+l[w>>>16&15]+l[w>>>12&15]+l[w>>>8&15]+l[w>>>4&15]+l[w&15]+l[C>>>28&15]+l[C>>>24&15]+l[C>>>20&15]+l[C>>>16&15]+l[C>>>12&15]+l[C>>>8&15]+l[C>>>4&15]+l[C&15];return this.is224||(A+=l[v>>>28&15]+l[v>>>24&15]+l[v>>>20&15]+l[v>>>16&15]+l[v>>>12&15]+l[v>>>8&15]+l[v>>>4&15]+l[v&15]),A},g.prototype.toString=g.prototype.hex,g.prototype.digest=function(){this.finalize();var m=this.h0,y=this.h1,F=this.h2,S=this.h3,I=this.h4,w=this.h5,C=this.h6,v=this.h7,A=[m>>>24&255,m>>>16&255,m>>>8&255,m&255,y>>>24&255,y>>>16&255,y>>>8&255,y&255,F>>>24&255,F>>>16&255,F>>>8&255,F&255,S>>>24&255,S>>>16&255,S>>>8&255,S&255,I>>>24&255,I>>>16&255,I>>>8&255,I&255,w>>>24&255,w>>>16&255,w>>>8&255,w&255,C>>>24&255,C>>>16&255,C>>>8&255,C&255];return this.is224||A.push(v>>>24&255,v>>>16&255,v>>>8&255,v&255),A},g.prototype.array=g.prototype.digest,g.prototype.arrayBuffer=function(){this.finalize();var m=new ArrayBuffer(this.is224?28:32),y=new DataView(m);return y.setUint32(0,this.h0),y.setUint32(4,this.h1),y.setUint32(8,this.h2),y.setUint32(12,this.h3),y.setUint32(16,this.h4),y.setUint32(20,this.h5),y.setUint32(24,this.h6),this.is224||y.setUint32(28,this.h7),m};function E(m,y,F){var S,I=typeof m;if(I==="string"){var w=[],C=m.length,v=0,A;for(S=0;S<C;++S)A=m.charCodeAt(S),A<128?w[v++]=A:A<2048?(w[v++]=192|A>>>6,w[v++]=128|A&63):A<55296||A>=57344?(w[v++]=224|A>>>12,w[v++]=128|A>>>6&63,w[v++]=128|A&63):(A=65536+((A&1023)<<10|m.charCodeAt(++S)&1023),w[v++]=240|A>>>18,w[v++]=128|A>>>12&63,w[v++]=128|A>>>6&63,w[v++]=128|A&63);m=w}else if(I==="object"){if(m===null)throw new Error(e);if(f&&m.constructor===ArrayBuffer)m=new Uint8Array(m);else if(!Array.isArray(m)&&(!f||!ArrayBuffer.isView(m)))throw new Error(e)}else throw new Error(e);m.length>64&&(m=new g(y,!0).update(m).array());var R=[],N=[];for(S=0;S<64;++S){var O=m[S]||0;R[S]=92^O,N[S]=54^O}g.call(this,y,F),this.update(N),this.oKeyPad=R,this.inner=!0,this.sharedMemory=F}E.prototype=new g,E.prototype.finalize=function(){if(g.prototype.finalize.call(this),this.inner){this.inner=!1;var m=this.array();g.call(this,this.is224,this.sharedMemory),this.update(this.oKeyPad),this.update(m),g.prototype.finalize.call(this)}};var P=i();P.sha256=P,P.sha224=i(!0),P.sha256.hmac=T(),P.sha224.hmac=T(!0),a?Ce.exports=P:(r.sha256=P.sha256,r.sha224=P.sha224,c&&define(function(){return P}))})()});function oe(e,{strict:t=!0}={}){return!e||typeof e!="string"?!1:t?/^0x[0-9a-fA-F]*$/.test(e):e.startsWith("0x")}var Pe=B(()=>{"use strict"});function ut(e){return oe(e,{strict:!1})?Math.ceil((e.length-2)/2):e.length}var sr=B(()=>{"use strict";Pe()});var pt,cr=B(()=>{"use strict";pt="2.21.54"});function lr(e,t){return t?.(e)?e:e&&typeof e=="object"&&"cause"in e&&e.cause!==void 0?lr(e.cause,t):t?null:e}var ft,z,ue=B(()=>{"use strict";cr();ft={getDocsUrl:({docsBaseUrl:e,docsPath:t="",docsSlug:r})=>t?`${e??"https://viem.sh"}${t}${r?`#${r}`:""}`:void 0,version:`viem@${pt}`},z=class e extends Error{constructor(t,r={}){let o=r.cause instanceof e?r.cause.details:r.cause?.message?r.cause.message:r.details,n=r.cause instanceof e&&r.cause.docsPath||r.docsPath,a=ft.getDocsUrl?.({...r,docsPath:n}),c=[t||"An error occurred.","",...r.metaMessages?[...r.metaMessages,""]:[],...a?[`Docs: ${a}`]:[],...o?[`Details: ${o}`]:[],...ft.version?[`Version: ${ft.version}`]:[]].join(`
|
|
2
|
-
`);super(c,r.cause?{cause:r.cause}:void 0),Object.defineProperty(this,"details",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"docsPath",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"metaMessages",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"shortMessage",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"version",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:"BaseError"}),this.details=o,this.docsPath=n,this.metaMessages=r.metaMessages,this.name=r.name??this.name,this.shortMessage=t,this.version=pt}walk(t){return lr(this,t)}}});var pe,ur=B(()=>{"use strict";ue();pe=class extends z{constructor({size:t,targetSize:r,type:o}){super(`${o.charAt(0).toUpperCase()}${o.slice(1).toLowerCase()} size (${t}) exceeds padding size (${r}).`,{name:"SizeExceedsPaddingSizeError"})}}});function V(e,{dir:t,size:r=32}={}){return typeof e=="string"?pr(e,{dir:t,size:r}):fr(e,{dir:t,size:r})}function pr(e,{dir:t,size:r=32}={}){if(r===null)return e;let o=e.replace("0x","");if(o.length>r*2)throw new pe({size:Math.ceil(o.length/2),targetSize:r,type:"hex"});return`0x${o[t==="right"?"padEnd":"padStart"](r*2,"0")}`}function fr(e,{dir:t,size:r=32}={}){if(r===null)return e;if(e.length>r)throw new pe({size:e.length,targetSize:r,type:"bytes"});let o=new Uint8Array(r);for(let n=0;n<r;n++){let a=t==="right";o[a?n:r-n-1]=e[a?n:e.length-n-1]}return o}var Re=B(()=>{"use strict";ur()});var Be,He,dt=B(()=>{"use strict";ue();Be=class extends z{constructor({max:t,min:r,signed:o,size:n,value:a}){super(`Number "${a}" is not in safe ${n?`${n*8}-bit ${o?"signed":"unsigned"} `:""}integer range ${t?`(${r} to ${t})`:`(above ${r})`}`,{name:"IntegerOutOfRangeError"})}},He=class extends z{constructor({givenSize:t,maxSize:r}){super(`Size cannot exceed ${r} bytes. Given size: ${t} bytes.`,{name:"SizeOverflowError"})}}});function Y(e,{size:t}){if(ut(e)>t)throw new He({givenSize:ut(e),maxSize:t})}var mt=B(()=>{"use strict";dt();sr()});function G(e,t={}){return typeof e=="number"||typeof e=="bigint"?Le(e,t):typeof e=="string"?mr(e,t):typeof e=="boolean"?dr(e,t):fe(e,t)}function dr(e,t={}){let r=`0x${Number(e)}`;return typeof t.size=="number"?(Y(r,{size:t.size}),V(r,{size:t.size})):r}function fe(e,t={}){let r="";for(let n=0;n<e.length;n++)r+=jo[e[n]];let o=`0x${r}`;return typeof t.size=="number"?(Y(o,{size:t.size}),V(o,{dir:"right",size:t.size})):o}function Le(e,t={}){let{signed:r,size:o}=t,n=BigInt(e),a;o?r?a=(1n<<BigInt(o)*8n-1n)-1n:a=2n**(BigInt(o)*8n)-1n:typeof e=="number"&&(a=BigInt(Number.MAX_SAFE_INTEGER));let c=typeof a=="bigint"&&r?-a-1n:0;if(a&&n>a||n<c){let l=typeof e=="bigint"?"n":"";throw new Be({max:a?`${a}${l}`:void 0,min:`${c}${l}`,signed:r,size:o,value:`${e}${l}`})}let f=`0x${(r&&n<0?(1n<<BigInt(o*8))+BigInt(n):n).toString(16)}`;return o?V(f,{size:o}):f}function mr(e,t={}){let r=qo.encode(e);return fe(r,t)}var jo,qo,Ue=B(()=>{"use strict";dt();Re();mt();jo=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));qo=new TextEncoder});function ht(e,t={}){return typeof e=="number"||typeof e=="bigint"?yr(e,t):typeof e=="boolean"?xr(e,t):oe(e)?de(e,t):De(e,t)}function xr(e,t={}){let r=new Uint8Array(1);return r[0]=Number(e),typeof t.size=="number"?(Y(r,{size:t.size}),V(r,{size:t.size})):r}function hr(e){if(e>=W.zero&&e<=W.nine)return e-W.zero;if(e>=W.A&&e<=W.F)return e-(W.A-10);if(e>=W.a&&e<=W.f)return e-(W.a-10)}function de(e,t={}){let r=e;t.size&&(Y(r,{size:t.size}),r=V(r,{dir:"right",size:t.size}));let o=r.slice(2);o.length%2&&(o=`0${o}`);let n=o.length/2,a=new Uint8Array(n);for(let c=0,f=0;c<n;c++){let l=hr(o.charCodeAt(f++)),x=hr(o.charCodeAt(f++));if(l===void 0||x===void 0)throw new z(`Invalid byte sequence ("${o[f-2]}${o[f-1]}" in "${o}").`);a[c]=l*16+x}return a}function yr(e,t){let r=Le(e,t);return de(r)}function De(e,t={}){let r=Ko.encode(e);return typeof t.size=="number"?(Y(r,{size:t.size}),V(r,{dir:"right",size:t.size})):r}var Ko,W,Ne=B(()=>{"use strict";ue();Pe();Re();mt();Ue();Ko=new TextEncoder;W={zero:48,nine:57,A:65,F:70,a:97,f:102}});function xt(e){if(!Number.isSafeInteger(e)||e<0)throw new Error("positive integer expected, got "+e)}function Jo(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&e.constructor.name==="Uint8Array"}function me(e,...t){if(!Jo(e))throw new Error("Uint8Array expected");if(t.length>0&&!t.includes(e.length))throw new Error("Uint8Array expected of length "+t+", got length="+e.length)}function yt(e,t=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(t&&e.finished)throw new Error("Hash#digest() has already been called")}function _r(e,t){me(e);let r=t.outputLen;if(e.length<r)throw new Error("digestInto() expects output buffer of length at least "+r)}var _t=B(()=>{"use strict"});function Go(e,t=!1){return t?{h:Number(e&Oe),l:Number(e>>gr&Oe)}:{h:Number(e>>gr&Oe)|0,l:Number(e&Oe)|0}}function br(e,t=!1){let r=new Uint32Array(e.length),o=new Uint32Array(e.length);for(let n=0;n<e.length;n++){let{h:a,l:c}=Go(e[n],t);[r[n],o[n]]=[a,c]}return[r,o]}var Oe,gr,wr,vr,Sr,Tr,Er=B(()=>{"use strict";Oe=BigInt(4294967295),gr=BigInt(32);wr=(e,t,r)=>e<<r|t>>>32-r,vr=(e,t,r)=>t<<r|e>>>32-r,Sr=(e,t,r)=>t<<r-32|e>>>64-r,Tr=(e,t,r)=>e<<r-32|t>>>64-r});function bt(e){for(let t=0;t<e.length;t++)e[t]=Xo(e[t])}function Yo(e){if(typeof e!="string")throw new Error("utf8ToBytes expected string, got "+typeof e);return new Uint8Array(new TextEncoder().encode(e))}function Ve(e){return typeof e=="string"&&(e=Yo(e)),me(e),e}function Ir(e){let t=o=>e().update(Ve(o)).digest(),r=e();return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=()=>e(),t}function Cr(e){let t=(o,n)=>e(n).update(Ve(o)).digest(),r=e({});return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=o=>e(o),t}var Fr,gt,Xo,ze,Ar=B(()=>{"use strict";_t();Fr=e=>new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4)),gt=new Uint8Array(new Uint32Array([287454020]).buffer)[0]===68,Xo=e=>e<<24&4278190080|e<<8&16711680|e>>>8&65280|e>>>24&255;ze=class{clone(){return this._cloneInto()}}});function an(e,t=24){let r=new Uint32Array(10);for(let o=24-t;o<24;o++){for(let c=0;c<10;c++)r[c]=e[c]^e[c+10]^e[c+20]^e[c+30]^e[c+40];for(let c=0;c<10;c+=2){let f=(c+8)%10,l=(c+2)%10,x=r[l],d=r[l+1],s=kr(x,d,1)^r[f],h=Mr(x,d,1)^r[f+1];for(let u=0;u<50;u+=10)e[c+u]^=s,e[c+u+1]^=h}let n=e[2],a=e[3];for(let c=0;c<24;c++){let f=Rr[c],l=kr(n,a,f),x=Mr(n,a,f),d=Pr[c];n=e[d],a=e[d+1],e[d]=l,e[d+1]=x}for(let c=0;c<50;c+=10){for(let f=0;f<10;f++)r[f]=e[c+f];for(let f=0;f<10;f++)e[c+f]^=~r[(f+2)%10]&r[(f+4)%10]}e[0]^=on[o],e[1]^=nn[o]}r.fill(0)}var Pr,Rr,Br,Zo,he,Qo,en,tn,rn,on,nn,kr,Mr,$e,X,Zi,Qi,ea,ta,ra,Hr,oa,na,Lr,ia,aa,Ur=B(()=>{"use strict";_t();Er();Ar();Pr=[],Rr=[],Br=[],Zo=BigInt(0),he=BigInt(1),Qo=BigInt(2),en=BigInt(7),tn=BigInt(256),rn=BigInt(113);for(let e=0,t=he,r=1,o=0;e<24;e++){[r,o]=[o,(2*r+3*o)%5],Pr.push(2*(5*o+r)),Rr.push((e+1)*(e+2)/2%64);let n=Zo;for(let a=0;a<7;a++)t=(t<<he^(t>>en)*rn)%tn,t&Qo&&(n^=he<<(he<<BigInt(a))-he);Br.push(n)}[on,nn]=br(Br,!0),kr=(e,t,r)=>r>32?Sr(e,t,r):wr(e,t,r),Mr=(e,t,r)=>r>32?Tr(e,t,r):vr(e,t,r);$e=class e extends ze{constructor(t,r,o,n=!1,a=24){if(super(),this.blockLen=t,this.suffix=r,this.outputLen=o,this.enableXOF=n,this.rounds=a,this.pos=0,this.posOut=0,this.finished=!1,this.destroyed=!1,xt(o),0>=this.blockLen||this.blockLen>=200)throw new Error("Sha3 supports only keccak-f1600 function");this.state=new Uint8Array(200),this.state32=Fr(this.state)}keccak(){gt||bt(this.state32),an(this.state32,this.rounds),gt||bt(this.state32),this.posOut=0,this.pos=0}update(t){yt(this);let{blockLen:r,state:o}=this;t=Ve(t);let n=t.length;for(let a=0;a<n;){let c=Math.min(r-this.pos,n-a);for(let f=0;f<c;f++)o[this.pos++]^=t[a++];this.pos===r&&this.keccak()}return this}finish(){if(this.finished)return;this.finished=!0;let{state:t,suffix:r,pos:o,blockLen:n}=this;t[o]^=r,r&128&&o===n-1&&this.keccak(),t[n-1]^=128,this.keccak()}writeInto(t){yt(this,!1),me(t),this.finish();let r=this.state,{blockLen:o}=this;for(let n=0,a=t.length;n<a;){this.posOut>=o&&this.keccak();let c=Math.min(o-this.posOut,a-n);t.set(r.subarray(this.posOut,this.posOut+c),n),this.posOut+=c,n+=c}return t}xofInto(t){if(!this.enableXOF)throw new Error("XOF is not possible for this instance");return this.writeInto(t)}xof(t){return xt(t),this.xofInto(new Uint8Array(t))}digestInto(t){if(_r(t,this),this.finished)throw new Error("digest() was already called");return this.writeInto(t),this.destroy(),t}digest(){return this.digestInto(new Uint8Array(this.outputLen))}destroy(){this.destroyed=!0,this.state.fill(0)}_cloneInto(t){let{blockLen:r,suffix:o,outputLen:n,rounds:a,enableXOF:c}=this;return t||(t=new e(r,o,n,c,a)),t.state32.set(this.state32),t.pos=this.pos,t.posOut=this.posOut,t.finished=this.finished,t.rounds=a,t.suffix=o,t.outputLen=n,t.enableXOF=c,t.destroyed=this.destroyed,t}},X=(e,t,r)=>Ir(()=>new $e(t,e,r)),Zi=X(6,144,224/8),Qi=X(6,136,256/8),ea=X(6,104,384/8),ta=X(6,72,512/8),ra=X(1,144,224/8),Hr=X(1,136,256/8),oa=X(1,104,384/8),na=X(1,72,512/8),Lr=(e,t,r)=>Cr((o={})=>new $e(t,e,o.dkLen===void 0?r:o.dkLen,!0)),ia=Lr(31,168,128/8),aa=Lr(31,136,256/8)});function xe(e,t){let r=t||"hex",o=Hr(oe(e,{strict:!1})?ht(e):e);return r==="bytes"?o:G(o)}var wt=B(()=>{"use strict";Ur();Pe();Ne();Ue()});var ye,Dr=B(()=>{"use strict";ue();ye=class extends z{constructor({address:t}){super(`Address "${t}" is invalid.`,{metaMessages:["- Address must be a hex value of 20 bytes (40 hex characters).","- Address must match its checksum counterpart."],name:"InvalidAddressError"})}}});var ne,vt=B(()=>{"use strict";ne=class extends Map{constructor(t){super(),Object.defineProperty(this,"maxSize",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.maxSize=t}get(t){let r=super.get(t);return super.has(t)&&r!==void 0&&(this.delete(t),super.set(t,r)),r}set(t,r){if(super.set(t,r),this.maxSize&&this.size>this.maxSize){let o=this.keys().next().value;o&&this.delete(o)}return this}}});function Nr(e,t){if(St.has(`${e}.${t}`))return St.get(`${e}.${t}`);let r=t?`${t}${e.toLowerCase()}`:e.substring(2).toLowerCase(),o=xe(De(r),"bytes"),n=(t?r.substring(`${t}0x`.length):r).split("");for(let c=0;c<40;c+=2)o[c>>1]>>4>=8&&n[c]&&(n[c]=n[c].toUpperCase()),(o[c>>1]&15)>=8&&n[c+1]&&(n[c+1]=n[c+1].toUpperCase());let a=`0x${n.join("")}`;return St.set(`${e}.${t}`,a),a}var St,Or=B(()=>{"use strict";Ne();wt();vt();St=new ne(8192)});function Et(e,t){let{strict:r=!0}=t??{},o=`${e}.${r}`;if(Tt.has(o))return Tt.get(o);let n=sn.test(e)?e.toLowerCase()===e?!0:r?Nr(e)===e:!0:!1;return Tt.set(o,n),n}var sn,Tt,zr=B(()=>{"use strict";vt();Or();sn=/^0x[a-fA-F0-9]{40}$/,Tt=new ne(8192)});function We(e){return`0x${e.reduce((t,r)=>t+r.replace("0x",""),"")}`}var Vr=B(()=>{"use strict"});function Ft(e,t){if(!Et(e,{strict:!1}))throw new ye({address:e});if(!Et(t,{strict:!1}))throw new ye({address:t});return e.toLowerCase()===t.toLowerCase()}var $r=B(()=>{"use strict";Dr();zr()});var Hn={};Oo(Hn,{ButtonShare:()=>Qe});function Zt(e){document.readyState==="complete"||document.readyState==="interactive"?setTimeout(e,1):document.addEventListener?document.addEventListener("DOMContentLoaded",e):document.attachEvent("onreadystatechange",()=>{document.readyState==="complete"&&e()})}var U=class extends Error{constructor(r,o,n){super(o);this.code=r;this.data=n}};var Ie=class extends U{constructor(t){super(D.internalError,t)}};var D={parseError:-32700,invalidRequest:-32600,methodNotFound:-32601,invalidParams:-32602,internalError:-32603,serverError:-32e3,clientNotConnected:-32001,configError:-32002,corruptedResponse:-32003,clientAborted:-32004,walletNotConnected:-32005,serverErrorForInteractionDelegation:-32006};var $=class{_promise;_resolve;_reject;constructor(){this._promise=new Promise((t,r)=>{this._resolve=t,this._reject=r})}get promise(){return this._promise}resolve=t=>{this._resolve?.(t)};reject=t=>{this._reject?.(t)}};var Vo=(e="button[data-frak-share-button], #nexus-share-button > button")=>document.querySelectorAll(e),$o=(e,t)=>{if(e){t?.removeAttribute("disabled");return}t?.setAttribute("disabled","")},Qt=e=>t=>{let r=Array.from(Vo(t?.metadata?.buttonShare));for(let o of r)$o(e,o)},er=Qt(!0),tr=Qt(!1);var rr=Fe(ot(),1),it=Fe(nt(),1);async function ce(e){let t=(0,it.sha256)(JSON.stringify(e)),r={...e,validationHash:t},o=await at(r),n=(0,it.sha256)(o);return{compressed:o,compressedHash:n}}async function at(e){return(0,rr.compressToBase64)(JSON.stringify(e))}var or=Fe(ot(),1),st=Fe(nt(),1);async function le(e){if(!(e?.compressed&&e?.compressedHash))throw new U(D.corruptedResponse,"Missing compressed data");let t=await ct(e.compressed);if(!t)throw new U(D.corruptedResponse,"Invalid compressed data");if(!t?.validationHash)throw new U(D.corruptedResponse,"Missing validation hash");if((0,st.sha256)(e.compressed)!==e.compressedHash)throw new U(D.corruptedResponse,"Invalid compressed hash");let{validationHash:o,...n}=t;if((0,st.sha256)(JSON.stringify(n))!==t.validationHash)throw new U(D.corruptedResponse,"Invalid data validation hash");return t}async function ct(e){let t=await(0,or.decompressFromBase64)(e);try{return JSON.parse(t)}catch(r){return console.error("Invalid compressed data",{e:r,decompressed:t}),null}}var re="nexus-wallet-backup";function nr(){let e=new Map;return{createChannel:t=>{let r=Math.random().toString(36).substring(7);return e.set(r,t),r},getRpcResolver:t=>e.get(t),removeChannel:t=>e.delete(t),destroy:()=>e.clear()}}var Ae={id:"nexus-wallet",name:"nexus-wallet",allow:"publickey-credentials-get *; clipboard-write; web-share *",style:{width:"0",height:"0",border:"0",position:"absolute",zIndex:1e3,top:"-1000px",left:"-1000px"}};function ke({walletBaseUrl:e,config:t}){tr(t);let r=document.querySelector("#nexus-wallet");r&&r.remove();let o=document.createElement("iframe");return o.id=Ae.id,o.name=Ae.name,o.allow=Ae.allow,o.style.zIndex=Ae.style.zIndex.toString(),lt({iframe:o,isVisible:!1}),document.body.appendChild(o),new Promise(n=>{o?.addEventListener("load",()=>n(o)),o.src=`${e??t?.walletUrl??"https://wallet.frak.id"}/listener`})}function lt({iframe:e,isVisible:t}){if(!t){e.style.width="0",e.style.height="0",e.style.border="0",e.style.position="fixed",e.style.top="-1000px",e.style.left="-1000px";return}e.style.position="fixed",e.style.top="0",e.style.left="0",e.style.width="100%",e.style.height="100%",e.style.pointerEvents="auto"}function ir({iframe:e}){let t=new $;return{handleEvent:async o=>{switch(o.iframeLifecycle){case"connected":t.resolve(!0);break;case"do-backup":o.data.backup?localStorage.setItem(re,o.data.backup):localStorage.removeItem(re);break;case"remove-backup":localStorage.removeItem(re);break;case"show":case"hide":lt({iframe:e,isVisible:o.iframeLifecycle==="show"});break}},isConnected:t.promise}}function ar({nexusWalletUrl:e,iframe:t,channelManager:r,iframeLifecycleManager:o}){if(typeof window>"u")throw new U(D.configError,"iframe client should be used in the browser");if(!t.contentWindow)throw new U(D.configError,"The iframe does not have a product window");let n=t.contentWindow,a=async l=>{if(!(l.origin&&URL.canParse(l.origin))||new URL(l.origin).origin.toLowerCase()!==new URL(e).origin.toLowerCase())return;if("iframeLifecycle"in l.data){await o.handleEvent(l.data);return}if("clientLifecycle"in l.data){console.error("Client lifecycle event received on the client side, dismissing it");return}let x=l.data.id,d=r.getRpcResolver(x);d&&await d(l.data)};return window.addEventListener("message",a),{sendEvent:l=>{n.postMessage(l,{targetOrigin:e})},cleanup:()=>{window.removeEventListener("message",a)}}}function Me({config:e,iframe:t}){let r=nr(),o=ir({iframe:t}),n=ar({nexusWalletUrl:e?.walletUrl??"https://wallet.frak.id",iframe:t,channelManager:r,iframeLifecycleManager:o}),a=async x=>{if(!await o.isConnected)throw new U(D.clientNotConnected,"The iframe provider isn't connected yet");let s=new $,h=r.createChannel(async _=>{let i=await le(_.data);i.error?s.reject(new U(i.error.code,i.error.message,i.error?.data)):s.resolve(i.result),r.removeChannel(h)}),u=await ce(x);return n.sendEvent({id:h,topic:x.method,data:u}),s.promise},c=async(x,d)=>{if(!await o.isConnected)throw new U(D.clientNotConnected,"The iframe provider isn't connected yet");let h=r.createChannel(async _=>{let i=await le(_.data);if(i.result)d(i.result);else throw new Ie("No valid result in the response")}),u=await ce(x);n.sendEvent({id:h,topic:x.method,data:u})},f=async()=>{r.destroy(),n.cleanup(),t.remove()},l=Wo({config:e,messageHandler:n,lifecycleManager:o});return{config:e,waitForConnection:o.isConnected,waitForSetup:l,request:a,listenerRequest:c,destroy:f}}async function Wo({config:e,messageHandler:t,lifecycleManager:r}){await r.isConnected,er(e);let o=async()=>{let a=e.metadata.css;a&&t.sendEvent({clientLifecycle:"modal-css",data:{cssLink:a}})},n=async()=>{if(typeof window>"u")return;let a=window.localStorage.getItem(re);a&&t.sendEvent({clientLifecycle:"restore-backup",data:{backup:a}})};await Promise.all([o(),n()])}Ne();Ue();Vr();$r();wt();Re();var It="fCtx";function cn(e){return btoa(Array.from(e,t=>String.fromCharCode(t)).join("")).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}function ln(e){let t=e.length%4;return Uint8Array.from(atob(e.replace(/-/g,"+").replace(/_/g,"/").padEnd(e.length+(t===0?0:4-t),"=")),r=>r.charCodeAt(0))}function Wr(e){if(e?.r)try{let t=de(e.r);return cn(t)}catch(t){console.error("Error compressing Frak context",{e:t,context:e})}}function jr(e){if(!(!e||e.length===0))try{let t=ln(e);return{r:fe(t,{size:20})}}catch(t){console.error("Error decompressing Frak context",{e:t,context:e})}}function qr({url:e}){if(!e)return null;let r=new URL(e).searchParams.get(It);return r?jr(r):null}function Kr({url:e,context:t}){if(!e)return null;let r=qr({url:e}),o=r?{...r,...t}:t;if(!o.r)return null;let n=Wr(o);if(!n)return null;let a=new URL(e);return a.searchParams.set(It,n),a.toString()}function Jr(e){let t=new URL(e);return t.searchParams.delete(It),t.toString()}function un({url:e,context:t}){if(!window.location?.href||typeof window>"u"){console.error("No window found, can't update context");return}let r=e??window.location.href,o;t!==null?o=Kr({url:r,context:t}):o=Jr(r),o&&window.history.replaceState(null,"",o.toString())}var Z={compress:Wr,decompress:jr,parse:qr,update:Kr,remove:Jr,replaceUrl:un};var je={dapp:1,press:2,webshop:3,referral:30,purchase:31},Va=Object.entries(je).reduce((e,[t,r])=>(e[t]=BigInt(1)<<BigInt(r),e),{});var Ct={press:{openArticle:"0xc0a24ffb",readArticle:"0xd5bd0fbe"},dapp:{proofVerifiableStorageUpdate:"0x2ab2aeef",callableVerifiableStorageUpdate:"0xa07da986"},webshop:{open:"0xb311798f"},referral:{referred:"0x010cc3b9",createLink:"0xb2c0f17c"},purchase:{started:"0xd87e90c3",completed:"0x8403aeb4",unsafeCompleted:"0x4d5b14e0"}};function At(e,t){if(!t)return e.request({method:"frak_listenToWalletStatus"}).then(n=>(Gr(n.interactionToken),n));let r=new $,o=!1;return e.listenerRequest({method:"frak_listenToWalletStatus"},n=>{t(n),Gr(n.interactionToken),o||(r.resolve(n),o=!0)}).then(()=>r.promise)}function Gr(e){typeof window>"u"||(e?window.sessionStorage.setItem("frak-wallet-interaction-token",e):window.sessionStorage.removeItem("frak.interaction-token"))}function Xr({domain:e}){let t=e??window.location.host;return xe(G(t))}async function kt(e,{productId:t,interaction:r,validation:o}){let n=t??Xr(e.config);return await e.request({method:"frak_sendInteraction",params:[n,r,o]})}async function _e(e,{steps:t,metadata:r}){return await e.request({method:"frak_displayModal",params:[t,e.config.metadata.name,r]})}function Mt(e,{metadata:t,login:r,openSession:o}){return qe(e,{steps:{login:r??{},openSession:o??{}},metadata:t})}function qe(e,t){function r(c){return qe(e,{...t,steps:{...t.steps,sendTransaction:c}})}function o(c){return qe(e,{...t,steps:{...t.steps,final:{...c,action:{key:"reward"}}}})}function n(c,f){return qe(e,{...t,steps:{...t.steps,final:{...f,action:{key:"sharing",options:c}}}})}async function a(){return await _e(e,t)}return{params:t,sendTx:r,reward:o,sharing:n,display:a}}function pn(){let e=We([Ct.referral.createLink,"0x"]);return{handlerTypeDenominator:G(je.referral),interactionData:e}}function fn({referrer:e}){let t=We([Ct.referral.referred,V(e,{size:32})]);return{handlerTypeDenominator:G(je.referral),interactionData:t}}var Pt={createLink:pn,referred:fn};async function Yr(e,{walletStatus:t,frakContext:r,modalConfig:o,productId:n,options:a}){let c=!1;async function f(){if(!c)return c=!0,mn(e,{modalConfig:o,walletStatus:t})}async function l(x){let d=Pt.referred({referrer:x});await kt(e,{productId:n,interaction:d})}try{let{status:x,currentWallet:d}=await dn({initialWalletStatus:t,getFreshWalletStatus:f,pushReferralInteraction:l,frakContext:r});return Z.replaceUrl({url:window.location?.href,context:a?.alwaysAppendUrl?{r:d}:null}),x}catch(x){return console.log("Error processing referral",{error:x}),Z.replaceUrl({url:window.location?.href,context:a?.alwaysAppendUrl?{r:t?.wallet}:null}),hn(x)}}async function dn({initialWalletStatus:e,getFreshWalletStatus:t,pushReferralInteraction:r,frakContext:o}){let n=e?.wallet;return o?.r?(n||(n=await t()),n&&Ft(o.r,n)?{status:"self-referral",currentWallet:n}:(e?.interactionSession||(n=await t()),await r(o.r),{status:"success",currentWallet:n})):{status:"no-referrer",currentWallet:n}}async function mn(e,{modalConfig:t,walletStatus:r}){return r?.interactionSession?r.wallet??void 0:t?(await _e(e,t))?.login?.wallet??void 0:void 0}function hn(e){if(e instanceof U)switch(e.code){case D.walletNotConnected:return"no-wallet";case D.serverErrorForInteractionDelegation:return"no-session";default:return"error"}return"error"}async function Rt(e,{productId:t,modalConfig:r,options:o}={}){let n=Z.parse({url:window.location.href}),a=await At(e);try{return await Yr(e,{walletStatus:a,frakContext:n,modalConfig:r,productId:t,options:o})}catch(c){return c}}var Zr="frakClientReady",Ke;function xn(){let e=new CustomEvent(Zr);window.dispatchEvent(e)}function Bt(e,t){(e==="add"?window.addEventListener:window.removeEventListener)(Zr,t,!1)}async function Qr(){if(!window?.FrakSetup.config){console.error("window.FrakSetup.config not found");return}let e=await ke({config:window.FrakSetup.config});if(!e){console.error("Failed to create iframe");return}let t=Me({config:window.FrakSetup.config,iframe:e});if(!await t.waitForConnection){console.error("Failed to connect to Frak client");return}return window.FrakSetup.client=t,xn(),t}function eo(e){Ke=Mt(e,window.FrakSetup?.modalConfig??{})}async function to(e){if(!Ke){console.error("modalBuilderSteps not found");return}let t=await Rt(e,{modalConfig:Ke.reward().params});console.log("referral",t)}function ro(){return Ke}var we,M,so,yn,Q,oo,co,Ht,lo,Dt,Lt,Ut,_n,be={},uo=[],gn=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,Nt=Array.isArray;function j(e,t){for(var r in t)e[r]=t[r];return e}function Ot(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function ee(e,t,r){var o,n,a,c={};for(a in t)a=="key"?o=t[a]:a=="ref"?n=t[a]:c[a]=t[a];if(arguments.length>2&&(c.children=arguments.length>3?we.call(arguments,2):r),typeof e=="function"&&e.defaultProps!=null)for(a in e.defaultProps)c[a]===void 0&&(c[a]=e.defaultProps[a]);return ge(e,c,o,n,null)}function ge(e,t,r,o,n){var a={type:e,props:t,key:r,ref:o,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:n??++so,__i:-1,__u:0};return n==null&&M.vnode!=null&&M.vnode(a),a}function te(e){return e.children}function Ge(e,t){this.props=e,this.context=t}function ie(e,t){if(t==null)return e.__?ie(e.__,e.__i+1):null;for(var r;t<e.__k.length;t++)if((r=e.__k[t])!=null&&r.__e!=null)return r.__e;return typeof e.type=="function"?ie(e):null}function po(e){var t,r;if((e=e.__)!=null&&e.__c!=null){for(e.__e=e.__c.base=null,t=0;t<e.__k.length;t++)if((r=e.__k[t])!=null&&r.__e!=null){e.__e=e.__c.base=r.__e;break}return po(e)}}function no(e){(!e.__d&&(e.__d=!0)&&Q.push(e)&&!Xe.__r++||oo!==M.debounceRendering)&&((oo=M.debounceRendering)||co)(Xe)}function Xe(){var e,t,r,o,n,a,c,f;for(Q.sort(Ht);e=Q.shift();)e.__d&&(t=Q.length,o=void 0,a=(n=(r=e).__v).__e,c=[],f=[],r.__P&&((o=j({},n)).__v=n.__v+1,M.vnode&&M.vnode(o),zt(r.__P,o,n,r.__n,r.__P.namespaceURI,32&n.__u?[a]:null,c,a??ie(n),!!(32&n.__u),f),o.__v=n.__v,o.__.__k[o.__i]=o,ho(c,o,f),o.__e!=a&&po(o)),Q.length>t&&Q.sort(Ht));Xe.__r=0}function fo(e,t,r,o,n,a,c,f,l,x,d){var s,h,u,_,i,p,b=o&&o.__k||uo,T=t.length;for(l=bn(r,t,b,l),s=0;s<T;s++)(u=r.__k[s])!=null&&(h=u.__i===-1?be:b[u.__i]||be,u.__i=s,p=zt(e,u,h,n,a,c,f,l,x,d),_=u.__e,u.ref&&h.ref!=u.ref&&(h.ref&&Vt(h.ref,null,u),d.push(u.ref,u.__c||_,u)),i==null&&_!=null&&(i=_),4&u.__u||h.__k===u.__k?l=mo(u,l,e):typeof u.type=="function"&&p!==void 0?l=p:_&&(l=_.nextSibling),u.__u&=-7);return r.__e=i,l}function bn(e,t,r,o){var n,a,c,f,l,x=t.length,d=r.length,s=d,h=0;for(e.__k=[],n=0;n<x;n++)(a=t[n])!=null&&typeof a!="boolean"&&typeof a!="function"?(f=n+h,(a=e.__k[n]=typeof a=="string"||typeof a=="number"||typeof a=="bigint"||a.constructor==String?ge(null,a,null,null,null):Nt(a)?ge(te,{children:a},null,null,null):a.constructor===void 0&&a.__b>0?ge(a.type,a.props,a.key,a.ref?a.ref:null,a.__v):a).__=e,a.__b=e.__b+1,c=null,(l=a.__i=wn(a,r,f,s))!==-1&&(s--,(c=r[l])&&(c.__u|=2)),c==null||c.__v===null?(l==-1&&h--,typeof a.type!="function"&&(a.__u|=4)):l!==f&&(l==f-1?h--:l==f+1?h++:(l>f?h--:h++,a.__u|=4))):a=e.__k[n]=null;if(s)for(n=0;n<d;n++)(c=r[n])!=null&&!(2&c.__u)&&(c.__e==o&&(o=ie(c)),xo(c,c));return o}function mo(e,t,r){var o,n;if(typeof e.type=="function"){for(o=e.__k,n=0;o&&n<o.length;n++)o[n]&&(o[n].__=e,t=mo(o[n],t,r));return t}e.__e!=t&&(t&&e.type&&!r.contains(t)&&(t=ie(e)),r.insertBefore(e.__e,t||null),t=e.__e);do t=t&&t.nextSibling;while(t!=null&&t.nodeType===8);return t}function wn(e,t,r,o){var n=e.key,a=e.type,c=r-1,f=r+1,l=t[r];if(l===null||l&&n==l.key&&a===l.type&&!(2&l.__u))return r;if((typeof a!="function"||a===te||n)&&o>(l!=null&&!(2&l.__u)?1:0))for(;c>=0||f<t.length;){if(c>=0){if((l=t[c])&&!(2&l.__u)&&n==l.key&&a===l.type)return c;c--}if(f<t.length){if((l=t[f])&&!(2&l.__u)&&n==l.key&&a===l.type)return f;f++}}return-1}function io(e,t,r){t[0]==="-"?e.setProperty(t,r??""):e[t]=r==null?"":typeof r!="number"||gn.test(t)?r:r+"px"}function Je(e,t,r,o,n){var a;e:if(t==="style")if(typeof r=="string")e.style.cssText=r;else{if(typeof o=="string"&&(e.style.cssText=o=""),o)for(t in o)r&&t in r||io(e.style,t,"");if(r)for(t in r)o&&r[t]===o[t]||io(e.style,t,r[t])}else if(t[0]==="o"&&t[1]==="n")a=t!==(t=t.replace(lo,"$1")),t=t.toLowerCase()in e||t==="onFocusOut"||t==="onFocusIn"?t.toLowerCase().slice(2):t.slice(2),e.l||(e.l={}),e.l[t+a]=r,r?o?r.u=o.u:(r.u=Dt,e.addEventListener(t,a?Ut:Lt,a)):e.removeEventListener(t,a?Ut:Lt,a);else{if(n=="http://www.w3.org/2000/svg")t=t.replace(/xlink(H|:h)/,"h").replace(/sName$/,"s");else if(t!="width"&&t!="height"&&t!="href"&&t!="list"&&t!="form"&&t!="tabIndex"&&t!="download"&&t!="rowSpan"&&t!="colSpan"&&t!="role"&&t!="popover"&&t in e)try{e[t]=r??"";break e}catch{}typeof r=="function"||(r==null||r===!1&&t[4]!=="-"?e.removeAttribute(t):e.setAttribute(t,t=="popover"&&r==1?"":r))}}function ao(e){return function(t){if(this.l){var r=this.l[t.type+e];if(t.t==null)t.t=Dt++;else if(t.t<r.u)return;return r(M.event?M.event(t):t)}}}function zt(e,t,r,o,n,a,c,f,l,x){var d,s,h,u,_,i,p,b,T,g,E,P,m,y,F,S,I,w=t.type;if(t.constructor!==void 0)return null;128&r.__u&&(l=!!(32&r.__u),a=[f=t.__e=r.__e]),(d=M.__b)&&d(t);e:if(typeof w=="function")try{if(b=t.props,T="prototype"in w&&w.prototype.render,g=(d=w.contextType)&&o[d.__c],E=d?g?g.props.value:d.__:o,r.__c?p=(s=t.__c=r.__c).__=s.__E:(T?t.__c=s=new w(b,E):(t.__c=s=new Ge(b,E),s.constructor=w,s.render=Sn),g&&g.sub(s),s.props=b,s.state||(s.state={}),s.context=E,s.__n=o,h=s.__d=!0,s.__h=[],s._sb=[]),T&&s.__s==null&&(s.__s=s.state),T&&w.getDerivedStateFromProps!=null&&(s.__s==s.state&&(s.__s=j({},s.__s)),j(s.__s,w.getDerivedStateFromProps(b,s.__s))),u=s.props,_=s.state,s.__v=t,h)T&&w.getDerivedStateFromProps==null&&s.componentWillMount!=null&&s.componentWillMount(),T&&s.componentDidMount!=null&&s.__h.push(s.componentDidMount);else{if(T&&w.getDerivedStateFromProps==null&&b!==u&&s.componentWillReceiveProps!=null&&s.componentWillReceiveProps(b,E),!s.__e&&(s.shouldComponentUpdate!=null&&s.shouldComponentUpdate(b,s.__s,E)===!1||t.__v===r.__v)){for(t.__v!==r.__v&&(s.props=b,s.state=s.__s,s.__d=!1),t.__e=r.__e,t.__k=r.__k,t.__k.some(function(C){C&&(C.__=t)}),P=0;P<s._sb.length;P++)s.__h.push(s._sb[P]);s._sb=[],s.__h.length&&c.push(s);break e}s.componentWillUpdate!=null&&s.componentWillUpdate(b,s.__s,E),T&&s.componentDidUpdate!=null&&s.__h.push(function(){s.componentDidUpdate(u,_,i)})}if(s.context=E,s.props=b,s.__P=e,s.__e=!1,m=M.__r,y=0,T){for(s.state=s.__s,s.__d=!1,m&&m(t),d=s.render(s.props,s.state,s.context),F=0;F<s._sb.length;F++)s.__h.push(s._sb[F]);s._sb=[]}else do s.__d=!1,m&&m(t),d=s.render(s.props,s.state,s.context),s.state=s.__s;while(s.__d&&++y<25);s.state=s.__s,s.getChildContext!=null&&(o=j(j({},o),s.getChildContext())),T&&!h&&s.getSnapshotBeforeUpdate!=null&&(i=s.getSnapshotBeforeUpdate(u,_)),f=fo(e,Nt(S=d!=null&&d.type===te&&d.key==null?d.props.children:d)?S:[S],t,r,o,n,a,c,f,l,x),s.base=t.__e,t.__u&=-161,s.__h.length&&c.push(s),p&&(s.__E=s.__=null)}catch(C){if(t.__v=null,l||a!=null)if(C.then){for(t.__u|=l?160:128;f&&f.nodeType===8&&f.nextSibling;)f=f.nextSibling;a[a.indexOf(f)]=null,t.__e=f}else for(I=a.length;I--;)Ot(a[I]);else t.__e=r.__e,t.__k=r.__k;M.__e(C,t,r)}else a==null&&t.__v===r.__v?(t.__k=r.__k,t.__e=r.__e):f=t.__e=vn(r.__e,t,r,o,n,a,c,l,x);return(d=M.diffed)&&d(t),128&t.__u?void 0:f}function ho(e,t,r){for(var o=0;o<r.length;o++)Vt(r[o],r[++o],r[++o]);M.__c&&M.__c(t,e),e.some(function(n){try{e=n.__h,n.__h=[],e.some(function(a){a.call(n)})}catch(a){M.__e(a,n.__v)}})}function vn(e,t,r,o,n,a,c,f,l){var x,d,s,h,u,_,i,p=r.props,b=t.props,T=t.type;if(T==="svg"?n="http://www.w3.org/2000/svg":T==="math"?n="http://www.w3.org/1998/Math/MathML":n||(n="http://www.w3.org/1999/xhtml"),a!=null){for(x=0;x<a.length;x++)if((u=a[x])&&"setAttribute"in u==!!T&&(T?u.localName===T:u.nodeType===3)){e=u,a[x]=null;break}}if(e==null){if(T===null)return document.createTextNode(b);e=document.createElementNS(n,T,b.is&&b),f&&(M.__m&&M.__m(t,a),f=!1),a=null}if(T===null)p===b||f&&e.data===b||(e.data=b);else{if(a=a&&we.call(e.childNodes),p=r.props||be,!f&&a!=null)for(p={},x=0;x<e.attributes.length;x++)p[(u=e.attributes[x]).name]=u.value;for(x in p)if(u=p[x],x!="children"){if(x=="dangerouslySetInnerHTML")s=u;else if(!(x in b)){if(x=="value"&&"defaultValue"in b||x=="checked"&&"defaultChecked"in b)continue;Je(e,x,null,u,n)}}for(x in b)u=b[x],x=="children"?h=u:x=="dangerouslySetInnerHTML"?d=u:x=="value"?_=u:x=="checked"?i=u:f&&typeof u!="function"||p[x]===u||Je(e,x,u,p[x],n);if(d)f||s&&(d.__html===s.__html||d.__html===e.innerHTML)||(e.innerHTML=d.__html),t.__k=[];else if(s&&(e.innerHTML=""),fo(e,Nt(h)?h:[h],t,r,o,T==="foreignObject"?"http://www.w3.org/1999/xhtml":n,a,c,a?a[0]:r.__k&&ie(r,0),f,l),a!=null)for(x=a.length;x--;)Ot(a[x]);f||(x="value",T==="progress"&&_==null?e.removeAttribute("value"):_!==void 0&&(_!==e[x]||T==="progress"&&!_||T==="option"&&_!==p[x])&&Je(e,x,_,p[x],n),x="checked",i!==void 0&&i!==e[x]&&Je(e,x,i,p[x],n))}return e}function Vt(e,t,r){try{if(typeof e=="function"){var o=typeof e.__u=="function";o&&e.__u(),o&&t==null||(e.__u=e(t))}else e.current=t}catch(n){M.__e(n,r)}}function xo(e,t,r){var o,n;if(M.unmount&&M.unmount(e),(o=e.ref)&&(o.current&&o.current!==e.__e||Vt(o,null,t)),(o=e.__c)!=null){if(o.componentWillUnmount)try{o.componentWillUnmount()}catch(a){M.__e(a,t)}o.base=o.__P=null}if(o=e.__k)for(n=0;n<o.length;n++)o[n]&&xo(o[n],t,r||typeof e.type!="function");r||Ot(e.__e),e.__c=e.__=e.__e=void 0}function Sn(e,t,r){return this.constructor(e,r)}function ve(e,t,r){var o,n,a,c;t===document&&(t=document.documentElement),M.__&&M.__(e,t),n=(o=typeof r=="function")?null:r&&r.__k||t.__k,a=[],c=[],zt(t,e=(!o&&r||t).__k=ee(te,null,[e]),n||be,be,t.namespaceURI,!o&&r?[r]:n?null:t.firstChild?we.call(t.childNodes):null,a,!o&&r?r:n?n.__e:t.firstChild,o,c),ho(a,e,c)}function $t(e,t){ve(e,t,$t)}function Wt(e,t,r){var o,n,a,c,f=j({},e.props);for(a in e.type&&e.type.defaultProps&&(c=e.type.defaultProps),t)a=="key"?o=t[a]:a=="ref"?n=t[a]:f[a]=t[a]===void 0&&c!==void 0?c[a]:t[a];return arguments.length>2&&(f.children=arguments.length>3?we.call(arguments,2):r),ge(e.type,f,o||e.key,n||e.ref,null)}we=uo.slice,M={__e:function(e,t,r,o){for(var n,a,c;t=t.__;)if((n=t.__c)&&!n.__)try{if((a=n.constructor)&&a.getDerivedStateFromError!=null&&(n.setState(a.getDerivedStateFromError(e)),c=n.__d),n.componentDidCatch!=null&&(n.componentDidCatch(e,o||{}),c=n.__d),c)return n.__E=n}catch(f){e=f}throw e}},so=0,yn=function(e){return e!=null&&e.constructor==null},Ge.prototype.setState=function(e,t){var r;r=this.__s!=null&&this.__s!==this.state?this.__s:this.__s=j({},this.state),typeof e=="function"&&(e=e(j({},r),this.props)),e&&j(r,e),e!=null&&this.__v&&(t&&this._sb.push(t),no(this))},Ge.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),no(this))},Ge.prototype.render=te,Q=[],co=typeof Promise=="function"?Promise.prototype.then.bind(Promise.resolve()):setTimeout,Ht=function(e,t){return e.__v.__b-t.__v.__b},Xe.__r=0,lo=/(PointerCapture)$|Capture$/i,Dt=0,Lt=ao(!1),Ut=ao(!0),_n=0;function jt(){return(jt=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(e[o]=r[o])}return e}).apply(this,arguments)}var Tn=["context","children"];function En(e){this.getChildContext=function(){return e.context};var t=e.children,r=function(o,n){if(o==null)return{};var a,c,f={},l=Object.keys(o);for(c=0;c<l.length;c++)n.indexOf(a=l[c])>=0||(f[a]=o[a]);return f}(e,Tn);return Wt(t,r)}function Fn(){var e=new CustomEvent("_preact",{detail:{},bubbles:!0,cancelable:!0});this.dispatchEvent(e),this._vdom=ee(En,jt({},this._props,{context:e.detail.context}),function t(r,o){if(r.nodeType===3)return r.data;if(r.nodeType!==1)return null;var n=[],a={},c=0,f=r.attributes,l=r.childNodes;for(c=f.length;c--;)f[c].name!=="slot"&&(a[f[c].name]=f[c].value,a[_o(f[c].name)]=f[c].value);for(c=l.length;c--;){var x=t(l[c],null),d=l[c].slot;d?a[d]=ee(yo,{name:d},x):n[c]=x}var s=o?ee(yo,null,n):n;return ee(o||r.nodeName.toLowerCase(),a,s)}(this,this._vdomComponent)),(this.hasAttribute("hydrate")?$t:ve)(this._vdom,this._root)}function _o(e){return e.replace(/-(\w)/g,function(t,r){return r?r.toUpperCase():""})}function In(e,t,r){if(this._vdom){var o={};o[e]=r=r??void 0,o[_o(e)]=r,this._vdom=Wt(this._vdom,o),ve(this._vdom,this._root)}}function Cn(){ve(this._vdom=null,this._root)}function yo(e,t){var r=this;return ee("slot",jt({},e,{ref:function(o){o?(r.ref=o,r._listener||(r._listener=function(n){n.stopPropagation(),n.detail.context=t},o.addEventListener("_preact",r._listener))):r.ref.removeEventListener("_preact",r._listener)}}))}function go(e,t,r,o){function n(){var a=Reflect.construct(HTMLElement,[],n);return a._vdomComponent=e,a._root=o&&o.shadow?a.attachShadow({mode:o.mode||"open"}):a,a}return(n.prototype=Object.create(HTMLElement.prototype)).constructor=n,n.prototype.connectedCallback=Fn,n.prototype.attributeChangedCallback=In,n.prototype.disconnectedCallback=Cn,r=r||e.observedAttributes||Object.keys(e.propTypes||{}),n.observedAttributes=r,r.forEach(function(a){Object.defineProperty(n.prototype,a,{get:function(){return this._vdom.props[a]},set:function(c){this._vdom?this.attributeChangedCallback(a,null,c):(this._props||(this._props={}),this._props[a]=c,this.connectedCallback());var f=typeof c;c!=null&&f!=="string"&&f!=="boolean"&&f!=="number"||this.setAttribute(a,c)}})}),customElements.define(t||e.tagName||e.displayName||e.name,n)}var Se,H,qt,bo,Ze=0,Co=[],L=M,wo=L.__b,vo=L.__r,So=L.diffed,To=L.__c,Eo=L.unmount,Fo=L.__;function Jt(e,t){L.__h&&L.__h(H,e,Ze||t),Ze=0;var r=H.__H||(H.__H={__:[],__h:[]});return e>=r.__.length&&r.__.push({}),r.__[e]}function Ao(e){return Ze=1,An(Ro,e)}function An(e,t,r){var o=Jt(Se++,2);if(o.t=e,!o.__c&&(o.__=[r?r(t):Ro(void 0,t),function(f){var l=o.__N?o.__N[0]:o.__[0],x=o.t(l,f);l!==x&&(o.__N=[x,o.__[1]],o.__c.setState({}))}],o.__c=H,!H.u)){var n=function(f,l,x){if(!o.__c.__H)return!0;var d=o.__c.__H.__.filter(function(h){return!!h.__c});if(d.every(function(h){return!h.__N}))return!a||a.call(this,f,l,x);var s=o.__c.props!==f;return d.forEach(function(h){if(h.__N){var u=h.__[0];h.__=h.__N,h.__N=void 0,u!==h.__[0]&&(s=!0)}}),a&&a.call(this,f,l,x)||s};H.u=!0;var a=H.shouldComponentUpdate,c=H.componentWillUpdate;H.componentWillUpdate=function(f,l,x){if(this.__e){var d=a;a=void 0,n(f,l,x),a=d}c&&c.call(this,f,l,x)},H.shouldComponentUpdate=n}return o.__N||o.__}function ko(e,t){var r=Jt(Se++,3);!L.__s&&Po(r.__H,t)&&(r.__=e,r.i=t,H.__H.__h.push(r))}function kn(e,t){var r=Jt(Se++,7);return Po(r.__H,t)&&(r.__=e(),r.__H=t,r.__h=e),r.__}function Mo(e,t){return Ze=8,kn(function(){return e},t)}function Mn(){for(var e;e=Co.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(Ye),e.__H.__h.forEach(Kt),e.__H.__h=[]}catch(t){e.__H.__h=[],L.__e(t,e.__v)}}L.__b=function(e){H=null,wo&&wo(e)},L.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),Fo&&Fo(e,t)},L.__r=function(e){vo&&vo(e),Se=0;var t=(H=e.__c).__H;t&&(qt===H?(t.__h=[],H.__h=[],t.__.forEach(function(r){r.__N&&(r.__=r.__N),r.i=r.__N=void 0})):(t.__h.forEach(Ye),t.__h.forEach(Kt),t.__h=[],Se=0)),qt=H},L.diffed=function(e){So&&So(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(Co.push(t)!==1&&bo===L.requestAnimationFrame||((bo=L.requestAnimationFrame)||Pn)(Mn)),t.__H.__.forEach(function(r){r.i&&(r.__H=r.i),r.i=void 0})),qt=H=null},L.__c=function(e,t){t.some(function(r){try{r.__h.forEach(Ye),r.__h=r.__h.filter(function(o){return!o.__||Kt(o)})}catch(o){t.some(function(n){n.__h&&(n.__h=[])}),t=[],L.__e(o,r.__v)}}),To&&To(e,t)},L.unmount=function(e){Eo&&Eo(e);var t,r=e.__c;r&&r.__H&&(r.__H.__.forEach(function(o){try{Ye(o)}catch(n){t=n}}),r.__H=void 0,t&&L.__e(t,r.__v))};var Io=typeof requestAnimationFrame=="function";function Pn(e){var t,r=function(){clearTimeout(o),Io&&cancelAnimationFrame(t),setTimeout(e)},o=setTimeout(r,100);Io&&(t=requestAnimationFrame(r))}function Ye(e){var t=H,r=e.__c;typeof r=="function"&&(e.__c=void 0,r()),H=t}function Kt(e){var t=H;e.__c=e.__(),H=t}function Po(e,t){return!e||e.length!==t.length||t.some(function(r,o){return r!==e[o]})}function Ro(e,t){return typeof t=="function"?t(e):t}var Rn=0,Bs=Array.isArray;function Bo(e,t,r,o,n,a){t||(t={});var c,f,l=t;"ref"in t&&(c=t.ref,delete t.ref);var x={type:e,props:l,key:r,ref:c,__k:null,__:null,__b:0,__e:null,__c:null,constructor:void 0,__v:--Rn,__i:-1,__u:0,__source:n,__self:a};if(typeof e=="function"&&(c=e.defaultProps))for(f in c)l[f]===void 0&&(l[f]=c[f]);return M.vnode&&M.vnode(x),x}function Bn(){let e=ro();if(!e){console.error("modalBuilderSteps not found");return}e.sharing(window.FrakSetup?.modalShareConfig??{}).display()}function Qe({text:e="Share and earn!",classname:t=""}){let[r,o]=Ao(!0),n=Mo(()=>{o(!1)},[]);return ko(()=>(Bt("add",n),()=>Bt("remove",n)),[n]),Bo("button",{type:"button",class:t,disabled:r,onClick:Bn,children:e})}customElements.get("frak-button-share")||go(Qe,"frak-button-share",["text"],{shadow:!1});Zt(async function(){let t=await Qr();if(!t){console.error("Failed to create Frak client");return}eo(t),to(t)});return zo(Hn);})();
|
|
3
|
-
/*! Bundled license information:
|
|
4
|
-
|
|
5
|
-
js-sha256/src/sha256.js:
|
|
6
|
-
(**
|
|
7
|
-
* [js-sha256]{@link https://github.com/emn178/js-sha256}
|
|
8
|
-
*
|
|
9
|
-
* @version 0.11.0
|
|
10
|
-
* @author Chen, Yi-Cyuan [emn178@gmail.com]
|
|
11
|
-
* @copyright Chen, Yi-Cyuan 2014-2024
|
|
12
|
-
* @license MIT
|
|
13
|
-
*)
|
|
14
|
-
|
|
15
|
-
@noble/hashes/esm/utils.js:
|
|
16
|
-
(*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) *)
|
|
17
|
-
*/
|