ethers.js/dist/shims.js

1 line
142 KiB
JavaScript
Raw Permalink Normal View History

!function(t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):("undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this)._shims=t()}(function(){return function n(o,i,s){function u(e,t){if(!i[e]){if(!o[e]){var r="function"==typeof require&&require;if(!t&&r)return r(e,!0);if(a)return a(e,!0);throw(r=new Error("Cannot find module '"+e+"'")).code="MODULE_NOT_FOUND",r}r=i[e]={exports:{}},o[e][0].call(r.exports,function(t){return u(o[e][1][t]||t)},r,r.exports,n,o,i,s)}return i[e].exports}for(var a="function"==typeof require&&require,t=0;t<s.length;t++)u(s[t]);return u}({1:[function(t,e,r){(function(e){if(e.atob)try{e.atob(" ")}catch(t){e.atob=(r=e.atob,n.original=r,n)}else{var r,u="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",s=/^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/;e.btoa=function(t){for(var e,r,n,o="",i=0,s=(t=String(t)).length%3;i<t.length;){if(255<(e=t.charCodeAt(i++))||255<(r=t.charCodeAt(i++))||255<(n=t.charCodeAt(i++)))throw new TypeError("Failed to execute 'btoa' on 'Window': The string to be encoded contains characters outside of the Latin1 range.");o+=u.charAt((e=e<<16|r<<8|n)>>18&63)+u.charAt(e>>12&63)+u.charAt(e>>6&63)+u.charAt(63&e)}return s?o.slice(0,s-3)+"===".substring(s):o},e.atob=function(t){if(t=String(t).replace(/[\t\n\f\r ]+/g,""),!s.test(t))throw new TypeError("Failed to execute 'atob' on 'Window': The string to be decoded is not correctly encoded.");t+="==".slice(2-(3&t.length));for(var e,r,n,o="",i=0;i<t.length;)e=u.indexOf(t.charAt(i++))<<18|u.indexOf(t.charAt(i++))<<12|(r=u.indexOf(t.charAt(i++)))<<6|(n=u.indexOf(t.charAt(i++))),o+=64===r?String.fromCharCode(e>>16&255):64===n?String.fromCharCode(e>>16&255,e>>8&255):String.fromCharCode(e>>16&255,e>>8&255,255&e);return o}}function n(t){return r(String(t).replace(/[\t\n\f\r ]+/g,""))}})(void 0!==r?r:this)},{}],2:[function(W,r,n){!function(V){!function(){var t,e;t=this,e=function(){"use strict";function f(t){return"function"==typeof t}var r=Array.isArray||function(t){return"[object Array]"===Object.prototype.toString.call(t)},n=0,e=void 0,o=void 0,u=function(t,e){h[n]=t,h[n+1]=e,2===(n+=2)&&(o?o(l):w())};var t="undefined"!=typeof window?window:void 0,i=t||{},s=i.MutationObserver||i.WebKitMutationObserver,a="undefined"==typeof self&&"undefined"!=typeof process&&"[object process]"==={}.toString.call(process),i="undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof importScripts&&"undefined"!=typeof MessageChannel;function c(){var t=setTimeout;return function(){return t(l,1)}}var h=new Array(1e3);function l(){for(var t=0;t<n;t+=2)(0,h[t])(h[t+1]),h[t]=void 0,h[t+1]=void 0;n=0}function p(){try{var t=W("vertx");return void 0!==(e=t.runOnLoop||t.runOnContext)?function(){e(l)}:c()}catch(t){return c()}}var d,v,g,y,w=void 0;function m(t,e){var r=arguments,n=this,o=new this.constructor(_);void 0===o[C]&&q(o);var i,s=n._state;return s?(i=r[s-1],u(function(){return P(s,o,i,n._result)})):z(n,o,t,e),o}function b(t){if(t&&"object"==typeof t&&t.constructor===this)return t;var e=new this(_);return E(e,t),e}var w=a?function(){return process.nextTick(l)}:s?(v=0,g=new s(l),y=document.createTextNode(""),g.observe(y,{characterData:!0}),function(){y.data=v=++v%2}):i?((d=new MessageChannel).port1.onmessage=l,function(){return d.port2.postMessage(0)}):(void 0===t&&"function"==typeof W?p:c)(),C=Math.random().toString(36).substring(16);function _(){}var A=void 0,S=1,x=2,F=new M;function B(t){try{return t.then}catch(t){return F.error=t,F}}function N(t,n,o){u(function(e){var r=!1,t=function(t,e,r,n){try{t.call(e,r,n)}catch(t){return t}}(o,n,function(t){r||(r=!0,(n!==t?E:D)(e,t))},function(t){r||(r=!0,k(e,t))},e._label);!r&&t&&(r=!0,k(e,t))},t)}function j(t,e,r){var n,o;e.constructor===t.constructor&&r===m&&e.constructor.resolve===b?(n=t,(o=e)._state===S?D(n,o._result):o._state===x?k(n,o._result):z(o,void 0,function(t){return E(n,t)},function(t){return k(n,t)})):r===F?(k(t,F.error),F.error=null):void 0!==r