182 lines
49 KiB
JavaScript
182 lines
49 KiB
JavaScript
var Je=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Qe(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}/*!
|
||
* Copyright (c) 2017 Benjamin Van Ryseghem<benjamin@vanryseghem.com>
|
||
*
|
||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||
* of this software and associated documentation files (the "Software"), to deal
|
||
* in the Software without restriction, including without limitation the rights
|
||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||
* copies of the Software, and to permit persons to whom the Software is
|
||
* furnished to do so, subject to the following conditions:
|
||
*
|
||
* The above copyright notice and this permission notice shall be included in
|
||
* all copies or substantial portions of the Software.
|
||
*
|
||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||
* SOFTWARE.
|
||
*/var Te,Ve;function et(){return Ve||(Ve=1,Te={languageTag:"en-US",delimiters:{thousands:",",decimal:"."},abbreviations:{thousand:"k",million:"m",billion:"b",trillion:"t"},spaceSeparated:!1,ordinal:function(n){let t=n%10;return~~(n%100/10)===1?"th":t===1?"st":t===2?"nd":t===3?"rd":"th"},bytes:{binarySuffixes:["B","KiB","MiB","GiB","TiB","PiB","EiB","ZiB","YiB"],decimalSuffixes:["B","KB","MB","GB","TB","PB","EB","ZB","YB"]},currency:{symbol:"$",position:"prefix",code:"USD"},currencyFormat:{thousandSeparated:!0,totalLength:4,spaceSeparated:!0,spaceSeparatedCurrency:!0},formats:{fourDigits:{totalLength:4,spaceSeparated:!0},fullWithTwoDecimals:{output:"currency",thousandSeparated:!0,mantissa:2},fullWithTwoDecimalsNoCurrency:{thousandSeparated:!0,mantissa:2},fullWithNoDecimals:{output:"currency",thousandSeparated:!0,mantissa:0}}}),Te}/*!
|
||
* Copyright (c) 2017 Benjamin Van Ryseghem<benjamin@vanryseghem.com>
|
||
*
|
||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||
* of this software and associated documentation files (the "Software"), to deal
|
||
* in the Software without restriction, including without limitation the rights
|
||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||
* copies of the Software, and to permit persons to whom the Software is
|
||
* furnished to do so, subject to the following conditions:
|
||
*
|
||
* The above copyright notice and this permission notice shall be included in
|
||
* all copies or substantial portions of the Software.
|
||
*
|
||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||
* SOFTWARE.
|
||
*/var Le,qe;function Ze(){if(qe)return Le;qe=1;const n=[{key:"ZiB",factor:Math.pow(1024,7)},{key:"ZB",factor:Math.pow(1e3,7)},{key:"YiB",factor:Math.pow(1024,8)},{key:"YB",factor:Math.pow(1e3,8)},{key:"TiB",factor:Math.pow(1024,4)},{key:"TB",factor:Math.pow(1e3,4)},{key:"PiB",factor:Math.pow(1024,5)},{key:"PB",factor:Math.pow(1e3,5)},{key:"MiB",factor:Math.pow(1024,2)},{key:"MB",factor:Math.pow(1e3,2)},{key:"KiB",factor:Math.pow(1024,1)},{key:"KB",factor:Math.pow(1e3,1)},{key:"GiB",factor:Math.pow(1024,3)},{key:"GB",factor:Math.pow(1e3,3)},{key:"EiB",factor:Math.pow(1024,6)},{key:"EB",factor:Math.pow(1e3,6)},{key:"B",factor:1}];function t(w){return w.replace(/[-/\\^$*+?.()|[\]{}]/g,"\\$&")}function p(w,g,B,T,_,A,X){if(!isNaN(+w))return+w;let P="",D=w.replace(/(^[^(]*)\((.*)\)([^)]*$)/,"$1$2$3");if(D!==w)return-1*p(D,g,B,T,_,A);for(let N=0;N<n.length;N++){let x=n[N];if(P=w.replace(RegExp(`([0-9 ])(${x.key})$`),"$1"),P!==w)return p(P,g,B,T,_,A)*x.factor}if(P=w.replace("%",""),P!==w)return p(P,g,B,T,_,A)/100;let F=parseFloat(w);if(isNaN(F))return;let L=T(F);if(L&&L!=="."&&(P=w.replace(new RegExp(`${t(L)}$`),""),P!==w))return p(P,g,B,T,_,A);let Q={};Object.keys(A).forEach(N=>{Q[A[N]]=N});let te=Object.keys(Q).sort().reverse(),R=te.length;for(let N=0;N<R;N++){let x=te[N],C=Q[x];if(P=w.replace(x,""),P!==w){let I;switch(C){case"thousand":I=Math.pow(10,3);break;case"million":I=Math.pow(10,6);break;case"billion":I=Math.pow(10,9);break;case"trillion":I=Math.pow(10,12);break}return p(P,g,B,T,_,A)*I}}}function d(w,g,B){let T=w.replace(B,"");return T=T.replace(new RegExp(`([0-9])${t(g.thousands)}([0-9])`,"g"),"$1$2"),T=T.replace(g.decimal,"."),T}function v(w,g,B="",T,_,A,X){if(w==="")return;if(w===_)return 0;let P=d(w,g,B);return p(P,g,B,T,_,A)}function y(w,g){if(!(w.indexOf(":")&&g.thousands!==":"))return!1;let T=w.split(":");if(T.length!==3)return!1;let _=+T[0],A=+T[1],X=+T[2];return!isNaN(_)&&!isNaN(A)&&!isNaN(X)}function O(w){let g=w.split(":"),B=+g[0],T=+g[1];return+g[2]+60*T+3600*B}function M(w,g){const B=Re();let T=B.currentDelimiters(),_=B.currentCurrency().symbol,A=B.currentOrdinal(),X=B.getZeroFormat(),P=B.currentAbbreviations(),D;if(typeof w=="string")y(w,T)?D=O(w):D=v(w,T,_,A,X,P);else if(typeof w=="number")D=w;else return;if(D!==void 0)return D}return Le={unformat:M},Le}/*!
|
||
* Copyright (c) 2017 Benjamin Van Ryseghem<benjamin@vanryseghem.com>
|
||
*
|
||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||
* of this software and associated documentation files (the "Software"), to deal
|
||
* in the Software without restriction, including without limitation the rights
|
||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||
* copies of the Software, and to permit persons to whom the Software is
|
||
* furnished to do so, subject to the following conditions:
|
||
*
|
||
* The above copyright notice and this permission notice shall be included in
|
||
* all copies or substantial portions of the Software.
|
||
*
|
||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||
* SOFTWARE.
|
||
*/var Ce,Ge;function ke(){if(Ge)return Ce;Ge=1;let n=Ze();const t=/^[a-z]{2,3}(-[a-zA-Z]{4})?(-([A-Z]{2}|[0-9]{3}))?$/,p=["currency","percent","byte","time","ordinal","number"],d=["trillion","billion","million","thousand"],v=["prefix","infix","postfix"],y=["sign","parenthesis"],O={type:"object",children:{thousand:{type:"string",mandatory:!0},million:{type:"string",mandatory:!0},billion:{type:"string",mandatory:!0},trillion:{type:"string",mandatory:!0}},mandatory:!0},g={output:{type:"string",validValues:p},base:{type:"string",validValues:["decimal","binary","general"],restriction:(D,F)=>F.output==="byte",message:"`base` must be provided only when the output is `byte`",mandatory:D=>D.output==="byte"},characteristic:{type:"number",restriction:D=>D>=0,message:"value must be positive"},prefix:"string",postfix:"string",forceAverage:{type:"string",validValues:d},average:"boolean",lowPrecision:{type:"boolean",restriction:(D,F)=>F.average===!0,message:"`lowPrecision` must be provided only when the option `average` is set"},currencyPosition:{type:"string",validValues:v},currencySymbol:"string",totalLength:{type:"number",restrictions:[{restriction:D=>D>=0,message:"value must be positive"},{restriction:(D,F)=>!F.exponential,message:"`totalLength` is incompatible with `exponential`"}]},mantissa:{type:"number",restriction:D=>D>=0,message:"value must be positive"},optionalMantissa:"boolean",trimMantissa:"boolean",roundingFunction:"function",optionalCharacteristic:"boolean",thousandSeparated:"boolean",spaceSeparated:"boolean",spaceSeparatedCurrency:"boolean",spaceSeparatedAbbreviation:"boolean",abbreviations:{type:"object",children:{thousand:"string",million:"string",billion:"string",trillion:"string"}},negative:{type:"string",validValues:y},forceSign:"boolean",exponential:{type:"boolean"},prefixSymbol:{type:"boolean",restriction:(D,F)=>F.output==="percent",message:"`prefixSymbol` can be provided only when the output is `percent`"}},B={languageTag:{type:"string",mandatory:!0,restriction:D=>D.match(t),message:"the language tag must follow the BCP 47 specification (see https://tools.ieft.org/html/bcp47)"},delimiters:{type:"object",children:{thousands:"string",decimal:"string",thousandsSize:"number"},mandatory:!0},abbreviations:O,spaceSeparated:"boolean",spaceSeparatedCurrency:"boolean",ordinal:{type:"function",mandatory:!0},bytes:{type:"object",children:{binarySuffixes:"object",decimalSuffixes:"object"}},currency:{type:"object",children:{symbol:"string",position:"string",code:"string"},mandatory:!0},defaults:"format",ordinalFormat:"format",byteFormat:"format",percentageFormat:"format",currencyFormat:"format",timeDefaults:"format",formats:{type:"object",children:{fourDigits:{type:"format",mandatory:!0},fullWithTwoDecimals:{type:"format",mandatory:!0},fullWithTwoDecimalsNoCurrency:{type:"format",mandatory:!0},fullWithNoDecimals:{type:"format",mandatory:!0}}}};function T(D,F){let L=_(D),Q=X(F);return L&&Q}function _(D){return n.unformat(D)!==void 0}function A(D,F,L,Q=!1){let te=Object.keys(D).map(R=>{if(!F[R])return console.error(`${L} Invalid key: ${R}`),!1;let N=D[R],x=F[R];if(typeof x=="string"&&(x={type:x}),x.type==="format"){if(!A(N,g,`[Validate ${R}]`,!0))return!1}else if(typeof N!==x.type)return console.error(`${L} ${R} type mismatched: "${x.type}" expected, "${typeof N}" provided`),!1;if(x.restrictions&&x.restrictions.length){let C=x.restrictions.length;for(let I=0;I<C;I++){let{restriction:S,message:W}=x.restrictions[I];if(!S(N,D))return console.error(`${L} ${R} invalid value: ${W}`),!1}}return x.restriction&&!x.restriction(N,D)?(console.error(`${L} ${R} invalid value: ${x.message}`),!1):x.validValues&&x.validValues.indexOf(N)===-1?(console.error(`${L} ${R} invalid value: must be among ${JSON.stringify(x.validValues)}, "${N}" provided`),!1):!(x.children&&!A(N,x.children,`[Validate ${R}]`))});return Q||te.push(...Object.keys(F).map(R=>{let N=F[R];if(typeof N=="string"&&(N={type:N}),N.mandatory){let x=N.mandatory;if(typeof x=="function"&&(x=x(D)),x&&D[R]===void 0)return console.error(`${L} Missing mandatory key "${R}"`),!1}return!0})),te.reduce((R,N)=>R&&N,!0)}function X(D){return A(D,g,"[Validate format]")}function P(D){return A(D,B,"[Validate language]")}return Ce={validate:T,validateFormat:X,validateInput:_,validateLanguage:P},Ce}/*!
|
||
* Copyright (c) 2017 Benjamin Van Ryseghem<benjamin@vanryseghem.com>
|
||
*
|
||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||
* of this software and associated documentation files (the "Software"), to deal
|
||
* in the Software without restriction, including without limitation the rights
|
||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||
* copies of the Software, and to permit persons to whom the Software is
|
||
* furnished to do so, subject to the following conditions:
|
||
*
|
||
* The above copyright notice and this permission notice shall be included in
|
||
* all copies or substantial portions of the Software.
|
||
*
|
||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||
* SOFTWARE.
|
||
*/function tt(n,t){let p=n.match(/^{([^}]*)}/);return p?(t.prefix=p[1],n.slice(p[0].length)):n}function rt(n,t){let p=n.match(/{([^}]*)}$/);return p?(t.postfix=p[1],n.slice(0,-p[0].length)):n}function nt(n,t){if(n.indexOf("$")!==-1){t.output="currency";return}if(n.indexOf("%")!==-1){t.output="percent";return}if(n.indexOf("bd")!==-1){t.output="byte",t.base="general";return}if(n.indexOf("b")!==-1){t.output="byte",t.base="binary";return}if(n.indexOf("d")!==-1){t.output="byte",t.base="decimal";return}if(n.indexOf(":")!==-1){t.output="time";return}n.indexOf("o")!==-1&&(t.output="ordinal")}function it(n,t){n.indexOf(",")!==-1&&(t.thousandSeparated=!0)}function at(n,t){n.indexOf(" ")!==-1&&(t.spaceSeparated=!0,t.spaceSeparatedCurrency=!0,(t.average||t.forceAverage)&&(t.spaceSeparatedAbbreviation=!0))}function lt(n,t){let p=n.match(/[1-9]+[0-9]*/);p&&(t.totalLength=+p[0])}function ot(n,t){let d=n.split(".")[0].match(/0+/);d&&(t.characteristic=d[0].length)}function st(n,t){let p=n.split(".")[1];if(p){let d=p.match(/0+/);d&&(t.mantissa=d[0].length)}}function ut(n,t){const p=n.split(".")[1];p&&(t.trimMantissa=p.indexOf("[")!==-1)}function ft(n,t){n.indexOf("a")!==-1&&(t.average=!0)}function ct(n,t){n.indexOf("K")!==-1?t.forceAverage="thousand":n.indexOf("M")!==-1?t.forceAverage="million":n.indexOf("B")!==-1?t.forceAverage="billion":n.indexOf("T")!==-1&&(t.forceAverage="trillion")}function ht(n,t){n.match(/\[\.]/)?t.optionalMantissa=!0:n.match(/\./)&&(t.optionalMantissa=!1)}function pt(n,t){if(n.indexOf(".")!==-1){let p=n.split(".")[0];t.optionalCharacteristic=p.indexOf("0")===-1}}function gt(n,t){n.match(/^\+?\([^)]*\)$/)&&(t.negative="parenthesis"),n.match(/^\+?-/)&&(t.negative="sign")}function dt(n,t){n.match(/^\+/)&&(t.forceSign=!0)}function mt(n,t={}){return typeof n!="string"?n:(n=tt(n,t),n=rt(n,t),nt(n,t),lt(n,t),ot(n,t),pt(n,t),ft(n,t),ct(n,t),st(n,t),ht(n,t),ut(n,t),it(n,t),at(n,t),gt(n,t),dt(n,t),t)}var Ue={parseFormat:mt};/*!
|
||
* Copyright (c) 2017 Benjamin Van Ryseghem<benjamin@vanryseghem.com>
|
||
*
|
||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||
* of this software and associated documentation files (the "Software"), to deal
|
||
* in the Software without restriction, including without limitation the rights
|
||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||
* copies of the Software, and to permit persons to whom the Software is
|
||
* furnished to do so, subject to the following conditions:
|
||
*
|
||
* The above copyright notice and this permission notice shall be included in
|
||
* all copies or substantial portions of the Software.
|
||
*
|
||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||
* SOFTWARE.
|
||
*/var Pe,je;function Re(){if(je)return Pe;je=1;const n=et(),t=ke(),p=Ue;let d={},v,y={},O=null,M={};function w(B){v=B}function g(){return y[v]}return d.languages=()=>Object.assign({},y),d.currentLanguage=()=>v,d.currentBytes=()=>g().bytes||{},d.currentCurrency=()=>g().currency,d.currentAbbreviations=()=>g().abbreviations,d.currentDelimiters=()=>g().delimiters,d.currentOrdinal=()=>g().ordinal,d.currentDefaults=()=>Object.assign({},g().defaults,M),d.currentOrdinalDefaultFormat=()=>Object.assign({},d.currentDefaults(),g().ordinalFormat),d.currentByteDefaultFormat=()=>Object.assign({},d.currentDefaults(),g().byteFormat),d.currentPercentageDefaultFormat=()=>Object.assign({},d.currentDefaults(),g().percentageFormat),d.currentCurrencyDefaultFormat=()=>Object.assign({},d.currentDefaults(),g().currencyFormat),d.currentTimeDefaultFormat=()=>Object.assign({},d.currentDefaults(),g().timeFormat),d.setDefaults=B=>{B=p.parseFormat(B),t.validateFormat(B)&&(M=B)},d.getZeroFormat=()=>O,d.setZeroFormat=B=>O=typeof B=="string"?B:null,d.hasZeroFormat=()=>O!==null,d.languageData=B=>{if(B){if(y[B])return y[B];throw new Error(`Unknown tag "${B}"`)}return g()},d.registerLanguage=(B,T=!1)=>{if(!t.validateLanguage(B))throw new Error("Invalid language data");y[B.languageTag]=B,T&&w(B.languageTag)},d.setLanguage=(B,T=n.languageTag)=>{if(!y[B]){let _=B.split("-")[0],A=Object.keys(y).find(X=>X.split("-")[0]===_);if(!y[A]){w(T);return}w(A);return}w(B)},d.registerLanguage(n),v=n.languageTag,Pe=d,Pe}function yt(n){throw new Error('Could not dynamically require "'+n+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}/*!
|
||
* Copyright (c) 2017 Benjamin Van Ryseghem<benjamin@vanryseghem.com>
|
||
*
|
||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||
* of this software and associated documentation files (the "Software"), to deal
|
||
* in the Software without restriction, including without limitation the rights
|
||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||
* copies of the Software, and to permit persons to whom the Software is
|
||
* furnished to do so, subject to the following conditions:
|
||
*
|
||
* The above copyright notice and this permission notice shall be included in
|
||
* all copies or substantial portions of the Software.
|
||
*
|
||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||
* SOFTWARE.
|
||
*/function vt(n,t){n.forEach(p=>{let d;try{d=yt(`../languages/${p}`)}catch{console.error(`Unable to load "${p}". No matching language file found.`)}d&&t.registerLanguage(d)})}var wt=n=>({loadLanguagesInNode:t=>vt(t,n)}),ze={exports:{}};(function(n){(function(t){var p,d=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,v=Math.ceil,y=Math.floor,O="[BigNumber Error] ",M=O+"Number primitive has more than 15 significant digits: ",w=1e14,g=14,B=9007199254740991,T=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],_=1e7,A=1e9;function X(N){var x,C,I,S=b.prototype={constructor:b,toString:null,valueOf:null},W=new b(1),q=20,G=4,ee=-7,re=21,he=-1e7,ae=1e7,pe=!1,ve=1,ce=0,$e={prefix:"",groupSize:3,secondaryGroupSize:0,groupSeparator:",",decimalSeparator:".",fractionGroupSize:0,fractionGroupSeparator:" ",suffix:""},ge="0123456789abcdefghijklmnopqrstuvwxyz",Me=!0;function b(e,r){var i,f,l,s,h,a,o,c,u=this;if(!(u instanceof b))return new b(e,r);if(r==null){if(e&&e._isBigNumber===!0){u.s=e.s,!e.c||e.e>ae?u.c=u.e=null:e.e<he?u.c=[u.e=0]:(u.e=e.e,u.c=e.c.slice());return}if((a=typeof e=="number")&&e*0==0){if(u.s=1/e<0?(e=-e,-1):1,e===~~e){for(s=0,h=e;h>=10;h/=10,s++);s>ae?u.c=u.e=null:(u.e=s,u.c=[e]);return}c=String(e)}else{if(!d.test(c=String(e)))return I(u,c,a);u.s=c.charCodeAt(0)==45?(c=c.slice(1),-1):1}(s=c.indexOf("."))>-1&&(c=c.replace(".","")),(h=c.search(/e/i))>0?(s<0&&(s=h),s+=+c.slice(h+1),c=c.substring(0,h)):s<0&&(s=c.length)}else{if(L(r,2,ge.length,"Base"),r==10&&Me)return u=new b(e),ne(u,q+u.e+1,G);if(c=String(e),a=typeof e=="number"){if(e*0!=0)return I(u,c,a,r);if(u.s=1/e<0?(c=c.slice(1),-1):1,b.DEBUG&&c.replace(/^0\.0*|\./,"").length>15)throw Error(M+e)}else u.s=c.charCodeAt(0)===45?(c=c.slice(1),-1):1;for(i=ge.slice(0,r),s=h=0,o=c.length;h<o;h++)if(i.indexOf(f=c.charAt(h))<0){if(f=="."){if(h>s){s=o;continue}}else if(!l&&(c==c.toUpperCase()&&(c=c.toLowerCase())||c==c.toLowerCase()&&(c=c.toUpperCase()))){l=!0,h=-1,s=0;continue}return I(u,String(e),a,r)}a=!1,c=C(c,r,10,u.s),(s=c.indexOf("."))>-1?c=c.replace(".",""):s=c.length}for(h=0;c.charCodeAt(h)===48;h++);for(o=c.length;c.charCodeAt(--o)===48;);if(c=c.slice(h,++o)){if(o-=h,a&&b.DEBUG&&o>15&&(e>B||e!==y(e)))throw Error(M+u.s*e);if((s=s-h-1)>ae)u.c=u.e=null;else if(s<he)u.c=[u.e=0];else{if(u.e=s,u.c=[],h=(s+1)%g,s<0&&(h+=g),h<o){for(h&&u.c.push(+c.slice(0,h)),o-=g;h<o;)u.c.push(+c.slice(h,h+=g));h=g-(c=c.slice(h)).length}else h-=o;for(;h--;c+="0");u.c.push(+c)}}else u.c=[u.e=0]}b.clone=X,b.ROUND_UP=0,b.ROUND_DOWN=1,b.ROUND_CEIL=2,b.ROUND_FLOOR=3,b.ROUND_HALF_UP=4,b.ROUND_HALF_DOWN=5,b.ROUND_HALF_EVEN=6,b.ROUND_HALF_CEIL=7,b.ROUND_HALF_FLOOR=8,b.EUCLID=9,b.config=b.set=function(e){var r,i;if(e!=null)if(typeof e=="object"){if(e.hasOwnProperty(r="DECIMAL_PLACES")&&(i=e[r],L(i,0,A,r),q=i),e.hasOwnProperty(r="ROUNDING_MODE")&&(i=e[r],L(i,0,8,r),G=i),e.hasOwnProperty(r="EXPONENTIAL_AT")&&(i=e[r],i&&i.pop?(L(i[0],-A,0,r),L(i[1],0,A,r),ee=i[0],re=i[1]):(L(i,-A,A,r),ee=-(re=i<0?-i:i))),e.hasOwnProperty(r="RANGE"))if(i=e[r],i&&i.pop)L(i[0],-A,-1,r),L(i[1],1,A,r),he=i[0],ae=i[1];else if(L(i,-A,A,r),i)he=-(ae=i<0?-i:i);else throw Error(O+r+" cannot be zero: "+i);if(e.hasOwnProperty(r="CRYPTO"))if(i=e[r],i===!!i)if(i)if(typeof crypto<"u"&&crypto&&(crypto.getRandomValues||crypto.randomBytes))pe=i;else throw pe=!i,Error(O+"crypto unavailable");else pe=i;else throw Error(O+r+" not true or false: "+i);if(e.hasOwnProperty(r="MODULO_MODE")&&(i=e[r],L(i,0,9,r),ve=i),e.hasOwnProperty(r="POW_PRECISION")&&(i=e[r],L(i,0,A,r),ce=i),e.hasOwnProperty(r="FORMAT"))if(i=e[r],typeof i=="object")$e=i;else throw Error(O+r+" not an object: "+i);if(e.hasOwnProperty(r="ALPHABET"))if(i=e[r],typeof i=="string"&&!/^.?$|[+\-.\s]|(.).*\1/.test(i))Me=i.slice(0,10)=="0123456789",ge=i;else throw Error(O+r+" invalid: "+i)}else throw Error(O+"Object expected: "+e);return{DECIMAL_PLACES:q,ROUNDING_MODE:G,EXPONENTIAL_AT:[ee,re],RANGE:[he,ae],CRYPTO:pe,MODULO_MODE:ve,POW_PRECISION:ce,FORMAT:$e,ALPHABET:ge}},b.isBigNumber=function(e){if(!e||e._isBigNumber!==!0)return!1;if(!b.DEBUG)return!0;var r,i,f=e.c,l=e.e,s=e.s;e:if({}.toString.call(f)=="[object Array]"){if((s===1||s===-1)&&l>=-A&&l<=A&&l===y(l)){if(f[0]===0){if(l===0&&f.length===1)return!0;break e}if(r=(l+1)%g,r<1&&(r+=g),String(f[0]).length==r){for(r=0;r<f.length;r++)if(i=f[r],i<0||i>=w||i!==y(i))break e;if(i!==0)return!0}}}else if(f===null&&l===null&&(s===null||s===1||s===-1))return!0;throw Error(O+"Invalid BigNumber: "+e)},b.maximum=b.max=function(){return Fe(arguments,-1)},b.minimum=b.min=function(){return Fe(arguments,1)},b.random=function(){var e=9007199254740992,r=Math.random()*e&2097151?function(){return y(Math.random()*e)}:function(){return(Math.random()*1073741824|0)*8388608+(Math.random()*8388608|0)};return function(i){var f,l,s,h,a,o=0,c=[],u=new b(W);if(i==null?i=q:L(i,0,A),h=v(i/g),pe)if(crypto.getRandomValues){for(f=crypto.getRandomValues(new Uint32Array(h*=2));o<h;)a=f[o]*131072+(f[o+1]>>>11),a>=9e15?(l=crypto.getRandomValues(new Uint32Array(2)),f[o]=l[0],f[o+1]=l[1]):(c.push(a%1e14),o+=2);o=h/2}else if(crypto.randomBytes){for(f=crypto.randomBytes(h*=7);o<h;)a=(f[o]&31)*281474976710656+f[o+1]*1099511627776+f[o+2]*4294967296+f[o+3]*16777216+(f[o+4]<<16)+(f[o+5]<<8)+f[o+6],a>=9e15?crypto.randomBytes(7).copy(f,o):(c.push(a%1e14),o+=7);o=h/7}else throw pe=!1,Error(O+"crypto unavailable");if(!pe)for(;o<h;)a=r(),a<9e15&&(c[o++]=a%1e14);for(h=c[--o],i%=g,h&&i&&(a=T[g-i],c[o]=y(h/a)*a);c[o]===0;c.pop(),o--);if(o<0)c=[s=0];else{for(s=-1;c[0]===0;c.splice(0,1),s-=g);for(o=1,a=c[0];a>=10;a/=10,o++);o<g&&(s-=g-o)}return u.e=s,u.c=c,u}}(),b.sum=function(){for(var e=1,r=arguments,i=new b(r[0]);e<r.length;)i=i.plus(r[e++]);return i},C=function(){var e="0123456789";function r(i,f,l,s){for(var h,a=[0],o,c=0,u=i.length;c<u;){for(o=a.length;o--;a[o]*=f);for(a[0]+=s.indexOf(i.charAt(c++)),h=0;h<a.length;h++)a[h]>l-1&&(a[h+1]==null&&(a[h+1]=0),a[h+1]+=a[h]/l|0,a[h]%=l)}return a.reverse()}return function(i,f,l,s,h){var a,o,c,u,m,$,E,U,j=i.indexOf("."),H=q,k=G;for(j>=0&&(u=ce,ce=0,i=i.replace(".",""),U=new b(f),$=U.pow(i.length-j),ce=u,U.c=r(R(D($.c),$.e,"0"),10,l,e),U.e=U.c.length),E=r(i,f,l,h?(a=ge,e):(a=e,ge)),c=u=E.length;E[--u]==0;E.pop());if(!E[0])return a.charAt(0);if(j<0?--c:($.c=E,$.e=c,$.s=s,$=x($,U,H,k,l),E=$.c,m=$.r,c=$.e),o=c+H+1,j=E[o],u=l/2,m=m||o<0||E[o+1]!=null,m=k<4?(j!=null||m)&&(k==0||k==($.s<0?3:2)):j>u||j==u&&(k==4||m||k==6&&E[o-1]&1||k==($.s<0?8:7)),o<1||!E[0])i=m?R(a.charAt(1),-H,a.charAt(0)):a.charAt(0);else{if(E.length=o,m)for(--l;++E[--o]>l;)E[o]=0,o||(++c,E=[1].concat(E));for(u=E.length;!E[--u];);for(j=0,i="";j<=u;i+=a.charAt(E[j++]));i=R(i,c,a.charAt(0))}return i}}(),x=function(){function e(f,l,s){var h,a,o,c,u=0,m=f.length,$=l%_,E=l/_|0;for(f=f.slice();m--;)o=f[m]%_,c=f[m]/_|0,h=E*o+c*$,a=$*o+h%_*_+u,u=(a/s|0)+(h/_|0)+E*c,f[m]=a%s;return u&&(f=[u].concat(f)),f}function r(f,l,s,h){var a,o;if(s!=h)o=s>h?1:-1;else for(a=o=0;a<s;a++)if(f[a]!=l[a]){o=f[a]>l[a]?1:-1;break}return o}function i(f,l,s,h){for(var a=0;s--;)f[s]-=a,a=f[s]<l[s]?1:0,f[s]=a*h+f[s]-l[s];for(;!f[0]&&f.length>1;f.splice(0,1));}return function(f,l,s,h,a){var o,c,u,m,$,E,U,j,H,k,V,K,Oe,Ae,_e,oe,we,ie=f.s==l.s?1:-1,J=f.c,Z=l.c;if(!J||!J[0]||!Z||!Z[0])return new b(!f.s||!l.s||(J?Z&&J[0]==Z[0]:!Z)?NaN:J&&J[0]==0||!Z?ie*0:ie/0);for(j=new b(ie),H=j.c=[],c=f.e-l.e,ie=s+c+1,a||(a=w,c=P(f.e/g)-P(l.e/g),ie=ie/g|0),u=0;Z[u]==(J[u]||0);u++);if(Z[u]>(J[u]||0)&&c--,ie<0)H.push(1),m=!0;else{for(Ae=J.length,oe=Z.length,u=0,ie+=2,$=y(a/(Z[0]+1)),$>1&&(Z=e(Z,$,a),J=e(J,$,a),oe=Z.length,Ae=J.length),Oe=oe,k=J.slice(0,oe),V=k.length;V<oe;k[V++]=0);we=Z.slice(),we=[0].concat(we),_e=Z[0],Z[1]>=a/2&&_e++;do{if($=0,o=r(Z,k,oe,V),o<0){if(K=k[0],oe!=V&&(K=K*a+(k[1]||0)),$=y(K/_e),$>1)for($>=a&&($=a-1),E=e(Z,$,a),U=E.length,V=k.length;r(E,k,U,V)==1;)$--,i(E,oe<U?we:Z,U,a),U=E.length,o=1;else $==0&&(o=$=1),E=Z.slice(),U=E.length;if(U<V&&(E=[0].concat(E)),i(k,E,V,a),V=k.length,o==-1)for(;r(Z,k,oe,V)<1;)$++,i(k,oe<V?we:Z,V,a),V=k.length}else o===0&&($++,k=[0]);H[u++]=$,k[0]?k[V++]=J[Oe]||0:(k=[J[Oe]],V=1)}while((Oe++<Ae||k[0]!=null)&&ie--);m=k[0]!=null,H[0]||H.splice(0,1)}if(a==w){for(u=1,ie=H[0];ie>=10;ie/=10,u++);ne(j,s+(j.e=u+c*g-1)+1,h,m)}else j.e=c,j.r=+m;return j}}();function Ee(e,r,i,f){var l,s,h,a,o;if(i==null?i=G:L(i,0,8),!e.c)return e.toString();if(l=e.c[0],h=e.e,r==null)o=D(e.c),o=f==1||f==2&&(h<=ee||h>=re)?te(o,h):R(o,h,"0");else if(e=ne(new b(e),r,i),s=e.e,o=D(e.c),a=o.length,f==1||f==2&&(r<=s||s<=ee)){for(;a<r;o+="0",a++);o=te(o,s)}else if(r-=h,o=R(o,s,"0"),s+1>a){if(--r>0)for(o+=".";r--;o+="0");}else if(r+=s-a,r>0)for(s+1==a&&(o+=".");r--;o+="0");return e.s<0&&l?"-"+o:o}function Fe(e,r){for(var i,f,l=1,s=new b(e[0]);l<e.length;l++)f=new b(e[l]),(!f.s||(i=F(s,f))===r||i===0&&s.s===r)&&(s=f);return s}function De(e,r,i){for(var f=1,l=r.length;!r[--l];r.pop());for(l=r[0];l>=10;l/=10,f++);return(i=f+i*g-1)>ae?e.c=e.e=null:i<he?e.c=[e.e=0]:(e.e=i,e.c=r),e}I=function(){var e=/^(-?)0([xbo])(?=\w[\w.]*$)/i,r=/^([^.]+)\.$/,i=/^\.([^.]+)$/,f=/^-?(Infinity|NaN)$/,l=/^\s*\+(?=[\w.])|^\s+|\s+$/g;return function(s,h,a,o){var c,u=a?h:h.replace(l,"");if(f.test(u))s.s=isNaN(u)?null:u<0?-1:1;else{if(!a&&(u=u.replace(e,function(m,$,E){return c=(E=E.toLowerCase())=="x"?16:E=="b"?2:8,!o||o==c?$:m}),o&&(c=o,u=u.replace(r,"$1").replace(i,"0.$1")),h!=u))return new b(u,c);if(b.DEBUG)throw Error(O+"Not a"+(o?" base "+o:"")+" number: "+h);s.s=null}s.c=s.e=null}}();function ne(e,r,i,f){var l,s,h,a,o,c,u,m=e.c,$=T;if(m){e:{for(l=1,a=m[0];a>=10;a/=10,l++);if(s=r-l,s<0)s+=g,h=r,o=m[c=0],u=y(o/$[l-h-1]%10);else if(c=v((s+1)/g),c>=m.length)if(f){for(;m.length<=c;m.push(0));o=u=0,l=1,s%=g,h=s-g+1}else break e;else{for(o=a=m[c],l=1;a>=10;a/=10,l++);s%=g,h=s-g+l,u=h<0?0:y(o/$[l-h-1]%10)}if(f=f||r<0||m[c+1]!=null||(h<0?o:o%$[l-h-1]),f=i<4?(u||f)&&(i==0||i==(e.s<0?3:2)):u>5||u==5&&(i==4||f||i==6&&(s>0?h>0?o/$[l-h]:0:m[c-1])%10&1||i==(e.s<0?8:7)),r<1||!m[0])return m.length=0,f?(r-=e.e+1,m[0]=$[(g-r%g)%g],e.e=-r||0):m[0]=e.e=0,e;if(s==0?(m.length=c,a=1,c--):(m.length=c+1,a=$[g-s],m[c]=h>0?y(o/$[l-h]%$[h])*a:0),f)for(;;)if(c==0){for(s=1,h=m[0];h>=10;h/=10,s++);for(h=m[0]+=a,a=1;h>=10;h/=10,a++);s!=a&&(e.e++,m[0]==w&&(m[0]=1));break}else{if(m[c]+=a,m[c]!=w)break;m[c--]=0,a=1}for(s=m.length;m[--s]===0;m.pop());}e.e>ae?e.c=e.e=null:e.e<he&&(e.c=[e.e=0])}return e}function ue(e){var r,i=e.e;return i===null?e.toString():(r=D(e.c),r=i<=ee||i>=re?te(r,i):R(r,i,"0"),e.s<0?"-"+r:r)}return S.absoluteValue=S.abs=function(){var e=new b(this);return e.s<0&&(e.s=1),e},S.comparedTo=function(e,r){return F(this,new b(e,r))},S.decimalPlaces=S.dp=function(e,r){var i,f,l,s=this;if(e!=null)return L(e,0,A),r==null?r=G:L(r,0,8),ne(new b(s),e+s.e+1,r);if(!(i=s.c))return null;if(f=((l=i.length-1)-P(this.e/g))*g,l=i[l])for(;l%10==0;l/=10,f--);return f<0&&(f=0),f},S.dividedBy=S.div=function(e,r){return x(this,new b(e,r),q,G)},S.dividedToIntegerBy=S.idiv=function(e,r){return x(this,new b(e,r),0,1)},S.exponentiatedBy=S.pow=function(e,r){var i,f,l,s,h,a,o,c,u,m=this;if(e=new b(e),e.c&&!e.isInteger())throw Error(O+"Exponent not an integer: "+ue(e));if(r!=null&&(r=new b(r)),a=e.e>14,!m.c||!m.c[0]||m.c[0]==1&&!m.e&&m.c.length==1||!e.c||!e.c[0])return u=new b(Math.pow(+ue(m),a?e.s*(2-Q(e)):+ue(e))),r?u.mod(r):u;if(o=e.s<0,r){if(r.c?!r.c[0]:!r.s)return new b(NaN);f=!o&&m.isInteger()&&r.isInteger(),f&&(m=m.mod(r))}else{if(e.e>9&&(m.e>0||m.e<-1||(m.e==0?m.c[0]>1||a&&m.c[1]>=24e7:m.c[0]<8e13||a&&m.c[0]<=9999975e7)))return s=m.s<0&&Q(e)?-0:0,m.e>-1&&(s=1/s),new b(o?1/s:s);ce&&(s=v(ce/g+2))}for(a?(i=new b(.5),o&&(e.s=1),c=Q(e)):(l=Math.abs(+ue(e)),c=l%2),u=new b(W);;){if(c){if(u=u.times(m),!u.c)break;s?u.c.length>s&&(u.c.length=s):f&&(u=u.mod(r))}if(l){if(l=y(l/2),l===0)break;c=l%2}else if(e=e.times(i),ne(e,e.e+1,1),e.e>14)c=Q(e);else{if(l=+ue(e),l===0)break;c=l%2}m=m.times(m),s?m.c&&m.c.length>s&&(m.c.length=s):f&&(m=m.mod(r))}return f?u:(o&&(u=W.div(u)),r?u.mod(r):s?ne(u,ce,G,h):u)},S.integerValue=function(e){var r=new b(this);return e==null?e=G:L(e,0,8),ne(r,r.e+1,e)},S.isEqualTo=S.eq=function(e,r){return F(this,new b(e,r))===0},S.isFinite=function(){return!!this.c},S.isGreaterThan=S.gt=function(e,r){return F(this,new b(e,r))>0},S.isGreaterThanOrEqualTo=S.gte=function(e,r){return(r=F(this,new b(e,r)))===1||r===0},S.isInteger=function(){return!!this.c&&P(this.e/g)>this.c.length-2},S.isLessThan=S.lt=function(e,r){return F(this,new b(e,r))<0},S.isLessThanOrEqualTo=S.lte=function(e,r){return(r=F(this,new b(e,r)))===-1||r===0},S.isNaN=function(){return!this.s},S.isNegative=function(){return this.s<0},S.isPositive=function(){return this.s>0},S.isZero=function(){return!!this.c&&this.c[0]==0},S.minus=function(e,r){var i,f,l,s,h=this,a=h.s;if(e=new b(e,r),r=e.s,!a||!r)return new b(NaN);if(a!=r)return e.s=-r,h.plus(e);var o=h.e/g,c=e.e/g,u=h.c,m=e.c;if(!o||!c){if(!u||!m)return u?(e.s=-r,e):new b(m?h:NaN);if(!u[0]||!m[0])return m[0]?(e.s=-r,e):new b(u[0]?h:G==3?-0:0)}if(o=P(o),c=P(c),u=u.slice(),a=o-c){for((s=a<0)?(a=-a,l=u):(c=o,l=m),l.reverse(),r=a;r--;l.push(0));l.reverse()}else for(f=(s=(a=u.length)<(r=m.length))?a:r,a=r=0;r<f;r++)if(u[r]!=m[r]){s=u[r]<m[r];break}if(s&&(l=u,u=m,m=l,e.s=-e.s),r=(f=m.length)-(i=u.length),r>0)for(;r--;u[i++]=0);for(r=w-1;f>a;){if(u[--f]<m[f]){for(i=f;i&&!u[--i];u[i]=r);--u[i],u[f]+=w}u[f]-=m[f]}for(;u[0]==0;u.splice(0,1),--c);return u[0]?De(e,u,c):(e.s=G==3?-1:1,e.c=[e.e=0],e)},S.modulo=S.mod=function(e,r){var i,f,l=this;return e=new b(e,r),!l.c||!e.s||e.c&&!e.c[0]?new b(NaN):!e.c||l.c&&!l.c[0]?new b(l):(ve==9?(f=e.s,e.s=1,i=x(l,e,0,3),e.s=f,i.s*=f):i=x(l,e,0,ve),e=l.minus(i.times(e)),!e.c[0]&&ve==1&&(e.s=l.s),e)},S.multipliedBy=S.times=function(e,r){var i,f,l,s,h,a,o,c,u,m,$,E,U,j,H,k=this,V=k.c,K=(e=new b(e,r)).c;if(!V||!K||!V[0]||!K[0])return!k.s||!e.s||V&&!V[0]&&!K||K&&!K[0]&&!V?e.c=e.e=e.s=null:(e.s*=k.s,!V||!K?e.c=e.e=null:(e.c=[0],e.e=0)),e;for(f=P(k.e/g)+P(e.e/g),e.s*=k.s,o=V.length,m=K.length,o<m&&(U=V,V=K,K=U,l=o,o=m,m=l),l=o+m,U=[];l--;U.push(0));for(j=w,H=_,l=m;--l>=0;){for(i=0,$=K[l]%H,E=K[l]/H|0,h=o,s=l+h;s>l;)c=V[--h]%H,u=V[h]/H|0,a=E*c+u*$,c=$*c+a%H*H+U[s]+i,i=(c/j|0)+(a/H|0)+E*u,U[s--]=c%j;U[s]=i}return i?++f:U.splice(0,1),De(e,U,f)},S.negated=function(){var e=new b(this);return e.s=-e.s||null,e},S.plus=function(e,r){var i,f=this,l=f.s;if(e=new b(e,r),r=e.s,!l||!r)return new b(NaN);if(l!=r)return e.s=-r,f.minus(e);var s=f.e/g,h=e.e/g,a=f.c,o=e.c;if(!s||!h){if(!a||!o)return new b(l/0);if(!a[0]||!o[0])return o[0]?e:new b(a[0]?f:l*0)}if(s=P(s),h=P(h),a=a.slice(),l=s-h){for(l>0?(h=s,i=o):(l=-l,i=a),i.reverse();l--;i.push(0));i.reverse()}for(l=a.length,r=o.length,l-r<0&&(i=o,o=a,a=i,r=l),l=0;r;)l=(a[--r]=a[r]+o[r]+l)/w|0,a[r]=w===a[r]?0:a[r]%w;return l&&(a=[l].concat(a),++h),De(e,a,h)},S.precision=S.sd=function(e,r){var i,f,l,s=this;if(e!=null&&e!==!!e)return L(e,1,A),r==null?r=G:L(r,0,8),ne(new b(s),e,r);if(!(i=s.c))return null;if(l=i.length-1,f=l*g+1,l=i[l]){for(;l%10==0;l/=10,f--);for(l=i[0];l>=10;l/=10,f++);}return e&&s.e+1>f&&(f=s.e+1),f},S.shiftedBy=function(e){return L(e,-B,B),this.times("1e"+e)},S.squareRoot=S.sqrt=function(){var e,r,i,f,l,s=this,h=s.c,a=s.s,o=s.e,c=q+4,u=new b("0.5");if(a!==1||!h||!h[0])return new b(!a||a<0&&(!h||h[0])?NaN:h?s:1/0);if(a=Math.sqrt(+ue(s)),a==0||a==1/0?(r=D(h),(r.length+o)%2==0&&(r+="0"),a=Math.sqrt(+r),o=P((o+1)/2)-(o<0||o%2),a==1/0?r="5e"+o:(r=a.toExponential(),r=r.slice(0,r.indexOf("e")+1)+o),i=new b(r)):i=new b(a+""),i.c[0]){for(o=i.e,a=o+c,a<3&&(a=0);;)if(l=i,i=u.times(l.plus(x(s,l,c,1))),D(l.c).slice(0,a)===(r=D(i.c)).slice(0,a))if(i.e<o&&--a,r=r.slice(a-3,a+1),r=="9999"||!f&&r=="4999"){if(!f&&(ne(l,l.e+q+2,0),l.times(l).eq(s))){i=l;break}c+=4,a+=4,f=1}else{(!+r||!+r.slice(1)&&r.charAt(0)=="5")&&(ne(i,i.e+q+2,1),e=!i.times(i).eq(s));break}}return ne(i,i.e+q+1,G,e)},S.toExponential=function(e,r){return e!=null&&(L(e,0,A),e++),Ee(this,e,r,1)},S.toFixed=function(e,r){return e!=null&&(L(e,0,A),e=e+this.e+1),Ee(this,e,r)},S.toFormat=function(e,r,i){var f,l=this;if(i==null)e!=null&&r&&typeof r=="object"?(i=r,r=null):e&&typeof e=="object"?(i=e,e=r=null):i=$e;else if(typeof i!="object")throw Error(O+"Argument not an object: "+i);if(f=l.toFixed(e,r),l.c){var s,h=f.split("."),a=+i.groupSize,o=+i.secondaryGroupSize,c=i.groupSeparator||"",u=h[0],m=h[1],$=l.s<0,E=$?u.slice(1):u,U=E.length;if(o&&(s=a,a=o,o=s,U-=s),a>0&&U>0){for(s=U%a||a,u=E.substr(0,s);s<U;s+=a)u+=c+E.substr(s,a);o>0&&(u+=c+E.slice(s)),$&&(u="-"+u)}f=m?u+(i.decimalSeparator||"")+((o=+i.fractionGroupSize)?m.replace(new RegExp("\\d{"+o+"}\\B","g"),"$&"+(i.fractionGroupSeparator||"")):m):u}return(i.prefix||"")+f+(i.suffix||"")},S.toFraction=function(e){var r,i,f,l,s,h,a,o,c,u,m,$,E=this,U=E.c;if(e!=null&&(a=new b(e),!a.isInteger()&&(a.c||a.s!==1)||a.lt(W)))throw Error(O+"Argument "+(a.isInteger()?"out of range: ":"not an integer: ")+ue(a));if(!U)return new b(E);for(r=new b(W),c=i=new b(W),f=o=new b(W),$=D(U),s=r.e=$.length-E.e-1,r.c[0]=T[(h=s%g)<0?g+h:h],e=!e||a.comparedTo(r)>0?s>0?r:c:a,h=ae,ae=1/0,a=new b($),o.c[0]=0;u=x(a,r,0,1),l=i.plus(u.times(f)),l.comparedTo(e)!=1;)i=f,f=l,c=o.plus(u.times(l=c)),o=l,r=a.minus(u.times(l=r)),a=l;return l=x(e.minus(i),f,0,1),o=o.plus(l.times(c)),i=i.plus(l.times(f)),o.s=c.s=E.s,s=s*2,m=x(c,f,s,G).minus(E).abs().comparedTo(x(o,i,s,G).minus(E).abs())<1?[c,f]:[o,i],ae=h,m},S.toNumber=function(){return+ue(this)},S.toPrecision=function(e,r){return e!=null&&L(e,1,A),Ee(this,e,r,2)},S.toString=function(e){var r,i=this,f=i.s,l=i.e;return l===null?f?(r="Infinity",f<0&&(r="-"+r)):r="NaN":(e==null?r=l<=ee||l>=re?te(D(i.c),l):R(D(i.c),l,"0"):e===10&&Me?(i=ne(new b(i),q+l+1,G),r=R(D(i.c),i.e,"0")):(L(e,2,ge.length,"Base"),r=C(R(D(i.c),l,"0"),10,e,f,!0)),f<0&&i.c[0]&&(r="-"+r)),r},S.valueOf=S.toJSON=function(){return ue(this)},S._isBigNumber=!0,N!=null&&b.set(N),b}function P(N){var x=N|0;return N>0||N===x?x:x-1}function D(N){for(var x,C,I=1,S=N.length,W=N[0]+"";I<S;){for(x=N[I++]+"",C=g-x.length;C--;x="0"+x);W+=x}for(S=W.length;W.charCodeAt(--S)===48;);return W.slice(0,S+1||1)}function F(N,x){var C,I,S=N.c,W=x.c,q=N.s,G=x.s,ee=N.e,re=x.e;if(!q||!G)return null;if(C=S&&!S[0],I=W&&!W[0],C||I)return C?I?0:-G:q;if(q!=G)return q;if(C=q<0,I=ee==re,!S||!W)return I?0:!S^C?1:-1;if(!I)return ee>re^C?1:-1;for(G=(ee=S.length)<(re=W.length)?ee:re,q=0;q<G;q++)if(S[q]!=W[q])return S[q]>W[q]^C?1:-1;return ee==re?0:ee>re^C?1:-1}function L(N,x,C,I){if(N<x||N>C||N!==y(N))throw Error(O+(I||"Argument")+(typeof N=="number"?N<x||N>C?" out of range: ":" not an integer: ":" not a primitive number: ")+String(N))}function Q(N){var x=N.c.length-1;return P(N.e/g)==x&&N.c[x]%2!=0}function te(N,x){return(N.length>1?N.charAt(0)+"."+N.slice(1):N)+(x<0?"e":"e+")+x}function R(N,x,C){var I,S;if(x<0){for(S=C+".";++x;S+=C);N=S+N}else if(I=N.length,++x>I){for(S=C,x-=I;--x;S+=C);N+=S}else x<I&&(N=N.slice(0,x)+"."+N.slice(x));return N}p=X(),p.default=p.BigNumber=p,n.exports?n.exports=p:(t||(t=typeof self<"u"&&self?self:window),t.BigNumber=p)})(Je)})(ze);var We=ze.exports;/*!
|
||
* Copyright (c) 2017 Benjamin Van Ryseghem<benjamin@vanryseghem.com>
|
||
*
|
||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||
* of this software and associated documentation files (the "Software"), to deal
|
||
* in the Software without restriction, including without limitation the rights
|
||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||
* copies of the Software, and to permit persons to whom the Software is
|
||
* furnished to do so, subject to the following conditions:
|
||
*
|
||
* The above copyright notice and this permission notice shall be included in
|
||
* all copies or substantial portions of the Software.
|
||
*
|
||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||
* SOFTWARE.
|
||
*/const le=Re(),bt=ke(),xt=Ue,Ot=We,Y={trillion:Math.pow(10,12),billion:Math.pow(10,9),million:Math.pow(10,6),thousand:Math.pow(10,3)},be={totalLength:0,characteristic:0,forceAverage:!1,average:!1,mantissa:-1,optionalMantissa:!0,thousandSeparated:!1,spaceSeparated:!1,negative:"sign",forceSign:!1,roundingFunction:Math.round,spaceSeparatedAbbreviation:!1},{binarySuffixes:He,decimalSuffixes:Se}=le.currentBytes(),Ie={general:{scale:1024,suffixes:Se},binary:{scale:1024,suffixes:He},decimal:{scale:1e3,suffixes:Se}};function Nt(n,t={},p){if(typeof t=="string"&&(t=xt.parseFormat(t)),!bt.validateFormat(t))return"ERROR: invalid format";let v=t.prefix||"",y=t.postfix||"",O=St(n,t,p);return O=Gt(O,v),O=jt(O,y),O}function St(n,t,p){switch(t.output){case"currency":return t=ye(t,le.currentCurrencyDefaultFormat()),Tt(n,t,le);case"percent":return t=ye(t,le.currentPercentageDefaultFormat()),_t(n,t,le,p);case"byte":return t=ye(t,le.currentByteDefaultFormat()),Et(n,t,le,p);case"time":return t=ye(t,le.currentTimeDefaultFormat()),At(n);case"ordinal":return t=ye(t,le.currentOrdinalDefaultFormat()),Dt(n,t,le);case"number":default:return xe({instance:n,providedFormat:t})}}function Bt(n){let t=Ie.decimal;return Be(n._value,t.suffixes,t.scale).suffix}function $t(n){let t=Ie.binary;return Be(n._value,t.suffixes,t.scale).suffix}function Mt(n){let t=Ie.general;return Be(n._value,t.suffixes,t.scale).suffix}function Be(n,t,p){let d=t[0],v=Math.abs(n);if(v>=p){for(let y=1;y<t.length;++y){let O=Math.pow(p,y),M=Math.pow(p,y+1);if(v>=O&&v<M){d=t[y],n=n/O;break}}d===t[0]&&(n=n/Math.pow(p,t.length-1),d=t[t.length-1])}return{value:n,suffix:d}}function Et(n,t,p,d){let v=t.base||"binary",y=Object.assign({},be,t);const{binarySuffixes:O,decimalSuffixes:M}=p.currentBytes();let g={general:{scale:1024,suffixes:M||Se,marker:"bd"},binary:{scale:1024,suffixes:O||He,marker:"b"},decimal:{scale:1e3,suffixes:M||Se,marker:"d"}}[v],{value:B,suffix:T}=Be(n._value,g.suffixes,g.scale);return`${xe({instance:d(B),providedFormat:t,state:p,defaults:p.currentByteDefaultFormat()})}${y.spaceSeparated?" ":""}${T}`}function Dt(n,t,p){let d=p.currentOrdinal(),v=Object.assign({},be,t),y=xe({instance:n,providedFormat:t,state:p}),O=d(n._value);return`${y}${v.spaceSeparated?" ":""}${O}`}function At(n){let t=Math.floor(n._value/60/60),p=Math.floor((n._value-t*60*60)/60),d=Math.round(n._value-t*60*60-p*60);return`${t}:${p<10?"0":""}${p}:${d<10?"0":""}${d}`}function _t(n,t,p,d){let v=t.prefixSymbol,y=xe({instance:d(n._value*100),providedFormat:t,state:p}),O=Object.assign({},be,t);return v?`%${O.spaceSeparated?" ":""}${y}`:`${y}${O.spaceSeparated?" ":""}%`}function Tt(n,t,p){const d=p.currentCurrency();let v=Object.assign({},t),y=Object.assign({},be,v),O,M="",w=!!y.totalLength||!!y.forceAverage||y.average,g=v.currencyPosition||d.position,B=v.currencySymbol||d.symbol;const T=y.spaceSeparatedCurrency!==void 0?y.spaceSeparatedCurrency:y.spaceSeparated;v.lowPrecision===void 0&&(v.lowPrecision=!1),T&&(M=" "),g==="infix"&&(O=M+B+M);let _=xe({instance:n,providedFormat:v,state:p,decimalSeparator:O});return g==="prefix"&&(n._value<0&&y.negative==="sign"?_=`-${M}${B}${_.slice(1)}`:n._value>0&&y.forceSign?_=`+${M}${B}${_.slice(1)}`:_=B+M+_),(!g||g==="postfix")&&(M=!y.spaceSeparatedAbbreviation&&w?"":M,_=_+M+B),_}function Lt({value:n,forceAverage:t,lowPrecision:p=!0,abbreviations:d,spaceSeparated:v=!1,totalLength:y=0,roundingFunction:O=Math.round}){let M="",w=Math.abs(n),g=-1;if(t&&d[t]&&Y[t]?(M=d[t],n=n/Y[t]):w>=Y.trillion||p&&O(w/Y.trillion)===1?(M=d.trillion,n=n/Y.trillion):w<Y.trillion&&w>=Y.billion||p&&O(w/Y.billion)===1?(M=d.billion,n=n/Y.billion):w<Y.billion&&w>=Y.million||p&&O(w/Y.million)===1?(M=d.million,n=n/Y.million):(w<Y.million&&w>=Y.thousand||p&&O(w/Y.thousand)===1)&&(M=d.thousand,n=n/Y.thousand),M&&(M=(v?" ":"")+M),y){let T=n<0,_=n.toString().split(".")[0],A=T?_.length-1:_.length;g=Math.max(y-A,0)}return{value:n,abbreviation:M,mantissaPrecision:g}}function Ct({value:n,characteristicPrecision:t}){let[p,d]=n.toExponential().split("e"),v=+p;if(!t)return{value:v,abbreviation:`e${d}`};let y=1;return y<t&&(v=v*Math.pow(10,t-y),d=+d-(t-y),d=d>=0?`+${d}`:d),{value:v,abbreviation:`e${d}`}}function Ne(n){let t="";for(let p=0;p<n;p++)t+="0";return t}function Pt(n,t){let p=n.toString(),[d,v]=p.split("e"),[y,O=""]=d.split(".");if(+v>0)p=y+O+Ne(v-O.length);else{let M=".";+y<0?M=`-0${M}`:M=`0${M}`;let w=(Ne(-v-1)+Math.abs(y)+O).substr(0,t);w.length<t&&(w+=Ne(t-w.length)),p=M+w}return+v>0&&t>0&&(p+=`.${Ne(t)}`),p}function kt(n,t,p=Math.round){return n.toString().indexOf("e")!==-1?Pt(n,t):new Ot(p(+`${n}e+${t}`)/Math.pow(10,t)).toFixed(t)}function Ut(n,t,p,d,v,y){if(d===-1)return n;let O=kt(t,d,y),[M,w=""]=O.toString().split(".");if(w.match(/^0+$/)&&(p||v))return M;let g=w.match(/0+$/);return v&&g?`${M}.${w.toString().slice(0,g.index)}`:O.toString()}function Rt(n,t,p,d){let v=n,[y,O]=v.toString().split(".");if(y.match(/^-?0$/)&&p)return O?`${y.replace("0","")}.${O}`:y.replace("0","");const M=t<0&&y.indexOf("-")===0;if(M&&(y=y.slice(1),v=v.slice(1)),y.length<d){let w=d-y.length;for(let g=0;g<w;g++)v=`0${v}`}return M&&(v=`-${v}`),v.toString()}function It(n,t){let p=[],d=0;for(let v=n;v>0;v--)d===t&&(p.unshift(v),d=0),d++;return p}function Ft(n,t,p,d,v){let y=d.currentDelimiters(),O=y.thousands;v=v||y.decimal;let M=y.thousandsSize||3,w=n.toString(),g=w.split(".")[0],B=w.split(".")[1];const T=t<0&&g.indexOf("-")===0;return p&&(T&&(g=g.slice(1)),It(g.length,M).forEach((A,X)=>{g=g.slice(0,A+X)+O+g.slice(A+X)}),T&&(g=`-${g}`)),B?w=g+v+B:w=g,w}function Vt(n,t){return n+t}function qt(n,t,p){return t===0?n:+n==0?n.replace("-",""):t>0?`+${n}`:p==="sign"?n:`(${n.replace("-","")})`}function Gt(n,t){return t+n}function jt(n,t){return n+t}function xe({instance:n,providedFormat:t,state:p=le,decimalSeparator:d,defaults:v=p.currentDefaults()}){let y=n._value;if(y===0&&p.hasZeroFormat())return p.getZeroFormat();if(!isFinite(y))return y.toString();let O=Object.assign({},be,v,t),M=O.totalLength,w=M?0:O.characteristic,g=O.optionalCharacteristic,B=O.forceAverage,T=O.lowPrecision,_=!!M||!!B||O.average,A=M?-1:_&&t.mantissa===void 0?0:O.mantissa,X=M?!1:t.optionalMantissa===void 0?A===-1:O.optionalMantissa,P=O.trimMantissa,D=O.thousandSeparated,F=O.spaceSeparated,L=O.negative,Q=O.forceSign,te=O.exponential,R=O.roundingFunction,N="";if(_){let C=Lt({value:y,forceAverage:B,lowPrecision:T,abbreviations:p.currentAbbreviations(),spaceSeparated:F,roundingFunction:R,totalLength:M});y=C.value,N+=C.abbreviation,M&&(A=C.mantissaPrecision)}if(te){let C=Ct({value:y,characteristicPrecision:w});y=C.value,N=C.abbreviation+N}let x=Ut(y.toString(),y,X,A,P,R);return x=Rt(x,y,g,w),x=Ft(x,y,D,p,d),(_||te)&&(x=Vt(x,N)),(Q||y<0)&&(x=qt(x,y,L)),x}function ye(n,t){if(!n)return t;let p=Object.keys(n);return p.length===1&&p[0]==="output"?t:n}var Zt=n=>({format:(...t)=>Nt(...t,n),getByteUnit:(...t)=>Mt(...t,n),getBinaryByteUnit:(...t)=>$t(...t,n),getDecimalByteUnit:(...t)=>Bt(...t,n),formatOrDefault:ye});/*!
|
||
* Copyright (c) 2017 Benjamin Van Ryseghem<benjamin@vanryseghem.com>
|
||
*
|
||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||
* of this software and associated documentation files (the "Software"), to deal
|
||
* in the Software without restriction, including without limitation the rights
|
||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||
* copies of the Software, and to permit persons to whom the Software is
|
||
* furnished to do so, subject to the following conditions:
|
||
*
|
||
* The above copyright notice and this permission notice shall be included in
|
||
* all copies or substantial portions of the Software.
|
||
*
|
||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||
* SOFTWARE.
|
||
*/const fe=We;function zt(n,t,p){let d=new fe(n._value),v=t;return p.isNumbro(t)&&(v=t._value),v=new fe(v),n._value=d.plus(v).toNumber(),n}function Xe(n,t,p){let d=new fe(n._value),v=t;return p.isNumbro(t)&&(v=t._value),v=new fe(v),n._value=d.minus(v).toNumber(),n}function Wt(n,t,p){let d=new fe(n._value),v=t;return p.isNumbro(t)&&(v=t._value),v=new fe(v),n._value=d.times(v).toNumber(),n}function Ht(n,t,p){let d=new fe(n._value),v=t;return p.isNumbro(t)&&(v=t._value),v=new fe(v),n._value=d.dividedBy(v).toNumber(),n}function Xt(n,t,p){let d=t;return p.isNumbro(t)&&(d=t._value),n._value=d,n}function Yt(n,t,p){let d=p(n._value);return Xe(d,t,p),Math.abs(d._value)}var Kt=n=>({add:(t,p)=>zt(t,p,n),subtract:(t,p)=>Xe(t,p,n),multiply:(t,p)=>Wt(t,p,n),divide:(t,p)=>Ht(t,p,n),set:(t,p)=>Xt(t,p,n),difference:(t,p)=>Yt(t,p,n),BigNumber:fe});/*!
|
||
* Copyright (c) 2017 Benjamin Van Ryseghem<benjamin@vanryseghem.com>
|
||
*
|
||
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
||
* of this software and associated documentation files (the "Software"), to deal
|
||
* in the Software without restriction, including without limitation the rights
|
||
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||
* copies of the Software, and to permit persons to whom the Software is
|
||
* furnished to do so, subject to the following conditions:
|
||
*
|
||
* The above copyright notice and this permission notice shall be included in
|
||
* all copies or substantial portions of the Software.
|
||
*
|
||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||
* SOFTWARE.
|
||
*/const Jt="2.5.0",se=Re(),Qt=ke(),er=wt(z),tr=Ze();let de=Zt(z),me=Kt(z);const rr=Ue;class Ye{constructor(t){this._value=t}clone(){return z(this._value)}format(t={}){return de.format(this,t)}formatCurrency(t){return typeof t=="string"&&(t=rr.parseFormat(t)),t=de.formatOrDefault(t,se.currentCurrencyDefaultFormat()),t.output="currency",de.format(this,t)}formatTime(t={}){return t.output="time",de.format(this,t)}binaryByteUnits(){return de.getBinaryByteUnit(this)}decimalByteUnits(){return de.getDecimalByteUnit(this)}byteUnits(){return de.getByteUnit(this)}difference(t){return me.difference(this,t)}add(t){return me.add(this,t)}subtract(t){return me.subtract(this,t)}multiply(t){return me.multiply(this,t)}divide(t){return me.divide(this,t)}set(t){return me.set(this,Ke(t))}value(){return this._value}valueOf(){return this._value}}function Ke(n){let t=n;return z.isNumbro(n)?t=n._value:typeof n=="string"?t=z.unformat(n):isNaN(n)&&(t=NaN),t}function z(n){return new Ye(Ke(n))}z.version=Jt;z.isNumbro=function(n){return n instanceof Ye};z.language=se.currentLanguage;z.registerLanguage=se.registerLanguage;z.setLanguage=se.setLanguage;z.languages=se.languages;z.languageData=se.languageData;z.zeroFormat=se.setZeroFormat;z.defaultFormat=se.currentDefaults;z.setDefaults=se.setDefaults;z.defaultCurrencyFormat=se.currentCurrencyDefaultFormat;z.validate=Qt.validate;z.loadLanguagesInNode=er.loadLanguagesInNode;z.unformat=tr.unformat;z.BigNumber=me.BigNumber;var nr=z,ir=Qe(nr);export{ir as n};
|