a-calc 3.0.0-beta.20250123.5 → 3.0.0-beta.20250123.6

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/browser/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  var a_calc=function(exports){"use strict";var _documentCurrentScript="undefined"!=typeof document?document.currentScript:null;function _arrayLikeToArray(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function _arrayWithHoles(e){if(Array.isArray(e))return e}function _arrayWithoutHoles(e){if(Array.isArray(e))return _arrayLikeToArray(e)}function asyncGeneratorStep(e,t,r,n,i,a,o){try{var s=e[a](o),_=s.value}catch(e){return void r(e)}s.done?t(_):Promise.resolve(_).then(n,i)}function _asyncToGenerator(e){return function(){var t=this,r=arguments;return new Promise(function(n,i){var a=e.apply(t,r);function o(e){asyncGeneratorStep(a,n,i,o,s,"next",e)}function s(e){asyncGeneratorStep(a,n,i,o,s,"throw",e)}o(void 0)})}}function _createForOfIteratorHelper(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=_unsupportedIterableToArray(e))||t){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==r.return||r.return()}finally{if(s)throw a}}}}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 _iterableToArray(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function _iterableToArrayLimit(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,i,a,o,s=[],_=!0,u=!1;try{if(a=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;_=!1}else for(;!(_=(n=a.call(r)).done)&&(s.push(n.value),s.length!==t);_=!0);}catch(e){u=!0,i=e}finally{try{if(!_&&null!=r.return&&(o=r.return(),Object(o)!==o))return}finally{if(u)throw i}}return s}}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 _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 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 _regenerator(){
2
2
  /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */
3
- var e,t,r="function"==typeof Symbol?Symbol:{},n=r.iterator||"@@iterator",i=r.toStringTag||"@@toStringTag";function a(r,n,i,a){var _=n&&n.prototype instanceof s?n:s,u=Object.create(_.prototype);return _regeneratorDefine(u,"_invoke",function(r,n,i){var a,s,_,u=0,c=i||[],l=!1,p={p:0,n:0,v:e,a:d,f:d.bind(e,4),d:function(t,r){return a=t,s=0,_=e,p.n=r,o}};function d(r,n){for(s=r,_=n,t=0;!l&&u&&!i&&t<c.length;t++){var i,a=c[t],d=p.p,f=a[2];r>3?(i=f===n)&&(_=a[(s=a[4])?5:(s=3,3)],a[4]=a[5]=e):a[0]<=d&&((i=r<2&&d<a[1])?(s=0,p.v=n,p.n=a[1]):d<f&&(i=r<3||a[0]>n||n>f)&&(a[4]=r,a[5]=n,p.n=f,s=0))}if(i||r>1)return o;throw l=!0,n}return function(i,c,f){if(u>1)throw TypeError("Generator is already running");for(l&&1===c&&d(c,f),s=c,_=f;(t=s<2?e:_)||!l;){a||(s?s<3?(s>1&&(p.n=-1),d(s,_)):p.n=_:p.v=_);try{if(u=2,a){if(s||(i="next"),t=a[i]){if(!(t=t.call(a,_)))throw TypeError("iterator result is not an object");if(!t.done)return t;_=t.value,s<2&&(s=0)}else 1===s&&(t=a.return)&&t.call(a),s<2&&(_=TypeError("The iterator does not provide a '"+i+"' method"),s=1);a=e}else if((t=(l=p.n<0)?_:r.call(n,p))!==o)break}catch(t){a=e,s=1,_=t}finally{u=1}}return{value:t,done:l}}}(r,i,a),!0),u}var o={};function s(){}function _(){}function u(){}t=Object.getPrototypeOf;var c=[][n]?t(t([][n]())):(_regeneratorDefine(t={},n,function(){return this}),t),l=u.prototype=s.prototype=Object.create(c);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,u):(e.__proto__=u,_regeneratorDefine(e,i,"GeneratorFunction")),e.prototype=Object.create(l),e}return _.prototype=u,_regeneratorDefine(l,"constructor",u),_regeneratorDefine(u,"constructor",_),_.displayName="GeneratorFunction",_regeneratorDefine(u,i,"GeneratorFunction"),_regeneratorDefine(l),_regeneratorDefine(l,i,"Generator"),_regeneratorDefine(l,n,function(){return this}),_regeneratorDefine(l,"toString",function(){return"[object Generator]"}),(_regenerator=function(){return{w:a,m:p}})()}function _regeneratorDefine(e,t,r,n){var i=Object.defineProperty;try{i({},"",{})}catch(e){i=0}_regeneratorDefine=function(e,t,r,n){function a(t,r){_regeneratorDefine(e,t,function(e){return this._invoke(t,r,e)})}t?i?i(e,t,{value:r,enumerable:!n,configurable:!n,writable:!n}):e[t]=r:(a("next",0),a("throw",1),a("return",2))},_regeneratorDefine(e,t,r,n)}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 _toPrimitive(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);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:t+""}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 _unsupportedIterableToArray(e,t){if(e){if("string"==typeof e)return _arrayLikeToArray(e,t);var r={}.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}}var version="3.0.0-beta.20250123.5";function decimal_round(e,t,r,n,i){var a=e.startsWith("-"),o=a?e.slice(1):e,s=o,_=t,u=t.length;function c(){s=(+s+1).toString()}var l={"~-":function(){var e="<"===r?n-1:n;_=t.slice(0,e)},"~+":function(){var e="<"===r?n-1:n;if(!(u<=e||0===u)){var i=t.slice(0,e);0===+t.slice(e,u)?_=i:(i=(+"9".concat(i)+1).toString().slice(1)).length>e?(_=i.slice(1,i.length),c()):_=i}},"~5":function(){if(0!==u){var e="<"===r?n-1:n;_=t.slice(0,e);var i=+t[e];Number.isNaN(i)||i>=5&&(_=(+"9".concat(_)+1).toString().slice(1)).length>e&&(_=_.slice(1,_.length),c())}},"~6":function(){if(0!==u){var e,i="<"===r?n-1:n,a=+t[i],s=t.slice(+i+1,t.length);s=""===s?0:parseInt(s),e=0===i?+o[o.length-1]:+t[i-1],_=t.slice(0,i),(a>=6||5===a&&s>0||5===a&&e%2!=0)&&(_=(+"9".concat(_)+1).toString().slice(1)).length>i&&(_=_.slice(1,_.length),c())}}};return"<="===r?u<=n?_=t.replace(/0*$/,""):(l[i]&&l[i](),_=_.replace(/0+$/,"")):"<"===r?u<n?_=t.replace(/0*$/,""):(l[i]&&l[i](),_=_.replace(/0+$/,"")):"="===r?u<n?_=t+"0".repeat(n-u):u>n&&l[i]&&l[i]():">="===r?u<n&&(_=t+"0".repeat(n-u)):">"===r&&u<=n&&(_=t+"0".repeat(n-u+1)),{int_part:a?"-".concat(s):s,dec_part:_}}var number_char="0123456789",var_char="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_$",number_first_char="0123456789-+",var_members_char="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_$[].'\"",var_first_char="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_$",pure_number_var_first_char="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_$",empty_char=" \n\r\t",number_char_set=new Set(number_char),var_char_set=new Set(var_char),var_members_char_set=new Set(var_members_char),var_first_char_set=new Set(var_first_char);new Set(number_first_char);var pure_number_var_first_char_set=new Set(pure_number_var_first_char),empty_char_set=new Set(empty_char),state_initial="initial",state_number="number",state_scientific="scientific",state_operator="operator",state_bracket="bracket",state_var="var",state_symbol="symbol",state_percent="percent",state_round="round",state_plus="plus",state_comma="comma",state_fraction="fraction",state_to_number="to-number",state_to_number_string="to-number-string",state_fallback_var="fallback_var",state_integer_padding="integer_padding",state_volume="volume",state_unit_after="unit_after",state_unit_before="unit_before",state_unit_middle="unit_middle",state_unit_hide="unit_hide",state_unit_default="unit_default",state_thousands="thousands",state_fmt_group="fmt_group",state_comparison="comparison",state_logical="logical",state_logical_not="logical_not",state_ternary_question="ternary_question",state_ternary_colon="ternary_colon",state_function="function",state_range_start="range_start",state_range_end="range_end",state_range_clamp="range_clamp",comparison_operators=new Set([">","<",">=","<=","==","!="]),logical_operators=new Set(["&&","||"]),operator_precedence={"|":0,"?":1,":":1,"||":2,"&&":3,"==":4,"!=":4,">":5,"<":5,">=":5,"<=":5,"+":6,"-":6,"*":7,"/":7,"%":7,"//":7,"**":8,"!":9,"unary-":9,"unary+":9},isArray=Array.isArray,freeGlobal="object"==("undefined"==typeof global?"undefined":_typeof(global))&&global&&global.Object===Object&&global,freeSelf="object"==("undefined"==typeof self?"undefined":_typeof(self))&&self&&self.Object===Object&&self,root=freeGlobal||freeSelf||Function("return this")(),_Symbol=root.Symbol,objectProto$4=Object.prototype,hasOwnProperty$3=objectProto$4.hasOwnProperty,nativeObjectToString$1=objectProto$4.toString,symToStringTag$1=_Symbol?_Symbol.toStringTag:void 0;function getRawTag(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 i=nativeObjectToString$1.call(e);return n&&(t?e[symToStringTag$1]=r:delete e[symToStringTag$1]),i}var objectProto$3=Object.prototype,nativeObjectToString=objectProto$3.toString;function objectToString(e){return nativeObjectToString.call(e)}var nullTag="[object Null]",undefinedTag="[object Undefined]",symToStringTag=_Symbol?_Symbol.toStringTag:void 0;function baseGetTag(e){return null==e?void 0===e?undefinedTag:nullTag:symToStringTag&&symToStringTag in Object(e)?getRawTag(e):objectToString(e)}function isObjectLike(e){return null!=e&&"object"==_typeof(e)}var symbolTag="[object Symbol]";function isSymbol(e){return"symbol"==_typeof(e)||isObjectLike(e)&&baseGetTag(e)==symbolTag}var reIsDeepProp=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,reIsPlainProp=/^\w*$/;function isKey(e,t){if(isArray(e))return!1;var r=_typeof(e);return!("number"!=r&&"symbol"!=r&&"boolean"!=r&&null!=e&&!isSymbol(e))||(reIsPlainProp.test(e)||!reIsDeepProp.test(e)||null!=t&&e in Object(t))}function isObject(e){var t=_typeof(e);return null!=e&&("object"==t||"function"==t)}var asyncTag="[object AsyncFunction]",funcTag="[object Function]",genTag="[object GeneratorFunction]",proxyTag="[object Proxy]";function isFunction(e){if(!isObject(e))return!1;var t=baseGetTag(e);return t==funcTag||t==genTag||t==asyncTag||t==proxyTag}var coreJsData=root["__core-js_shared__"],maskSrcKey=(uid=/[^.]+$/.exec(coreJsData&&coreJsData.keys&&coreJsData.keys.IE_PROTO||""),uid?"Symbol(src)_1."+uid:""),uid;function isMasked(e){return!!maskSrcKey&&maskSrcKey in e}var funcProto$1=Function.prototype,funcToString$1=funcProto$1.toString;function toSource(e){if(null!=e){try{return funcToString$1.call(e)}catch(e){}try{return e+""}catch(e){}}return""}var 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(e){return!(!isObject(e)||isMasked(e))&&(isFunction(e)?reIsNative:reIsHostCtor).test(toSource(e))}function getValue(e,t){return null==e?void 0:e[t]}function getNative(e,t){var r=getValue(e,t);return baseIsNative(r)?r:void 0}var nativeCreate=getNative(Object,"create");function hashClear(){this.__data__=nativeCreate?nativeCreate(null):{},this.size=0}function hashDelete(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var HASH_UNDEFINED$1="__lodash_hash_undefined__",objectProto$1=Object.prototype,hasOwnProperty$1=objectProto$1.hasOwnProperty;function hashGet(e){var t=this.__data__;if(nativeCreate){var r=t[e];return r===HASH_UNDEFINED$1?void 0:r}return hasOwnProperty$1.call(t,e)?t[e]:void 0}var objectProto=Object.prototype,hasOwnProperty=objectProto.hasOwnProperty;function hashHas(e){var t=this.__data__;return nativeCreate?void 0!==t[e]:hasOwnProperty.call(t,e)}var HASH_UNDEFINED="__lodash_hash_undefined__";function hashSet(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=nativeCreate&&void 0===t?HASH_UNDEFINED:t,this}function Hash(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])}}function listCacheClear(){this.__data__=[],this.size=0}function eq(e,t){return e===t||e!=e&&t!=t}function assocIndexOf(e,t){for(var r=e.length;r--;)if(eq(e[r][0],t))return r;return-1}Hash.prototype.clear=hashClear,Hash.prototype.delete=hashDelete,Hash.prototype.get=hashGet,Hash.prototype.has=hashHas,Hash.prototype.set=hashSet;var arrayProto=Array.prototype,splice=arrayProto.splice;function listCacheDelete(e){var t=this.__data__,r=assocIndexOf(t,e);return!(r<0)&&(r==t.length-1?t.pop():splice.call(t,r,1),--this.size,!0)}function listCacheGet(e){var t=this.__data__,r=assocIndexOf(t,e);return r<0?void 0:t[r][1]}function listCacheHas(e){return assocIndexOf(this.__data__,e)>-1}function listCacheSet(e,t){var r=this.__data__,n=assocIndexOf(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this}function ListCache(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.prototype.clear=listCacheClear,ListCache.prototype.delete=listCacheDelete,ListCache.prototype.get=listCacheGet,ListCache.prototype.has=listCacheHas,ListCache.prototype.set=listCacheSet;var Map$1=getNative(root,"Map");function mapCacheClear(){this.size=0,this.__data__={hash:new Hash,map:new(Map$1||ListCache),string:new Hash}}function isKeyable(e){var t=_typeof(e);return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e}function getMapData(e,t){var r=e.__data__;return isKeyable(t)?r["string"==typeof t?"string":"hash"]:r.map}function mapCacheDelete(e){var t=getMapData(this,e).delete(e);return this.size-=t?1:0,t}function mapCacheGet(e){return getMapData(this,e).get(e)}function mapCacheHas(e){return getMapData(this,e).has(e)}function mapCacheSet(e,t){var r=getMapData(this,e),n=r.size;return r.set(e,t),this.size+=r.size==n?0:1,this}function MapCache(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.prototype.clear=mapCacheClear,MapCache.prototype.delete=mapCacheDelete,MapCache.prototype.get=mapCacheGet,MapCache.prototype.has=mapCacheHas,MapCache.prototype.set=mapCacheSet;var FUNC_ERROR_TEXT="Expected a function";function memoize(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError(FUNC_ERROR_TEXT);var r=function(){var n=arguments,i=t?t.apply(this,n):n[0],a=r.cache;if(a.has(i))return a.get(i);var o=e.apply(this,n);return r.cache=a.set(i,o)||a,o};return r.cache=new(memoize.Cache||MapCache),r}memoize.Cache=MapCache;var MAX_MEMOIZE_SIZE=500;function memoizeCapped(e){var t=memoize(e,function(e){return r.size===MAX_MEMOIZE_SIZE&&r.clear(),e}),r=t.cache;return t}var rePropName=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,reEscapeChar=/\\(\\)?/g,stringToPath=memoizeCapped(function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(rePropName,function(e,r,n,i){t.push(n?i.replace(reEscapeChar,"$1"):r||e)}),t});function arrayMap(e,t){for(var r=-1,n=null==e?0:e.length,i=Array(n);++r<n;)i[r]=t(e[r],r,e);return i}var symbolProto=_Symbol?_Symbol.prototype:void 0,symbolToString=symbolProto?symbolProto.toString:void 0;function baseToString(e){if("string"==typeof e)return e;if(isArray(e))return arrayMap(e,baseToString)+"";if(isSymbol(e))return symbolToString?symbolToString.call(e):"";var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function toString(e){return null==e?"":baseToString(e)}function castPath(e,t){return isArray(e)?e:isKey(e,t)?[e]:stringToPath(toString(e))}function toKey(e){if("string"==typeof e||isSymbol(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function baseGet(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}function get(e,t,r){var n=null==e?void 0:baseGet(e,t);return void 0===n?r:n}var REG_UNIT_NUM_SCIENTIFIC=/^([+-]?[\d.]+(?:e|E)(?:\+|-)?\d+)(.*)$/,REG_UNIT_NUM_NORMAL=/^([+-]?[\d.]+)(.*)$/;function split_unit_num(e){var t,r,n=(e="string"!=typeof e?e.toString():e).match(REG_UNIT_NUM_SCIENTIFIC)||e.match(REG_UNIT_NUM_NORMAL);if(n){r=n[1];var i=n[2];""!==i.trim()&&(t=i)}return{num:r,unit:t}}function find_value(e,t,r){var n,i,a,o;return Array.isArray(e)?e.length>1?null!==(n=null!==(i=get(e[0],t))&&void 0!==i?i:get(e.at(-1),t))&&void 0!==n?n:r:1===e.length&&null!==(a=get(e[0],t))&&void 0!==a?a:r:null!==(o=get(e,t,r))&&void 0!==o?o:r}function parse_mantissa(e,t,r,n){var i=e.split("."),a=i[0],o=1===i.length?"":i[1],s=decimal_round(a,o,t,+r,n);return a=s.int_part,""===(o=s.dec_part)?a:"".concat(a,".").concat(o)}function integer_thousands(e){for(var t=e.length,r="";t>0;)r=e.substring(t-3,t)+(""!==r?",":"")+r,t-=3;return r}function parse_thousands(e){var t=e.split("."),r=t[0];return"-"===r[0]?t[0]="-"+integer_thousands(r.slice(1)):t[0]=integer_thousands(r),t.join(".")}function promise_queue(e){return _promise_queue.apply(this,arguments)}function _promise_queue(){return _promise_queue=_asyncToGenerator(_regenerator().m(function e(t){var r,n,i,a=arguments;return _regenerator().w(function(e){for(;;)switch(e.p=e.n){case 0:r=a.length>1&&void 0!==a[1]?a[1]:5e3,n=0;case 1:if(!(n<t.length)){e.n=7;break}return e.p=2,e.n=3,Promise.race([t[n],new Promise(function(e,t){setTimeout(function(){return t(new Error("promise queue timeout err"))},r)})]);case 3:i=e.v,e.n=5;break;case 4:return e.p=4,e.v,e.a(3,6);case 5:return e.a(2,i);case 6:n++,e.n=1;break;case 7:return e.a(2,Promise.reject("错误的 promise queue 调用"))}},e,null,[[2,4]])})),_promise_queue.apply(this,arguments)}function test_urls(e){return _test_urls.apply(this,arguments)}function _test_urls(){return(_test_urls=_asyncToGenerator(_regenerator().m(function e(t){var r;return _regenerator().w(function(e){for(;;)switch(e.p=e.n){case 0:r=0;case 1:if(!(r<t.length)){e.n=7;break}return e.p=2,e.n=3,fetch(t[r]);case 3:if(!e.v.ok){e.n=4;break}return e.a(2,t[r]);case 4:e.n=6;break;case 5:return e.p=5,e.v,e.a(3,6);case 6:r++,e.n=1;break;case 7:return e.a(2,null)}},e,null,[[2,5]])}))).apply(this,arguments)}function get_real_value(e,t){if(Array.isArray(e)){for(var r,n=0,i=e.length;n<i;n++){var a;if(void 0!==(r=null!==(a=get(e[n],t))&&void 0!==a?a:void 0))break}if(void 0===r)throw new Error("填充变量".concat(t,"失败"));return r}var o;return null!==(o=get(e,t))&&void 0!==o?o:void 0}function is_empty_for_fallback(e,t,r){return r&&"function"==typeof r._empty_check?r._empty_check(e,t):r&&Array.isArray(r._empty_values)?r._empty_values.some(function(t){return!(!Number.isNaN(t)||!Number.isNaN(e))||e===t}):null==e}function get_fallback_value(e,t,r){for(var n=0;n<t.length;n++){var i=t[n].trim(),a=void 0;try{if(Array.isArray(e))for(var o=0;o<e.length;o++){var s=get(e[o],i);if(void 0!==s){a=s;break}}else a=get(e,i)}catch(e){continue}if(!is_empty_for_fallback(a,i,r))return{value:a,path:i}}throw new Error("多路取值失败,所有路径均为空值: ".concat(t.join(" | ")))}function get_next_nonempty_char(e,t,r){var n;for(t++;t<r;){if(n=e[t],!empty_char_set.has(n))return n;t++}}function split_expr_and_fmt(e){for(var t=0,r=0;r<e.length;r++){var n=e[r];if("("===n)t++;else if(")"===n)t--;else if("|"===n&&0===t){if(r+1<e.length&&"|"===e[r+1]){r++;continue}return{expr:e.slice(0,r),fmt:e.slice(r+1).trim()}}}return{expr:e,fmt:""}}function parse_args(e,t){var r="",n={origin_expr:e,origin_fill_data:t,expr:"",fmt_expr:"",options:void 0,fill_data:void 0,_unit:void 0,_fmt:void 0,_empty_values:void 0,_empty_check:void 0,_vol_units:void 0,_vol_step:void 0,_thousands:void 0};if(null!=t&&(n.options=t,Array.isArray(t)?n.fill_data=t:n.fill_data=[t]),n._fmt=find_value(t,"_fmt"),n._unit=find_value(t,"_unit",!1),n._empty_values=find_value(t,"_empty_values"),n._empty_check=find_value(t,"_empty_check"),n._vol_units=find_value(t,"_vol_units"),n._vol_step=find_value(t,"_vol_step"),n._thousands=find_value(t,"_thousands"),"string"==typeof e){if(r=e,""===e.trim()||e.includes("NaN"))throw new Error("非法的表达式:".concat(e))}else{if("number"!=typeof e)throw new Error("错误的第一个参数类型: ".concat(e," 类型为:").concat(_typeof(e)));if(isNaN(e))throw new Error("传入了一个非法数字NaN");r=e.toString()}var i=split_expr_and_fmt(r),a=i.expr,o=i.fmt;return n.expr=a,n.fmt_expr=o,n}function detect_fallback_var$1(e,t){if("("!==e[t])return null;for(var r=0,n=!1,i=[],a="",o=t;o<e.length;){var s=e[o];if("("===s){if(0===r){r++,o++;continue}r++,a+=s}else if(")"===s){if(0===--r)return n?(i.push(a.trim()),{paths:i,end_index:o}):null;a+=s}else"|"===s&&1===r?(n=!0,i.push(a.trim()),a=""):a+=s;o++}return null}function detect_function_call(e,t,r){for(var n=t;n<e.length&&" "===e[n];)n++;return n<e.length&&"("===e[n]}function parse_function_args(e,t){if("("!==e[t])return null;for(var r=1,n=[],i="",a=t+1;a<e.length&&r>0;){var o=e[a];if("("===o)r++,i+=o;else if(")"===o){if(0===--r)return i.trim()&&n.push(i.trim()),{args:n,end_index:a};i+=o}else","===o&&1===r?(n.push(i.trim()),i=""):i+=o;a++}return null}function push_token$3(e,t){if(t.curr_state===state_number||t.curr_state===state_scientific){var r=t.expr.slice(t.prev_index,t.cur_index);if("+"===r||"-"===r)return e.push({type:state_operator,value:r}),t.curr_state=state_initial,void(t.prev_index=t.cur_index);if(t._unit){var n,i=split_unit_num(r),a=i.num,o=i.unit;if(void 0===o)e.push({type:state_number,value:a,real_value:a,has_unit:!1});else t.has_unit=!0,null!==(n=t.unit_str)&&void 0!==n||(t.unit_str=o),e.push({type:state_number,value:a,real_value:a,has_unit:!0,unit:o})}else e.push({type:state_number,value:r,real_value:r,has_unit:!1})}else if(t.curr_state===state_var){t.has_var=!0;var s=t.expr.slice(t.prev_index,t.cur_index);if("true"===s)e.push({type:"boolean",value:!0});else if("false"===s)e.push({type:"boolean",value:!1});else if(detect_function_call(t.expr,t.cur_index)){for(var _=t.cur_index;_<t.expr.length&&" "===t.expr[_];)_++;var u=parse_function_args(t.expr,_);if(u)return e.push({type:state_function,value:s,args:u.args}),t.cur_index=u.end_index+1,t.prev_index=t.cur_index,void(t.curr_state=state_initial)}else{var c=get_real_value(t.fill_data,s);if("function"==typeof c){for(var l=t.cur_index;l<t.expr.length&&" "===t.expr[l];)l++;if(l<t.expr.length&&"("===t.expr[l]){var p=parse_function_args(t.expr,l);if(p)return e.push({type:state_function,value:s,args:p.args,fn:c}),t.cur_index=p.end_index+1,t.prev_index=t.cur_index,void(t.curr_state=state_initial)}}if(t._unit){var d,f=split_unit_num(c),g=f.num,m=f.unit;if(void 0===m)e.push({type:"var",value:s,real_value:g,has_unit:!1});else t.has_unit=!0,null!==(d=t.unit_str)&&void 0!==d||(t.unit_str=m),e.push({type:"var",value:s,real_value:g,has_unit:!0,unit:m})}else e.push({type:"var",value:s,real_value:c,has_unit:!1})}}else e.push({type:t.curr_state,value:t.expr.slice(t.prev_index,t.cur_index)});t.curr_state=state_initial,t.prev_index=t.cur_index}function tokenizer(e,t,r,n){for(var i,a={has_var:!1,has_unit:!1,unit_str:void 0,fill_data:t,cur_index:0,prev_index:0,curr_state:state_initial,expr:e,_unit:r},o=e.length,s=[];a.cur_index<o;)switch(i=e[a.cur_index],a.curr_state){case state_initial:if(number_char_set.has(i))a.curr_state=state_number,a.cur_index++;else if(" "===i)a.cur_index++,a.prev_index=a.cur_index;else if("+-".includes(i)){var _=s.at(-1);0===a.cur_index||"operator"===(null==_?void 0:_.type)||"comparison"===(null==_?void 0:_.type)||"logical"===(null==_?void 0:_.type)||"logical_not"===(null==_?void 0:_.type)||"ternary_question"===(null==_?void 0:_.type)||"ternary_colon"===(null==_?void 0:_.type)||"("===(null==_?void 0:_.value)||"["===(null==_?void 0:_.value)||","===(null==_?void 0:_.value)?(a.curr_state=state_number,a.cur_index++):(a.cur_index++,s.push({type:state_operator,value:e.slice(a.prev_index,a.cur_index)}),a.prev_index=a.cur_index)}else if("*/%".includes(i))a.curr_state=state_operator,a.cur_index++;else if(">"===i)a.cur_index++,a.cur_index<o&&"="===e[a.cur_index]?(a.cur_index++,s.push({type:state_comparison,value:">="})):s.push({type:state_comparison,value:">"}),a.prev_index=a.cur_index;else if("<"===i)a.cur_index++,a.cur_index<o&&"="===e[a.cur_index]?(a.cur_index++,s.push({type:state_comparison,value:"<="})):s.push({type:state_comparison,value:"<"}),a.prev_index=a.cur_index;else if("="===i&&a.cur_index+1<o&&"="===e[a.cur_index+1])a.cur_index+=2,s.push({type:state_comparison,value:"=="}),a.prev_index=a.cur_index;else if("!"===i&&a.cur_index+1<o&&"="===e[a.cur_index+1])a.cur_index+=2,s.push({type:state_comparison,value:"!="}),a.prev_index=a.cur_index;else if("&"===i&&a.cur_index+1<o&&"&"===e[a.cur_index+1])a.cur_index+=2,s.push({type:state_logical,value:"&&"}),a.prev_index=a.cur_index;else if("|"===i&&a.cur_index+1<o&&"|"===e[a.cur_index+1])a.cur_index+=2,s.push({type:state_logical,value:"||"}),a.prev_index=a.cur_index;else if("!"===i)a.cur_index++,s.push({type:state_logical_not,value:"!"}),a.prev_index=a.cur_index;else if("?"===i)a.cur_index++,s.push({type:state_ternary_question,value:"?"}),a.prev_index=a.cur_index;else if(":"===i)a.cur_index++,s.push({type:state_ternary_colon,value:":"}),a.prev_index=a.cur_index;else if("["===i)a.cur_index++,s.push({type:state_range_start,value:"["}),a.prev_index=a.cur_index;else if("]"===i)a.cur_index++,s.push({type:state_range_end,value:"]"}),a.prev_index=a.cur_index;else if(","===i)a.cur_index++,s.push({type:"comma",value:","}),a.prev_index=a.cur_index;else if(var_char_set.has(i))a.curr_state=state_var,a.cur_index++;else if('"'===i||"'"===i){var u=i;a.cur_index++;for(var c="";a.cur_index<o&&e[a.cur_index]!==u;)"\\"===e[a.cur_index]&&a.cur_index+1<o?(a.cur_index++,c+=e[a.cur_index]):c+=e[a.cur_index],a.cur_index++;a.cur_index++,s.push({type:"string",value:c}),a.prev_index=a.cur_index}else if("("===i){var l=detect_fallback_var$1(e,a.cur_index);if(l){a.has_var=!0;var p=get_fallback_value(t,l.paths,n),d=p.value,f=p.path;if(r){var g,m=split_unit_num(d),v=m.num,h=m.unit;if(void 0!==h)a.has_unit=!0,null!==(g=a.unit_str)&&void 0!==g||(a.unit_str=h),s.push({type:state_fallback_var,value:l.paths,real_value:v,matched_path:f,has_unit:!0,unit:h});else s.push({type:state_fallback_var,value:l.paths,real_value:v,matched_path:f,has_unit:!1})}else s.push({type:state_fallback_var,value:l.paths,real_value:d,matched_path:f,has_unit:!1});a.cur_index=l.end_index+1,a.prev_index=a.cur_index}else s.push({type:state_bracket,value:i}),a.curr_state=state_initial,a.cur_index++,a.prev_index=a.cur_index}else")"===i?(s.push({type:state_bracket,value:i}),a.curr_state=state_initial,a.cur_index++,a.prev_index=a.cur_index):(a.cur_index++,a.prev_index=a.cur_index);break;case state_number:if(number_char_set.has(i))a.cur_index++;else if("."===i){if(a.cur_index===a.prev_index||e.slice(a.prev_index,a.cur_index).includes("."))throw new Error("非法的小数部分".concat(e.slice(a.prev_index,a.cur_index)));a.cur_index++}else"e"===i?(a.curr_state=state_scientific,a.cur_index++):r?"*/+-() ".indexOf(i)>-1||">"===i||"<"===i||"="===i||"!"===i||"&"===i||"|"===i||"?"===i||":"===i||"["===i||"]"===i||","===i||"%"===i&&number_char_set.has(e[a.cur_index-1])&&pure_number_var_first_char_set.has(get_next_nonempty_char(e,a.cur_index,o))?push_token$3(s,a):a.cur_index++:push_token$3(s,a);break;case state_operator:var w=e[a.cur_index-1];"*"===i&&"*"===w?(a.cur_index++,s.push({type:state_operator,value:"**"}),a.prev_index=a.cur_index):"/"===i&&"/"===w?(a.cur_index++,s.push({type:state_operator,value:"//"}),a.prev_index=a.cur_index):(s.push({type:state_operator,value:w}),a.prev_index=a.cur_index),a.curr_state=state_initial;break;case state_var:var_members_char_set.has(i)?a.cur_index++:push_token$3(s,a);break;case state_scientific:if(number_char_set.has(i))a.cur_index++;else if("+-".includes(i)){var b=a.prev_index;"+-".includes(e[b])&&(b+=1);var y=e.slice(b,a.cur_index),x=y.at(-1);y.includes(i)||"e"!==x?push_token$3(s,a):a.cur_index++}else r&&-1==="*/+-() ".indexOf(i)&&">"!==i&&"<"!==i&&"="!==i&&"!"!==i&&"&"!==i&&"|"!==i&&"?"!==i&&":"!==i&&"["!==i&&"]"!==i&&","!==i?a.cur_index++:push_token$3(s,a);break;default:throw new Error("字符扫描状态错误")}return a.prev_index<a.cur_index&&push_token$3(s,a),s.has_var=a.has_var,s.has_unit=a.has_unit,s.unit=a.unit_str,s}
3
+ var e,t,r="function"==typeof Symbol?Symbol:{},n=r.iterator||"@@iterator",i=r.toStringTag||"@@toStringTag";function a(r,n,i,a){var _=n&&n.prototype instanceof s?n:s,u=Object.create(_.prototype);return _regeneratorDefine(u,"_invoke",function(r,n,i){var a,s,_,u=0,c=i||[],l=!1,p={p:0,n:0,v:e,a:d,f:d.bind(e,4),d:function(t,r){return a=t,s=0,_=e,p.n=r,o}};function d(r,n){for(s=r,_=n,t=0;!l&&u&&!i&&t<c.length;t++){var i,a=c[t],d=p.p,f=a[2];r>3?(i=f===n)&&(_=a[(s=a[4])?5:(s=3,3)],a[4]=a[5]=e):a[0]<=d&&((i=r<2&&d<a[1])?(s=0,p.v=n,p.n=a[1]):d<f&&(i=r<3||a[0]>n||n>f)&&(a[4]=r,a[5]=n,p.n=f,s=0))}if(i||r>1)return o;throw l=!0,n}return function(i,c,f){if(u>1)throw TypeError("Generator is already running");for(l&&1===c&&d(c,f),s=c,_=f;(t=s<2?e:_)||!l;){a||(s?s<3?(s>1&&(p.n=-1),d(s,_)):p.n=_:p.v=_);try{if(u=2,a){if(s||(i="next"),t=a[i]){if(!(t=t.call(a,_)))throw TypeError("iterator result is not an object");if(!t.done)return t;_=t.value,s<2&&(s=0)}else 1===s&&(t=a.return)&&t.call(a),s<2&&(_=TypeError("The iterator does not provide a '"+i+"' method"),s=1);a=e}else if((t=(l=p.n<0)?_:r.call(n,p))!==o)break}catch(t){a=e,s=1,_=t}finally{u=1}}return{value:t,done:l}}}(r,i,a),!0),u}var o={};function s(){}function _(){}function u(){}t=Object.getPrototypeOf;var c=[][n]?t(t([][n]())):(_regeneratorDefine(t={},n,function(){return this}),t),l=u.prototype=s.prototype=Object.create(c);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,u):(e.__proto__=u,_regeneratorDefine(e,i,"GeneratorFunction")),e.prototype=Object.create(l),e}return _.prototype=u,_regeneratorDefine(l,"constructor",u),_regeneratorDefine(u,"constructor",_),_.displayName="GeneratorFunction",_regeneratorDefine(u,i,"GeneratorFunction"),_regeneratorDefine(l),_regeneratorDefine(l,i,"Generator"),_regeneratorDefine(l,n,function(){return this}),_regeneratorDefine(l,"toString",function(){return"[object Generator]"}),(_regenerator=function(){return{w:a,m:p}})()}function _regeneratorDefine(e,t,r,n){var i=Object.defineProperty;try{i({},"",{})}catch(e){i=0}_regeneratorDefine=function(e,t,r,n){function a(t,r){_regeneratorDefine(e,t,function(e){return this._invoke(t,r,e)})}t?i?i(e,t,{value:r,enumerable:!n,configurable:!n,writable:!n}):e[t]=r:(a("next",0),a("throw",1),a("return",2))},_regeneratorDefine(e,t,r,n)}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 _toPrimitive(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);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:t+""}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 _unsupportedIterableToArray(e,t){if(e){if("string"==typeof e)return _arrayLikeToArray(e,t);var r={}.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}}var version="3.0.0-beta.20250123.6";function decimal_round(e,t,r,n,i){var a=e.startsWith("-"),o=a?e.slice(1):e,s=o,_=t,u=t.length;function c(){s=(+s+1).toString()}var l={"~-":function(){var e="<"===r?n-1:n;_=t.slice(0,e)},"~+":function(){var e="<"===r?n-1:n;if(!(u<=e||0===u)){var i=t.slice(0,e);0===+t.slice(e,u)?_=i:(i=(+"9".concat(i)+1).toString().slice(1)).length>e?(_=i.slice(1,i.length),c()):_=i}},"~5":function(){if(0!==u){var e="<"===r?n-1:n;_=t.slice(0,e);var i=+t[e];Number.isNaN(i)||i>=5&&(_=(+"9".concat(_)+1).toString().slice(1)).length>e&&(_=_.slice(1,_.length),c())}},"~6":function(){if(0!==u){var e,i="<"===r?n-1:n,a=+t[i],s=t.slice(+i+1,t.length);s=""===s?0:parseInt(s),e=0===i?+o[o.length-1]:+t[i-1],_=t.slice(0,i),(a>=6||5===a&&s>0||5===a&&e%2!=0)&&(_=(+"9".concat(_)+1).toString().slice(1)).length>i&&(_=_.slice(1,_.length),c())}}};return"<="===r?u<=n?_=t.replace(/0*$/,""):(l[i]&&l[i](),_=_.replace(/0+$/,"")):"<"===r?u<n?_=t.replace(/0*$/,""):(l[i]&&l[i](),_=_.replace(/0+$/,"")):"="===r?u<n?_=t+"0".repeat(n-u):u>n&&l[i]&&l[i]():">="===r?u<n&&(_=t+"0".repeat(n-u)):">"===r&&u<=n&&(_=t+"0".repeat(n-u+1)),{int_part:a?"-".concat(s):s,dec_part:_}}var number_char="0123456789",var_char="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_$",number_first_char="0123456789-+",var_members_char="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_$[].'\"",var_first_char="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_$",pure_number_var_first_char="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_$",empty_char=" \n\r\t",number_char_set=new Set(number_char),var_char_set=new Set(var_char),var_members_char_set=new Set(var_members_char),var_first_char_set=new Set(var_first_char);new Set(number_first_char);var pure_number_var_first_char_set=new Set(pure_number_var_first_char),empty_char_set=new Set(empty_char),state_initial="initial",state_number="number",state_scientific="scientific",state_operator="operator",state_bracket="bracket",state_var="var",state_symbol="symbol",state_percent="percent",state_round="round",state_plus="plus",state_comma="comma",state_fraction="fraction",state_to_number="to-number",state_to_number_string="to-number-string",state_fallback_var="fallback_var",state_integer_padding="integer_padding",state_volume="volume",state_unit_after="unit_after",state_unit_before="unit_before",state_unit_middle="unit_middle",state_unit_hide="unit_hide",state_unit_default="unit_default",state_thousands="thousands",state_fmt_group="fmt_group",state_comparison="comparison",state_logical="logical",state_logical_not="logical_not",state_ternary_question="ternary_question",state_ternary_colon="ternary_colon",state_function="function",state_range_start="range_start",state_range_end="range_end",state_range_clamp="range_clamp",comparison_operators=new Set([">","<",">=","<=","==","!="]),logical_operators=new Set(["&&","||"]),operator_precedence={"|":0,"?":1,":":1,"||":2,"&&":3,"==":4,"!=":4,">":5,"<":5,">=":5,"<=":5,"+":6,"-":6,"*":7,"/":7,"%":7,"//":7,"**":8,"!":9,"unary-":9,"unary+":9},isArray=Array.isArray,freeGlobal="object"==("undefined"==typeof global?"undefined":_typeof(global))&&global&&global.Object===Object&&global,freeSelf="object"==("undefined"==typeof self?"undefined":_typeof(self))&&self&&self.Object===Object&&self,root=freeGlobal||freeSelf||Function("return this")(),_Symbol=root.Symbol,objectProto$4=Object.prototype,hasOwnProperty$3=objectProto$4.hasOwnProperty,nativeObjectToString$1=objectProto$4.toString,symToStringTag$1=_Symbol?_Symbol.toStringTag:void 0;function getRawTag(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 i=nativeObjectToString$1.call(e);return n&&(t?e[symToStringTag$1]=r:delete e[symToStringTag$1]),i}var objectProto$3=Object.prototype,nativeObjectToString=objectProto$3.toString;function objectToString(e){return nativeObjectToString.call(e)}var nullTag="[object Null]",undefinedTag="[object Undefined]",symToStringTag=_Symbol?_Symbol.toStringTag:void 0;function baseGetTag(e){return null==e?void 0===e?undefinedTag:nullTag:symToStringTag&&symToStringTag in Object(e)?getRawTag(e):objectToString(e)}function isObjectLike(e){return null!=e&&"object"==_typeof(e)}var symbolTag="[object Symbol]";function isSymbol(e){return"symbol"==_typeof(e)||isObjectLike(e)&&baseGetTag(e)==symbolTag}var reIsDeepProp=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,reIsPlainProp=/^\w*$/;function isKey(e,t){if(isArray(e))return!1;var r=_typeof(e);return!("number"!=r&&"symbol"!=r&&"boolean"!=r&&null!=e&&!isSymbol(e))||(reIsPlainProp.test(e)||!reIsDeepProp.test(e)||null!=t&&e in Object(t))}function isObject(e){var t=_typeof(e);return null!=e&&("object"==t||"function"==t)}var asyncTag="[object AsyncFunction]",funcTag="[object Function]",genTag="[object GeneratorFunction]",proxyTag="[object Proxy]";function isFunction(e){if(!isObject(e))return!1;var t=baseGetTag(e);return t==funcTag||t==genTag||t==asyncTag||t==proxyTag}var coreJsData=root["__core-js_shared__"],maskSrcKey=(uid=/[^.]+$/.exec(coreJsData&&coreJsData.keys&&coreJsData.keys.IE_PROTO||""),uid?"Symbol(src)_1."+uid:""),uid;function isMasked(e){return!!maskSrcKey&&maskSrcKey in e}var funcProto$1=Function.prototype,funcToString$1=funcProto$1.toString;function toSource(e){if(null!=e){try{return funcToString$1.call(e)}catch(e){}try{return e+""}catch(e){}}return""}var 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(e){return!(!isObject(e)||isMasked(e))&&(isFunction(e)?reIsNative:reIsHostCtor).test(toSource(e))}function getValue(e,t){return null==e?void 0:e[t]}function getNative(e,t){var r=getValue(e,t);return baseIsNative(r)?r:void 0}var nativeCreate=getNative(Object,"create");function hashClear(){this.__data__=nativeCreate?nativeCreate(null):{},this.size=0}function hashDelete(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var HASH_UNDEFINED$1="__lodash_hash_undefined__",objectProto$1=Object.prototype,hasOwnProperty$1=objectProto$1.hasOwnProperty;function hashGet(e){var t=this.__data__;if(nativeCreate){var r=t[e];return r===HASH_UNDEFINED$1?void 0:r}return hasOwnProperty$1.call(t,e)?t[e]:void 0}var objectProto=Object.prototype,hasOwnProperty=objectProto.hasOwnProperty;function hashHas(e){var t=this.__data__;return nativeCreate?void 0!==t[e]:hasOwnProperty.call(t,e)}var HASH_UNDEFINED="__lodash_hash_undefined__";function hashSet(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=nativeCreate&&void 0===t?HASH_UNDEFINED:t,this}function Hash(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])}}function listCacheClear(){this.__data__=[],this.size=0}function eq(e,t){return e===t||e!=e&&t!=t}function assocIndexOf(e,t){for(var r=e.length;r--;)if(eq(e[r][0],t))return r;return-1}Hash.prototype.clear=hashClear,Hash.prototype.delete=hashDelete,Hash.prototype.get=hashGet,Hash.prototype.has=hashHas,Hash.prototype.set=hashSet;var arrayProto=Array.prototype,splice=arrayProto.splice;function listCacheDelete(e){var t=this.__data__,r=assocIndexOf(t,e);return!(r<0)&&(r==t.length-1?t.pop():splice.call(t,r,1),--this.size,!0)}function listCacheGet(e){var t=this.__data__,r=assocIndexOf(t,e);return r<0?void 0:t[r][1]}function listCacheHas(e){return assocIndexOf(this.__data__,e)>-1}function listCacheSet(e,t){var r=this.__data__,n=assocIndexOf(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this}function ListCache(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.prototype.clear=listCacheClear,ListCache.prototype.delete=listCacheDelete,ListCache.prototype.get=listCacheGet,ListCache.prototype.has=listCacheHas,ListCache.prototype.set=listCacheSet;var Map$1=getNative(root,"Map");function mapCacheClear(){this.size=0,this.__data__={hash:new Hash,map:new(Map$1||ListCache),string:new Hash}}function isKeyable(e){var t=_typeof(e);return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e}function getMapData(e,t){var r=e.__data__;return isKeyable(t)?r["string"==typeof t?"string":"hash"]:r.map}function mapCacheDelete(e){var t=getMapData(this,e).delete(e);return this.size-=t?1:0,t}function mapCacheGet(e){return getMapData(this,e).get(e)}function mapCacheHas(e){return getMapData(this,e).has(e)}function mapCacheSet(e,t){var r=getMapData(this,e),n=r.size;return r.set(e,t),this.size+=r.size==n?0:1,this}function MapCache(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.prototype.clear=mapCacheClear,MapCache.prototype.delete=mapCacheDelete,MapCache.prototype.get=mapCacheGet,MapCache.prototype.has=mapCacheHas,MapCache.prototype.set=mapCacheSet;var FUNC_ERROR_TEXT="Expected a function";function memoize(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError(FUNC_ERROR_TEXT);var r=function(){var n=arguments,i=t?t.apply(this,n):n[0],a=r.cache;if(a.has(i))return a.get(i);var o=e.apply(this,n);return r.cache=a.set(i,o)||a,o};return r.cache=new(memoize.Cache||MapCache),r}memoize.Cache=MapCache;var MAX_MEMOIZE_SIZE=500;function memoizeCapped(e){var t=memoize(e,function(e){return r.size===MAX_MEMOIZE_SIZE&&r.clear(),e}),r=t.cache;return t}var rePropName=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,reEscapeChar=/\\(\\)?/g,stringToPath=memoizeCapped(function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(rePropName,function(e,r,n,i){t.push(n?i.replace(reEscapeChar,"$1"):r||e)}),t});function arrayMap(e,t){for(var r=-1,n=null==e?0:e.length,i=Array(n);++r<n;)i[r]=t(e[r],r,e);return i}var symbolProto=_Symbol?_Symbol.prototype:void 0,symbolToString=symbolProto?symbolProto.toString:void 0;function baseToString(e){if("string"==typeof e)return e;if(isArray(e))return arrayMap(e,baseToString)+"";if(isSymbol(e))return symbolToString?symbolToString.call(e):"";var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function toString(e){return null==e?"":baseToString(e)}function castPath(e,t){return isArray(e)?e:isKey(e,t)?[e]:stringToPath(toString(e))}function toKey(e){if("string"==typeof e||isSymbol(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function baseGet(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}function get(e,t,r){var n=null==e?void 0:baseGet(e,t);return void 0===n?r:n}var REG_UNIT_NUM_SCIENTIFIC=/^([+-]?[\d.]+(?:e|E)(?:\+|-)?\d+)(.*)$/,REG_UNIT_NUM_NORMAL=/^([+-]?[\d.]+)(.*)$/;function split_unit_num(e){var t,r,n=(e="string"!=typeof e?e.toString():e).match(REG_UNIT_NUM_SCIENTIFIC)||e.match(REG_UNIT_NUM_NORMAL);if(n){r=n[1];var i=n[2];""!==i.trim()&&(t=i)}return{num:r,unit:t}}function find_value(e,t,r){var n,i,a,o;return Array.isArray(e)?e.length>1?null!==(n=null!==(i=get(e[0],t))&&void 0!==i?i:get(e.at(-1),t))&&void 0!==n?n:r:1===e.length&&null!==(a=get(e[0],t))&&void 0!==a?a:r:null!==(o=get(e,t,r))&&void 0!==o?o:r}function parse_mantissa(e,t,r,n){var i=e.split("."),a=i[0],o=1===i.length?"":i[1],s=decimal_round(a,o,t,+r,n);return a=s.int_part,""===(o=s.dec_part)?a:"".concat(a,".").concat(o)}function integer_thousands(e){for(var t=e.length,r="";t>0;)r=e.substring(t-3,t)+(""!==r?",":"")+r,t-=3;return r}function parse_thousands(e){var t=e.split("."),r=t[0];return"-"===r[0]?t[0]="-"+integer_thousands(r.slice(1)):t[0]=integer_thousands(r),t.join(".")}function promise_queue(e){return _promise_queue.apply(this,arguments)}function _promise_queue(){return _promise_queue=_asyncToGenerator(_regenerator().m(function e(t){var r,n,i,a=arguments;return _regenerator().w(function(e){for(;;)switch(e.p=e.n){case 0:r=a.length>1&&void 0!==a[1]?a[1]:5e3,n=0;case 1:if(!(n<t.length)){e.n=7;break}return e.p=2,e.n=3,Promise.race([t[n],new Promise(function(e,t){setTimeout(function(){return t(new Error("promise queue timeout err"))},r)})]);case 3:i=e.v,e.n=5;break;case 4:return e.p=4,e.v,e.a(3,6);case 5:return e.a(2,i);case 6:n++,e.n=1;break;case 7:return e.a(2,Promise.reject("错误的 promise queue 调用"))}},e,null,[[2,4]])})),_promise_queue.apply(this,arguments)}function test_urls(e){return _test_urls.apply(this,arguments)}function _test_urls(){return(_test_urls=_asyncToGenerator(_regenerator().m(function e(t){var r;return _regenerator().w(function(e){for(;;)switch(e.p=e.n){case 0:r=0;case 1:if(!(r<t.length)){e.n=7;break}return e.p=2,e.n=3,fetch(t[r]);case 3:if(!e.v.ok){e.n=4;break}return e.a(2,t[r]);case 4:e.n=6;break;case 5:return e.p=5,e.v,e.a(3,6);case 6:r++,e.n=1;break;case 7:return e.a(2,null)}},e,null,[[2,5]])}))).apply(this,arguments)}function get_real_value(e,t){if(Array.isArray(e)){for(var r,n=0,i=e.length;n<i;n++){var a;if(void 0!==(r=null!==(a=get(e[n],t))&&void 0!==a?a:void 0))break}if(void 0===r)throw new Error("填充变量".concat(t,"失败"));return r}var o;return null!==(o=get(e,t))&&void 0!==o?o:void 0}function is_empty_for_fallback(e,t,r){return r&&"function"==typeof r._empty_check?r._empty_check(e,t):r&&Array.isArray(r._empty_values)?r._empty_values.some(function(t){return!(!Number.isNaN(t)||!Number.isNaN(e))||e===t}):null==e}function get_fallback_value(e,t,r){for(var n=0;n<t.length;n++){var i=t[n].trim(),a=void 0;try{if(Array.isArray(e))for(var o=0;o<e.length;o++){var s=get(e[o],i);if(void 0!==s){a=s;break}}else a=get(e,i)}catch(e){continue}if(!is_empty_for_fallback(a,i,r))return{value:a,path:i}}throw new Error("多路取值失败,所有路径均为空值: ".concat(t.join(" | ")))}function get_next_nonempty_char(e,t,r){var n;for(t++;t<r;){if(n=e[t],!empty_char_set.has(n))return n;t++}}function split_expr_and_fmt(e){for(var t=0,r=0;r<e.length;r++){var n=e[r];if("("===n)t++;else if(")"===n)t--;else if("|"===n&&0===t){if(r+1<e.length&&"|"===e[r+1]){r++;continue}return{expr:e.slice(0,r),fmt:e.slice(r+1).trim()}}}return{expr:e,fmt:""}}function parse_args(e,t){var r="",n={origin_expr:e,origin_fill_data:t,expr:"",fmt_expr:"",options:void 0,fill_data:void 0,_unit:void 0,_fmt:void 0,_empty_values:void 0,_empty_check:void 0,_vol_units:void 0,_vol_step:void 0,_thousands:void 0};if(null!=t&&(n.options=t,Array.isArray(t)?n.fill_data=t:n.fill_data=[t]),n._fmt=find_value(t,"_fmt"),n._unit=find_value(t,"_unit",!1),n._empty_values=find_value(t,"_empty_values"),n._empty_check=find_value(t,"_empty_check"),n._vol_units=find_value(t,"_vol_units"),n._vol_step=find_value(t,"_vol_step"),n._thousands=find_value(t,"_thousands"),"string"==typeof e){if(r=e,""===e.trim()||e.includes("NaN"))throw new Error("非法的表达式:".concat(e))}else{if("number"!=typeof e)throw new Error("错误的第一个参数类型: ".concat(e," 类型为:").concat(_typeof(e)));if(isNaN(e))throw new Error("传入了一个非法数字NaN");r=e.toString()}var i=split_expr_and_fmt(r),a=i.expr,o=i.fmt;return n.expr=a,n.fmt_expr=o,n}function detect_fallback_var$1(e,t){if("("!==e[t])return null;for(var r=0,n=!1,i=[],a="",o=t;o<e.length;){var s=e[o];if("("===s){if(0===r){r++,o++;continue}r++,a+=s}else if(")"===s){if(0===--r)return n?(i.push(a.trim()),{paths:i,end_index:o}):null;a+=s}else"|"===s&&1===r?(n=!0,i.push(a.trim()),a=""):a+=s;o++}return null}function detect_function_call(e,t,r){for(var n=t;n<e.length&&" "===e[n];)n++;return n<e.length&&"("===e[n]}function parse_function_args(e,t){if("("!==e[t])return null;for(var r=1,n=[],i="",a=t+1;a<e.length&&r>0;){var o=e[a];if("("===o)r++,i+=o;else if(")"===o){if(0===--r)return i.trim()&&n.push(i.trim()),{args:n,end_index:a};i+=o}else","===o&&1===r?(n.push(i.trim()),i=""):i+=o;a++}return null}function push_token$3(e,t){if(t.curr_state===state_number||t.curr_state===state_scientific){var r=t.expr.slice(t.prev_index,t.cur_index);if("+"===r||"-"===r)return e.push({type:state_operator,value:r}),t.curr_state=state_initial,void(t.prev_index=t.cur_index);if(t._unit){var n,i=split_unit_num(r),a=i.num,o=i.unit;if(void 0===o)e.push({type:state_number,value:a,real_value:a,has_unit:!1});else t.has_unit=!0,null!==(n=t.unit_str)&&void 0!==n||(t.unit_str=o),e.push({type:state_number,value:a,real_value:a,has_unit:!0,unit:o})}else e.push({type:state_number,value:r,real_value:r,has_unit:!1})}else if(t.curr_state===state_var){t.has_var=!0;var s=t.expr.slice(t.prev_index,t.cur_index);if("true"===s)e.push({type:"boolean",value:!0});else if("false"===s)e.push({type:"boolean",value:!1});else if(detect_function_call(t.expr,t.cur_index)){for(var _=t.cur_index;_<t.expr.length&&" "===t.expr[_];)_++;var u=parse_function_args(t.expr,_);if(u)return e.push({type:state_function,value:s,args:u.args}),t.cur_index=u.end_index+1,t.prev_index=t.cur_index,void(t.curr_state=state_initial)}else{var c=get_real_value(t.fill_data,s);if("function"==typeof c){for(var l=t.cur_index;l<t.expr.length&&" "===t.expr[l];)l++;if(l<t.expr.length&&"("===t.expr[l]){var p=parse_function_args(t.expr,l);if(p)return e.push({type:state_function,value:s,args:p.args,fn:c}),t.cur_index=p.end_index+1,t.prev_index=t.cur_index,void(t.curr_state=state_initial)}}if(t._unit){var d,f=split_unit_num(c),g=f.num,m=f.unit;if(void 0===m)e.push({type:"var",value:s,real_value:g,has_unit:!1});else t.has_unit=!0,null!==(d=t.unit_str)&&void 0!==d||(t.unit_str=m),e.push({type:"var",value:s,real_value:g,has_unit:!0,unit:m})}else e.push({type:"var",value:s,real_value:c,has_unit:!1})}}else e.push({type:t.curr_state,value:t.expr.slice(t.prev_index,t.cur_index)});t.curr_state=state_initial,t.prev_index=t.cur_index}function tokenizer(e,t,r,n){for(var i,a={has_var:!1,has_unit:!1,unit_str:void 0,fill_data:t,cur_index:0,prev_index:0,curr_state:state_initial,expr:e,_unit:r},o=e.length,s=[];a.cur_index<o;)switch(i=e[a.cur_index],a.curr_state){case state_initial:if(number_char_set.has(i))a.curr_state=state_number,a.cur_index++;else if(" "===i)a.cur_index++,a.prev_index=a.cur_index;else if("+-".includes(i)){var _=s.at(-1);0===a.cur_index||"operator"===(null==_?void 0:_.type)||"comparison"===(null==_?void 0:_.type)||"logical"===(null==_?void 0:_.type)||"logical_not"===(null==_?void 0:_.type)||"ternary_question"===(null==_?void 0:_.type)||"ternary_colon"===(null==_?void 0:_.type)||"("===(null==_?void 0:_.value)||"["===(null==_?void 0:_.value)||","===(null==_?void 0:_.value)?(a.curr_state=state_number,a.cur_index++):(a.cur_index++,s.push({type:state_operator,value:e.slice(a.prev_index,a.cur_index)}),a.prev_index=a.cur_index)}else if("*/%".includes(i))a.curr_state=state_operator,a.cur_index++;else if(">"===i)a.cur_index++,a.cur_index<o&&"="===e[a.cur_index]?(a.cur_index++,s.push({type:state_comparison,value:">="})):s.push({type:state_comparison,value:">"}),a.prev_index=a.cur_index;else if("<"===i)a.cur_index++,a.cur_index<o&&"="===e[a.cur_index]?(a.cur_index++,s.push({type:state_comparison,value:"<="})):s.push({type:state_comparison,value:"<"}),a.prev_index=a.cur_index;else if("="===i&&a.cur_index+1<o&&"="===e[a.cur_index+1])a.cur_index+=2,s.push({type:state_comparison,value:"=="}),a.prev_index=a.cur_index;else if("!"===i&&a.cur_index+1<o&&"="===e[a.cur_index+1])a.cur_index+=2,s.push({type:state_comparison,value:"!="}),a.prev_index=a.cur_index;else if("&"===i&&a.cur_index+1<o&&"&"===e[a.cur_index+1])a.cur_index+=2,s.push({type:state_logical,value:"&&"}),a.prev_index=a.cur_index;else if("|"===i&&a.cur_index+1<o&&"|"===e[a.cur_index+1])a.cur_index+=2,s.push({type:state_logical,value:"||"}),a.prev_index=a.cur_index;else if("!"===i)a.cur_index++,s.push({type:state_logical_not,value:"!"}),a.prev_index=a.cur_index;else if("?"===i)a.cur_index++,s.push({type:state_ternary_question,value:"?"}),a.prev_index=a.cur_index;else if(":"===i)a.cur_index++,s.push({type:state_ternary_colon,value:":"}),a.prev_index=a.cur_index;else if("["===i)a.cur_index++,s.push({type:state_range_start,value:"["}),a.prev_index=a.cur_index;else if("]"===i)a.cur_index++,s.push({type:state_range_end,value:"]"}),a.prev_index=a.cur_index;else if(","===i)a.cur_index++,s.push({type:"comma",value:","}),a.prev_index=a.cur_index;else if(var_char_set.has(i))a.curr_state=state_var,a.cur_index++;else if('"'===i||"'"===i){var u=i;a.cur_index++;for(var c="";a.cur_index<o&&e[a.cur_index]!==u;)"\\"===e[a.cur_index]&&a.cur_index+1<o?(a.cur_index++,c+=e[a.cur_index]):c+=e[a.cur_index],a.cur_index++;a.cur_index++,s.push({type:"string",value:c}),a.prev_index=a.cur_index}else if("("===i){var l=detect_fallback_var$1(e,a.cur_index);if(l){a.has_var=!0;var p=get_fallback_value(t,l.paths,n),d=p.value,f=p.path;if(r){var g,m=split_unit_num(d),v=m.num,h=m.unit;if(void 0!==h)a.has_unit=!0,null!==(g=a.unit_str)&&void 0!==g||(a.unit_str=h),s.push({type:state_fallback_var,value:l.paths,real_value:v,matched_path:f,has_unit:!0,unit:h});else s.push({type:state_fallback_var,value:l.paths,real_value:v,matched_path:f,has_unit:!1})}else s.push({type:state_fallback_var,value:l.paths,real_value:d,matched_path:f,has_unit:!1});a.cur_index=l.end_index+1,a.prev_index=a.cur_index}else s.push({type:state_bracket,value:i}),a.curr_state=state_initial,a.cur_index++,a.prev_index=a.cur_index}else")"===i?(s.push({type:state_bracket,value:i}),a.curr_state=state_initial,a.cur_index++,a.prev_index=a.cur_index):(a.cur_index++,a.prev_index=a.cur_index);break;case state_number:if(number_char_set.has(i))a.cur_index++;else if("."===i){if(a.cur_index===a.prev_index||e.slice(a.prev_index,a.cur_index).includes("."))throw new Error("非法的小数部分".concat(e.slice(a.prev_index,a.cur_index)));a.cur_index++}else"e"===i?(a.curr_state=state_scientific,a.cur_index++):r?"*/+-() ".indexOf(i)>-1||">"===i||"<"===i||"="===i||"!"===i||"&"===i||"|"===i||"?"===i||":"===i||"["===i||"]"===i||","===i||"%"===i&&number_char_set.has(e[a.cur_index-1])&&pure_number_var_first_char_set.has(get_next_nonempty_char(e,a.cur_index,o))?push_token$3(s,a):a.cur_index++:push_token$3(s,a);break;case state_operator:var w=e[a.cur_index-1];"*"===i&&"*"===w?(a.cur_index++,s.push({type:state_operator,value:"**"}),a.prev_index=a.cur_index):"/"===i&&"/"===w?(a.cur_index++,s.push({type:state_operator,value:"//"}),a.prev_index=a.cur_index):(s.push({type:state_operator,value:w}),a.prev_index=a.cur_index),a.curr_state=state_initial;break;case state_var:var_members_char_set.has(i)?a.cur_index++:push_token$3(s,a);break;case state_scientific:if(number_char_set.has(i))a.cur_index++;else if("+-".includes(i)){var b=a.prev_index;"+-".includes(e[b])&&(b+=1);var y=e.slice(b,a.cur_index),x=y.at(-1);y.includes(i)||"e"!==x?push_token$3(s,a):a.cur_index++}else r&&-1==="*/+-() ".indexOf(i)&&">"!==i&&"<"!==i&&"="!==i&&"!"!==i&&"&"!==i&&"|"!==i&&"?"!==i&&":"!==i&&"["!==i&&"]"!==i&&","!==i?a.cur_index++:push_token$3(s,a);break;default:throw new Error("字符扫描状态错误")}return a.prev_index<a.cur_index&&push_token$3(s,a),s.has_var=a.has_var,s.has_unit=a.has_unit,s.unit=a.unit_str,s}
4
4
  /*!
5
5
  * decimal.js v10.6.0
6
6
  * An arbitrary-precision Decimal type for JavaScript.
package/cjs/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  "use strict";var _documentCurrentScript="undefined"!=typeof document?document.currentScript:null;function _arrayLikeToArray(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function _arrayWithHoles(e){if(Array.isArray(e))return e}function _arrayWithoutHoles(e){if(Array.isArray(e))return _arrayLikeToArray(e)}function asyncGeneratorStep(e,t,r,n,i,a,o){try{var s=e[a](o),_=s.value}catch(e){return void r(e)}s.done?t(_):Promise.resolve(_).then(n,i)}function _asyncToGenerator(e){return function(){var t=this,r=arguments;return new Promise(function(n,i){var a=e.apply(t,r);function o(e){asyncGeneratorStep(a,n,i,o,s,"next",e)}function s(e){asyncGeneratorStep(a,n,i,o,s,"throw",e)}o(void 0)})}}function _createForOfIteratorHelper(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=_unsupportedIterableToArray(e))||t){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==r.return||r.return()}finally{if(s)throw a}}}}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 _iterableToArray(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function _iterableToArrayLimit(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,i,a,o,s=[],_=!0,u=!1;try{if(a=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;_=!1}else for(;!(_=(n=a.call(r)).done)&&(s.push(n.value),s.length!==t);_=!0);}catch(e){u=!0,i=e}finally{try{if(!_&&null!=r.return&&(o=r.return(),Object(o)!==o))return}finally{if(u)throw i}}return s}}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 _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 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 _regenerator(){
2
2
  /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */
3
- var e,t,r="function"==typeof Symbol?Symbol:{},n=r.iterator||"@@iterator",i=r.toStringTag||"@@toStringTag";function a(r,n,i,a){var _=n&&n.prototype instanceof s?n:s,u=Object.create(_.prototype);return _regeneratorDefine(u,"_invoke",function(r,n,i){var a,s,_,u=0,c=i||[],l=!1,p={p:0,n:0,v:e,a:d,f:d.bind(e,4),d:function(t,r){return a=t,s=0,_=e,p.n=r,o}};function d(r,n){for(s=r,_=n,t=0;!l&&u&&!i&&t<c.length;t++){var i,a=c[t],d=p.p,f=a[2];r>3?(i=f===n)&&(_=a[(s=a[4])?5:(s=3,3)],a[4]=a[5]=e):a[0]<=d&&((i=r<2&&d<a[1])?(s=0,p.v=n,p.n=a[1]):d<f&&(i=r<3||a[0]>n||n>f)&&(a[4]=r,a[5]=n,p.n=f,s=0))}if(i||r>1)return o;throw l=!0,n}return function(i,c,f){if(u>1)throw TypeError("Generator is already running");for(l&&1===c&&d(c,f),s=c,_=f;(t=s<2?e:_)||!l;){a||(s?s<3?(s>1&&(p.n=-1),d(s,_)):p.n=_:p.v=_);try{if(u=2,a){if(s||(i="next"),t=a[i]){if(!(t=t.call(a,_)))throw TypeError("iterator result is not an object");if(!t.done)return t;_=t.value,s<2&&(s=0)}else 1===s&&(t=a.return)&&t.call(a),s<2&&(_=TypeError("The iterator does not provide a '"+i+"' method"),s=1);a=e}else if((t=(l=p.n<0)?_:r.call(n,p))!==o)break}catch(t){a=e,s=1,_=t}finally{u=1}}return{value:t,done:l}}}(r,i,a),!0),u}var o={};function s(){}function _(){}function u(){}t=Object.getPrototypeOf;var c=[][n]?t(t([][n]())):(_regeneratorDefine(t={},n,function(){return this}),t),l=u.prototype=s.prototype=Object.create(c);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,u):(e.__proto__=u,_regeneratorDefine(e,i,"GeneratorFunction")),e.prototype=Object.create(l),e}return _.prototype=u,_regeneratorDefine(l,"constructor",u),_regeneratorDefine(u,"constructor",_),_.displayName="GeneratorFunction",_regeneratorDefine(u,i,"GeneratorFunction"),_regeneratorDefine(l),_regeneratorDefine(l,i,"Generator"),_regeneratorDefine(l,n,function(){return this}),_regeneratorDefine(l,"toString",function(){return"[object Generator]"}),(_regenerator=function(){return{w:a,m:p}})()}function _regeneratorDefine(e,t,r,n){var i=Object.defineProperty;try{i({},"",{})}catch(e){i=0}_regeneratorDefine=function(e,t,r,n){function a(t,r){_regeneratorDefine(e,t,function(e){return this._invoke(t,r,e)})}t?i?i(e,t,{value:r,enumerable:!n,configurable:!n,writable:!n}):e[t]=r:(a("next",0),a("throw",1),a("return",2))},_regeneratorDefine(e,t,r,n)}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 _toPrimitive(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);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:t+""}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 _unsupportedIterableToArray(e,t){if(e){if("string"==typeof e)return _arrayLikeToArray(e,t);var r={}.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}}var version="3.0.0-beta.20250123.5";function decimal_round(e,t,r,n,i){var a=e.startsWith("-"),o=a?e.slice(1):e,s=o,_=t,u=t.length;function c(){s=(+s+1).toString()}var l={"~-":function(){var e="<"===r?n-1:n;_=t.slice(0,e)},"~+":function(){var e="<"===r?n-1:n;if(!(u<=e||0===u)){var i=t.slice(0,e);0===+t.slice(e,u)?_=i:(i=(+"9".concat(i)+1).toString().slice(1)).length>e?(_=i.slice(1,i.length),c()):_=i}},"~5":function(){if(0!==u){var e="<"===r?n-1:n;_=t.slice(0,e);var i=+t[e];Number.isNaN(i)||i>=5&&(_=(+"9".concat(_)+1).toString().slice(1)).length>e&&(_=_.slice(1,_.length),c())}},"~6":function(){if(0!==u){var e,i="<"===r?n-1:n,a=+t[i],s=t.slice(+i+1,t.length);s=""===s?0:parseInt(s),e=0===i?+o[o.length-1]:+t[i-1],_=t.slice(0,i),(a>=6||5===a&&s>0||5===a&&e%2!=0)&&(_=(+"9".concat(_)+1).toString().slice(1)).length>i&&(_=_.slice(1,_.length),c())}}};return"<="===r?u<=n?_=t.replace(/0*$/,""):(l[i]&&l[i](),_=_.replace(/0+$/,"")):"<"===r?u<n?_=t.replace(/0*$/,""):(l[i]&&l[i](),_=_.replace(/0+$/,"")):"="===r?u<n?_=t+"0".repeat(n-u):u>n&&l[i]&&l[i]():">="===r?u<n&&(_=t+"0".repeat(n-u)):">"===r&&u<=n&&(_=t+"0".repeat(n-u+1)),{int_part:a?"-".concat(s):s,dec_part:_}}var number_char="0123456789",var_char="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_$",number_first_char="0123456789-+",var_members_char="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_$[].'\"",var_first_char="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_$",pure_number_var_first_char="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_$",empty_char=" \n\r\t",number_char_set=new Set(number_char),var_char_set=new Set(var_char),var_members_char_set=new Set(var_members_char),var_first_char_set=new Set(var_first_char);new Set(number_first_char);var pure_number_var_first_char_set=new Set(pure_number_var_first_char),empty_char_set=new Set(empty_char),state_initial="initial",state_number="number",state_scientific="scientific",state_operator="operator",state_bracket="bracket",state_var="var",state_symbol="symbol",state_percent="percent",state_round="round",state_plus="plus",state_comma="comma",state_fraction="fraction",state_to_number="to-number",state_to_number_string="to-number-string",state_fallback_var="fallback_var",state_integer_padding="integer_padding",state_volume="volume",state_unit_after="unit_after",state_unit_before="unit_before",state_unit_middle="unit_middle",state_unit_hide="unit_hide",state_unit_default="unit_default",state_thousands="thousands",state_fmt_group="fmt_group",state_comparison="comparison",state_logical="logical",state_logical_not="logical_not",state_ternary_question="ternary_question",state_ternary_colon="ternary_colon",state_function="function",state_range_start="range_start",state_range_end="range_end",state_range_clamp="range_clamp",comparison_operators=new Set([">","<",">=","<=","==","!="]),logical_operators=new Set(["&&","||"]),operator_precedence={"|":0,"?":1,":":1,"||":2,"&&":3,"==":4,"!=":4,">":5,"<":5,">=":5,"<=":5,"+":6,"-":6,"*":7,"/":7,"%":7,"//":7,"**":8,"!":9,"unary-":9,"unary+":9},isArray=Array.isArray,freeGlobal="object"==("undefined"==typeof global?"undefined":_typeof(global))&&global&&global.Object===Object&&global,freeSelf="object"==("undefined"==typeof self?"undefined":_typeof(self))&&self&&self.Object===Object&&self,root=freeGlobal||freeSelf||Function("return this")(),_Symbol=root.Symbol,objectProto$4=Object.prototype,hasOwnProperty$3=objectProto$4.hasOwnProperty,nativeObjectToString$1=objectProto$4.toString,symToStringTag$1=_Symbol?_Symbol.toStringTag:void 0;function getRawTag(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 i=nativeObjectToString$1.call(e);return n&&(t?e[symToStringTag$1]=r:delete e[symToStringTag$1]),i}var objectProto$3=Object.prototype,nativeObjectToString=objectProto$3.toString;function objectToString(e){return nativeObjectToString.call(e)}var nullTag="[object Null]",undefinedTag="[object Undefined]",symToStringTag=_Symbol?_Symbol.toStringTag:void 0;function baseGetTag(e){return null==e?void 0===e?undefinedTag:nullTag:symToStringTag&&symToStringTag in Object(e)?getRawTag(e):objectToString(e)}function isObjectLike(e){return null!=e&&"object"==_typeof(e)}var symbolTag="[object Symbol]";function isSymbol(e){return"symbol"==_typeof(e)||isObjectLike(e)&&baseGetTag(e)==symbolTag}var reIsDeepProp=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,reIsPlainProp=/^\w*$/;function isKey(e,t){if(isArray(e))return!1;var r=_typeof(e);return!("number"!=r&&"symbol"!=r&&"boolean"!=r&&null!=e&&!isSymbol(e))||(reIsPlainProp.test(e)||!reIsDeepProp.test(e)||null!=t&&e in Object(t))}function isObject(e){var t=_typeof(e);return null!=e&&("object"==t||"function"==t)}var asyncTag="[object AsyncFunction]",funcTag="[object Function]",genTag="[object GeneratorFunction]",proxyTag="[object Proxy]";function isFunction(e){if(!isObject(e))return!1;var t=baseGetTag(e);return t==funcTag||t==genTag||t==asyncTag||t==proxyTag}var coreJsData=root["__core-js_shared__"],maskSrcKey=(uid=/[^.]+$/.exec(coreJsData&&coreJsData.keys&&coreJsData.keys.IE_PROTO||""),uid?"Symbol(src)_1."+uid:""),uid;function isMasked(e){return!!maskSrcKey&&maskSrcKey in e}var funcProto$1=Function.prototype,funcToString$1=funcProto$1.toString;function toSource(e){if(null!=e){try{return funcToString$1.call(e)}catch(e){}try{return e+""}catch(e){}}return""}var 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(e){return!(!isObject(e)||isMasked(e))&&(isFunction(e)?reIsNative:reIsHostCtor).test(toSource(e))}function getValue(e,t){return null==e?void 0:e[t]}function getNative(e,t){var r=getValue(e,t);return baseIsNative(r)?r:void 0}var nativeCreate=getNative(Object,"create");function hashClear(){this.__data__=nativeCreate?nativeCreate(null):{},this.size=0}function hashDelete(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var HASH_UNDEFINED$1="__lodash_hash_undefined__",objectProto$1=Object.prototype,hasOwnProperty$1=objectProto$1.hasOwnProperty;function hashGet(e){var t=this.__data__;if(nativeCreate){var r=t[e];return r===HASH_UNDEFINED$1?void 0:r}return hasOwnProperty$1.call(t,e)?t[e]:void 0}var objectProto=Object.prototype,hasOwnProperty=objectProto.hasOwnProperty;function hashHas(e){var t=this.__data__;return nativeCreate?void 0!==t[e]:hasOwnProperty.call(t,e)}var HASH_UNDEFINED="__lodash_hash_undefined__";function hashSet(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=nativeCreate&&void 0===t?HASH_UNDEFINED:t,this}function Hash(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])}}function listCacheClear(){this.__data__=[],this.size=0}function eq(e,t){return e===t||e!=e&&t!=t}function assocIndexOf(e,t){for(var r=e.length;r--;)if(eq(e[r][0],t))return r;return-1}Hash.prototype.clear=hashClear,Hash.prototype.delete=hashDelete,Hash.prototype.get=hashGet,Hash.prototype.has=hashHas,Hash.prototype.set=hashSet;var arrayProto=Array.prototype,splice=arrayProto.splice;function listCacheDelete(e){var t=this.__data__,r=assocIndexOf(t,e);return!(r<0)&&(r==t.length-1?t.pop():splice.call(t,r,1),--this.size,!0)}function listCacheGet(e){var t=this.__data__,r=assocIndexOf(t,e);return r<0?void 0:t[r][1]}function listCacheHas(e){return assocIndexOf(this.__data__,e)>-1}function listCacheSet(e,t){var r=this.__data__,n=assocIndexOf(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this}function ListCache(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.prototype.clear=listCacheClear,ListCache.prototype.delete=listCacheDelete,ListCache.prototype.get=listCacheGet,ListCache.prototype.has=listCacheHas,ListCache.prototype.set=listCacheSet;var Map$1=getNative(root,"Map");function mapCacheClear(){this.size=0,this.__data__={hash:new Hash,map:new(Map$1||ListCache),string:new Hash}}function isKeyable(e){var t=_typeof(e);return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e}function getMapData(e,t){var r=e.__data__;return isKeyable(t)?r["string"==typeof t?"string":"hash"]:r.map}function mapCacheDelete(e){var t=getMapData(this,e).delete(e);return this.size-=t?1:0,t}function mapCacheGet(e){return getMapData(this,e).get(e)}function mapCacheHas(e){return getMapData(this,e).has(e)}function mapCacheSet(e,t){var r=getMapData(this,e),n=r.size;return r.set(e,t),this.size+=r.size==n?0:1,this}function MapCache(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.prototype.clear=mapCacheClear,MapCache.prototype.delete=mapCacheDelete,MapCache.prototype.get=mapCacheGet,MapCache.prototype.has=mapCacheHas,MapCache.prototype.set=mapCacheSet;var FUNC_ERROR_TEXT="Expected a function";function memoize(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError(FUNC_ERROR_TEXT);var r=function(){var n=arguments,i=t?t.apply(this,n):n[0],a=r.cache;if(a.has(i))return a.get(i);var o=e.apply(this,n);return r.cache=a.set(i,o)||a,o};return r.cache=new(memoize.Cache||MapCache),r}memoize.Cache=MapCache;var MAX_MEMOIZE_SIZE=500;function memoizeCapped(e){var t=memoize(e,function(e){return r.size===MAX_MEMOIZE_SIZE&&r.clear(),e}),r=t.cache;return t}var rePropName=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,reEscapeChar=/\\(\\)?/g,stringToPath=memoizeCapped(function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(rePropName,function(e,r,n,i){t.push(n?i.replace(reEscapeChar,"$1"):r||e)}),t});function arrayMap(e,t){for(var r=-1,n=null==e?0:e.length,i=Array(n);++r<n;)i[r]=t(e[r],r,e);return i}var symbolProto=_Symbol?_Symbol.prototype:void 0,symbolToString=symbolProto?symbolProto.toString:void 0;function baseToString(e){if("string"==typeof e)return e;if(isArray(e))return arrayMap(e,baseToString)+"";if(isSymbol(e))return symbolToString?symbolToString.call(e):"";var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function toString(e){return null==e?"":baseToString(e)}function castPath(e,t){return isArray(e)?e:isKey(e,t)?[e]:stringToPath(toString(e))}function toKey(e){if("string"==typeof e||isSymbol(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function baseGet(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}function get(e,t,r){var n=null==e?void 0:baseGet(e,t);return void 0===n?r:n}var REG_UNIT_NUM_SCIENTIFIC=/^([+-]?[\d.]+(?:e|E)(?:\+|-)?\d+)(.*)$/,REG_UNIT_NUM_NORMAL=/^([+-]?[\d.]+)(.*)$/;function split_unit_num(e){var t,r,n=(e="string"!=typeof e?e.toString():e).match(REG_UNIT_NUM_SCIENTIFIC)||e.match(REG_UNIT_NUM_NORMAL);if(n){r=n[1];var i=n[2];""!==i.trim()&&(t=i)}return{num:r,unit:t}}function find_value(e,t,r){var n,i,a,o;return Array.isArray(e)?e.length>1?null!==(n=null!==(i=get(e[0],t))&&void 0!==i?i:get(e.at(-1),t))&&void 0!==n?n:r:1===e.length&&null!==(a=get(e[0],t))&&void 0!==a?a:r:null!==(o=get(e,t,r))&&void 0!==o?o:r}function parse_mantissa(e,t,r,n){var i=e.split("."),a=i[0],o=1===i.length?"":i[1],s=decimal_round(a,o,t,+r,n);return a=s.int_part,""===(o=s.dec_part)?a:"".concat(a,".").concat(o)}function integer_thousands(e){for(var t=e.length,r="";t>0;)r=e.substring(t-3,t)+(""!==r?",":"")+r,t-=3;return r}function parse_thousands(e){var t=e.split("."),r=t[0];return"-"===r[0]?t[0]="-"+integer_thousands(r.slice(1)):t[0]=integer_thousands(r),t.join(".")}function promise_queue(e){return _promise_queue.apply(this,arguments)}function _promise_queue(){return _promise_queue=_asyncToGenerator(_regenerator().m(function e(t){var r,n,i,a=arguments;return _regenerator().w(function(e){for(;;)switch(e.p=e.n){case 0:r=a.length>1&&void 0!==a[1]?a[1]:5e3,n=0;case 1:if(!(n<t.length)){e.n=7;break}return e.p=2,e.n=3,Promise.race([t[n],new Promise(function(e,t){setTimeout(function(){return t(new Error("promise queue timeout err"))},r)})]);case 3:i=e.v,e.n=5;break;case 4:return e.p=4,e.v,e.a(3,6);case 5:return e.a(2,i);case 6:n++,e.n=1;break;case 7:return e.a(2,Promise.reject("错误的 promise queue 调用"))}},e,null,[[2,4]])})),_promise_queue.apply(this,arguments)}function test_urls(e){return _test_urls.apply(this,arguments)}function _test_urls(){return(_test_urls=_asyncToGenerator(_regenerator().m(function e(t){var r;return _regenerator().w(function(e){for(;;)switch(e.p=e.n){case 0:r=0;case 1:if(!(r<t.length)){e.n=7;break}return e.p=2,e.n=3,fetch(t[r]);case 3:if(!e.v.ok){e.n=4;break}return e.a(2,t[r]);case 4:e.n=6;break;case 5:return e.p=5,e.v,e.a(3,6);case 6:r++,e.n=1;break;case 7:return e.a(2,null)}},e,null,[[2,5]])}))).apply(this,arguments)}function get_real_value(e,t){if(Array.isArray(e)){for(var r,n=0,i=e.length;n<i;n++){var a;if(void 0!==(r=null!==(a=get(e[n],t))&&void 0!==a?a:void 0))break}if(void 0===r)throw new Error("填充变量".concat(t,"失败"));return r}var o;return null!==(o=get(e,t))&&void 0!==o?o:void 0}function is_empty_for_fallback(e,t,r){return r&&"function"==typeof r._empty_check?r._empty_check(e,t):r&&Array.isArray(r._empty_values)?r._empty_values.some(function(t){return!(!Number.isNaN(t)||!Number.isNaN(e))||e===t}):null==e}function get_fallback_value(e,t,r){for(var n=0;n<t.length;n++){var i=t[n].trim(),a=void 0;try{if(Array.isArray(e))for(var o=0;o<e.length;o++){var s=get(e[o],i);if(void 0!==s){a=s;break}}else a=get(e,i)}catch(e){continue}if(!is_empty_for_fallback(a,i,r))return{value:a,path:i}}throw new Error("多路取值失败,所有路径均为空值: ".concat(t.join(" | ")))}function get_next_nonempty_char(e,t,r){var n;for(t++;t<r;){if(n=e[t],!empty_char_set.has(n))return n;t++}}function split_expr_and_fmt(e){for(var t=0,r=0;r<e.length;r++){var n=e[r];if("("===n)t++;else if(")"===n)t--;else if("|"===n&&0===t){if(r+1<e.length&&"|"===e[r+1]){r++;continue}return{expr:e.slice(0,r),fmt:e.slice(r+1).trim()}}}return{expr:e,fmt:""}}function parse_args(e,t){var r="",n={origin_expr:e,origin_fill_data:t,expr:"",fmt_expr:"",options:void 0,fill_data:void 0,_unit:void 0,_fmt:void 0,_empty_values:void 0,_empty_check:void 0,_vol_units:void 0,_vol_step:void 0,_thousands:void 0};if(null!=t&&(n.options=t,Array.isArray(t)?n.fill_data=t:n.fill_data=[t]),n._fmt=find_value(t,"_fmt"),n._unit=find_value(t,"_unit",!1),n._empty_values=find_value(t,"_empty_values"),n._empty_check=find_value(t,"_empty_check"),n._vol_units=find_value(t,"_vol_units"),n._vol_step=find_value(t,"_vol_step"),n._thousands=find_value(t,"_thousands"),"string"==typeof e){if(r=e,""===e.trim()||e.includes("NaN"))throw new Error("非法的表达式:".concat(e))}else{if("number"!=typeof e)throw new Error("错误的第一个参数类型: ".concat(e," 类型为:").concat(_typeof(e)));if(isNaN(e))throw new Error("传入了一个非法数字NaN");r=e.toString()}var i=split_expr_and_fmt(r),a=i.expr,o=i.fmt;return n.expr=a,n.fmt_expr=o,n}function detect_fallback_var$1(e,t){if("("!==e[t])return null;for(var r=0,n=!1,i=[],a="",o=t;o<e.length;){var s=e[o];if("("===s){if(0===r){r++,o++;continue}r++,a+=s}else if(")"===s){if(0===--r)return n?(i.push(a.trim()),{paths:i,end_index:o}):null;a+=s}else"|"===s&&1===r?(n=!0,i.push(a.trim()),a=""):a+=s;o++}return null}function detect_function_call(e,t,r){for(var n=t;n<e.length&&" "===e[n];)n++;return n<e.length&&"("===e[n]}function parse_function_args(e,t){if("("!==e[t])return null;for(var r=1,n=[],i="",a=t+1;a<e.length&&r>0;){var o=e[a];if("("===o)r++,i+=o;else if(")"===o){if(0===--r)return i.trim()&&n.push(i.trim()),{args:n,end_index:a};i+=o}else","===o&&1===r?(n.push(i.trim()),i=""):i+=o;a++}return null}function push_token$3(e,t){if(t.curr_state===state_number||t.curr_state===state_scientific){var r=t.expr.slice(t.prev_index,t.cur_index);if("+"===r||"-"===r)return e.push({type:state_operator,value:r}),t.curr_state=state_initial,void(t.prev_index=t.cur_index);if(t._unit){var n,i=split_unit_num(r),a=i.num,o=i.unit;if(void 0===o)e.push({type:state_number,value:a,real_value:a,has_unit:!1});else t.has_unit=!0,null!==(n=t.unit_str)&&void 0!==n||(t.unit_str=o),e.push({type:state_number,value:a,real_value:a,has_unit:!0,unit:o})}else e.push({type:state_number,value:r,real_value:r,has_unit:!1})}else if(t.curr_state===state_var){t.has_var=!0;var s=t.expr.slice(t.prev_index,t.cur_index);if("true"===s)e.push({type:"boolean",value:!0});else if("false"===s)e.push({type:"boolean",value:!1});else if(detect_function_call(t.expr,t.cur_index)){for(var _=t.cur_index;_<t.expr.length&&" "===t.expr[_];)_++;var u=parse_function_args(t.expr,_);if(u)return e.push({type:state_function,value:s,args:u.args}),t.cur_index=u.end_index+1,t.prev_index=t.cur_index,void(t.curr_state=state_initial)}else{var c=get_real_value(t.fill_data,s);if("function"==typeof c){for(var l=t.cur_index;l<t.expr.length&&" "===t.expr[l];)l++;if(l<t.expr.length&&"("===t.expr[l]){var p=parse_function_args(t.expr,l);if(p)return e.push({type:state_function,value:s,args:p.args,fn:c}),t.cur_index=p.end_index+1,t.prev_index=t.cur_index,void(t.curr_state=state_initial)}}if(t._unit){var d,f=split_unit_num(c),g=f.num,m=f.unit;if(void 0===m)e.push({type:"var",value:s,real_value:g,has_unit:!1});else t.has_unit=!0,null!==(d=t.unit_str)&&void 0!==d||(t.unit_str=m),e.push({type:"var",value:s,real_value:g,has_unit:!0,unit:m})}else e.push({type:"var",value:s,real_value:c,has_unit:!1})}}else e.push({type:t.curr_state,value:t.expr.slice(t.prev_index,t.cur_index)});t.curr_state=state_initial,t.prev_index=t.cur_index}function tokenizer(e,t,r,n){for(var i,a={has_var:!1,has_unit:!1,unit_str:void 0,fill_data:t,cur_index:0,prev_index:0,curr_state:state_initial,expr:e,_unit:r},o=e.length,s=[];a.cur_index<o;)switch(i=e[a.cur_index],a.curr_state){case state_initial:if(number_char_set.has(i))a.curr_state=state_number,a.cur_index++;else if(" "===i)a.cur_index++,a.prev_index=a.cur_index;else if("+-".includes(i)){var _=s.at(-1);0===a.cur_index||"operator"===(null==_?void 0:_.type)||"comparison"===(null==_?void 0:_.type)||"logical"===(null==_?void 0:_.type)||"logical_not"===(null==_?void 0:_.type)||"ternary_question"===(null==_?void 0:_.type)||"ternary_colon"===(null==_?void 0:_.type)||"("===(null==_?void 0:_.value)||"["===(null==_?void 0:_.value)||","===(null==_?void 0:_.value)?(a.curr_state=state_number,a.cur_index++):(a.cur_index++,s.push({type:state_operator,value:e.slice(a.prev_index,a.cur_index)}),a.prev_index=a.cur_index)}else if("*/%".includes(i))a.curr_state=state_operator,a.cur_index++;else if(">"===i)a.cur_index++,a.cur_index<o&&"="===e[a.cur_index]?(a.cur_index++,s.push({type:state_comparison,value:">="})):s.push({type:state_comparison,value:">"}),a.prev_index=a.cur_index;else if("<"===i)a.cur_index++,a.cur_index<o&&"="===e[a.cur_index]?(a.cur_index++,s.push({type:state_comparison,value:"<="})):s.push({type:state_comparison,value:"<"}),a.prev_index=a.cur_index;else if("="===i&&a.cur_index+1<o&&"="===e[a.cur_index+1])a.cur_index+=2,s.push({type:state_comparison,value:"=="}),a.prev_index=a.cur_index;else if("!"===i&&a.cur_index+1<o&&"="===e[a.cur_index+1])a.cur_index+=2,s.push({type:state_comparison,value:"!="}),a.prev_index=a.cur_index;else if("&"===i&&a.cur_index+1<o&&"&"===e[a.cur_index+1])a.cur_index+=2,s.push({type:state_logical,value:"&&"}),a.prev_index=a.cur_index;else if("|"===i&&a.cur_index+1<o&&"|"===e[a.cur_index+1])a.cur_index+=2,s.push({type:state_logical,value:"||"}),a.prev_index=a.cur_index;else if("!"===i)a.cur_index++,s.push({type:state_logical_not,value:"!"}),a.prev_index=a.cur_index;else if("?"===i)a.cur_index++,s.push({type:state_ternary_question,value:"?"}),a.prev_index=a.cur_index;else if(":"===i)a.cur_index++,s.push({type:state_ternary_colon,value:":"}),a.prev_index=a.cur_index;else if("["===i)a.cur_index++,s.push({type:state_range_start,value:"["}),a.prev_index=a.cur_index;else if("]"===i)a.cur_index++,s.push({type:state_range_end,value:"]"}),a.prev_index=a.cur_index;else if(","===i)a.cur_index++,s.push({type:"comma",value:","}),a.prev_index=a.cur_index;else if(var_char_set.has(i))a.curr_state=state_var,a.cur_index++;else if('"'===i||"'"===i){var u=i;a.cur_index++;for(var c="";a.cur_index<o&&e[a.cur_index]!==u;)"\\"===e[a.cur_index]&&a.cur_index+1<o?(a.cur_index++,c+=e[a.cur_index]):c+=e[a.cur_index],a.cur_index++;a.cur_index++,s.push({type:"string",value:c}),a.prev_index=a.cur_index}else if("("===i){var l=detect_fallback_var$1(e,a.cur_index);if(l){a.has_var=!0;var p=get_fallback_value(t,l.paths,n),d=p.value,f=p.path;if(r){var g,m=split_unit_num(d),v=m.num,h=m.unit;if(void 0!==h)a.has_unit=!0,null!==(g=a.unit_str)&&void 0!==g||(a.unit_str=h),s.push({type:state_fallback_var,value:l.paths,real_value:v,matched_path:f,has_unit:!0,unit:h});else s.push({type:state_fallback_var,value:l.paths,real_value:v,matched_path:f,has_unit:!1})}else s.push({type:state_fallback_var,value:l.paths,real_value:d,matched_path:f,has_unit:!1});a.cur_index=l.end_index+1,a.prev_index=a.cur_index}else s.push({type:state_bracket,value:i}),a.curr_state=state_initial,a.cur_index++,a.prev_index=a.cur_index}else")"===i?(s.push({type:state_bracket,value:i}),a.curr_state=state_initial,a.cur_index++,a.prev_index=a.cur_index):(a.cur_index++,a.prev_index=a.cur_index);break;case state_number:if(number_char_set.has(i))a.cur_index++;else if("."===i){if(a.cur_index===a.prev_index||e.slice(a.prev_index,a.cur_index).includes("."))throw new Error("非法的小数部分".concat(e.slice(a.prev_index,a.cur_index)));a.cur_index++}else"e"===i?(a.curr_state=state_scientific,a.cur_index++):r?"*/+-() ".indexOf(i)>-1||">"===i||"<"===i||"="===i||"!"===i||"&"===i||"|"===i||"?"===i||":"===i||"["===i||"]"===i||","===i||"%"===i&&number_char_set.has(e[a.cur_index-1])&&pure_number_var_first_char_set.has(get_next_nonempty_char(e,a.cur_index,o))?push_token$3(s,a):a.cur_index++:push_token$3(s,a);break;case state_operator:var w=e[a.cur_index-1];"*"===i&&"*"===w?(a.cur_index++,s.push({type:state_operator,value:"**"}),a.prev_index=a.cur_index):"/"===i&&"/"===w?(a.cur_index++,s.push({type:state_operator,value:"//"}),a.prev_index=a.cur_index):(s.push({type:state_operator,value:w}),a.prev_index=a.cur_index),a.curr_state=state_initial;break;case state_var:var_members_char_set.has(i)?a.cur_index++:push_token$3(s,a);break;case state_scientific:if(number_char_set.has(i))a.cur_index++;else if("+-".includes(i)){var b=a.prev_index;"+-".includes(e[b])&&(b+=1);var y=e.slice(b,a.cur_index),x=y.at(-1);y.includes(i)||"e"!==x?push_token$3(s,a):a.cur_index++}else r&&-1==="*/+-() ".indexOf(i)&&">"!==i&&"<"!==i&&"="!==i&&"!"!==i&&"&"!==i&&"|"!==i&&"?"!==i&&":"!==i&&"["!==i&&"]"!==i&&","!==i?a.cur_index++:push_token$3(s,a);break;default:throw new Error("字符扫描状态错误")}return a.prev_index<a.cur_index&&push_token$3(s,a),s.has_var=a.has_var,s.has_unit=a.has_unit,s.unit=a.unit_str,s}
3
+ var e,t,r="function"==typeof Symbol?Symbol:{},n=r.iterator||"@@iterator",i=r.toStringTag||"@@toStringTag";function a(r,n,i,a){var _=n&&n.prototype instanceof s?n:s,u=Object.create(_.prototype);return _regeneratorDefine(u,"_invoke",function(r,n,i){var a,s,_,u=0,c=i||[],l=!1,p={p:0,n:0,v:e,a:d,f:d.bind(e,4),d:function(t,r){return a=t,s=0,_=e,p.n=r,o}};function d(r,n){for(s=r,_=n,t=0;!l&&u&&!i&&t<c.length;t++){var i,a=c[t],d=p.p,f=a[2];r>3?(i=f===n)&&(_=a[(s=a[4])?5:(s=3,3)],a[4]=a[5]=e):a[0]<=d&&((i=r<2&&d<a[1])?(s=0,p.v=n,p.n=a[1]):d<f&&(i=r<3||a[0]>n||n>f)&&(a[4]=r,a[5]=n,p.n=f,s=0))}if(i||r>1)return o;throw l=!0,n}return function(i,c,f){if(u>1)throw TypeError("Generator is already running");for(l&&1===c&&d(c,f),s=c,_=f;(t=s<2?e:_)||!l;){a||(s?s<3?(s>1&&(p.n=-1),d(s,_)):p.n=_:p.v=_);try{if(u=2,a){if(s||(i="next"),t=a[i]){if(!(t=t.call(a,_)))throw TypeError("iterator result is not an object");if(!t.done)return t;_=t.value,s<2&&(s=0)}else 1===s&&(t=a.return)&&t.call(a),s<2&&(_=TypeError("The iterator does not provide a '"+i+"' method"),s=1);a=e}else if((t=(l=p.n<0)?_:r.call(n,p))!==o)break}catch(t){a=e,s=1,_=t}finally{u=1}}return{value:t,done:l}}}(r,i,a),!0),u}var o={};function s(){}function _(){}function u(){}t=Object.getPrototypeOf;var c=[][n]?t(t([][n]())):(_regeneratorDefine(t={},n,function(){return this}),t),l=u.prototype=s.prototype=Object.create(c);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,u):(e.__proto__=u,_regeneratorDefine(e,i,"GeneratorFunction")),e.prototype=Object.create(l),e}return _.prototype=u,_regeneratorDefine(l,"constructor",u),_regeneratorDefine(u,"constructor",_),_.displayName="GeneratorFunction",_regeneratorDefine(u,i,"GeneratorFunction"),_regeneratorDefine(l),_regeneratorDefine(l,i,"Generator"),_regeneratorDefine(l,n,function(){return this}),_regeneratorDefine(l,"toString",function(){return"[object Generator]"}),(_regenerator=function(){return{w:a,m:p}})()}function _regeneratorDefine(e,t,r,n){var i=Object.defineProperty;try{i({},"",{})}catch(e){i=0}_regeneratorDefine=function(e,t,r,n){function a(t,r){_regeneratorDefine(e,t,function(e){return this._invoke(t,r,e)})}t?i?i(e,t,{value:r,enumerable:!n,configurable:!n,writable:!n}):e[t]=r:(a("next",0),a("throw",1),a("return",2))},_regeneratorDefine(e,t,r,n)}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 _toPrimitive(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);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:t+""}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 _unsupportedIterableToArray(e,t){if(e){if("string"==typeof e)return _arrayLikeToArray(e,t);var r={}.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}}var version="3.0.0-beta.20250123.6";function decimal_round(e,t,r,n,i){var a=e.startsWith("-"),o=a?e.slice(1):e,s=o,_=t,u=t.length;function c(){s=(+s+1).toString()}var l={"~-":function(){var e="<"===r?n-1:n;_=t.slice(0,e)},"~+":function(){var e="<"===r?n-1:n;if(!(u<=e||0===u)){var i=t.slice(0,e);0===+t.slice(e,u)?_=i:(i=(+"9".concat(i)+1).toString().slice(1)).length>e?(_=i.slice(1,i.length),c()):_=i}},"~5":function(){if(0!==u){var e="<"===r?n-1:n;_=t.slice(0,e);var i=+t[e];Number.isNaN(i)||i>=5&&(_=(+"9".concat(_)+1).toString().slice(1)).length>e&&(_=_.slice(1,_.length),c())}},"~6":function(){if(0!==u){var e,i="<"===r?n-1:n,a=+t[i],s=t.slice(+i+1,t.length);s=""===s?0:parseInt(s),e=0===i?+o[o.length-1]:+t[i-1],_=t.slice(0,i),(a>=6||5===a&&s>0||5===a&&e%2!=0)&&(_=(+"9".concat(_)+1).toString().slice(1)).length>i&&(_=_.slice(1,_.length),c())}}};return"<="===r?u<=n?_=t.replace(/0*$/,""):(l[i]&&l[i](),_=_.replace(/0+$/,"")):"<"===r?u<n?_=t.replace(/0*$/,""):(l[i]&&l[i](),_=_.replace(/0+$/,"")):"="===r?u<n?_=t+"0".repeat(n-u):u>n&&l[i]&&l[i]():">="===r?u<n&&(_=t+"0".repeat(n-u)):">"===r&&u<=n&&(_=t+"0".repeat(n-u+1)),{int_part:a?"-".concat(s):s,dec_part:_}}var number_char="0123456789",var_char="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_$",number_first_char="0123456789-+",var_members_char="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_$[].'\"",var_first_char="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_$",pure_number_var_first_char="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_$",empty_char=" \n\r\t",number_char_set=new Set(number_char),var_char_set=new Set(var_char),var_members_char_set=new Set(var_members_char),var_first_char_set=new Set(var_first_char);new Set(number_first_char);var pure_number_var_first_char_set=new Set(pure_number_var_first_char),empty_char_set=new Set(empty_char),state_initial="initial",state_number="number",state_scientific="scientific",state_operator="operator",state_bracket="bracket",state_var="var",state_symbol="symbol",state_percent="percent",state_round="round",state_plus="plus",state_comma="comma",state_fraction="fraction",state_to_number="to-number",state_to_number_string="to-number-string",state_fallback_var="fallback_var",state_integer_padding="integer_padding",state_volume="volume",state_unit_after="unit_after",state_unit_before="unit_before",state_unit_middle="unit_middle",state_unit_hide="unit_hide",state_unit_default="unit_default",state_thousands="thousands",state_fmt_group="fmt_group",state_comparison="comparison",state_logical="logical",state_logical_not="logical_not",state_ternary_question="ternary_question",state_ternary_colon="ternary_colon",state_function="function",state_range_start="range_start",state_range_end="range_end",state_range_clamp="range_clamp",comparison_operators=new Set([">","<",">=","<=","==","!="]),logical_operators=new Set(["&&","||"]),operator_precedence={"|":0,"?":1,":":1,"||":2,"&&":3,"==":4,"!=":4,">":5,"<":5,">=":5,"<=":5,"+":6,"-":6,"*":7,"/":7,"%":7,"//":7,"**":8,"!":9,"unary-":9,"unary+":9},isArray=Array.isArray,freeGlobal="object"==("undefined"==typeof global?"undefined":_typeof(global))&&global&&global.Object===Object&&global,freeSelf="object"==("undefined"==typeof self?"undefined":_typeof(self))&&self&&self.Object===Object&&self,root=freeGlobal||freeSelf||Function("return this")(),_Symbol=root.Symbol,objectProto$4=Object.prototype,hasOwnProperty$3=objectProto$4.hasOwnProperty,nativeObjectToString$1=objectProto$4.toString,symToStringTag$1=_Symbol?_Symbol.toStringTag:void 0;function getRawTag(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 i=nativeObjectToString$1.call(e);return n&&(t?e[symToStringTag$1]=r:delete e[symToStringTag$1]),i}var objectProto$3=Object.prototype,nativeObjectToString=objectProto$3.toString;function objectToString(e){return nativeObjectToString.call(e)}var nullTag="[object Null]",undefinedTag="[object Undefined]",symToStringTag=_Symbol?_Symbol.toStringTag:void 0;function baseGetTag(e){return null==e?void 0===e?undefinedTag:nullTag:symToStringTag&&symToStringTag in Object(e)?getRawTag(e):objectToString(e)}function isObjectLike(e){return null!=e&&"object"==_typeof(e)}var symbolTag="[object Symbol]";function isSymbol(e){return"symbol"==_typeof(e)||isObjectLike(e)&&baseGetTag(e)==symbolTag}var reIsDeepProp=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,reIsPlainProp=/^\w*$/;function isKey(e,t){if(isArray(e))return!1;var r=_typeof(e);return!("number"!=r&&"symbol"!=r&&"boolean"!=r&&null!=e&&!isSymbol(e))||(reIsPlainProp.test(e)||!reIsDeepProp.test(e)||null!=t&&e in Object(t))}function isObject(e){var t=_typeof(e);return null!=e&&("object"==t||"function"==t)}var asyncTag="[object AsyncFunction]",funcTag="[object Function]",genTag="[object GeneratorFunction]",proxyTag="[object Proxy]";function isFunction(e){if(!isObject(e))return!1;var t=baseGetTag(e);return t==funcTag||t==genTag||t==asyncTag||t==proxyTag}var coreJsData=root["__core-js_shared__"],maskSrcKey=(uid=/[^.]+$/.exec(coreJsData&&coreJsData.keys&&coreJsData.keys.IE_PROTO||""),uid?"Symbol(src)_1."+uid:""),uid;function isMasked(e){return!!maskSrcKey&&maskSrcKey in e}var funcProto$1=Function.prototype,funcToString$1=funcProto$1.toString;function toSource(e){if(null!=e){try{return funcToString$1.call(e)}catch(e){}try{return e+""}catch(e){}}return""}var 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(e){return!(!isObject(e)||isMasked(e))&&(isFunction(e)?reIsNative:reIsHostCtor).test(toSource(e))}function getValue(e,t){return null==e?void 0:e[t]}function getNative(e,t){var r=getValue(e,t);return baseIsNative(r)?r:void 0}var nativeCreate=getNative(Object,"create");function hashClear(){this.__data__=nativeCreate?nativeCreate(null):{},this.size=0}function hashDelete(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var HASH_UNDEFINED$1="__lodash_hash_undefined__",objectProto$1=Object.prototype,hasOwnProperty$1=objectProto$1.hasOwnProperty;function hashGet(e){var t=this.__data__;if(nativeCreate){var r=t[e];return r===HASH_UNDEFINED$1?void 0:r}return hasOwnProperty$1.call(t,e)?t[e]:void 0}var objectProto=Object.prototype,hasOwnProperty=objectProto.hasOwnProperty;function hashHas(e){var t=this.__data__;return nativeCreate?void 0!==t[e]:hasOwnProperty.call(t,e)}var HASH_UNDEFINED="__lodash_hash_undefined__";function hashSet(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=nativeCreate&&void 0===t?HASH_UNDEFINED:t,this}function Hash(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])}}function listCacheClear(){this.__data__=[],this.size=0}function eq(e,t){return e===t||e!=e&&t!=t}function assocIndexOf(e,t){for(var r=e.length;r--;)if(eq(e[r][0],t))return r;return-1}Hash.prototype.clear=hashClear,Hash.prototype.delete=hashDelete,Hash.prototype.get=hashGet,Hash.prototype.has=hashHas,Hash.prototype.set=hashSet;var arrayProto=Array.prototype,splice=arrayProto.splice;function listCacheDelete(e){var t=this.__data__,r=assocIndexOf(t,e);return!(r<0)&&(r==t.length-1?t.pop():splice.call(t,r,1),--this.size,!0)}function listCacheGet(e){var t=this.__data__,r=assocIndexOf(t,e);return r<0?void 0:t[r][1]}function listCacheHas(e){return assocIndexOf(this.__data__,e)>-1}function listCacheSet(e,t){var r=this.__data__,n=assocIndexOf(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this}function ListCache(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.prototype.clear=listCacheClear,ListCache.prototype.delete=listCacheDelete,ListCache.prototype.get=listCacheGet,ListCache.prototype.has=listCacheHas,ListCache.prototype.set=listCacheSet;var Map$1=getNative(root,"Map");function mapCacheClear(){this.size=0,this.__data__={hash:new Hash,map:new(Map$1||ListCache),string:new Hash}}function isKeyable(e){var t=_typeof(e);return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e}function getMapData(e,t){var r=e.__data__;return isKeyable(t)?r["string"==typeof t?"string":"hash"]:r.map}function mapCacheDelete(e){var t=getMapData(this,e).delete(e);return this.size-=t?1:0,t}function mapCacheGet(e){return getMapData(this,e).get(e)}function mapCacheHas(e){return getMapData(this,e).has(e)}function mapCacheSet(e,t){var r=getMapData(this,e),n=r.size;return r.set(e,t),this.size+=r.size==n?0:1,this}function MapCache(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.prototype.clear=mapCacheClear,MapCache.prototype.delete=mapCacheDelete,MapCache.prototype.get=mapCacheGet,MapCache.prototype.has=mapCacheHas,MapCache.prototype.set=mapCacheSet;var FUNC_ERROR_TEXT="Expected a function";function memoize(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError(FUNC_ERROR_TEXT);var r=function(){var n=arguments,i=t?t.apply(this,n):n[0],a=r.cache;if(a.has(i))return a.get(i);var o=e.apply(this,n);return r.cache=a.set(i,o)||a,o};return r.cache=new(memoize.Cache||MapCache),r}memoize.Cache=MapCache;var MAX_MEMOIZE_SIZE=500;function memoizeCapped(e){var t=memoize(e,function(e){return r.size===MAX_MEMOIZE_SIZE&&r.clear(),e}),r=t.cache;return t}var rePropName=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,reEscapeChar=/\\(\\)?/g,stringToPath=memoizeCapped(function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(rePropName,function(e,r,n,i){t.push(n?i.replace(reEscapeChar,"$1"):r||e)}),t});function arrayMap(e,t){for(var r=-1,n=null==e?0:e.length,i=Array(n);++r<n;)i[r]=t(e[r],r,e);return i}var symbolProto=_Symbol?_Symbol.prototype:void 0,symbolToString=symbolProto?symbolProto.toString:void 0;function baseToString(e){if("string"==typeof e)return e;if(isArray(e))return arrayMap(e,baseToString)+"";if(isSymbol(e))return symbolToString?symbolToString.call(e):"";var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function toString(e){return null==e?"":baseToString(e)}function castPath(e,t){return isArray(e)?e:isKey(e,t)?[e]:stringToPath(toString(e))}function toKey(e){if("string"==typeof e||isSymbol(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function baseGet(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}function get(e,t,r){var n=null==e?void 0:baseGet(e,t);return void 0===n?r:n}var REG_UNIT_NUM_SCIENTIFIC=/^([+-]?[\d.]+(?:e|E)(?:\+|-)?\d+)(.*)$/,REG_UNIT_NUM_NORMAL=/^([+-]?[\d.]+)(.*)$/;function split_unit_num(e){var t,r,n=(e="string"!=typeof e?e.toString():e).match(REG_UNIT_NUM_SCIENTIFIC)||e.match(REG_UNIT_NUM_NORMAL);if(n){r=n[1];var i=n[2];""!==i.trim()&&(t=i)}return{num:r,unit:t}}function find_value(e,t,r){var n,i,a,o;return Array.isArray(e)?e.length>1?null!==(n=null!==(i=get(e[0],t))&&void 0!==i?i:get(e.at(-1),t))&&void 0!==n?n:r:1===e.length&&null!==(a=get(e[0],t))&&void 0!==a?a:r:null!==(o=get(e,t,r))&&void 0!==o?o:r}function parse_mantissa(e,t,r,n){var i=e.split("."),a=i[0],o=1===i.length?"":i[1],s=decimal_round(a,o,t,+r,n);return a=s.int_part,""===(o=s.dec_part)?a:"".concat(a,".").concat(o)}function integer_thousands(e){for(var t=e.length,r="";t>0;)r=e.substring(t-3,t)+(""!==r?",":"")+r,t-=3;return r}function parse_thousands(e){var t=e.split("."),r=t[0];return"-"===r[0]?t[0]="-"+integer_thousands(r.slice(1)):t[0]=integer_thousands(r),t.join(".")}function promise_queue(e){return _promise_queue.apply(this,arguments)}function _promise_queue(){return _promise_queue=_asyncToGenerator(_regenerator().m(function e(t){var r,n,i,a=arguments;return _regenerator().w(function(e){for(;;)switch(e.p=e.n){case 0:r=a.length>1&&void 0!==a[1]?a[1]:5e3,n=0;case 1:if(!(n<t.length)){e.n=7;break}return e.p=2,e.n=3,Promise.race([t[n],new Promise(function(e,t){setTimeout(function(){return t(new Error("promise queue timeout err"))},r)})]);case 3:i=e.v,e.n=5;break;case 4:return e.p=4,e.v,e.a(3,6);case 5:return e.a(2,i);case 6:n++,e.n=1;break;case 7:return e.a(2,Promise.reject("错误的 promise queue 调用"))}},e,null,[[2,4]])})),_promise_queue.apply(this,arguments)}function test_urls(e){return _test_urls.apply(this,arguments)}function _test_urls(){return(_test_urls=_asyncToGenerator(_regenerator().m(function e(t){var r;return _regenerator().w(function(e){for(;;)switch(e.p=e.n){case 0:r=0;case 1:if(!(r<t.length)){e.n=7;break}return e.p=2,e.n=3,fetch(t[r]);case 3:if(!e.v.ok){e.n=4;break}return e.a(2,t[r]);case 4:e.n=6;break;case 5:return e.p=5,e.v,e.a(3,6);case 6:r++,e.n=1;break;case 7:return e.a(2,null)}},e,null,[[2,5]])}))).apply(this,arguments)}function get_real_value(e,t){if(Array.isArray(e)){for(var r,n=0,i=e.length;n<i;n++){var a;if(void 0!==(r=null!==(a=get(e[n],t))&&void 0!==a?a:void 0))break}if(void 0===r)throw new Error("填充变量".concat(t,"失败"));return r}var o;return null!==(o=get(e,t))&&void 0!==o?o:void 0}function is_empty_for_fallback(e,t,r){return r&&"function"==typeof r._empty_check?r._empty_check(e,t):r&&Array.isArray(r._empty_values)?r._empty_values.some(function(t){return!(!Number.isNaN(t)||!Number.isNaN(e))||e===t}):null==e}function get_fallback_value(e,t,r){for(var n=0;n<t.length;n++){var i=t[n].trim(),a=void 0;try{if(Array.isArray(e))for(var o=0;o<e.length;o++){var s=get(e[o],i);if(void 0!==s){a=s;break}}else a=get(e,i)}catch(e){continue}if(!is_empty_for_fallback(a,i,r))return{value:a,path:i}}throw new Error("多路取值失败,所有路径均为空值: ".concat(t.join(" | ")))}function get_next_nonempty_char(e,t,r){var n;for(t++;t<r;){if(n=e[t],!empty_char_set.has(n))return n;t++}}function split_expr_and_fmt(e){for(var t=0,r=0;r<e.length;r++){var n=e[r];if("("===n)t++;else if(")"===n)t--;else if("|"===n&&0===t){if(r+1<e.length&&"|"===e[r+1]){r++;continue}return{expr:e.slice(0,r),fmt:e.slice(r+1).trim()}}}return{expr:e,fmt:""}}function parse_args(e,t){var r="",n={origin_expr:e,origin_fill_data:t,expr:"",fmt_expr:"",options:void 0,fill_data:void 0,_unit:void 0,_fmt:void 0,_empty_values:void 0,_empty_check:void 0,_vol_units:void 0,_vol_step:void 0,_thousands:void 0};if(null!=t&&(n.options=t,Array.isArray(t)?n.fill_data=t:n.fill_data=[t]),n._fmt=find_value(t,"_fmt"),n._unit=find_value(t,"_unit",!1),n._empty_values=find_value(t,"_empty_values"),n._empty_check=find_value(t,"_empty_check"),n._vol_units=find_value(t,"_vol_units"),n._vol_step=find_value(t,"_vol_step"),n._thousands=find_value(t,"_thousands"),"string"==typeof e){if(r=e,""===e.trim()||e.includes("NaN"))throw new Error("非法的表达式:".concat(e))}else{if("number"!=typeof e)throw new Error("错误的第一个参数类型: ".concat(e," 类型为:").concat(_typeof(e)));if(isNaN(e))throw new Error("传入了一个非法数字NaN");r=e.toString()}var i=split_expr_and_fmt(r),a=i.expr,o=i.fmt;return n.expr=a,n.fmt_expr=o,n}function detect_fallback_var$1(e,t){if("("!==e[t])return null;for(var r=0,n=!1,i=[],a="",o=t;o<e.length;){var s=e[o];if("("===s){if(0===r){r++,o++;continue}r++,a+=s}else if(")"===s){if(0===--r)return n?(i.push(a.trim()),{paths:i,end_index:o}):null;a+=s}else"|"===s&&1===r?(n=!0,i.push(a.trim()),a=""):a+=s;o++}return null}function detect_function_call(e,t,r){for(var n=t;n<e.length&&" "===e[n];)n++;return n<e.length&&"("===e[n]}function parse_function_args(e,t){if("("!==e[t])return null;for(var r=1,n=[],i="",a=t+1;a<e.length&&r>0;){var o=e[a];if("("===o)r++,i+=o;else if(")"===o){if(0===--r)return i.trim()&&n.push(i.trim()),{args:n,end_index:a};i+=o}else","===o&&1===r?(n.push(i.trim()),i=""):i+=o;a++}return null}function push_token$3(e,t){if(t.curr_state===state_number||t.curr_state===state_scientific){var r=t.expr.slice(t.prev_index,t.cur_index);if("+"===r||"-"===r)return e.push({type:state_operator,value:r}),t.curr_state=state_initial,void(t.prev_index=t.cur_index);if(t._unit){var n,i=split_unit_num(r),a=i.num,o=i.unit;if(void 0===o)e.push({type:state_number,value:a,real_value:a,has_unit:!1});else t.has_unit=!0,null!==(n=t.unit_str)&&void 0!==n||(t.unit_str=o),e.push({type:state_number,value:a,real_value:a,has_unit:!0,unit:o})}else e.push({type:state_number,value:r,real_value:r,has_unit:!1})}else if(t.curr_state===state_var){t.has_var=!0;var s=t.expr.slice(t.prev_index,t.cur_index);if("true"===s)e.push({type:"boolean",value:!0});else if("false"===s)e.push({type:"boolean",value:!1});else if(detect_function_call(t.expr,t.cur_index)){for(var _=t.cur_index;_<t.expr.length&&" "===t.expr[_];)_++;var u=parse_function_args(t.expr,_);if(u)return e.push({type:state_function,value:s,args:u.args}),t.cur_index=u.end_index+1,t.prev_index=t.cur_index,void(t.curr_state=state_initial)}else{var c=get_real_value(t.fill_data,s);if("function"==typeof c){for(var l=t.cur_index;l<t.expr.length&&" "===t.expr[l];)l++;if(l<t.expr.length&&"("===t.expr[l]){var p=parse_function_args(t.expr,l);if(p)return e.push({type:state_function,value:s,args:p.args,fn:c}),t.cur_index=p.end_index+1,t.prev_index=t.cur_index,void(t.curr_state=state_initial)}}if(t._unit){var d,f=split_unit_num(c),g=f.num,m=f.unit;if(void 0===m)e.push({type:"var",value:s,real_value:g,has_unit:!1});else t.has_unit=!0,null!==(d=t.unit_str)&&void 0!==d||(t.unit_str=m),e.push({type:"var",value:s,real_value:g,has_unit:!0,unit:m})}else e.push({type:"var",value:s,real_value:c,has_unit:!1})}}else e.push({type:t.curr_state,value:t.expr.slice(t.prev_index,t.cur_index)});t.curr_state=state_initial,t.prev_index=t.cur_index}function tokenizer(e,t,r,n){for(var i,a={has_var:!1,has_unit:!1,unit_str:void 0,fill_data:t,cur_index:0,prev_index:0,curr_state:state_initial,expr:e,_unit:r},o=e.length,s=[];a.cur_index<o;)switch(i=e[a.cur_index],a.curr_state){case state_initial:if(number_char_set.has(i))a.curr_state=state_number,a.cur_index++;else if(" "===i)a.cur_index++,a.prev_index=a.cur_index;else if("+-".includes(i)){var _=s.at(-1);0===a.cur_index||"operator"===(null==_?void 0:_.type)||"comparison"===(null==_?void 0:_.type)||"logical"===(null==_?void 0:_.type)||"logical_not"===(null==_?void 0:_.type)||"ternary_question"===(null==_?void 0:_.type)||"ternary_colon"===(null==_?void 0:_.type)||"("===(null==_?void 0:_.value)||"["===(null==_?void 0:_.value)||","===(null==_?void 0:_.value)?(a.curr_state=state_number,a.cur_index++):(a.cur_index++,s.push({type:state_operator,value:e.slice(a.prev_index,a.cur_index)}),a.prev_index=a.cur_index)}else if("*/%".includes(i))a.curr_state=state_operator,a.cur_index++;else if(">"===i)a.cur_index++,a.cur_index<o&&"="===e[a.cur_index]?(a.cur_index++,s.push({type:state_comparison,value:">="})):s.push({type:state_comparison,value:">"}),a.prev_index=a.cur_index;else if("<"===i)a.cur_index++,a.cur_index<o&&"="===e[a.cur_index]?(a.cur_index++,s.push({type:state_comparison,value:"<="})):s.push({type:state_comparison,value:"<"}),a.prev_index=a.cur_index;else if("="===i&&a.cur_index+1<o&&"="===e[a.cur_index+1])a.cur_index+=2,s.push({type:state_comparison,value:"=="}),a.prev_index=a.cur_index;else if("!"===i&&a.cur_index+1<o&&"="===e[a.cur_index+1])a.cur_index+=2,s.push({type:state_comparison,value:"!="}),a.prev_index=a.cur_index;else if("&"===i&&a.cur_index+1<o&&"&"===e[a.cur_index+1])a.cur_index+=2,s.push({type:state_logical,value:"&&"}),a.prev_index=a.cur_index;else if("|"===i&&a.cur_index+1<o&&"|"===e[a.cur_index+1])a.cur_index+=2,s.push({type:state_logical,value:"||"}),a.prev_index=a.cur_index;else if("!"===i)a.cur_index++,s.push({type:state_logical_not,value:"!"}),a.prev_index=a.cur_index;else if("?"===i)a.cur_index++,s.push({type:state_ternary_question,value:"?"}),a.prev_index=a.cur_index;else if(":"===i)a.cur_index++,s.push({type:state_ternary_colon,value:":"}),a.prev_index=a.cur_index;else if("["===i)a.cur_index++,s.push({type:state_range_start,value:"["}),a.prev_index=a.cur_index;else if("]"===i)a.cur_index++,s.push({type:state_range_end,value:"]"}),a.prev_index=a.cur_index;else if(","===i)a.cur_index++,s.push({type:"comma",value:","}),a.prev_index=a.cur_index;else if(var_char_set.has(i))a.curr_state=state_var,a.cur_index++;else if('"'===i||"'"===i){var u=i;a.cur_index++;for(var c="";a.cur_index<o&&e[a.cur_index]!==u;)"\\"===e[a.cur_index]&&a.cur_index+1<o?(a.cur_index++,c+=e[a.cur_index]):c+=e[a.cur_index],a.cur_index++;a.cur_index++,s.push({type:"string",value:c}),a.prev_index=a.cur_index}else if("("===i){var l=detect_fallback_var$1(e,a.cur_index);if(l){a.has_var=!0;var p=get_fallback_value(t,l.paths,n),d=p.value,f=p.path;if(r){var g,m=split_unit_num(d),v=m.num,h=m.unit;if(void 0!==h)a.has_unit=!0,null!==(g=a.unit_str)&&void 0!==g||(a.unit_str=h),s.push({type:state_fallback_var,value:l.paths,real_value:v,matched_path:f,has_unit:!0,unit:h});else s.push({type:state_fallback_var,value:l.paths,real_value:v,matched_path:f,has_unit:!1})}else s.push({type:state_fallback_var,value:l.paths,real_value:d,matched_path:f,has_unit:!1});a.cur_index=l.end_index+1,a.prev_index=a.cur_index}else s.push({type:state_bracket,value:i}),a.curr_state=state_initial,a.cur_index++,a.prev_index=a.cur_index}else")"===i?(s.push({type:state_bracket,value:i}),a.curr_state=state_initial,a.cur_index++,a.prev_index=a.cur_index):(a.cur_index++,a.prev_index=a.cur_index);break;case state_number:if(number_char_set.has(i))a.cur_index++;else if("."===i){if(a.cur_index===a.prev_index||e.slice(a.prev_index,a.cur_index).includes("."))throw new Error("非法的小数部分".concat(e.slice(a.prev_index,a.cur_index)));a.cur_index++}else"e"===i?(a.curr_state=state_scientific,a.cur_index++):r?"*/+-() ".indexOf(i)>-1||">"===i||"<"===i||"="===i||"!"===i||"&"===i||"|"===i||"?"===i||":"===i||"["===i||"]"===i||","===i||"%"===i&&number_char_set.has(e[a.cur_index-1])&&pure_number_var_first_char_set.has(get_next_nonempty_char(e,a.cur_index,o))?push_token$3(s,a):a.cur_index++:push_token$3(s,a);break;case state_operator:var w=e[a.cur_index-1];"*"===i&&"*"===w?(a.cur_index++,s.push({type:state_operator,value:"**"}),a.prev_index=a.cur_index):"/"===i&&"/"===w?(a.cur_index++,s.push({type:state_operator,value:"//"}),a.prev_index=a.cur_index):(s.push({type:state_operator,value:w}),a.prev_index=a.cur_index),a.curr_state=state_initial;break;case state_var:var_members_char_set.has(i)?a.cur_index++:push_token$3(s,a);break;case state_scientific:if(number_char_set.has(i))a.cur_index++;else if("+-".includes(i)){var b=a.prev_index;"+-".includes(e[b])&&(b+=1);var y=e.slice(b,a.cur_index),x=y.at(-1);y.includes(i)||"e"!==x?push_token$3(s,a):a.cur_index++}else r&&-1==="*/+-() ".indexOf(i)&&">"!==i&&"<"!==i&&"="!==i&&"!"!==i&&"&"!==i&&"|"!==i&&"?"!==i&&":"!==i&&"["!==i&&"]"!==i&&","!==i?a.cur_index++:push_token$3(s,a);break;default:throw new Error("字符扫描状态错误")}return a.prev_index<a.cur_index&&push_token$3(s,a),s.has_var=a.has_var,s.has_unit=a.has_unit,s.unit=a.unit_str,s}
4
4
  /*!
5
5
  * decimal.js v10.6.0
6
6
  * An arbitrary-precision Decimal type for JavaScript.
package/es/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  function _arrayLikeToArray(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n}function _arrayWithHoles(e){if(Array.isArray(e))return e}function _arrayWithoutHoles(e){if(Array.isArray(e))return _arrayLikeToArray(e)}function asyncGeneratorStep(e,t,r,n,i,a,o){try{var s=e[a](o),_=s.value}catch(e){return void r(e)}s.done?t(_):Promise.resolve(_).then(n,i)}function _asyncToGenerator(e){return function(){var t=this,r=arguments;return new Promise(function(n,i){var a=e.apply(t,r);function o(e){asyncGeneratorStep(a,n,i,o,s,"next",e)}function s(e){asyncGeneratorStep(a,n,i,o,s,"throw",e)}o(void 0)})}}function _createForOfIteratorHelper(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=_unsupportedIterableToArray(e))||t){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,o=!0,s=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return o=e.done,e},e:function(e){s=!0,a=e},f:function(){try{o||null==r.return||r.return()}finally{if(s)throw a}}}}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 _iterableToArray(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}function _iterableToArrayLimit(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,i,a,o,s=[],_=!0,u=!1;try{if(a=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;_=!1}else for(;!(_=(n=a.call(r)).done)&&(s.push(n.value),s.length!==t);_=!0);}catch(e){u=!0,i=e}finally{try{if(!_&&null!=r.return&&(o=r.return(),Object(o)!==o))return}finally{if(u)throw i}}return s}}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 _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 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 _regenerator(){
2
2
  /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */
3
- var e,t,r="function"==typeof Symbol?Symbol:{},n=r.iterator||"@@iterator",i=r.toStringTag||"@@toStringTag";function a(r,n,i,a){var _=n&&n.prototype instanceof s?n:s,u=Object.create(_.prototype);return _regeneratorDefine(u,"_invoke",function(r,n,i){var a,s,_,u=0,l=i||[],c=!1,f={p:0,n:0,v:e,a:d,f:d.bind(e,4),d:function(t,r){return a=t,s=0,_=e,f.n=r,o}};function d(r,n){for(s=r,_=n,t=0;!c&&u&&!i&&t<l.length;t++){var i,a=l[t],d=f.p,p=a[2];r>3?(i=p===n)&&(_=a[(s=a[4])?5:(s=3,3)],a[4]=a[5]=e):a[0]<=d&&((i=r<2&&d<a[1])?(s=0,f.v=n,f.n=a[1]):d<p&&(i=r<3||a[0]>n||n>p)&&(a[4]=r,a[5]=n,f.n=p,s=0))}if(i||r>1)return o;throw c=!0,n}return function(i,l,p){if(u>1)throw TypeError("Generator is already running");for(c&&1===l&&d(l,p),s=l,_=p;(t=s<2?e:_)||!c;){a||(s?s<3?(s>1&&(f.n=-1),d(s,_)):f.n=_:f.v=_);try{if(u=2,a){if(s||(i="next"),t=a[i]){if(!(t=t.call(a,_)))throw TypeError("iterator result is not an object");if(!t.done)return t;_=t.value,s<2&&(s=0)}else 1===s&&(t=a.return)&&t.call(a),s<2&&(_=TypeError("The iterator does not provide a '"+i+"' method"),s=1);a=e}else if((t=(c=f.n<0)?_:r.call(n,f))!==o)break}catch(t){a=e,s=1,_=t}finally{u=1}}return{value:t,done:c}}}(r,i,a),!0),u}var o={};function s(){}function _(){}function u(){}t=Object.getPrototypeOf;var l=[][n]?t(t([][n]())):(_regeneratorDefine(t={},n,function(){return this}),t),c=u.prototype=s.prototype=Object.create(l);function f(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,u):(e.__proto__=u,_regeneratorDefine(e,i,"GeneratorFunction")),e.prototype=Object.create(c),e}return _.prototype=u,_regeneratorDefine(c,"constructor",u),_regeneratorDefine(u,"constructor",_),_.displayName="GeneratorFunction",_regeneratorDefine(u,i,"GeneratorFunction"),_regeneratorDefine(c),_regeneratorDefine(c,i,"Generator"),_regeneratorDefine(c,n,function(){return this}),_regeneratorDefine(c,"toString",function(){return"[object Generator]"}),(_regenerator=function(){return{w:a,m:f}})()}function _regeneratorDefine(e,t,r,n){var i=Object.defineProperty;try{i({},"",{})}catch(e){i=0}_regeneratorDefine=function(e,t,r,n){function a(t,r){_regeneratorDefine(e,t,function(e){return this._invoke(t,r,e)})}t?i?i(e,t,{value:r,enumerable:!n,configurable:!n,writable:!n}):e[t]=r:(a("next",0),a("throw",1),a("return",2))},_regeneratorDefine(e,t,r,n)}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 _toPrimitive(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);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:t+""}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 _unsupportedIterableToArray(e,t){if(e){if("string"==typeof e)return _arrayLikeToArray(e,t);var r={}.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}}var version="3.0.0-beta.20250123.5";function decimal_round(e,t,r,n,i){var a=e.startsWith("-"),o=a?e.slice(1):e,s=o,_=t,u=t.length;function l(){s=(+s+1).toString()}var c={"~-":function(){var e="<"===r?n-1:n;_=t.slice(0,e)},"~+":function(){var e="<"===r?n-1:n;if(!(u<=e||0===u)){var i=t.slice(0,e);0===+t.slice(e,u)?_=i:(i=(+"9".concat(i)+1).toString().slice(1)).length>e?(_=i.slice(1,i.length),l()):_=i}},"~5":function(){if(0!==u){var e="<"===r?n-1:n;_=t.slice(0,e);var i=+t[e];Number.isNaN(i)||i>=5&&(_=(+"9".concat(_)+1).toString().slice(1)).length>e&&(_=_.slice(1,_.length),l())}},"~6":function(){if(0!==u){var e,i="<"===r?n-1:n,a=+t[i],s=t.slice(+i+1,t.length);s=""===s?0:parseInt(s),e=0===i?+o[o.length-1]:+t[i-1],_=t.slice(0,i),(a>=6||5===a&&s>0||5===a&&e%2!=0)&&(_=(+"9".concat(_)+1).toString().slice(1)).length>i&&(_=_.slice(1,_.length),l())}}};return"<="===r?u<=n?_=t.replace(/0*$/,""):(c[i]&&c[i](),_=_.replace(/0+$/,"")):"<"===r?u<n?_=t.replace(/0*$/,""):(c[i]&&c[i](),_=_.replace(/0+$/,"")):"="===r?u<n?_=t+"0".repeat(n-u):u>n&&c[i]&&c[i]():">="===r?u<n&&(_=t+"0".repeat(n-u)):">"===r&&u<=n&&(_=t+"0".repeat(n-u+1)),{int_part:a?"-".concat(s):s,dec_part:_}}var number_char="0123456789",var_char="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_$",number_first_char="0123456789-+",var_members_char="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_$[].'\"",var_first_char="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_$",pure_number_var_first_char="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_$",empty_char=" \n\r\t",number_char_set=new Set(number_char),var_char_set=new Set(var_char),var_members_char_set=new Set(var_members_char),var_first_char_set=new Set(var_first_char);new Set(number_first_char);var pure_number_var_first_char_set=new Set(pure_number_var_first_char),empty_char_set=new Set(empty_char),state_initial="initial",state_number="number",state_scientific="scientific",state_operator="operator",state_bracket="bracket",state_var="var",state_symbol="symbol",state_percent="percent",state_round="round",state_plus="plus",state_comma="comma",state_fraction="fraction",state_to_number="to-number",state_to_number_string="to-number-string",state_fallback_var="fallback_var",state_integer_padding="integer_padding",state_volume="volume",state_unit_after="unit_after",state_unit_before="unit_before",state_unit_middle="unit_middle",state_unit_hide="unit_hide",state_unit_default="unit_default",state_thousands="thousands",state_fmt_group="fmt_group",state_comparison="comparison",state_logical="logical",state_logical_not="logical_not",state_ternary_question="ternary_question",state_ternary_colon="ternary_colon",state_function="function",state_range_start="range_start",state_range_end="range_end",state_range_clamp="range_clamp",comparison_operators=new Set([">","<",">=","<=","==","!="]),logical_operators=new Set(["&&","||"]),operator_precedence={"|":0,"?":1,":":1,"||":2,"&&":3,"==":4,"!=":4,">":5,"<":5,">=":5,"<=":5,"+":6,"-":6,"*":7,"/":7,"%":7,"//":7,"**":8,"!":9,"unary-":9,"unary+":9},isArray=Array.isArray,freeGlobal="object"==("undefined"==typeof global?"undefined":_typeof(global))&&global&&global.Object===Object&&global,freeSelf="object"==("undefined"==typeof self?"undefined":_typeof(self))&&self&&self.Object===Object&&self,root=freeGlobal||freeSelf||Function("return this")(),_Symbol=root.Symbol,objectProto$4=Object.prototype,hasOwnProperty$3=objectProto$4.hasOwnProperty,nativeObjectToString$1=objectProto$4.toString,symToStringTag$1=_Symbol?_Symbol.toStringTag:void 0;function getRawTag(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 i=nativeObjectToString$1.call(e);return n&&(t?e[symToStringTag$1]=r:delete e[symToStringTag$1]),i}var objectProto$3=Object.prototype,nativeObjectToString=objectProto$3.toString;function objectToString(e){return nativeObjectToString.call(e)}var nullTag="[object Null]",undefinedTag="[object Undefined]",symToStringTag=_Symbol?_Symbol.toStringTag:void 0;function baseGetTag(e){return null==e?void 0===e?undefinedTag:nullTag:symToStringTag&&symToStringTag in Object(e)?getRawTag(e):objectToString(e)}function isObjectLike(e){return null!=e&&"object"==_typeof(e)}var symbolTag="[object Symbol]";function isSymbol(e){return"symbol"==_typeof(e)||isObjectLike(e)&&baseGetTag(e)==symbolTag}var reIsDeepProp=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,reIsPlainProp=/^\w*$/;function isKey(e,t){if(isArray(e))return!1;var r=_typeof(e);return!("number"!=r&&"symbol"!=r&&"boolean"!=r&&null!=e&&!isSymbol(e))||(reIsPlainProp.test(e)||!reIsDeepProp.test(e)||null!=t&&e in Object(t))}function isObject(e){var t=_typeof(e);return null!=e&&("object"==t||"function"==t)}var asyncTag="[object AsyncFunction]",funcTag="[object Function]",genTag="[object GeneratorFunction]",proxyTag="[object Proxy]";function isFunction(e){if(!isObject(e))return!1;var t=baseGetTag(e);return t==funcTag||t==genTag||t==asyncTag||t==proxyTag}var coreJsData=root["__core-js_shared__"],maskSrcKey=(uid=/[^.]+$/.exec(coreJsData&&coreJsData.keys&&coreJsData.keys.IE_PROTO||""),uid?"Symbol(src)_1."+uid:""),uid;function isMasked(e){return!!maskSrcKey&&maskSrcKey in e}var funcProto$1=Function.prototype,funcToString$1=funcProto$1.toString;function toSource(e){if(null!=e){try{return funcToString$1.call(e)}catch(e){}try{return e+""}catch(e){}}return""}var 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(e){return!(!isObject(e)||isMasked(e))&&(isFunction(e)?reIsNative:reIsHostCtor).test(toSource(e))}function getValue(e,t){return null==e?void 0:e[t]}function getNative(e,t){var r=getValue(e,t);return baseIsNative(r)?r:void 0}var nativeCreate=getNative(Object,"create");function hashClear(){this.__data__=nativeCreate?nativeCreate(null):{},this.size=0}function hashDelete(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var HASH_UNDEFINED$1="__lodash_hash_undefined__",objectProto$1=Object.prototype,hasOwnProperty$1=objectProto$1.hasOwnProperty;function hashGet(e){var t=this.__data__;if(nativeCreate){var r=t[e];return r===HASH_UNDEFINED$1?void 0:r}return hasOwnProperty$1.call(t,e)?t[e]:void 0}var objectProto=Object.prototype,hasOwnProperty=objectProto.hasOwnProperty;function hashHas(e){var t=this.__data__;return nativeCreate?void 0!==t[e]:hasOwnProperty.call(t,e)}var HASH_UNDEFINED="__lodash_hash_undefined__";function hashSet(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=nativeCreate&&void 0===t?HASH_UNDEFINED:t,this}function Hash(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])}}function listCacheClear(){this.__data__=[],this.size=0}function eq(e,t){return e===t||e!=e&&t!=t}function assocIndexOf(e,t){for(var r=e.length;r--;)if(eq(e[r][0],t))return r;return-1}Hash.prototype.clear=hashClear,Hash.prototype.delete=hashDelete,Hash.prototype.get=hashGet,Hash.prototype.has=hashHas,Hash.prototype.set=hashSet;var arrayProto=Array.prototype,splice=arrayProto.splice;function listCacheDelete(e){var t=this.__data__,r=assocIndexOf(t,e);return!(r<0)&&(r==t.length-1?t.pop():splice.call(t,r,1),--this.size,!0)}function listCacheGet(e){var t=this.__data__,r=assocIndexOf(t,e);return r<0?void 0:t[r][1]}function listCacheHas(e){return assocIndexOf(this.__data__,e)>-1}function listCacheSet(e,t){var r=this.__data__,n=assocIndexOf(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this}function ListCache(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.prototype.clear=listCacheClear,ListCache.prototype.delete=listCacheDelete,ListCache.prototype.get=listCacheGet,ListCache.prototype.has=listCacheHas,ListCache.prototype.set=listCacheSet;var Map$1=getNative(root,"Map");function mapCacheClear(){this.size=0,this.__data__={hash:new Hash,map:new(Map$1||ListCache),string:new Hash}}function isKeyable(e){var t=_typeof(e);return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e}function getMapData(e,t){var r=e.__data__;return isKeyable(t)?r["string"==typeof t?"string":"hash"]:r.map}function mapCacheDelete(e){var t=getMapData(this,e).delete(e);return this.size-=t?1:0,t}function mapCacheGet(e){return getMapData(this,e).get(e)}function mapCacheHas(e){return getMapData(this,e).has(e)}function mapCacheSet(e,t){var r=getMapData(this,e),n=r.size;return r.set(e,t),this.size+=r.size==n?0:1,this}function MapCache(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.prototype.clear=mapCacheClear,MapCache.prototype.delete=mapCacheDelete,MapCache.prototype.get=mapCacheGet,MapCache.prototype.has=mapCacheHas,MapCache.prototype.set=mapCacheSet;var FUNC_ERROR_TEXT="Expected a function";function memoize(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError(FUNC_ERROR_TEXT);var r=function(){var n=arguments,i=t?t.apply(this,n):n[0],a=r.cache;if(a.has(i))return a.get(i);var o=e.apply(this,n);return r.cache=a.set(i,o)||a,o};return r.cache=new(memoize.Cache||MapCache),r}memoize.Cache=MapCache;var MAX_MEMOIZE_SIZE=500;function memoizeCapped(e){var t=memoize(e,function(e){return r.size===MAX_MEMOIZE_SIZE&&r.clear(),e}),r=t.cache;return t}var rePropName=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,reEscapeChar=/\\(\\)?/g,stringToPath=memoizeCapped(function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(rePropName,function(e,r,n,i){t.push(n?i.replace(reEscapeChar,"$1"):r||e)}),t});function arrayMap(e,t){for(var r=-1,n=null==e?0:e.length,i=Array(n);++r<n;)i[r]=t(e[r],r,e);return i}var symbolProto=_Symbol?_Symbol.prototype:void 0,symbolToString=symbolProto?symbolProto.toString:void 0;function baseToString(e){if("string"==typeof e)return e;if(isArray(e))return arrayMap(e,baseToString)+"";if(isSymbol(e))return symbolToString?symbolToString.call(e):"";var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function toString(e){return null==e?"":baseToString(e)}function castPath(e,t){return isArray(e)?e:isKey(e,t)?[e]:stringToPath(toString(e))}function toKey(e){if("string"==typeof e||isSymbol(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function baseGet(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}function get(e,t,r){var n=null==e?void 0:baseGet(e,t);return void 0===n?r:n}var REG_UNIT_NUM_SCIENTIFIC=/^([+-]?[\d.]+(?:e|E)(?:\+|-)?\d+)(.*)$/,REG_UNIT_NUM_NORMAL=/^([+-]?[\d.]+)(.*)$/;function split_unit_num(e){var t,r,n=(e="string"!=typeof e?e.toString():e).match(REG_UNIT_NUM_SCIENTIFIC)||e.match(REG_UNIT_NUM_NORMAL);if(n){r=n[1];var i=n[2];""!==i.trim()&&(t=i)}return{num:r,unit:t}}function find_value(e,t,r){var n,i,a,o;return Array.isArray(e)?e.length>1?null!==(n=null!==(i=get(e[0],t))&&void 0!==i?i:get(e.at(-1),t))&&void 0!==n?n:r:1===e.length&&null!==(a=get(e[0],t))&&void 0!==a?a:r:null!==(o=get(e,t,r))&&void 0!==o?o:r}function parse_mantissa(e,t,r,n){var i=e.split("."),a=i[0],o=1===i.length?"":i[1],s=decimal_round(a,o,t,+r,n);return a=s.int_part,""===(o=s.dec_part)?a:"".concat(a,".").concat(o)}function integer_thousands(e){for(var t=e.length,r="";t>0;)r=e.substring(t-3,t)+(""!==r?",":"")+r,t-=3;return r}function parse_thousands(e){var t=e.split("."),r=t[0];return"-"===r[0]?t[0]="-"+integer_thousands(r.slice(1)):t[0]=integer_thousands(r),t.join(".")}function promise_queue(e){return _promise_queue.apply(this,arguments)}function _promise_queue(){return _promise_queue=_asyncToGenerator(_regenerator().m(function e(t){var r,n,i,a=arguments;return _regenerator().w(function(e){for(;;)switch(e.p=e.n){case 0:r=a.length>1&&void 0!==a[1]?a[1]:5e3,n=0;case 1:if(!(n<t.length)){e.n=7;break}return e.p=2,e.n=3,Promise.race([t[n],new Promise(function(e,t){setTimeout(function(){return t(new Error("promise queue timeout err"))},r)})]);case 3:i=e.v,e.n=5;break;case 4:return e.p=4,e.v,e.a(3,6);case 5:return e.a(2,i);case 6:n++,e.n=1;break;case 7:return e.a(2,Promise.reject("错误的 promise queue 调用"))}},e,null,[[2,4]])})),_promise_queue.apply(this,arguments)}function test_urls(e){return _test_urls.apply(this,arguments)}function _test_urls(){return(_test_urls=_asyncToGenerator(_regenerator().m(function e(t){var r;return _regenerator().w(function(e){for(;;)switch(e.p=e.n){case 0:r=0;case 1:if(!(r<t.length)){e.n=7;break}return e.p=2,e.n=3,fetch(t[r]);case 3:if(!e.v.ok){e.n=4;break}return e.a(2,t[r]);case 4:e.n=6;break;case 5:return e.p=5,e.v,e.a(3,6);case 6:r++,e.n=1;break;case 7:return e.a(2,null)}},e,null,[[2,5]])}))).apply(this,arguments)}function get_real_value(e,t){if(Array.isArray(e)){for(var r,n=0,i=e.length;n<i;n++){var a;if(void 0!==(r=null!==(a=get(e[n],t))&&void 0!==a?a:void 0))break}if(void 0===r)throw new Error("填充变量".concat(t,"失败"));return r}var o;return null!==(o=get(e,t))&&void 0!==o?o:void 0}function is_empty_for_fallback(e,t,r){return r&&"function"==typeof r._empty_check?r._empty_check(e,t):r&&Array.isArray(r._empty_values)?r._empty_values.some(function(t){return!(!Number.isNaN(t)||!Number.isNaN(e))||e===t}):null==e}function get_fallback_value(e,t,r){for(var n=0;n<t.length;n++){var i=t[n].trim(),a=void 0;try{if(Array.isArray(e))for(var o=0;o<e.length;o++){var s=get(e[o],i);if(void 0!==s){a=s;break}}else a=get(e,i)}catch(e){continue}if(!is_empty_for_fallback(a,i,r))return{value:a,path:i}}throw new Error("多路取值失败,所有路径均为空值: ".concat(t.join(" | ")))}function get_next_nonempty_char(e,t,r){var n;for(t++;t<r;){if(n=e[t],!empty_char_set.has(n))return n;t++}}function split_expr_and_fmt(e){for(var t=0,r=0;r<e.length;r++){var n=e[r];if("("===n)t++;else if(")"===n)t--;else if("|"===n&&0===t){if(r+1<e.length&&"|"===e[r+1]){r++;continue}return{expr:e.slice(0,r),fmt:e.slice(r+1).trim()}}}return{expr:e,fmt:""}}function parse_args(e,t){var r="",n={origin_expr:e,origin_fill_data:t,expr:"",fmt_expr:"",options:void 0,fill_data:void 0,_unit:void 0,_fmt:void 0,_empty_values:void 0,_empty_check:void 0,_vol_units:void 0,_vol_step:void 0,_thousands:void 0};if(null!=t&&(n.options=t,Array.isArray(t)?n.fill_data=t:n.fill_data=[t]),n._fmt=find_value(t,"_fmt"),n._unit=find_value(t,"_unit",!1),n._empty_values=find_value(t,"_empty_values"),n._empty_check=find_value(t,"_empty_check"),n._vol_units=find_value(t,"_vol_units"),n._vol_step=find_value(t,"_vol_step"),n._thousands=find_value(t,"_thousands"),"string"==typeof e){if(r=e,""===e.trim()||e.includes("NaN"))throw new Error("非法的表达式:".concat(e))}else{if("number"!=typeof e)throw new Error("错误的第一个参数类型: ".concat(e," 类型为:").concat(_typeof(e)));if(isNaN(e))throw new Error("传入了一个非法数字NaN");r=e.toString()}var i=split_expr_and_fmt(r),a=i.expr,o=i.fmt;return n.expr=a,n.fmt_expr=o,n}function detect_fallback_var$1(e,t){if("("!==e[t])return null;for(var r=0,n=!1,i=[],a="",o=t;o<e.length;){var s=e[o];if("("===s){if(0===r){r++,o++;continue}r++,a+=s}else if(")"===s){if(0===--r)return n?(i.push(a.trim()),{paths:i,end_index:o}):null;a+=s}else"|"===s&&1===r?(n=!0,i.push(a.trim()),a=""):a+=s;o++}return null}function detect_function_call(e,t,r){for(var n=t;n<e.length&&" "===e[n];)n++;return n<e.length&&"("===e[n]}function parse_function_args(e,t){if("("!==e[t])return null;for(var r=1,n=[],i="",a=t+1;a<e.length&&r>0;){var o=e[a];if("("===o)r++,i+=o;else if(")"===o){if(0===--r)return i.trim()&&n.push(i.trim()),{args:n,end_index:a};i+=o}else","===o&&1===r?(n.push(i.trim()),i=""):i+=o;a++}return null}function push_token$3(e,t){if(t.curr_state===state_number||t.curr_state===state_scientific){var r=t.expr.slice(t.prev_index,t.cur_index);if("+"===r||"-"===r)return e.push({type:state_operator,value:r}),t.curr_state=state_initial,void(t.prev_index=t.cur_index);if(t._unit){var n,i=split_unit_num(r),a=i.num,o=i.unit;if(void 0===o)e.push({type:state_number,value:a,real_value:a,has_unit:!1});else t.has_unit=!0,null!==(n=t.unit_str)&&void 0!==n||(t.unit_str=o),e.push({type:state_number,value:a,real_value:a,has_unit:!0,unit:o})}else e.push({type:state_number,value:r,real_value:r,has_unit:!1})}else if(t.curr_state===state_var){t.has_var=!0;var s=t.expr.slice(t.prev_index,t.cur_index);if("true"===s)e.push({type:"boolean",value:!0});else if("false"===s)e.push({type:"boolean",value:!1});else if(detect_function_call(t.expr,t.cur_index)){for(var _=t.cur_index;_<t.expr.length&&" "===t.expr[_];)_++;var u=parse_function_args(t.expr,_);if(u)return e.push({type:state_function,value:s,args:u.args}),t.cur_index=u.end_index+1,t.prev_index=t.cur_index,void(t.curr_state=state_initial)}else{var l=get_real_value(t.fill_data,s);if("function"==typeof l){for(var c=t.cur_index;c<t.expr.length&&" "===t.expr[c];)c++;if(c<t.expr.length&&"("===t.expr[c]){var f=parse_function_args(t.expr,c);if(f)return e.push({type:state_function,value:s,args:f.args,fn:l}),t.cur_index=f.end_index+1,t.prev_index=t.cur_index,void(t.curr_state=state_initial)}}if(t._unit){var d,p=split_unit_num(l),g=p.num,m=p.unit;if(void 0===m)e.push({type:"var",value:s,real_value:g,has_unit:!1});else t.has_unit=!0,null!==(d=t.unit_str)&&void 0!==d||(t.unit_str=m),e.push({type:"var",value:s,real_value:g,has_unit:!0,unit:m})}else e.push({type:"var",value:s,real_value:l,has_unit:!1})}}else e.push({type:t.curr_state,value:t.expr.slice(t.prev_index,t.cur_index)});t.curr_state=state_initial,t.prev_index=t.cur_index}function tokenizer(e,t,r,n){for(var i,a={has_var:!1,has_unit:!1,unit_str:void 0,fill_data:t,cur_index:0,prev_index:0,curr_state:state_initial,expr:e,_unit:r},o=e.length,s=[];a.cur_index<o;)switch(i=e[a.cur_index],a.curr_state){case state_initial:if(number_char_set.has(i))a.curr_state=state_number,a.cur_index++;else if(" "===i)a.cur_index++,a.prev_index=a.cur_index;else if("+-".includes(i)){var _=s.at(-1);0===a.cur_index||"operator"===(null==_?void 0:_.type)||"comparison"===(null==_?void 0:_.type)||"logical"===(null==_?void 0:_.type)||"logical_not"===(null==_?void 0:_.type)||"ternary_question"===(null==_?void 0:_.type)||"ternary_colon"===(null==_?void 0:_.type)||"("===(null==_?void 0:_.value)||"["===(null==_?void 0:_.value)||","===(null==_?void 0:_.value)?(a.curr_state=state_number,a.cur_index++):(a.cur_index++,s.push({type:state_operator,value:e.slice(a.prev_index,a.cur_index)}),a.prev_index=a.cur_index)}else if("*/%".includes(i))a.curr_state=state_operator,a.cur_index++;else if(">"===i)a.cur_index++,a.cur_index<o&&"="===e[a.cur_index]?(a.cur_index++,s.push({type:state_comparison,value:">="})):s.push({type:state_comparison,value:">"}),a.prev_index=a.cur_index;else if("<"===i)a.cur_index++,a.cur_index<o&&"="===e[a.cur_index]?(a.cur_index++,s.push({type:state_comparison,value:"<="})):s.push({type:state_comparison,value:"<"}),a.prev_index=a.cur_index;else if("="===i&&a.cur_index+1<o&&"="===e[a.cur_index+1])a.cur_index+=2,s.push({type:state_comparison,value:"=="}),a.prev_index=a.cur_index;else if("!"===i&&a.cur_index+1<o&&"="===e[a.cur_index+1])a.cur_index+=2,s.push({type:state_comparison,value:"!="}),a.prev_index=a.cur_index;else if("&"===i&&a.cur_index+1<o&&"&"===e[a.cur_index+1])a.cur_index+=2,s.push({type:state_logical,value:"&&"}),a.prev_index=a.cur_index;else if("|"===i&&a.cur_index+1<o&&"|"===e[a.cur_index+1])a.cur_index+=2,s.push({type:state_logical,value:"||"}),a.prev_index=a.cur_index;else if("!"===i)a.cur_index++,s.push({type:state_logical_not,value:"!"}),a.prev_index=a.cur_index;else if("?"===i)a.cur_index++,s.push({type:state_ternary_question,value:"?"}),a.prev_index=a.cur_index;else if(":"===i)a.cur_index++,s.push({type:state_ternary_colon,value:":"}),a.prev_index=a.cur_index;else if("["===i)a.cur_index++,s.push({type:state_range_start,value:"["}),a.prev_index=a.cur_index;else if("]"===i)a.cur_index++,s.push({type:state_range_end,value:"]"}),a.prev_index=a.cur_index;else if(","===i)a.cur_index++,s.push({type:"comma",value:","}),a.prev_index=a.cur_index;else if(var_char_set.has(i))a.curr_state=state_var,a.cur_index++;else if('"'===i||"'"===i){var u=i;a.cur_index++;for(var l="";a.cur_index<o&&e[a.cur_index]!==u;)"\\"===e[a.cur_index]&&a.cur_index+1<o?(a.cur_index++,l+=e[a.cur_index]):l+=e[a.cur_index],a.cur_index++;a.cur_index++,s.push({type:"string",value:l}),a.prev_index=a.cur_index}else if("("===i){var c=detect_fallback_var$1(e,a.cur_index);if(c){a.has_var=!0;var f=get_fallback_value(t,c.paths,n),d=f.value,p=f.path;if(r){var g,m=split_unit_num(d),v=m.num,h=m.unit;if(void 0!==h)a.has_unit=!0,null!==(g=a.unit_str)&&void 0!==g||(a.unit_str=h),s.push({type:state_fallback_var,value:c.paths,real_value:v,matched_path:p,has_unit:!0,unit:h});else s.push({type:state_fallback_var,value:c.paths,real_value:v,matched_path:p,has_unit:!1})}else s.push({type:state_fallback_var,value:c.paths,real_value:d,matched_path:p,has_unit:!1});a.cur_index=c.end_index+1,a.prev_index=a.cur_index}else s.push({type:state_bracket,value:i}),a.curr_state=state_initial,a.cur_index++,a.prev_index=a.cur_index}else")"===i?(s.push({type:state_bracket,value:i}),a.curr_state=state_initial,a.cur_index++,a.prev_index=a.cur_index):(a.cur_index++,a.prev_index=a.cur_index);break;case state_number:if(number_char_set.has(i))a.cur_index++;else if("."===i){if(a.cur_index===a.prev_index||e.slice(a.prev_index,a.cur_index).includes("."))throw new Error("非法的小数部分".concat(e.slice(a.prev_index,a.cur_index)));a.cur_index++}else"e"===i?(a.curr_state=state_scientific,a.cur_index++):r?"*/+-() ".indexOf(i)>-1||">"===i||"<"===i||"="===i||"!"===i||"&"===i||"|"===i||"?"===i||":"===i||"["===i||"]"===i||","===i||"%"===i&&number_char_set.has(e[a.cur_index-1])&&pure_number_var_first_char_set.has(get_next_nonempty_char(e,a.cur_index,o))?push_token$3(s,a):a.cur_index++:push_token$3(s,a);break;case state_operator:var w=e[a.cur_index-1];"*"===i&&"*"===w?(a.cur_index++,s.push({type:state_operator,value:"**"}),a.prev_index=a.cur_index):"/"===i&&"/"===w?(a.cur_index++,s.push({type:state_operator,value:"//"}),a.prev_index=a.cur_index):(s.push({type:state_operator,value:w}),a.prev_index=a.cur_index),a.curr_state=state_initial;break;case state_var:var_members_char_set.has(i)?a.cur_index++:push_token$3(s,a);break;case state_scientific:if(number_char_set.has(i))a.cur_index++;else if("+-".includes(i)){var b=a.prev_index;"+-".includes(e[b])&&(b+=1);var y=e.slice(b,a.cur_index),x=y.at(-1);y.includes(i)||"e"!==x?push_token$3(s,a):a.cur_index++}else r&&-1==="*/+-() ".indexOf(i)&&">"!==i&&"<"!==i&&"="!==i&&"!"!==i&&"&"!==i&&"|"!==i&&"?"!==i&&":"!==i&&"["!==i&&"]"!==i&&","!==i?a.cur_index++:push_token$3(s,a);break;default:throw new Error("字符扫描状态错误")}return a.prev_index<a.cur_index&&push_token$3(s,a),s.has_var=a.has_var,s.has_unit=a.has_unit,s.unit=a.unit_str,s}
3
+ var e,t,r="function"==typeof Symbol?Symbol:{},n=r.iterator||"@@iterator",i=r.toStringTag||"@@toStringTag";function a(r,n,i,a){var _=n&&n.prototype instanceof s?n:s,u=Object.create(_.prototype);return _regeneratorDefine(u,"_invoke",function(r,n,i){var a,s,_,u=0,l=i||[],c=!1,f={p:0,n:0,v:e,a:d,f:d.bind(e,4),d:function(t,r){return a=t,s=0,_=e,f.n=r,o}};function d(r,n){for(s=r,_=n,t=0;!c&&u&&!i&&t<l.length;t++){var i,a=l[t],d=f.p,p=a[2];r>3?(i=p===n)&&(_=a[(s=a[4])?5:(s=3,3)],a[4]=a[5]=e):a[0]<=d&&((i=r<2&&d<a[1])?(s=0,f.v=n,f.n=a[1]):d<p&&(i=r<3||a[0]>n||n>p)&&(a[4]=r,a[5]=n,f.n=p,s=0))}if(i||r>1)return o;throw c=!0,n}return function(i,l,p){if(u>1)throw TypeError("Generator is already running");for(c&&1===l&&d(l,p),s=l,_=p;(t=s<2?e:_)||!c;){a||(s?s<3?(s>1&&(f.n=-1),d(s,_)):f.n=_:f.v=_);try{if(u=2,a){if(s||(i="next"),t=a[i]){if(!(t=t.call(a,_)))throw TypeError("iterator result is not an object");if(!t.done)return t;_=t.value,s<2&&(s=0)}else 1===s&&(t=a.return)&&t.call(a),s<2&&(_=TypeError("The iterator does not provide a '"+i+"' method"),s=1);a=e}else if((t=(c=f.n<0)?_:r.call(n,f))!==o)break}catch(t){a=e,s=1,_=t}finally{u=1}}return{value:t,done:c}}}(r,i,a),!0),u}var o={};function s(){}function _(){}function u(){}t=Object.getPrototypeOf;var l=[][n]?t(t([][n]())):(_regeneratorDefine(t={},n,function(){return this}),t),c=u.prototype=s.prototype=Object.create(l);function f(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,u):(e.__proto__=u,_regeneratorDefine(e,i,"GeneratorFunction")),e.prototype=Object.create(c),e}return _.prototype=u,_regeneratorDefine(c,"constructor",u),_regeneratorDefine(u,"constructor",_),_.displayName="GeneratorFunction",_regeneratorDefine(u,i,"GeneratorFunction"),_regeneratorDefine(c),_regeneratorDefine(c,i,"Generator"),_regeneratorDefine(c,n,function(){return this}),_regeneratorDefine(c,"toString",function(){return"[object Generator]"}),(_regenerator=function(){return{w:a,m:f}})()}function _regeneratorDefine(e,t,r,n){var i=Object.defineProperty;try{i({},"",{})}catch(e){i=0}_regeneratorDefine=function(e,t,r,n){function a(t,r){_regeneratorDefine(e,t,function(e){return this._invoke(t,r,e)})}t?i?i(e,t,{value:r,enumerable:!n,configurable:!n,writable:!n}):e[t]=r:(a("next",0),a("throw",1),a("return",2))},_regeneratorDefine(e,t,r,n)}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 _toPrimitive(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);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:t+""}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 _unsupportedIterableToArray(e,t){if(e){if("string"==typeof e)return _arrayLikeToArray(e,t);var r={}.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}}var version="3.0.0-beta.20250123.6";function decimal_round(e,t,r,n,i){var a=e.startsWith("-"),o=a?e.slice(1):e,s=o,_=t,u=t.length;function l(){s=(+s+1).toString()}var c={"~-":function(){var e="<"===r?n-1:n;_=t.slice(0,e)},"~+":function(){var e="<"===r?n-1:n;if(!(u<=e||0===u)){var i=t.slice(0,e);0===+t.slice(e,u)?_=i:(i=(+"9".concat(i)+1).toString().slice(1)).length>e?(_=i.slice(1,i.length),l()):_=i}},"~5":function(){if(0!==u){var e="<"===r?n-1:n;_=t.slice(0,e);var i=+t[e];Number.isNaN(i)||i>=5&&(_=(+"9".concat(_)+1).toString().slice(1)).length>e&&(_=_.slice(1,_.length),l())}},"~6":function(){if(0!==u){var e,i="<"===r?n-1:n,a=+t[i],s=t.slice(+i+1,t.length);s=""===s?0:parseInt(s),e=0===i?+o[o.length-1]:+t[i-1],_=t.slice(0,i),(a>=6||5===a&&s>0||5===a&&e%2!=0)&&(_=(+"9".concat(_)+1).toString().slice(1)).length>i&&(_=_.slice(1,_.length),l())}}};return"<="===r?u<=n?_=t.replace(/0*$/,""):(c[i]&&c[i](),_=_.replace(/0+$/,"")):"<"===r?u<n?_=t.replace(/0*$/,""):(c[i]&&c[i](),_=_.replace(/0+$/,"")):"="===r?u<n?_=t+"0".repeat(n-u):u>n&&c[i]&&c[i]():">="===r?u<n&&(_=t+"0".repeat(n-u)):">"===r&&u<=n&&(_=t+"0".repeat(n-u+1)),{int_part:a?"-".concat(s):s,dec_part:_}}var number_char="0123456789",var_char="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_$",number_first_char="0123456789-+",var_members_char="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_$[].'\"",var_first_char="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_$",pure_number_var_first_char="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_$",empty_char=" \n\r\t",number_char_set=new Set(number_char),var_char_set=new Set(var_char),var_members_char_set=new Set(var_members_char),var_first_char_set=new Set(var_first_char);new Set(number_first_char);var pure_number_var_first_char_set=new Set(pure_number_var_first_char),empty_char_set=new Set(empty_char),state_initial="initial",state_number="number",state_scientific="scientific",state_operator="operator",state_bracket="bracket",state_var="var",state_symbol="symbol",state_percent="percent",state_round="round",state_plus="plus",state_comma="comma",state_fraction="fraction",state_to_number="to-number",state_to_number_string="to-number-string",state_fallback_var="fallback_var",state_integer_padding="integer_padding",state_volume="volume",state_unit_after="unit_after",state_unit_before="unit_before",state_unit_middle="unit_middle",state_unit_hide="unit_hide",state_unit_default="unit_default",state_thousands="thousands",state_fmt_group="fmt_group",state_comparison="comparison",state_logical="logical",state_logical_not="logical_not",state_ternary_question="ternary_question",state_ternary_colon="ternary_colon",state_function="function",state_range_start="range_start",state_range_end="range_end",state_range_clamp="range_clamp",comparison_operators=new Set([">","<",">=","<=","==","!="]),logical_operators=new Set(["&&","||"]),operator_precedence={"|":0,"?":1,":":1,"||":2,"&&":3,"==":4,"!=":4,">":5,"<":5,">=":5,"<=":5,"+":6,"-":6,"*":7,"/":7,"%":7,"//":7,"**":8,"!":9,"unary-":9,"unary+":9},isArray=Array.isArray,freeGlobal="object"==("undefined"==typeof global?"undefined":_typeof(global))&&global&&global.Object===Object&&global,freeSelf="object"==("undefined"==typeof self?"undefined":_typeof(self))&&self&&self.Object===Object&&self,root=freeGlobal||freeSelf||Function("return this")(),_Symbol=root.Symbol,objectProto$4=Object.prototype,hasOwnProperty$3=objectProto$4.hasOwnProperty,nativeObjectToString$1=objectProto$4.toString,symToStringTag$1=_Symbol?_Symbol.toStringTag:void 0;function getRawTag(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 i=nativeObjectToString$1.call(e);return n&&(t?e[symToStringTag$1]=r:delete e[symToStringTag$1]),i}var objectProto$3=Object.prototype,nativeObjectToString=objectProto$3.toString;function objectToString(e){return nativeObjectToString.call(e)}var nullTag="[object Null]",undefinedTag="[object Undefined]",symToStringTag=_Symbol?_Symbol.toStringTag:void 0;function baseGetTag(e){return null==e?void 0===e?undefinedTag:nullTag:symToStringTag&&symToStringTag in Object(e)?getRawTag(e):objectToString(e)}function isObjectLike(e){return null!=e&&"object"==_typeof(e)}var symbolTag="[object Symbol]";function isSymbol(e){return"symbol"==_typeof(e)||isObjectLike(e)&&baseGetTag(e)==symbolTag}var reIsDeepProp=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,reIsPlainProp=/^\w*$/;function isKey(e,t){if(isArray(e))return!1;var r=_typeof(e);return!("number"!=r&&"symbol"!=r&&"boolean"!=r&&null!=e&&!isSymbol(e))||(reIsPlainProp.test(e)||!reIsDeepProp.test(e)||null!=t&&e in Object(t))}function isObject(e){var t=_typeof(e);return null!=e&&("object"==t||"function"==t)}var asyncTag="[object AsyncFunction]",funcTag="[object Function]",genTag="[object GeneratorFunction]",proxyTag="[object Proxy]";function isFunction(e){if(!isObject(e))return!1;var t=baseGetTag(e);return t==funcTag||t==genTag||t==asyncTag||t==proxyTag}var coreJsData=root["__core-js_shared__"],maskSrcKey=(uid=/[^.]+$/.exec(coreJsData&&coreJsData.keys&&coreJsData.keys.IE_PROTO||""),uid?"Symbol(src)_1."+uid:""),uid;function isMasked(e){return!!maskSrcKey&&maskSrcKey in e}var funcProto$1=Function.prototype,funcToString$1=funcProto$1.toString;function toSource(e){if(null!=e){try{return funcToString$1.call(e)}catch(e){}try{return e+""}catch(e){}}return""}var 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(e){return!(!isObject(e)||isMasked(e))&&(isFunction(e)?reIsNative:reIsHostCtor).test(toSource(e))}function getValue(e,t){return null==e?void 0:e[t]}function getNative(e,t){var r=getValue(e,t);return baseIsNative(r)?r:void 0}var nativeCreate=getNative(Object,"create");function hashClear(){this.__data__=nativeCreate?nativeCreate(null):{},this.size=0}function hashDelete(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t}var HASH_UNDEFINED$1="__lodash_hash_undefined__",objectProto$1=Object.prototype,hasOwnProperty$1=objectProto$1.hasOwnProperty;function hashGet(e){var t=this.__data__;if(nativeCreate){var r=t[e];return r===HASH_UNDEFINED$1?void 0:r}return hasOwnProperty$1.call(t,e)?t[e]:void 0}var objectProto=Object.prototype,hasOwnProperty=objectProto.hasOwnProperty;function hashHas(e){var t=this.__data__;return nativeCreate?void 0!==t[e]:hasOwnProperty.call(t,e)}var HASH_UNDEFINED="__lodash_hash_undefined__";function hashSet(e,t){var r=this.__data__;return this.size+=this.has(e)?0:1,r[e]=nativeCreate&&void 0===t?HASH_UNDEFINED:t,this}function Hash(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])}}function listCacheClear(){this.__data__=[],this.size=0}function eq(e,t){return e===t||e!=e&&t!=t}function assocIndexOf(e,t){for(var r=e.length;r--;)if(eq(e[r][0],t))return r;return-1}Hash.prototype.clear=hashClear,Hash.prototype.delete=hashDelete,Hash.prototype.get=hashGet,Hash.prototype.has=hashHas,Hash.prototype.set=hashSet;var arrayProto=Array.prototype,splice=arrayProto.splice;function listCacheDelete(e){var t=this.__data__,r=assocIndexOf(t,e);return!(r<0)&&(r==t.length-1?t.pop():splice.call(t,r,1),--this.size,!0)}function listCacheGet(e){var t=this.__data__,r=assocIndexOf(t,e);return r<0?void 0:t[r][1]}function listCacheHas(e){return assocIndexOf(this.__data__,e)>-1}function listCacheSet(e,t){var r=this.__data__,n=assocIndexOf(r,e);return n<0?(++this.size,r.push([e,t])):r[n][1]=t,this}function ListCache(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.prototype.clear=listCacheClear,ListCache.prototype.delete=listCacheDelete,ListCache.prototype.get=listCacheGet,ListCache.prototype.has=listCacheHas,ListCache.prototype.set=listCacheSet;var Map$1=getNative(root,"Map");function mapCacheClear(){this.size=0,this.__data__={hash:new Hash,map:new(Map$1||ListCache),string:new Hash}}function isKeyable(e){var t=_typeof(e);return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e}function getMapData(e,t){var r=e.__data__;return isKeyable(t)?r["string"==typeof t?"string":"hash"]:r.map}function mapCacheDelete(e){var t=getMapData(this,e).delete(e);return this.size-=t?1:0,t}function mapCacheGet(e){return getMapData(this,e).get(e)}function mapCacheHas(e){return getMapData(this,e).has(e)}function mapCacheSet(e,t){var r=getMapData(this,e),n=r.size;return r.set(e,t),this.size+=r.size==n?0:1,this}function MapCache(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.prototype.clear=mapCacheClear,MapCache.prototype.delete=mapCacheDelete,MapCache.prototype.get=mapCacheGet,MapCache.prototype.has=mapCacheHas,MapCache.prototype.set=mapCacheSet;var FUNC_ERROR_TEXT="Expected a function";function memoize(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError(FUNC_ERROR_TEXT);var r=function(){var n=arguments,i=t?t.apply(this,n):n[0],a=r.cache;if(a.has(i))return a.get(i);var o=e.apply(this,n);return r.cache=a.set(i,o)||a,o};return r.cache=new(memoize.Cache||MapCache),r}memoize.Cache=MapCache;var MAX_MEMOIZE_SIZE=500;function memoizeCapped(e){var t=memoize(e,function(e){return r.size===MAX_MEMOIZE_SIZE&&r.clear(),e}),r=t.cache;return t}var rePropName=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,reEscapeChar=/\\(\\)?/g,stringToPath=memoizeCapped(function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(rePropName,function(e,r,n,i){t.push(n?i.replace(reEscapeChar,"$1"):r||e)}),t});function arrayMap(e,t){for(var r=-1,n=null==e?0:e.length,i=Array(n);++r<n;)i[r]=t(e[r],r,e);return i}var symbolProto=_Symbol?_Symbol.prototype:void 0,symbolToString=symbolProto?symbolProto.toString:void 0;function baseToString(e){if("string"==typeof e)return e;if(isArray(e))return arrayMap(e,baseToString)+"";if(isSymbol(e))return symbolToString?symbolToString.call(e):"";var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function toString(e){return null==e?"":baseToString(e)}function castPath(e,t){return isArray(e)?e:isKey(e,t)?[e]:stringToPath(toString(e))}function toKey(e){if("string"==typeof e||isSymbol(e))return e;var t=e+"";return"0"==t&&1/e==-1/0?"-0":t}function baseGet(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}function get(e,t,r){var n=null==e?void 0:baseGet(e,t);return void 0===n?r:n}var REG_UNIT_NUM_SCIENTIFIC=/^([+-]?[\d.]+(?:e|E)(?:\+|-)?\d+)(.*)$/,REG_UNIT_NUM_NORMAL=/^([+-]?[\d.]+)(.*)$/;function split_unit_num(e){var t,r,n=(e="string"!=typeof e?e.toString():e).match(REG_UNIT_NUM_SCIENTIFIC)||e.match(REG_UNIT_NUM_NORMAL);if(n){r=n[1];var i=n[2];""!==i.trim()&&(t=i)}return{num:r,unit:t}}function find_value(e,t,r){var n,i,a,o;return Array.isArray(e)?e.length>1?null!==(n=null!==(i=get(e[0],t))&&void 0!==i?i:get(e.at(-1),t))&&void 0!==n?n:r:1===e.length&&null!==(a=get(e[0],t))&&void 0!==a?a:r:null!==(o=get(e,t,r))&&void 0!==o?o:r}function parse_mantissa(e,t,r,n){var i=e.split("."),a=i[0],o=1===i.length?"":i[1],s=decimal_round(a,o,t,+r,n);return a=s.int_part,""===(o=s.dec_part)?a:"".concat(a,".").concat(o)}function integer_thousands(e){for(var t=e.length,r="";t>0;)r=e.substring(t-3,t)+(""!==r?",":"")+r,t-=3;return r}function parse_thousands(e){var t=e.split("."),r=t[0];return"-"===r[0]?t[0]="-"+integer_thousands(r.slice(1)):t[0]=integer_thousands(r),t.join(".")}function promise_queue(e){return _promise_queue.apply(this,arguments)}function _promise_queue(){return _promise_queue=_asyncToGenerator(_regenerator().m(function e(t){var r,n,i,a=arguments;return _regenerator().w(function(e){for(;;)switch(e.p=e.n){case 0:r=a.length>1&&void 0!==a[1]?a[1]:5e3,n=0;case 1:if(!(n<t.length)){e.n=7;break}return e.p=2,e.n=3,Promise.race([t[n],new Promise(function(e,t){setTimeout(function(){return t(new Error("promise queue timeout err"))},r)})]);case 3:i=e.v,e.n=5;break;case 4:return e.p=4,e.v,e.a(3,6);case 5:return e.a(2,i);case 6:n++,e.n=1;break;case 7:return e.a(2,Promise.reject("错误的 promise queue 调用"))}},e,null,[[2,4]])})),_promise_queue.apply(this,arguments)}function test_urls(e){return _test_urls.apply(this,arguments)}function _test_urls(){return(_test_urls=_asyncToGenerator(_regenerator().m(function e(t){var r;return _regenerator().w(function(e){for(;;)switch(e.p=e.n){case 0:r=0;case 1:if(!(r<t.length)){e.n=7;break}return e.p=2,e.n=3,fetch(t[r]);case 3:if(!e.v.ok){e.n=4;break}return e.a(2,t[r]);case 4:e.n=6;break;case 5:return e.p=5,e.v,e.a(3,6);case 6:r++,e.n=1;break;case 7:return e.a(2,null)}},e,null,[[2,5]])}))).apply(this,arguments)}function get_real_value(e,t){if(Array.isArray(e)){for(var r,n=0,i=e.length;n<i;n++){var a;if(void 0!==(r=null!==(a=get(e[n],t))&&void 0!==a?a:void 0))break}if(void 0===r)throw new Error("填充变量".concat(t,"失败"));return r}var o;return null!==(o=get(e,t))&&void 0!==o?o:void 0}function is_empty_for_fallback(e,t,r){return r&&"function"==typeof r._empty_check?r._empty_check(e,t):r&&Array.isArray(r._empty_values)?r._empty_values.some(function(t){return!(!Number.isNaN(t)||!Number.isNaN(e))||e===t}):null==e}function get_fallback_value(e,t,r){for(var n=0;n<t.length;n++){var i=t[n].trim(),a=void 0;try{if(Array.isArray(e))for(var o=0;o<e.length;o++){var s=get(e[o],i);if(void 0!==s){a=s;break}}else a=get(e,i)}catch(e){continue}if(!is_empty_for_fallback(a,i,r))return{value:a,path:i}}throw new Error("多路取值失败,所有路径均为空值: ".concat(t.join(" | ")))}function get_next_nonempty_char(e,t,r){var n;for(t++;t<r;){if(n=e[t],!empty_char_set.has(n))return n;t++}}function split_expr_and_fmt(e){for(var t=0,r=0;r<e.length;r++){var n=e[r];if("("===n)t++;else if(")"===n)t--;else if("|"===n&&0===t){if(r+1<e.length&&"|"===e[r+1]){r++;continue}return{expr:e.slice(0,r),fmt:e.slice(r+1).trim()}}}return{expr:e,fmt:""}}function parse_args(e,t){var r="",n={origin_expr:e,origin_fill_data:t,expr:"",fmt_expr:"",options:void 0,fill_data:void 0,_unit:void 0,_fmt:void 0,_empty_values:void 0,_empty_check:void 0,_vol_units:void 0,_vol_step:void 0,_thousands:void 0};if(null!=t&&(n.options=t,Array.isArray(t)?n.fill_data=t:n.fill_data=[t]),n._fmt=find_value(t,"_fmt"),n._unit=find_value(t,"_unit",!1),n._empty_values=find_value(t,"_empty_values"),n._empty_check=find_value(t,"_empty_check"),n._vol_units=find_value(t,"_vol_units"),n._vol_step=find_value(t,"_vol_step"),n._thousands=find_value(t,"_thousands"),"string"==typeof e){if(r=e,""===e.trim()||e.includes("NaN"))throw new Error("非法的表达式:".concat(e))}else{if("number"!=typeof e)throw new Error("错误的第一个参数类型: ".concat(e," 类型为:").concat(_typeof(e)));if(isNaN(e))throw new Error("传入了一个非法数字NaN");r=e.toString()}var i=split_expr_and_fmt(r),a=i.expr,o=i.fmt;return n.expr=a,n.fmt_expr=o,n}function detect_fallback_var$1(e,t){if("("!==e[t])return null;for(var r=0,n=!1,i=[],a="",o=t;o<e.length;){var s=e[o];if("("===s){if(0===r){r++,o++;continue}r++,a+=s}else if(")"===s){if(0===--r)return n?(i.push(a.trim()),{paths:i,end_index:o}):null;a+=s}else"|"===s&&1===r?(n=!0,i.push(a.trim()),a=""):a+=s;o++}return null}function detect_function_call(e,t,r){for(var n=t;n<e.length&&" "===e[n];)n++;return n<e.length&&"("===e[n]}function parse_function_args(e,t){if("("!==e[t])return null;for(var r=1,n=[],i="",a=t+1;a<e.length&&r>0;){var o=e[a];if("("===o)r++,i+=o;else if(")"===o){if(0===--r)return i.trim()&&n.push(i.trim()),{args:n,end_index:a};i+=o}else","===o&&1===r?(n.push(i.trim()),i=""):i+=o;a++}return null}function push_token$3(e,t){if(t.curr_state===state_number||t.curr_state===state_scientific){var r=t.expr.slice(t.prev_index,t.cur_index);if("+"===r||"-"===r)return e.push({type:state_operator,value:r}),t.curr_state=state_initial,void(t.prev_index=t.cur_index);if(t._unit){var n,i=split_unit_num(r),a=i.num,o=i.unit;if(void 0===o)e.push({type:state_number,value:a,real_value:a,has_unit:!1});else t.has_unit=!0,null!==(n=t.unit_str)&&void 0!==n||(t.unit_str=o),e.push({type:state_number,value:a,real_value:a,has_unit:!0,unit:o})}else e.push({type:state_number,value:r,real_value:r,has_unit:!1})}else if(t.curr_state===state_var){t.has_var=!0;var s=t.expr.slice(t.prev_index,t.cur_index);if("true"===s)e.push({type:"boolean",value:!0});else if("false"===s)e.push({type:"boolean",value:!1});else if(detect_function_call(t.expr,t.cur_index)){for(var _=t.cur_index;_<t.expr.length&&" "===t.expr[_];)_++;var u=parse_function_args(t.expr,_);if(u)return e.push({type:state_function,value:s,args:u.args}),t.cur_index=u.end_index+1,t.prev_index=t.cur_index,void(t.curr_state=state_initial)}else{var l=get_real_value(t.fill_data,s);if("function"==typeof l){for(var c=t.cur_index;c<t.expr.length&&" "===t.expr[c];)c++;if(c<t.expr.length&&"("===t.expr[c]){var f=parse_function_args(t.expr,c);if(f)return e.push({type:state_function,value:s,args:f.args,fn:l}),t.cur_index=f.end_index+1,t.prev_index=t.cur_index,void(t.curr_state=state_initial)}}if(t._unit){var d,p=split_unit_num(l),g=p.num,m=p.unit;if(void 0===m)e.push({type:"var",value:s,real_value:g,has_unit:!1});else t.has_unit=!0,null!==(d=t.unit_str)&&void 0!==d||(t.unit_str=m),e.push({type:"var",value:s,real_value:g,has_unit:!0,unit:m})}else e.push({type:"var",value:s,real_value:l,has_unit:!1})}}else e.push({type:t.curr_state,value:t.expr.slice(t.prev_index,t.cur_index)});t.curr_state=state_initial,t.prev_index=t.cur_index}function tokenizer(e,t,r,n){for(var i,a={has_var:!1,has_unit:!1,unit_str:void 0,fill_data:t,cur_index:0,prev_index:0,curr_state:state_initial,expr:e,_unit:r},o=e.length,s=[];a.cur_index<o;)switch(i=e[a.cur_index],a.curr_state){case state_initial:if(number_char_set.has(i))a.curr_state=state_number,a.cur_index++;else if(" "===i)a.cur_index++,a.prev_index=a.cur_index;else if("+-".includes(i)){var _=s.at(-1);0===a.cur_index||"operator"===(null==_?void 0:_.type)||"comparison"===(null==_?void 0:_.type)||"logical"===(null==_?void 0:_.type)||"logical_not"===(null==_?void 0:_.type)||"ternary_question"===(null==_?void 0:_.type)||"ternary_colon"===(null==_?void 0:_.type)||"("===(null==_?void 0:_.value)||"["===(null==_?void 0:_.value)||","===(null==_?void 0:_.value)?(a.curr_state=state_number,a.cur_index++):(a.cur_index++,s.push({type:state_operator,value:e.slice(a.prev_index,a.cur_index)}),a.prev_index=a.cur_index)}else if("*/%".includes(i))a.curr_state=state_operator,a.cur_index++;else if(">"===i)a.cur_index++,a.cur_index<o&&"="===e[a.cur_index]?(a.cur_index++,s.push({type:state_comparison,value:">="})):s.push({type:state_comparison,value:">"}),a.prev_index=a.cur_index;else if("<"===i)a.cur_index++,a.cur_index<o&&"="===e[a.cur_index]?(a.cur_index++,s.push({type:state_comparison,value:"<="})):s.push({type:state_comparison,value:"<"}),a.prev_index=a.cur_index;else if("="===i&&a.cur_index+1<o&&"="===e[a.cur_index+1])a.cur_index+=2,s.push({type:state_comparison,value:"=="}),a.prev_index=a.cur_index;else if("!"===i&&a.cur_index+1<o&&"="===e[a.cur_index+1])a.cur_index+=2,s.push({type:state_comparison,value:"!="}),a.prev_index=a.cur_index;else if("&"===i&&a.cur_index+1<o&&"&"===e[a.cur_index+1])a.cur_index+=2,s.push({type:state_logical,value:"&&"}),a.prev_index=a.cur_index;else if("|"===i&&a.cur_index+1<o&&"|"===e[a.cur_index+1])a.cur_index+=2,s.push({type:state_logical,value:"||"}),a.prev_index=a.cur_index;else if("!"===i)a.cur_index++,s.push({type:state_logical_not,value:"!"}),a.prev_index=a.cur_index;else if("?"===i)a.cur_index++,s.push({type:state_ternary_question,value:"?"}),a.prev_index=a.cur_index;else if(":"===i)a.cur_index++,s.push({type:state_ternary_colon,value:":"}),a.prev_index=a.cur_index;else if("["===i)a.cur_index++,s.push({type:state_range_start,value:"["}),a.prev_index=a.cur_index;else if("]"===i)a.cur_index++,s.push({type:state_range_end,value:"]"}),a.prev_index=a.cur_index;else if(","===i)a.cur_index++,s.push({type:"comma",value:","}),a.prev_index=a.cur_index;else if(var_char_set.has(i))a.curr_state=state_var,a.cur_index++;else if('"'===i||"'"===i){var u=i;a.cur_index++;for(var l="";a.cur_index<o&&e[a.cur_index]!==u;)"\\"===e[a.cur_index]&&a.cur_index+1<o?(a.cur_index++,l+=e[a.cur_index]):l+=e[a.cur_index],a.cur_index++;a.cur_index++,s.push({type:"string",value:l}),a.prev_index=a.cur_index}else if("("===i){var c=detect_fallback_var$1(e,a.cur_index);if(c){a.has_var=!0;var f=get_fallback_value(t,c.paths,n),d=f.value,p=f.path;if(r){var g,m=split_unit_num(d),v=m.num,h=m.unit;if(void 0!==h)a.has_unit=!0,null!==(g=a.unit_str)&&void 0!==g||(a.unit_str=h),s.push({type:state_fallback_var,value:c.paths,real_value:v,matched_path:p,has_unit:!0,unit:h});else s.push({type:state_fallback_var,value:c.paths,real_value:v,matched_path:p,has_unit:!1})}else s.push({type:state_fallback_var,value:c.paths,real_value:d,matched_path:p,has_unit:!1});a.cur_index=c.end_index+1,a.prev_index=a.cur_index}else s.push({type:state_bracket,value:i}),a.curr_state=state_initial,a.cur_index++,a.prev_index=a.cur_index}else")"===i?(s.push({type:state_bracket,value:i}),a.curr_state=state_initial,a.cur_index++,a.prev_index=a.cur_index):(a.cur_index++,a.prev_index=a.cur_index);break;case state_number:if(number_char_set.has(i))a.cur_index++;else if("."===i){if(a.cur_index===a.prev_index||e.slice(a.prev_index,a.cur_index).includes("."))throw new Error("非法的小数部分".concat(e.slice(a.prev_index,a.cur_index)));a.cur_index++}else"e"===i?(a.curr_state=state_scientific,a.cur_index++):r?"*/+-() ".indexOf(i)>-1||">"===i||"<"===i||"="===i||"!"===i||"&"===i||"|"===i||"?"===i||":"===i||"["===i||"]"===i||","===i||"%"===i&&number_char_set.has(e[a.cur_index-1])&&pure_number_var_first_char_set.has(get_next_nonempty_char(e,a.cur_index,o))?push_token$3(s,a):a.cur_index++:push_token$3(s,a);break;case state_operator:var w=e[a.cur_index-1];"*"===i&&"*"===w?(a.cur_index++,s.push({type:state_operator,value:"**"}),a.prev_index=a.cur_index):"/"===i&&"/"===w?(a.cur_index++,s.push({type:state_operator,value:"//"}),a.prev_index=a.cur_index):(s.push({type:state_operator,value:w}),a.prev_index=a.cur_index),a.curr_state=state_initial;break;case state_var:var_members_char_set.has(i)?a.cur_index++:push_token$3(s,a);break;case state_scientific:if(number_char_set.has(i))a.cur_index++;else if("+-".includes(i)){var b=a.prev_index;"+-".includes(e[b])&&(b+=1);var y=e.slice(b,a.cur_index),x=y.at(-1);y.includes(i)||"e"!==x?push_token$3(s,a):a.cur_index++}else r&&-1==="*/+-() ".indexOf(i)&&">"!==i&&"<"!==i&&"="!==i&&"!"!==i&&"&"!==i&&"|"!==i&&"?"!==i&&":"!==i&&"["!==i&&"]"!==i&&","!==i?a.cur_index++:push_token$3(s,a);break;default:throw new Error("字符扫描状态错误")}return a.prev_index<a.cur_index&&push_token$3(s,a),s.has_var=a.has_var,s.has_unit=a.has_unit,s.unit=a.unit_str,s}
4
4
  /*!
5
5
  * decimal.js v10.6.0
6
6
  * An arbitrary-precision Decimal type for JavaScript.
@@ -7,6 +7,8 @@ import {
7
7
  ListToolsRequestSchema,
8
8
  ListResourcesRequestSchema,
9
9
  ReadResourceRequestSchema,
10
+ ListPromptsRequestSchema,
11
+ GetPromptRequestSchema,
10
12
  } from "@modelcontextprotocol/sdk/types.js";
11
13
 
12
14
  import {
@@ -803,6 +805,301 @@ cmul(99.9, 3) // 单价 * 数量
803
805
  `
804
806
  };
805
807
 
808
+ // ==================== Prompts 定义 ====================
809
+
810
+ const PROMPTS = [
811
+ {
812
+ name: "use-acalc-for-calculations",
813
+ description: "强制要求在所有数值计算场景中使用 a-calc 工具",
814
+ arguments: [],
815
+ },
816
+ {
817
+ name: "shopping-cart-with-acalc",
818
+ description: "使用 a-calc 实现购物车计算的最佳实践",
819
+ arguments: [],
820
+ },
821
+ {
822
+ name: "financial-calculations",
823
+ description: "使用 a-calc 进行金融和价格计算的指南",
824
+ arguments: [],
825
+ },
826
+ ];
827
+
828
+ const PROMPT_CONTENTS = {
829
+ "use-acalc-for-calculations": {
830
+ messages: [
831
+ {
832
+ role: "user",
833
+ content: {
834
+ type: "text",
835
+ text: `# 数值计算强制规则
836
+
837
+ ⚠️ **重要:在本次对话中,所有数值计算必须使用 a-calc MCP 工具!**
838
+
839
+ ## 强制使用场景
840
+
841
+ ### 1. 任何涉及小数的运算(必须使用)
842
+ - ✅ 使用 calc("0.1 + 0.2")
843
+ - ❌ 不要直接计算 0.1 + 0.2
844
+
845
+ ### 2. 价格和金额计算(必须使用)
846
+ - ✅ 使用 calc("price * qty | =2", {price: 99.9, qty: 3})
847
+ - ❌ 不要使用 JavaScript 的 * 运算符
848
+
849
+ ### 3. 百分比和折扣计算(必须使用)
850
+ - ✅ 使用 calc("price * 0.9 | =2", {price: 100})
851
+ - ❌ 不要直接计算
852
+
853
+ ### 4. 需要格式化的数值(必须使用)
854
+ - ✅ 使用 fmt(1234567, ",") 或 calc("value | ,", {value: 1234567})
855
+ - ❌ 不要使用 toLocaleString()
856
+
857
+ ### 5. 批量数据计算(必须使用)
858
+ - ✅ 使用 calc_sum("price * qty", items)
859
+ - ❌ 不要使用 reduce() 手动计算
860
+
861
+ ## 可以不使用的场景
862
+
863
+ 只有以下情况可以不使用 a-calc:
864
+ - 简单的整数加减:1 + 1, 10 - 5
865
+ - 数组长度、索引等非计算场景
866
+
867
+ ## 为什么必须使用 a-calc?
868
+
869
+ JavaScript 的浮点数精度问题:
870
+ - 0.1 + 0.2 = 0.30000000000000004 ❌
871
+ - 0.3 - 0.1 = 0.19999999999999998 ❌
872
+ - 99.9 * 3 = 299.70000000000005 ❌
873
+
874
+ 使用 a-calc 后:
875
+ - calc("0.1 + 0.2") = "0.3" ✅
876
+ - calc("0.3 - 0.1") = "0.2" ✅
877
+ - calc("99.9 * 3") = "299.7" ✅
878
+
879
+ ## 实施要求
880
+
881
+ 在编写代码时:
882
+ 1. 遇到数值计算,立即考虑是否需要使用 a-calc
883
+ 2. 涉及小数、金额、价格的,必须使用 a-calc
884
+ 3. 在代码注释中说明为什么使用 a-calc
885
+ 4. 优先使用 calc() 函数,它最灵活
886
+
887
+ 请确认你理解并将严格遵守这些规则。`,
888
+ },
889
+ },
890
+ ],
891
+ },
892
+ "shopping-cart-with-acalc": {
893
+ messages: [
894
+ {
895
+ role: "user",
896
+ content: {
897
+ type: "text",
898
+ text: `# 使用 a-calc 实现购物车的最佳实践
899
+
900
+ ## 核心原则
901
+
902
+ 购物车涉及大量价格计算,必须使用 a-calc 确保精度正确。
903
+
904
+ ## 典型场景和实现
905
+
906
+ ### 1. 单个商品小计
907
+
908
+ \`\`\`javascript
909
+ import { calc } from 'a-calc';
910
+
911
+ function calculateItemTotal(price, quantity) {
912
+ // 使用 a-calc 计算小计,保留2位小数
913
+ return calc("price * qty | =2", { price, qty: quantity });
914
+ }
915
+
916
+ // 示例
917
+ calculateItemTotal(99.9, 3); // "299.70"
918
+ \`\`\`
919
+
920
+ ### 2. 购物车总价
921
+
922
+ \`\`\`javascript
923
+ import { calc_sum } from 'a-calc';
924
+
925
+ function calculateCartTotal(items) {
926
+ // 使用 calc_sum 批量计算并求和
927
+ return calc_sum("price * qty | =2", items);
928
+ }
929
+
930
+ // 示例
931
+ const cart = [
932
+ { price: 99.9, qty: 2 },
933
+ { price: 49.9, qty: 3 },
934
+ { price: 199, qty: 1 }
935
+ ];
936
+ calculateCartTotal(cart); // "548.50"
937
+ \`\`\`
938
+
939
+ ### 3. 应用折扣
940
+
941
+ \`\`\`javascript
942
+ import { calc } from 'a-calc';
943
+
944
+ function applyDiscount(total, discountRate) {
945
+ // 计算折扣后价格
946
+ return calc("total * (1 - discount) | =2", {
947
+ total,
948
+ discount: discountRate
949
+ });
950
+ }
951
+
952
+ // 示例
953
+ applyDiscount(548.50, 0.1); // "493.65" (9折)
954
+ \`\`\`
955
+
956
+ ### 4. 含税价格
957
+
958
+ \`\`\`javascript
959
+ import { calc } from 'a-calc';
960
+
961
+ function calculateWithTax(subtotal, taxRate) {
962
+ // 计算含税总价
963
+ return calc("subtotal * (1 + tax) | =2", {
964
+ subtotal,
965
+ tax: taxRate
966
+ });
967
+ }
968
+
969
+ // 示例
970
+ calculateWithTax(493.65, 0.13); // "557.82"
971
+ \`\`\`
972
+
973
+ ### 5. 完整购物车组件示例
974
+
975
+ \`\`\`javascript
976
+ import { calc, calc_sum } from 'a-calc';
977
+
978
+ class ShoppingCart {
979
+ constructor() {
980
+ this.items = [];
981
+ }
982
+
983
+ addItem(product, quantity) {
984
+ this.items.push({
985
+ ...product,
986
+ qty: quantity,
987
+ // 使用 a-calc 计算小计
988
+ subtotal: calc("price * qty | =2", {
989
+ price: product.price,
990
+ qty: quantity
991
+ })
992
+ });
993
+ }
994
+
995
+ getTotal() {
996
+ // 使用 calc_sum 计算总价
997
+ return calc_sum("price * qty | =2", this.items);
998
+ }
999
+
1000
+ applyDiscount(code) {
1001
+ const total = this.getTotal();
1002
+ const discountRate = this.getDiscountRate(code);
1003
+
1004
+ // 使用 a-calc 计算折扣后价格
1005
+ return calc("total * (1 - rate) | =2", {
1006
+ total,
1007
+ rate: discountRate
1008
+ });
1009
+ }
1010
+
1011
+ getFinalPrice(taxRate = 0.13) {
1012
+ const discountedTotal = this.applyDiscount();
1013
+
1014
+ // 使用 a-calc 计算含税最终价格
1015
+ return calc("total * (1 + tax) | =2", {
1016
+ total: discountedTotal,
1017
+ tax: taxRate
1018
+ });
1019
+ }
1020
+ }
1021
+ \`\`\`
1022
+
1023
+ ## 关键要点
1024
+
1025
+ 1. **所有价格计算都使用 a-calc** - 避免精度问题
1026
+ 2. **使用 calc_sum 处理数组** - 批量计算更高效
1027
+ 3. **保留2位小数** - 使用 \`| =2\` 格式化
1028
+ 4. **添加千分位** - 使用 \`| =2,\` 格式化显示
1029
+
1030
+ ## 常见错误
1031
+
1032
+ ❌ **错误做法**:
1033
+ \`\`\`javascript
1034
+ const total = items.reduce((sum, item) => sum + item.price * item.qty, 0);
1035
+ // 精度问题!
1036
+ \`\`\`
1037
+
1038
+ ✅ **正确做法**:
1039
+ \`\`\`javascript
1040
+ const total = calc_sum("price * qty", items);
1041
+ // 精确计算!
1042
+ \`\`\`
1043
+
1044
+ 请在实现购物车时严格遵循这些最佳实践。`,
1045
+ },
1046
+ },
1047
+ ],
1048
+ },
1049
+ "financial-calculations": {
1050
+ messages: [
1051
+ {
1052
+ role: "user",
1053
+ content: {
1054
+ type: "text",
1055
+ text: `# 金融和价格计算最佳实践
1056
+
1057
+ 使用 a-calc 进行金融计算,确保精度和合规性。
1058
+
1059
+ ## 常见场景
1060
+
1061
+ ### 1. 利息计算
1062
+ \`\`\`javascript
1063
+ import { calc } from 'a-calc';
1064
+
1065
+ // 单利
1066
+ calc("principal * rate * time | =2", {
1067
+ principal: 10000,
1068
+ rate: 0.05,
1069
+ time: 2
1070
+ }); // "1000.00"
1071
+
1072
+ // 复利
1073
+ calc("principal * pow(1 + rate, time) - principal | =2", {
1074
+ principal: 10000,
1075
+ rate: 0.05,
1076
+ time: 2
1077
+ }); // "1025.00"
1078
+ \`\`\`
1079
+
1080
+ ### 2. 汇率转换
1081
+ \`\`\`javascript
1082
+ calc("amount * rate | =2", {
1083
+ amount: 1000,
1084
+ rate: 6.45
1085
+ }); // "6450.00"
1086
+ \`\`\`
1087
+
1088
+ ### 3. 投资回报率
1089
+ \`\`\`javascript
1090
+ calc("(final - initial) / initial * 100 | =2%", {
1091
+ final: 11000,
1092
+ initial: 10000
1093
+ }); // "10.00%"
1094
+ \`\`\`
1095
+
1096
+ 请在所有金融计算中使用 a-calc。`,
1097
+ },
1098
+ },
1099
+ ],
1100
+ },
1101
+ };
1102
+
806
1103
  // ==================== Server Setup ====================
807
1104
 
808
1105
  const server = new Server(
@@ -814,6 +1111,7 @@ const server = new Server(
814
1111
  capabilities: {
815
1112
  tools: {},
816
1113
  resources: {},
1114
+ prompts: {},
817
1115
  },
818
1116
  }
819
1117
  );
@@ -1060,6 +1358,22 @@ server.setRequestHandler(ReadResourceRequestSchema, async (request) => {
1060
1358
  throw new Error(`Resource not found: ${uri}`);
1061
1359
  });
1062
1360
 
1361
+ // ==================== Prompt Handlers ====================
1362
+
1363
+ server.setRequestHandler(ListPromptsRequestSchema, async () => {
1364
+ return { prompts: PROMPTS };
1365
+ });
1366
+
1367
+ server.setRequestHandler(GetPromptRequestSchema, async (request) => {
1368
+ const { name } = request.params;
1369
+
1370
+ if (PROMPT_CONTENTS[name]) {
1371
+ return PROMPT_CONTENTS[name];
1372
+ }
1373
+
1374
+ throw new Error(`Prompt not found: ${name}`);
1375
+ });
1376
+
1063
1377
  // ==================== Start Server ====================
1064
1378
 
1065
1379
  async function main() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "a-calc",
3
- "version": "3.0.0-beta.20250123.5",
3
+ "version": "3.0.0-beta.20250123.6",
4
4
  "description": "A very powerful and easy-to-use number precision calculation and formatting library.",
5
5
  "main": "./cjs/index.js",
6
6
  "exports": {