Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

a-calc

Package Overview
Dependencies
Maintainers
1
Versions
161
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

a-calc - npm Package Compare versions

Comparing version 1.2.8 to 1.2.9

2

browser/index.js

@@ -1,1 +0,1 @@

var a_calc=function(e){"use strict";function z(e){return(z="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function _(e){return function(e){if(Array.isArray(e))return n(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){var r;if(e)return"string"==typeof e?n(e,t):"Map"===(r="Object"===(r=Object.prototype.toString.call(e).slice(8,-1))&&e.constructor?e.constructor.name:r)||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?n(e,t):void 0}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function n(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var O="1.2.8",N=/^[+-]?\d[\d.]*(?:e\+|E\+|e-|E-|e|E)?\d*$/,S=/^[+-]?\d[\d.]*(?:e\+|E\+|e-|E-|e|E)?\d*\D*$/;function A(e){return-1<"+-*/%()**".indexOf(e)}function k(e){switch(e){case"+":case"-":return 1;case"*":case"/":case"%":return 2;case"**":return 3;default:return 0}}function p(e){return void 0!==e}function x(e){return null===e}function g(e){return null!==e}function u(e){return"string"==typeof e&&!!N.test(e)}var o={initial:"initial",number:"number",variable:"var",symbol:"symbol",percent:"percent",round:"round",plus:"plus",comma:"comma",fraction:"fraction",to_number:"to-number",scientific:"scientific"},j="<>=";function P(e){for(var t=o.initial,r=[],n=[];e;){var i=e[0];if(t===o.initial)if(/\s/.test(i))e=e.slice(1);else if(j.includes(i))t=o.symbol,r.push(i),e=e.slice(1);else if(","===i)t=o.initial,n.push({type:"comma",value:i}),e=e.slice(1);else if(/[a-zA-Z_]/.test(i))t=o.variable,r.push(i),e=e.slice(1);else if(/\d/.test(i))t=o.number,r.push(i),e=e.slice(1);else if("+"===i)t=o.initial,n.push({type:"plus",value:i}),e=e.slice(1);else if("~"===i)t=o.round,r.push(i),e=e.slice(1);else if("%"===i)t=o.initial,n.push({type:"percent",value:i}),e=e.slice(1);else if("/"===i)t=o.initial,n.push({type:"fraction",value:i}),e=e.slice(1);else{if("!"!==i)throw new Error("不识别的fmt字符:".concat(i));if(t=o.initial,/[Ee]/.test(e[1]))n.push({type:"scientific",value:e[1]});else{if(!/[Nn]/.test(e[1]))throw new Error("不识别的fmt字符:".concat(e.slice(2)));n.push({type:"to-number",value:e[1]})}e=e.slice(2)}else if(t===o.number)/\d/.test(i)?(r.push(i),e=e.slice(1)):(n.push({type:"number",value:r.join("")}),r.length=0,t=o.initial);else if(t===o.variable)/[\$\w_\-.\[\]"']/.test(i)?(r.push(i),e=e.slice(1)):(n.push({type:"var",value:r.join("")}),r.length=0,t=o.initial);else if(t===o.symbol)/\s/.test(i)?e=e.slice(1):j.includes(i)?(r.push(i),e=e.slice(1)):(n.push({type:"symbol",value:r.join("")}),r.length=0,t=o.initial);else{if(t!==o.round)throw new Error("错误的自动机状态");if(/\s/.test(i))e=e.slice(1);else{if(!("56+-".includes(i)&&r.length<2))throw new Error("舍入格式化语法错误:".concat(i));r.push(i),e=e.slice(1),n.push({type:"round",value:r.join("")}),r.length=0,t=o.initial}}}if(0<r.length&&(n.push({type:t,value:r.join("")}),r.length=0,t=o.initial),1<n.filter(function(e){return"number"===e.type}).length)throw new Error("格式化字符串错误,发现多余的数字");return n}var t="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},r=Array.isArray,t="object"==z(t)&&t&&t.Object===Object&&t,i="object"==("undefined"==typeof self?"undefined":z(self))&&self&&self.Object===Object&&self,t=t||i||Function("return this")(),i=t.Symbol,l=Object.prototype,C=l.hasOwnProperty,$=l.toString,s=i?i.toStringTag:void 0;var T=Object.prototype.toString;var B=function(e){var t=C.call(e,s),r=e[s];try{var n=!(e[s]=void 0)}catch(e){}var i=$.call(e);return n&&(t?e[s]=r:delete e[s]),i},I=function(e){return T.call(e)},R=i?i.toStringTag:void 0;function Y(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":(R&&R in Object(e)?B:I)(e)}var K=Y,Q=function(e){return null!=e&&"object"==z(e)};function c(e){return"symbol"==z(e)||Q(e)&&"[object Symbol]"==K(e)}var ee=r,te=c,re=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,ne=/^\w*$/;function ie(e,t){var r;return!ee(e)&&(!("number"!=(r=z(e))&&"symbol"!=r&&"boolean"!=r&&null!=e&&!te(e))||ne.test(e)||!re.test(e)||null!=t&&e in Object(t))}function oe(e){var t=z(e);return null!=e&&("object"==t||"function"==t)}var le=Y,se=oe;function ce(e){return!!se(e)&&("[object Function]"==(e=le(e))||"[object GeneratorFunction]"==e||"[object AsyncFunction]"==e||"[object Proxy]"==e)}var l=t["__core-js_shared__"],ue=(l=/[^.]+$/.exec(l&&l.keys&&l.keys.IE_PROTO||""))?"Symbol(src)_1."+l:"";var ae=Function.prototype.toString;var fe=ce,he=function(e){return!!ue&&ue in e},pe=oe,ge=function(e){if(null!=e){try{return ae.call(e)}catch(e){}try{return e+""}catch(e){}}return""},de=/^\[object .+?Constructor\]$/,l=Function.prototype,a=Object.prototype,l=l.toString,a=a.hasOwnProperty,ve=RegExp("^"+l.call(a).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");var me=function(e){return!(!pe(e)||he(e))&&(fe(e)?ve:de).test(ge(e))},ye=function(e,t){return null==e?void 0:e[t]};function be(e,t){return e=ye(e,t),me(e)?e:void 0}var l=be(Object,"create"),we=l;var _e=l,Ee=Object.prototype.hasOwnProperty;var Oe=l,Ne=Object.prototype.hasOwnProperty;var Se=l;function Ae(e){return e=this.has(e)&&delete this.__data__[e],this.size-=e?1:0,e}function ke(e){var t,r=this.__data__;return _e?"__lodash_hash_undefined__"===(t=r[e])?void 0:t:Ee.call(r,e)?r[e]:void 0}function xe(e){var t=this.__data__;return Oe?void 0!==t[e]:Ne.call(t,e)}function je(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=Se&&void 0===t?"__lodash_hash_undefined__":t,this}function f(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}f.prototype.clear=function(){this.__data__=we?we(null):{},this.size=0},f.prototype.delete=Ae,f.prototype.get=ke,f.prototype.has=xe,f.prototype.set=je;a=f;var Pe=function(e,t){return e===t||e!=e&&t!=t};function h(e,t){for(var r=e.length;r--;)if(Pe(e[r][0],t))return r;return-1}var Ce=h,$e=Array.prototype.splice;var Te=h;var Be=h;var Ie=h;function Re(e){var t=this.__data__;return!((e=Ce(t,e))<0||(e==t.length-1?t.pop():$e.call(t,e,1),--this.size,0))}function ze(e){var t=this.__data__;return(e=Te(t,e))<0?void 0:t[e][1]}function De(e){return-1<Be(this.__data__,e)}function Ue(e,t){var r=this.__data__,n=Ie(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this}function d(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}d.prototype.clear=function(){this.__data__=[],this.size=0},d.prototype.delete=Re,d.prototype.get=ze,d.prototype.has=De,d.prototype.set=Ue;var l=d,t=be(t,"Map"),Fe=a,Le=l,Me=t;var Ge=function(e){var t=z(e);return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e};function v(e,t){return e=e.__data__,Ge(t)?e["string"==typeof t?"string":"hash"]:e.map}var qe=v;var Je=v;var He=v;var Ve=v;function We(e){return e=qe(this,e).delete(e),this.size-=e?1:0,e}function Ze(e){return Je(this,e).get(e)}function Xe(e){return He(this,e).has(e)}function Ye(e,t){var r=Ve(this,e),n=r.size;return r.set(e,t),this.size+=r.size==n?0:1,this}function m(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}m.prototype.clear=function(){this.size=0,this.__data__={hash:new Fe,map:new(Me||Le),string:new Fe}},m.prototype.delete=We,m.prototype.get=Ze,m.prototype.has=Xe,m.prototype.set=Ye;var Ke=m;function Qe(n,i){if("function"!=typeof n||null!=i&&"function"!=typeof i)throw new TypeError("Expected a function");function o(){var e=arguments,t=i?i.apply(this,e):e[0],r=o.cache;return r.has(t)?r.get(t):(e=n.apply(this,e),o.cache=r.set(t,e)||r,e)}return o.cache=new(Qe.Cache||Ke),o}Qe.Cache=Ke;var et=Qe;var tt=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,rt=/\\(\\)?/g,a=function(e){var t=(e=et(e,function(e){return 500===t.size&&t.clear(),e})).cache;return e}(function(e){var i=[];return 46===e.charCodeAt(0)&&i.push(""),e.replace(tt,function(e,t,r,n){i.push(r?n.replace(rt,"$1"):t||e)}),i});var nt=function(e,t){for(var r=-1,n=null==e?0:e.length,i=Array(n);++r<n;)i[r]=t(e[r],r,e);return i},it=r,ot=c,l=i?i.prototype:void 0,lt=l?l.toString:void 0;var st=function e(t){var r;return"string"==typeof t?t:it(t)?nt(t,e)+"":ot(t)?lt?lt.call(t):"":"0"==(r=t+"")&&1/t==-1/0?"-0":r};var ct=r,ut=ie,at=a,ft=function(e){return null==e?"":st(e)};var ht=c;var pt=function(e,t){return ct(e)?e:ut(e,t)?[e]:at(ft(e))},gt=function(e){var t;return"string"==typeof e||ht(e)?e:"0"==(t=e+"")&&1/e==-1/0?"-0":t};var dt=function(e,t){for(var r=0,n=(t=pt(t,e)).length;null!=e&&r<n;)e=e[gt(t[r++])];return r&&r==n?e:void 0};var y=function(e,t,r){return void 0===(e=null==e?void 0:dt(e,t))?r:e};var b={initial:"initial",number:"number",scientific:"scientific",operator:"operator",bracket:"bracket",var:"var"},vt="+-",mt="*/%",yt="()";function bt(e,t){for(var r,n,i,o=1<arguments.length&&void 0!==t&&t,l=b.initial,s=[],c=[],u=function(){s.push(r),e=e.slice(1)},a=function(e){c.push({type:e,value:s.join("")}),s.length=0},f=function(){e=e.slice(1)};e;)switch(r=e[0],l){case b.initial:if(vt.includes(r)){var h=c.at(-1),l=0===c.length||"operator"===h.type||"("===h?b.number:b.operator;u()}else if(mt.includes(r))l=b.operator,u();else if(/\d/.test(r))l=b.number,u();else if(yt.includes(r))l=b.bracket;else if(/[a-zA-Z_$]/.test(r))l=b.var,u();else{if(!/\s/.test(r))throw new Error("不识别的字符".concat(r));f()}break;case b.bracket:c.push({type:b.bracket,value:r}),f(),l=b.initial;break;case b.operator:h=s.at(-1);"*"===r&&"*"===h&&u(),a(b.operator),l=b.initial;break;case b.number:if(/\d/.test(r))u();else if("."===r){if(0===s.length||s.includes("."))throw new Error("非法的小数部分".concat(s.join("")));u()}else"Ee".includes(r)?(l=b.scientific,u()):["auto","on",!0].includes(o)&&/[^*/+\-()\s]/.test(r)||"space"===o&&/\S/.test(r)?u():(a(b.number),l=b.initial);break;case b.scientific:/\d/.test(r)?u():vt.includes(r)?(n=s.slice(1),i=s.at(-1),n.includes(r)||!/[Ee]/.test(i)?(a(b.scientific),l=b.initial):u()):["auto","on",!0].includes(o)&&/[^*/+\-()\s]/.test(r)||"space"===o&&/\S/.test(r)?u():(a(b.scientific),l=b.initial);break;case b.var:/[\w_.\[\]"']/.test(r)?u():(a(b.var),l=b.initial);break;default:throw new Error("状态错误")}return 0!==s.length&&(c.push({type:l,value:s.join("")}),s.length=0,l=b.initial),c}function wt(e,t,r){if(x(t))throw new Error("错误的填充数据:",t);for(var n=[],i=0;i<e.length;i++){var o=e[i];if("var"!==o.type)n.push(o);else{if("undefined"===o.value||"NaN"===o.value)throw new Error("key不应该为:".concat(o.value));for(var l=null,s=0;s<t.length;s++){var c=t[s],c=y(c,o.value);if(void 0!==c){l=c;break}}if(null===l)throw new Error("token填充失败,请确认".concat(o,"存在"));if("string"==typeof l){if(""===l.trim())throw new Error("token填充失败,".concat(o.value,"值不可为空字符"));if([!0,"on","auto","space"].includes(r)){if(!S.test(l))throw new Error("token填充失败,".concat(o.value,"值:").concat(l,"为非法单位数字"))}else if(!u(l))throw new Error("token填充失败,".concat(o,"值:").concat(l,"为非法数字"))}l="string"!=typeof l?l.toString():l,n.push({type:"number",value:l})}}return n}function _t(e){for(var t,r=[],n=[],i=e.map(function(e){return e.value});0<i.length;){var o=i.shift();if(A(o))if("("===o)r.push(o);else if(")"===o){for(var l=r.pop();"("!==l&&0<r.length;)n.push(l),l=r.pop();if("("!==l)throw"error: unmatched ()"}else{for(;t=r[r.length-1],k(o)<=k(t)&&0<r.length;)n.push(r.pop());r.push(o)}else n.push(o)}if(0<r.length){if(")"===r[r.length-1]||"("===r[r.length-1])throw"error: unmatched ()";for(;0<r.length;)n.push(r.pop())}return n}var Et=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,Ot=Math.ceil,D=Math.floor,U="[BigNumber Error] ",Nt=U+"Number primitive has more than 15 significant digits: ",F=1e14,L=14,St=9007199254740991,At=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],M=1e7,G=1e9;function q(e){var t=0|e;return 0<e||e===t?t:t-1}function J(e){for(var t,r,n=1,i=e.length,o=e[0]+"";n<i;){for(t=e[n++]+"",r=L-t.length;r--;t="0"+t);o+=t}for(i=o.length;48===o.charCodeAt(--i););return o.slice(0,i+1||1)}function H(e,t){var r,n,i=e.c,o=t.c,l=e.s,s=t.s,e=e.e,t=t.e;if(!l||!s)return null;if(r=i&&!i[0],n=o&&!o[0],r||n)return r?n?0:-s:l;if(l!=s)return l;if(r=l<0,n=e==t,!i||!o)return n?0:!i^r?1:-1;if(!n)return t<e^r?1:-1;for(s=(e=i.length)<(t=o.length)?e:t,l=0;l<s;l++)if(i[l]!=o[l])return i[l]>o[l]^r?1:-1;return e==t?0:t<e^r?1:-1}function V(e,t,r,n){if(e<t||r<e||e!==D(e))throw Error(U+(n||"Argument")+("number"==typeof e?e<t||r<e?" out of range: ":" not an integer: ":" not a primitive number: ")+String(e))}function W(e){var t=e.c.length-1;return q(e.e/L)==t&&e.c[t]%2!=0}function Z(e,t){return(1<e.length?e.charAt(0)+"."+e.slice(1):e)+(t<0?"e":"e+")+t}function X(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}var E=function R(e){var v,f,h,t,u,m,l,s,c,a,p,r=x.prototype={constructor:x,toString:null,valueOf:null},g=new x(1),y=20,b=4,d=-7,w=21,_=-1e7,E=1e7,O=!1,i=1,N=0,S={prefix:"",groupSize:3,secondaryGroupSize:0,groupSeparator:",",decimalSeparator:".",fractionGroupSize:0,fractionGroupSeparator:" ",suffix:""},A="0123456789abcdefghijklmnopqrstuvwxyz",k=!0;function x(e,t){var r,n,i,o,l,s,c,u,a=this;if(!(a instanceof x))return new x(e,t);if(null==t){if(e&&!0===e._isBigNumber)return a.s=e.s,void(!e.c||e.e>E?a.c=a.e=null:e.e<_?a.c=[a.e=0]:(a.e=e.e,a.c=e.c.slice()));if((s="number"==typeof e)&&0*e==0){if(a.s=1/e<0?(e=-e,-1):1,e===~~e){for(o=0,l=e;10<=l;l/=10,o++);return void(E<o?a.c=a.e=null:(a.e=o,a.c=[e]))}u=String(e)}else{if(!Et.test(u=String(e)))return h(a,u,s);a.s=45==u.charCodeAt(0)?(u=u.slice(1),-1):1}0<(l=(u=-1<(o=u.indexOf("."))?u.replace(".",""):u).search(/e/i))?(o<0&&(o=l),o+=+u.slice(l+1),u=u.substring(0,l)):o<0&&(o=u.length)}else{if(V(t,2,A.length,"Base"),10==t&&k)return B(a=new x(e),y+a.e+1,b);if(u=String(e),s="number"==typeof e){if(0*e!=0)return h(a,u,s,t);if(a.s=1/e<0?(u=u.slice(1),-1):1,x.DEBUG&&15<u.replace(/^0\.0*|\./,"").length)throw Error(Nt+e)}else a.s=45===u.charCodeAt(0)?(u=u.slice(1),-1):1;for(r=A.slice(0,t),o=l=0,c=u.length;l<c;l++)if(r.indexOf(n=u.charAt(l))<0){if("."==n){if(o<l){o=c;continue}}else if(!i&&(u==u.toUpperCase()&&(u=u.toLowerCase())||u==u.toLowerCase()&&(u=u.toUpperCase()))){i=!0,l=-1,o=0;continue}return h(a,String(e),s,t)}s=!1,-1<(o=(u=f(u,t,10,a.s)).indexOf("."))?u=u.replace(".",""):o=u.length}for(l=0;48===u.charCodeAt(l);l++);for(c=u.length;48===u.charCodeAt(--c););if(u=u.slice(l,++c)){if(c-=l,s&&x.DEBUG&&15<c&&(St<e||e!==D(e)))throw Error(Nt+a.s*e);if((o=o-l-1)>E)a.c=a.e=null;else if(o<_)a.c=[a.e=0];else{if(a.e=o,a.c=[],l=(o+1)%L,o<0&&(l+=L),l<c){for(l&&a.c.push(+u.slice(0,l)),c-=L;l<c;)a.c.push(+u.slice(l,l+=L));l=L-(u=u.slice(l)).length}else l-=c;for(;l--;u+="0");a.c.push(+u)}}else a.c=[a.e=0]}function j(e,t,r,n){for(var i,o,l=[0],s=0,c=e.length;s<c;){for(o=l.length;o--;l[o]*=t);for(l[0]+=n.indexOf(e.charAt(s++)),i=0;i<l.length;i++)r-1<l[i]&&(null==l[i+1]&&(l[i+1]=0),l[i+1]+=l[i]/r|0,l[i]%=r)}return l.reverse()}function P(e,t,r){var n,i,o,l=0,s=e.length,c=t%M,u=t/M|0;for(e=e.slice();s--;)l=((i=c*(o=e[s]%M)+(n=u*o+(o=e[s]/M|0)*c)%M*M+l)/r|0)+(n/M|0)+u*o,e[s]=i%r;return e=l?[l].concat(e):e}function C(e,t,r,n){var i,o;if(r!=n)o=n<r?1:-1;else for(i=o=0;i<r;i++)if(e[i]!=t[i]){o=e[i]>t[i]?1:-1;break}return o}function $(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]&&1<e.length;e.splice(0,1));}function n(e,t,r,n){var i,o,l,s;if(null==r?r=b:V(r,0,8),!e.c)return e.toString();if(i=e.c[0],o=e.e,null==t)s=J(e.c),s=1==n||2==n&&(o<=d||w<=o)?Z(s,o):X(s,o,"0");else if(r=(e=B(new x(e),t,r)).e,l=(s=J(e.c)).length,1==n||2==n&&(t<=r||r<=d)){for(;l<t;s+="0",l++);s=Z(s,r)}else if(t-=o,s=X(s,r,"0"),l<r+1){if(0<--t)for(s+=".";t--;s+="0");}else if(0<(t+=r-l))for(r+1==l&&(s+=".");t--;s+="0");return e.s<0&&i?"-"+s:s}function o(e,t){for(var r,n=1,i=new x(e[0]);n<e.length;n++){if(!(r=new x(e[n])).s){i=r;break}t.call(i,r)&&(i=r)}return i}function T(e,t,r){for(var n=1,i=t.length;!t[--i];t.pop());for(i=t[0];10<=i;i/=10,n++);return(r=n+r*L-1)>E?e.c=e.e=null:r<_?e.c=[e.e=0]:(e.e=r,e.c=t),e}function B(e,t,r,n){var i,o,l,s,c,u,a,f=e.c,h=At;if(f){e:{for(i=1,s=f[0];10<=s;s/=10,i++);if((o=t-i)<0)o+=L,l=t,a=(c=f[u=0])/h[i-l-1]%10|0;else if((u=Ot((o+1)/L))>=f.length){if(!n)break e;for(;f.length<=u;f.push(0));c=a=0,l=(o%=L)-L+(i=1)}else{for(c=s=f[u],i=1;10<=s;s/=10,i++);a=(l=(o%=L)-L+i)<0?0:c/h[i-l-1]%10|0}if(n=n||t<0||null!=f[u+1]||(l<0?c:c%h[i-l-1]),n=r<4?(a||n)&&(0==r||r==(e.s<0?3:2)):5<a||5==a&&(4==r||n||6==r&&(0<o?0<l?c/h[i-l]:0:f[u-1])%10&1||r==(e.s<0?8:7)),t<1||!f[0])return f.length=0,n?(t-=e.e+1,f[0]=h[(L-t%L)%L],e.e=-t||0):f[0]=e.e=0,e;if(0==o?(f.length=u,s=1,u--):(f.length=u+1,s=h[L-o],f[u]=0<l?D(c/h[i-l]%h[l])*s:0),n)for(;;){if(0==u){for(o=1,l=f[0];10<=l;l/=10,o++);for(l=f[0]+=s,s=1;10<=l;l/=10,s++);o!=s&&(e.e++,f[0]==F)&&(f[0]=1);break}if(f[u]+=s,f[u]!=F)break;f[u--]=0,s=1}for(o=f.length;0===f[--o];f.pop());}e.e>E?e.c=e.e=null:e.e<_&&(e.c=[e.e=0])}return e}function I(e){var t,r=e.e;return null===r?e.toString():(t=J(e.c),t=r<=d||w<=r?Z(t,r):X(t,r,"0"),e.s<0?"-"+t:t)}return x.clone=R,x.ROUND_UP=0,x.ROUND_DOWN=1,x.ROUND_CEIL=2,x.ROUND_FLOOR=3,x.ROUND_HALF_UP=4,x.ROUND_HALF_DOWN=5,x.ROUND_HALF_EVEN=6,x.ROUND_HALF_CEIL=7,x.ROUND_HALF_FLOOR=8,x.EUCLID=9,x.config=x.set=function(e){var t,r;if(null!=e){if("object"!=z(e))throw Error(U+"Object expected: "+e);if(e.hasOwnProperty(t="DECIMAL_PLACES")&&(V(r=e[t],0,G,t),y=r),e.hasOwnProperty(t="ROUNDING_MODE")&&(V(r=e[t],0,8,t),b=r),e.hasOwnProperty(t="EXPONENTIAL_AT")&&((r=e[t])&&r.pop?(V(r[0],-G,0,t),V(r[1],0,G,t),d=r[0],w=r[1]):(V(r,-G,G,t),d=-(w=r<0?-r:r))),e.hasOwnProperty(t="RANGE"))if((r=e[t])&&r.pop)V(r[0],-G,-1,t),V(r[1],1,G,t),_=r[0],E=r[1];else{if(V(r,-G,G,t),!r)throw Error(U+t+" cannot be zero: "+r);_=-(E=r<0?-r:r)}if(e.hasOwnProperty(t="CRYPTO")){if((r=e[t])!==!!r)throw Error(U+t+" not true or false: "+r);if(r&&("undefined"==typeof crypto||!crypto||!crypto.getRandomValues&&!crypto.randomBytes))throw O=!r,Error(U+"crypto unavailable");O=r}if(e.hasOwnProperty(t="MODULO_MODE")&&(V(r=e[t],0,9,t),i=r),e.hasOwnProperty(t="POW_PRECISION")&&(V(r=e[t],0,G,t),N=r),e.hasOwnProperty(t="FORMAT")){if("object"!=z(r=e[t]))throw Error(U+t+" not an object: "+r);S=r}if(e.hasOwnProperty(t="ALPHABET")){if("string"!=typeof(r=e[t])||/^.?$|[+\-.\s]|(.).*\1/.test(r))throw Error(U+t+" invalid: "+r);k="0123456789"==r.slice(0,10),A=r}}return{DECIMAL_PLACES:y,ROUNDING_MODE:b,EXPONENTIAL_AT:[d,w],RANGE:[_,E],CRYPTO:O,MODULO_MODE:i,POW_PRECISION:N,FORMAT:S,ALPHABET:A}},x.isBigNumber=function(e){if(!e||!0!==e._isBigNumber)return!1;if(!x.DEBUG)return!0;var t,r,n=e.c,i=e.e,o=e.s;e:if("[object Array]"=={}.toString.call(n)){if((1===o||-1===o)&&-G<=i&&i<=G&&i===D(i))if(0===n[0]){if(0===i&&1===n.length)return!0}else 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||F<=r||r!==D(r))break e;if(0!==r)return!0}}else if(null===n&&null===i&&(null===o||1===o||-1===o))return!0;throw Error(U+"Invalid BigNumber: "+e)},x.maximum=x.max=function(){return o(arguments,r.lt)},x.minimum=x.min=function(){return o(arguments,r.gt)},x.random=(t=9007199254740992,u=Math.random()*t&2097151?function(){return D(Math.random()*t)}:function(){return 8388608*(1073741824*Math.random()|0)+(8388608*Math.random()|0)},function(e){var t,r,n,i,o,l=0,s=[],c=new x(g);if(null==e?e=y:V(e,0,G),i=Ot(e/L),O)if(crypto.getRandomValues){for(t=crypto.getRandomValues(new Uint32Array(i*=2));l<i;)9e15<=(o=131072*t[l]+(t[l+1]>>>11))?(r=crypto.getRandomValues(new Uint32Array(2)),t[l]=r[0],t[l+1]=r[1]):(s.push(o%1e14),l+=2);l=i/2}else{if(!crypto.randomBytes)throw O=!1,Error(U+"crypto unavailable");for(t=crypto.randomBytes(i*=7);l<i;)9e15<=(o=281474976710656*(31&t[l])+1099511627776*t[l+1]+4294967296*t[l+2]+16777216*t[l+3]+(t[l+4]<<16)+(t[l+5]<<8)+t[l+6])?crypto.randomBytes(7).copy(t,l):(s.push(o%1e14),l+=7);l=i/7}if(!O)for(;l<i;)(o=u())<9e15&&(s[l++]=o%1e14);for(i=s[--l],e%=L,i&&e&&(s[l]=D(i/(o=At[L-e]))*o);0===s[l];s.pop(),l--);if(l<0)s=[n=0];else{for(n=-1;0===s[0];s.splice(0,1),n-=L);for(l=1,o=s[0];10<=o;o/=10,l++);l<L&&(n-=L-l)}return c.e=n,c.c=s,c}),x.sum=function(){for(var e=1,t=arguments,r=new x(t[0]);e<t.length;)r=r.plus(t[e++]);return r},m="0123456789",f=function(e,t,r,n,i){var o,l,s,c,u,a,f,h,p=e.indexOf("."),g=y,d=b;for(0<=p&&(c=N,N=0,e=e.replace(".",""),a=(h=new x(t)).pow(e.length-p),N=c,h.c=j(X(J(a.c),a.e,"0"),10,r,m),h.e=h.c.length),s=c=(f=j(e,t,r,i?(o=A,m):(o=m,A))).length;0==f[--c];f.pop());if(!f[0])return o.charAt(0);if(p<0?--s:(a.c=f,a.e=s,a.s=n,f=(a=v(a,h,g,d,r)).c,u=a.r,s=a.e),p=f[l=s+g+1],c=r/2,u=u||l<0||null!=f[l+1],u=d<4?(null!=p||u)&&(0==d||d==(a.s<0?3:2)):c<p||p==c&&(4==d||u||6==d&&1&f[l-1]||d==(a.s<0?8:7)),l<1||!f[0])e=u?X(o.charAt(1),-g,o.charAt(0)):o.charAt(0);else{if(f.length=l,u)for(--r;++f[--l]>r;)f[l]=0,l||(++s,f=[1].concat(f));for(c=f.length;!f[--c];);for(p=0,e="";p<=c;e+=o.charAt(f[p++]));e=X(e,s,o.charAt(0))}return e},v=function(e,t,r,n,i){var o,l,s,c,u,a,f,h,p,g,d,v,m,y,b,w,_,E=e.s==t.s?1:-1,O=e.c,N=t.c;if(!(O&&O[0]&&N&&N[0]))return new x(e.s&&t.s&&(O?!N||O[0]!=N[0]:N)?O&&0==O[0]||!N?0*E:E/0:NaN);for(p=(h=new x(E)).c=[],E=r+(l=e.e-t.e)+1,i||(i=F,l=q(e.e/L)-q(t.e/L),E=E/L|0),s=0;N[s]==(O[s]||0);s++);if(N[s]>(O[s]||0)&&l--,E<0)p.push(1),c=!0;else{for(y=O.length,w=N.length,E+=2,1<(u=D(i/(N[s=0]+1)))&&(N=P(N,u,i),O=P(O,u,i),w=N.length,y=O.length),m=w,d=(g=O.slice(0,w)).length;d<w;g[d++]=0);_=N.slice(),_=[0].concat(_),b=N[0],N[1]>=i/2&&b++;do{if(u=0,(o=C(N,g,w,d))<0){if(v=g[0],w!=d&&(v=v*i+(g[1]||0)),1<(u=D(v/b)))for(f=(a=P(N,u=i<=u?i-1:u,i)).length,d=g.length;1==C(a,g,f,d);)u--,$(a,w<f?_:N,f,i),f=a.length,o=1;else 0==u&&(o=u=1),f=(a=N.slice()).length;if($(g,a=f<d?[0].concat(a):a,d,i),d=g.length,-1==o)for(;C(N,g,w,d)<1;)u++,$(g,w<d?_:N,d,i),d=g.length}else 0===o&&(u++,g=[0])}while(p[s++]=u,g[0]?g[d++]=O[m]||0:(g=[O[m]],d=1),(m++<y||null!=g[0])&&E--);c=null!=g[0],p[0]||p.splice(0,1)}if(i==F){for(s=1,E=p[0];10<=E;E/=10,s++);B(h,r+(h.e=s+l*L-1)+1,n,c)}else h.e=l,h.r=+c;return h},l=/^(-?)0([xbo])(?=\w[\w.]*$)/i,s=/^([^.]+)\.$/,c=/^\.([^.]+)$/,a=/^-?(Infinity|NaN)$/,p=/^\s*\+(?=[\w.])|^\s+|\s+$/g,h=function(e,t,r,n){var i,o=r?t:t.replace(p,"");if(a.test(o))e.s=isNaN(o)?null:o<0?-1:1;else{if(!r&&(o=o.replace(l,function(e,t,r){return i="x"==(r=r.toLowerCase())?16:"b"==r?2:8,n&&n!=i?e:t}),n&&(i=n,o=o.replace(s,"$1").replace(c,"0.$1")),t!=o))return new x(o,i);if(x.DEBUG)throw Error(U+"Not a"+(n?" base "+n:"")+" number: "+t);e.s=null}e.c=e.e=null},r.absoluteValue=r.abs=function(){var e=new x(this);return e.s<0&&(e.s=1),e},r.comparedTo=function(e,t){return H(this,new x(e,t))},r.decimalPlaces=r.dp=function(e,t){var r,n;if(null!=e)return V(e,0,G),null==t?t=b:V(t,0,8),B(new x(this),e+this.e+1,t);if(!(e=this.c))return null;if(r=((n=e.length-1)-q(this.e/L))*L,n=e[n])for(;n%10==0;n/=10,r--);return r=r<0?0:r},r.dividedBy=r.div=function(e,t){return v(this,new x(e,t),y,b)},r.dividedToIntegerBy=r.idiv=function(e,t){return v(this,new x(e,t),0,1)},r.exponentiatedBy=r.pow=function(e,t){var r,n,i,o,l,s,c,u,a=this;if((e=new x(e)).c&&!e.isInteger())throw Error(U+"Exponent not an integer: "+I(e));if(null!=t&&(t=new x(t)),l=14<e.e,!a.c||!a.c[0]||1==a.c[0]&&!a.e&&1==a.c.length||!e.c||!e.c[0])return u=new x(Math.pow(+I(a),l?e.s*(2-W(e)):+I(e))),t?u.mod(t):u;if(s=e.s<0,t){if(t.c?!t.c[0]:!t.s)return new x(NaN);(n=!s&&a.isInteger()&&t.isInteger())&&(a=a.mod(t))}else{if(9<e.e&&(0<a.e||a.e<-1||(0==a.e?1<a.c[0]||l&&24e7<=a.c[1]:a.c[0]<8e13||l&&a.c[0]<=9999975e7)))return o=a.s<0&&W(e)?-0:0,-1<a.e&&(o=1/o),new x(s?1/o:o);N&&(o=Ot(N/L+2))}for(c=l?(r=new x(.5),s&&(e.s=1),W(e)):(i=Math.abs(+I(e)))%2,u=new x(g);;){if(c){if(!(u=u.times(a)).c)break;o?u.c.length>o&&(u.c.length=o):n&&(u=u.mod(t))}if(i){if(0===(i=D(i/2)))break;c=i%2}else if(B(e=e.times(r),e.e+1,1),14<e.e)c=W(e);else{if(0==(i=+I(e)))break;c=i%2}a=a.times(a),o?a.c&&a.c.length>o&&(a.c.length=o):n&&(a=a.mod(t))}return n?u:(s&&(u=g.div(u)),t?u.mod(t):o?B(u,N,b,void 0):u)},r.integerValue=function(e){var t=new x(this);return null==e?e=b:V(e,0,8),B(t,t.e+1,e)},r.isEqualTo=r.eq=function(e,t){return 0===H(this,new x(e,t))},r.isFinite=function(){return!!this.c},r.isGreaterThan=r.gt=function(e,t){return 0<H(this,new x(e,t))},r.isGreaterThanOrEqualTo=r.gte=function(e,t){return 1===(t=H(this,new x(e,t)))||0===t},r.isInteger=function(){return!!this.c&&q(this.e/L)>this.c.length-2},r.isLessThan=r.lt=function(e,t){return H(this,new x(e,t))<0},r.isLessThanOrEqualTo=r.lte=function(e,t){return-1===(t=H(this,new x(e,t)))||0===t},r.isNaN=function(){return!this.s},r.isNegative=function(){return this.s<0},r.isPositive=function(){return 0<this.s},r.isZero=function(){return!!this.c&&0==this.c[0]},r.minus=function(e,t){var r,n,i,o,l=this,s=l.s;if(t=(e=new x(e,t)).s,!s||!t)return new x(NaN);if(s!=t)return e.s=-t,l.plus(e);var c=l.e/L,u=e.e/L,a=l.c,f=e.c;if(!c||!u){if(!a||!f)return a?(e.s=-t,e):new x(f?l:NaN);if(!a[0]||!f[0])return f[0]?(e.s=-t,e):new x(a[0]?l:3==b?-0:0)}if(c=q(c),u=q(u),a=a.slice(),s=c-u){for((i=(o=s<0)?(s=-s,a):(u=c,f)).reverse(),t=s;t--;i.push(0));i.reverse()}else for(n=(o=(s=a.length)<(t=f.length))?s:t,s=t=0;t<n;t++)if(a[t]!=f[t]){o=a[t]<f[t];break}if(o&&(i=a,a=f,f=i,e.s=-e.s),0<(t=(n=f.length)-(r=a.length)))for(;t--;a[r++]=0);for(t=F-1;s<n;){if(a[--n]<f[n]){for(r=n;r&&!a[--r];a[r]=t);--a[r],a[n]+=F}a[n]-=f[n]}for(;0==a[0];a.splice(0,1),--u);return a[0]?T(e,a,u):(e.s=3==b?-1:1,e.c=[e.e=0],e)},r.modulo=r.mod=function(e,t){var r,n=this;return e=new x(e,t),!n.c||!e.s||e.c&&!e.c[0]?new x(NaN):!e.c||n.c&&!n.c[0]?new x(n):(9==i?(t=e.s,e.s=1,r=v(n,e,0,3),e.s=t,r.s*=t):r=v(n,e,0,i),(e=n.minus(r.times(e))).c[0]||1!=i||(e.s=n.s),e)},r.multipliedBy=r.times=function(e,t){var r,n,i,o,l,s,c,u,a,f,h,p=this,g=p.c,d=(e=new x(e,t)).c;if(!(g&&d&&g[0]&&d[0]))return!p.s||!e.s||g&&!g[0]&&!d||d&&!d[0]&&!g?e.c=e.e=e.s=null:(e.s*=p.s,g&&d?(e.c=[0],e.e=0):e.c=e.e=null),e;for(t=q(p.e/L)+q(e.e/L),e.s*=p.s,(s=g.length)<(p=d.length)&&(h=g,g=d,d=h,n=s,s=p,p=n),n=s+p,h=[];n--;h.push(0));for(n=p;0<=--n;){for(a=d[n]%1e7,f=d[n]/1e7|(r=0),i=n+(o=s);n<i;)r=((c=a*(c=g[--o]%1e7)+(l=f*c+(u=g[o]/1e7|0)*a)%1e7*1e7+h[i]+r)/1e14|0)+(l/1e7|0)+f*u,h[i--]=c%1e14;h[i]=r}return r?++t:h.splice(0,1),T(e,h,t)},r.negated=function(){var e=new x(this);return e.s=-e.s||null,e},r.plus=function(e,t){var r,n=this,i=n.s;if(t=(e=new x(e,t)).s,!i||!t)return new x(NaN);if(i!=t)return e.s=-t,n.minus(e);var o=n.e/L,l=e.e/L,s=n.c,c=e.c;if(!o||!l){if(!s||!c)return new x(i/0);if(!s[0]||!c[0])return c[0]?e:new x(s[0]?n:0*i)}if(o=q(o),l=q(l),s=s.slice(),i=o-l){for((r=0<i?(l=o,c):(i=-i,s)).reverse();i--;r.push(0));r.reverse()}for((i=s.length)-(t=c.length)<0&&(r=c,c=s,s=r,t=i),i=0;t;)i=(s[--t]=s[t]+c[t]+i)/F|0,s[t]=F===s[t]?0:s[t]%F;return i&&(s=[i].concat(s),++l),T(e,s,l)},r.precision=r.sd=function(e,t){var r,n;if(null!=e&&e!==!!e)return V(e,1,G),null==t?t=b:V(t,0,8),B(new x(this),e,t);if(!(t=this.c))return null;if(r=(n=t.length-1)*L+1,n=t[n]){for(;n%10==0;n/=10,r--);for(n=t[0];10<=n;n/=10,r++);}return r=e&&this.e+1>r?this.e+1:r},r.shiftedBy=function(e){return V(e,-St,St),this.times("1e"+e)},r.squareRoot=r.sqrt=function(){var e,t,r,n,i,o=this,l=o.c,s=o.s,c=o.e,u=y+4,a=new x("0.5");if(1!==s||!l||!l[0])return new x(!s||s<0&&(!l||l[0])?NaN:l?o:1/0);if((r=0==(s=Math.sqrt(+I(o)))||s==1/0?(((t=J(l)).length+c)%2==0&&(t+="0"),s=Math.sqrt(+t),c=q((c+1)/2)-(c<0||c%2),new x(t=s==1/0?"5e"+c:(t=s.toExponential()).slice(0,t.indexOf("e")+1)+c)):new x(s+"")).c[0])for((s=(c=r.e)+u)<3&&(s=0);;)if(i=r,r=a.times(i.plus(v(o,i,u,1))),J(i.c).slice(0,s)===(t=J(r.c)).slice(0,s)){if(r.e<c&&--s,"9999"!=(t=t.slice(s-3,s+1))&&(n||"4999"!=t)){+t&&(+t.slice(1)||"5"!=t.charAt(0))||(B(r,r.e+y+2,1),e=!r.times(r).eq(o));break}if(!n&&(B(i,i.e+y+2,0),i.times(i).eq(o))){r=i;break}u+=4,s+=4,n=1}return B(r,r.e+y+1,b,e)},r.toExponential=function(e,t){return null!=e&&(V(e,0,G),e++),n(this,e,t,1)},r.toFixed=function(e,t){return null!=e&&(V(e,0,G),e=e+this.e+1),n(this,e,t)},r.toFormat=function(e,t,r){if(null==r)null!=e&&t&&"object"==z(t)?(r=t,t=null):e&&"object"==z(e)?(r=e,e=t=null):r=S;else if("object"!=z(r))throw Error(U+"Argument not an object: "+r);if(e=this.toFixed(e,t),this.c){var n,t=e.split("."),i=+r.groupSize,o=+r.secondaryGroupSize,l=r.groupSeparator||"",s=t[0],t=t[1],c=this.s<0,u=c?s.slice(1):s,a=u.length;if(o&&(n=i,i=o,a-=o=n),0<i&&0<a){for(s=u.substr(0,n=a%i||i);n<a;n+=i)s+=l+u.substr(n,i);0<o&&(s+=l+u.slice(n)),c&&(s="-"+s)}e=t?s+(r.decimalSeparator||"")+((o=+r.fractionGroupSize)?t.replace(new RegExp("\\d{"+o+"}\\B","g"),"$&"+(r.fractionGroupSeparator||"")):t):s}return(r.prefix||"")+e+(r.suffix||"")},r.toFraction=function(e){var t,r,n,i,o,l,s,c,u,a,f=this,h=f.c;if(null!=e&&(!(s=new x(e)).isInteger()&&(s.c||1!==s.s)||s.lt(g)))throw Error(U+"Argument "+(s.isInteger()?"out of range: ":"not an integer: ")+I(s));if(!h)return new x(f);for(t=new x(g),u=r=new x(g),n=c=new x(g),h=J(h),o=t.e=h.length-f.e-1,t.c[0]=At[(l=o%L)<0?L+l:l],e=!e||0<s.comparedTo(t)?0<o?t:u:s,l=E,E=1/0,s=new x(h),c.c[0]=0;a=v(s,t,0,1),1!=(i=r.plus(a.times(n))).comparedTo(e);)r=n,n=i,u=c.plus(a.times(i=u)),c=i,t=s.minus(a.times(i=t)),s=i;return i=v(e.minus(r),n,0,1),c=c.plus(i.times(u)),r=r.plus(i.times(n)),c.s=u.s=f.s,h=v(u,n,o*=2,b).minus(f).abs().comparedTo(v(c,r,o,b).minus(f).abs())<1?[u,n]:[c,r],E=l,h},r.toNumber=function(){return+I(this)},r.toPrecision=function(e,t){return null!=e&&V(e,1,G),n(this,e,t,2)},r.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":(t=null==e?i<=d||w<=i?Z(J(r.c),i):X(J(r.c),i,"0"):10===e&&k?X(J((r=B(new x(r),y+i+1,b)).c),r.e,"0"):(V(e,2,A.length,"Base"),f(X(J(r.c),i,"0"),10,e,n,!0)),n<0&&r.c[0]&&(t="-"+t)),t},r.valueOf=r.toJSON=function(){return I(this)},r._isBigNumber=!0,r[Symbol.toStringTag]="BigNumber",r[Symbol.for("nodejs.util.inspect.custom")]=r.valueOf,null!=e&&x.set(e),x}();function kt(e){for(var t=[];0<e.length;){var r=e.shift();if(A(r)){if(t.length<2)throw new Error("错误的栈长度, 可能是无法计算的表达式");var n=t.pop(),i=t.pop();if("string"==typeof n&&!E.isBigNumber(n)){if(!u(n))throw new Error("".concat(n,"不是一个合法的数字"));n=new E(n)}if("string"==typeof i&&!E.isBigNumber(i)){if(!u(i))throw new Error("".concat(i,"不是一个合法的数字"));i=new E(i)}switch(r){case"+":t.push(i.plus(n));break;case"-":t.push(i.minus(n));break;case"*":t.push(i.times(n));break;case"/":t.push(i.div(n));break;case"%":t.push(i.mod(n));break;case"**":t.push(i.pow(n))}}else t.push(r)}if(1!==t.length)throw"unvalid expression";var o=t[0];if((o=E.isBigNumber(o)?o:E(o)).isNaN())throw new Error("计算结果为NaN");return o}function xt(e,t,r){var n,i,o,l,s,c,u,a,f,h,p,g,d,v,m,y,b,w,_="";return E.isBigNumber(e)?_=e.toFixed():"string"!=typeof e&&(_=e.toString()),"undefined"===_||"NaN"===_?null:(i=n=null,l=o=!1,y=a=u=c=!(s="~-"),t.forEach(function(e){var t=e.type;if("symbol"===t){if(![">=","<=","=","<",">"].includes(e.value))throw new Error("错误的格式化参数:",e.value);i=e.value}else if("to-number"===t)y=!0;else if("comma"===t)o=!0;else if("number"===t)n=e.value;else if("plus"===t)l=!0;else if("round"===t)s=e.value;else if("fraction"===t)u=!0;else if("scientific"===t)c=!0;else{if("percent"!==t)throw new Error("错误的fmt Token");a=!0}}),c?(e=E(_).toExponential(),l&&!e.startsWith("-")?"+"+e:e):u?(t=E(_).toFraction().map(function(e){return e.toFixed()}).join("/"),l&&!t.startsWith("-")?"+"+t:t):(a&&(_=E(_).times(100).toFixed()),n&&(e=_.split("."),t=e[0],e=1===e.length?"":e[1],p=i,g=+n,b=s,d=f=t,m=(v=h=e).length,w={"~-":function(){v=h.slice(0,"<"===p?g-1:g)},"~+":function(){var e,t="<"===p?g-1:g;m<=t||0===m||(e=h.slice(0,t),0!=+h.slice(t,m)&&(e=(+e+1).toString()).length>t?(v=e.slice(1,e.length),d=(+d+1).toString()):v=e)},"~5":function(){var e,t;0===m||(v=h.slice(0,e="<"===p?g-1:g),t=+h[e],Number.isNaN(t))||5<=t&&(v=(+v+1).toString()).length>e&&(v=v.slice(1,v.length),d=(+d+1).toString())},"~6":function(){var e,t,r,n;0!==m&&(t=+h[e="<"===p?g-1:g],r=""===(r=h.slice(+e+1,h.length))?0:parseInt(r),n=0===e?+f[f.length-1]:+h[e-1],v=h.slice(0,e),6<=t||5==t&&0<r||5==t&&n%2!=0)&&(v=(+v+1).toString()).length>e&&(v=v.slice(1,v.length),d=(+d+1).toString())}},"<="===p?v=m<=g?h:(w[b]&&w[b](),v.replace(/0+$/,"")):"<"===p?v=m<g?h:(w[b]&&w[b](),v.replace(/0+$/,"")):"="===p?m<g?v=h+"0".repeat(g-m):g<m&&w[b]&&w[b]():">="===p?m<g&&(v=h+"0".repeat(g-m)):">"===p&&m<=g&&(v=h+"0".repeat(g-m+1)),t=(w={int_part:d,dec_part:v}).int_part,_=""===(e=w.dec_part)?t:"".concat(t,".").concat(e)),o&&(y=!1,_=1<(b=_.split(".")).length?((w=b[0]).includes("-")?b[0]=w[0]+w.slice(1).replace(/(?=(?!^)(?:\d{3})+$)/g,","):b[0]=w.replace(/(?=(?!^)(?:\d{3})+$)/g,","),b.join(".")):(t=b[0]).includes("-")?t[0]+t.slice(1).replace(/(?=(?!^)(?:\d{3})+$)/g,","):t.replace(/(?=(?!^)(?:\d{3})+$)/g,",")),l&&(y=!1,_.startsWith("-")||(_="+"+_)),a&&(y=!1,_+="%"),y&&!r?+_:_))}function jt(e,i){return e.map(function(e){if("var"!==e.type)return e;for(var t,r,n=0;n<i.length&&!p(t=y(i[n],e.value));n++);if("number"==typeof(r=t)||u(r))return{type:"number",value:t};throw new Error("错误的填充值")})}function Pt(e){var r=null;return e.length,{tokens:e.map(function(e){var t=function(e){for(var t,r,n=null,i=null,o=[/^([+-]?[\d.]+(?:e|E)(?:\+|-)?\d+)(.*)$/,/^([+-]?[\d.]+)(.*)$/],l=0;l<o.length;l++){var s=e.match(o[l]);if(s){t=s;break}}return t&&(i=t[1],""!==(r=t[2]).trim())&&(n=r),{num:i,unit:n}}(e.value);return null!==t.unit?(null==r&&(r=t.unit),{type:"number",value:t.num}):e}),unit:r}}var Ct=!1;var t="#ff8936",i="#fff",l="#67C23A",r="#ee7959",w={expr:"background: ".concat(t,";color: ").concat(i,";font-weight: bold;border-radius: 2px; padding: 3px 8px;"),label1:"color: ".concat(l,"; font-weight: bold;"),label2:"color: ".concat(r,"; font-weight: bold;")};function $t(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];var n,i=function(e){var t="",r=e[0],n=e[1],i={origin_expr:r,origin_fill_data:n,expr:"",fmt_tokens:null,options:null,fmt_err:!1,expr_err:!1},n=(p(n)&&(i.options=n),y(n,"_error",!1));if(0===e.length)throw new Error("至少传入一个参数");if("string"==typeof r){if(""===(t=r).trim()||r.includes("NaN"))return i.expr_err=!0,i}else{if("number"!=typeof r){if(!0===n)return i.expr_err=!0,i;throw new Error("错误的第一个参数类型: ".concat(r," 类型为:").concat(z(r)))}t=r.toString()}if(e=t.split("|"),i.expr=e[0],1<e.length){n=e[1];if(""!==n.trim())try{i.fmt_tokens=P(n)}catch(e){return i.fmt_err=!0,i}}if(null!==i.options&&i.options._fmt){var o,r=[];try{r=P(i.options._fmt)}catch(e){return i.fmt_err=!0,i}null===i.fmt_tokens?i.fmt_tokens=r:(o=i.fmt_tokens.map(function(e){return e.type}),r.forEach(function(e){o.includes(e.type)||i.fmt_tokens.push(e)}))}return i}(t),o=y(i,"options._error",void 0),l=y(i,"options._debug",!1),s=y(i,"options._unit",!1),c=i.options,u=null;if(i.fmt_err||i.expr_err){if(p(o))return o;throw new Error("表达式或格式化字符串错误,表达式为:".concat(i.expr))}var a=i.fmt_tokens;if(p(o))try{n=bt(i.expr,s)}catch(e){return o}else n=bt(i.expr,s);if(x(c))f=n;else{var f,h=[];if(Array.isArray(c)?h=c:(h.push(c),p(c=y(c,"_fill_data",{}))&&(Array.isArray(c)?h=[].concat(_(h),_(c)):h.push(c))),p(o))try{f=wt(n,h,s),g(i.fmt_tokens)&&(a=jt(i.fmt_tokens,h))}catch(e){return o}else f=wt(n,h,s),g(i.fmt_tokens)&&(a=jt(i.fmt_tokens,h));[!0,"on","auto","space"].includes(s)&&(u=(c=Pt(f)).unit,f=c.tokens)}h=_t(f),c=null;if(p(o))try{c=kt(h)}catch(e){return o}else c=kt(h);if("Infinity"!==(c=g(a)?xt(c,a,s):null!==c?c.toFixed():null)&&null!==c)return null!==u&&(c+=u),(Ct||l)&&(console.groupCollapsed("%c"+i.origin_expr,w.expr),console.log("%c表达式:",w.label1,i.origin_expr),console.log("%c数据源: %o \n%cstr:%c %s",w.label1,i.origin_fill_data,w.label2,"",JSON.stringify(i.origin_fill_data)),console.log("%ctokens: %o \n%cstr:%c %s",w.label1,n,w.label2,"",JSON.stringify(n)),console.log("%cfilled-tokens: %o \n%cstr:%c %s",w.label1,f,w.label2,"",JSON.stringify(f)),console.log("%cfmt-tokens: %o \n%cstr:%c %s",w.label1,i.fmt_tokens,w.label2,"",JSON.stringify(i.fmt_tokens)),console.log("%cfmt-filled-tokens: %o \n%cstr:%c %s",w.label1,a,w.label2,"",JSON.stringify(a)),console.log("%cpostfix-tokens: %o \n%cstr:%c %s",w.label1,h,w.label2,"",JSON.stringify(h)),console.log("%c单位: %o \n%cstr:%c %s",w.label1,u,w.label2,"",JSON.stringify(u)),console.log("%cparse-arg: %o \n%cstr:%c %s",w.label1,i,w.label2,"",JSON.stringify(i)),console.groupEnd(),console.log("\n")),c;if(p(o))return o;throw new Error("计算错误可能是非法的计算式")}console.log("%ca-calc:%c ".concat(O," %c=> %curl:%c https://www.npmjs.com/package/a-calc"),"color: #fff;background: #67C23A;padding: 2px 5px;border-radius:4px;font-size: 14px;","color: #67C23A;font-size:14px;","color: #67C23A;font-size:14px;","background: #67C23A;font-size:14px; padding: 2px 5px; border-radius: 4px; color: #fff;","font-size:14px;");a=$t;return e.calc=$t,e.close_debug=function(){Ct=!1},e.fmt=a,e.open_debug=function(){Ct=!0},e.version=O,Object.defineProperty(e,"__esModule",{value:!0}),e}({});
var a_calc=function(e){"use strict";function _(t,e){var r,n=Object.keys(t);return Object.getOwnPropertySymbols&&(r=Object.getOwnPropertySymbols(t),e&&(r=r.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,r)),n}function o(n){for(var e=1;e<arguments.length;e++){var i=null!=arguments[e]?arguments[e]:{};e%2?_(Object(i),!0).forEach(function(e){var t,r;t=n,r=i[e=e],(e=function(e){e=function(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0===r)return("string"===t?String:Number)(e);r=r.call(e,t||"default");if("object"!=typeof r)return r;throw new TypeError("@@toPrimitive must return a primitive value.")}(e,"string");return"symbol"==typeof e?e:String(e)}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(i)):_(Object(i)).forEach(function(e){Object.defineProperty(n,e,Object.getOwnPropertyDescriptor(i,e))})}return n}function R(e){return(R="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function O(e){return function(e){if(Array.isArray(e))return n(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||function(e,t){var r;if(e)return"string"==typeof e?n(e,t):"Map"===(r="Object"===(r=Object.prototype.toString.call(e).slice(8,-1))&&e.constructor?e.constructor.name:r)||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?n(e,t):void 0}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function n(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}var N="1.2.9",S=/^[+-]?\d[\d.]*(?:e\+|E\+|e-|E-|e|E)?\d*$/,A=/^[+-]?\d[\d.]*(?:e\+|E\+|e-|E-|e|E)?\d*\D*$/;function j(e){return-1<"+-*/%()**".indexOf(e)}function k(e){switch(e){case"+":case"-":return 1;case"*":case"/":case"%":return 2;case"**":return 3;default:return 0}}function h(e){return void 0!==e}function x(e){return null===e}function P(e){return null!==e}function c(e){return"string"==typeof e&&!!S.test(e)}var l={initial:"initial",number:"number",variable:"var",symbol:"symbol",percent:"percent",round:"round",plus:"plus",comma:"comma",fraction:"fraction",to_number:"to-number",scientific:"scientific"},C="<>=";function T(e){for(var t=l.initial,r=[],n=[];e;){var i=e[0];if(t===l.initial)if(/\s/.test(i))e=e.slice(1);else if(C.includes(i))t=l.symbol,r.push(i),e=e.slice(1);else if(","===i)t=l.initial,n.push({type:"comma",value:i}),e=e.slice(1);else if(/[a-zA-Z_]/.test(i))t=l.variable,r.push(i),e=e.slice(1);else if(/\d/.test(i))t=l.number,r.push(i),e=e.slice(1);else if("+"===i)t=l.initial,n.push({type:"plus",value:i}),e=e.slice(1);else if("~"===i)t=l.round,r.push(i),e=e.slice(1);else if("%"===i)t=l.initial,n.push({type:"percent",value:i}),e=e.slice(1);else if("/"===i)t=l.initial,n.push({type:"fraction",value:i}),e=e.slice(1);else{if("!"!==i)throw new Error("不识别的fmt字符:".concat(i));if(t=l.initial,/[Ee]/.test(e[1]))n.push({type:"scientific",value:e[1]});else{if(!/[Nn]/.test(e[1]))throw new Error("不识别的fmt字符:".concat(e.slice(2)));n.push({type:"to-number",value:e[1]})}e=e.slice(2)}else if(t===l.number)/\d/.test(i)?(r.push(i),e=e.slice(1)):(n.push({type:"number",value:r.join("")}),r.length=0,t=l.initial);else if(t===l.variable)/[\$\w_\-.\[\]"']/.test(i)?(r.push(i),e=e.slice(1)):(n.push({type:"var",value:r.join("")}),r.length=0,t=l.initial);else if(t===l.symbol)/\s/.test(i)?e=e.slice(1):C.includes(i)?(r.push(i),e=e.slice(1)):(n.push({type:"symbol",value:r.join("")}),r.length=0,t=l.initial);else{if(t!==l.round)throw new Error("错误的自动机状态");if(/\s/.test(i))e=e.slice(1);else{if(!("56+-".includes(i)&&r.length<2))throw new Error("舍入格式化语法错误:".concat(i));r.push(i),e=e.slice(1),n.push({type:"round",value:r.join("")}),r.length=0,t=l.initial}}}if(0<r.length&&(n.push({type:t,value:r.join("")}),r.length=0,t=l.initial),1<n.filter(function(e){return"number"===e.type}).length)throw new Error("格式化字符串错误,发现多余的数字");return n}var t="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},r=Array.isArray,t="object"==R(t)&&t&&t.Object===Object&&t,i="object"==("undefined"==typeof self?"undefined":R(self))&&self&&self.Object===Object&&self,t=t||i||Function("return this")(),i=t.Symbol,s=Object.prototype,$=s.hasOwnProperty,D=s.toString,u=i?i.toStringTag:void 0;var B=Object.prototype.toString;var I=function(e){var t=$.call(e,u),r=e[u];try{var n=!(e[u]=void 0)}catch(e){}var i=D.call(e);return n&&(t?e[u]=r:delete e[u]),i},Y=function(e){return B.call(e)},K=i?i.toStringTag:void 0;function Q(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":(K&&K in Object(e)?I:Y)(e)}var ee=Q,te=function(e){return null!=e&&"object"==R(e)};function re(e){return"symbol"==R(e)||te(e)&&"[object Symbol]"==ee(e)}var ne=r,ie=re,oe=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,le=/^\w*$/;function se(e,t){var r;return!ne(e)&&(!("number"!=(r=R(e))&&"symbol"!=r&&"boolean"!=r&&null!=e&&!ie(e))||le.test(e)||!oe.test(e)||null!=t&&e in Object(t))}function ue(e){var t=R(e);return null!=e&&("object"==t||"function"==t)}var ce=Q,ae=ue;function fe(e){return!!ae(e)&&("[object Function]"==(e=ce(e))||"[object GeneratorFunction]"==e||"[object AsyncFunction]"==e||"[object Proxy]"==e)}var s=t["__core-js_shared__"],pe=(s=/[^.]+$/.exec(s&&s.keys&&s.keys.IE_PROTO||""))?"Symbol(src)_1."+s:"";var he=Function.prototype.toString;var ge=fe,de=function(e){return!!pe&&pe in e},ve=ue,ye=function(e){if(null!=e){try{return he.call(e)}catch(e){}try{return e+""}catch(e){}}return""},be=/^\[object .+?Constructor\]$/,s=Function.prototype,a=Object.prototype,s=s.toString,a=a.hasOwnProperty,me=RegExp("^"+s.call(a).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");var we=function(e){return!(!ve(e)||de(e))&&(ge(e)?me:be).test(ye(e))},_e=function(e,t){return null==e?void 0:e[t]};function Ee(e,t){return e=_e(e,t),we(e)?e:void 0}var s=Ee(Object,"create"),Oe=s;var Ne=s,Se=Object.prototype.hasOwnProperty;var Ae=s,je=Object.prototype.hasOwnProperty;var ke=s;function xe(e){return e=this.has(e)&&delete this.__data__[e],this.size-=e?1:0,e}function Pe(e){var t,r=this.__data__;return Ne?"__lodash_hash_undefined__"===(t=r[e])?void 0:t:Se.call(r,e)?r[e]:void 0}function Ce(e){var t=this.__data__;return Ae?void 0!==t[e]:je.call(t,e)}function Te(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=ke&&void 0===t?"__lodash_hash_undefined__":t,this}function f(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}f.prototype.clear=function(){this.__data__=Oe?Oe(null):{},this.size=0},f.prototype.delete=xe,f.prototype.get=Pe,f.prototype.has=Ce,f.prototype.set=Te;a=f;var $e=function(e,t){return e===t||e!=e&&t!=t};function p(e,t){for(var r=e.length;r--;)if($e(e[r][0],t))return r;return-1}var De=p,Be=Array.prototype.splice;var Ie=p;var Re=p;var ze=p;function Ue(e){var t=this.__data__;return!((e=De(t,e))<0||(e==t.length-1?t.pop():Be.call(t,e,1),--this.size,0))}function Fe(e){var t=this.__data__;return(e=Ie(t,e))<0?void 0:t[e][1]}function Le(e){return-1<Re(this.__data__,e)}function Me(e,t){var r=this.__data__,n=ze(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this}function g(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}g.prototype.clear=function(){this.__data__=[],this.size=0},g.prototype.delete=Ue,g.prototype.get=Fe,g.prototype.has=Le,g.prototype.set=Me;var s=g,t=Ee(t,"Map"),Ge=a,qe=s,Je=t;var We=function(e){var t=R(e);return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e};function d(e,t){return e=e.__data__,We(t)?e["string"==typeof t?"string":"hash"]:e.map}var He=d;var Ve=d;var Ze=d;var Xe=d;function Ye(e){return e=He(this,e).delete(e),this.size-=e?1:0,e}function Ke(e){return Ve(this,e).get(e)}function Qe(e){return Ze(this,e).has(e)}function et(e,t){var r=Xe(this,e),n=r.size;return r.set(e,t),this.size+=r.size==n?0:1,this}function v(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}v.prototype.clear=function(){this.size=0,this.__data__={hash:new Ge,map:new(Je||qe),string:new Ge}},v.prototype.delete=Ye,v.prototype.get=Ke,v.prototype.has=Qe,v.prototype.set=et;var tt=v;function rt(n,i){if("function"!=typeof n||null!=i&&"function"!=typeof i)throw new TypeError("Expected a function");function o(){var e=arguments,t=i?i.apply(this,e):e[0],r=o.cache;return r.has(t)?r.get(t):(e=n.apply(this,e),o.cache=r.set(t,e)||r,e)}return o.cache=new(rt.Cache||tt),o}rt.Cache=tt;var nt=rt;var it=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,ot=/\\(\\)?/g,a=function(e){var t=(e=nt(e,function(e){return 500===t.size&&t.clear(),e})).cache;return e}(function(e){var i=[];return 46===e.charCodeAt(0)&&i.push(""),e.replace(it,function(e,t,r,n){i.push(r?n.replace(ot,"$1"):t||e)}),i});var lt=function(e,t){for(var r=-1,n=null==e?0:e.length,i=Array(n);++r<n;)i[r]=t(e[r],r,e);return i},st=r,ut=re,s=i?i.prototype:void 0,ct=s?s.toString:void 0;var at=function e(t){var r;return"string"==typeof t?t:st(t)?lt(t,e)+"":ut(t)?ct?ct.call(t):"":"0"==(r=t+"")&&1/t==-1/0?"-0":r};var ft=r,pt=se,ht=a,gt=function(e){return null==e?"":at(e)};var dt=re;var vt=function(e,t){return ft(e)?e:pt(e,t)?[e]:ht(gt(e))},yt=function(e){var t;return"string"==typeof e||dt(e)?e:"0"==(t=e+"")&&1/e==-1/0?"-0":t};var bt=function(e,t){for(var r=0,n=(t=vt(t,e)).length;null!=e&&r<n;)e=e[yt(t[r++])];return r&&r==n?e:void 0};var y=function(e,t,r){return void 0===(e=null==e?void 0:bt(e,t))?r:e};var b={initial:"initial",number:"number",scientific:"scientific",operator:"operator",bracket:"bracket",var:"var"},mt="+-",wt="*/%",_t="()";function Et(e,t){for(var r,n,i,o=1<arguments.length&&void 0!==t&&t,l=b.initial,s=[],u=[],c=function(){s.push(r),e=e.slice(1)},a=function(e){u.push({type:e,value:s.join("")}),s.length=0},f=function(){e=e.slice(1)};e;)switch(r=e[0],l){case b.initial:if(mt.includes(r)){var p=u.at(-1),l=0===u.length||"operator"===p.type||"("===p?b.number:b.operator;c()}else if(wt.includes(r))l=b.operator,c();else if(/\d/.test(r))l=b.number,c();else if(_t.includes(r))l=b.bracket;else if(/[a-zA-Z_$]/.test(r))l=b.var,c();else{if(!/\s/.test(r))throw new Error("不识别的字符".concat(r));f()}break;case b.bracket:u.push({type:b.bracket,value:r}),f(),l=b.initial;break;case b.operator:p=s.at(-1);"*"===r&&"*"===p&&c(),a(b.operator),l=b.initial;break;case b.number:if(/\d/.test(r))c();else if("."===r){if(0===s.length||s.includes("."))throw new Error("非法的小数部分".concat(s.join("")));c()}else"Ee".includes(r)?(l=b.scientific,c()):["auto","on",!0].includes(o)&&/[^*/+\-()\s]/.test(r)||"space"===o&&/\S/.test(r)?c():(a(b.number),l=b.initial);break;case b.scientific:/\d/.test(r)?c():mt.includes(r)?(n=s.slice(1),i=s.at(-1),n.includes(r)||!/[Ee]/.test(i)?(a(b.scientific),l=b.initial):c()):["auto","on",!0].includes(o)&&/[^*/+\-()\s]/.test(r)||"space"===o&&/\S/.test(r)?c():(a(b.scientific),l=b.initial);break;case b.var:/[\w_.\[\]"']/.test(r)?c():(a(b.var),l=b.initial);break;default:throw new Error("状态错误")}return 0!==s.length&&(u.push({type:l,value:s.join("")}),s.length=0,l=b.initial),u}function Ot(e,t,r){if(x(t))throw new Error("错误的填充数据:",t);for(var n=[],i=0;i<e.length;i++){var o=e[i];if("var"!==o.type)n.push(o);else{if("undefined"===o.value||"NaN"===o.value)throw new Error("key不应该为:".concat(o.value));for(var l=null,s=0;s<t.length;s++){var u=t[s],u=y(u,o.value);if(void 0!==u){l=u;break}}if(null===l)throw new Error("token填充失败,请确认".concat(o,"存在"));if("string"==typeof l){if(""===l.trim())throw new Error("token填充失败,".concat(o.value,"值不可为空字符"));if([!0,"on","auto","space"].includes(r)){if(!A.test(l))throw new Error("token填充失败,".concat(o.value,"值:").concat(l,"为非法单位数字"))}else if(!c(l))throw new Error("token填充失败,".concat(o,"值:").concat(l,"为非法数字"))}l="string"!=typeof l?l.toString():l,n.push({type:"number",value:l})}}return n}function Nt(e){for(var t,r=[],n=[],i=e.map(function(e){return e.value});0<i.length;){var o=i.shift();if(j(o))if("("===o)r.push(o);else if(")"===o){for(var l=r.pop();"("!==l&&0<r.length;)n.push(l),l=r.pop();if("("!==l)throw"error: unmatched ()"}else{for(;t=r[r.length-1],k(o)<=k(t)&&0<r.length;)n.push(r.pop());r.push(o)}else n.push(o)}if(0<r.length){if(")"===r[r.length-1]||"("===r[r.length-1])throw"error: unmatched ()";for(;0<r.length;)n.push(r.pop())}return n}var St=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,At=Math.ceil,z=Math.floor,U="[BigNumber Error] ",jt=U+"Number primitive has more than 15 significant digits: ",F=1e14,L=14,kt=9007199254740991,xt=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],M=1e7,G=1e9;function q(e){var t=0|e;return 0<e||e===t?t:t-1}function J(e){for(var t,r,n=1,i=e.length,o=e[0]+"";n<i;){for(t=e[n++]+"",r=L-t.length;r--;t="0"+t);o+=t}for(i=o.length;48===o.charCodeAt(--i););return o.slice(0,i+1||1)}function W(e,t){var r,n,i=e.c,o=t.c,l=e.s,s=t.s,e=e.e,t=t.e;if(!l||!s)return null;if(r=i&&!i[0],n=o&&!o[0],r||n)return r?n?0:-s:l;if(l!=s)return l;if(r=l<0,n=e==t,!i||!o)return n?0:!i^r?1:-1;if(!n)return t<e^r?1:-1;for(s=(e=i.length)<(t=o.length)?e:t,l=0;l<s;l++)if(i[l]!=o[l])return i[l]>o[l]^r?1:-1;return e==t?0:t<e^r?1:-1}function H(e,t,r,n){if(e<t||r<e||e!==z(e))throw Error(U+(n||"Argument")+("number"==typeof e?e<t||r<e?" out of range: ":" not an integer: ":" not a primitive number: ")+String(e))}function V(e){var t=e.c.length-1;return q(e.e/L)==t&&e.c[t]%2!=0}function Z(e,t){return(1<e.length?e.charAt(0)+"."+e.slice(1):e)+(t<0?"e":"e+")+t}function X(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}var E=function I(e){var v,f,p,t,c,y,l,s,u,a,h,r=k.prototype={constructor:k,toString:null,valueOf:null},g=new k(1),b=20,m=4,d=-7,w=21,_=-1e7,E=1e7,O=!1,i=1,N=0,S={prefix:"",groupSize:3,secondaryGroupSize:0,groupSeparator:",",decimalSeparator:".",fractionGroupSize:0,fractionGroupSeparator:" ",suffix:""},A="0123456789abcdefghijklmnopqrstuvwxyz",j=!0;function k(e,t){var r,n,i,o,l,s,u,c,a=this;if(!(a instanceof k))return new k(e,t);if(null==t){if(e&&!0===e._isBigNumber)return a.s=e.s,void(!e.c||e.e>E?a.c=a.e=null:e.e<_?a.c=[a.e=0]:(a.e=e.e,a.c=e.c.slice()));if((s="number"==typeof e)&&0*e==0){if(a.s=1/e<0?(e=-e,-1):1,e===~~e){for(o=0,l=e;10<=l;l/=10,o++);return void(E<o?a.c=a.e=null:(a.e=o,a.c=[e]))}c=String(e)}else{if(!St.test(c=String(e)))return p(a,c,s);a.s=45==c.charCodeAt(0)?(c=c.slice(1),-1):1}0<(l=(c=-1<(o=c.indexOf("."))?c.replace(".",""):c).search(/e/i))?(o<0&&(o=l),o+=+c.slice(l+1),c=c.substring(0,l)):o<0&&(o=c.length)}else{if(H(t,2,A.length,"Base"),10==t&&j)return D(a=new k(e),b+a.e+1,m);if(c=String(e),s="number"==typeof e){if(0*e!=0)return p(a,c,s,t);if(a.s=1/e<0?(c=c.slice(1),-1):1,k.DEBUG&&15<c.replace(/^0\.0*|\./,"").length)throw Error(jt+e)}else a.s=45===c.charCodeAt(0)?(c=c.slice(1),-1):1;for(r=A.slice(0,t),o=l=0,u=c.length;l<u;l++)if(r.indexOf(n=c.charAt(l))<0){if("."==n){if(o<l){o=u;continue}}else if(!i&&(c==c.toUpperCase()&&(c=c.toLowerCase())||c==c.toLowerCase()&&(c=c.toUpperCase()))){i=!0,l=-1,o=0;continue}return p(a,String(e),s,t)}s=!1,-1<(o=(c=f(c,t,10,a.s)).indexOf("."))?c=c.replace(".",""):o=c.length}for(l=0;48===c.charCodeAt(l);l++);for(u=c.length;48===c.charCodeAt(--u););if(c=c.slice(l,++u)){if(u-=l,s&&k.DEBUG&&15<u&&(kt<e||e!==z(e)))throw Error(jt+a.s*e);if((o=o-l-1)>E)a.c=a.e=null;else if(o<_)a.c=[a.e=0];else{if(a.e=o,a.c=[],l=(o+1)%L,o<0&&(l+=L),l<u){for(l&&a.c.push(+c.slice(0,l)),u-=L;l<u;)a.c.push(+c.slice(l,l+=L));l=L-(c=c.slice(l)).length}else l-=u;for(;l--;c+="0");a.c.push(+c)}}else a.c=[a.e=0]}function x(e,t,r,n){for(var i,o,l=[0],s=0,u=e.length;s<u;){for(o=l.length;o--;l[o]*=t);for(l[0]+=n.indexOf(e.charAt(s++)),i=0;i<l.length;i++)r-1<l[i]&&(null==l[i+1]&&(l[i+1]=0),l[i+1]+=l[i]/r|0,l[i]%=r)}return l.reverse()}function P(e,t,r){var n,i,o,l=0,s=e.length,u=t%M,c=t/M|0;for(e=e.slice();s--;)l=((i=u*(o=e[s]%M)+(n=c*o+(o=e[s]/M|0)*u)%M*M+l)/r|0)+(n/M|0)+c*o,e[s]=i%r;return e=l?[l].concat(e):e}function C(e,t,r,n){var i,o;if(r!=n)o=n<r?1:-1;else for(i=o=0;i<r;i++)if(e[i]!=t[i]){o=e[i]>t[i]?1:-1;break}return o}function T(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]&&1<e.length;e.splice(0,1));}function n(e,t,r,n){var i,o,l,s;if(null==r?r=m:H(r,0,8),!e.c)return e.toString();if(i=e.c[0],o=e.e,null==t)s=J(e.c),s=1==n||2==n&&(o<=d||w<=o)?Z(s,o):X(s,o,"0");else if(r=(e=D(new k(e),t,r)).e,l=(s=J(e.c)).length,1==n||2==n&&(t<=r||r<=d)){for(;l<t;s+="0",l++);s=Z(s,r)}else if(t-=o,s=X(s,r,"0"),l<r+1){if(0<--t)for(s+=".";t--;s+="0");}else if(0<(t+=r-l))for(r+1==l&&(s+=".");t--;s+="0");return e.s<0&&i?"-"+s:s}function o(e,t){for(var r,n=1,i=new k(e[0]);n<e.length;n++){if(!(r=new k(e[n])).s){i=r;break}t.call(i,r)&&(i=r)}return i}function $(e,t,r){for(var n=1,i=t.length;!t[--i];t.pop());for(i=t[0];10<=i;i/=10,n++);return(r=n+r*L-1)>E?e.c=e.e=null:r<_?e.c=[e.e=0]:(e.e=r,e.c=t),e}function D(e,t,r,n){var i,o,l,s,u,c,a,f=e.c,p=xt;if(f){e:{for(i=1,s=f[0];10<=s;s/=10,i++);if((o=t-i)<0)o+=L,l=t,a=(u=f[c=0])/p[i-l-1]%10|0;else if((c=At((o+1)/L))>=f.length){if(!n)break e;for(;f.length<=c;f.push(0));u=a=0,l=(o%=L)-L+(i=1)}else{for(u=s=f[c],i=1;10<=s;s/=10,i++);a=(l=(o%=L)-L+i)<0?0:u/p[i-l-1]%10|0}if(n=n||t<0||null!=f[c+1]||(l<0?u:u%p[i-l-1]),n=r<4?(a||n)&&(0==r||r==(e.s<0?3:2)):5<a||5==a&&(4==r||n||6==r&&(0<o?0<l?u/p[i-l]:0:f[c-1])%10&1||r==(e.s<0?8:7)),t<1||!f[0])return f.length=0,n?(t-=e.e+1,f[0]=p[(L-t%L)%L],e.e=-t||0):f[0]=e.e=0,e;if(0==o?(f.length=c,s=1,c--):(f.length=c+1,s=p[L-o],f[c]=0<l?z(u/p[i-l]%p[l])*s:0),n)for(;;){if(0==c){for(o=1,l=f[0];10<=l;l/=10,o++);for(l=f[0]+=s,s=1;10<=l;l/=10,s++);o!=s&&(e.e++,f[0]==F)&&(f[0]=1);break}if(f[c]+=s,f[c]!=F)break;f[c--]=0,s=1}for(o=f.length;0===f[--o];f.pop());}e.e>E?e.c=e.e=null:e.e<_&&(e.c=[e.e=0])}return e}function B(e){var t,r=e.e;return null===r?e.toString():(t=J(e.c),t=r<=d||w<=r?Z(t,r):X(t,r,"0"),e.s<0?"-"+t:t)}return k.clone=I,k.ROUND_UP=0,k.ROUND_DOWN=1,k.ROUND_CEIL=2,k.ROUND_FLOOR=3,k.ROUND_HALF_UP=4,k.ROUND_HALF_DOWN=5,k.ROUND_HALF_EVEN=6,k.ROUND_HALF_CEIL=7,k.ROUND_HALF_FLOOR=8,k.EUCLID=9,k.config=k.set=function(e){var t,r;if(null!=e){if("object"!=R(e))throw Error(U+"Object expected: "+e);if(e.hasOwnProperty(t="DECIMAL_PLACES")&&(H(r=e[t],0,G,t),b=r),e.hasOwnProperty(t="ROUNDING_MODE")&&(H(r=e[t],0,8,t),m=r),e.hasOwnProperty(t="EXPONENTIAL_AT")&&((r=e[t])&&r.pop?(H(r[0],-G,0,t),H(r[1],0,G,t),d=r[0],w=r[1]):(H(r,-G,G,t),d=-(w=r<0?-r:r))),e.hasOwnProperty(t="RANGE"))if((r=e[t])&&r.pop)H(r[0],-G,-1,t),H(r[1],1,G,t),_=r[0],E=r[1];else{if(H(r,-G,G,t),!r)throw Error(U+t+" cannot be zero: "+r);_=-(E=r<0?-r:r)}if(e.hasOwnProperty(t="CRYPTO")){if((r=e[t])!==!!r)throw Error(U+t+" not true or false: "+r);if(r&&("undefined"==typeof crypto||!crypto||!crypto.getRandomValues&&!crypto.randomBytes))throw O=!r,Error(U+"crypto unavailable");O=r}if(e.hasOwnProperty(t="MODULO_MODE")&&(H(r=e[t],0,9,t),i=r),e.hasOwnProperty(t="POW_PRECISION")&&(H(r=e[t],0,G,t),N=r),e.hasOwnProperty(t="FORMAT")){if("object"!=R(r=e[t]))throw Error(U+t+" not an object: "+r);S=r}if(e.hasOwnProperty(t="ALPHABET")){if("string"!=typeof(r=e[t])||/^.?$|[+\-.\s]|(.).*\1/.test(r))throw Error(U+t+" invalid: "+r);j="0123456789"==r.slice(0,10),A=r}}return{DECIMAL_PLACES:b,ROUNDING_MODE:m,EXPONENTIAL_AT:[d,w],RANGE:[_,E],CRYPTO:O,MODULO_MODE:i,POW_PRECISION:N,FORMAT:S,ALPHABET:A}},k.isBigNumber=function(e){if(!e||!0!==e._isBigNumber)return!1;if(!k.DEBUG)return!0;var t,r,n=e.c,i=e.e,o=e.s;e:if("[object Array]"=={}.toString.call(n)){if((1===o||-1===o)&&-G<=i&&i<=G&&i===z(i))if(0===n[0]){if(0===i&&1===n.length)return!0}else 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||F<=r||r!==z(r))break e;if(0!==r)return!0}}else if(null===n&&null===i&&(null===o||1===o||-1===o))return!0;throw Error(U+"Invalid BigNumber: "+e)},k.maximum=k.max=function(){return o(arguments,r.lt)},k.minimum=k.min=function(){return o(arguments,r.gt)},k.random=(t=9007199254740992,c=Math.random()*t&2097151?function(){return z(Math.random()*t)}:function(){return 8388608*(1073741824*Math.random()|0)+(8388608*Math.random()|0)},function(e){var t,r,n,i,o,l=0,s=[],u=new k(g);if(null==e?e=b:H(e,0,G),i=At(e/L),O)if(crypto.getRandomValues){for(t=crypto.getRandomValues(new Uint32Array(i*=2));l<i;)9e15<=(o=131072*t[l]+(t[l+1]>>>11))?(r=crypto.getRandomValues(new Uint32Array(2)),t[l]=r[0],t[l+1]=r[1]):(s.push(o%1e14),l+=2);l=i/2}else{if(!crypto.randomBytes)throw O=!1,Error(U+"crypto unavailable");for(t=crypto.randomBytes(i*=7);l<i;)9e15<=(o=281474976710656*(31&t[l])+1099511627776*t[l+1]+4294967296*t[l+2]+16777216*t[l+3]+(t[l+4]<<16)+(t[l+5]<<8)+t[l+6])?crypto.randomBytes(7).copy(t,l):(s.push(o%1e14),l+=7);l=i/7}if(!O)for(;l<i;)(o=c())<9e15&&(s[l++]=o%1e14);for(i=s[--l],e%=L,i&&e&&(s[l]=z(i/(o=xt[L-e]))*o);0===s[l];s.pop(),l--);if(l<0)s=[n=0];else{for(n=-1;0===s[0];s.splice(0,1),n-=L);for(l=1,o=s[0];10<=o;o/=10,l++);l<L&&(n-=L-l)}return u.e=n,u.c=s,u}),k.sum=function(){for(var e=1,t=arguments,r=new k(t[0]);e<t.length;)r=r.plus(t[e++]);return r},y="0123456789",f=function(e,t,r,n,i){var o,l,s,u,c,a,f,p,h=e.indexOf("."),g=b,d=m;for(0<=h&&(u=N,N=0,e=e.replace(".",""),a=(p=new k(t)).pow(e.length-h),N=u,p.c=x(X(J(a.c),a.e,"0"),10,r,y),p.e=p.c.length),s=u=(f=x(e,t,r,i?(o=A,y):(o=y,A))).length;0==f[--u];f.pop());if(!f[0])return o.charAt(0);if(h<0?--s:(a.c=f,a.e=s,a.s=n,f=(a=v(a,p,g,d,r)).c,c=a.r,s=a.e),h=f[l=s+g+1],u=r/2,c=c||l<0||null!=f[l+1],c=d<4?(null!=h||c)&&(0==d||d==(a.s<0?3:2)):u<h||h==u&&(4==d||c||6==d&&1&f[l-1]||d==(a.s<0?8:7)),l<1||!f[0])e=c?X(o.charAt(1),-g,o.charAt(0)):o.charAt(0);else{if(f.length=l,c)for(--r;++f[--l]>r;)f[l]=0,l||(++s,f=[1].concat(f));for(u=f.length;!f[--u];);for(h=0,e="";h<=u;e+=o.charAt(f[h++]));e=X(e,s,o.charAt(0))}return e},v=function(e,t,r,n,i){var o,l,s,u,c,a,f,p,h,g,d,v,y,b,m,w,_,E=e.s==t.s?1:-1,O=e.c,N=t.c;if(!(O&&O[0]&&N&&N[0]))return new k(e.s&&t.s&&(O?!N||O[0]!=N[0]:N)?O&&0==O[0]||!N?0*E:E/0:NaN);for(h=(p=new k(E)).c=[],E=r+(l=e.e-t.e)+1,i||(i=F,l=q(e.e/L)-q(t.e/L),E=E/L|0),s=0;N[s]==(O[s]||0);s++);if(N[s]>(O[s]||0)&&l--,E<0)h.push(1),u=!0;else{for(b=O.length,w=N.length,E+=2,1<(c=z(i/(N[s=0]+1)))&&(N=P(N,c,i),O=P(O,c,i),w=N.length,b=O.length),y=w,d=(g=O.slice(0,w)).length;d<w;g[d++]=0);_=N.slice(),_=[0].concat(_),m=N[0],N[1]>=i/2&&m++;do{if(c=0,(o=C(N,g,w,d))<0){if(v=g[0],w!=d&&(v=v*i+(g[1]||0)),1<(c=z(v/m)))for(f=(a=P(N,c=i<=c?i-1:c,i)).length,d=g.length;1==C(a,g,f,d);)c--,T(a,w<f?_:N,f,i),f=a.length,o=1;else 0==c&&(o=c=1),f=(a=N.slice()).length;if(T(g,a=f<d?[0].concat(a):a,d,i),d=g.length,-1==o)for(;C(N,g,w,d)<1;)c++,T(g,w<d?_:N,d,i),d=g.length}else 0===o&&(c++,g=[0])}while(h[s++]=c,g[0]?g[d++]=O[y]||0:(g=[O[y]],d=1),(y++<b||null!=g[0])&&E--);u=null!=g[0],h[0]||h.splice(0,1)}if(i==F){for(s=1,E=h[0];10<=E;E/=10,s++);D(p,r+(p.e=s+l*L-1)+1,n,u)}else p.e=l,p.r=+u;return p},l=/^(-?)0([xbo])(?=\w[\w.]*$)/i,s=/^([^.]+)\.$/,u=/^\.([^.]+)$/,a=/^-?(Infinity|NaN)$/,h=/^\s*\+(?=[\w.])|^\s+|\s+$/g,p=function(e,t,r,n){var i,o=r?t:t.replace(h,"");if(a.test(o))e.s=isNaN(o)?null:o<0?-1:1;else{if(!r&&(o=o.replace(l,function(e,t,r){return i="x"==(r=r.toLowerCase())?16:"b"==r?2:8,n&&n!=i?e:t}),n&&(i=n,o=o.replace(s,"$1").replace(u,"0.$1")),t!=o))return new k(o,i);if(k.DEBUG)throw Error(U+"Not a"+(n?" base "+n:"")+" number: "+t);e.s=null}e.c=e.e=null},r.absoluteValue=r.abs=function(){var e=new k(this);return e.s<0&&(e.s=1),e},r.comparedTo=function(e,t){return W(this,new k(e,t))},r.decimalPlaces=r.dp=function(e,t){var r,n;if(null!=e)return H(e,0,G),null==t?t=m:H(t,0,8),D(new k(this),e+this.e+1,t);if(!(e=this.c))return null;if(r=((n=e.length-1)-q(this.e/L))*L,n=e[n])for(;n%10==0;n/=10,r--);return r=r<0?0:r},r.dividedBy=r.div=function(e,t){return v(this,new k(e,t),b,m)},r.dividedToIntegerBy=r.idiv=function(e,t){return v(this,new k(e,t),0,1)},r.exponentiatedBy=r.pow=function(e,t){var r,n,i,o,l,s,u,c,a=this;if((e=new k(e)).c&&!e.isInteger())throw Error(U+"Exponent not an integer: "+B(e));if(null!=t&&(t=new k(t)),l=14<e.e,!a.c||!a.c[0]||1==a.c[0]&&!a.e&&1==a.c.length||!e.c||!e.c[0])return c=new k(Math.pow(+B(a),l?e.s*(2-V(e)):+B(e))),t?c.mod(t):c;if(s=e.s<0,t){if(t.c?!t.c[0]:!t.s)return new k(NaN);(n=!s&&a.isInteger()&&t.isInteger())&&(a=a.mod(t))}else{if(9<e.e&&(0<a.e||a.e<-1||(0==a.e?1<a.c[0]||l&&24e7<=a.c[1]:a.c[0]<8e13||l&&a.c[0]<=9999975e7)))return o=a.s<0&&V(e)?-0:0,-1<a.e&&(o=1/o),new k(s?1/o:o);N&&(o=At(N/L+2))}for(u=l?(r=new k(.5),s&&(e.s=1),V(e)):(i=Math.abs(+B(e)))%2,c=new k(g);;){if(u){if(!(c=c.times(a)).c)break;o?c.c.length>o&&(c.c.length=o):n&&(c=c.mod(t))}if(i){if(0===(i=z(i/2)))break;u=i%2}else if(D(e=e.times(r),e.e+1,1),14<e.e)u=V(e);else{if(0==(i=+B(e)))break;u=i%2}a=a.times(a),o?a.c&&a.c.length>o&&(a.c.length=o):n&&(a=a.mod(t))}return n?c:(s&&(c=g.div(c)),t?c.mod(t):o?D(c,N,m,void 0):c)},r.integerValue=function(e){var t=new k(this);return null==e?e=m:H(e,0,8),D(t,t.e+1,e)},r.isEqualTo=r.eq=function(e,t){return 0===W(this,new k(e,t))},r.isFinite=function(){return!!this.c},r.isGreaterThan=r.gt=function(e,t){return 0<W(this,new k(e,t))},r.isGreaterThanOrEqualTo=r.gte=function(e,t){return 1===(t=W(this,new k(e,t)))||0===t},r.isInteger=function(){return!!this.c&&q(this.e/L)>this.c.length-2},r.isLessThan=r.lt=function(e,t){return W(this,new k(e,t))<0},r.isLessThanOrEqualTo=r.lte=function(e,t){return-1===(t=W(this,new k(e,t)))||0===t},r.isNaN=function(){return!this.s},r.isNegative=function(){return this.s<0},r.isPositive=function(){return 0<this.s},r.isZero=function(){return!!this.c&&0==this.c[0]},r.minus=function(e,t){var r,n,i,o,l=this,s=l.s;if(t=(e=new k(e,t)).s,!s||!t)return new k(NaN);if(s!=t)return e.s=-t,l.plus(e);var u=l.e/L,c=e.e/L,a=l.c,f=e.c;if(!u||!c){if(!a||!f)return a?(e.s=-t,e):new k(f?l:NaN);if(!a[0]||!f[0])return f[0]?(e.s=-t,e):new k(a[0]?l:3==m?-0:0)}if(u=q(u),c=q(c),a=a.slice(),s=u-c){for((i=(o=s<0)?(s=-s,a):(c=u,f)).reverse(),t=s;t--;i.push(0));i.reverse()}else for(n=(o=(s=a.length)<(t=f.length))?s:t,s=t=0;t<n;t++)if(a[t]!=f[t]){o=a[t]<f[t];break}if(o&&(i=a,a=f,f=i,e.s=-e.s),0<(t=(n=f.length)-(r=a.length)))for(;t--;a[r++]=0);for(t=F-1;s<n;){if(a[--n]<f[n]){for(r=n;r&&!a[--r];a[r]=t);--a[r],a[n]+=F}a[n]-=f[n]}for(;0==a[0];a.splice(0,1),--c);return a[0]?$(e,a,c):(e.s=3==m?-1:1,e.c=[e.e=0],e)},r.modulo=r.mod=function(e,t){var r,n=this;return e=new k(e,t),!n.c||!e.s||e.c&&!e.c[0]?new k(NaN):!e.c||n.c&&!n.c[0]?new k(n):(9==i?(t=e.s,e.s=1,r=v(n,e,0,3),e.s=t,r.s*=t):r=v(n,e,0,i),(e=n.minus(r.times(e))).c[0]||1!=i||(e.s=n.s),e)},r.multipliedBy=r.times=function(e,t){var r,n,i,o,l,s,u,c,a,f,p,h=this,g=h.c,d=(e=new k(e,t)).c;if(!(g&&d&&g[0]&&d[0]))return!h.s||!e.s||g&&!g[0]&&!d||d&&!d[0]&&!g?e.c=e.e=e.s=null:(e.s*=h.s,g&&d?(e.c=[0],e.e=0):e.c=e.e=null),e;for(t=q(h.e/L)+q(e.e/L),e.s*=h.s,(s=g.length)<(h=d.length)&&(p=g,g=d,d=p,n=s,s=h,h=n),n=s+h,p=[];n--;p.push(0));for(n=h;0<=--n;){for(a=d[n]%1e7,f=d[n]/1e7|(r=0),i=n+(o=s);n<i;)r=((u=a*(u=g[--o]%1e7)+(l=f*u+(c=g[o]/1e7|0)*a)%1e7*1e7+p[i]+r)/1e14|0)+(l/1e7|0)+f*c,p[i--]=u%1e14;p[i]=r}return r?++t:p.splice(0,1),$(e,p,t)},r.negated=function(){var e=new k(this);return e.s=-e.s||null,e},r.plus=function(e,t){var r,n=this,i=n.s;if(t=(e=new k(e,t)).s,!i||!t)return new k(NaN);if(i!=t)return e.s=-t,n.minus(e);var o=n.e/L,l=e.e/L,s=n.c,u=e.c;if(!o||!l){if(!s||!u)return new k(i/0);if(!s[0]||!u[0])return u[0]?e:new k(s[0]?n:0*i)}if(o=q(o),l=q(l),s=s.slice(),i=o-l){for((r=0<i?(l=o,u):(i=-i,s)).reverse();i--;r.push(0));r.reverse()}for((i=s.length)-(t=u.length)<0&&(r=u,u=s,s=r,t=i),i=0;t;)i=(s[--t]=s[t]+u[t]+i)/F|0,s[t]=F===s[t]?0:s[t]%F;return i&&(s=[i].concat(s),++l),$(e,s,l)},r.precision=r.sd=function(e,t){var r,n;if(null!=e&&e!==!!e)return H(e,1,G),null==t?t=m:H(t,0,8),D(new k(this),e,t);if(!(t=this.c))return null;if(r=(n=t.length-1)*L+1,n=t[n]){for(;n%10==0;n/=10,r--);for(n=t[0];10<=n;n/=10,r++);}return r=e&&this.e+1>r?this.e+1:r},r.shiftedBy=function(e){return H(e,-kt,kt),this.times("1e"+e)},r.squareRoot=r.sqrt=function(){var e,t,r,n,i,o=this,l=o.c,s=o.s,u=o.e,c=b+4,a=new k("0.5");if(1!==s||!l||!l[0])return new k(!s||s<0&&(!l||l[0])?NaN:l?o:1/0);if((r=0==(s=Math.sqrt(+B(o)))||s==1/0?(((t=J(l)).length+u)%2==0&&(t+="0"),s=Math.sqrt(+t),u=q((u+1)/2)-(u<0||u%2),new k(t=s==1/0?"5e"+u:(t=s.toExponential()).slice(0,t.indexOf("e")+1)+u)):new k(s+"")).c[0])for((s=(u=r.e)+c)<3&&(s=0);;)if(i=r,r=a.times(i.plus(v(o,i,c,1))),J(i.c).slice(0,s)===(t=J(r.c)).slice(0,s)){if(r.e<u&&--s,"9999"!=(t=t.slice(s-3,s+1))&&(n||"4999"!=t)){+t&&(+t.slice(1)||"5"!=t.charAt(0))||(D(r,r.e+b+2,1),e=!r.times(r).eq(o));break}if(!n&&(D(i,i.e+b+2,0),i.times(i).eq(o))){r=i;break}c+=4,s+=4,n=1}return D(r,r.e+b+1,m,e)},r.toExponential=function(e,t){return null!=e&&(H(e,0,G),e++),n(this,e,t,1)},r.toFixed=function(e,t){return null!=e&&(H(e,0,G),e=e+this.e+1),n(this,e,t)},r.toFormat=function(e,t,r){if(null==r)null!=e&&t&&"object"==R(t)?(r=t,t=null):e&&"object"==R(e)?(r=e,e=t=null):r=S;else if("object"!=R(r))throw Error(U+"Argument not an object: "+r);if(e=this.toFixed(e,t),this.c){var n,t=e.split("."),i=+r.groupSize,o=+r.secondaryGroupSize,l=r.groupSeparator||"",s=t[0],t=t[1],u=this.s<0,c=u?s.slice(1):s,a=c.length;if(o&&(n=i,i=o,a-=o=n),0<i&&0<a){for(s=c.substr(0,n=a%i||i);n<a;n+=i)s+=l+c.substr(n,i);0<o&&(s+=l+c.slice(n)),u&&(s="-"+s)}e=t?s+(r.decimalSeparator||"")+((o=+r.fractionGroupSize)?t.replace(new RegExp("\\d{"+o+"}\\B","g"),"$&"+(r.fractionGroupSeparator||"")):t):s}return(r.prefix||"")+e+(r.suffix||"")},r.toFraction=function(e){var t,r,n,i,o,l,s,u,c,a,f=this,p=f.c;if(null!=e&&(!(s=new k(e)).isInteger()&&(s.c||1!==s.s)||s.lt(g)))throw Error(U+"Argument "+(s.isInteger()?"out of range: ":"not an integer: ")+B(s));if(!p)return new k(f);for(t=new k(g),c=r=new k(g),n=u=new k(g),p=J(p),o=t.e=p.length-f.e-1,t.c[0]=xt[(l=o%L)<0?L+l:l],e=!e||0<s.comparedTo(t)?0<o?t:c:s,l=E,E=1/0,s=new k(p),u.c[0]=0;a=v(s,t,0,1),1!=(i=r.plus(a.times(n))).comparedTo(e);)r=n,n=i,c=u.plus(a.times(i=c)),u=i,t=s.minus(a.times(i=t)),s=i;return i=v(e.minus(r),n,0,1),u=u.plus(i.times(c)),r=r.plus(i.times(n)),u.s=c.s=f.s,p=v(c,n,o*=2,m).minus(f).abs().comparedTo(v(u,r,o,m).minus(f).abs())<1?[c,n]:[u,r],E=l,p},r.toNumber=function(){return+B(this)},r.toPrecision=function(e,t){return null!=e&&H(e,1,G),n(this,e,t,2)},r.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":(t=null==e?i<=d||w<=i?Z(J(r.c),i):X(J(r.c),i,"0"):10===e&&j?X(J((r=D(new k(r),b+i+1,m)).c),r.e,"0"):(H(e,2,A.length,"Base"),f(X(J(r.c),i,"0"),10,e,n,!0)),n<0&&r.c[0]&&(t="-"+t)),t},r.valueOf=r.toJSON=function(){return B(this)},r._isBigNumber=!0,r[Symbol.toStringTag]="BigNumber",r[Symbol.for("nodejs.util.inspect.custom")]=r.valueOf,null!=e&&k.set(e),k}();function Pt(e){for(var t=[];0<e.length;){var r=e.shift();if(j(r)){if(t.length<2)throw new Error("错误的栈长度, 可能是无法计算的表达式");var n=t.pop(),i=t.pop();if("string"==typeof n&&!E.isBigNumber(n)){if(!c(n))throw new Error("".concat(n,"不是一个合法的数字"));n=new E(n)}if("string"==typeof i&&!E.isBigNumber(i)){if(!c(i))throw new Error("".concat(i,"不是一个合法的数字"));i=new E(i)}switch(r){case"+":t.push(i.plus(n));break;case"-":t.push(i.minus(n));break;case"*":t.push(i.times(n));break;case"/":t.push(i.div(n));break;case"%":t.push(i.mod(n));break;case"**":t.push(i.pow(n))}}else t.push(r)}if(1!==t.length)throw"unvalid expression";var o=t[0];if((o=E.isBigNumber(o)?o:E(o)).isNaN())throw new Error("计算结果为NaN");return o}function Ct(e,t,r){var n,i,o,l,s,u,c,a,f,p,h,g,d,v,y,b,m,w,_="";return E.isBigNumber(e)?_=e.toFixed():"string"!=typeof e&&(_=e.toString()),"undefined"===_||"NaN"===_?null:(i=n=null,l=o=!1,b=a=c=u=!(s="~-"),t.forEach(function(e){var t=e.type;if("symbol"===t){if(![">=","<=","=","<",">"].includes(e.value))throw new Error("错误的格式化参数:",e.value);i=e.value}else if("to-number"===t)b=!0;else if("comma"===t)o=!0;else if("number"===t)n=e.value;else if("plus"===t)l=!0;else if("round"===t)s=e.value;else if("fraction"===t)c=!0;else if("scientific"===t)u=!0;else{if("percent"!==t)throw new Error("错误的fmt Token");a=!0}}),u?(e=E(_).toExponential(),l&&!e.startsWith("-")?"+"+e:e):c?(t=E(_).toFraction().map(function(e){return e.toFixed()}).join("/"),l&&!t.startsWith("-")?"+"+t:t):(a&&(_=E(_).times(100).toFixed()),n&&(e=_.split("."),t=e[0],e=1===e.length?"":e[1],h=i,g=+n,m=s,d=f=t,y=(v=p=e).length,w={"~-":function(){v=p.slice(0,"<"===h?g-1:g)},"~+":function(){var e,t="<"===h?g-1:g;y<=t||0===y||(e=p.slice(0,t),0!=+p.slice(t,y)&&(e=(+e+1).toString()).length>t?(v=e.slice(1,e.length),d=(+d+1).toString()):v=e)},"~5":function(){var e,t;0===y||(v=p.slice(0,e="<"===h?g-1:g),t=+p[e],Number.isNaN(t))||5<=t&&(v=(+v+1).toString()).length>e&&(v=v.slice(1,v.length),d=(+d+1).toString())},"~6":function(){var e,t,r,n;0!==y&&(t=+p[e="<"===h?g-1:g],r=""===(r=p.slice(+e+1,p.length))?0:parseInt(r),n=0===e?+f[f.length-1]:+p[e-1],v=p.slice(0,e),6<=t||5==t&&0<r||5==t&&n%2!=0)&&(v=(+v+1).toString()).length>e&&(v=v.slice(1,v.length),d=(+d+1).toString())}},"<="===h?v=y<=g?p:(w[m]&&w[m](),v.replace(/0+$/,"")):"<"===h?v=y<g?p:(w[m]&&w[m](),v.replace(/0+$/,"")):"="===h?y<g?v=p+"0".repeat(g-y):g<y&&w[m]&&w[m]():">="===h?y<g&&(v=p+"0".repeat(g-y)):">"===h&&y<=g&&(v=p+"0".repeat(g-y+1)),t=(w={int_part:d,dec_part:v}).int_part,_=""===(e=w.dec_part)?t:"".concat(t,".").concat(e)),o&&(b=!1,_=1<(m=_.split(".")).length?((w=m[0]).includes("-")?m[0]=w[0]+w.slice(1).replace(/(?=(?!^)(?:\d{3})+$)/g,","):m[0]=w.replace(/(?=(?!^)(?:\d{3})+$)/g,","),m.join(".")):(t=m[0]).includes("-")?t[0]+t.slice(1).replace(/(?=(?!^)(?:\d{3})+$)/g,","):t.replace(/(?=(?!^)(?:\d{3})+$)/g,",")),l&&(b=!1,_.startsWith("-")||(_="+"+_)),a&&(b=!1,_+="%"),b&&!r?+_:_))}function Tt(e,i){return e.map(function(e){if("var"!==e.type)return e;for(var t,r,n=0;n<i.length&&!h(t=y(i[n],e.value));n++);if("number"==typeof(r=t)||c(r))return{type:"number",value:t};throw new Error("错误的填充值")})}function $t(e){var r=null;return e.length,{tokens:e.map(function(e){var t=function(e){for(var t,r,n=null,i=null,o=[/^([+-]?[\d.]+(?:e|E)(?:\+|-)?\d+)(.*)$/,/^([+-]?[\d.]+)(.*)$/],l=0;l<o.length;l++){var s=e.match(o[l]);if(s){t=s;break}}return t&&(i=t[1],""!==(r=t[2]).trim())&&(n=r),{num:i,unit:n}}(e.value);return null!==t.unit?(null==r&&(r=t.unit),{type:"number",value:t.num}):e}),unit:r}}var Dt=!1;var t="#ff8936",i="#fff",s="#67C23A",r="#ee7959",m={expr:"background: ".concat(t,";color: ").concat(i,";font-weight: bold;border-radius: 2px; padding: 3px 8px;"),label1:"color: ".concat(s,"; font-weight: bold; white-space:nowrap; overflow: hidden; text-overflow: ellipsis;"),label2:"color: ".concat(r,"; font-weight: bold;")};function w(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];var n,i=function(e){var t="",r=e[0],n=e[1],i={origin_expr:r,origin_fill_data:n,expr:"",fmt_tokens:null,options:null,fmt_err:!1,expr_err:!1},n=(h(n)&&(i.options=n),y(n,"_error",!1));if(0===e.length)throw new Error("至少传入一个参数");if("string"==typeof r){if(""===(t=r).trim()||r.includes("NaN"))return i.expr_err=!0,i}else{if("number"!=typeof r){if(!0===n)return i.expr_err=!0,i;throw new Error("错误的第一个参数类型: ".concat(r," 类型为:").concat(R(r)))}t=r.toString()}if(e=t.split("|"),i.expr=e[0],1<e.length){n=e[1];if(""!==n.trim())try{i.fmt_tokens=T(n)}catch(e){return i.fmt_err=!0,i}}if(null!==i.options&&i.options._fmt){var o,r=[];try{r=T(i.options._fmt)}catch(e){return i.fmt_err=!0,i}null===i.fmt_tokens?i.fmt_tokens=r:(o=i.fmt_tokens.map(function(e){return e.type}),r.forEach(function(e){o.includes(e.type)||i.fmt_tokens.push(e)}))}return i}(t),o=y(i,"options._error",void 0),l=y(i,"options._debug",!1),s=y(i,"options._unit",!1),u=i.options,c=null;if(i.fmt_err||i.expr_err){if(h(o))return o;throw new Error("表达式或格式化字符串错误,表达式为:".concat(i.expr))}var a=i.fmt_tokens;if(h(o))try{n=Et(i.expr,s)}catch(e){return o}else n=Et(i.expr,s);if(x(u))f=n;else{var f,p=[];if(Array.isArray(u)?p=u:(p.push(u),h(u=y(u,"_fill_data",{}))&&(Array.isArray(u)?p=[].concat(O(p),O(u)):p.push(u))),h(o))try{f=Ot(n,p,s),P(i.fmt_tokens)&&(a=Tt(i.fmt_tokens,p))}catch(e){return o}else f=Ot(n,p,s),P(i.fmt_tokens)&&(a=Tt(i.fmt_tokens,p));[!0,"on","auto","space"].includes(s)&&(c=(u=$t(f)).unit,f=u.tokens)}p=Nt(f),u=null;if(h(o))try{u=Pt(p)}catch(e){return o}else u=Pt(p);if("Infinity"!==(u=P(a)?Ct(u,a,s):null!==u?u.toFixed():null)&&null!==u)return null!==c&&(u+=c),(Dt||l)&&(console.groupCollapsed("%c"+i.origin_expr,m.expr),console.groupCollapsed("%c表达式:",m.label1,i.origin_expr),console.log(i.origin_expr),console.groupEnd(),console.groupCollapsed("%c数据源:",m.label1,JSON.stringify(i.origin_fill_data)),console.log(i.origin_fill_data),console.groupEnd(),console.groupCollapsed("%ctokens:",m.label1,JSON.stringify(n)),console.log(n),console.groupEnd(),console.groupCollapsed("%cfilled-tokens:",m.label1,JSON.stringify(f)),console.log(f),console.groupEnd(),console.groupCollapsed("%cfmt-tokens:",m.label1,JSON.stringify(i.fmt_tokens)),console.log(i.fmt_tokens),console.groupEnd(),console.groupCollapsed("%cfmt-filled-tokens:",m.label1,JSON.stringify(a)),console.log(a),console.groupEnd(),console.groupCollapsed("%cpostfix-tokens:",m.label1,JSON.stringify(p)),console.log(p),console.groupEnd(),console.groupCollapsed("%c单位:",m.label1,c),console.log(c),console.groupEnd(),console.groupCollapsed("%cparse-arg:",m.label1,JSON.stringify(i)),console.log(i),console.groupEnd(),console.groupEnd()),u;if(h(o))return o;throw new Error("计算错误可能是非法的计算式")}console.log("%ca-calc:%c ".concat(N," %c=> %curl:%c https://www.npmjs.com/package/a-calc"),"color: #fff;background: #67C23A;padding: 2px 5px;border-radius:4px;font-size: 14px;","color: #67C23A;font-size:14px;","color: #67C23A;font-size:14px;","background: #67C23A;font-size:14px; padding: 2px 5px; border-radius: 4px; color: #fff;","font-size:14px;");a=w;return e.calc=w,e.calc_wrap=function(t,r){var n={},i={_error:"-"};return["string","number"].includes(R(t))?(Array.isArray(r)||void 0===r||Object.keys(r).forEach(function(e){return e.startsWith("_")&&(i[e]=r[e])}),n=null!=r?r:{},/[a-zA-Z_]/.test(t.toString())?void 0!==r?(n=r,w(t,o(o({},i),n))):function(e){return w(t,e)}:w(t,o(o({},i),n))):(n=t,function(e){return w(e,n)})},e.close_debug=function(){Dt=!1},e.fmt=a,e.open_debug=function(){Dt=!0},e.version=N,Object.defineProperty(e,"__esModule",{value:!0}),e}({});

@@ -0,1 +1,18 @@

type StrOrNum = string | number
type InjectDataFn = <T>( data?: T extends string | number | undefined | null ? never : T ) => StrOrNum
type InjectExprFn = ( expr?: StrOrNum ) => StrOrNum
type StringToUnion<T extends string> = T extends `${ infer Letter }${ infer Rest }` ? Letter | Uppercase<Letter> | StringToUnion<Rest> : never;
type VarUnion = StringToUnion<"abcdefghijklmnopqrstuvwxyz_">
type IncludesVar<T> = T extends string ? T extends `${ infer F }${ infer R }` ? F extends VarUnion ? true : IncludesVar<R> : false : false
declare function calc_wrap<const T, R = undefined> (
expr_or_data: T, data?: R
): T extends StrOrNum ? IncludesVar<T> extends true ? R extends undefined ? InjectDataFn : StrOrNum : StrOrNum : InjectExprFn;
export declare type CalcConfig = any[] | Partial<{

@@ -2,0 +19,0 @@ // 出错时显示的值

{
"name": "a-calc",
"version": "1.2.8",
"version": "1.2.9",
"description": "Very powerful arbitrary precision calculation library and number formatting library",

@@ -5,0 +5,0 @@ "main": "./cjs/index.cjs",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc