@ywfe/fe-tools 1.2.1-beta.16 → 1.2.1-beta.17

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,4 +1,4 @@
1
- !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).YWTOOLS={})}(this,(function(e){"use strict";function t(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(e){try{u(n.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}u((n=n.apply(e,t||[])).next())}))}function r(e,t){var r,n,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(a){return function(u){return function(a){if(r)throw new TypeError("Generator is already executing.");for(;o&&(o=0,a[0]&&(s=0)),s;)try{if(r=1,n&&(i=2&a[0]?n.return:a[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,a[1])).done)return i;switch(n=0,i&&(a=[2&a[0],i.value]),a[0]){case 0:case 1:i=a;break;case 4:return s.label++,{value:a[1],done:!1};case 5:s.label++,n=a[1],a=[0];continue;case 7:a=s.ops.pop(),s.trys.pop();continue;default:if(!(i=s.trys,(i=i.length>0&&i[i.length-1])||6!==a[0]&&2!==a[0])){s=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]<i[3])){s.label=a[1];break}if(6===a[0]&&s.label<i[1]){s.label=i[1],i=a;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(a);break}i[2]&&s.ops.pop(),s.trys.pop();continue}a=t.call(e,s)}catch(e){a=[6,e],n=0}finally{r=i=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,u])}}}"function"==typeof SuppressedError&&SuppressedError;var n="undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{},i=[],o=[],s="undefined"!=typeof Uint8Array?Uint8Array:Array,a=!1;function u(){a=!0;for(var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",t=0;t<64;++t)i[t]=e[t],o[e.charCodeAt(t)]=t;o["-".charCodeAt(0)]=62,o["_".charCodeAt(0)]=63}function c(e,t,r){for(var n,o,s=[],a=t;a<r;a+=3)n=(e[a]<<16)+(e[a+1]<<8)+e[a+2],s.push(i[(o=n)>>18&63]+i[o>>12&63]+i[o>>6&63]+i[63&o]);return s.join("")}function f(e){var t;a||u();for(var r=e.length,n=r%3,o="",s=[],f=16383,l=0,h=r-n;l<h;l+=f)s.push(c(e,l,l+f>h?h:l+f));return 1===n?(t=e[r-1],o+=i[t>>2],o+=i[t<<4&63],o+="=="):2===n&&(t=(e[r-2]<<8)+e[r-1],o+=i[t>>10],o+=i[t>>4&63],o+=i[t<<2&63],o+="="),s.push(o),s.join("")}function l(e,t,r,n,i){var o,s,a=8*i-n-1,u=(1<<a)-1,c=u>>1,f=-7,l=r?i-1:0,h=r?-1:1,p=e[t+l];for(l+=h,o=p&(1<<-f)-1,p>>=-f,f+=a;f>0;o=256*o+e[t+l],l+=h,f-=8);for(s=o&(1<<-f)-1,o>>=-f,f+=n;f>0;s=256*s+e[t+l],l+=h,f-=8);if(0===o)o=1-c;else{if(o===u)return s?NaN:1/0*(p?-1:1);s+=Math.pow(2,n),o-=c}return(p?-1:1)*s*Math.pow(2,o-n)}function h(e,t,r,n,i,o){var s,a,u,c=8*o-i-1,f=(1<<c)-1,l=f>>1,h=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,p=n?0:o-1,d=n?1:-1,m=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(a=isNaN(t)?1:0,s=f):(s=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-s))<1&&(s--,u*=2),(t+=s+l>=1?h/u:h*Math.pow(2,1-l))*u>=2&&(s++,u/=2),s+l>=f?(a=0,s=f):s+l>=1?(a=(t*u-1)*Math.pow(2,i),s+=l):(a=t*Math.pow(2,l-1)*Math.pow(2,i),s=0));i>=8;e[r+p]=255&a,p+=d,a/=256,i-=8);for(s=s<<i|a,c+=i;c>0;e[r+p]=255&s,p+=d,s/=256,c-=8);e[r+p-d]|=128*m}var p={}.toString,d=Array.isArray||function(e){return"[object Array]"==p.call(e)};function m(){return y.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function g(e,t){if(m()<t)throw new RangeError("Invalid typed array length");return y.TYPED_ARRAY_SUPPORT?(e=new Uint8Array(t)).__proto__=y.prototype:(null===e&&(e=new y(t)),e.length=t),e}function y(e,t,r){if(!(y.TYPED_ARRAY_SUPPORT||this instanceof y))return new y(e,t,r);if("number"==typeof e){if("string"==typeof t)throw new Error("If encoding is specified then the first argument must be a string");return b(this,e)}return w(this,e,t,r)}function w(e,t,r,n){if("number"==typeof t)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&t instanceof ArrayBuffer?function(e,t,r,n){if(t.byteLength,r<0||t.byteLength<r)throw new RangeError("'offset' is out of bounds");if(t.byteLength<r+(n||0))throw new RangeError("'length' is out of bounds");t=void 0===r&&void 0===n?new Uint8Array(t):void 0===n?new Uint8Array(t,r):new Uint8Array(t,r,n);y.TYPED_ARRAY_SUPPORT?(e=t).__proto__=y.prototype:e=x(e,t);return e}(e,t,r,n):"string"==typeof t?function(e,t,r){"string"==typeof r&&""!==r||(r="utf8");if(!y.isEncoding(r))throw new TypeError('"encoding" must be a valid string encoding');var n=0|S(t,r);e=g(e,n);var i=e.write(t,r);i!==n&&(e=e.slice(0,i));return e}(e,t,r):function(e,t){if(E(t)){var r=0|k(t.length);return 0===(e=g(e,r)).length||t.copy(e,0,0,r),e}if(t){if("undefined"!=typeof ArrayBuffer&&t.buffer instanceof ArrayBuffer||"length"in t)return"number"!=typeof t.length||(n=t.length)!=n?g(e,0):x(e,t);if("Buffer"===t.type&&d(t.data))return x(e,t.data)}var n;throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(e,t)}function v(e){if("number"!=typeof e)throw new TypeError('"size" argument must be a number');if(e<0)throw new RangeError('"size" argument must not be negative')}function b(e,t){if(v(t),e=g(e,t<0?0:0|k(t)),!y.TYPED_ARRAY_SUPPORT)for(var r=0;r<t;++r)e[r]=0;return e}function x(e,t){var r=t.length<0?0:0|k(t.length);e=g(e,r);for(var n=0;n<r;n+=1)e[n]=255&t[n];return e}function k(e){if(e>=m())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+m().toString(16)+" bytes");return 0|e}function E(e){return!(null==e||!e._isBuffer)}function S(e,t){if(E(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!=typeof e&&(e=""+e);var r=e.length;if(0===r)return 0;for(var n=!1;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return Q(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return X(e).length;default:if(n)return Q(e).length;t=(""+t).toLowerCase(),n=!0}}function T(e,t,r){var n=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return D(this,t,r);case"utf8":case"utf-8":return R(this,t,r);case"ascii":return F(this,t,r);case"latin1":case"binary":return L(this,t,r);case"base64":return P(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return C(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}function _(e,t,r){var n=e[t];e[t]=e[r],e[r]=n}function A(e,t,r,n,i){if(0===e.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,isNaN(r)&&(r=i?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(i)return-1;r=e.length-1}else if(r<0){if(!i)return-1;r=0}if("string"==typeof t&&(t=y.from(t,n)),E(t))return 0===t.length?-1:O(e,t,r,n,i);if("number"==typeof t)return t&=255,y.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):O(e,[t],r,n,i);throw new TypeError("val must be string, number or Buffer")}function O(e,t,r,n,i){var o,s=1,a=e.length,u=t.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return-1;s=2,a/=2,u/=2,r/=2}function c(e,t){return 1===s?e[t]:e.readUInt16BE(t*s)}if(i){var f=-1;for(o=r;o<a;o++)if(c(e,o)===c(t,-1===f?0:o-f)){if(-1===f&&(f=o),o-f+1===u)return f*s}else-1!==f&&(o-=o-f),f=-1}else for(r+u>a&&(r=a-u),o=r;o>=0;o--){for(var l=!0,h=0;h<u;h++)if(c(e,o+h)!==c(t,h)){l=!1;break}if(l)return o}return-1}function I(e,t,r,n){r=Number(r)||0;var i=e.length-r;n?(n=Number(n))>i&&(n=i):n=i;var o=t.length;if(o%2!=0)throw new TypeError("Invalid hex string");n>o/2&&(n=o/2);for(var s=0;s<n;++s){var a=parseInt(t.substr(2*s,2),16);if(isNaN(a))return s;e[r+s]=a}return s}function B(e,t,r,n){return K(Q(t,e.length-r),e,r,n)}function N(e,t,r,n){return K(function(e){for(var t=[],r=0;r<e.length;++r)t.push(255&e.charCodeAt(r));return t}(t),e,r,n)}function M(e,t,r,n){return N(e,t,r,n)}function U(e,t,r,n){return K(X(t),e,r,n)}function j(e,t,r,n){return K(function(e,t){for(var r,n,i,o=[],s=0;s<e.length&&!((t-=2)<0);++s)n=(r=e.charCodeAt(s))>>8,i=r%256,o.push(i),o.push(n);return o}(t,e.length-r),e,r,n)}function P(e,t,r){return 0===t&&r===e.length?f(e):f(e.slice(t,r))}function R(e,t,r){r=Math.min(e.length,r);for(var n=[],i=t;i<r;){var o,s,a,u,c=e[i],f=null,l=c>239?4:c>223?3:c>191?2:1;if(i+l<=r)switch(l){case 1:c<128&&(f=c);break;case 2:128==(192&(o=e[i+1]))&&(u=(31&c)<<6|63&o)>127&&(f=u);break;case 3:o=e[i+1],s=e[i+2],128==(192&o)&&128==(192&s)&&(u=(15&c)<<12|(63&o)<<6|63&s)>2047&&(u<55296||u>57343)&&(f=u);break;case 4:o=e[i+1],s=e[i+2],a=e[i+3],128==(192&o)&&128==(192&s)&&128==(192&a)&&(u=(15&c)<<18|(63&o)<<12|(63&s)<<6|63&a)>65535&&u<1114112&&(f=u)}null===f?(f=65533,l=1):f>65535&&(f-=65536,n.push(f>>>10&1023|55296),f=56320|1023&f),n.push(f),i+=l}return function(e){var t=e.length;if(t<=z)return String.fromCharCode.apply(String,e);var r="",n=0;for(;n<t;)r+=String.fromCharCode.apply(String,e.slice(n,n+=z));return r}(n)}y.TYPED_ARRAY_SUPPORT=void 0===n.TYPED_ARRAY_SUPPORT||n.TYPED_ARRAY_SUPPORT,m(),y.poolSize=8192,y._augment=function(e){return e.__proto__=y.prototype,e},y.from=function(e,t,r){return w(null,e,t,r)},y.TYPED_ARRAY_SUPPORT&&(y.prototype.__proto__=Uint8Array.prototype,y.__proto__=Uint8Array),y.alloc=function(e,t,r){return function(e,t,r,n){return v(t),t<=0?g(e,t):void 0!==r?"string"==typeof n?g(e,t).fill(r,n):g(e,t).fill(r):g(e,t)}(null,e,t,r)},y.allocUnsafe=function(e){return b(null,e)},y.allocUnsafeSlow=function(e){return b(null,e)},y.isBuffer=function(e){return null!=e&&(!!e._isBuffer||ee(e)||function(e){return"function"==typeof e.readFloatLE&&"function"==typeof e.slice&&ee(e.slice(0,0))}(e))},y.compare=function(e,t){if(!E(e)||!E(t))throw new TypeError("Arguments must be Buffers");if(e===t)return 0;for(var r=e.length,n=t.length,i=0,o=Math.min(r,n);i<o;++i)if(e[i]!==t[i]){r=e[i],n=t[i];break}return r<n?-1:n<r?1:0},y.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},y.concat=function(e,t){if(!d(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return y.alloc(0);var r;if(void 0===t)for(t=0,r=0;r<e.length;++r)t+=e[r].length;var n=y.allocUnsafe(t),i=0;for(r=0;r<e.length;++r){var o=e[r];if(!E(o))throw new TypeError('"list" argument must be an Array of Buffers');o.copy(n,i),i+=o.length}return n},y.byteLength=S,y.prototype._isBuffer=!0,y.prototype.swap16=function(){var e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;t<e;t+=2)_(this,t,t+1);return this},y.prototype.swap32=function(){var e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;t<e;t+=4)_(this,t,t+3),_(this,t+1,t+2);return this},y.prototype.swap64=function(){var e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var t=0;t<e;t+=8)_(this,t,t+7),_(this,t+1,t+6),_(this,t+2,t+5),_(this,t+3,t+4);return this},y.prototype.toString=function(){var e=0|this.length;return 0===e?"":0===arguments.length?R(this,0,e):T.apply(this,arguments)},y.prototype.equals=function(e){if(!E(e))throw new TypeError("Argument must be a Buffer");return this===e||0===y.compare(this,e)},y.prototype.inspect=function(){var e="";return this.length>0&&(e=this.toString("hex",0,50).match(/.{2}/g).join(" "),this.length>50&&(e+=" ... ")),"<Buffer "+e+">"},y.prototype.compare=function(e,t,r,n,i){if(!E(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),t<0||r>e.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&t>=r)return 0;if(n>=i)return-1;if(t>=r)return 1;if(this===e)return 0;for(var o=(i>>>=0)-(n>>>=0),s=(r>>>=0)-(t>>>=0),a=Math.min(o,s),u=this.slice(n,i),c=e.slice(t,r),f=0;f<a;++f)if(u[f]!==c[f]){o=u[f],s=c[f];break}return o<s?-1:s<o?1:0},y.prototype.includes=function(e,t,r){return-1!==this.indexOf(e,t,r)},y.prototype.indexOf=function(e,t,r){return A(this,e,t,r,!0)},y.prototype.lastIndexOf=function(e,t,r){return A(this,e,t,r,!1)},y.prototype.write=function(e,t,r,n){if(void 0===t)n="utf8",r=this.length,t=0;else if(void 0===r&&"string"==typeof t)n=t,r=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t|=0,isFinite(r)?(r|=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}var i=this.length-t;if((void 0===r||r>i)&&(r=i),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var o=!1;;)switch(n){case"hex":return I(this,e,t,r);case"utf8":case"utf-8":return B(this,e,t,r);case"ascii":return N(this,e,t,r);case"latin1":case"binary":return M(this,e,t,r);case"base64":return U(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return j(this,e,t,r);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}},y.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var z=4096;function F(e,t,r){var n="";r=Math.min(e.length,r);for(var i=t;i<r;++i)n+=String.fromCharCode(127&e[i]);return n}function L(e,t,r){var n="";r=Math.min(e.length,r);for(var i=t;i<r;++i)n+=String.fromCharCode(e[i]);return n}function D(e,t,r){var n=e.length;(!t||t<0)&&(t=0),(!r||r<0||r>n)&&(r=n);for(var i="",o=t;o<r;++o)i+=J(e[o]);return i}function C(e,t,r){for(var n=e.slice(t,r),i="",o=0;o<n.length;o+=2)i+=String.fromCharCode(n[o]+256*n[o+1]);return i}function $(e,t,r){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(e+t>r)throw new RangeError("Trying to access beyond buffer length")}function Y(e,t,r,n,i,o){if(!E(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||t<o)throw new RangeError('"value" argument is out of bounds');if(r+n>e.length)throw new RangeError("Index out of range")}function q(e,t,r,n){t<0&&(t=65535+t+1);for(var i=0,o=Math.min(e.length-r,2);i<o;++i)e[r+i]=(t&255<<8*(n?i:1-i))>>>8*(n?i:1-i)}function H(e,t,r,n){t<0&&(t=4294967295+t+1);for(var i=0,o=Math.min(e.length-r,4);i<o;++i)e[r+i]=t>>>8*(n?i:3-i)&255}function V(e,t,r,n,i,o){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function W(e,t,r,n,i){return i||V(e,0,r,4),h(e,t,r,n,23,4),r+4}function Z(e,t,r,n,i){return i||V(e,0,r,8),h(e,t,r,n,52,8),r+8}y.prototype.slice=function(e,t){var r,n=this.length;if((e=~~e)<0?(e+=n)<0&&(e=0):e>n&&(e=n),(t=void 0===t?n:~~t)<0?(t+=n)<0&&(t=0):t>n&&(t=n),t<e&&(t=e),y.TYPED_ARRAY_SUPPORT)(r=this.subarray(e,t)).__proto__=y.prototype;else{var i=t-e;r=new y(i,void 0);for(var o=0;o<i;++o)r[o]=this[o+e]}return r},y.prototype.readUIntLE=function(e,t,r){e|=0,t|=0,r||$(e,t,this.length);for(var n=this[e],i=1,o=0;++o<t&&(i*=256);)n+=this[e+o]*i;return n},y.prototype.readUIntBE=function(e,t,r){e|=0,t|=0,r||$(e,t,this.length);for(var n=this[e+--t],i=1;t>0&&(i*=256);)n+=this[e+--t]*i;return n},y.prototype.readUInt8=function(e,t){return t||$(e,1,this.length),this[e]},y.prototype.readUInt16LE=function(e,t){return t||$(e,2,this.length),this[e]|this[e+1]<<8},y.prototype.readUInt16BE=function(e,t){return t||$(e,2,this.length),this[e]<<8|this[e+1]},y.prototype.readUInt32LE=function(e,t){return t||$(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},y.prototype.readUInt32BE=function(e,t){return t||$(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},y.prototype.readIntLE=function(e,t,r){e|=0,t|=0,r||$(e,t,this.length);for(var n=this[e],i=1,o=0;++o<t&&(i*=256);)n+=this[e+o]*i;return n>=(i*=128)&&(n-=Math.pow(2,8*t)),n},y.prototype.readIntBE=function(e,t,r){e|=0,t|=0,r||$(e,t,this.length);for(var n=t,i=1,o=this[e+--n];n>0&&(i*=256);)o+=this[e+--n]*i;return o>=(i*=128)&&(o-=Math.pow(2,8*t)),o},y.prototype.readInt8=function(e,t){return t||$(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},y.prototype.readInt16LE=function(e,t){t||$(e,2,this.length);var r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},y.prototype.readInt16BE=function(e,t){t||$(e,2,this.length);var r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},y.prototype.readInt32LE=function(e,t){return t||$(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},y.prototype.readInt32BE=function(e,t){return t||$(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},y.prototype.readFloatLE=function(e,t){return t||$(e,4,this.length),l(this,e,!0,23,4)},y.prototype.readFloatBE=function(e,t){return t||$(e,4,this.length),l(this,e,!1,23,4)},y.prototype.readDoubleLE=function(e,t){return t||$(e,8,this.length),l(this,e,!0,52,8)},y.prototype.readDoubleBE=function(e,t){return t||$(e,8,this.length),l(this,e,!1,52,8)},y.prototype.writeUIntLE=function(e,t,r,n){(e=+e,t|=0,r|=0,n)||Y(this,e,t,r,Math.pow(2,8*r)-1,0);var i=1,o=0;for(this[t]=255&e;++o<r&&(i*=256);)this[t+o]=e/i&255;return t+r},y.prototype.writeUIntBE=function(e,t,r,n){(e=+e,t|=0,r|=0,n)||Y(this,e,t,r,Math.pow(2,8*r)-1,0);var i=r-1,o=1;for(this[t+i]=255&e;--i>=0&&(o*=256);)this[t+i]=e/o&255;return t+r},y.prototype.writeUInt8=function(e,t,r){return e=+e,t|=0,r||Y(this,e,t,1,255,0),y.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},y.prototype.writeUInt16LE=function(e,t,r){return e=+e,t|=0,r||Y(this,e,t,2,65535,0),y.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):q(this,e,t,!0),t+2},y.prototype.writeUInt16BE=function(e,t,r){return e=+e,t|=0,r||Y(this,e,t,2,65535,0),y.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):q(this,e,t,!1),t+2},y.prototype.writeUInt32LE=function(e,t,r){return e=+e,t|=0,r||Y(this,e,t,4,4294967295,0),y.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):H(this,e,t,!0),t+4},y.prototype.writeUInt32BE=function(e,t,r){return e=+e,t|=0,r||Y(this,e,t,4,4294967295,0),y.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):H(this,e,t,!1),t+4},y.prototype.writeIntLE=function(e,t,r,n){if(e=+e,t|=0,!n){var i=Math.pow(2,8*r-1);Y(this,e,t,r,i-1,-i)}var o=0,s=1,a=0;for(this[t]=255&e;++o<r&&(s*=256);)e<0&&0===a&&0!==this[t+o-1]&&(a=1),this[t+o]=(e/s|0)-a&255;return t+r},y.prototype.writeIntBE=function(e,t,r,n){if(e=+e,t|=0,!n){var i=Math.pow(2,8*r-1);Y(this,e,t,r,i-1,-i)}var o=r-1,s=1,a=0;for(this[t+o]=255&e;--o>=0&&(s*=256);)e<0&&0===a&&0!==this[t+o+1]&&(a=1),this[t+o]=(e/s|0)-a&255;return t+r},y.prototype.writeInt8=function(e,t,r){return e=+e,t|=0,r||Y(this,e,t,1,127,-128),y.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},y.prototype.writeInt16LE=function(e,t,r){return e=+e,t|=0,r||Y(this,e,t,2,32767,-32768),y.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):q(this,e,t,!0),t+2},y.prototype.writeInt16BE=function(e,t,r){return e=+e,t|=0,r||Y(this,e,t,2,32767,-32768),y.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):q(this,e,t,!1),t+2},y.prototype.writeInt32LE=function(e,t,r){return e=+e,t|=0,r||Y(this,e,t,4,2147483647,-2147483648),y.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):H(this,e,t,!0),t+4},y.prototype.writeInt32BE=function(e,t,r){return e=+e,t|=0,r||Y(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),y.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):H(this,e,t,!1),t+4},y.prototype.writeFloatLE=function(e,t,r){return W(this,e,t,!0,r)},y.prototype.writeFloatBE=function(e,t,r){return W(this,e,t,!1,r)},y.prototype.writeDoubleLE=function(e,t,r){return Z(this,e,t,!0,r)},y.prototype.writeDoubleBE=function(e,t,r){return Z(this,e,t,!1,r)},y.prototype.copy=function(e,t,r,n){if(r||(r=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n<r&&(n=r),n===r)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("sourceStart out of bounds");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t<n-r&&(n=e.length-t+r);var i,o=n-r;if(this===e&&r<t&&t<n)for(i=o-1;i>=0;--i)e[i+t]=this[i+r];else if(o<1e3||!y.TYPED_ARRAY_SUPPORT)for(i=0;i<o;++i)e[i+t]=this[i+r];else Uint8Array.prototype.set.call(e,this.subarray(r,r+o),t);return o},y.prototype.fill=function(e,t,r,n){if("string"==typeof e){if("string"==typeof t?(n=t,t=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),1===e.length){var i=e.charCodeAt(0);i<256&&(e=i)}if(void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!y.isEncoding(n))throw new TypeError("Unknown encoding: "+n)}else"number"==typeof e&&(e&=255);if(t<0||this.length<t||this.length<r)throw new RangeError("Out of range index");if(r<=t)return this;var o;if(t>>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"==typeof e)for(o=t;o<r;++o)this[o]=e;else{var s=E(e)?e:Q(new y(e,n).toString()),a=s.length;for(o=0;o<r-t;++o)this[o+t]=s[o%a]}return this};var G=/[^+\/0-9A-Za-z-_]/g;function J(e){return e<16?"0"+e.toString(16):e.toString(16)}function Q(e,t){var r;t=t||1/0;for(var n=e.length,i=null,o=[],s=0;s<n;++s){if((r=e.charCodeAt(s))>55295&&r<57344){if(!i){if(r>56319){(t-=3)>-1&&o.push(239,191,189);continue}if(s+1===n){(t-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(t-=3)>-1&&o.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(t-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((t-=1)<0)break;o.push(r)}else if(r<2048){if((t-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function X(e){return function(e){var t,r,n,i,c,f;a||u();var l=e.length;if(l%4>0)throw new Error("Invalid string. Length must be a multiple of 4");c="="===e[l-2]?2:"="===e[l-1]?1:0,f=new s(3*l/4-c),n=c>0?l-4:l;var h=0;for(t=0,r=0;t<n;t+=4,r+=3)i=o[e.charCodeAt(t)]<<18|o[e.charCodeAt(t+1)]<<12|o[e.charCodeAt(t+2)]<<6|o[e.charCodeAt(t+3)],f[h++]=i>>16&255,f[h++]=i>>8&255,f[h++]=255&i;return 2===c?(i=o[e.charCodeAt(t)]<<2|o[e.charCodeAt(t+1)]>>4,f[h++]=255&i):1===c&&(i=o[e.charCodeAt(t)]<<10|o[e.charCodeAt(t+1)]<<4|o[e.charCodeAt(t+2)]>>2,f[h++]=i>>8&255,f[h++]=255&i),f}(function(e){if((e=function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}(e).replace(G,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function K(e,t,r,n){for(var i=0;i<n&&!(i+r>=t.length||i>=e.length);++i)t[i+r]=e[i];return i}function ee(e){return!!e.constructor&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)}function te(e){if(e.__esModule)return e;var t=e.default;if("function"==typeof t){var r=function e(){return this instanceof e?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};r.prototype=t.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(e).forEach((function(t){var n=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(r,t,n.get?n:{enumerable:!0,get:function(){return e[t]}})})),r}var re={},ne=te(Object.freeze({__proto__:null,default:{}}));function ie(e){return t(this,arguments,void 0,(function(e){var t,n,i,o,s,a,u,c=e.input;return r(this,(function(e){switch(e.label){case 0:return t=c.method||"GET",n=new Map([["prod","https://gateway.ywwl.com"],["test","https://test-gateway.ywwl.com"],["test2","https://test2-gateway.ywwl.com"],["dev","https://dev-gateway.ywwl.com"]]),i=function(e){return!!new RegExp("^(https?:\\/\\/)?((([a-z\\d]([a-z\\d-]*[a-z\\d])*)\\.)+[a-z]{2,}|((\\d{1,3}\\.){3}\\d{1,3}))(\\:\\d+)?(\\/[-a-z\\d%_.&#126;+]*)*(\\?[;&a-z\\d%_.&#126;+=-]*)?(\\#[-a-z\\d_]*)?$","i").test(e)},o=function(){return n.get("{{env}}")}(),s=i(c.url)?c.url:"".concat(o).concat(c.url),a={method:t,headers:{"Content-type":"application/json","x-token":"{{token}}"}},"POST"===t.toUpperCase()?a.body=JSON.stringify(c.params):"GET"===t.toUpperCase()&&(s="".concat(s,"?").concat(re.querystring.stringify(c.params||{}))),[4,fetch(s,a)];case 1:return(u=e.sent()).ok?[4,u.json()]:[2,{success:!1,message:"An error has occured: ".concat(u.status)}];case 2:return[2,e.sent()]}}))}))}!function(e){function t(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}Object.defineProperty(e,"__esModule",{value:!0});var r=t(ne);function n(e){return null!=e&&"object"==typeof e&&!0===e["@@functional/placeholder"]}function i(e){return function t(r){return 0===arguments.length||n(r)?t:e.apply(this,arguments)}}function o(e){return function t(r,o){switch(arguments.length){case 0:return t;case 1:return n(r)?t:i((function(t){return e(r,t)}));default:return n(r)&&n(o)?t:n(r)?i((function(t){return e(t,o)})):n(o)?i((function(t){return e(r,t)})):e(r,o)}}}function s(e,t){var r;t=t||[];var n=(e=e||[]).length,i=t.length,o=[];for(r=0;r<n;)o[o.length]=e[r],r+=1;for(r=0;r<i;)o[o.length]=t[r],r+=1;return o}function a(e,t){switch(e){case 0:return function(){return t.apply(this,arguments)};case 1:return function(e){return t.apply(this,arguments)};case 2:return function(e,r){return t.apply(this,arguments)};case 3:return function(e,r,n){return t.apply(this,arguments)};case 4:return function(e,r,n,i){return t.apply(this,arguments)};case 5:return function(e,r,n,i,o){return t.apply(this,arguments)};case 6:return function(e,r,n,i,o,s){return t.apply(this,arguments)};case 7:return function(e,r,n,i,o,s,a){return t.apply(this,arguments)};case 8:return function(e,r,n,i,o,s,a,u){return t.apply(this,arguments)};case 9:return function(e,r,n,i,o,s,a,u,c){return t.apply(this,arguments)};case 10:return function(e,r,n,i,o,s,a,u,c,f){return t.apply(this,arguments)};default:throw new Error("First argument to _arity must be a non-negative integer no greater than ten")}}function u(e,t,r){return function(){for(var i=[],o=0,s=e,c=0;c<t.length||o<arguments.length;){var f;c<t.length&&(!n(t[c])||o>=arguments.length)?f=t[c]:(f=arguments[o],o+=1),i[c]=f,n(f)||(s-=1),c+=1}return s<=0?r.apply(this,i):a(s,u(e,i,r))}}var c=o((function(e,t){return 1===e?i(t):a(e,u(e,[],t))}));function f(e){return function t(r,s,a){switch(arguments.length){case 0:return t;case 1:return n(r)?t:o((function(t,n){return e(r,t,n)}));case 2:return n(r)&&n(s)?t:n(r)?o((function(t,r){return e(t,s,r)})):n(s)?o((function(t,n){return e(r,t,n)})):i((function(t){return e(r,s,t)}));default:return n(r)&&n(s)&&n(a)?t:n(r)&&n(s)?o((function(t,r){return e(t,r,a)})):n(r)&&n(a)?o((function(t,r){return e(t,s,r)})):n(s)&&n(a)?o((function(t,n){return e(r,t,n)})):n(r)?i((function(t){return e(t,s,a)})):n(s)?i((function(t){return e(r,t,a)})):n(a)?i((function(t){return e(r,s,t)})):e(r,s,a)}}}var l=Array.isArray||function(e){return null!=e&&e.length>=0&&"[object Array]"===Object.prototype.toString.call(e)};function h(e,t,r){return function(){if(0===arguments.length)return r();var n=Array.prototype.slice.call(arguments,0),i=n.pop();if(!l(i)){for(var o=0;o<e.length;){if("function"==typeof i[e[o]])return i[e[o]].apply(i,n);o+=1}if(function(e){return null!=e&&"function"==typeof e["@@transducer/step"]}(i))return t.apply(null,n)(i)}return r.apply(this,arguments)}}var p=function(){return this.xf["@@transducer/init"]()},d=function(e){return this.xf["@@transducer/result"](e)};function m(e,t){for(var r=0,n=t.length,i=Array(n);r<n;)i[r]=e(t[r]),r+=1;return i}function g(e){return"[object String]"===Object.prototype.toString.call(e)}var w=i((function(e){return!!l(e)||!!e&&("object"==typeof e&&(!g(e)&&(1===e.nodeType?!!e.length:0===e.length||e.length>0&&(e.hasOwnProperty(0)&&e.hasOwnProperty(e.length-1)))))})),v=function(){function e(e){this.f=e}return e.prototype["@@transducer/init"]=function(){throw new Error("init not implemented on XWrap")},e.prototype["@@transducer/result"]=function(e){return e},e.prototype["@@transducer/step"]=function(e,t){return this.f(e,t)},e}();var b=o((function(e,t){return a(e.length,(function(){return e.apply(t,arguments)}))})),x=b;function k(e,t,r){for(var n=r.next();!n.done;){if((t=e["@@transducer/step"](t,n.value))&&t["@@transducer/reduced"]){t=t["@@transducer/value"];break}n=r.next()}return e["@@transducer/result"](t)}function E(e,t,r,n){return e["@@transducer/result"](r[n](x(e["@@transducer/step"],e),t))}var S="undefined"!=typeof Symbol?Symbol.iterator:"@@iterator";function T(e,t,r){if("function"==typeof e&&(e=function(e){return new v(e)}(e)),w(r))return function(e,t,r){for(var n=0,i=r.length;n<i;){if((t=e["@@transducer/step"](t,r[n]))&&t["@@transducer/reduced"]){t=t["@@transducer/value"];break}n+=1}return e["@@transducer/result"](t)}(e,t,r);if("function"==typeof r["fantasy-land/reduce"])return E(e,t,r,"fantasy-land/reduce");if(null!=r[S])return k(e,t,r[S]());if("function"==typeof r.next)return k(e,t,r);if("function"==typeof r.reduce)return E(e,t,r,"reduce");throw new TypeError("reduce: list must be array or iterable")}var _=function(){function e(e,t){this.xf=t,this.f=e}return e.prototype["@@transducer/init"]=p,e.prototype["@@transducer/result"]=d,e.prototype["@@transducer/step"]=function(e,t){return this.xf["@@transducer/step"](e,this.f(t))},e}(),A=o((function(e,t){return new _(e,t)}));function O(e,t){return Object.prototype.hasOwnProperty.call(t,e)}var I=Object.prototype.toString,B=function(){return"[object Arguments]"===I.call(arguments)?function(e){return"[object Arguments]"===I.call(e)}:function(e){return O("callee",e)}}(),N=B,M=!{toString:null}.propertyIsEnumerable("toString"),U=["constructor","valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"],j=function(){return arguments.propertyIsEnumerable("length")}(),P=function(e,t){for(var r=0;r<e.length;){if(e[r]===t)return!0;r+=1}return!1},R="function"!=typeof Object.keys||j?i((function(e){if(Object(e)!==e)return[];var t,r,n=[],i=j&&N(e);for(t in e)!O(t,e)||i&&"length"===t||(n[n.length]=t);if(M)for(r=U.length-1;r>=0;)O(t=U[r],e)&&!P(n,t)&&(n[n.length]=t),r-=1;return n})):i((function(e){return Object(e)!==e?[]:Object.keys(e)})),z=R,F=o(h(["fantasy-land/map","map"],A,(function(e,t){switch(Object.prototype.toString.call(t)){case"[object Function]":return c(t.length,(function(){return e.call(this,t.apply(this,arguments))}));case"[object Object]":return T((function(r,n){return r[n]=e(t[n]),r}),{},z(t));default:return m(e,t)}}))),L=F,D=Number.isInteger||function(e){return(e|0)===e},C=o((function(e,t){var r=e<0?t.length+e:e;return g(t)?t.charAt(r):t[r]})),$=o((function(e,t){return e.map((function(e){for(var r,n=t,i=0;i<e.length;){if(null==n)return;r=e[i],n=D(r)?C(r,n):n[r],i+=1}return n}))})),Y=o((function(e,t){return $([e],t)[0]})),q=o((function(e,t){return Y([e],t)})),H=f(T),V=o((function(e,t){return"function"==typeof t["fantasy-land/ap"]?t["fantasy-land/ap"](e):"function"==typeof e.ap?e.ap(t):"function"==typeof e?function(r){return e(r)(t(r))}:T((function(e,r){return s(e,L(r,t))}),[],e)})),W=i((function(e){for(var t=z(e),r=t.length,n=[],i=0;i<r;)n[i]=e[t[i]],i+=1;return n})),Z=i((function(e){return null==e}));function G(e){var t=Object.prototype.toString.call(e);return"[object Function]"===t||"[object AsyncFunction]"===t||"[object GeneratorFunction]"===t||"[object AsyncGeneratorFunction]"===t}var J=o((function(e,t){var r=c(e,t);return c(e,(function(){return T(V,L(r,arguments[0]),Array.prototype.slice.call(arguments,1))}))})),Q=J,X=i((function(e){return Q(e.length,e)})),K=i((function(e){return c(e.length,e)}));function ee(e){return function e(t){for(var r,n,i,o=[],s=0,a=t.length;s<a;){if(w(t[s]))for(i=0,n=(r=e(t[s])).length;i<n;)o[o.length]=r[i],i+=1;else o[o.length]=t[s];s+=1}return o}}var te=i((function(e){return null===e?"Null":void 0===e?"Undefined":Object.prototype.toString.call(e).slice(8,-1)})),re=X(i((function(e){return!e})));function ie(e,t){return function(){return t.call(this,e.apply(this,arguments))}}function oe(e,t){return function(){var r=arguments.length;if(0===r)return t();var n=arguments[r-1];return l(n)||"function"!=typeof n[e]?t.apply(this,arguments):n[e].apply(n,Array.prototype.slice.call(arguments,0,r-1))}}var se=f(oe("slice",(function(e,t,r){return Array.prototype.slice.call(r,e,t)}))),ae=i(oe("tail",se(1,1/0)));function ue(){if(0===arguments.length)throw new Error("pipe requires at least one argument");return a(arguments[0].length,H(ie,arguments[0],ae(arguments)))}var ce=i((function(e){return g(e)?e.split("").reverse().join(""):Array.prototype.slice.call(e,0).reverse()}));function fe(){if(0===arguments.length)throw new Error("compose requires at least one argument");return ue.apply(this,ce(arguments))}function le(e){return e}var he=i(le);function pe(e){for(var t,r=[];!(t=e.next()).done;)r.push(t.value);return r}function de(e,t,r){for(var n=0,i=r.length;n<i;){if(e(t,r[n]))return!0;n+=1}return!1}var me="function"==typeof Object.is?Object.is:function(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t};function ge(e,t,r,n){var i=pe(e);function o(e,t){return ye(e,t,r.slice(),n.slice())}return!de((function(e,t){return!de(o,t,e)}),pe(t),i)}function ye(e,t,r,n){if(me(e,t))return!0;var i,o,s=te(e);if(s!==te(t))return!1;if(null==e||null==t)return!1;if("function"==typeof e["fantasy-land/equals"]||"function"==typeof t["fantasy-land/equals"])return"function"==typeof e["fantasy-land/equals"]&&e["fantasy-land/equals"](t)&&"function"==typeof t["fantasy-land/equals"]&&t["fantasy-land/equals"](e);if("function"==typeof e.equals||"function"==typeof t.equals)return"function"==typeof e.equals&&e.equals(t)&&"function"==typeof t.equals&&t.equals(e);switch(s){case"Arguments":case"Array":case"Object":if("function"==typeof e.constructor&&"Promise"===(i=e.constructor,null==(o=String(i).match(/^function (\w*)/))?"":o[1]))return e===t;break;case"Boolean":case"Number":case"String":if(typeof e!=typeof t||!me(e.valueOf(),t.valueOf()))return!1;break;case"Date":if(!me(e.valueOf(),t.valueOf()))return!1;break;case"Error":return e.name===t.name&&e.message===t.message;case"RegExp":if(e.source!==t.source||e.global!==t.global||e.ignoreCase!==t.ignoreCase||e.multiline!==t.multiline||e.sticky!==t.sticky||e.unicode!==t.unicode)return!1}for(var a=r.length-1;a>=0;){if(r[a]===e)return n[a]===t;a-=1}switch(s){case"Map":return e.size===t.size&&ge(e.entries(),t.entries(),r.concat([e]),n.concat([t]));case"Set":return e.size===t.size&&ge(e.values(),t.values(),r.concat([e]),n.concat([t]));case"Arguments":case"Array":case"Object":case"Boolean":case"Number":case"String":case"Date":case"Error":case"RegExp":case"Int8Array":case"Uint8Array":case"Uint8ClampedArray":case"Int16Array":case"Uint16Array":case"Int32Array":case"Uint32Array":case"Float32Array":case"Float64Array":case"ArrayBuffer":break;default:return!1}var u=z(e);if(u.length!==z(t).length)return!1;var c=r.concat([e]),f=n.concat([t]);for(a=u.length-1;a>=0;){var l=u[a];if(!O(l,t)||!ye(t[l],e[l],c,f))return!1;a-=1}return!0}var we=o((function(e,t){return ye(e,t,[],[])}));function ve(e,t){return function(e,t,r){var n,i;if("function"==typeof e.indexOf)switch(typeof t){case"number":if(0===t){for(n=1/t;r<e.length;){if(0===(i=e[r])&&1/i===n)return r;r+=1}return-1}if(t!=t){for(;r<e.length;){if("number"==typeof(i=e[r])&&i!=i)return r;r+=1}return-1}return e.indexOf(t,r);case"string":case"boolean":case"function":case"undefined":return e.indexOf(t,r);case"object":if(null===t)return e.indexOf(t,r)}for(;r<e.length;){if(we(e[r],t))return r;r+=1}return-1}(t,e,0)>=0}function be(e){return'"'+e.replace(/\\/g,"\\\\").replace(/[\b]/g,"\\b").replace(/\f/g,"\\f").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\t/g,"\\t").replace(/\v/g,"\\v").replace(/\0/g,"\\0").replace(/"/g,'\\"')+'"'}var xe=function(e){return(e<10?"0":"")+e},ke="function"==typeof Date.prototype.toISOString?function(e){return e.toISOString()}:function(e){return e.getUTCFullYear()+"-"+xe(e.getUTCMonth()+1)+"-"+xe(e.getUTCDate())+"T"+xe(e.getUTCHours())+":"+xe(e.getUTCMinutes())+":"+xe(e.getUTCSeconds())+"."+(e.getUTCMilliseconds()/1e3).toFixed(3).slice(2,5)+"Z"};function Ee(e){return"[object Object]"===Object.prototype.toString.call(e)}var Se=function(){function e(e,t){this.xf=t,this.f=e}return e.prototype["@@transducer/init"]=p,e.prototype["@@transducer/result"]=d,e.prototype["@@transducer/step"]=function(e,t){return this.f(t)?this.xf["@@transducer/step"](e,t):e},e}(),Te=o(h(["filter"],o((function(e,t){return new Se(e,t)})),(function(e,t){return Ee(t)?T((function(r,n){return e(t[n])&&(r[n]=t[n]),r}),{},z(t)):function(e,t){for(var r=0,n=t.length,i=[];r<n;)e(t[r])&&(i[i.length]=t[r]),r+=1;return i}(e,t)}))),_e=o((function(e,t){return Te((r=e,function(){return!r.apply(this,arguments)}),t);var r})),Ae=_e;function Oe(e,t){var r=function(r){var n=t.concat([e]);return ve(r,n)?"<Circular>":Oe(r,n)},n=function(e,t){return m((function(t){return be(t)+": "+r(e[t])}),t.slice().sort())};switch(Object.prototype.toString.call(e)){case"[object Arguments]":return"(function() { return arguments; }("+m(r,e).join(", ")+"))";case"[object Array]":return"["+m(r,e).concat(n(e,Ae((function(e){return/^\d+$/.test(e)}),z(e)))).join(", ")+"]";case"[object Boolean]":return"object"==typeof e?"new Boolean("+r(e.valueOf())+")":e.toString();case"[object Date]":return"new Date("+(isNaN(e.valueOf())?r(NaN):be(ke(e)))+")";case"[object Null]":return"null";case"[object Number]":return"object"==typeof e?"new Number("+r(e.valueOf())+")":1/e==-1/0?"-0":e.toString(10);case"[object String]":return"object"==typeof e?"new String("+r(e.valueOf())+")":be(e);case"[object Undefined]":return"undefined";default:if("function"==typeof e.toString){var i=e.toString();if("[object Object]"!==i)return i}return"{"+n(e,z(e)).join(", ")+"}"}}var Ie=i((function(e){return Oe(e,[])})),Be=o((function(e,t){if(l(e)){if(l(t))return e.concat(t);throw new TypeError(Ie(t)+" is not an array")}if(g(e)){if(g(t))return e+t;throw new TypeError(Ie(t)+" is not a string")}if(null!=e&&G(e["fantasy-land/concat"]))return e["fantasy-land/concat"](t);if(null!=e&&G(e.concat))return e.concat(t);throw new TypeError(Ie(e)+' does not have a method named "concat" or "fantasy-land/concat"')}));function Ne(e,t,r){var n,i=typeof e;switch(i){case"string":case"number":return 0===e&&1/e==-1/0?!!r._items["-0"]||(t&&(r._items["-0"]=!0),!1):null!==r._nativeSet?t?(n=r._nativeSet.size,r._nativeSet.add(e),r._nativeSet.size===n):r._nativeSet.has(e):i in r._items?e in r._items[i]||(t&&(r._items[i][e]=!0),!1):(t&&(r._items[i]={},r._items[i][e]=!0),!1);case"boolean":if(i in r._items){var o=e?1:0;return!!r._items[i][o]||(t&&(r._items[i][o]=!0),!1)}return t&&(r._items[i]=e?[!1,!0]:[!0,!1]),!1;case"function":return null!==r._nativeSet?t?(n=r._nativeSet.size,r._nativeSet.add(e),r._nativeSet.size===n):r._nativeSet.has(e):i in r._items?!!ve(e,r._items[i])||(t&&r._items[i].push(e),!1):(t&&(r._items[i]=[e]),!1);case"undefined":return!!r._items[i]||(t&&(r._items[i]=!0),!1);case"object":if(null===e)return!!r._items.null||(t&&(r._items.null=!0),!1);default:return(i=Object.prototype.toString.call(e))in r._items?!!ve(e,r._items[i])||(t&&r._items[i].push(e),!1):(t&&(r._items[i]=[e]),!1)}}var Me=function(){function e(){this._nativeSet="function"==typeof Set?new Set:null,this._items={}}return e.prototype.add=function(e){return!Ne(e,!0,this)},e.prototype.has=function(e){return Ne(e,!1,this)},e}(),Ue=i((function(e){return null!=e&&"function"==typeof e["fantasy-land/empty"]?e["fantasy-land/empty"]():null!=e&&null!=e.constructor&&"function"==typeof e.constructor["fantasy-land/empty"]?e.constructor["fantasy-land/empty"]():null!=e&&"function"==typeof e.empty?e.empty():null!=e&&null!=e.constructor&&"function"==typeof e.constructor.empty?e.constructor.empty():l(e)?[]:g(e)?"":Ee(e)?{}:N(e)?function(){return arguments}():void 0})),je=Ue,Pe=function(){function e(e,t){this.xf=t,this.f=e,this.found=!1}return e.prototype["@@transducer/init"]=p,e.prototype["@@transducer/result"]=function(e){return this.found||(e=this.xf["@@transducer/step"](e,void 0)),this.xf["@@transducer/result"](e)},e.prototype["@@transducer/step"]=function(e,t){var r;return this.f(t)&&(this.found=!0,e=(r=this.xf["@@transducer/step"](e,t))&&r["@@transducer/reduced"]?r:{"@@transducer/value":r,"@@transducer/reduced":!0}),e},e}(),Re=o(h(["find"],o((function(e,t){return new Pe(e,t)})),(function(e,t){for(var r=0,n=t.length;r<n;){if(e(t[r]))return t[r];r+=1}}))),ze=i(ee()),Fe=i((function(e){for(var t={},r=0;r<e.length;)t[e[r][0]]=e[r][1],r+=1;return t})),Le=o((function(e,t){if(0===e.length||Z(t))return!1;for(var r=t,n=0;n<e.length;){if(Z(r)||!O(e[n],r))return!1;r=r[e[n]],n+=1}return!0})),De=o((function(e,t){for(var r,n,i=new Me,o=[],s=0;s<t.length;)r=e(n=t[s]),i.add(r)&&o.push(n),s+=1;return o}))(he);var Ce="function"==typeof Object.assign?Object.assign:function(e){if(null==e)throw new TypeError("Cannot convert undefined or null to object");for(var t=Object(e),r=1,n=arguments.length;r<n;){var i=arguments[r];if(null!=i)for(var o in i)O(o,i)&&(t[o]=i[o]);r+=1}return t},$e=o((function(e,t){return c(e+1,(function(){var r=arguments[e];if(null!=r&&G(r[t]))return r[t].apply(r,Array.prototype.slice.call(arguments,0,e));throw new TypeError(Ie(r)+' does not have a method named "'+t+'"')}))})),Ye=$e,qe=o((function(e,t){return null!=t&&t.constructor===e||t instanceof e})),He=i((function(e){return null!=e&&we(e,je(e))})),Ve=i((function(e){return Ce.apply(null,[{}].concat(e))})),We=o((function(e,t){for(var r={},n={},i=0,o=e.length;i<o;)n[e[i]]=1,i+=1;for(var s in t)n.hasOwnProperty(s)||(r[s]=t[s]);return r})),Ze=We,Ge=f((function(e,t,r){return we(t,r[e])})),Je=f((function(e,t,r){return r.replace(e,t)})),Qe=Ye(1,"split"),Xe="\t\n\v\f\r                 \u2028\u2029\ufeff",Ke=i("function"==typeof String.prototype.trim&&!Xe.trim()&&"​".trim()?function(e){return e.trim()}:function(e){var t=new RegExp("^["+Xe+"]["+Xe+"]*"),r=new RegExp("["+Xe+"]["+Xe+"]*$");return e.replace(t,"").replace(r,"")}),et=o(fe(De,s));const tt=e=>{if(Z(e)||He(e))return e;switch(te(e)){case"String":return Ke(e);case"Array":return Te(re(He))(e);default:return e}},rt=(e,t)=>He(t)||Z(t)?[]:ue(Qe(e),tt)(t),nt={set:(e,t)=>{"undefined"!=typeof window&&window.sessionStorage.setItem(e,t)},get:e=>"undefined"!=typeof window?window.sessionStorage.getItem(e):null,remove:e=>{"undefined"!=typeof window&&window.sessionStorage.removeItem(e)},clear:()=>{"undefined"!=typeof window&&window.sessionStorage.clear()}},it={set:(e,t)=>{"undefined"!=typeof window&&window.localStorage.setItem(e,t)},get:e=>"undefined"!=typeof window?window.localStorage.getItem(e):null,remove:e=>{"undefined"!=typeof window&&window.localStorage.removeItem(e)},clear:()=>{"undefined"!=typeof window&&window.localStorage.clear()}},ot={set:(e,t,r)=>{const n=new Date;n.setTime(n.getTime()+24*r*60*60*1e3);const i=`expires=${n.toUTCString()}`;document.cookie=`${e}=${escape(t)};${i};path=/`},get:e=>{const t=`${e}=`,r=document.cookie.split(";");for(let e=0;e<r.length;e+=1){let n=r[e];for(;" "===n.charAt(0);)n=n.substring(1);if(-1!==n.indexOf(t))return n.substring(t.length,n.length)}}};function st(e,t,r,n){e.addEventListener(t,(function n(i){e.removeEventListener(t,n),r(i)}),n)}const at=["id","type","async","defer","crossOrigin","integrity","noModule"];const ut=e=>{let t=e;return e instanceof Date?t=e:"string"==typeof e&&String(e).length>=13&&!isNaN(e)?t=Number(e):"string"==typeof e&&e.includes("-")&&(t=e.replace(/-/g,"/")),new Date(t)&&"Invalid Date"!==String(new Date(t))},ct=e=>{const t=e.replace(/-/g,"/");return new Date(t).valueOf()},ft=(e,t)=>{if(!ut(e))return null;let r;isNaN(e)?"string"==typeof e&&e.includes("-")&&(e=e.replace(/-/g,"/")):e=Number(e),r=new Date(e);const n={YYYY:r.getFullYear(),YY:`${r.getFullYear()}`.slice(-2),MM:`0${r.getMonth()+1}`.slice(-2),M:r.getMonth()+1,DD:`0${r.getDate()}`.slice(-2),D:r.getDate(),HH:`0${r.getHours()}`.slice(-2),H:r.getHours(),hh:("0"+r.getHours()%12).slice(-2),h:r.getHours()%12,mm:`0${r.getMinutes()}`.slice(-2),m:r.getMinutes(),ss:`0${r.getSeconds()}`.slice(-2),s:r.getSeconds(),w:["日","一","二","三","四","五","六"][r.getDay()]};for(const e in n)t=t.replace(e,n[e]);return t},lt=(e,t,r,n)=>{let i="";return t.length>r?t:(i="left"===e?new Array(r-t.length+1).join(n)+t:t+new Array(r-t.length+1).join(n),i)},[ht,pt,dt]=[86400,3600,60],mt=(e,t,r=!0)=>{let n=e<0?0:parseFloat(`${e}`);if((isNaN(n)||!n)&&(!r||0!==n))return"-";let[i,o,s,a]=[void 0,void 0,void 0,void 0];t.indexOf("{DD}")>-1&&(i=Math.floor(n/ht),n=Math.floor(n%ht)),t.indexOf("{HH}")>-1&&(o=Math.floor(n/pt),n=Math.floor(n%pt)),t.indexOf("{mm}")>-1&&(s=Math.floor(n/dt),n=Math.floor(n%dt)),a=n;return t.replace("{ss}","number"==typeof a?lt("left",String(a),2,"0"):"").replace("{mm}","number"==typeof s?lt("left",String(s),2,"0"):"").replace("{HH}","number"==typeof o?lt("left",String(o),2,"0"):"").replace("{DD}","number"==typeof i?lt("left",String(i),2,"0"):"")},[gt,yt,wt]=[86400,3600,60],vt=(e,t,r)=>{const n={reduce:K(((e,r,i)=>{const o=e(r,i);return(e=>Le([t],e))(i)&&i[t]?i[t].reduce(n.reduce(e),o):o})),find:K(((e,t,r)=>ue(L(n.reduce(e,t)),ze)(r)))},i=(r,n)=>e.value&&n[e.key]&&n[e.key]===e.value||!e.value&&n[e.key]?r.concat([Ze([t],n)]):r;switch(te(r)){case"Object":return n.reduce(i,[])(r);case"Array":return n.find(i,[])(r);default:return r}},bt=(e,t)=>{let r=[],n=[],i={};const o=Re(Ge("origion_url",`/${e[0]}`))(t);if(o){if(r=[o.name],e.length>1&&o.children&&o.children.length){const t=e.join("/");i=Re(Ge("origion_url",`/${t}`))(o.children)}else i=o.children&&o.children.length?o.children[0]:o;n=(null==i?void 0:i.name)?[i.name]:[]}return{defaultOpenMenus:r,defaultSelectedMenus:n,defaultMenu:i}},xt=e=>{var t,r;let n=[],i=[],o={};return e[0]&&e[0].children&&e[0].children.length?(n=[e[0].name],i=[e[0].children[0].name],o=e[0].children[0]):e[0]&&(n=[null===(t=e[0])||void 0===t?void 0:t.name],i=[null===(r=e[0])||void 0===r?void 0:r.name],o=e[0]),{defaultOpenMenus:n,defaultSelectedMenus:i,defaultMenu:o}},kt=(e,t=0,r=!0,n=!1)=>{let i=parseFloat(e);if(isNaN(i)||0!==e&&!e)return"-";let o=!1,s="";return i<0&&(o=!0,i=Math.abs(i)),i>=1e8?s=(i/1e8).toFixed(t)+(r?"亿":""):i>=1e4?s=(i/1e4).toFixed(t)+(r?"万":""):(s=n?i.toFixed(0):i.toString(),s=n||isNaN(t)?s:i.toFixed(t)),o?`-${s}`:s},Et=()=>window.localStorage.getItem("env")||"prod",St=()=>window.localStorage.getItem("isMock"),Tt=e=>{if(!e)return{};return ue(Je("?",""),Qe("&"),L((e=>Qe("=",decodeURI(e)))),Fe)(e)};var _t=Object.freeze({__proto__:null,parse:Tt,stringify:e=>{if(He(e))return"";const t=Object.keys(e);let r="";t.map((t=>{r+=`&${t}=${e[t]}`}));return new URLSearchParams(r).toString()||""}});var At=1e6,Ot=1e6,It="[big.js] ",Bt=It+"Invalid ",Nt=Bt+"decimal places",Mt=Bt+"rounding mode",Ut=It+"Division by zero",jt={},Pt=void 0,Rt=/^-?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i;function zt(e,t,r,n){var i=e.c,o=e.e+t+1;if(o<i.length){if(1===r)n=i[o]>=5;else if(2===r)n=i[o]>5||5==i[o]&&(n||o<0||i[o+1]!==Pt||1&i[o-1]);else if(3===r)n=n||!!i[0];else if(n=!1,0!==r)throw Error(Mt);if(o<1)i.length=1,n?(e.e=-t,i[0]=1):i[0]=e.e=0;else{if(i.length=o--,n)for(;++i[o]>9;)i[o]=0,o--||(++e.e,i.unshift(1));for(o=i.length;!i[--o];)i.pop()}}else if(r<0||r>3||r!==~~r)throw Error(Mt);return e}function Ft(e,t,r,n){var i,o,s=e.constructor,a=!e.c[0];if(r!==Pt){if(r!==~~r||r<(3==t)||r>At)throw Error(3==t?Bt+"precision":Nt);for(r=n-(e=new s(e)).e,e.c.length>++n&&zt(e,r,s.RM),2==t&&(n=e.e+r+1);e.c.length<n;)e.c.push(0)}if(i=e.e,r=(o=e.c.join("")).length,2!=t&&(1==t||3==t&&n<=i||i<=s.NE||i>=s.PE))o=o.charAt(0)+(r>1?"."+o.slice(1):"")+(i<0?"e":"e+")+i;else if(i<0){for(;++i;)o="0"+o;o="0."+o}else if(i>0)if(++i>r)for(i-=r;i--;)o+="0";else i<r&&(o=o.slice(0,i)+"."+o.slice(i));else r>1&&(o=o.charAt(0)+"."+o.slice(1));return e.s<0&&(!a||4==t)?"-"+o:o}jt.abs=function(){var e=new this.constructor(this);return e.s=1,e},jt.cmp=function(e){var t,r=this,n=r.c,i=(e=new r.constructor(e)).c,o=r.s,s=e.s,a=r.e,u=e.e;if(!n[0]||!i[0])return n[0]?o:i[0]?-s:0;if(o!=s)return o;if(t=o<0,a!=u)return a>u^t?1:-1;for(s=(a=n.length)<(u=i.length)?a:u,o=-1;++o<s;)if(n[o]!=i[o])return n[o]>i[o]^t?1:-1;return a==u?0:a>u^t?1:-1},jt.div=function(e){var t=this,r=t.constructor,n=t.c,i=(e=new r(e)).c,o=t.s==e.s?1:-1,s=r.DP;if(s!==~~s||s<0||s>At)throw Error(Nt);if(!i[0])throw Error(Ut);if(!n[0])return new r(0*o);var a,u,c,f,l,h=i.slice(),p=a=i.length,d=n.length,m=n.slice(0,a),g=m.length,y=e,w=y.c=[],v=0,b=s+(y.e=t.e-e.e)+1;for(y.s=o,o=b<0?0:b,h.unshift(0);g++<a;)m.push(0);do{for(c=0;c<10;c++){if(a!=(g=m.length))f=a>g?1:-1;else for(l=-1,f=0;++l<a;)if(i[l]!=m[l]){f=i[l]>m[l]?1:-1;break}if(!(f<0))break;for(u=g==a?i:h;g;){if(m[--g]<u[g]){for(l=g;l&&!m[--l];)m[l]=9;--m[l],m[g]+=10}m[g]-=u[g]}for(;!m[0];)m.shift()}w[v++]=f?c:++c,m[0]&&f?m[g]=n[p]||0:m=[n[p]]}while((p++<d||m[0]!==Pt)&&o--);return w[0]||1==v||(w.shift(),y.e--),v>b&&zt(y,s,r.RM,m[0]!==Pt),y},jt.eq=function(e){return!this.cmp(e)},jt.gt=function(e){return this.cmp(e)>0},jt.gte=function(e){return this.cmp(e)>-1},jt.lt=function(e){return this.cmp(e)<0},jt.lte=function(e){return this.cmp(e)<1},jt.minus=jt.sub=function(e){var t,r,n,i,o=this,s=o.constructor,a=o.s,u=(e=new s(e)).s;if(a!=u)return e.s=-u,o.plus(e);var c=o.c.slice(),f=o.e,l=e.c,h=e.e;if(!c[0]||!l[0])return l[0]?(e.s=-u,e):new s(c[0]?o:0);if(a=f-h){for((i=a<0)?(a=-a,n=c):(h=f,n=l),n.reverse(),u=a;u--;)n.push(0);n.reverse()}else for(r=((i=c.length<l.length)?c:l).length,a=u=0;u<r;u++)if(c[u]!=l[u]){i=c[u]<l[u];break}if(i&&(n=c,c=l,l=n,e.s=-e.s),(u=(r=l.length)-(t=c.length))>0)for(;u--;)c[t++]=0;for(u=t;r>a;){if(c[--r]<l[r]){for(t=r;t&&!c[--t];)c[t]=9;--c[t],c[r]+=10}c[r]-=l[r]}for(;0===c[--u];)c.pop();for(;0===c[0];)c.shift(),--h;return c[0]||(e.s=1,c=[h=0]),e.c=c,e.e=h,e},jt.mod=function(e){var t,r=this,n=r.constructor,i=r.s,o=(e=new n(e)).s;if(!e.c[0])throw Error(Ut);return r.s=e.s=1,t=1==e.cmp(r),r.s=i,e.s=o,t?new n(r):(i=n.DP,o=n.RM,n.DP=n.RM=0,r=r.div(e),n.DP=i,n.RM=o,this.minus(r.times(e)))},jt.plus=jt.add=function(e){var t,r=this,n=r.constructor,i=r.s,o=(e=new n(e)).s;if(i!=o)return e.s=-o,r.minus(e);var s=r.e,a=r.c,u=e.e,c=e.c;if(!a[0]||!c[0])return c[0]?e:new n(a[0]?r:0*i);if(a=a.slice(),i=s-u){for(i>0?(u=s,t=c):(i=-i,t=a),t.reverse();i--;)t.push(0);t.reverse()}for(a.length-c.length<0&&(t=c,c=a,a=t),i=c.length,o=0;i;a[i]%=10)o=(a[--i]=a[i]+c[i]+o)/10|0;for(o&&(a.unshift(o),++u),i=a.length;0===a[--i];)a.pop();return e.c=a,e.e=u,e},jt.pow=function(e){var t=this,r=new t.constructor(1),n=r,i=e<0;if(e!==~~e||e<-1e6||e>Ot)throw Error(Bt+"exponent");for(i&&(e=-e);1&e&&(n=n.times(t)),e>>=1;)t=t.times(t);return i?r.div(n):n},jt.round=function(e,t){var r=this.constructor;if(e===Pt)e=0;else if(e!==~~e||e<-At||e>At)throw Error(Nt);return zt(new r(this),e,t===Pt?r.RM:t)},jt.sqrt=function(){var e,t,r,n=this,i=n.constructor,o=n.s,s=n.e,a=new i(.5);if(!n.c[0])return new i(n);if(o<0)throw Error(It+"No square root");0===(o=Math.sqrt(n+""))||o===1/0?((t=n.c.join("")).length+s&1||(t+="0"),s=((s+1)/2|0)-(s<0||1&s),e=new i(((o=Math.sqrt(t))==1/0?"1e":(o=o.toExponential()).slice(0,o.indexOf("e")+1))+s)):e=new i(o),s=e.e+(i.DP+=4);do{r=e,e=a.times(r.plus(n.div(r)))}while(r.c.slice(0,s).join("")!==e.c.slice(0,s).join(""));return zt(e,i.DP-=4,i.RM)},jt.times=jt.mul=function(e){var t,r=this,n=r.constructor,i=r.c,o=(e=new n(e)).c,s=i.length,a=o.length,u=r.e,c=e.e;if(e.s=r.s==e.s?1:-1,!i[0]||!o[0])return new n(0*e.s);for(e.e=u+c,s<a&&(t=i,i=o,o=t,c=s,s=a,a=c),t=new Array(c=s+a);c--;)t[c]=0;for(u=a;u--;){for(a=0,c=s+u;c>u;)a=t[c]+o[u]*i[c-u-1]+a,t[c--]=a%10,a=a/10|0;t[c]=(t[c]+a)%10}for(a?++e.e:t.shift(),u=t.length;!t[--u];)t.pop();return e.c=t,e},jt.toExponential=function(e){return Ft(this,1,e,e)},jt.toFixed=function(e){return Ft(this,2,e,this.e+e)},jt.toPrecision=function(e){return Ft(this,3,e,e-1)},jt.toString=function(){return Ft(this)},jt.valueOf=jt.toJSON=function(){return Ft(this,4)};var Lt=function e(){function t(r){var n=this;if(!(n instanceof t))return r===Pt?e():new t(r);r instanceof t?(n.s=r.s,n.e=r.e,n.c=r.c.slice()):function(e,t){var r,n,i;if(0===t&&1/t<0)t="-0";else if(!Rt.test(t+=""))throw Error(Bt+"number");e.s="-"==t.charAt(0)?(t=t.slice(1),-1):1,(r=t.indexOf("."))>-1&&(t=t.replace(".",""));(n=t.search(/e/i))>0?(r<0&&(r=n),r+=+t.slice(n+1),t=t.substring(0,n)):r<0&&(r=t.length);for(i=t.length,n=0;n<i&&"0"==t.charAt(n);)++n;if(n==i)e.c=[e.e=0];else{for(;i>0&&"0"==t.charAt(--i););for(e.e=r-n-1,e.c=[],r=0;n<=i;)e.c[r++]=+t.charAt(n++)}}(n,r),n.constructor=t}return t.prototype=jt,t.DP=20,t.RM=1,t.NE=-7,t.PE=21,t.version="5.2.2",t}();const Dt=(e,t)=>{const r=(e=e.toString()).indexOf(".");return e=-1!==r?e.substring(0,t+r+1):e.substring(0),Number(parseFloat(e).toFixed(t))},Ct=e=>(t,r)=>{if(He(t)||Z(t))return t;if(isNaN(Number(t)))return NaN;const n=Number(new Lt(Number(t)).mul(e));if(Z(null==r?void 0:r.decimalNumber)&&Z(null==r?void 0:r.fn))return n;if(!Z(null==r?void 0:r.decimalNumber)&&Z(null==r?void 0:r.fn))return Number(n.toFixed(null==r?void 0:r.decimalNumber));if(!Z(null==r?void 0:r.decimalNumber)&&!Z(null==r?void 0:r.fn)){if("toFixed"===(null==r?void 0:r.fn))return Number(n.toFixed(null==r?void 0:r.decimalNumber));if("floor"===(null==r?void 0:r.fn))return Dt(n,null==r?void 0:r.decimalNumber)}},$t=e=>(t,r)=>{const n=(null==r?void 0:r.decimalNumber)||2,i=(null==r?void 0:r.fn)||"toFixed";if(He(t)||Z(t))return t;if(isNaN(Number(t)))return NaN;const o=new Lt(Number(t)).div(e);return"toFixed"===i?Number(o.toFixed(n)):"floor"===i?Dt(Number(o),n):t},Yt=e=>{const t=Object.prototype.toString.call(e),r=/^\[object (.*)\]$/.exec(t);return null!==r?r[1].toLowerCase():null},qt=e=>"string"==typeof e?Ke(e):("array"!==Yt(e)&&"object"!==Yt(e)||(Array.isArray(e)&&e.forEach((e=>{qt(e)})),null===typeof e)||Object.keys(e).map((t=>{const r=e[t];"string"==typeof r&&(e[t]=Ke(r)),"object"!==Yt(r)&&"array"!==Yt(r)||qt(r)})),e);var Ht,Vt=new Uint8Array(16);function Wt(){if(!Ht&&!(Ht="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto)))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Ht(Vt)}var Zt=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;for(var Gt=[],Jt=0;Jt<256;++Jt)Gt.push((Jt+256).toString(16).substr(1));function Qt(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=(Gt[e[t+0]]+Gt[e[t+1]]+Gt[e[t+2]]+Gt[e[t+3]]+"-"+Gt[e[t+4]]+Gt[e[t+5]]+"-"+Gt[e[t+6]]+Gt[e[t+7]]+"-"+Gt[e[t+8]]+Gt[e[t+9]]+"-"+Gt[e[t+10]]+Gt[e[t+11]]+Gt[e[t+12]]+Gt[e[t+13]]+Gt[e[t+14]]+Gt[e[t+15]]).toLowerCase();if(!function(e){return"string"==typeof e&&Zt.test(e)}(r))throw TypeError("Stringified UUID is invalid");return r}function Xt(e,t,r){var n=(e=e||{}).random||(e.rng||Wt)();return n[6]=15&n[6]|64,n[8]=63&n[8]|128,Qt(n)}const Kt="input is invalid type",er="0123456789abcdef".split(""),tr=[128,32768,8388608,-2147483648];let rr,nr=[];const ir=new ArrayBuffer(68);rr=new Uint8Array(ir),nr=new Uint32Array(ir);function or(){nr[0]=nr[16]=nr[1]=nr[2]=nr[3]=nr[4]=nr[5]=nr[6]=nr[7]=nr[8]=nr[9]=nr[10]=nr[11]=nr[12]=nr[13]=nr[14]=nr[15]=0,this.blocks=nr,this.buffer8=rr,this.h0=this.h1=this.h2=this.h3=this.start=this.bytes=this.hBytes=0,this.finalized=this.hashed=!1,this.first=!0}or.prototype.update=function(e){if(this.finalized)return;let t;const r=typeof e;if("string"!==r){if("object"!==r)throw Kt;if(null===e)throw Kt;if(e.constructor===ArrayBuffer)e=new Uint8Array(e);else if(!Array.isArray(e)&&!ArrayBuffer.isView(e))throw Kt;t=!0}let n,i,o=0,s=e.length,a=this.blocks,u=this.buffer8;for(;o<s;){if(this.hashed&&(this.hashed=!1,a[0]=a[16],a[16]=a[1]=a[2]=a[3]=a[4]=a[5]=a[6]=a[7]=a[8]=a[9]=a[10]=a[11]=a[12]=a[13]=a[14]=a[15]=0),t)for(i=this.start;o<s&&i<64;++o)u[i++]=e[o];else for(i=this.start;o<s&&i<64;++o)n=e.charCodeAt(o),n<128?u[i++]=n:n<2048?(u[i++]=192|n>>6,u[i++]=128|63&n):n<55296||n>=57344?(u[i++]=224|n>>12,u[i++]=128|n>>6&63,u[i++]=128|63&n):(n=65536+((1023&n)<<10|1023&e.charCodeAt(++o)),u[i++]=240|n>>18,u[i++]=128|n>>12&63,u[i++]=128|n>>6&63,u[i++]=128|63&n);this.lastByteIndex=i,this.bytes+=i-this.start,i>=64?(this.start=i-64,this.hash(),this.hashed=!0):this.start=i}return this.bytes>4294967295&&(this.hBytes+=this.bytes/4294967296|0,this.bytes=this.bytes%4294967296),this},or.prototype.finalize=function(){if(this.finalized)return;this.finalized=!0;const e=this.blocks,t=this.lastByteIndex;e[t>>2]|=tr[3&t],t>=56&&(this.hashed||this.hash(),e[0]=e[16],e[16]=e[1]=e[2]=e[3]=e[4]=e[5]=e[6]=e[7]=e[8]=e[9]=e[10]=e[11]=e[12]=e[13]=e[14]=e[15]=0),e[14]=this.bytes<<3,e[15]=this.hBytes<<3|this.bytes>>>29,this.hash()},or.prototype.hash=function(){let e,t,r,n,i,o,s=this.blocks;this.first?(e=s[0]-680876937,e=(e<<7|e>>>25)-271733879|0,n=(-1732584194^2004318071&e)+s[1]-117830708,n=(n<<12|n>>>20)+e|0,r=(-271733879^n&(-271733879^e))+s[2]-1126478375,r=(r<<17|r>>>15)+n|0,t=(e^r&(n^e))+s[3]-1316259209,t=(t<<22|t>>>10)+r|0):(e=this.h0,t=this.h1,r=this.h2,n=this.h3,e+=(n^t&(r^n))+s[0]-680876936,e=(e<<7|e>>>25)+t|0,n+=(r^e&(t^r))+s[1]-389564586,n=(n<<12|n>>>20)+e|0,r+=(t^n&(e^t))+s[2]+606105819,r=(r<<17|r>>>15)+n|0,t+=(e^r&(n^e))+s[3]-1044525330,t=(t<<22|t>>>10)+r|0),e+=(n^t&(r^n))+s[4]-176418897,e=(e<<7|e>>>25)+t|0,n+=(r^e&(t^r))+s[5]+1200080426,n=(n<<12|n>>>20)+e|0,r+=(t^n&(e^t))+s[6]-1473231341,r=(r<<17|r>>>15)+n|0,t+=(e^r&(n^e))+s[7]-45705983,t=(t<<22|t>>>10)+r|0,e+=(n^t&(r^n))+s[8]+1770035416,e=(e<<7|e>>>25)+t|0,n+=(r^e&(t^r))+s[9]-1958414417,n=(n<<12|n>>>20)+e|0,r+=(t^n&(e^t))+s[10]-42063,r=(r<<17|r>>>15)+n|0,t+=(e^r&(n^e))+s[11]-1990404162,t=(t<<22|t>>>10)+r|0,e+=(n^t&(r^n))+s[12]+1804603682,e=(e<<7|e>>>25)+t|0,n+=(r^e&(t^r))+s[13]-40341101,n=(n<<12|n>>>20)+e|0,r+=(t^n&(e^t))+s[14]-1502002290,r=(r<<17|r>>>15)+n|0,t+=(e^r&(n^e))+s[15]+1236535329,t=(t<<22|t>>>10)+r|0,e+=(r^n&(t^r))+s[1]-165796510,e=(e<<5|e>>>27)+t|0,n+=(t^r&(e^t))+s[6]-1069501632,n=(n<<9|n>>>23)+e|0,r+=(e^t&(n^e))+s[11]+643717713,r=(r<<14|r>>>18)+n|0,t+=(n^e&(r^n))+s[0]-373897302,t=(t<<20|t>>>12)+r|0,e+=(r^n&(t^r))+s[5]-701558691,e=(e<<5|e>>>27)+t|0,n+=(t^r&(e^t))+s[10]+38016083,n=(n<<9|n>>>23)+e|0,r+=(e^t&(n^e))+s[15]-660478335,r=(r<<14|r>>>18)+n|0,t+=(n^e&(r^n))+s[4]-405537848,t=(t<<20|t>>>12)+r|0,e+=(r^n&(t^r))+s[9]+568446438,e=(e<<5|e>>>27)+t|0,n+=(t^r&(e^t))+s[14]-1019803690,n=(n<<9|n>>>23)+e|0,r+=(e^t&(n^e))+s[3]-187363961,r=(r<<14|r>>>18)+n|0,t+=(n^e&(r^n))+s[8]+1163531501,t=(t<<20|t>>>12)+r|0,e+=(r^n&(t^r))+s[13]-1444681467,e=(e<<5|e>>>27)+t|0,n+=(t^r&(e^t))+s[2]-51403784,n=(n<<9|n>>>23)+e|0,r+=(e^t&(n^e))+s[7]+1735328473,r=(r<<14|r>>>18)+n|0,t+=(n^e&(r^n))+s[12]-1926607734,t=(t<<20|t>>>12)+r|0,i=t^r,e+=(i^n)+s[5]-378558,e=(e<<4|e>>>28)+t|0,n+=(i^e)+s[8]-2022574463,n=(n<<11|n>>>21)+e|0,o=n^e,r+=(o^t)+s[11]+1839030562,r=(r<<16|r>>>16)+n|0,t+=(o^r)+s[14]-35309556,t=(t<<23|t>>>9)+r|0,i=t^r,e+=(i^n)+s[1]-1530992060,e=(e<<4|e>>>28)+t|0,n+=(i^e)+s[4]+1272893353,n=(n<<11|n>>>21)+e|0,o=n^e,r+=(o^t)+s[7]-155497632,r=(r<<16|r>>>16)+n|0,t+=(o^r)+s[10]-1094730640,t=(t<<23|t>>>9)+r|0,i=t^r,e+=(i^n)+s[13]+681279174,e=(e<<4|e>>>28)+t|0,n+=(i^e)+s[0]-358537222,n=(n<<11|n>>>21)+e|0,o=n^e,r+=(o^t)+s[3]-722521979,r=(r<<16|r>>>16)+n|0,t+=(o^r)+s[6]+76029189,t=(t<<23|t>>>9)+r|0,i=t^r,e+=(i^n)+s[9]-640364487,e=(e<<4|e>>>28)+t|0,n+=(i^e)+s[12]-421815835,n=(n<<11|n>>>21)+e|0,o=n^e,r+=(o^t)+s[15]+530742520,r=(r<<16|r>>>16)+n|0,t+=(o^r)+s[2]-995338651,t=(t<<23|t>>>9)+r|0,e+=(r^(t|~n))+s[0]-198630844,e=(e<<6|e>>>26)+t|0,n+=(t^(e|~r))+s[7]+1126891415,n=(n<<10|n>>>22)+e|0,r+=(e^(n|~t))+s[14]-1416354905,r=(r<<15|r>>>17)+n|0,t+=(n^(r|~e))+s[5]-57434055,t=(t<<21|t>>>11)+r|0,e+=(r^(t|~n))+s[12]+1700485571,e=(e<<6|e>>>26)+t|0,n+=(t^(e|~r))+s[3]-1894986606,n=(n<<10|n>>>22)+e|0,r+=(e^(n|~t))+s[10]-1051523,r=(r<<15|r>>>17)+n|0,t+=(n^(r|~e))+s[1]-2054922799,t=(t<<21|t>>>11)+r|0,e+=(r^(t|~n))+s[8]+1873313359,e=(e<<6|e>>>26)+t|0,n+=(t^(e|~r))+s[15]-30611744,n=(n<<10|n>>>22)+e|0,r+=(e^(n|~t))+s[6]-1560198380,r=(r<<15|r>>>17)+n|0,t+=(n^(r|~e))+s[13]+1309151649,t=(t<<21|t>>>11)+r|0,e+=(r^(t|~n))+s[4]-145523070,e=(e<<6|e>>>26)+t|0,n+=(t^(e|~r))+s[11]-1120210379,n=(n<<10|n>>>22)+e|0,r+=(e^(n|~t))+s[2]+718787259,r=(r<<15|r>>>17)+n|0,t+=(n^(r|~e))+s[9]-343485551,t=(t<<21|t>>>11)+r|0,this.first?(this.h0=e+1732584193|0,this.h1=t-271733879|0,this.h2=r-1732584194|0,this.h3=n+271733878|0,this.first=!1):(this.h0=this.h0+e|0,this.h1=this.h1+t|0,this.h2=this.h2+r|0,this.h3=this.h3+n|0)},or.prototype.hex=function(){this.finalize();let e=this.h0,t=this.h1,r=this.h2,n=this.h3;return er[e>>4&15]+er[15&e]+er[e>>12&15]+er[e>>8&15]+er[e>>20&15]+er[e>>16&15]+er[e>>28&15]+er[e>>24&15]+er[t>>4&15]+er[15&t]+er[t>>12&15]+er[t>>8&15]+er[t>>20&15]+er[t>>16&15]+er[t>>28&15]+er[t>>24&15]+er[r>>4&15]+er[15&r]+er[r>>12&15]+er[r>>8&15]+er[r>>20&15]+er[r>>16&15]+er[r>>28&15]+er[r>>24&15]+er[n>>4&15]+er[15&n]+er[n>>12&15]+er[n>>8&15]+er[n>>20&15]+er[n>>16&15]+er[n>>28&15]+er[n>>24&15]};var sr=e=>(new or).update(e).hex();function ar(e){const t=typeof e;return null!=e&&("object"===t||"function"===t)}function ur(e,t,r){if("undefined"==typeof window)return;let n,i,o,s,a,u,c=0,f=!1,l=!1,h=!0;const p=!t&&0!==t&&"function"==typeof requestAnimationFrame;if("function"!=typeof e)throw new TypeError("Expected a function");function d(t){const r=n,o=i;return n=i=void 0,c=t,s=e.apply(o,r),s}function m(e,t){return p?(cancelAnimationFrame(a),requestAnimationFrame(e)):setTimeout(e,t)}function g(e){const r=e-u;return void 0===u||r>=t||r<0||l&&e-c>=o}function y(){const e=Date.now();if(g(e))return w(e);a=m(y,function(e){const r=e-c,n=t-(e-u);return l?Math.min(n,o-r):n}(e))}function w(e){return a=void 0,h&&n?d(e):(n=i=void 0,s)}function v(...e){const r=Date.now(),o=g(r);if(n=e,i=this,u=r,o){if(void 0===a)return function(e){return c=e,a=m(y,t),f?d(e):s}(u);if(l)return a=m(y,t),d(u)}return void 0===a&&(a=m(y,t)),s}return t=+t||0,ar(r)&&(f=!!r.leading,l="maxWait"in r,o=l?Math.max(+r.maxWait||0,t):o,h="trailing"in r?!!r.trailing:h),v.cancel=function(){void 0!==a&&function(e){if(p)return cancelAnimationFrame(e);clearTimeout(e)}(a),c=0,n=u=i=a=void 0},v.flush=function(){return void 0===a?s:w(Date.now())},v.pending=function(){return void 0!==a},v}var cr={},fr={
1
+ !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).YWTOOLS={})}(this,(function(e){"use strict";function t(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{c(n.next(e))}catch(e){o(e)}}function a(e){try{c(n.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,a)}c((n=n.apply(e,t||[])).next())}))}function r(e,t){var r,n,i,o,s={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function a(a){return function(c){return function(a){if(r)throw new TypeError("Generator is already executing.");for(;o&&(o=0,a[0]&&(s=0)),s;)try{if(r=1,n&&(i=2&a[0]?n.return:a[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,a[1])).done)return i;switch(n=0,i&&(a=[2&a[0],i.value]),a[0]){case 0:case 1:i=a;break;case 4:return s.label++,{value:a[1],done:!1};case 5:s.label++,n=a[1],a=[0];continue;case 7:a=s.ops.pop(),s.trys.pop();continue;default:if(!(i=s.trys,(i=i.length>0&&i[i.length-1])||6!==a[0]&&2!==a[0])){s=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]<i[3])){s.label=a[1];break}if(6===a[0]&&s.label<i[1]){s.label=i[1],i=a;break}if(i&&s.label<i[2]){s.label=i[2],s.ops.push(a);break}i[2]&&s.ops.pop(),s.trys.pop();continue}a=t.call(e,s)}catch(e){a=[6,e],n=0}finally{r=i=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,c])}}}function n(e){if(e.__esModule)return e;var t=e.default;if("function"==typeof t){var r=function e(){return this instanceof e?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};r.prototype=t.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(e).forEach((function(t){var n=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(r,t,n.get?n:{enumerable:!0,get:function(){return e[t]}})})),r}"function"==typeof SuppressedError&&SuppressedError;var i={},o=n(Object.freeze({__proto__:null,default:{}}));!function(e){function t(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}Object.defineProperty(e,"__esModule",{value:!0});var r=t(o);function n(e){return null!=e&&"object"==typeof e&&!0===e["@@functional/placeholder"]}function i(e){return function t(r){return 0===arguments.length||n(r)?t:e.apply(this,arguments)}}function s(e){return function t(r,o){switch(arguments.length){case 0:return t;case 1:return n(r)?t:i((function(t){return e(r,t)}));default:return n(r)&&n(o)?t:n(r)?i((function(t){return e(t,o)})):n(o)?i((function(t){return e(r,t)})):e(r,o)}}}function a(e,t){var r;t=t||[];var n=(e=e||[]).length,i=t.length,o=[];for(r=0;r<n;)o[o.length]=e[r],r+=1;for(r=0;r<i;)o[o.length]=t[r],r+=1;return o}function c(e,t){switch(e){case 0:return function(){return t.apply(this,arguments)};case 1:return function(e){return t.apply(this,arguments)};case 2:return function(e,r){return t.apply(this,arguments)};case 3:return function(e,r,n){return t.apply(this,arguments)};case 4:return function(e,r,n,i){return t.apply(this,arguments)};case 5:return function(e,r,n,i,o){return t.apply(this,arguments)};case 6:return function(e,r,n,i,o,s){return t.apply(this,arguments)};case 7:return function(e,r,n,i,o,s,a){return t.apply(this,arguments)};case 8:return function(e,r,n,i,o,s,a,c){return t.apply(this,arguments)};case 9:return function(e,r,n,i,o,s,a,c,u){return t.apply(this,arguments)};case 10:return function(e,r,n,i,o,s,a,c,u,f){return t.apply(this,arguments)};default:throw new Error("First argument to _arity must be a non-negative integer no greater than ten")}}function u(e,t,r){return function(){for(var i=[],o=0,s=e,a=0;a<t.length||o<arguments.length;){var f;a<t.length&&(!n(t[a])||o>=arguments.length)?f=t[a]:(f=arguments[o],o+=1),i[a]=f,n(f)||(s-=1),a+=1}return s<=0?r.apply(this,i):c(s,u(e,i,r))}}var f=s((function(e,t){return 1===e?i(t):c(e,u(e,[],t))}));function l(e){return function t(r,o,a){switch(arguments.length){case 0:return t;case 1:return n(r)?t:s((function(t,n){return e(r,t,n)}));case 2:return n(r)&&n(o)?t:n(r)?s((function(t,r){return e(t,o,r)})):n(o)?s((function(t,n){return e(r,t,n)})):i((function(t){return e(r,o,t)}));default:return n(r)&&n(o)&&n(a)?t:n(r)&&n(o)?s((function(t,r){return e(t,r,a)})):n(r)&&n(a)?s((function(t,r){return e(t,o,r)})):n(o)&&n(a)?s((function(t,n){return e(r,t,n)})):n(r)?i((function(t){return e(t,o,a)})):n(o)?i((function(t){return e(r,t,a)})):n(a)?i((function(t){return e(r,o,t)})):e(r,o,a)}}}var h=Array.isArray||function(e){return null!=e&&e.length>=0&&"[object Array]"===Object.prototype.toString.call(e)};function p(e,t,r){return function(){if(0===arguments.length)return r();var n=Array.prototype.slice.call(arguments,0),i=n.pop();if(!h(i)){for(var o=0;o<e.length;){if("function"==typeof i[e[o]])return i[e[o]].apply(i,n);o+=1}if(function(e){return null!=e&&"function"==typeof e["@@transducer/step"]}(i))return t.apply(null,n)(i)}return r.apply(this,arguments)}}var d=function(){return this.xf["@@transducer/init"]()},m=function(e){return this.xf["@@transducer/result"](e)};function g(e,t){for(var r=0,n=t.length,i=Array(n);r<n;)i[r]=e(t[r]),r+=1;return i}function y(e){return"[object String]"===Object.prototype.toString.call(e)}var w=i((function(e){return!!h(e)||!!e&&("object"==typeof e&&(!y(e)&&(1===e.nodeType?!!e.length:0===e.length||e.length>0&&(e.hasOwnProperty(0)&&e.hasOwnProperty(e.length-1)))))})),b=function(){function e(e){this.f=e}return e.prototype["@@transducer/init"]=function(){throw new Error("init not implemented on XWrap")},e.prototype["@@transducer/result"]=function(e){return e},e.prototype["@@transducer/step"]=function(e,t){return this.f(e,t)},e}();var x=s((function(e,t){return c(e.length,(function(){return e.apply(t,arguments)}))})),v=x;function k(e,t,r){for(var n=r.next();!n.done;){if((t=e["@@transducer/step"](t,n.value))&&t["@@transducer/reduced"]){t=t["@@transducer/value"];break}n=r.next()}return e["@@transducer/result"](t)}function S(e,t,r,n){return e["@@transducer/result"](r[n](v(e["@@transducer/step"],e),t))}var E="undefined"!=typeof Symbol?Symbol.iterator:"@@iterator";function T(e,t,r){if("function"==typeof e&&(e=function(e){return new b(e)}(e)),w(r))return function(e,t,r){for(var n=0,i=r.length;n<i;){if((t=e["@@transducer/step"](t,r[n]))&&t["@@transducer/reduced"]){t=t["@@transducer/value"];break}n+=1}return e["@@transducer/result"](t)}(e,t,r);if("function"==typeof r["fantasy-land/reduce"])return S(e,t,r,"fantasy-land/reduce");if(null!=r[E])return k(e,t,r[E]());if("function"==typeof r.next)return k(e,t,r);if("function"==typeof r.reduce)return S(e,t,r,"reduce");throw new TypeError("reduce: list must be array or iterable")}var O=function(){function e(e,t){this.xf=t,this.f=e}return e.prototype["@@transducer/init"]=d,e.prototype["@@transducer/result"]=m,e.prototype["@@transducer/step"]=function(e,t){return this.xf["@@transducer/step"](e,this.f(t))},e}(),N=s((function(e,t){return new O(e,t)}));function _(e,t){return Object.prototype.hasOwnProperty.call(t,e)}var j=Object.prototype.toString,I=function(){return"[object Arguments]"===j.call(arguments)?function(e){return"[object Arguments]"===j.call(e)}:function(e){return _("callee",e)}}(),B=I,M=!{toString:null}.propertyIsEnumerable("toString"),A=["constructor","valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"],z=function(){return arguments.propertyIsEnumerable("length")}(),F=function(e,t){for(var r=0;r<e.length;){if(e[r]===t)return!0;r+=1}return!1},U="function"!=typeof Object.keys||z?i((function(e){if(Object(e)!==e)return[];var t,r,n=[],i=z&&B(e);for(t in e)!_(t,e)||i&&"length"===t||(n[n.length]=t);if(M)for(r=A.length-1;r>=0;)_(t=A[r],e)&&!F(n,t)&&(n[n.length]=t),r-=1;return n})):i((function(e){return Object(e)!==e?[]:Object.keys(e)})),P=U,L=s(p(["fantasy-land/map","map"],N,(function(e,t){switch(Object.prototype.toString.call(t)){case"[object Function]":return f(t.length,(function(){return e.call(this,t.apply(this,arguments))}));case"[object Object]":return T((function(r,n){return r[n]=e(t[n]),r}),{},P(t));default:return g(e,t)}}))),$=L,D=Number.isInteger||function(e){return(e|0)===e},R=s((function(e,t){var r=e<0?t.length+e:e;return y(t)?t.charAt(r):t[r]})),C=s((function(e,t){return e.map((function(e){for(var r,n=t,i=0;i<e.length;){if(null==n)return;r=e[i],n=D(r)?R(r,n):n[r],i+=1}return n}))})),q=s((function(e,t){return C([e],t)[0]})),H=s((function(e,t){return q([e],t)})),W=l(T),Y=s((function(e,t){return"function"==typeof t["fantasy-land/ap"]?t["fantasy-land/ap"](e):"function"==typeof e.ap?e.ap(t):"function"==typeof e?function(r){return e(r)(t(r))}:T((function(e,r){return a(e,$(r,t))}),[],e)})),V=i((function(e){for(var t=P(e),r=t.length,n=[],i=0;i<r;)n[i]=e[t[i]],i+=1;return n})),Q=i((function(e){return null==e}));function Z(e){var t=Object.prototype.toString.call(e);return"[object Function]"===t||"[object AsyncFunction]"===t||"[object GeneratorFunction]"===t||"[object AsyncGeneratorFunction]"===t}var G=s((function(e,t){var r=f(e,t);return f(e,(function(){return T(Y,$(r,arguments[0]),Array.prototype.slice.call(arguments,1))}))})),J=G,X=i((function(e){return J(e.length,e)})),K=i((function(e){return f(e.length,e)}));function ee(e){return function e(t){for(var r,n,i,o=[],s=0,a=t.length;s<a;){if(w(t[s]))for(i=0,n=(r=e(t[s])).length;i<n;)o[o.length]=r[i],i+=1;else o[o.length]=t[s];s+=1}return o}}var te=i((function(e){return null===e?"Null":void 0===e?"Undefined":Object.prototype.toString.call(e).slice(8,-1)})),re=X(i((function(e){return!e})));function ne(e,t){return function(){return t.call(this,e.apply(this,arguments))}}function ie(e,t){return function(){var r=arguments.length;if(0===r)return t();var n=arguments[r-1];return h(n)||"function"!=typeof n[e]?t.apply(this,arguments):n[e].apply(n,Array.prototype.slice.call(arguments,0,r-1))}}var oe=l(ie("slice",(function(e,t,r){return Array.prototype.slice.call(r,e,t)}))),se=i(ie("tail",oe(1,1/0)));function ae(){if(0===arguments.length)throw new Error("pipe requires at least one argument");return c(arguments[0].length,W(ne,arguments[0],se(arguments)))}var ce=i((function(e){return y(e)?e.split("").reverse().join(""):Array.prototype.slice.call(e,0).reverse()}));function ue(){if(0===arguments.length)throw new Error("compose requires at least one argument");return ae.apply(this,ce(arguments))}function fe(e){return e}var le=i(fe);function he(e){for(var t,r=[];!(t=e.next()).done;)r.push(t.value);return r}function pe(e,t,r){for(var n=0,i=r.length;n<i;){if(e(t,r[n]))return!0;n+=1}return!1}var de="function"==typeof Object.is?Object.is:function(e,t){return e===t?0!==e||1/e==1/t:e!=e&&t!=t};function me(e,t,r,n){var i=he(e);function o(e,t){return ge(e,t,r.slice(),n.slice())}return!pe((function(e,t){return!pe(o,t,e)}),he(t),i)}function ge(e,t,r,n){if(de(e,t))return!0;var i,o,s=te(e);if(s!==te(t))return!1;if(null==e||null==t)return!1;if("function"==typeof e["fantasy-land/equals"]||"function"==typeof t["fantasy-land/equals"])return"function"==typeof e["fantasy-land/equals"]&&e["fantasy-land/equals"](t)&&"function"==typeof t["fantasy-land/equals"]&&t["fantasy-land/equals"](e);if("function"==typeof e.equals||"function"==typeof t.equals)return"function"==typeof e.equals&&e.equals(t)&&"function"==typeof t.equals&&t.equals(e);switch(s){case"Arguments":case"Array":case"Object":if("function"==typeof e.constructor&&"Promise"===(i=e.constructor,null==(o=String(i).match(/^function (\w*)/))?"":o[1]))return e===t;break;case"Boolean":case"Number":case"String":if(typeof e!=typeof t||!de(e.valueOf(),t.valueOf()))return!1;break;case"Date":if(!de(e.valueOf(),t.valueOf()))return!1;break;case"Error":return e.name===t.name&&e.message===t.message;case"RegExp":if(e.source!==t.source||e.global!==t.global||e.ignoreCase!==t.ignoreCase||e.multiline!==t.multiline||e.sticky!==t.sticky||e.unicode!==t.unicode)return!1}for(var a=r.length-1;a>=0;){if(r[a]===e)return n[a]===t;a-=1}switch(s){case"Map":return e.size===t.size&&me(e.entries(),t.entries(),r.concat([e]),n.concat([t]));case"Set":return e.size===t.size&&me(e.values(),t.values(),r.concat([e]),n.concat([t]));case"Arguments":case"Array":case"Object":case"Boolean":case"Number":case"String":case"Date":case"Error":case"RegExp":case"Int8Array":case"Uint8Array":case"Uint8ClampedArray":case"Int16Array":case"Uint16Array":case"Int32Array":case"Uint32Array":case"Float32Array":case"Float64Array":case"ArrayBuffer":break;default:return!1}var c=P(e);if(c.length!==P(t).length)return!1;var u=r.concat([e]),f=n.concat([t]);for(a=c.length-1;a>=0;){var l=c[a];if(!_(l,t)||!ge(t[l],e[l],u,f))return!1;a-=1}return!0}var ye=s((function(e,t){return ge(e,t,[],[])}));function we(e,t){return function(e,t,r){var n,i;if("function"==typeof e.indexOf)switch(typeof t){case"number":if(0===t){for(n=1/t;r<e.length;){if(0===(i=e[r])&&1/i===n)return r;r+=1}return-1}if(t!=t){for(;r<e.length;){if("number"==typeof(i=e[r])&&i!=i)return r;r+=1}return-1}return e.indexOf(t,r);case"string":case"boolean":case"function":case"undefined":return e.indexOf(t,r);case"object":if(null===t)return e.indexOf(t,r)}for(;r<e.length;){if(ye(e[r],t))return r;r+=1}return-1}(t,e,0)>=0}function be(e){return'"'+e.replace(/\\/g,"\\\\").replace(/[\b]/g,"\\b").replace(/\f/g,"\\f").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\t/g,"\\t").replace(/\v/g,"\\v").replace(/\0/g,"\\0").replace(/"/g,'\\"')+'"'}var xe=function(e){return(e<10?"0":"")+e},ve="function"==typeof Date.prototype.toISOString?function(e){return e.toISOString()}:function(e){return e.getUTCFullYear()+"-"+xe(e.getUTCMonth()+1)+"-"+xe(e.getUTCDate())+"T"+xe(e.getUTCHours())+":"+xe(e.getUTCMinutes())+":"+xe(e.getUTCSeconds())+"."+(e.getUTCMilliseconds()/1e3).toFixed(3).slice(2,5)+"Z"};function ke(e){return"[object Object]"===Object.prototype.toString.call(e)}var Se=function(){function e(e,t){this.xf=t,this.f=e}return e.prototype["@@transducer/init"]=d,e.prototype["@@transducer/result"]=m,e.prototype["@@transducer/step"]=function(e,t){return this.f(t)?this.xf["@@transducer/step"](e,t):e},e}(),Ee=s(p(["filter"],s((function(e,t){return new Se(e,t)})),(function(e,t){return ke(t)?T((function(r,n){return e(t[n])&&(r[n]=t[n]),r}),{},P(t)):function(e,t){for(var r=0,n=t.length,i=[];r<n;)e(t[r])&&(i[i.length]=t[r]),r+=1;return i}(e,t)}))),Te=s((function(e,t){return Ee((r=e,function(){return!r.apply(this,arguments)}),t);var r})),Oe=Te;function Ne(e,t){var r=function(r){var n=t.concat([e]);return we(r,n)?"<Circular>":Ne(r,n)},n=function(e,t){return g((function(t){return be(t)+": "+r(e[t])}),t.slice().sort())};switch(Object.prototype.toString.call(e)){case"[object Arguments]":return"(function() { return arguments; }("+g(r,e).join(", ")+"))";case"[object Array]":return"["+g(r,e).concat(n(e,Oe((function(e){return/^\d+$/.test(e)}),P(e)))).join(", ")+"]";case"[object Boolean]":return"object"==typeof e?"new Boolean("+r(e.valueOf())+")":e.toString();case"[object Date]":return"new Date("+(isNaN(e.valueOf())?r(NaN):be(ve(e)))+")";case"[object Null]":return"null";case"[object Number]":return"object"==typeof e?"new Number("+r(e.valueOf())+")":1/e==-1/0?"-0":e.toString(10);case"[object String]":return"object"==typeof e?"new String("+r(e.valueOf())+")":be(e);case"[object Undefined]":return"undefined";default:if("function"==typeof e.toString){var i=e.toString();if("[object Object]"!==i)return i}return"{"+n(e,P(e)).join(", ")+"}"}}var _e=i((function(e){return Ne(e,[])})),je=s((function(e,t){if(h(e)){if(h(t))return e.concat(t);throw new TypeError(_e(t)+" is not an array")}if(y(e)){if(y(t))return e+t;throw new TypeError(_e(t)+" is not a string")}if(null!=e&&Z(e["fantasy-land/concat"]))return e["fantasy-land/concat"](t);if(null!=e&&Z(e.concat))return e.concat(t);throw new TypeError(_e(e)+' does not have a method named "concat" or "fantasy-land/concat"')}));function Ie(e,t,r){var n,i=typeof e;switch(i){case"string":case"number":return 0===e&&1/e==-1/0?!!r._items["-0"]||(t&&(r._items["-0"]=!0),!1):null!==r._nativeSet?t?(n=r._nativeSet.size,r._nativeSet.add(e),r._nativeSet.size===n):r._nativeSet.has(e):i in r._items?e in r._items[i]||(t&&(r._items[i][e]=!0),!1):(t&&(r._items[i]={},r._items[i][e]=!0),!1);case"boolean":if(i in r._items){var o=e?1:0;return!!r._items[i][o]||(t&&(r._items[i][o]=!0),!1)}return t&&(r._items[i]=e?[!1,!0]:[!0,!1]),!1;case"function":return null!==r._nativeSet?t?(n=r._nativeSet.size,r._nativeSet.add(e),r._nativeSet.size===n):r._nativeSet.has(e):i in r._items?!!we(e,r._items[i])||(t&&r._items[i].push(e),!1):(t&&(r._items[i]=[e]),!1);case"undefined":return!!r._items[i]||(t&&(r._items[i]=!0),!1);case"object":if(null===e)return!!r._items.null||(t&&(r._items.null=!0),!1);default:return(i=Object.prototype.toString.call(e))in r._items?!!we(e,r._items[i])||(t&&r._items[i].push(e),!1):(t&&(r._items[i]=[e]),!1)}}var Be=function(){function e(){this._nativeSet="function"==typeof Set?new Set:null,this._items={}}return e.prototype.add=function(e){return!Ie(e,!0,this)},e.prototype.has=function(e){return Ie(e,!1,this)},e}(),Me=i((function(e){return null!=e&&"function"==typeof e["fantasy-land/empty"]?e["fantasy-land/empty"]():null!=e&&null!=e.constructor&&"function"==typeof e.constructor["fantasy-land/empty"]?e.constructor["fantasy-land/empty"]():null!=e&&"function"==typeof e.empty?e.empty():null!=e&&null!=e.constructor&&"function"==typeof e.constructor.empty?e.constructor.empty():h(e)?[]:y(e)?"":ke(e)?{}:B(e)?function(){return arguments}():void 0})),Ae=Me,ze=function(){function e(e,t){this.xf=t,this.f=e,this.found=!1}return e.prototype["@@transducer/init"]=d,e.prototype["@@transducer/result"]=function(e){return this.found||(e=this.xf["@@transducer/step"](e,void 0)),this.xf["@@transducer/result"](e)},e.prototype["@@transducer/step"]=function(e,t){var r;return this.f(t)&&(this.found=!0,e=(r=this.xf["@@transducer/step"](e,t))&&r["@@transducer/reduced"]?r:{"@@transducer/value":r,"@@transducer/reduced":!0}),e},e}(),Fe=s(p(["find"],s((function(e,t){return new ze(e,t)})),(function(e,t){for(var r=0,n=t.length;r<n;){if(e(t[r]))return t[r];r+=1}}))),Ue=i(ee()),Pe=i((function(e){for(var t={},r=0;r<e.length;)t[e[r][0]]=e[r][1],r+=1;return t})),Le=s((function(e,t){if(0===e.length||Q(t))return!1;for(var r=t,n=0;n<e.length;){if(Q(r)||!_(e[n],r))return!1;r=r[e[n]],n+=1}return!0})),$e=s((function(e,t){for(var r,n,i=new Be,o=[],s=0;s<t.length;)r=e(n=t[s]),i.add(r)&&o.push(n),s+=1;return o}))(le);var De="function"==typeof Object.assign?Object.assign:function(e){if(null==e)throw new TypeError("Cannot convert undefined or null to object");for(var t=Object(e),r=1,n=arguments.length;r<n;){var i=arguments[r];if(null!=i)for(var o in i)_(o,i)&&(t[o]=i[o]);r+=1}return t},Re=s((function(e,t){return f(e+1,(function(){var r=arguments[e];if(null!=r&&Z(r[t]))return r[t].apply(r,Array.prototype.slice.call(arguments,0,e));throw new TypeError(_e(r)+' does not have a method named "'+t+'"')}))})),Ce=Re,qe=s((function(e,t){return null!=t&&t.constructor===e||t instanceof e})),He=i((function(e){return null!=e&&ye(e,Ae(e))})),We=i((function(e){return De.apply(null,[{}].concat(e))})),Ye=s((function(e,t){for(var r={},n={},i=0,o=e.length;i<o;)n[e[i]]=1,i+=1;for(var s in t)n.hasOwnProperty(s)||(r[s]=t[s]);return r})),Ve=Ye,Qe=l((function(e,t,r){return ye(t,r[e])})),Ze=l((function(e,t,r){return r.replace(e,t)})),Ge=Ce(1,"split"),Je="\t\n\v\f\r                 \u2028\u2029\ufeff",Xe=i("function"==typeof String.prototype.trim&&!Je.trim()&&"​".trim()?function(e){return e.trim()}:function(e){var t=new RegExp("^["+Je+"]["+Je+"]*"),r=new RegExp("["+Je+"]["+Je+"]*$");return e.replace(t,"").replace(r,"")}),Ke=s(ue($e,a));const et=e=>{if(Q(e)||He(e))return e;switch(te(e)){case"String":return Xe(e);case"Array":return Ee(re(He))(e);default:return e}},tt=(e,t)=>He(t)||Q(t)?[]:ae(Ge(e),et)(t),rt={set:(e,t)=>{"undefined"!=typeof window&&window.sessionStorage.setItem(e,t)},get:e=>"undefined"!=typeof window?window.sessionStorage.getItem(e):null,remove:e=>{"undefined"!=typeof window&&window.sessionStorage.removeItem(e)},clear:()=>{"undefined"!=typeof window&&window.sessionStorage.clear()}},nt={set:(e,t)=>{"undefined"!=typeof window&&window.localStorage.setItem(e,t)},get:e=>"undefined"!=typeof window?window.localStorage.getItem(e):null,remove:e=>{"undefined"!=typeof window&&window.localStorage.removeItem(e)},clear:()=>{"undefined"!=typeof window&&window.localStorage.clear()}},it={set:(e,t,r)=>{const n=new Date;n.setTime(n.getTime()+24*r*60*60*1e3);const i=`expires=${n.toUTCString()}`;document.cookie=`${e}=${escape(t)};${i};path=/`},get:e=>{const t=`${e}=`,r=document.cookie.split(";");for(let e=0;e<r.length;e+=1){let n=r[e];for(;" "===n.charAt(0);)n=n.substring(1);if(-1!==n.indexOf(t))return n.substring(t.length,n.length)}}};function ot(e,t,r,n){e.addEventListener(t,(function n(i){e.removeEventListener(t,n),r(i)}),n)}const st=["id","type","async","defer","crossOrigin","integrity","noModule"];const at=e=>{let t=e;return e instanceof Date?t=e:"string"==typeof e&&String(e).length>=13&&!isNaN(e)?t=Number(e):"string"==typeof e&&e.includes("-")&&(t=e.replace(/-/g,"/")),new Date(t)&&"Invalid Date"!==String(new Date(t))},ct=e=>{const t=e.replace(/-/g,"/");return new Date(t).valueOf()},ut=(e,t)=>{if(!at(e))return null;let r;isNaN(e)?"string"==typeof e&&e.includes("-")&&(e=e.replace(/-/g,"/")):e=Number(e),r=new Date(e);const n={YYYY:r.getFullYear(),YY:`${r.getFullYear()}`.slice(-2),MM:`0${r.getMonth()+1}`.slice(-2),M:r.getMonth()+1,DD:`0${r.getDate()}`.slice(-2),D:r.getDate(),HH:`0${r.getHours()}`.slice(-2),H:r.getHours(),hh:("0"+r.getHours()%12).slice(-2),h:r.getHours()%12,mm:`0${r.getMinutes()}`.slice(-2),m:r.getMinutes(),ss:`0${r.getSeconds()}`.slice(-2),s:r.getSeconds(),w:["日","一","二","三","四","五","六"][r.getDay()]};for(const e in n)t=t.replace(e,n[e]);return t},ft=(e,t,r,n)=>{let i="";return t.length>r?t:(i="left"===e?new Array(r-t.length+1).join(n)+t:t+new Array(r-t.length+1).join(n),i)},[lt,ht,pt]=[86400,3600,60],dt=(e,t,r=!0)=>{let n=e<0?0:parseFloat(`${e}`);if((isNaN(n)||!n)&&(!r||0!==n))return"-";let[i,o,s,a]=[void 0,void 0,void 0,void 0];t.indexOf("{DD}")>-1&&(i=Math.floor(n/lt),n=Math.floor(n%lt)),t.indexOf("{HH}")>-1&&(o=Math.floor(n/ht),n=Math.floor(n%ht)),t.indexOf("{mm}")>-1&&(s=Math.floor(n/pt),n=Math.floor(n%pt)),a=n;return t.replace("{ss}","number"==typeof a?ft("left",String(a),2,"0"):"").replace("{mm}","number"==typeof s?ft("left",String(s),2,"0"):"").replace("{HH}","number"==typeof o?ft("left",String(o),2,"0"):"").replace("{DD}","number"==typeof i?ft("left",String(i),2,"0"):"")},[mt,gt,yt]=[86400,3600,60],wt=(e,t,r)=>{const n={reduce:K(((e,r,i)=>{const o=e(r,i);return(e=>Le([t],e))(i)&&i[t]?i[t].reduce(n.reduce(e),o):o})),find:K(((e,t,r)=>ae($(n.reduce(e,t)),Ue)(r)))},i=(r,n)=>e.value&&n[e.key]&&n[e.key]===e.value||!e.value&&n[e.key]?r.concat([Ve([t],n)]):r;switch(te(r)){case"Object":return n.reduce(i,[])(r);case"Array":return n.find(i,[])(r);default:return r}},bt=(e,t)=>{let r=[],n=[],i={};const o=Fe(Qe("origion_url",`/${e[0]}`))(t);if(o){if(r=[o.name],e.length>1&&o.children&&o.children.length){const t=e.join("/");i=Fe(Qe("origion_url",`/${t}`))(o.children)}else i=o.children&&o.children.length?o.children[0]:o;n=(null==i?void 0:i.name)?[i.name]:[]}return{defaultOpenMenus:r,defaultSelectedMenus:n,defaultMenu:i}},xt=e=>{var t,r;let n=[],i=[],o={};return e[0]&&e[0].children&&e[0].children.length?(n=[e[0].name],i=[e[0].children[0].name],o=e[0].children[0]):e[0]&&(n=[null===(t=e[0])||void 0===t?void 0:t.name],i=[null===(r=e[0])||void 0===r?void 0:r.name],o=e[0]),{defaultOpenMenus:n,defaultSelectedMenus:i,defaultMenu:o}},vt=(e,t=0,r=!0,n=!1)=>{let i=parseFloat(e);if(isNaN(i)||0!==e&&!e)return"-";let o=!1,s="";return i<0&&(o=!0,i=Math.abs(i)),i>=1e8?s=(i/1e8).toFixed(t)+(r?"亿":""):i>=1e4?s=(i/1e4).toFixed(t)+(r?"万":""):(s=n?i.toFixed(0):i.toString(),s=n||isNaN(t)?s:i.toFixed(t)),o?`-${s}`:s},kt=()=>window.localStorage.getItem("env")||"prod",St=()=>window.localStorage.getItem("isMock"),Et=e=>{if(!e)return{};return ae(Ze("?",""),Ge("&"),$((e=>Ge("=",decodeURI(e)))),Pe)(e)};var Tt=Object.freeze({__proto__:null,parse:Et,stringify:e=>{if(He(e))return"";const t=Object.keys(e);let r="";t.map((t=>{r+=`&${t}=${e[t]}`}));return new URLSearchParams(r).toString()||""}});var Ot=1e6,Nt=1e6,_t="[big.js] ",jt=_t+"Invalid ",It=jt+"decimal places",Bt=jt+"rounding mode",Mt=_t+"Division by zero",At={},zt=void 0,Ft=/^-?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i;function Ut(e,t,r,n){var i=e.c,o=e.e+t+1;if(o<i.length){if(1===r)n=i[o]>=5;else if(2===r)n=i[o]>5||5==i[o]&&(n||o<0||i[o+1]!==zt||1&i[o-1]);else if(3===r)n=n||!!i[0];else if(n=!1,0!==r)throw Error(Bt);if(o<1)i.length=1,n?(e.e=-t,i[0]=1):i[0]=e.e=0;else{if(i.length=o--,n)for(;++i[o]>9;)i[o]=0,o--||(++e.e,i.unshift(1));for(o=i.length;!i[--o];)i.pop()}}else if(r<0||r>3||r!==~~r)throw Error(Bt);return e}function Pt(e,t,r,n){var i,o,s=e.constructor,a=!e.c[0];if(r!==zt){if(r!==~~r||r<(3==t)||r>Ot)throw Error(3==t?jt+"precision":It);for(r=n-(e=new s(e)).e,e.c.length>++n&&Ut(e,r,s.RM),2==t&&(n=e.e+r+1);e.c.length<n;)e.c.push(0)}if(i=e.e,r=(o=e.c.join("")).length,2!=t&&(1==t||3==t&&n<=i||i<=s.NE||i>=s.PE))o=o.charAt(0)+(r>1?"."+o.slice(1):"")+(i<0?"e":"e+")+i;else if(i<0){for(;++i;)o="0"+o;o="0."+o}else if(i>0)if(++i>r)for(i-=r;i--;)o+="0";else i<r&&(o=o.slice(0,i)+"."+o.slice(i));else r>1&&(o=o.charAt(0)+"."+o.slice(1));return e.s<0&&(!a||4==t)?"-"+o:o}At.abs=function(){var e=new this.constructor(this);return e.s=1,e},At.cmp=function(e){var t,r=this,n=r.c,i=(e=new r.constructor(e)).c,o=r.s,s=e.s,a=r.e,c=e.e;if(!n[0]||!i[0])return n[0]?o:i[0]?-s:0;if(o!=s)return o;if(t=o<0,a!=c)return a>c^t?1:-1;for(s=(a=n.length)<(c=i.length)?a:c,o=-1;++o<s;)if(n[o]!=i[o])return n[o]>i[o]^t?1:-1;return a==c?0:a>c^t?1:-1},At.div=function(e){var t=this,r=t.constructor,n=t.c,i=(e=new r(e)).c,o=t.s==e.s?1:-1,s=r.DP;if(s!==~~s||s<0||s>Ot)throw Error(It);if(!i[0])throw Error(Mt);if(!n[0])return new r(0*o);var a,c,u,f,l,h=i.slice(),p=a=i.length,d=n.length,m=n.slice(0,a),g=m.length,y=e,w=y.c=[],b=0,x=s+(y.e=t.e-e.e)+1;for(y.s=o,o=x<0?0:x,h.unshift(0);g++<a;)m.push(0);do{for(u=0;u<10;u++){if(a!=(g=m.length))f=a>g?1:-1;else for(l=-1,f=0;++l<a;)if(i[l]!=m[l]){f=i[l]>m[l]?1:-1;break}if(!(f<0))break;for(c=g==a?i:h;g;){if(m[--g]<c[g]){for(l=g;l&&!m[--l];)m[l]=9;--m[l],m[g]+=10}m[g]-=c[g]}for(;!m[0];)m.shift()}w[b++]=f?u:++u,m[0]&&f?m[g]=n[p]||0:m=[n[p]]}while((p++<d||m[0]!==zt)&&o--);return w[0]||1==b||(w.shift(),y.e--),b>x&&Ut(y,s,r.RM,m[0]!==zt),y},At.eq=function(e){return!this.cmp(e)},At.gt=function(e){return this.cmp(e)>0},At.gte=function(e){return this.cmp(e)>-1},At.lt=function(e){return this.cmp(e)<0},At.lte=function(e){return this.cmp(e)<1},At.minus=At.sub=function(e){var t,r,n,i,o=this,s=o.constructor,a=o.s,c=(e=new s(e)).s;if(a!=c)return e.s=-c,o.plus(e);var u=o.c.slice(),f=o.e,l=e.c,h=e.e;if(!u[0]||!l[0])return l[0]?(e.s=-c,e):new s(u[0]?o:0);if(a=f-h){for((i=a<0)?(a=-a,n=u):(h=f,n=l),n.reverse(),c=a;c--;)n.push(0);n.reverse()}else for(r=((i=u.length<l.length)?u:l).length,a=c=0;c<r;c++)if(u[c]!=l[c]){i=u[c]<l[c];break}if(i&&(n=u,u=l,l=n,e.s=-e.s),(c=(r=l.length)-(t=u.length))>0)for(;c--;)u[t++]=0;for(c=t;r>a;){if(u[--r]<l[r]){for(t=r;t&&!u[--t];)u[t]=9;--u[t],u[r]+=10}u[r]-=l[r]}for(;0===u[--c];)u.pop();for(;0===u[0];)u.shift(),--h;return u[0]||(e.s=1,u=[h=0]),e.c=u,e.e=h,e},At.mod=function(e){var t,r=this,n=r.constructor,i=r.s,o=(e=new n(e)).s;if(!e.c[0])throw Error(Mt);return r.s=e.s=1,t=1==e.cmp(r),r.s=i,e.s=o,t?new n(r):(i=n.DP,o=n.RM,n.DP=n.RM=0,r=r.div(e),n.DP=i,n.RM=o,this.minus(r.times(e)))},At.plus=At.add=function(e){var t,r=this,n=r.constructor,i=r.s,o=(e=new n(e)).s;if(i!=o)return e.s=-o,r.minus(e);var s=r.e,a=r.c,c=e.e,u=e.c;if(!a[0]||!u[0])return u[0]?e:new n(a[0]?r:0*i);if(a=a.slice(),i=s-c){for(i>0?(c=s,t=u):(i=-i,t=a),t.reverse();i--;)t.push(0);t.reverse()}for(a.length-u.length<0&&(t=u,u=a,a=t),i=u.length,o=0;i;a[i]%=10)o=(a[--i]=a[i]+u[i]+o)/10|0;for(o&&(a.unshift(o),++c),i=a.length;0===a[--i];)a.pop();return e.c=a,e.e=c,e},At.pow=function(e){var t=this,r=new t.constructor(1),n=r,i=e<0;if(e!==~~e||e<-1e6||e>Nt)throw Error(jt+"exponent");for(i&&(e=-e);1&e&&(n=n.times(t)),e>>=1;)t=t.times(t);return i?r.div(n):n},At.round=function(e,t){var r=this.constructor;if(e===zt)e=0;else if(e!==~~e||e<-Ot||e>Ot)throw Error(It);return Ut(new r(this),e,t===zt?r.RM:t)},At.sqrt=function(){var e,t,r,n=this,i=n.constructor,o=n.s,s=n.e,a=new i(.5);if(!n.c[0])return new i(n);if(o<0)throw Error(_t+"No square root");0===(o=Math.sqrt(n+""))||o===1/0?((t=n.c.join("")).length+s&1||(t+="0"),s=((s+1)/2|0)-(s<0||1&s),e=new i(((o=Math.sqrt(t))==1/0?"1e":(o=o.toExponential()).slice(0,o.indexOf("e")+1))+s)):e=new i(o),s=e.e+(i.DP+=4);do{r=e,e=a.times(r.plus(n.div(r)))}while(r.c.slice(0,s).join("")!==e.c.slice(0,s).join(""));return Ut(e,i.DP-=4,i.RM)},At.times=At.mul=function(e){var t,r=this,n=r.constructor,i=r.c,o=(e=new n(e)).c,s=i.length,a=o.length,c=r.e,u=e.e;if(e.s=r.s==e.s?1:-1,!i[0]||!o[0])return new n(0*e.s);for(e.e=c+u,s<a&&(t=i,i=o,o=t,u=s,s=a,a=u),t=new Array(u=s+a);u--;)t[u]=0;for(c=a;c--;){for(a=0,u=s+c;u>c;)a=t[u]+o[c]*i[u-c-1]+a,t[u--]=a%10,a=a/10|0;t[u]=(t[u]+a)%10}for(a?++e.e:t.shift(),c=t.length;!t[--c];)t.pop();return e.c=t,e},At.toExponential=function(e){return Pt(this,1,e,e)},At.toFixed=function(e){return Pt(this,2,e,this.e+e)},At.toPrecision=function(e){return Pt(this,3,e,e-1)},At.toString=function(){return Pt(this)},At.valueOf=At.toJSON=function(){return Pt(this,4)};var Lt=function e(){function t(r){var n=this;if(!(n instanceof t))return r===zt?e():new t(r);r instanceof t?(n.s=r.s,n.e=r.e,n.c=r.c.slice()):function(e,t){var r,n,i;if(0===t&&1/t<0)t="-0";else if(!Ft.test(t+=""))throw Error(jt+"number");e.s="-"==t.charAt(0)?(t=t.slice(1),-1):1,(r=t.indexOf("."))>-1&&(t=t.replace(".",""));(n=t.search(/e/i))>0?(r<0&&(r=n),r+=+t.slice(n+1),t=t.substring(0,n)):r<0&&(r=t.length);for(i=t.length,n=0;n<i&&"0"==t.charAt(n);)++n;if(n==i)e.c=[e.e=0];else{for(;i>0&&"0"==t.charAt(--i););for(e.e=r-n-1,e.c=[],r=0;n<=i;)e.c[r++]=+t.charAt(n++)}}(n,r),n.constructor=t}return t.prototype=At,t.DP=20,t.RM=1,t.NE=-7,t.PE=21,t.version="5.2.2",t}();const $t=(e,t)=>{const r=(e=e.toString()).indexOf(".");return e=-1!==r?e.substring(0,t+r+1):e.substring(0),Number(parseFloat(e).toFixed(t))},Dt=e=>(t,r)=>{if(He(t)||Q(t))return t;if(isNaN(Number(t)))return NaN;const n=Number(new Lt(Number(t)).mul(e));if(Q(null==r?void 0:r.decimalNumber)&&Q(null==r?void 0:r.fn))return n;if(!Q(null==r?void 0:r.decimalNumber)&&Q(null==r?void 0:r.fn))return Number(n.toFixed(null==r?void 0:r.decimalNumber));if(!Q(null==r?void 0:r.decimalNumber)&&!Q(null==r?void 0:r.fn)){if("toFixed"===(null==r?void 0:r.fn))return Number(n.toFixed(null==r?void 0:r.decimalNumber));if("floor"===(null==r?void 0:r.fn))return $t(n,null==r?void 0:r.decimalNumber)}},Rt=e=>(t,r)=>{const n=(null==r?void 0:r.decimalNumber)||2,i=(null==r?void 0:r.fn)||"toFixed";if(He(t)||Q(t))return t;if(isNaN(Number(t)))return NaN;const o=new Lt(Number(t)).div(e);return"toFixed"===i?Number(o.toFixed(n)):"floor"===i?$t(Number(o),n):t},Ct=e=>{const t=Object.prototype.toString.call(e),r=/^\[object (.*)\]$/.exec(t);return null!==r?r[1].toLowerCase():null},qt=e=>"string"==typeof e?Xe(e):("array"!==Ct(e)&&"object"!==Ct(e)||(Array.isArray(e)&&e.forEach((e=>{qt(e)})),null===typeof e)||Object.keys(e).map((t=>{const r=e[t];"string"==typeof r&&(e[t]=Xe(r)),"object"!==Ct(r)&&"array"!==Ct(r)||qt(r)})),e);var Ht,Wt=new Uint8Array(16);function Yt(){if(!Ht&&!(Ht="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto)))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Ht(Wt)}var Vt=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;for(var Qt=[],Zt=0;Zt<256;++Zt)Qt.push((Zt+256).toString(16).substr(1));function Gt(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,r=(Qt[e[t+0]]+Qt[e[t+1]]+Qt[e[t+2]]+Qt[e[t+3]]+"-"+Qt[e[t+4]]+Qt[e[t+5]]+"-"+Qt[e[t+6]]+Qt[e[t+7]]+"-"+Qt[e[t+8]]+Qt[e[t+9]]+"-"+Qt[e[t+10]]+Qt[e[t+11]]+Qt[e[t+12]]+Qt[e[t+13]]+Qt[e[t+14]]+Qt[e[t+15]]).toLowerCase();if(!function(e){return"string"==typeof e&&Vt.test(e)}(r))throw TypeError("Stringified UUID is invalid");return r}function Jt(e,t,r){var n=(e=e||{}).random||(e.rng||Yt)();return n[6]=15&n[6]|64,n[8]=63&n[8]|128,Gt(n)}const Xt="input is invalid type",Kt="0123456789abcdef".split(""),er=[128,32768,8388608,-2147483648];let tr,rr=[];const nr=new ArrayBuffer(68);tr=new Uint8Array(nr),rr=new Uint32Array(nr);function ir(){rr[0]=rr[16]=rr[1]=rr[2]=rr[3]=rr[4]=rr[5]=rr[6]=rr[7]=rr[8]=rr[9]=rr[10]=rr[11]=rr[12]=rr[13]=rr[14]=rr[15]=0,this.blocks=rr,this.buffer8=tr,this.h0=this.h1=this.h2=this.h3=this.start=this.bytes=this.hBytes=0,this.finalized=this.hashed=!1,this.first=!0}ir.prototype.update=function(e){if(this.finalized)return;let t;const r=typeof e;if("string"!==r){if("object"!==r)throw Xt;if(null===e)throw Xt;if(e.constructor===ArrayBuffer)e=new Uint8Array(e);else if(!Array.isArray(e)&&!ArrayBuffer.isView(e))throw Xt;t=!0}let n,i,o=0,s=e.length,a=this.blocks,c=this.buffer8;for(;o<s;){if(this.hashed&&(this.hashed=!1,a[0]=a[16],a[16]=a[1]=a[2]=a[3]=a[4]=a[5]=a[6]=a[7]=a[8]=a[9]=a[10]=a[11]=a[12]=a[13]=a[14]=a[15]=0),t)for(i=this.start;o<s&&i<64;++o)c[i++]=e[o];else for(i=this.start;o<s&&i<64;++o)n=e.charCodeAt(o),n<128?c[i++]=n:n<2048?(c[i++]=192|n>>6,c[i++]=128|63&n):n<55296||n>=57344?(c[i++]=224|n>>12,c[i++]=128|n>>6&63,c[i++]=128|63&n):(n=65536+((1023&n)<<10|1023&e.charCodeAt(++o)),c[i++]=240|n>>18,c[i++]=128|n>>12&63,c[i++]=128|n>>6&63,c[i++]=128|63&n);this.lastByteIndex=i,this.bytes+=i-this.start,i>=64?(this.start=i-64,this.hash(),this.hashed=!0):this.start=i}return this.bytes>4294967295&&(this.hBytes+=this.bytes/4294967296|0,this.bytes=this.bytes%4294967296),this},ir.prototype.finalize=function(){if(this.finalized)return;this.finalized=!0;const e=this.blocks,t=this.lastByteIndex;e[t>>2]|=er[3&t],t>=56&&(this.hashed||this.hash(),e[0]=e[16],e[16]=e[1]=e[2]=e[3]=e[4]=e[5]=e[6]=e[7]=e[8]=e[9]=e[10]=e[11]=e[12]=e[13]=e[14]=e[15]=0),e[14]=this.bytes<<3,e[15]=this.hBytes<<3|this.bytes>>>29,this.hash()},ir.prototype.hash=function(){let e,t,r,n,i,o,s=this.blocks;this.first?(e=s[0]-680876937,e=(e<<7|e>>>25)-271733879|0,n=(-1732584194^2004318071&e)+s[1]-117830708,n=(n<<12|n>>>20)+e|0,r=(-271733879^n&(-271733879^e))+s[2]-1126478375,r=(r<<17|r>>>15)+n|0,t=(e^r&(n^e))+s[3]-1316259209,t=(t<<22|t>>>10)+r|0):(e=this.h0,t=this.h1,r=this.h2,n=this.h3,e+=(n^t&(r^n))+s[0]-680876936,e=(e<<7|e>>>25)+t|0,n+=(r^e&(t^r))+s[1]-389564586,n=(n<<12|n>>>20)+e|0,r+=(t^n&(e^t))+s[2]+606105819,r=(r<<17|r>>>15)+n|0,t+=(e^r&(n^e))+s[3]-1044525330,t=(t<<22|t>>>10)+r|0),e+=(n^t&(r^n))+s[4]-176418897,e=(e<<7|e>>>25)+t|0,n+=(r^e&(t^r))+s[5]+1200080426,n=(n<<12|n>>>20)+e|0,r+=(t^n&(e^t))+s[6]-1473231341,r=(r<<17|r>>>15)+n|0,t+=(e^r&(n^e))+s[7]-45705983,t=(t<<22|t>>>10)+r|0,e+=(n^t&(r^n))+s[8]+1770035416,e=(e<<7|e>>>25)+t|0,n+=(r^e&(t^r))+s[9]-1958414417,n=(n<<12|n>>>20)+e|0,r+=(t^n&(e^t))+s[10]-42063,r=(r<<17|r>>>15)+n|0,t+=(e^r&(n^e))+s[11]-1990404162,t=(t<<22|t>>>10)+r|0,e+=(n^t&(r^n))+s[12]+1804603682,e=(e<<7|e>>>25)+t|0,n+=(r^e&(t^r))+s[13]-40341101,n=(n<<12|n>>>20)+e|0,r+=(t^n&(e^t))+s[14]-1502002290,r=(r<<17|r>>>15)+n|0,t+=(e^r&(n^e))+s[15]+1236535329,t=(t<<22|t>>>10)+r|0,e+=(r^n&(t^r))+s[1]-165796510,e=(e<<5|e>>>27)+t|0,n+=(t^r&(e^t))+s[6]-1069501632,n=(n<<9|n>>>23)+e|0,r+=(e^t&(n^e))+s[11]+643717713,r=(r<<14|r>>>18)+n|0,t+=(n^e&(r^n))+s[0]-373897302,t=(t<<20|t>>>12)+r|0,e+=(r^n&(t^r))+s[5]-701558691,e=(e<<5|e>>>27)+t|0,n+=(t^r&(e^t))+s[10]+38016083,n=(n<<9|n>>>23)+e|0,r+=(e^t&(n^e))+s[15]-660478335,r=(r<<14|r>>>18)+n|0,t+=(n^e&(r^n))+s[4]-405537848,t=(t<<20|t>>>12)+r|0,e+=(r^n&(t^r))+s[9]+568446438,e=(e<<5|e>>>27)+t|0,n+=(t^r&(e^t))+s[14]-1019803690,n=(n<<9|n>>>23)+e|0,r+=(e^t&(n^e))+s[3]-187363961,r=(r<<14|r>>>18)+n|0,t+=(n^e&(r^n))+s[8]+1163531501,t=(t<<20|t>>>12)+r|0,e+=(r^n&(t^r))+s[13]-1444681467,e=(e<<5|e>>>27)+t|0,n+=(t^r&(e^t))+s[2]-51403784,n=(n<<9|n>>>23)+e|0,r+=(e^t&(n^e))+s[7]+1735328473,r=(r<<14|r>>>18)+n|0,t+=(n^e&(r^n))+s[12]-1926607734,t=(t<<20|t>>>12)+r|0,i=t^r,e+=(i^n)+s[5]-378558,e=(e<<4|e>>>28)+t|0,n+=(i^e)+s[8]-2022574463,n=(n<<11|n>>>21)+e|0,o=n^e,r+=(o^t)+s[11]+1839030562,r=(r<<16|r>>>16)+n|0,t+=(o^r)+s[14]-35309556,t=(t<<23|t>>>9)+r|0,i=t^r,e+=(i^n)+s[1]-1530992060,e=(e<<4|e>>>28)+t|0,n+=(i^e)+s[4]+1272893353,n=(n<<11|n>>>21)+e|0,o=n^e,r+=(o^t)+s[7]-155497632,r=(r<<16|r>>>16)+n|0,t+=(o^r)+s[10]-1094730640,t=(t<<23|t>>>9)+r|0,i=t^r,e+=(i^n)+s[13]+681279174,e=(e<<4|e>>>28)+t|0,n+=(i^e)+s[0]-358537222,n=(n<<11|n>>>21)+e|0,o=n^e,r+=(o^t)+s[3]-722521979,r=(r<<16|r>>>16)+n|0,t+=(o^r)+s[6]+76029189,t=(t<<23|t>>>9)+r|0,i=t^r,e+=(i^n)+s[9]-640364487,e=(e<<4|e>>>28)+t|0,n+=(i^e)+s[12]-421815835,n=(n<<11|n>>>21)+e|0,o=n^e,r+=(o^t)+s[15]+530742520,r=(r<<16|r>>>16)+n|0,t+=(o^r)+s[2]-995338651,t=(t<<23|t>>>9)+r|0,e+=(r^(t|~n))+s[0]-198630844,e=(e<<6|e>>>26)+t|0,n+=(t^(e|~r))+s[7]+1126891415,n=(n<<10|n>>>22)+e|0,r+=(e^(n|~t))+s[14]-1416354905,r=(r<<15|r>>>17)+n|0,t+=(n^(r|~e))+s[5]-57434055,t=(t<<21|t>>>11)+r|0,e+=(r^(t|~n))+s[12]+1700485571,e=(e<<6|e>>>26)+t|0,n+=(t^(e|~r))+s[3]-1894986606,n=(n<<10|n>>>22)+e|0,r+=(e^(n|~t))+s[10]-1051523,r=(r<<15|r>>>17)+n|0,t+=(n^(r|~e))+s[1]-2054922799,t=(t<<21|t>>>11)+r|0,e+=(r^(t|~n))+s[8]+1873313359,e=(e<<6|e>>>26)+t|0,n+=(t^(e|~r))+s[15]-30611744,n=(n<<10|n>>>22)+e|0,r+=(e^(n|~t))+s[6]-1560198380,r=(r<<15|r>>>17)+n|0,t+=(n^(r|~e))+s[13]+1309151649,t=(t<<21|t>>>11)+r|0,e+=(r^(t|~n))+s[4]-145523070,e=(e<<6|e>>>26)+t|0,n+=(t^(e|~r))+s[11]-1120210379,n=(n<<10|n>>>22)+e|0,r+=(e^(n|~t))+s[2]+718787259,r=(r<<15|r>>>17)+n|0,t+=(n^(r|~e))+s[9]-343485551,t=(t<<21|t>>>11)+r|0,this.first?(this.h0=e+1732584193|0,this.h1=t-271733879|0,this.h2=r-1732584194|0,this.h3=n+271733878|0,this.first=!1):(this.h0=this.h0+e|0,this.h1=this.h1+t|0,this.h2=this.h2+r|0,this.h3=this.h3+n|0)},ir.prototype.hex=function(){this.finalize();let e=this.h0,t=this.h1,r=this.h2,n=this.h3;return Kt[e>>4&15]+Kt[15&e]+Kt[e>>12&15]+Kt[e>>8&15]+Kt[e>>20&15]+Kt[e>>16&15]+Kt[e>>28&15]+Kt[e>>24&15]+Kt[t>>4&15]+Kt[15&t]+Kt[t>>12&15]+Kt[t>>8&15]+Kt[t>>20&15]+Kt[t>>16&15]+Kt[t>>28&15]+Kt[t>>24&15]+Kt[r>>4&15]+Kt[15&r]+Kt[r>>12&15]+Kt[r>>8&15]+Kt[r>>20&15]+Kt[r>>16&15]+Kt[r>>28&15]+Kt[r>>24&15]+Kt[n>>4&15]+Kt[15&n]+Kt[n>>12&15]+Kt[n>>8&15]+Kt[n>>20&15]+Kt[n>>16&15]+Kt[n>>28&15]+Kt[n>>24&15]};var or=e=>(new ir).update(e).hex();function sr(e){const t=typeof e;return null!=e&&("object"===t||"function"===t)}function ar(e,t,r){if("undefined"==typeof window)return;let n,i,o,s,a,c,u=0,f=!1,l=!1,h=!0;const p=!t&&0!==t&&"function"==typeof requestAnimationFrame;if("function"!=typeof e)throw new TypeError("Expected a function");function d(t){const r=n,o=i;return n=i=void 0,u=t,s=e.apply(o,r),s}function m(e,t){return p?(cancelAnimationFrame(a),requestAnimationFrame(e)):setTimeout(e,t)}function g(e){const r=e-c;return void 0===c||r>=t||r<0||l&&e-u>=o}function y(){const e=Date.now();if(g(e))return w(e);a=m(y,function(e){const r=e-u,n=t-(e-c);return l?Math.min(n,o-r):n}(e))}function w(e){return a=void 0,h&&n?d(e):(n=i=void 0,s)}function b(...e){const r=Date.now(),o=g(r);if(n=e,i=this,c=r,o){if(void 0===a)return function(e){return u=e,a=m(y,t),f?d(e):s}(c);if(l)return a=m(y,t),d(c)}return void 0===a&&(a=m(y,t)),s}return t=+t||0,sr(r)&&(f=!!r.leading,l="maxWait"in r,o=l?Math.max(+r.maxWait||0,t):o,h="trailing"in r?!!r.trailing:h),b.cancel=function(){void 0!==a&&function(e){if(p)return cancelAnimationFrame(e);clearTimeout(e)}(a),u=0,n=c=i=a=void 0},b.flush=function(){return void 0===a?s:w(Date.now())},b.pending=function(){return void 0!==a},b}var cr={},ur={
2
2
  /*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */
3
- read:function(e,t,r,n,i){var o,s,a=8*i-n-1,u=(1<<a)-1,c=u>>1,f=-7,l=r?i-1:0,h=r?-1:1,p=e[t+l];for(l+=h,o=p&(1<<-f)-1,p>>=-f,f+=a;f>0;o=256*o+e[t+l],l+=h,f-=8);for(s=o&(1<<-f)-1,o>>=-f,f+=n;f>0;s=256*s+e[t+l],l+=h,f-=8);if(0===o)o=1-c;else{if(o===u)return s?NaN:1/0*(p?-1:1);s+=Math.pow(2,n),o-=c}return(p?-1:1)*s*Math.pow(2,o-n)},write:function(e,t,r,n,i,o){var s,a,u,c=8*o-i-1,f=(1<<c)-1,l=f>>1,h=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,p=n?0:o-1,d=n?1:-1,m=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(a=isNaN(t)?1:0,s=f):(s=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-s))<1&&(s--,u*=2),(t+=s+l>=1?h/u:h*Math.pow(2,1-l))*u>=2&&(s++,u/=2),s+l>=f?(a=0,s=f):s+l>=1?(a=(t*u-1)*Math.pow(2,i),s+=l):(a=t*Math.pow(2,l-1)*Math.pow(2,i),s=0));i>=8;e[r+p]=255&a,p+=d,a/=256,i-=8);for(s=s<<i|a,c+=i;c>0;e[r+p]=255&s,p+=d,s/=256,c-=8);e[r+p-d]|=128*m}};!function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.AnsiStringType=e.StringType=e.BufferType=e.Uint8ArrayType=e.IgnoreType=e.Float80_LE=e.Float80_BE=e.Float64_LE=e.Float64_BE=e.Float32_LE=e.Float32_BE=e.Float16_LE=e.Float16_BE=e.INT64_BE=e.UINT64_BE=e.INT64_LE=e.UINT64_LE=e.INT32_LE=e.INT32_BE=e.INT24_BE=e.INT24_LE=e.INT16_LE=e.INT16_BE=e.INT8=e.UINT32_BE=e.UINT32_LE=e.UINT24_BE=e.UINT24_LE=e.UINT16_BE=e.UINT16_LE=e.UINT8=void 0;const t=fr;function r(e){return new DataView(e.buffer,e.byteOffset)}e.UINT8={len:1,get:(e,t)=>r(e).getUint8(t),put:(e,t,n)=>(r(e).setUint8(t,n),t+1)},e.UINT16_LE={len:2,get:(e,t)=>r(e).getUint16(t,!0),put:(e,t,n)=>(r(e).setUint16(t,n,!0),t+2)},e.UINT16_BE={len:2,get:(e,t)=>r(e).getUint16(t),put:(e,t,n)=>(r(e).setUint16(t,n),t+2)},e.UINT24_LE={len:3,get(e,t){const n=r(e);return n.getUint8(t)+(n.getUint16(t+1,!0)<<8)},put(e,t,n){const i=r(e);return i.setUint8(t,255&n),i.setUint16(t+1,n>>8,!0),t+3}},e.UINT24_BE={len:3,get(e,t){const n=r(e);return(n.getUint16(t)<<8)+n.getUint8(t+2)},put(e,t,n){const i=r(e);return i.setUint16(t,n>>8),i.setUint8(t+2,255&n),t+3}},e.UINT32_LE={len:4,get:(e,t)=>r(e).getUint32(t,!0),put:(e,t,n)=>(r(e).setUint32(t,n,!0),t+4)},e.UINT32_BE={len:4,get:(e,t)=>r(e).getUint32(t),put:(e,t,n)=>(r(e).setUint32(t,n),t+4)},e.INT8={len:1,get:(e,t)=>r(e).getInt8(t),put:(e,t,n)=>(r(e).setInt8(t,n),t+1)},e.INT16_BE={len:2,get:(e,t)=>r(e).getInt16(t),put:(e,t,n)=>(r(e).setInt16(t,n),t+2)},e.INT16_LE={len:2,get:(e,t)=>r(e).getInt16(t,!0),put:(e,t,n)=>(r(e).setInt16(t,n,!0),t+2)},e.INT24_LE={len:3,get(t,r){const n=e.UINT24_LE.get(t,r);return n>8388607?n-16777216:n},put(e,t,n){const i=r(e);return i.setUint8(t,255&n),i.setUint16(t+1,n>>8,!0),t+3}},e.INT24_BE={len:3,get(t,r){const n=e.UINT24_BE.get(t,r);return n>8388607?n-16777216:n},put(e,t,n){const i=r(e);return i.setUint16(t,n>>8),i.setUint8(t+2,255&n),t+3}},e.INT32_BE={len:4,get:(e,t)=>r(e).getInt32(t),put:(e,t,n)=>(r(e).setInt32(t,n),t+4)},e.INT32_LE={len:4,get:(e,t)=>r(e).getInt32(t,!0),put:(e,t,n)=>(r(e).setInt32(t,n,!0),t+4)},e.UINT64_LE={len:8,get:(e,t)=>r(e).getBigUint64(t,!0),put:(e,t,n)=>(r(e).setBigUint64(t,n,!0),t+8)},e.INT64_LE={len:8,get:(e,t)=>r(e).getBigInt64(t,!0),put:(e,t,n)=>(r(e).setBigInt64(t,n,!0),t+8)},e.UINT64_BE={len:8,get:(e,t)=>r(e).getBigUint64(t),put:(e,t,n)=>(r(e).setBigUint64(t,n),t+8)},e.INT64_BE={len:8,get:(e,t)=>r(e).getBigInt64(t),put:(e,t,n)=>(r(e).setBigInt64(t,n),t+8)},e.Float16_BE={len:2,get(e,r){return t.read(e,r,!1,10,this.len)},put(e,r,n){return t.write(e,n,r,!1,10,this.len),r+this.len}},e.Float16_LE={len:2,get(e,r){return t.read(e,r,!0,10,this.len)},put(e,r,n){return t.write(e,n,r,!0,10,this.len),r+this.len}},e.Float32_BE={len:4,get:(e,t)=>r(e).getFloat32(t),put:(e,t,n)=>(r(e).setFloat32(t,n),t+4)},e.Float32_LE={len:4,get:(e,t)=>r(e).getFloat32(t,!0),put:(e,t,n)=>(r(e).setFloat32(t,n,!0),t+4)},e.Float64_BE={len:8,get:(e,t)=>r(e).getFloat64(t),put:(e,t,n)=>(r(e).setFloat64(t,n),t+8)},e.Float64_LE={len:8,get:(e,t)=>r(e).getFloat64(t,!0),put:(e,t,n)=>(r(e).setFloat64(t,n,!0),t+8)},e.Float80_BE={len:10,get(e,r){return t.read(e,r,!1,63,this.len)},put(e,r,n){return t.write(e,n,r,!1,63,this.len),r+this.len}},e.Float80_LE={len:10,get(e,r){return t.read(e,r,!0,63,this.len)},put(e,r,n){return t.write(e,n,r,!0,63,this.len),r+this.len}};e.IgnoreType=class{constructor(e){this.len=e}get(e,t){}};e.Uint8ArrayType=class{constructor(e){this.len=e}get(e,t){return e.subarray(t,t+this.len)}};e.BufferType=class{constructor(e){this.len=e}get(e,t){return y.from(e.subarray(t,t+this.len))}};e.StringType=class{constructor(e,t){this.len=e,this.encoding=t}get(e,t){return y.from(e).toString(this.encoding,t,t+this.len)}};class n{constructor(e){this.len=e}static decode(e,t,r){let i="";for(let o=t;o<r;++o)i+=n.codePointToString(n.singleByteDecoder(e[o]));return i}static inRange(e,t,r){return t<=e&&e<=r}static codePointToString(e){return e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode(55296+(e>>10),56320+(1023&e)))}static singleByteDecoder(e){if(n.inRange(e,0,127))return e;const t=n.windows1252[e-128];if(null===t)throw Error("invaliding encoding");return t}get(e,t=0){return n.decode(e,t,t+this.len)}}e.AnsiStringType=n,n.windows1252=[8364,129,8218,402,8222,8230,8224,8225,710,8240,352,8249,338,141,381,143,144,8216,8217,8220,8221,8226,8211,8212,732,8482,353,8250,339,157,382,376,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255]}(cr);var lr={},hr={};Object.defineProperty(hr,"__esModule",{value:!0}),hr.readFile=hr.writeFileSync=hr.writeFile=hr.read=hr.open=hr.close=hr.stat=hr.createReadStream=hr.pathExists=void 0;const pr=r.default;hr.pathExists=pr.existsSync,hr.createReadStream=pr.createReadStream,hr.stat=async function(e){return new Promise(((t,r)=>{pr.stat(e,((e,n)=>{e?r(e):t(n)}))}))},hr.close=async function(e){return new Promise(((t,r)=>{pr.close(e,(e=>{e?r(e):t()}))}))},hr.open=async function(e,t){return new Promise(((r,n)=>{pr.open(e,t,((e,t)=>{e?n(e):r(t)}))}))},hr.read=async function(e,t,r,n,i){return new Promise(((o,s)=>{pr.read(e,t,r,n,i,((e,t,r)=>{e?s(e):o({bytesRead:t,buffer:r})}))}))},hr.writeFile=async function(e,t){return new Promise(((r,n)=>{pr.writeFile(e,t,(e=>{e?n(e):r()}))}))},hr.writeFileSync=function(e,t){pr.writeFileSync(e,t)},hr.readFile=async function(e){return new Promise(((t,r)=>{pr.readFile(e,((e,n)=>{e?r(e):t(n)}))}))};var dr={},mr={},gr={},yr={},wr={};!function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.EndOfStreamError=e.defaultMessages=void 0,e.defaultMessages="End-Of-Stream";class t extends Error{constructor(){super(e.defaultMessages)}}e.EndOfStreamError=t}(wr);var vr={},br={};Object.defineProperty(br,"__esModule",{value:!0}),br.Deferred=void 0;br.Deferred=class{constructor(){this.resolve=()=>null,this.reject=()=>null,this.promise=new Promise(((e,t)=>{this.reject=t,this.resolve=e}))}},function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.StreamReader=e.EndOfStreamError=void 0;const t=wr,r=br;var n=wr;Object.defineProperty(e,"EndOfStreamError",{enumerable:!0,get:function(){return n.EndOfStreamError}});e.StreamReader=class{constructor(e){if(this.s=e,this.deferred=null,this.endOfStream=!1,this.peekQueue=[],!e.read||!e.once)throw new Error("Expected an instance of stream.Readable");this.s.once("end",(()=>this.reject(new t.EndOfStreamError))),this.s.once("error",(e=>this.reject(e))),this.s.once("close",(()=>this.reject(new Error("Stream closed"))))}async peek(e,t,r){const n=await this.read(e,t,r);return this.peekQueue.push(e.subarray(t,t+n)),n}async read(e,r,n){if(0===n)return 0;if(0===this.peekQueue.length&&this.endOfStream)throw new t.EndOfStreamError;let i=n,o=0;for(;this.peekQueue.length>0&&i>0;){const t=this.peekQueue.pop();if(!t)throw new Error("peekData should be defined");const n=Math.min(t.length,i);e.set(t.subarray(0,n),r+o),o+=n,i-=n,n<t.length&&this.peekQueue.push(t.subarray(n))}for(;i>0&&!this.endOfStream;){const t=Math.min(i,1048576),n=await this.readFromStream(e,r+o,t);if(o+=n,n<t)break;i-=n}return o}async readFromStream(e,t,n){const i=this.s.read(n);if(i)return e.set(i,t),i.length;{const i={buffer:e,offset:t,length:n,deferred:new r.Deferred};return this.deferred=i.deferred,this.s.once("readable",(()=>{this.readDeferred(i)})),i.deferred.promise}}readDeferred(e){const t=this.s.read(e.length);t?(e.buffer.set(t,e.offset),e.deferred.resolve(t.length),this.deferred=null):this.s.once("readable",(()=>{this.readDeferred(e)}))}reject(e){this.endOfStream=!0,this.deferred&&(this.deferred.reject(e),this.deferred=null)}}}(vr),function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.StreamReader=e.EndOfStreamError=void 0;var t=wr;Object.defineProperty(e,"EndOfStreamError",{enumerable:!0,get:function(){return t.EndOfStreamError}});var r=vr;Object.defineProperty(e,"StreamReader",{enumerable:!0,get:function(){return r.StreamReader}})}(yr),Object.defineProperty(gr,"__esModule",{value:!0}),gr.AbstractTokenizer=void 0;const xr=yr;gr.AbstractTokenizer=class{constructor(e){this.position=0,this.numBuffer=new Uint8Array(8),this.fileInfo=e||{}}async readToken(e,t=this.position){const r=y.alloc(e.len);if(await this.readBuffer(r,{position:t})<e.len)throw new xr.EndOfStreamError;return e.get(r,0)}async peekToken(e,t=this.position){const r=y.alloc(e.len);if(await this.peekBuffer(r,{position:t})<e.len)throw new xr.EndOfStreamError;return e.get(r,0)}async readNumber(e){if(await this.readBuffer(this.numBuffer,{length:e.len})<e.len)throw new xr.EndOfStreamError;return e.get(this.numBuffer,0)}async peekNumber(e){if(await this.peekBuffer(this.numBuffer,{length:e.len})<e.len)throw new xr.EndOfStreamError;return e.get(this.numBuffer,0)}async ignore(e){if(void 0!==this.fileInfo.size){const t=this.fileInfo.size-this.position;if(e>t)return this.position+=t,t}return this.position+=e,e}async close(){}normalizeOptions(e,t){if(t&&void 0!==t.position&&t.position<this.position)throw new Error("`options.position` must be equal or greater than `tokenizer.position`");return t?{mayBeLess:!0===t.mayBeLess,offset:t.offset?t.offset:0,length:t.length?t.length:e.length-(t.offset?t.offset:0),position:t.position?t.position:this.position}:{mayBeLess:!1,offset:0,length:e.length,position:this.position}}},Object.defineProperty(mr,"__esModule",{value:!0}),mr.ReadStreamTokenizer=void 0;const kr=gr,Er=yr;class Sr extends kr.AbstractTokenizer{constructor(e,t){super(t),this.streamReader=new Er.StreamReader(e)}async getFileInfo(){return this.fileInfo}async readBuffer(e,t){const r=this.normalizeOptions(e,t),n=r.position-this.position;if(n>0)return await this.ignore(n),this.readBuffer(e,t);if(n<0)throw new Error("`options.position` must be equal or greater than `tokenizer.position`");if(0===r.length)return 0;const i=await this.streamReader.read(e,r.offset,r.length);if(this.position+=i,(!t||!t.mayBeLess)&&i<r.length)throw new Er.EndOfStreamError;return i}async peekBuffer(e,t){const r=this.normalizeOptions(e,t);let n=0;if(r.position){const t=r.position-this.position;if(t>0){const i=new Uint8Array(r.length+t);return n=await this.peekBuffer(i,{mayBeLess:r.mayBeLess}),e.set(i.subarray(t),r.offset),n-t}if(t<0)throw new Error("Cannot peek from a negative offset in a stream")}if(r.length>0){try{n=await this.streamReader.peek(e,r.offset,r.length)}catch(e){if(t&&t.mayBeLess&&e instanceof Er.EndOfStreamError)return 0;throw e}if(!r.mayBeLess&&n<r.length)throw new Er.EndOfStreamError}return n}async ignore(e){const t=Math.min(256e3,e),r=new Uint8Array(t);let n=0;for(;n<e;){const i=e-n,o=await this.readBuffer(r,{length:Math.min(t,i)});if(o<0)return o;n+=o}return n}}mr.ReadStreamTokenizer=Sr;var Tr={};Object.defineProperty(Tr,"__esModule",{value:!0}),Tr.BufferTokenizer=void 0;const _r=yr,Ar=gr;class Or extends Ar.AbstractTokenizer{constructor(e,t){super(t),this.uint8Array=e,this.fileInfo.size=this.fileInfo.size?this.fileInfo.size:e.length}async readBuffer(e,t){if(t&&t.position){if(t.position<this.position)throw new Error("`options.position` must be equal or greater than `tokenizer.position`");this.position=t.position}const r=await this.peekBuffer(e,t);return this.position+=r,r}async peekBuffer(e,t){const r=this.normalizeOptions(e,t),n=Math.min(this.uint8Array.length-r.position,r.length);if(!r.mayBeLess&&n<r.length)throw new _r.EndOfStreamError;return e.set(this.uint8Array.subarray(r.position,r.position+n),r.offset),n}async close(){}}Tr.BufferTokenizer=Or,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.fromBuffer=e.fromStream=e.EndOfStreamError=void 0;const t=mr,r=Tr;var n=yr;Object.defineProperty(e,"EndOfStreamError",{enumerable:!0,get:function(){return n.EndOfStreamError}}),e.fromStream=function(e,r){return r=r||{},new t.ReadStreamTokenizer(e,r)},e.fromBuffer=function(e,t){return new r.BufferTokenizer(e,t)}}(dr);var Ir={};Object.defineProperty(Ir,"__esModule",{value:!0}),Ir.fromFile=Ir.FileTokenizer=void 0;const Br=gr,Nr=yr,Mr=hr;class Ur extends Br.AbstractTokenizer{constructor(e,t){super(t),this.fd=e}async readBuffer(e,t){const r=this.normalizeOptions(e,t);this.position=r.position;const n=await Mr.read(this.fd,e,r.offset,r.length,r.position);if(this.position+=n.bytesRead,n.bytesRead<r.length&&(!t||!t.mayBeLess))throw new Nr.EndOfStreamError;return n.bytesRead}async peekBuffer(e,t){const r=this.normalizeOptions(e,t),n=await Mr.read(this.fd,e,r.offset,r.length,r.position);if(!r.mayBeLess&&n.bytesRead<r.length)throw new Nr.EndOfStreamError;return n.bytesRead}async close(){return Mr.close(this.fd)}}Ir.FileTokenizer=Ur,Ir.fromFile=async function(e){const t=await Mr.stat(e);if(!t.isFile)throw new Error(`File not a file: ${e}`);const r=await Mr.open(e,"r");return new Ur(r,{path:e,size:t.size})},function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.fromStream=e.fromBuffer=e.EndOfStreamError=e.fromFile=void 0;const t=hr,r=dr;var n=Ir;Object.defineProperty(e,"fromFile",{enumerable:!0,get:function(){return n.fromFile}});var i=dr;Object.defineProperty(e,"EndOfStreamError",{enumerable:!0,get:function(){return i.EndOfStreamError}}),Object.defineProperty(e,"fromBuffer",{enumerable:!0,get:function(){return i.fromBuffer}}),e.fromStream=async function(e,n){if(n=n||{},e.path){const r=await t.stat(e.path);n.path=e.path,n.size=r.size}return r.fromStream(e,n)}}(lr);const jr={get:(e,t)=>127&e[t+3]|e[t+2]<<7|e[t+1]<<14|e[t]<<21,len:4};async function Pr(e){try{return(new zr).parse(e)}catch(e){if(!(e instanceof lr.EndOfStreamError))throw e}}function Rr(e,t,r){r=Object.assign({offset:0},r);for(const[n,i]of t.entries())if(r.mask){if(i!==(r.mask[n]&e[n+r.offset]))return!1}else if(i!==e[n+r.offset])return!1;return!0}class zr{constructor(){this.buffer=y.alloc(4100)}check(e,t){return Rr(this.buffer,e,t)}checkString(e,t){return this.check((r=e,Object.values(r).map((e=>e.charCodeAt(0)))),t);var r}async readTiffTag(e){if(this.tokenizer){const t=await this.tokenizer.readToken(e?cr.UINT16_BE:cr.UINT16_LE);switch(this.tokenizer.ignore(10),t){case 50341:return{ext:"arw",mime:"image/x-sony-arw"};case 50706:return{ext:"dng",mime:"image/x-adobe-dng"}}}}async readTiffIFD(e){if(this.tokenizer){const t=await this.tokenizer.readToken(e?cr.UINT16_BE:cr.UINT16_LE);for(let r=0;r<t;++r){const t=await this.readTiffTag(e);if(t)return t}}}async readTiffHeader(e){const t=(e?cr.UINT16_BE:cr.UINT16_LE).get(this.buffer,2),r=(e?cr.UINT32_BE:cr.UINT32_LE).get(this.buffer,4);if(42===t){if(r>=6){if(this.checkString("CR",{offset:8}))return{ext:"cr2",mime:"image/x-canon-cr2"};if(r>=8&&(this.check([28,0,254,0],{offset:8})||this.check([31,0,11,0],{offset:8})))return{ext:"nef",mime:"image/x-nikon-nef"}}if(this.tokenizer){await this.tokenizer.ignore(r);const e=await this.readTiffIFD(!1);return e||{ext:"tif",mime:"image/tiff"}}}if(43===t)return{ext:"tif",mime:"image/tiff"}}async parse(e){if(this.buffer=y.alloc(4100),void 0===e.fileInfo.size&&(e.fileInfo.size=Number.MAX_SAFE_INTEGER),this.tokenizer=e,await e.peekBuffer(this.buffer,{length:12,mayBeLess:!0}),this.check([66,77]))return{ext:"bmp",mime:"image/bmp"};if(this.check([11,119]))return{ext:"ac3",mime:"audio/vnd.dolby.dd-raw"};if(this.check([120,1]))return{ext:"dmg",mime:"application/x-apple-diskimage"};if(this.check([77,90]))return{ext:"exe",mime:"application/x-msdownload"};if(this.check([37,33]))return await e.peekBuffer(this.buffer,{length:24,mayBeLess:!0}),this.checkString("PS-Adobe-",{offset:2})&&this.checkString(" EPSF-",{offset:14})?{ext:"eps",mime:"application/eps"}:{ext:"ps",mime:"application/postscript"};if(this.check([31,160])||this.check([31,157]))return{ext:"Z",mime:"application/x-compress"};if(this.check([71,73,70]))return{ext:"gif",mime:"image/gif"};if(this.check([255,216,255]))return{ext:"jpg",mime:"image/jpeg"};if(this.check([73,73,188]))return{ext:"jxr",mime:"image/vnd.ms-photo"};if(this.check([31,139,8]))return{ext:"gz",mime:"application/gzip"};if(this.check([66,90,104]))return{ext:"bz2",mime:"application/x-bzip2"};if(this.checkString("ID3")){await e.ignore(6);const t=await e.readToken(jr);return e.position+t>e.fileInfo.size?{ext:"mp3",mime:"audio/mpeg"}:(await e.ignore(t),Pr(e))}if(this.checkString("MP+"))return{ext:"mpc",mime:"audio/x-musepack"};if((67===this.buffer[0]||70===this.buffer[0])&&this.check([87,83],{offset:1}))return{ext:"swf",mime:"application/x-shockwave-flash"};if(this.checkString("FLIF"))return{ext:"flif",mime:"image/flif"};if(this.checkString("8BPS"))return{ext:"psd",mime:"image/vnd.adobe.photoshop"};if(this.checkString("WEBP",{offset:8}))return{ext:"webp",mime:"image/webp"};if(this.checkString("MPCK"))return{ext:"mpc",mime:"audio/x-musepack"};if(this.checkString("FORM"))return{ext:"aif",mime:"audio/aiff"};if(this.checkString("icns",{offset:0}))return{ext:"icns",mime:"image/icns"};if(this.check([80,75,3,4])){try{for(;e.position+30<e.fileInfo.size;){await e.readBuffer(this.buffer,{length:30});const r={compressedSize:this.buffer.readUInt32LE(18),uncompressedSize:this.buffer.readUInt32LE(22),filenameLength:this.buffer.readUInt16LE(26),extraFieldLength:this.buffer.readUInt16LE(28)};if(r.filename=await e.readToken(new cr.StringType(r.filenameLength,"utf-8")),await e.ignore(r.extraFieldLength),"META-INF/mozilla.rsa"===r.filename)return{ext:"xpi",mime:"application/x-xpinstall"};if(r.filename.endsWith(".rels")||r.filename.endsWith(".xml")){switch(r.filename.split("/")[0]){case"_rels":default:break;case"word":return{ext:"docx",mime:"application/vnd.openxmlformats-officedocument.wordprocessingml.document"};case"ppt":return{ext:"pptx",mime:"application/vnd.openxmlformats-officedocument.presentationml.presentation"};case"xl":return{ext:"xlsx",mime:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"}}}if(r.filename.startsWith("xl/"))return{ext:"xlsx",mime:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"};if(r.filename.startsWith("3D/")&&r.filename.endsWith(".model"))return{ext:"3mf",mime:"model/3mf"};if("mimetype"===r.filename&&r.compressedSize===r.uncompressedSize){switch(await e.readToken(new cr.StringType(r.compressedSize,"utf-8"))){case"application/epub+zip":return{ext:"epub",mime:"application/epub+zip"};case"application/vnd.oasis.opendocument.text":return{ext:"odt",mime:"application/vnd.oasis.opendocument.text"};case"application/vnd.oasis.opendocument.spreadsheet":return{ext:"ods",mime:"application/vnd.oasis.opendocument.spreadsheet"};case"application/vnd.oasis.opendocument.presentation":return{ext:"odp",mime:"application/vnd.oasis.opendocument.presentation"}}}if(0===r.compressedSize){let n=-1;for(;n<0&&e.position<e.fileInfo.size;)await e.peekBuffer(this.buffer,{mayBeLess:!0}),n=this.buffer.indexOf("504B0304",0,"hex"),await e.ignore(n>=0?n:this.buffer.length)}else await e.ignore(r.compressedSize)}}catch(i){if(!(i instanceof lr.EndOfStreamError))throw i}return{ext:"zip",mime:"application/zip"}}if(this.checkString("OggS")){await e.ignore(28);const o=y.alloc(8);return await e.readBuffer(o),Rr(o,[79,112,117,115,72,101,97,100])?{ext:"opus",mime:"audio/opus"}:Rr(o,[128,116,104,101,111,114,97])?{ext:"ogv",mime:"video/ogg"}:Rr(o,[1,118,105,100,101,111,0])?{ext:"ogm",mime:"video/ogg"}:Rr(o,[127,70,76,65,67])?{ext:"oga",mime:"audio/ogg"}:Rr(o,[83,112,101,101,120,32,32])?{ext:"spx",mime:"audio/ogg"}:Rr(o,[1,118,111,114,98,105,115])?{ext:"ogg",mime:"audio/ogg"}:{ext:"ogx",mime:"application/ogg"}}if(this.check([80,75])&&(3===this.buffer[2]||5===this.buffer[2]||7===this.buffer[2])&&(4===this.buffer[3]||6===this.buffer[3]||8===this.buffer[3]))return{ext:"zip",mime:"application/zip"};if(this.checkString("ftyp",{offset:4})&&96&this.buffer[8]){const s=this.buffer.toString("binary",8,12).replace("\0"," ").trim();switch(s){case"avif":case"avis":return{ext:"avif",mime:"image/avif"};case"mif1":return{ext:"heic",mime:"image/heif"};case"msf1":return{ext:"heic",mime:"image/heif-sequence"};case"heic":case"heix":return{ext:"heic",mime:"image/heic"};case"hevc":case"hevx":return{ext:"heic",mime:"image/heic-sequence"};case"qt":return{ext:"mov",mime:"video/quicktime"};case"M4V":case"M4VH":case"M4VP":return{ext:"m4v",mime:"video/x-m4v"};case"M4P":return{ext:"m4p",mime:"video/mp4"};case"M4B":return{ext:"m4b",mime:"audio/mp4"};case"M4A":return{ext:"m4a",mime:"audio/x-m4a"};case"F4V":return{ext:"f4v",mime:"video/mp4"};case"F4P":return{ext:"f4p",mime:"video/mp4"};case"F4A":return{ext:"f4a",mime:"audio/mp4"};case"F4B":return{ext:"f4b",mime:"audio/mp4"};case"crx":return{ext:"cr3",mime:"image/x-canon-cr3"};default:return s.startsWith("3g")?s.startsWith("3g2")?{ext:"3g2",mime:"video/3gpp2"}:{ext:"3gp",mime:"video/3gpp"}:{ext:"mp4",mime:"video/mp4"}}}if(this.checkString("MThd"))return{ext:"mid",mime:"audio/midi"};if(this.checkString("wOFF")&&(this.check([0,1,0,0],{offset:4})||this.checkString("OTTO",{offset:4})))return{ext:"woff",mime:"font/woff"};if(this.checkString("wOF2")&&(this.check([0,1,0,0],{offset:4})||this.checkString("OTTO",{offset:4})))return{ext:"woff2",mime:"font/woff2"};if(this.check([212,195,178,161])||this.check([161,178,195,212]))return{ext:"pcap",mime:"application/vnd.tcpdump.pcap"};if(this.checkString("DSD "))return{ext:"dsf",mime:"audio/x-dsf"};if(this.checkString("LZIP"))return{ext:"lz",mime:"application/x-lzip"};if(this.checkString("fLaC"))return{ext:"flac",mime:"audio/flac"};if(this.check([66,80,71,251]))return{ext:"bpg",mime:"image/bpg"};if(this.checkString("wvpk"))return{ext:"wv",mime:"audio/wavpack"};if(this.checkString("%PDF")){await e.ignore(1350);const a=10485760,u=y.alloc(Math.min(a,e.fileInfo.size));return await e.readBuffer(u,{mayBeLess:!0}),u.includes(y.from("AIPrivateData"))?{ext:"ai",mime:"application/postscript"}:{ext:"pdf",mime:"application/pdf"}}if(this.check([0,97,115,109]))return{ext:"wasm",mime:"application/wasm"};if(this.check([73,73])){const c=await this.readTiffHeader(!1);if(c)return c}if(this.check([77,77])){const f=await this.readTiffHeader(!0);if(f)return f}if(this.checkString("MAC "))return{ext:"ape",mime:"audio/ape"};if(this.check([26,69,223,163])){async function l(){const t=await e.peekNumber(cr.UINT8);let r=128,n=0;for(;!(t&r);)++n,r>>=1;const i=y.alloc(n+1);return await e.readBuffer(i),i}async function h(){const e=await l(),t=await l();t[0]^=128>>t.length-1;const r=Math.min(6,t.length);return{id:e.readUIntBE(0,e.length),len:t.readUIntBE(t.length-r,r)}}async function p(t,r){for(;r>0;){const t=await h();if(17026===t.id){return(await e.readToken(new cr.StringType(t.len,"utf-8"))).replace(/\00.*$/g,"")}await e.ignore(t.len),--r}}const d=await h();switch(await p(0,d.len)){case"webm":return{ext:"webm",mime:"video/webm"};case"matroska":return{ext:"mkv",mime:"video/x-matroska"};default:return}}if(this.check([82,73,70,70])){if(this.check([65,86,73],{offset:8}))return{ext:"avi",mime:"video/vnd.avi"};if(this.check([87,65,86,69],{offset:8}))return{ext:"wav",mime:"audio/vnd.wave"};if(this.check([81,76,67,77],{offset:8}))return{ext:"qcp",mime:"audio/qcelp"}}if(this.checkString("SQLi"))return{ext:"sqlite",mime:"application/x-sqlite3"};if(this.check([78,69,83,26]))return{ext:"nes",mime:"application/x-nintendo-nes-rom"};if(this.checkString("Cr24"))return{ext:"crx",mime:"application/x-google-chrome-extension"};if(this.checkString("MSCF")||this.checkString("ISc("))return{ext:"cab",mime:"application/vnd.ms-cab-compressed"};if(this.check([237,171,238,219]))return{ext:"rpm",mime:"application/x-rpm"};if(this.check([197,208,211,198]))return{ext:"eps",mime:"application/eps"};if(this.check([40,181,47,253]))return{ext:"zst",mime:"application/zstd"};if(this.check([127,69,76,70]))return{ext:"elf",mime:"application/x-elf"};if(this.check([79,84,84,79,0]))return{ext:"otf",mime:"font/otf"};if(this.checkString("#!AMR"))return{ext:"amr",mime:"audio/amr"};if(this.checkString("{\\rtf"))return{ext:"rtf",mime:"application/rtf"};if(this.check([70,76,86,1]))return{ext:"flv",mime:"video/x-flv"};if(this.checkString("IMPM"))return{ext:"it",mime:"audio/x-it"};if(this.checkString("-lh0-",{offset:2})||this.checkString("-lh1-",{offset:2})||this.checkString("-lh2-",{offset:2})||this.checkString("-lh3-",{offset:2})||this.checkString("-lh4-",{offset:2})||this.checkString("-lh5-",{offset:2})||this.checkString("-lh6-",{offset:2})||this.checkString("-lh7-",{offset:2})||this.checkString("-lzs-",{offset:2})||this.checkString("-lz4-",{offset:2})||this.checkString("-lz5-",{offset:2})||this.checkString("-lhd-",{offset:2}))return{ext:"lzh",mime:"application/x-lzh-compressed"};if(this.check([0,0,1,186])){if(this.check([33],{offset:4,mask:[241]}))return{ext:"mpg",mime:"video/MP1S"};if(this.check([68],{offset:4,mask:[196]}))return{ext:"mpg",mime:"video/MP2P"}}if(this.checkString("ITSF"))return{ext:"chm",mime:"application/vnd.ms-htmlhelp"};if(this.check([253,55,122,88,90,0]))return{ext:"xz",mime:"application/x-xz"};if(this.checkString("<?xml "))return{ext:"xml",mime:"application/xml"};if(this.check([55,122,188,175,39,28]))return{ext:"7z",mime:"application/x-7z-compressed"};if(this.check([82,97,114,33,26,7])&&(0===this.buffer[6]||1===this.buffer[6]))return{ext:"rar",mime:"application/x-rar-compressed"};if(this.checkString("solid "))return{ext:"stl",mime:"model/stl"};if(this.checkString("BLENDER"))return{ext:"blend",mime:"application/x-blender"};if(this.checkString("!<arch>")){await e.ignore(8);return"debian-binary"===await e.readToken(new cr.StringType(13,"ascii"))?{ext:"deb",mime:"application/x-deb"}:{ext:"ar",mime:"application/x-unix-archive"}}if(this.check([137,80,78,71,13,10,26,10])){async function m(){return{length:await e.readToken(cr.INT32_BE),type:await e.readToken(new cr.StringType(4,"binary"))}}await e.ignore(8);do{const g=await m();if(g.length<0)return;switch(g.type){case"IDAT":return{ext:"png",mime:"image/png"};case"acTL":return{ext:"apng",mime:"image/apng"};default:await e.ignore(g.length+4)}}while(e.position+8<e.fileInfo.size);return{ext:"png",mime:"image/png"}}if(this.check([65,82,82,79,87,49,0,0]))return{ext:"arrow",mime:"application/x-apache-arrow"};if(this.check([103,108,84,70,2,0,0,0]))return{ext:"glb",mime:"model/gltf-binary"};if(this.check([102,114,101,101],{offset:4})||this.check([109,100,97,116],{offset:4})||this.check([109,111,111,118],{offset:4})||this.check([119,105,100,101],{offset:4}))return{ext:"mov",mime:"video/quicktime"};if(this.check([239,187,191])&&this.checkString("<?xml",{offset:3}))return{ext:"xml",mime:"application/xml"};if(this.check([73,73,82,79,8,0,0,0,24]))return{ext:"orf",mime:"image/x-olympus-orf"};if(this.checkString("gimp xcf "))return{ext:"xcf",mime:"image/x-xcf"};if(this.check([73,73,85,0,24,0,0,0,136,231,116,216]))return{ext:"rw2",mime:"image/x-panasonic-rw2"};if(this.check([48,38,178,117,142,102,207,17,166,217])){async function w(){const t=y.alloc(16);return await e.readBuffer(t),{id:t,size:Number(await e.readToken(cr.UINT64_LE))}}for(await e.ignore(30);e.position+24<e.fileInfo.size;){const v=await w();let b=v.size-24;if(Rr(v.id,[145,7,220,183,183,169,207,17,142,230,0,192,12,32,83,101])){const x=y.alloc(16);if(b-=await e.readBuffer(x),Rr(x,[64,158,105,248,77,91,207,17,168,253,0,128,95,92,68,43]))return{ext:"asf",mime:"audio/x-ms-asf"};if(Rr(x,[192,239,25,188,77,91,207,17,168,253,0,128,95,92,68,43]))return{ext:"asf",mime:"video/x-ms-asf"};break}await e.ignore(b)}return{ext:"asf",mime:"application/vnd.ms-asf"}}if(this.check([171,75,84,88,32,49,49,187,13,10,26,10]))return{ext:"ktx",mime:"image/ktx"};if((this.check([126,16,4])||this.check([126,24,4]))&&this.check([48,77,73,69],{offset:4}))return{ext:"mie",mime:"application/x-mie"};if(this.check([39,10,0,0,0,0,0,0,0,0,0,0],{offset:2}))return{ext:"shp",mime:"application/x-esri-shape"};if(this.check([0,0,0,12,106,80,32,32,13,10,135,10])){await e.ignore(20);switch(await e.readToken(new cr.StringType(4,"ascii"))){case"jp2 ":return{ext:"jp2",mime:"image/jp2"};case"jpx ":return{ext:"jpx",mime:"image/jpx"};case"jpm ":return{ext:"jpm",mime:"image/jpm"};case"mjp2":return{ext:"mj2",mime:"image/mj2"};default:return}}if(this.check([255,10])||this.check([0,0,0,12,74,88,76,32,13,10,135,10]))return{ext:"jxl",mime:"image/jxl"};if(this.check([254,255,0,60,0,63,0,120,0,109,0,108])||this.check([255,254,60,0,63,0,120,0,109,0,108,0]))return{ext:"xml",mime:"application/xml"};if(this.check([0,0,1,186])||this.check([0,0,1,179]))return{ext:"mpg",mime:"video/mpeg"};if(this.check([0,1,0,0,0]))return{ext:"ttf",mime:"font/ttf"};if(this.check([0,0,1,0]))return{ext:"ico",mime:"image/x-icon"};if(this.check([0,0,2,0]))return{ext:"cur",mime:"image/x-icon"};if(this.check([208,207,17,224,161,177,26,225]))return{ext:"cfb",mime:"application/x-cfb"};if(await e.peekBuffer(this.buffer,{length:Math.min(256,e.fileInfo.size),mayBeLess:!0}),this.checkString("BEGIN:")){if(this.checkString("VCARD",{offset:6}))return{ext:"vcf",mime:"text/vcard"};if(this.checkString("VCALENDAR",{offset:6}))return{ext:"ics",mime:"text/calendar"}}if(this.checkString("FUJIFILMCCD-RAW"))return{ext:"raf",mime:"image/x-fujifilm-raf"};if(this.checkString("Extended Module:"))return{ext:"xm",mime:"audio/x-xm"};if(this.checkString("Creative Voice File"))return{ext:"voc",mime:"audio/x-voc"};if(this.check([4,0,0,0])&&this.buffer.length>=16){const k=this.buffer.readUInt32LE(12);if(k>12&&this.buffer.length>=k+16)try{const E=this.buffer.slice(16,k+16).toString();if(JSON.parse(E).files)return{ext:"asar",mime:"application/x-asar"}}catch(S){}}if(this.check([6,14,43,52,2,5,1,1,13,1,2,1,1,2]))return{ext:"mxf",mime:"application/mxf"};if(this.checkString("SCRM",{offset:44}))return{ext:"s3m",mime:"audio/x-s3m"};if(this.check([71])&&this.check([71],{offset:188}))return{ext:"mts",mime:"video/mp2t"};if(this.check([71],{offset:4})&&this.check([71],{offset:196}))return{ext:"mts",mime:"video/mp2t"};if(this.check([66,79,79,75,77,79,66,73],{offset:60}))return{ext:"mobi",mime:"application/x-mobipocket-ebook"};if(this.check([68,73,67,77],{offset:128}))return{ext:"dcm",mime:"application/dicom"};if(this.check([76,0,0,0,1,20,2,0,0,0,0,0,192,0,0,0,0,0,0,70]))return{ext:"lnk",mime:"application/x.ms.shortcut"};if(this.check([98,111,111,107,0,0,0,0,109,97,114,107,0,0,0,0]))return{ext:"alias",mime:"application/x.apple.alias"};if(this.check([76,80],{offset:34})&&(this.check([0,0,1],{offset:8})||this.check([1,0,2],{offset:8})||this.check([2,0,2],{offset:8})))return{ext:"eot",mime:"application/vnd.ms-fontobject"};if(this.check([6,6,237,245,216,29,70,229,189,49,239,231,254,116,183,29]))return{ext:"indd",mime:"application/x-indesign"};if(await e.peekBuffer(this.buffer,{length:Math.min(512,e.fileInfo.size),mayBeLess:!0}),function(e,t=0){const r=Number.parseInt(e.toString("utf8",148,154).replace(/\0.*$/,"").trim(),8);if(Number.isNaN(r))return!1;let n=256;for(let r=t;r<t+148;r++)n+=e[r];for(let r=t+156;r<t+512;r++)n+=e[r];return r===n}(this.buffer))return{ext:"tar",mime:"application/x-tar"};if(this.check([255,254,255,14,83,0,107,0,101,0,116,0,99,0,104,0,85,0,112,0,32,0,77,0,111,0,100,0,101,0,108,0]))return{ext:"skp",mime:"application/vnd.sketchup.skp"};if(this.checkString("-----BEGIN PGP MESSAGE-----"))return{ext:"pgp",mime:"application/pgp-encrypted"};if(this.buffer.length>=2&&this.check([255,224],{offset:0,mask:[255,224]})){if(this.check([16],{offset:1,mask:[22]}))return this.check([8],{offset:1,mask:[8]}),{ext:"aac",mime:"audio/aac"};if(this.check([2],{offset:1,mask:[6]}))return{ext:"mp3",mime:"audio/mpeg"};if(this.check([4],{offset:1,mask:[6]}))return{ext:"mp2",mime:"audio/mpeg"};if(this.check([6],{offset:1,mask:[6]}))return{ext:"mp1",mime:"audio/mpeg"}}}}e.YC=ot,e.YL=it,e.YR={email:/\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*/,phone:/^1[3|4|5|6|7|8][0-9]{9}$/,fixedPhone:/(^0\d{2,3}-\d{7,8}$)|(^1[3|4|5|6|7|8][0-9]{9}$)/,qq:/[1-9][0-9]{4,}/,zipcode:/[1-9]\d{5}(?!\d)/,IDCard:/^\d{17}[\d|X|x]|\d{15}$/,chinese:/^[\u0391-\uFFE5]+$/,chineseNumberLine:/^[\u4E00-\u9FA5A-Za-z0-9_]+$/,chineseNumberNoLine:/^[\u4E00-\u9FA5A-Za-z0-9]+$/,integerZ:/^[1-9]\d*$/,integerF:/^-[1-9]\d*$/,number:/^\d+(\.\d+)?$/,numberNoMoreThan1:/^\-?([0-9](\d+)?(\.\d{1,1})?$)|(^0$)|(^\d\.\d{1,1})$/,numberNoMoreThan2:/^\-?([0-9](\d+)?(\.\d{1,2})?$)|(^0$)|(^\d\.\d{1,2})$/,numberNoMoreThan3:/^\-?([0-9](\d+)?(\.\d{1,3})?$)|(^0$)|(^\d\.\d{1,3})$/,numberNoMoreThan4:/^\-?([0-9](\d+)?(\.\d{1,4})?$)|(^0$)|(^\d\.\d{1,4})$/,greaterZero1:/^(0|[1-9]\d*)(\.\d{1,1})?$/,greaterZero2:/^(0|[1-9]\d*)(\.\d{1,2})?$/,greaterZero3:/^(0|[1-9]\d*)(\.\d{1,3})?$/,greaterZero4:/^(0|[1-9]\d*)(\.\d{1,4})?$/,zeroTo100:/^((\d|[1-9]\d)(\.\d{1,2})?$)|(^100|100.0|100.00$)$/,zeroTo1000:/^((\d|[1-9]{1,2}\d)(\.\d{1,2})?$)|(^1000|1000.0|1000.00$)$/},e.YS=nt,e.calTimeLen=(e,t,r="s",n)=>{let i;switch(r){case"m":i=1e3*wt;break;case"h":i=1e3*yt;break;case"d":i=1e3*gt;break;default:i=1e3}let o=(ct(t)-ct(e))/i;return o="number"==typeof n?Number(o.toFixed(n)):o,o},e.checkFileType=(e,t)=>{const r=new FileReader;r.readAsArrayBuffer(e),r.onload=async r=>{var n,i;try{const o=new Uint8Array(null===(n=r.target)||void 0===n?void 0:n.result),s=await lr.fromBuffer(o),a=await Pr(s),u=e.name.indexOf(".")>-1?(e.name.split(".").pop()||"").toLocaleLowerCase():"";let c=!a||u===a.ext;u.indexOf("xls")>-1&&((null===(i=null==a?void 0:a.ext)||void 0===i?void 0:i.indexOf("xls"))>-1||"cfb"===(null==a?void 0:a.ext))&&(c=!0),t(c,a)}catch(e){if(!(e instanceof lr.EndOfStreamError))throw e;t(!0,void 0)}}},e.dateFormat=ft,e.debounce=ur,e.expandMultiple=(e,t,r)=>Ct(e)(t,r),e.exportExcel=(e,t={})=>{let r;if("undefined"!=typeof window){r=window.localStorage.getItem("token");const n=Object.assign(Object.assign({},t),{token:r});/^https.*/.test(e)||(e=e.replace("http","https"));const i=`${e}?${(e=>{const t=[];return Object.keys(e).forEach((r=>{He(e[r])||Z(e[r])||t.push(`${r}=${e[r]}`)})),t.join("&")})(n)}`;console.log("YWFE下载地址=>",i);const o=`alink_${(new Date).getTime()}`,s=document.createElement("a");s.setAttribute("href",i),s.setAttribute("target","_blank"),s.setAttribute("id",o),document.getElementById(o)||document.body.appendChild(s),s.click(),setTimeout((()=>{document.body.removeChild(s)}),0)}},e.fenToyuan=(e,t)=>$t(100)(e,t),e.fileTypeFromTokenizer=Pr,e.formatData=e=>{let{afterUnit:t}=e;const{type:r,value:n,isAbs:i,beforeUnit:o}=e;if(-2147483648===Number(n))return"无权限";if("text"===r)return n||0===n?n:"-";if(isNaN(n)||0!==n&&!n)return"-";let s;switch(r){case"yuan":s=kt(n,2);break;case"fen":s=kt(n/100,2);break;case"decimalToPercentSave2Decimal":s=kt(100*n,2),t="string"==typeof t?t:"%";break;case"decimalToPercentSave0Decimal":s=kt(100*n,0),t="string"==typeof t?t:"%";break;case"percentSave2Decimal":s=kt(n,2),t="string"==typeof t?t:"%";break;case"percentSave0Decimal":s=kt(n,0),t="string"==typeof t?t:"%";break;case"int":s=kt(n,2,!0,!0);break;case"decimal":s=kt(n,2,!0,!1);break;case"secToTimeHM":s=mt(n,"{HH}h{mm}m");break;case"secToTimeChMS":s=mt(n,"{mm}分{ss}秒");break;case"secToTimeMS":s=mt(n,"{mm}m{ss}s");break;case"secToTime":s=mt(n,"{DD}d{HH}h{mm}m{ss}s",!1),s=s.replace("00d","").replace("00h","");break;default:s=kt(n)}return s="-"!==s&&i?s.replace("-",""):s,"-"===s?"-":`${o||""}${s}${t||""}`},e.formatTime=mt,e.gTokg=(e,t)=>$t(1e3)(e,t),e.getBiteLen=e=>{if("string"!=typeof e)return 0;let t=0;for(let r=0;r<e.length;r++)e.charCodeAt(r)>127||94===e.charCodeAt(r)?t+=2:t+=1;return t},e.getDate=ct,e.getEnv=Et,e.getHost=(e,t,r)=>{const n=window.configs?window.configs:{};let i=r&&St()?"mock":Et();return{basePath:n[e]?n[e][i].API_BASE_URL+""+("mock"===i?"/"+t:""):"",loginPath:n.AUTH?n.AUTH[i].APPLICATION_URL:""}},e.getImgUrl=(e,t=200,r,n)=>{const i=new RegExp(/resize:(\d+):(\d+)/,"g");let o="";return e?(o=e,o=i.test(o)?o.replace(i,`resize:${t}:${r||0}`):o.indexOf("x-oss-process=image")>-1||o.indexOf("?")>-1?o:`${o}?x-oss-process=image/resize,w_${t},limit_0/quality,q_60`):o=n||"https://cdn.ywwl.com/bps/ywyun/dianhu/assets/def_goods_img.png",o},e.getMD5=e=>He(e)||Z(e)?e:qe(String,e)?sr(e):e,e.getMock=St,e.getQueries=e=>{let t=e||window.location.search;return t=t.replace("?",""),Tt(t)||{}},e.getQuery=(e,t)=>{const r=new RegExp(`(\\?|&)${e}=([^&]*)(&|$)`,"i");let n=window.location.href;const i=r.exec(t||n);return null!=i&&decodeURIComponent(i[2])||""},e.getQueryName=(e,t)=>{let r=t||decodeURI(window.location.href);r=r.split("?")[1];const n=new Object;if(-1===r.indexOf("?")){const e=r.split("&");for(let t=0;t<e.length;t++){const r=e[t],i=r.indexOf("=");i>0&&(n[r.substr(0,i)]=decodeURI(r.substr(i+1)))}}return n[e]||""},e.getQueryOfNextPageContext=e=>{if(!e)return{};const{pathname:t="",asPath:r="",query:n}=e,i=ue(Qe("/"),Te((e=>/\[\w+\]/.test(e))),L((e=>Je("]","",Je("[","",e)))))(t),o=ue(Qe("#"),se(0,1))(r)||[],s=o.length?ue(Qe("/"),Te((e=>""!==e)))(o[0]):[],a=i.map(((e,t)=>({[`${e}`]:s[t]})));let u={};return i.length?u=Ve(a)||{}:u.path=s[0]||"desktop",Object.assign(Object.assign({},n),u)},e.getRoutes=(e,t,r,n)=>{if(He(e)||He(t))return{menus:[],defaultSelectedMenus:[],defaultOpenMenus:[],defaultMenu:{},permissions:[]};let i;i="/"!==n&&"/undefined"!==n&&"/null"!==n?rt("/",n):[];let o=[],s=[],a={};const u=e=>{const n=t[e.url];if(!n)return{};const i=0===e.url.indexOf("/")?e.url||"":`/${e.url}`,u={path:i,param:n.param||"",url:n.url,name:e.resourceId,meta:{title:e.name,icon:n.icon},component:n.component,hidden:n.hidden,origion_url:i};return((null==r?void 0:r.primaryDefaultMenu)&&e.url===(null==r?void 0:r.primaryDefaultMenu)||(null==r?void 0:r.secondaryDefaultMenu)&&e.url===(null==r?void 0:r.secondaryDefaultMenu))&&(o=[e.resourceParentId],s=[e.resourceId],a=u),u},c=[];let f=[];if(e.map((e=>{const r=[],n=t[e.url],i=vt({key:"resourceType",value:"BUTTON"},"childMenus",e);if(i&&i.length){const e=ue(L(q("url")))(i);f=Be(f,e)}if(e.childMenus&&e.childMenus.length){vt({key:"resourceId"},"childMenus",e.childMenus).map((e=>{if(e){const t=u(e);t&&t.name&&r.push(t)}}))}const o=u(e);n&&c.push(Object.assign(Object.assign({},o),{children:r}))})),i.length&&c.length){const e=bt(i,c);s=e.defaultSelectedMenus,o=e.defaultOpenMenus,a=e.defaultMenu}else if(!s.length||!o.length||!a){const e=xt(c);s=e.defaultSelectedMenus,o=e.defaultOpenMenus,a=e.defaultMenu}return{menus:c,defaultSelectedMenus:s,defaultOpenMenus:o,defaultMenu:a,permissions:f}},e.humpToLine=function(e){return"string"!=typeof e?e:e.replace(/([A-Z])/g,"_$1").toLowerCase()},e.isChinaMobile=e=>/^((\+86)|(86)|(086))?(13[0-9]|15[0-9]|166|17[0-9]|18[0-9]|14[0-9]|19[0-9])[0-9]{8}$/.test(String(e)),e.isDate=ut,e.isURL=e=>/^((?:(?:https?|ftp):|)\/\/)(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9]+)(?:\.(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9]+)*(?:\.(?:[a-z\u00a1-\uffff]{2,}))\.?)(?::\d{2,5})?(?:[/?#]\S*)?$/i.test(String(e)),e.joinPath=e=>{if(!e||He(e))return"";const t=Object.keys(e);let r="";return t.map((t=>{e[t]&&"search"!==t&&(r+=`/${e[t]}`),"search"===t&&(r+=e[t])})),r},e.kgTog=(e,t)=>Ct(1e3)(e,t),e.lineToHump=function(e){return"string"!=typeof e?e:e.replace(/\_(\w)/g,(function(e,t){return t.toUpperCase()}))},e.loadScript=function(e,t,r){return new Promise(((n,i)=>{const o=document.createElement("script");var s,a;o.id=t,o.readyState?(a=()=>n(o),(s=o).onreadystatechange=function(){"loaded"!==s.readyState&&"complete"!==s.readyState||(s.onreadystatechange=null,a())}):function(e,t,r){st(e,"load",t),st(e,"error",r)}(o,(()=>n(o)),(()=>{i(),document.removeChild(document.getElementById(t))})),r&&at.forEach((e=>{if(e in r){const t=r[e];"string"==typeof t?o.setAttribute(e,t):"boolean"==typeof t&&(o[e]=t)}})),o.src=e.js,document.body.appendChild(o)}))},e.maxSubstrWord=(e,t=5,r=!0)=>"string"==typeof e?r?`${e.substr(0,t)}...`:e.substr(0,t):e,e.niceNumShow=(e,t=!1)=>{if(0!==e&&!e||"-"===e)return[{type:"num",text:"-"}];const r=[],n=e.toString().split("");let i,o="";return n.forEach((e=>{let n=/^[0-9\\.]*$/.test(e)?"num":"character";n="."===e&&t||"num"===n&&"suffixNum"===i?"suffixNum":n,i!==n&&i?(r.push({type:i,text:o}),o=e):o=`${o}${e}`,i=n})),i=i||"num",r.push({type:i,text:o}),r},e.numberToThousand=(e,t=",")=>He(e)||Z(e)?e:isNaN(Number(e))?NaN:e.toString().replace(/\d+/,(e=>e.replace(/(\d)(?=(\d{3})+$)/g,(e=>`${e}${t}`)))),e.omadownload=(e,t,r)=>{const n=new Uint8Array(e);try{const e=String.fromCharCode.apply(null,n);if(e.indexOf("success")>-1)return JSON.parse(e)}catch(e){console.warn(e)}const i=window.URL.createObjectURL(new Blob([e],{type:r||"application/vnd.ms-excel"})),o=document.createElement("a");o.style.display="none",o.href=i,o.setAttribute("download",decodeURIComponent(t)),document.body.appendChild(o),o.click(),o.remove()},e.parseParams=e=>W(e).join("/"),e.pickAll=(e,t,r)=>{const n={reduce:K(((r,i,o)=>{const s=r(i,o);if(!(e=>Le([t],e))(o)){return s&&s.length?L((t=>t[e]||t))(s):[]}return o[t]?o[t].reduce(n.reduce(r),s):s})),find:K(((e,t,r)=>ue(L(n.reduce(e,t)),ze)(r)))},i=(r,n)=>n[e]?r.concat([Ze([t],n)]):r;switch(te(r)){case"Object":return n.reduce(i,[])(r);case"Array":return n.find(i,[])(r);default:return r}},e.querystring=_t,e.reduceMultiple=(e,t,r)=>$t(e)(t,r),e.reduceParams=e=>{if(!e)return{};if(e instanceof FormData)return e;return Te((e=>!Z(e)&&!He(e)))(e)||{}},e.remove=function(e,t){const r=[];if(!e||!e.length)return r;let n=-1,i=[],o=e.length;for(;++n<o;){const o=e[n];t(o,n,e)&&(r.push(o),i.push(n))}return function(e,t){let r=e?t.length:0,n=r-1,i=0;for(;r--;){const o=t[r];r!=n&&o===i||(i=o,Array.prototype.splice.call(e,o,1))}}(e,i),r},e.round=(e,t=0)=>Math.round(Math.random()*(e-t)+t),e.slicePath=(e,t=0,r)=>{const n=rt("/",e);r||(r=n.length-1);return"/"+n.slice(t,r).join("/")},e.split=rt,e.strPad=lt,e.sum=(e,t)=>{let r=new Lt(0);const n=(e,t)=>{"array"===Yt(e)&&Array.isArray(e)&&e.forEach((e=>{isNaN(e)||(r=r.plus(Number(e))),"object"===Yt(e)&&void 0!==t&&null!==e[t]&&(r=r.plus(Number(e[t]))),"array"===Yt(e)&&Array.isArray(e)&&n(e,t)}))};return n(e,t),Number(r)},e.throttle=function(e,t,r){let n=!0,i=!0;if("function"!=typeof e)throw new TypeError("Expected a function");return ar(r)&&(n="leading"in r?!!r.leading:n,i="trailing"in r?!!r.trailing:i),ur(e,t,{leading:n,trailing:i,maxWait:t})},e.timeFlow=(e,t,r="HH:mm:ss")=>ft(ct(e)+1e3*t,r),e.toDate=e=>{if(ut(e)){let t=e;return e instanceof Date?t=e:"string"==typeof e&&String(e).length>=13&&!isNaN(e)?t=Number(e):"string"==typeof e&&e.includes("-")&&(t=e.replace(/-/g,"/")),new Date(t).getTime()}return 0},e.transformShortNum=kt,e.translateMapToArray=(e,t=!1,r="全部",n=null)=>{let i=t?[{label:r,value:n}]:[];for(const[t,r]of e.entries())i.push({label:r,value:t});return i},e.treeFind=(e,t,r)=>{const n={reduce:K(((r,i,s)=>{const a=r(i,s);return((e=>t&&Le([t],e)&&!He(e[t]))(s)||s[e.key]!==e.value)&&t&&s[t]&&!He(s[t])?n.reduce(o,a)(s[t]):a})),find:K(((e,t,r)=>ue(L(n.reduce(e,t)),ze,et(t))(r)))},i=(r,n)=>e.value&&n[e.key]&&n[e.key]===e.value||!e.value&&n[e.key]?t?r.concat([Ze([t],n)]):r.concat([n]):r,o=(e,t)=>{const r=Object.keys(t),o=[];return r.map((e=>{o.push(t[e])})),n.find(i,e)(o)};switch(te(r)){case"Object":return n.reduce(o,[])(r);case"Array":return n.find(i,[])(r);default:return[]}},e.treePaths=(e,t,r)=>{const n={reduce:K(((r,i,s,a)=>{const u=r(i,s,a);return(e=>Le([t],e)&&!He(e[t]))(a)||a[e.key]!==e.value?a[t]&&!He(a[t])?n.reduce(o,[],Ze([t],a))(a[t]):u:(s.path&&u.splice(0,0,s.path),u)})),find:K(((e,t,r,i)=>ue(L(n.reduce(e,t,r)),ze)(i)))},i=(t,r,n)=>e.value&&n[e.key]&&n[e.key]===e.value||!e.value&&n[e.key]?t.concat([n.path]):t,o=(e,t,r)=>{if(!r||He(r))return e;const o=Object.keys(r),s=[];return o.map((e=>{s.push(r[e])})),n.find(i,e,t)(s)};switch(te(r)){case"Object":return n.reduce(o,[],{})(r);case"Array":return n.find(i,[],{})(r);default:return[]}},e.treeReduce=vt,e.trimAll=tt,e.trimParams=qt,e.unLoadScript=function(e){if(document.getElementById(e)){const t=document.getElementById(e);document.body.removeChild(t)}},e.uuidv4=()=>Xt(),e.wanToyuan=(e,t)=>Ct(1e4)(e,t),e.yuanTofen=(e,t)=>Ct(100)(e,t),e.yuanTowan=(e,t)=>$t(1e4)(e,t)}(re),e.JSON2String=function(e){var t=e.input.data,r=void 0===t?{}:t;try{return"```json"+JSON.stringify(r)+"json```"}catch(e){return"```json"+JSON.stringify({})+"json```"}},e.request=ie,e.userInputToJson=function(e){return t(this,arguments,void 0,(function(e){var t,n,i=e.input;return r(this,(function(e){switch(e.label){case 0:return console.log("input",i),[4,ie({input:{url:"https://fc-typechat.ywwl.com/userInputToJson",method:"GET",params:i}})];case 1:return(t=e.sent()).success?[2,(n=t.data).success?n.data:n]:[2,t.success?t.data:t]}}))}))}}));
3
+ read:function(e,t,r,n,i){var o,s,a=8*i-n-1,c=(1<<a)-1,u=c>>1,f=-7,l=r?i-1:0,h=r?-1:1,p=e[t+l];for(l+=h,o=p&(1<<-f)-1,p>>=-f,f+=a;f>0;o=256*o+e[t+l],l+=h,f-=8);for(s=o&(1<<-f)-1,o>>=-f,f+=n;f>0;s=256*s+e[t+l],l+=h,f-=8);if(0===o)o=1-u;else{if(o===c)return s?NaN:1/0*(p?-1:1);s+=Math.pow(2,n),o-=u}return(p?-1:1)*s*Math.pow(2,o-n)},write:function(e,t,r,n,i,o){var s,a,c,u=8*o-i-1,f=(1<<u)-1,l=f>>1,h=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,p=n?0:o-1,d=n?1:-1,m=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(a=isNaN(t)?1:0,s=f):(s=Math.floor(Math.log(t)/Math.LN2),t*(c=Math.pow(2,-s))<1&&(s--,c*=2),(t+=s+l>=1?h/c:h*Math.pow(2,1-l))*c>=2&&(s++,c/=2),s+l>=f?(a=0,s=f):s+l>=1?(a=(t*c-1)*Math.pow(2,i),s+=l):(a=t*Math.pow(2,l-1)*Math.pow(2,i),s=0));i>=8;e[r+p]=255&a,p+=d,a/=256,i-=8);for(s=s<<i|a,u+=i;u>0;e[r+p]=255&s,p+=d,s/=256,u-=8);e[r+p-d]|=128*m}};!function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.AnsiStringType=e.StringType=e.BufferType=e.Uint8ArrayType=e.IgnoreType=e.Float80_LE=e.Float80_BE=e.Float64_LE=e.Float64_BE=e.Float32_LE=e.Float32_BE=e.Float16_LE=e.Float16_BE=e.INT64_BE=e.UINT64_BE=e.INT64_LE=e.UINT64_LE=e.INT32_LE=e.INT32_BE=e.INT24_BE=e.INT24_LE=e.INT16_LE=e.INT16_BE=e.INT8=e.UINT32_BE=e.UINT32_LE=e.UINT24_BE=e.UINT24_LE=e.UINT16_BE=e.UINT16_LE=e.UINT8=void 0;const t=ur;function r(e){return new DataView(e.buffer,e.byteOffset)}e.UINT8={len:1,get:(e,t)=>r(e).getUint8(t),put:(e,t,n)=>(r(e).setUint8(t,n),t+1)},e.UINT16_LE={len:2,get:(e,t)=>r(e).getUint16(t,!0),put:(e,t,n)=>(r(e).setUint16(t,n,!0),t+2)},e.UINT16_BE={len:2,get:(e,t)=>r(e).getUint16(t),put:(e,t,n)=>(r(e).setUint16(t,n),t+2)},e.UINT24_LE={len:3,get(e,t){const n=r(e);return n.getUint8(t)+(n.getUint16(t+1,!0)<<8)},put(e,t,n){const i=r(e);return i.setUint8(t,255&n),i.setUint16(t+1,n>>8,!0),t+3}},e.UINT24_BE={len:3,get(e,t){const n=r(e);return(n.getUint16(t)<<8)+n.getUint8(t+2)},put(e,t,n){const i=r(e);return i.setUint16(t,n>>8),i.setUint8(t+2,255&n),t+3}},e.UINT32_LE={len:4,get:(e,t)=>r(e).getUint32(t,!0),put:(e,t,n)=>(r(e).setUint32(t,n,!0),t+4)},e.UINT32_BE={len:4,get:(e,t)=>r(e).getUint32(t),put:(e,t,n)=>(r(e).setUint32(t,n),t+4)},e.INT8={len:1,get:(e,t)=>r(e).getInt8(t),put:(e,t,n)=>(r(e).setInt8(t,n),t+1)},e.INT16_BE={len:2,get:(e,t)=>r(e).getInt16(t),put:(e,t,n)=>(r(e).setInt16(t,n),t+2)},e.INT16_LE={len:2,get:(e,t)=>r(e).getInt16(t,!0),put:(e,t,n)=>(r(e).setInt16(t,n,!0),t+2)},e.INT24_LE={len:3,get(t,r){const n=e.UINT24_LE.get(t,r);return n>8388607?n-16777216:n},put(e,t,n){const i=r(e);return i.setUint8(t,255&n),i.setUint16(t+1,n>>8,!0),t+3}},e.INT24_BE={len:3,get(t,r){const n=e.UINT24_BE.get(t,r);return n>8388607?n-16777216:n},put(e,t,n){const i=r(e);return i.setUint16(t,n>>8),i.setUint8(t+2,255&n),t+3}},e.INT32_BE={len:4,get:(e,t)=>r(e).getInt32(t),put:(e,t,n)=>(r(e).setInt32(t,n),t+4)},e.INT32_LE={len:4,get:(e,t)=>r(e).getInt32(t,!0),put:(e,t,n)=>(r(e).setInt32(t,n,!0),t+4)},e.UINT64_LE={len:8,get:(e,t)=>r(e).getBigUint64(t,!0),put:(e,t,n)=>(r(e).setBigUint64(t,n,!0),t+8)},e.INT64_LE={len:8,get:(e,t)=>r(e).getBigInt64(t,!0),put:(e,t,n)=>(r(e).setBigInt64(t,n,!0),t+8)},e.UINT64_BE={len:8,get:(e,t)=>r(e).getBigUint64(t),put:(e,t,n)=>(r(e).setBigUint64(t,n),t+8)},e.INT64_BE={len:8,get:(e,t)=>r(e).getBigInt64(t),put:(e,t,n)=>(r(e).setBigInt64(t,n),t+8)},e.Float16_BE={len:2,get(e,r){return t.read(e,r,!1,10,this.len)},put(e,r,n){return t.write(e,n,r,!1,10,this.len),r+this.len}},e.Float16_LE={len:2,get(e,r){return t.read(e,r,!0,10,this.len)},put(e,r,n){return t.write(e,n,r,!0,10,this.len),r+this.len}},e.Float32_BE={len:4,get:(e,t)=>r(e).getFloat32(t),put:(e,t,n)=>(r(e).setFloat32(t,n),t+4)},e.Float32_LE={len:4,get:(e,t)=>r(e).getFloat32(t,!0),put:(e,t,n)=>(r(e).setFloat32(t,n,!0),t+4)},e.Float64_BE={len:8,get:(e,t)=>r(e).getFloat64(t),put:(e,t,n)=>(r(e).setFloat64(t,n),t+8)},e.Float64_LE={len:8,get:(e,t)=>r(e).getFloat64(t,!0),put:(e,t,n)=>(r(e).setFloat64(t,n,!0),t+8)},e.Float80_BE={len:10,get(e,r){return t.read(e,r,!1,63,this.len)},put(e,r,n){return t.write(e,n,r,!1,63,this.len),r+this.len}},e.Float80_LE={len:10,get(e,r){return t.read(e,r,!0,63,this.len)},put(e,r,n){return t.write(e,n,r,!0,63,this.len),r+this.len}};e.IgnoreType=class{constructor(e){this.len=e}get(e,t){}};e.Uint8ArrayType=class{constructor(e){this.len=e}get(e,t){return e.subarray(t,t+this.len)}};e.BufferType=class{constructor(e){this.len=e}get(e,t){return Buffer.from(e.subarray(t,t+this.len))}};e.StringType=class{constructor(e,t){this.len=e,this.encoding=t}get(e,t){return Buffer.from(e).toString(this.encoding,t,t+this.len)}};class n{constructor(e){this.len=e}static decode(e,t,r){let i="";for(let o=t;o<r;++o)i+=n.codePointToString(n.singleByteDecoder(e[o]));return i}static inRange(e,t,r){return t<=e&&e<=r}static codePointToString(e){return e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode(55296+(e>>10),56320+(1023&e)))}static singleByteDecoder(e){if(n.inRange(e,0,127))return e;const t=n.windows1252[e-128];if(null===t)throw Error("invaliding encoding");return t}get(e,t=0){return n.decode(e,t,t+this.len)}}e.AnsiStringType=n,n.windows1252=[8364,129,8218,402,8222,8230,8224,8225,710,8240,352,8249,338,141,381,143,144,8216,8217,8220,8221,8226,8211,8212,732,8482,353,8250,339,157,382,376,160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209,210,211,212,213,214,215,216,217,218,219,220,221,222,223,224,225,226,227,228,229,230,231,232,233,234,235,236,237,238,239,240,241,242,243,244,245,246,247,248,249,250,251,252,253,254,255]}(cr);var fr={},lr={};Object.defineProperty(lr,"__esModule",{value:!0}),lr.readFile=lr.writeFileSync=lr.writeFile=lr.read=lr.open=lr.close=lr.stat=lr.createReadStream=lr.pathExists=void 0;const hr=r.default;lr.pathExists=hr.existsSync,lr.createReadStream=hr.createReadStream,lr.stat=async function(e){return new Promise(((t,r)=>{hr.stat(e,((e,n)=>{e?r(e):t(n)}))}))},lr.close=async function(e){return new Promise(((t,r)=>{hr.close(e,(e=>{e?r(e):t()}))}))},lr.open=async function(e,t){return new Promise(((r,n)=>{hr.open(e,t,((e,t)=>{e?n(e):r(t)}))}))},lr.read=async function(e,t,r,n,i){return new Promise(((o,s)=>{hr.read(e,t,r,n,i,((e,t,r)=>{e?s(e):o({bytesRead:t,buffer:r})}))}))},lr.writeFile=async function(e,t){return new Promise(((r,n)=>{hr.writeFile(e,t,(e=>{e?n(e):r()}))}))},lr.writeFileSync=function(e,t){hr.writeFileSync(e,t)},lr.readFile=async function(e){return new Promise(((t,r)=>{hr.readFile(e,((e,n)=>{e?r(e):t(n)}))}))};var pr={},dr={},mr={},gr={},yr={};!function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.EndOfStreamError=e.defaultMessages=void 0,e.defaultMessages="End-Of-Stream";class t extends Error{constructor(){super(e.defaultMessages)}}e.EndOfStreamError=t}(yr);var wr={},br={};Object.defineProperty(br,"__esModule",{value:!0}),br.Deferred=void 0;br.Deferred=class{constructor(){this.resolve=()=>null,this.reject=()=>null,this.promise=new Promise(((e,t)=>{this.reject=t,this.resolve=e}))}},function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.StreamReader=e.EndOfStreamError=void 0;const t=yr,r=br;var n=yr;Object.defineProperty(e,"EndOfStreamError",{enumerable:!0,get:function(){return n.EndOfStreamError}});e.StreamReader=class{constructor(e){if(this.s=e,this.deferred=null,this.endOfStream=!1,this.peekQueue=[],!e.read||!e.once)throw new Error("Expected an instance of stream.Readable");this.s.once("end",(()=>this.reject(new t.EndOfStreamError))),this.s.once("error",(e=>this.reject(e))),this.s.once("close",(()=>this.reject(new Error("Stream closed"))))}async peek(e,t,r){const n=await this.read(e,t,r);return this.peekQueue.push(e.subarray(t,t+n)),n}async read(e,r,n){if(0===n)return 0;if(0===this.peekQueue.length&&this.endOfStream)throw new t.EndOfStreamError;let i=n,o=0;for(;this.peekQueue.length>0&&i>0;){const t=this.peekQueue.pop();if(!t)throw new Error("peekData should be defined");const n=Math.min(t.length,i);e.set(t.subarray(0,n),r+o),o+=n,i-=n,n<t.length&&this.peekQueue.push(t.subarray(n))}for(;i>0&&!this.endOfStream;){const t=Math.min(i,1048576),n=await this.readFromStream(e,r+o,t);if(o+=n,n<t)break;i-=n}return o}async readFromStream(e,t,n){const i=this.s.read(n);if(i)return e.set(i,t),i.length;{const i={buffer:e,offset:t,length:n,deferred:new r.Deferred};return this.deferred=i.deferred,this.s.once("readable",(()=>{this.readDeferred(i)})),i.deferred.promise}}readDeferred(e){const t=this.s.read(e.length);t?(e.buffer.set(t,e.offset),e.deferred.resolve(t.length),this.deferred=null):this.s.once("readable",(()=>{this.readDeferred(e)}))}reject(e){this.endOfStream=!0,this.deferred&&(this.deferred.reject(e),this.deferred=null)}}}(wr),function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.StreamReader=e.EndOfStreamError=void 0;var t=yr;Object.defineProperty(e,"EndOfStreamError",{enumerable:!0,get:function(){return t.EndOfStreamError}});var r=wr;Object.defineProperty(e,"StreamReader",{enumerable:!0,get:function(){return r.StreamReader}})}(gr),Object.defineProperty(mr,"__esModule",{value:!0}),mr.AbstractTokenizer=void 0;const xr=gr;mr.AbstractTokenizer=class{constructor(e){this.position=0,this.numBuffer=new Uint8Array(8),this.fileInfo=e||{}}async readToken(e,t=this.position){const r=Buffer.alloc(e.len);if(await this.readBuffer(r,{position:t})<e.len)throw new xr.EndOfStreamError;return e.get(r,0)}async peekToken(e,t=this.position){const r=Buffer.alloc(e.len);if(await this.peekBuffer(r,{position:t})<e.len)throw new xr.EndOfStreamError;return e.get(r,0)}async readNumber(e){if(await this.readBuffer(this.numBuffer,{length:e.len})<e.len)throw new xr.EndOfStreamError;return e.get(this.numBuffer,0)}async peekNumber(e){if(await this.peekBuffer(this.numBuffer,{length:e.len})<e.len)throw new xr.EndOfStreamError;return e.get(this.numBuffer,0)}async ignore(e){if(void 0!==this.fileInfo.size){const t=this.fileInfo.size-this.position;if(e>t)return this.position+=t,t}return this.position+=e,e}async close(){}normalizeOptions(e,t){if(t&&void 0!==t.position&&t.position<this.position)throw new Error("`options.position` must be equal or greater than `tokenizer.position`");return t?{mayBeLess:!0===t.mayBeLess,offset:t.offset?t.offset:0,length:t.length?t.length:e.length-(t.offset?t.offset:0),position:t.position?t.position:this.position}:{mayBeLess:!1,offset:0,length:e.length,position:this.position}}},Object.defineProperty(dr,"__esModule",{value:!0}),dr.ReadStreamTokenizer=void 0;const vr=mr,kr=gr;class Sr extends vr.AbstractTokenizer{constructor(e,t){super(t),this.streamReader=new kr.StreamReader(e)}async getFileInfo(){return this.fileInfo}async readBuffer(e,t){const r=this.normalizeOptions(e,t),n=r.position-this.position;if(n>0)return await this.ignore(n),this.readBuffer(e,t);if(n<0)throw new Error("`options.position` must be equal or greater than `tokenizer.position`");if(0===r.length)return 0;const i=await this.streamReader.read(e,r.offset,r.length);if(this.position+=i,(!t||!t.mayBeLess)&&i<r.length)throw new kr.EndOfStreamError;return i}async peekBuffer(e,t){const r=this.normalizeOptions(e,t);let n=0;if(r.position){const t=r.position-this.position;if(t>0){const i=new Uint8Array(r.length+t);return n=await this.peekBuffer(i,{mayBeLess:r.mayBeLess}),e.set(i.subarray(t),r.offset),n-t}if(t<0)throw new Error("Cannot peek from a negative offset in a stream")}if(r.length>0){try{n=await this.streamReader.peek(e,r.offset,r.length)}catch(e){if(t&&t.mayBeLess&&e instanceof kr.EndOfStreamError)return 0;throw e}if(!r.mayBeLess&&n<r.length)throw new kr.EndOfStreamError}return n}async ignore(e){const t=Math.min(256e3,e),r=new Uint8Array(t);let n=0;for(;n<e;){const i=e-n,o=await this.readBuffer(r,{length:Math.min(t,i)});if(o<0)return o;n+=o}return n}}dr.ReadStreamTokenizer=Sr;var Er={};Object.defineProperty(Er,"__esModule",{value:!0}),Er.BufferTokenizer=void 0;const Tr=gr,Or=mr;class Nr extends Or.AbstractTokenizer{constructor(e,t){super(t),this.uint8Array=e,this.fileInfo.size=this.fileInfo.size?this.fileInfo.size:e.length}async readBuffer(e,t){if(t&&t.position){if(t.position<this.position)throw new Error("`options.position` must be equal or greater than `tokenizer.position`");this.position=t.position}const r=await this.peekBuffer(e,t);return this.position+=r,r}async peekBuffer(e,t){const r=this.normalizeOptions(e,t),n=Math.min(this.uint8Array.length-r.position,r.length);if(!r.mayBeLess&&n<r.length)throw new Tr.EndOfStreamError;return e.set(this.uint8Array.subarray(r.position,r.position+n),r.offset),n}async close(){}}Er.BufferTokenizer=Nr,function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.fromBuffer=e.fromStream=e.EndOfStreamError=void 0;const t=dr,r=Er;var n=gr;Object.defineProperty(e,"EndOfStreamError",{enumerable:!0,get:function(){return n.EndOfStreamError}}),e.fromStream=function(e,r){return r=r||{},new t.ReadStreamTokenizer(e,r)},e.fromBuffer=function(e,t){return new r.BufferTokenizer(e,t)}}(pr);var _r={};Object.defineProperty(_r,"__esModule",{value:!0}),_r.fromFile=_r.FileTokenizer=void 0;const jr=mr,Ir=gr,Br=lr;class Mr extends jr.AbstractTokenizer{constructor(e,t){super(t),this.fd=e}async readBuffer(e,t){const r=this.normalizeOptions(e,t);this.position=r.position;const n=await Br.read(this.fd,e,r.offset,r.length,r.position);if(this.position+=n.bytesRead,n.bytesRead<r.length&&(!t||!t.mayBeLess))throw new Ir.EndOfStreamError;return n.bytesRead}async peekBuffer(e,t){const r=this.normalizeOptions(e,t),n=await Br.read(this.fd,e,r.offset,r.length,r.position);if(!r.mayBeLess&&n.bytesRead<r.length)throw new Ir.EndOfStreamError;return n.bytesRead}async close(){return Br.close(this.fd)}}_r.FileTokenizer=Mr,_r.fromFile=async function(e){const t=await Br.stat(e);if(!t.isFile)throw new Error(`File not a file: ${e}`);const r=await Br.open(e,"r");return new Mr(r,{path:e,size:t.size})},function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.fromStream=e.fromBuffer=e.EndOfStreamError=e.fromFile=void 0;const t=lr,r=pr;var n=_r;Object.defineProperty(e,"fromFile",{enumerable:!0,get:function(){return n.fromFile}});var i=pr;Object.defineProperty(e,"EndOfStreamError",{enumerable:!0,get:function(){return i.EndOfStreamError}}),Object.defineProperty(e,"fromBuffer",{enumerable:!0,get:function(){return i.fromBuffer}}),e.fromStream=async function(e,n){if(n=n||{},e.path){const r=await t.stat(e.path);n.path=e.path,n.size=r.size}return r.fromStream(e,n)}}(fr);const Ar={get:(e,t)=>127&e[t+3]|e[t+2]<<7|e[t+1]<<14|e[t]<<21,len:4};async function zr(e){try{return(new Ur).parse(e)}catch(e){if(!(e instanceof fr.EndOfStreamError))throw e}}function Fr(e,t,r){r=Object.assign({offset:0},r);for(const[n,i]of t.entries())if(r.mask){if(i!==(r.mask[n]&e[n+r.offset]))return!1}else if(i!==e[n+r.offset])return!1;return!0}class Ur{constructor(){this.buffer=Buffer.alloc(4100)}check(e,t){return Fr(this.buffer,e,t)}checkString(e,t){return this.check((r=e,Object.values(r).map((e=>e.charCodeAt(0)))),t);var r}async readTiffTag(e){if(this.tokenizer){const t=await this.tokenizer.readToken(e?cr.UINT16_BE:cr.UINT16_LE);switch(this.tokenizer.ignore(10),t){case 50341:return{ext:"arw",mime:"image/x-sony-arw"};case 50706:return{ext:"dng",mime:"image/x-adobe-dng"}}}}async readTiffIFD(e){if(this.tokenizer){const t=await this.tokenizer.readToken(e?cr.UINT16_BE:cr.UINT16_LE);for(let r=0;r<t;++r){const t=await this.readTiffTag(e);if(t)return t}}}async readTiffHeader(e){const t=(e?cr.UINT16_BE:cr.UINT16_LE).get(this.buffer,2),r=(e?cr.UINT32_BE:cr.UINT32_LE).get(this.buffer,4);if(42===t){if(r>=6){if(this.checkString("CR",{offset:8}))return{ext:"cr2",mime:"image/x-canon-cr2"};if(r>=8&&(this.check([28,0,254,0],{offset:8})||this.check([31,0,11,0],{offset:8})))return{ext:"nef",mime:"image/x-nikon-nef"}}if(this.tokenizer){await this.tokenizer.ignore(r);const e=await this.readTiffIFD(!1);return e||{ext:"tif",mime:"image/tiff"}}}if(43===t)return{ext:"tif",mime:"image/tiff"}}async parse(e){if(this.buffer=Buffer.alloc(4100),void 0===e.fileInfo.size&&(e.fileInfo.size=Number.MAX_SAFE_INTEGER),this.tokenizer=e,await e.peekBuffer(this.buffer,{length:12,mayBeLess:!0}),this.check([66,77]))return{ext:"bmp",mime:"image/bmp"};if(this.check([11,119]))return{ext:"ac3",mime:"audio/vnd.dolby.dd-raw"};if(this.check([120,1]))return{ext:"dmg",mime:"application/x-apple-diskimage"};if(this.check([77,90]))return{ext:"exe",mime:"application/x-msdownload"};if(this.check([37,33]))return await e.peekBuffer(this.buffer,{length:24,mayBeLess:!0}),this.checkString("PS-Adobe-",{offset:2})&&this.checkString(" EPSF-",{offset:14})?{ext:"eps",mime:"application/eps"}:{ext:"ps",mime:"application/postscript"};if(this.check([31,160])||this.check([31,157]))return{ext:"Z",mime:"application/x-compress"};if(this.check([71,73,70]))return{ext:"gif",mime:"image/gif"};if(this.check([255,216,255]))return{ext:"jpg",mime:"image/jpeg"};if(this.check([73,73,188]))return{ext:"jxr",mime:"image/vnd.ms-photo"};if(this.check([31,139,8]))return{ext:"gz",mime:"application/gzip"};if(this.check([66,90,104]))return{ext:"bz2",mime:"application/x-bzip2"};if(this.checkString("ID3")){await e.ignore(6);const t=await e.readToken(Ar);return e.position+t>e.fileInfo.size?{ext:"mp3",mime:"audio/mpeg"}:(await e.ignore(t),zr(e))}if(this.checkString("MP+"))return{ext:"mpc",mime:"audio/x-musepack"};if((67===this.buffer[0]||70===this.buffer[0])&&this.check([87,83],{offset:1}))return{ext:"swf",mime:"application/x-shockwave-flash"};if(this.checkString("FLIF"))return{ext:"flif",mime:"image/flif"};if(this.checkString("8BPS"))return{ext:"psd",mime:"image/vnd.adobe.photoshop"};if(this.checkString("WEBP",{offset:8}))return{ext:"webp",mime:"image/webp"};if(this.checkString("MPCK"))return{ext:"mpc",mime:"audio/x-musepack"};if(this.checkString("FORM"))return{ext:"aif",mime:"audio/aiff"};if(this.checkString("icns",{offset:0}))return{ext:"icns",mime:"image/icns"};if(this.check([80,75,3,4])){try{for(;e.position+30<e.fileInfo.size;){await e.readBuffer(this.buffer,{length:30});const r={compressedSize:this.buffer.readUInt32LE(18),uncompressedSize:this.buffer.readUInt32LE(22),filenameLength:this.buffer.readUInt16LE(26),extraFieldLength:this.buffer.readUInt16LE(28)};if(r.filename=await e.readToken(new cr.StringType(r.filenameLength,"utf-8")),await e.ignore(r.extraFieldLength),"META-INF/mozilla.rsa"===r.filename)return{ext:"xpi",mime:"application/x-xpinstall"};if(r.filename.endsWith(".rels")||r.filename.endsWith(".xml")){switch(r.filename.split("/")[0]){case"_rels":default:break;case"word":return{ext:"docx",mime:"application/vnd.openxmlformats-officedocument.wordprocessingml.document"};case"ppt":return{ext:"pptx",mime:"application/vnd.openxmlformats-officedocument.presentationml.presentation"};case"xl":return{ext:"xlsx",mime:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"}}}if(r.filename.startsWith("xl/"))return{ext:"xlsx",mime:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"};if(r.filename.startsWith("3D/")&&r.filename.endsWith(".model"))return{ext:"3mf",mime:"model/3mf"};if("mimetype"===r.filename&&r.compressedSize===r.uncompressedSize){switch(await e.readToken(new cr.StringType(r.compressedSize,"utf-8"))){case"application/epub+zip":return{ext:"epub",mime:"application/epub+zip"};case"application/vnd.oasis.opendocument.text":return{ext:"odt",mime:"application/vnd.oasis.opendocument.text"};case"application/vnd.oasis.opendocument.spreadsheet":return{ext:"ods",mime:"application/vnd.oasis.opendocument.spreadsheet"};case"application/vnd.oasis.opendocument.presentation":return{ext:"odp",mime:"application/vnd.oasis.opendocument.presentation"}}}if(0===r.compressedSize){let n=-1;for(;n<0&&e.position<e.fileInfo.size;)await e.peekBuffer(this.buffer,{mayBeLess:!0}),n=this.buffer.indexOf("504B0304",0,"hex"),await e.ignore(n>=0?n:this.buffer.length)}else await e.ignore(r.compressedSize)}}catch(i){if(!(i instanceof fr.EndOfStreamError))throw i}return{ext:"zip",mime:"application/zip"}}if(this.checkString("OggS")){await e.ignore(28);const o=Buffer.alloc(8);return await e.readBuffer(o),Fr(o,[79,112,117,115,72,101,97,100])?{ext:"opus",mime:"audio/opus"}:Fr(o,[128,116,104,101,111,114,97])?{ext:"ogv",mime:"video/ogg"}:Fr(o,[1,118,105,100,101,111,0])?{ext:"ogm",mime:"video/ogg"}:Fr(o,[127,70,76,65,67])?{ext:"oga",mime:"audio/ogg"}:Fr(o,[83,112,101,101,120,32,32])?{ext:"spx",mime:"audio/ogg"}:Fr(o,[1,118,111,114,98,105,115])?{ext:"ogg",mime:"audio/ogg"}:{ext:"ogx",mime:"application/ogg"}}if(this.check([80,75])&&(3===this.buffer[2]||5===this.buffer[2]||7===this.buffer[2])&&(4===this.buffer[3]||6===this.buffer[3]||8===this.buffer[3]))return{ext:"zip",mime:"application/zip"};if(this.checkString("ftyp",{offset:4})&&96&this.buffer[8]){const s=this.buffer.toString("binary",8,12).replace("\0"," ").trim();switch(s){case"avif":case"avis":return{ext:"avif",mime:"image/avif"};case"mif1":return{ext:"heic",mime:"image/heif"};case"msf1":return{ext:"heic",mime:"image/heif-sequence"};case"heic":case"heix":return{ext:"heic",mime:"image/heic"};case"hevc":case"hevx":return{ext:"heic",mime:"image/heic-sequence"};case"qt":return{ext:"mov",mime:"video/quicktime"};case"M4V":case"M4VH":case"M4VP":return{ext:"m4v",mime:"video/x-m4v"};case"M4P":return{ext:"m4p",mime:"video/mp4"};case"M4B":return{ext:"m4b",mime:"audio/mp4"};case"M4A":return{ext:"m4a",mime:"audio/x-m4a"};case"F4V":return{ext:"f4v",mime:"video/mp4"};case"F4P":return{ext:"f4p",mime:"video/mp4"};case"F4A":return{ext:"f4a",mime:"audio/mp4"};case"F4B":return{ext:"f4b",mime:"audio/mp4"};case"crx":return{ext:"cr3",mime:"image/x-canon-cr3"};default:return s.startsWith("3g")?s.startsWith("3g2")?{ext:"3g2",mime:"video/3gpp2"}:{ext:"3gp",mime:"video/3gpp"}:{ext:"mp4",mime:"video/mp4"}}}if(this.checkString("MThd"))return{ext:"mid",mime:"audio/midi"};if(this.checkString("wOFF")&&(this.check([0,1,0,0],{offset:4})||this.checkString("OTTO",{offset:4})))return{ext:"woff",mime:"font/woff"};if(this.checkString("wOF2")&&(this.check([0,1,0,0],{offset:4})||this.checkString("OTTO",{offset:4})))return{ext:"woff2",mime:"font/woff2"};if(this.check([212,195,178,161])||this.check([161,178,195,212]))return{ext:"pcap",mime:"application/vnd.tcpdump.pcap"};if(this.checkString("DSD "))return{ext:"dsf",mime:"audio/x-dsf"};if(this.checkString("LZIP"))return{ext:"lz",mime:"application/x-lzip"};if(this.checkString("fLaC"))return{ext:"flac",mime:"audio/flac"};if(this.check([66,80,71,251]))return{ext:"bpg",mime:"image/bpg"};if(this.checkString("wvpk"))return{ext:"wv",mime:"audio/wavpack"};if(this.checkString("%PDF")){await e.ignore(1350);const a=10485760,c=Buffer.alloc(Math.min(a,e.fileInfo.size));return await e.readBuffer(c,{mayBeLess:!0}),c.includes(Buffer.from("AIPrivateData"))?{ext:"ai",mime:"application/postscript"}:{ext:"pdf",mime:"application/pdf"}}if(this.check([0,97,115,109]))return{ext:"wasm",mime:"application/wasm"};if(this.check([73,73])){const u=await this.readTiffHeader(!1);if(u)return u}if(this.check([77,77])){const f=await this.readTiffHeader(!0);if(f)return f}if(this.checkString("MAC "))return{ext:"ape",mime:"audio/ape"};if(this.check([26,69,223,163])){async function l(){const t=await e.peekNumber(cr.UINT8);let r=128,n=0;for(;!(t&r);)++n,r>>=1;const i=Buffer.alloc(n+1);return await e.readBuffer(i),i}async function h(){const e=await l(),t=await l();t[0]^=128>>t.length-1;const r=Math.min(6,t.length);return{id:e.readUIntBE(0,e.length),len:t.readUIntBE(t.length-r,r)}}async function p(t,r){for(;r>0;){const t=await h();if(17026===t.id){return(await e.readToken(new cr.StringType(t.len,"utf-8"))).replace(/\00.*$/g,"")}await e.ignore(t.len),--r}}const d=await h();switch(await p(0,d.len)){case"webm":return{ext:"webm",mime:"video/webm"};case"matroska":return{ext:"mkv",mime:"video/x-matroska"};default:return}}if(this.check([82,73,70,70])){if(this.check([65,86,73],{offset:8}))return{ext:"avi",mime:"video/vnd.avi"};if(this.check([87,65,86,69],{offset:8}))return{ext:"wav",mime:"audio/vnd.wave"};if(this.check([81,76,67,77],{offset:8}))return{ext:"qcp",mime:"audio/qcelp"}}if(this.checkString("SQLi"))return{ext:"sqlite",mime:"application/x-sqlite3"};if(this.check([78,69,83,26]))return{ext:"nes",mime:"application/x-nintendo-nes-rom"};if(this.checkString("Cr24"))return{ext:"crx",mime:"application/x-google-chrome-extension"};if(this.checkString("MSCF")||this.checkString("ISc("))return{ext:"cab",mime:"application/vnd.ms-cab-compressed"};if(this.check([237,171,238,219]))return{ext:"rpm",mime:"application/x-rpm"};if(this.check([197,208,211,198]))return{ext:"eps",mime:"application/eps"};if(this.check([40,181,47,253]))return{ext:"zst",mime:"application/zstd"};if(this.check([127,69,76,70]))return{ext:"elf",mime:"application/x-elf"};if(this.check([79,84,84,79,0]))return{ext:"otf",mime:"font/otf"};if(this.checkString("#!AMR"))return{ext:"amr",mime:"audio/amr"};if(this.checkString("{\\rtf"))return{ext:"rtf",mime:"application/rtf"};if(this.check([70,76,86,1]))return{ext:"flv",mime:"video/x-flv"};if(this.checkString("IMPM"))return{ext:"it",mime:"audio/x-it"};if(this.checkString("-lh0-",{offset:2})||this.checkString("-lh1-",{offset:2})||this.checkString("-lh2-",{offset:2})||this.checkString("-lh3-",{offset:2})||this.checkString("-lh4-",{offset:2})||this.checkString("-lh5-",{offset:2})||this.checkString("-lh6-",{offset:2})||this.checkString("-lh7-",{offset:2})||this.checkString("-lzs-",{offset:2})||this.checkString("-lz4-",{offset:2})||this.checkString("-lz5-",{offset:2})||this.checkString("-lhd-",{offset:2}))return{ext:"lzh",mime:"application/x-lzh-compressed"};if(this.check([0,0,1,186])){if(this.check([33],{offset:4,mask:[241]}))return{ext:"mpg",mime:"video/MP1S"};if(this.check([68],{offset:4,mask:[196]}))return{ext:"mpg",mime:"video/MP2P"}}if(this.checkString("ITSF"))return{ext:"chm",mime:"application/vnd.ms-htmlhelp"};if(this.check([253,55,122,88,90,0]))return{ext:"xz",mime:"application/x-xz"};if(this.checkString("<?xml "))return{ext:"xml",mime:"application/xml"};if(this.check([55,122,188,175,39,28]))return{ext:"7z",mime:"application/x-7z-compressed"};if(this.check([82,97,114,33,26,7])&&(0===this.buffer[6]||1===this.buffer[6]))return{ext:"rar",mime:"application/x-rar-compressed"};if(this.checkString("solid "))return{ext:"stl",mime:"model/stl"};if(this.checkString("BLENDER"))return{ext:"blend",mime:"application/x-blender"};if(this.checkString("!<arch>")){await e.ignore(8);return"debian-binary"===await e.readToken(new cr.StringType(13,"ascii"))?{ext:"deb",mime:"application/x-deb"}:{ext:"ar",mime:"application/x-unix-archive"}}if(this.check([137,80,78,71,13,10,26,10])){async function m(){return{length:await e.readToken(cr.INT32_BE),type:await e.readToken(new cr.StringType(4,"binary"))}}await e.ignore(8);do{const g=await m();if(g.length<0)return;switch(g.type){case"IDAT":return{ext:"png",mime:"image/png"};case"acTL":return{ext:"apng",mime:"image/apng"};default:await e.ignore(g.length+4)}}while(e.position+8<e.fileInfo.size);return{ext:"png",mime:"image/png"}}if(this.check([65,82,82,79,87,49,0,0]))return{ext:"arrow",mime:"application/x-apache-arrow"};if(this.check([103,108,84,70,2,0,0,0]))return{ext:"glb",mime:"model/gltf-binary"};if(this.check([102,114,101,101],{offset:4})||this.check([109,100,97,116],{offset:4})||this.check([109,111,111,118],{offset:4})||this.check([119,105,100,101],{offset:4}))return{ext:"mov",mime:"video/quicktime"};if(this.check([239,187,191])&&this.checkString("<?xml",{offset:3}))return{ext:"xml",mime:"application/xml"};if(this.check([73,73,82,79,8,0,0,0,24]))return{ext:"orf",mime:"image/x-olympus-orf"};if(this.checkString("gimp xcf "))return{ext:"xcf",mime:"image/x-xcf"};if(this.check([73,73,85,0,24,0,0,0,136,231,116,216]))return{ext:"rw2",mime:"image/x-panasonic-rw2"};if(this.check([48,38,178,117,142,102,207,17,166,217])){async function y(){const t=Buffer.alloc(16);return await e.readBuffer(t),{id:t,size:Number(await e.readToken(cr.UINT64_LE))}}for(await e.ignore(30);e.position+24<e.fileInfo.size;){const w=await y();let b=w.size-24;if(Fr(w.id,[145,7,220,183,183,169,207,17,142,230,0,192,12,32,83,101])){const x=Buffer.alloc(16);if(b-=await e.readBuffer(x),Fr(x,[64,158,105,248,77,91,207,17,168,253,0,128,95,92,68,43]))return{ext:"asf",mime:"audio/x-ms-asf"};if(Fr(x,[192,239,25,188,77,91,207,17,168,253,0,128,95,92,68,43]))return{ext:"asf",mime:"video/x-ms-asf"};break}await e.ignore(b)}return{ext:"asf",mime:"application/vnd.ms-asf"}}if(this.check([171,75,84,88,32,49,49,187,13,10,26,10]))return{ext:"ktx",mime:"image/ktx"};if((this.check([126,16,4])||this.check([126,24,4]))&&this.check([48,77,73,69],{offset:4}))return{ext:"mie",mime:"application/x-mie"};if(this.check([39,10,0,0,0,0,0,0,0,0,0,0],{offset:2}))return{ext:"shp",mime:"application/x-esri-shape"};if(this.check([0,0,0,12,106,80,32,32,13,10,135,10])){await e.ignore(20);switch(await e.readToken(new cr.StringType(4,"ascii"))){case"jp2 ":return{ext:"jp2",mime:"image/jp2"};case"jpx ":return{ext:"jpx",mime:"image/jpx"};case"jpm ":return{ext:"jpm",mime:"image/jpm"};case"mjp2":return{ext:"mj2",mime:"image/mj2"};default:return}}if(this.check([255,10])||this.check([0,0,0,12,74,88,76,32,13,10,135,10]))return{ext:"jxl",mime:"image/jxl"};if(this.check([254,255,0,60,0,63,0,120,0,109,0,108])||this.check([255,254,60,0,63,0,120,0,109,0,108,0]))return{ext:"xml",mime:"application/xml"};if(this.check([0,0,1,186])||this.check([0,0,1,179]))return{ext:"mpg",mime:"video/mpeg"};if(this.check([0,1,0,0,0]))return{ext:"ttf",mime:"font/ttf"};if(this.check([0,0,1,0]))return{ext:"ico",mime:"image/x-icon"};if(this.check([0,0,2,0]))return{ext:"cur",mime:"image/x-icon"};if(this.check([208,207,17,224,161,177,26,225]))return{ext:"cfb",mime:"application/x-cfb"};if(await e.peekBuffer(this.buffer,{length:Math.min(256,e.fileInfo.size),mayBeLess:!0}),this.checkString("BEGIN:")){if(this.checkString("VCARD",{offset:6}))return{ext:"vcf",mime:"text/vcard"};if(this.checkString("VCALENDAR",{offset:6}))return{ext:"ics",mime:"text/calendar"}}if(this.checkString("FUJIFILMCCD-RAW"))return{ext:"raf",mime:"image/x-fujifilm-raf"};if(this.checkString("Extended Module:"))return{ext:"xm",mime:"audio/x-xm"};if(this.checkString("Creative Voice File"))return{ext:"voc",mime:"audio/x-voc"};if(this.check([4,0,0,0])&&this.buffer.length>=16){const v=this.buffer.readUInt32LE(12);if(v>12&&this.buffer.length>=v+16)try{const k=this.buffer.slice(16,v+16).toString();if(JSON.parse(k).files)return{ext:"asar",mime:"application/x-asar"}}catch(S){}}if(this.check([6,14,43,52,2,5,1,1,13,1,2,1,1,2]))return{ext:"mxf",mime:"application/mxf"};if(this.checkString("SCRM",{offset:44}))return{ext:"s3m",mime:"audio/x-s3m"};if(this.check([71])&&this.check([71],{offset:188}))return{ext:"mts",mime:"video/mp2t"};if(this.check([71],{offset:4})&&this.check([71],{offset:196}))return{ext:"mts",mime:"video/mp2t"};if(this.check([66,79,79,75,77,79,66,73],{offset:60}))return{ext:"mobi",mime:"application/x-mobipocket-ebook"};if(this.check([68,73,67,77],{offset:128}))return{ext:"dcm",mime:"application/dicom"};if(this.check([76,0,0,0,1,20,2,0,0,0,0,0,192,0,0,0,0,0,0,70]))return{ext:"lnk",mime:"application/x.ms.shortcut"};if(this.check([98,111,111,107,0,0,0,0,109,97,114,107,0,0,0,0]))return{ext:"alias",mime:"application/x.apple.alias"};if(this.check([76,80],{offset:34})&&(this.check([0,0,1],{offset:8})||this.check([1,0,2],{offset:8})||this.check([2,0,2],{offset:8})))return{ext:"eot",mime:"application/vnd.ms-fontobject"};if(this.check([6,6,237,245,216,29,70,229,189,49,239,231,254,116,183,29]))return{ext:"indd",mime:"application/x-indesign"};if(await e.peekBuffer(this.buffer,{length:Math.min(512,e.fileInfo.size),mayBeLess:!0}),function(e,t=0){const r=Number.parseInt(e.toString("utf8",148,154).replace(/\0.*$/,"").trim(),8);if(Number.isNaN(r))return!1;let n=256;for(let r=t;r<t+148;r++)n+=e[r];for(let r=t+156;r<t+512;r++)n+=e[r];return r===n}(this.buffer))return{ext:"tar",mime:"application/x-tar"};if(this.check([255,254,255,14,83,0,107,0,101,0,116,0,99,0,104,0,85,0,112,0,32,0,77,0,111,0,100,0,101,0,108,0]))return{ext:"skp",mime:"application/vnd.sketchup.skp"};if(this.checkString("-----BEGIN PGP MESSAGE-----"))return{ext:"pgp",mime:"application/pgp-encrypted"};if(this.buffer.length>=2&&this.check([255,224],{offset:0,mask:[255,224]})){if(this.check([16],{offset:1,mask:[22]}))return this.check([8],{offset:1,mask:[8]}),{ext:"aac",mime:"audio/aac"};if(this.check([2],{offset:1,mask:[6]}))return{ext:"mp3",mime:"audio/mpeg"};if(this.check([4],{offset:1,mask:[6]}))return{ext:"mp2",mime:"audio/mpeg"};if(this.check([6],{offset:1,mask:[6]}))return{ext:"mp1",mime:"audio/mpeg"}}}}e.YC=it,e.YL=nt,e.YR={email:/\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*/,phone:/^1[3|4|5|6|7|8][0-9]{9}$/,fixedPhone:/(^0\d{2,3}-\d{7,8}$)|(^1[3|4|5|6|7|8][0-9]{9}$)/,qq:/[1-9][0-9]{4,}/,zipcode:/[1-9]\d{5}(?!\d)/,IDCard:/^\d{17}[\d|X|x]|\d{15}$/,chinese:/^[\u0391-\uFFE5]+$/,chineseNumberLine:/^[\u4E00-\u9FA5A-Za-z0-9_]+$/,chineseNumberNoLine:/^[\u4E00-\u9FA5A-Za-z0-9]+$/,integerZ:/^[1-9]\d*$/,integerF:/^-[1-9]\d*$/,number:/^\d+(\.\d+)?$/,numberNoMoreThan1:/^\-?([0-9](\d+)?(\.\d{1,1})?$)|(^0$)|(^\d\.\d{1,1})$/,numberNoMoreThan2:/^\-?([0-9](\d+)?(\.\d{1,2})?$)|(^0$)|(^\d\.\d{1,2})$/,numberNoMoreThan3:/^\-?([0-9](\d+)?(\.\d{1,3})?$)|(^0$)|(^\d\.\d{1,3})$/,numberNoMoreThan4:/^\-?([0-9](\d+)?(\.\d{1,4})?$)|(^0$)|(^\d\.\d{1,4})$/,greaterZero1:/^(0|[1-9]\d*)(\.\d{1,1})?$/,greaterZero2:/^(0|[1-9]\d*)(\.\d{1,2})?$/,greaterZero3:/^(0|[1-9]\d*)(\.\d{1,3})?$/,greaterZero4:/^(0|[1-9]\d*)(\.\d{1,4})?$/,zeroTo100:/^((\d|[1-9]\d)(\.\d{1,2})?$)|(^100|100.0|100.00$)$/,zeroTo1000:/^((\d|[1-9]{1,2}\d)(\.\d{1,2})?$)|(^1000|1000.0|1000.00$)$/},e.YS=rt,e.calTimeLen=(e,t,r="s",n)=>{let i;switch(r){case"m":i=1e3*yt;break;case"h":i=1e3*gt;break;case"d":i=1e3*mt;break;default:i=1e3}let o=(ct(t)-ct(e))/i;return o="number"==typeof n?Number(o.toFixed(n)):o,o},e.checkFileType=(e,t)=>{const r=new FileReader;r.readAsArrayBuffer(e),r.onload=async r=>{var n,i;try{const o=new Uint8Array(null===(n=r.target)||void 0===n?void 0:n.result),s=await fr.fromBuffer(o),a=await zr(s),c=e.name.indexOf(".")>-1?(e.name.split(".").pop()||"").toLocaleLowerCase():"";let u=!a||c===a.ext;c.indexOf("xls")>-1&&((null===(i=null==a?void 0:a.ext)||void 0===i?void 0:i.indexOf("xls"))>-1||"cfb"===(null==a?void 0:a.ext))&&(u=!0),t(u,a)}catch(e){if(!(e instanceof fr.EndOfStreamError))throw e;t(!0,void 0)}}},e.dateFormat=ut,e.debounce=ar,e.expandMultiple=(e,t,r)=>Dt(e)(t,r),e.exportExcel=(e,t={})=>{let r;if("undefined"!=typeof window){r=window.localStorage.getItem("token");const n=Object.assign(Object.assign({},t),{token:r});/^https.*/.test(e)||(e=e.replace("http","https"));const i=`${e}?${(e=>{const t=[];return Object.keys(e).forEach((r=>{He(e[r])||Q(e[r])||t.push(`${r}=${e[r]}`)})),t.join("&")})(n)}`;console.log("YWFE下载地址=>",i);const o=`alink_${(new Date).getTime()}`,s=document.createElement("a");s.setAttribute("href",i),s.setAttribute("target","_blank"),s.setAttribute("id",o),document.getElementById(o)||document.body.appendChild(s),s.click(),setTimeout((()=>{document.body.removeChild(s)}),0)}},e.fenToyuan=(e,t)=>Rt(100)(e,t),e.fileTypeFromTokenizer=zr,e.formatData=e=>{let{afterUnit:t}=e;const{type:r,value:n,isAbs:i,beforeUnit:o}=e;if(-2147483648===Number(n))return"无权限";if("text"===r)return n||0===n?n:"-";if(isNaN(n)||0!==n&&!n)return"-";let s;switch(r){case"yuan":s=vt(n,2);break;case"fen":s=vt(n/100,2);break;case"decimalToPercentSave2Decimal":s=vt(100*n,2),t="string"==typeof t?t:"%";break;case"decimalToPercentSave0Decimal":s=vt(100*n,0),t="string"==typeof t?t:"%";break;case"percentSave2Decimal":s=vt(n,2),t="string"==typeof t?t:"%";break;case"percentSave0Decimal":s=vt(n,0),t="string"==typeof t?t:"%";break;case"int":s=vt(n,2,!0,!0);break;case"decimal":s=vt(n,2,!0,!1);break;case"secToTimeHM":s=dt(n,"{HH}h{mm}m");break;case"secToTimeChMS":s=dt(n,"{mm}分{ss}秒");break;case"secToTimeMS":s=dt(n,"{mm}m{ss}s");break;case"secToTime":s=dt(n,"{DD}d{HH}h{mm}m{ss}s",!1),s=s.replace("00d","").replace("00h","");break;default:s=vt(n)}return s="-"!==s&&i?s.replace("-",""):s,"-"===s?"-":`${o||""}${s}${t||""}`},e.formatTime=dt,e.gTokg=(e,t)=>Rt(1e3)(e,t),e.getBiteLen=e=>{if("string"!=typeof e)return 0;let t=0;for(let r=0;r<e.length;r++)e.charCodeAt(r)>127||94===e.charCodeAt(r)?t+=2:t+=1;return t},e.getDate=ct,e.getEnv=kt,e.getHost=(e,t,r)=>{const n=window.configs?window.configs:{};let i=r&&St()?"mock":kt();return{basePath:n[e]?n[e][i].API_BASE_URL+""+("mock"===i?"/"+t:""):"",loginPath:n.AUTH?n.AUTH[i].APPLICATION_URL:""}},e.getImgUrl=(e,t=200,r,n)=>{const i=new RegExp(/resize:(\d+):(\d+)/,"g");let o="";return e?(o=e,o=i.test(o)?o.replace(i,`resize:${t}:${r||0}`):o.indexOf("x-oss-process=image")>-1||o.indexOf("?")>-1?o:`${o}?x-oss-process=image/resize,w_${t},limit_0/quality,q_60`):o=n||"https://cdn.ywwl.com/bps/ywyun/dianhu/assets/def_goods_img.png",o},e.getMD5=e=>He(e)||Q(e)?e:qe(String,e)?or(e):e,e.getMock=St,e.getQueries=e=>{let t=e||window.location.search;return t=t.replace("?",""),Et(t)||{}},e.getQuery=(e,t)=>{const r=new RegExp(`(\\?|&)${e}=([^&]*)(&|$)`,"i");let n=window.location.href;const i=r.exec(t||n);return null!=i&&decodeURIComponent(i[2])||""},e.getQueryName=(e,t)=>{let r=t||decodeURI(window.location.href);r=r.split("?")[1];const n=new Object;if(-1===r.indexOf("?")){const e=r.split("&");for(let t=0;t<e.length;t++){const r=e[t],i=r.indexOf("=");i>0&&(n[r.substr(0,i)]=decodeURI(r.substr(i+1)))}}return n[e]||""},e.getQueryOfNextPageContext=e=>{if(!e)return{};const{pathname:t="",asPath:r="",query:n}=e,i=ae(Ge("/"),Ee((e=>/\[\w+\]/.test(e))),$((e=>Ze("]","",Ze("[","",e)))))(t),o=ae(Ge("#"),oe(0,1))(r)||[],s=o.length?ae(Ge("/"),Ee((e=>""!==e)))(o[0]):[],a=i.map(((e,t)=>({[`${e}`]:s[t]})));let c={};return i.length?c=We(a)||{}:c.path=s[0]||"desktop",Object.assign(Object.assign({},n),c)},e.getRoutes=(e,t,r,n)=>{if(He(e)||He(t))return{menus:[],defaultSelectedMenus:[],defaultOpenMenus:[],defaultMenu:{},permissions:[]};let i;i="/"!==n&&"/undefined"!==n&&"/null"!==n?tt("/",n):[];let o=[],s=[],a={};const c=e=>{const n=t[e.url];if(!n)return{};const i=0===e.url.indexOf("/")?e.url||"":`/${e.url}`,c={path:i,param:n.param||"",url:n.url,name:e.resourceId,meta:{title:e.name,icon:n.icon},component:n.component,hidden:n.hidden,origion_url:i};return((null==r?void 0:r.primaryDefaultMenu)&&e.url===(null==r?void 0:r.primaryDefaultMenu)||(null==r?void 0:r.secondaryDefaultMenu)&&e.url===(null==r?void 0:r.secondaryDefaultMenu))&&(o=[e.resourceParentId],s=[e.resourceId],a=c),c},u=[];let f=[];if(e.map((e=>{const r=[],n=t[e.url],i=wt({key:"resourceType",value:"BUTTON"},"childMenus",e);if(i&&i.length){const e=ae($(H("url")))(i);f=je(f,e)}if(e.childMenus&&e.childMenus.length){wt({key:"resourceId"},"childMenus",e.childMenus).map((e=>{if(e){const t=c(e);t&&t.name&&r.push(t)}}))}const o=c(e);n&&u.push(Object.assign(Object.assign({},o),{children:r}))})),i.length&&u.length){const e=bt(i,u);s=e.defaultSelectedMenus,o=e.defaultOpenMenus,a=e.defaultMenu}else if(!s.length||!o.length||!a){const e=xt(u);s=e.defaultSelectedMenus,o=e.defaultOpenMenus,a=e.defaultMenu}return{menus:u,defaultSelectedMenus:s,defaultOpenMenus:o,defaultMenu:a,permissions:f}},e.humpToLine=function(e){return"string"!=typeof e?e:e.replace(/([A-Z])/g,"_$1").toLowerCase()},e.isChinaMobile=e=>/^((\+86)|(86)|(086))?(13[0-9]|15[0-9]|166|17[0-9]|18[0-9]|14[0-9]|19[0-9])[0-9]{8}$/.test(String(e)),e.isDate=at,e.isURL=e=>/^((?:(?:https?|ftp):|)\/\/)(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9]+)(?:\.(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9]+)*(?:\.(?:[a-z\u00a1-\uffff]{2,}))\.?)(?::\d{2,5})?(?:[/?#]\S*)?$/i.test(String(e)),e.joinPath=e=>{if(!e||He(e))return"";const t=Object.keys(e);let r="";return t.map((t=>{e[t]&&"search"!==t&&(r+=`/${e[t]}`),"search"===t&&(r+=e[t])})),r},e.kgTog=(e,t)=>Dt(1e3)(e,t),e.lineToHump=function(e){return"string"!=typeof e?e:e.replace(/\_(\w)/g,(function(e,t){return t.toUpperCase()}))},e.loadScript=function(e,t,r){return new Promise(((n,i)=>{const o=document.createElement("script");var s,a;o.id=t,o.readyState?(a=()=>n(o),(s=o).onreadystatechange=function(){"loaded"!==s.readyState&&"complete"!==s.readyState||(s.onreadystatechange=null,a())}):function(e,t,r){ot(e,"load",t),ot(e,"error",r)}(o,(()=>n(o)),(()=>{i(),document.removeChild(document.getElementById(t))})),r&&st.forEach((e=>{if(e in r){const t=r[e];"string"==typeof t?o.setAttribute(e,t):"boolean"==typeof t&&(o[e]=t)}})),o.src=e.js,document.body.appendChild(o)}))},e.maxSubstrWord=(e,t=5,r=!0)=>"string"==typeof e?r?`${e.substr(0,t)}...`:e.substr(0,t):e,e.niceNumShow=(e,t=!1)=>{if(0!==e&&!e||"-"===e)return[{type:"num",text:"-"}];const r=[],n=e.toString().split("");let i,o="";return n.forEach((e=>{let n=/^[0-9\\.]*$/.test(e)?"num":"character";n="."===e&&t||"num"===n&&"suffixNum"===i?"suffixNum":n,i!==n&&i?(r.push({type:i,text:o}),o=e):o=`${o}${e}`,i=n})),i=i||"num",r.push({type:i,text:o}),r},e.numberToThousand=(e,t=",")=>He(e)||Q(e)?e:isNaN(Number(e))?NaN:e.toString().replace(/\d+/,(e=>e.replace(/(\d)(?=(\d{3})+$)/g,(e=>`${e}${t}`)))),e.omadownload=(e,t,r)=>{const n=new Uint8Array(e);try{const e=String.fromCharCode.apply(null,n);if(e.indexOf("success")>-1)return JSON.parse(e)}catch(e){console.warn(e)}const i=window.URL.createObjectURL(new Blob([e],{type:r||"application/vnd.ms-excel"})),o=document.createElement("a");o.style.display="none",o.href=i,o.setAttribute("download",decodeURIComponent(t)),document.body.appendChild(o),o.click(),o.remove()},e.parseParams=e=>V(e).join("/"),e.pickAll=(e,t,r)=>{const n={reduce:K(((r,i,o)=>{const s=r(i,o);if(!(e=>Le([t],e))(o)){return s&&s.length?$((t=>t[e]||t))(s):[]}return o[t]?o[t].reduce(n.reduce(r),s):s})),find:K(((e,t,r)=>ae($(n.reduce(e,t)),Ue)(r)))},i=(r,n)=>n[e]?r.concat([Ve([t],n)]):r;switch(te(r)){case"Object":return n.reduce(i,[])(r);case"Array":return n.find(i,[])(r);default:return r}},e.querystring=Tt,e.reduceMultiple=(e,t,r)=>Rt(e)(t,r),e.reduceParams=e=>{if(!e)return{};if(e instanceof FormData)return e;return Ee((e=>!Q(e)&&!He(e)))(e)||{}},e.remove=function(e,t){const r=[];if(!e||!e.length)return r;let n=-1,i=[],o=e.length;for(;++n<o;){const o=e[n];t(o,n,e)&&(r.push(o),i.push(n))}return function(e,t){let r=e?t.length:0,n=r-1,i=0;for(;r--;){const o=t[r];r!=n&&o===i||(i=o,Array.prototype.splice.call(e,o,1))}}(e,i),r},e.round=(e,t=0)=>Math.round(Math.random()*(e-t)+t),e.slicePath=(e,t=0,r)=>{const n=tt("/",e);r||(r=n.length-1);return"/"+n.slice(t,r).join("/")},e.split=tt,e.strPad=ft,e.sum=(e,t)=>{let r=new Lt(0);const n=(e,t)=>{"array"===Ct(e)&&Array.isArray(e)&&e.forEach((e=>{isNaN(e)||(r=r.plus(Number(e))),"object"===Ct(e)&&void 0!==t&&null!==e[t]&&(r=r.plus(Number(e[t]))),"array"===Ct(e)&&Array.isArray(e)&&n(e,t)}))};return n(e,t),Number(r)},e.throttle=function(e,t,r){let n=!0,i=!0;if("function"!=typeof e)throw new TypeError("Expected a function");return sr(r)&&(n="leading"in r?!!r.leading:n,i="trailing"in r?!!r.trailing:i),ar(e,t,{leading:n,trailing:i,maxWait:t})},e.timeFlow=(e,t,r="HH:mm:ss")=>ut(ct(e)+1e3*t,r),e.toDate=e=>{if(at(e)){let t=e;return e instanceof Date?t=e:"string"==typeof e&&String(e).length>=13&&!isNaN(e)?t=Number(e):"string"==typeof e&&e.includes("-")&&(t=e.replace(/-/g,"/")),new Date(t).getTime()}return 0},e.transformShortNum=vt,e.translateMapToArray=(e,t=!1,r="全部",n=null)=>{let i=t?[{label:r,value:n}]:[];for(const[t,r]of e.entries())i.push({label:r,value:t});return i},e.treeFind=(e,t,r)=>{const n={reduce:K(((r,i,s)=>{const a=r(i,s);return((e=>t&&Le([t],e)&&!He(e[t]))(s)||s[e.key]!==e.value)&&t&&s[t]&&!He(s[t])?n.reduce(o,a)(s[t]):a})),find:K(((e,t,r)=>ae($(n.reduce(e,t)),Ue,Ke(t))(r)))},i=(r,n)=>e.value&&n[e.key]&&n[e.key]===e.value||!e.value&&n[e.key]?t?r.concat([Ve([t],n)]):r.concat([n]):r,o=(e,t)=>{const r=Object.keys(t),o=[];return r.map((e=>{o.push(t[e])})),n.find(i,e)(o)};switch(te(r)){case"Object":return n.reduce(o,[])(r);case"Array":return n.find(i,[])(r);default:return[]}},e.treePaths=(e,t,r)=>{const n={reduce:K(((r,i,s,a)=>{const c=r(i,s,a);return(e=>Le([t],e)&&!He(e[t]))(a)||a[e.key]!==e.value?a[t]&&!He(a[t])?n.reduce(o,[],Ve([t],a))(a[t]):c:(s.path&&c.splice(0,0,s.path),c)})),find:K(((e,t,r,i)=>ae($(n.reduce(e,t,r)),Ue)(i)))},i=(t,r,n)=>e.value&&n[e.key]&&n[e.key]===e.value||!e.value&&n[e.key]?t.concat([n.path]):t,o=(e,t,r)=>{if(!r||He(r))return e;const o=Object.keys(r),s=[];return o.map((e=>{s.push(r[e])})),n.find(i,e,t)(s)};switch(te(r)){case"Object":return n.reduce(o,[],{})(r);case"Array":return n.find(i,[],{})(r);default:return[]}},e.treeReduce=wt,e.trimAll=et,e.trimParams=qt,e.unLoadScript=function(e){if(document.getElementById(e)){const t=document.getElementById(e);document.body.removeChild(t)}},e.uuidv4=()=>Jt(),e.wanToyuan=(e,t)=>Dt(1e4)(e,t),e.yuanTofen=(e,t)=>Dt(100)(e,t),e.yuanTowan=(e,t)=>Rt(1e4)(e,t)}(i),e.request=function(e){return t(this,arguments,void 0,(function(e){var t,n,o,s,a,c,u,f=e.input;return r(this,(function(e){switch(e.label){case 0:return t=f.method||"GET",n=new Map([["prod","https://gateway.ywwl.com"],["test","https://test-gateway.ywwl.com"],["test2","https://test2-gateway.ywwl.com"],["dev","https://dev-gateway.ywwl.com"]]),o=function(e){return!!new RegExp("^(https?:\\/\\/)?((([a-z\\d]([a-z\\d-]*[a-z\\d])*)\\.)+[a-z]{2,}|((\\d{1,3}\\.){3}\\d{1,3}))(\\:\\d+)?(\\/[-a-z\\d%_.&#126;+]*)*(\\?[;&a-z\\d%_.&#126;+=-]*)?(\\#[-a-z\\d_]*)?$","i").test(e)},s=function(){return n.get("{{env}}")}(),a=o(f.url)?f.url:"".concat(s).concat(f.url),c={method:t,headers:{"Content-type":"application/json","x-token":"{{token}}"}},"POST"===t.toUpperCase()?c.body=JSON.stringify(f.params):"GET"===t.toUpperCase()&&(a="".concat(a,"?").concat(i.querystring.stringify(f.params||{}))),[4,fetch(a,c)];case 1:return(u=e.sent()).ok?[4,u.json()]:[2,{success:!1,message:"An error has occured: ".concat(u.status)}];case 2:return[2,e.sent()]}}))}))}}));
4
4
  //# sourceMappingURL=ywfe-tools.umd.js.map