p:b=e);++r);return r-1}(e,a);return function(e,t,r,n,i,a,o,s,c){var u=c?c(e):e;if(ur){if("identity"===s)return u;"clamp"===s&&(u=r)}if(n===i)return n;if(t===r)return e<=t?n:i;t===-1/0?u=-u:r===1/0?u-=t:u=(u-t)/(r-t);u=a(u),n===-1/0?u=-u:i===1/0?u+=n:u=u*(i-n)+n;return u}(e,a[t],a[t+1],i[t],i[t+1],c,o,s,n.map)}}var q=function(e){Object(o.a)(r,e);var t=Object(s.a)(r);function r(e,n,i,a){var o;return Object(c.a)(this,r),(o=t.call(this)).calc=void 0,o.payload=e instanceof k&&!(e instanceof r)?e.getPayload():Array.isArray(e)?e:[e],o.calc=H(n,i,a),o}return Object(u.a)(r,[{key:"getValue",value:function(){return this.calc.apply(this,Object(n.a)(this.payload.map((function(e){return e.getValue()}))))}},{key:"updateConfig",value:function(e,t,r){this.calc=H(e,t,r)}},{key:"interpolate",value:function(e,t,n){return new r(this,e,t,n)}}]),r}(k);var z=function(e){Object(o.a)(r,e);var t=Object(s.a)(r);function r(e){var n,i;return Object(c.a)(this,r),n=t.call(this),i=Object(a.a)(n),n.animatedStyles=new Set,n.value=void 0,n.startPosition=void 0,n.lastPosition=void 0,n.lastVelocity=void 0,n.startTime=void 0,n.lastTime=void 0,n.done=!1,n.setValue=function(e,t){void 0===t&&(t=!0),i.value=e,t&&i.flush()},n.value=e,n.startPosition=e,n.lastPosition=e,n}return Object(u.a)(r,[{key:"flush",value:function(){0===this.animatedStyles.size&&function e(t,r){"update"in t?r.add(t):t.getChildren().forEach((function(t){return e(t,r)}))}(this,this.animatedStyles),this.animatedStyles.forEach((function(e){return e.update()}))}},{key:"clearStyles",value:function(){this.animatedStyles.clear()}},{key:"getValue",value:function(){return this.value}},{key:"interpolate",value:function(e,t,r){return new q(this,e,t,r)}}]),r}(E),V=function(e){Object(o.a)(r,e);var t=Object(s.a)(r);function r(e){var n;return Object(c.a)(this,r),(n=t.call(this)).payload=e.map((function(e){return new z(e)})),n}return Object(u.a)(r,[{key:"setValue",value:function(e,t){var r=this;void 0===t&&(t=!0),Array.isArray(e)?e.length===this.payload.length&&e.forEach((function(e,n){return r.payload[n].setValue(e,t)})):this.payload.forEach((function(r){return r.setValue(e,t)}))}},{key:"getValue",value:function(){return this.payload.map((function(e){return e.getValue()}))}},{key:"interpolate",value:function(e,t){return new q(this,e,t)}}]),r}(k),W=0,G=function(){function e(){var t=this;Object(c.a)(this,e),this.id=void 0,this.idle=!0,this.hasChanged=!1,this.guid=0,this.local=0,this.props={},this.merged={},this.animations={},this.interpolations={},this.values={},this.configs=[],this.listeners=[],this.queue=[],this.localQueue=void 0,this.getValues=function(){return t.interpolations},this.id=W++}return Object(u.a)(e,[{key:"update",value:function(e){if(!e)return this;var t=x(e),r=t.delay,n=void 0===r?0:r,i=t.to,a=Object(l.a)(t,["delay","to"]);if(b.arr(i)||b.fun(i))this.queue.push(Object(d.a)({},a,{delay:n,to:i}));else if(i){var o={};Object.entries(i).forEach((function(e){var t=e[0],r=e[1],i=Object(d.a)({to:Object(f.a)({},t,r),delay:g(n,t)},a),s=o[i.delay]&&o[i.delay].to;o[i.delay]=Object(d.a)({},o[i.delay],i,{to:Object(d.a)({},s,i.to)})})),this.queue=Object.values(o)}return this.queue=this.queue.sort((function(e,t){return e.delay-t.delay})),this.diff(a),this}},{key:"start",value:function(e){var t,r=this;if(this.queue.length){this.idle=!1,this.localQueue&&this.localQueue.forEach((function(e){var t=e.from,n=void 0===t?{}:t,i=e.to,a=void 0===i?{}:i;b.obj(n)&&(r.merged=Object(d.a)({},n,r.merged)),b.obj(a)&&(r.merged=Object(d.a)({},r.merged,a))}));var n=this.local=++this.guid,i=this.localQueue=this.queue;this.queue=[],i.forEach((function(t,a){var o=t.delay,s=Object(l.a)(t,["delay"]),c=function(t){a===i.length-1&&n===r.guid&&t&&(r.idle=!0,r.props.onRest&&r.props.onRest(r.merged)),e&&e()},u=b.arr(s.to)||b.fun(s.to);o?setTimeout((function(){n===r.guid&&(u?r.runAsync(s,c):r.diff(s).start(c))}),o):u?r.runAsync(s,c):r.diff(s).start(c)}))}else b.fun(e)&&this.listeners.push(e),this.props.onStart&&this.props.onStart(),t=this,F.has(t)||F.add(t),L||(L=!0,T(N||U));return this}},{key:"stop",value:function(e){return this.listeners.forEach((function(t){return t(e)})),this.listeners=[],this}},{key:"pause",value:function(e){var t;return this.stop(!0),e&&(t=this,F.has(t)&&F.delete(t)),this}},{key:"runAsync",value:function(e,t){var r=this,n=this,i=(e.delay,Object(l.a)(e,["delay"])),a=this.local,o=Promise.resolve(void 0);if(b.arr(i.to))for(var s=function(e){var t=e,n=Object(d.a)({},i,x(i.to[t]));b.arr(n.config)&&(n.config=n.config[t]),o=o.then((function(){if(a===r.guid)return new Promise((function(e){return r.diff(n).start(e)}))}))},c=0;c0&&Q(E),b&&b(c,t,r))},onStart:v&&function(){return v(c,t)},onFrame:p&&function(e){return p(c,t,e)},delay:a,reset:u&&"enter"===t});l.update(h),E.current.paused||l.start()})),Object(h.useEffect)((function(){return E.current.mounted=_.current=!0,function(){E.current.mounted=_.current=!1,Array.from(E.current.instances).map((function(e){return e[1].destroy()})),E.current.instances.clear()}}),[]),E.current.transitions.map((function(e){var t=e.item,r=e.slot,n=e.key;return{item:t,key:n,state:r,props:E.current.instances.get(n).getValues()}}))}function Q(e,t){var r,n=e.current.deleted,a=Object(i.a)(n);try{var o=function(){var n=r.value.key,i=function(e){return e.key!==n};(b.und(t)||t===n)&&(e.current.instances.delete(n),e.current.transitions=e.current.transitions.filter(i),e.current.deleted=e.current.deleted.filter(i))};for(a.s();!(r=a.n()).done;)o()}catch(s){a.e(s)}finally{a.f()}e.current.forceUpdate()}var ee=function(e){Object(o.a)(r,e);var t=Object(s.a)(r);function r(e){var n;return Object(c.a)(this,r),void 0===e&&(e={}),n=t.call(this),!e.transform||e.transform instanceof E||(e=w.transform(e)),n.payload=e,n}return r}(A),te={transparent:0,aliceblue:4042850303,antiquewhite:4209760255,aqua:16777215,aquamarine:2147472639,azure:4043309055,beige:4126530815,bisque:4293182719,black:255,blanchedalmond:4293643775,blue:65535,blueviolet:2318131967,brown:2771004159,burlywood:3736635391,burntsienna:3934150143,cadetblue:1604231423,chartreuse:2147418367,chocolate:3530104575,coral:4286533887,cornflowerblue:1687547391,cornsilk:4294499583,crimson:3692313855,cyan:16777215,darkblue:35839,darkcyan:9145343,darkgoldenrod:3095792639,darkgray:2846468607,darkgreen:6553855,darkgrey:2846468607,darkkhaki:3182914559,darkmagenta:2332068863,darkolivegreen:1433087999,darkorange:4287365375,darkorchid:2570243327,darkred:2332033279,darksalmon:3918953215,darkseagreen:2411499519,darkslateblue:1211993087,darkslategray:793726975,darkslategrey:793726975,darkturquoise:13554175,darkviolet:2483082239,deeppink:4279538687,deepskyblue:12582911,dimgray:1768516095,dimgrey:1768516095,dodgerblue:512819199,firebrick:2988581631,floralwhite:4294635775,forestgreen:579543807,fuchsia:4278255615,gainsboro:3705462015,ghostwhite:4177068031,gold:4292280575,goldenrod:3668254975,gray:2155905279,green:8388863,greenyellow:2919182335,grey:2155905279,honeydew:4043305215,hotpink:4285117695,indianred:3445382399,indigo:1258324735,ivory:4294963455,khaki:4041641215,lavender:3873897215,lavenderblush:4293981695,lawngreen:2096890111,lemonchiffon:4294626815,lightblue:2916673279,lightcoral:4034953471,lightcyan:3774873599,lightgoldenrodyellow:4210742015,lightgray:3553874943,lightgreen:2431553791,lightgrey:3553874943,lightpink:4290167295,lightsalmon:4288707327,lightseagreen:548580095,lightskyblue:2278488831,lightslategray:2005441023,lightslategrey:2005441023,lightsteelblue:2965692159,lightyellow:4294959359,lime:16711935,limegreen:852308735,linen:4210091775,magenta:4278255615,maroon:2147483903,mediumaquamarine:1724754687,mediumblue:52735,mediumorchid:3126187007,mediumpurple:2473647103,mediumseagreen:1018393087,mediumslateblue:2070474495,mediumspringgreen:16423679,mediumturquoise:1221709055,mediumvioletred:3340076543,midnightblue:421097727,mintcream:4127193855,mistyrose:4293190143,moccasin:4293178879,navajowhite:4292783615,navy:33023,oldlace:4260751103,olive:2155872511,olivedrab:1804477439,orange:4289003775,orangered:4282712319,orchid:3664828159,palegoldenrod:4008225535,palegreen:2566625535,paleturquoise:2951671551,palevioletred:3681588223,papayawhip:4293907967,peachpuff:4292524543,peru:3448061951,pink:4290825215,plum:3718307327,powderblue:2967529215,purple:2147516671,rebeccapurple:1714657791,red:4278190335,rosybrown:3163525119,royalblue:1097458175,saddlebrown:2336560127,salmon:4202722047,sandybrown:4104413439,seagreen:780883967,seashell:4294307583,sienna:2689740287,silver:3233857791,skyblue:2278484991,slateblue:1784335871,slategray:1887473919,slategrey:1887473919,snow:4294638335,springgreen:16744447,steelblue:1182971135,tan:3535047935,teal:8421631,thistle:3636451583,tomato:4284696575,turquoise:1088475391,violet:4001558271,wheat:4125012991,white:4294967295,whitesmoke:4126537215,yellow:4294902015,yellowgreen:2597139199},re="[-+]?\\d*\\.?\\d+";function ne(){for(var e=arguments.length,t=new Array(e),r=0;r1&&(r-=1),r<1/6?e+6*(t-e)*r:r<.5?t:r<2/3?e+(t-e)*(2/3-r)*6:e}function he(e,t,r){var n=r<.5?r*(1+t):r+t-r*t,i=2*r-n,a=le(i,n,e+1/3),o=le(i,n,e),s=le(i,n,e-1/3);return Math.round(255*a)<<24|Math.round(255*o)<<16|Math.round(255*s)<<8}function pe(e){var t=parseInt(e,10);return t<0?0:t>255?255:t}function be(e){return(parseFloat(e)%360+360)%360/360}function me(e){var t=parseFloat(e);return t<0?0:t>1?255:Math.round(255*t)}function ve(e){var t=parseFloat(e);return t<0?0:t>100?1:t/100}function ye(e){var t=function(e){var t;return"number"===typeof e?e>>>0===e&&e>=0&&e<=4294967295?e:null:(t=fe.exec(e))?parseInt(t[1]+"ff",16)>>>0:te.hasOwnProperty(e)?te[e]:(t=ie.exec(e))?(pe(t[1])<<24|pe(t[2])<<16|pe(t[3])<<8|255)>>>0:(t=ae.exec(e))?(pe(t[1])<<24|pe(t[2])<<16|pe(t[3])<<8|me(t[4]))>>>0:(t=ce.exec(e))?parseInt(t[1]+t[1]+t[2]+t[2]+t[3]+t[3]+"ff",16)>>>0:(t=de.exec(e))?parseInt(t[1],16)>>>0:(t=ue.exec(e))?parseInt(t[1]+t[1]+t[2]+t[2]+t[3]+t[3]+t[4]+t[4],16)>>>0:(t=oe.exec(e))?(255|he(be(t[1]),ve(t[2]),ve(t[3])))>>>0:(t=se.exec(e))?(he(be(t[1]),ve(t[2]),ve(t[3]))|me(t[4]))>>>0:null}(e);if(null===t)return e;var r=(16711680&(t=t||0))>>>16,n=(65280&t)>>>8,i=(255&t)/255;return"rgba(".concat((4278190080&t)>>>24,", ").concat(r,", ").concat(n,", ").concat(i,")")}var ge=/[+\-]?(?:0|[1-9]\d*)(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,xe=/(#(?:[0-9a-f]{2}){2,4}|(#[0-9a-f]{3})|(rgb|hsl)a?\((-?\d+%?[,\s]+){2,3}\s*[\d\.]+%?\))/gi,we=new RegExp("(".concat(Object.keys(te).join("|"),")"),"g"),_e={animationIterationCount:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},Ee=["Webkit","Ms","Moz","O"];function ke(e,t,r){return null==t||"boolean"===typeof t||""===t?"":r||"number"!==typeof t||0===t||_e.hasOwnProperty(e)&&_e[e]?(""+t).trim():t+"px"}_e=Object.keys(_e).reduce((function(e,t){return Ee.forEach((function(r){return e[function(e,t){return e+t.charAt(0).toUpperCase()+t.substring(1)}(r,t)]=e[t]})),e}),_e);var Ae={};B((function(e){return new ee(e)})),C("div"),P((function(e){var t=e.output.map((function(e){return e.replace(xe,ye)})).map((function(e){return e.replace(we,ye)})),r=t[0].match(ge).map((function(){return[]}));t.forEach((function(e){e.match(ge).forEach((function(e,t){return r[t].push(+e)}))}));var n=t[0].match(ge).map((function(t,n){return H(Object(d.a)({},e,{output:r[n]}))}));return function(e){var r=0;return t[0].replace(ge,(function(){return n[r++](e)})).replace(/rgba\(([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+), ([0-9\.-]+)\)/gi,(function(e,t,r,n,i){return"rgba(".concat(Math.round(t),", ").concat(Math.round(r),", ").concat(Math.round(n),", ").concat(i,")")}))}})),M(te),S((function(e,t){if(!e.nodeType||void 0===e.setAttribute)return!1;var r=t.style,n=t.children,i=t.scrollTop,a=t.scrollLeft,o=Object(l.a)(t,["style","children","scrollTop","scrollLeft"]),s="filter"===e.nodeName||e.parentNode&&"filter"===e.parentNode.nodeName;for(var c in void 0!==i&&(e.scrollTop=i),void 0!==a&&(e.scrollLeft=a),void 0!==n&&(e.textContent=n),r)if(r.hasOwnProperty(c)){var u=0===c.indexOf("--"),f=ke(c,r[c],u);"float"===c&&(c="cssFloat"),u?e.style.setProperty(c,f):e.style[c]=f}for(var d in o){var h=s?d:Ae[d]||(Ae[d]=d.replace(/([A-Z])/g,(function(e){return"-"+e.toLowerCase()})));"undefined"!==typeof e.getAttribute(h)&&e.setAttribute(h,o[d])}}),(function(e){return e}));var Se,Me,Oe=(Se=function(e){return Object(h.forwardRef)((function(t,r){var n=m(),i=Object(h.useRef)(!0),a=Object(h.useRef)(null),o=Object(h.useRef)(null),s=Object(h.useCallback)((function(e){var t=a.current;a.current=new D(e,(function(){var e=!1;o.current&&(e=w.fn(o.current,a.current.getAnimatedValue())),o.current&&!1!==e||n()})),t&&t.detach()}),[]);Object(h.useEffect)((function(){return function(){i.current=!1,a.current&&a.current.detach()}}),[]),Object(h.useImperativeHandle)(r,(function(){return j(o,i,n)})),s(t);var c,u=a.current.getValue(),f=(u.scrollTop,u.scrollLeft,Object(l.a)(u,["scrollTop","scrollLeft"])),v=(c=e,!b.fun(c)||c.prototype instanceof p.a.Component?function(e){return o.current=function(e,t){return t&&(b.fun(t)?t(e):b.obj(t)&&(t.current=e)),e}(e,r)}:void 0);return p.a.createElement(e,Object(d.a)({},f,{ref:v}))}))},void 0===(Me=!1)&&(Me=!0),function(e){return(b.arr(e)?e:Object.keys(e)).reduce((function(e,t){var r=Me?t[0].toLowerCase()+t.substring(1):t;return e[r]=Se(r),e}),Se)})(["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","big","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rp","rt","ruby","s","samp","script","section","select","small","source","span","strong","style","sub","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr","circle","clipPath","defs","ellipse","foreignObject","g","image","line","linearGradient","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","svg","text","tspan"])},function(e,t,r){"use strict";r.d(t,"a",(function(){return s}));var n=Object.prototype,i=n.toString,a=n.hasOwnProperty,o=new Map;function s(e,t){try{return function e(t,r){if(t===r)return!0;var n=i.call(t),o=i.call(r);if(n!==o)return!1;switch(n){case"[object Array]":if(t.length!==r.length)return!1;case"[object Object]":if(c(t,r))return!0;var s=Object.keys(t),u=Object.keys(r),f=s.length;if(f!==u.length)return!1;for(var d=0;d1&&r[1]||""},enumerable:!0,configurable:!0}),Object.defineProperty(e,"env",{get:function(){return i.default},enumerable:!0,configurable:!0}),e.environments=function(){return{qa2:{api:"https://api-qa.arkane.network/api",connect:"https://connect-qa2.arkane.network",login:"https://login-qa.arkane.network/auth"}}},Object.defineProperty(e,"urls",{get:function(){var t="";switch(e.environment){case"local":t="tst1";break;case"prod":case"production":t="";break;default:t=e.environment}var r=this.environments()[t];return r?{api:r.api,connect:"local"===e.environment||"local"===e.connectEnvironment?"http://127.0.0.1:8181":r.connect,login:r.login}:{api:"local"===e.environment?"http://127.0.0.1:8581/api":"https://api"+(t?"-"+t:"")+".arkane.network/api",connect:"local"===e.environment||"local"===e.connectEnvironment?"http://127.0.0.1:8181":"https://connect"+(t?"-"+t:"")+".arkane.network",login:"https://login"+(t?"-"+t:"")+".arkane.network/auth"}},enumerable:!0,configurable:!0}),e.removeNulls=function(t){return Object.keys(t).filter((function(e){return null!==t[e]&&void 0!==t[e]})).reduce((function(r,n){var i,a;return"object"!==typeof t[n]||Array.isArray(t[n])?Object.assign(r,((a={})[n]=t[n],a)):Object.assign(r,((i={})[n]=e.removeNulls(t[n]),i))}),{})},e.removeNullsAndEmpty=function(t){return Object.keys(t).filter((function(e){return null!==t[e]&&void 0!==t[e]&&""!==t[e]})).reduce((function(r,n){var i,a;return"object"!==typeof t[n]||Array.isArray(t[n])?Object.assign(r,((a={})[n]=t[n],a)):Object.assign(r,((i={})[n]=e.removeNullsAndEmpty(t[n]),i))}),{})},e.messages=function(){return{hasValidOrigin:function(t){return t.origin===e.urls.connect},hasType:function(e){return e.data&&e.data.type&&""!==e.data.type},isOfType:function(t,r){return e.messages().hasType(t)&&t.data.type===r.toString()},hasCorrectCorrelationID:function(e,t){return e.data&&e.data.correlationID===t}}},e.formatNumber=function(e,t,r){return void 0===t&&(t=2),void 0===r&&(r=t),new Intl.NumberFormat("en-US",{minimumFractionDigits:t,maximumFractionDigits:r}).format(e)},e.rawValue=function(){return{toTokenValue:function(e,t){return e/Math.pow(10,t)},toGwei:function(e){return e/Math.pow(10,9)}}},e.gwei=function(){return{toRawValue:function(e){return e*Math.pow(10,9)}}},e.openExternalUrl=function(e,t){if(void 0===t&&(t=!0),t){var r=window.open("","_blank");return r&&(r.opener=null,r.location.assign(e)),r}return window.location.href=e,window},e.zeroIfUndefined=function(e){return e||0},e.defaultRedirectUriIfNotPresent=function(e){return void 0===e&&(e={}),e.redirectUri||(e.redirectUri=window.location.href),e},e.http=function(){return{postInForm:function(t,r,i,a){a=e.defaultRedirectUriIfNotPresent(a);var o=document.createElement("form");o.action=e.http().buildUrl(t,a),o.method="POST";var s=document.createElement("input");s.type="hidden",s.name="bearerToken",s.value=i(),o.appendChild(s);var c=document.createElement("input");c.type="hidden",c.name="data",c.value=JSON.stringify(n.__assign({},r)),o.appendChild(c),document.body.appendChild(o),o.submit()},buildUrl:function(t,r){if(r&&(r.redirectUri||r.correlationID)){var n={};return r.redirectUri&&(n.redirectUri=r.redirectUri),r.correlationID&&(n.cid=r.correlationID),e.http().addRequestParams(t,n)}return t},addRequestParams:function(e,t){if(e&&t){var r=a.stringify(t);return e&&e.indexOf("?")>0?e+"&"+r:e+"?"+r}return e}}},e.rawEnvironmentHolder="",e.environment="",e.connectEnvironment="",e}();t.default=o},function(e,t,r){var n=r(259),i=r(811),a=r(1783),o=r(100),s=r(25),c=function e(t,r){var n=[];return r.forEach((function(r){if("object"===typeof r.components){if("tuple"!==r.type.substring(0,5))throw new Error("components found but type is not tuple; report on GitHub");var i="",a=r.type.indexOf("[");a>=0&&(i=r.type.substring(a));var o=e(t,r.components);Array.isArray(o)&&t?n.push("tuple("+o.join(",")+")"+i):t?n.push("("+o+")"):n.push("("+o.join(",")+")"+i)}else n.push(r.type)})),n},u=function(e){if(!i.isHexStrict(e))throw new Error("The parameter must be a valid HEX string.");var t="",r=0,n=e.length;for("0x"===e.substring(0,2)&&(r=2);r7?r+=e[n].toUpperCase():r+=e[n];return r},toHex:i.toHex,toBN:i.toBN,bytesToHex:i.bytesToHex,hexToBytes:i.hexToBytes,hexToNumberString:i.hexToNumberString,hexToNumber:i.hexToNumber,toDecimal:i.hexToNumber,numberToHex:i.numberToHex,fromDecimal:i.numberToHex,hexToUtf8:i.hexToUtf8,hexToString:i.hexToUtf8,toUtf8:i.hexToUtf8,stripHexPrefix:i.stripHexPrefix,utf8ToHex:i.utf8ToHex,stringToHex:i.utf8ToHex,fromUtf8:i.utf8ToHex,hexToAscii:u,toAscii:u,asciiToHex:f,fromAscii:f,unitMap:n.unitMap,toWei:function(e,t){if(t=d(t),!i.isBN(e)&&"string"!==typeof e)throw new Error("Please pass numbers as strings or BN objects to avoid precision errors.");return i.isBN(e)?n.toWei(e,t):n.toWei(e,t).toString(10)},fromWei:function(e,t){if(t=d(t),!i.isBN(e)&&"string"!==typeof e)throw new Error("Please pass numbers as strings or BN objects to avoid precision errors.");return i.isBN(e)?n.fromWei(e,t):n.fromWei(e,t).toString(10)},padLeft:i.leftPad,leftPad:i.leftPad,padRight:i.rightPad,rightPad:i.rightPad,toTwosComplement:i.toTwosComplement,isBloom:i.isBloom,isUserEthereumAddressInBloom:i.isUserEthereumAddressInBloom,isContractAddressInBloom:i.isContractAddressInBloom,isTopic:i.isTopic,isTopicInBloom:i.isTopicInBloom,isInBloom:i.isInBloom,compareBlockNumbers:function(e,t){if(e==t)return 0;if("genesis"!=e&&"earliest"!=e&&0!=e||"genesis"!=t&&"earliest"!=t&&0!=t){if("genesis"==e||"earliest"==e)return-1;if("genesis"==t||"earliest"==t)return 1;if("latest"==e)return"pending"==t?-1:1;if("latest"===t)return"pending"==e?1:-1;if("pending"==e)return 1;if("pending"==t)return-1;var r=new s(e),n=new s(t);return r.lt(n)?-1:r.eq(n)?0:1}return 0},toNumber:i.toNumber}},function(e,t,r){"use strict";r.r(t);var n=r(71);r.d(t,"ConstructorFragment",(function(){return n.a})),r.d(t,"ErrorFragment",(function(){return n.b})),r.d(t,"EventFragment",(function(){return n.c})),r.d(t,"Fragment",(function(){return n.e})),r.d(t,"FunctionFragment",(function(){return n.f})),r.d(t,"ParamType",(function(){return n.g})),r.d(t,"FormatTypes",(function(){return n.d}));var i=r(315);r.d(t,"AbiCoder",(function(){return i.a})),r.d(t,"defaultAbiCoder",(function(){return i.b}));var a=r(291);r.d(t,"Interface",(function(){return a.b})),r.d(t,"Indexed",(function(){return a.a}));var o=r(65);r.d(t,"checkResultErrors",(function(){return o.d})),r.d(t,"LogDescription",(function(){return a.c})),r.d(t,"TransactionDescription",(function(){return a.d}))},function(e,t,r){"use strict";r.r(t);var n=r(167);r.d(t,"computeHmac",(function(){return n.a})),r.d(t,"ripemd160",(function(){return n.b})),r.d(t,"sha256",(function(){return n.c})),r.d(t,"sha512",(function(){return n.d}));var i=r(388);r.d(t,"SupportedAlgorithm",(function(){return i.a}))},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=new Uint8Array(0);t.coerce=function(e){if(e instanceof Uint8Array&&"Uint8Array"===e.constructor.name)return e;if(e instanceof ArrayBuffer)return new Uint8Array(e);if(ArrayBuffer.isView(e))return new Uint8Array(e.buffer,e.byteOffset,e.byteLength);throw new Error("Unknown type, must be binary type")},t.empty=n,t.equals=function(e,t){if(e===t)return!0;if(e.byteLength!==t.byteLength)return!1;for(var r=0;r=0&&(t.throttleRetry=!0),t}return e.result}function W(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 G(e){if("pending"===e)throw new Error("pending not supported");return"latest"===e?e:parseInt(e.substring(2),16)}function K(e,t,r){if("call"===e&&t.code===g.Logger.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(L.isHexString)(i))return i;q.throwError("missing revert data in call exception",g.Logger.errors.CALL_EXCEPTION,{error:t,data:"0x"})}}var a=t.message;throw t.code===g.Logger.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/)&&q.throwError("insufficient funds for intrinsic transaction cost",g.Logger.errors.INSUFFICIENT_FUNDS,{error:t,method:e,transaction:r}),a.match(/same hash was already imported|transaction nonce is too low|nonce too low/)&&q.throwError("nonce has already been used",g.Logger.errors.NONCE_EXPIRED,{error:t,method:e,transaction:r}),a.match(/another transaction with same nonce/)&&q.throwError("replacement fee too low",g.Logger.errors.REPLACEMENT_UNDERPRICED,{error:t,method:e,transaction:r}),a.match(/execution failed due to an exception|execution reverted/)&&q.throwError("cannot estimate gas; transaction may fail or may require manual gas limit",g.Logger.errors.UNPREDICTABLE_GAS_LIMIT,{error:t,method:e,transaction:r}),t}var Z=function(e){Object(u.a)(r,e);var t=Object(f.a)(r);function r(e,n){var i;return Object(o.a)(this,r),q.checkNew(this instanceof r?this.constructor:void 0,r),i=t.call(this,e),Object(d.defineReadOnly)(Object(c.a)(i),"baseUrl",i.getBaseUrl()),Object(d.defineReadOnly)(Object(c.a)(i),"apiKey",n||"9D13ZE7XSBTJ94N9BNJ2MA33VMAY2YPIRB"),i}return Object(s.a)(r,[{key:"getBaseUrl",value:function(){switch(this.network?this.network.name:"invalid"){case"homestead":return"https://api.etherscan.io";case"ropsten":return"https://api-ropsten.etherscan.io";case"rinkeby":return"https://api-rinkeby.etherscan.io";case"kovan":return"https://api-kovan.etherscan.io";case"goerli":return"https://api-goerli.etherscan.io"}return q.throwArgumentError("unsupported network","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 H(this,void 0,void 0,p.a.mark((function n(){var i,a,o,s,c,u,f=this;return p.a.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return i=r?this.getPostUrl():this.getUrl(e,t),a=r?this.getPostData(e,t):null,o="proxy"===e?W:V,this.emit("debug",{action:"request",request:i,provider:this}),s={url:i,throttleSlotInterval:1e3,throttleCallback:function(e,t){return f.isCommunityResource()&&Object(l.d)(),Promise.resolve(!0)}},c=null,a&&(s.headers={"content-type":"application/x-www-form-urlencoded; charset=UTF-8"},c=Object.keys(a).map((function(e){return"".concat(e,"=").concat(a[e])})).join("&")),n.next=9,Object(U.fetchJson)(s,c,o||W);case 9:return u=n.sent,this.emit("debug",{action:"response",request:i,response:Object(d.deepCopy)(u),provider:this}),n.abrupt("return",u);case 12:case"end":return n.stop()}}),n,this)})))}},{key:"detectNetwork",value:function(){return H(this,void 0,void 0,p.a.mark((function e(){return p.a.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 n=this,i=Object.create(null,{perform:{get:function(){return Object(b.a)(Object(m.a)(r.prototype),"perform",n)}}});return H(this,void 0,void 0,p.a.mark((function r(){var n,a,o,s,c,u,f,d,l;return p.a.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 K("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(n=z(t.transaction)).module="proxy",n.action="eth_call",r.prev=20,r.next=23,this.fetch("proxy",n,!0);case 23:return r.abrupt("return",r.sent);case 26:return r.prev=26,r.t1=r.catch(20),r.abrupt("return",K("call",r.t1,t.transaction));case 29:return(a=z(t.transaction)).module="proxy",a.action="eth_estimateGas",r.prev=32,r.next=35,this.fetch("proxy",a,!0);case 35:return r.abrupt("return",r.sent);case 38:return r.prev=38,r.t2=r.catch(32),r.abrupt("return",K("estimateGas",r.t2,t.transaction));case 41:return o={action:"getLogs"},t.filter.fromBlock&&(o.fromBlock=G(t.filter.fromBlock)),t.filter.toBlock&&(o.toBlock=G(t.filter.toBlock)),t.filter.address&&(o.address=t.filter.address),t.filter.topics&&t.filter.topics.length>0&&(t.filter.topics.length>1&&q.throwError("unsupported topic count",g.Logger.errors.UNSUPPORTED_OPERATION,{topics:t.filter.topics}),1===t.filter.topics.length&&("string"===typeof(s=t.filter.topics[0])&&66===s.length||q.throwError("unsupported topic format",g.Logger.errors.UNSUPPORTED_OPERATION,{topic0:s}),o.topic0=s)),r.next=48,this.fetch("logs",o);case 48:c=r.sent,u={},f=0;case 51:if(!(ft?null:(n+i)/2}function te(e){if(null===e)return"null";if("number"===typeof e||"boolean"===typeof e)return JSON.stringify(e);if("string"===typeof e)return e;if(v.a.isBigNumber(e))return e.toString();if(Array.isArray(e))return JSON.stringify(e.map((function(e){return te(e)})));if("object"===typeof e){var t=Object.keys(e);return t.sort(),"{"+t.map((function(t){var r=e[t];return r="function"===typeof r?"[function]":te(r),JSON.stringify(t)+":"+r})).join(",")+"}"}throw new Error("unknown value type: "+typeof e)}var re=1;function ne(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 ie=[g.Logger.errors.CALL_EXCEPTION,g.Logger.errors.INSUFFICIENT_FUNDS,g.Logger.errors.NONCE_EXPIRED,g.Logger.errors.REPLACEMENT_UNDERPRICED,g.Logger.errors.UNPREDICTABLE_GAS_LIMIT],ae=["address","args","errorArgs","errorSignature","method","transaction"];function oe(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 se(e,t,r){var n=te;switch(t){case"getBlockNumber":return function(t){var r=t.map((function(e){return e.result})),n=ee(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 ee(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=Object(d.shallowCopy)(e)).confirmations=-1,te(e))};break;case"getBlock":n=r.includeTransactions?function(e){return null==e?null:((e=Object(d.shallowCopy)(e)).transactions=e.transactions.map((function(e){return(e=Object(d.shallowCopy)(e)).confirmations=-1,e})),te(e))}:function(e){return null==e?null:te(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),a=0;a=t)return o.result}}}(n,e.quorum)}function ce(e,t){return J(this,void 0,void 0,p.a.mark((function r(){var n;return p.a.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",Object(U.poll)((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 ue(e,t,r,n){return J(this,void 0,void 0,p.a.mark((function i(){var a,o;return p.a.wrap((function(i){for(;;)switch(i.prev=i.next){case 0:a=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?28:"getLogs"===i.t0?29:35;break;case 4:return i.abrupt("return",a[r]());case 5:if(!a.getEtherPrice){i.next=7;break}return i.abrupt("return",a.getEtherPrice());case 7:return i.abrupt("break",35);case 8:if(!n.blockTag||!Object(L.isHexString)(n.blockTag)){i.next=12;break}return i.next=11,ce(e,t);case 11:a=i.sent;case 12:return i.abrupt("return",a[r](n.address,n.blockTag||"latest"));case 13:if(!n.blockTag||!Object(L.isHexString)(n.blockTag)){i.next=17;break}return i.next=16,ce(e,t);case 16:a=i.sent;case 17:return i.abrupt("return",a.getStorageAt(n.address,n.position,n.blockTag||"latest"));case 18:if(!n.blockTag||!Object(L.isHexString)(n.blockTag)){i.next=22;break}return i.next=21,ce(e,t);case 21:a=i.sent;case 22:return i.abrupt("return",a[n.includeTransactions?"getBlockWithTransactions":"getBlock"](n.blockTag||n.blockHash));case 23:if(!n.blockTag||!Object(L.isHexString)(n.blockTag)){i.next=27;break}return i.next=26,ce(e,t);case 26:a=i.sent;case 27:return i.abrupt("return",a[r](n.transaction));case 28:return i.abrupt("return",a[r](n.transactionHash));case 29:if(!((o=n.filter).fromBlock&&Object(L.isHexString)(o.fromBlock)||o.toBlock&&Object(L.isHexString)(o.toBlock))){i.next=34;break}return i.next=33,ce(e,t);case 33:a=i.sent;case 34:return i.abrupt("return",a.getLogs(o));case 35:return i.abrupt("return",Y.throwError("unknown method error",g.Logger.errors.UNKNOWN_ERROR,{method:r,params:n}));case 36:case"end":return i.stop()}}),i)})))}var fe=function(e){Object(u.a)(r,e);var t=Object(f.a)(r);function r(e,i){var a;Object(o.a)(this,r),Y.checkNew(this instanceof r?this.constructor:void 0,r),0===e.length&&Y.throwArgumentError("missing providers","providers",e);var s=e.map((function(e,t){if(n.Provider.isProvider(e)){var r=Object(l.c)(e)?2e3:750;return Object.freeze({provider:e,weight:1,stallTimeout:r,priority:1})}var i=Object(d.shallowCopy)(e);null==i.priority&&(i.priority=1),null==i.stallTimeout&&(i.stallTimeout=Object(l.c)(e)?2e3:750),null==i.weight&&(i.weight=1);var a=i.weight;return(a%1||a>512||a<1)&&Y.throwArgumentError("invalid weight; must be integer in [1, 512]","providers[".concat(t,"].weight"),a),Object.freeze(i)})),u=s.reduce((function(e,t){return e+t.weight}),0);null==i?i=u/2:i>u&&Y.throwArgumentError("quorum will always fail; larger than total weight","quorum",i);var f=Q(s.map((function(e){return e.provider.network})));return null==f&&(f=new Promise((function(e,t){setTimeout((function(){a.detectNetwork().then(e,t)}),0)}))),a=t.call(this,f),Object(d.defineReadOnly)(Object(c.a)(a),"providerConfigs",Object.freeze(s)),Object(d.defineReadOnly)(Object(c.a)(a),"quorum",i),a._highestBlockNumber=-1,a}return Object(s.a)(r,[{key:"detectNetwork",value:function(){return J(this,void 0,void 0,p.a.mark((function e(){var t;return p.a.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",Q(t));case 4:case"end":return e.stop()}}),e,this)})))}},{key:"perform",value:function(e,t){return J(this,void 0,void 0,p.a.mark((function r(){var n,i,a,o,s,c,u,f,l,h,b=this;return p.a.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