@ape.swap/bonds-sdk 3.0.100 → 3.0.102
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/main.js +28 -25
- package/dist/state/useSDKConfig.d.ts +2 -0
- package/dist/types/bonds.d.ts +2 -0
- package/dist/utils/displayHelpers.d.ts +1 -1
- package/package.json +1 -1
package/dist/main.js
CHANGED
|
@@ -11548,7 +11548,7 @@ function findSpring({ duration = springDefaults.duration, bounce = springDefault
|
|
|
11548
11548
|
envelope = (undampedFreq) => {
|
|
11549
11549
|
const a = Math.exp(-undampedFreq * duration);
|
|
11550
11550
|
const b = (undampedFreq - velocity) * duration + 1;
|
|
11551
|
-
return -
|
|
11551
|
+
return -safeMin + a * b;
|
|
11552
11552
|
};
|
|
11553
11553
|
derivative = (undampedFreq) => {
|
|
11554
11554
|
const a = Math.exp(-undampedFreq * duration);
|
|
@@ -19529,12 +19529,12 @@ function clone$2(configObject) {
|
|
|
19529
19529
|
if (obj.hasOwnProperty(p = 'EXPONENTIAL_AT')) {
|
|
19530
19530
|
v = obj[p];
|
|
19531
19531
|
if (v && v.pop) {
|
|
19532
|
-
intCheck(v[0], -
|
|
19532
|
+
intCheck(v[0], -MAX, 0, p);
|
|
19533
19533
|
intCheck(v[1], 0, MAX, p);
|
|
19534
19534
|
TO_EXP_NEG = v[0];
|
|
19535
19535
|
TO_EXP_POS = v[1];
|
|
19536
19536
|
} else {
|
|
19537
|
-
intCheck(v, -
|
|
19537
|
+
intCheck(v, -MAX, MAX, p);
|
|
19538
19538
|
TO_EXP_NEG = -(TO_EXP_POS = v < 0 ? -v : v);
|
|
19539
19539
|
}
|
|
19540
19540
|
}
|
|
@@ -19545,12 +19545,12 @@ function clone$2(configObject) {
|
|
|
19545
19545
|
if (obj.hasOwnProperty(p = 'RANGE')) {
|
|
19546
19546
|
v = obj[p];
|
|
19547
19547
|
if (v && v.pop) {
|
|
19548
|
-
intCheck(v[0], -
|
|
19548
|
+
intCheck(v[0], -MAX, -1, p);
|
|
19549
19549
|
intCheck(v[1], 1, MAX, p);
|
|
19550
19550
|
MIN_EXP = v[0];
|
|
19551
19551
|
MAX_EXP = v[1];
|
|
19552
19552
|
} else {
|
|
19553
|
-
intCheck(v, -
|
|
19553
|
+
intCheck(v, -MAX, MAX, p);
|
|
19554
19554
|
if (v) {
|
|
19555
19555
|
MIN_EXP = -(MAX_EXP = v < 0 ? -v : v);
|
|
19556
19556
|
} else {
|
|
@@ -19667,7 +19667,7 @@ function clone$2(configObject) {
|
|
|
19667
19667
|
|
|
19668
19668
|
out: if ({}.toString.call(c) == '[object Array]') {
|
|
19669
19669
|
|
|
19670
|
-
if ((s === 1 || s === -1) && e >= -
|
|
19670
|
+
if ((s === 1 || s === -1) && e >= -MAX && e <= MAX && e === mathfloor(e)) {
|
|
19671
19671
|
|
|
19672
19672
|
// If the first element is zero, the BigNumber value must be zero.
|
|
19673
19673
|
if (c[0] === 0) {
|
|
@@ -21441,7 +21441,7 @@ function clone$2(configObject) {
|
|
|
21441
21441
|
* '[BigNumber Error] Argument {not a primitive number|not an integer|out of range}: {k}'
|
|
21442
21442
|
*/
|
|
21443
21443
|
P.shiftedBy = function (k) {
|
|
21444
|
-
intCheck(k, -
|
|
21444
|
+
intCheck(k, -MAX_SAFE_INTEGER$1, MAX_SAFE_INTEGER$1);
|
|
21445
21445
|
return this.times('1e' + k);
|
|
21446
21446
|
};
|
|
21447
21447
|
|
|
@@ -26831,7 +26831,7 @@ class BigNumber {
|
|
|
26831
26831
|
if (value % 1) {
|
|
26832
26832
|
throwFault$1("underflow", "BigNumber.from", value);
|
|
26833
26833
|
}
|
|
26834
|
-
if (value >= MAX_SAFE || value <= -
|
|
26834
|
+
if (value >= MAX_SAFE || value <= -MAX_SAFE) {
|
|
26835
26835
|
throwFault$1("overflow", "BigNumber.from", value);
|
|
26836
26836
|
}
|
|
26837
26837
|
return BigNumber.from(String(value));
|
|
@@ -45388,7 +45388,7 @@ lodash.exports;
|
|
|
45388
45388
|
return symbolToString ? symbolToString.call(value) : '';
|
|
45389
45389
|
}
|
|
45390
45390
|
var result = (value + '');
|
|
45391
|
-
return (result == '0' && (1 / value) == -
|
|
45391
|
+
return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
|
|
45392
45392
|
}
|
|
45393
45393
|
|
|
45394
45394
|
/**
|
|
@@ -47911,7 +47911,7 @@ lodash.exports;
|
|
|
47911
47911
|
return value;
|
|
47912
47912
|
}
|
|
47913
47913
|
var result = (value + '');
|
|
47914
|
-
return (result == '0' && (1 / value) == -
|
|
47914
|
+
return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
|
|
47915
47915
|
}
|
|
47916
47916
|
|
|
47917
47917
|
/**
|
|
@@ -53253,7 +53253,7 @@ lodash.exports;
|
|
|
53253
53253
|
* // => false
|
|
53254
53254
|
*/
|
|
53255
53255
|
function isSafeInteger(value) {
|
|
53256
|
-
return isInteger(value) && value >= -
|
|
53256
|
+
return isInteger(value) && value >= -MAX_SAFE_INTEGER && value <= MAX_SAFE_INTEGER;
|
|
53257
53257
|
}
|
|
53258
53258
|
|
|
53259
53259
|
/**
|
|
@@ -53520,7 +53520,7 @@ lodash.exports;
|
|
|
53520
53520
|
return value === 0 ? value : 0;
|
|
53521
53521
|
}
|
|
53522
53522
|
value = toNumber(value);
|
|
53523
|
-
if (value === INFINITY || value === -
|
|
53523
|
+
if (value === INFINITY || value === -INFINITY) {
|
|
53524
53524
|
var sign = (value < 0 ? -1 : 1);
|
|
53525
53525
|
return sign * MAX_INTEGER;
|
|
53526
53526
|
}
|
|
@@ -53689,7 +53689,7 @@ lodash.exports;
|
|
|
53689
53689
|
*/
|
|
53690
53690
|
function toSafeInteger(value) {
|
|
53691
53691
|
return value
|
|
53692
|
-
? baseClamp(toInteger(value), -
|
|
53692
|
+
? baseClamp(toInteger(value), -MAX_SAFE_INTEGER, MAX_SAFE_INTEGER)
|
|
53693
53693
|
: (value === 0 ? value : 0);
|
|
53694
53694
|
}
|
|
53695
53695
|
|
|
@@ -58382,7 +58382,7 @@ const stagingUrls = {
|
|
|
58382
58382
|
};
|
|
58383
58383
|
const useSDKConfig = (config) => {
|
|
58384
58384
|
const urls = process.env.NODE_ENV === 'production' ? defaultUrls : stagingUrls;
|
|
58385
|
-
const initialData = Object.assign(Object.assign({ referenceId: '', chains: [], hotBondChains: [types.ChainId.BSC, types.ChainId.MATIC], useHotBonds: true, useRainbowKit: false, useTiers: false, useTGEBonds: false, showLowValueBonds: false, bondPartner: undefined }, config), { urls: Object.assign(Object.assign({}, urls), config === null || config === void 0 ? void 0 : config.urls), highestCompatibleVersion: '2.1.3' });
|
|
58385
|
+
const initialData = Object.assign(Object.assign({ referenceId: '', chains: [], hotBondChains: [types.ChainId.BSC, types.ChainId.MATIC], useHotBonds: true, useRainbowKit: false, useTiers: false, useTGEBonds: false, showLowValueBonds: false, bondPartner: undefined, namingPreference: 'Bonus' }, config), { urls: Object.assign(Object.assign({}, urls), config === null || config === void 0 ? void 0 : config.urls), highestCompatibleVersion: '2.1.3' });
|
|
58386
58386
|
const { data } = useQuery({
|
|
58387
58387
|
queryKey: [QUERY_KEYS.SDK_CONFIG],
|
|
58388
58388
|
queryFn: () => {
|
|
@@ -58619,10 +58619,10 @@ const discountEarnTokenPriceForUser = (bond, useTiers, userTier) => {
|
|
|
58619
58619
|
const trueBondPriceWithFee = getBalanceNumber(new BigNumber$1(trueBondPrice !== null && trueBondPrice !== void 0 ? trueBondPrice : '0').times((100 + fee) / 100));
|
|
58620
58620
|
return getFirstNonZeroDigits(principalTokenPrice * trueBondPriceWithFee);
|
|
58621
58621
|
};
|
|
58622
|
-
const maxBuy = (bond) => {
|
|
58622
|
+
const maxBuy = (bond, allowLowValueBonds) => {
|
|
58623
58623
|
var _a, _b, _c, _d, _e, _f;
|
|
58624
58624
|
const available = new BigNumber$1((_a = bond === null || bond === void 0 ? void 0 : bond.tokensRemaining) !== null && _a !== void 0 ? _a : '0');
|
|
58625
|
-
const threshold = 5;
|
|
58625
|
+
const threshold = allowLowValueBonds ? 0 : 5;
|
|
58626
58626
|
const thresholdToShow = new BigNumber$1(threshold).div((_b = bond === null || bond === void 0 ? void 0 : bond.payoutTokenPrice) !== null && _b !== void 0 ? _b : 0);
|
|
58627
58627
|
let safeAvailable = available.minus(thresholdToShow);
|
|
58628
58628
|
if (safeAvailable.lt(0))
|
|
@@ -61325,7 +61325,7 @@ var numbro_min = {exports: {}};
|
|
|
61325
61325
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
61326
61326
|
* SOFTWARE.
|
|
61327
61327
|
*/
|
|
61328
|
-
function d(e,t){e.forEach((e=>{let r;try{r=function(e){throw new Error('Could not dynamically require "'+e+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}(`../languages/${e}`);}catch(t){console.error(`Unable to load "${e}". No matching language file found.`);}r&&t.registerLanguage(r);}));}var m={exports:{}};!function(e){!function(t){var r,n=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,i=Math.ceil,a=Math.floor,o="[BigNumber Error] ",u=o+"Number primitive has more than 15 significant digits: ",s=1e14,l=14,c=9007199254740991,f=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],p=1e7,g=1e9;function h(e){var t=0|e;return e>0||e===t?t:t-1}function d(e){for(var t,r,n=1,i=e.length,a=e[0]+"";n<i;){for(t=e[n++]+"",r=l-t.length;r--;t="0"+t);a+=t;}for(i=a.length;48===a.charCodeAt(--i););return a.slice(0,i+1||1)}function m(e,t){var r,n,i=e.c,a=t.c,o=e.s,u=t.s,s=e.e,l=t.e;if(!o||!u)return null;if(r=i&&!i[0],n=a&&!a[0],r||n)return r?n?0:-u:o;if(o!=u)return o;if(r=o<0,n=s==l,!i||!a)return n?0:!i^r?1:-1;if(!n)return s>l^r?1:-1;for(u=(s=i.length)<(l=a.length)?s:l,o=0;o<u;o++)if(i[o]!=a[o])return i[o]>a[o]^r?1:-1;return s==l?0:s>l^r?1:-1}function y(e,t,r,n){if(e<t||e>r||e!==a(e))throw Error(o+(n||"Argument")+("number"==typeof e?e<t||e>r?" out of range: ":" not an integer: ":" not a primitive number: ")+String(e))}function b(e){var t=e.c.length-1;return h(e.e/l)==t&&e.c[t]%2!=0}function v(e,t){return (e.length>1?e.charAt(0)+"."+e.slice(1):e)+(t<0?"e":"e+")+t}function w(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}r=function e(t){var r,O,x,S,N,$,B,M,D,F,E=q.prototype={constructor:q,toString:null,valueOf:null},A=new q(1),_=20,k=4,L=-7,P=21,T=-1e7,C=1e7,j=false,U=1,R=0,I={prefix:"",groupSize:3,secondaryGroupSize:0,groupSeparator:",",decimalSeparator:".",fractionGroupSize:0,fractionGroupSeparator:" ",suffix:""},G="0123456789abcdefghijklmnopqrstuvwxyz",V=true;function q(e,t){var r,i,o,s,f,p,g,h,d=this;if(!(d instanceof q))return new q(e,t);if(null==t){if(e&&true===e._isBigNumber)return d.s=e.s,void(!e.c||e.e>C?d.c=d.e=null:e.e<T?d.c=[d.e=0]:(d.e=e.e,d.c=e.c.slice()));if((p="number"==typeof e)&&0*e==0){if(d.s=1/e<0?(e=-e,-1):1,e===~~e){for(s=0,f=e;f>=10;f/=10,s++);return void(s>C?d.c=d.e=null:(d.e=s,d.c=[e]))}h=String(e);}else {if(!n.test(h=String(e)))return x(d,h,p);d.s=45==h.charCodeAt(0)?(h=h.slice(1),-1):1;}(s=h.indexOf("."))>-1&&(h=h.replace(".","")),(f=h.search(/e/i))>0?(s<0&&(s=f),s+=+h.slice(f+1),h=h.substring(0,f)):s<0&&(s=h.length);}else {if(y(t,2,G.length,"Base"),10==t&&V)return H(d=new q(e),_+d.e+1,k);if(h=String(e),p="number"==typeof e){if(0*e!=0)return x(d,h,p,t);if(d.s=1/e<0?(h=h.slice(1),-1):1,q.DEBUG&&h.replace(/^0\.0*|\./,"").length>15)throw Error(u+e)}else d.s=45===h.charCodeAt(0)?(h=h.slice(1),-1):1;for(r=G.slice(0,t),s=f=0,g=h.length;f<g;f++)if(r.indexOf(i=h.charAt(f))<0){if("."==i){if(f>s){s=g;continue}}else if(!o&&(h==h.toUpperCase()&&(h=h.toLowerCase())||h==h.toLowerCase()&&(h=h.toUpperCase()))){o=true,f=-1,s=0;continue}return x(d,String(e),p,t)}p=false,(s=(h=O(h,t,10,d.s)).indexOf("."))>-1?h=h.replace(".",""):s=h.length;}for(f=0;48===h.charCodeAt(f);f++);for(g=h.length;48===h.charCodeAt(--g););if(h=h.slice(f,++g)){if(g-=f,p&&q.DEBUG&&g>15&&(e>c||e!==a(e)))throw Error(u+d.s*e);if((s=s-f-1)>C)d.c=d.e=null;else if(s<T)d.c=[d.e=0];else {if(d.e=s,d.c=[],f=(s+1)%l,s<0&&(f+=l),f<g){for(f&&d.c.push(+h.slice(0,f)),g-=l;f<g;)d.c.push(+h.slice(f,f+=l));f=l-(h=h.slice(f)).length;}else f-=g;for(;f--;h+="0");d.c.push(+h);}}else d.c=[d.e=0];}function Z(e,t,r,n){var i,a,o,u,s;if(null==r?r=k:y(r,0,8),!e.c)return e.toString();if(i=e.c[0],o=e.e,null==t)s=d(e.c),s=1==n||2==n&&(o<=L||o>=P)?v(s,o):w(s,o,"0");else if(a=(e=H(new q(e),t,r)).e,u=(s=d(e.c)).length,1==n||2==n&&(t<=a||a<=L)){for(;u<t;s+="0",u++);s=v(s,a);}else if(t-=o,s=w(s,a,"0"),a+1>u){if(--t>0)for(s+=".";t--;s+="0");}else if((t+=a-u)>0)for(a+1==u&&(s+=".");t--;s+="0");return e.s<0&&i?"-"+s:s}function z(e,t){for(var r,n,i=1,a=new q(e[0]);i<e.length;i++)(!(n=new q(e[i])).s||(r=m(a,n))===t||0===r&&a.s===t)&&(a=n);return a}function W(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+r*l-1)>C?e.c=e.e=null:r<T?e.c=[e.e=0]:(e.e=r,e.c=t),e}function H(e,t,r,n){var o,u,c,p,g,h,d,m=e.c,y=f;if(m){e:{for(o=1,p=m[0];p>=10;p/=10,o++);if((u=t-o)<0)u+=l,c=t,g=m[h=0],d=a(g/y[o-c-1]%10);else if((h=i((u+1)/l))>=m.length){if(!n)break e;for(;m.length<=h;m.push(0));g=d=0,o=1,c=(u%=l)-l+1;}else {for(g=p=m[h],o=1;p>=10;p/=10,o++);d=(c=(u%=l)-l+o)<0?0:a(g/y[o-c-1]%10);}if(n=n||t<0||null!=m[h+1]||(c<0?g:g%y[o-c-1]),n=r<4?(d||n)&&(0==r||r==(e.s<0?3:2)):d>5||5==d&&(4==r||n||6==r&&(u>0?c>0?g/y[o-c]:0:m[h-1])%10&1||r==(e.s<0?8:7)),t<1||!m[0])return m.length=0,n?(t-=e.e+1,m[0]=y[(l-t%l)%l],e.e=-t||0):m[0]=e.e=0,e;if(0==u?(m.length=h,p=1,h--):(m.length=h+1,p=y[l-u],m[h]=c>0?a(g/y[o-c]%y[c])*p:0),n)for(;;){if(0==h){for(u=1,c=m[0];c>=10;c/=10,u++);for(c=m[0]+=p,p=1;c>=10;c/=10,p++);u!=p&&(e.e++,m[0]==s&&(m[0]=1));break}if(m[h]+=p,m[h]!=s)break;m[h--]=0,p=1;}for(u=m.length;0===m[--u];m.pop());}e.e>C?e.c=e.e=null:e.e<T&&(e.c=[e.e=0]);}return e}function Y(e){var t,r=e.e;return null===r?e.toString():(t=d(e.c),t=r<=L||r>=P?v(t,r):w(t,r,"0"),e.s<0?"-"+t:t)}return q.clone=e,q.ROUND_UP=0,q.ROUND_DOWN=1,q.ROUND_CEIL=2,q.ROUND_FLOOR=3,q.ROUND_HALF_UP=4,q.ROUND_HALF_DOWN=5,q.ROUND_HALF_EVEN=6,q.ROUND_HALF_CEIL=7,q.ROUND_HALF_FLOOR=8,q.EUCLID=9,q.config=q.set=function(e){var t,r;if(null!=e){if("object"!=typeof e)throw Error(o+"Object expected: "+e);if(e.hasOwnProperty(t="DECIMAL_PLACES")&&(y(r=e[t],0,g,t),_=r),e.hasOwnProperty(t="ROUNDING_MODE")&&(y(r=e[t],0,8,t),k=r),e.hasOwnProperty(t="EXPONENTIAL_AT")&&((r=e[t])&&r.pop?(y(r[0],-1e9,0,t),y(r[1],0,g,t),L=r[0],P=r[1]):(y(r,-1e9,g,t),L=-(P=r<0?-r:r))),e.hasOwnProperty(t="RANGE"))if((r=e[t])&&r.pop)y(r[0],-1e9,-1,t),y(r[1],1,g,t),T=r[0],C=r[1];else {if(y(r,-1e9,g,t),!r)throw Error(o+t+" cannot be zero: "+r);T=-(C=r<0?-r:r);}if(e.hasOwnProperty(t="CRYPTO")){if((r=e[t])!==!!r)throw Error(o+t+" not true or false: "+r);if(r){if("undefined"==typeof crypto||!crypto||!crypto.getRandomValues&&!crypto.randomBytes)throw j=!r,Error(o+"crypto unavailable");j=r;}else j=r;}if(e.hasOwnProperty(t="MODULO_MODE")&&(y(r=e[t],0,9,t),U=r),e.hasOwnProperty(t="POW_PRECISION")&&(y(r=e[t],0,g,t),R=r),e.hasOwnProperty(t="FORMAT")){if("object"!=typeof(r=e[t]))throw Error(o+t+" not an object: "+r);I=r;}if(e.hasOwnProperty(t="ALPHABET")){if("string"!=typeof(r=e[t])||/^.?$|[+\-.\s]|(.).*\1/.test(r))throw Error(o+t+" invalid: "+r);V="0123456789"==r.slice(0,10),G=r;}}return {DECIMAL_PLACES:_,ROUNDING_MODE:k,EXPONENTIAL_AT:[L,P],RANGE:[T,C],CRYPTO:j,MODULO_MODE:U,POW_PRECISION:R,FORMAT:I,ALPHABET:G}},q.isBigNumber=function(e){if(!e||true!==e._isBigNumber)return false;if(!q.DEBUG)return true;var t,r,n=e.c,i=e.e,u=e.s;e:if("[object Array]"=={}.toString.call(n)){if((1===u||-1===u)&&i>=-1e9&&i<=g&&i===a(i)){if(0===n[0]){if(0===i&&1===n.length)return true;break e}if((t=(i+1)%l)<1&&(t+=l),String(n[0]).length==t){for(t=0;t<n.length;t++)if((r=n[t])<0||r>=s||r!==a(r))break e;if(0!==r)return true}}}else if(null===n&&null===i&&(null===u||1===u||-1===u))return true;throw Error(o+"Invalid BigNumber: "+e)},q.maximum=q.max=function(){return z(arguments,-1)},q.minimum=q.min=function(){return z(arguments,1)},q.random=(S=9007199254740992,N=Math.random()*S&2097151?function(){return a(Math.random()*S)}:function(){return 8388608*(1073741824*Math.random()|0)+(8388608*Math.random()|0)},function(e){var t,r,n,u,s,c=0,p=[],h=new q(A);if(null==e?e=_:y(e,0,g),u=i(e/l),j)if(crypto.getRandomValues){for(t=crypto.getRandomValues(new Uint32Array(u*=2));c<u;)(s=131072*t[c]+(t[c+1]>>>11))>=9e15?(r=crypto.getRandomValues(new Uint32Array(2)),t[c]=r[0],t[c+1]=r[1]):(p.push(s%1e14),c+=2);c=u/2;}else {if(!crypto.randomBytes)throw j=false,Error(o+"crypto unavailable");for(t=crypto.randomBytes(u*=7);c<u;)(s=281474976710656*(31&t[c])+1099511627776*t[c+1]+4294967296*t[c+2]+16777216*t[c+3]+(t[c+4]<<16)+(t[c+5]<<8)+t[c+6])>=9e15?crypto.randomBytes(7).copy(t,c):(p.push(s%1e14),c+=7);c=u/7;}if(!j)for(;c<u;)(s=N())<9e15&&(p[c++]=s%1e14);for(u=p[--c],e%=l,u&&e&&(s=f[l-e],p[c]=a(u/s)*s);0===p[c];p.pop(),c--);if(c<0)p=[n=0];else {for(n=-1;0===p[0];p.splice(0,1),n-=l);for(c=1,s=p[0];s>=10;s/=10,c++);c<l&&(n-=l-c);}return h.e=n,h.c=p,h}),q.sum=function(){for(var e=1,t=arguments,r=new q(t[0]);e<t.length;)r=r.plus(t[e++]);return r},O=function(){var e="0123456789";function t(e,t,r,n){for(var i,a,o=[0],u=0,s=e.length;u<s;){for(a=o.length;a--;o[a]*=t);for(o[0]+=n.indexOf(e.charAt(u++)),i=0;i<o.length;i++)o[i]>r-1&&(null==o[i+1]&&(o[i+1]=0),o[i+1]+=o[i]/r|0,o[i]%=r);}return o.reverse()}return function(n,i,a,o,u){var s,l,c,f,p,g,h,m,y=n.indexOf("."),b=_,v=k;for(y>=0&&(f=R,R=0,n=n.replace(".",""),g=(m=new q(i)).pow(n.length-y),R=f,m.c=t(w(d(g.c),g.e,"0"),10,a,e),m.e=m.c.length),c=f=(h=t(n,i,a,u?(s=G,e):(s=e,G))).length;0==h[--f];h.pop());if(!h[0])return s.charAt(0);if(y<0?--c:(g.c=h,g.e=c,g.s=o,h=(g=r(g,m,b,v,a)).c,p=g.r,c=g.e),y=h[l=c+b+1],f=a/2,p=p||l<0||null!=h[l+1],p=v<4?(null!=y||p)&&(0==v||v==(g.s<0?3:2)):y>f||y==f&&(4==v||p||6==v&&1&h[l-1]||v==(g.s<0?8:7)),l<1||!h[0])n=p?w(s.charAt(1),-b,s.charAt(0)):s.charAt(0);else {if(h.length=l,p)for(--a;++h[--l]>a;)h[l]=0,l||(++c,h=[1].concat(h));for(f=h.length;!h[--f];);for(y=0,n="";y<=f;n+=s.charAt(h[y++]));n=w(n,c,s.charAt(0));}return n}}(),r=function(){function e(e,t,r){var n,i,a,o,u=0,s=e.length,l=t%p,c=t/p|0;for(e=e.slice();s--;)u=((i=l*(a=e[s]%p)+(n=c*a+(o=e[s]/p|0)*l)%p*p+u)/r|0)+(n/p|0)+c*o,e[s]=i%r;return u&&(e=[u].concat(e)),e}function t(e,t,r,n){var i,a;if(r!=n)a=r>n?1:-1;else for(i=a=0;i<r;i++)if(e[i]!=t[i]){a=e[i]>t[i]?1:-1;break}return a}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,u,c){var f,p,g,d,m,y,b,v,w,O,x,S,N,$,B,M,D,F=n.s==i.s?1:-1,E=n.c,A=i.c;if(!(E&&E[0]&&A&&A[0]))return new q(n.s&&i.s&&(E?!A||E[0]!=A[0]:A)?E&&0==E[0]||!A?0*F:F/0:NaN);for(w=(v=new q(F)).c=[],F=o+(p=n.e-i.e)+1,c||(c=s,p=h(n.e/l)-h(i.e/l),F=F/l|0),g=0;A[g]==(E[g]||0);g++);if(A[g]>(E[g]||0)&&p--,F<0)w.push(1),d=true;else {for($=E.length,M=A.length,g=0,F+=2,(m=a(c/(A[0]+1)))>1&&(A=e(A,m,c),E=e(E,m,c),M=A.length,$=E.length),N=M,x=(O=E.slice(0,M)).length;x<M;O[x++]=0);D=A.slice(),D=[0].concat(D),B=A[0],A[1]>=c/2&&B++;do{if(m=0,(f=t(A,O,M,x))<0){if(S=O[0],M!=x&&(S=S*c+(O[1]||0)),(m=a(S/B))>1)for(m>=c&&(m=c-1),b=(y=e(A,m,c)).length,x=O.length;1==t(y,O,b,x);)m--,r(y,M<b?D:A,b,c),b=y.length,f=1;else 0==m&&(f=m=1),b=(y=A.slice()).length;if(b<x&&(y=[0].concat(y)),r(O,y,x,c),x=O.length,-1==f)for(;t(A,O,M,x)<1;)m++,r(O,M<x?D:A,x,c),x=O.length;}else 0===f&&(m++,O=[0]);w[g++]=m,O[0]?O[x++]=E[N]||0:(O=[E[N]],x=1);}while((N++<$||null!=O[0])&&F--);d=null!=O[0],w[0]||w.splice(0,1);}if(c==s){for(g=1,F=w[0];F>=10;F/=10,g++);H(v,o+(v.e=g+p*l-1)+1,u,d);}else v.e=p,v.r=+d;return v}}(),$=/^(-?)0([xbo])(?=\w[\w.]*$)/i,B=/^([^.]+)\.$/,M=/^\.([^.]+)$/,D=/^-?(Infinity|NaN)$/,F=/^\s*\+(?=[\w.])|^\s+|\s+$/g,x=function(e,t,r,n){var i,a=r?t:t.replace(F,"");if(D.test(a))e.s=isNaN(a)?null:a<0?-1:1;else {if(!r&&(a=a.replace($,(function(e,t,r){return i="x"==(r=r.toLowerCase())?16:"b"==r?2:8,n&&n!=i?e:t})),n&&(i=n,a=a.replace(B,"$1").replace(M,"0.$1")),t!=a))return new q(a,i);if(q.DEBUG)throw Error(o+"Not a"+(n?" base "+n:"")+" number: "+t);e.s=null;}e.c=e.e=null;},E.absoluteValue=E.abs=function(){var e=new q(this);return e.s<0&&(e.s=1),e},E.comparedTo=function(e,t){return m(this,new q(e,t))},E.decimalPlaces=E.dp=function(e,t){var r,n,i,a=this;if(null!=e)return y(e,0,g),null==t?t=k:y(t,0,8),H(new q(a),e+a.e+1,t);if(!(r=a.c))return null;if(n=((i=r.length-1)-h(this.e/l))*l,i=r[i])for(;i%10==0;i/=10,n--);return n<0&&(n=0),n},E.dividedBy=E.div=function(e,t){return r(this,new q(e,t),_,k)},E.dividedToIntegerBy=E.idiv=function(e,t){return r(this,new q(e,t),0,1)},E.exponentiatedBy=E.pow=function(e,t){var r,n,u,s,c,f,p,g,h=this;if((e=new q(e)).c&&!e.isInteger())throw Error(o+"Exponent not an integer: "+Y(e));if(null!=t&&(t=new q(t)),c=e.e>14,!h.c||!h.c[0]||1==h.c[0]&&!h.e&&1==h.c.length||!e.c||!e.c[0])return g=new q(Math.pow(+Y(h),c?e.s*(2-b(e)):+Y(e))),t?g.mod(t):g;if(f=e.s<0,t){if(t.c?!t.c[0]:!t.s)return new q(NaN);(n=!f&&h.isInteger()&&t.isInteger())&&(h=h.mod(t));}else {if(e.e>9&&(h.e>0||h.e<-1||(0==h.e?h.c[0]>1||c&&h.c[1]>=24e7:h.c[0]<8e13||c&&h.c[0]<=9999975e7)))return s=h.s<0&&b(e)?-0:0,h.e>-1&&(s=1/s),new q(f?1/s:s);R&&(s=i(R/l+2));}for(c?(r=new q(.5),f&&(e.s=1),p=b(e)):p=(u=Math.abs(+Y(e)))%2,g=new q(A);;){if(p){if(!(g=g.times(h)).c)break;s?g.c.length>s&&(g.c.length=s):n&&(g=g.mod(t));}if(u){if(0===(u=a(u/2)))break;p=u%2;}else if(H(e=e.times(r),e.e+1,1),e.e>14)p=b(e);else {if(0===(u=+Y(e)))break;p=u%2;}h=h.times(h),s?h.c&&h.c.length>s&&(h.c.length=s):n&&(h=h.mod(t));}return n?g:(f&&(g=A.div(g)),t?g.mod(t):s?H(g,R,k,undefined):g)},E.integerValue=function(e){var t=new q(this);return null==e?e=k:y(e,0,8),H(t,t.e+1,e)},E.isEqualTo=E.eq=function(e,t){return 0===m(this,new q(e,t))},E.isFinite=function(){return !!this.c},E.isGreaterThan=E.gt=function(e,t){return m(this,new q(e,t))>0},E.isGreaterThanOrEqualTo=E.gte=function(e,t){return 1===(t=m(this,new q(e,t)))||0===t},E.isInteger=function(){return !!this.c&&h(this.e/l)>this.c.length-2},E.isLessThan=E.lt=function(e,t){return m(this,new q(e,t))<0},E.isLessThanOrEqualTo=E.lte=function(e,t){return -1===(t=m(this,new q(e,t)))||0===t},E.isNaN=function(){return !this.s},E.isNegative=function(){return this.s<0},E.isPositive=function(){return this.s>0},E.isZero=function(){return !!this.c&&0==this.c[0]},E.minus=function(e,t){var r,n,i,a,o=this,u=o.s;if(t=(e=new q(e,t)).s,!u||!t)return new q(NaN);if(u!=t)return e.s=-t,o.plus(e);var c=o.e/l,f=e.e/l,p=o.c,g=e.c;if(!c||!f){if(!p||!g)return p?(e.s=-t,e):new q(g?o:NaN);if(!p[0]||!g[0])return g[0]?(e.s=-t,e):new q(p[0]?o:3==k?-0:0)}if(c=h(c),f=h(f),p=p.slice(),u=c-f){for((a=u<0)?(u=-u,i=p):(f=c,i=g),i.reverse(),t=u;t--;i.push(0));i.reverse();}else for(n=(a=(u=p.length)<(t=g.length))?u:t,u=t=0;t<n;t++)if(p[t]!=g[t]){a=p[t]<g[t];break}if(a&&(i=p,p=g,g=i,e.s=-e.s),(t=(n=g.length)-(r=p.length))>0)for(;t--;p[r++]=0);for(t=s-1;n>u;){if(p[--n]<g[n]){for(r=n;r&&!p[--r];p[r]=t);--p[r],p[n]+=s;}p[n]-=g[n];}for(;0==p[0];p.splice(0,1),--f);return p[0]?W(e,p,f):(e.s=3==k?-1:1,e.c=[e.e=0],e)},E.modulo=E.mod=function(e,t){var n,i,a=this;return e=new q(e,t),!a.c||!e.s||e.c&&!e.c[0]?new q(NaN):!e.c||a.c&&!a.c[0]?new q(a):(9==U?(i=e.s,e.s=1,n=r(a,e,0,3),e.s=i,n.s*=i):n=r(a,e,0,U),(e=a.minus(n.times(e))).c[0]||1!=U||(e.s=a.s),e)},E.multipliedBy=E.times=function(e,t){var r,n,i,a,o,u,c,f,g,d,m,y,b,v,w,O=this,x=O.c,S=(e=new q(e,t)).c;if(!(x&&S&&x[0]&&S[0]))return !O.s||!e.s||x&&!x[0]&&!S||S&&!S[0]&&!x?e.c=e.e=e.s=null:(e.s*=O.s,x&&S?(e.c=[0],e.e=0):e.c=e.e=null),e;for(n=h(O.e/l)+h(e.e/l),e.s*=O.s,(c=x.length)<(d=S.length)&&(b=x,x=S,S=b,i=c,c=d,d=i),i=c+d,b=[];i--;b.push(0));for(v=s,w=p,i=d;--i>=0;){for(r=0,m=S[i]%w,y=S[i]/w|0,a=i+(o=c);a>i;)r=((f=m*(f=x[--o]%w)+(u=y*f+(g=x[o]/w|0)*m)%w*w+b[a]+r)/v|0)+(u/w|0)+y*g,b[a--]=f%v;b[a]=r;}return r?++n:b.splice(0,1),W(e,b,n)},E.negated=function(){var e=new q(this);return e.s=-e.s||null,e},E.plus=function(e,t){var r,n=this,i=n.s;if(t=(e=new q(e,t)).s,!i||!t)return new q(NaN);if(i!=t)return e.s=-t,n.minus(e);var a=n.e/l,o=e.e/l,u=n.c,c=e.c;if(!a||!o){if(!u||!c)return new q(i/0);if(!u[0]||!c[0])return c[0]?e:new q(u[0]?n:0*i)}if(a=h(a),o=h(o),u=u.slice(),i=a-o){for(i>0?(o=a,r=c):(i=-i,r=u),r.reverse();i--;r.push(0));r.reverse();}for((i=u.length)-(t=c.length)<0&&(r=c,c=u,u=r,t=i),i=0;t;)i=(u[--t]=u[t]+c[t]+i)/s|0,u[t]=s===u[t]?0:u[t]%s;return i&&(u=[i].concat(u),++o),W(e,u,o)},E.precision=E.sd=function(e,t){var r,n,i,a=this;if(null!=e&&e!==!!e)return y(e,1,g),null==t?t=k:y(t,0,8),H(new q(a),e,t);if(!(r=a.c))return null;if(n=(i=r.length-1)*l+1,i=r[i]){for(;i%10==0;i/=10,n--);for(i=r[0];i>=10;i/=10,n++);}return e&&a.e+1>n&&(n=a.e+1),n},E.shiftedBy=function(e){return y(e,-9007199254740991,c),this.times("1e"+e)},E.squareRoot=E.sqrt=function(){var e,t,n,i,a,o=this,u=o.c,s=o.s,l=o.e,c=_+4,f=new q("0.5");if(1!==s||!u||!u[0])return new q(!s||s<0&&(!u||u[0])?NaN:u?o:1/0);if(0==(s=Math.sqrt(+Y(o)))||s==1/0?(((t=d(u)).length+l)%2==0&&(t+="0"),s=Math.sqrt(+t),l=h((l+1)/2)-(l<0||l%2),n=new q(t=s==1/0?"5e"+l:(t=s.toExponential()).slice(0,t.indexOf("e")+1)+l)):n=new q(s+""),n.c[0])for((s=(l=n.e)+c)<3&&(s=0);;)if(a=n,n=f.times(a.plus(r(o,a,c,1))),d(a.c).slice(0,s)===(t=d(n.c)).slice(0,s)){if(n.e<l&&--s,"9999"!=(t=t.slice(s-3,s+1))&&(i||"4999"!=t)){+t&&(+t.slice(1)||"5"!=t.charAt(0))||(H(n,n.e+_+2,1),e=!n.times(n).eq(o));break}if(!i&&(H(a,a.e+_+2,0),a.times(a).eq(o))){n=a;break}c+=4,s+=4,i=1;}return H(n,n.e+_+1,k,e)},E.toExponential=function(e,t){return null!=e&&(y(e,0,g),e++),Z(this,e,t,1)},E.toFixed=function(e,t){return null!=e&&(y(e,0,g),e=e+this.e+1),Z(this,e,t)},E.toFormat=function(e,t,r){var n,i=this;if(null==r)null!=e&&t&&"object"==typeof t?(r=t,t=null):e&&"object"==typeof e?(r=e,e=t=null):r=I;else if("object"!=typeof r)throw Error(o+"Argument not an object: "+r);if(n=i.toFixed(e,t),i.c){var a,u=n.split("."),s=+r.groupSize,l=+r.secondaryGroupSize,c=r.groupSeparator||"",f=u[0],p=u[1],g=i.s<0,h=g?f.slice(1):f,d=h.length;if(l&&(a=s,s=l,l=a,d-=a),s>0&&d>0){for(a=d%s||s,f=h.substr(0,a);a<d;a+=s)f+=c+h.substr(a,s);l>0&&(f+=c+h.slice(a)),g&&(f="-"+f);}n=p?f+(r.decimalSeparator||"")+((l=+r.fractionGroupSize)?p.replace(new RegExp("\\d{"+l+"}\\B","g"),"$&"+(r.fractionGroupSeparator||"")):p):f;}return (r.prefix||"")+n+(r.suffix||"")},E.toFraction=function(e){var t,n,i,a,u,s,c,p,g,h,m,y,b=this,v=b.c;if(null!=e&&(!(c=new q(e)).isInteger()&&(c.c||1!==c.s)||c.lt(A)))throw Error(o+"Argument "+(c.isInteger()?"out of range: ":"not an integer: ")+Y(c));if(!v)return new q(b);for(t=new q(A),g=n=new q(A),i=p=new q(A),y=d(v),u=t.e=y.length-b.e-1,t.c[0]=f[(s=u%l)<0?l+s:s],e=!e||c.comparedTo(t)>0?u>0?t:g:c,s=C,C=1/0,c=new q(y),p.c[0]=0;h=r(c,t,0,1),1!=(a=n.plus(h.times(i))).comparedTo(e);)n=i,i=a,g=p.plus(h.times(a=g)),p=a,t=c.minus(h.times(a=t)),c=a;return a=r(e.minus(n),i,0,1),p=p.plus(a.times(g)),n=n.plus(a.times(i)),p.s=g.s=b.s,m=r(g,i,u*=2,k).minus(b).abs().comparedTo(r(p,n,u,k).minus(b).abs())<1?[g,i]:[p,n],C=s,m},E.toNumber=function(){return +Y(this)},E.toPrecision=function(e,t){return null!=e&&y(e,1,g),Z(this,e,t,2)},E.toString=function(e){var t,r=this,n=r.s,i=r.e;return null===i?n?(t="Infinity",n<0&&(t="-"+t)):t="NaN":(null==e?t=i<=L||i>=P?v(d(r.c),i):w(d(r.c),i,"0"):10===e&&V?t=w(d((r=H(new q(r),_+i+1,k)).c),r.e,"0"):(y(e,2,G.length,"Base"),t=O(w(d(r.c),i,"0"),10,e,n,true)),n<0&&r.c[0]&&(t="-"+t)),t},E.valueOf=E.toJSON=function(){return Y(this)},E._isBigNumber=true,null!=t&&q.set(t),q}(),r.default=r.BigNumber=r,e.exports?e.exports=r:(t||(t="undefined"!=typeof self&&self?self:window),t.BigNumber=r);}(o);}(m);var y=m.exports;
|
|
61328
|
+
function d(e,t){e.forEach((e=>{let r;try{r=function(e){throw new Error('Could not dynamically require "'+e+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}(`../languages/${e}`);}catch(t){console.error(`Unable to load "${e}". No matching language file found.`);}r&&t.registerLanguage(r);}));}var m={exports:{}};!function(e){!function(t){var r,n=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,i=Math.ceil,a=Math.floor,o="[BigNumber Error] ",u=o+"Number primitive has more than 15 significant digits: ",s=1e14,l=14,c=9007199254740991,f=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],p=1e7,g=1e9;function h(e){var t=0|e;return e>0||e===t?t:t-1}function d(e){for(var t,r,n=1,i=e.length,a=e[0]+"";n<i;){for(t=e[n++]+"",r=l-t.length;r--;t="0"+t);a+=t;}for(i=a.length;48===a.charCodeAt(--i););return a.slice(0,i+1||1)}function m(e,t){var r,n,i=e.c,a=t.c,o=e.s,u=t.s,s=e.e,l=t.e;if(!o||!u)return null;if(r=i&&!i[0],n=a&&!a[0],r||n)return r?n?0:-u:o;if(o!=u)return o;if(r=o<0,n=s==l,!i||!a)return n?0:!i^r?1:-1;if(!n)return s>l^r?1:-1;for(u=(s=i.length)<(l=a.length)?s:l,o=0;o<u;o++)if(i[o]!=a[o])return i[o]>a[o]^r?1:-1;return s==l?0:s>l^r?1:-1}function y(e,t,r,n){if(e<t||e>r||e!==a(e))throw Error(o+(n||"Argument")+("number"==typeof e?e<t||e>r?" out of range: ":" not an integer: ":" not a primitive number: ")+String(e))}function b(e){var t=e.c.length-1;return h(e.e/l)==t&&e.c[t]%2!=0}function v(e,t){return (e.length>1?e.charAt(0)+"."+e.slice(1):e)+(t<0?"e":"e+")+t}function w(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}r=function e(t){var r,O,x,S,N,$,B,M,D,F,E=q.prototype={constructor:q,toString:null,valueOf:null},A=new q(1),_=20,k=4,L=-7,P=21,T=-1e7,C=1e7,j=false,U=1,R=0,I={prefix:"",groupSize:3,secondaryGroupSize:0,groupSeparator:",",decimalSeparator:".",fractionGroupSize:0,fractionGroupSeparator:" ",suffix:""},G="0123456789abcdefghijklmnopqrstuvwxyz",V=true;function q(e,t){var r,i,o,s,f,p,g,h,d=this;if(!(d instanceof q))return new q(e,t);if(null==t){if(e&&true===e._isBigNumber)return d.s=e.s,void(!e.c||e.e>C?d.c=d.e=null:e.e<T?d.c=[d.e=0]:(d.e=e.e,d.c=e.c.slice()));if((p="number"==typeof e)&&0*e==0){if(d.s=1/e<0?(e=-e,-1):1,e===~~e){for(s=0,f=e;f>=10;f/=10,s++);return void(s>C?d.c=d.e=null:(d.e=s,d.c=[e]))}h=String(e);}else {if(!n.test(h=String(e)))return x(d,h,p);d.s=45==h.charCodeAt(0)?(h=h.slice(1),-1):1;}(s=h.indexOf("."))>-1&&(h=h.replace(".","")),(f=h.search(/e/i))>0?(s<0&&(s=f),s+=+h.slice(f+1),h=h.substring(0,f)):s<0&&(s=h.length);}else {if(y(t,2,G.length,"Base"),10==t&&V)return H(d=new q(e),_+d.e+1,k);if(h=String(e),p="number"==typeof e){if(0*e!=0)return x(d,h,p,t);if(d.s=1/e<0?(h=h.slice(1),-1):1,q.DEBUG&&h.replace(/^0\.0*|\./,"").length>15)throw Error(u+e)}else d.s=45===h.charCodeAt(0)?(h=h.slice(1),-1):1;for(r=G.slice(0,t),s=f=0,g=h.length;f<g;f++)if(r.indexOf(i=h.charAt(f))<0){if("."==i){if(f>s){s=g;continue}}else if(!o&&(h==h.toUpperCase()&&(h=h.toLowerCase())||h==h.toLowerCase()&&(h=h.toUpperCase()))){o=true,f=-1,s=0;continue}return x(d,String(e),p,t)}p=false,(s=(h=O(h,t,10,d.s)).indexOf("."))>-1?h=h.replace(".",""):s=h.length;}for(f=0;48===h.charCodeAt(f);f++);for(g=h.length;48===h.charCodeAt(--g););if(h=h.slice(f,++g)){if(g-=f,p&&q.DEBUG&&g>15&&(e>c||e!==a(e)))throw Error(u+d.s*e);if((s=s-f-1)>C)d.c=d.e=null;else if(s<T)d.c=[d.e=0];else {if(d.e=s,d.c=[],f=(s+1)%l,s<0&&(f+=l),f<g){for(f&&d.c.push(+h.slice(0,f)),g-=l;f<g;)d.c.push(+h.slice(f,f+=l));f=l-(h=h.slice(f)).length;}else f-=g;for(;f--;h+="0");d.c.push(+h);}}else d.c=[d.e=0];}function Z(e,t,r,n){var i,a,o,u,s;if(null==r?r=k:y(r,0,8),!e.c)return e.toString();if(i=e.c[0],o=e.e,null==t)s=d(e.c),s=1==n||2==n&&(o<=L||o>=P)?v(s,o):w(s,o,"0");else if(a=(e=H(new q(e),t,r)).e,u=(s=d(e.c)).length,1==n||2==n&&(t<=a||a<=L)){for(;u<t;s+="0",u++);s=v(s,a);}else if(t-=o,s=w(s,a,"0"),a+1>u){if(--t>0)for(s+=".";t--;s+="0");}else if((t+=a-u)>0)for(a+1==u&&(s+=".");t--;s+="0");return e.s<0&&i?"-"+s:s}function z(e,t){for(var r,n,i=1,a=new q(e[0]);i<e.length;i++)(!(n=new q(e[i])).s||(r=m(a,n))===t||0===r&&a.s===t)&&(a=n);return a}function W(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+r*l-1)>C?e.c=e.e=null:r<T?e.c=[e.e=0]:(e.e=r,e.c=t),e}function H(e,t,r,n){var o,u,c,p,g,h,d,m=e.c,y=f;if(m){e:{for(o=1,p=m[0];p>=10;p/=10,o++);if((u=t-o)<0)u+=l,c=t,g=m[h=0],d=a(g/y[o-c-1]%10);else if((h=i((u+1)/l))>=m.length){if(!n)break e;for(;m.length<=h;m.push(0));g=d=0,o=1,c=(u%=l)-l+1;}else {for(g=p=m[h],o=1;p>=10;p/=10,o++);d=(c=(u%=l)-l+o)<0?0:a(g/y[o-c-1]%10);}if(n=n||t<0||null!=m[h+1]||(c<0?g:g%y[o-c-1]),n=r<4?(d||n)&&(0==r||r==(e.s<0?3:2)):d>5||5==d&&(4==r||n||6==r&&(u>0?c>0?g/y[o-c]:0:m[h-1])%10&1||r==(e.s<0?8:7)),t<1||!m[0])return m.length=0,n?(t-=e.e+1,m[0]=y[(l-t%l)%l],e.e=-t||0):m[0]=e.e=0,e;if(0==u?(m.length=h,p=1,h--):(m.length=h+1,p=y[l-u],m[h]=c>0?a(g/y[o-c]%y[c])*p:0),n)for(;;){if(0==h){for(u=1,c=m[0];c>=10;c/=10,u++);for(c=m[0]+=p,p=1;c>=10;c/=10,p++);u!=p&&(e.e++,m[0]==s&&(m[0]=1));break}if(m[h]+=p,m[h]!=s)break;m[h--]=0,p=1;}for(u=m.length;0===m[--u];m.pop());}e.e>C?e.c=e.e=null:e.e<T&&(e.c=[e.e=0]);}return e}function Y(e){var t,r=e.e;return null===r?e.toString():(t=d(e.c),t=r<=L||r>=P?v(t,r):w(t,r,"0"),e.s<0?"-"+t:t)}return q.clone=e,q.ROUND_UP=0,q.ROUND_DOWN=1,q.ROUND_CEIL=2,q.ROUND_FLOOR=3,q.ROUND_HALF_UP=4,q.ROUND_HALF_DOWN=5,q.ROUND_HALF_EVEN=6,q.ROUND_HALF_CEIL=7,q.ROUND_HALF_FLOOR=8,q.EUCLID=9,q.config=q.set=function(e){var t,r;if(null!=e){if("object"!=typeof e)throw Error(o+"Object expected: "+e);if(e.hasOwnProperty(t="DECIMAL_PLACES")&&(y(r=e[t],0,g,t),_=r),e.hasOwnProperty(t="ROUNDING_MODE")&&(y(r=e[t],0,8,t),k=r),e.hasOwnProperty(t="EXPONENTIAL_AT")&&((r=e[t])&&r.pop?(y(r[0],-g,0,t),y(r[1],0,g,t),L=r[0],P=r[1]):(y(r,-g,g,t),L=-(P=r<0?-r:r))),e.hasOwnProperty(t="RANGE"))if((r=e[t])&&r.pop)y(r[0],-g,-1,t),y(r[1],1,g,t),T=r[0],C=r[1];else {if(y(r,-g,g,t),!r)throw Error(o+t+" cannot be zero: "+r);T=-(C=r<0?-r:r);}if(e.hasOwnProperty(t="CRYPTO")){if((r=e[t])!==!!r)throw Error(o+t+" not true or false: "+r);if(r){if("undefined"==typeof crypto||!crypto||!crypto.getRandomValues&&!crypto.randomBytes)throw j=!r,Error(o+"crypto unavailable");j=r;}else j=r;}if(e.hasOwnProperty(t="MODULO_MODE")&&(y(r=e[t],0,9,t),U=r),e.hasOwnProperty(t="POW_PRECISION")&&(y(r=e[t],0,g,t),R=r),e.hasOwnProperty(t="FORMAT")){if("object"!=typeof(r=e[t]))throw Error(o+t+" not an object: "+r);I=r;}if(e.hasOwnProperty(t="ALPHABET")){if("string"!=typeof(r=e[t])||/^.?$|[+\-.\s]|(.).*\1/.test(r))throw Error(o+t+" invalid: "+r);V="0123456789"==r.slice(0,10),G=r;}}return {DECIMAL_PLACES:_,ROUNDING_MODE:k,EXPONENTIAL_AT:[L,P],RANGE:[T,C],CRYPTO:j,MODULO_MODE:U,POW_PRECISION:R,FORMAT:I,ALPHABET:G}},q.isBigNumber=function(e){if(!e||true!==e._isBigNumber)return false;if(!q.DEBUG)return true;var t,r,n=e.c,i=e.e,u=e.s;e:if("[object Array]"=={}.toString.call(n)){if((1===u||-1===u)&&i>=-g&&i<=g&&i===a(i)){if(0===n[0]){if(0===i&&1===n.length)return true;break e}if((t=(i+1)%l)<1&&(t+=l),String(n[0]).length==t){for(t=0;t<n.length;t++)if((r=n[t])<0||r>=s||r!==a(r))break e;if(0!==r)return true}}}else if(null===n&&null===i&&(null===u||1===u||-1===u))return true;throw Error(o+"Invalid BigNumber: "+e)},q.maximum=q.max=function(){return z(arguments,-1)},q.minimum=q.min=function(){return z(arguments,1)},q.random=(S=9007199254740992,N=Math.random()*S&2097151?function(){return a(Math.random()*S)}:function(){return 8388608*(1073741824*Math.random()|0)+(8388608*Math.random()|0)},function(e){var t,r,n,u,s,c=0,p=[],h=new q(A);if(null==e?e=_:y(e,0,g),u=i(e/l),j)if(crypto.getRandomValues){for(t=crypto.getRandomValues(new Uint32Array(u*=2));c<u;)(s=131072*t[c]+(t[c+1]>>>11))>=9e15?(r=crypto.getRandomValues(new Uint32Array(2)),t[c]=r[0],t[c+1]=r[1]):(p.push(s%1e14),c+=2);c=u/2;}else {if(!crypto.randomBytes)throw j=false,Error(o+"crypto unavailable");for(t=crypto.randomBytes(u*=7);c<u;)(s=281474976710656*(31&t[c])+1099511627776*t[c+1]+4294967296*t[c+2]+16777216*t[c+3]+(t[c+4]<<16)+(t[c+5]<<8)+t[c+6])>=9e15?crypto.randomBytes(7).copy(t,c):(p.push(s%1e14),c+=7);c=u/7;}if(!j)for(;c<u;)(s=N())<9e15&&(p[c++]=s%1e14);for(u=p[--c],e%=l,u&&e&&(s=f[l-e],p[c]=a(u/s)*s);0===p[c];p.pop(),c--);if(c<0)p=[n=0];else {for(n=-1;0===p[0];p.splice(0,1),n-=l);for(c=1,s=p[0];s>=10;s/=10,c++);c<l&&(n-=l-c);}return h.e=n,h.c=p,h}),q.sum=function(){for(var e=1,t=arguments,r=new q(t[0]);e<t.length;)r=r.plus(t[e++]);return r},O=function(){var e="0123456789";function t(e,t,r,n){for(var i,a,o=[0],u=0,s=e.length;u<s;){for(a=o.length;a--;o[a]*=t);for(o[0]+=n.indexOf(e.charAt(u++)),i=0;i<o.length;i++)o[i]>r-1&&(null==o[i+1]&&(o[i+1]=0),o[i+1]+=o[i]/r|0,o[i]%=r);}return o.reverse()}return function(n,i,a,o,u){var s,l,c,f,p,g,h,m,y=n.indexOf("."),b=_,v=k;for(y>=0&&(f=R,R=0,n=n.replace(".",""),g=(m=new q(i)).pow(n.length-y),R=f,m.c=t(w(d(g.c),g.e,"0"),10,a,e),m.e=m.c.length),c=f=(h=t(n,i,a,u?(s=G,e):(s=e,G))).length;0==h[--f];h.pop());if(!h[0])return s.charAt(0);if(y<0?--c:(g.c=h,g.e=c,g.s=o,h=(g=r(g,m,b,v,a)).c,p=g.r,c=g.e),y=h[l=c+b+1],f=a/2,p=p||l<0||null!=h[l+1],p=v<4?(null!=y||p)&&(0==v||v==(g.s<0?3:2)):y>f||y==f&&(4==v||p||6==v&&1&h[l-1]||v==(g.s<0?8:7)),l<1||!h[0])n=p?w(s.charAt(1),-b,s.charAt(0)):s.charAt(0);else {if(h.length=l,p)for(--a;++h[--l]>a;)h[l]=0,l||(++c,h=[1].concat(h));for(f=h.length;!h[--f];);for(y=0,n="";y<=f;n+=s.charAt(h[y++]));n=w(n,c,s.charAt(0));}return n}}(),r=function(){function e(e,t,r){var n,i,a,o,u=0,s=e.length,l=t%p,c=t/p|0;for(e=e.slice();s--;)u=((i=l*(a=e[s]%p)+(n=c*a+(o=e[s]/p|0)*l)%p*p+u)/r|0)+(n/p|0)+c*o,e[s]=i%r;return u&&(e=[u].concat(e)),e}function t(e,t,r,n){var i,a;if(r!=n)a=r>n?1:-1;else for(i=a=0;i<r;i++)if(e[i]!=t[i]){a=e[i]>t[i]?1:-1;break}return a}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,u,c){var f,p,g,d,m,y,b,v,w,O,x,S,N,$,B,M,D,F=n.s==i.s?1:-1,E=n.c,A=i.c;if(!(E&&E[0]&&A&&A[0]))return new q(n.s&&i.s&&(E?!A||E[0]!=A[0]:A)?E&&0==E[0]||!A?0*F:F/0:NaN);for(w=(v=new q(F)).c=[],F=o+(p=n.e-i.e)+1,c||(c=s,p=h(n.e/l)-h(i.e/l),F=F/l|0),g=0;A[g]==(E[g]||0);g++);if(A[g]>(E[g]||0)&&p--,F<0)w.push(1),d=true;else {for($=E.length,M=A.length,g=0,F+=2,(m=a(c/(A[0]+1)))>1&&(A=e(A,m,c),E=e(E,m,c),M=A.length,$=E.length),N=M,x=(O=E.slice(0,M)).length;x<M;O[x++]=0);D=A.slice(),D=[0].concat(D),B=A[0],A[1]>=c/2&&B++;do{if(m=0,(f=t(A,O,M,x))<0){if(S=O[0],M!=x&&(S=S*c+(O[1]||0)),(m=a(S/B))>1)for(m>=c&&(m=c-1),b=(y=e(A,m,c)).length,x=O.length;1==t(y,O,b,x);)m--,r(y,M<b?D:A,b,c),b=y.length,f=1;else 0==m&&(f=m=1),b=(y=A.slice()).length;if(b<x&&(y=[0].concat(y)),r(O,y,x,c),x=O.length,-1==f)for(;t(A,O,M,x)<1;)m++,r(O,M<x?D:A,x,c),x=O.length;}else 0===f&&(m++,O=[0]);w[g++]=m,O[0]?O[x++]=E[N]||0:(O=[E[N]],x=1);}while((N++<$||null!=O[0])&&F--);d=null!=O[0],w[0]||w.splice(0,1);}if(c==s){for(g=1,F=w[0];F>=10;F/=10,g++);H(v,o+(v.e=g+p*l-1)+1,u,d);}else v.e=p,v.r=+d;return v}}(),$=/^(-?)0([xbo])(?=\w[\w.]*$)/i,B=/^([^.]+)\.$/,M=/^\.([^.]+)$/,D=/^-?(Infinity|NaN)$/,F=/^\s*\+(?=[\w.])|^\s+|\s+$/g,x=function(e,t,r,n){var i,a=r?t:t.replace(F,"");if(D.test(a))e.s=isNaN(a)?null:a<0?-1:1;else {if(!r&&(a=a.replace($,(function(e,t,r){return i="x"==(r=r.toLowerCase())?16:"b"==r?2:8,n&&n!=i?e:t})),n&&(i=n,a=a.replace(B,"$1").replace(M,"0.$1")),t!=a))return new q(a,i);if(q.DEBUG)throw Error(o+"Not a"+(n?" base "+n:"")+" number: "+t);e.s=null;}e.c=e.e=null;},E.absoluteValue=E.abs=function(){var e=new q(this);return e.s<0&&(e.s=1),e},E.comparedTo=function(e,t){return m(this,new q(e,t))},E.decimalPlaces=E.dp=function(e,t){var r,n,i,a=this;if(null!=e)return y(e,0,g),null==t?t=k:y(t,0,8),H(new q(a),e+a.e+1,t);if(!(r=a.c))return null;if(n=((i=r.length-1)-h(this.e/l))*l,i=r[i])for(;i%10==0;i/=10,n--);return n<0&&(n=0),n},E.dividedBy=E.div=function(e,t){return r(this,new q(e,t),_,k)},E.dividedToIntegerBy=E.idiv=function(e,t){return r(this,new q(e,t),0,1)},E.exponentiatedBy=E.pow=function(e,t){var r,n,u,s,c,f,p,g,h=this;if((e=new q(e)).c&&!e.isInteger())throw Error(o+"Exponent not an integer: "+Y(e));if(null!=t&&(t=new q(t)),c=e.e>14,!h.c||!h.c[0]||1==h.c[0]&&!h.e&&1==h.c.length||!e.c||!e.c[0])return g=new q(Math.pow(+Y(h),c?e.s*(2-b(e)):+Y(e))),t?g.mod(t):g;if(f=e.s<0,t){if(t.c?!t.c[0]:!t.s)return new q(NaN);(n=!f&&h.isInteger()&&t.isInteger())&&(h=h.mod(t));}else {if(e.e>9&&(h.e>0||h.e<-1||(0==h.e?h.c[0]>1||c&&h.c[1]>=24e7:h.c[0]<8e13||c&&h.c[0]<=9999975e7)))return s=h.s<0&&b(e)?-0:0,h.e>-1&&(s=1/s),new q(f?1/s:s);R&&(s=i(R/l+2));}for(c?(r=new q(.5),f&&(e.s=1),p=b(e)):p=(u=Math.abs(+Y(e)))%2,g=new q(A);;){if(p){if(!(g=g.times(h)).c)break;s?g.c.length>s&&(g.c.length=s):n&&(g=g.mod(t));}if(u){if(0===(u=a(u/2)))break;p=u%2;}else if(H(e=e.times(r),e.e+1,1),e.e>14)p=b(e);else {if(0===(u=+Y(e)))break;p=u%2;}h=h.times(h),s?h.c&&h.c.length>s&&(h.c.length=s):n&&(h=h.mod(t));}return n?g:(f&&(g=A.div(g)),t?g.mod(t):s?H(g,R,k,undefined):g)},E.integerValue=function(e){var t=new q(this);return null==e?e=k:y(e,0,8),H(t,t.e+1,e)},E.isEqualTo=E.eq=function(e,t){return 0===m(this,new q(e,t))},E.isFinite=function(){return !!this.c},E.isGreaterThan=E.gt=function(e,t){return m(this,new q(e,t))>0},E.isGreaterThanOrEqualTo=E.gte=function(e,t){return 1===(t=m(this,new q(e,t)))||0===t},E.isInteger=function(){return !!this.c&&h(this.e/l)>this.c.length-2},E.isLessThan=E.lt=function(e,t){return m(this,new q(e,t))<0},E.isLessThanOrEqualTo=E.lte=function(e,t){return -1===(t=m(this,new q(e,t)))||0===t},E.isNaN=function(){return !this.s},E.isNegative=function(){return this.s<0},E.isPositive=function(){return this.s>0},E.isZero=function(){return !!this.c&&0==this.c[0]},E.minus=function(e,t){var r,n,i,a,o=this,u=o.s;if(t=(e=new q(e,t)).s,!u||!t)return new q(NaN);if(u!=t)return e.s=-t,o.plus(e);var c=o.e/l,f=e.e/l,p=o.c,g=e.c;if(!c||!f){if(!p||!g)return p?(e.s=-t,e):new q(g?o:NaN);if(!p[0]||!g[0])return g[0]?(e.s=-t,e):new q(p[0]?o:3==k?-0:0)}if(c=h(c),f=h(f),p=p.slice(),u=c-f){for((a=u<0)?(u=-u,i=p):(f=c,i=g),i.reverse(),t=u;t--;i.push(0));i.reverse();}else for(n=(a=(u=p.length)<(t=g.length))?u:t,u=t=0;t<n;t++)if(p[t]!=g[t]){a=p[t]<g[t];break}if(a&&(i=p,p=g,g=i,e.s=-e.s),(t=(n=g.length)-(r=p.length))>0)for(;t--;p[r++]=0);for(t=s-1;n>u;){if(p[--n]<g[n]){for(r=n;r&&!p[--r];p[r]=t);--p[r],p[n]+=s;}p[n]-=g[n];}for(;0==p[0];p.splice(0,1),--f);return p[0]?W(e,p,f):(e.s=3==k?-1:1,e.c=[e.e=0],e)},E.modulo=E.mod=function(e,t){var n,i,a=this;return e=new q(e,t),!a.c||!e.s||e.c&&!e.c[0]?new q(NaN):!e.c||a.c&&!a.c[0]?new q(a):(9==U?(i=e.s,e.s=1,n=r(a,e,0,3),e.s=i,n.s*=i):n=r(a,e,0,U),(e=a.minus(n.times(e))).c[0]||1!=U||(e.s=a.s),e)},E.multipliedBy=E.times=function(e,t){var r,n,i,a,o,u,c,f,g,d,m,y,b,v,w,O=this,x=O.c,S=(e=new q(e,t)).c;if(!(x&&S&&x[0]&&S[0]))return !O.s||!e.s||x&&!x[0]&&!S||S&&!S[0]&&!x?e.c=e.e=e.s=null:(e.s*=O.s,x&&S?(e.c=[0],e.e=0):e.c=e.e=null),e;for(n=h(O.e/l)+h(e.e/l),e.s*=O.s,(c=x.length)<(d=S.length)&&(b=x,x=S,S=b,i=c,c=d,d=i),i=c+d,b=[];i--;b.push(0));for(v=s,w=p,i=d;--i>=0;){for(r=0,m=S[i]%w,y=S[i]/w|0,a=i+(o=c);a>i;)r=((f=m*(f=x[--o]%w)+(u=y*f+(g=x[o]/w|0)*m)%w*w+b[a]+r)/v|0)+(u/w|0)+y*g,b[a--]=f%v;b[a]=r;}return r?++n:b.splice(0,1),W(e,b,n)},E.negated=function(){var e=new q(this);return e.s=-e.s||null,e},E.plus=function(e,t){var r,n=this,i=n.s;if(t=(e=new q(e,t)).s,!i||!t)return new q(NaN);if(i!=t)return e.s=-t,n.minus(e);var a=n.e/l,o=e.e/l,u=n.c,c=e.c;if(!a||!o){if(!u||!c)return new q(i/0);if(!u[0]||!c[0])return c[0]?e:new q(u[0]?n:0*i)}if(a=h(a),o=h(o),u=u.slice(),i=a-o){for(i>0?(o=a,r=c):(i=-i,r=u),r.reverse();i--;r.push(0));r.reverse();}for((i=u.length)-(t=c.length)<0&&(r=c,c=u,u=r,t=i),i=0;t;)i=(u[--t]=u[t]+c[t]+i)/s|0,u[t]=s===u[t]?0:u[t]%s;return i&&(u=[i].concat(u),++o),W(e,u,o)},E.precision=E.sd=function(e,t){var r,n,i,a=this;if(null!=e&&e!==!!e)return y(e,1,g),null==t?t=k:y(t,0,8),H(new q(a),e,t);if(!(r=a.c))return null;if(n=(i=r.length-1)*l+1,i=r[i]){for(;i%10==0;i/=10,n--);for(i=r[0];i>=10;i/=10,n++);}return e&&a.e+1>n&&(n=a.e+1),n},E.shiftedBy=function(e){return y(e,-9007199254740991,c),this.times("1e"+e)},E.squareRoot=E.sqrt=function(){var e,t,n,i,a,o=this,u=o.c,s=o.s,l=o.e,c=_+4,f=new q("0.5");if(1!==s||!u||!u[0])return new q(!s||s<0&&(!u||u[0])?NaN:u?o:1/0);if(0==(s=Math.sqrt(+Y(o)))||s==1/0?(((t=d(u)).length+l)%2==0&&(t+="0"),s=Math.sqrt(+t),l=h((l+1)/2)-(l<0||l%2),n=new q(t=s==1/0?"5e"+l:(t=s.toExponential()).slice(0,t.indexOf("e")+1)+l)):n=new q(s+""),n.c[0])for((s=(l=n.e)+c)<3&&(s=0);;)if(a=n,n=f.times(a.plus(r(o,a,c,1))),d(a.c).slice(0,s)===(t=d(n.c)).slice(0,s)){if(n.e<l&&--s,"9999"!=(t=t.slice(s-3,s+1))&&(i||"4999"!=t)){+t&&(+t.slice(1)||"5"!=t.charAt(0))||(H(n,n.e+_+2,1),e=!n.times(n).eq(o));break}if(!i&&(H(a,a.e+_+2,0),a.times(a).eq(o))){n=a;break}c+=4,s+=4,i=1;}return H(n,n.e+_+1,k,e)},E.toExponential=function(e,t){return null!=e&&(y(e,0,g),e++),Z(this,e,t,1)},E.toFixed=function(e,t){return null!=e&&(y(e,0,g),e=e+this.e+1),Z(this,e,t)},E.toFormat=function(e,t,r){var n,i=this;if(null==r)null!=e&&t&&"object"==typeof t?(r=t,t=null):e&&"object"==typeof e?(r=e,e=t=null):r=I;else if("object"!=typeof r)throw Error(o+"Argument not an object: "+r);if(n=i.toFixed(e,t),i.c){var a,u=n.split("."),s=+r.groupSize,l=+r.secondaryGroupSize,c=r.groupSeparator||"",f=u[0],p=u[1],g=i.s<0,h=g?f.slice(1):f,d=h.length;if(l&&(a=s,s=l,l=a,d-=a),s>0&&d>0){for(a=d%s||s,f=h.substr(0,a);a<d;a+=s)f+=c+h.substr(a,s);l>0&&(f+=c+h.slice(a)),g&&(f="-"+f);}n=p?f+(r.decimalSeparator||"")+((l=+r.fractionGroupSize)?p.replace(new RegExp("\\d{"+l+"}\\B","g"),"$&"+(r.fractionGroupSeparator||"")):p):f;}return (r.prefix||"")+n+(r.suffix||"")},E.toFraction=function(e){var t,n,i,a,u,s,c,p,g,h,m,y,b=this,v=b.c;if(null!=e&&(!(c=new q(e)).isInteger()&&(c.c||1!==c.s)||c.lt(A)))throw Error(o+"Argument "+(c.isInteger()?"out of range: ":"not an integer: ")+Y(c));if(!v)return new q(b);for(t=new q(A),g=n=new q(A),i=p=new q(A),y=d(v),u=t.e=y.length-b.e-1,t.c[0]=f[(s=u%l)<0?l+s:s],e=!e||c.comparedTo(t)>0?u>0?t:g:c,s=C,C=1/0,c=new q(y),p.c[0]=0;h=r(c,t,0,1),1!=(a=n.plus(h.times(i))).comparedTo(e);)n=i,i=a,g=p.plus(h.times(a=g)),p=a,t=c.minus(h.times(a=t)),c=a;return a=r(e.minus(n),i,0,1),p=p.plus(a.times(g)),n=n.plus(a.times(i)),p.s=g.s=b.s,m=r(g,i,u*=2,k).minus(b).abs().comparedTo(r(p,n,u,k).minus(b).abs())<1?[g,i]:[p,n],C=s,m},E.toNumber=function(){return +Y(this)},E.toPrecision=function(e,t){return null!=e&&y(e,1,g),Z(this,e,t,2)},E.toString=function(e){var t,r=this,n=r.s,i=r.e;return null===i?n?(t="Infinity",n<0&&(t="-"+t)):t="NaN":(null==e?t=i<=L||i>=P?v(d(r.c),i):w(d(r.c),i,"0"):10===e&&V?t=w(d((r=H(new q(r),_+i+1,k)).c),r.e,"0"):(y(e,2,G.length,"Base"),t=O(w(d(r.c),i,"0"),10,e,n,true)),n<0&&r.c[0]&&(t="-"+t)),t},E.valueOf=E.toJSON=function(){return Y(this)},E._isBigNumber=true,null!=t&&q.set(t),q}(),r.default=r.BigNumber=r,e.exports?e.exports=r:(t||(t="undefined"!=typeof self&&self?self:window),t.BigNumber=r);}(o);}(m);var y=m.exports;
|
|
61329
61329
|
/*!
|
|
61330
61330
|
* Copyright (c) 2017 Benjamin Van Ryseghem<benjamin@vanryseghem.com>
|
|
61331
61331
|
*
|
|
@@ -78178,7 +78178,7 @@ const useApproval = (amount, currency, spender, account, chainId) => {
|
|
|
78178
78178
|
return [approvalState !== null && approvalState !== void 0 ? approvalState : ApprovalState.NOT_APPROVED, handleApprove];
|
|
78179
78179
|
};
|
|
78180
78180
|
|
|
78181
|
-
const version$1 = '2.
|
|
78181
|
+
const version$1 = '2.31.0';
|
|
78182
78182
|
|
|
78183
78183
|
let errorConfig = {
|
|
78184
78184
|
getDocsUrl: ({ docsBaseUrl, docsPath = '', docsSlug, }) => docsPath
|
|
@@ -78866,8 +78866,9 @@ const ProgressBarWrapper = ({ title, value, style, showTooltip, toolTipPlacement
|
|
|
78866
78866
|
var ProgressBarWrapper$1 = React__default.memo(ProgressBarWrapper);
|
|
78867
78867
|
|
|
78868
78868
|
const BondCards$1 = ({ bondData }) => {
|
|
78869
|
-
var _a, _b;
|
|
78869
|
+
var _a, _b, _c;
|
|
78870
78870
|
const isMobile = useIsMobile();
|
|
78871
|
+
const SDKConfig = useSDKConfig();
|
|
78871
78872
|
return (jsxs("div", { className: "bonds-cards", children: [jsxs("div", { className: "bond-card-block", sx: {
|
|
78872
78873
|
borderRadius: ['0px', '0px', '0px', 'normal'],
|
|
78873
78874
|
'&:first-of-type': {
|
|
@@ -78878,7 +78879,7 @@ const BondCards$1 = ({ bondData }) => {
|
|
|
78878
78879
|
borderBottomRightRadius: 'normal',
|
|
78879
78880
|
borderBottomLeftRadius: 'normal',
|
|
78880
78881
|
},
|
|
78881
|
-
}, children: [jsxs(Flex, { className: "bond-card-title", children: [
|
|
78882
|
+
}, children: [jsxs(Flex, { className: "bond-card-title", children: [SDKConfig.namingPreference, jsx$2(TooltipBubble, { className: "tooltip-bubble", body: jsx$2(Flex, { children: TooltipText.Discount }), width: "230px", placement: "bottomLeft", transformTip: "translate(-5%, -5%)", children: jsx$2("div", { className: "bond-card-tooltip", children: jsx$2(Svg, { icon: "questionCircle", width: "12px" }) }) })] }), jsx$2(BonusComponent, { trueBondPrices: SDKConfig.namingPreference !== 'Discount' ? bondData.trueBondPrices : undefined, minTier: bondData.minTier, tooltipPosition: isMobile ? 'bottomRight' : 'bottomLeft', bonus: SDKConfig.namingPreference === 'Discount' ? `${(_a = bondData === null || bondData === void 0 ? void 0 : bondData.discountWithFee) === null || _a === void 0 ? void 0 : _a.toFixed(2)}%` : undefined })] }), jsxs("div", { className: "bond-card-block", sx: {
|
|
78882
78883
|
borderRadius: ['0px', '0px', '0px', 'normal'],
|
|
78883
78884
|
'&:first-of-type': {
|
|
78884
78885
|
borderTopRightRadius: 'normal',
|
|
@@ -78898,7 +78899,7 @@ const BondCards$1 = ({ bondData }) => {
|
|
|
78898
78899
|
borderBottomRightRadius: 'normal',
|
|
78899
78900
|
borderBottomLeftRadius: 'normal',
|
|
78900
78901
|
},
|
|
78901
|
-
}, children: [jsxs("div", { className: "bond-card-title", children: ["Max Buy", jsx$2(TooltipBubble, { className: "tooltip-bubble", body: jsx$2(Flex, { children: TooltipText.MaxBuy((
|
|
78902
|
+
}, children: [jsxs("div", { className: "bond-card-title", children: ["Max Buy", jsx$2(TooltipBubble, { className: "tooltip-bubble", body: jsx$2(Flex, { children: TooltipText.MaxBuy((_b = bondData === null || bondData === void 0 ? void 0 : bondData.earnToken) === null || _b === void 0 ? void 0 : _b.symbol) }), width: "230px", placement: "bottomLeft", transformTip: "translate(-5%, -5%)", children: jsx$2("div", { className: "bond-card-tooltip", children: jsx$2(Svg, { icon: "questionCircle", width: "12px" }) }) })] }), jsxs("div", { className: "bond-card-content", children: [jsx$2("div", { style: { paddingRight: '3px' }, children: jsx$2(TokenImage, { symbol: (_c = bondData.showcaseTokenName) !== null && _c !== void 0 ? _c : bondData.earnToken.symbol, size: 20 }) }), formatNumberSI(maxBuy(bondData, SDKConfig.showLowValueBonds).toFixed(0), 2)] })] }), jsxs("div", { className: "bond-card-block", sx: {
|
|
78902
78903
|
borderRadius: ['0px', '0px', '0px', 'normal'],
|
|
78903
78904
|
'&:first-of-type': {
|
|
78904
78905
|
borderTopRightRadius: 'normal',
|
|
@@ -79361,7 +79362,7 @@ const BuyBond = ({ onDismiss, bondAddress, bondChain, handlePurchasedBond, isPro
|
|
|
79361
79362
|
// Validations
|
|
79362
79363
|
const isGoldRush = ((_f = bondData === null || bondData === void 0 ? void 0 : bondData.billArt) === null || _f === void 0 ? void 0 : _f.collection) === types.BillArtCollection.GoldenTicket_Collection1;
|
|
79363
79364
|
const zapEnabled = supportedByLIFI.includes(bondData === null || bondData === void 0 ? void 0 : bondData.chainId);
|
|
79364
|
-
const exceedsMaxBuy = maxBuy(bondData).lt(getPayoutAmount(bondData, depositAmount, userPoints !== null && userPoints !== void 0 ? userPoints : '0'));
|
|
79365
|
+
const exceedsMaxBuy = maxBuy(bondData, SDKConfig.showLowValueBonds).lt(getPayoutAmount(bondData, depositAmount, userPoints !== null && userPoints !== void 0 ? userPoints : '0'));
|
|
79365
79366
|
const exceedsBalance = new BigNumber$1(inputCurrencyBalance !== null && inputCurrencyBalance !== void 0 ? inputCurrencyBalance : '0').lt(inputValue);
|
|
79366
79367
|
// Loading State
|
|
79367
79368
|
const [loadingTx, setLoadingTx] = useState(false);
|
|
@@ -80189,6 +80190,7 @@ const BannerTestnet = ({ chainId }) => {
|
|
|
80189
80190
|
|
|
80190
80191
|
const BondRowsWithTitle = ({ chain, bonds, showHotBonds }) => {
|
|
80191
80192
|
const key = chain;
|
|
80193
|
+
const { namingPreference } = useSDKConfig();
|
|
80192
80194
|
const [isOpen, setIsOpen] = useState(true);
|
|
80193
80195
|
return (jsx$2(Flex$1, { className: "bondrowswithtitle", children: jsxs(AnimatePresence, { initial: false, children: [jsx$2(Flex$1, { onClick: () => setIsOpen(!isOpen), sx: { cursor: 'pointer' }, children: jsx$2(ChainTitle, { chain: chain, pt: '5px', hideTitles: bonds.length <= 0, isOpen: isOpen }) }), bonds.length > 0 && isOpen && (jsxs(motion.div, { initial: { height: 0, overflow: 'hidden' }, animate: { height: 'fit-content', overflow: 'hidden', transitionEnd: { overflow: 'visible' } }, exit: { height: 0, overflow: 'hidden' }, sx: {
|
|
80194
80196
|
position: 'relative',
|
|
@@ -80196,7 +80198,7 @@ const BondRowsWithTitle = ({ chain, bonds, showHotBonds }) => {
|
|
|
80196
80198
|
width: '100%',
|
|
80197
80199
|
marginTop: '0px',
|
|
80198
80200
|
}, className: "bonds-card-container", children: [TESTNET_CHAINS.includes(chain) && jsx$2(BannerTestnet, { chainId: chain }), bonds === null || bonds === void 0 ? void 0 : bonds.map((bondFromMap, index) => {
|
|
80199
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x;
|
|
80201
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y;
|
|
80200
80202
|
if (bondFromMap.soldOut) {
|
|
80201
80203
|
const bond = bondFromMap;
|
|
80202
80204
|
return (jsx$2(BondRow, { bondAddress: (_a = bond.contractAddress) === null || _a === void 0 ? void 0 : _a[bond.chainId], bondChain: bond.chainId, payoutToken: bond.earnToken, billType: bond.billType, tag: (_b = bond.tags) === null || _b === void 0 ? void 0 : _b[0], bondSoldOut: true, percentageAvailable: 100, remainingTokensString: `${formatNumberSI(0, 0)} ${bond.earnToken.symbol} ($${formatNumberSI(0, 2)})`, vestingTermString: "-", projectURL: bond.projectLink, twitterURL: bond.twitter, auditURL: bond.audit }, `${bond.contractAddress}-${bond.chainId}-${index}`));
|
|
@@ -80219,7 +80221,7 @@ const BondRowsWithTitle = ({ chain, bonds, showHotBonds }) => {
|
|
|
80219
80221
|
const bond = bondFromMap;
|
|
80220
80222
|
const bondAddress = (_w = bond === null || bond === void 0 ? void 0 : bond.contractAddress) === null || _w === void 0 ? void 0 : _w[bond === null || bond === void 0 ? void 0 : bond.chainId];
|
|
80221
80223
|
const remainingTokensString = getRemainingTokensString(bond);
|
|
80222
|
-
return (jsx$2(BondRow, { bondAddress: bondAddress, bondChain: bond.chainId, payoutToken: bond.earnToken, billType: bond.billType, tag: (_x = bond.tags) === null || _x === void 0 ? void 0 : _x[0], trueBondPrices: bond.trueBondPrices, minTier: bond === null || bond === void 0 ? void 0 : bond.minTier, vestingTermString: getVestingTermsString(bond), vestingCliffString: getVestingTermsTooltipString(bond), percentageAvailable: remainingPercentage(bond), remainingTokensString: remainingTokensString, projectURL: bond.projectLink, twitterURL: bond.twitter, auditURL: bond.audit }, `${bondAddress}-${bond.chainId}-${index}`));
|
|
80224
|
+
return (jsx$2(BondRow, { bondAddress: bondAddress, bondChain: bond.chainId, payoutToken: bond.earnToken, billType: bond.billType, tag: (_x = bond.tags) === null || _x === void 0 ? void 0 : _x[0], trueBondPrices: namingPreference === 'Bonus' ? bond.trueBondPrices : undefined, minTier: bond === null || bond === void 0 ? void 0 : bond.minTier, vestingTermString: getVestingTermsString(bond), vestingCliffString: getVestingTermsTooltipString(bond), percentageAvailable: remainingPercentage(bond), remainingTokensString: remainingTokensString, projectURL: bond.projectLink, twitterURL: bond.twitter, auditURL: bond.audit, bonus: namingPreference === 'Discount' ? `${(_y = bond === null || bond === void 0 ? void 0 : bond.discountWithFee) === null || _y === void 0 ? void 0 : _y.toFixed(2)}%` : undefined }, `${bondAddress}-${bond.chainId}-${index}`));
|
|
80223
80225
|
}
|
|
80224
80226
|
}), showHotBonds && (jsx$2(SwiperProvider, { children: jsx$2(HotBondCards, {}) }))] }, key))] }) }, key));
|
|
80225
80227
|
};
|
|
@@ -80337,6 +80339,7 @@ const FavIcon = ({ filterOption, setFilterOption, }) => {
|
|
|
80337
80339
|
};
|
|
80338
80340
|
|
|
80339
80341
|
const BondsMenu = ({ searchQuery, setSearchQuery, setChainFilterOption, chainFilterOption, filterOptions, filterOption, setFilterOption, onSort, }) => {
|
|
80342
|
+
const { namingPreference } = useSDKConfig();
|
|
80340
80343
|
return (jsxs("div", { className: "bonds-menu", children: [jsx$2(BondFilters, { chainFilterOption: chainFilterOption !== null && chainFilterOption !== void 0 ? chainFilterOption : ['All Chains'], setChainFilterOption: setChainFilterOption, filterOptions: filterOptions, filterOption: filterOption, setFilterOption: setFilterOption, onHandleQueryChange: () => setSearchQuery('') }), jsxs("div", { className: "table-header-container", children: [jsx$2("div", { className: "search-container", children: jsxs(Flex$1, { sx: { width: '100%', maxWidth: '340px' }, children: [jsx$2(Input, { value: searchQuery, onChange: (event) => setSearchQuery(event.target.value), variant: "search", width: '100%', sx: {
|
|
80341
80344
|
fontWeight: 600,
|
|
80342
80345
|
background: 'white2',
|
|
@@ -80344,7 +80347,7 @@ const BondsMenu = ({ searchQuery, setSearchQuery, setChainFilterOption, chainFil
|
|
|
80344
80347
|
fontSize: '14px',
|
|
80345
80348
|
color: 'white',
|
|
80346
80349
|
width: ['calc(50vw - 25px)'],
|
|
80347
|
-
}, placeholder: 'Search...' }), jsx$2(FavIcon, { filterOption: filterOption, setFilterOption: setFilterOption })] }) }), jsxs("div", { className: "headers-container", children: [jsxs("div", { className: "discount-header", onClick: () => onSort('bonus'), children: [
|
|
80350
|
+
}, placeholder: 'Search...' }), jsx$2(FavIcon, { filterOption: filterOption, setFilterOption: setFilterOption })] }) }), jsxs("div", { className: "headers-container", children: [jsxs("div", { className: "discount-header", onClick: () => onSort('bonus'), children: [namingPreference.toUpperCase(), jsx$2(Flex$1, { sx: { ml: '5px', mb: '3px' }, children: jsx$2(Svg, { icon: "sort", width: 10, color: "textDisabledButton" }) })] }), jsxs("div", { className: "terms-header", onClick: () => onSort('terms'), children: ["TERMS", jsx$2(Flex$1, { sx: { ml: '5px', mb: '3px' }, children: jsx$2(Svg, { icon: "sort", width: "12px", color: "textDisabledButton" }) })] }), jsxs("div", { className: "tokens-remaining-header", onClick: () => onSort('tokensRemaining'), children: ["TOKENS REMAINING", jsx$2(Flex$1, { sx: { ml: '5px', mb: '3px' }, children: jsx$2(Svg, { icon: "sort", width: "12px", color: "textDisabledButton" }) })] }), jsx$2("div", { className: "tooltip-header" })] })] })] }));
|
|
80348
80351
|
};
|
|
80349
80352
|
|
|
80350
80353
|
const getUserApiStats = (account) => __awaiter$9(void 0, void 0, void 0, function* () {
|
|
@@ -8,6 +8,7 @@ export interface SDKPropsDTO {
|
|
|
8
8
|
useTGEBonds?: boolean;
|
|
9
9
|
showLowValueBonds?: boolean;
|
|
10
10
|
bondPartner?: string;
|
|
11
|
+
namingPreference?: 'Discount' | 'Bonus';
|
|
11
12
|
urls?: Partial<Record<URLKeys, string>>;
|
|
12
13
|
theme?: any;
|
|
13
14
|
highestCompatibleVersion?: string;
|
|
@@ -22,6 +23,7 @@ export interface SDKProps {
|
|
|
22
23
|
useTGEBonds: boolean;
|
|
23
24
|
showLowValueBonds: boolean;
|
|
24
25
|
bondPartner?: string;
|
|
26
|
+
namingPreference: 'Discount' | 'Bonus';
|
|
25
27
|
urls: Record<URLKeys, string>;
|
|
26
28
|
theme?: any;
|
|
27
29
|
highestCompatibleVersion?: string;
|
package/dist/types/bonds.d.ts
CHANGED
|
@@ -13,6 +13,8 @@ export interface BondsData extends PreTGEConfig, BillsConfig {
|
|
|
13
13
|
tokensRemaining?: string;
|
|
14
14
|
showcaseTokenName?: string;
|
|
15
15
|
feeInPayout?: number;
|
|
16
|
+
discount?: number;
|
|
17
|
+
discountWithFee?: number;
|
|
16
18
|
trueBondPrices?: TrueBondPrices[];
|
|
17
19
|
payoutTokenPrice?: string;
|
|
18
20
|
principalTokenPrice?: string;
|
|
@@ -20,7 +20,7 @@ export declare const getVestingTermsString: (bond?: BondsData | BillsConfig) =>
|
|
|
20
20
|
export declare const getVestingTermsTooltipString: (bond?: BondsData | BillsConfig) => string | undefined;
|
|
21
21
|
export declare const discountEarnTokenPrice: (bond: BondsData, useTiers?: boolean) => string;
|
|
22
22
|
export declare const discountEarnTokenPriceForUser: (bond: BondsData, useTiers?: boolean, userTier?: LaunchBondTiers) => string;
|
|
23
|
-
export declare const maxBuy: (bond: BondsData) => BigNumber;
|
|
23
|
+
export declare const maxBuy: (bond: BondsData, allowLowValueBonds: boolean) => BigNumber;
|
|
24
24
|
export declare function formatNumber(input: string): string;
|
|
25
25
|
export declare function formatUSDNumber(input: string): string;
|
|
26
26
|
export declare const youSpendUSD: (bond: BondsData, inputValue: string) => string;
|