@eluvio/elv-client-js 4.0.9 → 4.0.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/ElvClient-min.js +2 -2
- package/dist/ElvClient-node-min.js +2 -2
- package/dist/ElvFrameClient-min.js +1 -1
- package/dist/ElvWalletClient-min.js +2 -2
- package/dist/ElvWalletClient-node-min.js +2 -2
- package/dist/src/AuthorizationClient.js +7 -8
- package/dist/src/client/ContentManagement.js +57 -52
- package/dist/src/client/Files.js +2 -1
- package/package.json +1 -1
- package/src/AuthorizationClient.js +5 -5
- package/src/client/ContentManagement.js +24 -29
- package/src/client/Files.js +1 -1
- package/utilities/ListAccessGroups.js +34 -0
|
@@ -63,4 +63,4 @@ var n=r(12),i=r(13),o=r(14);function a(){return A.TYPED_ARRAY_SUPPORT?2147483647
|
|
|
63
63
|
* @author Chen, Yi-Cyuan [emn178@gmail.com]
|
|
64
64
|
* @copyright Chen, Yi-Cyuan 2015-2018
|
|
65
65
|
* @license MIT
|
|
66
|
-
*/!function(){"use strict";var s="input is invalid type",A="object"===("undefined"==typeof window?"undefined":a(window)),c=A?window:{};c.JS_SHA3_NO_WINDOW&&(A=!1);var u=!A&&"object"===("undefined"==typeof self?"undefined":a(self));!c.JS_SHA3_NO_NODE_JS&&"object"===(void 0===e?"undefined":a(e))&&e.versions&&e.versions.node?c=n:u&&(c=self);var f=!c.JS_SHA3_NO_COMMON_JS&&"object"===a(i)&&i.exports,h=r(53),l=!c.JS_SHA3_NO_ARRAY_BUFFER&&"undefined"!=typeof ArrayBuffer,g="0123456789abcdef".split(""),d=[4,1024,262144,67108864],p=[0,8,16,24],I=[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],y=[224,256,384,512],b=[128,256],E=["hex","buffer","arrayBuffer","array","digest"],m={128:168,256:136};!c.JS_SHA3_NO_NODE_JS&&Array.isArray||(Array.isArray=function(e){return"[object Array]"===Object.prototype.toString.call(e)}),!l||!c.JS_SHA3_NO_ARRAY_BUFFER_IS_VIEW&&ArrayBuffer.isView||(ArrayBuffer.isView=function(e){return"object"===a(e)&&e.buffer&&e.buffer.constructor===ArrayBuffer});for(var C=function(e,t,r){return function(n){return new F(e,t,e).update(n)[r]()}},v=function(e,t,r){return function(n,i){return new F(e,t,i).update(n)[r]()}},B=function(e,t,r){return function(t,n,i,o){return S["cshake"+e].update(t,n,i,o)[r]()}},w=function(e,t,r){return function(t,n,i,o){return S["kmac"+e].update(t,n,i,o)[r]()}},Q=function(e,t,r,n){for(var i=0;i<E.length;++i){var o=E[i];e[o]=t(r,n,o)}return e},k=function(e,t){var r=C(e,t,"hex");return r.create=function(){return new F(e,t,e)},r.update=function(e){return r.create().update(e)},Q(r,C,e,t)},_=[{name:"keccak",padding:[1,256,65536,16777216],bits:y,createMethod:k},{name:"sha3",padding:[6,1536,393216,100663296],bits:y,createMethod:k},{name:"shake",padding:[31,7936,2031616,520093696],bits:b,createMethod:function(e,t){var r=v(e,t,"hex");return r.create=function(r){return new F(e,t,r)},r.update=function(e,t){return r.create(t).update(e)},Q(r,v,e,t)}},{name:"cshake",padding:d,bits:b,createMethod:function(e,t){var r=m[e],n=B(e,0,"hex");return n.create=function(n,i,o){return i||o?new F(e,t,n).bytepad([i,o],r):S["shake"+e].create(n)},n.update=function(e,t,r,i){return n.create(t,r,i).update(e)},Q(n,B,e,t)}},{name:"kmac",padding:d,bits:b,createMethod:function(e,t){var r=m[e],n=w(e,0,"hex");return n.create=function(n,i,o){return new j(e,t,i).bytepad(["KMAC",o],r).bytepad([n],r)},n.update=function(e,t,r,i){return n.create(e,r,i).update(t)},Q(n,w,e,t)}}],S={},D=[],M=0;M<_.length;++M)for(var R=_[M],x=R.bits,O=0;O<x.length;++O){var N=R.name+"_"+x[O];if(D.push(N),S[N]=R.createMethod(x[O],R.padding),"sha3"!==R.name){var P=R.name+x[O];D.push(P),S[P]=S[N]}}function F(e,t,r){this.blocks=[],this.s=[],this.padding=t,this.outputBits=r,this.reset=!0,this.finalized=!1,this.block=0,this.start=0,this.blockCount=1600-(e<<1)>>5,this.byteCount=this.blockCount<<2,this.outputBlocks=r>>5,this.extraBytes=(31&r)>>3;for(var n=0;n<50;++n)this.s[n]=0}function j(e,t,r){F.call(this,e,t,r)}F.prototype.update=function(e){if(this.finalized)throw new Error("finalize already called");var t,r=a(e);if("string"!==r){if("object"!==r)throw new Error(s);if(null===e)throw new Error(s);if(l&&e.constructor===ArrayBuffer)e=new Uint8Array(e);else if(!(Array.isArray(e)||l&&ArrayBuffer.isView(e)))throw new Error(s);t=!0}for(var n,i,o=this.blocks,A=this.byteCount,c=e.length,u=this.blockCount,f=0,h=this.s;f<c;){if(this.reset)for(this.reset=!1,o[0]=this.block,n=1;n<u+1;++n)o[n]=0;if(t)for(n=this.start;f<c&&n<A;++f)o[n>>2]|=e[f]<<p[3&n++];else for(n=this.start;f<c&&n<A;++f)(i=e.charCodeAt(f))<128?o[n>>2]|=i<<p[3&n++]:i<2048?(o[n>>2]|=(192|i>>6)<<p[3&n++],o[n>>2]|=(128|63&i)<<p[3&n++]):i<55296||i>=57344?(o[n>>2]|=(224|i>>12)<<p[3&n++],o[n>>2]|=(128|i>>6&63)<<p[3&n++],o[n>>2]|=(128|63&i)<<p[3&n++]):(i=65536+((1023&i)<<10|1023&e.charCodeAt(++f)),o[n>>2]|=(240|i>>18)<<p[3&n++],o[n>>2]|=(128|i>>12&63)<<p[3&n++],o[n>>2]|=(128|i>>6&63)<<p[3&n++],o[n>>2]|=(128|63&i)<<p[3&n++]);if(this.lastByteIndex=n,n>=A){for(this.start=n-A,this.block=o[u],n=0;n<u;++n)h[n]^=o[n];T(h),this.reset=!0}else this.start=n}return this},F.prototype.encode=function(e,t){var r=255&e,n=1,i=[r];for(r=255&(e>>=8);r>0;)i.unshift(r),r=255&(e>>=8),++n;return t?i.push(n):i.unshift(n),this.update(i),i.length},F.prototype.encodeString=function(e){var t,r=a(e);if("string"!==r){if("object"!==r)throw new Error(s);if(null===e)throw new Error(s);if(l&&e.constructor===ArrayBuffer)e=new Uint8Array(e);else if(!(Array.isArray(e)||l&&ArrayBuffer.isView(e)))throw new Error(s);t=!0}var n=0,i=e.length;if(t)n=i;else for(var o=0;o<e.length;++o){var A=e.charCodeAt(o);A<128?n+=1:A<2048?n+=2:A<55296||A>=57344?n+=3:(A=65536+((1023&A)<<10|1023&e.charCodeAt(++o)),n+=4)}return n+=this.encode(8*n),this.update(e),n},F.prototype.bytepad=function(e,t){for(var r=this.encode(t),n=0;n<e.length;++n)r+=this.encodeString(e[n]);var i=t-r%t,o=[];return o.length=i,this.update(o),this},F.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var e=this.blocks,t=this.lastByteIndex,r=this.blockCount,n=this.s;if(e[t>>2]|=this.padding[3&t],this.lastByteIndex===this.byteCount)for(e[0]=e[r],t=1;t<r+1;++t)e[t]=0;for(e[r-1]|=2147483648,t=0;t<r;++t)n[t]^=e[t];T(n)}},F.prototype.toString=F.prototype.hex=function(){this.finalize();for(var e,t=this.blockCount,r=this.s,n=this.outputBlocks,i=this.extraBytes,o=0,a=0,s="";a<n;){for(o=0;o<t&&a<n;++o,++a)e=r[o],s+=g[e>>4&15]+g[15&e]+g[e>>12&15]+g[e>>8&15]+g[e>>20&15]+g[e>>16&15]+g[e>>28&15]+g[e>>24&15];a%t==0&&(T(r),o=0)}return i&&(e=r[o],s+=g[e>>4&15]+g[15&e],i>1&&(s+=g[e>>12&15]+g[e>>8&15]),i>2&&(s+=g[e>>20&15]+g[e>>16&15])),s},F.prototype.arrayBuffer=function(){this.finalize();var e,t=this.blockCount,r=this.s,n=this.outputBlocks,i=this.extraBytes,o=0,a=0,s=this.outputBits>>3;e=i?new ArrayBuffer(n+1<<2):new ArrayBuffer(s);for(var A=new Uint32Array(e);a<n;){for(o=0;o<t&&a<n;++o,++a)A[a]=r[o];a%t==0&&T(r)}return i&&(A[o]=r[o],e=e.slice(0,s)),e},F.prototype.buffer=F.prototype.arrayBuffer,F.prototype.digest=F.prototype.array=function(){this.finalize();for(var e,t,r=this.blockCount,n=this.s,i=this.outputBlocks,o=this.extraBytes,a=0,s=0,A=[];s<i;){for(a=0;a<r&&s<i;++a,++s)e=s<<2,t=n[a],A[e]=255&t,A[e+1]=t>>8&255,A[e+2]=t>>16&255,A[e+3]=t>>24&255;s%r==0&&T(n)}return o&&(e=s<<2,t=n[a],A[e]=255&t,o>1&&(A[e+1]=t>>8&255),o>2&&(A[e+2]=t>>16&255)),A},j.prototype=new F,j.prototype.finalize=function(){return this.encode(this.outputBits,!0),F.prototype.finalize.call(this)};var T=function(e){var t,r,n,i,o,a,s,A,c,u,f,h,l,g,d,p,y,b,E,m,C,v,B,w,Q,k,_,S,D,M,R,x,O,N,P,F,j,T,U,L,H,G,Y,K,q,J,z,V,Z,W,X,$,ee,te,re,ne,ie,oe,ae,se,Ae,ce,ue;for(n=0;n<48;n+=2)i=e[0]^e[10]^e[20]^e[30]^e[40],o=e[1]^e[11]^e[21]^e[31]^e[41],a=e[2]^e[12]^e[22]^e[32]^e[42],s=e[3]^e[13]^e[23]^e[33]^e[43],A=e[4]^e[14]^e[24]^e[34]^e[44],c=e[5]^e[15]^e[25]^e[35]^e[45],u=e[6]^e[16]^e[26]^e[36]^e[46],f=e[7]^e[17]^e[27]^e[37]^e[47],t=(h=e[8]^e[18]^e[28]^e[38]^e[48])^(a<<1|s>>>31),r=(l=e[9]^e[19]^e[29]^e[39]^e[49])^(s<<1|a>>>31),e[0]^=t,e[1]^=r,e[10]^=t,e[11]^=r,e[20]^=t,e[21]^=r,e[30]^=t,e[31]^=r,e[40]^=t,e[41]^=r,t=i^(A<<1|c>>>31),r=o^(c<<1|A>>>31),e[2]^=t,e[3]^=r,e[12]^=t,e[13]^=r,e[22]^=t,e[23]^=r,e[32]^=t,e[33]^=r,e[42]^=t,e[43]^=r,t=a^(u<<1|f>>>31),r=s^(f<<1|u>>>31),e[4]^=t,e[5]^=r,e[14]^=t,e[15]^=r,e[24]^=t,e[25]^=r,e[34]^=t,e[35]^=r,e[44]^=t,e[45]^=r,t=A^(h<<1|l>>>31),r=c^(l<<1|h>>>31),e[6]^=t,e[7]^=r,e[16]^=t,e[17]^=r,e[26]^=t,e[27]^=r,e[36]^=t,e[37]^=r,e[46]^=t,e[47]^=r,t=u^(i<<1|o>>>31),r=f^(o<<1|i>>>31),e[8]^=t,e[9]^=r,e[18]^=t,e[19]^=r,e[28]^=t,e[29]^=r,e[38]^=t,e[39]^=r,e[48]^=t,e[49]^=r,g=e[0],d=e[1],J=e[11]<<4|e[10]>>>28,z=e[10]<<4|e[11]>>>28,S=e[20]<<3|e[21]>>>29,D=e[21]<<3|e[20]>>>29,se=e[31]<<9|e[30]>>>23,Ae=e[30]<<9|e[31]>>>23,G=e[40]<<18|e[41]>>>14,Y=e[41]<<18|e[40]>>>14,N=e[2]<<1|e[3]>>>31,P=e[3]<<1|e[2]>>>31,p=e[13]<<12|e[12]>>>20,y=e[12]<<12|e[13]>>>20,V=e[22]<<10|e[23]>>>22,Z=e[23]<<10|e[22]>>>22,M=e[33]<<13|e[32]>>>19,R=e[32]<<13|e[33]>>>19,ce=e[42]<<2|e[43]>>>30,ue=e[43]<<2|e[42]>>>30,te=e[5]<<30|e[4]>>>2,re=e[4]<<30|e[5]>>>2,F=e[14]<<6|e[15]>>>26,j=e[15]<<6|e[14]>>>26,b=e[25]<<11|e[24]>>>21,E=e[24]<<11|e[25]>>>21,W=e[34]<<15|e[35]>>>17,X=e[35]<<15|e[34]>>>17,x=e[45]<<29|e[44]>>>3,O=e[44]<<29|e[45]>>>3,w=e[6]<<28|e[7]>>>4,Q=e[7]<<28|e[6]>>>4,ne=e[17]<<23|e[16]>>>9,ie=e[16]<<23|e[17]>>>9,T=e[26]<<25|e[27]>>>7,U=e[27]<<25|e[26]>>>7,m=e[36]<<21|e[37]>>>11,C=e[37]<<21|e[36]>>>11,$=e[47]<<24|e[46]>>>8,ee=e[46]<<24|e[47]>>>8,K=e[8]<<27|e[9]>>>5,q=e[9]<<27|e[8]>>>5,k=e[18]<<20|e[19]>>>12,_=e[19]<<20|e[18]>>>12,oe=e[29]<<7|e[28]>>>25,ae=e[28]<<7|e[29]>>>25,L=e[38]<<8|e[39]>>>24,H=e[39]<<8|e[38]>>>24,v=e[48]<<14|e[49]>>>18,B=e[49]<<14|e[48]>>>18,e[0]=g^~p&b,e[1]=d^~y&E,e[10]=w^~k&S,e[11]=Q^~_&D,e[20]=N^~F&T,e[21]=P^~j&U,e[30]=K^~J&V,e[31]=q^~z&Z,e[40]=te^~ne&oe,e[41]=re^~ie&ae,e[2]=p^~b&m,e[3]=y^~E&C,e[12]=k^~S&M,e[13]=_^~D&R,e[22]=F^~T&L,e[23]=j^~U&H,e[32]=J^~V&W,e[33]=z^~Z&X,e[42]=ne^~oe&se,e[43]=ie^~ae&Ae,e[4]=b^~m&v,e[5]=E^~C&B,e[14]=S^~M&x,e[15]=D^~R&O,e[24]=T^~L&G,e[25]=U^~H&Y,e[34]=V^~W&$,e[35]=Z^~X&ee,e[44]=oe^~se&ce,e[45]=ae^~Ae&ue,e[6]=m^~v&g,e[7]=C^~B&d,e[16]=M^~x&w,e[17]=R^~O&Q,e[26]=L^~G&N,e[27]=H^~Y&P,e[36]=W^~$&K,e[37]=X^~ee&q,e[46]=se^~ce&te,e[47]=Ae^~ue&re,e[8]=v^~g&p,e[9]=B^~d&y,e[18]=x^~w&k,e[19]=O^~Q&_,e[28]=G^~N&F,e[29]=Y^~P&j,e[38]=$^~K&J,e[39]=ee^~q&z,e[48]=ce^~te&ne,e[49]=ue^~re&ie,e[0]^=I[n],e[1]^=I[n+1]};if(f)i.exports=S;else{for(M=0;M<D.length;++M)c[D[M]]=S[D[M]];h&&(void 0===(o=function(){return S}.call(t,r,t,i))||(i.exports=o))}}()}).call(this,r(9),r(8),r(11)(e))},function(e,t,r){"use strict";r.d(t,"a",(function(){return n}));var n="random/5.7.0"},function(e,t,r){var n=r(36),i=r(21),o=r(22),a=r(51),s=r(52);function A(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function c(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?A(Object(r),!0).forEach((function(t){n(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):A(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function u(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return f(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return f(e,t)}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return a=e.done,e},e:function(e){s=!0,o=e},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}function f(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var h=r(172),l=r(37),g=r(195).permissionLevels,d=r(99).LogMessage,p=r(265),I=function(){"use strict";function e(){var t=this,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=r.target,s=r.timeout,A=void 0===s?30:s;a(this,e),this.permissionLevels=g,!n&&"undefined"!=typeof window&&window.parent&&(n=window.parent),this.target=n,this.timeout=A,this.utils=l,this.Crypto=p,this.Crypto.ElvCrypto();var c,f=u(this.AllowedMethods());try{var h=function(){var e=c.value;t[e]=function(){var r=o(i.mark((function r(n){var o;return i.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return(o=n&&n.callback)&&delete n.callback,r.next=4,t.SendMessage({options:{calledMethod:e,args:t.utils.MakeClonable(n)},callback:o});case 4:return r.abrupt("return",r.sent);case 5:case"end":return r.stop()}}),r)})));return function(e){return r.apply(this,arguments)}}()};for(f.s();!(c=f.n()).done;)h()}catch(e){f.e(e)}finally{f.f()}this.userProfileClient={};var d,I=u(this.AllowedUserProfileMethods());try{var y=function(){var r=d.value;t.userProfileClient[r]=function(){var n=o(i.mark((function n(o){var a;return i.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return(a=o&&o.callback)&&delete o.callback,n.next=4,t.SendMessage({options:{module:"userProfileClient",calledMethod:r,args:t.utils.MakeClonable(o),prompted:e.PromptedMethods().includes(r)},callback:a});case 4:return n.abrupt("return",n.sent);case 5:case"end":return n.stop()}}),n)})));return function(e){return n.apply(this,arguments)}}()};for(I.s();!(d=I.n()).done;)y()}catch(e){I.e(e)}finally{I.f()}}var t,r,n;return s(e,[{key:"Log",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];d(this,e,t)}},{key:"PassRequest",value:(n=o(i.mark((function e(t){var r,n,o,a,s;return i.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.request,n=t.Respond,e.prev=1,r.callbackId&&(s=function(e){return n({type:"ElvFrameResponse",requestId:r.callbackId,response:e})}),e.next=5,this.SendMessage({options:r,callback:s});case 5:o=e.sent,e.next=11;break;case 8:e.prev=8,e.t0=e.catch(1),a=e.t0;case 11:return e.abrupt("return",{type:"ElvFrameResponse",requestId:r.requestId,response:o,error:a});case 12:case"end":return e.stop()}}),e,this,[[1,8]])}))),function(e){return n.apply(this,arguments)})},{key:"SendMessage",value:(r=o(i.mark((function t(r){var n,o,a,s,A,u,f,l,g,d;return i.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n=r.options,o=void 0===n?{}:n,a=r.callback,s=r.noResponse,A=void 0!==s&&s,u=h.next(),a&&(f=h.next()),this.target.postMessage(c(c({},o),{},{type:"ElvFrameRequest",requestId:u,callbackId:f}),"*"),!A){t.next=6;break}return t.abrupt("return");case 6:return l=o.calledMethod||o.operation,g=e.FileMethods().includes(o.calledMethod),d=this.timeout,o.prompted||g?d=0:o.args&&o.args.fcTimeout&&(d=o.args.fcTimeout),t.next=12,this.AwaitMessage(u,d,a,f,l);case 12:return t.abrupt("return",t.sent);case 13:case"end":return t.stop()}}),t,this)}))),function(e){return r.apply(this,arguments)})},{key:"AwaitMessage",value:(t=o(i.mark((function e(t,r,n,a,s){return i.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,new Promise((function(e,A){var c,u,f,h=function(){u&&clearTimeout(u),r>0&&(u=setTimeout((function(){"undefined"!=typeof window&&(window.removeEventListener("message",c),f&&window.removeEventListener("message",f)),A("Request ".concat(t," timed out (").concat(s,")"))}),1e3*r))};a&&(f=function(e){try{h();var t=e.data;if("ElvFrameResponse"!==t.type||t.requestId!==a)return;n(t.response)}catch(e){console.error(e)}},window.addEventListener("message",f)),c=function(){var r=o(i.mark((function r(n){var o;return i.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(r.prev=0,"ElvFrameResponse"===(o=n.data).type&&o.requestId===t){r.next=4;break}return r.abrupt("return");case 4:clearTimeout(u),window.removeEventListener("message",c),f&&window.removeEventListener("message",f),o.error?A(o.error):e(o.response),r.next=16;break;case 10:r.prev=10,r.t0=r.catch(0),clearTimeout(u),window.removeEventListener("message",c),f&&window.removeEventListener("message",f),A(r.t0);case 16:case"end":return r.stop()}}),r,null,[[0,10]])})));return function(e){return r.apply(this,arguments)}}(),h(),window.addEventListener("message",c)}));case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e)}))),function(e,r,n,i,o){return t.apply(this,arguments)})},{key:"OverriddenMethods",value:function(){return["UploadFiles"]}},{key:"AllowedMethods",value:function(){return["AccessGroupManagers","AccessGroupMembers","AccessGroupOwner","AccessInfo","AccessRequest","AccessType","AddAccessGroupManager","AddAccessGroupMember","AddContentLibraryGroup","AddContentObjectGroupPermission","AddLibraryContentType","AssetMetadata","AvailableDRMs","AvailableOfferings","AwaitPending","BitmovinPlayoutOptions","BlockNumber","CallBitcodeMethod","CallContractMethod","CallContractMethodAndWait","ClearCache","ClearStaticToken","Collection","CollectionTransactions","ConfigUrl","ContentLibraries","ContentLibrary","ContentLibraryGroupPermissions","ContentLibraryOwner","ContentObject","ContentObjectAccessComplete","ContentObjectGraph","ContentObjectGroupPermissions","ContentObjectImageUrl","ContentObjectLibraryId","ContentObjectMetadata","ContentObjectOwner","ContentObjectTenantId","ContentObjectVersions","ContentObjects","ContentPart","ContentParts","ContentSpaceId","ContentType","ContentTypeOwner","ContentTypes","ContractAbi","ContractEvents","ContractMetadata","ContractName","CopyContentObject","CreateABRMezzanine","CreateAccessGroup","CreateAndFinalizeContentObject","CreateContentLibrary","CreateContentObject","CreateContentType","CreateEncryptionConk","CreateFabricToken","CreateFileDirectories","CreateFileUploadJob","CreateLinks","CreateNTPInstance","CreateNonOwnerCap","CreatePart","CreateProductionMaster","CreateSignedToken","CurrentAccountAddress","CustomContractAddress","Decrypt","DecryptECIES","DefaultKMSAddress","DeleteAccessGroup","DeleteContentLibrary","DeleteContentObject","DeleteContentVersion","DeleteFiles","DeleteMetadata","DeleteNTPInstance","DeletePart","DeployContract","Download","DownloadEncrypted","DownloadFile","DownloadPart","EditAndFinalizeContentObject","EditContentObject","Encrypt","EncryptECIES","EncryptionConk","Events","ExtractEventFromLogs","ExtractValueFromEvent","FabricUrl","FileUrl","FinalizeABRMezzanine","FinalizeContentObject","FinalizePart","FinalizeStateChannelAccess","FinalizeUploadJob","FormatContractArguments","GenerateStateChannelToken","GenerateSignedLinkToken","GetBalance","InitializeAuthPolicy","IssueNTPCode","IssueSignedNTPCode","LatestVersionHash","LibraryContentTypes","LinkAccessGroupToOauth","LinkData","LinkTarget","LinkUrl","ListAccessGroups","ListFiles","ListNTPInstances","LROStatus","MergeContractMetadata","MergeMetadata","MetadataAuth","MintNFT","NetworkInfo","NodeId","Nodes","NTPInstance","Permission","PlayoutOptions","PlayoutPathResolution","ProduceMetadataLinks","Proofs","PublicRep","PublishContentVersion","QParts","RedeemCode","RemoveAccessGroupManager","RemoveAccessGroupMember","RemoveContentObjectGroupPermission","RemoveContentLibraryGroup","RemoveLibraryContentType","Rep","ReplaceContractMetadata","ReplaceMetadata","Request","ResetRegion","SendFunds","SetAccessCharge","SetAuth","SetAuthContext","SetAuthPolicy","SetContentLibraryImage","SetContentObjectImage","SetCustomContentContract","SetGroupPermission","SetNodes","SetOauthToken","SetPolicyAuthorization","SetSignerFromOauthToken","SetStaticToken","SetVisibility","SetPermission","StartABRMezzanineJobs","SuspendNTPInstance","UnlinkAccessGroupFromOauth","UpdateContentObjectGraph","UpdateNTPInstance","UploadFileData","UploadFilesFromS3","UploadJobStatus","UploadPart","UploadPartChunk","UploadStatus","UseRegion","VerifyContentObject","Visibility"]}},{key:"AllowedUserProfileMethods",value:function(){return["AccessLevel","CollectedTags","CreateWallet","DeleteUserMetadata","MergeUserMetadata","PublicUserMetadata","ReplaceUserMetadata","TenantId","UserMetadata","UserProfileImage","UserWalletAddress","UserWalletObjectInfo","WalletAddress"]}}],[{key:"PromptedMethods",value:function(){return["CollectedTags","DeleteUserMetadata","MergeUserMetadata","ReplaceUserMetadata","UserMetadata"]}},{key:"MetadataMethods",value:function(){return["DeleteUserMetadata","MergeUserMetadata","ReplaceUserMetadata","UserMetadata"]}},{key:"FileMethods",value:function(){return["DownloadFile","DownloadPart","UpdateContentObjectGraph","UploadFiles","UploadFilesFromS3","UploadPart","UploadPartChunk"]}}]),e}(),y=r(332).UploadFiles;I.prototype.UploadFiles=y,t.FrameClient=I},,function(e,t,r){(function(e){function t(e){return(t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var r=function(e){"use strict";var r=Object.prototype,n=r.hasOwnProperty,i="function"==typeof Symbol?Symbol:{},o=i.iterator||"@@iterator",a=i.asyncIterator||"@@asyncIterator",s=i.toStringTag||"@@toStringTag";function A(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{A({},"")}catch(e){A=function(e,t,r){return e[t]=r}}function c(e,t,r,n){var i=t&&t.prototype instanceof h?t:h,o=Object.create(i.prototype),a=new B(n||[]);return o._invoke=function(e,t,r){var n="suspendedStart";return function(i,o){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===i)throw o;return Q()}for(r.method=i,r.arg=o;;){var a=r.delegate;if(a){var s=m(a,r);if(s){if(s===f)continue;return s}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var A=u(e,t,r);if("normal"===A.type){if(n=r.done?"completed":"suspendedYield",A.arg===f)continue;return{value:A.arg,done:r.done}}"throw"===A.type&&(n="completed",r.method="throw",r.arg=A.arg)}}}(e,r,a),o}function u(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}e.wrap=c;var f={};function h(){}function l(){}function g(){}var d={};A(d,o,(function(){return this}));var p=Object.getPrototypeOf,I=p&&p(p(w([])));I&&I!==r&&n.call(I,o)&&(d=I);var y=g.prototype=h.prototype=Object.create(d);function b(e){["next","throw","return"].forEach((function(t){A(e,t,(function(e){return this._invoke(t,e)}))}))}function E(e,r){var i;this._invoke=function(o,a){function s(){return new r((function(i,s){!function i(o,a,s,A){var c=u(e[o],e,a);if("throw"!==c.type){var f=c.arg,h=f.value;return h&&"object"===t(h)&&n.call(h,"__await")?r.resolve(h.__await).then((function(e){i("next",e,s,A)}),(function(e){i("throw",e,s,A)})):r.resolve(h).then((function(e){f.value=e,s(f)}),(function(e){return i("throw",e,s,A)}))}A(c.arg)}(o,a,i,s)}))}return i=i?i.then(s,s):s()}}function m(e,t){var r=e.iterator[t.method];if(void 0===r){if(t.delegate=null,"throw"===t.method){if(e.iterator.return&&(t.method="return",t.arg=void 0,m(e,t),"throw"===t.method))return f;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return f}var n=u(r,e.iterator,t.arg);if("throw"===n.type)return t.method="throw",t.arg=n.arg,t.delegate=null,f;var i=n.arg;return i?i.done?(t[e.resultName]=i.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,f):i:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,f)}function C(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function v(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function B(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(C,this),this.reset(!0)}function w(e){if(e){var t=e[o];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var r=-1,i=function t(){for(;++r<e.length;)if(n.call(e,r))return t.value=e[r],t.done=!1,t;return t.value=void 0,t.done=!0,t};return i.next=i}}return{next:Q}}function Q(){return{value:void 0,done:!0}}return l.prototype=g,A(y,"constructor",g),A(g,"constructor",l),l.displayName=A(g,s,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===l||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,g):(e.__proto__=g,A(e,s,"GeneratorFunction")),e.prototype=Object.create(y),e},e.awrap=function(e){return{__await:e}},b(E.prototype),A(E.prototype,a,(function(){return this})),e.AsyncIterator=E,e.async=function(t,r,n,i,o){void 0===o&&(o=Promise);var a=new E(c(t,r,n,i),o);return e.isGeneratorFunction(r)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},b(y),A(y,s,"Generator"),A(y,o,(function(){return this})),A(y,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=[];for(var r in e)t.push(r);return t.reverse(),function r(){for(;t.length;){var n=t.pop();if(n in e)return r.value=n,r.done=!1,r}return r.done=!0,r}},e.values=w,B.prototype={constructor:B,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(v),!e)for(var t in this)"t"===t.charAt(0)&&n.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function r(r,n){return a.type="throw",a.arg=e,t.next=r,n&&(t.method="next",t.arg=void 0),!!n}for(var i=this.tryEntries.length-1;i>=0;--i){var o=this.tryEntries[i],a=o.completion;if("root"===o.tryLoc)return r("end");if(o.tryLoc<=this.prev){var s=n.call(o,"catchLoc"),A=n.call(o,"finallyLoc");if(s&&A){if(this.prev<o.catchLoc)return r(o.catchLoc,!0);if(this.prev<o.finallyLoc)return r(o.finallyLoc)}else if(s){if(this.prev<o.catchLoc)return r(o.catchLoc,!0)}else{if(!A)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return r(o.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var o=i;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=e,a.arg=t,o?(this.method="next",this.next=o.finallyLoc,f):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),f},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),v(r),f}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var i=n.arg;v(r)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:w(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),f}},e}("object"===t(e)?e.exports:{});try{regeneratorRuntime=r}catch(e){"object"===("undefined"==typeof globalThis?"undefined":t(globalThis))?globalThis.regeneratorRuntime=r:Function("r","regeneratorRuntime = r")(r)}}).call(this,r(11)(e))},function(e,t,r){var n=r(51),i=r(52),o=0,a=function(){"use strict";function e(){n(this,e)}return i(e,null,[{key:"next",value:function(){return++o}}]),e}();e.exports=a},function(e,t,r){var n=r(85);e.exports=function(e){if(Array.isArray(e))return n(e)},e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t){e.exports=function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)},e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t){e.exports=function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")},e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t,r){var n=r(177),i=r(178),o=r(86),a=r(179);e.exports=function(e,t){return n(e)||i(e,t)||o(e,t)||a()},e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t){e.exports=function(e){if(Array.isArray(e))return e},e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t){e.exports=function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,i,o=[],a=!0,s=!1;try{for(r=r.call(e);!(a=(n=r.next()).done)&&(o.push(n.value),!t||o.length!==t);a=!0);}catch(e){s=!0,i=e}finally{try{a||null==r.return||r.return()}finally{if(s)throw i}}return o}},e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t){e.exports=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")},e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t,r){"use strict";var n=r(4).Buffer;e.exports=function(e){if(e.length>=255)throw new TypeError("Alphabet too long");for(var t=new Uint8Array(256),r=0;r<t.length;r++)t[r]=255;for(var i=0;i<e.length;i++){var o=e.charAt(i),a=o.charCodeAt(0);if(255!==t[a])throw new TypeError(o+" is ambiguous");t[a]=i}var s=e.length,A=e.charAt(0),c=Math.log(s)/Math.log(256),u=Math.log(256)/Math.log(s);function f(e){if("string"!=typeof e)throw new TypeError("Expected String");if(0===e.length)return n.alloc(0);for(var r=0,i=0,o=0;e[r]===A;)i++,r++;for(var a=(e.length-r)*c+1>>>0,u=new Uint8Array(a);e[r];){var f=t[e.charCodeAt(r)];if(255===f)return;for(var h=0,l=a-1;(0!==f||h<o)&&-1!==l;l--,h++)f+=s*u[l]>>>0,u[l]=f%256>>>0,f=f/256>>>0;if(0!==f)throw new Error("Non-zero carry");o=h,r++}for(var g=a-o;g!==a&&0===u[g];)g++;var d=n.allocUnsafe(i+(a-g));d.fill(0,0,i);for(var p=i;g!==a;)d[p++]=u[g++];return d}return{encode:function(t){if((Array.isArray(t)||t instanceof Uint8Array)&&(t=n.from(t)),!n.isBuffer(t))throw new TypeError("Expected Buffer");if(0===t.length)return"";for(var r=0,i=0,o=0,a=t.length;o!==a&&0===t[o];)o++,r++;for(var c=(a-o)*u+1>>>0,f=new Uint8Array(c);o!==a;){for(var h=t[o],l=0,g=c-1;(0!==h||l<i)&&-1!==g;g--,l++)h+=256*f[g]>>>0,f[g]=h%s>>>0,h=h/s>>>0;if(0!==h)throw new Error("Non-zero carry");i=l,o++}for(var d=c-i;d!==c&&0===f[d];)d++;for(var p=A.repeat(r);d<c;++d)p+=e.charAt(f[d]);return p},decodeUnsafe:f,decode:function(e){var t=f(e);if(t)return t;throw new Error("Non-base"+s+" character")}}}},function(e,t,r){var n;function i(e){return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}!function(o){"use strict";var a,s=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,A="function"==typeof Symbol&&"symbol"==i(Symbol.iterator),c=Math.ceil,u=Math.floor,f="[BigNumber Error] ",h=f+"Number primitive has more than 15 significant digits: ",l=1e14,g=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],d=1e9;function p(e){var t=0|e;return e>0||e===t?t:t-1}function I(e){for(var t,r,n=1,i=e.length,o=e[0]+"";n<i;){for(r=14-(t=e[n++]+"").length;r--;t="0"+t);o+=t}for(i=o.length;48===o.charCodeAt(--i););return o.slice(0,i+1||1)}function y(e,t){var r,n,i=e.c,o=t.c,a=e.s,s=t.s,A=e.e,c=t.e;if(!a||!s)return null;if(r=i&&!i[0],n=o&&!o[0],r||n)return r?n?0:-s:a;if(a!=s)return a;if(r=a<0,n=A==c,!i||!o)return n?0:!i^r?1:-1;if(!n)return A>c^r?1:-1;for(s=(A=i.length)<(c=o.length)?A:c,a=0;a<s;a++)if(i[a]!=o[a])return i[a]>o[a]^r?1:-1;return A==c?0:A>c^r?1:-1}function b(e,t,r,n){if(e<t||e>r||e!==u(e))throw Error(f+(n||"Argument")+("number"==typeof e?e<t||e>r?" out of range: ":" not an integer: ":" not a primitive number: ")+String(e))}function E(e){var t=e.c.length-1;return p(e.e/14)==t&&e.c[t]%2!=0}function m(e,t){return(e.length>1?e.charAt(0)+"."+e.slice(1):e)+(t<0?"e":"e+")+t}function C(e,t,r){var n,i;if(t<0){for(i=r+".";++t;i+=r);e=i+e}else if(++t>(n=e.length)){for(i=r,t-=n;--t;i+=r);e+=i}else t<n&&(e=e.slice(0,t)+"."+e.slice(t));return e}(a=function e(t){var r,n,o,a,v,B,w,Q,k,_=L.prototype={constructor:L,toString:null,valueOf:null},S=new L(1),D=20,M=4,R=-7,x=21,O=-1e7,N=1e7,P=!1,F=1,j=0,T={prefix:"",groupSize:3,secondaryGroupSize:0,groupSeparator:",",decimalSeparator:".",fractionGroupSize:0,fractionGroupSeparator:" ",suffix:""},U="0123456789abcdefghijklmnopqrstuvwxyz";function L(e,t){var r,i,a,A,c,f,l,g,d=this;if(!(d instanceof L))return new L(e,t);if(null==t){if(e&&!0===e._isBigNumber)return d.s=e.s,void(!e.c||e.e>N?d.c=d.e=null:e.e<O?d.c=[d.e=0]:(d.e=e.e,d.c=e.c.slice()));if((f="number"==typeof e)&&0*e==0){if(d.s=1/e<0?(e=-e,-1):1,e===~~e){for(A=0,c=e;c>=10;c/=10,A++);return void(A>N?d.c=d.e=null:(d.e=A,d.c=[e]))}g=String(e)}else{if(!s.test(g=String(e)))return o(d,g,f);d.s=45==g.charCodeAt(0)?(g=g.slice(1),-1):1}(A=g.indexOf("."))>-1&&(g=g.replace(".","")),(c=g.search(/e/i))>0?(A<0&&(A=c),A+=+g.slice(c+1),g=g.substring(0,c)):A<0&&(A=g.length)}else{if(b(t,2,U.length,"Base"),10==t)return K(d=new L(e),D+d.e+1,M);if(g=String(e),f="number"==typeof e){if(0*e!=0)return o(d,g,f,t);if(d.s=1/e<0?(g=g.slice(1),-1):1,L.DEBUG&&g.replace(/^0\.0*|\./,"").length>15)throw Error(h+e)}else d.s=45===g.charCodeAt(0)?(g=g.slice(1),-1):1;for(r=U.slice(0,t),A=c=0,l=g.length;c<l;c++)if(r.indexOf(i=g.charAt(c))<0){if("."==i){if(c>A){A=l;continue}}else if(!a&&(g==g.toUpperCase()&&(g=g.toLowerCase())||g==g.toLowerCase()&&(g=g.toUpperCase()))){a=!0,c=-1,A=0;continue}return o(d,String(e),f,t)}f=!1,(A=(g=n(g,t,10,d.s)).indexOf("."))>-1?g=g.replace(".",""):A=g.length}for(c=0;48===g.charCodeAt(c);c++);for(l=g.length;48===g.charCodeAt(--l););if(g=g.slice(c,++l)){if(l-=c,f&&L.DEBUG&&l>15&&(e>9007199254740991||e!==u(e)))throw Error(h+d.s*e);if((A=A-c-1)>N)d.c=d.e=null;else if(A<O)d.c=[d.e=0];else{if(d.e=A,d.c=[],c=(A+1)%14,A<0&&(c+=14),c<l){for(c&&d.c.push(+g.slice(0,c)),l-=14;c<l;)d.c.push(+g.slice(c,c+=14));c=14-(g=g.slice(c)).length}else c-=l;for(;c--;g+="0");d.c.push(+g)}}else d.c=[d.e=0]}function H(e,t,r,n){var i,o,a,s,A;if(null==r?r=M:b(r,0,8),!e.c)return e.toString();if(i=e.c[0],a=e.e,null==t)A=I(e.c),A=1==n||2==n&&(a<=R||a>=x)?m(A,a):C(A,a,"0");else if(o=(e=K(new L(e),t,r)).e,s=(A=I(e.c)).length,1==n||2==n&&(t<=o||o<=R)){for(;s<t;A+="0",s++);A=m(A,o)}else if(t-=a,A=C(A,o,"0"),o+1>s){if(--t>0)for(A+=".";t--;A+="0");}else if((t+=o-s)>0)for(o+1==s&&(A+=".");t--;A+="0");return e.s<0&&i?"-"+A:A}function G(e,t){for(var r,n=1,i=new L(e[0]);n<e.length;n++){if(!(r=new L(e[n])).s){i=r;break}t.call(i,r)&&(i=r)}return i}function Y(e,t,r){for(var n=1,i=t.length;!t[--i];t.pop());for(i=t[0];i>=10;i/=10,n++);return(r=n+14*r-1)>N?e.c=e.e=null:r<O?e.c=[e.e=0]:(e.e=r,e.c=t),e}function K(e,t,r,n){var i,o,a,s,A,f,h,d=e.c,p=g;if(d){e:{for(i=1,s=d[0];s>=10;s/=10,i++);if((o=t-i)<0)o+=14,a=t,h=(A=d[f=0])/p[i-a-1]%10|0;else if((f=c((o+1)/14))>=d.length){if(!n)break e;for(;d.length<=f;d.push(0));A=h=0,i=1,a=(o%=14)-14+1}else{for(A=s=d[f],i=1;s>=10;s/=10,i++);h=(a=(o%=14)-14+i)<0?0:A/p[i-a-1]%10|0}if(n=n||t<0||null!=d[f+1]||(a<0?A:A%p[i-a-1]),n=r<4?(h||n)&&(0==r||r==(e.s<0?3:2)):h>5||5==h&&(4==r||n||6==r&&(o>0?a>0?A/p[i-a]:0:d[f-1])%10&1||r==(e.s<0?8:7)),t<1||!d[0])return d.length=0,n?(t-=e.e+1,d[0]=p[(14-t%14)%14],e.e=-t||0):d[0]=e.e=0,e;if(0==o?(d.length=f,s=1,f--):(d.length=f+1,s=p[14-o],d[f]=a>0?u(A/p[i-a]%p[a])*s:0),n)for(;;){if(0==f){for(o=1,a=d[0];a>=10;a/=10,o++);for(a=d[0]+=s,s=1;a>=10;a/=10,s++);o!=s&&(e.e++,d[0]==l&&(d[0]=1));break}if(d[f]+=s,d[f]!=l)break;d[f--]=0,s=1}for(o=d.length;0===d[--o];d.pop());}e.e>N?e.c=e.e=null:e.e<O&&(e.c=[e.e=0])}return e}function q(e){var t,r=e.e;return null===r?e.toString():(t=I(e.c),t=r<=R||r>=x?m(t,r):C(t,r,"0"),e.s<0?"-"+t:t)}return L.clone=e,L.ROUND_UP=0,L.ROUND_DOWN=1,L.ROUND_CEIL=2,L.ROUND_FLOOR=3,L.ROUND_HALF_UP=4,L.ROUND_HALF_DOWN=5,L.ROUND_HALF_EVEN=6,L.ROUND_HALF_CEIL=7,L.ROUND_HALF_FLOOR=8,L.EUCLID=9,L.config=L.set=function(e){var t,r;if(null!=e){if("object"!=i(e))throw Error(f+"Object expected: "+e);if(e.hasOwnProperty(t="DECIMAL_PLACES")&&(b(r=e[t],0,d,t),D=r),e.hasOwnProperty(t="ROUNDING_MODE")&&(b(r=e[t],0,8,t),M=r),e.hasOwnProperty(t="EXPONENTIAL_AT")&&((r=e[t])&&r.pop?(b(r[0],-d,0,t),b(r[1],0,d,t),R=r[0],x=r[1]):(b(r,-d,d,t),R=-(x=r<0?-r:r))),e.hasOwnProperty(t="RANGE"))if((r=e[t])&&r.pop)b(r[0],-d,-1,t),b(r[1],1,d,t),O=r[0],N=r[1];else{if(b(r,-d,d,t),!r)throw Error(f+t+" cannot be zero: "+r);O=-(N=r<0?-r:r)}if(e.hasOwnProperty(t="CRYPTO")){if((r=e[t])!==!!r)throw Error(f+t+" not true or false: "+r);if(r){if("undefined"==typeof crypto||!crypto||!crypto.getRandomValues&&!crypto.randomBytes)throw P=!r,Error(f+"crypto unavailable");P=r}else P=r}if(e.hasOwnProperty(t="MODULO_MODE")&&(b(r=e[t],0,9,t),F=r),e.hasOwnProperty(t="POW_PRECISION")&&(b(r=e[t],0,d,t),j=r),e.hasOwnProperty(t="FORMAT")){if("object"!=i(r=e[t]))throw Error(f+t+" not an object: "+r);T=r}if(e.hasOwnProperty(t="ALPHABET")){if("string"!=typeof(r=e[t])||/^.$|[+-.\s]|(.).*\1/.test(r))throw Error(f+t+" invalid: "+r);U=r}}return{DECIMAL_PLACES:D,ROUNDING_MODE:M,EXPONENTIAL_AT:[R,x],RANGE:[O,N],CRYPTO:P,MODULO_MODE:F,POW_PRECISION:j,FORMAT:T,ALPHABET:U}},L.isBigNumber=function(e){if(!e||!0!==e._isBigNumber)return!1;if(!L.DEBUG)return!0;var t,r,n=e.c,i=e.e,o=e.s;e:if("[object Array]"=={}.toString.call(n)){if((1===o||-1===o)&&i>=-d&&i<=d&&i===u(i)){if(0===n[0]){if(0===i&&1===n.length)return!0;break e}if((t=(i+1)%14)<1&&(t+=14),String(n[0]).length==t){for(t=0;t<n.length;t++)if((r=n[t])<0||r>=l||r!==u(r))break e;if(0!==r)return!0}}}else if(null===n&&null===i&&(null===o||1===o||-1===o))return!0;throw Error(f+"Invalid BigNumber: "+e)},L.maximum=L.max=function(){return G(arguments,_.lt)},L.minimum=L.min=function(){return G(arguments,_.gt)},L.random=(a=9007199254740992*Math.random()&2097151?function(){return u(9007199254740992*Math.random())}:function(){return 8388608*(1073741824*Math.random()|0)+(8388608*Math.random()|0)},function(e){var t,r,n,i,o,s=0,A=[],h=new L(S);if(null==e?e=D:b(e,0,d),i=c(e/14),P)if(crypto.getRandomValues){for(t=crypto.getRandomValues(new Uint32Array(i*=2));s<i;)(o=131072*t[s]+(t[s+1]>>>11))>=9e15?(r=crypto.getRandomValues(new Uint32Array(2)),t[s]=r[0],t[s+1]=r[1]):(A.push(o%1e14),s+=2);s=i/2}else{if(!crypto.randomBytes)throw P=!1,Error(f+"crypto unavailable");for(t=crypto.randomBytes(i*=7);s<i;)(o=281474976710656*(31&t[s])+1099511627776*t[s+1]+4294967296*t[s+2]+16777216*t[s+3]+(t[s+4]<<16)+(t[s+5]<<8)+t[s+6])>=9e15?crypto.randomBytes(7).copy(t,s):(A.push(o%1e14),s+=7);s=i/7}if(!P)for(;s<i;)(o=a())<9e15&&(A[s++]=o%1e14);for(e%=14,(i=A[--s])&&e&&(o=g[14-e],A[s]=u(i/o)*o);0===A[s];A.pop(),s--);if(s<0)A=[n=0];else{for(n=-1;0===A[0];A.splice(0,1),n-=14);for(s=1,o=A[0];o>=10;o/=10,s++);s<14&&(n-=14-s)}return h.e=n,h.c=A,h}),L.sum=function(){for(var e=1,t=arguments,r=new L(t[0]);e<t.length;)r=r.plus(t[e++]);return r},n=function(){function e(e,t,r,n){for(var i,o,a=[0],s=0,A=e.length;s<A;){for(o=a.length;o--;a[o]*=t);for(a[0]+=n.indexOf(e.charAt(s++)),i=0;i<a.length;i++)a[i]>r-1&&(null==a[i+1]&&(a[i+1]=0),a[i+1]+=a[i]/r|0,a[i]%=r)}return a.reverse()}return function(t,n,i,o,a){var s,A,c,u,f,h,l,g,d=t.indexOf("."),p=D,y=M;for(d>=0&&(u=j,j=0,t=t.replace(".",""),h=(g=new L(n)).pow(t.length-d),j=u,g.c=e(C(I(h.c),h.e,"0"),10,i,"0123456789"),g.e=g.c.length),c=u=(l=e(t,n,i,a?(s=U,"0123456789"):(s="0123456789",U))).length;0==l[--u];l.pop());if(!l[0])return s.charAt(0);if(d<0?--c:(h.c=l,h.e=c,h.s=o,l=(h=r(h,g,p,y,i)).c,f=h.r,c=h.e),d=l[A=c+p+1],u=i/2,f=f||A<0||null!=l[A+1],f=y<4?(null!=d||f)&&(0==y||y==(h.s<0?3:2)):d>u||d==u&&(4==y||f||6==y&&1&l[A-1]||y==(h.s<0?8:7)),A<1||!l[0])t=f?C(s.charAt(1),-p,s.charAt(0)):s.charAt(0);else{if(l.length=A,f)for(--i;++l[--A]>i;)l[A]=0,A||(++c,l=[1].concat(l));for(u=l.length;!l[--u];);for(d=0,t="";d<=u;t+=s.charAt(l[d++]));t=C(t,c,s.charAt(0))}return t}}(),r=function(){function e(e,t,r){var n,i,o,a,s=0,A=e.length,c=t%1e7,u=t/1e7|0;for(e=e.slice();A--;)s=((i=c*(o=e[A]%1e7)+(n=u*o+(a=e[A]/1e7|0)*c)%1e7*1e7+s)/r|0)+(n/1e7|0)+u*a,e[A]=i%r;return s&&(e=[s].concat(e)),e}function t(e,t,r,n){var i,o;if(r!=n)o=r>n?1:-1;else for(i=o=0;i<r;i++)if(e[i]!=t[i]){o=e[i]>t[i]?1:-1;break}return o}function r(e,t,r,n){for(var i=0;r--;)e[r]-=i,i=e[r]<t[r]?1:0,e[r]=i*n+e[r]-t[r];for(;!e[0]&&e.length>1;e.splice(0,1));}return function(n,i,o,a,s){var A,c,f,h,g,d,I,y,b,E,m,C,v,B,w,Q,k,_=n.s==i.s?1:-1,S=n.c,D=i.c;if(!(S&&S[0]&&D&&D[0]))return new L(n.s&&i.s&&(S?!D||S[0]!=D[0]:D)?S&&0==S[0]||!D?0*_:_/0:NaN);for(b=(y=new L(_)).c=[],_=o+(c=n.e-i.e)+1,s||(s=l,c=p(n.e/14)-p(i.e/14),_=_/14|0),f=0;D[f]==(S[f]||0);f++);if(D[f]>(S[f]||0)&&c--,_<0)b.push(1),h=!0;else{for(B=S.length,Q=D.length,f=0,_+=2,(g=u(s/(D[0]+1)))>1&&(D=e(D,g,s),S=e(S,g,s),Q=D.length,B=S.length),v=Q,m=(E=S.slice(0,Q)).length;m<Q;E[m++]=0);k=D.slice(),k=[0].concat(k),w=D[0],D[1]>=s/2&&w++;do{if(g=0,(A=t(D,E,Q,m))<0){if(C=E[0],Q!=m&&(C=C*s+(E[1]||0)),(g=u(C/w))>1)for(g>=s&&(g=s-1),I=(d=e(D,g,s)).length,m=E.length;1==t(d,E,I,m);)g--,r(d,Q<I?k:D,I,s),I=d.length,A=1;else 0==g&&(A=g=1),I=(d=D.slice()).length;if(I<m&&(d=[0].concat(d)),r(E,d,m,s),m=E.length,-1==A)for(;t(D,E,Q,m)<1;)g++,r(E,Q<m?k:D,m,s),m=E.length}else 0===A&&(g++,E=[0]);b[f++]=g,E[0]?E[m++]=S[v]||0:(E=[S[v]],m=1)}while((v++<B||null!=E[0])&&_--);h=null!=E[0],b[0]||b.splice(0,1)}if(s==l){for(f=1,_=b[0];_>=10;_/=10,f++);K(y,o+(y.e=f+14*c-1)+1,a,h)}else y.e=c,y.r=+h;return y}}(),v=/^(-?)0([xbo])(?=\w[\w.]*$)/i,B=/^([^.]+)\.$/,w=/^\.([^.]+)$/,Q=/^-?(Infinity|NaN)$/,k=/^\s*\+(?=[\w.])|^\s+|\s+$/g,o=function(e,t,r,n){var i,o=r?t:t.replace(k,"");if(Q.test(o))e.s=isNaN(o)?null:o<0?-1:1;else{if(!r&&(o=o.replace(v,(function(e,t,r){return i="x"==(r=r.toLowerCase())?16:"b"==r?2:8,n&&n!=i?e:t})),n&&(i=n,o=o.replace(B,"$1").replace(w,"0.$1")),t!=o))return new L(o,i);if(L.DEBUG)throw Error(f+"Not a"+(n?" base "+n:"")+" number: "+t);e.s=null}e.c=e.e=null},_.absoluteValue=_.abs=function(){var e=new L(this);return e.s<0&&(e.s=1),e},_.comparedTo=function(e,t){return y(this,new L(e,t))},_.decimalPlaces=_.dp=function(e,t){var r,n,i,o=this;if(null!=e)return b(e,0,d),null==t?t=M:b(t,0,8),K(new L(o),e+o.e+1,t);if(!(r=o.c))return null;if(n=14*((i=r.length-1)-p(this.e/14)),i=r[i])for(;i%10==0;i/=10,n--);return n<0&&(n=0),n},_.dividedBy=_.div=function(e,t){return r(this,new L(e,t),D,M)},_.dividedToIntegerBy=_.idiv=function(e,t){return r(this,new L(e,t),0,1)},_.exponentiatedBy=_.pow=function(e,t){var r,n,i,o,a,s,A,h,l=this;if((e=new L(e)).c&&!e.isInteger())throw Error(f+"Exponent not an integer: "+q(e));if(null!=t&&(t=new L(t)),a=e.e>14,!l.c||!l.c[0]||1==l.c[0]&&!l.e&&1==l.c.length||!e.c||!e.c[0])return h=new L(Math.pow(+q(l),a?2-E(e):+q(e))),t?h.mod(t):h;if(s=e.s<0,t){if(t.c?!t.c[0]:!t.s)return new L(NaN);(n=!s&&l.isInteger()&&t.isInteger())&&(l=l.mod(t))}else{if(e.e>9&&(l.e>0||l.e<-1||(0==l.e?l.c[0]>1||a&&l.c[1]>=24e7:l.c[0]<8e13||a&&l.c[0]<=9999975e7)))return o=l.s<0&&E(e)?-0:0,l.e>-1&&(o=1/o),new L(s?1/o:o);j&&(o=c(j/14+2))}for(a?(r=new L(.5),s&&(e.s=1),A=E(e)):A=(i=Math.abs(+q(e)))%2,h=new L(S);;){if(A){if(!(h=h.times(l)).c)break;o?h.c.length>o&&(h.c.length=o):n&&(h=h.mod(t))}if(i){if(0===(i=u(i/2)))break;A=i%2}else if(K(e=e.times(r),e.e+1,1),e.e>14)A=E(e);else{if(0===(i=+q(e)))break;A=i%2}l=l.times(l),o?l.c&&l.c.length>o&&(l.c.length=o):n&&(l=l.mod(t))}return n?h:(s&&(h=S.div(h)),t?h.mod(t):o?K(h,j,M,void 0):h)},_.integerValue=function(e){var t=new L(this);return null==e?e=M:b(e,0,8),K(t,t.e+1,e)},_.isEqualTo=_.eq=function(e,t){return 0===y(this,new L(e,t))},_.isFinite=function(){return!!this.c},_.isGreaterThan=_.gt=function(e,t){return y(this,new L(e,t))>0},_.isGreaterThanOrEqualTo=_.gte=function(e,t){return 1===(t=y(this,new L(e,t)))||0===t},_.isInteger=function(){return!!this.c&&p(this.e/14)>this.c.length-2},_.isLessThan=_.lt=function(e,t){return y(this,new L(e,t))<0},_.isLessThanOrEqualTo=_.lte=function(e,t){return-1===(t=y(this,new L(e,t)))||0===t},_.isNaN=function(){return!this.s},_.isNegative=function(){return this.s<0},_.isPositive=function(){return this.s>0},_.isZero=function(){return!!this.c&&0==this.c[0]},_.minus=function(e,t){var r,n,i,o,a=this,s=a.s;if(t=(e=new L(e,t)).s,!s||!t)return new L(NaN);if(s!=t)return e.s=-t,a.plus(e);var A=a.e/14,c=e.e/14,u=a.c,f=e.c;if(!A||!c){if(!u||!f)return u?(e.s=-t,e):new L(f?a:NaN);if(!u[0]||!f[0])return f[0]?(e.s=-t,e):new L(u[0]?a:3==M?-0:0)}if(A=p(A),c=p(c),u=u.slice(),s=A-c){for((o=s<0)?(s=-s,i=u):(c=A,i=f),i.reverse(),t=s;t--;i.push(0));i.reverse()}else for(n=(o=(s=u.length)<(t=f.length))?s:t,s=t=0;t<n;t++)if(u[t]!=f[t]){o=u[t]<f[t];break}if(o&&(i=u,u=f,f=i,e.s=-e.s),(t=(n=f.length)-(r=u.length))>0)for(;t--;u[r++]=0);for(t=l-1;n>s;){if(u[--n]<f[n]){for(r=n;r&&!u[--r];u[r]=t);--u[r],u[n]+=l}u[n]-=f[n]}for(;0==u[0];u.splice(0,1),--c);return u[0]?Y(e,u,c):(e.s=3==M?-1:1,e.c=[e.e=0],e)},_.modulo=_.mod=function(e,t){var n,i,o=this;return e=new L(e,t),!o.c||!e.s||e.c&&!e.c[0]?new L(NaN):!e.c||o.c&&!o.c[0]?new L(o):(9==F?(i=e.s,e.s=1,n=r(o,e,0,3),e.s=i,n.s*=i):n=r(o,e,0,F),(e=o.minus(n.times(e))).c[0]||1!=F||(e.s=o.s),e)},_.multipliedBy=_.times=function(e,t){var r,n,i,o,a,s,A,c,u,f,h,g,d,I,y=this,b=y.c,E=(e=new L(e,t)).c;if(!(b&&E&&b[0]&&E[0]))return!y.s||!e.s||b&&!b[0]&&!E||E&&!E[0]&&!b?e.c=e.e=e.s=null:(e.s*=y.s,b&&E?(e.c=[0],e.e=0):e.c=e.e=null),e;for(n=p(y.e/14)+p(e.e/14),e.s*=y.s,(A=b.length)<(f=E.length)&&(d=b,b=E,E=d,i=A,A=f,f=i),i=A+f,d=[];i--;d.push(0));for(I=l,1e7,i=f;--i>=0;){for(r=0,h=E[i]%1e7,g=E[i]/1e7|0,o=i+(a=A);o>i;)r=((c=h*(c=b[--a]%1e7)+(s=g*c+(u=b[a]/1e7|0)*h)%1e7*1e7+d[o]+r)/I|0)+(s/1e7|0)+g*u,d[o--]=c%I;d[o]=r}return r?++n:d.splice(0,1),Y(e,d,n)},_.negated=function(){var e=new L(this);return e.s=-e.s||null,e},_.plus=function(e,t){var r,n=this,i=n.s;if(t=(e=new L(e,t)).s,!i||!t)return new L(NaN);if(i!=t)return e.s=-t,n.minus(e);var o=n.e/14,a=e.e/14,s=n.c,A=e.c;if(!o||!a){if(!s||!A)return new L(i/0);if(!s[0]||!A[0])return A[0]?e:new L(s[0]?n:0*i)}if(o=p(o),a=p(a),s=s.slice(),i=o-a){for(i>0?(a=o,r=A):(i=-i,r=s),r.reverse();i--;r.push(0));r.reverse()}for((i=s.length)-(t=A.length)<0&&(r=A,A=s,s=r,t=i),i=0;t;)i=(s[--t]=s[t]+A[t]+i)/l|0,s[t]=l===s[t]?0:s[t]%l;return i&&(s=[i].concat(s),++a),Y(e,s,a)},_.precision=_.sd=function(e,t){var r,n,i,o=this;if(null!=e&&e!==!!e)return b(e,1,d),null==t?t=M:b(t,0,8),K(new L(o),e,t);if(!(r=o.c))return null;if(n=14*(i=r.length-1)+1,i=r[i]){for(;i%10==0;i/=10,n--);for(i=r[0];i>=10;i/=10,n++);}return e&&o.e+1>n&&(n=o.e+1),n},_.shiftedBy=function(e){return b(e,-9007199254740991,9007199254740991),this.times("1e"+e)},_.squareRoot=_.sqrt=function(){var e,t,n,i,o,a=this,s=a.c,A=a.s,c=a.e,u=D+4,f=new L("0.5");if(1!==A||!s||!s[0])return new L(!A||A<0&&(!s||s[0])?NaN:s?a:1/0);if(0==(A=Math.sqrt(+q(a)))||A==1/0?(((t=I(s)).length+c)%2==0&&(t+="0"),A=Math.sqrt(+t),c=p((c+1)/2)-(c<0||c%2),n=new L(t=A==1/0?"1e"+c:(t=A.toExponential()).slice(0,t.indexOf("e")+1)+c)):n=new L(A+""),n.c[0])for((A=(c=n.e)+u)<3&&(A=0);;)if(o=n,n=f.times(o.plus(r(a,o,u,1))),I(o.c).slice(0,A)===(t=I(n.c)).slice(0,A)){if(n.e<c&&--A,"9999"!=(t=t.slice(A-3,A+1))&&(i||"4999"!=t)){+t&&(+t.slice(1)||"5"!=t.charAt(0))||(K(n,n.e+D+2,1),e=!n.times(n).eq(a));break}if(!i&&(K(o,o.e+D+2,0),o.times(o).eq(a))){n=o;break}u+=4,A+=4,i=1}return K(n,n.e+D+1,M,e)},_.toExponential=function(e,t){return null!=e&&(b(e,0,d),e++),H(this,e,t,1)},_.toFixed=function(e,t){return null!=e&&(b(e,0,d),e=e+this.e+1),H(this,e,t)},_.toFormat=function(e,t,r){var n,o=this;if(null==r)null!=e&&t&&"object"==i(t)?(r=t,t=null):e&&"object"==i(e)?(r=e,e=t=null):r=T;else if("object"!=i(r))throw Error(f+"Argument not an object: "+r);if(n=o.toFixed(e,t),o.c){var a,s=n.split("."),A=+r.groupSize,c=+r.secondaryGroupSize,u=r.groupSeparator||"",h=s[0],l=s[1],g=o.s<0,d=g?h.slice(1):h,p=d.length;if(c&&(a=A,A=c,c=a,p-=a),A>0&&p>0){for(a=p%A||A,h=d.substr(0,a);a<p;a+=A)h+=u+d.substr(a,A);c>0&&(h+=u+d.slice(a)),g&&(h="-"+h)}n=l?h+(r.decimalSeparator||"")+((c=+r.fractionGroupSize)?l.replace(new RegExp("\\d{"+c+"}\\B","g"),"$&"+(r.fractionGroupSeparator||"")):l):h}return(r.prefix||"")+n+(r.suffix||"")},_.toFraction=function(e){var t,n,i,o,a,s,A,c,u,h,l,d,p=this,y=p.c;if(null!=e&&(!(A=new L(e)).isInteger()&&(A.c||1!==A.s)||A.lt(S)))throw Error(f+"Argument "+(A.isInteger()?"out of range: ":"not an integer: ")+q(A));if(!y)return new L(p);for(t=new L(S),u=n=new L(S),i=c=new L(S),d=I(y),a=t.e=d.length-p.e-1,t.c[0]=g[(s=a%14)<0?14+s:s],e=!e||A.comparedTo(t)>0?a>0?t:u:A,s=N,N=1/0,A=new L(d),c.c[0]=0;h=r(A,t,0,1),1!=(o=n.plus(h.times(i))).comparedTo(e);)n=i,i=o,u=c.plus(h.times(o=u)),c=o,t=A.minus(h.times(o=t)),A=o;return o=r(e.minus(n),i,0,1),c=c.plus(o.times(u)),n=n.plus(o.times(i)),c.s=u.s=p.s,l=r(u,i,a*=2,M).minus(p).abs().comparedTo(r(c,n,a,M).minus(p).abs())<1?[u,i]:[c,n],N=s,l},_.toNumber=function(){return+q(this)},_.toPrecision=function(e,t){return null!=e&&b(e,1,d),H(this,e,t,2)},_.toString=function(e){var t,r=this,i=r.s,o=r.e;return null===o?i?(t="Infinity",i<0&&(t="-"+t)):t="NaN":(null==e?t=o<=R||o>=x?m(I(r.c),o):C(I(r.c),o,"0"):10===e?t=C(I((r=K(new L(r),D+o+1,M)).c),r.e,"0"):(b(e,2,U.length,"Base"),t=n(C(I(r.c),o,"0"),10,e,i,!0)),i<0&&r.c[0]&&(t="-"+t)),t},_.valueOf=_.toJSON=function(){return q(this)},_._isBigNumber=!0,A&&(_[Symbol.toStringTag]="BigNumber",_[Symbol.for("nodejs.util.inspect.custom")]=_.valueOf),null!=t&&L.set(t),L}()).default=a.BigNumber=a,void 0===(n=function(){return a}.call(t,r,t,e))||(e.exports=n)}()},function(e,t,r){e.exports={encode:r(183),decode:r(184),encodingLength:r(185)}},function(e,t){e.exports=function e(t,n,i){n=n||[];var o=i=i||0;for(;t>=r;)n[i++]=255&t|128,t/=128;for(;-128&t;)n[i++]=255&t|128,t>>>=7;return n[i]=0|t,e.bytes=i-o+1,n};var r=Math.pow(2,31)},function(e,t){e.exports=function e(t,r){var n,i=0,o=0,a=r=r||0,s=t.length;do{if(a>=s)throw e.bytes=0,new RangeError("Could not decode varint");n=t[a++],i+=o<28?(127&n)<<o:(127&n)*Math.pow(2,o),o+=7}while(n>=128);return e.bytes=a-r,i}},function(e,t){var r=Math.pow(2,7),n=Math.pow(2,14),i=Math.pow(2,21),o=Math.pow(2,28),a=Math.pow(2,35),s=Math.pow(2,42),A=Math.pow(2,49),c=Math.pow(2,56),u=Math.pow(2,63);e.exports=function(e){return e<r?1:e<n?2:e<i?3:e<o?4:e<a?5:e<s?6:e<A?7:e<c?8:e<u?9:10}},function(e,t,r){"use strict";r.r(t),r.d(t,"Deflate",(function(){return zt})),r.d(t,"Inflate",(function(){return Xt})),r.d(t,"constants",(function(){return rr})),r.d(t,"default",(function(){return nr})),r.d(t,"deflate",(function(){return Vt})),r.d(t,"deflateRaw",(function(){return Zt})),r.d(t,"gzip",(function(){return Wt})),r.d(t,"inflate",(function(){return $t})),r.d(t,"inflateRaw",(function(){return er})),r.d(t,"ungzip",(function(){return tr}));function n(e){let t=e.length;for(;--t>=0;)e[t]=0}const i=new Uint8Array([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0]),o=new Uint8Array([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13]),a=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),s=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),A=new Array(576);n(A);const c=new Array(60);n(c);const u=new Array(512);n(u);const f=new Array(256);n(f);const h=new Array(29);n(h);const l=new Array(30);function g(e,t,r,n,i){this.static_tree=e,this.extra_bits=t,this.extra_base=r,this.elems=n,this.max_length=i,this.has_stree=e&&e.length}let d,p,I;function y(e,t){this.dyn_tree=e,this.max_code=0,this.stat_desc=t}n(l);const b=e=>e<256?u[e]:u[256+(e>>>7)],E=(e,t)=>{e.pending_buf[e.pending++]=255&t,e.pending_buf[e.pending++]=t>>>8&255},m=(e,t,r)=>{e.bi_valid>16-r?(e.bi_buf|=t<<e.bi_valid&65535,E(e,e.bi_buf),e.bi_buf=t>>16-e.bi_valid,e.bi_valid+=r-16):(e.bi_buf|=t<<e.bi_valid&65535,e.bi_valid+=r)},C=(e,t,r)=>{m(e,r[2*t],r[2*t+1])},v=(e,t)=>{let r=0;do{r|=1&e,e>>>=1,r<<=1}while(--t>0);return r>>>1},B=(e,t,r)=>{const n=new Array(16);let i,o,a=0;for(i=1;i<=15;i++)n[i]=a=a+r[i-1]<<1;for(o=0;o<=t;o++){let t=e[2*o+1];0!==t&&(e[2*o]=v(n[t]++,t))}},w=e=>{let t;for(t=0;t<286;t++)e.dyn_ltree[2*t]=0;for(t=0;t<30;t++)e.dyn_dtree[2*t]=0;for(t=0;t<19;t++)e.bl_tree[2*t]=0;e.dyn_ltree[512]=1,e.opt_len=e.static_len=0,e.last_lit=e.matches=0},Q=e=>{e.bi_valid>8?E(e,e.bi_buf):e.bi_valid>0&&(e.pending_buf[e.pending++]=e.bi_buf),e.bi_buf=0,e.bi_valid=0},k=(e,t,r,n)=>{const i=2*t,o=2*r;return e[i]<e[o]||e[i]===e[o]&&n[t]<=n[r]},_=(e,t,r)=>{const n=e.heap[r];let i=r<<1;for(;i<=e.heap_len&&(i<e.heap_len&&k(t,e.heap[i+1],e.heap[i],e.depth)&&i++,!k(t,n,e.heap[i],e.depth));)e.heap[r]=e.heap[i],r=i,i<<=1;e.heap[r]=n},S=(e,t,r)=>{let n,a,s,A,c=0;if(0!==e.last_lit)do{n=e.pending_buf[e.d_buf+2*c]<<8|e.pending_buf[e.d_buf+2*c+1],a=e.pending_buf[e.l_buf+c],c++,0===n?C(e,a,t):(s=f[a],C(e,s+256+1,t),A=i[s],0!==A&&(a-=h[s],m(e,a,A)),n--,s=b(n),C(e,s,r),A=o[s],0!==A&&(n-=l[s],m(e,n,A)))}while(c<e.last_lit);C(e,256,t)},D=(e,t)=>{const r=t.dyn_tree,n=t.stat_desc.static_tree,i=t.stat_desc.has_stree,o=t.stat_desc.elems;let a,s,A,c=-1;for(e.heap_len=0,e.heap_max=573,a=0;a<o;a++)0!==r[2*a]?(e.heap[++e.heap_len]=c=a,e.depth[a]=0):r[2*a+1]=0;for(;e.heap_len<2;)A=e.heap[++e.heap_len]=c<2?++c:0,r[2*A]=1,e.depth[A]=0,e.opt_len--,i&&(e.static_len-=n[2*A+1]);for(t.max_code=c,a=e.heap_len>>1;a>=1;a--)_(e,r,a);A=o;do{a=e.heap[1],e.heap[1]=e.heap[e.heap_len--],_(e,r,1),s=e.heap[1],e.heap[--e.heap_max]=a,e.heap[--e.heap_max]=s,r[2*A]=r[2*a]+r[2*s],e.depth[A]=(e.depth[a]>=e.depth[s]?e.depth[a]:e.depth[s])+1,r[2*a+1]=r[2*s+1]=A,e.heap[1]=A++,_(e,r,1)}while(e.heap_len>=2);e.heap[--e.heap_max]=e.heap[1],((e,t)=>{const r=t.dyn_tree,n=t.max_code,i=t.stat_desc.static_tree,o=t.stat_desc.has_stree,a=t.stat_desc.extra_bits,s=t.stat_desc.extra_base,A=t.stat_desc.max_length;let c,u,f,h,l,g,d=0;for(h=0;h<=15;h++)e.bl_count[h]=0;for(r[2*e.heap[e.heap_max]+1]=0,c=e.heap_max+1;c<573;c++)u=e.heap[c],h=r[2*r[2*u+1]+1]+1,h>A&&(h=A,d++),r[2*u+1]=h,u>n||(e.bl_count[h]++,l=0,u>=s&&(l=a[u-s]),g=r[2*u],e.opt_len+=g*(h+l),o&&(e.static_len+=g*(i[2*u+1]+l)));if(0!==d){do{for(h=A-1;0===e.bl_count[h];)h--;e.bl_count[h]--,e.bl_count[h+1]+=2,e.bl_count[A]--,d-=2}while(d>0);for(h=A;0!==h;h--)for(u=e.bl_count[h];0!==u;)f=e.heap[--c],f>n||(r[2*f+1]!==h&&(e.opt_len+=(h-r[2*f+1])*r[2*f],r[2*f+1]=h),u--)}})(e,t),B(r,c,e.bl_count)},M=(e,t,r)=>{let n,i,o=-1,a=t[1],s=0,A=7,c=4;for(0===a&&(A=138,c=3),t[2*(r+1)+1]=65535,n=0;n<=r;n++)i=a,a=t[2*(n+1)+1],++s<A&&i===a||(s<c?e.bl_tree[2*i]+=s:0!==i?(i!==o&&e.bl_tree[2*i]++,e.bl_tree[32]++):s<=10?e.bl_tree[34]++:e.bl_tree[36]++,s=0,o=i,0===a?(A=138,c=3):i===a?(A=6,c=3):(A=7,c=4))},R=(e,t,r)=>{let n,i,o=-1,a=t[1],s=0,A=7,c=4;for(0===a&&(A=138,c=3),n=0;n<=r;n++)if(i=a,a=t[2*(n+1)+1],!(++s<A&&i===a)){if(s<c)do{C(e,i,e.bl_tree)}while(0!=--s);else 0!==i?(i!==o&&(C(e,i,e.bl_tree),s--),C(e,16,e.bl_tree),m(e,s-3,2)):s<=10?(C(e,17,e.bl_tree),m(e,s-3,3)):(C(e,18,e.bl_tree),m(e,s-11,7));s=0,o=i,0===a?(A=138,c=3):i===a?(A=6,c=3):(A=7,c=4)}};let x=!1;const O=(e,t,r,n)=>{m(e,0+(n?1:0),3),((e,t,r,n)=>{Q(e),n&&(E(e,r),E(e,~r)),e.pending_buf.set(e.window.subarray(t,t+r),e.pending),e.pending+=r})(e,t,r,!0)};var N={_tr_init:e=>{x||((()=>{let e,t,r,n,s;const y=new Array(16);for(r=0,n=0;n<28;n++)for(h[n]=r,e=0;e<1<<i[n];e++)f[r++]=n;for(f[r-1]=n,s=0,n=0;n<16;n++)for(l[n]=s,e=0;e<1<<o[n];e++)u[s++]=n;for(s>>=7;n<30;n++)for(l[n]=s<<7,e=0;e<1<<o[n]-7;e++)u[256+s++]=n;for(t=0;t<=15;t++)y[t]=0;for(e=0;e<=143;)A[2*e+1]=8,e++,y[8]++;for(;e<=255;)A[2*e+1]=9,e++,y[9]++;for(;e<=279;)A[2*e+1]=7,e++,y[7]++;for(;e<=287;)A[2*e+1]=8,e++,y[8]++;for(B(A,287,y),e=0;e<30;e++)c[2*e+1]=5,c[2*e]=v(e,5);d=new g(A,i,257,286,15),p=new g(c,o,0,30,15),I=new g(new Array(0),a,0,19,7)})(),x=!0),e.l_desc=new y(e.dyn_ltree,d),e.d_desc=new y(e.dyn_dtree,p),e.bl_desc=new y(e.bl_tree,I),e.bi_buf=0,e.bi_valid=0,w(e)},_tr_stored_block:O,_tr_flush_block:(e,t,r,n)=>{let i,o,a=0;e.level>0?(2===e.strm.data_type&&(e.strm.data_type=(e=>{let t,r=4093624447;for(t=0;t<=31;t++,r>>>=1)if(1&r&&0!==e.dyn_ltree[2*t])return 0;if(0!==e.dyn_ltree[18]||0!==e.dyn_ltree[20]||0!==e.dyn_ltree[26])return 1;for(t=32;t<256;t++)if(0!==e.dyn_ltree[2*t])return 1;return 0})(e)),D(e,e.l_desc),D(e,e.d_desc),a=(e=>{let t;for(M(e,e.dyn_ltree,e.l_desc.max_code),M(e,e.dyn_dtree,e.d_desc.max_code),D(e,e.bl_desc),t=18;t>=3&&0===e.bl_tree[2*s[t]+1];t--);return e.opt_len+=3*(t+1)+5+5+4,t})(e),i=e.opt_len+3+7>>>3,o=e.static_len+3+7>>>3,o<=i&&(i=o)):i=o=r+5,r+4<=i&&-1!==t?O(e,t,r,n):4===e.strategy||o===i?(m(e,2+(n?1:0),3),S(e,A,c)):(m(e,4+(n?1:0),3),((e,t,r,n)=>{let i;for(m(e,t-257,5),m(e,r-1,5),m(e,n-4,4),i=0;i<n;i++)m(e,e.bl_tree[2*s[i]+1],3);R(e,e.dyn_ltree,t-1),R(e,e.dyn_dtree,r-1)})(e,e.l_desc.max_code+1,e.d_desc.max_code+1,a+1),S(e,e.dyn_ltree,e.dyn_dtree)),w(e),n&&Q(e)},_tr_tally:(e,t,r)=>(e.pending_buf[e.d_buf+2*e.last_lit]=t>>>8&255,e.pending_buf[e.d_buf+2*e.last_lit+1]=255&t,e.pending_buf[e.l_buf+e.last_lit]=255&r,e.last_lit++,0===t?e.dyn_ltree[2*r]++:(e.matches++,t--,e.dyn_ltree[2*(f[r]+256+1)]++,e.dyn_dtree[2*b(t)]++),e.last_lit===e.lit_bufsize-1),_tr_align:e=>{m(e,2,3),C(e,256,A),(e=>{16===e.bi_valid?(E(e,e.bi_buf),e.bi_buf=0,e.bi_valid=0):e.bi_valid>=8&&(e.pending_buf[e.pending++]=255&e.bi_buf,e.bi_buf>>=8,e.bi_valid-=8)})(e)}};var P=(e,t,r,n)=>{let i=65535&e|0,o=e>>>16&65535|0,a=0;for(;0!==r;){a=r>2e3?2e3:r,r-=a;do{i=i+t[n++]|0,o=o+i|0}while(--a);i%=65521,o%=65521}return i|o<<16|0};const F=new Uint32Array((()=>{let e,t=[];for(var r=0;r<256;r++){e=r;for(var n=0;n<8;n++)e=1&e?3988292384^e>>>1:e>>>1;t[r]=e}return t})());var j=(e,t,r,n)=>{const i=F,o=n+r;e^=-1;for(let r=n;r<o;r++)e=e>>>8^i[255&(e^t[r])];return-1^e},T={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"},U={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8};const{_tr_init:L,_tr_stored_block:H,_tr_flush_block:G,_tr_tally:Y,_tr_align:K}=N,{Z_NO_FLUSH:q,Z_PARTIAL_FLUSH:J,Z_FULL_FLUSH:z,Z_FINISH:V,Z_BLOCK:Z,Z_OK:W,Z_STREAM_END:X,Z_STREAM_ERROR:$,Z_DATA_ERROR:ee,Z_BUF_ERROR:te,Z_DEFAULT_COMPRESSION:re,Z_FILTERED:ne,Z_HUFFMAN_ONLY:ie,Z_RLE:oe,Z_FIXED:ae,Z_DEFAULT_STRATEGY:se,Z_UNKNOWN:Ae,Z_DEFLATED:ce}=U,ue=(e,t)=>(e.msg=T[t],t),fe=e=>(e<<1)-(e>4?9:0),he=e=>{let t=e.length;for(;--t>=0;)e[t]=0};let le=(e,t,r)=>(t<<e.hash_shift^r)&e.hash_mask;const ge=e=>{const t=e.state;let r=t.pending;r>e.avail_out&&(r=e.avail_out),0!==r&&(e.output.set(t.pending_buf.subarray(t.pending_out,t.pending_out+r),e.next_out),e.next_out+=r,t.pending_out+=r,e.total_out+=r,e.avail_out-=r,t.pending-=r,0===t.pending&&(t.pending_out=0))},de=(e,t)=>{G(e,e.block_start>=0?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,ge(e.strm)},pe=(e,t)=>{e.pending_buf[e.pending++]=t},Ie=(e,t)=>{e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=255&t},ye=(e,t,r,n)=>{let i=e.avail_in;return i>n&&(i=n),0===i?0:(e.avail_in-=i,t.set(e.input.subarray(e.next_in,e.next_in+i),r),1===e.state.wrap?e.adler=P(e.adler,t,i,r):2===e.state.wrap&&(e.adler=j(e.adler,t,i,r)),e.next_in+=i,e.total_in+=i,i)},be=(e,t)=>{let r,n,i=e.max_chain_length,o=e.strstart,a=e.prev_length,s=e.nice_match;const A=e.strstart>e.w_size-262?e.strstart-(e.w_size-262):0,c=e.window,u=e.w_mask,f=e.prev,h=e.strstart+258;let l=c[o+a-1],g=c[o+a];e.prev_length>=e.good_match&&(i>>=2),s>e.lookahead&&(s=e.lookahead);do{if(r=t,c[r+a]===g&&c[r+a-1]===l&&c[r]===c[o]&&c[++r]===c[o+1]){o+=2,r++;do{}while(c[++o]===c[++r]&&c[++o]===c[++r]&&c[++o]===c[++r]&&c[++o]===c[++r]&&c[++o]===c[++r]&&c[++o]===c[++r]&&c[++o]===c[++r]&&c[++o]===c[++r]&&o<h);if(n=258-(h-o),o=h-258,n>a){if(e.match_start=t,a=n,n>=s)break;l=c[o+a-1],g=c[o+a]}}}while((t=f[t&u])>A&&0!=--i);return a<=e.lookahead?a:e.lookahead},Ee=e=>{const t=e.w_size;let r,n,i,o,a;do{if(o=e.window_size-e.lookahead-e.strstart,e.strstart>=t+(t-262)){e.window.set(e.window.subarray(t,t+t),0),e.match_start-=t,e.strstart-=t,e.block_start-=t,n=e.hash_size,r=n;do{i=e.head[--r],e.head[r]=i>=t?i-t:0}while(--n);n=t,r=n;do{i=e.prev[--r],e.prev[r]=i>=t?i-t:0}while(--n);o+=t}if(0===e.strm.avail_in)break;if(n=ye(e.strm,e.window,e.strstart+e.lookahead,o),e.lookahead+=n,e.lookahead+e.insert>=3)for(a=e.strstart-e.insert,e.ins_h=e.window[a],e.ins_h=le(e,e.ins_h,e.window[a+1]);e.insert&&(e.ins_h=le(e,e.ins_h,e.window[a+3-1]),e.prev[a&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=a,a++,e.insert--,!(e.lookahead+e.insert<3)););}while(e.lookahead<262&&0!==e.strm.avail_in)},me=(e,t)=>{let r,n;for(;;){if(e.lookahead<262){if(Ee(e),e.lookahead<262&&t===q)return 1;if(0===e.lookahead)break}if(r=0,e.lookahead>=3&&(e.ins_h=le(e,e.ins_h,e.window[e.strstart+3-1]),r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),0!==r&&e.strstart-r<=e.w_size-262&&(e.match_length=be(e,r)),e.match_length>=3)if(n=Y(e,e.strstart-e.match_start,e.match_length-3),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=3){e.match_length--;do{e.strstart++,e.ins_h=le(e,e.ins_h,e.window[e.strstart+3-1]),r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart}while(0!=--e.match_length);e.strstart++}else e.strstart+=e.match_length,e.match_length=0,e.ins_h=e.window[e.strstart],e.ins_h=le(e,e.ins_h,e.window[e.strstart+1]);else n=Y(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++;if(n&&(de(e,!1),0===e.strm.avail_out))return 1}return e.insert=e.strstart<2?e.strstart:2,t===V?(de(e,!0),0===e.strm.avail_out?3:4):e.last_lit&&(de(e,!1),0===e.strm.avail_out)?1:2},Ce=(e,t)=>{let r,n,i;for(;;){if(e.lookahead<262){if(Ee(e),e.lookahead<262&&t===q)return 1;if(0===e.lookahead)break}if(r=0,e.lookahead>=3&&(e.ins_h=le(e,e.ins_h,e.window[e.strstart+3-1]),r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),e.prev_length=e.match_length,e.prev_match=e.match_start,e.match_length=2,0!==r&&e.prev_length<e.max_lazy_match&&e.strstart-r<=e.w_size-262&&(e.match_length=be(e,r),e.match_length<=5&&(e.strategy===ne||3===e.match_length&&e.strstart-e.match_start>4096)&&(e.match_length=2)),e.prev_length>=3&&e.match_length<=e.prev_length){i=e.strstart+e.lookahead-3,n=Y(e,e.strstart-1-e.prev_match,e.prev_length-3),e.lookahead-=e.prev_length-1,e.prev_length-=2;do{++e.strstart<=i&&(e.ins_h=le(e,e.ins_h,e.window[e.strstart+3-1]),r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart)}while(0!=--e.prev_length);if(e.match_available=0,e.match_length=2,e.strstart++,n&&(de(e,!1),0===e.strm.avail_out))return 1}else if(e.match_available){if(n=Y(e,0,e.window[e.strstart-1]),n&&de(e,!1),e.strstart++,e.lookahead--,0===e.strm.avail_out)return 1}else e.match_available=1,e.strstart++,e.lookahead--}return e.match_available&&(n=Y(e,0,e.window[e.strstart-1]),e.match_available=0),e.insert=e.strstart<2?e.strstart:2,t===V?(de(e,!0),0===e.strm.avail_out?3:4):e.last_lit&&(de(e,!1),0===e.strm.avail_out)?1:2};function ve(e,t,r,n,i){this.good_length=e,this.max_lazy=t,this.nice_length=r,this.max_chain=n,this.func=i}const Be=[new ve(0,0,0,0,(e,t)=>{let r=65535;for(r>e.pending_buf_size-5&&(r=e.pending_buf_size-5);;){if(e.lookahead<=1){if(Ee(e),0===e.lookahead&&t===q)return 1;if(0===e.lookahead)break}e.strstart+=e.lookahead,e.lookahead=0;const n=e.block_start+r;if((0===e.strstart||e.strstart>=n)&&(e.lookahead=e.strstart-n,e.strstart=n,de(e,!1),0===e.strm.avail_out))return 1;if(e.strstart-e.block_start>=e.w_size-262&&(de(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,t===V?(de(e,!0),0===e.strm.avail_out?3:4):(e.strstart>e.block_start&&(de(e,!1),e.strm.avail_out),1)}),new ve(4,4,8,4,me),new ve(4,5,16,8,me),new ve(4,6,32,32,me),new ve(4,4,16,16,Ce),new ve(8,16,32,32,Ce),new ve(8,16,128,128,Ce),new ve(8,32,128,256,Ce),new ve(32,128,258,1024,Ce),new ve(32,258,258,4096,Ce)];function we(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=ce,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new Uint16Array(1146),this.dyn_dtree=new Uint16Array(122),this.bl_tree=new Uint16Array(78),he(this.dyn_ltree),he(this.dyn_dtree),he(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Uint16Array(16),this.heap=new Uint16Array(573),he(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(573),he(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}const Qe=e=>{if(!e||!e.state)return ue(e,$);e.total_in=e.total_out=0,e.data_type=Ae;const t=e.state;return t.pending=0,t.pending_out=0,t.wrap<0&&(t.wrap=-t.wrap),t.status=t.wrap?42:113,e.adler=2===t.wrap?0:1,t.last_flush=q,L(t),W},ke=e=>{const t=Qe(e);var r;return t===W&&((r=e.state).window_size=2*r.w_size,he(r.head),r.max_lazy_match=Be[r.level].max_lazy,r.good_match=Be[r.level].good_length,r.nice_match=Be[r.level].nice_length,r.max_chain_length=Be[r.level].max_chain,r.strstart=0,r.block_start=0,r.lookahead=0,r.insert=0,r.match_length=r.prev_length=2,r.match_available=0,r.ins_h=0),t},_e=(e,t,r,n,i,o)=>{if(!e)return $;let a=1;if(t===re&&(t=6),n<0?(a=0,n=-n):n>15&&(a=2,n-=16),i<1||i>9||r!==ce||n<8||n>15||t<0||t>9||o<0||o>ae)return ue(e,$);8===n&&(n=9);const s=new we;return e.state=s,s.strm=e,s.wrap=a,s.gzhead=null,s.w_bits=n,s.w_size=1<<s.w_bits,s.w_mask=s.w_size-1,s.hash_bits=i+7,s.hash_size=1<<s.hash_bits,s.hash_mask=s.hash_size-1,s.hash_shift=~~((s.hash_bits+3-1)/3),s.window=new Uint8Array(2*s.w_size),s.head=new Uint16Array(s.hash_size),s.prev=new Uint16Array(s.w_size),s.lit_bufsize=1<<i+6,s.pending_buf_size=4*s.lit_bufsize,s.pending_buf=new Uint8Array(s.pending_buf_size),s.d_buf=1*s.lit_bufsize,s.l_buf=3*s.lit_bufsize,s.level=t,s.strategy=o,s.method=r,ke(e)};var Se={deflateInit:(e,t)=>_e(e,t,ce,15,8,se),deflateInit2:_e,deflateReset:ke,deflateResetKeep:Qe,deflateSetHeader:(e,t)=>e&&e.state?2!==e.state.wrap?$:(e.state.gzhead=t,W):$,deflate:(e,t)=>{let r,n;if(!e||!e.state||t>Z||t<0)return e?ue(e,$):$;const i=e.state;if(!e.output||!e.input&&0!==e.avail_in||666===i.status&&t!==V)return ue(e,0===e.avail_out?te:$);i.strm=e;const o=i.last_flush;if(i.last_flush=t,42===i.status)if(2===i.wrap)e.adler=0,pe(i,31),pe(i,139),pe(i,8),i.gzhead?(pe(i,(i.gzhead.text?1:0)+(i.gzhead.hcrc?2:0)+(i.gzhead.extra?4:0)+(i.gzhead.name?8:0)+(i.gzhead.comment?16:0)),pe(i,255&i.gzhead.time),pe(i,i.gzhead.time>>8&255),pe(i,i.gzhead.time>>16&255),pe(i,i.gzhead.time>>24&255),pe(i,9===i.level?2:i.strategy>=ie||i.level<2?4:0),pe(i,255&i.gzhead.os),i.gzhead.extra&&i.gzhead.extra.length&&(pe(i,255&i.gzhead.extra.length),pe(i,i.gzhead.extra.length>>8&255)),i.gzhead.hcrc&&(e.adler=j(e.adler,i.pending_buf,i.pending,0)),i.gzindex=0,i.status=69):(pe(i,0),pe(i,0),pe(i,0),pe(i,0),pe(i,0),pe(i,9===i.level?2:i.strategy>=ie||i.level<2?4:0),pe(i,3),i.status=113);else{let t=ce+(i.w_bits-8<<4)<<8,r=-1;r=i.strategy>=ie||i.level<2?0:i.level<6?1:6===i.level?2:3,t|=r<<6,0!==i.strstart&&(t|=32),t+=31-t%31,i.status=113,Ie(i,t),0!==i.strstart&&(Ie(i,e.adler>>>16),Ie(i,65535&e.adler)),e.adler=1}if(69===i.status)if(i.gzhead.extra){for(r=i.pending;i.gzindex<(65535&i.gzhead.extra.length)&&(i.pending!==i.pending_buf_size||(i.gzhead.hcrc&&i.pending>r&&(e.adler=j(e.adler,i.pending_buf,i.pending-r,r)),ge(e),r=i.pending,i.pending!==i.pending_buf_size));)pe(i,255&i.gzhead.extra[i.gzindex]),i.gzindex++;i.gzhead.hcrc&&i.pending>r&&(e.adler=j(e.adler,i.pending_buf,i.pending-r,r)),i.gzindex===i.gzhead.extra.length&&(i.gzindex=0,i.status=73)}else i.status=73;if(73===i.status)if(i.gzhead.name){r=i.pending;do{if(i.pending===i.pending_buf_size&&(i.gzhead.hcrc&&i.pending>r&&(e.adler=j(e.adler,i.pending_buf,i.pending-r,r)),ge(e),r=i.pending,i.pending===i.pending_buf_size)){n=1;break}n=i.gzindex<i.gzhead.name.length?255&i.gzhead.name.charCodeAt(i.gzindex++):0,pe(i,n)}while(0!==n);i.gzhead.hcrc&&i.pending>r&&(e.adler=j(e.adler,i.pending_buf,i.pending-r,r)),0===n&&(i.gzindex=0,i.status=91)}else i.status=91;if(91===i.status)if(i.gzhead.comment){r=i.pending;do{if(i.pending===i.pending_buf_size&&(i.gzhead.hcrc&&i.pending>r&&(e.adler=j(e.adler,i.pending_buf,i.pending-r,r)),ge(e),r=i.pending,i.pending===i.pending_buf_size)){n=1;break}n=i.gzindex<i.gzhead.comment.length?255&i.gzhead.comment.charCodeAt(i.gzindex++):0,pe(i,n)}while(0!==n);i.gzhead.hcrc&&i.pending>r&&(e.adler=j(e.adler,i.pending_buf,i.pending-r,r)),0===n&&(i.status=103)}else i.status=103;if(103===i.status&&(i.gzhead.hcrc?(i.pending+2>i.pending_buf_size&&ge(e),i.pending+2<=i.pending_buf_size&&(pe(i,255&e.adler),pe(i,e.adler>>8&255),e.adler=0,i.status=113)):i.status=113),0!==i.pending){if(ge(e),0===e.avail_out)return i.last_flush=-1,W}else if(0===e.avail_in&&fe(t)<=fe(o)&&t!==V)return ue(e,te);if(666===i.status&&0!==e.avail_in)return ue(e,te);if(0!==e.avail_in||0!==i.lookahead||t!==q&&666!==i.status){let r=i.strategy===ie?((e,t)=>{let r;for(;;){if(0===e.lookahead&&(Ee(e),0===e.lookahead)){if(t===q)return 1;break}if(e.match_length=0,r=Y(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,r&&(de(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,t===V?(de(e,!0),0===e.strm.avail_out?3:4):e.last_lit&&(de(e,!1),0===e.strm.avail_out)?1:2})(i,t):i.strategy===oe?((e,t)=>{let r,n,i,o;const a=e.window;for(;;){if(e.lookahead<=258){if(Ee(e),e.lookahead<=258&&t===q)return 1;if(0===e.lookahead)break}if(e.match_length=0,e.lookahead>=3&&e.strstart>0&&(i=e.strstart-1,n=a[i],n===a[++i]&&n===a[++i]&&n===a[++i])){o=e.strstart+258;do{}while(n===a[++i]&&n===a[++i]&&n===a[++i]&&n===a[++i]&&n===a[++i]&&n===a[++i]&&n===a[++i]&&n===a[++i]&&i<o);e.match_length=258-(o-i),e.match_length>e.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=3?(r=Y(e,1,e.match_length-3),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(r=Y(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),r&&(de(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,t===V?(de(e,!0),0===e.strm.avail_out?3:4):e.last_lit&&(de(e,!1),0===e.strm.avail_out)?1:2})(i,t):Be[i.level].func(i,t);if(3!==r&&4!==r||(i.status=666),1===r||3===r)return 0===e.avail_out&&(i.last_flush=-1),W;if(2===r&&(t===J?K(i):t!==Z&&(H(i,0,0,!1),t===z&&(he(i.head),0===i.lookahead&&(i.strstart=0,i.block_start=0,i.insert=0))),ge(e),0===e.avail_out))return i.last_flush=-1,W}return t!==V?W:i.wrap<=0?X:(2===i.wrap?(pe(i,255&e.adler),pe(i,e.adler>>8&255),pe(i,e.adler>>16&255),pe(i,e.adler>>24&255),pe(i,255&e.total_in),pe(i,e.total_in>>8&255),pe(i,e.total_in>>16&255),pe(i,e.total_in>>24&255)):(Ie(i,e.adler>>>16),Ie(i,65535&e.adler)),ge(e),i.wrap>0&&(i.wrap=-i.wrap),0!==i.pending?W:X)},deflateEnd:e=>{if(!e||!e.state)return $;const t=e.state.status;return 42!==t&&69!==t&&73!==t&&91!==t&&103!==t&&113!==t&&666!==t?ue(e,$):(e.state=null,113===t?ue(e,ee):W)},deflateSetDictionary:(e,t)=>{let r=t.length;if(!e||!e.state)return $;const n=e.state,i=n.wrap;if(2===i||1===i&&42!==n.status||n.lookahead)return $;if(1===i&&(e.adler=P(e.adler,t,r,0)),n.wrap=0,r>=n.w_size){0===i&&(he(n.head),n.strstart=0,n.block_start=0,n.insert=0);let e=new Uint8Array(n.w_size);e.set(t.subarray(r-n.w_size,r),0),t=e,r=n.w_size}const o=e.avail_in,a=e.next_in,s=e.input;for(e.avail_in=r,e.next_in=0,e.input=t,Ee(n);n.lookahead>=3;){let e=n.strstart,t=n.lookahead-2;do{n.ins_h=le(n,n.ins_h,n.window[e+3-1]),n.prev[e&n.w_mask]=n.head[n.ins_h],n.head[n.ins_h]=e,e++}while(--t);n.strstart=e,n.lookahead=2,Ee(n)}return n.strstart+=n.lookahead,n.block_start=n.strstart,n.insert=n.lookahead,n.lookahead=0,n.match_length=n.prev_length=2,n.match_available=0,e.next_in=a,e.input=s,e.avail_in=o,n.wrap=i,W},deflateInfo:"pako deflate (from Nodeca project)"};const De=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);var Me=function(e){const t=Array.prototype.slice.call(arguments,1);for(;t.length;){const r=t.shift();if(r){if("object"!=typeof r)throw new TypeError(r+"must be non-object");for(const t in r)De(r,t)&&(e[t]=r[t])}}return e},Re=e=>{let t=0;for(let r=0,n=e.length;r<n;r++)t+=e[r].length;const r=new Uint8Array(t);for(let t=0,n=0,i=e.length;t<i;t++){let i=e[t];r.set(i,n),n+=i.length}return r};let xe=!0;try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(e){xe=!1}const Oe=new Uint8Array(256);for(let e=0;e<256;e++)Oe[e]=e>=252?6:e>=248?5:e>=240?4:e>=224?3:e>=192?2:1;Oe[254]=Oe[254]=1;var Ne=e=>{if("function"==typeof TextEncoder&&TextEncoder.prototype.encode)return(new TextEncoder).encode(e);let t,r,n,i,o,a=e.length,s=0;for(i=0;i<a;i++)r=e.charCodeAt(i),55296==(64512&r)&&i+1<a&&(n=e.charCodeAt(i+1),56320==(64512&n)&&(r=65536+(r-55296<<10)+(n-56320),i++)),s+=r<128?1:r<2048?2:r<65536?3:4;for(t=new Uint8Array(s),o=0,i=0;o<s;i++)r=e.charCodeAt(i),55296==(64512&r)&&i+1<a&&(n=e.charCodeAt(i+1),56320==(64512&n)&&(r=65536+(r-55296<<10)+(n-56320),i++)),r<128?t[o++]=r:r<2048?(t[o++]=192|r>>>6,t[o++]=128|63&r):r<65536?(t[o++]=224|r>>>12,t[o++]=128|r>>>6&63,t[o++]=128|63&r):(t[o++]=240|r>>>18,t[o++]=128|r>>>12&63,t[o++]=128|r>>>6&63,t[o++]=128|63&r);return t},Pe=(e,t)=>{const r=t||e.length;if("function"==typeof TextDecoder&&TextDecoder.prototype.decode)return(new TextDecoder).decode(e.subarray(0,t));let n,i;const o=new Array(2*r);for(i=0,n=0;n<r;){let t=e[n++];if(t<128){o[i++]=t;continue}let a=Oe[t];if(a>4)o[i++]=65533,n+=a-1;else{for(t&=2===a?31:3===a?15:7;a>1&&n<r;)t=t<<6|63&e[n++],a--;a>1?o[i++]=65533:t<65536?o[i++]=t:(t-=65536,o[i++]=55296|t>>10&1023,o[i++]=56320|1023&t)}}return((e,t)=>{if(t<65534&&e.subarray&&xe)return String.fromCharCode.apply(null,e.length===t?e:e.subarray(0,t));let r="";for(let n=0;n<t;n++)r+=String.fromCharCode(e[n]);return r})(o,i)},Fe=(e,t)=>{(t=t||e.length)>e.length&&(t=e.length);let r=t-1;for(;r>=0&&128==(192&e[r]);)r--;return r<0||0===r?t:r+Oe[e[r]]>t?r:t};var je=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0};const Te=Object.prototype.toString,{Z_NO_FLUSH:Ue,Z_SYNC_FLUSH:Le,Z_FULL_FLUSH:He,Z_FINISH:Ge,Z_OK:Ye,Z_STREAM_END:Ke,Z_DEFAULT_COMPRESSION:qe,Z_DEFAULT_STRATEGY:Je,Z_DEFLATED:ze}=U;function Ve(e){this.options=Me({level:qe,method:ze,chunkSize:16384,windowBits:15,memLevel:8,strategy:Je},e||{});let t=this.options;t.raw&&t.windowBits>0?t.windowBits=-t.windowBits:t.gzip&&t.windowBits>0&&t.windowBits<16&&(t.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new je,this.strm.avail_out=0;let r=Se.deflateInit2(this.strm,t.level,t.method,t.windowBits,t.memLevel,t.strategy);if(r!==Ye)throw new Error(T[r]);if(t.header&&Se.deflateSetHeader(this.strm,t.header),t.dictionary){let e;if(e="string"==typeof t.dictionary?Ne(t.dictionary):"[object ArrayBuffer]"===Te.call(t.dictionary)?new Uint8Array(t.dictionary):t.dictionary,r=Se.deflateSetDictionary(this.strm,e),r!==Ye)throw new Error(T[r]);this._dict_set=!0}}function Ze(e,t){const r=new Ve(t);if(r.push(e,!0),r.err)throw r.msg||T[r.err];return r.result}Ve.prototype.push=function(e,t){const r=this.strm,n=this.options.chunkSize;let i,o;if(this.ended)return!1;for(o=t===~~t?t:!0===t?Ge:Ue,"string"==typeof e?r.input=Ne(e):"[object ArrayBuffer]"===Te.call(e)?r.input=new Uint8Array(e):r.input=e,r.next_in=0,r.avail_in=r.input.length;;)if(0===r.avail_out&&(r.output=new Uint8Array(n),r.next_out=0,r.avail_out=n),(o===Le||o===He)&&r.avail_out<=6)this.onData(r.output.subarray(0,r.next_out)),r.avail_out=0;else{if(i=Se.deflate(r,o),i===Ke)return r.next_out>0&&this.onData(r.output.subarray(0,r.next_out)),i=Se.deflateEnd(this.strm),this.onEnd(i),this.ended=!0,i===Ye;if(0!==r.avail_out){if(o>0&&r.next_out>0)this.onData(r.output.subarray(0,r.next_out)),r.avail_out=0;else if(0===r.avail_in)break}else this.onData(r.output)}return!0},Ve.prototype.onData=function(e){this.chunks.push(e)},Ve.prototype.onEnd=function(e){e===Ye&&(this.result=Re(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};var We={Deflate:Ve,deflate:Ze,deflateRaw:function(e,t){return(t=t||{}).raw=!0,Ze(e,t)},gzip:function(e,t){return(t=t||{}).gzip=!0,Ze(e,t)},constants:U};var Xe=function(e,t){let r,n,i,o,a,s,A,c,u,f,h,l,g,d,p,I,y,b,E,m,C,v,B,w;const Q=e.state;r=e.next_in,B=e.input,n=r+(e.avail_in-5),i=e.next_out,w=e.output,o=i-(t-e.avail_out),a=i+(e.avail_out-257),s=Q.dmax,A=Q.wsize,c=Q.whave,u=Q.wnext,f=Q.window,h=Q.hold,l=Q.bits,g=Q.lencode,d=Q.distcode,p=(1<<Q.lenbits)-1,I=(1<<Q.distbits)-1;e:do{l<15&&(h+=B[r++]<<l,l+=8,h+=B[r++]<<l,l+=8),y=g[h&p];t:for(;;){if(b=y>>>24,h>>>=b,l-=b,b=y>>>16&255,0===b)w[i++]=65535&y;else{if(!(16&b)){if(0==(64&b)){y=g[(65535&y)+(h&(1<<b)-1)];continue t}if(32&b){Q.mode=12;break e}e.msg="invalid literal/length code",Q.mode=30;break e}E=65535&y,b&=15,b&&(l<b&&(h+=B[r++]<<l,l+=8),E+=h&(1<<b)-1,h>>>=b,l-=b),l<15&&(h+=B[r++]<<l,l+=8,h+=B[r++]<<l,l+=8),y=d[h&I];r:for(;;){if(b=y>>>24,h>>>=b,l-=b,b=y>>>16&255,!(16&b)){if(0==(64&b)){y=d[(65535&y)+(h&(1<<b)-1)];continue r}e.msg="invalid distance code",Q.mode=30;break e}if(m=65535&y,b&=15,l<b&&(h+=B[r++]<<l,l+=8,l<b&&(h+=B[r++]<<l,l+=8)),m+=h&(1<<b)-1,m>s){e.msg="invalid distance too far back",Q.mode=30;break e}if(h>>>=b,l-=b,b=i-o,m>b){if(b=m-b,b>c&&Q.sane){e.msg="invalid distance too far back",Q.mode=30;break e}if(C=0,v=f,0===u){if(C+=A-b,b<E){E-=b;do{w[i++]=f[C++]}while(--b);C=i-m,v=w}}else if(u<b){if(C+=A+u-b,b-=u,b<E){E-=b;do{w[i++]=f[C++]}while(--b);if(C=0,u<E){b=u,E-=b;do{w[i++]=f[C++]}while(--b);C=i-m,v=w}}}else if(C+=u-b,b<E){E-=b;do{w[i++]=f[C++]}while(--b);C=i-m,v=w}for(;E>2;)w[i++]=v[C++],w[i++]=v[C++],w[i++]=v[C++],E-=3;E&&(w[i++]=v[C++],E>1&&(w[i++]=v[C++]))}else{C=i-m;do{w[i++]=w[C++],w[i++]=w[C++],w[i++]=w[C++],E-=3}while(E>2);E&&(w[i++]=w[C++],E>1&&(w[i++]=w[C++]))}break}}break}}while(r<n&&i<a);E=l>>3,r-=E,l-=E<<3,h&=(1<<l)-1,e.next_in=r,e.next_out=i,e.avail_in=r<n?n-r+5:5-(r-n),e.avail_out=i<a?a-i+257:257-(i-a),Q.hold=h,Q.bits=l};const $e=new Uint16Array([3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0]),et=new Uint8Array([16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78]),tt=new Uint16Array([1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0]),rt=new Uint8Array([16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64]);var nt=(e,t,r,n,i,o,a,s)=>{const A=s.bits;let c,u,f,h,l,g,d=0,p=0,I=0,y=0,b=0,E=0,m=0,C=0,v=0,B=0,w=null,Q=0;const k=new Uint16Array(16),_=new Uint16Array(16);let S,D,M,R=null,x=0;for(d=0;d<=15;d++)k[d]=0;for(p=0;p<n;p++)k[t[r+p]]++;for(b=A,y=15;y>=1&&0===k[y];y--);if(b>y&&(b=y),0===y)return i[o++]=20971520,i[o++]=20971520,s.bits=1,0;for(I=1;I<y&&0===k[I];I++);for(b<I&&(b=I),C=1,d=1;d<=15;d++)if(C<<=1,C-=k[d],C<0)return-1;if(C>0&&(0===e||1!==y))return-1;for(_[1]=0,d=1;d<15;d++)_[d+1]=_[d]+k[d];for(p=0;p<n;p++)0!==t[r+p]&&(a[_[t[r+p]]++]=p);if(0===e?(w=R=a,g=19):1===e?(w=$e,Q-=257,R=et,x-=257,g=256):(w=tt,R=rt,g=-1),B=0,p=0,d=I,l=o,E=b,m=0,f=-1,v=1<<b,h=v-1,1===e&&v>852||2===e&&v>592)return 1;for(;;){S=d-m,a[p]<g?(D=0,M=a[p]):a[p]>g?(D=R[x+a[p]],M=w[Q+a[p]]):(D=96,M=0),c=1<<d-m,u=1<<E,I=u;do{u-=c,i[l+(B>>m)+u]=S<<24|D<<16|M|0}while(0!==u);for(c=1<<d-1;B&c;)c>>=1;if(0!==c?(B&=c-1,B+=c):B=0,p++,0==--k[d]){if(d===y)break;d=t[r+a[p]]}if(d>b&&(B&h)!==f){for(0===m&&(m=b),l+=I,E=d-m,C=1<<E;E+m<y&&(C-=k[E+m],!(C<=0));)E++,C<<=1;if(v+=1<<E,1===e&&v>852||2===e&&v>592)return 1;f=B&h,i[f]=b<<24|E<<16|l-o|0}}return 0!==B&&(i[l+B]=d-m<<24|64<<16|0),s.bits=b,0};const{Z_FINISH:it,Z_BLOCK:ot,Z_TREES:at,Z_OK:st,Z_STREAM_END:At,Z_NEED_DICT:ct,Z_STREAM_ERROR:ut,Z_DATA_ERROR:ft,Z_MEM_ERROR:ht,Z_BUF_ERROR:lt,Z_DEFLATED:gt}=U,dt=e=>(e>>>24&255)+(e>>>8&65280)+((65280&e)<<8)+((255&e)<<24);function pt(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new Uint16Array(320),this.work=new Uint16Array(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}const It=e=>{if(!e||!e.state)return ut;const t=e.state;return e.total_in=e.total_out=t.total=0,e.msg="",t.wrap&&(e.adler=1&t.wrap),t.mode=1,t.last=0,t.havedict=0,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new Int32Array(852),t.distcode=t.distdyn=new Int32Array(592),t.sane=1,t.back=-1,st},yt=e=>{if(!e||!e.state)return ut;const t=e.state;return t.wsize=0,t.whave=0,t.wnext=0,It(e)},bt=(e,t)=>{let r;if(!e||!e.state)return ut;const n=e.state;return t<0?(r=0,t=-t):(r=1+(t>>4),t<48&&(t&=15)),t&&(t<8||t>15)?ut:(null!==n.window&&n.wbits!==t&&(n.window=null),n.wrap=r,n.wbits=t,yt(e))},Et=(e,t)=>{if(!e)return ut;const r=new pt;e.state=r,r.window=null;const n=bt(e,t);return n!==st&&(e.state=null),n};let mt,Ct,vt=!0;const Bt=e=>{if(vt){mt=new Int32Array(512),Ct=new Int32Array(32);let t=0;for(;t<144;)e.lens[t++]=8;for(;t<256;)e.lens[t++]=9;for(;t<280;)e.lens[t++]=7;for(;t<288;)e.lens[t++]=8;for(nt(1,e.lens,0,288,mt,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;nt(2,e.lens,0,32,Ct,0,e.work,{bits:5}),vt=!1}e.lencode=mt,e.lenbits=9,e.distcode=Ct,e.distbits=5},wt=(e,t,r,n)=>{let i;const o=e.state;return null===o.window&&(o.wsize=1<<o.wbits,o.wnext=0,o.whave=0,o.window=new Uint8Array(o.wsize)),n>=o.wsize?(o.window.set(t.subarray(r-o.wsize,r),0),o.wnext=0,o.whave=o.wsize):(i=o.wsize-o.wnext,i>n&&(i=n),o.window.set(t.subarray(r-n,r-n+i),o.wnext),(n-=i)?(o.window.set(t.subarray(r-n,r),0),o.wnext=n,o.whave=o.wsize):(o.wnext+=i,o.wnext===o.wsize&&(o.wnext=0),o.whave<o.wsize&&(o.whave+=i))),0};var Qt={inflateReset:yt,inflateReset2:bt,inflateResetKeep:It,inflateInit:e=>Et(e,15),inflateInit2:Et,inflate:(e,t)=>{let r,n,i,o,a,s,A,c,u,f,h,l,g,d,p,I,y,b,E,m,C,v,B=0;const w=new Uint8Array(4);let Q,k;const _=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(!e||!e.state||!e.output||!e.input&&0!==e.avail_in)return ut;r=e.state,12===r.mode&&(r.mode=13),a=e.next_out,i=e.output,A=e.avail_out,o=e.next_in,n=e.input,s=e.avail_in,c=r.hold,u=r.bits,f=s,h=A,v=st;e:for(;;)switch(r.mode){case 1:if(0===r.wrap){r.mode=13;break}for(;u<16;){if(0===s)break e;s--,c+=n[o++]<<u,u+=8}if(2&r.wrap&&35615===c){r.check=0,w[0]=255&c,w[1]=c>>>8&255,r.check=j(r.check,w,2,0),c=0,u=0,r.mode=2;break}if(r.flags=0,r.head&&(r.head.done=!1),!(1&r.wrap)||(((255&c)<<8)+(c>>8))%31){e.msg="incorrect header check",r.mode=30;break}if((15&c)!==gt){e.msg="unknown compression method",r.mode=30;break}if(c>>>=4,u-=4,C=8+(15&c),0===r.wbits)r.wbits=C;else if(C>r.wbits){e.msg="invalid window size",r.mode=30;break}r.dmax=1<<r.wbits,e.adler=r.check=1,r.mode=512&c?10:12,c=0,u=0;break;case 2:for(;u<16;){if(0===s)break e;s--,c+=n[o++]<<u,u+=8}if(r.flags=c,(255&r.flags)!==gt){e.msg="unknown compression method",r.mode=30;break}if(57344&r.flags){e.msg="unknown header flags set",r.mode=30;break}r.head&&(r.head.text=c>>8&1),512&r.flags&&(w[0]=255&c,w[1]=c>>>8&255,r.check=j(r.check,w,2,0)),c=0,u=0,r.mode=3;case 3:for(;u<32;){if(0===s)break e;s--,c+=n[o++]<<u,u+=8}r.head&&(r.head.time=c),512&r.flags&&(w[0]=255&c,w[1]=c>>>8&255,w[2]=c>>>16&255,w[3]=c>>>24&255,r.check=j(r.check,w,4,0)),c=0,u=0,r.mode=4;case 4:for(;u<16;){if(0===s)break e;s--,c+=n[o++]<<u,u+=8}r.head&&(r.head.xflags=255&c,r.head.os=c>>8),512&r.flags&&(w[0]=255&c,w[1]=c>>>8&255,r.check=j(r.check,w,2,0)),c=0,u=0,r.mode=5;case 5:if(1024&r.flags){for(;u<16;){if(0===s)break e;s--,c+=n[o++]<<u,u+=8}r.length=c,r.head&&(r.head.extra_len=c),512&r.flags&&(w[0]=255&c,w[1]=c>>>8&255,r.check=j(r.check,w,2,0)),c=0,u=0}else r.head&&(r.head.extra=null);r.mode=6;case 6:if(1024&r.flags&&(l=r.length,l>s&&(l=s),l&&(r.head&&(C=r.head.extra_len-r.length,r.head.extra||(r.head.extra=new Uint8Array(r.head.extra_len)),r.head.extra.set(n.subarray(o,o+l),C)),512&r.flags&&(r.check=j(r.check,n,l,o)),s-=l,o+=l,r.length-=l),r.length))break e;r.length=0,r.mode=7;case 7:if(2048&r.flags){if(0===s)break e;l=0;do{C=n[o+l++],r.head&&C&&r.length<65536&&(r.head.name+=String.fromCharCode(C))}while(C&&l<s);if(512&r.flags&&(r.check=j(r.check,n,l,o)),s-=l,o+=l,C)break e}else r.head&&(r.head.name=null);r.length=0,r.mode=8;case 8:if(4096&r.flags){if(0===s)break e;l=0;do{C=n[o+l++],r.head&&C&&r.length<65536&&(r.head.comment+=String.fromCharCode(C))}while(C&&l<s);if(512&r.flags&&(r.check=j(r.check,n,l,o)),s-=l,o+=l,C)break e}else r.head&&(r.head.comment=null);r.mode=9;case 9:if(512&r.flags){for(;u<16;){if(0===s)break e;s--,c+=n[o++]<<u,u+=8}if(c!==(65535&r.check)){e.msg="header crc mismatch",r.mode=30;break}c=0,u=0}r.head&&(r.head.hcrc=r.flags>>9&1,r.head.done=!0),e.adler=r.check=0,r.mode=12;break;case 10:for(;u<32;){if(0===s)break e;s--,c+=n[o++]<<u,u+=8}e.adler=r.check=dt(c),c=0,u=0,r.mode=11;case 11:if(0===r.havedict)return e.next_out=a,e.avail_out=A,e.next_in=o,e.avail_in=s,r.hold=c,r.bits=u,ct;e.adler=r.check=1,r.mode=12;case 12:if(t===ot||t===at)break e;case 13:if(r.last){c>>>=7&u,u-=7&u,r.mode=27;break}for(;u<3;){if(0===s)break e;s--,c+=n[o++]<<u,u+=8}switch(r.last=1&c,c>>>=1,u-=1,3&c){case 0:r.mode=14;break;case 1:if(Bt(r),r.mode=20,t===at){c>>>=2,u-=2;break e}break;case 2:r.mode=17;break;case 3:e.msg="invalid block type",r.mode=30}c>>>=2,u-=2;break;case 14:for(c>>>=7&u,u-=7&u;u<32;){if(0===s)break e;s--,c+=n[o++]<<u,u+=8}if((65535&c)!=(c>>>16^65535)){e.msg="invalid stored block lengths",r.mode=30;break}if(r.length=65535&c,c=0,u=0,r.mode=15,t===at)break e;case 15:r.mode=16;case 16:if(l=r.length,l){if(l>s&&(l=s),l>A&&(l=A),0===l)break e;i.set(n.subarray(o,o+l),a),s-=l,o+=l,A-=l,a+=l,r.length-=l;break}r.mode=12;break;case 17:for(;u<14;){if(0===s)break e;s--,c+=n[o++]<<u,u+=8}if(r.nlen=257+(31&c),c>>>=5,u-=5,r.ndist=1+(31&c),c>>>=5,u-=5,r.ncode=4+(15&c),c>>>=4,u-=4,r.nlen>286||r.ndist>30){e.msg="too many length or distance symbols",r.mode=30;break}r.have=0,r.mode=18;case 18:for(;r.have<r.ncode;){for(;u<3;){if(0===s)break e;s--,c+=n[o++]<<u,u+=8}r.lens[_[r.have++]]=7&c,c>>>=3,u-=3}for(;r.have<19;)r.lens[_[r.have++]]=0;if(r.lencode=r.lendyn,r.lenbits=7,Q={bits:r.lenbits},v=nt(0,r.lens,0,19,r.lencode,0,r.work,Q),r.lenbits=Q.bits,v){e.msg="invalid code lengths set",r.mode=30;break}r.have=0,r.mode=19;case 19:for(;r.have<r.nlen+r.ndist;){for(;B=r.lencode[c&(1<<r.lenbits)-1],p=B>>>24,I=B>>>16&255,y=65535&B,!(p<=u);){if(0===s)break e;s--,c+=n[o++]<<u,u+=8}if(y<16)c>>>=p,u-=p,r.lens[r.have++]=y;else{if(16===y){for(k=p+2;u<k;){if(0===s)break e;s--,c+=n[o++]<<u,u+=8}if(c>>>=p,u-=p,0===r.have){e.msg="invalid bit length repeat",r.mode=30;break}C=r.lens[r.have-1],l=3+(3&c),c>>>=2,u-=2}else if(17===y){for(k=p+3;u<k;){if(0===s)break e;s--,c+=n[o++]<<u,u+=8}c>>>=p,u-=p,C=0,l=3+(7&c),c>>>=3,u-=3}else{for(k=p+7;u<k;){if(0===s)break e;s--,c+=n[o++]<<u,u+=8}c>>>=p,u-=p,C=0,l=11+(127&c),c>>>=7,u-=7}if(r.have+l>r.nlen+r.ndist){e.msg="invalid bit length repeat",r.mode=30;break}for(;l--;)r.lens[r.have++]=C}}if(30===r.mode)break;if(0===r.lens[256]){e.msg="invalid code -- missing end-of-block",r.mode=30;break}if(r.lenbits=9,Q={bits:r.lenbits},v=nt(1,r.lens,0,r.nlen,r.lencode,0,r.work,Q),r.lenbits=Q.bits,v){e.msg="invalid literal/lengths set",r.mode=30;break}if(r.distbits=6,r.distcode=r.distdyn,Q={bits:r.distbits},v=nt(2,r.lens,r.nlen,r.ndist,r.distcode,0,r.work,Q),r.distbits=Q.bits,v){e.msg="invalid distances set",r.mode=30;break}if(r.mode=20,t===at)break e;case 20:r.mode=21;case 21:if(s>=6&&A>=258){e.next_out=a,e.avail_out=A,e.next_in=o,e.avail_in=s,r.hold=c,r.bits=u,Xe(e,h),a=e.next_out,i=e.output,A=e.avail_out,o=e.next_in,n=e.input,s=e.avail_in,c=r.hold,u=r.bits,12===r.mode&&(r.back=-1);break}for(r.back=0;B=r.lencode[c&(1<<r.lenbits)-1],p=B>>>24,I=B>>>16&255,y=65535&B,!(p<=u);){if(0===s)break e;s--,c+=n[o++]<<u,u+=8}if(I&&0==(240&I)){for(b=p,E=I,m=y;B=r.lencode[m+((c&(1<<b+E)-1)>>b)],p=B>>>24,I=B>>>16&255,y=65535&B,!(b+p<=u);){if(0===s)break e;s--,c+=n[o++]<<u,u+=8}c>>>=b,u-=b,r.back+=b}if(c>>>=p,u-=p,r.back+=p,r.length=y,0===I){r.mode=26;break}if(32&I){r.back=-1,r.mode=12;break}if(64&I){e.msg="invalid literal/length code",r.mode=30;break}r.extra=15&I,r.mode=22;case 22:if(r.extra){for(k=r.extra;u<k;){if(0===s)break e;s--,c+=n[o++]<<u,u+=8}r.length+=c&(1<<r.extra)-1,c>>>=r.extra,u-=r.extra,r.back+=r.extra}r.was=r.length,r.mode=23;case 23:for(;B=r.distcode[c&(1<<r.distbits)-1],p=B>>>24,I=B>>>16&255,y=65535&B,!(p<=u);){if(0===s)break e;s--,c+=n[o++]<<u,u+=8}if(0==(240&I)){for(b=p,E=I,m=y;B=r.distcode[m+((c&(1<<b+E)-1)>>b)],p=B>>>24,I=B>>>16&255,y=65535&B,!(b+p<=u);){if(0===s)break e;s--,c+=n[o++]<<u,u+=8}c>>>=b,u-=b,r.back+=b}if(c>>>=p,u-=p,r.back+=p,64&I){e.msg="invalid distance code",r.mode=30;break}r.offset=y,r.extra=15&I,r.mode=24;case 24:if(r.extra){for(k=r.extra;u<k;){if(0===s)break e;s--,c+=n[o++]<<u,u+=8}r.offset+=c&(1<<r.extra)-1,c>>>=r.extra,u-=r.extra,r.back+=r.extra}if(r.offset>r.dmax){e.msg="invalid distance too far back",r.mode=30;break}r.mode=25;case 25:if(0===A)break e;if(l=h-A,r.offset>l){if(l=r.offset-l,l>r.whave&&r.sane){e.msg="invalid distance too far back",r.mode=30;break}l>r.wnext?(l-=r.wnext,g=r.wsize-l):g=r.wnext-l,l>r.length&&(l=r.length),d=r.window}else d=i,g=a-r.offset,l=r.length;l>A&&(l=A),A-=l,r.length-=l;do{i[a++]=d[g++]}while(--l);0===r.length&&(r.mode=21);break;case 26:if(0===A)break e;i[a++]=r.length,A--,r.mode=21;break;case 27:if(r.wrap){for(;u<32;){if(0===s)break e;s--,c|=n[o++]<<u,u+=8}if(h-=A,e.total_out+=h,r.total+=h,h&&(e.adler=r.check=r.flags?j(r.check,i,h,a-h):P(r.check,i,h,a-h)),h=A,(r.flags?c:dt(c))!==r.check){e.msg="incorrect data check",r.mode=30;break}c=0,u=0}r.mode=28;case 28:if(r.wrap&&r.flags){for(;u<32;){if(0===s)break e;s--,c+=n[o++]<<u,u+=8}if(c!==(4294967295&r.total)){e.msg="incorrect length check",r.mode=30;break}c=0,u=0}r.mode=29;case 29:v=At;break e;case 30:v=ft;break e;case 31:return ht;case 32:default:return ut}return e.next_out=a,e.avail_out=A,e.next_in=o,e.avail_in=s,r.hold=c,r.bits=u,(r.wsize||h!==e.avail_out&&r.mode<30&&(r.mode<27||t!==it))&&wt(e,e.output,e.next_out,h-e.avail_out),f-=e.avail_in,h-=e.avail_out,e.total_in+=f,e.total_out+=h,r.total+=h,r.wrap&&h&&(e.adler=r.check=r.flags?j(r.check,i,h,e.next_out-h):P(r.check,i,h,e.next_out-h)),e.data_type=r.bits+(r.last?64:0)+(12===r.mode?128:0)+(20===r.mode||15===r.mode?256:0),(0===f&&0===h||t===it)&&v===st&&(v=lt),v},inflateEnd:e=>{if(!e||!e.state)return ut;let t=e.state;return t.window&&(t.window=null),e.state=null,st},inflateGetHeader:(e,t)=>{if(!e||!e.state)return ut;const r=e.state;return 0==(2&r.wrap)?ut:(r.head=t,t.done=!1,st)},inflateSetDictionary:(e,t)=>{const r=t.length;let n,i,o;return e&&e.state?(n=e.state,0!==n.wrap&&11!==n.mode?ut:11===n.mode&&(i=1,i=P(i,t,r,0),i!==n.check)?ft:(o=wt(e,t,r,r),o?(n.mode=31,ht):(n.havedict=1,st))):ut},inflateInfo:"pako inflate (from Nodeca project)"};var kt=function(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1};const _t=Object.prototype.toString,{Z_NO_FLUSH:St,Z_FINISH:Dt,Z_OK:Mt,Z_STREAM_END:Rt,Z_NEED_DICT:xt,Z_STREAM_ERROR:Ot,Z_DATA_ERROR:Nt,Z_MEM_ERROR:Pt}=U;function Ft(e){this.options=Me({chunkSize:65536,windowBits:15,to:""},e||{});const t=this.options;t.raw&&t.windowBits>=0&&t.windowBits<16&&(t.windowBits=-t.windowBits,0===t.windowBits&&(t.windowBits=-15)),!(t.windowBits>=0&&t.windowBits<16)||e&&e.windowBits||(t.windowBits+=32),t.windowBits>15&&t.windowBits<48&&0==(15&t.windowBits)&&(t.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new je,this.strm.avail_out=0;let r=Qt.inflateInit2(this.strm,t.windowBits);if(r!==Mt)throw new Error(T[r]);if(this.header=new kt,Qt.inflateGetHeader(this.strm,this.header),t.dictionary&&("string"==typeof t.dictionary?t.dictionary=Ne(t.dictionary):"[object ArrayBuffer]"===_t.call(t.dictionary)&&(t.dictionary=new Uint8Array(t.dictionary)),t.raw&&(r=Qt.inflateSetDictionary(this.strm,t.dictionary),r!==Mt)))throw new Error(T[r])}function jt(e,t){const r=new Ft(t);if(r.push(e),r.err)throw r.msg||T[r.err];return r.result}Ft.prototype.push=function(e,t){const r=this.strm,n=this.options.chunkSize,i=this.options.dictionary;let o,a,s;if(this.ended)return!1;for(a=t===~~t?t:!0===t?Dt:St,"[object ArrayBuffer]"===_t.call(e)?r.input=new Uint8Array(e):r.input=e,r.next_in=0,r.avail_in=r.input.length;;){for(0===r.avail_out&&(r.output=new Uint8Array(n),r.next_out=0,r.avail_out=n),o=Qt.inflate(r,a),o===xt&&i&&(o=Qt.inflateSetDictionary(r,i),o===Mt?o=Qt.inflate(r,a):o===Nt&&(o=xt));r.avail_in>0&&o===Rt&&r.state.wrap>0&&0!==e[r.next_in];)Qt.inflateReset(r),o=Qt.inflate(r,a);switch(o){case Ot:case Nt:case xt:case Pt:return this.onEnd(o),this.ended=!0,!1}if(s=r.avail_out,r.next_out&&(0===r.avail_out||o===Rt))if("string"===this.options.to){let e=Fe(r.output,r.next_out),t=r.next_out-e,i=Pe(r.output,e);r.next_out=t,r.avail_out=n-t,t&&r.output.set(r.output.subarray(e,e+t),0),this.onData(i)}else this.onData(r.output.length===r.next_out?r.output:r.output.subarray(0,r.next_out));if(o!==Mt||0!==s){if(o===Rt)return o=Qt.inflateEnd(this.strm),this.onEnd(o),this.ended=!0,!0;if(0===r.avail_in)break}}return!0},Ft.prototype.onData=function(e){this.chunks.push(e)},Ft.prototype.onEnd=function(e){e===Mt&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=Re(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};var Tt={Inflate:Ft,inflate:jt,inflateRaw:function(e,t){return(t=t||{}).raw=!0,jt(e,t)},ungzip:jt,constants:U};const{Deflate:Ut,deflate:Lt,deflateRaw:Ht,gzip:Gt}=We,{Inflate:Yt,inflate:Kt,inflateRaw:qt,ungzip:Jt}=Tt;var zt=Ut,Vt=Lt,Zt=Ht,Wt=Gt,Xt=Yt,$t=Kt,er=qt,tr=Jt,rr=U,nr={Deflate:Ut,deflate:Lt,deflateRaw:Ht,gzip:Gt,Inflate:Yt,inflate:Kt,inflateRaw:qt,ungzip:Jt,constants:U}},function(e,t){},function(e,t,r){"use strict";t.sha1=r(189),t.sha224=r(190),t.sha256=r(93),t.sha384=r(191),t.sha512=r(94)},function(e,t,r){"use strict";var n=r(15),i=r(29),o=r(92),a=n.rotl32,s=n.sum32,A=n.sum32_5,c=o.ft_1,u=i.BlockHash,f=[1518500249,1859775393,2400959708,3395469782];function h(){if(!(this instanceof h))return new h;u.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}n.inherits(h,u),e.exports=h,h.blockSize=512,h.outSize=160,h.hmacStrength=80,h.padLength=64,h.prototype._update=function(e,t){for(var r=this.W,n=0;n<16;n++)r[n]=e[t+n];for(;n<r.length;n++)r[n]=a(r[n-3]^r[n-8]^r[n-14]^r[n-16],1);var i=this.h[0],o=this.h[1],u=this.h[2],h=this.h[3],l=this.h[4];for(n=0;n<r.length;n++){var g=~~(n/20),d=A(a(i,5),c(g,o,u,h),l,r[n],f[g]);l=h,h=u,u=a(o,30),o=i,i=d}this.h[0]=s(this.h[0],i),this.h[1]=s(this.h[1],o),this.h[2]=s(this.h[2],u),this.h[3]=s(this.h[3],h),this.h[4]=s(this.h[4],l)},h.prototype._digest=function(e){return"hex"===e?n.toHex32(this.h,"big"):n.split32(this.h,"big")}},function(e,t,r){"use strict";var n=r(15),i=r(93);function o(){if(!(this instanceof o))return new o;i.call(this),this.h=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]}n.inherits(o,i),e.exports=o,o.blockSize=512,o.outSize=224,o.hmacStrength=192,o.padLength=64,o.prototype._digest=function(e){return"hex"===e?n.toHex32(this.h.slice(0,7),"big"):n.split32(this.h.slice(0,7),"big")}},function(e,t,r){"use strict";var n=r(15),i=r(94);function o(){if(!(this instanceof o))return new o;i.call(this),this.h=[3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]}n.inherits(o,i),e.exports=o,o.blockSize=1024,o.outSize=384,o.hmacStrength=192,o.padLength=128,o.prototype._digest=function(e){return"hex"===e?n.toHex32(this.h.slice(0,12),"big"):n.split32(this.h.slice(0,12),"big")}},function(e,t,r){"use strict";var n=r(15),i=r(29),o=n.rotl32,a=n.sum32,s=n.sum32_3,A=n.sum32_4,c=i.BlockHash;function u(){if(!(this instanceof u))return new u;c.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.endian="little"}function f(e,t,r,n){return e<=15?t^r^n:e<=31?t&r|~t&n:e<=47?(t|~r)^n:e<=63?t&n|r&~n:t^(r|~n)}function h(e){return e<=15?0:e<=31?1518500249:e<=47?1859775393:e<=63?2400959708:2840853838}function l(e){return e<=15?1352829926:e<=31?1548603684:e<=47?1836072691:e<=63?2053994217:0}n.inherits(u,c),t.ripemd160=u,u.blockSize=512,u.outSize=160,u.hmacStrength=192,u.padLength=64,u.prototype._update=function(e,t){for(var r=this.h[0],n=this.h[1],i=this.h[2],c=this.h[3],u=this.h[4],y=r,b=n,E=i,m=c,C=u,v=0;v<80;v++){var B=a(o(A(r,f(v,n,i,c),e[g[v]+t],h(v)),p[v]),u);r=u,u=c,c=o(i,10),i=n,n=B,B=a(o(A(y,f(79-v,b,E,m),e[d[v]+t],l(v)),I[v]),C),y=C,C=m,m=o(E,10),E=b,b=B}B=s(this.h[1],i,m),this.h[1]=s(this.h[2],c,C),this.h[2]=s(this.h[3],u,y),this.h[3]=s(this.h[4],r,b),this.h[4]=s(this.h[0],n,E),this.h[0]=B},u.prototype._digest=function(e){return"hex"===e?n.toHex32(this.h,"little"):n.split32(this.h,"little")};var g=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13],d=[5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11],p=[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6],I=[8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11]},function(e,t,r){"use strict";var n=r(15),i=r(12);function o(e,t,r){if(!(this instanceof o))return new o(e,t,r);this.Hash=e,this.blockSize=e.blockSize/8,this.outSize=e.outSize/8,this.inner=null,this.outer=null,this._init(n.toArray(t,r))}e.exports=o,o.prototype._init=function(e){e.length>this.blockSize&&(e=(new this.Hash).update(e).digest()),i(e.length<=this.blockSize);for(var t=e.length;t<this.blockSize;t++)e.push(0);for(t=0;t<e.length;t++)e[t]^=54;for(this.inner=(new this.Hash).update(e),t=0;t<e.length;t++)e[t]^=106;this.outer=(new this.Hash).update(e)},o.prototype.update=function(e,t){return this.inner.update(e,t),this},o.prototype.digest=function(e){return this.outer.update(this.inner.digest()),this.outer.digest(e)}},function(e,t,r){(function(e,t){!function(e,r){"use strict";if(!e.setImmediate){var n,i,o,a,s,A=1,c={},u=!1,f=e.document,h=Object.getPrototypeOf&&Object.getPrototypeOf(e);h=h&&h.setTimeout?h:e,"[object process]"==={}.toString.call(e.process)?n=function(){var e=l(arguments);return t.nextTick(g(d,e)),e}:!function(){if(e.postMessage&&!e.importScripts){var t=!0,r=e.onmessage;return e.onmessage=function(){t=!1},e.postMessage("","*"),e.onmessage=r,t}}()?e.MessageChannel?((o=new MessageChannel).port1.onmessage=function(e){d(e.data)},n=function(){var e=l(arguments);return o.port2.postMessage(e),e}):f&&"onreadystatechange"in f.createElement("script")?(i=f.documentElement,n=function(){var e=l(arguments),t=f.createElement("script");return t.onreadystatechange=function(){d(e),t.onreadystatechange=null,i.removeChild(t),t=null},i.appendChild(t),e}):n=function(){var e=l(arguments);return setTimeout(g(d,e),0),e}:(a="setImmediate$"+Math.random()+"$",s=function(t){t.source===e&&"string"==typeof t.data&&0===t.data.indexOf(a)&&d(+t.data.slice(a.length))},e.addEventListener?e.addEventListener("message",s,!1):e.attachEvent("onmessage",s),n=function(){var t=l(arguments);return e.postMessage(a+t,"*"),t}),h.setImmediate=n,h.clearImmediate=p}function l(e){return c[A]=g.apply(void 0,e),A++}function g(e){var t=[].slice.call(arguments,1);return function(){"function"==typeof e?e.apply(void 0,t):new Function(""+e)()}}function d(e){if(u)setTimeout(g(d,e),0);else{var t=c[e];if(t){u=!0;try{t()}finally{p(e),u=!1}}}}function p(e){delete c[e]}}("undefined"==typeof self?void 0===e?this:e:self)}).call(this,r(8),r(9))},function(e,t,r){var n=r(84),i=r(96),o=r(36),a=r(21),s=r(22);function A(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function c(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?A(Object(r),!0).forEach((function(t){o(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):A(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var u=r(97),f=r(196),h=r(197),l=r(100),g=l.ValidateLibrary,d=l.ValidateObject,p=l.ValidateVersion,I=l.ValidatePartHash,y=l.ValidateWriteToken,b=l.ValidateParameters,E=r(198);t.permissionLevels={owner:{short:"Owner Only",description:"Only the owner has access to the object and ability to change permissions",settings:{visibility:0,statusCode:-1,kmsConk:!1}},editable:{short:"Editable",description:"Members of the editors group have full access to the object and the ability to change permissions",settings:{visibility:0,statusCode:-1,kmsConk:!0}},viewable:{short:"Viewable",description:"In addition to editors, members of the 'accessor' group can have read-only access to the object including playing video and retrieving metadata, images and documents",settings:{visibility:0,statusCode:0,kmsConk:!0}},listable:{short:"Publicly Listable",description:"Anyone can list the public portion of this object but only accounts with specific rights can access",settings:{visibility:1,statusCode:0,kmsConk:!0}},public:{short:"Public",description:"Anyone can access this object",settings:{visibility:10,statusCode:0,kmsConk:!0}}},t.Visibility=function(){var e=s(a.mark((function e(t){var r,n,i,o=this;return a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.id,n=t.clearCache,e.prev=1,i=this.utils.HashToAddress(r),n&&delete this.visibilityInfo[i],this.visibilityInfo[i]||(this.visibilityInfo[i]=new Promise(function(){var e=s(a.mark((function e(t,n){return a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,o.authClient.ContractHasMethod({contractAddress:i,methodName:"visibility"});case 3:if(e.sent){e.next=7;break}return t(0),e.abrupt("return");case 7:return e.t0=t,e.next=10,o.CallContractMethod({contractAddress:o.utils.HashToAddress(r),methodName:"visibility"});case 10:e.t1=e.sent,(0,e.t0)(e.t1),e.next=17;break;case 14:e.prev=14,e.t2=e.catch(0),n(e.t2);case 17:case"end":return e.stop()}}),e,null,[[0,14]])})));return function(t,r){return e.apply(this,arguments)}}())),e.prev=5,e.next=8,this.visibilityInfo[i];case 8:return e.abrupt("return",e.sent);case 11:throw e.prev=11,e.t0=e.catch(5),delete this.visibilityInfo[i],e.t0;case 15:e.next=22;break;case 17:if(e.prev=17,e.t1=e.catch(1),"CALL_EXCEPTION"!==e.t1.code){e.next=21;break}return e.abrupt("return",0);case 21:throw e.t1;case 22:case"end":return e.stop()}}),e,this,[[1,17],[5,11]])})));return function(t){return e.apply(this,arguments)}}(),t.Permission=function(){var e=s(a.mark((function e(t){var r,n,i,o,s,A,c,u,f=this;return a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.objectId,n=t.clearCache,d(r),e.next=4,this.AccessType({id:r});case 4:if(e.t0=e.sent,e.t1=this.authClient.ACCESS_TYPES.OBJECT,e.t0===e.t1){e.next=8;break}throw Error("Permission only valid for normal content objects: "+r);case 8:return e.next=10,this.Visibility({id:r,clearCache:n});case 10:return i=e.sent,e.next=13,this.CallContractMethod({contractAddress:this.utils.HashToAddress(r),methodName:"addressKMS"});case 13:if(o=e.sent,s=o&&"ikms".concat(this.utils.AddressToHash(o)),A=!1,!s){e.next=27;break}return e.t2=this,e.next=20,this.ContentObjectLibraryId({objectId:r});case 20:return e.t3=e.sent,e.t4=r,e.t5="eluv.caps.".concat(s),e.t6={libraryId:e.t3,objectId:e.t4,metadataSubtree:e.t5},e.next=26,e.t2.ContentObjectMetadata.call(e.t2,e.t6);case 26:A=!!e.sent;case 27:return e.next=29,this.CallContractMethod({contractAddress:this.utils.HashToAddress(r),methodName:"statusCode"});case 29:return c=e.sent,c=parseInt(c._hex,16),(u=Object.keys(this.permissionLevels).filter((function(e){var t=f.permissionLevels[e].settings;return i>=t.visibility&&c>=t.statusCode&&A===t.kmsConk})))||(u=A?["editable"]:["owner"]),e.abrupt("return",u.slice(-1)[0]);case 34:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}(),t.DefaultKMSAddress=s(a.mark((function e(){var t,r,n,i=arguments;return a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=i.length>0&&void 0!==i[0]?i[0]:{},r=t.tenantId,e.t0=r,!e.t0){e.next=8;break}return e.next=5,this.AccessType({id:r});case 5:e.t1=e.sent,e.t2=this.authClient.ACCESS_TYPES.TENANT,e.t0=e.t1===e.t2;case 8:if(!e.t0){e.next=14;break}return e.next=11,this.CallContractMethod({contractAddress:this.utils.HashToAddress(r),methodName:"addressKMS"});case 11:if(!(n=e.sent)){e.next=14;break}return e.abrupt("return",n);case 14:return e.next=16,this.CallContractMethod({contractAddress:this.contentSpaceAddress,methodName:"addressKMS"});case 16:return e.abrupt("return",e.sent);case 17:case"end":return e.stop()}}),e,this)}))),t.ContentSpaceId=function(){return this.contentSpaceId},t.ContentTypeOwner=function(){var e=s(a.mark((function e(t){var r,n,i,o;return a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.name,n=t.typeId,i=t.versionHash,e.next=3,this.ContentType({name:r,typeId:n,versionHash:i});case 3:return o=e.sent,e.t0=this.utils,e.next=7,this.ethClient.CallContractMethod({contractAddress:this.utils.HashToAddress(o.id),methodName:"owner",methodArgs:[]});case 7:return e.t1=e.sent,e.abrupt("return",e.t0.FormatAddress.call(e.t0,e.t1));case 9:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}(),t.ContentType=function(){var e=s(a.mark((function e(t){var r,n,i,o,s,A,c;return a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.name,n=t.typeId,i=t.versionHash,o=t.publicOnly,s=void 0!==o&&o,this.Log("Retrieving content type: ".concat(r||n||i)),i&&(n=this.utils.DecodeVersionHash(i).objectId),!r){e.next=13;break}return this.Log("Looking up type by name in content space metadata..."),e.prev=5,e.next=8,this.ContentObjectMetadata({libraryId:this.contentSpaceLibraryId,objectId:this.contentSpaceObjectId,metadataSubtree:u("public","contentTypes",r)});case 8:n=e.sent,e.next=13;break;case 11:e.prev=11,e.t0=e.catch(5);case 13:if(n){e.next=23;break}return this.Log("Looking up type by name in available types..."),e.next=17,this.ContentTypes();case 17:if(A=e.sent,!r){e.next=22;break}return e.abrupt("return",Object.values(A).find((function(e){return(e.name||"").toLowerCase()===r.toLowerCase()})));case 22:return e.abrupt("return",Object.values(A).find((function(e){return e.hash===i})));case 23:if(i){e.next=27;break}return e.next=26,this.LatestVersionHash({objectId:n});case 26:i=e.sent;case 27:if(e.prev=27,this.Log("Looking up type by ID..."),!s){e.next=39;break}return e.next=32,this.ContentObjectMetadata({libraryId:this.contentSpaceLibraryId,objectId:n,versionHash:i,metadataSubtree:"public"});case 32:if(e.t1=e.sent,e.t1){e.next=35;break}e.t1={};case 35:e.t2=e.t1,c={public:e.t2},e.next=45;break;case 39:return e.next=41,this.ContentObjectMetadata({libraryId:this.contentSpaceLibraryId,objectId:n,versionHash:i});case 41:if(e.t3=e.sent,e.t3){e.next=44;break}e.t3={};case 44:c=e.t3;case 45:return e.abrupt("return",{id:n,hash:i,name:c.public&&c.public.name||c.name||n,meta:c});case 48:throw e.prev=48,e.t4=e.catch(27),this.Log("Error looking up content type:"),this.Log(e.t4),new Error("Content Type ".concat(r||n," is invalid"));case 53:case"end":return e.stop()}}),e,this,[[5,11],[27,48]])})));return function(t){return e.apply(this,arguments)}}(),t.ContentTypes=s(a.mark((function e(){var t,r,n,i=this;return a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.contentTypes=this.contentTypes||{},this.Log("Looking up all available content types"),e.next=4,this.Collection({collectionType:"contentTypes"});case 4:return t=e.sent,this.Log("Personally available types:"),this.Log(t),r={},e.prev=8,e.next=11,this.ContentObjectMetadata({libraryId:this.contentSpaceLibraryId,objectId:this.contentSpaceObjectId,metadataSubtree:"public/contentTypes"});case 11:if(e.t0=e.sent,e.t0){e.next=14;break}e.t0={};case 14:r=e.t0,e.next=19;break;case 17:e.prev=17,e.t1=e.catch(8);case 19:return n=Object.values(r).map((function(e){return i.utils.HashToAddress(e)})),this.Log("Content space types:"),this.Log(n),t=t.concat(n).filter((function(e){return e})).map((function(e){return i.utils.FormatAddress(e)})).filter((function(e,t,r){return r.indexOf(e)===t})),e.next=25,Promise.all(t.map(function(){var e=s(a.mark((function e(t){var r;return a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=i.utils.AddressToObjectId(t),i.contentTypes[r]){e.next=11;break}return e.prev=2,e.next=5,i.ContentType({typeId:r,publicOnly:!0});case 5:i.contentTypes[r]=e.sent,e.next=11;break;case 8:e.prev=8,e.t0=e.catch(2),console.error(e.t0);case 11:case"end":return e.stop()}}),e,null,[[2,8]])})));return function(t){return e.apply(this,arguments)}}()));case 25:return e.abrupt("return",this.contentTypes);case 26:case"end":return e.stop()}}),e,this,[[8,17]])}))),t.ContentLibraries=s(a.mark((function e(){var t,r=this;return a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.Collection({collectionType:"libraries"});case 2:return t=e.sent,e.abrupt("return",t.map((function(e){return r.utils.AddressToLibraryId(e)})));case 4:case"end":return e.stop()}}),e,this)}))),t.ContentLibrary=function(){var e=s(a.mark((function e(t){var r,n,i;return a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.libraryId,g(r),n=u("qlibs",r),e.t0=this.utils,e.t1=this.HttpClient,e.next=7,this.authClient.AuthorizationHeader({libraryId:r});case 7:return e.t2=e.sent,e.t3=n,e.t4={headers:e.t2,method:"GET",path:e.t3},e.t5=e.t1.Request.call(e.t1,e.t4),e.next=13,e.t0.ResponseToJson.call(e.t0,e.t5);case 13:return i=e.sent,e.abrupt("return",c(c({},i),{},{meta:i.meta||{}}));case 15:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}(),t.ContentLibraryOwner=function(){var e=s(a.mark((function e(t){var r;return a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.libraryId,g(r),e.t0=this.utils,e.next=5,this.ethClient.CallContractMethod({contractAddress:this.utils.HashToAddress(r),methodName:"owner",methodArgs:[]});case 5:return e.t1=e.sent,e.abrupt("return",e.t0.FormatAddress.call(e.t0,e.t1));case 7:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}(),t.LibraryContentTypes=function(){var e=s(a.mark((function e(t){var r,n,i,o=this;return a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.libraryId,g(r),this.Log("Retrieving library content types for ".concat(r)),e.next=5,this.ethClient.CallContractMethod({contractAddress:this.utils.HashToAddress(r),methodName:"contentTypesLength",methodArgs:[]});case 5:if(n=e.sent.toNumber(),this.Log("".concat(n," types")),0!==n){e.next=9;break}return e.abrupt("return",{});case 9:return i={},e.next=12,Promise.all(Array.from(new Array(n),function(){var e=s(a.mark((function e(t,n){var s,A;return a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,o.ethClient.CallContractMethod({contractAddress:o.utils.HashToAddress(r),methodName:"contentTypes",methodArgs:[n]});case 2:return s=e.sent,A=o.utils.AddressToObjectId(s),e.next=6,o.ContentType({typeId:A});case 6:i[A]=e.sent;case 7:case"end":return e.stop()}}),e)})));return function(t,r){return e.apply(this,arguments)}}()));case 12:return this.Log(i),e.abrupt("return",i);case 14:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}(),t.ContentObjects=function(){var e=s(a.mark((function e(t){var r,n,i,o,s,A,c;return a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.libraryId,n=t.filterOptions,i=void 0===n?{}:n,g(r),this.Log("Retrieving content objects from ".concat(r)),o=u("qlibs",r,"q"),s={filter:[]},i.cacheId&&(s.cache_id=i.cacheId),i.start&&(s.start=i.start),i.limit&&(s.limit=i.limit),i.select&&(s.select=i.select),i.sort&&(s.sort_by=i.sort,i.sortDesc&&(s.sort_descending=!0)),A={eq:":eq:",neq:":ne:",lt:":lt:",lte:":le:",gt:":gt:",gte:":ge:",cnt:":co:",ncnt:":nc:"},c=function(e){var t=e.key,r=e.type,n=e.filter;s.filter.push("".concat(t).concat(A[r]).concat(n))},i.filter&&(Array.isArray(i.filter)?i.filter.forEach((function(e){return c(e)})):c(i.filter)),this.Log("Filter options:"),this.Log(i),e.t0=this.utils,e.t1=this.HttpClient,e.next=19,this.authClient.AuthorizationHeader({libraryId:r});case 19:return e.t2=e.sent,e.t3=o,e.t4=s,e.t5={headers:e.t2,method:"GET",path:e.t3,queryParams:e.t4},e.t6=e.t1.Request.call(e.t1,e.t5),e.next=26,e.t0.ResponseToJson.call(e.t0,e.t6);case 26:return e.abrupt("return",e.sent);case 27:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}(),t.ContentObject=function(){var e=s(a.mark((function e(t){var r,n,i,o,s;return a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.libraryId,n=t.objectId,i=t.versionHash,o=t.writeToken,b({libraryId:r,objectId:n,versionHash:i}),this.Log("Retrieving content object: ".concat(r||""," ").concat(o||i||n)),i&&(n=this.utils.DecodeVersionHash(i).objectId),s=u("q",o||i||n),e.t0=this.utils,e.t1=this.HttpClient,e.next=9,this.authClient.AuthorizationHeader({libraryId:r,objectId:n,versionHash:i});case 9:return e.t2=e.sent,e.t3=s,e.t4={headers:e.t2,method:"GET",path:e.t3},e.t5=e.t1.Request.call(e.t1,e.t4),e.next=15,e.t0.ResponseToJson.call(e.t0,e.t5);case 15:return e.abrupt("return",e.sent);case 16:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}(),t.ContentObjectOwner=function(){var e=s(a.mark((function e(t){var r;return a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.objectId,d(r),this.Log("Retrieving content object owner: ".concat(r)),e.t0=this.utils,e.next=6,this.ethClient.CallContractMethod({contractAddress:this.utils.HashToAddress(r),methodName:"owner",methodArgs:[]});case 6:return e.t1=e.sent,e.abrupt("return",e.t0.FormatAddress.call(e.t0,e.t1));case 8:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}(),t.ContentObjectTenantId=function(){var e=s(a.mark((function e(t){var r,n;return a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.objectId,(n=t.versionHash)?p(n):d(r),n&&(r=this.utils.DecodeVersionHash(n).objectId),this.objectTenantIds[r]){e.next=7;break}return e.next=6,this.authClient.MakeElvMasterCall({methodName:"elv_getTenantById",params:[this.contentSpaceId,r]});case 6:this.objectTenantIds[r]=e.sent;case 7:return e.abrupt("return",this.objectTenantIds[r]);case 8:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}(),t.ContentObjectLibraryId=function(){var e=s(a.mark((function e(t){var r,n,i=this;return a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.objectId,(n=t.versionHash)?p(n):d(r),n&&(r=this.utils.DecodeVersionHash(n).objectId),e.next=5,this.authClient.AccessType(r);case 5:e.t0=e.sent,e.next=e.t0===this.authClient.ACCESS_TYPES.LIBRARY?8:e.t0===this.authClient.ACCESS_TYPES.OBJECT?9:e.t0===this.authClient.ACCESS_TYPES.OTHER?20:21;break;case 8:return e.abrupt("return",this.utils.AddressToLibraryId(this.utils.HashToAddress(r)));case 9:return this.objectLibraryIds[r]||(this.Log("Retrieving content object library ID: ".concat(r||n)),this.objectLibraryIds[r]=new Promise(function(){var e=s(a.mark((function e(t,n){return a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.t0=t,e.t1=i.utils,e.next=5,i.CallContractMethod({contractAddress:i.utils.HashToAddress(r),methodName:"libraryAddress"});case 5:e.t2=e.sent,e.t3=e.t1.AddressToLibraryId.call(e.t1,e.t2),(0,e.t0)(e.t3),e.next=13;break;case 10:e.prev=10,e.t4=e.catch(0),n(e.t4);case 13:case"end":return e.stop()}}),e,null,[[0,10]])})));return function(t,r){return e.apply(this,arguments)}}())),e.prev=10,e.next=13,this.objectLibraryIds[r];case 13:return e.abrupt("return",e.sent);case 16:throw e.prev=16,e.t1=e.catch(10),delete this.objectLibraryIds[r],e.t1;case 20:throw Error("Unable to retrieve library ID for ".concat(n||r,": Unknown type. (wrong network or deleted object?)"));case 21:return e.abrupt("return",this.contentSpaceLibraryId);case 22:case"end":return e.stop()}}),e,this,[[10,16]])})));return function(t){return e.apply(this,arguments)}}(),t.ProduceMetadataLinks=function(){var e=s(a.mark((function e(t){var r,n,o,A,f,h,l,g,d,p=this;return a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.libraryId,n=t.objectId,o=t.versionHash,A=t.path,f=void 0===A?"/":A,h=t.metadata,l=t.authorizationToken,g=t.noAuth,h&&"object"===i(h)){e.next=3;break}return e.abrupt("return",h);case 3:if(!Array.isArray(h)){e.next=7;break}return e.next=6,this.utils.LimitedMap(5,h,function(){var e=s(a.mark((function e(t,i){return a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,p.ProduceMetadataLinks({libraryId:r,objectId:n,versionHash:o,path:u(f,i.toString()),metadata:t,authorizationToken:l,noAuth:g});case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e)})));return function(t,r){return e.apply(this,arguments)}}());case 6:return e.abrupt("return",e.sent);case 7:if(!h["/"]||!h["/"].match(/\.\/(rep|files)\/.+/)&&!h["/"].match(/^\/?qfab\/([\w]+)\/?(rep|files)\/.+/)){e.next=16;break}return e.t0=c,e.t1=c({},h),e.t2={},e.next=13,this.LinkUrl({libraryId:r,objectId:n,versionHash:o,linkPath:f,authorizationToken:l});case 13:return e.t3=e.sent,e.t4={url:e.t3},e.abrupt("return",(0,e.t0)(e.t1,e.t2,e.t4));case 16:return d={},e.next=19,this.utils.LimitedMap(5,Object.keys(h),function(){var e=s(a.mark((function e(t){return a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,p.ProduceMetadataLinks({libraryId:r,objectId:n,versionHash:o,path:u(f,t),metadata:h[t],authorizationToken:l,noAuth:g});case 2:d[t]=e.sent;case 3:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}());case 19:return e.abrupt("return",d);case 20:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}(),t.MetadataAuth=function(){var e=s(a.mark((function e(t){var r,n,i,o,s,A,c,u,f,h,l,g,d;return a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.libraryId,n=t.objectId,i=t.versionHash,o=t.path,s=void 0===o?"/":o,A=t.channelAuth,c=void 0!==A&&A,u=t.noAuth,f=void 0!==u&&u,b({libraryId:r,objectId:n,versionHash:i}),i&&(n=this.utils.DecodeVersionHash(i).objectId),f=this.noAuth||f,h=f,f){e.next=14;break}return e.next=8,this.Visibility({id:n});case 8:return g=e.sent,e.next=11,this.AccessType({id:n});case 11:l=e.sent,h=(s||"").replace(/^\/+/,"").startsWith("public"),f=g>=10||h&&g>=1;case 14:if(!this.oauthToken){e.next=22;break}return e.next=17,this.authClient.KMSAddress({objectId:n,versionHash:i});case 17:if(!(d=e.sent)||this.utils.EqualAddress(d,this.utils.nullAddress)){e.next=22;break}return e.next=21,this.authClient.AuthorizationToken({libraryId:r,objectId:n,versionHash:i,channelAuth:!0,oauthToken:this.oauthToken});case 21:return e.abrupt("return",e.sent);case 22:if(this.inaccessibleLibraries[r]||!h||l!==this.authClient.ACCESS_TYPES.OBJECT||c){e.next=48;break}if(e.prev=23,e.t0=this.authClient,e.t1=r,e.t1){e.next=30;break}return e.next=29,this.ContentObjectLibraryId({objectId:n,versionHash:i});case 29:e.t1=e.sent;case 30:return e.t2=e.t1,e.t3=f,e.t4={libraryId:e.t2,noAuth:e.t3},e.next=35,e.t0.AuthorizationToken.call(e.t0,e.t4);case 35:return e.abrupt("return",e.sent);case 38:if(e.prev=38,e.t5=e.catch(23),!e.t5.message||!e.t5.message.toLowerCase().startsWith("access denied")){e.next=45;break}return this.inaccessibleLibraries[r]=!0,e.next=44,this.authClient.AuthorizationToken({libraryId:r,objectId:n,versionHash:i,noAuth:f,channelAuth:c});case 44:return e.abrupt("return",e.sent);case 45:throw e.t5;case 46:e.next=51;break;case 48:return e.next=50,this.authClient.AuthorizationToken({libraryId:r,objectId:n,versionHash:i,noAuth:f,channelAuth:c});case 50:return e.abrupt("return",e.sent);case 51:case"end":return e.stop()}}),e,this,[[23,38]])})));return function(t){return e.apply(this,arguments)}}(),t.ContentObjectMetadata=function(){var e=s(a.mark((function e(t){var r,n,i,o,s,A,h,l,g,d,p,I,y,m,C,v,B,w,Q,k,_,S,D,M,R,x,O,N,P,F,j,T=arguments;return a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.libraryId,n=t.objectId,i=t.versionHash,o=t.writeToken,s=t.metadataSubtree,A=void 0===s?"/":s,h=t.localizationSubtree,l=t.queryParams,g=void 0===l?{}:l,d=t.select,p=void 0===d?[]:d,I=t.remove,y=void 0===I?[]:I,m=t.authorizationToken,C=t.noAuth,v=void 0!==C&&C,B=t.resolveLinks,w=void 0!==B&&B,Q=t.resolveIncludeSource,k=void 0!==Q&&Q,_=t.resolveIgnoreErrors,S=void 0!==_&&_,D=t.linkDepthLimit,M=void 0===D?1:D,R=t.produceLinkUrls,x=void 0!==R&&R,b({libraryId:r,objectId:n,versionHash:i}),this.Log("Retrieving content object metadata: ".concat(r||""," ").concat(n||i," ").concat(o||"","\n Subtree: ").concat(A)),g=c({},g||{}),i&&(n=this.utils.DecodeVersionHash(i).objectId),O=u("q",o||i||n,"meta",A),e.next=8,this.MetadataAuth({libraryId:r,objectId:n,versionHash:i,path:A,noAuth:v});case 8:return N=e.sent,P=[m,g.authorization,N].flat().filter((function(e){return e})),delete g.authorization,e.prev=11,e.next=14,this.utils.ResponseToJson(this.HttpClient.Request({headers:{Authorization:P.map((function(e){return"Bearer ".concat(e)}))},queryParams:c(c({},g),{},{select:p,remove:y,link_depth:M,resolve:w,resolve_include_source:k,resolve_ignore_errors:S}),method:"GET",path:O}));case 14:F=e.sent,e.next=27;break;case 17:if(e.prev=17,e.t0=e.catch(11),404===e.t0.status){e.next=21;break}throw e.t0;case 21:if(!f.get(e.t0.body,"errors[0].cause.cause.cause.qwtoken")){e.next=26;break}throw e.t0;case 26:F="/"===A?{}:void 0;case 27:if(!x){e.next=31;break}return e.next=30,this.ProduceMetadataLinks({libraryId:r,objectId:n,versionHash:i,path:A,metadata:F,authorizationToken:m,noAuth:v});case 30:F=e.sent;case 31:if(h){e.next=33;break}return e.abrupt("return",F);case 33:return e.prev=33,e.next=36,this.ContentObjectMetadata(c(c({},T[0]),{},{metadataSubtree:h,localizationSubtree:void 0}));case 36:return j=e.sent,e.abrupt("return",E({},F,j,(function(e,t){return null===t||""===t?e:void 0})));case 40:return e.prev=40,e.t1=e.catch(33),this.Log(e.t1,!0),e.abrupt("return",F);case 44:case"end":return e.stop()}}),e,this,[[11,17],[33,40]])})));return function(t){return e.apply(this,arguments)}}(),t.AssetMetadata=function(){var e=s(a.mark((function e(t){var r,i,o,s,A,f,h,l,g,d=this;return a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.libraryId,i=t.objectId,o=t.versionHash,s=t.metadata,A=t.localization,f=t.noAuth,h=t.produceLinkUrls,l=void 0!==h&&h,b({libraryId:r,objectId:i,versionHash:o}),i||(i=this.utils.DecodeVersionHash(o).objectId),s){e.next=12;break}return e.next=6,this.ContentObjectMetadata({libraryId:r,objectId:i,versionHash:o,metadataSubtree:"public/asset_metadata",resolveLinks:!0,linkDepthLimit:2,resolveIgnoreErrors:!0,produceLinkUrls:l,noAuth:f});case 6:if(e.t0=e.sent,e.t0){e.next=9;break}e.t0={};case 9:s=e.t0,e.next=16;break;case 12:if(!l){e.next=16;break}return e.next=15,this.ProduceMetadataLinks({libraryId:r,objectId:i,versionHash:o,path:u("public","asset_metadata"),metadata:s,noAuth:f});case 15:s=e.sent;case 16:return s.info||(s.info={}),g=c({},s),A&&A.reverse().forEach((function(e){var t,r=(t=d.utils).SafeTraverse.apply(t,[s].concat(n(e)))||{};g=E({},g,r,(function(e,t){return null===t||""===t?e:void 0}))})),e.abrupt("return",g);case 20:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}(),t.ContentObjectVersions=function(){var e=s(a.mark((function e(t){var r,n,i;return a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.libraryId,n=t.objectId,b({libraryId:r,objectId:n}),this.Log("Retrieving content object versions: ".concat(r||""," ").concat(n)),i=u("qid",n),e.t0=this.utils,e.t1=this.HttpClient,e.next=8,this.authClient.AuthorizationHeader({libraryId:r,objectId:n});case 8:return e.t2=e.sent,e.t3=i,e.t4={headers:e.t2,method:"GET",path:e.t3},e.t5=e.t1.Request.call(e.t1,e.t4),e.abrupt("return",e.t0.ResponseToJson.call(e.t0,e.t5));case 13:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}(),t.LatestVersionHash=function(){var e=s(a.mark((function e(t){var r,n,i,o;return a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.objectId,(n=t.versionHash)&&(r=this.utils.DecodeVersionHash(n).objectId),d(r),e.prev=3,e.next=6,this.CallContractMethod({contractAddress:this.utils.HashToAddress(r),methodName:"objectHash"});case 6:i=e.sent,e.next=11;break;case 9:e.prev=9,e.t0=e.catch(3);case 11:if(i){e.next=20;break}return e.next=14,this.CallContractMethod({contractAddress:this.utils.HashToAddress(r),methodName:"countVersionHashes"});case 14:if((o=e.sent).toNumber()){e.next=17;break}throw Error("Unable to determine latest version hash for ".concat(n||r," - Item deleted?"));case 17:return e.next=19,this.CallContractMethod({contractAddress:this.utils.HashToAddress(r),methodName:"versionHashes",methodArgs:[o-1]});case 19:i=e.sent;case 20:return e.abrupt("return",i);case 21:case"end":return e.stop()}}),e,this,[[3,9]])})));return function(t){return e.apply(this,arguments)}}(),t.AvailableDRMs=s(a.mark((function e(){var t,r,n,i,o,s,A,c,u;return a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=["clear","aes-128"],"undefined"!=typeof window){e.next=3;break}return e.abrupt("return",t);case 3:if(window.navigator&&window.navigator.userAgent&&((r=window.navigator.userAgent.match(/(iPad|iPhone|iphone|iPod).*?(OS |os |OS_)(\d+((_|\.)\d)?((_|\.)\d)?)/))&&r[3]&&(n=r[3].split("_"),i=parseInt(n[0]),o=parseInt(n[1]),(i>13||13===i&&o>=1)&&(t[1]="sample-aes",t[2]="fairplay")),/^((?!chrome|android).)*safari/i.test(window.navigator.userAgent)&&(s=window.navigator.userAgent.match(/.+Version\/(\d+)\.(\d+)/))&&s[2]&&(A=parseInt(s[1]),c=parseInt(s[2]),(A>13||13===A&&c>=1)&&(t[1]="sample-aes",t[2]="fairplay"))),"undefined"==typeof window||"function"==typeof window.navigator.requestMediaKeySystemAccess){e.next=6;break}return e.abrupt("return",t);case 6:return e.prev=6,u=[{initDataTypes:["cenc"],audioCapabilities:[{contentType:'audio/mp4;codecs="mp4a.40.2"'}],videoCapabilities:[{contentType:'video/mp4;codecs="avc1.42E01E"'}]}],e.next=10,navigator.requestMediaKeySystemAccess("com.widevine.alpha",u);case 10:t.push("widevine"),e.next=15;break;case 13:e.prev=13,e.t0=e.catch(6);case 15:return e.abrupt("return",t);case 16:case"end":return e.stop()}}),e,null,[[6,13]])}))),t.PlayoutPathResolution=function(){var e=s(a.mark((function e(t){var r,n,i,o,s,A,c,f,h,l,g,d,p,I,y,b,E;return a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.libraryId,n=t.objectId,i=t.versionHash,o=t.writeToken,s=t.linkPath,A=t.handler,c=t.offering,f=void 0===c?"":c,h=t.signedLink,l=void 0!==h&&h,g=t.authorizationToken,r){e.next=5;break}return e.next=4,this.ContentObjectLibraryId({objectId:n});case 4:r=e.sent;case 5:if(i){e.next=9;break}return e.next=8,this.LatestVersionHash({objectId:n});case 8:i=e.sent;case 9:if(d=u("qlibs",r,"q",o||i,"rep",A,f,"options.json"),!s){e.next=26;break}return e.next=13,this.ContentObjectMetadata({libraryId:r,objectId:n,versionHash:i,writeToken:o,metadataSubtree:s,resolveLinks:!1,resolveIgnoreErrors:!0,resolveIncludeSource:!0,authorizationToken:g});case 13:if(E=e.sent,b=!!E&&!!E["/"]&&!E["/"].endsWith("options.json"),d=u("qlibs",r,"q",o||i,"meta",s),l){e.next=25;break}return e.next=19,this.LinkTarget({libraryId:r,objectId:n,versionHash:i,writeToken:o,linkPath:s,linkInfo:E,authorizationToken:g});case 19:return y=e.sent,I=this.utils.DecodeVersionHash(y).objectId,e.next=23,this.ContentObjectLibraryId({objectId:I});case 23:p=e.sent,b||f||(d=u("q",y,"rep",A,"options.json"));case 25:b&&(d=u(d,f,"options.json"));case 26:return e.abrupt("return",{path:d,multiOfferingLink:b,linkTarget:{libraryId:p,objectId:I,versionHash:y}});case 27:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}(),t.AvailableOfferings=function(){var e=s(a.mark((function e(t){var r,n,i,o,s,A,c,u,f,h,l,g;return a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.objectId,n=t.versionHash,i=t.writeToken,o=t.linkPath,s=t.signedLink,A=t.directLink,c=t.handler,u=void 0===c?"playout":c,f=t.authorizationToken,r||(r=this.utils.DecodeVersionHash(n).objectId),!A){e.next=15;break}return e.t0=this,e.next=6,this.ContentObjectLibraryId({objectId:r});case 6:return e.t1=e.sent,e.t2=r,e.t3=n,e.t4=o,e.t5=f,e.t6={libraryId:e.t1,objectId:e.t2,versionHash:e.t3,metadataSubtree:e.t4,resolveLinks:!0,authorizationToken:e.t5},e.next=14,e.t0.ContentObjectMetadata.call(e.t0,e.t6);case 14:return e.abrupt("return",e.sent);case 15:return e.next=17,this.PlayoutPathResolution({objectId:r,versionHash:n,writeToken:i,linkPath:o,signedLink:s,handler:u,authorizationToken:f});case 17:return h=e.sent,l=h.path,e.prev=19,e.t7=f,e.next=23,this.authClient.AuthorizationToken({objectId:r,channelAuth:!0,oauthToken:this.oauthToken});case 23:return e.t8=e.sent,g=[e.t7,e.t8].flat().filter((function(e){return e})),e.next=27,this.utils.ResponseToJson(this.HttpClient.Request({path:l,method:"GET",headers:{Authorization:"Bearer ".concat(g.join(","))}}));case 27:return e.abrupt("return",e.sent);case 30:if(e.prev=30,e.t9=e.catch(19),!e.t9.status||500!==parseInt(e.t9.status)){e.next=34;break}return e.abrupt("return",{});case 34:throw e.t9;case 35:case"end":return e.stop()}}),e,this,[[19,30]])})));return function(t){return e.apply(this,arguments)}}(),t.PlayoutOptions=function(){var e=s(a.mark((function e(t){var r,n,i,A,f,h,l,g,I,y,b,E,m,C,v,B,w,Q,k,_,S,D,M,R,x,O,N,P,F,j,T,U,L,H,G,Y,K,q,J,z,V,Z,W,X,$,ee,te=this;return a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.offeringURI,n=t.objectId,i=t.versionHash,A=t.writeToken,f=t.linkPath,h=t.signedLink,l=void 0!==h&&h,g=t.protocols,I=void 0===g?["dash","hls"]:g,y=t.handler,b=void 0===y?"playout":y,E=t.offering,m=void 0===E?"default":E,C=t.playoutType,v=t.drms,B=void 0===v?[]:v,w=t.context,Q=t.hlsjsProfile,k=void 0===Q||Q,_=t.authorizationToken,S=t.options,D=void 0===S?{}:S,!r){e.next=8;break}if(M=r.match(/(hq__[^/]+)\/rep\/([^/]+)\/([^/]+)\/options.json/),i=M[1],b=M[2],m=M[3],i&&b&&m){e.next=8;break}throw Error("Invalid offering URI: ".concat(r));case 8:if(i?p(i):d(n),I=I.map((function(e){return e.toLowerCase()})),B=B.map((function(e){return e.toLowerCase()})),n){e.next=15;break}n=this.utils.DecodeVersionHash(i).objectId,e.next=19;break;case 15:if(i){e.next=19;break}return e.next=18,this.LatestVersionHash({objectId:n});case 18:i=e.sent;case 19:return e.next=21,this.ContentObjectLibraryId({objectId:n});case 21:if(R=e.sent,e.prev=22,f){e.next=29;break}return x=u("public","asset_metadata","sources",m),e.next=27,this.ContentObjectMetadata({libraryId:R,objectId:n,versionHash:i,metadataSubtree:x,authorizationToken:_});case 27:e.sent&&(f=x);case 29:e.next=33;break;case 31:e.prev=31,e.t0=e.catch(22);case 33:return e.next=35,this.PlayoutPathResolution({libraryId:R,objectId:n,versionHash:i,writeToken:A,linkPath:f,signedLink:l,handler:b,offering:m,authorizationToken:_});case 35:if(O=e.sent,N=O.path,P=O.linkTarget,e.t1=this.authClient,e.t2=P.objectId||n,e.t3=P.versionHash||i,e.t3){e.next=45;break}return e.next=44,this.LatestVersionHash({objectId:n});case 44:e.t3=e.sent;case 45:return e.t4=e.t3,e.t5=I,e.t6=B,e.t7=w,e.t8={objectId:e.t2,versionHash:e.t4,protocols:e.t5,drms:e.t6,context:e.t7},F=e.t1.AudienceData.call(e.t1,e.t8),e.t9=_,e.next=54,this.authClient.AuthorizationToken({libraryId:R,objectId:n,channelAuth:!0,oauthToken:this.oauthToken,audienceData:F});case 54:return e.t10=e.sent,j=[e.t9,e.t10].flat().filter((function(e){return e})),T=c({authorization:j,resolve:!!f},D),e.t11=Object,e.next=60,this.utils.ResponseToJson(this.HttpClient.Request({path:N,method:"GET",queryParams:T}));case 60:if(e.t12=e.sent,U=e.t11.values.call(e.t11,e.t12),l||!P.versionHash){e.next=68;break}return e.t13=_,e.next=66,this.authClient.AuthorizationToken({libraryId:P.libraryId,objectId:P.objectId,channelAuth:!0,oauthToken:this.oauthToken,audienceData:F});case 66:e.t14=e.sent,T.authorization=[e.t13,e.t14].flat().filter((function(e){return e}));case 68:L={},Y=0;case 70:if(!(Y<U.length)){e.next=116;break}if(K=U[Y],q=K.properties.protocol,J=K.properties.drm,H=H||K.sid,G=G||!!K.properties.multiview,H&&(T.sid=H),z=K.uri.split("?")[0],C&&(z=z.replace("playlist","playlist-".concat(C))),V=K.properties.license_servers,Z=K.properties.cert,k&&"hls"===q&&"aes-128"===J&&(T.player_profile="hls-js"),e.t15=c,e.t16=c({},L[q]||{}),e.t17={},e.t18=c,e.t19=c({},(L[q]||{}).playoutMethods||{}),e.t20={},e.t21=o,e.t22={},e.t23=J||"clear",!l){e.next=97;break}return e.next=94,this.LinkUrl({versionHash:i,linkPath:u(f,m,z),queryParams:T,noAuth:!0});case 94:e.t24=e.sent,e.next=100;break;case 97:return e.next=99,this.Rep({libraryId:P.libraryId||R,objectId:P.objectId||n,versionHash:P.versionHash||i,rep:u(b,m,z),noAuth:!0,queryParams:T});case 99:e.t24=e.sent;case 100:for(W in e.t25=e.t24,e.t26=J?o({},J,{licenseServers:V,cert:Z}):void 0,e.t27={playoutUrl:e.t25,drms:e.t26},e.t28=(0,e.t21)(e.t22,e.t23,e.t27),e.t29=(0,e.t18)(e.t19,e.t20,e.t28),e.t30={playoutMethods:e.t29},L[q]=(0,e.t15)(e.t16,e.t17,e.t30),L[q].playoutMethods)L[q].playoutMethods[W].drms&&L[q].playoutMethods[W].drms[J]&&L[q].playoutMethods[W].drms[J].cert&&((X=new URL(L[q].playoutMethods[W].playoutUrl)).pathname=X.pathname.split("/").slice(0,-1).concat(["drm.cert"]).join("/"),L[q].playoutMethods[W].drms[J].cert_url=X.toString());if($=I.includes(q),ee=B.includes(J||"clear")||0===B.length&&!J,$&&ee){e.next=112;break}return e.abrupt("continue",113);case 112:(!L[q].playoutUrl||J&&"clear"!==J)&&(L[q].playoutUrl=L[q].playoutMethods[J||"clear"].playoutUrl,L[q].drms=L[q].playoutMethods[J||"clear"].drms);case 113:Y++,e.next=70;break;case 116:return G&&H&&(L.sessionId=H,L.multiview=!0,L.AvailableViews=s(a.mark((function e(){return a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.t0=te.utils,e.next=3,te.HttpClient.Request({path:u("q",P.versionHash||i,"rep",b,m,"views.json"),method:"GET",queryParams:{sid:H,authorization:j}});case 3:return e.t1=e.sent,e.next=6,e.t0.ResponseToFormat.call(e.t0,"json",e.t1);case 6:return e.abrupt("return",e.sent);case 7:case"end":return e.stop()}}),e)}))),L.SwitchView=function(){var e=s(a.mark((function e(t){return a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,te.HttpClient.Request({path:u("q",P.versionHash||i,"rep",b,m,"select_view"),method:"POST",queryParams:{sid:H,authorization:j},body:{view:t}});case 2:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()),this.Log(L),e.abrupt("return",L);case 119:case"end":return e.stop()}}),e,this,[[22,31]])})));return function(t){return e.apply(this,arguments)}}(),t.BitmovinPlayoutOptions=function(){var e=s(a.mark((function e(t){var r,n,i,o,s,A,c,u,f,h,l,g,I,y,b,E,m,C,v,B,w,Q,k,_;return a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.objectId,n=t.versionHash,i=t.writeToken,o=t.linkPath,s=t.signedLink,A=void 0!==s&&s,c=t.protocols,u=void 0===c?["dash","hls"]:c,f=t.drms,h=void 0===f?[]:f,l=t.handler,g=void 0===l?"playout":l,I=t.offering,y=void 0===I?"default":I,b=t.playoutType,E=t.context,m=t.authorizationToken,C=t.options,v=void 0===C?{}:C,n?p(n):d(r),r||(r=this.utils.DecodeVersionHash(n).objectId),e.next=5,this.PlayoutOptions({objectId:r,versionHash:n,writeToken:i,linkPath:o,signedLink:A,protocols:u,drms:h,handler:g,offering:y,playoutType:b,hlsjsProfile:!1,context:E,authorizationToken:m,options:v});case 5:return delete(B=e.sent).playoutMethods,e.next=9,this.PlayoutPathResolution({objectId:r,versionHash:n,writeToken:i,linkPath:o,signedLink:A,handler:g,offering:y,authorizationToken:m});case 9:if(w=e.sent,Q=w.linkTarget,k=[],m&&k.push(m),!A&&Q.versionHash){e.next=21;break}return e.t0=k,e.next=17,this.authClient.AuthorizationToken({objectId:r,channelAuth:!0,oauthToken:this.oauthToken});case 17:e.t1=e.sent,e.t0.push.call(e.t0,e.t1),e.next=26;break;case 21:return e.t2=k,e.next=24,this.authClient.AuthorizationToken({libraryId:Q.libraryId,objectId:Q.objectId,channelAuth:!0,oauthToken:this.oauthToken});case 24:e.t3=e.sent,e.t2.push.call(e.t2,e.t3);case 26:return _={drm:{}},Object.keys(B).forEach((function(e){var t=B[e];_[e]=t.playoutUrl,t.drms&&Object.keys(t.drms).forEach((function(e){if(t.drms[e].licenseServers&&0!==t.drms[e].licenseServers.length){var r=function(e){return e.toLowerCase().startsWith("https")},n=t.drms[e].licenseServers;n.find(r)&&(n=n.filter(r));var i=n.sort((function(){return.5-Math.random()}))[0];_.drm[e]||(_.drm[e]={LA_URL:i,headers:{Authorization:"Bearer ".concat(k.flat().filter((function(e){return e})).join(","))}})}}))})),e.abrupt("return",_);case 29:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}(),t.CallBitcodeMethod=function(){var e=s(a.mark((function e(t){var r,n,i,o,s,A,c,f,h,l,g,d,p,I,y,E;return a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.libraryId,n=t.objectId,i=t.versionHash,o=t.writeToken,s=t.method,A=t.queryParams,c=void 0===A?{}:A,f=t.body,h=void 0===f?{}:f,l=t.headers,g=void 0===l?{}:l,d=t.constant,p=void 0===d||d,I=t.format,y=void 0===I?"json":I,b({libraryId:r,objectId:n,versionHash:i}),s){e.next=4;break}throw"Bitcode method not specified";case 4:if(i&&(n=this.utils.DecodeVersionHash(i).objectId),E=u("q",o||i||n,"call",s),r&&(E=u("qlibs",r,E)),g.authorization||g.Authorization){e.next=12;break}return e.next=11,this.authClient.AuthorizationHeader({libraryId:r,objectId:n,update:!p});case 11:g.Authorization=e.sent.Authorization;case 12:return this.Log("Calling bitcode method: ".concat(r||""," ").concat(n||i," ").concat(o||"","\n ").concat(p?"GET":"POST"," ").concat(E,"\n Query Params:\n ").concat(JSON.stringify(c||""),"\n Body:\n ").concat(JSON.stringify(h||""),"\n Headers\n ").concat(JSON.stringify(g||""))),e.t0=this.utils,e.t1=y,e.next=17,this.HttpClient.Request({body:h,headers:g,method:p?"GET":"POST",path:E,queryParams:c,failover:!1});case 17:return e.t2=e.sent,e.abrupt("return",e.t0.ResponseToFormat.call(e.t0,e.t1,e.t2));case 19:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}(),t.Rep=function(){var e=s(a.mark((function e(t){var r,n,i,o,s,A,c,u,f,h,l,g;return a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.libraryId,n=t.objectId,i=t.versionHash,o=t.rep,s=t.queryParams,A=void 0===s?{}:s,c=t.channelAuth,u=void 0!==c&&c,f=t.noAuth,h=void 0!==f&&f,l=t.noCache,g=void 0!==l&&l,b({libraryId:r,objectId:n,versionHash:i}),o){e.next=4;break}throw"Rep not specified";case 4:return e.abrupt("return",this.FabricUrl({libraryId:r,objectId:n,versionHash:i,rep:o,queryParams:A,channelAuth:u,noAuth:h,noCache:g}));case 5:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}(),t.PublicRep=function(){var e=s(a.mark((function e(t){var r,n,i,o,s,A;return a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.libraryId,n=t.objectId,i=t.versionHash,o=t.rep,s=t.queryParams,A=void 0===s?{}:s,b({libraryId:r,objectId:n,versionHash:i}),o){e.next=4;break}throw"Rep not specified";case 4:return e.abrupt("return",this.FabricUrl({libraryId:r,objectId:n,versionHash:i,publicRep:o,queryParams:A,noAuth:!0}));case 5:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}(),t.FabricUrl=function(){var e=s(a.mark((function e(t){var r,n,i,o,s,A,f,h,l,g,d,p,I,y,E,m,C,v;return a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.libraryId,n=t.objectId,i=t.versionHash,o=t.writeToken,s=t.partHash,A=t.rep,f=t.publicRep,h=t.call,l=t.queryParams,g=void 0===l?{}:l,d=t.channelAuth,p=void 0!==d&&d,I=t.noAuth,y=void 0!==I&&I,E=t.noCache,m=void 0!==E&&E,(n||i)&&b({libraryId:r,objectId:n,versionHash:i}),i&&(n=this.utils.DecodeVersionHash(i).objectId),this.Log("Building Fabric URL:\n libraryId: ".concat(r,"\n objectId: ").concat(n,"\n versionHash: ").concat(i,"\n writeToken: ").concat(o,"\n partHash: ").concat(s,"\n rep: ").concat(A,"\n publicRep: ").concat(f,"\n call: ").concat(h,"\n channelAuth: ").concat(p,"\n noAuth: ").concat(y,"\n noCache: ").concat(m,"\n queryParams: ").concat(JSON.stringify(g||{},null,2))),C=[],g.authorization&&C.push(g.authorization),y&&g.authorization){e.next=12;break}return e.t0=C,e.next=10,this.authClient.AuthorizationToken({libraryId:r,objectId:n,versionHash:i,channelAuth:p,noAuth:y,noCache:m});case 10:e.t1=e.sent,e.t0.push.call(e.t0,e.t1);case 12:if(g=c(c({},g),{},{authorization:C.flat()}),!A&&!f||!n||i){e.next=17;break}return e.next=16,this.LatestVersionHash({objectId:n});case 16:i=e.sent;case 17:return v="",r?(v=u(v,"qlibs",r),(n||i)&&(v=u(v,"q",o||i||n))):i&&(v=u("q",i)),s?v=u(v,"data",s):A?v=u(v,"rep",A):f?v=u(v,"public",f):h&&(v=u(v,"call",h)),e.abrupt("return",this.HttpClient.URL({path:v,queryParams:g}));case 21:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}(),t.FileUrl=function(){var e=s(a.mark((function e(t){var r,n,i,o,s,A,f,h,l,g,d,p;return a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.libraryId,n=t.objectId,i=t.versionHash,o=t.writeToken,s=t.filePath,A=t.queryParams,f=void 0===A?{}:A,h=t.noCache,l=void 0!==h&&h,b({libraryId:r,objectId:n,versionHash:i}),s){e.next=4;break}throw"File path not specified";case 4:return i&&(n=this.utils.DecodeVersionHash(i).objectId),g=r?u("qlibs",r,"q",o||i||n):u("q",i),e.next=8,this.authClient.AuthorizationToken({libraryId:r,objectId:n,noCache:l});case 8:return d=e.sent,f=c(c({},f),{},{authorization:d}),e.next=12,this.ContentObjectMetadata({libraryId:r,objectId:n,versionHash:i,writeToken:o,metadataSubtree:u("files",s)});case 12:return p=e.sent,p&&p["."].encryption&&"cgck"===p["."].encryption.scheme?(g=u(g,"rep","files_download",s),f["header-x_decryption_mode"]="decrypt"):g=u(g,"files",s),e.abrupt("return",this.HttpClient.URL({path:g,queryParams:f}));case 16:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}(),t.ContentObjectImageUrl=function(){var e=s(a.mark((function e(t){var r,n,i,o,s,A,c;return a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.libraryId,n=t.objectId,i=t.versionHash,o=t.height,s=t.imagePath,A=void 0===s?"public/display_image":s,b({libraryId:r,objectId:n,versionHash:i}),i){e.next=6;break}return e.next=5,this.LatestVersionHash({objectId:n});case 5:i=e.sent;case 6:if(this.Log("Retrieving content object image url: ".concat(r," ").concat(n," ").concat(i)),this.objectImageUrls[i]){e.next=26;break}return e.prev=8,e.next=11,this.ContentObjectMetadata({versionHash:i,metadataSubtree:A});case 11:if(e.sent){e.next=15;break}return this.Log("No image url set: ".concat(r," ").concat(n," ").concat(i)),e.abrupt("return");case 15:e.next=21;break;case 17:e.prev=17,e.t0=e.catch(8),this.Log("Unable to query for image metadata: ".concat(r," ").concat(n," ").concat(i),!0),this.Log(e.t0,!0);case 21:return c={},o&&!isNaN(parseInt(o))&&(c.height=parseInt(o)),e.next=25,this.LinkUrl({versionHash:i,linkPath:A,queryParams:c});case 25:this.objectImageUrls[i]=e.sent;case 26:return e.abrupt("return",this.objectImageUrls[i]);case 27:case"end":return e.stop()}}),e,this,[[8,17]])})));return function(t){return e.apply(this,arguments)}}(),t.ContentObjectGraph=function(){var e=s(a.mark((function e(t){var r,n,i,o,A,c,f,h,l,g,d=this;return a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.libraryId,n=t.objectId,i=t.versionHash,o=t.autoUpdate,A=void 0!==o&&o,c=t.select,b({libraryId:r,objectId:n,versionHash:i}),this.Log("Retrieving content object graph: ".concat(r||""," ").concat(n||i)),i&&(n=this.utils.DecodeVersionHash(i).objectId),f=u("q",i||n,"links"),e.prev=5,e.t0=this.utils,e.t1=this.HttpClient,e.next=10,this.authClient.AuthorizationHeader({libraryId:r,objectId:n,versionHash:i});case 10:return e.t2=e.sent,e.t3={auto_update:A,select:c},e.t4=f,e.t5={headers:e.t2,queryParams:e.t3,method:"GET",path:e.t4},e.t6=e.t1.Request.call(e.t1,e.t5),e.next=17,e.t0.ResponseToJson.call(e.t0,e.t6);case 17:return e.abrupt("return",e.sent);case 20:if(e.prev=20,e.t7=e.catch(5),e.prev=22,(l=e.t7.body.errors[0].cause.cause.cause.cycle)&&0!==l.length){e.next=26;break}throw e.t7;case 26:return g={},e.next=29,Promise.all(l.map(function(){var e=s(a.mark((function e(t){var r,n;return a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!g[t]){e.next=2;break}return e.abrupt("return");case 2:return r=d.utils.DecodeVersionHash(t).objectId,e.next=5,d.ContentObjectMetadata({versionHash:t,metadataSubtree:"public/asset_metadata/display_title"});case 5:if(e.t2=e.sent,e.t2){e.next=10;break}return e.next=9,d.ContentObjectMetadata({versionHash:t,metadataSubtree:"public/name"});case 9:e.t2=e.sent;case 10:if(e.t1=e.t2,e.t1){e.next=15;break}return e.next=14,d.ContentObjectMetadata({versionHash:t,metadataSubtree:"name"});case 14:e.t1=e.sent;case 15:if(e.t0=e.t1,e.t0){e.next=18;break}e.t0=r;case 18:n=e.t0,g[t]={name:n,objectId:r};case 20:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()));case 29:h=l.map((function(e){return"".concat(g[e].name," (").concat(g[e].objectId,")")})),e.next=35;break;case 32:throw e.prev=32,e.t8=e.catch(22),e.t7;case 35:throw new Error("Cycle found in links: ".concat(h.join(" -> ")));case 36:case"end":return e.stop()}}),e,this,[[5,20],[22,32]])})));return function(t){return e.apply(this,arguments)}}(),t.LinkTarget=function(){var e=s(a.mark((function e(t){var r,n,o,s,A,c,u,f,h;return a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.libraryId,n=t.objectId,o=t.versionHash,s=t.writeToken,A=t.linkPath,c=t.authorizationToken,u=t.linkInfo,b({libraryId:r,objectId:n,versionHash:o}),s&&y(s),o&&(n=this.utils.DecodeVersionHash(o).objectId),!s||r){e.next=8;break}return e.next=7,this.ContentObjectLibraryId({objectId:n});case 7:r=e.sent;case 8:if(u){e.next=12;break}return e.next=11,this.ContentObjectMetadata({libraryId:r,objectId:n,versionHash:o,writeToken:s,metadataSubtree:A,resolveLinks:!1,resolveIgnoreErrors:!0,resolveIncludeSource:!0,authorizationToken:c});case 11:u=e.sent;case 12:if(!u||!u["/"]){e.next=27;break}if((f=((u["/"]||"").match(/^\/?qfab\/([\w]+)\/?.+/)||[])[1])||(f=u["."].container),!f){e.next=19;break}return e.abrupt("return",f);case 19:if(!o){e.next=21;break}return e.abrupt("return",o);case 21:if(e.t0=o,e.t0){e.next=26;break}return e.next=25,this.LatestVersionHash({objectId:n});case 25:e.t0=e.sent;case 26:return e.abrupt("return",e.t0);case 27:return e.next=29,this.ContentObjectMetadata({libraryId:r,objectId:n,versionHash:o,writeToken:s,metadataSubtree:A,resolveIncludeSource:!0,authorizationToken:c});case 29:if((u=e.sent)&&u["."]){e.next=49;break}if("object"!==i(u)){e.next=38;break}if(e.t1=o,e.t1){e.next=37;break}return e.next=36,this.LatestVersionHash({objectId:n});case 36:e.t1=e.sent;case 37:return e.abrupt("return",e.t1);case 38:if(h=A.split("/").slice(0,-1).join("/")){e.next=46;break}if(e.t2=o,e.t2){e.next=45;break}return e.next=44,this.LatestVersionHash({objectId:n});case 44:e.t2=e.sent;case 45:return e.abrupt("return",e.t2);case 46:return e.next=48,this.ContentObjectMetadata({libraryId:r,objectId:n,versionHash:o,writeToken:s,metadataSubtree:h,resolveIncludeSource:!0,authorizationToken:c});case 48:u=e.sent;case 49:return e.abrupt("return",u["."].source);case 50:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}(),t.LinkUrl=function(){var e=s(a.mark((function e(t){var r,n,i,o,s,A,f,h,l,g,d,p,I,E,m;return a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.libraryId,n=t.objectId,i=t.versionHash,o=t.writeToken,s=t.linkPath,A=t.mimeType,f=t.authorizationToken,h=t.queryParams,l=void 0===h?{}:h,g=t.channelAuth,d=void 0!==g&&g,p=t.noAuth,I=void 0!==p&&p,b({libraryId:r,objectId:n,versionHash:i}),o&&y(o),s){e.next=5;break}throw Error("Link path not specified");case 5:return i&&(n=this.utils.DecodeVersionHash(i).objectId),E=r?u("qlibs",r,"q",o||i||n,"meta",s):u("q",i,"meta",s),m=[f],e.t0=m,e.next=11,this.MetadataAuth({libraryId:r,objectId:n,versionHash:i,path:s,channelAuth:d,noAuth:I});case 11:return e.t1=e.sent,e.t0.push.call(e.t0,e.t1),l.authorization&&m.push(l.authorization),l=c(c({},l),{},{authorization:m.flat().filter((function(e){return e})),resolve:!0}),A&&(l["header-accept"]=A),e.abrupt("return",this.HttpClient.URL({path:E,queryParams:l}));case 17:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}(),t.LinkData=function(){var e=s(a.mark((function e(t){var r,n,i,o,s,A,c,u,f,l,g;return a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.libraryId,n=t.objectId,i=t.versionHash,o=t.writeToken,s=t.linkPath,A=t.queryParams,c=void 0===A?{}:A,u=t.format,f=void 0===u?"json":u,l=t.channelAuth,e.next=3,this.LinkUrl({libraryId:r,objectId:n,versionHash:i,writeToken:o,linkPath:s,queryParams:c,channelAuth:l});case 3:return g=e.sent,e.t0=this.utils,e.t1=f,e.next=8,h.Fetch(g);case 8:return e.t2=e.sent,e.abrupt("return",e.t0.ResponseToFormat.call(e.t0,e.t1,e.t2));case 10:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}(),t.CreateEncryptionConk=function(){var e=s(a.mark((function e(t){var r,n,i,o,s,A,c,u,f,h,l;return a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.libraryId,n=t.objectId,i=t.versionHash,o=t.writeToken,s=t.createKMSConk,A=void 0===s||s,!this.signer.remoteSigner){e.next=3;break}return e.abrupt("return");case 3:if(b({libraryId:r,objectId:n,versionHash:i}),y(o),n||(n=client.DecodeVersionHash(i).objectId),r){e.next=10;break}return e.next=9,this.ContentObjectLibraryId({objectId:n});case 9:r=e.sent;case 10:return c="eluv.caps.iusr".concat(this.utils.AddressToHash(this.signer.address)),e.next=13,this.ContentObjectMetadata({libraryId:r,objectId:n,writeToken:o,metadataSubtree:c});case 13:if(!(u=e.sent)){e.next=20;break}return e.next=17,this.Crypto.DecryptCap(u,this.signer._signingKey().privateKey);case 17:this.encryptionConks[n]=e.sent,e.next=34;break;case 20:return e.next=22,this.Crypto.GeneratePrimaryConk({spaceId:this.contentSpaceId,objectId:n});case 22:return this.encryptionConks[n]=e.sent,e.t0=this,e.t1=r,e.t2=n,e.t3=o,e.t4=c,e.next=30,this.Crypto.EncryptConk(this.encryptionConks[n],this.signer._signingKey().publicKey);case 30:return e.t5=e.sent,e.t6={libraryId:e.t1,objectId:e.t2,writeToken:e.t3,metadataSubtree:e.t4,metadata:e.t5},e.next=34,e.t0.ReplaceMetadata.call(e.t0,e.t6);case 34:if(!A){e.next=64;break}return e.prev=35,e.next=38,this.authClient.KMSAddress({objectId:n});case 38:return f=e.sent,e.next=41,this.authClient.KMSInfo({objectId:n});case 41:return h=e.sent.publicKey,l="eluv.caps.ikms".concat(this.utils.AddressToHash(f)),e.next=45,this.ContentObjectMetadata({libraryId:r,objectId:n,writeToken:o,metadataSubtree:l});case 45:if(e.sent){e.next=58;break}return e.t7=this,e.t8=r,e.t9=n,e.t10=o,e.t11=l,e.next=54,this.Crypto.EncryptConk(this.encryptionConks[n],h);case 54:return e.t12=e.sent,e.t13={libraryId:e.t8,objectId:e.t9,writeToken:e.t10,metadataSubtree:e.t11,metadata:e.t12},e.next=58,e.t7.ReplaceMetadata.call(e.t7,e.t13);case 58:e.next=64;break;case 60:e.prev=60,e.t14=e.catch(35),console.error("Failed to create encryption cap for KMS:"),console.error(e.t14);case 64:return e.abrupt("return",this.encryptionConks[n]);case 65:case"end":return e.stop()}}),e,this,[[35,60]])})));return function(t){return e.apply(this,arguments)}}(),t.EncryptionConk=function(){var e=s(a.mark((function e(t){var r,n,i,o,s,A,c,u,f,h,l;return a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.libraryId,n=t.objectId,i=t.versionHash,o=t.writeToken,s=t.download,A=void 0!==s&&s,b({libraryId:r,objectId:n,versionHash:i}),o&&y(o),n||(n=client.DecodeVersionHash(i).objectId),e.next=6,this.authClient.Owner({id:n});case 6:return c=e.sent,u="eluv.caps.iusr".concat(this.utils.AddressToHash(this.signer.address)),e.next=10,this.ContentObjectMetadata({libraryId:r,objectId:n,metadataSubtree:u});case 10:if(f=e.sent,this.utils.EqualAddress(c,this.signer.address)||f){e.next=21;break}if(!A){e.next=18;break}return e.next=15,this.authClient.ReEncryptionConk({libraryId:r,objectId:n,versionHash:i});case 15:return e.abrupt("return",e.sent);case 18:return e.next=20,this.authClient.EncryptionConk({libraryId:r,objectId:n,versionHash:i});case 20:return e.abrupt("return",e.sent);case 21:if(this.encryptionConks[n]){e.next=38;break}return h="eluv.caps.iusr".concat(this.utils.AddressToHash(this.signer.address)),e.next=25,this.ContentObjectMetadata({libraryId:r,objectId:n,versionHash:i,writeToken:o,metadataSubtree:h});case 25:if(!(l=e.sent)){e.next=32;break}return e.next=29,this.Crypto.DecryptCap(l,this.signer._signingKey().privateKey);case 29:this.encryptionConks[n]=e.sent,e.next=38;break;case 32:if(!o){e.next=37;break}return e.next=35,this.CreateEncryptionConk({libraryId:r,objectId:n,versionHash:i,writeToken:o,createKMSConk:!1});case 35:e.next=38;break;case 37:throw"No encryption conk present for "+n;case 38:return e.abrupt("return",this.encryptionConks[n]);case 39:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}(),t.Encrypt=function(){var e=s(a.mark((function e(t){var r,n,i,o,s,A;return a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.libraryId,n=t.objectId,i=t.writeToken,o=t.chunk,b({libraryId:r,objectId:n}),e.next=4,this.EncryptionConk({libraryId:r,objectId:n,writeToken:i});case 4:return s=e.sent,e.next=7,this.Crypto.Encrypt(s,o);case 7:return A=e.sent,e.abrupt("return",A.buffer.slice(A.byteOffset,A.byteOffset+A.byteLength));case 9:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}(),t.Decrypt=function(){var e=s(a.mark((function e(t){var r,n,i,o,s,A;return a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.libraryId,n=t.objectId,i=t.writeToken,o=t.chunk,b({libraryId:r,objectId:n}),e.next=4,this.EncryptionConk({libraryId:r,objectId:n,writeToken:i,download:!0});case 4:return s=e.sent,e.next=7,this.Crypto.Decrypt(s,o);case 7:return A=e.sent,e.abrupt("return",A.buffer.slice(A.byteOffset,A.byteOffset+A.byteLength));case 9:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}(),t.AccessType=function(){var e=s(a.mark((function e(t){var r;return a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.id,e.next=3,this.authClient.AccessType(r);case 3:return e.abrupt("return",e.sent);case 4:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}(),t.AccessInfo=function(){var e=s(a.mark((function e(t){var r,n,i;return a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.objectId,n=t.args,d(r),n||(n=[0,[],[]]),this.Log("Retrieving access info: ".concat(r)),e.next=6,this.ethClient.CallContractMethod({contractAddress:this.utils.HashToAddress(r),methodName:"getAccessInfo",methodArgs:n});case 6:return i=e.sent,this.Log(i),e.abrupt("return",{visibilityCode:i[0],visible:i[0]>=1,accessible:i[0]>=10,editable:i[0]>=100,hasAccess:0===i[1],accessCode:i[1],accessCharge:this.utils.WeiToEther(i[2]).toString()});case 9:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}(),t.AccessRequest=function(){var e=s(a.mark((function e(t){var r,n,i,o,s,A,c,u,f;return a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.libraryId,n=t.objectId,i=t.versionHash,o=t.args,s=void 0===o?[]:o,A=t.update,c=void 0!==A&&A,u=t.noCache,f=void 0!==u&&u,b({libraryId:r,objectId:n,versionHash:i}),i&&(n=this.utils.DecodeVersionHash(i).objectId),e.next=5,this.authClient.MakeAccessRequest({libraryId:r,objectId:n,versionHash:i,args:s,update:c,skipCache:!0,noCache:f});case 5:return e.abrupt("return",e.sent);case 6:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}(),t.SetAuthContext=function(e){var t=e.context;if(t&&Object.values(t).find((function(e){return"string"!=typeof e})))throw Error("Context must be a map of string->string");this.authContext=t},t.GenerateStateChannelToken=function(){var e=s(a.mark((function e(t){var r,n,i,o,s;return a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.objectId,n=t.versionHash,i=t.context,o=t.noCache,s=void 0!==o&&o,n?p(n):d(r),!n){e.next=6;break}r=this.utils.DecodeVersionHash(n).objectId,e.next=10;break;case 6:if(this.stateChannelAccess[r]){e.next=10;break}return e.next=9,this.LatestVersionHash({objectId:r});case 9:n=e.sent;case 10:return this.stateChannelAccess[r]=n,e.next=13,this.authClient.AuthorizationToken({objectId:r,channelAuth:!0,oauthToken:this.oauthToken,context:i,noCache:s});case 13:return e.abrupt("return",e.sent);case 14:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}(),t.FinalizeStateChannelAccess=function(){var e=s(a.mark((function e(t){var r,n,i;return a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.objectId,n=t.versionHash,i=t.percentComplete,n?p(n):d(r),!n){e.next=6;break}r=this.utils.DecodeVersionHash(n).objectId,e.next=13;break;case 6:if(!this.stateChannelAccess[r]){e.next=10;break}n=this.stateChannelAccess[r],e.next=13;break;case 10:return e.next=12,this.LatestVersionHash({objectId:r});case 12:n=e.sent;case 13:return this.stateChannelAccess[r]=void 0,e.next=16,this.authClient.ChannelContentFinalize({objectId:r,versionHash:n,percent:i});case 16:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}(),t.ContentObjectAccessComplete=function(){var e=s(a.mark((function e(t){var r,n,i;return a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.objectId,n=t.score,i=void 0===n?100:n,d(r),!(i<0||i>100)){e.next=4;break}throw Error("Invalid AccessComplete score: "+i);case 4:return e.next=6,this.authClient.AccessComplete({id:r,score:i});case 6:return e.abrupt("return",e.sent);case 7:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}(),t.Collection=function(){var e=s(a.mark((function e(t){var r;return a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.collectionType,["accessGroups","contentObjects","contentTypes","contracts","libraries"].includes(r)){e.next=4;break}throw new Error("Invalid collection type: "+r);case 4:if(!this.signer){e.next=10;break}return e.next=7,this.userProfileClient.WalletAddress();case 7:e.t0=e.sent,e.next=11;break;case 10:e.t0=void 0;case 11:if(e.t0){e.next=14;break}throw new Error("Unable to get collection: User wallet doesn't exist");case 14:return this.Log("Retrieving ".concat(r," contract collection for user ").concat(this.signer.address)),e.next=17,this.ethClient.MakeProviderCall({methodName:"send",args:["elv_getWalletCollection",[this.contentSpaceId,"iusr".concat(this.utils.AddressToHash(this.signer.address)),r]]});case 17:if(e.t1=e.sent,e.t1){e.next=20;break}e.t1=[];case 20:return e.abrupt("return",e.t1);case 21:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}(),t.VerifyContentObject=function(){var e=s(a.mark((function e(t){var r,n,i;return a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.libraryId,n=t.objectId,i=t.versionHash,b({libraryId:r,objectId:n,versionHash:i}),e.next=4,ContentObjectVerification.VerifyContentObject({client:this,libraryId:r,objectId:n,versionHash:i});case 4:return e.abrupt("return",e.sent);case 5:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}(),t.Proofs=function(){var e=s(a.mark((function e(t){var r,n,i,o,s;return a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.libraryId,n=t.objectId,i=t.versionHash,o=t.partHash,b({libraryId:r,objectId:n,versionHash:i}),I(o),i&&(n=this.utils.DecodeVersionHash(i).objectId),s=u("q",i||n,"data",o,"proofs"),e.t0=this.utils,e.t1=this.HttpClient,e.next=9,this.authClient.AuthorizationHeader({libraryId:r,objectId:n,versionHash:i});case 9:return e.t2=e.sent,e.t3=s,e.t4={headers:e.t2,method:"GET",path:e.t3},e.t5=e.t1.Request.call(e.t1,e.t4),e.abrupt("return",e.t0.ResponseToJson.call(e.t0,e.t5));case 14:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}(),t.QParts=function(){var e=s(a.mark((function e(t){var r,n,i,o,s,A;return a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.libraryId,n=t.objectId,i=t.partHash,o=t.format,s=void 0===o?"blob":o,b({libraryId:r,objectId:n,versionHash:versionHash}),I(i),A=u("qparts",i),e.t0=this.utils,e.t1=s,e.t2=this.HttpClient,e.next=9,this.authClient.AuthorizationHeader({libraryId:r,objectId:n,partHash:i});case 9:return e.t3=e.sent,e.t4=A,e.t5={headers:e.t3,method:"GET",path:e.t4},e.t6=e.t2.Request.call(e.t2,e.t5),e.abrupt("return",e.t0.ResponseToFormat.call(e.t0,e.t1,e.t6));case 14:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},function(e,t,r){(function(e){var r,n,i;function o(e){return(o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}!function(a,s){"use strict";"object"===o(e)&&"object"===o(e.exports)?e.exports=s():(n=[],void 0===(i="function"==typeof(r=s)?r.apply(t,n):r)||(e.exports=i))}(0,(function(){"use strict";var e=Object.prototype.toString;function t(e,t){return null!=e&&Object.prototype.hasOwnProperty.call(e,t)}function r(e){if(!e)return!0;if(i(e)&&0===e.length)return!0;if("string"!=typeof e){for(var r in e)if(t(e,r))return!1;return!0}return!1}function n(t){return e.call(t)}var i=Array.isArray||function(t){return"[object Array]"===e.call(t)};function a(e){var t=parseInt(e);return t.toString()===e?t:e}function s(e){var s,A,c=function e(t){return Object.keys(e).reduce((function(r,n){return"create"===n||"function"==typeof e[n]&&(r[n]=e[n].bind(e,t)),r}),{})};function u(e,t){if(s(e,t))return e[t]}function f(e,t,r,n){if("number"==typeof t&&(t=[t]),!t||0===t.length)return e;if("string"==typeof t)return f(e,t.split(".").map(a),r,n);var i=t[0],o=A(e,i);return 1===t.length?(void 0!==o&&n||(e[i]=r),o):(void 0===o&&("number"==typeof t[1]?e[i]=[]:e[i]={}),f(e[i],t.slice(1),r,n))}return s=(e=e||{}).includeInheritedProps?function(){return!0}:function(e,r){return"number"==typeof r&&Array.isArray(e)||t(e,r)},A=e.includeInheritedProps?function(e,t){"string"!=typeof t&&"number"!=typeof t&&(t=String(t));var r=u(e,t);if("__proto__"===t||"prototype"===t||"constructor"===t&&"function"==typeof r)throw new Error("For security reasons, object's magic properties cannot be set");return r}:function(e,t){return u(e,t)},c.has=function(r,n){if("number"==typeof n?n=[n]:"string"==typeof n&&(n=n.split(".")),!n||0===n.length)return!!r;for(var o=0;o<n.length;o++){var s=a(n[o]);if(!("number"==typeof s&&i(r)&&s<r.length||(e.includeInheritedProps?s in Object(r):t(r,s))))return!1;r=r[s]}return!0},c.ensureExists=function(e,t,r){return f(e,t,r,!0)},c.set=function(e,t,r,n){return f(e,t,r,n)},c.insert=function(e,t,r,n){var o=c.get(e,t);n=~~n,i(o)||c.set(e,t,o=[]),o.splice(n,0,r)},c.empty=function(e,t){var a,A;if(!r(t)&&(null!=e&&(a=c.get(e,t)))){if("string"==typeof a)return c.set(e,t,"");if(function(e){return"boolean"==typeof e||"[object Boolean]"===n(e)}(a))return c.set(e,t,!1);if("number"==typeof a)return c.set(e,t,0);if(i(a))a.length=0;else{if(!function(e){return"object"===o(e)&&"[object Object]"===n(e)}(a))return c.set(e,t,null);for(A in a)s(a,A)&&delete a[A]}}},c.push=function(e,t){var r=c.get(e,t);i(r)||c.set(e,t,r=[]),r.push.apply(r,Array.prototype.slice.call(arguments,2))},c.coalesce=function(e,t,r){for(var n,i=0,o=t.length;i<o;i++)if(void 0!==(n=c.get(e,t[i])))return n;return r},c.get=function(e,t,r){if("number"==typeof t&&(t=[t]),!t||0===t.length)return e;if(null==e)return r;if("string"==typeof t)return c.get(e,t.split("."),r);var n=a(t[0]),i=A(e,n);return void 0===i?r:1===t.length?i:c.get(e[n],t.slice(1),r)},c.del=function(e,t){if("number"==typeof t&&(t=[t]),null==e)return e;if(r(t))return e;if("string"==typeof t)return c.del(e,t.split("."));var n=a(t[0]);return A(e,n),s(e,n)?1!==t.length?c.del(e[n],t.slice(1)):(i(e)?e.splice(n,1):delete e[n],e):e},c}var A=s();return A.create=s,A.withInheritedProps=s({includeInheritedProps:!0}),A}))}).call(this,r(11)(e))},function(e,t,r){var n=r(21),i=r(22),o=r(51),a=r(52),s=r(88),A="undefined"!=typeof fetch?fetch:r(98).default,c=r(99).LogMessage,u=function(){"use strict";function e(t){var r=t.uris,n=t.debug;o(this,e),this.uris=r,this.uriIndex=0,this.debug=n,this.draftURIs={}}var t;return a(e,[{key:"Log",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];c(this,e,t)}},{key:"BaseURI",value:function(){return new s(this.uris[this.uriIndex])}},{key:"RecordWriteToken",value:function(e,t){this.draftURIs[e]=t?new s(t):this.BaseURI()}},{key:"RequestHeaders",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return t.Accept||(t.Accept="application/json"),"JSON"===e?t["Content-type"]="application/json":"BINARY"===e&&(t["Content-type"]="application/octet-stream"),t}},{key:"Request",value:(t=i(n.mark((function t(r){var i,o,a,s,A,c,u,f,h,l,g,d,p,I,y,b,E,m,C,v,B,w,Q,k;return n.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return i=r.method,o=r.path,a=r.queryParams,s=void 0===a?{}:a,A=r.body,c=r.bodyType,u=void 0===c?"JSON":c,f=r.headers,h=void 0===f?{}:f,l=r.attempts,g=void 0===l?0:l,d=r.failover,p=void 0===d||d,I=r.forceFailover,y=void 0!==I&&I,b=this.BaseURI(),E=o.replace(/^\//,"").match(/(qlibs\/ilib[a-zA-Z0-9]+|q|qid)\/(tqw__[a-zA-Z0-9]+)/),(m=E?E[2]:void 0)&&(this.draftURIs[m]?b=this.draftURIs[m]:this.draftURIs[m]=b),C=b.path(o).query(s).hash(""),v={method:i,headers:this.RequestHeaders(u,h)},"POST"!==i&&"PUT"!==i&&"DELETE"!==i||(A&&"JSON"===u?v.body=JSON.stringify(A):A&&(v.body=A)),t.prev=8,t.next=11,e.Fetch(C.toString(),v);case 11:B=t.sent,t.next=17;break;case 14:t.prev=14,t.t0=t.catch(8),B={ok:!1,status:500,statusText:"ElvClient Error: "+t.t0.message,url:C.toString(),stack:t.t0.stack};case 17:if(B.ok){t.next=40;break}if(!(!m&&(p&&parseInt(B.status)>=500||y)&&g<this.uris.length)){t.next=24;break}return this.Log("HttpClient failing over from ".concat(this.BaseURI(),": ").concat(g+1," attempts"),!0),this.uriIndex=(this.uriIndex+1)%this.uris.length,t.next=23,this.Request({method:i,path:o,queryParams:s,body:A,bodyType:u,headers:h,attempts:g+1,forceFailover:y});case 23:return t.abrupt("return",t.sent);case 24:if(w=B.headers&&B.headers.get("content-type")||"",Q="",!B.text||!B.json){t.next=37;break}if(!w.includes("application/json")){t.next=33;break}return t.next=30,B.json();case 30:t.t1=t.sent,t.next=36;break;case 33:return t.next=35,B.text();case 35:t.t1=t.sent;case 36:Q=t.t1;case 37:throw k={name:"ElvHttpClientError",status:B.status,statusText:B.statusText,message:B.statusText,url:C.toString(),body:Q,requestParams:v},this.Log(JSON.stringify(k,null,2),!0),k;case 40:return this.Log("".concat(B.status," - ").concat(i," ").concat(C.toString())),t.abrupt("return",B);case 42:case"end":return t.stop()}}),t,this,[[8,14]])}))),function(e){return t.apply(this,arguments)})},{key:"URL",value:function(e){var t=e.path,r=e.queryParams,n=void 0===r?{}:r;return this.BaseURI().path(t).query(n).hash("").toString()}}],[{key:"Fetch",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return A(e,t)}}]),e}();e.exports=u},function(e,t,r){var n=r(199),i=r(256)((function(e,t,r,i){n(e,t,r,i)}));e.exports=i},function(e,t,r){var n=r(200),i=r(104),o=r(231),a=r(233),s=r(17),A=r(114),c=r(113);e.exports=function e(t,r,u,f,h){t!==r&&o(r,(function(o,A){if(h||(h=new n),s(o))a(t,r,A,u,e,f,h);else{var l=f?f(c(t,A),o,A+"",t,r,h):void 0;void 0===l&&(l=o),i(t,A,l)}}),A)}},function(e,t,r){var n=r(38),i=r(206),o=r(207),a=r(208),s=r(209),A=r(210);function c(e){var t=this.__data__=new n(e);this.size=t.size}c.prototype.clear=i,c.prototype.delete=o,c.prototype.get=a,c.prototype.has=s,c.prototype.set=A,e.exports=c},function(e,t){e.exports=function(){this.__data__=[],this.size=0}},function(e,t,r){var n=r(39),i=Array.prototype.splice;e.exports=function(e){var t=this.__data__,r=n(t,e);return!(r<0)&&(r==t.length-1?t.pop():i.call(t,r,1),--this.size,!0)}},function(e,t,r){var n=r(39);e.exports=function(e){var t=this.__data__,r=n(t,e);return r<0?void 0:t[r][1]}},function(e,t,r){var n=r(39);e.exports=function(e){return n(this.__data__,e)>-1}},function(e,t,r){var n=r(39);e.exports=function(e,t){var r=this.__data__,i=n(r,e);return i<0?(++this.size,r.push([e,t])):r[i][1]=t,this}},function(e,t,r){var n=r(38);e.exports=function(){this.__data__=new n,this.size=0}},function(e,t){e.exports=function(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r}},function(e,t){e.exports=function(e){return this.__data__.get(e)}},function(e,t){e.exports=function(e){return this.__data__.has(e)}},function(e,t,r){var n=r(38),i=r(101),o=r(218);e.exports=function(e,t){var r=this.__data__;if(r instanceof n){var a=r.__data__;if(!i||a.length<199)return a.push([e,t]),this.size=++r.size,this;r=this.__data__=new o(a)}return r.set(e,t),this.size=r.size,this}},function(e,t,r){var n=r(55),i=r(214),o=r(17),a=r(216),s=/^\[object .+?Constructor\]$/,A=Function.prototype,c=Object.prototype,u=A.toString,f=c.hasOwnProperty,h=RegExp("^"+u.call(f).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");e.exports=function(e){return!(!o(e)||i(e))&&(n(e)?h:s).test(a(e))}},function(e,t,r){var n=r(102),i=Object.prototype,o=i.hasOwnProperty,a=i.toString,s=n?n.toStringTag:void 0;e.exports=function(e){var t=o.call(e,s),r=e[s];try{e[s]=void 0;var n=!0}catch(e){}var i=a.call(e);return n&&(t?e[s]=r:delete e[s]),i}},function(e,t){var r=Object.prototype.toString;e.exports=function(e){return r.call(e)}},function(e,t,r){var n,i=r(215),o=(n=/[^.]+$/.exec(i&&i.keys&&i.keys.IE_PROTO||""))?"Symbol(src)_1."+n:"";e.exports=function(e){return!!o&&o in e}},function(e,t,r){var n=r(23)["__core-js_shared__"];e.exports=n},function(e,t){var r=Function.prototype.toString;e.exports=function(e){if(null!=e){try{return r.call(e)}catch(e){}try{return e+""}catch(e){}}return""}},function(e,t){e.exports=function(e,t){return null==e?void 0:e[t]}},function(e,t,r){var n=r(219),i=r(226),o=r(228),a=r(229),s=r(230);function A(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}A.prototype.clear=n,A.prototype.delete=i,A.prototype.get=o,A.prototype.has=a,A.prototype.set=s,e.exports=A},function(e,t,r){var n=r(220),i=r(38),o=r(101);e.exports=function(){this.size=0,this.__data__={hash:new n,map:new(o||i),string:new n}}},function(e,t,r){var n=r(221),i=r(222),o=r(223),a=r(224),s=r(225);function A(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}A.prototype.clear=n,A.prototype.delete=i,A.prototype.get=o,A.prototype.has=a,A.prototype.set=s,e.exports=A},function(e,t,r){var n=r(42);e.exports=function(){this.__data__=n?n(null):{},this.size=0}},function(e,t){e.exports=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}},function(e,t,r){var n=r(42),i=Object.prototype.hasOwnProperty;e.exports=function(e){var t=this.__data__;if(n){var r=t[e];return"__lodash_hash_undefined__"===r?void 0:r}return i.call(t,e)?t[e]:void 0}},function(e,t,r){var n=r(42),i=Object.prototype.hasOwnProperty;e.exports=function(e){var t=this.__data__;return n?void 0!==t[e]:i.call(t,e)}},function(e,t,r){var n=r(42);e.exports=function(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=n&&void 0===t?"__lodash_hash_undefined__":t,this}},function(e,t,r){var n=r(43);e.exports=function(e){var t=n(this,e).delete(e);return this.size-=t?1:0,t}},function(e,t){function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}e.exports=function(e){var t=r(e);return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e}},function(e,t,r){var n=r(43);e.exports=function(e){return n(this,e).get(e)}},function(e,t,r){var n=r(43);e.exports=function(e){return n(this,e).has(e)}},function(e,t,r){var n=r(43);e.exports=function(e,t){var r=n(this,e),i=r.size;return r.set(e,t),this.size+=r.size==i?0:1,this}},function(e,t,r){var n=r(232)();e.exports=n},function(e,t){e.exports=function(e){return function(t,r,n){for(var i=-1,o=Object(t),a=n(t),s=a.length;s--;){var A=a[e?s:++i];if(!1===r(o[A],A,o))break}return t}}},function(e,t,r){var n=r(104),i=r(234),o=r(235),a=r(238),s=r(239),A=r(108),c=r(109),u=r(243),f=r(111),h=r(55),l=r(17),g=r(245),d=r(112),p=r(113),I=r(249);e.exports=function(e,t,r,y,b,E,m){var C=p(e,r),v=p(t,r),B=m.get(v);if(B)n(e,r,B);else{var w=E?E(C,v,r+"",e,t,m):void 0,Q=void 0===w;if(Q){var k=c(v),_=!k&&f(v),S=!k&&!_&&d(v);w=v,k||_||S?c(C)?w=C:u(C)?w=a(C):_?(Q=!1,w=i(v,!0)):S?(Q=!1,w=o(v,!0)):w=[]:g(v)||A(v)?(w=C,A(C)?w=I(C):l(C)&&!h(C)||(w=s(v))):Q=!1}Q&&(m.set(v,w),b(w,v,y,E,m),m.delete(v)),n(e,r,w)}}},function(e,t,r){(function(e){function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var i=r(23),o="object"==n(t)&&t&&!t.nodeType&&t,a=o&&"object"==n(e)&&e&&!e.nodeType&&e,s=a&&a.exports===o?i.Buffer:void 0,A=s?s.allocUnsafe:void 0;e.exports=function(e,t){if(t)return e.slice();var r=e.length,n=A?A(r):new e.constructor(r);return e.copy(n),n}}).call(this,r(11)(e))},function(e,t,r){var n=r(236);e.exports=function(e,t){var r=t?n(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.length)}},function(e,t,r){var n=r(237);e.exports=function(e){var t=new e.constructor(e.byteLength);return new n(t).set(new n(e)),t}},function(e,t,r){var n=r(23).Uint8Array;e.exports=n},function(e,t){e.exports=function(e,t){var r=-1,n=e.length;for(t||(t=Array(n));++r<n;)t[r]=e[r];return t}},function(e,t,r){var n=r(240),i=r(106),o=r(107);e.exports=function(e){return"function"!=typeof e.constructor||o(e)?{}:n(i(e))}},function(e,t,r){var n=r(17),i=Object.create,o=function(){function e(){}return function(t){if(!n(t))return{};if(i)return i(t);e.prototype=t;var r=new e;return e.prototype=void 0,r}}();e.exports=o},function(e,t){e.exports=function(e,t){return function(r){return e(t(r))}}},function(e,t,r){var n=r(41),i=r(30);e.exports=function(e){return i(e)&&"[object Arguments]"==n(e)}},function(e,t,r){var n=r(57),i=r(30);e.exports=function(e){return i(e)&&n(e)}},function(e,t){e.exports=function(){return!1}},function(e,t,r){var n=r(41),i=r(106),o=r(30),a=Function.prototype,s=Object.prototype,A=a.toString,c=s.hasOwnProperty,u=A.call(Object);e.exports=function(e){if(!o(e)||"[object Object]"!=n(e))return!1;var t=i(e);if(null===t)return!0;var r=c.call(t,"constructor")&&t.constructor;return"function"==typeof r&&r instanceof r&&A.call(r)==u}},function(e,t,r){var n=r(41),i=r(110),o=r(30),a={};a["[object Float32Array]"]=a["[object Float64Array]"]=a["[object Int8Array]"]=a["[object Int16Array]"]=a["[object Int32Array]"]=a["[object Uint8Array]"]=a["[object Uint8ClampedArray]"]=a["[object Uint16Array]"]=a["[object Uint32Array]"]=!0,a["[object Arguments]"]=a["[object Array]"]=a["[object ArrayBuffer]"]=a["[object Boolean]"]=a["[object DataView]"]=a["[object Date]"]=a["[object Error]"]=a["[object Function]"]=a["[object Map]"]=a["[object Number]"]=a["[object Object]"]=a["[object RegExp]"]=a["[object Set]"]=a["[object String]"]=a["[object WeakMap]"]=!1,e.exports=function(e){return o(e)&&i(e.length)&&!!a[n(e)]}},function(e,t){e.exports=function(e){return function(t){return e(t)}}},function(e,t,r){(function(e){function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var i=r(103),o="object"==n(t)&&t&&!t.nodeType&&t,a=o&&"object"==n(e)&&e&&!e.nodeType&&e,s=a&&a.exports===o&&i.process,A=function(){try{var e=a&&a.require&&a.require("util").types;return e||s&&s.binding&&s.binding("util")}catch(e){}}();e.exports=A}).call(this,r(11)(e))},function(e,t,r){var n=r(250),i=r(114);e.exports=function(e){return n(e,i(e))}},function(e,t,r){var n=r(251),i=r(56);e.exports=function(e,t,r,o){var a=!r;r||(r={});for(var s=-1,A=t.length;++s<A;){var c=t[s],u=o?o(r[c],e[c],c,r,e):void 0;void 0===u&&(u=e[c]),a?i(r,c,u):n(r,c,u)}return r}},function(e,t,r){var n=r(56),i=r(40),o=Object.prototype.hasOwnProperty;e.exports=function(e,t,r){var a=e[t];o.call(e,t)&&i(a,r)&&(void 0!==r||t in e)||n(e,t,r)}},function(e,t,r){var n=r(253),i=r(108),o=r(109),a=r(111),s=r(115),A=r(112),c=Object.prototype.hasOwnProperty;e.exports=function(e,t){var r=o(e),u=!r&&i(e),f=!r&&!u&&a(e),h=!r&&!u&&!f&&A(e),l=r||u||f||h,g=l?n(e.length,String):[],d=g.length;for(var p in e)!t&&!c.call(e,p)||l&&("length"==p||f&&("offset"==p||"parent"==p)||h&&("buffer"==p||"byteLength"==p||"byteOffset"==p)||s(p,d))||g.push(p);return g}},function(e,t){e.exports=function(e,t){for(var r=-1,n=Array(e);++r<e;)n[r]=t(r);return n}},function(e,t,r){var n=r(17),i=r(107),o=r(255),a=Object.prototype.hasOwnProperty;e.exports=function(e){if(!n(e))return o(e);var t=i(e),r=[];for(var s in e)("constructor"!=s||!t&&a.call(e,s))&&r.push(s);return r}},function(e,t){e.exports=function(e){var t=[];if(null!=e)for(var r in Object(e))t.push(r);return t}},function(e,t,r){var n=r(257),i=r(264);e.exports=function(e){return n((function(t,r){var n=-1,o=r.length,a=o>1?r[o-1]:void 0,s=o>2?r[2]:void 0;for(a=e.length>3&&"function"==typeof a?(o--,a):void 0,s&&i(r[0],r[1],s)&&(a=o<3?void 0:a,o=1),t=Object(t);++n<o;){var A=r[n];A&&e(t,A,n,a)}return t}))}},function(e,t,r){var n=r(116),i=r(258),o=r(260);e.exports=function(e,t){return o(i(e,t,n),e+"")}},function(e,t,r){var n=r(259),i=Math.max;e.exports=function(e,t,r){return t=i(void 0===t?e.length-1:t,0),function(){for(var o=arguments,a=-1,s=i(o.length-t,0),A=Array(s);++a<s;)A[a]=o[t+a];a=-1;for(var c=Array(t+1);++a<t;)c[a]=o[a];return c[t]=r(A),n(e,this,c)}}},function(e,t){e.exports=function(e,t,r){switch(r.length){case 0:return e.call(t);case 1:return e.call(t,r[0]);case 2:return e.call(t,r[0],r[1]);case 3:return e.call(t,r[0],r[1],r[2])}return e.apply(t,r)}},function(e,t,r){var n=r(261),i=r(263)(n);e.exports=i},function(e,t,r){var n=r(262),i=r(105),o=r(116),a=i?function(e,t){return i(e,"toString",{configurable:!0,enumerable:!1,value:n(t),writable:!0})}:o;e.exports=a},function(e,t){e.exports=function(e){return function(){return e}}},function(e,t){var r=Date.now;e.exports=function(e){var t=0,n=0;return function(){var i=r(),o=16-(i-n);if(n=i,o>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}},function(e,t,r){function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var i=r(40),o=r(57),a=r(115),s=r(17);e.exports=function(e,t,r){if(!s(r))return!1;var A=n(t);return!!("number"==A?o(r)&&a(t,r.length):"string"==A&&t in r)&&i(r[t],e)}},function(e,t,r){(function(t){var n=r(21),i=r(22);void 0===globalThis.Buffer&&(globalThis.Buffer=r(6).Buffer);var o,a=r(87),s=r(117),A=r(37);if("undefined"==typeof crypto){var c=r(274);c.getRandomValues=function(e){return c.randomBytes(e.length)},globalThis.crypto=c}switch(A.Platform()){case A.PLATFORM_REACT_NATIVE:case A.PLATFORM_WEB:o=r(165).default;break;default:o=r(!function(){var e=new Error("Cannot find module '@eluvio/crypto/dist/elv-crypto.bundle.node'");throw e.code="MODULE_NOT_FOUND",e}()).default}var u,f,h,l,g,d={ElvCrypto:(g=i(n.mark((function e(){return n.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,d.elvCrypto){e.next=5;break}return e.next=4,(new o).init();case 4:d.elvCrypto=e.sent;case 5:return e.abrupt("return",d.elvCrypto);case 8:e.prev=8,e.t0=e.catch(0),console.error("Error initializing ElvCrypto:"),console.error(e.t0);case 12:case"end":return e.stop()}}),e,null,[[0,8]])}))),function(){return g.apply(this,arguments)}),EncryptedSize:function(e){var t=Math.floor(e/1e6)*d.EncryptedBlockSize(1e6);return e%1e6!=0&&(t+=d.EncryptedBlockSize(e%1e6)),t},EncryptedBlockSize:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=129,n=608,i=48,o=12*(i-1),a=12*i,s=Math.floor(e/o)*a;return e%o!=0&&(s+=a),t?s+n:s+r},EncryptConk:function(e,r){return i(n.mark((function i(){var o,a,s,c,u,f;return n.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,d.ElvCrypto();case 2:return o=n.sent,r=new Uint8Array(t.from(r.replace("0x",""),"hex")),e=new Uint8Array(t.from(JSON.stringify(e))),n.next=7,o.encryptECIES(e,r);case 7:return a=n.sent,s=a.data,c=a.ephemeralKey,u=a.tag,f=t.concat([t.from(c),t.from(u),t.from(s)]),n.abrupt("return",A.B64(f));case 13:case"end":return n.stop()}}),i)})))()},DecryptCap:function(e,r){return i(n.mark((function i(){var o,a,s,A,c;return n.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,d.ElvCrypto();case 2:return o=n.sent,r=new Uint8Array(t.from(r.replace("0x",""),"hex")),e=t.from(e,"base64"),a=e.slice(0,65),s=e.slice(65,81),A=e.slice(81),c=o.decryptECIES(new Uint8Array(A),r,new Uint8Array(a),new Uint8Array(s)),n.abrupt("return",JSON.parse(t.from(c).toString()));case 10:case"end":return n.stop()}}),i)})))()},GeneratePrimaryConk:function(e){return i(n.mark((function r(){var i,o,s,A,c,u,f;return n.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return i=e.spaceId,o=e.objectId,r.next=3,d.ElvCrypto();case 3:return s=r.sent,A=s.generatePrimaryKeys(),c=A.secretKey,u=A.publicKey,f=s.generateSymmetricKey().key,r.abrupt("return",{symm_key:"kpsy".concat(a.encode(t.from(f))),secret_key:"kpsk".concat(a.encode(t.from(c))),public_key:"kppk".concat(a.encode(t.from(u))),sid:i,qid:o});case 7:case"end":return r.stop()}}),r)})))()},GenerateTargetConk:function(){return i(n.mark((function e(){var r,i,o,s;return n.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,d.ElvCrypto();case 2:return r=e.sent,i=r.generateTargetKeys(),o=i.secretKey,s=i.publicKey,e.abrupt("return",{secret_key:"kpsk".concat(a.encode(t.from(o))),public_key:"ktpk".concat(a.encode(t.from(s)))});case 5:case"end":return e.stop()}}),e)})))()},CapToConk:function(e){var t=function(e){return new Uint8Array(a.decode(e.slice(4)))};return{symmetricKey:t(e.symm_key),secretKey:t(e.secret_key),publicKey:t(e.public_key)}},EncryptionContext:function(e){return i(n.mark((function t(){var r,i,o,a,s,A,c;return n.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,d.ElvCrypto();case 2:return r=t.sent,i=d.CapToConk(e),o=i.symmetricKey,a=i.secretKey,(s=i.publicKey).length===r.PRIMARY_PK_KEY_SIZE?(c=r.CRYPTO_TYPE_PRIMARY,A=r.newPrimaryContext(s,a,o)):(c=r.CRYPTO_TYPE_TARGET,A=r.newTargetDecryptionContext(a,o)),t.abrupt("return",{context:A,type:c});case 6:case"end":return t.stop()}}),t)})))()},Encrypt:(l=i(n.mark((function e(r,i){var o,a,s,A,c;return n.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,d.OpenEncryptionStream(r);case 2:if(o=e.sent,t.isBuffer(i)||i instanceof ArrayBuffer){e.next=9;break}return e.t0=t,e.next=7,new Response(i).arrayBuffer();case 7:e.t1=e.sent,i=e.t0.from.call(e.t0,e.t1);case 9:for(a=new Uint8Array(i),s=0;s<a.length;s+=1e6)A=Math.min(a.length,s+1e6),o.write(a.slice(s,A));return o.end(),c=[],e.next=15,new Promise((function(e,t){o.on("data",(function(e){c.push(e)})).on("finish",(function(){e()})).on("error",(function(e){t(e)}))}));case 15:return e.abrupt("return",t.concat(c));case 16:case"end":return e.stop()}}),e)}))),function(e,t){return l.apply(this,arguments)}),OpenEncryptionStream:(h=i(n.mark((function e(t){var r,i,o,a,A;return n.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,d.ElvCrypto();case 2:return r=e.sent,e.next=5,d.EncryptionContext(t);case 5:return i=e.sent,o=i.context,a=new s.PassThrough,A=r.createCipher(o),e.abrupt("return",a.pipe(A).on("finish",(function(){o.free()})).on("error",(function(e){throw Error(e)})));case 10:case"end":return e.stop()}}),e)}))),function(e){return h.apply(this,arguments)}),Decrypt:(f=i(n.mark((function e(r,i){var o,a,s,A,c;return n.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,d.OpenDecryptionStream(r);case 2:for(o=e.sent,a=new Uint8Array(i),s=0;s<a.length;s+=1e6)A=Math.min(a.length,s+1e6),o.write(a.slice(s,A));return o.end(),c=[],e.next=9,new Promise((function(e,t){o.on("data",(function(e){c.push(e)})).on("finish",(function(){e()})).on("error",(function(e){t(e)}))}));case 9:return e.abrupt("return",t.concat(c));case 10:case"end":return e.stop()}}),e)}))),function(e,t){return f.apply(this,arguments)}),OpenDecryptionStream:(u=i(n.mark((function e(t){var r,i,o,a,A,c;return n.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,d.ElvCrypto();case 2:return r=e.sent,e.next=5,d.EncryptionContext(t);case 5:return i=e.sent,o=i.context,a=i.type,A=new s.PassThrough,c=r.createDecipher(a,o),e.abrupt("return",A.pipe(c).on("finish",(function(){o.free()})).on("error",(function(e){throw Error(e)})));case 11:case"end":return e.stop()}}),e)}))),function(e){return u.apply(this,arguments)})};e.exports=d}).call(this,r(6).Buffer)},function(e,t){},function(e,t,r){"use strict";var n=r(59).Buffer,i=r(268);e.exports=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.head=null,this.tail=null,this.length=0}return e.prototype.push=function(e){var t={data:e,next:null};this.length>0?this.tail.next=t:this.head=t,this.tail=t,++this.length},e.prototype.unshift=function(e){var t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length},e.prototype.shift=function(){if(0!==this.length){var e=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,e}},e.prototype.clear=function(){this.head=this.tail=null,this.length=0},e.prototype.join=function(e){if(0===this.length)return"";for(var t=this.head,r=""+t.data;t=t.next;)r+=e+t.data;return r},e.prototype.concat=function(e){if(0===this.length)return n.alloc(0);if(1===this.length)return this.head.data;for(var t,r,i,o=n.allocUnsafe(e>>>0),a=this.head,s=0;a;)t=a.data,r=o,i=s,t.copy(r,i),s+=a.data.length,a=a.next;return o},e}(),i&&i.inspect&&i.inspect.custom&&(e.exports.prototype[i.inspect.custom]=function(){var e=i.inspect({length:this.length});return this.constructor.name+" "+e})},function(e,t){},function(e,t,r){"use strict";e.exports=o;var n=r(122),i=Object.create(r(32));function o(e){if(!(this instanceof o))return new o(e);n.call(this,e)}i.inherits=r(3),i.inherits(o,n),o.prototype._transform=function(e,t,r){r(null,e)}},function(e,t,r){e.exports=r(60)},function(e,t,r){e.exports=r(18)},function(e,t,r){e.exports=r(58).Transform},function(e,t,r){e.exports=r(58).PassThrough},function(e,t,r){"use strict";t.randomBytes=t.rng=t.pseudoRandomBytes=t.prng=r(19),t.createHash=t.Hash=r(24),t.createHmac=t.Hmac=r(66);var n=r(133),i=Object.keys(n),o=["sha1","sha224","sha256","sha384","sha512","md5","rmd160"].concat(i);t.getHashes=function(){return o};var a=r(67);t.pbkdf2=a.pbkdf2,t.pbkdf2Sync=a.pbkdf2Sync;var s=r(139);t.Cipher=s.Cipher,t.createCipher=s.createCipher,t.Cipheriv=s.Cipheriv,t.createCipheriv=s.createCipheriv,t.Decipher=s.Decipher,t.createDecipher=s.createDecipher,t.Decipheriv=s.Decipheriv,t.createDecipheriv=s.createDecipheriv,t.getCiphers=s.getCiphers,t.listCiphers=s.listCiphers;var A=r(147);t.DiffieHellmanGroup=A.DiffieHellmanGroup,t.createDiffieHellmanGroup=A.createDiffieHellmanGroup,t.getDiffieHellman=A.getDiffieHellman,t.createDiffieHellman=A.createDiffieHellman,t.DiffieHellman=A.DiffieHellman;var c=r(150);t.createSign=c.createSign,t.Sign=c.Sign,t.createVerify=c.createVerify,t.Verify=c.Verify,t.createECDH=r(159);var u=r(160);t.publicEncrypt=u.publicEncrypt,t.privateEncrypt=u.privateEncrypt,t.publicDecrypt=u.publicDecrypt,t.privateDecrypt=u.privateDecrypt;var f=r(164);t.randomFill=f.randomFill,t.randomFillSync=f.randomFillSync,t.createCredentials=function(){throw new Error(["sorry, createCredentials is not implemented yet","we accept pull requests","https://github.com/crypto-browserify/crypto-browserify"].join("\n"))},t.constants={DH_CHECK_P_NOT_SAFE_PRIME:2,DH_CHECK_P_NOT_PRIME:1,DH_UNABLE_TO_CHECK_GENERATOR:4,DH_NOT_SUITABLE_GENERATOR:8,NPN_ENABLED:1,ALPN_ENABLED:1,RSA_PKCS1_PADDING:1,RSA_SSLV23_PADDING:2,RSA_NO_PADDING:3,RSA_PKCS1_OAEP_PADDING:4,RSA_X931_PADDING:5,RSA_PKCS1_PSS_PADDING:6,POINT_CONVERSION_COMPRESSED:2,POINT_CONVERSION_UNCOMPRESSED:4,POINT_CONVERSION_HYBRID:6}},function(e,t){},function(e,t,r){"use strict";function n(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function i(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function o(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}var a=r(6).Buffer,s=r(277).inspect,A=s&&s.custom||"inspect";e.exports=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.head=null,this.tail=null,this.length=0}var t,r,c;return t=e,(r=[{key:"push",value:function(e){var t={data:e,next:null};this.length>0?this.tail.next=t:this.head=t,this.tail=t,++this.length}},{key:"unshift",value:function(e){var t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length}},{key:"shift",value:function(){if(0!==this.length){var e=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,e}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(e){if(0===this.length)return"";for(var t=this.head,r=""+t.data;t=t.next;)r+=e+t.data;return r}},{key:"concat",value:function(e){if(0===this.length)return a.alloc(0);for(var t,r,n,i=a.allocUnsafe(e>>>0),o=this.head,s=0;o;)t=o.data,r=i,n=s,a.prototype.copy.call(t,r,n),s+=o.data.length,o=o.next;return i}},{key:"consume",value:function(e,t){var r;return e<this.head.data.length?(r=this.head.data.slice(0,e),this.head.data=this.head.data.slice(e)):r=e===this.head.data.length?this.shift():t?this._getString(e):this._getBuffer(e),r}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(e){var t=this.head,r=1,n=t.data;for(e-=n.length;t=t.next;){var i=t.data,o=e>i.length?i.length:e;if(o===i.length?n+=i:n+=i.slice(0,e),0==(e-=o)){o===i.length?(++r,t.next?this.head=t.next:this.head=this.tail=null):(this.head=t,t.data=i.slice(o));break}++r}return this.length-=r,n}},{key:"_getBuffer",value:function(e){var t=a.allocUnsafe(e),r=this.head,n=1;for(r.data.copy(t),e-=r.data.length;r=r.next;){var i=r.data,o=e>i.length?i.length:e;if(i.copy(t,t.length-e,0,o),0==(e-=o)){o===i.length?(++n,r.next?this.head=r.next:this.head=this.tail=null):(this.head=r,r.data=i.slice(o));break}++n}return this.length-=n,t}},{key:A,value:function(e,t){return s(this,function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?n(Object(r),!0).forEach((function(t){i(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):n(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({},t,{depth:0,customInspect:!1}))}}])&&o(t.prototype,r),c&&o(t,c),e}()},function(e,t){},function(e,t,r){"use strict";(function(t){var n;function i(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var o=r(63),a=Symbol("lastResolve"),s=Symbol("lastReject"),A=Symbol("error"),c=Symbol("ended"),u=Symbol("lastPromise"),f=Symbol("handlePromise"),h=Symbol("stream");function l(e,t){return{value:e,done:t}}function g(e){var t=e[a];if(null!==t){var r=e[h].read();null!==r&&(e[u]=null,e[a]=null,e[s]=null,t(l(r,!1)))}}function d(e){t.nextTick(g,e)}var p=Object.getPrototypeOf((function(){})),I=Object.setPrototypeOf((i(n={get stream(){return this[h]},next:function(){var e=this,r=this[A];if(null!==r)return Promise.reject(r);if(this[c])return Promise.resolve(l(void 0,!0));if(this[h].destroyed)return new Promise((function(r,n){t.nextTick((function(){e[A]?n(e[A]):r(l(void 0,!0))}))}));var n,i=this[u];if(i)n=new Promise(function(e,t){return function(r,n){e.then((function(){t[c]?r(l(void 0,!0)):t[f](r,n)}),n)}}(i,this));else{var o=this[h].read();if(null!==o)return Promise.resolve(l(o,!1));n=new Promise(this[f])}return this[u]=n,n}},Symbol.asyncIterator,(function(){return this})),i(n,"return",(function(){var e=this;return new Promise((function(t,r){e[h].destroy(null,(function(e){e?r(e):t(l(void 0,!0))}))}))})),n),p);e.exports=function(e){var t,r=Object.create(I,(i(t={},h,{value:e,writable:!0}),i(t,a,{value:null,writable:!0}),i(t,s,{value:null,writable:!0}),i(t,A,{value:null,writable:!0}),i(t,c,{value:e._readableState.endEmitted,writable:!0}),i(t,f,{value:function(e,t){var n=r[h].read();n?(r[u]=null,r[a]=null,r[s]=null,e(l(n,!1))):(r[a]=e,r[s]=t)},writable:!0}),t));return r[u]=null,o(e,(function(e){if(e&&"ERR_STREAM_PREMATURE_CLOSE"!==e.code){var t=r[s];return null!==t&&(r[u]=null,r[a]=null,r[s]=null,t(e)),void(r[A]=e)}var n=r[a];null!==n&&(r[u]=null,r[a]=null,r[s]=null,n(l(void 0,!0))),r[c]=!0})),e.on("readable",d.bind(null,r)),r}}).call(this,r(9))},function(e,t){e.exports=function(){throw new Error("Readable.from is not available in the browser")}},function(e,t,r){"use strict";e.exports=i;var n=r(129);function i(e){if(!(this instanceof i))return new i(e);n.call(this,e)}r(3)(i,n),i.prototype._transform=function(e,t,r){r(null,e)}},function(e,t,r){"use strict";var n;var i=r(25).codes,o=i.ERR_MISSING_ARGS,a=i.ERR_STREAM_DESTROYED;function s(e){if(e)throw e}function A(e,t,i,o){o=function(e){var t=!1;return function(){t||(t=!0,e.apply(void 0,arguments))}}(o);var s=!1;e.on("close",(function(){s=!0})),void 0===n&&(n=r(63)),n(e,{readable:t,writable:i},(function(e){if(e)return o(e);s=!0,o()}));var A=!1;return function(t){if(!s&&!A)return A=!0,function(e){return e.setHeader&&"function"==typeof e.abort}(e)?e.abort():"function"==typeof e.destroy?e.destroy():void o(t||new a("pipe"))}}function c(e){e()}function u(e,t){return e.pipe(t)}function f(e){return e.length?"function"!=typeof e[e.length-1]?s:e.pop():s}e.exports=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];var n,i=f(t);if(Array.isArray(t[0])&&(t=t[0]),t.length<2)throw new o("streams");var a=t.map((function(e,r){var o=r<t.length-1;return A(e,o,r>0,(function(e){n||(n=e),e&&a.forEach(c),o||(a.forEach(c),i(n))}))}));return t.reduce(u)}},function(e,t,r){var n=r(3),i=r(27),o=r(4).Buffer,a=[1518500249,1859775393,-1894007588,-899497514],s=new Array(80);function A(){this.init(),this._w=s,i.call(this,64,56)}function c(e){return e<<30|e>>>2}function u(e,t,r,n){return 0===e?t&r|~t&n:2===e?t&r|t&n|r&n:t^r^n}n(A,i),A.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},A.prototype._update=function(e){for(var t,r=this._w,n=0|this._a,i=0|this._b,o=0|this._c,s=0|this._d,A=0|this._e,f=0;f<16;++f)r[f]=e.readInt32BE(4*f);for(;f<80;++f)r[f]=r[f-3]^r[f-8]^r[f-14]^r[f-16];for(var h=0;h<80;++h){var l=~~(h/20),g=0|((t=n)<<5|t>>>27)+u(l,i,o,s)+A+r[h]+a[l];A=s,s=o,o=c(i),i=n,n=g}this._a=n+this._a|0,this._b=i+this._b|0,this._c=o+this._c|0,this._d=s+this._d|0,this._e=A+this._e|0},A.prototype._hash=function(){var e=o.allocUnsafe(20);return e.writeInt32BE(0|this._a,0),e.writeInt32BE(0|this._b,4),e.writeInt32BE(0|this._c,8),e.writeInt32BE(0|this._d,12),e.writeInt32BE(0|this._e,16),e},e.exports=A},function(e,t,r){var n=r(3),i=r(27),o=r(4).Buffer,a=[1518500249,1859775393,-1894007588,-899497514],s=new Array(80);function A(){this.init(),this._w=s,i.call(this,64,56)}function c(e){return e<<5|e>>>27}function u(e){return e<<30|e>>>2}function f(e,t,r,n){return 0===e?t&r|~t&n:2===e?t&r|t&n|r&n:t^r^n}n(A,i),A.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},A.prototype._update=function(e){for(var t,r=this._w,n=0|this._a,i=0|this._b,o=0|this._c,s=0|this._d,A=0|this._e,h=0;h<16;++h)r[h]=e.readInt32BE(4*h);for(;h<80;++h)r[h]=(t=r[h-3]^r[h-8]^r[h-14]^r[h-16])<<1|t>>>31;for(var l=0;l<80;++l){var g=~~(l/20),d=c(n)+f(g,i,o,s)+A+r[l]+a[g]|0;A=s,s=o,o=u(i),i=n,n=d}this._a=n+this._a|0,this._b=i+this._b|0,this._c=o+this._c|0,this._d=s+this._d|0,this._e=A+this._e|0},A.prototype._hash=function(){var e=o.allocUnsafe(20);return e.writeInt32BE(0|this._a,0),e.writeInt32BE(0|this._b,4),e.writeInt32BE(0|this._c,8),e.writeInt32BE(0|this._d,12),e.writeInt32BE(0|this._e,16),e},e.exports=A},function(e,t,r){var n=r(3),i=r(130),o=r(27),a=r(4).Buffer,s=new Array(64);function A(){this.init(),this._w=s,o.call(this,64,56)}n(A,i),A.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},A.prototype._hash=function(){var e=a.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},e.exports=A},function(e,t,r){var n=r(3),i=r(131),o=r(27),a=r(4).Buffer,s=new Array(160);function A(){this.init(),this._w=s,o.call(this,128,112)}n(A,i),A.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},A.prototype._hash=function(){var e=a.allocUnsafe(48);function t(t,r,n){e.writeInt32BE(t,n),e.writeInt32BE(r,n+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},e.exports=A},function(e,t,r){"use strict";var n=r(3),i=r(4).Buffer,o=r(16),a=i.alloc(128);function s(e,t){o.call(this,"digest"),"string"==typeof t&&(t=i.from(t)),this._alg=e,this._key=t,t.length>64?t=e(t):t.length<64&&(t=i.concat([t,a],64));for(var r=this._ipad=i.allocUnsafe(64),n=this._opad=i.allocUnsafe(64),s=0;s<64;s++)r[s]=54^t[s],n[s]=92^t[s];this._hash=[r]}n(s,o),s.prototype._update=function(e){this._hash.push(e)},s.prototype._final=function(){var e=this._alg(i.concat(this._hash));return this._alg(i.concat([this._opad,e]))},e.exports=s},function(e,t,r){(function(t){var n,i,o=r(4).Buffer,a=r(135),s=r(136),A=r(137),c=r(138),u=t.crypto&&t.crypto.subtle,f={sha:"SHA-1","sha-1":"SHA-1",sha1:"SHA-1",sha256:"SHA-256","sha-256":"SHA-256",sha384:"SHA-384","sha-384":"SHA-384","sha-512":"SHA-512",sha512:"SHA-512"},h=[];function l(){return i||(i=t.process&&t.process.nextTick?t.process.nextTick:t.queueMicrotask?t.queueMicrotask:t.setImmediate?t.setImmediate:t.setTimeout)}function g(e,t,r,n,i){return u.importKey("raw",e,{name:"PBKDF2"},!1,["deriveBits"]).then((function(e){return u.deriveBits({name:"PBKDF2",salt:t,iterations:r,hash:{name:i}},e,n<<3)})).then((function(e){return o.from(e)}))}e.exports=function(e,r,i,d,p,I){"function"==typeof p&&(I=p,p=void 0);var y=f[(p=p||"sha1").toLowerCase()];if(y&&"function"==typeof t.Promise){if(a(i,d),e=c(e,s,"Password"),r=c(r,s,"Salt"),"function"!=typeof I)throw new Error("No callback provided to pbkdf2");!function(e,t){e.then((function(e){l()((function(){t(null,e)}))}),(function(e){l()((function(){t(e)}))}))}(function(e){if(t.process&&!t.process.browser)return Promise.resolve(!1);if(!u||!u.importKey||!u.deriveBits)return Promise.resolve(!1);if(void 0!==h[e])return h[e];var r=g(n=n||o.alloc(8),n,10,128,e).then((function(){return!0})).catch((function(){return!1}));return h[e]=r,r}(y).then((function(t){return t?g(e,r,i,d,y):A(e,r,i,d,p)})),I)}else l()((function(){var t;try{t=A(e,r,i,d,p)}catch(e){return I(e)}I(null,t)}))}}).call(this,r(8))},function(e,t,r){var n=r(16),i=r(289),o=r(3),a=r(4).Buffer,s={"des-ede3-cbc":i.CBC.instantiate(i.EDE),"des-ede3":i.EDE,"des-ede-cbc":i.CBC.instantiate(i.EDE),"des-ede":i.EDE,"des-cbc":i.CBC.instantiate(i.DES),"des-ecb":i.DES};function A(e){n.call(this);var t,r=e.mode.toLowerCase(),i=s[r];t=e.decrypt?"decrypt":"encrypt";var o=e.key;a.isBuffer(o)||(o=a.from(o)),"des-ede"!==r&&"des-ede-cbc"!==r||(o=a.concat([o,o.slice(0,8)]));var A=e.iv;a.isBuffer(A)||(A=a.from(A)),this._des=i.create({key:o,iv:A,type:t})}s.des=s["des-cbc"],s.des3=s["des-ede3-cbc"],e.exports=A,o(A,n),A.prototype._update=function(e){return a.from(this._des.update(e))},A.prototype._final=function(){return a.from(this._des.final())}},function(e,t,r){"use strict";t.utils=r(140),t.Cipher=r(68),t.DES=r(141),t.CBC=r(290),t.EDE=r(291)},function(e,t,r){"use strict";var n=r(12),i=r(3),o={};function a(e){n.equal(e.length,8,"Invalid IV length"),this.iv=new Array(8);for(var t=0;t<this.iv.length;t++)this.iv[t]=e[t]}t.instantiate=function(e){function t(t){e.call(this,t),this._cbcInit()}i(t,e);for(var r=Object.keys(o),n=0;n<r.length;n++){var a=r[n];t.prototype[a]=o[a]}return t.create=function(e){return new t(e)},t},o._cbcInit=function(){var e=new a(this.options.iv);this._cbcState=e},o._update=function(e,t,r,n){var i=this._cbcState,o=this.constructor.super_.prototype,a=i.iv;if("encrypt"===this.type){for(var s=0;s<this.blockSize;s++)a[s]^=e[t+s];o._update.call(this,a,0,r,n);for(s=0;s<this.blockSize;s++)a[s]=r[n+s]}else{o._update.call(this,e,t,r,n);for(s=0;s<this.blockSize;s++)r[n+s]^=a[s];for(s=0;s<this.blockSize;s++)a[s]=e[t+s]}}},function(e,t,r){"use strict";var n=r(12),i=r(3),o=r(68),a=r(141);function s(e,t){n.equal(t.length,24,"Invalid key length");var r=t.slice(0,8),i=t.slice(8,16),o=t.slice(16,24);this.ciphers="encrypt"===e?[a.create({type:"encrypt",key:r}),a.create({type:"decrypt",key:i}),a.create({type:"encrypt",key:o})]:[a.create({type:"decrypt",key:o}),a.create({type:"encrypt",key:i}),a.create({type:"decrypt",key:r})]}function A(e){o.call(this,e);var t=new s(this.type,this.options.key);this._edeState=t}i(A,o),e.exports=A,A.create=function(e){return new A(e)},A.prototype._update=function(e,t,r,n){var i=this._edeState;i.ciphers[0]._update(e,t,r,n),i.ciphers[1]._update(r,n,r,n),i.ciphers[2]._update(r,n,r,n)},A.prototype._pad=a.prototype._pad,A.prototype._unpad=a.prototype._unpad},function(e,t,r){var n=r(70),i=r(145),o=r(4).Buffer,a=r(146),s=r(16),A=r(45),c=r(46);function u(e,t,r){s.call(this),this._cache=new h,this._cipher=new A.AES(t),this._prev=o.from(r),this._mode=e,this._autopadding=!0}r(3)(u,s),u.prototype._update=function(e){var t,r;this._cache.add(e);for(var n=[];t=this._cache.get();)r=this._mode.encrypt(this,t),n.push(r);return o.concat(n)};var f=o.alloc(16,16);function h(){this.cache=o.allocUnsafe(0)}function l(e,t,r){var s=n[e.toLowerCase()];if(!s)throw new TypeError("invalid suite type");if("string"==typeof t&&(t=o.from(t)),t.length!==s.key/8)throw new TypeError("invalid key length "+t.length);if("string"==typeof r&&(r=o.from(r)),"GCM"!==s.mode&&r.length!==s.iv)throw new TypeError("invalid iv length "+r.length);return"stream"===s.type?new a(s.module,t,r):"auth"===s.type?new i(s.module,t,r):new u(s.module,t,r)}u.prototype._final=function(){var e=this._cache.flush();if(this._autopadding)return e=this._mode.encrypt(this,e),this._cipher.scrub(),e;if(!e.equals(f))throw this._cipher.scrub(),new Error("data not multiple of block length")},u.prototype.setAutoPadding=function(e){return this._autopadding=!!e,this},h.prototype.add=function(e){this.cache=o.concat([this.cache,e])},h.prototype.get=function(){if(this.cache.length>15){var e=this.cache.slice(0,16);return this.cache=this.cache.slice(16),e}return null},h.prototype.flush=function(){for(var e=16-this.cache.length,t=o.allocUnsafe(e),r=-1;++r<e;)t.writeUInt8(e,r);return o.concat([this.cache,t])},t.createCipheriv=l,t.createCipher=function(e,t){var r=n[e.toLowerCase()];if(!r)throw new TypeError("invalid suite type");var i=c(t,!1,r.key,r.iv);return l(e,i.key,i.iv)}},function(e,t){t.encrypt=function(e,t){return e._cipher.encryptBlock(t)},t.decrypt=function(e,t){return e._cipher.decryptBlock(t)}},function(e,t,r){var n=r(34);t.encrypt=function(e,t){var r=n(t,e._prev);return e._prev=e._cipher.encryptBlock(r),e._prev},t.decrypt=function(e,t){var r=e._prev;e._prev=t;var i=e._cipher.decryptBlock(t);return n(i,r)}},function(e,t,r){var n=r(4).Buffer,i=r(34);function o(e,t,r){var o=t.length,a=i(t,e._cache);return e._cache=e._cache.slice(o),e._prev=n.concat([e._prev,r?t:a]),a}t.encrypt=function(e,t,r){for(var i,a=n.allocUnsafe(0);t.length;){if(0===e._cache.length&&(e._cache=e._cipher.encryptBlock(e._prev),e._prev=n.allocUnsafe(0)),!(e._cache.length<=t.length)){a=n.concat([a,o(e,t,r)]);break}i=e._cache.length,a=n.concat([a,o(e,t.slice(0,i),r)]),t=t.slice(i)}return a}},function(e,t,r){var n=r(4).Buffer;function i(e,t,r){var i=e._cipher.encryptBlock(e._prev)[0]^t;return e._prev=n.concat([e._prev.slice(1),n.from([r?t:i])]),i}t.encrypt=function(e,t,r){for(var o=t.length,a=n.allocUnsafe(o),s=-1;++s<o;)a[s]=i(e,t[s],r);return a}},function(e,t,r){var n=r(4).Buffer;function i(e,t,r){for(var n,i,a=-1,s=0;++a<8;)n=t&1<<7-a?128:0,s+=(128&(i=e._cipher.encryptBlock(e._prev)[0]^n))>>a%8,e._prev=o(e._prev,r?n:i);return s}function o(e,t){var r=e.length,i=-1,o=n.allocUnsafe(e.length);for(e=n.concat([e,n.from([t])]);++i<r;)o[i]=e[i]<<1|e[i+1]>>7;return o}t.encrypt=function(e,t,r){for(var o=t.length,a=n.allocUnsafe(o),s=-1;++s<o;)a[s]=i(e,t[s],r);return a}},function(e,t,r){(function(e){var n=r(34);function i(e){return e._prev=e._cipher.encryptBlock(e._prev),e._prev}t.encrypt=function(t,r){for(;t._cache.length<r.length;)t._cache=e.concat([t._cache,i(t)]);var o=t._cache.slice(0,r.length);return t._cache=t._cache.slice(r.length),n(r,o)}}).call(this,r(6).Buffer)},function(e,t,r){var n=r(4).Buffer,i=n.alloc(16,0);function o(e){var t=n.allocUnsafe(16);return t.writeUInt32BE(e[0]>>>0,0),t.writeUInt32BE(e[1]>>>0,4),t.writeUInt32BE(e[2]>>>0,8),t.writeUInt32BE(e[3]>>>0,12),t}function a(e){this.h=e,this.state=n.alloc(16,0),this.cache=n.allocUnsafe(0)}a.prototype.ghash=function(e){for(var t=-1;++t<e.length;)this.state[t]^=e[t];this._multiply()},a.prototype._multiply=function(){for(var e,t,r,n=[(e=this.h).readUInt32BE(0),e.readUInt32BE(4),e.readUInt32BE(8),e.readUInt32BE(12)],i=[0,0,0,0],a=-1;++a<128;){for(0!=(this.state[~~(a/8)]&1<<7-a%8)&&(i[0]^=n[0],i[1]^=n[1],i[2]^=n[2],i[3]^=n[3]),r=0!=(1&n[3]),t=3;t>0;t--)n[t]=n[t]>>>1|(1&n[t-1])<<31;n[0]=n[0]>>>1,r&&(n[0]=n[0]^225<<24)}this.state=o(i)},a.prototype.update=function(e){var t;for(this.cache=n.concat([this.cache,e]);this.cache.length>=16;)t=this.cache.slice(0,16),this.cache=this.cache.slice(16),this.ghash(t)},a.prototype.final=function(e,t){return this.cache.length&&this.ghash(n.concat([this.cache,i],16)),this.ghash(o([0,e,0,t])),this.state},e.exports=a},function(e,t,r){var n=r(145),i=r(4).Buffer,o=r(70),a=r(146),s=r(16),A=r(45),c=r(46);function u(e,t,r){s.call(this),this._cache=new f,this._last=void 0,this._cipher=new A.AES(t),this._prev=i.from(r),this._mode=e,this._autopadding=!0}function f(){this.cache=i.allocUnsafe(0)}function h(e,t,r){var s=o[e.toLowerCase()];if(!s)throw new TypeError("invalid suite type");if("string"==typeof r&&(r=i.from(r)),"GCM"!==s.mode&&r.length!==s.iv)throw new TypeError("invalid iv length "+r.length);if("string"==typeof t&&(t=i.from(t)),t.length!==s.key/8)throw new TypeError("invalid key length "+t.length);return"stream"===s.type?new a(s.module,t,r,!0):"auth"===s.type?new n(s.module,t,r,!0):new u(s.module,t,r)}r(3)(u,s),u.prototype._update=function(e){var t,r;this._cache.add(e);for(var n=[];t=this._cache.get(this._autopadding);)r=this._mode.decrypt(this,t),n.push(r);return i.concat(n)},u.prototype._final=function(){var e=this._cache.flush();if(this._autopadding)return function(e){var t=e[15];if(t<1||t>16)throw new Error("unable to decrypt data");var r=-1;for(;++r<t;)if(e[r+(16-t)]!==t)throw new Error("unable to decrypt data");if(16===t)return;return e.slice(0,16-t)}(this._mode.decrypt(this,e));if(e)throw new Error("data not multiple of block length")},u.prototype.setAutoPadding=function(e){return this._autopadding=!!e,this},f.prototype.add=function(e){this.cache=i.concat([this.cache,e])},f.prototype.get=function(e){var t;if(e){if(this.cache.length>16)return t=this.cache.slice(0,16),this.cache=this.cache.slice(16),t}else if(this.cache.length>=16)return t=this.cache.slice(0,16),this.cache=this.cache.slice(16),t;return null},f.prototype.flush=function(){if(this.cache.length)return this.cache},t.createDecipher=function(e,t){var r=o[e.toLowerCase()];if(!r)throw new TypeError("invalid suite type");var n=c(t,!1,r.key,r.iv);return h(e,n.key,n.iv)},t.createDecipheriv=h},function(e,t){t["des-ecb"]={key:8,iv:0},t["des-cbc"]=t.des={key:8,iv:8},t["des-ede3-cbc"]=t.des3={key:24,iv:8},t["des-ede3"]={key:24,iv:0},t["des-ede-cbc"]={key:16,iv:8},t["des-ede"]={key:16,iv:0}},function(e,t){},function(e){e.exports=JSON.parse('{"modp1":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a63a3620ffffffffffffffff"},"modp2":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece65381ffffffffffffffff"},"modp5":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca237327ffffffffffffffff"},"modp14":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aacaa68ffffffffffffffff"},"modp15":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a93ad2caffffffffffffffff"},"modp16":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c934063199ffffffffffffffff"},"modp17":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c93402849236c3fab4d27c7026c1d4dcb2602646dec9751e763dba37bdf8ff9406ad9e530ee5db382f413001aeb06a53ed9027d831179727b0865a8918da3edbebcf9b14ed44ce6cbaced4bb1bdb7f1447e6cc254b332051512bd7af426fb8f401378cd2bf5983ca01c64b92ecf032ea15d1721d03f482d7ce6e74fef6d55e702f46980c82b5a84031900b1c9e59e7c97fbec7e8f323a97a7e36cc88be0f1d45b7ff585ac54bd407b22b4154aacc8f6d7ebf48e1d814cc5ed20f8037e0a79715eef29be32806a1d58bb7c5da76f550aa3d8a1fbff0eb19ccb1a313d55cda56c9ec2ef29632387fe8d76e3c0468043e8f663f4860ee12bf2d5b0b7474d6e694f91e6dcc4024ffffffffffffffff"},"modp18":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c93402849236c3fab4d27c7026c1d4dcb2602646dec9751e763dba37bdf8ff9406ad9e530ee5db382f413001aeb06a53ed9027d831179727b0865a8918da3edbebcf9b14ed44ce6cbaced4bb1bdb7f1447e6cc254b332051512bd7af426fb8f401378cd2bf5983ca01c64b92ecf032ea15d1721d03f482d7ce6e74fef6d55e702f46980c82b5a84031900b1c9e59e7c97fbec7e8f323a97a7e36cc88be0f1d45b7ff585ac54bd407b22b4154aacc8f6d7ebf48e1d814cc5ed20f8037e0a79715eef29be32806a1d58bb7c5da76f550aa3d8a1fbff0eb19ccb1a313d55cda56c9ec2ef29632387fe8d76e3c0468043e8f663f4860ee12bf2d5b0b7474d6e694f91e6dbe115974a3926f12fee5e438777cb6a932df8cd8bec4d073b931ba3bc832b68d9dd300741fa7bf8afc47ed2576f6936ba424663aab639c5ae4f5683423b4742bf1c978238f16cbe39d652de3fdb8befc848ad922222e04a4037c0713eb57a81a23f0c73473fc646cea306b4bcbc8862f8385ddfa9d4b7fa2c087e879683303ed5bdd3a062b3cf5b3a278a66d2a13f83f44f82ddf310ee074ab6a364597e899a0255dc164f31cc50846851df9ab48195ded7ea1b1d510bd7ee74d73faf36bc31ecfa268359046f4eb879f924009438b481c6cd7889a002ed5ee382bc9190da6fc026e479558e4475677e9aa9e3050e2765694dfc81f56e880b96e7160c980dd98edd3dfffffffffffffffff"}}')},function(e,t,r){(function(t){var n=r(2),i=new(r(149)),o=new n(24),a=new n(11),s=new n(10),A=new n(3),c=new n(7),u=r(148),f=r(19);function h(e,r){return r=r||"utf8",t.isBuffer(e)||(e=new t(e,r)),this._pub=new n(e),this}function l(e,r){return r=r||"utf8",t.isBuffer(e)||(e=new t(e,r)),this._priv=new n(e),this}e.exports=d;var g={};function d(e,t,r){this.setGenerator(t),this.__prime=new n(e),this._prime=n.mont(this.__prime),this._primeLen=e.length,this._pub=void 0,this._priv=void 0,this._primeCode=void 0,r?(this.setPublicKey=h,this.setPrivateKey=l):this._primeCode=8}function p(e,r){var n=new t(e.toArray());return r?n.toString(r):n}Object.defineProperty(d.prototype,"verifyError",{enumerable:!0,get:function(){return"number"!=typeof this._primeCode&&(this._primeCode=function(e,t){var r=t.toString("hex"),n=[r,e.toString(16)].join("_");if(n in g)return g[n];var f,h=0;if(e.isEven()||!u.simpleSieve||!u.fermatTest(e)||!i.test(e))return h+=1,h+="02"===r||"05"===r?8:4,g[n]=h,h;switch(i.test(e.shrn(1))||(h+=2),r){case"02":e.mod(o).cmp(a)&&(h+=8);break;case"05":(f=e.mod(s)).cmp(A)&&f.cmp(c)&&(h+=8);break;default:h+=4}return g[n]=h,h}(this.__prime,this.__gen)),this._primeCode}}),d.prototype.generateKeys=function(){return this._priv||(this._priv=new n(f(this._primeLen))),this._pub=this._gen.toRed(this._prime).redPow(this._priv).fromRed(),this.getPublicKey()},d.prototype.computeSecret=function(e){var r=(e=(e=new n(e)).toRed(this._prime)).redPow(this._priv).fromRed(),i=new t(r.toArray()),o=this.getPrime();if(i.length<o.length){var a=new t(o.length-i.length);a.fill(0),i=t.concat([a,i])}return i},d.prototype.getPublicKey=function(e){return p(this._pub,e)},d.prototype.getPrivateKey=function(e){return p(this._priv,e)},d.prototype.getPrime=function(e){return p(this.__prime,e)},d.prototype.getGenerator=function(e){return p(this._gen,e)},d.prototype.setGenerator=function(e,r){return r=r||"utf8",t.isBuffer(e)||(e=new t(e,r)),this.__gen=e,this._gen=new n(e),this}}).call(this,r(6).Buffer)},function(e,t,r){var n=r(4).Buffer,i=r(66),o=r(72),a=r(73).ec,s=r(2),A=r(48),c=r(158);function u(e,t,r,o){if((e=n.from(e.toArray())).length<t.byteLength()){var a=n.alloc(t.byteLength()-e.length);e=n.concat([a,e])}var s=r.length,A=function(e,t){e=(e=f(e,t)).mod(t);var r=n.from(e.toArray());if(r.length<t.byteLength()){var i=n.alloc(t.byteLength()-r.length);r=n.concat([i,r])}return r}(r,t),c=n.alloc(s);c.fill(1);var u=n.alloc(s);return u=i(o,u).update(c).update(n.from([0])).update(e).update(A).digest(),c=i(o,u).update(c).digest(),{k:u=i(o,u).update(c).update(n.from([1])).update(e).update(A).digest(),v:c=i(o,u).update(c).digest()}}function f(e,t){var r=new s(e),n=(e.length<<3)-t.bitLength();return n>0&&r.ishrn(n),r}function h(e,t,r){var o,a;do{for(o=n.alloc(0);8*o.length<e.bitLength();)t.v=i(r,t.k).update(t.v).digest(),o=n.concat([o,t.v]);a=f(o,e),t.k=i(r,t.k).update(t.v).update(n.from([0])).digest(),t.v=i(r,t.k).update(t.v).digest()}while(-1!==a.cmp(e));return a}function l(e,t,r,n){return e.toRed(s.mont(r)).redPow(t).fromRed().mod(n)}e.exports=function(e,t,r,i,g){var d=A(t);if(d.curve){if("ecdsa"!==i&&"ecdsa/rsa"!==i)throw new Error("wrong private key type");return function(e,t){var r=c[t.curve.join(".")];if(!r)throw new Error("unknown curve "+t.curve.join("."));var i=new a(r).keyFromPrivate(t.privateKey).sign(e);return n.from(i.toDER())}(e,d)}if("dsa"===d.type){if("dsa"!==i)throw new Error("wrong private key type");return function(e,t,r){var i,o=t.params.priv_key,a=t.params.p,A=t.params.q,c=t.params.g,g=new s(0),d=f(e,A).mod(A),p=!1,I=u(o,A,e,r);for(;!1===p;)i=h(A,I,r),g=l(c,i,a,A),0===(p=i.invm(A).imul(d.add(o.mul(g))).mod(A)).cmpn(0)&&(p=!1,g=new s(0));return function(e,t){e=e.toArray(),t=t.toArray(),128&e[0]&&(e=[0].concat(e));128&t[0]&&(t=[0].concat(t));var r=[48,e.length+t.length+4,2,e.length];return r=r.concat(e,[2,t.length],t),n.from(r)}(g,p)}(e,d,r)}if("rsa"!==i&&"ecdsa/rsa"!==i)throw new Error("wrong private key type");e=n.concat([g,e]);for(var p=d.modulus.byteLength(),I=[0,1];e.length+I.length+1<p;)I.push(255);I.push(0);for(var y=-1;++y<e.length;)I.push(e[y]);return o(I,d)},e.exports.getKey=u,e.exports.makeKey=h},function(e){e.exports=JSON.parse('{"name":"elliptic","version":"6.5.4","description":"EC cryptography","main":"lib/elliptic.js","files":["lib"],"scripts":{"lint":"eslint lib test","lint:fix":"npm run lint -- --fix","unit":"istanbul test _mocha --reporter=spec test/index.js","test":"npm run lint && npm run unit","version":"grunt dist && git add dist/"},"repository":{"type":"git","url":"git@github.com:indutny/elliptic"},"keywords":["EC","Elliptic","curve","Cryptography"],"author":"Fedor Indutny <fedor@indutny.com>","license":"MIT","bugs":{"url":"https://github.com/indutny/elliptic/issues"},"homepage":"https://github.com/indutny/elliptic","devDependencies":{"brfs":"^2.0.2","coveralls":"^3.1.0","eslint":"^7.6.0","grunt":"^1.2.1","grunt-browserify":"^5.3.0","grunt-cli":"^1.3.2","grunt-contrib-connect":"^3.0.0","grunt-contrib-copy":"^1.0.0","grunt-contrib-uglify":"^5.0.0","grunt-mocha-istanbul":"^5.0.2","grunt-saucelabs":"^9.0.1","istanbul":"^0.4.5","mocha":"^8.0.1"},"dependencies":{"bn.js":"^4.11.9","brorand":"^1.1.0","hash.js":"^1.0.0","hmac-drbg":"^1.0.1","inherits":"^2.0.4","minimalistic-assert":"^1.0.1","minimalistic-crypto-utils":"^1.0.1"}}')},function(e,t,r){"use strict";var n=r(13),i=r(2),o=r(3),a=r(47),s=n.assert;function A(e){a.call(this,"short",e),this.a=new i(e.a,16).toRed(this.red),this.b=new i(e.b,16).toRed(this.red),this.tinv=this.two.redInvm(),this.zeroA=0===this.a.fromRed().cmpn(0),this.threeA=0===this.a.fromRed().sub(this.p).cmpn(-3),this.endo=this._getEndomorphism(e),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}function c(e,t,r,n){a.BasePoint.call(this,e,"affine"),null===t&&null===r?(this.x=null,this.y=null,this.inf=!0):(this.x=new i(t,16),this.y=new i(r,16),n&&(this.x.forceRed(this.curve.red),this.y.forceRed(this.curve.red)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.inf=!1)}function u(e,t,r,n){a.BasePoint.call(this,e,"jacobian"),null===t&&null===r&&null===n?(this.x=this.curve.one,this.y=this.curve.one,this.z=new i(0)):(this.x=new i(t,16),this.y=new i(r,16),this.z=new i(n,16)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.zOne=this.z===this.curve.one}o(A,a),e.exports=A,A.prototype._getEndomorphism=function(e){if(this.zeroA&&this.g&&this.n&&1===this.p.modn(3)){var t,r;if(e.beta)t=new i(e.beta,16).toRed(this.red);else{var n=this._getEndoRoots(this.p);t=(t=n[0].cmp(n[1])<0?n[0]:n[1]).toRed(this.red)}if(e.lambda)r=new i(e.lambda,16);else{var o=this._getEndoRoots(this.n);0===this.g.mul(o[0]).x.cmp(this.g.x.redMul(t))?r=o[0]:(r=o[1],s(0===this.g.mul(r).x.cmp(this.g.x.redMul(t))))}return{beta:t,lambda:r,basis:e.basis?e.basis.map((function(e){return{a:new i(e.a,16),b:new i(e.b,16)}})):this._getEndoBasis(r)}}},A.prototype._getEndoRoots=function(e){var t=e===this.p?this.red:i.mont(e),r=new i(2).toRed(t).redInvm(),n=r.redNeg(),o=new i(3).toRed(t).redNeg().redSqrt().redMul(r);return[n.redAdd(o).fromRed(),n.redSub(o).fromRed()]},A.prototype._getEndoBasis=function(e){for(var t,r,n,o,a,s,A,c,u,f=this.n.ushrn(Math.floor(this.n.bitLength()/2)),h=e,l=this.n.clone(),g=new i(1),d=new i(0),p=new i(0),I=new i(1),y=0;0!==h.cmpn(0);){var b=l.div(h);c=l.sub(b.mul(h)),u=p.sub(b.mul(g));var E=I.sub(b.mul(d));if(!n&&c.cmp(f)<0)t=A.neg(),r=g,n=c.neg(),o=u;else if(n&&2==++y)break;A=c,l=h,h=c,p=g,g=u,I=d,d=E}a=c.neg(),s=u;var m=n.sqr().add(o.sqr());return a.sqr().add(s.sqr()).cmp(m)>=0&&(a=t,s=r),n.negative&&(n=n.neg(),o=o.neg()),a.negative&&(a=a.neg(),s=s.neg()),[{a:n,b:o},{a:a,b:s}]},A.prototype._endoSplit=function(e){var t=this.endo.basis,r=t[0],n=t[1],i=n.b.mul(e).divRound(this.n),o=r.b.neg().mul(e).divRound(this.n),a=i.mul(r.a),s=o.mul(n.a),A=i.mul(r.b),c=o.mul(n.b);return{k1:e.sub(a).sub(s),k2:A.add(c).neg()}},A.prototype.pointFromX=function(e,t){(e=new i(e,16)).red||(e=e.toRed(this.red));var r=e.redSqr().redMul(e).redIAdd(e.redMul(this.a)).redIAdd(this.b),n=r.redSqrt();if(0!==n.redSqr().redSub(r).cmp(this.zero))throw new Error("invalid point");var o=n.fromRed().isOdd();return(t&&!o||!t&&o)&&(n=n.redNeg()),this.point(e,n)},A.prototype.validate=function(e){if(e.inf)return!0;var t=e.x,r=e.y,n=this.a.redMul(t),i=t.redSqr().redMul(t).redIAdd(n).redIAdd(this.b);return 0===r.redSqr().redISub(i).cmpn(0)},A.prototype._endoWnafMulAdd=function(e,t,r){for(var n=this._endoWnafT1,i=this._endoWnafT2,o=0;o<e.length;o++){var a=this._endoSplit(t[o]),s=e[o],A=s._getBeta();a.k1.negative&&(a.k1.ineg(),s=s.neg(!0)),a.k2.negative&&(a.k2.ineg(),A=A.neg(!0)),n[2*o]=s,n[2*o+1]=A,i[2*o]=a.k1,i[2*o+1]=a.k2}for(var c=this._wnafMulAdd(1,n,i,2*o,r),u=0;u<2*o;u++)n[u]=null,i[u]=null;return c},o(c,a.BasePoint),A.prototype.point=function(e,t,r){return new c(this,e,t,r)},A.prototype.pointFromJSON=function(e,t){return c.fromJSON(this,e,t)},c.prototype._getBeta=function(){if(this.curve.endo){var e=this.precomputed;if(e&&e.beta)return e.beta;var t=this.curve.point(this.x.redMul(this.curve.endo.beta),this.y);if(e){var r=this.curve,n=function(e){return r.point(e.x.redMul(r.endo.beta),e.y)};e.beta=t,t.precomputed={beta:null,naf:e.naf&&{wnd:e.naf.wnd,points:e.naf.points.map(n)},doubles:e.doubles&&{step:e.doubles.step,points:e.doubles.points.map(n)}}}return t}},c.prototype.toJSON=function(){return this.precomputed?[this.x,this.y,this.precomputed&&{doubles:this.precomputed.doubles&&{step:this.precomputed.doubles.step,points:this.precomputed.doubles.points.slice(1)},naf:this.precomputed.naf&&{wnd:this.precomputed.naf.wnd,points:this.precomputed.naf.points.slice(1)}}]:[this.x,this.y]},c.fromJSON=function(e,t,r){"string"==typeof t&&(t=JSON.parse(t));var n=e.point(t[0],t[1],r);if(!t[2])return n;function i(t){return e.point(t[0],t[1],r)}var o=t[2];return n.precomputed={beta:null,doubles:o.doubles&&{step:o.doubles.step,points:[n].concat(o.doubles.points.map(i))},naf:o.naf&&{wnd:o.naf.wnd,points:[n].concat(o.naf.points.map(i))}},n},c.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+">"},c.prototype.isInfinity=function(){return this.inf},c.prototype.add=function(e){if(this.inf)return e;if(e.inf)return this;if(this.eq(e))return this.dbl();if(this.neg().eq(e))return this.curve.point(null,null);if(0===this.x.cmp(e.x))return this.curve.point(null,null);var t=this.y.redSub(e.y);0!==t.cmpn(0)&&(t=t.redMul(this.x.redSub(e.x).redInvm()));var r=t.redSqr().redISub(this.x).redISub(e.x),n=t.redMul(this.x.redSub(r)).redISub(this.y);return this.curve.point(r,n)},c.prototype.dbl=function(){if(this.inf)return this;var e=this.y.redAdd(this.y);if(0===e.cmpn(0))return this.curve.point(null,null);var t=this.curve.a,r=this.x.redSqr(),n=e.redInvm(),i=r.redAdd(r).redIAdd(r).redIAdd(t).redMul(n),o=i.redSqr().redISub(this.x.redAdd(this.x)),a=i.redMul(this.x.redSub(o)).redISub(this.y);return this.curve.point(o,a)},c.prototype.getX=function(){return this.x.fromRed()},c.prototype.getY=function(){return this.y.fromRed()},c.prototype.mul=function(e){return e=new i(e,16),this.isInfinity()?this:this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve.endo?this.curve._endoWnafMulAdd([this],[e]):this.curve._wnafMul(this,e)},c.prototype.mulAdd=function(e,t,r){var n=[this,t],i=[e,r];return this.curve.endo?this.curve._endoWnafMulAdd(n,i):this.curve._wnafMulAdd(1,n,i,2)},c.prototype.jmulAdd=function(e,t,r){var n=[this,t],i=[e,r];return this.curve.endo?this.curve._endoWnafMulAdd(n,i,!0):this.curve._wnafMulAdd(1,n,i,2,!0)},c.prototype.eq=function(e){return this===e||this.inf===e.inf&&(this.inf||0===this.x.cmp(e.x)&&0===this.y.cmp(e.y))},c.prototype.neg=function(e){if(this.inf)return this;var t=this.curve.point(this.x,this.y.redNeg());if(e&&this.precomputed){var r=this.precomputed,n=function(e){return e.neg()};t.precomputed={naf:r.naf&&{wnd:r.naf.wnd,points:r.naf.points.map(n)},doubles:r.doubles&&{step:r.doubles.step,points:r.doubles.points.map(n)}}}return t},c.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},o(u,a.BasePoint),A.prototype.jpoint=function(e,t,r){return new u(this,e,t,r)},u.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var e=this.z.redInvm(),t=e.redSqr(),r=this.x.redMul(t),n=this.y.redMul(t).redMul(e);return this.curve.point(r,n)},u.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},u.prototype.add=function(e){if(this.isInfinity())return e;if(e.isInfinity())return this;var t=e.z.redSqr(),r=this.z.redSqr(),n=this.x.redMul(t),i=e.x.redMul(r),o=this.y.redMul(t.redMul(e.z)),a=e.y.redMul(r.redMul(this.z)),s=n.redSub(i),A=o.redSub(a);if(0===s.cmpn(0))return 0!==A.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var c=s.redSqr(),u=c.redMul(s),f=n.redMul(c),h=A.redSqr().redIAdd(u).redISub(f).redISub(f),l=A.redMul(f.redISub(h)).redISub(o.redMul(u)),g=this.z.redMul(e.z).redMul(s);return this.curve.jpoint(h,l,g)},u.prototype.mixedAdd=function(e){if(this.isInfinity())return e.toJ();if(e.isInfinity())return this;var t=this.z.redSqr(),r=this.x,n=e.x.redMul(t),i=this.y,o=e.y.redMul(t).redMul(this.z),a=r.redSub(n),s=i.redSub(o);if(0===a.cmpn(0))return 0!==s.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var A=a.redSqr(),c=A.redMul(a),u=r.redMul(A),f=s.redSqr().redIAdd(c).redISub(u).redISub(u),h=s.redMul(u.redISub(f)).redISub(i.redMul(c)),l=this.z.redMul(a);return this.curve.jpoint(f,h,l)},u.prototype.dblp=function(e){if(0===e)return this;if(this.isInfinity())return this;if(!e)return this.dbl();var t;if(this.curve.zeroA||this.curve.threeA){var r=this;for(t=0;t<e;t++)r=r.dbl();return r}var n=this.curve.a,i=this.curve.tinv,o=this.x,a=this.y,s=this.z,A=s.redSqr().redSqr(),c=a.redAdd(a);for(t=0;t<e;t++){var u=o.redSqr(),f=c.redSqr(),h=f.redSqr(),l=u.redAdd(u).redIAdd(u).redIAdd(n.redMul(A)),g=o.redMul(f),d=l.redSqr().redISub(g.redAdd(g)),p=g.redISub(d),I=l.redMul(p);I=I.redIAdd(I).redISub(h);var y=c.redMul(s);t+1<e&&(A=A.redMul(h)),o=d,s=y,c=I}return this.curve.jpoint(o,c.redMul(i),s)},u.prototype.dbl=function(){return this.isInfinity()?this:this.curve.zeroA?this._zeroDbl():this.curve.threeA?this._threeDbl():this._dbl()},u.prototype._zeroDbl=function(){var e,t,r;if(this.zOne){var n=this.x.redSqr(),i=this.y.redSqr(),o=i.redSqr(),a=this.x.redAdd(i).redSqr().redISub(n).redISub(o);a=a.redIAdd(a);var s=n.redAdd(n).redIAdd(n),A=s.redSqr().redISub(a).redISub(a),c=o.redIAdd(o);c=(c=c.redIAdd(c)).redIAdd(c),e=A,t=s.redMul(a.redISub(A)).redISub(c),r=this.y.redAdd(this.y)}else{var u=this.x.redSqr(),f=this.y.redSqr(),h=f.redSqr(),l=this.x.redAdd(f).redSqr().redISub(u).redISub(h);l=l.redIAdd(l);var g=u.redAdd(u).redIAdd(u),d=g.redSqr(),p=h.redIAdd(h);p=(p=p.redIAdd(p)).redIAdd(p),e=d.redISub(l).redISub(l),t=g.redMul(l.redISub(e)).redISub(p),r=(r=this.y.redMul(this.z)).redIAdd(r)}return this.curve.jpoint(e,t,r)},u.prototype._threeDbl=function(){var e,t,r;if(this.zOne){var n=this.x.redSqr(),i=this.y.redSqr(),o=i.redSqr(),a=this.x.redAdd(i).redSqr().redISub(n).redISub(o);a=a.redIAdd(a);var s=n.redAdd(n).redIAdd(n).redIAdd(this.curve.a),A=s.redSqr().redISub(a).redISub(a);e=A;var c=o.redIAdd(o);c=(c=c.redIAdd(c)).redIAdd(c),t=s.redMul(a.redISub(A)).redISub(c),r=this.y.redAdd(this.y)}else{var u=this.z.redSqr(),f=this.y.redSqr(),h=this.x.redMul(f),l=this.x.redSub(u).redMul(this.x.redAdd(u));l=l.redAdd(l).redIAdd(l);var g=h.redIAdd(h),d=(g=g.redIAdd(g)).redAdd(g);e=l.redSqr().redISub(d),r=this.y.redAdd(this.z).redSqr().redISub(f).redISub(u);var p=f.redSqr();p=(p=(p=p.redIAdd(p)).redIAdd(p)).redIAdd(p),t=l.redMul(g.redISub(e)).redISub(p)}return this.curve.jpoint(e,t,r)},u.prototype._dbl=function(){var e=this.curve.a,t=this.x,r=this.y,n=this.z,i=n.redSqr().redSqr(),o=t.redSqr(),a=r.redSqr(),s=o.redAdd(o).redIAdd(o).redIAdd(e.redMul(i)),A=t.redAdd(t),c=(A=A.redIAdd(A)).redMul(a),u=s.redSqr().redISub(c.redAdd(c)),f=c.redISub(u),h=a.redSqr();h=(h=(h=h.redIAdd(h)).redIAdd(h)).redIAdd(h);var l=s.redMul(f).redISub(h),g=r.redAdd(r).redMul(n);return this.curve.jpoint(u,l,g)},u.prototype.trpl=function(){if(!this.curve.zeroA)return this.dbl().add(this);var e=this.x.redSqr(),t=this.y.redSqr(),r=this.z.redSqr(),n=t.redSqr(),i=e.redAdd(e).redIAdd(e),o=i.redSqr(),a=this.x.redAdd(t).redSqr().redISub(e).redISub(n),s=(a=(a=(a=a.redIAdd(a)).redAdd(a).redIAdd(a)).redISub(o)).redSqr(),A=n.redIAdd(n);A=(A=(A=A.redIAdd(A)).redIAdd(A)).redIAdd(A);var c=i.redIAdd(a).redSqr().redISub(o).redISub(s).redISub(A),u=t.redMul(c);u=(u=u.redIAdd(u)).redIAdd(u);var f=this.x.redMul(s).redISub(u);f=(f=f.redIAdd(f)).redIAdd(f);var h=this.y.redMul(c.redMul(A.redISub(c)).redISub(a.redMul(s)));h=(h=(h=h.redIAdd(h)).redIAdd(h)).redIAdd(h);var l=this.z.redAdd(a).redSqr().redISub(r).redISub(s);return this.curve.jpoint(f,h,l)},u.prototype.mul=function(e,t){return e=new i(e,t),this.curve._wnafMul(this,e)},u.prototype.eq=function(e){if("affine"===e.type)return this.eq(e.toJ());if(this===e)return!0;var t=this.z.redSqr(),r=e.z.redSqr();if(0!==this.x.redMul(r).redISub(e.x.redMul(t)).cmpn(0))return!1;var n=t.redMul(this.z),i=r.redMul(e.z);return 0===this.y.redMul(i).redISub(e.y.redMul(n)).cmpn(0)},u.prototype.eqXToP=function(e){var t=this.z.redSqr(),r=e.toRed(this.curve.red).redMul(t);if(0===this.x.cmp(r))return!0;for(var n=e.clone(),i=this.curve.redN.redMul(t);;){if(n.iadd(this.curve.n),n.cmp(this.curve.p)>=0)return!1;if(r.redIAdd(i),0===this.x.cmp(r))return!0}},u.prototype.inspect=function(){return this.isInfinity()?"<EC JPoint Infinity>":"<EC JPoint x: "+this.x.toString(16,2)+" y: "+this.y.toString(16,2)+" z: "+this.z.toString(16,2)+">"},u.prototype.isInfinity=function(){return 0===this.z.cmpn(0)}},function(e,t,r){"use strict";var n=r(2),i=r(3),o=r(47),a=r(13);function s(e){o.call(this,"mont",e),this.a=new n(e.a,16).toRed(this.red),this.b=new n(e.b,16).toRed(this.red),this.i4=new n(4).toRed(this.red).redInvm(),this.two=new n(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}function A(e,t,r){o.BasePoint.call(this,e,"projective"),null===t&&null===r?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new n(t,16),this.z=new n(r,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}i(s,o),e.exports=s,s.prototype.validate=function(e){var t=e.normalize().x,r=t.redSqr(),n=r.redMul(t).redAdd(r.redMul(this.a)).redAdd(t);return 0===n.redSqrt().redSqr().cmp(n)},i(A,o.BasePoint),s.prototype.decodePoint=function(e,t){return this.point(a.toArray(e,t),1)},s.prototype.point=function(e,t){return new A(this,e,t)},s.prototype.pointFromJSON=function(e){return A.fromJSON(this,e)},A.prototype.precompute=function(){},A.prototype._encode=function(){return this.getX().toArray("be",this.curve.p.byteLength())},A.fromJSON=function(e,t){return new A(e,t[0],t[1]||e.one)},A.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" z: "+this.z.fromRed().toString(16,2)+">"},A.prototype.isInfinity=function(){return 0===this.z.cmpn(0)},A.prototype.dbl=function(){var e=this.x.redAdd(this.z).redSqr(),t=this.x.redSub(this.z).redSqr(),r=e.redSub(t),n=e.redMul(t),i=r.redMul(t.redAdd(this.curve.a24.redMul(r)));return this.curve.point(n,i)},A.prototype.add=function(){throw new Error("Not supported on Montgomery curve")},A.prototype.diffAdd=function(e,t){var r=this.x.redAdd(this.z),n=this.x.redSub(this.z),i=e.x.redAdd(e.z),o=e.x.redSub(e.z).redMul(r),a=i.redMul(n),s=t.z.redMul(o.redAdd(a).redSqr()),A=t.x.redMul(o.redISub(a).redSqr());return this.curve.point(s,A)},A.prototype.mul=function(e){for(var t=e.clone(),r=this,n=this.curve.point(null,null),i=[];0!==t.cmpn(0);t.iushrn(1))i.push(t.andln(1));for(var o=i.length-1;o>=0;o--)0===i[o]?(r=r.diffAdd(n,this),n=n.dbl()):(n=r.diffAdd(n,this),r=r.dbl());return n},A.prototype.mulAdd=function(){throw new Error("Not supported on Montgomery curve")},A.prototype.jumlAdd=function(){throw new Error("Not supported on Montgomery curve")},A.prototype.eq=function(e){return 0===this.getX().cmp(e.getX())},A.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this},A.prototype.getX=function(){return this.normalize(),this.x.fromRed()}},function(e,t,r){"use strict";var n=r(13),i=r(2),o=r(3),a=r(47),s=n.assert;function A(e){this.twisted=1!=(0|e.a),this.mOneA=this.twisted&&-1==(0|e.a),this.extended=this.mOneA,a.call(this,"edwards",e),this.a=new i(e.a,16).umod(this.red.m),this.a=this.a.toRed(this.red),this.c=new i(e.c,16).toRed(this.red),this.c2=this.c.redSqr(),this.d=new i(e.d,16).toRed(this.red),this.dd=this.d.redAdd(this.d),s(!this.twisted||0===this.c.fromRed().cmpn(1)),this.oneC=1==(0|e.c)}function c(e,t,r,n,o){a.BasePoint.call(this,e,"projective"),null===t&&null===r&&null===n?(this.x=this.curve.zero,this.y=this.curve.one,this.z=this.curve.one,this.t=this.curve.zero,this.zOne=!0):(this.x=new i(t,16),this.y=new i(r,16),this.z=n?new i(n,16):this.curve.one,this.t=o&&new i(o,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.t&&!this.t.red&&(this.t=this.t.toRed(this.curve.red)),this.zOne=this.z===this.curve.one,this.curve.extended&&!this.t&&(this.t=this.x.redMul(this.y),this.zOne||(this.t=this.t.redMul(this.z.redInvm()))))}o(A,a),e.exports=A,A.prototype._mulA=function(e){return this.mOneA?e.redNeg():this.a.redMul(e)},A.prototype._mulC=function(e){return this.oneC?e:this.c.redMul(e)},A.prototype.jpoint=function(e,t,r,n){return this.point(e,t,r,n)},A.prototype.pointFromX=function(e,t){(e=new i(e,16)).red||(e=e.toRed(this.red));var r=e.redSqr(),n=this.c2.redSub(this.a.redMul(r)),o=this.one.redSub(this.c2.redMul(this.d).redMul(r)),a=n.redMul(o.redInvm()),s=a.redSqrt();if(0!==s.redSqr().redSub(a).cmp(this.zero))throw new Error("invalid point");var A=s.fromRed().isOdd();return(t&&!A||!t&&A)&&(s=s.redNeg()),this.point(e,s)},A.prototype.pointFromY=function(e,t){(e=new i(e,16)).red||(e=e.toRed(this.red));var r=e.redSqr(),n=r.redSub(this.c2),o=r.redMul(this.d).redMul(this.c2).redSub(this.a),a=n.redMul(o.redInvm());if(0===a.cmp(this.zero)){if(t)throw new Error("invalid point");return this.point(this.zero,e)}var s=a.redSqrt();if(0!==s.redSqr().redSub(a).cmp(this.zero))throw new Error("invalid point");return s.fromRed().isOdd()!==t&&(s=s.redNeg()),this.point(s,e)},A.prototype.validate=function(e){if(e.isInfinity())return!0;e.normalize();var t=e.x.redSqr(),r=e.y.redSqr(),n=t.redMul(this.a).redAdd(r),i=this.c2.redMul(this.one.redAdd(this.d.redMul(t).redMul(r)));return 0===n.cmp(i)},o(c,a.BasePoint),A.prototype.pointFromJSON=function(e){return c.fromJSON(this,e)},A.prototype.point=function(e,t,r,n){return new c(this,e,t,r,n)},c.fromJSON=function(e,t){return new c(e,t[0],t[1],t[2])},c.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+" z: "+this.z.fromRed().toString(16,2)+">"},c.prototype.isInfinity=function(){return 0===this.x.cmpn(0)&&(0===this.y.cmp(this.z)||this.zOne&&0===this.y.cmp(this.curve.c))},c.prototype._extDbl=function(){var e=this.x.redSqr(),t=this.y.redSqr(),r=this.z.redSqr();r=r.redIAdd(r);var n=this.curve._mulA(e),i=this.x.redAdd(this.y).redSqr().redISub(e).redISub(t),o=n.redAdd(t),a=o.redSub(r),s=n.redSub(t),A=i.redMul(a),c=o.redMul(s),u=i.redMul(s),f=a.redMul(o);return this.curve.point(A,c,f,u)},c.prototype._projDbl=function(){var e,t,r,n,i,o,a=this.x.redAdd(this.y).redSqr(),s=this.x.redSqr(),A=this.y.redSqr();if(this.curve.twisted){var c=(n=this.curve._mulA(s)).redAdd(A);this.zOne?(e=a.redSub(s).redSub(A).redMul(c.redSub(this.curve.two)),t=c.redMul(n.redSub(A)),r=c.redSqr().redSub(c).redSub(c)):(i=this.z.redSqr(),o=c.redSub(i).redISub(i),e=a.redSub(s).redISub(A).redMul(o),t=c.redMul(n.redSub(A)),r=c.redMul(o))}else n=s.redAdd(A),i=this.curve._mulC(this.z).redSqr(),o=n.redSub(i).redSub(i),e=this.curve._mulC(a.redISub(n)).redMul(o),t=this.curve._mulC(n).redMul(s.redISub(A)),r=n.redMul(o);return this.curve.point(e,t,r)},c.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()},c.prototype._extAdd=function(e){var t=this.y.redSub(this.x).redMul(e.y.redSub(e.x)),r=this.y.redAdd(this.x).redMul(e.y.redAdd(e.x)),n=this.t.redMul(this.curve.dd).redMul(e.t),i=this.z.redMul(e.z.redAdd(e.z)),o=r.redSub(t),a=i.redSub(n),s=i.redAdd(n),A=r.redAdd(t),c=o.redMul(a),u=s.redMul(A),f=o.redMul(A),h=a.redMul(s);return this.curve.point(c,u,h,f)},c.prototype._projAdd=function(e){var t,r,n=this.z.redMul(e.z),i=n.redSqr(),o=this.x.redMul(e.x),a=this.y.redMul(e.y),s=this.curve.d.redMul(o).redMul(a),A=i.redSub(s),c=i.redAdd(s),u=this.x.redAdd(this.y).redMul(e.x.redAdd(e.y)).redISub(o).redISub(a),f=n.redMul(A).redMul(u);return this.curve.twisted?(t=n.redMul(c).redMul(a.redSub(this.curve._mulA(o))),r=A.redMul(c)):(t=n.redMul(c).redMul(a.redSub(o)),r=this.curve._mulC(A).redMul(c)),this.curve.point(f,t,r)},c.prototype.add=function(e){return this.isInfinity()?e:e.isInfinity()?this:this.curve.extended?this._extAdd(e):this._projAdd(e)},c.prototype.mul=function(e){return this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve._wnafMul(this,e)},c.prototype.mulAdd=function(e,t,r){return this.curve._wnafMulAdd(1,[this,t],[e,r],2,!1)},c.prototype.jmulAdd=function(e,t,r){return this.curve._wnafMulAdd(1,[this,t],[e,r],2,!0)},c.prototype.normalize=function(){if(this.zOne)return this;var e=this.z.redInvm();return this.x=this.x.redMul(e),this.y=this.y.redMul(e),this.t&&(this.t=this.t.redMul(e)),this.z=this.curve.one,this.zOne=!0,this},c.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())},c.prototype.getX=function(){return this.normalize(),this.x.fromRed()},c.prototype.getY=function(){return this.normalize(),this.y.fromRed()},c.prototype.eq=function(e){return this===e||0===this.getX().cmp(e.getX())&&0===this.getY().cmp(e.getY())},c.prototype.eqXToP=function(e){var t=e.toRed(this.curve.red).redMul(this.z);if(0===this.x.cmp(t))return!0;for(var r=e.clone(),n=this.curve.redN.redMul(this.z);;){if(r.iadd(this.curve.n),r.cmp(this.curve.p)>=0)return!1;if(t.redIAdd(n),0===this.x.cmp(t))return!0}},c.prototype.toP=c.prototype.normalize,c.prototype.mixedAdd=c.prototype.add},function(e,t){e.exports={doubles:{step:4,points:[["e60fce93b59e9ec53011aabc21c23e97b2a31369b87a5ae9c44ee89e2a6dec0a","f7e3507399e595929db99f34f57937101296891e44d23f0be1f32cce69616821"],["8282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508","11f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf"],["175e159f728b865a72f99cc6c6fc846de0b93833fd2222ed73fce5b551e5b739","d3506e0d9e3c79eba4ef97a51ff71f5eacb5955add24345c6efa6ffee9fed695"],["363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640","4e273adfc732221953b445397f3363145b9a89008199ecb62003c7f3bee9de9"],["8b4b5f165df3c2be8c6244b5b745638843e4a781a15bcd1b69f79a55dffdf80c","4aad0a6f68d308b4b3fbd7813ab0da04f9e336546162ee56b3eff0c65fd4fd36"],["723cbaa6e5db996d6bf771c00bd548c7b700dbffa6c0e77bcb6115925232fcda","96e867b5595cc498a921137488824d6e2660a0653779494801dc069d9eb39f5f"],["eebfa4d493bebf98ba5feec812c2d3b50947961237a919839a533eca0e7dd7fa","5d9a8ca3970ef0f269ee7edaf178089d9ae4cdc3a711f712ddfd4fdae1de8999"],["100f44da696e71672791d0a09b7bde459f1215a29b3c03bfefd7835b39a48db0","cdd9e13192a00b772ec8f3300c090666b7ff4a18ff5195ac0fbd5cd62bc65a09"],["e1031be262c7ed1b1dc9227a4a04c017a77f8d4464f3b3852c8acde6e534fd2d","9d7061928940405e6bb6a4176597535af292dd419e1ced79a44f18f29456a00d"],["feea6cae46d55b530ac2839f143bd7ec5cf8b266a41d6af52d5e688d9094696d","e57c6b6c97dce1bab06e4e12bf3ecd5c981c8957cc41442d3155debf18090088"],["da67a91d91049cdcb367be4be6ffca3cfeed657d808583de33fa978bc1ec6cb1","9bacaa35481642bc41f463f7ec9780e5dec7adc508f740a17e9ea8e27a68be1d"],["53904faa0b334cdda6e000935ef22151ec08d0f7bb11069f57545ccc1a37b7c0","5bc087d0bc80106d88c9eccac20d3c1c13999981e14434699dcb096b022771c8"],["8e7bcd0bd35983a7719cca7764ca906779b53a043a9b8bcaeff959f43ad86047","10b7770b2a3da4b3940310420ca9514579e88e2e47fd68b3ea10047e8460372a"],["385eed34c1cdff21e6d0818689b81bde71a7f4f18397e6690a841e1599c43862","283bebc3e8ea23f56701de19e9ebf4576b304eec2086dc8cc0458fe5542e5453"],["6f9d9b803ecf191637c73a4413dfa180fddf84a5947fbc9c606ed86c3fac3a7","7c80c68e603059ba69b8e2a30e45c4d47ea4dd2f5c281002d86890603a842160"],["3322d401243c4e2582a2147c104d6ecbf774d163db0f5e5313b7e0e742d0e6bd","56e70797e9664ef5bfb019bc4ddaf9b72805f63ea2873af624f3a2e96c28b2a0"],["85672c7d2de0b7da2bd1770d89665868741b3f9af7643397721d74d28134ab83","7c481b9b5b43b2eb6374049bfa62c2e5e77f17fcc5298f44c8e3094f790313a6"],["948bf809b1988a46b06c9f1919413b10f9226c60f668832ffd959af60c82a0a","53a562856dcb6646dc6b74c5d1c3418c6d4dff08c97cd2bed4cb7f88d8c8e589"],["6260ce7f461801c34f067ce0f02873a8f1b0e44dfc69752accecd819f38fd8e8","bc2da82b6fa5b571a7f09049776a1ef7ecd292238051c198c1a84e95b2b4ae17"],["e5037de0afc1d8d43d8348414bbf4103043ec8f575bfdc432953cc8d2037fa2d","4571534baa94d3b5f9f98d09fb990bddbd5f5b03ec481f10e0e5dc841d755bda"],["e06372b0f4a207adf5ea905e8f1771b4e7e8dbd1c6a6c5b725866a0ae4fce725","7a908974bce18cfe12a27bb2ad5a488cd7484a7787104870b27034f94eee31dd"],["213c7a715cd5d45358d0bbf9dc0ce02204b10bdde2a3f58540ad6908d0559754","4b6dad0b5ae462507013ad06245ba190bb4850f5f36a7eeddff2c27534b458f2"],["4e7c272a7af4b34e8dbb9352a5419a87e2838c70adc62cddf0cc3a3b08fbd53c","17749c766c9d0b18e16fd09f6def681b530b9614bff7dd33e0b3941817dcaae6"],["fea74e3dbe778b1b10f238ad61686aa5c76e3db2be43057632427e2840fb27b6","6e0568db9b0b13297cf674deccb6af93126b596b973f7b77701d3db7f23cb96f"],["76e64113f677cf0e10a2570d599968d31544e179b760432952c02a4417bdde39","c90ddf8dee4e95cf577066d70681f0d35e2a33d2b56d2032b4b1752d1901ac01"],["c738c56b03b2abe1e8281baa743f8f9a8f7cc643df26cbee3ab150242bcbb891","893fb578951ad2537f718f2eacbfbbbb82314eef7880cfe917e735d9699a84c3"],["d895626548b65b81e264c7637c972877d1d72e5f3a925014372e9f6588f6c14b","febfaa38f2bc7eae728ec60818c340eb03428d632bb067e179363ed75d7d991f"],["b8da94032a957518eb0f6433571e8761ceffc73693e84edd49150a564f676e03","2804dfa44805a1e4d7c99cc9762808b092cc584d95ff3b511488e4e74efdf6e7"],["e80fea14441fb33a7d8adab9475d7fab2019effb5156a792f1a11778e3c0df5d","eed1de7f638e00771e89768ca3ca94472d155e80af322ea9fcb4291b6ac9ec78"],["a301697bdfcd704313ba48e51d567543f2a182031efd6915ddc07bbcc4e16070","7370f91cfb67e4f5081809fa25d40f9b1735dbf7c0a11a130c0d1a041e177ea1"],["90ad85b389d6b936463f9d0512678de208cc330b11307fffab7ac63e3fb04ed4","e507a3620a38261affdcbd9427222b839aefabe1582894d991d4d48cb6ef150"],["8f68b9d2f63b5f339239c1ad981f162ee88c5678723ea3351b7b444c9ec4c0da","662a9f2dba063986de1d90c2b6be215dbbea2cfe95510bfdf23cbf79501fff82"],["e4f3fb0176af85d65ff99ff9198c36091f48e86503681e3e6686fd5053231e11","1e63633ad0ef4f1c1661a6d0ea02b7286cc7e74ec951d1c9822c38576feb73bc"],["8c00fa9b18ebf331eb961537a45a4266c7034f2f0d4e1d0716fb6eae20eae29e","efa47267fea521a1a9dc343a3736c974c2fadafa81e36c54e7d2a4c66702414b"],["e7a26ce69dd4829f3e10cec0a9e98ed3143d084f308b92c0997fddfc60cb3e41","2a758e300fa7984b471b006a1aafbb18d0a6b2c0420e83e20e8a9421cf2cfd51"],["b6459e0ee3662ec8d23540c223bcbdc571cbcb967d79424f3cf29eb3de6b80ef","67c876d06f3e06de1dadf16e5661db3c4b3ae6d48e35b2ff30bf0b61a71ba45"],["d68a80c8280bb840793234aa118f06231d6f1fc67e73c5a5deda0f5b496943e8","db8ba9fff4b586d00c4b1f9177b0e28b5b0e7b8f7845295a294c84266b133120"],["324aed7df65c804252dc0270907a30b09612aeb973449cea4095980fc28d3d5d","648a365774b61f2ff130c0c35aec1f4f19213b0c7e332843967224af96ab7c84"],["4df9c14919cde61f6d51dfdbe5fee5dceec4143ba8d1ca888e8bd373fd054c96","35ec51092d8728050974c23a1d85d4b5d506cdc288490192ebac06cad10d5d"],["9c3919a84a474870faed8a9c1cc66021523489054d7f0308cbfc99c8ac1f98cd","ddb84f0f4a4ddd57584f044bf260e641905326f76c64c8e6be7e5e03d4fc599d"],["6057170b1dd12fdf8de05f281d8e06bb91e1493a8b91d4cc5a21382120a959e5","9a1af0b26a6a4807add9a2daf71df262465152bc3ee24c65e899be932385a2a8"],["a576df8e23a08411421439a4518da31880cef0fba7d4df12b1a6973eecb94266","40a6bf20e76640b2c92b97afe58cd82c432e10a7f514d9f3ee8be11ae1b28ec8"],["7778a78c28dec3e30a05fe9629de8c38bb30d1f5cf9a3a208f763889be58ad71","34626d9ab5a5b22ff7098e12f2ff580087b38411ff24ac563b513fc1fd9f43ac"],["928955ee637a84463729fd30e7afd2ed5f96274e5ad7e5cb09eda9c06d903ac","c25621003d3f42a827b78a13093a95eeac3d26efa8a8d83fc5180e935bcd091f"],["85d0fef3ec6db109399064f3a0e3b2855645b4a907ad354527aae75163d82751","1f03648413a38c0be29d496e582cf5663e8751e96877331582c237a24eb1f962"],["ff2b0dce97eece97c1c9b6041798b85dfdfb6d8882da20308f5404824526087e","493d13fef524ba188af4c4dc54d07936c7b7ed6fb90e2ceb2c951e01f0c29907"],["827fbbe4b1e880ea9ed2b2e6301b212b57f1ee148cd6dd28780e5e2cf856e241","c60f9c923c727b0b71bef2c67d1d12687ff7a63186903166d605b68baec293ec"],["eaa649f21f51bdbae7be4ae34ce6e5217a58fdce7f47f9aa7f3b58fa2120e2b3","be3279ed5bbbb03ac69a80f89879aa5a01a6b965f13f7e59d47a5305ba5ad93d"],["e4a42d43c5cf169d9391df6decf42ee541b6d8f0c9a137401e23632dda34d24f","4d9f92e716d1c73526fc99ccfb8ad34ce886eedfa8d8e4f13a7f7131deba9414"],["1ec80fef360cbdd954160fadab352b6b92b53576a88fea4947173b9d4300bf19","aeefe93756b5340d2f3a4958a7abbf5e0146e77f6295a07b671cdc1cc107cefd"],["146a778c04670c2f91b00af4680dfa8bce3490717d58ba889ddb5928366642be","b318e0ec3354028add669827f9d4b2870aaa971d2f7e5ed1d0b297483d83efd0"],["fa50c0f61d22e5f07e3acebb1aa07b128d0012209a28b9776d76a8793180eef9","6b84c6922397eba9b72cd2872281a68a5e683293a57a213b38cd8d7d3f4f2811"],["da1d61d0ca721a11b1a5bf6b7d88e8421a288ab5d5bba5220e53d32b5f067ec2","8157f55a7c99306c79c0766161c91e2966a73899d279b48a655fba0f1ad836f1"],["a8e282ff0c9706907215ff98e8fd416615311de0446f1e062a73b0610d064e13","7f97355b8db81c09abfb7f3c5b2515888b679a3e50dd6bd6cef7c73111f4cc0c"],["174a53b9c9a285872d39e56e6913cab15d59b1fa512508c022f382de8319497c","ccc9dc37abfc9c1657b4155f2c47f9e6646b3a1d8cb9854383da13ac079afa73"],["959396981943785c3d3e57edf5018cdbe039e730e4918b3d884fdff09475b7ba","2e7e552888c331dd8ba0386a4b9cd6849c653f64c8709385e9b8abf87524f2fd"],["d2a63a50ae401e56d645a1153b109a8fcca0a43d561fba2dbb51340c9d82b151","e82d86fb6443fcb7565aee58b2948220a70f750af484ca52d4142174dcf89405"],["64587e2335471eb890ee7896d7cfdc866bacbdbd3839317b3436f9b45617e073","d99fcdd5bf6902e2ae96dd6447c299a185b90a39133aeab358299e5e9faf6589"],["8481bde0e4e4d885b3a546d3e549de042f0aa6cea250e7fd358d6c86dd45e458","38ee7b8cba5404dd84a25bf39cecb2ca900a79c42b262e556d64b1b59779057e"],["13464a57a78102aa62b6979ae817f4637ffcfed3c4b1ce30bcd6303f6caf666b","69be159004614580ef7e433453ccb0ca48f300a81d0942e13f495a907f6ecc27"],["bc4a9df5b713fe2e9aef430bcc1dc97a0cd9ccede2f28588cada3a0d2d83f366","d3a81ca6e785c06383937adf4b798caa6e8a9fbfa547b16d758d666581f33c1"],["8c28a97bf8298bc0d23d8c749452a32e694b65e30a9472a3954ab30fe5324caa","40a30463a3305193378fedf31f7cc0eb7ae784f0451cb9459e71dc73cbef9482"],["8ea9666139527a8c1dd94ce4f071fd23c8b350c5a4bb33748c4ba111faccae0","620efabbc8ee2782e24e7c0cfb95c5d735b783be9cf0f8e955af34a30e62b945"],["dd3625faef5ba06074669716bbd3788d89bdde815959968092f76cc4eb9a9787","7a188fa3520e30d461da2501045731ca941461982883395937f68d00c644a573"],["f710d79d9eb962297e4f6232b40e8f7feb2bc63814614d692c12de752408221e","ea98e67232d3b3295d3b535532115ccac8612c721851617526ae47a9c77bfc82"]]},naf:{wnd:7,points:[["f9308a019258c31049344f85f89d5229b531c845836f99b08601f113bce036f9","388f7b0f632de8140fe337e62a37f3566500a99934c2231b6cb9fd7584b8e672"],["2f8bde4d1a07209355b4a7250a5c5128e88b84bddc619ab7cba8d569b240efe4","d8ac222636e5e3d6d4dba9dda6c9c426f788271bab0d6840dca87d3aa6ac62d6"],["5cbdf0646e5db4eaa398f365f2ea7a0e3d419b7e0330e39ce92bddedcac4f9bc","6aebca40ba255960a3178d6d861a54dba813d0b813fde7b5a5082628087264da"],["acd484e2f0c7f65309ad178a9f559abde09796974c57e714c35f110dfc27ccbe","cc338921b0a7d9fd64380971763b61e9add888a4375f8e0f05cc262ac64f9c37"],["774ae7f858a9411e5ef4246b70c65aac5649980be5c17891bbec17895da008cb","d984a032eb6b5e190243dd56d7b7b365372db1e2dff9d6a8301d74c9c953c61b"],["f28773c2d975288bc7d1d205c3748651b075fbc6610e58cddeeddf8f19405aa8","ab0902e8d880a89758212eb65cdaf473a1a06da521fa91f29b5cb52db03ed81"],["d7924d4f7d43ea965a465ae3095ff41131e5946f3c85f79e44adbcf8e27e080e","581e2872a86c72a683842ec228cc6defea40af2bd896d3a5c504dc9ff6a26b58"],["defdea4cdb677750a420fee807eacf21eb9898ae79b9768766e4faa04a2d4a34","4211ab0694635168e997b0ead2a93daeced1f4a04a95c0f6cfb199f69e56eb77"],["2b4ea0a797a443d293ef5cff444f4979f06acfebd7e86d277475656138385b6c","85e89bc037945d93b343083b5a1c86131a01f60c50269763b570c854e5c09b7a"],["352bbf4a4cdd12564f93fa332ce333301d9ad40271f8107181340aef25be59d5","321eb4075348f534d59c18259dda3e1f4a1b3b2e71b1039c67bd3d8bcf81998c"],["2fa2104d6b38d11b0230010559879124e42ab8dfeff5ff29dc9cdadd4ecacc3f","2de1068295dd865b64569335bd5dd80181d70ecfc882648423ba76b532b7d67"],["9248279b09b4d68dab21a9b066edda83263c3d84e09572e269ca0cd7f5453714","73016f7bf234aade5d1aa71bdea2b1ff3fc0de2a887912ffe54a32ce97cb3402"],["daed4f2be3a8bf278e70132fb0beb7522f570e144bf615c07e996d443dee8729","a69dce4a7d6c98e8d4a1aca87ef8d7003f83c230f3afa726ab40e52290be1c55"],["c44d12c7065d812e8acf28d7cbb19f9011ecd9e9fdf281b0e6a3b5e87d22e7db","2119a460ce326cdc76c45926c982fdac0e106e861edf61c5a039063f0e0e6482"],["6a245bf6dc698504c89a20cfded60853152b695336c28063b61c65cbd269e6b4","e022cf42c2bd4a708b3f5126f16a24ad8b33ba48d0423b6efd5e6348100d8a82"],["1697ffa6fd9de627c077e3d2fe541084ce13300b0bec1146f95ae57f0d0bd6a5","b9c398f186806f5d27561506e4557433a2cf15009e498ae7adee9d63d01b2396"],["605bdb019981718b986d0f07e834cb0d9deb8360ffb7f61df982345ef27a7479","2972d2de4f8d20681a78d93ec96fe23c26bfae84fb14db43b01e1e9056b8c49"],["62d14dab4150bf497402fdc45a215e10dcb01c354959b10cfe31c7e9d87ff33d","80fc06bd8cc5b01098088a1950eed0db01aa132967ab472235f5642483b25eaf"],["80c60ad0040f27dade5b4b06c408e56b2c50e9f56b9b8b425e555c2f86308b6f","1c38303f1cc5c30f26e66bad7fe72f70a65eed4cbe7024eb1aa01f56430bd57a"],["7a9375ad6167ad54aa74c6348cc54d344cc5dc9487d847049d5eabb0fa03c8fb","d0e3fa9eca8726909559e0d79269046bdc59ea10c70ce2b02d499ec224dc7f7"],["d528ecd9b696b54c907a9ed045447a79bb408ec39b68df504bb51f459bc3ffc9","eecf41253136e5f99966f21881fd656ebc4345405c520dbc063465b521409933"],["49370a4b5f43412ea25f514e8ecdad05266115e4a7ecb1387231808f8b45963","758f3f41afd6ed428b3081b0512fd62a54c3f3afbb5b6764b653052a12949c9a"],["77f230936ee88cbbd73df930d64702ef881d811e0e1498e2f1c13eb1fc345d74","958ef42a7886b6400a08266e9ba1b37896c95330d97077cbbe8eb3c7671c60d6"],["f2dac991cc4ce4b9ea44887e5c7c0bce58c80074ab9d4dbaeb28531b7739f530","e0dedc9b3b2f8dad4da1f32dec2531df9eb5fbeb0598e4fd1a117dba703a3c37"],["463b3d9f662621fb1b4be8fbbe2520125a216cdfc9dae3debcba4850c690d45b","5ed430d78c296c3543114306dd8622d7c622e27c970a1de31cb377b01af7307e"],["f16f804244e46e2a09232d4aff3b59976b98fac14328a2d1a32496b49998f247","cedabd9b82203f7e13d206fcdf4e33d92a6c53c26e5cce26d6579962c4e31df6"],["caf754272dc84563b0352b7a14311af55d245315ace27c65369e15f7151d41d1","cb474660ef35f5f2a41b643fa5e460575f4fa9b7962232a5c32f908318a04476"],["2600ca4b282cb986f85d0f1709979d8b44a09c07cb86d7c124497bc86f082120","4119b88753c15bd6a693b03fcddbb45d5ac6be74ab5f0ef44b0be9475a7e4b40"],["7635ca72d7e8432c338ec53cd12220bc01c48685e24f7dc8c602a7746998e435","91b649609489d613d1d5e590f78e6d74ecfc061d57048bad9e76f302c5b9c61"],["754e3239f325570cdbbf4a87deee8a66b7f2b33479d468fbc1a50743bf56cc18","673fb86e5bda30fb3cd0ed304ea49a023ee33d0197a695d0c5d98093c536683"],["e3e6bd1071a1e96aff57859c82d570f0330800661d1c952f9fe2694691d9b9e8","59c9e0bba394e76f40c0aa58379a3cb6a5a2283993e90c4167002af4920e37f5"],["186b483d056a033826ae73d88f732985c4ccb1f32ba35f4b4cc47fdcf04aa6eb","3b952d32c67cf77e2e17446e204180ab21fb8090895138b4a4a797f86e80888b"],["df9d70a6b9876ce544c98561f4be4f725442e6d2b737d9c91a8321724ce0963f","55eb2dafd84d6ccd5f862b785dc39d4ab157222720ef9da217b8c45cf2ba2417"],["5edd5cc23c51e87a497ca815d5dce0f8ab52554f849ed8995de64c5f34ce7143","efae9c8dbc14130661e8cec030c89ad0c13c66c0d17a2905cdc706ab7399a868"],["290798c2b6476830da12fe02287e9e777aa3fba1c355b17a722d362f84614fba","e38da76dcd440621988d00bcf79af25d5b29c094db2a23146d003afd41943e7a"],["af3c423a95d9f5b3054754efa150ac39cd29552fe360257362dfdecef4053b45","f98a3fd831eb2b749a93b0e6f35cfb40c8cd5aa667a15581bc2feded498fd9c6"],["766dbb24d134e745cccaa28c99bf274906bb66b26dcf98df8d2fed50d884249a","744b1152eacbe5e38dcc887980da38b897584a65fa06cedd2c924f97cbac5996"],["59dbf46f8c94759ba21277c33784f41645f7b44f6c596a58ce92e666191abe3e","c534ad44175fbc300f4ea6ce648309a042ce739a7919798cd85e216c4a307f6e"],["f13ada95103c4537305e691e74e9a4a8dd647e711a95e73cb62dc6018cfd87b8","e13817b44ee14de663bf4bc808341f326949e21a6a75c2570778419bdaf5733d"],["7754b4fa0e8aced06d4167a2c59cca4cda1869c06ebadfb6488550015a88522c","30e93e864e669d82224b967c3020b8fa8d1e4e350b6cbcc537a48b57841163a2"],["948dcadf5990e048aa3874d46abef9d701858f95de8041d2a6828c99e2262519","e491a42537f6e597d5d28a3224b1bc25df9154efbd2ef1d2cbba2cae5347d57e"],["7962414450c76c1689c7b48f8202ec37fb224cf5ac0bfa1570328a8a3d7c77ab","100b610ec4ffb4760d5c1fc133ef6f6b12507a051f04ac5760afa5b29db83437"],["3514087834964b54b15b160644d915485a16977225b8847bb0dd085137ec47ca","ef0afbb2056205448e1652c48e8127fc6039e77c15c2378b7e7d15a0de293311"],["d3cc30ad6b483e4bc79ce2c9dd8bc54993e947eb8df787b442943d3f7b527eaf","8b378a22d827278d89c5e9be8f9508ae3c2ad46290358630afb34db04eede0a4"],["1624d84780732860ce1c78fcbfefe08b2b29823db913f6493975ba0ff4847610","68651cf9b6da903e0914448c6cd9d4ca896878f5282be4c8cc06e2a404078575"],["733ce80da955a8a26902c95633e62a985192474b5af207da6df7b4fd5fc61cd4","f5435a2bd2badf7d485a4d8b8db9fcce3e1ef8e0201e4578c54673bc1dc5ea1d"],["15d9441254945064cf1a1c33bbd3b49f8966c5092171e699ef258dfab81c045c","d56eb30b69463e7234f5137b73b84177434800bacebfc685fc37bbe9efe4070d"],["a1d0fcf2ec9de675b612136e5ce70d271c21417c9d2b8aaaac138599d0717940","edd77f50bcb5a3cab2e90737309667f2641462a54070f3d519212d39c197a629"],["e22fbe15c0af8ccc5780c0735f84dbe9a790badee8245c06c7ca37331cb36980","a855babad5cd60c88b430a69f53a1a7a38289154964799be43d06d77d31da06"],["311091dd9860e8e20ee13473c1155f5f69635e394704eaa74009452246cfa9b3","66db656f87d1f04fffd1f04788c06830871ec5a64feee685bd80f0b1286d8374"],["34c1fd04d301be89b31c0442d3e6ac24883928b45a9340781867d4232ec2dbdf","9414685e97b1b5954bd46f730174136d57f1ceeb487443dc5321857ba73abee"],["f219ea5d6b54701c1c14de5b557eb42a8d13f3abbcd08affcc2a5e6b049b8d63","4cb95957e83d40b0f73af4544cccf6b1f4b08d3c07b27fb8d8c2962a400766d1"],["d7b8740f74a8fbaab1f683db8f45de26543a5490bca627087236912469a0b448","fa77968128d9c92ee1010f337ad4717eff15db5ed3c049b3411e0315eaa4593b"],["32d31c222f8f6f0ef86f7c98d3a3335ead5bcd32abdd94289fe4d3091aa824bf","5f3032f5892156e39ccd3d7915b9e1da2e6dac9e6f26e961118d14b8462e1661"],["7461f371914ab32671045a155d9831ea8793d77cd59592c4340f86cbc18347b5","8ec0ba238b96bec0cbdddcae0aa442542eee1ff50c986ea6b39847b3cc092ff6"],["ee079adb1df1860074356a25aa38206a6d716b2c3e67453d287698bad7b2b2d6","8dc2412aafe3be5c4c5f37e0ecc5f9f6a446989af04c4e25ebaac479ec1c8c1e"],["16ec93e447ec83f0467b18302ee620f7e65de331874c9dc72bfd8616ba9da6b5","5e4631150e62fb40d0e8c2a7ca5804a39d58186a50e497139626778e25b0674d"],["eaa5f980c245f6f038978290afa70b6bd8855897f98b6aa485b96065d537bd99","f65f5d3e292c2e0819a528391c994624d784869d7e6ea67fb18041024edc07dc"],["78c9407544ac132692ee1910a02439958ae04877151342ea96c4b6b35a49f51","f3e0319169eb9b85d5404795539a5e68fa1fbd583c064d2462b675f194a3ddb4"],["494f4be219a1a77016dcd838431aea0001cdc8ae7a6fc688726578d9702857a5","42242a969283a5f339ba7f075e36ba2af925ce30d767ed6e55f4b031880d562c"],["a598a8030da6d86c6bc7f2f5144ea549d28211ea58faa70ebf4c1e665c1fe9b5","204b5d6f84822c307e4b4a7140737aec23fc63b65b35f86a10026dbd2d864e6b"],["c41916365abb2b5d09192f5f2dbeafec208f020f12570a184dbadc3e58595997","4f14351d0087efa49d245b328984989d5caf9450f34bfc0ed16e96b58fa9913"],["841d6063a586fa475a724604da03bc5b92a2e0d2e0a36acfe4c73a5514742881","73867f59c0659e81904f9a1c7543698e62562d6744c169ce7a36de01a8d6154"],["5e95bb399a6971d376026947f89bde2f282b33810928be4ded112ac4d70e20d5","39f23f366809085beebfc71181313775a99c9aed7d8ba38b161384c746012865"],["36e4641a53948fd476c39f8a99fd974e5ec07564b5315d8bf99471bca0ef2f66","d2424b1b1abe4eb8164227b085c9aa9456ea13493fd563e06fd51cf5694c78fc"],["336581ea7bfbbb290c191a2f507a41cf5643842170e914faeab27c2c579f726","ead12168595fe1be99252129b6e56b3391f7ab1410cd1e0ef3dcdcabd2fda224"],["8ab89816dadfd6b6a1f2634fcf00ec8403781025ed6890c4849742706bd43ede","6fdcef09f2f6d0a044e654aef624136f503d459c3e89845858a47a9129cdd24e"],["1e33f1a746c9c5778133344d9299fcaa20b0938e8acff2544bb40284b8c5fb94","60660257dd11b3aa9c8ed618d24edff2306d320f1d03010e33a7d2057f3b3b6"],["85b7c1dcb3cec1b7ee7f30ded79dd20a0ed1f4cc18cbcfcfa410361fd8f08f31","3d98a9cdd026dd43f39048f25a8847f4fcafad1895d7a633c6fed3c35e999511"],["29df9fbd8d9e46509275f4b125d6d45d7fbe9a3b878a7af872a2800661ac5f51","b4c4fe99c775a606e2d8862179139ffda61dc861c019e55cd2876eb2a27d84b"],["a0b1cae06b0a847a3fea6e671aaf8adfdfe58ca2f768105c8082b2e449fce252","ae434102edde0958ec4b19d917a6a28e6b72da1834aff0e650f049503a296cf2"],["4e8ceafb9b3e9a136dc7ff67e840295b499dfb3b2133e4ba113f2e4c0e121e5","cf2174118c8b6d7a4b48f6d534ce5c79422c086a63460502b827ce62a326683c"],["d24a44e047e19b6f5afb81c7ca2f69080a5076689a010919f42725c2b789a33b","6fb8d5591b466f8fc63db50f1c0f1c69013f996887b8244d2cdec417afea8fa3"],["ea01606a7a6c9cdd249fdfcfacb99584001edd28abbab77b5104e98e8e3b35d4","322af4908c7312b0cfbfe369f7a7b3cdb7d4494bc2823700cfd652188a3ea98d"],["af8addbf2b661c8a6c6328655eb96651252007d8c5ea31be4ad196de8ce2131f","6749e67c029b85f52a034eafd096836b2520818680e26ac8f3dfbcdb71749700"],["e3ae1974566ca06cc516d47e0fb165a674a3dabcfca15e722f0e3450f45889","2aeabe7e4531510116217f07bf4d07300de97e4874f81f533420a72eeb0bd6a4"],["591ee355313d99721cf6993ffed1e3e301993ff3ed258802075ea8ced397e246","b0ea558a113c30bea60fc4775460c7901ff0b053d25ca2bdeee98f1a4be5d196"],["11396d55fda54c49f19aa97318d8da61fa8584e47b084945077cf03255b52984","998c74a8cd45ac01289d5833a7beb4744ff536b01b257be4c5767bea93ea57a4"],["3c5d2a1ba39c5a1790000738c9e0c40b8dcdfd5468754b6405540157e017aa7a","b2284279995a34e2f9d4de7396fc18b80f9b8b9fdd270f6661f79ca4c81bd257"],["cc8704b8a60a0defa3a99a7299f2e9c3fbc395afb04ac078425ef8a1793cc030","bdd46039feed17881d1e0862db347f8cf395b74fc4bcdc4e940b74e3ac1f1b13"],["c533e4f7ea8555aacd9777ac5cad29b97dd4defccc53ee7ea204119b2889b197","6f0a256bc5efdf429a2fb6242f1a43a2d9b925bb4a4b3a26bb8e0f45eb596096"],["c14f8f2ccb27d6f109f6d08d03cc96a69ba8c34eec07bbcf566d48e33da6593","c359d6923bb398f7fd4473e16fe1c28475b740dd098075e6c0e8649113dc3a38"],["a6cbc3046bc6a450bac24789fa17115a4c9739ed75f8f21ce441f72e0b90e6ef","21ae7f4680e889bb130619e2c0f95a360ceb573c70603139862afd617fa9b9f"],["347d6d9a02c48927ebfb86c1359b1caf130a3c0267d11ce6344b39f99d43cc38","60ea7f61a353524d1c987f6ecec92f086d565ab687870cb12689ff1e31c74448"],["da6545d2181db8d983f7dcb375ef5866d47c67b1bf31c8cf855ef7437b72656a","49b96715ab6878a79e78f07ce5680c5d6673051b4935bd897fea824b77dc208a"],["c40747cc9d012cb1a13b8148309c6de7ec25d6945d657146b9d5994b8feb1111","5ca560753be2a12fc6de6caf2cb489565db936156b9514e1bb5e83037e0fa2d4"],["4e42c8ec82c99798ccf3a610be870e78338c7f713348bd34c8203ef4037f3502","7571d74ee5e0fb92a7a8b33a07783341a5492144cc54bcc40a94473693606437"],["3775ab7089bc6af823aba2e1af70b236d251cadb0c86743287522a1b3b0dedea","be52d107bcfa09d8bcb9736a828cfa7fac8db17bf7a76a2c42ad961409018cf7"],["cee31cbf7e34ec379d94fb814d3d775ad954595d1314ba8846959e3e82f74e26","8fd64a14c06b589c26b947ae2bcf6bfa0149ef0be14ed4d80f448a01c43b1c6d"],["b4f9eaea09b6917619f6ea6a4eb5464efddb58fd45b1ebefcdc1a01d08b47986","39e5c9925b5a54b07433a4f18c61726f8bb131c012ca542eb24a8ac07200682a"],["d4263dfc3d2df923a0179a48966d30ce84e2515afc3dccc1b77907792ebcc60e","62dfaf07a0f78feb30e30d6295853ce189e127760ad6cf7fae164e122a208d54"],["48457524820fa65a4f8d35eb6930857c0032acc0a4a2de422233eeda897612c4","25a748ab367979d98733c38a1fa1c2e7dc6cc07db2d60a9ae7a76aaa49bd0f77"],["dfeeef1881101f2cb11644f3a2afdfc2045e19919152923f367a1767c11cceda","ecfb7056cf1de042f9420bab396793c0c390bde74b4bbdff16a83ae09a9a7517"],["6d7ef6b17543f8373c573f44e1f389835d89bcbc6062ced36c82df83b8fae859","cd450ec335438986dfefa10c57fea9bcc521a0959b2d80bbf74b190dca712d10"],["e75605d59102a5a2684500d3b991f2e3f3c88b93225547035af25af66e04541f","f5c54754a8f71ee540b9b48728473e314f729ac5308b06938360990e2bfad125"],["eb98660f4c4dfaa06a2be453d5020bc99a0c2e60abe388457dd43fefb1ed620c","6cb9a8876d9cb8520609af3add26cd20a0a7cd8a9411131ce85f44100099223e"],["13e87b027d8514d35939f2e6892b19922154596941888336dc3563e3b8dba942","fef5a3c68059a6dec5d624114bf1e91aac2b9da568d6abeb2570d55646b8adf1"],["ee163026e9fd6fe017c38f06a5be6fc125424b371ce2708e7bf4491691e5764a","1acb250f255dd61c43d94ccc670d0f58f49ae3fa15b96623e5430da0ad6c62b2"],["b268f5ef9ad51e4d78de3a750c2dc89b1e626d43505867999932e5db33af3d80","5f310d4b3c99b9ebb19f77d41c1dee018cf0d34fd4191614003e945a1216e423"],["ff07f3118a9df035e9fad85eb6c7bfe42b02f01ca99ceea3bf7ffdba93c4750d","438136d603e858a3a5c440c38eccbaddc1d2942114e2eddd4740d098ced1f0d8"],["8d8b9855c7c052a34146fd20ffb658bea4b9f69e0d825ebec16e8c3ce2b526a1","cdb559eedc2d79f926baf44fb84ea4d44bcf50fee51d7ceb30e2e7f463036758"],["52db0b5384dfbf05bfa9d472d7ae26dfe4b851ceca91b1eba54263180da32b63","c3b997d050ee5d423ebaf66a6db9f57b3180c902875679de924b69d84a7b375"],["e62f9490d3d51da6395efd24e80919cc7d0f29c3f3fa48c6fff543becbd43352","6d89ad7ba4876b0b22c2ca280c682862f342c8591f1daf5170e07bfd9ccafa7d"],["7f30ea2476b399b4957509c88f77d0191afa2ff5cb7b14fd6d8e7d65aaab1193","ca5ef7d4b231c94c3b15389a5f6311e9daff7bb67b103e9880ef4bff637acaec"],["5098ff1e1d9f14fb46a210fada6c903fef0fb7b4a1dd1d9ac60a0361800b7a00","9731141d81fc8f8084d37c6e7542006b3ee1b40d60dfe5362a5b132fd17ddc0"],["32b78c7de9ee512a72895be6b9cbefa6e2f3c4ccce445c96b9f2c81e2778ad58","ee1849f513df71e32efc3896ee28260c73bb80547ae2275ba497237794c8753c"],["e2cb74fddc8e9fbcd076eef2a7c72b0ce37d50f08269dfc074b581550547a4f7","d3aa2ed71c9dd2247a62df062736eb0baddea9e36122d2be8641abcb005cc4a4"],["8438447566d4d7bedadc299496ab357426009a35f235cb141be0d99cd10ae3a8","c4e1020916980a4da5d01ac5e6ad330734ef0d7906631c4f2390426b2edd791f"],["4162d488b89402039b584c6fc6c308870587d9c46f660b878ab65c82c711d67e","67163e903236289f776f22c25fb8a3afc1732f2b84b4e95dbda47ae5a0852649"],["3fad3fa84caf0f34f0f89bfd2dcf54fc175d767aec3e50684f3ba4a4bf5f683d","cd1bc7cb6cc407bb2f0ca647c718a730cf71872e7d0d2a53fa20efcdfe61826"],["674f2600a3007a00568c1a7ce05d0816c1fb84bf1370798f1c69532faeb1a86b","299d21f9413f33b3edf43b257004580b70db57da0b182259e09eecc69e0d38a5"],["d32f4da54ade74abb81b815ad1fb3b263d82d6c692714bcff87d29bd5ee9f08f","f9429e738b8e53b968e99016c059707782e14f4535359d582fc416910b3eea87"],["30e4e670435385556e593657135845d36fbb6931f72b08cb1ed954f1e3ce3ff6","462f9bce619898638499350113bbc9b10a878d35da70740dc695a559eb88db7b"],["be2062003c51cc3004682904330e4dee7f3dcd10b01e580bf1971b04d4cad297","62188bc49d61e5428573d48a74e1c655b1c61090905682a0d5558ed72dccb9bc"],["93144423ace3451ed29e0fb9ac2af211cb6e84a601df5993c419859fff5df04a","7c10dfb164c3425f5c71a3f9d7992038f1065224f72bb9d1d902a6d13037b47c"],["b015f8044f5fcbdcf21ca26d6c34fb8197829205c7b7d2a7cb66418c157b112c","ab8c1e086d04e813744a655b2df8d5f83b3cdc6faa3088c1d3aea1454e3a1d5f"],["d5e9e1da649d97d89e4868117a465a3a4f8a18de57a140d36b3f2af341a21b52","4cb04437f391ed73111a13cc1d4dd0db1693465c2240480d8955e8592f27447a"],["d3ae41047dd7ca065dbf8ed77b992439983005cd72e16d6f996a5316d36966bb","bd1aeb21ad22ebb22a10f0303417c6d964f8cdd7df0aca614b10dc14d125ac46"],["463e2763d885f958fc66cdd22800f0a487197d0a82e377b49f80af87c897b065","bfefacdb0e5d0fd7df3a311a94de062b26b80c61fbc97508b79992671ef7ca7f"],["7985fdfd127c0567c6f53ec1bb63ec3158e597c40bfe747c83cddfc910641917","603c12daf3d9862ef2b25fe1de289aed24ed291e0ec6708703a5bd567f32ed03"],["74a1ad6b5f76e39db2dd249410eac7f99e74c59cb83d2d0ed5ff1543da7703e9","cc6157ef18c9c63cd6193d83631bbea0093e0968942e8c33d5737fd790e0db08"],["30682a50703375f602d416664ba19b7fc9bab42c72747463a71d0896b22f6da3","553e04f6b018b4fa6c8f39e7f311d3176290d0e0f19ca73f17714d9977a22ff8"],["9e2158f0d7c0d5f26c3791efefa79597654e7a2b2464f52b1ee6c1347769ef57","712fcdd1b9053f09003a3481fa7762e9ffd7c8ef35a38509e2fbf2629008373"],["176e26989a43c9cfeba4029c202538c28172e566e3c4fce7322857f3be327d66","ed8cc9d04b29eb877d270b4878dc43c19aefd31f4eee09ee7b47834c1fa4b1c3"],["75d46efea3771e6e68abb89a13ad747ecf1892393dfc4f1b7004788c50374da8","9852390a99507679fd0b86fd2b39a868d7efc22151346e1a3ca4726586a6bed8"],["809a20c67d64900ffb698c4c825f6d5f2310fb0451c869345b7319f645605721","9e994980d9917e22b76b061927fa04143d096ccc54963e6a5ebfa5f3f8e286c1"],["1b38903a43f7f114ed4500b4eac7083fdefece1cf29c63528d563446f972c180","4036edc931a60ae889353f77fd53de4a2708b26b6f5da72ad3394119daf408f9"]]}}},function(e,t,r){"use strict";function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var i=r(2),o=r(312),a=r(13),s=r(74),A=r(71),c=a.assert,u=r(313),f=r(314);function h(e){if(!(this instanceof h))return new h(e);"string"==typeof e&&(c(Object.prototype.hasOwnProperty.call(s,e),"Unknown curve "+e),e=s[e]),e instanceof s.PresetCurve&&(e={curve:e}),this.curve=e.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=e.curve.g,this.g.precompute(e.curve.n.bitLength()+1),this.hash=e.hash||e.curve.hash}e.exports=h,h.prototype.keyPair=function(e){return new u(this,e)},h.prototype.keyFromPrivate=function(e,t){return u.fromPrivate(this,e,t)},h.prototype.keyFromPublic=function(e,t){return u.fromPublic(this,e,t)},h.prototype.genKeyPair=function(e){e||(e={});for(var t=new o({hash:this.hash,pers:e.pers,persEnc:e.persEnc||"utf8",entropy:e.entropy||A(this.hash.hmacStrength),entropyEnc:e.entropy&&e.entropyEnc||"utf8",nonce:this.n.toArray()}),r=this.n.byteLength(),n=this.n.sub(new i(2));;){var a=new i(t.generate(r));if(!(a.cmp(n)>0))return a.iaddn(1),this.keyFromPrivate(a)}},h.prototype._truncateToN=function(e,t){var r=8*e.byteLength()-this.n.bitLength();return r>0&&(e=e.ushrn(r)),!t&&e.cmp(this.n)>=0?e.sub(this.n):e},h.prototype.sign=function(e,t,r,a){"object"===n(r)&&(a=r,r=null),a||(a={}),t=this.keyFromPrivate(t,r),e=this._truncateToN(new i(e,16));for(var s=this.n.byteLength(),A=t.getPrivate().toArray("be",s),c=e.toArray("be",s),u=new o({hash:this.hash,entropy:A,nonce:c,pers:a.pers,persEnc:a.persEnc||"utf8"}),h=this.n.sub(new i(1)),l=0;;l++){var g=a.k?a.k(l):new i(u.generate(this.n.byteLength()));if(!((g=this._truncateToN(g,!0)).cmpn(1)<=0||g.cmp(h)>=0)){var d=this.g.mul(g);if(!d.isInfinity()){var p=d.getX(),I=p.umod(this.n);if(0!==I.cmpn(0)){var y=g.invm(this.n).mul(I.mul(t.getPrivate()).iadd(e));if(0!==(y=y.umod(this.n)).cmpn(0)){var b=(d.getY().isOdd()?1:0)|(0!==p.cmp(I)?2:0);return a.canonical&&y.cmp(this.nh)>0&&(y=this.n.sub(y),b^=1),new f({r:I,s:y,recoveryParam:b})}}}}}},h.prototype.verify=function(e,t,r,n){e=this._truncateToN(new i(e,16)),r=this.keyFromPublic(r,n);var o=(t=new f(t,"hex")).r,a=t.s;if(o.cmpn(1)<0||o.cmp(this.n)>=0)return!1;if(a.cmpn(1)<0||a.cmp(this.n)>=0)return!1;var s,A=a.invm(this.n),c=A.mul(e).umod(this.n),u=A.mul(o).umod(this.n);return this.curve._maxwellTrick?!(s=this.g.jmulAdd(c,r.getPublic(),u)).isInfinity()&&s.eqXToP(o):!(s=this.g.mulAdd(c,r.getPublic(),u)).isInfinity()&&0===s.getX().umod(this.n).cmp(o)},h.prototype.recoverPubKey=function(e,t,r,n){c((3&r)===r,"The recovery param is more than two bits"),t=new f(t,n);var o=this.n,a=new i(e),s=t.r,A=t.s,u=1&r,h=r>>1;if(s.cmp(this.curve.p.umod(this.curve.n))>=0&&h)throw new Error("Unable to find sencond key candinate");s=h?this.curve.pointFromX(s.add(this.curve.n),u):this.curve.pointFromX(s,u);var l=t.r.invm(o),g=o.sub(a).mul(l).umod(o),d=A.mul(l).umod(o);return this.g.mulAdd(g,s,d)},h.prototype.getKeyRecoveryParam=function(e,t,r,n){if(null!==(t=new f(t,n)).recoveryParam)return t.recoveryParam;for(var i=0;i<4;i++){var o;try{o=this.recoverPubKey(e,t,i)}catch(e){continue}if(o.eq(r))return i}throw new Error("Unable to find valid recovery factor")}},function(e,t,r){"use strict";var n=r(7),i=r(151),o=r(12);function a(e){if(!(this instanceof a))return new a(e);this.hash=e.hash,this.predResist=!!e.predResist,this.outLen=this.hash.outSize,this.minEntropy=e.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var t=i.toArray(e.entropy,e.entropyEnc||"hex"),r=i.toArray(e.nonce,e.nonceEnc||"hex"),n=i.toArray(e.pers,e.persEnc||"hex");o(t.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(t,r,n)}e.exports=a,a.prototype._init=function(e,t,r){var n=e.concat(t).concat(r);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var i=0;i<this.V.length;i++)this.K[i]=0,this.V[i]=1;this._update(n),this._reseed=1,this.reseedInterval=281474976710656},a.prototype._hmac=function(){return new n.hmac(this.hash,this.K)},a.prototype._update=function(e){var t=this._hmac().update(this.V).update([0]);e&&(t=t.update(e)),this.K=t.digest(),this.V=this._hmac().update(this.V).digest(),e&&(this.K=this._hmac().update(this.V).update([1]).update(e).digest(),this.V=this._hmac().update(this.V).digest())},a.prototype.reseed=function(e,t,r,n){"string"!=typeof t&&(n=r,r=t,t=null),e=i.toArray(e,t),r=i.toArray(r,n),o(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(e.concat(r||[])),this._reseed=1},a.prototype.generate=function(e,t,r,n){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");"string"!=typeof t&&(n=r,r=t,t=null),r&&(r=i.toArray(r,n||"hex"),this._update(r));for(var o=[];o.length<e;)this.V=this._hmac().update(this.V).digest(),o=o.concat(this.V);var a=o.slice(0,e);return this._update(r),this._reseed++,i.encode(a,t)}},function(e,t,r){"use strict";var n=r(2),i=r(13).assert;function o(e,t){this.ec=e,this.priv=null,this.pub=null,t.priv&&this._importPrivate(t.priv,t.privEnc),t.pub&&this._importPublic(t.pub,t.pubEnc)}e.exports=o,o.fromPublic=function(e,t,r){return t instanceof o?t:new o(e,{pub:t,pubEnc:r})},o.fromPrivate=function(e,t,r){return t instanceof o?t:new o(e,{priv:t,privEnc:r})},o.prototype.validate=function(){var e=this.getPublic();return e.isInfinity()?{result:!1,reason:"Invalid public key"}:e.validate()?e.mul(this.ec.curve.n).isInfinity()?{result:!0,reason:null}:{result:!1,reason:"Public key * N != O"}:{result:!1,reason:"Public key is not a point"}},o.prototype.getPublic=function(e,t){return"string"==typeof e&&(t=e,e=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),t?this.pub.encode(t,e):this.pub},o.prototype.getPrivate=function(e){return"hex"===e?this.priv.toString(16,2):this.priv},o.prototype._importPrivate=function(e,t){this.priv=new n(e,t||16),this.priv=this.priv.umod(this.ec.curve.n)},o.prototype._importPublic=function(e,t){if(e.x||e.y)return"mont"===this.ec.curve.type?i(e.x,"Need x coordinate"):"short"!==this.ec.curve.type&&"edwards"!==this.ec.curve.type||i(e.x&&e.y,"Need both x and y coordinate"),void(this.pub=this.ec.curve.point(e.x,e.y));this.pub=this.ec.curve.decodePoint(e,t)},o.prototype.derive=function(e){return e.validate()||i(e.validate(),"public point not validated"),e.mul(this.priv).getX()},o.prototype.sign=function(e,t,r){return this.ec.sign(e,this,t,r)},o.prototype.verify=function(e,t){return this.ec.verify(e,t,this)},o.prototype.inspect=function(){return"<Key priv: "+(this.priv&&this.priv.toString(16,2))+" pub: "+(this.pub&&this.pub.inspect())+" >"}},function(e,t,r){"use strict";var n=r(2),i=r(13),o=i.assert;function a(e,t){if(e instanceof a)return e;this._importDER(e,t)||(o(e.r&&e.s,"Signature without r or s"),this.r=new n(e.r,16),this.s=new n(e.s,16),void 0===e.recoveryParam?this.recoveryParam=null:this.recoveryParam=e.recoveryParam)}function s(){this.place=0}function A(e,t){var r=e[t.place++];if(!(128&r))return r;var n=15&r;if(0===n||n>4)return!1;for(var i=0,o=0,a=t.place;o<n;o++,a++)i<<=8,i|=e[a],i>>>=0;return!(i<=127)&&(t.place=a,i)}function c(e){for(var t=0,r=e.length-1;!e[t]&&!(128&e[t+1])&&t<r;)t++;return 0===t?e:e.slice(t)}function u(e,t){if(t<128)e.push(t);else{var r=1+(Math.log(t)/Math.LN2>>>3);for(e.push(128|r);--r;)e.push(t>>>(r<<3)&255);e.push(t)}}e.exports=a,a.prototype._importDER=function(e,t){e=i.toArray(e,t);var r=new s;if(48!==e[r.place++])return!1;var o=A(e,r);if(!1===o)return!1;if(o+r.place!==e.length)return!1;if(2!==e[r.place++])return!1;var a=A(e,r);if(!1===a)return!1;var c=e.slice(r.place,a+r.place);if(r.place+=a,2!==e[r.place++])return!1;var u=A(e,r);if(!1===u)return!1;if(e.length!==u+r.place)return!1;var f=e.slice(r.place,u+r.place);if(0===c[0]){if(!(128&c[1]))return!1;c=c.slice(1)}if(0===f[0]){if(!(128&f[1]))return!1;f=f.slice(1)}return this.r=new n(c),this.s=new n(f),this.recoveryParam=null,!0},a.prototype.toDER=function(e){var t=this.r.toArray(),r=this.s.toArray();for(128&t[0]&&(t=[0].concat(t)),128&r[0]&&(r=[0].concat(r)),t=c(t),r=c(r);!(r[0]||128&r[1]);)r=r.slice(1);var n=[2];u(n,t.length),(n=n.concat(t)).push(2),u(n,r.length);var o=n.concat(r),a=[48];return u(a,o.length),a=a.concat(o),i.encode(a,e)}},function(e,t,r){"use strict";var n=r(7),i=r(74),o=r(13),a=o.assert,s=o.parseBytes,A=r(316),c=r(317);function u(e){if(a("ed25519"===e,"only tested with ed25519 so far"),!(this instanceof u))return new u(e);e=i[e].curve,this.curve=e,this.g=e.g,this.g.precompute(e.n.bitLength()+1),this.pointClass=e.point().constructor,this.encodingLength=Math.ceil(e.n.bitLength()/8),this.hash=n.sha512}e.exports=u,u.prototype.sign=function(e,t){e=s(e);var r=this.keyFromSecret(t),n=this.hashInt(r.messagePrefix(),e),i=this.g.mul(n),o=this.encodePoint(i),a=this.hashInt(o,r.pubBytes(),e).mul(r.priv()),A=n.add(a).umod(this.curve.n);return this.makeSignature({R:i,S:A,Rencoded:o})},u.prototype.verify=function(e,t,r){e=s(e),t=this.makeSignature(t);var n=this.keyFromPublic(r),i=this.hashInt(t.Rencoded(),n.pubBytes(),e),o=this.g.mul(t.S());return t.R().add(n.pub().mul(i)).eq(o)},u.prototype.hashInt=function(){for(var e=this.hash(),t=0;t<arguments.length;t++)e.update(arguments[t]);return o.intFromLE(e.digest()).umod(this.curve.n)},u.prototype.keyFromPublic=function(e){return A.fromPublic(this,e)},u.prototype.keyFromSecret=function(e){return A.fromSecret(this,e)},u.prototype.makeSignature=function(e){return e instanceof c?e:new c(this,e)},u.prototype.encodePoint=function(e){var t=e.getY().toArray("le",this.encodingLength);return t[this.encodingLength-1]|=e.getX().isOdd()?128:0,t},u.prototype.decodePoint=function(e){var t=(e=o.parseBytes(e)).length-1,r=e.slice(0,t).concat(-129&e[t]),n=0!=(128&e[t]),i=o.intFromLE(r);return this.curve.pointFromY(i,n)},u.prototype.encodeInt=function(e){return e.toArray("le",this.encodingLength)},u.prototype.decodeInt=function(e){return o.intFromLE(e)},u.prototype.isPoint=function(e){return e instanceof this.pointClass}},function(e,t,r){"use strict";var n=r(13),i=n.assert,o=n.parseBytes,a=n.cachedProperty;function s(e,t){this.eddsa=e,this._secret=o(t.secret),e.isPoint(t.pub)?this._pub=t.pub:this._pubBytes=o(t.pub)}s.fromPublic=function(e,t){return t instanceof s?t:new s(e,{pub:t})},s.fromSecret=function(e,t){return t instanceof s?t:new s(e,{secret:t})},s.prototype.secret=function(){return this._secret},a(s,"pubBytes",(function(){return this.eddsa.encodePoint(this.pub())})),a(s,"pub",(function(){return this._pubBytes?this.eddsa.decodePoint(this._pubBytes):this.eddsa.g.mul(this.priv())})),a(s,"privBytes",(function(){var e=this.eddsa,t=this.hash(),r=e.encodingLength-1,n=t.slice(0,e.encodingLength);return n[0]&=248,n[r]&=127,n[r]|=64,n})),a(s,"priv",(function(){return this.eddsa.decodeInt(this.privBytes())})),a(s,"hash",(function(){return this.eddsa.hash().update(this.secret()).digest()})),a(s,"messagePrefix",(function(){return this.hash().slice(this.eddsa.encodingLength)})),s.prototype.sign=function(e){return i(this._secret,"KeyPair can only verify"),this.eddsa.sign(e,this)},s.prototype.verify=function(e,t){return this.eddsa.verify(e,t,this)},s.prototype.getSecret=function(e){return i(this._secret,"KeyPair is public only"),n.encode(this.secret(),e)},s.prototype.getPublic=function(e){return n.encode(this.pubBytes(),e)},e.exports=s},function(e,t,r){"use strict";function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var i=r(2),o=r(13),a=o.assert,s=o.cachedProperty,A=o.parseBytes;function c(e,t){this.eddsa=e,"object"!==n(t)&&(t=A(t)),Array.isArray(t)&&(t={R:t.slice(0,e.encodingLength),S:t.slice(e.encodingLength)}),a(t.R&&t.S,"Signature without R or S"),e.isPoint(t.R)&&(this._R=t.R),t.S instanceof i&&(this._S=t.S),this._Rencoded=Array.isArray(t.R)?t.R:t.Rencoded,this._Sencoded=Array.isArray(t.S)?t.S:t.Sencoded}s(c,"S",(function(){return this.eddsa.decodeInt(this.Sencoded())})),s(c,"R",(function(){return this.eddsa.decodePoint(this.Rencoded())})),s(c,"Rencoded",(function(){return this.eddsa.encodePoint(this.R())})),s(c,"Sencoded",(function(){return this.eddsa.encodeInt(this.S())})),c.prototype.toBytes=function(){return this.Rencoded().concat(this.Sencoded())},c.prototype.toHex=function(){return o.encode(this.toBytes(),"hex").toUpperCase()},e.exports=c},function(e,t,r){"use strict";var n=r(153);t.certificate=r(324);var i=n.define("RSAPrivateKey",(function(){this.seq().obj(this.key("version").int(),this.key("modulus").int(),this.key("publicExponent").int(),this.key("privateExponent").int(),this.key("prime1").int(),this.key("prime2").int(),this.key("exponent1").int(),this.key("exponent2").int(),this.key("coefficient").int())}));t.RSAPrivateKey=i;var o=n.define("RSAPublicKey",(function(){this.seq().obj(this.key("modulus").int(),this.key("publicExponent").int())}));t.RSAPublicKey=o;var a=n.define("SubjectPublicKeyInfo",(function(){this.seq().obj(this.key("algorithm").use(s),this.key("subjectPublicKey").bitstr())}));t.PublicKey=a;var s=n.define("AlgorithmIdentifier",(function(){this.seq().obj(this.key("algorithm").objid(),this.key("none").null_().optional(),this.key("curve").objid().optional(),this.key("params").seq().obj(this.key("p").int(),this.key("q").int(),this.key("g").int()).optional())})),A=n.define("PrivateKeyInfo",(function(){this.seq().obj(this.key("version").int(),this.key("algorithm").use(s),this.key("subjectPrivateKey").octstr())}));t.PrivateKey=A;var c=n.define("EncryptedPrivateKeyInfo",(function(){this.seq().obj(this.key("algorithm").seq().obj(this.key("id").objid(),this.key("decrypt").seq().obj(this.key("kde").seq().obj(this.key("id").objid(),this.key("kdeparams").seq().obj(this.key("salt").octstr(),this.key("iters").int())),this.key("cipher").seq().obj(this.key("algo").objid(),this.key("iv").octstr()))),this.key("subjectPrivateKey").octstr())}));t.EncryptedPrivateKey=c;var u=n.define("DSAPrivateKey",(function(){this.seq().obj(this.key("version").int(),this.key("p").int(),this.key("q").int(),this.key("g").int(),this.key("pub_key").int(),this.key("priv_key").int())}));t.DSAPrivateKey=u,t.DSAparam=n.define("DSAparam",(function(){this.int()}));var f=n.define("ECPrivateKey",(function(){this.seq().obj(this.key("version").int(),this.key("privateKey").octstr(),this.key("parameters").optional().explicit(0).use(h),this.key("publicKey").optional().explicit(1).bitstr())}));t.ECPrivateKey=f;var h=n.define("ECParameters",(function(){this.choice({namedCurve:this.objid()})}));t.signature=n.define("signature",(function(){this.seq().obj(this.key("r").int(),this.key("s").int())}))},function(e,t,r){"use strict";var n=r(154),i=r(156),o=r(3);function a(e,t){this.name=e,this.body=t,this.decoders={},this.encoders={}}t.define=function(e,t){return new a(e,t)},a.prototype._createNamed=function(e){var t=this.name;function r(e){this._initNamed(e,t)}return o(r,e),r.prototype._initNamed=function(t,r){e.call(this,t,r)},new r(this)},a.prototype._getDecoder=function(e){return e=e||"der",this.decoders.hasOwnProperty(e)||(this.decoders[e]=this._createNamed(i[e])),this.decoders[e]},a.prototype.decode=function(e,t,r){return this._getDecoder(t).decode(e,r)},a.prototype._getEncoder=function(e){return e=e||"der",this.encoders.hasOwnProperty(e)||(this.encoders[e]=this._createNamed(n[e])),this.encoders[e]},a.prototype.encode=function(e,t,r){return this._getEncoder(t).encode(e,r)}},function(e,t,r){"use strict";var n=r(3),i=r(155);function o(e){i.call(this,e),this.enc="pem"}n(o,i),e.exports=o,o.prototype.encode=function(e,t){for(var r=i.prototype.encode.call(this,e).toString("base64"),n=["-----BEGIN "+t.label+"-----"],o=0;o<r.length;o+=64)n.push(r.slice(o,o+64));return n.push("-----END "+t.label+"-----"),n.join("\n")}},function(e,t,r){"use strict";var n=r(3),i=r(75).Buffer,o=r(157);function a(e){o.call(this,e),this.enc="pem"}n(a,o),e.exports=a,a.prototype.decode=function(e,t){for(var r=e.toString().split(/[\r\n]+/g),n=t.label.toUpperCase(),a=/^-----(BEGIN|END) ([^-]+)-----$/,s=-1,A=-1,c=0;c<r.length;c++){var u=r[c].match(a);if(null!==u&&u[2]===n){if(-1!==s){if("END"!==u[1])break;A=c;break}if("BEGIN"!==u[1])break;s=c}}if(-1===s||-1===A)throw new Error("PEM section not found for: "+n);var f=r.slice(s+1,A).join("");f.replace(/[^a-z0-9+/=]+/gi,"");var h=i.from(f,"base64");return o.prototype.decode.call(this,h,t)}},function(e,t,r){"use strict";var n=t;n.Reporter=r(77).Reporter,n.DecoderBuffer=r(35).DecoderBuffer,n.EncoderBuffer=r(35).EncoderBuffer,n.Node=r(76)},function(e,t,r){"use strict";var n=t;n._reverse=function(e){var t={};return Object.keys(e).forEach((function(r){(0|r)==r&&(r|=0);var n=e[r];t[n]=r})),t},n.der=r(78)},function(e,t,r){"use strict";var n=r(153),i=n.define("Time",(function(){this.choice({utcTime:this.utctime(),generalTime:this.gentime()})})),o=n.define("AttributeTypeValue",(function(){this.seq().obj(this.key("type").objid(),this.key("value").any())})),a=n.define("AlgorithmIdentifier",(function(){this.seq().obj(this.key("algorithm").objid(),this.key("parameters").optional(),this.key("curve").objid().optional())})),s=n.define("SubjectPublicKeyInfo",(function(){this.seq().obj(this.key("algorithm").use(a),this.key("subjectPublicKey").bitstr())})),A=n.define("RelativeDistinguishedName",(function(){this.setof(o)})),c=n.define("RDNSequence",(function(){this.seqof(A)})),u=n.define("Name",(function(){this.choice({rdnSequence:this.use(c)})})),f=n.define("Validity",(function(){this.seq().obj(this.key("notBefore").use(i),this.key("notAfter").use(i))})),h=n.define("Extension",(function(){this.seq().obj(this.key("extnID").objid(),this.key("critical").bool().def(!1),this.key("extnValue").octstr())})),l=n.define("TBSCertificate",(function(){this.seq().obj(this.key("version").explicit(0).int().optional(),this.key("serialNumber").int(),this.key("signature").use(a),this.key("issuer").use(u),this.key("validity").use(f),this.key("subject").use(u),this.key("subjectPublicKeyInfo").use(s),this.key("issuerUniqueID").implicit(1).bitstr().optional(),this.key("subjectUniqueID").implicit(2).bitstr().optional(),this.key("extensions").explicit(3).seqof(h).optional())})),g=n.define("X509Certificate",(function(){this.seq().obj(this.key("tbsCertificate").use(l),this.key("signatureAlgorithm").use(a),this.key("signatureValue").bitstr())}));e.exports=g},function(e){e.exports=JSON.parse('{"2.16.840.1.101.3.4.1.1":"aes-128-ecb","2.16.840.1.101.3.4.1.2":"aes-128-cbc","2.16.840.1.101.3.4.1.3":"aes-128-ofb","2.16.840.1.101.3.4.1.4":"aes-128-cfb","2.16.840.1.101.3.4.1.21":"aes-192-ecb","2.16.840.1.101.3.4.1.22":"aes-192-cbc","2.16.840.1.101.3.4.1.23":"aes-192-ofb","2.16.840.1.101.3.4.1.24":"aes-192-cfb","2.16.840.1.101.3.4.1.41":"aes-256-ecb","2.16.840.1.101.3.4.1.42":"aes-256-cbc","2.16.840.1.101.3.4.1.43":"aes-256-ofb","2.16.840.1.101.3.4.1.44":"aes-256-cfb"}')},function(e,t,r){var n=/Proc-Type: 4,ENCRYPTED[\n\r]+DEK-Info: AES-((?:128)|(?:192)|(?:256))-CBC,([0-9A-H]+)[\n\r]+([0-9A-z\n\r+/=]+)[\n\r]+/m,i=/^-----BEGIN ((?:.*? KEY)|CERTIFICATE)-----/m,o=/^-----BEGIN ((?:.*? KEY)|CERTIFICATE)-----([0-9A-z\n\r+/=]+)-----END \1-----$/m,a=r(46),s=r(69),A=r(4).Buffer;e.exports=function(e,t){var r,c=e.toString(),u=c.match(n);if(u){var f="aes"+u[1],h=A.from(u[2],"hex"),l=A.from(u[3].replace(/[\r\n]/g,""),"base64"),g=a(t,h.slice(0,8),parseInt(u[1],10)).key,d=[],p=s.createDecipheriv(f,g,h);d.push(p.update(l)),d.push(p.final()),r=A.concat(d)}else{var I=c.match(o);r=A.from(I[2].replace(/[\r\n]/g,""),"base64")}return{tag:c.match(i)[1],data:r}}},function(e,t,r){var n=r(4).Buffer,i=r(2),o=r(73).ec,a=r(48),s=r(158);function A(e,t){if(e.cmpn(0)<=0)throw new Error("invalid sig");if(e.cmp(t)>=t)throw new Error("invalid sig")}e.exports=function(e,t,r,c,u){var f=a(r);if("ec"===f.type){if("ecdsa"!==c&&"ecdsa/rsa"!==c)throw new Error("wrong public key type");return function(e,t,r){var n=s[r.data.algorithm.curve.join(".")];if(!n)throw new Error("unknown curve "+r.data.algorithm.curve.join("."));var i=new o(n),a=r.data.subjectPrivateKey.data;return i.verify(t,e,a)}(e,t,f)}if("dsa"===f.type){if("dsa"!==c)throw new Error("wrong public key type");return function(e,t,r){var n=r.data.p,o=r.data.q,s=r.data.g,c=r.data.pub_key,u=a.signature.decode(e,"der"),f=u.s,h=u.r;A(f,o),A(h,o);var l=i.mont(n),g=f.invm(o);return 0===s.toRed(l).redPow(new i(t).mul(g).mod(o)).fromRed().mul(c.toRed(l).redPow(h.mul(g).mod(o)).fromRed()).mod(n).mod(o).cmp(h)}(e,t,f)}if("rsa"!==c&&"ecdsa/rsa"!==c)throw new Error("wrong public key type");t=n.concat([u,t]);for(var h=f.modulus.byteLength(),l=[1],g=0;t.length+l.length+2<h;)l.push(255),g++;l.push(0);for(var d=-1;++d<t.length;)l.push(t[d]);l=n.from(l);var p=i.mont(f.modulus);e=(e=new i(e).toRed(p)).redPow(new i(f.publicExponent)),e=n.from(e.fromRed().toArray());var I=g<8?1:0;for(h=Math.min(e.length,l.length),e.length!==l.length&&(I=1),d=-1;++d<h;)I|=e[d]^l[d];return 0===I}},function(e,t,r){var n=r(48),i=r(19),o=r(24),a=r(161),s=r(162),A=r(2),c=r(163),u=r(72),f=r(4).Buffer;e.exports=function(e,t,r){var h;h=e.padding?e.padding:r?1:4;var l,g=n(e);if(4===h)l=function(e,t){var r=e.modulus.byteLength(),n=t.length,c=o("sha1").update(f.alloc(0)).digest(),u=c.length,h=2*u;if(n>r-h-2)throw new Error("message too long");var l=f.alloc(r-n-h-2),g=r-u-1,d=i(u),p=s(f.concat([c,l,f.alloc(1,1),t],g),a(d,g)),I=s(d,a(p,u));return new A(f.concat([f.alloc(1),I,p],r))}(g,t);else if(1===h)l=function(e,t,r){var n,o=t.length,a=e.modulus.byteLength();if(o>a-11)throw new Error("message too long");n=r?f.alloc(a-o-3,255):function(e){var t,r=f.allocUnsafe(e),n=0,o=i(2*e),a=0;for(;n<e;)a===o.length&&(o=i(2*e),a=0),(t=o[a++])&&(r[n++]=t);return r}(a-o-3);return new A(f.concat([f.from([0,r?1:2]),n,f.alloc(1),t],a))}(g,t,r);else{if(3!==h)throw new Error("unknown padding");if((l=new A(t)).cmp(g.modulus)>=0)throw new Error("data too long for modulus")}return r?u(l,g):c(l,g)}},function(e,t,r){var n=r(48),i=r(161),o=r(162),a=r(2),s=r(72),A=r(24),c=r(163),u=r(4).Buffer;e.exports=function(e,t,r){var f;f=e.padding?e.padding:r?1:4;var h,l=n(e),g=l.modulus.byteLength();if(t.length>g||new a(t).cmp(l.modulus)>=0)throw new Error("decryption error");h=r?c(new a(t),l):s(t,l);var d=u.alloc(g-h.length);if(h=u.concat([d,h],g),4===f)return function(e,t){var r=e.modulus.byteLength(),n=A("sha1").update(u.alloc(0)).digest(),a=n.length;if(0!==t[0])throw new Error("decryption error");var s=t.slice(1,a+1),c=t.slice(a+1),f=o(s,i(c,a)),h=o(c,i(f,r-a-1));if(function(e,t){e=u.from(e),t=u.from(t);var r=0,n=e.length;e.length!==t.length&&(r++,n=Math.min(e.length,t.length));var i=-1;for(;++i<n;)r+=e[i]^t[i];return r}(n,h.slice(0,a)))throw new Error("decryption error");var l=a;for(;0===h[l];)l++;if(1!==h[l++])throw new Error("decryption error");return h.slice(l)}(l,h);if(1===f)return function(e,t,r){var n=t.slice(0,2),i=2,o=0;for(;0!==t[i++];)if(i>=t.length){o++;break}var a=t.slice(2,i-1);("0002"!==n.toString("hex")&&!r||"0001"!==n.toString("hex")&&r)&&o++;a.length<8&&o++;if(o)throw new Error("decryption error");return t.slice(i)}(0,h,r);if(3===f)return h;throw new Error("unknown padding")}},function(e,t,r){(function(t){var n=r(62).Transform,i=r(3);function o(e){n.call(this,e),this._destroyed=!1}function a(e,t,r){r(null,e)}function s(e){return function(t,r,n){return"function"==typeof t&&(n=r,r=t,t={}),"function"!=typeof r&&(r=a),"function"!=typeof n&&(n=null),e(t,r,n)}}i(o,n),o.prototype.destroy=function(e){if(!this._destroyed){this._destroyed=!0;var r=this;t.nextTick((function(){e&&r.emit("error",e),r.emit("close")}))}},e.exports=s((function(e,t,r){var n=new o(e);return n._transform=t,r&&(n._flush=r),n})),e.exports.ctor=s((function(e,t,r){function n(t){if(!(this instanceof n))return new n(t);this.options=Object.assign({},e,t),o.call(this,this.options)}return i(n,o),n.prototype._transform=t,r&&(n.prototype._flush=r),n})),e.exports.obj=s((function(e,t,r){var n=new o(Object.assign({objectMode:!0,highWaterMark:16},e));return n._transform=t,r&&(n._flush=r),n}))}).call(this,r(9))},function(e,t){var r={}.toString;e.exports=Array.isArray||function(e){return"[object Array]"==r.call(e)}},function(e,t,r){(function(e){var n=r(36),i=r(21),o=r(22);function a(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function s(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?a(Object(r),!0).forEach((function(t){n(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):a(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var A,c=r(37);c.Platform()===c.PLATFORM_NODE&&(globalThis.Response=r(98).Response,A=r(333));var u=r(97),f=r(100),h=f.ValidatePresence,l=f.ValidateWriteToken,g=f.ValidatePartHash,d=f.ValidateParameters;t.ListFiles=function(){var e=o(i.mark((function e(t){var r,n,o,a;return i.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.libraryId,n=t.objectId,o=t.versionHash,d({libraryId:r,objectId:n,versionHash:o}),o&&(n=this.utils.DecodeVersionHash(o).objectId),a=u("q",o||n,"meta","files"),e.t0=this.utils,e.t1=this.HttpClient,e.next=8,this.authClient.AuthorizationHeader({libraryId:r,objectId:n,versionHash:o});case 8:return e.t2=e.sent,e.t3=a,e.t4={headers:e.t2,method:"GET",path:e.t3},e.t5=e.t1.Request.call(e.t1,e.t4),e.abrupt("return",e.t0.ResponseToJson.call(e.t0,e.t5));case 13:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}(),t.UploadFilesFromS3=function(){var t=o(i.mark((function t(r){var n,o,a,A,c,u,f,h,g,p,I,y,b,E,m,C,v,B,w,Q,k,_,S,D,M,R,x,O,N;return i.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:n=r.libraryId,o=r.objectId,a=r.writeToken,A=r.region,c=r.bucket,u=r.fileInfo,f=r.accessKey,h=r.secret,g=r.signedUrl,p=r.encryption,I=void 0===p?"none":p,y=r.copy,b=void 0!==y&&y,E=r.callback,d({libraryId:n,objectId:o}),l(a),m=/^s3:\/\/([^/]+)\//i,C=0;case 5:if(!(C<u.length)){t.next=18;break}if(v=u[C].source,!(B=m.exec(v))){t.next=15;break}if(B[1]===c){t.next=14;break}throw Error('Full S3 file path "'+v+"\" specified, but does not match provided bucket name '"+c+"'");case 14:u[C].source=v.replace(m,"");case 15:C++,t.next=5;break;case 18:if(this.Log("Uploading files from S3: ".concat(n," ").concat(o," ").concat(a)),"cgck"!==I){t.next=25;break}return t.next=22,this.EncryptionConk({libraryId:n,objectId:o,writeToken:a});case 22:Q=s(s({},Q=t.sent),{},{secret_key:""}),w="kp__".concat(this.utils.B58(e.from(JSON.stringify(Q))));case 25:return k={access_key_id:f,secret_access_key:h},g&&(k={signed_url:g}),_={encryption_key:w,access:{protocol:"s3",platform:"aws",path:c,storage_endpoint:{region:A},cloud_credentials:k}},S=u.map((function(e){return b?{op:"ingest-copy",path:e.path,encryption:{scheme:"cgck"===I?"cgck":"none"},ingest:{type:"key",path:e.source}}:{op:"add-reference",path:e.path,reference:{type:"key",path:e.source}}})),t.next=31,this.CreateFileUploadJob({libraryId:n,objectId:o,writeToken:a,ops:S,defaults:_});case 31:D=t.sent,M=D.id;case 33:return t.next=36,new Promise((function(e){return setTimeout(e,1e3)}));case 36:return t.next=38,this.UploadStatus({libraryId:n,objectId:o,writeToken:a,uploadId:M});case 38:if(!((R=t.sent).errors&&R.errors.length>1)){t.next=43;break}throw R.errors.join("\n");case 43:if(!R.error){t.next=48;break}throw this.Log("S3 file upload failed:\n".concat(JSON.stringify(R,null,2))),R.error;case 48:if("failed"!==R.status.toLowerCase()){t.next=50;break}throw"File upload failed";case 50:if(x=!1,b?(x=R.ingest_copy.done,E&&(O=R.ingest_copy.progress,E({done:x,uploaded:O.bytes.completed,total:O.bytes.total,uploadedFiles:O.files.completed,totalFiles:O.files.total,fileStatus:O.files.details}))):(x=R.add_reference.done,E&&(N=R.add_reference.progress,E({done:x,uploadedFiles:N.completed,totalFiles:N.total}))),!x){t.next=54;break}return t.abrupt("break",56);case 54:t.next=33;break;case 56:case"end":return t.stop()}}),t,this)})));return function(e){return t.apply(this,arguments)}}(),t.UploadFiles=function(){var t=o(i.mark((function t(r){var n,a,c,u,f,h,g,p,I,y,b,E,m,C,v,B,w,Q,k,_,S,D,M,R,x,O,N,P,F=this;return i.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n=r.libraryId,a=r.objectId,c=r.writeToken,u=r.fileInfo,f=r.encryption,h=void 0===f?"none":f,g=r.callback,d({libraryId:n,objectId:a}),l(c),this.Log("Uploading files: ".concat(n," ").concat(a," ").concat(c)),"cgck"!==h){t.next=8;break}return t.next=7,this.EncryptionConk({libraryId:n,objectId:a,writeToken:c});case 7:p=t.sent;case 8:for(I={},y={},b=0;b<u.length;b++)(E=s(s({},u[b]),{},{data:void 0})).path=E.path.replace(/^\/+/,""),"cgck"===h&&(E.encryption={scheme:"cgck"}),y[E.path]=u[b].data,delete E.data,E.type="file",I[E.path]={uploaded:0,total:E.size},u[b]=E;return this.Log(u),g&&g(I),t.next=15,this.CreateFileUploadJob({libraryId:n,objectId:a,writeToken:c,ops:u,encryption:h});case 15:m=t.sent,C=m.id,v=m.jobs,this.Log("Upload ID: ".concat(C)),this.Log(v),104857600,B=[],w=0,Q=0,k=function(){var t=o(i.mark((function t(){var r,o,s,u,f,l;return i.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:r=0;case 1:if(!(r<v.length)){t.next=31;break}case 2:if(!(w-Q>104857600)){t.next=7;break}return t.next=5,new Promise((function(e){return setTimeout(e,500)}));case 5:t.next=2;break;case 7:return o=v[r],t.next=10,F.UploadJobStatus({libraryId:n,objectId:a,writeToken:c,uploadId:C,jobId:o});case 10:s=t.sent,u=0;case 12:if(!(u<s.files.length)){t.next=25;break}if(f=s.files[u],l=void 0,"number"==typeof y[f.path]?(l=e.alloc(f.len),A.readSync(y[f.path],l,0,f.len,f.off)):l=y[f.path].slice(f.off,f.off+f.len),"cgck"!==h){t.next=20;break}return t.next=19,F.Crypto.Encrypt(p,l);case 19:l=t.sent;case 20:s.files[u].data=l,w+=f.len;case 22:u++,t.next=12;break;case 25:return B[r]=s,t.next=28,new Promise((function(e){return setTimeout(e,50)}));case 28:r++,t.next=1;break;case 31:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}(),_=function(){var e=o(i.mark((function e(t,r){var o,A,u,f;return i.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(B[r]){e.next=5;break}return e.next=3,new Promise((function(e){return setTimeout(e,500)}));case 3:e.next=0;break;case 5:o=B[r],A=o.files,u=0;case 8:if(!(u<A.length)){e.next=18;break}return f=A[u],e.next=12,F.UploadFileData({libraryId:n,objectId:a,writeToken:c,uploadId:C,jobId:t,fileData:f.data});case 12:delete B[r].files[u].data,Q+=f.len,g&&(I[f.path]=s(s({},I[f.path]),{},{uploaded:I[f.path].uploaded+f.len}),g(I));case 15:u++,e.next=8;break;case 18:case"end":return e.stop()}}),e)})));return function(t,r){return e.apply(this,arguments)}}(),k(),S=Math.min(3,v.length),D=[],M=0;case 30:if(!(M<S)){t.next=40;break}return R=(new Date).getTime(),t.next=34,_(v[M],M);case 34:x=((new Date).getTime()-R)/1e3,O=B[M].files.map((function(e){return e.len})).reduce((function(e,t){return e+t}),0),D.push(O/x/1048576);case 37:M++,t.next=30;break;case 40:return N=D.reduce((function(e,t){return e+t}),0)/S,P=Math.min(5,Math.ceil(N/2)),t.next=44,this.utils.LimitedMap(P,v,function(){var e=o(i.mark((function e(t,r){return i.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(r<S)){e.next=2;break}return e.abrupt("return");case 2:return e.next=4,_(t,r);case 4:case"end":return e.stop()}}),e)})));return function(t,r){return e.apply(this,arguments)}}());case 44:case"end":return t.stop()}}),t,this)})));return function(e){return t.apply(this,arguments)}}(),t.CreateFileUploadJob=function(){var e=o(i.mark((function e(t){var r,n,o,a,s,A,c,f,h,g;return i.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.libraryId,n=t.objectId,o=t.writeToken,a=t.ops,s=t.defaults,A=void 0===s?{}:s,c=t.encryption,f=void 0===c?"none":c,d({libraryId:r,objectId:n}),l(o),this.Log("Creating file upload job: ".concat(r," ").concat(n," ").concat(o)),this.Log(a),"cgck"===f&&(A.encryption={scheme:"cgck"}),h={seq:0,seq_complete:!0,defaults:A,ops:a},g=u("q",o,"file_jobs"),e.t0=this.utils,e.t1=this.HttpClient,e.next=12,this.authClient.AuthorizationHeader({libraryId:r,objectId:n,update:!0,encryption:f});case 12:return e.t2=e.sent,e.t3=g,e.t4=h,e.t5={headers:e.t2,method:"POST",path:e.t3,body:e.t4,failover:!1},e.t6=e.t1.Request.call(e.t1,e.t5),e.abrupt("return",e.t0.ResponseToJson.call(e.t0,e.t6));case 18:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}(),t.UploadStatus=function(){var e=o(i.mark((function e(t){var r,n,o,a,s;return i.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.libraryId,n=t.objectId,o=t.writeToken,a=t.uploadId,d({libraryId:r,objectId:n}),l(o),s=u("q",o,"file_jobs",a),e.t0=this.utils,e.t1=this.HttpClient,e.next=8,this.authClient.AuthorizationHeader({libraryId:r,objectId:n,update:!0});case 8:return e.t2=e.sent,e.t3=s,e.t4={headers:e.t2,method:"GET",path:e.t3,failover:!1},e.t5=e.t1.Request.call(e.t1,e.t4),e.abrupt("return",e.t0.ResponseToJson.call(e.t0,e.t5));case 13:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}(),t.UploadJobStatus=function(){var e=o(i.mark((function e(t){var r,n,o,a,s,A;return i.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.libraryId,n=t.objectId,o=t.writeToken,a=t.uploadId,s=t.jobId,d({libraryId:r,objectId:n}),l(o),A=u("q",o,"file_jobs",a,"uploads",s),e.t0=this.utils,e.t1=this.HttpClient,e.next=8,this.authClient.AuthorizationHeader({libraryId:r,objectId:n,update:!0});case 8:return e.t2=e.sent,e.t3=A,e.t4={headers:e.t2,method:"GET",path:e.t3,failover:!1},e.t5=e.t1.Request.call(e.t1,e.t4),e.abrupt("return",e.t0.ResponseToJson.call(e.t0,e.t5));case 13:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}(),t.UploadFileData=function(){var e=o(i.mark((function e(t){var r,n,o,a,A,c,f;return i.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.libraryId,n=t.objectId,o=t.writeToken,a=t.uploadId,A=t.jobId,c=t.fileData,d({libraryId:r,objectId:n}),l(o),f=u("q",o,"file_jobs",a,A),e.t0=this.utils,e.t1=this.HttpClient,e.t2=f,e.t3=c,e.t4=s,e.t5={"Content-type":"application/octet-stream"},e.next=12,this.authClient.AuthorizationHeader({libraryId:r,objectId:n,update:!0});case 12:return e.t6=e.sent,e.t7=(0,e.t4)(e.t5,e.t6),e.t8={method:"POST",path:e.t2,body:e.t3,bodyType:"BINARY",headers:e.t7,failover:!1},e.t9=e.t1.Request.call(e.t1,e.t8),e.next=18,e.t0.ResponseToJson.call(e.t0,e.t9);case 18:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}(),t.FinalizeUploadJob=function(){var e=o(i.mark((function e(t){var r,n,o,a;return i.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.libraryId,n=t.objectId,o=t.writeToken,d({libraryId:r,objectId:n}),l(o),this.Log("Finalizing upload job: ".concat(r," ").concat(n," ").concat(o)),a=u("q",o,"files"),e.t0=this.HttpClient,e.t1=a,e.next=9,this.authClient.AuthorizationHeader({libraryId:r,objectId:n,update:!0});case 9:return e.t2=e.sent,e.t3={method:"POST",path:e.t1,bodyType:"BINARY",headers:e.t2,failover:!1},e.next=13,e.t0.Request.call(e.t0,e.t3);case 13:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}(),t.CreateFileDirectories=function(){var e=o(i.mark((function e(t){var r,n,o,a,s;return i.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.libraryId,n=t.objectId,o=t.writeToken,a=t.filePaths,d({libraryId:r,objectId:n}),l(o),this.Log("Creating Directories: ".concat(r," ").concat(n," ").concat(o)),this.Log(a),s=a.map((function(e){return{op:"add",type:"directory",path:e}})),e.next=8,this.CreateFileUploadJob({libraryId:r,objectId:n,writeToken:o,ops:s});case 8:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}(),t.DeleteFiles=function(){var e=o(i.mark((function e(t){var r,n,o,a,s;return i.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.libraryId,n=t.objectId,o=t.writeToken,a=t.filePaths,d({libraryId:r,objectId:n}),l(o),this.Log("Deleting Files: ".concat(r," ").concat(n," ").concat(o)),this.Log(a),s=a.map((function(e){return{op:"del",path:e}})),e.next=8,this.CreateFileUploadJob({libraryId:r,objectId:n,writeToken:o,ops:s});case 8:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}(),t.DownloadFile=function(){var e=o(i.mark((function e(t){var r,n,o,a,A,c,f,l,g,p,I,y,b,E,m,C,v,B,w,Q,k,_=arguments;return i.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.libraryId,n=t.objectId,o=t.versionHash,a=t.writeToken,A=t.filePath,c=t.format,f=void 0===c?"arrayBuffer":c,l=t.chunked,g=void 0!==l&&l,p=t.chunkSize,I=t.clientSideDecryption,y=void 0!==I&&I,b=t.callback,d({libraryId:r,objectId:n,versionHash:o}),h("filePath",A),o&&(n=this.utils.DecodeVersionHash(o).objectId),e.next=6,this.ContentObjectMetadata({libraryId:r,objectId:n,versionHash:o,writeToken:a,metadataSubtree:u("files",A)});case 6:return E=e.sent,m=E&&E["."].encryption&&"cgck"===E["."].encryption.scheme,C=m?"cgck":void 0,v=m&&!y?u("q",a||o||n,"rep","files_download",A):u("q",a||o||n,"files",A),e.next=12,this.authClient.AuthorizationHeader({libraryId:r,objectId:n,versionHash:o,encryption:C});case 12:return(B=e.sent).Accept="*/*",w="eluv.caps.iusr".concat(this.utils.AddressToHash(this.signer.address)),e.next=17,this.ContentObjectMetadata({libraryId:r,objectId:n,metadataSubtree:w});case 17:if(Q=e.sent,e.t1=m,!e.t1){e.next=26;break}return e.t2=this.utils,e.t3=this.signer.address,e.next=24,this.ContentObjectOwner({objectId:n});case 24:e.t4=e.sent,e.t1=!e.t2.EqualAddress.call(e.t2,e.t3,e.t4);case 26:if(e.t0=e.t1,!e.t0){e.next=29;break}e.t0=!Q;case 29:if(!e.t0){e.next=31;break}B["X-Content-Fabric-Decryption-Mode"]="reencrypt";case 31:if(m&&!y&&(B["X-Content-Fabric-Decryption-Mode"]="decrypt",p=Number.MAX_SAFE_INTEGER),k=E["."].size,!m||!y){e.next=51;break}return e.t5=this,e.next=37,this.EncryptionConk({libraryId:r,objectId:n,versionHash:o,download:!0});case 37:return e.t6=e.sent,e.t7=v,e.t8=k,e.t9=B,e.t10=b,e.t11=f,e.t12=y,e.t13=g,e.t14={conk:e.t6,downloadPath:e.t7,bytesTotal:e.t8,headers:e.t9,callback:e.t10,format:e.t11,clientSideDecryption:e.t12,chunked:e.t13},e.next=48,e.t5.DownloadEncrypted.call(e.t5,e.t14);case 48:return e.abrupt("return",e.sent);case 51:return p||(p=1e7),e.prev=52,e.next=55,this.Download({downloadPath:v,bytesTotal:k,headers:B,callback:b,format:f,chunked:g,chunkSize:p});case 55:return e.abrupt("return",e.sent);case 58:if(e.prev=58,e.t15=e.catch(52),!m||y){e.next=62;break}return e.abrupt("return",this.DownloadFile(s(s({},_[0]),{},{clientSideDecryption:!0})));case 62:throw e.t15;case 63:case"end":return e.stop()}}),e,this,[[52,58]])})));return function(t){return e.apply(this,arguments)}}(),t.ContentParts=function(){var e=o(i.mark((function e(t){var r,n,o,a,s;return i.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.libraryId,n=t.objectId,o=t.versionHash,d({libraryId:r,objectId:n,versionHash:o}),this.Log("Retrieving parts: ".concat(r," ").concat(n||o)),o&&(n=this.utils.DecodeVersionHash(o).objectId),a=u("q",o||n,"parts"),e.t0=this.utils,e.t1=this.HttpClient,e.next=9,this.authClient.AuthorizationHeader({libraryId:r,objectId:n,versionHash:o});case 9:return e.t2=e.sent,e.t3=a,e.t4={headers:e.t2,method:"GET",path:e.t3},e.t5=e.t1.Request.call(e.t1,e.t4),e.next=15,e.t0.ResponseToJson.call(e.t0,e.t5);case 15:return s=e.sent,e.abrupt("return",s.parts);case 17:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}(),t.ContentPart=function(){var e=o(i.mark((function e(t){var r,n,o,a,s;return i.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.libraryId,n=t.objectId,o=t.versionHash,a=t.partHash,d({libraryId:r,objectId:n,versionHash:o}),g(a),this.Log("Retrieving part: ".concat(r," ").concat(n||o," ").concat(a)),o&&(n=this.utils.DecodeVersionHash(o).objectId),s=u("q",o||n,"parts",a),e.t0=this.utils,e.t1=this.HttpClient,e.next=10,this.authClient.AuthorizationHeader({libraryId:r,objectId:n,versionHash:o});case 10:return e.t2=e.sent,e.t3=s,e.t4={headers:e.t2,method:"GET",path:e.t3},e.t5=e.t1.Request.call(e.t1,e.t4),e.next=16,e.t0.ResponseToJson.call(e.t0,e.t5);case 16:return e.abrupt("return",e.sent);case 17:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}(),t.DownloadPart=function(){var e=o(i.mark((function e(t){var r,n,o,a,s,A,c,f,h,l,p,I,y,b,E,m,C;return i.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.libraryId,n=t.objectId,o=t.versionHash,a=t.writeToken,s=t.partHash,A=t.format,c=void 0===A?"arrayBuffer":A,f=t.chunked,h=void 0!==f&&f,l=t.chunkSize,p=void 0===l?1e7:l,I=t.callback,d({libraryId:r,objectId:n,versionHash:o}),g(s),o&&(n=this.utils.DecodeVersionHash(o).objectId),y=s.startsWith("hqpe"),b=y?"cgck":void 0,E=u("q",a||o||n,"data",s),e.next=9,this.authClient.AuthorizationHeader({libraryId:r,objectId:n,versionHash:o,encryption:b});case 9:return m=e.sent,e.next=12,this.ContentPart({libraryId:r,objectId:n,versionHash:o,partHash:s});case 12:if(C=e.sent.part.size,!y){e.next=37;break}return e.t0=this.utils,e.t1=this.signer.address,e.next=18,this.ContentObjectOwner({objectId:n});case 18:if(e.t2=e.sent,e.t0.EqualAddress.call(e.t0,e.t1,e.t2)){e.next=21;break}m["X-Content-Fabric-Decryption-Mode"]="reencrypt";case 21:return e.t3=this,e.next=24,this.EncryptionConk({libraryId:r,objectId:n,download:!0});case 24:return e.t4=e.sent,e.t5=E,e.t6=C,e.t7=m,e.t8=I,e.t9=c,e.t10=h,e.t11={conk:e.t4,downloadPath:e.t5,bytesTotal:e.t6,headers:e.t7,callback:e.t8,format:e.t9,chunked:e.t10},e.next=34,e.t3.DownloadEncrypted.call(e.t3,e.t11);case 34:return e.abrupt("return",e.sent);case 37:return e.next=39,this.Download({downloadPath:E,bytesTotal:C,headers:m,callback:I,format:c,chunked:h,chunkSize:p});case 39:return e.abrupt("return",e.sent);case 40:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}(),t.Download=function(){var t=o(i.mark((function t(r){var n,o,a,s,A,c,u,f,h,l,g,d,p,I,y;return i.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n=r.downloadPath,o=r.headers,a=r.bytesTotal,s=r.chunked,A=void 0!==s&&s,c=r.chunkSize,u=void 0===c?2e6:c,f=r.callback,h=r.format,l=void 0===h?"arrayBuffer":h,!A||f){t.next=3;break}throw Error("No callback specified for chunked download");case 3:A||(g=[]),d=0,p=Math.ceil(a/u),I=0;case 7:if(!(I<p)){t.next=35;break}return o.Range="bytes=".concat(d,"-").concat(d+u-1),t.next=11,this.HttpClient.Request({path:n,headers:o,method:"GET"});case 11:if(y=t.sent,d=Math.min(d+u,a),!A){t.next=24;break}return t.t0=f,t.t1=d,t.t2=a,t.next=19,this.utils.ResponseToFormat(l,y);case 19:t.t3=t.sent,t.t4={bytesFinished:t.t1,bytesTotal:t.t2,chunk:t.t3},(0,t.t0)(t.t4),t.next=32;break;case 24:return t.t5=g,t.t6=e,t.next=28,y.arrayBuffer();case 28:t.t7=t.sent,t.t8=t.t6.from.call(t.t6,t.t7),t.t5.push.call(t.t5,t.t8),f&&f({bytesFinished:d,bytesTotal:a});case 32:I++,t.next=7;break;case 35:if(A){t.next=39;break}return t.next=38,this.utils.ResponseToFormat(l,new Response(e.concat(g)));case 38:return t.abrupt("return",t.sent);case 39:case"end":return t.stop()}}),t,this)})));return function(e){return t.apply(this,arguments)}}(),t.DownloadEncrypted=function(){var t=o(i.mark((function t(r){var n,a,s,A,c,u,f,h,l,g,d,p,I,y,b,E,m,C=this;return i.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n=r.conk,a=r.downloadPath,s=r.bytesTotal,A=r.headers,c=r.callback,u=r.format,f=void 0===u?"arrayBuffer":u,h=r.chunked,!(l=void 0!==h&&h)||c){t.next=3;break}throw Error("No callback specified for chunked download");case 3:return g=n.public_key.startsWith("ktpk"),d=this.Crypto.EncryptedBlockSize(1e6,g),p=0,f=f.toLowerCase(),I=[],t.next=10,this.Crypto.OpenDecryptionStream(n);case 10:(y=t.sent).on("data",function(){var e=o(i.mark((function e(t){var r;return i.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!l){e.next=13;break}if("buffer"===f){e.next=10;break}if(r=t.buffer.slice(t.byteOffset,t.byteOffset+t.byteLength),"arraybuffer"!==f){e.next=7;break}t=r,e.next=10;break;case 7:return e.next=9,C.utils.ResponseToFormat(f,new Response(r));case 9:t=e.sent;case 10:c({bytesFinished:p,bytesTotal:s,chunk:t}),e.next=15;break;case 13:c&&c({bytesFinished:p,bytesTotal:s}),I.push(t);case 15:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()),b=Math.ceil(s/d),E=0;case 14:if(!(E<b)){t.next=30;break}return A.Range="bytes=".concat(p,"-").concat(p+d-1),t.next=18,this.HttpClient.Request({headers:A,method:"GET",path:a});case 18:return m=t.sent,p=Math.min(p+d,s),t.t0=y,t.t1=Uint8Array,t.next=24,m.arrayBuffer();case 24:t.t2=t.sent,t.t3=new t.t1(t.t2),t.t0.write.call(t.t0,t.t3);case 27:E++,t.next=14;break;case 30:return y.end(),t.next=33,new Promise((function(e){return y.on("finish",(function(){e()}))}));case 33:if(l){t.next=37;break}return t.next=36,this.utils.ResponseToFormat(f,new Response(e.concat(I)));case 36:return t.abrupt("return",t.sent);case 37:case"end":return t.stop()}}),t,this)})));return function(e){return t.apply(this,arguments)}}(),t.CreatePart=function(){var e=o(i.mark((function e(t){var r,n,o,a,s,A;return i.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.libraryId,n=t.objectId,o=t.writeToken,a=t.encryption,d({libraryId:r,objectId:n}),l(o),s=u("q",o,"parts"),e.t0=this.utils,e.t1=this.HttpClient,e.next=8,this.authClient.AuthorizationHeader({libraryId:r,objectId:n,update:!0,encryption:a});case 8:return e.t2=e.sent,e.t3=s,e.t4={headers:e.t2,method:"POST",path:e.t3,bodyType:"BINARY",body:"",failover:!1},e.t5=e.t1.Request.call(e.t1,e.t4),e.next=14,e.t0.ResponseToJson.call(e.t0,e.t5);case 14:return A=e.sent,e.abrupt("return",A.part.write_token);case 16:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}(),t.UploadPartChunk=function(){var e=o(i.mark((function e(t){var r,n,o,a,s,A,c,f;return i.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.libraryId,n=t.objectId,o=t.writeToken,a=t.partWriteToken,s=t.chunk,A=t.encryption,d({libraryId:r,objectId:n}),l(o),!A||"none"===A){e.next=10;break}return e.next=6,this.EncryptionConk({libraryId:r,objectId:n,writeToken:o});case 6:return c=e.sent,e.next=9,this.Crypto.Encrypt(c,s);case 9:s=e.sent;case 10:return f=u("q",o,"parts"),e.t0=this.utils,e.t1=this.HttpClient,e.next=15,this.authClient.AuthorizationHeader({libraryId:r,objectId:n,update:!0,encryption:A});case 15:return e.t2=e.sent,e.t3=u(f,a),e.t4=s,e.t5={headers:e.t2,method:"POST",path:e.t3,body:e.t4,bodyType:"BINARY",failover:!1},e.t6=e.t1.Request.call(e.t1,e.t5),e.next=22,e.t0.ResponseToJson.call(e.t0,e.t6);case 22:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}(),t.FinalizePart=function(){var e=o(i.mark((function e(t){var r,n,o,a,s,A;return i.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.libraryId,n=t.objectId,o=t.writeToken,a=t.partWriteToken,s=t.encryption,d({libraryId:r,objectId:n}),l(o),A=u("q",o,"parts"),e.t0=this.utils,e.t1=this.HttpClient,e.next=8,this.authClient.AuthorizationHeader({libraryId:r,objectId:n,update:!0,encryption:s});case 8:return e.t2=e.sent,e.t3=u(A,a),e.t4={headers:e.t2,method:"POST",path:e.t3,bodyType:"BINARY",body:"",failover:!1},e.next=13,e.t1.Request.call(e.t1,e.t4);case 13:return e.t5=e.sent,e.next=16,e.t0.ResponseToJson.call(e.t0,e.t5);case 16:return e.abrupt("return",e.sent);case 17:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}(),t.UploadPart=function(){var e=o(i.mark((function e(t){var r,n,o,a,s,A,c,u,f,h,g,p,I;return i.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.libraryId,n=t.objectId,o=t.writeToken,a=t.data,s=t.encryption,A=void 0===s?"none":s,c=t.chunkSize,u=void 0===c?1e7:c,f=t.callback,d({libraryId:r,objectId:n}),l(o),e.next=5,this.CreatePart({libraryId:r,objectId:n,writeToken:o,encryption:A});case 5:h=e.sent,g=a.length||a.byteLength||a.size,f&&f({bytesFinished:0,bytesTotal:g}),p=0;case 9:if(!(p<g)){e.next=17;break}return I=a.slice(p,p+u),e.next=13,this.UploadPartChunk({libraryId:r,objectId:n,writeToken:o,partWriteToken:h,chunk:I,encryption:A});case 13:f&&f({bytesFinished:Math.min(p+u,g),bytesTotal:g});case 14:p+=u,e.next=9;break;case 17:return e.next=19,this.FinalizePart({libraryId:r,objectId:n,writeToken:o,partWriteToken:h,encryption:A});case 19:return e.abrupt("return",e.sent);case 20:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}(),t.DeletePart=function(){var e=o(i.mark((function e(t){var r,n,o,a,s;return i.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.libraryId,n=t.objectId,o=t.writeToken,a=t.partHash,d({libraryId:r,objectId:n}),l(o),g(a),s=u("q",o,"parts",a),e.t0=this.HttpClient,e.next=8,this.authClient.AuthorizationHeader({libraryId:r,objectId:n,update:!0});case 8:return e.t1=e.sent,e.t2=s,e.t3={headers:e.t1,method:"DELETE",path:e.t2,failover:!1},e.next=13,e.t0.Request.call(e.t0,e.t3);case 13:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()}).call(this,r(6).Buffer)},function(e,t){},function(e,t,r){"use strict";r.r(t),r.d(t,"ethers",(function(){return A})),r.d(t,"Signer",(function(){return On})),r.d(t,"Wallet",(function(){return rs})),r.d(t,"VoidSigner",(function(){return Nn})),r.d(t,"getDefaultProvider",(function(){return yh})),r.d(t,"providers",(function(){return o})),r.d(t,"BaseContract",(function(){return Ni})),r.d(t,"Contract",(function(){return Pi})),r.d(t,"ContractFactory",(function(){return Fi})),r.d(t,"BigNumber",(function(){return y})),r.d(t,"FixedNumber",(function(){return Xi})),r.d(t,"constants",(function(){return i})),r.d(t,"errors",(function(){return h.a})),r.d(t,"logger",(function(){return Sd})),r.d(t,"utils",(function(){return s})),r.d(t,"wordlists",(function(){return Yo})),r.d(t,"version",(function(){return _d})),r.d(t,"Wordlist",(function(){return Oo}));var n={};r.r(n),r.d(n,"encode",(function(){return Z})),r.d(n,"decode",(function(){return $}));var i={};r.r(i),r.d(i,"AddressZero",(function(){return os})),r.d(i,"NegativeOne",(function(){return Dt})),r.d(i,"Zero",(function(){return Mt})),r.d(i,"One",(function(){return Rt})),r.d(i,"Two",(function(){return xt})),r.d(i,"WeiPerEther",(function(){return Ot})),r.d(i,"MaxUint256",(function(){return Nt})),r.d(i,"MinInt256",(function(){return Pt})),r.d(i,"MaxInt256",(function(){return Ft})),r.d(i,"HashZero",(function(){return as})),r.d(i,"EtherSymbol",(function(){return ss}));var o={};r.r(o),r.d(o,"Provider",(function(){return En})),r.d(o,"BaseProvider",(function(){return qA})),r.d(o,"Resolver",(function(){return GA})),r.d(o,"UrlJsonRpcProvider",(function(){return zc})),r.d(o,"FallbackProvider",(function(){return yf})),r.d(o,"AlchemyProvider",(function(){return Au})),r.d(o,"AlchemyWebSocketProvider",(function(){return su})),r.d(o,"AnkrProvider",(function(){return bu})),r.d(o,"CloudflareProvider",(function(){return Mu})),r.d(o,"EtherscanProvider",(function(){return zu})),r.d(o,"InfuraProvider",(function(){return xf})),r.d(o,"InfuraWebSocketProvider",(function(){return Rf})),r.d(o,"JsonRpcProvider",(function(){return Ic})),r.d(o,"JsonRpcBatchProvider",(function(){return Lf})),r.d(o,"NodesmithProvider",(function(){return Zf})),r.d(o,"PocketProvider",(function(){return oh})),r.d(o,"StaticJsonRpcProvider",(function(){return Jc})),r.d(o,"Web3Provider",(function(){return ph})),r.d(o,"WebSocketProvider",(function(){return Rc})),r.d(o,"IpcProvider",(function(){return bf})),r.d(o,"JsonRpcSigner",(function(){return gc})),r.d(o,"getDefaultProvider",(function(){return yh})),r.d(o,"getNetwork",(function(){return ds})),r.d(o,"isCommunityResource",(function(){return fA})),r.d(o,"isCommunityResourcable",(function(){return uA})),r.d(o,"showThrottleMessage",(function(){return lA})),r.d(o,"Formatter",(function(){return cA}));var a={};r.r(a),r.d(a,"decode",(function(){return ps})),r.d(a,"encode",(function(){return Is}));var s={};r.r(s),r.d(s,"AbiCoder",(function(){return Pg})),r.d(s,"defaultAbiCoder",(function(){return Fg})),r.d(s,"Fragment",(function(){return bg})),r.d(s,"ConstructorFragment",(function(){return Bg})),r.d(s,"ErrorFragment",(function(){return kg})),r.d(s,"EventFragment",(function(){return Eg})),r.d(s,"FunctionFragment",(function(){return wg})),r.d(s,"ParamType",(function(){return Ig})),r.d(s,"FormatTypes",(function(){return dg})),r.d(s,"checkResultErrors",(function(){return vh})),r.d(s,"Logger",(function(){return h.b})),r.d(s,"RLP",(function(){return n})),r.d(s,"_fetchData",(function(){return rA})),r.d(s,"fetchJson",(function(){return nA})),r.d(s,"poll",(function(){return iA})),r.d(s,"checkProperties",(function(){return M})),r.d(s,"deepCopy",(function(){return N})),r.d(s,"defineReadOnly",(function(){return _})),r.d(s,"getStatic",(function(){return S})),r.d(s,"resolveProperties",(function(){return D})),r.d(s,"shallowCopy",(function(){return R})),r.d(s,"arrayify",(function(){return c.a})),r.d(s,"concat",(function(){return c.b})),r.d(s,"stripZeros",(function(){return c.o})),r.d(s,"zeroPad",(function(){return c.p})),r.d(s,"isBytes",(function(){return c.j})),r.d(s,"isBytesLike",(function(){return c.k})),r.d(s,"defaultPath",(function(){return ea})),r.d(s,"HDNode",(function(){return ta})),r.d(s,"SigningKey",(function(){return Ln})),r.d(s,"Interface",(function(){return ed})),r.d(s,"LogDescription",(function(){return zg})),r.d(s,"TransactionDescription",(function(){return Vg})),r.d(s,"base58",(function(){return vo})),r.d(s,"base64",(function(){return a})),r.d(s,"hexlify",(function(){return c.i})),r.d(s,"isHexString",(function(){return c.l})),r.d(s,"hexConcat",(function(){return c.c})),r.d(s,"hexStripZeros",(function(){return c.f})),r.d(s,"hexValue",(function(){return c.g})),r.d(s,"hexZeroPad",(function(){return c.h})),r.d(s,"hexDataLength",(function(){return c.d})),r.d(s,"hexDataSlice",(function(){return c.e})),r.d(s,"nameprep",(function(){return yd})),r.d(s,"_toEscapedUtf8String",(function(){return me})),r.d(s,"toUtf8Bytes",(function(){return be})),r.d(s,"toUtf8CodePoints",(function(){return Be})),r.d(s,"toUtf8String",(function(){return ve})),r.d(s,"Utf8ErrorFuncs",(function(){return Ie})),r.d(s,"formatBytes32String",(function(){return bd})),r.d(s,"parseBytes32String",(function(){return Ed})),r.d(s,"dnsEncode",(function(){return zs})),r.d(s,"hashMessage",(function(){return to})),r.d(s,"namehash",(function(){return Js})),r.d(s,"isValidName",(function(){return qs})),r.d(s,"id",(function(){return we})),r.d(s,"_TypedDataEncoder",(function(){return bo})),r.d(s,"getAddress",(function(){return Ae})),r.d(s,"getIcapAddress",(function(){return ue})),r.d(s,"getContractAddress",(function(){return fe})),r.d(s,"getCreate2Address",(function(){return he})),r.d(s,"isAddress",(function(){return ce})),r.d(s,"formatEther",(function(){return Qd})),r.d(s,"parseEther",(function(){return kd})),r.d(s,"formatUnits",(function(){return Bd})),r.d(s,"parseUnits",(function(){return wd})),r.d(s,"commify",(function(){return vd})),r.d(s,"computeHmac",(function(){return Do})),r.d(s,"keccak256",(function(){return q})),r.d(s,"ripemd160",(function(){return ko})),r.d(s,"sha256",(function(){return _o})),r.d(s,"sha512",(function(){return So})),r.d(s,"randomBytes",(function(){return sa.a})),r.d(s,"shuffled",(function(){return Vu})),r.d(s,"solidityPack",(function(){return od})),r.d(s,"solidityKeccak256",(function(){return ad})),r.d(s,"soliditySha256",(function(){return sd})),r.d(s,"splitSignature",(function(){return c.n})),r.d(s,"joinSignature",(function(){return c.m})),r.d(s,"accessListify",(function(){return ei})),r.d(s,"parseTransaction",(function(){return ai})),r.d(s,"serializeTransaction",(function(){return ii})),r.d(s,"TransactionTypes",(function(){return Yn})),r.d(s,"getJsonWalletAddress",(function(){return Ya})),r.d(s,"computeAddress",(function(){return Zn})),r.d(s,"recoverAddress",(function(){return Wn})),r.d(s,"computePublicKey",(function(){return Gn})),r.d(s,"recoverPublicKey",(function(){return Hn})),r.d(s,"verifyMessage",(function(){return ns})),r.d(s,"verifyTypedData",(function(){return is})),r.d(s,"getAccountPath",(function(){return aa})),r.d(s,"mnemonicToEntropy",(function(){return na})),r.d(s,"entropyToMnemonic",(function(){return ia})),r.d(s,"isValidMnemonic",(function(){return oa})),r.d(s,"mnemonicToSeed",(function(){return ra})),r.d(s,"SupportedAlgorithm",(function(){return mo})),r.d(s,"UnicodeNormalizationForm",(function(){return le})),r.d(s,"Utf8ErrorReason",(function(){return ge})),r.d(s,"Indexed",(function(){return Wg}));var A={};r.r(A),r.d(A,"Signer",(function(){return On})),r.d(A,"Wallet",(function(){return rs})),r.d(A,"VoidSigner",(function(){return Nn})),r.d(A,"getDefaultProvider",(function(){return yh})),r.d(A,"providers",(function(){return o})),r.d(A,"BaseContract",(function(){return Ni})),r.d(A,"Contract",(function(){return Pi})),r.d(A,"ContractFactory",(function(){return Fi})),r.d(A,"BigNumber",(function(){return y})),r.d(A,"FixedNumber",(function(){return Xi})),r.d(A,"constants",(function(){return i})),r.d(A,"errors",(function(){return h.a})),r.d(A,"logger",(function(){return Sd})),r.d(A,"utils",(function(){return s})),r.d(A,"wordlists",(function(){return Yo})),r.d(A,"version",(function(){return _d})),r.d(A,"Wordlist",(function(){return Oo}));var c=r(0),u=r(2),f=r.n(u),h=r(1);function l(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}var g=f.a.BN,d=new h.b("bignumber/5.7.0"),p={};var I=!1,y=function(){function e(t,r){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),t!==p&&d.throwError("cannot call constructor directly; use BigNumber.from",h.b.errors.UNSUPPORTED_OPERATION,{operation:"new (BigNumber)"}),this._hex=r,this._isBigNumber=!0,Object.freeze(this)}var t,r,n;return t=e,n=[{key:"from",value:function(t){if(t instanceof e)return t;if("string"==typeof t)return t.match(/^-?0x[0-9a-f]+$/i)?new e(p,b(t)):t.match(/^-?[0-9]+$/)?new e(p,b(new g(t))):d.throwArgumentError("invalid BigNumber string","value",t);if("number"==typeof t)return t%1&&C("underflow","BigNumber.from",t),(t>=9007199254740991||t<=-9007199254740991)&&C("overflow","BigNumber.from",t),e.from(String(t));var r=t;if("bigint"==typeof r)return e.from(r.toString());if(Object(c.j)(r))return e.from(Object(c.i)(r));if(r)if(r.toHexString){var n=r.toHexString();if("string"==typeof n)return e.from(n)}else{var i=r._hex;if(null==i&&"BigNumber"===r.type&&(i=r.hex),"string"==typeof i&&(Object(c.l)(i)||"-"===i[0]&&Object(c.l)(i.substring(1))))return e.from(i)}return d.throwArgumentError("invalid BigNumber value","value",t)}},{key:"isBigNumber",value:function(e){return!(!e||!e._isBigNumber)}}],(r=[{key:"fromTwos",value:function(e){return E(m(this).fromTwos(e))}},{key:"toTwos",value:function(e){return E(m(this).toTwos(e))}},{key:"abs",value:function(){return"-"===this._hex[0]?e.from(this._hex.substring(1)):this}},{key:"add",value:function(e){return E(m(this).add(m(e)))}},{key:"sub",value:function(e){return E(m(this).sub(m(e)))}},{key:"div",value:function(t){return e.from(t).isZero()&&C("division-by-zero","div"),E(m(this).div(m(t)))}},{key:"mul",value:function(e){return E(m(this).mul(m(e)))}},{key:"mod",value:function(e){var t=m(e);return t.isNeg()&&C("division-by-zero","mod"),E(m(this).umod(t))}},{key:"pow",value:function(e){var t=m(e);return t.isNeg()&&C("negative-power","pow"),E(m(this).pow(t))}},{key:"and",value:function(e){var t=m(e);return(this.isNegative()||t.isNeg())&&C("unbound-bitwise-result","and"),E(m(this).and(t))}},{key:"or",value:function(e){var t=m(e);return(this.isNegative()||t.isNeg())&&C("unbound-bitwise-result","or"),E(m(this).or(t))}},{key:"xor",value:function(e){var t=m(e);return(this.isNegative()||t.isNeg())&&C("unbound-bitwise-result","xor"),E(m(this).xor(t))}},{key:"mask",value:function(e){return(this.isNegative()||e<0)&&C("negative-width","mask"),E(m(this).maskn(e))}},{key:"shl",value:function(e){return(this.isNegative()||e<0)&&C("negative-width","shl"),E(m(this).shln(e))}},{key:"shr",value:function(e){return(this.isNegative()||e<0)&&C("negative-width","shr"),E(m(this).shrn(e))}},{key:"eq",value:function(e){return m(this).eq(m(e))}},{key:"lt",value:function(e){return m(this).lt(m(e))}},{key:"lte",value:function(e){return m(this).lte(m(e))}},{key:"gt",value:function(e){return m(this).gt(m(e))}},{key:"gte",value:function(e){return m(this).gte(m(e))}},{key:"isNegative",value:function(){return"-"===this._hex[0]}},{key:"isZero",value:function(){return m(this).isZero()}},{key:"toNumber",value:function(){try{return m(this).toNumber()}catch(e){C("overflow","toNumber",this.toString())}return null}},{key:"toBigInt",value:function(){try{return BigInt(this.toString())}catch(e){}return d.throwError("this platform does not support BigInt",h.b.errors.UNSUPPORTED_OPERATION,{value:this.toString()})}},{key:"toString",value:function(){return arguments.length>0&&(10===arguments[0]?I||(I=!0,d.warn("BigNumber.toString does not accept any parameters; base-10 is assumed")):16===arguments[0]?d.throwError("BigNumber.toString does not accept any parameters; use bigNumber.toHexString()",h.b.errors.UNEXPECTED_ARGUMENT,{}):d.throwError("BigNumber.toString does not accept parameters",h.b.errors.UNEXPECTED_ARGUMENT,{})),m(this).toString(10)}},{key:"toHexString",value:function(){return this._hex}},{key:"toJSON",value:function(e){return{type:"BigNumber",hex:this.toHexString()}}}])&&l(t.prototype,r),n&&l(t,n),Object.defineProperty(t,"prototype",{writable:!1}),e}();function b(e){if("string"!=typeof e)return b(e.toString(16));if("-"===e[0])return"-"===(e=e.substring(1))[0]&&d.throwArgumentError("invalid hex","value",e),"0x00"===(e=b(e))?e:"-"+e;if("0x"!==e.substring(0,2)&&(e="0x"+e),"0x"===e)return"0x00";for(e.length%2&&(e="0x0"+e.substring(2));e.length>4&&"0x00"===e.substring(0,4);)e="0x"+e.substring(4);return e}function E(e){return y.from(b(e))}function m(e){var t=y.from(e).toHexString();return"-"===t[0]?new g("-"+t.substring(3),16):new g(t.substring(2),16)}function C(e,t,r){var n={fault:e,operation:t};return null!=r&&(n.value=r),d.throwError(e,h.b.errors.NUMERIC_FAULT,n)}function v(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function B(e,t,r){return t&&v(e.prototype,t),r&&v(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function w(e){return(w="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var Q=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{A(n.next(e))}catch(e){o(e)}}function s(e){try{A(n.throw(e))}catch(e){o(e)}}function A(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}A((n=n.apply(e,t||[])).next())}))},k=new h.b("properties/5.7.0");function _(e,t,r){Object.defineProperty(e,t,{enumerable:!0,value:r,writable:!1})}function S(e,t){for(var r=0;r<32;r++){if(e[t])return e[t];if(!e.prototype||"object"!==w(e.prototype))break;e=Object.getPrototypeOf(e.prototype).constructor}return null}function D(e){return Q(this,void 0,void 0,regeneratorRuntime.mark((function t(){var r,n;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=Object.keys(e).map((function(t){var r=e[t];return Promise.resolve(r).then((function(e){return{key:t,value:e}}))})),t.next=3,Promise.all(r);case 3:return n=t.sent,t.abrupt("return",n.reduce((function(e,t){return e[t.key]=t.value,e}),{}));case 5:case"end":return t.stop()}}),t)})))}function M(e,t){e&&"object"===w(e)||k.throwArgumentError("invalid object","object",e),Object.keys(e).forEach((function(r){t[r]||k.throwArgumentError("invalid object key - "+r,"transaction:"+r,e)}))}function R(e){var t={};for(var r in e)t[r]=e[r];return t}var x={bigint:!0,boolean:!0,function:!0,number:!0,string:!0};function O(e){if(function e(t){if(null==t||x[w(t)])return!0;if(Array.isArray(t)||"object"===w(t)){if(!Object.isFrozen(t))return!1;for(var r=Object.keys(t),n=0;n<r.length;n++){var i=null;try{i=t[r[n]]}catch(e){continue}if(!e(i))return!1}return!0}return k.throwArgumentError("Cannot deepCopy ".concat(w(t)),"object",t)}(e))return e;if(Array.isArray(e))return Object.freeze(e.map((function(e){return N(e)})));if("object"===w(e)){var t={};for(var r in e){var n=e[r];void 0!==n&&_(t,r,N(n))}return t}return k.throwArgumentError("Cannot deepCopy ".concat(w(e)),"object",e)}function N(e){return O(e)}var P=B((function e(t){for(var r in function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),t)this[r]=N(t[r])}));function F(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function j(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function T(e,t,r){return t&&j(e.prototype,t),r&&j(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}var U=new h.b("abi/5.7.0");var L=function(){function e(t,r,n,i){F(this,e),this.name=t,this.type=r,this.localName=n,this.dynamic=i}return T(e,[{key:"_throwError",value:function(e,t){U.throwArgumentError(e,this.localName,t)}}]),e}(),H=function(){function e(t){F(this,e),_(this,"wordSize",t||32),this._data=[],this._dataLength=0,this._padding=new Uint8Array(t)}return T(e,[{key:"data",get:function(){return Object(c.c)(this._data)}},{key:"length",get:function(){return this._dataLength}},{key:"_writeData",value:function(e){return this._data.push(e),this._dataLength+=e.length,e.length}},{key:"appendWriter",value:function(e){return this._writeData(Object(c.b)(e._data))}},{key:"writeBytes",value:function(e){var t=Object(c.a)(e),r=t.length%this.wordSize;return r&&(t=Object(c.b)([t,this._padding.slice(r)])),this._writeData(t)}},{key:"_getValue",value:function(e){var t=Object(c.a)(y.from(e));return t.length>this.wordSize&&U.throwError("value out-of-bounds",h.b.errors.BUFFER_OVERRUN,{length:this.wordSize,offset:t.length}),t.length%this.wordSize&&(t=Object(c.b)([this._padding.slice(t.length%this.wordSize),t])),t}},{key:"writeValue",value:function(e){return this._writeData(this._getValue(e))}},{key:"writeUpdatableValue",value:function(){var e=this,t=this._data.length;return this._data.push(this._padding),this._dataLength+=this.wordSize,function(r){e._data[t]=e._getValue(r)}}}]),e}(),G=function(){function e(t,r,n,i){F(this,e),_(this,"_data",Object(c.a)(t)),_(this,"wordSize",r||32),_(this,"_coerceFunc",n),_(this,"allowLoose",i),this._offset=0}return T(e,[{key:"data",get:function(){return Object(c.i)(this._data)}},{key:"consumed",get:function(){return this._offset}},{key:"coerce",value:function(t,r){return this._coerceFunc?this._coerceFunc(t,r):e.coerce(t,r)}},{key:"_peekBytes",value:function(e,t,r){var n=Math.ceil(t/this.wordSize)*this.wordSize;return this._offset+n>this._data.length&&(this.allowLoose&&r&&this._offset+t<=this._data.length?n=t:U.throwError("data out-of-bounds",h.b.errors.BUFFER_OVERRUN,{length:this._data.length,offset:this._offset+n})),this._data.slice(this._offset,this._offset+n)}},{key:"subReader",value:function(t){return new e(this._data.slice(this._offset+t),this.wordSize,this._coerceFunc,this.allowLoose)}},{key:"readBytes",value:function(e,t){var r=this._peekBytes(0,e,!!t);return this._offset+=r.length,r.slice(0,e)}},{key:"readValue",value:function(){return y.from(this.readBytes(this.wordSize))}}],[{key:"coerce",value:function(e,t){var r=e.match("^u?int([0-9]+)$");return r&&parseInt(r[1])<=48&&(t=t.toNumber()),t}}]),e}(),Y=r(167),K=r.n(Y);function q(e){return"0x"+K.a.keccak_256(Object(c.a)(e))}var J=new h.b("rlp/5.7.0");function z(e){for(var t=[];e;)t.unshift(255&e),e>>=8;return t}function V(e,t,r){for(var n=0,i=0;i<r;i++)n=256*n+e[t+i];return n}function Z(e){return Object(c.i)(function e(t){if(Array.isArray(t)){var r=[];if(t.forEach((function(t){r=r.concat(e(t))})),r.length<=55)return r.unshift(192+r.length),r;var n=z(r.length);return n.unshift(247+n.length),n.concat(r)}Object(c.k)(t)||J.throwArgumentError("RLP object must be BytesLike","object",t);var i=Array.prototype.slice.call(Object(c.a)(t));if(1===i.length&&i[0]<=127)return i;if(i.length<=55)return i.unshift(128+i.length),i;var o=z(i.length);return o.unshift(183+o.length),o.concat(i)}(e))}function W(e,t,r,n){for(var i=[];r<t+1+n;){var o=X(e,r);i.push(o.result),(r+=o.consumed)>t+1+n&&J.throwError("child data too short",h.b.errors.BUFFER_OVERRUN,{})}return{consumed:1+n,result:i}}function X(e,t){if(0===e.length&&J.throwError("data too short",h.b.errors.BUFFER_OVERRUN,{}),e[t]>=248){var r=e[t]-247;t+1+r>e.length&&J.throwError("data short segment too short",h.b.errors.BUFFER_OVERRUN,{});var n=V(e,t+1,r);return t+1+r+n>e.length&&J.throwError("data long segment too short",h.b.errors.BUFFER_OVERRUN,{}),W(e,t,t+1+r,r+n)}if(e[t]>=192){var i=e[t]-192;return t+1+i>e.length&&J.throwError("data array too short",h.b.errors.BUFFER_OVERRUN,{}),W(e,t,t+1,i)}if(e[t]>=184){var o=e[t]-183;t+1+o>e.length&&J.throwError("data array too short",h.b.errors.BUFFER_OVERRUN,{});var a=V(e,t+1,o);return t+1+o+a>e.length&&J.throwError("data array too short",h.b.errors.BUFFER_OVERRUN,{}),{consumed:1+o+a,result:Object(c.i)(e.slice(t+1+o,t+1+o+a))}}if(e[t]>=128){var s=e[t]-128;return t+1+s>e.length&&J.throwError("data too short",h.b.errors.BUFFER_OVERRUN,{}),{consumed:1+s,result:Object(c.i)(e.slice(t+1,t+1+s))}}return{consumed:1,result:Object(c.i)(e[t])}}function $(e){var t=Object(c.a)(e),r=X(t,0);return r.consumed!==t.length&&J.throwArgumentError("invalid rlp data","data",e),r.result}var ee=new h.b("address/5.7.0");function te(e){Object(c.l)(e,20)||ee.throwArgumentError("invalid address","address",e);for(var t=(e=e.toLowerCase()).substring(2).split(""),r=new Uint8Array(40),n=0;n<40;n++)r[n]=t[n].charCodeAt(0);for(var i=Object(c.a)(q(r)),o=0;o<40;o+=2)i[o>>1]>>4>=8&&(t[o]=t[o].toUpperCase()),(15&i[o>>1])>=8&&(t[o+1]=t[o+1].toUpperCase());return"0x"+t.join("")}for(var re={},ne=0;ne<10;ne++)re[String(ne)]=String(ne);for(var ie=0;ie<26;ie++)re[String.fromCharCode(65+ie)]=String(10+ie);var oe,ae=Math.floor((oe=9007199254740991,Math.log10?Math.log10(oe):Math.log(oe)/Math.LN10));function se(e){for(var t=(e=(e=e.toUpperCase()).substring(4)+e.substring(0,2)+"00").split("").map((function(e){return re[e]})).join("");t.length>=ae;){var r=t.substring(0,ae);t=parseInt(r,10)%97+t.substring(r.length)}for(var n=String(98-parseInt(t,10)%97);n.length<2;)n="0"+n;return n}function Ae(e){var t,r=null;if("string"!=typeof e&&ee.throwArgumentError("invalid address","address",e),e.match(/^(0x)?[0-9a-fA-F]{40}$/))"0x"!==e.substring(0,2)&&(e="0x"+e),r=te(e),e.match(/([A-F].*[a-f])|([a-f].*[A-F])/)&&r!==e&&ee.throwArgumentError("bad address checksum","address",e);else if(e.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)){for(e.substring(2,4)!==se(e)&&ee.throwArgumentError("bad icap checksum","address",e),t=e.substring(4),r=new g(t,36).toString(16);r.length<40;)r="0"+r;r=te("0x"+r)}else ee.throwArgumentError("invalid address","address",e);return r}function ce(e){try{return Ae(e),!0}catch(e){}return!1}function ue(e){for(var t,r=(t=Ae(e).substring(2),new g(t,16).toString(36)).toUpperCase();r.length<30;)r="0"+r;return"XE"+se("XE00"+r)+r}function fe(e){var t=null;try{t=Ae(e.from)}catch(t){ee.throwArgumentError("missing from address","transaction",e)}var r=Object(c.o)(Object(c.a)(y.from(e.nonce).toHexString()));return Ae(Object(c.e)(q(Z([t,r])),12))}function he(e,t,r){return 32!==Object(c.d)(t)&&ee.throwArgumentError("salt must be 32 bytes","salt",t),32!==Object(c.d)(r)&&ee.throwArgumentError("initCodeHash must be 32 bytes","initCodeHash",r),Ae(Object(c.e)(q(Object(c.b)(["0xff",Ae(e),t,r])),12))}var le,ge,de=new h.b("strings/5.7.0");function pe(e,t,r,n,i){if(e===ge.BAD_PREFIX||e===ge.UNEXPECTED_CONTINUE){for(var o=0,a=t+1;a<r.length&&r[a]>>6==2;a++)o++;return o}return e===ge.OVERRUN?r.length-t-1:0}!function(e){e.current="",e.NFC="NFC",e.NFD="NFD",e.NFKC="NFKC",e.NFKD="NFKD"}(le||(le={})),function(e){e.UNEXPECTED_CONTINUE="unexpected continuation byte",e.BAD_PREFIX="bad codepoint prefix",e.OVERRUN="string overrun",e.MISSING_CONTINUE="missing continuation byte",e.OUT_OF_RANGE="out of UTF-8 range",e.UTF16_SURROGATE="UTF-16 surrogate",e.OVERLONG="overlong representation"}(ge||(ge={}));var Ie=Object.freeze({error:function(e,t,r,n,i){return de.throwArgumentError("invalid codepoint at offset ".concat(t,"; ").concat(e),"bytes",r)},ignore:pe,replace:function(e,t,r,n,i){return e===ge.OVERLONG?(n.push(i),0):(n.push(65533),pe(e,t,r))}});function ye(e,t){null==t&&(t=Ie.error),e=Object(c.a)(e);for(var r=[],n=0;n<e.length;){var i=e[n++];if(i>>7!=0){var o=null,a=null;if(192==(224&i))o=1,a=127;else if(224==(240&i))o=2,a=2047;else{if(240!=(248&i)){n+=t(128==(192&i)?ge.UNEXPECTED_CONTINUE:ge.BAD_PREFIX,n-1,e,r);continue}o=3,a=65535}if(n-1+o>=e.length)n+=t(ge.OVERRUN,n-1,e,r);else{for(var s=i&(1<<8-o-1)-1,A=0;A<o;A++){var u=e[n];if(128!=(192&u)){n+=t(ge.MISSING_CONTINUE,n,e,r),s=null;break}s=s<<6|63&u,n++}null!==s&&(s>1114111?n+=t(ge.OUT_OF_RANGE,n-1-o,e,r,s):s>=55296&&s<=57343?n+=t(ge.UTF16_SURROGATE,n-1-o,e,r,s):s<=a?n+=t(ge.OVERLONG,n-1-o,e,r,s):r.push(s))}}else r.push(i)}return r}function be(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:le.current;t!=le.current&&(de.checkNormalize(),e=e.normalize(t));for(var r=[],n=0;n<e.length;n++){var i=e.charCodeAt(n);if(i<128)r.push(i);else if(i<2048)r.push(i>>6|192),r.push(63&i|128);else if(55296==(64512&i)){n++;var o=e.charCodeAt(n);if(n>=e.length||56320!=(64512&o))throw new Error("invalid utf-8 string");var a=65536+((1023&i)<<10)+(1023&o);r.push(a>>18|240),r.push(a>>12&63|128),r.push(a>>6&63|128),r.push(63&a|128)}else r.push(i>>12|224),r.push(i>>6&63|128),r.push(63&i|128)}return Object(c.a)(r)}function Ee(e){var t="0000"+e.toString(16);return"\\u"+t.substring(t.length-4)}function me(e,t){return'"'+ye(e,t).map((function(e){if(e<256){switch(e){case 8:return"\\b";case 9:return"\\t";case 10:return"\\n";case 13:return"\\r";case 34:return'\\"';case 92:return"\\\\"}if(e>=32&&e<127)return String.fromCharCode(e)}return e<=65535?Ee(e):Ee(55296+((e-=65536)>>10&1023))+Ee(56320+(1023&e))})).join("")+'"'}function Ce(e){return e.map((function(e){return e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode(55296+(e>>10&1023),56320+(1023&e)))})).join("")}function ve(e,t){return Ce(ye(e,t))}function Be(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:le.current;return ye(be(e,t))}function we(e){return q(be(e))}function Qe(e){return(Qe="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function ke(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function _e(e,t){return(_e=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Se(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=Me(e);if(t){var i=Me(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return De(this,r)}}function De(e,t){if(t&&("object"===Qe(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function Me(e){return(Me=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var Re=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&_e(e,t)}(o,e);var t,r,n,i=Se(o);function o(e){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,o),i.call(this,"address","address",e,!1)}return t=o,(r=[{key:"defaultValue",value:function(){return"0x0000000000000000000000000000000000000000"}},{key:"encode",value:function(e,t){try{t=Ae(t)}catch(e){this._throwError(e.message,t)}return e.writeValue(t)}},{key:"decode",value:function(e){return Ae(Object(c.h)(e.readValue().toHexString(),20))}}])&&ke(t.prototype,r),n&&ke(t,n),Object.defineProperty(t,"prototype",{writable:!1}),o}(L);function xe(e){return(xe="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Oe(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function Ne(e,t){return(Ne=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Pe(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=je(e);if(t){var i=je(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return Fe(this,r)}}function Fe(e,t){if(t&&("object"===xe(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function je(e){return(je=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var Te=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Ne(e,t)}(o,e);var t,r,n,i=Pe(o);function o(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,o),(t=i.call(this,e.name,e.type,void 0,e.dynamic)).coder=e,t}return t=o,(r=[{key:"defaultValue",value:function(){return this.coder.defaultValue()}},{key:"encode",value:function(e,t){return this.coder.encode(e,t)}},{key:"decode",value:function(e){return this.coder.decode(e)}}])&&Oe(t.prototype,r),n&&Oe(t,n),Object.defineProperty(t,"prototype",{writable:!1}),o}(L);function Ue(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function Le(e,t){return(Le=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function He(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=Ye(e);if(t){var i=Ye(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return Ge(this,r)}}function Ge(e,t){if(t&&("object"===Ke(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function Ye(e){return(Ye=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Ke(e){return(Ke="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var qe=new h.b("abi/5.7.0");function Je(e,t,r){var n=null;if(Array.isArray(r))n=r;else if(r&&"object"===Ke(r)){var i={};n=t.map((function(e){var t=e.localName;return t||qe.throwError("cannot encode object for signature with missing names",h.b.errors.INVALID_ARGUMENT,{argument:"values",coder:e,value:r}),i[t]&&qe.throwError("cannot encode object for signature with duplicate names",h.b.errors.INVALID_ARGUMENT,{argument:"values",coder:e,value:r}),i[t]=!0,r[t]}))}else qe.throwArgumentError("invalid tuple value","tuple",r);t.length!==n.length&&qe.throwArgumentError("types/value length mismatch","tuple",r);var o=new H(e.wordSize),a=new H(e.wordSize),s=[];t.forEach((function(e,t){var r=n[t];if(e.dynamic){var i=a.length;e.encode(a,r);var A=o.writeUpdatableValue();s.push((function(e){A(e+i)}))}else e.encode(o,r)})),s.forEach((function(e){e(o.length)}));var A=e.appendWriter(o);return A+=e.appendWriter(a)}function ze(e,t){var r=[],n=e.subReader(0);t.forEach((function(t){var i=null;if(t.dynamic){var o=e.readValue(),a=n.subReader(o.toNumber());try{i=t.decode(a)}catch(e){if(e.code===h.b.errors.BUFFER_OVERRUN)throw e;(i=e).baseType=t.name,i.name=t.localName,i.type=t.type}}else try{i=t.decode(e)}catch(e){if(e.code===h.b.errors.BUFFER_OVERRUN)throw e;(i=e).baseType=t.name,i.name=t.localName,i.type=t.type}null!=i&&r.push(i)}));var i=t.reduce((function(e,t){var r=t.localName;return r&&(e[r]||(e[r]=0),e[r]++),e}),{});t.forEach((function(e,t){var n=e.localName;if(n&&1===i[n]&&("length"===n&&(n="_length"),null==r[n])){var o=r[t];o instanceof Error?Object.defineProperty(r,n,{enumerable:!0,get:function(){throw o}}):r[n]=o}}));for(var o=function(e){var t=r[e];t instanceof Error&&Object.defineProperty(r,e,{enumerable:!0,get:function(){throw t}})},a=0;a<r.length;a++)o(a);return Object.freeze(r)}var Ve=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Le(e,t)}(o,e);var t,r,n,i=He(o);function o(e,t,r){var n;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,o);var a=e.type+"["+(t>=0?t:"")+"]",s=-1===t||e.dynamic;return(n=i.call(this,"array",a,r,s)).coder=e,n.length=t,n}return t=o,(r=[{key:"defaultValue",value:function(){for(var e=this.coder.defaultValue(),t=[],r=0;r<this.length;r++)t.push(e);return t}},{key:"encode",value:function(e,t){Array.isArray(t)||this._throwError("expected array value",t);var r=this.length;-1===r&&(r=t.length,e.writeValue(t.length)),qe.checkArgumentCount(t.length,r,"coder array"+(this.localName?" "+this.localName:""));for(var n=[],i=0;i<t.length;i++)n.push(this.coder);return Je(e,n,t)}},{key:"decode",value:function(e){var t=this.length;-1===t&&32*(t=e.readValue().toNumber())>e._data.length&&qe.throwError("insufficient data length",h.b.errors.BUFFER_OVERRUN,{length:e._data.length,count:t});for(var r=[],n=0;n<t;n++)r.push(new Te(this.coder));return e.coerce(this.name,ze(e,r))}}])&&Ue(t.prototype,r),n&&Ue(t,n),Object.defineProperty(t,"prototype",{writable:!1}),o}(L);function Ze(e){return(Ze="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function We(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function Xe(e,t){return(Xe=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function $e(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=tt(e);if(t){var i=tt(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return et(this,r)}}function et(e,t){if(t&&("object"===Ze(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function tt(e){return(tt=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var rt=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Xe(e,t)}(o,e);var t,r,n,i=$e(o);function o(e){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,o),i.call(this,"bool","bool",e,!1)}return t=o,(r=[{key:"defaultValue",value:function(){return!1}},{key:"encode",value:function(e,t){return e.writeValue(t?1:0)}},{key:"decode",value:function(e){return e.coerce(this.type,!e.readValue().isZero())}}])&&We(t.prototype,r),n&&We(t,n),Object.defineProperty(t,"prototype",{writable:!1}),o}(L);function nt(e){return(nt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function it(){return(it="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,r){var n=ot(e,t);if(n){var i=Object.getOwnPropertyDescriptor(n,t);return i.get?i.get.call(arguments.length<3?e:r):i.value}}).apply(this,arguments)}function ot(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=lt(e)););return e}function at(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function st(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function At(e,t,r){return t&&st(e.prototype,t),r&&st(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function ct(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&ut(e,t)}function ut(e,t){return(ut=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function ft(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=lt(e);if(t){var i=lt(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return ht(this,r)}}function ht(e,t){if(t&&("object"===nt(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function lt(e){return(lt=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var gt=function(e){ct(r,e);var t=ft(r);function r(e,n){return at(this,r),t.call(this,e,e,n,!0)}return At(r,[{key:"defaultValue",value:function(){return"0x"}},{key:"encode",value:function(e,t){t=Object(c.a)(t);var r=e.writeValue(t.length);return r+=e.writeBytes(t)}},{key:"decode",value:function(e){return e.readBytes(e.readValue().toNumber(),!0)}}]),r}(L),dt=function(e){ct(r,e);var t=ft(r);function r(e){return at(this,r),t.call(this,"bytes",e)}return At(r,[{key:"decode",value:function(e){return e.coerce(this.name,Object(c.i)(it(lt(r.prototype),"decode",this).call(this,e)))}}]),r}(gt);function pt(e){return(pt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function It(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function yt(e,t){return(yt=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function bt(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=mt(e);if(t){var i=mt(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return Et(this,r)}}function Et(e,t){if(t&&("object"===pt(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function mt(e){return(mt=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var Ct=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&yt(e,t)}(o,e);var t,r,n,i=bt(o);function o(e,t){var r;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,o);var n="bytes"+String(e);return(r=i.call(this,n,n,t,!1)).size=e,r}return t=o,(r=[{key:"defaultValue",value:function(){return"0x0000000000000000000000000000000000000000000000000000000000000000".substring(0,2+2*this.size)}},{key:"encode",value:function(e,t){var r=Object(c.a)(t);return r.length!==this.size&&this._throwError("incorrect data length",t),e.writeBytes(r)}},{key:"decode",value:function(e){return e.coerce(this.name,Object(c.i)(e.readBytes(this.size)))}}])&&It(t.prototype,r),n&&It(t,n),Object.defineProperty(t,"prototype",{writable:!1}),o}(L);function vt(e){return(vt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Bt(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function wt(e,t){return(wt=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Qt(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=_t(e);if(t){var i=_t(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return kt(this,r)}}function kt(e,t){if(t&&("object"===vt(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function _t(e){return(_t=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var St=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&wt(e,t)}(o,e);var t,r,n,i=Qt(o);function o(e){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,o),i.call(this,"null","",e,!1)}return t=o,(r=[{key:"defaultValue",value:function(){return null}},{key:"encode",value:function(e,t){return null!=t&&this._throwError("not null",t),e.writeBytes([])}},{key:"decode",value:function(e){return e.readBytes(0),e.coerce(this.name,null)}}])&&Bt(t.prototype,r),n&&Bt(t,n),Object.defineProperty(t,"prototype",{writable:!1}),o}(L),Dt=y.from(-1),Mt=y.from(0),Rt=y.from(1),xt=y.from(2),Ot=y.from("1000000000000000000"),Nt=y.from("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"),Pt=y.from("-0x8000000000000000000000000000000000000000000000000000000000000000"),Ft=y.from("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");function jt(e){return(jt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Tt(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function Ut(e,t){return(Ut=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Lt(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=Gt(e);if(t){var i=Gt(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return Ht(this,r)}}function Ht(e,t){if(t&&("object"===jt(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function Gt(e){return(Gt=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var Yt=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Ut(e,t)}(o,e);var t,r,n,i=Lt(o);function o(e,t,r){var n;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,o);var a=(t?"int":"uint")+8*e;return(n=i.call(this,a,a,r,!1)).size=e,n.signed=t,n}return t=o,(r=[{key:"defaultValue",value:function(){return 0}},{key:"encode",value:function(e,t){var r=y.from(t),n=Nt.mask(8*e.wordSize);if(this.signed){var i=n.mask(8*this.size-1);(r.gt(i)||r.lt(i.add(Rt).mul(Dt)))&&this._throwError("value out-of-bounds",t)}else(r.lt(Mt)||r.gt(n.mask(8*this.size)))&&this._throwError("value out-of-bounds",t);return r=r.toTwos(8*this.size).mask(8*this.size),this.signed&&(r=r.fromTwos(8*this.size).toTwos(8*e.wordSize)),e.writeValue(r)}},{key:"decode",value:function(e){var t=e.readValue().mask(8*this.size);return this.signed&&(t=t.fromTwos(8*this.size)),e.coerce(this.name,t)}}])&&Tt(t.prototype,r),n&&Tt(t,n),Object.defineProperty(t,"prototype",{writable:!1}),o}(L);function Kt(e){return(Kt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function qt(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function Jt(){return(Jt="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,r){var n=zt(e,t);if(n){var i=Object.getOwnPropertyDescriptor(n,t);return i.get?i.get.call(arguments.length<3?e:r):i.value}}).apply(this,arguments)}function zt(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=Xt(e)););return e}function Vt(e,t){return(Vt=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Zt(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=Xt(e);if(t){var i=Xt(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return Wt(this,r)}}function Wt(e,t){if(t&&("object"===Kt(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function Xt(e){return(Xt=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var $t=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Vt(e,t)}(o,e);var t,r,n,i=Zt(o);function o(e){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,o),i.call(this,"string",e)}return t=o,(r=[{key:"defaultValue",value:function(){return""}},{key:"encode",value:function(e,t){return Jt(Xt(o.prototype),"encode",this).call(this,e,be(t))}},{key:"decode",value:function(e){return ve(Jt(Xt(o.prototype),"decode",this).call(this,e))}}])&&qt(t.prototype,r),n&&qt(t,n),Object.defineProperty(t,"prototype",{writable:!1}),o}(gt);function er(e){return(er="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function tr(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function rr(e,t){return(rr=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function nr(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=or(e);if(t){var i=or(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return ir(this,r)}}function ir(e,t){if(t&&("object"===er(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function or(e){return(or=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var ar=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&rr(e,t)}(o,e);var t,r,n,i=nr(o);function o(e,t){var r;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,o);var n=!1,a=[];e.forEach((function(e){e.dynamic&&(n=!0),a.push(e.type)}));var s="tuple("+a.join(",")+")";return(r=i.call(this,"tuple",s,t,n)).coders=e,r}return t=o,(r=[{key:"defaultValue",value:function(){var e=[];this.coders.forEach((function(t){e.push(t.defaultValue())}));var t=this.coders.reduce((function(e,t){var r=t.localName;return r&&(e[r]||(e[r]=0),e[r]++),e}),{});return this.coders.forEach((function(r,n){var i=r.localName;i&&1===t[i]&&("length"===i&&(i="_length"),null==e[i]&&(e[i]=e[n]))})),Object.freeze(e)}},{key:"encode",value:function(e,t){return Je(e,this.coders,t)}},{key:"decode",value:function(e){return e.coerce(this.name,ze(e,this.coders))}}])&&tr(t.prototype,r),n&&tr(t,n),Object.defineProperty(t,"prototype",{writable:!1}),o}(L);function sr(e){return(sr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Ar(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&cr(e,t)}function cr(e,t){return(cr=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function ur(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=hr(e);if(t){var i=hr(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return fr(this,r)}}function fr(e,t){if(t&&("object"===sr(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function hr(e){return(hr=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function lr(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function gr(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function dr(e,t,r){return t&&gr(e.prototype,t),r&&gr(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}var pr=new h.b("abi/5.7.0"),Ir={},yr={calldata:!0,memory:!0,storage:!0},br={calldata:!0,memory:!0};function Er(e,t){if("bytes"===e||"string"===e){if(yr[t])return!0}else if("address"===e){if("payable"===t)return!0}else if((e.indexOf("[")>=0||"tuple"===e)&&br[t])return!0;return(yr[t]||"payable"===t)&&pr.throwArgumentError("invalid modifier","name",t),!1}function mr(e,t){for(var r in t)_(e,r,t[r])}var Cr=Object.freeze({sighash:"sighash",minimal:"minimal",full:"full",json:"json"}),vr=new RegExp(/^(.*)\[([0-9]*)\]$/),Br=function(){function e(t,r){lr(this,e),t!==Ir&&pr.throwError("use fromString",h.b.errors.UNSUPPORTED_OPERATION,{operation:"new ParamType()"}),mr(this,r);var n=this.type.match(vr);mr(this,n?{arrayLength:parseInt(n[2]||"-1"),arrayChildren:e.fromObject({type:n[1],components:this.components}),baseType:"array"}:{arrayLength:null,arrayChildren:null,baseType:null!=this.components?"tuple":this.type}),this._isParamType=!0,Object.freeze(this)}return dr(e,[{key:"format",value:function(e){if(e||(e=Cr.sighash),Cr[e]||pr.throwArgumentError("invalid format type","format",e),e===Cr.json){var t={type:"tuple"===this.baseType?"tuple":this.type,name:this.name||void 0};return"boolean"==typeof this.indexed&&(t.indexed=this.indexed),this.components&&(t.components=this.components.map((function(t){return JSON.parse(t.format(e))}))),JSON.stringify(t)}var r="";return"array"===this.baseType?(r+=this.arrayChildren.format(e),r+="["+(this.arrayLength<0?"":String(this.arrayLength))+"]"):"tuple"===this.baseType?(e!==Cr.sighash&&(r+=this.type),r+="("+this.components.map((function(t){return t.format(e)})).join(e===Cr.full?", ":",")+")"):r+=this.type,e!==Cr.sighash&&(!0===this.indexed&&(r+=" indexed"),e===Cr.full&&this.name&&(r+=" "+this.name)),r}}],[{key:"from",value:function(t,r){return"string"==typeof t?e.fromString(t,r):e.fromObject(t)}},{key:"fromObject",value:function(t){return e.isParamType(t)?t:new e(Ir,{name:t.name||null,type:Nr(t.type),indexed:null==t.indexed?null:!!t.indexed,components:t.components?t.components.map(e.fromObject):null})}},{key:"fromString",value:function(t,r){return function(t){return e.fromObject({name:t.name,type:t.type,indexed:t.indexed,components:t.components})}(function(e,t){var r=e;function n(t){pr.throwArgumentError("unexpected character at position ".concat(t),"param",e)}function i(e){var r={type:"",name:"",parent:e,state:{allowType:!0}};return t&&(r.indexed=!1),r}e=e.replace(/\s/g," ");for(var o={type:"",name:"",state:{allowType:!0}},a=o,s=0;s<e.length;s++){var A=e[s];switch(A){case"(":a.state.allowType&&""===a.type?a.type="tuple":a.state.allowParams||n(s),a.state.allowType=!1,a.type=Nr(a.type),a.components=[i(a)],a=a.components[0];break;case")":delete a.state,"indexed"===a.name&&(t||n(s),a.indexed=!0,a.name=""),Er(a.type,a.name)&&(a.name=""),a.type=Nr(a.type);var c=a;(a=a.parent)||n(s),delete c.parent,a.state.allowParams=!1,a.state.allowName=!0,a.state.allowArray=!0;break;case",":delete a.state,"indexed"===a.name&&(t||n(s),a.indexed=!0,a.name=""),Er(a.type,a.name)&&(a.name=""),a.type=Nr(a.type);var u=i(a.parent);a.parent.components.push(u),delete a.parent,a=u;break;case" ":a.state.allowType&&""!==a.type&&(a.type=Nr(a.type),delete a.state.allowType,a.state.allowName=!0,a.state.allowParams=!0),a.state.allowName&&""!==a.name&&("indexed"===a.name?(t||n(s),a.indexed&&n(s),a.indexed=!0,a.name=""):Er(a.type,a.name)?a.name="":a.state.allowName=!1);break;case"[":a.state.allowArray||n(s),a.type+=A,a.state.allowArray=!1,a.state.allowName=!1,a.state.readArray=!0;break;case"]":a.state.readArray||n(s),a.type+=A,a.state.readArray=!1,a.state.allowArray=!0,a.state.allowName=!0;break;default:a.state.allowType?(a.type+=A,a.state.allowParams=!0,a.state.allowArray=!0):a.state.allowName?(a.name+=A,delete a.state.allowArray):a.state.readArray?a.type+=A:n(s)}}return a.parent&&pr.throwArgumentError("unexpected eof","param",e),delete o.state,"indexed"===a.name?(t||n(r.length-7),a.indexed&&n(r.length-7),a.indexed=!0,a.name=""):Er(a.type,a.name)&&(a.name=""),o.type=Nr(o.type),o}(t,!!r))}},{key:"isParamType",value:function(e){return!(null==e||!e._isParamType)}}]),e}();function wr(e,t){return function(e){e=e.trim();for(var t=[],r="",n=0,i=0;i<e.length;i++){var o=e[i];","===o&&0===n?(t.push(r),r=""):(r+=o,"("===o?n++:")"===o&&-1===--n&&pr.throwArgumentError("unbalanced parenthesis","value",e))}r&&t.push(r);return t}(e).map((function(e){return Br.fromString(e,t)}))}var Qr=function(){function e(t,r){lr(this,e),t!==Ir&&pr.throwError("use a static from method",h.b.errors.UNSUPPORTED_OPERATION,{operation:"new Fragment()"}),mr(this,r),this._isFragment=!0,Object.freeze(this)}return dr(e,null,[{key:"from",value:function(t){return e.isFragment(t)?t:"string"==typeof t?e.fromString(t):e.fromObject(t)}},{key:"fromObject",value:function(t){if(e.isFragment(t))return t;switch(t.type){case"function":return Rr.fromObject(t);case"event":return kr.fromObject(t);case"constructor":return Mr.fromObject(t);case"error":return Or.fromObject(t);case"fallback":case"receive":return null}return pr.throwArgumentError("invalid fragment object","value",t)}},{key:"fromString",value:function(e){return"event"===(e=(e=(e=e.replace(/\s/g," ")).replace(/\(/g," (").replace(/\)/g,") ").replace(/\s+/g," ")).trim()).split(" ")[0]?kr.fromString(e.substring(5).trim()):"function"===e.split(" ")[0]?Rr.fromString(e.substring(8).trim()):"constructor"===e.split("(")[0].trim()?Mr.fromString(e.trim()):"error"===e.split(" ")[0]?Or.fromString(e.substring(5).trim()):pr.throwArgumentError("unsupported fragment","value",e)}},{key:"isFragment",value:function(e){return!(!e||!e._isFragment)}}]),e}(),kr=function(e){Ar(r,e);var t=ur(r);function r(){return lr(this,r),t.apply(this,arguments)}return dr(r,[{key:"format",value:function(e){if(e||(e=Cr.sighash),Cr[e]||pr.throwArgumentError("invalid format type","format",e),e===Cr.json)return JSON.stringify({type:"event",anonymous:this.anonymous,name:this.name,inputs:this.inputs.map((function(t){return JSON.parse(t.format(e))}))});var t="";return e!==Cr.sighash&&(t+="event "),t+=this.name+"("+this.inputs.map((function(t){return t.format(e)})).join(e===Cr.full?", ":",")+") ",e!==Cr.sighash&&this.anonymous&&(t+="anonymous "),t.trim()}}],[{key:"from",value:function(e){return"string"==typeof e?r.fromString(e):r.fromObject(e)}},{key:"fromObject",value:function(e){if(r.isEventFragment(e))return e;"event"!==e.type&&pr.throwArgumentError("invalid event object","value",e);var t={name:Fr(e.name),anonymous:e.anonymous,inputs:e.inputs?e.inputs.map(Br.fromObject):[],type:"event"};return new r(Ir,t)}},{key:"fromString",value:function(e){var t=e.match(jr);t||pr.throwArgumentError("invalid event string","value",e);var n=!1;return t[3].split(" ").forEach((function(e){switch(e.trim()){case"anonymous":n=!0;break;case"":break;default:pr.warn("unknown modifier: "+e)}})),r.fromObject({name:t[1].trim(),anonymous:n,inputs:wr(t[2],!0),type:"event"})}},{key:"isEventFragment",value:function(e){return e&&e._isFragment&&"event"===e.type}}]),r}(Qr);function _r(e,t){t.gas=null;var r=e.split("@");return 1!==r.length?(r.length>2&&pr.throwArgumentError("invalid human-readable ABI signature","value",e),r[1].match(/^[0-9]+$/)||pr.throwArgumentError("invalid human-readable ABI signature gas","value",e),t.gas=y.from(r[1]),r[0]):e}function Sr(e,t){t.constant=!1,t.payable=!1,t.stateMutability="nonpayable",e.split(" ").forEach((function(e){switch(e.trim()){case"constant":t.constant=!0;break;case"payable":t.payable=!0,t.stateMutability="payable";break;case"nonpayable":t.payable=!1,t.stateMutability="nonpayable";break;case"pure":t.constant=!0,t.stateMutability="pure";break;case"view":t.constant=!0,t.stateMutability="view";break;case"external":case"public":case"":break;default:console.log("unknown modifier: "+e)}}))}function Dr(e){var t={constant:!1,payable:!0,stateMutability:"payable"};return null!=e.stateMutability?(t.stateMutability=e.stateMutability,t.constant="view"===t.stateMutability||"pure"===t.stateMutability,null!=e.constant&&!!e.constant!==t.constant&&pr.throwArgumentError("cannot have constant function with mutability "+t.stateMutability,"value",e),t.payable="payable"===t.stateMutability,null!=e.payable&&!!e.payable!==t.payable&&pr.throwArgumentError("cannot have payable function with mutability "+t.stateMutability,"value",e)):null!=e.payable?(t.payable=!!e.payable,null!=e.constant||t.payable||"constructor"===e.type||pr.throwArgumentError("unable to determine stateMutability","value",e),t.constant=!!e.constant,t.constant?t.stateMutability="view":t.stateMutability=t.payable?"payable":"nonpayable",t.payable&&t.constant&&pr.throwArgumentError("cannot have constant payable function","value",e)):null!=e.constant?(t.constant=!!e.constant,t.payable=!t.constant,t.stateMutability=t.constant?"view":"payable"):"constructor"!==e.type&&pr.throwArgumentError("unable to determine stateMutability","value",e),t}var Mr=function(e){Ar(r,e);var t=ur(r);function r(){return lr(this,r),t.apply(this,arguments)}return dr(r,[{key:"format",value:function(e){if(e||(e=Cr.sighash),Cr[e]||pr.throwArgumentError("invalid format type","format",e),e===Cr.json)return JSON.stringify({type:"constructor",stateMutability:"nonpayable"!==this.stateMutability?this.stateMutability:void 0,payable:this.payable,gas:this.gas?this.gas.toNumber():void 0,inputs:this.inputs.map((function(t){return JSON.parse(t.format(e))}))});e===Cr.sighash&&pr.throwError("cannot format a constructor for sighash",h.b.errors.UNSUPPORTED_OPERATION,{operation:"format(sighash)"});var t="constructor("+this.inputs.map((function(t){return t.format(e)})).join(e===Cr.full?", ":",")+") ";return this.stateMutability&&"nonpayable"!==this.stateMutability&&(t+=this.stateMutability+" "),t.trim()}}],[{key:"from",value:function(e){return"string"==typeof e?r.fromString(e):r.fromObject(e)}},{key:"fromObject",value:function(e){if(r.isConstructorFragment(e))return e;"constructor"!==e.type&&pr.throwArgumentError("invalid constructor object","value",e);var t=Dr(e);t.constant&&pr.throwArgumentError("constructor cannot be constant","value",e);var n={name:null,type:e.type,inputs:e.inputs?e.inputs.map(Br.fromObject):[],payable:t.payable,stateMutability:t.stateMutability,gas:e.gas?y.from(e.gas):null};return new r(Ir,n)}},{key:"fromString",value:function(e){var t={type:"constructor"},n=(e=_r(e,t)).match(jr);return n&&"constructor"===n[1].trim()||pr.throwArgumentError("invalid constructor string","value",e),t.inputs=wr(n[2].trim(),!1),Sr(n[3].trim(),t),r.fromObject(t)}},{key:"isConstructorFragment",value:function(e){return e&&e._isFragment&&"constructor"===e.type}}]),r}(Qr),Rr=function(e){Ar(r,e);var t=ur(r);function r(){return lr(this,r),t.apply(this,arguments)}return dr(r,[{key:"format",value:function(e){if(e||(e=Cr.sighash),Cr[e]||pr.throwArgumentError("invalid format type","format",e),e===Cr.json)return JSON.stringify({type:"function",name:this.name,constant:this.constant,stateMutability:"nonpayable"!==this.stateMutability?this.stateMutability:void 0,payable:this.payable,gas:this.gas?this.gas.toNumber():void 0,inputs:this.inputs.map((function(t){return JSON.parse(t.format(e))})),outputs:this.outputs.map((function(t){return JSON.parse(t.format(e))}))});var t="";return e!==Cr.sighash&&(t+="function "),t+=this.name+"("+this.inputs.map((function(t){return t.format(e)})).join(e===Cr.full?", ":",")+") ",e!==Cr.sighash&&(this.stateMutability?"nonpayable"!==this.stateMutability&&(t+=this.stateMutability+" "):this.constant&&(t+="view "),this.outputs&&this.outputs.length&&(t+="returns ("+this.outputs.map((function(t){return t.format(e)})).join(", ")+") "),null!=this.gas&&(t+="@"+this.gas.toString()+" ")),t.trim()}}],[{key:"from",value:function(e){return"string"==typeof e?r.fromString(e):r.fromObject(e)}},{key:"fromObject",value:function(e){if(r.isFunctionFragment(e))return e;"function"!==e.type&&pr.throwArgumentError("invalid function object","value",e);var t=Dr(e),n={type:e.type,name:Fr(e.name),constant:t.constant,inputs:e.inputs?e.inputs.map(Br.fromObject):[],outputs:e.outputs?e.outputs.map(Br.fromObject):[],payable:t.payable,stateMutability:t.stateMutability,gas:e.gas?y.from(e.gas):null};return new r(Ir,n)}},{key:"fromString",value:function(e){var t={type:"function"},n=(e=_r(e,t)).split(" returns ");n.length>2&&pr.throwArgumentError("invalid function string","value",e);var i=n[0].match(jr);if(i||pr.throwArgumentError("invalid function signature","value",e),t.name=i[1].trim(),t.name&&Fr(t.name),t.inputs=wr(i[2],!1),Sr(i[3].trim(),t),n.length>1){var o=n[1].match(jr);""==o[1].trim()&&""==o[3].trim()||pr.throwArgumentError("unexpected tokens","value",e),t.outputs=wr(o[2],!1)}else t.outputs=[];return r.fromObject(t)}},{key:"isFunctionFragment",value:function(e){return e&&e._isFragment&&"function"===e.type}}]),r}(Mr);function xr(e){var t=e.format();return"Error(string)"!==t&&"Panic(uint256)"!==t||pr.throwArgumentError("cannot specify user defined ".concat(t," error"),"fragment",e),e}var Or=function(e){Ar(r,e);var t=ur(r);function r(){return lr(this,r),t.apply(this,arguments)}return dr(r,[{key:"format",value:function(e){if(e||(e=Cr.sighash),Cr[e]||pr.throwArgumentError("invalid format type","format",e),e===Cr.json)return JSON.stringify({type:"error",name:this.name,inputs:this.inputs.map((function(t){return JSON.parse(t.format(e))}))});var t="";return e!==Cr.sighash&&(t+="error "),(t+=this.name+"("+this.inputs.map((function(t){return t.format(e)})).join(e===Cr.full?", ":",")+") ").trim()}}],[{key:"from",value:function(e){return"string"==typeof e?r.fromString(e):r.fromObject(e)}},{key:"fromObject",value:function(e){if(r.isErrorFragment(e))return e;"error"!==e.type&&pr.throwArgumentError("invalid error object","value",e);var t={type:e.type,name:Fr(e.name),inputs:e.inputs?e.inputs.map(Br.fromObject):[]};return xr(new r(Ir,t))}},{key:"fromString",value:function(e){var t={type:"error"},n=e.match(jr);return n||pr.throwArgumentError("invalid error signature","value",e),t.name=n[1].trim(),t.name&&Fr(t.name),t.inputs=wr(n[2],!1),xr(r.fromObject(t))}},{key:"isErrorFragment",value:function(e){return e&&e._isFragment&&"error"===e.type}}]),r}(Qr);function Nr(e){return e.match(/^uint($|[^1-9])/)?e="uint256"+e.substring(4):e.match(/^int($|[^1-9])/)&&(e="int256"+e.substring(3)),e}var Pr=new RegExp("^[a-zA-Z$_][a-zA-Z0-9$_]*$");function Fr(e){return e&&e.match(Pr)||pr.throwArgumentError('invalid identifier "'.concat(e,'"'),"value",e),e}var jr=new RegExp("^([^)(]*)\\((.*)\\)([^)(]*)$");function Tr(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}var Ur=new h.b("abi/5.7.0"),Lr=new RegExp(/^bytes([0-9]*)$/),Hr=new RegExp(/^(u?int)([0-9]*)$/),Gr=new(function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),_(this,"coerceFunc",t||null)}var t,r,n;return t=e,(r=[{key:"_getCoder",value:function(e){var t=this;switch(e.baseType){case"address":return new Re(e.name);case"bool":return new rt(e.name);case"string":return new $t(e.name);case"bytes":return new dt(e.name);case"array":return new Ve(this._getCoder(e.arrayChildren),e.arrayLength,e.name);case"tuple":return new ar((e.components||[]).map((function(e){return t._getCoder(e)})),e.name);case"":return new St(e.name)}var r=e.type.match(Hr);if(r){var n=parseInt(r[2]||"256");return(0===n||n>256||n%8!=0)&&Ur.throwArgumentError("invalid "+r[1]+" bit length","param",e),new Yt(n/8,"int"===r[1],e.name)}if(r=e.type.match(Lr)){var i=parseInt(r[1]);return(0===i||i>32)&&Ur.throwArgumentError("invalid bytes length","param",e),new Ct(i,e.name)}return Ur.throwArgumentError("invalid type","type",e.type)}},{key:"_getWordSize",value:function(){return 32}},{key:"_getReader",value:function(e,t){return new G(e,this._getWordSize(),this.coerceFunc,t)}},{key:"_getWriter",value:function(){return new H(this._getWordSize())}},{key:"getDefaultValue",value:function(e){var t=this,r=e.map((function(e){return t._getCoder(Br.from(e))}));return new ar(r,"_").defaultValue()}},{key:"encode",value:function(e,t){var r=this;e.length!==t.length&&Ur.throwError("types/values length mismatch",h.b.errors.INVALID_ARGUMENT,{count:{types:e.length,values:t.length},value:{types:e,values:t}});var n=e.map((function(e){return r._getCoder(Br.from(e))})),i=new ar(n,"_"),o=this._getWriter();return i.encode(o,t),o.data}},{key:"decode",value:function(e,t,r){var n=this,i=e.map((function(e){return n._getCoder(Br.from(e))}));return new ar(i,"_").decode(this._getReader(Object(c.a)(t),r))}}])&&Tr(t.prototype,r),n&&Tr(t,n),Object.defineProperty(t,"prototype",{writable:!1}),e}());function Yr(e){return(Yr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Kr(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function qr(e,t,r){return t&&Kr(e.prototype,t),r&&Kr(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function Jr(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function zr(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Vr(e,t)}function Vr(e,t){return(Vr=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Zr(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=Xr(e);if(t){var i=Xr(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return Wr(this,r)}}function Wr(e,t){if(t&&("object"===Yr(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function Xr(e){return(Xr=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var $r=new h.b("abi/5.7.0"),en=function(e){zr(r,e);var t=Zr(r);function r(){return Jr(this,r),t.apply(this,arguments)}return qr(r)}(P),tn=function(e){zr(r,e);var t=Zr(r);function r(){return Jr(this,r),t.apply(this,arguments)}return qr(r)}(P),rn=function(e){zr(r,e);var t=Zr(r);function r(){return Jr(this,r),t.apply(this,arguments)}return qr(r)}(P),nn=function(e){zr(r,e);var t=Zr(r);function r(){return Jr(this,r),t.apply(this,arguments)}return qr(r,null,[{key:"isIndexed",value:function(e){return!(!e||!e._isIndexed)}}]),r}(P),on={"0x08c379a0":{signature:"Error(string)",name:"Error",inputs:["string"],reason:!0},"0x4e487b71":{signature:"Panic(uint256)",name:"Panic",inputs:["uint256"]}};function an(e,t){var r=new Error("deferred error during ABI decoding triggered accessing ".concat(e));return r.error=t,r}var sn=function(){function e(t){var r=this;Jr(this,e);_(this,"fragments",("string"==typeof t?JSON.parse(t):t).map((function(e){return Qr.from(e)})).filter((function(e){return null!=e}))),_(this,"_abiCoder",S(this instanceof e?this.constructor:void 0,"getAbiCoder")()),_(this,"functions",{}),_(this,"errors",{}),_(this,"events",{}),_(this,"structs",{}),this.fragments.forEach((function(e){var t=null;switch(e.type){case"constructor":return r.deploy?void $r.warn("duplicate definition - constructor"):void _(r,"deploy",e);case"function":t=r.functions;break;case"event":t=r.events;break;case"error":t=r.errors;break;default:return}var n=e.format();t[n]?$r.warn("duplicate definition - "+n):t[n]=e})),this.deploy||_(this,"deploy",Mr.from({payable:!1,type:"constructor"})),_(this,"_isInterface",!0)}return qr(e,[{key:"format",value:function(e){e||(e=Cr.full),e===Cr.sighash&&$r.throwArgumentError("interface does not support formatting sighash","format",e);var t=this.fragments.map((function(t){return t.format(e)}));return e===Cr.json?JSON.stringify(t.map((function(e){return JSON.parse(e)}))):t}},{key:"getFunction",value:function(e){if(Object(c.l)(e)){for(var t in this.functions)if(e===this.getSighash(t))return this.functions[t];$r.throwArgumentError("no matching function","sighash",e)}if(-1===e.indexOf("(")){var r=e.trim(),n=Object.keys(this.functions).filter((function(e){return e.split("(")[0]===r}));return 0===n.length?$r.throwArgumentError("no matching function","name",r):n.length>1&&$r.throwArgumentError("multiple matching functions","name",r),this.functions[n[0]]}var i=this.functions[Rr.fromString(e).format()];return i||$r.throwArgumentError("no matching function","signature",e),i}},{key:"getEvent",value:function(e){if(Object(c.l)(e)){var t=e.toLowerCase();for(var r in this.events)if(t===this.getEventTopic(r))return this.events[r];$r.throwArgumentError("no matching event","topichash",t)}if(-1===e.indexOf("(")){var n=e.trim(),i=Object.keys(this.events).filter((function(e){return e.split("(")[0]===n}));return 0===i.length?$r.throwArgumentError("no matching event","name",n):i.length>1&&$r.throwArgumentError("multiple matching events","name",n),this.events[i[0]]}var o=this.events[kr.fromString(e).format()];return o||$r.throwArgumentError("no matching event","signature",e),o}},{key:"getError",value:function(e){if(Object(c.l)(e)){var t=S(this.constructor,"getSighash");for(var r in this.errors){if(e===t(this.errors[r]))return this.errors[r]}$r.throwArgumentError("no matching error","sighash",e)}if(-1===e.indexOf("(")){var n=e.trim(),i=Object.keys(this.errors).filter((function(e){return e.split("(")[0]===n}));return 0===i.length?$r.throwArgumentError("no matching error","name",n):i.length>1&&$r.throwArgumentError("multiple matching errors","name",n),this.errors[i[0]]}var o=this.errors[Rr.fromString(e).format()];return o||$r.throwArgumentError("no matching error","signature",e),o}},{key:"getSighash",value:function(e){if("string"==typeof e)try{e=this.getFunction(e)}catch(t){try{e=this.getError(e)}catch(e){throw t}}return S(this.constructor,"getSighash")(e)}},{key:"getEventTopic",value:function(e){return"string"==typeof e&&(e=this.getEvent(e)),S(this.constructor,"getEventTopic")(e)}},{key:"_decodeParams",value:function(e,t){return this._abiCoder.decode(e,t)}},{key:"_encodeParams",value:function(e,t){return this._abiCoder.encode(e,t)}},{key:"encodeDeploy",value:function(e){return this._encodeParams(this.deploy.inputs,e||[])}},{key:"decodeErrorResult",value:function(e,t){"string"==typeof e&&(e=this.getError(e));var r=Object(c.a)(t);return Object(c.i)(r.slice(0,4))!==this.getSighash(e)&&$r.throwArgumentError("data signature does not match error ".concat(e.name,"."),"data",Object(c.i)(r)),this._decodeParams(e.inputs,r.slice(4))}},{key:"encodeErrorResult",value:function(e,t){return"string"==typeof e&&(e=this.getError(e)),Object(c.i)(Object(c.b)([this.getSighash(e),this._encodeParams(e.inputs,t||[])]))}},{key:"decodeFunctionData",value:function(e,t){"string"==typeof e&&(e=this.getFunction(e));var r=Object(c.a)(t);return Object(c.i)(r.slice(0,4))!==this.getSighash(e)&&$r.throwArgumentError("data signature does not match function ".concat(e.name,"."),"data",Object(c.i)(r)),this._decodeParams(e.inputs,r.slice(4))}},{key:"encodeFunctionData",value:function(e,t){return"string"==typeof e&&(e=this.getFunction(e)),Object(c.i)(Object(c.b)([this.getSighash(e),this._encodeParams(e.inputs,t||[])]))}},{key:"decodeFunctionResult",value:function(e,t){"string"==typeof e&&(e=this.getFunction(e));var r=Object(c.a)(t),n=null,i="",o=null,a=null,s=null;switch(r.length%this._abiCoder._getWordSize()){case 0:try{return this._abiCoder.decode(e.outputs,r)}catch(f){}break;case 4:var A=Object(c.i)(r.slice(0,4)),u=on[A];if(u)o=this._abiCoder.decode(u.inputs,r.slice(4)),a=u.name,s=u.signature,u.reason&&(n=o[0]),"Error"===a?i="; VM Exception while processing transaction: reverted with reason string ".concat(JSON.stringify(o[0])):"Panic"===a&&(i="; VM Exception while processing transaction: reverted with panic code ".concat(o[0]));else try{var f=this.getError(A);o=this._abiCoder.decode(f.inputs,r.slice(4)),a=f.name,s=f.format()}catch(f){}}return $r.throwError("call revert exception"+i,h.b.errors.CALL_EXCEPTION,{method:e.format(),data:Object(c.i)(t),errorArgs:o,errorName:a,errorSignature:s,reason:n})}},{key:"encodeFunctionResult",value:function(e,t){return"string"==typeof e&&(e=this.getFunction(e)),Object(c.i)(this._abiCoder.encode(e.outputs,t||[]))}},{key:"encodeFilterTopics",value:function(e,t){var r=this;"string"==typeof e&&(e=this.getEvent(e)),t.length>e.inputs.length&&$r.throwError("too many arguments for "+e.format(),h.b.errors.UNEXPECTED_ARGUMENT,{argument:"values",value:t});var n=[];e.anonymous||n.push(this.getEventTopic(e));var i=function(e,t){return"string"===e.type?we(t):"bytes"===e.type?q(Object(c.i)(t)):("bool"===e.type&&"boolean"==typeof t&&(t=t?"0x01":"0x00"),e.type.match(/^u?int/)&&(t=y.from(t).toHexString()),"address"===e.type&&r._abiCoder.encode(["address"],[t]),Object(c.h)(Object(c.i)(t),32))};for(t.forEach((function(t,r){var o=e.inputs[r];o.indexed?null==t?n.push(null):"array"===o.baseType||"tuple"===o.baseType?$r.throwArgumentError("filtering with tuples or arrays not supported","contract."+o.name,t):Array.isArray(t)?n.push(t.map((function(e){return i(o,e)}))):n.push(i(o,t)):null!=t&&$r.throwArgumentError("cannot filter non-indexed parameters; must be null","contract."+o.name,t)}));n.length&&null===n[n.length-1];)n.pop();return n}},{key:"encodeEventLog",value:function(e,t){var r=this;"string"==typeof e&&(e=this.getEvent(e));var n=[],i=[],o=[];return e.anonymous||n.push(this.getEventTopic(e)),t.length!==e.inputs.length&&$r.throwArgumentError("event arguments/values mismatch","values",t),e.inputs.forEach((function(e,a){var s=t[a];if(e.indexed)if("string"===e.type)n.push(we(s));else if("bytes"===e.type)n.push(q(s));else{if("tuple"===e.baseType||"array"===e.baseType)throw new Error("not implemented");n.push(r._abiCoder.encode([e.type],[s]))}else i.push(e),o.push(s)})),{data:this._abiCoder.encode(i,o),topics:n}}},{key:"decodeEventLog",value:function(e,t,r){if("string"==typeof e&&(e=this.getEvent(e)),null!=r&&!e.anonymous){var n=this.getEventTopic(e);Object(c.l)(r[0],32)&&r[0].toLowerCase()===n||$r.throwError("fragment/topic mismatch",h.b.errors.INVALID_ARGUMENT,{argument:"topics[0]",expected:n,value:r[0]}),r=r.slice(1)}var i=[],o=[],a=[];e.inputs.forEach((function(e,t){e.indexed?"string"===e.type||"bytes"===e.type||"tuple"===e.baseType||"array"===e.baseType?(i.push(Br.fromObject({type:"bytes32",name:e.name})),a.push(!0)):(i.push(e),a.push(!1)):(o.push(e),a.push(!1))}));var s=null!=r?this._abiCoder.decode(i,Object(c.b)(r)):null,A=this._abiCoder.decode(o,t,!0),u=[],f=0,l=0;e.inputs.forEach((function(e,t){if(e.indexed)if(null==s)u[t]=new nn({_isIndexed:!0,hash:null});else if(a[t])u[t]=new nn({_isIndexed:!0,hash:s[l++]});else try{u[t]=s[l++]}catch(e){u[t]=e}else try{u[t]=A[f++]}catch(e){u[t]=e}if(e.name&&null==u[e.name]){var r=u[t];r instanceof Error?Object.defineProperty(u,e.name,{enumerable:!0,get:function(){throw an("property ".concat(JSON.stringify(e.name)),r)}}):u[e.name]=r}}));for(var g=function(e){var t=u[e];t instanceof Error&&Object.defineProperty(u,e,{enumerable:!0,get:function(){throw an("index ".concat(e),t)}})},d=0;d<u.length;d++)g(d);return Object.freeze(u)}},{key:"parseTransaction",value:function(e){var t=this.getFunction(e.data.substring(0,10).toLowerCase());return t?new tn({args:this._abiCoder.decode(t.inputs,"0x"+e.data.substring(10)),functionFragment:t,name:t.name,signature:t.format(),sighash:this.getSighash(t),value:y.from(e.value||"0")}):null}},{key:"parseLog",value:function(e){var t=this.getEvent(e.topics[0]);return!t||t.anonymous?null:new en({eventFragment:t,name:t.name,signature:t.format(),topic:this.getEventTopic(t),args:this.decodeEventLog(t,e.data,e.topics)})}},{key:"parseError",value:function(e){var t=Object(c.i)(e),r=this.getError(t.substring(0,10).toLowerCase());return r?new rn({args:this._abiCoder.decode(r.inputs,"0x"+t.substring(10)),errorFragment:r,name:r.name,signature:r.format(),sighash:this.getSighash(r)}):null}}],[{key:"getAbiCoder",value:function(){return Gr}},{key:"getAddress",value:function(e){return Ae(e)}},{key:"getSighash",value:function(e){return Object(c.e)(we(e.format()),0,4)}},{key:"getEventTopic",value:function(e){return we(e.format())}},{key:"isInterface",value:function(e){return!(!e||!e._isInterface)}}]),e}();function An(e){return(An="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function cn(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function un(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function fn(e,t,r){return t&&un(e.prototype,t),r&&un(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function hn(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&ln(e,t)}function ln(e,t){return(ln=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function gn(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=pn(e);if(t){var i=pn(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return dn(this,r)}}function dn(e,t){if(t&&("object"===An(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function pn(e){return(pn=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var In=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{A(n.next(e))}catch(e){o(e)}}function s(e){try{A(n.throw(e))}catch(e){o(e)}}function A(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}A((n=n.apply(e,t||[])).next())}))},yn=new h.b("abstract-provider/5.7.0"),bn=function(e){hn(r,e);var t=gn(r);function r(){return cn(this,r),t.apply(this,arguments)}return fn(r,null,[{key:"isForkEvent",value:function(e){return!(!e||!e._isForkEvent)}}]),r}(P),En=function(){function e(){cn(this,e),yn.checkAbstract(this instanceof e?this.constructor:void 0,e),_(this,"_isProvider",!0)}return fn(e,[{key:"getFeeData",value:function(){return In(this,void 0,void 0,regeneratorRuntime.mark((function e(){var t,r,n,i,o,a;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,D({block:this.getBlock("latest"),gasPrice:this.getGasPrice().catch((function(e){return null}))});case 2:return t=e.sent,r=t.block,n=t.gasPrice,i=null,o=null,a=null,r&&r.baseFeePerGas&&(i=r.baseFeePerGas,a=y.from("1500000000"),o=r.baseFeePerGas.mul(2).add(a)),e.abrupt("return",{lastBaseFeePerGas:i,maxFeePerGas:o,maxPriorityFeePerGas:a,gasPrice:n});case 8:case"end":return e.stop()}}),e,this)})))}},{key:"addListener",value:function(e,t){return this.on(e,t)}},{key:"removeListener",value:function(e,t){return this.off(e,t)}}],[{key:"isProvider",value:function(e){return!(!e||!e._isProvider)}}]),e}();function mn(e){return(mn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Cn(e,t){return(Cn=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function vn(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=Qn(e);if(t){var i=Qn(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return Bn(this,r)}}function Bn(e,t){if(t&&("object"===mn(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return wn(e)}function wn(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Qn(e){return(Qn=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function kn(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _n(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function Sn(e,t,r){return t&&_n(e.prototype,t),r&&_n(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}var Dn=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{A(n.next(e))}catch(e){o(e)}}function s(e){try{A(n.throw(e))}catch(e){o(e)}}function A(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}A((n=n.apply(e,t||[])).next())}))},Mn=new h.b("abstract-signer/5.7.0"),Rn=["accessList","ccipReadEnabled","chainId","customData","data","from","gasLimit","gasPrice","maxFeePerGas","maxPriorityFeePerGas","nonce","to","type","value"],xn=[h.b.errors.INSUFFICIENT_FUNDS,h.b.errors.NONCE_EXPIRED,h.b.errors.REPLACEMENT_UNDERPRICED],On=function(){function e(){kn(this,e),Mn.checkAbstract(this instanceof e?this.constructor:void 0,e),_(this,"_isSigner",!0)}return Sn(e,[{key:"getBalance",value:function(e){return Dn(this,void 0,void 0,regeneratorRuntime.mark((function t(){return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this._checkProvider("getBalance"),t.next=3,this.provider.getBalance(this.getAddress(),e);case 3:return t.abrupt("return",t.sent);case 4:case"end":return t.stop()}}),t,this)})))}},{key:"getTransactionCount",value:function(e){return Dn(this,void 0,void 0,regeneratorRuntime.mark((function t(){return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this._checkProvider("getTransactionCount"),t.next=3,this.provider.getTransactionCount(this.getAddress(),e);case 3:return t.abrupt("return",t.sent);case 4:case"end":return t.stop()}}),t,this)})))}},{key:"estimateGas",value:function(e){return Dn(this,void 0,void 0,regeneratorRuntime.mark((function t(){var r;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this._checkProvider("estimateGas"),t.next=3,D(this.checkTransaction(e));case 3:return r=t.sent,t.next=6,this.provider.estimateGas(r);case 6:return t.abrupt("return",t.sent);case 7:case"end":return t.stop()}}),t,this)})))}},{key:"call",value:function(e,t){return Dn(this,void 0,void 0,regeneratorRuntime.mark((function r(){var n;return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return this._checkProvider("call"),r.next=3,D(this.checkTransaction(e));case 3:return n=r.sent,r.next=6,this.provider.call(n,t);case 6:return r.abrupt("return",r.sent);case 7:case"end":return r.stop()}}),r,this)})))}},{key:"sendTransaction",value:function(e){return Dn(this,void 0,void 0,regeneratorRuntime.mark((function t(){var r,n;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this._checkProvider("sendTransaction"),t.next=3,this.populateTransaction(e);case 3:return r=t.sent,t.next=6,this.signTransaction(r);case 6:return n=t.sent,t.next=9,this.provider.sendTransaction(n);case 9:return t.abrupt("return",t.sent);case 10:case"end":return t.stop()}}),t,this)})))}},{key:"getChainId",value:function(){return Dn(this,void 0,void 0,regeneratorRuntime.mark((function e(){var t;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this._checkProvider("getChainId"),e.next=3,this.provider.getNetwork();case 3:return t=e.sent,e.abrupt("return",t.chainId);case 5:case"end":return e.stop()}}),e,this)})))}},{key:"getGasPrice",value:function(){return Dn(this,void 0,void 0,regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this._checkProvider("getGasPrice"),e.next=3,this.provider.getGasPrice();case 3:return e.abrupt("return",e.sent);case 4:case"end":return e.stop()}}),e,this)})))}},{key:"getFeeData",value:function(){return Dn(this,void 0,void 0,regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this._checkProvider("getFeeData"),e.next=3,this.provider.getFeeData();case 3:return e.abrupt("return",e.sent);case 4:case"end":return e.stop()}}),e,this)})))}},{key:"resolveName",value:function(e){return Dn(this,void 0,void 0,regeneratorRuntime.mark((function t(){return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this._checkProvider("resolveName"),t.next=3,this.provider.resolveName(e);case 3:return t.abrupt("return",t.sent);case 4:case"end":return t.stop()}}),t,this)})))}},{key:"checkTransaction",value:function(e){for(var t in e)-1===Rn.indexOf(t)&&Mn.throwArgumentError("invalid transaction key: "+t,"transaction",e);var r=R(e);return null==r.from?r.from=this.getAddress():r.from=Promise.all([Promise.resolve(r.from),this.getAddress()]).then((function(t){return t[0].toLowerCase()!==t[1].toLowerCase()&&Mn.throwArgumentError("from address mismatch","transaction",e),t[0]})),r}},{key:"populateTransaction",value:function(e){return Dn(this,void 0,void 0,regeneratorRuntime.mark((function t(){var r,n,i,o,a=this;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,D(this.checkTransaction(e));case 2:if(null!=(r=t.sent).to&&(r.to=Promise.resolve(r.to).then((function(e){return Dn(a,void 0,void 0,regeneratorRuntime.mark((function t(){var r;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(null!=e){t.next=2;break}return t.abrupt("return",null);case 2:return t.next=4,this.resolveName(e);case 4:return null==(r=t.sent)&&Mn.throwArgumentError("provided ENS name resolves to null","tx.to",e),t.abrupt("return",r);case 7:case"end":return t.stop()}}),t,this)})))})),r.to.catch((function(e){}))),n=null!=r.maxFeePerGas||null!=r.maxPriorityFeePerGas,null==r.gasPrice||2!==r.type&&!n?0!==r.type&&1!==r.type||!n||Mn.throwArgumentError("pre-eip-1559 transaction do not support maxFeePerGas/maxPriorityFeePerGas","transaction",e):Mn.throwArgumentError("eip-1559 transaction do not support gasPrice","transaction",e),2!==r.type&&null!=r.type||null==r.maxFeePerGas||null==r.maxPriorityFeePerGas){t.next=10;break}r.type=2,t.next=18;break;case 10:if(0!==r.type&&1!==r.type){t.next=14;break}null==r.gasPrice&&(r.gasPrice=this.getGasPrice()),t.next=18;break;case 14:return t.next=16,this.getFeeData();case 16:i=t.sent,null==r.type?null!=i.maxFeePerGas&&null!=i.maxPriorityFeePerGas?(r.type=2,null!=r.gasPrice?(o=r.gasPrice,delete r.gasPrice,r.maxFeePerGas=o,r.maxPriorityFeePerGas=o):(null==r.maxFeePerGas&&(r.maxFeePerGas=i.maxFeePerGas),null==r.maxPriorityFeePerGas&&(r.maxPriorityFeePerGas=i.maxPriorityFeePerGas))):null!=i.gasPrice?(n&&Mn.throwError("network does not support EIP-1559",h.b.errors.UNSUPPORTED_OPERATION,{operation:"populateTransaction"}),null==r.gasPrice&&(r.gasPrice=i.gasPrice),r.type=0):Mn.throwError("failed to get consistent fee data",h.b.errors.UNSUPPORTED_OPERATION,{operation:"signer.getFeeData"}):2===r.type&&(null==r.maxFeePerGas&&(r.maxFeePerGas=i.maxFeePerGas),null==r.maxPriorityFeePerGas&&(r.maxPriorityFeePerGas=i.maxPriorityFeePerGas));case 18:return null==r.nonce&&(r.nonce=this.getTransactionCount("pending")),null==r.gasLimit&&(r.gasLimit=this.estimateGas(r).catch((function(e){if(xn.indexOf(e.code)>=0)throw e;return Mn.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",h.b.errors.UNPREDICTABLE_GAS_LIMIT,{error:e,tx:r})}))),null==r.chainId?r.chainId=this.getChainId():r.chainId=Promise.all([Promise.resolve(r.chainId),this.getChainId()]).then((function(t){return 0!==t[1]&&t[0]!==t[1]&&Mn.throwArgumentError("chainId address mismatch","transaction",e),t[0]})),t.next=23,D(r);case 23:return t.abrupt("return",t.sent);case 24:case"end":return t.stop()}}),t,this)})))}},{key:"_checkProvider",value:function(e){this.provider||Mn.throwError("missing provider",h.b.errors.UNSUPPORTED_OPERATION,{operation:e||"_checkProvider"})}}],[{key:"isSigner",value:function(e){return!(!e||!e._isSigner)}}]),e}(),Nn=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Cn(e,t)}(r,e);var t=vn(r);function r(e,n){var i;return kn(this,r),_(wn(i=t.call(this)),"address",e),_(wn(i),"provider",n||null),i}return Sn(r,[{key:"getAddress",value:function(){return Promise.resolve(this.address)}},{key:"_fail",value:function(e,t){return Promise.resolve().then((function(){Mn.throwError(e,h.b.errors.UNSUPPORTED_OPERATION,{operation:t})}))}},{key:"signMessage",value:function(e){return this._fail("VoidSigner cannot sign messages","signMessage")}},{key:"signTransaction",value:function(e){return this._fail("VoidSigner cannot sign transactions","signTransaction")}},{key:"_signTypedData",value:function(e,t,r){return this._fail("VoidSigner cannot sign typed data","signTypedData")}},{key:"connect",value:function(e){return new r(this.address,e)}}]),r}(On),Pn=r(166);function Fn(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}var jn=new h.b("signing-key/5.7.0"),Tn=null;function Un(){return Tn||(Tn=new Pn.a("secp256k1")),Tn}var Ln=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),_(this,"curve","secp256k1"),_(this,"privateKey",Object(c.i)(t)),32!==Object(c.d)(this.privateKey)&&jn.throwArgumentError("invalid private key","privateKey","[[ REDACTED ]]");var r=Un().keyFromPrivate(Object(c.a)(this.privateKey));_(this,"publicKey","0x"+r.getPublic(!1,"hex")),_(this,"compressedPublicKey","0x"+r.getPublic(!0,"hex")),_(this,"_isSigningKey",!0)}var t,r,n;return t=e,n=[{key:"isSigningKey",value:function(e){return!(!e||!e._isSigningKey)}}],(r=[{key:"_addPoint",value:function(e){var t=Un().keyFromPublic(Object(c.a)(this.publicKey)),r=Un().keyFromPublic(Object(c.a)(e));return"0x"+t.pub.add(r.pub).encodeCompressed("hex")}},{key:"signDigest",value:function(e){var t=Un().keyFromPrivate(Object(c.a)(this.privateKey)),r=Object(c.a)(e);32!==r.length&&jn.throwArgumentError("bad digest length","digest",e);var n=t.sign(r,{canonical:!0});return Object(c.n)({recoveryParam:n.recoveryParam,r:Object(c.h)("0x"+n.r.toString(16),32),s:Object(c.h)("0x"+n.s.toString(16),32)})}},{key:"computeSharedSecret",value:function(e){var t=Un().keyFromPrivate(Object(c.a)(this.privateKey)),r=Un().keyFromPublic(Object(c.a)(Gn(e)));return Object(c.h)("0x"+t.derive(r.getPublic()).toString(16),32)}}])&&Fn(t.prototype,r),n&&Fn(t,n),Object.defineProperty(t,"prototype",{writable:!1}),e}();function Hn(e,t){var r=Object(c.n)(t),n={r:Object(c.a)(r.r),s:Object(c.a)(r.s)};return"0x"+Un().recoverPubKey(Object(c.a)(e),n,r.recoveryParam).encode("hex",!1)}function Gn(e,t){var r=Object(c.a)(e);if(32===r.length){var n=new Ln(r);return t?"0x"+Un().keyFromPrivate(r).getPublic(!0,"hex"):n.publicKey}return 33===r.length?t?Object(c.i)(r):"0x"+Un().keyFromPublic(r).getPublic(!1,"hex"):65===r.length?t?"0x"+Un().keyFromPublic(r).getPublic(!0,"hex"):Object(c.i)(r):jn.throwArgumentError("invalid public or private key","key","[REDACTED]")}var Yn,Kn=new h.b("transactions/5.7.0");function qn(e){return"0x"===e?null:Ae(e)}function Jn(e){return"0x"===e?Mt:y.from(e)}!function(e){e[e.legacy=0]="legacy",e[e.eip2930=1]="eip2930",e[e.eip1559=2]="eip1559"}(Yn||(Yn={}));var zn=[{name:"nonce",maxLength:32,numeric:!0},{name:"gasPrice",maxLength:32,numeric:!0},{name:"gasLimit",maxLength:32,numeric:!0},{name:"to",length:20},{name:"value",maxLength:32,numeric:!0},{name:"data"}],Vn={chainId:!0,data:!0,gasLimit:!0,gasPrice:!0,nonce:!0,to:!0,type:!0,value:!0};function Zn(e){var t=Gn(e);return Ae(Object(c.e)(q(Object(c.e)(t,1)),12))}function Wn(e,t){return Zn(Hn(Object(c.a)(e),t))}function Xn(e,t){var r=Object(c.o)(y.from(e).toHexString());return r.length>32&&Kn.throwArgumentError("invalid length for "+t,"transaction:"+t,e),r}function $n(e,t){return{address:Ae(e),storageKeys:(t||[]).map((function(t,r){return 32!==Object(c.d)(t)&&Kn.throwArgumentError("invalid access list storageKey","accessList[".concat(e,":").concat(r,"]"),t),t.toLowerCase()}))}}function ei(e){if(Array.isArray(e))return e.map((function(e,t){return Array.isArray(e)?(e.length>2&&Kn.throwArgumentError("access list expected to be [ address, storageKeys[] ]","value[".concat(t,"]"),e),$n(e[0],e[1])):$n(e.address,e.storageKeys)}));var t=Object.keys(e).map((function(t){var r=e[t].reduce((function(e,t){return e[t]=!0,e}),{});return $n(t,Object.keys(r).sort())}));return t.sort((function(e,t){return e.address.localeCompare(t.address)})),t}function ti(e){return ei(e).map((function(e){return[e.address,e.storageKeys]}))}function ri(e,t){if(null!=e.gasPrice){var r=y.from(e.gasPrice),n=y.from(e.maxFeePerGas||0);r.eq(n)||Kn.throwArgumentError("mismatch EIP-1559 gasPrice != maxFeePerGas","tx",{gasPrice:r,maxFeePerGas:n})}var i=[Xn(e.chainId||0,"chainId"),Xn(e.nonce||0,"nonce"),Xn(e.maxPriorityFeePerGas||0,"maxPriorityFeePerGas"),Xn(e.maxFeePerGas||0,"maxFeePerGas"),Xn(e.gasLimit||0,"gasLimit"),null!=e.to?Ae(e.to):"0x",Xn(e.value||0,"value"),e.data||"0x",ti(e.accessList||[])];if(t){var o=Object(c.n)(t);i.push(Xn(o.recoveryParam,"recoveryParam")),i.push(Object(c.o)(o.r)),i.push(Object(c.o)(o.s))}return Object(c.c)(["0x02",Z(i)])}function ni(e,t){var r=[Xn(e.chainId||0,"chainId"),Xn(e.nonce||0,"nonce"),Xn(e.gasPrice||0,"gasPrice"),Xn(e.gasLimit||0,"gasLimit"),null!=e.to?Ae(e.to):"0x",Xn(e.value||0,"value"),e.data||"0x",ti(e.accessList||[])];if(t){var n=Object(c.n)(t);r.push(Xn(n.recoveryParam,"recoveryParam")),r.push(Object(c.o)(n.r)),r.push(Object(c.o)(n.s))}return Object(c.c)(["0x01",Z(r)])}function ii(e,t){if(null==e.type||0===e.type)return null!=e.accessList&&Kn.throwArgumentError("untyped transactions do not support accessList; include type: 1","transaction",e),function(e,t){M(e,Vn);var r=[];zn.forEach((function(t){var n=e[t.name]||[],i={};t.numeric&&(i.hexPad="left"),n=Object(c.a)(Object(c.i)(n,i)),t.length&&n.length!==t.length&&n.length>0&&Kn.throwArgumentError("invalid length for "+t.name,"transaction:"+t.name,n),t.maxLength&&(n=Object(c.o)(n)).length>t.maxLength&&Kn.throwArgumentError("invalid length for "+t.name,"transaction:"+t.name,n),r.push(Object(c.i)(n))}));var n=0;if(null!=e.chainId?"number"!=typeof(n=e.chainId)&&Kn.throwArgumentError("invalid transaction.chainId","transaction",e):t&&!Object(c.k)(t)&&t.v>28&&(n=Math.floor((t.v-35)/2)),0!==n&&(r.push(Object(c.i)(n)),r.push("0x"),r.push("0x")),!t)return Z(r);var i=Object(c.n)(t),o=27+i.recoveryParam;return 0!==n?(r.pop(),r.pop(),r.pop(),o+=2*n+8,i.v>28&&i.v!==o&&Kn.throwArgumentError("transaction.chainId/signature.v mismatch","signature",t)):i.v!==o&&Kn.throwArgumentError("transaction.chainId/signature.v mismatch","signature",t),r.push(Object(c.i)(o)),r.push(Object(c.o)(Object(c.a)(i.r))),r.push(Object(c.o)(Object(c.a)(i.s))),Z(r)}(e,t);switch(e.type){case 1:return ni(e,t);case 2:return ri(e,t)}return Kn.throwError("unsupported transaction type: ".concat(e.type),h.b.errors.UNSUPPORTED_OPERATION,{operation:"serializeTransaction",transactionType:e.type})}function oi(e,t,r){try{var n=Jn(t[0]).toNumber();if(0!==n&&1!==n)throw new Error("bad recid");e.v=n}catch(e){Kn.throwArgumentError("invalid v for transaction type: 1","v",t[0])}e.r=Object(c.h)(t[1],32),e.s=Object(c.h)(t[2],32);try{var i=q(r(e));e.from=Wn(i,{r:e.r,s:e.s,recoveryParam:e.v})}catch(e){}}function ai(e){var t=Object(c.a)(e);if(t[0]>127)return function(e){var t=$(e);9!==t.length&&6!==t.length&&Kn.throwArgumentError("invalid raw transaction","rawTransaction",e);var r={nonce:Jn(t[0]).toNumber(),gasPrice:Jn(t[1]),gasLimit:Jn(t[2]),to:qn(t[3]),value:Jn(t[4]),data:t[5],chainId:0};if(6===t.length)return r;try{r.v=y.from(t[6]).toNumber()}catch(e){return r}if(r.r=Object(c.h)(t[7],32),r.s=Object(c.h)(t[8],32),y.from(r.r).isZero()&&y.from(r.s).isZero())r.chainId=r.v,r.v=0;else{r.chainId=Math.floor((r.v-35)/2),r.chainId<0&&(r.chainId=0);var n=r.v-27,i=t.slice(0,6);0!==r.chainId&&(i.push(Object(c.i)(r.chainId)),i.push("0x"),i.push("0x"),n-=2*r.chainId+8);var o=q(Z(i));try{r.from=Wn(o,{r:Object(c.i)(r.r),s:Object(c.i)(r.s),recoveryParam:n})}catch(e){}r.hash=q(e)}return r.type=null,r}(t);switch(t[0]){case 1:return function(e){var t=$(e.slice(1));8!==t.length&&11!==t.length&&Kn.throwArgumentError("invalid component count for transaction type: 1","payload",Object(c.i)(e));var r={type:1,chainId:Jn(t[0]).toNumber(),nonce:Jn(t[1]).toNumber(),gasPrice:Jn(t[2]),gasLimit:Jn(t[3]),to:qn(t[4]),value:Jn(t[5]),data:t[6],accessList:ei(t[7])};return 8===t.length||(r.hash=q(e),oi(r,t.slice(8),ni)),r}(t);case 2:return function(e){var t=$(e.slice(1));9!==t.length&&12!==t.length&&Kn.throwArgumentError("invalid component count for transaction type: 2","payload",Object(c.i)(e));var r=Jn(t[2]),n=Jn(t[3]),i={type:2,chainId:Jn(t[0]).toNumber(),nonce:Jn(t[1]).toNumber(),maxPriorityFeePerGas:r,maxFeePerGas:n,gasPrice:null,gasLimit:Jn(t[4]),to:qn(t[5]),value:Jn(t[6]),data:t[7],accessList:ei(t[8])};return 9===t.length||(i.hash=q(e),oi(i,t.slice(9),ri)),i}(t)}return Kn.throwError("unsupported transaction type: ".concat(t[0]),h.b.errors.UNSUPPORTED_OPERATION,{operation:"parseTransaction",transactionType:t[0]})}function si(e){return function(e){if(Array.isArray(e))return Ai(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return Ai(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Ai(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Ai(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function ci(){return(ci="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,r){var n=ui(e,t);if(n){var i=Object.getOwnPropertyDescriptor(n,t);return i.get?i.get.call(arguments.length<3?e:r):i.value}}).apply(this,arguments)}function ui(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=pi(e)););return e}function fi(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&hi(e,t)}function hi(e,t){return(hi=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function li(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=pi(e);if(t){var i=pi(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return gi(this,r)}}function gi(e,t){if(t&&("object"===Ei(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return di(e)}function di(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function pi(e){return(pi=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Ii(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function yi(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function bi(e,t,r){return t&&yi(e.prototype,t),r&&yi(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function Ei(e){return(Ei="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var mi=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{A(n.next(e))}catch(e){o(e)}}function s(e){try{A(n.throw(e))}catch(e){o(e)}}function A(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}A((n=n.apply(e,t||[])).next())}))},Ci=new h.b("contracts/5.7.0"),vi={chainId:!0,data:!0,from:!0,gasLimit:!0,gasPrice:!0,nonce:!0,to:!0,value:!0,type:!0,accessList:!0,maxFeePerGas:!0,maxPriorityFeePerGas:!0,customData:!0,ccipReadEnabled:!0};function Bi(e,t){return mi(this,void 0,void 0,regeneratorRuntime.mark((function r(){var n,i;return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,t;case 2:return"string"!=typeof(n=r.sent)&&Ci.throwArgumentError("invalid address or ENS name","name",n),r.prev=4,r.abrupt("return",Ae(n));case 8:r.prev=8,r.t0=r.catch(4);case 10:return e||Ci.throwError("a provider or signer is needed to resolve ENS names",h.b.errors.UNSUPPORTED_OPERATION,{operation:"resolveName"}),r.next=13,e.resolveName(n);case 13:return null==(i=r.sent)&&Ci.throwArgumentError("resolver or addr is not configured for ENS name","name",n),r.abrupt("return",i);case 16:case"end":return r.stop()}}),r,null,[[4,8]])})))}function wi(e,t,r){return mi(this,void 0,void 0,regeneratorRuntime.mark((function n(){return regeneratorRuntime.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(!Array.isArray(r)){n.next=4;break}return n.next=3,Promise.all(r.map((function(r,n){return wi(e,Array.isArray(t)?t[n]:t[r.name],r)})));case 3:return n.abrupt("return",n.sent);case 4:if("address"!==r.type){n.next=8;break}return n.next=7,Bi(e,t);case 7:return n.abrupt("return",n.sent);case 8:if("tuple"!==r.type){n.next=12;break}return n.next=11,wi(e,t,r.components);case 11:return n.abrupt("return",n.sent);case 12:if("array"!==r.baseType){n.next=18;break}if(Array.isArray(t)){n.next=15;break}return n.abrupt("return",Promise.reject(Ci.makeError("invalid value for array",h.b.errors.INVALID_ARGUMENT,{argument:"value",value:t})));case 15:return n.next=17,Promise.all(t.map((function(t){return wi(e,t,r.arrayChildren)})));case 17:return n.abrupt("return",n.sent);case 18:return n.abrupt("return",t);case 19:case"end":return n.stop()}}),n)})))}function Qi(e,t,r){return mi(this,void 0,void 0,regeneratorRuntime.mark((function n(){var i,o,a,s,A,u,f,l,g,d,p=this;return regeneratorRuntime.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return i={},r.length===t.inputs.length+1&&"object"===Ei(r[r.length-1])&&(i=R(r.pop())),Ci.checkArgumentCount(r.length,t.inputs.length,"passed to contract"),e.signer?i.from?i.from=D({override:Bi(e.signer,i.from),signer:e.signer.getAddress()}).then((function(e){return mi(p,void 0,void 0,regeneratorRuntime.mark((function t(){return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return Ae(e.signer)!==e.override&&Ci.throwError("Contract with a Signer cannot override from",h.b.errors.UNSUPPORTED_OPERATION,{operation:"overrides.from"}),t.abrupt("return",e.override);case 2:case"end":return t.stop()}}),t)})))})):i.from=e.signer.getAddress():i.from&&(i.from=Bi(e.provider,i.from)),n.next=6,D({args:wi(e.signer||e.provider,r,t.inputs),address:e.resolvedAddress,overrides:D(i)||{}});case 6:if(o=n.sent,a=e.interface.encodeFunctionData(t,o.args),s={data:a,to:o.address},null!=(A=o.overrides).nonce&&(s.nonce=y.from(A.nonce).toNumber()),null!=A.gasLimit&&(s.gasLimit=y.from(A.gasLimit)),null!=A.gasPrice&&(s.gasPrice=y.from(A.gasPrice)),null!=A.maxFeePerGas&&(s.maxFeePerGas=y.from(A.maxFeePerGas)),null!=A.maxPriorityFeePerGas&&(s.maxPriorityFeePerGas=y.from(A.maxPriorityFeePerGas)),null!=A.from&&(s.from=A.from),null!=A.type&&(s.type=A.type),null!=A.accessList&&(s.accessList=ei(A.accessList)),null==s.gasLimit&&null!=t.gas){for(u=21e3,f=Object(c.a)(a),l=0;l<f.length;l++)u+=4,f[l]&&(u+=64);s.gasLimit=y.from(t.gas).add(u)}return A.value&&((g=y.from(A.value)).isZero()||t.payable||Ci.throwError("non-payable method cannot override value",h.b.errors.UNSUPPORTED_OPERATION,{operation:"overrides.value",value:i.value}),s.value=g),A.customData&&(s.customData=R(A.customData)),A.ccipReadEnabled&&(s.ccipReadEnabled=!!A.ccipReadEnabled),delete i.nonce,delete i.gasLimit,delete i.gasPrice,delete i.from,delete i.value,delete i.type,delete i.accessList,delete i.maxFeePerGas,delete i.maxPriorityFeePerGas,delete i.customData,delete i.ccipReadEnabled,(d=Object.keys(i).filter((function(e){return null!=i[e]}))).length&&Ci.throwError("cannot override ".concat(d.map((function(e){return JSON.stringify(e)})).join(",")),h.b.errors.UNSUPPORTED_OPERATION,{operation:"overrides",overrides:d}),n.abrupt("return",s);case 36:case"end":return n.stop()}}),n)})))}function ki(e,t){var r=t.wait.bind(t);t.wait=function(t){return r(t).then((function(t){return t.events=t.logs.map((function(r){var n=N(r),i=null;try{i=e.interface.parseLog(r)}catch(e){}return i&&(n.args=i.args,n.decode=function(t,r){return e.interface.decodeEventLog(i.eventFragment,t,r)},n.event=i.name,n.eventSignature=i.signature),n.removeListener=function(){return e.provider},n.getBlock=function(){return e.provider.getBlock(t.blockHash)},n.getTransaction=function(){return e.provider.getTransaction(t.transactionHash)},n.getTransactionReceipt=function(){return Promise.resolve(t)},n})),t}))}}function _i(e,t,r){var n=e.signer||e.provider;return function(){for(var i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];return mi(this,void 0,void 0,regeneratorRuntime.mark((function i(){var a,s,A,c,u;return regeneratorRuntime.wrap((function(i){for(;;)switch(i.prev=i.next){case 0:if(a=void 0,o.length!==t.inputs.length+1||"object"!==Ei(o[o.length-1])){i.next=9;break}if(null==(s=R(o.pop())).blockTag){i.next=7;break}return i.next=6,s.blockTag;case 6:a=i.sent;case 7:delete s.blockTag,o.push(s);case 9:if(null==e.deployTransaction){i.next=12;break}return i.next=12,e._deployed(a);case 12:return i.next=14,Qi(e,t,o);case 14:return A=i.sent,i.next=17,n.call(A,a);case 17:return c=i.sent,i.prev=18,u=e.interface.decodeFunctionResult(t,c),r&&1===t.outputs.length&&(u=u[0]),i.abrupt("return",u);case 24:throw i.prev=24,i.t0=i.catch(18),i.t0.code===h.b.errors.CALL_EXCEPTION&&(i.t0.address=e.address,i.t0.args=o,i.t0.transaction=A),i.t0;case 28:case"end":return i.stop()}}),i,null,[[18,24]])})))}}function Si(e,t,r){return t.constant?_i(e,t,r):function(e,t){return function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return mi(this,void 0,void 0,regeneratorRuntime.mark((function r(){var i,o;return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(e.signer||Ci.throwError("sending a transaction requires a signer",h.b.errors.UNSUPPORTED_OPERATION,{operation:"sendTransaction"}),null==e.deployTransaction){r.next=4;break}return r.next=4,e._deployed();case 4:return r.next=6,Qi(e,t,n);case 6:return i=r.sent,r.next=9,e.signer.sendTransaction(i);case 9:return o=r.sent,ki(e,o),r.abrupt("return",o);case 12:case"end":return r.stop()}}),r)})))}}(e,t)}function Di(e){return!e.address||null!=e.topics&&0!==e.topics.length?(e.address||"*")+"@"+(e.topics?e.topics.map((function(e){return Array.isArray(e)?e.join("|"):e})).join(":"):""):"*"}var Mi=function(){function e(t,r){Ii(this,e),_(this,"tag",t),_(this,"filter",r),this._listeners=[]}return bi(e,[{key:"addListener",value:function(e,t){this._listeners.push({listener:e,once:t})}},{key:"removeListener",value:function(e){var t=!1;this._listeners=this._listeners.filter((function(r){return!(!t&&r.listener===e)||(t=!0,!1)}))}},{key:"removeAllListeners",value:function(){this._listeners=[]}},{key:"listeners",value:function(){return this._listeners.map((function(e){return e.listener}))}},{key:"listenerCount",value:function(){return this._listeners.length}},{key:"run",value:function(e){var t=this,r=this.listenerCount();return this._listeners=this._listeners.filter((function(r){var n=e.slice();return setTimeout((function(){r.listener.apply(t,n)}),0),!r.once})),r}},{key:"prepareEvent",value:function(e){}},{key:"getEmit",value:function(e){return[e]}}]),e}(),Ri=function(e){fi(r,e);var t=li(r);function r(){return Ii(this,r),t.call(this,"error",null)}return bi(r)}(Mi),xi=function(e){fi(r,e);var t=li(r);function r(e,n,i,o){var a;Ii(this,r);var s={address:e},A=n.getEventTopic(i);return o?(A!==o[0]&&Ci.throwArgumentError("topic mismatch","topics",o),s.topics=o.slice()):s.topics=[A],_(di(a=t.call(this,Di(s),s)),"address",e),_(di(a),"interface",n),_(di(a),"fragment",i),a}return bi(r,[{key:"prepareEvent",value:function(e){var t=this;ci(pi(r.prototype),"prepareEvent",this).call(this,e),e.event=this.fragment.name,e.eventSignature=this.fragment.format(),e.decode=function(e,r){return t.interface.decodeEventLog(t.fragment,e,r)};try{e.args=this.interface.decodeEventLog(this.fragment,e.data,e.topics)}catch(t){e.args=null,e.decodeError=t}}},{key:"getEmit",value:function(e){var t=function(e){var t=[];return function e(r,n){if(Array.isArray(n))for(var i in n){var o=r.slice();o.push(i);try{e(o,n[i])}catch(e){t.push({path:o,error:e})}}}([],e),t}(e.args);if(t.length)throw t[0].error;var r=(e.args||[]).slice();return r.push(e),r}}]),r}(Mi),Oi=function(e){fi(r,e);var t=li(r);function r(e,n){var i;return Ii(this,r),_(di(i=t.call(this,"*",{address:e})),"address",e),_(di(i),"interface",n),i}return bi(r,[{key:"prepareEvent",value:function(e){var t=this;ci(pi(r.prototype),"prepareEvent",this).call(this,e);try{var n=this.interface.parseLog(e);e.event=n.name,e.eventSignature=n.signature,e.decode=function(e,r){return t.interface.decodeEventLog(n.eventFragment,e,r)},e.args=n.args}catch(e){}}}]),r}(Mi),Ni=function(){function e(t,r,n){var i=this;Ii(this,e),_(this,"interface",S(this instanceof e?this.constructor:void 0,"getInterface")(r)),null==n?(_(this,"provider",null),_(this,"signer",null)):On.isSigner(n)?(_(this,"provider",n.provider||null),_(this,"signer",n)):En.isProvider(n)?(_(this,"provider",n),_(this,"signer",null)):Ci.throwArgumentError("invalid signer or provider","signerOrProvider",n),_(this,"callStatic",{}),_(this,"estimateGas",{}),_(this,"functions",{}),_(this,"populateTransaction",{}),_(this,"filters",{});var o={};if(Object.keys(this.interface.events).forEach((function(e){var t=i.interface.events[e];_(i.filters,e,(function(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];return{address:i.address,topics:i.interface.encodeFilterTopics(t,r)}})),o[t.name]||(o[t.name]=[]),o[t.name].push(e)})),Object.keys(o).forEach((function(e){var t=o[e];1===t.length?_(i.filters,e,i.filters[t[0]]):Ci.warn("Duplicate definition of ".concat(e," (").concat(t.join(", "),")"))})),_(this,"_runningEvents",{}),_(this,"_wrappedEmits",{}),null==t&&Ci.throwArgumentError("invalid contract address or ENS name","addressOrName",t),_(this,"address",t),this.provider)_(this,"resolvedAddress",Bi(this.provider,t));else try{_(this,"resolvedAddress",Promise.resolve(Ae(t)))}catch(e){Ci.throwError("provider is required to use ENS name as contract address",h.b.errors.UNSUPPORTED_OPERATION,{operation:"new Contract"})}this.resolvedAddress.catch((function(e){}));var a={},s={};Object.keys(this.interface.functions).forEach((function(e){var t=i.interface.functions[e];if(s[e])Ci.warn("Duplicate ABI entry for ".concat(JSON.stringify(e)));else{s[e]=!0;var r=t.name;a["%".concat(r)]||(a["%".concat(r)]=[]),a["%".concat(r)].push(e),null==i[e]&&_(i,e,Si(i,t,!0)),null==i.functions[e]&&_(i.functions,e,Si(i,t,!1)),null==i.callStatic[e]&&_(i.callStatic,e,_i(i,t,!0)),null==i.populateTransaction[e]&&_(i.populateTransaction,e,function(e,t){return function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return Qi(e,t,n)}}(i,t)),null==i.estimateGas[e]&&_(i.estimateGas,e,function(e,t){var r=e.signer||e.provider;return function(){for(var n=arguments.length,i=new Array(n),o=0;o<n;o++)i[o]=arguments[o];return mi(this,void 0,void 0,regeneratorRuntime.mark((function n(){var o;return regeneratorRuntime.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return r||Ci.throwError("estimate require a provider or signer",h.b.errors.UNSUPPORTED_OPERATION,{operation:"estimateGas"}),n.next=3,Qi(e,t,i);case 3:return o=n.sent,n.next=6,r.estimateGas(o);case 6:return n.abrupt("return",n.sent);case 7:case"end":return n.stop()}}),n)})))}}(i,t))}})),Object.keys(a).forEach((function(e){var t=a[e];if(!(t.length>1)){e=e.substring(1);var r=t[0];try{null==i[e]&&_(i,e,i[r])}catch(e){}null==i.functions[e]&&_(i.functions,e,i.functions[r]),null==i.callStatic[e]&&_(i.callStatic,e,i.callStatic[r]),null==i.populateTransaction[e]&&_(i.populateTransaction,e,i.populateTransaction[r]),null==i.estimateGas[e]&&_(i.estimateGas,e,i.estimateGas[r])}}))}return bi(e,[{key:"deployed",value:function(){return this._deployed()}},{key:"_deployed",value:function(e){var t=this;return this._deployedPromise||(this.deployTransaction?this._deployedPromise=this.deployTransaction.wait().then((function(){return t})):this._deployedPromise=this.provider.getCode(this.address,e).then((function(e){return"0x"===e&&Ci.throwError("contract not deployed",h.b.errors.UNSUPPORTED_OPERATION,{contractAddress:t.address,operation:"getDeployed"}),t}))),this._deployedPromise}},{key:"fallback",value:function(e){var t=this;this.signer||Ci.throwError("sending a transactions require a signer",h.b.errors.UNSUPPORTED_OPERATION,{operation:"sendTransaction(fallback)"});var r=R(e||{});return["from","to"].forEach((function(e){null!=r[e]&&Ci.throwError("cannot override "+e,h.b.errors.UNSUPPORTED_OPERATION,{operation:e})})),r.to=this.resolvedAddress,this.deployed().then((function(){return t.signer.sendTransaction(r)}))}},{key:"connect",value:function(e){"string"==typeof e&&(e=new Nn(e,this.provider));var t=new this.constructor(this.address,this.interface,e);return this.deployTransaction&&_(t,"deployTransaction",this.deployTransaction),t}},{key:"attach",value:function(e){return new this.constructor(e,this.interface,this.signer||this.provider)}},{key:"_normalizeRunningEvent",value:function(e){return this._runningEvents[e.tag]?this._runningEvents[e.tag]:e}},{key:"_getRunningEvent",value:function(e){if("string"==typeof e){if("error"===e)return this._normalizeRunningEvent(new Ri);if("event"===e)return this._normalizeRunningEvent(new Mi("event",null));if("*"===e)return this._normalizeRunningEvent(new Oi(this.address,this.interface));var t=this.interface.getEvent(e);return this._normalizeRunningEvent(new xi(this.address,this.interface,t))}if(e.topics&&e.topics.length>0){try{var r=e.topics[0];if("string"!=typeof r)throw new Error("invalid topic");var n=this.interface.getEvent(r);return this._normalizeRunningEvent(new xi(this.address,this.interface,n,e.topics))}catch(e){}var i={address:this.address,topics:e.topics};return this._normalizeRunningEvent(new Mi(Di(i),i))}return this._normalizeRunningEvent(new Oi(this.address,this.interface))}},{key:"_checkRunningEvents",value:function(e){if(0===e.listenerCount()){delete this._runningEvents[e.tag];var t=this._wrappedEmits[e.tag];t&&e.filter&&(this.provider.off(e.filter,t),delete this._wrappedEmits[e.tag])}}},{key:"_wrapEvent",value:function(e,t,r){var n=this,i=N(t);return i.removeListener=function(){r&&(e.removeListener(r),n._checkRunningEvents(e))},i.getBlock=function(){return n.provider.getBlock(t.blockHash)},i.getTransaction=function(){return n.provider.getTransaction(t.transactionHash)},i.getTransactionReceipt=function(){return n.provider.getTransactionReceipt(t.transactionHash)},e.prepareEvent(i),i}},{key:"_addEventListener",value:function(e,t,r){var n=this;if(this.provider||Ci.throwError("events require a provider or a signer with a provider",h.b.errors.UNSUPPORTED_OPERATION,{operation:"once"}),e.addListener(t,r),this._runningEvents[e.tag]=e,!this._wrappedEmits[e.tag]){var i=function(r){var i=n._wrapEvent(e,r,t);if(null==i.decodeError)try{var o=e.getEmit(i);n.emit.apply(n,[e.filter].concat(si(o)))}catch(e){i.decodeError=e.error}null!=e.filter&&n.emit("event",i),null!=i.decodeError&&n.emit("error",i.decodeError,i)};this._wrappedEmits[e.tag]=i,null!=e.filter&&this.provider.on(e.filter,i)}}},{key:"queryFilter",value:function(e,t,r){var n=this,i=this._getRunningEvent(e),o=R(i.filter);return"string"==typeof t&&Object(c.l)(t,32)?(null!=r&&Ci.throwArgumentError("cannot specify toBlock with blockhash","toBlock",r),o.blockHash=t):(o.fromBlock=null!=t?t:0,o.toBlock=null!=r?r:"latest"),this.provider.getLogs(o).then((function(e){return e.map((function(e){return n._wrapEvent(i,e,null)}))}))}},{key:"on",value:function(e,t){return this._addEventListener(this._getRunningEvent(e),t,!1),this}},{key:"once",value:function(e,t){return this._addEventListener(this._getRunningEvent(e),t,!0),this}},{key:"emit",value:function(e){if(!this.provider)return!1;for(var t=this._getRunningEvent(e),r=arguments.length,n=new Array(r>1?r-1:0),i=1;i<r;i++)n[i-1]=arguments[i];var o=t.run(n)>0;return this._checkRunningEvents(t),o}},{key:"listenerCount",value:function(e){var t=this;return this.provider?null==e?Object.keys(this._runningEvents).reduce((function(e,r){return e+t._runningEvents[r].listenerCount()}),0):this._getRunningEvent(e).listenerCount():0}},{key:"listeners",value:function(e){var t=this;if(!this.provider)return[];if(null==e){var r=function(){var e=[];for(var r in t._runningEvents)t._runningEvents[r].listeners().forEach((function(t){e.push(t)}));return{v:e}}();if("object"===Ei(r))return r.v}return this._getRunningEvent(e).listeners()}},{key:"removeAllListeners",value:function(e){if(!this.provider)return this;if(null==e){for(var t in this._runningEvents){var r=this._runningEvents[t];r.removeAllListeners(),this._checkRunningEvents(r)}return this}var n=this._getRunningEvent(e);return n.removeAllListeners(),this._checkRunningEvents(n),this}},{key:"off",value:function(e,t){if(!this.provider)return this;var r=this._getRunningEvent(e);return r.removeListener(t),this._checkRunningEvents(r),this}},{key:"removeListener",value:function(e,t){return this.off(e,t)}}],[{key:"getContractAddress",value:function(e){return fe(e)}},{key:"getInterface",value:function(e){return sn.isInterface(e)?e:new sn(e)}},{key:"isIndexed",value:function(e){return nn.isIndexed(e)}}]),e}(),Pi=function(e){fi(r,e);var t=li(r);function r(){return Ii(this,r),t.apply(this,arguments)}return bi(r)}(Ni),Fi=function(){function e(t,r,n){Ii(this,e);var i=null;"0x"!==(i="string"==typeof r?r:Object(c.j)(r)?Object(c.i)(r):r&&"string"==typeof r.object?r.object:"!").substring(0,2)&&(i="0x"+i),(!Object(c.l)(i)||i.length%2)&&Ci.throwArgumentError("invalid bytecode","bytecode",r),n&&!On.isSigner(n)&&Ci.throwArgumentError("invalid signer","signer",n),_(this,"bytecode",i),_(this,"interface",S(this instanceof e?this.constructor:void 0,"getInterface")(t)),_(this,"signer",n||null)}return bi(e,[{key:"getDeployTransaction",value:function(){for(var e={},t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];if(r.length===this.interface.deploy.inputs.length+1&&"object"===Ei(r[r.length-1]))for(var i in e=R(r.pop()))if(!vi[i])throw new Error("unknown transaction override "+i);if(["data","from","to"].forEach((function(t){null!=e[t]&&Ci.throwError("cannot override "+t,h.b.errors.UNSUPPORTED_OPERATION,{operation:t})})),e.value){var o=y.from(e.value);o.isZero()||this.interface.deploy.payable||Ci.throwError("non-payable constructor cannot override value",h.b.errors.UNSUPPORTED_OPERATION,{operation:"overrides.value",value:e.value})}return Ci.checkArgumentCount(r.length,this.interface.deploy.inputs.length," in Contract constructor"),e.data=Object(c.i)(Object(c.b)([this.bytecode,this.interface.encodeDeploy(r)])),e}},{key:"deploy",value:function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return mi(this,void 0,void 0,regeneratorRuntime.mark((function e(){var r,n,i,o,a,s;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r={},t.length===this.interface.deploy.inputs.length+1&&(r=t.pop()),Ci.checkArgumentCount(t.length,this.interface.deploy.inputs.length," in Contract constructor"),e.next=5,wi(this.signer,t,this.interface.deploy.inputs);case 5:return(n=e.sent).push(r),i=this.getDeployTransaction.apply(this,si(n)),e.next=10,this.signer.sendTransaction(i);case 10:return o=e.sent,a=S(this.constructor,"getContractAddress")(o),ki(s=S(this.constructor,"getContract")(a,this.interface,this.signer),o),_(s,"deployTransaction",o),e.abrupt("return",s);case 16:case"end":return e.stop()}}),e,this)})))}},{key:"attach",value:function(e){return this.constructor.getContract(e,this.interface,this.signer)}},{key:"connect",value:function(e){return new this.constructor(this.interface,this.bytecode,e)}}],[{key:"fromSolidity",value:function(e,t){null==e&&Ci.throwError("missing compiler output",h.b.errors.MISSING_ARGUMENT,{argument:"compilerOutput"}),"string"==typeof e&&(e=JSON.parse(e));var r=e.abi,n=null;return e.bytecode?n=e.bytecode:e.evm&&e.evm.bytecode&&(n=e.evm.bytecode),new this(r,n,t)}},{key:"getInterface",value:function(e){return Pi.getInterface(e)}},{key:"getContractAddress",value:function(e){return fe(e)}},{key:"getContract",value:function(e,t,r){return new Pi(e,t,r)}}]),e}();function ji(e){return(ji="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Ti(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Ui(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function Li(e,t,r){return t&&Ui(e.prototype,t),r&&Ui(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}var Hi=new h.b("bignumber/5.7.0"),Gi={},Yi=y.from(0),Ki=y.from(-1);function qi(e,t,r,n){var i={fault:t,operation:r};return void 0!==n&&(i.value=n),Hi.throwError(e,h.b.errors.NUMERIC_FAULT,i)}for(var Ji="0";Ji.length<256;)Ji+=Ji;function zi(e){if("number"!=typeof e)try{e=y.from(e).toNumber()}catch(e){}return"number"==typeof e&&e>=0&&e<=256&&!(e%1)?"1"+Ji.substring(0,e):Hi.throwArgumentError("invalid decimal size","decimals",e)}function Vi(e,t){null==t&&(t=0);var r=zi(t),n=(e=y.from(e)).lt(Yi);n&&(e=e.mul(Ki));for(var i=e.mod(r).toString();i.length<r.length-1;)i="0"+i;i=i.match(/^([0-9]*[1-9]|0)(0*)/)[1];var o=e.div(r).toString();return e=1===r.length?o:o+"."+i,n&&(e="-"+e),e}function Zi(e,t){null==t&&(t=0);var r=zi(t);"string"==typeof e&&e.match(/^-?[0-9.]+$/)||Hi.throwArgumentError("invalid decimal value","value",e);var n="-"===e.substring(0,1);n&&(e=e.substring(1)),"."===e&&Hi.throwArgumentError("missing value","value",e);var i=e.split(".");i.length>2&&Hi.throwArgumentError("too many decimal points","value",e);var o=i[0],a=i[1];for(o||(o="0"),a||(a="0");"0"===a[a.length-1];)a=a.substring(0,a.length-1);for(a.length>r.length-1&&qi("fractional component exceeds decimals","underflow","parseFixed"),""===a&&(a="0");a.length<r.length-1;)a+="0";var s=y.from(o),A=y.from(a),c=s.mul(r).add(A);return n&&(c=c.mul(Ki)),c}var Wi=function(){function e(t,r,n,i){Ti(this,e),t!==Gi&&Hi.throwError("cannot use FixedFormat constructor; use FixedFormat.from",h.b.errors.UNSUPPORTED_OPERATION,{operation:"new FixedFormat"}),this.signed=r,this.width=n,this.decimals=i,this.name=(r?"":"u")+"fixed"+String(n)+"x"+String(i),this._multiplier=zi(i),Object.freeze(this)}return Li(e,null,[{key:"from",value:function(t){if(t instanceof e)return t;"number"==typeof t&&(t="fixed128x".concat(t));var r=!0,n=128,i=18;if("string"==typeof t)if("fixed"===t);else if("ufixed"===t)r=!1;else{var o=t.match(/^(u?)fixed([0-9]+)x([0-9]+)$/);o||Hi.throwArgumentError("invalid fixed format","format",t),r="u"!==o[1],n=parseInt(o[2]),i=parseInt(o[3])}else if(t){var a=function(e,r,n){return null==t[e]?n:(ji(t[e])!==r&&Hi.throwArgumentError("invalid fixed format ("+e+" not "+r+")","format."+e,t[e]),t[e])};r=a("signed","boolean",r),n=a("width","number",n),i=a("decimals","number",i)}return n%8&&Hi.throwArgumentError("invalid fixed format width (not byte aligned)","format.width",n),i>80&&Hi.throwArgumentError("invalid fixed format (decimals too large)","format.decimals",i),new e(Gi,r,n,i)}}]),e}(),Xi=function(){function e(t,r,n,i){Ti(this,e),t!==Gi&&Hi.throwError("cannot use FixedNumber constructor; use FixedNumber.from",h.b.errors.UNSUPPORTED_OPERATION,{operation:"new FixedFormat"}),this.format=i,this._hex=r,this._value=n,this._isFixedNumber=!0,Object.freeze(this)}return Li(e,[{key:"_checkFormat",value:function(e){this.format.name!==e.format.name&&Hi.throwArgumentError("incompatible format; use fixedNumber.toFormat","other",e)}},{key:"addUnsafe",value:function(t){this._checkFormat(t);var r=Zi(this._value,this.format.decimals),n=Zi(t._value,t.format.decimals);return e.fromValue(r.add(n),this.format.decimals,this.format)}},{key:"subUnsafe",value:function(t){this._checkFormat(t);var r=Zi(this._value,this.format.decimals),n=Zi(t._value,t.format.decimals);return e.fromValue(r.sub(n),this.format.decimals,this.format)}},{key:"mulUnsafe",value:function(t){this._checkFormat(t);var r=Zi(this._value,this.format.decimals),n=Zi(t._value,t.format.decimals);return e.fromValue(r.mul(n).div(this.format._multiplier),this.format.decimals,this.format)}},{key:"divUnsafe",value:function(t){this._checkFormat(t);var r=Zi(this._value,this.format.decimals),n=Zi(t._value,t.format.decimals);return e.fromValue(r.mul(this.format._multiplier).div(n),this.format.decimals,this.format)}},{key:"floor",value:function(){var t=this.toString().split(".");1===t.length&&t.push("0");var r=e.from(t[0],this.format),n=!t[1].match(/^(0*)$/);return this.isNegative()&&n&&(r=r.subUnsafe($i.toFormat(r.format))),r}},{key:"ceiling",value:function(){var t=this.toString().split(".");1===t.length&&t.push("0");var r=e.from(t[0],this.format),n=!t[1].match(/^(0*)$/);return!this.isNegative()&&n&&(r=r.addUnsafe($i.toFormat(r.format))),r}},{key:"round",value:function(t){null==t&&(t=0);var r=this.toString().split(".");if(1===r.length&&r.push("0"),(t<0||t>80||t%1)&&Hi.throwArgumentError("invalid decimal count","decimals",t),r[1].length<=t)return this;var n=e.from("1"+Ji.substring(0,t),this.format),i=eo.toFormat(this.format);return this.mulUnsafe(n).addUnsafe(i).floor().divUnsafe(n)}},{key:"isZero",value:function(){return"0.0"===this._value||"0"===this._value}},{key:"isNegative",value:function(){return"-"===this._value[0]}},{key:"toString",value:function(){return this._value}},{key:"toHexString",value:function(e){if(null==e)return this._hex;e%8&&Hi.throwArgumentError("invalid byte width","width",e);var t=y.from(this._hex).fromTwos(this.format.width).toTwos(e).toHexString();return Object(c.h)(t,e/8)}},{key:"toUnsafeFloat",value:function(){return parseFloat(this.toString())}},{key:"toFormat",value:function(t){return e.fromString(this._value,t)}}],[{key:"fromValue",value:function(t,r,n){return null!=n||null==r||function(e){return null!=e&&(y.isBigNumber(e)||"number"==typeof e&&e%1==0||"string"==typeof e&&!!e.match(/^-?[0-9]+$/)||Object(c.l)(e)||"bigint"==typeof e||Object(c.j)(e))}(r)||(n=r,r=null),null==r&&(r=0),null==n&&(n="fixed"),e.fromString(Vi(t,r),Wi.from(n))}},{key:"fromString",value:function(t,r){null==r&&(r="fixed");var n=Wi.from(r),i=Zi(t,n.decimals);!n.signed&&i.lt(Yi)&&qi("unsigned value cannot be negative","overflow","value",t);var o=null;n.signed?o=i.toTwos(n.width).toHexString():(o=i.toHexString(),o=Object(c.h)(o,n.width/8));var a=Vi(i,n.decimals);return new e(Gi,o,a,n)}},{key:"fromBytes",value:function(t,r){null==r&&(r="fixed");var n=Wi.from(r);if(Object(c.a)(t).length>n.width/8)throw new Error("overflow");var i=y.from(t);n.signed&&(i=i.fromTwos(n.width));var o=i.toTwos((n.signed?0:1)+n.width).toHexString(),a=Vi(i,n.decimals);return new e(Gi,o,a,n)}},{key:"from",value:function(t,r){if("string"==typeof t)return e.fromString(t,r);if(Object(c.j)(t))return e.fromBytes(t,r);try{return e.fromValue(t,0,r)}catch(e){if(e.code!==h.b.errors.INVALID_ARGUMENT)throw e}return Hi.throwArgumentError("invalid FixedNumber value","value",t)}},{key:"isFixedNumber",value:function(e){return!(!e||!e._isFixedNumber)}}]),e}(),$i=Xi.from(1),eo=Xi.from("0.5");function to(e){return"string"==typeof e&&(e=be(e)),q(Object(c.b)([be("Ethereum Signed Message:\n"),be(String(e.length)),e]))}function ro(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}var no=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{A(n.next(e))}catch(e){o(e)}}function s(e){try{A(n.throw(e))}catch(e){o(e)}}function A(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}A((n=n.apply(e,t||[])).next())}))},io=new h.b("hash/5.7.0"),oo=new Uint8Array(32);oo.fill(0);var ao=y.from(-1),so=y.from(0),Ao=y.from(1),co=y.from("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");var uo=Object(c.h)(Ao.toHexString(),32),fo=Object(c.h)(so.toHexString(),32),ho={name:"string",version:"string",chainId:"uint256",verifyingContract:"address",salt:"bytes32"},lo=["name","version","chainId","verifyingContract","salt"];function go(e){return function(t){return"string"!=typeof t&&io.throwArgumentError("invalid domain value for ".concat(JSON.stringify(e)),"domain.".concat(e),t),t}}var po={name:go("name"),version:go("version"),chainId:function(e){try{return y.from(e).toString()}catch(e){}return io.throwArgumentError('invalid domain value for "chainId"',"domain.chainId",e)},verifyingContract:function(e){try{return Ae(e).toLowerCase()}catch(e){}return io.throwArgumentError('invalid domain value "verifyingContract"',"domain.verifyingContract",e)},salt:function(e){try{var t=Object(c.a)(e);if(32!==t.length)throw new Error("bad length");return Object(c.i)(t)}catch(e){}return io.throwArgumentError('invalid domain value "salt"',"domain.salt",e)}};function Io(e){var t=e.match(/^(u?)int(\d*)$/);if(t){var r=""===t[1],n=parseInt(t[2]||"256");(n%8!=0||n>256||t[2]&&t[2]!==String(n))&&io.throwArgumentError("invalid numeric width","type",e);var i=co.mask(r?n-1:n),o=r?i.add(Ao).mul(ao):so;return function(t){var r=y.from(t);return(r.lt(o)||r.gt(i))&&io.throwArgumentError("value out-of-bounds for ".concat(e),"value",t),Object(c.h)(r.toTwos(256).toHexString(),32)}}var a=e.match(/^bytes(\d+)$/);if(a){var s=parseInt(a[1]);return(0===s||s>32||a[1]!==String(s))&&io.throwArgumentError("invalid bytes width","type",e),function(t){return Object(c.a)(t).length!==s&&io.throwArgumentError("invalid length for ".concat(e),"value",t),function(e){var t=Object(c.a)(e),r=t.length%32;return r?Object(c.c)([t,oo.slice(r)]):Object(c.i)(t)}(t)}}switch(e){case"address":return function(e){return Object(c.h)(Ae(e),32)};case"bool":return function(e){return e?uo:fo};case"bytes":return function(e){return q(e)};case"string":return function(e){return we(e)}}return null}function yo(e,t){return"".concat(e,"(").concat(t.map((function(e){var t=e.name;return e.type+" "+t})).join(","),")")}var bo=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),_(this,"types",Object.freeze(N(t))),_(this,"_encoderCache",{}),_(this,"_types",{});var r={},n={},i={};Object.keys(t).forEach((function(e){r[e]={},n[e]=[],i[e]={}}));var o=function(e){var i={};t[e].forEach((function(o){i[o.name]&&io.throwArgumentError("duplicate variable name ".concat(JSON.stringify(o.name)," in ").concat(JSON.stringify(e)),"types",t),i[o.name]=!0;var a=o.type.match(/^([^\x5b]*)(\x5b|$)/)[1];a===e&&io.throwArgumentError("circular type reference to ".concat(JSON.stringify(a)),"types",t),Io(a)||(n[a]||io.throwArgumentError("unknown type ".concat(JSON.stringify(a)),"types",t),n[a].push(e),r[e][a]=!0)}))};for(var a in t)o(a);var s=Object.keys(n).filter((function(e){return 0===n[e].length}));for(var A in 0===s.length?io.throwArgumentError("missing primary type","types",t):s.length>1&&io.throwArgumentError("ambiguous primary types or unused types: ".concat(s.map((function(e){return JSON.stringify(e)})).join(", ")),"types",t),_(this,"primaryType",s[0]),function e(o,a){a[o]&&io.throwArgumentError("circular type reference to ".concat(JSON.stringify(o)),"types",t),a[o]=!0,Object.keys(r[o]).forEach((function(t){n[t]&&(e(t,a),Object.keys(a).forEach((function(e){i[e][t]=!0})))})),delete a[o]}(this.primaryType,{}),i){var c=Object.keys(i[A]);c.sort(),this._types[A]=yo(A,t[A])+c.map((function(e){return yo(e,t[e])})).join("")}}var t,r,n;return t=e,n=[{key:"from",value:function(t){return new e(t)}},{key:"getPrimaryType",value:function(t){return e.from(t).primaryType}},{key:"hashStruct",value:function(t,r,n){return e.from(r).hashStruct(t,n)}},{key:"hashDomain",value:function(t){var r=[];for(var n in t){var i=ho[n];i||io.throwArgumentError("invalid typed-data domain key: ".concat(JSON.stringify(n)),"domain",t),r.push({name:n,type:i})}return r.sort((function(e,t){return lo.indexOf(e.name)-lo.indexOf(t.name)})),e.hashStruct("EIP712Domain",{EIP712Domain:r},t)}},{key:"encode",value:function(t,r,n){return Object(c.c)(["0x1901",e.hashDomain(t),e.from(r).hash(n)])}},{key:"hash",value:function(t,r,n){return q(e.encode(t,r,n))}},{key:"resolveNames",value:function(t,r,n,i){return no(this,void 0,void 0,regeneratorRuntime.mark((function o(){var a,s,A;return regeneratorRuntime.wrap((function(o){for(;;)switch(o.prev=o.next){case 0:t=R(t),a={},t.verifyingContract&&!Object(c.l)(t.verifyingContract,20)&&(a[t.verifyingContract]="0x"),(s=e.from(r)).visit(n,(function(e,t){return"address"!==e||Object(c.l)(t,20)||(a[t]="0x"),t})),o.t0=regeneratorRuntime.keys(a);case 6:if((o.t1=o.t0()).done){o.next=13;break}return A=o.t1.value,o.next=10,i(A);case 10:a[A]=o.sent,o.next=6;break;case 13:return t.verifyingContract&&a[t.verifyingContract]&&(t.verifyingContract=a[t.verifyingContract]),n=s.visit(n,(function(e,t){return"address"===e&&a[t]?a[t]:t})),o.abrupt("return",{domain:t,value:n});case 16:case"end":return o.stop()}}),o)})))}},{key:"getPayload",value:function(t,r,n){e.hashDomain(t);var i={},o=[];lo.forEach((function(e){var r=t[e];null!=r&&(i[e]=po[e](r),o.push({name:e,type:ho[e]}))}));var a=e.from(r),s=R(r);return s.EIP712Domain?io.throwArgumentError("types must not contain EIP712Domain type","types.EIP712Domain",r):s.EIP712Domain=o,a.encode(n),{types:s,domain:i,primaryType:a.primaryType,message:a.visit(n,(function(e,t){if(e.match(/^bytes(\d*)/))return Object(c.i)(Object(c.a)(t));if(e.match(/^u?int/))return y.from(t).toString();switch(e){case"address":return t.toLowerCase();case"bool":return!!t;case"string":return"string"!=typeof t&&io.throwArgumentError("invalid string","value",t),t}return io.throwArgumentError("unsupported type","type",e)}))}}}],(r=[{key:"getEncoder",value:function(e){var t=this._encoderCache[e];return t||(t=this._encoderCache[e]=this._getEncoder(e)),t}},{key:"_getEncoder",value:function(e){var t=this,r=Io(e);if(r)return r;var n=e.match(/^(.*)(\x5b(\d*)\x5d)$/);if(n){var i=n[1],o=this.getEncoder(i),a=parseInt(n[3]);return function(e){a>=0&&e.length!==a&&io.throwArgumentError("array length mismatch; expected length ${ arrayLength }","value",e);var r=e.map(o);return t._types[i]&&(r=r.map(q)),q(Object(c.c)(r))}}var s=this.types[e];if(s){var A=we(this._types[e]);return function(e){var r=s.map((function(r){var n=r.name,i=r.type,o=t.getEncoder(i)(e[n]);return t._types[i]?q(o):o}));return r.unshift(A),Object(c.c)(r)}}return io.throwArgumentError("unknown type: ".concat(e),"type",e)}},{key:"encodeType",value:function(e){var t=this._types[e];return t||io.throwArgumentError("unknown type: ".concat(JSON.stringify(e)),"name",e),t}},{key:"encodeData",value:function(e,t){return this.getEncoder(e)(t)}},{key:"hashStruct",value:function(e,t){return q(this.encodeData(e,t))}},{key:"encode",value:function(e){return this.encodeData(this.primaryType,e)}},{key:"hash",value:function(e){return this.hashStruct(this.primaryType,e)}},{key:"_visit",value:function(e,t,r){var n=this;if(Io(e))return r(e,t);var i=e.match(/^(.*)(\x5b(\d*)\x5d)$/);if(i){var o=i[1],a=parseInt(i[3]);return a>=0&&t.length!==a&&io.throwArgumentError("array length mismatch; expected length ${ arrayLength }","value",t),t.map((function(e){return n._visit(o,e,r)}))}var s=this.types[e];return s?s.reduce((function(e,i){var o=i.name,a=i.type;return e[o]=n._visit(a,t[o],r),e}),{}):io.throwArgumentError("unknown type: ".concat(e),"type",e)}},{key:"visit",value:function(e,t){return this._visit(this.primaryType,e,t)}}])&&ro(t.prototype,r),n&&ro(t,n),Object.defineProperty(t,"prototype",{writable:!1}),e}();function Eo(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}var mo,Co=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),_(this,"alphabet",t),_(this,"base",t.length),_(this,"_alphabetMap",{}),_(this,"_leader",t.charAt(0));for(var r=0;r<t.length;r++)this._alphabetMap[t.charAt(r)]=r}var t,r,n;return t=e,(r=[{key:"encode",value:function(e){var t=Object(c.a)(e);if(0===t.length)return"";for(var r=[0],n=0;n<t.length;++n){for(var i=t[n],o=0;o<r.length;++o)i+=r[o]<<8,r[o]=i%this.base,i=i/this.base|0;for(;i>0;)r.push(i%this.base),i=i/this.base|0}for(var a="",s=0;0===t[s]&&s<t.length-1;++s)a+=this._leader;for(var A=r.length-1;A>=0;--A)a+=this.alphabet[r[A]];return a}},{key:"decode",value:function(e){if("string"!=typeof e)throw new TypeError("Expected String");var t=[];if(0===e.length)return new Uint8Array(t);t.push(0);for(var r=0;r<e.length;r++){var n=this._alphabetMap[e[r]];if(void 0===n)throw new Error("Non-base"+this.base+" character");for(var i=n,o=0;o<t.length;++o)i+=t[o]*this.base,t[o]=255&i,i>>=8;for(;i>0;)t.push(255&i),i>>=8}for(var a=0;e[a]===this._leader&&a<e.length-1;++a)t.push(0);return Object(c.a)(new Uint8Array(t.reverse()))}}])&&Eo(t.prototype,r),n&&Eo(t,n),Object.defineProperty(t,"prototype",{writable:!1}),e}(),vo=(new Co("abcdefghijklmnopqrstuvwxyz234567"),new Co("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz")),Bo=r(7),wo=r.n(Bo);!function(e){e.sha256="sha256",e.sha512="sha512"}(mo||(mo={}));var Qo=new h.b("sha2/5.7.0");function ko(e){return"0x"+wo.a.ripemd160().update(Object(c.a)(e)).digest("hex")}function _o(e){return"0x"+wo.a.sha256().update(Object(c.a)(e)).digest("hex")}function So(e){return"0x"+wo.a.sha512().update(Object(c.a)(e)).digest("hex")}function Do(e,t,r){return mo[e]||Qo.throwError("unsupported algorithm "+e,h.b.errors.UNSUPPORTED_OPERATION,{operation:"hmac",algorithm:e}),"0x"+wo.a.hmac(wo.a[e],Object(c.a)(t)).update(Object(c.a)(r)).digest("hex")}function Mo(e,t,r,n,i){var o;e=Object(c.a)(e),t=Object(c.a)(t);var a,s,A=1,u=new Uint8Array(n),f=new Uint8Array(t.length+4);f.set(t);for(var h=1;h<=A;h++){f[t.length]=h>>24&255,f[t.length+1]=h>>16&255,f[t.length+2]=h>>8&255,f[t.length+3]=255&h;var l=Object(c.a)(Do(i,e,f));o||(o=l.length,s=new Uint8Array(o),a=n-((A=Math.ceil(n/o))-1)*o),s.set(l);for(var g=1;g<r;g++){l=Object(c.a)(Do(i,e,l));for(var d=0;d<o;d++)s[d]^=l[d]}var p=(h-1)*o,I=h===A?a:o;u.set(Object(c.a)(s).slice(0,I),p)}return Object(c.i)(u)}function Ro(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}var xo=new h.b("wordlists/5.7.0"),Oo=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),xo.checkAbstract(this instanceof e?this.constructor:void 0,e),_(this,"locale",t)}var t,r,n;return t=e,n=[{key:"check",value:function(e){for(var t=[],r=0;r<2048;r++){var n=e.getWord(r);if(r!==e.getWordIndex(n))return"0x";t.push(n)}return we(t.join("\n")+"\n")}},{key:"register",value:function(e,t){t||(t=e.locale)}}],(r=[{key:"split",value:function(e){return e.toLowerCase().split(/ +/g)}},{key:"join",value:function(e){return e.join(" ")}}])&&Ro(t.prototype,r),n&&Ro(t,n),Object.defineProperty(t,"prototype",{writable:!1}),e}();function No(e){return(No="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Po(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function Fo(e,t){return(Fo=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function jo(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=Uo(e);if(t){var i=Uo(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return To(this,r)}}function To(e,t){if(t&&("object"===No(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function Uo(e){return(Uo=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var Lo=null;function Ho(e){if(null==Lo&&(Lo="AbandonAbilityAbleAboutAboveAbsentAbsorbAbstractAbsurdAbuseAccessAccidentAccountAccuseAchieveAcidAcousticAcquireAcrossActActionActorActressActualAdaptAddAddictAddressAdjustAdmitAdultAdvanceAdviceAerobicAffairAffordAfraidAgainAgeAgentAgreeAheadAimAirAirportAisleAlarmAlbumAlcoholAlertAlienAllAlleyAllowAlmostAloneAlphaAlreadyAlsoAlterAlwaysAmateurAmazingAmongAmountAmusedAnalystAnchorAncientAngerAngleAngryAnimalAnkleAnnounceAnnualAnotherAnswerAntennaAntiqueAnxietyAnyApartApologyAppearAppleApproveAprilArchArcticAreaArenaArgueArmArmedArmorArmyAroundArrangeArrestArriveArrowArtArtefactArtistArtworkAskAspectAssaultAssetAssistAssumeAsthmaAthleteAtomAttackAttendAttitudeAttractAuctionAuditAugustAuntAuthorAutoAutumnAverageAvocadoAvoidAwakeAwareAwayAwesomeAwfulAwkwardAxisBabyBachelorBaconBadgeBagBalanceBalconyBallBambooBananaBannerBarBarelyBargainBarrelBaseBasicBasketBattleBeachBeanBeautyBecauseBecomeBeefBeforeBeginBehaveBehindBelieveBelowBeltBenchBenefitBestBetrayBetterBetweenBeyondBicycleBidBikeBindBiologyBirdBirthBitterBlackBladeBlameBlanketBlastBleakBlessBlindBloodBlossomBlouseBlueBlurBlushBoardBoatBodyBoilBombBoneBonusBookBoostBorderBoringBorrowBossBottomBounceBoxBoyBracketBrainBrandBrassBraveBreadBreezeBrickBridgeBriefBrightBringBriskBroccoliBrokenBronzeBroomBrotherBrownBrushBubbleBuddyBudgetBuffaloBuildBulbBulkBulletBundleBunkerBurdenBurgerBurstBusBusinessBusyButterBuyerBuzzCabbageCabinCableCactusCageCakeCallCalmCameraCampCanCanalCancelCandyCannonCanoeCanvasCanyonCapableCapitalCaptainCarCarbonCardCargoCarpetCarryCartCaseCashCasinoCastleCasualCatCatalogCatchCategoryCattleCaughtCauseCautionCaveCeilingCeleryCementCensusCenturyCerealCertainChairChalkChampionChangeChaosChapterChargeChaseChatCheapCheckCheeseChefCherryChestChickenChiefChildChimneyChoiceChooseChronicChuckleChunkChurnCigarCinnamonCircleCitizenCityCivilClaimClapClarifyClawClayCleanClerkCleverClickClientCliffClimbClinicClipClockClogCloseClothCloudClownClubClumpClusterClutchCoachCoastCoconutCodeCoffeeCoilCoinCollectColorColumnCombineComeComfortComicCommonCompanyConcertConductConfirmCongressConnectConsiderControlConvinceCookCoolCopperCopyCoralCoreCornCorrectCostCottonCouchCountryCoupleCourseCousinCoverCoyoteCrackCradleCraftCramCraneCrashCraterCrawlCrazyCreamCreditCreekCrewCricketCrimeCrispCriticCropCrossCrouchCrowdCrucialCruelCruiseCrumbleCrunchCrushCryCrystalCubeCultureCupCupboardCuriousCurrentCurtainCurveCushionCustomCuteCycleDadDamageDampDanceDangerDaringDashDaughterDawnDayDealDebateDebrisDecadeDecemberDecideDeclineDecorateDecreaseDeerDefenseDefineDefyDegreeDelayDeliverDemandDemiseDenialDentistDenyDepartDependDepositDepthDeputyDeriveDescribeDesertDesignDeskDespairDestroyDetailDetectDevelopDeviceDevoteDiagramDialDiamondDiaryDiceDieselDietDifferDigitalDignityDilemmaDinnerDinosaurDirectDirtDisagreeDiscoverDiseaseDishDismissDisorderDisplayDistanceDivertDivideDivorceDizzyDoctorDocumentDogDollDolphinDomainDonateDonkeyDonorDoorDoseDoubleDoveDraftDragonDramaDrasticDrawDreamDressDriftDrillDrinkDripDriveDropDrumDryDuckDumbDuneDuringDustDutchDutyDwarfDynamicEagerEagleEarlyEarnEarthEasilyEastEasyEchoEcologyEconomyEdgeEditEducateEffortEggEightEitherElbowElderElectricElegantElementElephantElevatorEliteElseEmbarkEmbodyEmbraceEmergeEmotionEmployEmpowerEmptyEnableEnactEndEndlessEndorseEnemyEnergyEnforceEngageEngineEnhanceEnjoyEnlistEnoughEnrichEnrollEnsureEnterEntireEntryEnvelopeEpisodeEqualEquipEraEraseErodeErosionErrorEruptEscapeEssayEssenceEstateEternalEthicsEvidenceEvilEvokeEvolveExactExampleExcessExchangeExciteExcludeExcuseExecuteExerciseExhaustExhibitExileExistExitExoticExpandExpectExpireExplainExposeExpressExtendExtraEyeEyebrowFabricFaceFacultyFadeFaintFaithFallFalseFameFamilyFamousFanFancyFantasyFarmFashionFatFatalFatherFatigueFaultFavoriteFeatureFebruaryFederalFeeFeedFeelFemaleFenceFestivalFetchFeverFewFiberFictionFieldFigureFileFilmFilterFinalFindFineFingerFinishFireFirmFirstFiscalFishFitFitnessFixFlagFlameFlashFlatFlavorFleeFlightFlipFloatFlockFloorFlowerFluidFlushFlyFoamFocusFogFoilFoldFollowFoodFootForceForestForgetForkFortuneForumForwardFossilFosterFoundFoxFragileFrameFrequentFreshFriendFringeFrogFrontFrostFrownFrozenFruitFuelFunFunnyFurnaceFuryFutureGadgetGainGalaxyGalleryGameGapGarageGarbageGardenGarlicGarmentGasGaspGateGatherGaugeGazeGeneralGeniusGenreGentleGenuineGestureGhostGiantGiftGiggleGingerGiraffeGirlGiveGladGlanceGlareGlassGlideGlimpseGlobeGloomGloryGloveGlowGlueGoatGoddessGoldGoodGooseGorillaGospelGossipGovernGownGrabGraceGrainGrantGrapeGrassGravityGreatGreenGridGriefGritGroceryGroupGrowGruntGuardGuessGuideGuiltGuitarGunGymHabitHairHalfHammerHamsterHandHappyHarborHardHarshHarvestHatHaveHawkHazardHeadHealthHeartHeavyHedgehogHeightHelloHelmetHelpHenHeroHiddenHighHillHintHipHireHistoryHobbyHockeyHoldHoleHolidayHollowHomeHoneyHoodHopeHornHorrorHorseHospitalHostHotelHourHoverHubHugeHumanHumbleHumorHundredHungryHuntHurdleHurryHurtHusbandHybridIceIconIdeaIdentifyIdleIgnoreIllIllegalIllnessImageImitateImmenseImmuneImpactImposeImproveImpulseInchIncludeIncomeIncreaseIndexIndicateIndoorIndustryInfantInflictInformInhaleInheritInitialInjectInjuryInmateInnerInnocentInputInquiryInsaneInsectInsideInspireInstallIntactInterestIntoInvestInviteInvolveIronIslandIsolateIssueItemIvoryJacketJaguarJarJazzJealousJeansJellyJewelJobJoinJokeJourneyJoyJudgeJuiceJumpJungleJuniorJunkJustKangarooKeenKeepKetchupKeyKickKidKidneyKindKingdomKissKitKitchenKiteKittenKiwiKneeKnifeKnockKnowLabLabelLaborLadderLadyLakeLampLanguageLaptopLargeLaterLatinLaughLaundryLavaLawLawnLawsuitLayerLazyLeaderLeafLearnLeaveLectureLeftLegLegalLegendLeisureLemonLendLengthLensLeopardLessonLetterLevelLiarLibertyLibraryLicenseLifeLiftLightLikeLimbLimitLinkLionLiquidListLittleLiveLizardLoadLoanLobsterLocalLockLogicLonelyLongLoopLotteryLoudLoungeLoveLoyalLuckyLuggageLumberLunarLunchLuxuryLyricsMachineMadMagicMagnetMaidMailMainMajorMakeMammalManManageMandateMangoMansionManualMapleMarbleMarchMarginMarineMarketMarriageMaskMassMasterMatchMaterialMathMatrixMatterMaximumMazeMeadowMeanMeasureMeatMechanicMedalMediaMelodyMeltMemberMemoryMentionMenuMercyMergeMeritMerryMeshMessageMetalMethodMiddleMidnightMilkMillionMimicMindMinimumMinorMinuteMiracleMirrorMiseryMissMistakeMixMixedMixtureMobileModelModifyMomMomentMonitorMonkeyMonsterMonthMoonMoralMoreMorningMosquitoMotherMotionMotorMountainMouseMoveMovieMuchMuffinMuleMultiplyMuscleMuseumMushroomMusicMustMutualMyselfMysteryMythNaiveNameNapkinNarrowNastyNationNatureNearNeckNeedNegativeNeglectNeitherNephewNerveNestNetNetworkNeutralNeverNewsNextNiceNightNobleNoiseNomineeNoodleNormalNorthNoseNotableNoteNothingNoticeNovelNowNuclearNumberNurseNutOakObeyObjectObligeObscureObserveObtainObviousOccurOceanOctoberOdorOffOfferOfficeOftenOilOkayOldOliveOlympicOmitOnceOneOnionOnlineOnlyOpenOperaOpinionOpposeOptionOrangeOrbitOrchardOrderOrdinaryOrganOrientOriginalOrphanOstrichOtherOutdoorOuterOutputOutsideOvalOvenOverOwnOwnerOxygenOysterOzonePactPaddlePagePairPalacePalmPandaPanelPanicPantherPaperParadeParentParkParrotPartyPassPatchPathPatientPatrolPatternPausePavePaymentPeacePeanutPearPeasantPelicanPenPenaltyPencilPeoplePepperPerfectPermitPersonPetPhonePhotoPhrasePhysicalPianoPicnicPicturePiecePigPigeonPillPilotPinkPioneerPipePistolPitchPizzaPlacePlanetPlasticPlatePlayPleasePledgePluckPlugPlungePoemPoetPointPolarPolePolicePondPonyPoolPopularPortionPositionPossiblePostPotatoPotteryPovertyPowderPowerPracticePraisePredictPreferPreparePresentPrettyPreventPricePridePrimaryPrintPriorityPrisonPrivatePrizeProblemProcessProduceProfitProgramProjectPromoteProofPropertyProsperProtectProudProvidePublicPuddingPullPulpPulsePumpkinPunchPupilPuppyPurchasePurityPurposePursePushPutPuzzlePyramidQualityQuantumQuarterQuestionQuickQuitQuizQuoteRabbitRaccoonRaceRackRadarRadioRailRainRaiseRallyRampRanchRandomRangeRapidRareRateRatherRavenRawRazorReadyRealReasonRebelRebuildRecallReceiveRecipeRecordRecycleReduceReflectReformRefuseRegionRegretRegularRejectRelaxReleaseReliefRelyRemainRememberRemindRemoveRenderRenewRentReopenRepairRepeatReplaceReportRequireRescueResembleResistResourceResponseResultRetireRetreatReturnReunionRevealReviewRewardRhythmRibRibbonRiceRichRideRidgeRifleRightRigidRingRiotRippleRiskRitualRivalRiverRoadRoastRobotRobustRocketRomanceRoofRookieRoomRoseRotateRoughRoundRouteRoyalRubberRudeRugRuleRunRunwayRuralSadSaddleSadnessSafeSailSaladSalmonSalonSaltSaluteSameSampleSandSatisfySatoshiSauceSausageSaveSayScaleScanScareScatterSceneSchemeSchoolScienceScissorsScorpionScoutScrapScreenScriptScrubSeaSearchSeasonSeatSecondSecretSectionSecuritySeedSeekSegmentSelectSellSeminarSeniorSenseSentenceSeriesServiceSessionSettleSetupSevenShadowShaftShallowShareShedShellSheriffShieldShiftShineShipShiverShockShoeShootShopShortShoulderShoveShrimpShrugShuffleShySiblingSickSideSiegeSightSignSilentSilkSillySilverSimilarSimpleSinceSingSirenSisterSituateSixSizeSkateSketchSkiSkillSkinSkirtSkullSlabSlamSleepSlenderSliceSlideSlightSlimSloganSlotSlowSlushSmallSmartSmileSmokeSmoothSnackSnakeSnapSniffSnowSoapSoccerSocialSockSodaSoftSolarSoldierSolidSolutionSolveSomeoneSongSoonSorrySortSoulSoundSoupSourceSouthSpaceSpareSpatialSpawnSpeakSpecialSpeedSpellSpendSphereSpiceSpiderSpikeSpinSpiritSplitSpoilSponsorSpoonSportSpotSpraySpreadSpringSpySquareSqueezeSquirrelStableStadiumStaffStageStairsStampStandStartStateStaySteakSteelStemStepStereoStickStillStingStockStomachStoneStoolStoryStoveStrategyStreetStrikeStrongStruggleStudentStuffStumbleStyleSubjectSubmitSubwaySuccessSuchSuddenSufferSugarSuggestSuitSummerSunSunnySunsetSuperSupplySupremeSureSurfaceSurgeSurpriseSurroundSurveySuspectSustainSwallowSwampSwapSwarmSwearSweetSwiftSwimSwingSwitchSwordSymbolSymptomSyrupSystemTableTackleTagTailTalentTalkTankTapeTargetTaskTasteTattooTaxiTeachTeamTellTenTenantTennisTentTermTestTextThankThatThemeThenTheoryThereTheyThingThisThoughtThreeThriveThrowThumbThunderTicketTideTigerTiltTimberTimeTinyTipTiredTissueTitleToastTobaccoTodayToddlerToeTogetherToiletTokenTomatoTomorrowToneTongueTonightToolToothTopTopicToppleTorchTornadoTortoiseTossTotalTouristTowardTowerTownToyTrackTradeTrafficTragicTrainTransferTrapTrashTravelTrayTreatTreeTrendTrialTribeTrickTriggerTrimTripTrophyTroubleTruckTrueTrulyTrumpetTrustTruthTryTubeTuitionTumbleTunaTunnelTurkeyTurnTurtleTwelveTwentyTwiceTwinTwistTwoTypeTypicalUglyUmbrellaUnableUnawareUncleUncoverUnderUndoUnfairUnfoldUnhappyUniformUniqueUnitUniverseUnknownUnlockUntilUnusualUnveilUpdateUpgradeUpholdUponUpperUpsetUrbanUrgeUsageUseUsedUsefulUselessUsualUtilityVacantVacuumVagueValidValleyValveVanVanishVaporVariousVastVaultVehicleVelvetVendorVentureVenueVerbVerifyVersionVeryVesselVeteranViableVibrantViciousVictoryVideoViewVillageVintageViolinVirtualVirusVisaVisitVisualVitalVividVocalVoiceVoidVolcanoVolumeVoteVoyageWageWagonWaitWalkWallWalnutWantWarfareWarmWarriorWashWaspWasteWaterWaveWayWealthWeaponWearWeaselWeatherWebWeddingWeekendWeirdWelcomeWestWetWhaleWhatWheatWheelWhenWhereWhipWhisperWideWidthWifeWildWillWinWindowWineWingWinkWinnerWinterWireWisdomWiseWishWitnessWolfWomanWonderWoodWoolWordWorkWorldWorryWorthWrapWreckWrestleWristWriteWrongYardYearYellowYouYoungYouthZebraZeroZoneZoo".replace(/([A-Z])/g," $1").toLowerCase().substring(1).split(" "),"0x3c8acc1e7b08d8e76f9fda015ef48dc8c710a73cb7e0f77b2c18a9b5a7adde60"!==Oo.check(e)))throw Lo=null,new Error("BIP39 Wordlist for en (English) FAILED")}var Go=new(function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Fo(e,t)}(o,e);var t,r,n,i=jo(o);function o(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,o),i.call(this,"en")}return t=o,(r=[{key:"getWord",value:function(e){return Ho(this),Lo[e]}},{key:"getWordIndex",value:function(e){return Ho(this),Lo.indexOf(e)}}])&&Po(t.prototype,r),n&&Po(t,n),Object.defineProperty(t,"prototype",{writable:!1}),o}(Oo));Oo.register(Go);var Yo={en:Go};function Ko(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}var qo=new h.b("hdnode/5.7.0"),Jo=y.from("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),zo=be("Bitcoin seed");function Vo(e){return(1<<e)-1<<8-e}function Zo(e){return Object(c.h)(Object(c.i)(e),32)}function Wo(e){return vo.encode(Object(c.b)([e,Object(c.e)(_o(_o(e)),0,4)]))}function Xo(e){if(null==e)return Yo.en;if("string"==typeof e){var t=Yo[e];return null==t&&qo.throwArgumentError("unknown locale","wordlist",e),t}return e}var $o={},ea="m/44'/60'/0'/0/0",ta=function(){function e(t,r,n,i,o,a,s,A){if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),t!==$o)throw new Error("HDNode constructor cannot be called directly");if(r){var u=new Ln(r);_(this,"privateKey",u.privateKey),_(this,"publicKey",u.compressedPublicKey)}else _(this,"privateKey",null),_(this,"publicKey",Object(c.i)(n));_(this,"parentFingerprint",i),_(this,"fingerprint",Object(c.e)(ko(_o(this.publicKey)),0,4)),_(this,"address",Zn(this.publicKey)),_(this,"chainCode",o),_(this,"index",a),_(this,"depth",s),null==A?(_(this,"mnemonic",null),_(this,"path",null)):"string"==typeof A?(_(this,"mnemonic",null),_(this,"path",A)):(_(this,"mnemonic",A),_(this,"path",A.path))}var t,r,n;return t=e,n=[{key:"_fromSeed",value:function(t,r){var n=Object(c.a)(t);if(n.length<16||n.length>64)throw new Error("invalid seed");var i=Object(c.a)(Do(mo.sha512,zo,n));return new e($o,Zo(i.slice(0,32)),null,"0x00000000",Zo(i.slice(32)),0,0,r)}},{key:"fromMnemonic",value:function(t,r,n){return t=ia(na(t,n=Xo(n)),n),e._fromSeed(ra(t,r),{phrase:t,path:"m",locale:n.locale})}},{key:"fromSeed",value:function(t){return e._fromSeed(t,null)}},{key:"fromExtendedKey",value:function(t){var r=vo.decode(t);82===r.length&&Wo(r.slice(0,78))===t||qo.throwArgumentError("invalid extended key","extendedKey","[REDACTED]");var n=r[4],i=Object(c.i)(r.slice(5,9)),o=parseInt(Object(c.i)(r.slice(9,13)).substring(2),16),a=Object(c.i)(r.slice(13,45)),s=r.slice(45,78);switch(Object(c.i)(r.slice(0,4))){case"0x0488b21e":case"0x043587cf":return new e($o,null,Object(c.i)(s),i,a,o,n,null);case"0x0488ade4":case"0x04358394 ":if(0!==s[0])break;return new e($o,Object(c.i)(s.slice(1)),null,i,a,o,n,null)}return qo.throwArgumentError("invalid extended key","extendedKey","[REDACTED]")}}],(r=[{key:"extendedKey",get:function(){if(this.depth>=256)throw new Error("Depth too large!");return Wo(Object(c.b)([null!=this.privateKey?"0x0488ADE4":"0x0488B21E",Object(c.i)(this.depth),this.parentFingerprint,Object(c.h)(Object(c.i)(this.index),4),this.chainCode,null!=this.privateKey?Object(c.b)(["0x00",this.privateKey]):this.publicKey]))}},{key:"neuter",value:function(){return new e($o,null,this.publicKey,this.parentFingerprint,this.chainCode,this.index,this.depth,this.path)}},{key:"_derive",value:function(t){if(t>4294967295)throw new Error("invalid index - "+String(t));var r=this.path;r&&(r+="/"+(2147483647&t));var n=new Uint8Array(37);if(2147483648&t){if(!this.privateKey)throw new Error("cannot derive child of neutered node");n.set(Object(c.a)(this.privateKey),1),r&&(r+="'")}else n.set(Object(c.a)(this.publicKey));for(var i=24;i>=0;i-=8)n[33+(i>>3)]=t>>24-i&255;var o=Object(c.a)(Do(mo.sha512,this.chainCode,n)),a=o.slice(0,32),s=o.slice(32),A=null,u=null;this.privateKey?A=Zo(y.from(a).add(this.privateKey).mod(Jo)):u=new Ln(Object(c.i)(a))._addPoint(this.publicKey);var f=r,h=this.mnemonic;return h&&(f=Object.freeze({phrase:h.phrase,path:r,locale:h.locale||"en"})),new e($o,A,u,this.fingerprint,Zo(s),t,this.depth+1,f)}},{key:"derivePath",value:function(e){var t=e.split("/");if(0===t.length||"m"===t[0]&&0!==this.depth)throw new Error("invalid path - "+e);"m"===t[0]&&t.shift();for(var r=this,n=0;n<t.length;n++){var i=t[n];if(i.match(/^[0-9]+'$/)){var o=parseInt(i.substring(0,i.length-1));if(o>=2147483648)throw new Error("invalid path index - "+i);r=r._derive(2147483648+o)}else{if(!i.match(/^[0-9]+$/))throw new Error("invalid path component - "+i);var a=parseInt(i);if(a>=2147483648)throw new Error("invalid path index - "+i);r=r._derive(a)}}return r}}])&&Ko(t.prototype,r),n&&Ko(t,n),Object.defineProperty(t,"prototype",{writable:!1}),e}();function ra(e,t){t||(t="");var r=be("mnemonic"+t,le.NFKD);return Mo(be(e,le.NFKD),r,2048,64,"sha512")}function na(e,t){t=Xo(t),qo.checkNormalize();var r=t.split(e);if(r.length%3!=0)throw new Error("invalid mnemonic");for(var n=Object(c.a)(new Uint8Array(Math.ceil(11*r.length/8))),i=0,o=0;o<r.length;o++){var a=t.getWordIndex(r[o].normalize("NFKD"));if(-1===a)throw new Error("invalid mnemonic");for(var s=0;s<11;s++)a&1<<10-s&&(n[i>>3]|=1<<7-i%8),i++}var A=32*r.length/3,u=Vo(r.length/3);if((Object(c.a)(_o(n.slice(0,A/8)))[0]&u)!==(n[n.length-1]&u))throw new Error("invalid checksum");return Object(c.i)(n.slice(0,A/8))}function ia(e,t){if(t=Xo(t),(e=Object(c.a)(e)).length%4!=0||e.length<16||e.length>32)throw new Error("invalid entropy");for(var r=[0],n=11,i=0;i<e.length;i++)n>8?(r[r.length-1]<<=8,r[r.length-1]|=e[i],n-=8):(r[r.length-1]<<=n,r[r.length-1]|=e[i]>>8-n,r.push(e[i]&(1<<8-n)-1),n+=3);var o=e.length/4,a=Object(c.a)(_o(e))[0]&Vo(o);return r[r.length-1]<<=o,r[r.length-1]|=a>>8-o,t.join(r.map((function(e){return t.getWord(e)})))}function oa(e,t){try{return na(e,t),!0}catch(e){}return!1}function aa(e){return("number"!=typeof e||e<0||e>=2147483648||e%1)&&qo.throwArgumentError("invalid account index","index",e),"m/44'/60'/".concat(e,"'/0/0")}var sa=r(337),Aa=r(14),ca=r.n(Aa),ua=r(49),fa=r.n(ua);function ha(e){return"string"==typeof e&&"0x"!==e.substring(0,2)&&(e="0x"+e),Object(c.a)(e)}function la(e,t){for(e=String(e);e.length<t;)e="0"+e;return e}function ga(e){return"string"==typeof e?be(e,le.NFKC):Object(c.a)(e)}function da(e,t){for(var r=e,n=t.toLowerCase().split("/"),i=0;i<n.length;i++){var o=null;for(var a in r)if(a.toLowerCase()===n[i]){o=r[a];break}if(null===o)return null;r=o}return r}function pa(e){var t=Object(c.a)(e);t[6]=15&t[6]|64,t[8]=63&t[8]|128;var r=Object(c.i)(t);return[r.substring(2,10),r.substring(10,14),r.substring(14,18),r.substring(18,22),r.substring(22,34)].join("-")}function Ia(e){return(Ia="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function ya(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function ba(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function Ea(e,t){return(Ea=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function ma(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=va(e);if(t){var i=va(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return Ca(this,r)}}function Ca(e,t){if(t&&("object"===Ia(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function va(e){return(va=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var Ba=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{A(n.next(e))}catch(e){o(e)}}function s(e){try{A(n.throw(e))}catch(e){o(e)}}function A(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}A((n=n.apply(e,t||[])).next())}))},wa=new h.b("json-wallets/5.7.0");function Qa(e){return null!=e&&e.mnemonic&&e.mnemonic.phrase}var ka=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Ea(e,t)}(o,e);var t,r,n,i=ma(o);function o(){return ya(this,o),i.apply(this,arguments)}return t=o,(r=[{key:"isKeystoreAccount",value:function(e){return!(!e||!e._isKeystoreAccount)}}])&&ba(t.prototype,r),n&&ba(t,n),Object.defineProperty(t,"prototype",{writable:!1}),o}(P);function _a(e,t){var r=ha(da(e,"crypto/ciphertext"));if(Object(c.i)(q(Object(c.b)([t.slice(16,32),r]))).substring(2)!==da(e,"crypto/mac").toLowerCase())throw new Error("invalid password");var n=function(e,t,r){if("aes-128-ctr"===da(e,"crypto/cipher")){var n=ha(da(e,"crypto/cipherparams/iv")),i=new ca.a.Counter(n),o=new ca.a.ModeOfOperation.ctr(t,i);return Object(c.a)(o.decrypt(r))}return null}(e,t.slice(0,16),r);n||wa.throwError("unsupported cipher",h.b.errors.UNSUPPORTED_OPERATION,{operation:"decrypt"});var i=t.slice(32,64),o=Zn(n);if(e.address){var a=e.address.toLowerCase();if("0x"!==a.substring(0,2)&&(a="0x"+a),Ae(a)!==o)throw new Error("address mismatch")}var s={_isKeystoreAccount:!0,address:o,privateKey:Object(c.i)(n)};if("0.1"===da(e,"x-ethers/version")){var A=ha(da(e,"x-ethers/mnemonicCiphertext")),u=ha(da(e,"x-ethers/mnemonicCounter")),f=new ca.a.Counter(u),l=new ca.a.ModeOfOperation.ctr(i,f),g=da(e,"x-ethers/path")||ea,d=da(e,"x-ethers/locale")||"en",p=Object(c.a)(l.decrypt(A));try{var I=ia(p,d),y=ta.fromMnemonic(I,null,d).derivePath(g);if(y.privateKey!=s.privateKey)throw new Error("mnemonic mismatch");s.mnemonic=y.mnemonic}catch(e){if(e.code!==h.b.errors.INVALID_ARGUMENT||"wordlist"!==e.argument)throw e}}return new ka(s)}function Sa(e,t,r,n,i){return Object(c.a)(Mo(e,t,r,n,i))}function Da(e,t,r,n,i){return Promise.resolve(Sa(e,t,r,n,i))}function Ma(e,t,r,n,i){var o=ga(t),a=da(e,"crypto/kdf");if(a&&"string"==typeof a){var s=function(e,t){return wa.throwArgumentError("invalid key-derivation function parameters",e,t)};if("scrypt"===a.toLowerCase()){var A=ha(da(e,"crypto/kdfparams/salt")),c=parseInt(da(e,"crypto/kdfparams/n")),u=parseInt(da(e,"crypto/kdfparams/r")),f=parseInt(da(e,"crypto/kdfparams/p"));c&&u&&f||s("kdf",a),0!=(c&c-1)&&s("N",c);var h=parseInt(da(e,"crypto/kdfparams/dklen"));return 32!==h&&s("dklen",h),n(o,A,c,u,f,64,i)}if("pbkdf2"===a.toLowerCase()){var l=ha(da(e,"crypto/kdfparams/salt")),g=null,d=da(e,"crypto/kdfparams/prf");"hmac-sha256"===d?g="sha256":"hmac-sha512"===d?g="sha512":s("prf",d);var p=parseInt(da(e,"crypto/kdfparams/c")),I=parseInt(da(e,"crypto/kdfparams/dklen"));return 32!==I&&s("dklen",I),r(o,l,p,I,g)}}return wa.throwArgumentError("unsupported key-derivation function","kdf",a)}function Ra(e){return(Ra="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function xa(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Oa(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function Na(e,t){return(Na=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Pa(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=ja(e);if(t){var i=ja(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return Fa(this,r)}}function Fa(e,t){if(t&&("object"===Ra(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function ja(e){return(ja=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var Ta=new h.b("json-wallets/5.7.0"),Ua=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Na(e,t)}(o,e);var t,r,n,i=Pa(o);function o(){return xa(this,o),i.apply(this,arguments)}return t=o,(r=[{key:"isCrowdsaleAccount",value:function(e){return!(!e||!e._isCrowdsaleAccount)}}])&&Oa(t.prototype,r),n&&Oa(t,n),Object.defineProperty(t,"prototype",{writable:!1}),o}(P);function La(e,t){var r=JSON.parse(e);t=ga(t);var n=Ae(da(r,"ethaddr")),i=ha(da(r,"encseed"));i&&i.length%16==0||Ta.throwArgumentError("invalid encseed","json",e);for(var o=Object(c.a)(Mo(t,t,2e3,32,"sha256")).slice(0,16),a=i.slice(0,16),s=i.slice(16),A=new ca.a.ModeOfOperation.cbc(o,a),u=ca.a.padding.pkcs7.strip(Object(c.a)(A.decrypt(s))),f="",h=0;h<u.length;h++)f+=String.fromCharCode(u[h]);var l=q(be(f));return new Ua({_isCrowdsaleAccount:!0,address:n,privateKey:l})}function Ha(e){var t=null;try{t=JSON.parse(e)}catch(e){return!1}return t.encseed&&t.ethaddr}function Ga(e){var t=null;try{t=JSON.parse(e)}catch(e){return!1}return!(!t.version||parseInt(t.version)!==t.version||3!==parseInt(t.version))}function Ya(e){if(Ha(e))try{return Ae(JSON.parse(e).ethaddr)}catch(e){return null}if(Ga(e))try{return Ae(JSON.parse(e).address)}catch(e){return null}return null}function Ka(e,t,r){if(Ha(e)){r&&r(0);var n=La(e,t);return r&&r(1),Promise.resolve(n)}return Ga(e)?function(e,t,r){return Ba(this,void 0,void 0,regeneratorRuntime.mark((function n(){var i,o;return regeneratorRuntime.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return i=JSON.parse(e),n.next=3,Ma(i,t,Da,fa.a.scrypt,r);case 3:return o=n.sent,n.abrupt("return",_a(i,o));case 5:case"end":return n.stop()}}),n)})))}(e,t,r):Promise.reject(new Error("invalid JSON wallet"))}function qa(e,t){if(Ha(e))return La(e,t);if(Ga(e))return function(e,t){var r=JSON.parse(e);return _a(r,Ma(r,t,Sa,fa.a.syncScrypt))}(e,t);throw new Error("invalid JSON wallet")}function Ja(e){return(Ja="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function za(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function Va(e,t){return(Va=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Za(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=$a(e);if(t){var i=$a(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return Wa(this,r)}}function Wa(e,t){if(t&&("object"===Ja(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return Xa(e)}function Xa(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function $a(e){return($a=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var es=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{A(n.next(e))}catch(e){o(e)}}function s(e){try{A(n.throw(e))}catch(e){o(e)}}function A(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}A((n=n.apply(e,t||[])).next())}))},ts=new h.b("wallet/5.7.0");var rs=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Va(e,t)}(o,e);var t,r,n,i=Za(o);function o(e,t){var r,n;if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,o),r=i.call(this),null!=(n=e)&&Object(c.l)(n.privateKey,32)&&null!=n.address){var a=new Ln(e.privateKey);if(_(Xa(r),"_signingKey",(function(){return a})),_(Xa(r),"address",Zn(r.publicKey)),r.address!==Ae(e.address)&&ts.throwArgumentError("privateKey/address mismatch","privateKey","[REDACTED]"),function(e){var t=e.mnemonic;return t&&t.phrase}(e)){var s=e.mnemonic;_(Xa(r),"_mnemonic",(function(){return{phrase:s.phrase,path:s.path||ea,locale:s.locale||"en"}}));var A=r.mnemonic;Zn(ta.fromMnemonic(A.phrase,null,A.locale).derivePath(A.path).privateKey)!==r.address&&ts.throwArgumentError("mnemonic/address mismatch","privateKey","[REDACTED]")}else _(Xa(r),"_mnemonic",(function(){return null}))}else{if(Ln.isSigningKey(e))"secp256k1"!==e.curve&&ts.throwArgumentError("unsupported curve; must be secp256k1","privateKey","[REDACTED]"),_(Xa(r),"_signingKey",(function(){return e}));else{"string"==typeof e&&e.match(/^[0-9a-f]*$/i)&&64===e.length&&(e="0x"+e);var u=new Ln(e);_(Xa(r),"_signingKey",(function(){return u}))}_(Xa(r),"_mnemonic",(function(){return null})),_(Xa(r),"address",Zn(r.publicKey))}return t&&!En.isProvider(t)&&ts.throwArgumentError("invalid provider","provider",t),_(Xa(r),"provider",t||null),r}return t=o,n=[{key:"createRandom",value:function(e){var t=Object(sa.a)(16);e||(e={}),e.extraEntropy&&(t=Object(c.a)(Object(c.e)(q(Object(c.b)([t,e.extraEntropy])),0,16)));var r=ia(t,e.locale);return o.fromMnemonic(r,e.path,e.locale)}},{key:"fromEncryptedJson",value:function(e,t,r){return Ka(e,t,r).then((function(e){return new o(e)}))}},{key:"fromEncryptedJsonSync",value:function(e,t){return new o(qa(e,t))}},{key:"fromMnemonic",value:function(e,t,r){return t||(t=ea),new o(ta.fromMnemonic(e,null,r).derivePath(t))}}],(r=[{key:"mnemonic",get:function(){return this._mnemonic()}},{key:"privateKey",get:function(){return this._signingKey().privateKey}},{key:"publicKey",get:function(){return this._signingKey().publicKey}},{key:"getAddress",value:function(){return Promise.resolve(this.address)}},{key:"connect",value:function(e){return new o(this,e)}},{key:"signTransaction",value:function(e){var t=this;return D(e).then((function(r){null!=r.from&&(Ae(r.from)!==t.address&&ts.throwArgumentError("transaction from address mismatch","transaction.from",e.from),delete r.from);var n=t._signingKey().signDigest(q(ii(r)));return ii(r,n)}))}},{key:"signMessage",value:function(e){return es(this,void 0,void 0,regeneratorRuntime.mark((function t(){return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",Object(c.m)(this._signingKey().signDigest(to(e))));case 1:case"end":return t.stop()}}),t,this)})))}},{key:"_signTypedData",value:function(e,t,r){return es(this,void 0,void 0,regeneratorRuntime.mark((function n(){var i,o=this;return regeneratorRuntime.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,bo.resolveNames(e,t,r,(function(e){return null==o.provider&&ts.throwError("cannot resolve ENS names without a provider",h.b.errors.UNSUPPORTED_OPERATION,{operation:"resolveName",value:e}),o.provider.resolveName(e)}));case 2:return i=n.sent,n.abrupt("return",Object(c.m)(this._signingKey().signDigest(bo.hash(i.domain,t,i.value))));case 4:case"end":return n.stop()}}),n,this)})))}},{key:"encrypt",value:function(e,t,r){if("function"!=typeof t||r||(r=t,t={}),r&&"function"!=typeof r)throw new Error("invalid callback");return t||(t={}),function(e,t,r,n){try{if(Ae(e.address)!==Zn(e.privateKey))throw new Error("address/privateKey mismatch");if(Qa(e)){var i=e.mnemonic;if(ta.fromMnemonic(i.phrase,null,i.locale).derivePath(i.path||ea).privateKey!=e.privateKey)throw new Error("mnemonic mismatch")}}catch(e){return Promise.reject(e)}"function"!=typeof r||n||(n=r,r={}),r||(r={});var o=Object(c.a)(e.privateKey),a=ga(t),s=null,A=null,u=null;if(Qa(e)){var f=e.mnemonic;s=Object(c.a)(na(f.phrase,f.locale||"en")),A=f.path||ea,u=f.locale||"en"}var h=r.client;h||(h="ethers.js");var l=null;l=r.salt?Object(c.a)(r.salt):Object(sa.a)(32);var g=null;if(r.iv){if(16!==(g=Object(c.a)(r.iv)).length)throw new Error("invalid iv")}else g=Object(sa.a)(16);var d=null;if(r.uuid){if(16!==(d=Object(c.a)(r.uuid)).length)throw new Error("invalid uuid")}else d=Object(sa.a)(16);var p=1<<17,I=8,y=1;return r.scrypt&&(r.scrypt.N&&(p=r.scrypt.N),r.scrypt.r&&(I=r.scrypt.r),r.scrypt.p&&(y=r.scrypt.p)),fa.a.scrypt(a,l,p,I,y,64,n).then((function(t){var r=(t=Object(c.a)(t)).slice(0,16),n=t.slice(16,32),i=t.slice(32,64),a=new ca.a.Counter(g),f=new ca.a.ModeOfOperation.ctr(r,a),b=Object(c.a)(f.encrypt(o)),E=q(Object(c.b)([n,b])),m={address:e.address.substring(2).toLowerCase(),id:pa(d),version:3,crypto:{cipher:"aes-128-ctr",cipherparams:{iv:Object(c.i)(g).substring(2)},ciphertext:Object(c.i)(b).substring(2),kdf:"scrypt",kdfparams:{salt:Object(c.i)(l).substring(2),n:p,dklen:32,p:y,r:I},mac:E.substring(2)}};if(s){var C=Object(sa.a)(16),v=new ca.a.Counter(C),B=new ca.a.ModeOfOperation.ctr(i,v),w=Object(c.a)(B.encrypt(s)),Q=new Date,k=Q.getUTCFullYear()+"-"+la(Q.getUTCMonth()+1,2)+"-"+la(Q.getUTCDate(),2)+"T"+la(Q.getUTCHours(),2)+"-"+la(Q.getUTCMinutes(),2)+"-"+la(Q.getUTCSeconds(),2)+".0Z";m["x-ethers"]={client:h,gethFilename:"UTC--"+k+"--"+m.address,mnemonicCounter:Object(c.i)(C).substring(2),mnemonicCiphertext:Object(c.i)(w).substring(2),path:A,locale:u,version:"0.1"}}return JSON.stringify(m)}))}(this,e,t,r)}}])&&za(t.prototype,r),n&&za(t,n),Object.defineProperty(t,"prototype",{writable:!1}),o}(On);function ns(e,t){return Wn(to(e),t)}function is(e,t,r,n){return Wn(bo.hash(e,t,r),n)}var os="0x0000000000000000000000000000000000000000",as="0x0000000000000000000000000000000000000000000000000000000000000000",ss="Ξ",As=new h.b("networks/5.7.1");function cs(e){var t=function(t,r){null==r&&(r={});var n=[];if(t.InfuraProvider&&"-"!==r.infura)try{n.push(new t.InfuraProvider(e,r.infura))}catch(e){}if(t.EtherscanProvider&&"-"!==r.etherscan)try{n.push(new t.EtherscanProvider(e,r.etherscan))}catch(e){}if(t.AlchemyProvider&&"-"!==r.alchemy)try{n.push(new t.AlchemyProvider(e,r.alchemy))}catch(e){}if(t.PocketProvider&&"-"!==r.pocket){try{var i=new t.PocketProvider(e,r.pocket);i.network&&-1===["goerli","ropsten","rinkeby","sepolia"].indexOf(i.network.name)&&n.push(i)}catch(e){}}if(t.CloudflareProvider&&"-"!==r.cloudflare)try{n.push(new t.CloudflareProvider(e))}catch(e){}if(t.AnkrProvider&&"-"!==r.ankr)try{var o=new t.AnkrProvider(e,r.ankr);o.network&&-1===["ropsten"].indexOf(o.network.name)&&n.push(o)}catch(e){}if(0===n.length)return null;if(t.FallbackProvider){var a=1;return null!=r.quorum?a=r.quorum:"homestead"===e&&(a=2),new t.FallbackProvider(n,a)}return n[0]};return t.renetwork=function(e){return cs(e)},t}function us(e,t){var r=function(r,n){return r.JsonRpcProvider?new r.JsonRpcProvider(e,t):null};return r.renetwork=function(t){return us(e,t)},r}var fs={chainId:1,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"homestead",_defaultProvider:cs("homestead")},hs={chainId:3,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"ropsten",_defaultProvider:cs("ropsten")},ls={chainId:63,name:"classicMordor",_defaultProvider:us("https://www.ethercluster.com/mordor","classicMordor")},gs={unspecified:{chainId:0,name:"unspecified"},homestead:fs,mainnet:fs,morden:{chainId:2,name:"morden"},ropsten:hs,testnet:hs,rinkeby:{chainId:4,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"rinkeby",_defaultProvider:cs("rinkeby")},kovan:{chainId:42,name:"kovan",_defaultProvider:cs("kovan")},goerli:{chainId:5,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"goerli",_defaultProvider:cs("goerli")},kintsugi:{chainId:1337702,name:"kintsugi"},sepolia:{chainId:11155111,name:"sepolia",_defaultProvider:cs("sepolia")},classic:{chainId:61,name:"classic",_defaultProvider:us("https://www.ethercluster.com/etc","classic")},classicMorden:{chainId:62,name:"classicMorden"},classicMordor:ls,classicTestnet:ls,classicKotti:{chainId:6,name:"classicKotti",_defaultProvider:us("https://www.ethercluster.com/kotti","classicKotti")},xdai:{chainId:100,name:"xdai"},matic:{chainId:137,name:"matic",_defaultProvider:cs("matic")},maticmum:{chainId:80001,name:"maticmum"},optimism:{chainId:10,name:"optimism",_defaultProvider:cs("optimism")},"optimism-kovan":{chainId:69,name:"optimism-kovan"},"optimism-goerli":{chainId:420,name:"optimism-goerli"},arbitrum:{chainId:42161,name:"arbitrum"},"arbitrum-rinkeby":{chainId:421611,name:"arbitrum-rinkeby"},"arbitrum-goerli":{chainId:421613,name:"arbitrum-goerli"},bnb:{chainId:56,name:"bnb"},bnbt:{chainId:97,name:"bnbt"}};function ds(e){if(null==e)return null;if("number"==typeof e){for(var t in gs){var r=gs[t];if(r.chainId===e)return{name:r.name,chainId:r.chainId,ensAddress:r.ensAddress||null,_defaultProvider:r._defaultProvider||null}}return{chainId:e,name:"unknown"}}if("string"==typeof e){var n=gs[e];return null==n?null:{name:n.name,chainId:n.chainId,ensAddress:n.ensAddress,_defaultProvider:n._defaultProvider||null}}var i=gs[e.name];if(!i)return"number"!=typeof e.chainId&&As.throwArgumentError("invalid network chainId","network",e),e;0!==e.chainId&&e.chainId!==i.chainId&&As.throwArgumentError("network chainId mismatch","network",e);var o,a=e._defaultProvider||null;return null==a&&i._defaultProvider&&(a=(o=i._defaultProvider)&&"function"==typeof o.renetwork?i._defaultProvider.renetwork(e):i._defaultProvider),{name:e.name,chainId:i.chainId,ensAddress:e.ensAddress||i.ensAddress||null,_defaultProvider:a}}function ps(e){e=atob(e);for(var t=[],r=0;r<e.length;r++)t.push(e.charCodeAt(r));return Object(c.a)(t)}function Is(e){e=Object(c.a)(e);for(var t="",r=0;r<e.length;r++)t+=String.fromCharCode(e[r]);return btoa(t)}function ys(e,t){null==t&&(t=1);var r=[],n=r.forEach;return function e(t,i){n.call(t,(function(t){i>0&&Array.isArray(t)?e(t,i-1):r.push(t)}))}(e,t),r}function bs(e){return function(e){var t=0;return function(){return e[t++]}}(function(e){var t=0;function r(){return e[t++]<<8|e[t++]}for(var n=r(),i=1,o=[0,1],a=1;a<n;a++)o.push(i+=r());var s=r(),A=t;t+=s;var c=0,u=0;function f(){return 0==c&&(u=u<<8|e[t++],c=8),u>>--c&1}for(var h=Math.pow(2,31),l=h>>>1,g=l>>1,d=h-1,p=0,I=0;I<31;I++)p=p<<1|f();for(var y=[],b=0,E=h;;){for(var m=Math.floor(((p-b+1)*i-1)/E),C=0,v=n;v-C>1;){var B=C+v>>>1;m<o[B]?v=B:C=B}if(0==C)break;y.push(C);for(var w=b+Math.floor(E*o[C]/i),Q=b+Math.floor(E*o[C+1]/i)-1;0==((w^Q)&l);)p=p<<1&d|f(),w=w<<1&d,Q=Q<<1&d|1;for(;w&~Q&g;)p=p&l|p<<1&d>>>1|f(),w=w<<1^l,Q=(Q^l)<<1|l|1;b=w,E=1+Q-w}var k=n-4;return y.map((function(t){switch(t-k){case 3:return k+65792+(e[A++]<<16|e[A++]<<8|e[A++]);case 2:return k+256+(e[A++]<<8|e[A++]);case 1:return k+e[A++];default:return t-1}}))}(e))}function Es(e){return 1&e?~e>>1:e>>1}function ms(e,t){for(var r=Array(e),n=0,i=-1;n<e;n++)r[n]=i+=1+t();return r}function Cs(e,t){for(var r=Array(e),n=0,i=0;n<e;n++)r[n]=i+=Es(t());return r}function vs(e,t){for(var r=ms(e(),e),n=e(),i=ms(n,e),o=function(e,t){for(var r=Array(e),n=0;n<e;n++)r[n]=1+t();return r}(n,e),a=0;a<n;a++)for(var s=0;s<o[a];s++)r.push(i[a]+s);return t?r.map((function(e){return t[e]})):r}function Bs(e,t,r){for(var n=Array(e).fill(void 0).map((function(){return[]})),i=0;i<t;i++)Cs(e,r).forEach((function(e,t){return n[t].push(e)}));return n}function ws(e,t){var r=1+t(),n=t(),i=function(e){for(var t=[];;){var r=e();if(0==r)break;t.push(r)}return t}(t);return ys(Bs(i.length,1+e,t).map((function(e,t){var o=e[0],a=e.slice(1);return Array(i[t]).fill(void 0).map((function(e,t){var i=t*n;return[o+t*r,a.map((function(e){return e+i}))]}))})))}function Qs(e,t){return Bs(1+t(),1+e,t).map((function(e){return[e[0],e.slice(1)]}))}function ks(e){return function(e){if(Array.isArray(e))return Ss(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||_s(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function _s(e,t){if(e){if("string"==typeof e)return Ss(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Ss(e,t):void 0}}function Ss(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var Ds,Ms,Rs=bs(ps("AEQF2AO2DEsA2wIrAGsBRABxAN8AZwCcAEwAqgA0AGwAUgByADcATAAVAFYAIQAyACEAKAAYAFgAGwAjABQAMAAmADIAFAAfABQAKwATACoADgAbAA8AHQAYABoAGQAxADgALAAoADwAEwA9ABMAGgARAA4ADwAWABMAFgAIAA8AHgQXBYMA5BHJAS8JtAYoAe4AExozi0UAH21tAaMnBT8CrnIyhrMDhRgDygIBUAEHcoFHUPe8AXBjAewCjgDQR8IICIcEcQLwATXCDgzvHwBmBoHNAqsBdBcUAykgDhAMShskMgo8AY8jqAQfAUAfHw8BDw87MioGlCIPBwZCa4ELatMAAMspJVgsDl8AIhckSg8XAHdvTwBcIQEiDT4OPhUqbyECAEoAS34Aej8Ybx83JgT/Xw8gHxZ/7w8RICxPHA9vBw+Pfw8PHwAPFv+fAsAvCc8vEr8ivwD/EQ8Bol8OEBa/A78hrwAPCU8vESNvvwWfHwNfAVoDHr+ZAAED34YaAdJPAK7PLwSEgDLHAGo1Pz8Pvx9fUwMrpb8O/58VTzAPIBoXIyQJNF8hpwIVAT8YGAUADDNBaX3RAMomJCg9EhUeA29MABsZBTMNJipjOhc19gcIDR8bBwQHEggCWi6DIgLuAQYA+BAFCha3A5XiAEsqM7UFFgFLhAMjFTMYE1Klnw74nRVBG/ASCm0BYRN/BrsU3VoWy+S0vV8LQx+vN8gF2AC2AK5EAWwApgYDKmAAroQ0NDQ0AT+OCg7wAAIHRAbpNgVcBV0APTA5BfbPFgMLzcYL/QqqA82eBALKCjQCjqYCht0/k2+OAsXQAoP3ASTKDgDw6ACKAUYCMpIKJpRaAE4A5womABzZvs0REEKiACIQAd5QdAECAj4Ywg/wGqY2AVgAYADYvAoCGAEubA0gvAY2ALAAbpbvqpyEAGAEpgQAJgAG7gAgAEACmghUFwCqAMpAINQIwC4DthRAAPcycKgApoIdABwBfCisABoATwBqASIAvhnSBP8aH/ECeAKXAq40NjgDBTwFYQU6AXs3oABgAD4XNgmcCY1eCl5tIFZeUqGgyoNHABgAEQAaABNwWQAmABMATPMa3T34ADldyprmM1M2XociUQgLzvwAXT3xABgAEQAaABNwIGFAnADD8AAgAD4BBJWzaCcIAIEBFMAWwKoAAdq9BWAF5wLQpALEtQAKUSGkahR4GnJM+gsAwCgeFAiUAECQ0BQuL8AAIAAAADKeIheclvFqQAAETr4iAMxIARMgAMIoHhQIAn0E0pDQFC4HhznoAAAAIAI2C0/4lvFqQAAETgBJJwYCAy4ABgYAFAA8MBKYEH4eRhTkAjYeFcgACAYAeABsOqyQ5gRwDayqugEgaIIAtgoACgDmEABmBAWGme5OBJJA2m4cDeoAmITWAXwrMgOgAGwBCh6CBXYF1Tzg1wKAAFdiuABRAFwAXQBsAG8AdgBrAHYAbwCEAHEwfxQBVE5TEQADVFhTBwBDANILAqcCzgLTApQCrQL6vAAMAL8APLhNBKkE6glGKTAU4Dr4N2EYEwBCkABKk8rHAbYBmwIoAiU4Ajf/Aq4CowCAANIChzgaNBsCsTgeODcFXrgClQKdAqQBiQGYAqsCsjTsNHsfNPA0ixsAWTWiOAMFPDQSNCk2BDZHNow2TTZUNhk28Jk9VzI3QkEoAoICoQKwAqcAQAAxBV4FXbS9BW47YkIXP1ciUqs05DS/FwABUwJW11e6nHuYZmSh/RAYA8oMKvZ8KASoUAJYWAJ6ILAsAZSoqjpgA0ocBIhmDgDWAAawRDQoAAcuAj5iAHABZiR2AIgiHgCaAU68ACxuHAG0ygM8MiZIAlgBdF4GagJqAPZOHAMuBgoATkYAsABiAHgAMLoGDPj0HpKEBAAOJgAuALggTAHWAeAMEDbd20Uege0ADwAWADkAQgA9OHd+2MUQZBBhBgNNDkxxPxUQArEPqwvqERoM1irQ090ANK4H8ANYB/ADWANYB/AH8ANYB/ADWANYA1gDWBwP8B/YxRBkD00EcgWTBZAE2wiIJk4RhgctCNdUEnQjHEwDSgEBIypJITuYMxAlR0wRTQgIATZHbKx9PQNMMbBU+pCnA9AyVDlxBgMedhKlAC8PeCE1uk6DekxxpQpQT7NX9wBFBgASqwAS5gBJDSgAUCwGPQBI4zTYABNGAE2bAE3KAExdGABKaAbgAFBXAFCOAFBJABI2SWdObALDOq0//QomCZhvwHdTBkIQHCemEPgMNAG2ATwN7kvZBPIGPATKH34ZGg/OlZ0Ipi3eDO4m5C6igFsj9iqEBe5L9TzeC05RaQ9aC2YJ5DpkgU8DIgEOIowK3g06CG4Q9ArKbA3mEUYHOgPWSZsApgcCCxIdNhW2JhFirQsKOXgG/Br3C5AmsBMqev0F1BoiBk4BKhsAANAu6IWxWjJcHU9gBgQLJiPIFKlQIQ0mQLh4SRocBxYlqgKSQ3FKiFE3HpQh9zw+DWcuFFF9B/Y8BhlQC4I8n0asRQ8R0z6OPUkiSkwtBDaALDAnjAnQD4YMunxzAVoJIgmyDHITMhEYN8YIOgcaLpclJxYIIkaWYJsE+KAD9BPSAwwFQAlCBxQDthwuEy8VKgUOgSXYAvQ21i60ApBWgQEYBcwPJh/gEFFH4Q7qCJwCZgOEJewALhUiABginAhEZABgj9lTBi7MCMhqbSN1A2gU6GIRdAeSDlgHqBw0FcAc4nDJXgyGCSiksAlcAXYJmgFgBOQICjVcjKEgQmdUi1kYnCBiQUBd/QIyDGYVoES+h3kCjA9sEhwBNgF0BzoNAgJ4Ee4RbBCWCOyGBTW2M/k6JgRQIYQgEgooA1BszwsoJvoM+WoBpBJjAw00PnfvZ6xgtyUX/gcaMsZBYSHyC5NPzgydGsIYQ1QvGeUHwAP0GvQn60FYBgADpAQUOk4z7wS+C2oIjAlAAEoOpBgH2BhrCnKM0QEyjAG4mgNYkoQCcJAGOAcMAGgMiAV65gAeAqgIpAAGANADWAA6Aq4HngAaAIZCAT4DKDABIuYCkAOUCDLMAZYwAfQqBBzEDBYA+DhuSwLDsgKAa2ajBd5ZAo8CSjYBTiYEBk9IUgOwcuIA3ABMBhTgSAEWrEvMG+REAeBwLADIAPwABjYHBkIBzgH0bgC4AWALMgmjtLYBTuoqAIQAFmwB2AKKAN4ANgCA8gFUAE4FWvoF1AJQSgESMhksWGIBvAMgATQBDgB6BsyOpsoIIARuB9QCEBwV4gLvLwe2AgMi4BPOQsYCvd9WADIXUu5eZwqoCqdeaAC0YTQHMnM9UQAPH6k+yAdy/BZIiQImSwBQ5gBQQzSaNTFWSTYBpwGqKQK38AFtqwBI/wK37gK3rQK3sAK6280C0gK33AK3zxAAUEIAUD9SklKDArekArw5AEQAzAHCO147WTteO1k7XjtZO147WTteO1kDmChYI03AVU0oJqkKbV9GYewMpw3VRMk6ShPcYFJgMxPJLbgUwhXPJVcZPhq9JwYl5VUKDwUt1GYxCC00dhe9AEApaYNCY4ceMQpMHOhTklT5LRwAskujM7ANrRsWREEFSHXuYisWDwojAmSCAmJDXE6wXDchAqH4AmiZAmYKAp+FOBwMAmY8AmYnBG8EgAN/FAN+kzkHOXgYOYM6JCQCbB4CMjc4CwJtyAJtr/CLADRoRiwBaADfAOIASwYHmQyOAP8MwwAOtgJ3MAJ2o0ACeUxEAni7Hl3cRa9G9AJ8QAJ6yQJ9CgJ88UgBSH5kJQAsFklZSlwWGErNAtECAtDNSygDiFADh+dExpEzAvKiXQQDA69Lz0wuJgTQTU1NsAKLQAKK2cIcCB5EaAa4Ao44Ao5dQZiCAo7aAo5deVG1UzYLUtVUhgKT/AKTDQDqAB1VH1WwVdEHLBwplocy4nhnRTw6ApegAu+zWCKpAFomApaQApZ9nQCqWa1aCoJOADwClrYClk9cRVzSApnMApllXMtdCBoCnJw5wzqeApwXAp+cAp65iwAeEDIrEAKd8gKekwC2PmE1YfACntQCoG8BqgKeoCACnk+mY8lkKCYsAiewAiZ/AqD8AqBN2AKmMAKlzwKoAAB+AqfzaH1osgAESmodatICrOQCrK8CrWgCrQMCVx4CVd0CseLYAx9PbJgCsr4OArLpGGzhbWRtSWADJc4Ctl08QG6RAylGArhfArlIFgK5K3hwN3DiAr0aAy2zAzISAr6JcgMDM3ICvhtzI3NQAsPMAsMFc4N0TDZGdOEDPKgDPJsDPcACxX0CxkgCxhGKAshqUgLIRQLJUALJLwJkngLd03h6YniveSZL0QMYpGcDAmH1GfSVJXsMXpNevBICz2wCz20wTFTT9BSgAMeuAs90ASrrA04TfkwGAtwoAtuLAtJQA1JdA1NgAQIDVY2AikABzBfuYUZ2AILPg44C2sgC2d+EEYRKpz0DhqYAMANkD4ZyWvoAVgLfZgLeuXR4AuIw7RUB8zEoAfScAfLTiALr9ALpcXoAAur6AurlAPpIAboC7ooC652Wq5cEAu5AA4XhmHpw4XGiAvMEAGoDjheZlAL3FAORbwOSiAL3mQL52gL4Z5odmqy8OJsfA52EAv77ARwAOp8dn7QDBY4DpmsDptoA0sYDBmuhiaIGCgMMSgFgASACtgNGAJwEgLpoBgC8BGzAEowcggCEDC6kdjoAJAM0C5IKRoABZCgiAIzw3AYBLACkfng9ogigkgNmWAN6AEQCvrkEVqTGAwCsBRbAA+4iQkMCHR072jI2PTbUNsk2RjY5NvA23TZKNiU3EDcZN5I+RTxDRTBCJkK5VBYKFhZfwQCWygU3AJBRHpu+OytgNxa61A40GMsYjsn7BVwFXQVcBV0FaAVdBVwFXQVcBV0FXAVdBVwFXUsaCNyKAK4AAQUHBwKU7oICoW1e7jAEzgPxA+YDwgCkBFDAwADABKzAAOxFLhitA1UFTDeyPkM+bj51QkRCuwTQWWQ8X+0AWBYzsACNA8xwzAGm7EZ/QisoCTAbLDs6fnLfb8H2GccsbgFw13M1HAVkBW/Jxsm9CNRO8E8FDD0FBQw9FkcClOYCoMFegpDfADgcMiA2AJQACB8AsigKAIzIEAJKeBIApY5yPZQIAKQiHb4fvj5BKSRPQrZCOz0oXyxgOywfKAnGbgMClQaCAkILXgdeCD9IIGUgQj5fPoY+dT52Ao5CM0dAX9BTVG9SDzFwWTQAbxBzJF/lOEIQQglCCkKJIAls5AcClQICoKPMODEFxhi6KSAbiyfIRrMjtCgdWCAkPlFBIitCsEJRzAbMAV/OEyQzDg0OAQQEJ36i328/Mk9AybDJsQlq3tDRApUKAkFzXf1d/j9uALYP6hCoFgCTGD8kPsFKQiobrm0+zj0KSD8kPnVCRBwMDyJRTHFgMTJa5rwXQiQ2YfI/JD7BMEJEHGINTw4TOFlIRzwJO0icMQpyPyQ+wzJCRBv6DVgnKB01NgUKj2bwYzMqCoBkznBgEF+zYDIocwRIX+NgHj4HICNfh2C4CwdwFWpTG/lgUhYGAwRfv2Ts8mAaXzVgml/XYIJfuWC4HI1gUF9pYJZgMR6ilQHMAOwLAlDRefC0in4AXAEJA6PjCwc0IamOANMMCAECRQDFNRTZBgd+CwQlRA+r6+gLBDEFBnwUBXgKATIArwAGRAAHA3cDdAN2A3kDdwN9A3oDdQN7A30DfAN4A3oDfQAYEAAlAtYASwMAUAFsAHcKAHcAmgB3AHUAdQB2AHVu8UgAygDAAHcAdQB1AHYAdQALCgB3AAsAmgB3AAsCOwB3AAtu8UgAygDAAHgKAJoAdwB3AHUAdQB2AHUAeAB1AHUAdgB1bvFIAMoAwAALCgCaAHcACwB3AAsCOwB3AAtu8UgAygDAAH4ACwGgALcBpwC6AahdAu0COwLtbvFIAMoAwAALCgCaAu0ACwLtAAsCOwLtAAtu8UgAygDAA24ACwNvAAu0VsQAAzsAABCkjUIpAAsAUIusOggWcgMeBxVsGwL67U/2HlzmWOEeOgALASvuAAseAfpKUpnpGgYJDCIZM6YyARUE9ThqAD5iXQgnAJYJPnOzw0ZAEZxEKsIAkA4DhAHnTAIDxxUDK0lxCQlPYgIvIQVYJQBVqE1GakUAKGYiDToSBA1EtAYAXQJYAIF8GgMHRyAAIAjOe9YncekRAA0KACUrjwE7Ayc6AAYWAqaiKG4McEcqANoN3+Mg9TwCBhIkuCny+JwUQ29L008JluRxu3K+oAdqiHOqFH0AG5SUIfUJ5SxCGfxdipRzqTmT4V5Zb+r1Uo4Vm+NqSSEl2mNvR2JhIa8SpYO6ntdwFXHCWTCK8f2+Hxo7uiG3drDycAuKIMP5bhi06ACnqArH1rz4Rqg//lm6SgJGEVbF9xJHISaR6HxqxSnkw6shDnelHKNEfGUXSJRJ1GcsmtJw25xrZMDK9gXSm1/YMkdX4/6NKYOdtk/NQ3/NnDASjTc3fPjIjW/5sVfVObX2oTDWkr1dF9f3kxBsD3/3aQO8hPfRz+e0uEiJqt1161griu7gz8hDDwtpy+F+BWtefnKHZPAxcZoWbnznhJpy0e842j36bcNzGnIEusgGX0a8ZxsnjcSsPDZ09yZ36fCQbriHeQ72JRMILNl6ePPf2HWoVwgWAm1fb3V2sAY0+B6rAXqSwPBgseVmoqsBTSrm91+XasMYYySI8eeRxH3ZvHkMz3BQ5aJ3iUVbYPNM3/7emRtjlsMgv/9VyTsyt/mK+8fgWeT6SoFaclXqn42dAIsvAarF5vNNWHzKSkKQ/8Hfk5ZWK7r9yliOsooyBjRhfkHP4Q2DkWXQi6FG/9r/IwbmkV5T7JSopHKn1pJwm9tb5Ot0oyN1Z2mPpKXHTxx2nlK08fKk1hEYA8WgVVWL5lgx0iTv+KdojJeU23ZDjmiubXOxVXJKKi2Wjuh2HLZOFLiSC7Tls5SMh4f+Pj6xUSrNjFqLGehRNB8lC0QSLNmkJJx/wSG3MnjE9T1CkPwJI0wH2lfzwETIiVqUxg0dfu5q39Gt+hwdcxkhhNvQ4TyrBceof3Mhs/IxFci1HmHr4FMZgXEEczPiGCx0HRwzAqDq2j9AVm1kwN0mRVLWLylgtoPNapF5cY4Y1wJh/e0BBwZj44YgZrDNqvD/9Hv7GFYdUQeDJuQ3EWI4HaKqavU1XjC/n41kT4L79kqGq0kLhdTZvgP3TA3fS0ozVz+5piZsoOtIvBUFoMKbNcmBL6YxxaUAusHB38XrS8dQMnQwJfUUkpRoGr5AUeWicvBTzyK9g77+yCkf5PAysL7r/JjcZgrbvRpMW9iyaxZvKO6ceZN2EwIxKwVFPuvFuiEPGCoagbMo+SpydLrXqBzNCDGFCrO/rkcwa2xhokQZ5CdZ0AsU3JfSqJ6n5I14YA+P/uAgfhPU84Tlw7cEFfp7AEE8ey4sP12PTt4Cods1GRgDOB5xvyiR5m+Bx8O5nBCNctU8BevfV5A08x6RHd5jcwPTMDSZJOedIZ1cGQ704lxbAzqZOP05ZxaOghzSdvFBHYqomATARyAADK4elP8Ly3IrUZKfWh23Xy20uBUmLS4Pfagu9+oyVa2iPgqRP3F2CTUsvJ7+RYnN8fFZbU/HVvxvcFFDKkiTqV5UBZ3Gz54JAKByi9hkKMZJvuGgcSYXFmw08UyoQyVdfTD1/dMkCHXcTGAKeROgArsvmRrQTLUOXioOHGK2QkjHuoYFgXciZoTJd6Fs5q1QX1G+p/e26hYsEf7QZD1nnIyl/SFkNtYYmmBhpBrxl9WbY0YpHWRuw2Ll/tj9mD8P4snVzJl4F9J+1arVeTb9E5r2ILH04qStjxQNwn3m4YNqxmaNbLAqW2TN6LidwuJRqS+NXbtqxoeDXpxeGWmxzSkWxjkyCkX4NQRme6q5SAcC+M7+9ETfA/EwrzQajKakCwYyeunP6ZFlxU2oMEn1Pz31zeStW74G406ZJFCl1wAXIoUKkWotYEpOuXB1uVNxJ63dpJEqfxBeptwIHNrPz8BllZoIcBoXwgfJ+8VAUnVPvRvexnw0Ma/WiGYuJO5y8QTvEYBigFmhUxY5RqzE8OcywN/8m4UYrlaniJO75XQ6KSo9+tWHlu+hMi0UVdiKQp7NelnoZUzNaIyBPVeOwK6GNp+FfHuPOoyhaWuNvTYFkvxscMQWDh+zeFCFkgwbXftiV23ywJ4+uwRqmg9k3KzwIQpzppt8DBBOMbrqwQM5Gb05sEwdKzMiAqOloaA/lr0KA+1pr0/+HiWoiIjHA/wir2nIuS3PeU/ji3O6ZwoxcR1SZ9FhtLC5S0FIzFhbBWcGVP/KpxOPSiUoAdWUpqKH++6Scz507iCcxYI6rdMBICPJZea7OcmeFw5mObJSiqpjg2UoWNIs+cFhyDSt6geV5qgi3FunmwwDoGSMgerFOZGX1m0dMCYo5XOruxO063dwENK9DbnVM9wYFREzh4vyU1WYYJ/LRRp6oxgjqP/X5a8/4Af6p6NWkQferzBmXme0zY/4nwMJm/wd1tIqSwGz+E3xPEAOoZlJit3XddD7/BT1pllzOx+8bmQtANQ/S6fZexc6qi3W+Q2xcmXTUhuS5mpHQRvcxZUN0S5+PL9lXWUAaRZhEH8hTdAcuNMMCuVNKTEGtSUKNi3O6KhSaTzck8csZ2vWRZ+d7mW8c4IKwXIYd25S/zIftPkwPzufjEvOHWVD1m+FjpDVUTV0DGDuHj6QnaEwLu/dEgdLQOg9E1Sro9XHJ8ykLAwtPu+pxqKDuFexqON1sKQm7rwbE1E68UCfA/erovrTCG+DBSNg0l4goDQvZN6uNlbyLpcZAwj2UclycvLpIZMgv4yRlpb3YuMftozorbcGVHt/VeDV3+Fdf1TP0iuaCsPi2G4XeGhsyF1ubVDxkoJhmniQ0/jSg/eYML9KLfnCFgISWkp91eauR3IQvED0nAPXK+6hPCYs+n3+hCZbiskmVMG2da+0EsZPonUeIY8EbfusQXjsK/eFDaosbPjEfQS0RKG7yj5GG69M7MeO1HmiUYocgygJHL6M1qzUDDwUSmr99V7Sdr2F3JjQAJY+F0yH33Iv3+C9M38eML7gTgmNu/r2bUMiPvpYbZ6v1/IaESirBHNa7mPKn4dEmYg7v/+HQgPN1G79jBQ1+soydfDC2r+h2Bl/KIc5KjMK7OH6nb1jLsNf0EHVe2KBiE51ox636uyG6Lho0t3J34L5QY/ilE3mikaF4HKXG1mG1rCevT1Vv6GavltxoQe/bMrpZvRggnBxSEPEeEzkEdOxTnPXHVjUYdw8JYvjB/o7Eegc3Ma+NUxLLnsK0kJlinPmUHzHGtrk5+CAbVzFOBqpyy3QVUnzTDfC/0XD94/okH+OB+i7g9lolhWIjSnfIb+Eq43ZXOWmwvjyV/qqD+t0e+7mTEM74qP/Ozt8nmC7mRpyu63OB4KnUzFc074SqoyPUAgM+/TJGFo6T44EHnQU4X4z6qannVqgw/U7zCpwcmXV1AubIrvOmkKHazJAR55ePjp5tLBsN8vAqs3NAHdcEHOR2xQ0lsNAFzSUuxFQCFYvXLZJdOj9p4fNq6p0HBGUik2YzaI4xySy91KzhQ0+q1hjxvImRwPRf76tChlRkhRCi74NXZ9qUNeIwP+s5p+3m5nwPdNOHgSLD79n7O9m1n1uDHiMntq4nkYwV5OZ1ENbXxFd4PgrlvavZsyUO4MqYlqqn1O8W/I1dEZq5dXhrbETLaZIbC2Kj/Aa/QM+fqUOHdf0tXAQ1huZ3cmWECWSXy/43j35+Mvq9xws7JKseriZ1pEWKc8qlzNrGPUGcVgOa9cPJYIJsGnJTAUsEcDOEVULO5x0rXBijc1lgXEzQQKhROf8zIV82w8eswc78YX11KYLWQRcgHNJElBxfXr72lS2RBSl07qTKorO2uUDZr3sFhYsvnhLZn0A94KRzJ/7DEGIAhW5ZWFpL8gEwu1aLA9MuWZzNwl8Oze9Y+bX+v9gywRVnoB5I/8kXTXU3141yRLYrIOOz6SOnyHNy4SieqzkBXharjfjqq1q6tklaEbA8Qfm2DaIPs7OTq/nvJBjKfO2H9bH2cCMh1+5gspfycu8f/cuuRmtDjyqZ7uCIMyjdV3a+p3fqmXsRx4C8lujezIFHnQiVTXLXuI1XrwN3+siYYj2HHTvESUx8DlOTXpak9qFRK+L3mgJ1WsD7F4cu1aJoFoYQnu+wGDMOjJM3kiBQWHCcvhJ/HRdxodOQp45YZaOTA22Nb4XKCVxqkbwMYFhzYQYIAnCW8FW14uf98jhUG2zrKhQQ0q0CEq0t5nXyvUyvR8DvD69LU+g3i+HFWQMQ8PqZuHD+sNKAV0+M6EJC0szq7rEr7B5bQ8BcNHzvDMc9eqB5ZCQdTf80Obn4uzjwpYU7SISdtV0QGa9D3Wrh2BDQtpBKxaNFV+/Cy2P/Sv+8s7Ud0Fd74X4+o/TNztWgETUapy+majNQ68Lq3ee0ZO48VEbTZYiH1Co4OlfWef82RWeyUXo7woM03PyapGfikTnQinoNq5z5veLpeMV3HCAMTaZmA1oGLAn7XS3XYsz+XK7VMQsc4XKrmDXOLU/pSXVNUq8dIqTba///3x6LiLS6xs1xuCAYSfcQ3+rQgmu7uvf3THKt5Ooo97TqcbRqxx7EASizaQCBQllG/rYxVapMLgtLbZS64w1MDBMXX+PQpBKNwqUKOf2DDRDUXQf9EhOS0Qj4nTmlA8dzSLz/G1d+Ud8MTy/6ghhdiLpeerGY/UlDOfiuqFsMUU5/UYlP+BAmgRLuNpvrUaLlVkrqDievNVEAwF+4CoM1MZTmjxjJMsKJq+u8Zd7tNCUFy6LiyYXRJQ4VyvEQFFaCGKsxIwQkk7EzZ6LTJq2hUuPhvAW+gQnSG6J+MszC+7QCRHcnqDdyNRJ6T9xyS87A6MDutbzKGvGktpbXqtzWtXb9HsfK2cBMomjN9a4y+TaJLnXxAeX/HWzmf4cR4vALt/P4w4qgKY04ml4ZdLOinFYS6cup3G/1ie4+t1eOnpBNlqGqs75ilzkT4+DsZQxNvaSKJ//6zIbbk/M7LOhFmRc/1R+kBtz7JFGdZm/COotIdvQoXpTqP/1uqEUmCb/QWoGLMwO5ANcHzxdY48IGP5+J+zKOTBFZ4Pid+GTM+Wq12MV/H86xEJptBa6T+p3kgpwLedManBHC2GgNrFpoN2xnrMz9WFWX/8/ygSBkavq2Uv7FdCsLEYLu9LLIvAU0bNRDtzYl+/vXmjpIvuJFYjmI0im6QEYqnIeMsNjXG4vIutIGHijeAG/9EDBozKV5cldkHbLxHh25vT+ZEzbhXlqvpzKJwcEgfNwLAKFeo0/pvEE10XDB+EXRTXtSzJozQKFFAJhMxYkVaCW+E9AL7tMeU8acxidHqzb6lX4691UsDpy/LLRmT+epgW56+5Cw8tB4kMUv6s9lh3eRKbyGs+H/4mQMaYzPTf2OOdokEn+zzgvoD3FqNKk8QqGAXVsqcGdXrT62fSPkR2vROFi68A6se86UxRUk4cajfPyCC4G5wDhD+zNq4jodQ4u4n/m37Lr36n4LIAAsVr02dFi9AiwA81MYs2rm4eDlDNmdMRvEKRHfBwW5DdMNp0jPFZMeARqF/wL4XBfd+EMLBfMzpH5GH6NaW+1vrvMdg+VxDzatk3MXgO3ro3P/DpcC6+Mo4MySJhKJhSR01SGGGp5hPWmrrUgrv3lDnP+HhcI3nt3YqBoVAVTBAQT5iuhTg8nvPtd8ZeYj6w1x6RqGUBrSku7+N1+BaasZvjTk64RoIDlL8brpEcJx3OmY7jLoZsswdtmhfC/G21llXhITOwmvRDDeTTPbyASOa16cF5/A1fZAidJpqju3wYAy9avPR1ya6eNp9K8XYrrtuxlqi+bDKwlfrYdR0RRiKRVTLOH85+ZY7XSmzRpfZBJjaTa81VDcJHpZnZnSQLASGYW9l51ZV/h7eVzTi3Hv6hUsgc/51AqJRTkpbFVLXXszoBL8nBX0u/0jBLT8nH+fJePbrwURT58OY+UieRjd1vs04w0VG5VN2U6MoGZkQzKN/ptz0Q366dxoTGmj7i1NQGHi9GgnquXFYdrCfZBmeb7s0T6yrdlZH5cZuwHFyIJ/kAtGsTg0xH5taAAq44BAk1CPk9KVVbqQzrCUiFdF/6gtlPQ8bHHc1G1W92MXGZ5HEHftyLYs8mbD/9xYRUWkHmlM0zC2ilJlnNgV4bfALpQghxOUoZL7VTqtCHIaQSXm+YUMnpkXybnV+A6xlm2CVy8fn0Xlm2XRa0+zzOa21JWWmixfiPMSCZ7qA4rS93VN3pkpF1s5TonQjisHf7iU9ZGvUPOAKZcR1pbeVf/Ul7OhepGCaId9wOtqo7pJ7yLcBZ0pFkOF28y4zEI/kcUNmutBHaQpBdNM8vjCS6HZRokkeo88TBAjGyG7SR+6vUgTcyK9Imalj0kuxz0wmK+byQU11AiJFk/ya5dNduRClcnU64yGu/ieWSeOos1t3ep+RPIWQ2pyTYVbZltTbsb7NiwSi3AV+8KLWk7LxCnfZUetEM8ThnsSoGH38/nyAwFguJp8FjvlHtcWZuU4hPva0rHfr0UhOOJ/F6vS62FW7KzkmRll2HEc7oUq4fyi5T70Vl7YVIfsPHUCdHesf9Lk7WNVWO75JDkYbMI8TOW8JKVtLY9d6UJRITO8oKo0xS+o99Yy04iniGHAaGj88kEWgwv0OrHdY/nr76DOGNS59hXCGXzTKUvDl9iKpLSWYN1lxIeyywdNpTkhay74w2jFT6NS8qkjo5CxA1yfSYwp6AJIZNKIeEK5PJAW7ORgWgwp0VgzYpqovMrWxbu+DGZ6Lhie1RAqpzm8VUzKJOH3mCzWuTOLsN3VT/dv2eeYe9UjbR8YTBsLz7q60VN1sU51k+um1f8JxD5pPhbhSC8rRaB454tmh6YUWrJI3+GWY0qeWioj/tbkYITOkJaeuGt4JrJvHA+l0Gu7kY7XOaa05alMnRWVCXqFgLIwSY4uF59Ue5SU4QKuc/HamDxbr0x6csCetXGoP7Qn1Bk/J9DsynO/UD6iZ1Hyrz+jit0hDCwi/E9OjgKTbB3ZQKQ/0ZOvevfNHG0NK4Aj3Cp7NpRk07RT1i/S0EL93Ag8GRgKI9CfpajKyK6+Jj/PI1KO5/85VAwz2AwzP8FTBb075IxCXv6T9RVvWT2tUaqxDS92zrGUbWzUYk9mSs82pECH+fkqsDt93VW++4YsR/dHCYcQSYTO/KaBMDj9LSD/J/+z20Kq8XvZUAIHtm9hRPP3ItbuAu2Hm5lkPs92pd7kCxgRs0xOVBnZ13ccdA0aunrwv9SdqElJRC3g+oCu+nXyCgmXUs9yMjTMAIHfxZV+aPKcZeUBWt057Xo85Ks1Ir5gzEHCWqZEhrLZMuF11ziGtFQUds/EESajhagzcKsxamcSZxGth4UII+adPhQkUnx2WyN+4YWR+r3f8MnkyGFuR4zjzxJS8WsQYR5PTyRaD9ixa6Mh741nBHbzfjXHskGDq179xaRNrCIB1z1xRfWfjqw2pHc1zk9xlPpL8sQWAIuETZZhbnmL54rceXVNRvUiKrrqIkeogsl0XXb17ylNb0f4GA9Wd44vffEG8FSZGHEL2fbaTGRcSiCeA8PmA/f6Hz8HCS76fXUHwgwkzSwlI71ekZ7Fapmlk/KC+Hs8hUcw3N2LN5LhkVYyizYFl/uPeVP5lsoJHhhfWvvSWruCUW1ZcJOeuTbrDgywJ/qG07gZJplnTvLcYdNaH0KMYOYMGX+rB4NGPFmQsNaIwlWrfCezxre8zXBrsMT+edVLbLqN1BqB76JH4BvZTqUIMfGwPGEn+EnmTV86fPBaYbFL3DFEhjB45CewkXEAtJxk4/Ms2pPXnaRqdky0HOYdcUcE2zcXq4vaIvW2/v0nHFJH2XXe22ueDmq/18XGtELSq85j9X8q0tcNSSKJIX8FTuJF/Pf8j5PhqG2u+osvsLxYrvvfeVJL+4tkcXcr9JV7v0ERmj/X6fM3NC4j6dS1+9Umr2oPavqiAydTZPLMNRGY23LO9zAVDly7jD+70G5TPPLdhRIl4WxcYjLnM+SNcJ26FOrkrISUtPObIz5Zb3AG612krnpy15RMW+1cQjlnWFI6538qky9axd2oJmHIHP08KyP0ubGO+TQNOYuv2uh17yCIvR8VcStw7o1g0NM60sk+8Tq7YfIBJrtp53GkvzXH7OA0p8/n/u1satf/VJhtR1l8Wa6Gmaug7haSpaCaYQax6ta0mkutlb+eAOSG1aobM81D9A4iS1RRlzBBoVX6tU1S6WE2N9ORY6DfeLRC4l9Rvr5h95XDWB2mR1d4WFudpsgVYwiTwT31ljskD8ZyDOlm5DkGh9N/UB/0AI5Xvb8ZBmai2hQ4BWMqFwYnzxwB26YHSOv9WgY3JXnvoN+2R4rqGVh/LLDMtpFP+SpMGJNWvbIl5SOodbCczW2RKleksPoUeGEzrjtKHVdtZA+kfqO+rVx/iclCqwoopepvJpSTDjT+b9GWylGRF8EDbGlw6eUzmJM95Ovoz+kwLX3c2fTjFeYEsE7vUZm3mqdGJuKh2w9/QGSaqRHs99aScGOdDqkFcACoqdbBoQqqjamhH6Q9ng39JCg3lrGJwd50Qk9ovnqBTr8MME7Ps2wiVfygUmPoUBJJfJWX5Nda0nuncbFkA==")),xs=new Set(vs(Rs)),Os=new Set(vs(Rs)),Ns=function(e){for(var t=[];;){var r=e();if(0==r)break;t.push(ws(r,e))}for(;;){var n=e()-1;if(n<0)break;t.push(Qs(n,e))}return function(e){for(var t={},r=0;r<e.length;r++){var n=e[r];t[n[0]]=n[1]}return t}(ys(t))}(Rs),Ps=(Ms=vs(Ds=Rs).sort((function(e,t){return e-t})),function e(){for(var t=[];;){var r=vs(Ds,Ms);if(0==r.length)break;t.push({set:new Set(r),node:e()})}t.sort((function(e,t){return t.set.size-e.set.size}));var n=Ds();return{branches:t,valid:n%3,fe0f:!!(1&(n=n/3|0)),save:1==(n>>=1),check:2==n}}());function Fs(e){return Be(e)}function js(e){return e.filter((function(e){return 65039!=e}))}function Ts(e){var t,r=function(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=_s(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return a=e.done,e},e:function(e){s=!0,o=e},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}(e.split("."));try{for(r.s();!(t=r.n()).done;){var n=t.value,i=Fs(n);try{for(var o=i.lastIndexOf(95)-1;o>=0;o--)if(95!==i[o])throw new Error("underscore only allowed at start");if(i.length>=4&&i.every((function(e){return e<128}))&&45===i[2]&&45===i[3])throw new Error("invalid label extension")}catch(e){throw new Error('Invalid label "'.concat(n,'": ').concat(e.message))}}}catch(e){r.e(e)}finally{r.f()}return e}function Us(e){return Ts(function(e,t){var r=Fs(e).reverse(),n=[];for(;r.length;){var i=Ls(r);if(i)n.push.apply(n,ks(t(i)));else{var o=r.pop();if(xs.has(o))n.push(o);else if(!Os.has(o)){var a=Ns[o];if(!a)throw new Error("Disallowed codepoint: 0x".concat(o.toString(16).toUpperCase()));n.push.apply(n,ks(a))}}}return Ts((s=String.fromCodePoint.apply(String,n),s.normalize("NFC")));var s}(e,js))}function Ls(e,t){var r,n,i,o=Ps,a=[],s=e.length;t&&(t.length=0);for(var A=function(){var A=e[--s];if(!(o=null===(r=o.branches.find((function(e){return e.set.has(A)})))||void 0===r?void 0:r.node))return"break";if(o.save)i=A;else if(o.check&&A===i)return"break";a.push(A),o.fe0f&&(a.push(65039),s>0&&65039==e[s-1]&&s--),o.valid&&(n=a.slice(),2==o.valid&&n.splice(1,1),t&&t.push.apply(t,ks(e.slice(s).reverse())),e.length=s)};s;){if("break"===A())break}return n}var Hs=new h.b("hash/5.7.0"),Gs=new Uint8Array(32);function Ys(e){if(0===e.length)throw new Error("invalid ENS name; empty component");return e}function Ks(e){var t=be(Us(e)),r=[];if(0===e.length)return r;for(var n=0,i=0;i<t.length;i++){46===t[i]&&(r.push(Ys(t.slice(n,i))),n=i+1)}if(n>=t.length)throw new Error("invalid ENS name; empty component");return r.push(Ys(t.slice(n))),r}function qs(e){try{return 0!==Ks(e).length}catch(e){}return!1}function Js(e){"string"!=typeof e&&Hs.throwArgumentError("invalid ENS name; not a string","name",e);for(var t=Gs,r=Ks(e);r.length;)t=q(Object(c.b)([t,q(r.pop())]));return Object(c.i)(t)}function zs(e){return Object(c.i)(Object(c.b)(Ks(e).map((function(e){if(e.length>63)throw new Error("invalid DNS encoded entry; length exceeds 63 bytes");var t=new Uint8Array(e.length+1);return t.set(e,1),t[0]=t.length-1,t}))))+"00"}Gs.fill(0);var Vs=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{A(n.next(e))}catch(e){o(e)}}function s(e){try{A(n.throw(e))}catch(e){o(e)}}function A(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}A((n=n.apply(e,t||[])).next())}))};function Zs(e,t){return Vs(this,void 0,void 0,regeneratorRuntime.mark((function r(){var n,i,o,a,s;return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return null==t&&(t={}),n={method:t.method||"GET",headers:t.headers||{},body:t.body||void 0},!0!==t.skipFetchSetup&&(n.mode="cors",n.cache="no-cache",n.credentials="same-origin",n.redirect="follow",n.referrer="client"),null!=t.fetchOptions&&((i=t.fetchOptions).mode&&(n.mode=i.mode),i.cache&&(n.cache=i.cache),i.credentials&&(n.credentials=i.credentials),i.redirect&&(n.redirect=i.redirect),i.referrer&&(n.referrer=i.referrer)),r.next=7,fetch(e,n);case 7:return o=r.sent,r.next=10,o.arrayBuffer();case 10:return a=r.sent,s={},o.headers.forEach?o.headers.forEach((function(e,t){s[t.toLowerCase()]=e})):o.headers.keys().forEach((function(e){s[e.toLowerCase()]=o.headers.get(e)})),r.abrupt("return",{headers:s,statusCode:o.status,statusMessage:o.statusText,body:Object(c.a)(new Uint8Array(a))});case 14:case"end":return r.stop()}}),r)})))}function Ws(e){return(Ws="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var Xs=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{A(n.next(e))}catch(e){o(e)}}function s(e){try{A(n.throw(e))}catch(e){o(e)}}function A(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}A((n=n.apply(e,t||[])).next())}))},$s=new h.b("web/5.7.1");function eA(e){return new Promise((function(t){setTimeout(t,e)}))}function tA(e,t){if(null==e)return null;if("string"==typeof e)return e;if(Object(c.k)(e)){if(t&&("text"===t.split("/")[0]||"application/json"===t.split(";")[0].trim()))try{return ve(e)}catch(e){}return Object(c.i)(e)}return e}function rA(e,t,r){var n="object"===Ws(e)&&null!=e.throttleLimit?e.throttleLimit:12;$s.assertArgument(n>0&&n%1==0,"invalid connection throttle limit","connection.throttleLimit",n);var i="object"===Ws(e)?e.throttleCallback:null,o="object"===Ws(e)&&"number"==typeof e.throttleSlotInterval?e.throttleSlotInterval:100;$s.assertArgument(o>0&&o%1==0,"invalid connection throttle slot interval","connection.throttleSlotInterval",o);var a="object"===Ws(e)&&!!e.errorPassThrough,s={},A=null,c={method:"GET"},u=!1,f=12e4;if("string"==typeof e)A=e;else if("object"===Ws(e)){if(null!=e&&null!=e.url||$s.throwArgumentError("missing URL","connection.url",e),A=e.url,"number"==typeof e.timeout&&e.timeout>0&&(f=e.timeout),e.headers)for(var l in e.headers)s[l.toLowerCase()]={key:l,value:String(e.headers[l])},["if-none-match","if-modified-since"].indexOf(l.toLowerCase())>=0&&(u=!0);if(c.allowGzip=!!e.allowGzip,null!=e.user&&null!=e.password){"https:"!==A.substring(0,6)&&!0!==e.allowInsecureAuthentication&&$s.throwError("basic authentication requires a secure https url",h.b.errors.INVALID_ARGUMENT,{argument:"url",url:A,user:e.user,password:"[REDACTED]"});var g=e.user+":"+e.password;s.authorization={key:"Authorization",value:"Basic "+Is(be(g))}}null!=e.skipFetchSetup&&(c.skipFetchSetup=!!e.skipFetchSetup),null!=e.fetchOptions&&(c.fetchOptions=R(e.fetchOptions))}var d,p=new RegExp("^data:([^;:]*)?(;base64)?,(.*)$","i"),I=A?A.match(p):null;if(I)try{var y={statusCode:200,statusMessage:"OK",headers:{"content-type":I[1]||"text/plain"},body:I[2]?ps(I[3]):(d=I[3],be(d.replace(/%([0-9a-f][0-9a-f])/gi,(function(e,t){return String.fromCharCode(parseInt(t,16))}))))},b=y.body;return r&&(b=r(y.body,y)),Promise.resolve(b)}catch(e){$s.throwError("processing response error",h.b.errors.SERVER_ERROR,{body:tA(I[1],I[2]),error:e,requestBody:null,requestMethod:"GET",url:A})}t&&(c.method="POST",c.body=t,null==s["content-type"]&&(s["content-type"]={key:"Content-Type",value:"application/octet-stream"}),null==s["content-length"]&&(s["content-length"]={key:"Content-Length",value:String(t.length)}));var E={};Object.keys(s).forEach((function(e){var t=s[e];E[t.key]=t.value})),c.headers=E;var m,C=(m=null,{promise:new Promise((function(e,t){f&&(m=setTimeout((function(){null!=m&&(m=null,t($s.makeError("timeout",h.b.errors.TIMEOUT,{requestBody:tA(c.body,E["content-type"]),requestMethod:c.method,timeout:f,url:A})))}),f))})),cancel:function(){null!=m&&(clearTimeout(m),m=null)}}),v=function(){return Xs(this,void 0,void 0,regeneratorRuntime.mark((function e(){var t,s,f,l,g,d,p,I,y,b;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t=0;case 1:if(!(t<n)){e.next=65;break}return s=null,e.prev=3,e.next=6,Zs(A,c);case 6:if(s=e.sent,!(t<n)){e.next=28;break}if(301!==s.statusCode&&302!==s.statusCode){e.next=15;break}if(f=s.headers.location||"","GET"!==c.method||!f.match(/^https:/)){e.next=13;break}return A=s.headers.location,e.abrupt("continue",62);case 13:e.next=28;break;case 15:if(429!==s.statusCode){e.next=28;break}if(l=!0,!i){e.next=21;break}return e.next=20,i(t,A);case 20:l=e.sent;case 21:if(!l){e.next=28;break}return g=0,d=s.headers["retry-after"],g="string"==typeof d&&d.match(/^[1-9][0-9]*$/)?1e3*parseInt(d):o*parseInt(String(Math.random()*Math.pow(2,t))),e.next=27,eA(g);case 27:return e.abrupt("continue",62);case 28:e.next=34;break;case 30:e.prev=30,e.t0=e.catch(3),null==(s=e.t0.response)&&(C.cancel(),$s.throwError("missing response",h.b.errors.SERVER_ERROR,{requestBody:tA(c.body,E["content-type"]),requestMethod:c.method,serverError:e.t0,url:A}));case 34:if(p=s.body,u&&304===s.statusCode?p=null:!a&&(s.statusCode<200||s.statusCode>=300)&&(C.cancel(),$s.throwError("bad response",h.b.errors.SERVER_ERROR,{status:s.statusCode,headers:s.headers,body:tA(p,s.headers?s.headers["content-type"]:null),requestBody:tA(c.body,E["content-type"]),requestMethod:c.method,url:A})),!r){e.next=60;break}return e.prev=37,e.next=40,r(p,s);case 40:return I=e.sent,C.cancel(),e.abrupt("return",I);case 45:if(e.prev=45,e.t1=e.catch(37),!(e.t1.throttleRetry&&t<n)){e.next=58;break}if(y=!0,!i){e.next=53;break}return e.next=52,i(t,A);case 52:y=e.sent;case 53:if(!y){e.next=58;break}return b=o*parseInt(String(Math.random()*Math.pow(2,t))),e.next=57,eA(b);case 57:return e.abrupt("continue",62);case 58:C.cancel(),$s.throwError("processing response error",h.b.errors.SERVER_ERROR,{body:tA(p,s.headers?s.headers["content-type"]:null),error:e.t1,requestBody:tA(c.body,E["content-type"]),requestMethod:c.method,url:A});case 60:return C.cancel(),e.abrupt("return",p);case 62:t++,e.next=1;break;case 65:return e.abrupt("return",$s.throwError("failed response",h.b.errors.SERVER_ERROR,{requestBody:tA(c.body,E["content-type"]),requestMethod:c.method,url:A}));case 66:case"end":return e.stop()}}),e,null,[[3,30],[37,45]])})))}();return Promise.race([C.promise,v])}function nA(e,t,r){var n=null;if(null!=t){n=be(t);var i="string"==typeof e?{url:e}:R(e);if(i.headers)0!==Object.keys(i.headers).filter((function(e){return"content-type"===e.toLowerCase()})).length||(i.headers=R(i.headers),i.headers["content-type"]="application/json");else i.headers={"content-type":"application/json"};e=i}return rA(e,n,(function(e,t){var n=null;if(null!=e)try{n=JSON.parse(ve(e))}catch(t){$s.throwError("invalid JSON",h.b.errors.SERVER_ERROR,{body:e,error:t})}return r&&(n=r(n,t)),n}))}function iA(e,t){return t||(t={}),null==(t=R(t)).floor&&(t.floor=0),null==t.ceiling&&(t.ceiling=1e4),null==t.interval&&(t.interval=250),new Promise((function(r,n){var i=null,o=!1,a=function(){return!o&&(o=!0,i&&clearTimeout(i),!0)};t.timeout&&(i=setTimeout((function(){a()&&n(new Error("timeout"))}),t.timeout));var s=t.retryLimit,A=0;!function i(){return e().then((function(e){if(void 0!==e)a()&&r(e);else if(t.oncePoll)t.oncePoll.once("poll",i);else if(t.onceBlock)t.onceBlock.once("block",i);else if(!o){if(++A>s)return void(a()&&n(new Error("retry limit reached")));var c=t.interval*parseInt(String(Math.random()*Math.pow(2,A)));c<t.floor&&(c=t.floor),c>t.ceiling&&(c=t.ceiling),setTimeout(i,c)}return null}),(function(e){a()&&n(e)}))}()}))}var oA=r(79),aA=r.n(oA);function sA(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}var AA=new h.b("providers/5.7.2"),cA=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.formats=this.getDefaultFormats()}var t,r,n;return t=e,n=[{key:"check",value:function(e,t){var r={};for(var n in e)try{var i=e[n](t[n]);void 0!==i&&(r[n]=i)}catch(e){throw e.checkKey=n,e.checkValue=t[n],e}return r}},{key:"allowNull",value:function(e,t){return function(r){return null==r?t:e(r)}}},{key:"allowFalsish",value:function(e,t){return function(r){return r?e(r):t}}},{key:"arrayOf",value:function(e){return function(t){if(!Array.isArray(t))throw new Error("not an array");var r=[];return t.forEach((function(t){r.push(e(t))})),r}}}],(r=[{key:"getDefaultFormats",value:function(){var t=this,r={},n=this.address.bind(this),i=this.bigNumber.bind(this),o=this.blockTag.bind(this),a=this.data.bind(this),s=this.hash.bind(this),A=this.hex.bind(this),c=this.number.bind(this),u=this.type.bind(this);return r.transaction={hash:s,type:u,accessList:e.allowNull(this.accessList.bind(this),null),blockHash:e.allowNull(s,null),blockNumber:e.allowNull(c,null),transactionIndex:e.allowNull(c,null),confirmations:e.allowNull(c,null),from:n,gasPrice:e.allowNull(i),maxPriorityFeePerGas:e.allowNull(i),maxFeePerGas:e.allowNull(i),gasLimit:i,to:e.allowNull(n,null),value:i,nonce:c,data:a,r:e.allowNull(this.uint256),s:e.allowNull(this.uint256),v:e.allowNull(c),creates:e.allowNull(n,null),raw:e.allowNull(a)},r.transactionRequest={from:e.allowNull(n),nonce:e.allowNull(c),gasLimit:e.allowNull(i),gasPrice:e.allowNull(i),maxPriorityFeePerGas:e.allowNull(i),maxFeePerGas:e.allowNull(i),to:e.allowNull(n),value:e.allowNull(i),data:e.allowNull((function(e){return t.data(e,!0)})),type:e.allowNull(c),accessList:e.allowNull(this.accessList.bind(this),null)},r.receiptLog={transactionIndex:c,blockNumber:c,transactionHash:s,address:n,topics:e.arrayOf(s),data:a,logIndex:c,blockHash:s},r.receipt={to:e.allowNull(this.address,null),from:e.allowNull(this.address,null),contractAddress:e.allowNull(n,null),transactionIndex:c,root:e.allowNull(A),gasUsed:i,logsBloom:e.allowNull(a),blockHash:s,transactionHash:s,logs:e.arrayOf(this.receiptLog.bind(this)),blockNumber:c,confirmations:e.allowNull(c,null),cumulativeGasUsed:i,effectiveGasPrice:e.allowNull(i),status:e.allowNull(c),type:u},r.block={hash:e.allowNull(s),parentHash:s,number:c,timestamp:c,nonce:e.allowNull(A),difficulty:this.difficulty.bind(this),gasLimit:i,gasUsed:i,miner:e.allowNull(n),extraData:a,transactions:e.allowNull(e.arrayOf(s)),baseFeePerGas:e.allowNull(i)},r.blockWithTransactions=R(r.block),r.blockWithTransactions.transactions=e.allowNull(e.arrayOf(this.transactionResponse.bind(this))),r.filter={fromBlock:e.allowNull(o,void 0),toBlock:e.allowNull(o,void 0),blockHash:e.allowNull(s,void 0),address:e.allowNull(n,void 0),topics:e.allowNull(this.topics.bind(this),void 0)},r.filterLog={blockNumber:e.allowNull(c),blockHash:e.allowNull(s),transactionIndex:c,removed:e.allowNull(this.boolean.bind(this)),address:n,data:e.allowFalsish(a,"0x"),topics:e.arrayOf(s),transactionHash:s,logIndex:c},r}},{key:"accessList",value:function(e){return ei(e||[])}},{key:"number",value:function(e){return"0x"===e?0:y.from(e).toNumber()}},{key:"type",value:function(e){return"0x"===e||null==e?0:y.from(e).toNumber()}},{key:"bigNumber",value:function(e){return y.from(e)}},{key:"boolean",value:function(e){if("boolean"==typeof e)return e;if("string"==typeof e){if("true"===(e=e.toLowerCase()))return!0;if("false"===e)return!1}throw new Error("invalid boolean - "+e)}},{key:"hex",value:function(e,t){return"string"==typeof e&&(t||"0x"===e.substring(0,2)||(e="0x"+e),Object(c.l)(e))?e.toLowerCase():AA.throwArgumentError("invalid hash","value",e)}},{key:"data",value:function(e,t){var r=this.hex(e,t);if(r.length%2!=0)throw new Error("invalid data; odd-length - "+e);return r}},{key:"address",value:function(e){return Ae(e)}},{key:"callAddress",value:function(e){if(!Object(c.l)(e,32))return null;var t=Ae(Object(c.e)(e,12));return t===os?null:t}},{key:"contractAddress",value:function(e){return fe(e)}},{key:"blockTag",value:function(e){if(null==e)return"latest";if("earliest"===e)return"0x0";switch(e){case"earliest":return"0x0";case"latest":case"pending":case"safe":case"finalized":return e}if("number"==typeof e||Object(c.l)(e))return Object(c.g)(e);throw new Error("invalid blockTag")}},{key:"hash",value:function(e,t){var r=this.hex(e,t);return 32!==Object(c.d)(r)?AA.throwArgumentError("invalid hash","value",e):r}},{key:"difficulty",value:function(e){if(null==e)return null;var t=y.from(e);try{return t.toNumber()}catch(e){}return null}},{key:"uint256",value:function(e){if(!Object(c.l)(e))throw new Error("invalid uint256");return Object(c.h)(e,32)}},{key:"_block",value:function(t,r){null!=t.author&&null==t.miner&&(t.miner=t.author);var n=null!=t._difficulty?t._difficulty:t.difficulty,i=e.check(r,t);return i._difficulty=null==n?null:y.from(n),i}},{key:"block",value:function(e){return this._block(e,this.formats.block)}},{key:"blockWithTransactions",value:function(e){return this._block(e,this.formats.blockWithTransactions)}},{key:"transactionRequest",value:function(t){return e.check(this.formats.transactionRequest,t)}},{key:"transactionResponse",value:function(t){null!=t.gas&&null==t.gasLimit&&(t.gasLimit=t.gas),t.to&&y.from(t.to).isZero()&&(t.to="0x0000000000000000000000000000000000000000"),null!=t.input&&null==t.data&&(t.data=t.input),null==t.to&&null==t.creates&&(t.creates=this.contractAddress(t)),1!==t.type&&2!==t.type||null!=t.accessList||(t.accessList=[]);var r=e.check(this.formats.transaction,t);if(null!=t.chainId){var n=t.chainId;Object(c.l)(n)&&(n=y.from(n).toNumber()),r.chainId=n}else{var i=t.networkId;null==i&&null==r.v&&(i=t.chainId),Object(c.l)(i)&&(i=y.from(i).toNumber()),"number"!=typeof i&&null!=r.v&&((i=(r.v-35)/2)<0&&(i=0),i=parseInt(i)),"number"!=typeof i&&(i=0),r.chainId=i}return r.blockHash&&"x"===r.blockHash.replace(/0/g,"")&&(r.blockHash=null),r}},{key:"transaction",value:function(e){return ai(e)}},{key:"receiptLog",value:function(t){return e.check(this.formats.receiptLog,t)}},{key:"receipt",value:function(t){var r=e.check(this.formats.receipt,t);if(null!=r.root)if(r.root.length<=4){var n=y.from(r.root).toNumber();0===n||1===n?(null!=r.status&&r.status!==n&&AA.throwArgumentError("alt-root-status/status mismatch","value",{root:r.root,status:r.status}),r.status=n,delete r.root):AA.throwArgumentError("invalid alt-root-status","value.root",r.root)}else 66!==r.root.length&&AA.throwArgumentError("invalid root hash","value.root",r.root);return null!=r.status&&(r.byzantium=!0),r}},{key:"topics",value:function(e){var t=this;return Array.isArray(e)?e.map((function(e){return t.topics(e)})):null!=e?this.hash(e,!0):null}},{key:"filter",value:function(t){return e.check(this.formats.filter,t)}},{key:"filterLog",value:function(t){return e.check(this.formats.filterLog,t)}}])&&sA(t.prototype,r),n&&sA(t,n),Object.defineProperty(t,"prototype",{writable:!1}),e}();function uA(e){return e&&"function"==typeof e.isCommunityResource}function fA(e){return uA(e)&&e.isCommunityResource()}var hA=!1;function lA(){hA||(hA=!0,console.log("========= NOTICE ========="),console.log("Request-Rate Exceeded (this message will not be repeated)"),console.log(""),console.log("The default API keys for each service are provided as a highly-throttled,"),console.log("community resource for low-traffic projects and early prototyping."),console.log(""),console.log("While your application will continue to function, we highly recommended"),console.log("signing up for your own API keys to improve performance, increase your"),console.log("request rate/limit and enable other perks, such as metrics and advanced APIs."),console.log(""),console.log("For more details: https://docs.ethers.io/api-keys/"),console.log("=========================="))}function gA(e,t){return(gA=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function dA(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=yA(e);if(t){var i=yA(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return pA(this,r)}}function pA(e,t){if(t&&("object"===CA(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return IA(e)}function IA(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function yA(e){return(yA=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function bA(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function EA(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function mA(e,t,r){return t&&EA(e.prototype,t),r&&EA(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function CA(e){return(CA="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var vA=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{A(n.next(e))}catch(e){o(e)}}function s(e){try{A(n.throw(e))}catch(e){o(e)}}function A(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}A((n=n.apply(e,t||[])).next())}))},BA=new h.b("providers/5.7.2");function wA(e){return null==e?"null":(32!==Object(c.d)(e)&&BA.throwArgumentError("invalid topic","topic",e),e.toLowerCase())}function QA(e){for(e=e.slice();e.length>0&&null==e[e.length-1];)e.pop();return e.map((function(e){if(Array.isArray(e)){var t={};e.forEach((function(e){t[wA(e)]=!0}));var r=Object.keys(t);return r.sort(),r.join("|")}return wA(e)})).join("&")}function kA(e){if("string"==typeof e){if(e=e.toLowerCase(),32===Object(c.d)(e))return"tx:"+e;if(-1===e.indexOf(":"))return e}else{if(Array.isArray(e))return"filter:*:"+QA(e);if(bn.isForkEvent(e))throw BA.warn("not implemented"),new Error("not implemented");if(e&&"object"===CA(e))return"filter:"+(e.address||"*")+":"+QA(e.topics||[])}throw new Error("invalid event - "+e)}function _A(){return(new Date).getTime()}function SA(e){return new Promise((function(t){setTimeout(t,e)}))}var DA=["block","network","pending","poll"],MA=function(){function e(t,r,n){bA(this,e),_(this,"tag",t),_(this,"listener",r),_(this,"once",n),this._lastBlockNumber=-2,this._inflight=!1}return mA(e,[{key:"event",get:function(){switch(this.type){case"tx":return this.hash;case"filter":return this.filter}return this.tag}},{key:"type",get:function(){return this.tag.split(":")[0]}},{key:"hash",get:function(){var e=this.tag.split(":");return"tx"!==e[0]?null:e[1]}},{key:"filter",get:function(){var e=this.tag.split(":");if("filter"!==e[0])return null;var t,r=e[1],n=""===(t=e[2])?[]:t.split(/&/g).map((function(e){if(""===e)return[];var t=e.split("|").map((function(e){return"null"===e?null:e}));return 1===t.length?t[0]:t})),i={};return n.length>0&&(i.topics=n),r&&"*"!==r&&(i.address=r),i}},{key:"pollable",value:function(){return this.tag.indexOf(":")>=0||DA.indexOf(this.tag)>=0}}]),e}(),RA={0:{symbol:"btc",p2pkh:0,p2sh:5,prefix:"bc"},2:{symbol:"ltc",p2pkh:48,p2sh:50,prefix:"ltc"},3:{symbol:"doge",p2pkh:30,p2sh:22},60:{symbol:"eth",ilk:"eth"},61:{symbol:"etc",ilk:"eth"},700:{symbol:"xdai",ilk:"eth"}};function xA(e){return Object(c.h)(y.from(e).toHexString(),32)}function OA(e){return vo.encode(Object(c.b)([e,Object(c.e)(_o(_o(e)),0,4)]))}var NA=new RegExp("^(ipfs)://(.*)$","i"),PA=[new RegExp("^(https)://(.*)$","i"),new RegExp("^(data):(.*)$","i"),NA,new RegExp("^eip155:[0-9]+/(erc[0-9]+):(.*)$","i")];function FA(e,t){try{return ve(jA(e,t))}catch(e){}return null}function jA(e,t){if("0x"===e)return null;var r=y.from(Object(c.e)(e,t,t+32)).toNumber(),n=y.from(Object(c.e)(e,r,r+32)).toNumber();return Object(c.e)(e,r+32,r+32+n)}function TA(e){return e.match(/^ipfs:\/\/ipfs\//i)?e=e.substring(12):e.match(/^ipfs:\/\//i)?e=e.substring(7):BA.throwArgumentError("unsupported IPFS format","link",e),"https://gateway.ipfs.io/ipfs/".concat(e)}function UA(e){var t=Object(c.a)(e);if(t.length>32)throw new Error("internal; should not happen");var r=new Uint8Array(32);return r.set(t,32-t.length),r}function LA(e){if(e.length%32==0)return e;var t=new Uint8Array(32*Math.ceil(e.length/32));return t.set(e),t}function HA(e){for(var t=[],r=0,n=0;n<e.length;n++)t.push(null),r+=32;for(var i=0;i<e.length;i++){var o=Object(c.a)(e[i]);t[i]=UA(r),t.push(UA(o.length)),t.push(LA(o)),r+=32+32*Math.ceil(o.length/32)}return Object(c.c)(t)}var GA=function(){function e(t,r,n,i){bA(this,e),_(this,"provider",t),_(this,"name",n),_(this,"address",t.formatter.address(r)),_(this,"_resolvedAddress",i)}return mA(e,[{key:"supportsWildcard",value:function(){var e=this;return this._supportsEip2544||(this._supportsEip2544=this.provider.call({to:this.address,data:"0x01ffc9a79061b92300000000000000000000000000000000000000000000000000000000"}).then((function(e){return y.from(e).eq(1)})).catch((function(t){if(t.code===h.b.errors.CALL_EXCEPTION)return!1;throw e._supportsEip2544=null,t}))),this._supportsEip2544}},{key:"_fetch",value:function(e,t){return vA(this,void 0,void 0,regeneratorRuntime.mark((function r(){var n,i,o;return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return n={to:this.address,ccipReadEnabled:!0,data:Object(c.c)([e,Js(this.name),t||"0x"])},i=!1,r.next=4,this.supportsWildcard();case 4:if(!r.sent){r.next=7;break}i=!0,n.data=Object(c.c)(["0x9061b923",HA([zs(this.name),n.data])]);case 7:return r.prev=7,r.next=10,this.provider.call(n);case 10:return o=r.sent,Object(c.a)(o).length%32==4&&BA.throwError("resolver threw error",h.b.errors.CALL_EXCEPTION,{transaction:n,data:o}),i&&(o=jA(o,0)),r.abrupt("return",o);case 16:if(r.prev=16,r.t0=r.catch(7),r.t0.code!==h.b.errors.CALL_EXCEPTION){r.next=20;break}return r.abrupt("return",null);case 20:throw r.t0;case 21:case"end":return r.stop()}}),r,this,[[7,16]])})))}},{key:"_fetchBytes",value:function(e,t){return vA(this,void 0,void 0,regeneratorRuntime.mark((function r(){var n;return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,this._fetch(e,t);case 2:if(null==(n=r.sent)){r.next=5;break}return r.abrupt("return",jA(n,0));case 5:return r.abrupt("return",null);case 6:case"end":return r.stop()}}),r,this)})))}},{key:"_getAddress",value:function(e,t){var r=RA[String(e)];if(null==r&&BA.throwError("unsupported coin type: ".concat(e),h.b.errors.UNSUPPORTED_OPERATION,{operation:"getAddress(".concat(e,")")}),"eth"===r.ilk)return this.provider.formatter.address(t);var n=Object(c.a)(t);if(null!=r.p2pkh){var i=t.match(/^0x76a9([0-9a-f][0-9a-f])([0-9a-f]*)88ac$/);if(i){var o=parseInt(i[1],16);if(i[2].length===2*o&&o>=1&&o<=75)return OA(Object(c.b)([[r.p2pkh],"0x"+i[2]]))}}if(null!=r.p2sh){var a=t.match(/^0xa9([0-9a-f][0-9a-f])([0-9a-f]*)87$/);if(a){var s=parseInt(a[1],16);if(a[2].length===2*s&&s>=1&&s<=75)return OA(Object(c.b)([[r.p2sh],"0x"+a[2]]))}}if(null!=r.prefix){var A=n[1],u=n[0];if(0===u?20!==A&&32!==A&&(u=-1):u=-1,u>=0&&n.length===2+A&&A>=1&&A<=75){var f=aA.a.toWords(n.slice(2));return f.unshift(u),aA.a.encode(r.prefix,f)}}return null}},{key:"getAddress",value:function(e){return vA(this,void 0,void 0,regeneratorRuntime.mark((function t(){var r,n,i;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(null==e&&(e=60),60!==e){t.next=16;break}return t.prev=2,t.next=5,this._fetch("0x3b3b57de");case 5:if("0x"!==(r=t.sent)&&r!==as){t.next=8;break}return t.abrupt("return",null);case 8:return t.abrupt("return",this.provider.formatter.callAddress(r));case 11:if(t.prev=11,t.t0=t.catch(2),t.t0.code!==h.b.errors.CALL_EXCEPTION){t.next=15;break}return t.abrupt("return",null);case 15:throw t.t0;case 16:return t.next=18,this._fetchBytes("0xf1cb7e06",xA(e));case 18:if(null!=(n=t.sent)&&"0x"!==n){t.next=21;break}return t.abrupt("return",null);case 21:return null==(i=this._getAddress(e,n))&&BA.throwError("invalid or unsupported coin data",h.b.errors.UNSUPPORTED_OPERATION,{operation:"getAddress(".concat(e,")"),coinType:e,data:n}),t.abrupt("return",i);case 24:case"end":return t.stop()}}),t,this,[[2,11]])})))}},{key:"getAvatar",value:function(){return vA(this,void 0,void 0,regeneratorRuntime.mark((function e(){var t,r,n,i,o,a,s,A,u,f,h,l,g,d,p,I;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=[{type:"name",content:this.name}],e.prev=1,e.next=4,this.getText("avatar");case 4:if(null!=(r=e.sent)){e.next=7;break}return e.abrupt("return",null);case 7:n=0;case 8:if(!(n<PA.length)){e.next=91;break}if(null!=(i=r.match(PA[n]))){e.next=12;break}return e.abrupt("continue",88);case 12:o=i[1].toLowerCase(),e.t0=o,e.next="https"===e.t0?16:"data"===e.t0?18:"ipfs"===e.t0?20:"erc721"===e.t0||"erc1155"===e.t0?22:88;break;case 16:return t.push({type:"url",content:r}),e.abrupt("return",{linkage:t,url:r});case 18:return t.push({type:"data",content:r}),e.abrupt("return",{linkage:t,url:r});case 20:return t.push({type:"ipfs",content:r}),e.abrupt("return",{linkage:t,url:TA(r)});case 22:if(a="erc721"===o?"0xc87b56dd":"0x0e89341c",t.push({type:o,content:r}),e.t1=this._resolvedAddress,e.t1){e.next=29;break}return e.next=28,this.getAddress();case 28:e.t1=e.sent;case 29:if(s=e.t1,2===(A=(i[2]||"").split("/")).length){e.next=33;break}return e.abrupt("return",null);case 33:return e.next=35,this.provider.formatter.address(A[0]);case 35:if(u=e.sent,f=Object(c.h)(y.from(A[1]).toHexString(),32),"erc721"!==o){e.next=48;break}return e.t2=this.provider.formatter,e.next=41,this.provider.call({to:u,data:Object(c.c)(["0x6352211e",f])});case 41:if(e.t3=e.sent,h=e.t2.callAddress.call(e.t2,e.t3),s===h){e.next=45;break}return e.abrupt("return",null);case 45:t.push({type:"owner",content:h}),e.next=57;break;case 48:if("erc1155"!==o){e.next=57;break}return e.t4=y,e.next=52,this.provider.call({to:u,data:Object(c.c)(["0x00fdd58e",Object(c.h)(s,32),f])});case 52:if(e.t5=e.sent,!(l=e.t4.from.call(e.t4,e.t5)).isZero()){e.next=56;break}return e.abrupt("return",null);case 56:t.push({type:"balance",content:l.toString()});case 57:return g={to:this.provider.formatter.address(A[0]),data:Object(c.c)([a,f])},e.t6=FA,e.next=61,this.provider.call(g);case 61:if(e.t7=e.sent,null!=(d=(0,e.t6)(e.t7,0))){e.next=65;break}return e.abrupt("return",null);case 65:return t.push({type:"metadata-url-base",content:d}),"erc1155"===o&&(d=d.replace("{id}",f.substring(2)),t.push({type:"metadata-url-expanded",content:d})),d.match(/^ipfs:/i)&&(d=TA(d)),t.push({type:"metadata-url",content:d}),e.next=71,nA(d);case 71:if(p=e.sent){e.next=74;break}return e.abrupt("return",null);case 74:if(t.push({type:"metadata",content:JSON.stringify(p)}),"string"==typeof(I=p.image)){e.next=78;break}return e.abrupt("return",null);case 78:if(!I.match(/^(https:\/\/|data:)/i)){e.next=81;break}e.next=86;break;case 81:if(null!=I.match(NA)){e.next=84;break}return e.abrupt("return",null);case 84:t.push({type:"url-ipfs",content:I}),I=TA(I);case 86:return t.push({type:"url",content:I}),e.abrupt("return",{linkage:t,url:I});case 88:n++,e.next=8;break;case 91:e.next=95;break;case 93:e.prev=93,e.t8=e.catch(1);case 95:return e.abrupt("return",null);case 96:case"end":return e.stop()}}),e,this,[[1,93]])})))}},{key:"getContentHash",value:function(){return vA(this,void 0,void 0,regeneratorRuntime.mark((function e(){var t,r,n,i,o,a,s,A,c;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._fetchBytes("0xbc1c58d1");case 2:if(null!=(t=e.sent)&&"0x"!==t){e.next=5;break}return e.abrupt("return",null);case 5:if(!(r=t.match(/^0xe3010170(([0-9a-f][0-9a-f])([0-9a-f][0-9a-f])([0-9a-f]*))$/))){e.next=10;break}if(n=parseInt(r[3],16),r[4].length!==2*n){e.next=10;break}return e.abrupt("return","ipfs://"+vo.encode("0x"+r[1]));case 10:if(!(i=t.match(/^0xe5010172(([0-9a-f][0-9a-f])([0-9a-f][0-9a-f])([0-9a-f]*))$/))){e.next=15;break}if(o=parseInt(i[3],16),i[4].length!==2*o){e.next=15;break}return e.abrupt("return","ipns://"+vo.encode("0x"+i[1]));case 15:if(!(a=t.match(/^0xe40101fa011b20([0-9a-f]*)$/))){e.next=19;break}if(64!==a[1].length){e.next=19;break}return e.abrupt("return","bzz://"+a[1]);case 19:if(!(s=t.match(/^0x90b2c605([0-9a-f]*)$/))){e.next=25;break}if(68!==s[1].length){e.next=25;break}return A={"=":"","+":"-","/":"_"},c=Is("0x"+s[1]).replace(/[=+\/]/g,(function(e){return A[e]})),e.abrupt("return","sia://"+c);case 25:return e.abrupt("return",BA.throwError("invalid or unsupported content hash data",h.b.errors.UNSUPPORTED_OPERATION,{operation:"getContentHash()",data:t}));case 26:case"end":return e.stop()}}),e,this)})))}},{key:"getText",value:function(e){return vA(this,void 0,void 0,regeneratorRuntime.mark((function t(){var r,n;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=be(e),(r=Object(c.b)([xA(64),xA(r.length),r])).length%32!=0&&(r=Object(c.b)([r,Object(c.h)("0x",32-e.length%32)])),t.next=5,this._fetchBytes("0x59d1d43c",Object(c.i)(r));case 5:if(null!=(n=t.sent)&&"0x"!==n){t.next=8;break}return t.abrupt("return",null);case 8:return t.abrupt("return",ve(n));case 9:case"end":return t.stop()}}),t,this)})))}}]),e}(),YA=null,KA=1,qA=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&gA(e,t)}(r,e);var t=dA(r);function r(e){var n;if(bA(this,r),(n=t.call(this))._events=[],n._emitted={block:-2},n.disableCcipRead=!1,n.formatter=(this instanceof r?this.constructor:void 0).getFormatter(),_(IA(n),"anyNetwork","any"===e),n.anyNetwork&&(e=n.detectNetwork()),e instanceof Promise)n._networkPromise=e,e.catch((function(e){})),n._ready().catch((function(e){}));else{var i=S(this instanceof r?this.constructor:void 0,"getNetwork")(e);i?(_(IA(n),"_network",i),n.emit("network",i,null)):BA.throwArgumentError("invalid network","network",e)}return n._maxInternalBlockNumber=-1024,n._lastBlockNumber=-2,n._maxFilterBlockRange=10,n._pollingInterval=4e3,n._fastQueryDate=0,n}return mA(r,[{key:"_ready",value:function(){return vA(this,void 0,void 0,regeneratorRuntime.mark((function e(){var t;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!=this._network){e.next=17;break}if(t=null,!this._networkPromise){e.next=11;break}return e.prev=3,e.next=6,this._networkPromise;case 6:t=e.sent,e.next=11;break;case 9:e.prev=9,e.t0=e.catch(3);case 11:if(null!=t){e.next=15;break}return e.next=14,this.detectNetwork();case 14:t=e.sent;case 15:t||BA.throwError("no network detected",h.b.errors.UNKNOWN_ERROR,{}),null==this._network&&(this.anyNetwork?this._network=t:_(this,"_network",t),this.emit("network",t,null));case 17:return e.abrupt("return",this._network);case 18:case"end":return e.stop()}}),e,this,[[3,9]])})))}},{key:"ready",get:function(){var e=this;return iA((function(){return e._ready().then((function(e){return e}),(function(e){if(e.code!==h.b.errors.NETWORK_ERROR||"noNetwork"!==e.event)throw e}))}))}},{key:"ccipReadFetch",value:function(e,t,r){return vA(this,void 0,void 0,regeneratorRuntime.mark((function n(){var i,o,a,s,A,c,u,f,l;return regeneratorRuntime.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(!this.disableCcipRead&&0!==r.length){n.next=2;break}return n.abrupt("return",null);case 2:i=e.to.toLowerCase(),o=t.toLowerCase(),a=[],s=0;case 6:if(!(s<r.length)){n.next=22;break}return A=r[s],c=A.replace("{sender}",i).replace("{data}",o),u=A.indexOf("{data}")>=0?null:JSON.stringify({data:o,sender:i}),n.next=12,nA({url:c,errorPassThrough:!0},u,(function(e,t){return e.status=t.statusCode,e}));case 12:if(!(f=n.sent).data){n.next=15;break}return n.abrupt("return",f.data);case 15:if(l=f.message||"unknown error",!(f.status>=400&&f.status<500)){n.next=18;break}return n.abrupt("return",BA.throwError("response not found during CCIP fetch: ".concat(l),h.b.errors.SERVER_ERROR,{url:A,errorMessage:l}));case 18:a.push(l);case 19:s++,n.next=6;break;case 22:return n.abrupt("return",BA.throwError("error encountered during CCIP fetch: ".concat(a.map((function(e){return JSON.stringify(e)})).join(", ")),h.b.errors.SERVER_ERROR,{urls:r,errorMessages:a}));case 23:case"end":return n.stop()}}),n,this)})))}},{key:"_getInternalBlockNumber",value:function(e){return vA(this,void 0,void 0,regeneratorRuntime.mark((function t(){var r,n,i,o,a=this;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this._ready();case 2:if(!(e>0)){t.next=20;break}case 3:if(!this._internalBlockNumber){t.next=20;break}return r=this._internalBlockNumber,t.prev=5,t.next=8,r;case 8:if(n=t.sent,!(_A()-n.respTime<=e)){t.next=11;break}return t.abrupt("return",n.blockNumber);case 11:return t.abrupt("break",20);case 14:if(t.prev=14,t.t0=t.catch(5),this._internalBlockNumber!==r){t.next=18;break}return t.abrupt("break",20);case 18:t.next=3;break;case 20:return i=_A(),o=D({blockNumber:this.perform("getBlockNumber",{}),networkError:this.getNetwork().then((function(e){return null}),(function(e){return e}))}).then((function(e){var t=e.blockNumber,r=e.networkError;if(r)throw a._internalBlockNumber===o&&(a._internalBlockNumber=null),r;var n=_A();return(t=y.from(t).toNumber())<a._maxInternalBlockNumber&&(t=a._maxInternalBlockNumber),a._maxInternalBlockNumber=t,a._setFastBlockNumber(t),{blockNumber:t,reqTime:i,respTime:n}})),this._internalBlockNumber=o,o.catch((function(e){a._internalBlockNumber===o&&(a._internalBlockNumber=null)})),t.next=26,o;case 26:return t.abrupt("return",t.sent.blockNumber);case 27:case"end":return t.stop()}}),t,this,[[5,14]])})))}},{key:"poll",value:function(){return vA(this,void 0,void 0,regeneratorRuntime.mark((function e(){var t,r,n,i,o=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=KA++,r=[],n=null,e.prev=3,e.next=6,this._getInternalBlockNumber(100+this.pollingInterval/2);case 6:n=e.sent,e.next=13;break;case 9:return e.prev=9,e.t0=e.catch(3),this.emit("error",e.t0),e.abrupt("return");case 13:if(this._setFastBlockNumber(n),this.emit("poll",t,n),n!==this._lastBlockNumber){e.next=18;break}return this.emit("didPoll",t),e.abrupt("return");case 18:if(-2===this._emitted.block&&(this._emitted.block=n-1),Math.abs(this._emitted.block-n)>1e3)BA.warn("network block skew detected; skipping block events (emitted=".concat(this._emitted.block," blockNumber").concat(n,")")),this.emit("error",BA.makeError("network block skew detected",h.b.errors.NETWORK_ERROR,{blockNumber:n,event:"blockSkew",previousBlockNumber:this._emitted.block})),this.emit("block",n);else for(i=this._emitted.block+1;i<=n;i++)this.emit("block",i);return this._emitted.block!==n&&(this._emitted.block=n,Object.keys(this._emitted).forEach((function(e){if("block"!==e){var t=o._emitted[e];"pending"!==t&&n-t>12&&delete o._emitted[e]}}))),-2===this._lastBlockNumber&&(this._lastBlockNumber=n-1),this._events.forEach((function(e){switch(e.type){case"tx":var t=e.hash,i=o.getTransactionReceipt(t).then((function(e){return e&&null!=e.blockNumber?(o._emitted["t:"+t]=e.blockNumber,o.emit(t,e),null):null})).catch((function(e){o.emit("error",e)}));r.push(i);break;case"filter":if(!e._inflight){e._inflight=!0,-2===e._lastBlockNumber&&(e._lastBlockNumber=n-1);var a=e.filter;a.fromBlock=e._lastBlockNumber+1,a.toBlock=n;var s=a.toBlock-o._maxFilterBlockRange;s>a.fromBlock&&(a.fromBlock=s),a.fromBlock<0&&(a.fromBlock=0);var A=o.getLogs(a).then((function(t){e._inflight=!1,0!==t.length&&t.forEach((function(t){t.blockNumber>e._lastBlockNumber&&(e._lastBlockNumber=t.blockNumber),o._emitted["b:"+t.blockHash]=t.blockNumber,o._emitted["t:"+t.transactionHash]=t.blockNumber,o.emit(a,t)}))})).catch((function(t){o.emit("error",t),e._inflight=!1}));r.push(A)}}})),this._lastBlockNumber=n,Promise.all(r).then((function(){o.emit("didPoll",t)})).catch((function(e){o.emit("error",e)})),e.abrupt("return");case 26:case"end":return e.stop()}}),e,this,[[3,9]])})))}},{key:"resetEventsBlock",value:function(e){this._lastBlockNumber=e-1,this.polling&&this.poll()}},{key:"network",get:function(){return this._network}},{key:"detectNetwork",value:function(){return vA(this,void 0,void 0,regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",BA.throwError("provider does not support network detection",h.b.errors.UNSUPPORTED_OPERATION,{operation:"provider.detectNetwork"}));case 1:case"end":return e.stop()}}),e)})))}},{key:"getNetwork",value:function(){return vA(this,void 0,void 0,regeneratorRuntime.mark((function e(){var t,r,n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._ready();case 2:return t=e.sent,e.next=5,this.detectNetwork();case 5:if(r=e.sent,t.chainId===r.chainId){e.next=23;break}if(!this.anyNetwork){e.next=20;break}return this._network=r,this._lastBlockNumber=-2,this._fastBlockNumber=null,this._fastBlockNumberPromise=null,this._fastQueryDate=0,this._emitted.block=-2,this._maxInternalBlockNumber=-1024,this._internalBlockNumber=null,this.emit("network",r,t),e.next=19,SA(0);case 19:return e.abrupt("return",this._network);case 20:throw n=BA.makeError("underlying network changed",h.b.errors.NETWORK_ERROR,{event:"changed",network:t,detectedNetwork:r}),this.emit("error",n),n;case 23:return e.abrupt("return",t);case 24:case"end":return e.stop()}}),e,this)})))}},{key:"blockNumber",get:function(){var e=this;return this._getInternalBlockNumber(100+this.pollingInterval/2).then((function(t){e._setFastBlockNumber(t)}),(function(e){})),null!=this._fastBlockNumber?this._fastBlockNumber:-1}},{key:"polling",get:function(){return null!=this._poller},set:function(e){var t=this;e&&!this._poller?(this._poller=setInterval((function(){t.poll()}),this.pollingInterval),this._bootstrapPoll||(this._bootstrapPoll=setTimeout((function(){t.poll(),t._bootstrapPoll=setTimeout((function(){t._poller||t.poll(),t._bootstrapPoll=null}),t.pollingInterval)}),0))):!e&&this._poller&&(clearInterval(this._poller),this._poller=null)}},{key:"pollingInterval",get:function(){return this._pollingInterval},set:function(e){var t=this;if("number"!=typeof e||e<=0||parseInt(String(e))!=e)throw new Error("invalid polling interval");this._pollingInterval=e,this._poller&&(clearInterval(this._poller),this._poller=setInterval((function(){t.poll()}),this._pollingInterval))}},{key:"_getFastBlockNumber",value:function(){var e=this,t=_A();return t-this._fastQueryDate>2*this._pollingInterval&&(this._fastQueryDate=t,this._fastBlockNumberPromise=this.getBlockNumber().then((function(t){return(null==e._fastBlockNumber||t>e._fastBlockNumber)&&(e._fastBlockNumber=t),e._fastBlockNumber}))),this._fastBlockNumberPromise}},{key:"_setFastBlockNumber",value:function(e){null!=this._fastBlockNumber&&e<this._fastBlockNumber||(this._fastQueryDate=_A(),(null==this._fastBlockNumber||e>this._fastBlockNumber)&&(this._fastBlockNumber=e,this._fastBlockNumberPromise=Promise.resolve(e)))}},{key:"waitForTransaction",value:function(e,t,r){return vA(this,void 0,void 0,regeneratorRuntime.mark((function n(){return regeneratorRuntime.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.abrupt("return",this._waitForTransaction(e,null==t?1:t,r||0,null));case 1:case"end":return n.stop()}}),n,this)})))}},{key:"_waitForTransaction",value:function(e,t,r,n){return vA(this,void 0,void 0,regeneratorRuntime.mark((function i(){var o,a=this;return regeneratorRuntime.wrap((function(i){for(;;)switch(i.prev=i.next){case 0:return i.next=2,this.getTransactionReceipt(e);case 2:if(!(((o=i.sent)?o.confirmations:0)>=t)){i.next=5;break}return i.abrupt("return",o);case 5:return i.abrupt("return",new Promise((function(i,o){var s=[],A=!1,c=function(){return!!A||(A=!0,s.forEach((function(e){e()})),!1)},u=function(e){e.confirmations<t||c()||i(e)};if(a.on(e,u),s.push((function(){a.removeListener(e,u)})),n){var f=n.startBlock,l=null,g=function r(i){return vA(a,void 0,void 0,regeneratorRuntime.mark((function a(){var s=this;return regeneratorRuntime.wrap((function(a){for(;;)switch(a.prev=a.next){case 0:if(!A){a.next=2;break}return a.abrupt("return");case 2:return a.next=4,SA(1e3);case 4:this.getTransactionCount(n.from).then((function(a){return vA(s,void 0,void 0,regeneratorRuntime.mark((function s(){var u,g,d,p,I,y;return regeneratorRuntime.wrap((function(s){for(;;)switch(s.prev=s.next){case 0:if(!A){s.next=2;break}return s.abrupt("return");case 2:if(!(a<=n.nonce)){s.next=6;break}f=i,s.next=41;break;case 6:return s.next=8,this.getTransaction(e);case 8:if(!(u=s.sent)||null==u.blockNumber){s.next=11;break}return s.abrupt("return");case 11:null==l&&(l=f-3)<n.startBlock&&(l=n.startBlock);case 12:if(!(l<=i)){s.next=41;break}if(!A){s.next=15;break}return s.abrupt("return");case 15:return s.next=17,this.getBlockWithTransactions(l);case 17:g=s.sent,d=0;case 19:if(!(d<g.transactions.length)){s.next=38;break}if((p=g.transactions[d]).hash!==e){s.next=23;break}return s.abrupt("return");case 23:if(p.from!==n.from||p.nonce!==n.nonce){s.next=35;break}if(!A){s.next=26;break}return s.abrupt("return");case 26:return s.next=28,this.waitForTransaction(p.hash,t);case 28:if(I=s.sent,!c()){s.next=31;break}return s.abrupt("return");case 31:return y="replaced",p.data===n.data&&p.to===n.to&&p.value.eq(n.value)?y="repriced":"0x"===p.data&&p.from===p.to&&p.value.isZero()&&(y="cancelled"),o(BA.makeError("transaction was replaced",h.b.errors.TRANSACTION_REPLACED,{cancelled:"replaced"===y||"cancelled"===y,reason:y,replacement:this._wrapTransaction(p),hash:e,receipt:I})),s.abrupt("return");case 35:d++,s.next=19;break;case 38:l++,s.next=12;break;case 41:if(!A){s.next=43;break}return s.abrupt("return");case 43:this.once("block",r);case 44:case"end":return s.stop()}}),s,this)})))}),(function(e){A||s.once("block",r)}));case 5:case"end":return a.stop()}}),a,this)})))};if(A)return;a.once("block",g),s.push((function(){a.removeListener("block",g)}))}if("number"==typeof r&&r>0){var d=setTimeout((function(){c()||o(BA.makeError("timeout exceeded",h.b.errors.TIMEOUT,{timeout:r}))}),r);d.unref&&d.unref(),s.push((function(){clearTimeout(d)}))}})));case 6:case"end":return i.stop()}}),i,this)})))}},{key:"getBlockNumber",value:function(){return vA(this,void 0,void 0,regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this._getInternalBlockNumber(0));case 1:case"end":return e.stop()}}),e,this)})))}},{key:"getGasPrice",value:function(){return vA(this,void 0,void 0,regeneratorRuntime.mark((function e(){var t;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getNetwork();case 2:return e.next=4,this.perform("getGasPrice",{});case 4:return t=e.sent,e.prev=5,e.abrupt("return",y.from(t));case 9:return e.prev=9,e.t0=e.catch(5),e.abrupt("return",BA.throwError("bad result from backend",h.b.errors.SERVER_ERROR,{method:"getGasPrice",result:t,error:e.t0}));case 12:case"end":return e.stop()}}),e,this,[[5,9]])})))}},{key:"getBalance",value:function(e,t){return vA(this,void 0,void 0,regeneratorRuntime.mark((function r(){var n,i;return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,this.getNetwork();case 2:return r.next=4,D({address:this._getAddress(e),blockTag:this._getBlockTag(t)});case 4:return n=r.sent,r.next=7,this.perform("getBalance",n);case 7:return i=r.sent,r.prev=8,r.abrupt("return",y.from(i));case 12:return r.prev=12,r.t0=r.catch(8),r.abrupt("return",BA.throwError("bad result from backend",h.b.errors.SERVER_ERROR,{method:"getBalance",params:n,result:i,error:r.t0}));case 15:case"end":return r.stop()}}),r,this,[[8,12]])})))}},{key:"getTransactionCount",value:function(e,t){return vA(this,void 0,void 0,regeneratorRuntime.mark((function r(){var n,i;return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,this.getNetwork();case 2:return r.next=4,D({address:this._getAddress(e),blockTag:this._getBlockTag(t)});case 4:return n=r.sent,r.next=7,this.perform("getTransactionCount",n);case 7:return i=r.sent,r.prev=8,r.abrupt("return",y.from(i).toNumber());case 12:return r.prev=12,r.t0=r.catch(8),r.abrupt("return",BA.throwError("bad result from backend",h.b.errors.SERVER_ERROR,{method:"getTransactionCount",params:n,result:i,error:r.t0}));case 15:case"end":return r.stop()}}),r,this,[[8,12]])})))}},{key:"getCode",value:function(e,t){return vA(this,void 0,void 0,regeneratorRuntime.mark((function r(){var n,i;return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,this.getNetwork();case 2:return r.next=4,D({address:this._getAddress(e),blockTag:this._getBlockTag(t)});case 4:return n=r.sent,r.next=7,this.perform("getCode",n);case 7:return i=r.sent,r.prev=8,r.abrupt("return",Object(c.i)(i));case 12:return r.prev=12,r.t0=r.catch(8),r.abrupt("return",BA.throwError("bad result from backend",h.b.errors.SERVER_ERROR,{method:"getCode",params:n,result:i,error:r.t0}));case 15:case"end":return r.stop()}}),r,this,[[8,12]])})))}},{key:"getStorageAt",value:function(e,t,r){return vA(this,void 0,void 0,regeneratorRuntime.mark((function n(){var i,o;return regeneratorRuntime.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,this.getNetwork();case 2:return n.next=4,D({address:this._getAddress(e),blockTag:this._getBlockTag(r),position:Promise.resolve(t).then((function(e){return Object(c.g)(e)}))});case 4:return i=n.sent,n.next=7,this.perform("getStorageAt",i);case 7:return o=n.sent,n.prev=8,n.abrupt("return",Object(c.i)(o));case 12:return n.prev=12,n.t0=n.catch(8),n.abrupt("return",BA.throwError("bad result from backend",h.b.errors.SERVER_ERROR,{method:"getStorageAt",params:i,result:o,error:n.t0}));case 15:case"end":return n.stop()}}),n,this,[[8,12]])})))}},{key:"_wrapTransaction",value:function(e,t,r){var n=this;if(null!=t&&32!==Object(c.d)(t))throw new Error("invalid response - sendTransaction");var i=e;return null!=t&&e.hash!==t&&BA.throwError("Transaction hash mismatch from Provider.sendTransaction.",h.b.errors.UNKNOWN_ERROR,{expectedHash:e.hash,returnedHash:t}),i.wait=function(t,i){return vA(n,void 0,void 0,regeneratorRuntime.mark((function n(){var o,a;return regeneratorRuntime.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return null==t&&(t=1),null==i&&(i=0),o=void 0,0!==t&&null!=r&&(o={data:e.data,from:e.from,nonce:e.nonce,to:e.to,value:e.value,startBlock:r}),n.next=6,this._waitForTransaction(e.hash,t,i,o);case 6:if(null!=(a=n.sent)||0!==t){n.next=9;break}return n.abrupt("return",null);case 9:return this._emitted["t:"+e.hash]=a.blockNumber,0===a.status&&BA.throwError("transaction failed",h.b.errors.CALL_EXCEPTION,{transactionHash:e.hash,transaction:e,receipt:a}),n.abrupt("return",a);case 12:case"end":return n.stop()}}),n,this)})))},i}},{key:"sendTransaction",value:function(e){return vA(this,void 0,void 0,regeneratorRuntime.mark((function t(){var r,n,i,o;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.getNetwork();case 2:return t.next=4,Promise.resolve(e).then((function(e){return Object(c.i)(e)}));case 4:return r=t.sent,null==(n=this.formatter.transaction(e)).confirmations&&(n.confirmations=0),t.next=9,this._getInternalBlockNumber(100+2*this.pollingInterval);case 9:return i=t.sent,t.prev=10,t.next=13,this.perform("sendTransaction",{signedTransaction:r});case 13:return o=t.sent,t.abrupt("return",this._wrapTransaction(n,o,i));case 17:throw t.prev=17,t.t0=t.catch(10),t.t0.transaction=n,t.t0.transactionHash=n.hash,t.t0;case 22:case"end":return t.stop()}}),t,this,[[10,17]])})))}},{key:"_getTransactionRequest",value:function(e){return vA(this,void 0,void 0,regeneratorRuntime.mark((function t(){var r,n,i=this;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e;case 2:return r=t.sent,n={},["from","to"].forEach((function(e){null!=r[e]&&(n[e]=Promise.resolve(r[e]).then((function(e){return e?i._getAddress(e):null})))})),["gasLimit","gasPrice","maxFeePerGas","maxPriorityFeePerGas","value"].forEach((function(e){null!=r[e]&&(n[e]=Promise.resolve(r[e]).then((function(e){return e?y.from(e):null})))})),["type"].forEach((function(e){null!=r[e]&&(n[e]=Promise.resolve(r[e]).then((function(e){return null!=e?e:null})))})),r.accessList&&(n.accessList=this.formatter.accessList(r.accessList)),["data"].forEach((function(e){null!=r[e]&&(n[e]=Promise.resolve(r[e]).then((function(e){return e?Object(c.i)(e):null})))})),t.t0=this.formatter,t.next=12,D(n);case 12:return t.t1=t.sent,t.abrupt("return",t.t0.transactionRequest.call(t.t0,t.t1));case 14:case"end":return t.stop()}}),t,this)})))}},{key:"_getFilter",value:function(e){return vA(this,void 0,void 0,regeneratorRuntime.mark((function t(){var r,n=this;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e;case 2:return e=t.sent,r={},null!=e.address&&(r.address=this._getAddress(e.address)),["blockHash","topics"].forEach((function(t){null!=e[t]&&(r[t]=e[t])})),["fromBlock","toBlock"].forEach((function(t){null!=e[t]&&(r[t]=n._getBlockTag(e[t]))})),t.t0=this.formatter,t.next=10,D(r);case 10:return t.t1=t.sent,t.abrupt("return",t.t0.filter.call(t.t0,t.t1));case 12:case"end":return t.stop()}}),t,this)})))}},{key:"_call",value:function(e,t,r){return vA(this,void 0,void 0,regeneratorRuntime.mark((function n(){var i,o,a,s,A,u,f,l,g,d,p,I,b,E,m;return regeneratorRuntime.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return r>=10&&BA.throwError("CCIP read exceeded maximum redirections",h.b.errors.SERVER_ERROR,{redirects:r,transaction:e}),i=e.to,n.next=4,this.perform("call",{transaction:e,blockTag:t});case 4:if(o=n.sent,!(r>=0&&"latest"===t&&null!=i&&"0x556f1830"===o.substring(0,10)&&Object(c.d)(o)%32==4)){n.next=31;break}for(n.prev=6,a=Object(c.e)(o,4),s=Object(c.e)(a,0,32),y.from(s).eq(i)||BA.throwError("CCIP Read sender did not match",h.b.errors.CALL_EXCEPTION,{name:"OffchainLookup",signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",transaction:e,data:o}),A=[],u=y.from(Object(c.e)(a,32,64)).toNumber(),f=y.from(Object(c.e)(a,u,u+32)).toNumber(),l=Object(c.e)(a,u+32),g=0;g<f;g++)null==(d=FA(l,32*g))&&BA.throwError("CCIP Read contained corrupt URL string",h.b.errors.CALL_EXCEPTION,{name:"OffchainLookup",signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",transaction:e,data:o}),A.push(d);return p=jA(a,64),y.from(Object(c.e)(a,100,128)).isZero()||BA.throwError("CCIP Read callback selector included junk",h.b.errors.CALL_EXCEPTION,{name:"OffchainLookup",signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",transaction:e,data:o}),I=Object(c.e)(a,96,100),b=jA(a,128),n.next=21,this.ccipReadFetch(e,p,A);case 21:return null==(E=n.sent)&&BA.throwError("CCIP Read disabled or provided no URLs",h.b.errors.CALL_EXCEPTION,{name:"OffchainLookup",signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",transaction:e,data:o}),m={to:i,data:Object(c.c)([I,HA([E,b])])},n.abrupt("return",this._call(m,t,r+1));case 27:if(n.prev=27,n.t0=n.catch(6),n.t0.code!==h.b.errors.SERVER_ERROR){n.next=31;break}throw n.t0;case 31:return n.prev=31,n.abrupt("return",Object(c.i)(o));case 35:return n.prev=35,n.t1=n.catch(31),n.abrupt("return",BA.throwError("bad result from backend",h.b.errors.SERVER_ERROR,{method:"call",params:{transaction:e,blockTag:t},result:o,error:n.t1}));case 38:case"end":return n.stop()}}),n,this,[[6,27],[31,35]])})))}},{key:"call",value:function(e,t){return vA(this,void 0,void 0,regeneratorRuntime.mark((function r(){var n;return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,this.getNetwork();case 2:return r.next=4,D({transaction:this._getTransactionRequest(e),blockTag:this._getBlockTag(t),ccipReadEnabled:Promise.resolve(e.ccipReadEnabled)});case 4:return n=r.sent,r.abrupt("return",this._call(n.transaction,n.blockTag,n.ccipReadEnabled?0:-1));case 6:case"end":return r.stop()}}),r,this)})))}},{key:"estimateGas",value:function(e){return vA(this,void 0,void 0,regeneratorRuntime.mark((function t(){var r,n;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.getNetwork();case 2:return t.next=4,D({transaction:this._getTransactionRequest(e)});case 4:return r=t.sent,t.next=7,this.perform("estimateGas",r);case 7:return n=t.sent,t.prev=8,t.abrupt("return",y.from(n));case 12:return t.prev=12,t.t0=t.catch(8),t.abrupt("return",BA.throwError("bad result from backend",h.b.errors.SERVER_ERROR,{method:"estimateGas",params:r,result:n,error:t.t0}));case 15:case"end":return t.stop()}}),t,this,[[8,12]])})))}},{key:"_getAddress",value:function(e){return vA(this,void 0,void 0,regeneratorRuntime.mark((function t(){var r;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e;case 2:return"string"!=typeof(e=t.sent)&&BA.throwArgumentError("invalid address or ENS name","name",e),t.next=6,this.resolveName(e);case 6:return null==(r=t.sent)&&BA.throwError("ENS name not configured",h.b.errors.UNSUPPORTED_OPERATION,{operation:"resolveName(".concat(JSON.stringify(e),")")}),t.abrupt("return",r);case 9:case"end":return t.stop()}}),t,this)})))}},{key:"_getBlock",value:function(e,t){return vA(this,void 0,void 0,regeneratorRuntime.mark((function r(){var n,i,o=this;return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,this.getNetwork();case 2:return r.next=4,e;case 4:if(e=r.sent,n=-128,i={includeTransactions:!!t},!Object(c.l)(e,32)){r.next=11;break}i.blockHash=e,r.next=21;break;case 11:return r.prev=11,r.next=14,this._getBlockTag(e);case 14:i.blockTag=r.sent,Object(c.l)(i.blockTag)&&(n=parseInt(i.blockTag.substring(2),16)),r.next=21;break;case 18:r.prev=18,r.t0=r.catch(11),BA.throwArgumentError("invalid block hash or block tag","blockHashOrBlockTag",e);case 21:return r.abrupt("return",iA((function(){return vA(o,void 0,void 0,regeneratorRuntime.mark((function e(){var r,o,a,s,A,c,u=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.perform("getBlock",i);case 2:if(null!=(r=e.sent)){e.next=11;break}if(null==i.blockHash){e.next=7;break}if(null!=this._emitted["b:"+i.blockHash]){e.next=7;break}return e.abrupt("return",null);case 7:if(null==i.blockTag){e.next=10;break}if(!(n>this._emitted.block)){e.next=10;break}return e.abrupt("return",null);case 10:return e.abrupt("return",void 0);case 11:if(!t){e.next=34;break}o=null,a=0;case 14:if(!(a<r.transactions.length)){e.next=31;break}if(null!=(s=r.transactions[a]).blockNumber){e.next=20;break}s.confirmations=0,e.next=28;break;case 20:if(null!=s.confirmations){e.next=28;break}if(null!=o){e.next=25;break}return e.next=24,this._getInternalBlockNumber(100+2*this.pollingInterval);case 24:o=e.sent;case 25:(A=o-s.blockNumber+1)<=0&&(A=1),s.confirmations=A;case 28:a++,e.next=14;break;case 31:return(c=this.formatter.blockWithTransactions(r)).transactions=c.transactions.map((function(e){return u._wrapTransaction(e)})),e.abrupt("return",c);case 34:return e.abrupt("return",this.formatter.block(r));case 35:case"end":return e.stop()}}),e,this)})))}),{oncePoll:this}));case 22:case"end":return r.stop()}}),r,this,[[11,18]])})))}},{key:"getBlock",value:function(e){return this._getBlock(e,!1)}},{key:"getBlockWithTransactions",value:function(e){return this._getBlock(e,!0)}},{key:"getTransaction",value:function(e){return vA(this,void 0,void 0,regeneratorRuntime.mark((function t(){var r,n=this;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.getNetwork();case 2:return t.next=4,e;case 4:return e=t.sent,r={transactionHash:this.formatter.hash(e,!0)},t.abrupt("return",iA((function(){return vA(n,void 0,void 0,regeneratorRuntime.mark((function t(){var n,i,o,a;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.perform("getTransaction",r);case 2:if(null!=(n=t.sent)){t.next=7;break}if(null!=this._emitted["t:"+e]){t.next=6;break}return t.abrupt("return",null);case 6:return t.abrupt("return",void 0);case 7:if(null!=(i=this.formatter.transactionResponse(n)).blockNumber){t.next=12;break}i.confirmations=0,t.next=19;break;case 12:if(null!=i.confirmations){t.next=19;break}return t.next=15,this._getInternalBlockNumber(100+2*this.pollingInterval);case 15:o=t.sent,(a=o-i.blockNumber+1)<=0&&(a=1),i.confirmations=a;case 19:return t.abrupt("return",this._wrapTransaction(i));case 20:case"end":return t.stop()}}),t,this)})))}),{oncePoll:this}));case 7:case"end":return t.stop()}}),t,this)})))}},{key:"getTransactionReceipt",value:function(e){return vA(this,void 0,void 0,regeneratorRuntime.mark((function t(){var r,n=this;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.getNetwork();case 2:return t.next=4,e;case 4:return e=t.sent,r={transactionHash:this.formatter.hash(e,!0)},t.abrupt("return",iA((function(){return vA(n,void 0,void 0,regeneratorRuntime.mark((function t(){var n,i,o,a;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.perform("getTransactionReceipt",r);case 2:if(null!=(n=t.sent)){t.next=7;break}if(null!=this._emitted["t:"+e]){t.next=6;break}return t.abrupt("return",null);case 6:return t.abrupt("return",void 0);case 7:if(null!=n.blockHash){t.next=9;break}return t.abrupt("return",void 0);case 9:if(null!=(i=this.formatter.receipt(n)).blockNumber){t.next=14;break}i.confirmations=0,t.next=21;break;case 14:if(null!=i.confirmations){t.next=21;break}return t.next=17,this._getInternalBlockNumber(100+2*this.pollingInterval);case 17:o=t.sent,(a=o-i.blockNumber+1)<=0&&(a=1),i.confirmations=a;case 21:return t.abrupt("return",i);case 22:case"end":return t.stop()}}),t,this)})))}),{oncePoll:this}));case 7:case"end":return t.stop()}}),t,this)})))}},{key:"getLogs",value:function(e){return vA(this,void 0,void 0,regeneratorRuntime.mark((function t(){var r,n;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.getNetwork();case 2:return t.next=4,D({filter:this._getFilter(e)});case 4:return r=t.sent,t.next=7,this.perform("getLogs",r);case 7:return(n=t.sent).forEach((function(e){null==e.removed&&(e.removed=!1)})),t.abrupt("return",cA.arrayOf(this.formatter.filterLog.bind(this.formatter))(n));case 10:case"end":return t.stop()}}),t,this)})))}},{key:"getEtherPrice",value:function(){return vA(this,void 0,void 0,regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getNetwork();case 2:return e.abrupt("return",this.perform("getEtherPrice",{}));case 3:case"end":return e.stop()}}),e,this)})))}},{key:"_getBlockTag",value:function(e){return vA(this,void 0,void 0,regeneratorRuntime.mark((function t(){var r;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e;case 2:if(!("number"==typeof(e=t.sent)&&e<0)){t.next=11;break}return e%1&&BA.throwArgumentError("invalid BlockTag","blockTag",e),t.next=7,this._getInternalBlockNumber(100+2*this.pollingInterval);case 7:return r=t.sent,(r+=e)<0&&(r=0),t.abrupt("return",this.formatter.blockTag(r));case 11:return t.abrupt("return",this.formatter.blockTag(e));case 12:case"end":return t.stop()}}),t,this)})))}},{key:"getResolver",value:function(e){return vA(this,void 0,void 0,regeneratorRuntime.mark((function t(){var r,n,i;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:r=e;case 1:if(""!==r&&"."!==r){t.next=4;break}return t.abrupt("return",null);case 4:if("eth"===e||"eth"!==r){t.next=6;break}return t.abrupt("return",null);case 6:return t.next=8,this._getResolver(r,"getResolver");case 8:if(null==(n=t.sent)){t.next=19;break}if(i=new GA(this,n,e),t.t0=r!==e,!t.t0){t.next=16;break}return t.next=15,i.supportsWildcard();case 15:t.t0=!t.sent;case 16:if(!t.t0){t.next=18;break}return t.abrupt("return",null);case 18:return t.abrupt("return",i);case 19:r=r.split(".").slice(1).join("."),t.next=1;break;case 22:case"end":return t.stop()}}),t,this)})))}},{key:"_getResolver",value:function(e,t){return vA(this,void 0,void 0,regeneratorRuntime.mark((function r(){var n,i;return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return null==t&&(t="ENS"),r.next=3,this.getNetwork();case 3:return(n=r.sent).ensAddress||BA.throwError("network does not support ENS",h.b.errors.UNSUPPORTED_OPERATION,{operation:t,network:n.name}),r.prev=5,r.next=8,this.call({to:n.ensAddress,data:"0x0178b8bf"+Js(e).substring(2)});case 8:return i=r.sent,r.abrupt("return",this.formatter.callAddress(i));case 12:r.prev=12,r.t0=r.catch(5);case 14:return r.abrupt("return",null);case 15:case"end":return r.stop()}}),r,this,[[5,12]])})))}},{key:"resolveName",value:function(e){return vA(this,void 0,void 0,regeneratorRuntime.mark((function t(){var r;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e;case 2:return e=t.sent,t.prev=3,t.abrupt("return",Promise.resolve(this.formatter.address(e)));case 7:if(t.prev=7,t.t0=t.catch(3),!Object(c.l)(e)){t.next=11;break}throw t.t0;case 11:return"string"!=typeof e&&BA.throwArgumentError("invalid ENS name","name",e),t.next=14,this.getResolver(e);case 14:if(r=t.sent){t.next=17;break}return t.abrupt("return",null);case 17:return t.next=19,r.getAddress();case 19:return t.abrupt("return",t.sent);case 20:case"end":return t.stop()}}),t,this,[[3,7]])})))}},{key:"lookupAddress",value:function(e){return vA(this,void 0,void 0,regeneratorRuntime.mark((function t(){var r,n,i;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e;case 2:return e=t.sent,e=this.formatter.address(e),r=e.substring(2).toLowerCase()+".addr.reverse",t.next=7,this._getResolver(r,"lookupAddress");case 7:if(null!=(n=t.sent)){t.next=10;break}return t.abrupt("return",null);case 10:return t.t0=FA,t.next=13,this.call({to:n,data:"0x691f3431"+Js(r).substring(2)});case 13:return t.t1=t.sent,i=(0,t.t0)(t.t1,0),t.next=17,this.resolveName(i);case 17:if(t.sent==e){t.next=20;break}return t.abrupt("return",null);case 20:return t.abrupt("return",i);case 21:case"end":return t.stop()}}),t,this)})))}},{key:"getAvatar",value:function(e){return vA(this,void 0,void 0,regeneratorRuntime.mark((function t(){var r,n,i,o,a,s,A;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=null,!Object(c.l)(e)){t.next=40;break}return n=this.formatter.address(e),i=n.substring(2).toLowerCase()+".addr.reverse",t.next=6,this._getResolver(i,"getAvatar");case 6:if(o=t.sent){t.next=9;break}return t.abrupt("return",null);case 9:return r=new GA(this,o,i),t.prev=10,t.next=13,r.getAvatar();case 13:if(!(a=t.sent)){t.next=16;break}return t.abrupt("return",a.url);case 16:t.next=22;break;case 18:if(t.prev=18,t.t0=t.catch(10),t.t0.code===h.b.errors.CALL_EXCEPTION){t.next=22;break}throw t.t0;case 22:return t.prev=22,t.t1=FA,t.next=26,this.call({to:o,data:"0x691f3431"+Js(i).substring(2)});case 26:return t.t2=t.sent,s=(0,t.t1)(t.t2,0),t.next=30,this.getResolver(s);case 30:r=t.sent,t.next=38;break;case 33:if(t.prev=33,t.t3=t.catch(22),t.t3.code===h.b.errors.CALL_EXCEPTION){t.next=37;break}throw t.t3;case 37:return t.abrupt("return",null);case 38:t.next=45;break;case 40:return t.next=42,this.getResolver(e);case 42:if(r=t.sent){t.next=45;break}return t.abrupt("return",null);case 45:return t.next=47,r.getAvatar();case 47:if(null!=(A=t.sent)){t.next=50;break}return t.abrupt("return",null);case 50:return t.abrupt("return",A.url);case 51:case"end":return t.stop()}}),t,this,[[10,18],[22,33]])})))}},{key:"perform",value:function(e,t){return BA.throwError(e+" not implemented",h.b.errors.NOT_IMPLEMENTED,{operation:e})}},{key:"_startEvent",value:function(e){this.polling=this._events.filter((function(e){return e.pollable()})).length>0}},{key:"_stopEvent",value:function(e){this.polling=this._events.filter((function(e){return e.pollable()})).length>0}},{key:"_addEventListener",value:function(e,t,r){var n=new MA(kA(e),t,r);return this._events.push(n),this._startEvent(n),this}},{key:"on",value:function(e,t){return this._addEventListener(e,t,!1)}},{key:"once",value:function(e,t){return this._addEventListener(e,t,!0)}},{key:"emit",value:function(e){for(var t=this,r=arguments.length,n=new Array(r>1?r-1:0),i=1;i<r;i++)n[i-1]=arguments[i];var o=!1,a=[],s=kA(e);return this._events=this._events.filter((function(e){return e.tag!==s||(setTimeout((function(){e.listener.apply(t,n)}),0),o=!0,!e.once||(a.push(e),!1))})),a.forEach((function(e){t._stopEvent(e)})),o}},{key:"listenerCount",value:function(e){if(!e)return this._events.length;var t=kA(e);return this._events.filter((function(e){return e.tag===t})).length}},{key:"listeners",value:function(e){if(null==e)return this._events.map((function(e){return e.listener}));var t=kA(e);return this._events.filter((function(e){return e.tag===t})).map((function(e){return e.listener}))}},{key:"off",value:function(e,t){var r=this;if(null==t)return this.removeAllListeners(e);var n=[],i=!1,o=kA(e);return this._events=this._events.filter((function(e){return e.tag!==o||e.listener!=t||(!!i||(i=!0,n.push(e),!1))})),n.forEach((function(e){r._stopEvent(e)})),this}},{key:"removeAllListeners",value:function(e){var t=this,r=[];if(null==e)r=this._events,this._events=[];else{var n=kA(e);this._events=this._events.filter((function(e){return e.tag!==n||(r.push(e),!1)}))}return r.forEach((function(e){t._stopEvent(e)})),this}}],[{key:"getFormatter",value:function(){return null==YA&&(YA=new cA),YA}},{key:"getNetwork",value:function(e){return ds(null==e?"homestead":e)}}]),r}(En);function JA(){return(JA="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,r){var n=zA(e,t);if(n){var i=Object.getOwnPropertyDescriptor(n,t);return i.get?i.get.call(arguments.length<3?e:r):i.value}}).apply(this,arguments)}function zA(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=nc(e)););return e}function VA(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function ZA(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function WA(e,t,r){return t&&ZA(e.prototype,t),r&&ZA(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function XA(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&$A(e,t)}function $A(e,t){return($A=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function ec(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=nc(e);if(t){var i=nc(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return tc(this,r)}}function tc(e,t){if(t&&("object"===ic(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return rc(e)}function rc(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function nc(e){return(nc=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function ic(e){return(ic="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var oc=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{A(n.next(e))}catch(e){o(e)}}function s(e){try{A(n.throw(e))}catch(e){o(e)}}function A(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}A((n=n.apply(e,t||[])).next())}))},ac=new h.b("providers/5.7.2"),sc=["call","estimateGas"];function Ac(e,t){if(null==e)return null;if("string"==typeof e.message&&e.message.match("reverted")){var r=Object(c.l)(e.data)?e.data:null;if(!t||r)return{message:e.message,data:r}}if("object"===ic(e)){for(var n in e){var i=Ac(e[n],t);if(i)return i}return null}if("string"==typeof e)try{return Ac(JSON.parse(e),t)}catch(e){}return null}function cc(e,t,r){var n=r.transaction||r.signedTransaction;if("call"===e){var i=Ac(t,!0);if(i)return i.data;ac.throwError("missing revert data in call exception; Transaction reverted without a reason string",h.b.errors.CALL_EXCEPTION,{data:"0x",transaction:n,error:t})}if("estimateGas"===e){var o=Ac(t.body,!1);null==o&&(o=Ac(t,!1)),o&&ac.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",h.b.errors.UNPREDICTABLE_GAS_LIMIT,{reason:o.message,method:e,transaction:n,error:t})}var a=t.message;throw t.code===h.b.errors.SERVER_ERROR&&t.error&&"string"==typeof t.error.message?a=t.error.message:"string"==typeof t.body?a=t.body:"string"==typeof t.responseText&&(a=t.responseText),(a=(a||"").toLowerCase()).match(/insufficient funds|base fee exceeds gas limit|InsufficientFunds/i)&&ac.throwError("insufficient funds for intrinsic transaction cost",h.b.errors.INSUFFICIENT_FUNDS,{error:t,method:e,transaction:n}),a.match(/nonce (is )?too low/i)&&ac.throwError("nonce has already been used",h.b.errors.NONCE_EXPIRED,{error:t,method:e,transaction:n}),a.match(/replacement transaction underpriced|transaction gas price.*too low/i)&&ac.throwError("replacement fee too low",h.b.errors.REPLACEMENT_UNDERPRICED,{error:t,method:e,transaction:n}),a.match(/only replay-protected/i)&&ac.throwError("legacy pre-eip-155 transactions not supported",h.b.errors.UNSUPPORTED_OPERATION,{error:t,method:e,transaction:n}),sc.indexOf(e)>=0&&a.match(/gas required exceeds allowance|always failing transaction|execution reverted|revert/)&&ac.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",h.b.errors.UNPREDICTABLE_GAS_LIMIT,{error:t,method:e,transaction:n}),t}function uc(e){return new Promise((function(t){setTimeout(t,e)}))}function fc(e){if(e.error){var t=new Error(e.error.message);throw t.code=e.error.code,t.data=e.error.data,t}return e.result}function hc(e){return e?e.toLowerCase():e}var lc={},gc=function(e){XA(r,e);var t=ec(r);function r(e,n,i){var o;if(VA(this,r),o=t.call(this),e!==lc)throw new Error("do not call the JsonRpcSigner constructor directly; use provider.getSigner");return _(rc(o),"provider",n),null==i&&(i=0),"string"==typeof i?(_(rc(o),"_address",o.provider.formatter.address(i)),_(rc(o),"_index",null)):"number"==typeof i?(_(rc(o),"_index",i),_(rc(o),"_address",null)):ac.throwArgumentError("invalid address or index","addressOrIndex",i),o}return WA(r,[{key:"connect",value:function(e){return ac.throwError("cannot alter JSON-RPC Signer connection",h.b.errors.UNSUPPORTED_OPERATION,{operation:"connect"})}},{key:"connectUnchecked",value:function(){return new dc(lc,this.provider,this._address||this._index)}},{key:"getAddress",value:function(){var e=this;return this._address?Promise.resolve(this._address):this.provider.send("eth_accounts",[]).then((function(t){return t.length<=e._index&&ac.throwError("unknown account #"+e._index,h.b.errors.UNSUPPORTED_OPERATION,{operation:"getAddress"}),e.provider.formatter.address(t[e._index])}))}},{key:"sendUncheckedTransaction",value:function(e){var t=this;e=R(e);var r=this.getAddress().then((function(e){return e&&(e=e.toLowerCase()),e}));if(null==e.gasLimit){var n=R(e);n.from=r,e.gasLimit=this.provider.estimateGas(n)}return null!=e.to&&(e.to=Promise.resolve(e.to).then((function(e){return oc(t,void 0,void 0,regeneratorRuntime.mark((function t(){var r;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(null!=e){t.next=2;break}return t.abrupt("return",null);case 2:return t.next=4,this.provider.resolveName(e);case 4:return null==(r=t.sent)&&ac.throwArgumentError("provided ENS name resolves to null","tx.to",e),t.abrupt("return",r);case 7:case"end":return t.stop()}}),t,this)})))}))),D({tx:D(e),sender:r}).then((function(r){var n=r.tx,i=r.sender;null!=n.from?n.from.toLowerCase()!==i&&ac.throwArgumentError("from address mismatch","transaction",e):n.from=i;var o=t.provider.constructor.hexlifyTransaction(n,{from:!0});return t.provider.send("eth_sendTransaction",[o]).then((function(e){return e}),(function(e){return"string"==typeof e.message&&e.message.match(/user denied/i)&&ac.throwError("user rejected transaction",h.b.errors.ACTION_REJECTED,{action:"sendTransaction",transaction:n}),cc("sendTransaction",e,o)}))}))}},{key:"signTransaction",value:function(e){return ac.throwError("signing transactions is unsupported",h.b.errors.UNSUPPORTED_OPERATION,{operation:"signTransaction"})}},{key:"sendTransaction",value:function(e){return oc(this,void 0,void 0,regeneratorRuntime.mark((function t(){var r,n,i=this;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.provider._getInternalBlockNumber(100+2*this.provider.pollingInterval);case 2:return r=t.sent,t.next=5,this.sendUncheckedTransaction(e);case 5:return n=t.sent,t.prev=6,t.next=9,iA((function(){return oc(i,void 0,void 0,regeneratorRuntime.mark((function e(){var t;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.provider.getTransaction(n);case 2:if(null!==(t=e.sent)){e.next=5;break}return e.abrupt("return",void 0);case 5:return e.abrupt("return",this.provider._wrapTransaction(t,n,r));case 6:case"end":return e.stop()}}),e,this)})))}),{oncePoll:this.provider});case 9:return t.abrupt("return",t.sent);case 12:throw t.prev=12,t.t0=t.catch(6),t.t0.transactionHash=n,t.t0;case 16:case"end":return t.stop()}}),t,this,[[6,12]])})))}},{key:"signMessage",value:function(e){return oc(this,void 0,void 0,regeneratorRuntime.mark((function t(){var r,n;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r="string"==typeof e?be(e):e,t.next=3,this.getAddress();case 3:return n=t.sent,t.prev=4,t.next=7,this.provider.send("personal_sign",[Object(c.i)(r),n.toLowerCase()]);case 7:return t.abrupt("return",t.sent);case 10:throw t.prev=10,t.t0=t.catch(4),"string"==typeof t.t0.message&&t.t0.message.match(/user denied/i)&&ac.throwError("user rejected signing",h.b.errors.ACTION_REJECTED,{action:"signMessage",from:n,messageData:e}),t.t0;case 14:case"end":return t.stop()}}),t,this,[[4,10]])})))}},{key:"_legacySignMessage",value:function(e){return oc(this,void 0,void 0,regeneratorRuntime.mark((function t(){var r,n;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r="string"==typeof e?be(e):e,t.next=3,this.getAddress();case 3:return n=t.sent,t.prev=4,t.next=7,this.provider.send("eth_sign",[n.toLowerCase(),Object(c.i)(r)]);case 7:return t.abrupt("return",t.sent);case 10:throw t.prev=10,t.t0=t.catch(4),"string"==typeof t.t0.message&&t.t0.message.match(/user denied/i)&&ac.throwError("user rejected signing",h.b.errors.ACTION_REJECTED,{action:"_legacySignMessage",from:n,messageData:e}),t.t0;case 14:case"end":return t.stop()}}),t,this,[[4,10]])})))}},{key:"_signTypedData",value:function(e,t,r){return oc(this,void 0,void 0,regeneratorRuntime.mark((function n(){var i,o,a=this;return regeneratorRuntime.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,bo.resolveNames(e,t,r,(function(e){return a.provider.resolveName(e)}));case 2:return i=n.sent,n.next=5,this.getAddress();case 5:return o=n.sent,n.prev=6,n.next=9,this.provider.send("eth_signTypedData_v4",[o.toLowerCase(),JSON.stringify(bo.getPayload(i.domain,t,i.value))]);case 9:return n.abrupt("return",n.sent);case 12:throw n.prev=12,n.t0=n.catch(6),"string"==typeof n.t0.message&&n.t0.message.match(/user denied/i)&&ac.throwError("user rejected signing",h.b.errors.ACTION_REJECTED,{action:"_signTypedData",from:o,messageData:{domain:i.domain,types:t,value:i.value}}),n.t0;case 16:case"end":return n.stop()}}),n,this,[[6,12]])})))}},{key:"unlock",value:function(e){return oc(this,void 0,void 0,regeneratorRuntime.mark((function t(){var r,n;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=this.provider,t.next=3,this.getAddress();case 3:return n=t.sent,t.abrupt("return",r.send("personal_unlockAccount",[n.toLowerCase(),e,null]));case 5:case"end":return t.stop()}}),t,this)})))}}]),r}(On),dc=function(e){XA(r,e);var t=ec(r);function r(){return VA(this,r),t.apply(this,arguments)}return WA(r,[{key:"sendTransaction",value:function(e){var t=this;return this.sendUncheckedTransaction(e).then((function(e){return{hash:e,nonce:null,gasLimit:null,gasPrice:null,data:null,value:null,chainId:null,confirmations:0,from:null,wait:function(r){return t.provider.waitForTransaction(e,r)}}}))}}]),r}(gc),pc={chainId:!0,data:!0,gasLimit:!0,gasPrice:!0,nonce:!0,to:!0,value:!0,type:!0,accessList:!0,maxFeePerGas:!0,maxPriorityFeePerGas:!0},Ic=function(e){XA(r,e);var t=ec(r);function r(e,n){var i;VA(this,r);var o=n;return null==o&&(o=new Promise((function(e,t){setTimeout((function(){i.detectNetwork().then((function(t){e(t)}),(function(e){t(e)}))}),0)}))),i=t.call(this,o),e||(e=S(i.constructor,"defaultUrl")()),_(rc(i),"connection","string"==typeof e?Object.freeze({url:e}):Object.freeze(R(e))),i._nextId=42,i}return WA(r,[{key:"_cache",get:function(){return null==this._eventLoopCache&&(this._eventLoopCache={}),this._eventLoopCache}},{key:"detectNetwork",value:function(){var e=this;return this._cache.detectNetwork||(this._cache.detectNetwork=this._uncachedDetectNetwork(),setTimeout((function(){e._cache.detectNetwork=null}),0)),this._cache.detectNetwork}},{key:"_uncachedDetectNetwork",value:function(){return oc(this,void 0,void 0,regeneratorRuntime.mark((function e(){var t,r;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,uc(0);case 2:return t=null,e.prev=3,e.next=6,this.send("eth_chainId",[]);case 6:t=e.sent,e.next=19;break;case 9:return e.prev=9,e.t0=e.catch(3),e.prev=11,e.next=14,this.send("net_version",[]);case 14:t=e.sent,e.next=19;break;case 17:e.prev=17,e.t1=e.catch(11);case 19:if(null==t){e.next=28;break}return r=S(this.constructor,"getNetwork"),e.prev=21,e.abrupt("return",r(y.from(t).toNumber()));case 25:return e.prev=25,e.t2=e.catch(21),e.abrupt("return",ac.throwError("could not detect network",h.b.errors.NETWORK_ERROR,{chainId:t,event:"invalidNetwork",serverError:e.t2}));case 28:return e.abrupt("return",ac.throwError("could not detect network",h.b.errors.NETWORK_ERROR,{event:"noNetwork"}));case 29:case"end":return e.stop()}}),e,this,[[3,9],[11,17],[21,25]])})))}},{key:"getSigner",value:function(e){return new gc(lc,this,e)}},{key:"getUncheckedSigner",value:function(e){return this.getSigner(e).connectUnchecked()}},{key:"listAccounts",value:function(){var e=this;return this.send("eth_accounts",[]).then((function(t){return t.map((function(t){return e.formatter.address(t)}))}))}},{key:"send",value:function(e,t){var r=this,n={method:e,params:t,id:this._nextId++,jsonrpc:"2.0"};this.emit("debug",{action:"request",request:N(n),provider:this});var i=["eth_chainId","eth_blockNumber"].indexOf(e)>=0;if(i&&this._cache[e])return this._cache[e];var o=nA(this.connection,JSON.stringify(n),fc).then((function(e){return r.emit("debug",{action:"response",request:n,response:e,provider:r}),e}),(function(e){throw r.emit("debug",{action:"response",error:e,request:n,provider:r}),e}));return i&&(this._cache[e]=o,setTimeout((function(){r._cache[e]=null}),0)),o}},{key:"prepareRequest",value:function(e,t){switch(e){case"getBlockNumber":return["eth_blockNumber",[]];case"getGasPrice":return["eth_gasPrice",[]];case"getBalance":return["eth_getBalance",[hc(t.address),t.blockTag]];case"getTransactionCount":return["eth_getTransactionCount",[hc(t.address),t.blockTag]];case"getCode":return["eth_getCode",[hc(t.address),t.blockTag]];case"getStorageAt":return["eth_getStorageAt",[hc(t.address),Object(c.h)(t.position,32),t.blockTag]];case"sendTransaction":return["eth_sendRawTransaction",[t.signedTransaction]];case"getBlock":return t.blockTag?["eth_getBlockByNumber",[t.blockTag,!!t.includeTransactions]]:t.blockHash?["eth_getBlockByHash",[t.blockHash,!!t.includeTransactions]]:null;case"getTransaction":return["eth_getTransactionByHash",[t.transactionHash]];case"getTransactionReceipt":return["eth_getTransactionReceipt",[t.transactionHash]];case"call":return["eth_call",[S(this.constructor,"hexlifyTransaction")(t.transaction,{from:!0}),t.blockTag]];case"estimateGas":return["eth_estimateGas",[S(this.constructor,"hexlifyTransaction")(t.transaction,{from:!0})]];case"getLogs":return t.filter&&null!=t.filter.address&&(t.filter.address=hc(t.filter.address)),["eth_getLogs",[t.filter]]}return null}},{key:"perform",value:function(e,t){return oc(this,void 0,void 0,regeneratorRuntime.mark((function r(){var n,i,o;return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if("call"!==e&&"estimateGas"!==e){r.next=8;break}if(!(n=t.transaction)||null==n.type||!y.from(n.type).isZero()){r.next=8;break}if(null!=n.maxFeePerGas||null!=n.maxPriorityFeePerGas){r.next=8;break}return r.next=6,this.getFeeData();case 6:null==(i=r.sent).maxFeePerGas&&null==i.maxPriorityFeePerGas&&((t=R(t)).transaction=R(n),delete t.transaction.type);case 8:return null==(o=this.prepareRequest(e,t))&&ac.throwError(e+" not implemented",h.b.errors.NOT_IMPLEMENTED,{operation:e}),r.prev=10,r.next=13,this.send(o[0],o[1]);case 13:return r.abrupt("return",r.sent);case 16:return r.prev=16,r.t0=r.catch(10),r.abrupt("return",cc(e,r.t0,t));case 19:case"end":return r.stop()}}),r,this,[[10,16]])})))}},{key:"_startEvent",value:function(e){"pending"===e.tag&&this._startPending(),JA(nc(r.prototype),"_startEvent",this).call(this,e)}},{key:"_startPending",value:function(){if(null==this._pendingFilter){var e=this,t=this.send("eth_newPendingTransactionFilter",[]);this._pendingFilter=t,t.then((function(r){return function n(){e.send("eth_getFilterChanges",[r]).then((function(r){if(e._pendingFilter!=t)return null;var n=Promise.resolve();return r.forEach((function(t){e._emitted["t:"+t.toLowerCase()]="pending",n=n.then((function(){return e.getTransaction(t).then((function(t){return e.emit("pending",t),null}))}))})),n.then((function(){return uc(1e3)}))})).then((function(){if(e._pendingFilter==t)return setTimeout((function(){n()}),0),null;e.send("eth_uninstallFilter",[r])})).catch((function(e){}))}(),r})).catch((function(e){}))}}},{key:"_stopEvent",value:function(e){"pending"===e.tag&&0===this.listenerCount("pending")&&(this._pendingFilter=null),JA(nc(r.prototype),"_stopEvent",this).call(this,e)}}],[{key:"defaultUrl",value:function(){return"http://localhost:8545"}},{key:"hexlifyTransaction",value:function(e,t){var r=R(pc);if(t)for(var n in t)t[n]&&(r[n]=!0);M(e,r);var i={};return["chainId","gasLimit","gasPrice","type","maxFeePerGas","maxPriorityFeePerGas","nonce","value"].forEach((function(t){if(null!=e[t]){var r=Object(c.g)(y.from(e[t]));"gasLimit"===t&&(t="gas"),i[t]=r}})),["from","to","data"].forEach((function(t){null!=e[t]&&(i[t]=Object(c.i)(e[t]))})),e.accessList&&(i.accessList=ei(e.accessList)),i}}]),r}(qA),yc=null;try{if(null==(yc=WebSocket))throw new Error("inject please")}catch(e){var bc=new h.b("providers/5.7.2");yc=function(){bc.throwError("WebSockets not supported in this environment",h.b.errors.UNSUPPORTED_OPERATION,{operation:"new WebSocket()"})}}function Ec(e){return(Ec="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function mc(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function Cc(e,t){return(Cc=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function vc(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=_c(e);if(t){var i=_c(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return Bc(this,r)}}function Bc(e,t){if(t&&("object"===Ec(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return wc(e)}function wc(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Qc(){return(Qc="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,r){var n=kc(e,t);if(n){var i=Object.getOwnPropertyDescriptor(n,t);return i.get?i.get.call(arguments.length<3?e:r):i.value}}).apply(this,arguments)}function kc(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=_c(e)););return e}function _c(e){return(_c=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var Sc=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{A(n.next(e))}catch(e){o(e)}}function s(e){try{A(n.throw(e))}catch(e){o(e)}}function A(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}A((n=n.apply(e,t||[])).next())}))},Dc=new h.b("providers/5.7.2"),Mc=1,Rc=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Cc(e,t)}(o,e);var t,r,n,i=vc(o);function o(e,t){var r,n;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,o),"any"===t&&Dc.throwError("WebSocketProvider does not support 'any' network yet",h.b.errors.UNSUPPORTED_OPERATION,{operation:"network:any"}),(n="string"==typeof e?i.call(this,e,t):i.call(this,"_websocket",t))._pollingInterval=-1,n._wsReady=!1,_(wc(n),"_websocket","string"==typeof e?new yc(n.connection.url):e),_(wc(n),"_requests",{}),_(wc(n),"_subs",{}),_(wc(n),"_subIds",{}),_(wc(n),"_detectNetwork",Qc((r=wc(n),_c(o.prototype)),"detectNetwork",r).call(r)),n.websocket.onopen=function(){n._wsReady=!0,Object.keys(n._requests).forEach((function(e){n.websocket.send(n._requests[e].payload)}))},n.websocket.onmessage=function(e){var t=e.data,r=JSON.parse(t);if(null!=r.id){var i=String(r.id),o=n._requests[i];if(delete n._requests[i],void 0!==r.result)o.callback(null,r.result),n.emit("debug",{action:"response",request:JSON.parse(o.payload),response:r.result,provider:wc(n)});else{var a=null;r.error?(_(a=new Error(r.error.message||"unknown error"),"code",r.error.code||null),_(a,"response",t)):a=new Error("unknown error"),o.callback(a,void 0),n.emit("debug",{action:"response",error:a,request:JSON.parse(o.payload),provider:wc(n)})}}else if("eth_subscription"===r.method){var s=n._subs[r.params.subscription];s&&s.processFunc(r.params.result)}else console.warn("this should not happen")};var a=setInterval((function(){n.emit("poll")}),1e3);return a.unref&&a.unref(),Bc(n)}return t=o,n=[{key:"defaultUrl",value:function(){return"ws://localhost:8546"}}],(r=[{key:"websocket",get:function(){return this._websocket}},{key:"detectNetwork",value:function(){return this._detectNetwork}},{key:"pollingInterval",get:function(){return 0},set:function(e){Dc.throwError("cannot set polling interval on WebSocketProvider",h.b.errors.UNSUPPORTED_OPERATION,{operation:"setPollingInterval"})}},{key:"resetEventsBlock",value:function(e){Dc.throwError("cannot reset events block on WebSocketProvider",h.b.errors.UNSUPPORTED_OPERATION,{operation:"resetEventBlock"})}},{key:"poll",value:function(){return Sc(this,void 0,void 0,regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",null);case 1:case"end":return e.stop()}}),e)})))}},{key:"polling",set:function(e){e&&Dc.throwError("cannot set polling on WebSocketProvider",h.b.errors.UNSUPPORTED_OPERATION,{operation:"setPolling"})}},{key:"send",value:function(e,t){var r=this,n=Mc++;return new Promise((function(i,o){var a=JSON.stringify({method:e,params:t,id:n,jsonrpc:"2.0"});r.emit("debug",{action:"request",request:JSON.parse(a),provider:r}),r._requests[String(n)]={callback:function(e,t){return e?o(e):i(t)},payload:a},r._wsReady&&r.websocket.send(a)}))}},{key:"_subscribe",value:function(e,t,r){return Sc(this,void 0,void 0,regeneratorRuntime.mark((function n(){var i,o,a=this;return regeneratorRuntime.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return null==(i=this._subIds[e])&&(i=Promise.all(t).then((function(e){return a.send("eth_subscribe",e)})),this._subIds[e]=i),n.next=4,i;case 4:o=n.sent,this._subs[o]={tag:e,processFunc:r};case 6:case"end":return n.stop()}}),n,this)})))}},{key:"_startEvent",value:function(e){var t=this;switch(e.type){case"block":this._subscribe("block",["newHeads"],(function(e){var r=y.from(e.number).toNumber();t._emitted.block=r,t.emit("block",r)}));break;case"pending":this._subscribe("pending",["newPendingTransactions"],(function(e){t.emit("pending",e)}));break;case"filter":this._subscribe(e.tag,["logs",this._getFilter(e.filter)],(function(r){null==r.removed&&(r.removed=!1),t.emit(e.filter,t.formatter.filterLog(r))}));break;case"tx":var r=function(e){var r=e.hash;t.getTransactionReceipt(r).then((function(e){e&&t.emit(r,e)}))};r(e),this._subscribe("tx",["newHeads"],(function(e){t._events.filter((function(e){return"tx"===e.type})).forEach(r)}));break;case"debug":case"poll":case"willPoll":case"didPoll":case"error":break;default:console.log("unhandled:",e)}}},{key:"_stopEvent",value:function(e){var t=this,r=e.tag;if("tx"===e.type){if(this._events.filter((function(e){return"tx"===e.type})).length)return;r="tx"}else if(this.listenerCount(e.event))return;var n=this._subIds[r];n&&(delete this._subIds[r],n.then((function(e){t._subs[e]&&(delete t._subs[e],t.send("eth_unsubscribe",[e]))})))}},{key:"destroy",value:function(){return Sc(this,void 0,void 0,regeneratorRuntime.mark((function e(){var t=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.websocket.readyState!==yc.CONNECTING){e.next=3;break}return e.next=3,new Promise((function(e){t.websocket.onopen=function(){e(!0)},t.websocket.onerror=function(){e(!1)}}));case 3:this.websocket.close(1e3);case 4:case"end":return e.stop()}}),e,this)})))}}])&&mc(t.prototype,r),n&&mc(t,n),Object.defineProperty(t,"prototype",{writable:!1}),o}(Ic);function xc(e){return(xc="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Oc(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Nc(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function Pc(e,t,r){return t&&Nc(e.prototype,t),r&&Nc(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function Fc(){return(Fc="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,r){var n=jc(e,t);if(n){var i=Object.getOwnPropertyDescriptor(n,t);return i.get?i.get.call(arguments.length<3?e:r):i.value}}).apply(this,arguments)}function jc(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=Yc(e)););return e}function Tc(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Uc(e,t)}function Uc(e,t){return(Uc=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Lc(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=Yc(e);if(t){var i=Yc(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return Hc(this,r)}}function Hc(e,t){if(t&&("object"===xc(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return Gc(e)}function Gc(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Yc(e){return(Yc=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var Kc=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{A(n.next(e))}catch(e){o(e)}}function s(e){try{A(n.throw(e))}catch(e){o(e)}}function A(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}A((n=n.apply(e,t||[])).next())}))},qc=new h.b("providers/5.7.2"),Jc=function(e){Tc(r,e);var t=Lc(r);function r(){return Oc(this,r),t.apply(this,arguments)}return Pc(r,[{key:"detectNetwork",value:function(){var e=this,t=Object.create(null,{detectNetwork:{get:function(){return Fc(Yc(r.prototype),"detectNetwork",e)}}});return Kc(this,void 0,void 0,regeneratorRuntime.mark((function e(){var r;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!=(r=this.network)){e.next=7;break}return e.next=4,t.detectNetwork.call(this);case 4:(r=e.sent)||qc.throwError("no network detected",h.b.errors.UNKNOWN_ERROR,{}),null==this._network&&(_(this,"_network",r),this.emit("network",r,null));case 7:return e.abrupt("return",r);case 8:case"end":return e.stop()}}),e,this)})))}}]),r}(Ic),zc=function(e){Tc(r,e);var t=Lc(r);function r(e,n){var i;Oc(this,r),qc.checkAbstract(this instanceof r?this.constructor:void 0,r),e=S(this instanceof r?this.constructor:void 0,"getNetwork")(e),n=S(this instanceof r?this.constructor:void 0,"getApiKey")(n);var o=S(this instanceof r?this.constructor:void 0,"getUrl")(e,n);return i=t.call(this,o,e),"string"==typeof n?_(Gc(i),"apiKey",n):null!=n&&Object.keys(n).forEach((function(e){_(Gc(i),e,n[e])})),i}return Pc(r,[{key:"_startPending",value:function(){qc.warn("WARNING: API provider does not support pending filters")}},{key:"isCommunityResource",value:function(){return!1}},{key:"getSigner",value:function(e){return qc.throwError("API provider does not support signing",h.b.errors.UNSUPPORTED_OPERATION,{operation:"getSigner"})}},{key:"listAccounts",value:function(){return Promise.resolve([])}}],[{key:"getApiKey",value:function(e){return e}},{key:"getUrl",value:function(e,t){return qc.throwError("not implemented; sub-classes must override getUrl",h.b.errors.NOT_IMPLEMENTED,{operation:"getUrl"})}}]),r}(Jc);function Vc(e){return(Vc="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Zc(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Wc(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function Xc(e,t,r){return t&&Wc(e.prototype,t),r&&Wc(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function $c(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&eu(e,t)}function eu(e,t){return(eu=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function tu(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=iu(e);if(t){var i=iu(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return ru(this,r)}}function ru(e,t){if(t&&("object"===Vc(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return nu(e)}function nu(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function iu(e){return(iu=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var ou=new h.b("providers/5.7.2"),au="_gg7wSSi0KMBsdKnGVfHDueq6xMB9EkC",su=function(e){$c(r,e);var t=tu(r);function r(e,n){var i;Zc(this,r);var o=new Au(e,n),a=o.connection.url.replace(/^http/i,"ws").replace(".alchemyapi.",".ws.alchemyapi.");return _(nu(i=t.call(this,a,o.network)),"apiKey",o.apiKey),i}return Xc(r,[{key:"isCommunityResource",value:function(){return this.apiKey===au}}]),r}(Rc),Au=function(e){$c(r,e);var t=tu(r);function r(){return Zc(this,r),t.apply(this,arguments)}return Xc(r,[{key:"isCommunityResource",value:function(){return this.apiKey===au}}],[{key:"getWebSocketProvider",value:function(e,t){return new su(e,t)}},{key:"getApiKey",value:function(e){return null==e?au:(e&&"string"!=typeof e&&ou.throwArgumentError("invalid apiKey","apiKey",e),e)}},{key:"getUrl",value:function(e,t){var r=null;switch(e.name){case"homestead":r="eth-mainnet.alchemyapi.io/v2/";break;case"goerli":r="eth-goerli.g.alchemy.com/v2/";break;case"matic":r="polygon-mainnet.g.alchemy.com/v2/";break;case"maticmum":r="polygon-mumbai.g.alchemy.com/v2/";break;case"arbitrum":r="arb-mainnet.g.alchemy.com/v2/";break;case"arbitrum-goerli":r="arb-goerli.g.alchemy.com/v2/";break;case"optimism":r="opt-mainnet.g.alchemy.com/v2/";break;case"optimism-goerli":r="opt-goerli.g.alchemy.com/v2/";break;default:ou.throwArgumentError("unsupported network","network",arguments[0])}return{allowGzip:!0,url:"https://"+r+t,throttleCallback:function(e,r){return t===au&&lA(),Promise.resolve(!0)}}}}]),r}(zc);function cu(e){return(cu="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function uu(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function fu(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function hu(e,t){return(hu=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function lu(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=du(e);if(t){var i=du(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return gu(this,r)}}function gu(e,t){if(t&&("object"===cu(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function du(e){return(du=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var pu=new h.b("providers/5.7.2"),Iu="9f7d929b018cdffb338517efa06f58359e86ff1ffd350bc889738523659e7972";function yu(e){switch(e){case"homestead":return"rpc.ankr.com/eth/";case"ropsten":return"rpc.ankr.com/eth_ropsten/";case"rinkeby":return"rpc.ankr.com/eth_rinkeby/";case"goerli":return"rpc.ankr.com/eth_goerli/";case"matic":return"rpc.ankr.com/polygon/";case"arbitrum":return"rpc.ankr.com/arbitrum/"}return pu.throwArgumentError("unsupported network","name",e)}var bu=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&hu(e,t)}(o,e);var t,r,n,i=lu(o);function o(){return uu(this,o),i.apply(this,arguments)}return t=o,n=[{key:"getApiKey",value:function(e){return null==e?Iu:e}},{key:"getUrl",value:function(e,t){null==t&&(t=Iu);var r={allowGzip:!0,url:"https://"+yu(e.name)+t,throttleCallback:function(e,r){return t.apiKey===Iu&&lA(),Promise.resolve(!0)}};return null!=t.projectSecret&&(r.user="",r.password=t.projectSecret),r}}],(r=[{key:"isCommunityResource",value:function(){return this.apiKey===Iu}}])&&fu(t.prototype,r),n&&fu(t,n),Object.defineProperty(t,"prototype",{writable:!1}),o}(zc);function Eu(e){return(Eu="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function mu(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Cu(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function vu(){return(vu="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,r){var n=Bu(e,t);if(n){var i=Object.getOwnPropertyDescriptor(n,t);return i.get?i.get.call(arguments.length<3?e:r):i.value}}).apply(this,arguments)}function Bu(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=_u(e)););return e}function wu(e,t){return(wu=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Qu(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=_u(e);if(t){var i=_u(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return ku(this,r)}}function ku(e,t){if(t&&("object"===Eu(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function _u(e){return(_u=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var Su=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{A(n.next(e))}catch(e){o(e)}}function s(e){try{A(n.throw(e))}catch(e){o(e)}}function A(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}A((n=n.apply(e,t||[])).next())}))},Du=new h.b("providers/5.7.2"),Mu=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&wu(e,t)}(o,e);var t,r,n,i=Qu(o);function o(){return mu(this,o),i.apply(this,arguments)}return t=o,n=[{key:"getApiKey",value:function(e){return null!=e&&Du.throwArgumentError("apiKey not supported for cloudflare","apiKey",e),null}},{key:"getUrl",value:function(e,t){var r=null;switch(e.name){case"homestead":r="https://cloudflare-eth.com/";break;default:Du.throwArgumentError("unsupported network","network",arguments[0])}return r}}],(r=[{key:"perform",value:function(e,t){var r=this,n=Object.create(null,{perform:{get:function(){return vu(_u(o.prototype),"perform",r)}}});return Su(this,void 0,void 0,regeneratorRuntime.mark((function r(){var i;return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if("getBlockNumber"!==e){r.next=5;break}return r.next=3,n.perform.call(this,"getBlock",{blockTag:"latest"});case 3:return i=r.sent,r.abrupt("return",i.number);case 5:return r.abrupt("return",n.perform.call(this,e,t));case 6:case"end":return r.stop()}}),r,this)})))}}])&&Cu(t.prototype,r),n&&Cu(t,n),Object.defineProperty(t,"prototype",{writable:!1}),o}(zc);function Ru(e){return(Ru="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function xu(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function Ou(){return(Ou="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,r){var n=Nu(e,t);if(n){var i=Object.getOwnPropertyDescriptor(n,t);return i.get?i.get.call(arguments.length<3?e:r):i.value}}).apply(this,arguments)}function Nu(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=Uu(e)););return e}function Pu(e,t){return(Pu=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Fu(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=Uu(e);if(t){var i=Uu(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return ju(this,r)}}function ju(e,t){if(t&&("object"===Ru(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return Tu(e)}function Tu(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Uu(e){return(Uu=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var Lu=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{A(n.next(e))}catch(e){o(e)}}function s(e){try{A(n.throw(e))}catch(e){o(e)}}function A(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}A((n=n.apply(e,t||[])).next())}))},Hu=new h.b("providers/5.7.2");function Gu(e){var t={};for(var r in e)if(null!=e[r]){var n=e[r];"type"===r&&0===n||(n={type:!0,gasLimit:!0,gasPrice:!0,maxFeePerGs:!0,maxPriorityFeePerGas:!0,nonce:!0,value:!0}[r]?Object(c.g)(Object(c.i)(n)):"accessList"===r?"["+ei(n).map((function(e){return'{address:"'.concat(e.address,'",storageKeys:["').concat(e.storageKeys.join('","'),'"]}')})).join(",")+"]":Object(c.i)(n),t[r]=n)}return t}function Yu(e){if(0==e.status&&("No records found"===e.message||"No transactions found"===e.message))return e.result;if(1!=e.status||"string"!=typeof e.message||!e.message.match(/^OK/)){var t=new Error("invalid response");throw t.result=JSON.stringify(e),(e.result||"").toLowerCase().indexOf("rate limit")>=0&&(t.throttleRetry=!0),t}return e.result}function Ku(e){if(e&&0==e.status&&"NOTOK"==e.message&&(e.result||"").toLowerCase().indexOf("rate limit")>=0){var t=new Error("throttled response");throw t.result=JSON.stringify(e),t.throttleRetry=!0,t}if("2.0"!=e.jsonrpc){var r=new Error("invalid response");throw r.result=JSON.stringify(e),r}if(e.error){var n=new Error(e.error.message||"unknown error");throw e.error.code&&(n.code=e.error.code),e.error.data&&(n.data=e.error.data),n}return e.result}function qu(e){if("pending"===e)throw new Error("pending not supported");return"latest"===e?e:parseInt(e.substring(2),16)}function Ju(e,t,r){if("call"===e&&t.code===h.b.errors.SERVER_ERROR){var n=t.error;if(n&&(n.message.match(/reverted/i)||n.message.match(/VM execution error/i))){var i=n.data;if(i&&(i="0x"+i.replace(/^.*0x/i,"")),Object(c.l)(i))return i;Hu.throwError("missing revert data in call exception",h.b.errors.CALL_EXCEPTION,{error:t,data:"0x"})}}var o=t.message;throw t.code===h.b.errors.SERVER_ERROR&&(t.error&&"string"==typeof t.error.message?o=t.error.message:"string"==typeof t.body?o=t.body:"string"==typeof t.responseText&&(o=t.responseText)),(o=(o||"").toLowerCase()).match(/insufficient funds/)&&Hu.throwError("insufficient funds for intrinsic transaction cost",h.b.errors.INSUFFICIENT_FUNDS,{error:t,method:e,transaction:r}),o.match(/same hash was already imported|transaction nonce is too low|nonce too low/)&&Hu.throwError("nonce has already been used",h.b.errors.NONCE_EXPIRED,{error:t,method:e,transaction:r}),o.match(/another transaction with same nonce/)&&Hu.throwError("replacement fee too low",h.b.errors.REPLACEMENT_UNDERPRICED,{error:t,method:e,transaction:r}),o.match(/execution failed due to an exception|execution reverted/)&&Hu.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",h.b.errors.UNPREDICTABLE_GAS_LIMIT,{error:t,method:e,transaction:r}),t}var zu=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Pu(e,t)}(o,e);var t,r,n,i=Fu(o);function o(e,t){var r;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,o),_(Tu(r=i.call(this,e)),"baseUrl",r.getBaseUrl()),_(Tu(r),"apiKey",t||null),r}return t=o,(r=[{key:"getBaseUrl",value:function(){switch(this.network?this.network.name:"invalid"){case"homestead":return"https://api.etherscan.io";case"goerli":return"https://api-goerli.etherscan.io";case"sepolia":return"https://api-sepolia.etherscan.io";case"matic":return"https://api.polygonscan.com";case"maticmum":return"https://api-testnet.polygonscan.com";case"arbitrum":return"https://api.arbiscan.io";case"arbitrum-goerli":return"https://api-goerli.arbiscan.io";case"optimism":return"https://api-optimistic.etherscan.io";case"optimism-goerli":return"https://api-goerli-optimistic.etherscan.io"}return Hu.throwArgumentError("unsupported network","network",this.network.name)}},{key:"getUrl",value:function(e,t){var r=Object.keys(t).reduce((function(e,r){var n=t[r];return null!=n&&(e+="&".concat(r,"=").concat(n)),e}),""),n=this.apiKey?"&apikey=".concat(this.apiKey):"";return"".concat(this.baseUrl,"/api?module=").concat(e).concat(r).concat(n)}},{key:"getPostUrl",value:function(){return"".concat(this.baseUrl,"/api")}},{key:"getPostData",value:function(e,t){return t.module=e,t.apikey=this.apiKey,t}},{key:"fetch",value:function(e,t,r){return Lu(this,void 0,void 0,regeneratorRuntime.mark((function n(){var i,o,a,s,A,c,u=this;return regeneratorRuntime.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return i=r?this.getPostUrl():this.getUrl(e,t),o=r?this.getPostData(e,t):null,a="proxy"===e?Ku:Yu,this.emit("debug",{action:"request",request:i,provider:this}),s={url:i,throttleSlotInterval:1e3,throttleCallback:function(e,t){return u.isCommunityResource()&&lA(),Promise.resolve(!0)}},A=null,o&&(s.headers={"content-type":"application/x-www-form-urlencoded; charset=UTF-8"},A=Object.keys(o).map((function(e){return"".concat(e,"=").concat(o[e])})).join("&")),n.next=9,nA(s,A,a||Ku);case 9:return c=n.sent,this.emit("debug",{action:"response",request:i,response:N(c),provider:this}),n.abrupt("return",c);case 12:case"end":return n.stop()}}),n,this)})))}},{key:"detectNetwork",value:function(){return Lu(this,void 0,void 0,regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.network);case 1:case"end":return e.stop()}}),e,this)})))}},{key:"perform",value:function(e,t){var r=this,n=Object.create(null,{perform:{get:function(){return Ou(Uu(o.prototype),"perform",r)}}});return Lu(this,void 0,void 0,regeneratorRuntime.mark((function r(){var i,o,a,s,A,c,u,f,l;return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:r.t0=e,r.next="getBlockNumber"===r.t0?3:"getGasPrice"===r.t0?4:"getBalance"===r.t0?5:"getTransactionCount"===r.t0?6:"getCode"===r.t0?7:"getStorageAt"===r.t0?8:"sendTransaction"===r.t0?9:"getBlock"===r.t0?10:"getTransaction"===r.t0?13:"getTransactionReceipt"===r.t0?14:"call"===r.t0?15:"estimateGas"===r.t0?29:"getLogs"===r.t0?41:"getEtherPrice"===r.t0?65:72;break;case 3:return r.abrupt("return",this.fetch("proxy",{action:"eth_blockNumber"}));case 4:return r.abrupt("return",this.fetch("proxy",{action:"eth_gasPrice"}));case 5:return r.abrupt("return",this.fetch("account",{action:"balance",address:t.address,tag:t.blockTag}));case 6:return r.abrupt("return",this.fetch("proxy",{action:"eth_getTransactionCount",address:t.address,tag:t.blockTag}));case 7:return r.abrupt("return",this.fetch("proxy",{action:"eth_getCode",address:t.address,tag:t.blockTag}));case 8:return r.abrupt("return",this.fetch("proxy",{action:"eth_getStorageAt",address:t.address,position:t.position,tag:t.blockTag}));case 9:return r.abrupt("return",this.fetch("proxy",{action:"eth_sendRawTransaction",hex:t.signedTransaction},!0).catch((function(e){return Ju("sendTransaction",e,t.signedTransaction)})));case 10:if(!t.blockTag){r.next=12;break}return r.abrupt("return",this.fetch("proxy",{action:"eth_getBlockByNumber",tag:t.blockTag,boolean:t.includeTransactions?"true":"false"}));case 12:throw new Error("getBlock by blockHash not implemented");case 13:return r.abrupt("return",this.fetch("proxy",{action:"eth_getTransactionByHash",txhash:t.transactionHash}));case 14:return r.abrupt("return",this.fetch("proxy",{action:"eth_getTransactionReceipt",txhash:t.transactionHash}));case 15:if("latest"===t.blockTag){r.next=17;break}throw new Error("EtherscanProvider does not support blockTag for call");case 17:return(i=Gu(t.transaction)).module="proxy",i.action="eth_call",r.prev=20,r.next=23,this.fetch("proxy",i,!0);case 23:return r.abrupt("return",r.sent);case 26:return r.prev=26,r.t1=r.catch(20),r.abrupt("return",Ju("call",r.t1,t.transaction));case 29:return(o=Gu(t.transaction)).module="proxy",o.action="eth_estimateGas",r.prev=32,r.next=35,this.fetch("proxy",o,!0);case 35:return r.abrupt("return",r.sent);case 38:return r.prev=38,r.t2=r.catch(32),r.abrupt("return",Ju("estimateGas",r.t2,t.transaction));case 41:return a={action:"getLogs"},t.filter.fromBlock&&(a.fromBlock=qu(t.filter.fromBlock)),t.filter.toBlock&&(a.toBlock=qu(t.filter.toBlock)),t.filter.address&&(a.address=t.filter.address),t.filter.topics&&t.filter.topics.length>0&&(t.filter.topics.length>1&&Hu.throwError("unsupported topic count",h.b.errors.UNSUPPORTED_OPERATION,{topics:t.filter.topics}),1===t.filter.topics.length&&("string"==typeof(s=t.filter.topics[0])&&66===s.length||Hu.throwError("unsupported topic format",h.b.errors.UNSUPPORTED_OPERATION,{topic0:s}),a.topic0=s)),r.next=48,this.fetch("logs",a);case 48:A=r.sent,c={},u=0;case 51:if(!(u<A.length)){r.next=64;break}if(null==(f=A[u]).blockHash){r.next=55;break}return r.abrupt("continue",61);case 55:if(null!=c[f.blockNumber]){r.next=60;break}return r.next=58,this.getBlock(f.blockNumber);case 58:(l=r.sent)&&(c[f.blockNumber]=l.hash);case 60:f.blockHash=c[f.blockNumber];case 61:u++,r.next=51;break;case 64:return r.abrupt("return",A);case 65:if("homestead"===this.network.name){r.next=67;break}return r.abrupt("return",0);case 67:return r.t3=parseFloat,r.next=70,this.fetch("stats",{action:"ethprice"});case 70:return r.t4=r.sent.ethusd,r.abrupt("return",(0,r.t3)(r.t4));case 72:return r.abrupt("break",73);case 73:return r.abrupt("return",n.perform.call(this,e,t));case 74:case"end":return r.stop()}}),r,this,[[20,26],[32,38]])})))}},{key:"getHistory",value:function(e,t,r){return Lu(this,void 0,void 0,regeneratorRuntime.mark((function n(){var i,o,a=this;return regeneratorRuntime.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,this.resolveName(e);case 2:return n.t0=n.sent,n.t1=null==t?0:t,n.t2=null==r?99999999:r,i={action:"txlist",address:n.t0,startblock:n.t1,endblock:n.t2,sort:"asc"},n.next=8,this.fetch("account",i);case 8:return o=n.sent,n.abrupt("return",o.map((function(e){["contractAddress","to"].forEach((function(t){""==e[t]&&delete e[t]})),null==e.creates&&null!=e.contractAddress&&(e.creates=e.contractAddress);var t=a.formatter.transactionResponse(e);return e.timeStamp&&(t.timestamp=parseInt(e.timeStamp)),t})));case 10:case"end":return n.stop()}}),n,this)})))}},{key:"isCommunityResource",value:function(){return null==this.apiKey}}])&&xu(t.prototype,r),n&&xu(t,n),Object.defineProperty(t,"prototype",{writable:!1}),o}(qA);function Vu(e){for(var t=(e=e.slice()).length-1;t>0;t--){var r=Math.floor(Math.random()*(t+1)),n=e[t];e[t]=e[r],e[r]=n}return e}function Zu(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function Wu(e,t){return(Wu=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Xu(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=tf(e);if(t){var i=tf(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return $u(this,r)}}function $u(e,t){if(t&&("object"===rf(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return ef(e)}function ef(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function tf(e){return(tf=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function rf(e){return(rf="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var nf=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{A(n.next(e))}catch(e){o(e)}}function s(e){try{A(n.throw(e))}catch(e){o(e)}}function A(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}A((n=n.apply(e,t||[])).next())}))},of=new h.b("providers/5.7.2");function af(){return(new Date).getTime()}function sf(e){for(var t=null,r=0;r<e.length;r++){var n=e[r];if(null==n)return null;t?t.name===n.name&&t.chainId===n.chainId&&(t.ensAddress===n.ensAddress||null==t.ensAddress&&null==n.ensAddress)||of.throwArgumentError("provider mismatch","networks",e):t=n}return t}function Af(e,t){e=e.slice().sort();var r=Math.floor(e.length/2);if(e.length%2)return e[r];var n=e[r-1],i=e[r];return null!=t&&Math.abs(n-i)>t?null:(n+i)/2}function cf(e){if(null===e)return"null";if("number"==typeof e||"boolean"==typeof e)return JSON.stringify(e);if("string"==typeof e)return e;if(y.isBigNumber(e))return e.toString();if(Array.isArray(e))return JSON.stringify(e.map((function(e){return cf(e)})));if("object"===rf(e)){var t=Object.keys(e);return t.sort(),"{"+t.map((function(t){var r=e[t];return r="function"==typeof r?"[function]":cf(r),JSON.stringify(t)+":"+r})).join(",")+"}"}throw new Error("unknown value type: "+rf(e))}var uf=1;function ff(e){var t=null,r=null,n=new Promise((function(n){t=function(){r&&(clearTimeout(r),r=null),n()},r=setTimeout(t,e)}));return{cancel:t,getPromise:function(){return n},wait:function(e){return n=n.then(e)}}}var hf=[h.b.errors.CALL_EXCEPTION,h.b.errors.INSUFFICIENT_FUNDS,h.b.errors.NONCE_EXPIRED,h.b.errors.REPLACEMENT_UNDERPRICED,h.b.errors.UNPREDICTABLE_GAS_LIMIT],lf=["address","args","errorArgs","errorSignature","method","transaction"];function gf(e,t){var r={weight:e.weight};return Object.defineProperty(r,"provider",{get:function(){return e.provider}}),e.start&&(r.start=e.start),t&&(r.duration=t-e.start),e.done&&(e.error?r.error=e.error:r.result=e.result||null),r}function df(e,t,r){var n=cf;switch(t){case"getBlockNumber":return function(t){var r=t.map((function(e){return e.result})),n=Af(t.map((function(e){return e.result})),2);if(null!=n)return n=Math.ceil(n),r.indexOf(n+1)>=0&&n++,n>=e._highestBlockNumber&&(e._highestBlockNumber=n),e._highestBlockNumber};case"getGasPrice":return function(e){var t=e.map((function(e){return e.result}));return t.sort(),t[Math.floor(t.length/2)]};case"getEtherPrice":return function(e){return Af(e.map((function(e){return e.result})))};case"getBalance":case"getTransactionCount":case"getCode":case"getStorageAt":case"call":case"estimateGas":case"getLogs":break;case"getTransaction":case"getTransactionReceipt":n=function(e){return null==e?null:((e=R(e)).confirmations=-1,cf(e))};break;case"getBlock":n=r.includeTransactions?function(e){return null==e?null:((e=R(e)).transactions=e.transactions.map((function(e){return(e=R(e)).confirmations=-1,e})),cf(e))}:function(e){return null==e?null:cf(e)};break;default:throw new Error("unknown method: "+t)}return function(e,t){return function(r){var n={};r.forEach((function(t){var r=e(t.result);n[r]||(n[r]={count:0,result:t.result}),n[r].count++}));for(var i=Object.keys(n),o=0;o<i.length;o++){var a=n[i[o]];if(a.count>=t)return a.result}}}(n,e.quorum)}function pf(e,t){return nf(this,void 0,void 0,regeneratorRuntime.mark((function r(){var n;return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(!(null!=(n=e.provider).blockNumber&&n.blockNumber>=t||-1===t)){r.next=3;break}return r.abrupt("return",n);case 3:return r.abrupt("return",iA((function(){return new Promise((function(r,i){setTimeout((function(){return n.blockNumber>=t?r(n):e.cancelled?r(null):r(void 0)}),0)}))}),{oncePoll:n}));case 4:case"end":return r.stop()}}),r)})))}function If(e,t,r,n){return nf(this,void 0,void 0,regeneratorRuntime.mark((function i(){var o,a;return regeneratorRuntime.wrap((function(i){for(;;)switch(i.prev=i.next){case 0:o=e.provider,i.t0=r,i.next="getBlockNumber"===i.t0||"getGasPrice"===i.t0?4:"getEtherPrice"===i.t0?5:"getBalance"===i.t0||"getTransactionCount"===i.t0||"getCode"===i.t0?8:"getStorageAt"===i.t0?13:"getBlock"===i.t0?18:"call"===i.t0||"estimateGas"===i.t0?23:"getTransaction"===i.t0||"getTransactionReceipt"===i.t0?30:"getLogs"===i.t0?31:37;break;case 4:return i.abrupt("return",o[r]());case 5:if(!o.getEtherPrice){i.next=7;break}return i.abrupt("return",o.getEtherPrice());case 7:return i.abrupt("break",37);case 8:if(!n.blockTag||!Object(c.l)(n.blockTag)){i.next=12;break}return i.next=11,pf(e,t);case 11:o=i.sent;case 12:return i.abrupt("return",o[r](n.address,n.blockTag||"latest"));case 13:if(!n.blockTag||!Object(c.l)(n.blockTag)){i.next=17;break}return i.next=16,pf(e,t);case 16:o=i.sent;case 17:return i.abrupt("return",o.getStorageAt(n.address,n.position,n.blockTag||"latest"));case 18:if(!n.blockTag||!Object(c.l)(n.blockTag)){i.next=22;break}return i.next=21,pf(e,t);case 21:o=i.sent;case 22:return i.abrupt("return",o[n.includeTransactions?"getBlockWithTransactions":"getBlock"](n.blockTag||n.blockHash));case 23:if(!n.blockTag||!Object(c.l)(n.blockTag)){i.next=27;break}return i.next=26,pf(e,t);case 26:o=i.sent;case 27:if("call"!==r||!n.blockTag){i.next=29;break}return i.abrupt("return",o[r](n.transaction,n.blockTag));case 29:return i.abrupt("return",o[r](n.transaction));case 30:return i.abrupt("return",o[r](n.transactionHash));case 31:if(!((a=n.filter).fromBlock&&Object(c.l)(a.fromBlock)||a.toBlock&&Object(c.l)(a.toBlock))){i.next=36;break}return i.next=35,pf(e,t);case 35:o=i.sent;case 36:return i.abrupt("return",o.getLogs(a));case 37:return i.abrupt("return",of.throwError("unknown method error",h.b.errors.UNKNOWN_ERROR,{method:r,params:n}));case 38:case"end":return i.stop()}}),i)})))}var yf=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Wu(e,t)}(o,e);var t,r,n,i=Xu(o);function o(e,t){var r;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,o),0===e.length&&of.throwArgumentError("missing providers","providers",e);var n=e.map((function(e,t){if(En.isProvider(e)){var r=fA(e)?2e3:750;return Object.freeze({provider:e,weight:1,stallTimeout:r,priority:1})}var n=R(e);null==n.priority&&(n.priority=1),null==n.stallTimeout&&(n.stallTimeout=fA(e)?2e3:750),null==n.weight&&(n.weight=1);var i=n.weight;return(i%1||i>512||i<1)&&of.throwArgumentError("invalid weight; must be integer in [1, 512]","providers[".concat(t,"].weight"),i),Object.freeze(n)})),a=n.reduce((function(e,t){return e+t.weight}),0);null==t?t=a/2:t>a&&of.throwArgumentError("quorum will always fail; larger than total weight","quorum",t);var s=sf(n.map((function(e){return e.provider.network})));return null==s&&(s=new Promise((function(e,t){setTimeout((function(){r.detectNetwork().then(e,t)}),0)}))),_(ef(r=i.call(this,s)),"providerConfigs",Object.freeze(n)),_(ef(r),"quorum",t),r._highestBlockNumber=-1,r}return t=o,(r=[{key:"detectNetwork",value:function(){return nf(this,void 0,void 0,regeneratorRuntime.mark((function e(){var t;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Promise.all(this.providerConfigs.map((function(e){return e.provider.getNetwork()})));case 2:return t=e.sent,e.abrupt("return",sf(t));case 4:case"end":return e.stop()}}),e,this)})))}},{key:"perform",value:function(e,t){return nf(this,void 0,void 0,regeneratorRuntime.mark((function r(){var n,i,o,a,s,A,c,u,f,l,g=this;return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if("sendTransaction"!==e){r.next=13;break}return r.next=3,Promise.all(this.providerConfigs.map((function(e){return e.provider.sendTransaction(t.signedTransaction).then((function(e){return e.hash}),(function(e){return e}))})));case 3:n=r.sent,i=0;case 5:if(!(i<n.length)){r.next=12;break}if("string"!=typeof(o=n[i])){r.next=9;break}return r.abrupt("return",o);case 9:i++,r.next=5;break;case 12:throw n[0];case 13:if(-1!==this._highestBlockNumber||"getBlockNumber"===e){r.next=16;break}return r.next=16,this.getBlockNumber();case 16:a=df(this,e,t),(s=Vu(this.providerConfigs.map(R))).sort((function(e,t){return e.priority-t.priority})),A=this._highestBlockNumber,c=0,u=!0,f=regeneratorRuntime.mark((function r(){var n,i,o,f,h,l,d;return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:for(n=af(),i=s.filter((function(e){return e.runner&&n-e.start<e.stallTimeout})).reduce((function(e,t){return e+t.weight}),0),o=function(){var r=s[c++],n=uf++;r.start=af(),r.staller=ff(r.stallTimeout),r.staller.wait((function(){r.staller=null})),r.runner=If(r,A,e,t).then((function(i){r.done=!0,r.result=i,g.listenerCount("debug")&&g.emit("debug",{action:"request",rid:n,backend:gf(r,af()),request:{method:e,params:N(t)},provider:g})}),(function(i){r.done=!0,r.error=i,g.listenerCount("debug")&&g.emit("debug",{action:"request",rid:n,backend:gf(r,af()),request:{method:e,params:N(t)},provider:g})})),g.listenerCount("debug")&&g.emit("debug",{action:"request",rid:n,backend:gf(r,null),request:{method:e,params:N(t)},provider:g}),i+=r.weight};i<g.quorum&&c<s.length;)o();if(f=[],s.forEach((function(e){!e.done&&e.runner&&(f.push(e.runner),e.staller&&f.push(e.staller.getPromise()))})),!f.length){r.next=9;break}return r.next=9,Promise.race(f);case 9:if(!((h=s.filter((function(e){return e.done&&null==e.error}))).length>=g.quorum)){r.next=19;break}if(void 0===(l=a(h))){r.next=15;break}return s.forEach((function(e){e.staller&&e.staller.cancel(),e.cancelled=!0})),r.abrupt("return",{v:l});case 15:if(u){r.next=18;break}return r.next=18,ff(100).getPromise();case 18:u=!1;case 19:if(d=s.reduce((function(e,t){if(!t.done||null==t.error)return e;var r=t.error.code;return hf.indexOf(r)>=0&&(e[r]||(e[r]={error:t.error,weight:0}),e[r].weight+=t.weight),e}),{}),Object.keys(d).forEach((function(e){var t=d[e];if(!(t.weight<g.quorum)){s.forEach((function(e){e.staller&&e.staller.cancel(),e.cancelled=!0}));var r=t.error,n={};lf.forEach((function(e){null!=r[e]&&(n[e]=r[e])})),of.throwError(r.reason||r.message,e,n)}})),0!==s.filter((function(e){return!e.done})).length){r.next=23;break}return r.abrupt("return","break");case 23:case"end":return r.stop()}}),r)}));case 23:return r.delegateYield(f(),"t0",25);case 25:if("break"!==(l=r.t0)){r.next=28;break}return r.abrupt("break",32);case 28:if("object"!==rf(l)){r.next=30;break}return r.abrupt("return",l.v);case 30:r.next=23;break;case 32:return s.forEach((function(e){e.staller&&e.staller.cancel(),e.cancelled=!0})),r.abrupt("return",of.throwError("failed to meet quorum",h.b.errors.SERVER_ERROR,{method:e,params:t,results:s.map((function(e){return gf(e)})),provider:this}));case 34:case"end":return r.stop()}}),r,this)})))}}])&&Zu(t.prototype,r),n&&Zu(t,n),Object.defineProperty(t,"prototype",{writable:!1}),o}(qA),bf=null;function Ef(e){return(Ef="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function mf(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Cf(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function vf(e,t,r){return t&&Cf(e.prototype,t),r&&Cf(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function Bf(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&wf(e,t)}function wf(e,t){return(wf=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Qf(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=Sf(e);if(t){var i=Sf(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return kf(this,r)}}function kf(e,t){if(t&&("object"===Ef(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return _f(e)}function _f(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Sf(e){return(Sf=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var Df=new h.b("providers/5.7.2"),Mf="84842078b09946638c03157f83405213",Rf=function(e){Bf(r,e);var t=Qf(r);function r(e,n){var i;mf(this,r);var o=new xf(e,n),a=o.connection;a.password&&Df.throwError("INFURA WebSocket project secrets unsupported",h.b.errors.UNSUPPORTED_OPERATION,{operation:"InfuraProvider.getWebSocketProvider()"});var s=a.url.replace(/^http/i,"ws").replace("/v3/","/ws/v3/");return _(_f(i=t.call(this,s,e)),"apiKey",o.projectId),_(_f(i),"projectId",o.projectId),_(_f(i),"projectSecret",o.projectSecret),i}return vf(r,[{key:"isCommunityResource",value:function(){return this.projectId===Mf}}]),r}(Rc),xf=function(e){Bf(r,e);var t=Qf(r);function r(){return mf(this,r),t.apply(this,arguments)}return vf(r,[{key:"isCommunityResource",value:function(){return this.projectId===Mf}}],[{key:"getWebSocketProvider",value:function(e,t){return new Rf(e,t)}},{key:"getApiKey",value:function(e){var t={apiKey:Mf,projectId:Mf,projectSecret:null};return null==e||("string"==typeof e?t.projectId=e:null!=e.projectSecret?(Df.assertArgument("string"==typeof e.projectId,"projectSecret requires a projectId","projectId",e.projectId),Df.assertArgument("string"==typeof e.projectSecret,"invalid projectSecret","projectSecret","[REDACTED]"),t.projectId=e.projectId,t.projectSecret=e.projectSecret):e.projectId&&(t.projectId=e.projectId),t.apiKey=t.projectId),t}},{key:"getUrl",value:function(e,t){var r=null;switch(e?e.name:"unknown"){case"homestead":r="mainnet.infura.io";break;case"goerli":r="goerli.infura.io";break;case"sepolia":r="sepolia.infura.io";break;case"matic":r="polygon-mainnet.infura.io";break;case"maticmum":r="polygon-mumbai.infura.io";break;case"optimism":r="optimism-mainnet.infura.io";break;case"optimism-goerli":r="optimism-goerli.infura.io";break;case"arbitrum":r="arbitrum-mainnet.infura.io";break;case"arbitrum-goerli":r="arbitrum-goerli.infura.io";break;default:Df.throwError("unsupported network",h.b.errors.INVALID_ARGUMENT,{argument:"network",value:e})}var n={allowGzip:!0,url:"https://"+r+"/v3/"+t.projectId,throttleCallback:function(e,r){return t.projectId===Mf&&lA(),Promise.resolve(!0)}};return null!=t.projectSecret&&(n.user="",n.password=t.projectSecret),n}}]),r}(zc);function Of(e){return(Of="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Nf(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Pf(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function Ff(e,t){return(Ff=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function jf(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=Uf(e);if(t){var i=Uf(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return Tf(this,r)}}function Tf(e,t){if(t&&("object"===Of(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function Uf(e){return(Uf=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var Lf=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Ff(e,t)}(o,e);var t,r,n,i=jf(o);function o(){return Nf(this,o),i.apply(this,arguments)}return t=o,(r=[{key:"send",value:function(e,t){var r=this,n={method:e,params:t,id:this._nextId++,jsonrpc:"2.0"};null==this._pendingBatch&&(this._pendingBatch=[]);var i={request:n,resolve:null,reject:null},o=new Promise((function(e,t){i.resolve=e,i.reject=t}));return this._pendingBatch.push(i),this._pendingBatchAggregator||(this._pendingBatchAggregator=setTimeout((function(){var e=r._pendingBatch;r._pendingBatch=null,r._pendingBatchAggregator=null;var t=e.map((function(e){return e.request}));return r.emit("debug",{action:"requestBatch",request:N(t),provider:r}),nA(r.connection,JSON.stringify(t)).then((function(n){r.emit("debug",{action:"response",request:t,response:n,provider:r}),e.forEach((function(e,t){var r=n[t];if(r.error){var i=new Error(r.error.message);i.code=r.error.code,i.data=r.error.data,e.reject(i)}else e.resolve(r.result)}))}),(function(n){r.emit("debug",{action:"response",error:n,request:t,provider:r}),e.forEach((function(e){e.reject(n)}))}))}),10)),o}}])&&Pf(t.prototype,r),n&&Pf(t,n),Object.defineProperty(t,"prototype",{writable:!1}),o}(Ic);function Hf(e){return(Hf="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Gf(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Yf(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function Kf(e,t){return(Kf=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function qf(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=zf(e);if(t){var i=zf(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return Jf(this,r)}}function Jf(e,t){if(t&&("object"===Hf(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function zf(e){return(zf=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var Vf=new h.b("providers/5.7.2"),Zf=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Kf(e,t)}(o,e);var t,r,n,i=qf(o);function o(){return Gf(this,o),i.apply(this,arguments)}return t=o,n=[{key:"getApiKey",value:function(e){return e&&"string"!=typeof e&&Vf.throwArgumentError("invalid apiKey","apiKey",e),e||"ETHERS_JS_SHARED"}},{key:"getUrl",value:function(e,t){Vf.warn("NodeSmith will be discontinued on 2019-12-20; please migrate to another platform.");var r=null;switch(e.name){case"homestead":r="https://ethereum.api.nodesmith.io/v1/mainnet/jsonrpc";break;case"ropsten":r="https://ethereum.api.nodesmith.io/v1/ropsten/jsonrpc";break;case"rinkeby":r="https://ethereum.api.nodesmith.io/v1/rinkeby/jsonrpc";break;case"goerli":r="https://ethereum.api.nodesmith.io/v1/goerli/jsonrpc";break;case"kovan":r="https://ethereum.api.nodesmith.io/v1/kovan/jsonrpc";break;default:Vf.throwArgumentError("unsupported network","network",arguments[0])}return r+"?apiKey="+t}}],(r=null)&&Yf(t.prototype,r),n&&Yf(t,n),Object.defineProperty(t,"prototype",{writable:!1}),o}(zc);function Wf(e){return(Wf="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Xf(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function $f(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function eh(e,t){return(eh=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function th(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=nh(e);if(t){var i=nh(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return rh(this,r)}}function rh(e,t){if(t&&("object"===Wf(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function nh(e){return(nh=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var ih=new h.b("providers/5.7.2"),oh=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&eh(e,t)}(o,e);var t,r,n,i=th(o);function o(){return Xf(this,o),i.apply(this,arguments)}return t=o,n=[{key:"getApiKey",value:function(e){var t={applicationId:null,loadBalancer:!0,applicationSecretKey:null};return null==e?t.applicationId="62e1ad51b37b8e00394bda3b":"string"==typeof e?t.applicationId=e:null!=e.applicationSecretKey?(t.applicationId=e.applicationId,t.applicationSecretKey=e.applicationSecretKey):e.applicationId?t.applicationId=e.applicationId:ih.throwArgumentError("unsupported PocketProvider apiKey","apiKey",e),t}},{key:"getUrl",value:function(e,t){var r=null;switch(e?e.name:"unknown"){case"goerli":r="eth-goerli.gateway.pokt.network";break;case"homestead":r="eth-mainnet.gateway.pokt.network";break;case"kovan":r="poa-kovan.gateway.pokt.network";break;case"matic":r="poly-mainnet.gateway.pokt.network";break;case"maticmum":r="polygon-mumbai-rpc.gateway.pokt.network";break;case"rinkeby":r="eth-rinkeby.gateway.pokt.network";break;case"ropsten":r="eth-ropsten.gateway.pokt.network";break;default:ih.throwError("unsupported network",h.b.errors.INVALID_ARGUMENT,{argument:"network",value:e})}var n={headers:{},url:"https://".concat(r,"/v1/lb/").concat(t.applicationId)};return null!=t.applicationSecretKey&&(n.user="",n.password=t.applicationSecretKey),n}}],(r=[{key:"isCommunityResource",value:function(){return"62e1ad51b37b8e00394bda3b"===this.applicationId}}])&&$f(t.prototype,r),n&&$f(t,n),Object.defineProperty(t,"prototype",{writable:!1}),o}(zc);function ah(e){return(ah="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function sh(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function Ah(e,t){return(Ah=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function ch(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=hh(e);if(t){var i=hh(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return uh(this,r)}}function uh(e,t){if(t&&("object"===ah(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return fh(e)}function fh(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function hh(e){return(hh=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var lh=new h.b("providers/5.7.2"),gh=1;function dh(e,t){var r="Web3LegacyFetcher";return function(e,n){var i=this,o={method:e,params:n,id:gh++,jsonrpc:"2.0"};return new Promise((function(e,n){i.emit("debug",{action:"request",fetcher:r,request:N(o),provider:i}),t(o,(function(t,a){if(t)return i.emit("debug",{action:"response",fetcher:r,error:t,request:o,provider:i}),n(t);if(i.emit("debug",{action:"response",fetcher:r,request:o,response:a,provider:i}),a.error){var s=new Error(a.error.message);return s.code=a.error.code,s.data=a.error.data,n(s)}e(a.result)}))}))}}var ph=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Ah(e,t)}(o,e);var t,r,n,i=ch(o);function o(e,t){var r;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,o),null==e&&lh.throwArgumentError("missing provider","provider",e);var n=null,a=null,s=null;return"function"==typeof e?(n="unknown:",a=e):(!(n=e.host||e.path||"")&&e.isMetaMask&&(n="metamask"),s=e,e.request?(""===n&&(n="eip-1193:"),a=function(e){return function(t,r){var n=this;null==r&&(r=[]);var i={method:t,params:r};return this.emit("debug",{action:"request",fetcher:"Eip1193Fetcher",request:N(i),provider:this}),e.request(i).then((function(e){return n.emit("debug",{action:"response",fetcher:"Eip1193Fetcher",request:i,response:e,provider:n}),e}),(function(e){throw n.emit("debug",{action:"response",fetcher:"Eip1193Fetcher",request:i,error:e,provider:n}),e}))}}(e)):e.sendAsync?a=dh(0,e.sendAsync.bind(e)):e.send?a=dh(0,e.send.bind(e)):lh.throwArgumentError("unsupported provider","provider",e),n||(n="unknown:")),_(fh(r=i.call(this,n,t)),"jsonRpcFetchFunc",a),_(fh(r),"provider",s),r}return t=o,(r=[{key:"send",value:function(e,t){return this.jsonRpcFetchFunc(e,t)}}])&&sh(t.prototype,r),n&&sh(t,n),Object.defineProperty(t,"prototype",{writable:!1}),o}(Ic),Ih=new h.b("providers/5.7.2");function yh(e,t){if(null==e&&(e="homestead"),"string"==typeof e){var r=e.match(/^(ws|http)s?:/i);if(r)switch(r[1].toLowerCase()){case"http":case"https":return new Ic(e);case"ws":case"wss":return new Rc(e);default:Ih.throwArgumentError("unsupported URL scheme","network",e)}}var n=ds(e);return n&&n._defaultProvider||Ih.throwError("unsupported getDefaultProvider network",h.b.errors.NETWORK_ERROR,{operation:"getDefaultProvider",network:e}),n._defaultProvider({FallbackProvider:yf,AlchemyProvider:Au,AnkrProvider:bu,CloudflareProvider:Mu,EtherscanProvider:zu,InfuraProvider:xf,JsonRpcProvider:Ic,NodesmithProvider:Zf,PocketProvider:oh,Web3Provider:ph,IpcProvider:bf},t)}function bh(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Eh(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function mh(e,t,r){return t&&Eh(e.prototype,t),r&&Eh(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}var Ch=new h.b("abi/5.7.0");function vh(e){var t=[];return function e(r,n){if(Array.isArray(n))for(var i in n){var o=r.slice();o.push(i);try{e(o,n[i])}catch(e){t.push({path:o,error:e})}}}([],e),t}var Bh=function(){function e(t,r,n,i){bh(this,e),this.name=t,this.type=r,this.localName=n,this.dynamic=i}return mh(e,[{key:"_throwError",value:function(e,t){Ch.throwArgumentError(e,this.localName,t)}}]),e}(),wh=function(){function e(t){bh(this,e),_(this,"wordSize",t||32),this._data=[],this._dataLength=0,this._padding=new Uint8Array(t)}return mh(e,[{key:"data",get:function(){return Object(c.c)(this._data)}},{key:"length",get:function(){return this._dataLength}},{key:"_writeData",value:function(e){return this._data.push(e),this._dataLength+=e.length,e.length}},{key:"appendWriter",value:function(e){return this._writeData(Object(c.b)(e._data))}},{key:"writeBytes",value:function(e){var t=Object(c.a)(e),r=t.length%this.wordSize;return r&&(t=Object(c.b)([t,this._padding.slice(r)])),this._writeData(t)}},{key:"_getValue",value:function(e){var t=Object(c.a)(y.from(e));return t.length>this.wordSize&&Ch.throwError("value out-of-bounds",h.b.errors.BUFFER_OVERRUN,{length:this.wordSize,offset:t.length}),t.length%this.wordSize&&(t=Object(c.b)([this._padding.slice(t.length%this.wordSize),t])),t}},{key:"writeValue",value:function(e){return this._writeData(this._getValue(e))}},{key:"writeUpdatableValue",value:function(){var e=this,t=this._data.length;return this._data.push(this._padding),this._dataLength+=this.wordSize,function(r){e._data[t]=e._getValue(r)}}}]),e}(),Qh=function(){function e(t,r,n,i){bh(this,e),_(this,"_data",Object(c.a)(t)),_(this,"wordSize",r||32),_(this,"_coerceFunc",n),_(this,"allowLoose",i),this._offset=0}return mh(e,[{key:"data",get:function(){return Object(c.i)(this._data)}},{key:"consumed",get:function(){return this._offset}},{key:"coerce",value:function(t,r){return this._coerceFunc?this._coerceFunc(t,r):e.coerce(t,r)}},{key:"_peekBytes",value:function(e,t,r){var n=Math.ceil(t/this.wordSize)*this.wordSize;return this._offset+n>this._data.length&&(this.allowLoose&&r&&this._offset+t<=this._data.length?n=t:Ch.throwError("data out-of-bounds",h.b.errors.BUFFER_OVERRUN,{length:this._data.length,offset:this._offset+n})),this._data.slice(this._offset,this._offset+n)}},{key:"subReader",value:function(t){return new e(this._data.slice(this._offset+t),this.wordSize,this._coerceFunc,this.allowLoose)}},{key:"readBytes",value:function(e,t){var r=this._peekBytes(0,e,!!t);return this._offset+=r.length,r.slice(0,e)}},{key:"readValue",value:function(){return y.from(this.readBytes(this.wordSize))}}],[{key:"coerce",value:function(e,t){var r=e.match("^u?int([0-9]+)$");return r&&parseInt(r[1])<=48&&(t=t.toNumber()),t}}]),e}();function kh(e){return(kh="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function _h(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function Sh(e,t){return(Sh=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Dh(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=Rh(e);if(t){var i=Rh(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return Mh(this,r)}}function Mh(e,t){if(t&&("object"===kh(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function Rh(e){return(Rh=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var xh=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Sh(e,t)}(o,e);var t,r,n,i=Dh(o);function o(e){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,o),i.call(this,"address","address",e,!1)}return t=o,(r=[{key:"defaultValue",value:function(){return"0x0000000000000000000000000000000000000000"}},{key:"encode",value:function(e,t){try{t=Ae(t)}catch(e){this._throwError(e.message,t)}return e.writeValue(t)}},{key:"decode",value:function(e){return Ae(Object(c.h)(e.readValue().toHexString(),20))}}])&&_h(t.prototype,r),n&&_h(t,n),Object.defineProperty(t,"prototype",{writable:!1}),o}(Bh);function Oh(e){return(Oh="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Nh(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function Ph(e,t){return(Ph=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Fh(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=Th(e);if(t){var i=Th(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return jh(this,r)}}function jh(e,t){if(t&&("object"===Oh(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function Th(e){return(Th=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var Uh=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Ph(e,t)}(o,e);var t,r,n,i=Fh(o);function o(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,o),(t=i.call(this,e.name,e.type,void 0,e.dynamic)).coder=e,t}return t=o,(r=[{key:"defaultValue",value:function(){return this.coder.defaultValue()}},{key:"encode",value:function(e,t){return this.coder.encode(e,t)}},{key:"decode",value:function(e){return this.coder.decode(e)}}])&&Nh(t.prototype,r),n&&Nh(t,n),Object.defineProperty(t,"prototype",{writable:!1}),o}(Bh);function Lh(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function Hh(e,t){return(Hh=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Gh(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=Kh(e);if(t){var i=Kh(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return Yh(this,r)}}function Yh(e,t){if(t&&("object"===qh(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function Kh(e){return(Kh=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function qh(e){return(qh="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var Jh=new h.b("abi/5.7.0");function zh(e,t,r){var n=null;if(Array.isArray(r))n=r;else if(r&&"object"===qh(r)){var i={};n=t.map((function(e){var t=e.localName;return t||Jh.throwError("cannot encode object for signature with missing names",h.b.errors.INVALID_ARGUMENT,{argument:"values",coder:e,value:r}),i[t]&&Jh.throwError("cannot encode object for signature with duplicate names",h.b.errors.INVALID_ARGUMENT,{argument:"values",coder:e,value:r}),i[t]=!0,r[t]}))}else Jh.throwArgumentError("invalid tuple value","tuple",r);t.length!==n.length&&Jh.throwArgumentError("types/value length mismatch","tuple",r);var o=new wh(e.wordSize),a=new wh(e.wordSize),s=[];t.forEach((function(e,t){var r=n[t];if(e.dynamic){var i=a.length;e.encode(a,r);var A=o.writeUpdatableValue();s.push((function(e){A(e+i)}))}else e.encode(o,r)})),s.forEach((function(e){e(o.length)}));var A=e.appendWriter(o);return A+=e.appendWriter(a)}function Vh(e,t){var r=[],n=e.subReader(0);t.forEach((function(t){var i=null;if(t.dynamic){var o=e.readValue(),a=n.subReader(o.toNumber());try{i=t.decode(a)}catch(e){if(e.code===h.b.errors.BUFFER_OVERRUN)throw e;(i=e).baseType=t.name,i.name=t.localName,i.type=t.type}}else try{i=t.decode(e)}catch(e){if(e.code===h.b.errors.BUFFER_OVERRUN)throw e;(i=e).baseType=t.name,i.name=t.localName,i.type=t.type}null!=i&&r.push(i)}));var i=t.reduce((function(e,t){var r=t.localName;return r&&(e[r]||(e[r]=0),e[r]++),e}),{});t.forEach((function(e,t){var n=e.localName;if(n&&1===i[n]&&("length"===n&&(n="_length"),null==r[n])){var o=r[t];o instanceof Error?Object.defineProperty(r,n,{enumerable:!0,get:function(){throw o}}):r[n]=o}}));for(var o=function(e){var t=r[e];t instanceof Error&&Object.defineProperty(r,e,{enumerable:!0,get:function(){throw t}})},a=0;a<r.length;a++)o(a);return Object.freeze(r)}var Zh=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Hh(e,t)}(o,e);var t,r,n,i=Gh(o);function o(e,t,r){var n;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,o);var a=e.type+"["+(t>=0?t:"")+"]",s=-1===t||e.dynamic;return(n=i.call(this,"array",a,r,s)).coder=e,n.length=t,n}return t=o,(r=[{key:"defaultValue",value:function(){for(var e=this.coder.defaultValue(),t=[],r=0;r<this.length;r++)t.push(e);return t}},{key:"encode",value:function(e,t){Array.isArray(t)||this._throwError("expected array value",t);var r=this.length;-1===r&&(r=t.length,e.writeValue(t.length)),Jh.checkArgumentCount(t.length,r,"coder array"+(this.localName?" "+this.localName:""));for(var n=[],i=0;i<t.length;i++)n.push(this.coder);return zh(e,n,t)}},{key:"decode",value:function(e){var t=this.length;-1===t&&32*(t=e.readValue().toNumber())>e._data.length&&Jh.throwError("insufficient data length",h.b.errors.BUFFER_OVERRUN,{length:e._data.length,count:t});for(var r=[],n=0;n<t;n++)r.push(new Uh(this.coder));return e.coerce(this.name,Vh(e,r))}}])&&Lh(t.prototype,r),n&&Lh(t,n),Object.defineProperty(t,"prototype",{writable:!1}),o}(Bh);function Wh(e){return(Wh="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Xh(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function $h(e,t){return($h=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function el(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=rl(e);if(t){var i=rl(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return tl(this,r)}}function tl(e,t){if(t&&("object"===Wh(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function rl(e){return(rl=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var nl=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&$h(e,t)}(o,e);var t,r,n,i=el(o);function o(e){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,o),i.call(this,"bool","bool",e,!1)}return t=o,(r=[{key:"defaultValue",value:function(){return!1}},{key:"encode",value:function(e,t){return e.writeValue(t?1:0)}},{key:"decode",value:function(e){return e.coerce(this.type,!e.readValue().isZero())}}])&&Xh(t.prototype,r),n&&Xh(t,n),Object.defineProperty(t,"prototype",{writable:!1}),o}(Bh);function il(e){return(il="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function ol(){return(ol="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,r){var n=al(e,t);if(n){var i=Object.getOwnPropertyDescriptor(n,t);return i.get?i.get.call(arguments.length<3?e:r):i.value}}).apply(this,arguments)}function al(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=gl(e)););return e}function sl(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Al(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function cl(e,t,r){return t&&Al(e.prototype,t),r&&Al(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function ul(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&fl(e,t)}function fl(e,t){return(fl=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function hl(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=gl(e);if(t){var i=gl(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return ll(this,r)}}function ll(e,t){if(t&&("object"===il(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function gl(e){return(gl=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var dl=function(e){ul(r,e);var t=hl(r);function r(e,n){return sl(this,r),t.call(this,e,e,n,!0)}return cl(r,[{key:"defaultValue",value:function(){return"0x"}},{key:"encode",value:function(e,t){t=Object(c.a)(t);var r=e.writeValue(t.length);return r+=e.writeBytes(t)}},{key:"decode",value:function(e){return e.readBytes(e.readValue().toNumber(),!0)}}]),r}(Bh),pl=function(e){ul(r,e);var t=hl(r);function r(e){return sl(this,r),t.call(this,"bytes",e)}return cl(r,[{key:"decode",value:function(e){return e.coerce(this.name,Object(c.i)(ol(gl(r.prototype),"decode",this).call(this,e)))}}]),r}(dl);function Il(e){return(Il="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function yl(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function bl(e,t){return(bl=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function El(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=Cl(e);if(t){var i=Cl(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return ml(this,r)}}function ml(e,t){if(t&&("object"===Il(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function Cl(e){return(Cl=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var vl=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&bl(e,t)}(o,e);var t,r,n,i=El(o);function o(e,t){var r;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,o);var n="bytes"+String(e);return(r=i.call(this,n,n,t,!1)).size=e,r}return t=o,(r=[{key:"defaultValue",value:function(){return"0x0000000000000000000000000000000000000000000000000000000000000000".substring(0,2+2*this.size)}},{key:"encode",value:function(e,t){var r=Object(c.a)(t);return r.length!==this.size&&this._throwError("incorrect data length",t),e.writeBytes(r)}},{key:"decode",value:function(e){return e.coerce(this.name,Object(c.i)(e.readBytes(this.size)))}}])&&yl(t.prototype,r),n&&yl(t,n),Object.defineProperty(t,"prototype",{writable:!1}),o}(Bh);function Bl(e){return(Bl="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function wl(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function Ql(e,t){return(Ql=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function kl(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=Sl(e);if(t){var i=Sl(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return _l(this,r)}}function _l(e,t){if(t&&("object"===Bl(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function Sl(e){return(Sl=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var Dl=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Ql(e,t)}(o,e);var t,r,n,i=kl(o);function o(e){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,o),i.call(this,"null","",e,!1)}return t=o,(r=[{key:"defaultValue",value:function(){return null}},{key:"encode",value:function(e,t){return null!=t&&this._throwError("not null",t),e.writeBytes([])}},{key:"decode",value:function(e){return e.readBytes(0),e.coerce(this.name,null)}}])&&wl(t.prototype,r),n&&wl(t,n),Object.defineProperty(t,"prototype",{writable:!1}),o}(Bh);function Ml(e){return(Ml="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Rl(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function xl(e,t){return(xl=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Ol(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=Pl(e);if(t){var i=Pl(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return Nl(this,r)}}function Nl(e,t){if(t&&("object"===Ml(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function Pl(e){return(Pl=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var Fl=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&xl(e,t)}(o,e);var t,r,n,i=Ol(o);function o(e,t,r){var n;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,o);var a=(t?"int":"uint")+8*e;return(n=i.call(this,a,a,r,!1)).size=e,n.signed=t,n}return t=o,(r=[{key:"defaultValue",value:function(){return 0}},{key:"encode",value:function(e,t){var r=y.from(t),n=Nt.mask(8*e.wordSize);if(this.signed){var i=n.mask(8*this.size-1);(r.gt(i)||r.lt(i.add(Rt).mul(Dt)))&&this._throwError("value out-of-bounds",t)}else(r.lt(Mt)||r.gt(n.mask(8*this.size)))&&this._throwError("value out-of-bounds",t);return r=r.toTwos(8*this.size).mask(8*this.size),this.signed&&(r=r.fromTwos(8*this.size).toTwos(8*e.wordSize)),e.writeValue(r)}},{key:"decode",value:function(e){var t=e.readValue().mask(8*this.size);return this.signed&&(t=t.fromTwos(8*this.size)),e.coerce(this.name,t)}}])&&Rl(t.prototype,r),n&&Rl(t,n),Object.defineProperty(t,"prototype",{writable:!1}),o}(Bh);function jl(e){return(jl="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Tl(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function Ul(){return(Ul="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,r){var n=Ll(e,t);if(n){var i=Object.getOwnPropertyDescriptor(n,t);return i.get?i.get.call(arguments.length<3?e:r):i.value}}).apply(this,arguments)}function Ll(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=Kl(e)););return e}function Hl(e,t){return(Hl=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Gl(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=Kl(e);if(t){var i=Kl(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return Yl(this,r)}}function Yl(e,t){if(t&&("object"===jl(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function Kl(e){return(Kl=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var ql=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Hl(e,t)}(o,e);var t,r,n,i=Gl(o);function o(e){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,o),i.call(this,"string",e)}return t=o,(r=[{key:"defaultValue",value:function(){return""}},{key:"encode",value:function(e,t){return Ul(Kl(o.prototype),"encode",this).call(this,e,be(t))}},{key:"decode",value:function(e){return ve(Ul(Kl(o.prototype),"decode",this).call(this,e))}}])&&Tl(t.prototype,r),n&&Tl(t,n),Object.defineProperty(t,"prototype",{writable:!1}),o}(dl);function Jl(e){return(Jl="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function zl(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function Vl(e,t){return(Vl=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Zl(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=Xl(e);if(t){var i=Xl(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return Wl(this,r)}}function Wl(e,t){if(t&&("object"===Jl(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function Xl(e){return(Xl=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var $l=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Vl(e,t)}(o,e);var t,r,n,i=Zl(o);function o(e,t){var r;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,o);var n=!1,a=[];e.forEach((function(e){e.dynamic&&(n=!0),a.push(e.type)}));var s="tuple("+a.join(",")+")";return(r=i.call(this,"tuple",s,t,n)).coders=e,r}return t=o,(r=[{key:"defaultValue",value:function(){var e=[];this.coders.forEach((function(t){e.push(t.defaultValue())}));var t=this.coders.reduce((function(e,t){var r=t.localName;return r&&(e[r]||(e[r]=0),e[r]++),e}),{});return this.coders.forEach((function(r,n){var i=r.localName;i&&1===t[i]&&("length"===i&&(i="_length"),null==e[i]&&(e[i]=e[n]))})),Object.freeze(e)}},{key:"encode",value:function(e,t){return zh(e,this.coders,t)}},{key:"decode",value:function(e){return e.coerce(this.name,Vh(e,this.coders))}}])&&zl(t.prototype,r),n&&zl(t,n),Object.defineProperty(t,"prototype",{writable:!1}),o}(Bh);function eg(e){return(eg="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function tg(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&rg(e,t)}function rg(e,t){return(rg=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function ng(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=og(e);if(t){var i=og(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return ig(this,r)}}function ig(e,t){if(t&&("object"===eg(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function og(e){return(og=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function ag(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function sg(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function Ag(e,t,r){return t&&sg(e.prototype,t),r&&sg(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}var cg=new h.b("abi/5.7.0"),ug={},fg={calldata:!0,memory:!0,storage:!0},hg={calldata:!0,memory:!0};function lg(e,t){if("bytes"===e||"string"===e){if(fg[t])return!0}else if("address"===e){if("payable"===t)return!0}else if((e.indexOf("[")>=0||"tuple"===e)&&hg[t])return!0;return(fg[t]||"payable"===t)&&cg.throwArgumentError("invalid modifier","name",t),!1}function gg(e,t){for(var r in t)_(e,r,t[r])}var dg=Object.freeze({sighash:"sighash",minimal:"minimal",full:"full",json:"json"}),pg=new RegExp(/^(.*)\[([0-9]*)\]$/),Ig=function(){function e(t,r){ag(this,e),t!==ug&&cg.throwError("use fromString",h.b.errors.UNSUPPORTED_OPERATION,{operation:"new ParamType()"}),gg(this,r);var n=this.type.match(pg);gg(this,n?{arrayLength:parseInt(n[2]||"-1"),arrayChildren:e.fromObject({type:n[1],components:this.components}),baseType:"array"}:{arrayLength:null,arrayChildren:null,baseType:null!=this.components?"tuple":this.type}),this._isParamType=!0,Object.freeze(this)}return Ag(e,[{key:"format",value:function(e){if(e||(e=dg.sighash),dg[e]||cg.throwArgumentError("invalid format type","format",e),e===dg.json){var t={type:"tuple"===this.baseType?"tuple":this.type,name:this.name||void 0};return"boolean"==typeof this.indexed&&(t.indexed=this.indexed),this.components&&(t.components=this.components.map((function(t){return JSON.parse(t.format(e))}))),JSON.stringify(t)}var r="";return"array"===this.baseType?(r+=this.arrayChildren.format(e),r+="["+(this.arrayLength<0?"":String(this.arrayLength))+"]"):"tuple"===this.baseType?(e!==dg.sighash&&(r+=this.type),r+="("+this.components.map((function(t){return t.format(e)})).join(e===dg.full?", ":",")+")"):r+=this.type,e!==dg.sighash&&(!0===this.indexed&&(r+=" indexed"),e===dg.full&&this.name&&(r+=" "+this.name)),r}}],[{key:"from",value:function(t,r){return"string"==typeof t?e.fromString(t,r):e.fromObject(t)}},{key:"fromObject",value:function(t){return e.isParamType(t)?t:new e(ug,{name:t.name||null,type:_g(t.type),indexed:null==t.indexed?null:!!t.indexed,components:t.components?t.components.map(e.fromObject):null})}},{key:"fromString",value:function(t,r){return function(t){return e.fromObject({name:t.name,type:t.type,indexed:t.indexed,components:t.components})}(function(e,t){var r=e;function n(t){cg.throwArgumentError("unexpected character at position ".concat(t),"param",e)}function i(e){var r={type:"",name:"",parent:e,state:{allowType:!0}};return t&&(r.indexed=!1),r}e=e.replace(/\s/g," ");for(var o={type:"",name:"",state:{allowType:!0}},a=o,s=0;s<e.length;s++){var A=e[s];switch(A){case"(":a.state.allowType&&""===a.type?a.type="tuple":a.state.allowParams||n(s),a.state.allowType=!1,a.type=_g(a.type),a.components=[i(a)],a=a.components[0];break;case")":delete a.state,"indexed"===a.name&&(t||n(s),a.indexed=!0,a.name=""),lg(a.type,a.name)&&(a.name=""),a.type=_g(a.type);var c=a;(a=a.parent)||n(s),delete c.parent,a.state.allowParams=!1,a.state.allowName=!0,a.state.allowArray=!0;break;case",":delete a.state,"indexed"===a.name&&(t||n(s),a.indexed=!0,a.name=""),lg(a.type,a.name)&&(a.name=""),a.type=_g(a.type);var u=i(a.parent);a.parent.components.push(u),delete a.parent,a=u;break;case" ":a.state.allowType&&""!==a.type&&(a.type=_g(a.type),delete a.state.allowType,a.state.allowName=!0,a.state.allowParams=!0),a.state.allowName&&""!==a.name&&("indexed"===a.name?(t||n(s),a.indexed&&n(s),a.indexed=!0,a.name=""):lg(a.type,a.name)?a.name="":a.state.allowName=!1);break;case"[":a.state.allowArray||n(s),a.type+=A,a.state.allowArray=!1,a.state.allowName=!1,a.state.readArray=!0;break;case"]":a.state.readArray||n(s),a.type+=A,a.state.readArray=!1,a.state.allowArray=!0,a.state.allowName=!0;break;default:a.state.allowType?(a.type+=A,a.state.allowParams=!0,a.state.allowArray=!0):a.state.allowName?(a.name+=A,delete a.state.allowArray):a.state.readArray?a.type+=A:n(s)}}return a.parent&&cg.throwArgumentError("unexpected eof","param",e),delete o.state,"indexed"===a.name?(t||n(r.length-7),a.indexed&&n(r.length-7),a.indexed=!0,a.name=""):lg(a.type,a.name)&&(a.name=""),o.type=_g(o.type),o}(t,!!r))}},{key:"isParamType",value:function(e){return!(null==e||!e._isParamType)}}]),e}();function yg(e,t){return function(e){e=e.trim();for(var t=[],r="",n=0,i=0;i<e.length;i++){var o=e[i];","===o&&0===n?(t.push(r),r=""):(r+=o,"("===o?n++:")"===o&&-1===--n&&cg.throwArgumentError("unbalanced parenthesis","value",e))}r&&t.push(r);return t}(e).map((function(e){return Ig.fromString(e,t)}))}var bg=function(){function e(t,r){ag(this,e),t!==ug&&cg.throwError("use a static from method",h.b.errors.UNSUPPORTED_OPERATION,{operation:"new Fragment()"}),gg(this,r),this._isFragment=!0,Object.freeze(this)}return Ag(e,null,[{key:"from",value:function(t){return e.isFragment(t)?t:"string"==typeof t?e.fromString(t):e.fromObject(t)}},{key:"fromObject",value:function(t){if(e.isFragment(t))return t;switch(t.type){case"function":return wg.fromObject(t);case"event":return Eg.fromObject(t);case"constructor":return Bg.fromObject(t);case"error":return kg.fromObject(t);case"fallback":case"receive":return null}return cg.throwArgumentError("invalid fragment object","value",t)}},{key:"fromString",value:function(e){return"event"===(e=(e=(e=e.replace(/\s/g," ")).replace(/\(/g," (").replace(/\)/g,") ").replace(/\s+/g," ")).trim()).split(" ")[0]?Eg.fromString(e.substring(5).trim()):"function"===e.split(" ")[0]?wg.fromString(e.substring(8).trim()):"constructor"===e.split("(")[0].trim()?Bg.fromString(e.trim()):"error"===e.split(" ")[0]?kg.fromString(e.substring(5).trim()):cg.throwArgumentError("unsupported fragment","value",e)}},{key:"isFragment",value:function(e){return!(!e||!e._isFragment)}}]),e}(),Eg=function(e){tg(r,e);var t=ng(r);function r(){return ag(this,r),t.apply(this,arguments)}return Ag(r,[{key:"format",value:function(e){if(e||(e=dg.sighash),dg[e]||cg.throwArgumentError("invalid format type","format",e),e===dg.json)return JSON.stringify({type:"event",anonymous:this.anonymous,name:this.name,inputs:this.inputs.map((function(t){return JSON.parse(t.format(e))}))});var t="";return e!==dg.sighash&&(t+="event "),t+=this.name+"("+this.inputs.map((function(t){return t.format(e)})).join(e===dg.full?", ":",")+") ",e!==dg.sighash&&this.anonymous&&(t+="anonymous "),t.trim()}}],[{key:"from",value:function(e){return"string"==typeof e?r.fromString(e):r.fromObject(e)}},{key:"fromObject",value:function(e){if(r.isEventFragment(e))return e;"event"!==e.type&&cg.throwArgumentError("invalid event object","value",e);var t={name:Dg(e.name),anonymous:e.anonymous,inputs:e.inputs?e.inputs.map(Ig.fromObject):[],type:"event"};return new r(ug,t)}},{key:"fromString",value:function(e){var t=e.match(Mg);t||cg.throwArgumentError("invalid event string","value",e);var n=!1;return t[3].split(" ").forEach((function(e){switch(e.trim()){case"anonymous":n=!0;break;case"":break;default:cg.warn("unknown modifier: "+e)}})),r.fromObject({name:t[1].trim(),anonymous:n,inputs:yg(t[2],!0),type:"event"})}},{key:"isEventFragment",value:function(e){return e&&e._isFragment&&"event"===e.type}}]),r}(bg);function mg(e,t){t.gas=null;var r=e.split("@");return 1!==r.length?(r.length>2&&cg.throwArgumentError("invalid human-readable ABI signature","value",e),r[1].match(/^[0-9]+$/)||cg.throwArgumentError("invalid human-readable ABI signature gas","value",e),t.gas=y.from(r[1]),r[0]):e}function Cg(e,t){t.constant=!1,t.payable=!1,t.stateMutability="nonpayable",e.split(" ").forEach((function(e){switch(e.trim()){case"constant":t.constant=!0;break;case"payable":t.payable=!0,t.stateMutability="payable";break;case"nonpayable":t.payable=!1,t.stateMutability="nonpayable";break;case"pure":t.constant=!0,t.stateMutability="pure";break;case"view":t.constant=!0,t.stateMutability="view";break;case"external":case"public":case"":break;default:console.log("unknown modifier: "+e)}}))}function vg(e){var t={constant:!1,payable:!0,stateMutability:"payable"};return null!=e.stateMutability?(t.stateMutability=e.stateMutability,t.constant="view"===t.stateMutability||"pure"===t.stateMutability,null!=e.constant&&!!e.constant!==t.constant&&cg.throwArgumentError("cannot have constant function with mutability "+t.stateMutability,"value",e),t.payable="payable"===t.stateMutability,null!=e.payable&&!!e.payable!==t.payable&&cg.throwArgumentError("cannot have payable function with mutability "+t.stateMutability,"value",e)):null!=e.payable?(t.payable=!!e.payable,null!=e.constant||t.payable||"constructor"===e.type||cg.throwArgumentError("unable to determine stateMutability","value",e),t.constant=!!e.constant,t.constant?t.stateMutability="view":t.stateMutability=t.payable?"payable":"nonpayable",t.payable&&t.constant&&cg.throwArgumentError("cannot have constant payable function","value",e)):null!=e.constant?(t.constant=!!e.constant,t.payable=!t.constant,t.stateMutability=t.constant?"view":"payable"):"constructor"!==e.type&&cg.throwArgumentError("unable to determine stateMutability","value",e),t}var Bg=function(e){tg(r,e);var t=ng(r);function r(){return ag(this,r),t.apply(this,arguments)}return Ag(r,[{key:"format",value:function(e){if(e||(e=dg.sighash),dg[e]||cg.throwArgumentError("invalid format type","format",e),e===dg.json)return JSON.stringify({type:"constructor",stateMutability:"nonpayable"!==this.stateMutability?this.stateMutability:void 0,payable:this.payable,gas:this.gas?this.gas.toNumber():void 0,inputs:this.inputs.map((function(t){return JSON.parse(t.format(e))}))});e===dg.sighash&&cg.throwError("cannot format a constructor for sighash",h.b.errors.UNSUPPORTED_OPERATION,{operation:"format(sighash)"});var t="constructor("+this.inputs.map((function(t){return t.format(e)})).join(e===dg.full?", ":",")+") ";return this.stateMutability&&"nonpayable"!==this.stateMutability&&(t+=this.stateMutability+" "),t.trim()}}],[{key:"from",value:function(e){return"string"==typeof e?r.fromString(e):r.fromObject(e)}},{key:"fromObject",value:function(e){if(r.isConstructorFragment(e))return e;"constructor"!==e.type&&cg.throwArgumentError("invalid constructor object","value",e);var t=vg(e);t.constant&&cg.throwArgumentError("constructor cannot be constant","value",e);var n={name:null,type:e.type,inputs:e.inputs?e.inputs.map(Ig.fromObject):[],payable:t.payable,stateMutability:t.stateMutability,gas:e.gas?y.from(e.gas):null};return new r(ug,n)}},{key:"fromString",value:function(e){var t={type:"constructor"},n=(e=mg(e,t)).match(Mg);return n&&"constructor"===n[1].trim()||cg.throwArgumentError("invalid constructor string","value",e),t.inputs=yg(n[2].trim(),!1),Cg(n[3].trim(),t),r.fromObject(t)}},{key:"isConstructorFragment",value:function(e){return e&&e._isFragment&&"constructor"===e.type}}]),r}(bg),wg=function(e){tg(r,e);var t=ng(r);function r(){return ag(this,r),t.apply(this,arguments)}return Ag(r,[{key:"format",value:function(e){if(e||(e=dg.sighash),dg[e]||cg.throwArgumentError("invalid format type","format",e),e===dg.json)return JSON.stringify({type:"function",name:this.name,constant:this.constant,stateMutability:"nonpayable"!==this.stateMutability?this.stateMutability:void 0,payable:this.payable,gas:this.gas?this.gas.toNumber():void 0,inputs:this.inputs.map((function(t){return JSON.parse(t.format(e))})),outputs:this.outputs.map((function(t){return JSON.parse(t.format(e))}))});var t="";return e!==dg.sighash&&(t+="function "),t+=this.name+"("+this.inputs.map((function(t){return t.format(e)})).join(e===dg.full?", ":",")+") ",e!==dg.sighash&&(this.stateMutability?"nonpayable"!==this.stateMutability&&(t+=this.stateMutability+" "):this.constant&&(t+="view "),this.outputs&&this.outputs.length&&(t+="returns ("+this.outputs.map((function(t){return t.format(e)})).join(", ")+") "),null!=this.gas&&(t+="@"+this.gas.toString()+" ")),t.trim()}}],[{key:"from",value:function(e){return"string"==typeof e?r.fromString(e):r.fromObject(e)}},{key:"fromObject",value:function(e){if(r.isFunctionFragment(e))return e;"function"!==e.type&&cg.throwArgumentError("invalid function object","value",e);var t=vg(e),n={type:e.type,name:Dg(e.name),constant:t.constant,inputs:e.inputs?e.inputs.map(Ig.fromObject):[],outputs:e.outputs?e.outputs.map(Ig.fromObject):[],payable:t.payable,stateMutability:t.stateMutability,gas:e.gas?y.from(e.gas):null};return new r(ug,n)}},{key:"fromString",value:function(e){var t={type:"function"},n=(e=mg(e,t)).split(" returns ");n.length>2&&cg.throwArgumentError("invalid function string","value",e);var i=n[0].match(Mg);if(i||cg.throwArgumentError("invalid function signature","value",e),t.name=i[1].trim(),t.name&&Dg(t.name),t.inputs=yg(i[2],!1),Cg(i[3].trim(),t),n.length>1){var o=n[1].match(Mg);""==o[1].trim()&&""==o[3].trim()||cg.throwArgumentError("unexpected tokens","value",e),t.outputs=yg(o[2],!1)}else t.outputs=[];return r.fromObject(t)}},{key:"isFunctionFragment",value:function(e){return e&&e._isFragment&&"function"===e.type}}]),r}(Bg);function Qg(e){var t=e.format();return"Error(string)"!==t&&"Panic(uint256)"!==t||cg.throwArgumentError("cannot specify user defined ".concat(t," error"),"fragment",e),e}var kg=function(e){tg(r,e);var t=ng(r);function r(){return ag(this,r),t.apply(this,arguments)}return Ag(r,[{key:"format",value:function(e){if(e||(e=dg.sighash),dg[e]||cg.throwArgumentError("invalid format type","format",e),e===dg.json)return JSON.stringify({type:"error",name:this.name,inputs:this.inputs.map((function(t){return JSON.parse(t.format(e))}))});var t="";return e!==dg.sighash&&(t+="error "),(t+=this.name+"("+this.inputs.map((function(t){return t.format(e)})).join(e===dg.full?", ":",")+") ").trim()}}],[{key:"from",value:function(e){return"string"==typeof e?r.fromString(e):r.fromObject(e)}},{key:"fromObject",value:function(e){if(r.isErrorFragment(e))return e;"error"!==e.type&&cg.throwArgumentError("invalid error object","value",e);var t={type:e.type,name:Dg(e.name),inputs:e.inputs?e.inputs.map(Ig.fromObject):[]};return Qg(new r(ug,t))}},{key:"fromString",value:function(e){var t={type:"error"},n=e.match(Mg);return n||cg.throwArgumentError("invalid error signature","value",e),t.name=n[1].trim(),t.name&&Dg(t.name),t.inputs=yg(n[2],!1),Qg(r.fromObject(t))}},{key:"isErrorFragment",value:function(e){return e&&e._isFragment&&"error"===e.type}}]),r}(bg);function _g(e){return e.match(/^uint($|[^1-9])/)?e="uint256"+e.substring(4):e.match(/^int($|[^1-9])/)&&(e="int256"+e.substring(3)),e}var Sg=new RegExp("^[a-zA-Z$_][a-zA-Z0-9$_]*$");function Dg(e){return e&&e.match(Sg)||cg.throwArgumentError('invalid identifier "'.concat(e,'"'),"value",e),e}var Mg=new RegExp("^([^)(]*)\\((.*)\\)([^)(]*)$");function Rg(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}var xg=new h.b("abi/5.7.0"),Og=new RegExp(/^bytes([0-9]*)$/),Ng=new RegExp(/^(u?int)([0-9]*)$/),Pg=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),_(this,"coerceFunc",t||null)}var t,r,n;return t=e,(r=[{key:"_getCoder",value:function(e){var t=this;switch(e.baseType){case"address":return new xh(e.name);case"bool":return new nl(e.name);case"string":return new ql(e.name);case"bytes":return new pl(e.name);case"array":return new Zh(this._getCoder(e.arrayChildren),e.arrayLength,e.name);case"tuple":return new $l((e.components||[]).map((function(e){return t._getCoder(e)})),e.name);case"":return new Dl(e.name)}var r=e.type.match(Ng);if(r){var n=parseInt(r[2]||"256");return(0===n||n>256||n%8!=0)&&xg.throwArgumentError("invalid "+r[1]+" bit length","param",e),new Fl(n/8,"int"===r[1],e.name)}if(r=e.type.match(Og)){var i=parseInt(r[1]);return(0===i||i>32)&&xg.throwArgumentError("invalid bytes length","param",e),new vl(i,e.name)}return xg.throwArgumentError("invalid type","type",e.type)}},{key:"_getWordSize",value:function(){return 32}},{key:"_getReader",value:function(e,t){return new Qh(e,this._getWordSize(),this.coerceFunc,t)}},{key:"_getWriter",value:function(){return new wh(this._getWordSize())}},{key:"getDefaultValue",value:function(e){var t=this,r=e.map((function(e){return t._getCoder(Ig.from(e))}));return new $l(r,"_").defaultValue()}},{key:"encode",value:function(e,t){var r=this;e.length!==t.length&&xg.throwError("types/values length mismatch",h.b.errors.INVALID_ARGUMENT,{count:{types:e.length,values:t.length},value:{types:e,values:t}});var n=e.map((function(e){return r._getCoder(Ig.from(e))})),i=new $l(n,"_"),o=this._getWriter();return i.encode(o,t),o.data}},{key:"decode",value:function(e,t,r){var n=this,i=e.map((function(e){return n._getCoder(Ig.from(e))}));return new $l(i,"_").decode(this._getReader(Object(c.a)(t),r))}}])&&Rg(t.prototype,r),n&&Rg(t,n),Object.defineProperty(t,"prototype",{writable:!1}),e}(),Fg=new Pg;function jg(e){return(jg="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Tg(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function Ug(e,t,r){return t&&Tg(e.prototype,t),r&&Tg(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function Lg(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Hg(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Gg(e,t)}function Gg(e,t){return(Gg=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Yg(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=qg(e);if(t){var i=qg(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return Kg(this,r)}}function Kg(e,t){if(t&&("object"===jg(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function qg(e){return(qg=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var Jg=new h.b("abi/5.7.0"),zg=function(e){Hg(r,e);var t=Yg(r);function r(){return Lg(this,r),t.apply(this,arguments)}return Ug(r)}(P),Vg=function(e){Hg(r,e);var t=Yg(r);function r(){return Lg(this,r),t.apply(this,arguments)}return Ug(r)}(P),Zg=function(e){Hg(r,e);var t=Yg(r);function r(){return Lg(this,r),t.apply(this,arguments)}return Ug(r)}(P),Wg=function(e){Hg(r,e);var t=Yg(r);function r(){return Lg(this,r),t.apply(this,arguments)}return Ug(r,null,[{key:"isIndexed",value:function(e){return!(!e||!e._isIndexed)}}]),r}(P),Xg={"0x08c379a0":{signature:"Error(string)",name:"Error",inputs:["string"],reason:!0},"0x4e487b71":{signature:"Panic(uint256)",name:"Panic",inputs:["uint256"]}};function $g(e,t){var r=new Error("deferred error during ABI decoding triggered accessing ".concat(e));return r.error=t,r}var ed=function(){function e(t){var r=this;Lg(this,e);_(this,"fragments",("string"==typeof t?JSON.parse(t):t).map((function(e){return bg.from(e)})).filter((function(e){return null!=e}))),_(this,"_abiCoder",S(this instanceof e?this.constructor:void 0,"getAbiCoder")()),_(this,"functions",{}),_(this,"errors",{}),_(this,"events",{}),_(this,"structs",{}),this.fragments.forEach((function(e){var t=null;switch(e.type){case"constructor":return r.deploy?void Jg.warn("duplicate definition - constructor"):void _(r,"deploy",e);case"function":t=r.functions;break;case"event":t=r.events;break;case"error":t=r.errors;break;default:return}var n=e.format();t[n]?Jg.warn("duplicate definition - "+n):t[n]=e})),this.deploy||_(this,"deploy",Bg.from({payable:!1,type:"constructor"})),_(this,"_isInterface",!0)}return Ug(e,[{key:"format",value:function(e){e||(e=dg.full),e===dg.sighash&&Jg.throwArgumentError("interface does not support formatting sighash","format",e);var t=this.fragments.map((function(t){return t.format(e)}));return e===dg.json?JSON.stringify(t.map((function(e){return JSON.parse(e)}))):t}},{key:"getFunction",value:function(e){if(Object(c.l)(e)){for(var t in this.functions)if(e===this.getSighash(t))return this.functions[t];Jg.throwArgumentError("no matching function","sighash",e)}if(-1===e.indexOf("(")){var r=e.trim(),n=Object.keys(this.functions).filter((function(e){return e.split("(")[0]===r}));return 0===n.length?Jg.throwArgumentError("no matching function","name",r):n.length>1&&Jg.throwArgumentError("multiple matching functions","name",r),this.functions[n[0]]}var i=this.functions[wg.fromString(e).format()];return i||Jg.throwArgumentError("no matching function","signature",e),i}},{key:"getEvent",value:function(e){if(Object(c.l)(e)){var t=e.toLowerCase();for(var r in this.events)if(t===this.getEventTopic(r))return this.events[r];Jg.throwArgumentError("no matching event","topichash",t)}if(-1===e.indexOf("(")){var n=e.trim(),i=Object.keys(this.events).filter((function(e){return e.split("(")[0]===n}));return 0===i.length?Jg.throwArgumentError("no matching event","name",n):i.length>1&&Jg.throwArgumentError("multiple matching events","name",n),this.events[i[0]]}var o=this.events[Eg.fromString(e).format()];return o||Jg.throwArgumentError("no matching event","signature",e),o}},{key:"getError",value:function(e){if(Object(c.l)(e)){var t=S(this.constructor,"getSighash");for(var r in this.errors){if(e===t(this.errors[r]))return this.errors[r]}Jg.throwArgumentError("no matching error","sighash",e)}if(-1===e.indexOf("(")){var n=e.trim(),i=Object.keys(this.errors).filter((function(e){return e.split("(")[0]===n}));return 0===i.length?Jg.throwArgumentError("no matching error","name",n):i.length>1&&Jg.throwArgumentError("multiple matching errors","name",n),this.errors[i[0]]}var o=this.errors[wg.fromString(e).format()];return o||Jg.throwArgumentError("no matching error","signature",e),o}},{key:"getSighash",value:function(e){if("string"==typeof e)try{e=this.getFunction(e)}catch(t){try{e=this.getError(e)}catch(e){throw t}}return S(this.constructor,"getSighash")(e)}},{key:"getEventTopic",value:function(e){return"string"==typeof e&&(e=this.getEvent(e)),S(this.constructor,"getEventTopic")(e)}},{key:"_decodeParams",value:function(e,t){return this._abiCoder.decode(e,t)}},{key:"_encodeParams",value:function(e,t){return this._abiCoder.encode(e,t)}},{key:"encodeDeploy",value:function(e){return this._encodeParams(this.deploy.inputs,e||[])}},{key:"decodeErrorResult",value:function(e,t){"string"==typeof e&&(e=this.getError(e));var r=Object(c.a)(t);return Object(c.i)(r.slice(0,4))!==this.getSighash(e)&&Jg.throwArgumentError("data signature does not match error ".concat(e.name,"."),"data",Object(c.i)(r)),this._decodeParams(e.inputs,r.slice(4))}},{key:"encodeErrorResult",value:function(e,t){return"string"==typeof e&&(e=this.getError(e)),Object(c.i)(Object(c.b)([this.getSighash(e),this._encodeParams(e.inputs,t||[])]))}},{key:"decodeFunctionData",value:function(e,t){"string"==typeof e&&(e=this.getFunction(e));var r=Object(c.a)(t);return Object(c.i)(r.slice(0,4))!==this.getSighash(e)&&Jg.throwArgumentError("data signature does not match function ".concat(e.name,"."),"data",Object(c.i)(r)),this._decodeParams(e.inputs,r.slice(4))}},{key:"encodeFunctionData",value:function(e,t){return"string"==typeof e&&(e=this.getFunction(e)),Object(c.i)(Object(c.b)([this.getSighash(e),this._encodeParams(e.inputs,t||[])]))}},{key:"decodeFunctionResult",value:function(e,t){"string"==typeof e&&(e=this.getFunction(e));var r=Object(c.a)(t),n=null,i="",o=null,a=null,s=null;switch(r.length%this._abiCoder._getWordSize()){case 0:try{return this._abiCoder.decode(e.outputs,r)}catch(f){}break;case 4:var A=Object(c.i)(r.slice(0,4)),u=Xg[A];if(u)o=this._abiCoder.decode(u.inputs,r.slice(4)),a=u.name,s=u.signature,u.reason&&(n=o[0]),"Error"===a?i="; VM Exception while processing transaction: reverted with reason string ".concat(JSON.stringify(o[0])):"Panic"===a&&(i="; VM Exception while processing transaction: reverted with panic code ".concat(o[0]));else try{var f=this.getError(A);o=this._abiCoder.decode(f.inputs,r.slice(4)),a=f.name,s=f.format()}catch(f){}}return Jg.throwError("call revert exception"+i,h.b.errors.CALL_EXCEPTION,{method:e.format(),data:Object(c.i)(t),errorArgs:o,errorName:a,errorSignature:s,reason:n})}},{key:"encodeFunctionResult",value:function(e,t){return"string"==typeof e&&(e=this.getFunction(e)),Object(c.i)(this._abiCoder.encode(e.outputs,t||[]))}},{key:"encodeFilterTopics",value:function(e,t){var r=this;"string"==typeof e&&(e=this.getEvent(e)),t.length>e.inputs.length&&Jg.throwError("too many arguments for "+e.format(),h.b.errors.UNEXPECTED_ARGUMENT,{argument:"values",value:t});var n=[];e.anonymous||n.push(this.getEventTopic(e));var i=function(e,t){return"string"===e.type?we(t):"bytes"===e.type?q(Object(c.i)(t)):("bool"===e.type&&"boolean"==typeof t&&(t=t?"0x01":"0x00"),e.type.match(/^u?int/)&&(t=y.from(t).toHexString()),"address"===e.type&&r._abiCoder.encode(["address"],[t]),Object(c.h)(Object(c.i)(t),32))};for(t.forEach((function(t,r){var o=e.inputs[r];o.indexed?null==t?n.push(null):"array"===o.baseType||"tuple"===o.baseType?Jg.throwArgumentError("filtering with tuples or arrays not supported","contract."+o.name,t):Array.isArray(t)?n.push(t.map((function(e){return i(o,e)}))):n.push(i(o,t)):null!=t&&Jg.throwArgumentError("cannot filter non-indexed parameters; must be null","contract."+o.name,t)}));n.length&&null===n[n.length-1];)n.pop();return n}},{key:"encodeEventLog",value:function(e,t){var r=this;"string"==typeof e&&(e=this.getEvent(e));var n=[],i=[],o=[];return e.anonymous||n.push(this.getEventTopic(e)),t.length!==e.inputs.length&&Jg.throwArgumentError("event arguments/values mismatch","values",t),e.inputs.forEach((function(e,a){var s=t[a];if(e.indexed)if("string"===e.type)n.push(we(s));else if("bytes"===e.type)n.push(q(s));else{if("tuple"===e.baseType||"array"===e.baseType)throw new Error("not implemented");n.push(r._abiCoder.encode([e.type],[s]))}else i.push(e),o.push(s)})),{data:this._abiCoder.encode(i,o),topics:n}}},{key:"decodeEventLog",value:function(e,t,r){if("string"==typeof e&&(e=this.getEvent(e)),null!=r&&!e.anonymous){var n=this.getEventTopic(e);Object(c.l)(r[0],32)&&r[0].toLowerCase()===n||Jg.throwError("fragment/topic mismatch",h.b.errors.INVALID_ARGUMENT,{argument:"topics[0]",expected:n,value:r[0]}),r=r.slice(1)}var i=[],o=[],a=[];e.inputs.forEach((function(e,t){e.indexed?"string"===e.type||"bytes"===e.type||"tuple"===e.baseType||"array"===e.baseType?(i.push(Ig.fromObject({type:"bytes32",name:e.name})),a.push(!0)):(i.push(e),a.push(!1)):(o.push(e),a.push(!1))}));var s=null!=r?this._abiCoder.decode(i,Object(c.b)(r)):null,A=this._abiCoder.decode(o,t,!0),u=[],f=0,l=0;e.inputs.forEach((function(e,t){if(e.indexed)if(null==s)u[t]=new Wg({_isIndexed:!0,hash:null});else if(a[t])u[t]=new Wg({_isIndexed:!0,hash:s[l++]});else try{u[t]=s[l++]}catch(e){u[t]=e}else try{u[t]=A[f++]}catch(e){u[t]=e}if(e.name&&null==u[e.name]){var r=u[t];r instanceof Error?Object.defineProperty(u,e.name,{enumerable:!0,get:function(){throw $g("property ".concat(JSON.stringify(e.name)),r)}}):u[e.name]=r}}));for(var g=function(e){var t=u[e];t instanceof Error&&Object.defineProperty(u,e,{enumerable:!0,get:function(){throw $g("index ".concat(e),t)}})},d=0;d<u.length;d++)g(d);return Object.freeze(u)}},{key:"parseTransaction",value:function(e){var t=this.getFunction(e.data.substring(0,10).toLowerCase());return t?new Vg({args:this._abiCoder.decode(t.inputs,"0x"+e.data.substring(10)),functionFragment:t,name:t.name,signature:t.format(),sighash:this.getSighash(t),value:y.from(e.value||"0")}):null}},{key:"parseLog",value:function(e){var t=this.getEvent(e.topics[0]);return!t||t.anonymous?null:new zg({eventFragment:t,name:t.name,signature:t.format(),topic:this.getEventTopic(t),args:this.decodeEventLog(t,e.data,e.topics)})}},{key:"parseError",value:function(e){var t=Object(c.i)(e),r=this.getError(t.substring(0,10).toLowerCase());return r?new Zg({args:this._abiCoder.decode(r.inputs,"0x"+t.substring(10)),errorFragment:r,name:r.name,signature:r.format(),sighash:this.getSighash(r)}):null}}],[{key:"getAbiCoder",value:function(){return Fg}},{key:"getAddress",value:function(e){return Ae(e)}},{key:"getSighash",value:function(e){return Object(c.e)(we(e.format()),0,4)}},{key:"getEventTopic",value:function(e){return we(e.format())}},{key:"isInterface",value:function(e){return!(!e||!e._isInterface)}}]),e}(),td=new RegExp("^bytes([0-9]+)$"),rd=new RegExp("^(u?int)([0-9]*)$"),nd=new RegExp("^(.*)\\[([0-9]*)\\]$"),id=new h.b("solidity/5.7.0");function od(e,t){e.length!=t.length&&id.throwArgumentError("wrong number of values; expected ${ types.length }","values",t);var r=[];return e.forEach((function(e,n){r.push(function e(t,r,n){switch(t){case"address":return n?Object(c.p)(r,32):Object(c.a)(r);case"string":return be(r);case"bytes":return Object(c.a)(r);case"bool":return r=r?"0x01":"0x00",n?Object(c.p)(r,32):Object(c.a)(r)}var i=t.match(rd);if(i){var o=parseInt(i[2]||"256");return(i[2]&&String(o)!==i[2]||o%8!=0||0===o||o>256)&&id.throwArgumentError("invalid number type","type",t),n&&(o=256),r=y.from(r).toTwos(o),Object(c.p)(r,o/8)}if(i=t.match(td)){var a=parseInt(i[1]);return(String(a)!==i[1]||0===a||a>32)&&id.throwArgumentError("invalid bytes type","type",t),Object(c.a)(r).byteLength!==a&&id.throwArgumentError("invalid value for ".concat(t),"value",r),n?Object(c.a)((r+"0000000000000000000000000000000000000000000000000000000000000000").substring(0,66)):r}if((i=t.match(nd))&&Array.isArray(r)){var s=i[1];parseInt(i[2]||String(r.length))!=r.length&&id.throwArgumentError("invalid array length for ".concat(t),"value",r);var A=[];return r.forEach((function(t){A.push(e(s,t,!0))})),Object(c.b)(A)}return id.throwArgumentError("invalid type","type",t)}(e,t[n]))})),Object(c.i)(Object(c.b)(r))}function ad(e,t){return q(od(e,t))}function sd(e,t){return _o(od(e,t))}function Ad(e,t){t||(t=function(e){return[parseInt(e,16)]});var r=0,n={};return e.split(",").forEach((function(e){var i=e.split(":");r+=parseInt(i[0],16),n[r]=t(i[1])})),n}function cd(e){var t=0;return e.split(",").map((function(e){var r=e.split("-");return 1===r.length?r[1]="0":""===r[1]&&(r[1]="1"),{l:t+parseInt(r[0],16),h:t=parseInt(r[1],16)}}))}function ud(e,t){for(var r=0,n=0;n<t.length;n++){var i=t[n];if(e>=(r+=i.l)&&e<=r+i.h&&(e-r)%(i.d||1)==0){if(i.e&&-1!==i.e.indexOf(e-r))continue;return i}}return null}var fd=cd("221,13-1b,5f-,40-10,51-f,11-3,3-3,2-2,2-4,8,2,15,2d,28-8,88,48,27-,3-5,11-20,27-,8,28,3-5,12,18,b-a,1c-4,6-16,2-d,2-2,2,1b-4,17-9,8f-,10,f,1f-2,1c-34,33-14e,4,36-,13-,6-2,1a-f,4,9-,3-,17,8,2-2,5-,2,8-,3-,4-8,2-3,3,6-,16-6,2-,7-3,3-,17,8,3,3,3-,2,6-3,3-,4-a,5,2-6,10-b,4,8,2,4,17,8,3,6-,b,4,4-,2-e,2-4,b-10,4,9-,3-,17,8,3-,5-,9-2,3-,4-7,3-3,3,4-3,c-10,3,7-2,4,5-2,3,2,3-2,3-2,4-2,9,4-3,6-2,4,5-8,2-e,d-d,4,9,4,18,b,6-3,8,4,5-6,3-8,3-3,b-11,3,9,4,18,b,6-3,8,4,5-6,3-6,2,3-3,b-11,3,9,4,18,11-3,7-,4,5-8,2-7,3-3,b-11,3,13-2,19,a,2-,8-2,2-3,7,2,9-11,4-b,3b-3,1e-24,3,2-,3,2-,2-5,5,8,4,2,2-,3,e,4-,6,2,7-,b-,3-21,49,23-5,1c-3,9,25,10-,2-2f,23,6,3,8-2,5-5,1b-45,27-9,2a-,2-3,5b-4,45-4,53-5,8,40,2,5-,8,2,5-,28,2,5-,20,2,5-,8,2,5-,8,8,18,20,2,5-,8,28,14-5,1d-22,56-b,277-8,1e-2,52-e,e,8-a,18-8,15-b,e,4,3-b,5e-2,b-15,10,b-5,59-7,2b-555,9d-3,5b-5,17-,7-,27-,7-,9,2,2,2,20-,36,10,f-,7,14-,4,a,54-3,2-6,6-5,9-,1c-10,13-1d,1c-14,3c-,10-6,32-b,240-30,28-18,c-14,a0,115-,3,66-,b-76,5,5-,1d,24,2,5-2,2,8-,35-2,19,f-10,1d-3,311-37f,1b,5a-b,d7-19,d-3,41,57-,68-4,29-3,5f,29-37,2e-2,25-c,2c-2,4e-3,30,78-3,64-,20,19b7-49,51a7-59,48e-2,38-738,2ba5-5b,222f-,3c-94,8-b,6-4,1b,6,2,3,3,6d-20,16e-f,41-,37-7,2e-2,11-f,5-b,18-,b,14,5-3,6,88-,2,bf-2,7-,7-,7-,4-2,8,8-9,8-2ff,20,5-b,1c-b4,27-,27-cbb1,f7-9,28-2,b5-221,56,48,3-,2-,3-,5,d,2,5,3,42,5-,9,8,1d,5,6,2-2,8,153-3,123-3,33-27fd,a6da-5128,21f-5df,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3,2-1d,61-ff7d"),hd="ad,34f,1806,180b,180c,180d,200b,200c,200d,2060,feff".split(",").map((function(e){return parseInt(e,16)})),ld=[{h:25,s:32,l:65},{h:30,s:32,e:[23],l:127},{h:54,s:1,e:[48],l:64,d:2},{h:14,s:1,l:57,d:2},{h:44,s:1,l:17,d:2},{h:10,s:1,e:[2,6,8],l:61,d:2},{h:16,s:1,l:68,d:2},{h:84,s:1,e:[18,24,66],l:19,d:2},{h:26,s:32,e:[17],l:435},{h:22,s:1,l:71,d:2},{h:15,s:80,l:40},{h:31,s:32,l:16},{h:32,s:1,l:80,d:2},{h:52,s:1,l:42,d:2},{h:12,s:1,l:55,d:2},{h:40,s:1,e:[38],l:15,d:2},{h:14,s:1,l:48,d:2},{h:37,s:48,l:49},{h:148,s:1,l:6351,d:2},{h:88,s:1,l:160,d:2},{h:15,s:16,l:704},{h:25,s:26,l:854},{h:25,s:32,l:55915},{h:37,s:40,l:1247},{h:25,s:-119711,l:53248},{h:25,s:-119763,l:52},{h:25,s:-119815,l:52},{h:25,s:-119867,e:[1,4,5,7,8,11,12,17],l:52},{h:25,s:-119919,l:52},{h:24,s:-119971,e:[2,7,8,17],l:52},{h:24,s:-120023,e:[2,7,13,15,16,17],l:52},{h:25,s:-120075,l:52},{h:25,s:-120127,l:52},{h:25,s:-120179,l:52},{h:25,s:-120231,l:52},{h:25,s:-120283,l:52},{h:25,s:-120335,l:52},{h:24,s:-119543,e:[17],l:56},{h:24,s:-119601,e:[17],l:58},{h:24,s:-119659,e:[17],l:58},{h:24,s:-119717,e:[17],l:58},{h:24,s:-119775,e:[17],l:58}],gd=Ad("b5:3bc,c3:ff,7:73,2:253,5:254,3:256,1:257,5:259,1:25b,3:260,1:263,2:269,1:268,5:26f,1:272,2:275,7:280,3:283,5:288,3:28a,1:28b,5:292,3f:195,1:1bf,29:19e,125:3b9,8b:3b2,1:3b8,1:3c5,3:3c6,1:3c0,1a:3ba,1:3c1,1:3c3,2:3b8,1:3b5,1bc9:3b9,1c:1f76,1:1f77,f:1f7a,1:1f7b,d:1f78,1:1f79,1:1f7c,1:1f7d,107:63,5:25b,4:68,1:68,1:68,3:69,1:69,1:6c,3:6e,4:70,1:71,1:72,1:72,1:72,7:7a,2:3c9,2:7a,2:6b,1:e5,1:62,1:63,3:65,1:66,2:6d,b:3b3,1:3c0,6:64,1b574:3b8,1a:3c3,20:3b8,1a:3c3,20:3b8,1a:3c3,20:3b8,1a:3c3,20:3b8,1a:3c3"),dd=Ad("179:1,2:1,2:1,5:1,2:1,a:4f,a:1,8:1,2:1,2:1,3:1,5:1,3:1,4:1,2:1,3:1,4:1,8:2,1:1,2:2,1:1,2:2,27:2,195:26,2:25,1:25,1:25,2:40,2:3f,1:3f,33:1,11:-6,1:-9,1ac7:-3a,6d:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,b:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,c:-8,2:-8,2:-8,2:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,49:-8,1:-8,1:-4a,1:-4a,d:-56,1:-56,1:-56,1:-56,d:-8,1:-8,f:-8,1:-8,3:-7"),pd=Ad("df:00730073,51:00690307,19:02BC006E,a7:006A030C,18a:002003B9,16:03B903080301,20:03C503080301,1d7:05650582,190f:00680331,1:00740308,1:0077030A,1:0079030A,1:006102BE,b6:03C50313,2:03C503130300,2:03C503130301,2:03C503130342,2a:1F0003B9,1:1F0103B9,1:1F0203B9,1:1F0303B9,1:1F0403B9,1:1F0503B9,1:1F0603B9,1:1F0703B9,1:1F0003B9,1:1F0103B9,1:1F0203B9,1:1F0303B9,1:1F0403B9,1:1F0503B9,1:1F0603B9,1:1F0703B9,1:1F2003B9,1:1F2103B9,1:1F2203B9,1:1F2303B9,1:1F2403B9,1:1F2503B9,1:1F2603B9,1:1F2703B9,1:1F2003B9,1:1F2103B9,1:1F2203B9,1:1F2303B9,1:1F2403B9,1:1F2503B9,1:1F2603B9,1:1F2703B9,1:1F6003B9,1:1F6103B9,1:1F6203B9,1:1F6303B9,1:1F6403B9,1:1F6503B9,1:1F6603B9,1:1F6703B9,1:1F6003B9,1:1F6103B9,1:1F6203B9,1:1F6303B9,1:1F6403B9,1:1F6503B9,1:1F6603B9,1:1F6703B9,3:1F7003B9,1:03B103B9,1:03AC03B9,2:03B10342,1:03B1034203B9,5:03B103B9,6:1F7403B9,1:03B703B9,1:03AE03B9,2:03B70342,1:03B7034203B9,5:03B703B9,6:03B903080300,1:03B903080301,3:03B90342,1:03B903080342,b:03C503080300,1:03C503080301,1:03C10313,2:03C50342,1:03C503080342,b:1F7C03B9,1:03C903B9,1:03CE03B9,2:03C90342,1:03C9034203B9,5:03C903B9,ac:00720073,5b:00B00063,6:00B00066,d:006E006F,a:0073006D,1:00740065006C,1:0074006D,124f:006800700061,2:00610075,2:006F0076,b:00700061,1:006E0061,1:03BC0061,1:006D0061,1:006B0061,1:006B0062,1:006D0062,1:00670062,3:00700066,1:006E0066,1:03BC0066,4:0068007A,1:006B0068007A,1:006D0068007A,1:00670068007A,1:00740068007A,15:00700061,1:006B00700061,1:006D00700061,1:006700700061,8:00700076,1:006E0076,1:03BC0076,1:006D0076,1:006B0076,1:006D0076,1:00700077,1:006E0077,1:03BC0077,1:006D0077,1:006B0077,1:006D0077,1:006B03C9,1:006D03C9,2:00620071,3:00632215006B0067,1:0063006F002E,1:00640062,1:00670079,2:00680070,2:006B006B,1:006B006D,9:00700068,2:00700070006D,1:00700072,2:00730076,1:00770062,c723:00660066,1:00660069,1:0066006C,1:006600660069,1:00660066006C,1:00730074,1:00730074,d:05740576,1:05740565,1:0574056B,1:057E0576,1:0574056D",(function(e){if(e.length%4!=0)throw new Error("bad data");for(var t=[],r=0;r<e.length;r+=4)t.push(parseInt(e.substring(r,r+4),16));return t})),Id=cd("80-20,2a0-,39c,32,f71,18e,7f2-f,19-7,30-4,7-5,f81-b,5,a800-20ff,4d1-1f,110,fa-6,d174-7,2e84-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,2,1f-5f,ff7f-20001");function yd(e){if(e.match(/^[a-z0-9-]*$/i)&&e.length<=59)return e.toLowerCase();var t,r=Be(e);t=r.map((function(e){if(hd.indexOf(e)>=0)return[];if(e>=65024&&e<=65039)return[];var t=function(e){var t=ud(e,ld);if(t)return[e+t.s];var r=gd[e];if(r)return r;var n=dd[e];if(n)return[e+n[0]];var i=pd[e];return i||null}(e);return t||[e]})),(r=Be(Ce(r=t.reduce((function(e,t){return t.forEach((function(t){e.push(t)})),e}),[])),le.NFKC)).forEach((function(e){if(ud(e,Id))throw new Error("STRINGPREP_CONTAINS_PROHIBITED")})),r.forEach((function(e){if(ud(e,fd))throw new Error("STRINGPREP_CONTAINS_UNASSIGNED")}));var n=Ce(r);if("-"===n.substring(0,1)||"--"===n.substring(2,4)||"-"===n.substring(n.length-1))throw new Error("invalid hyphen");return n}function bd(e){var t=be(e);if(t.length>31)throw new Error("bytes32 string must be less than 32 bytes");return Object(c.i)(Object(c.b)([t,as]).slice(0,32))}function Ed(e){var t=Object(c.a)(e);if(32!==t.length)throw new Error("invalid bytes32 - not 32 bytes long");if(0!==t[31])throw new Error("invalid bytes32 string - no null terminator");for(var r=31;0===t[r-1];)r--;return ve(t.slice(0,r))}var md=new h.b("units/5.7.0"),Cd=["wei","kwei","mwei","gwei","szabo","finney","ether"];function vd(e){var t=String(e).split(".");(t.length>2||!t[0].match(/^-?[0-9]*$/)||t[1]&&!t[1].match(/^[0-9]*$/)||"."===e||"-."===e)&&md.throwArgumentError("invalid value","value",e);var r=t[0],n="";for("-"===r.substring(0,1)&&(n="-",r=r.substring(1));"0"===r.substring(0,1);)r=r.substring(1);""===r&&(r="0");var i="";for(2===t.length&&(i="."+(t[1]||"0"));i.length>2&&"0"===i[i.length-1];)i=i.substring(0,i.length-1);for(var o=[];r.length;){if(r.length<=3){o.unshift(r);break}var a=r.length-3;o.unshift(r.substring(a)),r=r.substring(0,a)}return n+o.join(",")+i}function Bd(e,t){if("string"==typeof t){var r=Cd.indexOf(t);-1!==r&&(t=3*r)}return Vi(e,null!=t?t:18)}function wd(e,t){if("string"!=typeof e&&md.throwArgumentError("value must be a string","value",e),"string"==typeof t){var r=Cd.indexOf(t);-1!==r&&(t=3*r)}return Zi(e,null!=t?t:18)}function Qd(e){return Bd(e,18)}function kd(e){return wd(e,18)}var _d="ethers/5.7.2",Sd=new h.b(_d);try{var Dd=window;null==Dd._ethers&&(Dd._ethers=A)}catch(e){}},,,function(e,t,r){"use strict";(function(e){r.d(t,"a",(function(){return c}));var n=r(0),i=r(1),o=r(168),a=new i.b(o.a);var s=function(){if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;if(void 0!==e)return e;throw new Error("unable to locate global object")}(),A=s.crypto||s.msCrypto;function c(e){(e<=0||e>1024||e%1||e!=e)&&a.throwArgumentError("invalid length","length",e);var t=new Uint8Array(e);return A.getRandomValues(t),Object(n.a)(t)}A&&A.getRandomValues||(a.warn("WARNING: Missing strong random number source"),A={getRandomValues:function(e){return a.throwError("no secure random source avaialble",i.b.errors.UNSUPPORTED_OPERATION,{operation:"crypto.getRandomValues"})}})}).call(this,r(8))}])}));
|
|
66
|
+
*/!function(){"use strict";var s="input is invalid type",A="object"===("undefined"==typeof window?"undefined":a(window)),c=A?window:{};c.JS_SHA3_NO_WINDOW&&(A=!1);var u=!A&&"object"===("undefined"==typeof self?"undefined":a(self));!c.JS_SHA3_NO_NODE_JS&&"object"===(void 0===e?"undefined":a(e))&&e.versions&&e.versions.node?c=n:u&&(c=self);var f=!c.JS_SHA3_NO_COMMON_JS&&"object"===a(i)&&i.exports,h=r(53),l=!c.JS_SHA3_NO_ARRAY_BUFFER&&"undefined"!=typeof ArrayBuffer,g="0123456789abcdef".split(""),d=[4,1024,262144,67108864],p=[0,8,16,24],I=[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],y=[224,256,384,512],b=[128,256],E=["hex","buffer","arrayBuffer","array","digest"],m={128:168,256:136};!c.JS_SHA3_NO_NODE_JS&&Array.isArray||(Array.isArray=function(e){return"[object Array]"===Object.prototype.toString.call(e)}),!l||!c.JS_SHA3_NO_ARRAY_BUFFER_IS_VIEW&&ArrayBuffer.isView||(ArrayBuffer.isView=function(e){return"object"===a(e)&&e.buffer&&e.buffer.constructor===ArrayBuffer});for(var C=function(e,t,r){return function(n){return new F(e,t,e).update(n)[r]()}},v=function(e,t,r){return function(n,i){return new F(e,t,i).update(n)[r]()}},B=function(e,t,r){return function(t,n,i,o){return S["cshake"+e].update(t,n,i,o)[r]()}},w=function(e,t,r){return function(t,n,i,o){return S["kmac"+e].update(t,n,i,o)[r]()}},Q=function(e,t,r,n){for(var i=0;i<E.length;++i){var o=E[i];e[o]=t(r,n,o)}return e},k=function(e,t){var r=C(e,t,"hex");return r.create=function(){return new F(e,t,e)},r.update=function(e){return r.create().update(e)},Q(r,C,e,t)},_=[{name:"keccak",padding:[1,256,65536,16777216],bits:y,createMethod:k},{name:"sha3",padding:[6,1536,393216,100663296],bits:y,createMethod:k},{name:"shake",padding:[31,7936,2031616,520093696],bits:b,createMethod:function(e,t){var r=v(e,t,"hex");return r.create=function(r){return new F(e,t,r)},r.update=function(e,t){return r.create(t).update(e)},Q(r,v,e,t)}},{name:"cshake",padding:d,bits:b,createMethod:function(e,t){var r=m[e],n=B(e,0,"hex");return n.create=function(n,i,o){return i||o?new F(e,t,n).bytepad([i,o],r):S["shake"+e].create(n)},n.update=function(e,t,r,i){return n.create(t,r,i).update(e)},Q(n,B,e,t)}},{name:"kmac",padding:d,bits:b,createMethod:function(e,t){var r=m[e],n=w(e,0,"hex");return n.create=function(n,i,o){return new j(e,t,i).bytepad(["KMAC",o],r).bytepad([n],r)},n.update=function(e,t,r,i){return n.create(e,r,i).update(t)},Q(n,w,e,t)}}],S={},D=[],M=0;M<_.length;++M)for(var R=_[M],x=R.bits,O=0;O<x.length;++O){var N=R.name+"_"+x[O];if(D.push(N),S[N]=R.createMethod(x[O],R.padding),"sha3"!==R.name){var P=R.name+x[O];D.push(P),S[P]=S[N]}}function F(e,t,r){this.blocks=[],this.s=[],this.padding=t,this.outputBits=r,this.reset=!0,this.finalized=!1,this.block=0,this.start=0,this.blockCount=1600-(e<<1)>>5,this.byteCount=this.blockCount<<2,this.outputBlocks=r>>5,this.extraBytes=(31&r)>>3;for(var n=0;n<50;++n)this.s[n]=0}function j(e,t,r){F.call(this,e,t,r)}F.prototype.update=function(e){if(this.finalized)throw new Error("finalize already called");var t,r=a(e);if("string"!==r){if("object"!==r)throw new Error(s);if(null===e)throw new Error(s);if(l&&e.constructor===ArrayBuffer)e=new Uint8Array(e);else if(!(Array.isArray(e)||l&&ArrayBuffer.isView(e)))throw new Error(s);t=!0}for(var n,i,o=this.blocks,A=this.byteCount,c=e.length,u=this.blockCount,f=0,h=this.s;f<c;){if(this.reset)for(this.reset=!1,o[0]=this.block,n=1;n<u+1;++n)o[n]=0;if(t)for(n=this.start;f<c&&n<A;++f)o[n>>2]|=e[f]<<p[3&n++];else for(n=this.start;f<c&&n<A;++f)(i=e.charCodeAt(f))<128?o[n>>2]|=i<<p[3&n++]:i<2048?(o[n>>2]|=(192|i>>6)<<p[3&n++],o[n>>2]|=(128|63&i)<<p[3&n++]):i<55296||i>=57344?(o[n>>2]|=(224|i>>12)<<p[3&n++],o[n>>2]|=(128|i>>6&63)<<p[3&n++],o[n>>2]|=(128|63&i)<<p[3&n++]):(i=65536+((1023&i)<<10|1023&e.charCodeAt(++f)),o[n>>2]|=(240|i>>18)<<p[3&n++],o[n>>2]|=(128|i>>12&63)<<p[3&n++],o[n>>2]|=(128|i>>6&63)<<p[3&n++],o[n>>2]|=(128|63&i)<<p[3&n++]);if(this.lastByteIndex=n,n>=A){for(this.start=n-A,this.block=o[u],n=0;n<u;++n)h[n]^=o[n];T(h),this.reset=!0}else this.start=n}return this},F.prototype.encode=function(e,t){var r=255&e,n=1,i=[r];for(r=255&(e>>=8);r>0;)i.unshift(r),r=255&(e>>=8),++n;return t?i.push(n):i.unshift(n),this.update(i),i.length},F.prototype.encodeString=function(e){var t,r=a(e);if("string"!==r){if("object"!==r)throw new Error(s);if(null===e)throw new Error(s);if(l&&e.constructor===ArrayBuffer)e=new Uint8Array(e);else if(!(Array.isArray(e)||l&&ArrayBuffer.isView(e)))throw new Error(s);t=!0}var n=0,i=e.length;if(t)n=i;else for(var o=0;o<e.length;++o){var A=e.charCodeAt(o);A<128?n+=1:A<2048?n+=2:A<55296||A>=57344?n+=3:(A=65536+((1023&A)<<10|1023&e.charCodeAt(++o)),n+=4)}return n+=this.encode(8*n),this.update(e),n},F.prototype.bytepad=function(e,t){for(var r=this.encode(t),n=0;n<e.length;++n)r+=this.encodeString(e[n]);var i=t-r%t,o=[];return o.length=i,this.update(o),this},F.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var e=this.blocks,t=this.lastByteIndex,r=this.blockCount,n=this.s;if(e[t>>2]|=this.padding[3&t],this.lastByteIndex===this.byteCount)for(e[0]=e[r],t=1;t<r+1;++t)e[t]=0;for(e[r-1]|=2147483648,t=0;t<r;++t)n[t]^=e[t];T(n)}},F.prototype.toString=F.prototype.hex=function(){this.finalize();for(var e,t=this.blockCount,r=this.s,n=this.outputBlocks,i=this.extraBytes,o=0,a=0,s="";a<n;){for(o=0;o<t&&a<n;++o,++a)e=r[o],s+=g[e>>4&15]+g[15&e]+g[e>>12&15]+g[e>>8&15]+g[e>>20&15]+g[e>>16&15]+g[e>>28&15]+g[e>>24&15];a%t==0&&(T(r),o=0)}return i&&(e=r[o],s+=g[e>>4&15]+g[15&e],i>1&&(s+=g[e>>12&15]+g[e>>8&15]),i>2&&(s+=g[e>>20&15]+g[e>>16&15])),s},F.prototype.arrayBuffer=function(){this.finalize();var e,t=this.blockCount,r=this.s,n=this.outputBlocks,i=this.extraBytes,o=0,a=0,s=this.outputBits>>3;e=i?new ArrayBuffer(n+1<<2):new ArrayBuffer(s);for(var A=new Uint32Array(e);a<n;){for(o=0;o<t&&a<n;++o,++a)A[a]=r[o];a%t==0&&T(r)}return i&&(A[o]=r[o],e=e.slice(0,s)),e},F.prototype.buffer=F.prototype.arrayBuffer,F.prototype.digest=F.prototype.array=function(){this.finalize();for(var e,t,r=this.blockCount,n=this.s,i=this.outputBlocks,o=this.extraBytes,a=0,s=0,A=[];s<i;){for(a=0;a<r&&s<i;++a,++s)e=s<<2,t=n[a],A[e]=255&t,A[e+1]=t>>8&255,A[e+2]=t>>16&255,A[e+3]=t>>24&255;s%r==0&&T(n)}return o&&(e=s<<2,t=n[a],A[e]=255&t,o>1&&(A[e+1]=t>>8&255),o>2&&(A[e+2]=t>>16&255)),A},j.prototype=new F,j.prototype.finalize=function(){return this.encode(this.outputBits,!0),F.prototype.finalize.call(this)};var T=function(e){var t,r,n,i,o,a,s,A,c,u,f,h,l,g,d,p,y,b,E,m,C,v,B,w,Q,k,_,S,D,M,R,x,O,N,P,F,j,T,U,L,H,G,Y,K,q,J,z,V,Z,W,X,$,ee,te,re,ne,ie,oe,ae,se,Ae,ce,ue;for(n=0;n<48;n+=2)i=e[0]^e[10]^e[20]^e[30]^e[40],o=e[1]^e[11]^e[21]^e[31]^e[41],a=e[2]^e[12]^e[22]^e[32]^e[42],s=e[3]^e[13]^e[23]^e[33]^e[43],A=e[4]^e[14]^e[24]^e[34]^e[44],c=e[5]^e[15]^e[25]^e[35]^e[45],u=e[6]^e[16]^e[26]^e[36]^e[46],f=e[7]^e[17]^e[27]^e[37]^e[47],t=(h=e[8]^e[18]^e[28]^e[38]^e[48])^(a<<1|s>>>31),r=(l=e[9]^e[19]^e[29]^e[39]^e[49])^(s<<1|a>>>31),e[0]^=t,e[1]^=r,e[10]^=t,e[11]^=r,e[20]^=t,e[21]^=r,e[30]^=t,e[31]^=r,e[40]^=t,e[41]^=r,t=i^(A<<1|c>>>31),r=o^(c<<1|A>>>31),e[2]^=t,e[3]^=r,e[12]^=t,e[13]^=r,e[22]^=t,e[23]^=r,e[32]^=t,e[33]^=r,e[42]^=t,e[43]^=r,t=a^(u<<1|f>>>31),r=s^(f<<1|u>>>31),e[4]^=t,e[5]^=r,e[14]^=t,e[15]^=r,e[24]^=t,e[25]^=r,e[34]^=t,e[35]^=r,e[44]^=t,e[45]^=r,t=A^(h<<1|l>>>31),r=c^(l<<1|h>>>31),e[6]^=t,e[7]^=r,e[16]^=t,e[17]^=r,e[26]^=t,e[27]^=r,e[36]^=t,e[37]^=r,e[46]^=t,e[47]^=r,t=u^(i<<1|o>>>31),r=f^(o<<1|i>>>31),e[8]^=t,e[9]^=r,e[18]^=t,e[19]^=r,e[28]^=t,e[29]^=r,e[38]^=t,e[39]^=r,e[48]^=t,e[49]^=r,g=e[0],d=e[1],J=e[11]<<4|e[10]>>>28,z=e[10]<<4|e[11]>>>28,S=e[20]<<3|e[21]>>>29,D=e[21]<<3|e[20]>>>29,se=e[31]<<9|e[30]>>>23,Ae=e[30]<<9|e[31]>>>23,G=e[40]<<18|e[41]>>>14,Y=e[41]<<18|e[40]>>>14,N=e[2]<<1|e[3]>>>31,P=e[3]<<1|e[2]>>>31,p=e[13]<<12|e[12]>>>20,y=e[12]<<12|e[13]>>>20,V=e[22]<<10|e[23]>>>22,Z=e[23]<<10|e[22]>>>22,M=e[33]<<13|e[32]>>>19,R=e[32]<<13|e[33]>>>19,ce=e[42]<<2|e[43]>>>30,ue=e[43]<<2|e[42]>>>30,te=e[5]<<30|e[4]>>>2,re=e[4]<<30|e[5]>>>2,F=e[14]<<6|e[15]>>>26,j=e[15]<<6|e[14]>>>26,b=e[25]<<11|e[24]>>>21,E=e[24]<<11|e[25]>>>21,W=e[34]<<15|e[35]>>>17,X=e[35]<<15|e[34]>>>17,x=e[45]<<29|e[44]>>>3,O=e[44]<<29|e[45]>>>3,w=e[6]<<28|e[7]>>>4,Q=e[7]<<28|e[6]>>>4,ne=e[17]<<23|e[16]>>>9,ie=e[16]<<23|e[17]>>>9,T=e[26]<<25|e[27]>>>7,U=e[27]<<25|e[26]>>>7,m=e[36]<<21|e[37]>>>11,C=e[37]<<21|e[36]>>>11,$=e[47]<<24|e[46]>>>8,ee=e[46]<<24|e[47]>>>8,K=e[8]<<27|e[9]>>>5,q=e[9]<<27|e[8]>>>5,k=e[18]<<20|e[19]>>>12,_=e[19]<<20|e[18]>>>12,oe=e[29]<<7|e[28]>>>25,ae=e[28]<<7|e[29]>>>25,L=e[38]<<8|e[39]>>>24,H=e[39]<<8|e[38]>>>24,v=e[48]<<14|e[49]>>>18,B=e[49]<<14|e[48]>>>18,e[0]=g^~p&b,e[1]=d^~y&E,e[10]=w^~k&S,e[11]=Q^~_&D,e[20]=N^~F&T,e[21]=P^~j&U,e[30]=K^~J&V,e[31]=q^~z&Z,e[40]=te^~ne&oe,e[41]=re^~ie&ae,e[2]=p^~b&m,e[3]=y^~E&C,e[12]=k^~S&M,e[13]=_^~D&R,e[22]=F^~T&L,e[23]=j^~U&H,e[32]=J^~V&W,e[33]=z^~Z&X,e[42]=ne^~oe&se,e[43]=ie^~ae&Ae,e[4]=b^~m&v,e[5]=E^~C&B,e[14]=S^~M&x,e[15]=D^~R&O,e[24]=T^~L&G,e[25]=U^~H&Y,e[34]=V^~W&$,e[35]=Z^~X&ee,e[44]=oe^~se&ce,e[45]=ae^~Ae&ue,e[6]=m^~v&g,e[7]=C^~B&d,e[16]=M^~x&w,e[17]=R^~O&Q,e[26]=L^~G&N,e[27]=H^~Y&P,e[36]=W^~$&K,e[37]=X^~ee&q,e[46]=se^~ce&te,e[47]=Ae^~ue&re,e[8]=v^~g&p,e[9]=B^~d&y,e[18]=x^~w&k,e[19]=O^~Q&_,e[28]=G^~N&F,e[29]=Y^~P&j,e[38]=$^~K&J,e[39]=ee^~q&z,e[48]=ce^~te&ne,e[49]=ue^~re&ie,e[0]^=I[n],e[1]^=I[n+1]};if(f)i.exports=S;else{for(M=0;M<D.length;++M)c[D[M]]=S[D[M]];h&&(void 0===(o=function(){return S}.call(t,r,t,i))||(i.exports=o))}}()}).call(this,r(9),r(8),r(11)(e))},function(e,t,r){"use strict";r.d(t,"a",(function(){return n}));var n="random/5.7.0"},function(e,t,r){var n=r(36),i=r(21),o=r(22),a=r(51),s=r(52);function A(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function c(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?A(Object(r),!0).forEach((function(t){n(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):A(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function u(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=function(e,t){if(!e)return;if("string"==typeof e)return f(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return f(e,t)}(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return a=e.done,e},e:function(e){s=!0,o=e},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}function f(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var h=r(172),l=r(37),g=r(195).permissionLevels,d=r(99).LogMessage,p=r(265),I=function(){"use strict";function e(){var t=this,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=r.target,s=r.timeout,A=void 0===s?30:s;a(this,e),this.permissionLevels=g,!n&&"undefined"!=typeof window&&window.parent&&(n=window.parent),this.target=n,this.timeout=A,this.utils=l,this.Crypto=p,this.Crypto.ElvCrypto();var c,f=u(this.AllowedMethods());try{var h=function(){var e=c.value;t[e]=function(){var r=o(i.mark((function r(n){var o;return i.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return(o=n&&n.callback)&&delete n.callback,r.next=4,t.SendMessage({options:{calledMethod:e,args:t.utils.MakeClonable(n)},callback:o});case 4:return r.abrupt("return",r.sent);case 5:case"end":return r.stop()}}),r)})));return function(e){return r.apply(this,arguments)}}()};for(f.s();!(c=f.n()).done;)h()}catch(e){f.e(e)}finally{f.f()}this.userProfileClient={};var d,I=u(this.AllowedUserProfileMethods());try{var y=function(){var r=d.value;t.userProfileClient[r]=function(){var n=o(i.mark((function n(o){var a;return i.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return(a=o&&o.callback)&&delete o.callback,n.next=4,t.SendMessage({options:{module:"userProfileClient",calledMethod:r,args:t.utils.MakeClonable(o),prompted:e.PromptedMethods().includes(r)},callback:a});case 4:return n.abrupt("return",n.sent);case 5:case"end":return n.stop()}}),n)})));return function(e){return n.apply(this,arguments)}}()};for(I.s();!(d=I.n()).done;)y()}catch(e){I.e(e)}finally{I.f()}}var t,r,n;return s(e,[{key:"Log",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];d(this,e,t)}},{key:"PassRequest",value:(n=o(i.mark((function e(t){var r,n,o,a,s;return i.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.request,n=t.Respond,e.prev=1,r.callbackId&&(s=function(e){return n({type:"ElvFrameResponse",requestId:r.callbackId,response:e})}),e.next=5,this.SendMessage({options:r,callback:s});case 5:o=e.sent,e.next=11;break;case 8:e.prev=8,e.t0=e.catch(1),a=e.t0;case 11:return e.abrupt("return",{type:"ElvFrameResponse",requestId:r.requestId,response:o,error:a});case 12:case"end":return e.stop()}}),e,this,[[1,8]])}))),function(e){return n.apply(this,arguments)})},{key:"SendMessage",value:(r=o(i.mark((function t(r){var n,o,a,s,A,u,f,l,g,d;return i.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n=r.options,o=void 0===n?{}:n,a=r.callback,s=r.noResponse,A=void 0!==s&&s,u=h.next(),a&&(f=h.next()),this.target.postMessage(c(c({},o),{},{type:"ElvFrameRequest",requestId:u,callbackId:f}),"*"),!A){t.next=6;break}return t.abrupt("return");case 6:return l=o.calledMethod||o.operation,g=e.FileMethods().includes(o.calledMethod),d=this.timeout,o.prompted||g?d=0:o.args&&o.args.fcTimeout&&(d=o.args.fcTimeout),t.next=12,this.AwaitMessage(u,d,a,f,l);case 12:return t.abrupt("return",t.sent);case 13:case"end":return t.stop()}}),t,this)}))),function(e){return r.apply(this,arguments)})},{key:"AwaitMessage",value:(t=o(i.mark((function e(t,r,n,a,s){return i.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,new Promise((function(e,A){var c,u,f,h=function(){u&&clearTimeout(u),r>0&&(u=setTimeout((function(){"undefined"!=typeof window&&(window.removeEventListener("message",c),f&&window.removeEventListener("message",f)),A("Request ".concat(t," timed out (").concat(s,")"))}),1e3*r))};a&&(f=function(e){try{h();var t=e.data;if("ElvFrameResponse"!==t.type||t.requestId!==a)return;n(t.response)}catch(e){console.error(e)}},window.addEventListener("message",f)),c=function(){var r=o(i.mark((function r(n){var o;return i.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(r.prev=0,"ElvFrameResponse"===(o=n.data).type&&o.requestId===t){r.next=4;break}return r.abrupt("return");case 4:clearTimeout(u),window.removeEventListener("message",c),f&&window.removeEventListener("message",f),o.error?A(o.error):e(o.response),r.next=16;break;case 10:r.prev=10,r.t0=r.catch(0),clearTimeout(u),window.removeEventListener("message",c),f&&window.removeEventListener("message",f),A(r.t0);case 16:case"end":return r.stop()}}),r,null,[[0,10]])})));return function(e){return r.apply(this,arguments)}}(),h(),window.addEventListener("message",c)}));case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e)}))),function(e,r,n,i,o){return t.apply(this,arguments)})},{key:"OverriddenMethods",value:function(){return["UploadFiles"]}},{key:"AllowedMethods",value:function(){return["AccessGroupManagers","AccessGroupMembers","AccessGroupOwner","AccessInfo","AccessRequest","AccessType","AddAccessGroupManager","AddAccessGroupMember","AddContentLibraryGroup","AddContentObjectGroupPermission","AddLibraryContentType","AssetMetadata","AvailableDRMs","AvailableOfferings","AwaitPending","BitmovinPlayoutOptions","BlockNumber","CallBitcodeMethod","CallContractMethod","CallContractMethodAndWait","ClearCache","ClearStaticToken","Collection","CollectionTransactions","ConfigUrl","ContentLibraries","ContentLibrary","ContentLibraryGroupPermissions","ContentLibraryOwner","ContentObject","ContentObjectAccessComplete","ContentObjectGraph","ContentObjectGroupPermissions","ContentObjectImageUrl","ContentObjectLibraryId","ContentObjectMetadata","ContentObjectOwner","ContentObjectTenantId","ContentObjectVersions","ContentObjects","ContentPart","ContentParts","ContentSpaceId","ContentType","ContentTypeOwner","ContentTypes","ContractAbi","ContractEvents","ContractMetadata","ContractName","CopyContentObject","CreateABRMezzanine","CreateAccessGroup","CreateAndFinalizeContentObject","CreateContentLibrary","CreateContentObject","CreateContentType","CreateEncryptionConk","CreateFabricToken","CreateFileDirectories","CreateFileUploadJob","CreateLinks","CreateNTPInstance","CreateNonOwnerCap","CreatePart","CreateProductionMaster","CreateSignedToken","CurrentAccountAddress","CustomContractAddress","Decrypt","DecryptECIES","DefaultKMSAddress","DeleteAccessGroup","DeleteContentLibrary","DeleteContentObject","DeleteContentVersion","DeleteFiles","DeleteMetadata","DeleteNTPInstance","DeletePart","DeployContract","Download","DownloadEncrypted","DownloadFile","DownloadPart","EditAndFinalizeContentObject","EditContentObject","Encrypt","EncryptECIES","EncryptionConk","Events","ExtractEventFromLogs","ExtractValueFromEvent","FabricUrl","FileUrl","FinalizeABRMezzanine","FinalizeContentObject","FinalizePart","FinalizeStateChannelAccess","FinalizeUploadJob","FormatContractArguments","GenerateStateChannelToken","GenerateSignedLinkToken","GetBalance","InitializeAuthPolicy","IssueNTPCode","IssueSignedNTPCode","LatestVersionHash","LibraryContentTypes","LinkAccessGroupToOauth","LinkData","LinkTarget","LinkUrl","ListAccessGroups","ListFiles","ListNTPInstances","LROStatus","MergeContractMetadata","MergeMetadata","MetadataAuth","MintNFT","NetworkInfo","NodeId","Nodes","NTPInstance","Permission","PlayoutOptions","PlayoutPathResolution","ProduceMetadataLinks","Proofs","PublicRep","PublishContentVersion","QParts","RedeemCode","RemoveAccessGroupManager","RemoveAccessGroupMember","RemoveContentObjectGroupPermission","RemoveContentLibraryGroup","RemoveLibraryContentType","Rep","ReplaceContractMetadata","ReplaceMetadata","Request","ResetRegion","SendFunds","SetAccessCharge","SetAuth","SetAuthContext","SetAuthPolicy","SetContentLibraryImage","SetContentObjectImage","SetCustomContentContract","SetGroupPermission","SetNodes","SetOauthToken","SetPolicyAuthorization","SetSignerFromOauthToken","SetStaticToken","SetVisibility","SetPermission","StartABRMezzanineJobs","SuspendNTPInstance","UnlinkAccessGroupFromOauth","UpdateContentObjectGraph","UpdateNTPInstance","UploadFileData","UploadFilesFromS3","UploadJobStatus","UploadPart","UploadPartChunk","UploadStatus","UseRegion","VerifyContentObject","Visibility"]}},{key:"AllowedUserProfileMethods",value:function(){return["AccessLevel","CollectedTags","CreateWallet","DeleteUserMetadata","MergeUserMetadata","PublicUserMetadata","ReplaceUserMetadata","TenantId","UserMetadata","UserProfileImage","UserWalletAddress","UserWalletObjectInfo","WalletAddress"]}}],[{key:"PromptedMethods",value:function(){return["CollectedTags","DeleteUserMetadata","MergeUserMetadata","ReplaceUserMetadata","UserMetadata"]}},{key:"MetadataMethods",value:function(){return["DeleteUserMetadata","MergeUserMetadata","ReplaceUserMetadata","UserMetadata"]}},{key:"FileMethods",value:function(){return["DownloadFile","DownloadPart","UpdateContentObjectGraph","UploadFiles","UploadFilesFromS3","UploadPart","UploadPartChunk"]}}]),e}(),y=r(332).UploadFiles;I.prototype.UploadFiles=y,t.FrameClient=I},,function(e,t,r){(function(e){function t(e){return(t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var r=function(e){"use strict";var r=Object.prototype,n=r.hasOwnProperty,i="function"==typeof Symbol?Symbol:{},o=i.iterator||"@@iterator",a=i.asyncIterator||"@@asyncIterator",s=i.toStringTag||"@@toStringTag";function A(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{A({},"")}catch(e){A=function(e,t,r){return e[t]=r}}function c(e,t,r,n){var i=t&&t.prototype instanceof h?t:h,o=Object.create(i.prototype),a=new B(n||[]);return o._invoke=function(e,t,r){var n="suspendedStart";return function(i,o){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===i)throw o;return Q()}for(r.method=i,r.arg=o;;){var a=r.delegate;if(a){var s=m(a,r);if(s){if(s===f)continue;return s}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var A=u(e,t,r);if("normal"===A.type){if(n=r.done?"completed":"suspendedYield",A.arg===f)continue;return{value:A.arg,done:r.done}}"throw"===A.type&&(n="completed",r.method="throw",r.arg=A.arg)}}}(e,r,a),o}function u(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}e.wrap=c;var f={};function h(){}function l(){}function g(){}var d={};A(d,o,(function(){return this}));var p=Object.getPrototypeOf,I=p&&p(p(w([])));I&&I!==r&&n.call(I,o)&&(d=I);var y=g.prototype=h.prototype=Object.create(d);function b(e){["next","throw","return"].forEach((function(t){A(e,t,(function(e){return this._invoke(t,e)}))}))}function E(e,r){var i;this._invoke=function(o,a){function s(){return new r((function(i,s){!function i(o,a,s,A){var c=u(e[o],e,a);if("throw"!==c.type){var f=c.arg,h=f.value;return h&&"object"===t(h)&&n.call(h,"__await")?r.resolve(h.__await).then((function(e){i("next",e,s,A)}),(function(e){i("throw",e,s,A)})):r.resolve(h).then((function(e){f.value=e,s(f)}),(function(e){return i("throw",e,s,A)}))}A(c.arg)}(o,a,i,s)}))}return i=i?i.then(s,s):s()}}function m(e,t){var r=e.iterator[t.method];if(void 0===r){if(t.delegate=null,"throw"===t.method){if(e.iterator.return&&(t.method="return",t.arg=void 0,m(e,t),"throw"===t.method))return f;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return f}var n=u(r,e.iterator,t.arg);if("throw"===n.type)return t.method="throw",t.arg=n.arg,t.delegate=null,f;var i=n.arg;return i?i.done?(t[e.resultName]=i.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,f):i:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,f)}function C(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function v(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function B(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(C,this),this.reset(!0)}function w(e){if(e){var t=e[o];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var r=-1,i=function t(){for(;++r<e.length;)if(n.call(e,r))return t.value=e[r],t.done=!1,t;return t.value=void 0,t.done=!0,t};return i.next=i}}return{next:Q}}function Q(){return{value:void 0,done:!0}}return l.prototype=g,A(y,"constructor",g),A(g,"constructor",l),l.displayName=A(g,s,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===l||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,g):(e.__proto__=g,A(e,s,"GeneratorFunction")),e.prototype=Object.create(y),e},e.awrap=function(e){return{__await:e}},b(E.prototype),A(E.prototype,a,(function(){return this})),e.AsyncIterator=E,e.async=function(t,r,n,i,o){void 0===o&&(o=Promise);var a=new E(c(t,r,n,i),o);return e.isGeneratorFunction(r)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},b(y),A(y,s,"Generator"),A(y,o,(function(){return this})),A(y,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=[];for(var r in e)t.push(r);return t.reverse(),function r(){for(;t.length;){var n=t.pop();if(n in e)return r.value=n,r.done=!1,r}return r.done=!0,r}},e.values=w,B.prototype={constructor:B,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(v),!e)for(var t in this)"t"===t.charAt(0)&&n.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function r(r,n){return a.type="throw",a.arg=e,t.next=r,n&&(t.method="next",t.arg=void 0),!!n}for(var i=this.tryEntries.length-1;i>=0;--i){var o=this.tryEntries[i],a=o.completion;if("root"===o.tryLoc)return r("end");if(o.tryLoc<=this.prev){var s=n.call(o,"catchLoc"),A=n.call(o,"finallyLoc");if(s&&A){if(this.prev<o.catchLoc)return r(o.catchLoc,!0);if(this.prev<o.finallyLoc)return r(o.finallyLoc)}else if(s){if(this.prev<o.catchLoc)return r(o.catchLoc,!0)}else{if(!A)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return r(o.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var o=i;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=e,a.arg=t,o?(this.method="next",this.next=o.finallyLoc,f):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),f},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),v(r),f}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var i=n.arg;v(r)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:w(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),f}},e}("object"===t(e)?e.exports:{});try{regeneratorRuntime=r}catch(e){"object"===("undefined"==typeof globalThis?"undefined":t(globalThis))?globalThis.regeneratorRuntime=r:Function("r","regeneratorRuntime = r")(r)}}).call(this,r(11)(e))},function(e,t,r){var n=r(51),i=r(52),o=0,a=function(){"use strict";function e(){n(this,e)}return i(e,null,[{key:"next",value:function(){return++o}}]),e}();e.exports=a},function(e,t,r){var n=r(85);e.exports=function(e){if(Array.isArray(e))return n(e)},e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t){e.exports=function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)},e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t){e.exports=function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")},e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t,r){var n=r(177),i=r(178),o=r(86),a=r(179);e.exports=function(e,t){return n(e)||i(e,t)||o(e,t)||a()},e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t){e.exports=function(e){if(Array.isArray(e))return e},e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t){e.exports=function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,i,o=[],a=!0,s=!1;try{for(r=r.call(e);!(a=(n=r.next()).done)&&(o.push(n.value),!t||o.length!==t);a=!0);}catch(e){s=!0,i=e}finally{try{a||null==r.return||r.return()}finally{if(s)throw i}}return o}},e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t){e.exports=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")},e.exports.__esModule=!0,e.exports.default=e.exports},function(e,t,r){"use strict";var n=r(4).Buffer;e.exports=function(e){if(e.length>=255)throw new TypeError("Alphabet too long");for(var t=new Uint8Array(256),r=0;r<t.length;r++)t[r]=255;for(var i=0;i<e.length;i++){var o=e.charAt(i),a=o.charCodeAt(0);if(255!==t[a])throw new TypeError(o+" is ambiguous");t[a]=i}var s=e.length,A=e.charAt(0),c=Math.log(s)/Math.log(256),u=Math.log(256)/Math.log(s);function f(e){if("string"!=typeof e)throw new TypeError("Expected String");if(0===e.length)return n.alloc(0);for(var r=0,i=0,o=0;e[r]===A;)i++,r++;for(var a=(e.length-r)*c+1>>>0,u=new Uint8Array(a);e[r];){var f=t[e.charCodeAt(r)];if(255===f)return;for(var h=0,l=a-1;(0!==f||h<o)&&-1!==l;l--,h++)f+=s*u[l]>>>0,u[l]=f%256>>>0,f=f/256>>>0;if(0!==f)throw new Error("Non-zero carry");o=h,r++}for(var g=a-o;g!==a&&0===u[g];)g++;var d=n.allocUnsafe(i+(a-g));d.fill(0,0,i);for(var p=i;g!==a;)d[p++]=u[g++];return d}return{encode:function(t){if((Array.isArray(t)||t instanceof Uint8Array)&&(t=n.from(t)),!n.isBuffer(t))throw new TypeError("Expected Buffer");if(0===t.length)return"";for(var r=0,i=0,o=0,a=t.length;o!==a&&0===t[o];)o++,r++;for(var c=(a-o)*u+1>>>0,f=new Uint8Array(c);o!==a;){for(var h=t[o],l=0,g=c-1;(0!==h||l<i)&&-1!==g;g--,l++)h+=256*f[g]>>>0,f[g]=h%s>>>0,h=h/s>>>0;if(0!==h)throw new Error("Non-zero carry");i=l,o++}for(var d=c-i;d!==c&&0===f[d];)d++;for(var p=A.repeat(r);d<c;++d)p+=e.charAt(f[d]);return p},decodeUnsafe:f,decode:function(e){var t=f(e);if(t)return t;throw new Error("Non-base"+s+" character")}}}},function(e,t,r){var n;function i(e){return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}!function(o){"use strict";var a,s=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,A="function"==typeof Symbol&&"symbol"==i(Symbol.iterator),c=Math.ceil,u=Math.floor,f="[BigNumber Error] ",h=f+"Number primitive has more than 15 significant digits: ",l=1e14,g=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],d=1e9;function p(e){var t=0|e;return e>0||e===t?t:t-1}function I(e){for(var t,r,n=1,i=e.length,o=e[0]+"";n<i;){for(r=14-(t=e[n++]+"").length;r--;t="0"+t);o+=t}for(i=o.length;48===o.charCodeAt(--i););return o.slice(0,i+1||1)}function y(e,t){var r,n,i=e.c,o=t.c,a=e.s,s=t.s,A=e.e,c=t.e;if(!a||!s)return null;if(r=i&&!i[0],n=o&&!o[0],r||n)return r?n?0:-s:a;if(a!=s)return a;if(r=a<0,n=A==c,!i||!o)return n?0:!i^r?1:-1;if(!n)return A>c^r?1:-1;for(s=(A=i.length)<(c=o.length)?A:c,a=0;a<s;a++)if(i[a]!=o[a])return i[a]>o[a]^r?1:-1;return A==c?0:A>c^r?1:-1}function b(e,t,r,n){if(e<t||e>r||e!==u(e))throw Error(f+(n||"Argument")+("number"==typeof e?e<t||e>r?" out of range: ":" not an integer: ":" not a primitive number: ")+String(e))}function E(e){var t=e.c.length-1;return p(e.e/14)==t&&e.c[t]%2!=0}function m(e,t){return(e.length>1?e.charAt(0)+"."+e.slice(1):e)+(t<0?"e":"e+")+t}function C(e,t,r){var n,i;if(t<0){for(i=r+".";++t;i+=r);e=i+e}else if(++t>(n=e.length)){for(i=r,t-=n;--t;i+=r);e+=i}else t<n&&(e=e.slice(0,t)+"."+e.slice(t));return e}(a=function e(t){var r,n,o,a,v,B,w,Q,k,_=L.prototype={constructor:L,toString:null,valueOf:null},S=new L(1),D=20,M=4,R=-7,x=21,O=-1e7,N=1e7,P=!1,F=1,j=0,T={prefix:"",groupSize:3,secondaryGroupSize:0,groupSeparator:",",decimalSeparator:".",fractionGroupSize:0,fractionGroupSeparator:" ",suffix:""},U="0123456789abcdefghijklmnopqrstuvwxyz";function L(e,t){var r,i,a,A,c,f,l,g,d=this;if(!(d instanceof L))return new L(e,t);if(null==t){if(e&&!0===e._isBigNumber)return d.s=e.s,void(!e.c||e.e>N?d.c=d.e=null:e.e<O?d.c=[d.e=0]:(d.e=e.e,d.c=e.c.slice()));if((f="number"==typeof e)&&0*e==0){if(d.s=1/e<0?(e=-e,-1):1,e===~~e){for(A=0,c=e;c>=10;c/=10,A++);return void(A>N?d.c=d.e=null:(d.e=A,d.c=[e]))}g=String(e)}else{if(!s.test(g=String(e)))return o(d,g,f);d.s=45==g.charCodeAt(0)?(g=g.slice(1),-1):1}(A=g.indexOf("."))>-1&&(g=g.replace(".","")),(c=g.search(/e/i))>0?(A<0&&(A=c),A+=+g.slice(c+1),g=g.substring(0,c)):A<0&&(A=g.length)}else{if(b(t,2,U.length,"Base"),10==t)return K(d=new L(e),D+d.e+1,M);if(g=String(e),f="number"==typeof e){if(0*e!=0)return o(d,g,f,t);if(d.s=1/e<0?(g=g.slice(1),-1):1,L.DEBUG&&g.replace(/^0\.0*|\./,"").length>15)throw Error(h+e)}else d.s=45===g.charCodeAt(0)?(g=g.slice(1),-1):1;for(r=U.slice(0,t),A=c=0,l=g.length;c<l;c++)if(r.indexOf(i=g.charAt(c))<0){if("."==i){if(c>A){A=l;continue}}else if(!a&&(g==g.toUpperCase()&&(g=g.toLowerCase())||g==g.toLowerCase()&&(g=g.toUpperCase()))){a=!0,c=-1,A=0;continue}return o(d,String(e),f,t)}f=!1,(A=(g=n(g,t,10,d.s)).indexOf("."))>-1?g=g.replace(".",""):A=g.length}for(c=0;48===g.charCodeAt(c);c++);for(l=g.length;48===g.charCodeAt(--l););if(g=g.slice(c,++l)){if(l-=c,f&&L.DEBUG&&l>15&&(e>9007199254740991||e!==u(e)))throw Error(h+d.s*e);if((A=A-c-1)>N)d.c=d.e=null;else if(A<O)d.c=[d.e=0];else{if(d.e=A,d.c=[],c=(A+1)%14,A<0&&(c+=14),c<l){for(c&&d.c.push(+g.slice(0,c)),l-=14;c<l;)d.c.push(+g.slice(c,c+=14));c=14-(g=g.slice(c)).length}else c-=l;for(;c--;g+="0");d.c.push(+g)}}else d.c=[d.e=0]}function H(e,t,r,n){var i,o,a,s,A;if(null==r?r=M:b(r,0,8),!e.c)return e.toString();if(i=e.c[0],a=e.e,null==t)A=I(e.c),A=1==n||2==n&&(a<=R||a>=x)?m(A,a):C(A,a,"0");else if(o=(e=K(new L(e),t,r)).e,s=(A=I(e.c)).length,1==n||2==n&&(t<=o||o<=R)){for(;s<t;A+="0",s++);A=m(A,o)}else if(t-=a,A=C(A,o,"0"),o+1>s){if(--t>0)for(A+=".";t--;A+="0");}else if((t+=o-s)>0)for(o+1==s&&(A+=".");t--;A+="0");return e.s<0&&i?"-"+A:A}function G(e,t){for(var r,n=1,i=new L(e[0]);n<e.length;n++){if(!(r=new L(e[n])).s){i=r;break}t.call(i,r)&&(i=r)}return i}function Y(e,t,r){for(var n=1,i=t.length;!t[--i];t.pop());for(i=t[0];i>=10;i/=10,n++);return(r=n+14*r-1)>N?e.c=e.e=null:r<O?e.c=[e.e=0]:(e.e=r,e.c=t),e}function K(e,t,r,n){var i,o,a,s,A,f,h,d=e.c,p=g;if(d){e:{for(i=1,s=d[0];s>=10;s/=10,i++);if((o=t-i)<0)o+=14,a=t,h=(A=d[f=0])/p[i-a-1]%10|0;else if((f=c((o+1)/14))>=d.length){if(!n)break e;for(;d.length<=f;d.push(0));A=h=0,i=1,a=(o%=14)-14+1}else{for(A=s=d[f],i=1;s>=10;s/=10,i++);h=(a=(o%=14)-14+i)<0?0:A/p[i-a-1]%10|0}if(n=n||t<0||null!=d[f+1]||(a<0?A:A%p[i-a-1]),n=r<4?(h||n)&&(0==r||r==(e.s<0?3:2)):h>5||5==h&&(4==r||n||6==r&&(o>0?a>0?A/p[i-a]:0:d[f-1])%10&1||r==(e.s<0?8:7)),t<1||!d[0])return d.length=0,n?(t-=e.e+1,d[0]=p[(14-t%14)%14],e.e=-t||0):d[0]=e.e=0,e;if(0==o?(d.length=f,s=1,f--):(d.length=f+1,s=p[14-o],d[f]=a>0?u(A/p[i-a]%p[a])*s:0),n)for(;;){if(0==f){for(o=1,a=d[0];a>=10;a/=10,o++);for(a=d[0]+=s,s=1;a>=10;a/=10,s++);o!=s&&(e.e++,d[0]==l&&(d[0]=1));break}if(d[f]+=s,d[f]!=l)break;d[f--]=0,s=1}for(o=d.length;0===d[--o];d.pop());}e.e>N?e.c=e.e=null:e.e<O&&(e.c=[e.e=0])}return e}function q(e){var t,r=e.e;return null===r?e.toString():(t=I(e.c),t=r<=R||r>=x?m(t,r):C(t,r,"0"),e.s<0?"-"+t:t)}return L.clone=e,L.ROUND_UP=0,L.ROUND_DOWN=1,L.ROUND_CEIL=2,L.ROUND_FLOOR=3,L.ROUND_HALF_UP=4,L.ROUND_HALF_DOWN=5,L.ROUND_HALF_EVEN=6,L.ROUND_HALF_CEIL=7,L.ROUND_HALF_FLOOR=8,L.EUCLID=9,L.config=L.set=function(e){var t,r;if(null!=e){if("object"!=i(e))throw Error(f+"Object expected: "+e);if(e.hasOwnProperty(t="DECIMAL_PLACES")&&(b(r=e[t],0,d,t),D=r),e.hasOwnProperty(t="ROUNDING_MODE")&&(b(r=e[t],0,8,t),M=r),e.hasOwnProperty(t="EXPONENTIAL_AT")&&((r=e[t])&&r.pop?(b(r[0],-d,0,t),b(r[1],0,d,t),R=r[0],x=r[1]):(b(r,-d,d,t),R=-(x=r<0?-r:r))),e.hasOwnProperty(t="RANGE"))if((r=e[t])&&r.pop)b(r[0],-d,-1,t),b(r[1],1,d,t),O=r[0],N=r[1];else{if(b(r,-d,d,t),!r)throw Error(f+t+" cannot be zero: "+r);O=-(N=r<0?-r:r)}if(e.hasOwnProperty(t="CRYPTO")){if((r=e[t])!==!!r)throw Error(f+t+" not true or false: "+r);if(r){if("undefined"==typeof crypto||!crypto||!crypto.getRandomValues&&!crypto.randomBytes)throw P=!r,Error(f+"crypto unavailable");P=r}else P=r}if(e.hasOwnProperty(t="MODULO_MODE")&&(b(r=e[t],0,9,t),F=r),e.hasOwnProperty(t="POW_PRECISION")&&(b(r=e[t],0,d,t),j=r),e.hasOwnProperty(t="FORMAT")){if("object"!=i(r=e[t]))throw Error(f+t+" not an object: "+r);T=r}if(e.hasOwnProperty(t="ALPHABET")){if("string"!=typeof(r=e[t])||/^.$|[+-.\s]|(.).*\1/.test(r))throw Error(f+t+" invalid: "+r);U=r}}return{DECIMAL_PLACES:D,ROUNDING_MODE:M,EXPONENTIAL_AT:[R,x],RANGE:[O,N],CRYPTO:P,MODULO_MODE:F,POW_PRECISION:j,FORMAT:T,ALPHABET:U}},L.isBigNumber=function(e){if(!e||!0!==e._isBigNumber)return!1;if(!L.DEBUG)return!0;var t,r,n=e.c,i=e.e,o=e.s;e:if("[object Array]"=={}.toString.call(n)){if((1===o||-1===o)&&i>=-d&&i<=d&&i===u(i)){if(0===n[0]){if(0===i&&1===n.length)return!0;break e}if((t=(i+1)%14)<1&&(t+=14),String(n[0]).length==t){for(t=0;t<n.length;t++)if((r=n[t])<0||r>=l||r!==u(r))break e;if(0!==r)return!0}}}else if(null===n&&null===i&&(null===o||1===o||-1===o))return!0;throw Error(f+"Invalid BigNumber: "+e)},L.maximum=L.max=function(){return G(arguments,_.lt)},L.minimum=L.min=function(){return G(arguments,_.gt)},L.random=(a=9007199254740992*Math.random()&2097151?function(){return u(9007199254740992*Math.random())}:function(){return 8388608*(1073741824*Math.random()|0)+(8388608*Math.random()|0)},function(e){var t,r,n,i,o,s=0,A=[],h=new L(S);if(null==e?e=D:b(e,0,d),i=c(e/14),P)if(crypto.getRandomValues){for(t=crypto.getRandomValues(new Uint32Array(i*=2));s<i;)(o=131072*t[s]+(t[s+1]>>>11))>=9e15?(r=crypto.getRandomValues(new Uint32Array(2)),t[s]=r[0],t[s+1]=r[1]):(A.push(o%1e14),s+=2);s=i/2}else{if(!crypto.randomBytes)throw P=!1,Error(f+"crypto unavailable");for(t=crypto.randomBytes(i*=7);s<i;)(o=281474976710656*(31&t[s])+1099511627776*t[s+1]+4294967296*t[s+2]+16777216*t[s+3]+(t[s+4]<<16)+(t[s+5]<<8)+t[s+6])>=9e15?crypto.randomBytes(7).copy(t,s):(A.push(o%1e14),s+=7);s=i/7}if(!P)for(;s<i;)(o=a())<9e15&&(A[s++]=o%1e14);for(e%=14,(i=A[--s])&&e&&(o=g[14-e],A[s]=u(i/o)*o);0===A[s];A.pop(),s--);if(s<0)A=[n=0];else{for(n=-1;0===A[0];A.splice(0,1),n-=14);for(s=1,o=A[0];o>=10;o/=10,s++);s<14&&(n-=14-s)}return h.e=n,h.c=A,h}),L.sum=function(){for(var e=1,t=arguments,r=new L(t[0]);e<t.length;)r=r.plus(t[e++]);return r},n=function(){function e(e,t,r,n){for(var i,o,a=[0],s=0,A=e.length;s<A;){for(o=a.length;o--;a[o]*=t);for(a[0]+=n.indexOf(e.charAt(s++)),i=0;i<a.length;i++)a[i]>r-1&&(null==a[i+1]&&(a[i+1]=0),a[i+1]+=a[i]/r|0,a[i]%=r)}return a.reverse()}return function(t,n,i,o,a){var s,A,c,u,f,h,l,g,d=t.indexOf("."),p=D,y=M;for(d>=0&&(u=j,j=0,t=t.replace(".",""),h=(g=new L(n)).pow(t.length-d),j=u,g.c=e(C(I(h.c),h.e,"0"),10,i,"0123456789"),g.e=g.c.length),c=u=(l=e(t,n,i,a?(s=U,"0123456789"):(s="0123456789",U))).length;0==l[--u];l.pop());if(!l[0])return s.charAt(0);if(d<0?--c:(h.c=l,h.e=c,h.s=o,l=(h=r(h,g,p,y,i)).c,f=h.r,c=h.e),d=l[A=c+p+1],u=i/2,f=f||A<0||null!=l[A+1],f=y<4?(null!=d||f)&&(0==y||y==(h.s<0?3:2)):d>u||d==u&&(4==y||f||6==y&&1&l[A-1]||y==(h.s<0?8:7)),A<1||!l[0])t=f?C(s.charAt(1),-p,s.charAt(0)):s.charAt(0);else{if(l.length=A,f)for(--i;++l[--A]>i;)l[A]=0,A||(++c,l=[1].concat(l));for(u=l.length;!l[--u];);for(d=0,t="";d<=u;t+=s.charAt(l[d++]));t=C(t,c,s.charAt(0))}return t}}(),r=function(){function e(e,t,r){var n,i,o,a,s=0,A=e.length,c=t%1e7,u=t/1e7|0;for(e=e.slice();A--;)s=((i=c*(o=e[A]%1e7)+(n=u*o+(a=e[A]/1e7|0)*c)%1e7*1e7+s)/r|0)+(n/1e7|0)+u*a,e[A]=i%r;return s&&(e=[s].concat(e)),e}function t(e,t,r,n){var i,o;if(r!=n)o=r>n?1:-1;else for(i=o=0;i<r;i++)if(e[i]!=t[i]){o=e[i]>t[i]?1:-1;break}return o}function r(e,t,r,n){for(var i=0;r--;)e[r]-=i,i=e[r]<t[r]?1:0,e[r]=i*n+e[r]-t[r];for(;!e[0]&&e.length>1;e.splice(0,1));}return function(n,i,o,a,s){var A,c,f,h,g,d,I,y,b,E,m,C,v,B,w,Q,k,_=n.s==i.s?1:-1,S=n.c,D=i.c;if(!(S&&S[0]&&D&&D[0]))return new L(n.s&&i.s&&(S?!D||S[0]!=D[0]:D)?S&&0==S[0]||!D?0*_:_/0:NaN);for(b=(y=new L(_)).c=[],_=o+(c=n.e-i.e)+1,s||(s=l,c=p(n.e/14)-p(i.e/14),_=_/14|0),f=0;D[f]==(S[f]||0);f++);if(D[f]>(S[f]||0)&&c--,_<0)b.push(1),h=!0;else{for(B=S.length,Q=D.length,f=0,_+=2,(g=u(s/(D[0]+1)))>1&&(D=e(D,g,s),S=e(S,g,s),Q=D.length,B=S.length),v=Q,m=(E=S.slice(0,Q)).length;m<Q;E[m++]=0);k=D.slice(),k=[0].concat(k),w=D[0],D[1]>=s/2&&w++;do{if(g=0,(A=t(D,E,Q,m))<0){if(C=E[0],Q!=m&&(C=C*s+(E[1]||0)),(g=u(C/w))>1)for(g>=s&&(g=s-1),I=(d=e(D,g,s)).length,m=E.length;1==t(d,E,I,m);)g--,r(d,Q<I?k:D,I,s),I=d.length,A=1;else 0==g&&(A=g=1),I=(d=D.slice()).length;if(I<m&&(d=[0].concat(d)),r(E,d,m,s),m=E.length,-1==A)for(;t(D,E,Q,m)<1;)g++,r(E,Q<m?k:D,m,s),m=E.length}else 0===A&&(g++,E=[0]);b[f++]=g,E[0]?E[m++]=S[v]||0:(E=[S[v]],m=1)}while((v++<B||null!=E[0])&&_--);h=null!=E[0],b[0]||b.splice(0,1)}if(s==l){for(f=1,_=b[0];_>=10;_/=10,f++);K(y,o+(y.e=f+14*c-1)+1,a,h)}else y.e=c,y.r=+h;return y}}(),v=/^(-?)0([xbo])(?=\w[\w.]*$)/i,B=/^([^.]+)\.$/,w=/^\.([^.]+)$/,Q=/^-?(Infinity|NaN)$/,k=/^\s*\+(?=[\w.])|^\s+|\s+$/g,o=function(e,t,r,n){var i,o=r?t:t.replace(k,"");if(Q.test(o))e.s=isNaN(o)?null:o<0?-1:1;else{if(!r&&(o=o.replace(v,(function(e,t,r){return i="x"==(r=r.toLowerCase())?16:"b"==r?2:8,n&&n!=i?e:t})),n&&(i=n,o=o.replace(B,"$1").replace(w,"0.$1")),t!=o))return new L(o,i);if(L.DEBUG)throw Error(f+"Not a"+(n?" base "+n:"")+" number: "+t);e.s=null}e.c=e.e=null},_.absoluteValue=_.abs=function(){var e=new L(this);return e.s<0&&(e.s=1),e},_.comparedTo=function(e,t){return y(this,new L(e,t))},_.decimalPlaces=_.dp=function(e,t){var r,n,i,o=this;if(null!=e)return b(e,0,d),null==t?t=M:b(t,0,8),K(new L(o),e+o.e+1,t);if(!(r=o.c))return null;if(n=14*((i=r.length-1)-p(this.e/14)),i=r[i])for(;i%10==0;i/=10,n--);return n<0&&(n=0),n},_.dividedBy=_.div=function(e,t){return r(this,new L(e,t),D,M)},_.dividedToIntegerBy=_.idiv=function(e,t){return r(this,new L(e,t),0,1)},_.exponentiatedBy=_.pow=function(e,t){var r,n,i,o,a,s,A,h,l=this;if((e=new L(e)).c&&!e.isInteger())throw Error(f+"Exponent not an integer: "+q(e));if(null!=t&&(t=new L(t)),a=e.e>14,!l.c||!l.c[0]||1==l.c[0]&&!l.e&&1==l.c.length||!e.c||!e.c[0])return h=new L(Math.pow(+q(l),a?2-E(e):+q(e))),t?h.mod(t):h;if(s=e.s<0,t){if(t.c?!t.c[0]:!t.s)return new L(NaN);(n=!s&&l.isInteger()&&t.isInteger())&&(l=l.mod(t))}else{if(e.e>9&&(l.e>0||l.e<-1||(0==l.e?l.c[0]>1||a&&l.c[1]>=24e7:l.c[0]<8e13||a&&l.c[0]<=9999975e7)))return o=l.s<0&&E(e)?-0:0,l.e>-1&&(o=1/o),new L(s?1/o:o);j&&(o=c(j/14+2))}for(a?(r=new L(.5),s&&(e.s=1),A=E(e)):A=(i=Math.abs(+q(e)))%2,h=new L(S);;){if(A){if(!(h=h.times(l)).c)break;o?h.c.length>o&&(h.c.length=o):n&&(h=h.mod(t))}if(i){if(0===(i=u(i/2)))break;A=i%2}else if(K(e=e.times(r),e.e+1,1),e.e>14)A=E(e);else{if(0===(i=+q(e)))break;A=i%2}l=l.times(l),o?l.c&&l.c.length>o&&(l.c.length=o):n&&(l=l.mod(t))}return n?h:(s&&(h=S.div(h)),t?h.mod(t):o?K(h,j,M,void 0):h)},_.integerValue=function(e){var t=new L(this);return null==e?e=M:b(e,0,8),K(t,t.e+1,e)},_.isEqualTo=_.eq=function(e,t){return 0===y(this,new L(e,t))},_.isFinite=function(){return!!this.c},_.isGreaterThan=_.gt=function(e,t){return y(this,new L(e,t))>0},_.isGreaterThanOrEqualTo=_.gte=function(e,t){return 1===(t=y(this,new L(e,t)))||0===t},_.isInteger=function(){return!!this.c&&p(this.e/14)>this.c.length-2},_.isLessThan=_.lt=function(e,t){return y(this,new L(e,t))<0},_.isLessThanOrEqualTo=_.lte=function(e,t){return-1===(t=y(this,new L(e,t)))||0===t},_.isNaN=function(){return!this.s},_.isNegative=function(){return this.s<0},_.isPositive=function(){return this.s>0},_.isZero=function(){return!!this.c&&0==this.c[0]},_.minus=function(e,t){var r,n,i,o,a=this,s=a.s;if(t=(e=new L(e,t)).s,!s||!t)return new L(NaN);if(s!=t)return e.s=-t,a.plus(e);var A=a.e/14,c=e.e/14,u=a.c,f=e.c;if(!A||!c){if(!u||!f)return u?(e.s=-t,e):new L(f?a:NaN);if(!u[0]||!f[0])return f[0]?(e.s=-t,e):new L(u[0]?a:3==M?-0:0)}if(A=p(A),c=p(c),u=u.slice(),s=A-c){for((o=s<0)?(s=-s,i=u):(c=A,i=f),i.reverse(),t=s;t--;i.push(0));i.reverse()}else for(n=(o=(s=u.length)<(t=f.length))?s:t,s=t=0;t<n;t++)if(u[t]!=f[t]){o=u[t]<f[t];break}if(o&&(i=u,u=f,f=i,e.s=-e.s),(t=(n=f.length)-(r=u.length))>0)for(;t--;u[r++]=0);for(t=l-1;n>s;){if(u[--n]<f[n]){for(r=n;r&&!u[--r];u[r]=t);--u[r],u[n]+=l}u[n]-=f[n]}for(;0==u[0];u.splice(0,1),--c);return u[0]?Y(e,u,c):(e.s=3==M?-1:1,e.c=[e.e=0],e)},_.modulo=_.mod=function(e,t){var n,i,o=this;return e=new L(e,t),!o.c||!e.s||e.c&&!e.c[0]?new L(NaN):!e.c||o.c&&!o.c[0]?new L(o):(9==F?(i=e.s,e.s=1,n=r(o,e,0,3),e.s=i,n.s*=i):n=r(o,e,0,F),(e=o.minus(n.times(e))).c[0]||1!=F||(e.s=o.s),e)},_.multipliedBy=_.times=function(e,t){var r,n,i,o,a,s,A,c,u,f,h,g,d,I,y=this,b=y.c,E=(e=new L(e,t)).c;if(!(b&&E&&b[0]&&E[0]))return!y.s||!e.s||b&&!b[0]&&!E||E&&!E[0]&&!b?e.c=e.e=e.s=null:(e.s*=y.s,b&&E?(e.c=[0],e.e=0):e.c=e.e=null),e;for(n=p(y.e/14)+p(e.e/14),e.s*=y.s,(A=b.length)<(f=E.length)&&(d=b,b=E,E=d,i=A,A=f,f=i),i=A+f,d=[];i--;d.push(0));for(I=l,1e7,i=f;--i>=0;){for(r=0,h=E[i]%1e7,g=E[i]/1e7|0,o=i+(a=A);o>i;)r=((c=h*(c=b[--a]%1e7)+(s=g*c+(u=b[a]/1e7|0)*h)%1e7*1e7+d[o]+r)/I|0)+(s/1e7|0)+g*u,d[o--]=c%I;d[o]=r}return r?++n:d.splice(0,1),Y(e,d,n)},_.negated=function(){var e=new L(this);return e.s=-e.s||null,e},_.plus=function(e,t){var r,n=this,i=n.s;if(t=(e=new L(e,t)).s,!i||!t)return new L(NaN);if(i!=t)return e.s=-t,n.minus(e);var o=n.e/14,a=e.e/14,s=n.c,A=e.c;if(!o||!a){if(!s||!A)return new L(i/0);if(!s[0]||!A[0])return A[0]?e:new L(s[0]?n:0*i)}if(o=p(o),a=p(a),s=s.slice(),i=o-a){for(i>0?(a=o,r=A):(i=-i,r=s),r.reverse();i--;r.push(0));r.reverse()}for((i=s.length)-(t=A.length)<0&&(r=A,A=s,s=r,t=i),i=0;t;)i=(s[--t]=s[t]+A[t]+i)/l|0,s[t]=l===s[t]?0:s[t]%l;return i&&(s=[i].concat(s),++a),Y(e,s,a)},_.precision=_.sd=function(e,t){var r,n,i,o=this;if(null!=e&&e!==!!e)return b(e,1,d),null==t?t=M:b(t,0,8),K(new L(o),e,t);if(!(r=o.c))return null;if(n=14*(i=r.length-1)+1,i=r[i]){for(;i%10==0;i/=10,n--);for(i=r[0];i>=10;i/=10,n++);}return e&&o.e+1>n&&(n=o.e+1),n},_.shiftedBy=function(e){return b(e,-9007199254740991,9007199254740991),this.times("1e"+e)},_.squareRoot=_.sqrt=function(){var e,t,n,i,o,a=this,s=a.c,A=a.s,c=a.e,u=D+4,f=new L("0.5");if(1!==A||!s||!s[0])return new L(!A||A<0&&(!s||s[0])?NaN:s?a:1/0);if(0==(A=Math.sqrt(+q(a)))||A==1/0?(((t=I(s)).length+c)%2==0&&(t+="0"),A=Math.sqrt(+t),c=p((c+1)/2)-(c<0||c%2),n=new L(t=A==1/0?"1e"+c:(t=A.toExponential()).slice(0,t.indexOf("e")+1)+c)):n=new L(A+""),n.c[0])for((A=(c=n.e)+u)<3&&(A=0);;)if(o=n,n=f.times(o.plus(r(a,o,u,1))),I(o.c).slice(0,A)===(t=I(n.c)).slice(0,A)){if(n.e<c&&--A,"9999"!=(t=t.slice(A-3,A+1))&&(i||"4999"!=t)){+t&&(+t.slice(1)||"5"!=t.charAt(0))||(K(n,n.e+D+2,1),e=!n.times(n).eq(a));break}if(!i&&(K(o,o.e+D+2,0),o.times(o).eq(a))){n=o;break}u+=4,A+=4,i=1}return K(n,n.e+D+1,M,e)},_.toExponential=function(e,t){return null!=e&&(b(e,0,d),e++),H(this,e,t,1)},_.toFixed=function(e,t){return null!=e&&(b(e,0,d),e=e+this.e+1),H(this,e,t)},_.toFormat=function(e,t,r){var n,o=this;if(null==r)null!=e&&t&&"object"==i(t)?(r=t,t=null):e&&"object"==i(e)?(r=e,e=t=null):r=T;else if("object"!=i(r))throw Error(f+"Argument not an object: "+r);if(n=o.toFixed(e,t),o.c){var a,s=n.split("."),A=+r.groupSize,c=+r.secondaryGroupSize,u=r.groupSeparator||"",h=s[0],l=s[1],g=o.s<0,d=g?h.slice(1):h,p=d.length;if(c&&(a=A,A=c,c=a,p-=a),A>0&&p>0){for(a=p%A||A,h=d.substr(0,a);a<p;a+=A)h+=u+d.substr(a,A);c>0&&(h+=u+d.slice(a)),g&&(h="-"+h)}n=l?h+(r.decimalSeparator||"")+((c=+r.fractionGroupSize)?l.replace(new RegExp("\\d{"+c+"}\\B","g"),"$&"+(r.fractionGroupSeparator||"")):l):h}return(r.prefix||"")+n+(r.suffix||"")},_.toFraction=function(e){var t,n,i,o,a,s,A,c,u,h,l,d,p=this,y=p.c;if(null!=e&&(!(A=new L(e)).isInteger()&&(A.c||1!==A.s)||A.lt(S)))throw Error(f+"Argument "+(A.isInteger()?"out of range: ":"not an integer: ")+q(A));if(!y)return new L(p);for(t=new L(S),u=n=new L(S),i=c=new L(S),d=I(y),a=t.e=d.length-p.e-1,t.c[0]=g[(s=a%14)<0?14+s:s],e=!e||A.comparedTo(t)>0?a>0?t:u:A,s=N,N=1/0,A=new L(d),c.c[0]=0;h=r(A,t,0,1),1!=(o=n.plus(h.times(i))).comparedTo(e);)n=i,i=o,u=c.plus(h.times(o=u)),c=o,t=A.minus(h.times(o=t)),A=o;return o=r(e.minus(n),i,0,1),c=c.plus(o.times(u)),n=n.plus(o.times(i)),c.s=u.s=p.s,l=r(u,i,a*=2,M).minus(p).abs().comparedTo(r(c,n,a,M).minus(p).abs())<1?[u,i]:[c,n],N=s,l},_.toNumber=function(){return+q(this)},_.toPrecision=function(e,t){return null!=e&&b(e,1,d),H(this,e,t,2)},_.toString=function(e){var t,r=this,i=r.s,o=r.e;return null===o?i?(t="Infinity",i<0&&(t="-"+t)):t="NaN":(null==e?t=o<=R||o>=x?m(I(r.c),o):C(I(r.c),o,"0"):10===e?t=C(I((r=K(new L(r),D+o+1,M)).c),r.e,"0"):(b(e,2,U.length,"Base"),t=n(C(I(r.c),o,"0"),10,e,i,!0)),i<0&&r.c[0]&&(t="-"+t)),t},_.valueOf=_.toJSON=function(){return q(this)},_._isBigNumber=!0,A&&(_[Symbol.toStringTag]="BigNumber",_[Symbol.for("nodejs.util.inspect.custom")]=_.valueOf),null!=t&&L.set(t),L}()).default=a.BigNumber=a,void 0===(n=function(){return a}.call(t,r,t,e))||(e.exports=n)}()},function(e,t,r){e.exports={encode:r(183),decode:r(184),encodingLength:r(185)}},function(e,t){e.exports=function e(t,n,i){n=n||[];var o=i=i||0;for(;t>=r;)n[i++]=255&t|128,t/=128;for(;-128&t;)n[i++]=255&t|128,t>>>=7;return n[i]=0|t,e.bytes=i-o+1,n};var r=Math.pow(2,31)},function(e,t){e.exports=function e(t,r){var n,i=0,o=0,a=r=r||0,s=t.length;do{if(a>=s)throw e.bytes=0,new RangeError("Could not decode varint");n=t[a++],i+=o<28?(127&n)<<o:(127&n)*Math.pow(2,o),o+=7}while(n>=128);return e.bytes=a-r,i}},function(e,t){var r=Math.pow(2,7),n=Math.pow(2,14),i=Math.pow(2,21),o=Math.pow(2,28),a=Math.pow(2,35),s=Math.pow(2,42),A=Math.pow(2,49),c=Math.pow(2,56),u=Math.pow(2,63);e.exports=function(e){return e<r?1:e<n?2:e<i?3:e<o?4:e<a?5:e<s?6:e<A?7:e<c?8:e<u?9:10}},function(e,t,r){"use strict";r.r(t),r.d(t,"Deflate",(function(){return zt})),r.d(t,"Inflate",(function(){return Xt})),r.d(t,"constants",(function(){return rr})),r.d(t,"default",(function(){return nr})),r.d(t,"deflate",(function(){return Vt})),r.d(t,"deflateRaw",(function(){return Zt})),r.d(t,"gzip",(function(){return Wt})),r.d(t,"inflate",(function(){return $t})),r.d(t,"inflateRaw",(function(){return er})),r.d(t,"ungzip",(function(){return tr}));function n(e){let t=e.length;for(;--t>=0;)e[t]=0}const i=new Uint8Array([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0]),o=new Uint8Array([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13]),a=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),s=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),A=new Array(576);n(A);const c=new Array(60);n(c);const u=new Array(512);n(u);const f=new Array(256);n(f);const h=new Array(29);n(h);const l=new Array(30);function g(e,t,r,n,i){this.static_tree=e,this.extra_bits=t,this.extra_base=r,this.elems=n,this.max_length=i,this.has_stree=e&&e.length}let d,p,I;function y(e,t){this.dyn_tree=e,this.max_code=0,this.stat_desc=t}n(l);const b=e=>e<256?u[e]:u[256+(e>>>7)],E=(e,t)=>{e.pending_buf[e.pending++]=255&t,e.pending_buf[e.pending++]=t>>>8&255},m=(e,t,r)=>{e.bi_valid>16-r?(e.bi_buf|=t<<e.bi_valid&65535,E(e,e.bi_buf),e.bi_buf=t>>16-e.bi_valid,e.bi_valid+=r-16):(e.bi_buf|=t<<e.bi_valid&65535,e.bi_valid+=r)},C=(e,t,r)=>{m(e,r[2*t],r[2*t+1])},v=(e,t)=>{let r=0;do{r|=1&e,e>>>=1,r<<=1}while(--t>0);return r>>>1},B=(e,t,r)=>{const n=new Array(16);let i,o,a=0;for(i=1;i<=15;i++)n[i]=a=a+r[i-1]<<1;for(o=0;o<=t;o++){let t=e[2*o+1];0!==t&&(e[2*o]=v(n[t]++,t))}},w=e=>{let t;for(t=0;t<286;t++)e.dyn_ltree[2*t]=0;for(t=0;t<30;t++)e.dyn_dtree[2*t]=0;for(t=0;t<19;t++)e.bl_tree[2*t]=0;e.dyn_ltree[512]=1,e.opt_len=e.static_len=0,e.last_lit=e.matches=0},Q=e=>{e.bi_valid>8?E(e,e.bi_buf):e.bi_valid>0&&(e.pending_buf[e.pending++]=e.bi_buf),e.bi_buf=0,e.bi_valid=0},k=(e,t,r,n)=>{const i=2*t,o=2*r;return e[i]<e[o]||e[i]===e[o]&&n[t]<=n[r]},_=(e,t,r)=>{const n=e.heap[r];let i=r<<1;for(;i<=e.heap_len&&(i<e.heap_len&&k(t,e.heap[i+1],e.heap[i],e.depth)&&i++,!k(t,n,e.heap[i],e.depth));)e.heap[r]=e.heap[i],r=i,i<<=1;e.heap[r]=n},S=(e,t,r)=>{let n,a,s,A,c=0;if(0!==e.last_lit)do{n=e.pending_buf[e.d_buf+2*c]<<8|e.pending_buf[e.d_buf+2*c+1],a=e.pending_buf[e.l_buf+c],c++,0===n?C(e,a,t):(s=f[a],C(e,s+256+1,t),A=i[s],0!==A&&(a-=h[s],m(e,a,A)),n--,s=b(n),C(e,s,r),A=o[s],0!==A&&(n-=l[s],m(e,n,A)))}while(c<e.last_lit);C(e,256,t)},D=(e,t)=>{const r=t.dyn_tree,n=t.stat_desc.static_tree,i=t.stat_desc.has_stree,o=t.stat_desc.elems;let a,s,A,c=-1;for(e.heap_len=0,e.heap_max=573,a=0;a<o;a++)0!==r[2*a]?(e.heap[++e.heap_len]=c=a,e.depth[a]=0):r[2*a+1]=0;for(;e.heap_len<2;)A=e.heap[++e.heap_len]=c<2?++c:0,r[2*A]=1,e.depth[A]=0,e.opt_len--,i&&(e.static_len-=n[2*A+1]);for(t.max_code=c,a=e.heap_len>>1;a>=1;a--)_(e,r,a);A=o;do{a=e.heap[1],e.heap[1]=e.heap[e.heap_len--],_(e,r,1),s=e.heap[1],e.heap[--e.heap_max]=a,e.heap[--e.heap_max]=s,r[2*A]=r[2*a]+r[2*s],e.depth[A]=(e.depth[a]>=e.depth[s]?e.depth[a]:e.depth[s])+1,r[2*a+1]=r[2*s+1]=A,e.heap[1]=A++,_(e,r,1)}while(e.heap_len>=2);e.heap[--e.heap_max]=e.heap[1],((e,t)=>{const r=t.dyn_tree,n=t.max_code,i=t.stat_desc.static_tree,o=t.stat_desc.has_stree,a=t.stat_desc.extra_bits,s=t.stat_desc.extra_base,A=t.stat_desc.max_length;let c,u,f,h,l,g,d=0;for(h=0;h<=15;h++)e.bl_count[h]=0;for(r[2*e.heap[e.heap_max]+1]=0,c=e.heap_max+1;c<573;c++)u=e.heap[c],h=r[2*r[2*u+1]+1]+1,h>A&&(h=A,d++),r[2*u+1]=h,u>n||(e.bl_count[h]++,l=0,u>=s&&(l=a[u-s]),g=r[2*u],e.opt_len+=g*(h+l),o&&(e.static_len+=g*(i[2*u+1]+l)));if(0!==d){do{for(h=A-1;0===e.bl_count[h];)h--;e.bl_count[h]--,e.bl_count[h+1]+=2,e.bl_count[A]--,d-=2}while(d>0);for(h=A;0!==h;h--)for(u=e.bl_count[h];0!==u;)f=e.heap[--c],f>n||(r[2*f+1]!==h&&(e.opt_len+=(h-r[2*f+1])*r[2*f],r[2*f+1]=h),u--)}})(e,t),B(r,c,e.bl_count)},M=(e,t,r)=>{let n,i,o=-1,a=t[1],s=0,A=7,c=4;for(0===a&&(A=138,c=3),t[2*(r+1)+1]=65535,n=0;n<=r;n++)i=a,a=t[2*(n+1)+1],++s<A&&i===a||(s<c?e.bl_tree[2*i]+=s:0!==i?(i!==o&&e.bl_tree[2*i]++,e.bl_tree[32]++):s<=10?e.bl_tree[34]++:e.bl_tree[36]++,s=0,o=i,0===a?(A=138,c=3):i===a?(A=6,c=3):(A=7,c=4))},R=(e,t,r)=>{let n,i,o=-1,a=t[1],s=0,A=7,c=4;for(0===a&&(A=138,c=3),n=0;n<=r;n++)if(i=a,a=t[2*(n+1)+1],!(++s<A&&i===a)){if(s<c)do{C(e,i,e.bl_tree)}while(0!=--s);else 0!==i?(i!==o&&(C(e,i,e.bl_tree),s--),C(e,16,e.bl_tree),m(e,s-3,2)):s<=10?(C(e,17,e.bl_tree),m(e,s-3,3)):(C(e,18,e.bl_tree),m(e,s-11,7));s=0,o=i,0===a?(A=138,c=3):i===a?(A=6,c=3):(A=7,c=4)}};let x=!1;const O=(e,t,r,n)=>{m(e,0+(n?1:0),3),((e,t,r,n)=>{Q(e),n&&(E(e,r),E(e,~r)),e.pending_buf.set(e.window.subarray(t,t+r),e.pending),e.pending+=r})(e,t,r,!0)};var N={_tr_init:e=>{x||((()=>{let e,t,r,n,s;const y=new Array(16);for(r=0,n=0;n<28;n++)for(h[n]=r,e=0;e<1<<i[n];e++)f[r++]=n;for(f[r-1]=n,s=0,n=0;n<16;n++)for(l[n]=s,e=0;e<1<<o[n];e++)u[s++]=n;for(s>>=7;n<30;n++)for(l[n]=s<<7,e=0;e<1<<o[n]-7;e++)u[256+s++]=n;for(t=0;t<=15;t++)y[t]=0;for(e=0;e<=143;)A[2*e+1]=8,e++,y[8]++;for(;e<=255;)A[2*e+1]=9,e++,y[9]++;for(;e<=279;)A[2*e+1]=7,e++,y[7]++;for(;e<=287;)A[2*e+1]=8,e++,y[8]++;for(B(A,287,y),e=0;e<30;e++)c[2*e+1]=5,c[2*e]=v(e,5);d=new g(A,i,257,286,15),p=new g(c,o,0,30,15),I=new g(new Array(0),a,0,19,7)})(),x=!0),e.l_desc=new y(e.dyn_ltree,d),e.d_desc=new y(e.dyn_dtree,p),e.bl_desc=new y(e.bl_tree,I),e.bi_buf=0,e.bi_valid=0,w(e)},_tr_stored_block:O,_tr_flush_block:(e,t,r,n)=>{let i,o,a=0;e.level>0?(2===e.strm.data_type&&(e.strm.data_type=(e=>{let t,r=4093624447;for(t=0;t<=31;t++,r>>>=1)if(1&r&&0!==e.dyn_ltree[2*t])return 0;if(0!==e.dyn_ltree[18]||0!==e.dyn_ltree[20]||0!==e.dyn_ltree[26])return 1;for(t=32;t<256;t++)if(0!==e.dyn_ltree[2*t])return 1;return 0})(e)),D(e,e.l_desc),D(e,e.d_desc),a=(e=>{let t;for(M(e,e.dyn_ltree,e.l_desc.max_code),M(e,e.dyn_dtree,e.d_desc.max_code),D(e,e.bl_desc),t=18;t>=3&&0===e.bl_tree[2*s[t]+1];t--);return e.opt_len+=3*(t+1)+5+5+4,t})(e),i=e.opt_len+3+7>>>3,o=e.static_len+3+7>>>3,o<=i&&(i=o)):i=o=r+5,r+4<=i&&-1!==t?O(e,t,r,n):4===e.strategy||o===i?(m(e,2+(n?1:0),3),S(e,A,c)):(m(e,4+(n?1:0),3),((e,t,r,n)=>{let i;for(m(e,t-257,5),m(e,r-1,5),m(e,n-4,4),i=0;i<n;i++)m(e,e.bl_tree[2*s[i]+1],3);R(e,e.dyn_ltree,t-1),R(e,e.dyn_dtree,r-1)})(e,e.l_desc.max_code+1,e.d_desc.max_code+1,a+1),S(e,e.dyn_ltree,e.dyn_dtree)),w(e),n&&Q(e)},_tr_tally:(e,t,r)=>(e.pending_buf[e.d_buf+2*e.last_lit]=t>>>8&255,e.pending_buf[e.d_buf+2*e.last_lit+1]=255&t,e.pending_buf[e.l_buf+e.last_lit]=255&r,e.last_lit++,0===t?e.dyn_ltree[2*r]++:(e.matches++,t--,e.dyn_ltree[2*(f[r]+256+1)]++,e.dyn_dtree[2*b(t)]++),e.last_lit===e.lit_bufsize-1),_tr_align:e=>{m(e,2,3),C(e,256,A),(e=>{16===e.bi_valid?(E(e,e.bi_buf),e.bi_buf=0,e.bi_valid=0):e.bi_valid>=8&&(e.pending_buf[e.pending++]=255&e.bi_buf,e.bi_buf>>=8,e.bi_valid-=8)})(e)}};var P=(e,t,r,n)=>{let i=65535&e|0,o=e>>>16&65535|0,a=0;for(;0!==r;){a=r>2e3?2e3:r,r-=a;do{i=i+t[n++]|0,o=o+i|0}while(--a);i%=65521,o%=65521}return i|o<<16|0};const F=new Uint32Array((()=>{let e,t=[];for(var r=0;r<256;r++){e=r;for(var n=0;n<8;n++)e=1&e?3988292384^e>>>1:e>>>1;t[r]=e}return t})());var j=(e,t,r,n)=>{const i=F,o=n+r;e^=-1;for(let r=n;r<o;r++)e=e>>>8^i[255&(e^t[r])];return-1^e},T={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"},U={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8};const{_tr_init:L,_tr_stored_block:H,_tr_flush_block:G,_tr_tally:Y,_tr_align:K}=N,{Z_NO_FLUSH:q,Z_PARTIAL_FLUSH:J,Z_FULL_FLUSH:z,Z_FINISH:V,Z_BLOCK:Z,Z_OK:W,Z_STREAM_END:X,Z_STREAM_ERROR:$,Z_DATA_ERROR:ee,Z_BUF_ERROR:te,Z_DEFAULT_COMPRESSION:re,Z_FILTERED:ne,Z_HUFFMAN_ONLY:ie,Z_RLE:oe,Z_FIXED:ae,Z_DEFAULT_STRATEGY:se,Z_UNKNOWN:Ae,Z_DEFLATED:ce}=U,ue=(e,t)=>(e.msg=T[t],t),fe=e=>(e<<1)-(e>4?9:0),he=e=>{let t=e.length;for(;--t>=0;)e[t]=0};let le=(e,t,r)=>(t<<e.hash_shift^r)&e.hash_mask;const ge=e=>{const t=e.state;let r=t.pending;r>e.avail_out&&(r=e.avail_out),0!==r&&(e.output.set(t.pending_buf.subarray(t.pending_out,t.pending_out+r),e.next_out),e.next_out+=r,t.pending_out+=r,e.total_out+=r,e.avail_out-=r,t.pending-=r,0===t.pending&&(t.pending_out=0))},de=(e,t)=>{G(e,e.block_start>=0?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,ge(e.strm)},pe=(e,t)=>{e.pending_buf[e.pending++]=t},Ie=(e,t)=>{e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=255&t},ye=(e,t,r,n)=>{let i=e.avail_in;return i>n&&(i=n),0===i?0:(e.avail_in-=i,t.set(e.input.subarray(e.next_in,e.next_in+i),r),1===e.state.wrap?e.adler=P(e.adler,t,i,r):2===e.state.wrap&&(e.adler=j(e.adler,t,i,r)),e.next_in+=i,e.total_in+=i,i)},be=(e,t)=>{let r,n,i=e.max_chain_length,o=e.strstart,a=e.prev_length,s=e.nice_match;const A=e.strstart>e.w_size-262?e.strstart-(e.w_size-262):0,c=e.window,u=e.w_mask,f=e.prev,h=e.strstart+258;let l=c[o+a-1],g=c[o+a];e.prev_length>=e.good_match&&(i>>=2),s>e.lookahead&&(s=e.lookahead);do{if(r=t,c[r+a]===g&&c[r+a-1]===l&&c[r]===c[o]&&c[++r]===c[o+1]){o+=2,r++;do{}while(c[++o]===c[++r]&&c[++o]===c[++r]&&c[++o]===c[++r]&&c[++o]===c[++r]&&c[++o]===c[++r]&&c[++o]===c[++r]&&c[++o]===c[++r]&&c[++o]===c[++r]&&o<h);if(n=258-(h-o),o=h-258,n>a){if(e.match_start=t,a=n,n>=s)break;l=c[o+a-1],g=c[o+a]}}}while((t=f[t&u])>A&&0!=--i);return a<=e.lookahead?a:e.lookahead},Ee=e=>{const t=e.w_size;let r,n,i,o,a;do{if(o=e.window_size-e.lookahead-e.strstart,e.strstart>=t+(t-262)){e.window.set(e.window.subarray(t,t+t),0),e.match_start-=t,e.strstart-=t,e.block_start-=t,n=e.hash_size,r=n;do{i=e.head[--r],e.head[r]=i>=t?i-t:0}while(--n);n=t,r=n;do{i=e.prev[--r],e.prev[r]=i>=t?i-t:0}while(--n);o+=t}if(0===e.strm.avail_in)break;if(n=ye(e.strm,e.window,e.strstart+e.lookahead,o),e.lookahead+=n,e.lookahead+e.insert>=3)for(a=e.strstart-e.insert,e.ins_h=e.window[a],e.ins_h=le(e,e.ins_h,e.window[a+1]);e.insert&&(e.ins_h=le(e,e.ins_h,e.window[a+3-1]),e.prev[a&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=a,a++,e.insert--,!(e.lookahead+e.insert<3)););}while(e.lookahead<262&&0!==e.strm.avail_in)},me=(e,t)=>{let r,n;for(;;){if(e.lookahead<262){if(Ee(e),e.lookahead<262&&t===q)return 1;if(0===e.lookahead)break}if(r=0,e.lookahead>=3&&(e.ins_h=le(e,e.ins_h,e.window[e.strstart+3-1]),r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),0!==r&&e.strstart-r<=e.w_size-262&&(e.match_length=be(e,r)),e.match_length>=3)if(n=Y(e,e.strstart-e.match_start,e.match_length-3),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=3){e.match_length--;do{e.strstart++,e.ins_h=le(e,e.ins_h,e.window[e.strstart+3-1]),r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart}while(0!=--e.match_length);e.strstart++}else e.strstart+=e.match_length,e.match_length=0,e.ins_h=e.window[e.strstart],e.ins_h=le(e,e.ins_h,e.window[e.strstart+1]);else n=Y(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++;if(n&&(de(e,!1),0===e.strm.avail_out))return 1}return e.insert=e.strstart<2?e.strstart:2,t===V?(de(e,!0),0===e.strm.avail_out?3:4):e.last_lit&&(de(e,!1),0===e.strm.avail_out)?1:2},Ce=(e,t)=>{let r,n,i;for(;;){if(e.lookahead<262){if(Ee(e),e.lookahead<262&&t===q)return 1;if(0===e.lookahead)break}if(r=0,e.lookahead>=3&&(e.ins_h=le(e,e.ins_h,e.window[e.strstart+3-1]),r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),e.prev_length=e.match_length,e.prev_match=e.match_start,e.match_length=2,0!==r&&e.prev_length<e.max_lazy_match&&e.strstart-r<=e.w_size-262&&(e.match_length=be(e,r),e.match_length<=5&&(e.strategy===ne||3===e.match_length&&e.strstart-e.match_start>4096)&&(e.match_length=2)),e.prev_length>=3&&e.match_length<=e.prev_length){i=e.strstart+e.lookahead-3,n=Y(e,e.strstart-1-e.prev_match,e.prev_length-3),e.lookahead-=e.prev_length-1,e.prev_length-=2;do{++e.strstart<=i&&(e.ins_h=le(e,e.ins_h,e.window[e.strstart+3-1]),r=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart)}while(0!=--e.prev_length);if(e.match_available=0,e.match_length=2,e.strstart++,n&&(de(e,!1),0===e.strm.avail_out))return 1}else if(e.match_available){if(n=Y(e,0,e.window[e.strstart-1]),n&&de(e,!1),e.strstart++,e.lookahead--,0===e.strm.avail_out)return 1}else e.match_available=1,e.strstart++,e.lookahead--}return e.match_available&&(n=Y(e,0,e.window[e.strstart-1]),e.match_available=0),e.insert=e.strstart<2?e.strstart:2,t===V?(de(e,!0),0===e.strm.avail_out?3:4):e.last_lit&&(de(e,!1),0===e.strm.avail_out)?1:2};function ve(e,t,r,n,i){this.good_length=e,this.max_lazy=t,this.nice_length=r,this.max_chain=n,this.func=i}const Be=[new ve(0,0,0,0,(e,t)=>{let r=65535;for(r>e.pending_buf_size-5&&(r=e.pending_buf_size-5);;){if(e.lookahead<=1){if(Ee(e),0===e.lookahead&&t===q)return 1;if(0===e.lookahead)break}e.strstart+=e.lookahead,e.lookahead=0;const n=e.block_start+r;if((0===e.strstart||e.strstart>=n)&&(e.lookahead=e.strstart-n,e.strstart=n,de(e,!1),0===e.strm.avail_out))return 1;if(e.strstart-e.block_start>=e.w_size-262&&(de(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,t===V?(de(e,!0),0===e.strm.avail_out?3:4):(e.strstart>e.block_start&&(de(e,!1),e.strm.avail_out),1)}),new ve(4,4,8,4,me),new ve(4,5,16,8,me),new ve(4,6,32,32,me),new ve(4,4,16,16,Ce),new ve(8,16,32,32,Ce),new ve(8,16,128,128,Ce),new ve(8,32,128,256,Ce),new ve(32,128,258,1024,Ce),new ve(32,258,258,4096,Ce)];function we(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=ce,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new Uint16Array(1146),this.dyn_dtree=new Uint16Array(122),this.bl_tree=new Uint16Array(78),he(this.dyn_ltree),he(this.dyn_dtree),he(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Uint16Array(16),this.heap=new Uint16Array(573),he(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(573),he(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}const Qe=e=>{if(!e||!e.state)return ue(e,$);e.total_in=e.total_out=0,e.data_type=Ae;const t=e.state;return t.pending=0,t.pending_out=0,t.wrap<0&&(t.wrap=-t.wrap),t.status=t.wrap?42:113,e.adler=2===t.wrap?0:1,t.last_flush=q,L(t),W},ke=e=>{const t=Qe(e);var r;return t===W&&((r=e.state).window_size=2*r.w_size,he(r.head),r.max_lazy_match=Be[r.level].max_lazy,r.good_match=Be[r.level].good_length,r.nice_match=Be[r.level].nice_length,r.max_chain_length=Be[r.level].max_chain,r.strstart=0,r.block_start=0,r.lookahead=0,r.insert=0,r.match_length=r.prev_length=2,r.match_available=0,r.ins_h=0),t},_e=(e,t,r,n,i,o)=>{if(!e)return $;let a=1;if(t===re&&(t=6),n<0?(a=0,n=-n):n>15&&(a=2,n-=16),i<1||i>9||r!==ce||n<8||n>15||t<0||t>9||o<0||o>ae)return ue(e,$);8===n&&(n=9);const s=new we;return e.state=s,s.strm=e,s.wrap=a,s.gzhead=null,s.w_bits=n,s.w_size=1<<s.w_bits,s.w_mask=s.w_size-1,s.hash_bits=i+7,s.hash_size=1<<s.hash_bits,s.hash_mask=s.hash_size-1,s.hash_shift=~~((s.hash_bits+3-1)/3),s.window=new Uint8Array(2*s.w_size),s.head=new Uint16Array(s.hash_size),s.prev=new Uint16Array(s.w_size),s.lit_bufsize=1<<i+6,s.pending_buf_size=4*s.lit_bufsize,s.pending_buf=new Uint8Array(s.pending_buf_size),s.d_buf=1*s.lit_bufsize,s.l_buf=3*s.lit_bufsize,s.level=t,s.strategy=o,s.method=r,ke(e)};var Se={deflateInit:(e,t)=>_e(e,t,ce,15,8,se),deflateInit2:_e,deflateReset:ke,deflateResetKeep:Qe,deflateSetHeader:(e,t)=>e&&e.state?2!==e.state.wrap?$:(e.state.gzhead=t,W):$,deflate:(e,t)=>{let r,n;if(!e||!e.state||t>Z||t<0)return e?ue(e,$):$;const i=e.state;if(!e.output||!e.input&&0!==e.avail_in||666===i.status&&t!==V)return ue(e,0===e.avail_out?te:$);i.strm=e;const o=i.last_flush;if(i.last_flush=t,42===i.status)if(2===i.wrap)e.adler=0,pe(i,31),pe(i,139),pe(i,8),i.gzhead?(pe(i,(i.gzhead.text?1:0)+(i.gzhead.hcrc?2:0)+(i.gzhead.extra?4:0)+(i.gzhead.name?8:0)+(i.gzhead.comment?16:0)),pe(i,255&i.gzhead.time),pe(i,i.gzhead.time>>8&255),pe(i,i.gzhead.time>>16&255),pe(i,i.gzhead.time>>24&255),pe(i,9===i.level?2:i.strategy>=ie||i.level<2?4:0),pe(i,255&i.gzhead.os),i.gzhead.extra&&i.gzhead.extra.length&&(pe(i,255&i.gzhead.extra.length),pe(i,i.gzhead.extra.length>>8&255)),i.gzhead.hcrc&&(e.adler=j(e.adler,i.pending_buf,i.pending,0)),i.gzindex=0,i.status=69):(pe(i,0),pe(i,0),pe(i,0),pe(i,0),pe(i,0),pe(i,9===i.level?2:i.strategy>=ie||i.level<2?4:0),pe(i,3),i.status=113);else{let t=ce+(i.w_bits-8<<4)<<8,r=-1;r=i.strategy>=ie||i.level<2?0:i.level<6?1:6===i.level?2:3,t|=r<<6,0!==i.strstart&&(t|=32),t+=31-t%31,i.status=113,Ie(i,t),0!==i.strstart&&(Ie(i,e.adler>>>16),Ie(i,65535&e.adler)),e.adler=1}if(69===i.status)if(i.gzhead.extra){for(r=i.pending;i.gzindex<(65535&i.gzhead.extra.length)&&(i.pending!==i.pending_buf_size||(i.gzhead.hcrc&&i.pending>r&&(e.adler=j(e.adler,i.pending_buf,i.pending-r,r)),ge(e),r=i.pending,i.pending!==i.pending_buf_size));)pe(i,255&i.gzhead.extra[i.gzindex]),i.gzindex++;i.gzhead.hcrc&&i.pending>r&&(e.adler=j(e.adler,i.pending_buf,i.pending-r,r)),i.gzindex===i.gzhead.extra.length&&(i.gzindex=0,i.status=73)}else i.status=73;if(73===i.status)if(i.gzhead.name){r=i.pending;do{if(i.pending===i.pending_buf_size&&(i.gzhead.hcrc&&i.pending>r&&(e.adler=j(e.adler,i.pending_buf,i.pending-r,r)),ge(e),r=i.pending,i.pending===i.pending_buf_size)){n=1;break}n=i.gzindex<i.gzhead.name.length?255&i.gzhead.name.charCodeAt(i.gzindex++):0,pe(i,n)}while(0!==n);i.gzhead.hcrc&&i.pending>r&&(e.adler=j(e.adler,i.pending_buf,i.pending-r,r)),0===n&&(i.gzindex=0,i.status=91)}else i.status=91;if(91===i.status)if(i.gzhead.comment){r=i.pending;do{if(i.pending===i.pending_buf_size&&(i.gzhead.hcrc&&i.pending>r&&(e.adler=j(e.adler,i.pending_buf,i.pending-r,r)),ge(e),r=i.pending,i.pending===i.pending_buf_size)){n=1;break}n=i.gzindex<i.gzhead.comment.length?255&i.gzhead.comment.charCodeAt(i.gzindex++):0,pe(i,n)}while(0!==n);i.gzhead.hcrc&&i.pending>r&&(e.adler=j(e.adler,i.pending_buf,i.pending-r,r)),0===n&&(i.status=103)}else i.status=103;if(103===i.status&&(i.gzhead.hcrc?(i.pending+2>i.pending_buf_size&&ge(e),i.pending+2<=i.pending_buf_size&&(pe(i,255&e.adler),pe(i,e.adler>>8&255),e.adler=0,i.status=113)):i.status=113),0!==i.pending){if(ge(e),0===e.avail_out)return i.last_flush=-1,W}else if(0===e.avail_in&&fe(t)<=fe(o)&&t!==V)return ue(e,te);if(666===i.status&&0!==e.avail_in)return ue(e,te);if(0!==e.avail_in||0!==i.lookahead||t!==q&&666!==i.status){let r=i.strategy===ie?((e,t)=>{let r;for(;;){if(0===e.lookahead&&(Ee(e),0===e.lookahead)){if(t===q)return 1;break}if(e.match_length=0,r=Y(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,r&&(de(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,t===V?(de(e,!0),0===e.strm.avail_out?3:4):e.last_lit&&(de(e,!1),0===e.strm.avail_out)?1:2})(i,t):i.strategy===oe?((e,t)=>{let r,n,i,o;const a=e.window;for(;;){if(e.lookahead<=258){if(Ee(e),e.lookahead<=258&&t===q)return 1;if(0===e.lookahead)break}if(e.match_length=0,e.lookahead>=3&&e.strstart>0&&(i=e.strstart-1,n=a[i],n===a[++i]&&n===a[++i]&&n===a[++i])){o=e.strstart+258;do{}while(n===a[++i]&&n===a[++i]&&n===a[++i]&&n===a[++i]&&n===a[++i]&&n===a[++i]&&n===a[++i]&&n===a[++i]&&i<o);e.match_length=258-(o-i),e.match_length>e.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=3?(r=Y(e,1,e.match_length-3),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(r=Y(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),r&&(de(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,t===V?(de(e,!0),0===e.strm.avail_out?3:4):e.last_lit&&(de(e,!1),0===e.strm.avail_out)?1:2})(i,t):Be[i.level].func(i,t);if(3!==r&&4!==r||(i.status=666),1===r||3===r)return 0===e.avail_out&&(i.last_flush=-1),W;if(2===r&&(t===J?K(i):t!==Z&&(H(i,0,0,!1),t===z&&(he(i.head),0===i.lookahead&&(i.strstart=0,i.block_start=0,i.insert=0))),ge(e),0===e.avail_out))return i.last_flush=-1,W}return t!==V?W:i.wrap<=0?X:(2===i.wrap?(pe(i,255&e.adler),pe(i,e.adler>>8&255),pe(i,e.adler>>16&255),pe(i,e.adler>>24&255),pe(i,255&e.total_in),pe(i,e.total_in>>8&255),pe(i,e.total_in>>16&255),pe(i,e.total_in>>24&255)):(Ie(i,e.adler>>>16),Ie(i,65535&e.adler)),ge(e),i.wrap>0&&(i.wrap=-i.wrap),0!==i.pending?W:X)},deflateEnd:e=>{if(!e||!e.state)return $;const t=e.state.status;return 42!==t&&69!==t&&73!==t&&91!==t&&103!==t&&113!==t&&666!==t?ue(e,$):(e.state=null,113===t?ue(e,ee):W)},deflateSetDictionary:(e,t)=>{let r=t.length;if(!e||!e.state)return $;const n=e.state,i=n.wrap;if(2===i||1===i&&42!==n.status||n.lookahead)return $;if(1===i&&(e.adler=P(e.adler,t,r,0)),n.wrap=0,r>=n.w_size){0===i&&(he(n.head),n.strstart=0,n.block_start=0,n.insert=0);let e=new Uint8Array(n.w_size);e.set(t.subarray(r-n.w_size,r),0),t=e,r=n.w_size}const o=e.avail_in,a=e.next_in,s=e.input;for(e.avail_in=r,e.next_in=0,e.input=t,Ee(n);n.lookahead>=3;){let e=n.strstart,t=n.lookahead-2;do{n.ins_h=le(n,n.ins_h,n.window[e+3-1]),n.prev[e&n.w_mask]=n.head[n.ins_h],n.head[n.ins_h]=e,e++}while(--t);n.strstart=e,n.lookahead=2,Ee(n)}return n.strstart+=n.lookahead,n.block_start=n.strstart,n.insert=n.lookahead,n.lookahead=0,n.match_length=n.prev_length=2,n.match_available=0,e.next_in=a,e.input=s,e.avail_in=o,n.wrap=i,W},deflateInfo:"pako deflate (from Nodeca project)"};const De=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);var Me=function(e){const t=Array.prototype.slice.call(arguments,1);for(;t.length;){const r=t.shift();if(r){if("object"!=typeof r)throw new TypeError(r+"must be non-object");for(const t in r)De(r,t)&&(e[t]=r[t])}}return e},Re=e=>{let t=0;for(let r=0,n=e.length;r<n;r++)t+=e[r].length;const r=new Uint8Array(t);for(let t=0,n=0,i=e.length;t<i;t++){let i=e[t];r.set(i,n),n+=i.length}return r};let xe=!0;try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(e){xe=!1}const Oe=new Uint8Array(256);for(let e=0;e<256;e++)Oe[e]=e>=252?6:e>=248?5:e>=240?4:e>=224?3:e>=192?2:1;Oe[254]=Oe[254]=1;var Ne=e=>{if("function"==typeof TextEncoder&&TextEncoder.prototype.encode)return(new TextEncoder).encode(e);let t,r,n,i,o,a=e.length,s=0;for(i=0;i<a;i++)r=e.charCodeAt(i),55296==(64512&r)&&i+1<a&&(n=e.charCodeAt(i+1),56320==(64512&n)&&(r=65536+(r-55296<<10)+(n-56320),i++)),s+=r<128?1:r<2048?2:r<65536?3:4;for(t=new Uint8Array(s),o=0,i=0;o<s;i++)r=e.charCodeAt(i),55296==(64512&r)&&i+1<a&&(n=e.charCodeAt(i+1),56320==(64512&n)&&(r=65536+(r-55296<<10)+(n-56320),i++)),r<128?t[o++]=r:r<2048?(t[o++]=192|r>>>6,t[o++]=128|63&r):r<65536?(t[o++]=224|r>>>12,t[o++]=128|r>>>6&63,t[o++]=128|63&r):(t[o++]=240|r>>>18,t[o++]=128|r>>>12&63,t[o++]=128|r>>>6&63,t[o++]=128|63&r);return t},Pe=(e,t)=>{const r=t||e.length;if("function"==typeof TextDecoder&&TextDecoder.prototype.decode)return(new TextDecoder).decode(e.subarray(0,t));let n,i;const o=new Array(2*r);for(i=0,n=0;n<r;){let t=e[n++];if(t<128){o[i++]=t;continue}let a=Oe[t];if(a>4)o[i++]=65533,n+=a-1;else{for(t&=2===a?31:3===a?15:7;a>1&&n<r;)t=t<<6|63&e[n++],a--;a>1?o[i++]=65533:t<65536?o[i++]=t:(t-=65536,o[i++]=55296|t>>10&1023,o[i++]=56320|1023&t)}}return((e,t)=>{if(t<65534&&e.subarray&&xe)return String.fromCharCode.apply(null,e.length===t?e:e.subarray(0,t));let r="";for(let n=0;n<t;n++)r+=String.fromCharCode(e[n]);return r})(o,i)},Fe=(e,t)=>{(t=t||e.length)>e.length&&(t=e.length);let r=t-1;for(;r>=0&&128==(192&e[r]);)r--;return r<0||0===r?t:r+Oe[e[r]]>t?r:t};var je=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0};const Te=Object.prototype.toString,{Z_NO_FLUSH:Ue,Z_SYNC_FLUSH:Le,Z_FULL_FLUSH:He,Z_FINISH:Ge,Z_OK:Ye,Z_STREAM_END:Ke,Z_DEFAULT_COMPRESSION:qe,Z_DEFAULT_STRATEGY:Je,Z_DEFLATED:ze}=U;function Ve(e){this.options=Me({level:qe,method:ze,chunkSize:16384,windowBits:15,memLevel:8,strategy:Je},e||{});let t=this.options;t.raw&&t.windowBits>0?t.windowBits=-t.windowBits:t.gzip&&t.windowBits>0&&t.windowBits<16&&(t.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new je,this.strm.avail_out=0;let r=Se.deflateInit2(this.strm,t.level,t.method,t.windowBits,t.memLevel,t.strategy);if(r!==Ye)throw new Error(T[r]);if(t.header&&Se.deflateSetHeader(this.strm,t.header),t.dictionary){let e;if(e="string"==typeof t.dictionary?Ne(t.dictionary):"[object ArrayBuffer]"===Te.call(t.dictionary)?new Uint8Array(t.dictionary):t.dictionary,r=Se.deflateSetDictionary(this.strm,e),r!==Ye)throw new Error(T[r]);this._dict_set=!0}}function Ze(e,t){const r=new Ve(t);if(r.push(e,!0),r.err)throw r.msg||T[r.err];return r.result}Ve.prototype.push=function(e,t){const r=this.strm,n=this.options.chunkSize;let i,o;if(this.ended)return!1;for(o=t===~~t?t:!0===t?Ge:Ue,"string"==typeof e?r.input=Ne(e):"[object ArrayBuffer]"===Te.call(e)?r.input=new Uint8Array(e):r.input=e,r.next_in=0,r.avail_in=r.input.length;;)if(0===r.avail_out&&(r.output=new Uint8Array(n),r.next_out=0,r.avail_out=n),(o===Le||o===He)&&r.avail_out<=6)this.onData(r.output.subarray(0,r.next_out)),r.avail_out=0;else{if(i=Se.deflate(r,o),i===Ke)return r.next_out>0&&this.onData(r.output.subarray(0,r.next_out)),i=Se.deflateEnd(this.strm),this.onEnd(i),this.ended=!0,i===Ye;if(0!==r.avail_out){if(o>0&&r.next_out>0)this.onData(r.output.subarray(0,r.next_out)),r.avail_out=0;else if(0===r.avail_in)break}else this.onData(r.output)}return!0},Ve.prototype.onData=function(e){this.chunks.push(e)},Ve.prototype.onEnd=function(e){e===Ye&&(this.result=Re(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};var We={Deflate:Ve,deflate:Ze,deflateRaw:function(e,t){return(t=t||{}).raw=!0,Ze(e,t)},gzip:function(e,t){return(t=t||{}).gzip=!0,Ze(e,t)},constants:U};var Xe=function(e,t){let r,n,i,o,a,s,A,c,u,f,h,l,g,d,p,I,y,b,E,m,C,v,B,w;const Q=e.state;r=e.next_in,B=e.input,n=r+(e.avail_in-5),i=e.next_out,w=e.output,o=i-(t-e.avail_out),a=i+(e.avail_out-257),s=Q.dmax,A=Q.wsize,c=Q.whave,u=Q.wnext,f=Q.window,h=Q.hold,l=Q.bits,g=Q.lencode,d=Q.distcode,p=(1<<Q.lenbits)-1,I=(1<<Q.distbits)-1;e:do{l<15&&(h+=B[r++]<<l,l+=8,h+=B[r++]<<l,l+=8),y=g[h&p];t:for(;;){if(b=y>>>24,h>>>=b,l-=b,b=y>>>16&255,0===b)w[i++]=65535&y;else{if(!(16&b)){if(0==(64&b)){y=g[(65535&y)+(h&(1<<b)-1)];continue t}if(32&b){Q.mode=12;break e}e.msg="invalid literal/length code",Q.mode=30;break e}E=65535&y,b&=15,b&&(l<b&&(h+=B[r++]<<l,l+=8),E+=h&(1<<b)-1,h>>>=b,l-=b),l<15&&(h+=B[r++]<<l,l+=8,h+=B[r++]<<l,l+=8),y=d[h&I];r:for(;;){if(b=y>>>24,h>>>=b,l-=b,b=y>>>16&255,!(16&b)){if(0==(64&b)){y=d[(65535&y)+(h&(1<<b)-1)];continue r}e.msg="invalid distance code",Q.mode=30;break e}if(m=65535&y,b&=15,l<b&&(h+=B[r++]<<l,l+=8,l<b&&(h+=B[r++]<<l,l+=8)),m+=h&(1<<b)-1,m>s){e.msg="invalid distance too far back",Q.mode=30;break e}if(h>>>=b,l-=b,b=i-o,m>b){if(b=m-b,b>c&&Q.sane){e.msg="invalid distance too far back",Q.mode=30;break e}if(C=0,v=f,0===u){if(C+=A-b,b<E){E-=b;do{w[i++]=f[C++]}while(--b);C=i-m,v=w}}else if(u<b){if(C+=A+u-b,b-=u,b<E){E-=b;do{w[i++]=f[C++]}while(--b);if(C=0,u<E){b=u,E-=b;do{w[i++]=f[C++]}while(--b);C=i-m,v=w}}}else if(C+=u-b,b<E){E-=b;do{w[i++]=f[C++]}while(--b);C=i-m,v=w}for(;E>2;)w[i++]=v[C++],w[i++]=v[C++],w[i++]=v[C++],E-=3;E&&(w[i++]=v[C++],E>1&&(w[i++]=v[C++]))}else{C=i-m;do{w[i++]=w[C++],w[i++]=w[C++],w[i++]=w[C++],E-=3}while(E>2);E&&(w[i++]=w[C++],E>1&&(w[i++]=w[C++]))}break}}break}}while(r<n&&i<a);E=l>>3,r-=E,l-=E<<3,h&=(1<<l)-1,e.next_in=r,e.next_out=i,e.avail_in=r<n?n-r+5:5-(r-n),e.avail_out=i<a?a-i+257:257-(i-a),Q.hold=h,Q.bits=l};const $e=new Uint16Array([3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0]),et=new Uint8Array([16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78]),tt=new Uint16Array([1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0]),rt=new Uint8Array([16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64]);var nt=(e,t,r,n,i,o,a,s)=>{const A=s.bits;let c,u,f,h,l,g,d=0,p=0,I=0,y=0,b=0,E=0,m=0,C=0,v=0,B=0,w=null,Q=0;const k=new Uint16Array(16),_=new Uint16Array(16);let S,D,M,R=null,x=0;for(d=0;d<=15;d++)k[d]=0;for(p=0;p<n;p++)k[t[r+p]]++;for(b=A,y=15;y>=1&&0===k[y];y--);if(b>y&&(b=y),0===y)return i[o++]=20971520,i[o++]=20971520,s.bits=1,0;for(I=1;I<y&&0===k[I];I++);for(b<I&&(b=I),C=1,d=1;d<=15;d++)if(C<<=1,C-=k[d],C<0)return-1;if(C>0&&(0===e||1!==y))return-1;for(_[1]=0,d=1;d<15;d++)_[d+1]=_[d]+k[d];for(p=0;p<n;p++)0!==t[r+p]&&(a[_[t[r+p]]++]=p);if(0===e?(w=R=a,g=19):1===e?(w=$e,Q-=257,R=et,x-=257,g=256):(w=tt,R=rt,g=-1),B=0,p=0,d=I,l=o,E=b,m=0,f=-1,v=1<<b,h=v-1,1===e&&v>852||2===e&&v>592)return 1;for(;;){S=d-m,a[p]<g?(D=0,M=a[p]):a[p]>g?(D=R[x+a[p]],M=w[Q+a[p]]):(D=96,M=0),c=1<<d-m,u=1<<E,I=u;do{u-=c,i[l+(B>>m)+u]=S<<24|D<<16|M|0}while(0!==u);for(c=1<<d-1;B&c;)c>>=1;if(0!==c?(B&=c-1,B+=c):B=0,p++,0==--k[d]){if(d===y)break;d=t[r+a[p]]}if(d>b&&(B&h)!==f){for(0===m&&(m=b),l+=I,E=d-m,C=1<<E;E+m<y&&(C-=k[E+m],!(C<=0));)E++,C<<=1;if(v+=1<<E,1===e&&v>852||2===e&&v>592)return 1;f=B&h,i[f]=b<<24|E<<16|l-o|0}}return 0!==B&&(i[l+B]=d-m<<24|64<<16|0),s.bits=b,0};const{Z_FINISH:it,Z_BLOCK:ot,Z_TREES:at,Z_OK:st,Z_STREAM_END:At,Z_NEED_DICT:ct,Z_STREAM_ERROR:ut,Z_DATA_ERROR:ft,Z_MEM_ERROR:ht,Z_BUF_ERROR:lt,Z_DEFLATED:gt}=U,dt=e=>(e>>>24&255)+(e>>>8&65280)+((65280&e)<<8)+((255&e)<<24);function pt(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new Uint16Array(320),this.work=new Uint16Array(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}const It=e=>{if(!e||!e.state)return ut;const t=e.state;return e.total_in=e.total_out=t.total=0,e.msg="",t.wrap&&(e.adler=1&t.wrap),t.mode=1,t.last=0,t.havedict=0,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new Int32Array(852),t.distcode=t.distdyn=new Int32Array(592),t.sane=1,t.back=-1,st},yt=e=>{if(!e||!e.state)return ut;const t=e.state;return t.wsize=0,t.whave=0,t.wnext=0,It(e)},bt=(e,t)=>{let r;if(!e||!e.state)return ut;const n=e.state;return t<0?(r=0,t=-t):(r=1+(t>>4),t<48&&(t&=15)),t&&(t<8||t>15)?ut:(null!==n.window&&n.wbits!==t&&(n.window=null),n.wrap=r,n.wbits=t,yt(e))},Et=(e,t)=>{if(!e)return ut;const r=new pt;e.state=r,r.window=null;const n=bt(e,t);return n!==st&&(e.state=null),n};let mt,Ct,vt=!0;const Bt=e=>{if(vt){mt=new Int32Array(512),Ct=new Int32Array(32);let t=0;for(;t<144;)e.lens[t++]=8;for(;t<256;)e.lens[t++]=9;for(;t<280;)e.lens[t++]=7;for(;t<288;)e.lens[t++]=8;for(nt(1,e.lens,0,288,mt,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;nt(2,e.lens,0,32,Ct,0,e.work,{bits:5}),vt=!1}e.lencode=mt,e.lenbits=9,e.distcode=Ct,e.distbits=5},wt=(e,t,r,n)=>{let i;const o=e.state;return null===o.window&&(o.wsize=1<<o.wbits,o.wnext=0,o.whave=0,o.window=new Uint8Array(o.wsize)),n>=o.wsize?(o.window.set(t.subarray(r-o.wsize,r),0),o.wnext=0,o.whave=o.wsize):(i=o.wsize-o.wnext,i>n&&(i=n),o.window.set(t.subarray(r-n,r-n+i),o.wnext),(n-=i)?(o.window.set(t.subarray(r-n,r),0),o.wnext=n,o.whave=o.wsize):(o.wnext+=i,o.wnext===o.wsize&&(o.wnext=0),o.whave<o.wsize&&(o.whave+=i))),0};var Qt={inflateReset:yt,inflateReset2:bt,inflateResetKeep:It,inflateInit:e=>Et(e,15),inflateInit2:Et,inflate:(e,t)=>{let r,n,i,o,a,s,A,c,u,f,h,l,g,d,p,I,y,b,E,m,C,v,B=0;const w=new Uint8Array(4);let Q,k;const _=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(!e||!e.state||!e.output||!e.input&&0!==e.avail_in)return ut;r=e.state,12===r.mode&&(r.mode=13),a=e.next_out,i=e.output,A=e.avail_out,o=e.next_in,n=e.input,s=e.avail_in,c=r.hold,u=r.bits,f=s,h=A,v=st;e:for(;;)switch(r.mode){case 1:if(0===r.wrap){r.mode=13;break}for(;u<16;){if(0===s)break e;s--,c+=n[o++]<<u,u+=8}if(2&r.wrap&&35615===c){r.check=0,w[0]=255&c,w[1]=c>>>8&255,r.check=j(r.check,w,2,0),c=0,u=0,r.mode=2;break}if(r.flags=0,r.head&&(r.head.done=!1),!(1&r.wrap)||(((255&c)<<8)+(c>>8))%31){e.msg="incorrect header check",r.mode=30;break}if((15&c)!==gt){e.msg="unknown compression method",r.mode=30;break}if(c>>>=4,u-=4,C=8+(15&c),0===r.wbits)r.wbits=C;else if(C>r.wbits){e.msg="invalid window size",r.mode=30;break}r.dmax=1<<r.wbits,e.adler=r.check=1,r.mode=512&c?10:12,c=0,u=0;break;case 2:for(;u<16;){if(0===s)break e;s--,c+=n[o++]<<u,u+=8}if(r.flags=c,(255&r.flags)!==gt){e.msg="unknown compression method",r.mode=30;break}if(57344&r.flags){e.msg="unknown header flags set",r.mode=30;break}r.head&&(r.head.text=c>>8&1),512&r.flags&&(w[0]=255&c,w[1]=c>>>8&255,r.check=j(r.check,w,2,0)),c=0,u=0,r.mode=3;case 3:for(;u<32;){if(0===s)break e;s--,c+=n[o++]<<u,u+=8}r.head&&(r.head.time=c),512&r.flags&&(w[0]=255&c,w[1]=c>>>8&255,w[2]=c>>>16&255,w[3]=c>>>24&255,r.check=j(r.check,w,4,0)),c=0,u=0,r.mode=4;case 4:for(;u<16;){if(0===s)break e;s--,c+=n[o++]<<u,u+=8}r.head&&(r.head.xflags=255&c,r.head.os=c>>8),512&r.flags&&(w[0]=255&c,w[1]=c>>>8&255,r.check=j(r.check,w,2,0)),c=0,u=0,r.mode=5;case 5:if(1024&r.flags){for(;u<16;){if(0===s)break e;s--,c+=n[o++]<<u,u+=8}r.length=c,r.head&&(r.head.extra_len=c),512&r.flags&&(w[0]=255&c,w[1]=c>>>8&255,r.check=j(r.check,w,2,0)),c=0,u=0}else r.head&&(r.head.extra=null);r.mode=6;case 6:if(1024&r.flags&&(l=r.length,l>s&&(l=s),l&&(r.head&&(C=r.head.extra_len-r.length,r.head.extra||(r.head.extra=new Uint8Array(r.head.extra_len)),r.head.extra.set(n.subarray(o,o+l),C)),512&r.flags&&(r.check=j(r.check,n,l,o)),s-=l,o+=l,r.length-=l),r.length))break e;r.length=0,r.mode=7;case 7:if(2048&r.flags){if(0===s)break e;l=0;do{C=n[o+l++],r.head&&C&&r.length<65536&&(r.head.name+=String.fromCharCode(C))}while(C&&l<s);if(512&r.flags&&(r.check=j(r.check,n,l,o)),s-=l,o+=l,C)break e}else r.head&&(r.head.name=null);r.length=0,r.mode=8;case 8:if(4096&r.flags){if(0===s)break e;l=0;do{C=n[o+l++],r.head&&C&&r.length<65536&&(r.head.comment+=String.fromCharCode(C))}while(C&&l<s);if(512&r.flags&&(r.check=j(r.check,n,l,o)),s-=l,o+=l,C)break e}else r.head&&(r.head.comment=null);r.mode=9;case 9:if(512&r.flags){for(;u<16;){if(0===s)break e;s--,c+=n[o++]<<u,u+=8}if(c!==(65535&r.check)){e.msg="header crc mismatch",r.mode=30;break}c=0,u=0}r.head&&(r.head.hcrc=r.flags>>9&1,r.head.done=!0),e.adler=r.check=0,r.mode=12;break;case 10:for(;u<32;){if(0===s)break e;s--,c+=n[o++]<<u,u+=8}e.adler=r.check=dt(c),c=0,u=0,r.mode=11;case 11:if(0===r.havedict)return e.next_out=a,e.avail_out=A,e.next_in=o,e.avail_in=s,r.hold=c,r.bits=u,ct;e.adler=r.check=1,r.mode=12;case 12:if(t===ot||t===at)break e;case 13:if(r.last){c>>>=7&u,u-=7&u,r.mode=27;break}for(;u<3;){if(0===s)break e;s--,c+=n[o++]<<u,u+=8}switch(r.last=1&c,c>>>=1,u-=1,3&c){case 0:r.mode=14;break;case 1:if(Bt(r),r.mode=20,t===at){c>>>=2,u-=2;break e}break;case 2:r.mode=17;break;case 3:e.msg="invalid block type",r.mode=30}c>>>=2,u-=2;break;case 14:for(c>>>=7&u,u-=7&u;u<32;){if(0===s)break e;s--,c+=n[o++]<<u,u+=8}if((65535&c)!=(c>>>16^65535)){e.msg="invalid stored block lengths",r.mode=30;break}if(r.length=65535&c,c=0,u=0,r.mode=15,t===at)break e;case 15:r.mode=16;case 16:if(l=r.length,l){if(l>s&&(l=s),l>A&&(l=A),0===l)break e;i.set(n.subarray(o,o+l),a),s-=l,o+=l,A-=l,a+=l,r.length-=l;break}r.mode=12;break;case 17:for(;u<14;){if(0===s)break e;s--,c+=n[o++]<<u,u+=8}if(r.nlen=257+(31&c),c>>>=5,u-=5,r.ndist=1+(31&c),c>>>=5,u-=5,r.ncode=4+(15&c),c>>>=4,u-=4,r.nlen>286||r.ndist>30){e.msg="too many length or distance symbols",r.mode=30;break}r.have=0,r.mode=18;case 18:for(;r.have<r.ncode;){for(;u<3;){if(0===s)break e;s--,c+=n[o++]<<u,u+=8}r.lens[_[r.have++]]=7&c,c>>>=3,u-=3}for(;r.have<19;)r.lens[_[r.have++]]=0;if(r.lencode=r.lendyn,r.lenbits=7,Q={bits:r.lenbits},v=nt(0,r.lens,0,19,r.lencode,0,r.work,Q),r.lenbits=Q.bits,v){e.msg="invalid code lengths set",r.mode=30;break}r.have=0,r.mode=19;case 19:for(;r.have<r.nlen+r.ndist;){for(;B=r.lencode[c&(1<<r.lenbits)-1],p=B>>>24,I=B>>>16&255,y=65535&B,!(p<=u);){if(0===s)break e;s--,c+=n[o++]<<u,u+=8}if(y<16)c>>>=p,u-=p,r.lens[r.have++]=y;else{if(16===y){for(k=p+2;u<k;){if(0===s)break e;s--,c+=n[o++]<<u,u+=8}if(c>>>=p,u-=p,0===r.have){e.msg="invalid bit length repeat",r.mode=30;break}C=r.lens[r.have-1],l=3+(3&c),c>>>=2,u-=2}else if(17===y){for(k=p+3;u<k;){if(0===s)break e;s--,c+=n[o++]<<u,u+=8}c>>>=p,u-=p,C=0,l=3+(7&c),c>>>=3,u-=3}else{for(k=p+7;u<k;){if(0===s)break e;s--,c+=n[o++]<<u,u+=8}c>>>=p,u-=p,C=0,l=11+(127&c),c>>>=7,u-=7}if(r.have+l>r.nlen+r.ndist){e.msg="invalid bit length repeat",r.mode=30;break}for(;l--;)r.lens[r.have++]=C}}if(30===r.mode)break;if(0===r.lens[256]){e.msg="invalid code -- missing end-of-block",r.mode=30;break}if(r.lenbits=9,Q={bits:r.lenbits},v=nt(1,r.lens,0,r.nlen,r.lencode,0,r.work,Q),r.lenbits=Q.bits,v){e.msg="invalid literal/lengths set",r.mode=30;break}if(r.distbits=6,r.distcode=r.distdyn,Q={bits:r.distbits},v=nt(2,r.lens,r.nlen,r.ndist,r.distcode,0,r.work,Q),r.distbits=Q.bits,v){e.msg="invalid distances set",r.mode=30;break}if(r.mode=20,t===at)break e;case 20:r.mode=21;case 21:if(s>=6&&A>=258){e.next_out=a,e.avail_out=A,e.next_in=o,e.avail_in=s,r.hold=c,r.bits=u,Xe(e,h),a=e.next_out,i=e.output,A=e.avail_out,o=e.next_in,n=e.input,s=e.avail_in,c=r.hold,u=r.bits,12===r.mode&&(r.back=-1);break}for(r.back=0;B=r.lencode[c&(1<<r.lenbits)-1],p=B>>>24,I=B>>>16&255,y=65535&B,!(p<=u);){if(0===s)break e;s--,c+=n[o++]<<u,u+=8}if(I&&0==(240&I)){for(b=p,E=I,m=y;B=r.lencode[m+((c&(1<<b+E)-1)>>b)],p=B>>>24,I=B>>>16&255,y=65535&B,!(b+p<=u);){if(0===s)break e;s--,c+=n[o++]<<u,u+=8}c>>>=b,u-=b,r.back+=b}if(c>>>=p,u-=p,r.back+=p,r.length=y,0===I){r.mode=26;break}if(32&I){r.back=-1,r.mode=12;break}if(64&I){e.msg="invalid literal/length code",r.mode=30;break}r.extra=15&I,r.mode=22;case 22:if(r.extra){for(k=r.extra;u<k;){if(0===s)break e;s--,c+=n[o++]<<u,u+=8}r.length+=c&(1<<r.extra)-1,c>>>=r.extra,u-=r.extra,r.back+=r.extra}r.was=r.length,r.mode=23;case 23:for(;B=r.distcode[c&(1<<r.distbits)-1],p=B>>>24,I=B>>>16&255,y=65535&B,!(p<=u);){if(0===s)break e;s--,c+=n[o++]<<u,u+=8}if(0==(240&I)){for(b=p,E=I,m=y;B=r.distcode[m+((c&(1<<b+E)-1)>>b)],p=B>>>24,I=B>>>16&255,y=65535&B,!(b+p<=u);){if(0===s)break e;s--,c+=n[o++]<<u,u+=8}c>>>=b,u-=b,r.back+=b}if(c>>>=p,u-=p,r.back+=p,64&I){e.msg="invalid distance code",r.mode=30;break}r.offset=y,r.extra=15&I,r.mode=24;case 24:if(r.extra){for(k=r.extra;u<k;){if(0===s)break e;s--,c+=n[o++]<<u,u+=8}r.offset+=c&(1<<r.extra)-1,c>>>=r.extra,u-=r.extra,r.back+=r.extra}if(r.offset>r.dmax){e.msg="invalid distance too far back",r.mode=30;break}r.mode=25;case 25:if(0===A)break e;if(l=h-A,r.offset>l){if(l=r.offset-l,l>r.whave&&r.sane){e.msg="invalid distance too far back",r.mode=30;break}l>r.wnext?(l-=r.wnext,g=r.wsize-l):g=r.wnext-l,l>r.length&&(l=r.length),d=r.window}else d=i,g=a-r.offset,l=r.length;l>A&&(l=A),A-=l,r.length-=l;do{i[a++]=d[g++]}while(--l);0===r.length&&(r.mode=21);break;case 26:if(0===A)break e;i[a++]=r.length,A--,r.mode=21;break;case 27:if(r.wrap){for(;u<32;){if(0===s)break e;s--,c|=n[o++]<<u,u+=8}if(h-=A,e.total_out+=h,r.total+=h,h&&(e.adler=r.check=r.flags?j(r.check,i,h,a-h):P(r.check,i,h,a-h)),h=A,(r.flags?c:dt(c))!==r.check){e.msg="incorrect data check",r.mode=30;break}c=0,u=0}r.mode=28;case 28:if(r.wrap&&r.flags){for(;u<32;){if(0===s)break e;s--,c+=n[o++]<<u,u+=8}if(c!==(4294967295&r.total)){e.msg="incorrect length check",r.mode=30;break}c=0,u=0}r.mode=29;case 29:v=At;break e;case 30:v=ft;break e;case 31:return ht;case 32:default:return ut}return e.next_out=a,e.avail_out=A,e.next_in=o,e.avail_in=s,r.hold=c,r.bits=u,(r.wsize||h!==e.avail_out&&r.mode<30&&(r.mode<27||t!==it))&&wt(e,e.output,e.next_out,h-e.avail_out),f-=e.avail_in,h-=e.avail_out,e.total_in+=f,e.total_out+=h,r.total+=h,r.wrap&&h&&(e.adler=r.check=r.flags?j(r.check,i,h,e.next_out-h):P(r.check,i,h,e.next_out-h)),e.data_type=r.bits+(r.last?64:0)+(12===r.mode?128:0)+(20===r.mode||15===r.mode?256:0),(0===f&&0===h||t===it)&&v===st&&(v=lt),v},inflateEnd:e=>{if(!e||!e.state)return ut;let t=e.state;return t.window&&(t.window=null),e.state=null,st},inflateGetHeader:(e,t)=>{if(!e||!e.state)return ut;const r=e.state;return 0==(2&r.wrap)?ut:(r.head=t,t.done=!1,st)},inflateSetDictionary:(e,t)=>{const r=t.length;let n,i,o;return e&&e.state?(n=e.state,0!==n.wrap&&11!==n.mode?ut:11===n.mode&&(i=1,i=P(i,t,r,0),i!==n.check)?ft:(o=wt(e,t,r,r),o?(n.mode=31,ht):(n.havedict=1,st))):ut},inflateInfo:"pako inflate (from Nodeca project)"};var kt=function(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1};const _t=Object.prototype.toString,{Z_NO_FLUSH:St,Z_FINISH:Dt,Z_OK:Mt,Z_STREAM_END:Rt,Z_NEED_DICT:xt,Z_STREAM_ERROR:Ot,Z_DATA_ERROR:Nt,Z_MEM_ERROR:Pt}=U;function Ft(e){this.options=Me({chunkSize:65536,windowBits:15,to:""},e||{});const t=this.options;t.raw&&t.windowBits>=0&&t.windowBits<16&&(t.windowBits=-t.windowBits,0===t.windowBits&&(t.windowBits=-15)),!(t.windowBits>=0&&t.windowBits<16)||e&&e.windowBits||(t.windowBits+=32),t.windowBits>15&&t.windowBits<48&&0==(15&t.windowBits)&&(t.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new je,this.strm.avail_out=0;let r=Qt.inflateInit2(this.strm,t.windowBits);if(r!==Mt)throw new Error(T[r]);if(this.header=new kt,Qt.inflateGetHeader(this.strm,this.header),t.dictionary&&("string"==typeof t.dictionary?t.dictionary=Ne(t.dictionary):"[object ArrayBuffer]"===_t.call(t.dictionary)&&(t.dictionary=new Uint8Array(t.dictionary)),t.raw&&(r=Qt.inflateSetDictionary(this.strm,t.dictionary),r!==Mt)))throw new Error(T[r])}function jt(e,t){const r=new Ft(t);if(r.push(e),r.err)throw r.msg||T[r.err];return r.result}Ft.prototype.push=function(e,t){const r=this.strm,n=this.options.chunkSize,i=this.options.dictionary;let o,a,s;if(this.ended)return!1;for(a=t===~~t?t:!0===t?Dt:St,"[object ArrayBuffer]"===_t.call(e)?r.input=new Uint8Array(e):r.input=e,r.next_in=0,r.avail_in=r.input.length;;){for(0===r.avail_out&&(r.output=new Uint8Array(n),r.next_out=0,r.avail_out=n),o=Qt.inflate(r,a),o===xt&&i&&(o=Qt.inflateSetDictionary(r,i),o===Mt?o=Qt.inflate(r,a):o===Nt&&(o=xt));r.avail_in>0&&o===Rt&&r.state.wrap>0&&0!==e[r.next_in];)Qt.inflateReset(r),o=Qt.inflate(r,a);switch(o){case Ot:case Nt:case xt:case Pt:return this.onEnd(o),this.ended=!0,!1}if(s=r.avail_out,r.next_out&&(0===r.avail_out||o===Rt))if("string"===this.options.to){let e=Fe(r.output,r.next_out),t=r.next_out-e,i=Pe(r.output,e);r.next_out=t,r.avail_out=n-t,t&&r.output.set(r.output.subarray(e,e+t),0),this.onData(i)}else this.onData(r.output.length===r.next_out?r.output:r.output.subarray(0,r.next_out));if(o!==Mt||0!==s){if(o===Rt)return o=Qt.inflateEnd(this.strm),this.onEnd(o),this.ended=!0,!0;if(0===r.avail_in)break}}return!0},Ft.prototype.onData=function(e){this.chunks.push(e)},Ft.prototype.onEnd=function(e){e===Mt&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=Re(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};var Tt={Inflate:Ft,inflate:jt,inflateRaw:function(e,t){return(t=t||{}).raw=!0,jt(e,t)},ungzip:jt,constants:U};const{Deflate:Ut,deflate:Lt,deflateRaw:Ht,gzip:Gt}=We,{Inflate:Yt,inflate:Kt,inflateRaw:qt,ungzip:Jt}=Tt;var zt=Ut,Vt=Lt,Zt=Ht,Wt=Gt,Xt=Yt,$t=Kt,er=qt,tr=Jt,rr=U,nr={Deflate:Ut,deflate:Lt,deflateRaw:Ht,gzip:Gt,Inflate:Yt,inflate:Kt,inflateRaw:qt,ungzip:Jt,constants:U}},function(e,t){},function(e,t,r){"use strict";t.sha1=r(189),t.sha224=r(190),t.sha256=r(93),t.sha384=r(191),t.sha512=r(94)},function(e,t,r){"use strict";var n=r(15),i=r(29),o=r(92),a=n.rotl32,s=n.sum32,A=n.sum32_5,c=o.ft_1,u=i.BlockHash,f=[1518500249,1859775393,2400959708,3395469782];function h(){if(!(this instanceof h))return new h;u.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.W=new Array(80)}n.inherits(h,u),e.exports=h,h.blockSize=512,h.outSize=160,h.hmacStrength=80,h.padLength=64,h.prototype._update=function(e,t){for(var r=this.W,n=0;n<16;n++)r[n]=e[t+n];for(;n<r.length;n++)r[n]=a(r[n-3]^r[n-8]^r[n-14]^r[n-16],1);var i=this.h[0],o=this.h[1],u=this.h[2],h=this.h[3],l=this.h[4];for(n=0;n<r.length;n++){var g=~~(n/20),d=A(a(i,5),c(g,o,u,h),l,r[n],f[g]);l=h,h=u,u=a(o,30),o=i,i=d}this.h[0]=s(this.h[0],i),this.h[1]=s(this.h[1],o),this.h[2]=s(this.h[2],u),this.h[3]=s(this.h[3],h),this.h[4]=s(this.h[4],l)},h.prototype._digest=function(e){return"hex"===e?n.toHex32(this.h,"big"):n.split32(this.h,"big")}},function(e,t,r){"use strict";var n=r(15),i=r(93);function o(){if(!(this instanceof o))return new o;i.call(this),this.h=[3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428]}n.inherits(o,i),e.exports=o,o.blockSize=512,o.outSize=224,o.hmacStrength=192,o.padLength=64,o.prototype._digest=function(e){return"hex"===e?n.toHex32(this.h.slice(0,7),"big"):n.split32(this.h.slice(0,7),"big")}},function(e,t,r){"use strict";var n=r(15),i=r(94);function o(){if(!(this instanceof o))return new o;i.call(this),this.h=[3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]}n.inherits(o,i),e.exports=o,o.blockSize=1024,o.outSize=384,o.hmacStrength=192,o.padLength=128,o.prototype._digest=function(e){return"hex"===e?n.toHex32(this.h.slice(0,12),"big"):n.split32(this.h.slice(0,12),"big")}},function(e,t,r){"use strict";var n=r(15),i=r(29),o=n.rotl32,a=n.sum32,s=n.sum32_3,A=n.sum32_4,c=i.BlockHash;function u(){if(!(this instanceof u))return new u;c.call(this),this.h=[1732584193,4023233417,2562383102,271733878,3285377520],this.endian="little"}function f(e,t,r,n){return e<=15?t^r^n:e<=31?t&r|~t&n:e<=47?(t|~r)^n:e<=63?t&n|r&~n:t^(r|~n)}function h(e){return e<=15?0:e<=31?1518500249:e<=47?1859775393:e<=63?2400959708:2840853838}function l(e){return e<=15?1352829926:e<=31?1548603684:e<=47?1836072691:e<=63?2053994217:0}n.inherits(u,c),t.ripemd160=u,u.blockSize=512,u.outSize=160,u.hmacStrength=192,u.padLength=64,u.prototype._update=function(e,t){for(var r=this.h[0],n=this.h[1],i=this.h[2],c=this.h[3],u=this.h[4],y=r,b=n,E=i,m=c,C=u,v=0;v<80;v++){var B=a(o(A(r,f(v,n,i,c),e[g[v]+t],h(v)),p[v]),u);r=u,u=c,c=o(i,10),i=n,n=B,B=a(o(A(y,f(79-v,b,E,m),e[d[v]+t],l(v)),I[v]),C),y=C,C=m,m=o(E,10),E=b,b=B}B=s(this.h[1],i,m),this.h[1]=s(this.h[2],c,C),this.h[2]=s(this.h[3],u,y),this.h[3]=s(this.h[4],r,b),this.h[4]=s(this.h[0],n,E),this.h[0]=B},u.prototype._digest=function(e){return"hex"===e?n.toHex32(this.h,"little"):n.split32(this.h,"little")};var g=[0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13],d=[5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11],p=[11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6],I=[8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11]},function(e,t,r){"use strict";var n=r(15),i=r(12);function o(e,t,r){if(!(this instanceof o))return new o(e,t,r);this.Hash=e,this.blockSize=e.blockSize/8,this.outSize=e.outSize/8,this.inner=null,this.outer=null,this._init(n.toArray(t,r))}e.exports=o,o.prototype._init=function(e){e.length>this.blockSize&&(e=(new this.Hash).update(e).digest()),i(e.length<=this.blockSize);for(var t=e.length;t<this.blockSize;t++)e.push(0);for(t=0;t<e.length;t++)e[t]^=54;for(this.inner=(new this.Hash).update(e),t=0;t<e.length;t++)e[t]^=106;this.outer=(new this.Hash).update(e)},o.prototype.update=function(e,t){return this.inner.update(e,t),this},o.prototype.digest=function(e){return this.outer.update(this.inner.digest()),this.outer.digest(e)}},function(e,t,r){(function(e,t){!function(e,r){"use strict";if(!e.setImmediate){var n,i,o,a,s,A=1,c={},u=!1,f=e.document,h=Object.getPrototypeOf&&Object.getPrototypeOf(e);h=h&&h.setTimeout?h:e,"[object process]"==={}.toString.call(e.process)?n=function(){var e=l(arguments);return t.nextTick(g(d,e)),e}:!function(){if(e.postMessage&&!e.importScripts){var t=!0,r=e.onmessage;return e.onmessage=function(){t=!1},e.postMessage("","*"),e.onmessage=r,t}}()?e.MessageChannel?((o=new MessageChannel).port1.onmessage=function(e){d(e.data)},n=function(){var e=l(arguments);return o.port2.postMessage(e),e}):f&&"onreadystatechange"in f.createElement("script")?(i=f.documentElement,n=function(){var e=l(arguments),t=f.createElement("script");return t.onreadystatechange=function(){d(e),t.onreadystatechange=null,i.removeChild(t),t=null},i.appendChild(t),e}):n=function(){var e=l(arguments);return setTimeout(g(d,e),0),e}:(a="setImmediate$"+Math.random()+"$",s=function(t){t.source===e&&"string"==typeof t.data&&0===t.data.indexOf(a)&&d(+t.data.slice(a.length))},e.addEventListener?e.addEventListener("message",s,!1):e.attachEvent("onmessage",s),n=function(){var t=l(arguments);return e.postMessage(a+t,"*"),t}),h.setImmediate=n,h.clearImmediate=p}function l(e){return c[A]=g.apply(void 0,e),A++}function g(e){var t=[].slice.call(arguments,1);return function(){"function"==typeof e?e.apply(void 0,t):new Function(""+e)()}}function d(e){if(u)setTimeout(g(d,e),0);else{var t=c[e];if(t){u=!0;try{t()}finally{p(e),u=!1}}}}function p(e){delete c[e]}}("undefined"==typeof self?void 0===e?this:e:self)}).call(this,r(8),r(9))},function(e,t,r){var n=r(84),i=r(96),o=r(36),a=r(21),s=r(22);function A(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function c(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?A(Object(r),!0).forEach((function(t){o(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):A(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var u=r(97),f=r(196),h=r(197),l=r(100),g=l.ValidateLibrary,d=l.ValidateObject,p=l.ValidateVersion,I=l.ValidatePartHash,y=l.ValidateWriteToken,b=l.ValidateParameters,E=r(198);t.permissionLevels={owner:{short:"Owner Only",description:"Only the owner has access to the object and ability to change permissions",settings:{visibility:0,statusCode:-1,kmsConk:!1}},editable:{short:"Editable",description:"Members of the editors group have full access to the object and the ability to change permissions",settings:{visibility:0,statusCode:-1,kmsConk:!0}},viewable:{short:"Viewable",description:"In addition to editors, members of the 'accessor' group can have read-only access to the object including playing video and retrieving metadata, images and documents",settings:{visibility:0,statusCode:0,kmsConk:!0}},listable:{short:"Publicly Listable",description:"Anyone can list the public portion of this object but only accounts with specific rights can access",settings:{visibility:1,statusCode:0,kmsConk:!0}},public:{short:"Public",description:"Anyone can access this object",settings:{visibility:10,statusCode:0,kmsConk:!0}}},t.Visibility=function(){var e=s(a.mark((function e(t){var r,n,i,o=this;return a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.id,n=t.clearCache,e.prev=1,i=this.utils.HashToAddress(r),n&&delete this.visibilityInfo[i],this.visibilityInfo[i]||(this.visibilityInfo[i]=new Promise(function(){var e=s(a.mark((function e(t,n){return a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,o.authClient.ContractHasMethod({contractAddress:i,methodName:"visibility"});case 3:if(e.sent){e.next=7;break}return t(0),e.abrupt("return");case 7:return e.t0=t,e.next=10,o.CallContractMethod({contractAddress:o.utils.HashToAddress(r),methodName:"visibility"});case 10:e.t1=e.sent,(0,e.t0)(e.t1),e.next=17;break;case 14:e.prev=14,e.t2=e.catch(0),n(e.t2);case 17:case"end":return e.stop()}}),e,null,[[0,14]])})));return function(t,r){return e.apply(this,arguments)}}())),e.prev=5,e.next=8,this.visibilityInfo[i];case 8:return e.abrupt("return",e.sent);case 11:throw e.prev=11,e.t0=e.catch(5),delete this.visibilityInfo[i],e.t0;case 15:e.next=22;break;case 17:if(e.prev=17,e.t1=e.catch(1),"CALL_EXCEPTION"!==e.t1.code){e.next=21;break}return e.abrupt("return",0);case 21:throw e.t1;case 22:case"end":return e.stop()}}),e,this,[[1,17],[5,11]])})));return function(t){return e.apply(this,arguments)}}(),t.Permission=function(){var e=s(a.mark((function e(t){var r,n,i,o,s,A,c,u,f=this;return a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.objectId,n=t.clearCache,d(r),e.next=4,this.AccessType({id:r});case 4:if(e.t0=e.sent,e.t1=this.authClient.ACCESS_TYPES.OBJECT,e.t0===e.t1){e.next=8;break}throw Error("Permission only valid for normal content objects: "+r);case 8:return e.next=10,this.Visibility({id:r,clearCache:n});case 10:return i=e.sent,e.next=13,this.CallContractMethod({contractAddress:this.utils.HashToAddress(r),methodName:"addressKMS"});case 13:if(o=e.sent,s=o&&"ikms".concat(this.utils.AddressToHash(o)),A=!1,!s){e.next=27;break}return e.t2=this,e.next=20,this.ContentObjectLibraryId({objectId:r});case 20:return e.t3=e.sent,e.t4=r,e.t5="eluv.caps.".concat(s),e.t6={libraryId:e.t3,objectId:e.t4,metadataSubtree:e.t5},e.next=26,e.t2.ContentObjectMetadata.call(e.t2,e.t6);case 26:A=!!e.sent;case 27:return e.next=29,this.CallContractMethod({contractAddress:this.utils.HashToAddress(r),methodName:"statusCode"});case 29:return c=e.sent,c=parseInt(c._hex,16),(u=Object.keys(this.permissionLevels).filter((function(e){var t=f.permissionLevels[e].settings;return i>=t.visibility&&c>=t.statusCode&&A===t.kmsConk})))||(u=A?["editable"]:["owner"]),e.abrupt("return",u.slice(-1)[0]);case 34:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}(),t.DefaultKMSAddress=s(a.mark((function e(){var t,r,n,i=arguments;return a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=i.length>0&&void 0!==i[0]?i[0]:{},r=t.tenantId,e.t0=r,!e.t0){e.next=8;break}return e.next=5,this.AccessType({id:r});case 5:e.t1=e.sent,e.t2=this.authClient.ACCESS_TYPES.TENANT,e.t0=e.t1===e.t2;case 8:if(!e.t0){e.next=14;break}return e.next=11,this.CallContractMethod({contractAddress:this.utils.HashToAddress(r),methodName:"addressKMS"});case 11:if(!(n=e.sent)){e.next=14;break}return e.abrupt("return",n);case 14:return e.next=16,this.CallContractMethod({contractAddress:this.contentSpaceAddress,methodName:"addressKMS"});case 16:return e.abrupt("return",e.sent);case 17:case"end":return e.stop()}}),e,this)}))),t.ContentSpaceId=function(){return this.contentSpaceId},t.ContentTypeOwner=function(){var e=s(a.mark((function e(t){var r,n,i,o;return a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.name,n=t.typeId,i=t.versionHash,e.next=3,this.ContentType({name:r,typeId:n,versionHash:i});case 3:return o=e.sent,e.t0=this.utils,e.next=7,this.ethClient.CallContractMethod({contractAddress:this.utils.HashToAddress(o.id),methodName:"owner",methodArgs:[]});case 7:return e.t1=e.sent,e.abrupt("return",e.t0.FormatAddress.call(e.t0,e.t1));case 9:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}(),t.ContentType=function(){var e=s(a.mark((function e(t){var r,n,i,o,s,A,c;return a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.name,n=t.typeId,i=t.versionHash,o=t.publicOnly,s=void 0!==o&&o,this.Log("Retrieving content type: ".concat(r||n||i)),i&&(n=this.utils.DecodeVersionHash(i).objectId),!r){e.next=13;break}return this.Log("Looking up type by name in content space metadata..."),e.prev=5,e.next=8,this.ContentObjectMetadata({libraryId:this.contentSpaceLibraryId,objectId:this.contentSpaceObjectId,metadataSubtree:u("public","contentTypes",r)});case 8:n=e.sent,e.next=13;break;case 11:e.prev=11,e.t0=e.catch(5);case 13:if(n){e.next=23;break}return this.Log("Looking up type by name in available types..."),e.next=17,this.ContentTypes();case 17:if(A=e.sent,!r){e.next=22;break}return e.abrupt("return",Object.values(A).find((function(e){return(e.name||"").toLowerCase()===r.toLowerCase()})));case 22:return e.abrupt("return",Object.values(A).find((function(e){return e.hash===i})));case 23:if(i){e.next=27;break}return e.next=26,this.LatestVersionHash({objectId:n});case 26:i=e.sent;case 27:if(e.prev=27,this.Log("Looking up type by ID..."),!s){e.next=39;break}return e.next=32,this.ContentObjectMetadata({libraryId:this.contentSpaceLibraryId,objectId:n,versionHash:i,metadataSubtree:"public"});case 32:if(e.t1=e.sent,e.t1){e.next=35;break}e.t1={};case 35:e.t2=e.t1,c={public:e.t2},e.next=45;break;case 39:return e.next=41,this.ContentObjectMetadata({libraryId:this.contentSpaceLibraryId,objectId:n,versionHash:i});case 41:if(e.t3=e.sent,e.t3){e.next=44;break}e.t3={};case 44:c=e.t3;case 45:return e.abrupt("return",{id:n,hash:i,name:c.public&&c.public.name||c.name||n,meta:c});case 48:throw e.prev=48,e.t4=e.catch(27),this.Log("Error looking up content type:"),this.Log(e.t4),new Error("Content Type ".concat(r||n," is invalid"));case 53:case"end":return e.stop()}}),e,this,[[5,11],[27,48]])})));return function(t){return e.apply(this,arguments)}}(),t.ContentTypes=s(a.mark((function e(){var t,r,n,i=this;return a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.contentTypes=this.contentTypes||{},this.Log("Looking up all available content types"),e.next=4,this.Collection({collectionType:"contentTypes"});case 4:return t=e.sent,this.Log("Personally available types:"),this.Log(t),r={},e.prev=8,e.next=11,this.ContentObjectMetadata({libraryId:this.contentSpaceLibraryId,objectId:this.contentSpaceObjectId,metadataSubtree:"public/contentTypes"});case 11:if(e.t0=e.sent,e.t0){e.next=14;break}e.t0={};case 14:r=e.t0,e.next=19;break;case 17:e.prev=17,e.t1=e.catch(8);case 19:return n=Object.values(r).map((function(e){return i.utils.HashToAddress(e)})),this.Log("Content space types:"),this.Log(n),t=t.concat(n).filter((function(e){return e})).map((function(e){return i.utils.FormatAddress(e)})).filter((function(e,t,r){return r.indexOf(e)===t})),e.next=25,Promise.all(t.map(function(){var e=s(a.mark((function e(t){var r;return a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=i.utils.AddressToObjectId(t),i.contentTypes[r]){e.next=11;break}return e.prev=2,e.next=5,i.ContentType({typeId:r,publicOnly:!0});case 5:i.contentTypes[r]=e.sent,e.next=11;break;case 8:e.prev=8,e.t0=e.catch(2),console.error(e.t0);case 11:case"end":return e.stop()}}),e,null,[[2,8]])})));return function(t){return e.apply(this,arguments)}}()));case 25:return e.abrupt("return",this.contentTypes);case 26:case"end":return e.stop()}}),e,this,[[8,17]])}))),t.ContentLibraries=s(a.mark((function e(){var t,r=this;return a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.Collection({collectionType:"libraries"});case 2:return t=e.sent,e.abrupt("return",t.map((function(e){return r.utils.AddressToLibraryId(e)})));case 4:case"end":return e.stop()}}),e,this)}))),t.ContentLibrary=function(){var e=s(a.mark((function e(t){var r,n,i;return a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.libraryId,g(r),n=u("qlibs",r),e.t0=this.utils,e.t1=this.HttpClient,e.next=7,this.authClient.AuthorizationHeader({libraryId:r});case 7:return e.t2=e.sent,e.t3=n,e.t4={headers:e.t2,method:"GET",path:e.t3},e.t5=e.t1.Request.call(e.t1,e.t4),e.next=13,e.t0.ResponseToJson.call(e.t0,e.t5);case 13:return i=e.sent,e.abrupt("return",c(c({},i),{},{meta:i.meta||{}}));case 15:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}(),t.ContentLibraryOwner=function(){var e=s(a.mark((function e(t){var r;return a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.libraryId,g(r),e.t0=this.utils,e.next=5,this.ethClient.CallContractMethod({contractAddress:this.utils.HashToAddress(r),methodName:"owner",methodArgs:[]});case 5:return e.t1=e.sent,e.abrupt("return",e.t0.FormatAddress.call(e.t0,e.t1));case 7:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}(),t.LibraryContentTypes=function(){var e=s(a.mark((function e(t){var r,n,i,o=this;return a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.libraryId,g(r),this.Log("Retrieving library content types for ".concat(r)),e.next=5,this.ethClient.CallContractMethod({contractAddress:this.utils.HashToAddress(r),methodName:"contentTypesLength",methodArgs:[]});case 5:if(n=e.sent.toNumber(),this.Log("".concat(n," types")),0!==n){e.next=9;break}return e.abrupt("return",{});case 9:return i={},e.next=12,Promise.all(Array.from(new Array(n),function(){var e=s(a.mark((function e(t,n){var s,A;return a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,o.ethClient.CallContractMethod({contractAddress:o.utils.HashToAddress(r),methodName:"contentTypes",methodArgs:[n]});case 2:return s=e.sent,A=o.utils.AddressToObjectId(s),e.next=6,o.ContentType({typeId:A});case 6:i[A]=e.sent;case 7:case"end":return e.stop()}}),e)})));return function(t,r){return e.apply(this,arguments)}}()));case 12:return this.Log(i),e.abrupt("return",i);case 14:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}(),t.ContentObjects=function(){var e=s(a.mark((function e(t){var r,n,i,o,s,A,c;return a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.libraryId,n=t.filterOptions,i=void 0===n?{}:n,g(r),this.Log("Retrieving content objects from ".concat(r)),o=u("qlibs",r,"q"),s={filter:[]},i.cacheId&&(s.cache_id=i.cacheId),i.start&&(s.start=i.start),i.limit&&(s.limit=i.limit),i.select&&(s.select=i.select),i.sort&&(s.sort_by=i.sort,i.sortDesc&&(s.sort_descending=!0)),A={eq:":eq:",neq:":ne:",lt:":lt:",lte:":le:",gt:":gt:",gte:":ge:",cnt:":co:",ncnt:":nc:"},c=function(e){var t=e.key,r=e.type,n=e.filter;s.filter.push("".concat(t).concat(A[r]).concat(n))},i.filter&&(Array.isArray(i.filter)?i.filter.forEach((function(e){return c(e)})):c(i.filter)),this.Log("Filter options:"),this.Log(i),e.t0=this.utils,e.t1=this.HttpClient,e.next=19,this.authClient.AuthorizationHeader({libraryId:r});case 19:return e.t2=e.sent,e.t3=o,e.t4=s,e.t5={headers:e.t2,method:"GET",path:e.t3,queryParams:e.t4},e.t6=e.t1.Request.call(e.t1,e.t5),e.next=26,e.t0.ResponseToJson.call(e.t0,e.t6);case 26:return e.abrupt("return",e.sent);case 27:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}(),t.ContentObject=function(){var e=s(a.mark((function e(t){var r,n,i,o,s;return a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.libraryId,n=t.objectId,i=t.versionHash,o=t.writeToken,b({libraryId:r,objectId:n,versionHash:i}),this.Log("Retrieving content object: ".concat(r||""," ").concat(o||i||n)),i&&(n=this.utils.DecodeVersionHash(i).objectId),s=u("q",o||i||n),e.t0=this.utils,e.t1=this.HttpClient,e.next=9,this.authClient.AuthorizationHeader({libraryId:r,objectId:n,versionHash:i});case 9:return e.t2=e.sent,e.t3=s,e.t4={headers:e.t2,method:"GET",path:e.t3},e.t5=e.t1.Request.call(e.t1,e.t4),e.next=15,e.t0.ResponseToJson.call(e.t0,e.t5);case 15:return e.abrupt("return",e.sent);case 16:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}(),t.ContentObjectOwner=function(){var e=s(a.mark((function e(t){var r;return a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.objectId,d(r),this.Log("Retrieving content object owner: ".concat(r)),e.t0=this.utils,e.next=6,this.ethClient.CallContractMethod({contractAddress:this.utils.HashToAddress(r),methodName:"owner",methodArgs:[]});case 6:return e.t1=e.sent,e.abrupt("return",e.t0.FormatAddress.call(e.t0,e.t1));case 8:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}(),t.ContentObjectTenantId=function(){var e=s(a.mark((function e(t){var r,n;return a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.objectId,(n=t.versionHash)?p(n):d(r),n&&(r=this.utils.DecodeVersionHash(n).objectId),this.objectTenantIds[r]){e.next=7;break}return e.next=6,this.authClient.MakeElvMasterCall({methodName:"elv_getTenantById",params:[this.contentSpaceId,r]});case 6:this.objectTenantIds[r]=e.sent;case 7:return e.abrupt("return",this.objectTenantIds[r]);case 8:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}(),t.ContentObjectLibraryId=function(){var e=s(a.mark((function e(t){var r,n,i=this;return a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.objectId,(n=t.versionHash)?p(n):d(r),n&&(r=this.utils.DecodeVersionHash(n).objectId),e.next=5,this.authClient.AccessType(r);case 5:e.t0=e.sent,e.next=e.t0===this.authClient.ACCESS_TYPES.LIBRARY?8:e.t0===this.authClient.ACCESS_TYPES.OBJECT?9:e.t0===this.authClient.ACCESS_TYPES.OTHER?20:21;break;case 8:return e.abrupt("return",this.utils.AddressToLibraryId(this.utils.HashToAddress(r)));case 9:return this.objectLibraryIds[r]||(this.Log("Retrieving content object library ID: ".concat(r||n)),this.objectLibraryIds[r]=new Promise(function(){var e=s(a.mark((function e(t,n){return a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.t0=t,e.t1=i.utils,e.next=5,i.CallContractMethod({contractAddress:i.utils.HashToAddress(r),methodName:"libraryAddress"});case 5:e.t2=e.sent,e.t3=e.t1.AddressToLibraryId.call(e.t1,e.t2),(0,e.t0)(e.t3),e.next=13;break;case 10:e.prev=10,e.t4=e.catch(0),n(e.t4);case 13:case"end":return e.stop()}}),e,null,[[0,10]])})));return function(t,r){return e.apply(this,arguments)}}())),e.prev=10,e.next=13,this.objectLibraryIds[r];case 13:return e.abrupt("return",e.sent);case 16:throw e.prev=16,e.t1=e.catch(10),delete this.objectLibraryIds[r],e.t1;case 20:throw Error("Unable to retrieve library ID for ".concat(n||r,": Unknown type. (wrong network or deleted object?)"));case 21:return e.abrupt("return",this.contentSpaceLibraryId);case 22:case"end":return e.stop()}}),e,this,[[10,16]])})));return function(t){return e.apply(this,arguments)}}(),t.ProduceMetadataLinks=function(){var e=s(a.mark((function e(t){var r,n,o,A,f,h,l,g,d,p=this;return a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.libraryId,n=t.objectId,o=t.versionHash,A=t.path,f=void 0===A?"/":A,h=t.metadata,l=t.authorizationToken,g=t.noAuth,h&&"object"===i(h)){e.next=3;break}return e.abrupt("return",h);case 3:if(!Array.isArray(h)){e.next=7;break}return e.next=6,this.utils.LimitedMap(5,h,function(){var e=s(a.mark((function e(t,i){return a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,p.ProduceMetadataLinks({libraryId:r,objectId:n,versionHash:o,path:u(f,i.toString()),metadata:t,authorizationToken:l,noAuth:g});case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),e)})));return function(t,r){return e.apply(this,arguments)}}());case 6:return e.abrupt("return",e.sent);case 7:if(!h["/"]||!h["/"].match(/\.\/(rep|files)\/.+/)&&!h["/"].match(/^\/?qfab\/([\w]+)\/?(rep|files)\/.+/)){e.next=16;break}return e.t0=c,e.t1=c({},h),e.t2={},e.next=13,this.LinkUrl({libraryId:r,objectId:n,versionHash:o,linkPath:f,authorizationToken:l});case 13:return e.t3=e.sent,e.t4={url:e.t3},e.abrupt("return",(0,e.t0)(e.t1,e.t2,e.t4));case 16:return d={},e.next=19,this.utils.LimitedMap(5,Object.keys(h),function(){var e=s(a.mark((function e(t){return a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,p.ProduceMetadataLinks({libraryId:r,objectId:n,versionHash:o,path:u(f,t),metadata:h[t],authorizationToken:l,noAuth:g});case 2:d[t]=e.sent;case 3:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}());case 19:return e.abrupt("return",d);case 20:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}(),t.MetadataAuth=function(){var e=s(a.mark((function e(t){var r,n,i,o,s,A,c,u,f,h,l,g,d;return a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.libraryId,n=t.objectId,i=t.versionHash,o=t.path,s=void 0===o?"/":o,A=t.channelAuth,c=void 0!==A&&A,u=t.noAuth,f=void 0!==u&&u,b({libraryId:r,objectId:n,versionHash:i}),i&&(n=this.utils.DecodeVersionHash(i).objectId),f=this.noAuth||f,h=f,f){e.next=14;break}return e.next=8,this.Visibility({id:n});case 8:return g=e.sent,e.next=11,this.AccessType({id:n});case 11:l=e.sent,h=(s||"").replace(/^\/+/,"").startsWith("public"),f=g>=10||h&&g>=1;case 14:if(!this.oauthToken){e.next=22;break}return e.next=17,this.authClient.KMSAddress({objectId:n,versionHash:i});case 17:if(!(d=e.sent)||this.utils.EqualAddress(d,this.utils.nullAddress)){e.next=22;break}return e.next=21,this.authClient.AuthorizationToken({libraryId:r,objectId:n,versionHash:i,channelAuth:!0,oauthToken:this.oauthToken});case 21:return e.abrupt("return",e.sent);case 22:if(this.inaccessibleLibraries[r]||!h||l!==this.authClient.ACCESS_TYPES.OBJECT||c){e.next=48;break}if(e.prev=23,e.t0=this.authClient,e.t1=r,e.t1){e.next=30;break}return e.next=29,this.ContentObjectLibraryId({objectId:n,versionHash:i});case 29:e.t1=e.sent;case 30:return e.t2=e.t1,e.t3=f,e.t4={libraryId:e.t2,noAuth:e.t3},e.next=35,e.t0.AuthorizationToken.call(e.t0,e.t4);case 35:return e.abrupt("return",e.sent);case 38:if(e.prev=38,e.t5=e.catch(23),!e.t5.message||!e.t5.message.toLowerCase().startsWith("access denied")){e.next=45;break}return this.inaccessibleLibraries[r]=!0,e.next=44,this.authClient.AuthorizationToken({libraryId:r,objectId:n,versionHash:i,noAuth:f,channelAuth:c});case 44:return e.abrupt("return",e.sent);case 45:throw e.t5;case 46:e.next=51;break;case 48:return e.next=50,this.authClient.AuthorizationToken({libraryId:r,objectId:n,versionHash:i,noAuth:f,channelAuth:c});case 50:return e.abrupt("return",e.sent);case 51:case"end":return e.stop()}}),e,this,[[23,38]])})));return function(t){return e.apply(this,arguments)}}(),t.ContentObjectMetadata=function(){var e=s(a.mark((function e(t){var r,n,i,o,s,A,h,l,g,d,p,I,y,m,C,v,B,w,Q,k,_,S,D,M,R,x,O,N,P,F,j,T=arguments;return a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.libraryId,n=t.objectId,i=t.versionHash,o=t.writeToken,s=t.metadataSubtree,A=void 0===s?"/":s,h=t.localizationSubtree,l=t.queryParams,g=void 0===l?{}:l,d=t.select,p=void 0===d?[]:d,I=t.remove,y=void 0===I?[]:I,m=t.authorizationToken,C=t.noAuth,v=void 0!==C&&C,B=t.resolveLinks,w=void 0!==B&&B,Q=t.resolveIncludeSource,k=void 0!==Q&&Q,_=t.resolveIgnoreErrors,S=void 0!==_&&_,D=t.linkDepthLimit,M=void 0===D?1:D,R=t.produceLinkUrls,x=void 0!==R&&R,b({libraryId:r,objectId:n,versionHash:i}),this.Log("Retrieving content object metadata: ".concat(r||""," ").concat(n||i," ").concat(o||"","\n Subtree: ").concat(A)),g=c({},g||{}),i&&(n=this.utils.DecodeVersionHash(i).objectId),O=u("q",o||i||n,"meta",A),e.next=8,this.MetadataAuth({libraryId:r,objectId:n,versionHash:i,path:A,noAuth:v});case 8:return N=e.sent,P=[m,g.authorization,N].flat().filter((function(e){return e})),delete g.authorization,e.prev=11,e.next=14,this.utils.ResponseToJson(this.HttpClient.Request({headers:{Authorization:P.map((function(e){return"Bearer ".concat(e)}))},queryParams:c(c({},g),{},{select:p,remove:y,link_depth:M,resolve:w,resolve_include_source:k,resolve_ignore_errors:S}),method:"GET",path:O}));case 14:F=e.sent,e.next=27;break;case 17:if(e.prev=17,e.t0=e.catch(11),404===e.t0.status){e.next=21;break}throw e.t0;case 21:if(!f.get(e.t0.body,"errors[0].cause.cause.cause.qwtoken")){e.next=26;break}throw e.t0;case 26:F="/"===A?{}:void 0;case 27:if(!x){e.next=31;break}return e.next=30,this.ProduceMetadataLinks({libraryId:r,objectId:n,versionHash:i,path:A,metadata:F,authorizationToken:m,noAuth:v});case 30:F=e.sent;case 31:if(h){e.next=33;break}return e.abrupt("return",F);case 33:return e.prev=33,e.next=36,this.ContentObjectMetadata(c(c({},T[0]),{},{metadataSubtree:h,localizationSubtree:void 0}));case 36:return j=e.sent,e.abrupt("return",E({},F,j,(function(e,t){return null===t||""===t?e:void 0})));case 40:return e.prev=40,e.t1=e.catch(33),this.Log(e.t1,!0),e.abrupt("return",F);case 44:case"end":return e.stop()}}),e,this,[[11,17],[33,40]])})));return function(t){return e.apply(this,arguments)}}(),t.AssetMetadata=function(){var e=s(a.mark((function e(t){var r,i,o,s,A,f,h,l,g,d=this;return a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.libraryId,i=t.objectId,o=t.versionHash,s=t.metadata,A=t.localization,f=t.noAuth,h=t.produceLinkUrls,l=void 0!==h&&h,b({libraryId:r,objectId:i,versionHash:o}),i||(i=this.utils.DecodeVersionHash(o).objectId),s){e.next=12;break}return e.next=6,this.ContentObjectMetadata({libraryId:r,objectId:i,versionHash:o,metadataSubtree:"public/asset_metadata",resolveLinks:!0,linkDepthLimit:2,resolveIgnoreErrors:!0,produceLinkUrls:l,noAuth:f});case 6:if(e.t0=e.sent,e.t0){e.next=9;break}e.t0={};case 9:s=e.t0,e.next=16;break;case 12:if(!l){e.next=16;break}return e.next=15,this.ProduceMetadataLinks({libraryId:r,objectId:i,versionHash:o,path:u("public","asset_metadata"),metadata:s,noAuth:f});case 15:s=e.sent;case 16:return s.info||(s.info={}),g=c({},s),A&&A.reverse().forEach((function(e){var t,r=(t=d.utils).SafeTraverse.apply(t,[s].concat(n(e)))||{};g=E({},g,r,(function(e,t){return null===t||""===t?e:void 0}))})),e.abrupt("return",g);case 20:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}(),t.ContentObjectVersions=function(){var e=s(a.mark((function e(t){var r,n,i;return a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.libraryId,n=t.objectId,b({libraryId:r,objectId:n}),this.Log("Retrieving content object versions: ".concat(r||""," ").concat(n)),i=u("qid",n),e.t0=this.utils,e.t1=this.HttpClient,e.next=8,this.authClient.AuthorizationHeader({libraryId:r,objectId:n});case 8:return e.t2=e.sent,e.t3=i,e.t4={headers:e.t2,method:"GET",path:e.t3},e.t5=e.t1.Request.call(e.t1,e.t4),e.abrupt("return",e.t0.ResponseToJson.call(e.t0,e.t5));case 13:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}(),t.LatestVersionHash=function(){var e=s(a.mark((function e(t){var r,n,i,o;return a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.objectId,(n=t.versionHash)&&(r=this.utils.DecodeVersionHash(n).objectId),d(r),e.prev=3,e.next=6,this.CallContractMethod({contractAddress:this.utils.HashToAddress(r),methodName:"objectHash"});case 6:i=e.sent,e.next=11;break;case 9:e.prev=9,e.t0=e.catch(3);case 11:if(i){e.next=20;break}return e.next=14,this.CallContractMethod({contractAddress:this.utils.HashToAddress(r),methodName:"countVersionHashes"});case 14:if((o=e.sent).toNumber()){e.next=17;break}throw Error("Unable to determine latest version hash for ".concat(n||r," - Item deleted?"));case 17:return e.next=19,this.CallContractMethod({contractAddress:this.utils.HashToAddress(r),methodName:"versionHashes",methodArgs:[o-1]});case 19:i=e.sent;case 20:return e.abrupt("return",i);case 21:case"end":return e.stop()}}),e,this,[[3,9]])})));return function(t){return e.apply(this,arguments)}}(),t.AvailableDRMs=s(a.mark((function e(){var t,r,n,i,o,s,A,c,u;return a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=["clear","aes-128"],"undefined"!=typeof window){e.next=3;break}return e.abrupt("return",t);case 3:if(window.navigator&&window.navigator.userAgent&&((r=window.navigator.userAgent.match(/(iPad|iPhone|iphone|iPod).*?(OS |os |OS_)(\d+((_|\.)\d)?((_|\.)\d)?)/))&&r[3]&&(n=r[3].split("_"),i=parseInt(n[0]),o=parseInt(n[1]),(i>13||13===i&&o>=1)&&(t[1]="sample-aes",t[2]="fairplay")),/^((?!chrome|android).)*safari/i.test(window.navigator.userAgent)&&(s=window.navigator.userAgent.match(/.+Version\/(\d+)\.(\d+)/))&&s[2]&&(A=parseInt(s[1]),c=parseInt(s[2]),(A>13||13===A&&c>=1)&&(t[1]="sample-aes",t[2]="fairplay"))),"undefined"==typeof window||"function"==typeof window.navigator.requestMediaKeySystemAccess){e.next=6;break}return e.abrupt("return",t);case 6:return e.prev=6,u=[{initDataTypes:["cenc"],audioCapabilities:[{contentType:'audio/mp4;codecs="mp4a.40.2"'}],videoCapabilities:[{contentType:'video/mp4;codecs="avc1.42E01E"'}]}],e.next=10,navigator.requestMediaKeySystemAccess("com.widevine.alpha",u);case 10:t.push("widevine"),e.next=15;break;case 13:e.prev=13,e.t0=e.catch(6);case 15:return e.abrupt("return",t);case 16:case"end":return e.stop()}}),e,null,[[6,13]])}))),t.PlayoutPathResolution=function(){var e=s(a.mark((function e(t){var r,n,i,o,s,A,c,f,h,l,g,d,p,I,y,b,E;return a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.libraryId,n=t.objectId,i=t.versionHash,o=t.writeToken,s=t.linkPath,A=t.handler,c=t.offering,f=void 0===c?"":c,h=t.signedLink,l=void 0!==h&&h,g=t.authorizationToken,r){e.next=5;break}return e.next=4,this.ContentObjectLibraryId({objectId:n});case 4:r=e.sent;case 5:if(i){e.next=9;break}return e.next=8,this.LatestVersionHash({objectId:n});case 8:i=e.sent;case 9:if(d=u("qlibs",r,"q",o||i,"rep",A,f,"options.json"),!s){e.next=26;break}return e.next=13,this.ContentObjectMetadata({libraryId:r,objectId:n,versionHash:i,writeToken:o,metadataSubtree:s,resolveLinks:!1,resolveIgnoreErrors:!0,resolveIncludeSource:!0,authorizationToken:g});case 13:if(E=e.sent,b=!!E&&!!E["/"]&&!E["/"].endsWith("options.json"),d=u("qlibs",r,"q",o||i,"meta",s),l){e.next=25;break}return e.next=19,this.LinkTarget({libraryId:r,objectId:n,versionHash:i,writeToken:o,linkPath:s,linkInfo:E,authorizationToken:g});case 19:return y=e.sent,I=this.utils.DecodeVersionHash(y).objectId,e.next=23,this.ContentObjectLibraryId({objectId:I});case 23:p=e.sent,b||f||(d=u("q",y,"rep",A,"options.json"));case 25:b&&(d=u(d,f,"options.json"));case 26:return e.abrupt("return",{path:d,multiOfferingLink:b,linkTarget:{libraryId:p,objectId:I,versionHash:y}});case 27:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}(),t.AvailableOfferings=function(){var e=s(a.mark((function e(t){var r,n,i,o,s,A,c,u,f,h,l,g;return a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.objectId,n=t.versionHash,i=t.writeToken,o=t.linkPath,s=t.signedLink,A=t.directLink,c=t.handler,u=void 0===c?"playout":c,f=t.authorizationToken,r||(r=this.utils.DecodeVersionHash(n).objectId),!A){e.next=15;break}return e.t0=this,e.next=6,this.ContentObjectLibraryId({objectId:r});case 6:return e.t1=e.sent,e.t2=r,e.t3=n,e.t4=o,e.t5=f,e.t6={libraryId:e.t1,objectId:e.t2,versionHash:e.t3,metadataSubtree:e.t4,resolveLinks:!0,authorizationToken:e.t5},e.next=14,e.t0.ContentObjectMetadata.call(e.t0,e.t6);case 14:return e.abrupt("return",e.sent);case 15:return e.next=17,this.PlayoutPathResolution({objectId:r,versionHash:n,writeToken:i,linkPath:o,signedLink:s,handler:u,authorizationToken:f});case 17:return h=e.sent,l=h.path,e.prev=19,e.t7=f,e.next=23,this.authClient.AuthorizationToken({objectId:r,channelAuth:!0,oauthToken:this.oauthToken});case 23:return e.t8=e.sent,g=[e.t7,e.t8].flat().filter((function(e){return e})),e.next=27,this.utils.ResponseToJson(this.HttpClient.Request({path:l,method:"GET",headers:{Authorization:"Bearer ".concat(g.join(","))}}));case 27:return e.abrupt("return",e.sent);case 30:if(e.prev=30,e.t9=e.catch(19),!e.t9.status||500!==parseInt(e.t9.status)){e.next=34;break}return e.abrupt("return",{});case 34:throw e.t9;case 35:case"end":return e.stop()}}),e,this,[[19,30]])})));return function(t){return e.apply(this,arguments)}}(),t.PlayoutOptions=function(){var e=s(a.mark((function e(t){var r,n,i,A,f,h,l,g,I,y,b,E,m,C,v,B,w,Q,k,_,S,D,M,R,x,O,N,P,F,j,T,U,L,H,G,Y,K,q,J,z,V,Z,W,X,$,ee,te=this;return a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.offeringURI,n=t.objectId,i=t.versionHash,A=t.writeToken,f=t.linkPath,h=t.signedLink,l=void 0!==h&&h,g=t.protocols,I=void 0===g?["dash","hls"]:g,y=t.handler,b=void 0===y?"playout":y,E=t.offering,m=void 0===E?"default":E,C=t.playoutType,v=t.drms,B=void 0===v?[]:v,w=t.context,Q=t.hlsjsProfile,k=void 0===Q||Q,_=t.authorizationToken,S=t.options,D=void 0===S?{}:S,!r){e.next=8;break}if(M=r.match(/(hq__[^/]+)\/rep\/([^/]+)\/([^/]+)\/options.json/),i=M[1],b=M[2],m=M[3],i&&b&&m){e.next=8;break}throw Error("Invalid offering URI: ".concat(r));case 8:if(i?p(i):d(n),I=I.map((function(e){return e.toLowerCase()})),B=B.map((function(e){return e.toLowerCase()})),n){e.next=15;break}n=this.utils.DecodeVersionHash(i).objectId,e.next=19;break;case 15:if(i){e.next=19;break}return e.next=18,this.LatestVersionHash({objectId:n});case 18:i=e.sent;case 19:return e.next=21,this.ContentObjectLibraryId({objectId:n});case 21:if(R=e.sent,e.prev=22,f){e.next=29;break}return x=u("public","asset_metadata","sources",m),e.next=27,this.ContentObjectMetadata({libraryId:R,objectId:n,versionHash:i,metadataSubtree:x,authorizationToken:_});case 27:e.sent&&(f=x);case 29:e.next=33;break;case 31:e.prev=31,e.t0=e.catch(22);case 33:return e.next=35,this.PlayoutPathResolution({libraryId:R,objectId:n,versionHash:i,writeToken:A,linkPath:f,signedLink:l,handler:b,offering:m,authorizationToken:_});case 35:if(O=e.sent,N=O.path,P=O.linkTarget,e.t1=this.authClient,e.t2=P.objectId||n,e.t3=P.versionHash||i,e.t3){e.next=45;break}return e.next=44,this.LatestVersionHash({objectId:n});case 44:e.t3=e.sent;case 45:return e.t4=e.t3,e.t5=I,e.t6=B,e.t7=w,e.t8={objectId:e.t2,versionHash:e.t4,protocols:e.t5,drms:e.t6,context:e.t7},F=e.t1.AudienceData.call(e.t1,e.t8),e.t9=_,e.next=54,this.authClient.AuthorizationToken({libraryId:R,objectId:n,channelAuth:!0,oauthToken:this.oauthToken,audienceData:F});case 54:return e.t10=e.sent,j=[e.t9,e.t10].flat().filter((function(e){return e})),T=c({authorization:j,resolve:!!f},D),e.t11=Object,e.next=60,this.utils.ResponseToJson(this.HttpClient.Request({path:N,method:"GET",queryParams:T}));case 60:if(e.t12=e.sent,U=e.t11.values.call(e.t11,e.t12),l||!P.versionHash){e.next=68;break}return e.t13=_,e.next=66,this.authClient.AuthorizationToken({libraryId:P.libraryId,objectId:P.objectId,channelAuth:!0,oauthToken:this.oauthToken,audienceData:F});case 66:e.t14=e.sent,T.authorization=[e.t13,e.t14].flat().filter((function(e){return e}));case 68:L={},Y=0;case 70:if(!(Y<U.length)){e.next=116;break}if(K=U[Y],q=K.properties.protocol,J=K.properties.drm,H=H||K.sid,G=G||!!K.properties.multiview,H&&(T.sid=H),z=K.uri.split("?")[0],C&&(z=z.replace("playlist","playlist-".concat(C))),V=K.properties.license_servers,Z=K.properties.cert,k&&"hls"===q&&"aes-128"===J&&(T.player_profile="hls-js"),e.t15=c,e.t16=c({},L[q]||{}),e.t17={},e.t18=c,e.t19=c({},(L[q]||{}).playoutMethods||{}),e.t20={},e.t21=o,e.t22={},e.t23=J||"clear",!l){e.next=97;break}return e.next=94,this.LinkUrl({versionHash:i,linkPath:u(f,m,z),queryParams:T,noAuth:!0});case 94:e.t24=e.sent,e.next=100;break;case 97:return e.next=99,this.Rep({libraryId:P.libraryId||R,objectId:P.objectId||n,versionHash:P.versionHash||i,rep:u(b,m,z),noAuth:!0,queryParams:T});case 99:e.t24=e.sent;case 100:for(W in e.t25=e.t24,e.t26=J?o({},J,{licenseServers:V,cert:Z}):void 0,e.t27={playoutUrl:e.t25,drms:e.t26},e.t28=(0,e.t21)(e.t22,e.t23,e.t27),e.t29=(0,e.t18)(e.t19,e.t20,e.t28),e.t30={playoutMethods:e.t29},L[q]=(0,e.t15)(e.t16,e.t17,e.t30),L[q].playoutMethods)L[q].playoutMethods[W].drms&&L[q].playoutMethods[W].drms[J]&&L[q].playoutMethods[W].drms[J].cert&&((X=new URL(L[q].playoutMethods[W].playoutUrl)).pathname=X.pathname.split("/").slice(0,-1).concat(["drm.cert"]).join("/"),L[q].playoutMethods[W].drms[J].cert_url=X.toString());if($=I.includes(q),ee=B.includes(J||"clear")||0===B.length&&!J,$&&ee){e.next=112;break}return e.abrupt("continue",113);case 112:(!L[q].playoutUrl||J&&"clear"!==J)&&(L[q].playoutUrl=L[q].playoutMethods[J||"clear"].playoutUrl,L[q].drms=L[q].playoutMethods[J||"clear"].drms);case 113:Y++,e.next=70;break;case 116:return G&&H&&(L.sessionId=H,L.multiview=!0,L.AvailableViews=s(a.mark((function e(){return a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.t0=te.utils,e.next=3,te.HttpClient.Request({path:u("q",P.versionHash||i,"rep",b,m,"views.json"),method:"GET",queryParams:{sid:H,authorization:j}});case 3:return e.t1=e.sent,e.next=6,e.t0.ResponseToFormat.call(e.t0,"json",e.t1);case 6:return e.abrupt("return",e.sent);case 7:case"end":return e.stop()}}),e)}))),L.SwitchView=function(){var e=s(a.mark((function e(t){return a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,te.HttpClient.Request({path:u("q",P.versionHash||i,"rep",b,m,"select_view"),method:"POST",queryParams:{sid:H,authorization:j},body:{view:t}});case 2:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()),this.Log(L),e.abrupt("return",L);case 119:case"end":return e.stop()}}),e,this,[[22,31]])})));return function(t){return e.apply(this,arguments)}}(),t.BitmovinPlayoutOptions=function(){var e=s(a.mark((function e(t){var r,n,i,o,s,A,c,u,f,h,l,g,I,y,b,E,m,C,v,B,w,Q,k,_;return a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.objectId,n=t.versionHash,i=t.writeToken,o=t.linkPath,s=t.signedLink,A=void 0!==s&&s,c=t.protocols,u=void 0===c?["dash","hls"]:c,f=t.drms,h=void 0===f?[]:f,l=t.handler,g=void 0===l?"playout":l,I=t.offering,y=void 0===I?"default":I,b=t.playoutType,E=t.context,m=t.authorizationToken,C=t.options,v=void 0===C?{}:C,n?p(n):d(r),r||(r=this.utils.DecodeVersionHash(n).objectId),e.next=5,this.PlayoutOptions({objectId:r,versionHash:n,writeToken:i,linkPath:o,signedLink:A,protocols:u,drms:h,handler:g,offering:y,playoutType:b,hlsjsProfile:!1,context:E,authorizationToken:m,options:v});case 5:return delete(B=e.sent).playoutMethods,e.next=9,this.PlayoutPathResolution({objectId:r,versionHash:n,writeToken:i,linkPath:o,signedLink:A,handler:g,offering:y,authorizationToken:m});case 9:if(w=e.sent,Q=w.linkTarget,k=[],m&&k.push(m),!A&&Q.versionHash){e.next=21;break}return e.t0=k,e.next=17,this.authClient.AuthorizationToken({objectId:r,channelAuth:!0,oauthToken:this.oauthToken});case 17:e.t1=e.sent,e.t0.push.call(e.t0,e.t1),e.next=26;break;case 21:return e.t2=k,e.next=24,this.authClient.AuthorizationToken({libraryId:Q.libraryId,objectId:Q.objectId,channelAuth:!0,oauthToken:this.oauthToken});case 24:e.t3=e.sent,e.t2.push.call(e.t2,e.t3);case 26:return _={drm:{}},Object.keys(B).forEach((function(e){var t=B[e];_[e]=t.playoutUrl,t.drms&&Object.keys(t.drms).forEach((function(e){if(t.drms[e].licenseServers&&0!==t.drms[e].licenseServers.length){var r=function(e){return e.toLowerCase().startsWith("https")},n=t.drms[e].licenseServers;n.find(r)&&(n=n.filter(r));var i=n.sort((function(){return.5-Math.random()}))[0];_.drm[e]||(_.drm[e]={LA_URL:i,headers:{Authorization:"Bearer ".concat(k.flat().filter((function(e){return e})).join(","))}})}}))})),e.abrupt("return",_);case 29:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}(),t.CallBitcodeMethod=function(){var e=s(a.mark((function e(t){var r,n,i,o,s,A,c,f,h,l,g,d,p,I,y,E;return a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.libraryId,n=t.objectId,i=t.versionHash,o=t.writeToken,s=t.method,A=t.queryParams,c=void 0===A?{}:A,f=t.body,h=void 0===f?{}:f,l=t.headers,g=void 0===l?{}:l,d=t.constant,p=void 0===d||d,I=t.format,y=void 0===I?"json":I,b({libraryId:r,objectId:n,versionHash:i}),s){e.next=4;break}throw"Bitcode method not specified";case 4:if(i&&(n=this.utils.DecodeVersionHash(i).objectId),E=u("q",o||i||n,"call",s),r&&(E=u("qlibs",r,E)),g.authorization||g.Authorization){e.next=12;break}return e.next=11,this.authClient.AuthorizationHeader({libraryId:r,objectId:n,update:!p});case 11:g.Authorization=e.sent.Authorization;case 12:return this.Log("Calling bitcode method: ".concat(r||""," ").concat(n||i," ").concat(o||"","\n ").concat(p?"GET":"POST"," ").concat(E,"\n Query Params:\n ").concat(JSON.stringify(c||""),"\n Body:\n ").concat(JSON.stringify(h||""),"\n Headers\n ").concat(JSON.stringify(g||""))),e.t0=this.utils,e.t1=y,e.next=17,this.HttpClient.Request({body:h,headers:g,method:p?"GET":"POST",path:E,queryParams:c,failover:!1});case 17:return e.t2=e.sent,e.abrupt("return",e.t0.ResponseToFormat.call(e.t0,e.t1,e.t2));case 19:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}(),t.Rep=function(){var e=s(a.mark((function e(t){var r,n,i,o,s,A,c,u,f,h,l,g;return a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.libraryId,n=t.objectId,i=t.versionHash,o=t.rep,s=t.queryParams,A=void 0===s?{}:s,c=t.channelAuth,u=void 0!==c&&c,f=t.noAuth,h=void 0!==f&&f,l=t.noCache,g=void 0!==l&&l,b({libraryId:r,objectId:n,versionHash:i}),o){e.next=4;break}throw"Rep not specified";case 4:return e.abrupt("return",this.FabricUrl({libraryId:r,objectId:n,versionHash:i,rep:o,queryParams:A,channelAuth:u,noAuth:h,noCache:g}));case 5:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}(),t.PublicRep=function(){var e=s(a.mark((function e(t){var r,n,i,o,s,A;return a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.libraryId,n=t.objectId,i=t.versionHash,o=t.rep,s=t.queryParams,A=void 0===s?{}:s,b({libraryId:r,objectId:n,versionHash:i}),o){e.next=4;break}throw"Rep not specified";case 4:return e.abrupt("return",this.FabricUrl({libraryId:r,objectId:n,versionHash:i,publicRep:o,queryParams:A,noAuth:!0}));case 5:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}(),t.FabricUrl=function(){var e=s(a.mark((function e(t){var r,n,i,o,s,A,f,h,l,g,d,p,I,y,E,m,C,v;return a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.libraryId,n=t.objectId,i=t.versionHash,o=t.writeToken,s=t.partHash,A=t.rep,f=t.publicRep,h=t.call,l=t.queryParams,g=void 0===l?{}:l,d=t.channelAuth,p=void 0!==d&&d,I=t.noAuth,y=void 0!==I&&I,E=t.noCache,m=void 0!==E&&E,(n||i)&&b({libraryId:r,objectId:n,versionHash:i}),i&&(n=this.utils.DecodeVersionHash(i).objectId),this.Log("Building Fabric URL:\n libraryId: ".concat(r,"\n objectId: ").concat(n,"\n versionHash: ").concat(i,"\n writeToken: ").concat(o,"\n partHash: ").concat(s,"\n rep: ").concat(A,"\n publicRep: ").concat(f,"\n call: ").concat(h,"\n channelAuth: ").concat(p,"\n noAuth: ").concat(y,"\n noCache: ").concat(m,"\n queryParams: ").concat(JSON.stringify(g||{},null,2))),C=[],g.authorization&&C.push(g.authorization),y&&g.authorization){e.next=12;break}return e.t0=C,e.next=10,this.authClient.AuthorizationToken({libraryId:r,objectId:n,versionHash:i,channelAuth:p,noAuth:y,noCache:m});case 10:e.t1=e.sent,e.t0.push.call(e.t0,e.t1);case 12:if(g=c(c({},g),{},{authorization:C.flat()}),!A&&!f||!n||i){e.next=17;break}return e.next=16,this.LatestVersionHash({objectId:n});case 16:i=e.sent;case 17:return v="",r?(v=u(v,"qlibs",r),(n||i)&&(v=u(v,"q",o||i||n))):i&&(v=u("q",i)),s?v=u(v,"data",s):A?v=u(v,"rep",A):f?v=u(v,"public",f):h&&(v=u(v,"call",h)),e.abrupt("return",this.HttpClient.URL({path:v,queryParams:g}));case 21:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}(),t.FileUrl=function(){var e=s(a.mark((function e(t){var r,n,i,o,s,A,f,h,l,g,d,p;return a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.libraryId,n=t.objectId,i=t.versionHash,o=t.writeToken,s=t.filePath,A=t.queryParams,f=void 0===A?{}:A,h=t.noCache,l=void 0!==h&&h,b({libraryId:r,objectId:n,versionHash:i}),s){e.next=4;break}throw"File path not specified";case 4:return i&&(n=this.utils.DecodeVersionHash(i).objectId),g=r?u("qlibs",r,"q",o||i||n):u("q",i),e.next=8,this.authClient.AuthorizationToken({libraryId:r,objectId:n,noCache:l});case 8:return d=e.sent,f=c(c({},f),{},{authorization:d}),e.next=12,this.ContentObjectMetadata({libraryId:r,objectId:n,versionHash:i,writeToken:o,metadataSubtree:u("files",s)});case 12:return p=e.sent,p&&p["."].encryption&&"cgck"===p["."].encryption.scheme?(g=u(g,"rep","files_download",s),f["header-x_decryption_mode"]="decrypt"):g=u(g,"files",s),e.abrupt("return",this.HttpClient.URL({path:g,queryParams:f}));case 16:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}(),t.ContentObjectImageUrl=function(){var e=s(a.mark((function e(t){var r,n,i,o,s,A,c;return a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.libraryId,n=t.objectId,i=t.versionHash,o=t.height,s=t.imagePath,A=void 0===s?"public/display_image":s,b({libraryId:r,objectId:n,versionHash:i}),i){e.next=6;break}return e.next=5,this.LatestVersionHash({objectId:n});case 5:i=e.sent;case 6:if(this.Log("Retrieving content object image url: ".concat(r," ").concat(n," ").concat(i)),this.objectImageUrls[i]){e.next=26;break}return e.prev=8,e.next=11,this.ContentObjectMetadata({versionHash:i,metadataSubtree:A});case 11:if(e.sent){e.next=15;break}return this.Log("No image url set: ".concat(r," ").concat(n," ").concat(i)),e.abrupt("return");case 15:e.next=21;break;case 17:e.prev=17,e.t0=e.catch(8),this.Log("Unable to query for image metadata: ".concat(r," ").concat(n," ").concat(i),!0),this.Log(e.t0,!0);case 21:return c={},o&&!isNaN(parseInt(o))&&(c.height=parseInt(o)),e.next=25,this.LinkUrl({versionHash:i,linkPath:A,queryParams:c});case 25:this.objectImageUrls[i]=e.sent;case 26:return e.abrupt("return",this.objectImageUrls[i]);case 27:case"end":return e.stop()}}),e,this,[[8,17]])})));return function(t){return e.apply(this,arguments)}}(),t.ContentObjectGraph=function(){var e=s(a.mark((function e(t){var r,n,i,o,A,c,f,h,l,g,d=this;return a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.libraryId,n=t.objectId,i=t.versionHash,o=t.autoUpdate,A=void 0!==o&&o,c=t.select,b({libraryId:r,objectId:n,versionHash:i}),this.Log("Retrieving content object graph: ".concat(r||""," ").concat(n||i)),i&&(n=this.utils.DecodeVersionHash(i).objectId),f=u("q",i||n,"links"),e.prev=5,e.t0=this.utils,e.t1=this.HttpClient,e.next=10,this.authClient.AuthorizationHeader({libraryId:r,objectId:n,versionHash:i});case 10:return e.t2=e.sent,e.t3={auto_update:A,select:c},e.t4=f,e.t5={headers:e.t2,queryParams:e.t3,method:"GET",path:e.t4},e.t6=e.t1.Request.call(e.t1,e.t5),e.next=17,e.t0.ResponseToJson.call(e.t0,e.t6);case 17:return e.abrupt("return",e.sent);case 20:if(e.prev=20,e.t7=e.catch(5),e.prev=22,(l=e.t7.body.errors[0].cause.cause.cause.cycle)&&0!==l.length){e.next=26;break}throw e.t7;case 26:return g={},e.next=29,Promise.all(l.map(function(){var e=s(a.mark((function e(t){var r,n;return a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!g[t]){e.next=2;break}return e.abrupt("return");case 2:return r=d.utils.DecodeVersionHash(t).objectId,e.next=5,d.ContentObjectMetadata({versionHash:t,metadataSubtree:"public/asset_metadata/display_title"});case 5:if(e.t2=e.sent,e.t2){e.next=10;break}return e.next=9,d.ContentObjectMetadata({versionHash:t,metadataSubtree:"public/name"});case 9:e.t2=e.sent;case 10:if(e.t1=e.t2,e.t1){e.next=15;break}return e.next=14,d.ContentObjectMetadata({versionHash:t,metadataSubtree:"name"});case 14:e.t1=e.sent;case 15:if(e.t0=e.t1,e.t0){e.next=18;break}e.t0=r;case 18:n=e.t0,g[t]={name:n,objectId:r};case 20:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()));case 29:h=l.map((function(e){return"".concat(g[e].name," (").concat(g[e].objectId,")")})),e.next=35;break;case 32:throw e.prev=32,e.t8=e.catch(22),e.t7;case 35:throw new Error("Cycle found in links: ".concat(h.join(" -> ")));case 36:case"end":return e.stop()}}),e,this,[[5,20],[22,32]])})));return function(t){return e.apply(this,arguments)}}(),t.LinkTarget=function(){var e=s(a.mark((function e(t){var r,n,o,s,A,c,u,f,h;return a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.libraryId,n=t.objectId,o=t.versionHash,s=t.writeToken,A=t.linkPath,c=t.authorizationToken,u=t.linkInfo,b({libraryId:r,objectId:n,versionHash:o}),s&&y(s),o&&(n=this.utils.DecodeVersionHash(o).objectId),!s||r){e.next=8;break}return e.next=7,this.ContentObjectLibraryId({objectId:n});case 7:r=e.sent;case 8:if(u){e.next=12;break}return e.next=11,this.ContentObjectMetadata({libraryId:r,objectId:n,versionHash:o,writeToken:s,metadataSubtree:A,resolveLinks:!1,resolveIgnoreErrors:!0,resolveIncludeSource:!0,authorizationToken:c});case 11:u=e.sent;case 12:if(!u||!u["/"]){e.next=27;break}if((f=((u["/"]||"").match(/^\/?qfab\/([\w]+)\/?.+/)||[])[1])||(f=u["."].container),!f){e.next=19;break}return e.abrupt("return",f);case 19:if(!o){e.next=21;break}return e.abrupt("return",o);case 21:if(e.t0=o,e.t0){e.next=26;break}return e.next=25,this.LatestVersionHash({objectId:n});case 25:e.t0=e.sent;case 26:return e.abrupt("return",e.t0);case 27:return e.next=29,this.ContentObjectMetadata({libraryId:r,objectId:n,versionHash:o,writeToken:s,metadataSubtree:A,resolveIncludeSource:!0,authorizationToken:c});case 29:if((u=e.sent)&&u["."]){e.next=49;break}if("object"!==i(u)){e.next=38;break}if(e.t1=o,e.t1){e.next=37;break}return e.next=36,this.LatestVersionHash({objectId:n});case 36:e.t1=e.sent;case 37:return e.abrupt("return",e.t1);case 38:if(h=A.split("/").slice(0,-1).join("/")){e.next=46;break}if(e.t2=o,e.t2){e.next=45;break}return e.next=44,this.LatestVersionHash({objectId:n});case 44:e.t2=e.sent;case 45:return e.abrupt("return",e.t2);case 46:return e.next=48,this.ContentObjectMetadata({libraryId:r,objectId:n,versionHash:o,writeToken:s,metadataSubtree:h,resolveIncludeSource:!0,authorizationToken:c});case 48:u=e.sent;case 49:return e.abrupt("return",u["."].source);case 50:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}(),t.LinkUrl=function(){var e=s(a.mark((function e(t){var r,n,i,o,s,A,f,h,l,g,d,p,I,E,m;return a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.libraryId,n=t.objectId,i=t.versionHash,o=t.writeToken,s=t.linkPath,A=t.mimeType,f=t.authorizationToken,h=t.queryParams,l=void 0===h?{}:h,g=t.channelAuth,d=void 0!==g&&g,p=t.noAuth,I=void 0!==p&&p,b({libraryId:r,objectId:n,versionHash:i}),o&&y(o),s){e.next=5;break}throw Error("Link path not specified");case 5:return i&&(n=this.utils.DecodeVersionHash(i).objectId),E=r?u("qlibs",r,"q",o||i||n,"meta",s):u("q",i,"meta",s),m=[f],e.t0=m,e.next=11,this.MetadataAuth({libraryId:r,objectId:n,versionHash:i,path:s,channelAuth:d,noAuth:I});case 11:return e.t1=e.sent,e.t0.push.call(e.t0,e.t1),l.authorization&&m.push(l.authorization),l=c(c({},l),{},{authorization:m.flat().filter((function(e){return e})),resolve:!0}),A&&(l["header-accept"]=A),e.abrupt("return",this.HttpClient.URL({path:E,queryParams:l}));case 17:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}(),t.LinkData=function(){var e=s(a.mark((function e(t){var r,n,i,o,s,A,c,u,f,l,g;return a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.libraryId,n=t.objectId,i=t.versionHash,o=t.writeToken,s=t.linkPath,A=t.queryParams,c=void 0===A?{}:A,u=t.format,f=void 0===u?"json":u,l=t.channelAuth,e.next=3,this.LinkUrl({libraryId:r,objectId:n,versionHash:i,writeToken:o,linkPath:s,queryParams:c,channelAuth:l});case 3:return g=e.sent,e.t0=this.utils,e.t1=f,e.next=8,h.Fetch(g);case 8:return e.t2=e.sent,e.abrupt("return",e.t0.ResponseToFormat.call(e.t0,e.t1,e.t2));case 10:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}(),t.CreateEncryptionConk=function(){var e=s(a.mark((function e(t){var r,n,i,o,s,A,c,u,f,h,l;return a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.libraryId,n=t.objectId,i=t.versionHash,o=t.writeToken,s=t.createKMSConk,A=void 0===s||s,!this.signer.remoteSigner){e.next=3;break}return e.abrupt("return");case 3:if(b({libraryId:r,objectId:n,versionHash:i}),y(o),n||(n=client.DecodeVersionHash(i).objectId),r){e.next=10;break}return e.next=9,this.ContentObjectLibraryId({objectId:n});case 9:r=e.sent;case 10:return c="eluv.caps.iusr".concat(this.utils.AddressToHash(this.signer.address)),e.next=13,this.ContentObjectMetadata({libraryId:r,objectId:n,writeToken:o,metadataSubtree:c});case 13:if(!(u=e.sent)){e.next=20;break}return e.next=17,this.Crypto.DecryptCap(u,this.signer._signingKey().privateKey);case 17:this.encryptionConks[n]=e.sent,e.next=34;break;case 20:return e.next=22,this.Crypto.GeneratePrimaryConk({spaceId:this.contentSpaceId,objectId:n});case 22:return this.encryptionConks[n]=e.sent,e.t0=this,e.t1=r,e.t2=n,e.t3=o,e.t4=c,e.next=30,this.Crypto.EncryptConk(this.encryptionConks[n],this.signer._signingKey().publicKey);case 30:return e.t5=e.sent,e.t6={libraryId:e.t1,objectId:e.t2,writeToken:e.t3,metadataSubtree:e.t4,metadata:e.t5},e.next=34,e.t0.ReplaceMetadata.call(e.t0,e.t6);case 34:if(!A){e.next=64;break}return e.prev=35,e.next=38,this.authClient.KMSAddress({objectId:n});case 38:return f=e.sent,e.next=41,this.authClient.KMSInfo({objectId:n});case 41:return h=e.sent.publicKey,l="eluv.caps.ikms".concat(this.utils.AddressToHash(f)),e.next=45,this.ContentObjectMetadata({libraryId:r,objectId:n,writeToken:o,metadataSubtree:l});case 45:if(e.sent){e.next=58;break}return e.t7=this,e.t8=r,e.t9=n,e.t10=o,e.t11=l,e.next=54,this.Crypto.EncryptConk(this.encryptionConks[n],h);case 54:return e.t12=e.sent,e.t13={libraryId:e.t8,objectId:e.t9,writeToken:e.t10,metadataSubtree:e.t11,metadata:e.t12},e.next=58,e.t7.ReplaceMetadata.call(e.t7,e.t13);case 58:e.next=64;break;case 60:e.prev=60,e.t14=e.catch(35),console.error("Failed to create encryption cap for KMS:"),console.error(e.t14);case 64:return e.abrupt("return",this.encryptionConks[n]);case 65:case"end":return e.stop()}}),e,this,[[35,60]])})));return function(t){return e.apply(this,arguments)}}(),t.EncryptionConk=function(){var e=s(a.mark((function e(t){var r,n,i,o,s,A,c,u,f,h,l;return a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.libraryId,n=t.objectId,i=t.versionHash,o=t.writeToken,s=t.download,A=void 0!==s&&s,b({libraryId:r,objectId:n,versionHash:i}),o&&y(o),n||(n=client.DecodeVersionHash(i).objectId),e.next=6,this.authClient.Owner({id:n});case 6:return c=e.sent,u="eluv.caps.iusr".concat(this.utils.AddressToHash(this.signer.address)),e.next=10,this.ContentObjectMetadata({libraryId:r,objectId:n,metadataSubtree:u});case 10:if(f=e.sent,this.utils.EqualAddress(c,this.signer.address)||f){e.next=21;break}if(!A){e.next=18;break}return e.next=15,this.authClient.ReEncryptionConk({libraryId:r,objectId:n,versionHash:i});case 15:return e.abrupt("return",e.sent);case 18:return e.next=20,this.authClient.EncryptionConk({libraryId:r,objectId:n,versionHash:i});case 20:return e.abrupt("return",e.sent);case 21:if(this.encryptionConks[n]){e.next=38;break}return h="eluv.caps.iusr".concat(this.utils.AddressToHash(this.signer.address)),e.next=25,this.ContentObjectMetadata({libraryId:r,objectId:n,versionHash:i,writeToken:o,metadataSubtree:h});case 25:if(!(l=e.sent)){e.next=32;break}return e.next=29,this.Crypto.DecryptCap(l,this.signer._signingKey().privateKey);case 29:this.encryptionConks[n]=e.sent,e.next=38;break;case 32:if(!o){e.next=37;break}return e.next=35,this.CreateEncryptionConk({libraryId:r,objectId:n,versionHash:i,writeToken:o,createKMSConk:!1});case 35:e.next=38;break;case 37:throw"No encryption conk present for "+n;case 38:return e.abrupt("return",this.encryptionConks[n]);case 39:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}(),t.Encrypt=function(){var e=s(a.mark((function e(t){var r,n,i,o,s,A;return a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.libraryId,n=t.objectId,i=t.writeToken,o=t.chunk,b({libraryId:r,objectId:n}),e.next=4,this.EncryptionConk({libraryId:r,objectId:n,writeToken:i});case 4:return s=e.sent,e.next=7,this.Crypto.Encrypt(s,o);case 7:return A=e.sent,e.abrupt("return",A.buffer.slice(A.byteOffset,A.byteOffset+A.byteLength));case 9:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}(),t.Decrypt=function(){var e=s(a.mark((function e(t){var r,n,i,o,s,A;return a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.libraryId,n=t.objectId,i=t.writeToken,o=t.chunk,b({libraryId:r,objectId:n}),e.next=4,this.EncryptionConk({libraryId:r,objectId:n,writeToken:i,download:!0});case 4:return s=e.sent,e.next=7,this.Crypto.Decrypt(s,o);case 7:return A=e.sent,e.abrupt("return",A.buffer.slice(A.byteOffset,A.byteOffset+A.byteLength));case 9:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}(),t.AccessType=function(){var e=s(a.mark((function e(t){var r;return a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.id,e.next=3,this.authClient.AccessType(r);case 3:return e.abrupt("return",e.sent);case 4:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}(),t.AccessInfo=function(){var e=s(a.mark((function e(t){var r,n,i;return a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.objectId,n=t.args,d(r),n||(n=[0,[],[]]),this.Log("Retrieving access info: ".concat(r)),e.next=6,this.ethClient.CallContractMethod({contractAddress:this.utils.HashToAddress(r),methodName:"getAccessInfo",methodArgs:n});case 6:return i=e.sent,this.Log(i),e.abrupt("return",{visibilityCode:i[0],visible:i[0]>=1,accessible:i[0]>=10,editable:i[0]>=100,hasAccess:0===i[1],accessCode:i[1],accessCharge:this.utils.WeiToEther(i[2]).toString()});case 9:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}(),t.AccessRequest=function(){var e=s(a.mark((function e(t){var r,n,i,o,s,A,c,u,f;return a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.libraryId,n=t.objectId,i=t.versionHash,o=t.args,s=void 0===o?[]:o,A=t.update,c=void 0!==A&&A,u=t.noCache,f=void 0!==u&&u,b({libraryId:r,objectId:n,versionHash:i}),i&&(n=this.utils.DecodeVersionHash(i).objectId),e.next=5,this.authClient.MakeAccessRequest({libraryId:r,objectId:n,versionHash:i,args:s,update:c,skipCache:!0,noCache:f});case 5:return e.abrupt("return",e.sent);case 6:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}(),t.SetAuthContext=function(e){var t=e.context;if(t&&Object.values(t).find((function(e){return"string"!=typeof e})))throw Error("Context must be a map of string->string");this.authContext=t},t.GenerateStateChannelToken=function(){var e=s(a.mark((function e(t){var r,n,i,o,s;return a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.objectId,n=t.versionHash,i=t.context,o=t.noCache,s=void 0!==o&&o,n?p(n):d(r),!n){e.next=6;break}r=this.utils.DecodeVersionHash(n).objectId,e.next=10;break;case 6:if(this.stateChannelAccess[r]){e.next=10;break}return e.next=9,this.LatestVersionHash({objectId:r});case 9:n=e.sent;case 10:return this.stateChannelAccess[r]=n,e.next=13,this.authClient.AuthorizationToken({objectId:r,channelAuth:!0,oauthToken:this.oauthToken,context:i,noCache:s});case 13:return e.abrupt("return",e.sent);case 14:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}(),t.FinalizeStateChannelAccess=function(){var e=s(a.mark((function e(t){var r,n,i;return a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.objectId,n=t.versionHash,i=t.percentComplete,n?p(n):d(r),!n){e.next=6;break}r=this.utils.DecodeVersionHash(n).objectId,e.next=13;break;case 6:if(!this.stateChannelAccess[r]){e.next=10;break}n=this.stateChannelAccess[r],e.next=13;break;case 10:return e.next=12,this.LatestVersionHash({objectId:r});case 12:n=e.sent;case 13:return this.stateChannelAccess[r]=void 0,e.next=16,this.authClient.ChannelContentFinalize({objectId:r,versionHash:n,percent:i});case 16:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}(),t.ContentObjectAccessComplete=function(){var e=s(a.mark((function e(t){var r,n,i;return a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.objectId,n=t.score,i=void 0===n?100:n,d(r),!(i<0||i>100)){e.next=4;break}throw Error("Invalid AccessComplete score: "+i);case 4:return e.next=6,this.authClient.AccessComplete({id:r,score:i});case 6:return e.abrupt("return",e.sent);case 7:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}(),t.Collection=function(){var e=s(a.mark((function e(t){var r;return a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.collectionType,["accessGroups","contentObjects","contentTypes","contracts","libraries"].includes(r)){e.next=4;break}throw new Error("Invalid collection type: "+r);case 4:if(!this.signer){e.next=10;break}return e.next=7,this.userProfileClient.WalletAddress();case 7:e.t0=e.sent,e.next=11;break;case 10:e.t0=void 0;case 11:if(e.t0){e.next=14;break}throw new Error("Unable to get collection: User wallet doesn't exist");case 14:return this.Log("Retrieving ".concat(r," contract collection for user ").concat(this.signer.address)),e.next=17,this.ethClient.MakeProviderCall({methodName:"send",args:["elv_getWalletCollection",[this.contentSpaceId,"iusr".concat(this.utils.AddressToHash(this.signer.address)),r]]});case 17:if(e.t1=e.sent,e.t1){e.next=20;break}e.t1=[];case 20:return e.abrupt("return",e.t1);case 21:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}(),t.VerifyContentObject=function(){var e=s(a.mark((function e(t){var r,n,i;return a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.libraryId,n=t.objectId,i=t.versionHash,b({libraryId:r,objectId:n,versionHash:i}),e.next=4,ContentObjectVerification.VerifyContentObject({client:this,libraryId:r,objectId:n,versionHash:i});case 4:return e.abrupt("return",e.sent);case 5:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}(),t.Proofs=function(){var e=s(a.mark((function e(t){var r,n,i,o,s;return a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.libraryId,n=t.objectId,i=t.versionHash,o=t.partHash,b({libraryId:r,objectId:n,versionHash:i}),I(o),i&&(n=this.utils.DecodeVersionHash(i).objectId),s=u("q",i||n,"data",o,"proofs"),e.t0=this.utils,e.t1=this.HttpClient,e.next=9,this.authClient.AuthorizationHeader({libraryId:r,objectId:n,versionHash:i});case 9:return e.t2=e.sent,e.t3=s,e.t4={headers:e.t2,method:"GET",path:e.t3},e.t5=e.t1.Request.call(e.t1,e.t4),e.abrupt("return",e.t0.ResponseToJson.call(e.t0,e.t5));case 14:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}(),t.QParts=function(){var e=s(a.mark((function e(t){var r,n,i,o,s,A;return a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.libraryId,n=t.objectId,i=t.partHash,o=t.format,s=void 0===o?"blob":o,b({libraryId:r,objectId:n,versionHash:versionHash}),I(i),A=u("qparts",i),e.t0=this.utils,e.t1=s,e.t2=this.HttpClient,e.next=9,this.authClient.AuthorizationHeader({libraryId:r,objectId:n,partHash:i});case 9:return e.t3=e.sent,e.t4=A,e.t5={headers:e.t3,method:"GET",path:e.t4},e.t6=e.t2.Request.call(e.t2,e.t5),e.abrupt("return",e.t0.ResponseToFormat.call(e.t0,e.t1,e.t6));case 14:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()},function(e,t,r){(function(e){var r,n,i;function o(e){return(o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}!function(a,s){"use strict";"object"===o(e)&&"object"===o(e.exports)?e.exports=s():(n=[],void 0===(i="function"==typeof(r=s)?r.apply(t,n):r)||(e.exports=i))}(0,(function(){"use strict";var e=Object.prototype.toString;function t(e,t){return null!=e&&Object.prototype.hasOwnProperty.call(e,t)}function r(e){if(!e)return!0;if(i(e)&&0===e.length)return!0;if("string"!=typeof e){for(var r in e)if(t(e,r))return!1;return!0}return!1}function n(t){return e.call(t)}var i=Array.isArray||function(t){return"[object Array]"===e.call(t)};function a(e){var t=parseInt(e);return t.toString()===e?t:e}function s(e){var s,A,c=function e(t){return Object.keys(e).reduce((function(r,n){return"create"===n||"function"==typeof e[n]&&(r[n]=e[n].bind(e,t)),r}),{})};function u(e,t){if(s(e,t))return e[t]}function f(e,t,r,n){if("number"==typeof t&&(t=[t]),!t||0===t.length)return e;if("string"==typeof t)return f(e,t.split(".").map(a),r,n);var i=t[0],o=A(e,i);return 1===t.length?(void 0!==o&&n||(e[i]=r),o):(void 0===o&&("number"==typeof t[1]?e[i]=[]:e[i]={}),f(e[i],t.slice(1),r,n))}return s=(e=e||{}).includeInheritedProps?function(){return!0}:function(e,r){return"number"==typeof r&&Array.isArray(e)||t(e,r)},A=e.includeInheritedProps?function(e,t){"string"!=typeof t&&"number"!=typeof t&&(t=String(t));var r=u(e,t);if("__proto__"===t||"prototype"===t||"constructor"===t&&"function"==typeof r)throw new Error("For security reasons, object's magic properties cannot be set");return r}:function(e,t){return u(e,t)},c.has=function(r,n){if("number"==typeof n?n=[n]:"string"==typeof n&&(n=n.split(".")),!n||0===n.length)return!!r;for(var o=0;o<n.length;o++){var s=a(n[o]);if(!("number"==typeof s&&i(r)&&s<r.length||(e.includeInheritedProps?s in Object(r):t(r,s))))return!1;r=r[s]}return!0},c.ensureExists=function(e,t,r){return f(e,t,r,!0)},c.set=function(e,t,r,n){return f(e,t,r,n)},c.insert=function(e,t,r,n){var o=c.get(e,t);n=~~n,i(o)||c.set(e,t,o=[]),o.splice(n,0,r)},c.empty=function(e,t){var a,A;if(!r(t)&&(null!=e&&(a=c.get(e,t)))){if("string"==typeof a)return c.set(e,t,"");if(function(e){return"boolean"==typeof e||"[object Boolean]"===n(e)}(a))return c.set(e,t,!1);if("number"==typeof a)return c.set(e,t,0);if(i(a))a.length=0;else{if(!function(e){return"object"===o(e)&&"[object Object]"===n(e)}(a))return c.set(e,t,null);for(A in a)s(a,A)&&delete a[A]}}},c.push=function(e,t){var r=c.get(e,t);i(r)||c.set(e,t,r=[]),r.push.apply(r,Array.prototype.slice.call(arguments,2))},c.coalesce=function(e,t,r){for(var n,i=0,o=t.length;i<o;i++)if(void 0!==(n=c.get(e,t[i])))return n;return r},c.get=function(e,t,r){if("number"==typeof t&&(t=[t]),!t||0===t.length)return e;if(null==e)return r;if("string"==typeof t)return c.get(e,t.split("."),r);var n=a(t[0]),i=A(e,n);return void 0===i?r:1===t.length?i:c.get(e[n],t.slice(1),r)},c.del=function(e,t){if("number"==typeof t&&(t=[t]),null==e)return e;if(r(t))return e;if("string"==typeof t)return c.del(e,t.split("."));var n=a(t[0]);return A(e,n),s(e,n)?1!==t.length?c.del(e[n],t.slice(1)):(i(e)?e.splice(n,1):delete e[n],e):e},c}var A=s();return A.create=s,A.withInheritedProps=s({includeInheritedProps:!0}),A}))}).call(this,r(11)(e))},function(e,t,r){var n=r(21),i=r(22),o=r(51),a=r(52),s=r(88),A="undefined"!=typeof fetch?fetch:r(98).default,c=r(99).LogMessage,u=function(){"use strict";function e(t){var r=t.uris,n=t.debug;o(this,e),this.uris=r,this.uriIndex=0,this.debug=n,this.draftURIs={}}var t;return a(e,[{key:"Log",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];c(this,e,t)}},{key:"BaseURI",value:function(){return new s(this.uris[this.uriIndex])}},{key:"RecordWriteToken",value:function(e,t){this.draftURIs[e]=t?new s(t):this.BaseURI()}},{key:"RequestHeaders",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return t.Accept||(t.Accept="application/json"),"JSON"===e?t["Content-type"]="application/json":"BINARY"===e&&(t["Content-type"]="application/octet-stream"),t}},{key:"Request",value:(t=i(n.mark((function t(r){var i,o,a,s,A,c,u,f,h,l,g,d,p,I,y,b,E,m,C,v,B,w,Q,k;return n.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return i=r.method,o=r.path,a=r.queryParams,s=void 0===a?{}:a,A=r.body,c=r.bodyType,u=void 0===c?"JSON":c,f=r.headers,h=void 0===f?{}:f,l=r.attempts,g=void 0===l?0:l,d=r.failover,p=void 0===d||d,I=r.forceFailover,y=void 0!==I&&I,b=this.BaseURI(),E=o.replace(/^\//,"").match(/(qlibs\/ilib[a-zA-Z0-9]+|q|qid)\/(tqw__[a-zA-Z0-9]+)/),(m=E?E[2]:void 0)&&(this.draftURIs[m]?b=this.draftURIs[m]:this.draftURIs[m]=b),C=b.path(o).query(s).hash(""),v={method:i,headers:this.RequestHeaders(u,h)},"POST"!==i&&"PUT"!==i&&"DELETE"!==i||(A&&"JSON"===u?v.body=JSON.stringify(A):A&&(v.body=A)),t.prev=8,t.next=11,e.Fetch(C.toString(),v);case 11:B=t.sent,t.next=17;break;case 14:t.prev=14,t.t0=t.catch(8),B={ok:!1,status:500,statusText:"ElvClient Error: "+t.t0.message,url:C.toString(),stack:t.t0.stack};case 17:if(B.ok){t.next=40;break}if(!(!m&&(p&&parseInt(B.status)>=500||y)&&g<this.uris.length)){t.next=24;break}return this.Log("HttpClient failing over from ".concat(this.BaseURI(),": ").concat(g+1," attempts"),!0),this.uriIndex=(this.uriIndex+1)%this.uris.length,t.next=23,this.Request({method:i,path:o,queryParams:s,body:A,bodyType:u,headers:h,attempts:g+1,forceFailover:y});case 23:return t.abrupt("return",t.sent);case 24:if(w=B.headers&&B.headers.get("content-type")||"",Q="",!B.text||!B.json){t.next=37;break}if(!w.includes("application/json")){t.next=33;break}return t.next=30,B.json();case 30:t.t1=t.sent,t.next=36;break;case 33:return t.next=35,B.text();case 35:t.t1=t.sent;case 36:Q=t.t1;case 37:throw k={name:"ElvHttpClientError",status:B.status,statusText:B.statusText,message:B.statusText,url:C.toString(),body:Q,requestParams:v},this.Log(JSON.stringify(k,null,2),!0),k;case 40:return this.Log("".concat(B.status," - ").concat(i," ").concat(C.toString())),t.abrupt("return",B);case 42:case"end":return t.stop()}}),t,this,[[8,14]])}))),function(e){return t.apply(this,arguments)})},{key:"URL",value:function(e){var t=e.path,r=e.queryParams,n=void 0===r?{}:r;return this.BaseURI().path(t).query(n).hash("").toString()}}],[{key:"Fetch",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return A(e,t)}}]),e}();e.exports=u},function(e,t,r){var n=r(199),i=r(256)((function(e,t,r,i){n(e,t,r,i)}));e.exports=i},function(e,t,r){var n=r(200),i=r(104),o=r(231),a=r(233),s=r(17),A=r(114),c=r(113);e.exports=function e(t,r,u,f,h){t!==r&&o(r,(function(o,A){if(h||(h=new n),s(o))a(t,r,A,u,e,f,h);else{var l=f?f(c(t,A),o,A+"",t,r,h):void 0;void 0===l&&(l=o),i(t,A,l)}}),A)}},function(e,t,r){var n=r(38),i=r(206),o=r(207),a=r(208),s=r(209),A=r(210);function c(e){var t=this.__data__=new n(e);this.size=t.size}c.prototype.clear=i,c.prototype.delete=o,c.prototype.get=a,c.prototype.has=s,c.prototype.set=A,e.exports=c},function(e,t){e.exports=function(){this.__data__=[],this.size=0}},function(e,t,r){var n=r(39),i=Array.prototype.splice;e.exports=function(e){var t=this.__data__,r=n(t,e);return!(r<0)&&(r==t.length-1?t.pop():i.call(t,r,1),--this.size,!0)}},function(e,t,r){var n=r(39);e.exports=function(e){var t=this.__data__,r=n(t,e);return r<0?void 0:t[r][1]}},function(e,t,r){var n=r(39);e.exports=function(e){return n(this.__data__,e)>-1}},function(e,t,r){var n=r(39);e.exports=function(e,t){var r=this.__data__,i=n(r,e);return i<0?(++this.size,r.push([e,t])):r[i][1]=t,this}},function(e,t,r){var n=r(38);e.exports=function(){this.__data__=new n,this.size=0}},function(e,t){e.exports=function(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r}},function(e,t){e.exports=function(e){return this.__data__.get(e)}},function(e,t){e.exports=function(e){return this.__data__.has(e)}},function(e,t,r){var n=r(38),i=r(101),o=r(218);e.exports=function(e,t){var r=this.__data__;if(r instanceof n){var a=r.__data__;if(!i||a.length<199)return a.push([e,t]),this.size=++r.size,this;r=this.__data__=new o(a)}return r.set(e,t),this.size=r.size,this}},function(e,t,r){var n=r(55),i=r(214),o=r(17),a=r(216),s=/^\[object .+?Constructor\]$/,A=Function.prototype,c=Object.prototype,u=A.toString,f=c.hasOwnProperty,h=RegExp("^"+u.call(f).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");e.exports=function(e){return!(!o(e)||i(e))&&(n(e)?h:s).test(a(e))}},function(e,t,r){var n=r(102),i=Object.prototype,o=i.hasOwnProperty,a=i.toString,s=n?n.toStringTag:void 0;e.exports=function(e){var t=o.call(e,s),r=e[s];try{e[s]=void 0;var n=!0}catch(e){}var i=a.call(e);return n&&(t?e[s]=r:delete e[s]),i}},function(e,t){var r=Object.prototype.toString;e.exports=function(e){return r.call(e)}},function(e,t,r){var n,i=r(215),o=(n=/[^.]+$/.exec(i&&i.keys&&i.keys.IE_PROTO||""))?"Symbol(src)_1."+n:"";e.exports=function(e){return!!o&&o in e}},function(e,t,r){var n=r(23)["__core-js_shared__"];e.exports=n},function(e,t){var r=Function.prototype.toString;e.exports=function(e){if(null!=e){try{return r.call(e)}catch(e){}try{return e+""}catch(e){}}return""}},function(e,t){e.exports=function(e,t){return null==e?void 0:e[t]}},function(e,t,r){var n=r(219),i=r(226),o=r(228),a=r(229),s=r(230);function A(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}A.prototype.clear=n,A.prototype.delete=i,A.prototype.get=o,A.prototype.has=a,A.prototype.set=s,e.exports=A},function(e,t,r){var n=r(220),i=r(38),o=r(101);e.exports=function(){this.size=0,this.__data__={hash:new n,map:new(o||i),string:new n}}},function(e,t,r){var n=r(221),i=r(222),o=r(223),a=r(224),s=r(225);function A(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}A.prototype.clear=n,A.prototype.delete=i,A.prototype.get=o,A.prototype.has=a,A.prototype.set=s,e.exports=A},function(e,t,r){var n=r(42);e.exports=function(){this.__data__=n?n(null):{},this.size=0}},function(e,t){e.exports=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}},function(e,t,r){var n=r(42),i=Object.prototype.hasOwnProperty;e.exports=function(e){var t=this.__data__;if(n){var r=t[e];return"__lodash_hash_undefined__"===r?void 0:r}return i.call(t,e)?t[e]:void 0}},function(e,t,r){var n=r(42),i=Object.prototype.hasOwnProperty;e.exports=function(e){var t=this.__data__;return n?void 0!==t[e]:i.call(t,e)}},function(e,t,r){var n=r(42);e.exports=function(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=n&&void 0===t?"__lodash_hash_undefined__":t,this}},function(e,t,r){var n=r(43);e.exports=function(e){var t=n(this,e).delete(e);return this.size-=t?1:0,t}},function(e,t){function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}e.exports=function(e){var t=r(e);return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e}},function(e,t,r){var n=r(43);e.exports=function(e){return n(this,e).get(e)}},function(e,t,r){var n=r(43);e.exports=function(e){return n(this,e).has(e)}},function(e,t,r){var n=r(43);e.exports=function(e,t){var r=n(this,e),i=r.size;return r.set(e,t),this.size+=r.size==i?0:1,this}},function(e,t,r){var n=r(232)();e.exports=n},function(e,t){e.exports=function(e){return function(t,r,n){for(var i=-1,o=Object(t),a=n(t),s=a.length;s--;){var A=a[e?s:++i];if(!1===r(o[A],A,o))break}return t}}},function(e,t,r){var n=r(104),i=r(234),o=r(235),a=r(238),s=r(239),A=r(108),c=r(109),u=r(243),f=r(111),h=r(55),l=r(17),g=r(245),d=r(112),p=r(113),I=r(249);e.exports=function(e,t,r,y,b,E,m){var C=p(e,r),v=p(t,r),B=m.get(v);if(B)n(e,r,B);else{var w=E?E(C,v,r+"",e,t,m):void 0,Q=void 0===w;if(Q){var k=c(v),_=!k&&f(v),S=!k&&!_&&d(v);w=v,k||_||S?c(C)?w=C:u(C)?w=a(C):_?(Q=!1,w=i(v,!0)):S?(Q=!1,w=o(v,!0)):w=[]:g(v)||A(v)?(w=C,A(C)?w=I(C):l(C)&&!h(C)||(w=s(v))):Q=!1}Q&&(m.set(v,w),b(w,v,y,E,m),m.delete(v)),n(e,r,w)}}},function(e,t,r){(function(e){function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var i=r(23),o="object"==n(t)&&t&&!t.nodeType&&t,a=o&&"object"==n(e)&&e&&!e.nodeType&&e,s=a&&a.exports===o?i.Buffer:void 0,A=s?s.allocUnsafe:void 0;e.exports=function(e,t){if(t)return e.slice();var r=e.length,n=A?A(r):new e.constructor(r);return e.copy(n),n}}).call(this,r(11)(e))},function(e,t,r){var n=r(236);e.exports=function(e,t){var r=t?n(e.buffer):e.buffer;return new e.constructor(r,e.byteOffset,e.length)}},function(e,t,r){var n=r(237);e.exports=function(e){var t=new e.constructor(e.byteLength);return new n(t).set(new n(e)),t}},function(e,t,r){var n=r(23).Uint8Array;e.exports=n},function(e,t){e.exports=function(e,t){var r=-1,n=e.length;for(t||(t=Array(n));++r<n;)t[r]=e[r];return t}},function(e,t,r){var n=r(240),i=r(106),o=r(107);e.exports=function(e){return"function"!=typeof e.constructor||o(e)?{}:n(i(e))}},function(e,t,r){var n=r(17),i=Object.create,o=function(){function e(){}return function(t){if(!n(t))return{};if(i)return i(t);e.prototype=t;var r=new e;return e.prototype=void 0,r}}();e.exports=o},function(e,t){e.exports=function(e,t){return function(r){return e(t(r))}}},function(e,t,r){var n=r(41),i=r(30);e.exports=function(e){return i(e)&&"[object Arguments]"==n(e)}},function(e,t,r){var n=r(57),i=r(30);e.exports=function(e){return i(e)&&n(e)}},function(e,t){e.exports=function(){return!1}},function(e,t,r){var n=r(41),i=r(106),o=r(30),a=Function.prototype,s=Object.prototype,A=a.toString,c=s.hasOwnProperty,u=A.call(Object);e.exports=function(e){if(!o(e)||"[object Object]"!=n(e))return!1;var t=i(e);if(null===t)return!0;var r=c.call(t,"constructor")&&t.constructor;return"function"==typeof r&&r instanceof r&&A.call(r)==u}},function(e,t,r){var n=r(41),i=r(110),o=r(30),a={};a["[object Float32Array]"]=a["[object Float64Array]"]=a["[object Int8Array]"]=a["[object Int16Array]"]=a["[object Int32Array]"]=a["[object Uint8Array]"]=a["[object Uint8ClampedArray]"]=a["[object Uint16Array]"]=a["[object Uint32Array]"]=!0,a["[object Arguments]"]=a["[object Array]"]=a["[object ArrayBuffer]"]=a["[object Boolean]"]=a["[object DataView]"]=a["[object Date]"]=a["[object Error]"]=a["[object Function]"]=a["[object Map]"]=a["[object Number]"]=a["[object Object]"]=a["[object RegExp]"]=a["[object Set]"]=a["[object String]"]=a["[object WeakMap]"]=!1,e.exports=function(e){return o(e)&&i(e.length)&&!!a[n(e)]}},function(e,t){e.exports=function(e){return function(t){return e(t)}}},function(e,t,r){(function(e){function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var i=r(103),o="object"==n(t)&&t&&!t.nodeType&&t,a=o&&"object"==n(e)&&e&&!e.nodeType&&e,s=a&&a.exports===o&&i.process,A=function(){try{var e=a&&a.require&&a.require("util").types;return e||s&&s.binding&&s.binding("util")}catch(e){}}();e.exports=A}).call(this,r(11)(e))},function(e,t,r){var n=r(250),i=r(114);e.exports=function(e){return n(e,i(e))}},function(e,t,r){var n=r(251),i=r(56);e.exports=function(e,t,r,o){var a=!r;r||(r={});for(var s=-1,A=t.length;++s<A;){var c=t[s],u=o?o(r[c],e[c],c,r,e):void 0;void 0===u&&(u=e[c]),a?i(r,c,u):n(r,c,u)}return r}},function(e,t,r){var n=r(56),i=r(40),o=Object.prototype.hasOwnProperty;e.exports=function(e,t,r){var a=e[t];o.call(e,t)&&i(a,r)&&(void 0!==r||t in e)||n(e,t,r)}},function(e,t,r){var n=r(253),i=r(108),o=r(109),a=r(111),s=r(115),A=r(112),c=Object.prototype.hasOwnProperty;e.exports=function(e,t){var r=o(e),u=!r&&i(e),f=!r&&!u&&a(e),h=!r&&!u&&!f&&A(e),l=r||u||f||h,g=l?n(e.length,String):[],d=g.length;for(var p in e)!t&&!c.call(e,p)||l&&("length"==p||f&&("offset"==p||"parent"==p)||h&&("buffer"==p||"byteLength"==p||"byteOffset"==p)||s(p,d))||g.push(p);return g}},function(e,t){e.exports=function(e,t){for(var r=-1,n=Array(e);++r<e;)n[r]=t(r);return n}},function(e,t,r){var n=r(17),i=r(107),o=r(255),a=Object.prototype.hasOwnProperty;e.exports=function(e){if(!n(e))return o(e);var t=i(e),r=[];for(var s in e)("constructor"!=s||!t&&a.call(e,s))&&r.push(s);return r}},function(e,t){e.exports=function(e){var t=[];if(null!=e)for(var r in Object(e))t.push(r);return t}},function(e,t,r){var n=r(257),i=r(264);e.exports=function(e){return n((function(t,r){var n=-1,o=r.length,a=o>1?r[o-1]:void 0,s=o>2?r[2]:void 0;for(a=e.length>3&&"function"==typeof a?(o--,a):void 0,s&&i(r[0],r[1],s)&&(a=o<3?void 0:a,o=1),t=Object(t);++n<o;){var A=r[n];A&&e(t,A,n,a)}return t}))}},function(e,t,r){var n=r(116),i=r(258),o=r(260);e.exports=function(e,t){return o(i(e,t,n),e+"")}},function(e,t,r){var n=r(259),i=Math.max;e.exports=function(e,t,r){return t=i(void 0===t?e.length-1:t,0),function(){for(var o=arguments,a=-1,s=i(o.length-t,0),A=Array(s);++a<s;)A[a]=o[t+a];a=-1;for(var c=Array(t+1);++a<t;)c[a]=o[a];return c[t]=r(A),n(e,this,c)}}},function(e,t){e.exports=function(e,t,r){switch(r.length){case 0:return e.call(t);case 1:return e.call(t,r[0]);case 2:return e.call(t,r[0],r[1]);case 3:return e.call(t,r[0],r[1],r[2])}return e.apply(t,r)}},function(e,t,r){var n=r(261),i=r(263)(n);e.exports=i},function(e,t,r){var n=r(262),i=r(105),o=r(116),a=i?function(e,t){return i(e,"toString",{configurable:!0,enumerable:!1,value:n(t),writable:!0})}:o;e.exports=a},function(e,t){e.exports=function(e){return function(){return e}}},function(e,t){var r=Date.now;e.exports=function(e){var t=0,n=0;return function(){var i=r(),o=16-(i-n);if(n=i,o>0){if(++t>=800)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}},function(e,t,r){function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var i=r(40),o=r(57),a=r(115),s=r(17);e.exports=function(e,t,r){if(!s(r))return!1;var A=n(t);return!!("number"==A?o(r)&&a(t,r.length):"string"==A&&t in r)&&i(r[t],e)}},function(e,t,r){(function(t){var n=r(21),i=r(22);void 0===globalThis.Buffer&&(globalThis.Buffer=r(6).Buffer);var o,a=r(87),s=r(117),A=r(37);if("undefined"==typeof crypto){var c=r(274);c.getRandomValues=function(e){return c.randomBytes(e.length)},globalThis.crypto=c}switch(A.Platform()){case A.PLATFORM_REACT_NATIVE:case A.PLATFORM_WEB:o=r(165).default;break;default:o=r(!function(){var e=new Error("Cannot find module '@eluvio/crypto/dist/elv-crypto.bundle.node'");throw e.code="MODULE_NOT_FOUND",e}()).default}var u,f,h,l,g,d={ElvCrypto:(g=i(n.mark((function e(){return n.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,d.elvCrypto){e.next=5;break}return e.next=4,(new o).init();case 4:d.elvCrypto=e.sent;case 5:return e.abrupt("return",d.elvCrypto);case 8:e.prev=8,e.t0=e.catch(0),console.error("Error initializing ElvCrypto:"),console.error(e.t0);case 12:case"end":return e.stop()}}),e,null,[[0,8]])}))),function(){return g.apply(this,arguments)}),EncryptedSize:function(e){var t=Math.floor(e/1e6)*d.EncryptedBlockSize(1e6);return e%1e6!=0&&(t+=d.EncryptedBlockSize(e%1e6)),t},EncryptedBlockSize:function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r=129,n=608,i=48,o=12*(i-1),a=12*i,s=Math.floor(e/o)*a;return e%o!=0&&(s+=a),t?s+n:s+r},EncryptConk:function(e,r){return i(n.mark((function i(){var o,a,s,c,u,f;return n.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,d.ElvCrypto();case 2:return o=n.sent,r=new Uint8Array(t.from(r.replace("0x",""),"hex")),e=new Uint8Array(t.from(JSON.stringify(e))),n.next=7,o.encryptECIES(e,r);case 7:return a=n.sent,s=a.data,c=a.ephemeralKey,u=a.tag,f=t.concat([t.from(c),t.from(u),t.from(s)]),n.abrupt("return",A.B64(f));case 13:case"end":return n.stop()}}),i)})))()},DecryptCap:function(e,r){return i(n.mark((function i(){var o,a,s,A,c;return n.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,d.ElvCrypto();case 2:return o=n.sent,r=new Uint8Array(t.from(r.replace("0x",""),"hex")),e=t.from(e,"base64"),a=e.slice(0,65),s=e.slice(65,81),A=e.slice(81),c=o.decryptECIES(new Uint8Array(A),r,new Uint8Array(a),new Uint8Array(s)),n.abrupt("return",JSON.parse(t.from(c).toString()));case 10:case"end":return n.stop()}}),i)})))()},GeneratePrimaryConk:function(e){return i(n.mark((function r(){var i,o,s,A,c,u,f;return n.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return i=e.spaceId,o=e.objectId,r.next=3,d.ElvCrypto();case 3:return s=r.sent,A=s.generatePrimaryKeys(),c=A.secretKey,u=A.publicKey,f=s.generateSymmetricKey().key,r.abrupt("return",{symm_key:"kpsy".concat(a.encode(t.from(f))),secret_key:"kpsk".concat(a.encode(t.from(c))),public_key:"kppk".concat(a.encode(t.from(u))),sid:i,qid:o});case 7:case"end":return r.stop()}}),r)})))()},GenerateTargetConk:function(){return i(n.mark((function e(){var r,i,o,s;return n.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,d.ElvCrypto();case 2:return r=e.sent,i=r.generateTargetKeys(),o=i.secretKey,s=i.publicKey,e.abrupt("return",{secret_key:"kpsk".concat(a.encode(t.from(o))),public_key:"ktpk".concat(a.encode(t.from(s)))});case 5:case"end":return e.stop()}}),e)})))()},CapToConk:function(e){var t=function(e){return new Uint8Array(a.decode(e.slice(4)))};return{symmetricKey:t(e.symm_key),secretKey:t(e.secret_key),publicKey:t(e.public_key)}},EncryptionContext:function(e){return i(n.mark((function t(){var r,i,o,a,s,A,c;return n.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,d.ElvCrypto();case 2:return r=t.sent,i=d.CapToConk(e),o=i.symmetricKey,a=i.secretKey,(s=i.publicKey).length===r.PRIMARY_PK_KEY_SIZE?(c=r.CRYPTO_TYPE_PRIMARY,A=r.newPrimaryContext(s,a,o)):(c=r.CRYPTO_TYPE_TARGET,A=r.newTargetDecryptionContext(a,o)),t.abrupt("return",{context:A,type:c});case 6:case"end":return t.stop()}}),t)})))()},Encrypt:(l=i(n.mark((function e(r,i){var o,a,s,A,c;return n.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,d.OpenEncryptionStream(r);case 2:if(o=e.sent,t.isBuffer(i)||i instanceof ArrayBuffer){e.next=9;break}return e.t0=t,e.next=7,new Response(i).arrayBuffer();case 7:e.t1=e.sent,i=e.t0.from.call(e.t0,e.t1);case 9:for(a=new Uint8Array(i),s=0;s<a.length;s+=1e6)A=Math.min(a.length,s+1e6),o.write(a.slice(s,A));return o.end(),c=[],e.next=15,new Promise((function(e,t){o.on("data",(function(e){c.push(e)})).on("finish",(function(){e()})).on("error",(function(e){t(e)}))}));case 15:return e.abrupt("return",t.concat(c));case 16:case"end":return e.stop()}}),e)}))),function(e,t){return l.apply(this,arguments)}),OpenEncryptionStream:(h=i(n.mark((function e(t){var r,i,o,a,A;return n.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,d.ElvCrypto();case 2:return r=e.sent,e.next=5,d.EncryptionContext(t);case 5:return i=e.sent,o=i.context,a=new s.PassThrough,A=r.createCipher(o),e.abrupt("return",a.pipe(A).on("finish",(function(){o.free()})).on("error",(function(e){throw Error(e)})));case 10:case"end":return e.stop()}}),e)}))),function(e){return h.apply(this,arguments)}),Decrypt:(f=i(n.mark((function e(r,i){var o,a,s,A,c;return n.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,d.OpenDecryptionStream(r);case 2:for(o=e.sent,a=new Uint8Array(i),s=0;s<a.length;s+=1e6)A=Math.min(a.length,s+1e6),o.write(a.slice(s,A));return o.end(),c=[],e.next=9,new Promise((function(e,t){o.on("data",(function(e){c.push(e)})).on("finish",(function(){e()})).on("error",(function(e){t(e)}))}));case 9:return e.abrupt("return",t.concat(c));case 10:case"end":return e.stop()}}),e)}))),function(e,t){return f.apply(this,arguments)}),OpenDecryptionStream:(u=i(n.mark((function e(t){var r,i,o,a,A,c;return n.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,d.ElvCrypto();case 2:return r=e.sent,e.next=5,d.EncryptionContext(t);case 5:return i=e.sent,o=i.context,a=i.type,A=new s.PassThrough,c=r.createDecipher(a,o),e.abrupt("return",A.pipe(c).on("finish",(function(){o.free()})).on("error",(function(e){throw Error(e)})));case 11:case"end":return e.stop()}}),e)}))),function(e){return u.apply(this,arguments)})};e.exports=d}).call(this,r(6).Buffer)},function(e,t){},function(e,t,r){"use strict";var n=r(59).Buffer,i=r(268);e.exports=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.head=null,this.tail=null,this.length=0}return e.prototype.push=function(e){var t={data:e,next:null};this.length>0?this.tail.next=t:this.head=t,this.tail=t,++this.length},e.prototype.unshift=function(e){var t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length},e.prototype.shift=function(){if(0!==this.length){var e=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,e}},e.prototype.clear=function(){this.head=this.tail=null,this.length=0},e.prototype.join=function(e){if(0===this.length)return"";for(var t=this.head,r=""+t.data;t=t.next;)r+=e+t.data;return r},e.prototype.concat=function(e){if(0===this.length)return n.alloc(0);if(1===this.length)return this.head.data;for(var t,r,i,o=n.allocUnsafe(e>>>0),a=this.head,s=0;a;)t=a.data,r=o,i=s,t.copy(r,i),s+=a.data.length,a=a.next;return o},e}(),i&&i.inspect&&i.inspect.custom&&(e.exports.prototype[i.inspect.custom]=function(){var e=i.inspect({length:this.length});return this.constructor.name+" "+e})},function(e,t){},function(e,t,r){"use strict";e.exports=o;var n=r(122),i=Object.create(r(32));function o(e){if(!(this instanceof o))return new o(e);n.call(this,e)}i.inherits=r(3),i.inherits(o,n),o.prototype._transform=function(e,t,r){r(null,e)}},function(e,t,r){e.exports=r(60)},function(e,t,r){e.exports=r(18)},function(e,t,r){e.exports=r(58).Transform},function(e,t,r){e.exports=r(58).PassThrough},function(e,t,r){"use strict";t.randomBytes=t.rng=t.pseudoRandomBytes=t.prng=r(19),t.createHash=t.Hash=r(24),t.createHmac=t.Hmac=r(66);var n=r(133),i=Object.keys(n),o=["sha1","sha224","sha256","sha384","sha512","md5","rmd160"].concat(i);t.getHashes=function(){return o};var a=r(67);t.pbkdf2=a.pbkdf2,t.pbkdf2Sync=a.pbkdf2Sync;var s=r(139);t.Cipher=s.Cipher,t.createCipher=s.createCipher,t.Cipheriv=s.Cipheriv,t.createCipheriv=s.createCipheriv,t.Decipher=s.Decipher,t.createDecipher=s.createDecipher,t.Decipheriv=s.Decipheriv,t.createDecipheriv=s.createDecipheriv,t.getCiphers=s.getCiphers,t.listCiphers=s.listCiphers;var A=r(147);t.DiffieHellmanGroup=A.DiffieHellmanGroup,t.createDiffieHellmanGroup=A.createDiffieHellmanGroup,t.getDiffieHellman=A.getDiffieHellman,t.createDiffieHellman=A.createDiffieHellman,t.DiffieHellman=A.DiffieHellman;var c=r(150);t.createSign=c.createSign,t.Sign=c.Sign,t.createVerify=c.createVerify,t.Verify=c.Verify,t.createECDH=r(159);var u=r(160);t.publicEncrypt=u.publicEncrypt,t.privateEncrypt=u.privateEncrypt,t.publicDecrypt=u.publicDecrypt,t.privateDecrypt=u.privateDecrypt;var f=r(164);t.randomFill=f.randomFill,t.randomFillSync=f.randomFillSync,t.createCredentials=function(){throw new Error(["sorry, createCredentials is not implemented yet","we accept pull requests","https://github.com/crypto-browserify/crypto-browserify"].join("\n"))},t.constants={DH_CHECK_P_NOT_SAFE_PRIME:2,DH_CHECK_P_NOT_PRIME:1,DH_UNABLE_TO_CHECK_GENERATOR:4,DH_NOT_SUITABLE_GENERATOR:8,NPN_ENABLED:1,ALPN_ENABLED:1,RSA_PKCS1_PADDING:1,RSA_SSLV23_PADDING:2,RSA_NO_PADDING:3,RSA_PKCS1_OAEP_PADDING:4,RSA_X931_PADDING:5,RSA_PKCS1_PSS_PADDING:6,POINT_CONVERSION_COMPRESSED:2,POINT_CONVERSION_UNCOMPRESSED:4,POINT_CONVERSION_HYBRID:6}},function(e,t){},function(e,t,r){"use strict";function n(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function i(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function o(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}var a=r(6).Buffer,s=r(277).inspect,A=s&&s.custom||"inspect";e.exports=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.head=null,this.tail=null,this.length=0}var t,r,c;return t=e,(r=[{key:"push",value:function(e){var t={data:e,next:null};this.length>0?this.tail.next=t:this.head=t,this.tail=t,++this.length}},{key:"unshift",value:function(e){var t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length}},{key:"shift",value:function(){if(0!==this.length){var e=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,e}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(e){if(0===this.length)return"";for(var t=this.head,r=""+t.data;t=t.next;)r+=e+t.data;return r}},{key:"concat",value:function(e){if(0===this.length)return a.alloc(0);for(var t,r,n,i=a.allocUnsafe(e>>>0),o=this.head,s=0;o;)t=o.data,r=i,n=s,a.prototype.copy.call(t,r,n),s+=o.data.length,o=o.next;return i}},{key:"consume",value:function(e,t){var r;return e<this.head.data.length?(r=this.head.data.slice(0,e),this.head.data=this.head.data.slice(e)):r=e===this.head.data.length?this.shift():t?this._getString(e):this._getBuffer(e),r}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(e){var t=this.head,r=1,n=t.data;for(e-=n.length;t=t.next;){var i=t.data,o=e>i.length?i.length:e;if(o===i.length?n+=i:n+=i.slice(0,e),0==(e-=o)){o===i.length?(++r,t.next?this.head=t.next:this.head=this.tail=null):(this.head=t,t.data=i.slice(o));break}++r}return this.length-=r,n}},{key:"_getBuffer",value:function(e){var t=a.allocUnsafe(e),r=this.head,n=1;for(r.data.copy(t),e-=r.data.length;r=r.next;){var i=r.data,o=e>i.length?i.length:e;if(i.copy(t,t.length-e,0,o),0==(e-=o)){o===i.length?(++n,r.next?this.head=r.next:this.head=this.tail=null):(this.head=r,r.data=i.slice(o));break}++n}return this.length-=n,t}},{key:A,value:function(e,t){return s(this,function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?n(Object(r),!0).forEach((function(t){i(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):n(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}({},t,{depth:0,customInspect:!1}))}}])&&o(t.prototype,r),c&&o(t,c),e}()},function(e,t){},function(e,t,r){"use strict";(function(t){var n;function i(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var o=r(63),a=Symbol("lastResolve"),s=Symbol("lastReject"),A=Symbol("error"),c=Symbol("ended"),u=Symbol("lastPromise"),f=Symbol("handlePromise"),h=Symbol("stream");function l(e,t){return{value:e,done:t}}function g(e){var t=e[a];if(null!==t){var r=e[h].read();null!==r&&(e[u]=null,e[a]=null,e[s]=null,t(l(r,!1)))}}function d(e){t.nextTick(g,e)}var p=Object.getPrototypeOf((function(){})),I=Object.setPrototypeOf((i(n={get stream(){return this[h]},next:function(){var e=this,r=this[A];if(null!==r)return Promise.reject(r);if(this[c])return Promise.resolve(l(void 0,!0));if(this[h].destroyed)return new Promise((function(r,n){t.nextTick((function(){e[A]?n(e[A]):r(l(void 0,!0))}))}));var n,i=this[u];if(i)n=new Promise(function(e,t){return function(r,n){e.then((function(){t[c]?r(l(void 0,!0)):t[f](r,n)}),n)}}(i,this));else{var o=this[h].read();if(null!==o)return Promise.resolve(l(o,!1));n=new Promise(this[f])}return this[u]=n,n}},Symbol.asyncIterator,(function(){return this})),i(n,"return",(function(){var e=this;return new Promise((function(t,r){e[h].destroy(null,(function(e){e?r(e):t(l(void 0,!0))}))}))})),n),p);e.exports=function(e){var t,r=Object.create(I,(i(t={},h,{value:e,writable:!0}),i(t,a,{value:null,writable:!0}),i(t,s,{value:null,writable:!0}),i(t,A,{value:null,writable:!0}),i(t,c,{value:e._readableState.endEmitted,writable:!0}),i(t,f,{value:function(e,t){var n=r[h].read();n?(r[u]=null,r[a]=null,r[s]=null,e(l(n,!1))):(r[a]=e,r[s]=t)},writable:!0}),t));return r[u]=null,o(e,(function(e){if(e&&"ERR_STREAM_PREMATURE_CLOSE"!==e.code){var t=r[s];return null!==t&&(r[u]=null,r[a]=null,r[s]=null,t(e)),void(r[A]=e)}var n=r[a];null!==n&&(r[u]=null,r[a]=null,r[s]=null,n(l(void 0,!0))),r[c]=!0})),e.on("readable",d.bind(null,r)),r}}).call(this,r(9))},function(e,t){e.exports=function(){throw new Error("Readable.from is not available in the browser")}},function(e,t,r){"use strict";e.exports=i;var n=r(129);function i(e){if(!(this instanceof i))return new i(e);n.call(this,e)}r(3)(i,n),i.prototype._transform=function(e,t,r){r(null,e)}},function(e,t,r){"use strict";var n;var i=r(25).codes,o=i.ERR_MISSING_ARGS,a=i.ERR_STREAM_DESTROYED;function s(e){if(e)throw e}function A(e,t,i,o){o=function(e){var t=!1;return function(){t||(t=!0,e.apply(void 0,arguments))}}(o);var s=!1;e.on("close",(function(){s=!0})),void 0===n&&(n=r(63)),n(e,{readable:t,writable:i},(function(e){if(e)return o(e);s=!0,o()}));var A=!1;return function(t){if(!s&&!A)return A=!0,function(e){return e.setHeader&&"function"==typeof e.abort}(e)?e.abort():"function"==typeof e.destroy?e.destroy():void o(t||new a("pipe"))}}function c(e){e()}function u(e,t){return e.pipe(t)}function f(e){return e.length?"function"!=typeof e[e.length-1]?s:e.pop():s}e.exports=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];var n,i=f(t);if(Array.isArray(t[0])&&(t=t[0]),t.length<2)throw new o("streams");var a=t.map((function(e,r){var o=r<t.length-1;return A(e,o,r>0,(function(e){n||(n=e),e&&a.forEach(c),o||(a.forEach(c),i(n))}))}));return t.reduce(u)}},function(e,t,r){var n=r(3),i=r(27),o=r(4).Buffer,a=[1518500249,1859775393,-1894007588,-899497514],s=new Array(80);function A(){this.init(),this._w=s,i.call(this,64,56)}function c(e){return e<<30|e>>>2}function u(e,t,r,n){return 0===e?t&r|~t&n:2===e?t&r|t&n|r&n:t^r^n}n(A,i),A.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},A.prototype._update=function(e){for(var t,r=this._w,n=0|this._a,i=0|this._b,o=0|this._c,s=0|this._d,A=0|this._e,f=0;f<16;++f)r[f]=e.readInt32BE(4*f);for(;f<80;++f)r[f]=r[f-3]^r[f-8]^r[f-14]^r[f-16];for(var h=0;h<80;++h){var l=~~(h/20),g=0|((t=n)<<5|t>>>27)+u(l,i,o,s)+A+r[h]+a[l];A=s,s=o,o=c(i),i=n,n=g}this._a=n+this._a|0,this._b=i+this._b|0,this._c=o+this._c|0,this._d=s+this._d|0,this._e=A+this._e|0},A.prototype._hash=function(){var e=o.allocUnsafe(20);return e.writeInt32BE(0|this._a,0),e.writeInt32BE(0|this._b,4),e.writeInt32BE(0|this._c,8),e.writeInt32BE(0|this._d,12),e.writeInt32BE(0|this._e,16),e},e.exports=A},function(e,t,r){var n=r(3),i=r(27),o=r(4).Buffer,a=[1518500249,1859775393,-1894007588,-899497514],s=new Array(80);function A(){this.init(),this._w=s,i.call(this,64,56)}function c(e){return e<<5|e>>>27}function u(e){return e<<30|e>>>2}function f(e,t,r,n){return 0===e?t&r|~t&n:2===e?t&r|t&n|r&n:t^r^n}n(A,i),A.prototype.init=function(){return this._a=1732584193,this._b=4023233417,this._c=2562383102,this._d=271733878,this._e=3285377520,this},A.prototype._update=function(e){for(var t,r=this._w,n=0|this._a,i=0|this._b,o=0|this._c,s=0|this._d,A=0|this._e,h=0;h<16;++h)r[h]=e.readInt32BE(4*h);for(;h<80;++h)r[h]=(t=r[h-3]^r[h-8]^r[h-14]^r[h-16])<<1|t>>>31;for(var l=0;l<80;++l){var g=~~(l/20),d=c(n)+f(g,i,o,s)+A+r[l]+a[g]|0;A=s,s=o,o=u(i),i=n,n=d}this._a=n+this._a|0,this._b=i+this._b|0,this._c=o+this._c|0,this._d=s+this._d|0,this._e=A+this._e|0},A.prototype._hash=function(){var e=o.allocUnsafe(20);return e.writeInt32BE(0|this._a,0),e.writeInt32BE(0|this._b,4),e.writeInt32BE(0|this._c,8),e.writeInt32BE(0|this._d,12),e.writeInt32BE(0|this._e,16),e},e.exports=A},function(e,t,r){var n=r(3),i=r(130),o=r(27),a=r(4).Buffer,s=new Array(64);function A(){this.init(),this._w=s,o.call(this,64,56)}n(A,i),A.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},A.prototype._hash=function(){var e=a.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},e.exports=A},function(e,t,r){var n=r(3),i=r(131),o=r(27),a=r(4).Buffer,s=new Array(160);function A(){this.init(),this._w=s,o.call(this,128,112)}n(A,i),A.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},A.prototype._hash=function(){var e=a.allocUnsafe(48);function t(t,r,n){e.writeInt32BE(t,n),e.writeInt32BE(r,n+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},e.exports=A},function(e,t,r){"use strict";var n=r(3),i=r(4).Buffer,o=r(16),a=i.alloc(128);function s(e,t){o.call(this,"digest"),"string"==typeof t&&(t=i.from(t)),this._alg=e,this._key=t,t.length>64?t=e(t):t.length<64&&(t=i.concat([t,a],64));for(var r=this._ipad=i.allocUnsafe(64),n=this._opad=i.allocUnsafe(64),s=0;s<64;s++)r[s]=54^t[s],n[s]=92^t[s];this._hash=[r]}n(s,o),s.prototype._update=function(e){this._hash.push(e)},s.prototype._final=function(){var e=this._alg(i.concat(this._hash));return this._alg(i.concat([this._opad,e]))},e.exports=s},function(e,t,r){(function(t){var n,i,o=r(4).Buffer,a=r(135),s=r(136),A=r(137),c=r(138),u=t.crypto&&t.crypto.subtle,f={sha:"SHA-1","sha-1":"SHA-1",sha1:"SHA-1",sha256:"SHA-256","sha-256":"SHA-256",sha384:"SHA-384","sha-384":"SHA-384","sha-512":"SHA-512",sha512:"SHA-512"},h=[];function l(){return i||(i=t.process&&t.process.nextTick?t.process.nextTick:t.queueMicrotask?t.queueMicrotask:t.setImmediate?t.setImmediate:t.setTimeout)}function g(e,t,r,n,i){return u.importKey("raw",e,{name:"PBKDF2"},!1,["deriveBits"]).then((function(e){return u.deriveBits({name:"PBKDF2",salt:t,iterations:r,hash:{name:i}},e,n<<3)})).then((function(e){return o.from(e)}))}e.exports=function(e,r,i,d,p,I){"function"==typeof p&&(I=p,p=void 0);var y=f[(p=p||"sha1").toLowerCase()];if(y&&"function"==typeof t.Promise){if(a(i,d),e=c(e,s,"Password"),r=c(r,s,"Salt"),"function"!=typeof I)throw new Error("No callback provided to pbkdf2");!function(e,t){e.then((function(e){l()((function(){t(null,e)}))}),(function(e){l()((function(){t(e)}))}))}(function(e){if(t.process&&!t.process.browser)return Promise.resolve(!1);if(!u||!u.importKey||!u.deriveBits)return Promise.resolve(!1);if(void 0!==h[e])return h[e];var r=g(n=n||o.alloc(8),n,10,128,e).then((function(){return!0})).catch((function(){return!1}));return h[e]=r,r}(y).then((function(t){return t?g(e,r,i,d,y):A(e,r,i,d,p)})),I)}else l()((function(){var t;try{t=A(e,r,i,d,p)}catch(e){return I(e)}I(null,t)}))}}).call(this,r(8))},function(e,t,r){var n=r(16),i=r(289),o=r(3),a=r(4).Buffer,s={"des-ede3-cbc":i.CBC.instantiate(i.EDE),"des-ede3":i.EDE,"des-ede-cbc":i.CBC.instantiate(i.EDE),"des-ede":i.EDE,"des-cbc":i.CBC.instantiate(i.DES),"des-ecb":i.DES};function A(e){n.call(this);var t,r=e.mode.toLowerCase(),i=s[r];t=e.decrypt?"decrypt":"encrypt";var o=e.key;a.isBuffer(o)||(o=a.from(o)),"des-ede"!==r&&"des-ede-cbc"!==r||(o=a.concat([o,o.slice(0,8)]));var A=e.iv;a.isBuffer(A)||(A=a.from(A)),this._des=i.create({key:o,iv:A,type:t})}s.des=s["des-cbc"],s.des3=s["des-ede3-cbc"],e.exports=A,o(A,n),A.prototype._update=function(e){return a.from(this._des.update(e))},A.prototype._final=function(){return a.from(this._des.final())}},function(e,t,r){"use strict";t.utils=r(140),t.Cipher=r(68),t.DES=r(141),t.CBC=r(290),t.EDE=r(291)},function(e,t,r){"use strict";var n=r(12),i=r(3),o={};function a(e){n.equal(e.length,8,"Invalid IV length"),this.iv=new Array(8);for(var t=0;t<this.iv.length;t++)this.iv[t]=e[t]}t.instantiate=function(e){function t(t){e.call(this,t),this._cbcInit()}i(t,e);for(var r=Object.keys(o),n=0;n<r.length;n++){var a=r[n];t.prototype[a]=o[a]}return t.create=function(e){return new t(e)},t},o._cbcInit=function(){var e=new a(this.options.iv);this._cbcState=e},o._update=function(e,t,r,n){var i=this._cbcState,o=this.constructor.super_.prototype,a=i.iv;if("encrypt"===this.type){for(var s=0;s<this.blockSize;s++)a[s]^=e[t+s];o._update.call(this,a,0,r,n);for(s=0;s<this.blockSize;s++)a[s]=r[n+s]}else{o._update.call(this,e,t,r,n);for(s=0;s<this.blockSize;s++)r[n+s]^=a[s];for(s=0;s<this.blockSize;s++)a[s]=e[t+s]}}},function(e,t,r){"use strict";var n=r(12),i=r(3),o=r(68),a=r(141);function s(e,t){n.equal(t.length,24,"Invalid key length");var r=t.slice(0,8),i=t.slice(8,16),o=t.slice(16,24);this.ciphers="encrypt"===e?[a.create({type:"encrypt",key:r}),a.create({type:"decrypt",key:i}),a.create({type:"encrypt",key:o})]:[a.create({type:"decrypt",key:o}),a.create({type:"encrypt",key:i}),a.create({type:"decrypt",key:r})]}function A(e){o.call(this,e);var t=new s(this.type,this.options.key);this._edeState=t}i(A,o),e.exports=A,A.create=function(e){return new A(e)},A.prototype._update=function(e,t,r,n){var i=this._edeState;i.ciphers[0]._update(e,t,r,n),i.ciphers[1]._update(r,n,r,n),i.ciphers[2]._update(r,n,r,n)},A.prototype._pad=a.prototype._pad,A.prototype._unpad=a.prototype._unpad},function(e,t,r){var n=r(70),i=r(145),o=r(4).Buffer,a=r(146),s=r(16),A=r(45),c=r(46);function u(e,t,r){s.call(this),this._cache=new h,this._cipher=new A.AES(t),this._prev=o.from(r),this._mode=e,this._autopadding=!0}r(3)(u,s),u.prototype._update=function(e){var t,r;this._cache.add(e);for(var n=[];t=this._cache.get();)r=this._mode.encrypt(this,t),n.push(r);return o.concat(n)};var f=o.alloc(16,16);function h(){this.cache=o.allocUnsafe(0)}function l(e,t,r){var s=n[e.toLowerCase()];if(!s)throw new TypeError("invalid suite type");if("string"==typeof t&&(t=o.from(t)),t.length!==s.key/8)throw new TypeError("invalid key length "+t.length);if("string"==typeof r&&(r=o.from(r)),"GCM"!==s.mode&&r.length!==s.iv)throw new TypeError("invalid iv length "+r.length);return"stream"===s.type?new a(s.module,t,r):"auth"===s.type?new i(s.module,t,r):new u(s.module,t,r)}u.prototype._final=function(){var e=this._cache.flush();if(this._autopadding)return e=this._mode.encrypt(this,e),this._cipher.scrub(),e;if(!e.equals(f))throw this._cipher.scrub(),new Error("data not multiple of block length")},u.prototype.setAutoPadding=function(e){return this._autopadding=!!e,this},h.prototype.add=function(e){this.cache=o.concat([this.cache,e])},h.prototype.get=function(){if(this.cache.length>15){var e=this.cache.slice(0,16);return this.cache=this.cache.slice(16),e}return null},h.prototype.flush=function(){for(var e=16-this.cache.length,t=o.allocUnsafe(e),r=-1;++r<e;)t.writeUInt8(e,r);return o.concat([this.cache,t])},t.createCipheriv=l,t.createCipher=function(e,t){var r=n[e.toLowerCase()];if(!r)throw new TypeError("invalid suite type");var i=c(t,!1,r.key,r.iv);return l(e,i.key,i.iv)}},function(e,t){t.encrypt=function(e,t){return e._cipher.encryptBlock(t)},t.decrypt=function(e,t){return e._cipher.decryptBlock(t)}},function(e,t,r){var n=r(34);t.encrypt=function(e,t){var r=n(t,e._prev);return e._prev=e._cipher.encryptBlock(r),e._prev},t.decrypt=function(e,t){var r=e._prev;e._prev=t;var i=e._cipher.decryptBlock(t);return n(i,r)}},function(e,t,r){var n=r(4).Buffer,i=r(34);function o(e,t,r){var o=t.length,a=i(t,e._cache);return e._cache=e._cache.slice(o),e._prev=n.concat([e._prev,r?t:a]),a}t.encrypt=function(e,t,r){for(var i,a=n.allocUnsafe(0);t.length;){if(0===e._cache.length&&(e._cache=e._cipher.encryptBlock(e._prev),e._prev=n.allocUnsafe(0)),!(e._cache.length<=t.length)){a=n.concat([a,o(e,t,r)]);break}i=e._cache.length,a=n.concat([a,o(e,t.slice(0,i),r)]),t=t.slice(i)}return a}},function(e,t,r){var n=r(4).Buffer;function i(e,t,r){var i=e._cipher.encryptBlock(e._prev)[0]^t;return e._prev=n.concat([e._prev.slice(1),n.from([r?t:i])]),i}t.encrypt=function(e,t,r){for(var o=t.length,a=n.allocUnsafe(o),s=-1;++s<o;)a[s]=i(e,t[s],r);return a}},function(e,t,r){var n=r(4).Buffer;function i(e,t,r){for(var n,i,a=-1,s=0;++a<8;)n=t&1<<7-a?128:0,s+=(128&(i=e._cipher.encryptBlock(e._prev)[0]^n))>>a%8,e._prev=o(e._prev,r?n:i);return s}function o(e,t){var r=e.length,i=-1,o=n.allocUnsafe(e.length);for(e=n.concat([e,n.from([t])]);++i<r;)o[i]=e[i]<<1|e[i+1]>>7;return o}t.encrypt=function(e,t,r){for(var o=t.length,a=n.allocUnsafe(o),s=-1;++s<o;)a[s]=i(e,t[s],r);return a}},function(e,t,r){(function(e){var n=r(34);function i(e){return e._prev=e._cipher.encryptBlock(e._prev),e._prev}t.encrypt=function(t,r){for(;t._cache.length<r.length;)t._cache=e.concat([t._cache,i(t)]);var o=t._cache.slice(0,r.length);return t._cache=t._cache.slice(r.length),n(r,o)}}).call(this,r(6).Buffer)},function(e,t,r){var n=r(4).Buffer,i=n.alloc(16,0);function o(e){var t=n.allocUnsafe(16);return t.writeUInt32BE(e[0]>>>0,0),t.writeUInt32BE(e[1]>>>0,4),t.writeUInt32BE(e[2]>>>0,8),t.writeUInt32BE(e[3]>>>0,12),t}function a(e){this.h=e,this.state=n.alloc(16,0),this.cache=n.allocUnsafe(0)}a.prototype.ghash=function(e){for(var t=-1;++t<e.length;)this.state[t]^=e[t];this._multiply()},a.prototype._multiply=function(){for(var e,t,r,n=[(e=this.h).readUInt32BE(0),e.readUInt32BE(4),e.readUInt32BE(8),e.readUInt32BE(12)],i=[0,0,0,0],a=-1;++a<128;){for(0!=(this.state[~~(a/8)]&1<<7-a%8)&&(i[0]^=n[0],i[1]^=n[1],i[2]^=n[2],i[3]^=n[3]),r=0!=(1&n[3]),t=3;t>0;t--)n[t]=n[t]>>>1|(1&n[t-1])<<31;n[0]=n[0]>>>1,r&&(n[0]=n[0]^225<<24)}this.state=o(i)},a.prototype.update=function(e){var t;for(this.cache=n.concat([this.cache,e]);this.cache.length>=16;)t=this.cache.slice(0,16),this.cache=this.cache.slice(16),this.ghash(t)},a.prototype.final=function(e,t){return this.cache.length&&this.ghash(n.concat([this.cache,i],16)),this.ghash(o([0,e,0,t])),this.state},e.exports=a},function(e,t,r){var n=r(145),i=r(4).Buffer,o=r(70),a=r(146),s=r(16),A=r(45),c=r(46);function u(e,t,r){s.call(this),this._cache=new f,this._last=void 0,this._cipher=new A.AES(t),this._prev=i.from(r),this._mode=e,this._autopadding=!0}function f(){this.cache=i.allocUnsafe(0)}function h(e,t,r){var s=o[e.toLowerCase()];if(!s)throw new TypeError("invalid suite type");if("string"==typeof r&&(r=i.from(r)),"GCM"!==s.mode&&r.length!==s.iv)throw new TypeError("invalid iv length "+r.length);if("string"==typeof t&&(t=i.from(t)),t.length!==s.key/8)throw new TypeError("invalid key length "+t.length);return"stream"===s.type?new a(s.module,t,r,!0):"auth"===s.type?new n(s.module,t,r,!0):new u(s.module,t,r)}r(3)(u,s),u.prototype._update=function(e){var t,r;this._cache.add(e);for(var n=[];t=this._cache.get(this._autopadding);)r=this._mode.decrypt(this,t),n.push(r);return i.concat(n)},u.prototype._final=function(){var e=this._cache.flush();if(this._autopadding)return function(e){var t=e[15];if(t<1||t>16)throw new Error("unable to decrypt data");var r=-1;for(;++r<t;)if(e[r+(16-t)]!==t)throw new Error("unable to decrypt data");if(16===t)return;return e.slice(0,16-t)}(this._mode.decrypt(this,e));if(e)throw new Error("data not multiple of block length")},u.prototype.setAutoPadding=function(e){return this._autopadding=!!e,this},f.prototype.add=function(e){this.cache=i.concat([this.cache,e])},f.prototype.get=function(e){var t;if(e){if(this.cache.length>16)return t=this.cache.slice(0,16),this.cache=this.cache.slice(16),t}else if(this.cache.length>=16)return t=this.cache.slice(0,16),this.cache=this.cache.slice(16),t;return null},f.prototype.flush=function(){if(this.cache.length)return this.cache},t.createDecipher=function(e,t){var r=o[e.toLowerCase()];if(!r)throw new TypeError("invalid suite type");var n=c(t,!1,r.key,r.iv);return h(e,n.key,n.iv)},t.createDecipheriv=h},function(e,t){t["des-ecb"]={key:8,iv:0},t["des-cbc"]=t.des={key:8,iv:8},t["des-ede3-cbc"]=t.des3={key:24,iv:8},t["des-ede3"]={key:24,iv:0},t["des-ede-cbc"]={key:16,iv:8},t["des-ede"]={key:16,iv:0}},function(e,t){},function(e){e.exports=JSON.parse('{"modp1":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a63a3620ffffffffffffffff"},"modp2":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece65381ffffffffffffffff"},"modp5":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca237327ffffffffffffffff"},"modp14":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aacaa68ffffffffffffffff"},"modp15":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a93ad2caffffffffffffffff"},"modp16":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c934063199ffffffffffffffff"},"modp17":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c93402849236c3fab4d27c7026c1d4dcb2602646dec9751e763dba37bdf8ff9406ad9e530ee5db382f413001aeb06a53ed9027d831179727b0865a8918da3edbebcf9b14ed44ce6cbaced4bb1bdb7f1447e6cc254b332051512bd7af426fb8f401378cd2bf5983ca01c64b92ecf032ea15d1721d03f482d7ce6e74fef6d55e702f46980c82b5a84031900b1c9e59e7c97fbec7e8f323a97a7e36cc88be0f1d45b7ff585ac54bd407b22b4154aacc8f6d7ebf48e1d814cc5ed20f8037e0a79715eef29be32806a1d58bb7c5da76f550aa3d8a1fbff0eb19ccb1a313d55cda56c9ec2ef29632387fe8d76e3c0468043e8f663f4860ee12bf2d5b0b7474d6e694f91e6dcc4024ffffffffffffffff"},"modp18":{"gen":"02","prime":"ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece45b3dc2007cb8a163bf0598da48361c55d39a69163fa8fd24cf5f83655d23dca3ad961c62f356208552bb9ed529077096966d670c354e4abc9804f1746c08ca18217c32905e462e36ce3be39e772c180e86039b2783a2ec07a28fb5c55df06f4c52c9de2bcbf6955817183995497cea956ae515d2261898fa051015728e5a8aaac42dad33170d04507a33a85521abdf1cba64ecfb850458dbef0a8aea71575d060c7db3970f85a6e1e4c7abf5ae8cdb0933d71e8c94e04a25619dcee3d2261ad2ee6bf12ffa06d98a0864d87602733ec86a64521f2b18177b200cbbe117577a615d6c770988c0bad946e208e24fa074e5ab3143db5bfce0fd108e4b82d120a92108011a723c12a787e6d788719a10bdba5b2699c327186af4e23c1a946834b6150bda2583e9ca2ad44ce8dbbbc2db04de8ef92e8efc141fbecaa6287c59474e6bc05d99b2964fa090c3a2233ba186515be7ed1f612970cee2d7afb81bdd762170481cd0069127d5b05aa993b4ea988d8fddc186ffb7dc90a6c08f4df435c93402849236c3fab4d27c7026c1d4dcb2602646dec9751e763dba37bdf8ff9406ad9e530ee5db382f413001aeb06a53ed9027d831179727b0865a8918da3edbebcf9b14ed44ce6cbaced4bb1bdb7f1447e6cc254b332051512bd7af426fb8f401378cd2bf5983ca01c64b92ecf032ea15d1721d03f482d7ce6e74fef6d55e702f46980c82b5a84031900b1c9e59e7c97fbec7e8f323a97a7e36cc88be0f1d45b7ff585ac54bd407b22b4154aacc8f6d7ebf48e1d814cc5ed20f8037e0a79715eef29be32806a1d58bb7c5da76f550aa3d8a1fbff0eb19ccb1a313d55cda56c9ec2ef29632387fe8d76e3c0468043e8f663f4860ee12bf2d5b0b7474d6e694f91e6dbe115974a3926f12fee5e438777cb6a932df8cd8bec4d073b931ba3bc832b68d9dd300741fa7bf8afc47ed2576f6936ba424663aab639c5ae4f5683423b4742bf1c978238f16cbe39d652de3fdb8befc848ad922222e04a4037c0713eb57a81a23f0c73473fc646cea306b4bcbc8862f8385ddfa9d4b7fa2c087e879683303ed5bdd3a062b3cf5b3a278a66d2a13f83f44f82ddf310ee074ab6a364597e899a0255dc164f31cc50846851df9ab48195ded7ea1b1d510bd7ee74d73faf36bc31ecfa268359046f4eb879f924009438b481c6cd7889a002ed5ee382bc9190da6fc026e479558e4475677e9aa9e3050e2765694dfc81f56e880b96e7160c980dd98edd3dfffffffffffffffff"}}')},function(e,t,r){(function(t){var n=r(2),i=new(r(149)),o=new n(24),a=new n(11),s=new n(10),A=new n(3),c=new n(7),u=r(148),f=r(19);function h(e,r){return r=r||"utf8",t.isBuffer(e)||(e=new t(e,r)),this._pub=new n(e),this}function l(e,r){return r=r||"utf8",t.isBuffer(e)||(e=new t(e,r)),this._priv=new n(e),this}e.exports=d;var g={};function d(e,t,r){this.setGenerator(t),this.__prime=new n(e),this._prime=n.mont(this.__prime),this._primeLen=e.length,this._pub=void 0,this._priv=void 0,this._primeCode=void 0,r?(this.setPublicKey=h,this.setPrivateKey=l):this._primeCode=8}function p(e,r){var n=new t(e.toArray());return r?n.toString(r):n}Object.defineProperty(d.prototype,"verifyError",{enumerable:!0,get:function(){return"number"!=typeof this._primeCode&&(this._primeCode=function(e,t){var r=t.toString("hex"),n=[r,e.toString(16)].join("_");if(n in g)return g[n];var f,h=0;if(e.isEven()||!u.simpleSieve||!u.fermatTest(e)||!i.test(e))return h+=1,h+="02"===r||"05"===r?8:4,g[n]=h,h;switch(i.test(e.shrn(1))||(h+=2),r){case"02":e.mod(o).cmp(a)&&(h+=8);break;case"05":(f=e.mod(s)).cmp(A)&&f.cmp(c)&&(h+=8);break;default:h+=4}return g[n]=h,h}(this.__prime,this.__gen)),this._primeCode}}),d.prototype.generateKeys=function(){return this._priv||(this._priv=new n(f(this._primeLen))),this._pub=this._gen.toRed(this._prime).redPow(this._priv).fromRed(),this.getPublicKey()},d.prototype.computeSecret=function(e){var r=(e=(e=new n(e)).toRed(this._prime)).redPow(this._priv).fromRed(),i=new t(r.toArray()),o=this.getPrime();if(i.length<o.length){var a=new t(o.length-i.length);a.fill(0),i=t.concat([a,i])}return i},d.prototype.getPublicKey=function(e){return p(this._pub,e)},d.prototype.getPrivateKey=function(e){return p(this._priv,e)},d.prototype.getPrime=function(e){return p(this.__prime,e)},d.prototype.getGenerator=function(e){return p(this._gen,e)},d.prototype.setGenerator=function(e,r){return r=r||"utf8",t.isBuffer(e)||(e=new t(e,r)),this.__gen=e,this._gen=new n(e),this}}).call(this,r(6).Buffer)},function(e,t,r){var n=r(4).Buffer,i=r(66),o=r(72),a=r(73).ec,s=r(2),A=r(48),c=r(158);function u(e,t,r,o){if((e=n.from(e.toArray())).length<t.byteLength()){var a=n.alloc(t.byteLength()-e.length);e=n.concat([a,e])}var s=r.length,A=function(e,t){e=(e=f(e,t)).mod(t);var r=n.from(e.toArray());if(r.length<t.byteLength()){var i=n.alloc(t.byteLength()-r.length);r=n.concat([i,r])}return r}(r,t),c=n.alloc(s);c.fill(1);var u=n.alloc(s);return u=i(o,u).update(c).update(n.from([0])).update(e).update(A).digest(),c=i(o,u).update(c).digest(),{k:u=i(o,u).update(c).update(n.from([1])).update(e).update(A).digest(),v:c=i(o,u).update(c).digest()}}function f(e,t){var r=new s(e),n=(e.length<<3)-t.bitLength();return n>0&&r.ishrn(n),r}function h(e,t,r){var o,a;do{for(o=n.alloc(0);8*o.length<e.bitLength();)t.v=i(r,t.k).update(t.v).digest(),o=n.concat([o,t.v]);a=f(o,e),t.k=i(r,t.k).update(t.v).update(n.from([0])).digest(),t.v=i(r,t.k).update(t.v).digest()}while(-1!==a.cmp(e));return a}function l(e,t,r,n){return e.toRed(s.mont(r)).redPow(t).fromRed().mod(n)}e.exports=function(e,t,r,i,g){var d=A(t);if(d.curve){if("ecdsa"!==i&&"ecdsa/rsa"!==i)throw new Error("wrong private key type");return function(e,t){var r=c[t.curve.join(".")];if(!r)throw new Error("unknown curve "+t.curve.join("."));var i=new a(r).keyFromPrivate(t.privateKey).sign(e);return n.from(i.toDER())}(e,d)}if("dsa"===d.type){if("dsa"!==i)throw new Error("wrong private key type");return function(e,t,r){var i,o=t.params.priv_key,a=t.params.p,A=t.params.q,c=t.params.g,g=new s(0),d=f(e,A).mod(A),p=!1,I=u(o,A,e,r);for(;!1===p;)i=h(A,I,r),g=l(c,i,a,A),0===(p=i.invm(A).imul(d.add(o.mul(g))).mod(A)).cmpn(0)&&(p=!1,g=new s(0));return function(e,t){e=e.toArray(),t=t.toArray(),128&e[0]&&(e=[0].concat(e));128&t[0]&&(t=[0].concat(t));var r=[48,e.length+t.length+4,2,e.length];return r=r.concat(e,[2,t.length],t),n.from(r)}(g,p)}(e,d,r)}if("rsa"!==i&&"ecdsa/rsa"!==i)throw new Error("wrong private key type");e=n.concat([g,e]);for(var p=d.modulus.byteLength(),I=[0,1];e.length+I.length+1<p;)I.push(255);I.push(0);for(var y=-1;++y<e.length;)I.push(e[y]);return o(I,d)},e.exports.getKey=u,e.exports.makeKey=h},function(e){e.exports=JSON.parse('{"name":"elliptic","version":"6.5.4","description":"EC cryptography","main":"lib/elliptic.js","files":["lib"],"scripts":{"lint":"eslint lib test","lint:fix":"npm run lint -- --fix","unit":"istanbul test _mocha --reporter=spec test/index.js","test":"npm run lint && npm run unit","version":"grunt dist && git add dist/"},"repository":{"type":"git","url":"git@github.com:indutny/elliptic"},"keywords":["EC","Elliptic","curve","Cryptography"],"author":"Fedor Indutny <fedor@indutny.com>","license":"MIT","bugs":{"url":"https://github.com/indutny/elliptic/issues"},"homepage":"https://github.com/indutny/elliptic","devDependencies":{"brfs":"^2.0.2","coveralls":"^3.1.0","eslint":"^7.6.0","grunt":"^1.2.1","grunt-browserify":"^5.3.0","grunt-cli":"^1.3.2","grunt-contrib-connect":"^3.0.0","grunt-contrib-copy":"^1.0.0","grunt-contrib-uglify":"^5.0.0","grunt-mocha-istanbul":"^5.0.2","grunt-saucelabs":"^9.0.1","istanbul":"^0.4.5","mocha":"^8.0.1"},"dependencies":{"bn.js":"^4.11.9","brorand":"^1.1.0","hash.js":"^1.0.0","hmac-drbg":"^1.0.1","inherits":"^2.0.4","minimalistic-assert":"^1.0.1","minimalistic-crypto-utils":"^1.0.1"}}')},function(e,t,r){"use strict";var n=r(13),i=r(2),o=r(3),a=r(47),s=n.assert;function A(e){a.call(this,"short",e),this.a=new i(e.a,16).toRed(this.red),this.b=new i(e.b,16).toRed(this.red),this.tinv=this.two.redInvm(),this.zeroA=0===this.a.fromRed().cmpn(0),this.threeA=0===this.a.fromRed().sub(this.p).cmpn(-3),this.endo=this._getEndomorphism(e),this._endoWnafT1=new Array(4),this._endoWnafT2=new Array(4)}function c(e,t,r,n){a.BasePoint.call(this,e,"affine"),null===t&&null===r?(this.x=null,this.y=null,this.inf=!0):(this.x=new i(t,16),this.y=new i(r,16),n&&(this.x.forceRed(this.curve.red),this.y.forceRed(this.curve.red)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.inf=!1)}function u(e,t,r,n){a.BasePoint.call(this,e,"jacobian"),null===t&&null===r&&null===n?(this.x=this.curve.one,this.y=this.curve.one,this.z=new i(0)):(this.x=new i(t,16),this.y=new i(r,16),this.z=new i(n,16)),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.zOne=this.z===this.curve.one}o(A,a),e.exports=A,A.prototype._getEndomorphism=function(e){if(this.zeroA&&this.g&&this.n&&1===this.p.modn(3)){var t,r;if(e.beta)t=new i(e.beta,16).toRed(this.red);else{var n=this._getEndoRoots(this.p);t=(t=n[0].cmp(n[1])<0?n[0]:n[1]).toRed(this.red)}if(e.lambda)r=new i(e.lambda,16);else{var o=this._getEndoRoots(this.n);0===this.g.mul(o[0]).x.cmp(this.g.x.redMul(t))?r=o[0]:(r=o[1],s(0===this.g.mul(r).x.cmp(this.g.x.redMul(t))))}return{beta:t,lambda:r,basis:e.basis?e.basis.map((function(e){return{a:new i(e.a,16),b:new i(e.b,16)}})):this._getEndoBasis(r)}}},A.prototype._getEndoRoots=function(e){var t=e===this.p?this.red:i.mont(e),r=new i(2).toRed(t).redInvm(),n=r.redNeg(),o=new i(3).toRed(t).redNeg().redSqrt().redMul(r);return[n.redAdd(o).fromRed(),n.redSub(o).fromRed()]},A.prototype._getEndoBasis=function(e){for(var t,r,n,o,a,s,A,c,u,f=this.n.ushrn(Math.floor(this.n.bitLength()/2)),h=e,l=this.n.clone(),g=new i(1),d=new i(0),p=new i(0),I=new i(1),y=0;0!==h.cmpn(0);){var b=l.div(h);c=l.sub(b.mul(h)),u=p.sub(b.mul(g));var E=I.sub(b.mul(d));if(!n&&c.cmp(f)<0)t=A.neg(),r=g,n=c.neg(),o=u;else if(n&&2==++y)break;A=c,l=h,h=c,p=g,g=u,I=d,d=E}a=c.neg(),s=u;var m=n.sqr().add(o.sqr());return a.sqr().add(s.sqr()).cmp(m)>=0&&(a=t,s=r),n.negative&&(n=n.neg(),o=o.neg()),a.negative&&(a=a.neg(),s=s.neg()),[{a:n,b:o},{a:a,b:s}]},A.prototype._endoSplit=function(e){var t=this.endo.basis,r=t[0],n=t[1],i=n.b.mul(e).divRound(this.n),o=r.b.neg().mul(e).divRound(this.n),a=i.mul(r.a),s=o.mul(n.a),A=i.mul(r.b),c=o.mul(n.b);return{k1:e.sub(a).sub(s),k2:A.add(c).neg()}},A.prototype.pointFromX=function(e,t){(e=new i(e,16)).red||(e=e.toRed(this.red));var r=e.redSqr().redMul(e).redIAdd(e.redMul(this.a)).redIAdd(this.b),n=r.redSqrt();if(0!==n.redSqr().redSub(r).cmp(this.zero))throw new Error("invalid point");var o=n.fromRed().isOdd();return(t&&!o||!t&&o)&&(n=n.redNeg()),this.point(e,n)},A.prototype.validate=function(e){if(e.inf)return!0;var t=e.x,r=e.y,n=this.a.redMul(t),i=t.redSqr().redMul(t).redIAdd(n).redIAdd(this.b);return 0===r.redSqr().redISub(i).cmpn(0)},A.prototype._endoWnafMulAdd=function(e,t,r){for(var n=this._endoWnafT1,i=this._endoWnafT2,o=0;o<e.length;o++){var a=this._endoSplit(t[o]),s=e[o],A=s._getBeta();a.k1.negative&&(a.k1.ineg(),s=s.neg(!0)),a.k2.negative&&(a.k2.ineg(),A=A.neg(!0)),n[2*o]=s,n[2*o+1]=A,i[2*o]=a.k1,i[2*o+1]=a.k2}for(var c=this._wnafMulAdd(1,n,i,2*o,r),u=0;u<2*o;u++)n[u]=null,i[u]=null;return c},o(c,a.BasePoint),A.prototype.point=function(e,t,r){return new c(this,e,t,r)},A.prototype.pointFromJSON=function(e,t){return c.fromJSON(this,e,t)},c.prototype._getBeta=function(){if(this.curve.endo){var e=this.precomputed;if(e&&e.beta)return e.beta;var t=this.curve.point(this.x.redMul(this.curve.endo.beta),this.y);if(e){var r=this.curve,n=function(e){return r.point(e.x.redMul(r.endo.beta),e.y)};e.beta=t,t.precomputed={beta:null,naf:e.naf&&{wnd:e.naf.wnd,points:e.naf.points.map(n)},doubles:e.doubles&&{step:e.doubles.step,points:e.doubles.points.map(n)}}}return t}},c.prototype.toJSON=function(){return this.precomputed?[this.x,this.y,this.precomputed&&{doubles:this.precomputed.doubles&&{step:this.precomputed.doubles.step,points:this.precomputed.doubles.points.slice(1)},naf:this.precomputed.naf&&{wnd:this.precomputed.naf.wnd,points:this.precomputed.naf.points.slice(1)}}]:[this.x,this.y]},c.fromJSON=function(e,t,r){"string"==typeof t&&(t=JSON.parse(t));var n=e.point(t[0],t[1],r);if(!t[2])return n;function i(t){return e.point(t[0],t[1],r)}var o=t[2];return n.precomputed={beta:null,doubles:o.doubles&&{step:o.doubles.step,points:[n].concat(o.doubles.points.map(i))},naf:o.naf&&{wnd:o.naf.wnd,points:[n].concat(o.naf.points.map(i))}},n},c.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+">"},c.prototype.isInfinity=function(){return this.inf},c.prototype.add=function(e){if(this.inf)return e;if(e.inf)return this;if(this.eq(e))return this.dbl();if(this.neg().eq(e))return this.curve.point(null,null);if(0===this.x.cmp(e.x))return this.curve.point(null,null);var t=this.y.redSub(e.y);0!==t.cmpn(0)&&(t=t.redMul(this.x.redSub(e.x).redInvm()));var r=t.redSqr().redISub(this.x).redISub(e.x),n=t.redMul(this.x.redSub(r)).redISub(this.y);return this.curve.point(r,n)},c.prototype.dbl=function(){if(this.inf)return this;var e=this.y.redAdd(this.y);if(0===e.cmpn(0))return this.curve.point(null,null);var t=this.curve.a,r=this.x.redSqr(),n=e.redInvm(),i=r.redAdd(r).redIAdd(r).redIAdd(t).redMul(n),o=i.redSqr().redISub(this.x.redAdd(this.x)),a=i.redMul(this.x.redSub(o)).redISub(this.y);return this.curve.point(o,a)},c.prototype.getX=function(){return this.x.fromRed()},c.prototype.getY=function(){return this.y.fromRed()},c.prototype.mul=function(e){return e=new i(e,16),this.isInfinity()?this:this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve.endo?this.curve._endoWnafMulAdd([this],[e]):this.curve._wnafMul(this,e)},c.prototype.mulAdd=function(e,t,r){var n=[this,t],i=[e,r];return this.curve.endo?this.curve._endoWnafMulAdd(n,i):this.curve._wnafMulAdd(1,n,i,2)},c.prototype.jmulAdd=function(e,t,r){var n=[this,t],i=[e,r];return this.curve.endo?this.curve._endoWnafMulAdd(n,i,!0):this.curve._wnafMulAdd(1,n,i,2,!0)},c.prototype.eq=function(e){return this===e||this.inf===e.inf&&(this.inf||0===this.x.cmp(e.x)&&0===this.y.cmp(e.y))},c.prototype.neg=function(e){if(this.inf)return this;var t=this.curve.point(this.x,this.y.redNeg());if(e&&this.precomputed){var r=this.precomputed,n=function(e){return e.neg()};t.precomputed={naf:r.naf&&{wnd:r.naf.wnd,points:r.naf.points.map(n)},doubles:r.doubles&&{step:r.doubles.step,points:r.doubles.points.map(n)}}}return t},c.prototype.toJ=function(){return this.inf?this.curve.jpoint(null,null,null):this.curve.jpoint(this.x,this.y,this.curve.one)},o(u,a.BasePoint),A.prototype.jpoint=function(e,t,r){return new u(this,e,t,r)},u.prototype.toP=function(){if(this.isInfinity())return this.curve.point(null,null);var e=this.z.redInvm(),t=e.redSqr(),r=this.x.redMul(t),n=this.y.redMul(t).redMul(e);return this.curve.point(r,n)},u.prototype.neg=function(){return this.curve.jpoint(this.x,this.y.redNeg(),this.z)},u.prototype.add=function(e){if(this.isInfinity())return e;if(e.isInfinity())return this;var t=e.z.redSqr(),r=this.z.redSqr(),n=this.x.redMul(t),i=e.x.redMul(r),o=this.y.redMul(t.redMul(e.z)),a=e.y.redMul(r.redMul(this.z)),s=n.redSub(i),A=o.redSub(a);if(0===s.cmpn(0))return 0!==A.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var c=s.redSqr(),u=c.redMul(s),f=n.redMul(c),h=A.redSqr().redIAdd(u).redISub(f).redISub(f),l=A.redMul(f.redISub(h)).redISub(o.redMul(u)),g=this.z.redMul(e.z).redMul(s);return this.curve.jpoint(h,l,g)},u.prototype.mixedAdd=function(e){if(this.isInfinity())return e.toJ();if(e.isInfinity())return this;var t=this.z.redSqr(),r=this.x,n=e.x.redMul(t),i=this.y,o=e.y.redMul(t).redMul(this.z),a=r.redSub(n),s=i.redSub(o);if(0===a.cmpn(0))return 0!==s.cmpn(0)?this.curve.jpoint(null,null,null):this.dbl();var A=a.redSqr(),c=A.redMul(a),u=r.redMul(A),f=s.redSqr().redIAdd(c).redISub(u).redISub(u),h=s.redMul(u.redISub(f)).redISub(i.redMul(c)),l=this.z.redMul(a);return this.curve.jpoint(f,h,l)},u.prototype.dblp=function(e){if(0===e)return this;if(this.isInfinity())return this;if(!e)return this.dbl();var t;if(this.curve.zeroA||this.curve.threeA){var r=this;for(t=0;t<e;t++)r=r.dbl();return r}var n=this.curve.a,i=this.curve.tinv,o=this.x,a=this.y,s=this.z,A=s.redSqr().redSqr(),c=a.redAdd(a);for(t=0;t<e;t++){var u=o.redSqr(),f=c.redSqr(),h=f.redSqr(),l=u.redAdd(u).redIAdd(u).redIAdd(n.redMul(A)),g=o.redMul(f),d=l.redSqr().redISub(g.redAdd(g)),p=g.redISub(d),I=l.redMul(p);I=I.redIAdd(I).redISub(h);var y=c.redMul(s);t+1<e&&(A=A.redMul(h)),o=d,s=y,c=I}return this.curve.jpoint(o,c.redMul(i),s)},u.prototype.dbl=function(){return this.isInfinity()?this:this.curve.zeroA?this._zeroDbl():this.curve.threeA?this._threeDbl():this._dbl()},u.prototype._zeroDbl=function(){var e,t,r;if(this.zOne){var n=this.x.redSqr(),i=this.y.redSqr(),o=i.redSqr(),a=this.x.redAdd(i).redSqr().redISub(n).redISub(o);a=a.redIAdd(a);var s=n.redAdd(n).redIAdd(n),A=s.redSqr().redISub(a).redISub(a),c=o.redIAdd(o);c=(c=c.redIAdd(c)).redIAdd(c),e=A,t=s.redMul(a.redISub(A)).redISub(c),r=this.y.redAdd(this.y)}else{var u=this.x.redSqr(),f=this.y.redSqr(),h=f.redSqr(),l=this.x.redAdd(f).redSqr().redISub(u).redISub(h);l=l.redIAdd(l);var g=u.redAdd(u).redIAdd(u),d=g.redSqr(),p=h.redIAdd(h);p=(p=p.redIAdd(p)).redIAdd(p),e=d.redISub(l).redISub(l),t=g.redMul(l.redISub(e)).redISub(p),r=(r=this.y.redMul(this.z)).redIAdd(r)}return this.curve.jpoint(e,t,r)},u.prototype._threeDbl=function(){var e,t,r;if(this.zOne){var n=this.x.redSqr(),i=this.y.redSqr(),o=i.redSqr(),a=this.x.redAdd(i).redSqr().redISub(n).redISub(o);a=a.redIAdd(a);var s=n.redAdd(n).redIAdd(n).redIAdd(this.curve.a),A=s.redSqr().redISub(a).redISub(a);e=A;var c=o.redIAdd(o);c=(c=c.redIAdd(c)).redIAdd(c),t=s.redMul(a.redISub(A)).redISub(c),r=this.y.redAdd(this.y)}else{var u=this.z.redSqr(),f=this.y.redSqr(),h=this.x.redMul(f),l=this.x.redSub(u).redMul(this.x.redAdd(u));l=l.redAdd(l).redIAdd(l);var g=h.redIAdd(h),d=(g=g.redIAdd(g)).redAdd(g);e=l.redSqr().redISub(d),r=this.y.redAdd(this.z).redSqr().redISub(f).redISub(u);var p=f.redSqr();p=(p=(p=p.redIAdd(p)).redIAdd(p)).redIAdd(p),t=l.redMul(g.redISub(e)).redISub(p)}return this.curve.jpoint(e,t,r)},u.prototype._dbl=function(){var e=this.curve.a,t=this.x,r=this.y,n=this.z,i=n.redSqr().redSqr(),o=t.redSqr(),a=r.redSqr(),s=o.redAdd(o).redIAdd(o).redIAdd(e.redMul(i)),A=t.redAdd(t),c=(A=A.redIAdd(A)).redMul(a),u=s.redSqr().redISub(c.redAdd(c)),f=c.redISub(u),h=a.redSqr();h=(h=(h=h.redIAdd(h)).redIAdd(h)).redIAdd(h);var l=s.redMul(f).redISub(h),g=r.redAdd(r).redMul(n);return this.curve.jpoint(u,l,g)},u.prototype.trpl=function(){if(!this.curve.zeroA)return this.dbl().add(this);var e=this.x.redSqr(),t=this.y.redSqr(),r=this.z.redSqr(),n=t.redSqr(),i=e.redAdd(e).redIAdd(e),o=i.redSqr(),a=this.x.redAdd(t).redSqr().redISub(e).redISub(n),s=(a=(a=(a=a.redIAdd(a)).redAdd(a).redIAdd(a)).redISub(o)).redSqr(),A=n.redIAdd(n);A=(A=(A=A.redIAdd(A)).redIAdd(A)).redIAdd(A);var c=i.redIAdd(a).redSqr().redISub(o).redISub(s).redISub(A),u=t.redMul(c);u=(u=u.redIAdd(u)).redIAdd(u);var f=this.x.redMul(s).redISub(u);f=(f=f.redIAdd(f)).redIAdd(f);var h=this.y.redMul(c.redMul(A.redISub(c)).redISub(a.redMul(s)));h=(h=(h=h.redIAdd(h)).redIAdd(h)).redIAdd(h);var l=this.z.redAdd(a).redSqr().redISub(r).redISub(s);return this.curve.jpoint(f,h,l)},u.prototype.mul=function(e,t){return e=new i(e,t),this.curve._wnafMul(this,e)},u.prototype.eq=function(e){if("affine"===e.type)return this.eq(e.toJ());if(this===e)return!0;var t=this.z.redSqr(),r=e.z.redSqr();if(0!==this.x.redMul(r).redISub(e.x.redMul(t)).cmpn(0))return!1;var n=t.redMul(this.z),i=r.redMul(e.z);return 0===this.y.redMul(i).redISub(e.y.redMul(n)).cmpn(0)},u.prototype.eqXToP=function(e){var t=this.z.redSqr(),r=e.toRed(this.curve.red).redMul(t);if(0===this.x.cmp(r))return!0;for(var n=e.clone(),i=this.curve.redN.redMul(t);;){if(n.iadd(this.curve.n),n.cmp(this.curve.p)>=0)return!1;if(r.redIAdd(i),0===this.x.cmp(r))return!0}},u.prototype.inspect=function(){return this.isInfinity()?"<EC JPoint Infinity>":"<EC JPoint x: "+this.x.toString(16,2)+" y: "+this.y.toString(16,2)+" z: "+this.z.toString(16,2)+">"},u.prototype.isInfinity=function(){return 0===this.z.cmpn(0)}},function(e,t,r){"use strict";var n=r(2),i=r(3),o=r(47),a=r(13);function s(e){o.call(this,"mont",e),this.a=new n(e.a,16).toRed(this.red),this.b=new n(e.b,16).toRed(this.red),this.i4=new n(4).toRed(this.red).redInvm(),this.two=new n(2).toRed(this.red),this.a24=this.i4.redMul(this.a.redAdd(this.two))}function A(e,t,r){o.BasePoint.call(this,e,"projective"),null===t&&null===r?(this.x=this.curve.one,this.z=this.curve.zero):(this.x=new n(t,16),this.z=new n(r,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)))}i(s,o),e.exports=s,s.prototype.validate=function(e){var t=e.normalize().x,r=t.redSqr(),n=r.redMul(t).redAdd(r.redMul(this.a)).redAdd(t);return 0===n.redSqrt().redSqr().cmp(n)},i(A,o.BasePoint),s.prototype.decodePoint=function(e,t){return this.point(a.toArray(e,t),1)},s.prototype.point=function(e,t){return new A(this,e,t)},s.prototype.pointFromJSON=function(e){return A.fromJSON(this,e)},A.prototype.precompute=function(){},A.prototype._encode=function(){return this.getX().toArray("be",this.curve.p.byteLength())},A.fromJSON=function(e,t){return new A(e,t[0],t[1]||e.one)},A.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" z: "+this.z.fromRed().toString(16,2)+">"},A.prototype.isInfinity=function(){return 0===this.z.cmpn(0)},A.prototype.dbl=function(){var e=this.x.redAdd(this.z).redSqr(),t=this.x.redSub(this.z).redSqr(),r=e.redSub(t),n=e.redMul(t),i=r.redMul(t.redAdd(this.curve.a24.redMul(r)));return this.curve.point(n,i)},A.prototype.add=function(){throw new Error("Not supported on Montgomery curve")},A.prototype.diffAdd=function(e,t){var r=this.x.redAdd(this.z),n=this.x.redSub(this.z),i=e.x.redAdd(e.z),o=e.x.redSub(e.z).redMul(r),a=i.redMul(n),s=t.z.redMul(o.redAdd(a).redSqr()),A=t.x.redMul(o.redISub(a).redSqr());return this.curve.point(s,A)},A.prototype.mul=function(e){for(var t=e.clone(),r=this,n=this.curve.point(null,null),i=[];0!==t.cmpn(0);t.iushrn(1))i.push(t.andln(1));for(var o=i.length-1;o>=0;o--)0===i[o]?(r=r.diffAdd(n,this),n=n.dbl()):(n=r.diffAdd(n,this),r=r.dbl());return n},A.prototype.mulAdd=function(){throw new Error("Not supported on Montgomery curve")},A.prototype.jumlAdd=function(){throw new Error("Not supported on Montgomery curve")},A.prototype.eq=function(e){return 0===this.getX().cmp(e.getX())},A.prototype.normalize=function(){return this.x=this.x.redMul(this.z.redInvm()),this.z=this.curve.one,this},A.prototype.getX=function(){return this.normalize(),this.x.fromRed()}},function(e,t,r){"use strict";var n=r(13),i=r(2),o=r(3),a=r(47),s=n.assert;function A(e){this.twisted=1!=(0|e.a),this.mOneA=this.twisted&&-1==(0|e.a),this.extended=this.mOneA,a.call(this,"edwards",e),this.a=new i(e.a,16).umod(this.red.m),this.a=this.a.toRed(this.red),this.c=new i(e.c,16).toRed(this.red),this.c2=this.c.redSqr(),this.d=new i(e.d,16).toRed(this.red),this.dd=this.d.redAdd(this.d),s(!this.twisted||0===this.c.fromRed().cmpn(1)),this.oneC=1==(0|e.c)}function c(e,t,r,n,o){a.BasePoint.call(this,e,"projective"),null===t&&null===r&&null===n?(this.x=this.curve.zero,this.y=this.curve.one,this.z=this.curve.one,this.t=this.curve.zero,this.zOne=!0):(this.x=new i(t,16),this.y=new i(r,16),this.z=n?new i(n,16):this.curve.one,this.t=o&&new i(o,16),this.x.red||(this.x=this.x.toRed(this.curve.red)),this.y.red||(this.y=this.y.toRed(this.curve.red)),this.z.red||(this.z=this.z.toRed(this.curve.red)),this.t&&!this.t.red&&(this.t=this.t.toRed(this.curve.red)),this.zOne=this.z===this.curve.one,this.curve.extended&&!this.t&&(this.t=this.x.redMul(this.y),this.zOne||(this.t=this.t.redMul(this.z.redInvm()))))}o(A,a),e.exports=A,A.prototype._mulA=function(e){return this.mOneA?e.redNeg():this.a.redMul(e)},A.prototype._mulC=function(e){return this.oneC?e:this.c.redMul(e)},A.prototype.jpoint=function(e,t,r,n){return this.point(e,t,r,n)},A.prototype.pointFromX=function(e,t){(e=new i(e,16)).red||(e=e.toRed(this.red));var r=e.redSqr(),n=this.c2.redSub(this.a.redMul(r)),o=this.one.redSub(this.c2.redMul(this.d).redMul(r)),a=n.redMul(o.redInvm()),s=a.redSqrt();if(0!==s.redSqr().redSub(a).cmp(this.zero))throw new Error("invalid point");var A=s.fromRed().isOdd();return(t&&!A||!t&&A)&&(s=s.redNeg()),this.point(e,s)},A.prototype.pointFromY=function(e,t){(e=new i(e,16)).red||(e=e.toRed(this.red));var r=e.redSqr(),n=r.redSub(this.c2),o=r.redMul(this.d).redMul(this.c2).redSub(this.a),a=n.redMul(o.redInvm());if(0===a.cmp(this.zero)){if(t)throw new Error("invalid point");return this.point(this.zero,e)}var s=a.redSqrt();if(0!==s.redSqr().redSub(a).cmp(this.zero))throw new Error("invalid point");return s.fromRed().isOdd()!==t&&(s=s.redNeg()),this.point(s,e)},A.prototype.validate=function(e){if(e.isInfinity())return!0;e.normalize();var t=e.x.redSqr(),r=e.y.redSqr(),n=t.redMul(this.a).redAdd(r),i=this.c2.redMul(this.one.redAdd(this.d.redMul(t).redMul(r)));return 0===n.cmp(i)},o(c,a.BasePoint),A.prototype.pointFromJSON=function(e){return c.fromJSON(this,e)},A.prototype.point=function(e,t,r,n){return new c(this,e,t,r,n)},c.fromJSON=function(e,t){return new c(e,t[0],t[1],t[2])},c.prototype.inspect=function(){return this.isInfinity()?"<EC Point Infinity>":"<EC Point x: "+this.x.fromRed().toString(16,2)+" y: "+this.y.fromRed().toString(16,2)+" z: "+this.z.fromRed().toString(16,2)+">"},c.prototype.isInfinity=function(){return 0===this.x.cmpn(0)&&(0===this.y.cmp(this.z)||this.zOne&&0===this.y.cmp(this.curve.c))},c.prototype._extDbl=function(){var e=this.x.redSqr(),t=this.y.redSqr(),r=this.z.redSqr();r=r.redIAdd(r);var n=this.curve._mulA(e),i=this.x.redAdd(this.y).redSqr().redISub(e).redISub(t),o=n.redAdd(t),a=o.redSub(r),s=n.redSub(t),A=i.redMul(a),c=o.redMul(s),u=i.redMul(s),f=a.redMul(o);return this.curve.point(A,c,f,u)},c.prototype._projDbl=function(){var e,t,r,n,i,o,a=this.x.redAdd(this.y).redSqr(),s=this.x.redSqr(),A=this.y.redSqr();if(this.curve.twisted){var c=(n=this.curve._mulA(s)).redAdd(A);this.zOne?(e=a.redSub(s).redSub(A).redMul(c.redSub(this.curve.two)),t=c.redMul(n.redSub(A)),r=c.redSqr().redSub(c).redSub(c)):(i=this.z.redSqr(),o=c.redSub(i).redISub(i),e=a.redSub(s).redISub(A).redMul(o),t=c.redMul(n.redSub(A)),r=c.redMul(o))}else n=s.redAdd(A),i=this.curve._mulC(this.z).redSqr(),o=n.redSub(i).redSub(i),e=this.curve._mulC(a.redISub(n)).redMul(o),t=this.curve._mulC(n).redMul(s.redISub(A)),r=n.redMul(o);return this.curve.point(e,t,r)},c.prototype.dbl=function(){return this.isInfinity()?this:this.curve.extended?this._extDbl():this._projDbl()},c.prototype._extAdd=function(e){var t=this.y.redSub(this.x).redMul(e.y.redSub(e.x)),r=this.y.redAdd(this.x).redMul(e.y.redAdd(e.x)),n=this.t.redMul(this.curve.dd).redMul(e.t),i=this.z.redMul(e.z.redAdd(e.z)),o=r.redSub(t),a=i.redSub(n),s=i.redAdd(n),A=r.redAdd(t),c=o.redMul(a),u=s.redMul(A),f=o.redMul(A),h=a.redMul(s);return this.curve.point(c,u,h,f)},c.prototype._projAdd=function(e){var t,r,n=this.z.redMul(e.z),i=n.redSqr(),o=this.x.redMul(e.x),a=this.y.redMul(e.y),s=this.curve.d.redMul(o).redMul(a),A=i.redSub(s),c=i.redAdd(s),u=this.x.redAdd(this.y).redMul(e.x.redAdd(e.y)).redISub(o).redISub(a),f=n.redMul(A).redMul(u);return this.curve.twisted?(t=n.redMul(c).redMul(a.redSub(this.curve._mulA(o))),r=A.redMul(c)):(t=n.redMul(c).redMul(a.redSub(o)),r=this.curve._mulC(A).redMul(c)),this.curve.point(f,t,r)},c.prototype.add=function(e){return this.isInfinity()?e:e.isInfinity()?this:this.curve.extended?this._extAdd(e):this._projAdd(e)},c.prototype.mul=function(e){return this._hasDoubles(e)?this.curve._fixedNafMul(this,e):this.curve._wnafMul(this,e)},c.prototype.mulAdd=function(e,t,r){return this.curve._wnafMulAdd(1,[this,t],[e,r],2,!1)},c.prototype.jmulAdd=function(e,t,r){return this.curve._wnafMulAdd(1,[this,t],[e,r],2,!0)},c.prototype.normalize=function(){if(this.zOne)return this;var e=this.z.redInvm();return this.x=this.x.redMul(e),this.y=this.y.redMul(e),this.t&&(this.t=this.t.redMul(e)),this.z=this.curve.one,this.zOne=!0,this},c.prototype.neg=function(){return this.curve.point(this.x.redNeg(),this.y,this.z,this.t&&this.t.redNeg())},c.prototype.getX=function(){return this.normalize(),this.x.fromRed()},c.prototype.getY=function(){return this.normalize(),this.y.fromRed()},c.prototype.eq=function(e){return this===e||0===this.getX().cmp(e.getX())&&0===this.getY().cmp(e.getY())},c.prototype.eqXToP=function(e){var t=e.toRed(this.curve.red).redMul(this.z);if(0===this.x.cmp(t))return!0;for(var r=e.clone(),n=this.curve.redN.redMul(this.z);;){if(r.iadd(this.curve.n),r.cmp(this.curve.p)>=0)return!1;if(t.redIAdd(n),0===this.x.cmp(t))return!0}},c.prototype.toP=c.prototype.normalize,c.prototype.mixedAdd=c.prototype.add},function(e,t){e.exports={doubles:{step:4,points:[["e60fce93b59e9ec53011aabc21c23e97b2a31369b87a5ae9c44ee89e2a6dec0a","f7e3507399e595929db99f34f57937101296891e44d23f0be1f32cce69616821"],["8282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508","11f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf"],["175e159f728b865a72f99cc6c6fc846de0b93833fd2222ed73fce5b551e5b739","d3506e0d9e3c79eba4ef97a51ff71f5eacb5955add24345c6efa6ffee9fed695"],["363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640","4e273adfc732221953b445397f3363145b9a89008199ecb62003c7f3bee9de9"],["8b4b5f165df3c2be8c6244b5b745638843e4a781a15bcd1b69f79a55dffdf80c","4aad0a6f68d308b4b3fbd7813ab0da04f9e336546162ee56b3eff0c65fd4fd36"],["723cbaa6e5db996d6bf771c00bd548c7b700dbffa6c0e77bcb6115925232fcda","96e867b5595cc498a921137488824d6e2660a0653779494801dc069d9eb39f5f"],["eebfa4d493bebf98ba5feec812c2d3b50947961237a919839a533eca0e7dd7fa","5d9a8ca3970ef0f269ee7edaf178089d9ae4cdc3a711f712ddfd4fdae1de8999"],["100f44da696e71672791d0a09b7bde459f1215a29b3c03bfefd7835b39a48db0","cdd9e13192a00b772ec8f3300c090666b7ff4a18ff5195ac0fbd5cd62bc65a09"],["e1031be262c7ed1b1dc9227a4a04c017a77f8d4464f3b3852c8acde6e534fd2d","9d7061928940405e6bb6a4176597535af292dd419e1ced79a44f18f29456a00d"],["feea6cae46d55b530ac2839f143bd7ec5cf8b266a41d6af52d5e688d9094696d","e57c6b6c97dce1bab06e4e12bf3ecd5c981c8957cc41442d3155debf18090088"],["da67a91d91049cdcb367be4be6ffca3cfeed657d808583de33fa978bc1ec6cb1","9bacaa35481642bc41f463f7ec9780e5dec7adc508f740a17e9ea8e27a68be1d"],["53904faa0b334cdda6e000935ef22151ec08d0f7bb11069f57545ccc1a37b7c0","5bc087d0bc80106d88c9eccac20d3c1c13999981e14434699dcb096b022771c8"],["8e7bcd0bd35983a7719cca7764ca906779b53a043a9b8bcaeff959f43ad86047","10b7770b2a3da4b3940310420ca9514579e88e2e47fd68b3ea10047e8460372a"],["385eed34c1cdff21e6d0818689b81bde71a7f4f18397e6690a841e1599c43862","283bebc3e8ea23f56701de19e9ebf4576b304eec2086dc8cc0458fe5542e5453"],["6f9d9b803ecf191637c73a4413dfa180fddf84a5947fbc9c606ed86c3fac3a7","7c80c68e603059ba69b8e2a30e45c4d47ea4dd2f5c281002d86890603a842160"],["3322d401243c4e2582a2147c104d6ecbf774d163db0f5e5313b7e0e742d0e6bd","56e70797e9664ef5bfb019bc4ddaf9b72805f63ea2873af624f3a2e96c28b2a0"],["85672c7d2de0b7da2bd1770d89665868741b3f9af7643397721d74d28134ab83","7c481b9b5b43b2eb6374049bfa62c2e5e77f17fcc5298f44c8e3094f790313a6"],["948bf809b1988a46b06c9f1919413b10f9226c60f668832ffd959af60c82a0a","53a562856dcb6646dc6b74c5d1c3418c6d4dff08c97cd2bed4cb7f88d8c8e589"],["6260ce7f461801c34f067ce0f02873a8f1b0e44dfc69752accecd819f38fd8e8","bc2da82b6fa5b571a7f09049776a1ef7ecd292238051c198c1a84e95b2b4ae17"],["e5037de0afc1d8d43d8348414bbf4103043ec8f575bfdc432953cc8d2037fa2d","4571534baa94d3b5f9f98d09fb990bddbd5f5b03ec481f10e0e5dc841d755bda"],["e06372b0f4a207adf5ea905e8f1771b4e7e8dbd1c6a6c5b725866a0ae4fce725","7a908974bce18cfe12a27bb2ad5a488cd7484a7787104870b27034f94eee31dd"],["213c7a715cd5d45358d0bbf9dc0ce02204b10bdde2a3f58540ad6908d0559754","4b6dad0b5ae462507013ad06245ba190bb4850f5f36a7eeddff2c27534b458f2"],["4e7c272a7af4b34e8dbb9352a5419a87e2838c70adc62cddf0cc3a3b08fbd53c","17749c766c9d0b18e16fd09f6def681b530b9614bff7dd33e0b3941817dcaae6"],["fea74e3dbe778b1b10f238ad61686aa5c76e3db2be43057632427e2840fb27b6","6e0568db9b0b13297cf674deccb6af93126b596b973f7b77701d3db7f23cb96f"],["76e64113f677cf0e10a2570d599968d31544e179b760432952c02a4417bdde39","c90ddf8dee4e95cf577066d70681f0d35e2a33d2b56d2032b4b1752d1901ac01"],["c738c56b03b2abe1e8281baa743f8f9a8f7cc643df26cbee3ab150242bcbb891","893fb578951ad2537f718f2eacbfbbbb82314eef7880cfe917e735d9699a84c3"],["d895626548b65b81e264c7637c972877d1d72e5f3a925014372e9f6588f6c14b","febfaa38f2bc7eae728ec60818c340eb03428d632bb067e179363ed75d7d991f"],["b8da94032a957518eb0f6433571e8761ceffc73693e84edd49150a564f676e03","2804dfa44805a1e4d7c99cc9762808b092cc584d95ff3b511488e4e74efdf6e7"],["e80fea14441fb33a7d8adab9475d7fab2019effb5156a792f1a11778e3c0df5d","eed1de7f638e00771e89768ca3ca94472d155e80af322ea9fcb4291b6ac9ec78"],["a301697bdfcd704313ba48e51d567543f2a182031efd6915ddc07bbcc4e16070","7370f91cfb67e4f5081809fa25d40f9b1735dbf7c0a11a130c0d1a041e177ea1"],["90ad85b389d6b936463f9d0512678de208cc330b11307fffab7ac63e3fb04ed4","e507a3620a38261affdcbd9427222b839aefabe1582894d991d4d48cb6ef150"],["8f68b9d2f63b5f339239c1ad981f162ee88c5678723ea3351b7b444c9ec4c0da","662a9f2dba063986de1d90c2b6be215dbbea2cfe95510bfdf23cbf79501fff82"],["e4f3fb0176af85d65ff99ff9198c36091f48e86503681e3e6686fd5053231e11","1e63633ad0ef4f1c1661a6d0ea02b7286cc7e74ec951d1c9822c38576feb73bc"],["8c00fa9b18ebf331eb961537a45a4266c7034f2f0d4e1d0716fb6eae20eae29e","efa47267fea521a1a9dc343a3736c974c2fadafa81e36c54e7d2a4c66702414b"],["e7a26ce69dd4829f3e10cec0a9e98ed3143d084f308b92c0997fddfc60cb3e41","2a758e300fa7984b471b006a1aafbb18d0a6b2c0420e83e20e8a9421cf2cfd51"],["b6459e0ee3662ec8d23540c223bcbdc571cbcb967d79424f3cf29eb3de6b80ef","67c876d06f3e06de1dadf16e5661db3c4b3ae6d48e35b2ff30bf0b61a71ba45"],["d68a80c8280bb840793234aa118f06231d6f1fc67e73c5a5deda0f5b496943e8","db8ba9fff4b586d00c4b1f9177b0e28b5b0e7b8f7845295a294c84266b133120"],["324aed7df65c804252dc0270907a30b09612aeb973449cea4095980fc28d3d5d","648a365774b61f2ff130c0c35aec1f4f19213b0c7e332843967224af96ab7c84"],["4df9c14919cde61f6d51dfdbe5fee5dceec4143ba8d1ca888e8bd373fd054c96","35ec51092d8728050974c23a1d85d4b5d506cdc288490192ebac06cad10d5d"],["9c3919a84a474870faed8a9c1cc66021523489054d7f0308cbfc99c8ac1f98cd","ddb84f0f4a4ddd57584f044bf260e641905326f76c64c8e6be7e5e03d4fc599d"],["6057170b1dd12fdf8de05f281d8e06bb91e1493a8b91d4cc5a21382120a959e5","9a1af0b26a6a4807add9a2daf71df262465152bc3ee24c65e899be932385a2a8"],["a576df8e23a08411421439a4518da31880cef0fba7d4df12b1a6973eecb94266","40a6bf20e76640b2c92b97afe58cd82c432e10a7f514d9f3ee8be11ae1b28ec8"],["7778a78c28dec3e30a05fe9629de8c38bb30d1f5cf9a3a208f763889be58ad71","34626d9ab5a5b22ff7098e12f2ff580087b38411ff24ac563b513fc1fd9f43ac"],["928955ee637a84463729fd30e7afd2ed5f96274e5ad7e5cb09eda9c06d903ac","c25621003d3f42a827b78a13093a95eeac3d26efa8a8d83fc5180e935bcd091f"],["85d0fef3ec6db109399064f3a0e3b2855645b4a907ad354527aae75163d82751","1f03648413a38c0be29d496e582cf5663e8751e96877331582c237a24eb1f962"],["ff2b0dce97eece97c1c9b6041798b85dfdfb6d8882da20308f5404824526087e","493d13fef524ba188af4c4dc54d07936c7b7ed6fb90e2ceb2c951e01f0c29907"],["827fbbe4b1e880ea9ed2b2e6301b212b57f1ee148cd6dd28780e5e2cf856e241","c60f9c923c727b0b71bef2c67d1d12687ff7a63186903166d605b68baec293ec"],["eaa649f21f51bdbae7be4ae34ce6e5217a58fdce7f47f9aa7f3b58fa2120e2b3","be3279ed5bbbb03ac69a80f89879aa5a01a6b965f13f7e59d47a5305ba5ad93d"],["e4a42d43c5cf169d9391df6decf42ee541b6d8f0c9a137401e23632dda34d24f","4d9f92e716d1c73526fc99ccfb8ad34ce886eedfa8d8e4f13a7f7131deba9414"],["1ec80fef360cbdd954160fadab352b6b92b53576a88fea4947173b9d4300bf19","aeefe93756b5340d2f3a4958a7abbf5e0146e77f6295a07b671cdc1cc107cefd"],["146a778c04670c2f91b00af4680dfa8bce3490717d58ba889ddb5928366642be","b318e0ec3354028add669827f9d4b2870aaa971d2f7e5ed1d0b297483d83efd0"],["fa50c0f61d22e5f07e3acebb1aa07b128d0012209a28b9776d76a8793180eef9","6b84c6922397eba9b72cd2872281a68a5e683293a57a213b38cd8d7d3f4f2811"],["da1d61d0ca721a11b1a5bf6b7d88e8421a288ab5d5bba5220e53d32b5f067ec2","8157f55a7c99306c79c0766161c91e2966a73899d279b48a655fba0f1ad836f1"],["a8e282ff0c9706907215ff98e8fd416615311de0446f1e062a73b0610d064e13","7f97355b8db81c09abfb7f3c5b2515888b679a3e50dd6bd6cef7c73111f4cc0c"],["174a53b9c9a285872d39e56e6913cab15d59b1fa512508c022f382de8319497c","ccc9dc37abfc9c1657b4155f2c47f9e6646b3a1d8cb9854383da13ac079afa73"],["959396981943785c3d3e57edf5018cdbe039e730e4918b3d884fdff09475b7ba","2e7e552888c331dd8ba0386a4b9cd6849c653f64c8709385e9b8abf87524f2fd"],["d2a63a50ae401e56d645a1153b109a8fcca0a43d561fba2dbb51340c9d82b151","e82d86fb6443fcb7565aee58b2948220a70f750af484ca52d4142174dcf89405"],["64587e2335471eb890ee7896d7cfdc866bacbdbd3839317b3436f9b45617e073","d99fcdd5bf6902e2ae96dd6447c299a185b90a39133aeab358299e5e9faf6589"],["8481bde0e4e4d885b3a546d3e549de042f0aa6cea250e7fd358d6c86dd45e458","38ee7b8cba5404dd84a25bf39cecb2ca900a79c42b262e556d64b1b59779057e"],["13464a57a78102aa62b6979ae817f4637ffcfed3c4b1ce30bcd6303f6caf666b","69be159004614580ef7e433453ccb0ca48f300a81d0942e13f495a907f6ecc27"],["bc4a9df5b713fe2e9aef430bcc1dc97a0cd9ccede2f28588cada3a0d2d83f366","d3a81ca6e785c06383937adf4b798caa6e8a9fbfa547b16d758d666581f33c1"],["8c28a97bf8298bc0d23d8c749452a32e694b65e30a9472a3954ab30fe5324caa","40a30463a3305193378fedf31f7cc0eb7ae784f0451cb9459e71dc73cbef9482"],["8ea9666139527a8c1dd94ce4f071fd23c8b350c5a4bb33748c4ba111faccae0","620efabbc8ee2782e24e7c0cfb95c5d735b783be9cf0f8e955af34a30e62b945"],["dd3625faef5ba06074669716bbd3788d89bdde815959968092f76cc4eb9a9787","7a188fa3520e30d461da2501045731ca941461982883395937f68d00c644a573"],["f710d79d9eb962297e4f6232b40e8f7feb2bc63814614d692c12de752408221e","ea98e67232d3b3295d3b535532115ccac8612c721851617526ae47a9c77bfc82"]]},naf:{wnd:7,points:[["f9308a019258c31049344f85f89d5229b531c845836f99b08601f113bce036f9","388f7b0f632de8140fe337e62a37f3566500a99934c2231b6cb9fd7584b8e672"],["2f8bde4d1a07209355b4a7250a5c5128e88b84bddc619ab7cba8d569b240efe4","d8ac222636e5e3d6d4dba9dda6c9c426f788271bab0d6840dca87d3aa6ac62d6"],["5cbdf0646e5db4eaa398f365f2ea7a0e3d419b7e0330e39ce92bddedcac4f9bc","6aebca40ba255960a3178d6d861a54dba813d0b813fde7b5a5082628087264da"],["acd484e2f0c7f65309ad178a9f559abde09796974c57e714c35f110dfc27ccbe","cc338921b0a7d9fd64380971763b61e9add888a4375f8e0f05cc262ac64f9c37"],["774ae7f858a9411e5ef4246b70c65aac5649980be5c17891bbec17895da008cb","d984a032eb6b5e190243dd56d7b7b365372db1e2dff9d6a8301d74c9c953c61b"],["f28773c2d975288bc7d1d205c3748651b075fbc6610e58cddeeddf8f19405aa8","ab0902e8d880a89758212eb65cdaf473a1a06da521fa91f29b5cb52db03ed81"],["d7924d4f7d43ea965a465ae3095ff41131e5946f3c85f79e44adbcf8e27e080e","581e2872a86c72a683842ec228cc6defea40af2bd896d3a5c504dc9ff6a26b58"],["defdea4cdb677750a420fee807eacf21eb9898ae79b9768766e4faa04a2d4a34","4211ab0694635168e997b0ead2a93daeced1f4a04a95c0f6cfb199f69e56eb77"],["2b4ea0a797a443d293ef5cff444f4979f06acfebd7e86d277475656138385b6c","85e89bc037945d93b343083b5a1c86131a01f60c50269763b570c854e5c09b7a"],["352bbf4a4cdd12564f93fa332ce333301d9ad40271f8107181340aef25be59d5","321eb4075348f534d59c18259dda3e1f4a1b3b2e71b1039c67bd3d8bcf81998c"],["2fa2104d6b38d11b0230010559879124e42ab8dfeff5ff29dc9cdadd4ecacc3f","2de1068295dd865b64569335bd5dd80181d70ecfc882648423ba76b532b7d67"],["9248279b09b4d68dab21a9b066edda83263c3d84e09572e269ca0cd7f5453714","73016f7bf234aade5d1aa71bdea2b1ff3fc0de2a887912ffe54a32ce97cb3402"],["daed4f2be3a8bf278e70132fb0beb7522f570e144bf615c07e996d443dee8729","a69dce4a7d6c98e8d4a1aca87ef8d7003f83c230f3afa726ab40e52290be1c55"],["c44d12c7065d812e8acf28d7cbb19f9011ecd9e9fdf281b0e6a3b5e87d22e7db","2119a460ce326cdc76c45926c982fdac0e106e861edf61c5a039063f0e0e6482"],["6a245bf6dc698504c89a20cfded60853152b695336c28063b61c65cbd269e6b4","e022cf42c2bd4a708b3f5126f16a24ad8b33ba48d0423b6efd5e6348100d8a82"],["1697ffa6fd9de627c077e3d2fe541084ce13300b0bec1146f95ae57f0d0bd6a5","b9c398f186806f5d27561506e4557433a2cf15009e498ae7adee9d63d01b2396"],["605bdb019981718b986d0f07e834cb0d9deb8360ffb7f61df982345ef27a7479","2972d2de4f8d20681a78d93ec96fe23c26bfae84fb14db43b01e1e9056b8c49"],["62d14dab4150bf497402fdc45a215e10dcb01c354959b10cfe31c7e9d87ff33d","80fc06bd8cc5b01098088a1950eed0db01aa132967ab472235f5642483b25eaf"],["80c60ad0040f27dade5b4b06c408e56b2c50e9f56b9b8b425e555c2f86308b6f","1c38303f1cc5c30f26e66bad7fe72f70a65eed4cbe7024eb1aa01f56430bd57a"],["7a9375ad6167ad54aa74c6348cc54d344cc5dc9487d847049d5eabb0fa03c8fb","d0e3fa9eca8726909559e0d79269046bdc59ea10c70ce2b02d499ec224dc7f7"],["d528ecd9b696b54c907a9ed045447a79bb408ec39b68df504bb51f459bc3ffc9","eecf41253136e5f99966f21881fd656ebc4345405c520dbc063465b521409933"],["49370a4b5f43412ea25f514e8ecdad05266115e4a7ecb1387231808f8b45963","758f3f41afd6ed428b3081b0512fd62a54c3f3afbb5b6764b653052a12949c9a"],["77f230936ee88cbbd73df930d64702ef881d811e0e1498e2f1c13eb1fc345d74","958ef42a7886b6400a08266e9ba1b37896c95330d97077cbbe8eb3c7671c60d6"],["f2dac991cc4ce4b9ea44887e5c7c0bce58c80074ab9d4dbaeb28531b7739f530","e0dedc9b3b2f8dad4da1f32dec2531df9eb5fbeb0598e4fd1a117dba703a3c37"],["463b3d9f662621fb1b4be8fbbe2520125a216cdfc9dae3debcba4850c690d45b","5ed430d78c296c3543114306dd8622d7c622e27c970a1de31cb377b01af7307e"],["f16f804244e46e2a09232d4aff3b59976b98fac14328a2d1a32496b49998f247","cedabd9b82203f7e13d206fcdf4e33d92a6c53c26e5cce26d6579962c4e31df6"],["caf754272dc84563b0352b7a14311af55d245315ace27c65369e15f7151d41d1","cb474660ef35f5f2a41b643fa5e460575f4fa9b7962232a5c32f908318a04476"],["2600ca4b282cb986f85d0f1709979d8b44a09c07cb86d7c124497bc86f082120","4119b88753c15bd6a693b03fcddbb45d5ac6be74ab5f0ef44b0be9475a7e4b40"],["7635ca72d7e8432c338ec53cd12220bc01c48685e24f7dc8c602a7746998e435","91b649609489d613d1d5e590f78e6d74ecfc061d57048bad9e76f302c5b9c61"],["754e3239f325570cdbbf4a87deee8a66b7f2b33479d468fbc1a50743bf56cc18","673fb86e5bda30fb3cd0ed304ea49a023ee33d0197a695d0c5d98093c536683"],["e3e6bd1071a1e96aff57859c82d570f0330800661d1c952f9fe2694691d9b9e8","59c9e0bba394e76f40c0aa58379a3cb6a5a2283993e90c4167002af4920e37f5"],["186b483d056a033826ae73d88f732985c4ccb1f32ba35f4b4cc47fdcf04aa6eb","3b952d32c67cf77e2e17446e204180ab21fb8090895138b4a4a797f86e80888b"],["df9d70a6b9876ce544c98561f4be4f725442e6d2b737d9c91a8321724ce0963f","55eb2dafd84d6ccd5f862b785dc39d4ab157222720ef9da217b8c45cf2ba2417"],["5edd5cc23c51e87a497ca815d5dce0f8ab52554f849ed8995de64c5f34ce7143","efae9c8dbc14130661e8cec030c89ad0c13c66c0d17a2905cdc706ab7399a868"],["290798c2b6476830da12fe02287e9e777aa3fba1c355b17a722d362f84614fba","e38da76dcd440621988d00bcf79af25d5b29c094db2a23146d003afd41943e7a"],["af3c423a95d9f5b3054754efa150ac39cd29552fe360257362dfdecef4053b45","f98a3fd831eb2b749a93b0e6f35cfb40c8cd5aa667a15581bc2feded498fd9c6"],["766dbb24d134e745cccaa28c99bf274906bb66b26dcf98df8d2fed50d884249a","744b1152eacbe5e38dcc887980da38b897584a65fa06cedd2c924f97cbac5996"],["59dbf46f8c94759ba21277c33784f41645f7b44f6c596a58ce92e666191abe3e","c534ad44175fbc300f4ea6ce648309a042ce739a7919798cd85e216c4a307f6e"],["f13ada95103c4537305e691e74e9a4a8dd647e711a95e73cb62dc6018cfd87b8","e13817b44ee14de663bf4bc808341f326949e21a6a75c2570778419bdaf5733d"],["7754b4fa0e8aced06d4167a2c59cca4cda1869c06ebadfb6488550015a88522c","30e93e864e669d82224b967c3020b8fa8d1e4e350b6cbcc537a48b57841163a2"],["948dcadf5990e048aa3874d46abef9d701858f95de8041d2a6828c99e2262519","e491a42537f6e597d5d28a3224b1bc25df9154efbd2ef1d2cbba2cae5347d57e"],["7962414450c76c1689c7b48f8202ec37fb224cf5ac0bfa1570328a8a3d7c77ab","100b610ec4ffb4760d5c1fc133ef6f6b12507a051f04ac5760afa5b29db83437"],["3514087834964b54b15b160644d915485a16977225b8847bb0dd085137ec47ca","ef0afbb2056205448e1652c48e8127fc6039e77c15c2378b7e7d15a0de293311"],["d3cc30ad6b483e4bc79ce2c9dd8bc54993e947eb8df787b442943d3f7b527eaf","8b378a22d827278d89c5e9be8f9508ae3c2ad46290358630afb34db04eede0a4"],["1624d84780732860ce1c78fcbfefe08b2b29823db913f6493975ba0ff4847610","68651cf9b6da903e0914448c6cd9d4ca896878f5282be4c8cc06e2a404078575"],["733ce80da955a8a26902c95633e62a985192474b5af207da6df7b4fd5fc61cd4","f5435a2bd2badf7d485a4d8b8db9fcce3e1ef8e0201e4578c54673bc1dc5ea1d"],["15d9441254945064cf1a1c33bbd3b49f8966c5092171e699ef258dfab81c045c","d56eb30b69463e7234f5137b73b84177434800bacebfc685fc37bbe9efe4070d"],["a1d0fcf2ec9de675b612136e5ce70d271c21417c9d2b8aaaac138599d0717940","edd77f50bcb5a3cab2e90737309667f2641462a54070f3d519212d39c197a629"],["e22fbe15c0af8ccc5780c0735f84dbe9a790badee8245c06c7ca37331cb36980","a855babad5cd60c88b430a69f53a1a7a38289154964799be43d06d77d31da06"],["311091dd9860e8e20ee13473c1155f5f69635e394704eaa74009452246cfa9b3","66db656f87d1f04fffd1f04788c06830871ec5a64feee685bd80f0b1286d8374"],["34c1fd04d301be89b31c0442d3e6ac24883928b45a9340781867d4232ec2dbdf","9414685e97b1b5954bd46f730174136d57f1ceeb487443dc5321857ba73abee"],["f219ea5d6b54701c1c14de5b557eb42a8d13f3abbcd08affcc2a5e6b049b8d63","4cb95957e83d40b0f73af4544cccf6b1f4b08d3c07b27fb8d8c2962a400766d1"],["d7b8740f74a8fbaab1f683db8f45de26543a5490bca627087236912469a0b448","fa77968128d9c92ee1010f337ad4717eff15db5ed3c049b3411e0315eaa4593b"],["32d31c222f8f6f0ef86f7c98d3a3335ead5bcd32abdd94289fe4d3091aa824bf","5f3032f5892156e39ccd3d7915b9e1da2e6dac9e6f26e961118d14b8462e1661"],["7461f371914ab32671045a155d9831ea8793d77cd59592c4340f86cbc18347b5","8ec0ba238b96bec0cbdddcae0aa442542eee1ff50c986ea6b39847b3cc092ff6"],["ee079adb1df1860074356a25aa38206a6d716b2c3e67453d287698bad7b2b2d6","8dc2412aafe3be5c4c5f37e0ecc5f9f6a446989af04c4e25ebaac479ec1c8c1e"],["16ec93e447ec83f0467b18302ee620f7e65de331874c9dc72bfd8616ba9da6b5","5e4631150e62fb40d0e8c2a7ca5804a39d58186a50e497139626778e25b0674d"],["eaa5f980c245f6f038978290afa70b6bd8855897f98b6aa485b96065d537bd99","f65f5d3e292c2e0819a528391c994624d784869d7e6ea67fb18041024edc07dc"],["78c9407544ac132692ee1910a02439958ae04877151342ea96c4b6b35a49f51","f3e0319169eb9b85d5404795539a5e68fa1fbd583c064d2462b675f194a3ddb4"],["494f4be219a1a77016dcd838431aea0001cdc8ae7a6fc688726578d9702857a5","42242a969283a5f339ba7f075e36ba2af925ce30d767ed6e55f4b031880d562c"],["a598a8030da6d86c6bc7f2f5144ea549d28211ea58faa70ebf4c1e665c1fe9b5","204b5d6f84822c307e4b4a7140737aec23fc63b65b35f86a10026dbd2d864e6b"],["c41916365abb2b5d09192f5f2dbeafec208f020f12570a184dbadc3e58595997","4f14351d0087efa49d245b328984989d5caf9450f34bfc0ed16e96b58fa9913"],["841d6063a586fa475a724604da03bc5b92a2e0d2e0a36acfe4c73a5514742881","73867f59c0659e81904f9a1c7543698e62562d6744c169ce7a36de01a8d6154"],["5e95bb399a6971d376026947f89bde2f282b33810928be4ded112ac4d70e20d5","39f23f366809085beebfc71181313775a99c9aed7d8ba38b161384c746012865"],["36e4641a53948fd476c39f8a99fd974e5ec07564b5315d8bf99471bca0ef2f66","d2424b1b1abe4eb8164227b085c9aa9456ea13493fd563e06fd51cf5694c78fc"],["336581ea7bfbbb290c191a2f507a41cf5643842170e914faeab27c2c579f726","ead12168595fe1be99252129b6e56b3391f7ab1410cd1e0ef3dcdcabd2fda224"],["8ab89816dadfd6b6a1f2634fcf00ec8403781025ed6890c4849742706bd43ede","6fdcef09f2f6d0a044e654aef624136f503d459c3e89845858a47a9129cdd24e"],["1e33f1a746c9c5778133344d9299fcaa20b0938e8acff2544bb40284b8c5fb94","60660257dd11b3aa9c8ed618d24edff2306d320f1d03010e33a7d2057f3b3b6"],["85b7c1dcb3cec1b7ee7f30ded79dd20a0ed1f4cc18cbcfcfa410361fd8f08f31","3d98a9cdd026dd43f39048f25a8847f4fcafad1895d7a633c6fed3c35e999511"],["29df9fbd8d9e46509275f4b125d6d45d7fbe9a3b878a7af872a2800661ac5f51","b4c4fe99c775a606e2d8862179139ffda61dc861c019e55cd2876eb2a27d84b"],["a0b1cae06b0a847a3fea6e671aaf8adfdfe58ca2f768105c8082b2e449fce252","ae434102edde0958ec4b19d917a6a28e6b72da1834aff0e650f049503a296cf2"],["4e8ceafb9b3e9a136dc7ff67e840295b499dfb3b2133e4ba113f2e4c0e121e5","cf2174118c8b6d7a4b48f6d534ce5c79422c086a63460502b827ce62a326683c"],["d24a44e047e19b6f5afb81c7ca2f69080a5076689a010919f42725c2b789a33b","6fb8d5591b466f8fc63db50f1c0f1c69013f996887b8244d2cdec417afea8fa3"],["ea01606a7a6c9cdd249fdfcfacb99584001edd28abbab77b5104e98e8e3b35d4","322af4908c7312b0cfbfe369f7a7b3cdb7d4494bc2823700cfd652188a3ea98d"],["af8addbf2b661c8a6c6328655eb96651252007d8c5ea31be4ad196de8ce2131f","6749e67c029b85f52a034eafd096836b2520818680e26ac8f3dfbcdb71749700"],["e3ae1974566ca06cc516d47e0fb165a674a3dabcfca15e722f0e3450f45889","2aeabe7e4531510116217f07bf4d07300de97e4874f81f533420a72eeb0bd6a4"],["591ee355313d99721cf6993ffed1e3e301993ff3ed258802075ea8ced397e246","b0ea558a113c30bea60fc4775460c7901ff0b053d25ca2bdeee98f1a4be5d196"],["11396d55fda54c49f19aa97318d8da61fa8584e47b084945077cf03255b52984","998c74a8cd45ac01289d5833a7beb4744ff536b01b257be4c5767bea93ea57a4"],["3c5d2a1ba39c5a1790000738c9e0c40b8dcdfd5468754b6405540157e017aa7a","b2284279995a34e2f9d4de7396fc18b80f9b8b9fdd270f6661f79ca4c81bd257"],["cc8704b8a60a0defa3a99a7299f2e9c3fbc395afb04ac078425ef8a1793cc030","bdd46039feed17881d1e0862db347f8cf395b74fc4bcdc4e940b74e3ac1f1b13"],["c533e4f7ea8555aacd9777ac5cad29b97dd4defccc53ee7ea204119b2889b197","6f0a256bc5efdf429a2fb6242f1a43a2d9b925bb4a4b3a26bb8e0f45eb596096"],["c14f8f2ccb27d6f109f6d08d03cc96a69ba8c34eec07bbcf566d48e33da6593","c359d6923bb398f7fd4473e16fe1c28475b740dd098075e6c0e8649113dc3a38"],["a6cbc3046bc6a450bac24789fa17115a4c9739ed75f8f21ce441f72e0b90e6ef","21ae7f4680e889bb130619e2c0f95a360ceb573c70603139862afd617fa9b9f"],["347d6d9a02c48927ebfb86c1359b1caf130a3c0267d11ce6344b39f99d43cc38","60ea7f61a353524d1c987f6ecec92f086d565ab687870cb12689ff1e31c74448"],["da6545d2181db8d983f7dcb375ef5866d47c67b1bf31c8cf855ef7437b72656a","49b96715ab6878a79e78f07ce5680c5d6673051b4935bd897fea824b77dc208a"],["c40747cc9d012cb1a13b8148309c6de7ec25d6945d657146b9d5994b8feb1111","5ca560753be2a12fc6de6caf2cb489565db936156b9514e1bb5e83037e0fa2d4"],["4e42c8ec82c99798ccf3a610be870e78338c7f713348bd34c8203ef4037f3502","7571d74ee5e0fb92a7a8b33a07783341a5492144cc54bcc40a94473693606437"],["3775ab7089bc6af823aba2e1af70b236d251cadb0c86743287522a1b3b0dedea","be52d107bcfa09d8bcb9736a828cfa7fac8db17bf7a76a2c42ad961409018cf7"],["cee31cbf7e34ec379d94fb814d3d775ad954595d1314ba8846959e3e82f74e26","8fd64a14c06b589c26b947ae2bcf6bfa0149ef0be14ed4d80f448a01c43b1c6d"],["b4f9eaea09b6917619f6ea6a4eb5464efddb58fd45b1ebefcdc1a01d08b47986","39e5c9925b5a54b07433a4f18c61726f8bb131c012ca542eb24a8ac07200682a"],["d4263dfc3d2df923a0179a48966d30ce84e2515afc3dccc1b77907792ebcc60e","62dfaf07a0f78feb30e30d6295853ce189e127760ad6cf7fae164e122a208d54"],["48457524820fa65a4f8d35eb6930857c0032acc0a4a2de422233eeda897612c4","25a748ab367979d98733c38a1fa1c2e7dc6cc07db2d60a9ae7a76aaa49bd0f77"],["dfeeef1881101f2cb11644f3a2afdfc2045e19919152923f367a1767c11cceda","ecfb7056cf1de042f9420bab396793c0c390bde74b4bbdff16a83ae09a9a7517"],["6d7ef6b17543f8373c573f44e1f389835d89bcbc6062ced36c82df83b8fae859","cd450ec335438986dfefa10c57fea9bcc521a0959b2d80bbf74b190dca712d10"],["e75605d59102a5a2684500d3b991f2e3f3c88b93225547035af25af66e04541f","f5c54754a8f71ee540b9b48728473e314f729ac5308b06938360990e2bfad125"],["eb98660f4c4dfaa06a2be453d5020bc99a0c2e60abe388457dd43fefb1ed620c","6cb9a8876d9cb8520609af3add26cd20a0a7cd8a9411131ce85f44100099223e"],["13e87b027d8514d35939f2e6892b19922154596941888336dc3563e3b8dba942","fef5a3c68059a6dec5d624114bf1e91aac2b9da568d6abeb2570d55646b8adf1"],["ee163026e9fd6fe017c38f06a5be6fc125424b371ce2708e7bf4491691e5764a","1acb250f255dd61c43d94ccc670d0f58f49ae3fa15b96623e5430da0ad6c62b2"],["b268f5ef9ad51e4d78de3a750c2dc89b1e626d43505867999932e5db33af3d80","5f310d4b3c99b9ebb19f77d41c1dee018cf0d34fd4191614003e945a1216e423"],["ff07f3118a9df035e9fad85eb6c7bfe42b02f01ca99ceea3bf7ffdba93c4750d","438136d603e858a3a5c440c38eccbaddc1d2942114e2eddd4740d098ced1f0d8"],["8d8b9855c7c052a34146fd20ffb658bea4b9f69e0d825ebec16e8c3ce2b526a1","cdb559eedc2d79f926baf44fb84ea4d44bcf50fee51d7ceb30e2e7f463036758"],["52db0b5384dfbf05bfa9d472d7ae26dfe4b851ceca91b1eba54263180da32b63","c3b997d050ee5d423ebaf66a6db9f57b3180c902875679de924b69d84a7b375"],["e62f9490d3d51da6395efd24e80919cc7d0f29c3f3fa48c6fff543becbd43352","6d89ad7ba4876b0b22c2ca280c682862f342c8591f1daf5170e07bfd9ccafa7d"],["7f30ea2476b399b4957509c88f77d0191afa2ff5cb7b14fd6d8e7d65aaab1193","ca5ef7d4b231c94c3b15389a5f6311e9daff7bb67b103e9880ef4bff637acaec"],["5098ff1e1d9f14fb46a210fada6c903fef0fb7b4a1dd1d9ac60a0361800b7a00","9731141d81fc8f8084d37c6e7542006b3ee1b40d60dfe5362a5b132fd17ddc0"],["32b78c7de9ee512a72895be6b9cbefa6e2f3c4ccce445c96b9f2c81e2778ad58","ee1849f513df71e32efc3896ee28260c73bb80547ae2275ba497237794c8753c"],["e2cb74fddc8e9fbcd076eef2a7c72b0ce37d50f08269dfc074b581550547a4f7","d3aa2ed71c9dd2247a62df062736eb0baddea9e36122d2be8641abcb005cc4a4"],["8438447566d4d7bedadc299496ab357426009a35f235cb141be0d99cd10ae3a8","c4e1020916980a4da5d01ac5e6ad330734ef0d7906631c4f2390426b2edd791f"],["4162d488b89402039b584c6fc6c308870587d9c46f660b878ab65c82c711d67e","67163e903236289f776f22c25fb8a3afc1732f2b84b4e95dbda47ae5a0852649"],["3fad3fa84caf0f34f0f89bfd2dcf54fc175d767aec3e50684f3ba4a4bf5f683d","cd1bc7cb6cc407bb2f0ca647c718a730cf71872e7d0d2a53fa20efcdfe61826"],["674f2600a3007a00568c1a7ce05d0816c1fb84bf1370798f1c69532faeb1a86b","299d21f9413f33b3edf43b257004580b70db57da0b182259e09eecc69e0d38a5"],["d32f4da54ade74abb81b815ad1fb3b263d82d6c692714bcff87d29bd5ee9f08f","f9429e738b8e53b968e99016c059707782e14f4535359d582fc416910b3eea87"],["30e4e670435385556e593657135845d36fbb6931f72b08cb1ed954f1e3ce3ff6","462f9bce619898638499350113bbc9b10a878d35da70740dc695a559eb88db7b"],["be2062003c51cc3004682904330e4dee7f3dcd10b01e580bf1971b04d4cad297","62188bc49d61e5428573d48a74e1c655b1c61090905682a0d5558ed72dccb9bc"],["93144423ace3451ed29e0fb9ac2af211cb6e84a601df5993c419859fff5df04a","7c10dfb164c3425f5c71a3f9d7992038f1065224f72bb9d1d902a6d13037b47c"],["b015f8044f5fcbdcf21ca26d6c34fb8197829205c7b7d2a7cb66418c157b112c","ab8c1e086d04e813744a655b2df8d5f83b3cdc6faa3088c1d3aea1454e3a1d5f"],["d5e9e1da649d97d89e4868117a465a3a4f8a18de57a140d36b3f2af341a21b52","4cb04437f391ed73111a13cc1d4dd0db1693465c2240480d8955e8592f27447a"],["d3ae41047dd7ca065dbf8ed77b992439983005cd72e16d6f996a5316d36966bb","bd1aeb21ad22ebb22a10f0303417c6d964f8cdd7df0aca614b10dc14d125ac46"],["463e2763d885f958fc66cdd22800f0a487197d0a82e377b49f80af87c897b065","bfefacdb0e5d0fd7df3a311a94de062b26b80c61fbc97508b79992671ef7ca7f"],["7985fdfd127c0567c6f53ec1bb63ec3158e597c40bfe747c83cddfc910641917","603c12daf3d9862ef2b25fe1de289aed24ed291e0ec6708703a5bd567f32ed03"],["74a1ad6b5f76e39db2dd249410eac7f99e74c59cb83d2d0ed5ff1543da7703e9","cc6157ef18c9c63cd6193d83631bbea0093e0968942e8c33d5737fd790e0db08"],["30682a50703375f602d416664ba19b7fc9bab42c72747463a71d0896b22f6da3","553e04f6b018b4fa6c8f39e7f311d3176290d0e0f19ca73f17714d9977a22ff8"],["9e2158f0d7c0d5f26c3791efefa79597654e7a2b2464f52b1ee6c1347769ef57","712fcdd1b9053f09003a3481fa7762e9ffd7c8ef35a38509e2fbf2629008373"],["176e26989a43c9cfeba4029c202538c28172e566e3c4fce7322857f3be327d66","ed8cc9d04b29eb877d270b4878dc43c19aefd31f4eee09ee7b47834c1fa4b1c3"],["75d46efea3771e6e68abb89a13ad747ecf1892393dfc4f1b7004788c50374da8","9852390a99507679fd0b86fd2b39a868d7efc22151346e1a3ca4726586a6bed8"],["809a20c67d64900ffb698c4c825f6d5f2310fb0451c869345b7319f645605721","9e994980d9917e22b76b061927fa04143d096ccc54963e6a5ebfa5f3f8e286c1"],["1b38903a43f7f114ed4500b4eac7083fdefece1cf29c63528d563446f972c180","4036edc931a60ae889353f77fd53de4a2708b26b6f5da72ad3394119daf408f9"]]}}},function(e,t,r){"use strict";function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var i=r(2),o=r(312),a=r(13),s=r(74),A=r(71),c=a.assert,u=r(313),f=r(314);function h(e){if(!(this instanceof h))return new h(e);"string"==typeof e&&(c(Object.prototype.hasOwnProperty.call(s,e),"Unknown curve "+e),e=s[e]),e instanceof s.PresetCurve&&(e={curve:e}),this.curve=e.curve.curve,this.n=this.curve.n,this.nh=this.n.ushrn(1),this.g=this.curve.g,this.g=e.curve.g,this.g.precompute(e.curve.n.bitLength()+1),this.hash=e.hash||e.curve.hash}e.exports=h,h.prototype.keyPair=function(e){return new u(this,e)},h.prototype.keyFromPrivate=function(e,t){return u.fromPrivate(this,e,t)},h.prototype.keyFromPublic=function(e,t){return u.fromPublic(this,e,t)},h.prototype.genKeyPair=function(e){e||(e={});for(var t=new o({hash:this.hash,pers:e.pers,persEnc:e.persEnc||"utf8",entropy:e.entropy||A(this.hash.hmacStrength),entropyEnc:e.entropy&&e.entropyEnc||"utf8",nonce:this.n.toArray()}),r=this.n.byteLength(),n=this.n.sub(new i(2));;){var a=new i(t.generate(r));if(!(a.cmp(n)>0))return a.iaddn(1),this.keyFromPrivate(a)}},h.prototype._truncateToN=function(e,t){var r=8*e.byteLength()-this.n.bitLength();return r>0&&(e=e.ushrn(r)),!t&&e.cmp(this.n)>=0?e.sub(this.n):e},h.prototype.sign=function(e,t,r,a){"object"===n(r)&&(a=r,r=null),a||(a={}),t=this.keyFromPrivate(t,r),e=this._truncateToN(new i(e,16));for(var s=this.n.byteLength(),A=t.getPrivate().toArray("be",s),c=e.toArray("be",s),u=new o({hash:this.hash,entropy:A,nonce:c,pers:a.pers,persEnc:a.persEnc||"utf8"}),h=this.n.sub(new i(1)),l=0;;l++){var g=a.k?a.k(l):new i(u.generate(this.n.byteLength()));if(!((g=this._truncateToN(g,!0)).cmpn(1)<=0||g.cmp(h)>=0)){var d=this.g.mul(g);if(!d.isInfinity()){var p=d.getX(),I=p.umod(this.n);if(0!==I.cmpn(0)){var y=g.invm(this.n).mul(I.mul(t.getPrivate()).iadd(e));if(0!==(y=y.umod(this.n)).cmpn(0)){var b=(d.getY().isOdd()?1:0)|(0!==p.cmp(I)?2:0);return a.canonical&&y.cmp(this.nh)>0&&(y=this.n.sub(y),b^=1),new f({r:I,s:y,recoveryParam:b})}}}}}},h.prototype.verify=function(e,t,r,n){e=this._truncateToN(new i(e,16)),r=this.keyFromPublic(r,n);var o=(t=new f(t,"hex")).r,a=t.s;if(o.cmpn(1)<0||o.cmp(this.n)>=0)return!1;if(a.cmpn(1)<0||a.cmp(this.n)>=0)return!1;var s,A=a.invm(this.n),c=A.mul(e).umod(this.n),u=A.mul(o).umod(this.n);return this.curve._maxwellTrick?!(s=this.g.jmulAdd(c,r.getPublic(),u)).isInfinity()&&s.eqXToP(o):!(s=this.g.mulAdd(c,r.getPublic(),u)).isInfinity()&&0===s.getX().umod(this.n).cmp(o)},h.prototype.recoverPubKey=function(e,t,r,n){c((3&r)===r,"The recovery param is more than two bits"),t=new f(t,n);var o=this.n,a=new i(e),s=t.r,A=t.s,u=1&r,h=r>>1;if(s.cmp(this.curve.p.umod(this.curve.n))>=0&&h)throw new Error("Unable to find sencond key candinate");s=h?this.curve.pointFromX(s.add(this.curve.n),u):this.curve.pointFromX(s,u);var l=t.r.invm(o),g=o.sub(a).mul(l).umod(o),d=A.mul(l).umod(o);return this.g.mulAdd(g,s,d)},h.prototype.getKeyRecoveryParam=function(e,t,r,n){if(null!==(t=new f(t,n)).recoveryParam)return t.recoveryParam;for(var i=0;i<4;i++){var o;try{o=this.recoverPubKey(e,t,i)}catch(e){continue}if(o.eq(r))return i}throw new Error("Unable to find valid recovery factor")}},function(e,t,r){"use strict";var n=r(7),i=r(151),o=r(12);function a(e){if(!(this instanceof a))return new a(e);this.hash=e.hash,this.predResist=!!e.predResist,this.outLen=this.hash.outSize,this.minEntropy=e.minEntropy||this.hash.hmacStrength,this._reseed=null,this.reseedInterval=null,this.K=null,this.V=null;var t=i.toArray(e.entropy,e.entropyEnc||"hex"),r=i.toArray(e.nonce,e.nonceEnc||"hex"),n=i.toArray(e.pers,e.persEnc||"hex");o(t.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._init(t,r,n)}e.exports=a,a.prototype._init=function(e,t,r){var n=e.concat(t).concat(r);this.K=new Array(this.outLen/8),this.V=new Array(this.outLen/8);for(var i=0;i<this.V.length;i++)this.K[i]=0,this.V[i]=1;this._update(n),this._reseed=1,this.reseedInterval=281474976710656},a.prototype._hmac=function(){return new n.hmac(this.hash,this.K)},a.prototype._update=function(e){var t=this._hmac().update(this.V).update([0]);e&&(t=t.update(e)),this.K=t.digest(),this.V=this._hmac().update(this.V).digest(),e&&(this.K=this._hmac().update(this.V).update([1]).update(e).digest(),this.V=this._hmac().update(this.V).digest())},a.prototype.reseed=function(e,t,r,n){"string"!=typeof t&&(n=r,r=t,t=null),e=i.toArray(e,t),r=i.toArray(r,n),o(e.length>=this.minEntropy/8,"Not enough entropy. Minimum is: "+this.minEntropy+" bits"),this._update(e.concat(r||[])),this._reseed=1},a.prototype.generate=function(e,t,r,n){if(this._reseed>this.reseedInterval)throw new Error("Reseed is required");"string"!=typeof t&&(n=r,r=t,t=null),r&&(r=i.toArray(r,n||"hex"),this._update(r));for(var o=[];o.length<e;)this.V=this._hmac().update(this.V).digest(),o=o.concat(this.V);var a=o.slice(0,e);return this._update(r),this._reseed++,i.encode(a,t)}},function(e,t,r){"use strict";var n=r(2),i=r(13).assert;function o(e,t){this.ec=e,this.priv=null,this.pub=null,t.priv&&this._importPrivate(t.priv,t.privEnc),t.pub&&this._importPublic(t.pub,t.pubEnc)}e.exports=o,o.fromPublic=function(e,t,r){return t instanceof o?t:new o(e,{pub:t,pubEnc:r})},o.fromPrivate=function(e,t,r){return t instanceof o?t:new o(e,{priv:t,privEnc:r})},o.prototype.validate=function(){var e=this.getPublic();return e.isInfinity()?{result:!1,reason:"Invalid public key"}:e.validate()?e.mul(this.ec.curve.n).isInfinity()?{result:!0,reason:null}:{result:!1,reason:"Public key * N != O"}:{result:!1,reason:"Public key is not a point"}},o.prototype.getPublic=function(e,t){return"string"==typeof e&&(t=e,e=null),this.pub||(this.pub=this.ec.g.mul(this.priv)),t?this.pub.encode(t,e):this.pub},o.prototype.getPrivate=function(e){return"hex"===e?this.priv.toString(16,2):this.priv},o.prototype._importPrivate=function(e,t){this.priv=new n(e,t||16),this.priv=this.priv.umod(this.ec.curve.n)},o.prototype._importPublic=function(e,t){if(e.x||e.y)return"mont"===this.ec.curve.type?i(e.x,"Need x coordinate"):"short"!==this.ec.curve.type&&"edwards"!==this.ec.curve.type||i(e.x&&e.y,"Need both x and y coordinate"),void(this.pub=this.ec.curve.point(e.x,e.y));this.pub=this.ec.curve.decodePoint(e,t)},o.prototype.derive=function(e){return e.validate()||i(e.validate(),"public point not validated"),e.mul(this.priv).getX()},o.prototype.sign=function(e,t,r){return this.ec.sign(e,this,t,r)},o.prototype.verify=function(e,t){return this.ec.verify(e,t,this)},o.prototype.inspect=function(){return"<Key priv: "+(this.priv&&this.priv.toString(16,2))+" pub: "+(this.pub&&this.pub.inspect())+" >"}},function(e,t,r){"use strict";var n=r(2),i=r(13),o=i.assert;function a(e,t){if(e instanceof a)return e;this._importDER(e,t)||(o(e.r&&e.s,"Signature without r or s"),this.r=new n(e.r,16),this.s=new n(e.s,16),void 0===e.recoveryParam?this.recoveryParam=null:this.recoveryParam=e.recoveryParam)}function s(){this.place=0}function A(e,t){var r=e[t.place++];if(!(128&r))return r;var n=15&r;if(0===n||n>4)return!1;for(var i=0,o=0,a=t.place;o<n;o++,a++)i<<=8,i|=e[a],i>>>=0;return!(i<=127)&&(t.place=a,i)}function c(e){for(var t=0,r=e.length-1;!e[t]&&!(128&e[t+1])&&t<r;)t++;return 0===t?e:e.slice(t)}function u(e,t){if(t<128)e.push(t);else{var r=1+(Math.log(t)/Math.LN2>>>3);for(e.push(128|r);--r;)e.push(t>>>(r<<3)&255);e.push(t)}}e.exports=a,a.prototype._importDER=function(e,t){e=i.toArray(e,t);var r=new s;if(48!==e[r.place++])return!1;var o=A(e,r);if(!1===o)return!1;if(o+r.place!==e.length)return!1;if(2!==e[r.place++])return!1;var a=A(e,r);if(!1===a)return!1;var c=e.slice(r.place,a+r.place);if(r.place+=a,2!==e[r.place++])return!1;var u=A(e,r);if(!1===u)return!1;if(e.length!==u+r.place)return!1;var f=e.slice(r.place,u+r.place);if(0===c[0]){if(!(128&c[1]))return!1;c=c.slice(1)}if(0===f[0]){if(!(128&f[1]))return!1;f=f.slice(1)}return this.r=new n(c),this.s=new n(f),this.recoveryParam=null,!0},a.prototype.toDER=function(e){var t=this.r.toArray(),r=this.s.toArray();for(128&t[0]&&(t=[0].concat(t)),128&r[0]&&(r=[0].concat(r)),t=c(t),r=c(r);!(r[0]||128&r[1]);)r=r.slice(1);var n=[2];u(n,t.length),(n=n.concat(t)).push(2),u(n,r.length);var o=n.concat(r),a=[48];return u(a,o.length),a=a.concat(o),i.encode(a,e)}},function(e,t,r){"use strict";var n=r(7),i=r(74),o=r(13),a=o.assert,s=o.parseBytes,A=r(316),c=r(317);function u(e){if(a("ed25519"===e,"only tested with ed25519 so far"),!(this instanceof u))return new u(e);e=i[e].curve,this.curve=e,this.g=e.g,this.g.precompute(e.n.bitLength()+1),this.pointClass=e.point().constructor,this.encodingLength=Math.ceil(e.n.bitLength()/8),this.hash=n.sha512}e.exports=u,u.prototype.sign=function(e,t){e=s(e);var r=this.keyFromSecret(t),n=this.hashInt(r.messagePrefix(),e),i=this.g.mul(n),o=this.encodePoint(i),a=this.hashInt(o,r.pubBytes(),e).mul(r.priv()),A=n.add(a).umod(this.curve.n);return this.makeSignature({R:i,S:A,Rencoded:o})},u.prototype.verify=function(e,t,r){e=s(e),t=this.makeSignature(t);var n=this.keyFromPublic(r),i=this.hashInt(t.Rencoded(),n.pubBytes(),e),o=this.g.mul(t.S());return t.R().add(n.pub().mul(i)).eq(o)},u.prototype.hashInt=function(){for(var e=this.hash(),t=0;t<arguments.length;t++)e.update(arguments[t]);return o.intFromLE(e.digest()).umod(this.curve.n)},u.prototype.keyFromPublic=function(e){return A.fromPublic(this,e)},u.prototype.keyFromSecret=function(e){return A.fromSecret(this,e)},u.prototype.makeSignature=function(e){return e instanceof c?e:new c(this,e)},u.prototype.encodePoint=function(e){var t=e.getY().toArray("le",this.encodingLength);return t[this.encodingLength-1]|=e.getX().isOdd()?128:0,t},u.prototype.decodePoint=function(e){var t=(e=o.parseBytes(e)).length-1,r=e.slice(0,t).concat(-129&e[t]),n=0!=(128&e[t]),i=o.intFromLE(r);return this.curve.pointFromY(i,n)},u.prototype.encodeInt=function(e){return e.toArray("le",this.encodingLength)},u.prototype.decodeInt=function(e){return o.intFromLE(e)},u.prototype.isPoint=function(e){return e instanceof this.pointClass}},function(e,t,r){"use strict";var n=r(13),i=n.assert,o=n.parseBytes,a=n.cachedProperty;function s(e,t){this.eddsa=e,this._secret=o(t.secret),e.isPoint(t.pub)?this._pub=t.pub:this._pubBytes=o(t.pub)}s.fromPublic=function(e,t){return t instanceof s?t:new s(e,{pub:t})},s.fromSecret=function(e,t){return t instanceof s?t:new s(e,{secret:t})},s.prototype.secret=function(){return this._secret},a(s,"pubBytes",(function(){return this.eddsa.encodePoint(this.pub())})),a(s,"pub",(function(){return this._pubBytes?this.eddsa.decodePoint(this._pubBytes):this.eddsa.g.mul(this.priv())})),a(s,"privBytes",(function(){var e=this.eddsa,t=this.hash(),r=e.encodingLength-1,n=t.slice(0,e.encodingLength);return n[0]&=248,n[r]&=127,n[r]|=64,n})),a(s,"priv",(function(){return this.eddsa.decodeInt(this.privBytes())})),a(s,"hash",(function(){return this.eddsa.hash().update(this.secret()).digest()})),a(s,"messagePrefix",(function(){return this.hash().slice(this.eddsa.encodingLength)})),s.prototype.sign=function(e){return i(this._secret,"KeyPair can only verify"),this.eddsa.sign(e,this)},s.prototype.verify=function(e,t){return this.eddsa.verify(e,t,this)},s.prototype.getSecret=function(e){return i(this._secret,"KeyPair is public only"),n.encode(this.secret(),e)},s.prototype.getPublic=function(e){return n.encode(this.pubBytes(),e)},e.exports=s},function(e,t,r){"use strict";function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var i=r(2),o=r(13),a=o.assert,s=o.cachedProperty,A=o.parseBytes;function c(e,t){this.eddsa=e,"object"!==n(t)&&(t=A(t)),Array.isArray(t)&&(t={R:t.slice(0,e.encodingLength),S:t.slice(e.encodingLength)}),a(t.R&&t.S,"Signature without R or S"),e.isPoint(t.R)&&(this._R=t.R),t.S instanceof i&&(this._S=t.S),this._Rencoded=Array.isArray(t.R)?t.R:t.Rencoded,this._Sencoded=Array.isArray(t.S)?t.S:t.Sencoded}s(c,"S",(function(){return this.eddsa.decodeInt(this.Sencoded())})),s(c,"R",(function(){return this.eddsa.decodePoint(this.Rencoded())})),s(c,"Rencoded",(function(){return this.eddsa.encodePoint(this.R())})),s(c,"Sencoded",(function(){return this.eddsa.encodeInt(this.S())})),c.prototype.toBytes=function(){return this.Rencoded().concat(this.Sencoded())},c.prototype.toHex=function(){return o.encode(this.toBytes(),"hex").toUpperCase()},e.exports=c},function(e,t,r){"use strict";var n=r(153);t.certificate=r(324);var i=n.define("RSAPrivateKey",(function(){this.seq().obj(this.key("version").int(),this.key("modulus").int(),this.key("publicExponent").int(),this.key("privateExponent").int(),this.key("prime1").int(),this.key("prime2").int(),this.key("exponent1").int(),this.key("exponent2").int(),this.key("coefficient").int())}));t.RSAPrivateKey=i;var o=n.define("RSAPublicKey",(function(){this.seq().obj(this.key("modulus").int(),this.key("publicExponent").int())}));t.RSAPublicKey=o;var a=n.define("SubjectPublicKeyInfo",(function(){this.seq().obj(this.key("algorithm").use(s),this.key("subjectPublicKey").bitstr())}));t.PublicKey=a;var s=n.define("AlgorithmIdentifier",(function(){this.seq().obj(this.key("algorithm").objid(),this.key("none").null_().optional(),this.key("curve").objid().optional(),this.key("params").seq().obj(this.key("p").int(),this.key("q").int(),this.key("g").int()).optional())})),A=n.define("PrivateKeyInfo",(function(){this.seq().obj(this.key("version").int(),this.key("algorithm").use(s),this.key("subjectPrivateKey").octstr())}));t.PrivateKey=A;var c=n.define("EncryptedPrivateKeyInfo",(function(){this.seq().obj(this.key("algorithm").seq().obj(this.key("id").objid(),this.key("decrypt").seq().obj(this.key("kde").seq().obj(this.key("id").objid(),this.key("kdeparams").seq().obj(this.key("salt").octstr(),this.key("iters").int())),this.key("cipher").seq().obj(this.key("algo").objid(),this.key("iv").octstr()))),this.key("subjectPrivateKey").octstr())}));t.EncryptedPrivateKey=c;var u=n.define("DSAPrivateKey",(function(){this.seq().obj(this.key("version").int(),this.key("p").int(),this.key("q").int(),this.key("g").int(),this.key("pub_key").int(),this.key("priv_key").int())}));t.DSAPrivateKey=u,t.DSAparam=n.define("DSAparam",(function(){this.int()}));var f=n.define("ECPrivateKey",(function(){this.seq().obj(this.key("version").int(),this.key("privateKey").octstr(),this.key("parameters").optional().explicit(0).use(h),this.key("publicKey").optional().explicit(1).bitstr())}));t.ECPrivateKey=f;var h=n.define("ECParameters",(function(){this.choice({namedCurve:this.objid()})}));t.signature=n.define("signature",(function(){this.seq().obj(this.key("r").int(),this.key("s").int())}))},function(e,t,r){"use strict";var n=r(154),i=r(156),o=r(3);function a(e,t){this.name=e,this.body=t,this.decoders={},this.encoders={}}t.define=function(e,t){return new a(e,t)},a.prototype._createNamed=function(e){var t=this.name;function r(e){this._initNamed(e,t)}return o(r,e),r.prototype._initNamed=function(t,r){e.call(this,t,r)},new r(this)},a.prototype._getDecoder=function(e){return e=e||"der",this.decoders.hasOwnProperty(e)||(this.decoders[e]=this._createNamed(i[e])),this.decoders[e]},a.prototype.decode=function(e,t,r){return this._getDecoder(t).decode(e,r)},a.prototype._getEncoder=function(e){return e=e||"der",this.encoders.hasOwnProperty(e)||(this.encoders[e]=this._createNamed(n[e])),this.encoders[e]},a.prototype.encode=function(e,t,r){return this._getEncoder(t).encode(e,r)}},function(e,t,r){"use strict";var n=r(3),i=r(155);function o(e){i.call(this,e),this.enc="pem"}n(o,i),e.exports=o,o.prototype.encode=function(e,t){for(var r=i.prototype.encode.call(this,e).toString("base64"),n=["-----BEGIN "+t.label+"-----"],o=0;o<r.length;o+=64)n.push(r.slice(o,o+64));return n.push("-----END "+t.label+"-----"),n.join("\n")}},function(e,t,r){"use strict";var n=r(3),i=r(75).Buffer,o=r(157);function a(e){o.call(this,e),this.enc="pem"}n(a,o),e.exports=a,a.prototype.decode=function(e,t){for(var r=e.toString().split(/[\r\n]+/g),n=t.label.toUpperCase(),a=/^-----(BEGIN|END) ([^-]+)-----$/,s=-1,A=-1,c=0;c<r.length;c++){var u=r[c].match(a);if(null!==u&&u[2]===n){if(-1!==s){if("END"!==u[1])break;A=c;break}if("BEGIN"!==u[1])break;s=c}}if(-1===s||-1===A)throw new Error("PEM section not found for: "+n);var f=r.slice(s+1,A).join("");f.replace(/[^a-z0-9+/=]+/gi,"");var h=i.from(f,"base64");return o.prototype.decode.call(this,h,t)}},function(e,t,r){"use strict";var n=t;n.Reporter=r(77).Reporter,n.DecoderBuffer=r(35).DecoderBuffer,n.EncoderBuffer=r(35).EncoderBuffer,n.Node=r(76)},function(e,t,r){"use strict";var n=t;n._reverse=function(e){var t={};return Object.keys(e).forEach((function(r){(0|r)==r&&(r|=0);var n=e[r];t[n]=r})),t},n.der=r(78)},function(e,t,r){"use strict";var n=r(153),i=n.define("Time",(function(){this.choice({utcTime:this.utctime(),generalTime:this.gentime()})})),o=n.define("AttributeTypeValue",(function(){this.seq().obj(this.key("type").objid(),this.key("value").any())})),a=n.define("AlgorithmIdentifier",(function(){this.seq().obj(this.key("algorithm").objid(),this.key("parameters").optional(),this.key("curve").objid().optional())})),s=n.define("SubjectPublicKeyInfo",(function(){this.seq().obj(this.key("algorithm").use(a),this.key("subjectPublicKey").bitstr())})),A=n.define("RelativeDistinguishedName",(function(){this.setof(o)})),c=n.define("RDNSequence",(function(){this.seqof(A)})),u=n.define("Name",(function(){this.choice({rdnSequence:this.use(c)})})),f=n.define("Validity",(function(){this.seq().obj(this.key("notBefore").use(i),this.key("notAfter").use(i))})),h=n.define("Extension",(function(){this.seq().obj(this.key("extnID").objid(),this.key("critical").bool().def(!1),this.key("extnValue").octstr())})),l=n.define("TBSCertificate",(function(){this.seq().obj(this.key("version").explicit(0).int().optional(),this.key("serialNumber").int(),this.key("signature").use(a),this.key("issuer").use(u),this.key("validity").use(f),this.key("subject").use(u),this.key("subjectPublicKeyInfo").use(s),this.key("issuerUniqueID").implicit(1).bitstr().optional(),this.key("subjectUniqueID").implicit(2).bitstr().optional(),this.key("extensions").explicit(3).seqof(h).optional())})),g=n.define("X509Certificate",(function(){this.seq().obj(this.key("tbsCertificate").use(l),this.key("signatureAlgorithm").use(a),this.key("signatureValue").bitstr())}));e.exports=g},function(e){e.exports=JSON.parse('{"2.16.840.1.101.3.4.1.1":"aes-128-ecb","2.16.840.1.101.3.4.1.2":"aes-128-cbc","2.16.840.1.101.3.4.1.3":"aes-128-ofb","2.16.840.1.101.3.4.1.4":"aes-128-cfb","2.16.840.1.101.3.4.1.21":"aes-192-ecb","2.16.840.1.101.3.4.1.22":"aes-192-cbc","2.16.840.1.101.3.4.1.23":"aes-192-ofb","2.16.840.1.101.3.4.1.24":"aes-192-cfb","2.16.840.1.101.3.4.1.41":"aes-256-ecb","2.16.840.1.101.3.4.1.42":"aes-256-cbc","2.16.840.1.101.3.4.1.43":"aes-256-ofb","2.16.840.1.101.3.4.1.44":"aes-256-cfb"}')},function(e,t,r){var n=/Proc-Type: 4,ENCRYPTED[\n\r]+DEK-Info: AES-((?:128)|(?:192)|(?:256))-CBC,([0-9A-H]+)[\n\r]+([0-9A-z\n\r+/=]+)[\n\r]+/m,i=/^-----BEGIN ((?:.*? KEY)|CERTIFICATE)-----/m,o=/^-----BEGIN ((?:.*? KEY)|CERTIFICATE)-----([0-9A-z\n\r+/=]+)-----END \1-----$/m,a=r(46),s=r(69),A=r(4).Buffer;e.exports=function(e,t){var r,c=e.toString(),u=c.match(n);if(u){var f="aes"+u[1],h=A.from(u[2],"hex"),l=A.from(u[3].replace(/[\r\n]/g,""),"base64"),g=a(t,h.slice(0,8),parseInt(u[1],10)).key,d=[],p=s.createDecipheriv(f,g,h);d.push(p.update(l)),d.push(p.final()),r=A.concat(d)}else{var I=c.match(o);r=A.from(I[2].replace(/[\r\n]/g,""),"base64")}return{tag:c.match(i)[1],data:r}}},function(e,t,r){var n=r(4).Buffer,i=r(2),o=r(73).ec,a=r(48),s=r(158);function A(e,t){if(e.cmpn(0)<=0)throw new Error("invalid sig");if(e.cmp(t)>=t)throw new Error("invalid sig")}e.exports=function(e,t,r,c,u){var f=a(r);if("ec"===f.type){if("ecdsa"!==c&&"ecdsa/rsa"!==c)throw new Error("wrong public key type");return function(e,t,r){var n=s[r.data.algorithm.curve.join(".")];if(!n)throw new Error("unknown curve "+r.data.algorithm.curve.join("."));var i=new o(n),a=r.data.subjectPrivateKey.data;return i.verify(t,e,a)}(e,t,f)}if("dsa"===f.type){if("dsa"!==c)throw new Error("wrong public key type");return function(e,t,r){var n=r.data.p,o=r.data.q,s=r.data.g,c=r.data.pub_key,u=a.signature.decode(e,"der"),f=u.s,h=u.r;A(f,o),A(h,o);var l=i.mont(n),g=f.invm(o);return 0===s.toRed(l).redPow(new i(t).mul(g).mod(o)).fromRed().mul(c.toRed(l).redPow(h.mul(g).mod(o)).fromRed()).mod(n).mod(o).cmp(h)}(e,t,f)}if("rsa"!==c&&"ecdsa/rsa"!==c)throw new Error("wrong public key type");t=n.concat([u,t]);for(var h=f.modulus.byteLength(),l=[1],g=0;t.length+l.length+2<h;)l.push(255),g++;l.push(0);for(var d=-1;++d<t.length;)l.push(t[d]);l=n.from(l);var p=i.mont(f.modulus);e=(e=new i(e).toRed(p)).redPow(new i(f.publicExponent)),e=n.from(e.fromRed().toArray());var I=g<8?1:0;for(h=Math.min(e.length,l.length),e.length!==l.length&&(I=1),d=-1;++d<h;)I|=e[d]^l[d];return 0===I}},function(e,t,r){var n=r(48),i=r(19),o=r(24),a=r(161),s=r(162),A=r(2),c=r(163),u=r(72),f=r(4).Buffer;e.exports=function(e,t,r){var h;h=e.padding?e.padding:r?1:4;var l,g=n(e);if(4===h)l=function(e,t){var r=e.modulus.byteLength(),n=t.length,c=o("sha1").update(f.alloc(0)).digest(),u=c.length,h=2*u;if(n>r-h-2)throw new Error("message too long");var l=f.alloc(r-n-h-2),g=r-u-1,d=i(u),p=s(f.concat([c,l,f.alloc(1,1),t],g),a(d,g)),I=s(d,a(p,u));return new A(f.concat([f.alloc(1),I,p],r))}(g,t);else if(1===h)l=function(e,t,r){var n,o=t.length,a=e.modulus.byteLength();if(o>a-11)throw new Error("message too long");n=r?f.alloc(a-o-3,255):function(e){var t,r=f.allocUnsafe(e),n=0,o=i(2*e),a=0;for(;n<e;)a===o.length&&(o=i(2*e),a=0),(t=o[a++])&&(r[n++]=t);return r}(a-o-3);return new A(f.concat([f.from([0,r?1:2]),n,f.alloc(1),t],a))}(g,t,r);else{if(3!==h)throw new Error("unknown padding");if((l=new A(t)).cmp(g.modulus)>=0)throw new Error("data too long for modulus")}return r?u(l,g):c(l,g)}},function(e,t,r){var n=r(48),i=r(161),o=r(162),a=r(2),s=r(72),A=r(24),c=r(163),u=r(4).Buffer;e.exports=function(e,t,r){var f;f=e.padding?e.padding:r?1:4;var h,l=n(e),g=l.modulus.byteLength();if(t.length>g||new a(t).cmp(l.modulus)>=0)throw new Error("decryption error");h=r?c(new a(t),l):s(t,l);var d=u.alloc(g-h.length);if(h=u.concat([d,h],g),4===f)return function(e,t){var r=e.modulus.byteLength(),n=A("sha1").update(u.alloc(0)).digest(),a=n.length;if(0!==t[0])throw new Error("decryption error");var s=t.slice(1,a+1),c=t.slice(a+1),f=o(s,i(c,a)),h=o(c,i(f,r-a-1));if(function(e,t){e=u.from(e),t=u.from(t);var r=0,n=e.length;e.length!==t.length&&(r++,n=Math.min(e.length,t.length));var i=-1;for(;++i<n;)r+=e[i]^t[i];return r}(n,h.slice(0,a)))throw new Error("decryption error");var l=a;for(;0===h[l];)l++;if(1!==h[l++])throw new Error("decryption error");return h.slice(l)}(l,h);if(1===f)return function(e,t,r){var n=t.slice(0,2),i=2,o=0;for(;0!==t[i++];)if(i>=t.length){o++;break}var a=t.slice(2,i-1);("0002"!==n.toString("hex")&&!r||"0001"!==n.toString("hex")&&r)&&o++;a.length<8&&o++;if(o)throw new Error("decryption error");return t.slice(i)}(0,h,r);if(3===f)return h;throw new Error("unknown padding")}},function(e,t,r){(function(t){var n=r(62).Transform,i=r(3);function o(e){n.call(this,e),this._destroyed=!1}function a(e,t,r){r(null,e)}function s(e){return function(t,r,n){return"function"==typeof t&&(n=r,r=t,t={}),"function"!=typeof r&&(r=a),"function"!=typeof n&&(n=null),e(t,r,n)}}i(o,n),o.prototype.destroy=function(e){if(!this._destroyed){this._destroyed=!0;var r=this;t.nextTick((function(){e&&r.emit("error",e),r.emit("close")}))}},e.exports=s((function(e,t,r){var n=new o(e);return n._transform=t,r&&(n._flush=r),n})),e.exports.ctor=s((function(e,t,r){function n(t){if(!(this instanceof n))return new n(t);this.options=Object.assign({},e,t),o.call(this,this.options)}return i(n,o),n.prototype._transform=t,r&&(n.prototype._flush=r),n})),e.exports.obj=s((function(e,t,r){var n=new o(Object.assign({objectMode:!0,highWaterMark:16},e));return n._transform=t,r&&(n._flush=r),n}))}).call(this,r(9))},function(e,t){var r={}.toString;e.exports=Array.isArray||function(e){return"[object Array]"==r.call(e)}},function(e,t,r){(function(e){var n=r(36),i=r(21),o=r(22);function a(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function s(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?a(Object(r),!0).forEach((function(t){n(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):a(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}var A,c=r(37);c.Platform()===c.PLATFORM_NODE&&(globalThis.Response=r(98).Response,A=r(333));var u=r(97),f=r(100),h=f.ValidatePresence,l=f.ValidateWriteToken,g=f.ValidatePartHash,d=f.ValidateParameters;t.ListFiles=function(){var e=o(i.mark((function e(t){var r,n,o,a;return i.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.libraryId,n=t.objectId,o=t.versionHash,d({libraryId:r,objectId:n,versionHash:o}),o&&(n=this.utils.DecodeVersionHash(o).objectId),a=u("q",o||n,"meta","files"),e.t0=this.utils,e.t1=this.HttpClient,e.next=8,this.authClient.AuthorizationHeader({libraryId:r,objectId:n,versionHash:o});case 8:return e.t2=e.sent,e.t3=a,e.t4={headers:e.t2,method:"GET",path:e.t3},e.t5=e.t1.Request.call(e.t1,e.t4),e.abrupt("return",e.t0.ResponseToJson.call(e.t0,e.t5));case 13:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}(),t.UploadFilesFromS3=function(){var t=o(i.mark((function t(r){var n,o,a,A,c,u,f,h,g,p,I,y,b,E,m,C,v,B,w,Q,k,_,S,D,M,R,x,O,N;return i.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:n=r.libraryId,o=r.objectId,a=r.writeToken,A=r.region,c=r.bucket,u=r.fileInfo,f=r.accessKey,h=r.secret,g=r.signedUrl,p=r.encryption,I=void 0===p?"none":p,y=r.copy,b=void 0!==y&&y,E=r.callback,d({libraryId:n,objectId:o}),l(a),m=/^s3:\/\/([^/]+)\//i,C=0;case 5:if(!(C<u.length)){t.next=18;break}if(v=u[C].source,!(B=m.exec(v))){t.next=15;break}if(B[1]===c){t.next=14;break}throw Error('Full S3 file path "'+v+"\" specified, but does not match provided bucket name '"+c+"'");case 14:u[C].source=v.replace(m,"");case 15:C++,t.next=5;break;case 18:if(this.Log("Uploading files from S3: ".concat(n," ").concat(o," ").concat(a)),"cgck"!==I){t.next=25;break}return t.next=22,this.EncryptionConk({libraryId:n,objectId:o,writeToken:a});case 22:Q=s(s({},Q=t.sent),{},{secret_key:""}),w="kp__".concat(this.utils.B58(e.from(JSON.stringify(Q))));case 25:return k={access_key_id:f,secret_access_key:h},g&&(k={signed_url:g}),_={encryption_key:w,access:{protocol:"s3",platform:"aws",path:c,storage_endpoint:{region:A},cloud_credentials:k}},S=u.map((function(e){return b?{op:"ingest-copy",path:e.path,encryption:{scheme:"cgck"===I?"cgck":"none"},ingest:{type:"key",path:e.source}}:{op:"add-reference",path:e.path,reference:{type:"key",path:e.source}}})),t.next=31,this.CreateFileUploadJob({libraryId:n,objectId:o,writeToken:a,ops:S,defaults:_});case 31:D=t.sent,M=D.id;case 33:return t.next=36,new Promise((function(e){return setTimeout(e,1e3)}));case 36:return t.next=38,this.UploadStatus({libraryId:n,objectId:o,writeToken:a,uploadId:M});case 38:if(!((R=t.sent).errors&&R.errors.length>1)){t.next=43;break}throw R.errors.join("\n");case 43:if(!R.error){t.next=48;break}throw this.Log("S3 file upload failed:\n".concat(JSON.stringify(R,null,2))),R.error;case 48:if("failed"!==R.status.toLowerCase()){t.next=50;break}throw"File upload failed";case 50:if(x=!1,b?(x=R.ingest_copy.done,E&&(O=R.ingest_copy.progress,E({done:x,uploaded:O.bytes.completed,total:O.bytes.total,uploadedFiles:O.files.completed,totalFiles:O.files.total,fileStatus:O.files.details}))):(x=R.add_reference.done,E&&(N=R.add_reference.progress,E({done:x,uploadedFiles:N.completed,totalFiles:N.total}))),!x){t.next=54;break}return t.abrupt("break",56);case 54:t.next=33;break;case 56:case"end":return t.stop()}}),t,this)})));return function(e){return t.apply(this,arguments)}}(),t.UploadFiles=function(){var t=o(i.mark((function t(r){var n,a,c,u,f,h,g,p,I,y,b,E,m,C,v,B,w,Q,k,_,S,D,M,R,x,O,N,P,F=this;return i.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n=r.libraryId,a=r.objectId,c=r.writeToken,u=r.fileInfo,f=r.encryption,h=void 0===f?"none":f,g=r.callback,d({libraryId:n,objectId:a}),l(c),this.Log("Uploading files: ".concat(n," ").concat(a," ").concat(c)),"cgck"!==h){t.next=8;break}return t.next=7,this.EncryptionConk({libraryId:n,objectId:a,writeToken:c});case 7:p=t.sent;case 8:for(I={},y={},b=0;b<u.length;b++)(E=s(s({},u[b]),{},{data:void 0})).path=E.path.replace(/^\/+/,""),"cgck"===h&&(E.encryption={scheme:"cgck"}),y[E.path]=u[b].data,delete E.data,E.type="file",I[E.path]={uploaded:0,total:E.size},u[b]=E;return this.Log(u),g&&g(I),t.next=15,this.CreateFileUploadJob({libraryId:n,objectId:a,writeToken:c,ops:u,encryption:h});case 15:m=t.sent,C=m.id,v=m.jobs,this.Log("Upload ID: ".concat(C)),this.Log(v),104857600,B=[],w=0,Q=0,k=function(){var t=o(i.mark((function t(){var r,o,s,u,f,l;return i.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:r=0;case 1:if(!(r<v.length)){t.next=31;break}case 2:if(!(w-Q>104857600)){t.next=7;break}return t.next=5,new Promise((function(e){return setTimeout(e,500)}));case 5:t.next=2;break;case 7:return o=v[r],t.next=10,F.UploadJobStatus({libraryId:n,objectId:a,writeToken:c,uploadId:C,jobId:o});case 10:s=t.sent,u=0;case 12:if(!(u<s.files.length)){t.next=25;break}if(f=s.files[u],l=void 0,"number"==typeof y[f.path]?(l=e.alloc(f.len),A.readSync(y[f.path],l,0,f.len,f.off)):l=y[f.path].slice(f.off,f.off+f.len),"cgck"!==h){t.next=20;break}return t.next=19,F.Crypto.Encrypt(p,l);case 19:l=t.sent;case 20:s.files[u].data=l,w+=f.len;case 22:u++,t.next=12;break;case 25:return B[r]=s,t.next=28,new Promise((function(e){return setTimeout(e,50)}));case 28:r++,t.next=1;break;case 31:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}(),_=function(){var e=o(i.mark((function e(t,r){var o,A,u,f;return i.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(B[r]){e.next=5;break}return e.next=3,new Promise((function(e){return setTimeout(e,500)}));case 3:e.next=0;break;case 5:o=B[r],A=o.files,u=0;case 8:if(!(u<A.length)){e.next=18;break}return f=A[u],e.next=12,F.UploadFileData({libraryId:n,objectId:a,writeToken:c,uploadId:C,jobId:t,fileData:f.data});case 12:delete B[r].files[u].data,Q+=f.len,g&&(I[f.path]=s(s({},I[f.path]),{},{uploaded:I[f.path].uploaded+f.len}),g(I));case 15:u++,e.next=8;break;case 18:case"end":return e.stop()}}),e)})));return function(t,r){return e.apply(this,arguments)}}(),k(),S=Math.min(3,v.length),D=[],M=0;case 30:if(!(M<S)){t.next=40;break}return R=(new Date).getTime(),t.next=34,_(v[M],M);case 34:x=((new Date).getTime()-R)/1e3,O=B[M].files.map((function(e){return e.len})).reduce((function(e,t){return e+t}),0),D.push(O/x/1048576);case 37:M++,t.next=30;break;case 40:return N=D.reduce((function(e,t){return e+t}),0)/S,P=Math.min(5,Math.ceil(N/2)),t.next=44,this.utils.LimitedMap(P,v,function(){var e=o(i.mark((function e(t,r){return i.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!(r<S)){e.next=2;break}return e.abrupt("return");case 2:return e.next=4,_(t,r);case 4:case"end":return e.stop()}}),e)})));return function(t,r){return e.apply(this,arguments)}}());case 44:case"end":return t.stop()}}),t,this)})));return function(e){return t.apply(this,arguments)}}(),t.CreateFileUploadJob=function(){var e=o(i.mark((function e(t){var r,n,o,a,s,A,c,f,h,g;return i.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.libraryId,n=t.objectId,o=t.writeToken,a=t.ops,s=t.defaults,A=void 0===s?{}:s,c=t.encryption,f=void 0===c?"none":c,d({libraryId:r,objectId:n}),l(o),this.Log("Creating file upload job: ".concat(r," ").concat(n," ").concat(o)),this.Log(a),"cgck"===f&&(A.encryption={scheme:"cgck"}),h={seq:0,seq_complete:!0,defaults:A,ops:a},g=u("q",o,"file_jobs"),e.t0=this.utils,e.t1=this.HttpClient,e.next=12,this.authClient.AuthorizationHeader({libraryId:r,objectId:n,update:!0,encryption:f});case 12:return e.t2=e.sent,e.t3=g,e.t4=h,e.t5={headers:e.t2,method:"POST",path:e.t3,body:e.t4,failover:!1},e.t6=e.t1.Request.call(e.t1,e.t5),e.abrupt("return",e.t0.ResponseToJson.call(e.t0,e.t6));case 18:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}(),t.UploadStatus=function(){var e=o(i.mark((function e(t){var r,n,o,a,s;return i.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.libraryId,n=t.objectId,o=t.writeToken,a=t.uploadId,d({libraryId:r,objectId:n}),l(o),s=u("q",o,"file_jobs",a),e.t0=this.utils,e.t1=this.HttpClient,e.next=8,this.authClient.AuthorizationHeader({libraryId:r,objectId:n,update:!0});case 8:return e.t2=e.sent,e.t3=s,e.t4={headers:e.t2,method:"GET",path:e.t3,failover:!1},e.t5=e.t1.Request.call(e.t1,e.t4),e.abrupt("return",e.t0.ResponseToJson.call(e.t0,e.t5));case 13:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}(),t.UploadJobStatus=function(){var e=o(i.mark((function e(t){var r,n,o,a,s,A;return i.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.libraryId,n=t.objectId,o=t.writeToken,a=t.uploadId,s=t.jobId,d({libraryId:r,objectId:n}),l(o),A=u("q",o,"file_jobs",a,"uploads",s),e.t0=this.utils,e.t1=this.HttpClient,e.next=8,this.authClient.AuthorizationHeader({libraryId:r,objectId:n,update:!0});case 8:return e.t2=e.sent,e.t3=A,e.t4={headers:e.t2,method:"GET",path:e.t3,failover:!1},e.t5=e.t1.Request.call(e.t1,e.t4),e.abrupt("return",e.t0.ResponseToJson.call(e.t0,e.t5));case 13:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}(),t.UploadFileData=function(){var e=o(i.mark((function e(t){var r,n,o,a,A,c,f;return i.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.libraryId,n=t.objectId,o=t.writeToken,a=t.uploadId,A=t.jobId,c=t.fileData,d({libraryId:r,objectId:n}),l(o),f=u("q",o,"file_jobs",a,A),e.t0=this.utils,e.t1=this.HttpClient,e.t2=f,e.t3=c,e.t4=s,e.t5={"Content-type":"application/octet-stream"},e.next=12,this.authClient.AuthorizationHeader({libraryId:r,objectId:n,update:!0});case 12:return e.t6=e.sent,e.t7=(0,e.t4)(e.t5,e.t6),e.t8={method:"POST",path:e.t2,body:e.t3,bodyType:"BINARY",headers:e.t7,failover:!1},e.t9=e.t1.Request.call(e.t1,e.t8),e.next=18,e.t0.ResponseToJson.call(e.t0,e.t9);case 18:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}(),t.FinalizeUploadJob=function(){var e=o(i.mark((function e(t){var r,n,o,a;return i.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.libraryId,n=t.objectId,o=t.writeToken,d({libraryId:r,objectId:n}),l(o),this.Log("Finalizing upload job: ".concat(r," ").concat(n," ").concat(o)),a=u("q",o,"files"),e.t0=this.HttpClient,e.t1=a,e.next=9,this.authClient.AuthorizationHeader({libraryId:r,objectId:n,update:!0});case 9:return e.t2=e.sent,e.t3={method:"POST",path:e.t1,bodyType:"BINARY",headers:e.t2,failover:!1},e.next=13,e.t0.Request.call(e.t0,e.t3);case 13:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}(),t.CreateFileDirectories=function(){var e=o(i.mark((function e(t){var r,n,o,a,s;return i.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.libraryId,n=t.objectId,o=t.writeToken,a=t.filePaths,d({libraryId:r,objectId:n}),l(o),this.Log("Creating Directories: ".concat(r," ").concat(n," ").concat(o)),this.Log(a),s=a.map((function(e){return{op:"add",type:"directory",path:e}})),e.next=8,this.CreateFileUploadJob({libraryId:r,objectId:n,writeToken:o,ops:s});case 8:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}(),t.DeleteFiles=function(){var e=o(i.mark((function e(t){var r,n,o,a,s;return i.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.libraryId,n=t.objectId,o=t.writeToken,a=t.filePaths,d({libraryId:r,objectId:n}),l(o),this.Log("Deleting Files: ".concat(r," ").concat(n," ").concat(o)),this.Log(a),s=a.map((function(e){return{op:"del",path:e}})),e.next=8,this.CreateFileUploadJob({libraryId:r,objectId:n,writeToken:o,ops:s});case 8:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}(),t.DownloadFile=function(){var e=o(i.mark((function e(t){var r,n,o,a,A,c,f,l,g,p,I,y,b,E,m,C,v,B,w,Q,k,_=arguments;return i.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.libraryId,n=t.objectId,o=t.versionHash,a=t.writeToken,A=t.filePath,c=t.format,f=void 0===c?"arrayBuffer":c,l=t.chunked,g=void 0!==l&&l,p=t.chunkSize,I=t.clientSideDecryption,y=void 0!==I&&I,b=t.callback,d({libraryId:r,objectId:n,versionHash:o}),h("filePath",A),o&&(n=this.utils.DecodeVersionHash(o).objectId),e.next=6,this.ContentObjectMetadata({libraryId:r,objectId:n,versionHash:o,writeToken:a,metadataSubtree:u("files",A)});case 6:return E=e.sent,m=E&&E["."].encryption&&"cgck"===E["."].encryption.scheme,C=m?"cgck":void 0,v=m&&!y?u("q",a||o||n,"rep","files_download",A):u("q",a||o||n,"files",A),e.next=12,this.authClient.AuthorizationHeader({libraryId:r,objectId:n,versionHash:o,encryption:C});case 12:return(B=e.sent).Accept="*/*",w="eluv.caps.iusr".concat(this.utils.AddressToHash(this.signer.address)),e.next=17,this.ContentObjectMetadata({libraryId:r,objectId:n,metadataSubtree:w});case 17:if(Q=e.sent,e.t1=m,!e.t1){e.next=26;break}return e.t2=this.utils,e.t3=this.signer.address,e.next=24,this.ContentObjectOwner({objectId:n});case 24:e.t4=e.sent,e.t1=!e.t2.EqualAddress.call(e.t2,e.t3,e.t4);case 26:if(e.t0=e.t1,!e.t0){e.next=29;break}e.t0=!Q;case 29:if(!e.t0){e.next=31;break}B["X-Content-Fabric-Decryption-Mode"]="reencrypt";case 31:if(m&&!y&&(B["X-Content-Fabric-Decryption-Mode"]="decrypt",p=Number.MAX_SAFE_INTEGER),k=E["."].size,!m||!y){e.next=51;break}return e.t5=this,e.next=37,this.EncryptionConk({libraryId:r,objectId:n,versionHash:o,download:!0});case 37:return e.t6=e.sent,e.t7=v,e.t8=k,e.t9=B,e.t10=b,e.t11=f,e.t12=y,e.t13=g,e.t14={conk:e.t6,downloadPath:e.t7,bytesTotal:e.t8,headers:e.t9,callback:e.t10,format:e.t11,clientSideDecryption:e.t12,chunked:e.t13},e.next=48,e.t5.DownloadEncrypted.call(e.t5,e.t14);case 48:return e.abrupt("return",e.sent);case 51:return p||(p=1e7),e.prev=52,e.next=55,this.Download({downloadPath:v,bytesTotal:k,headers:B,callback:b,format:f,chunked:g,chunkSize:p});case 55:return e.abrupt("return",e.sent);case 58:if(e.prev=58,e.t15=e.catch(52),!m||y){e.next=62;break}return e.abrupt("return",this.DownloadFile(s(s({},_[0]),{},{clientSideDecryption:!0})));case 62:throw e.t15;case 63:case"end":return e.stop()}}),e,this,[[52,58]])})));return function(t){return e.apply(this,arguments)}}(),t.ContentParts=function(){var e=o(i.mark((function e(t){var r,n,o,a,s;return i.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.libraryId,n=t.objectId,o=t.versionHash,d({libraryId:r,objectId:n,versionHash:o}),this.Log("Retrieving parts: ".concat(r," ").concat(n||o)),o&&(n=this.utils.DecodeVersionHash(o).objectId),a=u("q",o||n,"parts"),e.t0=this.utils,e.t1=this.HttpClient,e.next=9,this.authClient.AuthorizationHeader({libraryId:r,objectId:n,versionHash:o});case 9:return e.t2=e.sent,e.t3=a,e.t4={headers:e.t2,method:"GET",path:e.t3},e.t5=e.t1.Request.call(e.t1,e.t4),e.next=15,e.t0.ResponseToJson.call(e.t0,e.t5);case 15:return s=e.sent,e.abrupt("return",s.parts);case 17:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}(),t.ContentPart=function(){var e=o(i.mark((function e(t){var r,n,o,a,s;return i.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.libraryId,n=t.objectId,o=t.versionHash,a=t.partHash,d({libraryId:r,objectId:n,versionHash:o}),g(a),this.Log("Retrieving part: ".concat(r," ").concat(n||o," ").concat(a)),o&&(n=this.utils.DecodeVersionHash(o).objectId),s=u("q",o||n,"parts",a),e.t0=this.utils,e.t1=this.HttpClient,e.next=10,this.authClient.AuthorizationHeader({libraryId:r,objectId:n,versionHash:o});case 10:return e.t2=e.sent,e.t3=s,e.t4={headers:e.t2,method:"GET",path:e.t3},e.t5=e.t1.Request.call(e.t1,e.t4),e.next=16,e.t0.ResponseToJson.call(e.t0,e.t5);case 16:return e.abrupt("return",e.sent);case 17:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}(),t.DownloadPart=function(){var e=o(i.mark((function e(t){var r,n,o,a,s,A,c,f,h,l,p,I,y,b,E,m,C;return i.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.libraryId,n=t.objectId,o=t.versionHash,a=t.writeToken,s=t.partHash,A=t.format,c=void 0===A?"arrayBuffer":A,f=t.chunked,h=void 0!==f&&f,l=t.chunkSize,p=void 0===l?1e7:l,I=t.callback,d({libraryId:r,objectId:n,versionHash:o}),g(s),o&&(n=this.utils.DecodeVersionHash(o).objectId),y=s.startsWith("hqpe"),b=y?"cgck":void 0,E=u("q",a||o||n,"data",s),e.next=9,this.authClient.AuthorizationHeader({libraryId:r,objectId:n,versionHash:o,encryption:b,makeAccessRequest:!0});case 9:return m=e.sent,e.next=12,this.ContentPart({libraryId:r,objectId:n,versionHash:o,partHash:s});case 12:if(C=e.sent.part.size,!y){e.next=37;break}return e.t0=this.utils,e.t1=this.signer.address,e.next=18,this.ContentObjectOwner({objectId:n});case 18:if(e.t2=e.sent,e.t0.EqualAddress.call(e.t0,e.t1,e.t2)){e.next=21;break}m["X-Content-Fabric-Decryption-Mode"]="reencrypt";case 21:return e.t3=this,e.next=24,this.EncryptionConk({libraryId:r,objectId:n,download:!0});case 24:return e.t4=e.sent,e.t5=E,e.t6=C,e.t7=m,e.t8=I,e.t9=c,e.t10=h,e.t11={conk:e.t4,downloadPath:e.t5,bytesTotal:e.t6,headers:e.t7,callback:e.t8,format:e.t9,chunked:e.t10},e.next=34,e.t3.DownloadEncrypted.call(e.t3,e.t11);case 34:return e.abrupt("return",e.sent);case 37:return e.next=39,this.Download({downloadPath:E,bytesTotal:C,headers:m,callback:I,format:c,chunked:h,chunkSize:p});case 39:return e.abrupt("return",e.sent);case 40:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}(),t.Download=function(){var t=o(i.mark((function t(r){var n,o,a,s,A,c,u,f,h,l,g,d,p,I,y;return i.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n=r.downloadPath,o=r.headers,a=r.bytesTotal,s=r.chunked,A=void 0!==s&&s,c=r.chunkSize,u=void 0===c?2e6:c,f=r.callback,h=r.format,l=void 0===h?"arrayBuffer":h,!A||f){t.next=3;break}throw Error("No callback specified for chunked download");case 3:A||(g=[]),d=0,p=Math.ceil(a/u),I=0;case 7:if(!(I<p)){t.next=35;break}return o.Range="bytes=".concat(d,"-").concat(d+u-1),t.next=11,this.HttpClient.Request({path:n,headers:o,method:"GET"});case 11:if(y=t.sent,d=Math.min(d+u,a),!A){t.next=24;break}return t.t0=f,t.t1=d,t.t2=a,t.next=19,this.utils.ResponseToFormat(l,y);case 19:t.t3=t.sent,t.t4={bytesFinished:t.t1,bytesTotal:t.t2,chunk:t.t3},(0,t.t0)(t.t4),t.next=32;break;case 24:return t.t5=g,t.t6=e,t.next=28,y.arrayBuffer();case 28:t.t7=t.sent,t.t8=t.t6.from.call(t.t6,t.t7),t.t5.push.call(t.t5,t.t8),f&&f({bytesFinished:d,bytesTotal:a});case 32:I++,t.next=7;break;case 35:if(A){t.next=39;break}return t.next=38,this.utils.ResponseToFormat(l,new Response(e.concat(g)));case 38:return t.abrupt("return",t.sent);case 39:case"end":return t.stop()}}),t,this)})));return function(e){return t.apply(this,arguments)}}(),t.DownloadEncrypted=function(){var t=o(i.mark((function t(r){var n,a,s,A,c,u,f,h,l,g,d,p,I,y,b,E,m,C=this;return i.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n=r.conk,a=r.downloadPath,s=r.bytesTotal,A=r.headers,c=r.callback,u=r.format,f=void 0===u?"arrayBuffer":u,h=r.chunked,!(l=void 0!==h&&h)||c){t.next=3;break}throw Error("No callback specified for chunked download");case 3:return g=n.public_key.startsWith("ktpk"),d=this.Crypto.EncryptedBlockSize(1e6,g),p=0,f=f.toLowerCase(),I=[],t.next=10,this.Crypto.OpenDecryptionStream(n);case 10:(y=t.sent).on("data",function(){var e=o(i.mark((function e(t){var r;return i.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!l){e.next=13;break}if("buffer"===f){e.next=10;break}if(r=t.buffer.slice(t.byteOffset,t.byteOffset+t.byteLength),"arraybuffer"!==f){e.next=7;break}t=r,e.next=10;break;case 7:return e.next=9,C.utils.ResponseToFormat(f,new Response(r));case 9:t=e.sent;case 10:c({bytesFinished:p,bytesTotal:s,chunk:t}),e.next=15;break;case 13:c&&c({bytesFinished:p,bytesTotal:s}),I.push(t);case 15:case"end":return e.stop()}}),e)})));return function(t){return e.apply(this,arguments)}}()),b=Math.ceil(s/d),E=0;case 14:if(!(E<b)){t.next=30;break}return A.Range="bytes=".concat(p,"-").concat(p+d-1),t.next=18,this.HttpClient.Request({headers:A,method:"GET",path:a});case 18:return m=t.sent,p=Math.min(p+d,s),t.t0=y,t.t1=Uint8Array,t.next=24,m.arrayBuffer();case 24:t.t2=t.sent,t.t3=new t.t1(t.t2),t.t0.write.call(t.t0,t.t3);case 27:E++,t.next=14;break;case 30:return y.end(),t.next=33,new Promise((function(e){return y.on("finish",(function(){e()}))}));case 33:if(l){t.next=37;break}return t.next=36,this.utils.ResponseToFormat(f,new Response(e.concat(I)));case 36:return t.abrupt("return",t.sent);case 37:case"end":return t.stop()}}),t,this)})));return function(e){return t.apply(this,arguments)}}(),t.CreatePart=function(){var e=o(i.mark((function e(t){var r,n,o,a,s,A;return i.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.libraryId,n=t.objectId,o=t.writeToken,a=t.encryption,d({libraryId:r,objectId:n}),l(o),s=u("q",o,"parts"),e.t0=this.utils,e.t1=this.HttpClient,e.next=8,this.authClient.AuthorizationHeader({libraryId:r,objectId:n,update:!0,encryption:a});case 8:return e.t2=e.sent,e.t3=s,e.t4={headers:e.t2,method:"POST",path:e.t3,bodyType:"BINARY",body:"",failover:!1},e.t5=e.t1.Request.call(e.t1,e.t4),e.next=14,e.t0.ResponseToJson.call(e.t0,e.t5);case 14:return A=e.sent,e.abrupt("return",A.part.write_token);case 16:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}(),t.UploadPartChunk=function(){var e=o(i.mark((function e(t){var r,n,o,a,s,A,c,f;return i.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.libraryId,n=t.objectId,o=t.writeToken,a=t.partWriteToken,s=t.chunk,A=t.encryption,d({libraryId:r,objectId:n}),l(o),!A||"none"===A){e.next=10;break}return e.next=6,this.EncryptionConk({libraryId:r,objectId:n,writeToken:o});case 6:return c=e.sent,e.next=9,this.Crypto.Encrypt(c,s);case 9:s=e.sent;case 10:return f=u("q",o,"parts"),e.t0=this.utils,e.t1=this.HttpClient,e.next=15,this.authClient.AuthorizationHeader({libraryId:r,objectId:n,update:!0,encryption:A});case 15:return e.t2=e.sent,e.t3=u(f,a),e.t4=s,e.t5={headers:e.t2,method:"POST",path:e.t3,body:e.t4,bodyType:"BINARY",failover:!1},e.t6=e.t1.Request.call(e.t1,e.t5),e.next=22,e.t0.ResponseToJson.call(e.t0,e.t6);case 22:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}(),t.FinalizePart=function(){var e=o(i.mark((function e(t){var r,n,o,a,s,A;return i.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.libraryId,n=t.objectId,o=t.writeToken,a=t.partWriteToken,s=t.encryption,d({libraryId:r,objectId:n}),l(o),A=u("q",o,"parts"),e.t0=this.utils,e.t1=this.HttpClient,e.next=8,this.authClient.AuthorizationHeader({libraryId:r,objectId:n,update:!0,encryption:s});case 8:return e.t2=e.sent,e.t3=u(A,a),e.t4={headers:e.t2,method:"POST",path:e.t3,bodyType:"BINARY",body:"",failover:!1},e.next=13,e.t1.Request.call(e.t1,e.t4);case 13:return e.t5=e.sent,e.next=16,e.t0.ResponseToJson.call(e.t0,e.t5);case 16:return e.abrupt("return",e.sent);case 17:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}(),t.UploadPart=function(){var e=o(i.mark((function e(t){var r,n,o,a,s,A,c,u,f,h,g,p,I;return i.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.libraryId,n=t.objectId,o=t.writeToken,a=t.data,s=t.encryption,A=void 0===s?"none":s,c=t.chunkSize,u=void 0===c?1e7:c,f=t.callback,d({libraryId:r,objectId:n}),l(o),e.next=5,this.CreatePart({libraryId:r,objectId:n,writeToken:o,encryption:A});case 5:h=e.sent,g=a.length||a.byteLength||a.size,f&&f({bytesFinished:0,bytesTotal:g}),p=0;case 9:if(!(p<g)){e.next=17;break}return I=a.slice(p,p+u),e.next=13,this.UploadPartChunk({libraryId:r,objectId:n,writeToken:o,partWriteToken:h,chunk:I,encryption:A});case 13:f&&f({bytesFinished:Math.min(p+u,g),bytesTotal:g});case 14:p+=u,e.next=9;break;case 17:return e.next=19,this.FinalizePart({libraryId:r,objectId:n,writeToken:o,partWriteToken:h,encryption:A});case 19:return e.abrupt("return",e.sent);case 20:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}(),t.DeletePart=function(){var e=o(i.mark((function e(t){var r,n,o,a,s;return i.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.libraryId,n=t.objectId,o=t.writeToken,a=t.partHash,d({libraryId:r,objectId:n}),l(o),g(a),s=u("q",o,"parts",a),e.t0=this.HttpClient,e.next=8,this.authClient.AuthorizationHeader({libraryId:r,objectId:n,update:!0});case 8:return e.t1=e.sent,e.t2=s,e.t3={headers:e.t1,method:"DELETE",path:e.t2,failover:!1},e.next=13,e.t0.Request.call(e.t0,e.t3);case 13:case"end":return e.stop()}}),e,this)})));return function(t){return e.apply(this,arguments)}}()}).call(this,r(6).Buffer)},function(e,t){},function(e,t,r){"use strict";r.r(t),r.d(t,"ethers",(function(){return A})),r.d(t,"Signer",(function(){return On})),r.d(t,"Wallet",(function(){return rs})),r.d(t,"VoidSigner",(function(){return Nn})),r.d(t,"getDefaultProvider",(function(){return yh})),r.d(t,"providers",(function(){return o})),r.d(t,"BaseContract",(function(){return Ni})),r.d(t,"Contract",(function(){return Pi})),r.d(t,"ContractFactory",(function(){return Fi})),r.d(t,"BigNumber",(function(){return y})),r.d(t,"FixedNumber",(function(){return Xi})),r.d(t,"constants",(function(){return i})),r.d(t,"errors",(function(){return h.a})),r.d(t,"logger",(function(){return Sd})),r.d(t,"utils",(function(){return s})),r.d(t,"wordlists",(function(){return Yo})),r.d(t,"version",(function(){return _d})),r.d(t,"Wordlist",(function(){return Oo}));var n={};r.r(n),r.d(n,"encode",(function(){return Z})),r.d(n,"decode",(function(){return $}));var i={};r.r(i),r.d(i,"AddressZero",(function(){return os})),r.d(i,"NegativeOne",(function(){return Dt})),r.d(i,"Zero",(function(){return Mt})),r.d(i,"One",(function(){return Rt})),r.d(i,"Two",(function(){return xt})),r.d(i,"WeiPerEther",(function(){return Ot})),r.d(i,"MaxUint256",(function(){return Nt})),r.d(i,"MinInt256",(function(){return Pt})),r.d(i,"MaxInt256",(function(){return Ft})),r.d(i,"HashZero",(function(){return as})),r.d(i,"EtherSymbol",(function(){return ss}));var o={};r.r(o),r.d(o,"Provider",(function(){return En})),r.d(o,"BaseProvider",(function(){return qA})),r.d(o,"Resolver",(function(){return GA})),r.d(o,"UrlJsonRpcProvider",(function(){return zc})),r.d(o,"FallbackProvider",(function(){return yf})),r.d(o,"AlchemyProvider",(function(){return Au})),r.d(o,"AlchemyWebSocketProvider",(function(){return su})),r.d(o,"AnkrProvider",(function(){return bu})),r.d(o,"CloudflareProvider",(function(){return Mu})),r.d(o,"EtherscanProvider",(function(){return zu})),r.d(o,"InfuraProvider",(function(){return xf})),r.d(o,"InfuraWebSocketProvider",(function(){return Rf})),r.d(o,"JsonRpcProvider",(function(){return Ic})),r.d(o,"JsonRpcBatchProvider",(function(){return Lf})),r.d(o,"NodesmithProvider",(function(){return Zf})),r.d(o,"PocketProvider",(function(){return oh})),r.d(o,"StaticJsonRpcProvider",(function(){return Jc})),r.d(o,"Web3Provider",(function(){return ph})),r.d(o,"WebSocketProvider",(function(){return Rc})),r.d(o,"IpcProvider",(function(){return bf})),r.d(o,"JsonRpcSigner",(function(){return gc})),r.d(o,"getDefaultProvider",(function(){return yh})),r.d(o,"getNetwork",(function(){return ds})),r.d(o,"isCommunityResource",(function(){return fA})),r.d(o,"isCommunityResourcable",(function(){return uA})),r.d(o,"showThrottleMessage",(function(){return lA})),r.d(o,"Formatter",(function(){return cA}));var a={};r.r(a),r.d(a,"decode",(function(){return ps})),r.d(a,"encode",(function(){return Is}));var s={};r.r(s),r.d(s,"AbiCoder",(function(){return Pg})),r.d(s,"defaultAbiCoder",(function(){return Fg})),r.d(s,"Fragment",(function(){return bg})),r.d(s,"ConstructorFragment",(function(){return Bg})),r.d(s,"ErrorFragment",(function(){return kg})),r.d(s,"EventFragment",(function(){return Eg})),r.d(s,"FunctionFragment",(function(){return wg})),r.d(s,"ParamType",(function(){return Ig})),r.d(s,"FormatTypes",(function(){return dg})),r.d(s,"checkResultErrors",(function(){return vh})),r.d(s,"Logger",(function(){return h.b})),r.d(s,"RLP",(function(){return n})),r.d(s,"_fetchData",(function(){return rA})),r.d(s,"fetchJson",(function(){return nA})),r.d(s,"poll",(function(){return iA})),r.d(s,"checkProperties",(function(){return M})),r.d(s,"deepCopy",(function(){return N})),r.d(s,"defineReadOnly",(function(){return _})),r.d(s,"getStatic",(function(){return S})),r.d(s,"resolveProperties",(function(){return D})),r.d(s,"shallowCopy",(function(){return R})),r.d(s,"arrayify",(function(){return c.a})),r.d(s,"concat",(function(){return c.b})),r.d(s,"stripZeros",(function(){return c.o})),r.d(s,"zeroPad",(function(){return c.p})),r.d(s,"isBytes",(function(){return c.j})),r.d(s,"isBytesLike",(function(){return c.k})),r.d(s,"defaultPath",(function(){return ea})),r.d(s,"HDNode",(function(){return ta})),r.d(s,"SigningKey",(function(){return Ln})),r.d(s,"Interface",(function(){return ed})),r.d(s,"LogDescription",(function(){return zg})),r.d(s,"TransactionDescription",(function(){return Vg})),r.d(s,"base58",(function(){return vo})),r.d(s,"base64",(function(){return a})),r.d(s,"hexlify",(function(){return c.i})),r.d(s,"isHexString",(function(){return c.l})),r.d(s,"hexConcat",(function(){return c.c})),r.d(s,"hexStripZeros",(function(){return c.f})),r.d(s,"hexValue",(function(){return c.g})),r.d(s,"hexZeroPad",(function(){return c.h})),r.d(s,"hexDataLength",(function(){return c.d})),r.d(s,"hexDataSlice",(function(){return c.e})),r.d(s,"nameprep",(function(){return yd})),r.d(s,"_toEscapedUtf8String",(function(){return me})),r.d(s,"toUtf8Bytes",(function(){return be})),r.d(s,"toUtf8CodePoints",(function(){return Be})),r.d(s,"toUtf8String",(function(){return ve})),r.d(s,"Utf8ErrorFuncs",(function(){return Ie})),r.d(s,"formatBytes32String",(function(){return bd})),r.d(s,"parseBytes32String",(function(){return Ed})),r.d(s,"dnsEncode",(function(){return zs})),r.d(s,"hashMessage",(function(){return to})),r.d(s,"namehash",(function(){return Js})),r.d(s,"isValidName",(function(){return qs})),r.d(s,"id",(function(){return we})),r.d(s,"_TypedDataEncoder",(function(){return bo})),r.d(s,"getAddress",(function(){return Ae})),r.d(s,"getIcapAddress",(function(){return ue})),r.d(s,"getContractAddress",(function(){return fe})),r.d(s,"getCreate2Address",(function(){return he})),r.d(s,"isAddress",(function(){return ce})),r.d(s,"formatEther",(function(){return Qd})),r.d(s,"parseEther",(function(){return kd})),r.d(s,"formatUnits",(function(){return Bd})),r.d(s,"parseUnits",(function(){return wd})),r.d(s,"commify",(function(){return vd})),r.d(s,"computeHmac",(function(){return Do})),r.d(s,"keccak256",(function(){return q})),r.d(s,"ripemd160",(function(){return ko})),r.d(s,"sha256",(function(){return _o})),r.d(s,"sha512",(function(){return So})),r.d(s,"randomBytes",(function(){return sa.a})),r.d(s,"shuffled",(function(){return Vu})),r.d(s,"solidityPack",(function(){return od})),r.d(s,"solidityKeccak256",(function(){return ad})),r.d(s,"soliditySha256",(function(){return sd})),r.d(s,"splitSignature",(function(){return c.n})),r.d(s,"joinSignature",(function(){return c.m})),r.d(s,"accessListify",(function(){return ei})),r.d(s,"parseTransaction",(function(){return ai})),r.d(s,"serializeTransaction",(function(){return ii})),r.d(s,"TransactionTypes",(function(){return Yn})),r.d(s,"getJsonWalletAddress",(function(){return Ya})),r.d(s,"computeAddress",(function(){return Zn})),r.d(s,"recoverAddress",(function(){return Wn})),r.d(s,"computePublicKey",(function(){return Gn})),r.d(s,"recoverPublicKey",(function(){return Hn})),r.d(s,"verifyMessage",(function(){return ns})),r.d(s,"verifyTypedData",(function(){return is})),r.d(s,"getAccountPath",(function(){return aa})),r.d(s,"mnemonicToEntropy",(function(){return na})),r.d(s,"entropyToMnemonic",(function(){return ia})),r.d(s,"isValidMnemonic",(function(){return oa})),r.d(s,"mnemonicToSeed",(function(){return ra})),r.d(s,"SupportedAlgorithm",(function(){return mo})),r.d(s,"UnicodeNormalizationForm",(function(){return le})),r.d(s,"Utf8ErrorReason",(function(){return ge})),r.d(s,"Indexed",(function(){return Wg}));var A={};r.r(A),r.d(A,"Signer",(function(){return On})),r.d(A,"Wallet",(function(){return rs})),r.d(A,"VoidSigner",(function(){return Nn})),r.d(A,"getDefaultProvider",(function(){return yh})),r.d(A,"providers",(function(){return o})),r.d(A,"BaseContract",(function(){return Ni})),r.d(A,"Contract",(function(){return Pi})),r.d(A,"ContractFactory",(function(){return Fi})),r.d(A,"BigNumber",(function(){return y})),r.d(A,"FixedNumber",(function(){return Xi})),r.d(A,"constants",(function(){return i})),r.d(A,"errors",(function(){return h.a})),r.d(A,"logger",(function(){return Sd})),r.d(A,"utils",(function(){return s})),r.d(A,"wordlists",(function(){return Yo})),r.d(A,"version",(function(){return _d})),r.d(A,"Wordlist",(function(){return Oo}));var c=r(0),u=r(2),f=r.n(u),h=r(1);function l(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}var g=f.a.BN,d=new h.b("bignumber/5.7.0"),p={};var I=!1,y=function(){function e(t,r){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),t!==p&&d.throwError("cannot call constructor directly; use BigNumber.from",h.b.errors.UNSUPPORTED_OPERATION,{operation:"new (BigNumber)"}),this._hex=r,this._isBigNumber=!0,Object.freeze(this)}var t,r,n;return t=e,n=[{key:"from",value:function(t){if(t instanceof e)return t;if("string"==typeof t)return t.match(/^-?0x[0-9a-f]+$/i)?new e(p,b(t)):t.match(/^-?[0-9]+$/)?new e(p,b(new g(t))):d.throwArgumentError("invalid BigNumber string","value",t);if("number"==typeof t)return t%1&&C("underflow","BigNumber.from",t),(t>=9007199254740991||t<=-9007199254740991)&&C("overflow","BigNumber.from",t),e.from(String(t));var r=t;if("bigint"==typeof r)return e.from(r.toString());if(Object(c.j)(r))return e.from(Object(c.i)(r));if(r)if(r.toHexString){var n=r.toHexString();if("string"==typeof n)return e.from(n)}else{var i=r._hex;if(null==i&&"BigNumber"===r.type&&(i=r.hex),"string"==typeof i&&(Object(c.l)(i)||"-"===i[0]&&Object(c.l)(i.substring(1))))return e.from(i)}return d.throwArgumentError("invalid BigNumber value","value",t)}},{key:"isBigNumber",value:function(e){return!(!e||!e._isBigNumber)}}],(r=[{key:"fromTwos",value:function(e){return E(m(this).fromTwos(e))}},{key:"toTwos",value:function(e){return E(m(this).toTwos(e))}},{key:"abs",value:function(){return"-"===this._hex[0]?e.from(this._hex.substring(1)):this}},{key:"add",value:function(e){return E(m(this).add(m(e)))}},{key:"sub",value:function(e){return E(m(this).sub(m(e)))}},{key:"div",value:function(t){return e.from(t).isZero()&&C("division-by-zero","div"),E(m(this).div(m(t)))}},{key:"mul",value:function(e){return E(m(this).mul(m(e)))}},{key:"mod",value:function(e){var t=m(e);return t.isNeg()&&C("division-by-zero","mod"),E(m(this).umod(t))}},{key:"pow",value:function(e){var t=m(e);return t.isNeg()&&C("negative-power","pow"),E(m(this).pow(t))}},{key:"and",value:function(e){var t=m(e);return(this.isNegative()||t.isNeg())&&C("unbound-bitwise-result","and"),E(m(this).and(t))}},{key:"or",value:function(e){var t=m(e);return(this.isNegative()||t.isNeg())&&C("unbound-bitwise-result","or"),E(m(this).or(t))}},{key:"xor",value:function(e){var t=m(e);return(this.isNegative()||t.isNeg())&&C("unbound-bitwise-result","xor"),E(m(this).xor(t))}},{key:"mask",value:function(e){return(this.isNegative()||e<0)&&C("negative-width","mask"),E(m(this).maskn(e))}},{key:"shl",value:function(e){return(this.isNegative()||e<0)&&C("negative-width","shl"),E(m(this).shln(e))}},{key:"shr",value:function(e){return(this.isNegative()||e<0)&&C("negative-width","shr"),E(m(this).shrn(e))}},{key:"eq",value:function(e){return m(this).eq(m(e))}},{key:"lt",value:function(e){return m(this).lt(m(e))}},{key:"lte",value:function(e){return m(this).lte(m(e))}},{key:"gt",value:function(e){return m(this).gt(m(e))}},{key:"gte",value:function(e){return m(this).gte(m(e))}},{key:"isNegative",value:function(){return"-"===this._hex[0]}},{key:"isZero",value:function(){return m(this).isZero()}},{key:"toNumber",value:function(){try{return m(this).toNumber()}catch(e){C("overflow","toNumber",this.toString())}return null}},{key:"toBigInt",value:function(){try{return BigInt(this.toString())}catch(e){}return d.throwError("this platform does not support BigInt",h.b.errors.UNSUPPORTED_OPERATION,{value:this.toString()})}},{key:"toString",value:function(){return arguments.length>0&&(10===arguments[0]?I||(I=!0,d.warn("BigNumber.toString does not accept any parameters; base-10 is assumed")):16===arguments[0]?d.throwError("BigNumber.toString does not accept any parameters; use bigNumber.toHexString()",h.b.errors.UNEXPECTED_ARGUMENT,{}):d.throwError("BigNumber.toString does not accept parameters",h.b.errors.UNEXPECTED_ARGUMENT,{})),m(this).toString(10)}},{key:"toHexString",value:function(){return this._hex}},{key:"toJSON",value:function(e){return{type:"BigNumber",hex:this.toHexString()}}}])&&l(t.prototype,r),n&&l(t,n),Object.defineProperty(t,"prototype",{writable:!1}),e}();function b(e){if("string"!=typeof e)return b(e.toString(16));if("-"===e[0])return"-"===(e=e.substring(1))[0]&&d.throwArgumentError("invalid hex","value",e),"0x00"===(e=b(e))?e:"-"+e;if("0x"!==e.substring(0,2)&&(e="0x"+e),"0x"===e)return"0x00";for(e.length%2&&(e="0x0"+e.substring(2));e.length>4&&"0x00"===e.substring(0,4);)e="0x"+e.substring(4);return e}function E(e){return y.from(b(e))}function m(e){var t=y.from(e).toHexString();return"-"===t[0]?new g("-"+t.substring(3),16):new g(t.substring(2),16)}function C(e,t,r){var n={fault:e,operation:t};return null!=r&&(n.value=r),d.throwError(e,h.b.errors.NUMERIC_FAULT,n)}function v(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function B(e,t,r){return t&&v(e.prototype,t),r&&v(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function w(e){return(w="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var Q=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{A(n.next(e))}catch(e){o(e)}}function s(e){try{A(n.throw(e))}catch(e){o(e)}}function A(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}A((n=n.apply(e,t||[])).next())}))},k=new h.b("properties/5.7.0");function _(e,t,r){Object.defineProperty(e,t,{enumerable:!0,value:r,writable:!1})}function S(e,t){for(var r=0;r<32;r++){if(e[t])return e[t];if(!e.prototype||"object"!==w(e.prototype))break;e=Object.getPrototypeOf(e.prototype).constructor}return null}function D(e){return Q(this,void 0,void 0,regeneratorRuntime.mark((function t(){var r,n;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=Object.keys(e).map((function(t){var r=e[t];return Promise.resolve(r).then((function(e){return{key:t,value:e}}))})),t.next=3,Promise.all(r);case 3:return n=t.sent,t.abrupt("return",n.reduce((function(e,t){return e[t.key]=t.value,e}),{}));case 5:case"end":return t.stop()}}),t)})))}function M(e,t){e&&"object"===w(e)||k.throwArgumentError("invalid object","object",e),Object.keys(e).forEach((function(r){t[r]||k.throwArgumentError("invalid object key - "+r,"transaction:"+r,e)}))}function R(e){var t={};for(var r in e)t[r]=e[r];return t}var x={bigint:!0,boolean:!0,function:!0,number:!0,string:!0};function O(e){if(function e(t){if(null==t||x[w(t)])return!0;if(Array.isArray(t)||"object"===w(t)){if(!Object.isFrozen(t))return!1;for(var r=Object.keys(t),n=0;n<r.length;n++){var i=null;try{i=t[r[n]]}catch(e){continue}if(!e(i))return!1}return!0}return k.throwArgumentError("Cannot deepCopy ".concat(w(t)),"object",t)}(e))return e;if(Array.isArray(e))return Object.freeze(e.map((function(e){return N(e)})));if("object"===w(e)){var t={};for(var r in e){var n=e[r];void 0!==n&&_(t,r,N(n))}return t}return k.throwArgumentError("Cannot deepCopy ".concat(w(e)),"object",e)}function N(e){return O(e)}var P=B((function e(t){for(var r in function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),t)this[r]=N(t[r])}));function F(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function j(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function T(e,t,r){return t&&j(e.prototype,t),r&&j(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}var U=new h.b("abi/5.7.0");var L=function(){function e(t,r,n,i){F(this,e),this.name=t,this.type=r,this.localName=n,this.dynamic=i}return T(e,[{key:"_throwError",value:function(e,t){U.throwArgumentError(e,this.localName,t)}}]),e}(),H=function(){function e(t){F(this,e),_(this,"wordSize",t||32),this._data=[],this._dataLength=0,this._padding=new Uint8Array(t)}return T(e,[{key:"data",get:function(){return Object(c.c)(this._data)}},{key:"length",get:function(){return this._dataLength}},{key:"_writeData",value:function(e){return this._data.push(e),this._dataLength+=e.length,e.length}},{key:"appendWriter",value:function(e){return this._writeData(Object(c.b)(e._data))}},{key:"writeBytes",value:function(e){var t=Object(c.a)(e),r=t.length%this.wordSize;return r&&(t=Object(c.b)([t,this._padding.slice(r)])),this._writeData(t)}},{key:"_getValue",value:function(e){var t=Object(c.a)(y.from(e));return t.length>this.wordSize&&U.throwError("value out-of-bounds",h.b.errors.BUFFER_OVERRUN,{length:this.wordSize,offset:t.length}),t.length%this.wordSize&&(t=Object(c.b)([this._padding.slice(t.length%this.wordSize),t])),t}},{key:"writeValue",value:function(e){return this._writeData(this._getValue(e))}},{key:"writeUpdatableValue",value:function(){var e=this,t=this._data.length;return this._data.push(this._padding),this._dataLength+=this.wordSize,function(r){e._data[t]=e._getValue(r)}}}]),e}(),G=function(){function e(t,r,n,i){F(this,e),_(this,"_data",Object(c.a)(t)),_(this,"wordSize",r||32),_(this,"_coerceFunc",n),_(this,"allowLoose",i),this._offset=0}return T(e,[{key:"data",get:function(){return Object(c.i)(this._data)}},{key:"consumed",get:function(){return this._offset}},{key:"coerce",value:function(t,r){return this._coerceFunc?this._coerceFunc(t,r):e.coerce(t,r)}},{key:"_peekBytes",value:function(e,t,r){var n=Math.ceil(t/this.wordSize)*this.wordSize;return this._offset+n>this._data.length&&(this.allowLoose&&r&&this._offset+t<=this._data.length?n=t:U.throwError("data out-of-bounds",h.b.errors.BUFFER_OVERRUN,{length:this._data.length,offset:this._offset+n})),this._data.slice(this._offset,this._offset+n)}},{key:"subReader",value:function(t){return new e(this._data.slice(this._offset+t),this.wordSize,this._coerceFunc,this.allowLoose)}},{key:"readBytes",value:function(e,t){var r=this._peekBytes(0,e,!!t);return this._offset+=r.length,r.slice(0,e)}},{key:"readValue",value:function(){return y.from(this.readBytes(this.wordSize))}}],[{key:"coerce",value:function(e,t){var r=e.match("^u?int([0-9]+)$");return r&&parseInt(r[1])<=48&&(t=t.toNumber()),t}}]),e}(),Y=r(167),K=r.n(Y);function q(e){return"0x"+K.a.keccak_256(Object(c.a)(e))}var J=new h.b("rlp/5.7.0");function z(e){for(var t=[];e;)t.unshift(255&e),e>>=8;return t}function V(e,t,r){for(var n=0,i=0;i<r;i++)n=256*n+e[t+i];return n}function Z(e){return Object(c.i)(function e(t){if(Array.isArray(t)){var r=[];if(t.forEach((function(t){r=r.concat(e(t))})),r.length<=55)return r.unshift(192+r.length),r;var n=z(r.length);return n.unshift(247+n.length),n.concat(r)}Object(c.k)(t)||J.throwArgumentError("RLP object must be BytesLike","object",t);var i=Array.prototype.slice.call(Object(c.a)(t));if(1===i.length&&i[0]<=127)return i;if(i.length<=55)return i.unshift(128+i.length),i;var o=z(i.length);return o.unshift(183+o.length),o.concat(i)}(e))}function W(e,t,r,n){for(var i=[];r<t+1+n;){var o=X(e,r);i.push(o.result),(r+=o.consumed)>t+1+n&&J.throwError("child data too short",h.b.errors.BUFFER_OVERRUN,{})}return{consumed:1+n,result:i}}function X(e,t){if(0===e.length&&J.throwError("data too short",h.b.errors.BUFFER_OVERRUN,{}),e[t]>=248){var r=e[t]-247;t+1+r>e.length&&J.throwError("data short segment too short",h.b.errors.BUFFER_OVERRUN,{});var n=V(e,t+1,r);return t+1+r+n>e.length&&J.throwError("data long segment too short",h.b.errors.BUFFER_OVERRUN,{}),W(e,t,t+1+r,r+n)}if(e[t]>=192){var i=e[t]-192;return t+1+i>e.length&&J.throwError("data array too short",h.b.errors.BUFFER_OVERRUN,{}),W(e,t,t+1,i)}if(e[t]>=184){var o=e[t]-183;t+1+o>e.length&&J.throwError("data array too short",h.b.errors.BUFFER_OVERRUN,{});var a=V(e,t+1,o);return t+1+o+a>e.length&&J.throwError("data array too short",h.b.errors.BUFFER_OVERRUN,{}),{consumed:1+o+a,result:Object(c.i)(e.slice(t+1+o,t+1+o+a))}}if(e[t]>=128){var s=e[t]-128;return t+1+s>e.length&&J.throwError("data too short",h.b.errors.BUFFER_OVERRUN,{}),{consumed:1+s,result:Object(c.i)(e.slice(t+1,t+1+s))}}return{consumed:1,result:Object(c.i)(e[t])}}function $(e){var t=Object(c.a)(e),r=X(t,0);return r.consumed!==t.length&&J.throwArgumentError("invalid rlp data","data",e),r.result}var ee=new h.b("address/5.7.0");function te(e){Object(c.l)(e,20)||ee.throwArgumentError("invalid address","address",e);for(var t=(e=e.toLowerCase()).substring(2).split(""),r=new Uint8Array(40),n=0;n<40;n++)r[n]=t[n].charCodeAt(0);for(var i=Object(c.a)(q(r)),o=0;o<40;o+=2)i[o>>1]>>4>=8&&(t[o]=t[o].toUpperCase()),(15&i[o>>1])>=8&&(t[o+1]=t[o+1].toUpperCase());return"0x"+t.join("")}for(var re={},ne=0;ne<10;ne++)re[String(ne)]=String(ne);for(var ie=0;ie<26;ie++)re[String.fromCharCode(65+ie)]=String(10+ie);var oe,ae=Math.floor((oe=9007199254740991,Math.log10?Math.log10(oe):Math.log(oe)/Math.LN10));function se(e){for(var t=(e=(e=e.toUpperCase()).substring(4)+e.substring(0,2)+"00").split("").map((function(e){return re[e]})).join("");t.length>=ae;){var r=t.substring(0,ae);t=parseInt(r,10)%97+t.substring(r.length)}for(var n=String(98-parseInt(t,10)%97);n.length<2;)n="0"+n;return n}function Ae(e){var t,r=null;if("string"!=typeof e&&ee.throwArgumentError("invalid address","address",e),e.match(/^(0x)?[0-9a-fA-F]{40}$/))"0x"!==e.substring(0,2)&&(e="0x"+e),r=te(e),e.match(/([A-F].*[a-f])|([a-f].*[A-F])/)&&r!==e&&ee.throwArgumentError("bad address checksum","address",e);else if(e.match(/^XE[0-9]{2}[0-9A-Za-z]{30,31}$/)){for(e.substring(2,4)!==se(e)&&ee.throwArgumentError("bad icap checksum","address",e),t=e.substring(4),r=new g(t,36).toString(16);r.length<40;)r="0"+r;r=te("0x"+r)}else ee.throwArgumentError("invalid address","address",e);return r}function ce(e){try{return Ae(e),!0}catch(e){}return!1}function ue(e){for(var t,r=(t=Ae(e).substring(2),new g(t,16).toString(36)).toUpperCase();r.length<30;)r="0"+r;return"XE"+se("XE00"+r)+r}function fe(e){var t=null;try{t=Ae(e.from)}catch(t){ee.throwArgumentError("missing from address","transaction",e)}var r=Object(c.o)(Object(c.a)(y.from(e.nonce).toHexString()));return Ae(Object(c.e)(q(Z([t,r])),12))}function he(e,t,r){return 32!==Object(c.d)(t)&&ee.throwArgumentError("salt must be 32 bytes","salt",t),32!==Object(c.d)(r)&&ee.throwArgumentError("initCodeHash must be 32 bytes","initCodeHash",r),Ae(Object(c.e)(q(Object(c.b)(["0xff",Ae(e),t,r])),12))}var le,ge,de=new h.b("strings/5.7.0");function pe(e,t,r,n,i){if(e===ge.BAD_PREFIX||e===ge.UNEXPECTED_CONTINUE){for(var o=0,a=t+1;a<r.length&&r[a]>>6==2;a++)o++;return o}return e===ge.OVERRUN?r.length-t-1:0}!function(e){e.current="",e.NFC="NFC",e.NFD="NFD",e.NFKC="NFKC",e.NFKD="NFKD"}(le||(le={})),function(e){e.UNEXPECTED_CONTINUE="unexpected continuation byte",e.BAD_PREFIX="bad codepoint prefix",e.OVERRUN="string overrun",e.MISSING_CONTINUE="missing continuation byte",e.OUT_OF_RANGE="out of UTF-8 range",e.UTF16_SURROGATE="UTF-16 surrogate",e.OVERLONG="overlong representation"}(ge||(ge={}));var Ie=Object.freeze({error:function(e,t,r,n,i){return de.throwArgumentError("invalid codepoint at offset ".concat(t,"; ").concat(e),"bytes",r)},ignore:pe,replace:function(e,t,r,n,i){return e===ge.OVERLONG?(n.push(i),0):(n.push(65533),pe(e,t,r))}});function ye(e,t){null==t&&(t=Ie.error),e=Object(c.a)(e);for(var r=[],n=0;n<e.length;){var i=e[n++];if(i>>7!=0){var o=null,a=null;if(192==(224&i))o=1,a=127;else if(224==(240&i))o=2,a=2047;else{if(240!=(248&i)){n+=t(128==(192&i)?ge.UNEXPECTED_CONTINUE:ge.BAD_PREFIX,n-1,e,r);continue}o=3,a=65535}if(n-1+o>=e.length)n+=t(ge.OVERRUN,n-1,e,r);else{for(var s=i&(1<<8-o-1)-1,A=0;A<o;A++){var u=e[n];if(128!=(192&u)){n+=t(ge.MISSING_CONTINUE,n,e,r),s=null;break}s=s<<6|63&u,n++}null!==s&&(s>1114111?n+=t(ge.OUT_OF_RANGE,n-1-o,e,r,s):s>=55296&&s<=57343?n+=t(ge.UTF16_SURROGATE,n-1-o,e,r,s):s<=a?n+=t(ge.OVERLONG,n-1-o,e,r,s):r.push(s))}}else r.push(i)}return r}function be(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:le.current;t!=le.current&&(de.checkNormalize(),e=e.normalize(t));for(var r=[],n=0;n<e.length;n++){var i=e.charCodeAt(n);if(i<128)r.push(i);else if(i<2048)r.push(i>>6|192),r.push(63&i|128);else if(55296==(64512&i)){n++;var o=e.charCodeAt(n);if(n>=e.length||56320!=(64512&o))throw new Error("invalid utf-8 string");var a=65536+((1023&i)<<10)+(1023&o);r.push(a>>18|240),r.push(a>>12&63|128),r.push(a>>6&63|128),r.push(63&a|128)}else r.push(i>>12|224),r.push(i>>6&63|128),r.push(63&i|128)}return Object(c.a)(r)}function Ee(e){var t="0000"+e.toString(16);return"\\u"+t.substring(t.length-4)}function me(e,t){return'"'+ye(e,t).map((function(e){if(e<256){switch(e){case 8:return"\\b";case 9:return"\\t";case 10:return"\\n";case 13:return"\\r";case 34:return'\\"';case 92:return"\\\\"}if(e>=32&&e<127)return String.fromCharCode(e)}return e<=65535?Ee(e):Ee(55296+((e-=65536)>>10&1023))+Ee(56320+(1023&e))})).join("")+'"'}function Ce(e){return e.map((function(e){return e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode(55296+(e>>10&1023),56320+(1023&e)))})).join("")}function ve(e,t){return Ce(ye(e,t))}function Be(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:le.current;return ye(be(e,t))}function we(e){return q(be(e))}function Qe(e){return(Qe="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function ke(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function _e(e,t){return(_e=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Se(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=Me(e);if(t){var i=Me(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return De(this,r)}}function De(e,t){if(t&&("object"===Qe(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function Me(e){return(Me=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var Re=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&_e(e,t)}(o,e);var t,r,n,i=Se(o);function o(e){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,o),i.call(this,"address","address",e,!1)}return t=o,(r=[{key:"defaultValue",value:function(){return"0x0000000000000000000000000000000000000000"}},{key:"encode",value:function(e,t){try{t=Ae(t)}catch(e){this._throwError(e.message,t)}return e.writeValue(t)}},{key:"decode",value:function(e){return Ae(Object(c.h)(e.readValue().toHexString(),20))}}])&&ke(t.prototype,r),n&&ke(t,n),Object.defineProperty(t,"prototype",{writable:!1}),o}(L);function xe(e){return(xe="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Oe(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function Ne(e,t){return(Ne=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Pe(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=je(e);if(t){var i=je(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return Fe(this,r)}}function Fe(e,t){if(t&&("object"===xe(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function je(e){return(je=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var Te=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Ne(e,t)}(o,e);var t,r,n,i=Pe(o);function o(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,o),(t=i.call(this,e.name,e.type,void 0,e.dynamic)).coder=e,t}return t=o,(r=[{key:"defaultValue",value:function(){return this.coder.defaultValue()}},{key:"encode",value:function(e,t){return this.coder.encode(e,t)}},{key:"decode",value:function(e){return this.coder.decode(e)}}])&&Oe(t.prototype,r),n&&Oe(t,n),Object.defineProperty(t,"prototype",{writable:!1}),o}(L);function Ue(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function Le(e,t){return(Le=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function He(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=Ye(e);if(t){var i=Ye(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return Ge(this,r)}}function Ge(e,t){if(t&&("object"===Ke(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function Ye(e){return(Ye=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Ke(e){return(Ke="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var qe=new h.b("abi/5.7.0");function Je(e,t,r){var n=null;if(Array.isArray(r))n=r;else if(r&&"object"===Ke(r)){var i={};n=t.map((function(e){var t=e.localName;return t||qe.throwError("cannot encode object for signature with missing names",h.b.errors.INVALID_ARGUMENT,{argument:"values",coder:e,value:r}),i[t]&&qe.throwError("cannot encode object for signature with duplicate names",h.b.errors.INVALID_ARGUMENT,{argument:"values",coder:e,value:r}),i[t]=!0,r[t]}))}else qe.throwArgumentError("invalid tuple value","tuple",r);t.length!==n.length&&qe.throwArgumentError("types/value length mismatch","tuple",r);var o=new H(e.wordSize),a=new H(e.wordSize),s=[];t.forEach((function(e,t){var r=n[t];if(e.dynamic){var i=a.length;e.encode(a,r);var A=o.writeUpdatableValue();s.push((function(e){A(e+i)}))}else e.encode(o,r)})),s.forEach((function(e){e(o.length)}));var A=e.appendWriter(o);return A+=e.appendWriter(a)}function ze(e,t){var r=[],n=e.subReader(0);t.forEach((function(t){var i=null;if(t.dynamic){var o=e.readValue(),a=n.subReader(o.toNumber());try{i=t.decode(a)}catch(e){if(e.code===h.b.errors.BUFFER_OVERRUN)throw e;(i=e).baseType=t.name,i.name=t.localName,i.type=t.type}}else try{i=t.decode(e)}catch(e){if(e.code===h.b.errors.BUFFER_OVERRUN)throw e;(i=e).baseType=t.name,i.name=t.localName,i.type=t.type}null!=i&&r.push(i)}));var i=t.reduce((function(e,t){var r=t.localName;return r&&(e[r]||(e[r]=0),e[r]++),e}),{});t.forEach((function(e,t){var n=e.localName;if(n&&1===i[n]&&("length"===n&&(n="_length"),null==r[n])){var o=r[t];o instanceof Error?Object.defineProperty(r,n,{enumerable:!0,get:function(){throw o}}):r[n]=o}}));for(var o=function(e){var t=r[e];t instanceof Error&&Object.defineProperty(r,e,{enumerable:!0,get:function(){throw t}})},a=0;a<r.length;a++)o(a);return Object.freeze(r)}var Ve=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Le(e,t)}(o,e);var t,r,n,i=He(o);function o(e,t,r){var n;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,o);var a=e.type+"["+(t>=0?t:"")+"]",s=-1===t||e.dynamic;return(n=i.call(this,"array",a,r,s)).coder=e,n.length=t,n}return t=o,(r=[{key:"defaultValue",value:function(){for(var e=this.coder.defaultValue(),t=[],r=0;r<this.length;r++)t.push(e);return t}},{key:"encode",value:function(e,t){Array.isArray(t)||this._throwError("expected array value",t);var r=this.length;-1===r&&(r=t.length,e.writeValue(t.length)),qe.checkArgumentCount(t.length,r,"coder array"+(this.localName?" "+this.localName:""));for(var n=[],i=0;i<t.length;i++)n.push(this.coder);return Je(e,n,t)}},{key:"decode",value:function(e){var t=this.length;-1===t&&32*(t=e.readValue().toNumber())>e._data.length&&qe.throwError("insufficient data length",h.b.errors.BUFFER_OVERRUN,{length:e._data.length,count:t});for(var r=[],n=0;n<t;n++)r.push(new Te(this.coder));return e.coerce(this.name,ze(e,r))}}])&&Ue(t.prototype,r),n&&Ue(t,n),Object.defineProperty(t,"prototype",{writable:!1}),o}(L);function Ze(e){return(Ze="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function We(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function Xe(e,t){return(Xe=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function $e(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=tt(e);if(t){var i=tt(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return et(this,r)}}function et(e,t){if(t&&("object"===Ze(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function tt(e){return(tt=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var rt=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Xe(e,t)}(o,e);var t,r,n,i=$e(o);function o(e){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,o),i.call(this,"bool","bool",e,!1)}return t=o,(r=[{key:"defaultValue",value:function(){return!1}},{key:"encode",value:function(e,t){return e.writeValue(t?1:0)}},{key:"decode",value:function(e){return e.coerce(this.type,!e.readValue().isZero())}}])&&We(t.prototype,r),n&&We(t,n),Object.defineProperty(t,"prototype",{writable:!1}),o}(L);function nt(e){return(nt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function it(){return(it="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,r){var n=ot(e,t);if(n){var i=Object.getOwnPropertyDescriptor(n,t);return i.get?i.get.call(arguments.length<3?e:r):i.value}}).apply(this,arguments)}function ot(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=lt(e)););return e}function at(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function st(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function At(e,t,r){return t&&st(e.prototype,t),r&&st(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function ct(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&ut(e,t)}function ut(e,t){return(ut=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function ft(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=lt(e);if(t){var i=lt(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return ht(this,r)}}function ht(e,t){if(t&&("object"===nt(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function lt(e){return(lt=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var gt=function(e){ct(r,e);var t=ft(r);function r(e,n){return at(this,r),t.call(this,e,e,n,!0)}return At(r,[{key:"defaultValue",value:function(){return"0x"}},{key:"encode",value:function(e,t){t=Object(c.a)(t);var r=e.writeValue(t.length);return r+=e.writeBytes(t)}},{key:"decode",value:function(e){return e.readBytes(e.readValue().toNumber(),!0)}}]),r}(L),dt=function(e){ct(r,e);var t=ft(r);function r(e){return at(this,r),t.call(this,"bytes",e)}return At(r,[{key:"decode",value:function(e){return e.coerce(this.name,Object(c.i)(it(lt(r.prototype),"decode",this).call(this,e)))}}]),r}(gt);function pt(e){return(pt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function It(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function yt(e,t){return(yt=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function bt(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=mt(e);if(t){var i=mt(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return Et(this,r)}}function Et(e,t){if(t&&("object"===pt(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function mt(e){return(mt=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var Ct=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&yt(e,t)}(o,e);var t,r,n,i=bt(o);function o(e,t){var r;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,o);var n="bytes"+String(e);return(r=i.call(this,n,n,t,!1)).size=e,r}return t=o,(r=[{key:"defaultValue",value:function(){return"0x0000000000000000000000000000000000000000000000000000000000000000".substring(0,2+2*this.size)}},{key:"encode",value:function(e,t){var r=Object(c.a)(t);return r.length!==this.size&&this._throwError("incorrect data length",t),e.writeBytes(r)}},{key:"decode",value:function(e){return e.coerce(this.name,Object(c.i)(e.readBytes(this.size)))}}])&&It(t.prototype,r),n&&It(t,n),Object.defineProperty(t,"prototype",{writable:!1}),o}(L);function vt(e){return(vt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Bt(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function wt(e,t){return(wt=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Qt(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=_t(e);if(t){var i=_t(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return kt(this,r)}}function kt(e,t){if(t&&("object"===vt(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function _t(e){return(_t=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var St=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&wt(e,t)}(o,e);var t,r,n,i=Qt(o);function o(e){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,o),i.call(this,"null","",e,!1)}return t=o,(r=[{key:"defaultValue",value:function(){return null}},{key:"encode",value:function(e,t){return null!=t&&this._throwError("not null",t),e.writeBytes([])}},{key:"decode",value:function(e){return e.readBytes(0),e.coerce(this.name,null)}}])&&Bt(t.prototype,r),n&&Bt(t,n),Object.defineProperty(t,"prototype",{writable:!1}),o}(L),Dt=y.from(-1),Mt=y.from(0),Rt=y.from(1),xt=y.from(2),Ot=y.from("1000000000000000000"),Nt=y.from("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"),Pt=y.from("-0x8000000000000000000000000000000000000000000000000000000000000000"),Ft=y.from("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");function jt(e){return(jt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Tt(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function Ut(e,t){return(Ut=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Lt(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=Gt(e);if(t){var i=Gt(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return Ht(this,r)}}function Ht(e,t){if(t&&("object"===jt(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function Gt(e){return(Gt=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var Yt=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Ut(e,t)}(o,e);var t,r,n,i=Lt(o);function o(e,t,r){var n;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,o);var a=(t?"int":"uint")+8*e;return(n=i.call(this,a,a,r,!1)).size=e,n.signed=t,n}return t=o,(r=[{key:"defaultValue",value:function(){return 0}},{key:"encode",value:function(e,t){var r=y.from(t),n=Nt.mask(8*e.wordSize);if(this.signed){var i=n.mask(8*this.size-1);(r.gt(i)||r.lt(i.add(Rt).mul(Dt)))&&this._throwError("value out-of-bounds",t)}else(r.lt(Mt)||r.gt(n.mask(8*this.size)))&&this._throwError("value out-of-bounds",t);return r=r.toTwos(8*this.size).mask(8*this.size),this.signed&&(r=r.fromTwos(8*this.size).toTwos(8*e.wordSize)),e.writeValue(r)}},{key:"decode",value:function(e){var t=e.readValue().mask(8*this.size);return this.signed&&(t=t.fromTwos(8*this.size)),e.coerce(this.name,t)}}])&&Tt(t.prototype,r),n&&Tt(t,n),Object.defineProperty(t,"prototype",{writable:!1}),o}(L);function Kt(e){return(Kt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function qt(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function Jt(){return(Jt="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,r){var n=zt(e,t);if(n){var i=Object.getOwnPropertyDescriptor(n,t);return i.get?i.get.call(arguments.length<3?e:r):i.value}}).apply(this,arguments)}function zt(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=Xt(e)););return e}function Vt(e,t){return(Vt=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Zt(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=Xt(e);if(t){var i=Xt(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return Wt(this,r)}}function Wt(e,t){if(t&&("object"===Kt(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function Xt(e){return(Xt=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var $t=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Vt(e,t)}(o,e);var t,r,n,i=Zt(o);function o(e){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,o),i.call(this,"string",e)}return t=o,(r=[{key:"defaultValue",value:function(){return""}},{key:"encode",value:function(e,t){return Jt(Xt(o.prototype),"encode",this).call(this,e,be(t))}},{key:"decode",value:function(e){return ve(Jt(Xt(o.prototype),"decode",this).call(this,e))}}])&&qt(t.prototype,r),n&&qt(t,n),Object.defineProperty(t,"prototype",{writable:!1}),o}(gt);function er(e){return(er="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function tr(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function rr(e,t){return(rr=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function nr(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=or(e);if(t){var i=or(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return ir(this,r)}}function ir(e,t){if(t&&("object"===er(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function or(e){return(or=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var ar=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&rr(e,t)}(o,e);var t,r,n,i=nr(o);function o(e,t){var r;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,o);var n=!1,a=[];e.forEach((function(e){e.dynamic&&(n=!0),a.push(e.type)}));var s="tuple("+a.join(",")+")";return(r=i.call(this,"tuple",s,t,n)).coders=e,r}return t=o,(r=[{key:"defaultValue",value:function(){var e=[];this.coders.forEach((function(t){e.push(t.defaultValue())}));var t=this.coders.reduce((function(e,t){var r=t.localName;return r&&(e[r]||(e[r]=0),e[r]++),e}),{});return this.coders.forEach((function(r,n){var i=r.localName;i&&1===t[i]&&("length"===i&&(i="_length"),null==e[i]&&(e[i]=e[n]))})),Object.freeze(e)}},{key:"encode",value:function(e,t){return Je(e,this.coders,t)}},{key:"decode",value:function(e){return e.coerce(this.name,ze(e,this.coders))}}])&&tr(t.prototype,r),n&&tr(t,n),Object.defineProperty(t,"prototype",{writable:!1}),o}(L);function sr(e){return(sr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Ar(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&cr(e,t)}function cr(e,t){return(cr=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function ur(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=hr(e);if(t){var i=hr(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return fr(this,r)}}function fr(e,t){if(t&&("object"===sr(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function hr(e){return(hr=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function lr(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function gr(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function dr(e,t,r){return t&&gr(e.prototype,t),r&&gr(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}var pr=new h.b("abi/5.7.0"),Ir={},yr={calldata:!0,memory:!0,storage:!0},br={calldata:!0,memory:!0};function Er(e,t){if("bytes"===e||"string"===e){if(yr[t])return!0}else if("address"===e){if("payable"===t)return!0}else if((e.indexOf("[")>=0||"tuple"===e)&&br[t])return!0;return(yr[t]||"payable"===t)&&pr.throwArgumentError("invalid modifier","name",t),!1}function mr(e,t){for(var r in t)_(e,r,t[r])}var Cr=Object.freeze({sighash:"sighash",minimal:"minimal",full:"full",json:"json"}),vr=new RegExp(/^(.*)\[([0-9]*)\]$/),Br=function(){function e(t,r){lr(this,e),t!==Ir&&pr.throwError("use fromString",h.b.errors.UNSUPPORTED_OPERATION,{operation:"new ParamType()"}),mr(this,r);var n=this.type.match(vr);mr(this,n?{arrayLength:parseInt(n[2]||"-1"),arrayChildren:e.fromObject({type:n[1],components:this.components}),baseType:"array"}:{arrayLength:null,arrayChildren:null,baseType:null!=this.components?"tuple":this.type}),this._isParamType=!0,Object.freeze(this)}return dr(e,[{key:"format",value:function(e){if(e||(e=Cr.sighash),Cr[e]||pr.throwArgumentError("invalid format type","format",e),e===Cr.json){var t={type:"tuple"===this.baseType?"tuple":this.type,name:this.name||void 0};return"boolean"==typeof this.indexed&&(t.indexed=this.indexed),this.components&&(t.components=this.components.map((function(t){return JSON.parse(t.format(e))}))),JSON.stringify(t)}var r="";return"array"===this.baseType?(r+=this.arrayChildren.format(e),r+="["+(this.arrayLength<0?"":String(this.arrayLength))+"]"):"tuple"===this.baseType?(e!==Cr.sighash&&(r+=this.type),r+="("+this.components.map((function(t){return t.format(e)})).join(e===Cr.full?", ":",")+")"):r+=this.type,e!==Cr.sighash&&(!0===this.indexed&&(r+=" indexed"),e===Cr.full&&this.name&&(r+=" "+this.name)),r}}],[{key:"from",value:function(t,r){return"string"==typeof t?e.fromString(t,r):e.fromObject(t)}},{key:"fromObject",value:function(t){return e.isParamType(t)?t:new e(Ir,{name:t.name||null,type:Nr(t.type),indexed:null==t.indexed?null:!!t.indexed,components:t.components?t.components.map(e.fromObject):null})}},{key:"fromString",value:function(t,r){return function(t){return e.fromObject({name:t.name,type:t.type,indexed:t.indexed,components:t.components})}(function(e,t){var r=e;function n(t){pr.throwArgumentError("unexpected character at position ".concat(t),"param",e)}function i(e){var r={type:"",name:"",parent:e,state:{allowType:!0}};return t&&(r.indexed=!1),r}e=e.replace(/\s/g," ");for(var o={type:"",name:"",state:{allowType:!0}},a=o,s=0;s<e.length;s++){var A=e[s];switch(A){case"(":a.state.allowType&&""===a.type?a.type="tuple":a.state.allowParams||n(s),a.state.allowType=!1,a.type=Nr(a.type),a.components=[i(a)],a=a.components[0];break;case")":delete a.state,"indexed"===a.name&&(t||n(s),a.indexed=!0,a.name=""),Er(a.type,a.name)&&(a.name=""),a.type=Nr(a.type);var c=a;(a=a.parent)||n(s),delete c.parent,a.state.allowParams=!1,a.state.allowName=!0,a.state.allowArray=!0;break;case",":delete a.state,"indexed"===a.name&&(t||n(s),a.indexed=!0,a.name=""),Er(a.type,a.name)&&(a.name=""),a.type=Nr(a.type);var u=i(a.parent);a.parent.components.push(u),delete a.parent,a=u;break;case" ":a.state.allowType&&""!==a.type&&(a.type=Nr(a.type),delete a.state.allowType,a.state.allowName=!0,a.state.allowParams=!0),a.state.allowName&&""!==a.name&&("indexed"===a.name?(t||n(s),a.indexed&&n(s),a.indexed=!0,a.name=""):Er(a.type,a.name)?a.name="":a.state.allowName=!1);break;case"[":a.state.allowArray||n(s),a.type+=A,a.state.allowArray=!1,a.state.allowName=!1,a.state.readArray=!0;break;case"]":a.state.readArray||n(s),a.type+=A,a.state.readArray=!1,a.state.allowArray=!0,a.state.allowName=!0;break;default:a.state.allowType?(a.type+=A,a.state.allowParams=!0,a.state.allowArray=!0):a.state.allowName?(a.name+=A,delete a.state.allowArray):a.state.readArray?a.type+=A:n(s)}}return a.parent&&pr.throwArgumentError("unexpected eof","param",e),delete o.state,"indexed"===a.name?(t||n(r.length-7),a.indexed&&n(r.length-7),a.indexed=!0,a.name=""):Er(a.type,a.name)&&(a.name=""),o.type=Nr(o.type),o}(t,!!r))}},{key:"isParamType",value:function(e){return!(null==e||!e._isParamType)}}]),e}();function wr(e,t){return function(e){e=e.trim();for(var t=[],r="",n=0,i=0;i<e.length;i++){var o=e[i];","===o&&0===n?(t.push(r),r=""):(r+=o,"("===o?n++:")"===o&&-1===--n&&pr.throwArgumentError("unbalanced parenthesis","value",e))}r&&t.push(r);return t}(e).map((function(e){return Br.fromString(e,t)}))}var Qr=function(){function e(t,r){lr(this,e),t!==Ir&&pr.throwError("use a static from method",h.b.errors.UNSUPPORTED_OPERATION,{operation:"new Fragment()"}),mr(this,r),this._isFragment=!0,Object.freeze(this)}return dr(e,null,[{key:"from",value:function(t){return e.isFragment(t)?t:"string"==typeof t?e.fromString(t):e.fromObject(t)}},{key:"fromObject",value:function(t){if(e.isFragment(t))return t;switch(t.type){case"function":return Rr.fromObject(t);case"event":return kr.fromObject(t);case"constructor":return Mr.fromObject(t);case"error":return Or.fromObject(t);case"fallback":case"receive":return null}return pr.throwArgumentError("invalid fragment object","value",t)}},{key:"fromString",value:function(e){return"event"===(e=(e=(e=e.replace(/\s/g," ")).replace(/\(/g," (").replace(/\)/g,") ").replace(/\s+/g," ")).trim()).split(" ")[0]?kr.fromString(e.substring(5).trim()):"function"===e.split(" ")[0]?Rr.fromString(e.substring(8).trim()):"constructor"===e.split("(")[0].trim()?Mr.fromString(e.trim()):"error"===e.split(" ")[0]?Or.fromString(e.substring(5).trim()):pr.throwArgumentError("unsupported fragment","value",e)}},{key:"isFragment",value:function(e){return!(!e||!e._isFragment)}}]),e}(),kr=function(e){Ar(r,e);var t=ur(r);function r(){return lr(this,r),t.apply(this,arguments)}return dr(r,[{key:"format",value:function(e){if(e||(e=Cr.sighash),Cr[e]||pr.throwArgumentError("invalid format type","format",e),e===Cr.json)return JSON.stringify({type:"event",anonymous:this.anonymous,name:this.name,inputs:this.inputs.map((function(t){return JSON.parse(t.format(e))}))});var t="";return e!==Cr.sighash&&(t+="event "),t+=this.name+"("+this.inputs.map((function(t){return t.format(e)})).join(e===Cr.full?", ":",")+") ",e!==Cr.sighash&&this.anonymous&&(t+="anonymous "),t.trim()}}],[{key:"from",value:function(e){return"string"==typeof e?r.fromString(e):r.fromObject(e)}},{key:"fromObject",value:function(e){if(r.isEventFragment(e))return e;"event"!==e.type&&pr.throwArgumentError("invalid event object","value",e);var t={name:Fr(e.name),anonymous:e.anonymous,inputs:e.inputs?e.inputs.map(Br.fromObject):[],type:"event"};return new r(Ir,t)}},{key:"fromString",value:function(e){var t=e.match(jr);t||pr.throwArgumentError("invalid event string","value",e);var n=!1;return t[3].split(" ").forEach((function(e){switch(e.trim()){case"anonymous":n=!0;break;case"":break;default:pr.warn("unknown modifier: "+e)}})),r.fromObject({name:t[1].trim(),anonymous:n,inputs:wr(t[2],!0),type:"event"})}},{key:"isEventFragment",value:function(e){return e&&e._isFragment&&"event"===e.type}}]),r}(Qr);function _r(e,t){t.gas=null;var r=e.split("@");return 1!==r.length?(r.length>2&&pr.throwArgumentError("invalid human-readable ABI signature","value",e),r[1].match(/^[0-9]+$/)||pr.throwArgumentError("invalid human-readable ABI signature gas","value",e),t.gas=y.from(r[1]),r[0]):e}function Sr(e,t){t.constant=!1,t.payable=!1,t.stateMutability="nonpayable",e.split(" ").forEach((function(e){switch(e.trim()){case"constant":t.constant=!0;break;case"payable":t.payable=!0,t.stateMutability="payable";break;case"nonpayable":t.payable=!1,t.stateMutability="nonpayable";break;case"pure":t.constant=!0,t.stateMutability="pure";break;case"view":t.constant=!0,t.stateMutability="view";break;case"external":case"public":case"":break;default:console.log("unknown modifier: "+e)}}))}function Dr(e){var t={constant:!1,payable:!0,stateMutability:"payable"};return null!=e.stateMutability?(t.stateMutability=e.stateMutability,t.constant="view"===t.stateMutability||"pure"===t.stateMutability,null!=e.constant&&!!e.constant!==t.constant&&pr.throwArgumentError("cannot have constant function with mutability "+t.stateMutability,"value",e),t.payable="payable"===t.stateMutability,null!=e.payable&&!!e.payable!==t.payable&&pr.throwArgumentError("cannot have payable function with mutability "+t.stateMutability,"value",e)):null!=e.payable?(t.payable=!!e.payable,null!=e.constant||t.payable||"constructor"===e.type||pr.throwArgumentError("unable to determine stateMutability","value",e),t.constant=!!e.constant,t.constant?t.stateMutability="view":t.stateMutability=t.payable?"payable":"nonpayable",t.payable&&t.constant&&pr.throwArgumentError("cannot have constant payable function","value",e)):null!=e.constant?(t.constant=!!e.constant,t.payable=!t.constant,t.stateMutability=t.constant?"view":"payable"):"constructor"!==e.type&&pr.throwArgumentError("unable to determine stateMutability","value",e),t}var Mr=function(e){Ar(r,e);var t=ur(r);function r(){return lr(this,r),t.apply(this,arguments)}return dr(r,[{key:"format",value:function(e){if(e||(e=Cr.sighash),Cr[e]||pr.throwArgumentError("invalid format type","format",e),e===Cr.json)return JSON.stringify({type:"constructor",stateMutability:"nonpayable"!==this.stateMutability?this.stateMutability:void 0,payable:this.payable,gas:this.gas?this.gas.toNumber():void 0,inputs:this.inputs.map((function(t){return JSON.parse(t.format(e))}))});e===Cr.sighash&&pr.throwError("cannot format a constructor for sighash",h.b.errors.UNSUPPORTED_OPERATION,{operation:"format(sighash)"});var t="constructor("+this.inputs.map((function(t){return t.format(e)})).join(e===Cr.full?", ":",")+") ";return this.stateMutability&&"nonpayable"!==this.stateMutability&&(t+=this.stateMutability+" "),t.trim()}}],[{key:"from",value:function(e){return"string"==typeof e?r.fromString(e):r.fromObject(e)}},{key:"fromObject",value:function(e){if(r.isConstructorFragment(e))return e;"constructor"!==e.type&&pr.throwArgumentError("invalid constructor object","value",e);var t=Dr(e);t.constant&&pr.throwArgumentError("constructor cannot be constant","value",e);var n={name:null,type:e.type,inputs:e.inputs?e.inputs.map(Br.fromObject):[],payable:t.payable,stateMutability:t.stateMutability,gas:e.gas?y.from(e.gas):null};return new r(Ir,n)}},{key:"fromString",value:function(e){var t={type:"constructor"},n=(e=_r(e,t)).match(jr);return n&&"constructor"===n[1].trim()||pr.throwArgumentError("invalid constructor string","value",e),t.inputs=wr(n[2].trim(),!1),Sr(n[3].trim(),t),r.fromObject(t)}},{key:"isConstructorFragment",value:function(e){return e&&e._isFragment&&"constructor"===e.type}}]),r}(Qr),Rr=function(e){Ar(r,e);var t=ur(r);function r(){return lr(this,r),t.apply(this,arguments)}return dr(r,[{key:"format",value:function(e){if(e||(e=Cr.sighash),Cr[e]||pr.throwArgumentError("invalid format type","format",e),e===Cr.json)return JSON.stringify({type:"function",name:this.name,constant:this.constant,stateMutability:"nonpayable"!==this.stateMutability?this.stateMutability:void 0,payable:this.payable,gas:this.gas?this.gas.toNumber():void 0,inputs:this.inputs.map((function(t){return JSON.parse(t.format(e))})),outputs:this.outputs.map((function(t){return JSON.parse(t.format(e))}))});var t="";return e!==Cr.sighash&&(t+="function "),t+=this.name+"("+this.inputs.map((function(t){return t.format(e)})).join(e===Cr.full?", ":",")+") ",e!==Cr.sighash&&(this.stateMutability?"nonpayable"!==this.stateMutability&&(t+=this.stateMutability+" "):this.constant&&(t+="view "),this.outputs&&this.outputs.length&&(t+="returns ("+this.outputs.map((function(t){return t.format(e)})).join(", ")+") "),null!=this.gas&&(t+="@"+this.gas.toString()+" ")),t.trim()}}],[{key:"from",value:function(e){return"string"==typeof e?r.fromString(e):r.fromObject(e)}},{key:"fromObject",value:function(e){if(r.isFunctionFragment(e))return e;"function"!==e.type&&pr.throwArgumentError("invalid function object","value",e);var t=Dr(e),n={type:e.type,name:Fr(e.name),constant:t.constant,inputs:e.inputs?e.inputs.map(Br.fromObject):[],outputs:e.outputs?e.outputs.map(Br.fromObject):[],payable:t.payable,stateMutability:t.stateMutability,gas:e.gas?y.from(e.gas):null};return new r(Ir,n)}},{key:"fromString",value:function(e){var t={type:"function"},n=(e=_r(e,t)).split(" returns ");n.length>2&&pr.throwArgumentError("invalid function string","value",e);var i=n[0].match(jr);if(i||pr.throwArgumentError("invalid function signature","value",e),t.name=i[1].trim(),t.name&&Fr(t.name),t.inputs=wr(i[2],!1),Sr(i[3].trim(),t),n.length>1){var o=n[1].match(jr);""==o[1].trim()&&""==o[3].trim()||pr.throwArgumentError("unexpected tokens","value",e),t.outputs=wr(o[2],!1)}else t.outputs=[];return r.fromObject(t)}},{key:"isFunctionFragment",value:function(e){return e&&e._isFragment&&"function"===e.type}}]),r}(Mr);function xr(e){var t=e.format();return"Error(string)"!==t&&"Panic(uint256)"!==t||pr.throwArgumentError("cannot specify user defined ".concat(t," error"),"fragment",e),e}var Or=function(e){Ar(r,e);var t=ur(r);function r(){return lr(this,r),t.apply(this,arguments)}return dr(r,[{key:"format",value:function(e){if(e||(e=Cr.sighash),Cr[e]||pr.throwArgumentError("invalid format type","format",e),e===Cr.json)return JSON.stringify({type:"error",name:this.name,inputs:this.inputs.map((function(t){return JSON.parse(t.format(e))}))});var t="";return e!==Cr.sighash&&(t+="error "),(t+=this.name+"("+this.inputs.map((function(t){return t.format(e)})).join(e===Cr.full?", ":",")+") ").trim()}}],[{key:"from",value:function(e){return"string"==typeof e?r.fromString(e):r.fromObject(e)}},{key:"fromObject",value:function(e){if(r.isErrorFragment(e))return e;"error"!==e.type&&pr.throwArgumentError("invalid error object","value",e);var t={type:e.type,name:Fr(e.name),inputs:e.inputs?e.inputs.map(Br.fromObject):[]};return xr(new r(Ir,t))}},{key:"fromString",value:function(e){var t={type:"error"},n=e.match(jr);return n||pr.throwArgumentError("invalid error signature","value",e),t.name=n[1].trim(),t.name&&Fr(t.name),t.inputs=wr(n[2],!1),xr(r.fromObject(t))}},{key:"isErrorFragment",value:function(e){return e&&e._isFragment&&"error"===e.type}}]),r}(Qr);function Nr(e){return e.match(/^uint($|[^1-9])/)?e="uint256"+e.substring(4):e.match(/^int($|[^1-9])/)&&(e="int256"+e.substring(3)),e}var Pr=new RegExp("^[a-zA-Z$_][a-zA-Z0-9$_]*$");function Fr(e){return e&&e.match(Pr)||pr.throwArgumentError('invalid identifier "'.concat(e,'"'),"value",e),e}var jr=new RegExp("^([^)(]*)\\((.*)\\)([^)(]*)$");function Tr(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}var Ur=new h.b("abi/5.7.0"),Lr=new RegExp(/^bytes([0-9]*)$/),Hr=new RegExp(/^(u?int)([0-9]*)$/),Gr=new(function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),_(this,"coerceFunc",t||null)}var t,r,n;return t=e,(r=[{key:"_getCoder",value:function(e){var t=this;switch(e.baseType){case"address":return new Re(e.name);case"bool":return new rt(e.name);case"string":return new $t(e.name);case"bytes":return new dt(e.name);case"array":return new Ve(this._getCoder(e.arrayChildren),e.arrayLength,e.name);case"tuple":return new ar((e.components||[]).map((function(e){return t._getCoder(e)})),e.name);case"":return new St(e.name)}var r=e.type.match(Hr);if(r){var n=parseInt(r[2]||"256");return(0===n||n>256||n%8!=0)&&Ur.throwArgumentError("invalid "+r[1]+" bit length","param",e),new Yt(n/8,"int"===r[1],e.name)}if(r=e.type.match(Lr)){var i=parseInt(r[1]);return(0===i||i>32)&&Ur.throwArgumentError("invalid bytes length","param",e),new Ct(i,e.name)}return Ur.throwArgumentError("invalid type","type",e.type)}},{key:"_getWordSize",value:function(){return 32}},{key:"_getReader",value:function(e,t){return new G(e,this._getWordSize(),this.coerceFunc,t)}},{key:"_getWriter",value:function(){return new H(this._getWordSize())}},{key:"getDefaultValue",value:function(e){var t=this,r=e.map((function(e){return t._getCoder(Br.from(e))}));return new ar(r,"_").defaultValue()}},{key:"encode",value:function(e,t){var r=this;e.length!==t.length&&Ur.throwError("types/values length mismatch",h.b.errors.INVALID_ARGUMENT,{count:{types:e.length,values:t.length},value:{types:e,values:t}});var n=e.map((function(e){return r._getCoder(Br.from(e))})),i=new ar(n,"_"),o=this._getWriter();return i.encode(o,t),o.data}},{key:"decode",value:function(e,t,r){var n=this,i=e.map((function(e){return n._getCoder(Br.from(e))}));return new ar(i,"_").decode(this._getReader(Object(c.a)(t),r))}}])&&Tr(t.prototype,r),n&&Tr(t,n),Object.defineProperty(t,"prototype",{writable:!1}),e}());function Yr(e){return(Yr="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Kr(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function qr(e,t,r){return t&&Kr(e.prototype,t),r&&Kr(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function Jr(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function zr(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Vr(e,t)}function Vr(e,t){return(Vr=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Zr(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=Xr(e);if(t){var i=Xr(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return Wr(this,r)}}function Wr(e,t){if(t&&("object"===Yr(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function Xr(e){return(Xr=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var $r=new h.b("abi/5.7.0"),en=function(e){zr(r,e);var t=Zr(r);function r(){return Jr(this,r),t.apply(this,arguments)}return qr(r)}(P),tn=function(e){zr(r,e);var t=Zr(r);function r(){return Jr(this,r),t.apply(this,arguments)}return qr(r)}(P),rn=function(e){zr(r,e);var t=Zr(r);function r(){return Jr(this,r),t.apply(this,arguments)}return qr(r)}(P),nn=function(e){zr(r,e);var t=Zr(r);function r(){return Jr(this,r),t.apply(this,arguments)}return qr(r,null,[{key:"isIndexed",value:function(e){return!(!e||!e._isIndexed)}}]),r}(P),on={"0x08c379a0":{signature:"Error(string)",name:"Error",inputs:["string"],reason:!0},"0x4e487b71":{signature:"Panic(uint256)",name:"Panic",inputs:["uint256"]}};function an(e,t){var r=new Error("deferred error during ABI decoding triggered accessing ".concat(e));return r.error=t,r}var sn=function(){function e(t){var r=this;Jr(this,e);_(this,"fragments",("string"==typeof t?JSON.parse(t):t).map((function(e){return Qr.from(e)})).filter((function(e){return null!=e}))),_(this,"_abiCoder",S(this instanceof e?this.constructor:void 0,"getAbiCoder")()),_(this,"functions",{}),_(this,"errors",{}),_(this,"events",{}),_(this,"structs",{}),this.fragments.forEach((function(e){var t=null;switch(e.type){case"constructor":return r.deploy?void $r.warn("duplicate definition - constructor"):void _(r,"deploy",e);case"function":t=r.functions;break;case"event":t=r.events;break;case"error":t=r.errors;break;default:return}var n=e.format();t[n]?$r.warn("duplicate definition - "+n):t[n]=e})),this.deploy||_(this,"deploy",Mr.from({payable:!1,type:"constructor"})),_(this,"_isInterface",!0)}return qr(e,[{key:"format",value:function(e){e||(e=Cr.full),e===Cr.sighash&&$r.throwArgumentError("interface does not support formatting sighash","format",e);var t=this.fragments.map((function(t){return t.format(e)}));return e===Cr.json?JSON.stringify(t.map((function(e){return JSON.parse(e)}))):t}},{key:"getFunction",value:function(e){if(Object(c.l)(e)){for(var t in this.functions)if(e===this.getSighash(t))return this.functions[t];$r.throwArgumentError("no matching function","sighash",e)}if(-1===e.indexOf("(")){var r=e.trim(),n=Object.keys(this.functions).filter((function(e){return e.split("(")[0]===r}));return 0===n.length?$r.throwArgumentError("no matching function","name",r):n.length>1&&$r.throwArgumentError("multiple matching functions","name",r),this.functions[n[0]]}var i=this.functions[Rr.fromString(e).format()];return i||$r.throwArgumentError("no matching function","signature",e),i}},{key:"getEvent",value:function(e){if(Object(c.l)(e)){var t=e.toLowerCase();for(var r in this.events)if(t===this.getEventTopic(r))return this.events[r];$r.throwArgumentError("no matching event","topichash",t)}if(-1===e.indexOf("(")){var n=e.trim(),i=Object.keys(this.events).filter((function(e){return e.split("(")[0]===n}));return 0===i.length?$r.throwArgumentError("no matching event","name",n):i.length>1&&$r.throwArgumentError("multiple matching events","name",n),this.events[i[0]]}var o=this.events[kr.fromString(e).format()];return o||$r.throwArgumentError("no matching event","signature",e),o}},{key:"getError",value:function(e){if(Object(c.l)(e)){var t=S(this.constructor,"getSighash");for(var r in this.errors){if(e===t(this.errors[r]))return this.errors[r]}$r.throwArgumentError("no matching error","sighash",e)}if(-1===e.indexOf("(")){var n=e.trim(),i=Object.keys(this.errors).filter((function(e){return e.split("(")[0]===n}));return 0===i.length?$r.throwArgumentError("no matching error","name",n):i.length>1&&$r.throwArgumentError("multiple matching errors","name",n),this.errors[i[0]]}var o=this.errors[Rr.fromString(e).format()];return o||$r.throwArgumentError("no matching error","signature",e),o}},{key:"getSighash",value:function(e){if("string"==typeof e)try{e=this.getFunction(e)}catch(t){try{e=this.getError(e)}catch(e){throw t}}return S(this.constructor,"getSighash")(e)}},{key:"getEventTopic",value:function(e){return"string"==typeof e&&(e=this.getEvent(e)),S(this.constructor,"getEventTopic")(e)}},{key:"_decodeParams",value:function(e,t){return this._abiCoder.decode(e,t)}},{key:"_encodeParams",value:function(e,t){return this._abiCoder.encode(e,t)}},{key:"encodeDeploy",value:function(e){return this._encodeParams(this.deploy.inputs,e||[])}},{key:"decodeErrorResult",value:function(e,t){"string"==typeof e&&(e=this.getError(e));var r=Object(c.a)(t);return Object(c.i)(r.slice(0,4))!==this.getSighash(e)&&$r.throwArgumentError("data signature does not match error ".concat(e.name,"."),"data",Object(c.i)(r)),this._decodeParams(e.inputs,r.slice(4))}},{key:"encodeErrorResult",value:function(e,t){return"string"==typeof e&&(e=this.getError(e)),Object(c.i)(Object(c.b)([this.getSighash(e),this._encodeParams(e.inputs,t||[])]))}},{key:"decodeFunctionData",value:function(e,t){"string"==typeof e&&(e=this.getFunction(e));var r=Object(c.a)(t);return Object(c.i)(r.slice(0,4))!==this.getSighash(e)&&$r.throwArgumentError("data signature does not match function ".concat(e.name,"."),"data",Object(c.i)(r)),this._decodeParams(e.inputs,r.slice(4))}},{key:"encodeFunctionData",value:function(e,t){return"string"==typeof e&&(e=this.getFunction(e)),Object(c.i)(Object(c.b)([this.getSighash(e),this._encodeParams(e.inputs,t||[])]))}},{key:"decodeFunctionResult",value:function(e,t){"string"==typeof e&&(e=this.getFunction(e));var r=Object(c.a)(t),n=null,i="",o=null,a=null,s=null;switch(r.length%this._abiCoder._getWordSize()){case 0:try{return this._abiCoder.decode(e.outputs,r)}catch(f){}break;case 4:var A=Object(c.i)(r.slice(0,4)),u=on[A];if(u)o=this._abiCoder.decode(u.inputs,r.slice(4)),a=u.name,s=u.signature,u.reason&&(n=o[0]),"Error"===a?i="; VM Exception while processing transaction: reverted with reason string ".concat(JSON.stringify(o[0])):"Panic"===a&&(i="; VM Exception while processing transaction: reverted with panic code ".concat(o[0]));else try{var f=this.getError(A);o=this._abiCoder.decode(f.inputs,r.slice(4)),a=f.name,s=f.format()}catch(f){}}return $r.throwError("call revert exception"+i,h.b.errors.CALL_EXCEPTION,{method:e.format(),data:Object(c.i)(t),errorArgs:o,errorName:a,errorSignature:s,reason:n})}},{key:"encodeFunctionResult",value:function(e,t){return"string"==typeof e&&(e=this.getFunction(e)),Object(c.i)(this._abiCoder.encode(e.outputs,t||[]))}},{key:"encodeFilterTopics",value:function(e,t){var r=this;"string"==typeof e&&(e=this.getEvent(e)),t.length>e.inputs.length&&$r.throwError("too many arguments for "+e.format(),h.b.errors.UNEXPECTED_ARGUMENT,{argument:"values",value:t});var n=[];e.anonymous||n.push(this.getEventTopic(e));var i=function(e,t){return"string"===e.type?we(t):"bytes"===e.type?q(Object(c.i)(t)):("bool"===e.type&&"boolean"==typeof t&&(t=t?"0x01":"0x00"),e.type.match(/^u?int/)&&(t=y.from(t).toHexString()),"address"===e.type&&r._abiCoder.encode(["address"],[t]),Object(c.h)(Object(c.i)(t),32))};for(t.forEach((function(t,r){var o=e.inputs[r];o.indexed?null==t?n.push(null):"array"===o.baseType||"tuple"===o.baseType?$r.throwArgumentError("filtering with tuples or arrays not supported","contract."+o.name,t):Array.isArray(t)?n.push(t.map((function(e){return i(o,e)}))):n.push(i(o,t)):null!=t&&$r.throwArgumentError("cannot filter non-indexed parameters; must be null","contract."+o.name,t)}));n.length&&null===n[n.length-1];)n.pop();return n}},{key:"encodeEventLog",value:function(e,t){var r=this;"string"==typeof e&&(e=this.getEvent(e));var n=[],i=[],o=[];return e.anonymous||n.push(this.getEventTopic(e)),t.length!==e.inputs.length&&$r.throwArgumentError("event arguments/values mismatch","values",t),e.inputs.forEach((function(e,a){var s=t[a];if(e.indexed)if("string"===e.type)n.push(we(s));else if("bytes"===e.type)n.push(q(s));else{if("tuple"===e.baseType||"array"===e.baseType)throw new Error("not implemented");n.push(r._abiCoder.encode([e.type],[s]))}else i.push(e),o.push(s)})),{data:this._abiCoder.encode(i,o),topics:n}}},{key:"decodeEventLog",value:function(e,t,r){if("string"==typeof e&&(e=this.getEvent(e)),null!=r&&!e.anonymous){var n=this.getEventTopic(e);Object(c.l)(r[0],32)&&r[0].toLowerCase()===n||$r.throwError("fragment/topic mismatch",h.b.errors.INVALID_ARGUMENT,{argument:"topics[0]",expected:n,value:r[0]}),r=r.slice(1)}var i=[],o=[],a=[];e.inputs.forEach((function(e,t){e.indexed?"string"===e.type||"bytes"===e.type||"tuple"===e.baseType||"array"===e.baseType?(i.push(Br.fromObject({type:"bytes32",name:e.name})),a.push(!0)):(i.push(e),a.push(!1)):(o.push(e),a.push(!1))}));var s=null!=r?this._abiCoder.decode(i,Object(c.b)(r)):null,A=this._abiCoder.decode(o,t,!0),u=[],f=0,l=0;e.inputs.forEach((function(e,t){if(e.indexed)if(null==s)u[t]=new nn({_isIndexed:!0,hash:null});else if(a[t])u[t]=new nn({_isIndexed:!0,hash:s[l++]});else try{u[t]=s[l++]}catch(e){u[t]=e}else try{u[t]=A[f++]}catch(e){u[t]=e}if(e.name&&null==u[e.name]){var r=u[t];r instanceof Error?Object.defineProperty(u,e.name,{enumerable:!0,get:function(){throw an("property ".concat(JSON.stringify(e.name)),r)}}):u[e.name]=r}}));for(var g=function(e){var t=u[e];t instanceof Error&&Object.defineProperty(u,e,{enumerable:!0,get:function(){throw an("index ".concat(e),t)}})},d=0;d<u.length;d++)g(d);return Object.freeze(u)}},{key:"parseTransaction",value:function(e){var t=this.getFunction(e.data.substring(0,10).toLowerCase());return t?new tn({args:this._abiCoder.decode(t.inputs,"0x"+e.data.substring(10)),functionFragment:t,name:t.name,signature:t.format(),sighash:this.getSighash(t),value:y.from(e.value||"0")}):null}},{key:"parseLog",value:function(e){var t=this.getEvent(e.topics[0]);return!t||t.anonymous?null:new en({eventFragment:t,name:t.name,signature:t.format(),topic:this.getEventTopic(t),args:this.decodeEventLog(t,e.data,e.topics)})}},{key:"parseError",value:function(e){var t=Object(c.i)(e),r=this.getError(t.substring(0,10).toLowerCase());return r?new rn({args:this._abiCoder.decode(r.inputs,"0x"+t.substring(10)),errorFragment:r,name:r.name,signature:r.format(),sighash:this.getSighash(r)}):null}}],[{key:"getAbiCoder",value:function(){return Gr}},{key:"getAddress",value:function(e){return Ae(e)}},{key:"getSighash",value:function(e){return Object(c.e)(we(e.format()),0,4)}},{key:"getEventTopic",value:function(e){return we(e.format())}},{key:"isInterface",value:function(e){return!(!e||!e._isInterface)}}]),e}();function An(e){return(An="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function cn(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function un(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function fn(e,t,r){return t&&un(e.prototype,t),r&&un(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function hn(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&ln(e,t)}function ln(e,t){return(ln=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function gn(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=pn(e);if(t){var i=pn(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return dn(this,r)}}function dn(e,t){if(t&&("object"===An(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function pn(e){return(pn=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var In=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{A(n.next(e))}catch(e){o(e)}}function s(e){try{A(n.throw(e))}catch(e){o(e)}}function A(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}A((n=n.apply(e,t||[])).next())}))},yn=new h.b("abstract-provider/5.7.0"),bn=function(e){hn(r,e);var t=gn(r);function r(){return cn(this,r),t.apply(this,arguments)}return fn(r,null,[{key:"isForkEvent",value:function(e){return!(!e||!e._isForkEvent)}}]),r}(P),En=function(){function e(){cn(this,e),yn.checkAbstract(this instanceof e?this.constructor:void 0,e),_(this,"_isProvider",!0)}return fn(e,[{key:"getFeeData",value:function(){return In(this,void 0,void 0,regeneratorRuntime.mark((function e(){var t,r,n,i,o,a;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,D({block:this.getBlock("latest"),gasPrice:this.getGasPrice().catch((function(e){return null}))});case 2:return t=e.sent,r=t.block,n=t.gasPrice,i=null,o=null,a=null,r&&r.baseFeePerGas&&(i=r.baseFeePerGas,a=y.from("1500000000"),o=r.baseFeePerGas.mul(2).add(a)),e.abrupt("return",{lastBaseFeePerGas:i,maxFeePerGas:o,maxPriorityFeePerGas:a,gasPrice:n});case 8:case"end":return e.stop()}}),e,this)})))}},{key:"addListener",value:function(e,t){return this.on(e,t)}},{key:"removeListener",value:function(e,t){return this.off(e,t)}}],[{key:"isProvider",value:function(e){return!(!e||!e._isProvider)}}]),e}();function mn(e){return(mn="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Cn(e,t){return(Cn=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function vn(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=Qn(e);if(t){var i=Qn(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return Bn(this,r)}}function Bn(e,t){if(t&&("object"===mn(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return wn(e)}function wn(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Qn(e){return(Qn=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function kn(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _n(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function Sn(e,t,r){return t&&_n(e.prototype,t),r&&_n(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}var Dn=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{A(n.next(e))}catch(e){o(e)}}function s(e){try{A(n.throw(e))}catch(e){o(e)}}function A(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}A((n=n.apply(e,t||[])).next())}))},Mn=new h.b("abstract-signer/5.7.0"),Rn=["accessList","ccipReadEnabled","chainId","customData","data","from","gasLimit","gasPrice","maxFeePerGas","maxPriorityFeePerGas","nonce","to","type","value"],xn=[h.b.errors.INSUFFICIENT_FUNDS,h.b.errors.NONCE_EXPIRED,h.b.errors.REPLACEMENT_UNDERPRICED],On=function(){function e(){kn(this,e),Mn.checkAbstract(this instanceof e?this.constructor:void 0,e),_(this,"_isSigner",!0)}return Sn(e,[{key:"getBalance",value:function(e){return Dn(this,void 0,void 0,regeneratorRuntime.mark((function t(){return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this._checkProvider("getBalance"),t.next=3,this.provider.getBalance(this.getAddress(),e);case 3:return t.abrupt("return",t.sent);case 4:case"end":return t.stop()}}),t,this)})))}},{key:"getTransactionCount",value:function(e){return Dn(this,void 0,void 0,regeneratorRuntime.mark((function t(){return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this._checkProvider("getTransactionCount"),t.next=3,this.provider.getTransactionCount(this.getAddress(),e);case 3:return t.abrupt("return",t.sent);case 4:case"end":return t.stop()}}),t,this)})))}},{key:"estimateGas",value:function(e){return Dn(this,void 0,void 0,regeneratorRuntime.mark((function t(){var r;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this._checkProvider("estimateGas"),t.next=3,D(this.checkTransaction(e));case 3:return r=t.sent,t.next=6,this.provider.estimateGas(r);case 6:return t.abrupt("return",t.sent);case 7:case"end":return t.stop()}}),t,this)})))}},{key:"call",value:function(e,t){return Dn(this,void 0,void 0,regeneratorRuntime.mark((function r(){var n;return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return this._checkProvider("call"),r.next=3,D(this.checkTransaction(e));case 3:return n=r.sent,r.next=6,this.provider.call(n,t);case 6:return r.abrupt("return",r.sent);case 7:case"end":return r.stop()}}),r,this)})))}},{key:"sendTransaction",value:function(e){return Dn(this,void 0,void 0,regeneratorRuntime.mark((function t(){var r,n;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this._checkProvider("sendTransaction"),t.next=3,this.populateTransaction(e);case 3:return r=t.sent,t.next=6,this.signTransaction(r);case 6:return n=t.sent,t.next=9,this.provider.sendTransaction(n);case 9:return t.abrupt("return",t.sent);case 10:case"end":return t.stop()}}),t,this)})))}},{key:"getChainId",value:function(){return Dn(this,void 0,void 0,regeneratorRuntime.mark((function e(){var t;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this._checkProvider("getChainId"),e.next=3,this.provider.getNetwork();case 3:return t=e.sent,e.abrupt("return",t.chainId);case 5:case"end":return e.stop()}}),e,this)})))}},{key:"getGasPrice",value:function(){return Dn(this,void 0,void 0,regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this._checkProvider("getGasPrice"),e.next=3,this.provider.getGasPrice();case 3:return e.abrupt("return",e.sent);case 4:case"end":return e.stop()}}),e,this)})))}},{key:"getFeeData",value:function(){return Dn(this,void 0,void 0,regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this._checkProvider("getFeeData"),e.next=3,this.provider.getFeeData();case 3:return e.abrupt("return",e.sent);case 4:case"end":return e.stop()}}),e,this)})))}},{key:"resolveName",value:function(e){return Dn(this,void 0,void 0,regeneratorRuntime.mark((function t(){return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this._checkProvider("resolveName"),t.next=3,this.provider.resolveName(e);case 3:return t.abrupt("return",t.sent);case 4:case"end":return t.stop()}}),t,this)})))}},{key:"checkTransaction",value:function(e){for(var t in e)-1===Rn.indexOf(t)&&Mn.throwArgumentError("invalid transaction key: "+t,"transaction",e);var r=R(e);return null==r.from?r.from=this.getAddress():r.from=Promise.all([Promise.resolve(r.from),this.getAddress()]).then((function(t){return t[0].toLowerCase()!==t[1].toLowerCase()&&Mn.throwArgumentError("from address mismatch","transaction",e),t[0]})),r}},{key:"populateTransaction",value:function(e){return Dn(this,void 0,void 0,regeneratorRuntime.mark((function t(){var r,n,i,o,a=this;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,D(this.checkTransaction(e));case 2:if(null!=(r=t.sent).to&&(r.to=Promise.resolve(r.to).then((function(e){return Dn(a,void 0,void 0,regeneratorRuntime.mark((function t(){var r;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(null!=e){t.next=2;break}return t.abrupt("return",null);case 2:return t.next=4,this.resolveName(e);case 4:return null==(r=t.sent)&&Mn.throwArgumentError("provided ENS name resolves to null","tx.to",e),t.abrupt("return",r);case 7:case"end":return t.stop()}}),t,this)})))})),r.to.catch((function(e){}))),n=null!=r.maxFeePerGas||null!=r.maxPriorityFeePerGas,null==r.gasPrice||2!==r.type&&!n?0!==r.type&&1!==r.type||!n||Mn.throwArgumentError("pre-eip-1559 transaction do not support maxFeePerGas/maxPriorityFeePerGas","transaction",e):Mn.throwArgumentError("eip-1559 transaction do not support gasPrice","transaction",e),2!==r.type&&null!=r.type||null==r.maxFeePerGas||null==r.maxPriorityFeePerGas){t.next=10;break}r.type=2,t.next=18;break;case 10:if(0!==r.type&&1!==r.type){t.next=14;break}null==r.gasPrice&&(r.gasPrice=this.getGasPrice()),t.next=18;break;case 14:return t.next=16,this.getFeeData();case 16:i=t.sent,null==r.type?null!=i.maxFeePerGas&&null!=i.maxPriorityFeePerGas?(r.type=2,null!=r.gasPrice?(o=r.gasPrice,delete r.gasPrice,r.maxFeePerGas=o,r.maxPriorityFeePerGas=o):(null==r.maxFeePerGas&&(r.maxFeePerGas=i.maxFeePerGas),null==r.maxPriorityFeePerGas&&(r.maxPriorityFeePerGas=i.maxPriorityFeePerGas))):null!=i.gasPrice?(n&&Mn.throwError("network does not support EIP-1559",h.b.errors.UNSUPPORTED_OPERATION,{operation:"populateTransaction"}),null==r.gasPrice&&(r.gasPrice=i.gasPrice),r.type=0):Mn.throwError("failed to get consistent fee data",h.b.errors.UNSUPPORTED_OPERATION,{operation:"signer.getFeeData"}):2===r.type&&(null==r.maxFeePerGas&&(r.maxFeePerGas=i.maxFeePerGas),null==r.maxPriorityFeePerGas&&(r.maxPriorityFeePerGas=i.maxPriorityFeePerGas));case 18:return null==r.nonce&&(r.nonce=this.getTransactionCount("pending")),null==r.gasLimit&&(r.gasLimit=this.estimateGas(r).catch((function(e){if(xn.indexOf(e.code)>=0)throw e;return Mn.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",h.b.errors.UNPREDICTABLE_GAS_LIMIT,{error:e,tx:r})}))),null==r.chainId?r.chainId=this.getChainId():r.chainId=Promise.all([Promise.resolve(r.chainId),this.getChainId()]).then((function(t){return 0!==t[1]&&t[0]!==t[1]&&Mn.throwArgumentError("chainId address mismatch","transaction",e),t[0]})),t.next=23,D(r);case 23:return t.abrupt("return",t.sent);case 24:case"end":return t.stop()}}),t,this)})))}},{key:"_checkProvider",value:function(e){this.provider||Mn.throwError("missing provider",h.b.errors.UNSUPPORTED_OPERATION,{operation:e||"_checkProvider"})}}],[{key:"isSigner",value:function(e){return!(!e||!e._isSigner)}}]),e}(),Nn=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Cn(e,t)}(r,e);var t=vn(r);function r(e,n){var i;return kn(this,r),_(wn(i=t.call(this)),"address",e),_(wn(i),"provider",n||null),i}return Sn(r,[{key:"getAddress",value:function(){return Promise.resolve(this.address)}},{key:"_fail",value:function(e,t){return Promise.resolve().then((function(){Mn.throwError(e,h.b.errors.UNSUPPORTED_OPERATION,{operation:t})}))}},{key:"signMessage",value:function(e){return this._fail("VoidSigner cannot sign messages","signMessage")}},{key:"signTransaction",value:function(e){return this._fail("VoidSigner cannot sign transactions","signTransaction")}},{key:"_signTypedData",value:function(e,t,r){return this._fail("VoidSigner cannot sign typed data","signTypedData")}},{key:"connect",value:function(e){return new r(this.address,e)}}]),r}(On),Pn=r(166);function Fn(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}var jn=new h.b("signing-key/5.7.0"),Tn=null;function Un(){return Tn||(Tn=new Pn.a("secp256k1")),Tn}var Ln=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),_(this,"curve","secp256k1"),_(this,"privateKey",Object(c.i)(t)),32!==Object(c.d)(this.privateKey)&&jn.throwArgumentError("invalid private key","privateKey","[[ REDACTED ]]");var r=Un().keyFromPrivate(Object(c.a)(this.privateKey));_(this,"publicKey","0x"+r.getPublic(!1,"hex")),_(this,"compressedPublicKey","0x"+r.getPublic(!0,"hex")),_(this,"_isSigningKey",!0)}var t,r,n;return t=e,n=[{key:"isSigningKey",value:function(e){return!(!e||!e._isSigningKey)}}],(r=[{key:"_addPoint",value:function(e){var t=Un().keyFromPublic(Object(c.a)(this.publicKey)),r=Un().keyFromPublic(Object(c.a)(e));return"0x"+t.pub.add(r.pub).encodeCompressed("hex")}},{key:"signDigest",value:function(e){var t=Un().keyFromPrivate(Object(c.a)(this.privateKey)),r=Object(c.a)(e);32!==r.length&&jn.throwArgumentError("bad digest length","digest",e);var n=t.sign(r,{canonical:!0});return Object(c.n)({recoveryParam:n.recoveryParam,r:Object(c.h)("0x"+n.r.toString(16),32),s:Object(c.h)("0x"+n.s.toString(16),32)})}},{key:"computeSharedSecret",value:function(e){var t=Un().keyFromPrivate(Object(c.a)(this.privateKey)),r=Un().keyFromPublic(Object(c.a)(Gn(e)));return Object(c.h)("0x"+t.derive(r.getPublic()).toString(16),32)}}])&&Fn(t.prototype,r),n&&Fn(t,n),Object.defineProperty(t,"prototype",{writable:!1}),e}();function Hn(e,t){var r=Object(c.n)(t),n={r:Object(c.a)(r.r),s:Object(c.a)(r.s)};return"0x"+Un().recoverPubKey(Object(c.a)(e),n,r.recoveryParam).encode("hex",!1)}function Gn(e,t){var r=Object(c.a)(e);if(32===r.length){var n=new Ln(r);return t?"0x"+Un().keyFromPrivate(r).getPublic(!0,"hex"):n.publicKey}return 33===r.length?t?Object(c.i)(r):"0x"+Un().keyFromPublic(r).getPublic(!1,"hex"):65===r.length?t?"0x"+Un().keyFromPublic(r).getPublic(!0,"hex"):Object(c.i)(r):jn.throwArgumentError("invalid public or private key","key","[REDACTED]")}var Yn,Kn=new h.b("transactions/5.7.0");function qn(e){return"0x"===e?null:Ae(e)}function Jn(e){return"0x"===e?Mt:y.from(e)}!function(e){e[e.legacy=0]="legacy",e[e.eip2930=1]="eip2930",e[e.eip1559=2]="eip1559"}(Yn||(Yn={}));var zn=[{name:"nonce",maxLength:32,numeric:!0},{name:"gasPrice",maxLength:32,numeric:!0},{name:"gasLimit",maxLength:32,numeric:!0},{name:"to",length:20},{name:"value",maxLength:32,numeric:!0},{name:"data"}],Vn={chainId:!0,data:!0,gasLimit:!0,gasPrice:!0,nonce:!0,to:!0,type:!0,value:!0};function Zn(e){var t=Gn(e);return Ae(Object(c.e)(q(Object(c.e)(t,1)),12))}function Wn(e,t){return Zn(Hn(Object(c.a)(e),t))}function Xn(e,t){var r=Object(c.o)(y.from(e).toHexString());return r.length>32&&Kn.throwArgumentError("invalid length for "+t,"transaction:"+t,e),r}function $n(e,t){return{address:Ae(e),storageKeys:(t||[]).map((function(t,r){return 32!==Object(c.d)(t)&&Kn.throwArgumentError("invalid access list storageKey","accessList[".concat(e,":").concat(r,"]"),t),t.toLowerCase()}))}}function ei(e){if(Array.isArray(e))return e.map((function(e,t){return Array.isArray(e)?(e.length>2&&Kn.throwArgumentError("access list expected to be [ address, storageKeys[] ]","value[".concat(t,"]"),e),$n(e[0],e[1])):$n(e.address,e.storageKeys)}));var t=Object.keys(e).map((function(t){var r=e[t].reduce((function(e,t){return e[t]=!0,e}),{});return $n(t,Object.keys(r).sort())}));return t.sort((function(e,t){return e.address.localeCompare(t.address)})),t}function ti(e){return ei(e).map((function(e){return[e.address,e.storageKeys]}))}function ri(e,t){if(null!=e.gasPrice){var r=y.from(e.gasPrice),n=y.from(e.maxFeePerGas||0);r.eq(n)||Kn.throwArgumentError("mismatch EIP-1559 gasPrice != maxFeePerGas","tx",{gasPrice:r,maxFeePerGas:n})}var i=[Xn(e.chainId||0,"chainId"),Xn(e.nonce||0,"nonce"),Xn(e.maxPriorityFeePerGas||0,"maxPriorityFeePerGas"),Xn(e.maxFeePerGas||0,"maxFeePerGas"),Xn(e.gasLimit||0,"gasLimit"),null!=e.to?Ae(e.to):"0x",Xn(e.value||0,"value"),e.data||"0x",ti(e.accessList||[])];if(t){var o=Object(c.n)(t);i.push(Xn(o.recoveryParam,"recoveryParam")),i.push(Object(c.o)(o.r)),i.push(Object(c.o)(o.s))}return Object(c.c)(["0x02",Z(i)])}function ni(e,t){var r=[Xn(e.chainId||0,"chainId"),Xn(e.nonce||0,"nonce"),Xn(e.gasPrice||0,"gasPrice"),Xn(e.gasLimit||0,"gasLimit"),null!=e.to?Ae(e.to):"0x",Xn(e.value||0,"value"),e.data||"0x",ti(e.accessList||[])];if(t){var n=Object(c.n)(t);r.push(Xn(n.recoveryParam,"recoveryParam")),r.push(Object(c.o)(n.r)),r.push(Object(c.o)(n.s))}return Object(c.c)(["0x01",Z(r)])}function ii(e,t){if(null==e.type||0===e.type)return null!=e.accessList&&Kn.throwArgumentError("untyped transactions do not support accessList; include type: 1","transaction",e),function(e,t){M(e,Vn);var r=[];zn.forEach((function(t){var n=e[t.name]||[],i={};t.numeric&&(i.hexPad="left"),n=Object(c.a)(Object(c.i)(n,i)),t.length&&n.length!==t.length&&n.length>0&&Kn.throwArgumentError("invalid length for "+t.name,"transaction:"+t.name,n),t.maxLength&&(n=Object(c.o)(n)).length>t.maxLength&&Kn.throwArgumentError("invalid length for "+t.name,"transaction:"+t.name,n),r.push(Object(c.i)(n))}));var n=0;if(null!=e.chainId?"number"!=typeof(n=e.chainId)&&Kn.throwArgumentError("invalid transaction.chainId","transaction",e):t&&!Object(c.k)(t)&&t.v>28&&(n=Math.floor((t.v-35)/2)),0!==n&&(r.push(Object(c.i)(n)),r.push("0x"),r.push("0x")),!t)return Z(r);var i=Object(c.n)(t),o=27+i.recoveryParam;return 0!==n?(r.pop(),r.pop(),r.pop(),o+=2*n+8,i.v>28&&i.v!==o&&Kn.throwArgumentError("transaction.chainId/signature.v mismatch","signature",t)):i.v!==o&&Kn.throwArgumentError("transaction.chainId/signature.v mismatch","signature",t),r.push(Object(c.i)(o)),r.push(Object(c.o)(Object(c.a)(i.r))),r.push(Object(c.o)(Object(c.a)(i.s))),Z(r)}(e,t);switch(e.type){case 1:return ni(e,t);case 2:return ri(e,t)}return Kn.throwError("unsupported transaction type: ".concat(e.type),h.b.errors.UNSUPPORTED_OPERATION,{operation:"serializeTransaction",transactionType:e.type})}function oi(e,t,r){try{var n=Jn(t[0]).toNumber();if(0!==n&&1!==n)throw new Error("bad recid");e.v=n}catch(e){Kn.throwArgumentError("invalid v for transaction type: 1","v",t[0])}e.r=Object(c.h)(t[1],32),e.s=Object(c.h)(t[2],32);try{var i=q(r(e));e.from=Wn(i,{r:e.r,s:e.s,recoveryParam:e.v})}catch(e){}}function ai(e){var t=Object(c.a)(e);if(t[0]>127)return function(e){var t=$(e);9!==t.length&&6!==t.length&&Kn.throwArgumentError("invalid raw transaction","rawTransaction",e);var r={nonce:Jn(t[0]).toNumber(),gasPrice:Jn(t[1]),gasLimit:Jn(t[2]),to:qn(t[3]),value:Jn(t[4]),data:t[5],chainId:0};if(6===t.length)return r;try{r.v=y.from(t[6]).toNumber()}catch(e){return r}if(r.r=Object(c.h)(t[7],32),r.s=Object(c.h)(t[8],32),y.from(r.r).isZero()&&y.from(r.s).isZero())r.chainId=r.v,r.v=0;else{r.chainId=Math.floor((r.v-35)/2),r.chainId<0&&(r.chainId=0);var n=r.v-27,i=t.slice(0,6);0!==r.chainId&&(i.push(Object(c.i)(r.chainId)),i.push("0x"),i.push("0x"),n-=2*r.chainId+8);var o=q(Z(i));try{r.from=Wn(o,{r:Object(c.i)(r.r),s:Object(c.i)(r.s),recoveryParam:n})}catch(e){}r.hash=q(e)}return r.type=null,r}(t);switch(t[0]){case 1:return function(e){var t=$(e.slice(1));8!==t.length&&11!==t.length&&Kn.throwArgumentError("invalid component count for transaction type: 1","payload",Object(c.i)(e));var r={type:1,chainId:Jn(t[0]).toNumber(),nonce:Jn(t[1]).toNumber(),gasPrice:Jn(t[2]),gasLimit:Jn(t[3]),to:qn(t[4]),value:Jn(t[5]),data:t[6],accessList:ei(t[7])};return 8===t.length||(r.hash=q(e),oi(r,t.slice(8),ni)),r}(t);case 2:return function(e){var t=$(e.slice(1));9!==t.length&&12!==t.length&&Kn.throwArgumentError("invalid component count for transaction type: 2","payload",Object(c.i)(e));var r=Jn(t[2]),n=Jn(t[3]),i={type:2,chainId:Jn(t[0]).toNumber(),nonce:Jn(t[1]).toNumber(),maxPriorityFeePerGas:r,maxFeePerGas:n,gasPrice:null,gasLimit:Jn(t[4]),to:qn(t[5]),value:Jn(t[6]),data:t[7],accessList:ei(t[8])};return 9===t.length||(i.hash=q(e),oi(i,t.slice(9),ri)),i}(t)}return Kn.throwError("unsupported transaction type: ".concat(t[0]),h.b.errors.UNSUPPORTED_OPERATION,{operation:"parseTransaction",transactionType:t[0]})}function si(e){return function(e){if(Array.isArray(e))return Ai(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return Ai(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);"Object"===r&&e.constructor&&(r=e.constructor.name);if("Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return Ai(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function Ai(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function ci(){return(ci="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,r){var n=ui(e,t);if(n){var i=Object.getOwnPropertyDescriptor(n,t);return i.get?i.get.call(arguments.length<3?e:r):i.value}}).apply(this,arguments)}function ui(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=pi(e)););return e}function fi(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&hi(e,t)}function hi(e,t){return(hi=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function li(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=pi(e);if(t){var i=pi(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return gi(this,r)}}function gi(e,t){if(t&&("object"===Ei(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return di(e)}function di(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function pi(e){return(pi=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function Ii(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function yi(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function bi(e,t,r){return t&&yi(e.prototype,t),r&&yi(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function Ei(e){return(Ei="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var mi=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{A(n.next(e))}catch(e){o(e)}}function s(e){try{A(n.throw(e))}catch(e){o(e)}}function A(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}A((n=n.apply(e,t||[])).next())}))},Ci=new h.b("contracts/5.7.0"),vi={chainId:!0,data:!0,from:!0,gasLimit:!0,gasPrice:!0,nonce:!0,to:!0,value:!0,type:!0,accessList:!0,maxFeePerGas:!0,maxPriorityFeePerGas:!0,customData:!0,ccipReadEnabled:!0};function Bi(e,t){return mi(this,void 0,void 0,regeneratorRuntime.mark((function r(){var n,i;return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,t;case 2:return"string"!=typeof(n=r.sent)&&Ci.throwArgumentError("invalid address or ENS name","name",n),r.prev=4,r.abrupt("return",Ae(n));case 8:r.prev=8,r.t0=r.catch(4);case 10:return e||Ci.throwError("a provider or signer is needed to resolve ENS names",h.b.errors.UNSUPPORTED_OPERATION,{operation:"resolveName"}),r.next=13,e.resolveName(n);case 13:return null==(i=r.sent)&&Ci.throwArgumentError("resolver or addr is not configured for ENS name","name",n),r.abrupt("return",i);case 16:case"end":return r.stop()}}),r,null,[[4,8]])})))}function wi(e,t,r){return mi(this,void 0,void 0,regeneratorRuntime.mark((function n(){return regeneratorRuntime.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(!Array.isArray(r)){n.next=4;break}return n.next=3,Promise.all(r.map((function(r,n){return wi(e,Array.isArray(t)?t[n]:t[r.name],r)})));case 3:return n.abrupt("return",n.sent);case 4:if("address"!==r.type){n.next=8;break}return n.next=7,Bi(e,t);case 7:return n.abrupt("return",n.sent);case 8:if("tuple"!==r.type){n.next=12;break}return n.next=11,wi(e,t,r.components);case 11:return n.abrupt("return",n.sent);case 12:if("array"!==r.baseType){n.next=18;break}if(Array.isArray(t)){n.next=15;break}return n.abrupt("return",Promise.reject(Ci.makeError("invalid value for array",h.b.errors.INVALID_ARGUMENT,{argument:"value",value:t})));case 15:return n.next=17,Promise.all(t.map((function(t){return wi(e,t,r.arrayChildren)})));case 17:return n.abrupt("return",n.sent);case 18:return n.abrupt("return",t);case 19:case"end":return n.stop()}}),n)})))}function Qi(e,t,r){return mi(this,void 0,void 0,regeneratorRuntime.mark((function n(){var i,o,a,s,A,u,f,l,g,d,p=this;return regeneratorRuntime.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return i={},r.length===t.inputs.length+1&&"object"===Ei(r[r.length-1])&&(i=R(r.pop())),Ci.checkArgumentCount(r.length,t.inputs.length,"passed to contract"),e.signer?i.from?i.from=D({override:Bi(e.signer,i.from),signer:e.signer.getAddress()}).then((function(e){return mi(p,void 0,void 0,regeneratorRuntime.mark((function t(){return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return Ae(e.signer)!==e.override&&Ci.throwError("Contract with a Signer cannot override from",h.b.errors.UNSUPPORTED_OPERATION,{operation:"overrides.from"}),t.abrupt("return",e.override);case 2:case"end":return t.stop()}}),t)})))})):i.from=e.signer.getAddress():i.from&&(i.from=Bi(e.provider,i.from)),n.next=6,D({args:wi(e.signer||e.provider,r,t.inputs),address:e.resolvedAddress,overrides:D(i)||{}});case 6:if(o=n.sent,a=e.interface.encodeFunctionData(t,o.args),s={data:a,to:o.address},null!=(A=o.overrides).nonce&&(s.nonce=y.from(A.nonce).toNumber()),null!=A.gasLimit&&(s.gasLimit=y.from(A.gasLimit)),null!=A.gasPrice&&(s.gasPrice=y.from(A.gasPrice)),null!=A.maxFeePerGas&&(s.maxFeePerGas=y.from(A.maxFeePerGas)),null!=A.maxPriorityFeePerGas&&(s.maxPriorityFeePerGas=y.from(A.maxPriorityFeePerGas)),null!=A.from&&(s.from=A.from),null!=A.type&&(s.type=A.type),null!=A.accessList&&(s.accessList=ei(A.accessList)),null==s.gasLimit&&null!=t.gas){for(u=21e3,f=Object(c.a)(a),l=0;l<f.length;l++)u+=4,f[l]&&(u+=64);s.gasLimit=y.from(t.gas).add(u)}return A.value&&((g=y.from(A.value)).isZero()||t.payable||Ci.throwError("non-payable method cannot override value",h.b.errors.UNSUPPORTED_OPERATION,{operation:"overrides.value",value:i.value}),s.value=g),A.customData&&(s.customData=R(A.customData)),A.ccipReadEnabled&&(s.ccipReadEnabled=!!A.ccipReadEnabled),delete i.nonce,delete i.gasLimit,delete i.gasPrice,delete i.from,delete i.value,delete i.type,delete i.accessList,delete i.maxFeePerGas,delete i.maxPriorityFeePerGas,delete i.customData,delete i.ccipReadEnabled,(d=Object.keys(i).filter((function(e){return null!=i[e]}))).length&&Ci.throwError("cannot override ".concat(d.map((function(e){return JSON.stringify(e)})).join(",")),h.b.errors.UNSUPPORTED_OPERATION,{operation:"overrides",overrides:d}),n.abrupt("return",s);case 36:case"end":return n.stop()}}),n)})))}function ki(e,t){var r=t.wait.bind(t);t.wait=function(t){return r(t).then((function(t){return t.events=t.logs.map((function(r){var n=N(r),i=null;try{i=e.interface.parseLog(r)}catch(e){}return i&&(n.args=i.args,n.decode=function(t,r){return e.interface.decodeEventLog(i.eventFragment,t,r)},n.event=i.name,n.eventSignature=i.signature),n.removeListener=function(){return e.provider},n.getBlock=function(){return e.provider.getBlock(t.blockHash)},n.getTransaction=function(){return e.provider.getTransaction(t.transactionHash)},n.getTransactionReceipt=function(){return Promise.resolve(t)},n})),t}))}}function _i(e,t,r){var n=e.signer||e.provider;return function(){for(var i=arguments.length,o=new Array(i),a=0;a<i;a++)o[a]=arguments[a];return mi(this,void 0,void 0,regeneratorRuntime.mark((function i(){var a,s,A,c,u;return regeneratorRuntime.wrap((function(i){for(;;)switch(i.prev=i.next){case 0:if(a=void 0,o.length!==t.inputs.length+1||"object"!==Ei(o[o.length-1])){i.next=9;break}if(null==(s=R(o.pop())).blockTag){i.next=7;break}return i.next=6,s.blockTag;case 6:a=i.sent;case 7:delete s.blockTag,o.push(s);case 9:if(null==e.deployTransaction){i.next=12;break}return i.next=12,e._deployed(a);case 12:return i.next=14,Qi(e,t,o);case 14:return A=i.sent,i.next=17,n.call(A,a);case 17:return c=i.sent,i.prev=18,u=e.interface.decodeFunctionResult(t,c),r&&1===t.outputs.length&&(u=u[0]),i.abrupt("return",u);case 24:throw i.prev=24,i.t0=i.catch(18),i.t0.code===h.b.errors.CALL_EXCEPTION&&(i.t0.address=e.address,i.t0.args=o,i.t0.transaction=A),i.t0;case 28:case"end":return i.stop()}}),i,null,[[18,24]])})))}}function Si(e,t,r){return t.constant?_i(e,t,r):function(e,t){return function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return mi(this,void 0,void 0,regeneratorRuntime.mark((function r(){var i,o;return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(e.signer||Ci.throwError("sending a transaction requires a signer",h.b.errors.UNSUPPORTED_OPERATION,{operation:"sendTransaction"}),null==e.deployTransaction){r.next=4;break}return r.next=4,e._deployed();case 4:return r.next=6,Qi(e,t,n);case 6:return i=r.sent,r.next=9,e.signer.sendTransaction(i);case 9:return o=r.sent,ki(e,o),r.abrupt("return",o);case 12:case"end":return r.stop()}}),r)})))}}(e,t)}function Di(e){return!e.address||null!=e.topics&&0!==e.topics.length?(e.address||"*")+"@"+(e.topics?e.topics.map((function(e){return Array.isArray(e)?e.join("|"):e})).join(":"):""):"*"}var Mi=function(){function e(t,r){Ii(this,e),_(this,"tag",t),_(this,"filter",r),this._listeners=[]}return bi(e,[{key:"addListener",value:function(e,t){this._listeners.push({listener:e,once:t})}},{key:"removeListener",value:function(e){var t=!1;this._listeners=this._listeners.filter((function(r){return!(!t&&r.listener===e)||(t=!0,!1)}))}},{key:"removeAllListeners",value:function(){this._listeners=[]}},{key:"listeners",value:function(){return this._listeners.map((function(e){return e.listener}))}},{key:"listenerCount",value:function(){return this._listeners.length}},{key:"run",value:function(e){var t=this,r=this.listenerCount();return this._listeners=this._listeners.filter((function(r){var n=e.slice();return setTimeout((function(){r.listener.apply(t,n)}),0),!r.once})),r}},{key:"prepareEvent",value:function(e){}},{key:"getEmit",value:function(e){return[e]}}]),e}(),Ri=function(e){fi(r,e);var t=li(r);function r(){return Ii(this,r),t.call(this,"error",null)}return bi(r)}(Mi),xi=function(e){fi(r,e);var t=li(r);function r(e,n,i,o){var a;Ii(this,r);var s={address:e},A=n.getEventTopic(i);return o?(A!==o[0]&&Ci.throwArgumentError("topic mismatch","topics",o),s.topics=o.slice()):s.topics=[A],_(di(a=t.call(this,Di(s),s)),"address",e),_(di(a),"interface",n),_(di(a),"fragment",i),a}return bi(r,[{key:"prepareEvent",value:function(e){var t=this;ci(pi(r.prototype),"prepareEvent",this).call(this,e),e.event=this.fragment.name,e.eventSignature=this.fragment.format(),e.decode=function(e,r){return t.interface.decodeEventLog(t.fragment,e,r)};try{e.args=this.interface.decodeEventLog(this.fragment,e.data,e.topics)}catch(t){e.args=null,e.decodeError=t}}},{key:"getEmit",value:function(e){var t=function(e){var t=[];return function e(r,n){if(Array.isArray(n))for(var i in n){var o=r.slice();o.push(i);try{e(o,n[i])}catch(e){t.push({path:o,error:e})}}}([],e),t}(e.args);if(t.length)throw t[0].error;var r=(e.args||[]).slice();return r.push(e),r}}]),r}(Mi),Oi=function(e){fi(r,e);var t=li(r);function r(e,n){var i;return Ii(this,r),_(di(i=t.call(this,"*",{address:e})),"address",e),_(di(i),"interface",n),i}return bi(r,[{key:"prepareEvent",value:function(e){var t=this;ci(pi(r.prototype),"prepareEvent",this).call(this,e);try{var n=this.interface.parseLog(e);e.event=n.name,e.eventSignature=n.signature,e.decode=function(e,r){return t.interface.decodeEventLog(n.eventFragment,e,r)},e.args=n.args}catch(e){}}}]),r}(Mi),Ni=function(){function e(t,r,n){var i=this;Ii(this,e),_(this,"interface",S(this instanceof e?this.constructor:void 0,"getInterface")(r)),null==n?(_(this,"provider",null),_(this,"signer",null)):On.isSigner(n)?(_(this,"provider",n.provider||null),_(this,"signer",n)):En.isProvider(n)?(_(this,"provider",n),_(this,"signer",null)):Ci.throwArgumentError("invalid signer or provider","signerOrProvider",n),_(this,"callStatic",{}),_(this,"estimateGas",{}),_(this,"functions",{}),_(this,"populateTransaction",{}),_(this,"filters",{});var o={};if(Object.keys(this.interface.events).forEach((function(e){var t=i.interface.events[e];_(i.filters,e,(function(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];return{address:i.address,topics:i.interface.encodeFilterTopics(t,r)}})),o[t.name]||(o[t.name]=[]),o[t.name].push(e)})),Object.keys(o).forEach((function(e){var t=o[e];1===t.length?_(i.filters,e,i.filters[t[0]]):Ci.warn("Duplicate definition of ".concat(e," (").concat(t.join(", "),")"))})),_(this,"_runningEvents",{}),_(this,"_wrappedEmits",{}),null==t&&Ci.throwArgumentError("invalid contract address or ENS name","addressOrName",t),_(this,"address",t),this.provider)_(this,"resolvedAddress",Bi(this.provider,t));else try{_(this,"resolvedAddress",Promise.resolve(Ae(t)))}catch(e){Ci.throwError("provider is required to use ENS name as contract address",h.b.errors.UNSUPPORTED_OPERATION,{operation:"new Contract"})}this.resolvedAddress.catch((function(e){}));var a={},s={};Object.keys(this.interface.functions).forEach((function(e){var t=i.interface.functions[e];if(s[e])Ci.warn("Duplicate ABI entry for ".concat(JSON.stringify(e)));else{s[e]=!0;var r=t.name;a["%".concat(r)]||(a["%".concat(r)]=[]),a["%".concat(r)].push(e),null==i[e]&&_(i,e,Si(i,t,!0)),null==i.functions[e]&&_(i.functions,e,Si(i,t,!1)),null==i.callStatic[e]&&_(i.callStatic,e,_i(i,t,!0)),null==i.populateTransaction[e]&&_(i.populateTransaction,e,function(e,t){return function(){for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];return Qi(e,t,n)}}(i,t)),null==i.estimateGas[e]&&_(i.estimateGas,e,function(e,t){var r=e.signer||e.provider;return function(){for(var n=arguments.length,i=new Array(n),o=0;o<n;o++)i[o]=arguments[o];return mi(this,void 0,void 0,regeneratorRuntime.mark((function n(){var o;return regeneratorRuntime.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return r||Ci.throwError("estimate require a provider or signer",h.b.errors.UNSUPPORTED_OPERATION,{operation:"estimateGas"}),n.next=3,Qi(e,t,i);case 3:return o=n.sent,n.next=6,r.estimateGas(o);case 6:return n.abrupt("return",n.sent);case 7:case"end":return n.stop()}}),n)})))}}(i,t))}})),Object.keys(a).forEach((function(e){var t=a[e];if(!(t.length>1)){e=e.substring(1);var r=t[0];try{null==i[e]&&_(i,e,i[r])}catch(e){}null==i.functions[e]&&_(i.functions,e,i.functions[r]),null==i.callStatic[e]&&_(i.callStatic,e,i.callStatic[r]),null==i.populateTransaction[e]&&_(i.populateTransaction,e,i.populateTransaction[r]),null==i.estimateGas[e]&&_(i.estimateGas,e,i.estimateGas[r])}}))}return bi(e,[{key:"deployed",value:function(){return this._deployed()}},{key:"_deployed",value:function(e){var t=this;return this._deployedPromise||(this.deployTransaction?this._deployedPromise=this.deployTransaction.wait().then((function(){return t})):this._deployedPromise=this.provider.getCode(this.address,e).then((function(e){return"0x"===e&&Ci.throwError("contract not deployed",h.b.errors.UNSUPPORTED_OPERATION,{contractAddress:t.address,operation:"getDeployed"}),t}))),this._deployedPromise}},{key:"fallback",value:function(e){var t=this;this.signer||Ci.throwError("sending a transactions require a signer",h.b.errors.UNSUPPORTED_OPERATION,{operation:"sendTransaction(fallback)"});var r=R(e||{});return["from","to"].forEach((function(e){null!=r[e]&&Ci.throwError("cannot override "+e,h.b.errors.UNSUPPORTED_OPERATION,{operation:e})})),r.to=this.resolvedAddress,this.deployed().then((function(){return t.signer.sendTransaction(r)}))}},{key:"connect",value:function(e){"string"==typeof e&&(e=new Nn(e,this.provider));var t=new this.constructor(this.address,this.interface,e);return this.deployTransaction&&_(t,"deployTransaction",this.deployTransaction),t}},{key:"attach",value:function(e){return new this.constructor(e,this.interface,this.signer||this.provider)}},{key:"_normalizeRunningEvent",value:function(e){return this._runningEvents[e.tag]?this._runningEvents[e.tag]:e}},{key:"_getRunningEvent",value:function(e){if("string"==typeof e){if("error"===e)return this._normalizeRunningEvent(new Ri);if("event"===e)return this._normalizeRunningEvent(new Mi("event",null));if("*"===e)return this._normalizeRunningEvent(new Oi(this.address,this.interface));var t=this.interface.getEvent(e);return this._normalizeRunningEvent(new xi(this.address,this.interface,t))}if(e.topics&&e.topics.length>0){try{var r=e.topics[0];if("string"!=typeof r)throw new Error("invalid topic");var n=this.interface.getEvent(r);return this._normalizeRunningEvent(new xi(this.address,this.interface,n,e.topics))}catch(e){}var i={address:this.address,topics:e.topics};return this._normalizeRunningEvent(new Mi(Di(i),i))}return this._normalizeRunningEvent(new Oi(this.address,this.interface))}},{key:"_checkRunningEvents",value:function(e){if(0===e.listenerCount()){delete this._runningEvents[e.tag];var t=this._wrappedEmits[e.tag];t&&e.filter&&(this.provider.off(e.filter,t),delete this._wrappedEmits[e.tag])}}},{key:"_wrapEvent",value:function(e,t,r){var n=this,i=N(t);return i.removeListener=function(){r&&(e.removeListener(r),n._checkRunningEvents(e))},i.getBlock=function(){return n.provider.getBlock(t.blockHash)},i.getTransaction=function(){return n.provider.getTransaction(t.transactionHash)},i.getTransactionReceipt=function(){return n.provider.getTransactionReceipt(t.transactionHash)},e.prepareEvent(i),i}},{key:"_addEventListener",value:function(e,t,r){var n=this;if(this.provider||Ci.throwError("events require a provider or a signer with a provider",h.b.errors.UNSUPPORTED_OPERATION,{operation:"once"}),e.addListener(t,r),this._runningEvents[e.tag]=e,!this._wrappedEmits[e.tag]){var i=function(r){var i=n._wrapEvent(e,r,t);if(null==i.decodeError)try{var o=e.getEmit(i);n.emit.apply(n,[e.filter].concat(si(o)))}catch(e){i.decodeError=e.error}null!=e.filter&&n.emit("event",i),null!=i.decodeError&&n.emit("error",i.decodeError,i)};this._wrappedEmits[e.tag]=i,null!=e.filter&&this.provider.on(e.filter,i)}}},{key:"queryFilter",value:function(e,t,r){var n=this,i=this._getRunningEvent(e),o=R(i.filter);return"string"==typeof t&&Object(c.l)(t,32)?(null!=r&&Ci.throwArgumentError("cannot specify toBlock with blockhash","toBlock",r),o.blockHash=t):(o.fromBlock=null!=t?t:0,o.toBlock=null!=r?r:"latest"),this.provider.getLogs(o).then((function(e){return e.map((function(e){return n._wrapEvent(i,e,null)}))}))}},{key:"on",value:function(e,t){return this._addEventListener(this._getRunningEvent(e),t,!1),this}},{key:"once",value:function(e,t){return this._addEventListener(this._getRunningEvent(e),t,!0),this}},{key:"emit",value:function(e){if(!this.provider)return!1;for(var t=this._getRunningEvent(e),r=arguments.length,n=new Array(r>1?r-1:0),i=1;i<r;i++)n[i-1]=arguments[i];var o=t.run(n)>0;return this._checkRunningEvents(t),o}},{key:"listenerCount",value:function(e){var t=this;return this.provider?null==e?Object.keys(this._runningEvents).reduce((function(e,r){return e+t._runningEvents[r].listenerCount()}),0):this._getRunningEvent(e).listenerCount():0}},{key:"listeners",value:function(e){var t=this;if(!this.provider)return[];if(null==e){var r=function(){var e=[];for(var r in t._runningEvents)t._runningEvents[r].listeners().forEach((function(t){e.push(t)}));return{v:e}}();if("object"===Ei(r))return r.v}return this._getRunningEvent(e).listeners()}},{key:"removeAllListeners",value:function(e){if(!this.provider)return this;if(null==e){for(var t in this._runningEvents){var r=this._runningEvents[t];r.removeAllListeners(),this._checkRunningEvents(r)}return this}var n=this._getRunningEvent(e);return n.removeAllListeners(),this._checkRunningEvents(n),this}},{key:"off",value:function(e,t){if(!this.provider)return this;var r=this._getRunningEvent(e);return r.removeListener(t),this._checkRunningEvents(r),this}},{key:"removeListener",value:function(e,t){return this.off(e,t)}}],[{key:"getContractAddress",value:function(e){return fe(e)}},{key:"getInterface",value:function(e){return sn.isInterface(e)?e:new sn(e)}},{key:"isIndexed",value:function(e){return nn.isIndexed(e)}}]),e}(),Pi=function(e){fi(r,e);var t=li(r);function r(){return Ii(this,r),t.apply(this,arguments)}return bi(r)}(Ni),Fi=function(){function e(t,r,n){Ii(this,e);var i=null;"0x"!==(i="string"==typeof r?r:Object(c.j)(r)?Object(c.i)(r):r&&"string"==typeof r.object?r.object:"!").substring(0,2)&&(i="0x"+i),(!Object(c.l)(i)||i.length%2)&&Ci.throwArgumentError("invalid bytecode","bytecode",r),n&&!On.isSigner(n)&&Ci.throwArgumentError("invalid signer","signer",n),_(this,"bytecode",i),_(this,"interface",S(this instanceof e?this.constructor:void 0,"getInterface")(t)),_(this,"signer",n||null)}return bi(e,[{key:"getDeployTransaction",value:function(){for(var e={},t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];if(r.length===this.interface.deploy.inputs.length+1&&"object"===Ei(r[r.length-1]))for(var i in e=R(r.pop()))if(!vi[i])throw new Error("unknown transaction override "+i);if(["data","from","to"].forEach((function(t){null!=e[t]&&Ci.throwError("cannot override "+t,h.b.errors.UNSUPPORTED_OPERATION,{operation:t})})),e.value){var o=y.from(e.value);o.isZero()||this.interface.deploy.payable||Ci.throwError("non-payable constructor cannot override value",h.b.errors.UNSUPPORTED_OPERATION,{operation:"overrides.value",value:e.value})}return Ci.checkArgumentCount(r.length,this.interface.deploy.inputs.length," in Contract constructor"),e.data=Object(c.i)(Object(c.b)([this.bytecode,this.interface.encodeDeploy(r)])),e}},{key:"deploy",value:function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return mi(this,void 0,void 0,regeneratorRuntime.mark((function e(){var r,n,i,o,a,s;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r={},t.length===this.interface.deploy.inputs.length+1&&(r=t.pop()),Ci.checkArgumentCount(t.length,this.interface.deploy.inputs.length," in Contract constructor"),e.next=5,wi(this.signer,t,this.interface.deploy.inputs);case 5:return(n=e.sent).push(r),i=this.getDeployTransaction.apply(this,si(n)),e.next=10,this.signer.sendTransaction(i);case 10:return o=e.sent,a=S(this.constructor,"getContractAddress")(o),ki(s=S(this.constructor,"getContract")(a,this.interface,this.signer),o),_(s,"deployTransaction",o),e.abrupt("return",s);case 16:case"end":return e.stop()}}),e,this)})))}},{key:"attach",value:function(e){return this.constructor.getContract(e,this.interface,this.signer)}},{key:"connect",value:function(e){return new this.constructor(this.interface,this.bytecode,e)}}],[{key:"fromSolidity",value:function(e,t){null==e&&Ci.throwError("missing compiler output",h.b.errors.MISSING_ARGUMENT,{argument:"compilerOutput"}),"string"==typeof e&&(e=JSON.parse(e));var r=e.abi,n=null;return e.bytecode?n=e.bytecode:e.evm&&e.evm.bytecode&&(n=e.evm.bytecode),new this(r,n,t)}},{key:"getInterface",value:function(e){return Pi.getInterface(e)}},{key:"getContractAddress",value:function(e){return fe(e)}},{key:"getContract",value:function(e,t,r){return new Pi(e,t,r)}}]),e}();function ji(e){return(ji="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Ti(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Ui(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function Li(e,t,r){return t&&Ui(e.prototype,t),r&&Ui(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}var Hi=new h.b("bignumber/5.7.0"),Gi={},Yi=y.from(0),Ki=y.from(-1);function qi(e,t,r,n){var i={fault:t,operation:r};return void 0!==n&&(i.value=n),Hi.throwError(e,h.b.errors.NUMERIC_FAULT,i)}for(var Ji="0";Ji.length<256;)Ji+=Ji;function zi(e){if("number"!=typeof e)try{e=y.from(e).toNumber()}catch(e){}return"number"==typeof e&&e>=0&&e<=256&&!(e%1)?"1"+Ji.substring(0,e):Hi.throwArgumentError("invalid decimal size","decimals",e)}function Vi(e,t){null==t&&(t=0);var r=zi(t),n=(e=y.from(e)).lt(Yi);n&&(e=e.mul(Ki));for(var i=e.mod(r).toString();i.length<r.length-1;)i="0"+i;i=i.match(/^([0-9]*[1-9]|0)(0*)/)[1];var o=e.div(r).toString();return e=1===r.length?o:o+"."+i,n&&(e="-"+e),e}function Zi(e,t){null==t&&(t=0);var r=zi(t);"string"==typeof e&&e.match(/^-?[0-9.]+$/)||Hi.throwArgumentError("invalid decimal value","value",e);var n="-"===e.substring(0,1);n&&(e=e.substring(1)),"."===e&&Hi.throwArgumentError("missing value","value",e);var i=e.split(".");i.length>2&&Hi.throwArgumentError("too many decimal points","value",e);var o=i[0],a=i[1];for(o||(o="0"),a||(a="0");"0"===a[a.length-1];)a=a.substring(0,a.length-1);for(a.length>r.length-1&&qi("fractional component exceeds decimals","underflow","parseFixed"),""===a&&(a="0");a.length<r.length-1;)a+="0";var s=y.from(o),A=y.from(a),c=s.mul(r).add(A);return n&&(c=c.mul(Ki)),c}var Wi=function(){function e(t,r,n,i){Ti(this,e),t!==Gi&&Hi.throwError("cannot use FixedFormat constructor; use FixedFormat.from",h.b.errors.UNSUPPORTED_OPERATION,{operation:"new FixedFormat"}),this.signed=r,this.width=n,this.decimals=i,this.name=(r?"":"u")+"fixed"+String(n)+"x"+String(i),this._multiplier=zi(i),Object.freeze(this)}return Li(e,null,[{key:"from",value:function(t){if(t instanceof e)return t;"number"==typeof t&&(t="fixed128x".concat(t));var r=!0,n=128,i=18;if("string"==typeof t)if("fixed"===t);else if("ufixed"===t)r=!1;else{var o=t.match(/^(u?)fixed([0-9]+)x([0-9]+)$/);o||Hi.throwArgumentError("invalid fixed format","format",t),r="u"!==o[1],n=parseInt(o[2]),i=parseInt(o[3])}else if(t){var a=function(e,r,n){return null==t[e]?n:(ji(t[e])!==r&&Hi.throwArgumentError("invalid fixed format ("+e+" not "+r+")","format."+e,t[e]),t[e])};r=a("signed","boolean",r),n=a("width","number",n),i=a("decimals","number",i)}return n%8&&Hi.throwArgumentError("invalid fixed format width (not byte aligned)","format.width",n),i>80&&Hi.throwArgumentError("invalid fixed format (decimals too large)","format.decimals",i),new e(Gi,r,n,i)}}]),e}(),Xi=function(){function e(t,r,n,i){Ti(this,e),t!==Gi&&Hi.throwError("cannot use FixedNumber constructor; use FixedNumber.from",h.b.errors.UNSUPPORTED_OPERATION,{operation:"new FixedFormat"}),this.format=i,this._hex=r,this._value=n,this._isFixedNumber=!0,Object.freeze(this)}return Li(e,[{key:"_checkFormat",value:function(e){this.format.name!==e.format.name&&Hi.throwArgumentError("incompatible format; use fixedNumber.toFormat","other",e)}},{key:"addUnsafe",value:function(t){this._checkFormat(t);var r=Zi(this._value,this.format.decimals),n=Zi(t._value,t.format.decimals);return e.fromValue(r.add(n),this.format.decimals,this.format)}},{key:"subUnsafe",value:function(t){this._checkFormat(t);var r=Zi(this._value,this.format.decimals),n=Zi(t._value,t.format.decimals);return e.fromValue(r.sub(n),this.format.decimals,this.format)}},{key:"mulUnsafe",value:function(t){this._checkFormat(t);var r=Zi(this._value,this.format.decimals),n=Zi(t._value,t.format.decimals);return e.fromValue(r.mul(n).div(this.format._multiplier),this.format.decimals,this.format)}},{key:"divUnsafe",value:function(t){this._checkFormat(t);var r=Zi(this._value,this.format.decimals),n=Zi(t._value,t.format.decimals);return e.fromValue(r.mul(this.format._multiplier).div(n),this.format.decimals,this.format)}},{key:"floor",value:function(){var t=this.toString().split(".");1===t.length&&t.push("0");var r=e.from(t[0],this.format),n=!t[1].match(/^(0*)$/);return this.isNegative()&&n&&(r=r.subUnsafe($i.toFormat(r.format))),r}},{key:"ceiling",value:function(){var t=this.toString().split(".");1===t.length&&t.push("0");var r=e.from(t[0],this.format),n=!t[1].match(/^(0*)$/);return!this.isNegative()&&n&&(r=r.addUnsafe($i.toFormat(r.format))),r}},{key:"round",value:function(t){null==t&&(t=0);var r=this.toString().split(".");if(1===r.length&&r.push("0"),(t<0||t>80||t%1)&&Hi.throwArgumentError("invalid decimal count","decimals",t),r[1].length<=t)return this;var n=e.from("1"+Ji.substring(0,t),this.format),i=eo.toFormat(this.format);return this.mulUnsafe(n).addUnsafe(i).floor().divUnsafe(n)}},{key:"isZero",value:function(){return"0.0"===this._value||"0"===this._value}},{key:"isNegative",value:function(){return"-"===this._value[0]}},{key:"toString",value:function(){return this._value}},{key:"toHexString",value:function(e){if(null==e)return this._hex;e%8&&Hi.throwArgumentError("invalid byte width","width",e);var t=y.from(this._hex).fromTwos(this.format.width).toTwos(e).toHexString();return Object(c.h)(t,e/8)}},{key:"toUnsafeFloat",value:function(){return parseFloat(this.toString())}},{key:"toFormat",value:function(t){return e.fromString(this._value,t)}}],[{key:"fromValue",value:function(t,r,n){return null!=n||null==r||function(e){return null!=e&&(y.isBigNumber(e)||"number"==typeof e&&e%1==0||"string"==typeof e&&!!e.match(/^-?[0-9]+$/)||Object(c.l)(e)||"bigint"==typeof e||Object(c.j)(e))}(r)||(n=r,r=null),null==r&&(r=0),null==n&&(n="fixed"),e.fromString(Vi(t,r),Wi.from(n))}},{key:"fromString",value:function(t,r){null==r&&(r="fixed");var n=Wi.from(r),i=Zi(t,n.decimals);!n.signed&&i.lt(Yi)&&qi("unsigned value cannot be negative","overflow","value",t);var o=null;n.signed?o=i.toTwos(n.width).toHexString():(o=i.toHexString(),o=Object(c.h)(o,n.width/8));var a=Vi(i,n.decimals);return new e(Gi,o,a,n)}},{key:"fromBytes",value:function(t,r){null==r&&(r="fixed");var n=Wi.from(r);if(Object(c.a)(t).length>n.width/8)throw new Error("overflow");var i=y.from(t);n.signed&&(i=i.fromTwos(n.width));var o=i.toTwos((n.signed?0:1)+n.width).toHexString(),a=Vi(i,n.decimals);return new e(Gi,o,a,n)}},{key:"from",value:function(t,r){if("string"==typeof t)return e.fromString(t,r);if(Object(c.j)(t))return e.fromBytes(t,r);try{return e.fromValue(t,0,r)}catch(e){if(e.code!==h.b.errors.INVALID_ARGUMENT)throw e}return Hi.throwArgumentError("invalid FixedNumber value","value",t)}},{key:"isFixedNumber",value:function(e){return!(!e||!e._isFixedNumber)}}]),e}(),$i=Xi.from(1),eo=Xi.from("0.5");function to(e){return"string"==typeof e&&(e=be(e)),q(Object(c.b)([be("Ethereum Signed Message:\n"),be(String(e.length)),e]))}function ro(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}var no=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{A(n.next(e))}catch(e){o(e)}}function s(e){try{A(n.throw(e))}catch(e){o(e)}}function A(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}A((n=n.apply(e,t||[])).next())}))},io=new h.b("hash/5.7.0"),oo=new Uint8Array(32);oo.fill(0);var ao=y.from(-1),so=y.from(0),Ao=y.from(1),co=y.from("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff");var uo=Object(c.h)(Ao.toHexString(),32),fo=Object(c.h)(so.toHexString(),32),ho={name:"string",version:"string",chainId:"uint256",verifyingContract:"address",salt:"bytes32"},lo=["name","version","chainId","verifyingContract","salt"];function go(e){return function(t){return"string"!=typeof t&&io.throwArgumentError("invalid domain value for ".concat(JSON.stringify(e)),"domain.".concat(e),t),t}}var po={name:go("name"),version:go("version"),chainId:function(e){try{return y.from(e).toString()}catch(e){}return io.throwArgumentError('invalid domain value for "chainId"',"domain.chainId",e)},verifyingContract:function(e){try{return Ae(e).toLowerCase()}catch(e){}return io.throwArgumentError('invalid domain value "verifyingContract"',"domain.verifyingContract",e)},salt:function(e){try{var t=Object(c.a)(e);if(32!==t.length)throw new Error("bad length");return Object(c.i)(t)}catch(e){}return io.throwArgumentError('invalid domain value "salt"',"domain.salt",e)}};function Io(e){var t=e.match(/^(u?)int(\d*)$/);if(t){var r=""===t[1],n=parseInt(t[2]||"256");(n%8!=0||n>256||t[2]&&t[2]!==String(n))&&io.throwArgumentError("invalid numeric width","type",e);var i=co.mask(r?n-1:n),o=r?i.add(Ao).mul(ao):so;return function(t){var r=y.from(t);return(r.lt(o)||r.gt(i))&&io.throwArgumentError("value out-of-bounds for ".concat(e),"value",t),Object(c.h)(r.toTwos(256).toHexString(),32)}}var a=e.match(/^bytes(\d+)$/);if(a){var s=parseInt(a[1]);return(0===s||s>32||a[1]!==String(s))&&io.throwArgumentError("invalid bytes width","type",e),function(t){return Object(c.a)(t).length!==s&&io.throwArgumentError("invalid length for ".concat(e),"value",t),function(e){var t=Object(c.a)(e),r=t.length%32;return r?Object(c.c)([t,oo.slice(r)]):Object(c.i)(t)}(t)}}switch(e){case"address":return function(e){return Object(c.h)(Ae(e),32)};case"bool":return function(e){return e?uo:fo};case"bytes":return function(e){return q(e)};case"string":return function(e){return we(e)}}return null}function yo(e,t){return"".concat(e,"(").concat(t.map((function(e){var t=e.name;return e.type+" "+t})).join(","),")")}var bo=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),_(this,"types",Object.freeze(N(t))),_(this,"_encoderCache",{}),_(this,"_types",{});var r={},n={},i={};Object.keys(t).forEach((function(e){r[e]={},n[e]=[],i[e]={}}));var o=function(e){var i={};t[e].forEach((function(o){i[o.name]&&io.throwArgumentError("duplicate variable name ".concat(JSON.stringify(o.name)," in ").concat(JSON.stringify(e)),"types",t),i[o.name]=!0;var a=o.type.match(/^([^\x5b]*)(\x5b|$)/)[1];a===e&&io.throwArgumentError("circular type reference to ".concat(JSON.stringify(a)),"types",t),Io(a)||(n[a]||io.throwArgumentError("unknown type ".concat(JSON.stringify(a)),"types",t),n[a].push(e),r[e][a]=!0)}))};for(var a in t)o(a);var s=Object.keys(n).filter((function(e){return 0===n[e].length}));for(var A in 0===s.length?io.throwArgumentError("missing primary type","types",t):s.length>1&&io.throwArgumentError("ambiguous primary types or unused types: ".concat(s.map((function(e){return JSON.stringify(e)})).join(", ")),"types",t),_(this,"primaryType",s[0]),function e(o,a){a[o]&&io.throwArgumentError("circular type reference to ".concat(JSON.stringify(o)),"types",t),a[o]=!0,Object.keys(r[o]).forEach((function(t){n[t]&&(e(t,a),Object.keys(a).forEach((function(e){i[e][t]=!0})))})),delete a[o]}(this.primaryType,{}),i){var c=Object.keys(i[A]);c.sort(),this._types[A]=yo(A,t[A])+c.map((function(e){return yo(e,t[e])})).join("")}}var t,r,n;return t=e,n=[{key:"from",value:function(t){return new e(t)}},{key:"getPrimaryType",value:function(t){return e.from(t).primaryType}},{key:"hashStruct",value:function(t,r,n){return e.from(r).hashStruct(t,n)}},{key:"hashDomain",value:function(t){var r=[];for(var n in t){var i=ho[n];i||io.throwArgumentError("invalid typed-data domain key: ".concat(JSON.stringify(n)),"domain",t),r.push({name:n,type:i})}return r.sort((function(e,t){return lo.indexOf(e.name)-lo.indexOf(t.name)})),e.hashStruct("EIP712Domain",{EIP712Domain:r},t)}},{key:"encode",value:function(t,r,n){return Object(c.c)(["0x1901",e.hashDomain(t),e.from(r).hash(n)])}},{key:"hash",value:function(t,r,n){return q(e.encode(t,r,n))}},{key:"resolveNames",value:function(t,r,n,i){return no(this,void 0,void 0,regeneratorRuntime.mark((function o(){var a,s,A;return regeneratorRuntime.wrap((function(o){for(;;)switch(o.prev=o.next){case 0:t=R(t),a={},t.verifyingContract&&!Object(c.l)(t.verifyingContract,20)&&(a[t.verifyingContract]="0x"),(s=e.from(r)).visit(n,(function(e,t){return"address"!==e||Object(c.l)(t,20)||(a[t]="0x"),t})),o.t0=regeneratorRuntime.keys(a);case 6:if((o.t1=o.t0()).done){o.next=13;break}return A=o.t1.value,o.next=10,i(A);case 10:a[A]=o.sent,o.next=6;break;case 13:return t.verifyingContract&&a[t.verifyingContract]&&(t.verifyingContract=a[t.verifyingContract]),n=s.visit(n,(function(e,t){return"address"===e&&a[t]?a[t]:t})),o.abrupt("return",{domain:t,value:n});case 16:case"end":return o.stop()}}),o)})))}},{key:"getPayload",value:function(t,r,n){e.hashDomain(t);var i={},o=[];lo.forEach((function(e){var r=t[e];null!=r&&(i[e]=po[e](r),o.push({name:e,type:ho[e]}))}));var a=e.from(r),s=R(r);return s.EIP712Domain?io.throwArgumentError("types must not contain EIP712Domain type","types.EIP712Domain",r):s.EIP712Domain=o,a.encode(n),{types:s,domain:i,primaryType:a.primaryType,message:a.visit(n,(function(e,t){if(e.match(/^bytes(\d*)/))return Object(c.i)(Object(c.a)(t));if(e.match(/^u?int/))return y.from(t).toString();switch(e){case"address":return t.toLowerCase();case"bool":return!!t;case"string":return"string"!=typeof t&&io.throwArgumentError("invalid string","value",t),t}return io.throwArgumentError("unsupported type","type",e)}))}}}],(r=[{key:"getEncoder",value:function(e){var t=this._encoderCache[e];return t||(t=this._encoderCache[e]=this._getEncoder(e)),t}},{key:"_getEncoder",value:function(e){var t=this,r=Io(e);if(r)return r;var n=e.match(/^(.*)(\x5b(\d*)\x5d)$/);if(n){var i=n[1],o=this.getEncoder(i),a=parseInt(n[3]);return function(e){a>=0&&e.length!==a&&io.throwArgumentError("array length mismatch; expected length ${ arrayLength }","value",e);var r=e.map(o);return t._types[i]&&(r=r.map(q)),q(Object(c.c)(r))}}var s=this.types[e];if(s){var A=we(this._types[e]);return function(e){var r=s.map((function(r){var n=r.name,i=r.type,o=t.getEncoder(i)(e[n]);return t._types[i]?q(o):o}));return r.unshift(A),Object(c.c)(r)}}return io.throwArgumentError("unknown type: ".concat(e),"type",e)}},{key:"encodeType",value:function(e){var t=this._types[e];return t||io.throwArgumentError("unknown type: ".concat(JSON.stringify(e)),"name",e),t}},{key:"encodeData",value:function(e,t){return this.getEncoder(e)(t)}},{key:"hashStruct",value:function(e,t){return q(this.encodeData(e,t))}},{key:"encode",value:function(e){return this.encodeData(this.primaryType,e)}},{key:"hash",value:function(e){return this.hashStruct(this.primaryType,e)}},{key:"_visit",value:function(e,t,r){var n=this;if(Io(e))return r(e,t);var i=e.match(/^(.*)(\x5b(\d*)\x5d)$/);if(i){var o=i[1],a=parseInt(i[3]);return a>=0&&t.length!==a&&io.throwArgumentError("array length mismatch; expected length ${ arrayLength }","value",t),t.map((function(e){return n._visit(o,e,r)}))}var s=this.types[e];return s?s.reduce((function(e,i){var o=i.name,a=i.type;return e[o]=n._visit(a,t[o],r),e}),{}):io.throwArgumentError("unknown type: ".concat(e),"type",e)}},{key:"visit",value:function(e,t){return this._visit(this.primaryType,e,t)}}])&&ro(t.prototype,r),n&&ro(t,n),Object.defineProperty(t,"prototype",{writable:!1}),e}();function Eo(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}var mo,Co=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),_(this,"alphabet",t),_(this,"base",t.length),_(this,"_alphabetMap",{}),_(this,"_leader",t.charAt(0));for(var r=0;r<t.length;r++)this._alphabetMap[t.charAt(r)]=r}var t,r,n;return t=e,(r=[{key:"encode",value:function(e){var t=Object(c.a)(e);if(0===t.length)return"";for(var r=[0],n=0;n<t.length;++n){for(var i=t[n],o=0;o<r.length;++o)i+=r[o]<<8,r[o]=i%this.base,i=i/this.base|0;for(;i>0;)r.push(i%this.base),i=i/this.base|0}for(var a="",s=0;0===t[s]&&s<t.length-1;++s)a+=this._leader;for(var A=r.length-1;A>=0;--A)a+=this.alphabet[r[A]];return a}},{key:"decode",value:function(e){if("string"!=typeof e)throw new TypeError("Expected String");var t=[];if(0===e.length)return new Uint8Array(t);t.push(0);for(var r=0;r<e.length;r++){var n=this._alphabetMap[e[r]];if(void 0===n)throw new Error("Non-base"+this.base+" character");for(var i=n,o=0;o<t.length;++o)i+=t[o]*this.base,t[o]=255&i,i>>=8;for(;i>0;)t.push(255&i),i>>=8}for(var a=0;e[a]===this._leader&&a<e.length-1;++a)t.push(0);return Object(c.a)(new Uint8Array(t.reverse()))}}])&&Eo(t.prototype,r),n&&Eo(t,n),Object.defineProperty(t,"prototype",{writable:!1}),e}(),vo=(new Co("abcdefghijklmnopqrstuvwxyz234567"),new Co("123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz")),Bo=r(7),wo=r.n(Bo);!function(e){e.sha256="sha256",e.sha512="sha512"}(mo||(mo={}));var Qo=new h.b("sha2/5.7.0");function ko(e){return"0x"+wo.a.ripemd160().update(Object(c.a)(e)).digest("hex")}function _o(e){return"0x"+wo.a.sha256().update(Object(c.a)(e)).digest("hex")}function So(e){return"0x"+wo.a.sha512().update(Object(c.a)(e)).digest("hex")}function Do(e,t,r){return mo[e]||Qo.throwError("unsupported algorithm "+e,h.b.errors.UNSUPPORTED_OPERATION,{operation:"hmac",algorithm:e}),"0x"+wo.a.hmac(wo.a[e],Object(c.a)(t)).update(Object(c.a)(r)).digest("hex")}function Mo(e,t,r,n,i){var o;e=Object(c.a)(e),t=Object(c.a)(t);var a,s,A=1,u=new Uint8Array(n),f=new Uint8Array(t.length+4);f.set(t);for(var h=1;h<=A;h++){f[t.length]=h>>24&255,f[t.length+1]=h>>16&255,f[t.length+2]=h>>8&255,f[t.length+3]=255&h;var l=Object(c.a)(Do(i,e,f));o||(o=l.length,s=new Uint8Array(o),a=n-((A=Math.ceil(n/o))-1)*o),s.set(l);for(var g=1;g<r;g++){l=Object(c.a)(Do(i,e,l));for(var d=0;d<o;d++)s[d]^=l[d]}var p=(h-1)*o,I=h===A?a:o;u.set(Object(c.a)(s).slice(0,I),p)}return Object(c.i)(u)}function Ro(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}var xo=new h.b("wordlists/5.7.0"),Oo=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),xo.checkAbstract(this instanceof e?this.constructor:void 0,e),_(this,"locale",t)}var t,r,n;return t=e,n=[{key:"check",value:function(e){for(var t=[],r=0;r<2048;r++){var n=e.getWord(r);if(r!==e.getWordIndex(n))return"0x";t.push(n)}return we(t.join("\n")+"\n")}},{key:"register",value:function(e,t){t||(t=e.locale)}}],(r=[{key:"split",value:function(e){return e.toLowerCase().split(/ +/g)}},{key:"join",value:function(e){return e.join(" ")}}])&&Ro(t.prototype,r),n&&Ro(t,n),Object.defineProperty(t,"prototype",{writable:!1}),e}();function No(e){return(No="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Po(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function Fo(e,t){return(Fo=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function jo(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=Uo(e);if(t){var i=Uo(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return To(this,r)}}function To(e,t){if(t&&("object"===No(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function Uo(e){return(Uo=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var Lo=null;function Ho(e){if(null==Lo&&(Lo="AbandonAbilityAbleAboutAboveAbsentAbsorbAbstractAbsurdAbuseAccessAccidentAccountAccuseAchieveAcidAcousticAcquireAcrossActActionActorActressActualAdaptAddAddictAddressAdjustAdmitAdultAdvanceAdviceAerobicAffairAffordAfraidAgainAgeAgentAgreeAheadAimAirAirportAisleAlarmAlbumAlcoholAlertAlienAllAlleyAllowAlmostAloneAlphaAlreadyAlsoAlterAlwaysAmateurAmazingAmongAmountAmusedAnalystAnchorAncientAngerAngleAngryAnimalAnkleAnnounceAnnualAnotherAnswerAntennaAntiqueAnxietyAnyApartApologyAppearAppleApproveAprilArchArcticAreaArenaArgueArmArmedArmorArmyAroundArrangeArrestArriveArrowArtArtefactArtistArtworkAskAspectAssaultAssetAssistAssumeAsthmaAthleteAtomAttackAttendAttitudeAttractAuctionAuditAugustAuntAuthorAutoAutumnAverageAvocadoAvoidAwakeAwareAwayAwesomeAwfulAwkwardAxisBabyBachelorBaconBadgeBagBalanceBalconyBallBambooBananaBannerBarBarelyBargainBarrelBaseBasicBasketBattleBeachBeanBeautyBecauseBecomeBeefBeforeBeginBehaveBehindBelieveBelowBeltBenchBenefitBestBetrayBetterBetweenBeyondBicycleBidBikeBindBiologyBirdBirthBitterBlackBladeBlameBlanketBlastBleakBlessBlindBloodBlossomBlouseBlueBlurBlushBoardBoatBodyBoilBombBoneBonusBookBoostBorderBoringBorrowBossBottomBounceBoxBoyBracketBrainBrandBrassBraveBreadBreezeBrickBridgeBriefBrightBringBriskBroccoliBrokenBronzeBroomBrotherBrownBrushBubbleBuddyBudgetBuffaloBuildBulbBulkBulletBundleBunkerBurdenBurgerBurstBusBusinessBusyButterBuyerBuzzCabbageCabinCableCactusCageCakeCallCalmCameraCampCanCanalCancelCandyCannonCanoeCanvasCanyonCapableCapitalCaptainCarCarbonCardCargoCarpetCarryCartCaseCashCasinoCastleCasualCatCatalogCatchCategoryCattleCaughtCauseCautionCaveCeilingCeleryCementCensusCenturyCerealCertainChairChalkChampionChangeChaosChapterChargeChaseChatCheapCheckCheeseChefCherryChestChickenChiefChildChimneyChoiceChooseChronicChuckleChunkChurnCigarCinnamonCircleCitizenCityCivilClaimClapClarifyClawClayCleanClerkCleverClickClientCliffClimbClinicClipClockClogCloseClothCloudClownClubClumpClusterClutchCoachCoastCoconutCodeCoffeeCoilCoinCollectColorColumnCombineComeComfortComicCommonCompanyConcertConductConfirmCongressConnectConsiderControlConvinceCookCoolCopperCopyCoralCoreCornCorrectCostCottonCouchCountryCoupleCourseCousinCoverCoyoteCrackCradleCraftCramCraneCrashCraterCrawlCrazyCreamCreditCreekCrewCricketCrimeCrispCriticCropCrossCrouchCrowdCrucialCruelCruiseCrumbleCrunchCrushCryCrystalCubeCultureCupCupboardCuriousCurrentCurtainCurveCushionCustomCuteCycleDadDamageDampDanceDangerDaringDashDaughterDawnDayDealDebateDebrisDecadeDecemberDecideDeclineDecorateDecreaseDeerDefenseDefineDefyDegreeDelayDeliverDemandDemiseDenialDentistDenyDepartDependDepositDepthDeputyDeriveDescribeDesertDesignDeskDespairDestroyDetailDetectDevelopDeviceDevoteDiagramDialDiamondDiaryDiceDieselDietDifferDigitalDignityDilemmaDinnerDinosaurDirectDirtDisagreeDiscoverDiseaseDishDismissDisorderDisplayDistanceDivertDivideDivorceDizzyDoctorDocumentDogDollDolphinDomainDonateDonkeyDonorDoorDoseDoubleDoveDraftDragonDramaDrasticDrawDreamDressDriftDrillDrinkDripDriveDropDrumDryDuckDumbDuneDuringDustDutchDutyDwarfDynamicEagerEagleEarlyEarnEarthEasilyEastEasyEchoEcologyEconomyEdgeEditEducateEffortEggEightEitherElbowElderElectricElegantElementElephantElevatorEliteElseEmbarkEmbodyEmbraceEmergeEmotionEmployEmpowerEmptyEnableEnactEndEndlessEndorseEnemyEnergyEnforceEngageEngineEnhanceEnjoyEnlistEnoughEnrichEnrollEnsureEnterEntireEntryEnvelopeEpisodeEqualEquipEraEraseErodeErosionErrorEruptEscapeEssayEssenceEstateEternalEthicsEvidenceEvilEvokeEvolveExactExampleExcessExchangeExciteExcludeExcuseExecuteExerciseExhaustExhibitExileExistExitExoticExpandExpectExpireExplainExposeExpressExtendExtraEyeEyebrowFabricFaceFacultyFadeFaintFaithFallFalseFameFamilyFamousFanFancyFantasyFarmFashionFatFatalFatherFatigueFaultFavoriteFeatureFebruaryFederalFeeFeedFeelFemaleFenceFestivalFetchFeverFewFiberFictionFieldFigureFileFilmFilterFinalFindFineFingerFinishFireFirmFirstFiscalFishFitFitnessFixFlagFlameFlashFlatFlavorFleeFlightFlipFloatFlockFloorFlowerFluidFlushFlyFoamFocusFogFoilFoldFollowFoodFootForceForestForgetForkFortuneForumForwardFossilFosterFoundFoxFragileFrameFrequentFreshFriendFringeFrogFrontFrostFrownFrozenFruitFuelFunFunnyFurnaceFuryFutureGadgetGainGalaxyGalleryGameGapGarageGarbageGardenGarlicGarmentGasGaspGateGatherGaugeGazeGeneralGeniusGenreGentleGenuineGestureGhostGiantGiftGiggleGingerGiraffeGirlGiveGladGlanceGlareGlassGlideGlimpseGlobeGloomGloryGloveGlowGlueGoatGoddessGoldGoodGooseGorillaGospelGossipGovernGownGrabGraceGrainGrantGrapeGrassGravityGreatGreenGridGriefGritGroceryGroupGrowGruntGuardGuessGuideGuiltGuitarGunGymHabitHairHalfHammerHamsterHandHappyHarborHardHarshHarvestHatHaveHawkHazardHeadHealthHeartHeavyHedgehogHeightHelloHelmetHelpHenHeroHiddenHighHillHintHipHireHistoryHobbyHockeyHoldHoleHolidayHollowHomeHoneyHoodHopeHornHorrorHorseHospitalHostHotelHourHoverHubHugeHumanHumbleHumorHundredHungryHuntHurdleHurryHurtHusbandHybridIceIconIdeaIdentifyIdleIgnoreIllIllegalIllnessImageImitateImmenseImmuneImpactImposeImproveImpulseInchIncludeIncomeIncreaseIndexIndicateIndoorIndustryInfantInflictInformInhaleInheritInitialInjectInjuryInmateInnerInnocentInputInquiryInsaneInsectInsideInspireInstallIntactInterestIntoInvestInviteInvolveIronIslandIsolateIssueItemIvoryJacketJaguarJarJazzJealousJeansJellyJewelJobJoinJokeJourneyJoyJudgeJuiceJumpJungleJuniorJunkJustKangarooKeenKeepKetchupKeyKickKidKidneyKindKingdomKissKitKitchenKiteKittenKiwiKneeKnifeKnockKnowLabLabelLaborLadderLadyLakeLampLanguageLaptopLargeLaterLatinLaughLaundryLavaLawLawnLawsuitLayerLazyLeaderLeafLearnLeaveLectureLeftLegLegalLegendLeisureLemonLendLengthLensLeopardLessonLetterLevelLiarLibertyLibraryLicenseLifeLiftLightLikeLimbLimitLinkLionLiquidListLittleLiveLizardLoadLoanLobsterLocalLockLogicLonelyLongLoopLotteryLoudLoungeLoveLoyalLuckyLuggageLumberLunarLunchLuxuryLyricsMachineMadMagicMagnetMaidMailMainMajorMakeMammalManManageMandateMangoMansionManualMapleMarbleMarchMarginMarineMarketMarriageMaskMassMasterMatchMaterialMathMatrixMatterMaximumMazeMeadowMeanMeasureMeatMechanicMedalMediaMelodyMeltMemberMemoryMentionMenuMercyMergeMeritMerryMeshMessageMetalMethodMiddleMidnightMilkMillionMimicMindMinimumMinorMinuteMiracleMirrorMiseryMissMistakeMixMixedMixtureMobileModelModifyMomMomentMonitorMonkeyMonsterMonthMoonMoralMoreMorningMosquitoMotherMotionMotorMountainMouseMoveMovieMuchMuffinMuleMultiplyMuscleMuseumMushroomMusicMustMutualMyselfMysteryMythNaiveNameNapkinNarrowNastyNationNatureNearNeckNeedNegativeNeglectNeitherNephewNerveNestNetNetworkNeutralNeverNewsNextNiceNightNobleNoiseNomineeNoodleNormalNorthNoseNotableNoteNothingNoticeNovelNowNuclearNumberNurseNutOakObeyObjectObligeObscureObserveObtainObviousOccurOceanOctoberOdorOffOfferOfficeOftenOilOkayOldOliveOlympicOmitOnceOneOnionOnlineOnlyOpenOperaOpinionOpposeOptionOrangeOrbitOrchardOrderOrdinaryOrganOrientOriginalOrphanOstrichOtherOutdoorOuterOutputOutsideOvalOvenOverOwnOwnerOxygenOysterOzonePactPaddlePagePairPalacePalmPandaPanelPanicPantherPaperParadeParentParkParrotPartyPassPatchPathPatientPatrolPatternPausePavePaymentPeacePeanutPearPeasantPelicanPenPenaltyPencilPeoplePepperPerfectPermitPersonPetPhonePhotoPhrasePhysicalPianoPicnicPicturePiecePigPigeonPillPilotPinkPioneerPipePistolPitchPizzaPlacePlanetPlasticPlatePlayPleasePledgePluckPlugPlungePoemPoetPointPolarPolePolicePondPonyPoolPopularPortionPositionPossiblePostPotatoPotteryPovertyPowderPowerPracticePraisePredictPreferPreparePresentPrettyPreventPricePridePrimaryPrintPriorityPrisonPrivatePrizeProblemProcessProduceProfitProgramProjectPromoteProofPropertyProsperProtectProudProvidePublicPuddingPullPulpPulsePumpkinPunchPupilPuppyPurchasePurityPurposePursePushPutPuzzlePyramidQualityQuantumQuarterQuestionQuickQuitQuizQuoteRabbitRaccoonRaceRackRadarRadioRailRainRaiseRallyRampRanchRandomRangeRapidRareRateRatherRavenRawRazorReadyRealReasonRebelRebuildRecallReceiveRecipeRecordRecycleReduceReflectReformRefuseRegionRegretRegularRejectRelaxReleaseReliefRelyRemainRememberRemindRemoveRenderRenewRentReopenRepairRepeatReplaceReportRequireRescueResembleResistResourceResponseResultRetireRetreatReturnReunionRevealReviewRewardRhythmRibRibbonRiceRichRideRidgeRifleRightRigidRingRiotRippleRiskRitualRivalRiverRoadRoastRobotRobustRocketRomanceRoofRookieRoomRoseRotateRoughRoundRouteRoyalRubberRudeRugRuleRunRunwayRuralSadSaddleSadnessSafeSailSaladSalmonSalonSaltSaluteSameSampleSandSatisfySatoshiSauceSausageSaveSayScaleScanScareScatterSceneSchemeSchoolScienceScissorsScorpionScoutScrapScreenScriptScrubSeaSearchSeasonSeatSecondSecretSectionSecuritySeedSeekSegmentSelectSellSeminarSeniorSenseSentenceSeriesServiceSessionSettleSetupSevenShadowShaftShallowShareShedShellSheriffShieldShiftShineShipShiverShockShoeShootShopShortShoulderShoveShrimpShrugShuffleShySiblingSickSideSiegeSightSignSilentSilkSillySilverSimilarSimpleSinceSingSirenSisterSituateSixSizeSkateSketchSkiSkillSkinSkirtSkullSlabSlamSleepSlenderSliceSlideSlightSlimSloganSlotSlowSlushSmallSmartSmileSmokeSmoothSnackSnakeSnapSniffSnowSoapSoccerSocialSockSodaSoftSolarSoldierSolidSolutionSolveSomeoneSongSoonSorrySortSoulSoundSoupSourceSouthSpaceSpareSpatialSpawnSpeakSpecialSpeedSpellSpendSphereSpiceSpiderSpikeSpinSpiritSplitSpoilSponsorSpoonSportSpotSpraySpreadSpringSpySquareSqueezeSquirrelStableStadiumStaffStageStairsStampStandStartStateStaySteakSteelStemStepStereoStickStillStingStockStomachStoneStoolStoryStoveStrategyStreetStrikeStrongStruggleStudentStuffStumbleStyleSubjectSubmitSubwaySuccessSuchSuddenSufferSugarSuggestSuitSummerSunSunnySunsetSuperSupplySupremeSureSurfaceSurgeSurpriseSurroundSurveySuspectSustainSwallowSwampSwapSwarmSwearSweetSwiftSwimSwingSwitchSwordSymbolSymptomSyrupSystemTableTackleTagTailTalentTalkTankTapeTargetTaskTasteTattooTaxiTeachTeamTellTenTenantTennisTentTermTestTextThankThatThemeThenTheoryThereTheyThingThisThoughtThreeThriveThrowThumbThunderTicketTideTigerTiltTimberTimeTinyTipTiredTissueTitleToastTobaccoTodayToddlerToeTogetherToiletTokenTomatoTomorrowToneTongueTonightToolToothTopTopicToppleTorchTornadoTortoiseTossTotalTouristTowardTowerTownToyTrackTradeTrafficTragicTrainTransferTrapTrashTravelTrayTreatTreeTrendTrialTribeTrickTriggerTrimTripTrophyTroubleTruckTrueTrulyTrumpetTrustTruthTryTubeTuitionTumbleTunaTunnelTurkeyTurnTurtleTwelveTwentyTwiceTwinTwistTwoTypeTypicalUglyUmbrellaUnableUnawareUncleUncoverUnderUndoUnfairUnfoldUnhappyUniformUniqueUnitUniverseUnknownUnlockUntilUnusualUnveilUpdateUpgradeUpholdUponUpperUpsetUrbanUrgeUsageUseUsedUsefulUselessUsualUtilityVacantVacuumVagueValidValleyValveVanVanishVaporVariousVastVaultVehicleVelvetVendorVentureVenueVerbVerifyVersionVeryVesselVeteranViableVibrantViciousVictoryVideoViewVillageVintageViolinVirtualVirusVisaVisitVisualVitalVividVocalVoiceVoidVolcanoVolumeVoteVoyageWageWagonWaitWalkWallWalnutWantWarfareWarmWarriorWashWaspWasteWaterWaveWayWealthWeaponWearWeaselWeatherWebWeddingWeekendWeirdWelcomeWestWetWhaleWhatWheatWheelWhenWhereWhipWhisperWideWidthWifeWildWillWinWindowWineWingWinkWinnerWinterWireWisdomWiseWishWitnessWolfWomanWonderWoodWoolWordWorkWorldWorryWorthWrapWreckWrestleWristWriteWrongYardYearYellowYouYoungYouthZebraZeroZoneZoo".replace(/([A-Z])/g," $1").toLowerCase().substring(1).split(" "),"0x3c8acc1e7b08d8e76f9fda015ef48dc8c710a73cb7e0f77b2c18a9b5a7adde60"!==Oo.check(e)))throw Lo=null,new Error("BIP39 Wordlist for en (English) FAILED")}var Go=new(function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Fo(e,t)}(o,e);var t,r,n,i=jo(o);function o(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,o),i.call(this,"en")}return t=o,(r=[{key:"getWord",value:function(e){return Ho(this),Lo[e]}},{key:"getWordIndex",value:function(e){return Ho(this),Lo.indexOf(e)}}])&&Po(t.prototype,r),n&&Po(t,n),Object.defineProperty(t,"prototype",{writable:!1}),o}(Oo));Oo.register(Go);var Yo={en:Go};function Ko(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}var qo=new h.b("hdnode/5.7.0"),Jo=y.from("0xfffffffffffffffffffffffffffffffebaaedce6af48a03bbfd25e8cd0364141"),zo=be("Bitcoin seed");function Vo(e){return(1<<e)-1<<8-e}function Zo(e){return Object(c.h)(Object(c.i)(e),32)}function Wo(e){return vo.encode(Object(c.b)([e,Object(c.e)(_o(_o(e)),0,4)]))}function Xo(e){if(null==e)return Yo.en;if("string"==typeof e){var t=Yo[e];return null==t&&qo.throwArgumentError("unknown locale","wordlist",e),t}return e}var $o={},ea="m/44'/60'/0'/0/0",ta=function(){function e(t,r,n,i,o,a,s,A){if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),t!==$o)throw new Error("HDNode constructor cannot be called directly");if(r){var u=new Ln(r);_(this,"privateKey",u.privateKey),_(this,"publicKey",u.compressedPublicKey)}else _(this,"privateKey",null),_(this,"publicKey",Object(c.i)(n));_(this,"parentFingerprint",i),_(this,"fingerprint",Object(c.e)(ko(_o(this.publicKey)),0,4)),_(this,"address",Zn(this.publicKey)),_(this,"chainCode",o),_(this,"index",a),_(this,"depth",s),null==A?(_(this,"mnemonic",null),_(this,"path",null)):"string"==typeof A?(_(this,"mnemonic",null),_(this,"path",A)):(_(this,"mnemonic",A),_(this,"path",A.path))}var t,r,n;return t=e,n=[{key:"_fromSeed",value:function(t,r){var n=Object(c.a)(t);if(n.length<16||n.length>64)throw new Error("invalid seed");var i=Object(c.a)(Do(mo.sha512,zo,n));return new e($o,Zo(i.slice(0,32)),null,"0x00000000",Zo(i.slice(32)),0,0,r)}},{key:"fromMnemonic",value:function(t,r,n){return t=ia(na(t,n=Xo(n)),n),e._fromSeed(ra(t,r),{phrase:t,path:"m",locale:n.locale})}},{key:"fromSeed",value:function(t){return e._fromSeed(t,null)}},{key:"fromExtendedKey",value:function(t){var r=vo.decode(t);82===r.length&&Wo(r.slice(0,78))===t||qo.throwArgumentError("invalid extended key","extendedKey","[REDACTED]");var n=r[4],i=Object(c.i)(r.slice(5,9)),o=parseInt(Object(c.i)(r.slice(9,13)).substring(2),16),a=Object(c.i)(r.slice(13,45)),s=r.slice(45,78);switch(Object(c.i)(r.slice(0,4))){case"0x0488b21e":case"0x043587cf":return new e($o,null,Object(c.i)(s),i,a,o,n,null);case"0x0488ade4":case"0x04358394 ":if(0!==s[0])break;return new e($o,Object(c.i)(s.slice(1)),null,i,a,o,n,null)}return qo.throwArgumentError("invalid extended key","extendedKey","[REDACTED]")}}],(r=[{key:"extendedKey",get:function(){if(this.depth>=256)throw new Error("Depth too large!");return Wo(Object(c.b)([null!=this.privateKey?"0x0488ADE4":"0x0488B21E",Object(c.i)(this.depth),this.parentFingerprint,Object(c.h)(Object(c.i)(this.index),4),this.chainCode,null!=this.privateKey?Object(c.b)(["0x00",this.privateKey]):this.publicKey]))}},{key:"neuter",value:function(){return new e($o,null,this.publicKey,this.parentFingerprint,this.chainCode,this.index,this.depth,this.path)}},{key:"_derive",value:function(t){if(t>4294967295)throw new Error("invalid index - "+String(t));var r=this.path;r&&(r+="/"+(2147483647&t));var n=new Uint8Array(37);if(2147483648&t){if(!this.privateKey)throw new Error("cannot derive child of neutered node");n.set(Object(c.a)(this.privateKey),1),r&&(r+="'")}else n.set(Object(c.a)(this.publicKey));for(var i=24;i>=0;i-=8)n[33+(i>>3)]=t>>24-i&255;var o=Object(c.a)(Do(mo.sha512,this.chainCode,n)),a=o.slice(0,32),s=o.slice(32),A=null,u=null;this.privateKey?A=Zo(y.from(a).add(this.privateKey).mod(Jo)):u=new Ln(Object(c.i)(a))._addPoint(this.publicKey);var f=r,h=this.mnemonic;return h&&(f=Object.freeze({phrase:h.phrase,path:r,locale:h.locale||"en"})),new e($o,A,u,this.fingerprint,Zo(s),t,this.depth+1,f)}},{key:"derivePath",value:function(e){var t=e.split("/");if(0===t.length||"m"===t[0]&&0!==this.depth)throw new Error("invalid path - "+e);"m"===t[0]&&t.shift();for(var r=this,n=0;n<t.length;n++){var i=t[n];if(i.match(/^[0-9]+'$/)){var o=parseInt(i.substring(0,i.length-1));if(o>=2147483648)throw new Error("invalid path index - "+i);r=r._derive(2147483648+o)}else{if(!i.match(/^[0-9]+$/))throw new Error("invalid path component - "+i);var a=parseInt(i);if(a>=2147483648)throw new Error("invalid path index - "+i);r=r._derive(a)}}return r}}])&&Ko(t.prototype,r),n&&Ko(t,n),Object.defineProperty(t,"prototype",{writable:!1}),e}();function ra(e,t){t||(t="");var r=be("mnemonic"+t,le.NFKD);return Mo(be(e,le.NFKD),r,2048,64,"sha512")}function na(e,t){t=Xo(t),qo.checkNormalize();var r=t.split(e);if(r.length%3!=0)throw new Error("invalid mnemonic");for(var n=Object(c.a)(new Uint8Array(Math.ceil(11*r.length/8))),i=0,o=0;o<r.length;o++){var a=t.getWordIndex(r[o].normalize("NFKD"));if(-1===a)throw new Error("invalid mnemonic");for(var s=0;s<11;s++)a&1<<10-s&&(n[i>>3]|=1<<7-i%8),i++}var A=32*r.length/3,u=Vo(r.length/3);if((Object(c.a)(_o(n.slice(0,A/8)))[0]&u)!==(n[n.length-1]&u))throw new Error("invalid checksum");return Object(c.i)(n.slice(0,A/8))}function ia(e,t){if(t=Xo(t),(e=Object(c.a)(e)).length%4!=0||e.length<16||e.length>32)throw new Error("invalid entropy");for(var r=[0],n=11,i=0;i<e.length;i++)n>8?(r[r.length-1]<<=8,r[r.length-1]|=e[i],n-=8):(r[r.length-1]<<=n,r[r.length-1]|=e[i]>>8-n,r.push(e[i]&(1<<8-n)-1),n+=3);var o=e.length/4,a=Object(c.a)(_o(e))[0]&Vo(o);return r[r.length-1]<<=o,r[r.length-1]|=a>>8-o,t.join(r.map((function(e){return t.getWord(e)})))}function oa(e,t){try{return na(e,t),!0}catch(e){}return!1}function aa(e){return("number"!=typeof e||e<0||e>=2147483648||e%1)&&qo.throwArgumentError("invalid account index","index",e),"m/44'/60'/".concat(e,"'/0/0")}var sa=r(337),Aa=r(14),ca=r.n(Aa),ua=r(49),fa=r.n(ua);function ha(e){return"string"==typeof e&&"0x"!==e.substring(0,2)&&(e="0x"+e),Object(c.a)(e)}function la(e,t){for(e=String(e);e.length<t;)e="0"+e;return e}function ga(e){return"string"==typeof e?be(e,le.NFKC):Object(c.a)(e)}function da(e,t){for(var r=e,n=t.toLowerCase().split("/"),i=0;i<n.length;i++){var o=null;for(var a in r)if(a.toLowerCase()===n[i]){o=r[a];break}if(null===o)return null;r=o}return r}function pa(e){var t=Object(c.a)(e);t[6]=15&t[6]|64,t[8]=63&t[8]|128;var r=Object(c.i)(t);return[r.substring(2,10),r.substring(10,14),r.substring(14,18),r.substring(18,22),r.substring(22,34)].join("-")}function Ia(e){return(Ia="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function ya(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function ba(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function Ea(e,t){return(Ea=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function ma(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=va(e);if(t){var i=va(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return Ca(this,r)}}function Ca(e,t){if(t&&("object"===Ia(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function va(e){return(va=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var Ba=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{A(n.next(e))}catch(e){o(e)}}function s(e){try{A(n.throw(e))}catch(e){o(e)}}function A(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}A((n=n.apply(e,t||[])).next())}))},wa=new h.b("json-wallets/5.7.0");function Qa(e){return null!=e&&e.mnemonic&&e.mnemonic.phrase}var ka=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Ea(e,t)}(o,e);var t,r,n,i=ma(o);function o(){return ya(this,o),i.apply(this,arguments)}return t=o,(r=[{key:"isKeystoreAccount",value:function(e){return!(!e||!e._isKeystoreAccount)}}])&&ba(t.prototype,r),n&&ba(t,n),Object.defineProperty(t,"prototype",{writable:!1}),o}(P);function _a(e,t){var r=ha(da(e,"crypto/ciphertext"));if(Object(c.i)(q(Object(c.b)([t.slice(16,32),r]))).substring(2)!==da(e,"crypto/mac").toLowerCase())throw new Error("invalid password");var n=function(e,t,r){if("aes-128-ctr"===da(e,"crypto/cipher")){var n=ha(da(e,"crypto/cipherparams/iv")),i=new ca.a.Counter(n),o=new ca.a.ModeOfOperation.ctr(t,i);return Object(c.a)(o.decrypt(r))}return null}(e,t.slice(0,16),r);n||wa.throwError("unsupported cipher",h.b.errors.UNSUPPORTED_OPERATION,{operation:"decrypt"});var i=t.slice(32,64),o=Zn(n);if(e.address){var a=e.address.toLowerCase();if("0x"!==a.substring(0,2)&&(a="0x"+a),Ae(a)!==o)throw new Error("address mismatch")}var s={_isKeystoreAccount:!0,address:o,privateKey:Object(c.i)(n)};if("0.1"===da(e,"x-ethers/version")){var A=ha(da(e,"x-ethers/mnemonicCiphertext")),u=ha(da(e,"x-ethers/mnemonicCounter")),f=new ca.a.Counter(u),l=new ca.a.ModeOfOperation.ctr(i,f),g=da(e,"x-ethers/path")||ea,d=da(e,"x-ethers/locale")||"en",p=Object(c.a)(l.decrypt(A));try{var I=ia(p,d),y=ta.fromMnemonic(I,null,d).derivePath(g);if(y.privateKey!=s.privateKey)throw new Error("mnemonic mismatch");s.mnemonic=y.mnemonic}catch(e){if(e.code!==h.b.errors.INVALID_ARGUMENT||"wordlist"!==e.argument)throw e}}return new ka(s)}function Sa(e,t,r,n,i){return Object(c.a)(Mo(e,t,r,n,i))}function Da(e,t,r,n,i){return Promise.resolve(Sa(e,t,r,n,i))}function Ma(e,t,r,n,i){var o=ga(t),a=da(e,"crypto/kdf");if(a&&"string"==typeof a){var s=function(e,t){return wa.throwArgumentError("invalid key-derivation function parameters",e,t)};if("scrypt"===a.toLowerCase()){var A=ha(da(e,"crypto/kdfparams/salt")),c=parseInt(da(e,"crypto/kdfparams/n")),u=parseInt(da(e,"crypto/kdfparams/r")),f=parseInt(da(e,"crypto/kdfparams/p"));c&&u&&f||s("kdf",a),0!=(c&c-1)&&s("N",c);var h=parseInt(da(e,"crypto/kdfparams/dklen"));return 32!==h&&s("dklen",h),n(o,A,c,u,f,64,i)}if("pbkdf2"===a.toLowerCase()){var l=ha(da(e,"crypto/kdfparams/salt")),g=null,d=da(e,"crypto/kdfparams/prf");"hmac-sha256"===d?g="sha256":"hmac-sha512"===d?g="sha512":s("prf",d);var p=parseInt(da(e,"crypto/kdfparams/c")),I=parseInt(da(e,"crypto/kdfparams/dklen"));return 32!==I&&s("dklen",I),r(o,l,p,I,g)}}return wa.throwArgumentError("unsupported key-derivation function","kdf",a)}function Ra(e){return(Ra="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function xa(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Oa(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function Na(e,t){return(Na=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Pa(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=ja(e);if(t){var i=ja(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return Fa(this,r)}}function Fa(e,t){if(t&&("object"===Ra(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function ja(e){return(ja=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var Ta=new h.b("json-wallets/5.7.0"),Ua=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Na(e,t)}(o,e);var t,r,n,i=Pa(o);function o(){return xa(this,o),i.apply(this,arguments)}return t=o,(r=[{key:"isCrowdsaleAccount",value:function(e){return!(!e||!e._isCrowdsaleAccount)}}])&&Oa(t.prototype,r),n&&Oa(t,n),Object.defineProperty(t,"prototype",{writable:!1}),o}(P);function La(e,t){var r=JSON.parse(e);t=ga(t);var n=Ae(da(r,"ethaddr")),i=ha(da(r,"encseed"));i&&i.length%16==0||Ta.throwArgumentError("invalid encseed","json",e);for(var o=Object(c.a)(Mo(t,t,2e3,32,"sha256")).slice(0,16),a=i.slice(0,16),s=i.slice(16),A=new ca.a.ModeOfOperation.cbc(o,a),u=ca.a.padding.pkcs7.strip(Object(c.a)(A.decrypt(s))),f="",h=0;h<u.length;h++)f+=String.fromCharCode(u[h]);var l=q(be(f));return new Ua({_isCrowdsaleAccount:!0,address:n,privateKey:l})}function Ha(e){var t=null;try{t=JSON.parse(e)}catch(e){return!1}return t.encseed&&t.ethaddr}function Ga(e){var t=null;try{t=JSON.parse(e)}catch(e){return!1}return!(!t.version||parseInt(t.version)!==t.version||3!==parseInt(t.version))}function Ya(e){if(Ha(e))try{return Ae(JSON.parse(e).ethaddr)}catch(e){return null}if(Ga(e))try{return Ae(JSON.parse(e).address)}catch(e){return null}return null}function Ka(e,t,r){if(Ha(e)){r&&r(0);var n=La(e,t);return r&&r(1),Promise.resolve(n)}return Ga(e)?function(e,t,r){return Ba(this,void 0,void 0,regeneratorRuntime.mark((function n(){var i,o;return regeneratorRuntime.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return i=JSON.parse(e),n.next=3,Ma(i,t,Da,fa.a.scrypt,r);case 3:return o=n.sent,n.abrupt("return",_a(i,o));case 5:case"end":return n.stop()}}),n)})))}(e,t,r):Promise.reject(new Error("invalid JSON wallet"))}function qa(e,t){if(Ha(e))return La(e,t);if(Ga(e))return function(e,t){var r=JSON.parse(e);return _a(r,Ma(r,t,Sa,fa.a.syncScrypt))}(e,t);throw new Error("invalid JSON wallet")}function Ja(e){return(Ja="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function za(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function Va(e,t){return(Va=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Za(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=$a(e);if(t){var i=$a(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return Wa(this,r)}}function Wa(e,t){if(t&&("object"===Ja(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return Xa(e)}function Xa(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function $a(e){return($a=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var es=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{A(n.next(e))}catch(e){o(e)}}function s(e){try{A(n.throw(e))}catch(e){o(e)}}function A(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}A((n=n.apply(e,t||[])).next())}))},ts=new h.b("wallet/5.7.0");var rs=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Va(e,t)}(o,e);var t,r,n,i=Za(o);function o(e,t){var r,n;if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,o),r=i.call(this),null!=(n=e)&&Object(c.l)(n.privateKey,32)&&null!=n.address){var a=new Ln(e.privateKey);if(_(Xa(r),"_signingKey",(function(){return a})),_(Xa(r),"address",Zn(r.publicKey)),r.address!==Ae(e.address)&&ts.throwArgumentError("privateKey/address mismatch","privateKey","[REDACTED]"),function(e){var t=e.mnemonic;return t&&t.phrase}(e)){var s=e.mnemonic;_(Xa(r),"_mnemonic",(function(){return{phrase:s.phrase,path:s.path||ea,locale:s.locale||"en"}}));var A=r.mnemonic;Zn(ta.fromMnemonic(A.phrase,null,A.locale).derivePath(A.path).privateKey)!==r.address&&ts.throwArgumentError("mnemonic/address mismatch","privateKey","[REDACTED]")}else _(Xa(r),"_mnemonic",(function(){return null}))}else{if(Ln.isSigningKey(e))"secp256k1"!==e.curve&&ts.throwArgumentError("unsupported curve; must be secp256k1","privateKey","[REDACTED]"),_(Xa(r),"_signingKey",(function(){return e}));else{"string"==typeof e&&e.match(/^[0-9a-f]*$/i)&&64===e.length&&(e="0x"+e);var u=new Ln(e);_(Xa(r),"_signingKey",(function(){return u}))}_(Xa(r),"_mnemonic",(function(){return null})),_(Xa(r),"address",Zn(r.publicKey))}return t&&!En.isProvider(t)&&ts.throwArgumentError("invalid provider","provider",t),_(Xa(r),"provider",t||null),r}return t=o,n=[{key:"createRandom",value:function(e){var t=Object(sa.a)(16);e||(e={}),e.extraEntropy&&(t=Object(c.a)(Object(c.e)(q(Object(c.b)([t,e.extraEntropy])),0,16)));var r=ia(t,e.locale);return o.fromMnemonic(r,e.path,e.locale)}},{key:"fromEncryptedJson",value:function(e,t,r){return Ka(e,t,r).then((function(e){return new o(e)}))}},{key:"fromEncryptedJsonSync",value:function(e,t){return new o(qa(e,t))}},{key:"fromMnemonic",value:function(e,t,r){return t||(t=ea),new o(ta.fromMnemonic(e,null,r).derivePath(t))}}],(r=[{key:"mnemonic",get:function(){return this._mnemonic()}},{key:"privateKey",get:function(){return this._signingKey().privateKey}},{key:"publicKey",get:function(){return this._signingKey().publicKey}},{key:"getAddress",value:function(){return Promise.resolve(this.address)}},{key:"connect",value:function(e){return new o(this,e)}},{key:"signTransaction",value:function(e){var t=this;return D(e).then((function(r){null!=r.from&&(Ae(r.from)!==t.address&&ts.throwArgumentError("transaction from address mismatch","transaction.from",e.from),delete r.from);var n=t._signingKey().signDigest(q(ii(r)));return ii(r,n)}))}},{key:"signMessage",value:function(e){return es(this,void 0,void 0,regeneratorRuntime.mark((function t(){return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",Object(c.m)(this._signingKey().signDigest(to(e))));case 1:case"end":return t.stop()}}),t,this)})))}},{key:"_signTypedData",value:function(e,t,r){return es(this,void 0,void 0,regeneratorRuntime.mark((function n(){var i,o=this;return regeneratorRuntime.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,bo.resolveNames(e,t,r,(function(e){return null==o.provider&&ts.throwError("cannot resolve ENS names without a provider",h.b.errors.UNSUPPORTED_OPERATION,{operation:"resolveName",value:e}),o.provider.resolveName(e)}));case 2:return i=n.sent,n.abrupt("return",Object(c.m)(this._signingKey().signDigest(bo.hash(i.domain,t,i.value))));case 4:case"end":return n.stop()}}),n,this)})))}},{key:"encrypt",value:function(e,t,r){if("function"!=typeof t||r||(r=t,t={}),r&&"function"!=typeof r)throw new Error("invalid callback");return t||(t={}),function(e,t,r,n){try{if(Ae(e.address)!==Zn(e.privateKey))throw new Error("address/privateKey mismatch");if(Qa(e)){var i=e.mnemonic;if(ta.fromMnemonic(i.phrase,null,i.locale).derivePath(i.path||ea).privateKey!=e.privateKey)throw new Error("mnemonic mismatch")}}catch(e){return Promise.reject(e)}"function"!=typeof r||n||(n=r,r={}),r||(r={});var o=Object(c.a)(e.privateKey),a=ga(t),s=null,A=null,u=null;if(Qa(e)){var f=e.mnemonic;s=Object(c.a)(na(f.phrase,f.locale||"en")),A=f.path||ea,u=f.locale||"en"}var h=r.client;h||(h="ethers.js");var l=null;l=r.salt?Object(c.a)(r.salt):Object(sa.a)(32);var g=null;if(r.iv){if(16!==(g=Object(c.a)(r.iv)).length)throw new Error("invalid iv")}else g=Object(sa.a)(16);var d=null;if(r.uuid){if(16!==(d=Object(c.a)(r.uuid)).length)throw new Error("invalid uuid")}else d=Object(sa.a)(16);var p=1<<17,I=8,y=1;return r.scrypt&&(r.scrypt.N&&(p=r.scrypt.N),r.scrypt.r&&(I=r.scrypt.r),r.scrypt.p&&(y=r.scrypt.p)),fa.a.scrypt(a,l,p,I,y,64,n).then((function(t){var r=(t=Object(c.a)(t)).slice(0,16),n=t.slice(16,32),i=t.slice(32,64),a=new ca.a.Counter(g),f=new ca.a.ModeOfOperation.ctr(r,a),b=Object(c.a)(f.encrypt(o)),E=q(Object(c.b)([n,b])),m={address:e.address.substring(2).toLowerCase(),id:pa(d),version:3,crypto:{cipher:"aes-128-ctr",cipherparams:{iv:Object(c.i)(g).substring(2)},ciphertext:Object(c.i)(b).substring(2),kdf:"scrypt",kdfparams:{salt:Object(c.i)(l).substring(2),n:p,dklen:32,p:y,r:I},mac:E.substring(2)}};if(s){var C=Object(sa.a)(16),v=new ca.a.Counter(C),B=new ca.a.ModeOfOperation.ctr(i,v),w=Object(c.a)(B.encrypt(s)),Q=new Date,k=Q.getUTCFullYear()+"-"+la(Q.getUTCMonth()+1,2)+"-"+la(Q.getUTCDate(),2)+"T"+la(Q.getUTCHours(),2)+"-"+la(Q.getUTCMinutes(),2)+"-"+la(Q.getUTCSeconds(),2)+".0Z";m["x-ethers"]={client:h,gethFilename:"UTC--"+k+"--"+m.address,mnemonicCounter:Object(c.i)(C).substring(2),mnemonicCiphertext:Object(c.i)(w).substring(2),path:A,locale:u,version:"0.1"}}return JSON.stringify(m)}))}(this,e,t,r)}}])&&za(t.prototype,r),n&&za(t,n),Object.defineProperty(t,"prototype",{writable:!1}),o}(On);function ns(e,t){return Wn(to(e),t)}function is(e,t,r,n){return Wn(bo.hash(e,t,r),n)}var os="0x0000000000000000000000000000000000000000",as="0x0000000000000000000000000000000000000000000000000000000000000000",ss="Ξ",As=new h.b("networks/5.7.1");function cs(e){var t=function(t,r){null==r&&(r={});var n=[];if(t.InfuraProvider&&"-"!==r.infura)try{n.push(new t.InfuraProvider(e,r.infura))}catch(e){}if(t.EtherscanProvider&&"-"!==r.etherscan)try{n.push(new t.EtherscanProvider(e,r.etherscan))}catch(e){}if(t.AlchemyProvider&&"-"!==r.alchemy)try{n.push(new t.AlchemyProvider(e,r.alchemy))}catch(e){}if(t.PocketProvider&&"-"!==r.pocket){try{var i=new t.PocketProvider(e,r.pocket);i.network&&-1===["goerli","ropsten","rinkeby","sepolia"].indexOf(i.network.name)&&n.push(i)}catch(e){}}if(t.CloudflareProvider&&"-"!==r.cloudflare)try{n.push(new t.CloudflareProvider(e))}catch(e){}if(t.AnkrProvider&&"-"!==r.ankr)try{var o=new t.AnkrProvider(e,r.ankr);o.network&&-1===["ropsten"].indexOf(o.network.name)&&n.push(o)}catch(e){}if(0===n.length)return null;if(t.FallbackProvider){var a=1;return null!=r.quorum?a=r.quorum:"homestead"===e&&(a=2),new t.FallbackProvider(n,a)}return n[0]};return t.renetwork=function(e){return cs(e)},t}function us(e,t){var r=function(r,n){return r.JsonRpcProvider?new r.JsonRpcProvider(e,t):null};return r.renetwork=function(t){return us(e,t)},r}var fs={chainId:1,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"homestead",_defaultProvider:cs("homestead")},hs={chainId:3,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"ropsten",_defaultProvider:cs("ropsten")},ls={chainId:63,name:"classicMordor",_defaultProvider:us("https://www.ethercluster.com/mordor","classicMordor")},gs={unspecified:{chainId:0,name:"unspecified"},homestead:fs,mainnet:fs,morden:{chainId:2,name:"morden"},ropsten:hs,testnet:hs,rinkeby:{chainId:4,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"rinkeby",_defaultProvider:cs("rinkeby")},kovan:{chainId:42,name:"kovan",_defaultProvider:cs("kovan")},goerli:{chainId:5,ensAddress:"0x00000000000C2E074eC69A0dFb2997BA6C7d2e1e",name:"goerli",_defaultProvider:cs("goerli")},kintsugi:{chainId:1337702,name:"kintsugi"},sepolia:{chainId:11155111,name:"sepolia",_defaultProvider:cs("sepolia")},classic:{chainId:61,name:"classic",_defaultProvider:us("https://www.ethercluster.com/etc","classic")},classicMorden:{chainId:62,name:"classicMorden"},classicMordor:ls,classicTestnet:ls,classicKotti:{chainId:6,name:"classicKotti",_defaultProvider:us("https://www.ethercluster.com/kotti","classicKotti")},xdai:{chainId:100,name:"xdai"},matic:{chainId:137,name:"matic",_defaultProvider:cs("matic")},maticmum:{chainId:80001,name:"maticmum"},optimism:{chainId:10,name:"optimism",_defaultProvider:cs("optimism")},"optimism-kovan":{chainId:69,name:"optimism-kovan"},"optimism-goerli":{chainId:420,name:"optimism-goerli"},arbitrum:{chainId:42161,name:"arbitrum"},"arbitrum-rinkeby":{chainId:421611,name:"arbitrum-rinkeby"},"arbitrum-goerli":{chainId:421613,name:"arbitrum-goerli"},bnb:{chainId:56,name:"bnb"},bnbt:{chainId:97,name:"bnbt"}};function ds(e){if(null==e)return null;if("number"==typeof e){for(var t in gs){var r=gs[t];if(r.chainId===e)return{name:r.name,chainId:r.chainId,ensAddress:r.ensAddress||null,_defaultProvider:r._defaultProvider||null}}return{chainId:e,name:"unknown"}}if("string"==typeof e){var n=gs[e];return null==n?null:{name:n.name,chainId:n.chainId,ensAddress:n.ensAddress,_defaultProvider:n._defaultProvider||null}}var i=gs[e.name];if(!i)return"number"!=typeof e.chainId&&As.throwArgumentError("invalid network chainId","network",e),e;0!==e.chainId&&e.chainId!==i.chainId&&As.throwArgumentError("network chainId mismatch","network",e);var o,a=e._defaultProvider||null;return null==a&&i._defaultProvider&&(a=(o=i._defaultProvider)&&"function"==typeof o.renetwork?i._defaultProvider.renetwork(e):i._defaultProvider),{name:e.name,chainId:i.chainId,ensAddress:e.ensAddress||i.ensAddress||null,_defaultProvider:a}}function ps(e){e=atob(e);for(var t=[],r=0;r<e.length;r++)t.push(e.charCodeAt(r));return Object(c.a)(t)}function Is(e){e=Object(c.a)(e);for(var t="",r=0;r<e.length;r++)t+=String.fromCharCode(e[r]);return btoa(t)}function ys(e,t){null==t&&(t=1);var r=[],n=r.forEach;return function e(t,i){n.call(t,(function(t){i>0&&Array.isArray(t)?e(t,i-1):r.push(t)}))}(e,t),r}function bs(e){return function(e){var t=0;return function(){return e[t++]}}(function(e){var t=0;function r(){return e[t++]<<8|e[t++]}for(var n=r(),i=1,o=[0,1],a=1;a<n;a++)o.push(i+=r());var s=r(),A=t;t+=s;var c=0,u=0;function f(){return 0==c&&(u=u<<8|e[t++],c=8),u>>--c&1}for(var h=Math.pow(2,31),l=h>>>1,g=l>>1,d=h-1,p=0,I=0;I<31;I++)p=p<<1|f();for(var y=[],b=0,E=h;;){for(var m=Math.floor(((p-b+1)*i-1)/E),C=0,v=n;v-C>1;){var B=C+v>>>1;m<o[B]?v=B:C=B}if(0==C)break;y.push(C);for(var w=b+Math.floor(E*o[C]/i),Q=b+Math.floor(E*o[C+1]/i)-1;0==((w^Q)&l);)p=p<<1&d|f(),w=w<<1&d,Q=Q<<1&d|1;for(;w&~Q&g;)p=p&l|p<<1&d>>>1|f(),w=w<<1^l,Q=(Q^l)<<1|l|1;b=w,E=1+Q-w}var k=n-4;return y.map((function(t){switch(t-k){case 3:return k+65792+(e[A++]<<16|e[A++]<<8|e[A++]);case 2:return k+256+(e[A++]<<8|e[A++]);case 1:return k+e[A++];default:return t-1}}))}(e))}function Es(e){return 1&e?~e>>1:e>>1}function ms(e,t){for(var r=Array(e),n=0,i=-1;n<e;n++)r[n]=i+=1+t();return r}function Cs(e,t){for(var r=Array(e),n=0,i=0;n<e;n++)r[n]=i+=Es(t());return r}function vs(e,t){for(var r=ms(e(),e),n=e(),i=ms(n,e),o=function(e,t){for(var r=Array(e),n=0;n<e;n++)r[n]=1+t();return r}(n,e),a=0;a<n;a++)for(var s=0;s<o[a];s++)r.push(i[a]+s);return t?r.map((function(e){return t[e]})):r}function Bs(e,t,r){for(var n=Array(e).fill(void 0).map((function(){return[]})),i=0;i<t;i++)Cs(e,r).forEach((function(e,t){return n[t].push(e)}));return n}function ws(e,t){var r=1+t(),n=t(),i=function(e){for(var t=[];;){var r=e();if(0==r)break;t.push(r)}return t}(t);return ys(Bs(i.length,1+e,t).map((function(e,t){var o=e[0],a=e.slice(1);return Array(i[t]).fill(void 0).map((function(e,t){var i=t*n;return[o+t*r,a.map((function(e){return e+i}))]}))})))}function Qs(e,t){return Bs(1+t(),1+e,t).map((function(e){return[e[0],e.slice(1)]}))}function ks(e){return function(e){if(Array.isArray(e))return Ss(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||_s(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function _s(e,t){if(e){if("string"==typeof e)return Ss(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?Ss(e,t):void 0}}function Ss(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var Ds,Ms,Rs=bs(ps("AEQF2AO2DEsA2wIrAGsBRABxAN8AZwCcAEwAqgA0AGwAUgByADcATAAVAFYAIQAyACEAKAAYAFgAGwAjABQAMAAmADIAFAAfABQAKwATACoADgAbAA8AHQAYABoAGQAxADgALAAoADwAEwA9ABMAGgARAA4ADwAWABMAFgAIAA8AHgQXBYMA5BHJAS8JtAYoAe4AExozi0UAH21tAaMnBT8CrnIyhrMDhRgDygIBUAEHcoFHUPe8AXBjAewCjgDQR8IICIcEcQLwATXCDgzvHwBmBoHNAqsBdBcUAykgDhAMShskMgo8AY8jqAQfAUAfHw8BDw87MioGlCIPBwZCa4ELatMAAMspJVgsDl8AIhckSg8XAHdvTwBcIQEiDT4OPhUqbyECAEoAS34Aej8Ybx83JgT/Xw8gHxZ/7w8RICxPHA9vBw+Pfw8PHwAPFv+fAsAvCc8vEr8ivwD/EQ8Bol8OEBa/A78hrwAPCU8vESNvvwWfHwNfAVoDHr+ZAAED34YaAdJPAK7PLwSEgDLHAGo1Pz8Pvx9fUwMrpb8O/58VTzAPIBoXIyQJNF8hpwIVAT8YGAUADDNBaX3RAMomJCg9EhUeA29MABsZBTMNJipjOhc19gcIDR8bBwQHEggCWi6DIgLuAQYA+BAFCha3A5XiAEsqM7UFFgFLhAMjFTMYE1Klnw74nRVBG/ASCm0BYRN/BrsU3VoWy+S0vV8LQx+vN8gF2AC2AK5EAWwApgYDKmAAroQ0NDQ0AT+OCg7wAAIHRAbpNgVcBV0APTA5BfbPFgMLzcYL/QqqA82eBALKCjQCjqYCht0/k2+OAsXQAoP3ASTKDgDw6ACKAUYCMpIKJpRaAE4A5womABzZvs0REEKiACIQAd5QdAECAj4Ywg/wGqY2AVgAYADYvAoCGAEubA0gvAY2ALAAbpbvqpyEAGAEpgQAJgAG7gAgAEACmghUFwCqAMpAINQIwC4DthRAAPcycKgApoIdABwBfCisABoATwBqASIAvhnSBP8aH/ECeAKXAq40NjgDBTwFYQU6AXs3oABgAD4XNgmcCY1eCl5tIFZeUqGgyoNHABgAEQAaABNwWQAmABMATPMa3T34ADldyprmM1M2XociUQgLzvwAXT3xABgAEQAaABNwIGFAnADD8AAgAD4BBJWzaCcIAIEBFMAWwKoAAdq9BWAF5wLQpALEtQAKUSGkahR4GnJM+gsAwCgeFAiUAECQ0BQuL8AAIAAAADKeIheclvFqQAAETr4iAMxIARMgAMIoHhQIAn0E0pDQFC4HhznoAAAAIAI2C0/4lvFqQAAETgBJJwYCAy4ABgYAFAA8MBKYEH4eRhTkAjYeFcgACAYAeABsOqyQ5gRwDayqugEgaIIAtgoACgDmEABmBAWGme5OBJJA2m4cDeoAmITWAXwrMgOgAGwBCh6CBXYF1Tzg1wKAAFdiuABRAFwAXQBsAG8AdgBrAHYAbwCEAHEwfxQBVE5TEQADVFhTBwBDANILAqcCzgLTApQCrQL6vAAMAL8APLhNBKkE6glGKTAU4Dr4N2EYEwBCkABKk8rHAbYBmwIoAiU4Ajf/Aq4CowCAANIChzgaNBsCsTgeODcFXrgClQKdAqQBiQGYAqsCsjTsNHsfNPA0ixsAWTWiOAMFPDQSNCk2BDZHNow2TTZUNhk28Jk9VzI3QkEoAoICoQKwAqcAQAAxBV4FXbS9BW47YkIXP1ciUqs05DS/FwABUwJW11e6nHuYZmSh/RAYA8oMKvZ8KASoUAJYWAJ6ILAsAZSoqjpgA0ocBIhmDgDWAAawRDQoAAcuAj5iAHABZiR2AIgiHgCaAU68ACxuHAG0ygM8MiZIAlgBdF4GagJqAPZOHAMuBgoATkYAsABiAHgAMLoGDPj0HpKEBAAOJgAuALggTAHWAeAMEDbd20Uege0ADwAWADkAQgA9OHd+2MUQZBBhBgNNDkxxPxUQArEPqwvqERoM1irQ090ANK4H8ANYB/ADWANYB/AH8ANYB/ADWANYA1gDWBwP8B/YxRBkD00EcgWTBZAE2wiIJk4RhgctCNdUEnQjHEwDSgEBIypJITuYMxAlR0wRTQgIATZHbKx9PQNMMbBU+pCnA9AyVDlxBgMedhKlAC8PeCE1uk6DekxxpQpQT7NX9wBFBgASqwAS5gBJDSgAUCwGPQBI4zTYABNGAE2bAE3KAExdGABKaAbgAFBXAFCOAFBJABI2SWdObALDOq0//QomCZhvwHdTBkIQHCemEPgMNAG2ATwN7kvZBPIGPATKH34ZGg/OlZ0Ipi3eDO4m5C6igFsj9iqEBe5L9TzeC05RaQ9aC2YJ5DpkgU8DIgEOIowK3g06CG4Q9ArKbA3mEUYHOgPWSZsApgcCCxIdNhW2JhFirQsKOXgG/Br3C5AmsBMqev0F1BoiBk4BKhsAANAu6IWxWjJcHU9gBgQLJiPIFKlQIQ0mQLh4SRocBxYlqgKSQ3FKiFE3HpQh9zw+DWcuFFF9B/Y8BhlQC4I8n0asRQ8R0z6OPUkiSkwtBDaALDAnjAnQD4YMunxzAVoJIgmyDHITMhEYN8YIOgcaLpclJxYIIkaWYJsE+KAD9BPSAwwFQAlCBxQDthwuEy8VKgUOgSXYAvQ21i60ApBWgQEYBcwPJh/gEFFH4Q7qCJwCZgOEJewALhUiABginAhEZABgj9lTBi7MCMhqbSN1A2gU6GIRdAeSDlgHqBw0FcAc4nDJXgyGCSiksAlcAXYJmgFgBOQICjVcjKEgQmdUi1kYnCBiQUBd/QIyDGYVoES+h3kCjA9sEhwBNgF0BzoNAgJ4Ee4RbBCWCOyGBTW2M/k6JgRQIYQgEgooA1BszwsoJvoM+WoBpBJjAw00PnfvZ6xgtyUX/gcaMsZBYSHyC5NPzgydGsIYQ1QvGeUHwAP0GvQn60FYBgADpAQUOk4z7wS+C2oIjAlAAEoOpBgH2BhrCnKM0QEyjAG4mgNYkoQCcJAGOAcMAGgMiAV65gAeAqgIpAAGANADWAA6Aq4HngAaAIZCAT4DKDABIuYCkAOUCDLMAZYwAfQqBBzEDBYA+DhuSwLDsgKAa2ajBd5ZAo8CSjYBTiYEBk9IUgOwcuIA3ABMBhTgSAEWrEvMG+REAeBwLADIAPwABjYHBkIBzgH0bgC4AWALMgmjtLYBTuoqAIQAFmwB2AKKAN4ANgCA8gFUAE4FWvoF1AJQSgESMhksWGIBvAMgATQBDgB6BsyOpsoIIARuB9QCEBwV4gLvLwe2AgMi4BPOQsYCvd9WADIXUu5eZwqoCqdeaAC0YTQHMnM9UQAPH6k+yAdy/BZIiQImSwBQ5gBQQzSaNTFWSTYBpwGqKQK38AFtqwBI/wK37gK3rQK3sAK6280C0gK33AK3zxAAUEIAUD9SklKDArekArw5AEQAzAHCO147WTteO1k7XjtZO147WTteO1kDmChYI03AVU0oJqkKbV9GYewMpw3VRMk6ShPcYFJgMxPJLbgUwhXPJVcZPhq9JwYl5VUKDwUt1GYxCC00dhe9AEApaYNCY4ceMQpMHOhTklT5LRwAskujM7ANrRsWREEFSHXuYisWDwojAmSCAmJDXE6wXDchAqH4AmiZAmYKAp+FOBwMAmY8AmYnBG8EgAN/FAN+kzkHOXgYOYM6JCQCbB4CMjc4CwJtyAJtr/CLADRoRiwBaADfAOIASwYHmQyOAP8MwwAOtgJ3MAJ2o0ACeUxEAni7Hl3cRa9G9AJ8QAJ6yQJ9CgJ88UgBSH5kJQAsFklZSlwWGErNAtECAtDNSygDiFADh+dExpEzAvKiXQQDA69Lz0wuJgTQTU1NsAKLQAKK2cIcCB5EaAa4Ao44Ao5dQZiCAo7aAo5deVG1UzYLUtVUhgKT/AKTDQDqAB1VH1WwVdEHLBwplocy4nhnRTw6ApegAu+zWCKpAFomApaQApZ9nQCqWa1aCoJOADwClrYClk9cRVzSApnMApllXMtdCBoCnJw5wzqeApwXAp+cAp65iwAeEDIrEAKd8gKekwC2PmE1YfACntQCoG8BqgKeoCACnk+mY8lkKCYsAiewAiZ/AqD8AqBN2AKmMAKlzwKoAAB+AqfzaH1osgAESmodatICrOQCrK8CrWgCrQMCVx4CVd0CseLYAx9PbJgCsr4OArLpGGzhbWRtSWADJc4Ctl08QG6RAylGArhfArlIFgK5K3hwN3DiAr0aAy2zAzISAr6JcgMDM3ICvhtzI3NQAsPMAsMFc4N0TDZGdOEDPKgDPJsDPcACxX0CxkgCxhGKAshqUgLIRQLJUALJLwJkngLd03h6YniveSZL0QMYpGcDAmH1GfSVJXsMXpNevBICz2wCz20wTFTT9BSgAMeuAs90ASrrA04TfkwGAtwoAtuLAtJQA1JdA1NgAQIDVY2AikABzBfuYUZ2AILPg44C2sgC2d+EEYRKpz0DhqYAMANkD4ZyWvoAVgLfZgLeuXR4AuIw7RUB8zEoAfScAfLTiALr9ALpcXoAAur6AurlAPpIAboC7ooC652Wq5cEAu5AA4XhmHpw4XGiAvMEAGoDjheZlAL3FAORbwOSiAL3mQL52gL4Z5odmqy8OJsfA52EAv77ARwAOp8dn7QDBY4DpmsDptoA0sYDBmuhiaIGCgMMSgFgASACtgNGAJwEgLpoBgC8BGzAEowcggCEDC6kdjoAJAM0C5IKRoABZCgiAIzw3AYBLACkfng9ogigkgNmWAN6AEQCvrkEVqTGAwCsBRbAA+4iQkMCHR072jI2PTbUNsk2RjY5NvA23TZKNiU3EDcZN5I+RTxDRTBCJkK5VBYKFhZfwQCWygU3AJBRHpu+OytgNxa61A40GMsYjsn7BVwFXQVcBV0FaAVdBVwFXQVcBV0FXAVdBVwFXUsaCNyKAK4AAQUHBwKU7oICoW1e7jAEzgPxA+YDwgCkBFDAwADABKzAAOxFLhitA1UFTDeyPkM+bj51QkRCuwTQWWQ8X+0AWBYzsACNA8xwzAGm7EZ/QisoCTAbLDs6fnLfb8H2GccsbgFw13M1HAVkBW/Jxsm9CNRO8E8FDD0FBQw9FkcClOYCoMFegpDfADgcMiA2AJQACB8AsigKAIzIEAJKeBIApY5yPZQIAKQiHb4fvj5BKSRPQrZCOz0oXyxgOywfKAnGbgMClQaCAkILXgdeCD9IIGUgQj5fPoY+dT52Ao5CM0dAX9BTVG9SDzFwWTQAbxBzJF/lOEIQQglCCkKJIAls5AcClQICoKPMODEFxhi6KSAbiyfIRrMjtCgdWCAkPlFBIitCsEJRzAbMAV/OEyQzDg0OAQQEJ36i328/Mk9AybDJsQlq3tDRApUKAkFzXf1d/j9uALYP6hCoFgCTGD8kPsFKQiobrm0+zj0KSD8kPnVCRBwMDyJRTHFgMTJa5rwXQiQ2YfI/JD7BMEJEHGINTw4TOFlIRzwJO0icMQpyPyQ+wzJCRBv6DVgnKB01NgUKj2bwYzMqCoBkznBgEF+zYDIocwRIX+NgHj4HICNfh2C4CwdwFWpTG/lgUhYGAwRfv2Ts8mAaXzVgml/XYIJfuWC4HI1gUF9pYJZgMR6ilQHMAOwLAlDRefC0in4AXAEJA6PjCwc0IamOANMMCAECRQDFNRTZBgd+CwQlRA+r6+gLBDEFBnwUBXgKATIArwAGRAAHA3cDdAN2A3kDdwN9A3oDdQN7A30DfAN4A3oDfQAYEAAlAtYASwMAUAFsAHcKAHcAmgB3AHUAdQB2AHVu8UgAygDAAHcAdQB1AHYAdQALCgB3AAsAmgB3AAsCOwB3AAtu8UgAygDAAHgKAJoAdwB3AHUAdQB2AHUAeAB1AHUAdgB1bvFIAMoAwAALCgCaAHcACwB3AAsCOwB3AAtu8UgAygDAAH4ACwGgALcBpwC6AahdAu0COwLtbvFIAMoAwAALCgCaAu0ACwLtAAsCOwLtAAtu8UgAygDAA24ACwNvAAu0VsQAAzsAABCkjUIpAAsAUIusOggWcgMeBxVsGwL67U/2HlzmWOEeOgALASvuAAseAfpKUpnpGgYJDCIZM6YyARUE9ThqAD5iXQgnAJYJPnOzw0ZAEZxEKsIAkA4DhAHnTAIDxxUDK0lxCQlPYgIvIQVYJQBVqE1GakUAKGYiDToSBA1EtAYAXQJYAIF8GgMHRyAAIAjOe9YncekRAA0KACUrjwE7Ayc6AAYWAqaiKG4McEcqANoN3+Mg9TwCBhIkuCny+JwUQ29L008JluRxu3K+oAdqiHOqFH0AG5SUIfUJ5SxCGfxdipRzqTmT4V5Zb+r1Uo4Vm+NqSSEl2mNvR2JhIa8SpYO6ntdwFXHCWTCK8f2+Hxo7uiG3drDycAuKIMP5bhi06ACnqArH1rz4Rqg//lm6SgJGEVbF9xJHISaR6HxqxSnkw6shDnelHKNEfGUXSJRJ1GcsmtJw25xrZMDK9gXSm1/YMkdX4/6NKYOdtk/NQ3/NnDASjTc3fPjIjW/5sVfVObX2oTDWkr1dF9f3kxBsD3/3aQO8hPfRz+e0uEiJqt1161griu7gz8hDDwtpy+F+BWtefnKHZPAxcZoWbnznhJpy0e842j36bcNzGnIEusgGX0a8ZxsnjcSsPDZ09yZ36fCQbriHeQ72JRMILNl6ePPf2HWoVwgWAm1fb3V2sAY0+B6rAXqSwPBgseVmoqsBTSrm91+XasMYYySI8eeRxH3ZvHkMz3BQ5aJ3iUVbYPNM3/7emRtjlsMgv/9VyTsyt/mK+8fgWeT6SoFaclXqn42dAIsvAarF5vNNWHzKSkKQ/8Hfk5ZWK7r9yliOsooyBjRhfkHP4Q2DkWXQi6FG/9r/IwbmkV5T7JSopHKn1pJwm9tb5Ot0oyN1Z2mPpKXHTxx2nlK08fKk1hEYA8WgVVWL5lgx0iTv+KdojJeU23ZDjmiubXOxVXJKKi2Wjuh2HLZOFLiSC7Tls5SMh4f+Pj6xUSrNjFqLGehRNB8lC0QSLNmkJJx/wSG3MnjE9T1CkPwJI0wH2lfzwETIiVqUxg0dfu5q39Gt+hwdcxkhhNvQ4TyrBceof3Mhs/IxFci1HmHr4FMZgXEEczPiGCx0HRwzAqDq2j9AVm1kwN0mRVLWLylgtoPNapF5cY4Y1wJh/e0BBwZj44YgZrDNqvD/9Hv7GFYdUQeDJuQ3EWI4HaKqavU1XjC/n41kT4L79kqGq0kLhdTZvgP3TA3fS0ozVz+5piZsoOtIvBUFoMKbNcmBL6YxxaUAusHB38XrS8dQMnQwJfUUkpRoGr5AUeWicvBTzyK9g77+yCkf5PAysL7r/JjcZgrbvRpMW9iyaxZvKO6ceZN2EwIxKwVFPuvFuiEPGCoagbMo+SpydLrXqBzNCDGFCrO/rkcwa2xhokQZ5CdZ0AsU3JfSqJ6n5I14YA+P/uAgfhPU84Tlw7cEFfp7AEE8ey4sP12PTt4Cods1GRgDOB5xvyiR5m+Bx8O5nBCNctU8BevfV5A08x6RHd5jcwPTMDSZJOedIZ1cGQ704lxbAzqZOP05ZxaOghzSdvFBHYqomATARyAADK4elP8Ly3IrUZKfWh23Xy20uBUmLS4Pfagu9+oyVa2iPgqRP3F2CTUsvJ7+RYnN8fFZbU/HVvxvcFFDKkiTqV5UBZ3Gz54JAKByi9hkKMZJvuGgcSYXFmw08UyoQyVdfTD1/dMkCHXcTGAKeROgArsvmRrQTLUOXioOHGK2QkjHuoYFgXciZoTJd6Fs5q1QX1G+p/e26hYsEf7QZD1nnIyl/SFkNtYYmmBhpBrxl9WbY0YpHWRuw2Ll/tj9mD8P4snVzJl4F9J+1arVeTb9E5r2ILH04qStjxQNwn3m4YNqxmaNbLAqW2TN6LidwuJRqS+NXbtqxoeDXpxeGWmxzSkWxjkyCkX4NQRme6q5SAcC+M7+9ETfA/EwrzQajKakCwYyeunP6ZFlxU2oMEn1Pz31zeStW74G406ZJFCl1wAXIoUKkWotYEpOuXB1uVNxJ63dpJEqfxBeptwIHNrPz8BllZoIcBoXwgfJ+8VAUnVPvRvexnw0Ma/WiGYuJO5y8QTvEYBigFmhUxY5RqzE8OcywN/8m4UYrlaniJO75XQ6KSo9+tWHlu+hMi0UVdiKQp7NelnoZUzNaIyBPVeOwK6GNp+FfHuPOoyhaWuNvTYFkvxscMQWDh+zeFCFkgwbXftiV23ywJ4+uwRqmg9k3KzwIQpzppt8DBBOMbrqwQM5Gb05sEwdKzMiAqOloaA/lr0KA+1pr0/+HiWoiIjHA/wir2nIuS3PeU/ji3O6ZwoxcR1SZ9FhtLC5S0FIzFhbBWcGVP/KpxOPSiUoAdWUpqKH++6Scz507iCcxYI6rdMBICPJZea7OcmeFw5mObJSiqpjg2UoWNIs+cFhyDSt6geV5qgi3FunmwwDoGSMgerFOZGX1m0dMCYo5XOruxO063dwENK9DbnVM9wYFREzh4vyU1WYYJ/LRRp6oxgjqP/X5a8/4Af6p6NWkQferzBmXme0zY/4nwMJm/wd1tIqSwGz+E3xPEAOoZlJit3XddD7/BT1pllzOx+8bmQtANQ/S6fZexc6qi3W+Q2xcmXTUhuS5mpHQRvcxZUN0S5+PL9lXWUAaRZhEH8hTdAcuNMMCuVNKTEGtSUKNi3O6KhSaTzck8csZ2vWRZ+d7mW8c4IKwXIYd25S/zIftPkwPzufjEvOHWVD1m+FjpDVUTV0DGDuHj6QnaEwLu/dEgdLQOg9E1Sro9XHJ8ykLAwtPu+pxqKDuFexqON1sKQm7rwbE1E68UCfA/erovrTCG+DBSNg0l4goDQvZN6uNlbyLpcZAwj2UclycvLpIZMgv4yRlpb3YuMftozorbcGVHt/VeDV3+Fdf1TP0iuaCsPi2G4XeGhsyF1ubVDxkoJhmniQ0/jSg/eYML9KLfnCFgISWkp91eauR3IQvED0nAPXK+6hPCYs+n3+hCZbiskmVMG2da+0EsZPonUeIY8EbfusQXjsK/eFDaosbPjEfQS0RKG7yj5GG69M7MeO1HmiUYocgygJHL6M1qzUDDwUSmr99V7Sdr2F3JjQAJY+F0yH33Iv3+C9M38eML7gTgmNu/r2bUMiPvpYbZ6v1/IaESirBHNa7mPKn4dEmYg7v/+HQgPN1G79jBQ1+soydfDC2r+h2Bl/KIc5KjMK7OH6nb1jLsNf0EHVe2KBiE51ox636uyG6Lho0t3J34L5QY/ilE3mikaF4HKXG1mG1rCevT1Vv6GavltxoQe/bMrpZvRggnBxSEPEeEzkEdOxTnPXHVjUYdw8JYvjB/o7Eegc3Ma+NUxLLnsK0kJlinPmUHzHGtrk5+CAbVzFOBqpyy3QVUnzTDfC/0XD94/okH+OB+i7g9lolhWIjSnfIb+Eq43ZXOWmwvjyV/qqD+t0e+7mTEM74qP/Ozt8nmC7mRpyu63OB4KnUzFc074SqoyPUAgM+/TJGFo6T44EHnQU4X4z6qannVqgw/U7zCpwcmXV1AubIrvOmkKHazJAR55ePjp5tLBsN8vAqs3NAHdcEHOR2xQ0lsNAFzSUuxFQCFYvXLZJdOj9p4fNq6p0HBGUik2YzaI4xySy91KzhQ0+q1hjxvImRwPRf76tChlRkhRCi74NXZ9qUNeIwP+s5p+3m5nwPdNOHgSLD79n7O9m1n1uDHiMntq4nkYwV5OZ1ENbXxFd4PgrlvavZsyUO4MqYlqqn1O8W/I1dEZq5dXhrbETLaZIbC2Kj/Aa/QM+fqUOHdf0tXAQ1huZ3cmWECWSXy/43j35+Mvq9xws7JKseriZ1pEWKc8qlzNrGPUGcVgOa9cPJYIJsGnJTAUsEcDOEVULO5x0rXBijc1lgXEzQQKhROf8zIV82w8eswc78YX11KYLWQRcgHNJElBxfXr72lS2RBSl07qTKorO2uUDZr3sFhYsvnhLZn0A94KRzJ/7DEGIAhW5ZWFpL8gEwu1aLA9MuWZzNwl8Oze9Y+bX+v9gywRVnoB5I/8kXTXU3141yRLYrIOOz6SOnyHNy4SieqzkBXharjfjqq1q6tklaEbA8Qfm2DaIPs7OTq/nvJBjKfO2H9bH2cCMh1+5gspfycu8f/cuuRmtDjyqZ7uCIMyjdV3a+p3fqmXsRx4C8lujezIFHnQiVTXLXuI1XrwN3+siYYj2HHTvESUx8DlOTXpak9qFRK+L3mgJ1WsD7F4cu1aJoFoYQnu+wGDMOjJM3kiBQWHCcvhJ/HRdxodOQp45YZaOTA22Nb4XKCVxqkbwMYFhzYQYIAnCW8FW14uf98jhUG2zrKhQQ0q0CEq0t5nXyvUyvR8DvD69LU+g3i+HFWQMQ8PqZuHD+sNKAV0+M6EJC0szq7rEr7B5bQ8BcNHzvDMc9eqB5ZCQdTf80Obn4uzjwpYU7SISdtV0QGa9D3Wrh2BDQtpBKxaNFV+/Cy2P/Sv+8s7Ud0Fd74X4+o/TNztWgETUapy+majNQ68Lq3ee0ZO48VEbTZYiH1Co4OlfWef82RWeyUXo7woM03PyapGfikTnQinoNq5z5veLpeMV3HCAMTaZmA1oGLAn7XS3XYsz+XK7VMQsc4XKrmDXOLU/pSXVNUq8dIqTba///3x6LiLS6xs1xuCAYSfcQ3+rQgmu7uvf3THKt5Ooo97TqcbRqxx7EASizaQCBQllG/rYxVapMLgtLbZS64w1MDBMXX+PQpBKNwqUKOf2DDRDUXQf9EhOS0Qj4nTmlA8dzSLz/G1d+Ud8MTy/6ghhdiLpeerGY/UlDOfiuqFsMUU5/UYlP+BAmgRLuNpvrUaLlVkrqDievNVEAwF+4CoM1MZTmjxjJMsKJq+u8Zd7tNCUFy6LiyYXRJQ4VyvEQFFaCGKsxIwQkk7EzZ6LTJq2hUuPhvAW+gQnSG6J+MszC+7QCRHcnqDdyNRJ6T9xyS87A6MDutbzKGvGktpbXqtzWtXb9HsfK2cBMomjN9a4y+TaJLnXxAeX/HWzmf4cR4vALt/P4w4qgKY04ml4ZdLOinFYS6cup3G/1ie4+t1eOnpBNlqGqs75ilzkT4+DsZQxNvaSKJ//6zIbbk/M7LOhFmRc/1R+kBtz7JFGdZm/COotIdvQoXpTqP/1uqEUmCb/QWoGLMwO5ANcHzxdY48IGP5+J+zKOTBFZ4Pid+GTM+Wq12MV/H86xEJptBa6T+p3kgpwLedManBHC2GgNrFpoN2xnrMz9WFWX/8/ygSBkavq2Uv7FdCsLEYLu9LLIvAU0bNRDtzYl+/vXmjpIvuJFYjmI0im6QEYqnIeMsNjXG4vIutIGHijeAG/9EDBozKV5cldkHbLxHh25vT+ZEzbhXlqvpzKJwcEgfNwLAKFeo0/pvEE10XDB+EXRTXtSzJozQKFFAJhMxYkVaCW+E9AL7tMeU8acxidHqzb6lX4691UsDpy/LLRmT+epgW56+5Cw8tB4kMUv6s9lh3eRKbyGs+H/4mQMaYzPTf2OOdokEn+zzgvoD3FqNKk8QqGAXVsqcGdXrT62fSPkR2vROFi68A6se86UxRUk4cajfPyCC4G5wDhD+zNq4jodQ4u4n/m37Lr36n4LIAAsVr02dFi9AiwA81MYs2rm4eDlDNmdMRvEKRHfBwW5DdMNp0jPFZMeARqF/wL4XBfd+EMLBfMzpH5GH6NaW+1vrvMdg+VxDzatk3MXgO3ro3P/DpcC6+Mo4MySJhKJhSR01SGGGp5hPWmrrUgrv3lDnP+HhcI3nt3YqBoVAVTBAQT5iuhTg8nvPtd8ZeYj6w1x6RqGUBrSku7+N1+BaasZvjTk64RoIDlL8brpEcJx3OmY7jLoZsswdtmhfC/G21llXhITOwmvRDDeTTPbyASOa16cF5/A1fZAidJpqju3wYAy9avPR1ya6eNp9K8XYrrtuxlqi+bDKwlfrYdR0RRiKRVTLOH85+ZY7XSmzRpfZBJjaTa81VDcJHpZnZnSQLASGYW9l51ZV/h7eVzTi3Hv6hUsgc/51AqJRTkpbFVLXXszoBL8nBX0u/0jBLT8nH+fJePbrwURT58OY+UieRjd1vs04w0VG5VN2U6MoGZkQzKN/ptz0Q366dxoTGmj7i1NQGHi9GgnquXFYdrCfZBmeb7s0T6yrdlZH5cZuwHFyIJ/kAtGsTg0xH5taAAq44BAk1CPk9KVVbqQzrCUiFdF/6gtlPQ8bHHc1G1W92MXGZ5HEHftyLYs8mbD/9xYRUWkHmlM0zC2ilJlnNgV4bfALpQghxOUoZL7VTqtCHIaQSXm+YUMnpkXybnV+A6xlm2CVy8fn0Xlm2XRa0+zzOa21JWWmixfiPMSCZ7qA4rS93VN3pkpF1s5TonQjisHf7iU9ZGvUPOAKZcR1pbeVf/Ul7OhepGCaId9wOtqo7pJ7yLcBZ0pFkOF28y4zEI/kcUNmutBHaQpBdNM8vjCS6HZRokkeo88TBAjGyG7SR+6vUgTcyK9Imalj0kuxz0wmK+byQU11AiJFk/ya5dNduRClcnU64yGu/ieWSeOos1t3ep+RPIWQ2pyTYVbZltTbsb7NiwSi3AV+8KLWk7LxCnfZUetEM8ThnsSoGH38/nyAwFguJp8FjvlHtcWZuU4hPva0rHfr0UhOOJ/F6vS62FW7KzkmRll2HEc7oUq4fyi5T70Vl7YVIfsPHUCdHesf9Lk7WNVWO75JDkYbMI8TOW8JKVtLY9d6UJRITO8oKo0xS+o99Yy04iniGHAaGj88kEWgwv0OrHdY/nr76DOGNS59hXCGXzTKUvDl9iKpLSWYN1lxIeyywdNpTkhay74w2jFT6NS8qkjo5CxA1yfSYwp6AJIZNKIeEK5PJAW7ORgWgwp0VgzYpqovMrWxbu+DGZ6Lhie1RAqpzm8VUzKJOH3mCzWuTOLsN3VT/dv2eeYe9UjbR8YTBsLz7q60VN1sU51k+um1f8JxD5pPhbhSC8rRaB454tmh6YUWrJI3+GWY0qeWioj/tbkYITOkJaeuGt4JrJvHA+l0Gu7kY7XOaa05alMnRWVCXqFgLIwSY4uF59Ue5SU4QKuc/HamDxbr0x6csCetXGoP7Qn1Bk/J9DsynO/UD6iZ1Hyrz+jit0hDCwi/E9OjgKTbB3ZQKQ/0ZOvevfNHG0NK4Aj3Cp7NpRk07RT1i/S0EL93Ag8GRgKI9CfpajKyK6+Jj/PI1KO5/85VAwz2AwzP8FTBb075IxCXv6T9RVvWT2tUaqxDS92zrGUbWzUYk9mSs82pECH+fkqsDt93VW++4YsR/dHCYcQSYTO/KaBMDj9LSD/J/+z20Kq8XvZUAIHtm9hRPP3ItbuAu2Hm5lkPs92pd7kCxgRs0xOVBnZ13ccdA0aunrwv9SdqElJRC3g+oCu+nXyCgmXUs9yMjTMAIHfxZV+aPKcZeUBWt057Xo85Ks1Ir5gzEHCWqZEhrLZMuF11ziGtFQUds/EESajhagzcKsxamcSZxGth4UII+adPhQkUnx2WyN+4YWR+r3f8MnkyGFuR4zjzxJS8WsQYR5PTyRaD9ixa6Mh741nBHbzfjXHskGDq179xaRNrCIB1z1xRfWfjqw2pHc1zk9xlPpL8sQWAIuETZZhbnmL54rceXVNRvUiKrrqIkeogsl0XXb17ylNb0f4GA9Wd44vffEG8FSZGHEL2fbaTGRcSiCeA8PmA/f6Hz8HCS76fXUHwgwkzSwlI71ekZ7Fapmlk/KC+Hs8hUcw3N2LN5LhkVYyizYFl/uPeVP5lsoJHhhfWvvSWruCUW1ZcJOeuTbrDgywJ/qG07gZJplnTvLcYdNaH0KMYOYMGX+rB4NGPFmQsNaIwlWrfCezxre8zXBrsMT+edVLbLqN1BqB76JH4BvZTqUIMfGwPGEn+EnmTV86fPBaYbFL3DFEhjB45CewkXEAtJxk4/Ms2pPXnaRqdky0HOYdcUcE2zcXq4vaIvW2/v0nHFJH2XXe22ueDmq/18XGtELSq85j9X8q0tcNSSKJIX8FTuJF/Pf8j5PhqG2u+osvsLxYrvvfeVJL+4tkcXcr9JV7v0ERmj/X6fM3NC4j6dS1+9Umr2oPavqiAydTZPLMNRGY23LO9zAVDly7jD+70G5TPPLdhRIl4WxcYjLnM+SNcJ26FOrkrISUtPObIz5Zb3AG612krnpy15RMW+1cQjlnWFI6538qky9axd2oJmHIHP08KyP0ubGO+TQNOYuv2uh17yCIvR8VcStw7o1g0NM60sk+8Tq7YfIBJrtp53GkvzXH7OA0p8/n/u1satf/VJhtR1l8Wa6Gmaug7haSpaCaYQax6ta0mkutlb+eAOSG1aobM81D9A4iS1RRlzBBoVX6tU1S6WE2N9ORY6DfeLRC4l9Rvr5h95XDWB2mR1d4WFudpsgVYwiTwT31ljskD8ZyDOlm5DkGh9N/UB/0AI5Xvb8ZBmai2hQ4BWMqFwYnzxwB26YHSOv9WgY3JXnvoN+2R4rqGVh/LLDMtpFP+SpMGJNWvbIl5SOodbCczW2RKleksPoUeGEzrjtKHVdtZA+kfqO+rVx/iclCqwoopepvJpSTDjT+b9GWylGRF8EDbGlw6eUzmJM95Ovoz+kwLX3c2fTjFeYEsE7vUZm3mqdGJuKh2w9/QGSaqRHs99aScGOdDqkFcACoqdbBoQqqjamhH6Q9ng39JCg3lrGJwd50Qk9ovnqBTr8MME7Ps2wiVfygUmPoUBJJfJWX5Nda0nuncbFkA==")),xs=new Set(vs(Rs)),Os=new Set(vs(Rs)),Ns=function(e){for(var t=[];;){var r=e();if(0==r)break;t.push(ws(r,e))}for(;;){var n=e()-1;if(n<0)break;t.push(Qs(n,e))}return function(e){for(var t={},r=0;r<e.length;r++){var n=e[r];t[n[0]]=n[1]}return t}(ys(t))}(Rs),Ps=(Ms=vs(Ds=Rs).sort((function(e,t){return e-t})),function e(){for(var t=[];;){var r=vs(Ds,Ms);if(0==r.length)break;t.push({set:new Set(r),node:e()})}t.sort((function(e,t){return t.set.size-e.set.size}));var n=Ds();return{branches:t,valid:n%3,fe0f:!!(1&(n=n/3|0)),save:1==(n>>=1),check:2==n}}());function Fs(e){return Be(e)}function js(e){return e.filter((function(e){return 65039!=e}))}function Ts(e){var t,r=function(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=_s(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return a=e.done,e},e:function(e){s=!0,o=e},f:function(){try{a||null==r.return||r.return()}finally{if(s)throw o}}}}(e.split("."));try{for(r.s();!(t=r.n()).done;){var n=t.value,i=Fs(n);try{for(var o=i.lastIndexOf(95)-1;o>=0;o--)if(95!==i[o])throw new Error("underscore only allowed at start");if(i.length>=4&&i.every((function(e){return e<128}))&&45===i[2]&&45===i[3])throw new Error("invalid label extension")}catch(e){throw new Error('Invalid label "'.concat(n,'": ').concat(e.message))}}}catch(e){r.e(e)}finally{r.f()}return e}function Us(e){return Ts(function(e,t){var r=Fs(e).reverse(),n=[];for(;r.length;){var i=Ls(r);if(i)n.push.apply(n,ks(t(i)));else{var o=r.pop();if(xs.has(o))n.push(o);else if(!Os.has(o)){var a=Ns[o];if(!a)throw new Error("Disallowed codepoint: 0x".concat(o.toString(16).toUpperCase()));n.push.apply(n,ks(a))}}}return Ts((s=String.fromCodePoint.apply(String,n),s.normalize("NFC")));var s}(e,js))}function Ls(e,t){var r,n,i,o=Ps,a=[],s=e.length;t&&(t.length=0);for(var A=function(){var A=e[--s];if(!(o=null===(r=o.branches.find((function(e){return e.set.has(A)})))||void 0===r?void 0:r.node))return"break";if(o.save)i=A;else if(o.check&&A===i)return"break";a.push(A),o.fe0f&&(a.push(65039),s>0&&65039==e[s-1]&&s--),o.valid&&(n=a.slice(),2==o.valid&&n.splice(1,1),t&&t.push.apply(t,ks(e.slice(s).reverse())),e.length=s)};s;){if("break"===A())break}return n}var Hs=new h.b("hash/5.7.0"),Gs=new Uint8Array(32);function Ys(e){if(0===e.length)throw new Error("invalid ENS name; empty component");return e}function Ks(e){var t=be(Us(e)),r=[];if(0===e.length)return r;for(var n=0,i=0;i<t.length;i++){46===t[i]&&(r.push(Ys(t.slice(n,i))),n=i+1)}if(n>=t.length)throw new Error("invalid ENS name; empty component");return r.push(Ys(t.slice(n))),r}function qs(e){try{return 0!==Ks(e).length}catch(e){}return!1}function Js(e){"string"!=typeof e&&Hs.throwArgumentError("invalid ENS name; not a string","name",e);for(var t=Gs,r=Ks(e);r.length;)t=q(Object(c.b)([t,q(r.pop())]));return Object(c.i)(t)}function zs(e){return Object(c.i)(Object(c.b)(Ks(e).map((function(e){if(e.length>63)throw new Error("invalid DNS encoded entry; length exceeds 63 bytes");var t=new Uint8Array(e.length+1);return t.set(e,1),t[0]=t.length-1,t}))))+"00"}Gs.fill(0);var Vs=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{A(n.next(e))}catch(e){o(e)}}function s(e){try{A(n.throw(e))}catch(e){o(e)}}function A(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}A((n=n.apply(e,t||[])).next())}))};function Zs(e,t){return Vs(this,void 0,void 0,regeneratorRuntime.mark((function r(){var n,i,o,a,s;return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return null==t&&(t={}),n={method:t.method||"GET",headers:t.headers||{},body:t.body||void 0},!0!==t.skipFetchSetup&&(n.mode="cors",n.cache="no-cache",n.credentials="same-origin",n.redirect="follow",n.referrer="client"),null!=t.fetchOptions&&((i=t.fetchOptions).mode&&(n.mode=i.mode),i.cache&&(n.cache=i.cache),i.credentials&&(n.credentials=i.credentials),i.redirect&&(n.redirect=i.redirect),i.referrer&&(n.referrer=i.referrer)),r.next=7,fetch(e,n);case 7:return o=r.sent,r.next=10,o.arrayBuffer();case 10:return a=r.sent,s={},o.headers.forEach?o.headers.forEach((function(e,t){s[t.toLowerCase()]=e})):o.headers.keys().forEach((function(e){s[e.toLowerCase()]=o.headers.get(e)})),r.abrupt("return",{headers:s,statusCode:o.status,statusMessage:o.statusText,body:Object(c.a)(new Uint8Array(a))});case 14:case"end":return r.stop()}}),r)})))}function Ws(e){return(Ws="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var Xs=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{A(n.next(e))}catch(e){o(e)}}function s(e){try{A(n.throw(e))}catch(e){o(e)}}function A(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}A((n=n.apply(e,t||[])).next())}))},$s=new h.b("web/5.7.1");function eA(e){return new Promise((function(t){setTimeout(t,e)}))}function tA(e,t){if(null==e)return null;if("string"==typeof e)return e;if(Object(c.k)(e)){if(t&&("text"===t.split("/")[0]||"application/json"===t.split(";")[0].trim()))try{return ve(e)}catch(e){}return Object(c.i)(e)}return e}function rA(e,t,r){var n="object"===Ws(e)&&null!=e.throttleLimit?e.throttleLimit:12;$s.assertArgument(n>0&&n%1==0,"invalid connection throttle limit","connection.throttleLimit",n);var i="object"===Ws(e)?e.throttleCallback:null,o="object"===Ws(e)&&"number"==typeof e.throttleSlotInterval?e.throttleSlotInterval:100;$s.assertArgument(o>0&&o%1==0,"invalid connection throttle slot interval","connection.throttleSlotInterval",o);var a="object"===Ws(e)&&!!e.errorPassThrough,s={},A=null,c={method:"GET"},u=!1,f=12e4;if("string"==typeof e)A=e;else if("object"===Ws(e)){if(null!=e&&null!=e.url||$s.throwArgumentError("missing URL","connection.url",e),A=e.url,"number"==typeof e.timeout&&e.timeout>0&&(f=e.timeout),e.headers)for(var l in e.headers)s[l.toLowerCase()]={key:l,value:String(e.headers[l])},["if-none-match","if-modified-since"].indexOf(l.toLowerCase())>=0&&(u=!0);if(c.allowGzip=!!e.allowGzip,null!=e.user&&null!=e.password){"https:"!==A.substring(0,6)&&!0!==e.allowInsecureAuthentication&&$s.throwError("basic authentication requires a secure https url",h.b.errors.INVALID_ARGUMENT,{argument:"url",url:A,user:e.user,password:"[REDACTED]"});var g=e.user+":"+e.password;s.authorization={key:"Authorization",value:"Basic "+Is(be(g))}}null!=e.skipFetchSetup&&(c.skipFetchSetup=!!e.skipFetchSetup),null!=e.fetchOptions&&(c.fetchOptions=R(e.fetchOptions))}var d,p=new RegExp("^data:([^;:]*)?(;base64)?,(.*)$","i"),I=A?A.match(p):null;if(I)try{var y={statusCode:200,statusMessage:"OK",headers:{"content-type":I[1]||"text/plain"},body:I[2]?ps(I[3]):(d=I[3],be(d.replace(/%([0-9a-f][0-9a-f])/gi,(function(e,t){return String.fromCharCode(parseInt(t,16))}))))},b=y.body;return r&&(b=r(y.body,y)),Promise.resolve(b)}catch(e){$s.throwError("processing response error",h.b.errors.SERVER_ERROR,{body:tA(I[1],I[2]),error:e,requestBody:null,requestMethod:"GET",url:A})}t&&(c.method="POST",c.body=t,null==s["content-type"]&&(s["content-type"]={key:"Content-Type",value:"application/octet-stream"}),null==s["content-length"]&&(s["content-length"]={key:"Content-Length",value:String(t.length)}));var E={};Object.keys(s).forEach((function(e){var t=s[e];E[t.key]=t.value})),c.headers=E;var m,C=(m=null,{promise:new Promise((function(e,t){f&&(m=setTimeout((function(){null!=m&&(m=null,t($s.makeError("timeout",h.b.errors.TIMEOUT,{requestBody:tA(c.body,E["content-type"]),requestMethod:c.method,timeout:f,url:A})))}),f))})),cancel:function(){null!=m&&(clearTimeout(m),m=null)}}),v=function(){return Xs(this,void 0,void 0,regeneratorRuntime.mark((function e(){var t,s,f,l,g,d,p,I,y,b;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t=0;case 1:if(!(t<n)){e.next=65;break}return s=null,e.prev=3,e.next=6,Zs(A,c);case 6:if(s=e.sent,!(t<n)){e.next=28;break}if(301!==s.statusCode&&302!==s.statusCode){e.next=15;break}if(f=s.headers.location||"","GET"!==c.method||!f.match(/^https:/)){e.next=13;break}return A=s.headers.location,e.abrupt("continue",62);case 13:e.next=28;break;case 15:if(429!==s.statusCode){e.next=28;break}if(l=!0,!i){e.next=21;break}return e.next=20,i(t,A);case 20:l=e.sent;case 21:if(!l){e.next=28;break}return g=0,d=s.headers["retry-after"],g="string"==typeof d&&d.match(/^[1-9][0-9]*$/)?1e3*parseInt(d):o*parseInt(String(Math.random()*Math.pow(2,t))),e.next=27,eA(g);case 27:return e.abrupt("continue",62);case 28:e.next=34;break;case 30:e.prev=30,e.t0=e.catch(3),null==(s=e.t0.response)&&(C.cancel(),$s.throwError("missing response",h.b.errors.SERVER_ERROR,{requestBody:tA(c.body,E["content-type"]),requestMethod:c.method,serverError:e.t0,url:A}));case 34:if(p=s.body,u&&304===s.statusCode?p=null:!a&&(s.statusCode<200||s.statusCode>=300)&&(C.cancel(),$s.throwError("bad response",h.b.errors.SERVER_ERROR,{status:s.statusCode,headers:s.headers,body:tA(p,s.headers?s.headers["content-type"]:null),requestBody:tA(c.body,E["content-type"]),requestMethod:c.method,url:A})),!r){e.next=60;break}return e.prev=37,e.next=40,r(p,s);case 40:return I=e.sent,C.cancel(),e.abrupt("return",I);case 45:if(e.prev=45,e.t1=e.catch(37),!(e.t1.throttleRetry&&t<n)){e.next=58;break}if(y=!0,!i){e.next=53;break}return e.next=52,i(t,A);case 52:y=e.sent;case 53:if(!y){e.next=58;break}return b=o*parseInt(String(Math.random()*Math.pow(2,t))),e.next=57,eA(b);case 57:return e.abrupt("continue",62);case 58:C.cancel(),$s.throwError("processing response error",h.b.errors.SERVER_ERROR,{body:tA(p,s.headers?s.headers["content-type"]:null),error:e.t1,requestBody:tA(c.body,E["content-type"]),requestMethod:c.method,url:A});case 60:return C.cancel(),e.abrupt("return",p);case 62:t++,e.next=1;break;case 65:return e.abrupt("return",$s.throwError("failed response",h.b.errors.SERVER_ERROR,{requestBody:tA(c.body,E["content-type"]),requestMethod:c.method,url:A}));case 66:case"end":return e.stop()}}),e,null,[[3,30],[37,45]])})))}();return Promise.race([C.promise,v])}function nA(e,t,r){var n=null;if(null!=t){n=be(t);var i="string"==typeof e?{url:e}:R(e);if(i.headers)0!==Object.keys(i.headers).filter((function(e){return"content-type"===e.toLowerCase()})).length||(i.headers=R(i.headers),i.headers["content-type"]="application/json");else i.headers={"content-type":"application/json"};e=i}return rA(e,n,(function(e,t){var n=null;if(null!=e)try{n=JSON.parse(ve(e))}catch(t){$s.throwError("invalid JSON",h.b.errors.SERVER_ERROR,{body:e,error:t})}return r&&(n=r(n,t)),n}))}function iA(e,t){return t||(t={}),null==(t=R(t)).floor&&(t.floor=0),null==t.ceiling&&(t.ceiling=1e4),null==t.interval&&(t.interval=250),new Promise((function(r,n){var i=null,o=!1,a=function(){return!o&&(o=!0,i&&clearTimeout(i),!0)};t.timeout&&(i=setTimeout((function(){a()&&n(new Error("timeout"))}),t.timeout));var s=t.retryLimit,A=0;!function i(){return e().then((function(e){if(void 0!==e)a()&&r(e);else if(t.oncePoll)t.oncePoll.once("poll",i);else if(t.onceBlock)t.onceBlock.once("block",i);else if(!o){if(++A>s)return void(a()&&n(new Error("retry limit reached")));var c=t.interval*parseInt(String(Math.random()*Math.pow(2,A)));c<t.floor&&(c=t.floor),c>t.ceiling&&(c=t.ceiling),setTimeout(i,c)}return null}),(function(e){a()&&n(e)}))}()}))}var oA=r(79),aA=r.n(oA);function sA(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}var AA=new h.b("providers/5.7.2"),cA=function(){function e(){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),this.formats=this.getDefaultFormats()}var t,r,n;return t=e,n=[{key:"check",value:function(e,t){var r={};for(var n in e)try{var i=e[n](t[n]);void 0!==i&&(r[n]=i)}catch(e){throw e.checkKey=n,e.checkValue=t[n],e}return r}},{key:"allowNull",value:function(e,t){return function(r){return null==r?t:e(r)}}},{key:"allowFalsish",value:function(e,t){return function(r){return r?e(r):t}}},{key:"arrayOf",value:function(e){return function(t){if(!Array.isArray(t))throw new Error("not an array");var r=[];return t.forEach((function(t){r.push(e(t))})),r}}}],(r=[{key:"getDefaultFormats",value:function(){var t=this,r={},n=this.address.bind(this),i=this.bigNumber.bind(this),o=this.blockTag.bind(this),a=this.data.bind(this),s=this.hash.bind(this),A=this.hex.bind(this),c=this.number.bind(this),u=this.type.bind(this);return r.transaction={hash:s,type:u,accessList:e.allowNull(this.accessList.bind(this),null),blockHash:e.allowNull(s,null),blockNumber:e.allowNull(c,null),transactionIndex:e.allowNull(c,null),confirmations:e.allowNull(c,null),from:n,gasPrice:e.allowNull(i),maxPriorityFeePerGas:e.allowNull(i),maxFeePerGas:e.allowNull(i),gasLimit:i,to:e.allowNull(n,null),value:i,nonce:c,data:a,r:e.allowNull(this.uint256),s:e.allowNull(this.uint256),v:e.allowNull(c),creates:e.allowNull(n,null),raw:e.allowNull(a)},r.transactionRequest={from:e.allowNull(n),nonce:e.allowNull(c),gasLimit:e.allowNull(i),gasPrice:e.allowNull(i),maxPriorityFeePerGas:e.allowNull(i),maxFeePerGas:e.allowNull(i),to:e.allowNull(n),value:e.allowNull(i),data:e.allowNull((function(e){return t.data(e,!0)})),type:e.allowNull(c),accessList:e.allowNull(this.accessList.bind(this),null)},r.receiptLog={transactionIndex:c,blockNumber:c,transactionHash:s,address:n,topics:e.arrayOf(s),data:a,logIndex:c,blockHash:s},r.receipt={to:e.allowNull(this.address,null),from:e.allowNull(this.address,null),contractAddress:e.allowNull(n,null),transactionIndex:c,root:e.allowNull(A),gasUsed:i,logsBloom:e.allowNull(a),blockHash:s,transactionHash:s,logs:e.arrayOf(this.receiptLog.bind(this)),blockNumber:c,confirmations:e.allowNull(c,null),cumulativeGasUsed:i,effectiveGasPrice:e.allowNull(i),status:e.allowNull(c),type:u},r.block={hash:e.allowNull(s),parentHash:s,number:c,timestamp:c,nonce:e.allowNull(A),difficulty:this.difficulty.bind(this),gasLimit:i,gasUsed:i,miner:e.allowNull(n),extraData:a,transactions:e.allowNull(e.arrayOf(s)),baseFeePerGas:e.allowNull(i)},r.blockWithTransactions=R(r.block),r.blockWithTransactions.transactions=e.allowNull(e.arrayOf(this.transactionResponse.bind(this))),r.filter={fromBlock:e.allowNull(o,void 0),toBlock:e.allowNull(o,void 0),blockHash:e.allowNull(s,void 0),address:e.allowNull(n,void 0),topics:e.allowNull(this.topics.bind(this),void 0)},r.filterLog={blockNumber:e.allowNull(c),blockHash:e.allowNull(s),transactionIndex:c,removed:e.allowNull(this.boolean.bind(this)),address:n,data:e.allowFalsish(a,"0x"),topics:e.arrayOf(s),transactionHash:s,logIndex:c},r}},{key:"accessList",value:function(e){return ei(e||[])}},{key:"number",value:function(e){return"0x"===e?0:y.from(e).toNumber()}},{key:"type",value:function(e){return"0x"===e||null==e?0:y.from(e).toNumber()}},{key:"bigNumber",value:function(e){return y.from(e)}},{key:"boolean",value:function(e){if("boolean"==typeof e)return e;if("string"==typeof e){if("true"===(e=e.toLowerCase()))return!0;if("false"===e)return!1}throw new Error("invalid boolean - "+e)}},{key:"hex",value:function(e,t){return"string"==typeof e&&(t||"0x"===e.substring(0,2)||(e="0x"+e),Object(c.l)(e))?e.toLowerCase():AA.throwArgumentError("invalid hash","value",e)}},{key:"data",value:function(e,t){var r=this.hex(e,t);if(r.length%2!=0)throw new Error("invalid data; odd-length - "+e);return r}},{key:"address",value:function(e){return Ae(e)}},{key:"callAddress",value:function(e){if(!Object(c.l)(e,32))return null;var t=Ae(Object(c.e)(e,12));return t===os?null:t}},{key:"contractAddress",value:function(e){return fe(e)}},{key:"blockTag",value:function(e){if(null==e)return"latest";if("earliest"===e)return"0x0";switch(e){case"earliest":return"0x0";case"latest":case"pending":case"safe":case"finalized":return e}if("number"==typeof e||Object(c.l)(e))return Object(c.g)(e);throw new Error("invalid blockTag")}},{key:"hash",value:function(e,t){var r=this.hex(e,t);return 32!==Object(c.d)(r)?AA.throwArgumentError("invalid hash","value",e):r}},{key:"difficulty",value:function(e){if(null==e)return null;var t=y.from(e);try{return t.toNumber()}catch(e){}return null}},{key:"uint256",value:function(e){if(!Object(c.l)(e))throw new Error("invalid uint256");return Object(c.h)(e,32)}},{key:"_block",value:function(t,r){null!=t.author&&null==t.miner&&(t.miner=t.author);var n=null!=t._difficulty?t._difficulty:t.difficulty,i=e.check(r,t);return i._difficulty=null==n?null:y.from(n),i}},{key:"block",value:function(e){return this._block(e,this.formats.block)}},{key:"blockWithTransactions",value:function(e){return this._block(e,this.formats.blockWithTransactions)}},{key:"transactionRequest",value:function(t){return e.check(this.formats.transactionRequest,t)}},{key:"transactionResponse",value:function(t){null!=t.gas&&null==t.gasLimit&&(t.gasLimit=t.gas),t.to&&y.from(t.to).isZero()&&(t.to="0x0000000000000000000000000000000000000000"),null!=t.input&&null==t.data&&(t.data=t.input),null==t.to&&null==t.creates&&(t.creates=this.contractAddress(t)),1!==t.type&&2!==t.type||null!=t.accessList||(t.accessList=[]);var r=e.check(this.formats.transaction,t);if(null!=t.chainId){var n=t.chainId;Object(c.l)(n)&&(n=y.from(n).toNumber()),r.chainId=n}else{var i=t.networkId;null==i&&null==r.v&&(i=t.chainId),Object(c.l)(i)&&(i=y.from(i).toNumber()),"number"!=typeof i&&null!=r.v&&((i=(r.v-35)/2)<0&&(i=0),i=parseInt(i)),"number"!=typeof i&&(i=0),r.chainId=i}return r.blockHash&&"x"===r.blockHash.replace(/0/g,"")&&(r.blockHash=null),r}},{key:"transaction",value:function(e){return ai(e)}},{key:"receiptLog",value:function(t){return e.check(this.formats.receiptLog,t)}},{key:"receipt",value:function(t){var r=e.check(this.formats.receipt,t);if(null!=r.root)if(r.root.length<=4){var n=y.from(r.root).toNumber();0===n||1===n?(null!=r.status&&r.status!==n&&AA.throwArgumentError("alt-root-status/status mismatch","value",{root:r.root,status:r.status}),r.status=n,delete r.root):AA.throwArgumentError("invalid alt-root-status","value.root",r.root)}else 66!==r.root.length&&AA.throwArgumentError("invalid root hash","value.root",r.root);return null!=r.status&&(r.byzantium=!0),r}},{key:"topics",value:function(e){var t=this;return Array.isArray(e)?e.map((function(e){return t.topics(e)})):null!=e?this.hash(e,!0):null}},{key:"filter",value:function(t){return e.check(this.formats.filter,t)}},{key:"filterLog",value:function(t){return e.check(this.formats.filterLog,t)}}])&&sA(t.prototype,r),n&&sA(t,n),Object.defineProperty(t,"prototype",{writable:!1}),e}();function uA(e){return e&&"function"==typeof e.isCommunityResource}function fA(e){return uA(e)&&e.isCommunityResource()}var hA=!1;function lA(){hA||(hA=!0,console.log("========= NOTICE ========="),console.log("Request-Rate Exceeded (this message will not be repeated)"),console.log(""),console.log("The default API keys for each service are provided as a highly-throttled,"),console.log("community resource for low-traffic projects and early prototyping."),console.log(""),console.log("While your application will continue to function, we highly recommended"),console.log("signing up for your own API keys to improve performance, increase your"),console.log("request rate/limit and enable other perks, such as metrics and advanced APIs."),console.log(""),console.log("For more details: https://docs.ethers.io/api-keys/"),console.log("=========================="))}function gA(e,t){return(gA=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function dA(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=yA(e);if(t){var i=yA(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return pA(this,r)}}function pA(e,t){if(t&&("object"===CA(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return IA(e)}function IA(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function yA(e){return(yA=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function bA(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function EA(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function mA(e,t,r){return t&&EA(e.prototype,t),r&&EA(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function CA(e){return(CA="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var vA=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{A(n.next(e))}catch(e){o(e)}}function s(e){try{A(n.throw(e))}catch(e){o(e)}}function A(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}A((n=n.apply(e,t||[])).next())}))},BA=new h.b("providers/5.7.2");function wA(e){return null==e?"null":(32!==Object(c.d)(e)&&BA.throwArgumentError("invalid topic","topic",e),e.toLowerCase())}function QA(e){for(e=e.slice();e.length>0&&null==e[e.length-1];)e.pop();return e.map((function(e){if(Array.isArray(e)){var t={};e.forEach((function(e){t[wA(e)]=!0}));var r=Object.keys(t);return r.sort(),r.join("|")}return wA(e)})).join("&")}function kA(e){if("string"==typeof e){if(e=e.toLowerCase(),32===Object(c.d)(e))return"tx:"+e;if(-1===e.indexOf(":"))return e}else{if(Array.isArray(e))return"filter:*:"+QA(e);if(bn.isForkEvent(e))throw BA.warn("not implemented"),new Error("not implemented");if(e&&"object"===CA(e))return"filter:"+(e.address||"*")+":"+QA(e.topics||[])}throw new Error("invalid event - "+e)}function _A(){return(new Date).getTime()}function SA(e){return new Promise((function(t){setTimeout(t,e)}))}var DA=["block","network","pending","poll"],MA=function(){function e(t,r,n){bA(this,e),_(this,"tag",t),_(this,"listener",r),_(this,"once",n),this._lastBlockNumber=-2,this._inflight=!1}return mA(e,[{key:"event",get:function(){switch(this.type){case"tx":return this.hash;case"filter":return this.filter}return this.tag}},{key:"type",get:function(){return this.tag.split(":")[0]}},{key:"hash",get:function(){var e=this.tag.split(":");return"tx"!==e[0]?null:e[1]}},{key:"filter",get:function(){var e=this.tag.split(":");if("filter"!==e[0])return null;var t,r=e[1],n=""===(t=e[2])?[]:t.split(/&/g).map((function(e){if(""===e)return[];var t=e.split("|").map((function(e){return"null"===e?null:e}));return 1===t.length?t[0]:t})),i={};return n.length>0&&(i.topics=n),r&&"*"!==r&&(i.address=r),i}},{key:"pollable",value:function(){return this.tag.indexOf(":")>=0||DA.indexOf(this.tag)>=0}}]),e}(),RA={0:{symbol:"btc",p2pkh:0,p2sh:5,prefix:"bc"},2:{symbol:"ltc",p2pkh:48,p2sh:50,prefix:"ltc"},3:{symbol:"doge",p2pkh:30,p2sh:22},60:{symbol:"eth",ilk:"eth"},61:{symbol:"etc",ilk:"eth"},700:{symbol:"xdai",ilk:"eth"}};function xA(e){return Object(c.h)(y.from(e).toHexString(),32)}function OA(e){return vo.encode(Object(c.b)([e,Object(c.e)(_o(_o(e)),0,4)]))}var NA=new RegExp("^(ipfs)://(.*)$","i"),PA=[new RegExp("^(https)://(.*)$","i"),new RegExp("^(data):(.*)$","i"),NA,new RegExp("^eip155:[0-9]+/(erc[0-9]+):(.*)$","i")];function FA(e,t){try{return ve(jA(e,t))}catch(e){}return null}function jA(e,t){if("0x"===e)return null;var r=y.from(Object(c.e)(e,t,t+32)).toNumber(),n=y.from(Object(c.e)(e,r,r+32)).toNumber();return Object(c.e)(e,r+32,r+32+n)}function TA(e){return e.match(/^ipfs:\/\/ipfs\//i)?e=e.substring(12):e.match(/^ipfs:\/\//i)?e=e.substring(7):BA.throwArgumentError("unsupported IPFS format","link",e),"https://gateway.ipfs.io/ipfs/".concat(e)}function UA(e){var t=Object(c.a)(e);if(t.length>32)throw new Error("internal; should not happen");var r=new Uint8Array(32);return r.set(t,32-t.length),r}function LA(e){if(e.length%32==0)return e;var t=new Uint8Array(32*Math.ceil(e.length/32));return t.set(e),t}function HA(e){for(var t=[],r=0,n=0;n<e.length;n++)t.push(null),r+=32;for(var i=0;i<e.length;i++){var o=Object(c.a)(e[i]);t[i]=UA(r),t.push(UA(o.length)),t.push(LA(o)),r+=32+32*Math.ceil(o.length/32)}return Object(c.c)(t)}var GA=function(){function e(t,r,n,i){bA(this,e),_(this,"provider",t),_(this,"name",n),_(this,"address",t.formatter.address(r)),_(this,"_resolvedAddress",i)}return mA(e,[{key:"supportsWildcard",value:function(){var e=this;return this._supportsEip2544||(this._supportsEip2544=this.provider.call({to:this.address,data:"0x01ffc9a79061b92300000000000000000000000000000000000000000000000000000000"}).then((function(e){return y.from(e).eq(1)})).catch((function(t){if(t.code===h.b.errors.CALL_EXCEPTION)return!1;throw e._supportsEip2544=null,t}))),this._supportsEip2544}},{key:"_fetch",value:function(e,t){return vA(this,void 0,void 0,regeneratorRuntime.mark((function r(){var n,i,o;return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return n={to:this.address,ccipReadEnabled:!0,data:Object(c.c)([e,Js(this.name),t||"0x"])},i=!1,r.next=4,this.supportsWildcard();case 4:if(!r.sent){r.next=7;break}i=!0,n.data=Object(c.c)(["0x9061b923",HA([zs(this.name),n.data])]);case 7:return r.prev=7,r.next=10,this.provider.call(n);case 10:return o=r.sent,Object(c.a)(o).length%32==4&&BA.throwError("resolver threw error",h.b.errors.CALL_EXCEPTION,{transaction:n,data:o}),i&&(o=jA(o,0)),r.abrupt("return",o);case 16:if(r.prev=16,r.t0=r.catch(7),r.t0.code!==h.b.errors.CALL_EXCEPTION){r.next=20;break}return r.abrupt("return",null);case 20:throw r.t0;case 21:case"end":return r.stop()}}),r,this,[[7,16]])})))}},{key:"_fetchBytes",value:function(e,t){return vA(this,void 0,void 0,regeneratorRuntime.mark((function r(){var n;return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,this._fetch(e,t);case 2:if(null==(n=r.sent)){r.next=5;break}return r.abrupt("return",jA(n,0));case 5:return r.abrupt("return",null);case 6:case"end":return r.stop()}}),r,this)})))}},{key:"_getAddress",value:function(e,t){var r=RA[String(e)];if(null==r&&BA.throwError("unsupported coin type: ".concat(e),h.b.errors.UNSUPPORTED_OPERATION,{operation:"getAddress(".concat(e,")")}),"eth"===r.ilk)return this.provider.formatter.address(t);var n=Object(c.a)(t);if(null!=r.p2pkh){var i=t.match(/^0x76a9([0-9a-f][0-9a-f])([0-9a-f]*)88ac$/);if(i){var o=parseInt(i[1],16);if(i[2].length===2*o&&o>=1&&o<=75)return OA(Object(c.b)([[r.p2pkh],"0x"+i[2]]))}}if(null!=r.p2sh){var a=t.match(/^0xa9([0-9a-f][0-9a-f])([0-9a-f]*)87$/);if(a){var s=parseInt(a[1],16);if(a[2].length===2*s&&s>=1&&s<=75)return OA(Object(c.b)([[r.p2sh],"0x"+a[2]]))}}if(null!=r.prefix){var A=n[1],u=n[0];if(0===u?20!==A&&32!==A&&(u=-1):u=-1,u>=0&&n.length===2+A&&A>=1&&A<=75){var f=aA.a.toWords(n.slice(2));return f.unshift(u),aA.a.encode(r.prefix,f)}}return null}},{key:"getAddress",value:function(e){return vA(this,void 0,void 0,regeneratorRuntime.mark((function t(){var r,n,i;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(null==e&&(e=60),60!==e){t.next=16;break}return t.prev=2,t.next=5,this._fetch("0x3b3b57de");case 5:if("0x"!==(r=t.sent)&&r!==as){t.next=8;break}return t.abrupt("return",null);case 8:return t.abrupt("return",this.provider.formatter.callAddress(r));case 11:if(t.prev=11,t.t0=t.catch(2),t.t0.code!==h.b.errors.CALL_EXCEPTION){t.next=15;break}return t.abrupt("return",null);case 15:throw t.t0;case 16:return t.next=18,this._fetchBytes("0xf1cb7e06",xA(e));case 18:if(null!=(n=t.sent)&&"0x"!==n){t.next=21;break}return t.abrupt("return",null);case 21:return null==(i=this._getAddress(e,n))&&BA.throwError("invalid or unsupported coin data",h.b.errors.UNSUPPORTED_OPERATION,{operation:"getAddress(".concat(e,")"),coinType:e,data:n}),t.abrupt("return",i);case 24:case"end":return t.stop()}}),t,this,[[2,11]])})))}},{key:"getAvatar",value:function(){return vA(this,void 0,void 0,regeneratorRuntime.mark((function e(){var t,r,n,i,o,a,s,A,u,f,h,l,g,d,p,I;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=[{type:"name",content:this.name}],e.prev=1,e.next=4,this.getText("avatar");case 4:if(null!=(r=e.sent)){e.next=7;break}return e.abrupt("return",null);case 7:n=0;case 8:if(!(n<PA.length)){e.next=91;break}if(null!=(i=r.match(PA[n]))){e.next=12;break}return e.abrupt("continue",88);case 12:o=i[1].toLowerCase(),e.t0=o,e.next="https"===e.t0?16:"data"===e.t0?18:"ipfs"===e.t0?20:"erc721"===e.t0||"erc1155"===e.t0?22:88;break;case 16:return t.push({type:"url",content:r}),e.abrupt("return",{linkage:t,url:r});case 18:return t.push({type:"data",content:r}),e.abrupt("return",{linkage:t,url:r});case 20:return t.push({type:"ipfs",content:r}),e.abrupt("return",{linkage:t,url:TA(r)});case 22:if(a="erc721"===o?"0xc87b56dd":"0x0e89341c",t.push({type:o,content:r}),e.t1=this._resolvedAddress,e.t1){e.next=29;break}return e.next=28,this.getAddress();case 28:e.t1=e.sent;case 29:if(s=e.t1,2===(A=(i[2]||"").split("/")).length){e.next=33;break}return e.abrupt("return",null);case 33:return e.next=35,this.provider.formatter.address(A[0]);case 35:if(u=e.sent,f=Object(c.h)(y.from(A[1]).toHexString(),32),"erc721"!==o){e.next=48;break}return e.t2=this.provider.formatter,e.next=41,this.provider.call({to:u,data:Object(c.c)(["0x6352211e",f])});case 41:if(e.t3=e.sent,h=e.t2.callAddress.call(e.t2,e.t3),s===h){e.next=45;break}return e.abrupt("return",null);case 45:t.push({type:"owner",content:h}),e.next=57;break;case 48:if("erc1155"!==o){e.next=57;break}return e.t4=y,e.next=52,this.provider.call({to:u,data:Object(c.c)(["0x00fdd58e",Object(c.h)(s,32),f])});case 52:if(e.t5=e.sent,!(l=e.t4.from.call(e.t4,e.t5)).isZero()){e.next=56;break}return e.abrupt("return",null);case 56:t.push({type:"balance",content:l.toString()});case 57:return g={to:this.provider.formatter.address(A[0]),data:Object(c.c)([a,f])},e.t6=FA,e.next=61,this.provider.call(g);case 61:if(e.t7=e.sent,null!=(d=(0,e.t6)(e.t7,0))){e.next=65;break}return e.abrupt("return",null);case 65:return t.push({type:"metadata-url-base",content:d}),"erc1155"===o&&(d=d.replace("{id}",f.substring(2)),t.push({type:"metadata-url-expanded",content:d})),d.match(/^ipfs:/i)&&(d=TA(d)),t.push({type:"metadata-url",content:d}),e.next=71,nA(d);case 71:if(p=e.sent){e.next=74;break}return e.abrupt("return",null);case 74:if(t.push({type:"metadata",content:JSON.stringify(p)}),"string"==typeof(I=p.image)){e.next=78;break}return e.abrupt("return",null);case 78:if(!I.match(/^(https:\/\/|data:)/i)){e.next=81;break}e.next=86;break;case 81:if(null!=I.match(NA)){e.next=84;break}return e.abrupt("return",null);case 84:t.push({type:"url-ipfs",content:I}),I=TA(I);case 86:return t.push({type:"url",content:I}),e.abrupt("return",{linkage:t,url:I});case 88:n++,e.next=8;break;case 91:e.next=95;break;case 93:e.prev=93,e.t8=e.catch(1);case 95:return e.abrupt("return",null);case 96:case"end":return e.stop()}}),e,this,[[1,93]])})))}},{key:"getContentHash",value:function(){return vA(this,void 0,void 0,regeneratorRuntime.mark((function e(){var t,r,n,i,o,a,s,A,c;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._fetchBytes("0xbc1c58d1");case 2:if(null!=(t=e.sent)&&"0x"!==t){e.next=5;break}return e.abrupt("return",null);case 5:if(!(r=t.match(/^0xe3010170(([0-9a-f][0-9a-f])([0-9a-f][0-9a-f])([0-9a-f]*))$/))){e.next=10;break}if(n=parseInt(r[3],16),r[4].length!==2*n){e.next=10;break}return e.abrupt("return","ipfs://"+vo.encode("0x"+r[1]));case 10:if(!(i=t.match(/^0xe5010172(([0-9a-f][0-9a-f])([0-9a-f][0-9a-f])([0-9a-f]*))$/))){e.next=15;break}if(o=parseInt(i[3],16),i[4].length!==2*o){e.next=15;break}return e.abrupt("return","ipns://"+vo.encode("0x"+i[1]));case 15:if(!(a=t.match(/^0xe40101fa011b20([0-9a-f]*)$/))){e.next=19;break}if(64!==a[1].length){e.next=19;break}return e.abrupt("return","bzz://"+a[1]);case 19:if(!(s=t.match(/^0x90b2c605([0-9a-f]*)$/))){e.next=25;break}if(68!==s[1].length){e.next=25;break}return A={"=":"","+":"-","/":"_"},c=Is("0x"+s[1]).replace(/[=+\/]/g,(function(e){return A[e]})),e.abrupt("return","sia://"+c);case 25:return e.abrupt("return",BA.throwError("invalid or unsupported content hash data",h.b.errors.UNSUPPORTED_OPERATION,{operation:"getContentHash()",data:t}));case 26:case"end":return e.stop()}}),e,this)})))}},{key:"getText",value:function(e){return vA(this,void 0,void 0,regeneratorRuntime.mark((function t(){var r,n;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=be(e),(r=Object(c.b)([xA(64),xA(r.length),r])).length%32!=0&&(r=Object(c.b)([r,Object(c.h)("0x",32-e.length%32)])),t.next=5,this._fetchBytes("0x59d1d43c",Object(c.i)(r));case 5:if(null!=(n=t.sent)&&"0x"!==n){t.next=8;break}return t.abrupt("return",null);case 8:return t.abrupt("return",ve(n));case 9:case"end":return t.stop()}}),t,this)})))}}]),e}(),YA=null,KA=1,qA=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&gA(e,t)}(r,e);var t=dA(r);function r(e){var n;if(bA(this,r),(n=t.call(this))._events=[],n._emitted={block:-2},n.disableCcipRead=!1,n.formatter=(this instanceof r?this.constructor:void 0).getFormatter(),_(IA(n),"anyNetwork","any"===e),n.anyNetwork&&(e=n.detectNetwork()),e instanceof Promise)n._networkPromise=e,e.catch((function(e){})),n._ready().catch((function(e){}));else{var i=S(this instanceof r?this.constructor:void 0,"getNetwork")(e);i?(_(IA(n),"_network",i),n.emit("network",i,null)):BA.throwArgumentError("invalid network","network",e)}return n._maxInternalBlockNumber=-1024,n._lastBlockNumber=-2,n._maxFilterBlockRange=10,n._pollingInterval=4e3,n._fastQueryDate=0,n}return mA(r,[{key:"_ready",value:function(){return vA(this,void 0,void 0,regeneratorRuntime.mark((function e(){var t;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!=this._network){e.next=17;break}if(t=null,!this._networkPromise){e.next=11;break}return e.prev=3,e.next=6,this._networkPromise;case 6:t=e.sent,e.next=11;break;case 9:e.prev=9,e.t0=e.catch(3);case 11:if(null!=t){e.next=15;break}return e.next=14,this.detectNetwork();case 14:t=e.sent;case 15:t||BA.throwError("no network detected",h.b.errors.UNKNOWN_ERROR,{}),null==this._network&&(this.anyNetwork?this._network=t:_(this,"_network",t),this.emit("network",t,null));case 17:return e.abrupt("return",this._network);case 18:case"end":return e.stop()}}),e,this,[[3,9]])})))}},{key:"ready",get:function(){var e=this;return iA((function(){return e._ready().then((function(e){return e}),(function(e){if(e.code!==h.b.errors.NETWORK_ERROR||"noNetwork"!==e.event)throw e}))}))}},{key:"ccipReadFetch",value:function(e,t,r){return vA(this,void 0,void 0,regeneratorRuntime.mark((function n(){var i,o,a,s,A,c,u,f,l;return regeneratorRuntime.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(!this.disableCcipRead&&0!==r.length){n.next=2;break}return n.abrupt("return",null);case 2:i=e.to.toLowerCase(),o=t.toLowerCase(),a=[],s=0;case 6:if(!(s<r.length)){n.next=22;break}return A=r[s],c=A.replace("{sender}",i).replace("{data}",o),u=A.indexOf("{data}")>=0?null:JSON.stringify({data:o,sender:i}),n.next=12,nA({url:c,errorPassThrough:!0},u,(function(e,t){return e.status=t.statusCode,e}));case 12:if(!(f=n.sent).data){n.next=15;break}return n.abrupt("return",f.data);case 15:if(l=f.message||"unknown error",!(f.status>=400&&f.status<500)){n.next=18;break}return n.abrupt("return",BA.throwError("response not found during CCIP fetch: ".concat(l),h.b.errors.SERVER_ERROR,{url:A,errorMessage:l}));case 18:a.push(l);case 19:s++,n.next=6;break;case 22:return n.abrupt("return",BA.throwError("error encountered during CCIP fetch: ".concat(a.map((function(e){return JSON.stringify(e)})).join(", ")),h.b.errors.SERVER_ERROR,{urls:r,errorMessages:a}));case 23:case"end":return n.stop()}}),n,this)})))}},{key:"_getInternalBlockNumber",value:function(e){return vA(this,void 0,void 0,regeneratorRuntime.mark((function t(){var r,n,i,o,a=this;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this._ready();case 2:if(!(e>0)){t.next=20;break}case 3:if(!this._internalBlockNumber){t.next=20;break}return r=this._internalBlockNumber,t.prev=5,t.next=8,r;case 8:if(n=t.sent,!(_A()-n.respTime<=e)){t.next=11;break}return t.abrupt("return",n.blockNumber);case 11:return t.abrupt("break",20);case 14:if(t.prev=14,t.t0=t.catch(5),this._internalBlockNumber!==r){t.next=18;break}return t.abrupt("break",20);case 18:t.next=3;break;case 20:return i=_A(),o=D({blockNumber:this.perform("getBlockNumber",{}),networkError:this.getNetwork().then((function(e){return null}),(function(e){return e}))}).then((function(e){var t=e.blockNumber,r=e.networkError;if(r)throw a._internalBlockNumber===o&&(a._internalBlockNumber=null),r;var n=_A();return(t=y.from(t).toNumber())<a._maxInternalBlockNumber&&(t=a._maxInternalBlockNumber),a._maxInternalBlockNumber=t,a._setFastBlockNumber(t),{blockNumber:t,reqTime:i,respTime:n}})),this._internalBlockNumber=o,o.catch((function(e){a._internalBlockNumber===o&&(a._internalBlockNumber=null)})),t.next=26,o;case 26:return t.abrupt("return",t.sent.blockNumber);case 27:case"end":return t.stop()}}),t,this,[[5,14]])})))}},{key:"poll",value:function(){return vA(this,void 0,void 0,regeneratorRuntime.mark((function e(){var t,r,n,i,o=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=KA++,r=[],n=null,e.prev=3,e.next=6,this._getInternalBlockNumber(100+this.pollingInterval/2);case 6:n=e.sent,e.next=13;break;case 9:return e.prev=9,e.t0=e.catch(3),this.emit("error",e.t0),e.abrupt("return");case 13:if(this._setFastBlockNumber(n),this.emit("poll",t,n),n!==this._lastBlockNumber){e.next=18;break}return this.emit("didPoll",t),e.abrupt("return");case 18:if(-2===this._emitted.block&&(this._emitted.block=n-1),Math.abs(this._emitted.block-n)>1e3)BA.warn("network block skew detected; skipping block events (emitted=".concat(this._emitted.block," blockNumber").concat(n,")")),this.emit("error",BA.makeError("network block skew detected",h.b.errors.NETWORK_ERROR,{blockNumber:n,event:"blockSkew",previousBlockNumber:this._emitted.block})),this.emit("block",n);else for(i=this._emitted.block+1;i<=n;i++)this.emit("block",i);return this._emitted.block!==n&&(this._emitted.block=n,Object.keys(this._emitted).forEach((function(e){if("block"!==e){var t=o._emitted[e];"pending"!==t&&n-t>12&&delete o._emitted[e]}}))),-2===this._lastBlockNumber&&(this._lastBlockNumber=n-1),this._events.forEach((function(e){switch(e.type){case"tx":var t=e.hash,i=o.getTransactionReceipt(t).then((function(e){return e&&null!=e.blockNumber?(o._emitted["t:"+t]=e.blockNumber,o.emit(t,e),null):null})).catch((function(e){o.emit("error",e)}));r.push(i);break;case"filter":if(!e._inflight){e._inflight=!0,-2===e._lastBlockNumber&&(e._lastBlockNumber=n-1);var a=e.filter;a.fromBlock=e._lastBlockNumber+1,a.toBlock=n;var s=a.toBlock-o._maxFilterBlockRange;s>a.fromBlock&&(a.fromBlock=s),a.fromBlock<0&&(a.fromBlock=0);var A=o.getLogs(a).then((function(t){e._inflight=!1,0!==t.length&&t.forEach((function(t){t.blockNumber>e._lastBlockNumber&&(e._lastBlockNumber=t.blockNumber),o._emitted["b:"+t.blockHash]=t.blockNumber,o._emitted["t:"+t.transactionHash]=t.blockNumber,o.emit(a,t)}))})).catch((function(t){o.emit("error",t),e._inflight=!1}));r.push(A)}}})),this._lastBlockNumber=n,Promise.all(r).then((function(){o.emit("didPoll",t)})).catch((function(e){o.emit("error",e)})),e.abrupt("return");case 26:case"end":return e.stop()}}),e,this,[[3,9]])})))}},{key:"resetEventsBlock",value:function(e){this._lastBlockNumber=e-1,this.polling&&this.poll()}},{key:"network",get:function(){return this._network}},{key:"detectNetwork",value:function(){return vA(this,void 0,void 0,regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",BA.throwError("provider does not support network detection",h.b.errors.UNSUPPORTED_OPERATION,{operation:"provider.detectNetwork"}));case 1:case"end":return e.stop()}}),e)})))}},{key:"getNetwork",value:function(){return vA(this,void 0,void 0,regeneratorRuntime.mark((function e(){var t,r,n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this._ready();case 2:return t=e.sent,e.next=5,this.detectNetwork();case 5:if(r=e.sent,t.chainId===r.chainId){e.next=23;break}if(!this.anyNetwork){e.next=20;break}return this._network=r,this._lastBlockNumber=-2,this._fastBlockNumber=null,this._fastBlockNumberPromise=null,this._fastQueryDate=0,this._emitted.block=-2,this._maxInternalBlockNumber=-1024,this._internalBlockNumber=null,this.emit("network",r,t),e.next=19,SA(0);case 19:return e.abrupt("return",this._network);case 20:throw n=BA.makeError("underlying network changed",h.b.errors.NETWORK_ERROR,{event:"changed",network:t,detectedNetwork:r}),this.emit("error",n),n;case 23:return e.abrupt("return",t);case 24:case"end":return e.stop()}}),e,this)})))}},{key:"blockNumber",get:function(){var e=this;return this._getInternalBlockNumber(100+this.pollingInterval/2).then((function(t){e._setFastBlockNumber(t)}),(function(e){})),null!=this._fastBlockNumber?this._fastBlockNumber:-1}},{key:"polling",get:function(){return null!=this._poller},set:function(e){var t=this;e&&!this._poller?(this._poller=setInterval((function(){t.poll()}),this.pollingInterval),this._bootstrapPoll||(this._bootstrapPoll=setTimeout((function(){t.poll(),t._bootstrapPoll=setTimeout((function(){t._poller||t.poll(),t._bootstrapPoll=null}),t.pollingInterval)}),0))):!e&&this._poller&&(clearInterval(this._poller),this._poller=null)}},{key:"pollingInterval",get:function(){return this._pollingInterval},set:function(e){var t=this;if("number"!=typeof e||e<=0||parseInt(String(e))!=e)throw new Error("invalid polling interval");this._pollingInterval=e,this._poller&&(clearInterval(this._poller),this._poller=setInterval((function(){t.poll()}),this._pollingInterval))}},{key:"_getFastBlockNumber",value:function(){var e=this,t=_A();return t-this._fastQueryDate>2*this._pollingInterval&&(this._fastQueryDate=t,this._fastBlockNumberPromise=this.getBlockNumber().then((function(t){return(null==e._fastBlockNumber||t>e._fastBlockNumber)&&(e._fastBlockNumber=t),e._fastBlockNumber}))),this._fastBlockNumberPromise}},{key:"_setFastBlockNumber",value:function(e){null!=this._fastBlockNumber&&e<this._fastBlockNumber||(this._fastQueryDate=_A(),(null==this._fastBlockNumber||e>this._fastBlockNumber)&&(this._fastBlockNumber=e,this._fastBlockNumberPromise=Promise.resolve(e)))}},{key:"waitForTransaction",value:function(e,t,r){return vA(this,void 0,void 0,regeneratorRuntime.mark((function n(){return regeneratorRuntime.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.abrupt("return",this._waitForTransaction(e,null==t?1:t,r||0,null));case 1:case"end":return n.stop()}}),n,this)})))}},{key:"_waitForTransaction",value:function(e,t,r,n){return vA(this,void 0,void 0,regeneratorRuntime.mark((function i(){var o,a=this;return regeneratorRuntime.wrap((function(i){for(;;)switch(i.prev=i.next){case 0:return i.next=2,this.getTransactionReceipt(e);case 2:if(!(((o=i.sent)?o.confirmations:0)>=t)){i.next=5;break}return i.abrupt("return",o);case 5:return i.abrupt("return",new Promise((function(i,o){var s=[],A=!1,c=function(){return!!A||(A=!0,s.forEach((function(e){e()})),!1)},u=function(e){e.confirmations<t||c()||i(e)};if(a.on(e,u),s.push((function(){a.removeListener(e,u)})),n){var f=n.startBlock,l=null,g=function r(i){return vA(a,void 0,void 0,regeneratorRuntime.mark((function a(){var s=this;return regeneratorRuntime.wrap((function(a){for(;;)switch(a.prev=a.next){case 0:if(!A){a.next=2;break}return a.abrupt("return");case 2:return a.next=4,SA(1e3);case 4:this.getTransactionCount(n.from).then((function(a){return vA(s,void 0,void 0,regeneratorRuntime.mark((function s(){var u,g,d,p,I,y;return regeneratorRuntime.wrap((function(s){for(;;)switch(s.prev=s.next){case 0:if(!A){s.next=2;break}return s.abrupt("return");case 2:if(!(a<=n.nonce)){s.next=6;break}f=i,s.next=41;break;case 6:return s.next=8,this.getTransaction(e);case 8:if(!(u=s.sent)||null==u.blockNumber){s.next=11;break}return s.abrupt("return");case 11:null==l&&(l=f-3)<n.startBlock&&(l=n.startBlock);case 12:if(!(l<=i)){s.next=41;break}if(!A){s.next=15;break}return s.abrupt("return");case 15:return s.next=17,this.getBlockWithTransactions(l);case 17:g=s.sent,d=0;case 19:if(!(d<g.transactions.length)){s.next=38;break}if((p=g.transactions[d]).hash!==e){s.next=23;break}return s.abrupt("return");case 23:if(p.from!==n.from||p.nonce!==n.nonce){s.next=35;break}if(!A){s.next=26;break}return s.abrupt("return");case 26:return s.next=28,this.waitForTransaction(p.hash,t);case 28:if(I=s.sent,!c()){s.next=31;break}return s.abrupt("return");case 31:return y="replaced",p.data===n.data&&p.to===n.to&&p.value.eq(n.value)?y="repriced":"0x"===p.data&&p.from===p.to&&p.value.isZero()&&(y="cancelled"),o(BA.makeError("transaction was replaced",h.b.errors.TRANSACTION_REPLACED,{cancelled:"replaced"===y||"cancelled"===y,reason:y,replacement:this._wrapTransaction(p),hash:e,receipt:I})),s.abrupt("return");case 35:d++,s.next=19;break;case 38:l++,s.next=12;break;case 41:if(!A){s.next=43;break}return s.abrupt("return");case 43:this.once("block",r);case 44:case"end":return s.stop()}}),s,this)})))}),(function(e){A||s.once("block",r)}));case 5:case"end":return a.stop()}}),a,this)})))};if(A)return;a.once("block",g),s.push((function(){a.removeListener("block",g)}))}if("number"==typeof r&&r>0){var d=setTimeout((function(){c()||o(BA.makeError("timeout exceeded",h.b.errors.TIMEOUT,{timeout:r}))}),r);d.unref&&d.unref(),s.push((function(){clearTimeout(d)}))}})));case 6:case"end":return i.stop()}}),i,this)})))}},{key:"getBlockNumber",value:function(){return vA(this,void 0,void 0,regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this._getInternalBlockNumber(0));case 1:case"end":return e.stop()}}),e,this)})))}},{key:"getGasPrice",value:function(){return vA(this,void 0,void 0,regeneratorRuntime.mark((function e(){var t;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getNetwork();case 2:return e.next=4,this.perform("getGasPrice",{});case 4:return t=e.sent,e.prev=5,e.abrupt("return",y.from(t));case 9:return e.prev=9,e.t0=e.catch(5),e.abrupt("return",BA.throwError("bad result from backend",h.b.errors.SERVER_ERROR,{method:"getGasPrice",result:t,error:e.t0}));case 12:case"end":return e.stop()}}),e,this,[[5,9]])})))}},{key:"getBalance",value:function(e,t){return vA(this,void 0,void 0,regeneratorRuntime.mark((function r(){var n,i;return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,this.getNetwork();case 2:return r.next=4,D({address:this._getAddress(e),blockTag:this._getBlockTag(t)});case 4:return n=r.sent,r.next=7,this.perform("getBalance",n);case 7:return i=r.sent,r.prev=8,r.abrupt("return",y.from(i));case 12:return r.prev=12,r.t0=r.catch(8),r.abrupt("return",BA.throwError("bad result from backend",h.b.errors.SERVER_ERROR,{method:"getBalance",params:n,result:i,error:r.t0}));case 15:case"end":return r.stop()}}),r,this,[[8,12]])})))}},{key:"getTransactionCount",value:function(e,t){return vA(this,void 0,void 0,regeneratorRuntime.mark((function r(){var n,i;return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,this.getNetwork();case 2:return r.next=4,D({address:this._getAddress(e),blockTag:this._getBlockTag(t)});case 4:return n=r.sent,r.next=7,this.perform("getTransactionCount",n);case 7:return i=r.sent,r.prev=8,r.abrupt("return",y.from(i).toNumber());case 12:return r.prev=12,r.t0=r.catch(8),r.abrupt("return",BA.throwError("bad result from backend",h.b.errors.SERVER_ERROR,{method:"getTransactionCount",params:n,result:i,error:r.t0}));case 15:case"end":return r.stop()}}),r,this,[[8,12]])})))}},{key:"getCode",value:function(e,t){return vA(this,void 0,void 0,regeneratorRuntime.mark((function r(){var n,i;return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,this.getNetwork();case 2:return r.next=4,D({address:this._getAddress(e),blockTag:this._getBlockTag(t)});case 4:return n=r.sent,r.next=7,this.perform("getCode",n);case 7:return i=r.sent,r.prev=8,r.abrupt("return",Object(c.i)(i));case 12:return r.prev=12,r.t0=r.catch(8),r.abrupt("return",BA.throwError("bad result from backend",h.b.errors.SERVER_ERROR,{method:"getCode",params:n,result:i,error:r.t0}));case 15:case"end":return r.stop()}}),r,this,[[8,12]])})))}},{key:"getStorageAt",value:function(e,t,r){return vA(this,void 0,void 0,regeneratorRuntime.mark((function n(){var i,o;return regeneratorRuntime.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,this.getNetwork();case 2:return n.next=4,D({address:this._getAddress(e),blockTag:this._getBlockTag(r),position:Promise.resolve(t).then((function(e){return Object(c.g)(e)}))});case 4:return i=n.sent,n.next=7,this.perform("getStorageAt",i);case 7:return o=n.sent,n.prev=8,n.abrupt("return",Object(c.i)(o));case 12:return n.prev=12,n.t0=n.catch(8),n.abrupt("return",BA.throwError("bad result from backend",h.b.errors.SERVER_ERROR,{method:"getStorageAt",params:i,result:o,error:n.t0}));case 15:case"end":return n.stop()}}),n,this,[[8,12]])})))}},{key:"_wrapTransaction",value:function(e,t,r){var n=this;if(null!=t&&32!==Object(c.d)(t))throw new Error("invalid response - sendTransaction");var i=e;return null!=t&&e.hash!==t&&BA.throwError("Transaction hash mismatch from Provider.sendTransaction.",h.b.errors.UNKNOWN_ERROR,{expectedHash:e.hash,returnedHash:t}),i.wait=function(t,i){return vA(n,void 0,void 0,regeneratorRuntime.mark((function n(){var o,a;return regeneratorRuntime.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return null==t&&(t=1),null==i&&(i=0),o=void 0,0!==t&&null!=r&&(o={data:e.data,from:e.from,nonce:e.nonce,to:e.to,value:e.value,startBlock:r}),n.next=6,this._waitForTransaction(e.hash,t,i,o);case 6:if(null!=(a=n.sent)||0!==t){n.next=9;break}return n.abrupt("return",null);case 9:return this._emitted["t:"+e.hash]=a.blockNumber,0===a.status&&BA.throwError("transaction failed",h.b.errors.CALL_EXCEPTION,{transactionHash:e.hash,transaction:e,receipt:a}),n.abrupt("return",a);case 12:case"end":return n.stop()}}),n,this)})))},i}},{key:"sendTransaction",value:function(e){return vA(this,void 0,void 0,regeneratorRuntime.mark((function t(){var r,n,i,o;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.getNetwork();case 2:return t.next=4,Promise.resolve(e).then((function(e){return Object(c.i)(e)}));case 4:return r=t.sent,null==(n=this.formatter.transaction(e)).confirmations&&(n.confirmations=0),t.next=9,this._getInternalBlockNumber(100+2*this.pollingInterval);case 9:return i=t.sent,t.prev=10,t.next=13,this.perform("sendTransaction",{signedTransaction:r});case 13:return o=t.sent,t.abrupt("return",this._wrapTransaction(n,o,i));case 17:throw t.prev=17,t.t0=t.catch(10),t.t0.transaction=n,t.t0.transactionHash=n.hash,t.t0;case 22:case"end":return t.stop()}}),t,this,[[10,17]])})))}},{key:"_getTransactionRequest",value:function(e){return vA(this,void 0,void 0,regeneratorRuntime.mark((function t(){var r,n,i=this;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e;case 2:return r=t.sent,n={},["from","to"].forEach((function(e){null!=r[e]&&(n[e]=Promise.resolve(r[e]).then((function(e){return e?i._getAddress(e):null})))})),["gasLimit","gasPrice","maxFeePerGas","maxPriorityFeePerGas","value"].forEach((function(e){null!=r[e]&&(n[e]=Promise.resolve(r[e]).then((function(e){return e?y.from(e):null})))})),["type"].forEach((function(e){null!=r[e]&&(n[e]=Promise.resolve(r[e]).then((function(e){return null!=e?e:null})))})),r.accessList&&(n.accessList=this.formatter.accessList(r.accessList)),["data"].forEach((function(e){null!=r[e]&&(n[e]=Promise.resolve(r[e]).then((function(e){return e?Object(c.i)(e):null})))})),t.t0=this.formatter,t.next=12,D(n);case 12:return t.t1=t.sent,t.abrupt("return",t.t0.transactionRequest.call(t.t0,t.t1));case 14:case"end":return t.stop()}}),t,this)})))}},{key:"_getFilter",value:function(e){return vA(this,void 0,void 0,regeneratorRuntime.mark((function t(){var r,n=this;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e;case 2:return e=t.sent,r={},null!=e.address&&(r.address=this._getAddress(e.address)),["blockHash","topics"].forEach((function(t){null!=e[t]&&(r[t]=e[t])})),["fromBlock","toBlock"].forEach((function(t){null!=e[t]&&(r[t]=n._getBlockTag(e[t]))})),t.t0=this.formatter,t.next=10,D(r);case 10:return t.t1=t.sent,t.abrupt("return",t.t0.filter.call(t.t0,t.t1));case 12:case"end":return t.stop()}}),t,this)})))}},{key:"_call",value:function(e,t,r){return vA(this,void 0,void 0,regeneratorRuntime.mark((function n(){var i,o,a,s,A,u,f,l,g,d,p,I,b,E,m;return regeneratorRuntime.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return r>=10&&BA.throwError("CCIP read exceeded maximum redirections",h.b.errors.SERVER_ERROR,{redirects:r,transaction:e}),i=e.to,n.next=4,this.perform("call",{transaction:e,blockTag:t});case 4:if(o=n.sent,!(r>=0&&"latest"===t&&null!=i&&"0x556f1830"===o.substring(0,10)&&Object(c.d)(o)%32==4)){n.next=31;break}for(n.prev=6,a=Object(c.e)(o,4),s=Object(c.e)(a,0,32),y.from(s).eq(i)||BA.throwError("CCIP Read sender did not match",h.b.errors.CALL_EXCEPTION,{name:"OffchainLookup",signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",transaction:e,data:o}),A=[],u=y.from(Object(c.e)(a,32,64)).toNumber(),f=y.from(Object(c.e)(a,u,u+32)).toNumber(),l=Object(c.e)(a,u+32),g=0;g<f;g++)null==(d=FA(l,32*g))&&BA.throwError("CCIP Read contained corrupt URL string",h.b.errors.CALL_EXCEPTION,{name:"OffchainLookup",signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",transaction:e,data:o}),A.push(d);return p=jA(a,64),y.from(Object(c.e)(a,100,128)).isZero()||BA.throwError("CCIP Read callback selector included junk",h.b.errors.CALL_EXCEPTION,{name:"OffchainLookup",signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",transaction:e,data:o}),I=Object(c.e)(a,96,100),b=jA(a,128),n.next=21,this.ccipReadFetch(e,p,A);case 21:return null==(E=n.sent)&&BA.throwError("CCIP Read disabled or provided no URLs",h.b.errors.CALL_EXCEPTION,{name:"OffchainLookup",signature:"OffchainLookup(address,string[],bytes,bytes4,bytes)",transaction:e,data:o}),m={to:i,data:Object(c.c)([I,HA([E,b])])},n.abrupt("return",this._call(m,t,r+1));case 27:if(n.prev=27,n.t0=n.catch(6),n.t0.code!==h.b.errors.SERVER_ERROR){n.next=31;break}throw n.t0;case 31:return n.prev=31,n.abrupt("return",Object(c.i)(o));case 35:return n.prev=35,n.t1=n.catch(31),n.abrupt("return",BA.throwError("bad result from backend",h.b.errors.SERVER_ERROR,{method:"call",params:{transaction:e,blockTag:t},result:o,error:n.t1}));case 38:case"end":return n.stop()}}),n,this,[[6,27],[31,35]])})))}},{key:"call",value:function(e,t){return vA(this,void 0,void 0,regeneratorRuntime.mark((function r(){var n;return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,this.getNetwork();case 2:return r.next=4,D({transaction:this._getTransactionRequest(e),blockTag:this._getBlockTag(t),ccipReadEnabled:Promise.resolve(e.ccipReadEnabled)});case 4:return n=r.sent,r.abrupt("return",this._call(n.transaction,n.blockTag,n.ccipReadEnabled?0:-1));case 6:case"end":return r.stop()}}),r,this)})))}},{key:"estimateGas",value:function(e){return vA(this,void 0,void 0,regeneratorRuntime.mark((function t(){var r,n;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.getNetwork();case 2:return t.next=4,D({transaction:this._getTransactionRequest(e)});case 4:return r=t.sent,t.next=7,this.perform("estimateGas",r);case 7:return n=t.sent,t.prev=8,t.abrupt("return",y.from(n));case 12:return t.prev=12,t.t0=t.catch(8),t.abrupt("return",BA.throwError("bad result from backend",h.b.errors.SERVER_ERROR,{method:"estimateGas",params:r,result:n,error:t.t0}));case 15:case"end":return t.stop()}}),t,this,[[8,12]])})))}},{key:"_getAddress",value:function(e){return vA(this,void 0,void 0,regeneratorRuntime.mark((function t(){var r;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e;case 2:return"string"!=typeof(e=t.sent)&&BA.throwArgumentError("invalid address or ENS name","name",e),t.next=6,this.resolveName(e);case 6:return null==(r=t.sent)&&BA.throwError("ENS name not configured",h.b.errors.UNSUPPORTED_OPERATION,{operation:"resolveName(".concat(JSON.stringify(e),")")}),t.abrupt("return",r);case 9:case"end":return t.stop()}}),t,this)})))}},{key:"_getBlock",value:function(e,t){return vA(this,void 0,void 0,regeneratorRuntime.mark((function r(){var n,i,o=this;return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,this.getNetwork();case 2:return r.next=4,e;case 4:if(e=r.sent,n=-128,i={includeTransactions:!!t},!Object(c.l)(e,32)){r.next=11;break}i.blockHash=e,r.next=21;break;case 11:return r.prev=11,r.next=14,this._getBlockTag(e);case 14:i.blockTag=r.sent,Object(c.l)(i.blockTag)&&(n=parseInt(i.blockTag.substring(2),16)),r.next=21;break;case 18:r.prev=18,r.t0=r.catch(11),BA.throwArgumentError("invalid block hash or block tag","blockHashOrBlockTag",e);case 21:return r.abrupt("return",iA((function(){return vA(o,void 0,void 0,regeneratorRuntime.mark((function e(){var r,o,a,s,A,c,u=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.perform("getBlock",i);case 2:if(null!=(r=e.sent)){e.next=11;break}if(null==i.blockHash){e.next=7;break}if(null!=this._emitted["b:"+i.blockHash]){e.next=7;break}return e.abrupt("return",null);case 7:if(null==i.blockTag){e.next=10;break}if(!(n>this._emitted.block)){e.next=10;break}return e.abrupt("return",null);case 10:return e.abrupt("return",void 0);case 11:if(!t){e.next=34;break}o=null,a=0;case 14:if(!(a<r.transactions.length)){e.next=31;break}if(null!=(s=r.transactions[a]).blockNumber){e.next=20;break}s.confirmations=0,e.next=28;break;case 20:if(null!=s.confirmations){e.next=28;break}if(null!=o){e.next=25;break}return e.next=24,this._getInternalBlockNumber(100+2*this.pollingInterval);case 24:o=e.sent;case 25:(A=o-s.blockNumber+1)<=0&&(A=1),s.confirmations=A;case 28:a++,e.next=14;break;case 31:return(c=this.formatter.blockWithTransactions(r)).transactions=c.transactions.map((function(e){return u._wrapTransaction(e)})),e.abrupt("return",c);case 34:return e.abrupt("return",this.formatter.block(r));case 35:case"end":return e.stop()}}),e,this)})))}),{oncePoll:this}));case 22:case"end":return r.stop()}}),r,this,[[11,18]])})))}},{key:"getBlock",value:function(e){return this._getBlock(e,!1)}},{key:"getBlockWithTransactions",value:function(e){return this._getBlock(e,!0)}},{key:"getTransaction",value:function(e){return vA(this,void 0,void 0,regeneratorRuntime.mark((function t(){var r,n=this;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.getNetwork();case 2:return t.next=4,e;case 4:return e=t.sent,r={transactionHash:this.formatter.hash(e,!0)},t.abrupt("return",iA((function(){return vA(n,void 0,void 0,regeneratorRuntime.mark((function t(){var n,i,o,a;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.perform("getTransaction",r);case 2:if(null!=(n=t.sent)){t.next=7;break}if(null!=this._emitted["t:"+e]){t.next=6;break}return t.abrupt("return",null);case 6:return t.abrupt("return",void 0);case 7:if(null!=(i=this.formatter.transactionResponse(n)).blockNumber){t.next=12;break}i.confirmations=0,t.next=19;break;case 12:if(null!=i.confirmations){t.next=19;break}return t.next=15,this._getInternalBlockNumber(100+2*this.pollingInterval);case 15:o=t.sent,(a=o-i.blockNumber+1)<=0&&(a=1),i.confirmations=a;case 19:return t.abrupt("return",this._wrapTransaction(i));case 20:case"end":return t.stop()}}),t,this)})))}),{oncePoll:this}));case 7:case"end":return t.stop()}}),t,this)})))}},{key:"getTransactionReceipt",value:function(e){return vA(this,void 0,void 0,regeneratorRuntime.mark((function t(){var r,n=this;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.getNetwork();case 2:return t.next=4,e;case 4:return e=t.sent,r={transactionHash:this.formatter.hash(e,!0)},t.abrupt("return",iA((function(){return vA(n,void 0,void 0,regeneratorRuntime.mark((function t(){var n,i,o,a;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.perform("getTransactionReceipt",r);case 2:if(null!=(n=t.sent)){t.next=7;break}if(null!=this._emitted["t:"+e]){t.next=6;break}return t.abrupt("return",null);case 6:return t.abrupt("return",void 0);case 7:if(null!=n.blockHash){t.next=9;break}return t.abrupt("return",void 0);case 9:if(null!=(i=this.formatter.receipt(n)).blockNumber){t.next=14;break}i.confirmations=0,t.next=21;break;case 14:if(null!=i.confirmations){t.next=21;break}return t.next=17,this._getInternalBlockNumber(100+2*this.pollingInterval);case 17:o=t.sent,(a=o-i.blockNumber+1)<=0&&(a=1),i.confirmations=a;case 21:return t.abrupt("return",i);case 22:case"end":return t.stop()}}),t,this)})))}),{oncePoll:this}));case 7:case"end":return t.stop()}}),t,this)})))}},{key:"getLogs",value:function(e){return vA(this,void 0,void 0,regeneratorRuntime.mark((function t(){var r,n;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.getNetwork();case 2:return t.next=4,D({filter:this._getFilter(e)});case 4:return r=t.sent,t.next=7,this.perform("getLogs",r);case 7:return(n=t.sent).forEach((function(e){null==e.removed&&(e.removed=!1)})),t.abrupt("return",cA.arrayOf(this.formatter.filterLog.bind(this.formatter))(n));case 10:case"end":return t.stop()}}),t,this)})))}},{key:"getEtherPrice",value:function(){return vA(this,void 0,void 0,regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getNetwork();case 2:return e.abrupt("return",this.perform("getEtherPrice",{}));case 3:case"end":return e.stop()}}),e,this)})))}},{key:"_getBlockTag",value:function(e){return vA(this,void 0,void 0,regeneratorRuntime.mark((function t(){var r;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e;case 2:if(!("number"==typeof(e=t.sent)&&e<0)){t.next=11;break}return e%1&&BA.throwArgumentError("invalid BlockTag","blockTag",e),t.next=7,this._getInternalBlockNumber(100+2*this.pollingInterval);case 7:return r=t.sent,(r+=e)<0&&(r=0),t.abrupt("return",this.formatter.blockTag(r));case 11:return t.abrupt("return",this.formatter.blockTag(e));case 12:case"end":return t.stop()}}),t,this)})))}},{key:"getResolver",value:function(e){return vA(this,void 0,void 0,regeneratorRuntime.mark((function t(){var r,n,i;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:r=e;case 1:if(""!==r&&"."!==r){t.next=4;break}return t.abrupt("return",null);case 4:if("eth"===e||"eth"!==r){t.next=6;break}return t.abrupt("return",null);case 6:return t.next=8,this._getResolver(r,"getResolver");case 8:if(null==(n=t.sent)){t.next=19;break}if(i=new GA(this,n,e),t.t0=r!==e,!t.t0){t.next=16;break}return t.next=15,i.supportsWildcard();case 15:t.t0=!t.sent;case 16:if(!t.t0){t.next=18;break}return t.abrupt("return",null);case 18:return t.abrupt("return",i);case 19:r=r.split(".").slice(1).join("."),t.next=1;break;case 22:case"end":return t.stop()}}),t,this)})))}},{key:"_getResolver",value:function(e,t){return vA(this,void 0,void 0,regeneratorRuntime.mark((function r(){var n,i;return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return null==t&&(t="ENS"),r.next=3,this.getNetwork();case 3:return(n=r.sent).ensAddress||BA.throwError("network does not support ENS",h.b.errors.UNSUPPORTED_OPERATION,{operation:t,network:n.name}),r.prev=5,r.next=8,this.call({to:n.ensAddress,data:"0x0178b8bf"+Js(e).substring(2)});case 8:return i=r.sent,r.abrupt("return",this.formatter.callAddress(i));case 12:r.prev=12,r.t0=r.catch(5);case 14:return r.abrupt("return",null);case 15:case"end":return r.stop()}}),r,this,[[5,12]])})))}},{key:"resolveName",value:function(e){return vA(this,void 0,void 0,regeneratorRuntime.mark((function t(){var r;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e;case 2:return e=t.sent,t.prev=3,t.abrupt("return",Promise.resolve(this.formatter.address(e)));case 7:if(t.prev=7,t.t0=t.catch(3),!Object(c.l)(e)){t.next=11;break}throw t.t0;case 11:return"string"!=typeof e&&BA.throwArgumentError("invalid ENS name","name",e),t.next=14,this.getResolver(e);case 14:if(r=t.sent){t.next=17;break}return t.abrupt("return",null);case 17:return t.next=19,r.getAddress();case 19:return t.abrupt("return",t.sent);case 20:case"end":return t.stop()}}),t,this,[[3,7]])})))}},{key:"lookupAddress",value:function(e){return vA(this,void 0,void 0,regeneratorRuntime.mark((function t(){var r,n,i;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,e;case 2:return e=t.sent,e=this.formatter.address(e),r=e.substring(2).toLowerCase()+".addr.reverse",t.next=7,this._getResolver(r,"lookupAddress");case 7:if(null!=(n=t.sent)){t.next=10;break}return t.abrupt("return",null);case 10:return t.t0=FA,t.next=13,this.call({to:n,data:"0x691f3431"+Js(r).substring(2)});case 13:return t.t1=t.sent,i=(0,t.t0)(t.t1,0),t.next=17,this.resolveName(i);case 17:if(t.sent==e){t.next=20;break}return t.abrupt("return",null);case 20:return t.abrupt("return",i);case 21:case"end":return t.stop()}}),t,this)})))}},{key:"getAvatar",value:function(e){return vA(this,void 0,void 0,regeneratorRuntime.mark((function t(){var r,n,i,o,a,s,A;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(r=null,!Object(c.l)(e)){t.next=40;break}return n=this.formatter.address(e),i=n.substring(2).toLowerCase()+".addr.reverse",t.next=6,this._getResolver(i,"getAvatar");case 6:if(o=t.sent){t.next=9;break}return t.abrupt("return",null);case 9:return r=new GA(this,o,i),t.prev=10,t.next=13,r.getAvatar();case 13:if(!(a=t.sent)){t.next=16;break}return t.abrupt("return",a.url);case 16:t.next=22;break;case 18:if(t.prev=18,t.t0=t.catch(10),t.t0.code===h.b.errors.CALL_EXCEPTION){t.next=22;break}throw t.t0;case 22:return t.prev=22,t.t1=FA,t.next=26,this.call({to:o,data:"0x691f3431"+Js(i).substring(2)});case 26:return t.t2=t.sent,s=(0,t.t1)(t.t2,0),t.next=30,this.getResolver(s);case 30:r=t.sent,t.next=38;break;case 33:if(t.prev=33,t.t3=t.catch(22),t.t3.code===h.b.errors.CALL_EXCEPTION){t.next=37;break}throw t.t3;case 37:return t.abrupt("return",null);case 38:t.next=45;break;case 40:return t.next=42,this.getResolver(e);case 42:if(r=t.sent){t.next=45;break}return t.abrupt("return",null);case 45:return t.next=47,r.getAvatar();case 47:if(null!=(A=t.sent)){t.next=50;break}return t.abrupt("return",null);case 50:return t.abrupt("return",A.url);case 51:case"end":return t.stop()}}),t,this,[[10,18],[22,33]])})))}},{key:"perform",value:function(e,t){return BA.throwError(e+" not implemented",h.b.errors.NOT_IMPLEMENTED,{operation:e})}},{key:"_startEvent",value:function(e){this.polling=this._events.filter((function(e){return e.pollable()})).length>0}},{key:"_stopEvent",value:function(e){this.polling=this._events.filter((function(e){return e.pollable()})).length>0}},{key:"_addEventListener",value:function(e,t,r){var n=new MA(kA(e),t,r);return this._events.push(n),this._startEvent(n),this}},{key:"on",value:function(e,t){return this._addEventListener(e,t,!1)}},{key:"once",value:function(e,t){return this._addEventListener(e,t,!0)}},{key:"emit",value:function(e){for(var t=this,r=arguments.length,n=new Array(r>1?r-1:0),i=1;i<r;i++)n[i-1]=arguments[i];var o=!1,a=[],s=kA(e);return this._events=this._events.filter((function(e){return e.tag!==s||(setTimeout((function(){e.listener.apply(t,n)}),0),o=!0,!e.once||(a.push(e),!1))})),a.forEach((function(e){t._stopEvent(e)})),o}},{key:"listenerCount",value:function(e){if(!e)return this._events.length;var t=kA(e);return this._events.filter((function(e){return e.tag===t})).length}},{key:"listeners",value:function(e){if(null==e)return this._events.map((function(e){return e.listener}));var t=kA(e);return this._events.filter((function(e){return e.tag===t})).map((function(e){return e.listener}))}},{key:"off",value:function(e,t){var r=this;if(null==t)return this.removeAllListeners(e);var n=[],i=!1,o=kA(e);return this._events=this._events.filter((function(e){return e.tag!==o||e.listener!=t||(!!i||(i=!0,n.push(e),!1))})),n.forEach((function(e){r._stopEvent(e)})),this}},{key:"removeAllListeners",value:function(e){var t=this,r=[];if(null==e)r=this._events,this._events=[];else{var n=kA(e);this._events=this._events.filter((function(e){return e.tag!==n||(r.push(e),!1)}))}return r.forEach((function(e){t._stopEvent(e)})),this}}],[{key:"getFormatter",value:function(){return null==YA&&(YA=new cA),YA}},{key:"getNetwork",value:function(e){return ds(null==e?"homestead":e)}}]),r}(En);function JA(){return(JA="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,r){var n=zA(e,t);if(n){var i=Object.getOwnPropertyDescriptor(n,t);return i.get?i.get.call(arguments.length<3?e:r):i.value}}).apply(this,arguments)}function zA(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=nc(e)););return e}function VA(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function ZA(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function WA(e,t,r){return t&&ZA(e.prototype,t),r&&ZA(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function XA(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&$A(e,t)}function $A(e,t){return($A=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function ec(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=nc(e);if(t){var i=nc(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return tc(this,r)}}function tc(e,t){if(t&&("object"===ic(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return rc(e)}function rc(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function nc(e){return(nc=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function ic(e){return(ic="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var oc=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{A(n.next(e))}catch(e){o(e)}}function s(e){try{A(n.throw(e))}catch(e){o(e)}}function A(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}A((n=n.apply(e,t||[])).next())}))},ac=new h.b("providers/5.7.2"),sc=["call","estimateGas"];function Ac(e,t){if(null==e)return null;if("string"==typeof e.message&&e.message.match("reverted")){var r=Object(c.l)(e.data)?e.data:null;if(!t||r)return{message:e.message,data:r}}if("object"===ic(e)){for(var n in e){var i=Ac(e[n],t);if(i)return i}return null}if("string"==typeof e)try{return Ac(JSON.parse(e),t)}catch(e){}return null}function cc(e,t,r){var n=r.transaction||r.signedTransaction;if("call"===e){var i=Ac(t,!0);if(i)return i.data;ac.throwError("missing revert data in call exception; Transaction reverted without a reason string",h.b.errors.CALL_EXCEPTION,{data:"0x",transaction:n,error:t})}if("estimateGas"===e){var o=Ac(t.body,!1);null==o&&(o=Ac(t,!1)),o&&ac.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",h.b.errors.UNPREDICTABLE_GAS_LIMIT,{reason:o.message,method:e,transaction:n,error:t})}var a=t.message;throw t.code===h.b.errors.SERVER_ERROR&&t.error&&"string"==typeof t.error.message?a=t.error.message:"string"==typeof t.body?a=t.body:"string"==typeof t.responseText&&(a=t.responseText),(a=(a||"").toLowerCase()).match(/insufficient funds|base fee exceeds gas limit|InsufficientFunds/i)&&ac.throwError("insufficient funds for intrinsic transaction cost",h.b.errors.INSUFFICIENT_FUNDS,{error:t,method:e,transaction:n}),a.match(/nonce (is )?too low/i)&&ac.throwError("nonce has already been used",h.b.errors.NONCE_EXPIRED,{error:t,method:e,transaction:n}),a.match(/replacement transaction underpriced|transaction gas price.*too low/i)&&ac.throwError("replacement fee too low",h.b.errors.REPLACEMENT_UNDERPRICED,{error:t,method:e,transaction:n}),a.match(/only replay-protected/i)&&ac.throwError("legacy pre-eip-155 transactions not supported",h.b.errors.UNSUPPORTED_OPERATION,{error:t,method:e,transaction:n}),sc.indexOf(e)>=0&&a.match(/gas required exceeds allowance|always failing transaction|execution reverted|revert/)&&ac.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",h.b.errors.UNPREDICTABLE_GAS_LIMIT,{error:t,method:e,transaction:n}),t}function uc(e){return new Promise((function(t){setTimeout(t,e)}))}function fc(e){if(e.error){var t=new Error(e.error.message);throw t.code=e.error.code,t.data=e.error.data,t}return e.result}function hc(e){return e?e.toLowerCase():e}var lc={},gc=function(e){XA(r,e);var t=ec(r);function r(e,n,i){var o;if(VA(this,r),o=t.call(this),e!==lc)throw new Error("do not call the JsonRpcSigner constructor directly; use provider.getSigner");return _(rc(o),"provider",n),null==i&&(i=0),"string"==typeof i?(_(rc(o),"_address",o.provider.formatter.address(i)),_(rc(o),"_index",null)):"number"==typeof i?(_(rc(o),"_index",i),_(rc(o),"_address",null)):ac.throwArgumentError("invalid address or index","addressOrIndex",i),o}return WA(r,[{key:"connect",value:function(e){return ac.throwError("cannot alter JSON-RPC Signer connection",h.b.errors.UNSUPPORTED_OPERATION,{operation:"connect"})}},{key:"connectUnchecked",value:function(){return new dc(lc,this.provider,this._address||this._index)}},{key:"getAddress",value:function(){var e=this;return this._address?Promise.resolve(this._address):this.provider.send("eth_accounts",[]).then((function(t){return t.length<=e._index&&ac.throwError("unknown account #"+e._index,h.b.errors.UNSUPPORTED_OPERATION,{operation:"getAddress"}),e.provider.formatter.address(t[e._index])}))}},{key:"sendUncheckedTransaction",value:function(e){var t=this;e=R(e);var r=this.getAddress().then((function(e){return e&&(e=e.toLowerCase()),e}));if(null==e.gasLimit){var n=R(e);n.from=r,e.gasLimit=this.provider.estimateGas(n)}return null!=e.to&&(e.to=Promise.resolve(e.to).then((function(e){return oc(t,void 0,void 0,regeneratorRuntime.mark((function t(){var r;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(null!=e){t.next=2;break}return t.abrupt("return",null);case 2:return t.next=4,this.provider.resolveName(e);case 4:return null==(r=t.sent)&&ac.throwArgumentError("provided ENS name resolves to null","tx.to",e),t.abrupt("return",r);case 7:case"end":return t.stop()}}),t,this)})))}))),D({tx:D(e),sender:r}).then((function(r){var n=r.tx,i=r.sender;null!=n.from?n.from.toLowerCase()!==i&&ac.throwArgumentError("from address mismatch","transaction",e):n.from=i;var o=t.provider.constructor.hexlifyTransaction(n,{from:!0});return t.provider.send("eth_sendTransaction",[o]).then((function(e){return e}),(function(e){return"string"==typeof e.message&&e.message.match(/user denied/i)&&ac.throwError("user rejected transaction",h.b.errors.ACTION_REJECTED,{action:"sendTransaction",transaction:n}),cc("sendTransaction",e,o)}))}))}},{key:"signTransaction",value:function(e){return ac.throwError("signing transactions is unsupported",h.b.errors.UNSUPPORTED_OPERATION,{operation:"signTransaction"})}},{key:"sendTransaction",value:function(e){return oc(this,void 0,void 0,regeneratorRuntime.mark((function t(){var r,n,i=this;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.provider._getInternalBlockNumber(100+2*this.provider.pollingInterval);case 2:return r=t.sent,t.next=5,this.sendUncheckedTransaction(e);case 5:return n=t.sent,t.prev=6,t.next=9,iA((function(){return oc(i,void 0,void 0,regeneratorRuntime.mark((function e(){var t;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.provider.getTransaction(n);case 2:if(null!==(t=e.sent)){e.next=5;break}return e.abrupt("return",void 0);case 5:return e.abrupt("return",this.provider._wrapTransaction(t,n,r));case 6:case"end":return e.stop()}}),e,this)})))}),{oncePoll:this.provider});case 9:return t.abrupt("return",t.sent);case 12:throw t.prev=12,t.t0=t.catch(6),t.t0.transactionHash=n,t.t0;case 16:case"end":return t.stop()}}),t,this,[[6,12]])})))}},{key:"signMessage",value:function(e){return oc(this,void 0,void 0,regeneratorRuntime.mark((function t(){var r,n;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r="string"==typeof e?be(e):e,t.next=3,this.getAddress();case 3:return n=t.sent,t.prev=4,t.next=7,this.provider.send("personal_sign",[Object(c.i)(r),n.toLowerCase()]);case 7:return t.abrupt("return",t.sent);case 10:throw t.prev=10,t.t0=t.catch(4),"string"==typeof t.t0.message&&t.t0.message.match(/user denied/i)&&ac.throwError("user rejected signing",h.b.errors.ACTION_REJECTED,{action:"signMessage",from:n,messageData:e}),t.t0;case 14:case"end":return t.stop()}}),t,this,[[4,10]])})))}},{key:"_legacySignMessage",value:function(e){return oc(this,void 0,void 0,regeneratorRuntime.mark((function t(){var r,n;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r="string"==typeof e?be(e):e,t.next=3,this.getAddress();case 3:return n=t.sent,t.prev=4,t.next=7,this.provider.send("eth_sign",[n.toLowerCase(),Object(c.i)(r)]);case 7:return t.abrupt("return",t.sent);case 10:throw t.prev=10,t.t0=t.catch(4),"string"==typeof t.t0.message&&t.t0.message.match(/user denied/i)&&ac.throwError("user rejected signing",h.b.errors.ACTION_REJECTED,{action:"_legacySignMessage",from:n,messageData:e}),t.t0;case 14:case"end":return t.stop()}}),t,this,[[4,10]])})))}},{key:"_signTypedData",value:function(e,t,r){return oc(this,void 0,void 0,regeneratorRuntime.mark((function n(){var i,o,a=this;return regeneratorRuntime.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,bo.resolveNames(e,t,r,(function(e){return a.provider.resolveName(e)}));case 2:return i=n.sent,n.next=5,this.getAddress();case 5:return o=n.sent,n.prev=6,n.next=9,this.provider.send("eth_signTypedData_v4",[o.toLowerCase(),JSON.stringify(bo.getPayload(i.domain,t,i.value))]);case 9:return n.abrupt("return",n.sent);case 12:throw n.prev=12,n.t0=n.catch(6),"string"==typeof n.t0.message&&n.t0.message.match(/user denied/i)&&ac.throwError("user rejected signing",h.b.errors.ACTION_REJECTED,{action:"_signTypedData",from:o,messageData:{domain:i.domain,types:t,value:i.value}}),n.t0;case 16:case"end":return n.stop()}}),n,this,[[6,12]])})))}},{key:"unlock",value:function(e){return oc(this,void 0,void 0,regeneratorRuntime.mark((function t(){var r,n;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=this.provider,t.next=3,this.getAddress();case 3:return n=t.sent,t.abrupt("return",r.send("personal_unlockAccount",[n.toLowerCase(),e,null]));case 5:case"end":return t.stop()}}),t,this)})))}}]),r}(On),dc=function(e){XA(r,e);var t=ec(r);function r(){return VA(this,r),t.apply(this,arguments)}return WA(r,[{key:"sendTransaction",value:function(e){var t=this;return this.sendUncheckedTransaction(e).then((function(e){return{hash:e,nonce:null,gasLimit:null,gasPrice:null,data:null,value:null,chainId:null,confirmations:0,from:null,wait:function(r){return t.provider.waitForTransaction(e,r)}}}))}}]),r}(gc),pc={chainId:!0,data:!0,gasLimit:!0,gasPrice:!0,nonce:!0,to:!0,value:!0,type:!0,accessList:!0,maxFeePerGas:!0,maxPriorityFeePerGas:!0},Ic=function(e){XA(r,e);var t=ec(r);function r(e,n){var i;VA(this,r);var o=n;return null==o&&(o=new Promise((function(e,t){setTimeout((function(){i.detectNetwork().then((function(t){e(t)}),(function(e){t(e)}))}),0)}))),i=t.call(this,o),e||(e=S(i.constructor,"defaultUrl")()),_(rc(i),"connection","string"==typeof e?Object.freeze({url:e}):Object.freeze(R(e))),i._nextId=42,i}return WA(r,[{key:"_cache",get:function(){return null==this._eventLoopCache&&(this._eventLoopCache={}),this._eventLoopCache}},{key:"detectNetwork",value:function(){var e=this;return this._cache.detectNetwork||(this._cache.detectNetwork=this._uncachedDetectNetwork(),setTimeout((function(){e._cache.detectNetwork=null}),0)),this._cache.detectNetwork}},{key:"_uncachedDetectNetwork",value:function(){return oc(this,void 0,void 0,regeneratorRuntime.mark((function e(){var t,r;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,uc(0);case 2:return t=null,e.prev=3,e.next=6,this.send("eth_chainId",[]);case 6:t=e.sent,e.next=19;break;case 9:return e.prev=9,e.t0=e.catch(3),e.prev=11,e.next=14,this.send("net_version",[]);case 14:t=e.sent,e.next=19;break;case 17:e.prev=17,e.t1=e.catch(11);case 19:if(null==t){e.next=28;break}return r=S(this.constructor,"getNetwork"),e.prev=21,e.abrupt("return",r(y.from(t).toNumber()));case 25:return e.prev=25,e.t2=e.catch(21),e.abrupt("return",ac.throwError("could not detect network",h.b.errors.NETWORK_ERROR,{chainId:t,event:"invalidNetwork",serverError:e.t2}));case 28:return e.abrupt("return",ac.throwError("could not detect network",h.b.errors.NETWORK_ERROR,{event:"noNetwork"}));case 29:case"end":return e.stop()}}),e,this,[[3,9],[11,17],[21,25]])})))}},{key:"getSigner",value:function(e){return new gc(lc,this,e)}},{key:"getUncheckedSigner",value:function(e){return this.getSigner(e).connectUnchecked()}},{key:"listAccounts",value:function(){var e=this;return this.send("eth_accounts",[]).then((function(t){return t.map((function(t){return e.formatter.address(t)}))}))}},{key:"send",value:function(e,t){var r=this,n={method:e,params:t,id:this._nextId++,jsonrpc:"2.0"};this.emit("debug",{action:"request",request:N(n),provider:this});var i=["eth_chainId","eth_blockNumber"].indexOf(e)>=0;if(i&&this._cache[e])return this._cache[e];var o=nA(this.connection,JSON.stringify(n),fc).then((function(e){return r.emit("debug",{action:"response",request:n,response:e,provider:r}),e}),(function(e){throw r.emit("debug",{action:"response",error:e,request:n,provider:r}),e}));return i&&(this._cache[e]=o,setTimeout((function(){r._cache[e]=null}),0)),o}},{key:"prepareRequest",value:function(e,t){switch(e){case"getBlockNumber":return["eth_blockNumber",[]];case"getGasPrice":return["eth_gasPrice",[]];case"getBalance":return["eth_getBalance",[hc(t.address),t.blockTag]];case"getTransactionCount":return["eth_getTransactionCount",[hc(t.address),t.blockTag]];case"getCode":return["eth_getCode",[hc(t.address),t.blockTag]];case"getStorageAt":return["eth_getStorageAt",[hc(t.address),Object(c.h)(t.position,32),t.blockTag]];case"sendTransaction":return["eth_sendRawTransaction",[t.signedTransaction]];case"getBlock":return t.blockTag?["eth_getBlockByNumber",[t.blockTag,!!t.includeTransactions]]:t.blockHash?["eth_getBlockByHash",[t.blockHash,!!t.includeTransactions]]:null;case"getTransaction":return["eth_getTransactionByHash",[t.transactionHash]];case"getTransactionReceipt":return["eth_getTransactionReceipt",[t.transactionHash]];case"call":return["eth_call",[S(this.constructor,"hexlifyTransaction")(t.transaction,{from:!0}),t.blockTag]];case"estimateGas":return["eth_estimateGas",[S(this.constructor,"hexlifyTransaction")(t.transaction,{from:!0})]];case"getLogs":return t.filter&&null!=t.filter.address&&(t.filter.address=hc(t.filter.address)),["eth_getLogs",[t.filter]]}return null}},{key:"perform",value:function(e,t){return oc(this,void 0,void 0,regeneratorRuntime.mark((function r(){var n,i,o;return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if("call"!==e&&"estimateGas"!==e){r.next=8;break}if(!(n=t.transaction)||null==n.type||!y.from(n.type).isZero()){r.next=8;break}if(null!=n.maxFeePerGas||null!=n.maxPriorityFeePerGas){r.next=8;break}return r.next=6,this.getFeeData();case 6:null==(i=r.sent).maxFeePerGas&&null==i.maxPriorityFeePerGas&&((t=R(t)).transaction=R(n),delete t.transaction.type);case 8:return null==(o=this.prepareRequest(e,t))&&ac.throwError(e+" not implemented",h.b.errors.NOT_IMPLEMENTED,{operation:e}),r.prev=10,r.next=13,this.send(o[0],o[1]);case 13:return r.abrupt("return",r.sent);case 16:return r.prev=16,r.t0=r.catch(10),r.abrupt("return",cc(e,r.t0,t));case 19:case"end":return r.stop()}}),r,this,[[10,16]])})))}},{key:"_startEvent",value:function(e){"pending"===e.tag&&this._startPending(),JA(nc(r.prototype),"_startEvent",this).call(this,e)}},{key:"_startPending",value:function(){if(null==this._pendingFilter){var e=this,t=this.send("eth_newPendingTransactionFilter",[]);this._pendingFilter=t,t.then((function(r){return function n(){e.send("eth_getFilterChanges",[r]).then((function(r){if(e._pendingFilter!=t)return null;var n=Promise.resolve();return r.forEach((function(t){e._emitted["t:"+t.toLowerCase()]="pending",n=n.then((function(){return e.getTransaction(t).then((function(t){return e.emit("pending",t),null}))}))})),n.then((function(){return uc(1e3)}))})).then((function(){if(e._pendingFilter==t)return setTimeout((function(){n()}),0),null;e.send("eth_uninstallFilter",[r])})).catch((function(e){}))}(),r})).catch((function(e){}))}}},{key:"_stopEvent",value:function(e){"pending"===e.tag&&0===this.listenerCount("pending")&&(this._pendingFilter=null),JA(nc(r.prototype),"_stopEvent",this).call(this,e)}}],[{key:"defaultUrl",value:function(){return"http://localhost:8545"}},{key:"hexlifyTransaction",value:function(e,t){var r=R(pc);if(t)for(var n in t)t[n]&&(r[n]=!0);M(e,r);var i={};return["chainId","gasLimit","gasPrice","type","maxFeePerGas","maxPriorityFeePerGas","nonce","value"].forEach((function(t){if(null!=e[t]){var r=Object(c.g)(y.from(e[t]));"gasLimit"===t&&(t="gas"),i[t]=r}})),["from","to","data"].forEach((function(t){null!=e[t]&&(i[t]=Object(c.i)(e[t]))})),e.accessList&&(i.accessList=ei(e.accessList)),i}}]),r}(qA),yc=null;try{if(null==(yc=WebSocket))throw new Error("inject please")}catch(e){var bc=new h.b("providers/5.7.2");yc=function(){bc.throwError("WebSockets not supported in this environment",h.b.errors.UNSUPPORTED_OPERATION,{operation:"new WebSocket()"})}}function Ec(e){return(Ec="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function mc(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function Cc(e,t){return(Cc=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function vc(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=_c(e);if(t){var i=_c(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return Bc(this,r)}}function Bc(e,t){if(t&&("object"===Ec(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return wc(e)}function wc(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Qc(){return(Qc="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,r){var n=kc(e,t);if(n){var i=Object.getOwnPropertyDescriptor(n,t);return i.get?i.get.call(arguments.length<3?e:r):i.value}}).apply(this,arguments)}function kc(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=_c(e)););return e}function _c(e){return(_c=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var Sc=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{A(n.next(e))}catch(e){o(e)}}function s(e){try{A(n.throw(e))}catch(e){o(e)}}function A(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}A((n=n.apply(e,t||[])).next())}))},Dc=new h.b("providers/5.7.2"),Mc=1,Rc=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Cc(e,t)}(o,e);var t,r,n,i=vc(o);function o(e,t){var r,n;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,o),"any"===t&&Dc.throwError("WebSocketProvider does not support 'any' network yet",h.b.errors.UNSUPPORTED_OPERATION,{operation:"network:any"}),(n="string"==typeof e?i.call(this,e,t):i.call(this,"_websocket",t))._pollingInterval=-1,n._wsReady=!1,_(wc(n),"_websocket","string"==typeof e?new yc(n.connection.url):e),_(wc(n),"_requests",{}),_(wc(n),"_subs",{}),_(wc(n),"_subIds",{}),_(wc(n),"_detectNetwork",Qc((r=wc(n),_c(o.prototype)),"detectNetwork",r).call(r)),n.websocket.onopen=function(){n._wsReady=!0,Object.keys(n._requests).forEach((function(e){n.websocket.send(n._requests[e].payload)}))},n.websocket.onmessage=function(e){var t=e.data,r=JSON.parse(t);if(null!=r.id){var i=String(r.id),o=n._requests[i];if(delete n._requests[i],void 0!==r.result)o.callback(null,r.result),n.emit("debug",{action:"response",request:JSON.parse(o.payload),response:r.result,provider:wc(n)});else{var a=null;r.error?(_(a=new Error(r.error.message||"unknown error"),"code",r.error.code||null),_(a,"response",t)):a=new Error("unknown error"),o.callback(a,void 0),n.emit("debug",{action:"response",error:a,request:JSON.parse(o.payload),provider:wc(n)})}}else if("eth_subscription"===r.method){var s=n._subs[r.params.subscription];s&&s.processFunc(r.params.result)}else console.warn("this should not happen")};var a=setInterval((function(){n.emit("poll")}),1e3);return a.unref&&a.unref(),Bc(n)}return t=o,n=[{key:"defaultUrl",value:function(){return"ws://localhost:8546"}}],(r=[{key:"websocket",get:function(){return this._websocket}},{key:"detectNetwork",value:function(){return this._detectNetwork}},{key:"pollingInterval",get:function(){return 0},set:function(e){Dc.throwError("cannot set polling interval on WebSocketProvider",h.b.errors.UNSUPPORTED_OPERATION,{operation:"setPollingInterval"})}},{key:"resetEventsBlock",value:function(e){Dc.throwError("cannot reset events block on WebSocketProvider",h.b.errors.UNSUPPORTED_OPERATION,{operation:"resetEventBlock"})}},{key:"poll",value:function(){return Sc(this,void 0,void 0,regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",null);case 1:case"end":return e.stop()}}),e)})))}},{key:"polling",set:function(e){e&&Dc.throwError("cannot set polling on WebSocketProvider",h.b.errors.UNSUPPORTED_OPERATION,{operation:"setPolling"})}},{key:"send",value:function(e,t){var r=this,n=Mc++;return new Promise((function(i,o){var a=JSON.stringify({method:e,params:t,id:n,jsonrpc:"2.0"});r.emit("debug",{action:"request",request:JSON.parse(a),provider:r}),r._requests[String(n)]={callback:function(e,t){return e?o(e):i(t)},payload:a},r._wsReady&&r.websocket.send(a)}))}},{key:"_subscribe",value:function(e,t,r){return Sc(this,void 0,void 0,regeneratorRuntime.mark((function n(){var i,o,a=this;return regeneratorRuntime.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return null==(i=this._subIds[e])&&(i=Promise.all(t).then((function(e){return a.send("eth_subscribe",e)})),this._subIds[e]=i),n.next=4,i;case 4:o=n.sent,this._subs[o]={tag:e,processFunc:r};case 6:case"end":return n.stop()}}),n,this)})))}},{key:"_startEvent",value:function(e){var t=this;switch(e.type){case"block":this._subscribe("block",["newHeads"],(function(e){var r=y.from(e.number).toNumber();t._emitted.block=r,t.emit("block",r)}));break;case"pending":this._subscribe("pending",["newPendingTransactions"],(function(e){t.emit("pending",e)}));break;case"filter":this._subscribe(e.tag,["logs",this._getFilter(e.filter)],(function(r){null==r.removed&&(r.removed=!1),t.emit(e.filter,t.formatter.filterLog(r))}));break;case"tx":var r=function(e){var r=e.hash;t.getTransactionReceipt(r).then((function(e){e&&t.emit(r,e)}))};r(e),this._subscribe("tx",["newHeads"],(function(e){t._events.filter((function(e){return"tx"===e.type})).forEach(r)}));break;case"debug":case"poll":case"willPoll":case"didPoll":case"error":break;default:console.log("unhandled:",e)}}},{key:"_stopEvent",value:function(e){var t=this,r=e.tag;if("tx"===e.type){if(this._events.filter((function(e){return"tx"===e.type})).length)return;r="tx"}else if(this.listenerCount(e.event))return;var n=this._subIds[r];n&&(delete this._subIds[r],n.then((function(e){t._subs[e]&&(delete t._subs[e],t.send("eth_unsubscribe",[e]))})))}},{key:"destroy",value:function(){return Sc(this,void 0,void 0,regeneratorRuntime.mark((function e(){var t=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.websocket.readyState!==yc.CONNECTING){e.next=3;break}return e.next=3,new Promise((function(e){t.websocket.onopen=function(){e(!0)},t.websocket.onerror=function(){e(!1)}}));case 3:this.websocket.close(1e3);case 4:case"end":return e.stop()}}),e,this)})))}}])&&mc(t.prototype,r),n&&mc(t,n),Object.defineProperty(t,"prototype",{writable:!1}),o}(Ic);function xc(e){return(xc="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Oc(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Nc(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function Pc(e,t,r){return t&&Nc(e.prototype,t),r&&Nc(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function Fc(){return(Fc="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,r){var n=jc(e,t);if(n){var i=Object.getOwnPropertyDescriptor(n,t);return i.get?i.get.call(arguments.length<3?e:r):i.value}}).apply(this,arguments)}function jc(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=Yc(e)););return e}function Tc(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Uc(e,t)}function Uc(e,t){return(Uc=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Lc(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=Yc(e);if(t){var i=Yc(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return Hc(this,r)}}function Hc(e,t){if(t&&("object"===xc(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return Gc(e)}function Gc(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Yc(e){return(Yc=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var Kc=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{A(n.next(e))}catch(e){o(e)}}function s(e){try{A(n.throw(e))}catch(e){o(e)}}function A(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}A((n=n.apply(e,t||[])).next())}))},qc=new h.b("providers/5.7.2"),Jc=function(e){Tc(r,e);var t=Lc(r);function r(){return Oc(this,r),t.apply(this,arguments)}return Pc(r,[{key:"detectNetwork",value:function(){var e=this,t=Object.create(null,{detectNetwork:{get:function(){return Fc(Yc(r.prototype),"detectNetwork",e)}}});return Kc(this,void 0,void 0,regeneratorRuntime.mark((function e(){var r;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(null!=(r=this.network)){e.next=7;break}return e.next=4,t.detectNetwork.call(this);case 4:(r=e.sent)||qc.throwError("no network detected",h.b.errors.UNKNOWN_ERROR,{}),null==this._network&&(_(this,"_network",r),this.emit("network",r,null));case 7:return e.abrupt("return",r);case 8:case"end":return e.stop()}}),e,this)})))}}]),r}(Ic),zc=function(e){Tc(r,e);var t=Lc(r);function r(e,n){var i;Oc(this,r),qc.checkAbstract(this instanceof r?this.constructor:void 0,r),e=S(this instanceof r?this.constructor:void 0,"getNetwork")(e),n=S(this instanceof r?this.constructor:void 0,"getApiKey")(n);var o=S(this instanceof r?this.constructor:void 0,"getUrl")(e,n);return i=t.call(this,o,e),"string"==typeof n?_(Gc(i),"apiKey",n):null!=n&&Object.keys(n).forEach((function(e){_(Gc(i),e,n[e])})),i}return Pc(r,[{key:"_startPending",value:function(){qc.warn("WARNING: API provider does not support pending filters")}},{key:"isCommunityResource",value:function(){return!1}},{key:"getSigner",value:function(e){return qc.throwError("API provider does not support signing",h.b.errors.UNSUPPORTED_OPERATION,{operation:"getSigner"})}},{key:"listAccounts",value:function(){return Promise.resolve([])}}],[{key:"getApiKey",value:function(e){return e}},{key:"getUrl",value:function(e,t){return qc.throwError("not implemented; sub-classes must override getUrl",h.b.errors.NOT_IMPLEMENTED,{operation:"getUrl"})}}]),r}(Jc);function Vc(e){return(Vc="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Zc(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Wc(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function Xc(e,t,r){return t&&Wc(e.prototype,t),r&&Wc(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function $c(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&eu(e,t)}function eu(e,t){return(eu=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function tu(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=iu(e);if(t){var i=iu(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return ru(this,r)}}function ru(e,t){if(t&&("object"===Vc(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return nu(e)}function nu(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function iu(e){return(iu=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var ou=new h.b("providers/5.7.2"),au="_gg7wSSi0KMBsdKnGVfHDueq6xMB9EkC",su=function(e){$c(r,e);var t=tu(r);function r(e,n){var i;Zc(this,r);var o=new Au(e,n),a=o.connection.url.replace(/^http/i,"ws").replace(".alchemyapi.",".ws.alchemyapi.");return _(nu(i=t.call(this,a,o.network)),"apiKey",o.apiKey),i}return Xc(r,[{key:"isCommunityResource",value:function(){return this.apiKey===au}}]),r}(Rc),Au=function(e){$c(r,e);var t=tu(r);function r(){return Zc(this,r),t.apply(this,arguments)}return Xc(r,[{key:"isCommunityResource",value:function(){return this.apiKey===au}}],[{key:"getWebSocketProvider",value:function(e,t){return new su(e,t)}},{key:"getApiKey",value:function(e){return null==e?au:(e&&"string"!=typeof e&&ou.throwArgumentError("invalid apiKey","apiKey",e),e)}},{key:"getUrl",value:function(e,t){var r=null;switch(e.name){case"homestead":r="eth-mainnet.alchemyapi.io/v2/";break;case"goerli":r="eth-goerli.g.alchemy.com/v2/";break;case"matic":r="polygon-mainnet.g.alchemy.com/v2/";break;case"maticmum":r="polygon-mumbai.g.alchemy.com/v2/";break;case"arbitrum":r="arb-mainnet.g.alchemy.com/v2/";break;case"arbitrum-goerli":r="arb-goerli.g.alchemy.com/v2/";break;case"optimism":r="opt-mainnet.g.alchemy.com/v2/";break;case"optimism-goerli":r="opt-goerli.g.alchemy.com/v2/";break;default:ou.throwArgumentError("unsupported network","network",arguments[0])}return{allowGzip:!0,url:"https://"+r+t,throttleCallback:function(e,r){return t===au&&lA(),Promise.resolve(!0)}}}}]),r}(zc);function cu(e){return(cu="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function uu(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function fu(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function hu(e,t){return(hu=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function lu(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=du(e);if(t){var i=du(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return gu(this,r)}}function gu(e,t){if(t&&("object"===cu(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function du(e){return(du=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var pu=new h.b("providers/5.7.2"),Iu="9f7d929b018cdffb338517efa06f58359e86ff1ffd350bc889738523659e7972";function yu(e){switch(e){case"homestead":return"rpc.ankr.com/eth/";case"ropsten":return"rpc.ankr.com/eth_ropsten/";case"rinkeby":return"rpc.ankr.com/eth_rinkeby/";case"goerli":return"rpc.ankr.com/eth_goerli/";case"matic":return"rpc.ankr.com/polygon/";case"arbitrum":return"rpc.ankr.com/arbitrum/"}return pu.throwArgumentError("unsupported network","name",e)}var bu=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&hu(e,t)}(o,e);var t,r,n,i=lu(o);function o(){return uu(this,o),i.apply(this,arguments)}return t=o,n=[{key:"getApiKey",value:function(e){return null==e?Iu:e}},{key:"getUrl",value:function(e,t){null==t&&(t=Iu);var r={allowGzip:!0,url:"https://"+yu(e.name)+t,throttleCallback:function(e,r){return t.apiKey===Iu&&lA(),Promise.resolve(!0)}};return null!=t.projectSecret&&(r.user="",r.password=t.projectSecret),r}}],(r=[{key:"isCommunityResource",value:function(){return this.apiKey===Iu}}])&&fu(t.prototype,r),n&&fu(t,n),Object.defineProperty(t,"prototype",{writable:!1}),o}(zc);function Eu(e){return(Eu="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function mu(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Cu(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function vu(){return(vu="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,r){var n=Bu(e,t);if(n){var i=Object.getOwnPropertyDescriptor(n,t);return i.get?i.get.call(arguments.length<3?e:r):i.value}}).apply(this,arguments)}function Bu(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=_u(e)););return e}function wu(e,t){return(wu=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Qu(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=_u(e);if(t){var i=_u(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return ku(this,r)}}function ku(e,t){if(t&&("object"===Eu(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function _u(e){return(_u=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var Su=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{A(n.next(e))}catch(e){o(e)}}function s(e){try{A(n.throw(e))}catch(e){o(e)}}function A(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}A((n=n.apply(e,t||[])).next())}))},Du=new h.b("providers/5.7.2"),Mu=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&wu(e,t)}(o,e);var t,r,n,i=Qu(o);function o(){return mu(this,o),i.apply(this,arguments)}return t=o,n=[{key:"getApiKey",value:function(e){return null!=e&&Du.throwArgumentError("apiKey not supported for cloudflare","apiKey",e),null}},{key:"getUrl",value:function(e,t){var r=null;switch(e.name){case"homestead":r="https://cloudflare-eth.com/";break;default:Du.throwArgumentError("unsupported network","network",arguments[0])}return r}}],(r=[{key:"perform",value:function(e,t){var r=this,n=Object.create(null,{perform:{get:function(){return vu(_u(o.prototype),"perform",r)}}});return Su(this,void 0,void 0,regeneratorRuntime.mark((function r(){var i;return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if("getBlockNumber"!==e){r.next=5;break}return r.next=3,n.perform.call(this,"getBlock",{blockTag:"latest"});case 3:return i=r.sent,r.abrupt("return",i.number);case 5:return r.abrupt("return",n.perform.call(this,e,t));case 6:case"end":return r.stop()}}),r,this)})))}}])&&Cu(t.prototype,r),n&&Cu(t,n),Object.defineProperty(t,"prototype",{writable:!1}),o}(zc);function Ru(e){return(Ru="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function xu(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function Ou(){return(Ou="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,r){var n=Nu(e,t);if(n){var i=Object.getOwnPropertyDescriptor(n,t);return i.get?i.get.call(arguments.length<3?e:r):i.value}}).apply(this,arguments)}function Nu(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=Uu(e)););return e}function Pu(e,t){return(Pu=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Fu(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=Uu(e);if(t){var i=Uu(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return ju(this,r)}}function ju(e,t){if(t&&("object"===Ru(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return Tu(e)}function Tu(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Uu(e){return(Uu=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var Lu=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{A(n.next(e))}catch(e){o(e)}}function s(e){try{A(n.throw(e))}catch(e){o(e)}}function A(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}A((n=n.apply(e,t||[])).next())}))},Hu=new h.b("providers/5.7.2");function Gu(e){var t={};for(var r in e)if(null!=e[r]){var n=e[r];"type"===r&&0===n||(n={type:!0,gasLimit:!0,gasPrice:!0,maxFeePerGs:!0,maxPriorityFeePerGas:!0,nonce:!0,value:!0}[r]?Object(c.g)(Object(c.i)(n)):"accessList"===r?"["+ei(n).map((function(e){return'{address:"'.concat(e.address,'",storageKeys:["').concat(e.storageKeys.join('","'),'"]}')})).join(",")+"]":Object(c.i)(n),t[r]=n)}return t}function Yu(e){if(0==e.status&&("No records found"===e.message||"No transactions found"===e.message))return e.result;if(1!=e.status||"string"!=typeof e.message||!e.message.match(/^OK/)){var t=new Error("invalid response");throw t.result=JSON.stringify(e),(e.result||"").toLowerCase().indexOf("rate limit")>=0&&(t.throttleRetry=!0),t}return e.result}function Ku(e){if(e&&0==e.status&&"NOTOK"==e.message&&(e.result||"").toLowerCase().indexOf("rate limit")>=0){var t=new Error("throttled response");throw t.result=JSON.stringify(e),t.throttleRetry=!0,t}if("2.0"!=e.jsonrpc){var r=new Error("invalid response");throw r.result=JSON.stringify(e),r}if(e.error){var n=new Error(e.error.message||"unknown error");throw e.error.code&&(n.code=e.error.code),e.error.data&&(n.data=e.error.data),n}return e.result}function qu(e){if("pending"===e)throw new Error("pending not supported");return"latest"===e?e:parseInt(e.substring(2),16)}function Ju(e,t,r){if("call"===e&&t.code===h.b.errors.SERVER_ERROR){var n=t.error;if(n&&(n.message.match(/reverted/i)||n.message.match(/VM execution error/i))){var i=n.data;if(i&&(i="0x"+i.replace(/^.*0x/i,"")),Object(c.l)(i))return i;Hu.throwError("missing revert data in call exception",h.b.errors.CALL_EXCEPTION,{error:t,data:"0x"})}}var o=t.message;throw t.code===h.b.errors.SERVER_ERROR&&(t.error&&"string"==typeof t.error.message?o=t.error.message:"string"==typeof t.body?o=t.body:"string"==typeof t.responseText&&(o=t.responseText)),(o=(o||"").toLowerCase()).match(/insufficient funds/)&&Hu.throwError("insufficient funds for intrinsic transaction cost",h.b.errors.INSUFFICIENT_FUNDS,{error:t,method:e,transaction:r}),o.match(/same hash was already imported|transaction nonce is too low|nonce too low/)&&Hu.throwError("nonce has already been used",h.b.errors.NONCE_EXPIRED,{error:t,method:e,transaction:r}),o.match(/another transaction with same nonce/)&&Hu.throwError("replacement fee too low",h.b.errors.REPLACEMENT_UNDERPRICED,{error:t,method:e,transaction:r}),o.match(/execution failed due to an exception|execution reverted/)&&Hu.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",h.b.errors.UNPREDICTABLE_GAS_LIMIT,{error:t,method:e,transaction:r}),t}var zu=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Pu(e,t)}(o,e);var t,r,n,i=Fu(o);function o(e,t){var r;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,o),_(Tu(r=i.call(this,e)),"baseUrl",r.getBaseUrl()),_(Tu(r),"apiKey",t||null),r}return t=o,(r=[{key:"getBaseUrl",value:function(){switch(this.network?this.network.name:"invalid"){case"homestead":return"https://api.etherscan.io";case"goerli":return"https://api-goerli.etherscan.io";case"sepolia":return"https://api-sepolia.etherscan.io";case"matic":return"https://api.polygonscan.com";case"maticmum":return"https://api-testnet.polygonscan.com";case"arbitrum":return"https://api.arbiscan.io";case"arbitrum-goerli":return"https://api-goerli.arbiscan.io";case"optimism":return"https://api-optimistic.etherscan.io";case"optimism-goerli":return"https://api-goerli-optimistic.etherscan.io"}return Hu.throwArgumentError("unsupported network","network",this.network.name)}},{key:"getUrl",value:function(e,t){var r=Object.keys(t).reduce((function(e,r){var n=t[r];return null!=n&&(e+="&".concat(r,"=").concat(n)),e}),""),n=this.apiKey?"&apikey=".concat(this.apiKey):"";return"".concat(this.baseUrl,"/api?module=").concat(e).concat(r).concat(n)}},{key:"getPostUrl",value:function(){return"".concat(this.baseUrl,"/api")}},{key:"getPostData",value:function(e,t){return t.module=e,t.apikey=this.apiKey,t}},{key:"fetch",value:function(e,t,r){return Lu(this,void 0,void 0,regeneratorRuntime.mark((function n(){var i,o,a,s,A,c,u=this;return regeneratorRuntime.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return i=r?this.getPostUrl():this.getUrl(e,t),o=r?this.getPostData(e,t):null,a="proxy"===e?Ku:Yu,this.emit("debug",{action:"request",request:i,provider:this}),s={url:i,throttleSlotInterval:1e3,throttleCallback:function(e,t){return u.isCommunityResource()&&lA(),Promise.resolve(!0)}},A=null,o&&(s.headers={"content-type":"application/x-www-form-urlencoded; charset=UTF-8"},A=Object.keys(o).map((function(e){return"".concat(e,"=").concat(o[e])})).join("&")),n.next=9,nA(s,A,a||Ku);case 9:return c=n.sent,this.emit("debug",{action:"response",request:i,response:N(c),provider:this}),n.abrupt("return",c);case 12:case"end":return n.stop()}}),n,this)})))}},{key:"detectNetwork",value:function(){return Lu(this,void 0,void 0,regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",this.network);case 1:case"end":return e.stop()}}),e,this)})))}},{key:"perform",value:function(e,t){var r=this,n=Object.create(null,{perform:{get:function(){return Ou(Uu(o.prototype),"perform",r)}}});return Lu(this,void 0,void 0,regeneratorRuntime.mark((function r(){var i,o,a,s,A,c,u,f,l;return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:r.t0=e,r.next="getBlockNumber"===r.t0?3:"getGasPrice"===r.t0?4:"getBalance"===r.t0?5:"getTransactionCount"===r.t0?6:"getCode"===r.t0?7:"getStorageAt"===r.t0?8:"sendTransaction"===r.t0?9:"getBlock"===r.t0?10:"getTransaction"===r.t0?13:"getTransactionReceipt"===r.t0?14:"call"===r.t0?15:"estimateGas"===r.t0?29:"getLogs"===r.t0?41:"getEtherPrice"===r.t0?65:72;break;case 3:return r.abrupt("return",this.fetch("proxy",{action:"eth_blockNumber"}));case 4:return r.abrupt("return",this.fetch("proxy",{action:"eth_gasPrice"}));case 5:return r.abrupt("return",this.fetch("account",{action:"balance",address:t.address,tag:t.blockTag}));case 6:return r.abrupt("return",this.fetch("proxy",{action:"eth_getTransactionCount",address:t.address,tag:t.blockTag}));case 7:return r.abrupt("return",this.fetch("proxy",{action:"eth_getCode",address:t.address,tag:t.blockTag}));case 8:return r.abrupt("return",this.fetch("proxy",{action:"eth_getStorageAt",address:t.address,position:t.position,tag:t.blockTag}));case 9:return r.abrupt("return",this.fetch("proxy",{action:"eth_sendRawTransaction",hex:t.signedTransaction},!0).catch((function(e){return Ju("sendTransaction",e,t.signedTransaction)})));case 10:if(!t.blockTag){r.next=12;break}return r.abrupt("return",this.fetch("proxy",{action:"eth_getBlockByNumber",tag:t.blockTag,boolean:t.includeTransactions?"true":"false"}));case 12:throw new Error("getBlock by blockHash not implemented");case 13:return r.abrupt("return",this.fetch("proxy",{action:"eth_getTransactionByHash",txhash:t.transactionHash}));case 14:return r.abrupt("return",this.fetch("proxy",{action:"eth_getTransactionReceipt",txhash:t.transactionHash}));case 15:if("latest"===t.blockTag){r.next=17;break}throw new Error("EtherscanProvider does not support blockTag for call");case 17:return(i=Gu(t.transaction)).module="proxy",i.action="eth_call",r.prev=20,r.next=23,this.fetch("proxy",i,!0);case 23:return r.abrupt("return",r.sent);case 26:return r.prev=26,r.t1=r.catch(20),r.abrupt("return",Ju("call",r.t1,t.transaction));case 29:return(o=Gu(t.transaction)).module="proxy",o.action="eth_estimateGas",r.prev=32,r.next=35,this.fetch("proxy",o,!0);case 35:return r.abrupt("return",r.sent);case 38:return r.prev=38,r.t2=r.catch(32),r.abrupt("return",Ju("estimateGas",r.t2,t.transaction));case 41:return a={action:"getLogs"},t.filter.fromBlock&&(a.fromBlock=qu(t.filter.fromBlock)),t.filter.toBlock&&(a.toBlock=qu(t.filter.toBlock)),t.filter.address&&(a.address=t.filter.address),t.filter.topics&&t.filter.topics.length>0&&(t.filter.topics.length>1&&Hu.throwError("unsupported topic count",h.b.errors.UNSUPPORTED_OPERATION,{topics:t.filter.topics}),1===t.filter.topics.length&&("string"==typeof(s=t.filter.topics[0])&&66===s.length||Hu.throwError("unsupported topic format",h.b.errors.UNSUPPORTED_OPERATION,{topic0:s}),a.topic0=s)),r.next=48,this.fetch("logs",a);case 48:A=r.sent,c={},u=0;case 51:if(!(u<A.length)){r.next=64;break}if(null==(f=A[u]).blockHash){r.next=55;break}return r.abrupt("continue",61);case 55:if(null!=c[f.blockNumber]){r.next=60;break}return r.next=58,this.getBlock(f.blockNumber);case 58:(l=r.sent)&&(c[f.blockNumber]=l.hash);case 60:f.blockHash=c[f.blockNumber];case 61:u++,r.next=51;break;case 64:return r.abrupt("return",A);case 65:if("homestead"===this.network.name){r.next=67;break}return r.abrupt("return",0);case 67:return r.t3=parseFloat,r.next=70,this.fetch("stats",{action:"ethprice"});case 70:return r.t4=r.sent.ethusd,r.abrupt("return",(0,r.t3)(r.t4));case 72:return r.abrupt("break",73);case 73:return r.abrupt("return",n.perform.call(this,e,t));case 74:case"end":return r.stop()}}),r,this,[[20,26],[32,38]])})))}},{key:"getHistory",value:function(e,t,r){return Lu(this,void 0,void 0,regeneratorRuntime.mark((function n(){var i,o,a=this;return regeneratorRuntime.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,this.resolveName(e);case 2:return n.t0=n.sent,n.t1=null==t?0:t,n.t2=null==r?99999999:r,i={action:"txlist",address:n.t0,startblock:n.t1,endblock:n.t2,sort:"asc"},n.next=8,this.fetch("account",i);case 8:return o=n.sent,n.abrupt("return",o.map((function(e){["contractAddress","to"].forEach((function(t){""==e[t]&&delete e[t]})),null==e.creates&&null!=e.contractAddress&&(e.creates=e.contractAddress);var t=a.formatter.transactionResponse(e);return e.timeStamp&&(t.timestamp=parseInt(e.timeStamp)),t})));case 10:case"end":return n.stop()}}),n,this)})))}},{key:"isCommunityResource",value:function(){return null==this.apiKey}}])&&xu(t.prototype,r),n&&xu(t,n),Object.defineProperty(t,"prototype",{writable:!1}),o}(qA);function Vu(e){for(var t=(e=e.slice()).length-1;t>0;t--){var r=Math.floor(Math.random()*(t+1)),n=e[t];e[t]=e[r],e[r]=n}return e}function Zu(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function Wu(e,t){return(Wu=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Xu(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=tf(e);if(t){var i=tf(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return $u(this,r)}}function $u(e,t){if(t&&("object"===rf(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return ef(e)}function ef(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function tf(e){return(tf=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function rf(e){return(rf="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var nf=function(e,t,r,n){return new(r||(r=Promise))((function(i,o){function a(e){try{A(n.next(e))}catch(e){o(e)}}function s(e){try{A(n.throw(e))}catch(e){o(e)}}function A(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}A((n=n.apply(e,t||[])).next())}))},of=new h.b("providers/5.7.2");function af(){return(new Date).getTime()}function sf(e){for(var t=null,r=0;r<e.length;r++){var n=e[r];if(null==n)return null;t?t.name===n.name&&t.chainId===n.chainId&&(t.ensAddress===n.ensAddress||null==t.ensAddress&&null==n.ensAddress)||of.throwArgumentError("provider mismatch","networks",e):t=n}return t}function Af(e,t){e=e.slice().sort();var r=Math.floor(e.length/2);if(e.length%2)return e[r];var n=e[r-1],i=e[r];return null!=t&&Math.abs(n-i)>t?null:(n+i)/2}function cf(e){if(null===e)return"null";if("number"==typeof e||"boolean"==typeof e)return JSON.stringify(e);if("string"==typeof e)return e;if(y.isBigNumber(e))return e.toString();if(Array.isArray(e))return JSON.stringify(e.map((function(e){return cf(e)})));if("object"===rf(e)){var t=Object.keys(e);return t.sort(),"{"+t.map((function(t){var r=e[t];return r="function"==typeof r?"[function]":cf(r),JSON.stringify(t)+":"+r})).join(",")+"}"}throw new Error("unknown value type: "+rf(e))}var uf=1;function ff(e){var t=null,r=null,n=new Promise((function(n){t=function(){r&&(clearTimeout(r),r=null),n()},r=setTimeout(t,e)}));return{cancel:t,getPromise:function(){return n},wait:function(e){return n=n.then(e)}}}var hf=[h.b.errors.CALL_EXCEPTION,h.b.errors.INSUFFICIENT_FUNDS,h.b.errors.NONCE_EXPIRED,h.b.errors.REPLACEMENT_UNDERPRICED,h.b.errors.UNPREDICTABLE_GAS_LIMIT],lf=["address","args","errorArgs","errorSignature","method","transaction"];function gf(e,t){var r={weight:e.weight};return Object.defineProperty(r,"provider",{get:function(){return e.provider}}),e.start&&(r.start=e.start),t&&(r.duration=t-e.start),e.done&&(e.error?r.error=e.error:r.result=e.result||null),r}function df(e,t,r){var n=cf;switch(t){case"getBlockNumber":return function(t){var r=t.map((function(e){return e.result})),n=Af(t.map((function(e){return e.result})),2);if(null!=n)return n=Math.ceil(n),r.indexOf(n+1)>=0&&n++,n>=e._highestBlockNumber&&(e._highestBlockNumber=n),e._highestBlockNumber};case"getGasPrice":return function(e){var t=e.map((function(e){return e.result}));return t.sort(),t[Math.floor(t.length/2)]};case"getEtherPrice":return function(e){return Af(e.map((function(e){return e.result})))};case"getBalance":case"getTransactionCount":case"getCode":case"getStorageAt":case"call":case"estimateGas":case"getLogs":break;case"getTransaction":case"getTransactionReceipt":n=function(e){return null==e?null:((e=R(e)).confirmations=-1,cf(e))};break;case"getBlock":n=r.includeTransactions?function(e){return null==e?null:((e=R(e)).transactions=e.transactions.map((function(e){return(e=R(e)).confirmations=-1,e})),cf(e))}:function(e){return null==e?null:cf(e)};break;default:throw new Error("unknown method: "+t)}return function(e,t){return function(r){var n={};r.forEach((function(t){var r=e(t.result);n[r]||(n[r]={count:0,result:t.result}),n[r].count++}));for(var i=Object.keys(n),o=0;o<i.length;o++){var a=n[i[o]];if(a.count>=t)return a.result}}}(n,e.quorum)}function pf(e,t){return nf(this,void 0,void 0,regeneratorRuntime.mark((function r(){var n;return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(!(null!=(n=e.provider).blockNumber&&n.blockNumber>=t||-1===t)){r.next=3;break}return r.abrupt("return",n);case 3:return r.abrupt("return",iA((function(){return new Promise((function(r,i){setTimeout((function(){return n.blockNumber>=t?r(n):e.cancelled?r(null):r(void 0)}),0)}))}),{oncePoll:n}));case 4:case"end":return r.stop()}}),r)})))}function If(e,t,r,n){return nf(this,void 0,void 0,regeneratorRuntime.mark((function i(){var o,a;return regeneratorRuntime.wrap((function(i){for(;;)switch(i.prev=i.next){case 0:o=e.provider,i.t0=r,i.next="getBlockNumber"===i.t0||"getGasPrice"===i.t0?4:"getEtherPrice"===i.t0?5:"getBalance"===i.t0||"getTransactionCount"===i.t0||"getCode"===i.t0?8:"getStorageAt"===i.t0?13:"getBlock"===i.t0?18:"call"===i.t0||"estimateGas"===i.t0?23:"getTransaction"===i.t0||"getTransactionReceipt"===i.t0?30:"getLogs"===i.t0?31:37;break;case 4:return i.abrupt("return",o[r]());case 5:if(!o.getEtherPrice){i.next=7;break}return i.abrupt("return",o.getEtherPrice());case 7:return i.abrupt("break",37);case 8:if(!n.blockTag||!Object(c.l)(n.blockTag)){i.next=12;break}return i.next=11,pf(e,t);case 11:o=i.sent;case 12:return i.abrupt("return",o[r](n.address,n.blockTag||"latest"));case 13:if(!n.blockTag||!Object(c.l)(n.blockTag)){i.next=17;break}return i.next=16,pf(e,t);case 16:o=i.sent;case 17:return i.abrupt("return",o.getStorageAt(n.address,n.position,n.blockTag||"latest"));case 18:if(!n.blockTag||!Object(c.l)(n.blockTag)){i.next=22;break}return i.next=21,pf(e,t);case 21:o=i.sent;case 22:return i.abrupt("return",o[n.includeTransactions?"getBlockWithTransactions":"getBlock"](n.blockTag||n.blockHash));case 23:if(!n.blockTag||!Object(c.l)(n.blockTag)){i.next=27;break}return i.next=26,pf(e,t);case 26:o=i.sent;case 27:if("call"!==r||!n.blockTag){i.next=29;break}return i.abrupt("return",o[r](n.transaction,n.blockTag));case 29:return i.abrupt("return",o[r](n.transaction));case 30:return i.abrupt("return",o[r](n.transactionHash));case 31:if(!((a=n.filter).fromBlock&&Object(c.l)(a.fromBlock)||a.toBlock&&Object(c.l)(a.toBlock))){i.next=36;break}return i.next=35,pf(e,t);case 35:o=i.sent;case 36:return i.abrupt("return",o.getLogs(a));case 37:return i.abrupt("return",of.throwError("unknown method error",h.b.errors.UNKNOWN_ERROR,{method:r,params:n}));case 38:case"end":return i.stop()}}),i)})))}var yf=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Wu(e,t)}(o,e);var t,r,n,i=Xu(o);function o(e,t){var r;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,o),0===e.length&&of.throwArgumentError("missing providers","providers",e);var n=e.map((function(e,t){if(En.isProvider(e)){var r=fA(e)?2e3:750;return Object.freeze({provider:e,weight:1,stallTimeout:r,priority:1})}var n=R(e);null==n.priority&&(n.priority=1),null==n.stallTimeout&&(n.stallTimeout=fA(e)?2e3:750),null==n.weight&&(n.weight=1);var i=n.weight;return(i%1||i>512||i<1)&&of.throwArgumentError("invalid weight; must be integer in [1, 512]","providers[".concat(t,"].weight"),i),Object.freeze(n)})),a=n.reduce((function(e,t){return e+t.weight}),0);null==t?t=a/2:t>a&&of.throwArgumentError("quorum will always fail; larger than total weight","quorum",t);var s=sf(n.map((function(e){return e.provider.network})));return null==s&&(s=new Promise((function(e,t){setTimeout((function(){r.detectNetwork().then(e,t)}),0)}))),_(ef(r=i.call(this,s)),"providerConfigs",Object.freeze(n)),_(ef(r),"quorum",t),r._highestBlockNumber=-1,r}return t=o,(r=[{key:"detectNetwork",value:function(){return nf(this,void 0,void 0,regeneratorRuntime.mark((function e(){var t;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Promise.all(this.providerConfigs.map((function(e){return e.provider.getNetwork()})));case 2:return t=e.sent,e.abrupt("return",sf(t));case 4:case"end":return e.stop()}}),e,this)})))}},{key:"perform",value:function(e,t){return nf(this,void 0,void 0,regeneratorRuntime.mark((function r(){var n,i,o,a,s,A,c,u,f,l,g=this;return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if("sendTransaction"!==e){r.next=13;break}return r.next=3,Promise.all(this.providerConfigs.map((function(e){return e.provider.sendTransaction(t.signedTransaction).then((function(e){return e.hash}),(function(e){return e}))})));case 3:n=r.sent,i=0;case 5:if(!(i<n.length)){r.next=12;break}if("string"!=typeof(o=n[i])){r.next=9;break}return r.abrupt("return",o);case 9:i++,r.next=5;break;case 12:throw n[0];case 13:if(-1!==this._highestBlockNumber||"getBlockNumber"===e){r.next=16;break}return r.next=16,this.getBlockNumber();case 16:a=df(this,e,t),(s=Vu(this.providerConfigs.map(R))).sort((function(e,t){return e.priority-t.priority})),A=this._highestBlockNumber,c=0,u=!0,f=regeneratorRuntime.mark((function r(){var n,i,o,f,h,l,d;return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:for(n=af(),i=s.filter((function(e){return e.runner&&n-e.start<e.stallTimeout})).reduce((function(e,t){return e+t.weight}),0),o=function(){var r=s[c++],n=uf++;r.start=af(),r.staller=ff(r.stallTimeout),r.staller.wait((function(){r.staller=null})),r.runner=If(r,A,e,t).then((function(i){r.done=!0,r.result=i,g.listenerCount("debug")&&g.emit("debug",{action:"request",rid:n,backend:gf(r,af()),request:{method:e,params:N(t)},provider:g})}),(function(i){r.done=!0,r.error=i,g.listenerCount("debug")&&g.emit("debug",{action:"request",rid:n,backend:gf(r,af()),request:{method:e,params:N(t)},provider:g})})),g.listenerCount("debug")&&g.emit("debug",{action:"request",rid:n,backend:gf(r,null),request:{method:e,params:N(t)},provider:g}),i+=r.weight};i<g.quorum&&c<s.length;)o();if(f=[],s.forEach((function(e){!e.done&&e.runner&&(f.push(e.runner),e.staller&&f.push(e.staller.getPromise()))})),!f.length){r.next=9;break}return r.next=9,Promise.race(f);case 9:if(!((h=s.filter((function(e){return e.done&&null==e.error}))).length>=g.quorum)){r.next=19;break}if(void 0===(l=a(h))){r.next=15;break}return s.forEach((function(e){e.staller&&e.staller.cancel(),e.cancelled=!0})),r.abrupt("return",{v:l});case 15:if(u){r.next=18;break}return r.next=18,ff(100).getPromise();case 18:u=!1;case 19:if(d=s.reduce((function(e,t){if(!t.done||null==t.error)return e;var r=t.error.code;return hf.indexOf(r)>=0&&(e[r]||(e[r]={error:t.error,weight:0}),e[r].weight+=t.weight),e}),{}),Object.keys(d).forEach((function(e){var t=d[e];if(!(t.weight<g.quorum)){s.forEach((function(e){e.staller&&e.staller.cancel(),e.cancelled=!0}));var r=t.error,n={};lf.forEach((function(e){null!=r[e]&&(n[e]=r[e])})),of.throwError(r.reason||r.message,e,n)}})),0!==s.filter((function(e){return!e.done})).length){r.next=23;break}return r.abrupt("return","break");case 23:case"end":return r.stop()}}),r)}));case 23:return r.delegateYield(f(),"t0",25);case 25:if("break"!==(l=r.t0)){r.next=28;break}return r.abrupt("break",32);case 28:if("object"!==rf(l)){r.next=30;break}return r.abrupt("return",l.v);case 30:r.next=23;break;case 32:return s.forEach((function(e){e.staller&&e.staller.cancel(),e.cancelled=!0})),r.abrupt("return",of.throwError("failed to meet quorum",h.b.errors.SERVER_ERROR,{method:e,params:t,results:s.map((function(e){return gf(e)})),provider:this}));case 34:case"end":return r.stop()}}),r,this)})))}}])&&Zu(t.prototype,r),n&&Zu(t,n),Object.defineProperty(t,"prototype",{writable:!1}),o}(qA),bf=null;function Ef(e){return(Ef="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function mf(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Cf(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function vf(e,t,r){return t&&Cf(e.prototype,t),r&&Cf(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function Bf(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&wf(e,t)}function wf(e,t){return(wf=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Qf(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=Sf(e);if(t){var i=Sf(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return kf(this,r)}}function kf(e,t){if(t&&("object"===Ef(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return _f(e)}function _f(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function Sf(e){return(Sf=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var Df=new h.b("providers/5.7.2"),Mf="84842078b09946638c03157f83405213",Rf=function(e){Bf(r,e);var t=Qf(r);function r(e,n){var i;mf(this,r);var o=new xf(e,n),a=o.connection;a.password&&Df.throwError("INFURA WebSocket project secrets unsupported",h.b.errors.UNSUPPORTED_OPERATION,{operation:"InfuraProvider.getWebSocketProvider()"});var s=a.url.replace(/^http/i,"ws").replace("/v3/","/ws/v3/");return _(_f(i=t.call(this,s,e)),"apiKey",o.projectId),_(_f(i),"projectId",o.projectId),_(_f(i),"projectSecret",o.projectSecret),i}return vf(r,[{key:"isCommunityResource",value:function(){return this.projectId===Mf}}]),r}(Rc),xf=function(e){Bf(r,e);var t=Qf(r);function r(){return mf(this,r),t.apply(this,arguments)}return vf(r,[{key:"isCommunityResource",value:function(){return this.projectId===Mf}}],[{key:"getWebSocketProvider",value:function(e,t){return new Rf(e,t)}},{key:"getApiKey",value:function(e){var t={apiKey:Mf,projectId:Mf,projectSecret:null};return null==e||("string"==typeof e?t.projectId=e:null!=e.projectSecret?(Df.assertArgument("string"==typeof e.projectId,"projectSecret requires a projectId","projectId",e.projectId),Df.assertArgument("string"==typeof e.projectSecret,"invalid projectSecret","projectSecret","[REDACTED]"),t.projectId=e.projectId,t.projectSecret=e.projectSecret):e.projectId&&(t.projectId=e.projectId),t.apiKey=t.projectId),t}},{key:"getUrl",value:function(e,t){var r=null;switch(e?e.name:"unknown"){case"homestead":r="mainnet.infura.io";break;case"goerli":r="goerli.infura.io";break;case"sepolia":r="sepolia.infura.io";break;case"matic":r="polygon-mainnet.infura.io";break;case"maticmum":r="polygon-mumbai.infura.io";break;case"optimism":r="optimism-mainnet.infura.io";break;case"optimism-goerli":r="optimism-goerli.infura.io";break;case"arbitrum":r="arbitrum-mainnet.infura.io";break;case"arbitrum-goerli":r="arbitrum-goerli.infura.io";break;default:Df.throwError("unsupported network",h.b.errors.INVALID_ARGUMENT,{argument:"network",value:e})}var n={allowGzip:!0,url:"https://"+r+"/v3/"+t.projectId,throttleCallback:function(e,r){return t.projectId===Mf&&lA(),Promise.resolve(!0)}};return null!=t.projectSecret&&(n.user="",n.password=t.projectSecret),n}}]),r}(zc);function Of(e){return(Of="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Nf(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Pf(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function Ff(e,t){return(Ff=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function jf(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=Uf(e);if(t){var i=Uf(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return Tf(this,r)}}function Tf(e,t){if(t&&("object"===Of(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function Uf(e){return(Uf=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var Lf=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Ff(e,t)}(o,e);var t,r,n,i=jf(o);function o(){return Nf(this,o),i.apply(this,arguments)}return t=o,(r=[{key:"send",value:function(e,t){var r=this,n={method:e,params:t,id:this._nextId++,jsonrpc:"2.0"};null==this._pendingBatch&&(this._pendingBatch=[]);var i={request:n,resolve:null,reject:null},o=new Promise((function(e,t){i.resolve=e,i.reject=t}));return this._pendingBatch.push(i),this._pendingBatchAggregator||(this._pendingBatchAggregator=setTimeout((function(){var e=r._pendingBatch;r._pendingBatch=null,r._pendingBatchAggregator=null;var t=e.map((function(e){return e.request}));return r.emit("debug",{action:"requestBatch",request:N(t),provider:r}),nA(r.connection,JSON.stringify(t)).then((function(n){r.emit("debug",{action:"response",request:t,response:n,provider:r}),e.forEach((function(e,t){var r=n[t];if(r.error){var i=new Error(r.error.message);i.code=r.error.code,i.data=r.error.data,e.reject(i)}else e.resolve(r.result)}))}),(function(n){r.emit("debug",{action:"response",error:n,request:t,provider:r}),e.forEach((function(e){e.reject(n)}))}))}),10)),o}}])&&Pf(t.prototype,r),n&&Pf(t,n),Object.defineProperty(t,"prototype",{writable:!1}),o}(Ic);function Hf(e){return(Hf="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Gf(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Yf(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function Kf(e,t){return(Kf=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function qf(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=zf(e);if(t){var i=zf(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return Jf(this,r)}}function Jf(e,t){if(t&&("object"===Hf(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function zf(e){return(zf=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var Vf=new h.b("providers/5.7.2"),Zf=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Kf(e,t)}(o,e);var t,r,n,i=qf(o);function o(){return Gf(this,o),i.apply(this,arguments)}return t=o,n=[{key:"getApiKey",value:function(e){return e&&"string"!=typeof e&&Vf.throwArgumentError("invalid apiKey","apiKey",e),e||"ETHERS_JS_SHARED"}},{key:"getUrl",value:function(e,t){Vf.warn("NodeSmith will be discontinued on 2019-12-20; please migrate to another platform.");var r=null;switch(e.name){case"homestead":r="https://ethereum.api.nodesmith.io/v1/mainnet/jsonrpc";break;case"ropsten":r="https://ethereum.api.nodesmith.io/v1/ropsten/jsonrpc";break;case"rinkeby":r="https://ethereum.api.nodesmith.io/v1/rinkeby/jsonrpc";break;case"goerli":r="https://ethereum.api.nodesmith.io/v1/goerli/jsonrpc";break;case"kovan":r="https://ethereum.api.nodesmith.io/v1/kovan/jsonrpc";break;default:Vf.throwArgumentError("unsupported network","network",arguments[0])}return r+"?apiKey="+t}}],(r=null)&&Yf(t.prototype,r),n&&Yf(t,n),Object.defineProperty(t,"prototype",{writable:!1}),o}(zc);function Wf(e){return(Wf="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Xf(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function $f(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function eh(e,t){return(eh=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function th(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=nh(e);if(t){var i=nh(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return rh(this,r)}}function rh(e,t){if(t&&("object"===Wf(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function nh(e){return(nh=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var ih=new h.b("providers/5.7.2"),oh=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&eh(e,t)}(o,e);var t,r,n,i=th(o);function o(){return Xf(this,o),i.apply(this,arguments)}return t=o,n=[{key:"getApiKey",value:function(e){var t={applicationId:null,loadBalancer:!0,applicationSecretKey:null};return null==e?t.applicationId="62e1ad51b37b8e00394bda3b":"string"==typeof e?t.applicationId=e:null!=e.applicationSecretKey?(t.applicationId=e.applicationId,t.applicationSecretKey=e.applicationSecretKey):e.applicationId?t.applicationId=e.applicationId:ih.throwArgumentError("unsupported PocketProvider apiKey","apiKey",e),t}},{key:"getUrl",value:function(e,t){var r=null;switch(e?e.name:"unknown"){case"goerli":r="eth-goerli.gateway.pokt.network";break;case"homestead":r="eth-mainnet.gateway.pokt.network";break;case"kovan":r="poa-kovan.gateway.pokt.network";break;case"matic":r="poly-mainnet.gateway.pokt.network";break;case"maticmum":r="polygon-mumbai-rpc.gateway.pokt.network";break;case"rinkeby":r="eth-rinkeby.gateway.pokt.network";break;case"ropsten":r="eth-ropsten.gateway.pokt.network";break;default:ih.throwError("unsupported network",h.b.errors.INVALID_ARGUMENT,{argument:"network",value:e})}var n={headers:{},url:"https://".concat(r,"/v1/lb/").concat(t.applicationId)};return null!=t.applicationSecretKey&&(n.user="",n.password=t.applicationSecretKey),n}}],(r=[{key:"isCommunityResource",value:function(){return"62e1ad51b37b8e00394bda3b"===this.applicationId}}])&&$f(t.prototype,r),n&&$f(t,n),Object.defineProperty(t,"prototype",{writable:!1}),o}(zc);function ah(e){return(ah="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function sh(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function Ah(e,t){return(Ah=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function ch(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=hh(e);if(t){var i=hh(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return uh(this,r)}}function uh(e,t){if(t&&("object"===ah(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return fh(e)}function fh(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function hh(e){return(hh=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var lh=new h.b("providers/5.7.2"),gh=1;function dh(e,t){var r="Web3LegacyFetcher";return function(e,n){var i=this,o={method:e,params:n,id:gh++,jsonrpc:"2.0"};return new Promise((function(e,n){i.emit("debug",{action:"request",fetcher:r,request:N(o),provider:i}),t(o,(function(t,a){if(t)return i.emit("debug",{action:"response",fetcher:r,error:t,request:o,provider:i}),n(t);if(i.emit("debug",{action:"response",fetcher:r,request:o,response:a,provider:i}),a.error){var s=new Error(a.error.message);return s.code=a.error.code,s.data=a.error.data,n(s)}e(a.result)}))}))}}var ph=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Ah(e,t)}(o,e);var t,r,n,i=ch(o);function o(e,t){var r;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,o),null==e&&lh.throwArgumentError("missing provider","provider",e);var n=null,a=null,s=null;return"function"==typeof e?(n="unknown:",a=e):(!(n=e.host||e.path||"")&&e.isMetaMask&&(n="metamask"),s=e,e.request?(""===n&&(n="eip-1193:"),a=function(e){return function(t,r){var n=this;null==r&&(r=[]);var i={method:t,params:r};return this.emit("debug",{action:"request",fetcher:"Eip1193Fetcher",request:N(i),provider:this}),e.request(i).then((function(e){return n.emit("debug",{action:"response",fetcher:"Eip1193Fetcher",request:i,response:e,provider:n}),e}),(function(e){throw n.emit("debug",{action:"response",fetcher:"Eip1193Fetcher",request:i,error:e,provider:n}),e}))}}(e)):e.sendAsync?a=dh(0,e.sendAsync.bind(e)):e.send?a=dh(0,e.send.bind(e)):lh.throwArgumentError("unsupported provider","provider",e),n||(n="unknown:")),_(fh(r=i.call(this,n,t)),"jsonRpcFetchFunc",a),_(fh(r),"provider",s),r}return t=o,(r=[{key:"send",value:function(e,t){return this.jsonRpcFetchFunc(e,t)}}])&&sh(t.prototype,r),n&&sh(t,n),Object.defineProperty(t,"prototype",{writable:!1}),o}(Ic),Ih=new h.b("providers/5.7.2");function yh(e,t){if(null==e&&(e="homestead"),"string"==typeof e){var r=e.match(/^(ws|http)s?:/i);if(r)switch(r[1].toLowerCase()){case"http":case"https":return new Ic(e);case"ws":case"wss":return new Rc(e);default:Ih.throwArgumentError("unsupported URL scheme","network",e)}}var n=ds(e);return n&&n._defaultProvider||Ih.throwError("unsupported getDefaultProvider network",h.b.errors.NETWORK_ERROR,{operation:"getDefaultProvider",network:e}),n._defaultProvider({FallbackProvider:yf,AlchemyProvider:Au,AnkrProvider:bu,CloudflareProvider:Mu,EtherscanProvider:zu,InfuraProvider:xf,JsonRpcProvider:Ic,NodesmithProvider:Zf,PocketProvider:oh,Web3Provider:ph,IpcProvider:bf},t)}function bh(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Eh(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function mh(e,t,r){return t&&Eh(e.prototype,t),r&&Eh(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}var Ch=new h.b("abi/5.7.0");function vh(e){var t=[];return function e(r,n){if(Array.isArray(n))for(var i in n){var o=r.slice();o.push(i);try{e(o,n[i])}catch(e){t.push({path:o,error:e})}}}([],e),t}var Bh=function(){function e(t,r,n,i){bh(this,e),this.name=t,this.type=r,this.localName=n,this.dynamic=i}return mh(e,[{key:"_throwError",value:function(e,t){Ch.throwArgumentError(e,this.localName,t)}}]),e}(),wh=function(){function e(t){bh(this,e),_(this,"wordSize",t||32),this._data=[],this._dataLength=0,this._padding=new Uint8Array(t)}return mh(e,[{key:"data",get:function(){return Object(c.c)(this._data)}},{key:"length",get:function(){return this._dataLength}},{key:"_writeData",value:function(e){return this._data.push(e),this._dataLength+=e.length,e.length}},{key:"appendWriter",value:function(e){return this._writeData(Object(c.b)(e._data))}},{key:"writeBytes",value:function(e){var t=Object(c.a)(e),r=t.length%this.wordSize;return r&&(t=Object(c.b)([t,this._padding.slice(r)])),this._writeData(t)}},{key:"_getValue",value:function(e){var t=Object(c.a)(y.from(e));return t.length>this.wordSize&&Ch.throwError("value out-of-bounds",h.b.errors.BUFFER_OVERRUN,{length:this.wordSize,offset:t.length}),t.length%this.wordSize&&(t=Object(c.b)([this._padding.slice(t.length%this.wordSize),t])),t}},{key:"writeValue",value:function(e){return this._writeData(this._getValue(e))}},{key:"writeUpdatableValue",value:function(){var e=this,t=this._data.length;return this._data.push(this._padding),this._dataLength+=this.wordSize,function(r){e._data[t]=e._getValue(r)}}}]),e}(),Qh=function(){function e(t,r,n,i){bh(this,e),_(this,"_data",Object(c.a)(t)),_(this,"wordSize",r||32),_(this,"_coerceFunc",n),_(this,"allowLoose",i),this._offset=0}return mh(e,[{key:"data",get:function(){return Object(c.i)(this._data)}},{key:"consumed",get:function(){return this._offset}},{key:"coerce",value:function(t,r){return this._coerceFunc?this._coerceFunc(t,r):e.coerce(t,r)}},{key:"_peekBytes",value:function(e,t,r){var n=Math.ceil(t/this.wordSize)*this.wordSize;return this._offset+n>this._data.length&&(this.allowLoose&&r&&this._offset+t<=this._data.length?n=t:Ch.throwError("data out-of-bounds",h.b.errors.BUFFER_OVERRUN,{length:this._data.length,offset:this._offset+n})),this._data.slice(this._offset,this._offset+n)}},{key:"subReader",value:function(t){return new e(this._data.slice(this._offset+t),this.wordSize,this._coerceFunc,this.allowLoose)}},{key:"readBytes",value:function(e,t){var r=this._peekBytes(0,e,!!t);return this._offset+=r.length,r.slice(0,e)}},{key:"readValue",value:function(){return y.from(this.readBytes(this.wordSize))}}],[{key:"coerce",value:function(e,t){var r=e.match("^u?int([0-9]+)$");return r&&parseInt(r[1])<=48&&(t=t.toNumber()),t}}]),e}();function kh(e){return(kh="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function _h(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function Sh(e,t){return(Sh=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Dh(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=Rh(e);if(t){var i=Rh(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return Mh(this,r)}}function Mh(e,t){if(t&&("object"===kh(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function Rh(e){return(Rh=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var xh=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Sh(e,t)}(o,e);var t,r,n,i=Dh(o);function o(e){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,o),i.call(this,"address","address",e,!1)}return t=o,(r=[{key:"defaultValue",value:function(){return"0x0000000000000000000000000000000000000000"}},{key:"encode",value:function(e,t){try{t=Ae(t)}catch(e){this._throwError(e.message,t)}return e.writeValue(t)}},{key:"decode",value:function(e){return Ae(Object(c.h)(e.readValue().toHexString(),20))}}])&&_h(t.prototype,r),n&&_h(t,n),Object.defineProperty(t,"prototype",{writable:!1}),o}(Bh);function Oh(e){return(Oh="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Nh(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function Ph(e,t){return(Ph=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Fh(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=Th(e);if(t){var i=Th(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return jh(this,r)}}function jh(e,t){if(t&&("object"===Oh(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function Th(e){return(Th=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var Uh=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Ph(e,t)}(o,e);var t,r,n,i=Fh(o);function o(e){var t;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,o),(t=i.call(this,e.name,e.type,void 0,e.dynamic)).coder=e,t}return t=o,(r=[{key:"defaultValue",value:function(){return this.coder.defaultValue()}},{key:"encode",value:function(e,t){return this.coder.encode(e,t)}},{key:"decode",value:function(e){return this.coder.decode(e)}}])&&Nh(t.prototype,r),n&&Nh(t,n),Object.defineProperty(t,"prototype",{writable:!1}),o}(Bh);function Lh(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function Hh(e,t){return(Hh=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Gh(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=Kh(e);if(t){var i=Kh(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return Yh(this,r)}}function Yh(e,t){if(t&&("object"===qh(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function Kh(e){return(Kh=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function qh(e){return(qh="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var Jh=new h.b("abi/5.7.0");function zh(e,t,r){var n=null;if(Array.isArray(r))n=r;else if(r&&"object"===qh(r)){var i={};n=t.map((function(e){var t=e.localName;return t||Jh.throwError("cannot encode object for signature with missing names",h.b.errors.INVALID_ARGUMENT,{argument:"values",coder:e,value:r}),i[t]&&Jh.throwError("cannot encode object for signature with duplicate names",h.b.errors.INVALID_ARGUMENT,{argument:"values",coder:e,value:r}),i[t]=!0,r[t]}))}else Jh.throwArgumentError("invalid tuple value","tuple",r);t.length!==n.length&&Jh.throwArgumentError("types/value length mismatch","tuple",r);var o=new wh(e.wordSize),a=new wh(e.wordSize),s=[];t.forEach((function(e,t){var r=n[t];if(e.dynamic){var i=a.length;e.encode(a,r);var A=o.writeUpdatableValue();s.push((function(e){A(e+i)}))}else e.encode(o,r)})),s.forEach((function(e){e(o.length)}));var A=e.appendWriter(o);return A+=e.appendWriter(a)}function Vh(e,t){var r=[],n=e.subReader(0);t.forEach((function(t){var i=null;if(t.dynamic){var o=e.readValue(),a=n.subReader(o.toNumber());try{i=t.decode(a)}catch(e){if(e.code===h.b.errors.BUFFER_OVERRUN)throw e;(i=e).baseType=t.name,i.name=t.localName,i.type=t.type}}else try{i=t.decode(e)}catch(e){if(e.code===h.b.errors.BUFFER_OVERRUN)throw e;(i=e).baseType=t.name,i.name=t.localName,i.type=t.type}null!=i&&r.push(i)}));var i=t.reduce((function(e,t){var r=t.localName;return r&&(e[r]||(e[r]=0),e[r]++),e}),{});t.forEach((function(e,t){var n=e.localName;if(n&&1===i[n]&&("length"===n&&(n="_length"),null==r[n])){var o=r[t];o instanceof Error?Object.defineProperty(r,n,{enumerable:!0,get:function(){throw o}}):r[n]=o}}));for(var o=function(e){var t=r[e];t instanceof Error&&Object.defineProperty(r,e,{enumerable:!0,get:function(){throw t}})},a=0;a<r.length;a++)o(a);return Object.freeze(r)}var Zh=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Hh(e,t)}(o,e);var t,r,n,i=Gh(o);function o(e,t,r){var n;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,o);var a=e.type+"["+(t>=0?t:"")+"]",s=-1===t||e.dynamic;return(n=i.call(this,"array",a,r,s)).coder=e,n.length=t,n}return t=o,(r=[{key:"defaultValue",value:function(){for(var e=this.coder.defaultValue(),t=[],r=0;r<this.length;r++)t.push(e);return t}},{key:"encode",value:function(e,t){Array.isArray(t)||this._throwError("expected array value",t);var r=this.length;-1===r&&(r=t.length,e.writeValue(t.length)),Jh.checkArgumentCount(t.length,r,"coder array"+(this.localName?" "+this.localName:""));for(var n=[],i=0;i<t.length;i++)n.push(this.coder);return zh(e,n,t)}},{key:"decode",value:function(e){var t=this.length;-1===t&&32*(t=e.readValue().toNumber())>e._data.length&&Jh.throwError("insufficient data length",h.b.errors.BUFFER_OVERRUN,{length:e._data.length,count:t});for(var r=[],n=0;n<t;n++)r.push(new Uh(this.coder));return e.coerce(this.name,Vh(e,r))}}])&&Lh(t.prototype,r),n&&Lh(t,n),Object.defineProperty(t,"prototype",{writable:!1}),o}(Bh);function Wh(e){return(Wh="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Xh(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function $h(e,t){return($h=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function el(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=rl(e);if(t){var i=rl(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return tl(this,r)}}function tl(e,t){if(t&&("object"===Wh(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function rl(e){return(rl=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var nl=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&$h(e,t)}(o,e);var t,r,n,i=el(o);function o(e){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,o),i.call(this,"bool","bool",e,!1)}return t=o,(r=[{key:"defaultValue",value:function(){return!1}},{key:"encode",value:function(e,t){return e.writeValue(t?1:0)}},{key:"decode",value:function(e){return e.coerce(this.type,!e.readValue().isZero())}}])&&Xh(t.prototype,r),n&&Xh(t,n),Object.defineProperty(t,"prototype",{writable:!1}),o}(Bh);function il(e){return(il="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function ol(){return(ol="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,r){var n=al(e,t);if(n){var i=Object.getOwnPropertyDescriptor(n,t);return i.get?i.get.call(arguments.length<3?e:r):i.value}}).apply(this,arguments)}function al(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=gl(e)););return e}function sl(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Al(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function cl(e,t,r){return t&&Al(e.prototype,t),r&&Al(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function ul(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&fl(e,t)}function fl(e,t){return(fl=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function hl(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=gl(e);if(t){var i=gl(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return ll(this,r)}}function ll(e,t){if(t&&("object"===il(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function gl(e){return(gl=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var dl=function(e){ul(r,e);var t=hl(r);function r(e,n){return sl(this,r),t.call(this,e,e,n,!0)}return cl(r,[{key:"defaultValue",value:function(){return"0x"}},{key:"encode",value:function(e,t){t=Object(c.a)(t);var r=e.writeValue(t.length);return r+=e.writeBytes(t)}},{key:"decode",value:function(e){return e.readBytes(e.readValue().toNumber(),!0)}}]),r}(Bh),pl=function(e){ul(r,e);var t=hl(r);function r(e){return sl(this,r),t.call(this,"bytes",e)}return cl(r,[{key:"decode",value:function(e){return e.coerce(this.name,Object(c.i)(ol(gl(r.prototype),"decode",this).call(this,e)))}}]),r}(dl);function Il(e){return(Il="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function yl(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function bl(e,t){return(bl=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function El(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=Cl(e);if(t){var i=Cl(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return ml(this,r)}}function ml(e,t){if(t&&("object"===Il(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function Cl(e){return(Cl=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var vl=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&bl(e,t)}(o,e);var t,r,n,i=El(o);function o(e,t){var r;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,o);var n="bytes"+String(e);return(r=i.call(this,n,n,t,!1)).size=e,r}return t=o,(r=[{key:"defaultValue",value:function(){return"0x0000000000000000000000000000000000000000000000000000000000000000".substring(0,2+2*this.size)}},{key:"encode",value:function(e,t){var r=Object(c.a)(t);return r.length!==this.size&&this._throwError("incorrect data length",t),e.writeBytes(r)}},{key:"decode",value:function(e){return e.coerce(this.name,Object(c.i)(e.readBytes(this.size)))}}])&&yl(t.prototype,r),n&&yl(t,n),Object.defineProperty(t,"prototype",{writable:!1}),o}(Bh);function Bl(e){return(Bl="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function wl(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function Ql(e,t){return(Ql=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function kl(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=Sl(e);if(t){var i=Sl(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return _l(this,r)}}function _l(e,t){if(t&&("object"===Bl(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function Sl(e){return(Sl=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var Dl=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Ql(e,t)}(o,e);var t,r,n,i=kl(o);function o(e){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,o),i.call(this,"null","",e,!1)}return t=o,(r=[{key:"defaultValue",value:function(){return null}},{key:"encode",value:function(e,t){return null!=t&&this._throwError("not null",t),e.writeBytes([])}},{key:"decode",value:function(e){return e.readBytes(0),e.coerce(this.name,null)}}])&&wl(t.prototype,r),n&&wl(t,n),Object.defineProperty(t,"prototype",{writable:!1}),o}(Bh);function Ml(e){return(Ml="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Rl(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function xl(e,t){return(xl=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Ol(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=Pl(e);if(t){var i=Pl(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return Nl(this,r)}}function Nl(e,t){if(t&&("object"===Ml(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function Pl(e){return(Pl=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var Fl=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&xl(e,t)}(o,e);var t,r,n,i=Ol(o);function o(e,t,r){var n;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,o);var a=(t?"int":"uint")+8*e;return(n=i.call(this,a,a,r,!1)).size=e,n.signed=t,n}return t=o,(r=[{key:"defaultValue",value:function(){return 0}},{key:"encode",value:function(e,t){var r=y.from(t),n=Nt.mask(8*e.wordSize);if(this.signed){var i=n.mask(8*this.size-1);(r.gt(i)||r.lt(i.add(Rt).mul(Dt)))&&this._throwError("value out-of-bounds",t)}else(r.lt(Mt)||r.gt(n.mask(8*this.size)))&&this._throwError("value out-of-bounds",t);return r=r.toTwos(8*this.size).mask(8*this.size),this.signed&&(r=r.fromTwos(8*this.size).toTwos(8*e.wordSize)),e.writeValue(r)}},{key:"decode",value:function(e){var t=e.readValue().mask(8*this.size);return this.signed&&(t=t.fromTwos(8*this.size)),e.coerce(this.name,t)}}])&&Rl(t.prototype,r),n&&Rl(t,n),Object.defineProperty(t,"prototype",{writable:!1}),o}(Bh);function jl(e){return(jl="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Tl(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function Ul(){return(Ul="undefined"!=typeof Reflect&&Reflect.get?Reflect.get:function(e,t,r){var n=Ll(e,t);if(n){var i=Object.getOwnPropertyDescriptor(n,t);return i.get?i.get.call(arguments.length<3?e:r):i.value}}).apply(this,arguments)}function Ll(e,t){for(;!Object.prototype.hasOwnProperty.call(e,t)&&null!==(e=Kl(e)););return e}function Hl(e,t){return(Hl=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Gl(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=Kl(e);if(t){var i=Kl(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return Yl(this,r)}}function Yl(e,t){if(t&&("object"===jl(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function Kl(e){return(Kl=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var ql=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Hl(e,t)}(o,e);var t,r,n,i=Gl(o);function o(e){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,o),i.call(this,"string",e)}return t=o,(r=[{key:"defaultValue",value:function(){return""}},{key:"encode",value:function(e,t){return Ul(Kl(o.prototype),"encode",this).call(this,e,be(t))}},{key:"decode",value:function(e){return ve(Ul(Kl(o.prototype),"decode",this).call(this,e))}}])&&Tl(t.prototype,r),n&&Tl(t,n),Object.defineProperty(t,"prototype",{writable:!1}),o}(dl);function Jl(e){return(Jl="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function zl(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function Vl(e,t){return(Vl=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Zl(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=Xl(e);if(t){var i=Xl(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return Wl(this,r)}}function Wl(e,t){if(t&&("object"===Jl(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function Xl(e){return(Xl=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var $l=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Vl(e,t)}(o,e);var t,r,n,i=Zl(o);function o(e,t){var r;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,o);var n=!1,a=[];e.forEach((function(e){e.dynamic&&(n=!0),a.push(e.type)}));var s="tuple("+a.join(",")+")";return(r=i.call(this,"tuple",s,t,n)).coders=e,r}return t=o,(r=[{key:"defaultValue",value:function(){var e=[];this.coders.forEach((function(t){e.push(t.defaultValue())}));var t=this.coders.reduce((function(e,t){var r=t.localName;return r&&(e[r]||(e[r]=0),e[r]++),e}),{});return this.coders.forEach((function(r,n){var i=r.localName;i&&1===t[i]&&("length"===i&&(i="_length"),null==e[i]&&(e[i]=e[n]))})),Object.freeze(e)}},{key:"encode",value:function(e,t){return zh(e,this.coders,t)}},{key:"decode",value:function(e){return e.coerce(this.name,Vh(e,this.coders))}}])&&zl(t.prototype,r),n&&zl(t,n),Object.defineProperty(t,"prototype",{writable:!1}),o}(Bh);function eg(e){return(eg="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function tg(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&rg(e,t)}function rg(e,t){return(rg=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function ng(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=og(e);if(t){var i=og(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return ig(this,r)}}function ig(e,t){if(t&&("object"===eg(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function og(e){return(og=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function ag(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function sg(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function Ag(e,t,r){return t&&sg(e.prototype,t),r&&sg(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}var cg=new h.b("abi/5.7.0"),ug={},fg={calldata:!0,memory:!0,storage:!0},hg={calldata:!0,memory:!0};function lg(e,t){if("bytes"===e||"string"===e){if(fg[t])return!0}else if("address"===e){if("payable"===t)return!0}else if((e.indexOf("[")>=0||"tuple"===e)&&hg[t])return!0;return(fg[t]||"payable"===t)&&cg.throwArgumentError("invalid modifier","name",t),!1}function gg(e,t){for(var r in t)_(e,r,t[r])}var dg=Object.freeze({sighash:"sighash",minimal:"minimal",full:"full",json:"json"}),pg=new RegExp(/^(.*)\[([0-9]*)\]$/),Ig=function(){function e(t,r){ag(this,e),t!==ug&&cg.throwError("use fromString",h.b.errors.UNSUPPORTED_OPERATION,{operation:"new ParamType()"}),gg(this,r);var n=this.type.match(pg);gg(this,n?{arrayLength:parseInt(n[2]||"-1"),arrayChildren:e.fromObject({type:n[1],components:this.components}),baseType:"array"}:{arrayLength:null,arrayChildren:null,baseType:null!=this.components?"tuple":this.type}),this._isParamType=!0,Object.freeze(this)}return Ag(e,[{key:"format",value:function(e){if(e||(e=dg.sighash),dg[e]||cg.throwArgumentError("invalid format type","format",e),e===dg.json){var t={type:"tuple"===this.baseType?"tuple":this.type,name:this.name||void 0};return"boolean"==typeof this.indexed&&(t.indexed=this.indexed),this.components&&(t.components=this.components.map((function(t){return JSON.parse(t.format(e))}))),JSON.stringify(t)}var r="";return"array"===this.baseType?(r+=this.arrayChildren.format(e),r+="["+(this.arrayLength<0?"":String(this.arrayLength))+"]"):"tuple"===this.baseType?(e!==dg.sighash&&(r+=this.type),r+="("+this.components.map((function(t){return t.format(e)})).join(e===dg.full?", ":",")+")"):r+=this.type,e!==dg.sighash&&(!0===this.indexed&&(r+=" indexed"),e===dg.full&&this.name&&(r+=" "+this.name)),r}}],[{key:"from",value:function(t,r){return"string"==typeof t?e.fromString(t,r):e.fromObject(t)}},{key:"fromObject",value:function(t){return e.isParamType(t)?t:new e(ug,{name:t.name||null,type:_g(t.type),indexed:null==t.indexed?null:!!t.indexed,components:t.components?t.components.map(e.fromObject):null})}},{key:"fromString",value:function(t,r){return function(t){return e.fromObject({name:t.name,type:t.type,indexed:t.indexed,components:t.components})}(function(e,t){var r=e;function n(t){cg.throwArgumentError("unexpected character at position ".concat(t),"param",e)}function i(e){var r={type:"",name:"",parent:e,state:{allowType:!0}};return t&&(r.indexed=!1),r}e=e.replace(/\s/g," ");for(var o={type:"",name:"",state:{allowType:!0}},a=o,s=0;s<e.length;s++){var A=e[s];switch(A){case"(":a.state.allowType&&""===a.type?a.type="tuple":a.state.allowParams||n(s),a.state.allowType=!1,a.type=_g(a.type),a.components=[i(a)],a=a.components[0];break;case")":delete a.state,"indexed"===a.name&&(t||n(s),a.indexed=!0,a.name=""),lg(a.type,a.name)&&(a.name=""),a.type=_g(a.type);var c=a;(a=a.parent)||n(s),delete c.parent,a.state.allowParams=!1,a.state.allowName=!0,a.state.allowArray=!0;break;case",":delete a.state,"indexed"===a.name&&(t||n(s),a.indexed=!0,a.name=""),lg(a.type,a.name)&&(a.name=""),a.type=_g(a.type);var u=i(a.parent);a.parent.components.push(u),delete a.parent,a=u;break;case" ":a.state.allowType&&""!==a.type&&(a.type=_g(a.type),delete a.state.allowType,a.state.allowName=!0,a.state.allowParams=!0),a.state.allowName&&""!==a.name&&("indexed"===a.name?(t||n(s),a.indexed&&n(s),a.indexed=!0,a.name=""):lg(a.type,a.name)?a.name="":a.state.allowName=!1);break;case"[":a.state.allowArray||n(s),a.type+=A,a.state.allowArray=!1,a.state.allowName=!1,a.state.readArray=!0;break;case"]":a.state.readArray||n(s),a.type+=A,a.state.readArray=!1,a.state.allowArray=!0,a.state.allowName=!0;break;default:a.state.allowType?(a.type+=A,a.state.allowParams=!0,a.state.allowArray=!0):a.state.allowName?(a.name+=A,delete a.state.allowArray):a.state.readArray?a.type+=A:n(s)}}return a.parent&&cg.throwArgumentError("unexpected eof","param",e),delete o.state,"indexed"===a.name?(t||n(r.length-7),a.indexed&&n(r.length-7),a.indexed=!0,a.name=""):lg(a.type,a.name)&&(a.name=""),o.type=_g(o.type),o}(t,!!r))}},{key:"isParamType",value:function(e){return!(null==e||!e._isParamType)}}]),e}();function yg(e,t){return function(e){e=e.trim();for(var t=[],r="",n=0,i=0;i<e.length;i++){var o=e[i];","===o&&0===n?(t.push(r),r=""):(r+=o,"("===o?n++:")"===o&&-1===--n&&cg.throwArgumentError("unbalanced parenthesis","value",e))}r&&t.push(r);return t}(e).map((function(e){return Ig.fromString(e,t)}))}var bg=function(){function e(t,r){ag(this,e),t!==ug&&cg.throwError("use a static from method",h.b.errors.UNSUPPORTED_OPERATION,{operation:"new Fragment()"}),gg(this,r),this._isFragment=!0,Object.freeze(this)}return Ag(e,null,[{key:"from",value:function(t){return e.isFragment(t)?t:"string"==typeof t?e.fromString(t):e.fromObject(t)}},{key:"fromObject",value:function(t){if(e.isFragment(t))return t;switch(t.type){case"function":return wg.fromObject(t);case"event":return Eg.fromObject(t);case"constructor":return Bg.fromObject(t);case"error":return kg.fromObject(t);case"fallback":case"receive":return null}return cg.throwArgumentError("invalid fragment object","value",t)}},{key:"fromString",value:function(e){return"event"===(e=(e=(e=e.replace(/\s/g," ")).replace(/\(/g," (").replace(/\)/g,") ").replace(/\s+/g," ")).trim()).split(" ")[0]?Eg.fromString(e.substring(5).trim()):"function"===e.split(" ")[0]?wg.fromString(e.substring(8).trim()):"constructor"===e.split("(")[0].trim()?Bg.fromString(e.trim()):"error"===e.split(" ")[0]?kg.fromString(e.substring(5).trim()):cg.throwArgumentError("unsupported fragment","value",e)}},{key:"isFragment",value:function(e){return!(!e||!e._isFragment)}}]),e}(),Eg=function(e){tg(r,e);var t=ng(r);function r(){return ag(this,r),t.apply(this,arguments)}return Ag(r,[{key:"format",value:function(e){if(e||(e=dg.sighash),dg[e]||cg.throwArgumentError("invalid format type","format",e),e===dg.json)return JSON.stringify({type:"event",anonymous:this.anonymous,name:this.name,inputs:this.inputs.map((function(t){return JSON.parse(t.format(e))}))});var t="";return e!==dg.sighash&&(t+="event "),t+=this.name+"("+this.inputs.map((function(t){return t.format(e)})).join(e===dg.full?", ":",")+") ",e!==dg.sighash&&this.anonymous&&(t+="anonymous "),t.trim()}}],[{key:"from",value:function(e){return"string"==typeof e?r.fromString(e):r.fromObject(e)}},{key:"fromObject",value:function(e){if(r.isEventFragment(e))return e;"event"!==e.type&&cg.throwArgumentError("invalid event object","value",e);var t={name:Dg(e.name),anonymous:e.anonymous,inputs:e.inputs?e.inputs.map(Ig.fromObject):[],type:"event"};return new r(ug,t)}},{key:"fromString",value:function(e){var t=e.match(Mg);t||cg.throwArgumentError("invalid event string","value",e);var n=!1;return t[3].split(" ").forEach((function(e){switch(e.trim()){case"anonymous":n=!0;break;case"":break;default:cg.warn("unknown modifier: "+e)}})),r.fromObject({name:t[1].trim(),anonymous:n,inputs:yg(t[2],!0),type:"event"})}},{key:"isEventFragment",value:function(e){return e&&e._isFragment&&"event"===e.type}}]),r}(bg);function mg(e,t){t.gas=null;var r=e.split("@");return 1!==r.length?(r.length>2&&cg.throwArgumentError("invalid human-readable ABI signature","value",e),r[1].match(/^[0-9]+$/)||cg.throwArgumentError("invalid human-readable ABI signature gas","value",e),t.gas=y.from(r[1]),r[0]):e}function Cg(e,t){t.constant=!1,t.payable=!1,t.stateMutability="nonpayable",e.split(" ").forEach((function(e){switch(e.trim()){case"constant":t.constant=!0;break;case"payable":t.payable=!0,t.stateMutability="payable";break;case"nonpayable":t.payable=!1,t.stateMutability="nonpayable";break;case"pure":t.constant=!0,t.stateMutability="pure";break;case"view":t.constant=!0,t.stateMutability="view";break;case"external":case"public":case"":break;default:console.log("unknown modifier: "+e)}}))}function vg(e){var t={constant:!1,payable:!0,stateMutability:"payable"};return null!=e.stateMutability?(t.stateMutability=e.stateMutability,t.constant="view"===t.stateMutability||"pure"===t.stateMutability,null!=e.constant&&!!e.constant!==t.constant&&cg.throwArgumentError("cannot have constant function with mutability "+t.stateMutability,"value",e),t.payable="payable"===t.stateMutability,null!=e.payable&&!!e.payable!==t.payable&&cg.throwArgumentError("cannot have payable function with mutability "+t.stateMutability,"value",e)):null!=e.payable?(t.payable=!!e.payable,null!=e.constant||t.payable||"constructor"===e.type||cg.throwArgumentError("unable to determine stateMutability","value",e),t.constant=!!e.constant,t.constant?t.stateMutability="view":t.stateMutability=t.payable?"payable":"nonpayable",t.payable&&t.constant&&cg.throwArgumentError("cannot have constant payable function","value",e)):null!=e.constant?(t.constant=!!e.constant,t.payable=!t.constant,t.stateMutability=t.constant?"view":"payable"):"constructor"!==e.type&&cg.throwArgumentError("unable to determine stateMutability","value",e),t}var Bg=function(e){tg(r,e);var t=ng(r);function r(){return ag(this,r),t.apply(this,arguments)}return Ag(r,[{key:"format",value:function(e){if(e||(e=dg.sighash),dg[e]||cg.throwArgumentError("invalid format type","format",e),e===dg.json)return JSON.stringify({type:"constructor",stateMutability:"nonpayable"!==this.stateMutability?this.stateMutability:void 0,payable:this.payable,gas:this.gas?this.gas.toNumber():void 0,inputs:this.inputs.map((function(t){return JSON.parse(t.format(e))}))});e===dg.sighash&&cg.throwError("cannot format a constructor for sighash",h.b.errors.UNSUPPORTED_OPERATION,{operation:"format(sighash)"});var t="constructor("+this.inputs.map((function(t){return t.format(e)})).join(e===dg.full?", ":",")+") ";return this.stateMutability&&"nonpayable"!==this.stateMutability&&(t+=this.stateMutability+" "),t.trim()}}],[{key:"from",value:function(e){return"string"==typeof e?r.fromString(e):r.fromObject(e)}},{key:"fromObject",value:function(e){if(r.isConstructorFragment(e))return e;"constructor"!==e.type&&cg.throwArgumentError("invalid constructor object","value",e);var t=vg(e);t.constant&&cg.throwArgumentError("constructor cannot be constant","value",e);var n={name:null,type:e.type,inputs:e.inputs?e.inputs.map(Ig.fromObject):[],payable:t.payable,stateMutability:t.stateMutability,gas:e.gas?y.from(e.gas):null};return new r(ug,n)}},{key:"fromString",value:function(e){var t={type:"constructor"},n=(e=mg(e,t)).match(Mg);return n&&"constructor"===n[1].trim()||cg.throwArgumentError("invalid constructor string","value",e),t.inputs=yg(n[2].trim(),!1),Cg(n[3].trim(),t),r.fromObject(t)}},{key:"isConstructorFragment",value:function(e){return e&&e._isFragment&&"constructor"===e.type}}]),r}(bg),wg=function(e){tg(r,e);var t=ng(r);function r(){return ag(this,r),t.apply(this,arguments)}return Ag(r,[{key:"format",value:function(e){if(e||(e=dg.sighash),dg[e]||cg.throwArgumentError("invalid format type","format",e),e===dg.json)return JSON.stringify({type:"function",name:this.name,constant:this.constant,stateMutability:"nonpayable"!==this.stateMutability?this.stateMutability:void 0,payable:this.payable,gas:this.gas?this.gas.toNumber():void 0,inputs:this.inputs.map((function(t){return JSON.parse(t.format(e))})),outputs:this.outputs.map((function(t){return JSON.parse(t.format(e))}))});var t="";return e!==dg.sighash&&(t+="function "),t+=this.name+"("+this.inputs.map((function(t){return t.format(e)})).join(e===dg.full?", ":",")+") ",e!==dg.sighash&&(this.stateMutability?"nonpayable"!==this.stateMutability&&(t+=this.stateMutability+" "):this.constant&&(t+="view "),this.outputs&&this.outputs.length&&(t+="returns ("+this.outputs.map((function(t){return t.format(e)})).join(", ")+") "),null!=this.gas&&(t+="@"+this.gas.toString()+" ")),t.trim()}}],[{key:"from",value:function(e){return"string"==typeof e?r.fromString(e):r.fromObject(e)}},{key:"fromObject",value:function(e){if(r.isFunctionFragment(e))return e;"function"!==e.type&&cg.throwArgumentError("invalid function object","value",e);var t=vg(e),n={type:e.type,name:Dg(e.name),constant:t.constant,inputs:e.inputs?e.inputs.map(Ig.fromObject):[],outputs:e.outputs?e.outputs.map(Ig.fromObject):[],payable:t.payable,stateMutability:t.stateMutability,gas:e.gas?y.from(e.gas):null};return new r(ug,n)}},{key:"fromString",value:function(e){var t={type:"function"},n=(e=mg(e,t)).split(" returns ");n.length>2&&cg.throwArgumentError("invalid function string","value",e);var i=n[0].match(Mg);if(i||cg.throwArgumentError("invalid function signature","value",e),t.name=i[1].trim(),t.name&&Dg(t.name),t.inputs=yg(i[2],!1),Cg(i[3].trim(),t),n.length>1){var o=n[1].match(Mg);""==o[1].trim()&&""==o[3].trim()||cg.throwArgumentError("unexpected tokens","value",e),t.outputs=yg(o[2],!1)}else t.outputs=[];return r.fromObject(t)}},{key:"isFunctionFragment",value:function(e){return e&&e._isFragment&&"function"===e.type}}]),r}(Bg);function Qg(e){var t=e.format();return"Error(string)"!==t&&"Panic(uint256)"!==t||cg.throwArgumentError("cannot specify user defined ".concat(t," error"),"fragment",e),e}var kg=function(e){tg(r,e);var t=ng(r);function r(){return ag(this,r),t.apply(this,arguments)}return Ag(r,[{key:"format",value:function(e){if(e||(e=dg.sighash),dg[e]||cg.throwArgumentError("invalid format type","format",e),e===dg.json)return JSON.stringify({type:"error",name:this.name,inputs:this.inputs.map((function(t){return JSON.parse(t.format(e))}))});var t="";return e!==dg.sighash&&(t+="error "),(t+=this.name+"("+this.inputs.map((function(t){return t.format(e)})).join(e===dg.full?", ":",")+") ").trim()}}],[{key:"from",value:function(e){return"string"==typeof e?r.fromString(e):r.fromObject(e)}},{key:"fromObject",value:function(e){if(r.isErrorFragment(e))return e;"error"!==e.type&&cg.throwArgumentError("invalid error object","value",e);var t={type:e.type,name:Dg(e.name),inputs:e.inputs?e.inputs.map(Ig.fromObject):[]};return Qg(new r(ug,t))}},{key:"fromString",value:function(e){var t={type:"error"},n=e.match(Mg);return n||cg.throwArgumentError("invalid error signature","value",e),t.name=n[1].trim(),t.name&&Dg(t.name),t.inputs=yg(n[2],!1),Qg(r.fromObject(t))}},{key:"isErrorFragment",value:function(e){return e&&e._isFragment&&"error"===e.type}}]),r}(bg);function _g(e){return e.match(/^uint($|[^1-9])/)?e="uint256"+e.substring(4):e.match(/^int($|[^1-9])/)&&(e="int256"+e.substring(3)),e}var Sg=new RegExp("^[a-zA-Z$_][a-zA-Z0-9$_]*$");function Dg(e){return e&&e.match(Sg)||cg.throwArgumentError('invalid identifier "'.concat(e,'"'),"value",e),e}var Mg=new RegExp("^([^)(]*)\\((.*)\\)([^)(]*)$");function Rg(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}var xg=new h.b("abi/5.7.0"),Og=new RegExp(/^bytes([0-9]*)$/),Ng=new RegExp(/^(u?int)([0-9]*)$/),Pg=function(){function e(t){!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,e),_(this,"coerceFunc",t||null)}var t,r,n;return t=e,(r=[{key:"_getCoder",value:function(e){var t=this;switch(e.baseType){case"address":return new xh(e.name);case"bool":return new nl(e.name);case"string":return new ql(e.name);case"bytes":return new pl(e.name);case"array":return new Zh(this._getCoder(e.arrayChildren),e.arrayLength,e.name);case"tuple":return new $l((e.components||[]).map((function(e){return t._getCoder(e)})),e.name);case"":return new Dl(e.name)}var r=e.type.match(Ng);if(r){var n=parseInt(r[2]||"256");return(0===n||n>256||n%8!=0)&&xg.throwArgumentError("invalid "+r[1]+" bit length","param",e),new Fl(n/8,"int"===r[1],e.name)}if(r=e.type.match(Og)){var i=parseInt(r[1]);return(0===i||i>32)&&xg.throwArgumentError("invalid bytes length","param",e),new vl(i,e.name)}return xg.throwArgumentError("invalid type","type",e.type)}},{key:"_getWordSize",value:function(){return 32}},{key:"_getReader",value:function(e,t){return new Qh(e,this._getWordSize(),this.coerceFunc,t)}},{key:"_getWriter",value:function(){return new wh(this._getWordSize())}},{key:"getDefaultValue",value:function(e){var t=this,r=e.map((function(e){return t._getCoder(Ig.from(e))}));return new $l(r,"_").defaultValue()}},{key:"encode",value:function(e,t){var r=this;e.length!==t.length&&xg.throwError("types/values length mismatch",h.b.errors.INVALID_ARGUMENT,{count:{types:e.length,values:t.length},value:{types:e,values:t}});var n=e.map((function(e){return r._getCoder(Ig.from(e))})),i=new $l(n,"_"),o=this._getWriter();return i.encode(o,t),o.data}},{key:"decode",value:function(e,t,r){var n=this,i=e.map((function(e){return n._getCoder(Ig.from(e))}));return new $l(i,"_").decode(this._getReader(Object(c.a)(t),r))}}])&&Rg(t.prototype,r),n&&Rg(t,n),Object.defineProperty(t,"prototype",{writable:!1}),e}(),Fg=new Pg;function jg(e){return(jg="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Tg(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function Ug(e,t,r){return t&&Tg(e.prototype,t),r&&Tg(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function Lg(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Hg(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&Gg(e,t)}function Gg(e,t){return(Gg=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function Yg(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var r,n=qg(e);if(t){var i=qg(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return Kg(this,r)}}function Kg(e,t){if(t&&("object"===jg(t)||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e)}function qg(e){return(qg=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var Jg=new h.b("abi/5.7.0"),zg=function(e){Hg(r,e);var t=Yg(r);function r(){return Lg(this,r),t.apply(this,arguments)}return Ug(r)}(P),Vg=function(e){Hg(r,e);var t=Yg(r);function r(){return Lg(this,r),t.apply(this,arguments)}return Ug(r)}(P),Zg=function(e){Hg(r,e);var t=Yg(r);function r(){return Lg(this,r),t.apply(this,arguments)}return Ug(r)}(P),Wg=function(e){Hg(r,e);var t=Yg(r);function r(){return Lg(this,r),t.apply(this,arguments)}return Ug(r,null,[{key:"isIndexed",value:function(e){return!(!e||!e._isIndexed)}}]),r}(P),Xg={"0x08c379a0":{signature:"Error(string)",name:"Error",inputs:["string"],reason:!0},"0x4e487b71":{signature:"Panic(uint256)",name:"Panic",inputs:["uint256"]}};function $g(e,t){var r=new Error("deferred error during ABI decoding triggered accessing ".concat(e));return r.error=t,r}var ed=function(){function e(t){var r=this;Lg(this,e);_(this,"fragments",("string"==typeof t?JSON.parse(t):t).map((function(e){return bg.from(e)})).filter((function(e){return null!=e}))),_(this,"_abiCoder",S(this instanceof e?this.constructor:void 0,"getAbiCoder")()),_(this,"functions",{}),_(this,"errors",{}),_(this,"events",{}),_(this,"structs",{}),this.fragments.forEach((function(e){var t=null;switch(e.type){case"constructor":return r.deploy?void Jg.warn("duplicate definition - constructor"):void _(r,"deploy",e);case"function":t=r.functions;break;case"event":t=r.events;break;case"error":t=r.errors;break;default:return}var n=e.format();t[n]?Jg.warn("duplicate definition - "+n):t[n]=e})),this.deploy||_(this,"deploy",Bg.from({payable:!1,type:"constructor"})),_(this,"_isInterface",!0)}return Ug(e,[{key:"format",value:function(e){e||(e=dg.full),e===dg.sighash&&Jg.throwArgumentError("interface does not support formatting sighash","format",e);var t=this.fragments.map((function(t){return t.format(e)}));return e===dg.json?JSON.stringify(t.map((function(e){return JSON.parse(e)}))):t}},{key:"getFunction",value:function(e){if(Object(c.l)(e)){for(var t in this.functions)if(e===this.getSighash(t))return this.functions[t];Jg.throwArgumentError("no matching function","sighash",e)}if(-1===e.indexOf("(")){var r=e.trim(),n=Object.keys(this.functions).filter((function(e){return e.split("(")[0]===r}));return 0===n.length?Jg.throwArgumentError("no matching function","name",r):n.length>1&&Jg.throwArgumentError("multiple matching functions","name",r),this.functions[n[0]]}var i=this.functions[wg.fromString(e).format()];return i||Jg.throwArgumentError("no matching function","signature",e),i}},{key:"getEvent",value:function(e){if(Object(c.l)(e)){var t=e.toLowerCase();for(var r in this.events)if(t===this.getEventTopic(r))return this.events[r];Jg.throwArgumentError("no matching event","topichash",t)}if(-1===e.indexOf("(")){var n=e.trim(),i=Object.keys(this.events).filter((function(e){return e.split("(")[0]===n}));return 0===i.length?Jg.throwArgumentError("no matching event","name",n):i.length>1&&Jg.throwArgumentError("multiple matching events","name",n),this.events[i[0]]}var o=this.events[Eg.fromString(e).format()];return o||Jg.throwArgumentError("no matching event","signature",e),o}},{key:"getError",value:function(e){if(Object(c.l)(e)){var t=S(this.constructor,"getSighash");for(var r in this.errors){if(e===t(this.errors[r]))return this.errors[r]}Jg.throwArgumentError("no matching error","sighash",e)}if(-1===e.indexOf("(")){var n=e.trim(),i=Object.keys(this.errors).filter((function(e){return e.split("(")[0]===n}));return 0===i.length?Jg.throwArgumentError("no matching error","name",n):i.length>1&&Jg.throwArgumentError("multiple matching errors","name",n),this.errors[i[0]]}var o=this.errors[wg.fromString(e).format()];return o||Jg.throwArgumentError("no matching error","signature",e),o}},{key:"getSighash",value:function(e){if("string"==typeof e)try{e=this.getFunction(e)}catch(t){try{e=this.getError(e)}catch(e){throw t}}return S(this.constructor,"getSighash")(e)}},{key:"getEventTopic",value:function(e){return"string"==typeof e&&(e=this.getEvent(e)),S(this.constructor,"getEventTopic")(e)}},{key:"_decodeParams",value:function(e,t){return this._abiCoder.decode(e,t)}},{key:"_encodeParams",value:function(e,t){return this._abiCoder.encode(e,t)}},{key:"encodeDeploy",value:function(e){return this._encodeParams(this.deploy.inputs,e||[])}},{key:"decodeErrorResult",value:function(e,t){"string"==typeof e&&(e=this.getError(e));var r=Object(c.a)(t);return Object(c.i)(r.slice(0,4))!==this.getSighash(e)&&Jg.throwArgumentError("data signature does not match error ".concat(e.name,"."),"data",Object(c.i)(r)),this._decodeParams(e.inputs,r.slice(4))}},{key:"encodeErrorResult",value:function(e,t){return"string"==typeof e&&(e=this.getError(e)),Object(c.i)(Object(c.b)([this.getSighash(e),this._encodeParams(e.inputs,t||[])]))}},{key:"decodeFunctionData",value:function(e,t){"string"==typeof e&&(e=this.getFunction(e));var r=Object(c.a)(t);return Object(c.i)(r.slice(0,4))!==this.getSighash(e)&&Jg.throwArgumentError("data signature does not match function ".concat(e.name,"."),"data",Object(c.i)(r)),this._decodeParams(e.inputs,r.slice(4))}},{key:"encodeFunctionData",value:function(e,t){return"string"==typeof e&&(e=this.getFunction(e)),Object(c.i)(Object(c.b)([this.getSighash(e),this._encodeParams(e.inputs,t||[])]))}},{key:"decodeFunctionResult",value:function(e,t){"string"==typeof e&&(e=this.getFunction(e));var r=Object(c.a)(t),n=null,i="",o=null,a=null,s=null;switch(r.length%this._abiCoder._getWordSize()){case 0:try{return this._abiCoder.decode(e.outputs,r)}catch(f){}break;case 4:var A=Object(c.i)(r.slice(0,4)),u=Xg[A];if(u)o=this._abiCoder.decode(u.inputs,r.slice(4)),a=u.name,s=u.signature,u.reason&&(n=o[0]),"Error"===a?i="; VM Exception while processing transaction: reverted with reason string ".concat(JSON.stringify(o[0])):"Panic"===a&&(i="; VM Exception while processing transaction: reverted with panic code ".concat(o[0]));else try{var f=this.getError(A);o=this._abiCoder.decode(f.inputs,r.slice(4)),a=f.name,s=f.format()}catch(f){}}return Jg.throwError("call revert exception"+i,h.b.errors.CALL_EXCEPTION,{method:e.format(),data:Object(c.i)(t),errorArgs:o,errorName:a,errorSignature:s,reason:n})}},{key:"encodeFunctionResult",value:function(e,t){return"string"==typeof e&&(e=this.getFunction(e)),Object(c.i)(this._abiCoder.encode(e.outputs,t||[]))}},{key:"encodeFilterTopics",value:function(e,t){var r=this;"string"==typeof e&&(e=this.getEvent(e)),t.length>e.inputs.length&&Jg.throwError("too many arguments for "+e.format(),h.b.errors.UNEXPECTED_ARGUMENT,{argument:"values",value:t});var n=[];e.anonymous||n.push(this.getEventTopic(e));var i=function(e,t){return"string"===e.type?we(t):"bytes"===e.type?q(Object(c.i)(t)):("bool"===e.type&&"boolean"==typeof t&&(t=t?"0x01":"0x00"),e.type.match(/^u?int/)&&(t=y.from(t).toHexString()),"address"===e.type&&r._abiCoder.encode(["address"],[t]),Object(c.h)(Object(c.i)(t),32))};for(t.forEach((function(t,r){var o=e.inputs[r];o.indexed?null==t?n.push(null):"array"===o.baseType||"tuple"===o.baseType?Jg.throwArgumentError("filtering with tuples or arrays not supported","contract."+o.name,t):Array.isArray(t)?n.push(t.map((function(e){return i(o,e)}))):n.push(i(o,t)):null!=t&&Jg.throwArgumentError("cannot filter non-indexed parameters; must be null","contract."+o.name,t)}));n.length&&null===n[n.length-1];)n.pop();return n}},{key:"encodeEventLog",value:function(e,t){var r=this;"string"==typeof e&&(e=this.getEvent(e));var n=[],i=[],o=[];return e.anonymous||n.push(this.getEventTopic(e)),t.length!==e.inputs.length&&Jg.throwArgumentError("event arguments/values mismatch","values",t),e.inputs.forEach((function(e,a){var s=t[a];if(e.indexed)if("string"===e.type)n.push(we(s));else if("bytes"===e.type)n.push(q(s));else{if("tuple"===e.baseType||"array"===e.baseType)throw new Error("not implemented");n.push(r._abiCoder.encode([e.type],[s]))}else i.push(e),o.push(s)})),{data:this._abiCoder.encode(i,o),topics:n}}},{key:"decodeEventLog",value:function(e,t,r){if("string"==typeof e&&(e=this.getEvent(e)),null!=r&&!e.anonymous){var n=this.getEventTopic(e);Object(c.l)(r[0],32)&&r[0].toLowerCase()===n||Jg.throwError("fragment/topic mismatch",h.b.errors.INVALID_ARGUMENT,{argument:"topics[0]",expected:n,value:r[0]}),r=r.slice(1)}var i=[],o=[],a=[];e.inputs.forEach((function(e,t){e.indexed?"string"===e.type||"bytes"===e.type||"tuple"===e.baseType||"array"===e.baseType?(i.push(Ig.fromObject({type:"bytes32",name:e.name})),a.push(!0)):(i.push(e),a.push(!1)):(o.push(e),a.push(!1))}));var s=null!=r?this._abiCoder.decode(i,Object(c.b)(r)):null,A=this._abiCoder.decode(o,t,!0),u=[],f=0,l=0;e.inputs.forEach((function(e,t){if(e.indexed)if(null==s)u[t]=new Wg({_isIndexed:!0,hash:null});else if(a[t])u[t]=new Wg({_isIndexed:!0,hash:s[l++]});else try{u[t]=s[l++]}catch(e){u[t]=e}else try{u[t]=A[f++]}catch(e){u[t]=e}if(e.name&&null==u[e.name]){var r=u[t];r instanceof Error?Object.defineProperty(u,e.name,{enumerable:!0,get:function(){throw $g("property ".concat(JSON.stringify(e.name)),r)}}):u[e.name]=r}}));for(var g=function(e){var t=u[e];t instanceof Error&&Object.defineProperty(u,e,{enumerable:!0,get:function(){throw $g("index ".concat(e),t)}})},d=0;d<u.length;d++)g(d);return Object.freeze(u)}},{key:"parseTransaction",value:function(e){var t=this.getFunction(e.data.substring(0,10).toLowerCase());return t?new Vg({args:this._abiCoder.decode(t.inputs,"0x"+e.data.substring(10)),functionFragment:t,name:t.name,signature:t.format(),sighash:this.getSighash(t),value:y.from(e.value||"0")}):null}},{key:"parseLog",value:function(e){var t=this.getEvent(e.topics[0]);return!t||t.anonymous?null:new zg({eventFragment:t,name:t.name,signature:t.format(),topic:this.getEventTopic(t),args:this.decodeEventLog(t,e.data,e.topics)})}},{key:"parseError",value:function(e){var t=Object(c.i)(e),r=this.getError(t.substring(0,10).toLowerCase());return r?new Zg({args:this._abiCoder.decode(r.inputs,"0x"+t.substring(10)),errorFragment:r,name:r.name,signature:r.format(),sighash:this.getSighash(r)}):null}}],[{key:"getAbiCoder",value:function(){return Fg}},{key:"getAddress",value:function(e){return Ae(e)}},{key:"getSighash",value:function(e){return Object(c.e)(we(e.format()),0,4)}},{key:"getEventTopic",value:function(e){return we(e.format())}},{key:"isInterface",value:function(e){return!(!e||!e._isInterface)}}]),e}(),td=new RegExp("^bytes([0-9]+)$"),rd=new RegExp("^(u?int)([0-9]*)$"),nd=new RegExp("^(.*)\\[([0-9]*)\\]$"),id=new h.b("solidity/5.7.0");function od(e,t){e.length!=t.length&&id.throwArgumentError("wrong number of values; expected ${ types.length }","values",t);var r=[];return e.forEach((function(e,n){r.push(function e(t,r,n){switch(t){case"address":return n?Object(c.p)(r,32):Object(c.a)(r);case"string":return be(r);case"bytes":return Object(c.a)(r);case"bool":return r=r?"0x01":"0x00",n?Object(c.p)(r,32):Object(c.a)(r)}var i=t.match(rd);if(i){var o=parseInt(i[2]||"256");return(i[2]&&String(o)!==i[2]||o%8!=0||0===o||o>256)&&id.throwArgumentError("invalid number type","type",t),n&&(o=256),r=y.from(r).toTwos(o),Object(c.p)(r,o/8)}if(i=t.match(td)){var a=parseInt(i[1]);return(String(a)!==i[1]||0===a||a>32)&&id.throwArgumentError("invalid bytes type","type",t),Object(c.a)(r).byteLength!==a&&id.throwArgumentError("invalid value for ".concat(t),"value",r),n?Object(c.a)((r+"0000000000000000000000000000000000000000000000000000000000000000").substring(0,66)):r}if((i=t.match(nd))&&Array.isArray(r)){var s=i[1];parseInt(i[2]||String(r.length))!=r.length&&id.throwArgumentError("invalid array length for ".concat(t),"value",r);var A=[];return r.forEach((function(t){A.push(e(s,t,!0))})),Object(c.b)(A)}return id.throwArgumentError("invalid type","type",t)}(e,t[n]))})),Object(c.i)(Object(c.b)(r))}function ad(e,t){return q(od(e,t))}function sd(e,t){return _o(od(e,t))}function Ad(e,t){t||(t=function(e){return[parseInt(e,16)]});var r=0,n={};return e.split(",").forEach((function(e){var i=e.split(":");r+=parseInt(i[0],16),n[r]=t(i[1])})),n}function cd(e){var t=0;return e.split(",").map((function(e){var r=e.split("-");return 1===r.length?r[1]="0":""===r[1]&&(r[1]="1"),{l:t+parseInt(r[0],16),h:t=parseInt(r[1],16)}}))}function ud(e,t){for(var r=0,n=0;n<t.length;n++){var i=t[n];if(e>=(r+=i.l)&&e<=r+i.h&&(e-r)%(i.d||1)==0){if(i.e&&-1!==i.e.indexOf(e-r))continue;return i}}return null}var fd=cd("221,13-1b,5f-,40-10,51-f,11-3,3-3,2-2,2-4,8,2,15,2d,28-8,88,48,27-,3-5,11-20,27-,8,28,3-5,12,18,b-a,1c-4,6-16,2-d,2-2,2,1b-4,17-9,8f-,10,f,1f-2,1c-34,33-14e,4,36-,13-,6-2,1a-f,4,9-,3-,17,8,2-2,5-,2,8-,3-,4-8,2-3,3,6-,16-6,2-,7-3,3-,17,8,3,3,3-,2,6-3,3-,4-a,5,2-6,10-b,4,8,2,4,17,8,3,6-,b,4,4-,2-e,2-4,b-10,4,9-,3-,17,8,3-,5-,9-2,3-,4-7,3-3,3,4-3,c-10,3,7-2,4,5-2,3,2,3-2,3-2,4-2,9,4-3,6-2,4,5-8,2-e,d-d,4,9,4,18,b,6-3,8,4,5-6,3-8,3-3,b-11,3,9,4,18,b,6-3,8,4,5-6,3-6,2,3-3,b-11,3,9,4,18,11-3,7-,4,5-8,2-7,3-3,b-11,3,13-2,19,a,2-,8-2,2-3,7,2,9-11,4-b,3b-3,1e-24,3,2-,3,2-,2-5,5,8,4,2,2-,3,e,4-,6,2,7-,b-,3-21,49,23-5,1c-3,9,25,10-,2-2f,23,6,3,8-2,5-5,1b-45,27-9,2a-,2-3,5b-4,45-4,53-5,8,40,2,5-,8,2,5-,28,2,5-,20,2,5-,8,2,5-,8,8,18,20,2,5-,8,28,14-5,1d-22,56-b,277-8,1e-2,52-e,e,8-a,18-8,15-b,e,4,3-b,5e-2,b-15,10,b-5,59-7,2b-555,9d-3,5b-5,17-,7-,27-,7-,9,2,2,2,20-,36,10,f-,7,14-,4,a,54-3,2-6,6-5,9-,1c-10,13-1d,1c-14,3c-,10-6,32-b,240-30,28-18,c-14,a0,115-,3,66-,b-76,5,5-,1d,24,2,5-2,2,8-,35-2,19,f-10,1d-3,311-37f,1b,5a-b,d7-19,d-3,41,57-,68-4,29-3,5f,29-37,2e-2,25-c,2c-2,4e-3,30,78-3,64-,20,19b7-49,51a7-59,48e-2,38-738,2ba5-5b,222f-,3c-94,8-b,6-4,1b,6,2,3,3,6d-20,16e-f,41-,37-7,2e-2,11-f,5-b,18-,b,14,5-3,6,88-,2,bf-2,7-,7-,7-,4-2,8,8-9,8-2ff,20,5-b,1c-b4,27-,27-cbb1,f7-9,28-2,b5-221,56,48,3-,2-,3-,5,d,2,5,3,42,5-,9,8,1d,5,6,2-2,8,153-3,123-3,33-27fd,a6da-5128,21f-5df,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3-fffd,3,2-1d,61-ff7d"),hd="ad,34f,1806,180b,180c,180d,200b,200c,200d,2060,feff".split(",").map((function(e){return parseInt(e,16)})),ld=[{h:25,s:32,l:65},{h:30,s:32,e:[23],l:127},{h:54,s:1,e:[48],l:64,d:2},{h:14,s:1,l:57,d:2},{h:44,s:1,l:17,d:2},{h:10,s:1,e:[2,6,8],l:61,d:2},{h:16,s:1,l:68,d:2},{h:84,s:1,e:[18,24,66],l:19,d:2},{h:26,s:32,e:[17],l:435},{h:22,s:1,l:71,d:2},{h:15,s:80,l:40},{h:31,s:32,l:16},{h:32,s:1,l:80,d:2},{h:52,s:1,l:42,d:2},{h:12,s:1,l:55,d:2},{h:40,s:1,e:[38],l:15,d:2},{h:14,s:1,l:48,d:2},{h:37,s:48,l:49},{h:148,s:1,l:6351,d:2},{h:88,s:1,l:160,d:2},{h:15,s:16,l:704},{h:25,s:26,l:854},{h:25,s:32,l:55915},{h:37,s:40,l:1247},{h:25,s:-119711,l:53248},{h:25,s:-119763,l:52},{h:25,s:-119815,l:52},{h:25,s:-119867,e:[1,4,5,7,8,11,12,17],l:52},{h:25,s:-119919,l:52},{h:24,s:-119971,e:[2,7,8,17],l:52},{h:24,s:-120023,e:[2,7,13,15,16,17],l:52},{h:25,s:-120075,l:52},{h:25,s:-120127,l:52},{h:25,s:-120179,l:52},{h:25,s:-120231,l:52},{h:25,s:-120283,l:52},{h:25,s:-120335,l:52},{h:24,s:-119543,e:[17],l:56},{h:24,s:-119601,e:[17],l:58},{h:24,s:-119659,e:[17],l:58},{h:24,s:-119717,e:[17],l:58},{h:24,s:-119775,e:[17],l:58}],gd=Ad("b5:3bc,c3:ff,7:73,2:253,5:254,3:256,1:257,5:259,1:25b,3:260,1:263,2:269,1:268,5:26f,1:272,2:275,7:280,3:283,5:288,3:28a,1:28b,5:292,3f:195,1:1bf,29:19e,125:3b9,8b:3b2,1:3b8,1:3c5,3:3c6,1:3c0,1a:3ba,1:3c1,1:3c3,2:3b8,1:3b5,1bc9:3b9,1c:1f76,1:1f77,f:1f7a,1:1f7b,d:1f78,1:1f79,1:1f7c,1:1f7d,107:63,5:25b,4:68,1:68,1:68,3:69,1:69,1:6c,3:6e,4:70,1:71,1:72,1:72,1:72,7:7a,2:3c9,2:7a,2:6b,1:e5,1:62,1:63,3:65,1:66,2:6d,b:3b3,1:3c0,6:64,1b574:3b8,1a:3c3,20:3b8,1a:3c3,20:3b8,1a:3c3,20:3b8,1a:3c3,20:3b8,1a:3c3"),dd=Ad("179:1,2:1,2:1,5:1,2:1,a:4f,a:1,8:1,2:1,2:1,3:1,5:1,3:1,4:1,2:1,3:1,4:1,8:2,1:1,2:2,1:1,2:2,27:2,195:26,2:25,1:25,1:25,2:40,2:3f,1:3f,33:1,11:-6,1:-9,1ac7:-3a,6d:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,b:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,c:-8,2:-8,2:-8,2:-8,9:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,1:-8,49:-8,1:-8,1:-4a,1:-4a,d:-56,1:-56,1:-56,1:-56,d:-8,1:-8,f:-8,1:-8,3:-7"),pd=Ad("df:00730073,51:00690307,19:02BC006E,a7:006A030C,18a:002003B9,16:03B903080301,20:03C503080301,1d7:05650582,190f:00680331,1:00740308,1:0077030A,1:0079030A,1:006102BE,b6:03C50313,2:03C503130300,2:03C503130301,2:03C503130342,2a:1F0003B9,1:1F0103B9,1:1F0203B9,1:1F0303B9,1:1F0403B9,1:1F0503B9,1:1F0603B9,1:1F0703B9,1:1F0003B9,1:1F0103B9,1:1F0203B9,1:1F0303B9,1:1F0403B9,1:1F0503B9,1:1F0603B9,1:1F0703B9,1:1F2003B9,1:1F2103B9,1:1F2203B9,1:1F2303B9,1:1F2403B9,1:1F2503B9,1:1F2603B9,1:1F2703B9,1:1F2003B9,1:1F2103B9,1:1F2203B9,1:1F2303B9,1:1F2403B9,1:1F2503B9,1:1F2603B9,1:1F2703B9,1:1F6003B9,1:1F6103B9,1:1F6203B9,1:1F6303B9,1:1F6403B9,1:1F6503B9,1:1F6603B9,1:1F6703B9,1:1F6003B9,1:1F6103B9,1:1F6203B9,1:1F6303B9,1:1F6403B9,1:1F6503B9,1:1F6603B9,1:1F6703B9,3:1F7003B9,1:03B103B9,1:03AC03B9,2:03B10342,1:03B1034203B9,5:03B103B9,6:1F7403B9,1:03B703B9,1:03AE03B9,2:03B70342,1:03B7034203B9,5:03B703B9,6:03B903080300,1:03B903080301,3:03B90342,1:03B903080342,b:03C503080300,1:03C503080301,1:03C10313,2:03C50342,1:03C503080342,b:1F7C03B9,1:03C903B9,1:03CE03B9,2:03C90342,1:03C9034203B9,5:03C903B9,ac:00720073,5b:00B00063,6:00B00066,d:006E006F,a:0073006D,1:00740065006C,1:0074006D,124f:006800700061,2:00610075,2:006F0076,b:00700061,1:006E0061,1:03BC0061,1:006D0061,1:006B0061,1:006B0062,1:006D0062,1:00670062,3:00700066,1:006E0066,1:03BC0066,4:0068007A,1:006B0068007A,1:006D0068007A,1:00670068007A,1:00740068007A,15:00700061,1:006B00700061,1:006D00700061,1:006700700061,8:00700076,1:006E0076,1:03BC0076,1:006D0076,1:006B0076,1:006D0076,1:00700077,1:006E0077,1:03BC0077,1:006D0077,1:006B0077,1:006D0077,1:006B03C9,1:006D03C9,2:00620071,3:00632215006B0067,1:0063006F002E,1:00640062,1:00670079,2:00680070,2:006B006B,1:006B006D,9:00700068,2:00700070006D,1:00700072,2:00730076,1:00770062,c723:00660066,1:00660069,1:0066006C,1:006600660069,1:00660066006C,1:00730074,1:00730074,d:05740576,1:05740565,1:0574056B,1:057E0576,1:0574056D",(function(e){if(e.length%4!=0)throw new Error("bad data");for(var t=[],r=0;r<e.length;r+=4)t.push(parseInt(e.substring(r,r+4),16));return t})),Id=cd("80-20,2a0-,39c,32,f71,18e,7f2-f,19-7,30-4,7-5,f81-b,5,a800-20ff,4d1-1f,110,fa-6,d174-7,2e84-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,ffff-,2,1f-5f,ff7f-20001");function yd(e){if(e.match(/^[a-z0-9-]*$/i)&&e.length<=59)return e.toLowerCase();var t,r=Be(e);t=r.map((function(e){if(hd.indexOf(e)>=0)return[];if(e>=65024&&e<=65039)return[];var t=function(e){var t=ud(e,ld);if(t)return[e+t.s];var r=gd[e];if(r)return r;var n=dd[e];if(n)return[e+n[0]];var i=pd[e];return i||null}(e);return t||[e]})),(r=Be(Ce(r=t.reduce((function(e,t){return t.forEach((function(t){e.push(t)})),e}),[])),le.NFKC)).forEach((function(e){if(ud(e,Id))throw new Error("STRINGPREP_CONTAINS_PROHIBITED")})),r.forEach((function(e){if(ud(e,fd))throw new Error("STRINGPREP_CONTAINS_UNASSIGNED")}));var n=Ce(r);if("-"===n.substring(0,1)||"--"===n.substring(2,4)||"-"===n.substring(n.length-1))throw new Error("invalid hyphen");return n}function bd(e){var t=be(e);if(t.length>31)throw new Error("bytes32 string must be less than 32 bytes");return Object(c.i)(Object(c.b)([t,as]).slice(0,32))}function Ed(e){var t=Object(c.a)(e);if(32!==t.length)throw new Error("invalid bytes32 - not 32 bytes long");if(0!==t[31])throw new Error("invalid bytes32 string - no null terminator");for(var r=31;0===t[r-1];)r--;return ve(t.slice(0,r))}var md=new h.b("units/5.7.0"),Cd=["wei","kwei","mwei","gwei","szabo","finney","ether"];function vd(e){var t=String(e).split(".");(t.length>2||!t[0].match(/^-?[0-9]*$/)||t[1]&&!t[1].match(/^[0-9]*$/)||"."===e||"-."===e)&&md.throwArgumentError("invalid value","value",e);var r=t[0],n="";for("-"===r.substring(0,1)&&(n="-",r=r.substring(1));"0"===r.substring(0,1);)r=r.substring(1);""===r&&(r="0");var i="";for(2===t.length&&(i="."+(t[1]||"0"));i.length>2&&"0"===i[i.length-1];)i=i.substring(0,i.length-1);for(var o=[];r.length;){if(r.length<=3){o.unshift(r);break}var a=r.length-3;o.unshift(r.substring(a)),r=r.substring(0,a)}return n+o.join(",")+i}function Bd(e,t){if("string"==typeof t){var r=Cd.indexOf(t);-1!==r&&(t=3*r)}return Vi(e,null!=t?t:18)}function wd(e,t){if("string"!=typeof e&&md.throwArgumentError("value must be a string","value",e),"string"==typeof t){var r=Cd.indexOf(t);-1!==r&&(t=3*r)}return Zi(e,null!=t?t:18)}function Qd(e){return Bd(e,18)}function kd(e){return wd(e,18)}var _d="ethers/5.7.2",Sd=new h.b(_d);try{var Dd=window;null==Dd._ethers&&(Dd._ethers=A)}catch(e){}},,,function(e,t,r){"use strict";(function(e){r.d(t,"a",(function(){return c}));var n=r(0),i=r(1),o=r(168),a=new i.b(o.a);var s=function(){if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;if(void 0!==e)return e;throw new Error("unable to locate global object")}(),A=s.crypto||s.msCrypto;function c(e){(e<=0||e>1024||e%1||e!=e)&&a.throwArgumentError("invalid length","length",e);var t=new Uint8Array(e);return A.getRandomValues(t),Object(n.a)(t)}A&&A.getRandomValues||(a.warn("WARNING: Missing strong random number source"),A={getRandomValues:function(e){return a.throwError("no secure random source avaialble",i.b.errors.UNSUPPORTED_OPERATION,{operation:"crypto.getRandomValues"})}})}).call(this,r(8))}])}));
|