@frak-labs/components 0.0.5 → 0.0.6
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/cdn/components.js +2 -2
- package/package.json +2 -2
package/cdn/components.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
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);})();
|
|
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 tt=Zt((se,et)=>{"use strict";(function(e,t){if(typeof se=="object"&&typeof et=="object")et.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 E(h){try{R(p.throw(h))}catch(_){F(_)}}function R(h){var _;h.done?b(h.value):(_=h.value,_ instanceof i?_:new i(function(T){T(_)})).then(g,E)}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:E(0),throw:E(1),return:E(2)},typeof Symbol=="function"&&(F[Symbol.iterator]=function(){return this}),F;function E(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(T){_=[6,T],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(E){i(E)}}function b(g){try{F(u.throw(g))}catch(E){i(E)}}function F(g){var E;g.done?y(g.value):(E=g.value,E instanceof m?E:new m(function(R){R(E)})).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(E){if(m)throw new TypeError("Generator is already executing.");for(;i&&(i=0,E[0]&&(p=0)),p;)try{if(m=1,u&&(y=2&E[0]?u.return:E[0]?u.throw||((y=u.return)&&y.call(u),0):u.next)&&!(y=y.call(u,E[1])).done)return y;switch(u=0,y&&(E=[2&E[0],y.value]),E[0]){case 0:case 1:y=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(!((y=(y=p.trys).length>0&&y[y.length-1])||E[0]!==6&&E[0]!==2)){p=0;continue}if(E[0]===3&&(!y||E[1]>y[0]&&E[1]<y[3])){p.label=E[1];break}if(E[0]===6&&p.label<y[1]){p.label=y[1],y=E;break}if(y&&p.label<y[2]){p.label=y[2],p.ops.push(E);break}y[2]&&p.ops.pop(),p.trys.pop();continue}E=s.call(d,p)}catch(R){E=[6,R],u=0}finally{m=y=0}if(5&E[0])throw E[1];return{value:E[0]?E[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,E=0;E<F;++E)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(E){E(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(E){g=[6,E],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 rt=Zt((Un,Te)=>{"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 Te=="object"&&Te.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(T){return new g(_,!0).update(T)[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 T=0;T<m.length;++T){var S=m[T];_[S]=y(S,h)}return _},p=function(h,_){var T=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 T.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?T.createHash(I).update(w(v)).digest("hex"):h(v)};return C},b=function(h,_){return function(T,S){return new E(T,_,!0).update(S)[h]()}},F=function(h){var _=b("hex",h);_.create=function(I){return new E(I,h)},_.update=function(I,w){return _.create(I).update(w)};for(var T=0;T<m.length;++T){var S=m[T];_[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 _,T=typeof h;if(T!=="string"){if(T==="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,T=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,Ze,Qe,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=_&T,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&T^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),Ze=S&h,q=Ze^S&_^ae,J=v&I^~v&w,A=C+z+J+s[M+1]+k[M+1],K=O+q,C=T+A<<0,T=A+K<<0,O=(T>>>2|T<<30)^(T>>>13|T<<19)^(T>>>22|T<<10),z=(C>>>6|C<<26)^(C>>>11|C<<21)^(C>>>25|C<<7),Qe=T&S,q=Qe^T&h^Ze,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=_&T,q=ve^_&S^Qe,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+T<<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,T=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[T>>>28&15]+l[T>>>24&15]+l[T>>>20&15]+l[T>>>16&15]+l[T>>>12&15]+l[T>>>8&15]+l[T>>>4&15]+l[T&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,T=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,T>>>24&255,T>>>16&255,T>>>8&255,T&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 E(h,_,T){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,_,T),this.update(O),this.oKeyPad=M,this.inner=!0,this.sharedMemory=T}E.prototype=new g,E.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?Te.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 ct(e){return te(e,{strict:!1})?Math.ceil((e.length-2)/2):e.length}var sr=B(()=>{"use strict";Ae()});var lt,cr=B(()=>{"use strict";lt="2.22.3"});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 ut,N,ce=B(()=>{"use strict";cr();ut={getDocsUrl:({docsBaseUrl:e,docsPath:t="",docsSlug:r})=>t?`${e??"https://viem.sh"}${t}${r?`#${r}`:""}`:void 0,version:`viem@${lt}`},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=ut.getDocsUrl?.({...r,docsPath:n}),c=[t||"An error occurred.","",...r.metaMessages?[...r.metaMessages,""]:[],...a?[`Docs: ${a}`]:[],...o?[`Details: ${o}`]:[],...ut.version?[`Version: ${ut.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=lt}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,pt=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(ct(e)>t)throw new Me({givenSize:ct(e),maxSize:t})}var ft=B(()=>{"use strict";pt();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";pt();Pe();ft();Wo=Array.from({length:256},(e,t)=>t.toString(16).padStart(2,"0"));jo=new TextEncoder});function dt(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();ft();He();qo=new TextEncoder;W={zero:48,nine:57,A:65,F:70,a:97,f:102}});function mt(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 ht(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 xt=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,Er=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 yt(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 Tr,_t,Go,Oe,kr=B(()=>{"use strict";xt();Tr=e=>new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4)),_t=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";xt();Er();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,mt(o),0>=this.blockLen||this.blockLen>=200)throw new Error("Sha3 supports only keccak-f1600 function");this.state=new Uint8Array(200),this.state32=Tr(this.state)}keccak(){_t||yt(this.state32),nn(this.state32,this.rounds),_t||yt(this.state32),this.posOut=0,this.pos=0}update(t){ht(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){ht(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 mt(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})?dt(e):e);return r==="bytes"?o:G(o)}var gt=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,bt=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(wt.has(`${e}.${t}`))return wt.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 wt.set(`${e}.${t}`,a),a}var wt,zr=B(()=>{"use strict";Ue();gt();bt();wt=new re(8192)});function St(e,t){let{strict:r=!0}=t??{},o=`${e}.${r}`;if(vt.has(o))return vt.get(o);let n=an.test(e)?e.toLowerCase()===e?!0:r?Or(e)===e:!0:!1;return vt.set(o,n),n}var an,vt,Nr=B(()=>{"use strict";bt();zr();an=/^0x[a-fA-F0-9]{40}$/,vt=new re(8192)});function Ft(e){return`0x${e.reduce((t,r)=>t+r.replace("0x",""),"")}`}var Vr=B(()=>{"use strict"});function Et(e,t){if(!St(e,{strict:!1}))throw new he({address:e});if(!St(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:()=>Ye});var U=class extends Error{constructor(r,o,n){super(o);this.code=r;this.data=n}};var Ee=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(tt(),1),ot=Fe(rt(),1);async function Ie(e){let t=(0,ot.sha256)(JSON.stringify(e)),r={...e,validationHash:t},o=await tr(r),n=(0,ot.sha256)(o);return{compressed:o,compressedHash:n}}async function tr(e){return(0,er.compressToBase64)(JSON.stringify(e))}var rr=Fe(tt(),1),nt=Fe(rt(),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,nt.sha256)(e.compressed)!==e.compressedHash)throw new U(D.corruptedResponse,"Invalid compressed hash");let{validationHash:o,...n}=t;if((0,nt.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 it({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(),at({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 at({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":at({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 st({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 Ee("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();gt();Pe();var Tt="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(Tt);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(Tt,n),a.toString()}function Jr(e){let t=new URL(e);return t.searchParams.delete(Tt),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 it({config:e});if(!t){console.error("Failed to create iframe");return}let r=st({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 Ve(e,{steps:{login:r??{},openSession:o??{}},metadata:t})}function Ve(e,t){function r(c){return Ve(e,{...t,steps:{...t.steps,sendTransaction:c}})}function o(c){return Ve(e,{...t,steps:{...t.steps,final:{...c,action:{key:"reward"}}}})}function n(c,f){return Ve(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",unsafeCompleted:"0x4d5b14e0"},retail:{customerMeeting:"0x74489004"}};var $e={dapp:1,press:2,webshop:3,retail:4,referral:30,purchase:31},Xa=Object.entries($e).reduce((e,[t,r])=>(e[t]=BigInt(1)<<BigInt(r),e),{});var Mt={createLink(){return{handlerTypeDenominator:G($e.referral),interactionData:Rt.referral.createLink}},referred({referrer:e}){let t=Ft([Rt.referral.referred,V(e,{size:32})]);return{handlerTypeDenominator:G($e.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&&Et(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",We;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){We=Pt(e,window.FrakSetup?.modalConfig??{})}async function ro(e){if(!We){console.error("modalBuilderSteps not found");return}let t=await Bt(e,{modalConfig:We.reward().params});console.log("referral",t)}function oo(){return We}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 qe(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)&&!Ke.__r++||no!==P.debounceRendering)&&((no=P.debounceRendering)||lo)(Ke)}function Ke(){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));Ke.__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 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||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,E,R,h,_,T,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],E=d?g?g.props.value:d.__:o,r.__c?p=(s=t.__c=r.__c).__=s.__E:(F?t.__c=s=new w(b,E):(t.__c=s=new qe(b,E),s.constructor=w,s.render=gn),g&&g.sub(s),s.props=b,s.state||(s.state={}),s.context=E,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,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)}),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,E),F&&s.componentDidUpdate!=null&&s.__h.push(function(){s.componentDidUpdate(u,y,i)})}if(s.context=E,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),T=0;T<s._sb.length;T++)s.__h.push(s._sb[T]);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;je(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||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=""),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])&&je(e,x,y,p[x],n),x="checked",i!==void 0&&i!==e[x]&&je(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},qe.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))},qe.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),io(this))},qe.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},Ke.__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,Ge=0,ko=[],L=P,vo=L.__b,So=L.__r,Fo=L.diffed,Eo=L.__c,To=L.unmount,Io=L.__;function Gt(e,t){L.__h&&L.__h(H,e,Ge||t),Ge=0;var r=H.__H||(H.__H={__:[],__h:[]});return e>=r.__.length&&r.__.push({}),r.__[e]}function Xt(e){return Ge=1,En(Mo,e)}function En(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 Xe(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 Ge=8,Xe(function(){return e},t)}function Tn(){for(var e;e=ko.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(Je),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(Je),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)(Tn)),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(Je),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)}}),Eo&&Eo(e,t)},L.unmount=function(e){To&&To(e);var t,r=e.__c;r&&r.__H&&(r.__H.__.forEach(function(o){try{Je(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 Je(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;if("ref"in l)for(f in l={},t)f=="ref"?c=t[f]:l[f]=t[f];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 Ye({text:e="Share and earn!",classname:t="",useReward:r,noRewardText:o}){let n=Xe(()=>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=Xe(()=>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(Ye,"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
3
|
/*! Bundled license information:
|
|
4
4
|
|
|
5
5
|
js-sha256/src/sha256.js:
|
package/package.json
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"url": "https://twitter.com/QNivelais"
|
|
12
12
|
}
|
|
13
13
|
],
|
|
14
|
-
"version": "0.0.
|
|
14
|
+
"version": "0.0.6",
|
|
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",
|
|
@@ -51,7 +51,7 @@
|
|
|
51
51
|
"publish": "bun publish"
|
|
52
52
|
},
|
|
53
53
|
"dependencies": {
|
|
54
|
-
"preact": "^10.25.
|
|
54
|
+
"preact": "^10.25.4",
|
|
55
55
|
"preact-custom-element": "^4.3.0"
|
|
56
56
|
},
|
|
57
57
|
"devDependencies": {
|