PageSourceSearch

https://reactive-bridge-dapp.vercel.app/assets/index-B5QhlUsk.js

js reactive-bridge-dapp.vercel.app collected 2026-10-03 07:35:25 UTC 207,412 bytes, 6 lines download raw bytes

1import{w as os,x as as,y as le,z as Pe,A as qn,C as Lo}from"./index-BkIlVDhX.js";function Bo(e,t){for(var r=0;r<t.length;r++){const n=t[r];if(typeof n!="string"&&!Array.isArray(n)){for(const o in n)if(o!=="default"&&!(o in e)){const c=Object.getOwnPropertyDescriptor(n,o);c&&Object.defineProperty(e,o,c.get?c:{enumerable:!0,get:()=>n[o]})}}}return Object.freeze(Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}))}var Kn={},At={},ir={};Object.defineProperty(ir,"__esModule",{value:!0});ir.walletLogo=void 0;const To=(e,t)=>{let r;switch(e){case"standard":return r=t,`data:image/svg+xml,%3Csvg width='${t}' height='${r}' viewBox='0 0 1024 1024' fill='none' xmlns='http://www.w3.org/2000/svg'%3E %3Crect width='1024' height='1024' fill='%230052FF'/%3E %3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M152 512C152 710.823 313.177 872 512 872C710.823 872 872 710.823 872 512C872 313.177 710.823 152 512 152C313.177 152 152 313.177 152 512ZM420 396C406.745 396 396 406.745 396 420V604C396 617.255 406.745 628 420 628H604C617.255 628 628 617.255 628 604V420C628 406.745 617.255 396 604 396H420Z' fill='white'/%3E %3C/svg%3E `;case"circle":return r=t,`data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='${t}' height='${r}' viewBox='0 0 999.81 999.81'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%230052fe;%7D.cls-2%7Bfill:%23fefefe;%7D.cls-3%7Bfill:%230152fe;%7D%3C/style%3E%3C/defs%3E%3Cpath class='cls-1' d='M655-115.9h56c.83,1.59,2.36.88,3.56,1a478,478,0,0,1,75.06,10.42C891.4-81.76,978.33-32.58,1049.19,44q116.7,126,131.94,297.61c.38,4.14-.34,8.53,1.78,12.45v59c-1.58.84-.91,2.35-1,3.56a482.05,482.05,0,0,1-10.38,74.05c-24,106.72-76.64,196.76-158.83,268.93s-178.18,112.82-287.2,122.6c-4.83.43-9.86-.25-14.51,1.77H654c-1-1.68-2.69-.91-4.06-1a496.89,496.89,0,0,1-105.9-18.59c-93.54-27.42-172.78-77.59-236.91-150.94Q199.34,590.1,184.87,426.58c-.47-5.19.25-10.56-1.77-15.59V355c1.68-1,.91-2.7,1-4.06a498.12,498.12,0,0,1,18.58-105.9c26-88.75,72.64-164.9,140.6-227.57q126-116.27,297.21-131.61C645.32-114.57,650.35-113.88,655-115.9Zm377.92,500c0-192.44-156.31-349.49-347.56-350.15-194.13-.68-350.94,155.13-352.29,347.42-1.37,194.55,155.51,352.1,348.56,352.47C876.15,734.23,1032.93,577.84,1032.93,384.11Z' transform='translate(-183.1 115.9)'/%3E%3Cpath class='cls-2' d='M1032.93,384.11c0,193.73-156.78,350.12-351.29,349.74-193-.37-349.93-157.92-348.56-352.47C334.43,189.09,491.24,33.28,685.37,34,876.62,34.62,1032.94,191.67,1032.93,384.11ZM683,496.81q43.74,0,87.48,0c15.55,0,25.32-9.72,25.33-25.21q0-87.48,0-175c0-15.83-9.68-25.46-25.59-25.46H595.77c-15.88,0-25.57,9.64-25.58,25.46q0,87.23,0,174.45c0,16.18,9.59,25.7,25.84,25.71Z' transform='translate(-183.1 115.9)'/%3E%3Cpath class='cls-3' d='M683,496.81H596c-16.25,0-25.84-9.53-25.84-25.71q0-87.23,0-174.45c0-15.82,9.7-25.46,25.58-25.46H770.22c15.91,0,25.59,9.63,25.59,25.46q0,87.47,0,175c0,15.49-9.78,25.2-25.33,25.21Q726.74,496.84,683,496.81Z' transform='translate(-183.1 115.9)'/%3E%3C/svg%3E`;case"text":return r=(.1*t).toFixed(2),`data:image/svg+xml,%3Csvg width='${t}' height='${r}' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 528.15 53.64'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%230052ff;%7D%3C/style%3E%3C/defs%3E%3Ctitle%3ECoinbase_Wordmark_SubBrands_ALL%3C/title%3E%3Cpath class='cls-1' d='M164.45,15a15,15,0,0,0-11.74,5.4V0h-8.64V52.92h8.5V48a15,15,0,0,0,11.88,5.62c10.37,0,18.21-8.21,18.21-19.3S174.67,15,164.45,15Zm-1.3,30.67c-6.19,0-10.73-4.83-10.73-11.31S157,23,163.22,23s10.66,4.82,10.66,11.37S169.34,45.65,163.15,45.65Zm83.31-14.91-6.34-.93c-3-.43-5.18-1.44-5.18-3.82,0-2.59,2.8-3.89,6.62-3.89,4.18,0,6.84,1.8,7.42,4.76h8.35c-.94-7.49-6.7-11.88-15.55-11.88-9.15,0-15.2,4.68-15.2,11.3,0,6.34,4,10,12,11.16l6.33.94c3.1.43,4.83,1.65,4.83,4,0,2.95-3,4.17-7.2,4.17-5.12,0-8-2.09-8.43-5.25h-8.49c.79,7.27,6.48,12.38,16.84,12.38,9.44,0,15.7-4.32,15.7-11.74C258.12,35.28,253.58,31.82,246.46,30.74Zm-27.65-2.3c0-8.06-4.9-13.46-15.27-13.46-9.79,0-15.26,5-16.34,12.6h8.57c.43-3,2.73-5.4,7.63-5.4,4.39,0,6.55,1.94,6.55,4.32,0,3.09-4,3.88-8.85,4.39-6.63.72-14.84,3-14.84,11.66,0,6.7,5,11,12.89,11,6.19,0,10.08-2.59,12-6.7.28,3.67,3,6.05,6.84,6.05h5v-7.7h-4.25Zm-8.5,9.36c0,5-4.32,8.64-9.57,8.64-3.24,0-6-1.37-6-4.25,0-3.67,4.39-4.68,8.42-5.11s6-1.22,7.13-2.88ZM281.09,15c-11.09,0-19.23,8.35-19.23,19.36,0,11.6,8.72,19.3,19.37,19.3,9,0,16.06-5.33,17.86-12.89h-9c-1.3,3.31-4.47,5.19-8.71,5.19-5.55,0-9.72-3.46-10.66-9.51H299.3
1V33.12C299.3,22.46,291.53,15,281.09,15Zm-9.87,15.26c1.37-5.18,5.26-7.7,9.72-7.7,4.9,0,8.64,2.8,9.51,7.7ZM19.3,23a9.84,9.84,0,0,1,9.5,7h9.14c-1.65-8.93-9-15-18.57-15A19,19,0,0,0,0,34.34c0,11.09,8.28,19.3,19.37,19.3,9.36,0,16.85-6,18.5-15H28.8a9.75,9.75,0,0,1-9.43,7.06c-6.27,0-10.66-4.83-10.66-11.31S13,23,19.3,23Zm41.11-8A19,19,0,0,0,41,34.34c0,11.09,8.28,19.3,19.37,19.3A19,19,0,0,0,79.92,34.27C79.92,23.33,71.64,15,60.41,15Zm.07,30.67c-6.19,0-10.73-4.83-10.73-11.31S54.22,23,60.41,23s10.8,4.89,10.8,11.37S66.67,45.65,60.48,45.65ZM123.41,15c-5.62,0-9.29,2.3-11.45,5.54V15.7h-8.57V52.92H112V32.69C112,27,115.63,23,121,23c5,0,8.06,3.53,8.06,8.64V52.92h8.64V31C137.66,21.6,132.84,15,123.41,15ZM92,.36a5.36,5.36,0,0,0-5.55,5.47,5.55,5.55,0,0,0,11.09,0A5.35,5.35,0,0,0,92,.36Zm-9.72,23h5.4V52.92h8.64V15.7h-14Zm298.17-7.7L366.2,52.92H372L375.29,44H392l3.33,8.88h6L386.87,15.7ZM377,39.23l6.45-17.56h.1l6.56,17.56ZM362.66,15.7l-7.88,29h-.11l-8.14-29H341l-8,28.93h-.1l-8-28.87H319L329.82,53h5.45l8.19-29.24h.11L352,53h5.66L368.1,15.7Zm135.25,0v4.86h12.32V52.92h5.6V20.56h12.32V15.7ZM467.82,52.92h25.54V48.06H473.43v-12h18.35V31.35H473.43V20.56h19.93V15.7H467.82ZM443,15.7h-5.6V52.92h24.32V48.06H443Zm-30.45,0h-5.61V52.92h24.32V48.06H412.52Z'/%3E%3C/svg%3E`;case"textWithLogo":return r=(.25*t).toFixed(2),`data:image/svg+xml,%3Csvg width='${t}' height='${r}' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 308.44 77.61'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%230052ff;%7D%3C/style%3E%3C/defs%3E%3Cpath class='cls-1' d='M142.94,20.2l-7.88,29H135l-8.15-29h-5.55l-8,28.93h-.11l-8-28.87H99.27l10.84,37.27h5.44l8.2-29.24h.1l8.41,29.24h5.66L148.39,20.2Zm17.82,0L146.48,57.42h5.82l3.28-8.88h16.65l3.34,8.88h6L167.16,20.2Zm-3.44,23.52,6.45-17.55h.11l6.56,17.55ZM278.2,20.2v4.86h12.32V57.42h5.6V25.06h12.32V20.2ZM248.11,57.42h25.54V52.55H253.71V40.61h18.35V35.85H253.71V25.06h19.94V20.2H248.11ZM223.26,20.2h-5.61V57.42H242V52.55H223.26Zm-30.46,0h-5.6V57.42h24.32V52.55H192.8Zm-154,38A19.41,19.41,0,1,1,57.92,35.57H77.47a38.81,38.81,0,1,0,0,6.47H57.92A19.39,19.39,0,0,1,38.81,58.21Z'/%3E%3C/svg%3E`;case"textLight":return r=(.1*t).toFixed(2),`data:image/svg+xml,%3Csvg width='${t}' height='${r}' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 528.15 53.64'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%23fefefe;%7D%3C/style%3E%3C/defs%3E%3Ctitle%3ECoinbase_Wordmark_SubBrands_ALL%3C/title%3E%3Cpath class='cls-1' d='M164.45,15a15,15,0,0,0-11.74,5.4V0h-8.64V52.92h8.5V48a15,15,0,0,0,11.88,5.62c10.37,0,18.21-8.21,18.21-19.3S174.67,15,164.45,15Zm-1.3,30.67c-6.19,0-10.73-4.83-10.73-11.31S157,23,163.22,23s10.66,4.82,10.66,11.37S169.34,45.65,163.15,45.65Zm83.31-14.91-6.34-.93c-3-.43-5.18-1.44-5.18-3.82,0-2.59,2.8-3.89,6.62-3.89,4.18,0,6.84,1.8,7.42,4.76h8.35c-.94-7.49-6.7-11.88-15.55-11.88-9.15,0-15.2,4.68-15.2,11.3,0,6.34,4,10,12,11.16l6.33.94c3.1.43,4.83,1.65,4.83,4,0,2.95-3,4.17-7.2,4.17-5.12,0-8-2.09-8.43-5.25h-8.49c.79,7.27,6.48,12.38,16.84,12.38,9.44,0,15.7-4.32,15.7-11.74C258.12,35.28,253.58,31.82,246.46,30.74Zm-27.65-2.3c0-8.06-4.9-13.46-15.27-13.46-9.79,0-15.26,5-16.34,12.6h8.57c.43-3,2.73-5.4,7.63-5.4,4.39,0,6.55,1.94,6.55,4.32,0,3.09-4,3.88-8.85,4.39-6.63.72-14.84,3-14.84,11.66,0,6.7,5,11,12.89,11,6.19,0,10.08-2.59,12-6.7.28,3.67,3,6.05,6.84,6.05h5v-7.7h-4.25Zm-8.5,9.36c0,5-4.32,8.64-9.57,8.64-3.24,0-6-1.37-6-4.25,0-3.67,4.39-4.68,8.42-5.11s6-1.22,7.13-2.88ZM281.09,15c-11.09,0-19.23,8.35-19.23,19.36,0,11.6,8.72,19.3,19.37,19.3,9,0,16.06-5.33,17.86-12.89h-9c-1.3,3.31-4.47,5.19-8.71,5.19-5.55,0-9.72-3.46-10.66-9.51H299.3V33.12C299.3,22.46,291.53,15,281.09,15Zm-9.87,15.26c1.37-5.18,5.26-7.7,9.72-7.7,4.9,0,8.64,2.8,9.51,7.7ZM19.3,23a9.84,9.84,0,0,1,9.5,7h9.14c-1.65-8.93-9-15-18.57-15A19,19,0,0,0,0,34.34c0,11.09,8.28,19.3,19.37,19.3,9.36,0,16.85-6,18.5-15H28.8a9.75,9.75,0,0,1-9.43,7.06c-6.27,0-10.66-4.83-10.66-11.31S13,23,19.3,23Zm41.11-8A19,19,0,0,0,41,34.34c0,11.09,8.28,19.3,19.37,19.3A19,19,0,0,0,79.92,34.27C79.92,23.33,71.64,15,60.41,15Zm.07,30.67c-6.19,0-10.73-4.83-10.73-11.31S54.22,23,60.41,23s10.8,4.89,10.8,11.37S66.67,45.65,60.48,45.65ZM123.41,15c-5.62,0-9.29,2.3-11.45,5.54V15.7h-8.57V52.92H112V32.69C112,27,115.63,23,121,23c5,0,8.06,3.53,8.06,8.64V52.92h8.64V31C137.66,21.6,132.84,15,123.41,15ZM92,.36a5.36,5.36,0,0,0-5.55,5.47,5.55,5.55,0,0,0,11.09,0A5.35,5.35,0,0,0,92,.36Zm-9.72,23h5.4V52.92h8.64V15.7
1h-14Zm298.17-7.7L366.2,52.92H372L375.29,44H392l3.33,8.88h6L386.87,15.7ZM377,39.23l6.45-17.56h.1l6.56,17.56ZM362.66,15.7l-7.88,29h-.11l-8.14-29H341l-8,28.93h-.1l-8-28.87H319L329.82,53h5.45l8.19-29.24h.11L352,53h5.66L368.1,15.7Zm135.25,0v4.86h12.32V52.92h5.6V20.56h12.32V15.7ZM467.82,52.92h25.54V48.06H473.43v-12h18.35V31.35H473.43V20.56h19.93V15.7H467.82ZM443,15.7h-5.6V52.92h24.32V48.06H443Zm-30.45,0h-5.61V52.92h24.32V48.06H412.52Z'/%3E%3C/svg%3E`;case"textWithLogoLight":return r=(.25*t).toFixed(2),`data:image/svg+xml,%3Csvg width='${t}' height='${r}' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 308.44 77.61'%3E%3Cdefs%3E%3Cstyle%3E.cls-1%7Bfill:%23fefefe;%7D%3C/style%3E%3C/defs%3E%3Cpath class='cls-1' d='M142.94,20.2l-7.88,29H135l-8.15-29h-5.55l-8,28.93h-.11l-8-28.87H99.27l10.84,37.27h5.44l8.2-29.24h.1l8.41,29.24h5.66L148.39,20.2Zm17.82,0L146.48,57.42h5.82l3.28-8.88h16.65l3.34,8.88h6L167.16,20.2Zm-3.44,23.52,6.45-17.55h.11l6.56,17.55ZM278.2,20.2v4.86h12.32V57.42h5.6V25.06h12.32V20.2ZM248.11,57.42h25.54V52.55H253.71V40.61h18.35V35.85H253.71V25.06h19.94V20.2H248.11ZM223.26,20.2h-5.61V57.42H242V52.55H223.26Zm-30.46,0h-5.6V57.42h24.32V52.55H192.8Zm-154,38A19.41,19.41,0,1,1,57.92,35.57H77.47a38.81,38.81,0,1,0,0,6.47H57.92A19.39,19.39,0,0,1,38.81,58.21Z'/%3E%3C/svg%3E`;default:return r=t,`data:image/svg+xml,%3Csvg width='${t}' height='${r}' viewBox='0 0 1024 1024' fill='none' xmlns='http://www.w3.org/2000/svg'%3E %3Crect width='1024' height='1024' fill='%230052FF'/%3E %3Cpath fill-rule='evenodd' clip-rule='evenodd' d='M152 512C152 710.823 313.177 872 512 872C710.823 872 872 710.823 872 512C872 313.177 710.823 152 512 152C313.177 152 152 313.177 152 512ZM420 396C406.745 396 396 406.745 396 420V604C396 617.255 406.745 628 420 628H604C617.255 628 628 617.255 628 604V420C628 406.745 617.255 396 604 396H420Z' fill='white'/%3E %3C/svg%3E `}};ir.walletLogo=To;var sr={},cs={exports:{}};(function(e){var t=Object.prototype.hasOwnProperty,r="~";function n(){}Object.create&&(n.prototype=Object.create(null),new n().__proto__||(r=!1));function o(h,_,m){this.fn=h,this.context=_,this.once=m||!1}function c(h,_,m,g,b){if(typeof m!="function")throw new TypeError("The listener must be a function");var v=new o(m,g||h,b),I=r?r+_:_;return h._events[I]?h._events[I].fn?h._events[I]=[h._events[I],v]:h._events[I].push(v):(h._events[I]=v,h._eventsCount++),h}function l(h,_){--h._eventsCount===0?h._events=new n:delete h._events[_]}function a(){this._events=new n,this._eventsCount=0}a.prototype.eventNames=function(){var _=[],m,g;if(this._eventsCount===0)return _;for(g in m=this._events)t.call(m,g)&&_.push(r?g.slice(1):g);return Object.getOwnPropertySymbols?_.concat(Object.getOwnPropertySymbols(m)):_},a.prototype.listeners=function(_){var m=r?r+_:_,g=this._events[m];if(!g)return[];if(g.fn)return[g.fn];for(var b=0,v=g.length,I=new Array(v);b<v;b++)I[b]=g[b].fn;return I},a.prototype.listenerCount=function(_){var m=r?r+_:_,g=this._events[m];return g?g.fn?1:g.length:0},a.prototype.emit=function(_,m,g,b,v,I){var T=r?r+_:_;if(!this._events[T])return!1;var k=this._events[T],y=arguments.length,x,R;if(k.fn){switch(k.once&&this.removeListener(_,k.fn,void 0,!0),y){case 1:return k.fn.call(k.context),!0;case 2:return k.fn.call(k.context,m),!0;case 3:return k.fn.call(k.context,m,g),!0;case 4:return k.fn.call(k.context,m,g,b),!0;case 5:return k.fn.call(k.context,m,g,b,v),!0;case 6:return k.fn.call(k.context,m,g,b,v,I),!0}for(R=1,x=new Array(y-1);R<y;R++)x[R-1]=arguments[R];k.fn.apply(k.context,x)}else{var L=k.length,P;for(R=0;R<L;R++)switch(k[R].once&&this.removeListener(_,k[R].fn,void 0,!0),y){case 1:k[R].fn.call(k[R].context);break;case 2:k[R].fn.call(k[R].context,m);break;case 3:k[R].fn.call(k[R].context,m,g);break;case 4:k[R].fn.call(k[R].context,m,g,b);break;default:if(!x)for(P=1,x=new Array(y-1);P<y;P++)x[P-1]=arguments[P];k[R].fn.apply(k[R].context,x)}}return!0},a.prototype.on=function(_,m,g){return c(this,_,m,g,!1)},a.prototype.once=function(_,m,g){return c(this,_,m,g,!0)},a.prototype.removeListener=function(_,m,g,b){var v=r?r+_:_;if(!this._events[v])return this;if(!m)return l(this,v),this;var I=this._events[v];if(I.fn)I.fn===m&&(!b||I.once)&&(!g||I.context===g)&&l(this,v);else{for(var T=0,k=[],y=I.length;T<y;T++)(I[T].fn!==m||b&&!I[T].once||g&&I[T].context!==g)&&k.push(I[T]);k.length?this._events[v]=k.length===1?k[0]:k:l(this,v)}return this},a.prototype.removeAllListeners=function(_){var m;return _?(m=r?r+_:_,this._events[m]&&l(this,m)):(this._events=new n,this._eventsCount=0),this},a.prototype.off=a.prototype.removeListener,a.prototype.addListener=a.prototype.on,a.prefixed=r,a.EventEmitter=a,e.exports=a})(cs);var Po=cs.exports,qe={},Je={};
1Object.defineProperty(Je,"__esModule",{value:!0});Je.errorValues=Je.standardErrorCodes=void 0;Je.standardErrorCodes={rpc:{invalidInput:-32e3,resourceNotFound:-32001,resourceUnavailable:-32002,transactionRejected:-32003,methodNotSupported:-32004,limitExceeded:-32005,parse:-32700,invalidRequest:-32600,methodNotFound:-32601,invalidParams:-32602,internal:-32603},provider:{userRejectedRequest:4001,unauthorized:4100,unsupportedMethod:4200,disconnected:4900,chainDisconnected:4901,unsupportedChain:4902}};Je.errorValues={"-32700":{standard:"JSON RPC 2.0",message:"Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text."},"-32600":{standard:"JSON RPC 2.0",message:"The JSON sent is not a valid Request object."},"-32601":{standard:"JSON RPC 2.0",message:"The method does not exist / is not available."},"-32602":{standard:"JSON RPC 2.0",message:"Invalid method parameter(s)."},"-32603":{standard:"JSON RPC 2.0",message:"Internal JSON-RPC error."},"-32000":{standard:"EIP-1474",message:"Invalid input."},"-32001":{standard:"EIP-1474",message:"Resource not found."},"-32002":{standard:"EIP-1474",message:"Resource unavailable."},"-32003":{standard:"EIP-1474",message:"Transaction rejected."},"-32004":{standard:"EIP-1474",message:"Method not supported."},"-32005":{standard:"EIP-1474",message:"Request limit exceeded."},4001:{standard:"EIP-1193",message:"User rejected the request."},4100:{standard:"EIP-1193",message:"The requested account and/or method has not been authorized by the user."},4200:{standard:"EIP-1193",message:"The requested method is not supported by this Ethereum provider."},4900:{standard:"EIP-1193",message:"The provider is disconnected from all chains."},4901:{standard:"EIP-1193",message:"The provider is disconnected from the specified chain."},4902:{standard:"EIP-3085",message:"Unrecognized chain ID."}};var or={},zn={};(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.serialize=e.getErrorCode=e.isValidCode=e.getMessageFromCode=e.JSON_RPC_SERVER_ERROR_MESSAGE=void 0;const t=Je,r="Unspecified error message.";e.JSON_RPC_SERVER_ERROR_MESSAGE="Unspecified server error.";function n(b,v=r){if(b&&Number.isInteger(b)){const I=b.toString();if(m(t.errorValues,I))return t.errorValues[I].message;if(h(b))return e.JSON_RPC_SERVER_ERROR_MESSAGE}return v}e.getMessageFromCode=n;function o(b){if(!Number.isInteger(b))return!1;const v=b.toString();return!!(t.errorValues[v]||h(b))}e.isValidCode=o;function c(b){var v;if(typeof b=="number")return b;if(l(b))return(v=b.code)!==null&&v!==void 0?v:b.errorCode}e.getErrorCode=c;function l(b){return typeof b=="object"&&b!==null&&(typeof b.code=="number"||typeof b.errorCode=="number")}function a(b,{shouldIncludeStack:v=!1}={}){const I={};if(b&&typeof b=="object"&&!Array.isArray(b)&&m(b,"code")&&o(b.code)){const T=b;I.code=T.code,T.message&&typeof T.message=="string"?(I.message=T.message,m(T,"data")&&(I.data=T.data)):(I.message=n(I.code),I.data={originalError:_(b)})}else I.code=t.standardErrorCodes.rpc.internal,I.message=g(b,"message")?b.message:r,I.data={originalError:_(b)};return v&&(I.stack=g(b,"stack")?b.stack:void 0),I}e.serialize=a;function h(b){return b>=-32099&&b<=-32e3}function _(b){return b&&typeof b=="object"&&!Array.isArray(b)?Object.assign({},b):b}function m(b,v){return Object.prototype.hasOwnProperty.call(b,v)}function g(b,v){return typeof b=="object"&&b!==null&&v in b&&typeof b[v]=="string"}})(zn);Object.defineProperty(or,"__esModule",{value:!0});or.standardErrors=void 0;const fe=Je,ls=zn;or.standardErrors={rpc:{parse:e=>Se(fe.standardErrorCodes.rpc.parse,e),invalidRequest:e=>Se(fe.standardErrorCodes.rpc.invalidRequest,e),invalidParams:e=>Se(fe.standardErrorCodes.rpc.invalidParams,e),methodNotFound:e=>Se(fe.standardErrorCodes.rpc.methodNotFound,e),internal:e=>Se(fe.standardErrorCodes.rpc.internal,e),server:e=>{if(!e||typeof e!="object"||Array.isArray(e))throw new Error("Ethereum RPC Server errors must provide single object argument.");const{code:t}=e;if(!Number.isInteger(t)||t>-32005||t<-32099)throw new Error('"code" must be an integer such that: -32099 <= code 
1<= -32005');return Se(t,e)},invalidInput:e=>Se(fe.standardErrorCodes.rpc.invalidInput,e),resourceNotFound:e=>Se(fe.standardErrorCodes.rpc.resourceNotFound,e),resourceUnavailable:e=>Se(fe.standardErrorCodes.rpc.resourceUnavailable,e),transactionRejected:e=>Se(fe.standardErrorCodes.rpc.transactionRejected,e),methodNotSupported:e=>Se(fe.standardErrorCodes.rpc.methodNotSupported,e),limitExceeded:e=>Se(fe.standardErrorCodes.rpc.limitExceeded,e)},provider:{userRejectedRequest:e=>ut(fe.standardErrorCodes.provider.userRejectedRequest,e),unauthorized:e=>ut(fe.standardErrorCodes.provider.unauthorized,e),unsupportedMethod:e=>ut(fe.standardErrorCodes.provider.unsupportedMethod,e),disconnected:e=>ut(fe.standardErrorCodes.provider.disconnected,e),chainDisconnected:e=>ut(fe.standardErrorCodes.provider.chainDisconnected,e),unsupportedChain:e=>ut(fe.standardErrorCodes.provider.unsupportedChain,e),custom:e=>{if(!e||typeof e!="object"||Array.isArray(e))throw new Error("Ethereum Provider custom errors must provide single object argument.");const{code:t,message:r,data:n}=e;if(!r||typeof r!="string")throw new Error('"message" must be a nonempty string');return new ds(t,r,n)}}};function Se(e,t){const[r,n]=us(t);return new hs(e,r||(0,ls.getMessageFromCode)(e),n)}function ut(e,t){const[r,n]=us(t);return new ds(e,r||(0,ls.getMessageFromCode)(e),n)}function us(e){if(e){if(typeof e=="string")return[e];if(typeof e=="object"&&!Array.isArray(e)){const{message:t,data:r}=e;
1if(t&&typeof t!="string")throw new Error("Must specify string message.");return[t||void 0,r]}}return[]}class hs extends Error{constructor(t,r,n){if(!Number.isInteger(t))throw new Error('"code" must be an integer.');if(!r||typeof r!="string")throw new Error('"message" must be a nonempty string.');super(r),this.code=t,n!==void 0&&(this.data=n)}}class ds extends hs{constructor(t,r,n){if(!No(t))throw new Error('"code" must be an integer such that: 1000 <= code <= 4999');super(t,r,n)}}function No(e){return Number.isInteger(e)&&e>=1e3&&e<=4999}(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.standardErrors=e.standardErrorCodes=void 0;var t=Je;Object.defineProperty(e,"standardErrorCodes",{enumerable:!0,get:function(){return t.standardErrorCodes}});var r=or;Object.defineProperty(e,"standardErrors",{enumerable:!0,get:function(){return r.standardErrors}})})(qe);var ar={},Et={};Object.defineProperty(Et,"__esModule",{value:!0});Et.isErrorResponse=void 0;function Do(e){return e.errorMessage!==void 0}Et.isErrorResponse=Do;var st={};Object.defineProperty(st,"__esModule",{value:!0});st.LIB_VERSION=void 0;st.LIB_VERSION="4.0.4";Object.defineProperty(ar,"__esModule",{value:!0});ar.serializeError=void 0;const Oo=Et,Uo=st,Fo=Je,jo=zn;function Wo(e,t){const r=(0,jo.serialize)($o(e),{shouldIncludeStack:!0}),n=new URL("https://docs.cloud.coinbase.com/wallet-sdk/docs/errors");n.searchParams.set("version",Uo.LIB_VERSION),n.searchParams.set("code",r.code.toString());const o=Ho(r.data,t);return o&&n.searchParams.set("method",o),n.searchParams.set("message",r.message),Object.assign(Object.assign({},r),{docUrl:n.href})}ar.serializeError=Wo;function $o(e){return typeof e=="string"?{message:e,code:Fo.standardErrorCodes.rpc.internal}:(0,Oo.isErrorResponse)(e)?Object.assign(Object.assign({},e),{message:e.errorMessage,code:e.errorCode,data:{method:e.method}}):e}function Ho(e,t){const r=e==null?void 0:e.method;if(r)return r;if(t!==void 0){if(typeof t=="string")return t;if(Array.isArray(t)){if(t.length>0)return t[0].method}else return t.method}}var ge={};Object.defineProperty(ge,"__esModule",{value:!0});ge.RegExpString=ge.IntNumber=ge.BigIntString=ge.AddressString=ge.HexString=ge.OpaqueType=void 0;function Bt(){return e=>e}ge.OpaqueType=Bt;ge.HexString=Bt();ge.AddressString=Bt();ge.BigIntString=Bt();function qo(e){return Math.floor(e)}ge.IntNumber=qo;ge.RegExpString=Bt();var O={};
1Object.defineProperty(O,"__esModule",{value:!0});O.areAddressArraysEqual=O.getFavicon=O.range=O.isBigNumber=O.ensureParsedJSONObject=O.ensureBigInt=O.ensureRegExpString=O.ensureIntNumber=O.ensureBuffer=O.ensureAddressString=O.ensureEvenLengthHexString=O.ensureHexString=O.isHexString=O.prepend0x=O.strip0x=O.has0xPrefix=O.hexStringFromIntNumber=O.intNumberFromHexString=O.bigIntStringFromBigInt=O.hexStringFromBuffer=O.hexStringToUint8Array=O.uint8ArrayToHex=O.randomBytesHex=void 0;const ot=qe,Ie=ge,fs=/^[0-9]*$/,ps=/^[a-f0-9]*$/;function Ko(e){return _s(crypto.getRandomValues(new Uint8Array(e)))}O.randomBytesHex=Ko;function _s(e){return[...e].map(t=>t.toString(16).padStart(2,"0")).join("")}O.uint8ArrayToHex=_s;function zo(e){return new Uint8Array(e.match(/.{1,2}/g).map(t=>parseInt(t,16)))}O.hexStringToUint8Array=zo;function Vo(e,t=!1){const r=e.toString("hex");return(0,Ie.HexString)(t?`0x${r}`:r)}O.hexStringFromBuffer=Vo;function Go(e){return(0,Ie.BigIntString)(e.toString(10))}O.bigIntStringFromBigInt=Go;function Zo(e){return(0,Ie.IntNumber)(Number(BigInt(Pt(e,!0))))}O.intNumberFromHexString=Zo;function Yo(e){return(0,Ie.HexString)(`0x${BigInt(e).toString(16)}`)}O.hexStringFromIntNumber=Yo;function Vn(e){return e.startsWith("0x")||e.startsWith("0X")}O.has0xPrefix=Vn;function cr(e){return Vn(e)?e.slice(2):e}O.strip0x=cr;function gs(e){return Vn(e)?`0x${e.slice(2)}`:`0x${e}`}O.prepend0x=gs;function Tt(e){if(typeof e!="string")return!1;const t=cr(e).toLowerCase();return ps.test(t)}O.isHexString=Tt;function ys(e,t=!1){if(typeof e=="string"){const r=cr(e).toLowerCase();if(ps.test(r))return(0,Ie.HexString)(t?`0x${r}`:r)}throw ot.standardErrors.rpc.invalidParams(`"${String(e)}" is not a hexadecimal string`)}O.ensureHexString=ys;function Pt(e,t=!1){let r=ys(e,!1);return r.length%2===1&&(r=(0,Ie.HexString)(`0${r}`)),t?(0,Ie.HexString)(`0x${r}`):r}O.ensureEvenLengthHexString=Pt;function Jo(e){if(typeof e=="string"){const t=cr(e).toLowerCase();if(Tt(t)&&t.length===40)return(0,Ie.AddressString)(gs(t))}throw ot.standardErrors.rpc.invalidParams(`Invalid Ethereum address: ${String(e)}`)}O.ensureAddressString=Jo;function Qo(e){if(Buffer.isBuffer(e))return e;if(typeof e=="string"){if(Tt(e)){const t=Pt(e,!1);return Buffer.from(t,"hex")}return Buffer.from(e,"utf8")}throw ot.standardErrors.rpc.invalidParams(`Not binary data: ${String(e)}`)}O.ensureBuffer=Qo;function bs(e){if(typeof e=="number"&&Number.isInteger(e))return(0,Ie.IntNumber)(e);if(typeof e=="string"){if(fs.test(e))return(0,Ie.IntNumber)(Number(e));if(Tt(e))return(0,Ie.IntNumber)(Number(BigInt(Pt(e,!0))))}throw ot.standardErrors.rpc.invalidParams(`Not an integer: ${String(e)}`)}O.ensureIntNumber=bs;function Xo(e){if(e instanceof RegExp)return(0,Ie.RegExpString)(e.toString());throw ot.standardErrors.rpc.invalidParams(`Not a RegExp: ${String(e)}`)}O.ensureRegExpString=Xo;function ea(e){if(e!==null&&(typeof e=="bigint"||ws(e)))return BigInt(e.toString(10));if(typeof e=="number")return BigInt(bs(e));if(typeof e=="string"){if(fs.test(e))return BigInt(e);if(Tt(e))return BigInt(Pt(e,!0))}throw ot.standardErrors.rpc.invalidParams(`Not an integer: ${String(e)}`)}O.ensureBigInt=ea;function ta(e){if(typeof e=="string")return JSON.parse(e);if(typeof e=="object")return e;throw ot.standardErrors.rpc.invalidParams(`Not a JSON string or an object: ${String(e)}`)}O.ensureParsedJSONObject=ta;function ws(e){if(e==null||typeof e.constructor!="function")return!1;const{constructor:t}=e;return typeof t.config=="function"&&typeof t.EUCLID=="number"}O.isBigNumber=ws;function ra(e,t){return Array.from({length:t-e},(r,n)=>e+n)}O.range=ra;function na(){const e=document.querySelector('link[sizes="192x192"]')||document.querySelector('link[sizes="180x180"]')||document.querySelector('link[rel="icon"]')||document.querySelector('link[rel="shortcut icon"]'),{protocol:t,host:r}=document.location,n=e?e.getAttribute("href"):null;return!n||n.startsWith("javascript:")||n.startsWith("vbscript:")?null:n.startsWith("http://")||n.startsWith("https://")||n.startsWith("data:")?n:n.startsWith("//")?t+n:`${t}//${r}${n}`}O.getFavicon=na;function ia(e,t){return e.length===t.length&&e.every((r,n)=>r===t[n])}O.areAddressArraysEqual=ia;var We={},lr={},ur={},oe={};
1Object.defineProperty(oe,"__esModule",{value:!0});oe.decryptContent=oe.encryptContent=oe.importKeyFromHexString=oe.exportKeyToHexString=oe.decrypt=oe.encrypt=oe.deriveSharedSecret=oe.generateKeyPair=void 0;const ms=O;async function sa(){return crypto.subtle.generateKey({name:"ECDH",namedCurve:"P-256"},!0,["deriveKey"])}oe.generateKeyPair=sa;async function oa(e,t){return crypto.subtle.deriveKey({name:"ECDH",public:t},e,{name:"AES-GCM",length:256},!1,["encrypt","decrypt"])}oe.deriveSharedSecret=oa;async function vs(e,t){const r=crypto.getRandomValues(new Uint8Array(12)),n=await crypto.subtle.encrypt({name:"AES-GCM",iv:r},e,new TextEncoder().encode(t));return{iv:r,cipherText:n}}oe.encrypt=vs;async function Es(e,{iv:t,cipherText:r}){const n=await crypto.subtle.decrypt({name:"AES-GCM",iv:t},e,r);return new TextDecoder().decode(n)}oe.decrypt=Es;function Ss(e){switch(e){case"public":return"spki";case"private":return"pkcs8"}}async function aa(e,t){const r=Ss(e),n=await crypto.subtle.exportKey(r,t);return(0,ms.uint8ArrayToHex)(new Uint8Array(n))}oe.exportKeyToHexString=aa;async function ca(e,t){const r=Ss(e),n=(0,ms.hexStringToUint8Array)(t).buffer;return await crypto.subtle.importKey(r,n,{name:"ECDH",namedCurve:"P-256"},!0,e==="private"?["deriveKey"]:[])}oe.importKeyFromHexString=ca;async function la(e,t){const r=JSON.stringify(e,(n,o)=>{if(!(o instanceof Error))return o;const c=o;return Object.assign(Object.assign({},c.code?{code:c.code}:{}),{message:c.message})});return vs(t,r)}oe.encryptContent=la;async function ua(e,t){return JSON.parse(await Es(t,e))}oe.decryptContent=ua;var Ke={};Object.defineProperty(Ke,"__esModule",{value:!0});Ke.ScopedLocalStorage=void 0;class tr{constructor(t,r){this.scope=t,this.module=r}setItem(t,r){localStorage.setItem(this.scopedKey(t),r)}getItem(t){return localStorage.getItem(this.scopedKey(t))}removeItem(t){localStorage.removeItem(this.scopedKey(t))}clear(){const t=this.scopedKey(""),r=[];for(let n=0;n<localStorage.length;n++){const o=localStorage.key(n);typeof o=="string"&&o.startsWith(t)&&r.push(o)}r.forEach(n=>localStorage.removeItem(n))}scopedKey(t){return`-${this.scope}${this.module?`:${this.module}`:""}:${t}`}static clearAll(){new tr("CBWSDK").clear(),new tr("walletlink").clear()}}Ke.ScopedLocalStorage=tr;Object.defineProperty(ur,"__esModule",{value:!0});ur.SCWKeyManager=void 0;const qt=oe,ha=Ke,yn={storageKey:"ownPrivateKey",keyType:"private"},bn={storageKey:"ownPublicKey",keyType:"public"},wn={storageKey:"peerPublicKey",keyType:"public"};class da{constructor(){this.storage=new ha.ScopedLocalStorage("CBWSDK","SCWKeyManager"),this.ownPrivateKey=null,this.ownPublicKey=null,this.peerPublicKey=null,this.sharedSecret=null}async getOwnPublicKey(){return await this.loadKeysIfNeeded(),this.ownPublicKey}async getSharedSecret(){return await this.loadKeysIfNeeded(),this.sharedSecret}async setPeerPublicKey(t){this.sharedSecret=null,this.peerPublicKey=t,await this.storeKey(wn,t),await this.loadKeysIfNeeded()}async clear(){this.ownPrivateKey=null,this.ownPublicKey=null,this.peerPublicKey=null,this.sharedSecret=null,this.storage.removeItem(bn.storageKey),this.storage.removeItem(yn.storageKey),this.storage.removeItem(wn.storageKey)}async generateKeyPair(){const t=await(0,qt.generateKeyPair)();this.ownPrivateKey=t.privateKey,this.ownPublicKey=t.publicKey,await this.storeKey(yn,t.privateKey),await this.storeKey(bn,t.publicKey)}async loadKeysIfNeeded(){if(this.ownPrivateKey===null&&(this.ownPrivateKey=await this.loadKey(yn)),this.ownPublicKey===null&&(this.ownPublicKey=await this.loadKey(bn)),(this.ownPrivateKey===null||this.ownPublicKey===null)&&await this.generateKeyPair(),this.peerPublicKey===null&&(this.peerPublicKey=await this.loadKey(wn)),this.sharedSecret===null){if(this.ownPrivateKey===null||this.peerPublicKey===null)return;this.sharedSecret=await(0,qt.deriveSharedSecret)(this.ownPrivateKey,this.peerPublicKey)}}async loadKey(t){const r=this.storage.getItem(t.storageKey);return r?(0,qt.importKeyFromHexString)(t.keyType,r):null}async storeKey(t,r){const n=await(0,qt.exportKeyToHexString)(t.keyType,r);this.storage.setItem(t.storageKey,n)}}
1ur.SCWKeyManager=da;var hr={};Object.defineProperty(hr,"__esModule",{value:!0});hr.SCWStateManager=void 0;const fa=Ke,oi="accounts",ai="activeChain",ci="availableChains",li="walletCapabilities";class pa{get accounts(){return this._accounts}get activeChain(){return this._activeChain}get walletCapabilities(){return this._walletCapabilities}constructor(t){var r,n;this.storage=new fa.ScopedLocalStorage("CBWSDK","SCWStateManager"),this.updateListener=t.updateListener,this.availableChains=this.loadItemFromStorage(ci),this._walletCapabilities=this.loadItemFromStorage(li);const o=this.loadItemFromStorage(oi),c=this.loadItemFromStorage(ai);o&&this.updateListener.onAccountsUpdate({accounts:o,source:"storage"}),c&&this.updateListener.onChainUpdate({chain:c,source:"storage"}),this._accounts=o||[],this._activeChain=c||{id:(n=(r=t.appChainIds)===null||r===void 0?void 0:r[0])!==null&&n!==void 0?n:1}}updateAccounts(t){this._accounts=t,this.storeItemToStorage(oi,t),this.updateListener.onAccountsUpdate({accounts:t,source:"wallet"})}switchChain(t){var r;const n=(r=this.availableChains)===null||r===void 0?void 0:r.find(o=>o.id===t);return n?(n===this._activeChain||(this._activeChain=n,this.storeItemToStorage(ai,n),this.updateListener.onChainUpdate({chain:n,source:"wallet"})),!0):!1}updateAvailableChains(t){if(!t||Object.keys(t).length===0)return;const r=Object.entries(t).map(([n,o])=>({id:Number(n),rpcUrl:o}));this.availableChains=r,this.storeItemToStorage(ci,r),this.switchChain(this._activeChain.id)}updateWalletCapabilities(t){this._walletCapabilities=t,this.storeItemToStorage(li,t)}storeItemToStorage(t,r){this.storage.setItem(t,JSON.stringify(r))}loadItemFromStorage(t){const r=this.storage.getItem(t);return r?JSON.parse(r):void 0}clear(){this.storage.clear()}}hr.SCWStateManager=pa;Object.defineProperty(lr,"__esModule",{value:!0});lr.SCWSigner=void 0;const _a=ur,ga=hr,Kt=qe,ui=O,zt=oe;class ya{constructor(t){this.metadata=t.metadata,this.communicator=t.communicator,this.keyManager=new _a.SCWKeyManager,this.stateManager=new ga.SCWStateManager({appChainIds:this.metadata.appChainIds,updateListener:t.updateListener}),this.handshake=this.handshake.bind(this),this.request=this.request.bind(this),this.createRequestMessage=this.createRequestMessage.bind(this),this.decryptResponseMessage=this.decryptResponseMessage.bind(this)}async handshake(){const t=await this.createRequestMessage({handshake:{method:"eth_requestAccounts",params:this.metadata}}),r=await this.communicator.postRequestAndWaitForResponse(t);if("failure"in r.content)throw r.content.failure;const n=await(0,zt.importKeyFromHexString)("public",r.sender);await this.keyManager.setPeerPublicKey(n);const o=await this.decryptResponseMessage(r);this.updateInternalState({method:"eth_requestAccounts"},o);const c=o.result;if("error"in c)throw c.error;return this.stateManager.accounts}async request(t){const r=this.tryLocalHandling(t);if(r!==void 0){if(r instanceof Error)throw r;return r}await this.communicator.waitForPopupLoaded();const n=await this.sendEncryptedRequest(t),o=await this.decryptResponseMessage(n);this.updateInternalState(t,o);const c=o.result;if("error"in c)throw c.error;return c.value}async disconnect(){this.stateManager.clear(),await this.keyManager.clear()}tryLocalHandling(t){var r;switch(t.method){case"wallet_switchEthereumChain":{const n=t.params;if(!n||!(!((r=n[0])===null||r===void 0)&&r.chainId))throw Kt.standardErrors.rpc.invalidParams();const o=(0,ui.ensureIntNumber)(n[0].chainId);return this.stateManager.switchChain(o)?null:void 0}case"wallet_getCapabilities":{const n=this.stateManager.walletCapabilities;if(!n)throw Kt.standardErrors.provider.unauthorized("No wallet capabilities found, please disconnect and reconnect");return n}default:return}}async sendEncryptedRequest(t){const r=await this.keyManager.getSharedSecret();if(!r)throw Kt.standardErrors.provider.unauthorized("No valid session found, try requestAccounts before other methods");const n=await(0,zt.encryptContent)({action:t,chainId:this.stateManager.activeChain.id},r),o=await this.createRequestMessage({encrypted:n});return this.communicator.postRequestAndWaitForResponse(o)}async createRequestMessage(t){const r=await(0,zt.exportKeyToHexString)("public",await this.keyManager.getOwnPublicKey());return{id:crypto.randomUUID(),sender:r,content:t,timestamp:new Date}}async decryptResponseMessage(t){const r=t.content;if("failure"in r)throw r.failure;
1const n=await this.keyManager.getSharedSecret();if(!n)throw Kt.standardErrors.provider.unauthorized("Invalid session");return(0,zt.decryptContent)(r.encrypted,n)}updateInternalState(t,r){var n,o;const c=(n=r.data)===null||n===void 0?void 0:n.chains;c&&this.stateManager.updateAvailableChains(c);const l=(o=r.data)===null||o===void 0?void 0:o.capabilities;l&&this.stateManager.updateWalletCapabilities(l);const a=r.result;if(!("error"in a))switch(t.method){case"eth_requestAccounts":{const h=a.value;this.stateManager.updateAccounts(h);break}case"wallet_switchEthereumChain":{if(a.value!==null)return;const h=t.params,_=(0,ui.ensureIntNumber)(h[0].chainId);this.stateManager.switchChain(_);break}}}}lr.SCWSigner=ya;var dr={},Nn={exports:{}},xs=os.EventEmitter,Nt={},fr={};fr.byteLength=ma;fr.toByteArray=Ea;fr.fromByteArray=Ca;var je=[],xe=[],ba=typeof Uint8Array<"u"?Uint8Array:Array,mn="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(var ht=0,wa=mn.length;ht<wa;++ht)je[ht]=mn[ht],xe[mn.charCodeAt(ht)]=ht;xe[45]=62;xe[95]=63;function Cs(e){var t=e.length;if(t%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=e.indexOf("=");r===-1&&(r=t);var n=r===t?0:4-r%4;return[r,n]}function ma(e){var t=Cs(e),r=t[0],n=t[1];return(r+n)*3/4-n}function va(e,t,r){return(t+r)*3/4-r}function Ea(e){var t,r=Cs(e),n=r[0],o=r[1],c=new ba(va(e,n,o)),l=0,a=o>0?n-4:n,h;for(h=0;h<a;h+=4)t=xe[e.charCodeAt(h)]<<18|xe[e.charCodeAt(h+1)]<<12|xe[e.charCodeAt(h+2)]<<6|xe[e.charCodeAt(h+3)],c[l++]=t>>16&255,c[l++]=t>>8&255,c[l++]=t&255;return o===2&&(t=xe[e.charCodeAt(h)]<<2|xe[e.charCodeAt(h+1)]>>4,c[l++]=t&255),o===1&&(t=xe[e.charCodeAt(h)]<<10|xe[e.charCodeAt(h+1)]<<4|xe[e.charCodeAt(h+2)]>>2,c[l++]=t>>8&255,c[l++]=t&255),c}function Sa(e){return je[e>>18&63]+je[e>>12&63]+je[e>>6&63]+je[e&63]}function xa(e,t,r){for(var n,o=[],c=t;c<r;c+=3)n=(e[c]<<16&16711680)+(e[c+1]<<8&65280)+(e[c+2]&255),o.push(Sa(n));return o.join("")}function Ca(e){for(var t,r=e.length,n=r%3,o=[],c=16383,l=0,a=r-n;l<a;l+=c)o.push(xa(e,l,l+c>a?a:l+c));return n===1?(t=e[r-1],o.push(je[t>>2]+je[t<<4&63]+"==")):n===2&&(t=(e[r-2]<<8)+e[r-1],o.push(je[t>>10]+je[t>>4&63]+je[t<<2&63]+"=")),o.join("")}var Gn={};/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */Gn.read=function(e,t,r,n,o){var c,l,a=o*8-n-1,h=(1<<a)-1,_=h>>1,m=-7,g=r?o-1:0,b=r?-1:1,v=e[t+g];for(g+=b,c=v&(1<<-m)-1,v>>=-m,m+=a;m>0;c=c*256+e[t+g],g+=b,m-=8);for(l=c&(1<<-m)-1,c>>=-m,m+=n;m>0;l=l*256+e[t+g],g+=b,m-=8);if(c===0)c=1-_;else{if(c===h)return l?NaN:(v?-1:1)*(1/0);l=l+Math.pow(2,n),c=c-_}return(v?-1:1)*l*Math.pow(2,c-n)};Gn.write=function(e,t,r,n,o,c){var l,a,h,_=c*8-o-1,m=(1<<_)-1,g=m>>1,b=o===23?Math.pow(2,-24)-Math.pow(2,-77):0,v=n?0:c-1,I=n?1:-1,T=t<0||t===0&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(a=isNaN(t)?1:0,l=m):(l=Math.floor(Math.log(t)/Math.LN2),t*(h=Math.pow(2,-l))<1&&(l--,h*=2),l+g>=1?t+=b/h:t+=b*Math.pow(2,1-g),t*h>=2&&(l++,h/=2),l+g>=m?(a=0,l=m):l+g>=1?(a=(t*h-1)*Math.pow(2,o),l=l+g):(a=t*Math.pow(2,g-1)*Math.pow(2,o),l=0));o>=8;e[r+v]=a&255,v+=I,a/=256,o-=8);for(l=l<<o|a,_+=o;_>0;e[r+v]=l&255,v+=I,l/=256,_-=8);e[r+v-I]|=T*128};/*!
2 * The buffer module from node.js, for the browser.
3 *
4 * @author   Feross Aboukhadijeh <https://feross.org>
5 * @license  MIT
6 */(function(e){const t=fr,r=Gn,n=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;e.Buffer=a,e.SlowBuffer=x,e.INSPECT_MAX_BYTES=50;const o=2147483647;e.kMaxLength=o,a.TYPED_ARRAY_SUPPORT=c(),!a.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function c(){try{const u=new Uint8Array(1),i={foo:function(){return 42}};return Object.setPrototypeOf(i,Uint8Array.prototype),Object.setPrototypeOf(u,i),u.foo()===42}catch{return!1}}Object.defineProperty(a.prototype,"parent",{enumerable:!0,get:function(){if(a.isBuffer(this))return this.buffer}}),Object.defineProperty(a.prototype,"offset",{enumerable:!0,get:function(){if(a.isBuffer(this))return this.byteOffset}});function l(u){if(u>
vendor: 20,192 bytes, line 6
6o)throw new RangeError('The value "'+u+'" is invalid for option "size"');const i=new Uint8Array(u);return Object.setPrototypeOf(i,a.prototype),i}function a(u,i,s){if(typeof u=="number"){if(typeof i=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return g(u)}return h(u,i,s)}a.poolSize=8192;function h(u,i,s){if(typeof u=="string")return b(u,i);if(ArrayBuffer.isView(u))return I(u);if(u==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof u);if(_e(u,ArrayBuffer)||u&&_e(u.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(_e(u,SharedArrayBuffer)||u&&_e(u.buffer,SharedArrayBuffer)))return T(u,i,s);if(typeof u=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');const d=u.valueOf&&u.valueOf();if(d!=null&&d!==u)return a.from(d,i,s);const w=k(u);if(w)return w;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof u[Symbol.toPrimitive]=="function")return a.from(u[Symbol.toPrimitive]("string"),i,s);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof u)}a.from=function(u,i,s){return h(u,i,s)},Object.setPrototypeOf(a.prototype,Uint8Array.prototype),Object.setPrototypeOf(a,Uint8Array);function _(u){if(typeof u!="number")throw new TypeError('"size" argument must be of type number');if(u<0)throw new RangeError('The value "'+u+'" is invalid for option "size"')}function m(u,i,s){return _(u),u<=0?l(u):i!==void 0?typeof s=="string"?l(u).fill(i,s):l(u).fill(i):l(u)}a.alloc=function(u,i,s){return m(u,i,s)};function g(u){return _(u),l(u<0?0:y(u)|0)}a.allocUnsafe=function(u){return g(u)},a.allocUnsafeSlow=function(u){return g(u)};function b(u,i){if((typeof i!="string"||i==="")&&(i="utf8"),!a.isEncoding(i))throw new TypeError("Unknown encoding: "+i);const s=R(u,i)|0;let d=l(s);const w=d.write(u,i);return w!==s&&(d=d.slice(0,w)),d}function v(u){const i=u.length<0?0:y(u.length)|0,s=l(i);for(let d=0;d<i;d+=1)s[d]=u[d]&255;return s}function I(u){if(_e(u,Uint8Array)){const i=new Uint8Array(u);return T(i.buffer,i.byteOffset,i.byteLength)}return v(u)}function T(u,i,s){if(i<0||u.byteLength<i)throw new RangeError('"offset" is outside of buffer bounds');if(u.byteLength<i+(s||0))throw new RangeError('"length" is outside of buffer bounds');let d;return i===void 0&&s===void 0?d=new Uint8Array(u):s===void 0?d=new Uint8Array(u,i):d=new Uint8Array(u,i,s),Object.setPrototypeOf(d,a.prototype),d}function k(u){if(a.isBuffer(u)){const i=y(u.length)|0,s=l(i);return s.length===0||u.copy(s,0,0,i),s}if(u.length!==void 0)return typeof u.length!="number"||De(u.length)?l(0):v(u);if(u.type==="Buffer"&&Array.isArray(u.data))return v(u.data)}function y(u){if(u>=o)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+o.toString(16)+" bytes");return u|0}function x(u){return+u!=u&&(u=0),a.alloc(+u)}a.isBuffer=function(i){return i!=null&&i._isBuffer===!0&&i!==a.prototype},a.compare=function(i,s){if(_e(i,Uint8Array)&&(i=a.from(i,i.offset,i.byteLength)),_e(s,Uint8Array)&&(s=a.from(s,s.offset,s.byteLength)),!a.isBuffer(i)||!a.isBuffer(s))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(i===s)return 0;let d=i.length,w=s.length;for(let C=0,A=Math.min(d,w);C<A;++C)if(i[C]!==s[C]){d=i[C],w=s[C];break}return d<w?-1:w<d?1:0},a.isEncoding=function(i){switch(String(i).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},a.concat=function(i,s){if(!Array.isArray(i))throw new TypeError('"list" argument must be an Array of Buffers');if(i.length===0)return a.alloc(0);let d;if(s===void 0)for(s=0,d=0;d<i.length;++d)s+=i[d].length;const w=a.allocUnsafe(s);let C=0;for(d=0;d<i.length;++d){let A=i[d];if(_e(A,Uint8Array))C+A.length>w.length?(a.isBuffer(A)||(A=a.from(A)),A.copy(w,C)):Uint8Array.prototype.set.call(w,A,C);else if(a.isBuffer(A))A.copy(w,C);else throw new TypeError('"list" argument must be an Array of Buffers');C+=A.length}return w};function R(u,i){if(a.isBuffer(u))return u.length;if(ArrayBuffer.isView(u)||_e(u,ArrayBuffer))return u.byteLength;if(typeof u!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof u);const s=u.length,d=arguments.length>2&&arguments[2]===!0;if(!d&&s===0)return 0;let w=!1;for(;;)switch(i){case"ascii":case"latin1":case"binary":return s;case"utf8":case"utf-8":return K(u).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return s*2;case"hex":return s>>>1;case"base64":return et(u).length;default:if(w)return d?-1:K(u).length;i=(""+i).toLowerCase(),w=!0}}a.byteLength=R;function L(u,i,s){let d=!1;if((i===void 0||i<0)&&(i=0),i>this.length||((s===void 0||s>this.length)&&(s=this.length),s<=0)||(s>>>=0,i>>>=0,s<=i))return"";for(u||(u="utf8");;)switch(u){case"hex":return me(this,i,s);case"utf8":case"utf-8":return he(this,i,s);case"ascii":return we(this,i,s);case"latin1":case"binary":return Ae(this,i,s);case"base64":return ne(this,i,s);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Me(this,i,s);default:if(d)throw new TypeError("Unknown encoding: "+u);u=(u+"").toLowerCase(),d=!0}}a.prototype._isBuffer=!0;function P(u,i,s){const d=u[i];u[i]=u[s],u[s]=d}a.prototype.swap16=function(){const i=this.length;if(i%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let s=0;s<i;s+=2)P(this,s,s+1);return this},a.prototype.swap32=function(){const i=this.length;if(i%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let s=0;s<i;s+=4)P(this,s,s+3),P(this,s+1,s+2);return this},a.prototype.swap64=function(){const i=this.length;if(i%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let s=0;s<i;s+=8)P(this,s,s+7),P(this,s+1,s+6),P(this,s+2,s+5),P(this,s+3,s+4);return this},a.prototype.toString=function(){const i=this.length;return i===0?"":arguments.length===0?he(this,0,i):L.apply(this,arguments)},a.prototype.toLocaleString=a.prototype.toString,a.prototype.equals=function(i){if(!a.isBuffer(i))throw new TypeError("Argument must be a Buffer");return this===i?!0:a.compare(this,i)===0},a.prototype.inspect=function(){let i="";const s=e.INSPECT_MAX_BYTES;return i=this.toString("hex",0,s).replace(/(.{2})/g,"$1 ").trim(),this.length>s&&(i+=" ... "),"<Buffer "+i+">"},n&&(a.prototype[n]=a.prototype.inspect),a.prototype.compare=function(i,s,d,w,C){if(_e(i,Uint8Array)&&(i=a.from(i,i.offset,i.byteLength)),!a.isBuffer(i))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof i);if(s===void 0&&(s=0),d===void 0&&(d=i?i.length:0),w===void 0&&(w=0),C===void 0&&(C=this.length),s<0||d>i.length||w<0||C>this.length)throw new RangeError("out of range index");if(w>=C&&s>=d)return 0;if(w>=C)return-1;if(s>=d)return 1;if(s>>>=0,d>>>=0,w>>>=0,C>>>=0,this===i)return 0;let A=C-w,H=d-s;const X=Math.min(A,H),G=this.slice(w,C),ee=i.slice(s,d);for(let V=0;V<X;++V)if(G[V]!==ee[V]){A=G[V],H=ee[V];break}return A<H?-1:H<A?1:0};function U(u,i,s,d,w){if(u.length===0)return-1;if(typeof s=="string"?(d=s,s=0):s>2147483647?s=2147483647:s<-2147483648&&(s=-2147483648),s=+s,De(s)&&(s=w?0:u.length-1),s<0&&(s=u.length+s),s>=u.length){if(w)return-1;s=u.length-1}else if(s<0)if(w)s=0;else return-1;if(typeof i=="string"&&(i=a.from(i,d)),a.isBuffer(i))return i.length===0?-1:z(u,i,s,d,w);if(typeof i=="number")return i=i&255,typeof Uint8Array.prototype.indexOf=="function"?w?Uint8Array.prototype.indexOf.call(u,i,s):Uint8Array.prototype.lastIndexOf.call(u,i,s):z(u,[i],s,d,w);throw new TypeError("val must be string, number or Buffer")}function z(u,i,s,d,w){let C=1,A=u.length,H=i.length;if(d!==void 0&&(d=String(d).toLowerCase(),d==="ucs2"||d==="ucs-2"||d==="utf16le"||d==="utf-16le")){if(u.length<2||i.length<2)return-1;C=2,A/=2,H/=2,s/=2}function X(ee,V){return C===1?ee[V]:ee.readUInt16BE(V*C)}let G;if(w){let ee=-1;for(G=s;G<A;G++)if(X(u,G)===X(i,ee===-1?0:G-ee)){if(ee===-1&&(ee=G),G-ee+1===H)return ee*C}else ee!==-1&&(G-=G-ee),ee=-1}else for(s+H>A&&(s=A-H),G=s;G>=0;G--){let ee=!0;for(let V=0;V<H;V++)if(X(u,G+V)!==X(i,V)){ee=!1;break}if(ee)return G}return-1}a.prototype.includes=function(i,s,d){return this.indexOf(i,s,d)!==-1},a.prototype.indexOf=function(i,s,d){return U(this,i,s,d,!0)},a.prototype.lastIndexOf=function(i,s,d){return U(this,i,s,d,!1)};function j(u,i,s,d){s=Number(s)||0;const w=u.length-s;d?(d=Number(d),d>w&&(d=w)):d=w;const C=i.length;d>C/2&&(d=C/2);let A;for(A=0;A<d;++A){const H=parseInt(i.substr(A*2,2),16);if(De(H))return A;u[s+A]=H}return A}function F(u,i,s,d){return Ve(K(i,u.length-s),u,s,d)}function Z(u,i,s,d){return Ve(Be(i),u,s,d)}function ue(u,i,s,d){return Ve(et(i),u,s,d)}function Re(u,i,s,d){return Ve(ze(i,u.length-s),u,s,d)}a.prototype.write=function(i,s,d,w){if(s===void 0)w="utf8",d=this.length,s=0;else if(d===void 0&&typeof s=="string")w=s,d=this.length,s=0;else if(isFinite(s))s=s>>>0,isFinite(d)?(d=d>>>0,w===void 0&&(w="utf8")):(w=d,d=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");const C=this.length-s;if((d===void 0||d>C)&&(d=C),i.length>0&&(d<0||s<0)||s>this.length)throw new RangeError("Attempt to write outside buffer bounds");w||(w="utf8");let A=!1;for(;;)switch(w){case"hex":return j(this,i,s,d);case"utf8":case"utf-8":return F(this,i,s,d);case"ascii":case"latin1":case"binary":return Z(this,i,s,d);case"base64":return ue(this,i,s,d);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Re(this,i,s,d);default:if(A)throw new TypeError("Unknown encoding: "+w);w=(""+w).toLowerCase(),A=!0}},a.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function ne(u,i,s){return i===0&&s===u.length?t.fromByteArray(u):t.fromByteArray(u.slice(i,s))}function he(u,i,s){s=Math.min(u.length,s);const d=[];let w=i;for(;w<s;){const C=u[w];let A=null,H=C>239?4:C>223?3:C>191?2:1;if(w+H<=s){let X,G,ee,V;switch(H){case 1:C<128&&(A=C);break;case 2:X=u[w+1],(X&192)===128&&(V=(C&31)<<6|X&63,V>127&&(A=V));break;case 3:X=u[w+1],G=u[w+2],(X&192)===128&&(G&192)===128&&(V=(C&15)<<12|(X&63)<<6|G&63,V>2047&&(V<55296||V>57343)&&(A=V));break;case 4:X=u[w+1],G=u[w+2],ee=u[w+3],(X&192)===128&&(G&192)===128&&(ee&192)===128&&(V=(C&15)<<18|(X&63)<<12|(G&63)<<6|ee&63,V>65535&&V<1114112&&(A=V))}}A===null?(A=65533,H=1):A>65535&&(A-=65536,d.push(A>>>10&1023|55296),A=56320|A&1023),d.push(A),w+=H}return Ne(d)}const de=4096;function Ne(u){const i=u.length;if(i<=de)return String.fromCharCode.apply(String,u);let s="",d=0;for(;d<i;)s+=String.fromCharCode.apply(String,u.slice(d,d+=de));return s}function we(u,i,s){let d="";s=Math.min(u.length,s);for(let w=i;w<s;++w)d+=String.fromCharCode(u[w]&127);return d}function Ae(u,i,s){let d="";s=Math.min(u.length,s);for(let w=i;w<s;++w)d+=String.fromCharCode(u[w]);return d}function me(u,i,s){const d=u.length;(!i||i<0)&&(i=0),(!s||s<0||s>d)&&(s=d);let w="";for(let C=i;C<s;++C)w+=tt[u[C]];return w}function Me(u,i,s){const d=u.slice(i,s);let w="";for(let C=0;C<d.length-1;C+=2)w+=String.fromCharCode(d[C]+d[C+1]*256);return w}a.prototype.slice=function(i,s){const d=this.length;i=~~i,s=s===void 0?d:~~s,i<0?(i+=d,i<0&&(i=0)):i>d&&(i=d),s<0?(s+=d,s<0&&(s=0)):s>d&&(s=d),s<i&&(s=i);const w=this.subarray(i,s);return Object.setPrototypeOf(w,a.prototype),w};function Y(u,i,s){if(u%1!==0||u<0)throw new RangeError("offset is not uint");if(u+i>s)throw new RangeError("Trying to access beyond buffer length")}a.prototype.readUintLE=a.prototype.readUIntLE=function(i,s,d){i=i>>>0,s=s>>>0,d||Y(i,s,this.length);let w=this[i],C=1,A=0;for(;++A<s&&(C*=256);)w+=this[i+A]*C;return w},a.prototype.readUintBE=a.prototype.readUIntBE=function(i,s,d){i=i>>>0,s=s>>>0,d||Y(i,s,this.length);let w=this[i+--s],C=1;for(;s>0&&(C*=256);)w+=this[i+--s]*C;return w},a.prototype.readUint8=a.prototype.readUInt8=function(i,s){return i=i>>>0,s||Y(i,1,this.length),this[i]},a.prototype.readUint16LE=a.prototype.readUInt16LE=function(i,s){return i=i>>>0,s||Y(i,2,this.length),this[i]|this[i+1]<<8},a.prototype.readUint16BE=a.prototype.readUInt16BE=function(i,s){return i=i>>>0,s||Y(i,2,this.length),this[i]<<8|this[i+1]},a.prototype.readUint32LE=a.prototype.readUInt32LE=function(i,s){return i=i>>>0,s||Y(i,4,this.length),(this[i]|this[i+1]<<8|this[i+2]<<16)+this[i+3]*16777216},a.prototype.readUint32BE=a.prototype.readUInt32BE=function(i,s){return i=i>>>0,s||Y(i,4,this.length),this[i]*16777216+(this[i+1]<<16|this[i+2]<<8|this[i+3])},a.prototype.readBigUInt64LE=ye(function(i){i=i>>>0,M(i,"offset");const s=this[i],d=this[i+7];(s===void 0||d===void 0)&&N(i,this.length-8);const w=s+this[++i]*2**8+this[++i]*2**16+this[++i]*2**24,C=this[++i]+this[++i]*2**8+this[++i]*2**16+d*2**24;return BigInt(w)+(BigInt(C)<<BigInt(32))}),a.prototype.readBigUInt64BE=ye(function(i){i=i>>>0,M(i,"offset");const s=this[i],d=this[i+7];(s===void 0||d===void 0)&&N(i,this.length-8);const w=s*2**24+this[++i]*2**16+this[++i]*2**8+this[++i],C=this[++i]*2**24+this[++i]*2**16+this[++i]*2**8+d;return(BigInt(w)<<BigInt(32))+BigInt(C)}),a.prototype.readIntLE=function(i,s,d){i=i>>>0,s=s>>>0,d||Y(i,s,this.length);let w=this[i],C=1,A=0;for(;++A<s&&(C*=256);)w+=this[i+A]*C;return C*=128,w>=C&&(w-=Math.pow(2,8*s)),w},a.prototype.readIntBE=function(i,s,d){i=i>>>0,s=s>>>0,d||Y(i,s,this.length);let w=s,C=1,A=this[i+--w];for(;w>0&&(C*=256);)A+=this[i+--w]*C;return C*=128,A>=C&&(A-=Math.pow(2,8*s)),A},a.prototype.readInt8=function(i,s){return i=i>>>0,s||Y(i,1,this.length),this[i]&128?(255-this[i]+1)*-1:this[i]},a.prototype.readInt16LE=function(i,s){i=i>>>0,s||Y(i,2,this.length);const d=this[i]|this[i+1]<<8;return d&32768?d|4294901760:d},a.prototype.readInt16BE=function(i,s){i=i>>>0,s||Y(i,2,this.length);const d=this[i+1]|this[i]<<8;return d&32768?d|4294901760:d},a.prototype.readInt32LE=function(i,s){return i=i>>>0,s||Y(i,4,this.length),this[i]|this[i+1]<<8|this[i+2]<<16|this[i+3]<<24},a.prototype.readInt32BE=function(i,s){return i=i>>>0,s||Y(i,4,this.length),this[i]<<24|this[i+1]<<16|this[i+2]<<8|this[i+3]},a.prototype.readBigInt64LE=ye(function(i){i=i>>>0,M(i,"offset");const s=this[i],d=this[i+7];(s===void 0||d===void 0)&&N(i,this.length-8);const w=this[i+4]+this[i+5]*2**8+this[i+6]*2**16+(d<<24);return(BigInt(w)<<BigInt(32))+BigInt(s+this[++i]*2**8+this[++i]*2**16+this[++i]*2**24)}),a.prototype.readBigInt64BE=ye(function(i){i=i>>>0,M(i,"offset");const s=this[i],d=this[i+7];(s===void 0||d===void 0)&&N(i,this.length-8);const w=(s<<24)+this[++i]*2**16+this[++i]*2**8+this[++i];return(BigInt(w)<<BigInt(32))+BigInt(this[++i]*2**24+this[++i]*2**16+this[++i]*2**8+d)}),a.prototype.readFloatLE=function(i,s){return i=i>>>0,s||Y(i,4,this.length),r.read(this,i,!0,23,4)},a.prototype.readFloatBE=function(i,s){return i=i>>>0,s||Y(i,4,this.length),r.read(this,i,!1,23,4)},a.prototype.readDoubleLE=function(i,s){return i=i>>>0,s||Y(i,8,this.length),r.read(this,i,!0,52,8)},a.prototype.readDoubleBE=function(i,s){return i=i>>>0,s||Y(i,8,this.length),r.read(this,i,!1,52,8)};function re(u,i,s,d,w,C){if(!a.isBuffer(u))throw new TypeError('"buffer" argument must be a Buffer instance');if(i>w||i<C)throw new RangeError('"value" argument is out of bounds');if(s+d>u.length)throw new RangeError("Index out of range")}a.prototype.writeUintLE=a.prototype.writeUIntLE=function(i,s,d,w){if(i=+i,s=s>>>0,d=d>>>0,!w){const H=Math.pow(2,8*d)-1;re(this,i,s,d,H,0)}let C=1,A=0;for(this[s]=i&255;++A<d&&(C*=256);)this[s+A]=i/C&255;return s+d},a.prototype.writeUintBE=a.prototype.writeUIntBE=function(i,s,d,w){if(i=+i,s=s>>>0,d=d>>>0,!w){const H=Math.pow(2,8*d)-1;re(this,i,s,d,H,0)}let C=d-1,A=1;for(this[s+C]=i&255;--C>=0&&(A*=256);)this[s+C]=i/A&255;return s+d},a.prototype.writeUint8=a.prototype.writeUInt8=function(i,s,d){return i=+i,s=s>>>0,d||re(this,i,s,1,255,0),this[s]=i&255,s+1},a.prototype.writeUint16LE=a.prototype.writeUInt16LE=function(i,s,d){return i=+i,s=s>>>0,d||re(this,i,s,2,65535,0),this[s]=i&255,this[s+1]=i>>>8,s+2},a.prototype.writeUint16BE=a.prototype.writeUInt16BE=function(i,s,d){return i=+i,s=s>>>0,d||re(this,i,s,2,65535,0),this[s]=i>>>8,this[s+1]=i&255,s+2},a.prototype.writeUint32LE=a.prototype.writeUInt32LE=function(i,s,d){return i=+i,s=s>>>0,d||re(this,i,s,4,4294967295,0),this[s+3]=i>>>24,this[s+2]=i>>>16,this[s+1]=i>>>8,this[s]=i&255,s+4},a.prototype.writeUint32BE=a.prototype.writeUInt32BE=function(i,s,d){return i=+i,s=s>>>0,d||re(this,i,s,4,4294967295,0),this[s]=i>>>24,this[s+1]=i>>>16,this[s+2]=i>>>8,this[s+3]=i&255,s+4};function pe(u,i,s,d,w){p(i,d,w,u,s,7);let C=Number(i&BigInt(4294967295));u[s++]=C,C=C>>8,u[s++]=C,C=C>>8,u[s++]=C,C=C>>8,u[s++]=C;let A=Number(i>>BigInt(32)&BigInt(4294967295));return u[s++]=A,A=A>>8,u[s++]=A,A=A>>8,u[s++]=A,A=A>>8,u[s++]=A,s}function Le(u,i,s,d,w){p(i,d,w,u,s,7);let C=Number(i&BigInt(4294967295));u[s+7]=C,C=C>>8,u[s+6]=C,C=C>>8,u[s+5]=C,C=C>>8,u[s+4]=C;let A=Number(i>>BigInt(32)&BigInt(4294967295));return u[s+3]=A,A=A>>8,u[s+2]=A,A=A>>8,u[s+1]=A,A=A>>8,u[s]=A,s+8}a.prototype.writeBigUInt64LE=ye(function(i,s=0){return pe(this,i,s,BigInt(0),BigInt("0xffffffffffffffff"))}),a.prototype.writeBigUInt64BE=ye(function(i,s=0){return Le(this,i,s,BigInt(0),BigInt("0xffffffffffffffff"))}),a.prototype.writeIntLE=function(i,s,d,w){if(i=+i,s=s>>>0,!w){const X=Math.pow(2,8*d-1);re(this,i,s,d,X-1,-X)}let C=0,A=1,H=0;for(this[s]=i&255;++C<d&&(A*=256);)i<0&&H===0&&this[s+C-1]!==0&&(H=1),this[s+C]=(i/A>>0)-H&255;return s+d},a.prototype.writeIntBE=function(i,s,d,w){if(i=+i,s=s>>>0,!w){const X=Math.pow(2,8*d-1);re(this,i,s,d,X-1,-X)}let C=d-1,A=1,H=0;for(this[s+C]=i&255;--C>=0&&(A*=256);)i<0&&H===0&&this[s+C+1]!==0&&(H=1),this[s+C]=(i/A>>0)-H&255;return s+d},a.prototype.writeInt8=function(i,s,d){return i=+i,s=s>>>0,d||re(this,i,s,1,127,-128),i<0&&(i=255+i+1),this[s]=i&255,s+1},a.prototype.writeInt16LE=function(i,s,d){return i=+i,s=s>>>0,d||re(this,i,s,2,32767,-32768),this[s]=i&255,this[s+1]=i>>>8,s+2},a.prototype.writeInt16BE=function(i,s,d){return i=+i,s=s>>>0,d||re(this,i,s,2,32767,-32768),this[s]=i>>>8,this[s+1]=i&255,s+2},a.prototype.writeInt32LE=function(i,s,d){return i=+i,s=s>>>0,d||re(this,i,s,4,2147483647,-2147483648),this[s]=i&255,this[s+1]=i>>>8,this[s+2]=i>>>16,this[s+3]=i>>>24,s+4},a.prototype.writeInt32BE=function(i,s,d){return i=+i,s=s>>>0,d||re(this,i,s,4,2147483647,-2147483648),i<0&&(i=4294967295+i+1),this[s]=i>>>24,this[s+1]=i>>>16,this[s+2]=i>>>8,this[s+3]=i&255,s+4},a.prototype.writeBigInt64LE=ye(function(i,s=0){return pe(this,i,s,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),a.prototype.writeBigInt64BE=ye(function(i,s=0){return Le(this,i,s,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function Ee(u,i,s,d,w,C){if(s+d>u.length)throw new RangeError("Index out of range");if(s<0)throw new RangeError("Index out of range")}function S(u,i,s,d,w){return i=+i,s=s>>>0,w||Ee(u,i,s,4),r.write(u,i,s,d,23,4),s+4}a.prototype.writeFloatLE=function(i,s,d){return S(this,i,s,!0,d)},a.prototype.writeFloatBE=function(i,s,d){return S(this,i,s,!1,d)};function E(u,i,s,d,w){return i=+i,s=s>>>0,w||Ee(u,i,s,8),r.write(u,i,s,d,52,8),s+8}a.prototype.writeDoubleLE=function(i,s,d){return E(this,i,s,!0,d)},a.prototype.writeDoubleBE=function(i,s,d){return E(this,i,s,!1,d)},a.prototype.copy=function(i,s,d,w){if(!a.isBuffer(i))throw new TypeError("argument should be a Buffer");if(d||(d=0),!w&&w!==0&&(w=this.length),s>=i.length&&(s=i.length),s||(s=0),w>0&&w<d&&(w=d),w===d||i.length===0||this.length===0)return 0;if(s<0)throw new RangeError("targetStart out of bounds");if(d<0||d>=this.length)throw new RangeError("Index out of range");if(w<0)throw new RangeError("sourceEnd out of bounds");w>this.length&&(w=this.length),i.length-s<w-d&&(w=i.length-s+d);const C=w-d;return this===i&&typeof Uint8Array.prototype.copyWithin=="function"?this.copyWithin(s,d,w):Uint8Array.prototype.set.call(i,this.subarray(d,w),s),C},a.prototype.fill=function(i,s,d,w){if(typeof i=="string"){if(typeof s=="string"?(w=s,s=0,d=this.length):typeof d=="str
6ing"&&(w=d,d=this.length),w!==void 0&&typeof w!="string")throw new TypeError("encoding must be a string");if(typeof w=="string"&&!a.isEncoding(w))throw new TypeError("Unknown encoding: "+w);if(i.length===1){const A=i.charCodeAt(0);(w==="utf8"&&A<128||w==="latin1")&&(i=A)}}else typeof i=="number"?i=i&255:typeof i=="boolean"&&(i=Number(i));if(s<0||this.length<s||this.length<d)throw new RangeError("Out of range index");if(d<=s)return this;s=s>>>0,d=d===void 0?this.length:d>>>0,i||(i=0);let C;if(typeof i=="number")for(C=s;C<d;++C)this[C]=i;else{const A=a.isBuffer(i)?i:a.from(i,w),H=A.length;if(H===0)throw new TypeError('The value "'+i+'" is invalid for argument "value"');for(C=0;C<d-s;++C)this[C+s]=A[C%H]}return this};const B={};function D(u,i,s){B[u]=class extends s{constructor(){super(),Object.defineProperty(this,"message",{value:i.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${u}]`,this.stack,delete this.name}get code(){return u}set code(w){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:w,writable:!0})}toString(){return`${this.name} [${u}]: ${this.message}`}}}D("ERR_BUFFER_OUT_OF_BOUNDS",function(u){return u?`${u} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),D("ERR_INVALID_ARG_TYPE",function(u,i){return`The "${u}" argument must be of type number. Received type ${typeof i}`},TypeError),D("ERR_OUT_OF_RANGE",function(u,i,s){let d=`The value of "${u}" is out of range.`,w=s;return Number.isInteger(s)&&Math.abs(s)>2**32?w=W(String(s)):typeof s=="bigint"&&(w=String(s),(s>BigInt(2)**BigInt(32)||s<-(BigInt(2)**BigInt(32)))&&(w=W(w)),w+="n"),d+=` It must be ${i}. Received ${w}`,d},RangeError);function W(u){let i="",s=u.length;const d=u[0]==="-"?1:0;for(;s>=d+4;s-=3)i=`_${u.slice(s-3,s)}${i}`;return`${u.slice(0,s)}${i}`}function f(u,i,s){M(i,"offset"),(u[i]===void 0||u[i+s]===void 0)&&N(i,u.length-(s+1))}function p(u,i,s,d,w,C){if(u>s||u<i){const A=typeof i=="bigint"?"n":"";let H;throw i===0||i===BigInt(0)?H=`>= 0${A} and < 2${A} ** ${(C+1)*8}${A}`:H=`>= -(2${A} ** ${(C+1)*8-1}${A}) and < 2 ** ${(C+1)*8-1}${A}`,new B.ERR_OUT_OF_RANGE("value",H,u)}f(d,w,C)}function M(u,i){if(typeof u!="number")throw new B.ERR_INVALID_ARG_TYPE(i,"number",u)}function N(u,i,s){throw Math.floor(u)!==u?(M(u,s),new B.ERR_OUT_OF_RANGE("offset","an integer",u)):i<0?new B.ERR_BUFFER_OUT_OF_BOUNDS:new B.ERR_OUT_OF_RANGE("offset",`>= 0 and <= ${i}`,u)}const J=/[^+/0-9A-Za-z-_]/g;function $(u){if(u=u.split("=")[0],u=u.trim().replace(J,""),u.length<2)return"";for(;u.length%4!==0;)u=u+"=";return u}function K(u,i){i=i||1/0;let s;const d=u.length;let w=null;const C=[];for(let A=0;A<d;++A){if(s=u.charCodeAt(A),s>55295&&s<57344){if(!w){if(s>56319){(i-=3)>-1&&C.push(239,191,189);continue}else if(A+1===d){(i-=3)>-1&&C.push(239,191,189);continue}w=s;continue}if(s<56320){(i-=3)>-1&&C.push(239,191,189),w=s;continue}s=(w-55296<<10|s-56320)+65536}else w&&(i-=3)>-1&&C.push(239,191,189);if(w=null,s<128){if((i-=1)<0)break;C.push(s)}else if(s<2048){if((i-=2)<0)break;C.push(s>>6|192,s&63|128)}else if(s<65536){if((i-=3)<0)break;C.push(s>>12|224,s>>6&63|128,s&63|128)}else if(s<1114112){if((i-=4)<0)break;C.push(s>>18|240,s>>12&63|128,s>>6&63|128,s&63|128)}else throw new Error("Invalid code point")}return C}function Be(u){const i=[];for(let s=0;s<u.length;++s)i.push(u.charCodeAt(s)&255);return i}function ze(u,i){let s,d,w;const C=[];for(let A=0;A<u.length&&!((i-=2)<0);++A)s=u.charCodeAt(A),d=s>>8,w=s%256,C.push(w),C.push(d);return C}function et(u){return t.toByteArray($(u))}function Ve(u,i,s,d){let w;for(w=0;w<d&&!(w+s>=i.length||w>=u.length);++w)i[w+s]=u[w];return w}function _e(u,i){return u instanceof i||u!=null&&u.constructor!=null&&u.constructor.name!=null&&u.constructor.name===i.name}function De(u){return u!==u}const tt=function(){const u="0123456789abcdef",i=new Array(256);for(let s=0;s<16;++s){const d=s*16;for(let w=0;w<16;++w)i[d+w]=u[s]+u[w]}return i}();function ye(u){return typeof BigInt>"u"?Oe:u}function Oe(){throw new Error("BigInt not supported")}})(Nt);var vn,hi;function Ia(){if(hi)return vn;hi=1;function e(I,T){var k=Object.keys(I);if(Object.getOwnPropertySymbols){var y=Object.getOwnPropertySymbols(I);T&&(y=y.filter(function(x){return Object.getOwnPropertyDescriptor(I,x).enumerable})),k.push.apply(k,y)}return k}function t(I){for(var T=1;T<arguments.length;T++){var k=arguments[T]!=null?arguments[T]:{};
vendor: 5,540 bytes, line 6
6T%2?e(Object(k),!0).forEach(function(y){r(I,y,k[y])}):Object.getOwnPropertyDescriptors?Object.defineProperties(I,Object.getOwnPropertyDescriptors(k)):e(Object(k)).forEach(function(y){Object.defineProperty(I,y,Object.getOwnPropertyDescriptor(k,y))})}return I}function r(I,T,k){return T=l(T),T in I?Object.defineProperty(I,T,{value:k,enumerable:!0,configurable:!0,writable:!0}):I[T]=k,I}function n(I,T){if(!(I instanceof T))throw new TypeError("Cannot call a class as a function")}function o(I,T){for(var k=0;k<T.length;k++){var y=T[k];y.enumerable=y.enumerable||!1,y.configurable=!0,"value"in y&&(y.writable=!0),Object.defineProperty(I,l(y.key),y)}}function c(I,T,k){return T&&o(I.prototype,T),Object.defineProperty(I,"prototype",{writable:!1}),I}function l(I){var T=a(I,"string");return typeof T=="symbol"?T:String(T)}function a(I,T){if(typeof I!="object"||I===null)return I;var k=I[Symbol.toPrimitive];if(k!==void 0){var y=k.call(I,T||"default");if(typeof y!="object")return y;throw new TypeError("@@toPrimitive must return a primitive value.")}return(T==="string"?String:Number)(I)}var h=Nt,_=h.Buffer,m=as,g=m.inspect,b=g&&g.custom||"inspect";function v(I,T,k){_.prototype.copy.call(I,T,k)}return vn=function(){function I(){n(this,I),this.head=null,this.tail=null,this.length=0}return c(I,[{key:"push",value:function(k){var y={data:k,next:null};this.length>0?this.tail.next=y:this.head=y,this.tail=y,++this.length}},{key:"unshift",value:function(k){var y={data:k,next:this.head};this.length===0&&(this.tail=y),this.head=y,++this.length}},{key:"shift",value:function(){if(this.length!==0){var k=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,k}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(k){if(this.length===0)return"";for(var y=this.head,x=""+y.data;y=y.next;)x+=k+y.data;return x}},{key:"concat",value:function(k){if(this.length===0)return _.alloc(0);for(var y=_.allocUnsafe(k>>>0),x=this.head,R=0;x;)v(x.data,y,R),R+=x.data.length,x=x.next;return y}},{key:"consume",value:function(k,y){var x;return k<this.head.data.length?(x=this.head.data.slice(0,k),this.head.data=this.head.data.slice(k)):k===this.head.data.length?x=this.shift():x=y?this._getString(k):this._getBuffer(k),x}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(k){var y=this.head,x=1,R=y.data;for(k-=R.length;y=y.next;){var L=y.data,P=k>L.length?L.length:k;if(P===L.length?R+=L:R+=L.slice(0,k),k-=P,k===0){P===L.length?(++x,y.next?this.head=y.next:this.head=this.tail=null):(this.head=y,y.data=L.slice(P));break}++x}return this.length-=x,R}},{key:"_getBuffer",value:function(k){var y=_.allocUnsafe(k),x=this.head,R=1;for(x.data.copy(y),k-=x.data.length;x=x.next;){var L=x.data,P=k>L.length?L.length:k;if(L.copy(y,y.length-k,0,P),k-=P,k===0){P===L.length?(++R,x.next?this.head=x.next:this.head=this.tail=null):(this.head=x,x.data=L.slice(P));break}++R}return this.length-=R,y}},{key:b,value:function(k,y){return g(this,t(t({},y),{},{depth:0,customInspect:!1}))}}]),I}(),vn}function ka(e,t){var r=this,n=this._readableState&&this._readableState.destroyed,o=this._writableState&&this._writableState.destroyed;return n||o?(t?t(e):e&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,process.nextTick(Dn,this,e)):process.nextTick(Dn,this,e)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(e||null,function(c){!t&&c?r._writableState?r._writableState.errorEmitted?process.nextTick(Qt,r):(r._writableState.errorEmitted=!0,process.nextTick(di,r,c)):process.nextTick(di,r,c):t?(process.nextTick(Qt,r),t(c)):process.nextTick(Qt,r)}),this)}function di(e,t){Dn(e,t),Qt(e)}function Qt(e){e._writableState&&!e._writableState.emitClose||e._readableState&&!e._readableState.emitClose||e.emit("close")}function Ra(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}function Dn(e,t){e.emit("error",t)}function Aa(e,t){var r=e._readableState,n=e._writableState;r&&r.autoDestroy||n&&n.autoDestroy?e.destroy(t):e.emit("error",t)}var Is={destroy:ka,undestroy:Ra,errorOrDestroy:Aa},at={};function Ma(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}var ks={};function ke(e,t,r){r||(r=Error);function n(c,l,a){return typeof t=="string"?t:t(c,l,a)}var o=function(c){Ma(l,c);function l(a,h,_){return c.call(this,n(a,h,_))||this}return l}(r);o.prototype.name=r.name,o.prototype.code=e,ks[e]=o}function fi(e,t){if(Array.isArray(e)){var r=e.length;return e=e.map(function(n){return String(n)}),r>2?"one of ".concat(t," ").concat(e.slice(0,r-1).join(", "),", or ")+e[r-1]:r===2?"one of ".concat(t," ").concat(e[0]," or ").concat(e[1]):"of ".concat(t," ").concat(e[0])}else return"of ".concat(t," ").concat(String(e))}function La(e,t,r){return e.substr(0,t.length)===t}function Ba(e,t,r){return(r===void 0||r>e.length)&&(r=e.length),e.substring(r-t.length,r)===t}function Ta(e,t,r){return typeof r!="number"&&(r=0),r+t.length>e.length?!1:e.indexOf(t,r)!==-1}ke("ERR_INVALID_OPT_VALUE",function(e,t){return'The value "'+t+'" is invali
6d for option "'+e+'"'},TypeError);ke("ERR_INVALID_ARG_TYPE",function(e,t,r){var n;typeof t=="string"&&La(t,"not ")?(n="must not be",t=t.replace(/^not /,"")):n="must be";var o;if(Ba(e," argument"))o="The ".concat(e," ").concat(n," ").concat(fi(t,"type"));else{var c=Ta(e,".")?"property":"argument";o='The "'.concat(e,'" ').concat(c," ").concat(n," ").concat(fi(t,"type"))}return o+=". Received type ".concat(typeof r),o},TypeError);ke("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF");ke("ERR_METHOD_NOT_IMPLEMENTED",function(e){return"The "+e+" method is not implemented"});ke("ERR_STREAM_PREMATURE_CLOSE","Premature close");ke("ERR_STREAM_DESTROYED",function(e){return"Cannot call "+e+" after a stream was destroyed"});ke("ERR_MULTIPLE_CALLBACK","Callback called multiple times");ke("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable");ke("ERR_STREAM_WRITE_AFTER_END","write after end");ke("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError);ke("ERR_UNKNOWN_ENCODING",function(e){return"Unknown encoding: "+e},TypeError);ke("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event");at.codes=ks;var Pa=at.codes.ERR_INVALID_OPT_VALUE;function Na(e,t,r){return e.highWaterMark!=null?e.highWaterMark:t?e[r]:null}function Da(e,t,r,n){var o=Na(t,n,r);if(o!=null){if(!(isFinite(o)&&Math.floor(o)===o)||o<0){var c=n?r:"highWaterMark";throw new Pa(c,o)}return Math.floor(o)}return e.objectMode?16:16*1024}var Rs={getHighWaterMark:Da},Oa=Ua;function Ua(e,t){if(En("noDeprecation"))return e;var r=!1;function n(){if(!r){if(En("throwDeprecation"))throw new Error(t);En("traceDeprecation")?console.trace(t):console.warn(t),r=!0}return e.apply(this,arguments)}return n}function En(e){try{if(!le.localStorage)return!1}catch{return!1}var t=le.localStorage[e];return t==null?!1:String(t).toLowerCase()==="true"}var Sn,pi;function As(){if(pi)return Sn;pi=1,Sn=j;function e(S){var E=this;this.next=null,this.entry=null,this.finish=function(){Ee(E,S)}}var t;j.WritableState=U;var r={deprecate:Oa},n=xs,o=Nt.Buffer,c=(typeof le<"u"?le:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function l(S){return o.from(S)}function a(S){return o.isBuffer(S)||S instanceof c}var h=Is,_=Rs,m=_.getHighWaterMark,g=at.codes,b=g.ERR_INVALID_ARG_TYPE,v=g.E
vendor: 14,423 bytes, line 6
6RR_METHOD_NOT_IMPLEMENTED,I=g.ERR_MULTIPLE_CALLBACK,T=g.ERR_STREAM_CANNOT_PIPE,k=g.ERR_STREAM_DESTROYED,y=g.ERR_STREAM_NULL_VALUES,x=g.ERR_STREAM_WRITE_AFTER_END,R=g.ERR_UNKNOWN_ENCODING,L=h.errorOrDestroy;Pe(j,n);function P(){}function U(S,E,B){t=t||yt(),S=S||{},typeof B!="boolean"&&(B=E instanceof t),this.objectMode=!!S.objectMode,B&&(this.objectMode=this.objectMode||!!S.writableObjectMode),this.highWaterMark=m(this,S,"writableHighWaterMark",B),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var D=S.decodeStrings===!1;this.decodeStrings=!D,this.defaultEncoding=S.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(W){Ne(E,W)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=S.emitClose!==!1,this.autoDestroy=!!S.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new e(this)}U.prototype.getBuffer=function(){for(var E=this.bufferedRequest,B=[];E;)B.push(E),E=E.next;return B},function(){try{Object.defineProperty(U.prototype,"buffer",{get:r.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch{}}();var z;typeof Symbol=="function"&&Symbol.hasInstance&&typeof Function.prototype[Symbol.hasInstance]=="function"?(z=Function.prototype[Symbol.hasInstance],Object.defineProperty(j,Symbol.hasInstance,{value:function(E){return z.call(this,E)?!0:this!==j?!1:E&&E._writableState instanceof U}})):z=function(E){return E instanceof this};function j(S){t=t||yt();var E=this instanceof t;if(!E&&!z.call(j,this))return new j(S);this._writableState=new U(S,this,E),this.writable=!0,S&&(typeof S.write=="function"&&(this._write=S.write),typeof S.writev=="function"&&(this._writev=S.writev),typeof S.destroy=="function"&&(this._destroy=S.destroy),typeof S.final=="function"&&(this._final=S.final)),n.call(this)}j.prototype.pipe=function(){L(this,new T)};function F(S,E){var B=new x;L(S,B),process.nextTick(E,B)}function Z(S,E,B,D){var W;return B===null?W=new y:typeof B!="string"&&!E.objectMode&&(W=new b("chunk",["string","Buffer"],B)),W?(L(S,W),process.nextTick(D,W),!1):!0}j.prototype.write=function(S,E,B){var D=this._writableState,W=!1,f=!D.objectMode&&a(S);return f&&!o.isBuffer(S)&&(S=l(S)),typeof E=="function"&&(B=E,E=null),f?E="buffer":E||(E=D.defaultEncoding),typeof B!="function"&&(B=P),D.ending?F(this,B):(f||Z(this,D,S,B))&&(D.pendingcb++,W=Re(this,D,f,S,E,B)),W},j.prototype.cork=function(){this._writableState.corked++},j.prototype.uncork=function(){var S=this._writableState;S.corked&&(S.corked--,!S.writing&&!S.corked&&!S.bufferProcessing&&S.bufferedRequest&&me(this,S))},j.prototype.setDefaultEncoding=function(E){if(typeof E=="string"&&(E=E.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((E+"").toLowerCase())>-1))throw new R(E);return this._writableState.defaultEncoding=E,this},Object.defineProperty(j.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}});function ue(S,E,B){return!S.objectMode&&S.decodeStrings!==!1&&typeof E=="string"&&(E=o.from(E,B)),E}Object.defineProperty(j.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}});function Re(S,E,B,D,W,f){if(!B){var p=ue(E,D,W);D!==p&&(B=!0,W="buffer",D=p)}var M=E.objectMode?1:D.length;E.length+=M;var N=E.length<E.highWaterMark;if(N||(E.needDrain=!0),E.writing||E.corked){var J=E.lastBufferedRequest;E.lastBufferedRequest={chunk:D,encoding:W,isBuf:B,callback:f,next:null},J?J.next=E.lastBufferedRequest:E.bufferedRequest=E.lastBufferedRequest,E.bufferedRequestCount+=1}else ne(S,E,!1,M,D,W,f);return N}function ne(S,E,B,D,W,f,p){E.writelen=D,E.writecb=p,E.writing=!0,E.sync=!0,E.destroyed?E.onwrite(new k("write")):B?S._writev(W,E.onwrite):S._write(W,f,E.onwrite),E.sync=!1}function he(S,E,B,D,W){--E.pendingcb,B?(process.nextTick(W,D),process.nextTick(pe,S,E),S._writableState.errorEmitted=!0,L(S,D)):(W(D),S._writableState.errorEmitted=!0,L(S,D),pe(S,E))}function de(S){S.writing=!1,S.writecb=null,S.length-=S.writelen,S.writelen=0}function Ne(S,E){var B=S._writableState,D=B.sync,W=B.writecb;if(typeof W!="function")throw new I;if(de(B),E)he(S,B,D,E,W);else{var f=Me(B)||S.destroyed;!f&&!B.corked&&!B.bufferProcessing&&B.bufferedRequest&&me(S,B),D?process.nextTick(we,S,B,f,W):we(S,B,f,W)}}function we(S,E,B,D){B||Ae(S,E),E.pendingcb--,D(),pe(S,E)}function Ae(S,E){E.length===0&&E.needDrain&&(E.needDrain=!1,S.emit("drain"))}function me(S,E){E.bufferProcessing=!0;var B=E.bufferedRequest;if(S._writev&&B&&B.next){var D=E.bufferedRequestCount,W=new Array(D),f=E.corkedRequestsFree;f.entry=B;for(var p=0,M=!0;B;)W[p]=B,B.isBuf||(M=!1),B=B.next,p+=1;W.allBuffers=M,ne(S,E,!0,E.length,W,"",f.finish),E.pendingcb++,E.lastBufferedRequest=null,f.next?(E.corkedRequestsFree=f.next,f.next=null):E.corkedRequestsFree=new e(E),E.bufferedRequestCount=0}else{for(;B;){var N=B.chunk,J=B.encoding,$=B.callback,K=E.objectMode?1:N.length;if(ne(S,E,!1,K,N,J,$),B=B.next,E.bufferedRequestCount--,E.writing)break}B===null&&(E.lastBufferedRequest=null)}E.bufferedRequest=B,E.bufferProcessing=!1}j.prototype._write=function(S,E,B){B(new v("_write()"))},j.prototype._writev=null,j.prototype.end=function(S,E,B){var D=this._writableState;return typeof S=="function"?(B=S,S=null,E=null):typeof E=="function"&&(B=E,E=null),S!=null&&this.write(S,E),D.corked&&(D.corked=1,this.uncork()),D.ending||Le(this,D,B),this},Object.defineProperty(j.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function Me(S){return S.ending&&S.length===0&&S.bufferedRequest===null&&!S.finished&&!S.writing}function Y(S,E){S._final(function(B){E.pendingcb--,B&&L(S,B),E.prefinished=!0,S.emit("prefinish"),pe(S,E)})}function re(S,E){!E.prefinished&&!E.finalCalled&&(typeof S._final=="function"&&!E.destroyed?(E.pendingcb++,E.finalCalled=!0,process.nextTick(Y,S,E)):(E.prefinished=!0,S.emit("prefinish")))}function pe(S,E){var B=Me(E);if(B&&(re(S,E),E.pendingcb===0&&(E.finished=!0,S.emit("finish"),E.autoDestroy))){var D=S._readableState;(!D||D.autoDestroy&&D.endEmitted)&&S.destroy()}return B}function Le(S,E,B){E.ending=!0,pe(S,E),B&&(E.finished?process.nextTick(B):S.once("finish",B)),E.ended=!0,S.writable=!1}function Ee(S,E,B){var D=S.entry;for(S.entry=null;D;){var W=D.callback;E.pendingcb--,W(B),D=D.next}E.corkedRequestsFree.next=S}return Object.defineProperty(j.prototype,"destroyed",{enumerable:!1,get:function(){return this._writableState===void 0?!1:this._writableState.destroyed},set:function(E){this._writableState&&(this._writableState.destroyed=E)}}),j.prototype.destroy=h.destroy,j.prototype._undestroy=h.undestroy,j.prototype._destroy=function(S,E){E(S)},Sn}var xn,_i;function yt(){if(_i)return xn;_i=1;var e=Object.keys||function(_){var m=[];for(var g in _)m.push(g);return m};xn=l;var t=Ls(),r=As();Pe(l,t);for(var n=e(r.prototype),o=0;o<n.length;o++){var c=n[o];l.prototype[c]||(l.prototype[c]=r.prototype[c])}function l(_){if(!(this instanceof l))return new l(_);t.call(this,_),r.call(this,_),this.allowHalfOpen=!0,_&&(_.readable===!1&&(this.readable=!1),_.writable===!1&&(this.writable=!1),_.allowHalfOpen===!1&&(this.allowHalfOpen=!1,this.once("end",a)))}Object.defineProperty(l.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(l.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(l.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}});function a(){this._writableState.ended||process.nextTick(h,this)}function h(_){_.end()}return Object.defineProperty(l.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState===void 0||this._writableState===void 0?!1:this._readableState.destroyed&&this._writableState.destroyed},set:function(m){this._readableState===void 0||this._writableState===void 0||(this._readableState.destroyed=m,this._writableState.destroyed=m)}}),xn}var Cn={},On={exports:{}};/*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */(function(e,t){var r=Nt,n=r.Buffer;function o(l,a){for(var h in l)a[h]=l[h]}n.from&&n.alloc&&n.allocUnsafe&&n.allocUnsafeSlow?e.exports=r:(o(r,t),t.Buffer=c);function c(l,a,h){return n(l,a,h)}c.prototype=Object.create(n.prototype),o(n,c),c.from=function(l,a,h){if(typeof l=="number")throw new TypeError("Argument must not be a number");return n(l,a,h)},c.alloc=function(l,a,h){if(typeof l!="number")throw new TypeError("Argument must be a number");var _=n(l);return a!==void 0?typeof h=="string"?_.fill(a,h):_.fill(a):_.fill(0),_},c.allocUnsafe=function(l){if(typeof l!="number")throw new TypeError("Argument must be a number");return n(l)},c.allocUnsafeSlow=function(l){if(typeof l!="number")throw new TypeError("Argument must be a number");return r.SlowBuffer(l)}})(On,On.exports);var rt=On.exports,gi;function yi(){if(gi)return Cn;gi=1;var e=rt.Buffer,t=e.isEncoding||function(y){switch(y=""+y,y&&y.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function r(y){if(!y)return"utf8";for(var x;;)switch(y){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return y;default:if(x)return;y=(""+y).toLowerCase(),x=!0}}function n(y){var x=r(y);if(typeof x!="string"&&(e.isEncoding===t||!t(y)))throw new Error("Unknown encoding: "+y);return x||y}Cn.StringDecoder=o;function o(y){this.encoding=n(y);var x;switch(this.encoding){case"utf16le":this.text=g,this.end=b,x=4;break;case"utf8":this.fillLast=h,x=4;break;case"base64":this.text=v,this.end=I,x=3;break;default:this.write=T,this.end=k;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=e.allocUnsafe(x)}o.prototype.write=function(y){if(y.length===0)return"";var x,R;if(this.lastNeed){if(x=this.fillLast(y),x===void 0)return"";R=this.lastNeed,this.lastNeed=0}else R=0;return R<y.length?x?x+this.text(y,R):this.text(y,R):x||""},o.prototype.end=m,o.prototype.text=_,o.prototype.fillLast=function(y){if(this.lastNeed<=y.length)return y.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);y.copy(this.lastChar,this.lastTotal-this.lastNeed,0,y.length),this.lastNeed-=y.length};function c(y){return y<=127?0:y>>5===6?2:y>>4===14?3:y>>3===30?4:y>>6===2?-1:-2}function l(y,x,R){var L=x.length-1;if(L<R)return 0;var P=c(x[L]);return P>=0?(P>0&&(y.lastNeed=P-1),P):--L<R||P===-2?0:(P=c(x[L]),P>=0?(P>0&&(y.lastNeed=P-2),P):--L<R||P===-2?0:(P=c(x[L]),P>=0?(P>0&&(P===2?P=0:y.lastNeed=P-3),P):0))}function a(y,x,R){if((x[0]&192)!==128)return y.lastNeed=0,"�";if(y.lastNeed>1&&x.length>1){if((x[1]&192)!==128)return y.lastNeed=1,"�";if(y.lastNeed>2&&x.length>2&&(x[2]&192)!==128)return y.lastNeed=2,"�"}}function h(y){var x=this.lastTotal-this.lastNeed,R=a(this,y);if(R!==void 0)return R;if(this.lastNeed<=y.length)return y.copy(this.lastChar,x,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);y.copy(this.lastChar,x,0,y.length),this.lastNeed-=y.length}function _(y,x){var R=l(this,y,x);if(!this.lastNeed)return y.toString("utf8",x);this.lastTotal=R;var L=y.length-(R-this.lastNeed);return y.copy(this.lastChar,0,L),y.toString("utf8",x,L)}function m(y){var x=y&&y.length?this.write(y):"";return this.lastNeed?x+"�":x}function g(y,x){if((y.length-x)%2===0){var R=y.toString("utf16le",x);if(R){var L=R.charCodeAt(R.length-1);if(L>=55296&&L<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=y[y.length-2],this.lastChar[1]=y[y.length-1],R.slice(0,-1)}return R}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=y[y.length-1],y.toString("utf16le",x,y.length-1)}function b(y){var x=y&&y.length?this.write(y):"";if(this.lastNeed){var R=this.lastTotal-this.lastNeed;return x+this.lastChar.toString("utf16le",0,R)}return x}function v(y,x){var R=(y.length-x)%3;return R===0?y.toString("base64",x):(this.lastNeed=3-R,this.lastTotal=3,R===1?this.lastChar[0]=y[y.length-1]:(this.lastChar[0]=y[y.length-2],this.lastChar[1]=y[y.length-1]),y.toString("base64",x,y.length-R))}function I(y){var x=y&&y.length?this.write(y):"";return this.lastNeed?x+this.lastChar.toString("base64",0,3-this.lastNeed):x}function T(y){return y.toString(this.encoding)}function k(y){return y&&y.length?this.write(y):""}return Cn}var bi=at.codes.ERR_STREAM_PREMATURE_CLOSE;function Fa(e){var t=!1;return function(){if(!t){t=!0;for(var r=arguments.length,n=new Array(r),o=0;o<r;o++)n[o]=arguments[o];e.apply(this,n)}}}function ja(){}function Wa(e){return e.setHeader&&typeof e.abort=="function"}function Ms(e,t,r){if(typeof t=="function")return Ms(e,null,t);t||(t={}),r=Fa(r||ja);var n=t.readable||t.readable!==!1&&e.readable,o=t.writable||t.writable!==!1&&e.writable,c=function(){e.writable||a()},l=e._writableState&&e._writableState.finished,a=function(){o=!1,l=!0,n||r.call(e)},h=e._readableState&&e._readableState.endEmitted,_=function(){n=!1,h=!0,o||r.call(e)},m=function(I){r.call(e,I)},g=function(){var I;if(n&&!h)return(!e._readableState||!e._readableState.ended)&&(I=new bi),r.call(e,I);if(o&&!l)return(!e._writableState||!e._writableState.ended)&&(I=new bi),r.call(e,I)},b=function(){e.req.on("finish",a)};return Wa(e)?(e.on("complete",a),e.on("abort",g),e.req?b():e.on("request",b)):o&&!e._writableState&&(e.on("end",c),e.on("close",c)),e.on("end",_),e.on("finish",a),t.error!==!1&&e.on("error",m),e.on("close",g),function(){e.removeListener("complete",a),e.removeListener("abort",g),e.removeListener("request",b),e.req&&e.req.removeListener("finish",a),e.removeListener("end",c),e.removeListener("close",c),e.removeListener("finish",a),e.removeListener("end",_),e.removeListener("error",m),e.removeListener("close",g)}}var Zn=Ms,In,wi;function $a(){if(wi)return In;wi=1;var e;function t(R,L,P){return L=r(L),L in R?Object.defineProperty(R,L,{value:P,enumerable:!0,configurable:!0,writable:!0}):R[L]=P,R}
6function r(R){var L=n(R,"string");return typeof L=="symbol"?L:String(L)}function n(R,L){if(typeof R!="object"||R===null)return R;var P=R[Symbol.toPrimitive];if(P!==void 0){var U=P.call(R,L||"default");if(typeof U!="object")return U;throw new TypeError("@@toPrimitive must return a primitive value.")}return(L==="string"?String:Number)(R)}var o=Zn,c=Symbol("lastResolve"),l=Symbol("lastReject"),a=Symbol("error"),h=Symbol("ended"),_=Symbol("lastPromise"),m=Symbol("handlePromise"),g=Symbol("stream");function b(R,L){return{value:R,done:L}}function v(R){var L=R[c];if(L!==null){var P=R[g].read();P!==null&&(R[_]=null,R[c]=null,R[l]=null,L(b(P,!1)))}}function I(R){process.nextTick(v,R)}function T(R,L){return function(P,U){R.then(function(){if(L[h]){P(b(void 0,!0));return}L[m](P,U)},U)}}var k=Object.getPrototypeOf(function(){}),y=Object.setPrototypeOf((e={get stream(){return this[g]},next:function(){var L=this,P=this[a];if(P!==null)return Promise.reject(P);if(this[h])return Promise.resolve(b(void 0,!0));if(this[g].destroyed)return new Promise(function(F,Z){process.nextTick(function(){L[a]?Z(L[a]):F(b(void 0,!0))})});var U=this[_],z;if(U)z=new Promise(T(U,this));else{var j=this[g].read();if(j!==null)return Promise.resolve(b(j,!1));z=new Promise(this[m])}return this[_]=z,z}},t(e,Symbol.asyncIterator,function(){return this}),t(e,"return",function(){var L=this;return new Promise(function(P,U){L[g].destroy(null,function(z){if(z){U(z);return}P(b(void 0,!0))})})}),e),k),x=function(L){var P,U=Object.create(y,(P={},t(P,g,{value:L,writable:!0}),t(P,c,{value:null,writable:!0}),t(P,l,{value:null,writable:!0}),t(P,a,{value:null,writable:!0}),t(P,h,{value:L._readableState.endEmitted,writable:!0}),t(P,m,{value:function(j,F){var Z=U[g].read();Z?(U[_]=null,U[c]=null,U[l]=null,j(b(Z,!1))):(U[c]=j,U[l]=F)},writable:!0}),P));return U[_]=null,o(L,function(z){if(z&&z.code!=="ERR_STREAM_PREMATURE_CLOSE"){var j=U[l];j!==null&&(U[_]=null,U[c]=null,U[l]=null,j(z)),U[a]=z;return}var F=U[c];F!==null&&(U[_]=null,U[c]=null,U[l]=null,F(b(void 0,!0))),U[h]=!0}),L.on("readable",I.bind(null,U)),U};return In=x,In}var kn,mi;function Ha(){return mi||(mi=1,kn=function(){throw new Error("Readable.from is not available in the browser")}),kn}var Rn,vi;function Ls(){if(vi)return Rn;vi=1,Rn=F;var e;F.ReadableState=j,os.EventEmitter;var t=function(p,M){return p.listeners(M).length},r=xs,n=Nt.Buffer,o=(typeof le<"u"?le:typeof window<"u"?window:typeof self<"u"?self:{}).Uint8Array||function(){};function c(f){return n.from(f)}function l(f){return n.isBuffer(f)||f instanceof o}var a=as,h;a&&a.debuglog?h=a.debuglog("stream"):h=function(){};var _=Ia(),m=Is,g=Rs,b=g.getHighWaterMark,v=at.codes,I=v.ERR_INVALID_ARG_TYPE,T=v.ERR_STREAM_PUSH_AFTER_EOF,k=v.ERR_METHOD_NOT_IMPLEMENTED,y=v.ERR_STREAM_UNSHIFT_AFTER_END_EVENT,x,R,L;Pe(F,r);var P=m.errorOrDestroy,U=["error","close","destroy","pause","resume"];function z(f,p,M){if(typeof f.prependListener=="function")return f.prependListener(p,M);!f._events||!f._events[p]?f.on(p,M):Array.isArray(f._events[p])?f._events[p].unshift(M):f._events[p]=[M,f._events[p]]}function j(f,p,M){e=e||yt(),f=f||{},typeof M!="boolean"&&(M=p instanceof e),this.objectMode=!!f.objectMode,M&&(this.objectMode=this.objectMode||!!f.readableObjectMode),this.highWaterMark=b(this,f,"readableHighWaterMark",M),this.buffer=new _,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=f.emitClose!==!1,this.autoDestroy=!!f.autoDestroy,this.destroyed=!1,this.defaultEncoding=f.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,f.encoding&&(x||(x=yi().StringDecoder),this.decoder=new x(f.encoding),this.encoding=f.encoding)}function F(f){if(e=e||yt(),!(this instanceof F))return new F(f);var p=this instanceof e;this._readableState=new j(f,this,p),this.readable=!0,f&&(typeof f.read=="function"&&(this._read=f.read),typeof f.destroy=="function"&&(this._destroy=f.destroy)),r.call(this)}Object.defineProperty(F.prototype,"destroyed",{enumerable:!1,get:function(){return this._readableState===void 0?!1:this._readableState.destroyed},set:function(p){this._readableState&&(this._readableState.destroyed=p)}}),F.prototype.destroy=m.destroy,F.prototype._undestroy=m.undestroy,F.prototype._destroy=function(f,p){p(f)},F.prototype.push=function(f,p){var M=this._readableState,N;return M.objectMode?N=!0:typeof f=="string"&&(p=p||M.defaultEncoding,p!==M.encoding&&(f=n.from(f,p),p=""),N=!0),Z(this,f,p,!1,N)},F.prototype.unshift=function(f){return Z(this,f,null,!0,!1)};function Z(f,p,M,N,J){h("readableAddChunk",p);var $=f._readableState;if(p===null)$.reading=!1,Ne(f,$);else{var K;if(J||(K=Re($,p)),K)P(f,K);else if($.objectMode||p&&p.length>
vendor: 4,314 bytes, line 6
60)if(typeof p!="string"&&!$.objectMode&&Object.getPrototypeOf(p)!==n.prototype&&(p=c(p)),N)$.endEmitted?P(f,new y):ue(f,$,p,!0);else if($.ended)P(f,new T);else{if($.destroyed)return!1;$.reading=!1,$.decoder&&!M?(p=$.decoder.write(p),$.objectMode||p.length!==0?ue(f,$,p,!1):me(f,$)):ue(f,$,p,!1)}else N||($.reading=!1,me(f,$))}return!$.ended&&($.length<$.highWaterMark||$.length===0)}function ue(f,p,M,N){p.flowing&&p.length===0&&!p.sync?(p.awaitDrain=0,f.emit("data",M)):(p.length+=p.objectMode?1:M.length,N?p.buffer.unshift(M):p.buffer.push(M),p.needReadable&&we(f)),me(f,p)}function Re(f,p){var M;return!l(p)&&typeof p!="string"&&p!==void 0&&!f.objectMode&&(M=new I("chunk",["string","Buffer","Uint8Array"],p)),M}F.prototype.isPaused=function(){return this._readableState.flowing===!1},F.prototype.setEncoding=function(f){x||(x=yi().StringDecoder);var p=new x(f);this._readableState.decoder=p,this._readableState.encoding=this._readableState.decoder.encoding;for(var M=this._readableState.buffer.head,N="";M!==null;)N+=p.write(M.data),M=M.next;return this._readableState.buffer.clear(),N!==""&&this._readableState.buffer.push(N),this._readableState.length=N.length,this};var ne=1073741824;function he(f){return f>=ne?f=ne:(f--,f|=f>>>1,f|=f>>>2,f|=f>>>4,f|=f>>>8,f|=f>>>16,f++),f}function de(f,p){return f<=0||p.length===0&&p.ended?0:p.objectMode?1:f!==f?p.flowing&&p.length?p.buffer.head.data.length:p.length:(f>p.highWaterMark&&(p.highWaterMark=he(f)),f<=p.length?f:p.ended?p.length:(p.needReadable=!0,0))}F.prototype.read=function(f){h("read",f),f=parseInt(f,10);var p=this._readableState,M=f;if(f!==0&&(p.emittedReadable=!1),f===0&&p.needReadable&&((p.highWaterMark!==0?p.length>=p.highWaterMark:p.length>0)||p.ended))return h("read: emitReadable",p.length,p.ended),p.length===0&&p.ended?B(this):we(this),null;if(f=de(f,p),f===0&&p.ended)return p.length===0&&B(this),null;var N=p.needReadable;h("need readable",N),(p.length===0||p.length-f<p.highWaterMark)&&(N=!0,h("length less than watermark",N)),p.ended||p.reading?(N=!1,h("reading or ended",N)):N&&(h("do read"),p.reading=!0,p.sync=!0,p.length===0&&(p.needReadable=!0),this._read(p.highWaterMark),p.sync=!1,p.reading||(f=de(M,p)));var J;return f>0?J=E(f,p):J=null,J===null?(p.needReadable=p.length<=p.highWaterMark,f=0):(p.length-=f,p.awaitDrain=0),p.length===0&&(p.ended||(p.needReadable=!0),M!==f&&p.ended&&B(this)),J!==null&&this.emit("data",J),J};function Ne(f,p){if(h("onEofChunk"),!p.ended){if(p.decoder){var M=p.decoder.end();M&&M.length&&(p.buffer.push(M),p.length+=p.objectMode?1:M.length)}p.ended=!0,p.sync?we(f):(p.needReadable=!1,p.emittedReadable||(p.emittedReadable=!0,Ae(f)))}}function we(f){var p=f._readableState;h("emitReadable",p.needReadable,p.emittedReadable),p.needReadable=!1,p.emittedReadable||(h("emitReadable",p.flowing),p.emittedReadable=!0,process.nextTick(Ae,f))}function Ae(f){var p=f._readableState;h("emitReadable_",p.destroyed,p.length,p.ended),!p.destroyed&&(p.length||p.ended)&&(f.emit("readable"),p.emittedReadable=!1),p.needReadable=!p.flowing&&!p.ended&&p.length<=p.highWaterMark,S(f)}function me(f,p){p.readingMore||(p.readingMore=!0,process.nextTick(Me,f,p))}function Me(f,p){for(;!p.reading&&!p.ended&&(p.length<p.highWaterMark||p.flowing&&p.length===0);){var M=p.length;if(h("maybeReadMore read 0"),f.read(0),M===p.length)break}p.readingMore=!1}F.prototype._read=function(f){P(this,new k("_read()"))},F.prototype.pipe=function(f,p){var M=this,N=this._readableState;switch(N.pipesCount){case 0:N.pipes=f;break;case 1:N.pipes=[N.pipes,f];break;default:N.pipes.push(f);break}N.pipesCount+=1,h("pipe count=%d opts=%j",N.pipesCount,p);var J=(!p||p.end!==!1)&&f!==process.stdout&&f!==process.stderr,$=J?Be:Oe;N.endEmitted?process.nextTick($):M.once("end",$),f.on("unpipe",K);function K(u,i){h("onunpipe"),u===M&&i&&i.hasUnpiped===!1&&(i.hasUnpiped=!0,Ve())}function Be(){h("onend"),f.end()}var ze=Y(M);f.on("drain",ze);var et=!1;function Ve(){h("cleanup"),f.removeListener("close",tt),f.removeListener("finish",ye),f.removeListener("drain",ze),f.removeListener("error",De),f.removeListener("unpipe",K),M.removeListener("end",Be),M.removeListener("end",Oe),M.removeListener("data",_e),et=!0,N.awaitDrain&&(!f._writableState||f._writableState.needDrain)&&ze()}M.on("data",_e);function _e(u){h("ondata");var i=f.write(u);
vendor: 5,025 bytes, line 6
6h("dest.write",i),i===!1&&((N.pipesCount===1&&N.pipes===f||N.pipesCount>1&&W(N.pipes,f)!==-1)&&!et&&(h("false write response, pause",N.awaitDrain),N.awaitDrain++),M.pause())}function De(u){h("onerror",u),Oe(),f.removeListener("error",De),t(f,"error")===0&&P(f,u)}z(f,"error",De);function tt(){f.removeListener("finish",ye),Oe()}f.once("close",tt);function ye(){h("onfinish"),f.removeListener("close",tt),Oe()}f.once("finish",ye);function Oe(){h("unpipe"),M.unpipe(f)}return f.emit("pipe",M),N.flowing||(h("pipe resume"),M.resume()),f};function Y(f){return function(){var M=f._readableState;h("pipeOnDrain",M.awaitDrain),M.awaitDrain&&M.awaitDrain--,M.awaitDrain===0&&t(f,"data")&&(M.flowing=!0,S(f))}}F.prototype.unpipe=function(f){var p=this._readableState,M={hasUnpiped:!1};if(p.pipesCount===0)return this;if(p.pipesCount===1)return f&&f!==p.pipes?this:(f||(f=p.pipes),p.pipes=null,p.pipesCount=0,p.flowing=!1,f&&f.emit("unpipe",this,M),this);if(!f){var N=p.pipes,J=p.pipesCount;p.pipes=null,p.pipesCount=0,p.flowing=!1;for(var $=0;$<J;$++)N[$].emit("unpipe",this,{hasUnpiped:!1});return this}var K=W(p.pipes,f);return K===-1?this:(p.pipes.splice(K,1),p.pipesCount-=1,p.pipesCount===1&&(p.pipes=p.pipes[0]),f.emit("unpipe",this,M),this)},F.prototype.on=function(f,p){var M=r.prototype.on.call(this,f,p),N=this._readableState;return f==="data"?(N.readableListening=this.listenerCount("readable")>0,N.flowing!==!1&&this.resume()):f==="readable"&&!N.endEmitted&&!N.readableListening&&(N.readableListening=N.needReadable=!0,N.flowing=!1,N.emittedReadable=!1,h("on readable",N.length,N.reading),N.length?we(this):N.reading||process.nextTick(pe,this)),M},F.prototype.addListener=F.prototype.on,F.prototype.removeListener=function(f,p){var M=r.prototype.removeListener.call(this,f,p);return f==="readable"&&process.nextTick(re,this),M},F.prototype.removeAllListeners=function(f){var p=r.prototype.removeAllListeners.apply(this,arguments);return(f==="readable"||f===void 0)&&process.nextTick(re,this),p};function re(f){var p=f._readableState;p.readableListening=f.listenerCount("readable")>0,p.resumeScheduled&&!p.paused?p.flowing=!0:f.listenerCount("data")>0&&f.resume()}function pe(f){h("readable nexttick read 0"),f.read(0)}F.prototype.resume=function(){var f=this._readableState;return f.flowing||(h("resume"),f.flowing=!f.readableListening,Le(this,f)),f.paused=!1,this};function Le(f,p){p.resumeScheduled||(p.resumeScheduled=!0,process.nextTick(Ee,f,p))}function Ee(f,p){h("resume",p.reading),p.reading||f.read(0),p.resumeScheduled=!1,f.emit("resume"),S(f),p.flowing&&!p.reading&&f.read(0)}F.prototype.pause=function(){return h("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(h("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this};function S(f){var p=f._readableState;for(h("flow",p.flowing);p.flowing&&f.read()!==null;);}F.prototype.wrap=function(f){var p=this,M=this._readableState,N=!1;f.on("end",function(){if(h("wrapped end"),M.decoder&&!M.ended){var K=M.decoder.end();K&&K.length&&p.push(K)}p.push(null)}),f.on("data",function(K){if(h("wrapped data"),M.decoder&&(K=M.decoder.write(K)),!(M.objectMode&&K==null)&&!(!M.objectMode&&(!K||!K.length))){var Be=p.push(K);Be||(N=!0,f.pause())}});for(var J in f)this[J]===void 0&&typeof f[J]=="function"&&(this[J]=function(Be){return function(){return f[Be].apply(f,arguments)}}(J));for(var $=0;$<U.length;$++)f.on(U[$],this.emit.bind(this,U[$]));return this._read=function(K){h("wrapped _read",K),N&&(N=!1,f.resume())},this},typeof Symbol=="function"&&(F.prototype[Symbol.asyncIterator]=function(){return R===void 0&&(R=$a()),R(this)}),Object.defineProperty(F.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),Object.defineProperty(F.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}}),Object.defineProperty(F.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(p){this._readableState&&(this._readableState.flowing=p)}}),F._fromList=E,Object.defineProperty(F.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}});function E(f,p){if(p.length===0)return null;var M;return p.objectMode?M=p.buffer.shift():!f||f>=p.length?(p.decoder?M=p.buffer.join(""):p.buffer.length===1?M=p.buffer.first():M=p.buffer.concat(p.length),p.buffer.clear()):M=p.buffer.consume(f,p.decoder),M}function B(f){var p=f._readableState;h("endReadable",p.endEmitted),p.endEmitted||(p.ended=!0,process.nextTick(D,p,f))}function D(f,p){if(h("endReadableNT",f.endEmitted,f.length),!f.endEmitted&&f.length===0&&(f.endEmitted=!0,p.readable=!1,p.emit("end"),f.autoDestroy)){var M=p._writableState;(!M||M.autoDestroy&&M.finished)&&p.destroy()}}typeof Symbol=="function"&&(F.from=function(f,p){return L===void 0&&(L=Ha()),L(F,f,p)});function W(f,p){for(var M=0,N=f.length;M<N;M++)if(f[M]===p)return M;return-1}return Rn}
6var Bs=Qe,pr=at.codes,qa=pr.ERR_METHOD_NOT_IMPLEMENTED,Ka=pr.ERR_MULTIPLE_CALLBACK,za=pr.ERR_TRANSFORM_ALREADY_TRANSFORMING,Va=pr.ERR_TRANSFORM_WITH_LENGTH_0,_r=yt();Pe(Qe,_r);function Ga(e,t){var r=this._transformState;r.transforming=!1;var n=r.writecb;if(n===null)return this.emit("error",new Ka);r.writechunk=null,r.writecb=null,t!=null&&this.push(t),n(e);var o=this._readableState;o.reading=!1,(o.needReadable||o.length<o.highWaterMark)&&this._read(o.highWaterMark)}function Qe(e){if(!(this instanceof Qe))return new Qe(e);_r.call(this,e),this._transformState={afterTransform:Ga.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,e&&(typeof e.transform=="function"&&(this._transform=e.transform),typeof e.flush=="function"&&(this._flush=e.flush)),this.on("prefinish",Za)}function Za(){var e=this;typeof this._flush=="function"&&!this._readableState.destroyed?this._flush(function(t,r){Ei(e,t,r)}):Ei(this,null,null)}Qe.prototype.push=function(e,t){return this._transformState.needTransform=!1,_r.prototype.push.call(this,e,t)};Qe.prototype._transform=function(e,t,r){r(new qa("_transform()"))};Qe.prototype._write=function(e,t,r){var n=this._transformState;if(n.writecb=r,n.writechunk=e,n.writeencoding=t,!n.transforming){var o=this._readableState;(n.needTransform||o.needReadable||o.length<o.highWaterMark)&&this._read(o.highWaterMark)}};Qe.prototype._read=function(e){var t=this._transformState;t.writechunk!==null&&!t.transforming?(t.transforming=!0,this._transform(t.writechunk,t.writeencoding,t.afterTransform)):t.needTransform=!0};Qe.prototype._destroy=function(e,t){_r.prototype._destroy.call(this,e,function(r){t(r)})};function Ei(e,t,r){if(t)return e.emit("error",t);if(r!=null&&e.push(r),e._writableState.length)throw new Va;if(e._transformState.transforming)throw new za;return e.push(null)}var Ya=Mt,Ts=Bs;Pe(Mt,Ts);function Mt(e){if(!(this instanceof Mt))return new Mt(e);Ts.call(this,e)}Mt.prototype._transform=function(e,t,r){r(null,e)};var An;function Ja(e){var t=!1;return function(){t||(t=!0,e.apply(void 0,arguments))}}var Ps=at.codes,Qa=Ps.ERR_MISSING_ARGS,Xa=Ps.ERR_STREAM_DESTROYED;function Si(e){if(e)throw e}function ec(e){return e.setHeader&&typeof e.abort=="function"}function tc(e,t,r,n){n=Ja(n);var o=!1;e.on("close",function(){o=!0}),An===void 0&&(An=Zn),An(e,{readable:t,writable:r},function(l){if(l)return n(l);o=!0,n()});var c=!1;return function(l){if(!o&&!c){if(c=!0,ec(e))return e.abort();if(typeof e.destroy=="function")return e.destroy();n(l||new Xa("pipe"))}}}function xi(e){e()}function rc(e,t){return e.pipe(t)}function nc(e){return!e.length||typeof e[e.length-1]!="function"?Si:e.pop()}function ic(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];var n=nc(t);if(Array.isArray(t[0])&&(t=t[0]),t.length<2)throw new Qa("streams");var o,c=t.map(function(l,a){var h=a<t.length-1,_=a>0;return tc(l,h,_,function(m){o||(o=m),m&&c.forEach(xi),!h&&(c.forEach(xi),n(o))})});return t.reduce(rc)}var sc=ic;(function(e,t){t=e.exports=Ls(),t.Stream=t,t.Readable=t,t.Writable=As(),t.Duplex=yt(),t.Transform=Bs,t.PassThrough=Ya,t.finished=Zn,t.pipeline=sc})(Nn,Nn.exports);var Ns=Nn.exports;const{Transform:oc}=Ns;var ac=e=>class Ds extends oc{constructor(r,n,o,c,l){super(l),this._rate=r,this._capacity=n,this._delimitedSuffix=o,this._hashBitLength=c,this._options=l,this._state=new e,this._state.initialize(r,n),this._finalized=!1}_transform(r,n,o){let c=null;try{this.update(r,n)}catch(l){c=l}o(c)}_flush(r){let n=null;try{this.push(this.digest())}catch(o){n=o}r(n)}update(r,n){if(!Buffer.isBuffer(r)&&typeof r!="string")throw new TypeError("Data must be a string or a buffer");if(this._finalized)throw new Error("Digest already called");return Buffer.isBuffer(r)||(r=Buffer.from(r,n)),this._state.absorb(r),this}digest(r){if(this._finalized)throw new Error("Digest already called");this._finalized=!0,this._delimitedSuffix&&this._state.absorbLastFewBits(this._delimitedSuffix);let n=this._state.squeeze(this._hashBitLength/8);return r!==void 0&&(n=n.toString(r)),this._resetState(),n}_resetState(){return this._state.initialize(this._rate,this._capacity),this}_clone(){const r=new Ds(this._rate,this._capacity,this._delimitedSuffix,this._hashBitLength,this._options);return this._state.copy(r._state),r._finalized=this._finalized,r}};const{Transform:cc}=Ns;var lc=e=>class Os extends cc{constructor(r,n,o,c){super(c),this._rate=r,this._capacity=n,this._delimitedSuffix=o,this._options=c,this._state=new e,this._state.initialize(r,n),this._finalized=!1}_transform(r,n,o){let c=null;try{this.update(r,n)}catch(l){c=l}o(c)}_flush(){}_read(r){this.push(this.squeeze(r))}update(r,n){if(!Buffer.isBuffer(r)&&typeof r!="string")throw new TypeError("Data must be a string or a buffer");if(this._finalized)throw new Error("Squeeze already called");return Buffer.isBuffer(r)||(r=Buffer.from(r,n)),this._state.absorb(r),this}squeeze(r,n){this._finalized||(this._finalized=!0,this._state.absorbLastFewBits(this._delimitedSuffix));let o=this._state.squeeze(r);return n!==void 0&&(o=o.toString(n)),o}_resetState(){return this._state.initialize(this._rate,this._capacity),this}_clone(){const r=new Os(this._rate,this._capacity,this._delimitedSuffix,this._options);return this._state.copy(r._state),r._finalized=this._finalized,r}};const uc=ac,hc=lc;var dc=function(e){const t=uc(e),r=hc(e);return function(n,o){switch(typeof n=="string"?n.toLowerCase():n){case"keccak224":return new t(1152,448,null,224,o);case"keccak256":return new t(1088,512,null,256,o);case"keccak384":return new t(832,768,null,384,o);case"keccak512":return new t(576,1024,null,512,o);case"sha3-224":return new t(1152,448,6,224,o);case"sha3-256":return new t(1088,512,6,256,o);case"sha3-384":return new t(832,768,6,384,o);case"sha3-512":return new t(576,1024,6,512,o);case"shake128":return new r(1344,256,31,o);case"shake256":return new r(1088,512,31,o);default:throw new Error("Invald algorithm: "+n)}}},Us={};const Ci=[1,0,32898,0,32906,2147483648,2147516416,2147483648,32907,0,2147483649,0,2147516545,2147483648,32777,2147483648,138,0,136,0,2147516425,0,2147483658,0,2147516555,0,139,2147483648,32905,2147483648,32771,2147483648,32770,2147483648,128,2147483648,32778,0,2147483658,2147483648,2147516545,2147483648,32896,2147483648,2147483649,0,2147516424,2147483648];Us.p1600=function(e){for(let t=0;t<24;++t){const r=e[0]^e[10]^e[20]^e[30]^e[40],n=e[1]^e[11]^e[21]^e[31]^e[41],o=e[2]^e[12]^e[22]^e[32]^e[42],c=e[3]^e[13]^e[23]^e[33]^e[43],l=e[4]^e[14]^e[24]^e[34]^e[44],a=e[5]^e[15]^e[25]^e[35]^e[45],h=e[6]^e[16]^e[26]^e[36]^e[46],_=e[7]^e[17]^e[27]^e[37]^e[47],m=e[8]^e[18]^e[28]^e[38]^e[48],g=e[9]^e[19]^e[29]^e[39]^e[49];let b=m^(o<<1|c>>>31),v=g^(c<<1|o>>>31);const I=e[0]^b,T=e[1]^v,k=e[10]^b,y=e[11]^v,x=e[20]^b,R=e[21]^v,L=e[30]^b,P=e[31]^v,U=e[40]^b,z=e[41]^v;b=r^(l<<1|a>>>31),v=n^(a<<1|l>>>31);const j=e[2]^b,F=e[3]^v,Z=e[12]^b,ue=e[13]^v,Re=e[22]^b,ne=e[23]^v,he=e[32]^b,de=e[33]^v,Ne=e[42]^b,we=e[43]^v;b=o^(h<<1|_>>>31),v=c^(_<<1|h>>>31);const Ae=e[4]^b,me=e[5]^v,Me=e[14]^b,Y=e[15]^v,re=e[24]^b,pe=e[25]^v,Le=e[34]^b,Ee=e[35]^v,S=e[44]^b,E=e[45]^v;b=l^(m<<1|g>>>31),v=a^(g<<1|m>>>31);const B=e[6]^b,D=e[7]^v,W=e[16]^b,f=e[17]^v,p=e[26]^b,M=e[27]^v,N=e[36]^b,J=e[37]^v,$=e[46]^b,K=e[47]^v;b=h^(r<<1|n>>>31),v=_^(n<<1|r>>>31);const Be=e[8]^b,ze=e[9]^v,et=e[18]^b,Ve=e[19]^v,_e=e[28]^b,De=e[29]^v,tt=e[38]^b,ye=e[39]^v,Oe=e[48]^b,u=e[49]^v,i=I,s=T,d=y<<4|k>>>28,w=k<<4|y>>>28,C=x<<3|R>>>29,A=R<<3|x>>>29,H=P<<9|L>>>23,X=L<<9|P>>>23,G=U<<18|z>>>14,ee=z<<18|U>>>14,V=j<<1|F>>>31,Lr=F<<1|j>>>31,Br=ue<<12|Z>>>20,Tr=Z<<12|ue>>>20,Pr=Re<<10|ne>>>22,Nr=ne<<10|Re>>>22,Dr=de<<13|he>>>19,Or=he<<13|de>>>19,Ur=Ne<<2|we>>>30,Fr=we<<2|Ne>>>30,jr=me<<30|Ae>>>2,Wr=Ae<<30|me>>>2,$r=Me<<6|Y>>>26,Hr=Y<<6|Me>>>26,qr=pe<<11|re>>>21,Kr=re<<11|pe>>>21,zr=Le<<15|Ee>>>17,Vr=Ee<<15|Le>>>17,Gr=E<<29|S>>>3,Zr=S<<29|E>>>3,Yr=B<<28|D>>>4,Jr=D<<28|B>>>4,Qr=f<<23|W>>>9,Xr=W<<23|f>>>9,en=p<<25|M>>>7,tn=M<<25|p>>>7,rn=N<<21|J>>>11,nn=J<<21|N>>>11,sn=K<<24|$>>>8,on=$<<24|K>>>8,an=Be<<27|ze>>>5,cn=ze<<27|Be>>>5,ln=et<<20|Ve>>>12,un=Ve<<20|et>>>12,hn=De<<7|_e>>>25,dn=_e<<7|De>>>25,fn=tt<<8|ye>>>24,pn=ye<<8|tt>>>24,_n=Oe<<14|u>>>18,gn=u<<14|Oe>>>18;e[0]=i^~Br&qr,e[1]=s^~Tr&Kr,e[10]=Yr^~ln&C,e[11]=Jr^~un&A,e[20]=V^~$r&en,e[21]=Lr^~Hr&tn,e[30]=an^~d&Pr,e[31]=cn^~w&Nr,e[40]=jr^~Qr&hn,e[41]=Wr^~Xr&dn,e[2]=Br^~qr&rn,e[3]=Tr^~Kr&nn,e[12]=ln^~C&Dr,e[13]=un^~A&Or,e[22]=$r^~en&fn,e[23]=Hr^~tn&pn,e[32]=d^~Pr&zr,e[33]=w^~Nr&Vr,e[42]=Qr^~hn&H,e[43]=Xr^~dn&X,e[4]=qr^~rn&_n,e[5]=Kr^~nn&gn,e[14]=C^~Dr&Gr,e[15]=A^~Or&Zr,e[24]=en^~fn&G,e[25]=tn^~pn&ee,e[34]=Pr^~zr&sn,e[35]=Nr^~Vr&on,e[44]=hn^~H&Ur,e[45]=dn^~X&Fr,e[6]=rn^~_n&i,e[7]=nn^~gn&s,e[16]=Dr^~Gr&Yr,e[17]=Or^~Zr&Jr,e[26]=fn^~G&V,e[27]=pn^~ee&Lr,e[36]=zr^~sn&an,e[37]=Vr^~on&cn,e[46]=H^~Ur&jr,e[47]=X^~Fr&Wr,e[8]=_n^~i&Br,e[9]=gn^~s&Tr,e[18]=Gr^~Yr&ln,e[19]=Zr^~Jr&un,e[28]=G^~V&$r,e[29]=ee^~Lr&Hr,e[38]=sn^~an&d,e[39]=on^~cn&w,e[48]=Ur^~jr&Qr,e[49]=Fr^~Wr&Xr,e[0]^=Ci[t*2],e[1]^=Ci[t*2+1]}};const rr=Us;function St(){this.state=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],this.blockSize=null,this.count=0,this.squeezing=!1}St.prototype.initialize=function(e,t){for(let r=0;r<50;++r)this.state[r]=0;this.blockSize=e/8,this.count=0,this.squeezing=!1};St.prototype.absorb=function(e){for(let t=0;t<e.length;++t)this.state[~~(this.count/4)]^=e[t]<<8*(this.count%4),this.count+=1,this.count===this.blockSize&&(rr.p1600(this.state),this.count=0)};St.prototype.absorbLastFewBits=function(e){this.state[~~(this.count/4)]^=e<<8*(this.count%4),e&128&&this.count===this.blockSize-1&&rr.p1600(this.state),this.state[~~((this.blockSize-1)/4)]^=128<<8*((this.blockSize-1)%4),rr.p1600(this.state),this.count=0,this.squeezing=!0};St.prototype.squeeze=function(e){this.squeezing||this.absorbLastFewBits(1);const t=Buffer.alloc(e);for(let r=0;r<e;++r)t[r]=this.state[~~(this.count/4)]>>>8*(this.count%4)&255,this.count+=1,this.count===this.blockSize&&(rr.p1600(this.state),this.count=0);return t};St.prototype.copy=function(e){for(let t=0;t<50;++t)e.state[t]=this.state[t];e.blockSize=this.blockSize,e.count=this.count,e.squeezing=this.squeezing};var fc=St,pc=dc(fc);const _c=pc;function Fs(e){return Buffer.allocUnsafe(e).fill(0)}function gc(e){return e.toString(2).length}function js(e,t){let r=e.toString(16);r.length%2!==0&&(r="0"+r);const n=r.match(/.{1,2}/g).map(o=>parseInt(o,16));for(;n.length<t;)n.unshift(0);return Buffer.from(n)}function yc(e,t){const r=e<0n;let n;if(r){const o=(1n<<BigInt(t))-1n;n=(~e&o)+1n}else n=e;return n&=(1n<<BigInt(t))-1n,n}function Ws(e,t,r){const n=Fs(t);return e=gr(e),r?e.length<t?(e.copy(n),n):e.slice(0,t):e.length<t?(e.copy(n,t-e.length),n):e.slice(-t)}function bc(e,t){return Ws(e,t,!0)}function gr(e){if(!Buffer.isBuffer(e))if(Array.isArray(e))e=Buffer.from(e);else if(typeof e=="string")$s(e)?e=Buffer.from(vc(Hs(e)),"hex"):e=Buffer.from(e);else if(typeof e=="number")e=intToBuffer(e);else if(e==null)e=Buffer.allocUnsafe(0);else if(typeof e=="bigint")e=js(e);else if(e.toArray)e=Buffer.from(e.toArray());else throw new Error("invalid type");return e}function wc(e){return e=gr(e),"0x"+e.toString("hex")}function mc(e,t){return e=gr(e),t||(t=256),_c("keccak"+t).update(e).digest()}function vc(e){return e.length%2?"0"+e:e}function $s(e){return typeof e=="string"&&e.match(/^0x[0-9A-Fa-f]*$/)}function Hs(e){return typeof e=="string"&&e.startsWith("0x")?e.slice(2):e}var qs={zeros:Fs,setLength:Ws,setLengthRight:bc,isHexString:$s,stripHexPrefix:Hs,toBuffer:gr,bufferToHex:wc,keccak:mc,bitLengthFromBigInt:gc,bufferBEFromBigInt:js,twosFromBigInt:yc};const be=qs;function Ks(e){return e.startsWith("int[")?"int256"+e.slice(3):e==="int"?"int256":e.startsWith("uint[")?"uint256"+e.slice(4):e==="uint"?"uint256":e.startsWith("fixed[")?"fixed128x128"+e.slice(5):e==="fixed"?"fixed128x128":e.startsWith("ufixed[")?"ufixed128x128"+e.slice(6):e==="ufixed"?"ufixed128x128":e}function gt(e){return parseInt(/^\D+(\d+)$/.exec(e)[1],10)}function Ii(e){var t=/^\D+(\d+)x(\d+)$/.exec(e);return[parseInt(t[1],10),parseInt(t[2],10)]}function zs(e){var t=e.match(/(.*)\[(.*?)\]$/);return t?t[2]===""?"dynamic":parseInt(t[2],10):null}function nt(e){var t=typeof e;if(t==="string"||t==="number")return BigInt(e);if(t==="bigint")return e;throw new Error("Argument is not a number")}function Ue(e,t){var r,n,o,c;if(e==="address")return Ue("uint160",nt(t));if(e==="bool")return Ue("uint8",t?1:0);if(e==="string")return Ue("bytes",new Buffer(t,"utf8"));if(Sc(e)){if(typeof t.length>"u")throw new Error("Not an array?");if(r=zs(e),r!=="dynamic"&&r!==0&&t.length>r)throw new Error("Elements exceed array size: "+r);o=[],e=e.slice(0,e.lastIndexOf("[")),typeof t=="string"&&(t=JSON.parse(t));for(c in t)o.push(Ue(e,t[c]));if(r==="dynamic"){var l=Ue("uint256",t.length);o.unshift(l)}return Buffer.concat(o)}else{if(e==="bytes")return t=new Buffer(t),o=Buffer.concat([Ue("uint256",t.length),t]),t.length%32!==0&&(o=Buffer.concat([o,be.zeros(32-t.length%32)])),o;if(e.startsWith("bytes")){if(r=gt(e),r<1||r>32)throw new Error("Invalid bytes<N> width: "+r);return be.setLengthRight(t,32)}else if(e.startsWith("uint")){if(r=gt(e),r%8||r<8||r>256)throw new Error("Invalid uint<N> width: "+r);n=nt(t);const a=be.bitLengthFromBigInt(n);if(a>r)throw new Error("Supplied uint exceeds width: "+r+" vs "+a);if(n<0)throw new Error("Supplied uint is negative");return be.bufferBEFromBigInt(n,32)}else if(e.startsWith("int")){if(r=gt(e),r%8||r<8||r>256)throw new Error("Invalid int<N> width: "+r);n=nt(t);const a=be.bitLengthFromBigInt(n);if(a>r)throw new Error("Supplied int exceeds width: "+r+" vs "+a);const h=be.twosFromBigInt(n,256);return be.bufferBEFromBigInt(h,32)}else if(e.startsWith("ufixed")){if(r=Ii(e),n=nt(t),n<0)throw new Error("Supplied ufixed is negative");return Ue("uint256",n*BigInt(2)**BigInt(r[1]))}else if(e.startsWith("fixed"))return r=Ii(e),Ue("int256",nt(t)*BigInt(2)**BigInt(r[1]))}throw new Error("Unsupported or invalid type: "+e)}function Ec(e){return e==="string"||e==="bytes"||zs(e)==="dynamic"}function Sc(e){return e.lastIndexOf("]")===e.length-1}function xc(e,t){var r=[],n=[],o=32*e.length;for(var c in e){var l=Ks(e[c]),a=t[c],h=Ue(l,a);Ec(l)?(r.push(Ue("uint256",o)),n.push(h),o+=h.length):r.push(h)}return Buffer.concat(r.concat(n))}function Vs(e,t){if(e.length!==t.length)throw new Error("Number of types are not matching the values");for(var r,n,o=[],c=0;c<e.length;c++){var l=Ks(e[c]),a=t[c];if(l==="bytes")o.push(a);else if(l==="string")o.push(new Buffer(a,"utf8"));else if(l==="bool")o.push(new Buffer(a?"01":"00","hex"));else if(l==="address")o.push(be.setLength(a,20));else if(l.startsWith("bytes")){if(r=gt(l),r<1||r>32)throw new Error("Invalid bytes<N> width: "+r);o.push(be.setLengthRight(a,r))}else if(l.startsWith("uint")){if(r=gt(l),r%8||r<8||r>256)throw new Error("Invalid uint<N> width: "+r);n=nt(a);const h=be.bitLengthFromBigInt(n);if(h>r)throw new Error("Supplied uint exceeds width: "+r+" vs "+h);o.push(be.bufferBEFromBigInt(n,r/8))}else if(l.startsWith("int")){if(r=gt(l),r%8||r<8||r>256)throw new Error("Invalid int<N> width: "+r);n=nt(a);const h=be.bitLengthFromBigInt(n);if(h>r)throw new Error("Supplied int exceeds width: "+r+" vs "+h);
6const _=be.twosFromBigInt(n,r);o.push(be.bufferBEFromBigInt(_,r/8))}else throw new Error("Unsupported or invalid type: "+l)}return Buffer.concat(o)}function Cc(e,t){return be.keccak(Vs(e,t))}var Ic={rawEncode:xc,solidityPack:Vs,soliditySHA3:Cc};const Te=qs,It=Ic,Gs={type:"object",properties:{types:{type:"object",additionalProperties:{type:"array",items:{type:"object",properties:{name:{type:"string"},type:{type:"string"}},required:["name","type"]}}},primaryType:{type:"string"},domain:{type:"object"},message:{type:"object"}},required:["types","primaryType","domain","message"]},Mn={encodeData(e,t,r,n=!0){const o=["bytes32"],c=[this.hashType(e,r)];if(n){const l=(a,h,_)=>{if(r[h]!==void 0)return["bytes32",_==null?"0x0000000000000000000000000000000000000000000000000000000000000000":Te.keccak(this.encodeData(h,_,r,n))];if(_===void 0)throw new Error(`missing value for field ${a} of type ${h}`);if(h==="bytes")return["bytes32",Te.keccak(_)];if(h==="string")return typeof _=="string"&&(_=Buffer.from(_,"utf8")),["bytes32",Te.keccak(_)];if(h.lastIndexOf("]")===h.length-1){const m=h.slice(0,h.lastIndexOf("[")),g=_.map(b=>l(a,m,b));return["bytes32",Te.keccak(It.rawEncode(g.map(([b])=>b),g.map(([,b])=>b)))]}return[h,_]};for(const a of r[e]){const[h,_]=l(a.name,a.type,t[a.name]);o.push(h),c.push(_)}}else for(const l of r[e]){let a=t[l.name];if(a!==void 0)if(l.type==="bytes")o.push("bytes32"),a=Te.keccak(a),c.push(a);else if(l.type==="string")o.push("bytes32"),typeof a=="string"&&(a=Buffer.from(a,"utf8")),a=Te.keccak(a),c.push(a);
6else if(r[l.type]!==void 0)o.push("bytes32"),a=Te.keccak(this.encodeData(l.type,a,r,n)),c.push(a);else{if(l.type.lastIndexOf("]")===l.type.length-1)throw new Error("Arrays currently unimplemented in encodeData");o.push(l.type),c.push(a)}}return It.rawEncode(o,c)},encodeType(e,t){let r="",n=this.findTypeDependencies(e,t).filter(o=>o!==e);n=[e].concat(n.sort());for(const o of n){if(!t[o])throw new Error("No type definition specified: "+o);r+=o+"("+t[o].map(({name:l,type:a})=>a+" "+l).join(",")+")"}return r},findTypeDependencies(e,t,r=[]){if(e=e.match(/^\w*/)[0],r.includes(e)||t[e]===void 0)return r;r.push(e);for(const n of t[e])for(const o of this.findTypeDependencies(n.type,t,r))!r.includes(o)&&r.push(o);return r},hashStruct(e,t,r,n=!0){return Te.keccak(this.encodeData(e,t,r,n))},hashType(e,t){return Te.keccak(this.encodeType(e,t))},sanitizeData(e){const t={};for(const r in Gs.properties)e[r]&&(t[r]=e[r]);return t.types&&(t.types=Object.assign({EIP712Domain:[]},t.types)),t},hash(e,t=!0){const r=this.sanitizeData(e),n=[Buffer.from("1901","hex")];return n.push(this.hashStruct("EIP712Domain",r.domain,r.types,t)),r.primaryType!=="EIP712Domain"&&n.push(this.hashStruct(r.primaryType,r.message,r.types,t)),Te.keccak(Buffer.concat(n))}};var kc={TYPED_MESSAGE_SCHEMA:Gs,TypedDataUtils:Mn,hashForSignTypedDataLegacy:function(e){return Rc(e.data)},hashForSignTypedData_v3:function(e){return Mn.hash(e.data,!1)},hashForSignTypedData_v4:function(e){return Mn.hash(e.data)}};function Rc(e){const t=new Error("Expect argument to be non-empty array");if(typeof e!="object"||!e.length)throw t;const r=e.map(function(c){return c.type==="bytes"?Te.toBuffer(c.value):c.value}),n=e.map(function(c){return c.type}),o=e.map(function(c){if(!c.name)throw t;return c.type+" "+c.name});return It.soliditySHA3(["bytes32","bytes32"],[It.soliditySHA3(new Array(e.length).fill("string"),o),It.soliditySHA3(n,r)])}var $e={};Object.defineProperty($e,"__esModule",{value:!0});
6$e.APP_VERSION_KEY=$e.LOCAL_STORAGE_ADDRESSES_KEY=$e.WALLET_USER_NAME_KEY=void 0;$e.WALLET_USER_NAME_KEY="walletUsername";$e.LOCAL_STORAGE_ADDRESSES_KEY="Addresses";$e.APP_VERSION_KEY="AppVersion";var Dt={};Object.defineProperty(Dt,"__esModule",{value:!0});Dt.RelayEventManager=void 0;const Ac=O;class Mc{constructor(){this._nextRequestId=0,this.callbacks=new Map}makeRequestId(){this._nextRequestId=(this._nextRequestId+1)%2147483647;const t=this._nextRequestId,r=(0,Ac.prepend0x)(t.toString(16));return this.callbacks.get(r)&&this.callbacks.delete(r),t}}Dt.RelayEventManager=Mc;var yr={},br={},wr={};Object.defineProperty(wr,"__esModule",{value:!0});wr.WalletLinkCipher=void 0;const Vt=O;class Lc{constructor(t){this.secret=t}async encrypt(t){const r=this.secret;if(r.length!==64)throw Error("secret must be 256 bits");const n=crypto.getRandomValues(new Uint8Array(12)),o=await crypto.subtle.importKey("raw",(0,Vt.hexStringToUint8Array)(r),{name:"aes-gcm"},!1,["encrypt","decrypt"]),c=new TextEncoder,l=await window.crypto.subtle.encrypt({name:"AES-GCM",iv:n},o,c.encode(t)),a=16,h=l.slice(l.byteLength-a),_=l.slice(0,l.byteLength-a),m=new Uint8Array(h),g=new Uint8Array(_),b=new Uint8Array([...n,...m,...g]);return(0,Vt.uint8ArrayToHex)(b)}async decrypt(t){const r=this.secret;if(r.length!==64)throw Error("secret must be 256 bits");return new Promise((n,o)=>{(async function(){const c=await crypto.subtle.importKey("raw",(0,Vt.hexStringToUint8Array)(r),{name:"aes-gcm"},!1,["encrypt","decrypt"]),l=(0,Vt.hexStringToUint8Array)(t),a=l.slice(0,12),h=l.slice(12,28),_=l.slice(28),m=new Uint8Array([..._,...h]),g={name:"AES-GCM",iv:new Uint8Array(a)};try{const b=await window.crypto.subtle.decrypt(g,c,m),v=new TextDecoder;n(v.decode(b))}catch(b){o(b)}})()})}}wr.WalletLinkCipher=Lc;var mr={};Object.defineProperty(mr,"__esModule",{value:!0});mr.WalletLinkHTTP=void 0;class Bc{constructor(t,r,n){this.linkAPIUrl=t,this.sessionId=r;const o=`${r}:${n}`;this.auth=`Basic ${btoa(o)}`}async markUnseenEventsAsSeen(t){return Promise.all(t.map(r=>fetch(`${this.linkAPIUrl}/events/${r.eventId}/seen`,{method:"POST",headers:{Authorization:this.auth}}))).catch(r=>console.error("Unabled to mark event as failed:",r))}async fetchUnseenEvents(){var t;const r=await fetch(`${this.linkAPIUrl}/events?unseen=true`,{headers:{Authorization:this.auth}});if(r.ok){const{events:n,error:o}=await r.json();if(o)throw new Error(`Check unseen events failed: ${o}`);const c=(t=n==null?void 0:n.filter(l=>l.event==="Web3Response").map(l=>({type:"Event",sessionId:this.sessionId,eventId:l.id,event:l.event,data:l.data})))!==null&&t!==void 0?t:[];return this.markUnseenEventsAsSeen(c),c}throw new Error(`Check unseen events failed: ${r.status}`)}}mr.WalletLinkHTTP=Bc;var bt={};Object.defineProperty(bt,"__esModule",{value:!0});bt.WalletLinkWebSocket=bt.ConnectionState=void 0;var _t;(function(e){e[e.DISCONNECTED=0]="DISCONNECTED",e[e.CONNECTING=1]="CONNECTING",e[e.CONNECTED=2]="CONNECTED"})(_t||(bt.ConnectionState=_t={}));class Tc{setConnectionStateListener(t){this.connectionStateListener=t}setIncomingDataListener(t){this.incomingDataListener=t}constructor(t,r=WebSocket){this.WebSocketClass=r,this.webSocket=null,this.pendingData=[],this.url=t.replace(/^http/,"ws")}async connect(){if(this.webSocket)throw new Error("webSocket object is not null");return new Promise((t,r)=>{var n;let o;try{this.webSocket=o=new this.WebSocketClass(this.url)}catch(c){r(c);return}(n=this.connectionStateListener)===null||n===void 0||n.call(this,_t.CONNECTING),o.onclose=c=>{var l;this.clearWebSocket(),r(new Error(`websocket error ${c.code}: ${c.reason}`)),(l=this.connectionStateListener)===null||l===void 0||l.call(this,_t.DISCONNECTED)},o.onopen=c=>{var l;t(),(l=this.connectionStateListener)===null||l===void 0||l.call(this,_t.CONNECTED),this.pendingData.length>0&&([...this.pendingData].forEach(h=>this.sendData(h)),this.pendingData=[])},o.onmessage=c=>{var l,a;if(c.data==="h")(l=this.incomingDataListener)===null||l===void 0||l.call(this,{type:"Heartbeat"});else try{const h=JSON.parse(c.data);(a=this.incomingDataListener)===null||a===void 0||a.call(this,h)}catch{}}})}disconnect(){var t;const{webSocket:r}=this;if(r){this.clearWebSocket(),(t=this.connectionStateListener)===null||t===void 0||t.call(this,_t.DISCONNECTED),this.connectionStateListener=void 0,this.incomingDataListener=void 0;try{r.close()}catch{}}}sendData(t){const{webSocket:r}=this;if(!r){this.pendingData.push(t),this.connect();return}r.send(t)}clearWebSocket(){const{webSocket:t}=this;t&&(this.webSocket=null,t.onclose=null,t.onerror=null,t.onmessage=null,t.onopen=null)}}bt.WalletLinkWebSocket=Tc;
6Object.defineProperty(br,"__esModule",{value:!0});br.WalletLinkConnection=void 0;const ki=$e,Pc=wr,Nc=mr,Gt=bt,dt=ge,Ri=1e4,Dc=6e4;class Oc{constructor({session:t,linkAPIUrl:r,listener:n,WebSocketClass:o=WebSocket}){this.destroyed=!1,this.lastHeartbeatResponse=0,this.nextReqId=(0,dt.IntNumber)(1),this._connected=!1,this._linked=!1,this.shouldFetchUnseenEventsOnConnect=!1,this.requestResolutions=new Map,this.handleSessionMetadataUpdated=l=>{if(!l)return;new Map([["__destroyed",this.handleDestroyed],["EthereumAddress",this.handleAccountUpdated],["WalletUsername",this.handleWalletUsernameUpdated],["AppVersion",this.handleAppVersionUpdated],["ChainId",h=>l.JsonRpcUrl&&this.handleChainUpdated(h,l.JsonRpcUrl)]]).forEach((h,_)=>{const m=l[_];m!==void 0&&h(m)})},this.handleDestroyed=l=>{var a;l==="1"&&((a=this.listener)===null||a===void 0||a.resetAndReload())},this.handleAccountUpdated=async l=>{var a;{const h=await this.cipher.decrypt(l);(a=this.listener)===null||a===void 0||a.accountUpdated(h)}},this.handleMetadataUpdated=async(l,a)=>{var h;{const _=await this.cipher.decrypt(a);(h=this.listener)===null||h===void 0||h.metadataUpdated(l,_)}},this.handleWalletUsernameUpdated=async l=>{this.handleMetadataUpdated(ki.WALLET_USER_NAME_KEY,l)},this.handleAppVersionUpdated=async l=>{this.handleMetadataUpdated(ki.APP_VERSION_KEY,l)},this.handleChainUpdated=async(l,a)=>{var h;{const _=await this.cipher.decrypt(l),m=await this.cipher.decrypt(a);(h=this.listener)===null||h===void 0||h.chainUpdated(_,m)}},this.session=t,this.cipher=new Pc.WalletLinkCipher(t.secret),this.listener=n;const c=new Gt.WalletLinkWebSocket(`${r}/rpc`,o);c.setConnectionStateListener(async l=>{let a=!1;switch(l){case Gt.ConnectionState.DISCONNECTED:if(!this.destroyed){const h=async()=>{await new Promise(_=>setTimeout(_,5e3)),this.destroyed||c.connect().catch(()=>{h()})};h()}break;case Gt.ConnectionState.CONNECTED:try{await this.authenticate(),this.sendIsLinked(),this.sendGetSessionConfig(),a=!0}catch{}this.updateLastHeartbeat(),setInterval(()=>{this.heartbeat()},Ri),this.shouldFetchUnseenEventsOnConnect&&this.fetchUnseenEventsAPI();break;case Gt.ConnectionState.CONNECTING:break}this.connected!==a&&(this.connected=a)}),c.setIncomingDataListener(l=>{var a;switch(l.type){case"Heartbeat":this.updateLastHeartbeat();return;case"IsLinkedOK":case"Linked":{const h=l.type==="IsLinkedOK"?l.linked:void 0;this.linked=h||l.onlineGuests>0;break}case"GetSessionConfigOK":case"SessionConfigUpdated":{this.handleSessionMetadataUpdated(l.metadata);break}case"Event":{this.handleIncomingEvent(l);break}}l.id!==void 0&&((a=this.requestResolutions.get(l.id))===null||a===void 0||a(l))}),this.ws=c,this.http=new Nc.WalletLinkHTTP(r,t.id,t.key)}connect(){if(this.destroyed)throw new Error("instance is destroyed");this.ws.connect()}destroy(){this.destroyed=!0,this.ws.disconnect(),this.listener=void 0}get isDestroyed(){return this.destroyed}get connected(){return this._connected}set connected(t){var r;this._connected=t,t&&((r=this.onceConnected)===null||r===void 0||r.call(this))}setOnceConnected(t){return new Promise(r=>{this.connected?t().then(r):this.onceConnected=()=>{t().then(r),this.onceConnected=void 0}})}get linked(){return this._linked}set linked(t){var r,n;this._linked=t,t&&((r=this.onceLinked)===null||r===void 0||r.call(this)),(n=this.listener)===null||n===void 0||n.linkedUpdated(t)}setOnceLinked(t){return new Promise(r=>{this.linked?t().then(r):this.onceLinked=()=>{t().then(r),this.onceLinked=void 0}})}async handleIncomingEvent(t){var r;if(!(t.type!=="Event"||t.event!=="Web3Response")){const n=await this.cipher.decrypt(t.data),o=JSON.parse(n);if(o.type!=="WEB3_RESPONSE")return;(r=this.listener)===null||r===void 0||r.handleWeb3ResponseMessage(o)}}async checkUnseenEvents(){if(!this.connected){this.shouldFetchUnseenEventsOnConnect=!0;return}await new Promise(t=>setTimeout(t,250));try{await this.fetchUnseenEventsAPI()}catch(t){console.error("Unable to check for unseen events",t)}}async fetchUnseenEventsAPI(){this.shouldFetchUnseenEventsOnConnect=!1,(await this.http.fetchUnseenEvents()).forEac
6h(r=>this.handleIncomingEvent(r))}async setSessionMetadata(t,r){const n={type:"SetSessionConfig",id:(0,dt.IntNumber)(this.nextReqId++),sessionId:this.session.id,metadata:{[t]:r}};return this.setOnceConnected(async()=>{const o=await this.makeRequest(n);if(o.type==="Fail")throw new Error(o.error||"failed to set session metadata")})}async publishEvent(t,r,n=!1){const o=await this.cipher.encrypt(JSON.stringify(Object.assign(Object.assign({},r),{origin:location.origin,relaySource:"coinbaseWalletExtension"in window&&window.coinbaseWalletExtension?"injected_sdk":"sdk"}))),c={type:"PublishEvent",id:(0,dt.IntNumber)(this.nextReqId++),sessionId:this.session.id,event:t,data:o,callWebhook:n};return this.setOnceLinked(async()=>{const l=await this.makeRequest(c);if(l.type==="Fail")throw new Error(l.error||"failed to publish event");return l.eventId})}sendData(t){this.ws.sendData(JSON.stringify(t))}updateLastHeartbeat(){this.lastHeartbeatResponse=Date.now()}heartbeat(){if(Date.now()-this.lastHeartbeatResponse>Ri*2){this.ws.disconnect();return}try{this.ws.sendData("h")}catch{}}async makeRequest(t,r=Dc){const n=t.id;this.sendData(t);let o;return Promise.race([new Promise((c,l)=>{o=window.setTimeout(()=>{l(new Error(`request ${n} timed out`))},r)}),new Promise(c=>{this.requestResolutions.set(n,l=>{clearTimeout(o),c(l),this.requestResolutions.delete(n)})})])}async authenticate(){const t={type:"HostSession",id:(0,dt.IntNumber)(this.nextReqId++),sessionId:this.session.id,sessionKey:this.session.key},r=await this.makeRequest(t);if(r.type==="Fail")throw new Error(r.error||"failed to authenticate")}sendIsLinked(){const t={type:"IsLinked",id:(0,dt.IntNumber)(this.nextReqId++),sessionId:this.session.id};this.sendData(t)}sendGetSessionConfig(){const t={type:"GetSessionConfig",id:(0,dt.IntNumber)(this.nextReqId++),sessionId:this.session.id};this.sendData(t)}}br.WalletLinkConnection=Oc;var vr={},Zs={exports:{}},Ys=rt.Buffer;function Er(e,t){this._block=Ys.alloc(e),this._finalSize=t,this._blockSize=e,this._len=0}Er.prototype.update=function(e,t){typeof e=="string"&&(t=t||"utf8",e=Ys.from(e,t));for(var r=this._block,n=this._blockSize,o=e.length,c=this._len,l=0;l<o;){for(var a=c%n,h=Math.min(o-l,n-a),_=0;_<h;_++)r[a+_]=e[l+_];c+=h,l+=h,c%n===0&&this._update(r)}return this._len+=o,this};Er.prototype.digest=function(e){var t=this._len%this._blockSize;this._block[t]=128,this._block.fill(0,t+1),t>=this._finalSize&&(this._update(this._block),this._block.fill(0));var r=this._len*8;if(r<=4294967295)this._block.writeUInt32BE(r,this._blockSize-4);else{var n=(r&4294967295)>>>0,o=(r-n)/4294967296;this._block.writeUInt32BE(o,this._blockSize-8),this._block.writeUInt32BE(n,this._blockSize-4)}this._update(this._block);var c=this._hash();return e?c.toString(e):c};Er.prototype._update=function(){throw new Error("_update must be implemented by subclass")};var xt=Er,Uc=Pe,Js=xt,Fc=rt.Buffer,jc=[1518500249,1859775393,-1894007588,-899497514],Wc=new Array(80);function Ot(){this.init(),this._w=Wc,Js.call(this,64,56)}Uc(Ot,Js);Ot.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this};function $c(e){return e<<5|e>>>27}function Hc(e){return e<<30|e>>>2}function qc(e,t,r,n){return e===0?t&r|~t&n:e===2?t&r|t&n|r&n:t^r^n}Ot.prototype._update=function(e){for(var t=this._w,r=this._a|0,n=this._b|0,o=this._c|0,c=this._d|0,l=this._e|0,a=0;a<16;++a)t[a]=e.readInt32BE(a*4);for(;a<80;++a)t[a]=t[a-3]^t[a-8]^t[a-14]^t[a-16];for(var h=0;h<80;++h){var _=~~(h/20),m=$c(r)+qc(_,n,o,c)+l+t[h]+jc[_]|0;l=c,c=o,o=Hc(n),n=r,r=m}this._a=r+this._a|0,this._b=n+this._b|0,this._c=o+this._c|0,this._d=c+this._d|0,this._e=l+this._e|0};Ot.prototype._hash=function(){var e=Fc.allocUnsafe(20);return e.writeInt32BE(this._a|0,0),e.writeInt32BE(this._b|0,4),e.writeInt32BE(this._c|0,8),e.writeInt32BE(this._d|0,12),e.writeInt32BE(this._e|0,16),e};var Kc=Ot,zc=Pe,Qs=xt,Vc=rt.Buffer,Gc=[1518500249,1859775393,-1894007588,-899497514],Zc=new Array(80);function Ut(){this.init(),this._w=Zc,Qs.call(this,64,56)}zc(Ut,Qs);Ut.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this};function Yc(e){return e<<1|e>>>31}
6function Jc(e){return e<<5|e>>>27}function Qc(e){return e<<30|e>>>2}function Xc(e,t,r,n){return e===0?t&r|~t&n:e===2?t&r|t&n|r&n:t^r^n}Ut.prototype._update=function(e){for(var t=this._w,r=this._a|0,n=this._b|0,o=this._c|0,c=this._d|0,l=this._e|0,a=0;a<16;++a)t[a]=e.readInt32BE(a*4);for(;a<80;++a)t[a]=Yc(t[a-3]^t[a-8]^t[a-14]^t[a-16]);for(var h=0;h<80;++h){var _=~~(h/20),m=Jc(r)+Xc(_,n,o,c)+l+t[h]+Gc[_]|0;l=c,c=o,o=Qc(n),n=r,r=m}this._a=r+this._a|0,this._b=n+this._b|0,this._c=o+this._c|0,this._d=c+this._d|0,this._e=l+this._e|0};Ut.prototype._hash=function(){var e=Vc.allocUnsafe(20);return e.writeInt32BE(this._a|0,0),e.writeInt32BE(this._b|0,4),e.writeInt32BE(this._c|0,8),e.writeInt32BE(this._d|0,12),e.writeInt32BE(this._e|0,16),e};var el=Ut,tl=Pe,Xs=xt,rl=rt.Buffer,nl=[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],il=new Array(64);function Ft(){this.init(),this._w=il,Xs.call(this,64,56)}tl(Ft,Xs);Ft.prototype.init=function(){return this._a=1779033703,this._b=3144134277,this._c=1013904242,this._d=2773480762,this._e=1359893119,this._f=2600822924,this._g=528734635,this._h=1541459225,this};function sl(e,t,r){return r^e&(t^r)}function ol(e,t,r){return e&t|r&(e|t)}function al(e){return(e>>>2|e<<30)^(e>>>13|e<<19)^(e>>>22|e<<10)}function cl(e){return(e>>>6|e<<26)^(e>>>11|e<<21)^(e>>>25|e<<7)}function ll(e){return(e>>>7|e<<25)^(e>>>18|e<<14)^e>>>3}function ul(e){return(e>>>17|e<<15)^(e>>>19|e<<13)^e>>>10}Ft.prototype._update=function(e){for(var t=this._w,r=this._a|0,n=this._b|0,o=this._c|0,c=this._d|0,l=this._e|0,a=this._f|0,h=this._g|0,_=this._h|0,m=0;m<16;++m)t[m]=e.readInt32BE(m*4);for(;m<64;++m)t[m]=ul(t[m-2])+t[m-7]+ll(t[m-15])+t[m-16]|0;for(var g=0;g<64;++g){var b=_+cl(l)+sl(l,a,h)+nl[g]+t[g]|0,v=al(r)+ol(r,n,o)|0;_=h,h=a,a=l,l=c+b|0,c=o,o=n,n=r,r=b+v|0}this._a=r+this._a|0,this._b=n+this._b|0,this._c=o+this._c|0,this._d=c+this._d|0,this._e=l+this._e|0,this._f=a+this._f|0,this._g=h+this._g|0,this._h=_+this._h|0};Ft.prototype._hash=function(){var e=rl.allocUnsafe(32);return e.writeInt32BE(this._a,0),e.writeInt32BE(this._b,4),e.writeInt32BE(this._c,8),e.writeInt32BE(this._d,12),e.writeInt32BE(this._e,16),e.writeInt32BE(this._f,20),e.writeInt32BE(this._g,24),e.writeInt32BE(this._h,28),e};var eo=Ft,hl=Pe,dl=eo,fl=xt,pl=rt.Buffer,_l=new Array(64);function Sr(){this.init(),this._w=_l,fl.call(this,64,56)}hl(Sr,dl);Sr.prototype.init=function(){return this._a=3238371032,this._b=914150663,this._c=812702999,this._d=4144912697,this._e=4290775857,this._f=1750603025,this._g=1694076839,this._h=3204075428,this};Sr.prototype._hash=function(){var e=pl.allocUnsafe(28);return e.writeInt32BE(this._a,0),e.writeInt32BE(this._b,4),e.writeInt32BE(this._c,8),e.writeInt32BE(this._d,12),e.writeInt32BE(this._e,16),e.writeInt32BE(this._f,20),e.writeInt32BE(this._g,24),e};var gl=Sr,yl=Pe,to=xt,bl=rt.Buffer,Ai=[1116352408,3609767458,1899447441,602891725,3049323471,3964484399,3921009573,2173295548,961987163,4081628472,1508970993,3053834265,2453635748,2937671579,2870763221,3664609560,3624381080,2734883394,310598401,1164996542,607225278,1323610764,1426881987,3590304994,1925078388,4068182383,2162078206,991336113,2614888103,633803317,3248222580,3479774868,3835390401,2666613458,4022224774,944711139,264347078,2341262773,604807628,2007800933,770255983,1495990901,1249150122,1856431235,1555081692,3175218132,1996064986,2198950837,2554220882,3999719339,2821834349,766784016,2952996808,2566594879,3210313671,3203337956,3336571891,1034457026,3584528711,2466948901,113926993,3758326383,338241895,168717936,666307205,1188179964,773529912,1546045734,1294757372,1522805485,1396182291,2643833823,1695183700,2343527390,1986661051,1014477480,2177026350,1206759142,2456956037,344077627,2730485921,1290863460,2820302411,3158454273,3259730800,3505952657,3345764771,106217008,3516065817,3606008344,3600352804,1432725776,4094571909,1467031594,275423344,851169720,430227734,3100823752,506948616,1363258195,659060556,3750685593,883997877,3785050280,958139571,3318307427,
61322822218,3812723403,1537002063,2003034995,1747873779,3602036899,1955562222,1575990012,2024104815,1125592928,2227730452,2716904306,2361852424,442776044,2428436474,593698344,2756734187,3733110249,3204031479,2999351573,3329325298,3815920427,3391569614,3928383900,3515267271,566280711,3940187606,3454069534,4118630271,4000239992,116418474,1914138554,174292421,2731055270,289380356,3203993006,460393269,320620315,685471733,587496836,852142971,1086792851,1017036298,365543100,1126000580,2618297676,1288033470,3409855158,1501505948,4234509866,1607167915,987167468,1816402316,1246189591],wl=new Array(160);function jt(){this.init(),this._w=wl,to.call(this,128,112)}yl(jt,to);jt.prototype.init=function(){return this._ah=1779033703,this._bh=3144134277,this._ch=1013904242,this._dh=2773480762,this._eh=1359893119,this._fh=2600822924,this._gh=528734635,this._hh=1541459225,this._al=4089235720,this._bl=2227873595,this._cl=4271175723,this._dl=1595750129,this._el=2917565137,this._fl=725511199,this._gl=4215389547,this._hl=327033209,this};function Mi(e,t,r){return r^e&(t^r)}function Li(e,t,r){return e&t|r&(e|t)}function Bi(e,t){return(e>>>28|t<<4)^(t>>>2|e<<30)^(t>>>7|e<<25)}function Ti(e,t){return(e>>>14|t<<18)^(e>>>18|t<<14)^(t>>>9|e<<23)}function ml(e,t){return(e>>>1|t<<31)^(e>>>8|t<<24)^e>>>7}function vl(e,t){return(e>>>1|t<<31)^(e>>>8|t<<24)^(e>>>7|t<<25)}function El(e,t){return(e>>>19|t<<13)^(t>>>29|e<<3)^e>>>6}function Sl(e,t){return(e>>>19|t<<13)^(t>>>29|e<<3)^(e>>>6|t<<26)}function ae(e,t){return e>>>0<t>>>0?1:0}jt.prototype._update=function(e){for(var t=this._w,r=this._ah|0,n=this._bh|0,o=this._ch|0,c=this._dh|0,l=this._eh|0,a=this._fh|0,h=this._gh|0,_=this._hh|0,m=this._al|0,g=this._bl|0,b=this._cl|0,v=this._dl|0,I=this._el|0,T=this._fl|0,k=this._gl|0,y=this._hl|0,x=0;x<32;x+=2)t[x]=e.readInt32BE(x*4),t[x+1]=e.readInt32BE(x*4+4);for(;x<160;x+=2){var R=t[x-30],L=t[x-15*2+1],P=ml(R,L),U=vl(L,R);R=t[x-2*2],L=t[x-2*2+1];var z=El(R,L),j=Sl(L,R),F=t[x-7*2],Z=t[x-7*2+1],ue=t[x-16*2],Re=t[x-16*2+1],ne=U+Z|0,he=P+F+ae(ne,U)|0;ne=ne+j|0,he=he+z+ae(ne,j)|0,ne=ne+Re|0,he=he+ue+ae(ne,Re)|0,t[x]=he,t[x+1]=ne}for(var de=0;de<160;de+=2){he=t[de],ne=t[de+1];var Ne=Li(r,n,o),we=Li(m,g,b),Ae=Bi(r,m),me=Bi(m,r),Me=Ti(l,I),Y=Ti(I,l),re=Ai[de],pe=Ai[de+1],Le=Mi(l,a,h),Ee=Mi(I,T,k),S=y+Y|0,E=_+Me+ae(S,y)|0;S=S+Ee|0,E=E+Le+ae(S,Ee)|0,S=S+pe|0,E=E+re+ae(S,pe)|0,S=S+ne|0,E=E+he+ae(S,ne)|0;var B=me+we|0,D=Ae+Ne+ae(B,me)|0;_=h,y=k,h=a,k=T,a=l,T=I,I=v+S|0,l=c+E+ae(I,v)|0,c=o,v=b,o=n,b=g,n=r,g=m,m=S+B|0,r=E+D+ae(m,S)|0}this._al=this._al+m|0,this._bl=this._bl+g|0,this._cl=this._cl+b|0,this._dl=this._dl+v|0,this._el=this._el+I|0,this._fl=this._fl+T|0,this._gl=this._gl+k|0,this._hl=this._hl+y|0,this._ah=this._ah+r+ae(this._al,m)|0,this._bh=this._bh+n+ae(this._bl,g)|0,this._ch=this._ch+o+ae(this._cl,b)|0,this._dh=this._dh+c+ae(this._dl,v)|0,this._eh=this._eh+l+ae(this._el,I)|0,this._fh=this._fh+a+ae(this._fl,T)|0,this._gh=this._gh+h+ae(this._gl,k)|0,this._hh=this._hh+_+ae(this._hl,y)|0};jt.prototype._hash=function(){var e=bl.allocUnsafe(64);function t(r,n,o){e.writeInt32BE(r,o),e.writeInt32BE(n,o+4)}return t(this._ah,this._al,0),t(this._bh,this._bl,8),t(this._ch,this._cl,16),t(this._dh,this._dl,24),t(this._eh,this._el,32),t(this._fh,this._fl,40),t(this._gh,this._gl,48),t(this._hh,this._hl,56),e};var ro=jt,xl=Pe,Cl=ro,Il=xt,kl=rt.Buffer,Rl=new Array(160);function xr(){this.init(),this._w=Rl,Il.call(this,128,112)}xl(xr,Cl);xr.prototype.init=function(){return this._ah=3418070365,this._bh=1654270250,this._ch=2438529370,this._dh=355462360,this._eh=1731405415,this._fh=2394180231,this._gh=3675008525,this._hh=1203062813,this._al=3238371032,this._bl=914150663,this._cl=812702999,this._dl=4144912697,this._el=4290775857,this._fl=1750603025,this._gl=1694076839,this._hl=3204075428,this};xr.prototype._hash=function(){var e=kl.allocUnsafe(48);function t(r,n,o){e.writeInt32BE(r,o),e.writeInt32BE(n,o+4)}return t(this._ah,this._al,0),t(this._bh,this._bl,8),t(this._ch,this._cl,16),t(this._dh,this._dl,24),t(this._eh,this._el,32),t(this._fh,this._fl,40),e};var Al=xr,ct=Zs.exports=function(t){t=t.toLowerCase();var r=ct[t];if(!r)throw new Error(t+" is not supported (we accept pull requests)");return new r};ct.sha=Kc;ct.sha1=el;ct.sha224=gl;ct.sha256=eo;ct.sha384=Al;ct.sha512=ro;var Ml=Zs.exports;
6Object.defineProperty(vr,"__esModule",{value:!0});vr.WalletLinkSession=void 0;const Ll=Ml,Pi=O,Ni="session:id",Di="session:secret",Oi="session:linked";class Yn{constructor(t,r,n,o){this._storage=t,this._id=r||(0,Pi.randomBytesHex)(16),this._secret=n||(0,Pi.randomBytesHex)(32),this._key=new Ll.sha256().update(`${this._id}, ${this._secret} WalletLink`).digest("hex"),this._linked=!!o}static load(t){const r=t.getItem(Ni),n=t.getItem(Oi),o=t.getItem(Di);return r&&o?new Yn(t,r,o,n==="1"):null}get id(){return this._id}get secret(){return this._secret}get key(){return this._key}get linked(){return this._linked}set linked(t){this._linked=t,this.persistLinked()}save(){return this._storage.setItem(Ni,this._id),this._storage.setItem(Di,this._secret),this.persistLinked(),this}persistLinked(){this._storage.setItem(Oi,this._linked?"1":"0")}}vr.WalletLinkSession=Yn;var ve={};Object.defineProperty(ve,"__esModule",{value:!0});ve.isDarkMode=ve.isMobileWeb=ve.getLocation=ve.createQrUrl=void 0;function Bl(e,t,r,n,o,c){const l=n?"parent-id":"id",a=new URLSearchParams({[l]:e,secret:t,server:r,v:o,chainId:c.toString()}).toString();return`${r}/#/link?${a}`}ve.createQrUrl=Bl;function Tl(){try{return window.frameElement!==null}catch{return!1}}function Pl(){try{return Tl()&&window.top?window.top.location:window.location}catch{return window.location}}ve.getLocation=Pl;function Nl(){var e;return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test((e=window==null?void 0:window.navigator)===null||e===void 0?void 0:e.userAgent)}ve.isMobileWeb=Nl;function Dl(){var e,t;return(t=(e=window==null?void 0:window.matchMedia)===null||e===void 0?void 0:e.call(window,"(prefers-color-scheme: dark)").matches)!==null&&t!==void 0?t:!1}ve.isDarkMode=Dl;var Cr={},Wt={},Jn={};Object.defineProperty(Jn,"__esModule",{value:!0});Jn.default='@namespace svg "http://www.w3.org/2000/svg";.-cbwsdk-css-reset,.-cbwsdk-css-reset *{animation:none;animation-delay:0;animation-direction:normal;animation-duration:0;animation-fill-mode:none;animation-iteration-count:1;animation-name:none;animation-play-state:running;animation-timing-function:ease;backface-visibility:visible;background:0;background-attachment:scroll;background-clip:border-box;background-color:rgba(0,0,0,0);background-image:none;background-origin:padding-box;background-position:0 0;background-position-x:0;background-position-y:0;background-repeat:repeat;background-size:auto auto;border:0;border-style:none;border-width:medium;border-color:inherit;border-bottom:0;border-bottom-color:inherit;border-bottom-left-radius:0;border-bottom-right-radius:0;border-bottom-style:none;border-bottom-width:medium;border-collapse:separate;border-image:none;border-left:0;border-left-color:inherit;border-left-style:none;border-left-width:medium;border-radius:0;border-right:0;border-right-color:inherit;border-right-style:none;border-right-width:medium;border-spacing:0;border-top:0;border-top-color:inherit;border-top-left-radius:0;border-top-right-radius:0;border-top-style:none;border-top-width:medium;box-shadow:none;box-sizing:border-box;caption-side:top;clear:none;clip:auto;color:inherit;columns:auto;column-count:auto;column-fill:balance;column-gap:normal;column-rule:medium none currentColor;column-rule-color:currentColor;column-rule-style:none;column-rule-width:none;column-span:1;column-width:auto;counter-increment:none;counter-reset:none;direction:ltr;empty-cells:show;float:none;font:normal;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Helvetica Neue",Arial,sans-serif;font-size:medium;font-style:normal;font-variant:normal;font-weight:normal;height:auto;hyphens:none;letter-spacing:normal;line-height:normal;list-style:none;list-style-image:none;list-style-position:outside;list-style-type:disc;margin:0;margin-bottom:0;margin-left:0;margin-right:0;margin-top:0;opacity:1;orphans:0;outline:0;outline-color:invert;outline-style:none;outline-width:medium;overflow:visible;overflow-x:visible;overflow-y:visible;padding:0;padding-bottom:0;padding-left:0;padding-right:0;padding-top:0;page-break-after:auto;page-break-before:auto;page-break-inside:auto;perspective:none;perspective-origin:50% 50%;pointer-events:auto;position:static;quotes:"\\201C" "\\201D" "\\2018" "\\2019";tab-size:8;table-layout:auto;text-align:inherit;text-align-last:auto;text-decoration:none;text-decoration-color:inherit;text-decoration-line:none;text-decoration-style:solid;text-indent:0;text-shadow:none;text-transform:none;transform:none;transform-style:flat;transition:none;transition-delay:0s;transition-duration:0s;transition-property:none;transition-timing-function:ease;unicode-bidi:normal;vertical-align:baseline;visibility:visible;white-space:normal;widows:0;word-spacing:normal;z-index:auto}.-cbwsdk-css-reset strong{font-weight:bold}.-cbwsdk-css-reset *{box-sizing:border-box;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","Helvetica Neue",Arial,sans-serif;line-height:1}.-cbwsdk-css-reset [class*=container]{margin:0;padding:0}.-cbwsdk-css-reset style{display:none}';
6var Ol=le&&le.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Wt,"__esModule",{value:!0});Wt.injectCssReset=void 0;const Ul=Ol(Jn);function Fl(){const e=document.createElement("style");e.type="text/css",e.appendChild(document.createTextNode(Ul.default)),document.documentElement.appendChild(e)}Wt.injectCssReset=Fl;var Qn={};function no(e){var t,r,n="";if(typeof e=="string"||typeof e=="number")n+=e;else if(typeof e=="object")if(Array.isArray(e))for(t=0;t<e.length;t++)e[t]&&(r=no(e[t]))&&(n&&(n+=" "),n+=r);else for(t in e)e[t]&&(n&&(n+=" "),n+=t);return n}function Ui(){for(var e,t,r=0,n="";r<arguments.length;)(e=arguments[r++])&&(t=no(e))&&(n&&(n+=" "),n+=t);return n}const jl=Object.freeze(Object.defineProperty({__proto__:null,clsx:Ui,default:Ui},Symbol.toStringTag,{value:"Module"})),io=qn(jl);var $t,te,so,oo,it,Fi,ao,Un,Xn,Fn,jn,co,Lt={},lo=[],Wl=/acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|itera/i,Ir=Array.isArray;function Ye(e,t){for(var r in t)e[r]=t[r];return e}function uo(e){e&&e.parentNode&&e.parentNode.removeChild(e)}function Wn(e,t,r){var n,o,c,l={};for(c in t)c=="key"?n=t[c]:c=="ref"?o=t[c]:l[c]=t[c];if(arguments.length>2&&(l.children=arguments.length>3?$t.call(arguments,2):r),typeof e=="function"&&e.defaultProps!=null)for(c in e.defaultProps)l[c]===void 0&&(l[c]=e.defaultProps[c]);return kt(e,l,n,o,null)}function kt(e,t,r,n,o){var c={type:e,props:t,key:r,ref:n,__k:null,__:null,__b:0,__e:null,__d:void 0,__c:null,constructor:void 0,__v:o??++so,__i:-1,__u:0};return o==null&&te.vnode!=null&&te.vnode(c),c}function $l(){return{current:null}}function Ht(e){return e.children}function Rt(e,t){this.props=e,this.context=t}function wt(e,t){if(t==null)return e.__?wt(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"?wt(e):null}function ho(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 ho(e)}}function $n(e){(!e.__d&&(e.__d=!0)&&it.push(e)&&!nr.__r++||Fi!==te.debounceRendering)&&((Fi=te.debounceRendering)||ao)(nr)}function nr(){var e,t,r,n,o,c,l,a;for(it.sort(Un);e=it.shift();)e.__d&&(t=it.length,n=void 0,c=(o=(r=e).__v).__e,l=[],a=[],r.__P&&((n=Ye({},o)).__v=o.__v+1,te.vnode&&te.vnode(n),ei(r.__P,n,o,r.__n,r.__P.namespaceURI,32&o.__u?[c]:null,l,c??wt(o),!!(32&o.__u),a),n.__v=o.__v,n.__.__k[n.__i]=n,go(l,n,a),n.__e!=c&&ho(n)),it.length>t&&it.sort(Un));nr.__r=0}function fo(e,t,r,n,o,c,l,a,h,_,m){var g,b,v,I,T,k=n&&n.__k||lo,y=t.length;for(r.__d=h,Hl(r,t,k),h=r.__d,g=0;g<y;g++)(v=r.__k[g])!=null&&(b=v.__i===-1?Lt:k[v.__i]||Lt,v.__i=g,ei(e,v,b,o,c,l,a,h,_,m),I=v.__e,v.ref&&b.ref!=v.ref&&(b.ref&&ti(b.ref,null,v),m.push(v.ref,v.__c||I,v)),T==null&&I!=null&&(T=I),65536&v.__u||b.__k===v.__k?h=po(v,h,e):typeof v.type=="function"&&v.__d!==void 0?h=v.__d:I&&(h=I.nextSibling),v.__d=void 0,v.__u&=-196609);r.__d=h,r.__e=T}function Hl(e,t,r){var n,o,c,l,a,h=t.length,_=r.length,m=_,g=0;for(e.__k=[],n=0;n<h;n++)(o=t[n])!=null&&typeof o!="boolean"&&typeof o!="function"?(l=n+g,(o=e.__k[n]=typeof o=="string"||typeof o=="number"||typeof o=="bigint"||o.constructor==String?kt(null,o,null,null,null):Ir(o)?kt(Ht,{children:o},null,null,null):o.constructor===void 0&&o.__b>0?kt(o.type,o.props,o.key,o.ref?o.ref:null,o.__v):o).__=e,o.__b=e.__b+1,c=null,(a=o.__i=ql(o,r,l,m))!==-1&&(m--,(c=r[a])&&(c.__u|=131072)),c==null||c.__v===null?(a==-1&&g--,typeof o.type!="function"&&(o.__u|=65536)):a!==l&&(a==l-1?g--:a==l+1?g++:(a>l?g--:g++,o.__u|=65536))):o=e.__k[n]=null;if(m)for(n=0;n<_;n++)(c=r[n])!=null&&!(131072&c.__u)&&(c.__e==e.__d&&(e.__d=wt(c)),yo(c,c))}function po(e,t,r){var n,o;if(typeof e.type=="function"){for(n=e.__k,o=0;n&&o<n.length;o++)n[o]&&(n[o].__=e,t=po(n[o],t,r));return t}e.__e!=t&&(t&&e.type&&!r.contains(t)&&(t=wt(e)),r.insertBefore(e.__e,t||null),t=e.__e);do t=t&&t.nextSibling;while(t!=null&&t.nodeType===8);return t}function _o(e,t){return t=t||[],e==null||typeof e=="boolean"||(Ir(e)?e.some(function(r){_o(r,t)}):t.push(e)),t}function ql(e,t,r,n){var o=e.key,c=e.type,l=r-1,a=r+1,h=t[r];if(h===null||h&&o==h.key&&c===h.type&&!(131072&h.__u))return r;if(n>(h!=null&&!(131072&h.__u)?1:0))for(;l>=0||a<t.length;){if(l>=0){if((h=t[l])&&!(131072&h.__u)&&o==h.key&&c===h.type)return l;l--}if(a<t.length){if((h=t[a])&&!(131072&h.__u)&&o==h.key&&c===h.type)return a;a++}}return-1}function ji(e,t,r){t[0]==="-"?e.setProperty(t,r??""):e[t]=r==null?"":typeof r!="number"||Wl.test(t)?r:r+"px"}function Zt(e,t,r,n,o){var c;e:if(t==="style")if(typeof r=="string")e.style.cssText=r;else{if(typeof n=="string"&&(e.style.cssText=n=""),n)for(t in n)r&&t in r||ji(e.style,t,"");if(r)for(t in r)n&&r[t]===n[t]||ji(e.style,t,r[t])}else if(t[0]==="o"&&t[1]==="n")c=t!==(t=t.replace(/(PointerCapture)$|Capture$/i,"$1")),t=t.toLowerCase()in e||t==="onFocusOut"||t==="onFocusIn"?t.toLowerCase().slice(2):t.slice(2),e.l||(e.l={}),e.l[t+c]=r,r?n?r.u=n.u:(r.u=Xn,e.addEventListener(t,c?jn:Fn,c)):e.removeEventListener(t,c?jn:Fn,c);else{if(o=="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 Wi(e){return function(t){if(this.l){var r=this.l[t.type+e];if(t.t==null)t.t=Xn++;else if(t.t<r.u)return;return r(te.event?te.event(t):t)}}}function ei(e,t,r,n,o,c,l,a,h,_){var m,g,b,v,I,T,k,y,x,R,L,P,U,z,j,F,Z=t.type;if(t.constructor!==void 0)return null;128&r.__u&&(h=!!(32&r.__u),c=[a=t.__e=r.__e]),(m=te.__b)&&m(t);e:if(typeof Z=="function")try{if(y=t.props,x="prototype"in Z&&Z.prototype.render,R=(m=Z.contextType)&&n[m.__c],L=m?R?R.props.value:m.__:n,r.__c?k=(g=t.__c=r.__c).__=g.__E:(x?t.__c=g=new Z(y,L):(t.__c=g=new Rt(y,L),g.constructor=Z,g.render=zl),R&&R.sub(g),g.props=y,g.state||(g.state={}),g.context=L,g.__n=n,b=g.__d=!0,g.__h=[],g._sb=[]),x&&g.__s==null&&(g.__s=g.state),x&&Z.getDerivedStateFromProps!=null&&(g.__s==g.state&&(g.__s=Ye({},g.__s)),Ye(g.__s,Z.getDerivedStateFromProps(y,g.__s))),v=g.props,I=g.state,g.__v=t,b)x&&Z.getDerivedStateFromProps==null&&g.componentWillMount!=null&&g.componentWillMount(),x&&g.componentDidMount!=null&&g.__h.push(g.componentDidMount);else{if(x&&Z.getDerivedStateFromProps==null&&y!==v&&g.componentWillReceiveProps!=null&&g.componentWillReceiveProps(y,L),!g.__e&&(g.shouldComponentUpdate!=null&&g.shouldComponentUpdate(y,g.__s,L)===!1||t.__v===r.__v)){for(t.__v!==r.__v&&(g.props=y,g.state=g.__s,g.__d=!1),t.__e=r.__e,t.__k=r.__k,t.__k.some(function(ue){ue&&(ue.__=t)}),P=0;P<g._sb.length;P++)g.__h.push(g._sb[P]);g._sb=[],g.__h.length&&l.push(g);break e}g.componentWillUpdate!=null&&g.componentWillUpdate(y,g.__s,L),x&&g.componentDidUpdate!=null&&g.__h.push(function(){g.componentDidUpdate(v,I,T)})}if(g.context=L,g.props=y,g.__P=e,g.__e=!1,U=te.__r,z=0,x){for(g.state=g.__s,g.__d=!1,U&&U(t),m=g.render(g.props,g.state,g.context),j=0;j<g._sb.length;j++)g.__h.push(g._sb[j]);g._sb=[]}else do g.__d=!1,U&&U(t),m=g.render(g.props,g.state,g.context),g.state=g.__s;while(g.__d&&++z<25);g.state=g.__s,g.getChildContext!=null&&(n=Ye(Ye({},n),g.getChildContext())),x&&!b&&g.getSnapshotBeforeUpdate!=null&&(T=g.getSnapshotBeforeUpdate(v,I)),fo(e,Ir(F=m!=null&&m.type===
6Ht&&m.key==null?m.props.children:m)?F:[F],t,r,n,o,c,l,a,h,_),g.base=t.__e,t.__u&=-161,g.__h.length&&l.push(g),k&&(g.__E=g.__=null)}catch(ue){if(t.__v=null,h||c!=null){for(t.__u|=h?160:32;a&&a.nodeType===8&&a.nextSibling;)a=a.nextSibling;c[c.indexOf(a)]=null,t.__e=a}else t.__e=r.__e,t.__k=r.__k;te.__e(ue,t,r)}else c==null&&t.__v===r.__v?(t.__k=r.__k,t.__e=r.__e):t.__e=Kl(r.__e,t,r,n,o,c,l,h,_);(m=te.diffed)&&m(t)}function go(e,t,r){t.__d=void 0;for(var n=0;n<r.length;n++)ti(r[n],r[++n],r[++n]);te.__c&&te.__c(t,e),e.some(function(o){try{e=o.__h,o.__h=[],e.some(function(c){c.call(o)})}catch(c){te.__e(c,o.__v)}})}function Kl(e,t,r,n,o,c,l,a,h){var _,m,g,b,v,I,T,k=r.props,y=t.props,x=t.type;if(x==="svg"?o="http://www.w3.org/2000/svg":x==="math"?o="http://www.w3.org/1998/Math/MathML":o||(o="http://www.w3.org/1999/xhtml"),c!=null){for(_=0;_<c.length;_++)if((v=c[_])&&"setAttribute"in v==!!x&&(x?v.localName===x:v.nodeType===3)){e=v,c[_]=null;break}}if(e==null){if(x===null)return document.createTextNode(y);e=document.createElementNS(o,x,y.is&&y),a&&(te.__m&&te.__m(t,c),a=!1),c=null}if(x===null)k===y||a&&e.data===y||(e.data=y);else{if(c=c&&$t.call(e.childNodes),k=r.props||Lt,!a&&c!=null)for(k={},_=0;_<e.attributes.length;_++)k[(v=e.attributes[_]).name]=v.value;for(_ in k)if(v=k[_],_!="children"){if(_=="dangerouslySetInnerHTML")g=v;else if(!(_ in y)){if(_=="value"&&"defaultValue"in y||_=="checked"&&"defaultChecked"in y)continue;Zt(e,_,null,v,o)}}for(_ in y)v=y[_],_=="children"?b=v:_=="dangerouslySetInnerHTML"?m=v:_=="value"?I=v:_=="checked"?T=v:a&&typeof v!="function"||k[_]===v||Zt(e,_,v,k[_],o);if(m)a||g&&(m.__html===g.__html||m.__html===e.innerHTML)||(e.innerHTML=m.__html),t.__k=[];else if(g&&(e.innerHTML=""),fo(e,Ir(b)?b:[b],t,r,n,x==="foreignObject"?"http://www.w3.org/1999/xhtml":o,c,l,c?c[0]:r.__k&&wt(r,0),a,h),c!=null)for(_=c.length;_--;)uo(c[_]);a||(_="value",x==="progress"&&I==null?e.removeAttribute("value"):I!==void 0&&(I!==e[_]||x==="progress"&&!I||x==="option"&&I!==k[_])&&Zt(e,_,I,k[_],o),_="checked",T!==void 0&&T!==e[_]&&Zt(e,_,T,k[_],o))}return e}function ti(e,t,r){try{if(typeof e=="function"){var n=typeof e.__u=="function";n&&e.__u(),n&&t==null||(e.__u=e(t))}else e.current=t}catch(o){te.__e(o,r)}}function yo(e,t,r){var n,o;if(te.unmount&&te.unmount(e),(n=e.ref)&&(n.current&&n.current!==e.__e||ti(n,null,t)),(n=e.__c)!=null){if(n.componentWillUnmount)try{n.componentWillUnmount()}catch(c){te.__e(c,t)}n.base=n.__P=null}if(n=e.__k)for(o=0;o<n.length;o++)n[o]&&yo(n[o],t,r||typeof e.type!="function");r||uo(e.__e),e.__c=e.__=e.__e=e.__d=void 0}function zl(e,t,r){return this.constructor(e,r)}function bo(e,t,r){var n,o,c,l;te.__&&te.__(e,t),o=(n=typeof r=="function")?null:r&&r.__k||t.__k,c=[],l=[],ei(t,e=(!n&&r||t).__k=Wn(Ht,null,[e]),o||Lt,Lt,t.namespaceURI,!n&&r?[r]:o?null:t.firstChild?$t.call(t.childNodes):null,c,!n&&r?r:o?o.__e:t.firstChild,n,l),go(c,e,l)}function wo(e,t){bo(e,t,wo)}function Vl(e,t,r){var n,o,c,l,a=Ye({},e.props);for(c in e.type&&e.type.defaultProps&&(l=e.type.defaultProps),t)c=="key"?n=t[c]:c=="ref"?o=t[c]:a[c]=t[c]===void 0&&l!==void 0?l[c]:t[c];return arguments.length>2&&(a.children=arguments.length>3?$t.call(arguments,2):r),kt(e.type,a,n||e.key,o||e.ref,null)}function Gl(e,t){var r={__c:t="__cC"+co++,__:e,Consumer:function(n,o){return n.children(o)},Provider:function(n){var o,c;return this.getChildContext||(o=[],(c={})[t]=this,this.getChildContext=function(){return c},this.componentWillUnmount=function(){o=null},this.shouldComponentUpdate=function(l){this.props.value!==l.value&&o.some(function(a){a.__e=!0,$n(a)})},this.sub=function(l){o.push(l);var a=l.componentWillUnmount;l.componentWillUnmount=function(){o&&o.splice(o.indexOf(l),1),a&&a.call(l)}}),n.children}};return r.Provider.__=r.Consumer.contextType=r}$t=lo.slice,te={__e:function(e,t,r,n){for(var o,c,l;t=t.__;)if((o=t.__c)&&!o.__)try{if((c=o.constructor)&&c.getDerivedStateFromError!=null&&(o.setState(c.getDerivedStateFromError(e)),l=o.__d),o.componentDidCatch!=null&&(o.componentDidCatch(e,n||{}),l=o.__d),l)return o.__E=o}catch(a){e=a}throw e}},so=0,oo=function(e){return e!=null&&e.constructor==null},Rt.prototype.setState=function(e,t){var r;r=this.__s!=null&&this.__s!==this.state?this.__s:this.__s=Ye({},this.state),typeof e=="function"&&(e=e(Ye({},r),this.props)),e&&Ye(r,e),e!=null&&this.__v&&(t&&this._sb.push(t),$n(this))},Rt.prototype.forceUpdate=function(e){this.__v&&(this.__e=!0,e&&this.__h.push(e),$n(this))},Rt.prototype.render=Ht,it=[],ao=typeof Promise=="function"?Promise.prototype.then.bind(Prom
6ise.resolve()):setTimeout,Un=function(e,t){return e.__v.__b-t.__v.__b},nr.__r=0,Xn=0,Fn=Wi(!1),jn=Wi(!0),co=0;const Zl=Object.freeze(Object.defineProperty({__proto__:null,Component:Rt,Fragment:Ht,cloneElement:Vl,createContext:Gl,createElement:Wn,createRef:$l,h:Wn,hydrate:wo,get isValidElement(){return oo},get options(){return te},render:bo,toChildArray:_o},Symbol.toStringTag,{value:"Module"})),mo=qn(Zl);var Xe,Q,Ln,$i,mt=0,vo=[],ie=te,Hi=ie.__b,qi=ie.__r,Ki=ie.diffed,zi=ie.__c,Vi=ie.unmount,Gi=ie.__;function lt(e,t){ie.__h&&ie.__h(Q,e,mt||t),mt=0;var r=Q.__H||(Q.__H={__:[],__h:[]});return e>=r.__.length&&r.__.push({}),r.__[e]}function Eo(e){return mt=1,So(Co,e)}function So(e,t,r){var n=lt(Xe++,2);if(n.t=e,!n.__c&&(n.__=[r?r(t):Co(void 0,t),function(a){var h=n.__N?n.__N[0]:n.__[0],_=n.t(h,a);h!==_&&(n.__N=[_,n.__[1]],n.__c.setState({}))}],n.__c=Q,!Q.u)){var o=function(a,h,_){if(!n.__c.__H)return!0;var m=n.__c.__H.__.filter(function(b){return!!b.__c});if(m.every(function(b){return!b.__N}))return!c||c.call(this,a,h,_);var g=!1;return m.forEach(function(b){if(b.__N){var v=b.__[0];b.__=b.__N,b.__N=void 0,v!==b.__[0]&&(g=!0)}}),!(!g&&n.__c.props===a)&&(!c||c.call(this,a,h,_))};Q.u=!0;var c=Q.shouldComponentUpdate,l=Q.componentWillUpdate;Q.componentWillUpdate=function(a,h,_){if(this.__e){var m=c;c=void 0,o(a,h,_),c=m}l&&l.call(this,a,h,_)},Q.shouldComponentUpdate=o}return n.__N||n.__}function Yl(e,t){var r=lt(Xe++,3);!ie.__s&&ni(r.__H,t)&&(r.__=e,r.i=t,Q.__H.__h.push(r))}function xo(e,t){var r=lt(Xe++,4);!ie.__s&&ni(r.__H,t)&&(r.__=e,r.i=t,Q.__h.push(r))}function Jl(e){return mt=5,ri(function(){return{current:e}},[])}function Ql(e,t,r){mt=6,xo(function(){return typeof e=="function"?(e(t()),function(){return e(null)}):e?(e.current=t(),function(){return e.current=null}):void 0},r==null?r:r.concat(e))}function ri(e,t){var r=lt(Xe++,7);return ni(r.__H,t)&&(r.__=e(),r.__H=t,r.__h=e),r.__}function Xl(e,t){return mt=8,ri(function(){return e},t)}function eu(e){var t=Q.context[e.__c],r=lt(Xe++,9);return r.c=e,t?(r.__==null&&(r.__=!0,t.sub(Q)),t.props.value):e.__}function tu(e,t){ie.useDebugValue&&ie.useDebugValue(t?t(e):e)}function ru(e){var t=lt(Xe++,10),r=Eo();return t.__=e,Q.componentDidCatch||(Q.componentDidCatch=function(n,o){t.__&&t.__(n,o),r[1](n)}),[r[0],function(){r[1](void 0)}]}function nu(){var e=lt(Xe++,11);if(!e.__){for(var t=Q.__v;t!==null&&!t.__m&&t.__!==null;)t=t.__;var r=t.__m||(t.__m=[0,0]);e.__="P"+r[0]+"-"+r[1]++}return e.__}function iu(){for(var e;e=vo.shift();)if(e.__P&&e.__H)try{e.__H.__h.forEach(Xt),e.__H.__h.forEach(Hn),e.__H.__h=[]}catch(t){e.__H.__h=[],ie.__e(t,e.__v)}}ie.__b=function(e){Q=null,Hi&&Hi(e)},ie.__=function(e,t){e&&t.__k&&t.__k.__m&&(e.__m=t.__k.__m),Gi&&Gi(e,t)},ie.__r=function(e){qi&&qi(e),Xe=0;var t=(Q=e.__c).__H;t&&(Ln===Q?(t.__h=[],Q.__h=[],t.__.forEach(function(r){r.__N&&(r.__=r.__N),r.i=r.__N=void 0})):(t.__h.forEach(Xt),t.__h.forEach(Hn),t.__h=[],Xe=0)),Ln=Q},ie.diffed=function(e){Ki&&Ki(e);var t=e.__c;t&&t.__H&&(t.__H.__h.length&&(vo.push(t)!==1&&$i===ie.requestAnimationFrame||(($i=ie.requestAnimationFrame)||su)(iu)),t.__H.__.forEach(function(r){r.i&&(r.__H=r.i),r.i=void 0})),Ln=Q=null},ie.__c=function(e,t){t.some(function(r){try{r.__h.forEach(Xt),r.__h=r.__h.filter(function(n){return!n.__||Hn(n)})}catch(n){t.some(function(o){o.__h&&(o.__h=[])}),t=[],ie.__e(n,r.__v)}}),zi&&zi(e,t)},ie.unmount=function(e){Vi&&Vi(e);var t,r=e.__c;r&&r.__H&&(r.__H.__.forEach(function(n){try{Xt(n)}catch(o){t=o}}),r.__H=void 0,t&&ie.__e(t,r.__v))};var Zi=typeof requestAnimationFrame=="function";function su(e){var t,r=function(){clearTimeout(n),Zi&&cancelAnimationFrame(t),setTimeout(e)},n=setTimeout(r,100);Zi&&(t=requestAnimationFrame(r))}function Xt(e){var t=Q,r=e.__c;typeof r=="function"&&(e.__c=void 0,r()),Q=t}function Hn(e){var t=Q;e.__c=e.__(),Q=t}function ni(e,t){return!e||e.length!==t.length||t.some(function(r,n){return r!==e[n]})}function Co(e,t){return typeof t=="function"?t(e):t}const ou=Object.freeze(Object.defineProperty({__proto__:null,useCallback:Xl,useContext:eu,useDebugValue:tu,useEffect:Yl,useErrorBoundary:ru,useId:nu,useImperativeHandle:Ql,useLayoutEffect:xo,useMemo:ri,useReducer:So,useRef
6:Jl,useState:Eo},Symbol.toStringTag,{value:"Module"})),au=qn(ou);var ii={};Object.defineProperty(ii,"__esModule",{value:!0});ii.default=".-cbwsdk-css-reset .-gear-container{margin-left:16px !important;margin-right:9px !important;display:flex;align-items:center;justify-content:center;width:24px;height:24px;transition:opacity .25s}.-cbwsdk-css-reset .-gear-container *{user-select:none}.-cbwsdk-css-reset .-gear-container svg{opacity:0;position:absolute}.-cbwsdk-css-reset .-gear-icon{height:12px;width:12px;z-index:10000}.-cbwsdk-css-reset .-cbwsdk-snackbar{align-items:flex-end;display:flex;flex-direction:column;position:fixed;right:0;top:0;z-index:2147483647}.-cbwsdk-css-reset .-cbwsdk-snackbar *{user-select:none}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance{display:flex;flex-direction:column;margin:8px 16px 0 16px;overflow:visible;text-align:left;transform:translateX(0);transition:opacity .25s,transform .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-header:hover .-gear-container svg{opacity:1}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-header{display:flex;align-items:center;background:#fff;overflow:hidden;border:1px solid #e7ebee;box-sizing:border-box;border-radius:8px;cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-header-cblogo{margin:8px 8px 8px 8px}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-header *{cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-header-message{color:#000;font-size:13px;line-height:1.5;user-select:none}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu{background:#fff;transition:opacity .25s ease-in-out,transform .25s linear,visibility 0s;visibility:hidden;border:1px solid #e7ebee;box-sizing:border-box;border-radius:8px;opacity:0;flex-direction:column;padding-left:8px;padding-right:8px}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item:last-child{margin-bottom:8px !important}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item:hover{background:#f5f7f8;border-radius:6px;transition:background .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item:hover span{color:#050f19;transition:color .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item:hover svg path{fill:#000;transition:fill .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item{visibility:inherit;height:35px;margin-top:8px;margin-bottom:0;display:flex;flex-direction:row;align-items:center;padding:8px;cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item *{visibility:inherit;cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item-is-red:hover{background:rgba(223,95,103,.2);transition:background .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item-is-red:hover *{cursor:pointer}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item-is-red:hover svg path{fill:#df5f67;transition:fill .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item-is-red:hover span{color:#df5f67;transition:color .25s}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-menu-item-info{color:#aaa;font-size:13px;margin:0 8px 0 32px;position:absolute}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-hidden{opacity:0;text-align:left;transform:translateX(25%);transition:opacity .5s linear}.-cbwsdk-css-reset .-cbwsdk-snackbar-instance-expanded .-cbwsdk-snackbar-instance-menu{opacity:1;display:flex;transform:translateY(8px);visibility:visible}";(function(e){var t=le&&le.__importDefault||function(b){return b&&b.__esModule?b:{default:b}};Object.defineProperty(e,"__esModule",{value:!0}),e.SnackbarInstance=e.SnackbarContainer=e.Snackbar=void 0;const r=t(io),n=mo,o=au,c=ve,l=t(ii),a="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzIiIGhlaWdodD0iMzIiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTEuNDkyIDEwLjQxOWE4LjkzIDguOTMgMCAwMTguOTMtOC45M2gxMS4xNjNhOC45MyA4LjkzIDAgMDE4LjkzIDguOTN2MTEuMTYzYTguOTMgOC45MyAwIDAxLTguOTMgOC45M0gxMC40MjJhOC45MyA4LjkzIDAgMDEtOC45My04LjkzVjEwLjQxOXoiIGZpbGw9IiMxNjUyRjAiLz48cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0iTTEwLjQxOSAwSDIxLjU4QzI3LjMzNSAwIDMyIDQuNjY1IDMyIDEwLjQxOVYyMS41OEMzMiAyNy4zMzUgMjcuMzM1IDMyIDIxLjU4MSAzMkgxMC40MkM0LjY2NSAzMiAwIDI3LjMzNSAwIDIxLjU4MVYxMC40MkMwIDQuNjY1IDQuNjY1IDAgMTAuNDE5IDB6bTAgMS40ODhhOC45MyA4LjkzIDAgMDAtOC45MyA4LjkzdjExLjE2M2E4LjkzIDguOTMgMCAwMDguOTMgOC45M0gyMS41OGE4LjkzIDguOTMgMCAwMDguOTMtOC45M1YxMC40MmE4LjkzIDguOTMgMCAwMC04LjkzLTguOTNIMTAuNDJ6IiBmaWxsPSIjZmZmIi8+PHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0xNS45OTggMjYuMDQ5Yy01LjU0OSAwLTEwLjA0Ny00LjQ5OC0xMC4wNDctMTAuMDQ3IDAtNS41NDggNC40OTgtMTAuMDQ2IDEwLjA0Ny0xMC4wNDYgNS41NDggMCAxMC4wNDYgNC40OTggMTAuMDQ2IDEwLjA0NiA
6wIDUuNTQ5LTQuNDk4IDEwLjA0Ny0xMC4wNDYgMTAuMDQ3eiIgZmlsbD0iI2ZmZiIvPjxwYXRoIGQ9Ik0xMi43NjIgMTQuMjU0YzAtLjgyMi42NjctMS40ODkgMS40ODktMS40ODloMy40OTdjLjgyMiAwIDEuNDg4LjY2NiAxLjQ4OCAxLjQ4OXYzLjQ5N2MwIC44MjItLjY2NiAxLjQ4OC0xLjQ4OCAxLjQ4OGgtMy40OTdhMS40ODggMS40ODggMCAwMS0xLjQ4OS0xLjQ4OHYtMy40OTh6IiBmaWxsPSIjMTY1MkYwIi8+PC9zdmc+",h="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTIiIGhlaWdodD0iMTIiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZD0iTTEyIDYuNzV2LTEuNWwtMS43Mi0uNTdjLS4wOC0uMjctLjE5LS41Mi0uMzItLjc3bC44MS0xLjYyLTEuMDYtMS4wNi0xLjYyLjgxYy0uMjQtLjEzLS41LS4yNC0uNzctLjMyTDYuNzUgMGgtMS41bC0uNTcgMS43MmMtLjI3LjA4LS41My4xOS0uNzcuMzJsLTEuNjItLjgxLTEuMDYgMS4wNi44MSAxLjYyYy0uMTMuMjQtLjI0LjUtLjMyLjc3TDAgNS4yNXYxLjVsMS43Mi41N2MuMDguMjcuMTkuNTMuMzIuNzdsLS44MSAxLjYyIDEuMDYgMS4wNiAxLjYyLS44MWMuMjQuMTMuNS4yMy43Ny4zMkw1LjI1IDEyaDEuNWwuNTctMS43MmMuMjctLjA4LjUyLS4xOS43Ny0uMzJsMS42Mi44MSAxLjA2LTEuMDYtLjgxLTEuNjJjLjEzLS4yNC4yMy0uNS4zMi0uNzdMMTIgNi43NXpNNiA4LjVhMi41IDIuNSAwIDAxMC01IDIuNSAyLjUgMCAwMTAgNXoiIGZpbGw9IiMwNTBGMTkiLz48L3N2Zz4=";class _{constructor(){this.items=new Map,this.nextItemKey=0,this.root=null,this.darkMode=(0,c.isDarkMode)()}attach(v){this.root=document.createElement("div"),this.root.className="-cbwsdk-snackbar-root",v.appendChild(this.root),this.render()}presentItem(v){const I=this.nextItemKey++;return this.items.set(I,v),this.render(),()=>{this.items.delete(I),this.render()}}clear(){this.items.clear(),this.render()}render(){this.root&&(0,n.render)((0,n.h)("div",null,(0,n.h)(e.SnackbarContainer,{darkMode:this.darkMode},Array.from(this.items.entries()).map(([v,I])=>(0,n.h)(e.SnackbarInstance,Object.assign({},I,{key:v}))))),this.root)}}e.Snackbar=_;const m=b=>(0,n.h)("div",{class:(0,r.default)("-cbwsdk-snackbar-container")},(0,n.h)("style",null,l.default),(0,n.h)("div",{class:"-cbwsdk-snackbar"},b.children));e.SnackbarContainer=m;const g=({autoExpand:b,message:v,menuItems:I})=>{const[T,k]=(0,o.useState)(!0),[y,x]=(0,o.useState)(b??!1);(0,o.useEffect)(()=>{const L=[window.setTimeout(()=>{k(!1)},1),window.setTimeout(()=>{x(!0)},1e4)];return()=>{L.forEach(window.clearTimeout)}});const R=()=>{x(!y)};return(0,n.h)("div",{class:(0,r.default)("-cbwsdk-snackbar-instance",T&&"-cbwsdk-snackbar-instance-hidden",y&&"-cbwsdk-snackbar-instance-expanded")},(0,n.h)("div",{class:"-cbwsdk-snackbar-instance-header",onClick:R},(0,n.h)("img",{src:a,class:"-cbwsdk-snackbar-instance-header-cblogo"})," ",(0,n.h)("div",{class:"-cbwsdk-snackbar-instance-header-message"},v),(0,n.h)("div",{class:"-gear-container"},!y&&(0,n.h)("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,n.h)("circle",{cx:"12",cy:"12",r:"12",fill:"#F5F7F8"})),(0,n.h)("img",{src:h,class:"-gear-icon",title:"Expand"}))),I&&I.length>0&&(0,n.h)("div",{class:"-cbwsdk-snackbar-instance-menu"},I.map((L,P)=>(0,n.h)("div",{class:(0,r.default)("-cbwsdk-snackbar-instance-menu-item",L.isRed&&"-cbwsdk-snackbar-instance-menu-item-is-red"),onClick:L.onClick,key:P},(0,n.h)("svg",{width:L.svgWidth,height:L.svgHeight,viewBox:"0 0 10 11",fill:"none",xmlns:"http://www.w3.org/2000/svg"},(0,n.h)("path",{"fill-rule":L.defaultFillRule,"clip-rule":L.defaultClipRule,d:L.path,fill:"#AAAAAA"})),(0,n.h)("span",{class:(0,r.default)("-cbwsdk-snackbar-instance-menu-item-info",L.isRed&&"-cbwsdk-snackbar-instance-menu-item-info-is-red")},L.info)))))};e.SnackbarInstance=g})(Qn);Object.defineProperty(Cr,"__esModule",{value:!0});Cr.WalletLinkRelayUI=void 0;const cu=Wt,lu=Qn;class uu{constructor(){this.attached=!1,this.snackbar=new lu.Snackbar}attach(){if(this.attached)throw new Error("Coinbase Wallet SDK UI is already attached");const t=document.documentElement,r=document.createElement("div");r.className="-cbwsdk-css-reset",t.appendChild(r),this.snackbar.attach(r),this.attached=!0,(0,cu.injectCssReset)()}showConnecting(t){let r;return t.isUnlinkedErrorState?r={autoExpand:!0,message:"Connection lost",menuItems:[{isRed:!1,info:"Reset connection",svgWidth:"10",svgHeight:"11",path:"M5.00008 0.96875C6.73133 0.96875 8.23758 1.94375 9.00008 3.375L10.0001 2.375V5.5H9.53133H7.96883H6.87508L7.80633 4.56875C7.41258 3.3875 6.31258 2.53125 5.00008 2.53125C3.76258 2.53125 2.70633 3.2875 2.25633 4.36875L0.812576 3.76875C1.50008 2.125 3.11258 0.9687
65 5.00008 0.96875ZM2.19375 6.43125C2.5875 7.6125 3.6875 8.46875 5 8.46875C6.2375 8.46875 7.29375 7.7125 7.74375 6.63125L9.1875 7.23125C8.5 8.875 6.8875 10.0312 5 10.0312C3.26875 10.0312 1.7625 9.05625 1 7.625L0 8.625V5.5H0.46875H2.03125H3.125L2.19375 6.43125Z",defaultFillRule:"evenodd",defaultClipRule:"evenodd",onClick:t.onResetConnection}]}:r={message:"Confirm on phone",menuItems:[{isRed:!0,info:"Cancel transaction",svgWidth:"11",svgHeight:"11",path:"M10.3711 1.52346L9.21775 0.370117L5.37109 4.21022L1.52444 0.370117L0.371094 1.52346L4.2112 5.37012L0.371094 9.21677L1.52444 10.3701L5.37109 6.53001L9.21775 10.3701L10.3711 9.21677L6.53099 5.37012L10.3711 1.52346Z",defaultFillRule:"inherit",defaultClipRule:"inherit",onClick:t.onCancel},{isRed:!1,info:"Reset connection",svgWidth:"10",svgHeight:"11",path:"M5.00008 0.96875C6.73133 0.96875 8.23758 1.94375 9.00008 3.375L10.0001 2.375V5.5H9.53133H7.96883H6.87508L7.80633 4.56875C7.41258 3.3875 6.31258 2.53125 5.00008 2.53125C3.76258 2.53125 2.70633 3.2875 2.25633 4.36875L0.812576 3.76875C1.50008 2.125 3.11258 0.96875 5.00008 0.96875ZM2.19375 6.43125C2.5875 7.6125 3.6875 8.46875 5 8.46875C6.2375 8.46875 7.29375 7.7125 7.74375 6.63125L9.1875 7.23125C8.5 8.875 6.8875 10.0312 5 10.0312C3.26875 10.0312 1.7625 9.05625 1 7.625L0 8.625V5.5H0.46875H2.03125H3.125L2.19375 6.43125Z",defaultFillRule:"evenodd",defaultClipRule:"evenodd",onClick:t.onResetConnection}]},this.snackbar.presentItem(r)}}Cr.WalletLinkRelayUI=uu;var kr={},Rr={},si={};Object.defineProperty(si,"__esModule",{value:!0});si.default=".-cbwsdk-css-reset .-cbwsdk-redirect-dialog-backdrop{position:fixed;top:0;left:0;right:0;bottom:0;transition:opacity .25s;background-color:rgba(10,11,13,.5)}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-backdrop-hidden{opacity:0}
6.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box{display:block;position:fixed;top:50%;left:50%;transform:translate(-50%, -50%);padding:20px;border-radius:8px;background-color:#fff;color:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box p{display:block;font-weight:400;font-size:14px;line-height:20px;padding-bottom:12px;color:#5b636e}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box button{appearance:none;border:none;background:none;color:#0052ff;padding:0;text-decoration:none;display:block;font-weight:600;font-size:16px;line-height:24px}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box.dark{background-color:#0a0b0d;color:#fff}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box.dark button{color:#0052ff}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box.light{background-color:#fff;color:#0a0b0d}.-cbwsdk-css-reset .-cbwsdk-redirect-dialog-box.light button{color:#0052ff}";var Io=le&&le.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(Rr,"__esModule",{value:!0});Rr.RedirectDialog=void 0;const hu=Io(io),Fe=mo,du=Wt,fu=Qn,pu=ve,_u=Io(si);class gu{constructor(){this.root=null,this.darkMode=(0,pu.isDarkMode)()}attach(){const t=document.documentElement;this.root=document.createElement("div"),this.root.className="-cbwsdk-css-reset",t.appendChild(this.root),(0,du.injectCssReset)()}present(t){this.render(t)}clear(){this.render(null)}render(t){this.root&&((0,Fe.render)(null,this.root),t&&(0,Fe.render)((0,Fe.h)(yu,Object.assign({},t,{onDismiss:()=>{this.clear()},darkMode:this.darkMode})),this.root))}}Rr.RedirectDialog=gu;const yu=({title:e,buttonText:t,darkMode:r,onButtonClick:n,onDismiss:o})=>{const c=r?"dark":"light";return(0,Fe.h)(fu.SnackbarContainer,{darkMode:r},(0,Fe.h)("div",{class:"-cbwsdk-redirect-dialog"},(0,Fe.h)("style",null,_u.default),(0,Fe.h)("div",{class:"-cbwsdk-redirect-dialog-backdrop",onClick:o}),(0,Fe.h)("div",{class:(0,hu.default)("-cbwsdk-redirect-dialog-box",c)},(0,Fe.h)("p",null,e),(0,Fe.h)("button",{onClick:n},t))))};var He={};Object.defineProperty(He,"__esModule",{value:!0});He.CBW_MOBILE_DEEPLINK_URL=He.WALLETLINK_URL=He.CB_KEYS_URL=void 0;He.CB_KEYS_URL="https://keys.coinbase.com/connect";He.WALLETLINK_URL="https://www.walletlink.org";He.CBW_MOBILE_DEEPLINK_URL="https://go.cb-w.com/walletlink";Object.defineProperty(kr,"__esModule",{value:!0});kr.WLMobileRelayUI=void 0;const bu=Rr,wu=ve,mu=He;class vu{constructor(){this.attached=!1,this.redirectDialog=new bu.RedirectDialog}attach(){if(this.attached)throw new Error("Coinbase Wallet SDK UI is already attached");this.redirectDialog.attach(),this.attached=!0}redirectToCoinbaseWallet(t){const r=new URL(mu.CBW_MOBILE_DEEPLINK_URL);r.searchParams.append("redirect_url",(0,wu.getLocation)().href),t&&r.searchParams.append("wl_url",t);const n=document.createElement("a");n.target="cbw-opener",n.href=r.href,n.rel="noreferrer noopener",n.click()}openCoinbaseWalletDeeplink(t){this.redirectDialog.present({title:"Redirecting to Coinbase Wallet...",buttonText:"Open",onButtonClick:()=>{this.redirectToCoinbaseWallet(t)}}),setTimeout(()=>{this.redirectToCoinbaseWallet(t)},99)}showConnecting(t){return()=>{this.redirectDialog.clear()}}}kr.WLMobileRelayUI=vu;
6Object.defineProperty(yr,"__esModule",{value:!0});yr.WalletLinkRelay=void 0;const Eu=br,Su=$e,xu=Dt,Bn=vr,ft=Et,Cu=ve,Iu=Cr,Yi=kr,ku=qe,se=O,Ru=Ke;class Ze{constructor(t){this.accountsCallback=null,this.chainCallbackParams={chainId:"",jsonRpcUrl:""},this.chainCallback=null,this.dappDefaultChain=1,this.isMobileWeb=(0,Cu.isMobileWeb)(),this.appName="",this.appLogoUrl=null,this.linkedUpdated=c=>{this.isLinked=c;const l=this.storage.getItem(Su.LOCAL_STORAGE_ADDRESSES_KEY);if(c&&(this._session.linked=c),this.isUnlinkedErrorState=!1,l){const a=l.split(" "),h=this.storage.getItem("IsStandaloneSigning")==="true";a[0]!==""&&!c&&this._session.linked&&!h&&(this.isUnlinkedErrorState=!0)}},this.metadataUpdated=(c,l)=>{this.storage.setItem(c,l)},this.chainUpdated=(c,l)=>{this.chainCallbackParams.chainId===c&&this.chainCallbackParams.jsonRpcUrl===l||(this.chainCallbackParams={chainId:c,jsonRpcUrl:l},this.chainCallback&&this.chainCallback(c,l))},this.accountUpdated=c=>{this.accountsCallback&&this.accountsCallback([c]),Ze.accountRequestCallbackIds.size>0&&(Array.from(Ze.accountRequestCallbackIds.values()).forEach(l=>{const a={type:"WEB3_RESPONSE",id:l,response:{method:"requestEthereumAccounts",result:[c]}};this.invokeCallback(Object.assign(Object.assign({},a),{id:l}))}),Ze.accountRequestCallbackIds.clear())},this.resetAndReload=this.resetAndReload.bind(this),this.linkAPIUrl=t.linkAPIUrl,this.storage=t.storage;const{session:r,ui:n,connection:o}=this.subscribe();this._session=r,this.connection=o,this.relayEventManager=new xu.RelayEventManager,this.ui=n}subscribe(){const t=Bn.WalletLinkSession.load(this.storage)||new Bn.WalletLinkSession(this.storage).save(),{linkAPIUrl:r}=this,n=new Eu.WalletLinkConnection({session:t,linkAPIUrl:r,listener:this}),o=this.isMobileWeb?new Yi.WLMobileRelayUI:new Iu.WalletLinkRelayUI;return n.connect(),{session:t,ui:o,connection:n}}attachUI(){this.ui.attach()}resetAndReload(){Promise.race([this.connection.setSessionMetadata("__destroyed","1"),new Promise(t=>setTimeout(()=>t(null),1e3))]).then(()=>{this.connection.destroy();const t=Bn.WalletLinkSession.load(this.storage);(t==null?void 0:t.id)===this._session.id&&Ru.ScopedLocalStorage.clearAll(),document.location.reload()}).catch(t=>{})}setAppInfo(t,r){this.appName=t,this.appLogoUrl=r}getStorageItem(t){return this.storage.getItem(t)}setStorageItem(t,r){this.storage.setItem(t,r)}signEthereumMessage(t,r,n,o){return this.sendRequest({method:"signEthereumMessage",params:{message:(0,se.hexStringFromBuffer)(t,!0),address:r,addPrefix:n,typedDataJson:o||null}})}ethereumAddressFromSignedMessage(t,r,n){return this.sendRequest({method:"ethereumAddressFromSignedMessage",params:{message:(0,se.hexStringFromBuffer)(t,!0),signature:(0,se.hexStringFromBuffer)(r,!0),addPrefix:n}})}signEthereumTransaction(t){return this.sendRequest({method:"signEthereumTransaction",params:{fromAddress:t.fromAddress,toAddress:t.toAddress,weiValue:(0,se.bigIntStringFromBigInt)(t.weiValue),data:(0,se.hexStringFromBuffer)(t.data,!0),nonce:t.nonce,gasPriceInWei:t.gasPriceInWei?(0,se.bigIntStringFromBigInt)(t.gasPriceInWei):null,maxFeePerGas:t.gasPriceInWei?(0,se.bigIntStringFromBigInt)(t.gasPriceInWei):null,maxPriorityFeePerGas:t.gasPriceInWei?(0,se.bigIntStringFromBigInt)(t.gasPriceInWei):null,gasLimit:t.gasLimit?(0,se.bigIntStringFromBigInt)(t.gasLimit):null,chainId:t.chainId,shouldSubmit:!1}})}signAndSubmitEthereumTransaction(t){return this.sendRequest({method:"signEthereumTransaction",params:{fromAddress:t.fromAddress,toAddress:t.toAddress,weiValue:(0,se.bigIntStringFromBigInt)(t.weiValue),data:(0,se.hexStringFromBuffer)(t.data,!0),nonce:t.nonce,gasPriceInWei:t.gasPriceInWei?(0,se.bigIntStringFromBigInt)(t.gasPriceInWei):null,maxFeePerGas:t.maxFeePerGas?(0,se.bigIntStringFromBigInt)(t.maxFeePerGas):null,maxPriorityFeePerGas:t.maxPriorityFeePerGas?(0,se.bigIntStringFromBigInt)(t.maxPriorityFeePerGas):null,gasLimit:t.gasLimit?(0,se.bigIntStringFromBigInt)(t.gasLimit):null,chainId:t.chainId,shouldSubmit:!0}})}submitEthereumTransaction(t,r){return this.sendRequest({method:"submitEthereumTransaction",params:{signedTransaction:(0,se.hexStringFromBuffer)(t,!0),chainId:r}})}scanQRCode(t){return this.sendRequest({method:"scanQRCode",params:{regExp:t}})}getWalletLinkSession(){return this._session}genericRequest(t,r){return this.sendRequest({method:"generic",params:{action:r,data:t}})}sendGenericMessage(t){return this.sendRequest(t)}sendRequest(t){let r=null;const n=(0,se.randomBytesHex)(8),o=c=>{this.publishWeb3RequestCanceledEvent(n),this.handleErrorResponse(n,t.method,c),r==null||r()};return new Promise((c,l)=>{r=this.ui.showConnecting({isUnlinkedErrorState:this.isUnlinkedErrorState,onCancel:o,onResetConnection:this.resetAndReload}),this.relayEventManager.callbacks.set(n,a=>{if(r==null||r(),(0,ft.isErrorResponse)(a))return l(new Error(a.errorMessage));c(a)}),this.publishWeb3RequestEvent(n,t)})}setAccountsCallback(t){this.accountsCallback=t}setChainCallback(t){this.chainCallback=t}setDappDefaultChainCallback(t){this.dappDefaultChain=t}publishWeb3RequestEvent(t,r){const n={type:"WEB3_REQUEST",id:t,request:r};this.publishEvent("Web3Request",n,!0).then(o=>{}).catch(o=>{this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:n.id,response:{method:r.method,errorMessage:o.message}})}),this.isMobileWeb&&this.openCoinbaseWalletDeeplink(r.method)}openCoinbaseWalletDeeplink(t){if(this.ui instanceof Yi.WLMobileRelayUI)switch(t){case"requestEthereumAccounts":case"switchEthereumChain":return;default:window.addEventListener("blur",()=>{window.addEventListener("focus",()=>{this.connection.checkUnseenEvents()},{once:!0})},{once:!0}),this.ui.openCoinbaseWalletDeeplink();break}}publishWeb3RequestCanceledEvent(t){const r={type:"WEB3_REQUEST_CANCELED",id:t};this.publishEvent("Web3RequestCanceled",r,!1).then()}publishEvent(t,r,n){return this.connection.publishEvent(t,r,n)}handleWeb3ResponseMessage(t){const{response:r}=t;if(r.method==="requestEthereumAccounts"){Ze.accountRequestCallbackIds.forEach(n=>this.invokeCallback(Object.assign(Object.assign({},t),{id:n}))),Ze.accountRequestCallbackIds.clear();return}this.invokeCallback(t)}handleErrorResponse(t,r,n){var o;const c=(o=n==null?void 0:n.message)!==null&&o!==void 0?o:"Unspecified error message.";this.handleWeb3ResponseMessage({type:"WEB3_RESPONSE",id:t,response:{method:r,errorMessage:c}})}invokeCallback(t){const r=this.relayEventManager.callbacks.get(t.id);r&&(r(t.response),this.relayEventManager.callbacks.delete(t.id))}requestEthereumAccounts(){const t={method:"requestEthereumAccounts",params:{appName:this.appName,a
6ppLogoUrl:this.appLogoUrl||null}},r=(0,se.randomBytesHex)(8);return new Promise((n,o)=>{this.relayEventManager.callbacks.set(r,c=>{if((0,ft.isErrorResponse)(c))return o(new Error(c.errorMessage));n(c)}),Ze.accountRequestCallbackIds.add(r),this.publishWeb3RequestEvent(r,t)})}watchAsset(t,r,n,o,c,l){const a={method:"watchAsset",params:{type:t,options:{address:r,symbol:n,decimals:o,image:c},chainId:l}};let h=null;const _=(0,se.randomBytesHex)(8),m=g=>{this.publishWeb3RequestCanceledEvent(_),this.handleErrorResponse(_,a.method,g),h==null||h()};return h=this.ui.showConnecting({isUnlinkedErrorState:this.isUnlinkedErrorState,onCancel:m,onResetConnection:this.resetAndReload}),new Promise((g,b)=>{this.relayEventManager.callbacks.set(_,v=>{if(h==null||h(),(0,ft.isErrorResponse)(v))return b(new Error(v.errorMessage));g(v)}),this.publishWeb3RequestEvent(_,a)})}addEthereumChain(t,r,n,o,c,l){const a={method:"addEthereumChain",params:{chainId:t,rpcUrls:r,blockExplorerUrls:o,chainName:c,iconUrls:n,nativeCurrency:l}};let h=null;const _=(0,se.randomBytesHex)(8),m=g=>{this.publishWeb3RequestCanceledEvent(_),this.handleErrorResponse(_,a.method,g),h==null||h()};return h=this.ui.showConnecting({isUnlinkedErrorState:this.isUnlinkedErrorState,onCancel:m,onResetConnection:this.resetAndReload}),new Promise((g,b)=>{this.relayEventManager.callbacks.set(_,v=>{if(h==null||h(),(0,ft.isErrorResponse)(v))return b(new Error(v.errorMessage));g(v)}),this.publishWeb3RequestEvent(_,a)})}switchEthereumChain(t,r){const n={method:"switchEthereumChain",params:Object.assign({chainId:t},{address:r})},o=(0,se.randomBytesHex)(8);return new Promise((c,l)=>{this.relayEventManager.callbacks.set(o,a=>{if((0,ft.isErrorResponse)(a)&&a.errorCode)return l(ku.standardErrors.provider.custom({code:a.errorCode,message:"Unrecognized chain ID. Try adding the chain using addEthereumChain first."}));if((0,ft.isErrorResponse)(a))return l(new Error(a.errorMessage));c(a)}),this.publishWeb3RequestEvent(o,n)})}}yr.WalletLinkRelay=Ze;Ze.accountRequestCallbackIds=new Set;var Au=le&&le.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(dr,"__esModule",{value:!0});dr.WalletLinkSigner=void 0;const Tn=Au(kc),Ji=$e,Mu=Dt,Ge=Et,Lu=yr,Qi=He,ce=qe,q=O,Bu=Ke,Pn="DefaultChainId",Xi="DefaultJsonRpcUrl";class Tu{constructor(t){var r,n;this._relay=null,this._addresses=[],this.hasMadeFirstChainChangedEmission=!1;const{appName:o,appLogoUrl:c}=t.metadata;this._appName=o,this._appLogoUrl=c,this._storage=new Bu.ScopedLocalStorage("walletlink",Qi.WALLETLINK_URL),this.updateListener=t.updateListener,this._relayEventManager=new Mu.RelayEventManager,this._jsonRpcUrlFromOpts="";const l=this._storage.getItem(Ji.LOCAL_STORAGE_ADDRESSES_KEY);if(l){const h=l.split(" ");h[0]!==""&&(this._addresses=h.map(_=>(0,q.ensureAddressString)(_)),(r=this.updateListener)===null||r===void 0||r.onAccountsUpdate({accounts:this._addresses,source:"storage"}))}this._storage.getItem(Pn)&&((n=this.updateListener)===null||n===void 0||n.onChainUpdate({chain:{id:this.getChainId(),rpcUrl:this.jsonRpcUrl},source:"storage"}),this.hasMadeFirstChainChangedEmission=!0),this.initializeRelay()}getSession(){const t=this.initializeRelay(),{id:r,secret:n}=t.getWalletLinkSession();return{id:r,secret:n}}async handshake(){return await this.request({method:"eth_requestAccounts"})}get selectedAddress(){return this._addresses[0]||void 0}get jsonRpcUrl(){var t;return(t=this._storage.getItem(Xi))!==null&&t!==void 0?t:this._jsonRpcUrlFromOpts}set jsonRpcUrl(t){this._storage.setItem(Xi,t)}updateProviderInfo(t,r){var n;this.jsonRpcUrl=t;const o=this.getChainId();this._storage.setItem(Pn,r.toString(10)),((0,q.ensureIntNumber)(r)!==o||!this.hasMadeFirstChainChangedEmission)&&((n=this.updateListener)===null||n===void 0||n.onChainUpdate({chain:{id:r,rpcUrl:t},source:"wallet"}),this.hasMadeFirstChainChangedEmission=!0)}async watchAsset(t,r,n,o,c,l){const h=await this.initializeRelay().watchAsset(t,r,n,o,c,l==null?void 0:l.toString());return(0,Ge.isErrorResponse)(h)?!1:!!h.result}async addEthereumChain(t,r,n,o,c,l){var a,h;if((0,q.ensureIntNumber)(t)===this.getChainId())return!1;const _=this.initializeRelay();this._isAuthorized()||await _.requestEthereumAccounts();const m=await _.addEthereumChain(t.toString(),r,c,n,o,l);return(0,Ge.isErrorResponse)(m)?!1:(((a=m.result)===null||a===void 0?void 0:a.isApproved)===!0&&this.updateProviderInfo(r[0],t),((h=m.result)===null||h===void 0?void 0:h.isApproved)===!0)}async switchEthereumChain(t){const n=await this.initializeRelay().switchEthereumChain(t.toString(10),this.selectedAddress||void 0);if((0,Ge.isErrorResponse)(n)){if(!n.errorCode)return;throw n.errorCode===ce.standardErrorCodes.provider.unsupportedChain?ce.standardErrors.provider.unsupportedChain():ce.standardErrors.provider.custom({message:n.errorMessage,code:n.errorCode})}const o=n.result;o.isApproved&&o.rpcUrl.length>0&&this.updateProviderInfo(o.rpcUrl,t)}async disconnect(){this._relay&&this._relay.resetAndReload(),this._storage.clear()}async request(t){try{return this._request(t).catch(r=>{throw r})}catch(r){return Promise.reject(r)}}async _request(t){if(!t||typeof t!="object"||Array.isArray(t))throw ce.standardErrors.rpc.invalidRequest({message:"Expected a single, non-array, object argument.",data:t});const{method:r,params:n}=t;if(typeof r!="string"||r.length===0)throw ce.standardErrors.rpc.invalidRequest({message:"'args.method' must be a non-empty string.",data:t});if(n!==void 0&&!Array.isArray(n)&&(typeof n!="object"||n===null))throw ce.standardErrors.rpc.invalidRequest({message:"'args.params' must be an object or array if provided.",data:t});const o=n===void 0?[]:n,c=this._relayEventManager.makeRequestId();return(await this._sendRequestAsync({method:r,params:o,jsonrpc:"2.0",id:c})).result}_setAddresses(t,r){var n;if(!Array.isArray(t))throw new Error("addresses is not an array");const o=t.map(c=>(0,q.ensureAddressString)(c));JSON.stringify(o)!==JSON.stringify(this._addresses)&&(this._addresses=o,(n=this.updateListener)===null||n===void 0||n.onAccountsUpdate({accounts:o,source:"wallet"}),this._storage.setItem(Ji.LOCAL_STORAGE_ADDRESSES_KEY,o.join(" ")))}_sendRequestAsync(t){return new Promise((r,n)=>{try{const o=this._handleSynchronousMethods(t);
6if(o!==void 0)return r({jsonrpc:"2.0",id:t.id,result:o})}catch(o){return n(o)}this._handleAsynchronousMethods(t).then(o=>o&&r(Object.assign(Object.assign({},o),{id:t.id}))).catch(o=>n(o))})}_handleSynchronousMethods(t){const{method:r}=t;switch(r){case"eth_accounts":return this._eth_accounts();case"eth_coinbase":return this._eth_coinbase();case"net_version":return this._net_version();case"eth_chainId":return this._eth_chainId();default:return}}async _handleAsynchronousMethods(t){const{method:r}=t,n=t.params||[];switch(r){case"eth_requestAccounts":return this._eth_requestAccounts();case"eth_sign":return this._eth_sign(n);case"eth_ecRecover":return this._eth_ecRecover(n);case"personal_sign":return this._personal_sign(n);case"personal_ecRecover":return this._personal_ecRecover(n);case"eth_signTransaction":return this._eth_signTransaction(n);case"eth_sendRawTransaction":return this._eth_sendRawTransaction(n);case"eth_sendTransaction":return this._eth_sendTransaction(n);case"eth_signTypedData_v1":return this._eth_signTypedData_v1(n);case"eth_signTypedData_v2":return this._throwUnsupportedMethodError();case"eth_signTypedData_v3":return this._eth_signTypedData_v3(n);case"eth_signTypedData_v4":case"eth_signTypedData":return this._eth_signTypedData_v4(n);case"wallet_addEthereumChain":return this._wallet_addEthereumChain(n);case"wallet_switchEthereumChain":return this._wallet_switchEthereumChain(n);case"wallet_watchAsset":return this._wallet_watchAsset(n);default:return this._throwUnsupportedMethodError()}}_isKnownAddress(t){try{const r=(0,q.ensureAddressString)(t);return this._addresses.map(o=>(0,q.ensureAddressString)(o)).includes(r)}catch{}return!1}_ensureKnownAddress(t){if(!this._isKnownAddress(t))throw new Error("Unknown Ethereum address")}_prepareTransactionParams(t){const r=t.from?(0,q.ensureAddressString)(t.from):this.selectedAddress;if(!r)throw new Error("Ethereum address is unavailable");this._ensureKnownAddress(r);const n=t.to?(0,q.ensureAddressString)(t.to):null,o=t.value!=null?(0,q.ensureBigInt)(t.value):BigInt(0),c=t.data?(0,q.ensureBuffer)(t.data):Buffer.alloc(0),l=t.nonce!=null?(0,q.ensureIntNumber)(t.nonce):null,a=t.gasPrice!=null?(0,q.ensureBigInt)(t.gasPrice):null,h=t.maxFeePerGas!=null?(0,q.ensureBigInt)(t.maxFeePerGas):null,_=t.maxPriorityFeePerGas!=null?(0,q.ensureBigInt)(t.maxPriorityFeePerGas):null,m=t.gas!=null?(0,q.ensureBigInt)(t.gas):null,g=t.chainId?(0,q.ensureIntNumber)(t.chainId):this.getChainId();return{fromAddress:r,toAddress:n,weiValue:o,data:c,nonce:l,gasPriceInWei:a,maxFeePerGas:h,maxPriorityFeePerGas:_,gasLimit:m,chainId:g}}_isAuthorized(){return this._addresses.length>0}_requireAuthorization(){if(!this._isAuthorized())throw ce.standardErrors.provider.unauthorized({})}_throwUnsupportedMethodError(){throw ce.standardErrors.provider.unsupportedMethod({})}async _signEthereumMessage(t,r,n,o){this._ensureKnownAddress(r);try{const l=await this.initializeRelay().signEthereumMessage(t,r,n,o);if((0,Ge.isErrorResponse)(l))throw new Error(l.errorMessage);return{jsonrpc:"2.0",id:0,result:l.result}}catch(c){throw typeof c.message=="string"&&c.message.match(/(denied|rejected)/i)?ce.standardErrors.provider.userRejectedRequest("User denied message signature"):c}}async _ethereumAddressFromSignedMessage(t,r,n){const c=await this.initializeRelay().ethereumAddressFromSignedMessage(t,r,n);if((0,Ge.isErrorResponse)(c))throw new Error(c.errorMessage);return{jsonrpc:"2.0",id:0,result:c.result}}_eth_accounts(){return[...this._addresses]}_eth_coinbase(){return this.selectedAddress||null}_net_version(){return this.getChainId().toString(10)}_eth_chainId(){return(0,q.hexStringFromIntNumber)(this.getChainId())}getChainId(){const t=this._storage.getItem(Pn);if(!t)return(0,q.ensureIntNumber)(1);const r=parseInt(t,10);return(0,q.ensureIntNumber)(r)}async _eth_requestAccounts(){if(this._isAuthorized())return Promise.resolve({jsonrpc:"2.0",id:0,result:this._addresses});let t;try{if(t=await this.initializeRelay().requestEthereumAccounts(),(0,Ge.isErrorResponse)(t))throw new Error(t.errorMessage)}catch(r){throw typeof r.message=="string"&&r.message.match(/(denied|rejected)/i)?ce.standardErrors.provider.userRejectedRequest("User denied account authorization"):r}if(!t.result)throw new Error("accounts received is empty");return this._setAddresses(t.result),{jsonrpc:"2.0",id:0,result:this._addresses}}_eth_sign(t){this._requireAuthorization();const r=(0,q.ensureAddressString)(t[0]),n=(0,q.ensureBuffer)(t[1]);return this._signEthereumMessage(n,r,!1)}_eth_ecRecover(t){const r=(0,q.ensureBuffer)(t[0]),n=(0,q.ensureBuffer)(t[1]);return this._ethereumAddressFromSignedMessage(r,n,!1)}_personal_sign(t){this._requireAuthorization();const r=(0,q.ensureBuffer)(t[0]),n=(0,q.ensureAddressString)(t[1]);return this._signEthereumMessage(r,n,!0)}_personal_ecRecover(t){const r=(0,q.ensureBuffer)(t[0]),n=(0,q.ensureBuffer)(t[1]);return this._ethereumAddressFromSignedMessage(r,n,!0)}async _eth_signTransaction(t){this._requireAuthorization();const r=this._prepareTransactionParams(t[0]||{});try{const o=await this.initializeRelay().signEthereumTransaction(r);if((0,Ge.isErrorResponse)(o))throw new Error(o.errorMessage);return{jsonrpc:"2.0",id:0,result:o.result}}catch(n){throw typeof n.message=="string"&&n.message.match(/(denied|rejected)/i)?ce.standardErrors.provider.userRejectedRequest("User denied transaction signature"):n}}async _eth_sendRawTransaction(t){const r=(0,q.ensureBuffer)(t[0]),o=await this.initializeRelay().submitEthereumTransaction(r,this.getChainId());if((0,Ge.isErrorResponse)(o))throw new Error(o.errorMessage);return{jsonrpc:"2.0",id:0,result:o.result}}async _eth_sendTransaction(t){this._requireAuthorization();const r=this._prepareTransactionParams(t[0]||{});try{const o=await this.initializeRelay().signAndSubmitEthereumTransaction(r);if((0,Ge.isErrorResponse)(o))throw new Error(o.errorMessage);return{jsonrpc:"2.0",id:0,result:o.result}}catch(n){throw typeof n.message=="string"&&n.message.match(/(denied|rejected)/i)?ce.standardErrors.provider.userRejectedRequest("User denied transaction signature"):n}}async _eth_signTypedData_v1(t){this._requireAuthorization();const r=(0,q.ensureParsedJSONObject)(t[0]),n=(0,q.ensureAddressString)(t[1]);this._ensureKnownAddress(n);const o=Tn.default.hashForSignTypedDataLegacy({data:r}),c=JSON.stringify(r,null,2);return this._signEthereumMessage(o,n,!1,c)}async _eth_signTypedData_v3(t){this._requireAuthorization();const r=(0,q.ensureAddressString)(t[0]),n=(0,q.ensureParsedJSONObject)(t[1]);this._ensureKnownAddress(r);const o=Tn.default.hashForSignTypedData_v3({data:n}),c=JSON.stringify(n,null,2);return this._signEthereumMessage(o,r,!1,c)}async _eth_signTypedData_v4(t){this._requireAuthorization();const r=(0,q.ensureAddressString)(t[0]),n=(0,q.ensureParsedJSONObject)(t[1]);this._ensureKnownAddress(r);const o=Tn.default.hashForSignTypedData_v4({data:n}),c=JSON.stringify(n,null,2);return this._signEthereumMessage(o,r,!1,c)}async _wallet_addEthereumChain(t){var r,n,o,c;const l=t[0];if(((r=l.rpcUrls)===null||r===void 0?void 0:r.length)===0)return{jsonrpc:"2.0",id:0,error:{code:2,message:"please pass in at least 1 rpcUrl"}};if(!l.chainName||l.chainName.trim()==="")throw ce.standardErrors.rpc.invalidParams("chainName is a required field");if(!l.nativeCurrency)throw ce.standardErrors.rpc.invalidParams("nativeCurrency is a required field");const a=parseInt(l.chainId,16);return await this.addEthereumChain(a,(n=l.rpcUrls)!==null&&n!==void 0?n:[],(o=l.blockExplorerUrls)!==null&&o!==void 0?o:[],l.chainName,(c=l.iconUrls)!==null&&c!==void 0?c:[],l.nativeCurrency)?{jsonrpc:"2.0",id:0,result:null}:{jsonrpc:"2.0",id:0,error:{code:2,message:"unable to add ethereum chain"}}}async _wallet_switchEthereumChain(t){const r=t[0];return await this.switchEthereumChain(parseInt(r.chainId,16)),{jsonrpc:"2.0",id:0,result:null}}async _wallet_watchAsset(t){const r=Array.isArray(t)?t[0]:t;if(!r.type)throw ce.standardErrors.rpc.invalidParams("Type is required");if((r==null?void 0:r.type)!=="ERC20")throw ce.standardErrors.rpc.invalidParams(`Asset of type '${r.type}' is not supported`);if(!(r!=null&&r.options))throw ce.standardErrors.rpc.invalidParams("Options are required");if(!(r!=null&&r.options.address))throw ce.standardErrors.rpc.invalidParams("Address is required");const n=this.getChainId(),{address:o,symbol:c,image:l,decimals:a}=r.options;return{jsonrpc:"2.0",id:0,result:await this.watchAsset(r.type,o,c,a,l,n)}}initializeRelay(){if(!this._relay){const t=new Lu.WalletLinkRelay({linkAPIUrl:Qi.WALLETLINK_URL,storage:this._storage});t.setAppInfo(this._appName,this._appLogoUrl),t.attachUI(),t.setAccountsCallback((r,n)=>this._setAddresses(r,n)),t.setChainCallback((r,n)=>{this.updateProviderInfo(n,parseInt(r,10))}),this._relay=t}return this._relay}}dr.WalletLinkSigner=Tu;var Ce={};
6Object.defineProperty(Ce,"__esModule",{value:!0});Ce.checkErrorForInvalidRequestArgs=Ce.getCoinbaseInjectedProvider=Ce.getCoinbaseInjectedSigner=Ce.fetchRPCRequest=void 0;const Pu=st,er=qe;async function Nu(e,t){if(!t.rpcUrl)throw er.standardErrors.rpc.internal("No RPC URL set for chain");const r=Object.assign(Object.assign({},e),{jsonrpc:"2.0",id:crypto.randomUUID()});return(await(await window.fetch(t.rpcUrl,{method:"POST",body:JSON.stringify(r),mode:"cors",headers:{"Content-Type":"application/json","X-Cbw-Sdk-Version":Pu.LIB_VERSION}})).json()).result}Ce.fetchRPCRequest=Nu;function ko(){return globalThis.coinbaseWalletSigner}Ce.getCoinbaseInjectedSigner=ko;function Du(){return globalThis.coinbaseWalletExtension}function Ou(){var e,t;try{const r=globalThis;return(e=r.ethereum)!==null&&e!==void 0?e:(t=r.top)===null||t===void 0?void 0:t.ethereum}catch{return}}function Uu({metadata:e,preference:t}){var r;if(t.options!=="smartWalletOnly"){if(ko())return;const c=Du();if(c){const{appName:l,appLogoUrl:a,appChainIds:h}=e;return(r=c.setAppInfo)===null||r===void 0||r.call(c,l,a,h),c}}const n=Ou();if(n!=null&&n.isCoinbaseBrowser)return n}Ce.getCoinbaseInjectedProvider=Uu;function Fu(e){if(!e||typeof e!="object"||Array.isArray(e))return er.standardErrors.rpc.invalidParams({message:"Expected a single, non-array, object argument.",data:e});const{method:t,params:r}=e;if(typeof t!="string"||t.length===0)return er.standardErrors.rpc.invalidParams({message:"'args.method' must be a non-empty string.",data:e});if(r!==void 0&&!Array.isArray(r)&&(typeof r!="object"||r===null))return er.standardErrors.rpc.invalidParams({message:"'args.params' must be an object or array if provided.",data:e})}Ce.checkErrorForInvalidRequestArgs=Fu;Object.defineProperty(We,"__esModule",{value:!0});We.createSigner=We.fetchSignerType=We.storeSignerType=We.loadSignerType=void 0;const ju=lr,Ro=dr,Wu=qe,$u=Ce,Hu=Ke,Ao="SignerType",Mo=new Hu.ScopedLocalStorage("CBWSDK","SignerConfigurator");function qu(){return Mo.getItem(Ao)}We.loadSignerType=qu;function Ku(e){Mo.setItem(Ao,e)}We.storeSignerType=Ku;async function zu(e){const{communicator:t,metadata:r}=e;Gu(t,r).catch(()=>{});const n={id:crypto.randomUUID(),event:"selectSignerType",data:e.preference},{data:o}=await t.postRequestAndWaitForResponse(n);return o}We.fetchSignerType=zu;function Vu(e){const{signerType:t,metadata:r,communicator:n,updateListener:o}=e;switch(t){case"scw":return new ju.SCWSigner({metadata:r,updateListener:o,communicator:n});case"walletlink":return new Ro.WalletLinkSigner({metadata:r,updateListener:o});case"extension":{const c=(0,$u.getCoinbaseInjectedSigner)();if(!c)throw Wu.standardErrors.rpc.internal("injected signer not found");return c}}}We.createSigner=Vu;async function Gu(e,t){await e.onMessage(({event:n})=>n==="WalletLinkSessionRequest");const r=new Ro.WalletLinkSigner({metadata:t});e.postMessage({event:"WalletLinkUpdate",data:{session:r.getSession()}}),await r.handshake(),e.postMessage({event:"WalletLinkUpdate",data:{connected:!0}})}var Ar={},vt={};Object.defineProperty(vt,"__esModule",{value:!0});vt.closePopup=vt.openPopup=void 0;const Zu=qe,es=420,ts=540;function Yu(e){const t=(window.innerWidth-es)/2+window.screenX,r=(window.innerHeight-ts)/2+window.screenY,n=window.open(e,"Smart Wallet",`width=${es}, height=${ts}, left=${t}, top=${r}`);if(n==null||n.focus(),!n)throw Zu.standardErrors.rpc.internal("Pop up window failed to open");return n}vt.openPopup=Yu;function Ju(e){e&&!e.closed&&e.close()}vt.closePopup=Ju;Object.defineProperty(Ar,"__esModule",{value:!0});Ar.Communicator=void 0;const Qu=st,rs=vt,Xu=He,ns=qe;class eh{constructor(t=Xu.CB_KEYS_URL){this.popup=null,this.listeners=new Map,this.postMessage=async r=>{(await this.waitForPopupLoaded()).postMessage(r,this.url.origin)},this.postRequestAndWaitForResponse=async r=>{const n=this.onMessage(({requestId:o})=>o===r.id);return this.postMessage(r),await n},this.onMessage=async r=>new Promise((n,o)=>{const c=l=>{if(l.origin!==this.url.origin)return;const a=l.data;r(a)&&(n(a),window.removeEventListener("message",c),this.listeners.delete(c))};window.addEventListener("message",c),this.listeners.set(c,{reject:o})}),this.disconnect=()=>{(0,rs.closePopup)(this.popup),this.popup=null,this.listeners.forEac
6h(({reject:r},n)=>{r(ns.standardErrors.provider.userRejectedRequest("Request rejected")),window.removeEventListener("message",n)}),this.listeners.clear()},this.waitForPopupLoaded=async()=>this.popup&&!this.popup.closed?(this.popup.focus(),this.popup):(this.popup=(0,rs.openPopup)(this.url),this.onMessage(({event:r})=>r==="PopupUnload").then(this.disconnect).catch(()=>{}),this.onMessage(({event:r})=>r==="PopupLoaded").then(r=>{this.postMessage({requestId:r.id,data:{version:Qu.LIB_VERSION}})}).then(()=>{if(!this.popup)throw ns.standardErrors.rpc.internal();return this.popup})),this.url=new URL(t)}}Ar.Communicator=eh;var Mr={};Object.defineProperty(Mr,"__esModule",{value:!0});Mr.determineMethodCategory=void 0;const is={handshake:["eth_requestAccounts"],sign:["eth_ecRecover","personal_sign","personal_ecRecover","eth_signTransaction","eth_sendTransaction","eth_signTypedData_v1","eth_signTypedData_v3","eth_signTypedData_v4","eth_signTypedData","wallet_addEthereumChain","wallet_switchEthereumChain","wallet_watchAsset","wallet_getCapabilities","wallet_sendCalls","wallet_showCallsStatus"],state:["eth_chainId","eth_accounts","eth_coinbase","net_version"],deprecated:["eth_sign","eth_signTypedData_v2"],unsupported:["eth_subscribe","eth_unsubscribe"],fetch:[]};function th(e){for(const t in is){const r=t;if(is[r].includes(e))return r}}Mr.determineMethodCategory=th;var rh=le&&le.__rest||function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,n=Object.getOwnPropertySymbols(e);o<n.length;o++)t.indexOf(n[o])<0&&Object.prototype.propertyIsEnumerable.call(e,n[o])&&(r[n[o]]=e[n[o]]);return r},nh=le&&le.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(sr,"__esModule",{value:!0});sr.CoinbaseWalletProvider=void 0;const ih=nh(Po),pt=qe,sh=ar,Yt=ge,Ct=O,Jt=We,ss=Ce,oh=Ar,ah=Mr,ch=Ke;class lh extends ih.default{constructor(t){var r,n,{metadata:o}=t,c=t.preference,{keysUrl:l}=c,a=rh(c,["keysUrl"]);super(),this.accounts=[],this.handlers={handshake:async _=>{try{if(this.connected)return this.emit("connect",{chainId:(0,Ct.hexStringFromIntNumber)((0,Yt.IntNumber)(this.chain.id))}),this.accounts;const m=await this.requestSignerSelection(),g=this.initSigner(m),b=await g.handshake();return this.signer=g,(0,Jt.storeSignerType)(m),this.emit("connect",{chainId:(0,Ct.hexStringFromIntNumber)((0,Yt.IntNumber)(this.chain.id))}),b}catch(m){throw this.handleUnauthorizedError(m),m}},sign:async _=>{if(!this.connected||!this.signer)throw pt.standardErrors.provider.unauthorized("Must call 'eth_requestAccounts' before other methods");try{return await this.signer.request(_)}catch(m){throw this.handleUnauthorizedError(m),m}},fetch:_=>(0,ss.fetchRPCRequest)(_,this.chain),state:_=>{const m=()=>{if(this.connected)return this.accounts;throw pt.standardErrors.provider.unauthorized("Must call 'eth_requestAccounts' before other methods")};switch(_.method){case"eth_chainId":return(0,Ct.hexStringFromIntNumber)((0,Yt.IntNumber)(this.chain.id));case"net_version":return this.chain.id;case"eth_accounts":return m();case"eth_coinbase":return m()[0];default:return this.handlers.unsupported(_)}},deprecated:({method:_})=>{throw pt.standardErrors.rpc.methodNotSupported(`Method ${_} is deprecated.`)},unsupported:({method:_})=>{throw pt.standardErrors.rpc.methodNotSupported(`Method ${_} is not supported.`)}},this.isCoinbaseWallet=!0,this.updateListener={onAccountsUpdate:({accounts:_,source:m})=>{(0,Ct.areAddressArraysEqual)(this.accounts,_)||(this.accounts=_,m!=="storage"&&this.emit("accountsChanged",this.accounts))},onChainUpdate:({chain:_,source:m})=>{_.id===this.chain.id&&_.rpcUrl===this.chain.rpcUrl||(this.chain=_,m!=="storage"&&this.emit("chainChanged",(0,Ct.hexStringFromIntNumber)((0,Yt.IntNumber)(_.id))))}},this.metadata=o,this.preference=a,this.communicator=new oh.Communicator(l),this.chain={id:(n=(r=o.appChainIds)===null||r===void 0?void 0:r[0])!==null&&n!==void 0?n:1};const h=(0,Jt.loadSignerType)();this.signer=h?this.initSigner(h):null}get connected(){return this.accounts.length>0}async request(t){var r;try{const n=(0,ss.checkErrorForInvalidRequestArgs)(t);if(n)throw n;const o=(r=(0,ah.determineMethodCategory)(t.method))!==null&&r!==void 0?r:"fetch";return this.handlers[o](t)}catch(n){return Promise.reject((0,sh.serializeError)(n,t.method))}}handleUnauthorizedError(t){t.code===pt.standardErrorCodes.provider.unauthorized&&this.disconnect()}async enable(){return console.warn('.enable() has been deprecated. Please use .request({ method: "eth_requestAccounts" }) instead.'),await this.request({method:"eth_requestAccounts"})}async disconnect(){this.accounts=[],this.chain={id:1}
6,ch.ScopedLocalStorage.clearAll(),this.emit("disconnect",pt.standardErrors.provider.disconnected("User initiated disconnection"))}requestSignerSelection(){return(0,Jt.fetchSignerType)({communicator:this.communicator,preference:this.preference,metadata:this.metadata})}initSigner(t){return(0,Jt.createSigner)({signerType:t,metadata:this.metadata,communicator:this.communicator,updateListener:this.updateListener})}}sr.CoinbaseWalletProvider=lh;Object.defineProperty(At,"__esModule",{value:!0});At.CoinbaseWalletSDK=void 0;const uh=ir,hh=sr,dh=Ke,fh=st,ph=O,_h=Ce;class gh{constructor(t){this.metadata={appName:t.appName||"Dapp",appLogoUrl:t.appLogoUrl||(0,ph.getFavicon)(),appChainIds:t.appChainIds||[]},this.storeLatestVersion()}makeWeb3Provider(t={options:"all"}){var r;const n={metadata:this.metadata,preference:t};return(r=(0,_h.getCoinbaseInjectedProvider)(n))!==null&&r!==void 0?r:new hh.CoinbaseWalletProvider(n)}getCoinbaseWalletLogo(t,r=240){return(0,uh.walletLogo)(t,r)}storeLatestVersion(){new dh.ScopedLocalStorage("CBWSDK").setItem("VERSION",fh.LIB_VERSION)}}At.CoinbaseWalletSDK=gh;(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.CoinbaseWalletSDK=void 0;const t=At;e.default=t.CoinbaseWalletSDK;var r=At;Object.defineProperty(e,"CoinbaseWalletSDK",{enumerable:!0,get:function(){return r.CoinbaseWalletSDK}})})(Kn);const yh=Lo(Kn),mh=Bo({__proto__:null,default:yh},[Kn]);export{mh as i};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.