@stackone/transport 2.7.1 → 2.7.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +4 -4
- package/dist/index.mjs +4 -4
- package/package.json +5 -5
package/dist/index.cjs
CHANGED
|
@@ -105,7 +105,7 @@ Example:
|
|
|
105
105
|
import { create, all } from 'mathjs';
|
|
106
106
|
const mathjs = create(all);
|
|
107
107
|
mathjs.config({ number: 'BigNumber' });
|
|
108
|
-
`);return Object.freeze(St)};(0,mn.default)(hn,St,{MATRIX_OPTIONS:fn,NUMBER_OPTIONS:pn});var gn=o(((e,t)=>{(function(n,r){typeof e==`object`&&t!==void 0?t.exports=r():typeof define==`function`&&define.amd?define(r):(n=typeof globalThis<`u`?globalThis:n||self,n[`'typed'`]=r())})(e,(function(){"use strict";function e(){return!0}function t(){return!1}function n(){}let r=`Argument is not a typed-function.`;function i(){function a(e){return typeof e==`object`&&!!e&&e.constructor===Object}let o=[{name:`number`,test:function(e){return typeof e==`number`}},{name:`string`,test:function(e){return typeof e==`string`}},{name:`boolean`,test:function(e){return typeof e==`boolean`}},{name:`Function`,test:function(e){return typeof e==`function`}},{name:`Array`,test:Array.isArray},{name:`Date`,test:function(e){return e instanceof Date}},{name:`RegExp`,test:function(e){return e instanceof RegExp}},{name:`Object`,test:a},{name:`null`,test:function(e){return e===null}},{name:`undefined`,test:function(e){return e===void 0}}],s={name:`any`,test:e,isAny:!0},c,l,u=0,d={createCount:0};function f(e){let t=c.get(e);if(t)return t;let n=`Unknown type "`+e+`"`,r=e.toLowerCase(),i;for(i of l)if(i.toLowerCase()===r){n+=`. Did you mean "`+i+`" ?`;break}throw TypeError(n)}function p(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:`any`,n=t?f(t).index:l.length,r=[];for(let t=0;t<e.length;++t){if(!e[t]||typeof e[t].name!=`string`||typeof e[t].test!=`function`)throw TypeError(`Object with properties {name: string, test: function} expected`);let i=e[t].name;if(c.has(i))throw TypeError(`Duplicate type name "`+i+`"`);r.push(i),c.set(i,{name:i,test:e[t].test,isAny:e[t].isAny,index:n+t,conversionsTo:[]})}let i=l.slice(n);l=l.slice(0,n).concat(r).concat(i);for(let e=n+r.length;e<l.length;++e)c.get(l[e]).index=e}function m(){c=new Map,l=[],u=0,p([s],!1)}m(),p(o);function h(){let e;for(e of l)c.get(e).conversionsTo=[];u=0}function g(e){let t=l.filter(t=>{let n=c.get(t);return!n.isAny&&n.test(e)});return t.length?t:[`any`]}function _(e){return e&&typeof e==`function`&&`_typedFunctionData`in e}function v(e,t,n){if(!_(e))throw TypeError(r);let i=n&&n.exact,a=ne(Array.isArray(t)?t.join(`,`):t),o=x(a);if(!i||o in e.signatures){let t=e._typedFunctionData.signatureMap.get(o);if(t)return t}let s=a.length,c;if(i){c=[];let t;for(t in e.signatures)c.push(e._typedFunctionData.signatureMap.get(t))}else c=e._typedFunctionData.signatures;for(let e=0;e<s;++e){let t=a[e],n=[],r;for(r of c){let i=ie(r.params,e);if(!(!i||t.restParam&&!i.restParam)){if(!i.hasAny){let e=te(i);if(t.types.some(t=>!e.has(t.name)))continue}n.push(r)}}if(c=n,c.length===0)break}let l;for(l of c)if(l.params.length<=s)return l;throw TypeError(`Signature not found (signature: `+(e.name||`unnamed`)+`(`+x(a,`, `)+`))`)}function y(e,t,n){return v(e,t,n).implementation}function b(e,t){let n=f(t);if(n.test(e))return e;let r=n.conversionsTo;if(r.length===0)throw Error(`There are no conversions to `+t+` defined.`);for(let t=0;t<r.length;t++)if(f(r[t].from).test(e))return r[t].convert(e);throw Error(`Cannot convert `+e+` to `+t)}function x(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:`,`;return e.map(e=>e.name).join(t)}function S(e){let t=e.indexOf(`...`)===0,n=(t?e.length>3?e.slice(3):`any`:e).split(`|`).map(e=>f(e.trim())),r=!1,i=t?`...`:``;return{types:n.map(function(e){return r=e.isAny||r,i+=e.name+`|`,{name:e.name,typeIndex:e.index,test:e.test,isAny:e.isAny,conversion:null,conversionIndex:-1}}),name:i.slice(0,-1),hasAny:r,hasConversion:!1,restParam:t}}function ee(e){let t=de(e.types.map(e=>e.name)),n=e.hasAny,r=e.name,i=t.map(function(e){let t=f(e.from);return n=t.isAny||n,r+=`|`+e.from,{name:e.from,typeIndex:t.index,test:t.test,isAny:t.isAny,conversion:e,conversionIndex:e.index}});return{types:e.types.concat(i),name:r,hasAny:n,hasConversion:i.length>0,restParam:e.restParam}}function te(e){return e.typeSet||(e.typeSet=new Set,e.types.forEach(t=>e.typeSet.add(t.name))),e.typeSet}function ne(e){let t=[];if(typeof e!=`string`)throw TypeError(`Signatures must be strings`);let n=e.trim();if(n===``)return t;let r=n.split(`,`);for(let e=0;e<r.length;++e){let n=S(r[e].trim());if(n.restParam&&e!==r.length-1)throw SyntaxError(`Unexpected rest parameter "`+r[e]+`": only allowed for the last parameter`);if(n.types.length===0)return null;t.push(n)}return t}function C(e){let t=Se(e);return t?t.restParam:!1}function w(t){if(!t||t.types.length===0)return e;if(t.types.length===1)return f(t.types[0].name).test;if(t.types.length===2){let e=f(t.types[0].name).test,n=f(t.types[1].name).test;return function(t){return e(t)||n(t)}}else{let e=t.types.map(function(e){return f(e.name).test});return function(t){for(let n=0;n<e.length;n++)if(e[n](t))return!0;return!1}}}function re(e){let t,n,r;if(C(e)){t=xe(e).map(w);let n=t.length,r=w(Se(e)),i=function(e){for(let t=n;t<e.length;t++)if(!r(e[t]))return!1;return!0};return function(e){for(let n=0;n<t.length;n++)if(!t[n](e[n]))return!1;return i(e)&&e.length>=n+1}}else if(e.length===0)return function(e){return e.length===0};else if(e.length===1)return n=w(e[0]),function(e){return n(e[0])&&e.length===1};else if(e.length===2)return n=w(e[0]),r=w(e[1]),function(e){return n(e[0])&&r(e[1])&&e.length===2};else return t=e.map(w),function(e){for(let n=0;n<t.length;n++)if(!t[n](e[n]))return!1;return e.length===t.length}}function ie(e,t){return t<e.length?e[t]:C(e)?Se(e):null}function ae(e,t){let n=ie(e,t);return n?te(n):new Set}function T(e){return e.conversion===null||e.conversion===void 0}function E(e,t){let n=new Set;return e.forEach(e=>{let r=ae(e.params,t),i;for(i of r)n.add(i)}),n.has(`any`)?[`any`]:Array.from(n)}function oe(e,t,n){let r,i,a=e||`unnamed`,o=n,s;for(s=0;s<t.length;s++){let e=[];if(o.forEach(n=>{let r=w(ie(n.params,s));(s<n.params.length||C(n.params))&&r(t[s])&&e.push(n)}),e.length===0){if(i=E(o,s),i.length>0){let e=g(t[s]);return r=TypeError(`Unexpected type of argument in function `+a+` (expected: `+i.join(` or `)+`, actual: `+e.join(` | `)+`, index: `+s+`)`),r.data={category:`wrongType`,fn:a,index:s,actual:e,expected:i},r}}else o=e}let c=o.map(function(e){return C(e.params)?1/0:e.params.length});if(t.length<Math.min.apply(null,c))return i=E(o,s),r=TypeError(`Too few arguments in function `+a+` (expected: `+i.join(` or `)+`, index: `+t.length+`)`),r.data={category:`tooFewArgs`,fn:a,index:t.length,expected:i},r;let l=Math.max.apply(null,c);if(t.length>l)return r=TypeError(`Too many arguments in function `+a+` (expected: `+l+`, actual: `+t.length+`)`),r.data={category:`tooManyArgs`,fn:a,index:t.length,expectedLength:l},r;let u=[];for(let e=0;e<t.length;++e)u.push(g(t[e]).join(`|`));return r=TypeError(`Arguments of type "`+u.join(`, `)+`" do not match any of the defined signatures of function `+a+`.`),r.data={category:`mismatch`,actual:u},r}function se(e){let t=l.length+1;for(let n=0;n<e.types.length;n++)T(e.types[n])&&(t=Math.min(t,e.types[n].typeIndex));return t}function ce(e){let t=u+1;for(let n=0;n<e.types.length;n++)T(e.types[n])||(t=Math.min(t,e.types[n].conversionIndex));return t}function le(e,t){if(e.hasAny){if(!t.hasAny)return 1}else if(t.hasAny)return-1;if(e.restParam){if(!t.restParam)return 1}else if(t.restParam)return-1;if(e.hasConversion){if(!t.hasConversion)return 1}else if(t.hasConversion)return-1;let n=se(e)-se(t);if(n<0)return-1;if(n>0)return 1;let r=ce(e)-ce(t);return r<0?-1:r>0?1:0}function ue(e,t){let n=e.params,r=t.params,i=Se(n),a=Se(r),o=C(n),s=C(r);if(o&&i.hasAny){if(!s||!a.hasAny)return 1}else if(s&&a.hasAny)return-1;let c=0,l=0,u;for(u of n)u.hasAny&&++c,u.hasConversion&&++l;let d=0,f=0;for(u of r)u.hasAny&&++d,u.hasConversion&&++f;if(c!==d)return c-d;if(o&&i.hasConversion){if(!s||!a.hasConversion)return 1}else if(s&&a.hasConversion)return-1;if(l!==f)return l-f;if(o){if(!s)return 1}else if(s)return-1;let p=(n.length-r.length)*(o?-1:1);if(p!==0)return p;let m=[],h=0;for(let e=0;e<n.length;++e){let t=le(n[e],r[e]);m.push(t),h+=t}if(h!==0)return h;let g;for(g of m)if(g!==0)return g;return 0}function de(e){if(e.length===0)return[];let t=e.map(f);e.length>1&&t.sort((e,t)=>e.index-t.index);let n=t[0].conversionsTo;if(e.length===1)return n;n=n.concat([]);let r=new Set(e);for(let e=1;e<t.length;++e){let i;for(i of t[e].conversionsTo)r.has(i.from)||(n.push(i),r.add(i.from))}return n}function D(e,t){let n=t;if(e.some(e=>e.hasConversion)){let r=C(e),i=e.map(fe);n=function(){let e=[],n=r?arguments.length-1:arguments.length;for(let t=0;t<n;t++)e[t]=i[t](arguments[t]);return r&&(e[n]=arguments[n].map(i[n])),t.apply(this,e)}}let r=n;if(C(e)){let t=e.length-1;r=function(){return n.apply(this,Ce(arguments,0,t).concat([Ce(arguments,t)]))}}return r}function fe(e){let t,n,r,i,a=[],o=[];switch(e.types.forEach(function(e){e.conversion&&(a.push(f(e.conversion.from).test),o.push(e.conversion.convert))}),o.length){case 0:return function(e){return e};case 1:return t=a[0],r=o[0],function(e){return t(e)?r(e):e};case 2:return t=a[0],n=a[1],r=o[0],i=o[1],function(e){return t(e)?r(e):n(e)?i(e):e};default:return function(e){for(let t=0;t<o.length;t++)if(a[t](e))return o[t](e);return e}}}function pe(e){function t(e,n,r){if(n<e.length){let i=e[n],a=[];if(i.restParam){let e=i.types.filter(T);e.length<i.types.length&&a.push({types:e,name:`...`+e.map(e=>e.name).join(`|`),hasAny:e.some(e=>e.isAny),hasConversion:!1,restParam:!0}),a.push(i)}else a=i.types.map(function(e){return{types:[e],name:e.name,hasAny:e.isAny,hasConversion:e.conversion,restParam:!1}});return Te(a,function(i){return t(e,n+1,r.concat([i]))})}else return[r]}return t(e,0,[])}function me(e,t){let n=Math.max(e.length,t.length);for(let r=0;r<n;r++){let n=ae(e,r),i=ae(t,r),a=!1,o;for(o of i)if(n.has(o)){a=!0;break}if(!a)return!1}let r=e.length,i=t.length,a=C(e),o=C(t);return a?o?r===i:i>=r:o?r>=i:r===i}function he(e){return e.map(e=>Oe(e)?k(e.referToSelf.callback):De(e)?O(e.referTo.references,e.referTo.callback):e)}function ge(e,t,n){let r=[],i;for(i of e){let e=n[i];if(typeof e!=`number`)throw TypeError(`No definition for referenced signature "`+i+`"`);if(e=t[e],typeof e!=`function`)return!1;r.push(e)}return r}function _e(e,t,n){let r=he(e),i=Array(r.length).fill(!1),a=!0;for(;a;){a=!1;let e=!0;for(let o=0;o<r.length;++o){if(i[o])continue;let s=r[o];if(Oe(s))r[o]=s.referToSelf.callback(n),r[o].referToSelf=s.referToSelf,i[o]=!0,e=!1;else if(De(s)){let n=ge(s.referTo.references,r,t);n?(r[o]=s.referTo.callback.apply(this,n),r[o].referTo=s.referTo,i[o]=!0,e=!1):a=!0}}if(e&&a)throw SyntaxError(`Circular reference detected in resolving typed.referTo`)}return r}function ve(e){let t=/\bthis(\(|\.signatures\b)/;Object.keys(e).forEach(n=>{let r=e[n];if(t.test(r.toString()))throw SyntaxError("Using `this` to self-reference a function is deprecated since typed-function@3. Use typed.referTo and typed.referToSelf instead.")})}function ye(e,r){if(d.createCount++,Object.keys(r).length===0)throw SyntaxError(`No signatures provided`);d.warnAgainstDeprecatedThis&&ve(r);let i=[],a=[],o={},s=[],c;for(c in r){if(!Object.prototype.hasOwnProperty.call(r,c))continue;let e=ne(c);if(!e)continue;i.forEach(function(t){if(me(t,e))throw TypeError(`Conflicting signatures "`+x(t)+`" and "`+x(e)+`".`)}),i.push(e);let t=a.length;a.push(r[c]);let n=e.map(ee),l;for(l of pe(n)){let e=x(l);s.push({params:l,name:e,fn:t}),l.every(e=>!e.hasConversion)&&(o[e]=t)}}s.sort(ue);let l=_e(a,o,Me),u;for(u in o)Object.prototype.hasOwnProperty.call(o,u)&&(o[u]=l[o[u]]);let f=[],p=new Map;for(u of s)p.has(u.name)||(u.fn=l[u.fn],f.push(u),p.set(u.name,u));let m=f[0]&&f[0].params.length<=2&&!C(f[0].params),h=f[1]&&f[1].params.length<=2&&!C(f[1].params),g=f[2]&&f[2].params.length<=2&&!C(f[2].params),_=f[3]&&f[3].params.length<=2&&!C(f[3].params),v=f[4]&&f[4].params.length<=2&&!C(f[4].params),y=f[5]&&f[5].params.length<=2&&!C(f[5].params),b=m&&h&&g&&_&&v&&y;for(let e=0;e<f.length;++e)f[e].test=re(f[e].params);let S=m?w(f[0].params[0]):t,te=h?w(f[1].params[0]):t,ie=g?w(f[2].params[0]):t,ae=_?w(f[3].params[0]):t,T=v?w(f[4].params[0]):t,E=y?w(f[5].params[0]):t,oe=m?w(f[0].params[1]):t,se=h?w(f[1].params[1]):t,ce=g?w(f[2].params[1]):t,le=_?w(f[3].params[1]):t,de=v?w(f[4].params[1]):t,fe=y?w(f[5].params[1]):t;for(let e=0;e<f.length;++e)f[e].implementation=D(f[e].params,f[e].fn);let he=m?f[0].implementation:n,ge=h?f[1].implementation:n,ye=g?f[2].implementation:n,be=_?f[3].implementation:n,xe=v?f[4].implementation:n,Se=y?f[5].implementation:n,Ce=m?f[0].params.length:-1,we=h?f[1].params.length:-1,Te=g?f[2].params.length:-1,Ee=_?f[3].params.length:-1,O=v?f[4].params.length:-1,k=y?f[5].params.length:-1,De=b?6:0,Oe=f.length,ke=f.map(e=>e.test),Ae=f.map(e=>e.implementation),je=function(){for(let e=De;e<Oe;e++)if(ke[e](arguments))return Ae[e].apply(this,arguments);return d.onMismatch(e,arguments,f)};function Me(e,t){return arguments.length===Ce&&S(e)&&oe(t)?he.apply(this,arguments):arguments.length===we&&te(e)&&se(t)?ge.apply(this,arguments):arguments.length===Te&&ie(e)&&ce(t)?ye.apply(this,arguments):arguments.length===Ee&&ae(e)&&le(t)?be.apply(this,arguments):arguments.length===O&&T(e)&&de(t)?xe.apply(this,arguments):arguments.length===k&&E(e)&&fe(t)?Se.apply(this,arguments):je.apply(this,arguments)}try{Object.defineProperty(Me,`name`,{value:e})}catch{}return Me.signatures=o,Me._typedFunctionData={signatures:f,signatureMap:p},Me}function be(e,t,n){throw oe(e,t,n)}function xe(e){return Ce(e,0,e.length-1)}function Se(e){return e[e.length-1]}function Ce(e,t,n){return Array.prototype.slice.call(e,t,n)}function we(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return e[n]}function Te(e,t){return Array.prototype.concat.apply([],e.map(t))}function Ee(){let e=xe(arguments).map(e=>x(ne(e))),t=Se(arguments);if(typeof t!=`function`)throw TypeError(`Callback function expected as last argument`);return O(e,t)}function O(e,t){return{referTo:{references:e,callback:t}}}function k(e){if(typeof e!=`function`)throw TypeError(`Callback function expected as first argument`);return{referToSelf:{callback:e}}}function De(e){return e&&typeof e.referTo==`object`&&Array.isArray(e.referTo.references)&&typeof e.referTo.callback==`function`}function Oe(e){return e&&typeof e.referToSelf==`object`&&typeof e.referToSelf.callback==`function`}function ke(e,t){if(!e)return t;if(t&&t!==e){let n=Error(`Function names do not match (expected: `+e+`, actual: `+t+`)`);throw n.data={actual:t,expected:e},n}return e}function Ae(e){let t;for(let n in e)Object.prototype.hasOwnProperty.call(e,n)&&(_(e[n])||typeof e[n].signature==`string`)&&(t=ke(t,e[n].name));return t}function je(e,t){let n;for(n in t)if(Object.prototype.hasOwnProperty.call(t,n)){if(n in e&&t[n]!==e[n]){let r=Error(`Signature "`+n+`" is defined twice`);throw r.data={signature:n,sourceFunction:t[n],destFunction:e[n]},r}e[n]=t[n]}}let Me=d;d=function(e){let t=typeof e==`string`,n=t?1:0,r=t?e:``,i={};for(let e=n;e<arguments.length;++e){let n=arguments[e],o={},s;if(typeof n==`function`?(s=n.name,typeof n.signature==`string`?o[n.signature]=n:_(n)&&(o=n.signatures)):a(n)&&(o=n,t||(s=Ae(n))),Object.keys(o).length===0){let t=TypeError(`Argument to 'typed' at index `+e+` is not a (typed) function, nor an object with signatures as keys and functions as values.`);throw t.data={index:e,argument:n},t}t||(r=ke(r,s)),je(i,o)}return ye(r||``,i)},d.create=i,d.createCount=Me.createCount,d.onMismatch=be,d.throwMismatchError=be,d.createError=oe,d.clear=m,d.clearConversions=h,d.addTypes=p,d._findType=f,d.referTo=Ee,d.referToSelf=k,d.convert=b,d.findSignature=v,d.find=y,d.isTypedFunction=_,d.warnAgainstDeprecatedThis=!0,d.addType=function(e,t){let n=`any`;t!==!1&&c.has(`Object`)&&(n=`Object`),d.addTypes([e],n)};function Ne(e){if(!e||typeof e.from!=`string`||typeof e.to!=`string`||typeof e.convert!=`function`)throw TypeError(`Object with properties {from: string, to: string, convert: function} expected`);if(e.to===e.from)throw SyntaxError(`Illegal to define conversion from "`+e.from+`" to itself.`)}return d.addConversion=function(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{override:!1};Ne(e);let n=f(e.to),r=n.conversionsTo.find(t=>t.from===e.from);if(r)if(t&&t.override)d.removeConversion({from:r.from,to:e.to,convert:r.convert});else throw Error(`There is already a conversion from "`+e.from+`" to "`+n.name+`"`);n.conversionsTo.push({from:e.from,convert:e.convert,index:u++})},d.addConversions=function(e,t){e.forEach(e=>d.addConversion(e,t))},d.removeConversion=function(e){Ne(e);let t=f(e.to),n=we(t.conversionsTo,t=>t.from===e.from);if(!n)throw Error(`Attempt to remove nonexistent conversion from `+e.from+` to `+e.to);if(n.convert!==e.convert)throw Error(`Conversion to remove does not match existing conversion`);let r=t.conversionsTo.indexOf(n);t.conversionsTo.splice(r,1)},d.resolve=function(e,t){if(!_(e))throw TypeError(r);let n=e._typedFunctionData.signatures;for(let e=0;e<n.length;++e)if(n[e].test(t))return n[e];return null},d}return i()}))}));function N(e){return typeof e==`boolean`?!0:isFinite(e)?e===Math.round(e):!1}function _n(e,t,n){var r={2:`0b`,8:`0o`,16:`0x`}[t],i=``;if(n){if(n<1)throw Error(`size must be in greater than 0`);if(!N(n))throw Error(`size must be an integer`);if(e>2**(n-1)-1||e<-(2**(n-1)))throw Error(`Value must be in range [-2^${n-1}, 2^${n-1}-1]`);if(!N(e))throw Error(`Value must be an integer`);e<0&&(e+=2**n),i=`i${n}`}var a=``;return e<0&&(e=-e,a=`-`),`${a}${r}${e.toString(t)}${i}`}function vn(e,t){if(typeof t==`function`)return t(e);if(e===1/0)return`Infinity`;if(e===-1/0)return`-Infinity`;if(isNaN(e))return`NaN`;var n=`auto`,r,i;if(t&&(t.notation&&(n=t.notation),A(t)?r=t:A(t.precision)&&(r=t.precision),t.wordSize&&(i=t.wordSize,typeof i!=`number`)))throw Error(`Option "wordSize" must be a number`);switch(n){case`fixed`:return xn(e,r);case`exponential`:return Sn(e,r);case`engineering`:return bn(e,r);case`bin`:return _n(e,2,i);case`oct`:return _n(e,8,i);case`hex`:return _n(e,16,i);case`auto`:return Cn(e,r,t&&t).replace(/((\.\d*?)(0+))($|e)/,function(){var e=arguments[2],t=arguments[4];return e===`.`?t:e+t});default:throw Error(`Unknown notation "`+n+`". Choose "auto", "exponential", "fixed", "bin", "oct", or "hex.`)}}function yn(e){var t=String(e).toLowerCase().match(/^(-?)(\d+\.?\d*)(e([+-]?\d+))?$/);if(!t)throw SyntaxError(`Invalid number `+e);var n=t[1],r=t[2],i=parseFloat(t[4]||`0`),a=r.indexOf(`.`);i+=a===-1?r.length-1:a-1;var o=r.replace(`.`,``).replace(/^0*/,function(e){return i-=e.length,``}).replace(/0*$/,``).split(``).map(function(e){return parseInt(e)});return o.length===0&&(o.push(0),i++),{sign:n,coefficients:o,exponent:i}}function bn(e,t){if(isNaN(e)||!isFinite(e))return String(e);var n=wn(yn(e),t),r=n.exponent,i=n.coefficients,a=r%3==0?r:r<0?r-3-r%3:r-r%3;if(A(t))for(;t>i.length||r-a+1>i.length;)i.push(0);else for(var o=Math.abs(r-a)-(i.length-1),s=0;s<o;s++)i.push(0);for(var c=Math.abs(r-a),l=1;c>0;)l++,c--;var u=i.slice(l).join(``),d=A(t)&&u.length||u.match(/[1-9]/)?`.`+u:``,f=i.slice(0,l).join(``)+d+`e`+(r>=0?`+`:``)+a.toString();return n.sign+f}function xn(e,t){if(isNaN(e)||!isFinite(e))return String(e);var n=yn(e),r=typeof t==`number`?wn(n,n.exponent+1+t):n,i=r.coefficients,a=r.exponent+1,o=a+(t||0);return i.length<o&&(i=i.concat(Tn(o-i.length))),a<0&&(i=Tn(-a+1).concat(i),a=1),a<i.length&&i.splice(a,0,a===0?`0.`:`.`),r.sign+i.join(``)}function Sn(e,t){if(isNaN(e)||!isFinite(e))return String(e);var n=yn(e),r=t?wn(n,t):n,i=r.coefficients,a=r.exponent;i.length<t&&(i=i.concat(Tn(t-i.length)));var o=i.shift();return r.sign+o+(i.length>0?`.`+i.join(``):``)+`e`+(a>=0?`+`:``)+a}function Cn(e,t,n){if(isNaN(e)||!isFinite(e))return String(e);var r=n&&n.lowerExp!==void 0?n.lowerExp:-3,i=n&&n.upperExp!==void 0?n.upperExp:5,a=yn(e),o=t?wn(a,t):a;if(o.exponent<r||o.exponent>=i)return Sn(e,t);var s=o.coefficients,c=o.exponent;s.length<t&&(s=s.concat(Tn(t-s.length))),s=s.concat(Tn(c-s.length+1+(s.length<t?t-s.length:0))),s=Tn(-c).concat(s);var l=c>0?c:0;return l<s.length-1&&s.splice(l+1,0,`.`),o.sign+s.join(``)}function wn(e,t){for(var n={sign:e.sign,coefficients:e.coefficients,exponent:e.exponent},r=n.coefficients;t<=0;)r.unshift(0),n.exponent++,t++;if(r.length>t&&r.splice(t,r.length-t)[0]>=5){var i=t-1;for(r[i]++;r[i]===10;)r.pop(),i===0&&(r.unshift(0),n.exponent++,i++),i--,r[i]++}return n}function Tn(e){for(var t=[],n=0;n<e;n++)t.push(0);return t}function En(e){return e.toExponential().replace(/e.*$/,``).replace(/^0\.?0*|\./,``).length}var Dn=2**-52||2220446049250313e-31;function On(e,t,n){var r=e.constructor,i=new r(2),a=``;if(n){if(n<1)throw Error(`size must be in greater than 0`);if(!N(n))throw Error(`size must be an integer`);if(e.greaterThan(i.pow(n-1).sub(1))||e.lessThan(i.pow(n-1).mul(-1)))throw Error(`Value must be in range [-2^${n-1}, 2^${n-1}-1]`);if(!e.isInteger())throw Error(`Value must be an integer`);e.lessThan(0)&&(e=e.add(i.pow(n))),a=`i${n}`}switch(t){case 2:return`${e.toBinary()}${a}`;case 8:return`${e.toOctal()}${a}`;case 16:return`${e.toHexadecimal()}${a}`;default:throw Error(`Base ${t} not supported `)}}function kn(e,t){if(typeof t==`function`)return t(e);if(!e.isFinite())return e.isNaN()?`NaN`:e.gt(0)?`Infinity`:`-Infinity`;var n=`auto`,r,i;if(t!==void 0&&(t.notation&&(n=t.notation),typeof t==`number`?r=t:t.precision!==void 0&&(r=t.precision),t.wordSize&&(i=t.wordSize,typeof i!=`number`)))throw Error(`Option "wordSize" must be a number`);switch(n){case`fixed`:return Mn(e,r);case`exponential`:return jn(e,r);case`engineering`:return An(e,r);case`bin`:return On(e,2,i);case`oct`:return On(e,8,i);case`hex`:return On(e,16,i);case`auto`:var a=t&&t.lowerExp!==void 0?t.lowerExp:-3,o=t&&t.upperExp!==void 0?t.upperExp:5;if(e.isZero())return`0`;var s,c=e.toSignificantDigits(r),l=c.e;return s=l>=a&&l<o?c.toFixed():jn(e,r),s.replace(/((\.\d*?)(0+))($|e)/,function(){var e=arguments[2],t=arguments[4];return e===`.`?t:e+t});default:throw Error(`Unknown notation "`+n+`". Choose "auto", "exponential", "fixed", "bin", "oct", or "hex.`)}}function An(e,t){var n=e.e,r=n%3==0?n:n<0?n-3-n%3:n-n%3,i=e.mul(10**-r).toPrecision(t);if(i.indexOf(`e`)!==-1){var a=e.constructor;i=new a(i).toFixed()}return i+`e`+(n>=0?`+`:``)+r.toString()}function jn(e,t){return t===void 0?e.toExponential():e.toExponential(t-1)}function Mn(e,t){return e.toFixed(t)}function Nn(e,t){var n=Pn(e,t);return t&&typeof t==`object`&&`truncate`in t&&n.length>t.truncate?n.substring(0,t.truncate-3)+`...`:n}function Pn(e,t){return typeof e==`number`?vn(e,t):j(e)?kn(e,t):Rn(e)?!t||t.fraction!==`decimal`?e.s*e.n+`/`+e.d:e.toString():Array.isArray(e)?Ln(e,t):Et(e)?Fn(e):typeof e==`function`?e.syntax?String(e.syntax):`function`:e&&typeof e==`object`?typeof e.format==`function`?e.format(t):e&&e.toString(t)!=={}.toString()?e.toString(t):`{`+Object.keys(e).map(n=>Fn(n)+`: `+Nn(e[n],t)).join(`, `)+`}`:String(e)}function Fn(e){for(var t=String(e),n=``,r=0;r<t.length;){var i=t.charAt(r);n+=i in In?In[i]:i,r++}return`"`+n+`"`}var In={'"':`\\"`,"\\":`\\\\`,"\b":`\\b`,"\f":`\\f`,"\n":`\\n`,"\r":`\\r`," ":`\\t`};function Ln(e,t){if(Array.isArray(e)){for(var n=`[`,r=e.length,i=0;i<r;i++)i!==0&&(n+=`, `),n+=Ln(e[i],t);return n+=`]`,n}else return Nn(e,t)}function Rn(e){return e&&typeof e==`object`&&typeof e.s==`number`&&typeof e.n==`number`&&typeof e.d==`number`||!1}function P(e,t,n){if(!(this instanceof P))throw SyntaxError(`Constructor must be called with the new operator`);this.actual=e,this.expected=t,this.relation=n,this.message=`Dimension mismatch (`+(Array.isArray(e)?`[`+e.join(`, `)+`]`:e)+` `+(this.relation||`!=`)+` `+(Array.isArray(t)?`[`+t.join(`, `)+`]`:t)+`)`,this.stack=Error().stack}P.prototype=RangeError(),P.prototype.constructor=RangeError,P.prototype.name=`DimensionError`,P.prototype.isDimensionError=!0;function zn(e,t,n){if(!(this instanceof zn))throw SyntaxError(`Constructor must be called with the new operator`);this.index=e,arguments.length<3?(this.min=0,this.max=t):(this.min=t,this.max=n),this.min!==void 0&&this.index<this.min?this.message=`Index out of range (`+this.index+` < `+this.min+`)`:this.max!==void 0&&this.index>=this.max?this.message=`Index out of range (`+this.index+` > `+(this.max-1)+`)`:this.message=`Index out of range (`+this.index+`)`,this.stack=Error().stack}zn.prototype=RangeError(),zn.prototype.constructor=RangeError,zn.prototype.name=`IndexError`,zn.prototype.isIndexError=!0;function Bn(e){for(var t=[];Array.isArray(e);)t.push(e.length),e=e[0];return t}function Vn(e,t,n){var r,i=e.length;if(i!==t[n])throw new P(i,t[n]);if(n<t.length-1){var a=n+1;for(r=0;r<i;r++){var o=e[r];if(!Array.isArray(o))throw new P(t.length-1,t.length,`<`);Vn(e[r],t,a)}}else for(r=0;r<i;r++)if(Array.isArray(e[r]))throw new P(t.length+1,t.length,`>`)}function Hn(e,t){if(t.length===0){if(Array.isArray(e))throw new P(e.length,0)}else Vn(e,t,0)}function F(e,t){if(e!==void 0){if(!A(e)||!N(e))throw TypeError(`Index must be an integer (value: `+e+`)`);if(e<0||typeof t==`number`&&e>=t)throw new zn(e,t)}}function Un(e,t,n){if(!Array.isArray(t))throw TypeError(`Array expected`);if(t.length===0)throw Error(`Resizing to scalar is not supported`);return t.forEach(function(e){if(!A(e)||!N(e)||e<0)throw TypeError(`Invalid size, must contain positive integers (size: `+Nn(t)+`)`)}),(A(e)||j(e))&&(e=[e]),Wn(e,t,0,n===void 0?0:n),e}function Wn(e,t,n,r){var i,a,o=e.length,s=t[n],c=Math.min(o,s);if(e.length=s,n<t.length-1){var l=n+1;for(i=0;i<c;i++)a=e[i],Array.isArray(a)||(a=[a],e[i]=a),Wn(a,t,l,r);for(i=c;i<s;i++)a=[],e[i]=a,Wn(a,t,l,r)}else{for(i=0;i<c;i++)for(;Array.isArray(e[i]);)e[i]=e[i][0];for(i=c;i<s;i++)e[i]=r}}function Gn(e,t){var n=Zn(e),r=n.length;if(!Array.isArray(e)||!Array.isArray(t))throw TypeError(`Array expected`);if(t.length===0)throw new P(0,r,`!=`);t=Kn(t,r);var i=qn(t);if(r!==i)throw new P(i,r,`!=`);try{return Jn(n,t)}catch(e){throw e instanceof P?new P(i,r,`!=`):e}}function Kn(e,t){var n=qn(e),r=e.slice(),i=-1,a=e.indexOf(i);if(e.indexOf(i,a+1)>=0)throw Error(`More than one wildcard in sizes`);var o=a>=0,s=t%n===0;if(o)if(s)r[a]=-t/n;else throw Error(`Could not replace wildcard, since `+t+` is no multiple of `+-n);return r}function qn(e){return e.reduce((e,t)=>e*t,1)}function Jn(e,t){for(var n=e,r,i=t.length-1;i>0;i--){var a=t[i];r=[];for(var o=n.length/a,s=0;s<o;s++)r.push(n.slice(s*a,(s+1)*a));n=r}return n}function Yn(e,t,n,r){var i=r||Bn(e);if(n)for(var a=0;a<n;a++)e=[e],i.unshift(1);for(e=Xn(e,t,0);i.length<t;)i.push(1);return e}function Xn(e,t,n){var r,i;if(Array.isArray(e)){var a=n+1;for(r=0,i=e.length;r<i;r++)e[r]=Xn(e[r],t,a)}else for(var o=n;o<t;o++)e=[e];return e}function Zn(e){if(!Array.isArray(e))return e;var t=[];return e.forEach(function e(n){Array.isArray(n)?n.forEach(e):t.push(n)}),t}function Qn(e,t){for(var n,r=0,i=0;i<e.length;i++){var a=e[i],o=Array.isArray(a);if(i===0&&o&&(r=a.length),o&&a.length!==r)return;var s=o?Qn(a,t):t(a);if(n===void 0)n=s;else if(n!==s)return`mixed`}return n}function $n(e,t,n,r){if(r<n){if(e.length!==t.length)throw new P(e.length,t.length);for(var i=[],a=0;a<e.length;a++)i[a]=$n(e[a],t[a],n,r+1);return i}else return e.concat(t)}function er(){var e=Array.prototype.slice.call(arguments,0,-1),t=Array.prototype.slice.call(arguments,-1);if(e.length===1)return e[0];if(e.length>1)return e.slice(1).reduce(function(e,n){return $n(e,n,t,0)},e[0]);throw Error(`Wrong number of arguments in function concat`)}function tr(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];for(var r=t.map(e=>e.length),i=Math.max(...r),a=Array(i).fill(null),o=0;o<t.length;o++)for(var s=t[o],c=r[o],l=0;l<c;l++){var u=i-c+l;s[l]>a[u]&&(a[u]=s[l])}for(var d=0;d<t.length;d++)nr(t[d],a);return a}function nr(e,t){for(var n=t.length,r=e.length,i=0;i<r;i++){var a=n-r+i;if(e[i]<t[a]&&e[i]>1||e[i]>t[a])throw Error(`shape missmatch: missmatch is found in arg with shape (${e}) not possible to broadcast dimension ${r} with size ${e[i]} to size ${t[a]}`)}}function rr(e,t){var n=Bn(e);if(ln(n,t))return e;nr(n,t);var r=tr(n,t),i=r.length,a=[...Array(i-n.length).fill(1),...n],o=ar(e);n.length<i&&(o=Gn(o,a),n=Bn(o));for(var s=0;s<i;s++)n[s]<r[s]&&(o=ir(o,r[s],s),n=Bn(o));return o}function ir(e,t,n){return er(...Array(t).fill(e),n)}function ar(e){return(0,mn.default)([],e)}function or(e,t,n,r){function i(r){var i=dn(r,t.map(lr));return sr(e,t,r),n(i)}return i.isFactory=!0,i.fn=e,i.dependencies=t.slice().sort(),r&&(i.meta=r),i}function sr(e,t,n){if(!t.filter(e=>!cr(e)).every(e=>n[e]!==void 0)){var r=t.filter(e=>n[e]===void 0);throw Error(`Cannot create function "${e}", some dependencies are missing: ${r.map(e=>`"${e}"`).join(`, `)}.`)}}function cr(e){return e&&e[0]===`?`}function lr(e){return e&&e[0]===`?`?e.slice(1):e}function ur(e,t){if(hr(e)&&pr(e,t))return e[t];throw typeof e[t]==`function`&&mr(e,t)?Error(`Cannot access method "`+t+`" as a property`):Error(`No access to property "`+t+`"`)}function dr(e,t,n){if(hr(e)&&pr(e,t))return e[t]=n,n;throw Error(`No access to property "`+t+`"`)}function fr(e,t){return t in e}function pr(e,t){return!e||typeof e!=`object`?!1:un(gr,t)?!0:!(t in Object.prototype||t in Function.prototype)}function mr(e,t){return e==null||typeof e[t]!=`function`||un(e,t)&&Object.getPrototypeOf&&t in Object.getPrototypeOf(e)?!1:un(_r,t)?!0:!(t in Object.prototype||t in Function.prototype)}function hr(e){return typeof e==`object`&&e&&e.constructor===Object}var gr={length:!0,name:!0},_r={toString:!0,valueOf:!0,toLocaleString:!0},vr=class{constructor(e){this.wrappedObject=e}keys(){return Object.keys(this.wrappedObject)}get(e){return ur(this.wrappedObject,e)}set(e,t){return dr(this.wrappedObject,e,t),this}has(e){return fr(this.wrappedObject,e)}};function yr(e){return e?e instanceof Map||e instanceof vr||typeof e.set==`function`&&typeof e.get==`function`&&typeof e.keys==`function`&&typeof e.has==`function`:!1}var br=c(gn(),1),xr=function(){return xr=br.default.create,br.default},Sr=[`?BigNumber`,`?Complex`,`?DenseMatrix`,`?Fraction`],Cr=or(`typed`,Sr,function(e){var{BigNumber:t,Complex:n,DenseMatrix:r,Fraction:i}=e,a=xr();return a.clear(),a.addTypes([{name:`number`,test:A},{name:`Complex`,test:Ct},{name:`BigNumber`,test:j},{name:`Fraction`,test:wt},{name:`Unit`,test:Tt},{name:`identifier`,test:e=>Et&&/^(?:[A-Za-z\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u0870-\u0887\u0889-\u088E\u08A0-\u08C9\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C5D\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16F1-\u16F8\u1700-\u1711\u171F-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1878\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4C\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BF\u31F0-\u31FF\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA7CA\uA7D0\uA7D1\uA7D3\uA7D5-\uA7D9\uA7F2-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF2D-\uDF40\uDF42-\uDF49\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDD70-\uDD7A\uDD7C-\uDD8A\uDD8C-\uDD92\uDD94\uDD95\uDD97-\uDDA1\uDDA3-\uDDB1\uDDB3-\uDDB9\uDDBB\uDDBC\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67\uDF80-\uDF85\uDF87-\uDFB0\uDFB2-\uDFBA]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE35\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2\uDD00-\uDD23\uDE80-\uDEA9\uDEB0\uDEB1\uDF00-\uDF1C\uDF27\uDF30-\uDF45\uDF70-\uDF81\uDFB0-\uDFC4\uDFE0-\uDFF6]|\uD804[\uDC03-\uDC37\uDC71\uDC72\uDC75\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD44\uDD47\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE3F\uDE40\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC5F-\uDC61\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDEB8\uDF00-\uDF1A\uDF40-\uDF46]|\uD806[\uDC00-\uDC2B\uDCA0-\uDCDF\uDCFF-\uDD06\uDD09\uDD0C-\uDD13\uDD15\uDD16\uDD18-\uDD2F\uDD3F\uDD41\uDDA0-\uDDA7\uDDAA-\uDDD0\uDDE1\uDDE3\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE89\uDE9D\uDEB0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD89\uDD98\uDEE0-\uDEF2\uDF02\uDF04-\uDF10\uDF12-\uDF33\uDFB0]|\uD808[\uDC00-\uDF99]|\uD809[\uDC80-\uDD43]|\uD80B[\uDF90-\uDFF0]|[\uD80C\uD81C-\uD820\uD822\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879\uD880-\uD883\uD885-\uD887][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2F\uDC41-\uDC46]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE70-\uDEBE\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDE40-\uDE7F\uDF00-\uDF4A\uDF50\uDF93-\uDF9F\uDFE0\uDFE1\uDFE3]|\uD821[\uDC00-\uDFF7]|\uD823[\uDC00-\uDCD5\uDD00-\uDD08]|\uD82B[\uDFF0-\uDFF3\uDFF5-\uDFFB\uDFFD\uDFFE]|\uD82C[\uDC00-\uDD22\uDD32\uDD50-\uDD52\uDD55\uDD64-\uDD67\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD837[\uDF00-\uDF1E\uDF25-\uDF2A]|\uD838[\uDC30-\uDC6D\uDD00-\uDD2C\uDD37-\uDD3D\uDD4E\uDE90-\uDEAD\uDEC0-\uDEEB]|\uD839[\uDCD0-\uDCEB\uDFE0-\uDFE6\uDFE8-\uDFEB\uDFED\uDFEE\uDFF0-\uDFFE]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43\uDD4B]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDEDF\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF39\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A\uDF50-\uDFFF]|\uD888[\uDC00-\uDFAF])(?:[0-9A-Za-z\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u0870-\u0887\u0889-\u088E\u08A0-\u08C9\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C5D\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16F1-\u16F8\u1700-\u1711\u171F-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1878\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4C\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BF\u31F0-\u31FF\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA7CA\uA7D0\uA7D1\uA7D3\uA7D5-\uA7D9\uA7F2-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF2D-\uDF40\uDF42-\uDF49\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDD70-\uDD7A\uDD7C-\uDD8A\uDD8C-\uDD92\uDD94\uDD95\uDD97-\uDDA1\uDDA3-\uDDB1\uDDB3-\uDDB9\uDDBB\uDDBC\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67\uDF80-\uDF85\uDF87-\uDFB0\uDFB2-\uDFBA]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE35\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2\uDD00-\uDD23\uDE80-\uDEA9\uDEB0\uDEB1\uDF00-\uDF1C\uDF27\uDF30-\uDF45\uDF70-\uDF81\uDFB0-\uDFC4\uDFE0-\uDFF6]|\uD804[\uDC03-\uDC37\uDC71\uDC72\uDC75\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD44\uDD47\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE3F\uDE40\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC5F-\uDC61\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDEB8\uDF00-\uDF1A\uDF40-\uDF46]|\uD806[\uDC00-\uDC2B\uDCA0-\uDCDF\uDCFF-\uDD06\uDD09\uDD0C-\uDD13\uDD15\uDD16\uDD18-\uDD2F\uDD3F\uDD41\uDDA0-\uDDA7\uDDAA-\uDDD0\uDDE1\uDDE3\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE89\uDE9D\uDEB0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD89\uDD98\uDEE0-\uDEF2\uDF02\uDF04-\uDF10\uDF12-\uDF33\uDFB0]|\uD808[\uDC00-\uDF99]|\uD809[\uDC80-\uDD43]|\uD80B[\uDF90-\uDFF0]|[\uD80C\uD81C-\uD820\uD822\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879\uD880-\uD883\uD885-\uD887][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2F\uDC41-\uDC46]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE70-\uDEBE\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDE40-\uDE7F\uDF00-\uDF4A\uDF50\uDF93-\uDF9F\uDFE0\uDFE1\uDFE3]|\uD821[\uDC00-\uDFF7]|\uD823[\uDC00-\uDCD5\uDD00-\uDD08]|\uD82B[\uDFF0-\uDFF3\uDFF5-\uDFFB\uDFFD\uDFFE]|\uD82C[\uDC00-\uDD22\uDD32\uDD50-\uDD52\uDD55\uDD64-\uDD67\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD837[\uDF00-\uDF1E\uDF25-\uDF2A]|\uD838[\uDC30-\uDC6D\uDD00-\uDD2C\uDD37-\uDD3D\uDD4E\uDE90-\uDEAD\uDEC0-\uDEEB]|\uD839[\uDCD0-\uDCEB\uDFE0-\uDFE6\uDFE8-\uDFEB\uDFED\uDFEE\uDFF0-\uDFFE]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43\uDD4B]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDEDF\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF39\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A\uDF50-\uDFFF]|\uD888[\uDC00-\uDFAF])*$/.test(e)},{name:`string`,test:Et},{name:`Chain`,test:an},{name:`Array`,test:M},{name:`Matrix`,test:Dt},{name:`DenseMatrix`,test:kt},{name:`SparseMatrix`,test:At},{name:`Range`,test:jt},{name:`Index`,test:Mt},{name:`boolean`,test:Nt},{name:`ResultSet`,test:Pt},{name:`Help`,test:Ft},{name:`function`,test:It},{name:`Date`,test:Lt},{name:`RegExp`,test:Rt},{name:`null`,test:Bt},{name:`undefined`,test:Vt},{name:`AccessorNode`,test:Ht},{name:`ArrayNode`,test:Ut},{name:`AssignmentNode`,test:Wt},{name:`BlockNode`,test:Gt},{name:`ConditionalNode`,test:Kt},{name:`ConstantNode`,test:qt},{name:`FunctionNode`,test:Yt},{name:`FunctionAssignmentNode`,test:Jt},{name:`IndexNode`,test:Xt},{name:`Node`,test:Zt},{name:`ObjectNode`,test:Qt},{name:`OperatorNode`,test:$t},{name:`ParenthesisNode`,test:en},{name:`RangeNode`,test:tn},{name:`RelationalNode`,test:nn},{name:`SymbolNode`,test:rn},{name:`Map`,test:yr},{name:`Object`,test:zt}]),a.addConversions([{from:`number`,to:`BigNumber`,convert:function(e){if(t||wr(e),En(e)>15)throw TypeError(`Cannot implicitly convert a number with >15 significant digits to BigNumber (value: `+e+`). Use function bignumber(x) to convert to BigNumber.`);return new t(e)}},{from:`number`,to:`Complex`,convert:function(e){return n||Tr(e),new n(e,0)}},{from:`BigNumber`,to:`Complex`,convert:function(e){return n||Tr(e),new n(e.toNumber(),0)}},{from:`Fraction`,to:`BigNumber`,convert:function(e){throw TypeError(`Cannot implicitly convert a Fraction to BigNumber or vice versa. Use function bignumber(x) to convert to BigNumber or fraction(x) to convert to Fraction.`)}},{from:`Fraction`,to:`Complex`,convert:function(e){return n||Tr(e),new n(e.valueOf(),0)}},{from:`number`,to:`Fraction`,convert:function(e){i||Dr(e);var t=new i(e);if(t.valueOf()!==e)throw TypeError(`Cannot implicitly convert a number to a Fraction when there will be a loss of precision (value: `+e+`). Use function fraction(x) to convert to Fraction.`);return t}},{from:`string`,to:`number`,convert:function(e){var t=Number(e);if(isNaN(t))throw Error(`Cannot convert "`+e+`" to a number`);return t}},{from:`string`,to:`BigNumber`,convert:function(e){t||wr(e);try{return new t(e)}catch{throw Error(`Cannot convert "`+e+`" to BigNumber`)}}},{from:`string`,to:`Fraction`,convert:function(e){i||Dr(e);try{return new i(e)}catch{throw Error(`Cannot convert "`+e+`" to Fraction`)}}},{from:`string`,to:`Complex`,convert:function(e){n||Tr(e);try{return new n(e)}catch{throw Error(`Cannot convert "`+e+`" to Complex`)}}},{from:`boolean`,to:`number`,convert:function(e){return+e}},{from:`boolean`,to:`BigNumber`,convert:function(e){return t||wr(e),new t(+e)}},{from:`boolean`,to:`Fraction`,convert:function(e){return i||Dr(e),new i(+e)}},{from:`boolean`,to:`string`,convert:function(e){return String(e)}},{from:`Array`,to:`Matrix`,convert:function(e){return r||Er(),new r(e)}},{from:`Matrix`,to:`Array`,convert:function(e){return e.valueOf()}}]),a.onMismatch=(e,t,n)=>{var r=a.createError(e,t,n);if([`wrongType`,`mismatch`].includes(r.data.category)&&t.length===1&&Ot(t[0])&&n.some(e=>!e.params.includes(`,`))){var i=TypeError(`Function '${e}' doesn't apply to matrices. To call it elementwise on a matrix 'M', try 'map(M, ${e})'.`);throw i.data=r.data,i}throw r},a.onMismatch=(e,t,n)=>{var r=a.createError(e,t,n);if([`wrongType`,`mismatch`].includes(r.data.category)&&t.length===1&&Ot(t[0])&&n.some(e=>!e.params.includes(`,`))){var i=TypeError(`Function '${e}' doesn't apply to matrices. To call it elementwise on a matrix 'M', try 'map(M, ${e})'.`);throw i.data=r.data,i}throw r},a});function wr(e){throw Error(`Cannot convert value ${e} into a BigNumber: no class 'BigNumber' provided`)}function Tr(e){throw Error(`Cannot convert value ${e} into a Complex number: no class 'Complex' provided`)}function Er(){throw Error(`Cannot convert array into a Matrix: no class 'DenseMatrix' provided`)}function Dr(e){throw Error(`Cannot convert value ${e} into a Fraction, no class 'Fraction' provided.`)}
|
|
108
|
+
`);return Object.freeze(St)};(0,mn.default)(hn,St,{MATRIX_OPTIONS:fn,NUMBER_OPTIONS:pn});var gn=o(((e,t)=>{(function(n,r){typeof e==`object`&&t!==void 0?t.exports=r():typeof define==`function`&&define.amd?define(r):(n=typeof globalThis<`u`?globalThis:n||self,n.typed=r())})(e,(function(){"use strict";function e(){return!0}function t(){return!1}function n(){}let r=`Argument is not a typed-function.`;function i(){function a(e){return typeof e==`object`&&!!e&&e.constructor===Object}let o=[{name:`number`,test:function(e){return typeof e==`number`}},{name:`string`,test:function(e){return typeof e==`string`}},{name:`boolean`,test:function(e){return typeof e==`boolean`}},{name:`Function`,test:function(e){return typeof e==`function`}},{name:`Array`,test:Array.isArray},{name:`Date`,test:function(e){return e instanceof Date}},{name:`RegExp`,test:function(e){return e instanceof RegExp}},{name:`Object`,test:a},{name:`null`,test:function(e){return e===null}},{name:`undefined`,test:function(e){return e===void 0}}],s={name:`any`,test:e,isAny:!0},c,l,u=0,d={createCount:0};function f(e){let t=c.get(e);if(t)return t;let n=`Unknown type "`+e+`"`,r=e.toLowerCase(),i;for(i of l)if(i.toLowerCase()===r){n+=`. Did you mean "`+i+`" ?`;break}throw TypeError(n)}function p(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:`any`,n=t?f(t).index:l.length,r=[];for(let t=0;t<e.length;++t){if(!e[t]||typeof e[t].name!=`string`||typeof e[t].test!=`function`)throw TypeError(`Object with properties {name: string, test: function} expected`);let i=e[t].name;if(c.has(i))throw TypeError(`Duplicate type name "`+i+`"`);r.push(i),c.set(i,{name:i,test:e[t].test,isAny:e[t].isAny,index:n+t,conversionsTo:[]})}let i=l.slice(n);l=l.slice(0,n).concat(r).concat(i);for(let e=n+r.length;e<l.length;++e)c.get(l[e]).index=e}function m(){c=new Map,l=[],u=0,p([s],!1)}m(),p(o);function h(){let e;for(e of l)c.get(e).conversionsTo=[];u=0}function g(e){let t=l.filter(t=>{let n=c.get(t);return!n.isAny&&n.test(e)});return t.length?t:[`any`]}function _(e){return e&&typeof e==`function`&&`_typedFunctionData`in e}function v(e,t,n){if(!_(e))throw TypeError(r);let i=n&&n.exact,a=ne(Array.isArray(t)?t.join(`,`):t),o=x(a);if(!i||o in e.signatures){let t=e._typedFunctionData.signatureMap.get(o);if(t)return t}let s=a.length,c;if(i){c=[];let t;for(t in e.signatures)c.push(e._typedFunctionData.signatureMap.get(t))}else c=e._typedFunctionData.signatures;for(let e=0;e<s;++e){let t=a[e],n=[],r;for(r of c){let i=ie(r.params,e);if(!(!i||t.restParam&&!i.restParam)){if(!i.hasAny){let e=te(i);if(t.types.some(t=>!e.has(t.name)))continue}n.push(r)}}if(c=n,c.length===0)break}let l;for(l of c)if(l.params.length<=s)return l;throw TypeError(`Signature not found (signature: `+(e.name||`unnamed`)+`(`+x(a,`, `)+`))`)}function y(e,t,n){return v(e,t,n).implementation}function b(e,t){let n=f(t);if(n.test(e))return e;let r=n.conversionsTo;if(r.length===0)throw Error(`There are no conversions to `+t+` defined.`);for(let t=0;t<r.length;t++)if(f(r[t].from).test(e))return r[t].convert(e);throw Error(`Cannot convert `+e+` to `+t)}function x(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:`,`;return e.map(e=>e.name).join(t)}function S(e){let t=e.indexOf(`...`)===0,n=(t?e.length>3?e.slice(3):`any`:e).split(`|`).map(e=>f(e.trim())),r=!1,i=t?`...`:``;return{types:n.map(function(e){return r=e.isAny||r,i+=e.name+`|`,{name:e.name,typeIndex:e.index,test:e.test,isAny:e.isAny,conversion:null,conversionIndex:-1}}),name:i.slice(0,-1),hasAny:r,hasConversion:!1,restParam:t}}function ee(e){let t=de(e.types.map(e=>e.name)),n=e.hasAny,r=e.name,i=t.map(function(e){let t=f(e.from);return n=t.isAny||n,r+=`|`+e.from,{name:e.from,typeIndex:t.index,test:t.test,isAny:t.isAny,conversion:e,conversionIndex:e.index}});return{types:e.types.concat(i),name:r,hasAny:n,hasConversion:i.length>0,restParam:e.restParam}}function te(e){return e.typeSet||(e.typeSet=new Set,e.types.forEach(t=>e.typeSet.add(t.name))),e.typeSet}function ne(e){let t=[];if(typeof e!=`string`)throw TypeError(`Signatures must be strings`);let n=e.trim();if(n===``)return t;let r=n.split(`,`);for(let e=0;e<r.length;++e){let n=S(r[e].trim());if(n.restParam&&e!==r.length-1)throw SyntaxError(`Unexpected rest parameter "`+r[e]+`": only allowed for the last parameter`);if(n.types.length===0)return null;t.push(n)}return t}function C(e){let t=Se(e);return t?t.restParam:!1}function w(t){if(!t||t.types.length===0)return e;if(t.types.length===1)return f(t.types[0].name).test;if(t.types.length===2){let e=f(t.types[0].name).test,n=f(t.types[1].name).test;return function(t){return e(t)||n(t)}}else{let e=t.types.map(function(e){return f(e.name).test});return function(t){for(let n=0;n<e.length;n++)if(e[n](t))return!0;return!1}}}function re(e){let t,n,r;if(C(e)){t=xe(e).map(w);let n=t.length,r=w(Se(e)),i=function(e){for(let t=n;t<e.length;t++)if(!r(e[t]))return!1;return!0};return function(e){for(let n=0;n<t.length;n++)if(!t[n](e[n]))return!1;return i(e)&&e.length>=n+1}}else if(e.length===0)return function(e){return e.length===0};else if(e.length===1)return n=w(e[0]),function(e){return n(e[0])&&e.length===1};else if(e.length===2)return n=w(e[0]),r=w(e[1]),function(e){return n(e[0])&&r(e[1])&&e.length===2};else return t=e.map(w),function(e){for(let n=0;n<t.length;n++)if(!t[n](e[n]))return!1;return e.length===t.length}}function ie(e,t){return t<e.length?e[t]:C(e)?Se(e):null}function ae(e,t){let n=ie(e,t);return n?te(n):new Set}function T(e){return e.conversion===null||e.conversion===void 0}function E(e,t){let n=new Set;return e.forEach(e=>{let r=ae(e.params,t),i;for(i of r)n.add(i)}),n.has(`any`)?[`any`]:Array.from(n)}function oe(e,t,n){let r,i,a=e||`unnamed`,o=n,s;for(s=0;s<t.length;s++){let e=[];if(o.forEach(n=>{let r=w(ie(n.params,s));(s<n.params.length||C(n.params))&&r(t[s])&&e.push(n)}),e.length===0){if(i=E(o,s),i.length>0){let e=g(t[s]);return r=TypeError(`Unexpected type of argument in function `+a+` (expected: `+i.join(` or `)+`, actual: `+e.join(` | `)+`, index: `+s+`)`),r.data={category:`wrongType`,fn:a,index:s,actual:e,expected:i},r}}else o=e}let c=o.map(function(e){return C(e.params)?1/0:e.params.length});if(t.length<Math.min.apply(null,c))return i=E(o,s),r=TypeError(`Too few arguments in function `+a+` (expected: `+i.join(` or `)+`, index: `+t.length+`)`),r.data={category:`tooFewArgs`,fn:a,index:t.length,expected:i},r;let l=Math.max.apply(null,c);if(t.length>l)return r=TypeError(`Too many arguments in function `+a+` (expected: `+l+`, actual: `+t.length+`)`),r.data={category:`tooManyArgs`,fn:a,index:t.length,expectedLength:l},r;let u=[];for(let e=0;e<t.length;++e)u.push(g(t[e]).join(`|`));return r=TypeError(`Arguments of type "`+u.join(`, `)+`" do not match any of the defined signatures of function `+a+`.`),r.data={category:`mismatch`,actual:u},r}function se(e){let t=l.length+1;for(let n=0;n<e.types.length;n++)t=Math.min(t,e.types[n].typeIndex);return t}function ce(e){let t=u+1;for(let n=0;n<e.types.length;n++)T(e.types[n])||(t=Math.min(t,e.types[n].conversionIndex));return t}function le(e,t){if(e.hasAny){if(!t.hasAny)return .1}else if(t.hasAny)return-.1;if(e.restParam){if(!t.restParam)return .01}else if(t.restParam)return-.01;let n=se(e)-se(t);if(n<0)return-.001;if(n>0)return .001;let r=ce(e),i=ce(t);if(e.hasConversion){if(!t.hasConversion)return(1+r)*1e-6}else if(t.hasConversion)return-(1+i)*1e-6;let a=r-i;return a<0?-1e-7:a>0?1e-7:0}function ue(e,t){let n=e.params,r=t.params,i=Se(n),a=Se(r),o=C(n),s=C(r);if(o&&i.hasAny){if(!s||!a.hasAny)return 1e7}else if(s&&a.hasAny)return-1e7;let c=0,l=0,u;for(u of n)u.hasAny&&++c,u.hasConversion&&++l;let d=0,f=0;for(u of r)u.hasAny&&++d,u.hasConversion&&++f;if(c!==d)return(c-d)*1e6;if(o&&i.hasConversion){if(!s||!a.hasConversion)return 1e5}else if(s&&a.hasConversion)return-1e5;if(l!==f)return(l-f)*1e4;if(o){if(!s)return 1e3}else if(s)return-1e3;let p=(n.length-r.length)*(o?-100:100);if(p!==0)return p;let m=[],h=0;for(let e=0;e<n.length;++e){let t=le(n[e],r[e]);m.push(t),h+=t}if(h!==0)return(h<0?-10:10)+h;let g,_=9,v=_/(m.length+1);for(g of m){if(g!==0)return(g<0?-_:_)+g;_-=v}return 0}function de(e){if(e.length===0)return[];let t=e.map(f);if(e.length===1)return t[0].conversionsTo;let n=new Set(e),r=new Set;for(let e=0;e<t.length;++e)for(let i of t[e].conversionsTo)n.has(i.from)||r.add(i.from);let i=[];for(let e of r){let n=u+1,r=null;for(let i=0;i<t.length;++i)for(let a of t[i].conversionsTo)a.from===e&&a.index<n&&(n=a.index,r=a);i.push(r)}return i}function D(e,t){let n=t,r=``;if(e.some(e=>e.hasConversion)){let i=C(e),a=e.map(fe);r=a.map(e=>e.name).join(`;`),n=function(){let e=[],n=i?arguments.length-1:arguments.length;for(let t=0;t<n;t++)e[t]=a[t](arguments[t]);return i&&(e[n]=arguments[n].map(a[n])),t.apply(this,e)}}let i=n;if(C(e)){let t=e.length-1;i=function(){return n.apply(this,Ce(arguments,0,t).concat([Ce(arguments,t)]))}}return r&&Object.defineProperty(i,`name`,{value:r}),i}function fe(e){let t,n,r,i,a=[],o=[],s=``;e.types.forEach(function(e){e.conversion&&(s+=e.conversion.from+`~>`+e.conversion.to+`,`,a.push(f(e.conversion.from).test),o.push(e.conversion.convert))}),s=s?s.slice(0,-1):`pass`;let c=e=>e;switch(o.length){case 0:break;case 1:t=a[0],r=o[0],c=function(e){return t(e)?r(e):e};break;case 2:t=a[0],n=a[1],r=o[0],i=o[1],c=function(e){return t(e)?r(e):n(e)?i(e):e};break;default:c=function(e){for(let t=0;t<o.length;t++)if(a[t](e))return o[t](e);return e}}return Object.defineProperty(c,`name`,{value:s}),c}function pe(e){function t(e,n,r){if(n<e.length){let i=e[n],a=[];if(i.restParam){let e=i.types.filter(T);e.length<i.types.length&&a.push({types:e,name:`...`+e.map(e=>e.name).join(`|`),hasAny:e.some(e=>e.isAny),hasConversion:!1,restParam:!0}),a.push(i)}else a=i.types.map(function(e){return{types:[e],name:e.name,hasAny:e.isAny,hasConversion:e.conversion,restParam:!1}});return Te(a,function(i){return t(e,n+1,r.concat([i]))})}else return[r]}return t(e,0,[])}function me(e,t){let n=Math.max(e.length,t.length);for(let r=0;r<n;r++){let n=ae(e,r),i=ae(t,r),a=!1,o;for(o of i)if(n.has(o)){a=!0;break}if(!a)return!1}let r=e.length,i=t.length,a=C(e),o=C(t);return a?o?r===i:i>=r:o?r>=i:r===i}function he(e){return e.map(e=>Oe(e)?k(e.referToSelf.callback):De(e)?O(e.referTo.references,e.referTo.callback):e)}function ge(e,t,n){let r=[],i;for(i of e){let e=n[i];if(typeof e!=`number`)throw TypeError(`No definition for referenced signature "`+i+`"`);if(e=t[e],typeof e!=`function`)return!1;r.push(e)}return r}function _e(e,t,n){let r=he(e),i=Array(r.length).fill(!1),a=!0;for(;a;){a=!1;let e=!0;for(let o=0;o<r.length;++o){if(i[o])continue;let s=r[o];if(Oe(s))r[o]=s.referToSelf.callback(n),r[o].referToSelf=s.referToSelf,i[o]=!0,e=!1;else if(De(s)){let n=ge(s.referTo.references,r,t);n?(r[o]=s.referTo.callback.apply(this,n),r[o].referTo=s.referTo,i[o]=!0,e=!1):a=!0}}if(e&&a)throw SyntaxError(`Circular reference detected in resolving typed.referTo`)}return r}function ve(e){let t=/\bthis(\(|\.signatures\b)/;Object.keys(e).forEach(n=>{let r=e[n];if(t.test(r.toString()))throw SyntaxError("Using `this` to self-reference a function is deprecated since typed-function@3. Use typed.referTo and typed.referToSelf instead.")})}function ye(e,r){if(d.createCount++,Object.keys(r).length===0)throw SyntaxError(`No signatures provided`);d.warnAgainstDeprecatedThis&&ve(r);let i=[],a=[],o={},s=[],c;for(c in r){if(!Object.prototype.hasOwnProperty.call(r,c))continue;let e=ne(c);if(!e)continue;i.forEach(function(t){if(me(t,e))throw TypeError(`Conflicting signatures "`+x(t)+`" and "`+x(e)+`".`)}),i.push(e);let t=a.length;a.push(r[c]);let n=e.map(ee),l;for(l of pe(n)){let e=x(l);s.push({params:l,name:e,fn:t}),l.every(e=>!e.hasConversion)&&(o[e]=t)}}s.sort(ue);let l=_e(a,o,Me),u;for(u in o)Object.prototype.hasOwnProperty.call(o,u)&&(o[u]=l[o[u]]);let f=[],p=new Map;for(u of s)p.has(u.name)||(u.fn=l[u.fn],f.push(u),p.set(u.name,u));let m=f[0]&&f[0].params.length<=2&&!C(f[0].params),h=f[1]&&f[1].params.length<=2&&!C(f[1].params),g=f[2]&&f[2].params.length<=2&&!C(f[2].params),_=f[3]&&f[3].params.length<=2&&!C(f[3].params),v=f[4]&&f[4].params.length<=2&&!C(f[4].params),y=f[5]&&f[5].params.length<=2&&!C(f[5].params),b=m&&h&&g&&_&&v&&y;for(let e=0;e<f.length;++e)f[e].test=re(f[e].params);let S=m?w(f[0].params[0]):t,te=h?w(f[1].params[0]):t,ie=g?w(f[2].params[0]):t,ae=_?w(f[3].params[0]):t,T=v?w(f[4].params[0]):t,E=y?w(f[5].params[0]):t,oe=m?w(f[0].params[1]):t,se=h?w(f[1].params[1]):t,ce=g?w(f[2].params[1]):t,le=_?w(f[3].params[1]):t,de=v?w(f[4].params[1]):t,fe=y?w(f[5].params[1]):t;for(let e=0;e<f.length;++e)f[e].implementation=D(f[e].params,f[e].fn);let he=m?f[0].implementation:n,ge=h?f[1].implementation:n,ye=g?f[2].implementation:n,be=_?f[3].implementation:n,xe=v?f[4].implementation:n,Se=y?f[5].implementation:n,Ce=m?f[0].params.length:-1,we=h?f[1].params.length:-1,Te=g?f[2].params.length:-1,Ee=_?f[3].params.length:-1,O=v?f[4].params.length:-1,k=y?f[5].params.length:-1,De=b?6:0,Oe=f.length,ke=f.map(e=>e.test),Ae=f.map(e=>e.implementation),je=function(){for(let e=De;e<Oe;e++)if(ke[e](arguments))return Ae[e].apply(this,arguments);return d.onMismatch(e,arguments,f)};function Me(e,t){return arguments.length===Ce&&S(e)&&oe(t)?he.apply(this,arguments):arguments.length===we&&te(e)&&se(t)?ge.apply(this,arguments):arguments.length===Te&&ie(e)&&ce(t)?ye.apply(this,arguments):arguments.length===Ee&&ae(e)&&le(t)?be.apply(this,arguments):arguments.length===O&&T(e)&&de(t)?xe.apply(this,arguments):arguments.length===k&&E(e)&&fe(t)?Se.apply(this,arguments):je.apply(this,arguments)}try{Object.defineProperty(Me,`name`,{value:e})}catch{}return Me.signatures=o,Me._typedFunctionData={signatures:f,signatureMap:p},Me}function be(e,t,n){throw oe(e,t,n)}function xe(e){return Ce(e,0,e.length-1)}function Se(e){return e[e.length-1]}function Ce(e,t,n){return Array.prototype.slice.call(e,t,n)}function we(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return e[n]}function Te(e,t){return Array.prototype.concat.apply([],e.map(t))}function Ee(){let e=xe(arguments).map(e=>x(ne(e))),t=Se(arguments);if(typeof t!=`function`)throw TypeError(`Callback function expected as last argument`);return O(e,t)}function O(e,t){return{referTo:{references:e,callback:t}}}function k(e){if(typeof e!=`function`)throw TypeError(`Callback function expected as first argument`);return{referToSelf:{callback:e}}}function De(e){return e&&typeof e.referTo==`object`&&Array.isArray(e.referTo.references)&&typeof e.referTo.callback==`function`}function Oe(e){return e&&typeof e.referToSelf==`object`&&typeof e.referToSelf.callback==`function`}function ke(e,t){if(!e)return t;if(t&&t!==e){let n=Error(`Function names do not match (expected: `+e+`, actual: `+t+`)`);throw n.data={actual:t,expected:e},n}return e}function Ae(e){let t;for(let n in e)Object.prototype.hasOwnProperty.call(e,n)&&(_(e[n])||typeof e[n].signature==`string`)&&(t=ke(t,e[n].name));return t}function je(e,t){let n;for(n in t)if(Object.prototype.hasOwnProperty.call(t,n)){if(n in e&&t[n]!==e[n]){let r=Error(`Signature "`+n+`" is defined twice`);throw r.data={signature:n,sourceFunction:t[n],destFunction:e[n]},r}e[n]=t[n]}}let Me=d;d=function(e){let t=typeof e==`string`,n=t?1:0,r=t?e:``,i={};for(let e=n;e<arguments.length;++e){let n=arguments[e],o={},s;if(typeof n==`function`?(s=n.name,typeof n.signature==`string`?o[n.signature]=n:_(n)&&(o=n.signatures)):a(n)&&(o=n,t||(s=Ae(n))),Object.keys(o).length===0){let t=TypeError(`Argument to 'typed' at index `+e+` is not a (typed) function, nor an object with signatures as keys and functions as values.`);throw t.data={index:e,argument:n},t}t||(r=ke(r,s)),je(i,o)}return ye(r||``,i)},d.create=i,d.createCount=Me.createCount,d.onMismatch=be,d.throwMismatchError=be,d.createError=oe,d.clear=m,d.clearConversions=h,d.addTypes=p,d._findType=f,d.referTo=Ee,d.referToSelf=k,d.convert=b,d.findSignature=v,d.find=y,d.isTypedFunction=_,d.warnAgainstDeprecatedThis=!0,d.addType=function(e,t){let n=`any`;t!==!1&&c.has(`Object`)&&(n=`Object`),d.addTypes([e],n)};function Ne(e){if(!e||typeof e.from!=`string`||typeof e.to!=`string`||typeof e.convert!=`function`)throw TypeError(`Object with properties {from: string, to: string, convert: function} expected`);if(e.to===e.from)throw SyntaxError(`Illegal to define conversion from "`+e.from+`" to itself.`)}return d.addConversion=function(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{override:!1};Ne(e);let n=f(e.to),r=n.conversionsTo.find(t=>t.from===e.from);if(r)if(t&&t.override)d.removeConversion({from:r.from,to:e.to,convert:r.convert});else throw Error(`There is already a conversion from "`+e.from+`" to "`+n.name+`"`);n.conversionsTo.push({from:e.from,to:n.name,convert:e.convert,index:u++})},d.addConversions=function(e,t){e.forEach(e=>d.addConversion(e,t))},d.removeConversion=function(e){Ne(e);let t=f(e.to),n=we(t.conversionsTo,t=>t.from===e.from);if(!n)throw Error(`Attempt to remove nonexistent conversion from `+e.from+` to `+e.to);if(n.convert!==e.convert)throw Error(`Conversion to remove does not match existing conversion`);let r=t.conversionsTo.indexOf(n);t.conversionsTo.splice(r,1)},d.resolve=function(e,t){if(!_(e))throw TypeError(r);let n=e._typedFunctionData.signatures;for(let e=0;e<n.length;++e)if(n[e].test(t))return n[e];return null},d}return i()}))}));function N(e){return typeof e==`boolean`?!0:isFinite(e)?e===Math.round(e):!1}function _n(e,t,n){var r={2:`0b`,8:`0o`,16:`0x`}[t],i=``;if(n){if(n<1)throw Error(`size must be in greater than 0`);if(!N(n))throw Error(`size must be an integer`);if(e>2**(n-1)-1||e<-(2**(n-1)))throw Error(`Value must be in range [-2^${n-1}, 2^${n-1}-1]`);if(!N(e))throw Error(`Value must be an integer`);e<0&&(e+=2**n),i=`i${n}`}var a=``;return e<0&&(e=-e,a=`-`),`${a}${r}${e.toString(t)}${i}`}function vn(e,t){if(typeof t==`function`)return t(e);if(e===1/0)return`Infinity`;if(e===-1/0)return`-Infinity`;if(isNaN(e))return`NaN`;var n=`auto`,r,i;if(t&&(t.notation&&(n=t.notation),A(t)?r=t:A(t.precision)&&(r=t.precision),t.wordSize&&(i=t.wordSize,typeof i!=`number`)))throw Error(`Option "wordSize" must be a number`);switch(n){case`fixed`:return xn(e,r);case`exponential`:return Sn(e,r);case`engineering`:return bn(e,r);case`bin`:return _n(e,2,i);case`oct`:return _n(e,8,i);case`hex`:return _n(e,16,i);case`auto`:return Cn(e,r,t&&t).replace(/((\.\d*?)(0+))($|e)/,function(){var e=arguments[2],t=arguments[4];return e===`.`?t:e+t});default:throw Error(`Unknown notation "`+n+`". Choose "auto", "exponential", "fixed", "bin", "oct", or "hex.`)}}function yn(e){var t=String(e).toLowerCase().match(/^(-?)(\d+\.?\d*)(e([+-]?\d+))?$/);if(!t)throw SyntaxError(`Invalid number `+e);var n=t[1],r=t[2],i=parseFloat(t[4]||`0`),a=r.indexOf(`.`);i+=a===-1?r.length-1:a-1;var o=r.replace(`.`,``).replace(/^0*/,function(e){return i-=e.length,``}).replace(/0*$/,``).split(``).map(function(e){return parseInt(e)});return o.length===0&&(o.push(0),i++),{sign:n,coefficients:o,exponent:i}}function bn(e,t){if(isNaN(e)||!isFinite(e))return String(e);var n=wn(yn(e),t),r=n.exponent,i=n.coefficients,a=r%3==0?r:r<0?r-3-r%3:r-r%3;if(A(t))for(;t>i.length||r-a+1>i.length;)i.push(0);else for(var o=Math.abs(r-a)-(i.length-1),s=0;s<o;s++)i.push(0);for(var c=Math.abs(r-a),l=1;c>0;)l++,c--;var u=i.slice(l).join(``),d=A(t)&&u.length||u.match(/[1-9]/)?`.`+u:``,f=i.slice(0,l).join(``)+d+`e`+(r>=0?`+`:``)+a.toString();return n.sign+f}function xn(e,t){if(isNaN(e)||!isFinite(e))return String(e);var n=yn(e),r=typeof t==`number`?wn(n,n.exponent+1+t):n,i=r.coefficients,a=r.exponent+1,o=a+(t||0);return i.length<o&&(i=i.concat(Tn(o-i.length))),a<0&&(i=Tn(-a+1).concat(i),a=1),a<i.length&&i.splice(a,0,a===0?`0.`:`.`),r.sign+i.join(``)}function Sn(e,t){if(isNaN(e)||!isFinite(e))return String(e);var n=yn(e),r=t?wn(n,t):n,i=r.coefficients,a=r.exponent;i.length<t&&(i=i.concat(Tn(t-i.length)));var o=i.shift();return r.sign+o+(i.length>0?`.`+i.join(``):``)+`e`+(a>=0?`+`:``)+a}function Cn(e,t,n){if(isNaN(e)||!isFinite(e))return String(e);var r=n&&n.lowerExp!==void 0?n.lowerExp:-3,i=n&&n.upperExp!==void 0?n.upperExp:5,a=yn(e),o=t?wn(a,t):a;if(o.exponent<r||o.exponent>=i)return Sn(e,t);var s=o.coefficients,c=o.exponent;s.length<t&&(s=s.concat(Tn(t-s.length))),s=s.concat(Tn(c-s.length+1+(s.length<t?t-s.length:0))),s=Tn(-c).concat(s);var l=c>0?c:0;return l<s.length-1&&s.splice(l+1,0,`.`),o.sign+s.join(``)}function wn(e,t){for(var n={sign:e.sign,coefficients:e.coefficients,exponent:e.exponent},r=n.coefficients;t<=0;)r.unshift(0),n.exponent++,t++;if(r.length>t&&r.splice(t,r.length-t)[0]>=5){var i=t-1;for(r[i]++;r[i]===10;)r.pop(),i===0&&(r.unshift(0),n.exponent++,i++),i--,r[i]++}return n}function Tn(e){for(var t=[],n=0;n<e;n++)t.push(0);return t}function En(e){return e.toExponential().replace(/e.*$/,``).replace(/^0\.?0*|\./,``).length}var Dn=2**-52||2220446049250313e-31;function On(e,t,n){var r=e.constructor,i=new r(2),a=``;if(n){if(n<1)throw Error(`size must be in greater than 0`);if(!N(n))throw Error(`size must be an integer`);if(e.greaterThan(i.pow(n-1).sub(1))||e.lessThan(i.pow(n-1).mul(-1)))throw Error(`Value must be in range [-2^${n-1}, 2^${n-1}-1]`);if(!e.isInteger())throw Error(`Value must be an integer`);e.lessThan(0)&&(e=e.add(i.pow(n))),a=`i${n}`}switch(t){case 2:return`${e.toBinary()}${a}`;case 8:return`${e.toOctal()}${a}`;case 16:return`${e.toHexadecimal()}${a}`;default:throw Error(`Base ${t} not supported `)}}function kn(e,t){if(typeof t==`function`)return t(e);if(!e.isFinite())return e.isNaN()?`NaN`:e.gt(0)?`Infinity`:`-Infinity`;var n=`auto`,r,i;if(t!==void 0&&(t.notation&&(n=t.notation),typeof t==`number`?r=t:t.precision!==void 0&&(r=t.precision),t.wordSize&&(i=t.wordSize,typeof i!=`number`)))throw Error(`Option "wordSize" must be a number`);switch(n){case`fixed`:return Mn(e,r);case`exponential`:return jn(e,r);case`engineering`:return An(e,r);case`bin`:return On(e,2,i);case`oct`:return On(e,8,i);case`hex`:return On(e,16,i);case`auto`:var a=t&&t.lowerExp!==void 0?t.lowerExp:-3,o=t&&t.upperExp!==void 0?t.upperExp:5;if(e.isZero())return`0`;var s,c=e.toSignificantDigits(r),l=c.e;return s=l>=a&&l<o?c.toFixed():jn(e,r),s.replace(/((\.\d*?)(0+))($|e)/,function(){var e=arguments[2],t=arguments[4];return e===`.`?t:e+t});default:throw Error(`Unknown notation "`+n+`". Choose "auto", "exponential", "fixed", "bin", "oct", or "hex.`)}}function An(e,t){var n=e.e,r=n%3==0?n:n<0?n-3-n%3:n-n%3,i=e.mul(10**-r).toPrecision(t);if(i.indexOf(`e`)!==-1){var a=e.constructor;i=new a(i).toFixed()}return i+`e`+(n>=0?`+`:``)+r.toString()}function jn(e,t){return t===void 0?e.toExponential():e.toExponential(t-1)}function Mn(e,t){return e.toFixed(t)}function Nn(e,t){var n=Pn(e,t);return t&&typeof t==`object`&&`truncate`in t&&n.length>t.truncate?n.substring(0,t.truncate-3)+`...`:n}function Pn(e,t){return typeof e==`number`?vn(e,t):j(e)?kn(e,t):Rn(e)?!t||t.fraction!==`decimal`?e.s*e.n+`/`+e.d:e.toString():Array.isArray(e)?Ln(e,t):Et(e)?Fn(e):typeof e==`function`?e.syntax?String(e.syntax):`function`:e&&typeof e==`object`?typeof e.format==`function`?e.format(t):e&&e.toString(t)!=={}.toString()?e.toString(t):`{`+Object.keys(e).map(n=>Fn(n)+`: `+Nn(e[n],t)).join(`, `)+`}`:String(e)}function Fn(e){for(var t=String(e),n=``,r=0;r<t.length;){var i=t.charAt(r);n+=i in In?In[i]:i,r++}return`"`+n+`"`}var In={'"':`\\"`,"\\":`\\\\`,"\b":`\\b`,"\f":`\\f`,"\n":`\\n`,"\r":`\\r`," ":`\\t`};function Ln(e,t){if(Array.isArray(e)){for(var n=`[`,r=e.length,i=0;i<r;i++)i!==0&&(n+=`, `),n+=Ln(e[i],t);return n+=`]`,n}else return Nn(e,t)}function Rn(e){return e&&typeof e==`object`&&typeof e.s==`number`&&typeof e.n==`number`&&typeof e.d==`number`||!1}function P(e,t,n){if(!(this instanceof P))throw SyntaxError(`Constructor must be called with the new operator`);this.actual=e,this.expected=t,this.relation=n,this.message=`Dimension mismatch (`+(Array.isArray(e)?`[`+e.join(`, `)+`]`:e)+` `+(this.relation||`!=`)+` `+(Array.isArray(t)?`[`+t.join(`, `)+`]`:t)+`)`,this.stack=Error().stack}P.prototype=RangeError(),P.prototype.constructor=RangeError,P.prototype.name=`DimensionError`,P.prototype.isDimensionError=!0;function zn(e,t,n){if(!(this instanceof zn))throw SyntaxError(`Constructor must be called with the new operator`);this.index=e,arguments.length<3?(this.min=0,this.max=t):(this.min=t,this.max=n),this.min!==void 0&&this.index<this.min?this.message=`Index out of range (`+this.index+` < `+this.min+`)`:this.max!==void 0&&this.index>=this.max?this.message=`Index out of range (`+this.index+` > `+(this.max-1)+`)`:this.message=`Index out of range (`+this.index+`)`,this.stack=Error().stack}zn.prototype=RangeError(),zn.prototype.constructor=RangeError,zn.prototype.name=`IndexError`,zn.prototype.isIndexError=!0;function Bn(e){for(var t=[];Array.isArray(e);)t.push(e.length),e=e[0];return t}function Vn(e,t,n){var r,i=e.length;if(i!==t[n])throw new P(i,t[n]);if(n<t.length-1){var a=n+1;for(r=0;r<i;r++){var o=e[r];if(!Array.isArray(o))throw new P(t.length-1,t.length,`<`);Vn(e[r],t,a)}}else for(r=0;r<i;r++)if(Array.isArray(e[r]))throw new P(t.length+1,t.length,`>`)}function Hn(e,t){if(t.length===0){if(Array.isArray(e))throw new P(e.length,0)}else Vn(e,t,0)}function F(e,t){if(e!==void 0){if(!A(e)||!N(e))throw TypeError(`Index must be an integer (value: `+e+`)`);if(e<0||typeof t==`number`&&e>=t)throw new zn(e,t)}}function Un(e,t,n){if(!Array.isArray(t))throw TypeError(`Array expected`);if(t.length===0)throw Error(`Resizing to scalar is not supported`);return t.forEach(function(e){if(!A(e)||!N(e)||e<0)throw TypeError(`Invalid size, must contain positive integers (size: `+Nn(t)+`)`)}),(A(e)||j(e))&&(e=[e]),Wn(e,t,0,n===void 0?0:n),e}function Wn(e,t,n,r){var i,a,o=e.length,s=t[n],c=Math.min(o,s);if(e.length=s,n<t.length-1){var l=n+1;for(i=0;i<c;i++)a=e[i],Array.isArray(a)||(a=[a],e[i]=a),Wn(a,t,l,r);for(i=c;i<s;i++)a=[],e[i]=a,Wn(a,t,l,r)}else{for(i=0;i<c;i++)for(;Array.isArray(e[i]);)e[i]=e[i][0];for(i=c;i<s;i++)e[i]=r}}function Gn(e,t){var n=Zn(e),r=n.length;if(!Array.isArray(e)||!Array.isArray(t))throw TypeError(`Array expected`);if(t.length===0)throw new P(0,r,`!=`);t=Kn(t,r);var i=qn(t);if(r!==i)throw new P(i,r,`!=`);try{return Jn(n,t)}catch(e){throw e instanceof P?new P(i,r,`!=`):e}}function Kn(e,t){var n=qn(e),r=e.slice(),i=-1,a=e.indexOf(i);if(e.indexOf(i,a+1)>=0)throw Error(`More than one wildcard in sizes`);var o=a>=0,s=t%n===0;if(o)if(s)r[a]=-t/n;else throw Error(`Could not replace wildcard, since `+t+` is no multiple of `+-n);return r}function qn(e){return e.reduce((e,t)=>e*t,1)}function Jn(e,t){for(var n=e,r,i=t.length-1;i>0;i--){var a=t[i];r=[];for(var o=n.length/a,s=0;s<o;s++)r.push(n.slice(s*a,(s+1)*a));n=r}return n}function Yn(e,t,n,r){var i=r||Bn(e);if(n)for(var a=0;a<n;a++)e=[e],i.unshift(1);for(e=Xn(e,t,0);i.length<t;)i.push(1);return e}function Xn(e,t,n){var r,i;if(Array.isArray(e)){var a=n+1;for(r=0,i=e.length;r<i;r++)e[r]=Xn(e[r],t,a)}else for(var o=n;o<t;o++)e=[e];return e}function Zn(e){if(!Array.isArray(e))return e;var t=[];return e.forEach(function e(n){Array.isArray(n)?n.forEach(e):t.push(n)}),t}function Qn(e,t){for(var n,r=0,i=0;i<e.length;i++){var a=e[i],o=Array.isArray(a);if(i===0&&o&&(r=a.length),o&&a.length!==r)return;var s=o?Qn(a,t):t(a);if(n===void 0)n=s;else if(n!==s)return`mixed`}return n}function $n(e,t,n,r){if(r<n){if(e.length!==t.length)throw new P(e.length,t.length);for(var i=[],a=0;a<e.length;a++)i[a]=$n(e[a],t[a],n,r+1);return i}else return e.concat(t)}function er(){var e=Array.prototype.slice.call(arguments,0,-1),t=Array.prototype.slice.call(arguments,-1);if(e.length===1)return e[0];if(e.length>1)return e.slice(1).reduce(function(e,n){return $n(e,n,t,0)},e[0]);throw Error(`Wrong number of arguments in function concat`)}function tr(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];for(var r=t.map(e=>e.length),i=Math.max(...r),a=Array(i).fill(null),o=0;o<t.length;o++)for(var s=t[o],c=r[o],l=0;l<c;l++){var u=i-c+l;s[l]>a[u]&&(a[u]=s[l])}for(var d=0;d<t.length;d++)nr(t[d],a);return a}function nr(e,t){for(var n=t.length,r=e.length,i=0;i<r;i++){var a=n-r+i;if(e[i]<t[a]&&e[i]>1||e[i]>t[a])throw Error(`shape missmatch: missmatch is found in arg with shape (${e}) not possible to broadcast dimension ${r} with size ${e[i]} to size ${t[a]}`)}}function rr(e,t){var n=Bn(e);if(ln(n,t))return e;nr(n,t);var r=tr(n,t),i=r.length,a=[...Array(i-n.length).fill(1),...n],o=ar(e);n.length<i&&(o=Gn(o,a),n=Bn(o));for(var s=0;s<i;s++)n[s]<r[s]&&(o=ir(o,r[s],s),n=Bn(o));return o}function ir(e,t,n){return er(...Array(t).fill(e),n)}function ar(e){return(0,mn.default)([],e)}function or(e,t,n,r){function i(r){var i=dn(r,t.map(lr));return sr(e,t,r),n(i)}return i.isFactory=!0,i.fn=e,i.dependencies=t.slice().sort(),r&&(i.meta=r),i}function sr(e,t,n){if(!t.filter(e=>!cr(e)).every(e=>n[e]!==void 0)){var r=t.filter(e=>n[e]===void 0);throw Error(`Cannot create function "${e}", some dependencies are missing: ${r.map(e=>`"${e}"`).join(`, `)}.`)}}function cr(e){return e&&e[0]===`?`}function lr(e){return e&&e[0]===`?`?e.slice(1):e}function ur(e,t){if(hr(e)&&pr(e,t))return e[t];throw typeof e[t]==`function`&&mr(e,t)?Error(`Cannot access method "`+t+`" as a property`):Error(`No access to property "`+t+`"`)}function dr(e,t,n){if(hr(e)&&pr(e,t))return e[t]=n,n;throw Error(`No access to property "`+t+`"`)}function fr(e,t){return t in e}function pr(e,t){return!e||typeof e!=`object`?!1:un(gr,t)?!0:!(t in Object.prototype||t in Function.prototype)}function mr(e,t){return e==null||typeof e[t]!=`function`||un(e,t)&&Object.getPrototypeOf&&t in Object.getPrototypeOf(e)?!1:un(_r,t)?!0:!(t in Object.prototype||t in Function.prototype)}function hr(e){return typeof e==`object`&&e&&e.constructor===Object}var gr={length:!0,name:!0},_r={toString:!0,valueOf:!0,toLocaleString:!0},vr=class{constructor(e){this.wrappedObject=e}keys(){return Object.keys(this.wrappedObject)}get(e){return ur(this.wrappedObject,e)}set(e,t){return dr(this.wrappedObject,e,t),this}has(e){return fr(this.wrappedObject,e)}};function yr(e){return e?e instanceof Map||e instanceof vr||typeof e.set==`function`&&typeof e.get==`function`&&typeof e.keys==`function`&&typeof e.has==`function`:!1}var br=c(gn(),1),xr=function(){return xr=br.default.create,br.default},Sr=[`?BigNumber`,`?Complex`,`?DenseMatrix`,`?Fraction`],Cr=or(`typed`,Sr,function(e){var{BigNumber:t,Complex:n,DenseMatrix:r,Fraction:i}=e,a=xr();return a.clear(),a.addTypes([{name:`number`,test:A},{name:`Complex`,test:Ct},{name:`BigNumber`,test:j},{name:`Fraction`,test:wt},{name:`Unit`,test:Tt},{name:`identifier`,test:e=>Et&&/^(?:[A-Za-z\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u0870-\u0887\u0889-\u088E\u08A0-\u08C9\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C5D\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16F1-\u16F8\u1700-\u1711\u171F-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1878\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4C\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BF\u31F0-\u31FF\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA7CA\uA7D0\uA7D1\uA7D3\uA7D5-\uA7D9\uA7F2-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF2D-\uDF40\uDF42-\uDF49\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDD70-\uDD7A\uDD7C-\uDD8A\uDD8C-\uDD92\uDD94\uDD95\uDD97-\uDDA1\uDDA3-\uDDB1\uDDB3-\uDDB9\uDDBB\uDDBC\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67\uDF80-\uDF85\uDF87-\uDFB0\uDFB2-\uDFBA]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE35\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2\uDD00-\uDD23\uDE80-\uDEA9\uDEB0\uDEB1\uDF00-\uDF1C\uDF27\uDF30-\uDF45\uDF70-\uDF81\uDFB0-\uDFC4\uDFE0-\uDFF6]|\uD804[\uDC03-\uDC37\uDC71\uDC72\uDC75\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD44\uDD47\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE3F\uDE40\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC5F-\uDC61\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDEB8\uDF00-\uDF1A\uDF40-\uDF46]|\uD806[\uDC00-\uDC2B\uDCA0-\uDCDF\uDCFF-\uDD06\uDD09\uDD0C-\uDD13\uDD15\uDD16\uDD18-\uDD2F\uDD3F\uDD41\uDDA0-\uDDA7\uDDAA-\uDDD0\uDDE1\uDDE3\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE89\uDE9D\uDEB0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD89\uDD98\uDEE0-\uDEF2\uDF02\uDF04-\uDF10\uDF12-\uDF33\uDFB0]|\uD808[\uDC00-\uDF99]|\uD809[\uDC80-\uDD43]|\uD80B[\uDF90-\uDFF0]|[\uD80C\uD81C-\uD820\uD822\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879\uD880-\uD883\uD885-\uD887][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2F\uDC41-\uDC46]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE70-\uDEBE\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDE40-\uDE7F\uDF00-\uDF4A\uDF50\uDF93-\uDF9F\uDFE0\uDFE1\uDFE3]|\uD821[\uDC00-\uDFF7]|\uD823[\uDC00-\uDCD5\uDD00-\uDD08]|\uD82B[\uDFF0-\uDFF3\uDFF5-\uDFFB\uDFFD\uDFFE]|\uD82C[\uDC00-\uDD22\uDD32\uDD50-\uDD52\uDD55\uDD64-\uDD67\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD837[\uDF00-\uDF1E\uDF25-\uDF2A]|\uD838[\uDC30-\uDC6D\uDD00-\uDD2C\uDD37-\uDD3D\uDD4E\uDE90-\uDEAD\uDEC0-\uDEEB]|\uD839[\uDCD0-\uDCEB\uDFE0-\uDFE6\uDFE8-\uDFEB\uDFED\uDFEE\uDFF0-\uDFFE]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43\uDD4B]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDEDF\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF39\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A\uDF50-\uDFFF]|\uD888[\uDC00-\uDFAF])(?:[0-9A-Za-z\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u0870-\u0887\u0889-\u088E\u08A0-\u08C9\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C5D\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16F1-\u16F8\u1700-\u1711\u171F-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1878\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4C\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BF\u31F0-\u31FF\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA7CA\uA7D0\uA7D1\uA7D3\uA7D5-\uA7D9\uA7F2-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF2D-\uDF40\uDF42-\uDF49\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDD70-\uDD7A\uDD7C-\uDD8A\uDD8C-\uDD92\uDD94\uDD95\uDD97-\uDDA1\uDDA3-\uDDB1\uDDB3-\uDDB9\uDDBB\uDDBC\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67\uDF80-\uDF85\uDF87-\uDFB0\uDFB2-\uDFBA]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE35\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2\uDD00-\uDD23\uDE80-\uDEA9\uDEB0\uDEB1\uDF00-\uDF1C\uDF27\uDF30-\uDF45\uDF70-\uDF81\uDFB0-\uDFC4\uDFE0-\uDFF6]|\uD804[\uDC03-\uDC37\uDC71\uDC72\uDC75\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD44\uDD47\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE3F\uDE40\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC5F-\uDC61\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDEB8\uDF00-\uDF1A\uDF40-\uDF46]|\uD806[\uDC00-\uDC2B\uDCA0-\uDCDF\uDCFF-\uDD06\uDD09\uDD0C-\uDD13\uDD15\uDD16\uDD18-\uDD2F\uDD3F\uDD41\uDDA0-\uDDA7\uDDAA-\uDDD0\uDDE1\uDDE3\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE89\uDE9D\uDEB0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD89\uDD98\uDEE0-\uDEF2\uDF02\uDF04-\uDF10\uDF12-\uDF33\uDFB0]|\uD808[\uDC00-\uDF99]|\uD809[\uDC80-\uDD43]|\uD80B[\uDF90-\uDFF0]|[\uD80C\uD81C-\uD820\uD822\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879\uD880-\uD883\uD885-\uD887][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2F\uDC41-\uDC46]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE70-\uDEBE\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDE40-\uDE7F\uDF00-\uDF4A\uDF50\uDF93-\uDF9F\uDFE0\uDFE1\uDFE3]|\uD821[\uDC00-\uDFF7]|\uD823[\uDC00-\uDCD5\uDD00-\uDD08]|\uD82B[\uDFF0-\uDFF3\uDFF5-\uDFFB\uDFFD\uDFFE]|\uD82C[\uDC00-\uDD22\uDD32\uDD50-\uDD52\uDD55\uDD64-\uDD67\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD837[\uDF00-\uDF1E\uDF25-\uDF2A]|\uD838[\uDC30-\uDC6D\uDD00-\uDD2C\uDD37-\uDD3D\uDD4E\uDE90-\uDEAD\uDEC0-\uDEEB]|\uD839[\uDCD0-\uDCEB\uDFE0-\uDFE6\uDFE8-\uDFEB\uDFED\uDFEE\uDFF0-\uDFFE]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43\uDD4B]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDEDF\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF39\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A\uDF50-\uDFFF]|\uD888[\uDC00-\uDFAF])*$/.test(e)},{name:`string`,test:Et},{name:`Chain`,test:an},{name:`Array`,test:M},{name:`Matrix`,test:Dt},{name:`DenseMatrix`,test:kt},{name:`SparseMatrix`,test:At},{name:`Range`,test:jt},{name:`Index`,test:Mt},{name:`boolean`,test:Nt},{name:`ResultSet`,test:Pt},{name:`Help`,test:Ft},{name:`function`,test:It},{name:`Date`,test:Lt},{name:`RegExp`,test:Rt},{name:`null`,test:Bt},{name:`undefined`,test:Vt},{name:`AccessorNode`,test:Ht},{name:`ArrayNode`,test:Ut},{name:`AssignmentNode`,test:Wt},{name:`BlockNode`,test:Gt},{name:`ConditionalNode`,test:Kt},{name:`ConstantNode`,test:qt},{name:`FunctionNode`,test:Yt},{name:`FunctionAssignmentNode`,test:Jt},{name:`IndexNode`,test:Xt},{name:`Node`,test:Zt},{name:`ObjectNode`,test:Qt},{name:`OperatorNode`,test:$t},{name:`ParenthesisNode`,test:en},{name:`RangeNode`,test:tn},{name:`RelationalNode`,test:nn},{name:`SymbolNode`,test:rn},{name:`Map`,test:yr},{name:`Object`,test:zt}]),a.addConversions([{from:`number`,to:`BigNumber`,convert:function(e){if(t||wr(e),En(e)>15)throw TypeError(`Cannot implicitly convert a number with >15 significant digits to BigNumber (value: `+e+`). Use function bignumber(x) to convert to BigNumber.`);return new t(e)}},{from:`number`,to:`Complex`,convert:function(e){return n||Tr(e),new n(e,0)}},{from:`BigNumber`,to:`Complex`,convert:function(e){return n||Tr(e),new n(e.toNumber(),0)}},{from:`Fraction`,to:`BigNumber`,convert:function(e){throw TypeError(`Cannot implicitly convert a Fraction to BigNumber or vice versa. Use function bignumber(x) to convert to BigNumber or fraction(x) to convert to Fraction.`)}},{from:`Fraction`,to:`Complex`,convert:function(e){return n||Tr(e),new n(e.valueOf(),0)}},{from:`number`,to:`Fraction`,convert:function(e){i||Dr(e);var t=new i(e);if(t.valueOf()!==e)throw TypeError(`Cannot implicitly convert a number to a Fraction when there will be a loss of precision (value: `+e+`). Use function fraction(x) to convert to Fraction.`);return t}},{from:`string`,to:`number`,convert:function(e){var t=Number(e);if(isNaN(t))throw Error(`Cannot convert "`+e+`" to a number`);return t}},{from:`string`,to:`BigNumber`,convert:function(e){t||wr(e);try{return new t(e)}catch{throw Error(`Cannot convert "`+e+`" to BigNumber`)}}},{from:`string`,to:`Fraction`,convert:function(e){i||Dr(e);try{return new i(e)}catch{throw Error(`Cannot convert "`+e+`" to Fraction`)}}},{from:`string`,to:`Complex`,convert:function(e){n||Tr(e);try{return new n(e)}catch{throw Error(`Cannot convert "`+e+`" to Complex`)}}},{from:`boolean`,to:`number`,convert:function(e){return+e}},{from:`boolean`,to:`BigNumber`,convert:function(e){return t||wr(e),new t(+e)}},{from:`boolean`,to:`Fraction`,convert:function(e){return i||Dr(e),new i(+e)}},{from:`boolean`,to:`string`,convert:function(e){return String(e)}},{from:`Array`,to:`Matrix`,convert:function(e){return r||Er(),new r(e)}},{from:`Matrix`,to:`Array`,convert:function(e){return e.valueOf()}}]),a.onMismatch=(e,t,n)=>{var r=a.createError(e,t,n);if([`wrongType`,`mismatch`].includes(r.data.category)&&t.length===1&&Ot(t[0])&&n.some(e=>!e.params.includes(`,`))){var i=TypeError(`Function '${e}' doesn't apply to matrices. To call it elementwise on a matrix 'M', try 'map(M, ${e})'.`);throw i.data=r.data,i}throw r},a.onMismatch=(e,t,n)=>{var r=a.createError(e,t,n);if([`wrongType`,`mismatch`].includes(r.data.category)&&t.length===1&&Ot(t[0])&&n.some(e=>!e.params.includes(`,`))){var i=TypeError(`Function '${e}' doesn't apply to matrices. To call it elementwise on a matrix 'M', try 'map(M, ${e})'.`);throw i.data=r.data,i}throw r},a});function wr(e){throw Error(`Cannot convert value ${e} into a BigNumber: no class 'BigNumber' provided`)}function Tr(e){throw Error(`Cannot convert value ${e} into a Complex number: no class 'Complex' provided`)}function Er(){throw Error(`Cannot convert array into a Matrix: no class 'DenseMatrix' provided`)}function Dr(e){throw Error(`Cannot convert value ${e} into a Fraction, no class 'Fraction' provided.`)}
|
|
109
109
|
/*!
|
|
110
110
|
* decimal.js v10.6.0
|
|
111
111
|
* An arbitrary-precision Decimal type for JavaScript.
|
|
@@ -113,8 +113,8 @@ Example:
|
|
|
113
113
|
* Copyright (c) 2025 Michael Mclaughlin <M8ch88l@gmail.com>
|
|
114
114
|
* MIT Licence
|
|
115
115
|
*/
|
|
116
|
-
var Or=9e15,kr=1e9,Ar=`0123456789abcdef`,jr=`2.3025850929940456840179914546843642076011014886287729760333279009675726096773524802359972050895982983419677840422862486334095254650828067566662873690987816894829072083255546808437998948262331985283935053089653777326288461633662222876982198867465436674744042432743651550489343149393914796194044002221051017141748003688084012647080685567743216228355220114804663715659121373450747856947683463616792101806445070648000277502684916746550586856935673420670581136429224554405758925724208241314695689016758940256776311356919292033376587141660230105703089634572075440370847469940168269282808481184289314848524948644871927809676271275775397027668605952496716674183485704422507197965004714951050492214776567636938662976979522110718264549734772662425709429322582798502585509785265383207606726317164309505995087807523710333101197857547331541421808427543863591778117054309827482385045648019095610299291824318237525357709750539565187697510374970888692180205189339507238539205144634197265287286965110862571492198849978748873771345686209167058`,Mr=`3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679821480865132823066470938446095505822317253594081284811174502841027019385211055596446229489549303819644288109756659334461284756482337867831652712019091456485669234603486104543266482133936072602491412737245870066063155881748815209209628292540917153643678925903600113305305488204665213841469519415116094330572703657595919530921861173819326117931051185480744623799627495673518857527248912279381830119491298336733624406566430860213949463952247371907021798609437027705392171762931767523846748184676694051320005681271452635608277857713427577896091736371787214684409012249534301465495853710507922796892589235420199561121290219608640344181598136297747713099605187072113499999983729780499510597317328160963185950244594553469083026425223082533446850352619311881710100031378387528865875332083814206171776691473035982534904287554687311595628638823537875937519577818577805321712268066130019278766111959092164201989380952572010654858632789`,Nr={precision:20,rounding:4,modulo:1,toExpNeg:-7,toExpPos:21,minE:-Or,maxE:Or,crypto:!1},Pr,Fr,I=!0,Ir=`[DecimalError] `,Lr=Ir+`Invalid argument: `,Rr=Ir+`Precision limit exceeded`,zr=Ir+`crypto unavailable`,Br=`[object Decimal]`,L=Math.floor,R=Math.pow,Vr=/^0b([01]+(\.[01]*)?|\.[01]+)(p[+-]?\d+)?$/i,Hr=/^0x([0-9a-f]+(\.[0-9a-f]*)?|\.[0-9a-f]+)(p[+-]?\d+)?$/i,Ur=/^0o([0-7]+(\.[0-7]*)?|\.[0-7]+)(p[+-]?\d+)?$/i,Wr=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,z=1e7,B=7,Gr=9007199254740991,Kr=jr.length-1,qr=Mr.length-1,V={toStringTag:Br};V.absoluteValue=V.abs=function(){var e=new this.constructor(this);return e.s<0&&(e.s=1),G(e)},V.ceil=function(){return G(new this.constructor(this),this.e+1,2)},V.clampedTo=V.clamp=function(e,t){var n,r=this,i=r.constructor;if(e=new i(e),t=new i(t),!e.s||!t.s)return new i(NaN);if(e.gt(t))throw Error(Lr+t);return n=r.cmp(e),n<0?e:r.cmp(t)>0?t:new i(r)},V.comparedTo=V.cmp=function(e){var t,n,r,i,a=this,o=a.d,s=(e=new a.constructor(e)).d,c=a.s,l=e.s;if(!o||!s)return!c||!l?NaN:c===l?o===s?0:!o^c<0?1:-1:c;if(!o[0]||!s[0])return o[0]?c:s[0]?-l:0;if(c!==l)return c;if(a.e!==e.e)return a.e>e.e^c<0?1:-1;for(r=o.length,i=s.length,t=0,n=r<i?r:i;t<n;++t)if(o[t]!==s[t])return o[t]>s[t]^c<0?1:-1;return r===i?0:r>i^c<0?1:-1},V.cosine=V.cos=function(){var e,t,n=this,r=n.constructor;return n.d?n.d[0]?(e=r.precision,t=r.rounding,r.precision=e+Math.max(n.e,n.sd())+B,r.rounding=1,n=Xr(r,fi(r,n)),r.precision=e,r.rounding=t,G(Fr==2||Fr==3?n.neg():n,e,t,!0)):new r(1):new r(NaN)},V.cubeRoot=V.cbrt=function(){var e,t,n,r,i,a,o,s,c,l,u=this,d=u.constructor;if(!u.isFinite()||u.isZero())return new d(u);for(I=!1,a=u.s*R(u.s*u,1/3),!a||Math.abs(a)==1/0?(n=H(u.d),e=u.e,(a=(e-n.length+1)%3)&&(n+=a==1||a==-2?`0`:`00`),a=R(n,1/3),e=L((e+1)/3)-(e%3==(e<0?-1:2)),a==1/0?n=`5e`+e:(n=a.toExponential(),n=n.slice(0,n.indexOf(`e`)+1)+e),r=new d(n),r.s=u.s):r=new d(a.toString()),o=(e=d.precision)+3;;)if(s=r,c=s.times(s).times(s),l=c.plus(u),r=W(l.plus(u).times(s),l.plus(c),o+2,1),H(s.d).slice(0,o)===(n=H(r.d)).slice(0,o))if(n=n.slice(o-3,o+1),n==`9999`||!i&&n==`4999`){if(!i&&(G(s,e+1,0),s.times(s).times(s).eq(u))){r=s;break}o+=4,i=1}else{(!+n||!+n.slice(1)&&n.charAt(0)==`5`)&&(G(r,e+1,1),t=!r.times(r).times(r).eq(u));break}return I=!0,G(r,e,d.rounding,t)},V.decimalPlaces=V.dp=function(){var e,t=this.d,n=NaN;if(t){if(e=t.length-1,n=(e-L(this.e/B))*B,e=t[e],e)for(;e%10==0;e/=10)n--;n<0&&(n=0)}return n},V.dividedBy=V.div=function(e){return W(this,new this.constructor(e))},V.dividedToIntegerBy=V.divToInt=function(e){var t=this,n=t.constructor;return G(W(t,new n(e),0,1,1),n.precision,n.rounding)},V.equals=V.eq=function(e){return this.cmp(e)===0},V.floor=function(){return G(new this.constructor(this),this.e+1,3)},V.greaterThan=V.gt=function(e){return this.cmp(e)>0},V.greaterThanOrEqualTo=V.gte=function(e){var t=this.cmp(e);return t==1||t===0},V.hyperbolicCosine=V.cosh=function(){var e,t,n,r,i,a=this,o=a.constructor,s=new o(1);if(!a.isFinite())return new o(a.s?1/0:NaN);if(a.isZero())return s;n=o.precision,r=o.rounding,o.precision=n+Math.max(a.e,a.sd())+4,o.rounding=1,i=a.d.length,i<32?(e=Math.ceil(i/3),t=(1/di(4,e)).toString()):(e=16,t=`2.3283064365386962890625e-10`),a=ui(o,1,a.times(t),new o(1),!0);for(var c,l=e,u=new o(8);l--;)c=a.times(a),a=s.minus(c.times(u.minus(c.times(u))));return G(a,o.precision=n,o.rounding=r,!0)},V.hyperbolicSine=V.sinh=function(){var e,t,n,r,i=this,a=i.constructor;if(!i.isFinite()||i.isZero())return new a(i);if(t=a.precision,n=a.rounding,a.precision=t+Math.max(i.e,i.sd())+4,a.rounding=1,r=i.d.length,r<3)i=ui(a,2,i,i,!0);else{e=1.4*Math.sqrt(r),e=e>16?16:e|0,i=i.times(1/di(5,e)),i=ui(a,2,i,i,!0);for(var o,s=new a(5),c=new a(16),l=new a(20);e--;)o=i.times(i),i=i.times(s.plus(o.times(c.times(o).plus(l))))}return a.precision=t,a.rounding=n,G(i,t,n,!0)},V.hyperbolicTangent=V.tanh=function(){var e,t,n=this,r=n.constructor;return n.isFinite()?n.isZero()?new r(n):(e=r.precision,t=r.rounding,r.precision=e+7,r.rounding=1,W(n.sinh(),n.cosh(),r.precision=e,r.rounding=t)):new r(n.s)},V.inverseCosine=V.acos=function(){var e=this,t=e.constructor,n=e.abs().cmp(1),r=t.precision,i=t.rounding;return n===-1?e.isZero()?q(t,r+4,i).times(.5):(t.precision=r+6,t.rounding=1,e=new t(1).minus(e).div(e.plus(1)).sqrt().atan(),t.precision=r,t.rounding=i,e.times(2)):n===0?e.isNeg()?q(t,r,i):new t(0):new t(NaN)},V.inverseHyperbolicCosine=V.acosh=function(){var e,t,n=this,r=n.constructor;return n.lte(1)?new r(n.eq(1)?0:NaN):n.isFinite()?(e=r.precision,t=r.rounding,r.precision=e+Math.max(Math.abs(n.e),n.sd())+4,r.rounding=1,I=!1,n=n.times(n).minus(1).sqrt().plus(n),I=!0,r.precision=e,r.rounding=t,n.ln()):new r(n)},V.inverseHyperbolicSine=V.asinh=function(){var e,t,n=this,r=n.constructor;return!n.isFinite()||n.isZero()?new r(n):(e=r.precision,t=r.rounding,r.precision=e+2*Math.max(Math.abs(n.e),n.sd())+6,r.rounding=1,I=!1,n=n.times(n).plus(1).sqrt().plus(n),I=!0,r.precision=e,r.rounding=t,n.ln())},V.inverseHyperbolicTangent=V.atanh=function(){var e,t,n,r,i=this,a=i.constructor;return i.isFinite()?i.e>=0?new a(i.abs().eq(1)?i.s/0:i.isZero()?i:NaN):(e=a.precision,t=a.rounding,r=i.sd(),Math.max(r,e)<2*-i.e-1?G(new a(i),e,t,!0):(a.precision=n=r-i.e,i=W(i.plus(1),new a(1).minus(i),n+e,1),a.precision=e+4,a.rounding=1,i=i.ln(),a.precision=e,a.rounding=t,i.times(.5))):new a(NaN)},V.inverseSine=V.asin=function(){var e,t,n,r,i=this,a=i.constructor;return i.isZero()?new a(i):(t=i.abs().cmp(1),n=a.precision,r=a.rounding,t===-1?(a.precision=n+6,a.rounding=1,i=i.div(new a(1).minus(i.times(i)).sqrt().plus(1)).atan(),a.precision=n,a.rounding=r,i.times(2)):t===0?(e=q(a,n+4,r).times(.5),e.s=i.s,e):new a(NaN))},V.inverseTangent=V.atan=function(){var e,t,n,r,i,a,o,s,c,l=this,u=l.constructor,d=u.precision,f=u.rounding;if(l.isFinite()){if(l.isZero())return new u(l);if(l.abs().eq(1)&&d+4<=qr)return o=q(u,d+4,f).times(.25),o.s=l.s,o}else{if(!l.s)return new u(NaN);if(d+4<=qr)return o=q(u,d+4,f).times(.5),o.s=l.s,o}for(u.precision=s=d+10,u.rounding=1,n=Math.min(28,s/B+2|0),e=n;e;--e)l=l.div(l.times(l).plus(1).sqrt().plus(1));for(I=!1,t=Math.ceil(s/B),r=1,c=l.times(l),o=new u(l),i=l;e!==-1;)if(i=i.times(c),a=o.minus(i.div(r+=2)),i=i.times(c),o=a.plus(i.div(r+=2)),o.d[t]!==void 0)for(e=t;o.d[e]===a.d[e]&&e--;);return n&&(o=o.times(2<<n-1)),I=!0,G(o,u.precision=d,u.rounding=f,!0)},V.isFinite=function(){return!!this.d},V.isInteger=V.isInt=function(){return!!this.d&&L(this.e/B)>this.d.length-2},V.isNaN=function(){return!this.s},V.isNegative=V.isNeg=function(){return this.s<0},V.isPositive=V.isPos=function(){return this.s>0},V.isZero=function(){return!!this.d&&this.d[0]===0},V.lessThan=V.lt=function(e){return this.cmp(e)<0},V.lessThanOrEqualTo=V.lte=function(e){return this.cmp(e)<1},V.logarithm=V.log=function(e){var t,n,r,i,a,o,s,c,l=this,u=l.constructor,d=u.precision,f=u.rounding,p=5;if(e==null)e=new u(10),t=!0;else{if(e=new u(e),n=e.d,e.s<0||!n||!n[0]||e.eq(1))return new u(NaN);t=e.eq(10)}if(n=l.d,l.s<0||!n||!n[0]||l.eq(1))return new u(n&&!n[0]?-1/0:l.s==1?n?0:1/0:NaN);if(t)if(n.length>1)a=!0;else{for(i=n[0];i%10==0;)i/=10;a=i!==1}if(I=!1,s=d+p,o=ai(l,s),r=t?Qr(u,s+10):ai(e,s),c=W(o,r,s,1),Jr(c.d,i=d,f))do if(s+=10,o=ai(l,s),r=t?Qr(u,s+10):ai(e,s),c=W(o,r,s,1),!a){+H(c.d).slice(i+1,i+15)+1==0x5af3107a4000&&(c=G(c,d+1,0));break}while(Jr(c.d,i+=10,f));return I=!0,G(c,d,f)},V.minus=V.sub=function(e){var t,n,r,i,a,o,s,c,l,u,d,f,p=this,m=p.constructor;if(e=new m(e),!p.d||!e.d)return!p.s||!e.s?e=new m(NaN):p.d?e.s=-e.s:e=new m(e.d||p.s!==e.s?p:NaN),e;if(p.s!=e.s)return e.s=-e.s,p.plus(e);if(l=p.d,f=e.d,s=m.precision,c=m.rounding,!l[0]||!f[0]){if(f[0])e.s=-e.s;else if(l[0])e=new m(p);else return new m(c===3?-0:0);return I?G(e,s,c):e}if(n=L(e.e/B),u=L(p.e/B),l=l.slice(),a=u-n,a){for(d=a<0,d?(t=l,a=-a,o=f.length):(t=f,n=u,o=l.length),r=Math.max(Math.ceil(s/B),o)+2,a>r&&(a=r,t.length=1),t.reverse(),r=a;r--;)t.push(0);t.reverse()}else{for(r=l.length,o=f.length,d=r<o,d&&(o=r),r=0;r<o;r++)if(l[r]!=f[r]){d=l[r]<f[r];break}a=0}for(d&&(t=l,l=f,f=t,e.s=-e.s),o=l.length,r=f.length-o;r>0;--r)l[o++]=0;for(r=f.length;r>a;){if(l[--r]<f[r]){for(i=r;i&&l[--i]===0;)l[i]=z-1;--l[i],l[r]+=z}l[r]-=f[r]}for(;l[--o]===0;)l.pop();for(;l[0]===0;l.shift())--n;return l[0]?(e.d=l,e.e=Zr(l,n),I?G(e,s,c):e):new m(c===3?-0:0)},V.modulo=V.mod=function(e){var t,n=this,r=n.constructor;return e=new r(e),!n.d||!e.s||e.d&&!e.d[0]?new r(NaN):!e.d||n.d&&!n.d[0]?G(new r(n),r.precision,r.rounding):(I=!1,r.modulo==9?(t=W(n,e.abs(),0,3,1),t.s*=e.s):t=W(n,e,0,r.modulo,1),t=t.times(e),I=!0,n.minus(t))},V.naturalExponential=V.exp=function(){return ii(this)},V.naturalLogarithm=V.ln=function(){return ai(this)},V.negated=V.neg=function(){var e=new this.constructor(this);return e.s=-e.s,G(e)},V.plus=V.add=function(e){var t,n,r,i,a,o,s,c,l,u,d=this,f=d.constructor;if(e=new f(e),!d.d||!e.d)return!d.s||!e.s?e=new f(NaN):d.d||(e=new f(e.d||d.s===e.s?d:NaN)),e;if(d.s!=e.s)return e.s=-e.s,d.minus(e);if(l=d.d,u=e.d,s=f.precision,c=f.rounding,!l[0]||!u[0])return u[0]||(e=new f(d)),I?G(e,s,c):e;if(a=L(d.e/B),r=L(e.e/B),l=l.slice(),i=a-r,i){for(i<0?(n=l,i=-i,o=u.length):(n=u,r=a,o=l.length),a=Math.ceil(s/B),o=a>o?a+1:o+1,i>o&&(i=o,n.length=1),n.reverse();i--;)n.push(0);n.reverse()}for(o=l.length,i=u.length,o-i<0&&(i=o,n=u,u=l,l=n),t=0;i;)t=(l[--i]=l[i]+u[i]+t)/z|0,l[i]%=z;for(t&&(l.unshift(t),++r),o=l.length;l[--o]==0;)l.pop();return e.d=l,e.e=Zr(l,r),I?G(e,s,c):e},V.precision=V.sd=function(e){var t,n=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(Lr+e);return n.d?(t=$r(n.d),e&&n.e+1>t&&(t=n.e+1)):t=NaN,t},V.round=function(){var e=this,t=e.constructor;return G(new t(e),e.e+1,t.rounding)},V.sine=V.sin=function(){var e,t,n=this,r=n.constructor;return n.isFinite()?n.isZero()?new r(n):(e=r.precision,t=r.rounding,r.precision=e+Math.max(n.e,n.sd())+B,r.rounding=1,n=li(r,fi(r,n)),r.precision=e,r.rounding=t,G(Fr>2?n.neg():n,e,t,!0)):new r(NaN)},V.squareRoot=V.sqrt=function(){var e,t,n,r,i,a,o=this,s=o.d,c=o.e,l=o.s,u=o.constructor;if(l!==1||!s||!s[0])return new u(!l||l<0&&(!s||s[0])?NaN:s?o:1/0);for(I=!1,l=Math.sqrt(+o),l==0||l==1/0?(t=H(s),(t.length+c)%2==0&&(t+=`0`),l=Math.sqrt(t),c=L((c+1)/2)-(c<0||c%2),l==1/0?t=`5e`+c:(t=l.toExponential(),t=t.slice(0,t.indexOf(`e`)+1)+c),r=new u(t)):r=new u(l.toString()),n=(c=u.precision)+3;;)if(a=r,r=a.plus(W(o,a,n+2,1)).times(.5),H(a.d).slice(0,n)===(t=H(r.d)).slice(0,n))if(t=t.slice(n-3,n+1),t==`9999`||!i&&t==`4999`){if(!i&&(G(a,c+1,0),a.times(a).eq(o))){r=a;break}n+=4,i=1}else{(!+t||!+t.slice(1)&&t.charAt(0)==`5`)&&(G(r,c+1,1),e=!r.times(r).eq(o));break}return I=!0,G(r,c,u.rounding,e)},V.tangent=V.tan=function(){var e,t,n=this,r=n.constructor;return n.isFinite()?n.isZero()?new r(n):(e=r.precision,t=r.rounding,r.precision=e+10,r.rounding=1,n=n.sin(),n.s=1,n=W(n,new r(1).minus(n.times(n)).sqrt(),e+10,0),r.precision=e,r.rounding=t,G(Fr==2||Fr==4?n.neg():n,e,t,!0)):new r(NaN)},V.times=V.mul=function(e){var t,n,r,i,a,o,s,c,l,u=this,d=u.constructor,f=u.d,p=(e=new d(e)).d;if(e.s*=u.s,!f||!f[0]||!p||!p[0])return new d(!e.s||f&&!f[0]&&!p||p&&!p[0]&&!f?NaN:!f||!p?e.s/0:e.s*0);for(n=L(u.e/B)+L(e.e/B),c=f.length,l=p.length,c<l&&(a=f,f=p,p=a,o=c,c=l,l=o),a=[],o=c+l,r=o;r--;)a.push(0);for(r=l;--r>=0;){for(t=0,i=c+r;i>r;)s=a[i]+p[r]*f[i-r-1]+t,a[i--]=s%z|0,t=s/z|0;a[i]=(a[i]+t)%z|0}for(;!a[--o];)a.pop();return t?++n:a.shift(),e.d=a,e.e=Zr(a,n),I?G(e,d.precision,d.rounding):e},V.toBinary=function(e,t){return pi(this,2,e,t)},V.toDecimalPlaces=V.toDP=function(e,t){var n=this,r=n.constructor;return n=new r(n),e===void 0?n:(U(e,0,kr),t===void 0?t=r.rounding:U(t,0,8),G(n,e+n.e+1,t))},V.toExponential=function(e,t){var n,r=this,i=r.constructor;return e===void 0?n=K(r,!0):(U(e,0,kr),t===void 0?t=i.rounding:U(t,0,8),r=G(new i(r),e+1,t),n=K(r,!0,e+1)),r.isNeg()&&!r.isZero()?`-`+n:n},V.toFixed=function(e,t){var n,r,i=this,a=i.constructor;return e===void 0?n=K(i):(U(e,0,kr),t===void 0?t=a.rounding:U(t,0,8),r=G(new a(i),e+i.e+1,t),n=K(r,!1,e+r.e+1)),i.isNeg()&&!i.isZero()?`-`+n:n},V.toFraction=function(e){var t,n,r,i,a,o,s,c,l,u,d,f,p=this,m=p.d,h=p.constructor;if(!m)return new h(p);if(l=n=new h(1),r=c=new h(0),t=new h(r),a=t.e=$r(m)-p.e-1,o=a%B,t.d[0]=R(10,o<0?B+o:o),e==null)e=a>0?t:l;else{if(s=new h(e),!s.isInt()||s.lt(l))throw Error(Lr+s);e=s.gt(t)?a>0?t:l:s}for(I=!1,s=new h(H(m)),u=h.precision,h.precision=a=m.length*B*2;d=W(s,t,0,1,1),i=n.plus(d.times(r)),i.cmp(e)!=1;)n=r,r=i,i=l,l=c.plus(d.times(i)),c=i,i=t,t=s.minus(d.times(i)),s=i;return i=W(e.minus(n),r,0,1,1),c=c.plus(i.times(l)),n=n.plus(i.times(r)),c.s=l.s=p.s,f=W(l,r,a,1).minus(p).abs().cmp(W(c,n,a,1).minus(p).abs())<1?[l,r]:[c,n],h.precision=u,I=!0,f},V.toHexadecimal=V.toHex=function(e,t){return pi(this,16,e,t)},V.toNearest=function(e,t){var n=this,r=n.constructor;if(n=new r(n),e==null){if(!n.d)return n;e=new r(1),t=r.rounding}else{if(e=new r(e),t===void 0?t=r.rounding:U(t,0,8),!n.d)return e.s?n:e;if(!e.d)return e.s&&=n.s,e}return e.d[0]?(I=!1,n=W(n,e,0,t,1).times(e),I=!0,G(n)):(e.s=n.s,n=e),n},V.toNumber=function(){return+this},V.toOctal=function(e,t){return pi(this,8,e,t)},V.toPower=V.pow=function(e){var t,n,r,i,a,o,s=this,c=s.constructor,l=+(e=new c(e));if(!s.d||!e.d||!s.d[0]||!e.d[0])return new c(R(+s,l));if(s=new c(s),s.eq(1))return s;if(r=c.precision,a=c.rounding,e.eq(1))return G(s,r,a);if(t=L(e.e/B),t>=e.d.length-1&&(n=l<0?-l:l)<=Gr)return i=ti(c,s,n,r),e.s<0?new c(1).div(i):G(i,r,a);if(o=s.s,o<0){if(t<e.d.length-1)return new c(NaN);if(e.d[t]&1||(o=1),s.e==0&&s.d[0]==1&&s.d.length==1)return s.s=o,s}return n=R(+s,l),t=n==0||!isFinite(n)?L(l*(Math.log(`0.`+H(s.d))/Math.LN10+s.e+1)):new c(n+``).e,t>c.maxE+1||t<c.minE-1?new c(t>0?o/0:0):(I=!1,c.rounding=s.s=1,n=Math.min(12,(t+``).length),i=ii(e.times(ai(s,r+n)),r),i.d&&(i=G(i,r+5,1),Jr(i.d,r,a)&&(t=r+10,i=G(ii(e.times(ai(s,t+n)),t),t+5,1),+H(i.d).slice(r+1,r+15)+1==0x5af3107a4000&&(i=G(i,r+1,0)))),i.s=o,I=!0,c.rounding=a,G(i,r,a))},V.toPrecision=function(e,t){var n,r=this,i=r.constructor;return e===void 0?n=K(r,r.e<=i.toExpNeg||r.e>=i.toExpPos):(U(e,1,kr),t===void 0?t=i.rounding:U(t,0,8),r=G(new i(r),e,t),n=K(r,e<=r.e||r.e<=i.toExpNeg,e)),r.isNeg()&&!r.isZero()?`-`+n:n},V.toSignificantDigits=V.toSD=function(e,t){var n=this,r=n.constructor;return e===void 0?(e=r.precision,t=r.rounding):(U(e,1,kr),t===void 0?t=r.rounding:U(t,0,8)),G(new r(n),e,t)},V.toString=function(){var e=this,t=e.constructor,n=K(e,e.e<=t.toExpNeg||e.e>=t.toExpPos);return e.isNeg()&&!e.isZero()?`-`+n:n},V.truncated=V.trunc=function(){return G(new this.constructor(this),this.e+1,1)},V.valueOf=V.toJSON=function(){var e=this,t=e.constructor,n=K(e,e.e<=t.toExpNeg||e.e>=t.toExpPos);return e.isNeg()?`-`+n:n};function H(e){var t,n,r,i=e.length-1,a=``,o=e[0];if(i>0){for(a+=o,t=1;t<i;t++)r=e[t]+``,n=B-r.length,n&&(a+=ei(n)),a+=r;o=e[t],r=o+``,n=B-r.length,n&&(a+=ei(n))}else if(o===0)return`0`;for(;o%10==0;)o/=10;return a+o}function U(e,t,n){if(e!==~~e||e<t||e>n)throw Error(Lr+e)}function Jr(e,t,n,r){var i,a,o,s;for(a=e[0];a>=10;a/=10)--t;return--t<0?(t+=B,i=0):(i=Math.ceil((t+1)/B),t%=B),a=R(10,B-t),s=e[i]%a|0,r==null?t<3?(t==0?s=s/100|0:t==1&&(s=s/10|0),o=n<4&&s==99999||n>3&&s==49999||s==5e4||s==0):o=(n<4&&s+1==a||n>3&&s+1==a/2)&&(e[i+1]/a/100|0)==R(10,t-2)-1||(s==a/2||s==0)&&(e[i+1]/a/100|0)==0:t<4?(t==0?s=s/1e3|0:t==1?s=s/100|0:t==2&&(s=s/10|0),o=(r||n<4)&&s==9999||!r&&n>3&&s==4999):o=((r||n<4)&&s+1==a||!r&&n>3&&s+1==a/2)&&(e[i+1]/a/1e3|0)==R(10,t-3)-1,o}function Yr(e,t,n){for(var r,i=[0],a,o=0,s=e.length;o<s;){for(a=i.length;a--;)i[a]*=t;for(i[0]+=Ar.indexOf(e.charAt(o++)),r=0;r<i.length;r++)i[r]>n-1&&(i[r+1]===void 0&&(i[r+1]=0),i[r+1]+=i[r]/n|0,i[r]%=n)}return i.reverse()}function Xr(e,t){var n,r,i;if(t.isZero())return t;r=t.d.length,r<32?(n=Math.ceil(r/3),i=(1/di(4,n)).toString()):(n=16,i=`2.3283064365386962890625e-10`),e.precision+=n,t=ui(e,1,t.times(i),new e(1));for(var a=n;a--;){var o=t.times(t);t=o.times(o).minus(o).times(8).plus(1)}return e.precision-=n,t}var W=(function(){function e(e,t,n){var r,i=0,a=e.length;for(e=e.slice();a--;)r=e[a]*t+i,e[a]=r%n|0,i=r/n|0;return i&&e.unshift(i),e}function t(e,t,n,r){var i,a;if(n!=r)a=n>r?1:-1;else for(i=a=0;i<n;i++)if(e[i]!=t[i]){a=e[i]>t[i]?1:-1;break}return a}function n(e,t,n,r){for(var i=0;n--;)e[n]-=i,i=e[n]<t[n]?1:0,e[n]=i*r+e[n]-t[n];for(;!e[0]&&e.length>1;)e.shift()}return function(r,i,a,o,s,c){var l,u,d,f,p,m,h,g,_,v,y,b,x,S,ee,te,ne,C,w,re,ie=r.constructor,ae=r.s==i.s?1:-1,T=r.d,E=i.d;if(!T||!T[0]||!E||!E[0])return new ie(!r.s||!i.s||(T?E&&T[0]==E[0]:!E)?NaN:T&&T[0]==0||!E?ae*0:ae/0);for(c?(p=1,u=r.e-i.e):(c=z,p=B,u=L(r.e/p)-L(i.e/p)),w=E.length,ne=T.length,_=new ie(ae),v=_.d=[],d=0;E[d]==(T[d]||0);d++);if(E[d]>(T[d]||0)&&u--,a==null?(S=a=ie.precision,o=ie.rounding):S=s?a+(r.e-i.e)+1:a,S<0)v.push(1),m=!0;else{if(S=S/p+2|0,d=0,w==1){for(f=0,E=E[0],S++;(d<ne||f)&&S--;d++)ee=f*c+(T[d]||0),v[d]=ee/E|0,f=ee%E|0;m=f||d<ne}else{for(f=c/(E[0]+1)|0,f>1&&(E=e(E,f,c),T=e(T,f,c),w=E.length,ne=T.length),te=w,y=T.slice(0,w),b=y.length;b<w;)y[b++]=0;re=E.slice(),re.unshift(0),C=E[0],E[1]>=c/2&&++C;do f=0,l=t(E,y,w,b),l<0?(x=y[0],w!=b&&(x=x*c+(y[1]||0)),f=x/C|0,f>1?(f>=c&&(f=c-1),h=e(E,f,c),g=h.length,b=y.length,l=t(h,y,g,b),l==1&&(f--,n(h,w<g?re:E,g,c))):(f==0&&(l=f=1),h=E.slice()),g=h.length,g<b&&h.unshift(0),n(y,h,b,c),l==-1&&(b=y.length,l=t(E,y,w,b),l<1&&(f++,n(y,w<b?re:E,b,c))),b=y.length):l===0&&(f++,y=[0]),v[d++]=f,l&&y[0]?y[b++]=T[te]||0:(y=[T[te]],b=1);while((te++<ne||y[0]!==void 0)&&S--);m=y[0]!==void 0}v[0]||v.shift()}if(p==1)_.e=u,Pr=m;else{for(d=1,f=v[0];f>=10;f/=10)d++;_.e=d+u*p-1,G(_,s?a+_.e+1:a,o,m)}return _}})();function G(e,t,n,r){var i,a,o,s,c,l,u,d,f,p=e.constructor;out:if(t!=null){if(d=e.d,!d)return e;for(i=1,s=d[0];s>=10;s/=10)i++;if(a=t-i,a<0)a+=B,o=t,u=d[f=0],c=u/R(10,i-o-1)%10|0;else if(f=Math.ceil((a+1)/B),s=d.length,f>=s)if(r){for(;s++<=f;)d.push(0);u=c=0,i=1,a%=B,o=a-B+1}else break out;else{for(u=s=d[f],i=1;s>=10;s/=10)i++;a%=B,o=a-B+i,c=o<0?0:u/R(10,i-o-1)%10|0}if(r=r||t<0||d[f+1]!==void 0||(o<0?u:u%R(10,i-o-1)),l=n<4?(c||r)&&(n==0||n==(e.s<0?3:2)):c>5||c==5&&(n==4||r||n==6&&(a>0?o>0?u/R(10,i-o):0:d[f-1])%10&1||n==(e.s<0?8:7)),t<1||!d[0])return d.length=0,l?(t-=e.e+1,d[0]=R(10,(B-t%B)%B),e.e=-t||0):d[0]=e.e=0,e;if(a==0?(d.length=f,s=1,f--):(d.length=f+1,s=R(10,B-a),d[f]=o>0?(u/R(10,i-o)%R(10,o)|0)*s:0),l)for(;;)if(f==0){for(a=1,o=d[0];o>=10;o/=10)a++;for(o=d[0]+=s,s=1;o>=10;o/=10)s++;a!=s&&(e.e++,d[0]==z&&(d[0]=1));break}else{if(d[f]+=s,d[f]!=z)break;d[f--]=0,s=1}for(a=d.length;d[--a]===0;)d.pop()}return I&&(e.e>p.maxE?(e.d=null,e.e=NaN):e.e<p.minE&&(e.e=0,e.d=[0])),e}function K(e,t,n){if(!e.isFinite())return oi(e);var r,i=e.e,a=H(e.d),o=a.length;return t?(n&&(r=n-o)>0?a=a.charAt(0)+`.`+a.slice(1)+ei(r):o>1&&(a=a.charAt(0)+`.`+a.slice(1)),a=a+(e.e<0?`e`:`e+`)+e.e):i<0?(a=`0.`+ei(-i-1)+a,n&&(r=n-o)>0&&(a+=ei(r))):i>=o?(a+=ei(i+1-o),n&&(r=n-i-1)>0&&(a=a+`.`+ei(r))):((r=i+1)<o&&(a=a.slice(0,r)+`.`+a.slice(r)),n&&(r=n-o)>0&&(i+1===o&&(a+=`.`),a+=ei(r))),a}function Zr(e,t){var n=e[0];for(t*=B;n>=10;n/=10)t++;return t}function Qr(e,t,n){if(t>Kr)throw I=!0,n&&(e.precision=n),Error(Rr);return G(new e(jr),t,1,!0)}function q(e,t,n){if(t>qr)throw Error(Rr);return G(new e(Mr),t,n,!0)}function $r(e){var t=e.length-1,n=t*B+1;if(t=e[t],t){for(;t%10==0;t/=10)n--;for(t=e[0];t>=10;t/=10)n++}return n}function ei(e){for(var t=``;e--;)t+=`0`;return t}function ti(e,t,n,r){var i,a=new e(1),o=Math.ceil(r/B+4);for(I=!1;;){if(n%2&&(a=a.times(t),mi(a.d,o)&&(i=!0)),n=L(n/2),n===0){n=a.d.length-1,i&&a.d[n]===0&&++a.d[n];break}t=t.times(t),mi(t.d,o)}return I=!0,a}function ni(e){return e.d[e.d.length-1]&1}function ri(e,t,n){for(var r,i,a=new e(t[0]),o=0;++o<t.length;){if(i=new e(t[o]),!i.s){a=i;break}r=a.cmp(i),(r===n||r===0&&a.s===n)&&(a=i)}return a}function ii(e,t){var n,r,i,a,o,s,c,l=0,u=0,d=0,f=e.constructor,p=f.rounding,m=f.precision;if(!e.d||!e.d[0]||e.e>17)return new f(e.d?e.d[0]?e.s<0?0:1/0:1:e.s?e.s<0?0:e:NaN);for(t==null?(I=!1,c=m):c=t,s=new f(.03125);e.e>-2;)e=e.times(s),d+=5;for(r=Math.log(R(2,d))/Math.LN10*2+5|0,c+=r,n=a=o=new f(1),f.precision=c;;){if(a=G(a.times(e),c,1),n=n.times(++u),s=o.plus(W(a,n,c,1)),H(s.d).slice(0,c)===H(o.d).slice(0,c)){for(i=d;i--;)o=G(o.times(o),c,1);if(t==null)if(l<3&&Jr(o.d,c-r,p,l))f.precision=c+=10,n=a=s=new f(1),u=0,l++;else return G(o,f.precision=m,p,I=!0);else return f.precision=m,o}o=s}}function ai(e,t){var n,r,i,a,o,s,c,l,u,d,f,p=1,m=10,h=e,g=h.d,_=h.constructor,v=_.rounding,y=_.precision;if(h.s<0||!g||!g[0]||!h.e&&g[0]==1&&g.length==1)return new _(g&&!g[0]?-1/0:h.s==1?g?0:h:NaN);if(t==null?(I=!1,u=y):u=t,_.precision=u+=m,n=H(g),r=n.charAt(0),Math.abs(a=h.e)<0x5543df729c000){for(;r<7&&r!=1||r==1&&n.charAt(1)>3;)h=h.times(e),n=H(h.d),r=n.charAt(0),p++;a=h.e,r>1?(h=new _(`0.`+n),a++):h=new _(r+`.`+n.slice(1))}else return l=Qr(_,u+2,y).times(a+``),h=ai(new _(r+`.`+n.slice(1)),u-m).plus(l),_.precision=y,t==null?G(h,y,v,I=!0):h;for(d=h,c=o=h=W(h.minus(1),h.plus(1),u,1),f=G(h.times(h),u,1),i=3;;){if(o=G(o.times(f),u,1),l=c.plus(W(o,new _(i),u,1)),H(l.d).slice(0,u)===H(c.d).slice(0,u))if(c=c.times(2),a!==0&&(c=c.plus(Qr(_,u+2,y).times(a+``))),c=W(c,new _(p),u,1),t==null)if(Jr(c.d,u-m,v,s))_.precision=u+=m,l=o=h=W(d.minus(1),d.plus(1),u,1),f=G(h.times(h),u,1),i=s=1;else return G(c,_.precision=y,v,I=!0);else return _.precision=y,c;c=l,i+=2}}function oi(e){return String(e.s*e.s/0)}function si(e,t){var n,r,i;for((n=t.indexOf(`.`))>-1&&(t=t.replace(`.`,``)),(r=t.search(/e/i))>0?(n<0&&(n=r),n+=+t.slice(r+1),t=t.substring(0,r)):n<0&&(n=t.length),r=0;t.charCodeAt(r)===48;r++);for(i=t.length;t.charCodeAt(i-1)===48;--i);if(t=t.slice(r,i),t){if(i-=r,e.e=n=n-r-1,e.d=[],r=(n+1)%B,n<0&&(r+=B),r<i){for(r&&e.d.push(+t.slice(0,r)),i-=B;r<i;)e.d.push(+t.slice(r,r+=B));t=t.slice(r),r=B-t.length}else r-=i;for(;r--;)t+=`0`;e.d.push(+t),I&&(e.e>e.constructor.maxE?(e.d=null,e.e=NaN):e.e<e.constructor.minE&&(e.e=0,e.d=[0]))}else e.e=0,e.d=[0];return e}function ci(e,t){var n,r,i,a,o,s,c,l,u;if(t.indexOf(`_`)>-1){if(t=t.replace(/(\d)_(?=\d)/g,`$1`),Wr.test(t))return si(e,t)}else if(t===`Infinity`||t===`NaN`)return+t||(e.s=NaN),e.e=NaN,e.d=null,e;if(Hr.test(t))n=16,t=t.toLowerCase();else if(Vr.test(t))n=2;else if(Ur.test(t))n=8;else throw Error(Lr+t);for(a=t.search(/p/i),a>0?(c=+t.slice(a+1),t=t.substring(2,a)):t=t.slice(2),a=t.indexOf(`.`),o=a>=0,r=e.constructor,o&&(t=t.replace(`.`,``),s=t.length,a=s-a,i=ti(r,new r(n),a,a*2)),l=Yr(t,n,z),u=l.length-1,a=u;l[a]===0;--a)l.pop();return a<0?new r(e.s*0):(e.e=Zr(l,u),e.d=l,I=!1,o&&(e=W(e,i,s*4)),c&&(e=e.times(Math.abs(c)<54?R(2,c):na.pow(2,c))),I=!0,e)}function li(e,t){var n,r=t.d.length;if(r<3)return t.isZero()?t:ui(e,2,t,t);n=1.4*Math.sqrt(r),n=n>16?16:n|0,t=t.times(1/di(5,n)),t=ui(e,2,t,t);for(var i,a=new e(5),o=new e(16),s=new e(20);n--;)i=t.times(t),t=t.times(a.plus(i.times(o.times(i).minus(s))));return t}function ui(e,t,n,r,i){var a,o,s,c,l=1,u=e.precision,d=Math.ceil(u/B);for(I=!1,c=n.times(n),s=new e(r);;){if(o=W(s.times(c),new e(t++*t++),u,1),s=i?r.plus(o):r.minus(o),r=W(o.times(c),new e(t++*t++),u,1),o=s.plus(r),o.d[d]!==void 0){for(a=d;o.d[a]===s.d[a]&&a--;);if(a==-1)break}a=s,s=r,r=o,o=a,l++}return I=!0,o.d.length=d+1,o}function di(e,t){for(var n=e;--t;)n*=e;return n}function fi(e,t){var n,r=t.s<0,i=q(e,e.precision,1),a=i.times(.5);if(t=t.abs(),t.lte(a))return Fr=r?4:1,t;if(n=t.divToInt(i),n.isZero())Fr=r?3:2;else{if(t=t.minus(n.times(i)),t.lte(a))return Fr=ni(n)?r?2:3:r?4:1,t;Fr=ni(n)?r?1:4:r?3:2}return t.minus(i).abs()}function pi(e,t,n,r){var i,a,o,s,c,l,u,d,f,p=e.constructor,m=n!==void 0;if(m?(U(n,1,kr),r===void 0?r=p.rounding:U(r,0,8)):(n=p.precision,r=p.rounding),!e.isFinite())u=oi(e);else{for(u=K(e),o=u.indexOf(`.`),m?(i=2,t==16?n=n*4-3:t==8&&(n=n*3-2)):i=t,o>=0&&(u=u.replace(`.`,``),f=new p(1),f.e=u.length-o,f.d=Yr(K(f),10,i),f.e=f.d.length),d=Yr(u,10,i),a=c=d.length;d[--c]==0;)d.pop();if(!d[0])u=m?`0p+0`:`0`;else{if(o<0?a--:(e=new p(e),e.d=d,e.e=a,e=W(e,f,n,r,0,i),d=e.d,a=e.e,l=Pr),o=d[n],s=i/2,l||=d[n+1]!==void 0,l=r<4?(o!==void 0||l)&&(r===0||r===(e.s<0?3:2)):o>s||o===s&&(r===4||l||r===6&&d[n-1]&1||r===(e.s<0?8:7)),d.length=n,l)for(;++d[--n]>i-1;)d[n]=0,n||(++a,d.unshift(1));for(c=d.length;!d[c-1];--c);for(o=0,u=``;o<c;o++)u+=Ar.charAt(d[o]);if(m){if(c>1)if(t==16||t==8){for(o=t==16?4:3,--c;c%o;c++)u+=`0`;for(d=Yr(u,i,t),c=d.length;!d[c-1];--c);for(o=1,u=`1.`;o<c;o++)u+=Ar.charAt(d[o])}else u=u.charAt(0)+`.`+u.slice(1);u=u+(a<0?`p`:`p+`)+a}else if(a<0){for(;++a;)u=`0`+u;u=`0.`+u}else if(++a>c)for(a-=c;a--;)u+=`0`;else a<c&&(u=u.slice(0,a)+`.`+u.slice(a))}u=(t==16?`0x`:t==2?`0b`:t==8?`0o`:``)+u}return e.s<0?`-`+u:u}function mi(e,t){if(e.length>t)return e.length=t,!0}function hi(e){return new this(e).abs()}function gi(e){return new this(e).acos()}function _i(e){return new this(e).acosh()}function vi(e,t){return new this(e).plus(t)}function yi(e){return new this(e).asin()}function bi(e){return new this(e).asinh()}function xi(e){return new this(e).atan()}function Si(e){return new this(e).atanh()}function Ci(e,t){e=new this(e),t=new this(t);var n,r=this.precision,i=this.rounding,a=r+4;return!e.s||!t.s?n=new this(NaN):!e.d&&!t.d?(n=q(this,a,1).times(t.s>0?.25:.75),n.s=e.s):!t.d||e.isZero()?(n=t.s<0?q(this,r,i):new this(0),n.s=e.s):!e.d||t.isZero()?(n=q(this,a,1).times(.5),n.s=e.s):t.s<0?(this.precision=a,this.rounding=1,n=this.atan(W(e,t,a,1)),t=q(this,a,1),this.precision=r,this.rounding=i,n=e.s<0?n.minus(t):n.plus(t)):n=this.atan(W(e,t,a,1)),n}function wi(e){return new this(e).cbrt()}function Ti(e){return G(e=new this(e),e.e+1,2)}function Ei(e,t,n){return new this(e).clamp(t,n)}function Di(e){if(!e||typeof e!=`object`)throw Error(Ir+`Object expected`);var t,n,r,i=e.defaults===!0,a=[`precision`,1,kr,`rounding`,0,8,`toExpNeg`,-Or,0,`toExpPos`,0,Or,`maxE`,0,Or,`minE`,-Or,0,`modulo`,0,9];for(t=0;t<a.length;t+=3)if(n=a[t],i&&(this[n]=Nr[n]),(r=e[n])!==void 0)if(L(r)===r&&r>=a[t+1]&&r<=a[t+2])this[n]=r;else throw Error(Lr+n+`: `+r);if(n=`crypto`,i&&(this[n]=Nr[n]),(r=e[n])!==void 0)if(r===!0||r===!1||r===0||r===1)if(r)if(typeof crypto<`u`&&crypto&&(crypto.getRandomValues||crypto.randomBytes))this[n]=!0;else throw Error(zr);else this[n]=!1;else throw Error(Lr+n+`: `+r);return this}function Oi(e){return new this(e).cos()}function ki(e){return new this(e).cosh()}function Ai(e){var t,n,r;function i(e){var t,n,r,a=this;if(!(a instanceof i))return new i(e);if(a.constructor=i,Fi(e)){a.s=e.s,I?!e.d||e.e>i.maxE?(a.e=NaN,a.d=null):e.e<i.minE?(a.e=0,a.d=[0]):(a.e=e.e,a.d=e.d.slice()):(a.e=e.e,a.d=e.d?e.d.slice():e.d);return}if(r=typeof e,r===`number`){if(e===0){a.s=1/e<0?-1:1,a.e=0,a.d=[0];return}if(e<0?(e=-e,a.s=-1):a.s=1,e===~~e&&e<1e7){for(t=0,n=e;n>=10;n/=10)t++;I?t>i.maxE?(a.e=NaN,a.d=null):t<i.minE?(a.e=0,a.d=[0]):(a.e=t,a.d=[e]):(a.e=t,a.d=[e]);return}if(e*0!=0){e||(a.s=NaN),a.e=NaN,a.d=null;return}return si(a,e.toString())}if(r===`string`)return(n=e.charCodeAt(0))===45?(e=e.slice(1),a.s=-1):(n===43&&(e=e.slice(1)),a.s=1),Wr.test(e)?si(a,e):ci(a,e);if(r===`bigint`)return e<0?(e=-e,a.s=-1):a.s=1,si(a,e.toString());throw Error(Lr+e)}if(i.prototype=V,i.ROUND_UP=0,i.ROUND_DOWN=1,i.ROUND_CEIL=2,i.ROUND_FLOOR=3,i.ROUND_HALF_UP=4,i.ROUND_HALF_DOWN=5,i.ROUND_HALF_EVEN=6,i.ROUND_HALF_CEIL=7,i.ROUND_HALF_FLOOR=8,i.EUCLID=9,i.config=i.set=Di,i.clone=Ai,i.isDecimal=Fi,i.abs=hi,i.acos=gi,i.acosh=_i,i.add=vi,i.asin=yi,i.asinh=bi,i.atan=xi,i.atanh=Si,i.atan2=Ci,i.cbrt=wi,i.ceil=Ti,i.clamp=Ei,i.cos=Oi,i.cosh=ki,i.div=ji,i.exp=Mi,i.floor=Ni,i.hypot=Pi,i.ln=Ii,i.log=Li,i.log10=zi,i.log2=Ri,i.max=Bi,i.min=Vi,i.mod=Hi,i.mul=Ui,i.pow=Wi,i.random=Gi,i.round=Ki,i.sign=qi,i.sin=Ji,i.sinh=Yi,i.sqrt=Xi,i.sub=Zi,i.sum=Qi,i.tan=$i,i.tanh=ea,i.trunc=ta,e===void 0&&(e={}),e&&e.defaults!==!0)for(r=[`precision`,`rounding`,`toExpNeg`,`toExpPos`,`maxE`,`minE`,`modulo`,`crypto`],t=0;t<r.length;)e.hasOwnProperty(n=r[t++])||(e[n]=this[n]);return i.config(e),i}function ji(e,t){return new this(e).div(t)}function Mi(e){return new this(e).exp()}function Ni(e){return G(e=new this(e),e.e+1,3)}function Pi(){var e,t,n=new this(0);for(I=!1,e=0;e<arguments.length;)if(t=new this(arguments[e++]),t.d)n.d&&(n=n.plus(t.times(t)));else{if(t.s)return I=!0,new this(1/0);n=t}return I=!0,n.sqrt()}function Fi(e){return e instanceof na||e&&e.toStringTag===Br||!1}function Ii(e){return new this(e).ln()}function Li(e,t){return new this(e).log(t)}function Ri(e){return new this(e).log(2)}function zi(e){return new this(e).log(10)}function Bi(){return ri(this,arguments,-1)}function Vi(){return ri(this,arguments,1)}function Hi(e,t){return new this(e).mod(t)}function Ui(e,t){return new this(e).mul(t)}function Wi(e,t){return new this(e).pow(t)}function Gi(e){var t,n,r,i,a=0,o=new this(1),s=[];if(e===void 0?e=this.precision:U(e,1,kr),r=Math.ceil(e/B),this.crypto)if(crypto.getRandomValues)for(t=crypto.getRandomValues(new Uint32Array(r));a<r;)i=t[a],i>=429e7?t[a]=crypto.getRandomValues(new Uint32Array(1))[0]:s[a++]=i%1e7;else if(crypto.randomBytes){for(t=crypto.randomBytes(r*=4);a<r;)i=t[a]+(t[a+1]<<8)+(t[a+2]<<16)+((t[a+3]&127)<<24),i>=214e7?crypto.randomBytes(4).copy(t,a):(s.push(i%1e7),a+=4);a=r/4}else throw Error(zr);else for(;a<r;)s[a++]=Math.random()*1e7|0;for(r=s[--a],e%=B,r&&e&&(i=R(10,B-e),s[a]=(r/i|0)*i);s[a]===0;a--)s.pop();if(a<0)n=0,s=[0];else{for(n=-1;s[0]===0;n-=B)s.shift();for(r=1,i=s[0];i>=10;i/=10)r++;r<B&&(n-=B-r)}return o.e=n,o.d=s,o}function Ki(e){return G(e=new this(e),e.e+1,this.rounding)}function qi(e){return e=new this(e),e.d?e.d[0]?e.s:0*e.s:e.s||NaN}function Ji(e){return new this(e).sin()}function Yi(e){return new this(e).sinh()}function Xi(e){return new this(e).sqrt()}function Zi(e,t){return new this(e).sub(t)}function Qi(){var e=0,t=arguments,n=new this(t[e]);for(I=!1;n.s&&++e<t.length;)n=n.plus(t[e]);return I=!0,G(n,this.precision,this.rounding)}function $i(e){return new this(e).tan()}function ea(e){return new this(e).tanh()}function ta(e){return G(e=new this(e),e.e+1,1)}V[Symbol.for(`nodejs.util.inspect.custom`)]=V.toString,V[Symbol.toStringTag]=`Decimal`;var na=V.constructor=Ai(Nr);jr=new na(jr),Mr=new na(Mr);var ra=na,ia=`BigNumber`,aa=[`?on`,`config`],oa=or(ia,aa,e=>{var{on:t,config:n}=e,r=ra.clone({precision:n.precision,modulo:ra.EUCLID});return r.prototype=Object.create(r.prototype),r.prototype.type=`BigNumber`,r.prototype.isBigNumber=!0,r.prototype.toJSON=function(){return{mathjs:`BigNumber`,value:this.toString()}},r.fromJSON=function(e){return new r(e.value)},t&&t(`config`,function(e,t){e.precision!==t.precision&&r.config({precision:e.precision})}),r},{isClass:!0});const J=Math.cosh||function(e){return Math.abs(e)<1e-9?1-e:(Math.exp(e)+Math.exp(-e))*.5},Y=Math.sinh||function(e){return Math.abs(e)<1e-9?e:(Math.exp(e)-Math.exp(-e))*.5},sa=function(e){let t=Math.PI/4;if(-t>e||e>t)return Math.cos(e)-1;let n=e*e;return n*(n*(n*(n*(n*(n*(n*(n/20922789888e3-1/87178291200)+1/479001600)-1/3628800)+1/40320)-1/720)+1/24)-1/2)},ca=function(e,t){return e=Math.abs(e),t=Math.abs(t),e<t&&([e,t]=[t,e]),e<1e8?Math.sqrt(e*e+t*t):(t/=e,e*Math.sqrt(1+t*t))},la=function(){throw SyntaxError(`Invalid Param`)};function ua(e,t){let n=Math.abs(e),r=Math.abs(t);return e===0?Math.log(r):t===0?Math.log(n):n<3e3&&r<3e3?Math.log(e*e+t*t)*.5:(e*=.5,t*=.5,.5*Math.log(e*e+t*t)+Math.LN2)}const da={re:0,im:0},fa=function(e,t){let n=da;if(e==null)n.re=n.im=0;else if(t!==void 0)n.re=e,n.im=t;else switch(typeof e){case`object`:if(`im`in e&&`re`in e)n.re=e.re,n.im=e.im;else if(`abs`in e&&`arg`in e){if(!isFinite(e.abs)&&isFinite(e.arg))return X.INFINITY;n.re=e.abs*Math.cos(e.arg),n.im=e.abs*Math.sin(e.arg)}else if(`r`in e&&`phi`in e){if(!isFinite(e.r)&&isFinite(e.phi))return X.INFINITY;n.re=e.r*Math.cos(e.phi),n.im=e.r*Math.sin(e.phi)}else e.length===2?(n.re=e[0],n.im=e[1]):la();break;case`string`:n.im=n.re=0;let t=e.replace(/_/g,``).match(/\d+\.?\d*e[+-]?\d+|\d+\.?\d*|\.\d+|./g),r=1,i=0;t===null&&la();for(let e=0;e<t.length;e++){let a=t[e];a===` `||a===` `||a===`
|
|
117
|
-
`||(a===`+`?r++:a===`-`?i++:a===`i`||a===`I`?(r+i===0&&la(),t[e+1]!==` `&&!isNaN(t[e+1])?(n.im+=parseFloat((i%2?`-`:``)+t[e+1]),e++):n.im+=parseFloat((i%2?`-`:``)+`1`),r=i=0):((r+i===0||isNaN(a))&&la(),t[e+1]===`i`||t[e+1]===`I`?(n.im+=parseFloat((i%2?`-`:``)+a),e++):n.re+=parseFloat((i%2?`-`:``)+a),r=i=0))}r+i>0&&la();break;case`number`:n.im=0,n.re=e;break;default:la()}return isNaN(n.re)||isNaN(n.im),n};function X(e,t){if(!(this instanceof X))return new X(e,t);let n=fa(e,t);this.re=n.re,this.im=n.im}X.prototype={re:0,im:0,sign:function(){let e=ca(this.re,this.im);return new X(this.re/e,this.im/e)},add:function(e,t){let n=fa(e,t),r=this.isInfinite(),i=!(isFinite(n.re)&&isFinite(n.im));return r||i?r&&i?X.NAN:X.INFINITY:new X(this.re+n.re,this.im+n.im)},sub:function(e,t){let n=fa(e,t),r=this.isInfinite(),i=!(isFinite(n.re)&&isFinite(n.im));return r||i?r&&i?X.NAN:X.INFINITY:new X(this.re-n.re,this.im-n.im)},mul:function(e,t){let n=fa(e,t),r=this.isInfinite(),i=!(isFinite(n.re)&&isFinite(n.im)),a=this.re===0&&this.im===0,o=n.re===0&&n.im===0;return r&&o||i&&a?X.NAN:r||i?X.INFINITY:n.im===0&&this.im===0?new X(this.re*n.re,0):new X(this.re*n.re-this.im*n.im,this.re*n.im+this.im*n.re)},div:function(e,t){let n=fa(e,t),r=this.isInfinite(),i=!(isFinite(n.re)&&isFinite(n.im)),a=this.re===0&&this.im===0,o=n.re===0&&n.im===0;if(a&&o||r&&i)return X.NAN;if(o||r)return X.INFINITY;if(a||i)return X.ZERO;if(n.im===0)return new X(this.re/n.re,this.im/n.re);if(Math.abs(n.re)<Math.abs(n.im)){let e=n.re/n.im,t=n.re*e+n.im;return new X((this.re*e+this.im)/t,(this.im*e-this.re)/t)}else{let e=n.im/n.re,t=n.im*e+n.re;return new X((this.re+this.im*e)/t,(this.im-this.re*e)/t)}},pow:function(e,t){let n=fa(e,t),r=this.re===0&&this.im===0;if(n.re===0&&n.im===0)return X.ONE;if(n.im===0){if(this.im===0&&this.re>0)return new X(this.re**+n.re,0);if(this.re===0)switch((n.re%4+4)%4){case 0:return new X(this.im**+n.re,0);case 1:return new X(0,this.im**+n.re);case 2:return new X(-(this.im**+n.re),0);case 3:return new X(0,-(this.im**+n.re))}}if(r&&n.re>0)return X.ZERO;let i=Math.atan2(this.im,this.re),a=ua(this.re,this.im),o=Math.exp(n.re*a-n.im*i),s=n.im*a+n.re*i;return new X(o*Math.cos(s),o*Math.sin(s))},sqrt:function(){let e=this.re,t=this.im;if(t===0)return e>=0?new X(Math.sqrt(e),0):new X(0,Math.sqrt(-e));let n=ca(e,t),r=Math.sqrt(.5*(n+Math.abs(e))),i=Math.abs(t)/(2*r);return e>=0?new X(r,t<0?-i:i):new X(i,t<0?-r:r)},exp:function(){let e=Math.exp(this.re);return this.im===0?new X(e,0):new X(e*Math.cos(this.im),e*Math.sin(this.im))},expm1:function(){let e=this.re,t=this.im;return new X(Math.expm1(e)*Math.cos(t)+sa(t),Math.exp(e)*Math.sin(t))},log:function(){let e=this.re,t=this.im;return t===0&&e>0?new X(Math.log(e),0):new X(ua(e,t),Math.atan2(t,e))},abs:function(){return ca(this.re,this.im)},arg:function(){return Math.atan2(this.im,this.re)},sin:function(){let e=this.re,t=this.im;return new X(Math.sin(e)*J(t),Math.cos(e)*Y(t))},cos:function(){let e=this.re,t=this.im;return new X(Math.cos(e)*J(t),-Math.sin(e)*Y(t))},tan:function(){let e=2*this.re,t=2*this.im,n=Math.cos(e)+J(t);return new X(Math.sin(e)/n,Y(t)/n)},cot:function(){let e=2*this.re,t=2*this.im,n=Math.cos(e)-J(t);return new X(-Math.sin(e)/n,Y(t)/n)},sec:function(){let e=this.re,t=this.im,n=.5*J(2*t)+.5*Math.cos(2*e);return new X(Math.cos(e)*J(t)/n,Math.sin(e)*Y(t)/n)},csc:function(){let e=this.re,t=this.im,n=.5*J(2*t)-.5*Math.cos(2*e);return new X(Math.sin(e)*J(t)/n,-Math.cos(e)*Y(t)/n)},asin:function(){let e=this.re,t=this.im,n=new X(t*t-e*e+1,-2*e*t).sqrt(),r=new X(n.re-t,n.im+e).log();return new X(r.im,-r.re)},acos:function(){let e=this.re,t=this.im,n=new X(t*t-e*e+1,-2*e*t).sqrt(),r=new X(n.re-t,n.im+e).log();return new X(Math.PI/2-r.im,r.re)},atan:function(){let e=this.re,t=this.im;if(e===0){if(t===1)return new X(0,1/0);if(t===-1)return new X(0,-1/0)}let n=e*e+(1-t)*(1-t),r=new X((1-t*t-e*e)/n,-2*e/n).log();return new X(-.5*r.im,.5*r.re)},acot:function(){let e=this.re,t=this.im;if(t===0)return new X(Math.atan2(1,e),0);let n=e*e+t*t;return n===0?new X(e===0?0:e/0,t===0?0:-t/0).atan():new X(e/n,-t/n).atan()},asec:function(){let e=this.re,t=this.im;if(e===0&&t===0)return new X(0,1/0);let n=e*e+t*t;return n===0?new X(e===0?0:e/0,t===0?0:-t/0).acos():new X(e/n,-t/n).acos()},acsc:function(){let e=this.re,t=this.im;if(e===0&&t===0)return new X(Math.PI/2,1/0);let n=e*e+t*t;return n===0?new X(e===0?0:e/0,t===0?0:-t/0).asin():new X(e/n,-t/n).asin()},sinh:function(){let e=this.re,t=this.im;return new X(Y(e)*Math.cos(t),J(e)*Math.sin(t))},cosh:function(){let e=this.re,t=this.im;return new X(J(e)*Math.cos(t),Y(e)*Math.sin(t))},tanh:function(){let e=2*this.re,t=2*this.im,n=J(e)+Math.cos(t);return new X(Y(e)/n,Math.sin(t)/n)},coth:function(){let e=2*this.re,t=2*this.im,n=J(e)-Math.cos(t);return new X(Y(e)/n,-Math.sin(t)/n)},csch:function(){let e=this.re,t=this.im,n=Math.cos(2*t)-J(2*e);return new X(-2*Y(e)*Math.cos(t)/n,2*J(e)*Math.sin(t)/n)},sech:function(){let e=this.re,t=this.im,n=Math.cos(2*t)+J(2*e);return new X(2*J(e)*Math.cos(t)/n,-2*Y(e)*Math.sin(t)/n)},asinh:function(){let e=this.
|
|
116
|
+
var Or=9e15,kr=1e9,Ar=`0123456789abcdef`,jr=`2.3025850929940456840179914546843642076011014886287729760333279009675726096773524802359972050895982983419677840422862486334095254650828067566662873690987816894829072083255546808437998948262331985283935053089653777326288461633662222876982198867465436674744042432743651550489343149393914796194044002221051017141748003688084012647080685567743216228355220114804663715659121373450747856947683463616792101806445070648000277502684916746550586856935673420670581136429224554405758925724208241314695689016758940256776311356919292033376587141660230105703089634572075440370847469940168269282808481184289314848524948644871927809676271275775397027668605952496716674183485704422507197965004714951050492214776567636938662976979522110718264549734772662425709429322582798502585509785265383207606726317164309505995087807523710333101197857547331541421808427543863591778117054309827482385045648019095610299291824318237525357709750539565187697510374970888692180205189339507238539205144634197265287286965110862571492198849978748873771345686209167058`,Mr=`3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679821480865132823066470938446095505822317253594081284811174502841027019385211055596446229489549303819644288109756659334461284756482337867831652712019091456485669234603486104543266482133936072602491412737245870066063155881748815209209628292540917153643678925903600113305305488204665213841469519415116094330572703657595919530921861173819326117931051185480744623799627495673518857527248912279381830119491298336733624406566430860213949463952247371907021798609437027705392171762931767523846748184676694051320005681271452635608277857713427577896091736371787214684409012249534301465495853710507922796892589235420199561121290219608640344181598136297747713099605187072113499999983729780499510597317328160963185950244594553469083026425223082533446850352619311881710100031378387528865875332083814206171776691473035982534904287554687311595628638823537875937519577818577805321712268066130019278766111959092164201989380952572010654858632789`,Nr={precision:20,rounding:4,modulo:1,toExpNeg:-7,toExpPos:21,minE:-Or,maxE:Or,crypto:!1},Pr,Fr,I=!0,Ir=`[DecimalError] `,Lr=Ir+`Invalid argument: `,Rr=Ir+`Precision limit exceeded`,zr=Ir+`crypto unavailable`,Br=`[object Decimal]`,L=Math.floor,R=Math.pow,Vr=/^0b([01]+(\.[01]*)?|\.[01]+)(p[+-]?\d+)?$/i,Hr=/^0x([0-9a-f]+(\.[0-9a-f]*)?|\.[0-9a-f]+)(p[+-]?\d+)?$/i,Ur=/^0o([0-7]+(\.[0-7]*)?|\.[0-7]+)(p[+-]?\d+)?$/i,Wr=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,z=1e7,B=7,Gr=9007199254740991,Kr=jr.length-1,qr=Mr.length-1,V={toStringTag:Br};V.absoluteValue=V.abs=function(){var e=new this.constructor(this);return e.s<0&&(e.s=1),G(e)},V.ceil=function(){return G(new this.constructor(this),this.e+1,2)},V.clampedTo=V.clamp=function(e,t){var n,r=this,i=r.constructor;if(e=new i(e),t=new i(t),!e.s||!t.s)return new i(NaN);if(e.gt(t))throw Error(Lr+t);return n=r.cmp(e),n<0?e:r.cmp(t)>0?t:new i(r)},V.comparedTo=V.cmp=function(e){var t,n,r,i,a=this,o=a.d,s=(e=new a.constructor(e)).d,c=a.s,l=e.s;if(!o||!s)return!c||!l?NaN:c===l?o===s?0:!o^c<0?1:-1:c;if(!o[0]||!s[0])return o[0]?c:s[0]?-l:0;if(c!==l)return c;if(a.e!==e.e)return a.e>e.e^c<0?1:-1;for(r=o.length,i=s.length,t=0,n=r<i?r:i;t<n;++t)if(o[t]!==s[t])return o[t]>s[t]^c<0?1:-1;return r===i?0:r>i^c<0?1:-1},V.cosine=V.cos=function(){var e,t,n=this,r=n.constructor;return n.d?n.d[0]?(e=r.precision,t=r.rounding,r.precision=e+Math.max(n.e,n.sd())+B,r.rounding=1,n=Xr(r,fi(r,n)),r.precision=e,r.rounding=t,G(Fr==2||Fr==3?n.neg():n,e,t,!0)):new r(1):new r(NaN)},V.cubeRoot=V.cbrt=function(){var e,t,n,r,i,a,o,s,c,l,u=this,d=u.constructor;if(!u.isFinite()||u.isZero())return new d(u);for(I=!1,a=u.s*R(u.s*u,1/3),!a||Math.abs(a)==1/0?(n=H(u.d),e=u.e,(a=(e-n.length+1)%3)&&(n+=a==1||a==-2?`0`:`00`),a=R(n,1/3),e=L((e+1)/3)-(e%3==(e<0?-1:2)),a==1/0?n=`5e`+e:(n=a.toExponential(),n=n.slice(0,n.indexOf(`e`)+1)+e),r=new d(n),r.s=u.s):r=new d(a.toString()),o=(e=d.precision)+3;;)if(s=r,c=s.times(s).times(s),l=c.plus(u),r=W(l.plus(u).times(s),l.plus(c),o+2,1),H(s.d).slice(0,o)===(n=H(r.d)).slice(0,o))if(n=n.slice(o-3,o+1),n==`9999`||!i&&n==`4999`){if(!i&&(G(s,e+1,0),s.times(s).times(s).eq(u))){r=s;break}o+=4,i=1}else{(!+n||!+n.slice(1)&&n.charAt(0)==`5`)&&(G(r,e+1,1),t=!r.times(r).times(r).eq(u));break}return I=!0,G(r,e,d.rounding,t)},V.decimalPlaces=V.dp=function(){var e,t=this.d,n=NaN;if(t){if(e=t.length-1,n=(e-L(this.e/B))*B,e=t[e],e)for(;e%10==0;e/=10)n--;n<0&&(n=0)}return n},V.dividedBy=V.div=function(e){return W(this,new this.constructor(e))},V.dividedToIntegerBy=V.divToInt=function(e){var t=this,n=t.constructor;return G(W(t,new n(e),0,1,1),n.precision,n.rounding)},V.equals=V.eq=function(e){return this.cmp(e)===0},V.floor=function(){return G(new this.constructor(this),this.e+1,3)},V.greaterThan=V.gt=function(e){return this.cmp(e)>0},V.greaterThanOrEqualTo=V.gte=function(e){var t=this.cmp(e);return t==1||t===0},V.hyperbolicCosine=V.cosh=function(){var e,t,n,r,i,a=this,o=a.constructor,s=new o(1);if(!a.isFinite())return new o(a.s?1/0:NaN);if(a.isZero())return s;n=o.precision,r=o.rounding,o.precision=n+Math.max(a.e,a.sd())+4,o.rounding=1,i=a.d.length,i<32?(e=Math.ceil(i/3),t=(1/di(4,e)).toString()):(e=16,t=`2.3283064365386962890625e-10`),a=ui(o,1,a.times(t),new o(1),!0);for(var c,l=e,u=new o(8);l--;)c=a.times(a),a=s.minus(c.times(u.minus(c.times(u))));return G(a,o.precision=n,o.rounding=r,!0)},V.hyperbolicSine=V.sinh=function(){var e,t,n,r,i=this,a=i.constructor;if(!i.isFinite()||i.isZero())return new a(i);if(t=a.precision,n=a.rounding,a.precision=t+Math.max(i.e,i.sd())+4,a.rounding=1,r=i.d.length,r<3)i=ui(a,2,i,i,!0);else{e=1.4*Math.sqrt(r),e=e>16?16:e|0,i=i.times(1/di(5,e)),i=ui(a,2,i,i,!0);for(var o,s=new a(5),c=new a(16),l=new a(20);e--;)o=i.times(i),i=i.times(s.plus(o.times(c.times(o).plus(l))))}return a.precision=t,a.rounding=n,G(i,t,n,!0)},V.hyperbolicTangent=V.tanh=function(){var e,t,n=this,r=n.constructor;return n.isFinite()?n.isZero()?new r(n):(e=r.precision,t=r.rounding,r.precision=e+7,r.rounding=1,W(n.sinh(),n.cosh(),r.precision=e,r.rounding=t)):new r(n.s)},V.inverseCosine=V.acos=function(){var e=this,t=e.constructor,n=e.abs().cmp(1),r=t.precision,i=t.rounding;return n===-1?e.isZero()?q(t,r+4,i).times(.5):(t.precision=r+6,t.rounding=1,e=new t(1).minus(e).div(e.plus(1)).sqrt().atan(),t.precision=r,t.rounding=i,e.times(2)):n===0?e.isNeg()?q(t,r,i):new t(0):new t(NaN)},V.inverseHyperbolicCosine=V.acosh=function(){var e,t,n=this,r=n.constructor;return n.lte(1)?new r(n.eq(1)?0:NaN):n.isFinite()?(e=r.precision,t=r.rounding,r.precision=e+Math.max(Math.abs(n.e),n.sd())+4,r.rounding=1,I=!1,n=n.times(n).minus(1).sqrt().plus(n),I=!0,r.precision=e,r.rounding=t,n.ln()):new r(n)},V.inverseHyperbolicSine=V.asinh=function(){var e,t,n=this,r=n.constructor;return!n.isFinite()||n.isZero()?new r(n):(e=r.precision,t=r.rounding,r.precision=e+2*Math.max(Math.abs(n.e),n.sd())+6,r.rounding=1,I=!1,n=n.times(n).plus(1).sqrt().plus(n),I=!0,r.precision=e,r.rounding=t,n.ln())},V.inverseHyperbolicTangent=V.atanh=function(){var e,t,n,r,i=this,a=i.constructor;return i.isFinite()?i.e>=0?new a(i.abs().eq(1)?i.s/0:i.isZero()?i:NaN):(e=a.precision,t=a.rounding,r=i.sd(),Math.max(r,e)<2*-i.e-1?G(new a(i),e,t,!0):(a.precision=n=r-i.e,i=W(i.plus(1),new a(1).minus(i),n+e,1),a.precision=e+4,a.rounding=1,i=i.ln(),a.precision=e,a.rounding=t,i.times(.5))):new a(NaN)},V.inverseSine=V.asin=function(){var e,t,n,r,i=this,a=i.constructor;return i.isZero()?new a(i):(t=i.abs().cmp(1),n=a.precision,r=a.rounding,t===-1?(a.precision=n+6,a.rounding=1,i=i.div(new a(1).minus(i.times(i)).sqrt().plus(1)).atan(),a.precision=n,a.rounding=r,i.times(2)):t===0?(e=q(a,n+4,r).times(.5),e.s=i.s,e):new a(NaN))},V.inverseTangent=V.atan=function(){var e,t,n,r,i,a,o,s,c,l=this,u=l.constructor,d=u.precision,f=u.rounding;if(l.isFinite()){if(l.isZero())return new u(l);if(l.abs().eq(1)&&d+4<=qr)return o=q(u,d+4,f).times(.25),o.s=l.s,o}else{if(!l.s)return new u(NaN);if(d+4<=qr)return o=q(u,d+4,f).times(.5),o.s=l.s,o}for(u.precision=s=d+10,u.rounding=1,n=Math.min(28,s/B+2|0),e=n;e;--e)l=l.div(l.times(l).plus(1).sqrt().plus(1));for(I=!1,t=Math.ceil(s/B),r=1,c=l.times(l),o=new u(l),i=l;e!==-1;)if(i=i.times(c),a=o.minus(i.div(r+=2)),i=i.times(c),o=a.plus(i.div(r+=2)),o.d[t]!==void 0)for(e=t;o.d[e]===a.d[e]&&e--;);return n&&(o=o.times(2<<n-1)),I=!0,G(o,u.precision=d,u.rounding=f,!0)},V.isFinite=function(){return!!this.d},V.isInteger=V.isInt=function(){return!!this.d&&L(this.e/B)>this.d.length-2},V.isNaN=function(){return!this.s},V.isNegative=V.isNeg=function(){return this.s<0},V.isPositive=V.isPos=function(){return this.s>0},V.isZero=function(){return!!this.d&&this.d[0]===0},V.lessThan=V.lt=function(e){return this.cmp(e)<0},V.lessThanOrEqualTo=V.lte=function(e){return this.cmp(e)<1},V.logarithm=V.log=function(e){var t,n,r,i,a,o,s,c,l=this,u=l.constructor,d=u.precision,f=u.rounding,p=5;if(e==null)e=new u(10),t=!0;else{if(e=new u(e),n=e.d,e.s<0||!n||!n[0]||e.eq(1))return new u(NaN);t=e.eq(10)}if(n=l.d,l.s<0||!n||!n[0]||l.eq(1))return new u(n&&!n[0]?-1/0:l.s==1?n?0:1/0:NaN);if(t)if(n.length>1)a=!0;else{for(i=n[0];i%10==0;)i/=10;a=i!==1}if(I=!1,s=d+p,o=ai(l,s),r=t?Qr(u,s+10):ai(e,s),c=W(o,r,s,1),Jr(c.d,i=d,f))do if(s+=10,o=ai(l,s),r=t?Qr(u,s+10):ai(e,s),c=W(o,r,s,1),!a){+H(c.d).slice(i+1,i+15)+1==0x5af3107a4000&&(c=G(c,d+1,0));break}while(Jr(c.d,i+=10,f));return I=!0,G(c,d,f)},V.minus=V.sub=function(e){var t,n,r,i,a,o,s,c,l,u,d,f,p=this,m=p.constructor;if(e=new m(e),!p.d||!e.d)return!p.s||!e.s?e=new m(NaN):p.d?e.s=-e.s:e=new m(e.d||p.s!==e.s?p:NaN),e;if(p.s!=e.s)return e.s=-e.s,p.plus(e);if(l=p.d,f=e.d,s=m.precision,c=m.rounding,!l[0]||!f[0]){if(f[0])e.s=-e.s;else if(l[0])e=new m(p);else return new m(c===3?-0:0);return I?G(e,s,c):e}if(n=L(e.e/B),u=L(p.e/B),l=l.slice(),a=u-n,a){for(d=a<0,d?(t=l,a=-a,o=f.length):(t=f,n=u,o=l.length),r=Math.max(Math.ceil(s/B),o)+2,a>r&&(a=r,t.length=1),t.reverse(),r=a;r--;)t.push(0);t.reverse()}else{for(r=l.length,o=f.length,d=r<o,d&&(o=r),r=0;r<o;r++)if(l[r]!=f[r]){d=l[r]<f[r];break}a=0}for(d&&(t=l,l=f,f=t,e.s=-e.s),o=l.length,r=f.length-o;r>0;--r)l[o++]=0;for(r=f.length;r>a;){if(l[--r]<f[r]){for(i=r;i&&l[--i]===0;)l[i]=z-1;--l[i],l[r]+=z}l[r]-=f[r]}for(;l[--o]===0;)l.pop();for(;l[0]===0;l.shift())--n;return l[0]?(e.d=l,e.e=Zr(l,n),I?G(e,s,c):e):new m(c===3?-0:0)},V.modulo=V.mod=function(e){var t,n=this,r=n.constructor;return e=new r(e),!n.d||!e.s||e.d&&!e.d[0]?new r(NaN):!e.d||n.d&&!n.d[0]?G(new r(n),r.precision,r.rounding):(I=!1,r.modulo==9?(t=W(n,e.abs(),0,3,1),t.s*=e.s):t=W(n,e,0,r.modulo,1),t=t.times(e),I=!0,n.minus(t))},V.naturalExponential=V.exp=function(){return ii(this)},V.naturalLogarithm=V.ln=function(){return ai(this)},V.negated=V.neg=function(){var e=new this.constructor(this);return e.s=-e.s,G(e)},V.plus=V.add=function(e){var t,n,r,i,a,o,s,c,l,u,d=this,f=d.constructor;if(e=new f(e),!d.d||!e.d)return!d.s||!e.s?e=new f(NaN):d.d||(e=new f(e.d||d.s===e.s?d:NaN)),e;if(d.s!=e.s)return e.s=-e.s,d.minus(e);if(l=d.d,u=e.d,s=f.precision,c=f.rounding,!l[0]||!u[0])return u[0]||(e=new f(d)),I?G(e,s,c):e;if(a=L(d.e/B),r=L(e.e/B),l=l.slice(),i=a-r,i){for(i<0?(n=l,i=-i,o=u.length):(n=u,r=a,o=l.length),a=Math.ceil(s/B),o=a>o?a+1:o+1,i>o&&(i=o,n.length=1),n.reverse();i--;)n.push(0);n.reverse()}for(o=l.length,i=u.length,o-i<0&&(i=o,n=u,u=l,l=n),t=0;i;)t=(l[--i]=l[i]+u[i]+t)/z|0,l[i]%=z;for(t&&(l.unshift(t),++r),o=l.length;l[--o]==0;)l.pop();return e.d=l,e.e=Zr(l,r),I?G(e,s,c):e},V.precision=V.sd=function(e){var t,n=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(Lr+e);return n.d?(t=$r(n.d),e&&n.e+1>t&&(t=n.e+1)):t=NaN,t},V.round=function(){var e=this,t=e.constructor;return G(new t(e),e.e+1,t.rounding)},V.sine=V.sin=function(){var e,t,n=this,r=n.constructor;return n.isFinite()?n.isZero()?new r(n):(e=r.precision,t=r.rounding,r.precision=e+Math.max(n.e,n.sd())+B,r.rounding=1,n=li(r,fi(r,n)),r.precision=e,r.rounding=t,G(Fr>2?n.neg():n,e,t,!0)):new r(NaN)},V.squareRoot=V.sqrt=function(){var e,t,n,r,i,a,o=this,s=o.d,c=o.e,l=o.s,u=o.constructor;if(l!==1||!s||!s[0])return new u(!l||l<0&&(!s||s[0])?NaN:s?o:1/0);for(I=!1,l=Math.sqrt(+o),l==0||l==1/0?(t=H(s),(t.length+c)%2==0&&(t+=`0`),l=Math.sqrt(t),c=L((c+1)/2)-(c<0||c%2),l==1/0?t=`5e`+c:(t=l.toExponential(),t=t.slice(0,t.indexOf(`e`)+1)+c),r=new u(t)):r=new u(l.toString()),n=(c=u.precision)+3;;)if(a=r,r=a.plus(W(o,a,n+2,1)).times(.5),H(a.d).slice(0,n)===(t=H(r.d)).slice(0,n))if(t=t.slice(n-3,n+1),t==`9999`||!i&&t==`4999`){if(!i&&(G(a,c+1,0),a.times(a).eq(o))){r=a;break}n+=4,i=1}else{(!+t||!+t.slice(1)&&t.charAt(0)==`5`)&&(G(r,c+1,1),e=!r.times(r).eq(o));break}return I=!0,G(r,c,u.rounding,e)},V.tangent=V.tan=function(){var e,t,n=this,r=n.constructor;return n.isFinite()?n.isZero()?new r(n):(e=r.precision,t=r.rounding,r.precision=e+10,r.rounding=1,n=n.sin(),n.s=1,n=W(n,new r(1).minus(n.times(n)).sqrt(),e+10,0),r.precision=e,r.rounding=t,G(Fr==2||Fr==4?n.neg():n,e,t,!0)):new r(NaN)},V.times=V.mul=function(e){var t,n,r,i,a,o,s,c,l,u=this,d=u.constructor,f=u.d,p=(e=new d(e)).d;if(e.s*=u.s,!f||!f[0]||!p||!p[0])return new d(!e.s||f&&!f[0]&&!p||p&&!p[0]&&!f?NaN:!f||!p?e.s/0:e.s*0);for(n=L(u.e/B)+L(e.e/B),c=f.length,l=p.length,c<l&&(a=f,f=p,p=a,o=c,c=l,l=o),a=[],o=c+l,r=o;r--;)a.push(0);for(r=l;--r>=0;){for(t=0,i=c+r;i>r;)s=a[i]+p[r]*f[i-r-1]+t,a[i--]=s%z|0,t=s/z|0;a[i]=(a[i]+t)%z|0}for(;!a[--o];)a.pop();return t?++n:a.shift(),e.d=a,e.e=Zr(a,n),I?G(e,d.precision,d.rounding):e},V.toBinary=function(e,t){return pi(this,2,e,t)},V.toDecimalPlaces=V.toDP=function(e,t){var n=this,r=n.constructor;return n=new r(n),e===void 0?n:(U(e,0,kr),t===void 0?t=r.rounding:U(t,0,8),G(n,e+n.e+1,t))},V.toExponential=function(e,t){var n,r=this,i=r.constructor;return e===void 0?n=K(r,!0):(U(e,0,kr),t===void 0?t=i.rounding:U(t,0,8),r=G(new i(r),e+1,t),n=K(r,!0,e+1)),r.isNeg()&&!r.isZero()?`-`+n:n},V.toFixed=function(e,t){var n,r,i=this,a=i.constructor;return e===void 0?n=K(i):(U(e,0,kr),t===void 0?t=a.rounding:U(t,0,8),r=G(new a(i),e+i.e+1,t),n=K(r,!1,e+r.e+1)),i.isNeg()&&!i.isZero()?`-`+n:n},V.toFraction=function(e){var t,n,r,i,a,o,s,c,l,u,d,f,p=this,m=p.d,h=p.constructor;if(!m)return new h(p);if(l=n=new h(1),r=c=new h(0),t=new h(r),a=t.e=$r(m)-p.e-1,o=a%B,t.d[0]=R(10,o<0?B+o:o),e==null)e=a>0?t:l;else{if(s=new h(e),!s.isInt()||s.lt(l))throw Error(Lr+s);e=s.gt(t)?a>0?t:l:s}for(I=!1,s=new h(H(m)),u=h.precision,h.precision=a=m.length*B*2;d=W(s,t,0,1,1),i=n.plus(d.times(r)),i.cmp(e)!=1;)n=r,r=i,i=l,l=c.plus(d.times(i)),c=i,i=t,t=s.minus(d.times(i)),s=i;return i=W(e.minus(n),r,0,1,1),c=c.plus(i.times(l)),n=n.plus(i.times(r)),c.s=l.s=p.s,f=W(l,r,a,1).minus(p).abs().cmp(W(c,n,a,1).minus(p).abs())<1?[l,r]:[c,n],h.precision=u,I=!0,f},V.toHexadecimal=V.toHex=function(e,t){return pi(this,16,e,t)},V.toNearest=function(e,t){var n=this,r=n.constructor;if(n=new r(n),e==null){if(!n.d)return n;e=new r(1),t=r.rounding}else{if(e=new r(e),t===void 0?t=r.rounding:U(t,0,8),!n.d)return e.s?n:e;if(!e.d)return e.s&&=n.s,e}return e.d[0]?(I=!1,n=W(n,e,0,t,1).times(e),I=!0,G(n)):(e.s=n.s,n=e),n},V.toNumber=function(){return+this},V.toOctal=function(e,t){return pi(this,8,e,t)},V.toPower=V.pow=function(e){var t,n,r,i,a,o,s=this,c=s.constructor,l=+(e=new c(e));if(!s.d||!e.d||!s.d[0]||!e.d[0])return new c(R(+s,l));if(s=new c(s),s.eq(1))return s;if(r=c.precision,a=c.rounding,e.eq(1))return G(s,r,a);if(t=L(e.e/B),t>=e.d.length-1&&(n=l<0?-l:l)<=Gr)return i=ti(c,s,n,r),e.s<0?new c(1).div(i):G(i,r,a);if(o=s.s,o<0){if(t<e.d.length-1)return new c(NaN);if(e.d[t]&1||(o=1),s.e==0&&s.d[0]==1&&s.d.length==1)return s.s=o,s}return n=R(+s,l),t=n==0||!isFinite(n)?L(l*(Math.log(`0.`+H(s.d))/Math.LN10+s.e+1)):new c(n+``).e,t>c.maxE+1||t<c.minE-1?new c(t>0?o/0:0):(I=!1,c.rounding=s.s=1,n=Math.min(12,(t+``).length),i=ii(e.times(ai(s,r+n)),r),i.d&&(i=G(i,r+5,1),Jr(i.d,r,a)&&(t=r+10,i=G(ii(e.times(ai(s,t+n)),t),t+5,1),+H(i.d).slice(r+1,r+15)+1==0x5af3107a4000&&(i=G(i,r+1,0)))),i.s=o,I=!0,c.rounding=a,G(i,r,a))},V.toPrecision=function(e,t){var n,r=this,i=r.constructor;return e===void 0?n=K(r,r.e<=i.toExpNeg||r.e>=i.toExpPos):(U(e,1,kr),t===void 0?t=i.rounding:U(t,0,8),r=G(new i(r),e,t),n=K(r,e<=r.e||r.e<=i.toExpNeg,e)),r.isNeg()&&!r.isZero()?`-`+n:n},V.toSignificantDigits=V.toSD=function(e,t){var n=this,r=n.constructor;return e===void 0?(e=r.precision,t=r.rounding):(U(e,1,kr),t===void 0?t=r.rounding:U(t,0,8)),G(new r(n),e,t)},V.toString=function(){var e=this,t=e.constructor,n=K(e,e.e<=t.toExpNeg||e.e>=t.toExpPos);return e.isNeg()&&!e.isZero()?`-`+n:n},V.truncated=V.trunc=function(){return G(new this.constructor(this),this.e+1,1)},V.valueOf=V.toJSON=function(){var e=this,t=e.constructor,n=K(e,e.e<=t.toExpNeg||e.e>=t.toExpPos);return e.isNeg()?`-`+n:n};function H(e){var t,n,r,i=e.length-1,a=``,o=e[0];if(i>0){for(a+=o,t=1;t<i;t++)r=e[t]+``,n=B-r.length,n&&(a+=ei(n)),a+=r;o=e[t],r=o+``,n=B-r.length,n&&(a+=ei(n))}else if(o===0)return`0`;for(;o%10==0;)o/=10;return a+o}function U(e,t,n){if(e!==~~e||e<t||e>n)throw Error(Lr+e)}function Jr(e,t,n,r){var i,a,o,s;for(a=e[0];a>=10;a/=10)--t;return--t<0?(t+=B,i=0):(i=Math.ceil((t+1)/B),t%=B),a=R(10,B-t),s=e[i]%a|0,r==null?t<3?(t==0?s=s/100|0:t==1&&(s=s/10|0),o=n<4&&s==99999||n>3&&s==49999||s==5e4||s==0):o=(n<4&&s+1==a||n>3&&s+1==a/2)&&(e[i+1]/a/100|0)==R(10,t-2)-1||(s==a/2||s==0)&&(e[i+1]/a/100|0)==0:t<4?(t==0?s=s/1e3|0:t==1?s=s/100|0:t==2&&(s=s/10|0),o=(r||n<4)&&s==9999||!r&&n>3&&s==4999):o=((r||n<4)&&s+1==a||!r&&n>3&&s+1==a/2)&&(e[i+1]/a/1e3|0)==R(10,t-3)-1,o}function Yr(e,t,n){for(var r,i=[0],a,o=0,s=e.length;o<s;){for(a=i.length;a--;)i[a]*=t;for(i[0]+=Ar.indexOf(e.charAt(o++)),r=0;r<i.length;r++)i[r]>n-1&&(i[r+1]===void 0&&(i[r+1]=0),i[r+1]+=i[r]/n|0,i[r]%=n)}return i.reverse()}function Xr(e,t){var n,r,i;if(t.isZero())return t;r=t.d.length,r<32?(n=Math.ceil(r/3),i=(1/di(4,n)).toString()):(n=16,i=`2.3283064365386962890625e-10`),e.precision+=n,t=ui(e,1,t.times(i),new e(1));for(var a=n;a--;){var o=t.times(t);t=o.times(o).minus(o).times(8).plus(1)}return e.precision-=n,t}var W=(function(){function e(e,t,n){var r,i=0,a=e.length;for(e=e.slice();a--;)r=e[a]*t+i,e[a]=r%n|0,i=r/n|0;return i&&e.unshift(i),e}function t(e,t,n,r){var i,a;if(n!=r)a=n>r?1:-1;else for(i=a=0;i<n;i++)if(e[i]!=t[i]){a=e[i]>t[i]?1:-1;break}return a}function n(e,t,n,r){for(var i=0;n--;)e[n]-=i,i=e[n]<t[n]?1:0,e[n]=i*r+e[n]-t[n];for(;!e[0]&&e.length>1;)e.shift()}return function(r,i,a,o,s,c){var l,u,d,f,p,m,h,g,_,v,y,b,x,S,ee,te,ne,C,w,re,ie=r.constructor,ae=r.s==i.s?1:-1,T=r.d,E=i.d;if(!T||!T[0]||!E||!E[0])return new ie(!r.s||!i.s||(T?E&&T[0]==E[0]:!E)?NaN:T&&T[0]==0||!E?ae*0:ae/0);for(c?(p=1,u=r.e-i.e):(c=z,p=B,u=L(r.e/p)-L(i.e/p)),w=E.length,ne=T.length,_=new ie(ae),v=_.d=[],d=0;E[d]==(T[d]||0);d++);if(E[d]>(T[d]||0)&&u--,a==null?(S=a=ie.precision,o=ie.rounding):S=s?a+(r.e-i.e)+1:a,S<0)v.push(1),m=!0;else{if(S=S/p+2|0,d=0,w==1){for(f=0,E=E[0],S++;(d<ne||f)&&S--;d++)ee=f*c+(T[d]||0),v[d]=ee/E|0,f=ee%E|0;m=f||d<ne}else{for(f=c/(E[0]+1)|0,f>1&&(E=e(E,f,c),T=e(T,f,c),w=E.length,ne=T.length),te=w,y=T.slice(0,w),b=y.length;b<w;)y[b++]=0;re=E.slice(),re.unshift(0),C=E[0],E[1]>=c/2&&++C;do f=0,l=t(E,y,w,b),l<0?(x=y[0],w!=b&&(x=x*c+(y[1]||0)),f=x/C|0,f>1?(f>=c&&(f=c-1),h=e(E,f,c),g=h.length,b=y.length,l=t(h,y,g,b),l==1&&(f--,n(h,w<g?re:E,g,c))):(f==0&&(l=f=1),h=E.slice()),g=h.length,g<b&&h.unshift(0),n(y,h,b,c),l==-1&&(b=y.length,l=t(E,y,w,b),l<1&&(f++,n(y,w<b?re:E,b,c))),b=y.length):l===0&&(f++,y=[0]),v[d++]=f,l&&y[0]?y[b++]=T[te]||0:(y=[T[te]],b=1);while((te++<ne||y[0]!==void 0)&&S--);m=y[0]!==void 0}v[0]||v.shift()}if(p==1)_.e=u,Pr=m;else{for(d=1,f=v[0];f>=10;f/=10)d++;_.e=d+u*p-1,G(_,s?a+_.e+1:a,o,m)}return _}})();function G(e,t,n,r){var i,a,o,s,c,l,u,d,f,p=e.constructor;out:if(t!=null){if(d=e.d,!d)return e;for(i=1,s=d[0];s>=10;s/=10)i++;if(a=t-i,a<0)a+=B,o=t,u=d[f=0],c=u/R(10,i-o-1)%10|0;else if(f=Math.ceil((a+1)/B),s=d.length,f>=s)if(r){for(;s++<=f;)d.push(0);u=c=0,i=1,a%=B,o=a-B+1}else break out;else{for(u=s=d[f],i=1;s>=10;s/=10)i++;a%=B,o=a-B+i,c=o<0?0:u/R(10,i-o-1)%10|0}if(r=r||t<0||d[f+1]!==void 0||(o<0?u:u%R(10,i-o-1)),l=n<4?(c||r)&&(n==0||n==(e.s<0?3:2)):c>5||c==5&&(n==4||r||n==6&&(a>0?o>0?u/R(10,i-o):0:d[f-1])%10&1||n==(e.s<0?8:7)),t<1||!d[0])return d.length=0,l?(t-=e.e+1,d[0]=R(10,(B-t%B)%B),e.e=-t||0):d[0]=e.e=0,e;if(a==0?(d.length=f,s=1,f--):(d.length=f+1,s=R(10,B-a),d[f]=o>0?(u/R(10,i-o)%R(10,o)|0)*s:0),l)for(;;)if(f==0){for(a=1,o=d[0];o>=10;o/=10)a++;for(o=d[0]+=s,s=1;o>=10;o/=10)s++;a!=s&&(e.e++,d[0]==z&&(d[0]=1));break}else{if(d[f]+=s,d[f]!=z)break;d[f--]=0,s=1}for(a=d.length;d[--a]===0;)d.pop()}return I&&(e.e>p.maxE?(e.d=null,e.e=NaN):e.e<p.minE&&(e.e=0,e.d=[0])),e}function K(e,t,n){if(!e.isFinite())return oi(e);var r,i=e.e,a=H(e.d),o=a.length;return t?(n&&(r=n-o)>0?a=a.charAt(0)+`.`+a.slice(1)+ei(r):o>1&&(a=a.charAt(0)+`.`+a.slice(1)),a=a+(e.e<0?`e`:`e+`)+e.e):i<0?(a=`0.`+ei(-i-1)+a,n&&(r=n-o)>0&&(a+=ei(r))):i>=o?(a+=ei(i+1-o),n&&(r=n-i-1)>0&&(a=a+`.`+ei(r))):((r=i+1)<o&&(a=a.slice(0,r)+`.`+a.slice(r)),n&&(r=n-o)>0&&(i+1===o&&(a+=`.`),a+=ei(r))),a}function Zr(e,t){var n=e[0];for(t*=B;n>=10;n/=10)t++;return t}function Qr(e,t,n){if(t>Kr)throw I=!0,n&&(e.precision=n),Error(Rr);return G(new e(jr),t,1,!0)}function q(e,t,n){if(t>qr)throw Error(Rr);return G(new e(Mr),t,n,!0)}function $r(e){var t=e.length-1,n=t*B+1;if(t=e[t],t){for(;t%10==0;t/=10)n--;for(t=e[0];t>=10;t/=10)n++}return n}function ei(e){for(var t=``;e--;)t+=`0`;return t}function ti(e,t,n,r){var i,a=new e(1),o=Math.ceil(r/B+4);for(I=!1;;){if(n%2&&(a=a.times(t),mi(a.d,o)&&(i=!0)),n=L(n/2),n===0){n=a.d.length-1,i&&a.d[n]===0&&++a.d[n];break}t=t.times(t),mi(t.d,o)}return I=!0,a}function ni(e){return e.d[e.d.length-1]&1}function ri(e,t,n){for(var r,i,a=new e(t[0]),o=0;++o<t.length;){if(i=new e(t[o]),!i.s){a=i;break}r=a.cmp(i),(r===n||r===0&&a.s===n)&&(a=i)}return a}function ii(e,t){var n,r,i,a,o,s,c,l=0,u=0,d=0,f=e.constructor,p=f.rounding,m=f.precision;if(!e.d||!e.d[0]||e.e>17)return new f(e.d?e.d[0]?e.s<0?0:1/0:1:e.s?e.s<0?0:e:NaN);for(t==null?(I=!1,c=m):c=t,s=new f(.03125);e.e>-2;)e=e.times(s),d+=5;for(r=Math.log(R(2,d))/Math.LN10*2+5|0,c+=r,n=a=o=new f(1),f.precision=c;;){if(a=G(a.times(e),c,1),n=n.times(++u),s=o.plus(W(a,n,c,1)),H(s.d).slice(0,c)===H(o.d).slice(0,c)){for(i=d;i--;)o=G(o.times(o),c,1);if(t==null)if(l<3&&Jr(o.d,c-r,p,l))f.precision=c+=10,n=a=s=new f(1),u=0,l++;else return G(o,f.precision=m,p,I=!0);else return f.precision=m,o}o=s}}function ai(e,t){var n,r,i,a,o,s,c,l,u,d,f,p=1,m=10,h=e,g=h.d,_=h.constructor,v=_.rounding,y=_.precision;if(h.s<0||!g||!g[0]||!h.e&&g[0]==1&&g.length==1)return new _(g&&!g[0]?-1/0:h.s==1?g?0:h:NaN);if(t==null?(I=!1,u=y):u=t,_.precision=u+=m,n=H(g),r=n.charAt(0),Math.abs(a=h.e)<0x5543df729c000){for(;r<7&&r!=1||r==1&&n.charAt(1)>3;)h=h.times(e),n=H(h.d),r=n.charAt(0),p++;a=h.e,r>1?(h=new _(`0.`+n),a++):h=new _(r+`.`+n.slice(1))}else return l=Qr(_,u+2,y).times(a+``),h=ai(new _(r+`.`+n.slice(1)),u-m).plus(l),_.precision=y,t==null?G(h,y,v,I=!0):h;for(d=h,c=o=h=W(h.minus(1),h.plus(1),u,1),f=G(h.times(h),u,1),i=3;;){if(o=G(o.times(f),u,1),l=c.plus(W(o,new _(i),u,1)),H(l.d).slice(0,u)===H(c.d).slice(0,u))if(c=c.times(2),a!==0&&(c=c.plus(Qr(_,u+2,y).times(a+``))),c=W(c,new _(p),u,1),t==null)if(Jr(c.d,u-m,v,s))_.precision=u+=m,l=o=h=W(d.minus(1),d.plus(1),u,1),f=G(h.times(h),u,1),i=s=1;else return G(c,_.precision=y,v,I=!0);else return _.precision=y,c;c=l,i+=2}}function oi(e){return String(e.s*e.s/0)}function si(e,t){var n,r,i;for((n=t.indexOf(`.`))>-1&&(t=t.replace(`.`,``)),(r=t.search(/e/i))>0?(n<0&&(n=r),n+=+t.slice(r+1),t=t.substring(0,r)):n<0&&(n=t.length),r=0;t.charCodeAt(r)===48;r++);for(i=t.length;t.charCodeAt(i-1)===48;--i);if(t=t.slice(r,i),t){if(i-=r,e.e=n=n-r-1,e.d=[],r=(n+1)%B,n<0&&(r+=B),r<i){for(r&&e.d.push(+t.slice(0,r)),i-=B;r<i;)e.d.push(+t.slice(r,r+=B));t=t.slice(r),r=B-t.length}else r-=i;for(;r--;)t+=`0`;e.d.push(+t),I&&(e.e>e.constructor.maxE?(e.d=null,e.e=NaN):e.e<e.constructor.minE&&(e.e=0,e.d=[0]))}else e.e=0,e.d=[0];return e}function ci(e,t){var n,r,i,a,o,s,c,l,u;if(t.indexOf(`_`)>-1){if(t=t.replace(/(\d)_(?=\d)/g,`$1`),Wr.test(t))return si(e,t)}else if(t===`Infinity`||t===`NaN`)return+t||(e.s=NaN),e.e=NaN,e.d=null,e;if(Hr.test(t))n=16,t=t.toLowerCase();else if(Vr.test(t))n=2;else if(Ur.test(t))n=8;else throw Error(Lr+t);for(a=t.search(/p/i),a>0?(c=+t.slice(a+1),t=t.substring(2,a)):t=t.slice(2),a=t.indexOf(`.`),o=a>=0,r=e.constructor,o&&(t=t.replace(`.`,``),s=t.length,a=s-a,i=ti(r,new r(n),a,a*2)),l=Yr(t,n,z),u=l.length-1,a=u;l[a]===0;--a)l.pop();return a<0?new r(e.s*0):(e.e=Zr(l,u),e.d=l,I=!1,o&&(e=W(e,i,s*4)),c&&(e=e.times(Math.abs(c)<54?R(2,c):na.pow(2,c))),I=!0,e)}function li(e,t){var n,r=t.d.length;if(r<3)return t.isZero()?t:ui(e,2,t,t);n=1.4*Math.sqrt(r),n=n>16?16:n|0,t=t.times(1/di(5,n)),t=ui(e,2,t,t);for(var i,a=new e(5),o=new e(16),s=new e(20);n--;)i=t.times(t),t=t.times(a.plus(i.times(o.times(i).minus(s))));return t}function ui(e,t,n,r,i){var a,o,s,c,l=1,u=e.precision,d=Math.ceil(u/B);for(I=!1,c=n.times(n),s=new e(r);;){if(o=W(s.times(c),new e(t++*t++),u,1),s=i?r.plus(o):r.minus(o),r=W(o.times(c),new e(t++*t++),u,1),o=s.plus(r),o.d[d]!==void 0){for(a=d;o.d[a]===s.d[a]&&a--;);if(a==-1)break}a=s,s=r,r=o,o=a,l++}return I=!0,o.d.length=d+1,o}function di(e,t){for(var n=e;--t;)n*=e;return n}function fi(e,t){var n,r=t.s<0,i=q(e,e.precision,1),a=i.times(.5);if(t=t.abs(),t.lte(a))return Fr=r?4:1,t;if(n=t.divToInt(i),n.isZero())Fr=r?3:2;else{if(t=t.minus(n.times(i)),t.lte(a))return Fr=ni(n)?r?2:3:r?4:1,t;Fr=ni(n)?r?1:4:r?3:2}return t.minus(i).abs()}function pi(e,t,n,r){var i,a,o,s,c,l,u,d,f,p=e.constructor,m=n!==void 0;if(m?(U(n,1,kr),r===void 0?r=p.rounding:U(r,0,8)):(n=p.precision,r=p.rounding),!e.isFinite())u=oi(e);else{for(u=K(e),o=u.indexOf(`.`),m?(i=2,t==16?n=n*4-3:t==8&&(n=n*3-2)):i=t,o>=0&&(u=u.replace(`.`,``),f=new p(1),f.e=u.length-o,f.d=Yr(K(f),10,i),f.e=f.d.length),d=Yr(u,10,i),a=c=d.length;d[--c]==0;)d.pop();if(!d[0])u=m?`0p+0`:`0`;else{if(o<0?a--:(e=new p(e),e.d=d,e.e=a,e=W(e,f,n,r,0,i),d=e.d,a=e.e,l=Pr),o=d[n],s=i/2,l||=d[n+1]!==void 0,l=r<4?(o!==void 0||l)&&(r===0||r===(e.s<0?3:2)):o>s||o===s&&(r===4||l||r===6&&d[n-1]&1||r===(e.s<0?8:7)),d.length=n,l)for(;++d[--n]>i-1;)d[n]=0,n||(++a,d.unshift(1));for(c=d.length;!d[c-1];--c);for(o=0,u=``;o<c;o++)u+=Ar.charAt(d[o]);if(m){if(c>1)if(t==16||t==8){for(o=t==16?4:3,--c;c%o;c++)u+=`0`;for(d=Yr(u,i,t),c=d.length;!d[c-1];--c);for(o=1,u=`1.`;o<c;o++)u+=Ar.charAt(d[o])}else u=u.charAt(0)+`.`+u.slice(1);u=u+(a<0?`p`:`p+`)+a}else if(a<0){for(;++a;)u=`0`+u;u=`0.`+u}else if(++a>c)for(a-=c;a--;)u+=`0`;else a<c&&(u=u.slice(0,a)+`.`+u.slice(a))}u=(t==16?`0x`:t==2?`0b`:t==8?`0o`:``)+u}return e.s<0?`-`+u:u}function mi(e,t){if(e.length>t)return e.length=t,!0}function hi(e){return new this(e).abs()}function gi(e){return new this(e).acos()}function _i(e){return new this(e).acosh()}function vi(e,t){return new this(e).plus(t)}function yi(e){return new this(e).asin()}function bi(e){return new this(e).asinh()}function xi(e){return new this(e).atan()}function Si(e){return new this(e).atanh()}function Ci(e,t){e=new this(e),t=new this(t);var n,r=this.precision,i=this.rounding,a=r+4;return!e.s||!t.s?n=new this(NaN):!e.d&&!t.d?(n=q(this,a,1).times(t.s>0?.25:.75),n.s=e.s):!t.d||e.isZero()?(n=t.s<0?q(this,r,i):new this(0),n.s=e.s):!e.d||t.isZero()?(n=q(this,a,1).times(.5),n.s=e.s):t.s<0?(this.precision=a,this.rounding=1,n=this.atan(W(e,t,a,1)),t=q(this,a,1),this.precision=r,this.rounding=i,n=e.s<0?n.minus(t):n.plus(t)):n=this.atan(W(e,t,a,1)),n}function wi(e){return new this(e).cbrt()}function Ti(e){return G(e=new this(e),e.e+1,2)}function Ei(e,t,n){return new this(e).clamp(t,n)}function Di(e){if(!e||typeof e!=`object`)throw Error(Ir+`Object expected`);var t,n,r,i=e.defaults===!0,a=[`precision`,1,kr,`rounding`,0,8,`toExpNeg`,-Or,0,`toExpPos`,0,Or,`maxE`,0,Or,`minE`,-Or,0,`modulo`,0,9];for(t=0;t<a.length;t+=3)if(n=a[t],i&&(this[n]=Nr[n]),(r=e[n])!==void 0)if(L(r)===r&&r>=a[t+1]&&r<=a[t+2])this[n]=r;else throw Error(Lr+n+`: `+r);if(n=`crypto`,i&&(this[n]=Nr[n]),(r=e[n])!==void 0)if(r===!0||r===!1||r===0||r===1)if(r)if(typeof crypto<`u`&&crypto&&(crypto.getRandomValues||crypto.randomBytes))this[n]=!0;else throw Error(zr);else this[n]=!1;else throw Error(Lr+n+`: `+r);return this}function Oi(e){return new this(e).cos()}function ki(e){return new this(e).cosh()}function Ai(e){var t,n,r;function i(e){var t,n,r,a=this;if(!(a instanceof i))return new i(e);if(a.constructor=i,Fi(e)){a.s=e.s,I?!e.d||e.e>i.maxE?(a.e=NaN,a.d=null):e.e<i.minE?(a.e=0,a.d=[0]):(a.e=e.e,a.d=e.d.slice()):(a.e=e.e,a.d=e.d?e.d.slice():e.d);return}if(r=typeof e,r===`number`){if(e===0){a.s=1/e<0?-1:1,a.e=0,a.d=[0];return}if(e<0?(e=-e,a.s=-1):a.s=1,e===~~e&&e<1e7){for(t=0,n=e;n>=10;n/=10)t++;I?t>i.maxE?(a.e=NaN,a.d=null):t<i.minE?(a.e=0,a.d=[0]):(a.e=t,a.d=[e]):(a.e=t,a.d=[e]);return}if(e*0!=0){e||(a.s=NaN),a.e=NaN,a.d=null;return}return si(a,e.toString())}if(r===`string`)return(n=e.charCodeAt(0))===45?(e=e.slice(1),a.s=-1):(n===43&&(e=e.slice(1)),a.s=1),Wr.test(e)?si(a,e):ci(a,e);if(r===`bigint`)return e<0?(e=-e,a.s=-1):a.s=1,si(a,e.toString());throw Error(Lr+e)}if(i.prototype=V,i.ROUND_UP=0,i.ROUND_DOWN=1,i.ROUND_CEIL=2,i.ROUND_FLOOR=3,i.ROUND_HALF_UP=4,i.ROUND_HALF_DOWN=5,i.ROUND_HALF_EVEN=6,i.ROUND_HALF_CEIL=7,i.ROUND_HALF_FLOOR=8,i.EUCLID=9,i.config=i.set=Di,i.clone=Ai,i.isDecimal=Fi,i.abs=hi,i.acos=gi,i.acosh=_i,i.add=vi,i.asin=yi,i.asinh=bi,i.atan=xi,i.atanh=Si,i.atan2=Ci,i.cbrt=wi,i.ceil=Ti,i.clamp=Ei,i.cos=Oi,i.cosh=ki,i.div=ji,i.exp=Mi,i.floor=Ni,i.hypot=Pi,i.ln=Ii,i.log=Li,i.log10=zi,i.log2=Ri,i.max=Bi,i.min=Vi,i.mod=Hi,i.mul=Ui,i.pow=Wi,i.random=Gi,i.round=Ki,i.sign=qi,i.sin=Ji,i.sinh=Yi,i.sqrt=Xi,i.sub=Zi,i.sum=Qi,i.tan=$i,i.tanh=ea,i.trunc=ta,e===void 0&&(e={}),e&&e.defaults!==!0)for(r=[`precision`,`rounding`,`toExpNeg`,`toExpPos`,`maxE`,`minE`,`modulo`,`crypto`],t=0;t<r.length;)e.hasOwnProperty(n=r[t++])||(e[n]=this[n]);return i.config(e),i}function ji(e,t){return new this(e).div(t)}function Mi(e){return new this(e).exp()}function Ni(e){return G(e=new this(e),e.e+1,3)}function Pi(){var e,t,n=new this(0);for(I=!1,e=0;e<arguments.length;)if(t=new this(arguments[e++]),t.d)n.d&&(n=n.plus(t.times(t)));else{if(t.s)return I=!0,new this(1/0);n=t}return I=!0,n.sqrt()}function Fi(e){return e instanceof na||e&&e.toStringTag===Br||!1}function Ii(e){return new this(e).ln()}function Li(e,t){return new this(e).log(t)}function Ri(e){return new this(e).log(2)}function zi(e){return new this(e).log(10)}function Bi(){return ri(this,arguments,-1)}function Vi(){return ri(this,arguments,1)}function Hi(e,t){return new this(e).mod(t)}function Ui(e,t){return new this(e).mul(t)}function Wi(e,t){return new this(e).pow(t)}function Gi(e){var t,n,r,i,a=0,o=new this(1),s=[];if(e===void 0?e=this.precision:U(e,1,kr),r=Math.ceil(e/B),this.crypto)if(crypto.getRandomValues)for(t=crypto.getRandomValues(new Uint32Array(r));a<r;)i=t[a],i>=429e7?t[a]=crypto.getRandomValues(new Uint32Array(1))[0]:s[a++]=i%1e7;else if(crypto.randomBytes){for(t=crypto.randomBytes(r*=4);a<r;)i=t[a]+(t[a+1]<<8)+(t[a+2]<<16)+((t[a+3]&127)<<24),i>=214e7?crypto.randomBytes(4).copy(t,a):(s.push(i%1e7),a+=4);a=r/4}else throw Error(zr);else for(;a<r;)s[a++]=Math.random()*1e7|0;for(r=s[--a],e%=B,r&&e&&(i=R(10,B-e),s[a]=(r/i|0)*i);s[a]===0;a--)s.pop();if(a<0)n=0,s=[0];else{for(n=-1;s[0]===0;n-=B)s.shift();for(r=1,i=s[0];i>=10;i/=10)r++;r<B&&(n-=B-r)}return o.e=n,o.d=s,o}function Ki(e){return G(e=new this(e),e.e+1,this.rounding)}function qi(e){return e=new this(e),e.d?e.d[0]?e.s:0*e.s:e.s||NaN}function Ji(e){return new this(e).sin()}function Yi(e){return new this(e).sinh()}function Xi(e){return new this(e).sqrt()}function Zi(e,t){return new this(e).sub(t)}function Qi(){var e=0,t=arguments,n=new this(t[e]);for(I=!1;n.s&&++e<t.length;)n=n.plus(t[e]);return I=!0,G(n,this.precision,this.rounding)}function $i(e){return new this(e).tan()}function ea(e){return new this(e).tanh()}function ta(e){return G(e=new this(e),e.e+1,1)}V[Symbol.for(`nodejs.util.inspect.custom`)]=V.toString,V[Symbol.toStringTag]=`Decimal`;var na=V.constructor=Ai(Nr);jr=new na(jr),Mr=new na(Mr);var ra=na,ia=`BigNumber`,aa=[`?on`,`config`],oa=or(ia,aa,e=>{var{on:t,config:n}=e,r=ra.clone({precision:n.precision,modulo:ra.EUCLID});return r.prototype=Object.create(r.prototype),r.prototype.type=`BigNumber`,r.prototype.isBigNumber=!0,r.prototype.toJSON=function(){return{mathjs:`BigNumber`,value:this.toString()}},r.fromJSON=function(e){return new r(e.value)},t&&t(`config`,function(e,t){e.precision!==t.precision&&r.config({precision:e.precision})}),r},{isClass:!0});const J=Math.cosh||function(e){return Math.abs(e)<1e-9?1-e:(Math.exp(e)+Math.exp(-e))*.5},Y=Math.sinh||function(e){return Math.abs(e)<1e-9?e:(Math.exp(e)-Math.exp(-e))*.5},sa=e=>{let t=Math.sin(.5*e);return-2*t*t},ca=function(e,t){return e=Math.abs(e),t=Math.abs(t),e<t&&([e,t]=[t,e]),e<1e8?Math.sqrt(e*e+t*t):(t/=e,e*Math.sqrt(1+t*t))},la=function(){throw SyntaxError(`Invalid Param`)};function ua(e,t){let n=Math.abs(e),r=Math.abs(t);return e===0?Math.log(r):t===0?Math.log(n):n<3e3&&r<3e3?Math.log(e*e+t*t)*.5:(e*=.5,t*=.5,.5*Math.log(e*e+t*t)+Math.LN2)}const da={re:0,im:0},fa=function(e,t){let n=da;if(e==null)n.re=n.im=0;else if(t!==void 0)n.re=e,n.im=t;else switch(typeof e){case`object`:if(`im`in e&&`re`in e)n.re=e.re,n.im=e.im;else if(`abs`in e&&`arg`in e){if(!isFinite(e.abs)&&isFinite(e.arg))return X.INFINITY;n.re=e.abs*Math.cos(e.arg),n.im=e.abs*Math.sin(e.arg)}else if(`r`in e&&`phi`in e){if(!isFinite(e.r)&&isFinite(e.phi))return X.INFINITY;n.re=e.r*Math.cos(e.phi),n.im=e.r*Math.sin(e.phi)}else e.length===2?(n.re=e[0],n.im=e[1]):la();break;case`string`:n.im=n.re=0;let t=e.replace(/_/g,``).match(/\d+\.?\d*e[+-]?\d+|\d+\.?\d*|\.\d+|./g),r=1,i=0;t===null&&la();for(let e=0;e<t.length;e++){let a=t[e];a===` `||a===` `||a===`
|
|
117
|
+
`||(a===`+`?r++:a===`-`?i++:a===`i`||a===`I`?(r+i===0&&la(),t[e+1]!==` `&&!isNaN(t[e+1])?(n.im+=parseFloat((i%2?`-`:``)+t[e+1]),e++):n.im+=parseFloat((i%2?`-`:``)+`1`),r=i=0):((r+i===0||isNaN(a))&&la(),t[e+1]===`i`||t[e+1]===`I`?(n.im+=parseFloat((i%2?`-`:``)+a),e++):n.re+=parseFloat((i%2?`-`:``)+a),r=i=0))}r+i>0&&la();break;case`number`:n.im=0,n.re=e;break;default:la()}return isNaN(n.re)||isNaN(n.im),n};function X(e,t){if(!(this instanceof X))return new X(e,t);let n=fa(e,t);this.re=n.re,this.im=n.im}X.prototype={re:0,im:0,sign:function(){let e=ca(this.re,this.im);return new X(this.re/e,this.im/e)},add:function(e,t){let n=fa(e,t),r=this.isInfinite(),i=!(isFinite(n.re)&&isFinite(n.im));return r||i?r&&i?X.NAN:X.INFINITY:new X(this.re+n.re,this.im+n.im)},sub:function(e,t){let n=fa(e,t),r=this.isInfinite(),i=!(isFinite(n.re)&&isFinite(n.im));return r||i?r&&i?X.NAN:X.INFINITY:new X(this.re-n.re,this.im-n.im)},mul:function(e,t){let n=fa(e,t),r=this.isInfinite(),i=!(isFinite(n.re)&&isFinite(n.im)),a=this.re===0&&this.im===0,o=n.re===0&&n.im===0;return r&&o||i&&a?X.NAN:r||i?X.INFINITY:n.im===0&&this.im===0?new X(this.re*n.re,0):new X(this.re*n.re-this.im*n.im,this.re*n.im+this.im*n.re)},div:function(e,t){let n=fa(e,t),r=this.isInfinite(),i=!(isFinite(n.re)&&isFinite(n.im)),a=this.re===0&&this.im===0,o=n.re===0&&n.im===0;if(a&&o||r&&i)return X.NAN;if(o||r)return X.INFINITY;if(a||i)return X.ZERO;if(n.im===0)return new X(this.re/n.re,this.im/n.re);if(Math.abs(n.re)<Math.abs(n.im)){let e=n.re/n.im,t=n.re*e+n.im;return new X((this.re*e+this.im)/t,(this.im*e-this.re)/t)}else{let e=n.im/n.re,t=n.im*e+n.re;return new X((this.re+this.im*e)/t,(this.im-this.re*e)/t)}},pow:function(e,t){let n=fa(e,t),r=this.re===0&&this.im===0;if(n.re===0&&n.im===0)return X.ONE;if(n.im===0){if(this.im===0&&this.re>0)return new X(this.re**+n.re,0);if(this.re===0)switch((n.re%4+4)%4){case 0:return new X(this.im**+n.re,0);case 1:return new X(0,this.im**+n.re);case 2:return new X(-(this.im**+n.re),0);case 3:return new X(0,-(this.im**+n.re))}}if(r&&n.re>0)return X.ZERO;let i=Math.atan2(this.im,this.re),a=ua(this.re,this.im),o=Math.exp(n.re*a-n.im*i),s=n.im*a+n.re*i;return new X(o*Math.cos(s),o*Math.sin(s))},sqrt:function(){let e=this.re,t=this.im;if(t===0)return e>=0?new X(Math.sqrt(e),0):new X(0,Math.sqrt(-e));let n=ca(e,t),r=Math.sqrt(.5*(n+Math.abs(e))),i=Math.abs(t)/(2*r);return e>=0?new X(r,t<0?-i:i):new X(i,t<0?-r:r)},exp:function(){let e=Math.exp(this.re);return this.im===0?new X(e,0):new X(e*Math.cos(this.im),e*Math.sin(this.im))},expm1:function(){let e=this.re,t=this.im;return new X(Math.expm1(e)*Math.cos(t)+sa(t),Math.exp(e)*Math.sin(t))},log:function(){let e=this.re,t=this.im;return t===0&&e>0?new X(Math.log(e),0):new X(ua(e,t),Math.atan2(t,e))},abs:function(){return ca(this.re,this.im)},arg:function(){return Math.atan2(this.im,this.re)},sin:function(){let e=this.re,t=this.im;return new X(Math.sin(e)*J(t),Math.cos(e)*Y(t))},cos:function(){let e=this.re,t=this.im;return new X(Math.cos(e)*J(t),-Math.sin(e)*Y(t))},tan:function(){let e=2*this.re,t=2*this.im,n=Math.cos(e)+J(t);return new X(Math.sin(e)/n,Y(t)/n)},cot:function(){let e=2*this.re,t=2*this.im,n=Math.cos(e)-J(t);return new X(-Math.sin(e)/n,Y(t)/n)},sec:function(){let e=this.re,t=this.im,n=.5*J(2*t)+.5*Math.cos(2*e);return new X(Math.cos(e)*J(t)/n,Math.sin(e)*Y(t)/n)},csc:function(){let e=this.re,t=this.im,n=.5*J(2*t)-.5*Math.cos(2*e);return new X(Math.sin(e)*J(t)/n,-Math.cos(e)*Y(t)/n)},asin:function(){let e=this.re,t=this.im,n=new X(t*t-e*e+1,-2*e*t).sqrt(),r=new X(n.re-t,n.im+e).log();return new X(r.im,-r.re)},acos:function(){let e=this.re,t=this.im,n=new X(t*t-e*e+1,-2*e*t).sqrt(),r=new X(n.re-t,n.im+e).log();return new X(Math.PI/2-r.im,r.re)},atan:function(){let e=this.re,t=this.im;if(e===0){if(t===1)return new X(0,1/0);if(t===-1)return new X(0,-1/0)}let n=e*e+(1-t)*(1-t),r=new X((1-t*t-e*e)/n,-2*e/n).log();return new X(-.5*r.im,.5*r.re)},acot:function(){let e=this.re,t=this.im;if(t===0)return new X(Math.atan2(1,e),0);let n=e*e+t*t;return n===0?new X(e===0?0:e/0,t===0?0:-t/0).atan():new X(e/n,-t/n).atan()},asec:function(){let e=this.re,t=this.im;if(e===0&&t===0)return new X(0,1/0);let n=e*e+t*t;return n===0?new X(e===0?0:e/0,t===0?0:-t/0).acos():new X(e/n,-t/n).acos()},acsc:function(){let e=this.re,t=this.im;if(e===0&&t===0)return new X(Math.PI/2,1/0);let n=e*e+t*t;return n===0?new X(e===0?0:e/0,t===0?0:-t/0).asin():new X(e/n,-t/n).asin()},sinh:function(){let e=this.re,t=this.im;return new X(Y(e)*Math.cos(t),J(e)*Math.sin(t))},cosh:function(){let e=this.re,t=this.im;return new X(J(e)*Math.cos(t),Y(e)*Math.sin(t))},tanh:function(){let e=2*this.re,t=2*this.im,n=J(e)+Math.cos(t);return new X(Y(e)/n,Math.sin(t)/n)},coth:function(){let e=2*this.re,t=2*this.im,n=J(e)-Math.cos(t);return new X(Y(e)/n,-Math.sin(t)/n)},csch:function(){let e=this.re,t=this.im,n=Math.cos(2*t)-J(2*e);return new X(-2*Y(e)*Math.cos(t)/n,2*J(e)*Math.sin(t)/n)},sech:function(){let e=this.re,t=this.im,n=Math.cos(2*t)+J(2*e);return new X(2*J(e)*Math.cos(t)/n,-2*Y(e)*Math.sin(t)/n)},asinh:function(){let e=this.re,t=this.im;if(t===0){if(e===0)return new X(0,0);let t=Math.abs(e),n=Math.log(t+Math.sqrt(t*t+1));return new X(e<0?-n:n,0)}let n=new X(e*e-t*t+1,2*e*t).sqrt();return new X(e+n.re,t+n.im).log()},acosh:function(){let e=this.re,t=this.im;if(t===0){if(e>1)return new X(Math.log(e+Math.sqrt(e-1)*Math.sqrt(e+1)),0);if(e<-1){let t=Math.sqrt(e*e-1);return new X(Math.log(-e+t),Math.PI)}return new X(0,Math.acos(e))}let n=new X(e-1,t).sqrt(),r=new X(e+1,t).sqrt();return new X(e+n.re*r.re-n.im*r.im,t+n.re*r.im+n.im*r.re).log()},atanh:function(){let e=this.re,t=this.im;if(t===0){if(e===0)return new X(0,0);if(e===1)return new X(1/0,0);if(e===-1)return new X(-1/0,0);if(-1<e&&e<1)return new X(.5*Math.log((1+e)/(1-e)),0);if(e>1){let t=(e+1)/(e-1);return new X(.5*Math.log(t),-Math.PI/2)}let t=(1+e)/(1-e);return new X(.5*Math.log(-t),Math.PI/2)}let n=1-e,r=1+e,i=n*n+t*t;if(i===0)return new X(e===-1?0:e/0,t===0?0:t/0);let a=(r*n-t*t)/i,o=(t*n+r*t)/i;return new X(ua(a,o)/2,Math.atan2(o,a)/2)},acoth:function(){let e=this.re,t=this.im;if(e===0&&t===0)return new X(0,Math.PI/2);let n=e*e+t*t;return n===0?new X(e===0?0:e/0,t===0?0:-t/0).atanh():new X(e/n,-t/n).atanh()},acsch:function(){let e=this.re,t=this.im;if(t===0){if(e===0)return new X(1/0,0);let t=1/e;return new X(Math.log(t+Math.sqrt(t*t+1)),0)}let n=e*e+t*t;return n===0?new X(e===0?0:e/0,t===0?0:-t/0).asinh():new X(e/n,-t/n).asinh()},asech:function(){let e=this.re,t=this.im;if(this.isZero())return X.INFINITY;let n=e*e+t*t;return n===0?new X(e===0?0:e/0,t===0?0:-t/0).acosh():new X(e/n,-t/n).acosh()},inverse:function(){if(this.isZero())return X.INFINITY;if(this.isInfinite())return X.ZERO;let e=this.re,t=this.im,n=e*e+t*t;return new X(e/n,-t/n)},conjugate:function(){return new X(this.re,-this.im)},neg:function(){return new X(-this.re,-this.im)},ceil:function(e){return e=10**(e||0),new X(Math.ceil(this.re*e)/e,Math.ceil(this.im*e)/e)},floor:function(e){return e=10**(e||0),new X(Math.floor(this.re*e)/e,Math.floor(this.im*e)/e)},round:function(e){return e=10**(e||0),new X(Math.round(this.re*e)/e,Math.round(this.im*e)/e)},equals:function(e,t){let n=fa(e,t);return Math.abs(n.re-this.re)<=X.EPSILON&&Math.abs(n.im-this.im)<=X.EPSILON},clone:function(){return new X(this.re,this.im)},toString:function(){let e=this.re,t=this.im,n=``;return this.isNaN()?`NaN`:this.isInfinite()?`Infinity`:(Math.abs(e)<X.EPSILON&&(e=0),Math.abs(t)<X.EPSILON&&(t=0),t===0?n+e:(e===0?t<0&&(t=-t,n+=`-`):(n+=e,n+=` `,t<0?(t=-t,n+=`-`):n+=`+`,n+=` `),t!==1&&(n+=t),n+`i`))},toVector:function(){return[this.re,this.im]},valueOf:function(){return this.im===0?this.re:null},isNaN:function(){return isNaN(this.re)||isNaN(this.im)},isZero:function(){return this.im===0&&this.re===0},isFinite:function(){return isFinite(this.re)&&isFinite(this.im)},isInfinite:function(){return!this.isFinite()}},X.ZERO=new X(0,0),X.ONE=new X(1,0),X.I=new X(0,1),X.PI=new X(Math.PI,0),X.E=new X(Math.E,0),X.INFINITY=new X(1/0,1/0),X.NAN=new X(NaN,NaN),X.EPSILON=1e-15;var pa=`Complex`,ma=[],ha=or(pa,ma,()=>(Object.defineProperty(X,`name`,{value:`Complex`}),X.prototype.constructor=X,X.prototype.type=`Complex`,X.prototype.isComplex=!0,X.prototype.toJSON=function(){return{mathjs:`Complex`,re:this.re,im:this.im}},X.prototype.toPolar=function(){return{r:this.abs(),phi:this.arg()}},X.prototype.format=function(e){var t=``,n=this.im,r=this.re,i=vn(this.re,e),a=vn(this.im,e),o=A(e)?e:e?e.precision:null;if(o!==null){var s=10**-o;Math.abs(r/n)<s&&(r=0),Math.abs(n/r)<s&&(n=0)}return t=n===0?i:r===0?n===1?`i`:n===-1?`-i`:a+`i`:n<0?n===-1?i+` - i`:i+` - `+a.substring(1)+`i`:n===1?i+` + i`:i+` + `+a+`i`,t},X.fromPolar=function(e){switch(arguments.length){case 1:var t=arguments[0];if(typeof t==`object`)return X(t);throw TypeError(`Input has to be an object with r and phi keys.`);case 2:var n=arguments[0],r=arguments[1];if(A(n)){if(Tt(r)&&r.hasBase(`ANGLE`)&&(r=r.toNumber(`rad`)),A(r))return new X({r:n,phi:r});throw TypeError(`Phi is not a number nor an angle unit.`)}else throw TypeError(`Radius r is not a number.`);default:throw SyntaxError(`Wrong number of arguments in function fromPolar`)}},X.prototype.valueOf=X.prototype.toString,X.fromJSON=function(e){return new X(e)},X.compare=function(e,t){return e.re>t.re?1:e.re<t.re?-1:e.im>t.im?1:e.im<t.im?-1:0},X),{isClass:!0}),ga=o(((e,t)=>{
|
|
118
118
|
/**
|
|
119
119
|
* @license Fraction.js v4.3.0 20/08/2023
|
|
120
120
|
* https://www.xarg.org/2014/03/rational-numbers-in-javascript/
|
|
@@ -182,7 +182,7 @@ var Or=9e15,kr=1e9,Ar=`0123456789abcdef`,jr=`2.302585092994045684017991454684364
|
|
|
182
182
|
return nil
|
|
183
183
|
`},Lo=async e=>{let{redisClientConfig:t,logger:n,generateUUID:r}=e;try{n?.info({category:`TransportInitialization`,message:`Starting transport system initialization`});let[e,i,a]=await Promise.all([Z.prepare(Ke,{redisClientConfig:t,scripts:Ge,logger:n,additionalArgs:r?[r]:void 0}),Z.prepare(k,{redisClientConfig:t,scripts:Fo,logger:n}),Z.prepare(To,{redisClientConfig:t,scripts:Io,logger:n})]),o=[{name:`ConcurrencyManager`,ready:e.isReady()},{name:`QueueManager`,ready:i.isReady()},{name:`RateLimitManager`,ready:a.isReady()}],s=o.filter(e=>!e.ready);if(s.length>0){let e=s.map(e=>e.name).join(`, `);throw Error(`Failed to initialize managers: ${e}`)}return n?.info({category:`TransportInitialization`,message:`Transport system initialization completed successfully`,context:{initializedManagers:o.map(e=>e.name)}}),{concurrencyManager:e,queueManager:i,rateLimitManager:a}}catch(e){n?.error({category:`TransportInitialization`,message:`Failed to initialize transport system`,code:`TRANSPORT_INIT_ERROR`,error:e});let t=Z.cleanupFailed();throw t>0&&n?.info({category:`TransportInitialization`,message:`Cleaned up ${t} failed singleton instances`}),e}},Ro=e=>{try{e?.info({category:`TransportInitialization`,message:`Starting transport system shutdown`});let t=Z.getIfReady(Ke),n=Z.getIfReady(k),r=Z.getIfReady(To);t?.close(),n?.close(),r?.close(),Z.reset(Ke),Z.reset(k),Z.reset(To),e?.info({category:`TransportInitialization`,message:`Transport system shutdown completed`})}catch(t){e?.error({category:`TransportInitialization`,message:`Error during transport system shutdown`,code:`TRANSPORT_SHUTDOWN_ERROR`,error:t})}},zo=()=>{let e=Z.getIfReady(Ke),t=Z.getIfReady(k),n=Z.getIfReady(To);return!!(e?.isReady()&&t?.isReady()&&n?.isReady())},Bo=()=>{let e=Z.getIfReady(Ke),t=Z.getIfReady(k),n=Z.getIfReady(To);return e&&t&&n?{concurrencyManager:e,queueManager:t,rateLimitManager:n}:null},Vo=e=>typeof e==`object`&&!!e&&`value`in e&&(typeof e.value==`string`||Array.isArray(e.value)),Ho=e=>Array.isArray(e)?e:[e],Uo=e=>Array.isArray(e)?e.map(String):String(e),Wo=(e,t,n)=>{let r=Ho(t);if(Vo(e))return{value:[...Ho(e.value),...r],arrayFormat:n??e.arrayFormat};let i=[...Ho(e),...r];return n?{value:i,arrayFormat:n}:i},Go=(e,t,n)=>{let r=Uo(t);return e===void 0?n?{value:r,arrayFormat:n}:r:Wo(e,r,n)},Ko=(e,t)=>Array.isArray(e)?e.concat(t):typeof e==`object`&&e&&typeof t==`object`&&t?{...e,...t}:t,qo=e=>e.reduce((e,t)=>{if(t.in===`query`){let n=e.query[t.name];e.query[t.name]=Go(n,t.value,t.arrayFormat)}else if(t.in===`body`)if(t.spread)Array.isArray(t.value)?Array.isArray(e.body)?e.body=e.body.concat(t.value):e.body=t.value:typeof t.value==`object`&&t.value!==null&&(e.body={...e.body,...t.value});else{let n=e.body[t.name];e.body[t.name]=Ko(n,t.value)}else e.headers[t.name]=String(t.value);return e},{query:{},body:{},headers:{}}),Jo=[`query`,`body`,`headers`],Yo=[`repeat`,`brackets`,`comma`],Xo=e=>(0,l.notMissing)(e)&&e>=200&&e<=299,Zo=e=>(0,l.notMissing)(e)&&e>=400&&e<=599,Qo=e=>(0,l.notMissing)(e)&&e>=100&&e<=199;var $o=class{async performRequest({httpClient:e,url:t,method:n,headers:r,queryParams:i,body:a,customErrorConfigs:o,requestConfig:s}){let c;try{c=await e?.request({method:n,url:t,headers:r,queryParams:i,maxRedirects:0,payload:a,requestConfig:s})}catch(e){if((0,l.isMissing)(e?.response))throw e;c=e.response}let u=Je(c,o);if(Zo(u?.status))throw new Xe(u,u.message);return u}};const es=`:A-Za-z_\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD`;es+``;const ts=`[`+es+`][:A-Za-z_\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.\\d\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*`,ns=RegExp(`^[:A-Za-z_\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Za-z_\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.\\d\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$`);function rs(e,t){let n=[],r=t.exec(e);for(;r;){let i=[];i.startIndex=t.lastIndex-r[0].length;let a=r.length;for(let e=0;e<a;e++)i.push(r[e]);n.push(i),r=t.exec(e)}return n}const is=function(e){return ns.exec(e)!=null};function as(e){return e!==void 0}const os={allowBooleanAttributes:!1,unpairedTags:[]};function ss(e,t){t=Object.assign({},os,t);let n=[],r=!1,i=!1;e[0]===``&&(e=e.substr(1));for(let a=0;a<e.length;a++)if(e[a]===`<`&&e[a+1]===`?`){if(a+=2,a=ls(e,a),a.err)return a}else if(e[a]===`<`){let o=a;if(a++,e[a]===`!`){a=us(e,a);continue}else{let s=!1;e[a]===`/`&&(s=!0,a++);let c=``;for(;a<e.length&&e[a]!==`>`&&e[a]!==` `&&e[a]!==` `&&e[a]!==`
|
|
184
184
|
`&&e[a]!==`\r`;a++)c+=e[a];if(c=c.trim(),c[c.length-1]===`/`&&(c=c.substring(0,c.length-1),a--),!ys(c)){let t;return t=c.trim().length===0?`Invalid space after '<'.`:`Tag '`+c+`' is an invalid name.`,Q(`InvalidTag`,t,$(e,a))}let l=ps(e,a);if(l===!1)return Q(`InvalidAttr`,`Attributes for '`+c+`' have open quote.`,$(e,a));let u=l.value;if(a=l.index,u[u.length-1]===`/`){let n=a-u.length;u=u.substring(0,u.length-1);let i=hs(u,t);if(i===!0)r=!0;else return Q(i.err.code,i.err.msg,$(e,n+i.err.line))}else if(s)if(l.tagClosed){if(u.trim().length>0)return Q(`InvalidTag`,`Closing tag '`+c+`' can't have attributes or invalid starting.`,$(e,o));if(n.length===0)return Q(`InvalidTag`,`Closing tag '`+c+`' has not been opened.`,$(e,o));{let t=n.pop();if(c!==t.tagName){let n=$(e,t.tagStartPos);return Q(`InvalidTag`,`Expected closing tag '`+t.tagName+`' (opened in line `+n.line+`, col `+n.col+`) instead of closing tag '`+c+`'.`,$(e,o))}n.length==0&&(i=!0)}}else return Q(`InvalidTag`,`Closing tag '`+c+`' doesn't have proper closing.`,$(e,a));else{let s=hs(u,t);if(s!==!0)return Q(s.err.code,s.err.msg,$(e,a-u.length+s.err.line));if(i===!0)return Q(`InvalidXml`,`Multiple possible root nodes found.`,$(e,a));t.unpairedTags.indexOf(c)!==-1||n.push({tagName:c,tagStartPos:o}),r=!0}for(a++;a<e.length;a++)if(e[a]===`<`)if(e[a+1]===`!`){a++,a=us(e,a);continue}else if(e[a+1]===`?`){if(a=ls(e,++a),a.err)return a}else break;else if(e[a]===`&`){let t=_s(e,a);if(t==-1)return Q(`InvalidChar`,`char '&' is not expected.`,$(e,a));a=t}else if(i===!0&&!cs(e[a]))return Q(`InvalidXml`,`Extra text at the end`,$(e,a));e[a]===`<`&&a--}}else{if(cs(e[a]))continue;return Q(`InvalidChar`,`char '`+e[a]+`' is not expected.`,$(e,a))}if(r){if(n.length==1)return Q(`InvalidTag`,`Unclosed tag '`+n[0].tagName+`'.`,$(e,n[0].tagStartPos));if(n.length>0)return Q(`InvalidXml`,`Invalid '`+JSON.stringify(n.map(e=>e.tagName),null,4).replace(/\r?\n/g,``)+`' found.`,{line:1,col:1})}else return Q(`InvalidXml`,`Start tag expected.`,1);return!0}function cs(e){return e===` `||e===` `||e===`
|
|
185
|
-
`||e===`\r`}function ls(e,t){let n=t;for(;t<e.length;t++)if(e[t]==`?`||e[t]==` `){let r=e.substr(n,t-n);if(t>5&&r===`xml`)return Q(`InvalidXml`,`XML declaration allowed only at the start of the document.`,$(e,t));if(e[t]==`?`&&e[t+1]==`>`){t++;break}else continue}return t}function us(e,t){if(e.length>t+5&&e[t+1]===`-`&&e[t+2]===`-`){for(t+=3;t<e.length;t++)if(e[t]===`-`&&e[t+1]===`-`&&e[t+2]===`>`){t+=2;break}}else if(e.length>t+8&&e[t+1]===`D`&&e[t+2]===`O`&&e[t+3]===`C`&&e[t+4]===`T`&&e[t+5]===`Y`&&e[t+6]===`P`&&e[t+7]===`E`){let n=1;for(t+=8;t<e.length;t++)if(e[t]===`<`)n++;else if(e[t]===`>`&&(n--,n===0))break}else if(e.length>t+9&&e[t+1]===`[`&&e[t+2]===`C`&&e[t+3]===`D`&&e[t+4]===`A`&&e[t+5]===`T`&&e[t+6]===`A`&&e[t+7]===`[`){for(t+=8;t<e.length;t++)if(e[t]===`]`&&e[t+1]===`]`&&e[t+2]===`>`){t+=2;break}}return t}const ds=`"`,fs=`'`;function ps(e,t){let n=``,r=``,i=!1;for(;t<e.length;t++){if(e[t]===`"`||e[t]===`'`)r===``?r=e[t]:r!==e[t]||(r=``);else if(e[t]===`>`&&r===``){i=!0;break}n+=e[t]}return r===``?{value:n,index:t,tagClosed:i}:!1}const ms=RegExp(`(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['"])(([\\s\\S])*?)\\5)?`,`g`);function hs(e,t){let n=rs(e,ms),r={};for(let e=0;e<n.length;e++){if(n[e][1].length===0)return Q(`InvalidAttr`,`Attribute '`+n[e][2]+`' has no space in starting.`,bs(n[e]));if(n[e][3]!==void 0&&n[e][4]===void 0)return Q(`InvalidAttr`,`Attribute '`+n[e][2]+`' is without value.`,bs(n[e]));if(n[e][3]===void 0&&!t.allowBooleanAttributes)return Q(`InvalidAttr`,`boolean attribute '`+n[e][2]+`' is not allowed.`,bs(n[e]));let i=n[e][2];if(!vs(i))return Q(`InvalidAttr`,`Attribute '`+i+`' is an invalid name.`,bs(n[e]));if(!r.hasOwnProperty(i))r[i]=1;else return Q(`InvalidAttr`,`Attribute '`+i+`' is repeated.`,bs(n[e]))}return!0}function gs(e,t){let n=/\d/;for(e[t]===`x`&&(t++,n=/[\da-fA-F]/);t<e.length;t++){if(e[t]===`;`)return t;if(!e[t].match(n))break}return-1}function _s(e,t){if(t++,e[t]===`;`)return-1;if(e[t]===`#`)return t++,gs(e,t);let n=0;for(;t<e.length;t++,n++)if(!(e[t].match(/\w/)&&n<20)){if(e[t]===`;`)break;return-1}return t}function Q(e,t,n){return{err:{code:e,msg:t,line:n.line||n,col:n.col}}}function vs(e){return is(e)}function ys(e){return is(e)}function $(e,t){let n=e.substring(0,t).split(/\r?\n/);return{line:n.length,col:n[n.length-1].length+1}}function bs(e){return e.startIndex+e[1].length}const xs={preserveOrder:!1,attributeNamePrefix:`@_`,attributesGroupName:!1,textNodeName:`#text`,ignoreAttributes:!0,removeNSPrefix:!1,allowBooleanAttributes:!1,parseTagValue:!0,parseAttributeValue:!1,trimValues:!0,cdataPropName:!1,numberParseOptions:{hex:!0,leadingZeros:!0,eNotation:!0},tagValueProcessor:function(e,t){return t},attributeValueProcessor:function(e,t){return t},stopNodes:[],alwaysCreateTextNode:!1,isArray:()=>!1,commentPropName:!1,unpairedTags:[],processEntities:!0,htmlEntities:!1,ignoreDeclaration:!1,ignorePiTags:!1,transformTagName:!1,transformAttributeName:!1,updateTag:function(e,t,n){return e},captureMetaData:!1},Ss=function(e){return Object.assign({},xs,e)};let Cs;Cs=typeof Symbol==`function`?Symbol(`XML Node Metadata`):`@@xmlMetadata`;var ws=class{constructor(e){this.tagname=e,this.child=[],this[`:@`]={}}add(e,t){e===`__proto__`&&(e=`#__proto__`),this.child.push({[e]:t})}addChild(e,t){e.tagname===`__proto__`&&(e.tagname=`#__proto__`),e[`:@`]&&Object.keys(e[`:@`]).length>0?this.child.push({[e.tagname]:e.child,":@":e[`:@`]}):this.child.push({[e.tagname]:e.child}),t!==void 0&&(this.child[this.child.length-1][Cs]={startIndex:t})}static getMetaDataSymbol(){return Cs}};function Ts(e,t){let n={};if(e[t+3]===`O`&&e[t+4]===`C`&&e[t+5]===`T`&&e[t+6]===`Y`&&e[t+7]===`P`&&e[t+8]===`E`){t+=9;let r=1,i=!1,a=!1,o=``;for(;t<e.length;t++)if(e[t]===`<`&&!a){if(i&&js(e,`!ENTITY`,t)){t+=7;let r,i;[r,i,t]=Ds(e,t+1),i.indexOf(`&`)===-1&&(n[r]={regx:RegExp(`&${r};`,`g`),val:i})}else if(i&&js(e,`!ELEMENT`,t)){t+=8;let{index:n}=As(e,t+1);t=n}else if(i&&js(e,`!ATTLIST`,t))t+=8;else if(i&&js(e,`!NOTATION`,t)){t+=9;let{index:n}=Os(e,t+1);t=n}else if(js(e,`!--`,t))a=!0;else throw Error(`Invalid DOCTYPE`);r++,o=``}else if(e[t]===`>`){if(a?e[t-1]===`-`&&e[t-2]===`-`&&(a=!1,r--):r--,r===0)break}else e[t]===`[`?i=!0:o+=e[t];if(r!==0)throw Error(`Unclosed DOCTYPE`)}else throw Error(`Invalid Tag instead of DOCTYPE`);return{entities:n,i:t}}const Es=(e,t)=>{for(;t<e.length&&/\s/.test(e[t]);)t++;return t};function Ds(e,t){t=Es(e,t);let n=``;for(;t<e.length&&!/\s/.test(e[t])&&e[t]!==`"`&&e[t]!==`'`;)n+=e[t],t++;if(Ms(n),t=Es(e,t),e.substring(t,t+6).toUpperCase()===`SYSTEM`)throw Error(`External entities are not supported`);if(e[t]===`%`)throw Error(`Parameter entities are not supported`);let r=``;return[t,r]=ks(e,t,`entity`),t--,[n,r,t]}function Os(e,t){t=Es(e,t);let n=``;for(;t<e.length&&!/\s/.test(e[t]);)n+=e[t],t++;Ms(n),t=Es(e,t);let r=e.substring(t,t+6).toUpperCase();if(r!==`SYSTEM`&&r!==`PUBLIC`)throw Error(`Expected SYSTEM or PUBLIC, found "${r}"`);t+=r.length,t=Es(e,t);let i=null,a=null;if(r===`PUBLIC`)[t,i]=ks(e,t,`publicIdentifier`),t=Es(e,t),(e[t]===`"`||e[t]===`'`)&&([t,a]=ks(e,t,`systemIdentifier`));else if(r===`SYSTEM`&&([t,a]=ks(e,t,`systemIdentifier`),!a))throw Error(`Missing mandatory system identifier for SYSTEM notation`);return{notationName:n,publicIdentifier:i,systemIdentifier:a,index:--t}}function ks(e,t,n){let r=``,i=e[t];if(i!==`"`&&i!==`'`)throw Error(`Expected quoted string, found "${i}"`);for(t++;t<e.length&&e[t]!==i;)r+=e[t],t++;if(e[t]!==i)throw Error(`Unterminated ${n} value`);return t++,[t,r]}function As(e,t){t=Es(e,t);let n=``;for(;t<e.length&&!/\s/.test(e[t]);)n+=e[t],t++;if(!Ms(n))throw Error(`Invalid element name: "${n}"`);t=Es(e,t);let r=``;if(e[t]===`E`&&js(e,`MPTY`,t))t+=4;else if(e[t]===`A`&&js(e,`NY`,t))t+=2;else if(e[t]===`(`){for(t++;t<e.length&&e[t]!==`)`;)r+=e[t],t++;if(e[t]!==`)`)throw Error(`Unterminated content model`)}else throw Error(`Invalid Element Expression, found "${e[t]}"`);return{elementName:n,contentModel:r.trim(),index:t}}function js(e,t,n){for(let r=0;r<t.length;r++)if(t[r]!==e[n+r+1])return!1;return!0}function Ms(e){if(is(e))return e;throw Error(`Invalid entity name ${e}`)}const Ns=/^[-+]?0x[a-fA-F0-9]+$/,Ps=/^([\-\+])?(0*)([0-9]*(\.[0-9]*)?)$/,Fs={hex:!0,leadingZeros:!0,decimalPoint:`.`,eNotation:!0};function Is(e,t={}){if(t=Object.assign({},Fs,t),!e||typeof e!=`string`)return e;let n=e.trim();if(t.skipLike!==void 0&&t.skipLike.test(n))return e;if(e===`0`)return 0;if(t.hex&&Ns.test(n))return Bs(n,16);if(n.search(/.+[eE].+/)!==-1)return Rs(e,n,t);{let r=Ps.exec(n);if(r){let i=r[1]||``,a=r[2],o=zs(r[3]),s=i?e[a.length+1]===`.`:e[a.length]===`.`;if(!t.leadingZeros&&(a.length>1||a.length===1&&!s))return e;{let r=Number(n),s=String(r);if(r===0)return r;if(s.search(/[eE]/)!==-1)return t.eNotation?r:e;if(n.indexOf(`.`)!==-1)return s===`0`||s===o||s===`${i}${o}`?r:e;let c=a?o:n;return a?c===s||i+c===s?r:e:c===s||c===i+s?r:e}}else return e}}const Ls=/^([-+])?(0*)(\d*(\.\d*)?[eE][-\+]?\d+)$/;function Rs(e,t,n){if(!n.eNotation)return e;let r=t.match(Ls);if(r){let i=r[1]||``,a=r[3].indexOf(`e`)===-1?`E`:`e`,o=r[2],s=i?e[o.length+1]===a:e[o.length]===a;return o.length>1&&s?e:o.length===1&&(r[3].startsWith(`.${a}`)||r[3][0]===a)?Number(t):n.leadingZeros&&!s?(t=(r[1]||``)+r[3],Number(t)):e}else return e}function zs(e){return e&&e.indexOf(`.`)!==-1?(e=e.replace(/0+$/,``),e===`.`?e=`0`:e[0]===`.`?e=`0`+e:e[e.length-1]===`.`&&(e=e.substring(0,e.length-1)),e):e}function Bs(e,t){if(parseInt)return parseInt(e,t);if(Number.parseInt)return Number.parseInt(e,t);if(window&&window.parseInt)return window.parseInt(e,t);throw Error(`parseInt, Number.parseInt, window.parseInt are not supported`)}function Vs(e){return typeof e==`function`?e:Array.isArray(e)?t=>{for(let n of e)if(typeof n==`string`&&t===n||n instanceof RegExp&&n.test(t))return!0}:()=>!1}var Hs=class{constructor(e){this.options=e,this.currentNode=null,this.tagsNodeStack=[],this.docTypeEntities={},this.lastEntities={apos:{regex:/&(apos|#39|#x27);/g,val:`'`},gt:{regex:/&(gt|#62|#x3E);/g,val:`>`},lt:{regex:/&(lt|#60|#x3C);/g,val:`<`},quot:{regex:/&(quot|#34|#x22);/g,val:`"`}},this.ampEntity={regex:/&(amp|#38|#x26);/g,val:`&`},this.htmlEntities={space:{regex:/&(nbsp|#160);/g,val:` `},cent:{regex:/&(cent|#162);/g,val:`¢`},pound:{regex:/&(pound|#163);/g,val:`£`},yen:{regex:/&(yen|#165);/g,val:`¥`},euro:{regex:/&(euro|#8364);/g,val:`€`},copyright:{regex:/&(copy|#169);/g,val:`©`},reg:{regex:/&(reg|#174);/g,val:`®`},inr:{regex:/&(inr|#8377);/g,val:`₹`},num_dec:{regex:/&#([0-9]{1,7});/g,val:(e,t)=>String.fromCodePoint(Number.parseInt(t,10))},num_hex:{regex:/&#x([0-9a-fA-F]{1,6});/g,val:(e,t)=>String.fromCodePoint(Number.parseInt(t,16))}},this.addExternalEntities=Us,this.parseXml=Js,this.parseTextData=Ws,this.resolveNameSpace=Gs,this.buildAttributesMap=qs,this.isItStopNode=Qs,this.replaceEntitiesValue=Xs,this.readStopNodeData=nc,this.saveTextToParentTag=Zs,this.addChild=Ys,this.ignoreAttributesFn=Vs(this.options.ignoreAttributes)}};function Us(e){let t=Object.keys(e);for(let n=0;n<t.length;n++){let r=t[n];this.lastEntities[r]={regex:RegExp(`&`+r+`;`,`g`),val:e[r]}}}function Ws(e,t,n,r,i,a,o){if(e!==void 0&&(this.options.trimValues&&!r&&(e=e.trim()),e.length>0)){o||(e=this.replaceEntitiesValue(e));let r=this.options.tagValueProcessor(t,e,n,i,a);return r==null?e:typeof r!=typeof e||r!==e?r:this.options.trimValues||e.trim()===e?rc(e,this.options.parseTagValue,this.options.numberParseOptions):e}}function Gs(e){if(this.options.removeNSPrefix){let t=e.split(`:`),n=e.charAt(0)===`/`?`/`:``;if(t[0]===`xmlns`)return``;t.length===2&&(e=n+t[1])}return e}const Ks=RegExp(`([^\\s=]+)\\s*(=\\s*(['"])([\\s\\S]*?)\\3)?`,`gm`);function qs(e,t,n){if(this.options.ignoreAttributes!==!0&&typeof e==`string`){let n=rs(e,Ks),r=n.length,i={};for(let e=0;e<r;e++){let r=this.resolveNameSpace(n[e][1]);if(this.ignoreAttributesFn(r,t))continue;let a=n[e][4],o=this.options.attributeNamePrefix+r;if(r.length)if(this.options.transformAttributeName&&(o=this.options.transformAttributeName(o)),o===`__proto__`&&(o=`#__proto__`),a!==void 0){this.options.trimValues&&(a=a.trim()),a=this.replaceEntitiesValue(a);let e=this.options.attributeValueProcessor(r,a,t);e==null?i[o]=a:typeof e!=typeof a||e!==a?i[o]=e:i[o]=rc(a,this.options.parseAttributeValue,this.options.numberParseOptions)}else this.options.allowBooleanAttributes&&(i[o]=!0)}if(!Object.keys(i).length)return;if(this.options.attributesGroupName){let e={};return e[this.options.attributesGroupName]=i,e}return i}}const Js=function(e){e=e.replace(/\r\n?/g,`
|
|
185
|
+
`||e===`\r`}function ls(e,t){let n=t;for(;t<e.length;t++)if(e[t]==`?`||e[t]==` `){let r=e.substr(n,t-n);if(t>5&&r===`xml`)return Q(`InvalidXml`,`XML declaration allowed only at the start of the document.`,$(e,t));if(e[t]==`?`&&e[t+1]==`>`){t++;break}else continue}return t}function us(e,t){if(e.length>t+5&&e[t+1]===`-`&&e[t+2]===`-`){for(t+=3;t<e.length;t++)if(e[t]===`-`&&e[t+1]===`-`&&e[t+2]===`>`){t+=2;break}}else if(e.length>t+8&&e[t+1]===`D`&&e[t+2]===`O`&&e[t+3]===`C`&&e[t+4]===`T`&&e[t+5]===`Y`&&e[t+6]===`P`&&e[t+7]===`E`){let n=1;for(t+=8;t<e.length;t++)if(e[t]===`<`)n++;else if(e[t]===`>`&&(n--,n===0))break}else if(e.length>t+9&&e[t+1]===`[`&&e[t+2]===`C`&&e[t+3]===`D`&&e[t+4]===`A`&&e[t+5]===`T`&&e[t+6]===`A`&&e[t+7]===`[`){for(t+=8;t<e.length;t++)if(e[t]===`]`&&e[t+1]===`]`&&e[t+2]===`>`){t+=2;break}}return t}const ds=`"`,fs=`'`;function ps(e,t){let n=``,r=``,i=!1;for(;t<e.length;t++){if(e[t]===`"`||e[t]===`'`)r===``?r=e[t]:r!==e[t]||(r=``);else if(e[t]===`>`&&r===``){i=!0;break}n+=e[t]}return r===``?{value:n,index:t,tagClosed:i}:!1}const ms=RegExp(`(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['"])(([\\s\\S])*?)\\5)?`,`g`);function hs(e,t){let n=rs(e,ms),r={};for(let e=0;e<n.length;e++){if(n[e][1].length===0)return Q(`InvalidAttr`,`Attribute '`+n[e][2]+`' has no space in starting.`,bs(n[e]));if(n[e][3]!==void 0&&n[e][4]===void 0)return Q(`InvalidAttr`,`Attribute '`+n[e][2]+`' is without value.`,bs(n[e]));if(n[e][3]===void 0&&!t.allowBooleanAttributes)return Q(`InvalidAttr`,`boolean attribute '`+n[e][2]+`' is not allowed.`,bs(n[e]));let i=n[e][2];if(!vs(i))return Q(`InvalidAttr`,`Attribute '`+i+`' is an invalid name.`,bs(n[e]));if(!r.hasOwnProperty(i))r[i]=1;else return Q(`InvalidAttr`,`Attribute '`+i+`' is repeated.`,bs(n[e]))}return!0}function gs(e,t){let n=/\d/;for(e[t]===`x`&&(t++,n=/[\da-fA-F]/);t<e.length;t++){if(e[t]===`;`)return t;if(!e[t].match(n))break}return-1}function _s(e,t){if(t++,e[t]===`;`)return-1;if(e[t]===`#`)return t++,gs(e,t);let n=0;for(;t<e.length;t++,n++)if(!(e[t].match(/\w/)&&n<20)){if(e[t]===`;`)break;return-1}return t}function Q(e,t,n){return{err:{code:e,msg:t,line:n.line||n,col:n.col}}}function vs(e){return is(e)}function ys(e){return is(e)}function $(e,t){let n=e.substring(0,t).split(/\r?\n/);return{line:n.length,col:n[n.length-1].length+1}}function bs(e){return e.startIndex+e[1].length}const xs={preserveOrder:!1,attributeNamePrefix:`@_`,attributesGroupName:!1,textNodeName:`#text`,ignoreAttributes:!0,removeNSPrefix:!1,allowBooleanAttributes:!1,parseTagValue:!0,parseAttributeValue:!1,trimValues:!0,cdataPropName:!1,numberParseOptions:{hex:!0,leadingZeros:!0,eNotation:!0},tagValueProcessor:function(e,t){return t},attributeValueProcessor:function(e,t){return t},stopNodes:[],alwaysCreateTextNode:!1,isArray:()=>!1,commentPropName:!1,unpairedTags:[],processEntities:!0,htmlEntities:!1,ignoreDeclaration:!1,ignorePiTags:!1,transformTagName:!1,transformAttributeName:!1,updateTag:function(e,t,n){return e},captureMetaData:!1},Ss=function(e){return Object.assign({},xs,e)};let Cs;Cs=typeof Symbol==`function`?Symbol(`XML Node Metadata`):`@@xmlMetadata`;var ws=class{constructor(e){this.tagname=e,this.child=[],this[`:@`]={}}add(e,t){e===`__proto__`&&(e=`#__proto__`),this.child.push({[e]:t})}addChild(e,t){e.tagname===`__proto__`&&(e.tagname=`#__proto__`),e[`:@`]&&Object.keys(e[`:@`]).length>0?this.child.push({[e.tagname]:e.child,":@":e[`:@`]}):this.child.push({[e.tagname]:e.child}),t!==void 0&&(this.child[this.child.length-1][Cs]={startIndex:t})}static getMetaDataSymbol(){return Cs}};function Ts(e,t){let n={};if(e[t+3]===`O`&&e[t+4]===`C`&&e[t+5]===`T`&&e[t+6]===`Y`&&e[t+7]===`P`&&e[t+8]===`E`){t+=9;let r=1,i=!1,a=!1,o=``;for(;t<e.length;t++)if(e[t]===`<`&&!a){if(i&&js(e,`!ENTITY`,t)){t+=7;let r,i;[r,i,t]=Ds(e,t+1),i.indexOf(`&`)===-1&&(n[r]={regx:RegExp(`&${r};`,`g`),val:i})}else if(i&&js(e,`!ELEMENT`,t)){t+=8;let{index:n}=As(e,t+1);t=n}else if(i&&js(e,`!ATTLIST`,t))t+=8;else if(i&&js(e,`!NOTATION`,t)){t+=9;let{index:n}=Os(e,t+1);t=n}else if(js(e,`!--`,t))a=!0;else throw Error(`Invalid DOCTYPE`);r++,o=``}else if(e[t]===`>`){if(a?e[t-1]===`-`&&e[t-2]===`-`&&(a=!1,r--):r--,r===0)break}else e[t]===`[`?i=!0:o+=e[t];if(r!==0)throw Error(`Unclosed DOCTYPE`)}else throw Error(`Invalid Tag instead of DOCTYPE`);return{entities:n,i:t}}const Es=(e,t)=>{for(;t<e.length&&/\s/.test(e[t]);)t++;return t};function Ds(e,t){t=Es(e,t);let n=``;for(;t<e.length&&!/\s/.test(e[t])&&e[t]!==`"`&&e[t]!==`'`;)n+=e[t],t++;if(Ms(n),t=Es(e,t),e.substring(t,t+6).toUpperCase()===`SYSTEM`)throw Error(`External entities are not supported`);if(e[t]===`%`)throw Error(`Parameter entities are not supported`);let r=``;return[t,r]=ks(e,t,`entity`),t--,[n,r,t]}function Os(e,t){t=Es(e,t);let n=``;for(;t<e.length&&!/\s/.test(e[t]);)n+=e[t],t++;Ms(n),t=Es(e,t);let r=e.substring(t,t+6).toUpperCase();if(r!==`SYSTEM`&&r!==`PUBLIC`)throw Error(`Expected SYSTEM or PUBLIC, found "${r}"`);t+=r.length,t=Es(e,t);let i=null,a=null;if(r===`PUBLIC`)[t,i]=ks(e,t,`publicIdentifier`),t=Es(e,t),(e[t]===`"`||e[t]===`'`)&&([t,a]=ks(e,t,`systemIdentifier`));else if(r===`SYSTEM`&&([t,a]=ks(e,t,`systemIdentifier`),!a))throw Error(`Missing mandatory system identifier for SYSTEM notation`);return{notationName:n,publicIdentifier:i,systemIdentifier:a,index:--t}}function ks(e,t,n){let r=``,i=e[t];if(i!==`"`&&i!==`'`)throw Error(`Expected quoted string, found "${i}"`);for(t++;t<e.length&&e[t]!==i;)r+=e[t],t++;if(e[t]!==i)throw Error(`Unterminated ${n} value`);return t++,[t,r]}function As(e,t){t=Es(e,t);let n=``;for(;t<e.length&&!/\s/.test(e[t]);)n+=e[t],t++;if(!Ms(n))throw Error(`Invalid element name: "${n}"`);t=Es(e,t);let r=``;if(e[t]===`E`&&js(e,`MPTY`,t))t+=4;else if(e[t]===`A`&&js(e,`NY`,t))t+=2;else if(e[t]===`(`){for(t++;t<e.length&&e[t]!==`)`;)r+=e[t],t++;if(e[t]!==`)`)throw Error(`Unterminated content model`)}else throw Error(`Invalid Element Expression, found "${e[t]}"`);return{elementName:n,contentModel:r.trim(),index:t}}function js(e,t,n){for(let r=0;r<t.length;r++)if(t[r]!==e[n+r+1])return!1;return!0}function Ms(e){if(is(e))return e;throw Error(`Invalid entity name ${e}`)}const Ns=/^[-+]?0x[a-fA-F0-9]+$/,Ps=/^([\-\+])?(0*)([0-9]*(\.[0-9]*)?)$/,Fs={hex:!0,leadingZeros:!0,decimalPoint:`.`,eNotation:!0};function Is(e,t={}){if(t=Object.assign({},Fs,t),!e||typeof e!=`string`)return e;let n=e.trim();if(t.skipLike!==void 0&&t.skipLike.test(n))return e;if(e===`0`)return 0;if(t.hex&&Ns.test(n))return Bs(n,16);if(n.includes(`e`)||n.includes(`E`))return Rs(e,n,t);{let r=Ps.exec(n);if(r){let i=r[1]||``,a=r[2],o=zs(r[3]),s=i?e[a.length+1]===`.`:e[a.length]===`.`;if(!t.leadingZeros&&(a.length>1||a.length===1&&!s))return e;{let r=Number(n),s=String(r);if(r===0)return r;if(s.search(/[eE]/)!==-1)return t.eNotation?r:e;if(n.indexOf(`.`)!==-1)return s===`0`||s===o||s===`${i}${o}`?r:e;let c=a?o:n;return a?c===s||i+c===s?r:e:c===s||c===i+s?r:e}}else return e}}const Ls=/^([-+])?(0*)(\d*(\.\d*)?[eE][-\+]?\d+)$/;function Rs(e,t,n){if(!n.eNotation)return e;let r=t.match(Ls);if(r){let i=r[1]||``,a=r[3].indexOf(`e`)===-1?`E`:`e`,o=r[2],s=i?e[o.length+1]===a:e[o.length]===a;return o.length>1&&s?e:o.length===1&&(r[3].startsWith(`.${a}`)||r[3][0]===a)?Number(t):n.leadingZeros&&!s?(t=(r[1]||``)+r[3],Number(t)):e}else return e}function zs(e){return e&&e.indexOf(`.`)!==-1?(e=e.replace(/0+$/,``),e===`.`?e=`0`:e[0]===`.`?e=`0`+e:e[e.length-1]===`.`&&(e=e.substring(0,e.length-1)),e):e}function Bs(e,t){if(parseInt)return parseInt(e,t);if(Number.parseInt)return Number.parseInt(e,t);if(window&&window.parseInt)return window.parseInt(e,t);throw Error(`parseInt, Number.parseInt, window.parseInt are not supported`)}function Vs(e){return typeof e==`function`?e:Array.isArray(e)?t=>{for(let n of e)if(typeof n==`string`&&t===n||n instanceof RegExp&&n.test(t))return!0}:()=>!1}var Hs=class{constructor(e){this.options=e,this.currentNode=null,this.tagsNodeStack=[],this.docTypeEntities={},this.lastEntities={apos:{regex:/&(apos|#39|#x27);/g,val:`'`},gt:{regex:/&(gt|#62|#x3E);/g,val:`>`},lt:{regex:/&(lt|#60|#x3C);/g,val:`<`},quot:{regex:/&(quot|#34|#x22);/g,val:`"`}},this.ampEntity={regex:/&(amp|#38|#x26);/g,val:`&`},this.htmlEntities={space:{regex:/&(nbsp|#160);/g,val:` `},cent:{regex:/&(cent|#162);/g,val:`¢`},pound:{regex:/&(pound|#163);/g,val:`£`},yen:{regex:/&(yen|#165);/g,val:`¥`},euro:{regex:/&(euro|#8364);/g,val:`€`},copyright:{regex:/&(copy|#169);/g,val:`©`},reg:{regex:/&(reg|#174);/g,val:`®`},inr:{regex:/&(inr|#8377);/g,val:`₹`},num_dec:{regex:/&#([0-9]{1,7});/g,val:(e,t)=>String.fromCodePoint(Number.parseInt(t,10))},num_hex:{regex:/&#x([0-9a-fA-F]{1,6});/g,val:(e,t)=>String.fromCodePoint(Number.parseInt(t,16))}},this.addExternalEntities=Us,this.parseXml=Js,this.parseTextData=Ws,this.resolveNameSpace=Gs,this.buildAttributesMap=qs,this.isItStopNode=Qs,this.replaceEntitiesValue=Xs,this.readStopNodeData=nc,this.saveTextToParentTag=Zs,this.addChild=Ys,this.ignoreAttributesFn=Vs(this.options.ignoreAttributes)}};function Us(e){let t=Object.keys(e);for(let n=0;n<t.length;n++){let r=t[n];this.lastEntities[r]={regex:RegExp(`&`+r+`;`,`g`),val:e[r]}}}function Ws(e,t,n,r,i,a,o){if(e!==void 0&&(this.options.trimValues&&!r&&(e=e.trim()),e.length>0)){o||(e=this.replaceEntitiesValue(e));let r=this.options.tagValueProcessor(t,e,n,i,a);return r==null?e:typeof r!=typeof e||r!==e?r:this.options.trimValues||e.trim()===e?rc(e,this.options.parseTagValue,this.options.numberParseOptions):e}}function Gs(e){if(this.options.removeNSPrefix){let t=e.split(`:`),n=e.charAt(0)===`/`?`/`:``;if(t[0]===`xmlns`)return``;t.length===2&&(e=n+t[1])}return e}const Ks=RegExp(`([^\\s=]+)\\s*(=\\s*(['"])([\\s\\S]*?)\\3)?`,`gm`);function qs(e,t,n){if(this.options.ignoreAttributes!==!0&&typeof e==`string`){let n=rs(e,Ks),r=n.length,i={};for(let e=0;e<r;e++){let r=this.resolveNameSpace(n[e][1]);if(this.ignoreAttributesFn(r,t))continue;let a=n[e][4],o=this.options.attributeNamePrefix+r;if(r.length)if(this.options.transformAttributeName&&(o=this.options.transformAttributeName(o)),o===`__proto__`&&(o=`#__proto__`),a!==void 0){this.options.trimValues&&(a=a.trim()),a=this.replaceEntitiesValue(a);let e=this.options.attributeValueProcessor(r,a,t);e==null?i[o]=a:typeof e!=typeof a||e!==a?i[o]=e:i[o]=rc(a,this.options.parseAttributeValue,this.options.numberParseOptions)}else this.options.allowBooleanAttributes&&(i[o]=!0)}if(!Object.keys(i).length)return;if(this.options.attributesGroupName){let e={};return e[this.options.attributesGroupName]=i,e}return i}}const Js=function(e){e=e.replace(/\r\n?/g,`
|
|
186
186
|
`);let t=new ws(`!xml`),n=t,r=``,i=``;for(let a=0;a<e.length;a++)if(e[a]===`<`)if(e[a+1]===`/`){let t=ec(e,`>`,a,`Closing Tag is not closed.`),o=e.substring(a+2,t).trim();if(this.options.removeNSPrefix){let e=o.indexOf(`:`);e!==-1&&(o=o.substr(e+1))}this.options.transformTagName&&(o=this.options.transformTagName(o)),n&&(r=this.saveTextToParentTag(r,n,i));let s=i.substring(i.lastIndexOf(`.`)+1);if(o&&this.options.unpairedTags.indexOf(o)!==-1)throw Error(`Unpaired tag can not be used as closing tag: </${o}>`);let c=0;s&&this.options.unpairedTags.indexOf(s)!==-1?(c=i.lastIndexOf(`.`,i.lastIndexOf(`.`)-1),this.tagsNodeStack.pop()):c=i.lastIndexOf(`.`),i=i.substring(0,c),n=this.tagsNodeStack.pop(),r=``,a=t}else if(e[a+1]===`?`){let t=tc(e,a,!1,`?>`);if(!t)throw Error(`Pi Tag is not closed.`);if(r=this.saveTextToParentTag(r,n,i),!(this.options.ignoreDeclaration&&t.tagName===`?xml`||this.options.ignorePiTags)){let e=new ws(t.tagName);e.add(this.options.textNodeName,``),t.tagName!==t.tagExp&&t.attrExpPresent&&(e[`:@`]=this.buildAttributesMap(t.tagExp,i,t.tagName)),this.addChild(n,e,i,a)}a=t.closeIndex+1}else if(e.substr(a+1,3)===`!--`){let t=ec(e,`-->`,a+4,`Comment is not closed.`);if(this.options.commentPropName){let o=e.substring(a+4,t-2);r=this.saveTextToParentTag(r,n,i),n.add(this.options.commentPropName,[{[this.options.textNodeName]:o}])}a=t}else if(e.substr(a+1,2)===`!D`){let t=Ts(e,a);this.docTypeEntities=t.entities,a=t.i}else if(e.substr(a+1,2)===`![`){let t=ec(e,`]]>`,a,`CDATA is not closed.`)-2,o=e.substring(a+9,t);r=this.saveTextToParentTag(r,n,i);let s=this.parseTextData(o,n.tagname,i,!0,!1,!0,!0);s??=``,this.options.cdataPropName?n.add(this.options.cdataPropName,[{[this.options.textNodeName]:o}]):n.add(this.options.textNodeName,s),a=t+2}else{let o=tc(e,a,this.options.removeNSPrefix),s=o.tagName,c=o.rawTagName,l=o.tagExp,u=o.attrExpPresent,d=o.closeIndex;this.options.transformTagName&&(s=this.options.transformTagName(s)),n&&r&&n.tagname!==`!xml`&&(r=this.saveTextToParentTag(r,n,i,!1));let f=n;f&&this.options.unpairedTags.indexOf(f.tagname)!==-1&&(n=this.tagsNodeStack.pop(),i=i.substring(0,i.lastIndexOf(`.`))),s!==t.tagname&&(i+=i?`.`+s:s);let p=a;if(this.isItStopNode(this.options.stopNodes,i,s)){let t=``;if(l.length>0&&l.lastIndexOf(`/`)===l.length-1)s[s.length-1]===`/`?(s=s.substr(0,s.length-1),i=i.substr(0,i.length-1),l=s):l=l.substr(0,l.length-1),a=o.closeIndex;else if(this.options.unpairedTags.indexOf(s)!==-1)a=o.closeIndex;else{let n=this.readStopNodeData(e,c,d+1);if(!n)throw Error(`Unexpected end of ${c}`);a=n.i,t=n.tagContent}let r=new ws(s);s!==l&&u&&(r[`:@`]=this.buildAttributesMap(l,i,s)),t&&=this.parseTextData(t,s,i,!0,u,!0,!0),i=i.substr(0,i.lastIndexOf(`.`)),r.add(this.options.textNodeName,t),this.addChild(n,r,i,p)}else{if(l.length>0&&l.lastIndexOf(`/`)===l.length-1){s[s.length-1]===`/`?(s=s.substr(0,s.length-1),i=i.substr(0,i.length-1),l=s):l=l.substr(0,l.length-1),this.options.transformTagName&&(s=this.options.transformTagName(s));let e=new ws(s);s!==l&&u&&(e[`:@`]=this.buildAttributesMap(l,i,s)),this.addChild(n,e,i,p),i=i.substr(0,i.lastIndexOf(`.`))}else{let e=new ws(s);this.tagsNodeStack.push(n),s!==l&&u&&(e[`:@`]=this.buildAttributesMap(l,i,s)),this.addChild(n,e,i,p),n=e}r=``,a=d}}else r+=e[a];return t.child};function Ys(e,t,n,r){this.options.captureMetaData||(r=void 0);let i=this.options.updateTag(t.tagname,n,t[`:@`]);i===!1||(typeof i==`string`&&(t.tagname=i),e.addChild(t,r))}const Xs=function(e){if(this.options.processEntities){for(let t in this.docTypeEntities){let n=this.docTypeEntities[t];e=e.replace(n.regx,n.val)}for(let t in this.lastEntities){let n=this.lastEntities[t];e=e.replace(n.regex,n.val)}if(this.options.htmlEntities)for(let t in this.htmlEntities){let n=this.htmlEntities[t];e=e.replace(n.regex,n.val)}e=e.replace(this.ampEntity.regex,this.ampEntity.val)}return e};function Zs(e,t,n,r){return e&&=(r===void 0&&(r=t.child.length===0),e=this.parseTextData(e,t.tagname,n,!1,t[`:@`]?Object.keys(t[`:@`]).length!==0:!1,r),e!==void 0&&e!==``&&t.add(this.options.textNodeName,e),``),e}function Qs(e,t,n){let r=`*.`+n;for(let n in e){let i=e[n];if(r===i||t===i)return!0}return!1}function $s(e,t,n=`>`){let r,i=``;for(let a=t;a<e.length;a++){let t=e[a];if(r)t===r&&(r=``);else if(t===`"`||t===`'`)r=t;else if(t===n[0])if(n[1]){if(e[a+1]===n[1])return{data:i,index:a}}else return{data:i,index:a};else t===` `&&(t=` `);i+=t}}function ec(e,t,n,r){let i=e.indexOf(t,n);if(i===-1)throw Error(r);return i+t.length-1}function tc(e,t,n,r=`>`){let i=$s(e,t+1,r);if(!i)return;let a=i.data,o=i.index,s=a.search(/\s/),c=a,l=!0;s!==-1&&(c=a.substring(0,s),a=a.substring(s+1).trimStart());let u=c;if(n){let e=c.indexOf(`:`);e!==-1&&(c=c.substr(e+1),l=c!==i.data.substr(e+1))}return{tagName:c,tagExp:a,closeIndex:o,attrExpPresent:l,rawTagName:u}}function nc(e,t,n){let r=n,i=1;for(;n<e.length;n++)if(e[n]===`<`)if(e[n+1]===`/`){let a=ec(e,`>`,n,`${t} is not closed`);if(e.substring(n+2,a).trim()===t&&(i--,i===0))return{tagContent:e.substring(r,n),i:a};n=a}else if(e[n+1]===`?`)n=ec(e,`?>`,n+1,`StopNode is not closed.`);else if(e.substr(n+1,3)===`!--`)n=ec(e,`-->`,n+3,`StopNode is not closed.`);else if(e.substr(n+1,2)===`![`)n=ec(e,`]]>`,n,`StopNode is not closed.`)-2;else{let r=tc(e,n,`>`);r&&((r&&r.tagName)===t&&r.tagExp[r.tagExp.length-1]!==`/`&&i++,n=r.closeIndex)}}function rc(e,t,n){if(t&&typeof e==`string`){let t=e.trim();return t===`true`?!0:t===`false`?!1:Is(e,n)}else if(as(e))return e;else return``}const ic=ws.getMetaDataSymbol();function ac(e,t){return oc(e,t)}function oc(e,t,n){let r,i={};for(let a=0;a<e.length;a++){let o=e[a],s=sc(o),c=``;if(c=n===void 0?s:n+`.`+s,s===t.textNodeName)r===void 0?r=o[s]:r+=``+o[s];else if(s===void 0)continue;else if(o[s]){let e=oc(o[s],t,c),n=lc(e,t);o[ic]!==void 0&&(e[ic]=o[ic]),o[`:@`]?cc(e,o[`:@`],c,t):Object.keys(e).length===1&&e[t.textNodeName]!==void 0&&!t.alwaysCreateTextNode?e=e[t.textNodeName]:Object.keys(e).length===0&&(t.alwaysCreateTextNode?e[t.textNodeName]=``:e=``),i[s]!==void 0&&i.hasOwnProperty(s)?(Array.isArray(i[s])||(i[s]=[i[s]]),i[s].push(e)):t.isArray(s,c,n)?i[s]=[e]:i[s]=e}}return typeof r==`string`?r.length>0&&(i[t.textNodeName]=r):r!==void 0&&(i[t.textNodeName]=r),i}function sc(e){let t=Object.keys(e);for(let e=0;e<t.length;e++){let n=t[e];if(n!==`:@`)return n}}function cc(e,t,n,r){if(t){let i=Object.keys(t),a=i.length;for(let o=0;o<a;o++){let a=i[o];r.isArray(a,n+`.`+a,!0,!0)?e[a]=[t[a]]:e[a]=t[a]}}}function lc(e,t){let{textNodeName:n}=t,r=Object.keys(e).length;return!!(r===0||r===1&&(e[n]||typeof e[n]==`boolean`||e[n]===0))}var uc=class{constructor(e){this.externalEntities={},this.options=Ss(e)}parse(e,t){if(typeof e!=`string`)if(e.toString)e=e.toString();else throw Error(`XML data is accepted in String or Bytes[] form.`);if(t){t===!0&&(t={});let n=ss(e,t);if(n!==!0)throw Error(`${n.err.msg}:${n.err.line}:${n.err.col}`)}let n=new Hs(this.options);n.addExternalEntities(this.externalEntities);let r=n.parseXml(e);return this.options.preserveOrder||r===void 0?r:ac(r,this.options)}addEntity(e,t){if(t.indexOf(`&`)!==-1)throw Error(`Entity value can't have '&'`);if(e.indexOf(`&`)!==-1||e.indexOf(`;`)!==-1)throw Error(`An entity must be set without '&' and ';'. Eg. use '#xD' for '
'`);if(t===`&`)throw Error(`An entity with value '&' is not permitted`);this.externalEntities[e]=t}static getMetaDataSymbol(){return ws.getMetaDataSymbol()}};const dc=`
|
|
187
187
|
`;function fc(e,t){let n=``;return t.format&&t.indentBy.length>0&&(n=`
|
|
188
188
|
`),pc(e,t,``,n)}function pc(e,t,n,r){let i=``,a=!1;for(let o=0;o<e.length;o++){let s=e[o],c=mc(s);if(c===void 0)continue;let l=``;if(l=n.length===0?c:`${n}.${c}`,c===t.textNodeName){let e=s[c];gc(l,t)||(e=t.tagValueProcessor(c,e),e=_c(e,t)),a&&(i+=r),i+=e,a=!1;continue}else if(c===t.cdataPropName){a&&(i+=r),i+=`<![CDATA[${s[c][0][t.textNodeName]}]]>`,a=!1;continue}else if(c===t.commentPropName){i+=r+`<!--${s[c][0][t.textNodeName]}-->`,a=!0;continue}else if(c[0]===`?`){let e=hc(s[`:@`],t),n=c===`?xml`?``:r,o=s[c][0][t.textNodeName];o=o.length===0?``:` `+o,i+=n+`<${c}${o}${e}?>`,a=!0;continue}let u=r;u!==``&&(u+=t.indentBy);let d=r+`<${c}${hc(s[`:@`],t)}`,f=pc(s[c],t,l,u);t.unpairedTags.indexOf(c)===-1?(!f||f.length===0)&&t.suppressEmptyNode?i+=d+`/>`:f&&f.endsWith(`>`)?i+=d+`>${f}${r}</${c}>`:(i+=d+`>`,f&&r!==``&&(f.includes(`/>`)||f.includes(`</`))?i+=r+t.indentBy+f+r:i+=f,i+=`</${c}>`):t.suppressUnpairedNode?i+=d+`>`:i+=d+`/>`,a=!0}return i}function mc(e){let t=Object.keys(e);for(let n=0;n<t.length;n++){let r=t[n];if(e.hasOwnProperty(r)&&r!==`:@`)return r}}function hc(e,t){let n=``;if(e&&!t.ignoreAttributes)for(let r in e){if(!e.hasOwnProperty(r))continue;let i=t.attributeValueProcessor(r,e[r]);i=_c(i,t),i===!0&&t.suppressBooleanAttributes?n+=` ${r.substr(t.attributeNamePrefix.length)}`:n+=` ${r.substr(t.attributeNamePrefix.length)}="${i}"`}return n}function gc(e,t){e=e.substr(0,e.length-t.textNodeName.length-1);let n=e.substr(e.lastIndexOf(`.`)+1);for(let r in t.stopNodes)if(t.stopNodes[r]===e||t.stopNodes[r]===`*.`+n)return!0;return!1}function _c(e,t){if(e&&e.length>0&&t.processEntities)for(let n=0;n<t.entities.length;n++){let r=t.entities[n];e=e.replace(r.regex,r.val)}return e}const vc={attributeNamePrefix:`@_`,attributesGroupName:!1,textNodeName:`#text`,ignoreAttributes:!0,cdataPropName:!1,format:!1,indentBy:` `,suppressEmptyNode:!1,suppressUnpairedNode:!0,suppressBooleanAttributes:!0,tagValueProcessor:function(e,t){return t},attributeValueProcessor:function(e,t){return t},preserveOrder:!1,commentPropName:!1,unpairedTags:[],entities:[{regex:RegExp(`&`,`g`),val:`&`},{regex:RegExp(`>`,`g`),val:`>`},{regex:RegExp(`<`,`g`),val:`<`},{regex:RegExp(`'`,`g`),val:`'`},{regex:RegExp(`"`,`g`),val:`"`}],processEntities:!0,stopNodes:[],oneListGroup:!1};function yc(e){this.options=Object.assign({},vc,e),this.options.ignoreAttributes===!0||this.options.attributesGroupName?this.isAttribute=function(){return!1}:(this.ignoreAttributesFn=Vs(this.options.ignoreAttributes),this.attrPrefixLen=this.options.attributeNamePrefix.length,this.isAttribute=Sc),this.processTextOrObjNode=bc,this.options.format?(this.indentate=xc,this.tagEndChar=`>
|
package/dist/index.mjs
CHANGED
|
@@ -105,7 +105,7 @@ Example:
|
|
|
105
105
|
import { create, all } from 'mathjs';
|
|
106
106
|
const mathjs = create(all);
|
|
107
107
|
mathjs.config({ number: 'BigNumber' });
|
|
108
|
-
`);return Object.freeze(rt)};(0,Yt.default)(Xt,rt,{MATRIX_OPTIONS:qt,NUMBER_OPTIONS:Jt});var Zt=D(((e,t)=>{(function(n,r){typeof e==`object`&&t!==void 0?t.exports=r():typeof define==`function`&&define.amd?define(r):(n=typeof globalThis<`u`?globalThis:n||self,n[`'typed'`]=r())})(e,(function(){function e(){return!0}function t(){return!1}function n(){}let r=`Argument is not a typed-function.`;function i(){function a(e){return typeof e==`object`&&!!e&&e.constructor===Object}let o=[{name:`number`,test:function(e){return typeof e==`number`}},{name:`string`,test:function(e){return typeof e==`string`}},{name:`boolean`,test:function(e){return typeof e==`boolean`}},{name:`Function`,test:function(e){return typeof e==`function`}},{name:`Array`,test:Array.isArray},{name:`Date`,test:function(e){return e instanceof Date}},{name:`RegExp`,test:function(e){return e instanceof RegExp}},{name:`Object`,test:a},{name:`null`,test:function(e){return e===null}},{name:`undefined`,test:function(e){return e===void 0}}],s={name:`any`,test:e,isAny:!0},c,l,u=0,d={createCount:0};function f(e){let t=c.get(e);if(t)return t;let n=`Unknown type "`+e+`"`,r=e.toLowerCase(),i;for(i of l)if(i.toLowerCase()===r){n+=`. Did you mean "`+i+`" ?`;break}throw TypeError(n)}function p(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:`any`,n=t?f(t).index:l.length,r=[];for(let t=0;t<e.length;++t){if(!e[t]||typeof e[t].name!=`string`||typeof e[t].test!=`function`)throw TypeError(`Object with properties {name: string, test: function} expected`);let i=e[t].name;if(c.has(i))throw TypeError(`Duplicate type name "`+i+`"`);r.push(i),c.set(i,{name:i,test:e[t].test,isAny:e[t].isAny,index:n+t,conversionsTo:[]})}let i=l.slice(n);l=l.slice(0,n).concat(r).concat(i);for(let e=n+r.length;e<l.length;++e)c.get(l[e]).index=e}function m(){c=new Map,l=[],u=0,p([s],!1)}m(),p(o);function h(){let e;for(e of l)c.get(e).conversionsTo=[];u=0}function g(e){let t=l.filter(t=>{let n=c.get(t);return!n.isAny&&n.test(e)});return t.length?t:[`any`]}function _(e){return e&&typeof e==`function`&&`_typedFunctionData`in e}function v(e,t,n){if(!_(e))throw TypeError(r);let i=n&&n.exact,a=w(Array.isArray(t)?t.join(`,`):t),o=x(a);if(!i||o in e.signatures){let t=e._typedFunctionData.signatureMap.get(o);if(t)return t}let s=a.length,c;if(i){c=[];let t;for(t in e.signatures)c.push(e._typedFunctionData.signatureMap.get(t))}else c=e._typedFunctionData.signatures;for(let e=0;e<s;++e){let t=a[e],n=[],r;for(r of c){let i=ne(r.params,e);if(!(!i||t.restParam&&!i.restParam)){if(!i.hasAny){let e=ee(i);if(t.types.some(t=>!e.has(t.name)))continue}n.push(r)}}if(c=n,c.length===0)break}let l;for(l of c)if(l.params.length<=s)return l;throw TypeError(`Signature not found (signature: `+(e.name||`unnamed`)+`(`+x(a,`, `)+`))`)}function y(e,t,n){return v(e,t,n).implementation}function b(e,t){let n=f(t);if(n.test(e))return e;let r=n.conversionsTo;if(r.length===0)throw Error(`There are no conversions to `+t+` defined.`);for(let t=0;t<r.length;t++)if(f(r[t].from).test(e))return r[t].convert(e);throw Error(`Cannot convert `+e+` to `+t)}function x(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:`,`;return e.map(e=>e.name).join(t)}function S(e){let t=e.indexOf(`...`)===0,n=(t?e.length>3?e.slice(3):`any`:e).split(`|`).map(e=>f(e.trim())),r=!1,i=t?`...`:``;return{types:n.map(function(e){return r=e.isAny||r,i+=e.name+`|`,{name:e.name,typeIndex:e.index,test:e.test,isAny:e.isAny,conversion:null,conversionIndex:-1}}),name:i.slice(0,-1),hasAny:r,hasConversion:!1,restParam:t}}function C(e){let t=ce(e.types.map(e=>e.name)),n=e.hasAny,r=e.name,i=t.map(function(e){let t=f(e.from);return n=t.isAny||n,r+=`|`+e.from,{name:e.from,typeIndex:t.index,test:t.test,isAny:t.isAny,conversion:e,conversionIndex:e.index}});return{types:e.types.concat(i),name:r,hasAny:n,hasConversion:i.length>0,restParam:e.restParam}}function ee(e){return e.typeSet||(e.typeSet=new Set,e.types.forEach(t=>e.typeSet.add(t.name))),e.typeSet}function w(e){let t=[];if(typeof e!=`string`)throw TypeError(`Signatures must be strings`);let n=e.trim();if(n===``)return t;let r=n.split(`,`);for(let e=0;e<r.length;++e){let n=S(r[e].trim());if(n.restParam&&e!==r.length-1)throw SyntaxError(`Unexpected rest parameter "`+r[e]+`": only allowed for the last parameter`);if(n.types.length===0)return null;t.push(n)}return t}function T(e){let t=ye(e);return t?t.restParam:!1}function E(t){if(!t||t.types.length===0)return e;if(t.types.length===1)return f(t.types[0].name).test;if(t.types.length===2){let e=f(t.types[0].name).test,n=f(t.types[1].name).test;return function(t){return e(t)||n(t)}}else{let e=t.types.map(function(e){return f(e.name).test});return function(t){for(let n=0;n<e.length;n++)if(e[n](t))return!0;return!1}}}function te(e){let t,n,r;if(T(e)){t=ve(e).map(E);let n=t.length,r=E(ye(e)),i=function(e){for(let t=n;t<e.length;t++)if(!r(e[t]))return!1;return!0};return function(e){for(let n=0;n<t.length;n++)if(!t[n](e[n]))return!1;return i(e)&&e.length>=n+1}}else if(e.length===0)return function(e){return e.length===0};else if(e.length===1)return n=E(e[0]),function(e){return n(e[0])&&e.length===1};else if(e.length===2)return n=E(e[0]),r=E(e[1]),function(e){return n(e[0])&&r(e[1])&&e.length===2};else return t=e.map(E),function(e){for(let n=0;n<t.length;n++)if(!t[n](e[n]))return!1;return e.length===t.length}}function ne(e,t){return t<e.length?e[t]:T(e)?ye(e):null}function D(e,t){let n=ne(e,t);return n?ee(n):new Set}function O(e){return e.conversion===null||e.conversion===void 0}function k(e,t){let n=new Set;return e.forEach(e=>{let r=D(e.params,t),i;for(i of r)n.add(i)}),n.has(`any`)?[`any`]:Array.from(n)}function re(e,t,n){let r,i,a=e||`unnamed`,o=n,s;for(s=0;s<t.length;s++){let e=[];if(o.forEach(n=>{let r=E(ne(n.params,s));(s<n.params.length||T(n.params))&&r(t[s])&&e.push(n)}),e.length===0){if(i=k(o,s),i.length>0){let e=g(t[s]);return r=TypeError(`Unexpected type of argument in function `+a+` (expected: `+i.join(` or `)+`, actual: `+e.join(` | `)+`, index: `+s+`)`),r.data={category:`wrongType`,fn:a,index:s,actual:e,expected:i},r}}else o=e}let c=o.map(function(e){return T(e.params)?1/0:e.params.length});if(t.length<Math.min.apply(null,c))return i=k(o,s),r=TypeError(`Too few arguments in function `+a+` (expected: `+i.join(` or `)+`, index: `+t.length+`)`),r.data={category:`tooFewArgs`,fn:a,index:t.length,expected:i},r;let l=Math.max.apply(null,c);if(t.length>l)return r=TypeError(`Too many arguments in function `+a+` (expected: `+l+`, actual: `+t.length+`)`),r.data={category:`tooManyArgs`,fn:a,index:t.length,expectedLength:l},r;let u=[];for(let e=0;e<t.length;++e)u.push(g(t[e]).join(`|`));return r=TypeError(`Arguments of type "`+u.join(`, `)+`" do not match any of the defined signatures of function `+a+`.`),r.data={category:`mismatch`,actual:u},r}function ie(e){let t=l.length+1;for(let n=0;n<e.types.length;n++)O(e.types[n])&&(t=Math.min(t,e.types[n].typeIndex));return t}function ae(e){let t=u+1;for(let n=0;n<e.types.length;n++)O(e.types[n])||(t=Math.min(t,e.types[n].conversionIndex));return t}function oe(e,t){if(e.hasAny){if(!t.hasAny)return 1}else if(t.hasAny)return-1;if(e.restParam){if(!t.restParam)return 1}else if(t.restParam)return-1;if(e.hasConversion){if(!t.hasConversion)return 1}else if(t.hasConversion)return-1;let n=ie(e)-ie(t);if(n<0)return-1;if(n>0)return 1;let r=ae(e)-ae(t);return r<0?-1:r>0?1:0}function se(e,t){let n=e.params,r=t.params,i=ye(n),a=ye(r),o=T(n),s=T(r);if(o&&i.hasAny){if(!s||!a.hasAny)return 1}else if(s&&a.hasAny)return-1;let c=0,l=0,u;for(u of n)u.hasAny&&++c,u.hasConversion&&++l;let d=0,f=0;for(u of r)u.hasAny&&++d,u.hasConversion&&++f;if(c!==d)return c-d;if(o&&i.hasConversion){if(!s||!a.hasConversion)return 1}else if(s&&a.hasConversion)return-1;if(l!==f)return l-f;if(o){if(!s)return 1}else if(s)return-1;let p=(n.length-r.length)*(o?-1:1);if(p!==0)return p;let m=[],h=0;for(let e=0;e<n.length;++e){let t=oe(n[e],r[e]);m.push(t),h+=t}if(h!==0)return h;let g;for(g of m)if(g!==0)return g;return 0}function ce(e){if(e.length===0)return[];let t=e.map(f);e.length>1&&t.sort((e,t)=>e.index-t.index);let n=t[0].conversionsTo;if(e.length===1)return n;n=n.concat([]);let r=new Set(e);for(let e=1;e<t.length;++e){let i;for(i of t[e].conversionsTo)r.has(i.from)||(n.push(i),r.add(i.from))}return n}function le(e,t){let n=t;if(e.some(e=>e.hasConversion)){let r=T(e),i=e.map(ue);n=function(){let e=[],n=r?arguments.length-1:arguments.length;for(let t=0;t<n;t++)e[t]=i[t](arguments[t]);return r&&(e[n]=arguments[n].map(i[n])),t.apply(this,e)}}let r=n;if(T(e)){let t=e.length-1;r=function(){return n.apply(this,be(arguments,0,t).concat([be(arguments,t)]))}}return r}function ue(e){let t,n,r,i,a=[],o=[];switch(e.types.forEach(function(e){e.conversion&&(a.push(f(e.conversion.from).test),o.push(e.conversion.convert))}),o.length){case 0:return function(e){return e};case 1:return t=a[0],r=o[0],function(e){return t(e)?r(e):e};case 2:return t=a[0],n=a[1],r=o[0],i=o[1],function(e){return t(e)?r(e):n(e)?i(e):e};default:return function(e){for(let t=0;t<o.length;t++)if(a[t](e))return o[t](e);return e}}}function de(e){function t(e,n,r){if(n<e.length){let i=e[n],a=[];if(i.restParam){let e=i.types.filter(O);e.length<i.types.length&&a.push({types:e,name:`...`+e.map(e=>e.name).join(`|`),hasAny:e.some(e=>e.isAny),hasConversion:!1,restParam:!0}),a.push(i)}else a=i.types.map(function(e){return{types:[e],name:e.name,hasAny:e.isAny,hasConversion:e.conversion,restParam:!1}});return Se(a,function(i){return t(e,n+1,r.concat([i]))})}else return[r]}return t(e,0,[])}function A(e,t){let n=Math.max(e.length,t.length);for(let r=0;r<n;r++){let n=D(e,r),i=D(t,r),a=!1,o;for(o of i)if(n.has(o)){a=!0;break}if(!a)return!1}let r=e.length,i=t.length,a=T(e),o=T(t);return a?o?r===i:i>=r:o?r>=i:r===i}function fe(e){return e.map(e=>De(e)?Te(e.referToSelf.callback):Ee(e)?we(e.referTo.references,e.referTo.callback):e)}function pe(e,t,n){let r=[],i;for(i of e){let e=n[i];if(typeof e!=`number`)throw TypeError(`No definition for referenced signature "`+i+`"`);if(e=t[e],typeof e!=`function`)return!1;r.push(e)}return r}function me(e,t,n){let r=fe(e),i=Array(r.length).fill(!1),a=!0;for(;a;){a=!1;let e=!0;for(let o=0;o<r.length;++o){if(i[o])continue;let s=r[o];if(De(s))r[o]=s.referToSelf.callback(n),r[o].referToSelf=s.referToSelf,i[o]=!0,e=!1;else if(Ee(s)){let n=pe(s.referTo.references,r,t);n?(r[o]=s.referTo.callback.apply(this,n),r[o].referTo=s.referTo,i[o]=!0,e=!1):a=!0}}if(e&&a)throw SyntaxError(`Circular reference detected in resolving typed.referTo`)}return r}function he(e){let t=/\bthis(\(|\.signatures\b)/;Object.keys(e).forEach(n=>{let r=e[n];if(t.test(r.toString()))throw SyntaxError("Using `this` to self-reference a function is deprecated since typed-function@3. Use typed.referTo and typed.referToSelf instead.")})}function ge(e,r){if(d.createCount++,Object.keys(r).length===0)throw SyntaxError(`No signatures provided`);d.warnAgainstDeprecatedThis&&he(r);let i=[],a=[],o={},s=[],c;for(c in r){if(!Object.prototype.hasOwnProperty.call(r,c))continue;let e=w(c);if(!e)continue;i.forEach(function(t){if(A(t,e))throw TypeError(`Conflicting signatures "`+x(t)+`" and "`+x(e)+`".`)}),i.push(e);let t=a.length;a.push(r[c]);let n=e.map(C),l;for(l of de(n)){let e=x(l);s.push({params:l,name:e,fn:t}),l.every(e=>!e.hasConversion)&&(o[e]=t)}}s.sort(se);let l=me(a,o,je),u;for(u in o)Object.prototype.hasOwnProperty.call(o,u)&&(o[u]=l[o[u]]);let f=[],p=new Map;for(u of s)p.has(u.name)||(u.fn=l[u.fn],f.push(u),p.set(u.name,u));let m=f[0]&&f[0].params.length<=2&&!T(f[0].params),h=f[1]&&f[1].params.length<=2&&!T(f[1].params),g=f[2]&&f[2].params.length<=2&&!T(f[2].params),_=f[3]&&f[3].params.length<=2&&!T(f[3].params),v=f[4]&&f[4].params.length<=2&&!T(f[4].params),y=f[5]&&f[5].params.length<=2&&!T(f[5].params),b=m&&h&&g&&_&&v&&y;for(let e=0;e<f.length;++e)f[e].test=te(f[e].params);let S=m?E(f[0].params[0]):t,ee=h?E(f[1].params[0]):t,ne=g?E(f[2].params[0]):t,D=_?E(f[3].params[0]):t,O=v?E(f[4].params[0]):t,k=y?E(f[5].params[0]):t,re=m?E(f[0].params[1]):t,ie=h?E(f[1].params[1]):t,ae=g?E(f[2].params[1]):t,oe=_?E(f[3].params[1]):t,ce=v?E(f[4].params[1]):t,ue=y?E(f[5].params[1]):t;for(let e=0;e<f.length;++e)f[e].implementation=le(f[e].params,f[e].fn);let fe=m?f[0].implementation:n,pe=h?f[1].implementation:n,ge=g?f[2].implementation:n,_e=_?f[3].implementation:n,ve=v?f[4].implementation:n,ye=y?f[5].implementation:n,be=m?f[0].params.length:-1,xe=h?f[1].params.length:-1,Se=g?f[2].params.length:-1,Ce=_?f[3].params.length:-1,we=v?f[4].params.length:-1,Te=y?f[5].params.length:-1,Ee=b?6:0,De=f.length,Oe=f.map(e=>e.test),ke=f.map(e=>e.implementation),Ae=function(){for(let e=Ee;e<De;e++)if(Oe[e](arguments))return ke[e].apply(this,arguments);return d.onMismatch(e,arguments,f)};function je(e,t){return arguments.length===be&&S(e)&&re(t)?fe.apply(this,arguments):arguments.length===xe&&ee(e)&&ie(t)?pe.apply(this,arguments):arguments.length===Se&&ne(e)&&ae(t)?ge.apply(this,arguments):arguments.length===Ce&&D(e)&&oe(t)?_e.apply(this,arguments):arguments.length===we&&O(e)&&ce(t)?ve.apply(this,arguments):arguments.length===Te&&k(e)&&ue(t)?ye.apply(this,arguments):Ae.apply(this,arguments)}try{Object.defineProperty(je,`name`,{value:e})}catch{}return je.signatures=o,je._typedFunctionData={signatures:f,signatureMap:p},je}function _e(e,t,n){throw re(e,t,n)}function ve(e){return be(e,0,e.length-1)}function ye(e){return e[e.length-1]}function be(e,t,n){return Array.prototype.slice.call(e,t,n)}function xe(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return e[n]}function Se(e,t){return Array.prototype.concat.apply([],e.map(t))}function Ce(){let e=ve(arguments).map(e=>x(w(e))),t=ye(arguments);if(typeof t!=`function`)throw TypeError(`Callback function expected as last argument`);return we(e,t)}function we(e,t){return{referTo:{references:e,callback:t}}}function Te(e){if(typeof e!=`function`)throw TypeError(`Callback function expected as first argument`);return{referToSelf:{callback:e}}}function Ee(e){return e&&typeof e.referTo==`object`&&Array.isArray(e.referTo.references)&&typeof e.referTo.callback==`function`}function De(e){return e&&typeof e.referToSelf==`object`&&typeof e.referToSelf.callback==`function`}function Oe(e,t){if(!e)return t;if(t&&t!==e){let n=Error(`Function names do not match (expected: `+e+`, actual: `+t+`)`);throw n.data={actual:t,expected:e},n}return e}function ke(e){let t;for(let n in e)Object.prototype.hasOwnProperty.call(e,n)&&(_(e[n])||typeof e[n].signature==`string`)&&(t=Oe(t,e[n].name));return t}function Ae(e,t){let n;for(n in t)if(Object.prototype.hasOwnProperty.call(t,n)){if(n in e&&t[n]!==e[n]){let r=Error(`Signature "`+n+`" is defined twice`);throw r.data={signature:n,sourceFunction:t[n],destFunction:e[n]},r}e[n]=t[n]}}let je=d;d=function(e){let t=typeof e==`string`,n=t?1:0,r=t?e:``,i={};for(let e=n;e<arguments.length;++e){let n=arguments[e],o={},s;if(typeof n==`function`?(s=n.name,typeof n.signature==`string`?o[n.signature]=n:_(n)&&(o=n.signatures)):a(n)&&(o=n,t||(s=ke(n))),Object.keys(o).length===0){let t=TypeError(`Argument to 'typed' at index `+e+` is not a (typed) function, nor an object with signatures as keys and functions as values.`);throw t.data={index:e,argument:n},t}t||(r=Oe(r,s)),Ae(i,o)}return ge(r||``,i)},d.create=i,d.createCount=je.createCount,d.onMismatch=_e,d.throwMismatchError=_e,d.createError=re,d.clear=m,d.clearConversions=h,d.addTypes=p,d._findType=f,d.referTo=Ce,d.referToSelf=Te,d.convert=b,d.findSignature=v,d.find=y,d.isTypedFunction=_,d.warnAgainstDeprecatedThis=!0,d.addType=function(e,t){let n=`any`;t!==!1&&c.has(`Object`)&&(n=`Object`),d.addTypes([e],n)};function Me(e){if(!e||typeof e.from!=`string`||typeof e.to!=`string`||typeof e.convert!=`function`)throw TypeError(`Object with properties {from: string, to: string, convert: function} expected`);if(e.to===e.from)throw SyntaxError(`Illegal to define conversion from "`+e.from+`" to itself.`)}return d.addConversion=function(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{override:!1};Me(e);let n=f(e.to),r=n.conversionsTo.find(t=>t.from===e.from);if(r)if(t&&t.override)d.removeConversion({from:r.from,to:e.to,convert:r.convert});else throw Error(`There is already a conversion from "`+e.from+`" to "`+n.name+`"`);n.conversionsTo.push({from:e.from,convert:e.convert,index:u++})},d.addConversions=function(e,t){e.forEach(e=>d.addConversion(e,t))},d.removeConversion=function(e){Me(e);let t=f(e.to),n=xe(t.conversionsTo,t=>t.from===e.from);if(!n)throw Error(`Attempt to remove nonexistent conversion from `+e.from+` to `+e.to);if(n.convert!==e.convert)throw Error(`Conversion to remove does not match existing conversion`);let r=t.conversionsTo.indexOf(n);t.conversionsTo.splice(r,1)},d.resolve=function(e,t){if(!_(e))throw TypeError(r);let n=e._typedFunctionData.signatures;for(let e=0;e<n.length;++e)if(n[e].test(t))return n[e];return null},d}return i()}))}));function N(e){return typeof e==`boolean`?!0:isFinite(e)?e===Math.round(e):!1}function Qt(e,t,n){var r={2:`0b`,8:`0o`,16:`0x`}[t],i=``;if(n){if(n<1)throw Error(`size must be in greater than 0`);if(!N(n))throw Error(`size must be an integer`);if(e>2**(n-1)-1||e<-(2**(n-1)))throw Error(`Value must be in range [-2^${n-1}, 2^${n-1}-1]`);if(!N(e))throw Error(`Value must be an integer`);e<0&&(e+=2**n),i=`i${n}`}var a=``;return e<0&&(e=-e,a=`-`),`${a}${r}${e.toString(t)}${i}`}function $t(e,t){if(typeof t==`function`)return t(e);if(e===1/0)return`Infinity`;if(e===-1/0)return`-Infinity`;if(isNaN(e))return`NaN`;var n=`auto`,r,i;if(t&&(t.notation&&(n=t.notation),j(t)?r=t:j(t.precision)&&(r=t.precision),t.wordSize&&(i=t.wordSize,typeof i!=`number`)))throw Error(`Option "wordSize" must be a number`);switch(n){case`fixed`:return nn(e,r);case`exponential`:return rn(e,r);case`engineering`:return tn(e,r);case`bin`:return Qt(e,2,i);case`oct`:return Qt(e,8,i);case`hex`:return Qt(e,16,i);case`auto`:return an(e,r,t&&t).replace(/((\.\d*?)(0+))($|e)/,function(){var e=arguments[2],t=arguments[4];return e===`.`?t:e+t});default:throw Error(`Unknown notation "`+n+`". Choose "auto", "exponential", "fixed", "bin", "oct", or "hex.`)}}function en(e){var t=String(e).toLowerCase().match(/^(-?)(\d+\.?\d*)(e([+-]?\d+))?$/);if(!t)throw SyntaxError(`Invalid number `+e);var n=t[1],r=t[2],i=parseFloat(t[4]||`0`),a=r.indexOf(`.`);i+=a===-1?r.length-1:a-1;var o=r.replace(`.`,``).replace(/^0*/,function(e){return i-=e.length,``}).replace(/0*$/,``).split(``).map(function(e){return parseInt(e)});return o.length===0&&(o.push(0),i++),{sign:n,coefficients:o,exponent:i}}function tn(e,t){if(isNaN(e)||!isFinite(e))return String(e);var n=on(en(e),t),r=n.exponent,i=n.coefficients,a=r%3==0?r:r<0?r-3-r%3:r-r%3;if(j(t))for(;t>i.length||r-a+1>i.length;)i.push(0);else for(var o=Math.abs(r-a)-(i.length-1),s=0;s<o;s++)i.push(0);for(var c=Math.abs(r-a),l=1;c>0;)l++,c--;var u=i.slice(l).join(``),d=j(t)&&u.length||u.match(/[1-9]/)?`.`+u:``,f=i.slice(0,l).join(``)+d+`e`+(r>=0?`+`:``)+a.toString();return n.sign+f}function nn(e,t){if(isNaN(e)||!isFinite(e))return String(e);var n=en(e),r=typeof t==`number`?on(n,n.exponent+1+t):n,i=r.coefficients,a=r.exponent+1,o=a+(t||0);return i.length<o&&(i=i.concat(sn(o-i.length))),a<0&&(i=sn(-a+1).concat(i),a=1),a<i.length&&i.splice(a,0,a===0?`0.`:`.`),r.sign+i.join(``)}function rn(e,t){if(isNaN(e)||!isFinite(e))return String(e);var n=en(e),r=t?on(n,t):n,i=r.coefficients,a=r.exponent;i.length<t&&(i=i.concat(sn(t-i.length)));var o=i.shift();return r.sign+o+(i.length>0?`.`+i.join(``):``)+`e`+(a>=0?`+`:``)+a}function an(e,t,n){if(isNaN(e)||!isFinite(e))return String(e);var r=n&&n.lowerExp!==void 0?n.lowerExp:-3,i=n&&n.upperExp!==void 0?n.upperExp:5,a=en(e),o=t?on(a,t):a;if(o.exponent<r||o.exponent>=i)return rn(e,t);var s=o.coefficients,c=o.exponent;s.length<t&&(s=s.concat(sn(t-s.length))),s=s.concat(sn(c-s.length+1+(s.length<t?t-s.length:0))),s=sn(-c).concat(s);var l=c>0?c:0;return l<s.length-1&&s.splice(l+1,0,`.`),o.sign+s.join(``)}function on(e,t){for(var n={sign:e.sign,coefficients:e.coefficients,exponent:e.exponent},r=n.coefficients;t<=0;)r.unshift(0),n.exponent++,t++;if(r.length>t&&r.splice(t,r.length-t)[0]>=5){var i=t-1;for(r[i]++;r[i]===10;)r.pop(),i===0&&(r.unshift(0),n.exponent++,i++),i--,r[i]++}return n}function sn(e){for(var t=[],n=0;n<e;n++)t.push(0);return t}function cn(e){return e.toExponential().replace(/e.*$/,``).replace(/^0\.?0*|\./,``).length}function ln(e,t,n){var r=e.constructor,i=new r(2),a=``;if(n){if(n<1)throw Error(`size must be in greater than 0`);if(!N(n))throw Error(`size must be an integer`);if(e.greaterThan(i.pow(n-1).sub(1))||e.lessThan(i.pow(n-1).mul(-1)))throw Error(`Value must be in range [-2^${n-1}, 2^${n-1}-1]`);if(!e.isInteger())throw Error(`Value must be an integer`);e.lessThan(0)&&(e=e.add(i.pow(n))),a=`i${n}`}switch(t){case 2:return`${e.toBinary()}${a}`;case 8:return`${e.toOctal()}${a}`;case 16:return`${e.toHexadecimal()}${a}`;default:throw Error(`Base ${t} not supported `)}}function un(e,t){if(typeof t==`function`)return t(e);if(!e.isFinite())return e.isNaN()?`NaN`:e.gt(0)?`Infinity`:`-Infinity`;var n=`auto`,r,i;if(t!==void 0&&(t.notation&&(n=t.notation),typeof t==`number`?r=t:t.precision!==void 0&&(r=t.precision),t.wordSize&&(i=t.wordSize,typeof i!=`number`)))throw Error(`Option "wordSize" must be a number`);switch(n){case`fixed`:return pn(e,r);case`exponential`:return fn(e,r);case`engineering`:return dn(e,r);case`bin`:return ln(e,2,i);case`oct`:return ln(e,8,i);case`hex`:return ln(e,16,i);case`auto`:var a=t&&t.lowerExp!==void 0?t.lowerExp:-3,o=t&&t.upperExp!==void 0?t.upperExp:5;if(e.isZero())return`0`;var s,c=e.toSignificantDigits(r),l=c.e;return s=l>=a&&l<o?c.toFixed():fn(e,r),s.replace(/((\.\d*?)(0+))($|e)/,function(){var e=arguments[2],t=arguments[4];return e===`.`?t:e+t});default:throw Error(`Unknown notation "`+n+`". Choose "auto", "exponential", "fixed", "bin", "oct", or "hex.`)}}function dn(e,t){var n=e.e,r=n%3==0?n:n<0?n-3-n%3:n-n%3,i=e.mul(10**-r).toPrecision(t);if(i.indexOf(`e`)!==-1){var a=e.constructor;i=new a(i).toFixed()}return i+`e`+(n>=0?`+`:``)+r.toString()}function fn(e,t){return t===void 0?e.toExponential():e.toExponential(t-1)}function pn(e,t){return e.toFixed(t)}function mn(e,t){var n=hn(e,t);return t&&typeof t==`object`&&`truncate`in t&&n.length>t.truncate?n.substring(0,t.truncate-3)+`...`:n}function hn(e,t){return typeof e==`number`?$t(e,t):it(e)?un(e,t):yn(e)?!t||t.fraction!==`decimal`?e.s*e.n+`/`+e.d:e.toString():Array.isArray(e)?vn(e,t):ct(e)?gn(e):typeof e==`function`?e.syntax?String(e.syntax):`function`:e&&typeof e==`object`?typeof e.format==`function`?e.format(t):e&&e.toString(t)!=={}.toString()?e.toString(t):`{`+Object.keys(e).map(n=>gn(n)+`: `+mn(e[n],t)).join(`, `)+`}`:String(e)}function gn(e){for(var t=String(e),n=``,r=0;r<t.length;){var i=t.charAt(r);n+=i in _n?_n[i]:i,r++}return`"`+n+`"`}var _n={'"':`\\"`,"\\":`\\\\`,"\b":`\\b`,"\f":`\\f`,"\n":`\\n`,"\r":`\\r`," ":`\\t`};function vn(e,t){if(Array.isArray(e)){for(var n=`[`,r=e.length,i=0;i<r;i++)i!==0&&(n+=`, `),n+=vn(e[i],t);return n+=`]`,n}else return mn(e,t)}function yn(e){return e&&typeof e==`object`&&typeof e.s==`number`&&typeof e.n==`number`&&typeof e.d==`number`||!1}function P(e,t,n){if(!(this instanceof P))throw SyntaxError(`Constructor must be called with the new operator`);this.actual=e,this.expected=t,this.relation=n,this.message=`Dimension mismatch (`+(Array.isArray(e)?`[`+e.join(`, `)+`]`:e)+` `+(this.relation||`!=`)+` `+(Array.isArray(t)?`[`+t.join(`, `)+`]`:t)+`)`,this.stack=Error().stack}P.prototype=RangeError(),P.prototype.constructor=RangeError,P.prototype.name=`DimensionError`,P.prototype.isDimensionError=!0;function bn(e,t,n){if(!(this instanceof bn))throw SyntaxError(`Constructor must be called with the new operator`);this.index=e,arguments.length<3?(this.min=0,this.max=t):(this.min=t,this.max=n),this.min!==void 0&&this.index<this.min?this.message=`Index out of range (`+this.index+` < `+this.min+`)`:this.max!==void 0&&this.index>=this.max?this.message=`Index out of range (`+this.index+` > `+(this.max-1)+`)`:this.message=`Index out of range (`+this.index+`)`,this.stack=Error().stack}bn.prototype=RangeError(),bn.prototype.constructor=RangeError,bn.prototype.name=`IndexError`,bn.prototype.isIndexError=!0;function xn(e){for(var t=[];Array.isArray(e);)t.push(e.length),e=e[0];return t}function Sn(e,t,n){var r,i=e.length;if(i!==t[n])throw new P(i,t[n]);if(n<t.length-1){var a=n+1;for(r=0;r<i;r++){var o=e[r];if(!Array.isArray(o))throw new P(t.length-1,t.length,`<`);Sn(e[r],t,a)}}else for(r=0;r<i;r++)if(Array.isArray(e[r]))throw new P(t.length+1,t.length,`>`)}function Cn(e,t){if(t.length===0){if(Array.isArray(e))throw new P(e.length,0)}else Sn(e,t,0)}function F(e,t){if(e!==void 0){if(!j(e)||!N(e))throw TypeError(`Index must be an integer (value: `+e+`)`);if(e<0||typeof t==`number`&&e>=t)throw new bn(e,t)}}function wn(e,t,n){if(!Array.isArray(t))throw TypeError(`Array expected`);if(t.length===0)throw Error(`Resizing to scalar is not supported`);return t.forEach(function(e){if(!j(e)||!N(e)||e<0)throw TypeError(`Invalid size, must contain positive integers (size: `+mn(t)+`)`)}),(j(e)||it(e))&&(e=[e]),Tn(e,t,0,n===void 0?0:n),e}function Tn(e,t,n,r){var i,a,o=e.length,s=t[n],c=Math.min(o,s);if(e.length=s,n<t.length-1){var l=n+1;for(i=0;i<c;i++)a=e[i],Array.isArray(a)||(a=[a],e[i]=a),Tn(a,t,l,r);for(i=c;i<s;i++)a=[],e[i]=a,Tn(a,t,l,r)}else{for(i=0;i<c;i++)for(;Array.isArray(e[i]);)e[i]=e[i][0];for(i=c;i<s;i++)e[i]=r}}function En(e,t){var n=Mn(e),r=n.length;if(!Array.isArray(e)||!Array.isArray(t))throw TypeError(`Array expected`);if(t.length===0)throw new P(0,r,`!=`);t=Dn(t,r);var i=On(t);if(r!==i)throw new P(i,r,`!=`);try{return kn(n,t)}catch(e){throw e instanceof P?new P(i,r,`!=`):e}}function Dn(e,t){var n=On(e),r=e.slice(),i=-1,a=e.indexOf(i);if(e.indexOf(i,a+1)>=0)throw Error(`More than one wildcard in sizes`);var o=a>=0,s=t%n===0;if(o)if(s)r[a]=-t/n;else throw Error(`Could not replace wildcard, since `+t+` is no multiple of `+-n);return r}function On(e){return e.reduce((e,t)=>e*t,1)}function kn(e,t){for(var n=e,r,i=t.length-1;i>0;i--){var a=t[i];r=[];for(var o=n.length/a,s=0;s<o;s++)r.push(n.slice(s*a,(s+1)*a));n=r}return n}function An(e,t,n,r){var i=r||xn(e);if(n)for(var a=0;a<n;a++)e=[e],i.unshift(1);for(e=jn(e,t,0);i.length<t;)i.push(1);return e}function jn(e,t,n){var r,i;if(Array.isArray(e)){var a=n+1;for(r=0,i=e.length;r<i;r++)e[r]=jn(e[r],t,a)}else for(var o=n;o<t;o++)e=[e];return e}function Mn(e){if(!Array.isArray(e))return e;var t=[];return e.forEach(function e(n){Array.isArray(n)?n.forEach(e):t.push(n)}),t}function Nn(e,t){for(var n,r=0,i=0;i<e.length;i++){var a=e[i],o=Array.isArray(a);if(i===0&&o&&(r=a.length),o&&a.length!==r)return;var s=o?Nn(a,t):t(a);if(n===void 0)n=s;else if(n!==s)return`mixed`}return n}function Pn(e,t,n,r){if(r<n){if(e.length!==t.length)throw new P(e.length,t.length);for(var i=[],a=0;a<e.length;a++)i[a]=Pn(e[a],t[a],n,r+1);return i}else return e.concat(t)}function Fn(){var e=Array.prototype.slice.call(arguments,0,-1),t=Array.prototype.slice.call(arguments,-1);if(e.length===1)return e[0];if(e.length>1)return e.slice(1).reduce(function(e,n){return Pn(e,n,t,0)},e[0]);throw Error(`Wrong number of arguments in function concat`)}function In(){for(var e=[...arguments],t=e.map(e=>e.length),n=Math.max(...t),r=Array(n).fill(null),i=0;i<e.length;i++)for(var a=e[i],o=t[i],s=0;s<o;s++){var c=n-o+s;a[s]>r[c]&&(r[c]=a[s])}for(var l=0;l<e.length;l++)Ln(e[l],r);return r}function Ln(e,t){for(var n=t.length,r=e.length,i=0;i<r;i++){var a=n-r+i;if(e[i]<t[a]&&e[i]>1||e[i]>t[a])throw Error(`shape missmatch: missmatch is found in arg with shape (${e}) not possible to broadcast dimension ${r} with size ${e[i]} to size ${t[a]}`)}}function Rn(e,t){var n=xn(e);if(Wt(n,t))return e;Ln(n,t);var r=In(n,t),i=r.length,a=[...Array(i-n.length).fill(1),...n],o=Bn(e);n.length<i&&(o=En(o,a),n=xn(o));for(var s=0;s<i;s++)n[s]<r[s]&&(o=zn(o,r[s],s),n=xn(o));return o}function zn(e,t,n){return Fn(...Array(t).fill(e),n)}function Bn(e){return(0,Yt.default)([],e)}function Vn(e,t,n,r){function i(r){var i=Kt(r,t.map(Wn));return Hn(e,t,r),n(i)}return i.isFactory=!0,i.fn=e,i.dependencies=t.slice().sort(),r&&(i.meta=r),i}function Hn(e,t,n){if(!t.filter(e=>!Un(e)).every(e=>n[e]!==void 0)){var r=t.filter(e=>n[e]===void 0);throw Error(`Cannot create function "${e}", some dependencies are missing: ${r.map(e=>`"${e}"`).join(`, `)}.`)}}function Un(e){return e&&e[0]===`?`}function Wn(e){return e&&e[0]===`?`?e.slice(1):e}function Gn(e,t){if(Xn(e)&&Jn(e,t))return e[t];throw typeof e[t]==`function`&&Yn(e,t)?Error(`Cannot access method "`+t+`" as a property`):Error(`No access to property "`+t+`"`)}function Kn(e,t,n){if(Xn(e)&&Jn(e,t))return e[t]=n,n;throw Error(`No access to property "`+t+`"`)}function qn(e,t){return t in e}function Jn(e,t){return!e||typeof e!=`object`?!1:Gt(Zn,t)?!0:!(t in Object.prototype||t in Function.prototype)}function Yn(e,t){return e==null||typeof e[t]!=`function`||Gt(e,t)&&Object.getPrototypeOf&&t in Object.getPrototypeOf(e)?!1:Gt(Qn,t)?!0:!(t in Object.prototype||t in Function.prototype)}function Xn(e){return typeof e==`object`&&e&&e.constructor===Object}var Zn={length:!0,name:!0},Qn={toString:!0,valueOf:!0,toLocaleString:!0},$n=class{constructor(e){this.wrappedObject=e}keys(){return Object.keys(this.wrappedObject)}get(e){return Gn(this.wrappedObject,e)}set(e,t){return Kn(this.wrappedObject,e,t),this}has(e){return qn(this.wrappedObject,e)}};function er(e){return e?e instanceof Map||e instanceof $n||typeof e.set==`function`&&typeof e.get==`function`&&typeof e.keys==`function`&&typeof e.has==`function`:!1}var tr=k(Zt(),1),nr=function(){return nr=tr.default.create,tr.default},rr=Vn(`typed`,[`?BigNumber`,`?Complex`,`?DenseMatrix`,`?Fraction`],function(e){var{BigNumber:t,Complex:n,DenseMatrix:r,Fraction:i}=e,a=nr();return a.clear(),a.addTypes([{name:`number`,test:j},{name:`Complex`,test:at},{name:`BigNumber`,test:it},{name:`Fraction`,test:ot},{name:`Unit`,test:st},{name:`identifier`,test:e=>ct&&/^(?:[A-Za-z\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u0870-\u0887\u0889-\u088E\u08A0-\u08C9\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C5D\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16F1-\u16F8\u1700-\u1711\u171F-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1878\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4C\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BF\u31F0-\u31FF\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA7CA\uA7D0\uA7D1\uA7D3\uA7D5-\uA7D9\uA7F2-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF2D-\uDF40\uDF42-\uDF49\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDD70-\uDD7A\uDD7C-\uDD8A\uDD8C-\uDD92\uDD94\uDD95\uDD97-\uDDA1\uDDA3-\uDDB1\uDDB3-\uDDB9\uDDBB\uDDBC\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67\uDF80-\uDF85\uDF87-\uDFB0\uDFB2-\uDFBA]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE35\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2\uDD00-\uDD23\uDE80-\uDEA9\uDEB0\uDEB1\uDF00-\uDF1C\uDF27\uDF30-\uDF45\uDF70-\uDF81\uDFB0-\uDFC4\uDFE0-\uDFF6]|\uD804[\uDC03-\uDC37\uDC71\uDC72\uDC75\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD44\uDD47\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE3F\uDE40\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC5F-\uDC61\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDEB8\uDF00-\uDF1A\uDF40-\uDF46]|\uD806[\uDC00-\uDC2B\uDCA0-\uDCDF\uDCFF-\uDD06\uDD09\uDD0C-\uDD13\uDD15\uDD16\uDD18-\uDD2F\uDD3F\uDD41\uDDA0-\uDDA7\uDDAA-\uDDD0\uDDE1\uDDE3\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE89\uDE9D\uDEB0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD89\uDD98\uDEE0-\uDEF2\uDF02\uDF04-\uDF10\uDF12-\uDF33\uDFB0]|\uD808[\uDC00-\uDF99]|\uD809[\uDC80-\uDD43]|\uD80B[\uDF90-\uDFF0]|[\uD80C\uD81C-\uD820\uD822\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879\uD880-\uD883\uD885-\uD887][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2F\uDC41-\uDC46]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE70-\uDEBE\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDE40-\uDE7F\uDF00-\uDF4A\uDF50\uDF93-\uDF9F\uDFE0\uDFE1\uDFE3]|\uD821[\uDC00-\uDFF7]|\uD823[\uDC00-\uDCD5\uDD00-\uDD08]|\uD82B[\uDFF0-\uDFF3\uDFF5-\uDFFB\uDFFD\uDFFE]|\uD82C[\uDC00-\uDD22\uDD32\uDD50-\uDD52\uDD55\uDD64-\uDD67\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD837[\uDF00-\uDF1E\uDF25-\uDF2A]|\uD838[\uDC30-\uDC6D\uDD00-\uDD2C\uDD37-\uDD3D\uDD4E\uDE90-\uDEAD\uDEC0-\uDEEB]|\uD839[\uDCD0-\uDCEB\uDFE0-\uDFE6\uDFE8-\uDFEB\uDFED\uDFEE\uDFF0-\uDFFE]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43\uDD4B]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDEDF\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF39\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A\uDF50-\uDFFF]|\uD888[\uDC00-\uDFAF])(?:[0-9A-Za-z\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u0870-\u0887\u0889-\u088E\u08A0-\u08C9\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C5D\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16F1-\u16F8\u1700-\u1711\u171F-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1878\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4C\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BF\u31F0-\u31FF\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA7CA\uA7D0\uA7D1\uA7D3\uA7D5-\uA7D9\uA7F2-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF2D-\uDF40\uDF42-\uDF49\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDD70-\uDD7A\uDD7C-\uDD8A\uDD8C-\uDD92\uDD94\uDD95\uDD97-\uDDA1\uDDA3-\uDDB1\uDDB3-\uDDB9\uDDBB\uDDBC\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67\uDF80-\uDF85\uDF87-\uDFB0\uDFB2-\uDFBA]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE35\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2\uDD00-\uDD23\uDE80-\uDEA9\uDEB0\uDEB1\uDF00-\uDF1C\uDF27\uDF30-\uDF45\uDF70-\uDF81\uDFB0-\uDFC4\uDFE0-\uDFF6]|\uD804[\uDC03-\uDC37\uDC71\uDC72\uDC75\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD44\uDD47\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE3F\uDE40\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC5F-\uDC61\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDEB8\uDF00-\uDF1A\uDF40-\uDF46]|\uD806[\uDC00-\uDC2B\uDCA0-\uDCDF\uDCFF-\uDD06\uDD09\uDD0C-\uDD13\uDD15\uDD16\uDD18-\uDD2F\uDD3F\uDD41\uDDA0-\uDDA7\uDDAA-\uDDD0\uDDE1\uDDE3\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE89\uDE9D\uDEB0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD89\uDD98\uDEE0-\uDEF2\uDF02\uDF04-\uDF10\uDF12-\uDF33\uDFB0]|\uD808[\uDC00-\uDF99]|\uD809[\uDC80-\uDD43]|\uD80B[\uDF90-\uDFF0]|[\uD80C\uD81C-\uD820\uD822\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879\uD880-\uD883\uD885-\uD887][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2F\uDC41-\uDC46]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE70-\uDEBE\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDE40-\uDE7F\uDF00-\uDF4A\uDF50\uDF93-\uDF9F\uDFE0\uDFE1\uDFE3]|\uD821[\uDC00-\uDFF7]|\uD823[\uDC00-\uDCD5\uDD00-\uDD08]|\uD82B[\uDFF0-\uDFF3\uDFF5-\uDFFB\uDFFD\uDFFE]|\uD82C[\uDC00-\uDD22\uDD32\uDD50-\uDD52\uDD55\uDD64-\uDD67\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD837[\uDF00-\uDF1E\uDF25-\uDF2A]|\uD838[\uDC30-\uDC6D\uDD00-\uDD2C\uDD37-\uDD3D\uDD4E\uDE90-\uDEAD\uDEC0-\uDEEB]|\uD839[\uDCD0-\uDCEB\uDFE0-\uDFE6\uDFE8-\uDFEB\uDFED\uDFEE\uDFF0-\uDFFE]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43\uDD4B]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDEDF\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF39\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A\uDF50-\uDFFF]|\uD888[\uDC00-\uDFAF])*$/.test(e)},{name:`string`,test:ct},{name:`Chain`,test:Bt},{name:`Array`,test:M},{name:`Matrix`,test:lt},{name:`DenseMatrix`,test:dt},{name:`SparseMatrix`,test:ft},{name:`Range`,test:pt},{name:`Index`,test:mt},{name:`boolean`,test:ht},{name:`ResultSet`,test:gt},{name:`Help`,test:_t},{name:`function`,test:vt},{name:`Date`,test:yt},{name:`RegExp`,test:bt},{name:`null`,test:St},{name:`undefined`,test:Ct},{name:`AccessorNode`,test:wt},{name:`ArrayNode`,test:Tt},{name:`AssignmentNode`,test:Et},{name:`BlockNode`,test:Dt},{name:`ConditionalNode`,test:Ot},{name:`ConstantNode`,test:kt},{name:`FunctionNode`,test:jt},{name:`FunctionAssignmentNode`,test:At},{name:`IndexNode`,test:Mt},{name:`Node`,test:Nt},{name:`ObjectNode`,test:Pt},{name:`OperatorNode`,test:Ft},{name:`ParenthesisNode`,test:It},{name:`RangeNode`,test:Lt},{name:`RelationalNode`,test:Rt},{name:`SymbolNode`,test:zt},{name:`Map`,test:er},{name:`Object`,test:xt}]),a.addConversions([{from:`number`,to:`BigNumber`,convert:function(e){if(t||ir(e),cn(e)>15)throw TypeError(`Cannot implicitly convert a number with >15 significant digits to BigNumber (value: `+e+`). Use function bignumber(x) to convert to BigNumber.`);return new t(e)}},{from:`number`,to:`Complex`,convert:function(e){return n||ar(e),new n(e,0)}},{from:`BigNumber`,to:`Complex`,convert:function(e){return n||ar(e),new n(e.toNumber(),0)}},{from:`Fraction`,to:`BigNumber`,convert:function(e){throw TypeError(`Cannot implicitly convert a Fraction to BigNumber or vice versa. Use function bignumber(x) to convert to BigNumber or fraction(x) to convert to Fraction.`)}},{from:`Fraction`,to:`Complex`,convert:function(e){return n||ar(e),new n(e.valueOf(),0)}},{from:`number`,to:`Fraction`,convert:function(e){i||sr(e);var t=new i(e);if(t.valueOf()!==e)throw TypeError(`Cannot implicitly convert a number to a Fraction when there will be a loss of precision (value: `+e+`). Use function fraction(x) to convert to Fraction.`);return t}},{from:`string`,to:`number`,convert:function(e){var t=Number(e);if(isNaN(t))throw Error(`Cannot convert "`+e+`" to a number`);return t}},{from:`string`,to:`BigNumber`,convert:function(e){t||ir(e);try{return new t(e)}catch{throw Error(`Cannot convert "`+e+`" to BigNumber`)}}},{from:`string`,to:`Fraction`,convert:function(e){i||sr(e);try{return new i(e)}catch{throw Error(`Cannot convert "`+e+`" to Fraction`)}}},{from:`string`,to:`Complex`,convert:function(e){n||ar(e);try{return new n(e)}catch{throw Error(`Cannot convert "`+e+`" to Complex`)}}},{from:`boolean`,to:`number`,convert:function(e){return+e}},{from:`boolean`,to:`BigNumber`,convert:function(e){return t||ir(e),new t(+e)}},{from:`boolean`,to:`Fraction`,convert:function(e){return i||sr(e),new i(+e)}},{from:`boolean`,to:`string`,convert:function(e){return String(e)}},{from:`Array`,to:`Matrix`,convert:function(e){return r||or(),new r(e)}},{from:`Matrix`,to:`Array`,convert:function(e){return e.valueOf()}}]),a.onMismatch=(e,t,n)=>{var r=a.createError(e,t,n);if([`wrongType`,`mismatch`].includes(r.data.category)&&t.length===1&&ut(t[0])&&n.some(e=>!e.params.includes(`,`))){var i=TypeError(`Function '${e}' doesn't apply to matrices. To call it elementwise on a matrix 'M', try 'map(M, ${e})'.`);throw i.data=r.data,i}throw r},a.onMismatch=(e,t,n)=>{var r=a.createError(e,t,n);if([`wrongType`,`mismatch`].includes(r.data.category)&&t.length===1&&ut(t[0])&&n.some(e=>!e.params.includes(`,`))){var i=TypeError(`Function '${e}' doesn't apply to matrices. To call it elementwise on a matrix 'M', try 'map(M, ${e})'.`);throw i.data=r.data,i}throw r},a});function ir(e){throw Error(`Cannot convert value ${e} into a BigNumber: no class 'BigNumber' provided`)}function ar(e){throw Error(`Cannot convert value ${e} into a Complex number: no class 'Complex' provided`)}function or(){throw Error(`Cannot convert array into a Matrix: no class 'DenseMatrix' provided`)}function sr(e){throw Error(`Cannot convert value ${e} into a Fraction, no class 'Fraction' provided.`)}
|
|
108
|
+
`);return Object.freeze(rt)};(0,Yt.default)(Xt,rt,{MATRIX_OPTIONS:qt,NUMBER_OPTIONS:Jt});var Zt=D(((e,t)=>{(function(n,r){typeof e==`object`&&t!==void 0?t.exports=r():typeof define==`function`&&define.amd?define(r):(n=typeof globalThis<`u`?globalThis:n||self,n.typed=r())})(e,(function(){function e(){return!0}function t(){return!1}function n(){}let r=`Argument is not a typed-function.`;function i(){function a(e){return typeof e==`object`&&!!e&&e.constructor===Object}let o=[{name:`number`,test:function(e){return typeof e==`number`}},{name:`string`,test:function(e){return typeof e==`string`}},{name:`boolean`,test:function(e){return typeof e==`boolean`}},{name:`Function`,test:function(e){return typeof e==`function`}},{name:`Array`,test:Array.isArray},{name:`Date`,test:function(e){return e instanceof Date}},{name:`RegExp`,test:function(e){return e instanceof RegExp}},{name:`Object`,test:a},{name:`null`,test:function(e){return e===null}},{name:`undefined`,test:function(e){return e===void 0}}],s={name:`any`,test:e,isAny:!0},c,l,u=0,d={createCount:0};function f(e){let t=c.get(e);if(t)return t;let n=`Unknown type "`+e+`"`,r=e.toLowerCase(),i;for(i of l)if(i.toLowerCase()===r){n+=`. Did you mean "`+i+`" ?`;break}throw TypeError(n)}function p(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:`any`,n=t?f(t).index:l.length,r=[];for(let t=0;t<e.length;++t){if(!e[t]||typeof e[t].name!=`string`||typeof e[t].test!=`function`)throw TypeError(`Object with properties {name: string, test: function} expected`);let i=e[t].name;if(c.has(i))throw TypeError(`Duplicate type name "`+i+`"`);r.push(i),c.set(i,{name:i,test:e[t].test,isAny:e[t].isAny,index:n+t,conversionsTo:[]})}let i=l.slice(n);l=l.slice(0,n).concat(r).concat(i);for(let e=n+r.length;e<l.length;++e)c.get(l[e]).index=e}function m(){c=new Map,l=[],u=0,p([s],!1)}m(),p(o);function h(){let e;for(e of l)c.get(e).conversionsTo=[];u=0}function g(e){let t=l.filter(t=>{let n=c.get(t);return!n.isAny&&n.test(e)});return t.length?t:[`any`]}function _(e){return e&&typeof e==`function`&&`_typedFunctionData`in e}function v(e,t,n){if(!_(e))throw TypeError(r);let i=n&&n.exact,a=w(Array.isArray(t)?t.join(`,`):t),o=x(a);if(!i||o in e.signatures){let t=e._typedFunctionData.signatureMap.get(o);if(t)return t}let s=a.length,c;if(i){c=[];let t;for(t in e.signatures)c.push(e._typedFunctionData.signatureMap.get(t))}else c=e._typedFunctionData.signatures;for(let e=0;e<s;++e){let t=a[e],n=[],r;for(r of c){let i=ne(r.params,e);if(!(!i||t.restParam&&!i.restParam)){if(!i.hasAny){let e=ee(i);if(t.types.some(t=>!e.has(t.name)))continue}n.push(r)}}if(c=n,c.length===0)break}let l;for(l of c)if(l.params.length<=s)return l;throw TypeError(`Signature not found (signature: `+(e.name||`unnamed`)+`(`+x(a,`, `)+`))`)}function y(e,t,n){return v(e,t,n).implementation}function b(e,t){let n=f(t);if(n.test(e))return e;let r=n.conversionsTo;if(r.length===0)throw Error(`There are no conversions to `+t+` defined.`);for(let t=0;t<r.length;t++)if(f(r[t].from).test(e))return r[t].convert(e);throw Error(`Cannot convert `+e+` to `+t)}function x(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:`,`;return e.map(e=>e.name).join(t)}function S(e){let t=e.indexOf(`...`)===0,n=(t?e.length>3?e.slice(3):`any`:e).split(`|`).map(e=>f(e.trim())),r=!1,i=t?`...`:``;return{types:n.map(function(e){return r=e.isAny||r,i+=e.name+`|`,{name:e.name,typeIndex:e.index,test:e.test,isAny:e.isAny,conversion:null,conversionIndex:-1}}),name:i.slice(0,-1),hasAny:r,hasConversion:!1,restParam:t}}function C(e){let t=ce(e.types.map(e=>e.name)),n=e.hasAny,r=e.name,i=t.map(function(e){let t=f(e.from);return n=t.isAny||n,r+=`|`+e.from,{name:e.from,typeIndex:t.index,test:t.test,isAny:t.isAny,conversion:e,conversionIndex:e.index}});return{types:e.types.concat(i),name:r,hasAny:n,hasConversion:i.length>0,restParam:e.restParam}}function ee(e){return e.typeSet||(e.typeSet=new Set,e.types.forEach(t=>e.typeSet.add(t.name))),e.typeSet}function w(e){let t=[];if(typeof e!=`string`)throw TypeError(`Signatures must be strings`);let n=e.trim();if(n===``)return t;let r=n.split(`,`);for(let e=0;e<r.length;++e){let n=S(r[e].trim());if(n.restParam&&e!==r.length-1)throw SyntaxError(`Unexpected rest parameter "`+r[e]+`": only allowed for the last parameter`);if(n.types.length===0)return null;t.push(n)}return t}function T(e){let t=ye(e);return t?t.restParam:!1}function E(t){if(!t||t.types.length===0)return e;if(t.types.length===1)return f(t.types[0].name).test;if(t.types.length===2){let e=f(t.types[0].name).test,n=f(t.types[1].name).test;return function(t){return e(t)||n(t)}}else{let e=t.types.map(function(e){return f(e.name).test});return function(t){for(let n=0;n<e.length;n++)if(e[n](t))return!0;return!1}}}function te(e){let t,n,r;if(T(e)){t=ve(e).map(E);let n=t.length,r=E(ye(e)),i=function(e){for(let t=n;t<e.length;t++)if(!r(e[t]))return!1;return!0};return function(e){for(let n=0;n<t.length;n++)if(!t[n](e[n]))return!1;return i(e)&&e.length>=n+1}}else if(e.length===0)return function(e){return e.length===0};else if(e.length===1)return n=E(e[0]),function(e){return n(e[0])&&e.length===1};else if(e.length===2)return n=E(e[0]),r=E(e[1]),function(e){return n(e[0])&&r(e[1])&&e.length===2};else return t=e.map(E),function(e){for(let n=0;n<t.length;n++)if(!t[n](e[n]))return!1;return e.length===t.length}}function ne(e,t){return t<e.length?e[t]:T(e)?ye(e):null}function D(e,t){let n=ne(e,t);return n?ee(n):new Set}function O(e){return e.conversion===null||e.conversion===void 0}function k(e,t){let n=new Set;return e.forEach(e=>{let r=D(e.params,t),i;for(i of r)n.add(i)}),n.has(`any`)?[`any`]:Array.from(n)}function re(e,t,n){let r,i,a=e||`unnamed`,o=n,s;for(s=0;s<t.length;s++){let e=[];if(o.forEach(n=>{let r=E(ne(n.params,s));(s<n.params.length||T(n.params))&&r(t[s])&&e.push(n)}),e.length===0){if(i=k(o,s),i.length>0){let e=g(t[s]);return r=TypeError(`Unexpected type of argument in function `+a+` (expected: `+i.join(` or `)+`, actual: `+e.join(` | `)+`, index: `+s+`)`),r.data={category:`wrongType`,fn:a,index:s,actual:e,expected:i},r}}else o=e}let c=o.map(function(e){return T(e.params)?1/0:e.params.length});if(t.length<Math.min.apply(null,c))return i=k(o,s),r=TypeError(`Too few arguments in function `+a+` (expected: `+i.join(` or `)+`, index: `+t.length+`)`),r.data={category:`tooFewArgs`,fn:a,index:t.length,expected:i},r;let l=Math.max.apply(null,c);if(t.length>l)return r=TypeError(`Too many arguments in function `+a+` (expected: `+l+`, actual: `+t.length+`)`),r.data={category:`tooManyArgs`,fn:a,index:t.length,expectedLength:l},r;let u=[];for(let e=0;e<t.length;++e)u.push(g(t[e]).join(`|`));return r=TypeError(`Arguments of type "`+u.join(`, `)+`" do not match any of the defined signatures of function `+a+`.`),r.data={category:`mismatch`,actual:u},r}function ie(e){let t=l.length+1;for(let n=0;n<e.types.length;n++)t=Math.min(t,e.types[n].typeIndex);return t}function ae(e){let t=u+1;for(let n=0;n<e.types.length;n++)O(e.types[n])||(t=Math.min(t,e.types[n].conversionIndex));return t}function oe(e,t){if(e.hasAny){if(!t.hasAny)return .1}else if(t.hasAny)return-.1;if(e.restParam){if(!t.restParam)return .01}else if(t.restParam)return-.01;let n=ie(e)-ie(t);if(n<0)return-.001;if(n>0)return .001;let r=ae(e),i=ae(t);if(e.hasConversion){if(!t.hasConversion)return(1+r)*1e-6}else if(t.hasConversion)return-(1+i)*1e-6;let a=r-i;return a<0?-1e-7:a>0?1e-7:0}function se(e,t){let n=e.params,r=t.params,i=ye(n),a=ye(r),o=T(n),s=T(r);if(o&&i.hasAny){if(!s||!a.hasAny)return 1e7}else if(s&&a.hasAny)return-1e7;let c=0,l=0,u;for(u of n)u.hasAny&&++c,u.hasConversion&&++l;let d=0,f=0;for(u of r)u.hasAny&&++d,u.hasConversion&&++f;if(c!==d)return(c-d)*1e6;if(o&&i.hasConversion){if(!s||!a.hasConversion)return 1e5}else if(s&&a.hasConversion)return-1e5;if(l!==f)return(l-f)*1e4;if(o){if(!s)return 1e3}else if(s)return-1e3;let p=(n.length-r.length)*(o?-100:100);if(p!==0)return p;let m=[],h=0;for(let e=0;e<n.length;++e){let t=oe(n[e],r[e]);m.push(t),h+=t}if(h!==0)return(h<0?-10:10)+h;let g,_=9,v=_/(m.length+1);for(g of m){if(g!==0)return(g<0?-_:_)+g;_-=v}return 0}function ce(e){if(e.length===0)return[];let t=e.map(f);if(e.length===1)return t[0].conversionsTo;let n=new Set(e),r=new Set;for(let e=0;e<t.length;++e)for(let i of t[e].conversionsTo)n.has(i.from)||r.add(i.from);let i=[];for(let e of r){let n=u+1,r=null;for(let i=0;i<t.length;++i)for(let a of t[i].conversionsTo)a.from===e&&a.index<n&&(n=a.index,r=a);i.push(r)}return i}function le(e,t){let n=t,r=``;if(e.some(e=>e.hasConversion)){let i=T(e),a=e.map(ue);r=a.map(e=>e.name).join(`;`),n=function(){let e=[],n=i?arguments.length-1:arguments.length;for(let t=0;t<n;t++)e[t]=a[t](arguments[t]);return i&&(e[n]=arguments[n].map(a[n])),t.apply(this,e)}}let i=n;if(T(e)){let t=e.length-1;i=function(){return n.apply(this,be(arguments,0,t).concat([be(arguments,t)]))}}return r&&Object.defineProperty(i,`name`,{value:r}),i}function ue(e){let t,n,r,i,a=[],o=[],s=``;e.types.forEach(function(e){e.conversion&&(s+=e.conversion.from+`~>`+e.conversion.to+`,`,a.push(f(e.conversion.from).test),o.push(e.conversion.convert))}),s=s?s.slice(0,-1):`pass`;let c=e=>e;switch(o.length){case 0:break;case 1:t=a[0],r=o[0],c=function(e){return t(e)?r(e):e};break;case 2:t=a[0],n=a[1],r=o[0],i=o[1],c=function(e){return t(e)?r(e):n(e)?i(e):e};break;default:c=function(e){for(let t=0;t<o.length;t++)if(a[t](e))return o[t](e);return e}}return Object.defineProperty(c,`name`,{value:s}),c}function de(e){function t(e,n,r){if(n<e.length){let i=e[n],a=[];if(i.restParam){let e=i.types.filter(O);e.length<i.types.length&&a.push({types:e,name:`...`+e.map(e=>e.name).join(`|`),hasAny:e.some(e=>e.isAny),hasConversion:!1,restParam:!0}),a.push(i)}else a=i.types.map(function(e){return{types:[e],name:e.name,hasAny:e.isAny,hasConversion:e.conversion,restParam:!1}});return Se(a,function(i){return t(e,n+1,r.concat([i]))})}else return[r]}return t(e,0,[])}function A(e,t){let n=Math.max(e.length,t.length);for(let r=0;r<n;r++){let n=D(e,r),i=D(t,r),a=!1,o;for(o of i)if(n.has(o)){a=!0;break}if(!a)return!1}let r=e.length,i=t.length,a=T(e),o=T(t);return a?o?r===i:i>=r:o?r>=i:r===i}function fe(e){return e.map(e=>De(e)?Te(e.referToSelf.callback):Ee(e)?we(e.referTo.references,e.referTo.callback):e)}function pe(e,t,n){let r=[],i;for(i of e){let e=n[i];if(typeof e!=`number`)throw TypeError(`No definition for referenced signature "`+i+`"`);if(e=t[e],typeof e!=`function`)return!1;r.push(e)}return r}function me(e,t,n){let r=fe(e),i=Array(r.length).fill(!1),a=!0;for(;a;){a=!1;let e=!0;for(let o=0;o<r.length;++o){if(i[o])continue;let s=r[o];if(De(s))r[o]=s.referToSelf.callback(n),r[o].referToSelf=s.referToSelf,i[o]=!0,e=!1;else if(Ee(s)){let n=pe(s.referTo.references,r,t);n?(r[o]=s.referTo.callback.apply(this,n),r[o].referTo=s.referTo,i[o]=!0,e=!1):a=!0}}if(e&&a)throw SyntaxError(`Circular reference detected in resolving typed.referTo`)}return r}function he(e){let t=/\bthis(\(|\.signatures\b)/;Object.keys(e).forEach(n=>{let r=e[n];if(t.test(r.toString()))throw SyntaxError("Using `this` to self-reference a function is deprecated since typed-function@3. Use typed.referTo and typed.referToSelf instead.")})}function ge(e,r){if(d.createCount++,Object.keys(r).length===0)throw SyntaxError(`No signatures provided`);d.warnAgainstDeprecatedThis&&he(r);let i=[],a=[],o={},s=[],c;for(c in r){if(!Object.prototype.hasOwnProperty.call(r,c))continue;let e=w(c);if(!e)continue;i.forEach(function(t){if(A(t,e))throw TypeError(`Conflicting signatures "`+x(t)+`" and "`+x(e)+`".`)}),i.push(e);let t=a.length;a.push(r[c]);let n=e.map(C),l;for(l of de(n)){let e=x(l);s.push({params:l,name:e,fn:t}),l.every(e=>!e.hasConversion)&&(o[e]=t)}}s.sort(se);let l=me(a,o,je),u;for(u in o)Object.prototype.hasOwnProperty.call(o,u)&&(o[u]=l[o[u]]);let f=[],p=new Map;for(u of s)p.has(u.name)||(u.fn=l[u.fn],f.push(u),p.set(u.name,u));let m=f[0]&&f[0].params.length<=2&&!T(f[0].params),h=f[1]&&f[1].params.length<=2&&!T(f[1].params),g=f[2]&&f[2].params.length<=2&&!T(f[2].params),_=f[3]&&f[3].params.length<=2&&!T(f[3].params),v=f[4]&&f[4].params.length<=2&&!T(f[4].params),y=f[5]&&f[5].params.length<=2&&!T(f[5].params),b=m&&h&&g&&_&&v&&y;for(let e=0;e<f.length;++e)f[e].test=te(f[e].params);let S=m?E(f[0].params[0]):t,ee=h?E(f[1].params[0]):t,ne=g?E(f[2].params[0]):t,D=_?E(f[3].params[0]):t,O=v?E(f[4].params[0]):t,k=y?E(f[5].params[0]):t,re=m?E(f[0].params[1]):t,ie=h?E(f[1].params[1]):t,ae=g?E(f[2].params[1]):t,oe=_?E(f[3].params[1]):t,ce=v?E(f[4].params[1]):t,ue=y?E(f[5].params[1]):t;for(let e=0;e<f.length;++e)f[e].implementation=le(f[e].params,f[e].fn);let fe=m?f[0].implementation:n,pe=h?f[1].implementation:n,ge=g?f[2].implementation:n,_e=_?f[3].implementation:n,ve=v?f[4].implementation:n,ye=y?f[5].implementation:n,be=m?f[0].params.length:-1,xe=h?f[1].params.length:-1,Se=g?f[2].params.length:-1,Ce=_?f[3].params.length:-1,we=v?f[4].params.length:-1,Te=y?f[5].params.length:-1,Ee=b?6:0,De=f.length,Oe=f.map(e=>e.test),ke=f.map(e=>e.implementation),Ae=function(){for(let e=Ee;e<De;e++)if(Oe[e](arguments))return ke[e].apply(this,arguments);return d.onMismatch(e,arguments,f)};function je(e,t){return arguments.length===be&&S(e)&&re(t)?fe.apply(this,arguments):arguments.length===xe&&ee(e)&&ie(t)?pe.apply(this,arguments):arguments.length===Se&&ne(e)&&ae(t)?ge.apply(this,arguments):arguments.length===Ce&&D(e)&&oe(t)?_e.apply(this,arguments):arguments.length===we&&O(e)&&ce(t)?ve.apply(this,arguments):arguments.length===Te&&k(e)&&ue(t)?ye.apply(this,arguments):Ae.apply(this,arguments)}try{Object.defineProperty(je,`name`,{value:e})}catch{}return je.signatures=o,je._typedFunctionData={signatures:f,signatureMap:p},je}function _e(e,t,n){throw re(e,t,n)}function ve(e){return be(e,0,e.length-1)}function ye(e){return e[e.length-1]}function be(e,t,n){return Array.prototype.slice.call(e,t,n)}function xe(e,t){for(let n=0;n<e.length;n++)if(t(e[n]))return e[n]}function Se(e,t){return Array.prototype.concat.apply([],e.map(t))}function Ce(){let e=ve(arguments).map(e=>x(w(e))),t=ye(arguments);if(typeof t!=`function`)throw TypeError(`Callback function expected as last argument`);return we(e,t)}function we(e,t){return{referTo:{references:e,callback:t}}}function Te(e){if(typeof e!=`function`)throw TypeError(`Callback function expected as first argument`);return{referToSelf:{callback:e}}}function Ee(e){return e&&typeof e.referTo==`object`&&Array.isArray(e.referTo.references)&&typeof e.referTo.callback==`function`}function De(e){return e&&typeof e.referToSelf==`object`&&typeof e.referToSelf.callback==`function`}function Oe(e,t){if(!e)return t;if(t&&t!==e){let n=Error(`Function names do not match (expected: `+e+`, actual: `+t+`)`);throw n.data={actual:t,expected:e},n}return e}function ke(e){let t;for(let n in e)Object.prototype.hasOwnProperty.call(e,n)&&(_(e[n])||typeof e[n].signature==`string`)&&(t=Oe(t,e[n].name));return t}function Ae(e,t){let n;for(n in t)if(Object.prototype.hasOwnProperty.call(t,n)){if(n in e&&t[n]!==e[n]){let r=Error(`Signature "`+n+`" is defined twice`);throw r.data={signature:n,sourceFunction:t[n],destFunction:e[n]},r}e[n]=t[n]}}let je=d;d=function(e){let t=typeof e==`string`,n=t?1:0,r=t?e:``,i={};for(let e=n;e<arguments.length;++e){let n=arguments[e],o={},s;if(typeof n==`function`?(s=n.name,typeof n.signature==`string`?o[n.signature]=n:_(n)&&(o=n.signatures)):a(n)&&(o=n,t||(s=ke(n))),Object.keys(o).length===0){let t=TypeError(`Argument to 'typed' at index `+e+` is not a (typed) function, nor an object with signatures as keys and functions as values.`);throw t.data={index:e,argument:n},t}t||(r=Oe(r,s)),Ae(i,o)}return ge(r||``,i)},d.create=i,d.createCount=je.createCount,d.onMismatch=_e,d.throwMismatchError=_e,d.createError=re,d.clear=m,d.clearConversions=h,d.addTypes=p,d._findType=f,d.referTo=Ce,d.referToSelf=Te,d.convert=b,d.findSignature=v,d.find=y,d.isTypedFunction=_,d.warnAgainstDeprecatedThis=!0,d.addType=function(e,t){let n=`any`;t!==!1&&c.has(`Object`)&&(n=`Object`),d.addTypes([e],n)};function Me(e){if(!e||typeof e.from!=`string`||typeof e.to!=`string`||typeof e.convert!=`function`)throw TypeError(`Object with properties {from: string, to: string, convert: function} expected`);if(e.to===e.from)throw SyntaxError(`Illegal to define conversion from "`+e.from+`" to itself.`)}return d.addConversion=function(e){let t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{override:!1};Me(e);let n=f(e.to),r=n.conversionsTo.find(t=>t.from===e.from);if(r)if(t&&t.override)d.removeConversion({from:r.from,to:e.to,convert:r.convert});else throw Error(`There is already a conversion from "`+e.from+`" to "`+n.name+`"`);n.conversionsTo.push({from:e.from,to:n.name,convert:e.convert,index:u++})},d.addConversions=function(e,t){e.forEach(e=>d.addConversion(e,t))},d.removeConversion=function(e){Me(e);let t=f(e.to),n=xe(t.conversionsTo,t=>t.from===e.from);if(!n)throw Error(`Attempt to remove nonexistent conversion from `+e.from+` to `+e.to);if(n.convert!==e.convert)throw Error(`Conversion to remove does not match existing conversion`);let r=t.conversionsTo.indexOf(n);t.conversionsTo.splice(r,1)},d.resolve=function(e,t){if(!_(e))throw TypeError(r);let n=e._typedFunctionData.signatures;for(let e=0;e<n.length;++e)if(n[e].test(t))return n[e];return null},d}return i()}))}));function N(e){return typeof e==`boolean`?!0:isFinite(e)?e===Math.round(e):!1}function Qt(e,t,n){var r={2:`0b`,8:`0o`,16:`0x`}[t],i=``;if(n){if(n<1)throw Error(`size must be in greater than 0`);if(!N(n))throw Error(`size must be an integer`);if(e>2**(n-1)-1||e<-(2**(n-1)))throw Error(`Value must be in range [-2^${n-1}, 2^${n-1}-1]`);if(!N(e))throw Error(`Value must be an integer`);e<0&&(e+=2**n),i=`i${n}`}var a=``;return e<0&&(e=-e,a=`-`),`${a}${r}${e.toString(t)}${i}`}function $t(e,t){if(typeof t==`function`)return t(e);if(e===1/0)return`Infinity`;if(e===-1/0)return`-Infinity`;if(isNaN(e))return`NaN`;var n=`auto`,r,i;if(t&&(t.notation&&(n=t.notation),j(t)?r=t:j(t.precision)&&(r=t.precision),t.wordSize&&(i=t.wordSize,typeof i!=`number`)))throw Error(`Option "wordSize" must be a number`);switch(n){case`fixed`:return nn(e,r);case`exponential`:return rn(e,r);case`engineering`:return tn(e,r);case`bin`:return Qt(e,2,i);case`oct`:return Qt(e,8,i);case`hex`:return Qt(e,16,i);case`auto`:return an(e,r,t&&t).replace(/((\.\d*?)(0+))($|e)/,function(){var e=arguments[2],t=arguments[4];return e===`.`?t:e+t});default:throw Error(`Unknown notation "`+n+`". Choose "auto", "exponential", "fixed", "bin", "oct", or "hex.`)}}function en(e){var t=String(e).toLowerCase().match(/^(-?)(\d+\.?\d*)(e([+-]?\d+))?$/);if(!t)throw SyntaxError(`Invalid number `+e);var n=t[1],r=t[2],i=parseFloat(t[4]||`0`),a=r.indexOf(`.`);i+=a===-1?r.length-1:a-1;var o=r.replace(`.`,``).replace(/^0*/,function(e){return i-=e.length,``}).replace(/0*$/,``).split(``).map(function(e){return parseInt(e)});return o.length===0&&(o.push(0),i++),{sign:n,coefficients:o,exponent:i}}function tn(e,t){if(isNaN(e)||!isFinite(e))return String(e);var n=on(en(e),t),r=n.exponent,i=n.coefficients,a=r%3==0?r:r<0?r-3-r%3:r-r%3;if(j(t))for(;t>i.length||r-a+1>i.length;)i.push(0);else for(var o=Math.abs(r-a)-(i.length-1),s=0;s<o;s++)i.push(0);for(var c=Math.abs(r-a),l=1;c>0;)l++,c--;var u=i.slice(l).join(``),d=j(t)&&u.length||u.match(/[1-9]/)?`.`+u:``,f=i.slice(0,l).join(``)+d+`e`+(r>=0?`+`:``)+a.toString();return n.sign+f}function nn(e,t){if(isNaN(e)||!isFinite(e))return String(e);var n=en(e),r=typeof t==`number`?on(n,n.exponent+1+t):n,i=r.coefficients,a=r.exponent+1,o=a+(t||0);return i.length<o&&(i=i.concat(sn(o-i.length))),a<0&&(i=sn(-a+1).concat(i),a=1),a<i.length&&i.splice(a,0,a===0?`0.`:`.`),r.sign+i.join(``)}function rn(e,t){if(isNaN(e)||!isFinite(e))return String(e);var n=en(e),r=t?on(n,t):n,i=r.coefficients,a=r.exponent;i.length<t&&(i=i.concat(sn(t-i.length)));var o=i.shift();return r.sign+o+(i.length>0?`.`+i.join(``):``)+`e`+(a>=0?`+`:``)+a}function an(e,t,n){if(isNaN(e)||!isFinite(e))return String(e);var r=n&&n.lowerExp!==void 0?n.lowerExp:-3,i=n&&n.upperExp!==void 0?n.upperExp:5,a=en(e),o=t?on(a,t):a;if(o.exponent<r||o.exponent>=i)return rn(e,t);var s=o.coefficients,c=o.exponent;s.length<t&&(s=s.concat(sn(t-s.length))),s=s.concat(sn(c-s.length+1+(s.length<t?t-s.length:0))),s=sn(-c).concat(s);var l=c>0?c:0;return l<s.length-1&&s.splice(l+1,0,`.`),o.sign+s.join(``)}function on(e,t){for(var n={sign:e.sign,coefficients:e.coefficients,exponent:e.exponent},r=n.coefficients;t<=0;)r.unshift(0),n.exponent++,t++;if(r.length>t&&r.splice(t,r.length-t)[0]>=5){var i=t-1;for(r[i]++;r[i]===10;)r.pop(),i===0&&(r.unshift(0),n.exponent++,i++),i--,r[i]++}return n}function sn(e){for(var t=[],n=0;n<e;n++)t.push(0);return t}function cn(e){return e.toExponential().replace(/e.*$/,``).replace(/^0\.?0*|\./,``).length}function ln(e,t,n){var r=e.constructor,i=new r(2),a=``;if(n){if(n<1)throw Error(`size must be in greater than 0`);if(!N(n))throw Error(`size must be an integer`);if(e.greaterThan(i.pow(n-1).sub(1))||e.lessThan(i.pow(n-1).mul(-1)))throw Error(`Value must be in range [-2^${n-1}, 2^${n-1}-1]`);if(!e.isInteger())throw Error(`Value must be an integer`);e.lessThan(0)&&(e=e.add(i.pow(n))),a=`i${n}`}switch(t){case 2:return`${e.toBinary()}${a}`;case 8:return`${e.toOctal()}${a}`;case 16:return`${e.toHexadecimal()}${a}`;default:throw Error(`Base ${t} not supported `)}}function un(e,t){if(typeof t==`function`)return t(e);if(!e.isFinite())return e.isNaN()?`NaN`:e.gt(0)?`Infinity`:`-Infinity`;var n=`auto`,r,i;if(t!==void 0&&(t.notation&&(n=t.notation),typeof t==`number`?r=t:t.precision!==void 0&&(r=t.precision),t.wordSize&&(i=t.wordSize,typeof i!=`number`)))throw Error(`Option "wordSize" must be a number`);switch(n){case`fixed`:return pn(e,r);case`exponential`:return fn(e,r);case`engineering`:return dn(e,r);case`bin`:return ln(e,2,i);case`oct`:return ln(e,8,i);case`hex`:return ln(e,16,i);case`auto`:var a=t&&t.lowerExp!==void 0?t.lowerExp:-3,o=t&&t.upperExp!==void 0?t.upperExp:5;if(e.isZero())return`0`;var s,c=e.toSignificantDigits(r),l=c.e;return s=l>=a&&l<o?c.toFixed():fn(e,r),s.replace(/((\.\d*?)(0+))($|e)/,function(){var e=arguments[2],t=arguments[4];return e===`.`?t:e+t});default:throw Error(`Unknown notation "`+n+`". Choose "auto", "exponential", "fixed", "bin", "oct", or "hex.`)}}function dn(e,t){var n=e.e,r=n%3==0?n:n<0?n-3-n%3:n-n%3,i=e.mul(10**-r).toPrecision(t);if(i.indexOf(`e`)!==-1){var a=e.constructor;i=new a(i).toFixed()}return i+`e`+(n>=0?`+`:``)+r.toString()}function fn(e,t){return t===void 0?e.toExponential():e.toExponential(t-1)}function pn(e,t){return e.toFixed(t)}function mn(e,t){var n=hn(e,t);return t&&typeof t==`object`&&`truncate`in t&&n.length>t.truncate?n.substring(0,t.truncate-3)+`...`:n}function hn(e,t){return typeof e==`number`?$t(e,t):it(e)?un(e,t):yn(e)?!t||t.fraction!==`decimal`?e.s*e.n+`/`+e.d:e.toString():Array.isArray(e)?vn(e,t):ct(e)?gn(e):typeof e==`function`?e.syntax?String(e.syntax):`function`:e&&typeof e==`object`?typeof e.format==`function`?e.format(t):e&&e.toString(t)!=={}.toString()?e.toString(t):`{`+Object.keys(e).map(n=>gn(n)+`: `+mn(e[n],t)).join(`, `)+`}`:String(e)}function gn(e){for(var t=String(e),n=``,r=0;r<t.length;){var i=t.charAt(r);n+=i in _n?_n[i]:i,r++}return`"`+n+`"`}var _n={'"':`\\"`,"\\":`\\\\`,"\b":`\\b`,"\f":`\\f`,"\n":`\\n`,"\r":`\\r`," ":`\\t`};function vn(e,t){if(Array.isArray(e)){for(var n=`[`,r=e.length,i=0;i<r;i++)i!==0&&(n+=`, `),n+=vn(e[i],t);return n+=`]`,n}else return mn(e,t)}function yn(e){return e&&typeof e==`object`&&typeof e.s==`number`&&typeof e.n==`number`&&typeof e.d==`number`||!1}function P(e,t,n){if(!(this instanceof P))throw SyntaxError(`Constructor must be called with the new operator`);this.actual=e,this.expected=t,this.relation=n,this.message=`Dimension mismatch (`+(Array.isArray(e)?`[`+e.join(`, `)+`]`:e)+` `+(this.relation||`!=`)+` `+(Array.isArray(t)?`[`+t.join(`, `)+`]`:t)+`)`,this.stack=Error().stack}P.prototype=RangeError(),P.prototype.constructor=RangeError,P.prototype.name=`DimensionError`,P.prototype.isDimensionError=!0;function bn(e,t,n){if(!(this instanceof bn))throw SyntaxError(`Constructor must be called with the new operator`);this.index=e,arguments.length<3?(this.min=0,this.max=t):(this.min=t,this.max=n),this.min!==void 0&&this.index<this.min?this.message=`Index out of range (`+this.index+` < `+this.min+`)`:this.max!==void 0&&this.index>=this.max?this.message=`Index out of range (`+this.index+` > `+(this.max-1)+`)`:this.message=`Index out of range (`+this.index+`)`,this.stack=Error().stack}bn.prototype=RangeError(),bn.prototype.constructor=RangeError,bn.prototype.name=`IndexError`,bn.prototype.isIndexError=!0;function xn(e){for(var t=[];Array.isArray(e);)t.push(e.length),e=e[0];return t}function Sn(e,t,n){var r,i=e.length;if(i!==t[n])throw new P(i,t[n]);if(n<t.length-1){var a=n+1;for(r=0;r<i;r++){var o=e[r];if(!Array.isArray(o))throw new P(t.length-1,t.length,`<`);Sn(e[r],t,a)}}else for(r=0;r<i;r++)if(Array.isArray(e[r]))throw new P(t.length+1,t.length,`>`)}function Cn(e,t){if(t.length===0){if(Array.isArray(e))throw new P(e.length,0)}else Sn(e,t,0)}function F(e,t){if(e!==void 0){if(!j(e)||!N(e))throw TypeError(`Index must be an integer (value: `+e+`)`);if(e<0||typeof t==`number`&&e>=t)throw new bn(e,t)}}function wn(e,t,n){if(!Array.isArray(t))throw TypeError(`Array expected`);if(t.length===0)throw Error(`Resizing to scalar is not supported`);return t.forEach(function(e){if(!j(e)||!N(e)||e<0)throw TypeError(`Invalid size, must contain positive integers (size: `+mn(t)+`)`)}),(j(e)||it(e))&&(e=[e]),Tn(e,t,0,n===void 0?0:n),e}function Tn(e,t,n,r){var i,a,o=e.length,s=t[n],c=Math.min(o,s);if(e.length=s,n<t.length-1){var l=n+1;for(i=0;i<c;i++)a=e[i],Array.isArray(a)||(a=[a],e[i]=a),Tn(a,t,l,r);for(i=c;i<s;i++)a=[],e[i]=a,Tn(a,t,l,r)}else{for(i=0;i<c;i++)for(;Array.isArray(e[i]);)e[i]=e[i][0];for(i=c;i<s;i++)e[i]=r}}function En(e,t){var n=Mn(e),r=n.length;if(!Array.isArray(e)||!Array.isArray(t))throw TypeError(`Array expected`);if(t.length===0)throw new P(0,r,`!=`);t=Dn(t,r);var i=On(t);if(r!==i)throw new P(i,r,`!=`);try{return kn(n,t)}catch(e){throw e instanceof P?new P(i,r,`!=`):e}}function Dn(e,t){var n=On(e),r=e.slice(),i=-1,a=e.indexOf(i);if(e.indexOf(i,a+1)>=0)throw Error(`More than one wildcard in sizes`);var o=a>=0,s=t%n===0;if(o)if(s)r[a]=-t/n;else throw Error(`Could not replace wildcard, since `+t+` is no multiple of `+-n);return r}function On(e){return e.reduce((e,t)=>e*t,1)}function kn(e,t){for(var n=e,r,i=t.length-1;i>0;i--){var a=t[i];r=[];for(var o=n.length/a,s=0;s<o;s++)r.push(n.slice(s*a,(s+1)*a));n=r}return n}function An(e,t,n,r){var i=r||xn(e);if(n)for(var a=0;a<n;a++)e=[e],i.unshift(1);for(e=jn(e,t,0);i.length<t;)i.push(1);return e}function jn(e,t,n){var r,i;if(Array.isArray(e)){var a=n+1;for(r=0,i=e.length;r<i;r++)e[r]=jn(e[r],t,a)}else for(var o=n;o<t;o++)e=[e];return e}function Mn(e){if(!Array.isArray(e))return e;var t=[];return e.forEach(function e(n){Array.isArray(n)?n.forEach(e):t.push(n)}),t}function Nn(e,t){for(var n,r=0,i=0;i<e.length;i++){var a=e[i],o=Array.isArray(a);if(i===0&&o&&(r=a.length),o&&a.length!==r)return;var s=o?Nn(a,t):t(a);if(n===void 0)n=s;else if(n!==s)return`mixed`}return n}function Pn(e,t,n,r){if(r<n){if(e.length!==t.length)throw new P(e.length,t.length);for(var i=[],a=0;a<e.length;a++)i[a]=Pn(e[a],t[a],n,r+1);return i}else return e.concat(t)}function Fn(){var e=Array.prototype.slice.call(arguments,0,-1),t=Array.prototype.slice.call(arguments,-1);if(e.length===1)return e[0];if(e.length>1)return e.slice(1).reduce(function(e,n){return Pn(e,n,t,0)},e[0]);throw Error(`Wrong number of arguments in function concat`)}function In(){for(var e=[...arguments],t=e.map(e=>e.length),n=Math.max(...t),r=Array(n).fill(null),i=0;i<e.length;i++)for(var a=e[i],o=t[i],s=0;s<o;s++){var c=n-o+s;a[s]>r[c]&&(r[c]=a[s])}for(var l=0;l<e.length;l++)Ln(e[l],r);return r}function Ln(e,t){for(var n=t.length,r=e.length,i=0;i<r;i++){var a=n-r+i;if(e[i]<t[a]&&e[i]>1||e[i]>t[a])throw Error(`shape missmatch: missmatch is found in arg with shape (${e}) not possible to broadcast dimension ${r} with size ${e[i]} to size ${t[a]}`)}}function Rn(e,t){var n=xn(e);if(Wt(n,t))return e;Ln(n,t);var r=In(n,t),i=r.length,a=[...Array(i-n.length).fill(1),...n],o=Bn(e);n.length<i&&(o=En(o,a),n=xn(o));for(var s=0;s<i;s++)n[s]<r[s]&&(o=zn(o,r[s],s),n=xn(o));return o}function zn(e,t,n){return Fn(...Array(t).fill(e),n)}function Bn(e){return(0,Yt.default)([],e)}function Vn(e,t,n,r){function i(r){var i=Kt(r,t.map(Wn));return Hn(e,t,r),n(i)}return i.isFactory=!0,i.fn=e,i.dependencies=t.slice().sort(),r&&(i.meta=r),i}function Hn(e,t,n){if(!t.filter(e=>!Un(e)).every(e=>n[e]!==void 0)){var r=t.filter(e=>n[e]===void 0);throw Error(`Cannot create function "${e}", some dependencies are missing: ${r.map(e=>`"${e}"`).join(`, `)}.`)}}function Un(e){return e&&e[0]===`?`}function Wn(e){return e&&e[0]===`?`?e.slice(1):e}function Gn(e,t){if(Xn(e)&&Jn(e,t))return e[t];throw typeof e[t]==`function`&&Yn(e,t)?Error(`Cannot access method "`+t+`" as a property`):Error(`No access to property "`+t+`"`)}function Kn(e,t,n){if(Xn(e)&&Jn(e,t))return e[t]=n,n;throw Error(`No access to property "`+t+`"`)}function qn(e,t){return t in e}function Jn(e,t){return!e||typeof e!=`object`?!1:Gt(Zn,t)?!0:!(t in Object.prototype||t in Function.prototype)}function Yn(e,t){return e==null||typeof e[t]!=`function`||Gt(e,t)&&Object.getPrototypeOf&&t in Object.getPrototypeOf(e)?!1:Gt(Qn,t)?!0:!(t in Object.prototype||t in Function.prototype)}function Xn(e){return typeof e==`object`&&e&&e.constructor===Object}var Zn={length:!0,name:!0},Qn={toString:!0,valueOf:!0,toLocaleString:!0},$n=class{constructor(e){this.wrappedObject=e}keys(){return Object.keys(this.wrappedObject)}get(e){return Gn(this.wrappedObject,e)}set(e,t){return Kn(this.wrappedObject,e,t),this}has(e){return qn(this.wrappedObject,e)}};function er(e){return e?e instanceof Map||e instanceof $n||typeof e.set==`function`&&typeof e.get==`function`&&typeof e.keys==`function`&&typeof e.has==`function`:!1}var tr=k(Zt(),1),nr=function(){return nr=tr.default.create,tr.default},rr=Vn(`typed`,[`?BigNumber`,`?Complex`,`?DenseMatrix`,`?Fraction`],function(e){var{BigNumber:t,Complex:n,DenseMatrix:r,Fraction:i}=e,a=nr();return a.clear(),a.addTypes([{name:`number`,test:j},{name:`Complex`,test:at},{name:`BigNumber`,test:it},{name:`Fraction`,test:ot},{name:`Unit`,test:st},{name:`identifier`,test:e=>ct&&/^(?:[A-Za-z\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u0870-\u0887\u0889-\u088E\u08A0-\u08C9\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C5D\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16F1-\u16F8\u1700-\u1711\u171F-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1878\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4C\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BF\u31F0-\u31FF\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA7CA\uA7D0\uA7D1\uA7D3\uA7D5-\uA7D9\uA7F2-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF2D-\uDF40\uDF42-\uDF49\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDD70-\uDD7A\uDD7C-\uDD8A\uDD8C-\uDD92\uDD94\uDD95\uDD97-\uDDA1\uDDA3-\uDDB1\uDDB3-\uDDB9\uDDBB\uDDBC\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67\uDF80-\uDF85\uDF87-\uDFB0\uDFB2-\uDFBA]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE35\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2\uDD00-\uDD23\uDE80-\uDEA9\uDEB0\uDEB1\uDF00-\uDF1C\uDF27\uDF30-\uDF45\uDF70-\uDF81\uDFB0-\uDFC4\uDFE0-\uDFF6]|\uD804[\uDC03-\uDC37\uDC71\uDC72\uDC75\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD44\uDD47\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE3F\uDE40\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC5F-\uDC61\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDEB8\uDF00-\uDF1A\uDF40-\uDF46]|\uD806[\uDC00-\uDC2B\uDCA0-\uDCDF\uDCFF-\uDD06\uDD09\uDD0C-\uDD13\uDD15\uDD16\uDD18-\uDD2F\uDD3F\uDD41\uDDA0-\uDDA7\uDDAA-\uDDD0\uDDE1\uDDE3\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE89\uDE9D\uDEB0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD89\uDD98\uDEE0-\uDEF2\uDF02\uDF04-\uDF10\uDF12-\uDF33\uDFB0]|\uD808[\uDC00-\uDF99]|\uD809[\uDC80-\uDD43]|\uD80B[\uDF90-\uDFF0]|[\uD80C\uD81C-\uD820\uD822\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879\uD880-\uD883\uD885-\uD887][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2F\uDC41-\uDC46]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE70-\uDEBE\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDE40-\uDE7F\uDF00-\uDF4A\uDF50\uDF93-\uDF9F\uDFE0\uDFE1\uDFE3]|\uD821[\uDC00-\uDFF7]|\uD823[\uDC00-\uDCD5\uDD00-\uDD08]|\uD82B[\uDFF0-\uDFF3\uDFF5-\uDFFB\uDFFD\uDFFE]|\uD82C[\uDC00-\uDD22\uDD32\uDD50-\uDD52\uDD55\uDD64-\uDD67\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD837[\uDF00-\uDF1E\uDF25-\uDF2A]|\uD838[\uDC30-\uDC6D\uDD00-\uDD2C\uDD37-\uDD3D\uDD4E\uDE90-\uDEAD\uDEC0-\uDEEB]|\uD839[\uDCD0-\uDCEB\uDFE0-\uDFE6\uDFE8-\uDFEB\uDFED\uDFEE\uDFF0-\uDFFE]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43\uDD4B]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDEDF\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF39\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A\uDF50-\uDFFF]|\uD888[\uDC00-\uDFAF])(?:[0-9A-Za-z\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u0870-\u0887\u0889-\u088E\u08A0-\u08C9\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C5D\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16F1-\u16F8\u1700-\u1711\u171F-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1878\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4C\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BF\u31F0-\u31FF\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA7CA\uA7D0\uA7D1\uA7D3\uA7D5-\uA7D9\uA7F2-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF2D-\uDF40\uDF42-\uDF49\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDD70-\uDD7A\uDD7C-\uDD8A\uDD8C-\uDD92\uDD94\uDD95\uDD97-\uDDA1\uDDA3-\uDDB1\uDDB3-\uDDB9\uDDBB\uDDBC\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67\uDF80-\uDF85\uDF87-\uDFB0\uDFB2-\uDFBA]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE35\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2\uDD00-\uDD23\uDE80-\uDEA9\uDEB0\uDEB1\uDF00-\uDF1C\uDF27\uDF30-\uDF45\uDF70-\uDF81\uDFB0-\uDFC4\uDFE0-\uDFF6]|\uD804[\uDC03-\uDC37\uDC71\uDC72\uDC75\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD44\uDD47\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE3F\uDE40\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC5F-\uDC61\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDEB8\uDF00-\uDF1A\uDF40-\uDF46]|\uD806[\uDC00-\uDC2B\uDCA0-\uDCDF\uDCFF-\uDD06\uDD09\uDD0C-\uDD13\uDD15\uDD16\uDD18-\uDD2F\uDD3F\uDD41\uDDA0-\uDDA7\uDDAA-\uDDD0\uDDE1\uDDE3\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE89\uDE9D\uDEB0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD89\uDD98\uDEE0-\uDEF2\uDF02\uDF04-\uDF10\uDF12-\uDF33\uDFB0]|\uD808[\uDC00-\uDF99]|\uD809[\uDC80-\uDD43]|\uD80B[\uDF90-\uDFF0]|[\uD80C\uD81C-\uD820\uD822\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879\uD880-\uD883\uD885-\uD887][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2F\uDC41-\uDC46]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE70-\uDEBE\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDE40-\uDE7F\uDF00-\uDF4A\uDF50\uDF93-\uDF9F\uDFE0\uDFE1\uDFE3]|\uD821[\uDC00-\uDFF7]|\uD823[\uDC00-\uDCD5\uDD00-\uDD08]|\uD82B[\uDFF0-\uDFF3\uDFF5-\uDFFB\uDFFD\uDFFE]|\uD82C[\uDC00-\uDD22\uDD32\uDD50-\uDD52\uDD55\uDD64-\uDD67\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD837[\uDF00-\uDF1E\uDF25-\uDF2A]|\uD838[\uDC30-\uDC6D\uDD00-\uDD2C\uDD37-\uDD3D\uDD4E\uDE90-\uDEAD\uDEC0-\uDEEB]|\uD839[\uDCD0-\uDCEB\uDFE0-\uDFE6\uDFE8-\uDFEB\uDFED\uDFEE\uDFF0-\uDFFE]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43\uDD4B]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDEDF\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF39\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A\uDF50-\uDFFF]|\uD888[\uDC00-\uDFAF])*$/.test(e)},{name:`string`,test:ct},{name:`Chain`,test:Bt},{name:`Array`,test:M},{name:`Matrix`,test:lt},{name:`DenseMatrix`,test:dt},{name:`SparseMatrix`,test:ft},{name:`Range`,test:pt},{name:`Index`,test:mt},{name:`boolean`,test:ht},{name:`ResultSet`,test:gt},{name:`Help`,test:_t},{name:`function`,test:vt},{name:`Date`,test:yt},{name:`RegExp`,test:bt},{name:`null`,test:St},{name:`undefined`,test:Ct},{name:`AccessorNode`,test:wt},{name:`ArrayNode`,test:Tt},{name:`AssignmentNode`,test:Et},{name:`BlockNode`,test:Dt},{name:`ConditionalNode`,test:Ot},{name:`ConstantNode`,test:kt},{name:`FunctionNode`,test:jt},{name:`FunctionAssignmentNode`,test:At},{name:`IndexNode`,test:Mt},{name:`Node`,test:Nt},{name:`ObjectNode`,test:Pt},{name:`OperatorNode`,test:Ft},{name:`ParenthesisNode`,test:It},{name:`RangeNode`,test:Lt},{name:`RelationalNode`,test:Rt},{name:`SymbolNode`,test:zt},{name:`Map`,test:er},{name:`Object`,test:xt}]),a.addConversions([{from:`number`,to:`BigNumber`,convert:function(e){if(t||ir(e),cn(e)>15)throw TypeError(`Cannot implicitly convert a number with >15 significant digits to BigNumber (value: `+e+`). Use function bignumber(x) to convert to BigNumber.`);return new t(e)}},{from:`number`,to:`Complex`,convert:function(e){return n||ar(e),new n(e,0)}},{from:`BigNumber`,to:`Complex`,convert:function(e){return n||ar(e),new n(e.toNumber(),0)}},{from:`Fraction`,to:`BigNumber`,convert:function(e){throw TypeError(`Cannot implicitly convert a Fraction to BigNumber or vice versa. Use function bignumber(x) to convert to BigNumber or fraction(x) to convert to Fraction.`)}},{from:`Fraction`,to:`Complex`,convert:function(e){return n||ar(e),new n(e.valueOf(),0)}},{from:`number`,to:`Fraction`,convert:function(e){i||sr(e);var t=new i(e);if(t.valueOf()!==e)throw TypeError(`Cannot implicitly convert a number to a Fraction when there will be a loss of precision (value: `+e+`). Use function fraction(x) to convert to Fraction.`);return t}},{from:`string`,to:`number`,convert:function(e){var t=Number(e);if(isNaN(t))throw Error(`Cannot convert "`+e+`" to a number`);return t}},{from:`string`,to:`BigNumber`,convert:function(e){t||ir(e);try{return new t(e)}catch{throw Error(`Cannot convert "`+e+`" to BigNumber`)}}},{from:`string`,to:`Fraction`,convert:function(e){i||sr(e);try{return new i(e)}catch{throw Error(`Cannot convert "`+e+`" to Fraction`)}}},{from:`string`,to:`Complex`,convert:function(e){n||ar(e);try{return new n(e)}catch{throw Error(`Cannot convert "`+e+`" to Complex`)}}},{from:`boolean`,to:`number`,convert:function(e){return+e}},{from:`boolean`,to:`BigNumber`,convert:function(e){return t||ir(e),new t(+e)}},{from:`boolean`,to:`Fraction`,convert:function(e){return i||sr(e),new i(+e)}},{from:`boolean`,to:`string`,convert:function(e){return String(e)}},{from:`Array`,to:`Matrix`,convert:function(e){return r||or(),new r(e)}},{from:`Matrix`,to:`Array`,convert:function(e){return e.valueOf()}}]),a.onMismatch=(e,t,n)=>{var r=a.createError(e,t,n);if([`wrongType`,`mismatch`].includes(r.data.category)&&t.length===1&&ut(t[0])&&n.some(e=>!e.params.includes(`,`))){var i=TypeError(`Function '${e}' doesn't apply to matrices. To call it elementwise on a matrix 'M', try 'map(M, ${e})'.`);throw i.data=r.data,i}throw r},a.onMismatch=(e,t,n)=>{var r=a.createError(e,t,n);if([`wrongType`,`mismatch`].includes(r.data.category)&&t.length===1&&ut(t[0])&&n.some(e=>!e.params.includes(`,`))){var i=TypeError(`Function '${e}' doesn't apply to matrices. To call it elementwise on a matrix 'M', try 'map(M, ${e})'.`);throw i.data=r.data,i}throw r},a});function ir(e){throw Error(`Cannot convert value ${e} into a BigNumber: no class 'BigNumber' provided`)}function ar(e){throw Error(`Cannot convert value ${e} into a Complex number: no class 'Complex' provided`)}function or(){throw Error(`Cannot convert array into a Matrix: no class 'DenseMatrix' provided`)}function sr(e){throw Error(`Cannot convert value ${e} into a Fraction, no class 'Fraction' provided.`)}
|
|
109
109
|
/*!
|
|
110
110
|
* decimal.js v10.6.0
|
|
111
111
|
* An arbitrary-precision Decimal type for JavaScript.
|
|
@@ -113,8 +113,8 @@ Example:
|
|
|
113
113
|
* Copyright (c) 2025 Michael Mclaughlin <M8ch88l@gmail.com>
|
|
114
114
|
* MIT Licence
|
|
115
115
|
*/
|
|
116
|
-
var cr=9e15,lr=1e9,ur=`0123456789abcdef`,dr=`2.3025850929940456840179914546843642076011014886287729760333279009675726096773524802359972050895982983419677840422862486334095254650828067566662873690987816894829072083255546808437998948262331985283935053089653777326288461633662222876982198867465436674744042432743651550489343149393914796194044002221051017141748003688084012647080685567743216228355220114804663715659121373450747856947683463616792101806445070648000277502684916746550586856935673420670581136429224554405758925724208241314695689016758940256776311356919292033376587141660230105703089634572075440370847469940168269282808481184289314848524948644871927809676271275775397027668605952496716674183485704422507197965004714951050492214776567636938662976979522110718264549734772662425709429322582798502585509785265383207606726317164309505995087807523710333101197857547331541421808427543863591778117054309827482385045648019095610299291824318237525357709750539565187697510374970888692180205189339507238539205144634197265287286965110862571492198849978748873771345686209167058`,fr=`3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679821480865132823066470938446095505822317253594081284811174502841027019385211055596446229489549303819644288109756659334461284756482337867831652712019091456485669234603486104543266482133936072602491412737245870066063155881748815209209628292540917153643678925903600113305305488204665213841469519415116094330572703657595919530921861173819326117931051185480744623799627495673518857527248912279381830119491298336733624406566430860213949463952247371907021798609437027705392171762931767523846748184676694051320005681271452635608277857713427577896091736371787214684409012249534301465495853710507922796892589235420199561121290219608640344181598136297747713099605187072113499999983729780499510597317328160963185950244594553469083026425223082533446850352619311881710100031378387528865875332083814206171776691473035982534904287554687311595628638823537875937519577818577805321712268066130019278766111959092164201989380952572010654858632789`,pr={precision:20,rounding:4,modulo:1,toExpNeg:-7,toExpPos:21,minE:-cr,maxE:cr,crypto:!1},mr,hr,I=!0,gr=`[DecimalError] `,_r=gr+`Invalid argument: `,vr=gr+`Precision limit exceeded`,yr=gr+`crypto unavailable`,br=`[object Decimal]`,L=Math.floor,R=Math.pow,xr=/^0b([01]+(\.[01]*)?|\.[01]+)(p[+-]?\d+)?$/i,Sr=/^0x([0-9a-f]+(\.[0-9a-f]*)?|\.[0-9a-f]+)(p[+-]?\d+)?$/i,Cr=/^0o([0-7]+(\.[0-7]*)?|\.[0-7]+)(p[+-]?\d+)?$/i,wr=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,z=1e7,B=7,Tr=9007199254740991,Er=dr.length-1,Dr=fr.length-1,V={toStringTag:br};V.absoluteValue=V.abs=function(){var e=new this.constructor(this);return e.s<0&&(e.s=1),G(e)},V.ceil=function(){return G(new this.constructor(this),this.e+1,2)},V.clampedTo=V.clamp=function(e,t){var n,r=this,i=r.constructor;if(e=new i(e),t=new i(t),!e.s||!t.s)return new i(NaN);if(e.gt(t))throw Error(_r+t);return n=r.cmp(e),n<0?e:r.cmp(t)>0?t:new i(r)},V.comparedTo=V.cmp=function(e){var t,n,r,i,a=this,o=a.d,s=(e=new a.constructor(e)).d,c=a.s,l=e.s;if(!o||!s)return!c||!l?NaN:c===l?o===s?0:!o^c<0?1:-1:c;if(!o[0]||!s[0])return o[0]?c:s[0]?-l:0;if(c!==l)return c;if(a.e!==e.e)return a.e>e.e^c<0?1:-1;for(r=o.length,i=s.length,t=0,n=r<i?r:i;t<n;++t)if(o[t]!==s[t])return o[t]>s[t]^c<0?1:-1;return r===i?0:r>i^c<0?1:-1},V.cosine=V.cos=function(){var e,t,n=this,r=n.constructor;return n.d?n.d[0]?(e=r.precision,t=r.rounding,r.precision=e+Math.max(n.e,n.sd())+B,r.rounding=1,n=Ar(r,Kr(r,n)),r.precision=e,r.rounding=t,G(hr==2||hr==3?n.neg():n,e,t,!0)):new r(1):new r(NaN)},V.cubeRoot=V.cbrt=function(){var e,t,n,r,i,a,o,s,c,l,u=this,d=u.constructor;if(!u.isFinite()||u.isZero())return new d(u);for(I=!1,a=u.s*R(u.s*u,1/3),!a||Math.abs(a)==1/0?(n=H(u.d),e=u.e,(a=(e-n.length+1)%3)&&(n+=a==1||a==-2?`0`:`00`),a=R(n,1/3),e=L((e+1)/3)-(e%3==(e<0?-1:2)),a==1/0?n=`5e`+e:(n=a.toExponential(),n=n.slice(0,n.indexOf(`e`)+1)+e),r=new d(n),r.s=u.s):r=new d(a.toString()),o=(e=d.precision)+3;;)if(s=r,c=s.times(s).times(s),l=c.plus(u),r=W(l.plus(u).times(s),l.plus(c),o+2,1),H(s.d).slice(0,o)===(n=H(r.d)).slice(0,o))if(n=n.slice(o-3,o+1),n==`9999`||!i&&n==`4999`){if(!i&&(G(s,e+1,0),s.times(s).times(s).eq(u))){r=s;break}o+=4,i=1}else{(!+n||!+n.slice(1)&&n.charAt(0)==`5`)&&(G(r,e+1,1),t=!r.times(r).times(r).eq(u));break}return I=!0,G(r,e,d.rounding,t)},V.decimalPlaces=V.dp=function(){var e,t=this.d,n=NaN;if(t){if(e=t.length-1,n=(e-L(this.e/B))*B,e=t[e],e)for(;e%10==0;e/=10)n--;n<0&&(n=0)}return n},V.dividedBy=V.div=function(e){return W(this,new this.constructor(e))},V.dividedToIntegerBy=V.divToInt=function(e){var t=this,n=t.constructor;return G(W(t,new n(e),0,1,1),n.precision,n.rounding)},V.equals=V.eq=function(e){return this.cmp(e)===0},V.floor=function(){return G(new this.constructor(this),this.e+1,3)},V.greaterThan=V.gt=function(e){return this.cmp(e)>0},V.greaterThanOrEqualTo=V.gte=function(e){var t=this.cmp(e);return t==1||t===0},V.hyperbolicCosine=V.cosh=function(){var e,t,n,r,i,a=this,o=a.constructor,s=new o(1);if(!a.isFinite())return new o(a.s?1/0:NaN);if(a.isZero())return s;n=o.precision,r=o.rounding,o.precision=n+Math.max(a.e,a.sd())+4,o.rounding=1,i=a.d.length,i<32?(e=Math.ceil(i/3),t=(1/Gr(4,e)).toString()):(e=16,t=`2.3283064365386962890625e-10`),a=Wr(o,1,a.times(t),new o(1),!0);for(var c,l=e,u=new o(8);l--;)c=a.times(a),a=s.minus(c.times(u.minus(c.times(u))));return G(a,o.precision=n,o.rounding=r,!0)},V.hyperbolicSine=V.sinh=function(){var e,t,n,r,i=this,a=i.constructor;if(!i.isFinite()||i.isZero())return new a(i);if(t=a.precision,n=a.rounding,a.precision=t+Math.max(i.e,i.sd())+4,a.rounding=1,r=i.d.length,r<3)i=Wr(a,2,i,i,!0);else{e=1.4*Math.sqrt(r),e=e>16?16:e|0,i=i.times(1/Gr(5,e)),i=Wr(a,2,i,i,!0);for(var o,s=new a(5),c=new a(16),l=new a(20);e--;)o=i.times(i),i=i.times(s.plus(o.times(c.times(o).plus(l))))}return a.precision=t,a.rounding=n,G(i,t,n,!0)},V.hyperbolicTangent=V.tanh=function(){var e,t,n=this,r=n.constructor;return n.isFinite()?n.isZero()?new r(n):(e=r.precision,t=r.rounding,r.precision=e+7,r.rounding=1,W(n.sinh(),n.cosh(),r.precision=e,r.rounding=t)):new r(n.s)},V.inverseCosine=V.acos=function(){var e=this,t=e.constructor,n=e.abs().cmp(1),r=t.precision,i=t.rounding;return n===-1?e.isZero()?q(t,r+4,i).times(.5):(t.precision=r+6,t.rounding=1,e=new t(1).minus(e).div(e.plus(1)).sqrt().atan(),t.precision=r,t.rounding=i,e.times(2)):n===0?e.isNeg()?q(t,r,i):new t(0):new t(NaN)},V.inverseHyperbolicCosine=V.acosh=function(){var e,t,n=this,r=n.constructor;return n.lte(1)?new r(n.eq(1)?0:NaN):n.isFinite()?(e=r.precision,t=r.rounding,r.precision=e+Math.max(Math.abs(n.e),n.sd())+4,r.rounding=1,I=!1,n=n.times(n).minus(1).sqrt().plus(n),I=!0,r.precision=e,r.rounding=t,n.ln()):new r(n)},V.inverseHyperbolicSine=V.asinh=function(){var e,t,n=this,r=n.constructor;return!n.isFinite()||n.isZero()?new r(n):(e=r.precision,t=r.rounding,r.precision=e+2*Math.max(Math.abs(n.e),n.sd())+6,r.rounding=1,I=!1,n=n.times(n).plus(1).sqrt().plus(n),I=!0,r.precision=e,r.rounding=t,n.ln())},V.inverseHyperbolicTangent=V.atanh=function(){var e,t,n,r,i=this,a=i.constructor;return i.isFinite()?i.e>=0?new a(i.abs().eq(1)?i.s/0:i.isZero()?i:NaN):(e=a.precision,t=a.rounding,r=i.sd(),Math.max(r,e)<2*-i.e-1?G(new a(i),e,t,!0):(a.precision=n=r-i.e,i=W(i.plus(1),new a(1).minus(i),n+e,1),a.precision=e+4,a.rounding=1,i=i.ln(),a.precision=e,a.rounding=t,i.times(.5))):new a(NaN)},V.inverseSine=V.asin=function(){var e,t,n,r,i=this,a=i.constructor;return i.isZero()?new a(i):(t=i.abs().cmp(1),n=a.precision,r=a.rounding,t===-1?(a.precision=n+6,a.rounding=1,i=i.div(new a(1).minus(i.times(i)).sqrt().plus(1)).atan(),a.precision=n,a.rounding=r,i.times(2)):t===0?(e=q(a,n+4,r).times(.5),e.s=i.s,e):new a(NaN))},V.inverseTangent=V.atan=function(){var e,t,n,r,i,a,o,s,c,l=this,u=l.constructor,d=u.precision,f=u.rounding;if(l.isFinite()){if(l.isZero())return new u(l);if(l.abs().eq(1)&&d+4<=Dr)return o=q(u,d+4,f).times(.25),o.s=l.s,o}else{if(!l.s)return new u(NaN);if(d+4<=Dr)return o=q(u,d+4,f).times(.5),o.s=l.s,o}for(u.precision=s=d+10,u.rounding=1,n=Math.min(28,s/B+2|0),e=n;e;--e)l=l.div(l.times(l).plus(1).sqrt().plus(1));for(I=!1,t=Math.ceil(s/B),r=1,c=l.times(l),o=new u(l),i=l;e!==-1;)if(i=i.times(c),a=o.minus(i.div(r+=2)),i=i.times(c),o=a.plus(i.div(r+=2)),o.d[t]!==void 0)for(e=t;o.d[e]===a.d[e]&&e--;);return n&&(o=o.times(2<<n-1)),I=!0,G(o,u.precision=d,u.rounding=f,!0)},V.isFinite=function(){return!!this.d},V.isInteger=V.isInt=function(){return!!this.d&&L(this.e/B)>this.d.length-2},V.isNaN=function(){return!this.s},V.isNegative=V.isNeg=function(){return this.s<0},V.isPositive=V.isPos=function(){return this.s>0},V.isZero=function(){return!!this.d&&this.d[0]===0},V.lessThan=V.lt=function(e){return this.cmp(e)<0},V.lessThanOrEqualTo=V.lte=function(e){return this.cmp(e)<1},V.logarithm=V.log=function(e){var t,n,r,i,a,o,s,c,l=this,u=l.constructor,d=u.precision,f=u.rounding,p=5;if(e==null)e=new u(10),t=!0;else{if(e=new u(e),n=e.d,e.s<0||!n||!n[0]||e.eq(1))return new u(NaN);t=e.eq(10)}if(n=l.d,l.s<0||!n||!n[0]||l.eq(1))return new u(n&&!n[0]?-1/0:l.s==1?n?0:1/0:NaN);if(t)if(n.length>1)a=!0;else{for(i=n[0];i%10==0;)i/=10;a=i!==1}if(I=!1,s=d+p,o=zr(l,s),r=t?Mr(u,s+10):zr(e,s),c=W(o,r,s,1),Or(c.d,i=d,f))do if(s+=10,o=zr(l,s),r=t?Mr(u,s+10):zr(e,s),c=W(o,r,s,1),!a){+H(c.d).slice(i+1,i+15)+1==0x5af3107a4000&&(c=G(c,d+1,0));break}while(Or(c.d,i+=10,f));return I=!0,G(c,d,f)},V.minus=V.sub=function(e){var t,n,r,i,a,o,s,c,l,u,d,f,p=this,m=p.constructor;if(e=new m(e),!p.d||!e.d)return!p.s||!e.s?e=new m(NaN):p.d?e.s=-e.s:e=new m(e.d||p.s!==e.s?p:NaN),e;if(p.s!=e.s)return e.s=-e.s,p.plus(e);if(l=p.d,f=e.d,s=m.precision,c=m.rounding,!l[0]||!f[0]){if(f[0])e.s=-e.s;else if(l[0])e=new m(p);else return new m(c===3?-0:0);return I?G(e,s,c):e}if(n=L(e.e/B),u=L(p.e/B),l=l.slice(),a=u-n,a){for(d=a<0,d?(t=l,a=-a,o=f.length):(t=f,n=u,o=l.length),r=Math.max(Math.ceil(s/B),o)+2,a>r&&(a=r,t.length=1),t.reverse(),r=a;r--;)t.push(0);t.reverse()}else{for(r=l.length,o=f.length,d=r<o,d&&(o=r),r=0;r<o;r++)if(l[r]!=f[r]){d=l[r]<f[r];break}a=0}for(d&&(t=l,l=f,f=t,e.s=-e.s),o=l.length,r=f.length-o;r>0;--r)l[o++]=0;for(r=f.length;r>a;){if(l[--r]<f[r]){for(i=r;i&&l[--i]===0;)l[i]=z-1;--l[i],l[r]+=z}l[r]-=f[r]}for(;l[--o]===0;)l.pop();for(;l[0]===0;l.shift())--n;return l[0]?(e.d=l,e.e=jr(l,n),I?G(e,s,c):e):new m(c===3?-0:0)},V.modulo=V.mod=function(e){var t,n=this,r=n.constructor;return e=new r(e),!n.d||!e.s||e.d&&!e.d[0]?new r(NaN):!e.d||n.d&&!n.d[0]?G(new r(n),r.precision,r.rounding):(I=!1,r.modulo==9?(t=W(n,e.abs(),0,3,1),t.s*=e.s):t=W(n,e,0,r.modulo,1),t=t.times(e),I=!0,n.minus(t))},V.naturalExponential=V.exp=function(){return Rr(this)},V.naturalLogarithm=V.ln=function(){return zr(this)},V.negated=V.neg=function(){var e=new this.constructor(this);return e.s=-e.s,G(e)},V.plus=V.add=function(e){var t,n,r,i,a,o,s,c,l,u,d=this,f=d.constructor;if(e=new f(e),!d.d||!e.d)return!d.s||!e.s?e=new f(NaN):d.d||(e=new f(e.d||d.s===e.s?d:NaN)),e;if(d.s!=e.s)return e.s=-e.s,d.minus(e);if(l=d.d,u=e.d,s=f.precision,c=f.rounding,!l[0]||!u[0])return u[0]||(e=new f(d)),I?G(e,s,c):e;if(a=L(d.e/B),r=L(e.e/B),l=l.slice(),i=a-r,i){for(i<0?(n=l,i=-i,o=u.length):(n=u,r=a,o=l.length),a=Math.ceil(s/B),o=a>o?a+1:o+1,i>o&&(i=o,n.length=1),n.reverse();i--;)n.push(0);n.reverse()}for(o=l.length,i=u.length,o-i<0&&(i=o,n=u,u=l,l=n),t=0;i;)t=(l[--i]=l[i]+u[i]+t)/z|0,l[i]%=z;for(t&&(l.unshift(t),++r),o=l.length;l[--o]==0;)l.pop();return e.d=l,e.e=jr(l,r),I?G(e,s,c):e},V.precision=V.sd=function(e){var t,n=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(_r+e);return n.d?(t=Nr(n.d),e&&n.e+1>t&&(t=n.e+1)):t=NaN,t},V.round=function(){var e=this,t=e.constructor;return G(new t(e),e.e+1,t.rounding)},V.sine=V.sin=function(){var e,t,n=this,r=n.constructor;return n.isFinite()?n.isZero()?new r(n):(e=r.precision,t=r.rounding,r.precision=e+Math.max(n.e,n.sd())+B,r.rounding=1,n=Ur(r,Kr(r,n)),r.precision=e,r.rounding=t,G(hr>2?n.neg():n,e,t,!0)):new r(NaN)},V.squareRoot=V.sqrt=function(){var e,t,n,r,i,a,o=this,s=o.d,c=o.e,l=o.s,u=o.constructor;if(l!==1||!s||!s[0])return new u(!l||l<0&&(!s||s[0])?NaN:s?o:1/0);for(I=!1,l=Math.sqrt(+o),l==0||l==1/0?(t=H(s),(t.length+c)%2==0&&(t+=`0`),l=Math.sqrt(t),c=L((c+1)/2)-(c<0||c%2),l==1/0?t=`5e`+c:(t=l.toExponential(),t=t.slice(0,t.indexOf(`e`)+1)+c),r=new u(t)):r=new u(l.toString()),n=(c=u.precision)+3;;)if(a=r,r=a.plus(W(o,a,n+2,1)).times(.5),H(a.d).slice(0,n)===(t=H(r.d)).slice(0,n))if(t=t.slice(n-3,n+1),t==`9999`||!i&&t==`4999`){if(!i&&(G(a,c+1,0),a.times(a).eq(o))){r=a;break}n+=4,i=1}else{(!+t||!+t.slice(1)&&t.charAt(0)==`5`)&&(G(r,c+1,1),e=!r.times(r).eq(o));break}return I=!0,G(r,c,u.rounding,e)},V.tangent=V.tan=function(){var e,t,n=this,r=n.constructor;return n.isFinite()?n.isZero()?new r(n):(e=r.precision,t=r.rounding,r.precision=e+10,r.rounding=1,n=n.sin(),n.s=1,n=W(n,new r(1).minus(n.times(n)).sqrt(),e+10,0),r.precision=e,r.rounding=t,G(hr==2||hr==4?n.neg():n,e,t,!0)):new r(NaN)},V.times=V.mul=function(e){var t,n,r,i,a,o,s,c,l,u=this,d=u.constructor,f=u.d,p=(e=new d(e)).d;if(e.s*=u.s,!f||!f[0]||!p||!p[0])return new d(!e.s||f&&!f[0]&&!p||p&&!p[0]&&!f?NaN:!f||!p?e.s/0:e.s*0);for(n=L(u.e/B)+L(e.e/B),c=f.length,l=p.length,c<l&&(a=f,f=p,p=a,o=c,c=l,l=o),a=[],o=c+l,r=o;r--;)a.push(0);for(r=l;--r>=0;){for(t=0,i=c+r;i>r;)s=a[i]+p[r]*f[i-r-1]+t,a[i--]=s%z|0,t=s/z|0;a[i]=(a[i]+t)%z|0}for(;!a[--o];)a.pop();return t?++n:a.shift(),e.d=a,e.e=jr(a,n),I?G(e,d.precision,d.rounding):e},V.toBinary=function(e,t){return qr(this,2,e,t)},V.toDecimalPlaces=V.toDP=function(e,t){var n=this,r=n.constructor;return n=new r(n),e===void 0?n:(U(e,0,lr),t===void 0?t=r.rounding:U(t,0,8),G(n,e+n.e+1,t))},V.toExponential=function(e,t){var n,r=this,i=r.constructor;return e===void 0?n=K(r,!0):(U(e,0,lr),t===void 0?t=i.rounding:U(t,0,8),r=G(new i(r),e+1,t),n=K(r,!0,e+1)),r.isNeg()&&!r.isZero()?`-`+n:n},V.toFixed=function(e,t){var n,r,i=this,a=i.constructor;return e===void 0?n=K(i):(U(e,0,lr),t===void 0?t=a.rounding:U(t,0,8),r=G(new a(i),e+i.e+1,t),n=K(r,!1,e+r.e+1)),i.isNeg()&&!i.isZero()?`-`+n:n},V.toFraction=function(e){var t,n,r,i,a,o,s,c,l,u,d,f,p=this,m=p.d,h=p.constructor;if(!m)return new h(p);if(l=n=new h(1),r=c=new h(0),t=new h(r),a=t.e=Nr(m)-p.e-1,o=a%B,t.d[0]=R(10,o<0?B+o:o),e==null)e=a>0?t:l;else{if(s=new h(e),!s.isInt()||s.lt(l))throw Error(_r+s);e=s.gt(t)?a>0?t:l:s}for(I=!1,s=new h(H(m)),u=h.precision,h.precision=a=m.length*B*2;d=W(s,t,0,1,1),i=n.plus(d.times(r)),i.cmp(e)!=1;)n=r,r=i,i=l,l=c.plus(d.times(i)),c=i,i=t,t=s.minus(d.times(i)),s=i;return i=W(e.minus(n),r,0,1,1),c=c.plus(i.times(l)),n=n.plus(i.times(r)),c.s=l.s=p.s,f=W(l,r,a,1).minus(p).abs().cmp(W(c,n,a,1).minus(p).abs())<1?[l,r]:[c,n],h.precision=u,I=!0,f},V.toHexadecimal=V.toHex=function(e,t){return qr(this,16,e,t)},V.toNearest=function(e,t){var n=this,r=n.constructor;if(n=new r(n),e==null){if(!n.d)return n;e=new r(1),t=r.rounding}else{if(e=new r(e),t===void 0?t=r.rounding:U(t,0,8),!n.d)return e.s?n:e;if(!e.d)return e.s&&=n.s,e}return e.d[0]?(I=!1,n=W(n,e,0,t,1).times(e),I=!0,G(n)):(e.s=n.s,n=e),n},V.toNumber=function(){return+this},V.toOctal=function(e,t){return qr(this,8,e,t)},V.toPower=V.pow=function(e){var t,n,r,i,a,o,s=this,c=s.constructor,l=+(e=new c(e));if(!s.d||!e.d||!s.d[0]||!e.d[0])return new c(R(+s,l));if(s=new c(s),s.eq(1))return s;if(r=c.precision,a=c.rounding,e.eq(1))return G(s,r,a);if(t=L(e.e/B),t>=e.d.length-1&&(n=l<0?-l:l)<=Tr)return i=Fr(c,s,n,r),e.s<0?new c(1).div(i):G(i,r,a);if(o=s.s,o<0){if(t<e.d.length-1)return new c(NaN);if(e.d[t]&1||(o=1),s.e==0&&s.d[0]==1&&s.d.length==1)return s.s=o,s}return n=R(+s,l),t=n==0||!isFinite(n)?L(l*(Math.log(`0.`+H(s.d))/Math.LN10+s.e+1)):new c(n+``).e,t>c.maxE+1||t<c.minE-1?new c(t>0?o/0:0):(I=!1,c.rounding=s.s=1,n=Math.min(12,(t+``).length),i=Rr(e.times(zr(s,r+n)),r),i.d&&(i=G(i,r+5,1),Or(i.d,r,a)&&(t=r+10,i=G(Rr(e.times(zr(s,t+n)),t),t+5,1),+H(i.d).slice(r+1,r+15)+1==0x5af3107a4000&&(i=G(i,r+1,0)))),i.s=o,I=!0,c.rounding=a,G(i,r,a))},V.toPrecision=function(e,t){var n,r=this,i=r.constructor;return e===void 0?n=K(r,r.e<=i.toExpNeg||r.e>=i.toExpPos):(U(e,1,lr),t===void 0?t=i.rounding:U(t,0,8),r=G(new i(r),e,t),n=K(r,e<=r.e||r.e<=i.toExpNeg,e)),r.isNeg()&&!r.isZero()?`-`+n:n},V.toSignificantDigits=V.toSD=function(e,t){var n=this,r=n.constructor;return e===void 0?(e=r.precision,t=r.rounding):(U(e,1,lr),t===void 0?t=r.rounding:U(t,0,8)),G(new r(n),e,t)},V.toString=function(){var e=this,t=e.constructor,n=K(e,e.e<=t.toExpNeg||e.e>=t.toExpPos);return e.isNeg()&&!e.isZero()?`-`+n:n},V.truncated=V.trunc=function(){return G(new this.constructor(this),this.e+1,1)},V.valueOf=V.toJSON=function(){var e=this,t=e.constructor,n=K(e,e.e<=t.toExpNeg||e.e>=t.toExpPos);return e.isNeg()?`-`+n:n};function H(e){var t,n,r,i=e.length-1,a=``,o=e[0];if(i>0){for(a+=o,t=1;t<i;t++)r=e[t]+``,n=B-r.length,n&&(a+=Pr(n)),a+=r;o=e[t],r=o+``,n=B-r.length,n&&(a+=Pr(n))}else if(o===0)return`0`;for(;o%10==0;)o/=10;return a+o}function U(e,t,n){if(e!==~~e||e<t||e>n)throw Error(_r+e)}function Or(e,t,n,r){var i,a,o,s;for(a=e[0];a>=10;a/=10)--t;return--t<0?(t+=B,i=0):(i=Math.ceil((t+1)/B),t%=B),a=R(10,B-t),s=e[i]%a|0,r==null?t<3?(t==0?s=s/100|0:t==1&&(s=s/10|0),o=n<4&&s==99999||n>3&&s==49999||s==5e4||s==0):o=(n<4&&s+1==a||n>3&&s+1==a/2)&&(e[i+1]/a/100|0)==R(10,t-2)-1||(s==a/2||s==0)&&(e[i+1]/a/100|0)==0:t<4?(t==0?s=s/1e3|0:t==1?s=s/100|0:t==2&&(s=s/10|0),o=(r||n<4)&&s==9999||!r&&n>3&&s==4999):o=((r||n<4)&&s+1==a||!r&&n>3&&s+1==a/2)&&(e[i+1]/a/1e3|0)==R(10,t-3)-1,o}function kr(e,t,n){for(var r,i=[0],a,o=0,s=e.length;o<s;){for(a=i.length;a--;)i[a]*=t;for(i[0]+=ur.indexOf(e.charAt(o++)),r=0;r<i.length;r++)i[r]>n-1&&(i[r+1]===void 0&&(i[r+1]=0),i[r+1]+=i[r]/n|0,i[r]%=n)}return i.reverse()}function Ar(e,t){var n,r,i;if(t.isZero())return t;r=t.d.length,r<32?(n=Math.ceil(r/3),i=(1/Gr(4,n)).toString()):(n=16,i=`2.3283064365386962890625e-10`),e.precision+=n,t=Wr(e,1,t.times(i),new e(1));for(var a=n;a--;){var o=t.times(t);t=o.times(o).minus(o).times(8).plus(1)}return e.precision-=n,t}var W=(function(){function e(e,t,n){var r,i=0,a=e.length;for(e=e.slice();a--;)r=e[a]*t+i,e[a]=r%n|0,i=r/n|0;return i&&e.unshift(i),e}function t(e,t,n,r){var i,a;if(n!=r)a=n>r?1:-1;else for(i=a=0;i<n;i++)if(e[i]!=t[i]){a=e[i]>t[i]?1:-1;break}return a}function n(e,t,n,r){for(var i=0;n--;)e[n]-=i,i=e[n]<t[n]?1:0,e[n]=i*r+e[n]-t[n];for(;!e[0]&&e.length>1;)e.shift()}return function(r,i,a,o,s,c){var l,u,d,f,p,m,h,g,_,v,y,b,x,S,C,ee,w,T,E,te,ne=r.constructor,D=r.s==i.s?1:-1,O=r.d,k=i.d;if(!O||!O[0]||!k||!k[0])return new ne(!r.s||!i.s||(O?k&&O[0]==k[0]:!k)?NaN:O&&O[0]==0||!k?D*0:D/0);for(c?(p=1,u=r.e-i.e):(c=z,p=B,u=L(r.e/p)-L(i.e/p)),E=k.length,w=O.length,_=new ne(D),v=_.d=[],d=0;k[d]==(O[d]||0);d++);if(k[d]>(O[d]||0)&&u--,a==null?(S=a=ne.precision,o=ne.rounding):S=s?a+(r.e-i.e)+1:a,S<0)v.push(1),m=!0;else{if(S=S/p+2|0,d=0,E==1){for(f=0,k=k[0],S++;(d<w||f)&&S--;d++)C=f*c+(O[d]||0),v[d]=C/k|0,f=C%k|0;m=f||d<w}else{for(f=c/(k[0]+1)|0,f>1&&(k=e(k,f,c),O=e(O,f,c),E=k.length,w=O.length),ee=E,y=O.slice(0,E),b=y.length;b<E;)y[b++]=0;te=k.slice(),te.unshift(0),T=k[0],k[1]>=c/2&&++T;do f=0,l=t(k,y,E,b),l<0?(x=y[0],E!=b&&(x=x*c+(y[1]||0)),f=x/T|0,f>1?(f>=c&&(f=c-1),h=e(k,f,c),g=h.length,b=y.length,l=t(h,y,g,b),l==1&&(f--,n(h,E<g?te:k,g,c))):(f==0&&(l=f=1),h=k.slice()),g=h.length,g<b&&h.unshift(0),n(y,h,b,c),l==-1&&(b=y.length,l=t(k,y,E,b),l<1&&(f++,n(y,E<b?te:k,b,c))),b=y.length):l===0&&(f++,y=[0]),v[d++]=f,l&&y[0]?y[b++]=O[ee]||0:(y=[O[ee]],b=1);while((ee++<w||y[0]!==void 0)&&S--);m=y[0]!==void 0}v[0]||v.shift()}if(p==1)_.e=u,mr=m;else{for(d=1,f=v[0];f>=10;f/=10)d++;_.e=d+u*p-1,G(_,s?a+_.e+1:a,o,m)}return _}})();function G(e,t,n,r){var i,a,o,s,c,l,u,d,f,p=e.constructor;out:if(t!=null){if(d=e.d,!d)return e;for(i=1,s=d[0];s>=10;s/=10)i++;if(a=t-i,a<0)a+=B,o=t,u=d[f=0],c=u/R(10,i-o-1)%10|0;else if(f=Math.ceil((a+1)/B),s=d.length,f>=s)if(r){for(;s++<=f;)d.push(0);u=c=0,i=1,a%=B,o=a-B+1}else break out;else{for(u=s=d[f],i=1;s>=10;s/=10)i++;a%=B,o=a-B+i,c=o<0?0:u/R(10,i-o-1)%10|0}if(r=r||t<0||d[f+1]!==void 0||(o<0?u:u%R(10,i-o-1)),l=n<4?(c||r)&&(n==0||n==(e.s<0?3:2)):c>5||c==5&&(n==4||r||n==6&&(a>0?o>0?u/R(10,i-o):0:d[f-1])%10&1||n==(e.s<0?8:7)),t<1||!d[0])return d.length=0,l?(t-=e.e+1,d[0]=R(10,(B-t%B)%B),e.e=-t||0):d[0]=e.e=0,e;if(a==0?(d.length=f,s=1,f--):(d.length=f+1,s=R(10,B-a),d[f]=o>0?(u/R(10,i-o)%R(10,o)|0)*s:0),l)for(;;)if(f==0){for(a=1,o=d[0];o>=10;o/=10)a++;for(o=d[0]+=s,s=1;o>=10;o/=10)s++;a!=s&&(e.e++,d[0]==z&&(d[0]=1));break}else{if(d[f]+=s,d[f]!=z)break;d[f--]=0,s=1}for(a=d.length;d[--a]===0;)d.pop()}return I&&(e.e>p.maxE?(e.d=null,e.e=NaN):e.e<p.minE&&(e.e=0,e.d=[0])),e}function K(e,t,n){if(!e.isFinite())return Br(e);var r,i=e.e,a=H(e.d),o=a.length;return t?(n&&(r=n-o)>0?a=a.charAt(0)+`.`+a.slice(1)+Pr(r):o>1&&(a=a.charAt(0)+`.`+a.slice(1)),a=a+(e.e<0?`e`:`e+`)+e.e):i<0?(a=`0.`+Pr(-i-1)+a,n&&(r=n-o)>0&&(a+=Pr(r))):i>=o?(a+=Pr(i+1-o),n&&(r=n-i-1)>0&&(a=a+`.`+Pr(r))):((r=i+1)<o&&(a=a.slice(0,r)+`.`+a.slice(r)),n&&(r=n-o)>0&&(i+1===o&&(a+=`.`),a+=Pr(r))),a}function jr(e,t){var n=e[0];for(t*=B;n>=10;n/=10)t++;return t}function Mr(e,t,n){if(t>Er)throw I=!0,n&&(e.precision=n),Error(vr);return G(new e(dr),t,1,!0)}function q(e,t,n){if(t>Dr)throw Error(vr);return G(new e(fr),t,n,!0)}function Nr(e){var t=e.length-1,n=t*B+1;if(t=e[t],t){for(;t%10==0;t/=10)n--;for(t=e[0];t>=10;t/=10)n++}return n}function Pr(e){for(var t=``;e--;)t+=`0`;return t}function Fr(e,t,n,r){var i,a=new e(1),o=Math.ceil(r/B+4);for(I=!1;;){if(n%2&&(a=a.times(t),Jr(a.d,o)&&(i=!0)),n=L(n/2),n===0){n=a.d.length-1,i&&a.d[n]===0&&++a.d[n];break}t=t.times(t),Jr(t.d,o)}return I=!0,a}function Ir(e){return e.d[e.d.length-1]&1}function Lr(e,t,n){for(var r,i,a=new e(t[0]),o=0;++o<t.length;){if(i=new e(t[o]),!i.s){a=i;break}r=a.cmp(i),(r===n||r===0&&a.s===n)&&(a=i)}return a}function Rr(e,t){var n,r,i,a,o,s,c,l=0,u=0,d=0,f=e.constructor,p=f.rounding,m=f.precision;if(!e.d||!e.d[0]||e.e>17)return new f(e.d?e.d[0]?e.s<0?0:1/0:1:e.s?e.s<0?0:e:NaN);for(t==null?(I=!1,c=m):c=t,s=new f(.03125);e.e>-2;)e=e.times(s),d+=5;for(r=Math.log(R(2,d))/Math.LN10*2+5|0,c+=r,n=a=o=new f(1),f.precision=c;;){if(a=G(a.times(e),c,1),n=n.times(++u),s=o.plus(W(a,n,c,1)),H(s.d).slice(0,c)===H(o.d).slice(0,c)){for(i=d;i--;)o=G(o.times(o),c,1);if(t==null)if(l<3&&Or(o.d,c-r,p,l))f.precision=c+=10,n=a=s=new f(1),u=0,l++;else return G(o,f.precision=m,p,I=!0);else return f.precision=m,o}o=s}}function zr(e,t){var n,r,i,a,o,s,c,l,u,d,f,p=1,m=10,h=e,g=h.d,_=h.constructor,v=_.rounding,y=_.precision;if(h.s<0||!g||!g[0]||!h.e&&g[0]==1&&g.length==1)return new _(g&&!g[0]?-1/0:h.s==1?g?0:h:NaN);if(t==null?(I=!1,u=y):u=t,_.precision=u+=m,n=H(g),r=n.charAt(0),Math.abs(a=h.e)<0x5543df729c000){for(;r<7&&r!=1||r==1&&n.charAt(1)>3;)h=h.times(e),n=H(h.d),r=n.charAt(0),p++;a=h.e,r>1?(h=new _(`0.`+n),a++):h=new _(r+`.`+n.slice(1))}else return l=Mr(_,u+2,y).times(a+``),h=zr(new _(r+`.`+n.slice(1)),u-m).plus(l),_.precision=y,t==null?G(h,y,v,I=!0):h;for(d=h,c=o=h=W(h.minus(1),h.plus(1),u,1),f=G(h.times(h),u,1),i=3;;){if(o=G(o.times(f),u,1),l=c.plus(W(o,new _(i),u,1)),H(l.d).slice(0,u)===H(c.d).slice(0,u))if(c=c.times(2),a!==0&&(c=c.plus(Mr(_,u+2,y).times(a+``))),c=W(c,new _(p),u,1),t==null)if(Or(c.d,u-m,v,s))_.precision=u+=m,l=o=h=W(d.minus(1),d.plus(1),u,1),f=G(h.times(h),u,1),i=s=1;else return G(c,_.precision=y,v,I=!0);else return _.precision=y,c;c=l,i+=2}}function Br(e){return String(e.s*e.s/0)}function Vr(e,t){var n,r,i;for((n=t.indexOf(`.`))>-1&&(t=t.replace(`.`,``)),(r=t.search(/e/i))>0?(n<0&&(n=r),n+=+t.slice(r+1),t=t.substring(0,r)):n<0&&(n=t.length),r=0;t.charCodeAt(r)===48;r++);for(i=t.length;t.charCodeAt(i-1)===48;--i);if(t=t.slice(r,i),t){if(i-=r,e.e=n=n-r-1,e.d=[],r=(n+1)%B,n<0&&(r+=B),r<i){for(r&&e.d.push(+t.slice(0,r)),i-=B;r<i;)e.d.push(+t.slice(r,r+=B));t=t.slice(r),r=B-t.length}else r-=i;for(;r--;)t+=`0`;e.d.push(+t),I&&(e.e>e.constructor.maxE?(e.d=null,e.e=NaN):e.e<e.constructor.minE&&(e.e=0,e.d=[0]))}else e.e=0,e.d=[0];return e}function Hr(e,t){var n,r,i,a,o,s,c,l,u;if(t.indexOf(`_`)>-1){if(t=t.replace(/(\d)_(?=\d)/g,`$1`),wr.test(t))return Vr(e,t)}else if(t===`Infinity`||t===`NaN`)return+t||(e.s=NaN),e.e=NaN,e.d=null,e;if(Sr.test(t))n=16,t=t.toLowerCase();else if(xr.test(t))n=2;else if(Cr.test(t))n=8;else throw Error(_r+t);for(a=t.search(/p/i),a>0?(c=+t.slice(a+1),t=t.substring(2,a)):t=t.slice(2),a=t.indexOf(`.`),o=a>=0,r=e.constructor,o&&(t=t.replace(`.`,``),s=t.length,a=s-a,i=Fr(r,new r(n),a,a*2)),l=kr(t,n,z),u=l.length-1,a=u;l[a]===0;--a)l.pop();return a<0?new r(e.s*0):(e.e=jr(l,u),e.d=l,I=!1,o&&(e=W(e,i,s*4)),c&&(e=e.times(Math.abs(c)<54?R(2,c):Ii.pow(2,c))),I=!0,e)}function Ur(e,t){var n,r=t.d.length;if(r<3)return t.isZero()?t:Wr(e,2,t,t);n=1.4*Math.sqrt(r),n=n>16?16:n|0,t=t.times(1/Gr(5,n)),t=Wr(e,2,t,t);for(var i,a=new e(5),o=new e(16),s=new e(20);n--;)i=t.times(t),t=t.times(a.plus(i.times(o.times(i).minus(s))));return t}function Wr(e,t,n,r,i){var a,o,s,c,l=1,u=e.precision,d=Math.ceil(u/B);for(I=!1,c=n.times(n),s=new e(r);;){if(o=W(s.times(c),new e(t++*t++),u,1),s=i?r.plus(o):r.minus(o),r=W(o.times(c),new e(t++*t++),u,1),o=s.plus(r),o.d[d]!==void 0){for(a=d;o.d[a]===s.d[a]&&a--;);if(a==-1)break}a=s,s=r,r=o,o=a,l++}return I=!0,o.d.length=d+1,o}function Gr(e,t){for(var n=e;--t;)n*=e;return n}function Kr(e,t){var n,r=t.s<0,i=q(e,e.precision,1),a=i.times(.5);if(t=t.abs(),t.lte(a))return hr=r?4:1,t;if(n=t.divToInt(i),n.isZero())hr=r?3:2;else{if(t=t.minus(n.times(i)),t.lte(a))return hr=Ir(n)?r?2:3:r?4:1,t;hr=Ir(n)?r?1:4:r?3:2}return t.minus(i).abs()}function qr(e,t,n,r){var i,a,o,s,c,l,u,d,f,p=e.constructor,m=n!==void 0;if(m?(U(n,1,lr),r===void 0?r=p.rounding:U(r,0,8)):(n=p.precision,r=p.rounding),!e.isFinite())u=Br(e);else{for(u=K(e),o=u.indexOf(`.`),m?(i=2,t==16?n=n*4-3:t==8&&(n=n*3-2)):i=t,o>=0&&(u=u.replace(`.`,``),f=new p(1),f.e=u.length-o,f.d=kr(K(f),10,i),f.e=f.d.length),d=kr(u,10,i),a=c=d.length;d[--c]==0;)d.pop();if(!d[0])u=m?`0p+0`:`0`;else{if(o<0?a--:(e=new p(e),e.d=d,e.e=a,e=W(e,f,n,r,0,i),d=e.d,a=e.e,l=mr),o=d[n],s=i/2,l||=d[n+1]!==void 0,l=r<4?(o!==void 0||l)&&(r===0||r===(e.s<0?3:2)):o>s||o===s&&(r===4||l||r===6&&d[n-1]&1||r===(e.s<0?8:7)),d.length=n,l)for(;++d[--n]>i-1;)d[n]=0,n||(++a,d.unshift(1));for(c=d.length;!d[c-1];--c);for(o=0,u=``;o<c;o++)u+=ur.charAt(d[o]);if(m){if(c>1)if(t==16||t==8){for(o=t==16?4:3,--c;c%o;c++)u+=`0`;for(d=kr(u,i,t),c=d.length;!d[c-1];--c);for(o=1,u=`1.`;o<c;o++)u+=ur.charAt(d[o])}else u=u.charAt(0)+`.`+u.slice(1);u=u+(a<0?`p`:`p+`)+a}else if(a<0){for(;++a;)u=`0`+u;u=`0.`+u}else if(++a>c)for(a-=c;a--;)u+=`0`;else a<c&&(u=u.slice(0,a)+`.`+u.slice(a))}u=(t==16?`0x`:t==2?`0b`:t==8?`0o`:``)+u}return e.s<0?`-`+u:u}function Jr(e,t){if(e.length>t)return e.length=t,!0}function Yr(e){return new this(e).abs()}function Xr(e){return new this(e).acos()}function Zr(e){return new this(e).acosh()}function Qr(e,t){return new this(e).plus(t)}function $r(e){return new this(e).asin()}function ei(e){return new this(e).asinh()}function ti(e){return new this(e).atan()}function ni(e){return new this(e).atanh()}function ri(e,t){e=new this(e),t=new this(t);var n,r=this.precision,i=this.rounding,a=r+4;return!e.s||!t.s?n=new this(NaN):!e.d&&!t.d?(n=q(this,a,1).times(t.s>0?.25:.75),n.s=e.s):!t.d||e.isZero()?(n=t.s<0?q(this,r,i):new this(0),n.s=e.s):!e.d||t.isZero()?(n=q(this,a,1).times(.5),n.s=e.s):t.s<0?(this.precision=a,this.rounding=1,n=this.atan(W(e,t,a,1)),t=q(this,a,1),this.precision=r,this.rounding=i,n=e.s<0?n.minus(t):n.plus(t)):n=this.atan(W(e,t,a,1)),n}function ii(e){return new this(e).cbrt()}function ai(e){return G(e=new this(e),e.e+1,2)}function oi(e,t,n){return new this(e).clamp(t,n)}function si(e){if(!e||typeof e!=`object`)throw Error(gr+`Object expected`);var t,n,r,i=e.defaults===!0,a=[`precision`,1,lr,`rounding`,0,8,`toExpNeg`,-cr,0,`toExpPos`,0,cr,`maxE`,0,cr,`minE`,-cr,0,`modulo`,0,9];for(t=0;t<a.length;t+=3)if(n=a[t],i&&(this[n]=pr[n]),(r=e[n])!==void 0)if(L(r)===r&&r>=a[t+1]&&r<=a[t+2])this[n]=r;else throw Error(_r+n+`: `+r);if(n=`crypto`,i&&(this[n]=pr[n]),(r=e[n])!==void 0)if(r===!0||r===!1||r===0||r===1)if(r)if(typeof crypto<`u`&&crypto&&(crypto.getRandomValues||crypto.randomBytes))this[n]=!0;else throw Error(yr);else this[n]=!1;else throw Error(_r+n+`: `+r);return this}function ci(e){return new this(e).cos()}function li(e){return new this(e).cosh()}function ui(e){var t,n,r;function i(e){var t,n,r,a=this;if(!(a instanceof i))return new i(e);if(a.constructor=i,hi(e)){a.s=e.s,I?!e.d||e.e>i.maxE?(a.e=NaN,a.d=null):e.e<i.minE?(a.e=0,a.d=[0]):(a.e=e.e,a.d=e.d.slice()):(a.e=e.e,a.d=e.d?e.d.slice():e.d);return}if(r=typeof e,r===`number`){if(e===0){a.s=1/e<0?-1:1,a.e=0,a.d=[0];return}if(e<0?(e=-e,a.s=-1):a.s=1,e===~~e&&e<1e7){for(t=0,n=e;n>=10;n/=10)t++;I?t>i.maxE?(a.e=NaN,a.d=null):t<i.minE?(a.e=0,a.d=[0]):(a.e=t,a.d=[e]):(a.e=t,a.d=[e]);return}if(e*0!=0){e||(a.s=NaN),a.e=NaN,a.d=null;return}return Vr(a,e.toString())}if(r===`string`)return(n=e.charCodeAt(0))===45?(e=e.slice(1),a.s=-1):(n===43&&(e=e.slice(1)),a.s=1),wr.test(e)?Vr(a,e):Hr(a,e);if(r===`bigint`)return e<0?(e=-e,a.s=-1):a.s=1,Vr(a,e.toString());throw Error(_r+e)}if(i.prototype=V,i.ROUND_UP=0,i.ROUND_DOWN=1,i.ROUND_CEIL=2,i.ROUND_FLOOR=3,i.ROUND_HALF_UP=4,i.ROUND_HALF_DOWN=5,i.ROUND_HALF_EVEN=6,i.ROUND_HALF_CEIL=7,i.ROUND_HALF_FLOOR=8,i.EUCLID=9,i.config=i.set=si,i.clone=ui,i.isDecimal=hi,i.abs=Yr,i.acos=Xr,i.acosh=Zr,i.add=Qr,i.asin=$r,i.asinh=ei,i.atan=ti,i.atanh=ni,i.atan2=ri,i.cbrt=ii,i.ceil=ai,i.clamp=oi,i.cos=ci,i.cosh=li,i.div=di,i.exp=fi,i.floor=pi,i.hypot=mi,i.ln=gi,i.log=_i,i.log10=yi,i.log2=vi,i.max=bi,i.min=xi,i.mod=Si,i.mul=Ci,i.pow=wi,i.random=Ti,i.round=Ei,i.sign=Di,i.sin=Oi,i.sinh=ki,i.sqrt=Ai,i.sub=ji,i.sum=Mi,i.tan=Ni,i.tanh=Pi,i.trunc=Fi,e===void 0&&(e={}),e&&e.defaults!==!0)for(r=[`precision`,`rounding`,`toExpNeg`,`toExpPos`,`maxE`,`minE`,`modulo`,`crypto`],t=0;t<r.length;)e.hasOwnProperty(n=r[t++])||(e[n]=this[n]);return i.config(e),i}function di(e,t){return new this(e).div(t)}function fi(e){return new this(e).exp()}function pi(e){return G(e=new this(e),e.e+1,3)}function mi(){var e,t,n=new this(0);for(I=!1,e=0;e<arguments.length;)if(t=new this(arguments[e++]),t.d)n.d&&(n=n.plus(t.times(t)));else{if(t.s)return I=!0,new this(1/0);n=t}return I=!0,n.sqrt()}function hi(e){return e instanceof Ii||e&&e.toStringTag===br||!1}function gi(e){return new this(e).ln()}function _i(e,t){return new this(e).log(t)}function vi(e){return new this(e).log(2)}function yi(e){return new this(e).log(10)}function bi(){return Lr(this,arguments,-1)}function xi(){return Lr(this,arguments,1)}function Si(e,t){return new this(e).mod(t)}function Ci(e,t){return new this(e).mul(t)}function wi(e,t){return new this(e).pow(t)}function Ti(e){var t,n,r,i,a=0,o=new this(1),s=[];if(e===void 0?e=this.precision:U(e,1,lr),r=Math.ceil(e/B),this.crypto)if(crypto.getRandomValues)for(t=crypto.getRandomValues(new Uint32Array(r));a<r;)i=t[a],i>=429e7?t[a]=crypto.getRandomValues(new Uint32Array(1))[0]:s[a++]=i%1e7;else if(crypto.randomBytes){for(t=crypto.randomBytes(r*=4);a<r;)i=t[a]+(t[a+1]<<8)+(t[a+2]<<16)+((t[a+3]&127)<<24),i>=214e7?crypto.randomBytes(4).copy(t,a):(s.push(i%1e7),a+=4);a=r/4}else throw Error(yr);else for(;a<r;)s[a++]=Math.random()*1e7|0;for(r=s[--a],e%=B,r&&e&&(i=R(10,B-e),s[a]=(r/i|0)*i);s[a]===0;a--)s.pop();if(a<0)n=0,s=[0];else{for(n=-1;s[0]===0;n-=B)s.shift();for(r=1,i=s[0];i>=10;i/=10)r++;r<B&&(n-=B-r)}return o.e=n,o.d=s,o}function Ei(e){return G(e=new this(e),e.e+1,this.rounding)}function Di(e){return e=new this(e),e.d?e.d[0]?e.s:0*e.s:e.s||NaN}function Oi(e){return new this(e).sin()}function ki(e){return new this(e).sinh()}function Ai(e){return new this(e).sqrt()}function ji(e,t){return new this(e).sub(t)}function Mi(){var e=0,t=arguments,n=new this(t[e]);for(I=!1;n.s&&++e<t.length;)n=n.plus(t[e]);return I=!0,G(n,this.precision,this.rounding)}function Ni(e){return new this(e).tan()}function Pi(e){return new this(e).tanh()}function Fi(e){return G(e=new this(e),e.e+1,1)}V[Symbol.for(`nodejs.util.inspect.custom`)]=V.toString,V[Symbol.toStringTag]=`Decimal`;var Ii=V.constructor=ui(pr);dr=new Ii(dr),fr=new Ii(fr);var Li=Ii,Ri=Vn(`BigNumber`,[`?on`,`config`],e=>{var{on:t,config:n}=e,r=Li.clone({precision:n.precision,modulo:Li.EUCLID});return r.prototype=Object.create(r.prototype),r.prototype.type=`BigNumber`,r.prototype.isBigNumber=!0,r.prototype.toJSON=function(){return{mathjs:`BigNumber`,value:this.toString()}},r.fromJSON=function(e){return new r(e.value)},t&&t(`config`,function(e,t){e.precision!==t.precision&&r.config({precision:e.precision})}),r},{isClass:!0});const J=Math.cosh||function(e){return Math.abs(e)<1e-9?1-e:(Math.exp(e)+Math.exp(-e))*.5},Y=Math.sinh||function(e){return Math.abs(e)<1e-9?e:(Math.exp(e)-Math.exp(-e))*.5},zi=function(e){let t=Math.PI/4;if(-t>e||e>t)return Math.cos(e)-1;let n=e*e;return n*(n*(n*(n*(n*(n*(n*(n/20922789888e3-1/87178291200)+1/479001600)-1/3628800)+1/40320)-1/720)+1/24)-1/2)},Bi=function(e,t){return e=Math.abs(e),t=Math.abs(t),e<t&&([e,t]=[t,e]),e<1e8?Math.sqrt(e*e+t*t):(t/=e,e*Math.sqrt(1+t*t))},Vi=function(){throw SyntaxError(`Invalid Param`)};function Hi(e,t){let n=Math.abs(e),r=Math.abs(t);return e===0?Math.log(r):t===0?Math.log(n):n<3e3&&r<3e3?Math.log(e*e+t*t)*.5:(e*=.5,t*=.5,.5*Math.log(e*e+t*t)+Math.LN2)}const Ui={re:0,im:0},Wi=function(e,t){let n=Ui;if(e==null)n.re=n.im=0;else if(t!==void 0)n.re=e,n.im=t;else switch(typeof e){case`object`:if(`im`in e&&`re`in e)n.re=e.re,n.im=e.im;else if(`abs`in e&&`arg`in e){if(!isFinite(e.abs)&&isFinite(e.arg))return X.INFINITY;n.re=e.abs*Math.cos(e.arg),n.im=e.abs*Math.sin(e.arg)}else if(`r`in e&&`phi`in e){if(!isFinite(e.r)&&isFinite(e.phi))return X.INFINITY;n.re=e.r*Math.cos(e.phi),n.im=e.r*Math.sin(e.phi)}else e.length===2?(n.re=e[0],n.im=e[1]):Vi();break;case`string`:n.im=n.re=0;let t=e.replace(/_/g,``).match(/\d+\.?\d*e[+-]?\d+|\d+\.?\d*|\.\d+|./g),r=1,i=0;t===null&&Vi();for(let e=0;e<t.length;e++){let a=t[e];a===` `||a===` `||a===`
|
|
117
|
-
`||(a===`+`?r++:a===`-`?i++:a===`i`||a===`I`?(r+i===0&&Vi(),t[e+1]!==` `&&!isNaN(t[e+1])?(n.im+=parseFloat((i%2?`-`:``)+t[e+1]),e++):n.im+=parseFloat((i%2?`-`:``)+`1`),r=i=0):((r+i===0||isNaN(a))&&Vi(),t[e+1]===`i`||t[e+1]===`I`?(n.im+=parseFloat((i%2?`-`:``)+a),e++):n.re+=parseFloat((i%2?`-`:``)+a),r=i=0))}r+i>0&&Vi();break;case`number`:n.im=0,n.re=e;break;default:Vi()}return isNaN(n.re)||isNaN(n.im),n};function X(e,t){if(!(this instanceof X))return new X(e,t);let n=Wi(e,t);this.re=n.re,this.im=n.im}X.prototype={re:0,im:0,sign:function(){let e=Bi(this.re,this.im);return new X(this.re/e,this.im/e)},add:function(e,t){let n=Wi(e,t),r=this.isInfinite(),i=!(isFinite(n.re)&&isFinite(n.im));return r||i?r&&i?X.NAN:X.INFINITY:new X(this.re+n.re,this.im+n.im)},sub:function(e,t){let n=Wi(e,t),r=this.isInfinite(),i=!(isFinite(n.re)&&isFinite(n.im));return r||i?r&&i?X.NAN:X.INFINITY:new X(this.re-n.re,this.im-n.im)},mul:function(e,t){let n=Wi(e,t),r=this.isInfinite(),i=!(isFinite(n.re)&&isFinite(n.im)),a=this.re===0&&this.im===0,o=n.re===0&&n.im===0;return r&&o||i&&a?X.NAN:r||i?X.INFINITY:n.im===0&&this.im===0?new X(this.re*n.re,0):new X(this.re*n.re-this.im*n.im,this.re*n.im+this.im*n.re)},div:function(e,t){let n=Wi(e,t),r=this.isInfinite(),i=!(isFinite(n.re)&&isFinite(n.im)),a=this.re===0&&this.im===0,o=n.re===0&&n.im===0;if(a&&o||r&&i)return X.NAN;if(o||r)return X.INFINITY;if(a||i)return X.ZERO;if(n.im===0)return new X(this.re/n.re,this.im/n.re);if(Math.abs(n.re)<Math.abs(n.im)){let e=n.re/n.im,t=n.re*e+n.im;return new X((this.re*e+this.im)/t,(this.im*e-this.re)/t)}else{let e=n.im/n.re,t=n.im*e+n.re;return new X((this.re+this.im*e)/t,(this.im-this.re*e)/t)}},pow:function(e,t){let n=Wi(e,t),r=this.re===0&&this.im===0;if(n.re===0&&n.im===0)return X.ONE;if(n.im===0){if(this.im===0&&this.re>0)return new X(this.re**+n.re,0);if(this.re===0)switch((n.re%4+4)%4){case 0:return new X(this.im**+n.re,0);case 1:return new X(0,this.im**+n.re);case 2:return new X(-(this.im**+n.re),0);case 3:return new X(0,-(this.im**+n.re))}}if(r&&n.re>0)return X.ZERO;let i=Math.atan2(this.im,this.re),a=Hi(this.re,this.im),o=Math.exp(n.re*a-n.im*i),s=n.im*a+n.re*i;return new X(o*Math.cos(s),o*Math.sin(s))},sqrt:function(){let e=this.re,t=this.im;if(t===0)return e>=0?new X(Math.sqrt(e),0):new X(0,Math.sqrt(-e));let n=Bi(e,t),r=Math.sqrt(.5*(n+Math.abs(e))),i=Math.abs(t)/(2*r);return e>=0?new X(r,t<0?-i:i):new X(i,t<0?-r:r)},exp:function(){let e=Math.exp(this.re);return this.im===0?new X(e,0):new X(e*Math.cos(this.im),e*Math.sin(this.im))},expm1:function(){let e=this.re,t=this.im;return new X(Math.expm1(e)*Math.cos(t)+zi(t),Math.exp(e)*Math.sin(t))},log:function(){let e=this.re,t=this.im;return t===0&&e>0?new X(Math.log(e),0):new X(Hi(e,t),Math.atan2(t,e))},abs:function(){return Bi(this.re,this.im)},arg:function(){return Math.atan2(this.im,this.re)},sin:function(){let e=this.re,t=this.im;return new X(Math.sin(e)*J(t),Math.cos(e)*Y(t))},cos:function(){let e=this.re,t=this.im;return new X(Math.cos(e)*J(t),-Math.sin(e)*Y(t))},tan:function(){let e=2*this.re,t=2*this.im,n=Math.cos(e)+J(t);return new X(Math.sin(e)/n,Y(t)/n)},cot:function(){let e=2*this.re,t=2*this.im,n=Math.cos(e)-J(t);return new X(-Math.sin(e)/n,Y(t)/n)},sec:function(){let e=this.re,t=this.im,n=.5*J(2*t)+.5*Math.cos(2*e);return new X(Math.cos(e)*J(t)/n,Math.sin(e)*Y(t)/n)},csc:function(){let e=this.re,t=this.im,n=.5*J(2*t)-.5*Math.cos(2*e);return new X(Math.sin(e)*J(t)/n,-Math.cos(e)*Y(t)/n)},asin:function(){let e=this.re,t=this.im,n=new X(t*t-e*e+1,-2*e*t).sqrt(),r=new X(n.re-t,n.im+e).log();return new X(r.im,-r.re)},acos:function(){let e=this.re,t=this.im,n=new X(t*t-e*e+1,-2*e*t).sqrt(),r=new X(n.re-t,n.im+e).log();return new X(Math.PI/2-r.im,r.re)},atan:function(){let e=this.re,t=this.im;if(e===0){if(t===1)return new X(0,1/0);if(t===-1)return new X(0,-1/0)}let n=e*e+(1-t)*(1-t),r=new X((1-t*t-e*e)/n,-2*e/n).log();return new X(-.5*r.im,.5*r.re)},acot:function(){let e=this.re,t=this.im;if(t===0)return new X(Math.atan2(1,e),0);let n=e*e+t*t;return n===0?new X(e===0?0:e/0,t===0?0:-t/0).atan():new X(e/n,-t/n).atan()},asec:function(){let e=this.re,t=this.im;if(e===0&&t===0)return new X(0,1/0);let n=e*e+t*t;return n===0?new X(e===0?0:e/0,t===0?0:-t/0).acos():new X(e/n,-t/n).acos()},acsc:function(){let e=this.re,t=this.im;if(e===0&&t===0)return new X(Math.PI/2,1/0);let n=e*e+t*t;return n===0?new X(e===0?0:e/0,t===0?0:-t/0).asin():new X(e/n,-t/n).asin()},sinh:function(){let e=this.re,t=this.im;return new X(Y(e)*Math.cos(t),J(e)*Math.sin(t))},cosh:function(){let e=this.re,t=this.im;return new X(J(e)*Math.cos(t),Y(e)*Math.sin(t))},tanh:function(){let e=2*this.re,t=2*this.im,n=J(e)+Math.cos(t);return new X(Y(e)/n,Math.sin(t)/n)},coth:function(){let e=2*this.re,t=2*this.im,n=J(e)-Math.cos(t);return new X(Y(e)/n,-Math.sin(t)/n)},csch:function(){let e=this.re,t=this.im,n=Math.cos(2*t)-J(2*e);return new X(-2*Y(e)*Math.cos(t)/n,2*J(e)*Math.sin(t)/n)},sech:function(){let e=this.re,t=this.im,n=Math.cos(2*t)+J(2*e);return new X(2*J(e)*Math.cos(t)/n,-2*Y(e)*Math.sin(t)/n)},asinh:function(){let e=this.
|
|
116
|
+
var cr=9e15,lr=1e9,ur=`0123456789abcdef`,dr=`2.3025850929940456840179914546843642076011014886287729760333279009675726096773524802359972050895982983419677840422862486334095254650828067566662873690987816894829072083255546808437998948262331985283935053089653777326288461633662222876982198867465436674744042432743651550489343149393914796194044002221051017141748003688084012647080685567743216228355220114804663715659121373450747856947683463616792101806445070648000277502684916746550586856935673420670581136429224554405758925724208241314695689016758940256776311356919292033376587141660230105703089634572075440370847469940168269282808481184289314848524948644871927809676271275775397027668605952496716674183485704422507197965004714951050492214776567636938662976979522110718264549734772662425709429322582798502585509785265383207606726317164309505995087807523710333101197857547331541421808427543863591778117054309827482385045648019095610299291824318237525357709750539565187697510374970888692180205189339507238539205144634197265287286965110862571492198849978748873771345686209167058`,fr=`3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679821480865132823066470938446095505822317253594081284811174502841027019385211055596446229489549303819644288109756659334461284756482337867831652712019091456485669234603486104543266482133936072602491412737245870066063155881748815209209628292540917153643678925903600113305305488204665213841469519415116094330572703657595919530921861173819326117931051185480744623799627495673518857527248912279381830119491298336733624406566430860213949463952247371907021798609437027705392171762931767523846748184676694051320005681271452635608277857713427577896091736371787214684409012249534301465495853710507922796892589235420199561121290219608640344181598136297747713099605187072113499999983729780499510597317328160963185950244594553469083026425223082533446850352619311881710100031378387528865875332083814206171776691473035982534904287554687311595628638823537875937519577818577805321712268066130019278766111959092164201989380952572010654858632789`,pr={precision:20,rounding:4,modulo:1,toExpNeg:-7,toExpPos:21,minE:-cr,maxE:cr,crypto:!1},mr,hr,I=!0,gr=`[DecimalError] `,_r=gr+`Invalid argument: `,vr=gr+`Precision limit exceeded`,yr=gr+`crypto unavailable`,br=`[object Decimal]`,L=Math.floor,R=Math.pow,xr=/^0b([01]+(\.[01]*)?|\.[01]+)(p[+-]?\d+)?$/i,Sr=/^0x([0-9a-f]+(\.[0-9a-f]*)?|\.[0-9a-f]+)(p[+-]?\d+)?$/i,Cr=/^0o([0-7]+(\.[0-7]*)?|\.[0-7]+)(p[+-]?\d+)?$/i,wr=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,z=1e7,B=7,Tr=9007199254740991,Er=dr.length-1,Dr=fr.length-1,V={toStringTag:br};V.absoluteValue=V.abs=function(){var e=new this.constructor(this);return e.s<0&&(e.s=1),G(e)},V.ceil=function(){return G(new this.constructor(this),this.e+1,2)},V.clampedTo=V.clamp=function(e,t){var n,r=this,i=r.constructor;if(e=new i(e),t=new i(t),!e.s||!t.s)return new i(NaN);if(e.gt(t))throw Error(_r+t);return n=r.cmp(e),n<0?e:r.cmp(t)>0?t:new i(r)},V.comparedTo=V.cmp=function(e){var t,n,r,i,a=this,o=a.d,s=(e=new a.constructor(e)).d,c=a.s,l=e.s;if(!o||!s)return!c||!l?NaN:c===l?o===s?0:!o^c<0?1:-1:c;if(!o[0]||!s[0])return o[0]?c:s[0]?-l:0;if(c!==l)return c;if(a.e!==e.e)return a.e>e.e^c<0?1:-1;for(r=o.length,i=s.length,t=0,n=r<i?r:i;t<n;++t)if(o[t]!==s[t])return o[t]>s[t]^c<0?1:-1;return r===i?0:r>i^c<0?1:-1},V.cosine=V.cos=function(){var e,t,n=this,r=n.constructor;return n.d?n.d[0]?(e=r.precision,t=r.rounding,r.precision=e+Math.max(n.e,n.sd())+B,r.rounding=1,n=Ar(r,Kr(r,n)),r.precision=e,r.rounding=t,G(hr==2||hr==3?n.neg():n,e,t,!0)):new r(1):new r(NaN)},V.cubeRoot=V.cbrt=function(){var e,t,n,r,i,a,o,s,c,l,u=this,d=u.constructor;if(!u.isFinite()||u.isZero())return new d(u);for(I=!1,a=u.s*R(u.s*u,1/3),!a||Math.abs(a)==1/0?(n=H(u.d),e=u.e,(a=(e-n.length+1)%3)&&(n+=a==1||a==-2?`0`:`00`),a=R(n,1/3),e=L((e+1)/3)-(e%3==(e<0?-1:2)),a==1/0?n=`5e`+e:(n=a.toExponential(),n=n.slice(0,n.indexOf(`e`)+1)+e),r=new d(n),r.s=u.s):r=new d(a.toString()),o=(e=d.precision)+3;;)if(s=r,c=s.times(s).times(s),l=c.plus(u),r=W(l.plus(u).times(s),l.plus(c),o+2,1),H(s.d).slice(0,o)===(n=H(r.d)).slice(0,o))if(n=n.slice(o-3,o+1),n==`9999`||!i&&n==`4999`){if(!i&&(G(s,e+1,0),s.times(s).times(s).eq(u))){r=s;break}o+=4,i=1}else{(!+n||!+n.slice(1)&&n.charAt(0)==`5`)&&(G(r,e+1,1),t=!r.times(r).times(r).eq(u));break}return I=!0,G(r,e,d.rounding,t)},V.decimalPlaces=V.dp=function(){var e,t=this.d,n=NaN;if(t){if(e=t.length-1,n=(e-L(this.e/B))*B,e=t[e],e)for(;e%10==0;e/=10)n--;n<0&&(n=0)}return n},V.dividedBy=V.div=function(e){return W(this,new this.constructor(e))},V.dividedToIntegerBy=V.divToInt=function(e){var t=this,n=t.constructor;return G(W(t,new n(e),0,1,1),n.precision,n.rounding)},V.equals=V.eq=function(e){return this.cmp(e)===0},V.floor=function(){return G(new this.constructor(this),this.e+1,3)},V.greaterThan=V.gt=function(e){return this.cmp(e)>0},V.greaterThanOrEqualTo=V.gte=function(e){var t=this.cmp(e);return t==1||t===0},V.hyperbolicCosine=V.cosh=function(){var e,t,n,r,i,a=this,o=a.constructor,s=new o(1);if(!a.isFinite())return new o(a.s?1/0:NaN);if(a.isZero())return s;n=o.precision,r=o.rounding,o.precision=n+Math.max(a.e,a.sd())+4,o.rounding=1,i=a.d.length,i<32?(e=Math.ceil(i/3),t=(1/Gr(4,e)).toString()):(e=16,t=`2.3283064365386962890625e-10`),a=Wr(o,1,a.times(t),new o(1),!0);for(var c,l=e,u=new o(8);l--;)c=a.times(a),a=s.minus(c.times(u.minus(c.times(u))));return G(a,o.precision=n,o.rounding=r,!0)},V.hyperbolicSine=V.sinh=function(){var e,t,n,r,i=this,a=i.constructor;if(!i.isFinite()||i.isZero())return new a(i);if(t=a.precision,n=a.rounding,a.precision=t+Math.max(i.e,i.sd())+4,a.rounding=1,r=i.d.length,r<3)i=Wr(a,2,i,i,!0);else{e=1.4*Math.sqrt(r),e=e>16?16:e|0,i=i.times(1/Gr(5,e)),i=Wr(a,2,i,i,!0);for(var o,s=new a(5),c=new a(16),l=new a(20);e--;)o=i.times(i),i=i.times(s.plus(o.times(c.times(o).plus(l))))}return a.precision=t,a.rounding=n,G(i,t,n,!0)},V.hyperbolicTangent=V.tanh=function(){var e,t,n=this,r=n.constructor;return n.isFinite()?n.isZero()?new r(n):(e=r.precision,t=r.rounding,r.precision=e+7,r.rounding=1,W(n.sinh(),n.cosh(),r.precision=e,r.rounding=t)):new r(n.s)},V.inverseCosine=V.acos=function(){var e=this,t=e.constructor,n=e.abs().cmp(1),r=t.precision,i=t.rounding;return n===-1?e.isZero()?q(t,r+4,i).times(.5):(t.precision=r+6,t.rounding=1,e=new t(1).minus(e).div(e.plus(1)).sqrt().atan(),t.precision=r,t.rounding=i,e.times(2)):n===0?e.isNeg()?q(t,r,i):new t(0):new t(NaN)},V.inverseHyperbolicCosine=V.acosh=function(){var e,t,n=this,r=n.constructor;return n.lte(1)?new r(n.eq(1)?0:NaN):n.isFinite()?(e=r.precision,t=r.rounding,r.precision=e+Math.max(Math.abs(n.e),n.sd())+4,r.rounding=1,I=!1,n=n.times(n).minus(1).sqrt().plus(n),I=!0,r.precision=e,r.rounding=t,n.ln()):new r(n)},V.inverseHyperbolicSine=V.asinh=function(){var e,t,n=this,r=n.constructor;return!n.isFinite()||n.isZero()?new r(n):(e=r.precision,t=r.rounding,r.precision=e+2*Math.max(Math.abs(n.e),n.sd())+6,r.rounding=1,I=!1,n=n.times(n).plus(1).sqrt().plus(n),I=!0,r.precision=e,r.rounding=t,n.ln())},V.inverseHyperbolicTangent=V.atanh=function(){var e,t,n,r,i=this,a=i.constructor;return i.isFinite()?i.e>=0?new a(i.abs().eq(1)?i.s/0:i.isZero()?i:NaN):(e=a.precision,t=a.rounding,r=i.sd(),Math.max(r,e)<2*-i.e-1?G(new a(i),e,t,!0):(a.precision=n=r-i.e,i=W(i.plus(1),new a(1).minus(i),n+e,1),a.precision=e+4,a.rounding=1,i=i.ln(),a.precision=e,a.rounding=t,i.times(.5))):new a(NaN)},V.inverseSine=V.asin=function(){var e,t,n,r,i=this,a=i.constructor;return i.isZero()?new a(i):(t=i.abs().cmp(1),n=a.precision,r=a.rounding,t===-1?(a.precision=n+6,a.rounding=1,i=i.div(new a(1).minus(i.times(i)).sqrt().plus(1)).atan(),a.precision=n,a.rounding=r,i.times(2)):t===0?(e=q(a,n+4,r).times(.5),e.s=i.s,e):new a(NaN))},V.inverseTangent=V.atan=function(){var e,t,n,r,i,a,o,s,c,l=this,u=l.constructor,d=u.precision,f=u.rounding;if(l.isFinite()){if(l.isZero())return new u(l);if(l.abs().eq(1)&&d+4<=Dr)return o=q(u,d+4,f).times(.25),o.s=l.s,o}else{if(!l.s)return new u(NaN);if(d+4<=Dr)return o=q(u,d+4,f).times(.5),o.s=l.s,o}for(u.precision=s=d+10,u.rounding=1,n=Math.min(28,s/B+2|0),e=n;e;--e)l=l.div(l.times(l).plus(1).sqrt().plus(1));for(I=!1,t=Math.ceil(s/B),r=1,c=l.times(l),o=new u(l),i=l;e!==-1;)if(i=i.times(c),a=o.minus(i.div(r+=2)),i=i.times(c),o=a.plus(i.div(r+=2)),o.d[t]!==void 0)for(e=t;o.d[e]===a.d[e]&&e--;);return n&&(o=o.times(2<<n-1)),I=!0,G(o,u.precision=d,u.rounding=f,!0)},V.isFinite=function(){return!!this.d},V.isInteger=V.isInt=function(){return!!this.d&&L(this.e/B)>this.d.length-2},V.isNaN=function(){return!this.s},V.isNegative=V.isNeg=function(){return this.s<0},V.isPositive=V.isPos=function(){return this.s>0},V.isZero=function(){return!!this.d&&this.d[0]===0},V.lessThan=V.lt=function(e){return this.cmp(e)<0},V.lessThanOrEqualTo=V.lte=function(e){return this.cmp(e)<1},V.logarithm=V.log=function(e){var t,n,r,i,a,o,s,c,l=this,u=l.constructor,d=u.precision,f=u.rounding,p=5;if(e==null)e=new u(10),t=!0;else{if(e=new u(e),n=e.d,e.s<0||!n||!n[0]||e.eq(1))return new u(NaN);t=e.eq(10)}if(n=l.d,l.s<0||!n||!n[0]||l.eq(1))return new u(n&&!n[0]?-1/0:l.s==1?n?0:1/0:NaN);if(t)if(n.length>1)a=!0;else{for(i=n[0];i%10==0;)i/=10;a=i!==1}if(I=!1,s=d+p,o=zr(l,s),r=t?Mr(u,s+10):zr(e,s),c=W(o,r,s,1),Or(c.d,i=d,f))do if(s+=10,o=zr(l,s),r=t?Mr(u,s+10):zr(e,s),c=W(o,r,s,1),!a){+H(c.d).slice(i+1,i+15)+1==0x5af3107a4000&&(c=G(c,d+1,0));break}while(Or(c.d,i+=10,f));return I=!0,G(c,d,f)},V.minus=V.sub=function(e){var t,n,r,i,a,o,s,c,l,u,d,f,p=this,m=p.constructor;if(e=new m(e),!p.d||!e.d)return!p.s||!e.s?e=new m(NaN):p.d?e.s=-e.s:e=new m(e.d||p.s!==e.s?p:NaN),e;if(p.s!=e.s)return e.s=-e.s,p.plus(e);if(l=p.d,f=e.d,s=m.precision,c=m.rounding,!l[0]||!f[0]){if(f[0])e.s=-e.s;else if(l[0])e=new m(p);else return new m(c===3?-0:0);return I?G(e,s,c):e}if(n=L(e.e/B),u=L(p.e/B),l=l.slice(),a=u-n,a){for(d=a<0,d?(t=l,a=-a,o=f.length):(t=f,n=u,o=l.length),r=Math.max(Math.ceil(s/B),o)+2,a>r&&(a=r,t.length=1),t.reverse(),r=a;r--;)t.push(0);t.reverse()}else{for(r=l.length,o=f.length,d=r<o,d&&(o=r),r=0;r<o;r++)if(l[r]!=f[r]){d=l[r]<f[r];break}a=0}for(d&&(t=l,l=f,f=t,e.s=-e.s),o=l.length,r=f.length-o;r>0;--r)l[o++]=0;for(r=f.length;r>a;){if(l[--r]<f[r]){for(i=r;i&&l[--i]===0;)l[i]=z-1;--l[i],l[r]+=z}l[r]-=f[r]}for(;l[--o]===0;)l.pop();for(;l[0]===0;l.shift())--n;return l[0]?(e.d=l,e.e=jr(l,n),I?G(e,s,c):e):new m(c===3?-0:0)},V.modulo=V.mod=function(e){var t,n=this,r=n.constructor;return e=new r(e),!n.d||!e.s||e.d&&!e.d[0]?new r(NaN):!e.d||n.d&&!n.d[0]?G(new r(n),r.precision,r.rounding):(I=!1,r.modulo==9?(t=W(n,e.abs(),0,3,1),t.s*=e.s):t=W(n,e,0,r.modulo,1),t=t.times(e),I=!0,n.minus(t))},V.naturalExponential=V.exp=function(){return Rr(this)},V.naturalLogarithm=V.ln=function(){return zr(this)},V.negated=V.neg=function(){var e=new this.constructor(this);return e.s=-e.s,G(e)},V.plus=V.add=function(e){var t,n,r,i,a,o,s,c,l,u,d=this,f=d.constructor;if(e=new f(e),!d.d||!e.d)return!d.s||!e.s?e=new f(NaN):d.d||(e=new f(e.d||d.s===e.s?d:NaN)),e;if(d.s!=e.s)return e.s=-e.s,d.minus(e);if(l=d.d,u=e.d,s=f.precision,c=f.rounding,!l[0]||!u[0])return u[0]||(e=new f(d)),I?G(e,s,c):e;if(a=L(d.e/B),r=L(e.e/B),l=l.slice(),i=a-r,i){for(i<0?(n=l,i=-i,o=u.length):(n=u,r=a,o=l.length),a=Math.ceil(s/B),o=a>o?a+1:o+1,i>o&&(i=o,n.length=1),n.reverse();i--;)n.push(0);n.reverse()}for(o=l.length,i=u.length,o-i<0&&(i=o,n=u,u=l,l=n),t=0;i;)t=(l[--i]=l[i]+u[i]+t)/z|0,l[i]%=z;for(t&&(l.unshift(t),++r),o=l.length;l[--o]==0;)l.pop();return e.d=l,e.e=jr(l,r),I?G(e,s,c):e},V.precision=V.sd=function(e){var t,n=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(_r+e);return n.d?(t=Nr(n.d),e&&n.e+1>t&&(t=n.e+1)):t=NaN,t},V.round=function(){var e=this,t=e.constructor;return G(new t(e),e.e+1,t.rounding)},V.sine=V.sin=function(){var e,t,n=this,r=n.constructor;return n.isFinite()?n.isZero()?new r(n):(e=r.precision,t=r.rounding,r.precision=e+Math.max(n.e,n.sd())+B,r.rounding=1,n=Ur(r,Kr(r,n)),r.precision=e,r.rounding=t,G(hr>2?n.neg():n,e,t,!0)):new r(NaN)},V.squareRoot=V.sqrt=function(){var e,t,n,r,i,a,o=this,s=o.d,c=o.e,l=o.s,u=o.constructor;if(l!==1||!s||!s[0])return new u(!l||l<0&&(!s||s[0])?NaN:s?o:1/0);for(I=!1,l=Math.sqrt(+o),l==0||l==1/0?(t=H(s),(t.length+c)%2==0&&(t+=`0`),l=Math.sqrt(t),c=L((c+1)/2)-(c<0||c%2),l==1/0?t=`5e`+c:(t=l.toExponential(),t=t.slice(0,t.indexOf(`e`)+1)+c),r=new u(t)):r=new u(l.toString()),n=(c=u.precision)+3;;)if(a=r,r=a.plus(W(o,a,n+2,1)).times(.5),H(a.d).slice(0,n)===(t=H(r.d)).slice(0,n))if(t=t.slice(n-3,n+1),t==`9999`||!i&&t==`4999`){if(!i&&(G(a,c+1,0),a.times(a).eq(o))){r=a;break}n+=4,i=1}else{(!+t||!+t.slice(1)&&t.charAt(0)==`5`)&&(G(r,c+1,1),e=!r.times(r).eq(o));break}return I=!0,G(r,c,u.rounding,e)},V.tangent=V.tan=function(){var e,t,n=this,r=n.constructor;return n.isFinite()?n.isZero()?new r(n):(e=r.precision,t=r.rounding,r.precision=e+10,r.rounding=1,n=n.sin(),n.s=1,n=W(n,new r(1).minus(n.times(n)).sqrt(),e+10,0),r.precision=e,r.rounding=t,G(hr==2||hr==4?n.neg():n,e,t,!0)):new r(NaN)},V.times=V.mul=function(e){var t,n,r,i,a,o,s,c,l,u=this,d=u.constructor,f=u.d,p=(e=new d(e)).d;if(e.s*=u.s,!f||!f[0]||!p||!p[0])return new d(!e.s||f&&!f[0]&&!p||p&&!p[0]&&!f?NaN:!f||!p?e.s/0:e.s*0);for(n=L(u.e/B)+L(e.e/B),c=f.length,l=p.length,c<l&&(a=f,f=p,p=a,o=c,c=l,l=o),a=[],o=c+l,r=o;r--;)a.push(0);for(r=l;--r>=0;){for(t=0,i=c+r;i>r;)s=a[i]+p[r]*f[i-r-1]+t,a[i--]=s%z|0,t=s/z|0;a[i]=(a[i]+t)%z|0}for(;!a[--o];)a.pop();return t?++n:a.shift(),e.d=a,e.e=jr(a,n),I?G(e,d.precision,d.rounding):e},V.toBinary=function(e,t){return qr(this,2,e,t)},V.toDecimalPlaces=V.toDP=function(e,t){var n=this,r=n.constructor;return n=new r(n),e===void 0?n:(U(e,0,lr),t===void 0?t=r.rounding:U(t,0,8),G(n,e+n.e+1,t))},V.toExponential=function(e,t){var n,r=this,i=r.constructor;return e===void 0?n=K(r,!0):(U(e,0,lr),t===void 0?t=i.rounding:U(t,0,8),r=G(new i(r),e+1,t),n=K(r,!0,e+1)),r.isNeg()&&!r.isZero()?`-`+n:n},V.toFixed=function(e,t){var n,r,i=this,a=i.constructor;return e===void 0?n=K(i):(U(e,0,lr),t===void 0?t=a.rounding:U(t,0,8),r=G(new a(i),e+i.e+1,t),n=K(r,!1,e+r.e+1)),i.isNeg()&&!i.isZero()?`-`+n:n},V.toFraction=function(e){var t,n,r,i,a,o,s,c,l,u,d,f,p=this,m=p.d,h=p.constructor;if(!m)return new h(p);if(l=n=new h(1),r=c=new h(0),t=new h(r),a=t.e=Nr(m)-p.e-1,o=a%B,t.d[0]=R(10,o<0?B+o:o),e==null)e=a>0?t:l;else{if(s=new h(e),!s.isInt()||s.lt(l))throw Error(_r+s);e=s.gt(t)?a>0?t:l:s}for(I=!1,s=new h(H(m)),u=h.precision,h.precision=a=m.length*B*2;d=W(s,t,0,1,1),i=n.plus(d.times(r)),i.cmp(e)!=1;)n=r,r=i,i=l,l=c.plus(d.times(i)),c=i,i=t,t=s.minus(d.times(i)),s=i;return i=W(e.minus(n),r,0,1,1),c=c.plus(i.times(l)),n=n.plus(i.times(r)),c.s=l.s=p.s,f=W(l,r,a,1).minus(p).abs().cmp(W(c,n,a,1).minus(p).abs())<1?[l,r]:[c,n],h.precision=u,I=!0,f},V.toHexadecimal=V.toHex=function(e,t){return qr(this,16,e,t)},V.toNearest=function(e,t){var n=this,r=n.constructor;if(n=new r(n),e==null){if(!n.d)return n;e=new r(1),t=r.rounding}else{if(e=new r(e),t===void 0?t=r.rounding:U(t,0,8),!n.d)return e.s?n:e;if(!e.d)return e.s&&=n.s,e}return e.d[0]?(I=!1,n=W(n,e,0,t,1).times(e),I=!0,G(n)):(e.s=n.s,n=e),n},V.toNumber=function(){return+this},V.toOctal=function(e,t){return qr(this,8,e,t)},V.toPower=V.pow=function(e){var t,n,r,i,a,o,s=this,c=s.constructor,l=+(e=new c(e));if(!s.d||!e.d||!s.d[0]||!e.d[0])return new c(R(+s,l));if(s=new c(s),s.eq(1))return s;if(r=c.precision,a=c.rounding,e.eq(1))return G(s,r,a);if(t=L(e.e/B),t>=e.d.length-1&&(n=l<0?-l:l)<=Tr)return i=Fr(c,s,n,r),e.s<0?new c(1).div(i):G(i,r,a);if(o=s.s,o<0){if(t<e.d.length-1)return new c(NaN);if(e.d[t]&1||(o=1),s.e==0&&s.d[0]==1&&s.d.length==1)return s.s=o,s}return n=R(+s,l),t=n==0||!isFinite(n)?L(l*(Math.log(`0.`+H(s.d))/Math.LN10+s.e+1)):new c(n+``).e,t>c.maxE+1||t<c.minE-1?new c(t>0?o/0:0):(I=!1,c.rounding=s.s=1,n=Math.min(12,(t+``).length),i=Rr(e.times(zr(s,r+n)),r),i.d&&(i=G(i,r+5,1),Or(i.d,r,a)&&(t=r+10,i=G(Rr(e.times(zr(s,t+n)),t),t+5,1),+H(i.d).slice(r+1,r+15)+1==0x5af3107a4000&&(i=G(i,r+1,0)))),i.s=o,I=!0,c.rounding=a,G(i,r,a))},V.toPrecision=function(e,t){var n,r=this,i=r.constructor;return e===void 0?n=K(r,r.e<=i.toExpNeg||r.e>=i.toExpPos):(U(e,1,lr),t===void 0?t=i.rounding:U(t,0,8),r=G(new i(r),e,t),n=K(r,e<=r.e||r.e<=i.toExpNeg,e)),r.isNeg()&&!r.isZero()?`-`+n:n},V.toSignificantDigits=V.toSD=function(e,t){var n=this,r=n.constructor;return e===void 0?(e=r.precision,t=r.rounding):(U(e,1,lr),t===void 0?t=r.rounding:U(t,0,8)),G(new r(n),e,t)},V.toString=function(){var e=this,t=e.constructor,n=K(e,e.e<=t.toExpNeg||e.e>=t.toExpPos);return e.isNeg()&&!e.isZero()?`-`+n:n},V.truncated=V.trunc=function(){return G(new this.constructor(this),this.e+1,1)},V.valueOf=V.toJSON=function(){var e=this,t=e.constructor,n=K(e,e.e<=t.toExpNeg||e.e>=t.toExpPos);return e.isNeg()?`-`+n:n};function H(e){var t,n,r,i=e.length-1,a=``,o=e[0];if(i>0){for(a+=o,t=1;t<i;t++)r=e[t]+``,n=B-r.length,n&&(a+=Pr(n)),a+=r;o=e[t],r=o+``,n=B-r.length,n&&(a+=Pr(n))}else if(o===0)return`0`;for(;o%10==0;)o/=10;return a+o}function U(e,t,n){if(e!==~~e||e<t||e>n)throw Error(_r+e)}function Or(e,t,n,r){var i,a,o,s;for(a=e[0];a>=10;a/=10)--t;return--t<0?(t+=B,i=0):(i=Math.ceil((t+1)/B),t%=B),a=R(10,B-t),s=e[i]%a|0,r==null?t<3?(t==0?s=s/100|0:t==1&&(s=s/10|0),o=n<4&&s==99999||n>3&&s==49999||s==5e4||s==0):o=(n<4&&s+1==a||n>3&&s+1==a/2)&&(e[i+1]/a/100|0)==R(10,t-2)-1||(s==a/2||s==0)&&(e[i+1]/a/100|0)==0:t<4?(t==0?s=s/1e3|0:t==1?s=s/100|0:t==2&&(s=s/10|0),o=(r||n<4)&&s==9999||!r&&n>3&&s==4999):o=((r||n<4)&&s+1==a||!r&&n>3&&s+1==a/2)&&(e[i+1]/a/1e3|0)==R(10,t-3)-1,o}function kr(e,t,n){for(var r,i=[0],a,o=0,s=e.length;o<s;){for(a=i.length;a--;)i[a]*=t;for(i[0]+=ur.indexOf(e.charAt(o++)),r=0;r<i.length;r++)i[r]>n-1&&(i[r+1]===void 0&&(i[r+1]=0),i[r+1]+=i[r]/n|0,i[r]%=n)}return i.reverse()}function Ar(e,t){var n,r,i;if(t.isZero())return t;r=t.d.length,r<32?(n=Math.ceil(r/3),i=(1/Gr(4,n)).toString()):(n=16,i=`2.3283064365386962890625e-10`),e.precision+=n,t=Wr(e,1,t.times(i),new e(1));for(var a=n;a--;){var o=t.times(t);t=o.times(o).minus(o).times(8).plus(1)}return e.precision-=n,t}var W=(function(){function e(e,t,n){var r,i=0,a=e.length;for(e=e.slice();a--;)r=e[a]*t+i,e[a]=r%n|0,i=r/n|0;return i&&e.unshift(i),e}function t(e,t,n,r){var i,a;if(n!=r)a=n>r?1:-1;else for(i=a=0;i<n;i++)if(e[i]!=t[i]){a=e[i]>t[i]?1:-1;break}return a}function n(e,t,n,r){for(var i=0;n--;)e[n]-=i,i=e[n]<t[n]?1:0,e[n]=i*r+e[n]-t[n];for(;!e[0]&&e.length>1;)e.shift()}return function(r,i,a,o,s,c){var l,u,d,f,p,m,h,g,_,v,y,b,x,S,C,ee,w,T,E,te,ne=r.constructor,D=r.s==i.s?1:-1,O=r.d,k=i.d;if(!O||!O[0]||!k||!k[0])return new ne(!r.s||!i.s||(O?k&&O[0]==k[0]:!k)?NaN:O&&O[0]==0||!k?D*0:D/0);for(c?(p=1,u=r.e-i.e):(c=z,p=B,u=L(r.e/p)-L(i.e/p)),E=k.length,w=O.length,_=new ne(D),v=_.d=[],d=0;k[d]==(O[d]||0);d++);if(k[d]>(O[d]||0)&&u--,a==null?(S=a=ne.precision,o=ne.rounding):S=s?a+(r.e-i.e)+1:a,S<0)v.push(1),m=!0;else{if(S=S/p+2|0,d=0,E==1){for(f=0,k=k[0],S++;(d<w||f)&&S--;d++)C=f*c+(O[d]||0),v[d]=C/k|0,f=C%k|0;m=f||d<w}else{for(f=c/(k[0]+1)|0,f>1&&(k=e(k,f,c),O=e(O,f,c),E=k.length,w=O.length),ee=E,y=O.slice(0,E),b=y.length;b<E;)y[b++]=0;te=k.slice(),te.unshift(0),T=k[0],k[1]>=c/2&&++T;do f=0,l=t(k,y,E,b),l<0?(x=y[0],E!=b&&(x=x*c+(y[1]||0)),f=x/T|0,f>1?(f>=c&&(f=c-1),h=e(k,f,c),g=h.length,b=y.length,l=t(h,y,g,b),l==1&&(f--,n(h,E<g?te:k,g,c))):(f==0&&(l=f=1),h=k.slice()),g=h.length,g<b&&h.unshift(0),n(y,h,b,c),l==-1&&(b=y.length,l=t(k,y,E,b),l<1&&(f++,n(y,E<b?te:k,b,c))),b=y.length):l===0&&(f++,y=[0]),v[d++]=f,l&&y[0]?y[b++]=O[ee]||0:(y=[O[ee]],b=1);while((ee++<w||y[0]!==void 0)&&S--);m=y[0]!==void 0}v[0]||v.shift()}if(p==1)_.e=u,mr=m;else{for(d=1,f=v[0];f>=10;f/=10)d++;_.e=d+u*p-1,G(_,s?a+_.e+1:a,o,m)}return _}})();function G(e,t,n,r){var i,a,o,s,c,l,u,d,f,p=e.constructor;out:if(t!=null){if(d=e.d,!d)return e;for(i=1,s=d[0];s>=10;s/=10)i++;if(a=t-i,a<0)a+=B,o=t,u=d[f=0],c=u/R(10,i-o-1)%10|0;else if(f=Math.ceil((a+1)/B),s=d.length,f>=s)if(r){for(;s++<=f;)d.push(0);u=c=0,i=1,a%=B,o=a-B+1}else break out;else{for(u=s=d[f],i=1;s>=10;s/=10)i++;a%=B,o=a-B+i,c=o<0?0:u/R(10,i-o-1)%10|0}if(r=r||t<0||d[f+1]!==void 0||(o<0?u:u%R(10,i-o-1)),l=n<4?(c||r)&&(n==0||n==(e.s<0?3:2)):c>5||c==5&&(n==4||r||n==6&&(a>0?o>0?u/R(10,i-o):0:d[f-1])%10&1||n==(e.s<0?8:7)),t<1||!d[0])return d.length=0,l?(t-=e.e+1,d[0]=R(10,(B-t%B)%B),e.e=-t||0):d[0]=e.e=0,e;if(a==0?(d.length=f,s=1,f--):(d.length=f+1,s=R(10,B-a),d[f]=o>0?(u/R(10,i-o)%R(10,o)|0)*s:0),l)for(;;)if(f==0){for(a=1,o=d[0];o>=10;o/=10)a++;for(o=d[0]+=s,s=1;o>=10;o/=10)s++;a!=s&&(e.e++,d[0]==z&&(d[0]=1));break}else{if(d[f]+=s,d[f]!=z)break;d[f--]=0,s=1}for(a=d.length;d[--a]===0;)d.pop()}return I&&(e.e>p.maxE?(e.d=null,e.e=NaN):e.e<p.minE&&(e.e=0,e.d=[0])),e}function K(e,t,n){if(!e.isFinite())return Br(e);var r,i=e.e,a=H(e.d),o=a.length;return t?(n&&(r=n-o)>0?a=a.charAt(0)+`.`+a.slice(1)+Pr(r):o>1&&(a=a.charAt(0)+`.`+a.slice(1)),a=a+(e.e<0?`e`:`e+`)+e.e):i<0?(a=`0.`+Pr(-i-1)+a,n&&(r=n-o)>0&&(a+=Pr(r))):i>=o?(a+=Pr(i+1-o),n&&(r=n-i-1)>0&&(a=a+`.`+Pr(r))):((r=i+1)<o&&(a=a.slice(0,r)+`.`+a.slice(r)),n&&(r=n-o)>0&&(i+1===o&&(a+=`.`),a+=Pr(r))),a}function jr(e,t){var n=e[0];for(t*=B;n>=10;n/=10)t++;return t}function Mr(e,t,n){if(t>Er)throw I=!0,n&&(e.precision=n),Error(vr);return G(new e(dr),t,1,!0)}function q(e,t,n){if(t>Dr)throw Error(vr);return G(new e(fr),t,n,!0)}function Nr(e){var t=e.length-1,n=t*B+1;if(t=e[t],t){for(;t%10==0;t/=10)n--;for(t=e[0];t>=10;t/=10)n++}return n}function Pr(e){for(var t=``;e--;)t+=`0`;return t}function Fr(e,t,n,r){var i,a=new e(1),o=Math.ceil(r/B+4);for(I=!1;;){if(n%2&&(a=a.times(t),Jr(a.d,o)&&(i=!0)),n=L(n/2),n===0){n=a.d.length-1,i&&a.d[n]===0&&++a.d[n];break}t=t.times(t),Jr(t.d,o)}return I=!0,a}function Ir(e){return e.d[e.d.length-1]&1}function Lr(e,t,n){for(var r,i,a=new e(t[0]),o=0;++o<t.length;){if(i=new e(t[o]),!i.s){a=i;break}r=a.cmp(i),(r===n||r===0&&a.s===n)&&(a=i)}return a}function Rr(e,t){var n,r,i,a,o,s,c,l=0,u=0,d=0,f=e.constructor,p=f.rounding,m=f.precision;if(!e.d||!e.d[0]||e.e>17)return new f(e.d?e.d[0]?e.s<0?0:1/0:1:e.s?e.s<0?0:e:NaN);for(t==null?(I=!1,c=m):c=t,s=new f(.03125);e.e>-2;)e=e.times(s),d+=5;for(r=Math.log(R(2,d))/Math.LN10*2+5|0,c+=r,n=a=o=new f(1),f.precision=c;;){if(a=G(a.times(e),c,1),n=n.times(++u),s=o.plus(W(a,n,c,1)),H(s.d).slice(0,c)===H(o.d).slice(0,c)){for(i=d;i--;)o=G(o.times(o),c,1);if(t==null)if(l<3&&Or(o.d,c-r,p,l))f.precision=c+=10,n=a=s=new f(1),u=0,l++;else return G(o,f.precision=m,p,I=!0);else return f.precision=m,o}o=s}}function zr(e,t){var n,r,i,a,o,s,c,l,u,d,f,p=1,m=10,h=e,g=h.d,_=h.constructor,v=_.rounding,y=_.precision;if(h.s<0||!g||!g[0]||!h.e&&g[0]==1&&g.length==1)return new _(g&&!g[0]?-1/0:h.s==1?g?0:h:NaN);if(t==null?(I=!1,u=y):u=t,_.precision=u+=m,n=H(g),r=n.charAt(0),Math.abs(a=h.e)<0x5543df729c000){for(;r<7&&r!=1||r==1&&n.charAt(1)>3;)h=h.times(e),n=H(h.d),r=n.charAt(0),p++;a=h.e,r>1?(h=new _(`0.`+n),a++):h=new _(r+`.`+n.slice(1))}else return l=Mr(_,u+2,y).times(a+``),h=zr(new _(r+`.`+n.slice(1)),u-m).plus(l),_.precision=y,t==null?G(h,y,v,I=!0):h;for(d=h,c=o=h=W(h.minus(1),h.plus(1),u,1),f=G(h.times(h),u,1),i=3;;){if(o=G(o.times(f),u,1),l=c.plus(W(o,new _(i),u,1)),H(l.d).slice(0,u)===H(c.d).slice(0,u))if(c=c.times(2),a!==0&&(c=c.plus(Mr(_,u+2,y).times(a+``))),c=W(c,new _(p),u,1),t==null)if(Or(c.d,u-m,v,s))_.precision=u+=m,l=o=h=W(d.minus(1),d.plus(1),u,1),f=G(h.times(h),u,1),i=s=1;else return G(c,_.precision=y,v,I=!0);else return _.precision=y,c;c=l,i+=2}}function Br(e){return String(e.s*e.s/0)}function Vr(e,t){var n,r,i;for((n=t.indexOf(`.`))>-1&&(t=t.replace(`.`,``)),(r=t.search(/e/i))>0?(n<0&&(n=r),n+=+t.slice(r+1),t=t.substring(0,r)):n<0&&(n=t.length),r=0;t.charCodeAt(r)===48;r++);for(i=t.length;t.charCodeAt(i-1)===48;--i);if(t=t.slice(r,i),t){if(i-=r,e.e=n=n-r-1,e.d=[],r=(n+1)%B,n<0&&(r+=B),r<i){for(r&&e.d.push(+t.slice(0,r)),i-=B;r<i;)e.d.push(+t.slice(r,r+=B));t=t.slice(r),r=B-t.length}else r-=i;for(;r--;)t+=`0`;e.d.push(+t),I&&(e.e>e.constructor.maxE?(e.d=null,e.e=NaN):e.e<e.constructor.minE&&(e.e=0,e.d=[0]))}else e.e=0,e.d=[0];return e}function Hr(e,t){var n,r,i,a,o,s,c,l,u;if(t.indexOf(`_`)>-1){if(t=t.replace(/(\d)_(?=\d)/g,`$1`),wr.test(t))return Vr(e,t)}else if(t===`Infinity`||t===`NaN`)return+t||(e.s=NaN),e.e=NaN,e.d=null,e;if(Sr.test(t))n=16,t=t.toLowerCase();else if(xr.test(t))n=2;else if(Cr.test(t))n=8;else throw Error(_r+t);for(a=t.search(/p/i),a>0?(c=+t.slice(a+1),t=t.substring(2,a)):t=t.slice(2),a=t.indexOf(`.`),o=a>=0,r=e.constructor,o&&(t=t.replace(`.`,``),s=t.length,a=s-a,i=Fr(r,new r(n),a,a*2)),l=kr(t,n,z),u=l.length-1,a=u;l[a]===0;--a)l.pop();return a<0?new r(e.s*0):(e.e=jr(l,u),e.d=l,I=!1,o&&(e=W(e,i,s*4)),c&&(e=e.times(Math.abs(c)<54?R(2,c):Ii.pow(2,c))),I=!0,e)}function Ur(e,t){var n,r=t.d.length;if(r<3)return t.isZero()?t:Wr(e,2,t,t);n=1.4*Math.sqrt(r),n=n>16?16:n|0,t=t.times(1/Gr(5,n)),t=Wr(e,2,t,t);for(var i,a=new e(5),o=new e(16),s=new e(20);n--;)i=t.times(t),t=t.times(a.plus(i.times(o.times(i).minus(s))));return t}function Wr(e,t,n,r,i){var a,o,s,c,l=1,u=e.precision,d=Math.ceil(u/B);for(I=!1,c=n.times(n),s=new e(r);;){if(o=W(s.times(c),new e(t++*t++),u,1),s=i?r.plus(o):r.minus(o),r=W(o.times(c),new e(t++*t++),u,1),o=s.plus(r),o.d[d]!==void 0){for(a=d;o.d[a]===s.d[a]&&a--;);if(a==-1)break}a=s,s=r,r=o,o=a,l++}return I=!0,o.d.length=d+1,o}function Gr(e,t){for(var n=e;--t;)n*=e;return n}function Kr(e,t){var n,r=t.s<0,i=q(e,e.precision,1),a=i.times(.5);if(t=t.abs(),t.lte(a))return hr=r?4:1,t;if(n=t.divToInt(i),n.isZero())hr=r?3:2;else{if(t=t.minus(n.times(i)),t.lte(a))return hr=Ir(n)?r?2:3:r?4:1,t;hr=Ir(n)?r?1:4:r?3:2}return t.minus(i).abs()}function qr(e,t,n,r){var i,a,o,s,c,l,u,d,f,p=e.constructor,m=n!==void 0;if(m?(U(n,1,lr),r===void 0?r=p.rounding:U(r,0,8)):(n=p.precision,r=p.rounding),!e.isFinite())u=Br(e);else{for(u=K(e),o=u.indexOf(`.`),m?(i=2,t==16?n=n*4-3:t==8&&(n=n*3-2)):i=t,o>=0&&(u=u.replace(`.`,``),f=new p(1),f.e=u.length-o,f.d=kr(K(f),10,i),f.e=f.d.length),d=kr(u,10,i),a=c=d.length;d[--c]==0;)d.pop();if(!d[0])u=m?`0p+0`:`0`;else{if(o<0?a--:(e=new p(e),e.d=d,e.e=a,e=W(e,f,n,r,0,i),d=e.d,a=e.e,l=mr),o=d[n],s=i/2,l||=d[n+1]!==void 0,l=r<4?(o!==void 0||l)&&(r===0||r===(e.s<0?3:2)):o>s||o===s&&(r===4||l||r===6&&d[n-1]&1||r===(e.s<0?8:7)),d.length=n,l)for(;++d[--n]>i-1;)d[n]=0,n||(++a,d.unshift(1));for(c=d.length;!d[c-1];--c);for(o=0,u=``;o<c;o++)u+=ur.charAt(d[o]);if(m){if(c>1)if(t==16||t==8){for(o=t==16?4:3,--c;c%o;c++)u+=`0`;for(d=kr(u,i,t),c=d.length;!d[c-1];--c);for(o=1,u=`1.`;o<c;o++)u+=ur.charAt(d[o])}else u=u.charAt(0)+`.`+u.slice(1);u=u+(a<0?`p`:`p+`)+a}else if(a<0){for(;++a;)u=`0`+u;u=`0.`+u}else if(++a>c)for(a-=c;a--;)u+=`0`;else a<c&&(u=u.slice(0,a)+`.`+u.slice(a))}u=(t==16?`0x`:t==2?`0b`:t==8?`0o`:``)+u}return e.s<0?`-`+u:u}function Jr(e,t){if(e.length>t)return e.length=t,!0}function Yr(e){return new this(e).abs()}function Xr(e){return new this(e).acos()}function Zr(e){return new this(e).acosh()}function Qr(e,t){return new this(e).plus(t)}function $r(e){return new this(e).asin()}function ei(e){return new this(e).asinh()}function ti(e){return new this(e).atan()}function ni(e){return new this(e).atanh()}function ri(e,t){e=new this(e),t=new this(t);var n,r=this.precision,i=this.rounding,a=r+4;return!e.s||!t.s?n=new this(NaN):!e.d&&!t.d?(n=q(this,a,1).times(t.s>0?.25:.75),n.s=e.s):!t.d||e.isZero()?(n=t.s<0?q(this,r,i):new this(0),n.s=e.s):!e.d||t.isZero()?(n=q(this,a,1).times(.5),n.s=e.s):t.s<0?(this.precision=a,this.rounding=1,n=this.atan(W(e,t,a,1)),t=q(this,a,1),this.precision=r,this.rounding=i,n=e.s<0?n.minus(t):n.plus(t)):n=this.atan(W(e,t,a,1)),n}function ii(e){return new this(e).cbrt()}function ai(e){return G(e=new this(e),e.e+1,2)}function oi(e,t,n){return new this(e).clamp(t,n)}function si(e){if(!e||typeof e!=`object`)throw Error(gr+`Object expected`);var t,n,r,i=e.defaults===!0,a=[`precision`,1,lr,`rounding`,0,8,`toExpNeg`,-cr,0,`toExpPos`,0,cr,`maxE`,0,cr,`minE`,-cr,0,`modulo`,0,9];for(t=0;t<a.length;t+=3)if(n=a[t],i&&(this[n]=pr[n]),(r=e[n])!==void 0)if(L(r)===r&&r>=a[t+1]&&r<=a[t+2])this[n]=r;else throw Error(_r+n+`: `+r);if(n=`crypto`,i&&(this[n]=pr[n]),(r=e[n])!==void 0)if(r===!0||r===!1||r===0||r===1)if(r)if(typeof crypto<`u`&&crypto&&(crypto.getRandomValues||crypto.randomBytes))this[n]=!0;else throw Error(yr);else this[n]=!1;else throw Error(_r+n+`: `+r);return this}function ci(e){return new this(e).cos()}function li(e){return new this(e).cosh()}function ui(e){var t,n,r;function i(e){var t,n,r,a=this;if(!(a instanceof i))return new i(e);if(a.constructor=i,hi(e)){a.s=e.s,I?!e.d||e.e>i.maxE?(a.e=NaN,a.d=null):e.e<i.minE?(a.e=0,a.d=[0]):(a.e=e.e,a.d=e.d.slice()):(a.e=e.e,a.d=e.d?e.d.slice():e.d);return}if(r=typeof e,r===`number`){if(e===0){a.s=1/e<0?-1:1,a.e=0,a.d=[0];return}if(e<0?(e=-e,a.s=-1):a.s=1,e===~~e&&e<1e7){for(t=0,n=e;n>=10;n/=10)t++;I?t>i.maxE?(a.e=NaN,a.d=null):t<i.minE?(a.e=0,a.d=[0]):(a.e=t,a.d=[e]):(a.e=t,a.d=[e]);return}if(e*0!=0){e||(a.s=NaN),a.e=NaN,a.d=null;return}return Vr(a,e.toString())}if(r===`string`)return(n=e.charCodeAt(0))===45?(e=e.slice(1),a.s=-1):(n===43&&(e=e.slice(1)),a.s=1),wr.test(e)?Vr(a,e):Hr(a,e);if(r===`bigint`)return e<0?(e=-e,a.s=-1):a.s=1,Vr(a,e.toString());throw Error(_r+e)}if(i.prototype=V,i.ROUND_UP=0,i.ROUND_DOWN=1,i.ROUND_CEIL=2,i.ROUND_FLOOR=3,i.ROUND_HALF_UP=4,i.ROUND_HALF_DOWN=5,i.ROUND_HALF_EVEN=6,i.ROUND_HALF_CEIL=7,i.ROUND_HALF_FLOOR=8,i.EUCLID=9,i.config=i.set=si,i.clone=ui,i.isDecimal=hi,i.abs=Yr,i.acos=Xr,i.acosh=Zr,i.add=Qr,i.asin=$r,i.asinh=ei,i.atan=ti,i.atanh=ni,i.atan2=ri,i.cbrt=ii,i.ceil=ai,i.clamp=oi,i.cos=ci,i.cosh=li,i.div=di,i.exp=fi,i.floor=pi,i.hypot=mi,i.ln=gi,i.log=_i,i.log10=yi,i.log2=vi,i.max=bi,i.min=xi,i.mod=Si,i.mul=Ci,i.pow=wi,i.random=Ti,i.round=Ei,i.sign=Di,i.sin=Oi,i.sinh=ki,i.sqrt=Ai,i.sub=ji,i.sum=Mi,i.tan=Ni,i.tanh=Pi,i.trunc=Fi,e===void 0&&(e={}),e&&e.defaults!==!0)for(r=[`precision`,`rounding`,`toExpNeg`,`toExpPos`,`maxE`,`minE`,`modulo`,`crypto`],t=0;t<r.length;)e.hasOwnProperty(n=r[t++])||(e[n]=this[n]);return i.config(e),i}function di(e,t){return new this(e).div(t)}function fi(e){return new this(e).exp()}function pi(e){return G(e=new this(e),e.e+1,3)}function mi(){var e,t,n=new this(0);for(I=!1,e=0;e<arguments.length;)if(t=new this(arguments[e++]),t.d)n.d&&(n=n.plus(t.times(t)));else{if(t.s)return I=!0,new this(1/0);n=t}return I=!0,n.sqrt()}function hi(e){return e instanceof Ii||e&&e.toStringTag===br||!1}function gi(e){return new this(e).ln()}function _i(e,t){return new this(e).log(t)}function vi(e){return new this(e).log(2)}function yi(e){return new this(e).log(10)}function bi(){return Lr(this,arguments,-1)}function xi(){return Lr(this,arguments,1)}function Si(e,t){return new this(e).mod(t)}function Ci(e,t){return new this(e).mul(t)}function wi(e,t){return new this(e).pow(t)}function Ti(e){var t,n,r,i,a=0,o=new this(1),s=[];if(e===void 0?e=this.precision:U(e,1,lr),r=Math.ceil(e/B),this.crypto)if(crypto.getRandomValues)for(t=crypto.getRandomValues(new Uint32Array(r));a<r;)i=t[a],i>=429e7?t[a]=crypto.getRandomValues(new Uint32Array(1))[0]:s[a++]=i%1e7;else if(crypto.randomBytes){for(t=crypto.randomBytes(r*=4);a<r;)i=t[a]+(t[a+1]<<8)+(t[a+2]<<16)+((t[a+3]&127)<<24),i>=214e7?crypto.randomBytes(4).copy(t,a):(s.push(i%1e7),a+=4);a=r/4}else throw Error(yr);else for(;a<r;)s[a++]=Math.random()*1e7|0;for(r=s[--a],e%=B,r&&e&&(i=R(10,B-e),s[a]=(r/i|0)*i);s[a]===0;a--)s.pop();if(a<0)n=0,s=[0];else{for(n=-1;s[0]===0;n-=B)s.shift();for(r=1,i=s[0];i>=10;i/=10)r++;r<B&&(n-=B-r)}return o.e=n,o.d=s,o}function Ei(e){return G(e=new this(e),e.e+1,this.rounding)}function Di(e){return e=new this(e),e.d?e.d[0]?e.s:0*e.s:e.s||NaN}function Oi(e){return new this(e).sin()}function ki(e){return new this(e).sinh()}function Ai(e){return new this(e).sqrt()}function ji(e,t){return new this(e).sub(t)}function Mi(){var e=0,t=arguments,n=new this(t[e]);for(I=!1;n.s&&++e<t.length;)n=n.plus(t[e]);return I=!0,G(n,this.precision,this.rounding)}function Ni(e){return new this(e).tan()}function Pi(e){return new this(e).tanh()}function Fi(e){return G(e=new this(e),e.e+1,1)}V[Symbol.for(`nodejs.util.inspect.custom`)]=V.toString,V[Symbol.toStringTag]=`Decimal`;var Ii=V.constructor=ui(pr);dr=new Ii(dr),fr=new Ii(fr);var Li=Ii,Ri=Vn(`BigNumber`,[`?on`,`config`],e=>{var{on:t,config:n}=e,r=Li.clone({precision:n.precision,modulo:Li.EUCLID});return r.prototype=Object.create(r.prototype),r.prototype.type=`BigNumber`,r.prototype.isBigNumber=!0,r.prototype.toJSON=function(){return{mathjs:`BigNumber`,value:this.toString()}},r.fromJSON=function(e){return new r(e.value)},t&&t(`config`,function(e,t){e.precision!==t.precision&&r.config({precision:e.precision})}),r},{isClass:!0});const J=Math.cosh||function(e){return Math.abs(e)<1e-9?1-e:(Math.exp(e)+Math.exp(-e))*.5},Y=Math.sinh||function(e){return Math.abs(e)<1e-9?e:(Math.exp(e)-Math.exp(-e))*.5},zi=e=>{let t=Math.sin(.5*e);return-2*t*t},Bi=function(e,t){return e=Math.abs(e),t=Math.abs(t),e<t&&([e,t]=[t,e]),e<1e8?Math.sqrt(e*e+t*t):(t/=e,e*Math.sqrt(1+t*t))},Vi=function(){throw SyntaxError(`Invalid Param`)};function Hi(e,t){let n=Math.abs(e),r=Math.abs(t);return e===0?Math.log(r):t===0?Math.log(n):n<3e3&&r<3e3?Math.log(e*e+t*t)*.5:(e*=.5,t*=.5,.5*Math.log(e*e+t*t)+Math.LN2)}const Ui={re:0,im:0},Wi=function(e,t){let n=Ui;if(e==null)n.re=n.im=0;else if(t!==void 0)n.re=e,n.im=t;else switch(typeof e){case`object`:if(`im`in e&&`re`in e)n.re=e.re,n.im=e.im;else if(`abs`in e&&`arg`in e){if(!isFinite(e.abs)&&isFinite(e.arg))return X.INFINITY;n.re=e.abs*Math.cos(e.arg),n.im=e.abs*Math.sin(e.arg)}else if(`r`in e&&`phi`in e){if(!isFinite(e.r)&&isFinite(e.phi))return X.INFINITY;n.re=e.r*Math.cos(e.phi),n.im=e.r*Math.sin(e.phi)}else e.length===2?(n.re=e[0],n.im=e[1]):Vi();break;case`string`:n.im=n.re=0;let t=e.replace(/_/g,``).match(/\d+\.?\d*e[+-]?\d+|\d+\.?\d*|\.\d+|./g),r=1,i=0;t===null&&Vi();for(let e=0;e<t.length;e++){let a=t[e];a===` `||a===` `||a===`
|
|
117
|
+
`||(a===`+`?r++:a===`-`?i++:a===`i`||a===`I`?(r+i===0&&Vi(),t[e+1]!==` `&&!isNaN(t[e+1])?(n.im+=parseFloat((i%2?`-`:``)+t[e+1]),e++):n.im+=parseFloat((i%2?`-`:``)+`1`),r=i=0):((r+i===0||isNaN(a))&&Vi(),t[e+1]===`i`||t[e+1]===`I`?(n.im+=parseFloat((i%2?`-`:``)+a),e++):n.re+=parseFloat((i%2?`-`:``)+a),r=i=0))}r+i>0&&Vi();break;case`number`:n.im=0,n.re=e;break;default:Vi()}return isNaN(n.re)||isNaN(n.im),n};function X(e,t){if(!(this instanceof X))return new X(e,t);let n=Wi(e,t);this.re=n.re,this.im=n.im}X.prototype={re:0,im:0,sign:function(){let e=Bi(this.re,this.im);return new X(this.re/e,this.im/e)},add:function(e,t){let n=Wi(e,t),r=this.isInfinite(),i=!(isFinite(n.re)&&isFinite(n.im));return r||i?r&&i?X.NAN:X.INFINITY:new X(this.re+n.re,this.im+n.im)},sub:function(e,t){let n=Wi(e,t),r=this.isInfinite(),i=!(isFinite(n.re)&&isFinite(n.im));return r||i?r&&i?X.NAN:X.INFINITY:new X(this.re-n.re,this.im-n.im)},mul:function(e,t){let n=Wi(e,t),r=this.isInfinite(),i=!(isFinite(n.re)&&isFinite(n.im)),a=this.re===0&&this.im===0,o=n.re===0&&n.im===0;return r&&o||i&&a?X.NAN:r||i?X.INFINITY:n.im===0&&this.im===0?new X(this.re*n.re,0):new X(this.re*n.re-this.im*n.im,this.re*n.im+this.im*n.re)},div:function(e,t){let n=Wi(e,t),r=this.isInfinite(),i=!(isFinite(n.re)&&isFinite(n.im)),a=this.re===0&&this.im===0,o=n.re===0&&n.im===0;if(a&&o||r&&i)return X.NAN;if(o||r)return X.INFINITY;if(a||i)return X.ZERO;if(n.im===0)return new X(this.re/n.re,this.im/n.re);if(Math.abs(n.re)<Math.abs(n.im)){let e=n.re/n.im,t=n.re*e+n.im;return new X((this.re*e+this.im)/t,(this.im*e-this.re)/t)}else{let e=n.im/n.re,t=n.im*e+n.re;return new X((this.re+this.im*e)/t,(this.im-this.re*e)/t)}},pow:function(e,t){let n=Wi(e,t),r=this.re===0&&this.im===0;if(n.re===0&&n.im===0)return X.ONE;if(n.im===0){if(this.im===0&&this.re>0)return new X(this.re**+n.re,0);if(this.re===0)switch((n.re%4+4)%4){case 0:return new X(this.im**+n.re,0);case 1:return new X(0,this.im**+n.re);case 2:return new X(-(this.im**+n.re),0);case 3:return new X(0,-(this.im**+n.re))}}if(r&&n.re>0)return X.ZERO;let i=Math.atan2(this.im,this.re),a=Hi(this.re,this.im),o=Math.exp(n.re*a-n.im*i),s=n.im*a+n.re*i;return new X(o*Math.cos(s),o*Math.sin(s))},sqrt:function(){let e=this.re,t=this.im;if(t===0)return e>=0?new X(Math.sqrt(e),0):new X(0,Math.sqrt(-e));let n=Bi(e,t),r=Math.sqrt(.5*(n+Math.abs(e))),i=Math.abs(t)/(2*r);return e>=0?new X(r,t<0?-i:i):new X(i,t<0?-r:r)},exp:function(){let e=Math.exp(this.re);return this.im===0?new X(e,0):new X(e*Math.cos(this.im),e*Math.sin(this.im))},expm1:function(){let e=this.re,t=this.im;return new X(Math.expm1(e)*Math.cos(t)+zi(t),Math.exp(e)*Math.sin(t))},log:function(){let e=this.re,t=this.im;return t===0&&e>0?new X(Math.log(e),0):new X(Hi(e,t),Math.atan2(t,e))},abs:function(){return Bi(this.re,this.im)},arg:function(){return Math.atan2(this.im,this.re)},sin:function(){let e=this.re,t=this.im;return new X(Math.sin(e)*J(t),Math.cos(e)*Y(t))},cos:function(){let e=this.re,t=this.im;return new X(Math.cos(e)*J(t),-Math.sin(e)*Y(t))},tan:function(){let e=2*this.re,t=2*this.im,n=Math.cos(e)+J(t);return new X(Math.sin(e)/n,Y(t)/n)},cot:function(){let e=2*this.re,t=2*this.im,n=Math.cos(e)-J(t);return new X(-Math.sin(e)/n,Y(t)/n)},sec:function(){let e=this.re,t=this.im,n=.5*J(2*t)+.5*Math.cos(2*e);return new X(Math.cos(e)*J(t)/n,Math.sin(e)*Y(t)/n)},csc:function(){let e=this.re,t=this.im,n=.5*J(2*t)-.5*Math.cos(2*e);return new X(Math.sin(e)*J(t)/n,-Math.cos(e)*Y(t)/n)},asin:function(){let e=this.re,t=this.im,n=new X(t*t-e*e+1,-2*e*t).sqrt(),r=new X(n.re-t,n.im+e).log();return new X(r.im,-r.re)},acos:function(){let e=this.re,t=this.im,n=new X(t*t-e*e+1,-2*e*t).sqrt(),r=new X(n.re-t,n.im+e).log();return new X(Math.PI/2-r.im,r.re)},atan:function(){let e=this.re,t=this.im;if(e===0){if(t===1)return new X(0,1/0);if(t===-1)return new X(0,-1/0)}let n=e*e+(1-t)*(1-t),r=new X((1-t*t-e*e)/n,-2*e/n).log();return new X(-.5*r.im,.5*r.re)},acot:function(){let e=this.re,t=this.im;if(t===0)return new X(Math.atan2(1,e),0);let n=e*e+t*t;return n===0?new X(e===0?0:e/0,t===0?0:-t/0).atan():new X(e/n,-t/n).atan()},asec:function(){let e=this.re,t=this.im;if(e===0&&t===0)return new X(0,1/0);let n=e*e+t*t;return n===0?new X(e===0?0:e/0,t===0?0:-t/0).acos():new X(e/n,-t/n).acos()},acsc:function(){let e=this.re,t=this.im;if(e===0&&t===0)return new X(Math.PI/2,1/0);let n=e*e+t*t;return n===0?new X(e===0?0:e/0,t===0?0:-t/0).asin():new X(e/n,-t/n).asin()},sinh:function(){let e=this.re,t=this.im;return new X(Y(e)*Math.cos(t),J(e)*Math.sin(t))},cosh:function(){let e=this.re,t=this.im;return new X(J(e)*Math.cos(t),Y(e)*Math.sin(t))},tanh:function(){let e=2*this.re,t=2*this.im,n=J(e)+Math.cos(t);return new X(Y(e)/n,Math.sin(t)/n)},coth:function(){let e=2*this.re,t=2*this.im,n=J(e)-Math.cos(t);return new X(Y(e)/n,-Math.sin(t)/n)},csch:function(){let e=this.re,t=this.im,n=Math.cos(2*t)-J(2*e);return new X(-2*Y(e)*Math.cos(t)/n,2*J(e)*Math.sin(t)/n)},sech:function(){let e=this.re,t=this.im,n=Math.cos(2*t)+J(2*e);return new X(2*J(e)*Math.cos(t)/n,-2*Y(e)*Math.sin(t)/n)},asinh:function(){let e=this.re,t=this.im;if(t===0){if(e===0)return new X(0,0);let t=Math.abs(e),n=Math.log(t+Math.sqrt(t*t+1));return new X(e<0?-n:n,0)}let n=new X(e*e-t*t+1,2*e*t).sqrt();return new X(e+n.re,t+n.im).log()},acosh:function(){let e=this.re,t=this.im;if(t===0){if(e>1)return new X(Math.log(e+Math.sqrt(e-1)*Math.sqrt(e+1)),0);if(e<-1){let t=Math.sqrt(e*e-1);return new X(Math.log(-e+t),Math.PI)}return new X(0,Math.acos(e))}let n=new X(e-1,t).sqrt(),r=new X(e+1,t).sqrt();return new X(e+n.re*r.re-n.im*r.im,t+n.re*r.im+n.im*r.re).log()},atanh:function(){let e=this.re,t=this.im;if(t===0){if(e===0)return new X(0,0);if(e===1)return new X(1/0,0);if(e===-1)return new X(-1/0,0);if(-1<e&&e<1)return new X(.5*Math.log((1+e)/(1-e)),0);if(e>1){let t=(e+1)/(e-1);return new X(.5*Math.log(t),-Math.PI/2)}let t=(1+e)/(1-e);return new X(.5*Math.log(-t),Math.PI/2)}let n=1-e,r=1+e,i=n*n+t*t;if(i===0)return new X(e===-1?0:e/0,t===0?0:t/0);let a=(r*n-t*t)/i,o=(t*n+r*t)/i;return new X(Hi(a,o)/2,Math.atan2(o,a)/2)},acoth:function(){let e=this.re,t=this.im;if(e===0&&t===0)return new X(0,Math.PI/2);let n=e*e+t*t;return n===0?new X(e===0?0:e/0,t===0?0:-t/0).atanh():new X(e/n,-t/n).atanh()},acsch:function(){let e=this.re,t=this.im;if(t===0){if(e===0)return new X(1/0,0);let t=1/e;return new X(Math.log(t+Math.sqrt(t*t+1)),0)}let n=e*e+t*t;return n===0?new X(e===0?0:e/0,t===0?0:-t/0).asinh():new X(e/n,-t/n).asinh()},asech:function(){let e=this.re,t=this.im;if(this.isZero())return X.INFINITY;let n=e*e+t*t;return n===0?new X(e===0?0:e/0,t===0?0:-t/0).acosh():new X(e/n,-t/n).acosh()},inverse:function(){if(this.isZero())return X.INFINITY;if(this.isInfinite())return X.ZERO;let e=this.re,t=this.im,n=e*e+t*t;return new X(e/n,-t/n)},conjugate:function(){return new X(this.re,-this.im)},neg:function(){return new X(-this.re,-this.im)},ceil:function(e){return e=10**(e||0),new X(Math.ceil(this.re*e)/e,Math.ceil(this.im*e)/e)},floor:function(e){return e=10**(e||0),new X(Math.floor(this.re*e)/e,Math.floor(this.im*e)/e)},round:function(e){return e=10**(e||0),new X(Math.round(this.re*e)/e,Math.round(this.im*e)/e)},equals:function(e,t){let n=Wi(e,t);return Math.abs(n.re-this.re)<=X.EPSILON&&Math.abs(n.im-this.im)<=X.EPSILON},clone:function(){return new X(this.re,this.im)},toString:function(){let e=this.re,t=this.im,n=``;return this.isNaN()?`NaN`:this.isInfinite()?`Infinity`:(Math.abs(e)<X.EPSILON&&(e=0),Math.abs(t)<X.EPSILON&&(t=0),t===0?n+e:(e===0?t<0&&(t=-t,n+=`-`):(n+=e,n+=` `,t<0?(t=-t,n+=`-`):n+=`+`,n+=` `),t!==1&&(n+=t),n+`i`))},toVector:function(){return[this.re,this.im]},valueOf:function(){return this.im===0?this.re:null},isNaN:function(){return isNaN(this.re)||isNaN(this.im)},isZero:function(){return this.im===0&&this.re===0},isFinite:function(){return isFinite(this.re)&&isFinite(this.im)},isInfinite:function(){return!this.isFinite()}},X.ZERO=new X(0,0),X.ONE=new X(1,0),X.I=new X(0,1),X.PI=new X(Math.PI,0),X.E=new X(Math.E,0),X.INFINITY=new X(1/0,1/0),X.NAN=new X(NaN,NaN),X.EPSILON=1e-15;var Gi=Vn(`Complex`,[],()=>(Object.defineProperty(X,`name`,{value:`Complex`}),X.prototype.constructor=X,X.prototype.type=`Complex`,X.prototype.isComplex=!0,X.prototype.toJSON=function(){return{mathjs:`Complex`,re:this.re,im:this.im}},X.prototype.toPolar=function(){return{r:this.abs(),phi:this.arg()}},X.prototype.format=function(e){var t=``,n=this.im,r=this.re,i=$t(this.re,e),a=$t(this.im,e),o=j(e)?e:e?e.precision:null;if(o!==null){var s=10**-o;Math.abs(r/n)<s&&(r=0),Math.abs(n/r)<s&&(n=0)}return t=n===0?i:r===0?n===1?`i`:n===-1?`-i`:a+`i`:n<0?n===-1?i+` - i`:i+` - `+a.substring(1)+`i`:n===1?i+` + i`:i+` + `+a+`i`,t},X.fromPolar=function(e){switch(arguments.length){case 1:var t=arguments[0];if(typeof t==`object`)return X(t);throw TypeError(`Input has to be an object with r and phi keys.`);case 2:var n=arguments[0],r=arguments[1];if(j(n)){if(st(r)&&r.hasBase(`ANGLE`)&&(r=r.toNumber(`rad`)),j(r))return new X({r:n,phi:r});throw TypeError(`Phi is not a number nor an angle unit.`)}else throw TypeError(`Radius r is not a number.`);default:throw SyntaxError(`Wrong number of arguments in function fromPolar`)}},X.prototype.valueOf=X.prototype.toString,X.fromJSON=function(e){return new X(e)},X.compare=function(e,t){return e.re>t.re?1:e.re<t.re?-1:e.im>t.im?1:e.im<t.im?-1:0},X),{isClass:!0}),Ki=k(D(((e,t)=>{
|
|
118
118
|
/**
|
|
119
119
|
* @license Fraction.js v4.3.0 20/08/2023
|
|
120
120
|
* https://www.xarg.org/2014/03/rational-numbers-in-javascript/
|
|
@@ -182,7 +182,7 @@ var cr=9e15,lr=1e9,ur=`0123456789abcdef`,dr=`2.302585092994045684017991454684364
|
|
|
182
182
|
return nil
|
|
183
183
|
`},za=async e=>{let{redisClientConfig:t,logger:n,generateUUID:r}=e;try{n?.info({category:`TransportInitialization`,message:`Starting transport system initialization`});let[e,i,a]=await Promise.all([Z.prepare(Pe,{redisClientConfig:t,scripts:Ne,logger:n,additionalArgs:r?[r]:void 0}),Z.prepare(Ce,{redisClientConfig:t,scripts:La,logger:n}),Z.prepare(Da,{redisClientConfig:t,scripts:Ra,logger:n})]),o=[{name:`ConcurrencyManager`,ready:e.isReady()},{name:`QueueManager`,ready:i.isReady()},{name:`RateLimitManager`,ready:a.isReady()}],s=o.filter(e=>!e.ready);if(s.length>0){let e=s.map(e=>e.name).join(`, `);throw Error(`Failed to initialize managers: ${e}`)}return n?.info({category:`TransportInitialization`,message:`Transport system initialization completed successfully`,context:{initializedManagers:o.map(e=>e.name)}}),{concurrencyManager:e,queueManager:i,rateLimitManager:a}}catch(e){n?.error({category:`TransportInitialization`,message:`Failed to initialize transport system`,code:`TRANSPORT_INIT_ERROR`,error:e});let t=Z.cleanupFailed();throw t>0&&n?.info({category:`TransportInitialization`,message:`Cleaned up ${t} failed singleton instances`}),e}},Ba=e=>{try{e?.info({category:`TransportInitialization`,message:`Starting transport system shutdown`});let t=Z.getIfReady(Pe),n=Z.getIfReady(Ce),r=Z.getIfReady(Da);t?.close(),n?.close(),r?.close(),Z.reset(Pe),Z.reset(Ce),Z.reset(Da),e?.info({category:`TransportInitialization`,message:`Transport system shutdown completed`})}catch(t){e?.error({category:`TransportInitialization`,message:`Error during transport system shutdown`,code:`TRANSPORT_SHUTDOWN_ERROR`,error:t})}},Va=()=>{let e=Z.getIfReady(Pe),t=Z.getIfReady(Ce),n=Z.getIfReady(Da);return!!(e?.isReady()&&t?.isReady()&&n?.isReady())},Ha=()=>{let e=Z.getIfReady(Pe),t=Z.getIfReady(Ce),n=Z.getIfReady(Da);return e&&t&&n?{concurrencyManager:e,queueManager:t,rateLimitManager:n}:null},Ua=e=>typeof e==`object`&&!!e&&`value`in e&&(typeof e.value==`string`||Array.isArray(e.value)),Wa=e=>Array.isArray(e)?e:[e],Ga=e=>Array.isArray(e)?e.map(String):String(e),Ka=(e,t,n)=>{let r=Wa(t);if(Ua(e))return{value:[...Wa(e.value),...r],arrayFormat:n??e.arrayFormat};let i=[...Wa(e),...r];return n?{value:i,arrayFormat:n}:i},qa=(e,t,n)=>{let r=Ga(t);return e===void 0?n?{value:r,arrayFormat:n}:r:Ka(e,r,n)},Ja=(e,t)=>Array.isArray(e)?e.concat(t):typeof e==`object`&&e&&typeof t==`object`&&t?{...e,...t}:t,Ya=e=>e.reduce((e,t)=>{if(t.in===`query`){let n=e.query[t.name];e.query[t.name]=qa(n,t.value,t.arrayFormat)}else if(t.in===`body`)if(t.spread)Array.isArray(t.value)?Array.isArray(e.body)?e.body=e.body.concat(t.value):e.body=t.value:typeof t.value==`object`&&t.value!==null&&(e.body={...e.body,...t.value});else{let n=e.body[t.name];e.body[t.name]=Ja(n,t.value)}else e.headers[t.name]=String(t.value);return e},{query:{},body:{},headers:{}}),Xa=[`query`,`body`,`headers`],Za=[`repeat`,`brackets`,`comma`],Qa=e=>u(e)&&e>=200&&e<=299,$a=e=>u(e)&&e>=400&&e<=599,eo=e=>u(e)&&e>=100&&e<=199;var to=class{async performRequest({httpClient:e,url:t,method:n,headers:r,queryParams:i,body:a,customErrorConfigs:s,requestConfig:c}){let l;try{l=await e?.request({method:n,url:t,headers:r,queryParams:i,maxRedirects:0,payload:a,requestConfig:c})}catch(e){if(o(e?.response))throw e;l=e.response}let u=Ie(l,s);if($a(u?.status))throw new Re(u,u.message);return u}};const no=`:A-Za-z_\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD`;no+``,``+no;const ro=RegExp(`^[:A-Za-z_\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Za-z_\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.\\d\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$`);function io(e,t){let n=[],r=t.exec(e);for(;r;){let i=[];i.startIndex=t.lastIndex-r[0].length;let a=r.length;for(let e=0;e<a;e++)i.push(r[e]);n.push(i),r=t.exec(e)}return n}const ao=function(e){return ro.exec(e)!=null};function oo(e){return e!==void 0}const so={allowBooleanAttributes:!1,unpairedTags:[]};function co(e,t){t=Object.assign({},so,t);let n=[],r=!1,i=!1;e[0]===``&&(e=e.substr(1));for(let a=0;a<e.length;a++)if(e[a]===`<`&&e[a+1]===`?`){if(a+=2,a=uo(e,a),a.err)return a}else if(e[a]===`<`){let o=a;if(a++,e[a]===`!`){a=fo(e,a);continue}else{let s=!1;e[a]===`/`&&(s=!0,a++);let c=``;for(;a<e.length&&e[a]!==`>`&&e[a]!==` `&&e[a]!==` `&&e[a]!==`
|
|
184
184
|
`&&e[a]!==`\r`;a++)c+=e[a];if(c=c.trim(),c[c.length-1]===`/`&&(c=c.substring(0,c.length-1),a--),!yo(c)){let t;return t=c.trim().length===0?`Invalid space after '<'.`:`Tag '`+c+`' is an invalid name.`,Q(`InvalidTag`,t,$(e,a))}let l=po(e,a);if(l===!1)return Q(`InvalidAttr`,`Attributes for '`+c+`' have open quote.`,$(e,a));let u=l.value;if(a=l.index,u[u.length-1]===`/`){let n=a-u.length;u=u.substring(0,u.length-1);let i=ho(u,t);if(i===!0)r=!0;else return Q(i.err.code,i.err.msg,$(e,n+i.err.line))}else if(s)if(l.tagClosed){if(u.trim().length>0)return Q(`InvalidTag`,`Closing tag '`+c+`' can't have attributes or invalid starting.`,$(e,o));if(n.length===0)return Q(`InvalidTag`,`Closing tag '`+c+`' has not been opened.`,$(e,o));{let t=n.pop();if(c!==t.tagName){let n=$(e,t.tagStartPos);return Q(`InvalidTag`,`Expected closing tag '`+t.tagName+`' (opened in line `+n.line+`, col `+n.col+`) instead of closing tag '`+c+`'.`,$(e,o))}n.length==0&&(i=!0)}}else return Q(`InvalidTag`,`Closing tag '`+c+`' doesn't have proper closing.`,$(e,a));else{let s=ho(u,t);if(s!==!0)return Q(s.err.code,s.err.msg,$(e,a-u.length+s.err.line));if(i===!0)return Q(`InvalidXml`,`Multiple possible root nodes found.`,$(e,a));t.unpairedTags.indexOf(c)!==-1||n.push({tagName:c,tagStartPos:o}),r=!0}for(a++;a<e.length;a++)if(e[a]===`<`)if(e[a+1]===`!`){a++,a=fo(e,a);continue}else if(e[a+1]===`?`){if(a=uo(e,++a),a.err)return a}else break;else if(e[a]===`&`){let t=_o(e,a);if(t==-1)return Q(`InvalidChar`,`char '&' is not expected.`,$(e,a));a=t}else if(i===!0&&!lo(e[a]))return Q(`InvalidXml`,`Extra text at the end`,$(e,a));e[a]===`<`&&a--}}else{if(lo(e[a]))continue;return Q(`InvalidChar`,`char '`+e[a]+`' is not expected.`,$(e,a))}if(r){if(n.length==1)return Q(`InvalidTag`,`Unclosed tag '`+n[0].tagName+`'.`,$(e,n[0].tagStartPos));if(n.length>0)return Q(`InvalidXml`,`Invalid '`+JSON.stringify(n.map(e=>e.tagName),null,4).replace(/\r?\n/g,``)+`' found.`,{line:1,col:1})}else return Q(`InvalidXml`,`Start tag expected.`,1);return!0}function lo(e){return e===` `||e===` `||e===`
|
|
185
|
-
`||e===`\r`}function uo(e,t){let n=t;for(;t<e.length;t++)if(e[t]==`?`||e[t]==` `){let r=e.substr(n,t-n);if(t>5&&r===`xml`)return Q(`InvalidXml`,`XML declaration allowed only at the start of the document.`,$(e,t));if(e[t]==`?`&&e[t+1]==`>`){t++;break}else continue}return t}function fo(e,t){if(e.length>t+5&&e[t+1]===`-`&&e[t+2]===`-`){for(t+=3;t<e.length;t++)if(e[t]===`-`&&e[t+1]===`-`&&e[t+2]===`>`){t+=2;break}}else if(e.length>t+8&&e[t+1]===`D`&&e[t+2]===`O`&&e[t+3]===`C`&&e[t+4]===`T`&&e[t+5]===`Y`&&e[t+6]===`P`&&e[t+7]===`E`){let n=1;for(t+=8;t<e.length;t++)if(e[t]===`<`)n++;else if(e[t]===`>`&&(n--,n===0))break}else if(e.length>t+9&&e[t+1]===`[`&&e[t+2]===`C`&&e[t+3]===`D`&&e[t+4]===`A`&&e[t+5]===`T`&&e[t+6]===`A`&&e[t+7]===`[`){for(t+=8;t<e.length;t++)if(e[t]===`]`&&e[t+1]===`]`&&e[t+2]===`>`){t+=2;break}}return t}function po(e,t){let n=``,r=``,i=!1;for(;t<e.length;t++){if(e[t]===`"`||e[t]===`'`)r===``?r=e[t]:r!==e[t]||(r=``);else if(e[t]===`>`&&r===``){i=!0;break}n+=e[t]}return r===``?{value:n,index:t,tagClosed:i}:!1}const mo=RegExp(`(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['"])(([\\s\\S])*?)\\5)?`,`g`);function ho(e,t){let n=io(e,mo),r={};for(let e=0;e<n.length;e++){if(n[e][1].length===0)return Q(`InvalidAttr`,`Attribute '`+n[e][2]+`' has no space in starting.`,bo(n[e]));if(n[e][3]!==void 0&&n[e][4]===void 0)return Q(`InvalidAttr`,`Attribute '`+n[e][2]+`' is without value.`,bo(n[e]));if(n[e][3]===void 0&&!t.allowBooleanAttributes)return Q(`InvalidAttr`,`boolean attribute '`+n[e][2]+`' is not allowed.`,bo(n[e]));let i=n[e][2];if(!vo(i))return Q(`InvalidAttr`,`Attribute '`+i+`' is an invalid name.`,bo(n[e]));if(!r.hasOwnProperty(i))r[i]=1;else return Q(`InvalidAttr`,`Attribute '`+i+`' is repeated.`,bo(n[e]))}return!0}function go(e,t){let n=/\d/;for(e[t]===`x`&&(t++,n=/[\da-fA-F]/);t<e.length;t++){if(e[t]===`;`)return t;if(!e[t].match(n))break}return-1}function _o(e,t){if(t++,e[t]===`;`)return-1;if(e[t]===`#`)return t++,go(e,t);let n=0;for(;t<e.length;t++,n++)if(!(e[t].match(/\w/)&&n<20)){if(e[t]===`;`)break;return-1}return t}function Q(e,t,n){return{err:{code:e,msg:t,line:n.line||n,col:n.col}}}function vo(e){return ao(e)}function yo(e){return ao(e)}function $(e,t){let n=e.substring(0,t).split(/\r?\n/);return{line:n.length,col:n[n.length-1].length+1}}function bo(e){return e.startIndex+e[1].length}const xo={preserveOrder:!1,attributeNamePrefix:`@_`,attributesGroupName:!1,textNodeName:`#text`,ignoreAttributes:!0,removeNSPrefix:!1,allowBooleanAttributes:!1,parseTagValue:!0,parseAttributeValue:!1,trimValues:!0,cdataPropName:!1,numberParseOptions:{hex:!0,leadingZeros:!0,eNotation:!0},tagValueProcessor:function(e,t){return t},attributeValueProcessor:function(e,t){return t},stopNodes:[],alwaysCreateTextNode:!1,isArray:()=>!1,commentPropName:!1,unpairedTags:[],processEntities:!0,htmlEntities:!1,ignoreDeclaration:!1,ignorePiTags:!1,transformTagName:!1,transformAttributeName:!1,updateTag:function(e,t,n){return e},captureMetaData:!1},So=function(e){return Object.assign({},xo,e)};let Co;Co=typeof Symbol==`function`?Symbol(`XML Node Metadata`):`@@xmlMetadata`;var wo=class{constructor(e){this.tagname=e,this.child=[],this[`:@`]={}}add(e,t){e===`__proto__`&&(e=`#__proto__`),this.child.push({[e]:t})}addChild(e,t){e.tagname===`__proto__`&&(e.tagname=`#__proto__`),e[`:@`]&&Object.keys(e[`:@`]).length>0?this.child.push({[e.tagname]:e.child,":@":e[`:@`]}):this.child.push({[e.tagname]:e.child}),t!==void 0&&(this.child[this.child.length-1][Co]={startIndex:t})}static getMetaDataSymbol(){return Co}};function To(e,t){let n={};if(e[t+3]===`O`&&e[t+4]===`C`&&e[t+5]===`T`&&e[t+6]===`Y`&&e[t+7]===`P`&&e[t+8]===`E`){t+=9;let r=1,i=!1,a=!1,o=``;for(;t<e.length;t++)if(e[t]===`<`&&!a){if(i&&jo(e,`!ENTITY`,t)){t+=7;let r,i;[r,i,t]=Do(e,t+1),i.indexOf(`&`)===-1&&(n[r]={regx:RegExp(`&${r};`,`g`),val:i})}else if(i&&jo(e,`!ELEMENT`,t)){t+=8;let{index:n}=Ao(e,t+1);t=n}else if(i&&jo(e,`!ATTLIST`,t))t+=8;else if(i&&jo(e,`!NOTATION`,t)){t+=9;let{index:n}=Oo(e,t+1);t=n}else if(jo(e,`!--`,t))a=!0;else throw Error(`Invalid DOCTYPE`);r++,o=``}else if(e[t]===`>`){if(a?e[t-1]===`-`&&e[t-2]===`-`&&(a=!1,r--):r--,r===0)break}else e[t]===`[`?i=!0:o+=e[t];if(r!==0)throw Error(`Unclosed DOCTYPE`)}else throw Error(`Invalid Tag instead of DOCTYPE`);return{entities:n,i:t}}const Eo=(e,t)=>{for(;t<e.length&&/\s/.test(e[t]);)t++;return t};function Do(e,t){t=Eo(e,t);let n=``;for(;t<e.length&&!/\s/.test(e[t])&&e[t]!==`"`&&e[t]!==`'`;)n+=e[t],t++;if(Mo(n),t=Eo(e,t),e.substring(t,t+6).toUpperCase()===`SYSTEM`)throw Error(`External entities are not supported`);if(e[t]===`%`)throw Error(`Parameter entities are not supported`);let r=``;return[t,r]=ko(e,t,`entity`),t--,[n,r,t]}function Oo(e,t){t=Eo(e,t);let n=``;for(;t<e.length&&!/\s/.test(e[t]);)n+=e[t],t++;Mo(n),t=Eo(e,t);let r=e.substring(t,t+6).toUpperCase();if(r!==`SYSTEM`&&r!==`PUBLIC`)throw Error(`Expected SYSTEM or PUBLIC, found "${r}"`);t+=r.length,t=Eo(e,t);let i=null,a=null;if(r===`PUBLIC`)[t,i]=ko(e,t,`publicIdentifier`),t=Eo(e,t),(e[t]===`"`||e[t]===`'`)&&([t,a]=ko(e,t,`systemIdentifier`));else if(r===`SYSTEM`&&([t,a]=ko(e,t,`systemIdentifier`),!a))throw Error(`Missing mandatory system identifier for SYSTEM notation`);return{notationName:n,publicIdentifier:i,systemIdentifier:a,index:--t}}function ko(e,t,n){let r=``,i=e[t];if(i!==`"`&&i!==`'`)throw Error(`Expected quoted string, found "${i}"`);for(t++;t<e.length&&e[t]!==i;)r+=e[t],t++;if(e[t]!==i)throw Error(`Unterminated ${n} value`);return t++,[t,r]}function Ao(e,t){t=Eo(e,t);let n=``;for(;t<e.length&&!/\s/.test(e[t]);)n+=e[t],t++;if(!Mo(n))throw Error(`Invalid element name: "${n}"`);t=Eo(e,t);let r=``;if(e[t]===`E`&&jo(e,`MPTY`,t))t+=4;else if(e[t]===`A`&&jo(e,`NY`,t))t+=2;else if(e[t]===`(`){for(t++;t<e.length&&e[t]!==`)`;)r+=e[t],t++;if(e[t]!==`)`)throw Error(`Unterminated content model`)}else throw Error(`Invalid Element Expression, found "${e[t]}"`);return{elementName:n,contentModel:r.trim(),index:t}}function jo(e,t,n){for(let r=0;r<t.length;r++)if(t[r]!==e[n+r+1])return!1;return!0}function Mo(e){if(ao(e))return e;throw Error(`Invalid entity name ${e}`)}const No=/^[-+]?0x[a-fA-F0-9]+$/,Po=/^([\-\+])?(0*)([0-9]*(\.[0-9]*)?)$/,Fo={hex:!0,leadingZeros:!0,decimalPoint:`.`,eNotation:!0};function Io(e,t={}){if(t=Object.assign({},Fo,t),!e||typeof e!=`string`)return e;let n=e.trim();if(t.skipLike!==void 0&&t.skipLike.test(n))return e;if(e===`0`)return 0;if(t.hex&&No.test(n))return Bo(n,16);if(n.search(/.+[eE].+/)!==-1)return Ro(e,n,t);{let r=Po.exec(n);if(r){let i=r[1]||``,a=r[2],o=zo(r[3]),s=i?e[a.length+1]===`.`:e[a.length]===`.`;if(!t.leadingZeros&&(a.length>1||a.length===1&&!s))return e;{let r=Number(n),s=String(r);if(r===0)return r;if(s.search(/[eE]/)!==-1)return t.eNotation?r:e;if(n.indexOf(`.`)!==-1)return s===`0`||s===o||s===`${i}${o}`?r:e;let c=a?o:n;return a?c===s||i+c===s?r:e:c===s||c===i+s?r:e}}else return e}}const Lo=/^([-+])?(0*)(\d*(\.\d*)?[eE][-\+]?\d+)$/;function Ro(e,t,n){if(!n.eNotation)return e;let r=t.match(Lo);if(r){let i=r[1]||``,a=r[3].indexOf(`e`)===-1?`E`:`e`,o=r[2],s=i?e[o.length+1]===a:e[o.length]===a;return o.length>1&&s?e:o.length===1&&(r[3].startsWith(`.${a}`)||r[3][0]===a)?Number(t):n.leadingZeros&&!s?(t=(r[1]||``)+r[3],Number(t)):e}else return e}function zo(e){return e&&e.indexOf(`.`)!==-1?(e=e.replace(/0+$/,``),e===`.`?e=`0`:e[0]===`.`?e=`0`+e:e[e.length-1]===`.`&&(e=e.substring(0,e.length-1)),e):e}function Bo(e,t){if(parseInt)return parseInt(e,t);if(Number.parseInt)return Number.parseInt(e,t);if(window&&window.parseInt)return window.parseInt(e,t);throw Error(`parseInt, Number.parseInt, window.parseInt are not supported`)}function Vo(e){return typeof e==`function`?e:Array.isArray(e)?t=>{for(let n of e)if(typeof n==`string`&&t===n||n instanceof RegExp&&n.test(t))return!0}:()=>!1}var Ho=class{constructor(e){this.options=e,this.currentNode=null,this.tagsNodeStack=[],this.docTypeEntities={},this.lastEntities={apos:{regex:/&(apos|#39|#x27);/g,val:`'`},gt:{regex:/&(gt|#62|#x3E);/g,val:`>`},lt:{regex:/&(lt|#60|#x3C);/g,val:`<`},quot:{regex:/&(quot|#34|#x22);/g,val:`"`}},this.ampEntity={regex:/&(amp|#38|#x26);/g,val:`&`},this.htmlEntities={space:{regex:/&(nbsp|#160);/g,val:` `},cent:{regex:/&(cent|#162);/g,val:`¢`},pound:{regex:/&(pound|#163);/g,val:`£`},yen:{regex:/&(yen|#165);/g,val:`¥`},euro:{regex:/&(euro|#8364);/g,val:`€`},copyright:{regex:/&(copy|#169);/g,val:`©`},reg:{regex:/&(reg|#174);/g,val:`®`},inr:{regex:/&(inr|#8377);/g,val:`₹`},num_dec:{regex:/&#([0-9]{1,7});/g,val:(e,t)=>String.fromCodePoint(Number.parseInt(t,10))},num_hex:{regex:/&#x([0-9a-fA-F]{1,6});/g,val:(e,t)=>String.fromCodePoint(Number.parseInt(t,16))}},this.addExternalEntities=Uo,this.parseXml=Jo,this.parseTextData=Wo,this.resolveNameSpace=Go,this.buildAttributesMap=qo,this.isItStopNode=Qo,this.replaceEntitiesValue=Xo,this.readStopNodeData=ns,this.saveTextToParentTag=Zo,this.addChild=Yo,this.ignoreAttributesFn=Vo(this.options.ignoreAttributes)}};function Uo(e){let t=Object.keys(e);for(let n=0;n<t.length;n++){let r=t[n];this.lastEntities[r]={regex:RegExp(`&`+r+`;`,`g`),val:e[r]}}}function Wo(e,t,n,r,i,a,o){if(e!==void 0&&(this.options.trimValues&&!r&&(e=e.trim()),e.length>0)){o||(e=this.replaceEntitiesValue(e));let r=this.options.tagValueProcessor(t,e,n,i,a);return r==null?e:typeof r!=typeof e||r!==e?r:this.options.trimValues||e.trim()===e?rs(e,this.options.parseTagValue,this.options.numberParseOptions):e}}function Go(e){if(this.options.removeNSPrefix){let t=e.split(`:`),n=e.charAt(0)===`/`?`/`:``;if(t[0]===`xmlns`)return``;t.length===2&&(e=n+t[1])}return e}const Ko=RegExp(`([^\\s=]+)\\s*(=\\s*(['"])([\\s\\S]*?)\\3)?`,`gm`);function qo(e,t,n){if(this.options.ignoreAttributes!==!0&&typeof e==`string`){let n=io(e,Ko),r=n.length,i={};for(let e=0;e<r;e++){let r=this.resolveNameSpace(n[e][1]);if(this.ignoreAttributesFn(r,t))continue;let a=n[e][4],o=this.options.attributeNamePrefix+r;if(r.length)if(this.options.transformAttributeName&&(o=this.options.transformAttributeName(o)),o===`__proto__`&&(o=`#__proto__`),a!==void 0){this.options.trimValues&&(a=a.trim()),a=this.replaceEntitiesValue(a);let e=this.options.attributeValueProcessor(r,a,t);e==null?i[o]=a:typeof e!=typeof a||e!==a?i[o]=e:i[o]=rs(a,this.options.parseAttributeValue,this.options.numberParseOptions)}else this.options.allowBooleanAttributes&&(i[o]=!0)}if(!Object.keys(i).length)return;if(this.options.attributesGroupName){let e={};return e[this.options.attributesGroupName]=i,e}return i}}const Jo=function(e){e=e.replace(/\r\n?/g,`
|
|
185
|
+
`||e===`\r`}function uo(e,t){let n=t;for(;t<e.length;t++)if(e[t]==`?`||e[t]==` `){let r=e.substr(n,t-n);if(t>5&&r===`xml`)return Q(`InvalidXml`,`XML declaration allowed only at the start of the document.`,$(e,t));if(e[t]==`?`&&e[t+1]==`>`){t++;break}else continue}return t}function fo(e,t){if(e.length>t+5&&e[t+1]===`-`&&e[t+2]===`-`){for(t+=3;t<e.length;t++)if(e[t]===`-`&&e[t+1]===`-`&&e[t+2]===`>`){t+=2;break}}else if(e.length>t+8&&e[t+1]===`D`&&e[t+2]===`O`&&e[t+3]===`C`&&e[t+4]===`T`&&e[t+5]===`Y`&&e[t+6]===`P`&&e[t+7]===`E`){let n=1;for(t+=8;t<e.length;t++)if(e[t]===`<`)n++;else if(e[t]===`>`&&(n--,n===0))break}else if(e.length>t+9&&e[t+1]===`[`&&e[t+2]===`C`&&e[t+3]===`D`&&e[t+4]===`A`&&e[t+5]===`T`&&e[t+6]===`A`&&e[t+7]===`[`){for(t+=8;t<e.length;t++)if(e[t]===`]`&&e[t+1]===`]`&&e[t+2]===`>`){t+=2;break}}return t}function po(e,t){let n=``,r=``,i=!1;for(;t<e.length;t++){if(e[t]===`"`||e[t]===`'`)r===``?r=e[t]:r!==e[t]||(r=``);else if(e[t]===`>`&&r===``){i=!0;break}n+=e[t]}return r===``?{value:n,index:t,tagClosed:i}:!1}const mo=RegExp(`(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['"])(([\\s\\S])*?)\\5)?`,`g`);function ho(e,t){let n=io(e,mo),r={};for(let e=0;e<n.length;e++){if(n[e][1].length===0)return Q(`InvalidAttr`,`Attribute '`+n[e][2]+`' has no space in starting.`,bo(n[e]));if(n[e][3]!==void 0&&n[e][4]===void 0)return Q(`InvalidAttr`,`Attribute '`+n[e][2]+`' is without value.`,bo(n[e]));if(n[e][3]===void 0&&!t.allowBooleanAttributes)return Q(`InvalidAttr`,`boolean attribute '`+n[e][2]+`' is not allowed.`,bo(n[e]));let i=n[e][2];if(!vo(i))return Q(`InvalidAttr`,`Attribute '`+i+`' is an invalid name.`,bo(n[e]));if(!r.hasOwnProperty(i))r[i]=1;else return Q(`InvalidAttr`,`Attribute '`+i+`' is repeated.`,bo(n[e]))}return!0}function go(e,t){let n=/\d/;for(e[t]===`x`&&(t++,n=/[\da-fA-F]/);t<e.length;t++){if(e[t]===`;`)return t;if(!e[t].match(n))break}return-1}function _o(e,t){if(t++,e[t]===`;`)return-1;if(e[t]===`#`)return t++,go(e,t);let n=0;for(;t<e.length;t++,n++)if(!(e[t].match(/\w/)&&n<20)){if(e[t]===`;`)break;return-1}return t}function Q(e,t,n){return{err:{code:e,msg:t,line:n.line||n,col:n.col}}}function vo(e){return ao(e)}function yo(e){return ao(e)}function $(e,t){let n=e.substring(0,t).split(/\r?\n/);return{line:n.length,col:n[n.length-1].length+1}}function bo(e){return e.startIndex+e[1].length}const xo={preserveOrder:!1,attributeNamePrefix:`@_`,attributesGroupName:!1,textNodeName:`#text`,ignoreAttributes:!0,removeNSPrefix:!1,allowBooleanAttributes:!1,parseTagValue:!0,parseAttributeValue:!1,trimValues:!0,cdataPropName:!1,numberParseOptions:{hex:!0,leadingZeros:!0,eNotation:!0},tagValueProcessor:function(e,t){return t},attributeValueProcessor:function(e,t){return t},stopNodes:[],alwaysCreateTextNode:!1,isArray:()=>!1,commentPropName:!1,unpairedTags:[],processEntities:!0,htmlEntities:!1,ignoreDeclaration:!1,ignorePiTags:!1,transformTagName:!1,transformAttributeName:!1,updateTag:function(e,t,n){return e},captureMetaData:!1},So=function(e){return Object.assign({},xo,e)};let Co;Co=typeof Symbol==`function`?Symbol(`XML Node Metadata`):`@@xmlMetadata`;var wo=class{constructor(e){this.tagname=e,this.child=[],this[`:@`]={}}add(e,t){e===`__proto__`&&(e=`#__proto__`),this.child.push({[e]:t})}addChild(e,t){e.tagname===`__proto__`&&(e.tagname=`#__proto__`),e[`:@`]&&Object.keys(e[`:@`]).length>0?this.child.push({[e.tagname]:e.child,":@":e[`:@`]}):this.child.push({[e.tagname]:e.child}),t!==void 0&&(this.child[this.child.length-1][Co]={startIndex:t})}static getMetaDataSymbol(){return Co}};function To(e,t){let n={};if(e[t+3]===`O`&&e[t+4]===`C`&&e[t+5]===`T`&&e[t+6]===`Y`&&e[t+7]===`P`&&e[t+8]===`E`){t+=9;let r=1,i=!1,a=!1,o=``;for(;t<e.length;t++)if(e[t]===`<`&&!a){if(i&&jo(e,`!ENTITY`,t)){t+=7;let r,i;[r,i,t]=Do(e,t+1),i.indexOf(`&`)===-1&&(n[r]={regx:RegExp(`&${r};`,`g`),val:i})}else if(i&&jo(e,`!ELEMENT`,t)){t+=8;let{index:n}=Ao(e,t+1);t=n}else if(i&&jo(e,`!ATTLIST`,t))t+=8;else if(i&&jo(e,`!NOTATION`,t)){t+=9;let{index:n}=Oo(e,t+1);t=n}else if(jo(e,`!--`,t))a=!0;else throw Error(`Invalid DOCTYPE`);r++,o=``}else if(e[t]===`>`){if(a?e[t-1]===`-`&&e[t-2]===`-`&&(a=!1,r--):r--,r===0)break}else e[t]===`[`?i=!0:o+=e[t];if(r!==0)throw Error(`Unclosed DOCTYPE`)}else throw Error(`Invalid Tag instead of DOCTYPE`);return{entities:n,i:t}}const Eo=(e,t)=>{for(;t<e.length&&/\s/.test(e[t]);)t++;return t};function Do(e,t){t=Eo(e,t);let n=``;for(;t<e.length&&!/\s/.test(e[t])&&e[t]!==`"`&&e[t]!==`'`;)n+=e[t],t++;if(Mo(n),t=Eo(e,t),e.substring(t,t+6).toUpperCase()===`SYSTEM`)throw Error(`External entities are not supported`);if(e[t]===`%`)throw Error(`Parameter entities are not supported`);let r=``;return[t,r]=ko(e,t,`entity`),t--,[n,r,t]}function Oo(e,t){t=Eo(e,t);let n=``;for(;t<e.length&&!/\s/.test(e[t]);)n+=e[t],t++;Mo(n),t=Eo(e,t);let r=e.substring(t,t+6).toUpperCase();if(r!==`SYSTEM`&&r!==`PUBLIC`)throw Error(`Expected SYSTEM or PUBLIC, found "${r}"`);t+=r.length,t=Eo(e,t);let i=null,a=null;if(r===`PUBLIC`)[t,i]=ko(e,t,`publicIdentifier`),t=Eo(e,t),(e[t]===`"`||e[t]===`'`)&&([t,a]=ko(e,t,`systemIdentifier`));else if(r===`SYSTEM`&&([t,a]=ko(e,t,`systemIdentifier`),!a))throw Error(`Missing mandatory system identifier for SYSTEM notation`);return{notationName:n,publicIdentifier:i,systemIdentifier:a,index:--t}}function ko(e,t,n){let r=``,i=e[t];if(i!==`"`&&i!==`'`)throw Error(`Expected quoted string, found "${i}"`);for(t++;t<e.length&&e[t]!==i;)r+=e[t],t++;if(e[t]!==i)throw Error(`Unterminated ${n} value`);return t++,[t,r]}function Ao(e,t){t=Eo(e,t);let n=``;for(;t<e.length&&!/\s/.test(e[t]);)n+=e[t],t++;if(!Mo(n))throw Error(`Invalid element name: "${n}"`);t=Eo(e,t);let r=``;if(e[t]===`E`&&jo(e,`MPTY`,t))t+=4;else if(e[t]===`A`&&jo(e,`NY`,t))t+=2;else if(e[t]===`(`){for(t++;t<e.length&&e[t]!==`)`;)r+=e[t],t++;if(e[t]!==`)`)throw Error(`Unterminated content model`)}else throw Error(`Invalid Element Expression, found "${e[t]}"`);return{elementName:n,contentModel:r.trim(),index:t}}function jo(e,t,n){for(let r=0;r<t.length;r++)if(t[r]!==e[n+r+1])return!1;return!0}function Mo(e){if(ao(e))return e;throw Error(`Invalid entity name ${e}`)}const No=/^[-+]?0x[a-fA-F0-9]+$/,Po=/^([\-\+])?(0*)([0-9]*(\.[0-9]*)?)$/,Fo={hex:!0,leadingZeros:!0,decimalPoint:`.`,eNotation:!0};function Io(e,t={}){if(t=Object.assign({},Fo,t),!e||typeof e!=`string`)return e;let n=e.trim();if(t.skipLike!==void 0&&t.skipLike.test(n))return e;if(e===`0`)return 0;if(t.hex&&No.test(n))return Bo(n,16);if(n.includes(`e`)||n.includes(`E`))return Ro(e,n,t);{let r=Po.exec(n);if(r){let i=r[1]||``,a=r[2],o=zo(r[3]),s=i?e[a.length+1]===`.`:e[a.length]===`.`;if(!t.leadingZeros&&(a.length>1||a.length===1&&!s))return e;{let r=Number(n),s=String(r);if(r===0)return r;if(s.search(/[eE]/)!==-1)return t.eNotation?r:e;if(n.indexOf(`.`)!==-1)return s===`0`||s===o||s===`${i}${o}`?r:e;let c=a?o:n;return a?c===s||i+c===s?r:e:c===s||c===i+s?r:e}}else return e}}const Lo=/^([-+])?(0*)(\d*(\.\d*)?[eE][-\+]?\d+)$/;function Ro(e,t,n){if(!n.eNotation)return e;let r=t.match(Lo);if(r){let i=r[1]||``,a=r[3].indexOf(`e`)===-1?`E`:`e`,o=r[2],s=i?e[o.length+1]===a:e[o.length]===a;return o.length>1&&s?e:o.length===1&&(r[3].startsWith(`.${a}`)||r[3][0]===a)?Number(t):n.leadingZeros&&!s?(t=(r[1]||``)+r[3],Number(t)):e}else return e}function zo(e){return e&&e.indexOf(`.`)!==-1?(e=e.replace(/0+$/,``),e===`.`?e=`0`:e[0]===`.`?e=`0`+e:e[e.length-1]===`.`&&(e=e.substring(0,e.length-1)),e):e}function Bo(e,t){if(parseInt)return parseInt(e,t);if(Number.parseInt)return Number.parseInt(e,t);if(window&&window.parseInt)return window.parseInt(e,t);throw Error(`parseInt, Number.parseInt, window.parseInt are not supported`)}function Vo(e){return typeof e==`function`?e:Array.isArray(e)?t=>{for(let n of e)if(typeof n==`string`&&t===n||n instanceof RegExp&&n.test(t))return!0}:()=>!1}var Ho=class{constructor(e){this.options=e,this.currentNode=null,this.tagsNodeStack=[],this.docTypeEntities={},this.lastEntities={apos:{regex:/&(apos|#39|#x27);/g,val:`'`},gt:{regex:/&(gt|#62|#x3E);/g,val:`>`},lt:{regex:/&(lt|#60|#x3C);/g,val:`<`},quot:{regex:/&(quot|#34|#x22);/g,val:`"`}},this.ampEntity={regex:/&(amp|#38|#x26);/g,val:`&`},this.htmlEntities={space:{regex:/&(nbsp|#160);/g,val:` `},cent:{regex:/&(cent|#162);/g,val:`¢`},pound:{regex:/&(pound|#163);/g,val:`£`},yen:{regex:/&(yen|#165);/g,val:`¥`},euro:{regex:/&(euro|#8364);/g,val:`€`},copyright:{regex:/&(copy|#169);/g,val:`©`},reg:{regex:/&(reg|#174);/g,val:`®`},inr:{regex:/&(inr|#8377);/g,val:`₹`},num_dec:{regex:/&#([0-9]{1,7});/g,val:(e,t)=>String.fromCodePoint(Number.parseInt(t,10))},num_hex:{regex:/&#x([0-9a-fA-F]{1,6});/g,val:(e,t)=>String.fromCodePoint(Number.parseInt(t,16))}},this.addExternalEntities=Uo,this.parseXml=Jo,this.parseTextData=Wo,this.resolveNameSpace=Go,this.buildAttributesMap=qo,this.isItStopNode=Qo,this.replaceEntitiesValue=Xo,this.readStopNodeData=ns,this.saveTextToParentTag=Zo,this.addChild=Yo,this.ignoreAttributesFn=Vo(this.options.ignoreAttributes)}};function Uo(e){let t=Object.keys(e);for(let n=0;n<t.length;n++){let r=t[n];this.lastEntities[r]={regex:RegExp(`&`+r+`;`,`g`),val:e[r]}}}function Wo(e,t,n,r,i,a,o){if(e!==void 0&&(this.options.trimValues&&!r&&(e=e.trim()),e.length>0)){o||(e=this.replaceEntitiesValue(e));let r=this.options.tagValueProcessor(t,e,n,i,a);return r==null?e:typeof r!=typeof e||r!==e?r:this.options.trimValues||e.trim()===e?rs(e,this.options.parseTagValue,this.options.numberParseOptions):e}}function Go(e){if(this.options.removeNSPrefix){let t=e.split(`:`),n=e.charAt(0)===`/`?`/`:``;if(t[0]===`xmlns`)return``;t.length===2&&(e=n+t[1])}return e}const Ko=RegExp(`([^\\s=]+)\\s*(=\\s*(['"])([\\s\\S]*?)\\3)?`,`gm`);function qo(e,t,n){if(this.options.ignoreAttributes!==!0&&typeof e==`string`){let n=io(e,Ko),r=n.length,i={};for(let e=0;e<r;e++){let r=this.resolveNameSpace(n[e][1]);if(this.ignoreAttributesFn(r,t))continue;let a=n[e][4],o=this.options.attributeNamePrefix+r;if(r.length)if(this.options.transformAttributeName&&(o=this.options.transformAttributeName(o)),o===`__proto__`&&(o=`#__proto__`),a!==void 0){this.options.trimValues&&(a=a.trim()),a=this.replaceEntitiesValue(a);let e=this.options.attributeValueProcessor(r,a,t);e==null?i[o]=a:typeof e!=typeof a||e!==a?i[o]=e:i[o]=rs(a,this.options.parseAttributeValue,this.options.numberParseOptions)}else this.options.allowBooleanAttributes&&(i[o]=!0)}if(!Object.keys(i).length)return;if(this.options.attributesGroupName){let e={};return e[this.options.attributesGroupName]=i,e}return i}}const Jo=function(e){e=e.replace(/\r\n?/g,`
|
|
186
186
|
`);let t=new wo(`!xml`),n=t,r=``,i=``;for(let a=0;a<e.length;a++)if(e[a]===`<`)if(e[a+1]===`/`){let t=es(e,`>`,a,`Closing Tag is not closed.`),o=e.substring(a+2,t).trim();if(this.options.removeNSPrefix){let e=o.indexOf(`:`);e!==-1&&(o=o.substr(e+1))}this.options.transformTagName&&(o=this.options.transformTagName(o)),n&&(r=this.saveTextToParentTag(r,n,i));let s=i.substring(i.lastIndexOf(`.`)+1);if(o&&this.options.unpairedTags.indexOf(o)!==-1)throw Error(`Unpaired tag can not be used as closing tag: </${o}>`);let c=0;s&&this.options.unpairedTags.indexOf(s)!==-1?(c=i.lastIndexOf(`.`,i.lastIndexOf(`.`)-1),this.tagsNodeStack.pop()):c=i.lastIndexOf(`.`),i=i.substring(0,c),n=this.tagsNodeStack.pop(),r=``,a=t}else if(e[a+1]===`?`){let t=ts(e,a,!1,`?>`);if(!t)throw Error(`Pi Tag is not closed.`);if(r=this.saveTextToParentTag(r,n,i),!(this.options.ignoreDeclaration&&t.tagName===`?xml`||this.options.ignorePiTags)){let e=new wo(t.tagName);e.add(this.options.textNodeName,``),t.tagName!==t.tagExp&&t.attrExpPresent&&(e[`:@`]=this.buildAttributesMap(t.tagExp,i,t.tagName)),this.addChild(n,e,i,a)}a=t.closeIndex+1}else if(e.substr(a+1,3)===`!--`){let t=es(e,`-->`,a+4,`Comment is not closed.`);if(this.options.commentPropName){let o=e.substring(a+4,t-2);r=this.saveTextToParentTag(r,n,i),n.add(this.options.commentPropName,[{[this.options.textNodeName]:o}])}a=t}else if(e.substr(a+1,2)===`!D`){let t=To(e,a);this.docTypeEntities=t.entities,a=t.i}else if(e.substr(a+1,2)===`![`){let t=es(e,`]]>`,a,`CDATA is not closed.`)-2,o=e.substring(a+9,t);r=this.saveTextToParentTag(r,n,i);let s=this.parseTextData(o,n.tagname,i,!0,!1,!0,!0);s??=``,this.options.cdataPropName?n.add(this.options.cdataPropName,[{[this.options.textNodeName]:o}]):n.add(this.options.textNodeName,s),a=t+2}else{let o=ts(e,a,this.options.removeNSPrefix),s=o.tagName,c=o.rawTagName,l=o.tagExp,u=o.attrExpPresent,d=o.closeIndex;this.options.transformTagName&&(s=this.options.transformTagName(s)),n&&r&&n.tagname!==`!xml`&&(r=this.saveTextToParentTag(r,n,i,!1));let f=n;f&&this.options.unpairedTags.indexOf(f.tagname)!==-1&&(n=this.tagsNodeStack.pop(),i=i.substring(0,i.lastIndexOf(`.`))),s!==t.tagname&&(i+=i?`.`+s:s);let p=a;if(this.isItStopNode(this.options.stopNodes,i,s)){let t=``;if(l.length>0&&l.lastIndexOf(`/`)===l.length-1)s[s.length-1]===`/`?(s=s.substr(0,s.length-1),i=i.substr(0,i.length-1),l=s):l=l.substr(0,l.length-1),a=o.closeIndex;else if(this.options.unpairedTags.indexOf(s)!==-1)a=o.closeIndex;else{let n=this.readStopNodeData(e,c,d+1);if(!n)throw Error(`Unexpected end of ${c}`);a=n.i,t=n.tagContent}let r=new wo(s);s!==l&&u&&(r[`:@`]=this.buildAttributesMap(l,i,s)),t&&=this.parseTextData(t,s,i,!0,u,!0,!0),i=i.substr(0,i.lastIndexOf(`.`)),r.add(this.options.textNodeName,t),this.addChild(n,r,i,p)}else{if(l.length>0&&l.lastIndexOf(`/`)===l.length-1){s[s.length-1]===`/`?(s=s.substr(0,s.length-1),i=i.substr(0,i.length-1),l=s):l=l.substr(0,l.length-1),this.options.transformTagName&&(s=this.options.transformTagName(s));let e=new wo(s);s!==l&&u&&(e[`:@`]=this.buildAttributesMap(l,i,s)),this.addChild(n,e,i,p),i=i.substr(0,i.lastIndexOf(`.`))}else{let e=new wo(s);this.tagsNodeStack.push(n),s!==l&&u&&(e[`:@`]=this.buildAttributesMap(l,i,s)),this.addChild(n,e,i,p),n=e}r=``,a=d}}else r+=e[a];return t.child};function Yo(e,t,n,r){this.options.captureMetaData||(r=void 0);let i=this.options.updateTag(t.tagname,n,t[`:@`]);i===!1||(typeof i==`string`&&(t.tagname=i),e.addChild(t,r))}const Xo=function(e){if(this.options.processEntities){for(let t in this.docTypeEntities){let n=this.docTypeEntities[t];e=e.replace(n.regx,n.val)}for(let t in this.lastEntities){let n=this.lastEntities[t];e=e.replace(n.regex,n.val)}if(this.options.htmlEntities)for(let t in this.htmlEntities){let n=this.htmlEntities[t];e=e.replace(n.regex,n.val)}e=e.replace(this.ampEntity.regex,this.ampEntity.val)}return e};function Zo(e,t,n,r){return e&&=(r===void 0&&(r=t.child.length===0),e=this.parseTextData(e,t.tagname,n,!1,t[`:@`]?Object.keys(t[`:@`]).length!==0:!1,r),e!==void 0&&e!==``&&t.add(this.options.textNodeName,e),``),e}function Qo(e,t,n){let r=`*.`+n;for(let n in e){let i=e[n];if(r===i||t===i)return!0}return!1}function $o(e,t,n=`>`){let r,i=``;for(let a=t;a<e.length;a++){let t=e[a];if(r)t===r&&(r=``);else if(t===`"`||t===`'`)r=t;else if(t===n[0])if(n[1]){if(e[a+1]===n[1])return{data:i,index:a}}else return{data:i,index:a};else t===` `&&(t=` `);i+=t}}function es(e,t,n,r){let i=e.indexOf(t,n);if(i===-1)throw Error(r);return i+t.length-1}function ts(e,t,n,r=`>`){let i=$o(e,t+1,r);if(!i)return;let a=i.data,o=i.index,s=a.search(/\s/),c=a,l=!0;s!==-1&&(c=a.substring(0,s),a=a.substring(s+1).trimStart());let u=c;if(n){let e=c.indexOf(`:`);e!==-1&&(c=c.substr(e+1),l=c!==i.data.substr(e+1))}return{tagName:c,tagExp:a,closeIndex:o,attrExpPresent:l,rawTagName:u}}function ns(e,t,n){let r=n,i=1;for(;n<e.length;n++)if(e[n]===`<`)if(e[n+1]===`/`){let a=es(e,`>`,n,`${t} is not closed`);if(e.substring(n+2,a).trim()===t&&(i--,i===0))return{tagContent:e.substring(r,n),i:a};n=a}else if(e[n+1]===`?`)n=es(e,`?>`,n+1,`StopNode is not closed.`);else if(e.substr(n+1,3)===`!--`)n=es(e,`-->`,n+3,`StopNode is not closed.`);else if(e.substr(n+1,2)===`![`)n=es(e,`]]>`,n,`StopNode is not closed.`)-2;else{let r=ts(e,n,`>`);r&&((r&&r.tagName)===t&&r.tagExp[r.tagExp.length-1]!==`/`&&i++,n=r.closeIndex)}}function rs(e,t,n){if(t&&typeof e==`string`){let t=e.trim();return t===`true`?!0:t===`false`?!1:Io(e,n)}else if(oo(e))return e;else return``}const is=wo.getMetaDataSymbol();function as(e,t){return os(e,t)}function os(e,t,n){let r,i={};for(let a=0;a<e.length;a++){let o=e[a],s=ss(o),c=``;if(c=n===void 0?s:n+`.`+s,s===t.textNodeName)r===void 0?r=o[s]:r+=``+o[s];else if(s===void 0)continue;else if(o[s]){let e=os(o[s],t,c),n=ls(e,t);o[is]!==void 0&&(e[is]=o[is]),o[`:@`]?cs(e,o[`:@`],c,t):Object.keys(e).length===1&&e[t.textNodeName]!==void 0&&!t.alwaysCreateTextNode?e=e[t.textNodeName]:Object.keys(e).length===0&&(t.alwaysCreateTextNode?e[t.textNodeName]=``:e=``),i[s]!==void 0&&i.hasOwnProperty(s)?(Array.isArray(i[s])||(i[s]=[i[s]]),i[s].push(e)):t.isArray(s,c,n)?i[s]=[e]:i[s]=e}}return typeof r==`string`?r.length>0&&(i[t.textNodeName]=r):r!==void 0&&(i[t.textNodeName]=r),i}function ss(e){let t=Object.keys(e);for(let e=0;e<t.length;e++){let n=t[e];if(n!==`:@`)return n}}function cs(e,t,n,r){if(t){let i=Object.keys(t),a=i.length;for(let o=0;o<a;o++){let a=i[o];r.isArray(a,n+`.`+a,!0,!0)?e[a]=[t[a]]:e[a]=t[a]}}}function ls(e,t){let{textNodeName:n}=t,r=Object.keys(e).length;return!!(r===0||r===1&&(e[n]||typeof e[n]==`boolean`||e[n]===0))}var us=class{constructor(e){this.externalEntities={},this.options=So(e)}parse(e,t){if(typeof e!=`string`)if(e.toString)e=e.toString();else throw Error(`XML data is accepted in String or Bytes[] form.`);if(t){t===!0&&(t={});let n=co(e,t);if(n!==!0)throw Error(`${n.err.msg}:${n.err.line}:${n.err.col}`)}let n=new Ho(this.options);n.addExternalEntities(this.externalEntities);let r=n.parseXml(e);return this.options.preserveOrder||r===void 0?r:as(r,this.options)}addEntity(e,t){if(t.indexOf(`&`)!==-1)throw Error(`Entity value can't have '&'`);if(e.indexOf(`&`)!==-1||e.indexOf(`;`)!==-1)throw Error(`An entity must be set without '&' and ';'. Eg. use '#xD' for '
'`);if(t===`&`)throw Error(`An entity with value '&' is not permitted`);this.externalEntities[e]=t}static getMetaDataSymbol(){return wo.getMetaDataSymbol()}};function ds(e,t){let n=``;return t.format&&t.indentBy.length>0&&(n=`
|
|
187
187
|
`),fs(e,t,``,n)}function fs(e,t,n,r){let i=``,a=!1;for(let o=0;o<e.length;o++){let s=e[o],c=ps(s);if(c===void 0)continue;let l=``;if(l=n.length===0?c:`${n}.${c}`,c===t.textNodeName){let e=s[c];hs(l,t)||(e=t.tagValueProcessor(c,e),e=gs(e,t)),a&&(i+=r),i+=e,a=!1;continue}else if(c===t.cdataPropName){a&&(i+=r),i+=`<![CDATA[${s[c][0][t.textNodeName]}]]>`,a=!1;continue}else if(c===t.commentPropName){i+=r+`<!--${s[c][0][t.textNodeName]}-->`,a=!0;continue}else if(c[0]===`?`){let e=ms(s[`:@`],t),n=c===`?xml`?``:r,o=s[c][0][t.textNodeName];o=o.length===0?``:` `+o,i+=n+`<${c}${o}${e}?>`,a=!0;continue}let u=r;u!==``&&(u+=t.indentBy);let d=r+`<${c}${ms(s[`:@`],t)}`,f=fs(s[c],t,l,u);t.unpairedTags.indexOf(c)===-1?(!f||f.length===0)&&t.suppressEmptyNode?i+=d+`/>`:f&&f.endsWith(`>`)?i+=d+`>${f}${r}</${c}>`:(i+=d+`>`,f&&r!==``&&(f.includes(`/>`)||f.includes(`</`))?i+=r+t.indentBy+f+r:i+=f,i+=`</${c}>`):t.suppressUnpairedNode?i+=d+`>`:i+=d+`/>`,a=!0}return i}function ps(e){let t=Object.keys(e);for(let n=0;n<t.length;n++){let r=t[n];if(e.hasOwnProperty(r)&&r!==`:@`)return r}}function ms(e,t){let n=``;if(e&&!t.ignoreAttributes)for(let r in e){if(!e.hasOwnProperty(r))continue;let i=t.attributeValueProcessor(r,e[r]);i=gs(i,t),i===!0&&t.suppressBooleanAttributes?n+=` ${r.substr(t.attributeNamePrefix.length)}`:n+=` ${r.substr(t.attributeNamePrefix.length)}="${i}"`}return n}function hs(e,t){e=e.substr(0,e.length-t.textNodeName.length-1);let n=e.substr(e.lastIndexOf(`.`)+1);for(let r in t.stopNodes)if(t.stopNodes[r]===e||t.stopNodes[r]===`*.`+n)return!0;return!1}function gs(e,t){if(e&&e.length>0&&t.processEntities)for(let n=0;n<t.entities.length;n++){let r=t.entities[n];e=e.replace(r.regex,r.val)}return e}const _s={attributeNamePrefix:`@_`,attributesGroupName:!1,textNodeName:`#text`,ignoreAttributes:!0,cdataPropName:!1,format:!1,indentBy:` `,suppressEmptyNode:!1,suppressUnpairedNode:!0,suppressBooleanAttributes:!0,tagValueProcessor:function(e,t){return t},attributeValueProcessor:function(e,t){return t},preserveOrder:!1,commentPropName:!1,unpairedTags:[],entities:[{regex:RegExp(`&`,`g`),val:`&`},{regex:RegExp(`>`,`g`),val:`>`},{regex:RegExp(`<`,`g`),val:`<`},{regex:RegExp(`'`,`g`),val:`'`},{regex:RegExp(`"`,`g`),val:`"`}],processEntities:!0,stopNodes:[],oneListGroup:!1};function vs(e){this.options=Object.assign({},_s,e),this.options.ignoreAttributes===!0||this.options.attributesGroupName?this.isAttribute=function(){return!1}:(this.ignoreAttributesFn=Vo(this.options.ignoreAttributes),this.attrPrefixLen=this.options.attributeNamePrefix.length,this.isAttribute=xs),this.processTextOrObjNode=ys,this.options.format?(this.indentate=bs,this.tagEndChar=`>
|
|
188
188
|
`,this.newLine=`
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stackone/transport",
|
|
3
|
-
"version": "2.7.
|
|
3
|
+
"version": "2.7.2",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "dist/index.cjs",
|
|
6
6
|
"module": "dist/index.mjs",
|
|
@@ -41,14 +41,14 @@
|
|
|
41
41
|
"author": "StackOne",
|
|
42
42
|
"license": "ISC",
|
|
43
43
|
"dependencies": {
|
|
44
|
-
"jsonpath-plus": "^10.3.0",
|
|
45
44
|
"@stackone/expressions": "*",
|
|
46
|
-
"@stackone/redaction": "*",
|
|
47
45
|
"@stackone/logger": "*",
|
|
46
|
+
"@stackone/redaction": "*",
|
|
48
47
|
"@stackone/utils": "*",
|
|
49
48
|
"axios": "1.12.0",
|
|
49
|
+
"jsonpath-plus": "10.3.0",
|
|
50
50
|
"qs": "6.14.1",
|
|
51
|
-
"redis": "
|
|
51
|
+
"redis": "4.7.1"
|
|
52
52
|
},
|
|
53
53
|
"tsdown": {
|
|
54
54
|
"dts": true,
|
|
@@ -57,4 +57,4 @@
|
|
|
57
57
|
"cjs"
|
|
58
58
|
]
|
|
59
59
|
}
|
|
60
|
-
}
|
|
60
|
+
}
|