PageSourceSearch

https://www.rba.hr/etc.clientlibs/rbi/clientlibs/clientlib-site/re…/js/chunks/chunk-mathjs.1788431024728.js

js rba.hr collected 2026-09-26 01:41:30 UTC 316,110 bytes, 1 lines download raw bytes

1var e=Math.pow;function t(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function r(e){if(Object.prototype.hasOwnProperty.call(e,"__esModule"))return e;var t=e.default;if("function"==typeof t){var r=function e(){var r=!1;try{r=this instanceof e}catch(n){}return r?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};r.prototype=t.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(e).forEach(function(t){var n=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(r,t,n.get?n:{enumerable:!0,get:function(){return e[t]}})}),r}function n(){return n=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},n.apply(null,arguments)}var i={relTol:1e-12,absTol:1e-15,matrix:"Matrix",number:"number",numberFallback:"number",precision:64,predictable:!1,randomSeed:null,legacySubset:!1};function a(e,t){if(s(e,t)||u(e,t))return e[t];if(c(e,t))throw new Error('Cannot access method "'.concat(t,'" as a property'));if(null==e)throw new TypeError('Cannot access property "'.concat(t,'": object is ').concat(e));throw new Error('No access to property "'+t+'"')}function o(e,t,r){if(s(e,t)||u(e,t))return e[t]=r,r;throw new Error('No access to property "'.concat(t,'"'))}function s(e,t){return!!function(e){return"object"==typeof e&&e&&e.constructor===Object}(e)&&!(t in Object.prototype)}function u(e,t){return!!Array.isArray(e)&&("number"==typeof t||"string"==typeof t&&function(e){return/^\d+$/.test(e)}(t)||"length"===t)}function c(e,t){return null!=e&&"function"==typeof e[t]&&(!(pe(e,t)&&Object.getPrototypeOf&&t in Object.getPrototypeOf(e))&&(!!f.has(t)||!(t in Object.prototype)&&!(t in Function.prototype)))}var f=new Set(["toString","valueOf","toLocaleString"]);class l{constructor(e){this.wrappedObject=e,this[Symbol.iterator]=this.entries}keys(){return Object.keys(this.wrappedObject).filter(e=>this.has(e)).values()}get(e){return a(this.wrappedObject,e)}set(e,t){return o(this.wrappedObject,e,t),this}has(e){return s(this.wrappedObject,e)&&e in this.wrappedObject}entries(){return h(this.keys(),e=>[e,this.get(e)])}forEach(e){for(var t of this.keys())e(this.get(t),t,this)}delete(e){s(this.wrappedObject,e)&&delete this.wrappedObject[e]}clear(){for(var e of this.keys())this.delete(e)}get size(){return Object.keys(this.wrappedObject).length}}class p{constructor(e,t,r){this.a=e,this.b=t,this.bKeys=r,this[Symbol.iterator]=this.entries}get(e){return this.bKeys.has(e)?this.b.get(e):this.a.get(e)}set(e,t){return this.bKeys.has(e)?this.b.set(e,t):this.a.set(e,t),this}has(e){return this.b.has(e)||this.a.has(e)}keys(){return new Set([...this.a.keys(),...this.b.keys()])[Symbol.iterator]()}entries(){return h(this.keys(),e=>[e,this.get(e)])}forEach(e){for(var t of this.keys())e(this.get(t),t,this)}delete(e){return this.bKeys.has(e)?this.b.delete(e):this.a.delete(e)}clear(){this.a.clear(),this.b.clear()}get size(){return[...this.keys()].length}}function h(e,t){return{next:()=>{var r=e.next();return r.done?r:{value:t(r.value),done:!1}}}}function d(){return new Map}function m(e){return"number"==typeof e}function g(e){return!(!e||"object"!=typeof e||"function"!=typeof e.constructor)&&(!0===e.isBigNumber&&"object"==typeof e.constructor.prototype&&!0===e.constructor.prototype.isBigNumber||"function"==typeof e.constructor.isDecimal&&!0===e.constructor.isDecimal(e))}function v(e){return"bigint"==typeof e}function D(e){return e&&"object"==typeof e&&!0===Object.getPrototypeOf(e).isComplex||!1}function y(e){return e&&"object"==typeof e&&!0===Object.getPrototypeOf(e).isFraction||!1}function E(e){return e&&!0===e.constructor.prototype.isUnit||!1}function w(e){return"string"==typeof e}var b=Array.isArray;function x(e){return e&&!0===e.constructor.prototype.isMatrix||!1}function N(e){return Array.isArray(e)||x(e)}function A(e){return e&&e.isDenseMatrix&&!0===e.constructor.prototype.isMatrix||!1}function F(e){return e&&e.isSparseMatrix&&!0===e.constructor.prototype.isMatrix||!1}function C(e){return e&&!0===e.constructor.prototype.isRange||!1}function S(e){return e&&!0===e.constructor.prototype.isIndex||!1}function T(e){return"boolean"==typeof e}function _(e){return e&&!0===e.constructor.prototype.isResultSet||!1}function M(e){return e&&!0===e.constructor.prototype.isHelp||!1}function B(e){return"function"==typeof e}function O(e){return e instanceof Date}function I(e){return e instanceof RegExp}function k(e){return!(!e||"object"!=typeof e||e.constructor!==Object||D(e)||y(e))}function R(e){return!!e&&(e instanceof Map||e instanceof l||"function"==typeof e.set&&"function"==typeof e.get&&"function"==typeof e.keys&&"function"==typeof e.has)}function j(e){return R(e)&&R(e.a)&&R(e.b)}function z(e){return R(e)&&k(e.wrappedObject)}function U(e){return null===e}function P(e){return void 0===e}function L(e){return e&&!0===e.isAccessorNode&&!0===e.constructor.prototype.isNode||!1}function q(e){return e&&!0===e.isArrayNode&&!0===e.constructor.prototype.isNode||!1}function $(e){return e&&!0===e.isAssignmentNode&&!0===e.constructor.prototype.isNode||!1}function H(e){return e&&!0===e.isBlockNode&&!0===e.constructor.prototype.isNode||!1}function G(e){return e&&!0===e.isConditionalNode&&!0===e.constructor.prototype.isNode||!1}function W(e){return e&&!0===e.isConstantNode&&!0===e.constructor.prototype.isNode||!1}function V(e){return W(e)||Q(e)&&1===e.args.length&&W(e.args[0])&&"-+~".includes(e.op)}function Y(e){return e&&!0===e.isFunctionAssignmentNode&&!0===e.constructor.prototype.isNode||!1}function J(e){return e&&!0===e.isFunctionNode&&!0===e.constructor.prototype.isNode||!1}function Z(e){return e&&!0===e.isIndexNode&&!0===e.constructor.prototype.isNode||!1}function X(e){return e&&!0===e.isNode&&!0===e.constructor.prototype.isNode||!1}function K(e){return e&&!0===e.isObjectNode&&!0===e.constructor.prototype.isNode||!1}function Q(e){return e&&!0===e.isOperatorNode&&!0===e.constructor.prototype.isNode||!1}function ee(e){return e&&!0===e.isParenthesisNode&&!0===e.constructor.prototype.isNode||!1}function te(e){return e&&!0===e.isRangeNode&&!0===e.constructor.prototype.isNode||!1}function re(e){return e&&!0===e.isRelationalNode&&!0===e.constructor.prototype.isNode||!1}function ne(e){return e&&!0===e.isSymbolNode&&!0===e.constructor.prototype.isNode||!1}function ie(e){return e&&!0===e.constructor.prototype.isChain||!1}function ae(e){var t=typeof e;return"object"===t?null===e?"null":g(e)?"BigNumber":e.constructor&&e.constructor.name?e.constructor.name:"Object":t}function oe(e){var t=typeof e;if("number"===t||"bigint"===t||"string"===t||"boolean"===t||null==e)return e;if("function"==typeof e.clone)return e.clone();if(Array.isArray(e))return e.map(function(e){return oe(e)});if(e instanceof Date)return new Date(e.valueOf());if(g(e))return e;if(k(e))return function(e,t){var r={};for(var n in e)pe(e,n)&&(r[n]=t(e[n]));return r}(e,oe);if("function"===t)return e;throw new TypeError("Cannot clone: unknown type of value (value: ".concat(e,")"))}function se(e,t){if(Array.isArray(t))throw new TypeError("Arrays are not supported by deepExtend");for(var r in t)if(pe(t,r)&&!(r in Object.prototype)&&!(r in Function.prototype))if(t[r]&&t[r].constructor===Object)void 0===e[r]&&(e[r]={}),e[r]&&e[r].constructor===Object?se(e[r],t[r]):e[r]=t[r];else{if(Array.isArray(t[r]))throw new TypeError("Arrays are not supported by deepExtend");e[r]=t[r]}return e}function ue(e,t){var r,n,i;if(Array.isArray(e)){if(!Array.isArray(t))return!1;if(e.length!==t.length)return!1;for(n=0,i=e.length;n<i;n++)if(!ue(e[n],t[n]))return!1;return!0}if("function"==typeof e)return e===t;if(e instanceof Object){if(Array.isArray(t)||!(t instanceof Object))return!1;for(r in e)if(!(r in t)||!ue(e[r],t[r]))return!1;for(r in t)if(!(r in e))return!1;return!0}return e===t}function ce(e){var t={};return fe(e,t),t}function fe(e,t){for(var r in e)if(pe(e,r)){var n=e[r];
1"object"==typeof n&&null!==n?fe(n,t):t[r]=n}}function le(e,t,r){var n,i=!0;Object.defineProperty(e,t,{get:function(){return i&&(n=r(),i=!1),n},set:function(e){n=e,i=!1},configurable:!0,enumerable:!0})}function pe(e,t){return e&&Object.hasOwnProperty.call(e,t)}var he=["Matrix","Array"],de=["number","BigNumber","bigint","Fraction"];function me(e,t){function r(n){if(n){if(void 0!==n.epsilon){console.warn('Warning: The configuration option "epsilon" is deprecated. Use "relTol" and "absTol" instead.');var i=oe(n);return i.relTol=n.epsilon,i.absTol=.001*n.epsilon,delete i.epsilon,r(i)}!0===n.legacySubset&&console.warn('Warning: The configuration option "legacySubset" is for compatibility only and might be deprecated in the future.');var a=oe(e);ge(n,"matrix",he),ge(n,"number",de),se(e,n);var o=oe(e),s=oe(n);return t("config",o,a,s),o}return oe(e)}return r.MATRIX_OPTIONS=he,r.NUMBER_OPTIONS=de,Object.keys(i).forEach(t=>{Object.defineProperty(r,t,{get:()=>e[t],enumerable:!0,configurable:!0})}),r}function ge(e,t,r){void 0===e[t]||r.includes(e[t])||console.warn('Warning: Unknown value "'+e[t]+'" for configuration option "'+t+'". Available options: '+r.map(e=>JSON.stringify(e)).join(", ")+".")}function ve(){return!0}function De(){return!1}function ye(){}const Ee="Argument is not a typed-function.";const we=function e(){function t(e){return"object"==typeof e&&null!==e&&e.constructor===Object}const r=[{name:"number",test:function(e){return"number"==typeof e}},{name:"string",test:function(e){return"string"==typeof e}},{name:"boolean",test:function(e){return"boolean"==typeof e}},{name:"Function",test:function(e){return"function"==typeof e}},{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:t},{name:"null",test:function(e){return null===e}},{name:"undefined",test:function(e){return void 0===e}}],n={name:"any",test:ve,isAny:!0};let i,a,o=0,s={createCount:0};function u(e){const t=i.get(e);if(t)return t;let r='Unknown type "'+e+'"';const n=e.toLowerCase();let o;for(o of a)if(o.toLowerCase()===n){r+='. Did you mean "'+o+'" ?';break}throw new TypeError(r)}function c(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"any";const r=t?u(t).index:a.length,n=[];for(let a=0;a<e.length;++a){if(!e[a]||"string"!=typeof e[a].name||"function"!=typeof e[a].test)throw new TypeError("Object with properties {name: string, test: function} expected");const t=e[a].name;if(i.has(t))throw new TypeError('Duplicate type name "'+t+'"');n.push(t),i.set(t,{name:t,test:e[a].test,isAny:e[a].isAny,index:r+a,conversionsTo:[]})}const o=a.slice(r);a=a.slice(0,r).concat(n).concat(o);for(let s=r+n.length;s<a.length;++s)i.get(a[s]).index=s}function f(){i=new Map,a=[],o=0,c([n],!1)}function l(e){const t=a.filter(t=>{const r=i.get(t);return!r.isAny&&r.test(e)});return t.length?t:["any"]}function p(e){return e&&"function"==typeof e&&"_typedFunctionData"in e}function h(e,t,r){if(!p(e))throw new TypeError(Ee);const n=r&&r.exact,i=D(Array.isArray(t)?t.join(","):t),a=d(i);if(!n||a in e.signatures){const t=e._typedFunctionData.signatureMap.get(a);if(t)return t}const o=i.length;let s,u;if(n){let t;for(t in s=[],e.signatures)s.push(e._typedFunctionData.signatureMap.get(t))}else s=e._typedFunctionData.signatures;for(let c=0;c<o;++c){const e=i[c],t=[];let r;for(r of s){const n=b(r.params,c);if(n&&(!e.restParam||n.restParam)){if(!n.hasAny){const t=v(n);if(e.types.some(e=>!t.has(e.name)))continue}t.push(r)}}if(s=t,0===s.length)break}for(u of s)if(u.params.length<=o)return u;throw new TypeError("Signature not found (signature: "+(e.name||"unnamed")+"("+d(i,", ")+"))")}function d(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:",";return e.map(e=>e.name).join(t)}function m(e){const t=0===e.indexOf("..."),r=(t?e.length>3?e.slice(3):"any":e).split("|").map(e=>u(e.trim()));let n=!1,i=t?"...":"";return{types:r.map(function(e){return n=e.isAny||n,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:n,hasConversion:!1,restParam:t}}function g(e){const t=function(e){if(0===e.length)return[];const t=e.map(u);if(1===e.length)return t[0].conversionsTo;const r=new Set(e),n=new Set;for(let a=0;a<t.length;++a)for(const e of t[a].conversionsTo)r.has(e.from)||n.add(e.from);const i=[];for(const a of n){let e=o+1,r=null;for(let n=0;n<t.length;++n)for(const i of t[n].conversionsTo)i.from===a&&i.index<e&&(e=i.index,r=i);i.push(r)}return i}(e.types.map(e=>e.name));let r=e.hasAny,n=e.name;const i=t.map(function(e){const t=u(e.from);return r=t.isAny||r,n+="|"+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:n,hasAny:r,hasConversion:i.length>0,restParam:e.restParam}}function v(e){return e.typeSet||(e.typeSet=new Set,e.types.forEac
1h(t=>e.typeSet.add(t.name))),e.typeSet}function D(e){const t=[];if("string"!=typeof e)throw new TypeError("Signatures must be strings");const r=e.trim();if(""===r)return t;const n=r.split(",");for(let i=0;i<n.length;++i){const e=m(n[i].trim());if(e.restParam&&i!==n.length-1)throw new SyntaxError('Unexpected rest parameter "'+n[i]+'": only allowed for the last parameter');if(0===e.types.length)return null;t.push(e)}return t}function y(e){const t=P(e);return!!t&&t.restParam}function E(e){if(e&&0!==e.types.length){if(1===e.types.length)return u(e.types[0].name).test;if(2===e.types.length){const t=u(e.types[0].name).test,r=u(e.types[1].name).test;return function(e){return t(e)||r(e)}}{const t=e.types.map(function(e){return u(e.name).test});return function(e){for(let r=0;r<t.length;r++)if(t[r](e))return!0;return!1}}}return ve}function w(e){let t,r,n;if(y(e)){t=U(e).map(E);const r=t.length,n=E(P(e)),i=function(e){for(let t=r;t<e.length;t++)if(!n(e[t]))return!1;return!0};return function(e){for(let r=0;r<t.length;r++)if(!t[r](e[r]))return!1;return i(e)&&e.length>=r+1}}return 0===e.length?function(e){return 0===e.length}:1===e.length?(r=E(e[0]),function(e){return r(e[0])&&1===e.length}):2===e.length?(r=E(e[0]),n=E(e[1]),function(e){return r(e[0])&&n(e[1])&&2===e.length}):(t=e.map(E),function(e){for(let r=0;r<t.length;r++)if(!t[r](e[r]))return!1;return e.length===t.length})}function b(e,t){return t<e.length?e[t]:y(e)?P(e):null}function x(e,t){const r=b(e,t);return r?v(r):new Set}function N(e){return null===e.conversion||void 0===e.conversion}function A(e,t){const r=new Set;return e.forEach(e=>{const n=x(e.params,t);let i;for(i of n)r.add(i)}),r.has("any")?["any"]:Array.from(r)}function F(e,t,r){let n,i;const a=e||"unnamed";let o,s=r;for(o=0;o<t.length;o++){const e=[];if(s.forEach(r=>{const n=E(b(r.params,o));(o<r.params.length||y(r.params))&&n(t[o])&&e.push(r)}),0===e.length){if(i=A(s,o),i.length>0){const e=l(t[o]);return n=new TypeError("Unexpected type of argument in function "+a+" (expected: "+i.join(" or ")+", actual: "+e.join(" | ")+", index: "+o+")"),n.data={category:"wrongType",fn:a,index:o,actual:e,expected:i},n}}else s=e}const u=s.map(function(e){return y(e.params)?1/0:e.params.length});if(t.length<Math.min.apply(null,u))return i=A(s,o),n=new TypeError("Too few arguments in function "+a+" (expected: "+i.join(" or ")+", index: "+t.length+")"),n.data={category:"tooFewArgs",fn:a,index:t.length,expected:i},n;const c=Math.max.apply(null,u);if(t.length>c)return n=new TypeError("Too many arguments in function "+a+" (expected: "+c+", actual: "+t.length+")"),n.data={category:"tooManyArgs",fn:a,index:t.length,expectedLength:c},n;const f=[];for(let p=0;p<t.length;++p)f.push(l(t[p]).join("|"));return n=new TypeError('Arguments of type "'+f.join(", ")+'" do not match any of the defined signatures of function '+a+"."),n.data={category:"mismatch",actual:f},n}function C(e){let t=a.length+1;for(let r=0;r<e.types.length;r++)t=Math.min(t,e.types[r].typeIndex);return t}function S(e){let t=o+1;for(let r=0;r<e.types.length;r++)N(e.types[r])||(t=Math.min(t,e.types[r].conversionIndex));return t}function T(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;const r=C(e)-C(t);if(r<0)return-.001;if(r>0)return.001;const n=S(e),i=S(t);if(e.hasConversion){if(!t.hasConversion)return 1e-6*(1+n)}else if(t.hasConversion)return 1e-6*-(1+i);const a=n-i;return a<0?-1e-7:a>0?1e-7:0}function _(e,t){const r=e.params,n=t.params,i=P(r),a=P(n),o=y(r),s=y(n);if(o&&i.hasAny){if(!s||!a.hasAny)return 1e7}else if(s&&a.hasAny)return-1e7;let u,c=0,f=0;for(u of r)u.hasAny&&++c,u.hasConversion&&++f;let l=0,p=0;for(u of n)u.hasAny&&++l,u.hasConversion&&++p;if(c!==l)return 1e6*(c-l);if(o&&i.hasConversion){if(!s||!a.hasConversion)return 1e5}else if(s&&a.hasConversion)return-1e5;if(f!==p)return 1e4*(f-p);if(o){if(!s)return 1e3}else if(s)return-1e3;const h=(r.length-n.length)*(o?-100:100);if(0!==h)return h;const d=[];let m,g=0;for(let y=0;y<r.length;++y){const e=T(r[y],n[y]);d.push(e),g+=e}if(0!==g)return(g<0?-10:10)+g;let v=9;const D=v/(d.length+1);for(m of d){if(0!==m)return(m<0?-v:v)+m;v-=D}return 0}function M(e,t){let r=t,n="";if(e.some(e=>e.hasConversion)){const i=y(e),a=e.map(B);n=a.map(e=>e.name).join(";"),r=function(){const e=[],r=i?arguments.length-1:arguments.length;for(let t=0;t<r;t++)e[t]=a[t](arguments[t]);return i&&(e[r]=arguments[r].map(a[r])),t.apply(this,e)}}let i=r;if(y(e)){const t=e.length-1;i=function(){return r.apply(this,L(arguments,0,t).concat([L(arguments,t)]))}}return n&&Object.defineProperty(i,"name",{value:n}),i}function B(e){let t,r,n,i;const a=[],o=[];let s="";
1e.types.forEach(function(e){e.conversion&&(s+=e.conversion.from+"~>"+e.conversion.to+",",a.push(u(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],n=o[0],c=function(e){return t(e)?n(e):e};break;case 2:t=a[0],r=a[1],n=o[0],i=o[1],c=function(e){return t(e)?n(e):r(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 O(e){return function e(t,r,n){if(r<t.length){const o=t[r];let s=[];if(o.restParam){const e=o.types.filter(N);e.length<o.types.length&&s.push({types:e,name:"..."+e.map(e=>e.name).join("|"),hasAny:e.some(e=>e.isAny),hasConversion:!1,restParam:!0}),s.push(o)}else s=o.types.map(function(e){return{types:[e],name:e.name,hasAny:e.isAny,hasConversion:e.conversion,restParam:!1}});return i=s,a=function(i){return e(t,r+1,n.concat([i]))},Array.prototype.concat.apply([],i.map(a))}return[n];var i,a}(e,0,[])}function I(e,t){const r=Math.max(e.length,t.length);for(let s=0;s<r;s++){const r=x(e,s),n=x(t,s);let i,a=!1;for(i of n)if(r.has(i)){a=!0;break}if(!a)return!1}const n=e.length,i=t.length,a=y(e),o=y(t);return a?o?n===i:i>=n:o?n>=i:n===i}function k(e,t,r){const n=[];let i;for(i of e){let e=r[i];if("number"!=typeof e)throw new TypeError('No definition for referenced signature "'+i+'"');if(e=t[e],"function"!=typeof e)return!1;n.push(e)}return n}function R(e,t,r){const n=function(e){return e.map(e=>G(e)?$(e.referToSelf.callback):H(e)?q(e.referTo.references,e.referTo.callback):e)}(e),i=new Array(n.length).fill(!1);let a=!0;for(;a;){a=!1;let e=!0;for(let o=0;o<n.length;++o){if(i[o])continue;const s=n[o];if(G(s))n[o]=s.referToSelf.callback(r),n[o].referToSelf=s.referToSelf,i[o]=!0,e=!1;else if(H(s)){const r=k(s.referTo.references,n,t);r?(n[o]=s.referTo.callback.apply(this,r),n[o].referTo=s.referTo,i[o]=!0,e=!1):a=!0}}if(e&&a)throw new SyntaxError("Circular reference detected in resolving typed.referTo")}return n}function j(e,t){if(s.createCount++,0===Object.keys(t).length)throw new SyntaxError("No signatures provided");s.warnAgainstDeprecatedThis&&function(e){const t=/\bthis(\(|\.signatures\b)/;Object.keys(e).forEach(r=>{const n=e[r];if(t.test(n.toString()))throw new SyntaxError("Using `this` to self-reference a function is deprecated since typed-function@3. Use typed.referTo and typed.referToSelf instead.")})}(t);const r=[],n=[],i={},a=[];let o;for(o in t){if(!Object.prototype.hasOwnProperty.call(t,o))continue;const e=D(o);if(!e)continue;r.forEach(function(t){if(I(t,e))throw new TypeError('Conflicting signatures "'+d(t)+'" and "'+d(e)+'".')}),r.push(e);const s=n.length;n.push(t[o]);const u=e.map(g);let c;for(c of O(u)){const e=d(c);a.push({params:c,name:e,fn:s}),c.every(e=>!e.hasConversion)&&(i[e]=s)}}a.sort(_);const u=R(n,i,ae);let c;for(c in i)Object.prototype.hasOwnProperty.call(i,c)&&(i[c]=u[i[c]]);const f=[],l=new Map;for(c of a)l.has(c.name)||(c.fn=u[c.fn],f.push(c),l.set(c.name,c));const p=f[0]&&f[0].params.length<=2&&!y(f[0].params),h=f[1]&&f[1].params.length<=2&&!y(f[1].params),m=f[2]&&f[2].params.length<=2&&!y(f[2].params),v=f[3]&&f[3].params.length<=2&&!y(f[3].params),b=f[4]&&f[4].params.length<=2&&!y(f[4].params),x=f[5]&&f[5].params.length<=2&&!y(f[5].params),N=p&&h&&m&&v&&b&&x;for(let s=0;s<f.length;++s)f[s].test=w(f[s].params);const A=p?E(f[0].params[0]):De,F=h?E(f[1].params[0]):De,C=m?E(f[2].params[0]):De,S=v?E(f[3].params[0]):De,T=b?E(f[4].params[0]):De,B=x?E(f[5].params[0]):De,k=p?E(f[0].params[1]):De,j=h?E(f[1].params[1]):De,z=m?E(f[2].params[1]):De,U=v?E(f[3].params[1]):De,P=b?E(f[4].params[1]):De,L=x?E(f[5].params[1]):De;for(let s=0;s<f.length;++s)f[s].implementation=M(f[s].params,f[s].fn);const q=p?f[0].implementation:ye,$=h?f[1].implementation:ye,H=m?f[2].implementation:ye,G=v?f[3].implementation:ye,W=b?f[4].implementation:ye,V=x?f[5].implementation:ye,Y=p?f[0].params.length:-1,J=h?f[1].params.length:-1,Z=m?f[2].params.length:-1,X=v?f[3].params.length:-1,K=b?f[4].params.length:-1,Q=x?f[5].params.length:-1,ee=N?6:0,te=f.length,re=f.map(e=>e.test),ne=f.map(e=>e.implementation),ie=function(){for(let e=ee;e<te;e++)if(re[e](arguments))return ne[e].apply(this,arguments);return s.onMismatch(e,arguments,f)};function ae(e,t){return arguments.length===Y&&A(e)&&k(t)?q.apply(this,arguments):arguments.length===J&&F(e)&&j(t)?$.apply(this,arguments):arguments.length===Z&&C(e)&&z(t)?H.apply(this,arguments):arguments.length===X&&S(e)&&U(t)?G.apply(this,arguments):arguments.length===K&&T(e)&&P(t)?W.apply(this,arguments):arguments.length===Q&&B(e)&&L(t)?V.apply(this,arguments):ie.apply(this,arguments)}try{Object.defineProperty(ae,"name",{value:e})}catch(oe){}
1return ae.signatures=i,ae._typedFunctionData={signatures:f,signatureMap:l},ae}function z(e,t,r){throw F(e,t,r)}function U(e){return L(e,0,e.length-1)}function P(e){return e[e.length-1]}function L(e,t,r){return Array.prototype.slice.call(e,t,r)}function q(e,t){return{referTo:{references:e,callback:t}}}function $(e){if("function"!=typeof e)throw new TypeError("Callback function expected as first argument");return{referToSelf:{callback:e}}}function H(e){return e&&"object"==typeof e.referTo&&Array.isArray(e.referTo.references)&&"function"==typeof e.referTo.callback}function G(e){return e&&"object"==typeof e.referToSelf&&"function"==typeof e.referToSelf.callback}function W(e,t){if(!e)return t;if(t&&t!==e){const r=new Error("Function names do not match (expected: "+e+", actual: "+t+")");throw r.data={actual:t,expected:e},r}return e}function V(e){let t;for(const r in e)Object.prototype.hasOwnProperty.call(e,r)&&(p(e[r])||"string"==typeof e[r].signature)&&(t=W(t,e[r].name));return t}function Y(e,t){let r;for(r in t)if(Object.prototype.hasOwnProperty.call(t,r)){if(r in e&&t[r]!==e[r]){const n=new Error('Signature "'+r+'" is defined twice');throw n.data={signature:r,sourceFunction:t[r],destFunction:e[r]},n}e[r]=t[r]}}f(),c(r);const J=s;function Z(e){if(!e||"string"!=typeof e.from||"string"!=typeof e.to||"function"!=typeof e.convert)throw new TypeError("Object with properties {from: string, to: string, convert: function} expected");if(e.to===e.from)throw new SyntaxError('Illegal to define conversion from "'+e.from+'" to itself.')}return s=function(e){const r="string"==typeof e;let n=r?e:"";const i={};for(let a=r?1:0;a<arguments.length;++a){const e=arguments[a];let o,s={};if("function"==typeof e?(o=e.name,"string"==typeof e.signature?s[e.signature]=e:p(e)&&(s=e.signatures)):t(e)&&(s=e,r||(o=V(e))),0===Object.keys(s).length){const t=new TypeError("Argument to 'typed' at index "+a+" is not a (typed) function, nor an object with signatures as keys and functions as values.");throw t.data={index:a,argument:e},t}r||(n=W(n,o)),Y(i,s)}return j(n||"",i)},s.create=e,s.createCount=J.createCount,s.onMismatch=z,s.throwMismatchError=z,s.createError=F,s.clear=f,s.clearConversions=function(){let e;for(e of a)i.get(e).conversionsTo=[];o=0},s.addTypes=c,s._findType=u,s.referTo=function(){const e=U(arguments).map(e=>d(D(e))),t=P(arguments);if("function"!=typeof t)throw new TypeError("Callback function expected as last argument");return q(e,t)},s.referToSelf=$,s.convert=function(e,t){const r=u(t);if(r.test(e))return e;const n=r.conversionsTo;if(0===n.length)throw new Error("There are no conversions to "+t+" defined.");for(let i=0;i<n.length;i++){if(u(n[i].from).test(e))return n[i].convert(e)}throw new Error("Cannot convert "+e+" to "+t)},s.findSignature=h,s.find=function(e,t,r){return h(e,t,r).implementation},s.isTypedFunction=p,s.warnAgainstDeprecatedThis=!0,s.addType=function(e,t){let r="any";!1!==t&&i.has("Object")&&(r="Object"),s.addTypes([e],r)},s.addConversion=function(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{override:!1};Z(e);const r=u(e.to),n=r.conversionsTo.find(t=>t.from===e.from);if(n){if(!t||!t.override)throw new Error('There is already a conversion from "'+e.from+'" to "'+r.name+'"');s.removeConversion({from:n.from,to:e.to,convert:n.convert})}r.conversionsTo.push({from:e.from,to:r.name,convert:e.convert,index:o++})},s.addConversions=function(e,t){e.forEach(e=>s.addConversion(e,t))},s.removeConversion=function(e){Z(e);const t=u(e.to),r=function(e,t){for(let r=0;r<e.length;r++)if(t(e[r]))return e[r]}(t.conversionsTo,t=>t.from===e.from);if(!r)throw new Error("Attempt to remove nonexistent conversion from "+e.from+" to "+e.to);if(r.convert!==e.convert)throw new Error("Conversion to remove does not match existing conversion");const n=t.conversionsTo.indexOf(r);t.conversionsTo.splice(n,1)},s.resolve=function(e,t){if(!p(e))throw new TypeError(Ee);const r=e._typedFunctionData.signatures;for(let n=0;n<r.length;++n)if(r[n].test(t))return r[n];return null},s}();function be(e,t,r,n){function i(n){var i=function(e,t){for(var r={},n=0;n<t.length;n++){var i=t[n],a=e[i];void 0!==a&&(r[i]=a)}return r}(n,t.map(Ne));return function(e,t,r){var n=t.filter(e=>!function(e){return e&&"?"===e[0]}(e)).every(e=>void 0!==r[e]);if(!n){var i=t.filter(e=>void 0===r[e]);throw new Error('Cannot create function "'.concat(e,'", ')+"some dependencies are missing: ".concat(i.map(e=>'"'.concat(e,'"')).join(", "),"."))}}
1(e,t,n),r(i)}return i.isFactory=!0,i.fn=e,i.dependencies=t.slice().sort(),n&&(i.meta=n),i}function xe(e){return"function"==typeof e&&"string"==typeof e.fn&&Array.isArray(e.dependencies)}function Ne(e){return e&&"?"===e[0]?e.slice(1):e}function Ae(e){return"boolean"==typeof e||!!Number.isFinite(e)&&e===Math.round(e)}function Fe(t,r,n){var i={2:"0b",8:"0o",16:"0x"}[r],a="";if(n){if(n<1)throw new Error("size must be in greater than 0");if(!Ae(n))throw new Error("size must be an integer");if(t>e(2,n-1)-1||t<-e(2,n-1))throw new Error("Value must be in range [-2^".concat(n-1,", 2^").concat(n-1,"-1]"));if(!Ae(t))throw new Error("Value must be an integer");t<0&&(t+=e(2,n)),a="i".concat(n)}var o="";return t<0&&(t=-t,o="-"),"".concat(o).concat(i).concat(t.toString(r)).concat(a)}function Ce(e,t){if("function"==typeof t)return t(e);if(e===1/0)return"Infinity";if(e===-1/0)return"-Infinity";if(isNaN(e))return"NaN";var{notation:r,precision:n,wordSize:i}=Se(t);switch(r){case"fixed":return _e(e,n);case"exponential":return Me(e,n);case"engineering":return function(e,t){if(isNaN(e)||!Number.isFinite(e))return String(e);var r=Te(e),n=Be(r,t),i=n.exponent,a=n.coefficients,o=i%3==0?i:i<0?i-3-i%3:i-i%3;if(m(t))for(;t>a.length||i-o+1>a.length;)a.push(0);else for(var s=Math.abs(i-o)-(a.length-1),u=0;u<s;u++)a.push(0);var c=Math.abs(i-o),f=1;for(;c>0;)f++,c--;var l=a.slice(f).join(""),p=m(t)&&l.length||l.match(/[1-9]/)?"."+l:"",h=a.slice(0,f).join("")+p+"e"+(i>=0?"+":"")+o.toString();return n.sign+h}(e,n);case"bin":return Fe(e,2,i);case"oct":return Fe(e,8,i);case"hex":return Fe(e,16,i);case"auto":return function(e,t,r){if(isNaN(e)||!Number.isFinite(e))return String(e);var n=Re(null==r?void 0:r.lowerExp,-3),i=Re(null==r?void 0:r.upperExp,5),a=Te(e),o=t?Be(a,t):a;if(o.exponent<n||o.exponent>=i)return Me(e,t);var s=o.coefficients,u=o.exponent;s.length<t&&(s=s.concat(Oe(t-s.length))),s=s.concat(Oe(u-s.length+1+(s.length<t?t-s.length:0)));var c=u>0?u:0;return c<(s=Oe(-u).concat(s)).length-1&&s.splice(c+1,0,"."),o.sign+s.join("")}(e,n,t).replace(/((\.\d*?)(0+))($|e)/,function(){var e=arguments[2],t=arguments[4];return"."!==e?e+t:t});default:throw new Error('Unknown notation "'+r+'". Choose "auto", "exponential", "fixed", "bin", "oct", or "hex.')}}function Se(e){var t,r,n="auto";if(void 0!==e)if(m(e))t=e;else if(g(e))t=e.toNumber();else{if(!k(e))throw new Error("Unsupported type of options, number, BigNumber, or object expected");void 0!==e.precision&&(t=ke(e.precision,()=>{throw new Error('Option "precision" must be a number or BigNumber')})),void 0!==e.wordSize&&(r=ke(e.wordSize,()=>{throw new Error('Option "wordSize" must be a number or BigNumber')})),e.notation&&(n=e.notation)}return{notation:n,precision:t,wordSize:r}}function Te(e){var t=String(e).toLowerCase().match(/^(-?)(\d+\.?\d*)(e([+-]?\d+))?$/);if(!t)throw new SyntaxError("Invalid number "+e);var r=t[1],n=t[2],i=parseFloat(t[4]||"0"),a=n.indexOf(".");i+=-1!==a?a-1:n.length-1;var o=n.replace(".","").replace(/^0*/,function(e){return i-=e.length,""}).replace(/0*$/,"").split("").map(function(e){return parseInt(e)});return 0===o.length&&(o.push(0),i++),{sign:r,coefficients:o,exponent:i}}function _e(e,t){if(isNaN(e)||!Number.isFinite(e))return String(e);var r=Te(e),n="number"==typeof t?Be(r,r.exponent+1+t):r,i=n.coefficients,a=n.exponent+1,o=a+(t||0);return i.length<o&&(i=i.concat(Oe(o-i.length))),a<0&&(i=Oe(1-a).concat(i),a=1),a<i.length&&i.splice(a,0,0===a?"0.":"."),n.sign+i.join("")}function Me(e,t){if(isNaN(e)||!Number.isFinite(Number(e)))return String(e);var r=Te(e),n=t?Be(r,t):r,i=n.coefficients,a=n.exponent;i.length<t&&(i=i.concat(Oe(t-i.length)));var o=i.shift();return n.sign+o+(i.length>0?"."+i.join(""):"")+"e"+(a>=0?"+":"")+a}function Be(e,t){for(var r={sign:e.sign,coefficients:e.coefficients,exponent:e.exponent},n=r.coefficients;t<=0;)n.unshift(0),r.exponent++,t++;if(n.length>t&&n.splice(t,n.length-t)[0]>=5){var i=t-1;for(n[i]++;10===n[i];)n.pop(),0===i&&(n.unshift(0),r.exponent++,i++),n[--i]++}return r}function Oe(e){for(var t=[],r=0;r<e;r++)t.push(0);return t}function Ie(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1e-8,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;
1if(r<=0)throw new Error("Relative tolerance must be greater than 0");if(n<0)throw new Error("Absolute tolerance must be at least 0");return!isNaN(e)&&!isNaN(t)&&(Number.isFinite(e)&&Number.isFinite(t)?e===t||Math.abs(e-t)<=Math.max(r*Math.max(Math.abs(e),Math.abs(t)),n):e===t)}function ke(e,t){return m(e)?e:g(e)?e.toNumber():void t()}function Re(e,t){return m(e)?e:g(e)?e.toNumber():t}var je=function(){return je=we.create,we},ze=be("typed",["?BigNumber","?Complex","?DenseMatrix","?Fraction"],function(e){var{BigNumber:t,Complex:r,DenseMatrix:n,Fraction:i}=e,a=je();return a.clear(),a.addTypes([{name:"number",test:m},{name:"Complex",test:D},{name:"BigNumber",test:g},{name:"bigint",test:v},{name:"Fraction",test:y},{name:"Unit",test:E},{name:"identifier",test:e=>w&&/^(?:[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-\u088F\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\u0C5C\u0C5D\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDC-\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-\u1C8A\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-\uA7DC\uA7F1-\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\uFB
1D3-\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\uDDC0-\uDDF3\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\uDD40-\uDD59\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\uDD4A-\uDD65\uDD6F-\uDD85\uDE80-\uDEA9\uDEB0\uDEB1\uDEC2-\uDEC7\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\uDF80-\uDF89\uDF8B\uDF8E\uDF90-\uDFB5\uDFB7\uDFD1\uDFD3]|\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\uDFC0-\uDFE0]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD89\uDD98\uDDB0-\uDDDB\uDEE0-\uDEF2\uDF02\uDF04-\uDF10\uDF12-\uDF33\uDFB0]|\uD808[\uDC00-\uDF99]|\uD809[\uDC80-\uDD43]|\uD80B[\uDF90-\uDFF0]|[\uD80C\uD80E\uD80F\uD81C-\uD822\uD840-\uD868\uD86A-\uD86D\uD86F-\uD872\uD874-\uD879\uD880-\uD883\uD885-\uD88C][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2F\uDC41-\uDC46\uDC60-\uDFFF]|\uD810[\uDC00-\uDFFA]|\uD811[\uDC00-\uDE46]|\uD818[\uDD00-\uDD1D]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE70-\uDEBE\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDD40-\uDD6C\uDE40-\uDE7F\uDEA0-\uDEB8\uDEBB-\uDED3\uDF00-\uDF4A\uDF50\uDF93-\uDF9F\uDFE0\uDFE1\uDFE3\uDFF2\uDFF3]|\uD823[\uDC00-\uDCD5\uDCFF-\uDD1E\uDD80-\uDDF2]|\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\uDDD0-\uDDED\uDDF0\uDEC0-\uDEDE\uDEE0-\uDEE2\uDEE4\uDEE5\uDEE7-\uDEED\uDEF0-\uDEF4\uDEFE\uDEFF\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]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEAD\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0\uDFF0-\uDFFF]|\uD87B[\uDC00-\uDE5D]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A\uDF50-\uDFFF]|\uD88D[\uDC00-\uDC79])(?:[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-\u088F\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\u0C5C\u0C5D\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDC-\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\u
10EB3\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-\u1C8A\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-\uA7DC\uA7F1-\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\uDDC0-\uDDF3\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\uDD40-\uDD59\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\uDD4A-\uDD65\uDD6F-\uDD85\uDE80-\uDEA9\uDEB0\uDEB1\uDEC2-\uDEC7\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\uDF80-\uDF89\uDF8B\uDF8E\uDF90-\uDFB5\uDFB7\uDFD1\uDFD3]|\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\uDFC0-\uDFE0]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD89\uDD98\uDDB0-\uDDDB\uDEE0-\uDEF2\uDF02\uDF04-\uDF10\uDF12-\uDF33\uDFB0]|\uD808[\uDC00-\uDF99]|\uD809[\uDC80-\uDD43]|\uD80B[\uDF90-\uDFF0]|[\uD80C\uD80E\uD80F\uD81C-\uD822\uD840-\uD868\uD86A-\uD86D\uD86F-\uD872\uD874-\uD879\uD880-\uD883\uD885-\uD88C][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2F\uDC41-\uDC46\uDC60-\uDFFF]|\uD810[\uDC00-\uDFFA]|\uD811[\uDC00-\uDE46]|\uD818[\uDD00-\uDD1D]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE70-\uDEBE\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDD40-\uDD6C\uDE4
10-\uDE7F\uDEA0-\uDEB8\uDEBB-\uDED3\uDF00-\uDF4A\uDF50\uDF93-\uDF9F\uDFE0\uDFE1\uDFE3\uDFF2\uDFF3]|\uD823[\uDC00-\uDCD5\uDCFF-\uDD1E\uDD80-\uDDF2]|\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\uDDD0-\uDDED\uDDF0\uDEC0-\uDEDE\uDEE0-\uDEE2\uDEE4\uDEE5\uDEE7-\uDEED\uDEF0-\uDEF4\uDEFE\uDEFF\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]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEAD\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0\uDFF0-\uDFFF]|\uD87B[\uDC00-\uDE5D]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A\uDF50-\uDFFF]|\uD88D[\uDC00-\uDC79])*$/.test(e)},{name:"string",test:w},{name:"Chain",test:ie},{name:"Array",test:b},{name:"Matrix",test:x},{name:"DenseMatrix",test:A},{name:"SparseMatrix",test:F},{name:"Range",test:C},{name:"Index",test:S},{name:"boolean",test:T},{name:"ResultSet",test:_},{name:"Help",test:M},{name:"function",test:B},{name:"Date",test:O},{name:"RegExp",test:I},{name:"null",test:U},{name:"undefined",test:P}
1,{name:"AccessorNode",test:L},{name:"ArrayNode",test:q},{name:"AssignmentNode",test:$},{name:"BlockNode",test:H},{name:"ConditionalNode",test:G},{name:"ConstantNode",test:W},{name:"FunctionNode",test:J},{name:"FunctionAssignmentNode",test:Y},{name:"IndexNode",test:Z},{name:"Node",test:X},{name:"ObjectNode",test:K},{name:"OperatorNode",test:Q},{name:"ParenthesisNode",test:ee},{name:"RangeNode",test:te},{name:"RelationalNode",test:re},{name:"SymbolNode",test:ne},{name:"Map",test:R},{name:"Object",test:k}]),a.addConversions([{from:"number",to:"BigNumber",convert:function(e){if(t||Ue(e),e.toExponential().replace(/e.*$/,"").replace(/^0\.?0*|\./,"").length>15)throw new 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 r||Pe(e),new r(e,0)}},{from:"BigNumber",to:"Complex",convert:function(e){return r||Pe(e),new r(e.toNumber(),0)}},{from:"bigint",to:"number",convert:function(e){if(e>Number.MAX_SAFE_INTEGER)throw new TypeError("Cannot implicitly convert bigint to number: value exceeds the max safe integer value (value: "+e+")");return Number(e)}},{from:"bigint",to:"BigNumber",convert:function(e){return t||Ue(e),new t(e.toString())}},{from:"bigint",to:"Fraction",convert:function(e){return i||Le(e),new i(e)}},{from:"Fraction",to:"BigNumber",convert:function(e){throw new 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 r||Pe(e),new r(e.valueOf(),0)}},{from:"number",to:"Fraction",convert:function(e){i||Le(e);var t=new i(e);if(t.valueOf()!==e)throw new 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 new Error('Cannot convert "'+e+'" to a number');return t}},{from:"string",to:"BigNumber",convert:function(e){t||Ue(e);try{return new t(e)}catch(r){throw new Error('Cannot convert "'+e+'" to BigNumber')}}},{from:"string",to:"bigint",convert:function(e){try{return BigInt(e)}catch(t){throw new Error('Cannot convert "'+e+'" to BigInt')}}},{from:"string",to:"Fraction",convert:function(e){i||Le(e);try{return new i(e)}catch(t){throw new Error('Cannot convert "'+e+'" to Fraction')}}},{from:"string",to:"Complex",convert:function(e){r||Pe(e);try{return new r(e)}catch(t){throw new Error('Cannot convert "'+e+'" to Complex')}}},{from:"boolean",to:"number",convert:function(e){return+e}},{from:"boolean",to:"BigNumber",convert:function(e){return t||Ue(e),new t(+e)}},{from:"boolean",to:"bigint",convert:function(e){return BigInt(+e)}},{from:"boolean",to:"Fraction",convert:function(e){return i||Le(e),new i(+e)}},{from:"boolean",to:"string",convert:function(e){return String(e)}},{from:"Array",to:"Matrix",convert:function(e){return n||function(){throw new Error("Cannot convert array into a Matrix: no class 'DenseMatrix' provided")}(),new n(e)}},{from:"Matrix",to:"Array",convert:function(e){return e.valueOf()}}]),a.onMismatch=(e,t,r)=>{var n=a.createError(e,t,r);if(["wrongType","mismatch"].includes(n.data.category)&&1===t.length&&N(t[0])&&r.some(e=>!e.params.includes(","))){var i=new TypeError("Function '".concat(e,"' doesn't apply to matrices. To call it ")+"elementwise on a matrix 'M', try 'map(M, ".concat(e,")'."));throw i.data=n.data,i}throw n},a.onMismatch=(e,t,r)=>{var n=a.createError(e,t,r);if(["wrongType","mismatch"].includes(n.data.category)&&1===t.length&&N(t[0])&&r.some(e=>!e.params.includes(","))){var i=new TypeError("Function '".concat(e,"' doesn't apply to matrices. To call it ")+"elementwise on a matrix 'M', try 'map(M, ".concat(e,")'."));throw i.data=n.data,i}throw n},a});function Ue(e){throw new Error("Cannot convert value ".concat(e," into a BigNumber: no class 'BigNumber' provided"))}function Pe(e){throw new Error("Cannot convert value ".concat(e," into a Complex number: no class 'Complex' provided"))}function Le(e){throw new Error("Cannot convert value ".concat(e," into a Fraction, no class 'Fraction' provided."))}var qe,$e,He=be("ResultSet",[],()=>{function e(t){if(!(this instanceof e))throw new SyntaxError("Constructor must be called with the new operator");this.entries=t||[]}return e.prototype.type="ResultSet",e.prototype.isResultSet=!0,e.prototype.valueOf=function(){return this.entries},e.prototype.toString=function(){return"["+this.entries.map(String).join(", ")+"]"},e.prototype.toJSON=function(){return{mathjs:"ResultSet",entries:this.entries}},e.fromJSON=function(t){return new e(t.entries)},e},{isClass:!0}),Ge=9e15,We=1e9,Ve="0123456789abcdef",Ye="2.3025850929940456840179914546843642076011014886287729760333279009675726096773524802359972050895982983419677840422862486334095254650828067566662873690987816894829072083255546808437998948262331985283935053089653777326288461633662222876982198867465436674744042432743651550489343149393914796194044002221051017141748003688084012647080685567743216228355220114804663715659121373450747856947683463616792101806445070648000277502684916746550586856935673420670581136429224554405758925724208241314695689016758940256776311356919292033376587141660230105703089634572075440370847469940168269282808481184289314848524948644871927809676271275775397027668605952496716674183485704422507197965004714951050492214776567636938662976979522110718264549734772662425709429322582798502585509785265383207606726317164309505995087807523710333101197857547331541421808427543863591778117054309827482385045648019095610299291824318237525357709750539565187697510374970888692180205189339507238539205144634197265287286965110862571492198849978748873771345686209167058",Je="3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679821480865132823
1066470938446095505822317253594081284811174502841027019385211055596446229489549303819644288109756659334461284756482337867831652712019091456485669234603486104543266482133936072602491412737245870066063155881748815209209628292540917153643678925903600113305305488204665213841469519415116094330572703657595919530921861173819326117931051185480744623799627495673518857527248912279381830119491298336733624406566430860213949463952247371907021798609437027705392171762931767523846748184676694051320005681271452635608277857713427577896091736371787214684409012249534301465495853710507922796892589235420199561121290219608640344181598136297747713099605187072113499999983729780499510597317328160963185950244594553469083026425223082533446850352619311881710100031378387528865875332083814206171776691473035982534904287554687311595628638823537875937519577818577805321712268066130019278766111959092164201989380952572010654858632789",Ze={precision:20,rounding:4,modulo:1,toExpNeg:-7,toExpPos:21,minE:-Ge,maxE:Ge,crypto:!1},Xe=!0,Ke="[DecimalError] ",Qe=Ke+"Invalid argument: ",et=Ke+"Precision limit exceeded",tt=Ke+"crypto unavailable",rt="[object Decimal]",nt=Math.floor,it=Math.pow,at=/^0b([01]+(\.[01]*)?|\.[01]+)(p[+-]?\d+)?$/i,ot=/^0x([0-9a-f]+(\.[0-9a-f]*)?|\.[0-9a-f]+)(p[+-]?\d+)?$/i,st=/^0o([0-7]+(\.[0-7]*)?|\.[0-7]+)(p[+-]?\d+)?$/i,ut=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,ct=1e7,ft=Ye.length-1,lt=Je.length-1,pt={toStringTag:rt};function ht(e){var t,r,n,i=e.length-1,a="",o=e[0];if(i>0){for(a+=o,t=1;t<i;t++)(r=7-(n=e[t]+"").length)&&(a+=Nt(r)),a+=n;(r=7-(n=(o=e[t])+"").length)&&(a+=Nt(r))}else if(0===o)return"0";for(;o%10==0;)o/=10;return a+o}function dt(e,t,r){if(e!==~~e||e<t||e>r)throw Error(Qe+e)}function mt(e,t,r,n){var i,a,o,s;for(a=e[0];a>=10;a/=10)--t;return--t<0?(t+=7,i=0):(i=Math.ceil((t+1)/7),t%=7),a=it(10,7-t),s=e[i]%a|0,null==n?t<3?(0==t?s=s/100|0:1==t&&(s=s/10|0),o=r<4&&99999==s||r>3&&49999==s||5e4==s||0==s):o=(r<4&&s+1==a||r>3&&s+1==a/2)&&(e[i+1]/a/100|0)==it(10,t-2)-1||(s==a/2||0==s)&&!(e[i+1]/a/100|0):t<4?(0==t?s=s/1e3|0:1==t?s=s/100|0:2==t&&(s=s/10|0),o=(n||r<4)&&9999==s||!n&&r>3&&4999==s):o=((n||r<4)&&s+1==a||!n&&r>3&&s+1==a/2)&&(e[i+1]/a/1e3|0)==it(10,t-3)-1,o}function gt(e,t,r){for(var n,i,a=[0],o=0,s=e.length;o<s;){for(i=a.length;i--;)a[i]*=t;for(a[0]+=Ve.indexOf(e.charAt(o++)),n=0;n<a.length;n++)a[n]>r-1&&(void 0===a[n+1]&&(a[n+1]=0),a[n+1]+=a[n]/r|0,a[n]%=r)}return a.reverse()}pt.absoluteValue=pt.abs=function(){var e=new this.constructor(this);return e.s<0&&(e.s=1),Dt(e)},pt.ceil=function(){return Dt(new this.constructor(this),this.e+1,2)},pt.clampedTo=pt.clamp=function(e,t){var r=this,n=r.constructor;if(e=new n(e),t=new n(t),!e.s||!t.s)return new n(NaN);if(e.gt(t))throw Error(Qe+t);return r.cmp(e)<0?e:r.cmp(t)>0?t:new n(r)},pt.comparedTo=pt.cmp=function(e){var t,r,n,i,a=this,o=a.d,s=(e=new a.constructor(e)).d,u=a.s,c=e.s;if(!o||!s)return u&&c?u!==c?u:o===s?0:!o^u<0?1:-1:NaN;if(!o[0]||!s[0])return o[0]?u:s[0]?-c:0;if(u!==c)return u;if(a.e!==e.e)return a.e>e.e^u<0?1:-1;for(t=0,r=(n=o.length)<(i=s.length)?n:i;t<r;++t)if(o[t]!==s[t])return o[t]>s[t]^u<0?1:-1;return n===i?0:n>i^u<0?1:-1},pt.cosine=pt.cos=function(){var e,t,r=this,n=r.constructor;return r.d?r.d[0]?(e=n.precision,t=n.rounding,n.precision=e+Math.max(r.e,r.sd())+7,n.rounding=1,r=function(e,t){var r,n,i;if(t.isZero())return t;n=t.d.length,n<32?i=(1/Ot(4,r=Math.ceil(n/3))).toString():(r=16,i="2.3283064365386962890625e-10");e.precision+=r,t=Bt(e,1,t.times(i),new e(1));for(var a=r;a--;){var o=t.times(t);t=o.times(o).minus(o).times(8).plus(1)}return e.precision-=r,t}(n,It(n,r)),n.precision=e,n.rounding=t,Dt(2==$e||3==$e?r.neg():r,e,t,!0)):new n(1):new n(NaN)},pt.cubeRoot=pt.cbrt=function(){var e,t,r,n,i,a,o,s,u,c,f=this,l=f.constructor;if(!f.isFinite()||f.isZero())return new l(f);for(Xe=!1,(a=f.s*it(f.s*f,1/3))&&Math.abs(a)!=1/0?n=new l(a.toString()):(r=ht(f.d),(a=((e=f.e)-r.length+1)%3)&&(r+=1==a||-2==a?"0":"00"),a=it(r,1/3),e=nt((e+1)/3)-(e%3==(e<0?-1:2)),(n=new l(r=a==1/0?"5e"+e:(r=a.toExponential()).slice(0,r.indexOf("e")+1)+e)).s=f.s),o=(e=l.precision)+3;;)if(c=(u=(s=n).times(s).times(s)).plus(f),n=vt(c.plus(f).times(s),c.plus(u),o+2,1),ht(s.d).slice(0,o)===(r=ht(n.d)).slice(0,o)){if
vendor: 22,970 bytes, line 1
1("9999"!=(r=r.slice(o-3,o+1))&&(i||"4999"!=r)){+r&&(+r.slice(1)||"5"!=r.charAt(0))||(Dt(n,e+1,1),t=!n.times(n).times(n).eq(f));break}if(!i&&(Dt(s,e+1,0),s.times(s).times(s).eq(f))){n=s;break}o+=4,i=1}return Xe=!0,Dt(n,e,l.rounding,t)},pt.decimalPlaces=pt.dp=function(){var e,t=this.d,r=NaN;if(t){if(r=7*((e=t.length-1)-nt(this.e/7)),e=t[e])for(;e%10==0;e/=10)r--;r<0&&(r=0)}return r},pt.dividedBy=pt.div=function(e){return vt(this,new this.constructor(e))},pt.dividedToIntegerBy=pt.divToInt=function(e){var t=this.constructor;return Dt(vt(this,new t(e),0,1,1),t.precision,t.rounding)},pt.equals=pt.eq=function(e){return 0===this.cmp(e)},pt.floor=function(){return Dt(new this.constructor(this),this.e+1,3)},pt.greaterThan=pt.gt=function(e){return this.cmp(e)>0},pt.greaterThanOrEqualTo=pt.gte=function(e){var t=this.cmp(e);return 1==t||0===t},pt.hyperbolicCosine=pt.cosh=function(){var e,t,r,n,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;r=o.precision,n=o.rounding,o.precision=r+Math.max(a.e,a.sd())+4,o.rounding=1,(i=a.d.length)<32?t=(1/Ot(4,e=Math.ceil(i/3))).toString():(e=16,t="2.3283064365386962890625e-10"),a=Bt(o,1,a.times(t),new o(1),!0);for(var u,c=e,f=new o(8);c--;)u=a.times(a),a=s.minus(u.times(f.minus(u.times(f))));return Dt(a,o.precision=r,o.rounding=n,!0)},pt.hyperbolicSine=pt.sinh=function(){var e,t,r,n,i=this,a=i.constructor;if(!i.isFinite()||i.isZero())return new a(i);if(t=a.precision,r=a.rounding,a.precision=t+Math.max(i.e,i.sd())+4,a.rounding=1,(n=i.d.length)<3)i=Bt(a,2,i,i,!0);else{e=(e=1.4*Math.sqrt(n))>16?16:0|e,i=Bt(a,2,i=i.times(1/Ot(5,e)),i,!0);for(var o,s=new a(5),u=new a(16),c=new a(20);e--;)o=i.times(i),i=i.times(s.plus(o.times(u.times(o).plus(c))))}return a.precision=t,a.rounding=r,Dt(i,t,r,!0)},pt.hyperbolicTangent=pt.tanh=function(){var e,t,r=this,n=r.constructor;return r.isFinite()?r.isZero()?new n(r):(e=n.precision,t=n.rounding,n.precision=e+7,n.rounding=1,vt(r.sinh(),r.cosh(),n.precision=e,n.rounding=t)):new n(r.s)},pt.inverseCosine=pt.acos=function(){var e=this,t=e.constructor,r=e.abs().cmp(1),n=t.precision,i=t.rounding;return-1!==r?0===r?e.isNeg()?bt(t,n,i):new t(0):new t(NaN):e.isZero()?bt(t,n+4,i).times(.5):(t.precision=n+6,t.rounding=1,e=new t(1).minus(e).div(e.plus(1)).sqrt().atan(),t.precision=n,t.rounding=i,e.times(2))},pt.inverseHyperbolicCosine=pt.acosh=function(){var e,t,r=this,n=r.constructor;return r.lte(1)?new n(r.eq(1)?0:NaN):r.isFinite()?(e=n.precision,t=n.rounding,n.precision=e+Math.max(Math.abs(r.e),r.sd())+4,n.rounding=1,Xe=!1,r=r.times(r).minus(1).sqrt().plus(r),Xe=!0,n.precision=e,n.rounding=t,r.ln()):new n(r)},pt.inverseHyperbolicSine=pt.asinh=function(){var e,t,r=this,n=r.constructor;return!r.isFinite()||r.isZero()?new n(r):(e=n.precision,t=n.rounding,n.precision=e+2*Math.max(Math.abs(r.e),r.sd())+6,n.rounding=1,Xe=!1,r=r.times(r).plus(1).sqrt().plus(r),Xe=!0,n.precision=e,n.rounding=t,r.ln())},pt.inverseHyperbolicTangent=pt.atanh=function(){var e,t,r,n,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,n=i.sd(),Math.max(n,e)<2*-i.e-1?Dt(new a(i),e,t,!0):(a.precision=r=n-i.e,i=vt(i.plus(1),new a(1).minus(i),r+e,1),a.precision=e+4,a.rounding=1,i=i.ln(),a.precision=e,a.rounding=t,i.times(.5))):new a(NaN)},pt.inverseSine=pt.asin=function(){var e,t,r,n,i=this,a=i.constructor;return i.isZero()?new a(i):(t=i.abs().cmp(1),r=a.precision,n=a.rounding,-1!==t?0===t?((e=bt(a,r+4,n).times(.5)).s=i.s,e):new a(NaN):(a.precision=r+6,a.rounding=1,i=i.div(new a(1).minus(i.times(i)).sqrt().plus(1)).atan(),a.precision=r,a.rounding=n,i.times(2)))},pt.inverseTangent=pt.atan=function(){var e,t,r,n,i,a,o,s,u,c=this,f=c.constructor,l=f.precision,p=f.rounding;if(c.isFinite()){if(c.isZero())return new f(c);if(c.abs().eq(1)&&l+4<=lt)return(o=bt(f,l+4,p).times(.25)).s=c.s,o}else{if(!c.s)return new f(NaN);if(l+4<=lt)return(o=bt(f,l+4,p).times(.5)).s=c.s,o}for(f.precision=s=l+10,f.rounding=1,e=r=Math.min(28,s/7+2|0);e;--e)c=c.div(c.times(c).plus(1).sqrt().plus(1));for(Xe=!1,t=Math.ceil(s/7),n=1,u=c.times(c),o=new f(c),i=c;-1!==e;)if(i=i.times(u),a=o.minus(i.div(n+=2)),i=i.times(u),void 0!==(o=a.plus(i.div(n+=2))).d[t])for(e=t;o.d[e]===a.d[e]&&e--;);return r&&(o=o.times(2<<r-1)),Xe=!0,Dt(o,f.precision=l,f.rounding=p,!0)},pt.isFinite=function(){return!!this.d},pt.isInteger=pt.isInt=function(){return!!this.d&&nt(this.e/7)>this.d.length-2},pt.isNaN=function(){return!this.s},pt.isNegative=pt.isNeg=function(){return this.s<0},pt.isPositive=pt.isPos=function(){return this.s>0},pt.isZero=function(){return!!this.d&&0===this.d[0]},pt.lessThan=pt.lt=function(e){return this.cmp(e)<0},pt.lessThanOrEqualTo=pt.lte=function(e){return this.cmp(e)<1},pt.logarithm=pt.log=function(e){var t,r,n,i,a,o,s,u,c=this,f=c.constructor,l=f.precision,p=f.rounding;if(null==e)e=new f(10),t=!0;else{if(r=(e=new f(e)).d,e.s<0||!r||!r[0]||e.eq(1))return new f(NaN);t=e.eq(10)}if(r=c.d,c.s<0||!r||!r[0]||c.eq(1))return new f(r&&!r[0]?-1/0:1!=c.s?NaN:r?0:1/0);if(t)if(r.length>1)a=!0;else{for(i=r[0];i%10==0;)i/=10;a=1!==i}if(Xe=!1,o=Tt(c,s=l+5),n=t?wt(f,s+10):Tt(e,s),mt((u=vt(o,n,s,1)).d,i=l,p))do{if(o=Tt(c,s+=10),n=t?wt(f,s+10):Tt(e,s),u=vt(o,n,s,1),!a){+ht(u.d).slice(i+1,i+15)+1==1e14&&(u=Dt(u,l+1,0));break}}while(mt(u.d,i+=10,p));return Xe=!0,Dt(u,l,p)},pt.minus=pt.sub=function(e){var t,r,n,i,a,o,s,u,c,f,l,p,h=this,d=h.constructor;if(e=new d(e),!h.d||!e.d)return h.s&&e.s?h.d?e.s=-e.s:e=new d(e.d||h.s!==e.s?h:NaN):e=new d(NaN),e;if(h.s!=e.s)return e.s=-e.s,h.plus(e);if(c=h.d,p=e.d,s=d.precision,u=d.rounding,!c[0]||!p[0]){if(p[0])e.s=-e.s;else{if(!c[0])return new d(3===u?-0:0);e=new d(h)}return Xe?Dt(e,s,u):e}if(r=nt(e.e/7),f=nt(h.e/7),c=c.slice(),a=f-r){for((l=a<0)?(t=c,a=-a,o=p.length):(t=p,r=f,o=c.length),a>(n=Math.max(Math.ceil(s/7),o)+2)&&(a=n,t.length=1),t.reverse(),n=a;n--;)t.push(0);t.reverse()}else{for((l=(n=c.length)<(o=p.length))&&(o=n),n=0;n<o;n++)if(c[n]!=p[n]){l=c[n]<p[n];break}a=0}for(l&&(t=c,c=p,p=t,e.s=-e.s),o=c.length,n=p.length-o;n>0;--n)c[o++]=0;for(n=p.length;n>a;){if(c[--n]<p[n]){for(i=n;i&&0===c[--i];)c[i]=ct-1;--c[i],c[n]+=ct}c[n]-=p[n]}for(;0===c[--o];)c.pop();for(;0===c[0];c.shift())--r;return c[0]?(e.d=c,e.e=Et(c,r),Xe?Dt(e,s,u):e):new d(3===u?-0:0)},pt.modulo=pt.mod=function(e){var t,r=this,n=r.constructor;return e=new n(e),!r.d||!e.s||e.d&&!e.d[0]?new n(NaN):!e.d||r.d&&!r.d[0]?Dt(new n(r),n.precision,n.rounding):(Xe=!1,9==n.modulo?(t=vt(r,e.abs(),0,3,1)).s*=e.s:t=vt(r,e,0,n.modulo,1),t=t.times(e),Xe=!0,r.minus(t))},pt.naturalExponential=pt.exp=function(){return St(this)},pt.naturalLogarithm=pt.ln=function(){return Tt(this)},pt.negated=pt.neg=function(){var e=new this.constructor(this);return e.s=-e.s,Dt(e)},pt.plus=pt.add=function(e){var t,r,n,i,a,o,s,u,c,f,l=this,p=l.constructor;if(e=new p(e),!l.d||!e.d)return l.s&&e.s?l.d||(e=new p(e.d||l.s===e.s?l:NaN)):e=new p(NaN),e;if(l.s!=e.s)return e.s=-e.s,l.minus(e);if(c=l.d,f=e.d,s=p.precision,u=p.rounding,!c[0]||!f[0])return f[0]||(e=new p(l)),Xe?Dt(e,s,u):e;if(a=nt(l.e/7),n=nt(e.e/7),c=c.slice(),i=a-n){for(i<0?(r=c,i=-i,o=f.length):(r=f,n=a,o=c.length),i>(o=(a=Math.ceil(s/7))>o?a+1:o+1)&&(i=o,r.length=1),r.reverse();i--;)r.push(0);r.reverse()}for((o=c.length)-(i=f.length)<0&&(i=o,r=f,f=c,c=r),t=0;i;)t=(c[--i]=c[i]+f[i]+t)/ct|0,c[i]%=ct;for(t&&(c.unshift(t),++n),o=c.length;0==c[--o];)c.pop();return e.d=c,e.e=Et(c,n),Xe?Dt(e,s,u):e},pt.precision=pt.sd=function(e){var t,r=this;if(void 0!==e&&e!==!!e&&1!==e&&0!==e)throw Error(Qe+e);return r.d?(t=xt(r.d),e&&r.e+1>t&&(t=r.e+1)):t=NaN,t},pt.round=function(){var e=this,t=e.constructor;return Dt(new t(e),e.e+1,t.rounding)},pt.sine=pt.sin=function(){var e,t,r=this,n=r.constructor;return r.isFinite()?r.isZero()?new n(r):(e=n.precision,t=n.rounding,n.precision=e+Math.max(r.e,r.sd())+7,n.rounding=1,r=function(e,t){var r,n=t.d.length;if(n<3)return t.isZero()?t:Bt(e,2,t,t);r=(r=1.4*Math.sqrt(n))>16?16:0|r,t=t.times(1/Ot(5,r)),t=Bt(e,2,t,t);for(var i,a=new e(5),o=new e(16),s=new e(20);r--;)i=t.times(t),t=t.times(a.plus(i.times(o.times(i).minus(s))));return t}(n,It(n,r)),n.precision=e,n.rounding=t,Dt($e>2?r.neg():r,e,t,!0)):new n(NaN)},pt.squareRoot=pt.sqrt=function(){var e,t,r,n,i,a,o=this,s=o.d,u=o.e,c=o.s,f=o.constructor;if(1!==c||!s||!s[0])return new f(!c||c<0&&(!s||s[0])?NaN:s?o:1/0);for(Xe=!1,0==(c=Math.sqrt(+o))||c==1/0?(((t=ht(s)).length+u)%2==0&&(t+="0"),c=Math.sqrt(t),u=nt((u+1)/2)-(u<0||u%2),n=new f(t=c==1/0?"5e"+u:(t=c.toExponential()).slice(0,t.indexOf("e")+1)+u)):n=new f(c.toString()),r=(u=f.precision)+3;;)if(n=(a=n).plus(vt(o,a,r+2,1)).times(.5),ht(a.d).slice(0,r)===(t=ht(n.d)).slice(0,r)){if("9999"!=(t=t.slice(r-3,r+1))&&(i||"4999"!=t)){+t&&(+t.slice(1)||"5"!=t.charAt(0))||(Dt(n,u+1,1),e=!n.times(n).eq(o));break}if(!i&&(Dt(a,u+1,0),a.times(a).eq(o))){n=a;break}r+=4,i=1}return Xe=!0,Dt(n,u,f.rounding,e)},pt.tangent=pt.tan=function(){var e,t,r=this,n=r.constructor;return r.isFinite()?r.isZero()?new n(r):(e=n.precision,t=n.rounding,n.precision=e+10,n.rounding=1,(r=r.sin()).s=1,r=vt(r,new n(1).minus(r.times(r)).sqrt(),e+10,0),n.precision=e,n.rounding=t,Dt(2==$e||4==$e?r.neg():r,e,t,!0)):new n(NaN)},pt.times=pt.mul=function(e){var t,r,n,i,a,o,s,u,c,f=this,l=f.constructor,p=f.d,h=(e=new l(e)).d;if(e.s*=f.s,!(p&&p[0]&&h&&h[0]))return new l(!e.s||p&&!p[0]&&!h||h&&!h[0]&&!p?NaN:p&&h?0*e.s:e.s/0);for(r=nt(f.e/7)+nt(e.e/7),(u=p.length)<(c=h.length)&&(a=p,p=h,h=a,o=u,u=c,c=o),a=[],n=o=u+c;n--;)a.push(0);for(n=c;--n>=0;){for(t=0,i=u+n;i>n;)s=a[i]+h[n]*p[i-n-1]+t,a[i--]=s%ct|0,t=s/ct|0;a[i]=(a[i]+t)%ct|0}for(;!a[--o];)a.pop();return t?++r:a.shift(),e.d=a,e.e=Et(a,r),Xe?Dt(e,l.precision,l.rounding):e},pt.toBinary=function(e,t){return kt(this,2,e,t)},pt.toDecimalPlaces=pt.toDP=function(e,t){var r=this,n=r.constructor;return r=new n(r),void 0===e?r:(dt(e,0,We),void 0===t?t=n.rounding:dt(t,0,8),Dt(r,e+r.e+1,t))},pt.toExponential=function(e,t){var r,n=this,i=n.constructor;return void 0===e?r=yt(n,!0):(dt(e,0,We),void 0===t?t=i.rounding:dt(t,0,8),r=yt(n=Dt(new i(n),e+1,t),!0,e+1)),n.isNeg()&&!n.isZero()?"-"+r:r},pt.toFixed=function(e,t){var r,n,i=this,a=i.constructor;return void 0===e?r=yt(i):(dt(e,0,We),void 0===t?t=a.rounding:dt(t,0,8),r=yt(n=Dt(new a(i),e+i.e+1,t),!1,e+n.e+1)),i.isNeg()&&!i.isZero()?"-"+r:r},pt.toFraction=function(e){var t,r,n,i,a,o,s,u,c,f,l,p,h=this,d=h.d,m=h.constructor;if(!d)return new m(h);if(c=r=new m(1),n=u=new m(0),o=(a=(t=new m(n)).e=xt(d)-h.e-1)%7,t.d[0]=it(10,o<0?7+o:o),null==e)e=a>0?t:c;else{if(!(s=new m(e)).isInt()||s.lt(c))throw Error(Qe+s);e=s.gt(t)?a>0?t:c:s}for(Xe=!1,s=new m(ht(d)),f=m.precision,m.precision=a=7*d.length*2;l=vt(s,t,0,1,1),1!=(i=r.plus(l.times(n))).cmp(e);)r=n,n=i,i=c,c=u.plus(l.times(i)),u=i,i=t,t=s.minus(l.times(i)),s=i;return i=vt(e.minus(r),n,0,1,1),u=u.plus(i.times(c)),r=r.plus(i.times(n)),u.s=c.s=h.s,p=vt(c,n,a,1).minus(h).abs().cmp(vt(u,r,a,1).minus(h).abs())<1?[c,n]:[u,r],m.precision=f,Xe=!0,p},pt.toHexadecimal=pt.toHex=function(e,t){return kt(this,16,e,t)},pt.toNearest=function(e,t){var r=this,n=r.constructor;if(r=new n(r),null==e){if(!r.d)return r;e=new n(1),t=n.rounding}else{if(e=new n(e),void 0===t?t=n.rounding:dt(t,0,8),!r.d)return e.s?r:e;if(!e.d)return e.s&&(e.s=r.s),e}return e.d[0]?(Xe=!1,r=vt(r,e,0,t,1).times(e),Xe=!0,Dt(r)):(e.s=r.s,r=e),r},pt.toNumber=function(){return+this},pt.toOctal=function(e,t){return kt(this,8,e,t)},pt.toPower=pt.pow=function(e){var t,r,n,i,a,o,s=this,u=s.constructor,c=+(e=new u(e));if(!(s.d&&e.d&&s.d[0]&&e.d[0]))return new u(it(+s,c));if((s=new u(s)).eq(1))return s;if(n=u.precision,a=u.rounding,e.eq(1))return Dt(s,n,a);if((t=nt(e.e/7))>=e.d.length-1&&(r=c<0?-c:c)<=9007199254740991)return i=At(u,s,r,n),e.s<0?new u(1).div(i):Dt(i,n,a);if((o=s.s)<0){if(t<e.d.length-1)return new u(NaN);if(1&e.d[t]||(o=1),0==s.e&&1==s.d[0]&&1==s.d.length)return s.s=o,s}return(t=0!=(r=it(+s,c))&&isFinite(r)?new u(r+"").e:nt(c*(Math.log("0."+ht(s.d))/Math.LN10+s.e+1)))>u.maxE+1||t<u.minE-1?new u(t>0?o/0:0):(Xe=!1,u.rounding=s.s=1,r=Math.min(12,(t+"").length),(i=St(e.times(Tt(s,n+r)),n)).d&&mt((i=Dt(i,n+5,1)).d,n,a)&&(t=n+10,+ht((i=Dt(St(e.times(Tt(s,t+r)),t),t+5,1)).d).slice(n+1,n+15)+1==1e14&&(i=Dt(i,n+1,0))),i.s=o,Xe=!0,u.rounding=a,Dt(i,n,a))},pt.toPrecision=function(e,t){var r,n=this,i=n.constructor;return void 0===e?r=yt(n,n.e<=i.toExpNeg||n.e>=i.toExpPos):(dt(e,1,We),void 0===t?t=i.rounding:dt(t,0,8),r=yt(n=Dt(new i(n),e,t),e<=n.e||n.e<=i.toExpNeg,e)),n.isNeg()&&!n.isZero()?"-"+r:r},pt.toSignificantDigits=pt.toSD=function(e,t){var r=this.constructor;return void 0===e?(e=r.precision,t=r.rounding):(dt(e,1,We),void 0===t?t=r.rounding:dt(t,0,8)),Dt(new r(this),e,t)},pt.toString=function(){var e=this,t=e.constructor,r=yt(e,e.e<=t.toExpNeg||e.e>=t.toExpPos);return e.isNeg()&&!e.isZero()?"-"+r:r},pt.truncated=pt.trunc=function(){return Dt(new this.constructor(this),this.e+1,1)},pt.valueOf=pt.toJSON=function(){var e=this,t=e.constructor,r=yt(e,e.e<=t.toExpNeg||e.e>=t.toExpPos);return e.isNeg()?"-"+r:r};var vt=function(){function e(e,t,r){var n,i=0,a=e.length;for(e=e.slice();a--;)n=e[a]*t+i,e[a]=n%r|0,i=n/r|0;return i&&e.unshift(i),e}function t(e,t,r,n){var i,a;if(r!=n)a=r>n?1:-1;else for(i=a=0;i<r;i++)if(e[i]!=t[i]){a=e[i]>t[i]?1:-1;break}return a}function r(e,t,r,n){for(var i=0;r--;)e[r]-=i,i=e[r]<t[r]?1:0,e[r]=i*n+e[r]-t[r];for(;!e[0]&&e.length>1;)e.shift()}return function(n,i,a,o,s,u){var c,f,l,p,h,d,m,g,v,D,y,E,w,b,x,N,A,F,C,S,T=n.constructor,_=n.s==i.s?1:-1,M=n.d,B=i.d;if(!(M&&M[0]&&B&&B[0]))return new T(n.s&&i.s&&(M?!B||M[0]!=B[0]:B)?M&&0==M[0]||!B?0*_:_/0:NaN);for(u?(h=1,f=n.e-i.e):(u=ct,h=7,f=nt(n.e/h)-nt(i.e/h)),C=B.length,A=M.length,D=(v=new T(_)).d=[],l=0;B[l]==(M[l]||0);l++);if(B[l]>(M[l]||0)&&f--,null==a?(b=a=T.precision,o=T.rounding):b=s?a+(n.e-i.e)+1:a,b<0)D.push(1),d=!0;else{if(b=b/h+2|0,l=0,1==C){for(p=0,B=B[0],b++;(l<A||p)&&b--;l++)x=p*u+(M[l]||0),D[l]=x/B|0,p=x%B|0;d=p||l<A}else{for((p=u/(B[0]+1)|0)>1&&(B=e(B,p,u),M=e(M,p,u),C=B.length,A=M.length),N=C,E=(y=M.slice(0,C)).length;E<C;)y[E++]=0;(S=B.slice()).unshift(0),F=B[0],B[1]>=u/2&&++F;do{p=0,(c=t(B,y,C,E))<0?(w=y[0],C!=E&&(w=w*u+(y[1]||0)),(p=w/F|0)>1?(p>=u&&(p=u-1),1==(c=t(m=e(B,p,u),y,g=m.length,E=y.length))&&(p--,r(m,C<g?S:B,g,u))):(0==p&&(c=p=1),m=B.slice()),(g=m.length)<E&&m.unshift(0),r(y,m,E,u),-1==c&&(c=t(B,y,C,E=y.length))<1&&(p++,r(y,C<E?S:B,E,u)),E=y.length):0===c&&(p++,y=[0]),D[l++]=p,c&&y[0]?y[E++]=M[N]||0:(y=[M[N]],E=1)}while((N++<A||void 0!==y[0])&&b--);d=void 0!==y[0]}D[0]||D.shift()}if(1==h)v.e=f,qe=d;else{for(l=1,p=D[0];p>=10;p/=10)l++;v.e=l+f*h-1,Dt(v,s?a+v.e+1:a,o,d)}return v}}();function Dt(e,t,r,n){var i,a,o,s,u,c,f,l,p,h=e.constructor;e:if(null!=t){if(!(l=e.d))return e;for(i=1,s=l[0];s>=10;s/=10)i++;if((a=t-i)<0)a+=7,o=t,u=(f=l[p=0])/it(10,i-o-1)%10|0;else if((p=Math.ceil((a+1)/7))>=(s=l.length)){if(!n)break e;for(;s++<=p;)l.push(0);f=u=0,i=1,o=(a%=7)-7+1}else{for(f=s=l[p],i=1;s>=10;s/=10)i++;u=(o=(a%=7)-7+i)<0?0:f/it(10,i-o-1)%10|0}if(n=n||t<0||void 0!==l[p+1]||(o<0?f:f%it(10,i-o-1)),c=r<4?(u||n)&&(0==r||r==(e.s<0?3:2)):u>5||5==u&&(4==r||n||6==r&&(a>0?o>0?f/it(10,i-o):0:l[p-1])%10&1||r==(e.s<0?8:7)),t<1||!l[0])return l.length=0,c?(t-=e.e+1,l[0]=it(10,(7-t%7)%7),e.e=-t||0):l[0]=e.e=0,e;if(0==a?(l.length=p,s=1,p--):(l.length=p+1,s=it(10,7-a),l[p]=o>0?(f/it(10,i-o)%it(10,o)|0)*s:0),c)for(;;){if(0==p){for(a=1,o=l[0];o>=10;o/=10)a++;for(o=l[0]+=s,s=1;o>=10;o/=10)s++;a!=s&&(e.e++,l[0]==ct&&(l[0]=1));break}if(l[p]+=s,l[p]!=ct)break;l[p--]=0,s=1}for(a=l.length;0===l[--a];)l.pop()}return Xe&&(e.e>h.maxE?(e.d=null,e.e=NaN):e.e<h.minE&&(e.e=0,e.d=[0])),e}function yt(e,t,r){if(!e.isFinite())return _t(e);var n,i=e.e,a=ht(e.d),o=a.length;return t?(r&&(n=r-o)>0?a=a.charAt(0)+"."+a.slice(1)+Nt(n):o>1&&(a=a.charAt(0)+"."+a.slice(1)),a=a+(e.e<0?"e":"e+")+e.e):i<0?(a="0."+Nt(-i-1)+a,r&&(n=r-o)>0&&(a+=Nt(n))):i>=o?(a+=Nt(i+1-o),r&&(n=r-i-1)>0&&(a=a+"."+Nt(n))):((n=i+1)<o&&(a=a.slice(0,n)+"."+a.slice(n)),r&&(n=r-o)>0&&(i+1===o&&(a+="."),a+=Nt(n))),a}function Et(e,t){var r=e[0];for(t*=7;r>=10;r/=10)t++;return t}function wt(e,t,r){if(t>ft)throw Xe=!0,r&&(e.precision=r),Error(et);return Dt(new e(Ye),t,1,!0)}function bt(e,t,r){if(t>lt)throw Error(et);return Dt(new e(Je),t,r,!0)}function xt(e){var t=e.length-1,r=7*t+1;if(t=e[t]){for(;t%10==0;t/=10)r--;for(t=e[0];t>=10;t/=10)r++}return r}function Nt(e){for(var t="";e--;)t+="0";return t}function At(e,t,r,n){var i,a=new e(1),o=Math.ceil(n/7+4);for(Xe=!1;;){if(r%2&&Rt((a=a.times(t)).d,o)&&(i=!0),0===(r=nt(r/2))){r=a.d.length-1,i&&0===a.d[r]&&++a.d[r];break}Rt((t=t.times(t)).d,o)}return Xe=!0,a}function Ft(e){return 1&e.d[e.d.length-1]}function Ct(e,t,r){for(var n,i,a=new e(t[0]),o=0;++o<t.length;){if(!(i=new e(t[o])).s){a=i;break}((n=a.cmp(i))===r||0===n&&a.s===r)&&(a=i)}return a}function St(e,t){var r,n,i,a,o,s,u,c=0,f=0,l=0,p=e.constructor,h=p.rounding,d=p.precision;if(!e.d||!e.d[0]||e.e>17)return new p(e.d?e.d[0]?e.s<0?0:1/0:1:e.s?e.s<0?0:e:NaN);for(null==t?(Xe=!1,u=d):u=t,s=new p(.03125);e.e>-2;)e=e.times(s),l+=5;for(u+=n=Math.log(it(2,l))/Math.LN10*2+5|0,r=a=o=new p(1),p.precision=u;;){if(a=Dt(a.times(e),u,1),r=r.times(++f),ht((s=o.plus(vt(a,r,u,1))).d).slice(0,u)===ht(o.d).slice(0,u)){for(i=l;i--;)o=Dt(o.times(o),u,1);if(null!=t)return p.precision=d,o;if(!(c<3&&mt(o.d,u-n,h,c)))return Dt(o,p.precision=d,h,Xe=!0);p.precision=u+=10,r=a=s=new p(1),f=0,c++}o=s}}function Tt(e,t){var r,n,i,a,o,s,u,c,f,l,p,h=1,d=e,m=d.d,g=d.constructor,v=g.rounding,D=g.precision;if(d.s<0||!m||!m[0]||!d.e&&1==m[0]&&1==m.length)return new g(m&&!m[0]?-1/0:1!=d.s?NaN:m?0:d);if(null==t?(Xe=!1,f=D):f=t,g.precision=f+=10,n=(r=ht(m)).charAt(0),!(Math.abs(a=d.e)<15e14))return c=wt(g,f+2,D).times(a+""),d=Tt(new g(n+"."+r.slice(1)),f-10).plus(c),g.precision=D,null==t?Dt(d,D,v,Xe=!0):d;for(;n<7&&1!=n||1==n&&r.charAt(1)>3;)n=(r=ht((d=d.times(e)).d)).charAt(0),h++;for(a=d.e,n>1?(d=new g("0."+r),a++):d=new g(n+"."+r.slice(1)),l=d,u=o=d=vt(d.minus(1),d.plus(1),f,1),p=Dt(d.times(d),f,1),i=3;;){if(o=Dt(o.times(p),f,1),ht((c=u.plus(vt(o,new g(i),f,1))).d).slice(0,f)===ht(u.d).slice(0,f)){if(u=u.times(2),0!==a&&(u=u.plus(wt(g,f+2,D).times(a+""))),u=vt(u,new g(h),f,1),null!=t)return g.precision=D,u;if(!mt(u.d,f-10,v,s))return Dt(u,g.precision=D,v,Xe=!0);g.precision=f+=10,c=o=d=vt(l.minus(1),l.plus(1),f,1),p=Dt(d.times(d),f,1),i=s=1}u=c,i+=2}}function _t(e){return String(e.s*e.s/0)}function Mt(e,t){var r,n,i;for((r=t.indexOf("."))>-1&&(t=t.replace(".","")),(n=t.search(/e/i))>0?(r<0&&(r=n),r+=+t.slice(n+1),t=t.substring(0,n)):r<0&&(r=t.length),n=0;48===t.charCodeAt(n);n++);for(i=t.length;48===t.charCodeAt(i-1);--i);if(t=t.slice(n,i)){if(i-=n,e.e=r=r-n-1,e.d=[],n=(r+1)%7,r<0&&(n+=7),n<i){for(n&&e.d.push(+t.slice(0,n)),i-=7;n<i;)e.d.push(+t.slice(n,n+=7));n=7-(t=t.slice(n)).length}else n-=i;for(;n--;)t+="0";e.d.push(+t),Xe&&(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 Bt(e,t,r,n,i){var a,o,s,u,c=e.precision,f=Math.ceil(c/7);for(Xe=!1,u=r.times(r),s=new e(n);;){if(o=vt(s.times(u),new e(t++*t++),c,1),s=i?n.plus(o):n.minus(o),n=vt(o.times(u),new e(t++*t++),c,1),void 0!==(o=s.plus(n)).d[f]){for(a=f;o.d[a]===s.d[a]&&a--;);if(-1==a)break}a=s,s=n,n=o,o=a}return Xe=!0,o.d.length=f+1,o}function Ot(e,t){for(var r=e;--t;)r*=e;return r}function It(e,t){var r,n=t.s<0,i=bt(e,e.precision,1),a=i.times(.5);if((t=t.abs()).lte(a))return $e=n?4:1,t;if((r=t.divToInt(i)).isZero())$e=n?3:2;else{if((t=t.minus(r.times(i))).lte(a))return $e=Ft(r)?n?2:3:n?4:1,t;$e=Ft(r)?n?1:4:n?3:2}return t.minus(i).abs()}function kt(e,t,r,n){var i,a,o,s,u,c,f,l,p,h=e.constructor,d=void 0!==r;if(d?(dt(r,1,We),void 0===n?n=h.rounding:dt(n,0,8)):(r=h.precision,n=h.rounding),e.isFinite()){for(d?(i=2,16==t?r=4*r-3:8==t&&(r=3*r-2)):i=t,(o=(f=yt(e)).indexOf("."))>=0&&(f=f.replace(".",""),(p=new h(1)).e=f.length-o,p.d=gt(yt(p),10,i),p.e=p.d.length),a=u=(l=gt(f,10,i)).length;0==l[--u];)l.pop();if(l[0]){if(o<0?a--:((e=new h(e)).d=l,e.e=a,l=(e=vt(e,p,r,n,0,i)).d,a=e.e,c=qe),o=l[r],s=i/2,c=c||void 0!==l[r+1],c=n<4?(void 0!==o||c)&&(0===n||n===(e.s<0?3:2)):o>s||o===s&&(4===n||c||6===n&&1&l[r-1]||n===(e.s<0?8:7)),l.length=r,c)for(;++l[--r]>i-1;)l[r]=0,r||(++a,l.unshift(1));for(u=l.length;!l[u-1];--u);for(o=0,f="";o<u;o++)f+=Ve.charAt(l[o]);if(d){if(u>1)if(16==t||8==t){for(o=16==t?4:3,--u;u%o;u++)f+="0";for(u=(l=gt(f,i,t)).length;!l[u-1];--u);for(o=1,f="1.";o<u;o++)f+=Ve.charAt(l[o])}else f=f.charAt(0)+"."+f.slice(1);f=f+(a<0?"p":"p+")+a}else if(a<0){for(;++a;)f="0"+f;f="0."+f}else if(++a>u)for(a-=u;a--;)f+="0";else a<u&&(f=f.slice(0,a)+"."+f.slice(a))}else f=d?"0p+0":"0";f=(16==t?"0x":2==t?"0b":8==t?"0o":"")+f}else f=_t(e);return e.s<0?"-"+f:f}function Rt(e,t){if(e.length>t)return e.length=t,!0}function jt(e){return new this(e).abs()}function zt(e){return new this(e).acos()}function Ut(e){return new this(e).acosh()}function Pt(e,t){return new this(e).plus(t)}function Lt(e){return new this(e).asin()}function qt(e){return new this(e).asinh()}function $t(e){return new this(e).atan()}function Ht(e){return new this(e).atanh()}function Gt(e,t){e=new this(e),t=new this(t);var r,n=this.precision,i=this.rounding,a=n+4;return e.s&&t.s?e.d||t.d?!t.d||e.isZero()?(r=t.s<0?bt(this,n,i):new this(0)).s=e.s:!e.d||t.isZero()?(r=bt(this,a,1).times(.5)).s=e.s:t.s<0?(this.precision=a,this.rounding=1,r=this.atan(vt(e,t,a,1)),t=bt(this,a,1),this.precision=n,this.rounding=i,r=e.s<0?r.minus(t):r.plus(t)):r=this.atan(vt(e,t,a,1)):(r=bt(this,a,1).times(t.s>0?.25:.75)).s=e.s:r=new this(NaN),r}function Wt(e){return new this(e).cbrt()}function Vt(e){return Dt(e=new this(e),e.e+1,2)}function Yt(e,t,r){return new this(e).clamp(t,r)}function Jt(e){if(!e||"object"!=typeof e)throw Error(Ke+"Object expected");var t,r,n,i=!0===e.defaults,a=["precision",1,We,"rounding",0,8,"toExpNeg",-Ge,0,"toExpPos",0,Ge,"maxE",0,Ge,"minE",-Ge,0,"modulo",0,9];for(t=0;t<a.length;t+=3)if(r=a[t],i&&(this[r]=Ze[r]),void 0!==(n=e[r])){if(!(nt(n)===n&&n>=a[t+1]&&n<=a[t+2]))throw Error(Qe+r+": "+n);this[r]=n}if(r="crypto",i&&(this[r]=Ze[r]),void 0!==(n=e[r])){if(!0!==n&&!1!==n&&0!==n&&1!==n)throw Error(Qe+r+": "+n);if(n){if("undefined"==typeof crypto||!crypto||!crypto.getRandomValues&&!crypto.randomBytes)throw Error(tt);this[r]=!0}else this[r]=!1}return this}function Zt(e){return new this(e).cos()}function Xt(e){return new this(e).cosh()}function Kt(e,t){return new this(e).div(t)}function Qt(e){return new this(e).exp()}function er(e){return Dt(e=new this(e),e.e+1,3)}function tr(){var e,t,r=new this(0);for(Xe=!1,e=0;e<arguments.length;)if((t=new this(arguments[e++])).d)r.d&&(r=r.plus(t.times(t)));else{if(t.s)return Xe=!0,new this(1/0);r=t}return Xe=!0,r.sqrt()}function rr(e){return e instanceof xr||e&&e.toStringTag===rt||!1}function nr(e){return new this(e).ln()}function ir(e,t){return new this(e).log(t)}function ar(e){return new this(e).log(2)}function or(e){return new this(e).log(10)}function sr(){return Ct(this,arguments,-1)}
1function ur(){return Ct(this,arguments,1)}function cr(e,t){return new this(e).mod(t)}function fr(e,t){return new this(e).mul(t)}function lr(e,t){return new this(e).pow(t)}function pr(e){var t,r,n,i,a=0,o=new this(1),s=[];if(void 0===e?e=this.precision:dt(e,1,We),n=Math.ceil(e/7),this.crypto)if(crypto.getRandomValues)for(t=crypto.getRandomValues(new Uint32Array(n));a<n;)(i=t[a])>=429e7?t[a]=crypto.getRandomValues(new Uint32Array(1))[0]:s[a++]=i%1e7;else{if(!crypto.randomBytes)throw Error(tt);for(t=crypto.randomBytes(n*=4);a<n;)(i=t[a]+(t[a+1]<<8)+(t[a+2]<<16)+((127&t[a+3])<<24))>=214e7?crypto.randomBytes(4).copy(t,a):(s.push(i%1e7),a+=4);a=n/4}else for(;a<n;)s[a++]=1e7*Math.random()|0;for(e%=7,(n=s[--a])&&e&&(i=it(10,7-e),s[a]=(n/i|0)*i);0===s[a];a--)s.pop();if(a<0)r=0,s=[0];else{for(r=-1;0===s[0];r-=7)s.shift();for(n=1,i=s[0];i>=10;i/=10)n++;n<7&&(r-=7-n)}return o.e=r,o.d=s,o}function hr(e){return Dt(e=new this(e),e.e+1,this.rounding)}function dr(e){return(e=new this(e)).d?e.d[0]?e.s:0*e.s:e.s||NaN}function mr(e){return new this(e).sin()}function gr(e){return new this(e).sinh()}function vr(e){return new this(e).sqrt()}function Dr(e,t){return new this(e).sub(t)}function yr(){var e=0,t=arguments,r=new this(t[e]);for(Xe=!1;r.s&&++e<t.length;)r=r.plus(t[e]);return Xe=!0,Dt(r,this.precision,this.rounding)}function Er(e){return new this(e).tan()}function wr(e){return new this(e).tanh()}function br(e){return Dt(e=new this(e),e.e+1,1)}pt[Symbol.for("nodejs.util.inspect.custom")]=pt.toString,pt[Symbol.toStringTag]="Decimal";var xr=pt.constructor=function e(t){var r,n,i;function a(e){var t,r,n,i=this;if(!(i instanceof a))return new a(e);if(i.constructor=a,rr(e))return i.s=e.s,void(Xe?!e.d||e.e>a.maxE?(i.e=NaN,i.d=null):e.e<a.minE?(i.e=0,i.d=[0]):(i.e=e.e,i.d=e.d.slice()):(i.e=e.e,i.d=e.d?e.d.slice():e.d));if("number"===(n=typeof e)){if(0===e)return i.s=1/e<0?-1:1,i.e=0,void(i.d=[0]);if(e<0?(e=-e,i.s=-1):i.s=1,e===~~e&&e<1e7){for(t=0,r=e;r>=10;r/=10)t++;return void(Xe?t>a.maxE?(i.e=NaN,i.d=null):t<a.minE?(i.e=0,i.d=[0]):(i.e=t,i.d=[e]):(i.e=t,i.d=[e]))}return 0*e!=0?(e||(i.s=NaN),i.e=NaN,void(i.d=null)):Mt(i,e.toString())}if("string"===n)return 45===(r=e.charCodeAt(0))?(e=e.slice(1),i.s=-1):(43===r&&(e=e.slice(1)),i.s=1),ut.test(e)?Mt(i,e):function(e,t){var r,n,i,a,o,s,u,c,f;if(t.indexOf("_")>-1){if(t=t.replace(/(\d)_(?=\d)/g,"$1"),ut.test(t))return Mt(e,t)}else if("Infinity"===t||"NaN"===t)return+t||(e.s=NaN),e.e=NaN,e.d=null,e;if(ot.test(t))r=16,t=t.toLowerCase();else if(at.test(t))r=2;else{if(!st.test(t))throw Error(Qe+t);r=8}for((a=t.search(/p/i))>0?(u=+t.slice(a+1),t=t.substring(2,a)):t=t.slice(2),o=(a=t.indexOf("."))>=0,n=e.constructor,o&&(a=(s=(t=t.replace(".","")).length)-a,i=At(n,new n(r),a,2*a)),a=f=(c=gt(t,r,ct)).length-1;0===c[a];--a)c.pop();return a<0?new n(0*e.s):(e.e=Et(c,f),e.d=c,Xe=!1,o&&(e=vt(e,i,4*s)),u&&(e=e.times(Math.abs(u)<54?it(2,u):xr.pow(2,u))),Xe=!0,e)}(i,e);if("bigint"===n)return e<0?(e=-e,i.s=-1):i.s=1,Mt(i,e.toString());throw Error(Qe+e)}if(a.prototype=pt,a.ROUND_UP=0,a.ROUND_DOWN=1,a.ROUND_CEIL=2,a.ROUND_FLOOR=3,a.ROUND_HALF_UP=4,a.ROUND_HALF_DOWN=5,a.ROUND_HALF_EVEN=6,a.ROUND_HALF_CEIL=7,a.ROUND_HALF_FLOOR=8,a.EUCLID=9,a.config=a.set=Jt,a.clone=e,a.isDecimal=rr,a.abs=jt,a.acos=zt,a.acosh=Ut,a.add=Pt,a.asin=Lt,a.asinh=qt,a.atan=$t,a.atanh=Ht,a.atan2=Gt,a.cbrt=Wt,a.ceil=Vt,a.clamp=Yt,a.cos=Zt,a.cosh=Xt,a.div=Kt,a.exp=Qt,a.floor=er,a.hypot=tr,a.ln=nr,a.log=ir,a.log10=or,a.log2=ar,a.max=sr,a.min=ur,a.mod=cr,a.mul=fr,a.pow=lr,a.random=pr,a.round=hr,a.sign=dr,a.sin=mr,a.sinh=gr,a.sqrt=vr,a.sub=Dr,a.sum=yr,a.tan=Er,a.tanh=wr,a.trunc=br,void 0===t&&(t={}),t&&!0!==t.defaults)for(i=["precision","rounding","toExpNeg","toExpPos","maxE","minE","modulo","crypto"],r=0;r<i.length;)t.hasOwnProperty(n=i[r++])||(t[n]=this[n]);return a.config(t),a}(Ze);Ye=new xr(Ye),Je=new xr(Je);var Nr=be("BigNumber",["?on","config"],e=>{var{on:t,config:r}=e,n=xr.clone({precision:r.precision,modulo:xr.EUCLID});return n.prototype=Object.create(n.prototype),n.prototype.type="BigNumber",n.prototype.isBigNumber=!0,n.prototype.toJSON=function(){return{mathjs:"BigNumber",value:this.toString()}},n.fromJSON=function(e){return new n(e.value)},t&&t("config",function(e,t){e.precision!==t.precision&&n.config({precision:e.precision})}),n},{isClass:!0});const Ar=Math.cosh||function(e){return Math.abs(e)<1e-9?1-e:.5*(Math.exp(e)+Math.exp(-e))},Fr=Math.sinh||function(e){return Math.abs(e)<1e-9?e:.5*(Math.exp(e)-Math.exp(-e))},Cr=function(e,t){return(e=Math.abs(e))<(t=Math.abs(t))&&([e,t]=[t,e]),e<1e8?Math.sqrt(e*e+t*t):(t/=e,e*Math.sqrt(1+t*t))},Sr=function(){throw SyntaxError("Invalid Param")};function Tr(e,t){const r=Math.abs(e),n=Math.abs(t);return 0===e?Math.log(n):0===t?Math.log(r):r<3e3&&n<3e3?.5*Math.log(e*e+t*t):(e*=.5,t*=.5,.5*Math.log(e*e+t*t)+Math.LN2)}const _r={re:0,im:0},Mr=function(e,t){const r=_r;if(null==e)r.re=r.im=0;else if(void 0!==t)r.re=e,r.im=t;else switch(typeof e){case"object":if("im"in e&&"re"in e)r.re=e.re,r.im=e.im;else if("abs"in e&&"arg"in e){if(!isFinite(e.abs)&&isFinite(e.arg))return Br.INFINITY;r.re=e.abs*Math.cos(e.arg),r.im=e.abs*Math.sin(e.arg)}else if("r"in e&&"phi"in e){if(!isFinite(e.r)&&isFinite(e.phi))return Br.INFINITY;r.re=e.r*Math.cos(e.phi),r.im=e.r*Math.sin(e.phi)}else 2===e.length?(r.re=e[0],r.im=e[1]):Sr();break;case"string":r.im=r.re=0;const t=e.replace(/_/g,"").match(/\d+\.?\d*e[+-]?\d+|\d+\.?\d*|\.\d+|./g);let n=1,i=0;null===t&&Sr();for(let e=0;e<t.length;e++){const a=t[e];
1" "===a||"\t"===a||"\n"===a||("+"===a?n++:"-"===a?i++:"i"===a||"I"===a?(n+i===0&&Sr()," "===t[e+1]||isNaN(t[e+1])?r.im+=parseFloat((i%2?"-":"")+"1"):(r.im+=parseFloat((i%2?"-":"")+t[e+1]),e++),n=i=0):((n+i===0||isNaN(a))&&Sr(),"i"===t[e+1]||"I"===t[e+1]?(r.im+=parseFloat((i%2?"-":"")+a),e++):r.re+=parseFloat((i%2?"-":"")+a),n=i=0))}n+i>0&&Sr();break;case"number":r.im=0,r.re=e;break;default:Sr()}return isNaN(r.re)||isNaN(r.im),r};function Br(e,t){if(!(this instanceof Br))return new Br(e,t);const r=Mr(e,t);this.re=r.re,this.im=r.im}Br.prototype={re:0,im:0,sign:function(){const e=Cr(this.re,this.im);return new Br(this.re/e,this.im/e)},add:function(e,t){const r=Mr(e,t),n=this.isInfinite(),i=!(isFinite(r.re)&&isFinite(r.im));return n||i?n&&i?Br.NAN:Br.INFINITY:new Br(this.re+r.re,this.im+r.im)},sub:function(e,t){const r=Mr(e,t),n=this.isInfinite(),i=!(isFinite(r.re)&&isFinite(r.im));return n||i?n&&i?Br.NAN:Br.INFINITY:new Br(this.re-r.re,this.im-r.im)},mul:function(e,t){const r=Mr(e,t),n=this.isInfinite(),i=!(isFinite(r.re)&&isFinite(r.im)),a=0===this.re&&0===this.im,o=0===r.re&&0===r.im;return n&&o||i&&a?Br.NAN:n||i?Br.INFINITY:0===r.im&&0===this.im?new Br(this.re*r.re,0):new Br(this.re*r.re-this.im*r.im,this.re*r.im+this.im*r.re)},div:function(e,t){const r=Mr(e,t),n=this.isInfinite(),i=!(isFinite(r.re)&&isFinite(r.im)),a=0===this.re&&0===this.im,o=0===r.re&&0===r.im;if(a&&o||n&&i)return Br.NAN;if(o||n)return Br.INFINITY;if(a||i)return Br.ZERO;if(0===r.im)return new Br(this.re/r.re,this.im/r.re);if(Math.abs(r.re)<Math.abs(r.im)){const e=r.re/r.im,t=r.re*e+r.im;return new Br((this.re*e+this.im)/t,(this.im*e-this.re)/t)}{const e=r.im/r.re,t=r.im*e+r.re;return new Br((this.re+this.im*e)/t,(this.im-this.re*e)/t)}},pow:function(e,t){const r=Mr(e,t),n=0===this.re&&0===this.im;if(0===r.re&&0===r.im)return Br.ONE;if(0===r.im){if(0===this.im&&this.re>0)return new Br(Math.pow(this.re,r.re),0);if(0===this.re)switch((r.re%4+4)%4){case 0:return new Br(Math.pow(this.im,r.re),0);case 1:return new Br(0,Math.pow(this.im,r.re));case 2:return new Br(-Math.pow(this.im,r.re),0);case 3:return new Br(0,-Math.pow(this.im,r.re))}}if(n&&r.re>0)return Br.ZERO;const i=Math.atan2(this.im,this.re),a=Tr(this.re,this.im);let o=Math.exp(r.re*a-r.im*i),s=r.im*a+r.re*i;return new Br(o*Math.cos(s),o*Math.sin(s))},sqrt:function(){const e=this.re,t=this.im;if(0===t)return e>=0?new Br(Math.sqrt(e),0):new Br(0,Math.sqrt(-e));const r=Cr(e,t);let n=Math.sqrt(.5*(r+Math.abs(e))),i=Math.abs(t)/(2*n);return e>=0?new Br(n,t<0?-i:i):new Br(i,t<0?-n:n)},exp:function(){const e=Math.exp(this.re);return 0===this.im?new Br(e,0):new Br(e*Math.cos(this.im),e*Math.sin(this.im))},expm1:function(){const e=this.re,t=this.im;return new Br(Math.expm1(e)*Math.cos(t)+(e=>{const t=Math.sin(.5*e);return-2*t*t})(t),Math.exp(e)*Math.sin(t))},log:function(){const e=this.re,t=this.im;return 0===t&&e>0?new Br(Math.log(e),0):new Br(Tr(e,t),Math.atan2(t,e))},abs:function(){return Cr(this.re,this.im)},arg:function(){return Math.atan2(this.im,this.re)},sin:function(){const e=this.re,t=this.im;return new Br(Math.sin(e)*Ar(t),Math.cos(e)*Fr(t))},cos:function(){const e=this.re,t=this.im;return new Br(Math.cos(e)*Ar(t),-Math.sin(e)*Fr(t))},tan:function(){const e=2*this.re,t=2*this.im,r=Math.cos(e)+Ar(t);return new Br(Math.sin(e)/r,Fr(t)/r)},cot:function(){const e=2*this.re,t=2*this.im,r=Math.cos(e)-Ar(t);return new Br(-Math.sin(e)/r,Fr(t)/r)},sec:function(){const e=this.re,t=this.im,r=.5*Ar(2*t)+.5*Math.cos(2*e);return new Br(Math.cos(e)*Ar(t)/r,Math.sin(e)*Fr(t)/r)},csc:function(){const e=this.re,t=this.im,r=.5*Ar(2*t)-.5*Math.cos(2*e);return new Br(Math.sin(e)*Ar(t)/r,-Math.cos(e)*Fr(t)/r)},asin:function(){const e=this.re,t=this.im,r=new Br(t*t-e*e+1,-2*e*t).sqrt(),n=new Br(r.re-t,r.im+e).log();return new Br(n.im,-n.re)},acos:function(){const e=this.re,t=this.im,r=new Br(t*t-e*e+1,-2*e*t).sqrt(),n=new Br(r.re-t,r.im+e).log();return new Br(Math.PI/2-n.im,n.re)},atan:function(){const e=this.re,t=this.im;if(0===e){if(1===t)return new Br(0,1/0);if(-1===t)return new Br(0,-1/0)}const r=e*e+(1-t)*(1-t),n=new Br((1-t*t-e*e)/r,-2*e/r).log();return new Br(-.5*n.im,.5*n.re)},acot:function(){const e=this.re,t=this.im;if(0===t)return new Br(Math.atan2(1,e),0);const r=e*e+t*t;return 0!==r?new Br(e/r,-t/r).atan():new Br(0!==e?e/0:0,0!==t?-t/0:0).atan()},asec:function(){const e=this.re,t=this.im;if(0===e&&0===t)return new Br(0,1/0);const r=e*e+t*t;return 0!==r?new Br(e/r,-t/r).acos():new Br(0!==e?e/0:0,0!==t?-t/0:0).acos()},acsc:function(){const e=this.re,t=this.im;if(0===e&&0===t)return new Br(Math.PI/2,1/0);const r=e*e+t*t;return 0!==r?new Br(e/r,-t/r).asin():new Br(0!==e?e/0:0,0!==t?-t/0:0).asin()},sinh:function(){const e=this.re,t=this.im;return new Br(Fr(e)*Math.cos(t),Ar(e)*Math.sin(t))},cosh:function(){const e=this.re,t=this.im;return new Br(Ar(e)*Math.cos(t),Fr(e)*Math.sin(t))},tanh:function(){const e=2*this.re,t=2*this.im,r=Ar(e)+Math.cos(t);return new Br(Fr(e)/r,Math.sin(t)/r)},coth:function(){const e=2*this.re,t=2*this.im,r=Ar(e)-Math.cos(t);return new Br(Fr(e)/r,-Math.sin(t)/r)},csch:function(){const e=this.re,t=this.im,r=Math.cos(2*t)-Ar(2*e);return new Br(-2*Fr(e)*Math.cos(t)/r,2*Ar(e)*Math.sin(t)/r)},sech:function(){const e=this.re,t=this.im,r=Math.cos(2*t)+Ar(2*e);return new Br(2*Ar(e)*Math.cos(t)/r,-2*Fr(e)*Math.sin(t)/r)},asinh:function(){const e=this.re,t=this.im;if(0===t){if(0===e)return new Br(0,0);const t=Math.abs(e),r=Math.log(t+Math.sqrt(t*t+1));return new Br(e<0?-r:r,0)}const r=new Br(e*e-t*t+1,2*e*t).sqrt();return new Br(e+r.re,t+r.im).log()},acosh:function(){const e=this.re,t=this.im;if(0===t){if(e>1)return new Br(Math.log(e+Math.sqrt(e-1)*Math.sqrt(e+1)),0);if(e<-1){const t=Math.sqrt(e*e-1);return new Br(Math.log(-e+t),Math.PI)}return new Br(0,Math.acos(e))}const r=new Br(e-1,t).sqrt(),n=new Br(e+1,t).sqrt();return new Br(e+r.re*n.re-r.im*n.im,t+r.re*n.im+r.im*n.re).log()},atanh:function(){const e=this.re,t=this.im;if(0===t){if(0===e)return new Br(0,0);if(1===e)return new Br(1/0,0);if(-1===e)return new Br(-1/0,0);if(-1<e&&e<1)return new Br(.5*Math.log((1+e)/(1-e)),0);if(e>1){const t=(e+1)/(e-1);return new Br(.5*Math.log(t),-Math.PI/2)}const t=(1+e)/(1-e);return new Br(.5*Math.log(-t),Math.PI/2)}const r=1-e,n=1+e,i=r*r+t*t;if(0===i)return new Br(-1!==e?e/0:0,0!==t?t/0:0);const a=(n*r-t*t)/i,o=(t*r+n*t)/i;return new Br(Tr(a,o)/2,Math.atan2(o,a)/2)},acoth:function(){const e=this.re,t=this.im;if(0===e&&0===t)return new Br(0,Math.PI/2);const r=e*e+t*t;return 0!==r?new Br(e/r,-t/r).atanh():new Br(0!==e?e/0:0,0!==t?-t/0:0).atanh()},acsch:function(){const e=this.re,t=this.im;if(0===t){if(0===e)return new Br(1/0,0);const t=1/e;return new Br(Math.log(t+Math.sqrt(t*t+1)),0)}const r=e*e+t*t;return 0!==r?new Br(e/r,-t/r).asinh():new Br(0!==e?e/0:0,0!==t?-t/0:0).asinh()},asech:function(){const e=this.re,t=this.im;if(this.isZero())return Br.INFINITY;const r=e*e+t*t;return 0!==r?new Br(e/r,-t/r).acosh():new Br(0!==e?e/0:0,0!==t?-t/0:0).acosh()},inverse:function(){if(this.isZero())return Br.INFINITY;if(this.isInfinite())return Br.ZERO;const e=this.re,t=this.im,r=e*e+t*t;return new Br(e/r,-t/r)},conjugate:function(){return new Br(this.re,-this.im)},neg:function(){return new Br(-this.re,-this.im)},ceil:function(e){return e=Math.pow(10,e||0),new Br(Math.ceil(this.re*e)/e,Math.
1ceil(this.im*e)/e)},floor:function(e){return e=Math.pow(10,e||0),new Br(Math.floor(this.re*e)/e,Math.floor(this.im*e)/e)},round:function(e){return e=Math.pow(10,e||0),new Br(Math.round(this.re*e)/e,Math.round(this.im*e)/e)},equals:function(e,t){const r=Mr(e,t);return Math.abs(r.re-this.re)<=Br.EPSILON&&Math.abs(r.im-this.im)<=Br.EPSILON},clone:function(){return new Br(this.re,this.im)},toString:function(){let e=this.re,t=this.im,r="";return this.isNaN()?"NaN":this.isInfinite()?"Infinity":(Math.abs(e)<Br.EPSILON&&(e=0),Math.abs(t)<Br.EPSILON&&(t=0),0===t?r+e:(0!==e?(r+=e,r+=" ",t<0?(t=-t,r+="-"):r+="+",r+=" "):t<0&&(t=-t,r+="-"),1!==t&&(r+=t),r+"i"))},toVector:function(){return[this.re,this.im]},valueOf:function(){return 0===this.im?this.re:null},isNaN:function(){return isNaN(this.re)||isNaN(this.im)},isZero:function(){return 0===this.im&&0===this.re},isFinite:function(){return isFinite(this.re)&&isFinite(this.im)},isInfinite:function(){return!this.isFinite()}},Br.ZERO=new Br(0,0),Br.ONE=new Br(1,0),Br.I=new Br(0,1),Br.PI=new Br(Math.PI,0),Br.E=new Br(Math.E,0),Br.INFINITY=new Br(1/0,1/0),Br.NAN=new Br(NaN,NaN),Br.EPSILON=1e-15;var Or=be("Complex",[],()=>(Object.defineProperty(Br,"name",{value:"Complex"}),Br.prototype.constructor=Br,Br.prototype.type="Complex",Br.prototype.isComplex=!0,Br.prototype.toJSON=function(){return{mathjs:"Complex",re:this.re,im:this.im}},Br.prototype.toPolar=function(){return{r:this.abs(),phi:this.arg()}},Br.prototype.format=function(e){var t=this.im,r=this.re,n=Ce(this.re,e),i=Ce(this.im,e),a=m(e)?e:e?e.precision:null;if(null!==a){var o=Math.pow(10,-a);Math.abs(r/t)<o&&(r=0),Math.abs(t/r)<o&&(t=0)}return 0===t?n:0===r?1===t?"i":-1===t?"-i":i+"i":t<0?-1===t?n+" - i":n+" - "+i.substring(1)+"i":1===t?n+" + i":n+" + "+i+"i"},Br.fromPolar=function(e){switch(arguments.length){case 1:var t=arguments[0];if("object"==typeof t)return Br(t);throw new TypeError("Input has to be an object with r and phi keys.");case 2:var r=arguments[0],n=arguments[1];if(m(r)){if(E(n)&&n.hasBase("ANGLE")&&(n=n.toNumber("rad")),m(n))return new Br({r:r,phi:n});throw new TypeError("Phi is not a number nor an angle unit.")}throw new TypeError("Radius r is not a number.");default:throw new SyntaxError("Wrong number of arguments in function fromPolar")}},Br.prototype.valueOf=Br.prototype.toString,Br.fromJSON=function(e){return new Br(e)},Br.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},Br),{isClass:!0});"undefined"==typeof BigInt&&(BigInt=function(e){if(isNaN(e))throw new Error("");return e});const Ir=BigInt(0),kr=BigInt(1),Rr=BigInt(2),jr=BigInt(3),zr=BigInt(5),Ur=BigInt(10);BigInt(Number.MAX_SAFE_INTEGER);const Pr={s:kr,n:Ir,d:kr};function Lr(e,t){try{e=BigInt(e)}catch(r){throw Xr()}return e*t}function qr(e){return"bigint"==typeof e?e:Math.floor(e)}function $r(e,t){if(t===Ir)throw Zr();const r=Object.create(Jr.prototype);r.s=e<Ir?-kr:kr;const n=Yr(e=e<Ir?-e:e,t);return r.n=e/n,r.d=t/n,r}const Hr=[Rr*Rr,Rr,Rr*Rr,Rr,Rr*Rr,Rr*jr,Rr,Rr*jr];function Gr(e){const t=Object.create(null);if(e<=kr)return t[e]=kr,t;const r=e=>{t[e]=(t[e]||Ir)+kr};for(;e%Rr===Ir;)r(Rr),e/=Rr;for(;e%jr===Ir;)r(jr),e/=jr;for(;e%zr===Ir;)r(zr),e/=zr;for(let n=0,i=Rr+zr;i*i<=e;){for(;e%i===Ir;)r(i),e/=i;i+=Hr[n],n=n+1&7}return e>kr&&r(e),t}const Wr=function(t,r){let n=Ir,i=kr,a=kr;if(null==t);else if(void 0!==r){if("bigint"==typeof t)n=t;else{if(isNaN(t))throw Xr();if(t%1!=0)throw Kr();n=BigInt(t)}if("bigint"==typeof r)i=r;else{if(isNaN(r))throw Xr();if(r%1!=0)throw Kr();i=BigInt(r)}a=n*i}else if("object"==typeof t){if("d"in t&&"n"in t)n=BigInt(t.n),i=BigInt(t.d),"s"in t&&(n*=BigInt(t.s));else if(0 in t)n=BigInt(t[0]),1 in t&&(i=BigInt(t[1]));else{if("bigint"!=typeof t)throw Xr();n=t}a=n*i}else if("number"==typeof t){if(isNaN(t))throw Xr();if(t<0&&(a=-kr,t=-t),t%1==0)n=BigInt(t);else{let r=1,a=0,o=1,s=1,u=1,c=1e7;for(t>=1&&(r=e(10,Math.floor(1+Math.log10(t))),t/=r);o<=c&&u<=c;){let e=(a+s)/(o+u);if(t===e){o+u<=c?(n=a+s,i=o+u):u>o?(n=s,i=u):(n=a,i=o);break}t>e?(a+=s,o+=u):(s+=a,u+=o),o>c?(n=s,i=u):(n=a,i=o)}n=BigInt(n)*BigInt(r),i=BigInt(i)}}else if("string"==typeof t){let r=0,o=Ir,s=Ir,u=Ir,c=kr,f=kr,l=t.replace(/_/g,"").match(/\d+|./g);if(null===l)throw Xr();if("-"===l[r]?(a=-kr,r++):"+"===l[r]&&r++,l.length===r+1?s=Lr(l[r++],a):"."===l[r+1]||"."===l[r]?("."!==l[r]&&(o=Lr(l[r++],a)),r++,(r+1===l.length||"("===l[r+1]&&")"===l[r+3]||"'"
1===l[r+1]&&"'"===l[r+3])&&(s=Lr(l[r],a),c=e(Ur,BigInt(l[r].length)),r++),("("===l[r]&&")"===l[r+2]||"'"===l[r]&&"'"===l[r+2])&&(u=Lr(l[r+1],a),f=e(Ur,BigInt(l[r+1].length))-kr,r+=3)):"/"===l[r+1]||":"===l[r+1]?(s=Lr(l[r],a),c=Lr(l[r+2],kr),r+=3):"/"===l[r+3]&&" "===l[r+1]&&(o=Lr(l[r],a),s=Lr(l[r+2],a),c=Lr(l[r+4],kr),r+=5),!(l.length<=r))throw Xr();i=c*f,a=n=u+i*o+f*s}else{if("bigint"!=typeof t)throw Xr();n=t,a=t,i=kr}if(i===Ir)throw Zr();Pr.s=a<Ir?-kr:kr,Pr.n=n<Ir?-n:n,Pr.d=i<Ir?-i:i};function Vr(e,t,r){let n=kr,i=function(e,t,r){let n=kr;for(;t>Ir;e=e*e%r,t>>=kr)t&kr&&(n=n*e%r);return n}(Ur,r,t);for(let a=0;a<300;a++){if(n===i)return BigInt(a);n=n*Ur%t,i=i*Ur%t}return 0}function Yr(e,t){if(!e)return t;if(!t)return e;for(;;){if(!(e%=t))return t;if(!(t%=e))return e}}function Jr(e,t){if(Wr(e,t),!(this instanceof Jr))return $r(Pr.s*Pr.n,Pr.d);e=Yr(Pr.d,Pr.n),this.s=Pr.s,this.n=Pr.n/e,this.d=Pr.d/e}const Zr=function(){return new Error("Division by Zero")},Xr=function(){return new Error("Invalid argument")},Kr=function(){return new Error("Parameters must be integer")};Jr.prototype={s:kr,n:Ir,d:kr,abs:function(){return $r(this.n,this.d)},neg:function(){return $r(-this.s*this.n,this.d)},add:function(e,t){return Wr(e,t),$r(this.s*this.n*Pr.d+Pr.s*this.d*Pr.n,this.d*Pr.d)},sub:function(e,t){return Wr(e,t),$r(this.s*this.n*Pr.d-Pr.s*this.d*Pr.n,this.d*Pr.d)},mul:function(e,t){return Wr(e,t),$r(this.s*Pr.s*this.n*Pr.n,this.d*Pr.d)},div:function(e,t){return Wr(e,t),$r(this.s*Pr.s*this.n*Pr.d,this.d*Pr.n)},clone:function(){return $r(this.s*this.n,this.d)},mod:function(e,t){if(void 0===e)return $r(this.s*this.n%this.d,kr);if(Wr(e,t),Ir===Pr.n*this.d)throw Zr();return $r(this.s*(Pr.d*this.n)%(Pr.n*this.d),Pr.d*this.d)},gcd:function(e,t){return Wr(e,t),$r(Yr(Pr.n,this.n)*Yr(Pr.d,this.d),Pr.d*this.d)},lcm:function(e,t){return Wr(e,t),Pr.n===Ir&&this.n===Ir?$r(Ir,kr):$r(Pr.n*this.n,Yr(Pr.n,this.n)*Yr(Pr.d,this.d))},inverse:function(){return $r(this.s*this.d,this.n)},pow:function(t,r){if(Wr(t,r),Pr.d===kr)return Pr.s<Ir?$r(e(this.s*this.d,Pr.n),e(this.n,Pr.n)):$r(e(this.s*this.n,Pr.n),e(this.d,Pr.n));if(this.s<Ir)return null;let n=Gr(this.n),i=Gr(this.d),a=kr,o=kr;for(let s in n)if("1"!==s){if("0"===s){a=Ir;break}if(n[s]*=Pr.n,n[s]%Pr.d!==Ir)return null;n[s]/=Pr.d,a*=e(BigInt(s),n[s])}for(let s in i)if("1"!==s){if(i[s]*=Pr.n,i[s]%Pr.d!==Ir)return null;i[s]/=Pr.d,o*=e(BigInt(s),i[s])}return Pr.s<Ir?$r(o,a):$r(a,o)},log:function(e,t){if(Wr(e,t),this.s<=Ir||Pr.s<=Ir)return null;const r=Object.create(null),n=Gr(Pr.n),i=Gr(Pr.d),a=Gr(this.n),o=Gr(this.d);for(const c in i)n[c]=(n[c]||Ir)-i[c];for(const c in o)a[c]=(a[c]||Ir)-o[c];for(const c in n)"1"!==c&&(r[c]=!0);for(const c in a)"1"!==c&&(r[c]=!0);let s=null,u=null;for(const c in r){const e=n[c]||Ir,t=a[c]||Ir;if(e===Ir){if(t!==Ir)return null;continue}let r=t,i=e;const o=Yr(r,i);if(r/=o,i/=o,null===s&&null===u)s=r,u=i;else if(r*u!==s*i)return null}return null!==s&&null!==u?$r(s,u):null},equals:function(e,t){return Wr(e,t),this.s*this.n*Pr.d===Pr.s*Pr.n*this.d},lt:function(e,t){return Wr(e,t),this.s*this.n*Pr.d<Pr.s*Pr.n*this.d},lte:function(e,t){return Wr(e,t),this.s*this.n*Pr.d<=Pr.s*Pr.n*this.d},gt:function(e,t){return Wr(e,t),this.s*this.n*Pr.d>Pr.s*Pr.n*this.d},gte:function(e,t){return Wr(e,t),this.s*this.n*Pr.d>=Pr.s*Pr.n*this.d},compare:function(e,t){Wr(e,t);let r=this.s*this.n*Pr.d-Pr.s*Pr.n*this.d;return(Ir<r)-(r<Ir)},ceil:function(t){return t=e(Ur,BigInt(t||0)),$r(qr(this.s*t*this.n/this.d)+(t*this.n%this.d>Ir&&this.s>=Ir?kr:Ir),t)},floor:function(t){return t=e(Ur,BigInt(t||0)),$r(qr(this.s*t*this.n/this.d)-(t*this.n%this.d>Ir&&this.s<Ir?kr:Ir),t)},round:function(t){return t=e(Ur,BigInt(t||0)),$r(qr(this.s*t*this.n/this.d)+this.s*((this.s>=Ir?kr:Ir)+Rr*(t*this.n%this.d)>this.d?kr:Ir),t)},roundTo:function(e,t){Wr(e,t);const r=this.n*Pr.d,n=this.d*Pr.n,i=r%n;let a=qr(r/n);return i+i>=n&&a++,$r(this.s*a*Pr.n,Pr.d)},divisible:function(e,t){return Wr(e,t),Pr.n!==Ir&&this.n*Pr.d%(Pr.n*this.d)===Ir},valueOf:function(){return Number(this.s*this.n)/Number(this.d)},toString:function(e=15){let t=this.n,r=this.d,n=function(e,t){for(;t%Rr===Ir;t/=Rr);for(;t%zr===Ir;t/=zr);if(t===kr)return Ir;let r=Ur%t,n=1;for(;r!==kr;n++)if(r=r*Ur%t,n>2e3)return Ir;return BigInt(n)}(0,r),i=Vr(0,r,n),a=this.s<Ir?"-":"";if(a+=qr(t/r),t%=r,t*=Ur,t&&(a+="."),n){for(let e=i;e--;)a+=qr(t/r),t%=r,t*=Ur;a+="(";for(let e=n;e--;)a+=qr(t/r),t%=r,t*=Ur;a+=")"}else for(let o=e;t&&o--;)a+=qr(t/r),t%=r,t*=Ur;return a},toFraction:function(e=!1){let t=this.n,r=this.d,n=this.s<Ir?"-":"";if(r===kr)n+=t;else{const i=qr(t/r);e&&i>Ir&&(n+=i,n+=" ",t%=r),n+=t,n+="/",n+=r}return n},toLatex:function(e=!1){let t=this.n,r=this.d,n=this.s<Ir?"-":"";if(r===kr)n+=t;else{const i=qr(t/r);e&&i>Ir&&(n+=i,t%=r),n+="\\frac{",n+=t,n+="}{",n+=r,n+="}"}return n},toContinued:function(){let e=this.n,t=this.d;const r=[];for(;t;){r.push(qr(e/t));const n=e%t;e=t,t=n}return r},simplify:function(e=.001){const t=BigInt(Math.ceil(1/e)),r=this.abs(),n=r.toContinued();for(let i=1;i<n.length;i++){let e=$r(n[i-1],kr);for(let t=i-2;t>=0;t--)e=e.inverse().add(n[t]);let a=e.sub(r);if(a.n*t<a.d)return e.mul(this.s)}return this}};var Qr=be("Fraction",[],()=>(Object.defineProperty(Jr,"name",{value:"Fraction"}),Jr.prototype.constructor=Jr,Jr.prototype.type="Fraction",Jr.prototype.isFraction=!0,Jr.prototype.toJSON=function(){return{mathjs:"Fraction",n:String(this.s*this.n),d:String(this.d)}},Jr.fromJSON=function(e){return new Jr(e)},Jr),{isClass:!0}),en=be("Matrix",[],()=>{function e(){if(!(this instanceof e))throw new SyntaxError("Constructor must be called with the new operator")}return e.prototype.type="Matrix",e.prototype.isMatrix=!0,e.prototype.storage=function(){throw new Error("Cannot invoke storage on a Matrix interface")},e.prototype.datatype=function(){throw new Error("Cannot invoke datatype on a Matrix interface")},e.prototype.create=function(e,t){throw new Error("Cannot invoke create on a Matrix interface")},e.prototype.subset=function(e,t,r){throw new Error("Cannot invoke subset on a Matrix interface")},e.prototype.get=function(e){throw new Error("Cannot invoke get on a Matrix interface")},e.prototype.set=function(e,t,r){throw new Error("Cannot invoke set on a Matrix interface")},e.prototype.resize=function(e,t){throw new Error("Cannot invoke resize on a Matrix interface")},e.prototype.reshape=function(e,t){throw new Error("Cannot invoke reshape on a Matrix interface")},e.prototype.clone=function(){throw new Error("Cannot invoke clone on a Matrix interface")},e.prototype.size=function(){throw new Error("Cannot invoke size on a Matrix interface")},e.prototype.map=function(e,t){throw new Error("Cannot invoke map on a Matrix interface")},e.prototype.forEach=function(e){throw new Error("Cannot invoke forEach on a Matrix interface")},e.prototype[Symbol.iterator]=function(){throw new Error("Cannot iterate a Matrix interface")},e.prototype.toArray=function(){throw new Error("Cannot invoke toArray on a Matrix interface")},e.prototype.valueOf=function(){throw new Error("Cannot invoke valueOf on a Matrix interface")},e.prototype.format=function(e){throw new Error("Cannot invoke format on a Matrix interface")},e.prototype.toString=function(){throw new Error("Cannot invoke toString on a Matrix interface")},e},{isClass:!0});function tn(e,t,r){var n=new(0,e.constructor)(2),i="";if(r){if(r<1)throw new Error("size must be in greater than 0");if(!Ae(r))throw new Error("size must be an integer");if(e.greaterThan(n.pow(r-1).sub(1))||e.lessThan(n.pow(r-1).mul(-1)))throw new Error("Value must be in range [-2^".concat(r-1,", 2^").
1concat(r-1,"-1]"));if(!e.isInteger())throw new Error("Value must be an integer");e.lessThan(0)&&(e=e.add(n.pow(r))),i="i".concat(r)}switch(t){case 2:return"".concat(e.toBinary()).concat(i);case 8:return"".concat(e.toOctal()).concat(i);case 16:return"".concat(e.toHexadecimal()).concat(i);default:throw new Error("Base ".concat(t," not supported "))}}function rn(e,t){if("function"==typeof t)return t(e);if(!e.isFinite())return e.isNaN()?"NaN":e.gt(0)?"Infinity":"-Infinity";var{notation:r,precision:n,wordSize:i}=Se(t);switch(r){case"fixed":return function(e,t){return e.toFixed(t)}(e,n);case"exponential":return nn(e,n);case"engineering":return function(e,t){var r=e.e,n=r%3==0?r:r<0?r-3-r%3:r-r%3,i=e.mul(Math.pow(10,-n)),a=i.toPrecision(t);if(a.includes("e")){a=new(0,e.constructor)(a).toFixed()}return a+"e"+(r>=0?"+":"")+n.toString()}(e,n);case"bin":return tn(e,2,i);case"oct":return tn(e,8,i);case"hex":return tn(e,16,i);case"auto":var a=an(null==t?void 0:t.lowerExp,-3),o=an(null==t?void 0:t.upperExp,5);if(e.isZero())return"0";var s=e.toSignificantDigits(n),u=s.e;return(u>=a&&u<o?s.toFixed():nn(e,n)).replace(/((\.\d*?)(0+))($|e)/,function(){var e=arguments[2],t=arguments[4];return"."!==e?e+t:t});default:throw new Error('Unknown notation "'+r+'". Choose "auto", "exponential", "fixed", "bin", "oct", or "hex.')}}function nn(e,t){return void 0!==t?e.toExponential(t-1):e.toExponential()}function an(e,t){return m(e)?e:g(e)?e.toNumber():t}function on(e,t){var r=e.length-t.length,n=e.length;return e.substring(r,n)===t}function sn(e,t){var r=function(e,t){if("number"==typeof e)return Ce(e,t);if(g(e))return rn(e,t);if(function(e){return e&&"object"==typeof e&&"bigint"==typeof e.s&&"bigint"==typeof e.n&&"bigint"==typeof e.d||!1}(e))return t&&"decimal"===t.fraction?e.toString():"".concat(e.s*e.n,"/").concat(e.d);if(Array.isArray(e))return ln(e,t);if(w(e))return un(e);if("function"==typeof e)return e.syntax?String(e.syntax):"function";if(e&&"object"==typeof e){return"function"==typeof e.format?e.format(t):e&&e.toString(t)!=={}.toString()?e.toString(t):"{"+Object.keys(e).map(r=>un(r)+": "+sn(e[r],t)).join(", ")+"}"}return String(e)}(e,t);return t&&"object"==typeof t&&"truncate"in t&&r.length>t.truncate?r.substring(0,t.truncate-3)+"...":r}function un(e){for(var t=String(e),r="",n=0;n<t.length;){var i=t.charAt(n);r+=i in cn?cn[i]:i,n++}return'"'+r+'"'}var cn={'"':'\\"',"\\":"\\\\","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r","\t":"\\t"};function fn(e){var t=String(e);return t=t.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/'/g,"&#39;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}function ln(e,t){if(Array.isArray(e)){for(var r="[",n=e.length,i=0;i<n;i++)0!==i&&(r+=", "),r+=ln(e[i],t);return r+="]"}return sn(e,t)}function pn(e,t,r){if(!(this instanceof pn))throw new SyntaxError("Constructor must be called with the new operator");this.actual=e,this.expected=t,this.relation=r,this.message="Dimension mismatch ("+(Array.isArray(e)?"["+e.join(", ")+"]":e)+" "+(this.relation||"!=")+" "+(Array.isArray(t)?"["+t.join(", ")+"]":t)+")",this.stack=(new Error).stack}function hn(e,t,r){if(!(this instanceof hn))throw new 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=r),void 0!==this.min&&this.index<this.min?this.message="Index out of range ("+this.index+" < "+this.min+")":void 0!==this.max&&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=(new Error).stack}function dn(e){for(var t=[];Array.isArray(e);)t.push(e.length),e=e[0];return t}function mn(e,t,r){var n,i=e.length;if(i!==t[r])throw new pn(i,t[r]);if(r<t.length-1){var a=r+1;for(n=0;n<i;n++){var o=e[n];if(!Array.isArray(o))throw new pn(t.length-1,t.length,"<");mn(e[n],t,a)}}else for(n=0;n<i;n++)if(Array.isArray(e[n]))throw new pn(t.length+1,t.length,">")}function gn(e,t){if(0===t.length){if(Array.isArray(e))throw new pn(e.length,0)}else mn(e,t,0)}function vn(e,t){var r=e.isMatrix?e._size:dn(e);t._sourceSize.forEach((e,t)=>{if(null!==e&&e!==r[t])throw new pn(e,r[t])})}function Dn(e,t){if(void 0!==e){if(!m(e)||!Ae(e))throw new TypeError("Index must be an integer (value: "+e+")");if(e<0||"number"==typeof t&&e>=t)throw new hn(e,t)}}function yn(e){for(var t=0;t<e._dimensions.length;++t){var r=e._dimensions[t];
1if(r._data&&b(r._data)){if(0===r._size[0])return!0}else if(r.isRange){if(r.start===r.end)return!0}else if(w(r)&&0===r.length)return!0}return!1}function En(e,t,r){if(!Array.isArray(t))throw new TypeError("Array expected");if(0===t.length)throw new Error("Resizing to scalar is not supported");return t.forEach(function(e){if(!m(e)||!Ae(e)||e<0)throw new TypeError("Invalid size, must contain positive integers (size: "+sn(t)+")")}),(m(e)||g(e))&&(e=[e]),wn(e,t,0,void 0!==r?r:0),e}function wn(e,t,r,n){var i,a,o=e.length,s=t[r],u=Math.min(o,s);if(e.length=s,r<t.length-1){var c=r+1;for(i=0;i<u;i++)a=e[i],Array.isArray(a)||(a=[a],e[i]=a),wn(a,t,c,n);for(i=u;i<s;i++)a=[],e[i]=a,wn(a,t,c,n)}else{for(i=0;i<u;i++)for(;Array.isArray(e[i]);)e[i]=e[i][0];for(i=u;i<s;i++)e[i]=n}}function bn(e,t){var r=function(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!Array.isArray(e))return e;if("boolean"!=typeof t)throw new TypeError("Boolean expected for second argument of flatten");var r=[];t?i(e):n(e);return r;function n(e){for(var t=0;t<e.length;t++){var i=e[t];Array.isArray(i)?n(i):r.push(i)}}function i(e){if(Array.isArray(e[0]))for(var t=0;t<e.length;t++)i(e[t]);else for(var n=0;n<e.length;n++)r.push(e[n])}}(e,!0),n=r.length;if(!Array.isArray(e)||!Array.isArray(t))throw new TypeError("Array expected");if(0===t.length)throw new pn(0,n,"!=");var i=Nn(t=xn(t,n));if(n!==i)throw new pn(i,n,"!=");try{return function(e,t){for(var r,n=e,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}(r,t)}catch(a){if(a instanceof pn)throw new pn(i,n,"!=");throw a}}function xn(e,t){var r=Nn(e),n=e.slice(),i=e.indexOf(-1);if(e.indexOf(-1,i+1)>=0)throw new Error("More than one wildcard in sizes");if(i>=0){if(!(t%r===0))throw new Error("Could not replace wildcard, since "+t+" is no multiple of "+-r);n[i]=-t/r}return n}function Nn(e){return e.reduce((e,t)=>e*t,1)}function An(e,t,r,n){var i=n||dn(e);if(r)for(var a=0;a<r;a++)e=[e],i.unshift(1);for(e=Fn(e,t,0);i.length<t;)i.push(1);return e}function Fn(e,t,r){var n,i;if(Array.isArray(e)){var a=r+1;for(n=0,i=e.length;n<i;n++)e[n]=Fn(e[n],t,a)}else for(var o=r;o<t;o++)e=[e];return e}function Cn(e,t){return Array.prototype.map.call(e,t)}function Sn(e,t){Array.prototype.forEach.call(e,t)}function Tn(e,t){return Array.prototype.join.call(e,t)}function _n(e,t){for(var r,n=0,i=0;i<e.length;i++){var a=e[i],o=Array.isArray(a);if(0===i&&o&&(n=a.length),o&&a.length!==n)return;var s=o?_n(a,t):t(a);if(void 0===r)r=s;else if(r!==s)return"mixed"}return r}function Mn(e,t,r,n){if(n<r){if(e.length!==t.length)throw new pn(e.length,t.length);for(var i=[],a=0;a<e.length;a++)i[a]=Mn(e[a],t[a],r,n+1);return i}return e.concat(t)}function Bn(){var e=Array.prototype.slice.call(arguments,0,-1),t=Array.prototype.slice.call(arguments,-1);if(1===e.length)return e[0];if(e.length>1)return e.slice(1).reduce(function(e,r){return Mn(e,r,t,0)},e[0]);throw new Error("Wrong number of arguments in function concat")}function On(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];for(var n=t.map(e=>e.length),i=Math.max(...n),a=new Array(i).fill(null),o=0;o<t.length;o++)for(var s=t[o],u=n[o],c=0;c<u;c++){var f=i-u+c;s[c]>a[f]&&(a[f]=s[c])}for(var l=0;l<t.length;l++)In(t[l],a);return a}function In(e,t){for(var r=t.length,n=e.length,i=0;i<n;i++){var a=r-n+i;if(e[i]<t[a]&&e[i]>1||e[i]>t[a])throw new Error("shape mismatch: mismatch is found in arg with shape (".concat(e,") not possible to broadcast dimension ").concat(n," with size ").concat(e[i]," to size ").concat(t[a]))}}function kn(e,t){var r=dn(e);if(ue(r,t))return e;In(r,t);var i=On(r,t),a=i.length,o=[...Array(a-r.length).fill(1),...r],s=function(e){return n([],e)}(e);r.length<a&&(r=dn(s=bn(s,o)));for(var u=0;u<a;u++)r[u]<i[u]&&(r=dn(s=Rn(s,i[u],u)));return s}function Rn(e,t,r){return Bn(...Array(t).fill(e),r)}function jn(e,t){if(!Array.isArray(e))throw new Error("Array expected");if(!Array.isArray(t))throw new Error("Array expected for index");var r=dn(e);if(t.length!==r.length)throw new pn(t.length,r.length);for(var n=0;n<t.length;n++)Dn(t[n],r[n]);return t.reduce((e,t)=>
1e[t],e)}function zn(e,t){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(0===e.length)return[];if(r)return function e(r){if(Array.isArray(r)){for(var n=r.length,i=Array(n),a=0;a<n;a++)i[a]=e(r[a]);return i}return t(r)}(e);var n=[];return function r(i,a){if(Array.isArray(i)){for(var o=i.length,s=Array(o),u=0;u<o;u++)n[a]=u,s[u]=r(i[u],a+1);return s}return t(i,n.slice(0,a),e)}(e,0)}function Un(e,t,r,n){if(we.isTypedFunction(e)){var i,a;if(n)i=1;else{var o=t.isMatrix?t.size():dn(t);if(!o.length||0===o[o.length-1])return{isUnary:n,fn:e};var s=o.map(()=>0),u=t.isMatrix?t.get(s):jn(t,s);i=function(e,t,r,n){for(var i=[t,r,n],a=3;a>0;a--){var o=i.slice(0,a);if(null!==we.resolve(e,o))return a}}(e,u,s,t)}if(t.isMatrix&&"mixed"!==t.dataType&&void 0!==t.dataType){var c=function(e,t){var r=[];if(Object.entries(e.signatures).forEach(e=>{var[n,i]=e;n.split(",").length===t&&r.push(i)}),1===r.length)return r[0]}(e,i);a=void 0!==c?c:e}else a=e;return i>=1&&i<=3?{isUnary:1===i,fn:function(){for(var t=arguments.length,n=new Array(t),o=0;o<t;o++)n[o]=arguments[o];return Ln(a,n.slice(0,i),r,e.name)}}:{isUnary:!1,fn:function(){for(var t=arguments.length,n=new Array(t),i=0;i<t;i++)n[i]=arguments[i];return Ln(a,n,r,e.name)}}}return void 0===n?{isUnary:Pn(e),fn:e}:{isUnary:n,fn:e}}function Pn(e){if(1!==e.length)return!1;var t=e.toString();if(/arguments/.test(t))return!1;var r=t.match(/\(.*?\)/);return!/\.\.\./.test(r)}function Ln(e,t,r,n){try{return e(...t)}catch(i){!function(e,t,r,n){var i;if(e instanceof TypeError&&"wrongType"===(null===(i=e.data)||void 0===i?void 0:i.category)){var a=[];throw a.push("value: ".concat(ae(t[0]))),t.length>=2&&a.push("index: ".concat(ae(t[1]))),t.length>=3&&a.push("array: ".concat(ae(t[2]))),new TypeError("Function ".concat(r," cannot apply callback arguments ")+"".concat(n,"(").concat(a.join(", "),") at index ").concat(JSON.stringify(t[1])))}throw new TypeError("Function ".concat(r," cannot apply callback arguments ")+"to function ".concat(n,": ").concat(e.message))}(i,t,r,n)}}pn.prototype=new RangeError,pn.prototype.constructor=RangeError,pn.prototype.name="DimensionError",pn.prototype.isDimensionError=!0,hn.prototype=new RangeError,hn.prototype.constructor=RangeError,hn.prototype.name="IndexError",hn.prototype.isIndexError=!0;var qn=be("DenseMatrix",["Matrix","config"],e=>{var{Matrix:t,config:r}=e;function n(e,t){if(!(this instanceof n))throw new SyntaxError("Constructor must be called with the new operator");if(t&&!w(t))throw new Error("Invalid datatype: "+t);if(x(e))"DenseMatrix"===e.type?(this._data=oe(e._data),this._size=oe(e._size),this._datatype=t||e._datatype):(this._data=e.toArray(),this._size=e.size(),this._datatype=t||e._datatype);else if(e&&b(e.data)&&b(e.size))this._data=e.data,this._size=e.size,gn(this._data,this._size),this._datatype=t||e.datatype;else if(b(e))this._data=o(e),this._size=dn(this._data),gn(this._data,this._size),this._datatype=t;else{if(e)throw new TypeError("Unsupported type of data ("+ae(e)+")");this._data=[],this._size=[0],this._datatype=t}}function i(e,t,r){if(0===t.length){for(var n=e._data;b(n);)n=n[0];return n}return e._size=t.slice(0),e._data=En(e._data,e._size,r),e}function a(e,t,r){for(var n=e._size.slice(0),a=!1;n.length<t.length;)n.push(0),a=!0;for(var o=0,s=t.length;o<s;o++)t[o]>n[o]&&(n[o]=t[o],a=!0);a&&i(e,n,r)}function o(e){return x(e)?o(e.valueOf()):b(e)?e.map(o):e}return n.prototype=new t,n.prototype.createDenseMatrix=function(e,t){return new n(e,t)},Object.defineProperty(n,"name",{value:"DenseMatrix"}),n.prototype.constructor=n,n.prototype.type="DenseMatrix",n.prototype.isDenseMatrix=!0,n.prototype.getDataType=function(){return _n(this._data,ae)},n.prototype.storage=function(){return"dense"},n.prototype.datatype=function(){return this._datatype},n.prototype.create=function(e,t){return new n(e,t)},n.prototype.subset=function(e,t,i){switch(arguments.length){case 1:return function(e,t){if(!S(t))throw new TypeError("Invalid index");var i=r.legacySubset?t.size().every(e=>1===e):t.isScalar();if(i)return e.get(t.min());var a=t.size();if(a.length!==e._size.length)throw new pn(a.length,e._size.length);for(var o=t.min(),s=t.max(),u=0,c=e._size.length;u<c;u++)Dn(o[u],e._size[u]),Dn(s[u],e._size[u]);var f=new n,l=function(e,t){var r=t.size().length-1,n=Array(r);return{data:i(e),size:n.filter(e=>null!==e)};function i(e){var a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,o=t.dimension(a);function s(e,t){return m(e)?t(e):e.map(t).valueOf()}return m(o)?n[a]=null:n[a]=o.size()[0],s(o,a<r?t=>(Dn(t,e.length),i(e[t],a+1)):t=>(Dn(t,e.length),e[t]))}}(e._data,t);return f._size=l.size,f._datatype=e._datatype,f._data=l.data,r.legacySubset?f.reshape(t.
1size()):f}(this,e);case 2:case 3:return function(e,t,r,n){if(!t||!0!==t.isIndex)throw new TypeError("Invalid index");var i,o=t.size(),s=t.isScalar();x(r)?(i=r.size(),r=r.valueOf()):i=dn(r);if(s){if(0!==i.length)throw new TypeError("Scalar expected");e.set(t.min(),r,n)}else{if(!ue(i,o)){if(0===i.length)r=kn([r],o);else try{r=kn(r,o)}catch(f){}i=dn(r)}if(o.length<e._size.length)throw new pn(o.length,e._size.length,"<");if(i.length<o.length){for(var u=0,c=0;1===o[u]&&1===i[u];)u++;for(;1===o[u];)c++,u++;r=An(r,o.length,c,i)}if(!ue(o,i))throw new pn(o,i,">");a(e,t.max().map(function(e){return e+1}),n),function(e,t,r){var n=t.size().length-1;function i(e,r){var a=arguments.length>2&&void 0!==arguments[2]?arguments[2]:0,o=t.dimension(a),s=(t,n)=>{Dn(t,e.length),i(e[t],r[n[0]],a+1)},u=(t,n)=>{Dn(t,e.length),e[t]=r[n[0]]};a<n?m(o)?s(o,[0]):o.forEach(s):m(o)?u(o,[0]):o.forEach(u)}i(e,r)}(e._data,t,r)}return e}(this,e,t,i);default:throw new SyntaxError("Wrong number of arguments")}},n.prototype.get=function(e){return jn(this._data,e)},n.prototype.set=function(e,t,r){if(!b(e))throw new TypeError("Array expected");if(e.length<this._size.length)throw new pn(e.length,this._size.length,"<");var n,i,o;a(this,e.map(function(e){return e+1}),r);var s=this._data;for(n=0,i=e.length-1;n<i;n++)Dn(o=e[n],s.length),s=s[o];return Dn(o=e[e.length-1],s.length),s[o]=t,this},n.prototype.resize=function(e,t,r){if(!N(e))throw new TypeError("Array or Matrix expected");var n=e.valueOf().map(e=>Array.isArray(e)&&1===e.length?e[0]:e);return i(r?this.clone():this,n,t)},n.prototype.reshape=function(e,t){var r=t?this.clone():this;r._data=bn(r._data,e);var n=r._size.reduce((e,t)=>e*t);return r._size=xn(e,n),r},n.prototype.clone=function(){return new n({data:oe(this._data),size:oe(this._size),datatype:this._datatype})},n.prototype.size=function(){return this._size.slice(0)},n.prototype.map=function(e){var t=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=this,n=r._size.length-1;if(n<0)return r.clone();var i=Un(e,r,"map",t),a=i.fn,o=r.create(void 0,r._datatype);if(o._size=r._size,t||i.isUnary)return o._data=function e(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=Array(t.length);if(r<n)for(var o=0;o<t.length;o++)i[o]=e(t[o],r+1);else for(var s=0;s<t.length;s++)i[s]=a(t[s]);return i}(r._data),o;if(0===n){for(var s=r.valueOf(),u=Array(s.length),c=0;c<s.length;c++)u[c]=a(s[c],[c],r);return o._data=u,o}var f=[];return o._data=function e(t){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,o=Array(t.length);if(i<n)for(var s=0;s<t.length;s++)f[i]=s,o[s]=e(t[s],i+1);else for(var u=0;u<t.length;u++)f[i]=u,o[u]=a(t[u],f.slice(),r);return o}(r._data),o},n.prototype.forEach=function(e){var t=arguments.length>2&&void 0!==arguments[2]&&arguments[2],r=this,n=r._size.length-1;if(!(n<0)){var i=Un(e,r,"map",t),a=i.fn;if(t||i.isUnary)(function e(t){var r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;if(r<n)for(var i=0;i<t.length;i++)e(t[i],r+1);else for(var o=0;o<t.length;o++)a(t[o])})(r._data);else if(0!==n){var o=[];!function e(t){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;if(i<n)for(var s=0;s<t.length;s++)o[i]=s,e(t[s],i+1);else for(var u=0;u<t.length;u++)o[i]=u,a(t[u],o.slice(),r)}(r._data)}else for(var s=0;s<r._data.length;s++)a(r._data[s],[s],r)}},n.prototype[Symbol.iterator]=function*(){var e=this._size.length-1;if(!(e<0))if(0!==e)for(var t=Array(e+1).fill(0),r=this._size.reduce((e,t)=>e*t,1),n=0;n<r;n++){for(var i=this._data,a=0;a<e;a++)i=i[t[a]];yield{value:i[t[e]],index:t.slice()};for(var o=e;o>=0&&(t[o]++,!(t[o]<this._size[o]));o--)t[o]=0}else for(var s=0;s<this._data.length;s++)yield{value:this._data[s],index:[s]}},n.prototype.rows=function(){var e=[];if(2!==this.size().length)throw new TypeError("Rows can only be returned for a 2D matrix.");var t=this._data;for(var r of t)e.push(new n([r],this._datatype));return e},n.prototype.columns=function(){var e=this,t=[],r=this.size();if(2!==r.length)throw new TypeError("Rows can only be returned for a 2D matrix.");for(var i=this._data,a=function(r){var a=i.map(e=>[e[r]]);t.push(new n(a,e._datatype))},o=0;o<r[1];o++)a(o);return t},n.prototype.toArray=function(){return oe(this._data)},n.prototype.valueOf=function(){return this._data},n.prototype.format=function(e){return sn(this._data,e)},n.prototype.toString=function(){return sn(this._data)},n.prototype.toJSON=function(){return{mathjs:"DenseMatrix",data:this._data,size:this._size,datatype:this._datatype}},n.prototype.diagonal=function(e){if(e){if(g(e)&&(e=e.toNumber()),!m(e)||!Ae(e))throw new TypeError("The parameter k must be an integer number")}else e=0;for(var t=e>0?e:0,r=e<0?-e:0,i=this._size[0],a=this._size[1],o=Math.min(i-r,a-t),s=[],u=0;u<o;u++)s[u]=this._data[u+r][u+t];return new n({data:s,size:[o],datatype:this._datatype})},n.diagonal=function(e,t,r,i){if(!b(e))throw new TypeError("Array expected, size parameter");if(2!==e.length)throw new Error("Only two dimensions matrix are supported");if(e=e.map(function(e){if(g(e)&&(e=e.toNumber()),!m(e)||!Ae(e)||e<1)throw new Error("Size values must be positive integers");return e}),r){if(g(r)&&(r=r.toNumber()),!m(r)||!Ae(r))throw new TypeError("The parameter k must be an integer number")}else r=0;var a,o=r>0?r:0,s=r<0?-r:0,u=e[0],c=e[1],f=Math.min(u-s,c-o);if(b(t)){if(t.length!==f)throw new Error("Invalid value array length");a=function(e){return t[e]}}else if(x(t)){var l=t.size();if(1!==l.length||l[0]!==f)throw new Error("Invalid matrix length");a=function(e){return t.get([e])}}else a=function(){return t};i||(i=g(a(0))?a(0).mul(0):0);var p=[];if(e.length>0){p=En(p,e,i);for(var h=0;h<f;h++)p[h+s][h+o]=a(h)}return new n({data:p,size:[u,c]})},n.fromJSON=function(e){return new n(e)},n.prototype.swapRows=function(e,t){if(!(m(e)&&Ae(e)&&m(t)&&Ae(t)))throw new Error("Row index must be positive integers");if(2!==this._size.length)throw new Error("Only two dimensional matrix is supported");return Dn(e,this._size[0]),Dn(t,this._size[0]),n._swapRows(e,t,this._data),this},n._swapRows=function(e,t,r){var n=r[e];r[e]=r[t],r[t]=n},n},{isClass:!0});function $n(e,t,r){if(!r)return x(e)?e.map(e=>t(e),!1,!0):zn(e,t,!0);var n=e=>0===e?e:t(e);return x(e)?e.map(e=>
1n(e),!1,!0):zn(e,n,!0)}function Hn(e,t,r,n,i,a,o,s,u,c,f){var l,p,h,d,m=e._values,g=e._index,v=e._ptr;if(n)for(p=v[t],h=v[t+1],l=p;l<h;l++)r[d=g[l]]!==a?(r[d]=a,o.push(d),n[d]=m[l]):(n[d]=s(n[d],m[l]),i[d]=a);else for(p=v[t],h=v[t+1],l=p;l<h;l++)r[d=g[l]]!==a?(r[d]=a,o.push(d)):i[d]=a}var Gn="isInteger",Wn=be(Gn,["typed","equal"],e=>{var{typed:t,equal:r}=e;return t(Gn,{number:e=>!!Number.isFinite(e)&&r(e,Math.round(e)),BigNumber:e=>!!e.isFinite()&&r(e.round(),e),bigint:e=>!0,Fraction:e=>e.d===BigInt("1"),"Array | Matrix":t.referToSelf(e=>t=>$n(t,e))})}),Vn="number",Yn="number, number";function Jn(e){return Math.abs(e)}function Zn(e,t){return e+t}function Xn(e,t){return e-t}function Kn(e,t){return e*t}function Qn(e){return-e}function ei(e,t){return e*e<1&&t===1/0||e*e>1&&t===-1/0?0:Math.pow(e,t)}function ti(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;if(!Ae(t)||t<0||t>15)throw new Error("Number of decimals in function round must be an integer from 0 to 15 inclusive");return parseFloat(_e(e,t))}Jn.signature=Vn,Zn.signature=Yn,Xn.signature=Yn,Kn.signature=Yn,Qn.signature=Vn,ei.signature=Yn;var ri="number, number";function ni(e){return!e}function ii(e,t){return!(!e&&!t)}function ai(e,t){return!(!e||!t)}function oi(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1e-9,n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:0;
1if(r<=0)throw new Error("Relative tolerance must be greater than 0");if(n<0)throw new Error("Absolute tolerance must be at least 0");return!e.isNaN()&&!t.isNaN()&&(e.isFinite()&&t.isFinite()?!!e.eq(t)||e.minus(t).abs().lte(e.constructor.max(e.constructor.max(e.abs(),t.abs()).mul(r),n)):e.eq(t))}ni.signature="number",ii.signature=ri,ai.signature=ri;var si="isNumeric",ui=be(si,["typed"],e=>{var{typed:t}=e;return t(si,{"number | BigNumber | bigint | Fraction | boolean":()=>!0,"Complex | Unit | string | null | undefined | Node":()=>!1,"Array | Matrix":t.referToSelf(e=>t=>$n(t,e))})}),ci="isZero",fi=be(ci,["typed","equalScalar"],e=>{var{typed:t,equalScalar:r}=e;return t(ci,{"number | BigNumber | Complex | Fraction":e=>r(e,0),bigint:e=>e===BigInt("0"),Unit:t.referToSelf(e=>r=>t.find(e,r.valueType())(r.value)),"Array | Matrix":t.referToSelf(e=>t=>$n(t,e))})}),li="isBounded",pi=be(li,["typed"],e=>{var{typed:t}=e;return t(li,{number:e=>Number.isFinite(e),"BigNumber | Complex":e=>e.isFinite(),"bigint | Fraction":()=>!0,"null | undefined":()=>!1,Unit:t.referToSelf(e=>t=>e(t.value)),"Array | Matrix":t.referToSelf(e=>t=>(Array.isArray(t)||(t=t.valueOf()),t.every(t=>e(t))))})});var hi=be("compareUnits",["typed"],e=>{var{typed:t}=e;return{"Unit, Unit":t.referToSelf(e=>(r,n)=>{if(!r.equalBase(n))throw new Error("Cannot compare units with different base");return t.find(e,[r.valueType(),n.valueType()])(r.value,n.value)})}}),di="equalScalar",mi=be(di,["typed","config"],e=>{var{typed:t,config:r}=e,n=hi({typed:t});return t(di,{"boolean, boolean":function(e,t){return e===t},"number, number":function(e,t){return Ie(e,t,r.relTol,r.absTol)},"BigNumber, BigNumber":function(e,t){return e.eq(t)||oi(e,t,r.relTol,r.absTol)},"bigint, bigint":function(e,t){return e===t},"Fraction, Fraction":function(e,t){return e.equals(t)},"Complex, Complex":function(e,t){return function(e,t,r,n){return Ie(e.re,t.re,r,n)&&Ie(e.im,t.im,r,n)}(e,t,r.relTol,r.absTol)}},n)});be(di,["typed","config"],e=>{var{typed:t,config:r}=e;return t(di,{"number, number":function(e,t){return Ie(e,t,r.relTol,r.absTol)}})});var gi=be("SparseMatrix",["typed","equalScalar","Matrix"],e=>{var{typed:t,equalScalar:r,Matrix:n}=e;function i(e,t){if(!(this instanceof i))throw new SyntaxError("Constructor must be called with the new operator");if(t&&!w(t))throw new Error("Invalid datatype: "+t);if(x(e))!function(e,t,r){"SparseMatrix"===t.type?(e._values=t._values?oe(t._values):void 0,e._index=oe(t._index),e._ptr=oe(t._ptr),e._size=oe(t._size),e._datatype=r||t._datatype):a(e,t.valueOf(),r||t._datatype)}(this,e,t);else if(e&&b(e.index)&&b(e.ptr)&&b(e.size))this._values=e.values,this._index=e.index,this._ptr=e.ptr,this._size=e.size,this._datatype=t||e.datatype;else if(b(e))a(this,e,t);else{if(e)throw new TypeError("Unsupported type of data ("+ae(e)+")");this._values=[],this._index=[],this._ptr=[0],this._size=[0,0],this._datatype=t}}function a(e,n,i){e._values=[],e._index=[],e._ptr=[],e._datatype=i;var a=n.length,o=0,s=r,u=0;if(w(i)&&(s=t.find(r,[i,i])||r,u=t.convert(0,i)),a>0){var c=0;do{e._ptr.push(e._index.length);for(var f=0;f<a;f++){var l=n[f];if(b(l)){if(0===c&&o<l.length&&(o=l.length),c<l.length){var p=l[c];s(p,u)||(e._values.push(p),e._index.push(f))}}else 0===c&&o<1&&(o=1),s(l,u)||(e._values.push(l),e._index.push(f))}c++}while(c<o)}for(;e._ptr.length<=o;)e._ptr.push(e._index.length);e._size=[a,o]}function o(e,t,r,n){if(r-t===0)return r;for(var i=t;i<r;i++)if(n[i]===e)return i;return t}function s(e,t,r,n,i,a,o){i.splice(e,0,n),a.splice(e,0,t);for(var s=r+1;s<o.length;s++)o[s]++}function u(e,n,i,a){var o=a||0,s=r,u=0;w(e._datatype)&&(s=t.find(r,[e._datatype,e._datatype])||r,u=t.convert(0,e._datatype),o=t.convert(o,e._datatype));var c,f,l,p=!s(o,u),h=e._size[0],d=e._size[1];if(i>d){for(f=d;f<i;f++)if(e._ptr[f]=e._values.length,p)for(c=0;c<h;c++)e._values.push(o),e._index.push(c);e._ptr[i]=e._values.length}else i<d&&(e._ptr.splice(i+1,d-i),e._values.splice(e._ptr[i],e._values.length),e._index.splice(e._ptr[i],e._index.length));if(d=i,n>h){if(p){var m=0;for(f=0;f<d;f++){e._ptr[f]=e._ptr[f]+m,l=e._ptr[f+1]+m;var g=0;
1for(c=h;c<n;c++,g++)e._values.splice(l+g,0,o),e._index.splice(l+g,0,c),m++}e._ptr[d]=e._values.length}}else if(n<h){var v=0;for(f=0;f<d;f++){e._ptr[f]=e._ptr[f]-v;var D=e._ptr[f],y=e._ptr[f+1]-v;for(l=D;l<y;l++)(c=e._index[l])>n-1&&(e._values.splice(l,1),e._index.splice(l,1),v++)}e._ptr[f]=e._values.length}return e._size[0]=n,e._size[1]=i,e}function c(e,t,r,n,i){var a,o,s=n[0],u=n[1],c=[];for(a=0;a<s;a++)for(c[a]=[],o=0;o<u;o++)c[a][o]=0;for(o=0;o<u;o++)for(var f=r[o],l=r[o+1],p=f;p<l;p++)c[a=t[p]][o]=e?i?oe(e[p]):e[p]:1;return c}return i.prototype=new n,i.prototype.createSparseMatrix=function(e,t){return new i(e,t)},Object.defineProperty(i,"name",{value:"SparseMatrix"}),i.prototype.constructor=i,i.prototype.type="SparseMatrix",i.prototype.isSparseMatrix=!0,i.prototype.getDataType=function(){return _n(this._values,ae)},i.prototype.storage=function(){return"sparse"},i.prototype.datatype=function(){return this._datatype},i.prototype.create=function(e,t){return new i(e,t)},i.prototype.density=function(){var e=this._size[0],t=this._size[1];return 0!==e&&0!==t?this._index.length/(e*t):0},i.prototype.subset=function(e,t,r){if(!this._values)throw new Error("Cannot invoke subset on a Pattern only matrix");switch(arguments.length){case 1:return function(e,t){if(!S(t))throw new TypeError("Invalid index");if(t.isScalar())return e.get(t.min());var r,n,a,o,s=t.size();if(s.length!==e._size.length)throw new pn(s.length,e._size.length);var u=t.min(),c=t.max();for(r=0,n=e._size.length;r<n;r++)Dn(u[r],e._size[r]),Dn(c[r],e._size[r]);var f=e._values,l=e._index,p=e._ptr,h=t.dimension(0),d=t.dimension(1),m=[],g=[];function v(e,t){g[e]=t[0],m[e]=!0}Number.isInteger(h)?v(h,[0]):h.forEach(v);var D=f?[]:void 0,y=[],E=[];function w(e){for(E.push(y.length),a=p[e],o=p[e+1];a<o;a++)r=l[a],!0===m[r]&&(y.push(g[r]),D&&D.push(f[a]))}Number.isInteger(d)?w(d):d.forEach(w);return E.push(y.length),new i({values:D,index:y,ptr:E,size:s,datatype:e._datatype})}(this,e);case 2:case 3:return function(e,t,r,n){if(!t||!0!==t.isIndex)throw new TypeError("Invalid index");var i,a=t.size(),o=t.isScalar();x(r)?(i=r.size(),r=r.toArray()):i=dn(r);if(o){if(0!==i.length)throw new TypeError("Scalar expected");e.set(t.min(),r,n)}else{if(1!==a.length&&2!==a.length)throw new pn(a.length,e._size.length,"<");if(i.length<a.length){for(var s=0,u=0;1===a[s]&&1===i[s];)s++;for(;1===a[s];)u++,s++;r=An(r,a.length,u,i)}if(!ue(a,i))throw new pn(a,i,">");if(1===a.length){l(t.dimension(0),(t,i)=>{Dn(t),e.set([t,0],r[i[0]],n)})}else{var c=t.dimension(0),f=t.dimension(1);l(c,(t,i)=>{Dn(t),l(f,(a,o)=>{Dn(a),e.set([t,a],r[i[0]][o[0]],n)})})}}return e;function l(e,t){m(e)?t(e,[0]):e.forEach(t)}}(this,e,t,r);default:throw new SyntaxError("Wrong number of arguments")}},i.prototype.get=function(e){if(!b(e))throw new TypeError("Array expected");if(e.length!==this._size.length)throw new pn(e.length,this._size.length);if(!this._values)throw new Error("Cannot invoke get on a Pattern only matrix");var t=e[0],r=e[1];Dn(t,this._size[0]),Dn(r,this._size[1]);var n=o(t,this._ptr[r],this._ptr[r+1],this._index);return n<this._ptr[r+1]&&this._index[n]===t?this._values[n]:0},i.prototype.set=function(e,n,i){if(!b(e))throw new TypeError("Array expected");if(e.length!==this._size.length)throw new pn(e.length,this._size.length);if(!this._values)throw new Error("Cannot invoke set on a Pattern only matrix");var a=e[0],c=e[1],f=this._size[0],l=this._size[1],p=r,h=0;w(this._datatype)&&(p=t.find(r,[this._datatype,this._datatype])||r,h=t.convert(0,this._datatype)),(a>f-1||c>l-1)&&(u(this,Math.max(a+1,f),Math.max(c+1,l),i),f=this._size[0],l=this._size[1]),Dn(a,f),Dn(c,l);var d=o(a,this._ptr[c],this._ptr[c+1],this._index);return d<this._ptr[c+1]&&this._index[d]===a?p(n,h)?function(e,t,r,n,i){r.splice(e,1),n.splice(e,1);for(var a=t+1;a<i.length;a++)i[a]--}(d,c,this._values,this._index,this._ptr):this._values[d]=n:p(n,h)||s(d,a,c,n,this._values,this._index,this._ptr),this},i.prototype.resize=function(e,t,r){if(!N(e))throw new TypeError("Array or Matrix expected");var n=e.valueOf().map(e=>Array.isArray(e)&&1===e.length?e[0]:e);if(2!==n.length)throw new Error("Only two dimensions matrix are supported");
1return n.forEach(function(e){if(!m(e)||!Ae(e)||e<0)throw new TypeError("Invalid size, must contain positive integers (size: "+sn(n)+")")}),u(r?this.clone():this,n[0],n[1],t)},i.prototype.reshape=function(e,t){if(!b(e))throw new TypeError("Array expected");if(2!==e.length)throw new Error("Sparse matrices can only be reshaped in two dimensions");e.forEach(function(t){if(!m(t)||!Ae(t)||t<=-2||0===t)throw new TypeError("Invalid size, must contain positive integers or -1 (size: "+sn(e)+")")});var r=this._size[0]*this._size[1];if(r!==(e=xn(e,r))[0]*e[1])throw new Error("Reshaping sparse matrix will result in the wrong number of elements");var n=t?this.clone():this;if(this._size[0]===e[0]&&this._size[1]===e[1])return n;for(var i=[],a=0;a<n._ptr.length;a++)for(var u=0;u<n._ptr[a+1]-n._ptr[a];u++)i.push(a);for(var c=n._values.slice(),f=n._index.slice(),l=0;l<n._index.length;l++){var p=f[l],h=i[l],d=p*n._size[1]+h;i[l]=d%e[1],f[l]=Math.floor(d/e[1])}n._values.length=0,n._index.length=0,n._ptr.length=e[1]+1,n._size=e.slice();for(var g=0;g<n._ptr.length;g++)n._ptr[g]=0;for(var v=0;v<c.length;v++){var D=f[v],y=i[v],E=c[v];s(o(D,n._ptr[y],n._ptr[y+1],n._index),D,y,E,n._values,n._index,n._ptr)}return n},i.prototype.clone=function(){return new i({values:this._values?oe(this._values):void 0,index:oe(this._index),ptr:oe(this._ptr),size:oe(this._size),datatype:this._datatype})},i.prototype.size=function(){return this._size.slice(0)},i.prototype.map=function(e,n){if(!this._values)throw new Error("Cannot invoke map on a Pattern only matrix");var a=this,o=this._size[0],s=this._size[1],u=Un(e,a,"map");return function(e,n,a,o,s,u,c){var f=[],l=[],p=[],h=r,d=0;w(e._datatype)&&(h=t.find(r,[e._datatype,e._datatype])||r,d=t.convert(0,e._datatype));for(var m=function(e,t,r){var n=u(e,t,r);h(n,d)||(f.push(n),l.push(t))},g=o;g<=s;g++){p.push(f.length);var v=e._ptr[g],D=e._ptr[g+1];if(c)for(var y=v;y<D;y++){var E=e._index[y];E>=n&&E<=a&&m(e._values[y],E-n,g-o)}else{for(var b={},x=v;x<D;x++){b[e._index[x]]=e._values[x]}for(var N=n;N<=a;N++){m(N in b?b[N]:0,N-n,g-o)}}}return p.push(f.length),new i({values:f,index:l,ptr:p,size:[a-n+1,s-o+1]})}(this,0,o-1,0,s-1,function(e,t,r){return u.fn(e,[t,r],a)},n)},i.prototype.forEach=function(e,t){if(!this._values)throw new Error("Cannot invoke forEach on a Pattern only matrix");for(var r=this,n=this._size[0],i=this._size[1],a=Un(e,r,"forEach"),o=0;o<i;o++){var s=this._ptr[o],u=this._ptr[o+1];if(t)for(var c=s;c<u;c++){var f=this._index[c];a.fn(this._values[c],[f,o],r)}else{for(var l={},p=s;p<u;p++){l[this._index[p]]=this._values[p]}for(var h=0;h<n;h++){var d=h in l?l[h]:0;a.fn(d,[h,o],r)}}}},i.prototype[Symbol.iterator]=function*(){if(!this._values)throw new Error("Cannot iterate a Pattern only matrix");for(var e=this._size[1],t=0;t<e;t++)for(var r=this._ptr[t],n=this._ptr[t+1],i=r;i<n;i++){var a=this._index[i];yield{value:this._values[i],index:[a,t]}}},i.prototype.toArray=function(){return c(this._values,this._index,this._ptr,this._size,!0)},i.prototype.valueOf=function(){return c(this._values,this._index,this._ptr,this._size,!1)},i.prototype.format=function(e){for(var t=this._size[0],r=this._size[1],n=this.density(),i="Sparse Matrix ["+sn(t,e)+" x "+sn(r,e)+"] density: "+sn(n,e)+"\n",a=0;a<r;a++)for(var o=this._ptr[a],s=this._ptr[a+1],u=o;u<s;u++){i+="\n    ("+sn(this._index[u],e)+", "+sn(a,e)+") ==> "+(this._values?sn(this._values[u],e):"X")}return i},i.prototype.toString=function(){return sn(this.toArray())},i.prototype.toJSON=function(){return{mathjs:"SparseMatrix",values:this._values,index:this._index,ptr:this._ptr,size:this._size,datatype:this._datatype}},i.prototype.diagonal=function(e){if(e){if(g(e)&&(e=e.toNumber()),!m(e)||!Ae(e))throw new TypeError("The parameter k must be an integer number")}else e=0;var t=e>0?e:0,r=e<0?-e:0,n=this._size[0],a=this._size[1],o=Math.min(n-r,a-t),s=[],u=[],c=[];c[0]=0;for(var f=t;f<a&&s.length<o;f++)for(var l=this._ptr[f],p=this._ptr[f+1],h=l;h<p;h++){var d=this._index[h];if(d===f-t+r){s.push(this._values[h]),u[s.length-1]=d-r;break}}return c.push(s.length),new i({values:s,index:u,ptr:c,size:[o,1]})},i.fromJSON=function(e){return new i(e)}
1,i.diagonal=function(e,n,a,o,s){if(!b(e))throw new TypeError("Array expected, size parameter");if(2!==e.length)throw new Error("Only two dimensions matrix are supported");if(e=e.map(function(e){if(g(e)&&(e=e.toNumber()),!m(e)||!Ae(e)||e<1)throw new Error("Size values must be positive integers");return e}),a){if(g(a)&&(a=a.toNumber()),!m(a)||!Ae(a))throw new TypeError("The parameter k must be an integer number")}else a=0;var u=r,c=0;w(s)&&(u=t.find(r,[s,s])||r,c=t.convert(0,s));var f,l=a>0?a:0,p=a<0?-a:0,h=e[0],d=e[1],v=Math.min(h-p,d-l);if(b(n)){if(n.length!==v)throw new Error("Invalid value array length");f=function(e){return n[e]}}else if(x(n)){var D=n.size();if(1!==D.length||D[0]!==v)throw new Error("Invalid matrix length");f=function(e){return n.get([e])}}else f=function(){return n};for(var y=[],E=[],N=[],A=0;A<d;A++){N.push(y.length);var F=A-l;if(F>=0&&F<v){var C=f(F);u(C,c)||(E.push(F+p),y.push(C))}}return N.push(y.length),new i({values:y,index:E,ptr:N,size:[h,d]})},i.prototype.swapRows=function(e,t){if(!(m(e)&&Ae(e)&&m(t)&&Ae(t)))throw new Error("Row index must be positive integers");if(2!==this._size.length)throw new Error("Only two dimensional matrix is supported");return Dn(e,this._size[0]),Dn(t,this._size[0]),i._swapRows(e,t,this._size[1],this._values,this._index,this._ptr),this},i._forEachRow=function(e,t,r,n,i){for(var a=n[e],o=n[e+1],s=a;s<o;s++)i(r[s],t[s])},i._swapRows=function(e,t,r,n,i,a){for(var s=0;s<r;s++){var u=a[s],c=a[s+1],f=o(e,u,c,i),l=o(t,u,c,i);if(f<c&&l<c&&i[f]===e&&i[l]===t){if(n){var p=n[f];n[f]=n[l],n[l]=p}}else if(f<c&&i[f]===e&&(l>=c||i[l]!==t)){var h=n?n[f]:void 0;i.splice(l,0,t),n&&n.splice(l,0,h),i.splice(l<=f?f+1:f,1),n&&n.splice(l<=f?f+1:f,1)}else if(l<c&&i[l]===t&&(f>=c||i[f]!==e)){var d=n?n[l]:void 0;i.splice(f,0,e),n&&n.splice(f,0,d),i.splice(f<=l?l+1:l,1),n&&n.splice(f<=l?l+1:l,1)}}},i},{isClass:!0});var vi=be("number",["typed"],t=>{var{typed:r}=t,n=r("number",{"":function(){return 0},number:function(e){return e},string:function(t){if("NaN"===t)return NaN;var r,n,i=(n=(r=t).match(/(0[box])([0-9a-fA-F]*)\.([0-9a-fA-F]*)/))?{input:r,radix:{"0b":2,"0o":8,"0x":16}[n[1]],integerPart:n[2],fractionalPart:n[3]}:null;if(i)return function(e){for(var t=parseInt(e.integerPart,e.radix),r=0,n=0;n<e.fractionalPart.length;n++)r+=parseInt(e.fractionalPart[n],e.radix)/Math.pow(e.radix,n+1);var i=t+r;if(isNaN(i))throw new SyntaxError('String "'+e.input+'" is not a valid number');return i}(i);var a=0,o=t.match(/(0[box][0-9a-fA-F]*)i([0-9]*)/);o&&(a=Number(o[2]),t=o[1]);var s=Number(t);if(isNaN(s))throw new SyntaxError('String "'+t+'" is not a valid number');if(o){if(s>e(2,a)-1)throw new SyntaxError('String "'.concat(t,'" is out of range'));s>=e(2,a-1)&&(s-=e(2,a))}return s},BigNumber:function(e){return e.toNumber()},bigint:function(e){return Number(e)},Fraction:function(e){return e.valueOf()},Unit:r.referToSelf(e=>t=>{var r=t.clone();return r.value=e(t.value),r}),null:function(e){return 0},"Unit, string | Unit":function(e,t){return e.toNumber(t)},"Array | Matrix":r.referToSelf(e=>t=>$n(t,e))});return n.fromJSON=function(e){return parseFloat(e.value)},n}),Di=be("bignumber",["typed","BigNumber"],e=>{var{typed:t,BigNumber:r}=e;return t("bignumber",{"":function(){return new r(0)},number:function(e){return new r(e+"")},string:function(e){var t=e.match(/(0[box][0-9a-fA-F]*)i([0-9]*)/);if(t){var n=t[2],i=r(t[1]),a=new r(2).pow(Number(n));if(i.gt(a.sub(1)))throw new SyntaxError('String "'.concat(e,'" is out of range'));var o=new r(2).pow(Number(n)-1);return i.gte(o)?i.sub(a):i}return new r(e)},BigNumber:function(e){return e},bigint:function(e){return new r(e.toString())},Unit:t.referToSelf(e=>t=>{var r=t.clone();return r.value=e(t.value),r}),Fraction:function(e){return new r(String(e.n)).div(String(e.d)).times(String(e.s))},null:function(e){return new r(0)},"Array | Matrix":t.referToSelf(e=>t=>$n(t,e))})}),yi=be("fraction",["typed","Fraction"],e=>{var{typed:t,Fraction:r}=e;return t("fraction",{number:function(e){if(!Number.isFinite(e)||isNaN(e))throw new Error(e+" cannot be represented as a fraction");return new r(e)},string:function(e){return new r(e)},"number, number":function(e,t){return new r(e,t)},"bigint, bigint":function(e,t){return new r(e,t)},null:function(e){return new r(0)},BigNumber:function(e){return new r(e.toString())},bigint:function(e){return new r(e.toString())},Fraction:function(e){return e},Unit:t.referToSelf(e=>t=>{var r=t.clone();return r.value=e(t.value),r}),Object:function(e){return new r(e)},"Array | Matrix":t.referToSelf(e=>t=>$n(t,e))})}),Ei="matrix",wi=be(Ei,["typed","Matrix","DenseMatrix","SparseMatrix"],e=>{var{typed:t,Matrix:r,DenseMatrix:n,SparseMatrix:i}=e;return t(Ei,{"":function(){return a([])}
1,string:function(e){return a([],e)},"string, string":function(e,t){return a([],e,t)},Array:function(e){return a(e)},Matrix:function(e){return a(e,e.storage())},"Array | Matrix, string":a,"Array | Matrix, string, string":a});function a(e,t,r){if("dense"===t||"default"===t||void 0===t)return new n(e,r);if("sparse"===t)return new i(e,r);throw new TypeError("Unknown matrix type "+JSON.stringify(t)+".")}}),bi="unaryMinus",xi=be(bi,["typed"],e=>{var{typed:t}=e;return t(bi,{number:Qn,"Complex | BigNumber | Fraction":e=>e.neg(),bigint:e=>-e,Unit:t.referToSelf(e=>r=>{var n=r.clone();return n.value=t.find(e,n.valueType())(r.value),n}),"Array | Matrix":t.referToSelf(e=>t=>$n(t,e,!0))})}),Ni=be("abs",["typed"],e=>{var{typed:t}=e;return t("abs",{number:Jn,"Complex | BigNumber | Fraction | Unit":e=>e.abs(),bigint:e=>e<BigInt("0")?-e:e,"Array | Matrix":t.referToSelf(e=>t=>$n(t,e,!0))})}),Ai="addScalar",Fi=be(Ai,["typed"],e=>{var{typed:t}=e;return t(Ai,{"number, number":Zn,"Complex, Complex":function(e,t){return e.add(t)},"BigNumber, BigNumber":function(e,t){return e.plus(t)},"bigint, bigint":function(e,t){return e+t},"Fraction, Fraction":function(e,t){return e.add(t)},"Unit, Unit":t.referToSelf(e=>(r,n)=>{if(null===r.value||void 0===r.value)throw new Error("Parameter x contains a unit with undefined value");if(null===n.value||void 0===n.value)throw new Error("Parameter y contains a unit with undefined value");if(!r.equalBase(n))throw new Error("Units do not match");var i=r.clone();return i.value=t.find(e,[i.valueType(),n.valueType()])(i.value,n.value),i.fixPrefix=!1,i})})}),Ci="subtractScalar",Si=be(Ci,["typed"],e=>{var{typed:t}=e;return t(Ci,{"number, number":Xn,"Complex, Complex":function(e,t){return e.sub(t)},"BigNumber, BigNumber":function(e,t){return e.minus(t)},"bigint, bigint":function(e,t){return e-t},"Fraction, Fraction":function(e,t){return e.sub(t)},"Unit, Unit":t.referToSelf(e=>(r,n)=>{if(null===r.value||void 0===r.value)throw new Error("Parameter x contains a unit with undefined value");if(null===n.value||void 0===n.value)throw new Error("Parameter y contains a unit with undefined value");if(!r.equalBase(n))throw new Error("Units do not match");var i=r.clone();return i.value=t.find(e,[i.valueType(),n.valueType()])(i.value,n.value),i.fixPrefix=!1,i})})}),Ti=be("matAlgo11xS0s",["typed","equalScalar"],e=>{var{typed:t,equalScalar:r}=e;return function(e,n,i,a){var o=e._values,s=e._index,u=e._ptr,c=e._size,f=e._datatype;if(!o)throw new Error("Cannot perform operation on Pattern Sparse Matrix and Scalar value");var l,p=c[0],h=c[1],d=r,m=0,g=i;"string"==typeof f&&(l=f,d=t.find(r,[l,l]),m=t.convert(0,l),n=t.convert(n,l),g=t.find(i,[l,l]));for(var v=[],D=[],y=[],E=0;E<h;E++){y[E]=D.length;for(var w=u[E],b=u[E+1],x=w;x<b;x++){var N=s[x],A=a?g(n,o[x]):g(o[x],n);d(A,m)||(D.push(N),v.push(A))}}return y[h]=D.length,e.createSparseMatrix({values:v,index:D,ptr:y,size:[p,h],datatype:l})}}),_i=be("matAlgo12xSfs",["typed","DenseMatrix"],e=>{var{typed:t,DenseMatrix:r}=e;return function(e,n,i,a){var o=e._values,s=e._index,u=e._ptr,c=e._size,f=e._datatype;if(!o)throw new Error("Cannot perform operation on Pattern Sparse Matrix and Scalar value");var l,p=c[0],h=c[1],d=i;"string"==typeof f&&(l=f,n=t.convert(n,l),d=t.find(i,[l,l]));for(var m=[],g=[],v=[],D=0;D<h;D++){for(var y=D+1,E=u[D],w=u[D+1],b=E;b<w;b++){var x=s[b];g[x]=o[b],v[x]=y}for(var N=0;N<p;N++)0===D&&(m[N]=[]),v[N]===y?m[N][D]=a?d(n,g[N]):d(g[N],n):m[N][D]=a?d(n,0):d(0,n)}return new r({data:m,size:[p,h],datatype:l})}}),Mi=be("matAlgo14xDs",["typed"],e=>{var{typed:t}=e;return function(e,n,i,a){var o,s=e._data,u=e._size,c=e._datatype,f=i;"string"==typeof c&&(o=c,n=t.convert(n,o),f=t.find(i,[o,o]));var l=u.length>0?r(f,0,u,u[0],s,n,a):[];return e.createDenseMatrix({data:l,size:oe(u),datatype:o})};function r(e,t,n,i,a,o,s){var u=[];if(t===n.length-1)for(var c=0;c<i;c++)u[c]=s?e(o,a[c]):e(a[c],o);else for(var f=0;f<i;f++)u[f]=r(e,t+1,n,n[t+1],a[f],o,s);return u}}),Bi="ceil",Oi=["typed","config","round","matrix","equalScalar","zeros","DenseMatrix"],Ii=new xr(10),ki=be(Bi,["typed","config","round"],t=>{var{typed:r,config:n,round:i}=t;function a(e){var t=Math.ceil(e),r=i(e);return t===r?t:Ie(e,r,n.relTol,n.absTol)&&!Ie(e,t,n.relTol,n.absTol)?r:t}return r(Bi,{number:a,"number, number":function(t,r){if(!Ae(r))throw new RangeError("number of decimals in function ceil must be an integer");if(r<0||r>15)throw new RangeError("number of decimals in ceil number must be in range 0-15");var n=e(10,r);return a(t*n)/n}})}
1),Ri=be(Bi,Oi,e=>{var{typed:t,config:r,round:n,matrix:i,equalScalar:a,zeros:o,DenseMatrix:s}=e,u=Ti({typed:t,equalScalar:a}),c=_i({typed:t,DenseMatrix:s}),f=Mi({typed:t}),l=ki({typed:t,config:r,round:n});function p(e){var t=(e,t)=>oi(e,t,r.relTol,r.absTol),i=e.ceil(),a=n(e);return i.eq(a)?i:t(e,a)&&!t(e,i)?a:i}return t("ceil",{number:l.signatures.number,"number,number":l.signatures["number,number"],Complex:function(e){return e.ceil()},"Complex, number":function(e,t){return e.ceil(t)},"Complex, BigNumber":function(e,t){return e.ceil(t.toNumber())},BigNumber:p,"BigNumber, BigNumber":function(e,t){var r=Ii.pow(t);return p(e.mul(r)).div(r)},bigint:e=>e,"bigint, number":(e,t)=>e,"bigint, BigNumber":(e,t)=>e,Fraction:function(e){return e.ceil()},"Fraction, number":function(e,t){return e.ceil(t)},"Fraction, BigNumber":function(e,t){return e.ceil(t.toNumber())},"Unit, number, Unit":t.referToSelf(e=>function(t,r,n){var i=t.toNumeric(n);return n.multiply(e(i,r))}),"Unit, BigNumber, Unit":t.referToSelf(e=>(t,r,n)=>e(t,r.toNumber(),n)),"Array | Matrix, number | BigNumber, Unit":t.referToSelf(e=>(t,r,n)=>$n(t,t=>e(t,r,n),!0)),"Array | Matrix | Unit, Unit":t.referToSelf(e=>(t,r)=>e(t,0,r)),"Array | Matrix":t.referToSelf(e=>t=>$n(t,e,!0)),"Array, number | BigNumber":t.referToSelf(e=>(t,r)=>$n(t,t=>e(t,r),!0)),"SparseMatrix, number | BigNumber":t.referToSelf(e=>(t,r)=>u(t,r,e,!1)),"DenseMatrix, number | BigNumber":t.referToSelf(e=>(t,r)=>f(t,r,e,!1)),"number | Complex | Fraction | BigNumber, Array":t.referToSelf(e=>(t,r)=>f(i(r),t,e,!0).valueOf()),"number | Complex | Fraction | BigNumber, Matrix":t.referToSelf(e=>(t,r)=>a(t,0)?o(r.size(),r.storage()):"dense"===r.storage()?f(r,t,e,!0):c(r,t,e,!0))})}),ji="fix",zi=["typed","Complex","matrix","ceil","floor","equalScalar","zeros","DenseMatrix"],Ui=be(ji,["typed","ceil","floor"],e=>{var{typed:t,ceil:r,floor:n}=e;return t(ji,{number:function(e){return e>0?n(e):r(e)},"number, number":function(e,t){return e>0?n(e,t):r(e,t)}})}),Pi=be(ji,zi,e=>{var{typed:t,Complex:r,matrix:n,ceil:i,floor:a,equalScalar:o,zeros:s,DenseMatrix:u}=e,c=_i({typed:t,DenseMatrix:u}),f=Mi({typed:t}),l=Ui({typed:t,ceil:i,floor:a});return t("fix",{number:l.signatures.number,"number, number | BigNumber":l.signatures["number,number"],Complex:function(e){return new r(e.re>0?Math.floor(e.re):Math.ceil(e.re),e.im>0?Math.floor(e.im):Math.ceil(e.im))},"Complex, number":function(e,t){return new r(e.re>0?a(e.re,t):i(e.re,t),e.im>0?a(e.im,t):i(e.im,t))},"Complex, BigNumber":function(e,t){var n=t.toNumber();return new r(e.re>0?a(e.re,n):i(e.re,n),e.im>0?a(e.im,n):i(e.im,n))},BigNumber:function(e){return e.isNegative()?i(e):a(e)},"BigNumber, number | BigNumber":function(e,t){return e.isNegative()?i(e,t):a(e,t)},bigint:e=>e,"bigint, number":(e,t)=>e,"bigint, BigNumber":(e,t)=>e,Fraction:function(e){return e.s<BigInt("0")?e.ceil():e.floor()},"Fraction, number | BigNumber":function(e,t){return e.s<BigInt("0")?i(e,t):a(e,t)},"Unit, number, Unit":t.referToSelf(e=>function(t,r,n){var i=t.toNumeric(n);return n.multiply(e(i,r))}),"Unit, BigNumber, Unit":t.referToSelf(e=>(t,r,n)=>e(t,r.toNumber(),n)),"Array | Matrix, number | BigNumber, Unit":t.referToSelf(e=>(t,r,n)=>$n(t,t=>e(t,r,n),!0)),"Array | Matrix | Unit, Unit":t.referToSelf(e=>(t,r)=>e(t,0,r)),"Array | Matrix":t.referToSelf(e=>t=>$n(t,e,!0)),"Array | Matrix, number | BigNumber":t.referToSelf(e=>(t,r)=>$n(t,t=>e(t,r),!0)),"number | Complex | Fraction | BigNumber, Array":t.referToSelf(e=>(t,r)=>f(n(r),t,e,!0).valueOf()),"number | Complex | Fraction | BigNumber, Matrix":t.referToSelf(e=>(t,r)=>o(t,0)?s(r.size(),r.storage()):"dense"===r.storage()?f(r,t,e,!0):c(r,t,e,!0))})}),Li="floor",qi=["typed","config","round","matrix","equalScalar","zeros","DenseMatrix"],$i=new xr(10),Hi=be(Li,["typed","config","round"],t=>{var{typed:r,config:n,round:i}=t;function a(e){var t=Math.floor(e),r=i(e);return t===r?t:Ie(e,r,n.relTol,n.absTol)&&!Ie(e,t,n.relTol,n.absTol)?r:t}return r(Li,{number:a,"number, number":function(t,r){if(!Ae(r))throw new RangeError("number of decimals in function floor must be an integer");if(r<0||r>15)throw new RangeError("number of decimals in floor number must be in range 0 - 15");var n=e(10,r);return a(t*n)/n}})}),Gi=be(Li,qi,e=>{var{typed:t,config:r,round:n,matrix:i,equalScalar:a,zeros:o,DenseMatrix:s}=e,u=Ti({typed:t,equalScalar:a}),c=_i({typed:t,DenseMatrix:s}),f=Mi({typed:t}),l=Hi({typed:t,config:r,round:n});function p(e){var t=(e,t)=>oi(e,t,r.relTol,r.absTol),i=e.floor(),a=n(e);return i.eq(a)?i:t(e,a)&&!t(e,i)?a:i}return t("floor",{number:l.signatures.number,"number,number":l.signatures["number,number"],Complex:function(e){return e.floor()},"Complex, number":function(e,t){return e.floor(t)},"Complex, BigNumber":function(e,t){return e.floor(t.toNumber())},BigNumber:p,"BigNumber, BigNumber":function(e,t){var r=$i.pow(t);return p(e.mul(r)).div(r)},bigint:e=>e,"bigint, number":(e,t)=>e,"bigint, BigNumber":(e,t)=>e,Fraction:function(e){return e.floor()},"Fraction, number":function(e,t){return e.floor(t)},"Fraction, BigNumber":function(e,t){return e.floor(t.toNumber())},"Unit, number, Unit":t.referToSelf(e=>function(t,r,n){var i=t.toNumeric(n);return n.multiply(e(i,r))}),"Unit, BigNumber, Unit":t.referToSelf(e=>(t,r,n)=>e(t,r.toNumber(),n)),"Array | Matrix, number | BigNumber, Unit":t.referToSelf(e=>(t,r,n)=>$n(t,t=>e(t,r,n),!0)),"Array | Matrix | Unit, Unit":t.referToSelf(e=>(t,r)=>e(t,0,r)),"Array | Matrix":t.referToSelf(e=>t=>$n(t,e,!0)),"Array, number | BigNumber":t.referToSelf(e=>(t,r)=>$n(t,t=>e(t,r),!0)),"SparseMatrix, number | BigNumber":t.referToSelf(e=>(t,r)=>
1u(t,r,e,!1)),"DenseMatrix, number | BigNumber":t.referToSelf(e=>(t,r)=>f(t,r,e,!1)),"number | Complex | Fraction | BigNumber, Array":t.referToSelf(e=>(t,r)=>f(i(r),t,e,!0).valueOf()),"number | Complex | Fraction | BigNumber, Matrix":t.referToSelf(e=>(t,r)=>a(t,0)?o(r.size(),r.storage()):"dense"===r.storage()?f(r,t,e,!0):c(r,t,e,!0))})}),Wi=be("matAlgo02xDS0",["typed","equalScalar"],e=>{var{typed:t,equalScalar:r}=e;return function(e,n,i,a){var o=e._data,s=e._size,u=e._datatype||e.getDataType(),c=n._values,f=n._index,l=n._ptr,p=n._size,h=n._datatype||void 0===n._data?n._datatype:n.getDataType();if(s.length!==p.length)throw new pn(s.length,p.length);if(s[0]!==p[0]||s[1]!==p[1])throw new RangeError("Dimension mismatch. Matrix A ("+s+") must match Matrix B ("+p+")");if(!c)throw new Error("Cannot perform operation on Dense Matrix and Pattern Sparse Matrix");var d,m=s[0],g=s[1],v=r,D=0,y=i;"string"==typeof u&&u===h&&"mixed"!==u&&(d=u,v=t.find(r,[d,d]),D=t.convert(0,d),y=t.find(i,[d,d]));for(var E=[],w=[],b=[],x=0;x<g;x++){b[x]=w.length;for(var N=l[x],A=l[x+1],F=N;F<A;F++){var C=f[F],S=a?y(c[F],o[C][x]):y(o[C][x],c[F]);v(S,D)||(w.push(C),E.push(S))}}return b[g]=w.length,n.createSparseMatrix({values:E,index:w,ptr:b,size:[m,g],datatype:u===e._datatype&&h===n._datatype?d:void 0})}}),Vi=be("matAlgo03xDSf",["typed"],e=>{var{typed:t}=e;return function(e,r,n,i){var a=e._data,o=e._size,s=e._datatype||e.getDataType(),u=r._values,c=r._index,f=r._ptr,l=r._size,p=r._datatype||void 0===r._data?r._datatype:r.getDataType();if(o.length!==l.length)throw new pn(o.length,l.length);if(o[0]!==l[0]||o[1]!==l[1])throw new RangeError("Dimension mismatch. Matrix A ("+o+") must match Matrix B ("+l+")");if(!u)throw new Error("Cannot perform operation on Dense Matrix and Pattern Sparse Matrix");var h,d=o[0],m=o[1],g=0,v=n;"string"==typeof s&&s===p&&"mixed"!==s&&(h=s,g=t.convert(0,h),v=t.find(n,[h,h]));for(var D=[],y=0;y<d;y++)D[y]=[];for(var E=[],w=[],b=0;b<m;b++){for(var x=b+1,N=f[b],A=f[b+1],F=N;F<A;F++){var C=c[F];E[C]=i?v(u[F],a[C][b]):v(a[C][b],u[F]),w[C]=x}for(var S=0;S<d;S++)w[S]===x?D[S][b]=E[S]:D[S][b]=i?v(g,a[S][b]):v(a[S][b],g)}return e.createDenseMatrix({data:D,size:[d,m],datatype:s===e._datatype&&p===r._datatype?h:void 0})}}),Yi=be("matAlgo05xSfSf",["typed","equalScalar"],e=>{var{typed:t,equalScalar:r}=e;return function(e,n,i){var a=e._values,o=e._index,s=e._ptr,u=e._size,c=e._datatype||void 0===e._data?e._datatype:e.getDataType(),f=n._values,l=n._index,p=n._ptr,h=n._size,d=n._datatype||void 0===n._data?n._datatype:n.getDataType();if(u.length!==h.length)throw new pn(u.length,h.length);if(u[0]!==h[0]||u[1]!==h[1])throw new RangeError("Dimension mismatch. Matrix A ("+u+") must match Matrix B ("+h+")");var m,g=u[0],v=u[1],D=r,y=0,E=i;"string"==typeof c&&c===d&&"mixed"!==c&&(m=c,D=t.find(r,[m,m]),y=t.convert(0,m),E=t.find(i,[m,m]));var w,b,x,N,A=a&&f?[]:void 0,F=[],C=[],S=A?[]:void 0,T=A?[]:void 0,_=[],M=[];for(b=0;b<v;b++){C[b]=F.length;var B=b+1;for(x=s[b],N=s[b+1];x<N;x++)w=o[x],F.push(w),_[w]=B,S&&(S[w]=a[x]);for(x=p[b],N=p[b+1];x<N;x++)_[w=l[x]]!==B&&F.push(w),M[w]=B,T&&(T[w]=f[x]);if(A)for(x=C[b];x<F.length;){var O=_[w=F[x]],I=M[w];if(O===B||I===B){var k=E(O===B?S[w]:y,I===B?T[w]:y);D(k,y)?F.splice(x,1):(A.push(k),x++)}}}return C[v]=F.length,e.createSparseMatrix({values:A,index:F,ptr:C,size:[g,v],datatype:c===e._datatype&&d===n._datatype?m:void 0})}}),Ji=be("matAlgo13xDD",["typed"],e=>{var{typed:t}=e;return function(e,n,i){var a,o=e._data,s=e._size,u=e._datatype,c=n._data,f=n._size,l=n._datatype,p=[];if(s.length!==f.length)throw new pn(s.length,f.length);for(var h=0;h<s.length;h++){if(s[h]!==f[h])throw new RangeError("Dimension mismatch. Matrix A ("+s+") must match Matrix B ("+f+")");p[h]=s[h]}var d=i;"string"==typeof u&&u===l&&(a=u,d=t.find(i,[a,a]));var m=p.length>0?r(d,0,p,p[0],o,c):[];return e.createDenseMatrix({data:m,size:p,datatype:a})};function r(e,t,n,i,a,o){var s=[];if(t===n.length-1)for(var u=0;u<i;u++)s[u]=e(a[u],o[u]);else for(var c=0;c<i;c++)s[c]=r(e,t+1,n,n[t+1],a[c],o[c]);return s}});function Zi(e,t){if(ue(e.size(),t.size()))return[e,t];var r=On(e.size(),t.size());return[e,t].map(e=>function(e,t){if(ue(e.size(),t))return e;return e.create(kn(e.valueOf(),t),e.datatype())}(e,r))}var Xi=be("matrixAlgorithmSuite",["typed","matrix"],e=>{var{typed:t,matrix:r}=e,n=Ji({typed:t}),i=Mi({typed:t});return function(e){var a,o=e.elop,s=e.SD||e.DS;o?(a={"DenseMatrix, DenseMatrix":(e,t)=>
1n(...Zi(e,t),o),"Array, Array":(e,t)=>n(...Zi(r(e),r(t)),o).valueOf(),"Array, DenseMatrix":(e,t)=>n(...Zi(r(e),t),o),"DenseMatrix, Array":(e,t)=>n(...Zi(e,r(t)),o)},e.SS&&(a["SparseMatrix, SparseMatrix"]=(t,r)=>e.SS(...Zi(t,r),o,!1)),e.DS&&(a["DenseMatrix, SparseMatrix"]=(t,r)=>e.DS(...Zi(t,r),o,!1),a["Array, SparseMatrix"]=(t,n)=>e.DS(...Zi(r(t),n),o,!1)),s&&(a["SparseMatrix, DenseMatrix"]=(e,t)=>s(...Zi(t,e),o,!0),a["SparseMatrix, Array"]=(e,t)=>s(...Zi(r(t),e),o,!0))):(a={"DenseMatrix, DenseMatrix":t.referToSelf(e=>(t,r)=>n(...Zi(t,r),e)),"Array, Array":t.referToSelf(e=>(t,i)=>n(...Zi(r(t),r(i)),e).valueOf()),"Array, DenseMatrix":t.referToSelf(e=>(t,i)=>n(...Zi(r(t),i),e)),"DenseMatrix, Array":t.referToSelf(e=>(t,i)=>n(...Zi(t,r(i)),e))},e.SS&&(a["SparseMatrix, SparseMatrix"]=t.referToSelf(t=>(r,n)=>e.SS(...Zi(r,n),t,!1))),e.DS&&(a["DenseMatrix, SparseMatrix"]=t.referToSelf(t=>(r,n)=>e.DS(...Zi(r,n),t,!1)),a["Array, SparseMatrix"]=t.referToSelf(t=>(n,i)=>e.DS(...Zi(r(n),i),t,!1))),s&&(a["SparseMatrix, DenseMatrix"]=t.referToSelf(e=>(t,r)=>s(...Zi(r,t),e,!0)),a["SparseMatrix, Array"]=t.referToSelf(e=>(t,n)=>s(...Zi(r(n),t),e,!0))));var u=e.scalar||"any";(e.Ds||e.Ss)&&(o?(a["DenseMatrix,"+u]=(e,t)=>i(e,t,o,!1),a[u+", DenseMatrix"]=(e,t)=>i(t,e,o,!0),a["Array,"+u]=(e,t)=>i(r(e),t,o,!1).valueOf(),a[u+", Array"]=(e,t)=>i(r(t),e,o,!0).valueOf()):(a["DenseMatrix,"+u]=t.referToSelf(e=>(t,r)=>i(t,r,e,!1)),a[u+", DenseMatrix"]=t.referToSelf(e=>(t,r)=>i(r,t,e,!0)),a["Array,"+u]=t.referToSelf(e=>(t,n)=>i(r(t),n,e,!1).valueOf()),a[u+", Array"]=t.referToSelf(e=>(t,n)=>i(r(n),t,e,!0).valueOf())));var c=void 0!==e.sS?e.sS:e.Ss;return o?(e.Ss&&(a["SparseMatrix,"+u]=(t,r)=>e.Ss(t,r,o,!1)),c&&(a[u+", SparseMatrix"]=(e,t)=>c(t,e,o,!0))):(e.Ss&&(a["SparseMatrix,"+u]=t.referToSelf(t=>(r,n)=>e.Ss(r,n,t,!1))),c&&(a[u+", SparseMatrix"]=t.referToSelf(e=>(t,r)=>c(r,t,e,!0)))),o&&o.signatures&&function(e,t){for(var r in t)pe(t,r)&&(e[r]=t[r])}(a,o.signatures),a}}),Ki=be("matAlgo01xDSid",["typed"],e=>{var{typed:t}=e;return function(e,r,n,i){var a=e._data,o=e._size,s=e._datatype||e.getDataType(),u=r._values,c=r._index,f=r._ptr,l=r._size,p=r._datatype||void 0===r._data?r._datatype:r.getDataType();if(o.length!==l.length)throw new pn(o.length,l.length);if(o[0]!==l[0]||o[1]!==l[1])throw new RangeError("Dimension mismatch. Matrix A ("+o+") must match Matrix B ("+l+")");if(!u)throw new Error("Cannot perform operation on Dense Matrix and Pattern Sparse Matrix");var h,d,m=o[0],g=o[1],v="string"==typeof s&&"mixed"!==s&&s===p?s:void 0,D=v?t.find(n,[v,v]):n,y=[];for(h=0;h<m;h++)y[h]=[];var E=[],w=[];for(d=0;d<g;d++){for(var b=d+1,x=f[d],N=f[d+1],A=x;A<N;A++)E[h=c[A]]=i?D(u[A],a[h][d]):D(a[h][d],u[A]),w[h]=b;for(h=0;h<m;h++)w[h]===b?y[h][d]=E[h]:y[h][d]=a[h][d]}return e.createDenseMatrix({data:y,size:[m,g],datatype:s===e._datatype&&p===r._datatype?v:void 0})}}),Qi=be("matAlgo04xSidSid",["typed","equalScalar"],e=>{var{typed:t,equalScalar:r}=e;return function(e,n,i){var a=e._values,o=e._index,s=e._ptr,u=e._size,c=e._datatype||void 0===e._data?e._datatype:e.getDataType(),f=n._values,l=n._index,p=n._ptr,h=n._size,d=n._datatype||void 0===n._data?n._datatype:n.getDataType();if(u.length!==h.length)throw new pn(u.length,h.length);if(u[0]!==h[0]||u[1]!==h[1])throw new RangeError("Dimension mismatch. Matrix A ("+u+") must match Matrix B ("+h+")");var m,g=u[0],v=u[1],D=r,y=0,E=i;"string"==typeof c&&c===d&&"mixed"!==c&&(m=c,D=t.find(r,[m,m]),y=t.convert(0,m),E=t.find(i,[m,m]));var w,b,x,N,A,F=a&&f?[]:void 0,C=[],S=[],T=a&&f?[]:void 0,_=a&&f?[]:void 0,M=[],B=[];for(b=0;b<v;b++){S[b]=C.length;var O=b+1;for(N=s[b],A=s[b+1],x=N;x<A;x++)w=o[x],C.push(w),M[w]=O,T&&(T[w]=a[x]);for(N=p[b],A=p[b+1],x=N;x<A;x++)if(M[w=l[x]]===O){if(T){var I=E(T[w],f[x]);D(I,y)?M[w]=null:T[w]=I}}else C.push(w),B[w]=O,_&&(_[w]=f[x]);if(T&&_)for(x=S[b];x<C.length;)M[w=C[x]]===O?(F[x]=T[w],x++):B[w]===O?(F[x]=_[w],x++):C.splice(x,1)}return S[v]=C.length,e.createSparseMatrix({values:F,index:C,ptr:S,size:[g,v],datatype:c===e._datatype&&d===n._datatype?m:void 0})}}),ea=be("matAlgo10xSids",["typed","DenseMatrix"],e=>{var{typed:t,DenseMatrix:r}=e;return function(e,n,i,a){var o=e._values,s=e._index,u=e._ptr,c=e._size,f=e._datatype;if(!o)throw new Error("Cannot perform operation on Pattern Sparse Matrix and Scalar value");var l,p=c[0],h=c[1],d=i;"string"==typeof f&&(l=f,n=t.convert(n,l),d=t.find(i,[l,l]));for(var m=[],g=[],v=[],D=0;D<h;D++){for(var y=D+1,E=u[D],w=u[D+1],b=E;b<w;b++){var x=s[b];g[x]=o[b],v[x]=y}for(var N=0;N<p;N++)0===D&&(m[N]=[]),v[N]===y?m[N][D]=a?d(n,g[N]):d(g[N],n):m[N][D]=n}return new r({data:m,size:[p,h],datatype:l})}});function ta(e,t,r,n){if(!(this instanceof ta))throw new SyntaxError("Constructor must be called with the new operator");this.fn=e,this.count=t,this.min=r,this.max=n,this.message="Wrong number of arguments in function "+e+" ("+t+" provided, "+r+(null!=n?"-"+n:"")+" expected)",this.stack=(new Error).stack}ta.prototype=new Error,ta.prototype.constructor=Error,ta.prototype.name="ArgumentsError",ta.prototype.isArgumentsError=!0;var ra=be("matAlgo06xS0S0",["typed","equalScalar"],e=>{var{typed:t,equalScalar:r}=e;return function(e,n,i){var a=e._values,o=e._size,s=e._datatype||void 0===e._data?e._datatype:e.getDataType(),u=n._values,c=n._size,f=n._datatype||void 0===n._data?n._datatype:n.getDataType();if(o.length!==c.length)throw new pn(o.length,c.length);if(o[0]!==c[0]||o[1]!==c[1])throw new RangeError("Dimension mismatch. Matrix A ("+o+") must match Matrix B ("+c+")");var l,p=o[0],h=o[1],d=r,m=0,g=i;"string"==typeof s&&s===f&&"mixed"!==s&&(l=s,d=t.find(r,[l,l]),m=t.convert(0,l),g=t.find(i,[l,l]));for(var v=a&&u?[]:void 0,D=[],y=[],E=v?[]:void 0,w=[],b=[],x=0;x<h;x++){y[x]=D.length;var N=x+1;if(Hn(e,x,w,E,b,N,D,g),Hn(n,x,w,E,b,N,D,g),E)for(var A=y[x];A<D.length;){var F=D[A];if(b[F]===N){var C=E[F];d(C,m)?D.splice(A,1):(v.push(C),A++)}else D.splice(A,1)}else for(var S=y[x];S<D.length;){b[D[S]]!==N?D.splice(S,1):S++}}return y[h]=D.length,e.createSparseMatrix({values:v,index:D,ptr:y,size:[p,h],datatype:s===e._datatype&&f===n._datatype?l:void 0})}}),na=be("multiplyScalar",["typed"],e=>{var{typed:t}=e;return t("multiplyScalar",{"number, number":Kn,"Complex, Complex":function(e,t){return e.mul(t)},"BigNumber, BigNumber":function(e,t){return e.times(t)},"bigint, bigint":function(e,t){return e*t},"Fraction, Fraction":function(e,t){return e.mul(t)},"number | Fraction | BigNumber | Complex, Unit":(e,t)=>t.multiply(e),"Unit, number | Fraction | BigNumber | Complex | Unit":(e,t)=>e.multiply(t)})}),ia="multiply",aa=be(ia,["typed","matrix","addScalar","multiplyScalar","equalScalar","dot"],e=>{var{typed:t,matrix:r,addScalar:n,multiplyScalar:i,equalScalar:a,dot:o}=e,s=Ti({typed:t,equalScalar:a}),u=Mi({typed:t});function c(e,t){switch(e.length){case 1:switch(t.length){case 1:if(e[0]!==t[0])throw new RangeError("Dimension mismatch in multiplication. Vectors must have the same length");break;case 2:if(e[0]!==t[0])throw new RangeError("Dimension mismatch in multiplication. Vector length ("+e[0]+") must match Matrix rows ("+t[0]+")");break;default:throw new Error("Can only multiply a 1 or 2 dimensional matrix (Matrix B has "+t.length+" dimensions)")}
1break;case 2:switch(t.length){case 1:if(e[1]!==t[0])throw new RangeError("Dimension mismatch in multiplication. Matrix columns ("+e[1]+") must match Vector length ("+t[0]+")");break;case 2:if(e[1]!==t[0])throw new RangeError("Dimension mismatch in multiplication. Matrix A columns ("+e[1]+") must match Matrix B rows ("+t[0]+")");break;default:throw new Error("Can only multiply a 1 or 2 dimensional matrix (Matrix B has "+t.length+" dimensions)")}break;default:throw new Error("Can only multiply a 1 or 2 dimensional matrix (Matrix A has "+e.length+" dimensions)")}}function f(e,r){if("dense"!==r.storage())throw new Error("Support for SparseMatrix not implemented");return function(e,r){var a,o=e._data,s=e._size,u=e._datatype||e.getDataType(),c=r._data,f=r._size,l=r._datatype||r.getDataType(),p=s[0],h=f[1],d=n,m=i;u&&l&&u===l&&"string"==typeof u&&"mixed"!==u&&(a=u,d=t.find(n,[a,a]),m=t.find(i,[a,a]));for(var g=[],v=0;v<h;v++){for(var D=m(o[0],c[0][v]),y=1;y<p;y++)D=d(D,m(o[y],c[y][v]));g[v]=D}return e.createDenseMatrix({data:g,size:[h],datatype:u===e._datatype&&l===r._datatype?a:void 0})}(e,r)}var l=t("_multiplyMatrixVector",{"DenseMatrix, any":function(e,r){var a,o=e._data,s=e._size,u=e._datatype||e.getDataType(),c=r._data,f=r._datatype||r.getDataType(),l=s[0],p=s[1],h=n,d=i;u&&f&&u===f&&"string"==typeof u&&"mixed"!==u&&(a=u,h=t.find(n,[a,a]),d=t.find(i,[a,a]));for(var m=[],g=0;g<l;g++){for(var v=o[g],D=d(v[0],c[0]),y=1;y<p;y++)D=h(D,d(v[y],c[y]));m[g]=D}return e.createDenseMatrix({data:m,size:[l],datatype:u===e._datatype&&f===r._datatype?a:void 0})},"SparseMatrix, any":function(e,r){var o=e._values,s=e._index,u=e._ptr,c=e._datatype||void 0===e._data?e._datatype:e.getDataType();if(!o)throw new Error("Cannot multiply Pattern only Matrix times Dense Matrix");var f,l=r._data,p=r._datatype||r.getDataType(),h=e._size[0],d=r._size[0],m=[],g=[],v=[],D=n,y=i,E=a,w=0;c&&p&&c===p&&"string"==typeof c&&"mixed"!==c&&(f=c,D=t.find(n,[f,f]),y=t.find(i,[f,f]),E=t.find(a,[f,f]),w=t.convert(0,f));var b=[],x=[];v[0]=0;for(var N=0;N<d;N++){var A=l[N];if(!E(A,w))for(var F=u[N],C=u[N+1],S=F;S<C;S++){var T=s[S];x[T]?b[T]=D(b[T],y(A,o[S])):(x[T]=!0,g.push(T),b[T]=y(A,o[S]))}}for(var _=g.length,M=0;M<_;M++){var B=g[M];m[M]=b[B]}return v[1]=g.length,e.createSparseMatrix({values:m,index:g,ptr:v,size:[h,1],datatype:c===e._datatype&&p===r._datatype?f:void 0})}}),p=t("_multiplyMatrixMatrix",{"DenseMatrix, DenseMatrix":function(e,r){var a,o=e._data,s=e._size,u=e._datatype||e.getDataType(),c=r._data,f=r._size,l=r._datatype||r.getDataType(),p=s[0],h=s[1],d=f[1],m=n,g=i;u&&l&&u===l&&"string"==typeof u&&"mixed"!==u&&"mixed"!==u&&(a=u,m=t.find(n,[a,a]),g=t.find(i,[a,a]));for(var v=[],D=0;D<p;D++){var y=o[D];v[D]=[];for(var E=0;E<d;E++){for(var w=g(y[0],c[0][E]),b=1;b<h;b++)w=m(w,g(y[b],c[b][E]));v[D][E]=w}}return e.createDenseMatrix({data:v,size:[p,d],datatype:u===e._datatype&&l===r._datatype?a:void 0})},"DenseMatrix, SparseMatrix":function(e,r){var o=e._data,s=e._size,u=e._datatype||e.getDataType(),c=r._values,f=r._index,l=r._ptr,p=r._size,h=r._datatype||void 0===r._data?r._datatype:r.getDataType();if(!c)throw new Error("Cannot multiply Dense Matrix times Pattern only Matrix");var d,m=s[0],g=p[1],v=n,D=i,y=a,E=0;u&&h&&u===h&&"string"==typeof u&&"mixed"!==u&&(d=u,v=t.find(n,[d,d]),D=t.find(i,[d,d]),y=t.find(a,[d,d]),E=t.convert(0,d));for(var w=[],b=[],x=[],N=r.createSparseMatrix({values:w,index:b,ptr:x,size:[m,g],datatype:u===e._datatype&&h===r._datatype?d:void 0}),A=0;A<g;A++){x[A]=b.length;var F=l[A],C=l[A+1];if(C>F)for(var S=0,T=0;T<m;T++){for(var _=T+1,M=void 0,B=F;B<C;B++){var O=f[B];S!==_?(M=D(o[T][O],c[B]),S=_):M=v(M,D(o[T][O],c[B]))}S!==_||y(M,E)||(b.push(T),w.push(M))}}return x[g]=b.length,N},"SparseMatrix, DenseMatrix":function(e,r){var o=e._values,s=e._index,u=e._ptr,c=e._datatype||void 0===e._data?e._datatype:e.getDataType();if(!o)throw new Error("Cannot multiply Pattern only Matrix times Dense Matrix");var f,l=r._data,p=r._datatype||r.getDataType(),h=e._size[0],d=r._size[0],m=r._size[1],g=n,v=i,D=a,y=0;c&&p&&c===p&&"string"==typeof c&&"mixed"!==c&&(f=c,g=t.find(n,[f,f]),v=t.find(i,[f,f]),D=t.find(a,[f,f]),y=t.convert(0,f));for(var E=[],w=[],b=[],x=e.createSparseMatrix({values:E,index:w,ptr:b,size:[h,m],datatype:c===e._datatype&&p===r._datatype?f:void 0}),N=[],A=[],F=0;F<m;F++){b[F]=w.length;for(var C=F+1,S=0;S<d;S++){var T=l[S][F];if(!D(T,y))for(var _=u[S],M=u[S+1],B=_;B<M;B++){var O=s[B];A[O]!==C?(A[O]=C,w.push(O),N[O]=v(T,o[B])):N[O]=g(N[O],v(T,o[B]))}}for(var I=b[F],k=w.length,R=I;R<k;R++){var j=w[R];E[R]=N[j]}}return b[m]=w.length,x},"SparseMatrix, SparseMatrix":function(e,r){var a,o=e._values,s=e._index,u=e._ptr,c=e._datatype||void 0===e._data?e._datatype:e.getDataType(),f=r._values,l=r._index,p=r._ptr,h=r._datatype||void 0===r._data?r._datatype:r.getDataType(),d=e._size[0],m=r._size[1],g=
1o&&f,v=n,D=i;c&&h&&c===h&&"string"==typeof c&&"mixed"!==c&&(a=c,v=t.find(n,[a,a]),D=t.find(i,[a,a]));for(var y,E,w,b,x,N,A,F,C=g?[]:void 0,S=[],T=[],_=e.createSparseMatrix({values:C,index:S,ptr:T,size:[d,m],datatype:c===e._datatype&&h===r._datatype?a:void 0}),M=g?[]:void 0,B=[],O=0;O<m;O++){T[O]=S.length;var I=O+1;for(x=p[O],N=p[O+1],b=x;b<N;b++)if(F=l[b],g)for(E=u[F],w=u[F+1],y=E;y<w;y++)B[A=s[y]]!==I?(B[A]=I,S.push(A),M[A]=D(f[b],o[y])):M[A]=v(M[A],D(f[b],o[y]));else for(E=u[F],w=u[F+1],y=E;y<w;y++)B[A=s[y]]!==I&&(B[A]=I,S.push(A));if(g)for(var k=T[O],R=S.length,j=k;j<R;j++){var z=S[j];C[j]=M[z]}}return T[m]=S.length,_}});return t(ia,i,{"Array, Array":t.referTo("Matrix, Matrix",e=>(t,n)=>{c(dn(t),dn(n));var i=e(r(t),r(n));return x(i)?i.valueOf():i}),"Matrix, Matrix":function(e,t){var r=e.size(),n=t.size();return c(r,n),1===r.length?1===n.length?function(e,t,r){if(0===r)throw new Error("Cannot multiply two empty vectors");return o(e,t)}(e,t,r[0]):f(e,t):1===n.length?l(e,t):p(e,t)},"Matrix, Array":t.referTo("Matrix,Matrix",e=>(t,n)=>e(t,r(n))),"Array, Matrix":t.referToSelf(e=>(t,n)=>e(r(t,n.storage()),n)),"SparseMatrix, any":function(e,t){return s(e,t,i,!1)},"DenseMatrix, any":function(e,t){return u(e,t,i,!1)},"any, SparseMatrix":function(e,t){return s(t,e,i,!0)},"any, DenseMatrix":function(e,t){return u(t,e,i,!0)},"Array, any":function(e,t){return u(r(e),t,i,!1).valueOf()},"any, Array":function(e,t){return u(r(t),e,i,!0).valueOf()},"any, any":i,"any, any, ...any":t.referToSelf(e=>(t,r,n)=>{for(var i=e(t,r),a=0;a<n.length;a++)i=e(i,n[a]);return i})})}),oa=be("matAlgo07xSSf",["typed","SparseMatrix"],e=>{var{typed:t,SparseMatrix:r}=e;return function(e,i,a){var o=e._size,s=e._datatype||void 0===e._data?e._datatype:e.getDataType(),u=i._size,c=i._datatype||void 0===i._data?i._datatype:i.getDataType();if(o.length!==u.length)throw new pn(o.length,u.length);if(o[0]!==u[0]||o[1]!==u[1])throw new RangeError("Dimension mismatch. Matrix A ("+o+") must match Matrix B ("+u+")");var f,l=o[0],p=o[1],h=0,d=a;"string"==typeof s&&s===c&&"mixed"!==s&&(f=s,h=t.convert(0,f),d=t.find(a,[f,f]));for(var m=[],g=[],v=new Array(p+1).fill(0),D=[],y=[],E=[],w=[],b=0;b<p;b++){var x=b+1,N=0;n(e,b,E,D,x),n(i,b,w,y,x);for(var A=0;A<l;A++){var F=d(E[A]===x?D[A]:h,w[A]===x?y[A]:h);0!==F&&!1!==F&&(g.push(A),m.push(F),N++)}v[b+1]=v[b]+N}return new r({values:m,index:g,ptr:v,size:[l,p],datatype:s===e._datatype&&c===i._datatype?f:void 0})};function n(e,t,r,n,i){for(var a=e._values,o=e._index,s=e._ptr,u=s[t],c=s[t+1];u<c;u++){var f=o[u];r[f]=i,n[f]=a[u]}}}),sa="conj",ua=be(sa,["typed"],e=>{var{typed:t}=e;return t(sa,{"number | BigNumber | Fraction":e=>e,Complex:e=>e.conjugate(),Unit:t.referToSelf(e=>t=>new t.constructor(e(t.toNumeric()),t.formatUnits())),"Array | Matrix":t.referToSelf(e=>t=>$n(t,e))})}),ca=be("not",["typed"],e=>{var{typed:t}=e;return t("not",{"null | undefined":()=>!0,number:ni,Complex:function(e){return 0===e.re&&0===e.im},BigNumber:function(e){return e.isZero()||e.isNaN()},bigint:e=>!e,Unit:t.referToSelf(e=>r=>t.find(e,r.valueType())(r.value)),"Array | Matrix":t.referToSelf(e=>t=>$n(t,e))})}),fa=be("or",["typed","matrix","equalScalar","DenseMatrix","concat"],e=>{var{typed:t,matrix:r,equalScalar:n,DenseMatrix:i,concat:a}=e,o=Vi({typed:t}),s=Yi({typed:t,equalScalar:n}),u=_i({typed:t,DenseMatrix:i}),c=Xi({typed:t,matrix:r,concat:a});return t("or",{"number, number":ii,"Complex, Complex":function(e,t){return 0!==e.re||0!==e.im||0!==t.re||0!==t.im},"BigNumber, BigNumber":function(e,t){return!e.isZero()&&!e.isNaN()||!t.isZero()&&!t.isNaN()},"bigint, bigint":ii,"Unit, Unit":t.referToSelf(e=>(t,r)=>e(t.value||0,r.value||0))},c({SS:s,DS:o,Ss:u}))}),la="concat",pa=be(la,["typed","matrix","isInteger"],e=>{var{typed:t,matrix:r,isInteger:n}=e;return t(la,{"...Array | Matrix | number | BigNumber":function(e){var t,i,a=e.length,o=-1,s=!1,u=[];for(t=0;t<a;t++){var c=e[t];if(x(c)&&(s=!0),m(c)||g(c)){if(t!==a-1)throw new Error("Dimension must be specified as last argument");if(i=o,o=c.valueOf(),!n(o))throw new TypeError("Integer number expected for dimension");if(o<0||t>0&&o>i)throw new hn(o,i+1)}else{var f=oe(c).valueOf(),l=dn(f);if(u[t]=f,i=o,o=l.length-1,t>0&&o!==i)throw new pn(i+1,o+1)}}if(0===u.length)throw new SyntaxError("At least one matrix expected");for(var p=u.shift();u.length;)p=Bn(p,u.shift(),o);return s?r(p):p},"...string":function(e){return e.join("")}})}),ha="identity",da=be(ha,["typed","config","matrix","BigNumber","DenseMatrix","SparseMatrix"],e=>{var{typed:t,config:r,matrix:n,BigNumber:i,DenseMatrix:a,SparseMatrix:o}=e;return t(ha,{"":function(){return"Matrix"===r.matrix?n([]):[]},string:function(e){return n(e)}
1,"number | BigNumber":function(e){return u(e,e,"Matrix"===r.matrix?"dense":void 0)},"number | BigNumber, string":function(e,t){return u(e,e,t)},"number | BigNumber, number | BigNumber":function(e,t){return u(e,t,"Matrix"===r.matrix?"dense":void 0)},"number | BigNumber, number | BigNumber, string":function(e,t,r){return u(e,t,r)},Array:function(e){return s(e)},"Array, string":function(e,t){return s(e,t)},Matrix:function(e){return s(e.valueOf(),e.storage())},"Matrix, string":function(e,t){return s(e.valueOf(),t)}});function s(e,t){switch(e.length){case 0:return t?n(t):[];case 1:return u(e[0],e[0],t);case 2:return u(e[0],e[1],t);default:throw new Error("Vector containing two values expected")}}function u(e,t,r){var n=g(e)||g(t)?i:null;if(g(e)&&(e=e.toNumber()),g(t)&&(t=t.toNumber()),!Ae(e)||e<1)throw new Error("Parameters in function identity must be positive integers");if(!Ae(t)||t<1)throw new Error("Parameters in function identity must be positive integers");var s=n?new i(1):1,u=n?new n(0):0,c=[e,t];if(r){if("sparse"===r)return o.diagonal(c,s,0,u);if("dense"===r)return a.diagonal(c,s,0,u);throw new TypeError('Unknown matrix type "'.concat(r,'"'))}for(var f=En([],c,u),l=e<t?e:t,p=0;p<l;p++)f[p][p]=s;return f}});function ma(){throw new Error('No "bignumber" implementation available')}function ga(){throw new Error('No "fraction" implementation available')}var va="size",Da=be(va,["typed"],e=>{var{typed:t}=e;return t(va,{Matrix:e=>e.size(),Array:dn,string:e=>[e.length],"number | Complex | BigNumber | Unit | boolean | null":e=>[]})}),ya="subset",Ea=be(ya,["typed","matrix","zeros","add"],e=>{var{typed:t,matrix:r,zeros:n,add:i}=e;return t(ya,{"Matrix, Index":function(e,t){return yn(t)?r():(vn(e,t),e.subset(t))},"Array, Index":t.referTo("Matrix, Index",function(e){return function(t,n){var i=e(r(t),n);return n.isScalar()?i:i.valueOf()}}),"Object, Index":xa,"string, Index":wa,"Matrix, Index, any, any":function(e,t,r,a){return yn(t)?e:(vn(e,t),e.clone().subset(t,function(e,t){if("string"==typeof e)throw new Error("can't boradcast a string");if(t.isScalar())return e;var r=t.size();if(!r.every(e=>e>0))return e;try{return i(e,n(r))}catch(a){return e}}(r,t),a))},"Array, Index, any, any":t.referTo("Matrix, Index, any, any",function(e){return function(t,n,i,a){var o=e(r(t),n,i,a);return o.isMatrix?o.valueOf():o}}),"Array, Index, any":t.referTo("Matrix, Index, any, any",function(e){return function(t,n,i){return e(r(t),n,i,void 0).valueOf()}}),"Matrix, Index, any":t.referTo("Matrix, Index, any, any",function(e){return function(t,r,n){return e(t,r,n,void 0)}}),"string, Index, string":ba,"string, Index, string, string":ba,"Object, Index, any":Na})});function wa(e,t){if(!S(t))throw new TypeError("Index expected");if(yn(t))return"";if(vn(Array.from(e),t),1!==t.size().length)throw new pn(t.size().length,1);var r=e.length;Dn(t.min()[0],r),Dn(t.max()[0],r);var n=t.dimension(0),i="";function a(t){i+=e.charAt(t)}return Number.isInteger(n)?a(n):n.forEach(a),i}function ba(e,t,r,n){if(!t||!0!==t.isIndex)throw new TypeError("Index expected");if(yn(t))return e;if(vn(Array.from(e),t),1!==t.size().length)throw new pn(t.size().length,1);if(void 0!==n){if("string"!=typeof n||1!==n.length)throw new TypeError("Single character expected as defaultValue")}else n=" ";var i=t.dimension(0);if((Number.isInteger(i)?1:i.size()[0])!==r.length)throw new pn(i.size()[0],r.length);var a=e.length;Dn(t.min()[0]),Dn(t.max()[0]);for(var o=[],s=0;s<a;s++)o[s]=e.charAt(s);function u(e,t){o[e]=r.charAt(t[0])}if(Number.isInteger(i)?u(i,[0]):i.forEach(u),o.length>a)for(var c=a-1,f=o.length;c<f;c++)o[c]||(o[c]=n);return o.join("")}function xa(e,t){if(!yn(t)){if(1!==t.size().length)throw new pn(t.size(),1);var r=t.dimension(0);if("string"!=typeof r)throw new TypeError("String expected as index to retrieve an object property");return a(e,r)}}function Na(e,t,r){if(yn(t))return e;if(1!==t.size().length)throw new pn(t.size(),1);var n=t.dimension(0);if("string"!=typeof n)throw new TypeError("String expected as index to retrieve an object property");var i=oe(e);return o(i,n,r),i}var Aa="zeros",Fa=be(Aa,["typed","config","matrix","BigNumber"],e=>{var{typed:t,config:r,matrix:n,BigNumber:i}=e;return t(Aa,{"":function(){return"Array"===r.matrix?a([]):a([],"default")},"...number | BigNumber | string":function(e){if("string"==typeof e[e.length-1]){var t=e.pop();return a(e,t)}return"Array"===r.matrix?a(e):a(e,"default")},Array:a,Matrix:function(e){var t=e.storage();return a(e.valueOf(),t)},"Array | Matrix, string":function(e,t){return a(e.valueOf(),t)}});function a(e,t){var r=function(e){var t=!1;return e.forEach(function(e,r,n){g(e)&&(t=!0,n[r]=e.toNumber())}),t}(e),a=r?new i(0):0;if(function(e){e.forEach(function(e){if("number"!=typeof e||!Ae(e)||e<0)throw new Error("Parameters in function zeros must be positive integers")})}(e),t){var o=n(t);return e.length>0?o.resize(e,a):o}var s=[];return e.length>0?En(s,e,a):s}});function Ca(e){return(Ca="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function Sa(e){var t=function(e,t){if("object"!=Ca(e)||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t);if("object"!=Ca(n))return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==Ca(t)?t:t+""}function Ta(e,t,r){return(t=Sa(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var _a="format",Ma=be(_a,["typed"],e=>{var{typed:t}=e;return t(_a,{any:sn,"any, Object | function | number | BigNumber":sn})}),Ba=be("numeric",["number","?bignumber","?fraction"],e=>{var{number:t,bignumber:r,fraction:n}=e,i={string:!0,number:!0,BigNumber:!0,Fraction:!0},a={number:e=>t(e),BigNumber:r?e=>r(e):ma,bigint:e=>BigInt(e),Fraction:n?e=>n(e):ga};return function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"number";if(void 0!==(arguments.length>2?arguments[2]:void 0))throw new SyntaxError("numeric() takes one or tw
1o arguments");var r=ae(e);if(!(r in i))throw new TypeError("Cannot convert "+e+' of type "'+r+'"; valid input types are '+Object.keys(i).join(", "));if(!(t in a))throw new TypeError("Cannot convert "+e+' to type "'+t+'"; valid output types are '+Object.keys(a).join(", "));return t===r?e:a[t](e)}}),Oa="divideScalar",Ia=be(Oa,["typed","numeric"],e=>{var{typed:t,numeric:r}=e;return t(Oa,{"number, number":function(e,t){return e/t},"Complex, Complex":function(e,t){return e.div(t)},"BigNumber, BigNumber":function(e,t){return e.div(t)},"bigint, bigint":function(e,t){return e/t},"Fraction, Fraction":function(e,t){return e.div(t)},"Unit, number | Complex | Fraction | BigNumber | Unit":(e,t)=>e.divide(t),"number | Fraction | Complex | BigNumber, Unit":(e,t)=>t.divideInto(e)})}),ka=be("pow",["typed","config","identity","multiply","matrix","inv","fraction","number","Complex"],t=>{var{typed:r,config:n,identity:i,multiply:a,matrix:o,inv:s,number:u,fraction:c,Complex:f}=t;return r("pow",{"number, number":l,"Complex, Complex":function(e,t){return e.pow(t)},"BigNumber, BigNumber":function(e,t){return t.isInteger()||e>=0||n.predictable?e.pow(t):new f(e.toNumber(),0).pow(t.toNumber(),0)},"bigint, bigint":(t,r)=>e(t,r),"Fraction, Fraction":function(e,t){var r=e.pow(t);if(null!=r)return r;if(n.predictable)throw new Error("Result of pow is non-rational and cannot be expressed as a fraction");return l(e.valueOf(),t.valueOf())},"Array, number":p,"Array, BigNumber":function(e,t){return p(e,t.toNumber())},"Matrix, number":h,"Matrix, BigNumber":function(e,t){return h(e,t.toNumber())},"Unit, number | BigNumber":function(e,t){return e.pow(t)}});function l(e,t){if(n.predictable&&!Ae(t)&&e<0)try{var r=c(t),i=u(r);if((t===i||Math.abs((t-i)/t)<1e-14)&&r.d%BigInt("2")===BigInt("1"))return(r.n%BigInt("2")===BigInt("0")?1:-1)*Math.pow(-e,t)}catch(a){}return n.predictable&&(e<-1&&t===1/0||e>-1&&e<0&&t===-1/0)?NaN:Ae(t)||e>=0||n.predictable?ei(e,t):e*e<1&&t===1/0||e*e>1&&t===-1/0?0:new f(e,0).pow(t,0)}function p(e,t){if(!Ae(t))throw new TypeError("For A^b, b must be an integer (value is "+t+")");var r=dn(e);if(2!==r.length)throw new Error("For A^b, A must be 2 dimensional (A has "+r.length+" dimensions)");if(r[0]!==r[1])throw new Error("For A^b, A must be square (size is "+r[0]+"x"+r[1]+")");if(t<0)try{return p(s(e),-t)}catch(u){if("Cannot calculate inverse, determinant is zero"===u.message)throw new TypeError("For A^b, when A is not invertible, b must be a positive integer (value is "+t+")");throw u}for(var n=i(r[0]).valueOf(),o=e;t>=1;)1&~t||(n=a(o,n)),t>>=1,o=a(o,o);return n}function h(e,t){return o(p(e.valueOf(),t))}}),Ra="Number of decimals in function round must be an integer",ja="round",za=be(ja,["typed","config","matrix","equalScalar","zeros","BigNumber","DenseMatrix"],e=>{var{typed:t,config:r,matrix:n,equalScalar:i,zeros:a,BigNumber:o,DenseMatrix:s}=e,u=Ti({typed:t,equalScalar:i}),c=_i({typed:t,DenseMatrix:s}),f=Mi({typed:t});function l(e){return Math.abs(Te(e).exponent)}return t(ja,{number:function(e){var t=ti(e,l(r.relTol));return ti(Ie(e,t,r.relTol,r.absTol)?t:e)},"number, number":function(e,t){var n=l(r.relTol);if(t>=n)return ti(e,t);var i=ti(e,n);return ti(Ie(e,i,r.relTol,r.absTol)?i:e,t)},"number, BigNumber":function(e,t){if(!t.isInteger())throw new TypeError(Ra);return new o(e).toDecimalPlaces(t.toNumber())},Complex:function(e){return e.round()},"Complex, number":function(e,t){if(t%1)throw new TypeError(Ra);return e.round(t)},"Complex, BigNumber":function(e,t){if(!t.isInteger())throw new TypeError(Ra);var r=t.toNumber();return e.round(r)},BigNumber:function(e){var t=new o(e).toDecimalPlaces(l(r.relTol));return(oi(e,t,r.relTol,r.absTol)?t:e).toDecimalPlaces(0)},"BigNumber, BigNumber":function(e,t){if(!t.isInteger())throw new TypeError(Ra);var n=l(r.relTol);if(t>=n)return e.toDecimalPlaces(t.toNumber());var i=e.toDecimalPlaces(n);return(oi(e,i,r.relTol,r.absTol)?i:e).toDecimalPlaces(t.toNumber())},bigint:e=>e,"bigint, number":(e,t)=>e,"bigint, BigNumber":(e,t)=>e,Fraction:function(e){return e.round()},"Fraction, number":function(e,t){if(t%1)throw new TypeError(Ra);return e.round(t)},"Fraction, BigNumber":function(e,t){if(!t.isInteger())throw new TypeError(Ra);return e.round(t.toNumber())},"Unit, number, Unit":t.referToSelf(e=>function(t,r,n){var i=t.toNumeric(n);return n.multiply(e(i,r))}),"Unit, BigNumber, Unit":t.referToSelf(e=>(t,r,n)=>e(t,r.toNumber(),n)),"Array | Matrix, number | BigNumber, Unit":t.referToSelf(e=>(t,r,n)=>$n(t,t=>e(t,r,n),!0)),"Array | Matrix | Unit, Unit":t.referToSelf(e=>(t,r)=>e(t,0,r)),"Array | Matrix":t.referToSelf(e=>t=>$n(t,e,!0)),"SparseMatrix, number | BigNumber":t.referToSelf(e=>(t,r)=>
1u(t,r,e,!1)),"DenseMatrix, number | BigNumber":t.referToSelf(e=>(t,r)=>f(t,r,e,!1)),"Array, number | BigNumber":t.referToSelf(e=>(t,r)=>f(n(t),r,e,!1).valueOf()),"number | Complex | BigNumber | Fraction, SparseMatrix":t.referToSelf(e=>(t,r)=>i(t,0)?a(r.size(),r.storage()):c(r,t,e,!0)),"number | Complex | BigNumber | Fraction, DenseMatrix":t.referToSelf(e=>(t,r)=>i(t,0)?a(r.size(),r.storage()):f(r,t,e,!0)),"number | Complex | BigNumber | Fraction, Array":t.referToSelf(e=>(t,r)=>f(n(r),t,e,!0).valueOf())})}),Ua=be("and",["typed","matrix","equalScalar","zeros","not","concat"],e=>{var{typed:t,matrix:r,equalScalar:n,zeros:i,not:a,concat:o}=e,s=Wi({typed:t,equalScalar:n}),u=ra({typed:t,equalScalar:n}),c=Ti({typed:t,equalScalar:n}),f=Mi({typed:t}),l=Xi({typed:t,matrix:r,concat:o});return t("and",{"number, number":ai,"Complex, Complex":function(e,t){return!(0===e.re&&0===e.im||0===t.re&&0===t.im)},"BigNumber, BigNumber":function(e,t){return!(e.isZero()||t.isZero()||e.isNaN()||t.isNaN())},"bigint, bigint":ai,"Unit, Unit":t.referToSelf(e=>(t,r)=>e(t.value||0,r.value||0)),"SparseMatrix, any":t.referToSelf(e=>(t,r)=>a(r)?i(t.size(),t.storage()):c(t,r,e,!1)),"DenseMatrix, any":t.referToSelf(e=>(t,r)=>a(r)?i(t.size(),t.storage()):f(t,r,e,!1)),"any, SparseMatrix":t.referToSelf(e=>(t,r)=>a(t)?i(t.size(),t.storage()):c(r,t,e,!0)),"any, DenseMatrix":t.referToSelf(e=>(t,r)=>a(t)?i(t.size(),t.storage()):f(r,t,e,!0)),"Array, any":t.referToSelf(e=>(t,n)=>e(r(t),n).valueOf()),"any, Array":t.referToSelf(e=>(t,n)=>e(t,r(n)).valueOf())},l({SS:u,DS:s}))}),Pa="equal",La=be(Pa,["typed","matrix","equalScalar","DenseMatrix","SparseMatrix"],e=>{var{typed:t,matrix:r,equalScalar:n,DenseMatrix:i,concat:a,SparseMatrix:o}=e,s=Vi({typed:t}),u=oa({typed:t,SparseMatrix:o}),c=_i({typed:t,DenseMatrix:i}),f=Xi({typed:t,matrix:r});return t(Pa,qa({typed:t,equalScalar:n}),f({elop:n,SS:u,DS:s,Ss:c}))}),qa=be(Pa,["typed","equalScalar"],e=>{var{typed:t,equalScalar:r}=e;return t(Pa,{"any, any":function(e,t){return null===e?null===t:null===t?null===e:void 0===e?void 0===t:void 0===t?void 0===e:r(e,t)}})});function $a(e){var t=0,r=1,n=Object.create(null),i=Object.create(null),a=0,o=function(e){var o=i[e];if(o&&(delete n[o],delete i[e],--t,r===o)){if(!t)return a=0,void(r=1);for(;!Object.prototype.hasOwnProperty.call(n,++r););}};return e=Math.abs(e),{hit:function(s){var u=i[s],c=++a;if(n[c]=s,i[s]=c,!u){if(++t<=e)return;return s=n[r],o(s),s}if(delete n[u],r===u)for(;!Object.prototype.hasOwnProperty.call(n,++r););},delete:o,clear:function(){t=a=0,r=1,n=Object.create(null),i=Object.create(null)}}}function Ha(e){var{hasher:t,limit:r}=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return r=null==r?Number.POSITIVE_INFINITY:r,t=null==t?JSON.stringify:t,function n(){"object"!=typeof n.cache&&(n.cache={values:new Map,lru:$a(r||Number.POSITIVE_INFINITY)});for(var i=[],a=0;a<arguments.length;a++)i[a]=arguments[a];var o=t(i);if(n.cache.values.has(o))return n.cache.lru.hit(o),n.cache.values.get(o);var s=e.apply(e,i);return n.cache.values.set(o,s),n.cache.values.delete(n.cache.lru.hit(o)),s}}Ha(function(e){return new e(1).exp()},{hasher:Wa}),Ha(function(e){return new e(1).plus(new e(5).sqrt()).div(2)},{hasher:Wa});var Ga=Ha(function(e){return e.acos(-1)},{hasher:Wa});function Wa(e){return e[0].precision}function Va(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function Ya(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Va(Object(r),!0).forEach(function(t){Ta(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Va(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}Ha(function(e){return Ga(e).times(2)},{hasher:Wa});var Ja=be("Unit",["?on","config","addScalar","subtractScalar","multiplyScalar","divideScalar","pow","abs","fix","round","equal","isNumeric","format","number","Complex","BigNumber","Fraction"],e=>{var t,r,i,{on:a,config:o,addScalar:s,subtractScalar:u,multiplyScalar:c,divideScalar:f,pow:l,abs:p,fix:h,roun
1d:d,equal:m,isNumeric:g,format:v,number:y,Complex:w,BigNumber:b,Fraction:x}=e,N=y,A=!1,F=!0;function C(e,t){if(!(this instanceof C))throw new Error("Constructor must be called with the new operator");if(null!=e&&!g(e)&&!D(e))throw new TypeError("First parameter in Unit constructor must be number, BigNumber, Fraction, Complex, or undefined");if(this.fixPrefix=A,this.skipAutomaticSimplification=F,void 0===t)this.units=[],this.dimensions=P.map(e=>0);else if("string"==typeof t){var r=C.parse(t);this.units=r.units,this.dimensions=r.dimensions}else{if(!E(t)||null!==t.value)throw new TypeError("Second parameter in Unit constructor must be a string or valueless Unit");this.fixPrefix=t.fixPrefix,this.skipAutomaticSimplification=t.skipAutomaticSimplification,this.dimensions=t.dimensions.slice(0),this.units=t.units.map(e=>n({},e))}this.value=this._normalize(e)}function S(){for(;" "===i||"\t"===i;)_()}function T(e){return e>="0"&&e<="9"}function _(){r++,i=t.charAt(r)}function M(e){r=e,i=t.charAt(r)}function B(){var e,t="",n=r;if("+"===i?_():"-"===i&&(t+=i,_()),!((e=i)>="0"&&e<="9"||"."===e))return M(n),null;if("."===i){if(t+=i,_(),!T(i))return M(n),null}else{for(;T(i);)t+=i,_();"."===i&&(t+=i,_())}for(;T(i);)t+=i,_();if("E"===i||"e"===i){var a="",o=r;if(a+=i,_(),"+"!==i&&"-"!==i||(a+=i,_()),!T(i))return M(o),t;for(t+=a;T(i);)t+=i,_()}return t}function O(){for(var e="";T(i)||C.isValidAlpha(i);)e+=i,_();var t=e.charAt(0);return C.isValidAlpha(t)?e:null}function I(e){return i===e?(_(),e):null}Object.defineProperty(C,"name",{value:"Unit"}),C.prototype.constructor=C,C.prototype.type="Unit",C.prototype.isUnit=!0,C.parse=function(e,n){if(n=n||{},r=-1,i="","string"!=typeof(t=e))throw new TypeError("Invalid argument in Unit.parse, string expected");var a=new C;a.units=[];var s=1,u=!1;_(),S();var c=B(),f=null;if(c){if("BigNumber"===o.number)f=new b(c);else if("Fraction"===o.number)try{f=new x(c)}catch(E){f=parseFloat(c)}else f=parseFloat(c);S(),I("*")?(s=1,u=!0):I("/")&&(s=-1,u=!0)}for(var l=[],p=1;;){for(S();"("===i;)l.push(s),p*=s,s=1,_(),S();var h=void 0;if(!i)break;var d=i;if(null===(h=O()))throw new SyntaxError('Unexpected "'+d+'" in "'+t+'" at index '+r.toString());var m=k(h);if(null===m)throw new SyntaxError('Unit "'+h+'" not found.');var g=s*p;if(S(),I("^")){S();var v=B();if(null===v)throw new SyntaxError('In "'+e+'", "^" must be followed by a floating-point number');g*=v}a.units.push({unit:m.unit,prefix:m.prefix,power:g});for(var D=0;D<P.length;D++)a.dimensions[D]+=(m.unit.dimensions[D]||0)*g;for(S();")"===i;){if(0===l.length)throw new SyntaxError('Unmatched ")" in "'+t+'" at index '+r.toString());p/=l.pop(),_(),S()}if(u=!1,I("*")?(s=1,u=!0):I("/")?(s=-1,u=!0):s=1,m.unit.base){var y=m.unit.base.key;V.auto[y]={unit:m.unit,prefix:m.prefix}}}if(S(),i)throw new SyntaxError('Could not parse: "'+e+'"');if(u)throw new SyntaxError('Trailing characters: "'+e+'"');if(0!==l.length)throw new SyntaxError('Unmatched "(" in "'+t+'"');if(0===a.units.length&&!n.allowNoUnits)throw new SyntaxError('"'+e+'" contains 
1no units');return a.value=void 0!==f?a._normalize(f):null,a},C.prototype.clone=function(){var e=new C;e.fixPrefix=this.fixPrefix,e.skipAutomaticSimplification=this.skipAutomaticSimplification,e.value=oe(this.value),e.dimensions=this.dimensions.slice(0),e.units=[];for(var t=0;t<this.units.length;t++)for(var r in e.units[t]={},this.units[t])pe(this.units[t],r)&&(e.units[t][r]=this.units[t][r]);return e},C.prototype.valueType=function(){return ae(this.value)},C.prototype._isDerived=function(){return 0!==this.units.length&&(this.units.length>1||Math.abs(this.units[0].power-1)>1e-15)},C.prototype._normalize=function(e){if(null==e||0===this.units.length)return e;for(var t=e,r=C._getNumberConverter(ae(e)),n=0;n<this.units.length;n++){var i=r(this.units[n].unit.value),a=r(this.units[n].prefix.value),o=r(this.units[n].power);t=c(t,l(c(i,a),o))}return t},C.prototype._denormalize=function(e,t){if(null==e||0===this.units.length)return e;for(var r=e,n=C._getNumberConverter(ae(e)),i=0;i<this.units.length;i++){var a=n(this.units[i].unit.value),o=n(this.units[i].prefix.value),s=n(this.units[i].power);r=f(r,l(c(a,o),s))}return r};var k=Ha(e=>{if(pe(H,e)){var t=H[e];return{unit:t,prefix:t.prefixes[""]}}for(var r in H)if(pe(H,r)&&on(e,r)){var n=H[r],i=e.length-r.length,a=e.substring(0,i),o=pe(n.prefixes,a)?n.prefixes[a]:void 0;if(void 0!==o)return{unit:n,prefix:o}}return null},{hasher:e=>e[0],limit:100});function R(e){return e.equalBase(L.NONE)&&null!==e.value&&!o.predictable?e.value:e}function j(e){return C._getNumberConverter(ae(e))(1)}function z(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=e.skipAutomaticSimplification||null===e.value?e.clone():e.simplify();!function(e){var t=!1;void 0!==e.value&&null!==e.value&&D(e.value)&&(t=Math.abs(e.value.re)<1e-14);for(var r in e.units)pe(e.units,r)&&e.units[r].unit&&("VA"===e.units[r].unit.name&&t?e.units[r].unit=H.VAR:"VAR"!==e.units[r].unit.name||t||(e.units[r].unit=H.VA))}(r),function(e,t){1!==e.units.length||e.fixPrefix||Math.abs(e.units[0].power-Math.round(e.units[0].power))<1e-14&&(e.units[0].prefix=e._bestPrefix(t))}(r,t.offset);var n=r._denormalize(r.value),i=null!==r.value?v(n,t||{}):"",a=r.formatUnits();return{simp:r,valueStr:i,unitStr:a}}C.isValuelessUnit=function(e){return null!==k(e)},C.prototype.hasBase=function(e){if("string"==typeof e&&(e=L[e]),!e)return!1;for(var t=0;t<P.length;t++)if(Math.abs((this.dimensions[t]||0)-(e.dimensions[t]||0))>1e-12)return!1;return!0},C.prototype.equalBase=function(e){for(var t=0;t<P.length;t++)if(Math.abs((this.dimensions[t]||0)-(e.dimensions[t]||0))>1e-12)return!1;return!0},C.prototype.equals=function(e){return this.equalBase(e)&&m(this.value,e.value)},C.prototype.multiply=function(e){for(var t=this.clone(),r=E(e)?e:new C(e),n=0;n<P.length;n++)t.dimensions[n]=(this.dimensions[n]||0)+(r.dimensions[n]||0);for(var i=0;i<r.units.length;i++){var a=Ya({},r.units[i]);t.units.push(a)}if(null!==this.value||null!==r.value){var o=null===this.value?this._normalize(j(r.value)):this.value,s=null===r.value?r._normalize(j(this.value)):r.value;t.value=c(o,s)}else t.value=null;return E(e)&&(t.skipAutomaticSimplification=!1),R(t)},C.prototype.divideInto=function(e){return new C(e).divide(this)},C.prototype.divide=function(e){for(var t=this.clone(),r=E(e)?e:new C(e),n=0;n<P.length;n++)t.dimensions[n]=(this.dimensions[n]||0)-(r.dimensions[n]||0);for(var i=0;i<r.units.length;i++){var a=Ya(Ya({},r.units[i]),{},{power:-r.units[i].power});t.units.push(a)}if(null!==this.value||null!==r.value){var o=null===this.value?this._normalize(j(r.value)):this.value,s=null===r.value?r._normalize(j(this.value)):r.value;t.value=f(o,s)}else t.value=null;return E(e)&&(t.skipAutomaticSimplification=!1),R(t)},C.prototype.pow=function(e){for(var t=this.clone(),r=0;r<P.length;r++)t.dimensions[r]=(this.dimensions[r]||0)*e;for(var n=0;n<t.units.length;n++)t.units[n].power*=e;return null!==t.value?t.value=l(t.value,e):t.value=null,t.skipAutomaticSimplification=!1,R(t)},C.prototype.abs=function(){var e=this.clone();if(null!==e.value)if(e._isDerived()||0===e.units.length||0===e.units[0].unit.offset)e.value=p(e.value);else{var t=e._numberConverter(),r=t(e.units[0].unit.value),n=t(e.units[0].unit.offset),i=c(r,n);e.value=u(p(s(e.value,i)),i)}for(var a in e.units)"VA"!==e.units[a].unit.name&&"VAR"!==e.units[a].unit.name||(e.units[a].unit=H.W);return e},C.prototype.to=function(e){var t,r=null===this.value?this._normalize(1):this.value;if("string"==typeof e)t=C.parse(e);else{if(!E(e))throw new Error("String or Unit expected as parameter");t=e.clone()}if(!this.equalBase(t))throw new Error("Units do not match ('".concat(t.toString(),"' != '").concat(this.toString(),"')"));if(null!==t.value)throw new Error("Cannot convert to a unit with a value");if(null===this.value||this._isDerived()||0===this.units.length||0===t.units.length||this.units[0].unit.offset===t.units[0].unit.offset)t.value=oe(r);else{var n=C._getNumberConverter(ae(r)),i=this.units[0].unit.value,a=this.units[0].unit.offset,o=c(i,a),f=t.units[0].unit.value,l=t.units[0].unit.offset,p=c(f,l);t.value=s(r,n(u(o,p)))}return t.fixPrefix=!0,t.skipAutomaticSimplification=!0,t},C.prototype.toNumber=function(e){return N(this.toNumeric(e))},C.prototype.toNumeric=function(e){var t;return(t=e?this.to(e):this.clone())._isDerived()||0===t.units.length?t._denormalize(t.value):t._denormalize(t.value,t.units[0].prefix.value)},C.prototype.toString=function(){return this.format()},C.prototype.toJSON=function(){return{mathjs:"Unit",value:this._denormalize(this.value),unit:this.units.length>0?this.formatUnits():null,fixPrefix:this.fixPrefix,skipSimp:this.skipAutomaticSimplification}},C.fromJSON=function(e){var t,r,n,i=new C(e.value,null!==(t=e.unit)&&void 0!==t?t:void 0);return i.fixPrefix=null!==(r=e.fixPrefix)&&void 0!==r?r:A,i.skipAutomaticSimplification=null!==(n=e.skipSimp)&&void 0!==n?n:F,i},C.prototype.valueOf=C.prototype.toString,C.prototype.simplify=function(){var e,t,r=this.clone(),n=[];for(var i in Y)if(pe(Y,i)&&r.hasBase(L[i])){e=i;break}if("NONE"===e)r.units=[];else if(e&&pe(Y,e)&&(t=Y[e]),t)r.units=[{unit:t.unit,prefix:t.prefix,power:1}];else{for(var a=!1,o=0;o<P.length;o++){var s=P[o];Math.abs(r.dimensions[o]||0)>1e-12&&(pe(Y,s)?n.push({unit:Y[s].unit,prefix:Y[s].prefix,power:r.dimensions[o]||0}):a=!0)}n.length<r.units.length&&!a&&(r.units=n)}return r},C.prototype.toSI=function(){for(var e=this.clone(),t=[],r=0;r<P.length;r++){var n=P[r];if(Math.abs(e.dimensions[r]||0)>1e-12){if(!pe(V.si,n))throw new Error("Cannot express custom unit "+n+" in SI units");t.push({unit:V.si[n].unit,prefix:V.si[n].prefix,power:e.dimensions[r]||0})}}return e.units=t,e.fixPrefix=!0,e.skipAutomaticSimplification=!0,null!==this.value?(e.value=null,this.to(e)):e},C.prototype.formatUnits=function(){for(var e="",t="",r=0,n=0,i=0;i<this.units.length;i++)this.units[i].power>0?(r++,e+=" "+this.units[i].prefix.name+this.units[i].unit.name,Math.abs(this.units[i].power-1)>1e-15&&(e+="^"+this.units[i].power)):this.units[i].power<0&&n++;if(n>0)for(var a=0;a<this.units.length;a++)this.units[a].power<0&&(r>0?(t+=" "+this.units[a].prefix.name+this.units[a].unit.name,Math.abs(this.units[a].power+1)>1e-15&&(t+="^"+-this.units[a].power)):(t+=" "+this.units[a].prefix.name+this.units[a].unit.name,t+="^"+this.units[a].power));e=e.substr(1),t=t.substr(1),r>1&&n>0&&(e="("+e+")"),n>1&&r>0&&(t="("+t+")");var o=e;return r>0&&n>0&&(o+=" / "),o+=t},C.prototype.toBest=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(e&&!Array.isArray(e))throw new Error("Invalid unit type. Expected string or Unit.");var r=this.units[0].unit.prefixes;if(e&&e.length>0){var n=e.map(e=>{var t=null;if("string"==typeof e){if(!(t=C.parse(e)))throw new Error("Invalid unit type. Expected compatible string or Unit.")}else if(!E(e))throw new Error("Invalid unit type. Expected compatible string or Unit.");null===t&&(t=e.clone());try{return this.to(t.formatUnits()),t}catch(r){throw new Error("Invalid unit type. Expected compatible string or Unit.")}}).map(e=>e.units[0].prefix);this.units[0].unit.prefixes=n.reduce((e,t)=>
1(e[t.name]=t,e),{}),this.units[0].prefix=n[0]}var i=z(this,t).simp;return this.units[0].unit.prefixes=r,i.fixPrefix=!0,i},C.prototype.format=function(e){var{simp:t,valueStr:r,unitStr:n}=z(this,e),i=r;return t.value&&D(t.value)&&(i="("+i+")"),n.length>0&&i.length>0&&(i+=" "),i+=n},C.prototype._bestPrefix=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1.2;if(1!==this.units.length)throw new Error("Can only compute the best prefix for single units with integer powers, like kg, s^2, N^-1, and so forth!");if(Math.abs(this.units[0].power-Math.round(this.units[0].power))>=1e-14)throw new Error("Can only compute the best prefix for single units with integer powers, like kg, s^2, N^-1, and so forth!");var t=null!==this.value?p(this.value):0,r=p(this.units[0].unit.value),n=this.units[0].prefix;if(0===t)return n;var i=this.units[0].power,a=Math.log(t/Math.pow(n.value*r,i))/Math.LN10-e;if(a>-2.200001&&a<1.800001)return n;a=Math.abs(a);var o=this.units[0].unit.prefixes;for(var s in o)if(pe(o,s)){var u=o[s];if(u.scientific){var c=Math.abs(Math.log(t/Math.pow(u.value*r,i))/Math.LN10-e);(c<a||c===a&&u.name.length<n.name.length)&&(n=u,a=c)}}return n},C.prototype.splitUnit=function(e){for(var t=this.clone(),r=[],n=0;n<e.length&&(t=t.to(e[n]),n!==e.length-1);n++){var i=t.toNumeric(),a=d(i),o=new C(m(a,i)?a:h(t.toNumeric()),e[n].toString());r.push(o),t=u(t,o)}for(var c=0,f=0;f<r.length;f++)c=s(c,r[f].value);return m(c,this.value)&&(t.value=0),r.push(t),r};var U={NONE:{"":{name:"",value:1,scientific:!0}},SHORT:{"":{name:"",value:1,scientific:!0},da:{name:"da",value:10,scientific:!1},h:{name:"h",value:100,scientific:!1},k:{name:"k",value:1e3,scientific:!0},M:{name:"M",value:1e6,scientific:!0},G:{name:"G",value:1e9,scientific:!0},T:{name:"T",value:1e12,scientific:!0},P:{name:"P",value:1e15,scientific:!0},E:{name:"E",value:1e18,scientific:!0},Z:{name:"Z",value:1e21,scientific:!0},Y:{name:"Y",value:1e24,scientific:!0},R:{name:"R",value:1e27,scientific:!0},Q:{name:"Q",value:1e30,scientific:!0},d:{name:"d",value:.1,scientific:!1},c:{name:"c",value:.01,scientific:!1},m:{name:"m",value:.001,scientific:!0},u:{name:"u",value:1e-6,scientific:!0},n:{name:"n",value:1e-9,scientific:!0},p:{name:"p",value:1e-12,scientific:!0},f:{name:"f",value:1e-15,scientific:!0},a:{name:"a",value:1e-18,scientific:!0},z:{name:"z",value:1e-21,scientific:!0},y:{name:"y",value:1e-24,scientific:!0},r:{name:"r",value:1e-27,scientific:!0},q:{name:"q",value:1e-30,scientific:!0}},LONG:{"":{name:"",value:1,scientific:!0},deca:{name:"deca",value:10,scientific:!1},hecto:{name:"hecto",value:100,scientific:!1},kilo:{name:"kilo",value:1e3,scientific:!0},mega:{name:"mega",value:1e6,scientific:!0},giga:{name:"giga",value:1e9,scientific:!0},tera:{name:"tera",value:1e12,scientific:!0},peta:{name:"peta",value:1e15,scientific:!0},exa:{name:"exa",value:1e18,scientific:!0},zetta:{name:"zetta",value:1e21,scientific:!0},yotta:{name:"yotta",value:1e24,scientific:!0},ronna:{name:"ronna",value:1e27,scientific:!0},quetta:{name:"quetta",value:1e30,scientific:!0},deci:{name:"deci",value:.1,scientific:!1},centi:{name:"centi",value:.01,scientific:!1},milli:{name:"milli",value:.001,scientific:!0},micro:{name:"micro",value:1e-6,scientific:!0},nano:{name:"nano",value:1e-9,scientific:!0}
vendor: 5,969 bytes, line 1
1,pico:{name:"pico",value:1e-12,scientific:!0},femto:{name:"femto",value:1e-15,scientific:!0},atto:{name:"atto",value:1e-18,scientific:!0},zepto:{name:"zepto",value:1e-21,scientific:!0},yocto:{name:"yocto",value:1e-24,scientific:!0},ronto:{name:"ronto",value:1e-27,scientific:!0},quecto:{name:"quecto",value:1e-30,scientific:!0}},SQUARED:{"":{name:"",value:1,scientific:!0},da:{name:"da",value:100,scientific:!1},h:{name:"h",value:1e4,scientific:!1},k:{name:"k",value:1e6,scientific:!0},M:{name:"M",value:1e12,scientific:!0},G:{name:"G",value:1e18,scientific:!0},T:{name:"T",value:1e24,scientific:!0},P:{name:"P",value:1e30,scientific:!0},E:{name:"E",value:1e36,scientific:!0},Z:{name:"Z",value:1e42,scientific:!0},Y:{name:"Y",value:1e48,scientific:!0},R:{name:"R",value:1e54,scientific:!0},Q:{name:"Q",value:1e60,scientific:!0},d:{name:"d",value:.01,scientific:!1},c:{name:"c",value:1e-4,scientific:!1},m:{name:"m",value:1e-6,scientific:!0},u:{name:"u",value:1e-12,scientific:!0},n:{name:"n",value:1e-18,scientific:!0},p:{name:"p",value:1e-24,scientific:!0},f:{name:"f",value:1e-30,scientific:!0},a:{name:"a",value:1e-36,scientific:!0},z:{name:"z",value:1e-42,scientific:!0},y:{name:"y",value:1e-48,scientific:!0},r:{name:"r",value:1e-54,scientific:!0},q:{name:"q",value:1e-60,scientific:!0}},CUBIC:{"":{name:"",value:1,scientific:!0},da:{name:"da",value:1e3,scientific:!1},h:{name:"h",value:1e6,scientific:!1},k:{name:"k",value:1e9,scientific:!0},M:{name:"M",value:1e18,scientific:!0},G:{name:"G",value:1e27,scientific:!0},T:{name:"T",value:1e36,scientific:!0},P:{name:"P",value:1e45,scientific:!0},E:{name:"E",value:1e54,scientific:!0},Z:{name:"Z",value:1e63,scientific:!0},Y:{name:"Y",value:1e72,scientific:!0},R:{name:"R",value:1e81,scientific:!0},Q:{name:"Q",value:1e90,scientific:!0},d:{name:"d",value:.001,scientific:!1},c:{name:"c",value:1e-6,scientific:!1},m:{name:"m",value:1e-9,scientific:!0},u:{name:"u",value:1e-18,scientific:!0},n:{name:"n",value:1e-27,scientific:!0},p:{name:"p",value:1e-36,scientific:!0},f:{name:"f",value:1e-45,scientific:!0},a:{name:"a",value:1e-54,scientific:!0},z:{name:"z",value:1e-63,scientific:!0},y:{name:"y",value:1e-72,scientific:!0},r:{name:"r",value:1e-81,scientific:!0},q:{name:"q",value:1e-90,scientific:!0}},BINARY_SHORT_SI:{"":{name:"",value:1,scientific:!0},k:{name:"k",value:1e3,scientific:!0},M:{name:"M",value:1e6,scientific:!0},G:{name:"G",value:1e9,scientific:!0},T:{name:"T",value:1e12,scientific:!0},P:{name:"P",value:1e15,scientific:!0},E:{name:"E",value:1e18,scientific:!0},Z:{name:"Z",value:1e21,scientific:!0},Y:{name:"Y",value:1e24,scientific:!0}},BINARY_SHORT_IEC:{"":{name:"",value:1,scientific:!0},Ki:{name:"Ki",value:1024,scientific:!0},Mi:{name:"Mi",value:Math.pow(1024,2),scientific:!0},Gi:{name:"Gi",value:Math.pow(1024,3),scientific:!0},Ti:{name:"Ti",value:Math.pow(1024,4),scientific:!0},Pi:{name:"Pi",value:Math.pow(1024,5),scientific:!0},Ei:{name:"Ei",value:Math.pow(1024,6),scientific:!0},Zi:{name:"Zi",value:Math.pow(1024,7),scientific:!0},Yi:{name:"Yi",value:Math.pow(1024,8),scientific:!0}},BINARY_LONG_SI:{"":{name:"",value:1,scientific:!0},kilo:{name:"kilo",value:1e3,scientific:!0},mega:{name:"mega",value:1e6,scientific:!0},giga:{name:"giga",value:1e9,scientific:!0},tera:{name:"tera",value:1e12,scientific:!0},peta:{name:"peta",value:1e15,scientific:!0},exa:{name:"exa",value:1e18,scientific:!0},zetta:{name:"zetta",value:1e21,scientific:!0},yotta:{name:"yotta",value:1e24,scientific:!0}},BINARY_LONG_IEC:{"":{name:"",value:1,scientific:!0},kibi:{name:"kibi",value:1024,scientific:!0},mebi:{name:"mebi",value:Math.pow(1024,2),scientific:!0},gibi:{name:"gibi",value:Math.pow(1024,3),scientific:!0},tebi:{name:"tebi",value:Math.pow(1024,4),scientific:!0},pebi:{name:"pebi",value:Math.pow(1024,5),scientific:!0},exi:{name:"exi",value:Math.pow(1024,6),scientific:!0},zebi:{name:"zebi",value:Math.pow(1024,7),scientific:!0},yobi:{name:"yobi",value:Math.pow(1024,8),scientific:!0}},BTU:{"":{name:"",value:1,scientific:!0},MM:{name:"MM",value:1e6,scientific:!0}}};U.SHORTLONG=n({},U.SHORT,U.LONG),U.BINARY_SHORT=n({},U.BINARY_SHORT_SI,U.BINARY_SHORT_IEC),U.BINARY_LONG=n({},U.BINARY_LONG_SI,U.BINARY_LONG_IEC);var P=["MASS","LENGTH","TIME","CURRENT","TEMPERATURE","LUMINOUS_INTENSITY","AMOUNT_OF_SUBSTANCE","ANGLE","BIT"],L={NONE:{dimensions:[0,0,0,0,0,0,0,0,0]},MASS:{dimensions:[1,0,0,0,0,0,0,0,0]},LENGTH:{dimensions:[0,1,0,0,0,0,0,0,0]},TIME:{dimensions:[0,0,1,0,0,0,0,0,0]},CURRENT:{dimensions:[0,0,0,1,0,0,0,0,0]},TEMPERATURE:{dimensions:[0,0,0,0,1,0,0,0,0]},LUMINOUS_INTENSITY:{dimensions:[0,0,0,0,0,1,0,0,0]},AMOUNT_OF_SUBSTANCE:{dimensions:[0,0,0,0,0,0,1,0,0]},FORCE:{dimensions:[1,1,-2,0,0,0,0,0,0]},SURFACE:{dimensions:[0,2,0,0,0,0,0,0,0]},VOLUME:{dimensions:[0,3,0,0,0,0,0,0,0]},ENERGY:{dimensions:[1,2,-2,0,0,0,0,0,0]},POWER:{dimensions:[1,2,-3,0,0,0,0,0,0]},PRESSURE:{dimensions:[1,-1,-2,0,0,0,0,0,0]},ELECTRIC_CHARGE:{dimensions:[0,0,1,1,0,0,0,0,0]},ELECTRIC_CAPACITANCE:{dimensions:[-1,-2,4,2,0,0,0,0,0]},ELECTRIC_POTENTIAL:{dimensions:[1,2,-3,-1,0,0,0,0,0]},ELECTRIC_RESISTANCE:{dimensions:[1,2,-3,-2,0,0,0,0,0]},ELECTRIC_INDUCTANCE:{dimensions:[1,2,-2,-2,0,0,0,0,0]},ELECTRIC_CONDUCTANCE:{dimensions:[-1,-2,3,2,0,0,0,0,0]},MAGNETIC_FLUX:{dimensions:[1,2,-2,-1,0,0,0,0,0]},MAGNETIC_FLUX_DENSITY:{dimensions:[1,0,-2,-1,0,0,0,0,0]},FREQUENCY:{dimensions:[0,0,-1,0,0,0,0,0,0]},ANGLE:{dimensions:[0,0,0,0,0,0,0,1,0]},BIT:{dimensions:[0,0,0,0,0,0,0,0,1]}};for(var q in L)pe(L,q)&&(L[q].key=q);var $={name:"",base:{},value:1,offset:0,dimensions:P.map(e=>0)},H={meter:{name:"meter",base:L.LENGTH,prefixes:U.LONG,value:1,offset:0},inch:{name:"inch",base:L.LENGTH,prefixes:U.NONE,value:.0254,offset:0},foot:{name:"foot",base:L.LENGTH,prefixes:U.NONE,value:.3048,offset:0},yard:{name:"yard",base:L.LENGTH,prefixes:U.NONE,value:.9144,offset:0},mile:{name:"mile",base:L.LENGTH,prefixes:U.NONE,value:1609.344,offset:0},link:{name:"link",base:L.LENGTH,prefixes:U.NONE,value:.201168,offset:0}
1,rod:{name:"rod",base:L.LENGTH,prefixes:U.NONE,value:5.0292,offset:0},chain:{name:"chain",base:L.LENGTH,prefixes:U.NONE,value:20.1168,offset:0},angstrom:{name:"angstrom",base:L.LENGTH,prefixes:U.NONE,value:1e-10,offset:0},m:{name:"m",base:L.LENGTH,prefixes:U.SHORT,value:1,offset:0},in:{name:"in",base:L.LENGTH,prefixes:U.NONE,value:.0254,offset:0},ft:{name:"ft",base:L.LENGTH,prefixes:U.NONE,value:.3048,offset:0},yd:{name:"yd",base:L.LENGTH,prefixes:U.NONE,value:.9144,offset:0},mi:{name:"mi",base:L.LENGTH,prefixes:U.NONE,value:1609.344,offset:0},li:{name:"li",base:L.LENGTH,prefixes:U.NONE,value:.201168,offset:0},rd:{name:"rd",base:L.LENGTH,prefixes:U.NONE,value:5.02921,offset:0},ch:{name:"ch",base:L.LENGTH,prefixes:U.NONE,value:20.1168,offset:0},mil:{name:"mil",base:L.LENGTH,prefixes:U.NONE,value:254e-7,offset:0},m2:{name:"m2",base:L.SURFACE,prefixes:U.SQUARED,value:1,offset:0},sqin:{name:"sqin",base:L.SURFACE,prefixes:U.NONE,value:64516e-8,offset:0},sqft:{name:"sqft",base:L.SURFACE,prefixes:U.NONE,value:.09290304,offset:0},sqyd:{name:"sqyd",base:L.SURFACE,prefixes:U.NONE,value:.83612736,offset:0},sqmi:{name:"sqmi",base:L.SURFACE,prefixes:U.NONE,value:2589988.110336,offset:0},sqrd:{name:"sqrd",base:L.SURFACE,prefixes:U.NONE,value:25.29295,offset:0},sqch:{name:"sqch",base:L.SURFACE,prefixes:U.NONE,value:404.6873,offset:0},sqmil:{name:"sqmil",base:L.SURFACE,prefixes:U.NONE,value:6.4516e-10,offset:0},acre:{name:"acre",base:L.SURFACE,prefixes:U.NONE,value:4046.86,offset:0},hectare:{name:"hectare",base:L.SURFACE,prefixes:U.NONE,value:1e4,offset:0},m3:{name:"m3",base:L.VOLUME,prefixes:U.CUBIC,value:1,offset:0},L:{name:"L",base:L.VOLUME,prefixes:U.SHORT,value:.001,offset:0},l:{name:"l",base:L.VOLUME,prefixes:U.SHORT,value:.001,offset:0},litre:{name:"litre",base:L.VOLUME,prefixes:U.LONG,value:.001,offset:0},cuin:{name:"cuin",base:L.VOLUME,prefixes:U.NONE,value:16387064e-12,offset:0},cuft:{name:"cuft",base:L.VOLUME,prefixes:U.NONE,value:.028316846592,offset:0},cuyd:{name:"cuyd",base:L.VOLUME,prefixes:U.NONE,value:.764554857984,offset:0},teaspoon:{name:"teaspoon",base:L.VOLUME,prefixes:U.NONE,value:5e-6,offset:0},tablespoon:{name:"tablespoon",base:L.VOLUME,prefixes:U.NONE,value:15e-6,offset:0},drop:{name:"drop",base:L.VOLUME,prefixes:U.NONE,value:5e-8,offset:0},gtt:{name:"gtt",base:L.VOLUME,prefixes:U.NONE,value:5e-8,offset:0},minim:{name:"minim",base:L.VOLUME,prefixes:U.NONE,value:6.1611519921875e-8,offset:0},fluiddram:{name:"fluiddram",base:L.VOLUME,prefixes:U.NONE,value:36966911953125e-19,offset:0},fluidounce:{name:"fluidounce",base:L.VOLUME,prefixes:U.NONE,value:295735295625e-16,offset:0}
1,gill:{name:"gill",base:L.VOLUME,prefixes:U.NONE,value:.00011829411825,offset:0},cc:{name:"cc",base:L.VOLUME,prefixes:U.NONE,value:1e-6,offset:0},cup:{name:"cup",base:L.VOLUME,prefixes:U.NONE,value:.0002365882365,offset:0},pint:{name:"pint",base:L.VOLUME,prefixes:U.NONE,value:.000473176473,offset:0},quart:{name:"quart",base:L.VOLUME,prefixes:U.NONE,value:.000946352946,offset:0},gallon:{name:"gallon",base:L.VOLUME,prefixes:U.NONE,value:.003785411784,offset:0},beerbarrel:{name:"beerbarrel",base:L.VOLUME,prefixes:U.NONE,value:.117347765304,offset:0},oilbarrel:{name:"oilbarrel",base:L.VOLUME,prefixes:U.NONE,value:.158987294928,offset:0},hogshead:{name:"hogshead",base:L.VOLUME,prefixes:U.NONE,value:.238480942392,offset:0},g:{name:"g",base:L.MASS,prefixes:U.SHORT,value:.001,offset:0},gram:{name:"gram",base:L.MASS,prefixes:U.LONG,value:.001,offset:0},ton:{name:"ton",base:L.MASS,prefixes:U.SHORT,value:907.18474,offset:0},t:{name:"t",base:L.MASS,prefixes:U.SHORT,value:1e3,offset:0},tonne:{name:"tonne",base:L.MASS,prefixes:U.LONG,value:1e3,offset:0},grain:{name:"grain",base:L.MASS,prefixes:U.NONE,value:6479891e-11,offset:0},dram:{name:"dram",base:L.MASS,prefixes:U.NONE,value:.0017718451953125,offset:0},ounce:{name:"ounce",base:L.MASS,prefixes:U.NONE,value:.028349523125,offset:0},poundmass:{name:"poundmass",base:L.MASS,prefixes:U.NONE,value:.45359237,offset:0},hundredweight:{name:"hundredweight",base:L.MASS,prefixes:U.NONE,value:45.359237,offset:0},stick:{name:"stick",base:L.MASS,prefixes:U.NONE,value:.115,offset:0},stone:{name:"stone",base:L.MASS,prefixes:U.NONE,value:6.35029318,offset:0},gr:{name:"gr",base:L.MASS,prefixes:U.NONE,value:6479891e-11,offset:0},dr:{name:"dr",base:L.MASS,prefixes:U.NONE,value:.0017718451953125,offset:0},oz:{name:"oz",base:L.MASS,prefixes:U.NONE,value:.028349523125,offset:0},lbm:{name:"lbm",base:L.MASS,prefixes:U.NONE,value:.45359237,offset:0},cwt:{name:"cwt",base:L.MASS,prefixes:U.NONE,value:45.359237,offset:0},s:{name:"s",base:L.TIME,prefixes:U.SHORT,value:1,offset:0},min:{name:"min",base:L.TIME,prefixes:U.NONE,value:60,offset:0},h:{name:"h",base:L.TIME,prefixes:U.NONE,value:3600,offset:0},second:{name:"second",base:L.TIME,prefixes:U.LONG,value:1,offset:0},sec:{name:"sec",base:L.TIME,prefixes:U.LONG,value:1,offset:0},minute:{name:"minute",base:L.TIME,prefixes:U.NONE,value:60,offset:0},hour:{name:"hour",base:L.TIME,prefixes:U.NONE,value:3600,offset:0},day:{name:"day",base:L.TIME,prefixes:U.NONE,value:86400,offset:0},week:{name:"week",base:L.TIME,prefixes:U.NONE,value:604800,offset:0},month:{name:"month",base:L.TIME,prefixes:U.NONE,value:2629800,offset:0},year:{name:"year",base:L.TIME,prefixes:U.NONE,value:31557600,offset:0},decade:{name:"decade",base:L.TIME,prefixes:U.NONE,value:315576e3,offset:0},century:{name:"century",base:L.TIME,prefixes:U.NONE,value:315576e4,offset:0},millennium:{name:"millennium",base:L.TIME,prefixes:U.NONE,value:315576e5,offset:0},hertz:{name:"Hertz",base:L.FREQUENCY,prefixes:U.LONG,value:1,offset:0,reciprocal:!0},Hz:{name:"Hz",base:L.FREQUENCY,prefixes:U.SHORT,value:1,offset:0,reciprocal:!0},rad:{name:"rad",base:L.ANGLE,prefixes:U.SHORT,value:1,offset:0},radian:{name:"radian",base:L.ANGLE,prefixes:U.LONG,value:1,offset:0},deg:{name:"deg",base:L.ANGLE,prefixes:U.SHORT,value:null,offset:0},degree:{name:"degree",base:L.ANGLE,prefixes:U.LONG,value:null,offset:0},grad:{name:"grad",base:L.ANGLE,prefixes:U.SHORT,value:null,offset:0},gradian:{name:"gradian",base:L.ANGLE,prefixes:U.LONG,value:null,offset:0},cycle:{name:"cycle",base:L.ANGLE,prefixes:U.NONE,value:null,offset:0},arcsec:{name:"arcsec",base:L.ANGLE,prefixes:U.NONE,value:null,offset:0},arcmin:{name:"arcmin",base:L.ANGLE,prefixes:U.NONE,value:null,offset:0},A:{name:"A",base:L.CURRENT,prefixes:U.SHORT,value:1,offset:0},ampere:{name:"ampere",base:L.CURRENT,prefixes:U.LONG,value:1,offset:0}
1,K:{name:"K",base:L.TEMPERATURE,prefixes:U.SHORT,value:1,offset:0},degC:{name:"degC",base:L.TEMPERATURE,prefixes:U.SHORT,value:1,offset:273.15},degF:{name:"degF",base:L.TEMPERATURE,prefixes:U.SHORT,value:new x(5,9),offset:459.67},degR:{name:"degR",base:L.TEMPERATURE,prefixes:U.SHORT,value:new x(5,9),offset:0},kelvin:{name:"kelvin",base:L.TEMPERATURE,prefixes:U.LONG,value:1,offset:0},celsius:{name:"celsius",base:L.TEMPERATURE,prefixes:U.LONG,value:1,offset:273.15},fahrenheit:{name:"fahrenheit",base:L.TEMPERATURE,prefixes:U.LONG,value:new x(5,9),offset:459.67},rankine:{name:"rankine",base:L.TEMPERATURE,prefixes:U.LONG,value:new x(5,9),offset:0},mol:{name:"mol",base:L.AMOUNT_OF_SUBSTANCE,prefixes:U.SHORT,value:1,offset:0},mole:{name:"mole",base:L.AMOUNT_OF_SUBSTANCE,prefixes:U.LONG,value:1,offset:0},cd:{name:"cd",base:L.LUMINOUS_INTENSITY,prefixes:U.SHORT,value:1,offset:0},candela:{name:"candela",base:L.LUMINOUS_INTENSITY,prefixes:U.LONG,value:1,offset:0},N:{name:"N",base:L.FORCE,prefixes:U.SHORT,value:1,offset:0},newton:{name:"newton",base:L.FORCE,prefixes:U.LONG,value:1,offset:0},dyn:{name:"dyn",base:L.FORCE,prefixes:U.SHORT,value:1e-5,offset:0},dyne:{name:"dyne",base:L.FORCE,prefixes:U.LONG,value:1e-5,offset:0},lbf:{name:"lbf",base:L.FORCE,prefixes:U.NONE,value:4.4482216152605,offset:0},poundforce:{name:"poundforce",base:L.FORCE,prefixes:U.NONE,value:4.4482216152605,offset:0},kip:{name:"kip",base:L.FORCE,prefixes:U.LONG,value:4448.2216,offset:0},kilogramforce:{name:"kilogramforce",base:L.FORCE,prefixes:U.NONE,value:9.80665,offset:0},J:{name:"J",base:L.ENERGY,prefixes:U.SHORT,value:1,offset:0},joule:{name:"joule",base:L.ENERGY,prefixes:U.LONG,value:1,offset:0},erg:{name:"erg",base:L.ENERGY,prefixes:U.SHORTLONG,value:1e-7,offset:0},Wh:{name:"Wh",base:L.ENERGY,prefixes:U.SHORT,value:3600,offset:0},BTU:{name:"BTU",base:L.ENERGY,prefixes:U.BTU,value:1055.05585262,offset:0},eV:{name:"eV",base:L.ENERGY,prefixes:U.SHORT,value:1602176565e-28,offset:0},electronvolt:{name:"electronvolt",base:L.ENERGY,prefixes:U.LONG,value:1602176565e-28,offset:0},W:{name:"W",base:L.POWER,prefixes:U.SHORT,value:1,offset:0},watt:{name:"watt",base:L.POWER,prefixes:U.LONG,value:1,offset:0},hp:{name:"hp",base:L.POWER,prefixes:U.NONE,value:745.6998715386,offset:0},VAR:{name:"VAR",base:L.POWER,prefixes:U.SHORT,value:w.I,offset:0},VA:{name:"VA",base:L.POWER,prefixes:U.SHORT,value:1,offset:0},Pa:{name:"Pa",base:L.PRESSURE,prefixes:U.SHORT,value:1,offset:0},psi:{name:"psi",base:L.PRESSURE,prefixes:U.NONE,value:6894.75729276459,offset:0},atm:{name:"atm",base:L.PRESSURE,prefixes:U.NONE,value:101325,offset:0},bar:{name:"bar",base:L.PRESSURE,prefixes:U.SHORTLONG,value:1e5,offset:0},torr:{name:"torr",base:L.PRESSURE,prefixes:U.NONE,value:133.322,offset:0},mmHg:{name:"mmHg",base:L.PRESSURE,prefixes:U.NONE,value:133.322,offset:0},mmH2O:{name:"mmH2O",base:L.PRESSURE,prefixes:U.NONE,value:9.80665,offset:0},cmH2O:{name:"cmH2O",base:L.PRESSURE,prefixes:U.NONE,value:98.0665,offset:0},coulomb:{name:"coulomb",base:L.ELECTRIC_CHARGE,prefixes:U.LONG,value:1,offset:0},C:{name:"C",base:L.ELECTRIC_CHARGE,prefixes:U.SHORT,value:1,offset:0},Ah:{name:"Ah",base:L.ELECTRIC_CHARGE,prefixes:U.SHORT,value:3600,offset:0},farad:{name:"farad",base:L.ELECTRIC_CAPACITANCE,prefixes:U.LONG,value:1,offset:0},F:{name:"F",base:L.ELECTRIC_CAPACITANCE,prefixes:U.SHORT,value:1,offset:0},volt:{name:"volt",base:L.ELECTRIC_POTENTIAL,prefixes:U.LONG,value:1,offset:0},V:{name:"V",base:L.ELECTRIC_POTENTIAL,prefixes:U.SHORT,value:1,offset:0},ohm:{name:"ohm",base:L.ELECTRIC_RESISTANCE,prefixes:U.SHORTLONG,value:1,offset:0},henry:{name:"henry",base:L.ELECTRIC_INDUCTANCE,prefixes:U.LONG,value:1,offset:0},H:{name:"H",base:L.ELECTRIC_INDUCTANCE,prefixes:U.SHORT,value:1,offset:0},siemens:{name:"siemens",base:L.ELECTRIC_CONDUCTANCE,prefixes:U.LONG,value:1,offset:0},S:{name:"S",base:L.ELECTRIC_CONDUCTANCE,prefixes:U.SHORT,value:1,offset:0},weber:{name:"weber",base:L.MAGNETIC_FLUX,prefixes:U.LONG,value:1,offset:0},Wb:{name:"Wb",base:L.MAGNETIC_FLUX,prefixes:U.SHORT,value:1,offset:0},tesla:{name:"tesla",base:L.MAGNETIC_FLUX_DENSITY,prefixes:U.LONG,value:1,offset:0},T:{name:"T",base:L.MAGNETIC_FLUX_DENSITY,prefixes:U.SHORT,value:1,offset:0},b:{name:"b",base:L.BIT,prefixes:U.BINARY_SHORT,value:1,offset:0}
vendor: 6,420 bytes, line 1
1,bits:{name:"bits",base:L.BIT,prefixes:U.BINARY_LONG,value:1,offset:0},B:{name:"B",base:L.BIT,prefixes:U.BINARY_SHORT,value:8,offset:0},bytes:{name:"bytes",base:L.BIT,prefixes:U.BINARY_LONG,value:8,offset:0}},G={meters:"meter",inches:"inch",feet:"foot",yards:"yard",miles:"mile",links:"link",rods:"rod",chains:"chain",angstroms:"angstrom",lt:"l",litres:"litre",liter:"litre",liters:"litre",teaspoons:"teaspoon",tablespoons:"tablespoon",minims:"minim",fldr:"fluiddram",fluiddrams:"fluiddram",floz:"fluidounce",fluidounces:"fluidounce",gi:"gill",gills:"gill",cp:"cup",cups:"cup",pt:"pint",pints:"pint",qt:"quart",quarts:"quart",gal:"gallon",gallons:"gallon",bbl:"beerbarrel",beerbarrels:"beerbarrel",obl:"oilbarrel",oilbarrels:"oilbarrel",hogsheads:"hogshead",gtts:"gtt",grams:"gram",tons:"ton",tonnes:"tonne",grains:"grain",drams:"dram",ounces:"ounce",poundmasses:"poundmass",hundredweights:"hundredweight",sticks:"stick",lb:"lbm",lbs:"lbm",kips:"kip",kgf:"kilogramforce",acres:"acre",hectares:"hectare",sqfeet:"sqft",sqyard:"sqyd",sqmile:"sqmi",sqmiles:"sqmi",mmhg:"mmHg",mmh2o:"mmH2O",cmh2o:"cmH2O",seconds:"second",secs:"second",minutes:"minute",mins:"minute",hours:"hour",hr:"hour",hrs:"hour",days:"day",weeks:"week",months:"month",years:"year",decades:"decade",centuries:"century",millennia:"millennium",hertz:"hertz",radians:"radian",degrees:"degree",gradians:"gradian",cycles:"cycle",arcsecond:"arcsec",arcseconds:"arcsec",arcminute:"arcmin",arcminutes:"arcmin",BTUs:"BTU",watts:"watt",joules:"joule",amperes:"ampere",amps:"ampere",amp:"ampere",coulombs:"coulomb",volts:"volt",ohms:"ohm",farads:"farad",webers:"weber",teslas:"tesla",electronvolts:"electronvolt",moles:"mole",bit:"bits",byte:"bytes"};function W(e){if("BigNumber"===e.number){var t=Ga(b);H.rad.value=new b(1),H.deg.value=t.div(180),H.grad.value=t.div(200),H.cycle.value=t.times(2),H.arcsec.value=t.div(648e3),H.arcmin.value=t.div(10800)}else H.rad.value=1,H.deg.value=Math.PI/180,H.grad.value=Math.PI/200,H.cycle.value=2*Math.PI,H.arcsec.value=Math.PI/648e3,H.arcmin.value=Math.PI/10800;H.radian.value=H.rad.value,H.degree.value=H.deg.value,H.gradian.value=H.grad.value}W(o),a&&a("config",function(e,t){e.number!==t.number&&W(e)});var V={si:{NONE:{unit:$,prefix:U.NONE[""]},LENGTH:{unit:H.m,prefix:U.SHORT[""]},MASS:{unit:H.g,prefix:U.SHORT.k},TIME:{unit:H.s,prefix:U.SHORT[""]},CURRENT:{unit:H.A,prefix:U.SHORT[""]},TEMPERATURE:{unit:H.K,prefix:U.SHORT[""]},LUMINOUS_INTENSITY:{unit:H.cd,prefix:U.SHORT[""]},AMOUNT_OF_SUBSTANCE:{unit:H.mol,prefix:U.SHORT[""]},ANGLE:{unit:H.rad,prefix:U.SHORT[""]},BIT:{unit:H.bits,prefix:U.SHORT[""]},FORCE:{unit:H.N,prefix:U.SHORT[""]},ENERGY:{unit:H.J,prefix:U.SHORT[""]},POWER:{unit:H.W,prefix:U.SHORT[""]},PRESSURE:{unit:H.Pa,prefix:U.SHORT[""]},ELECTRIC_CHARGE:{unit:H.C,prefix:U.SHORT[""]},ELECTRIC_CAPACITANCE:{unit:H.F,prefix:U.SHORT[""]},ELECTRIC_POTENTIAL:{unit:H.V,prefix:U.SHORT[""]},ELECTRIC_RESISTANCE:{unit:H.ohm,prefix:U.SHORT[""]},ELECTRIC_INDUCTANCE:{unit:H.H,prefix:U.SHORT[""]},ELECTRIC_CONDUCTANCE:{unit:H.S,prefix:U.SHORT[""]},MAGNETIC_FLUX:{unit:H.Wb,prefix:U.SHORT[""]},MAGNETIC_FLUX_DENSITY:{unit:H.T,prefix:U.SHORT[""]},FREQUENCY:{unit:H.Hz,prefix:U.SHORT[""]}}};V.cgs=JSON.parse(JSON.stringify(V.si)),V.cgs.LENGTH={unit:H.m,prefix:U.SHORT.c},V.cgs.MASS={unit:H.g,prefix:U.SHORT[""]},V.cgs.FORCE={unit:H.dyn,prefix:U.SHORT[""]},V.cgs.ENERGY={unit:H.erg,prefix:U.NONE[""]},V.us=JSON.parse(JSON.stringify(V.si)),V.us.LENGTH={unit:H.ft,prefix:U.NONE[""]},V.us.MASS={unit:H.lbm,prefix:U.NONE[""]},V.us.TEMPERATURE={unit:H.degF,prefix:U.NONE[""]},V.us.FORCE={unit:H.lbf,prefix:U.NONE[""]},V.us.ENERGY={unit:H.BTU,prefix:U.BTU[""]},V.us.POWER={unit:H.hp,prefix:U.NONE[""]},V.us.PRESSURE={unit:H.psi,prefix:U.NONE[""]},V.auto=JSON.parse(JSON.stringify(V.si));var Y=V.auto;for(var J in C.setUnitSystem=function(e){if(!pe(V,e))throw new Error("Unit system "+e+" does not exist. Choices are: "+Object.keys(V).join(", "));Y=V[e]},C.getUnitSystem=function(){for(var e in V)if(pe(V,e)&&V[e]===Y)return e},C.typeConverters={BigNumber:function(e){return null!=e&&e.isFraction?new b(String(e.n)).div(String(e.d)).times(String(e.s)):new b(e+"")},Fraction:function(e){return new x(e)},Complex:function(e){return e},number:function(e){return null!=e&&e.isFraction?y(e):e}},C.prototype._numberConverter=function(){var e=C.typeConverters[this.valueType()];if(e)return e;throw new TypeError('Unsupported Unit value type "'+this.valueType()+'"')},C._getNumberConverter=function(e){if(!C.typeConverters[e])throw new TypeError('Unsupported type "'+e+'"');return C.typeConverters[e]},H)if(pe(H,J)){var Z=H[J];Z.dimensions=Z.base.dimensions}for(var X in G)if(pe(G,X)){var K=H[G[X]],Q={};for(var ee in K)pe(K,ee)&&(Q[ee]=K[ee]);Q.name=X,H[X]=Q}return C.isValidAlpha=function(e){return/^[a-zA-Z]$/.test(e)},C.createUnit=function(e,t){if("object"!=typeof e)throw new TypeError("createUnit expects first parameter to be of type 'Object'");if(t&&t.override)for(var r in e)if(pe(e,r)&&C.deleteUnit(r),e[r].aliases)for(var n=0;n<e[r].aliases.length;n++)C.deleteUnit(e[r].aliases[n]);var i;for(var a in e)pe(e,a)&&(i=C.createUnitSingle(a,e[a]));return i},C.createUnitSingle=function(e,t){if(null==t&&(t={}),"string"!=typeof e)throw new TypeError("createUnitSingle expects first parameter to be of type 'string'");if(pe(H,e))throw new Error('Cannot create unit "'+e+'": a unit with that name already exists');!function(e){for(var t=0;t<e.length;t++){if(i=e.charAt(t),0===t&&!C.isValidAlpha(i))throw new Error('Invalid unit name (must begin with alpha character): "'+e+'"');if(t>0&&!C.isValidAlpha(i)&&!T(i))throw new Error('Invalid unit name (only alphanumeric characters are allowed): "'+e+'"')}}(e);var r,n,a,o=null,s=[],u=0;if(t&&"Unit"===t.type)o=t.clone();else if("string"==typeof t)""!==t&&(r=t);else{if("object"!=typeof t)throw new TypeError('Cannot create unit "'+e+'" from "'+t.toString()+'": expecting "string" or "Unit" or "Object"');r=t.definition,n=t.prefixes,u=t.offset,a=t.baseName,t.aliases&&(s=t.aliases.valueOf())}if(s)for(var c=0;c<s.length;c++)if(pe(H,s[c]))throw new Error('Cannot create alias "'+s[c]+'": a unit with that name already exists');if(r&&"string"==typeof r&&!o)try{o=C.parse(r,{allowNoUnits:!0})}catch(x){throw x.message='Could not create unit "'+e+'" from "'+r+'": '+x.message,x}else r&&"Unit"===r.type&&(o=r.clone());s=s||[],u=u||0,n=n&&n.toUpperCase&&U[n.toUpperCase()]||U.NONE;var f={};
1if(o){f={name:e,value:o.value,dimensions:o.dimensions.slice(0),prefixes:n,offset:u};var l=!1;for(var p in L)if(pe(L,p)){for(var h=!0,d=0;d<P.length;d++)if(Math.abs((f.dimensions[d]||0)-(L[p].dimensions[d]||0))>1e-12){h=!1;break}if(h){l=!0,f.base=L[p];break}}if(!l){a=a||e+"_STUFF";var m={dimensions:o.dimensions.slice(0)};m.key=a,L[a]=m,Y[a]={unit:f,prefix:U.NONE[""]},f.base=L[a]}}else{if(a=a||e+"_STUFF",P.indexOf(a)>=0)throw new Error('Cannot create new base unit "'+e+'": a base unit with that name already exists (and cannot be overridden)');for(var g in P.push(a),L)pe(L,g)&&(L[g].dimensions[P.length-1]=0);for(var v={dimensions:[]},D=0;D<P.length;D++)v.dimensions[D]=0;v.dimensions[P.length-1]=1,v.key=a,L[a]=v,f={name:e,value:1,dimensions:L[a].dimensions.slice(0),prefixes:n,offset:u,base:L[a]},Y[a]={unit:f,prefix:U.NONE[""]}}C.UNITS[e]=f;for(var y=0;y<s.length;y++){var E=s[y],w={};for(var b in f)pe(f,b)&&(w[b]=f[b]);w.name=E,C.UNITS[E]=w}return delete k.cache,new C(null,e)},C.deleteUnit=function(e){delete C.UNITS[e],delete k.cache},C.PREFIXES=U,C.BASE_DIMENSIONS=P,C.BASE_UNITS=L,C.UNIT_SYSTEMS=V,C.UNITS=H,C},{isClass:!0}),Za=be("add",["typed","matrix","addScalar","equalScalar","DenseMatrix","SparseMatrix","concat"],e=>{var{typed:t,matrix:r,addScalar:n,equalScalar:i,DenseMatrix:a,SparseMatrix:o,concat:s}=e,u=Ki({typed:t}),c=Qi({typed:t,equalScalar:i}),f=ea({typed:t,DenseMatrix:a}),l=Xi({typed:t,matrix:r,concat:s});return t("add",{"any, any":n,"any, any, ...any":t.referToSelf(e=>(t,r,n)=>{for(var i=e(t,r),a=0;a<n.length;a++)i=e(i,n[a]);return i})},l({elop:n,DS:u,SS:c,Ss:f}))}),Xa=be("dot",["typed","addScalar","multiplyScalar","conj","size"],e=>{var{typed:t,addScalar:r,multiplyScalar:n,conj:i,size:a}=e;return t("dot",{"Array | DenseMatrix, Array | DenseMatrix":function(e,s){var u=o(e,s),c=x(e)?e._data:e,f=x(e)?e._datatype||e.getDataType():void 0,l=x(s)?s._data:s,p=x(s)?s._datatype||s.getDataType():void 0,h=2===a(e).length,d=2===a(s).length,m=r,g=n;if(f&&p&&f===p&&"string"==typeof f&&"mixed"!==f){var v=f;m=t.find(r,[v,v]),g=t.find(n,[v,v])}if(!h&&!d){for(var D=g(i(c[0]),l[0]),y=1;y<u;y++)D=m(D,g(i(c[y]),l[y]));return D}if(!h&&d){for(var E=g(i(c[0]),l[0][0]),w=1;w<u;w++)E=m(E,g(i(c[w]),l[w][0]));return E}if(h&&!d){for(var b=g(i(c[0][0]),l[0]),N=1;N<u;N++)b=m(b,g(i(c[N][0]),l[N]));return b}if(h&&d){for(var A=g(i(c[0][0]),l[0][0]),F=1;F<u;F++)A=m(A,g(i(c[F][0]),l[F][0]));return A}},"SparseMatrix, SparseMatrix":function(e,t){o(e,t);var i=e._index,a=e._values,s=t._index,u=t._values,c=0,f=r,l=n,p=0,h=0;for(;p<i.length&&h<s.length;){var d=i[p],m=s[h];d<m?p++:d>m?h++:d===m&&(c=f(c,l(a[p],u[h])),p++,h++)}return c}});function o(e,t){var r,n,i=a(e),o=a(t);if(1===i.length)r=i[0];else{if(2!==i.length||1!==i[1])throw new RangeError("Expected a column vector, instead got a matrix of size ("+i.join(", ")+")");r=i[0]}if(1===o.length)n=o[0];else{if(2!==o.length||1!==o[1])throw new RangeError("Expected a column vector, instead got a matrix of size ("+o.join(", ")+")");n=o[0]}if(r!==n)throw new RangeError("Vectors must have equal length ("+r+" != "+n+")");if(0===r)throw new RangeError("Cannot calculate the dot product of empty vectors");return r}}),Ka=new Set(["end"]),Qa=be("Node",["mathWithTransform"],e=>{var{mathWithTransform:t}=e;return class{get type(){return"Node"}get isNode(){return!0}evaluate(e){return this.compile().evaluate(e)}compile(){var e=this._compile(t,{}),r={};return{evaluate:function(t){var n=function(e){if(!e)return d();if(R(e))return e;if(k(e))return new l(e);throw new Error("createMap can create maps from objects or Maps")}(t);return function(e){for(var t of[...Ka])if(e.has(t))throw new Error('Scope contains an illegal symbol, "'+t+'" is a reserved keyword')}(n),e(n,r,null)}}}_compile(e,t){throw new Error("Method _compile must be implemented by type "+this.type)}forEach(e){throw new Error("Cannot run forEach on a Node interface")}map(e){throw new Error("Cannot run map on a Node interface")}_ifNode(e){if(!X(e))throw new TypeError("Callback function must return a Node");return e}traverse(e){e(this,null,null),function e(t,r){t.forEach(function(t,n,i){r(t,n,i),e(t,r)})}(this,e)}transform(e){return function t(r,n,i){var a=e(r,n,i);return a!==r?a:r.map(t)}(this,null,null)}filter(e){var t=[];
1return this.traverse(function(r,n,i){e(r,n,i)&&t.push(r)}),t}clone(){throw new Error("Cannot clone a Node interface")}cloneDeep(){return this.map(function(e){return e.cloneDeep()})}equals(e){return!!e&&(this.type===e.type&&ue(this,e))}toString(e){var t=this._getCustomString(e);return void 0!==t?t:this._toString(e)}_toString(){throw new Error("_toString not implemented for "+this.type)}toJSON(){throw new Error("Cannot serialize object: toJSON not implemented by "+this.type)}toHTML(e){var t=this._getCustomString(e);return void 0!==t?t:this._toHTML(e)}_toHTML(){throw new Error("_toHTML not implemented for "+this.type)}toTex(e){var t=this._getCustomString(e);return void 0!==t?t:this._toTex(e)}_toTex(e){throw new Error("_toTex not implemented for "+this.type)}_getCustomString(e){if(e&&"object"==typeof e)switch(typeof e.handler){case"object":case"undefined":return;case"function":return e.handler(this,e);default:throw new TypeError("Object or function expected as callback")}}getIdentifier(){return this.type}getContent(){return this}}},{isClass:!0,isNode:!0});function eo(e){return e&&e.isIndexError?new hn(e.index+1,e.min+1,void 0!==e.max?e.max+1:void 0):e}function to(e){var{subset:t}=e;return function(e,r){try{if(Array.isArray(e))return t(e,r);if(e&&"function"==typeof e.subset)return e.subset(r);if("string"==typeof e)return t(e,r);if("object"==typeof e){if(!r.isObjectProperty())throw new TypeError("Cannot apply a numeric index as object property");return a(e,r.getObjectProperty())}throw new TypeError("Cannot apply index: unsupported type of object")}catch(n){throw eo(n)}}}var ro="AccessorNode",no=be(ro,["subset","Node"],e=>{var{subset:t,Node:r}=e,n=to({subset:t});function i(e){return!(L(e)||q(e)||W(e)||J(e)||K(e)||ee(e)||ne(e))}class o extends r{constructor(e,t){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];if(super(),!X(e))throw new TypeError('Node expected for parameter "object"');if(!Z(t))throw new TypeError('IndexNode expected for parameter "index"');this.object=e,this.index=t,this.optionalChaining=r}get name(){return this.index?this.index.isObjectProperty()?this.index.getObjectProperty():"":this.object.name||""}get type(){return ro}get isAccessorNode(){return!0}_compile(e,t){var r=this.object._compile(e,t),i=this.index._compile(e,t),o=this.optionalChaining,s=L(this.object)&&this.object.optionalChaining;if(this.index.isObjectProperty()){var u=this.index.getObjectProperty();return function(e,t,n){var i=n||{},c=r(e,t,i);if(o&&null==c)i.optionalShortCircuit=!0;else if(!s||null==i||!i.optionalShortCircuit)return a(c,u)}}return function(e,t,a){var u=a||{},c=r(e,t,u);if(o&&null==c)u.optionalShortCircuit=!0;else if(!s||null==u||!u.optionalShortCircuit){var f=i(e,t,c);return n(c,f)}}}forEach(e){e(this.object,"object",this),e(this.index,"index",this)}map(e){return new o(this._ifNode(e(this.object,"object",this)),this._ifNode(e(this.index,"index",this)),this.optionalChaining)}clone(){return new o(this.object,this.index,this.optionalChaining)}_toString(e){var t=this.object.toString(e);return i(this.object)&&(t="("+t+")"),t+(this.optionalChaining?this.index.dotNotation?"?":"?.":"")+this.index.toString(e)}_toHTML(e){var t=this.object.toHTML(e);return i(this.object)&&(t='<span class="math-parenthesis math-round-parenthesis">(</span>'+t+'<span class="math-parenthesis math-round-parenthesis">)</span>'),t+this.index.toHTML(e)}_toTex(e){var t=this.object.toTex(e);return i(this.object)&&(t="\\left(' + object + '\\right)"),t+this.index.toTex(e)}toJSON(){return{mathjs:ro,object:this.object,index:this.index,optionalChaining:this.optionalChaining}}static fromJSON(e){return new o(e.object,e.index,e.optionalChaining)}}return Ta(o,"name",ro),o},{isClass:!0,isNode:!0}),io="ArrayNode",ao=be(io,["Node"],e=>{var{Node:t}=e;class r extends t{constructor(e){if(super(),this.items=e||[],!Array.isArray(this.items)||!this.items.every(X))throw new TypeError("Array containing Nodes expected")}get type(){return io}get isArrayNode(){return!0}_compile(e,t){var r=Cn(this.items,function(r){return r._compile(e,t)});if("Array"!==e.config.matrix){var n=e.matrix;return function(e,t,i){return n(Cn(r,function(r){return r(e,t,i)}))}}return function(e,t,n){return Cn(r,function(r){return r(e,t,n)})}}forEach(e){for(var t=0;t<this.items.length;t++){e(this.items[t],"items["+t+"]",this)}}map(e){for(var t=[],n=0;n<this.items.length;n++)t[n]=this._ifNode(e(this.items[n],"items["+n+"]",this));return new r(t)}clone(){return new r(this.items.slice(0))}_toString(e){return"["+this.items.map(function(t){return t.toString(e)}).join(", ")+"]"}toJSON(){return{mathjs:io,items:this.items}}static fromJSON(e){return new r(e.items)}_toHTML(e){return'<span class="math-parenthesis math-square-parenthesis">[</span>'+this.items.map(function(t){return t.toHTML(e)}).join('<span class="math-separator">,</span>')+'<span class="math-parenthesis math-square-parenthesis">]</span>'}_toTex(e){return function t(r,n){var i=r.some(q)&&!r.every(q),a=n||i,o=a?"&":"\\\\",s=r.map(function(r){return r.items?t(r.items,!n):r.toTex(e)}).join(o);return i||!a||a&&!n?"\\begin{bmatrix}"+s+"\\end{bmatrix}":s}(this.items,!1)}}return Ta(r,"name",io),r},{isClass:!0,isNode:!0});var oo=[{AssignmentNode:{},FunctionAssignmentNode:{}},{ConditionalNode:{latexLeftParens:!1,latexRightParens:!1,latexParens:!1}},{"OperatorNode:or":{op:"or",associativity:"left",associativeWith:[]}},{"OperatorNode:xor":{op:"xor",associativity:"left",associativeWith:[]}},{"OperatorNode:and":{op:"and",associativity:"left",associativeWith:[]}},{"OperatorNode:bitOr":{op:"|",associativity:"left",associativeWith:[]}},{"OperatorNode:bitXor":{op:"^|",associativity:"left",associativeWith:[]}},{"OperatorNode:bitAnd":{op:"&",associativity:"left",associativeWith:[]}},{"OperatorNode:equal":{op:"==",associativity:"left",associativeWith:[]},"OperatorNode:unequal":{op:"!=",associativity:"left",associativeWith:[]},"OperatorNode:smaller":{op:"<",associativity:"left",associativeWith:[]},"OperatorNode:larger":{op:">",associativity:"left",associativeWith:[]},"OperatorNode:smallerEq":{op:"<=",associativity:"left",associativeWith:[]},"OperatorNode:largerEq":{op:">=",associativity:"left",associativeWith:[]},RelationalNode:{associativity:"left",associativeWith:[]}},{"OperatorNode:leftShift":{op:"<<",associativity:"left",associativeWith:[]},"OperatorNode:rightArithShift":{op:">>",associativity:"left",associativeWith:[]},"OperatorNode:rightLogShift":{op:">>>",associativity:"left",associativeWith:[]}},{"OperatorNode:to":{op:"to",associativity:"left",associativeWith:[]}},{RangeNode:{}},{"OperatorNode:add":{op:"+",associativity:"left",associativeWith:["OperatorNode:add","OperatorNode:subtract"]},"OperatorNode:subtract":{op:"-",associativity:"left",associativeWith:[]}},{"OperatorNode:multiply":{op:"*",associativity:"left",associativeWith:["OperatorNode:multiply","OperatorNode:divide","Operator:dotMultiply","Operator:dotDivide"]}
1,"OperatorNode:divide":{op:"/",associativity:"left",associativeWith:[],latexLeftParens:!1,latexRightParens:!1,latexParens:!1},"OperatorNode:dotMultiply":{op:".*",associativity:"left",associativeWith:["OperatorNode:multiply","OperatorNode:divide","OperatorNode:dotMultiply","OperatorNode:doDivide"]},"OperatorNode:dotDivide":{op:"./",associativity:"left",associativeWith:[]},"OperatorNode:mod":{op:"mod",associativity:"left",associativeWith:[]}},{"OperatorNode:multiply":{associativity:"left",associativeWith:["OperatorNode:multiply","OperatorNode:divide","Operator:dotMultiply","Operator:dotDivide"]}},{"OperatorNode:unaryPlus":{op:"+",associativity:"right"},"OperatorNode:unaryMinus":{op:"-",associativity:"right"},"OperatorNode:bitNot":{op:"~",associativity:"right"},"OperatorNode:not":{op:"not",associativity:"right"}},{"OperatorNode:pow":{op:"^",associativity:"right",associativeWith:[],latexRightParens:!1},"OperatorNode:dotPow":{op:".^",associativity:"right",associativeWith:[]}},{"OperatorNode:nullish":{op:"??",associativity:"left",associativeWith:[]}},{"OperatorNode:factorial":{op:"!",associativity:"left"}},{"OperatorNode:ctranspose":{op:"'",associativity:"left"}}];function so(e,t){if(!t||"auto"!==t)return e;for(var r=e;ee(r);)r=r.content;return r}function uo(e,t,r,n){var i=e;"keep"!==t&&(i=e.getContent());for(var a=i.getIdentifier(),o=null,s=0;s<oo.length;s++)if(a in oo[s]){o=s;break}if("OperatorNode:multiply"===a&&i.implicit&&"show"!==r){var u=so(i.args[0],t);W(u)&&n&&"OperatorNode:divide"===n.getIdentifier()&&V(so(n.args[0],t))||"OperatorNode:divide"===u.getIdentifier()&&V(so(u.args[0],t))&&W(so(u.args[1]))||(o+=1)}return o}function co(e,t){var r=e;"keep"!==t&&(r=e.getContent());var n=r.getIdentifier(),i=uo(r,t);if(null===i)return null;var a=oo[i][n];if(pe(a,"associativity")){if("left"===a.associativity)return"left";if("right"===a.associativity)return"right";throw Error("'"+n+"' has the invalid associativity '"+a.associativity+"'.")}return null}function fo(e,t,r){var n="keep"!==r?e.getContent():e,i="keep"!==r?e.getContent():t,a=n.getIdentifier(),o=i.getIdentifier(),s=uo(n,r);if(null===s)return null;var u=oo[s][a];if(pe(u,"associativeWith")&&u.associativeWith instanceof Array){for(var c=0;c<u.associativeWith.length;c++)if(u.associativeWith[c]===o)return!0;return!1}return null}var lo,po,ho="AssignmentNode",mo=be(ho,["subset","?matrix","Node"],e=>{var{subset:t,matrix:r,Node:n}=e,i=to({subset:t}),s=function(e){var{subset:t,matrix:r}=e;return function(e,n,i){try{if(Array.isArray(e))return r(e).subset(n,i).valueOf().forEach((t,r)=>{e[r]=t}),e;if(e&&"function"==typeof e.subset)return e.subset(n,i);if("string"==typeof e)return t(e,n,i);if("object"==typeof e){if(!n.isObjectProperty())throw TypeError("Cannot apply a numeric index as object property");return o(e,n.getObjectProperty(),i),e}throw new TypeError("Cannot apply index: unsupported type of object")}catch(a){throw eo(a)}}}({subset:t,matrix:r});function u(e,t,r){t||(t="keep");var n=uo(e,t,r),i=uo(e.value,t,r);return"all"===t||null!==i&&i<=n}class c extends n{constructor(e,t,r){if(super(),this.object=e,this.index=r?t:null,this.value=r||t,!ne(e)&&!L(e))throw new TypeError('SymbolNode or AccessorNode expected as "object"');if(ne(e)&&"end"===e.name)throw new Error('Cannot assign to symbol "end"');if(this.index&&!Z(this.index))throw new TypeError('IndexNode expected as "index"');if(!X(this.value))throw new TypeError('Node expected as "value"')}get name(){return this.index?this.index.isObjectProperty()?this.index.getObjectProperty():"":this.object.name||""}get type(){return ho}get isAssignmentNode(){return!0}_compile(e,t){var r=this.object._compile(e,t),n=this.index?this.index._compile(e,t):null,u=this.value._compile(e,t),c=this.object.name;if(this.index){if(this.index.isObjectProperty()){var f=this.index.getObjectProperty();return function(e,t,n){var i=r(e,t,n),a=u(e,t,n);return o(i,f,a),a}}if(ne(this.object))return function(e,t,i){var a=r(e,t,i),o=u(e,t,i),f=n(e,t,a);return e.set(c,s(a,f,o)),o};var l=this.object.object._compile(e,t);if(this.object.index.isObjectProperty()){var p=this.object.index.getObjectProperty();return function(e,t,r){var i=l(e,t,r),c=a(i,p),f=n(e,t,c),h=u(e,t,r);return o(i,p,s(c,f,h)),h}}var h=this.object.index._compile(e,t);return function(e,t,r){var a=l(e,t,r),o=h(e,t,a),c=i(a,o),f=n(e,t,c),p=u(e,t,r);return s(a,o,s(c,f,p)),p}}if(!ne(this.object))throw new TypeError("SymbolNode expected as object");return function(e,t,r){var n=u(e,t,r);return e.set(c,n),n}}forEach(e){e(this.object,"object",this),this.index&&e(this.index,"index",this),e(this.value,"value",this)}map(e){var t=this._ifNode(e(this.object,"object",this)),r=this.index?this._ifNode(e(this.index,"index",this)):null,n=this._ifNode(e(this.value,"value",this));return new c(t,r,n)}clone(){return new c(this.object,this.index,this.value)}_toString(e){var t=this.object.toString(e),r=this.index?this.index.toString(e):"",n=this.value.toString(e);return u(this,e&&e.parenthesis,e&&e.implicit)&&(n="("+n+")"),t+r+" = "+n}toJSON(){return{mathjs:ho,object:this.object,index:this.index,value:this.value}}static fromJSON(e){return new c(e.object,e.index,e.value)}_toHTML(e){var t=this.object.toHTML(e),r=this.index?this.index.toHTML(e):"",n=this.value.toHTML(e);return u(this,e&&e.parenthesis,e&&e.implicit)&&(n='<span class="math-paranthesis math-round-parenthesis">(</span>'+n+'<span class="math-paranthesis math-round-parenthesis">)</span>'),t+r+'<span class="math-operator math-assignment-operator math-variable-assignment-operator math-binary-operator">=</span>'+n}_toTex(e){var t=this.object.toTex(e),r=this.index?this.index.toTex(e):"",n=this.value.toTex(e);return u(this,e&&e.parenthesis,e&&e.implicit)&&(n="\\left(".concat(n,"\\right)")),t+r+"="+n}}return Ta(c,"name",ho),c},{isClass:!0,isNode:!0}),go="BlockNode",vo=be(go,["ResultSet","Node"],e=>{var{ResultSet:t,Node:r}=e;class n extends r{constructor(e){if(super(),!Array.isArray(e))throw new Error("Array expected");this.blocks=e.map(function(e){var t=e&&e.node,r=!e||void 0===e.visible||e.visible;if(!X(t))throw new TypeError('Property "node" must be a Node');if("boolean"!=typeof r)throw new TypeError('Property "visible" must be a boolean');return{node:t,visible:r}})}get type(){return go}get isBlockNode(){return!0}_compile(e,r){var n=Cn(this.blocks,function(t){return{evaluate:t.node._compile(e,r),visible:t.visible}});return function(e,r,i){var a=[];return Sn(n,function(t){var n=t.evaluate(e,r,i);t.visible&&a.push(n)}),new t(a)}}forEach(e){for(var t=0;t<this.blocks.length;t++)e(this.blocks[t].node,"blocks["+t+"].node",this)}map(e){for(var t=[],r=0;r<this.blocks.length;r++){var i=this.blocks[r],a=this._ifNode(e(i.node,"blocks["+r+"].node",this));t[r]={node:a,visible:i.visible}}return new n(t)}clone(){var e=this.blocks.map(function(e){return{node:e.node,visible:e.visible}});return new n(e)}_toString(e){return this.blocks.map(function(t){return t.node.toString(e)+(t.visible?"":";")}).join("\n")}toJSON(){return{mathjs:go,blocks:this.blocks}}static fromJSON(e){return new n(e.blocks)}_toHTML(e){return this.blocks.map(function(t){return t.node.toHTML(e)+(t.visible?"":'<span class="math-separator">;</span>')}).join('<span class="math-separator"><br /></span>')}_toTex(e){return this.blocks.map(function(t){return t.node.toTex(e)+(t.visible?"":";")}).join("\\;\\;\n")}}return Ta(n,"name",go),n},{isClass:!0,isNode:!0}),Do="ConditionalNode",yo=be(Do,["Node"],e=>{var{Node:t}=e;class r extends t{constructor(e,t,r){if(super(),!X(e))throw new TypeError("Parameter condition must be a Node");if(!X(t))throw new TypeError("Parameter trueExpr must be a Node");if(!X(r))throw new TypeError("Parameter falseExpr must be a Node");this.condition=e,this.trueExpr=t,this.falseExpr=r}get type(){return Do}get isConditionalNode(){return!0}
1_compile(e,t){var r=this.condition._compile(e,t),n=this.trueExpr._compile(e,t),i=this.falseExpr._compile(e,t);return function(e,t,a){return function(e){if("number"==typeof e||"boolean"==typeof e||"string"==typeof e)return!!e;if(e){if(g(e))return!e.isZero();if(D(e))return!(!e.re&&!e.im);if(E(e))return!!e.value}if(null==e)return!1;throw new TypeError('Unsupported type of condition "'+ae(e)+'"')}(r(e,t,a))?n(e,t,a):i(e,t,a)}}forEach(e){e(this.condition,"condition",this),e(this.trueExpr,"trueExpr",this),e(this.falseExpr,"falseExpr",this)}map(e){return new r(this._ifNode(e(this.condition,"condition",this)),this._ifNode(e(this.trueExpr,"trueExpr",this)),this._ifNode(e(this.falseExpr,"falseExpr",this)))}clone(){return new r(this.condition,this.trueExpr,this.falseExpr)}_toString(e){var t=e&&e.parenthesis?e.parenthesis:"keep",r=uo(this,t,e&&e.implicit),n=this.condition.toString(e),i=uo(this.condition,t,e&&e.implicit);("all"===t||"OperatorNode"===this.condition.type||null!==i&&i<=r)&&(n="("+n+")");var a=this.trueExpr.toString(e),o=uo(this.trueExpr,t,e&&e.implicit);("all"===t||"OperatorNode"===this.trueExpr.type||null!==o&&o<=r)&&(a="("+a+")");var s=this.falseExpr.toString(e),u=uo(this.falseExpr,t,e&&e.implicit);return("all"===t||"OperatorNode"===this.falseExpr.type||null!==u&&u<=r)&&(s="("+s+")"),n+" ? "+a+" : "+s}toJSON(){return{mathjs:Do,condition:this.condition,trueExpr:this.trueExpr,falseExpr:this.falseExpr}}static fromJSON(e){return new r(e.condition,e.trueExpr,e.falseExpr)}_toHTML(e){var t=e&&e.parenthesis?e.parenthesis:"keep",r=uo(this,t,e&&e.implicit),n=this.condition.toHTML(e),i=uo(this.condition,t,e&&e.implicit);("all"===t||"OperatorNode"===this.condition.type||null!==i&&i<=r)&&(n='<span class="math-parenthesis math-round-parenthesis">(</span>'+n+'<span class="math-parenthesis math-round-parenthesis">)</span>');var a=this.trueExpr.toHTML(e),o=uo(this.trueExpr,t,e&&e.implicit);("all"===t||"OperatorNode"===this.trueExpr.type||null!==o&&o<=r)&&(a='<span class="math-parenthesis math-round-parenthesis">(</span>'+a+'<span class="math-parenthesis math-round-parenthesis">)</span>');var s=this.falseExpr.toHTML(e),u=uo(this.falseExpr,t,e&&e.implicit);return("all"===t||"OperatorNode"===this.falseExpr.type||null!==u&&u<=r)&&(s='<span class="math-parenthesis math-round-parenthesis">(</span>'+s+'<span class="math-parenthesis math-round-parenthesis">)</span>'),n+'<span class="math-operator math-conditional-operator">?</span>'+a+'<span class="math-operator math-conditional-operator">:</span>'+s}_toTex(e){return"\\begin{cases} {"+this.trueExpr.toTex(e)+"}, &\\quad{\\text{if }\\;"+this.condition.toTex(e)+"}\\\\{"+this.falseExpr.toTex(e)+"}, &\\quad{\\text{otherwise}}\\end{cases}"}}return Ta(r,"name",Do),r},{isClass:!0,isNode:!0});const Eo=t(function(){if(po)return lo;po=1;var e=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},t={"{":"\\{","}":"\\}","\\":"\\textbackslash{}","#":"\\#",$:"\\$","%":"\\%","&":"\\&","^":"\\textasciicircum{}",_:"\\_","~":"\\textasciitilde{}"},r={"–":"\\--","—":"\\---"," ":"~","\t":"\\qquad{}","\r\n":"\\newline{}","\n":"\\newline{}"},n=function(t,r){return e({},t,r)};return lo=function(i){for(var a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},o=a.preserveFormatting,s=void 0!==o&&o,u=a.escapeMapFn,c=void 0===u?n:u,f=String(i),l="",p=c(e({},t),s?e({},r):{}),h=Object.keys(p),d=function(){var e=!1;h.forEach(function(t,r){e||f.length>=t.length&&f.slice(0,t.length)===t&&(l+=p[h[r]],f=f.slice(t.length,f.length),e=!0)}),e||(l+=f.slice(0,1),f=f.slice(1,f.length))};f;)d();return l}}());var wo={Alpha:"A",alpha:"\\alpha",Beta:"B",beta:"\\beta",Gamma:"\\Gamma",gamma:"\\gamma",Delta:"\\Delta",delta:"\\delta",Epsilon:"E",epsilon:"\\epsilon",varepsilon:"\\varepsilon",Zeta:"Z",zeta:"\\zeta",Eta:"H",eta:"\\eta",Theta:"\\Theta",theta:"\\theta",vartheta:"\\vartheta",Iota:"I",iota:"\\iota",Kappa:"K",kappa:"\\kappa",varkappa:"\\varkappa",Lambda:"\\Lambda",lambda:"\\lambda",Mu:"M",mu:"\\mu",Nu:"N",nu:"\\nu",Xi:"\\Xi",xi:"\\xi",Omicron:"O",omicron:"o",Pi:"\\Pi",pi:"\\pi",varpi:"\\varpi",Rho:"P",rho:"\\rho",varrho:"\\varrho",Sigma:"\\Sigma",sigma:"\\sigma",varsigma:"\\varsigma",Tau:"T",tau:"\\tau",Upsilon:"\\Upsilon",upsilon:"\\upsilon",Phi:"\\Phi",phi:"\\phi",varphi:"\\varphi",Chi:"X",chi:"\\chi",Psi:"\\Psi",psi:"\\psi",Omega:"\\Omega",omega:"\\omega",true:"\\mathrm{True}",false:"\\mathrm{False}",i:"i",inf:"\\infty",Inf:"\\infty",infinity:"\\infty",Infinity:"\\infty",oo:"\\infty",lim:"\\lim",undefined:"\\mathbf{?}"},bo={transpose:"^\\top",ctranspose:"^H",factorial:"!",pow:"^",dotPow:".^\\wedge",unaryPlus:"+",unaryMinus:"-",bitNot:"\\~",not:"\\neg",multiply:"\\cdot",divi
vendor: 4,173 bytes, line 1
1de:"\\frac",dotMultiply:".\\cdot",dotDivide:".:",mod:"\\mod",add:"+",subtract:"-",to:"\\rightarrow",leftShift:"<<",rightArithShift:">>",rightLogShift:">>>",equal:"=",unequal:"\\neq",smaller:"<",larger:">",smallerEq:"\\leq",largerEq:"\\geq",bitAnd:"\\&",bitXor:"\\underline{|}",bitOr:"|",and:"\\wedge",xor:"\\veebar",or:"\\vee"},xo={abs:{1:"\\left|${args[0]}\\right|"},add:{2:"\\left(${args[0]}".concat(bo.add,"${args[1]}\\right)")},cbrt:{1:"\\sqrt[3]{${args[0]}}"},ceil:{1:"\\left\\lceil${args[0]}\\right\\rceil"},cube:{1:"\\left(${args[0]}\\right)^3"},divide:{2:"\\frac{${args[0]}}{${args[1]}}"},dotDivide:{2:"\\left(${args[0]}".concat(bo.dotDivide,"${args[1]}\\right)")},dotMultiply:{2:"\\left(${args[0]}".concat(bo.dotMultiply,"${args[1]}\\right)")},dotPow:{2:"\\left(${args[0]}".concat(bo.dotPow,"${args[1]}\\right)")},exp:{1:"\\exp\\left(${args[0]}\\right)"},expm1:"\\left(e".concat(bo.pow,"{${args[0]}}-1\\right)"),fix:{1:"\\mathrm{${name}}\\left(${args[0]}\\right)"},floor:{1:"\\left\\lfloor${args[0]}\\right\\rfloor"},fraction:{2:"\\frac{${args[0]}}{${args[1]}}"},gcd:"\\gcd\\left(${args}\\right)",hypot:"\\hypot\\left(${args}\\right)",log:{1:"\\ln\\left(${args[0]}\\right)",2:"\\log_{${args[1]}}\\left(${args[0]}\\right)"},log10:{1:"\\log_{10}\\left(${args[0]}\\right)"},log1p:{1:"\\ln\\left(${args[0]}+1\\right)",2:"\\log_{${args[1]}}\\left(${args[0]}+1\\right)"},log2:"\\log_{2}\\left(${args[0]}\\right)",mod:{2:"\\left(${args[0]}".concat(bo.mod,"${args[1]}\\right)")},multiply:{2:"\\left(${args[0]}".concat(bo.multiply,"${args[1]}\\right)")},norm:{1:"\\left\\|${args[0]}\\right\\|",2:void 0},nthRoot:{2:"\\sqrt[${args[1]}]{${args[0]}}"},nthRoots:{2:"\\{y : y^${args[1]} = {${args[0]}}\\}"},pow:{2:"\\left(${args[0]}\\right)".concat(bo.pow,"{${args[1]}}")},round:{1:"\\left\\lfloor${args[0]}\\right\\rceil",2:void 0},sign:{1:"\\mathrm{${name}}\\left(${args[0]}\\right)"},sqrt:{1:"\\sqrt{${args[0]}}"},square:{1:"\\left(${args[0]}\\right)^2"},subtract:{2:"\\left(${args[0]}".concat(bo.subtract,"${args[1]}\\right)")},unaryMinus:{1:"".concat(bo.unaryMinus,"\\left(${args[0]}\\right)")},unaryPlus:{1:"".concat(bo.unaryPlus,"\\left(${args[0]}\\right)")},bitAnd:{2:"\\left(${args[0]}".concat(bo.bitAnd,"${args[1]}\\right)")},bitNot:{1:bo.bitNot+"\\left(${args[0]}\\right)"},bitOr:{2:"\\left(${args[0]}".concat(bo.bitOr,"${args[1]}\\right)")},bitXor:{2:"\\left(${args[0]}".concat(bo.bitXor,"${args[1]}\\right)")},leftShift:{2:"\\left(${args[0]}".concat(bo.leftShift,"${args[1]}\\right)")},rightArithShift:{2:"\\left(${args[0]}".concat(bo.rightArithShift,"${args[1]}\\right)")},rightLogShift:{2:"\\left(${args[0]}".concat(bo.rightLogShift,"${args[1]}\\right)")},bellNumbers:{1:"\\mathrm{B}_{${args[0]}}"},catalan:{1:"\\mathrm{C}_{${args[0]}}"},stirlingS2:{2:"\\mathrm{S}\\left(${args}\\right)"},arg:{1:"\\arg\\left(${args[0]}\\right)"},conj:{1:"\\left(${args[0]}\\right)^*"},im:{1:"\\Im\\left\\lbrace${args[0]}\\right\\rbrace"},re:{1:"\\Re\\left\\lbrace${args[0]}\\right\\rbrace"},and:{2:"\\left(${args[0]}".concat(bo.and,"${args[1]}\\right)")},not:{1:bo.not+"\\left(${args[0]}\\right)"},or:{2:"\\left(${args[0]}".concat(bo.or,"${args[1]}\\right)")},xor:{2:"\\left(${args[0]}".concat(bo.xor,"${args[1]}\\right)")},cross:{2:"\\left(${args[0]}\\right)\\times\\left(${args[1]}\\right)"},ctranspose:{1:"\\left(${args[0]}\\right)".concat(bo.ctranspose)},det:{1:"\\det\\left(${args[0]}\\right)"},dot:{2:"\\left(${args[0]}\\cdot${args[1]}\\right)"},expm:{1:"\\exp\\left(${args[0]}\\right)"},inv:{1:"\\left(${args[0]}\\right)^{-1}"},pinv:{1:"\\left(${args[0]}\\right)^{+}"},sqrtm:{1:"{${args[0]}}".concat(bo.pow,"{\\frac{1}{2}}")},trace:{1:"\\mathrm{tr}\\left(${args[0]}\\right)"},transpose:{1:"\\left(${args[0]}\\right)".concat(bo.transpose)},combinations:{2:"\\binom{${args[0]}}{${args[1]}}"},combinationsWithRep:{2:"\\left(\\!\\!{\\binom{${args[0]}}{${args[1]}}}\\!\\!\\right)"},factorial:{1:"\\left(${args[0]}\\right)".concat(bo.factorial)},gamma:{1:"\\Gamma\\left(${args[0]}\\right)"},lgamma:{1:"\\ln\\Gamma\\left(${args[0]}\\right)"},equal:{2:"\\left(${args[0]}".concat(bo.equal,"${args[1]}\\right)")},larger:{2:"\\left(${args[0]}".concat(bo.larger,"${args[1]}\\right)")}
1,largerEq:{2:"\\left(${args[0]}".concat(bo.largerEq,"${args[1]}\\right)")},smaller:{2:"\\left(${args[0]}".concat(bo.smaller,"${args[1]}\\right)")},smallerEq:{2:"\\left(${args[0]}".concat(bo.smallerEq,"${args[1]}\\right)")},unequal:{2:"\\left(${args[0]}".concat(bo.unequal,"${args[1]}\\right)")},erf:{1:"erf\\left(${args[0]}\\right)"},max:"\\max\\left(${args}\\right)",min:"\\min\\left(${args}\\right)",variance:"\\mathrm{Var}\\left(${args}\\right)",acos:{1:"\\cos^{-1}\\left(${args[0]}\\right)"},acosh:{1:"\\cosh^{-1}\\left(${args[0]}\\right)"},acot:{1:"\\cot^{-1}\\left(${args[0]}\\right)"},acoth:{1:"\\coth^{-1}\\left(${args[0]}\\right)"},acsc:{1:"\\csc^{-1}\\left(${args[0]}\\right)"},acsch:{1:"\\mathrm{csch}^{-1}\\left(${args[0]}\\right)"},asec:{1:"\\sec^{-1}\\left(${args[0]}\\right)"},asech:{1:"\\mathrm{sech}^{-1}\\left(${args[0]}\\right)"},asin:{1:"\\sin^{-1}\\left(${args[0]}\\right)"},asinh:{1:"\\sinh^{-1}\\left(${args[0]}\\right)"},atan:{1:"\\tan^{-1}\\left(${args[0]}\\right)"},atan2:{2:"\\mathrm{atan2}\\left(${args}\\right)"},atanh:{1:"\\tanh^{-1}\\left(${args[0]}\\right)"},cos:{1:"\\cos\\left(${args[0]}\\right)"},cosh:{1:"\\cosh\\left(${args[0]}\\right)"},cot:{1:"\\cot\\left(${args[0]}\\right)"},coth:{1:"\\coth\\left(${args[0]}\\right)"},csc:{1:"\\csc\\left(${args[0]}\\right)"},csch:{1:"\\mathrm{csch}\\left(${args[0]}\\right)"},sec:{1:"\\sec\\left(${args[0]}\\right)"},sech:{1:"\\mathrm{sech}\\left(${args[0]}\\right)"},sin:{1:"\\sin\\left(${args[0]}\\right)"},sinh:{1:"\\sinh\\left(${args[0]}\\right)"},tan:{1:"\\tan\\left(${args[0]}\\right)"},tanh:{1:"\\tanh\\left(${args[0]}\\right)"},to:{2:"\\left(${args[0]}".concat(bo.to,"${args[1]}\\right)")},numeric:function(e,t){return e.args[0].toTex()},number:{0:"0",1:"\\left(${args[0]}\\right)",2:"\\left(\\left(${args[0]}\\right)${args[1]}\\right)"},string:{0:'\\mathtt{""}',1:"\\mathrm{string}\\left(${args[0]}\\right)"},bignumber:{0:"0",1:"\\left(${args[0]}\\right)"},bigint:{0:"0",1:"\\left(${args[0]}\\right)"},complex:{0:"0",1:"\\left(${args[0]}\\right)",2:"\\left(\\left(${args[0]}\\right)+".concat(wo.i,"\\cdot\\left(${args[1]}\\right)\\right)")},matrix:{0:"\\begin{bmatrix}\\end{bmatrix}",1:"\\left(${args[0]}\\right)",2:"\\left(${args[0]}\\right)"},sparse:{0:"\\begin{bsparse}\\end{bsparse}",1:"\\left(${args[0]}\\right)"},unit:{1:"\\left(${args[0]}\\right)",2:"\\left(\\left(${args[0]}\\right)${args[1]}\\right)"}},No={deg:"^\\circ"};function Ao(e){return Eo(e,{preserveFormatting:!0})}function Fo(e,t){return(t=void 0!==t&&t)?pe(No,e)?No[e]:"\\mathrm{"+Ao(e)+"}":pe(wo,e)?wo[e]:Ao(e)}var Co="ConstantNode",So=be(Co,["Node","isBounded"],e=>{var{Node:t,isBounded:r}=e;class n extends t{constructor(e){super(),this.value=e}get type(){return Co}get isConstantNode(){return!0}_compile(e,t){var r=this.value;return function(){return r}}forEach(e){}map(e){return this.clone()}clone(){return new n(this.value)}_toString(e){return sn(this.value,e)}_toHTML(e){var t=this._toString(e);switch(ae(this.value)){case"number":case"bigint":case"BigNumber":case"Fraction":return'<span class="math-number">'+t+"</span>";case"string":return'<span class="math-string">'+t+"</span>";case"boolean":return'<span class="math-boolean">'+t+"</span>";case"null":return'<span class="math-null-symbol">'+t+"</span>";case"undefined":return'<span class="math-undefined">'+t+"</span>";default:return'<span class="math-symbol">'+t+"</span>"}}toJSON(){return{mathjs:Co,value:this.value}}static fromJSON(e){return new n(e.value)}_toTex(e){var t=this._toString(e);switch(ae(this.value)){case"string":return"\\mathtt{"+Ao(t)+"}";case"number":case"BigNumber":if(!r(this.value))return this.value.valueOf()<0?"-\\infty":"\\infty";var n=t.toLowerCase().indexOf("e");return-1!==n?t.substring(0,n)+"\\cdot10^{"+t.substring(n+1)+"}":t;case"bigint":return t.toString();case"Fraction":return this.value.toLatex();default:return t}}}return Ta(n,"name",Co),n},{isClass:!0,isNode:!0}),To="FunctionAssignmentNode",_o=be(To,["typed","Node"],e=>{var{typed:t,Node:r}=e;function n(e,t,r){var n=uo(e,t,r),i=uo(e.expr,t,r);return"all"===t||null!==i&&i<=n}class i extends r{constructor(e,t,r){if(super(),"string"!=typeof e)throw new TypeError('String expected for parameter "name"');
1if(!Array.isArray(t))throw new TypeError('Array containing strings or objects expected for parameter "params"');if(!X(r))throw new TypeError('Node expected for parameter "expr"');if(Ka.has(e))throw new Error('Illegal function name, "'+e+'" is a reserved keyword');var n=new Set;for(var i of t){var a="string"==typeof i?i:i.name;if(n.has(a))throw new Error('Duplicate parameter name "'.concat(a,'"'));n.add(a)}this.name=e,this.params=t.map(function(e){return e&&e.name||e}),this.types=t.map(function(e){return e&&e.type||"any"}),this.expr=r}get type(){return To}get isFunctionAssignmentNode(){return!0}_compile(e,r){var n=Object.create(r);Sn(this.params,function(e){n[e]=!0});var i=this.expr,a=i._compile(e,n),o=this.name,s=this.params,u=Tn(this.types,","),c=o+"("+Tn(this.params,", ")+")";return function(e,r,n){var f={};f[u]=function(){for(var t=Object.create(r),i=0;i<s.length;i++)t[s[i]]=arguments[i];return a(e,t,n)};var l=t(o,f);return l.syntax=c,l.expr=i.toString(),e.set(o,l),l}}forEach(e){e(this.expr,"expr",this)}map(e){var t=this._ifNode(e(this.expr,"expr",this));return new i(this.name,this.params.slice(0),t)}clone(){return new i(this.name,this.params.slice(0),this.expr)}_toString(e){var t=e&&e.parenthesis?e.parenthesis:"keep",r=this.expr.toString(e);return n(this,t,e&&e.implicit)&&(r="("+r+")"),this.name+"("+this.params.join(", ")+") = "+r}toJSON(){var e=this.types;return{mathjs:To,name:this.name,params:this.params.map(function(t,r){return{name:t,type:e[r]}}),expr:this.expr}}static fromJSON(e){return new i(e.name,e.params,e.expr)}_toHTML(e){for(var t=e&&e.parenthesis?e.parenthesis:"keep",r=[],i=0;i<this.params.length;i++)r.push('<span class="math-symbol math-parameter">'+fn(this.params[i])+"</span>");var a=this.expr.toHTML(e);return n(this,t,e&&e.implicit)&&(a='<span class="math-parenthesis math-round-parenthesis">(</span>'+a+'<span class="math-parenthesis math-round-parenthesis">)</span>'),'<span class="math-function">'+fn(this.name)+'</span><span class="math-parenthesis math-round-parenthesis">(</span>'+r.join('<span class="math-separator">,</span>')+'<span class="math-parenthesis math-round-parenthesis">)</span><span class="math-operator math-assignment-operator math-variable-assignment-operator math-binary-operator">=</span>'+a}_toTex(e){var t=e&&e.parenthesis?e.parenthesis:"keep",r=this.expr.toTex(e);return n(this,t,e&&e.implicit)&&(r="\\left(".concat(r,"\\right)")),"\\mathrm{"+this.name+"}\\left("+this.params.map(Fo).join(",")+"\\right)="+r}}return Ta(i,"name",To),i},{isClass:!0,isNode:!0}),Mo="IndexNode",Bo=be(Mo,["Node","size"],e=>{var{Node:t,size:r}=e;class n extends t{constructor(e,t){if(super(),this.dimensions=e,this.dotNotation=t||!1,!Array.isArray(e)||!e.every(X))throw new TypeError('Array containing Nodes expected for parameter "dimensions"');if(this.dotNotation&&!this.isObjectProperty())throw new Error("dotNotation only applicable for object properties")}get type(){return Mo}get isIndexNode(){return!0}_compile(e,t){var n=Cn(this.dimensions,function(n,i){if(n.filter(e=>e.isSymbolNode&&"end"===e.name).length>0){var a=Object.create(t);a.end=!0;var o=n._compile(e,a);return function(e,t,n){if(!x(n)&&!b(n)&&!w(n))throw new TypeError('Cannot resolve "end": context must be a Matrix, Array, or string but is '+ae(n));var a=r(n),s=Object.create(t);return s.end=a[i],o(e,s,n)}}return n._compile(e,t)}),i=a(e,"index");return function(e,t,r){var a=Cn(n,function(n){return n(e,t,r)});return i(...a)}}forEach(e){for(var t=0;t<this.dimensions.length;t++)e(this.dimensions[t],"dimensions["+t+"]",this)}map(e){for(var t=[],r=0;r<this.dimensions.length;r++)t[r]=this._ifNode(e(this.dimensions[r],"dimensions["+r+"]",this));return new n(t,this.dotNotation)}clone(){return new n(this.dimensions.slice(0),this.dotNotation)}isObjectProperty(){return 1===this.dimensions.length&&W(this.dimensions[0])&&"string"==typeof this.dimensions[0].value}getObjectProperty(){return this.isObjectProperty()?this.dimensions[0].value:null}_toString(e){return this.dotNotation?"."+this.getObjectProperty():"["+this.dimensions.join(", ")+"]"}toJSON(){return{mathjs:Mo,dimensions:this.dimensions,dotNotation:this.dotNotation}}static fromJSON(e){return new n(e.dimensions,e.dotNotation)}_toHTML(e){for(var t=[],r=0;r<this.dimensions.length;r++)t[r]=this.dimensions[r].toHTML();return this.dotNotation?'<span class="math-operator math-accessor-operator">.</span><span class="math-symbol math-property">'+fn(this.getObjectProperty())+"</span>":'<span class="math-parenthesis math-square-parenthesis">[</span>'+t.join('<span class="math-separator">,</span>')+'<span class="math-parenthesis math-square-parenthesis">]</span>'}_toTex(e){var t=this.dimensions.map(function(t){return t.toTex(e)});return this.dotNotation?"."+this.getObjectProperty():"_{"+t.join(",")+"}"}}return Ta(n,"name",Mo),n},{isClass:!0,isNode:!0}),Oo="ObjectNode",Io=be(Oo,["Node"],e=>{var{Node:t}=e;class r extends t{constructor(e){if(super(),this.properties=e||{},e&&("object"!=typeof e||!Object.keys(e).every(function(t){return X(e[t])})))throw new TypeError("Object containing Nodes expected")}get type(){return Oo}get isObjectNode(){return!0}_compile(e,t){var r={};for(var n in this.properties)if(pe(this.properties,n)){var i=un(n),o=JSON.parse(i),s=a(this.properties,n);r[o]=s._compile(e,t)}return function(e,t,n){var i={};for(var a in r)pe(r,a)&&(i[a]=r[a](e,t,n));return i}}forEach(e){for(var t in this.properties)pe(this.properties,t)&&e(this.properties[t],"properties["+un(t)+"]",this)}map(e){var t={};for(var n in this.properties)pe(this.properties,n)&&(t[n]=this._ifNode(e(this.properties[n],"properties["+un(n)+"]",this)));return new r(t)}clone(){var e={};for(var t in this.properties)pe(this.properties,t)&&(e[t]=this.properties[t]);return new r(e)}_toString(e){var t=[];for(var r in this.properties)pe(this.properties,r)&&t.push(un(r)+": "+this.properties[r].toString(e));return"{"+t.join(", ")+"}"}toJSON(){return{mathjs:Oo,properties:this.properties}}static fromJSON(e){return new r(e.properties)}_toHTML(e){var t=[];for(var r in this.properties)pe(this.properties,r)&&t.push('<span class="math-symbol math-property">'+fn(r)+'</span><span class="math-operator math-assignment-operator math-property-assignment-operator math-binary-operator">:</span>'+this.properties[r].toHTML(e));return'<span class="math-parenthesis math-curly-parenthesis">{</span>'+t.join('<span class="math-separator">,</span>')+'<span class="math-parenthesis math-curly-parenthesis">}</span>'}_toTex(e){var t=[];for(var r in this.properties)pe(this.properties,r)&&t.push("\\mathbf{"+r+":} & "+this.properties[r].toTex(e)+"\\\\");return"\\left\\{\\begin{array}{ll}"+t.join("\n")+"\\end{array}\\right\\}"}}return Ta(r,"name",Oo),r},{isClass:!0,isNode:!0});function ko(e,t){return new p(e,new l(t),new Set(Object.keys(t)))}var Ro,jo="OperatorNode",zo=be(jo,["Node"],e=>{var{Node:t}=e;function r(e,t){var n=e;if("auto"===t)for(;ee(n);)n=n.content;return!!W(n)||!!Q(n)&&r(n.args[0],t)}function n(e,t,n,i,a){var o,s=uo(e,t,n),u=co(e,t);if("all"===t||i.length>2&&"OperatorNode:add"!==e.getIdentifier()&&"OperatorNode:multiply"!==e.getIdentifier())return i.map(function(e){switch(e.getContent().type){case"ArrayNode":case"ConstantNode":case"SymbolNode":case"ParenthesisNode":return!1;default:return!0}});switch(i.length){case 0:o=[];break;case 1:var c=uo(i[0],t,n,e);
1if(a&&null!==c){var f,l;if("keep"===t?(f=i[0].getIdentifier(),l=e.getIdentifier()):(f=i[0].getContent().getIdentifier(),l=e.getContent().getIdentifier()),!1===oo[s][l].latexLeftParens){o=[!1];break}if(!1===oo[c][f].latexParens){o=[!1];break}}if(null===c){o=[!1];break}if(c<=s){o=[!0];break}o=[!1];break;case 2:var p,h,d=uo(i[0],t,n,e),m=fo(e,i[0],t);p=null!==d&&(d===s&&"right"===u&&!m||d<s);var g,v,D,y=uo(i[1],t,n,e),E=fo(e,i[1],t);if(h=null!==y&&(y===s&&"left"===u&&!E||y<s),a)"keep"===t?(g=e.getIdentifier(),v=e.args[0].getIdentifier(),D=e.args[1].getIdentifier()):(g=e.getContent().getIdentifier(),v=e.args[0].getContent().getIdentifier(),D=e.args[1].getContent().getIdentifier()),null!==d&&(!1===oo[s][g].latexLeftParens&&(p=!1),!1===oo[d][v].latexParens&&(p=!1)),null!==y&&(!1===oo[s][g].latexRightParens&&(h=!1),!1===oo[y][D].latexParens&&(h=!1));o=[p,h];break;default:"OperatorNode:add"!==e.getIdentifier()&&"OperatorNode:multiply"!==e.getIdentifier()||(o=i.map(function(r){var i=uo(r,t,n,e),a=fo(e,r,t),o=co(r,t);return null!==i&&(s===i&&u===o&&!a||i<s)}))}if(i.length>=2&&"OperatorNode:multiply"===e.getIdentifier()&&e.implicit&&"all"!==t&&"hide"===n)for(var w=1;w<o.length;++w)!r(i[w],t)||o[w-1]||"keep"===t&&ee(i[w-1])||(o[w]=!0);return o}class i extends t{constructor(e,t,r,n,i){if(super(),"string"!=typeof e)throw new TypeError('string expected for parameter "op"');if("string"!=typeof t)throw new TypeError('string expected for parameter "fn"');if(!Array.isArray(r)||!r.every(X))throw new TypeError('Array containing Nodes expected for parameter "args"');this.implicit=!0===n,this.isPercentage=!0===i,this.op=e,this.fn=t,this.args=r||[]}get type(){return jo}get isOperatorNode(){return!0}
1_compile(e,t){if("string"!=typeof this.fn||!c(e,this.fn))throw e[this.fn]?new Error('No access to function "'+this.fn+'"'):new Error("Function "+this.fn+' missing in provided namespace "math"');var r=a(e,this.fn),n=Cn(this.args,function(r){return r._compile(e,t)});if("function"==typeof r&&!0===r.rawArgs){var i=this.args;return function(t,n,a){return r(i,e,ko(t,n))}}if(1===n.length){var o=n[0];return function(e,t,n){return r(o(e,t,n))}}if(2===n.length){var s=n[0],u=n[1];return function(e,t,n){return r(s(e,t,n),u(e,t,n))}}return function(e,t,i){return r.apply(null,Cn(n,function(r){return r(e,t,i)}))}}forEach(e){for(var t=0;t<this.args.length;t++)e(this.args[t],"args["+t+"]",this)}map(e){for(var t=[],r=0;r<this.args.length;r++)t[r]=this._ifNode(e(this.args[r],"args["+r+"]",this));return new i(this.op,this.fn,t,this.implicit,this.isPercentage)}clone(){return new i(this.op,this.fn,this.args.slice(0),this.implicit,this.isPercentage)}isUnary(){return 1===this.args.length}isBinary(){return 2===this.args.length}_toString(e){var t=e&&e.parenthesis?e.parenthesis:"keep",r=e&&e.implicit?e.implicit:"hide",i=this.args,a=n(this,t,r,i,!1);if(1===i.length){var o=co(this,t),s=i[0].toString(e);a[0]&&(s="("+s+")");var u=/[a-zA-Z]+/.test(this.op);return"right"===o?this.op+(u?" ":"")+s:"left"===o?s+(u?" ":"")+this.op:s+this.op}if(2===i.length){var c=i[0].toString(e),f=i[1].toString(e);return a[0]&&(c="("+c+")"),a[1]&&(f="("+f+")"),this.implicit&&"OperatorNode:multiply"===this.getIdentifier()&&"hide"===r?c+" "+f:c+" "+this.op+" "+f}if(i.length>2&&("OperatorNode:add"===this.getIdentifier()||"OperatorNode:multiply"===this.getIdentifier())){var l=i.map(function(t,r){return t=t.toString(e),a[r]&&(t="("+t+")"),t});return this.implicit&&"OperatorNode:multiply"===this.getIdentifier()&&"hide"===r?l.join(" "):l.join(" "+this.op+" ")}return this.fn+"("+this.args.join(", ")+")"}toJSON(){return{mathjs:jo,op:this.op,fn:this.fn,args:this.args,implicit:this.implicit,isPercentage:this.isPercentage}}static fromJSON(e){return new i(e.op,e.fn,e.args,e.implicit,e.isPercentage)}_toHTML(e){var t=e&&e.parenthesis?e.parenthesis:"keep",r=e&&e.implicit?e.implicit:"hide",i=this.args,a=n(this,t,r,i,!1);if(1===i.length){var o=co(this,t),s=i[0].toHTML(e);return a[0]&&(s='<span class="math-parenthesis math-round-parenthesis">(</span>'+s+'<span class="math-parenthesis math-round-parenthesis">)</span>'),"right"===o?'<span class="math-operator math-unary-operator math-lefthand-unary-operator">'+fn(this.op)+"</span>
1"+s:s+'<span class="math-operator math-unary-operator math-righthand-unary-operator">'+fn(this.op)+"</span>"}if(2===i.length){var u=i[0].toHTML(e),c=i[1].toHTML(e);return a[0]&&(u='<span class="math-parenthesis math-round-parenthesis">(</span>'+u+'<span class="math-parenthesis math-round-parenthesis">)</span>'),a[1]&&(c='<span class="math-parenthesis math-round-parenthesis">(</span>'+c+'<span class="math-parenthesis math-round-parenthesis">)</span>'),this.implicit&&"OperatorNode:multiply"===this.getIdentifier()&&"hide"===r?u+'<span class="math-operator math-binary-operator math-implicit-binary-operator"></span>'+c:u+'<span class="math-operator math-binary-operator math-explicit-binary-operator">'+fn(this.op)+"</span>"+c}var f=i.map(function(t,r){return t=t.toHTML(e),a[r]&&(t='<span class="math-parenthesis math-round-parenthesis">(</span>'+t+'<span class="math-parenthesis math-round-parenthesis">)</span>'),t});return i.length>2&&("OperatorNode:add"===this.getIdentifier()||"OperatorNode:multiply"===this.getIdentifier())?this.implicit&&"OperatorNode:multiply"===this.getIdentifier()&&"hide"===r?f.join('<span class="math-operator math-binary-operator math-implicit-binary-operator"></span>'):f.join('<span class="math-operator math-binary-operator math-explicit-binary-operator">'+fn(this.op)+"</span>"):'<span class="math-function">'+fn(this.fn)+'</span><span class="math-paranthesis math-round-parenthesis">(</span>'+f.join('<span class="math-separator">,</span>')+'<span class="math-paranthesis math-round-parenthesis">)</span>'}_toTex(e){var t=e&&e.parenthesis?e.parenthesis:"keep",r=e&&e.implicit?e.implicit:"hide",i=this.args,a=n(this,t,r,i,!0),o=bo[this.fn];if(o=void 0===o?this.op:o,1===i.length){var s=co(this,t),u=i[0].toTex(e);return a[0]&&(u="\\left(".concat(u,"\\right)")),"right"===s?o+u:u+o}if(2===i.length){var c=i[0],f=c.toTex(e);a[0]&&(f="\\left(".concat(f,"\\right)"));var l,p=i[1].toTex(e);switch(a[1]&&(p="\\left(".concat(p,"\\right)")),l="keep"===t?c.getIdentifier():c.getContent().getIdentifier(),this.getIdentifier()){case"OperatorNode:divide":return o+"{"+f+"}{"+p+"}";case"OperatorNode:pow":switch(f="{"+f+"}",p="{"+p+"}",l){case"ConditionalNode":case"OperatorNode:divide":f="\\left(".concat(f,"\\right)")}break;case"OperatorNode:multiply":if(this.implicit&&"hide"===r)return f+"~"+p}return f+o+p}if(i.length>2&&("OperatorNode:add"===this.getIdentifier()||"OperatorNode:multiply"===this.getIdentifier())){var h=i.map(function(t,r){return t=t.toTex(e),a[r]&&(t="\\left(".concat(t,"\\right)")),t});return"OperatorNode:multiply"===this.getIdentifier()&&this.implicit&&"hide"===r?h.join("~"):h.join(o)}return"\\mathrm{"+this.fn+"}\\left("+i.map(function(t){return t.toTex(e)}).join(",")+"\\right)"}getIdentifier(){return this.type+":"+this.fn}}return Ta(i,"name",jo),i},{isClass:!0,isNode:!0}),Uo="ParenthesisNode",Po=be(Uo,["Node"],e=>{var{Node:t}=e;class r extends t{constructor(e){if(super(),!X(e))throw new TypeError('Node expected for parameter "content"');this.content=e}get type(){return Uo}get isParenthesisNode(){return!0}_compile(e,t){return this.content._compile(e,t)}getContent(){return this.content.getContent()}forEach(e){e(this.content,"content",this)}map(e){var t=e(this.content,"content",this);return new r(t)}clone(){return new r(this.content)}_toString(e){return!e||e&&!e.parenthesis||e&&"keep"===e.parenthesis?"("+this.content.toString(e)+")":this.content.toString(e)}toJSON(){return{mathjs:Uo,content:this.content}}static fromJSON(e){return new r(e.content)}_toHTML(e){return!e||e&&!e.parenthesis||e&&"keep"===e.parenthesis?'<span class="math-parenthesis math-round-parenthesis">(</span>'+this.content.toHTML(e)+'<span class="math-parenthesis math-round-parenthesis">)</span>':this.content.toHTML(e)}_toTex(e){return!e||e&&!e.parenthesis||e&&"keep"===e.parenthesis?"\\left(".concat(this.content.toTex(e),"\\right)"):this.content.toTex(e)}}return Ta(r,"name",Uo),r},{isClass:!0,isNode:!0}),Lo="RangeNode",qo=be(Lo,["Node"],e=>{var{Node:t}=e;function r(e,t,r){var n=uo(e,t,r),i={},a=uo(e.start,t,r);if(i.start=null!==a&&a<=n||"all"===t,e.step){var o=uo(e.step,t,r);i.step=null!==o&&o<=n||"all"===t}var s=uo(e.end,t,r);return i.end=null!==s&&s<=n||"all"===t,i}class n extends t{constructor(e,t,r){if(super(),!X(e))throw new TypeError("Node expected");if(!X(t))throw new TypeError("Node expected");if(r&&!X(r))throw new TypeError("Node expected");if(arguments.length>3)throw new Error("Too many arguments");this.start=e,this.end=t,this.step=r||null}get type(){return Lo}get isRangeNode(){return!0}needsEnd(){return this.filter(function(e){return ne(e)&&"end"===e.name}).length>0}_compile(e,t){var r=e.range,n=this.start._compile(e,t),i=this.end._compile(e,t);if(this.step){var a=this.step._compile(e,t);return function(e,t,o){return r(n(e,t,o),i(e,t,o),a(e,t,o))}}return function(e,t,a){return r(n(e,t,a),i(e,t,a))}}forEach(e){e(this.start,"start",this),e(this.end,"end",this),this.step&&e(this.step,"step",this)}map(e){return new n(this._ifNode(e(this.start,"start",this)),this._ifNode(e(this.end,"end",this)),this.step&&this._ifNode(e(this.step,"step",this)))}clone(){return new n(this.start,this.end,this.step&&this.step)}_toString(e){var t,n=r(this,e&&e.parenthesis?e.parenthesis:"keep",e&&e.implicit),i=this.start.toString(e);if(n.start&&(i="("+i+")"),t=i,this.step){var a=this.step.toString(e);n.step&&(a="("+a+")"),t+=":"+a}var o=this.end.toString(e);return n.end&&(o="("+o+")"),t+=":"+o}toJSON(){return{mathjs:Lo,start:this.start,end:this.end,step:this.step}}static fromJSON(e){return new n(e.start,e.end,e.step)}_toHTML(e){var t,n=r(this,e&&e.parenthesis?e.parenthesis:"keep",e&&e.implicit),i=this.start.toHTML(e);if(n.start&&(i='<span class="math-parenthesis math-round-parenthesis">(</span>'+i+'<span class="math-parenthesis math-round-parenthesis">)</span>'),t=i,this.step){var a=this.step.toHTML(e);
1n.step&&(a='<span class="math-parenthesis math-round-parenthesis">(</span>'+a+'<span class="math-parenthesis math-round-parenthesis">)</span>'),t+='<span class="math-operator math-range-operator">:</span>'+a}var o=this.end.toHTML(e);return n.end&&(o='<span class="math-parenthesis math-round-parenthesis">(</span>'+o+'<span class="math-parenthesis math-round-parenthesis">)</span>'),t+='<span class="math-operator math-range-operator">:</span>'+o}_toTex(e){var t=r(this,e&&e.parenthesis?e.parenthesis:"keep",e&&e.implicit),n=this.start.toTex(e);if(t.start&&(n="\\left(".concat(n,"\\right)")),this.step){var i=this.step.toTex(e);t.step&&(i="\\left(".concat(i,"\\right)")),n+=":"+i}var a=this.end.toTex(e);return t.end&&(a="\\left(".concat(a,"\\right)")),n+=":"+a}}return Ta(n,"name",Lo),n},{isClass:!0,isNode:!0}),$o="RelationalNode",Ho=be($o,["Node"],e=>{var{Node:t}=e,r={equal:"==",unequal:"!=",smaller:"<",larger:">",smallerEq:"<=",largerEq:">="};class n extends t{constructor(e,t){if(super(),!Array.isArray(e))throw new TypeError("Parameter conditionals must be an array");if(!Array.isArray(t))throw new TypeError("Parameter params must be an array");if(e.length!==t.length-1)throw new TypeError("Parameter params must contain exactly one more element than parameter conditionals");this.conditionals=e,this.params=t}get type(){return $o}get isRelationalNode(){return!0}_compile(e,t){var r=this,n=this.params.map(r=>r._compile(e,t));return function(t,i,o){for(var s,u=n[0](t,i,o),c=0;c<r.conditionals.length;c++){if(s=u,u=n[c+1](t,i,o),!a(e,r.conditionals[c])(s,u))return!1}return!0}}forEach(e){this.params.forEach((t,r)=>e(t,"params["+r+"]",this),this)}map(e){return new n(this.conditionals.slice(),this.params.map((t,r)=>this._ifNode(e(t,"params["+r+"]",this)),this))}clone(){return new n(this.conditionals,this.params)}_toString(e){for(var t=e&&e.parenthesis?e.parenthesis:"keep",n=uo(this,t,e&&e.implicit),i=this.params.map(function(r,i){var a=uo(r,t,e&&e.implicit);return"all"===t||null!==a&&a<=n?"("+r.toString(e)+")":r.toString(e)}),a=i[0],o=0;o<this.conditionals.length;o++)a+=" "+r[this.conditionals[o]],a+=" "+i[o+1];return a}toJSON(){return{mathjs:$o,conditionals:this.conditionals,params:this.params}}static fromJSON(e){return new n(e.conditionals,e.params)}_toHTML(e){for(var t=e&&e.parenthesis?e.parenthesis:"keep",n=uo(this,t,e&&e.implicit),i=this.params.map(function(r,i){var a=uo(r,t,e&&e.implicit);return"all"===t||null!==a&&a<=n?'<span class="math-parenthesis math-round-parenthesis">(</span>'+r.toHTML(e)+'<span class="math-parenthesis math-round-parenthesis">)</span>':r.toHTML(e)}),a=i[0],o=0;o<this.conditionals.length;o++)a+='<span class="math-operator math-binary-operator math-explicit-binary-operator">'+fn(r[this.conditionals[o]])+"</span>"+i[o+1];return a}_toTex(e){for(var t=e&&e.parenthesis?e.parenthesis:"keep",r=uo(this,t,e&&e.implicit),n=this.params.map(function(n,i){var a=uo(n,t,e&&e.implicit);return"all"===t||null!==a&&a<=r?"\\left("+n.toTex(e)+"\right)":n.toTex(e)}),i=n[0],a=0;a<this.conditionals.length;a++)i+=bo[this.conditionals[a]]+n[a+1];return i}}return Ta(n,"name",$o),n},{isClass:!0,isNode:!0}),Go=be("SymbolNode",["math","?Unit","Node"],e=>{var{math:t,Unit:r,Node:n}=e;function i(e){return!!r&&r.isValuelessUnit(e)}class o extends n{constructor(e){if(super(),"string"!=typeof e)throw new TypeError('String expected for parameter "name"');this.name=e}get type(){return"SymbolNode"}get isSymbolNode(){return!0}_compile(e,t){var n=this.name;if(!0===t[n])return function(e,t,r){return a(t,n)};if(n in e)return function(t,r,i){return t.has(n)?t.get(n):a(e,n)};var s=i(n);return function(e,t,i){return e.has(n)?e.get(n):s?new r(null,n):o.onUndefinedSymbol(n)}}forEach(e){}map(e){return this.clone()}static onUndefinedSymbol(e){throw new Error("Undefined symbol "+e)}clone(){return new o(this.name)}_toString(e){return this.name}_toHTML(e){var t=fn(this.name);return"true"===t||"false"===t?'<span class="math-symbol math-boolean">'+t+"</span>":"i"===t?'<span class="math-symbol math-imaginary-symbol">'+t+"</span>":"Infinity"===t?'<span class="math-symbol math-infinity-symbol">'+t+"</span>":"NaN"===t?'<span class="math-symbol math-nan-symbol">'+t+"</span>":"null"===t?'<span class="math-symbol math-null-symbol">'+t+"</span>":"undefined"===t?'<span class="math-symbol math-undefined-symbol">'+t+"</span>":'<span class="math-symbol">'+t+"</span>"}toJSON(){return{mathjs:"SymbolNode",name:this.name}}static fromJSON(e){return new o(e.name)}_toTex(e){var r=!1;void 0===t[this.name]&&i(this.name)&&(r=!0);var n=Fo(this.name,r);return"\\"===n[0]?n:" "+n}}return o},{isClass:!0,isNode:!0}),Wo="FunctionNode",Vo=be(Wo,["math","Node","SymbolNode"],e=>{var t,{math:r,Node:n,SymbolNode:i}
1=e,o=e=>sn(e,{truncate:78});function s(e,t,r){for(var n,i="",a=/\$(?:\{([a-z_][a-z_0-9]*)(?:\[([0-9]+)\])?\}|\$)/gi,o=0;null!==(n=a.exec(e));)if(i+=e.substring(o,n.index),o=n.index,"$$"===n[0])i+="$",o++;else{o+=n[0].length;var s=t[n[1]];if(!s)throw new ReferenceError("Template: Property "+n[1]+" does not exist.");if(void 0===n[2])switch(typeof s){case"string":i+=s;break;case"object":if(X(s))i+=s.toTex(r);else{if(!Array.isArray(s))throw new TypeError("Template: "+n[1]+" has to be a Node, String or array of Nodes");i+=s.map(function(e,t){if(X(e))return e.toTex(r);throw new TypeError("Template: "+n[1]+"["+t+"] is not a Node.")}).join(",")}break;default:throw new TypeError("Template: "+n[1]+" has to be a Node, String or array of Nodes")}else{if(!X(s[n[2]]&&s[n[2]]))throw new TypeError("Template: "+n[1]+"["+n[2]+"] is not a Node.");i+=s[n[2]].toTex(r)}}return i+=e.slice(o)}class u extends n{constructor(e,t,r){if(super(),"string"==typeof e&&(e=new i(e)),!X(e))throw new TypeError('Node expected as parameter "fn"');if(!Array.isArray(t)||!t.every(X))throw new TypeError('Array containing Nodes expected for parameter "args"');var n=typeof r;if("undefined"!==n&&"boolean"!==n)throw new TypeError("optional flag, if specified, must be boolean");this.fn=e,this.args=t||[],this.optional=!!r}get name(){return this.fn.name||""}get type(){return Wo}get isFunctionNode(){return!0}_compile(e,t){var r=this.args.map(r=>r._compile(e,t)),n=this.optional||L(this.fn)&&this.fn.optionalChaining;if(!ne(this.fn)){if(L(this.fn)&&Z(this.fn.index)&&this.fn.index.isObjectProperty()){var i=this.fn.object._compile(e,t),s=this.fn.index.getObjectProperty(),f=this.args;return function(t,a,o){var u=i(t,a,o);if(!n||null!=u&&void 0!==u[s]){var l=function(e,t){if(!c(e,t))throw new Error('No access to method "'+t+'"');return e[t]}(u,s);if(null!=l&&l.rawArgs)return l(f,e,ko(t,a));var p=r.map(e=>e(t,a,o));return l.apply(u,p)}}}var l=this.fn.toString(),p=this.fn._compile(e,t),h=this.args;return function(t,i,a){var s=p(t,i,a);if(!n||void 0!==s){if("function"!=typeof s)throw new TypeError("Expression '".concat(l,"' did not evaluate to a function; value is:")+"\n  ".concat(o(s)));if(s.rawArgs)return s(h,e,ko(t,i));var u=r.map(e=>e(t,i,a));return s.apply(s,u)}}}var d=this.fn.name;if(t[d]){var m=this.args;return function(t,i,s){var u=a(i,d);if(!n||void 0!==u){if("function"!=typeof u)throw new TypeError("Argument '".concat(d,"' was not a function; received: ").concat(o(u)));if(u.rawArgs)return u(m,e,ko(t,i));var c=r.map(e=>e(t,i,s));return u.apply(u,c)}}}var g=d in e?a(e,d):void 0,v="function"==typeof g&&!0===g.rawArgs,D=t=>{var r;if(t.has(d))r=t.get(d);else if(d in e)r=a(e,d);else{if(!n)return u.onUndefinedFunction(d);r=void 0}if("function"==typeof r||n&&void 0===r)return r;throw new TypeError("'".concat(d,"' is not a function; its value is:\n  ").concat(o(r)))};if(v){var y=this.args;return function(t,n,i){var a=D(t);return!0===a.rawArgs?a(y,e,ko(t,n)):a(...r.map(e=>e(t,n,i)))}}switch(r.length){case 0:return function(e,t,r){var i=D(e);if(!n||void 0!==i)return i()};case 1:return function(e,t,i){var a=D(e);if(!n||void 0!==a)return a((0,r[0])(e,t,i))};case 2:return function(e,t,i){var a=D(e);if(!n||void 0!==a){var o=r[0],s=r[1];return a(o(e,t,i),s(e,t,i))}};default:return function(e,t,i){var a=D(e);if(!n||void 0!==a)return a(...r.map(r=>r(e,t,i)))}}}forEach(e){e(this.fn,"fn",this);for(var t=0;t<this.args.length;t++)e(this.args[t],"args["+t+"]",this)}map(e){for(var t=this._ifNode(e(this.fn,"fn",this)),r=[],n=0;n<this.args.length;n++)r[n]=this._ifNode(e(this.args[n],"args["+n+"]",this));return new u(t,r)}clone(){return new u(this.fn,this.args.slice(0))}toString(e){var t,r=this.fn.toString(e);return e&&"object"==typeof e.handler&&pe(e.handler,r)&&(t=e.handler[r](this,e)),void 0!==t?t:super.toString(e)}_toString(e){var t=this.args.map(function(t){return t.toString(e)});return(Y(this.fn)?"("+this.fn.toString(e)+")":this.fn.toString(e))+"("+t.join(", ")+")"}toJSON(){return{mathjs:Wo,fn:this.fn,args:this.args}}_toHTML(e){var t=this.args.map(function(t){return t.toHTML(e)});return'<span class="math-function">'+fn(this.fn)+'</span><span class="math-paranthesis math-round-parenthesis">(</span>'+t.join('<span class="math-separator">,</span>')+'<span class="math-paranthesis math-round-parenthesis">)</span>'}toTex(e){var t;return e&&"object"==typeof e.handler&&pe(e.handler,this.name)&&(t=e.handler[this.name](this,e)),void 0!==t?t:super.toTex(e)}_toTex(e){var t,n,i=this.args.map(function(t){return t.toTex(e)});switch(xo[this.name]&&(t=xo[this.name]),!r[this.name]||"function"!=typeof r[this.name].toTex&&"object"!=typeof r[this.name].toTex&&"string"!=typeof r[this.name].toTex||(t=r[this.name].toTex),typeof t){case"function":n=t(this,e);break;case"string":n=s(t,this,e);break;case"object":switch(typeof t[i.length]){case"function":n=t[i.length](this,e);break;case"string":n=s(t[i.length],this,e)}}return void 0!==n?n:s("\\mathrm{${name}}\\left(${args}\\right)",this,e)}getIdentifier(){return this.type+":"+this.name}}return t=u,Ta(u,"name",Wo),Ta(u,"onUndefinedFunction",function(e){throw new Error("Undefined function "+e)}),Ta(u,"fromJSON",function(e){return new t(e.fn,e.args)}),u},{isClass:!0,isNode:!0}),Yo="parse",Jo=be(Yo,["typed","numeric","config","AccessorNode","ArrayNode","AssignmentNode","BlockNode","ConditionalNode","ConstantNode","FunctionAssignmentNode","FunctionNode","IndexNode","ObjectNode","OperatorNode","ParenthesisNode","RangeNode","RelationalNode","SymbolNode"],e=>
1{var{typed:t,numeric:r,config:i,AccessorNode:a,ArrayNode:o,AssignmentNode:s,BlockNode:u,ConditionalNode:c,ConstantNode:f,FunctionAssignmentNode:l,FunctionNode:p,IndexNode:h,ObjectNode:d,OperatorNode:m,ParenthesisNode:g,RangeNode:v,RelationalNode:D,SymbolNode:y}=e,E=t(Yo,{string:function(e){return j(e,{})},"Array | Matrix":function(e){return w(e,{})},"string, Object":function(e,t){return j(e,void 0!==t.nodes?t.nodes:{})},"Array | Matrix, Object":w});function w(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=void 0!==t.nodes?t.nodes:{};return $n(e,function(e){if("string"!=typeof e)throw new TypeError("String expected");return j(e,r)})}var b={NULL:0,DELIMITER:1,NUMBER:2,SYMBOL:3,UNKNOWN:4},x={",":!0,"(":!0,")":!0,"[":!0,"]":!0,"{":!0,"}":!0,'"':!0,"'":!0,";":!0,"+":!0,"-":!0,"*":!0,".*":!0,"/":!0,"./":!0,"%":!0,"^":!0,".^":!0,"~":!0,"!":!0,"&":!0,"|":!0,"^|":!0,"=":!0,":":!0,"?":!0,"?.":!0,"??":!0,"==":!0,"!=":!0,"<":!0,">":!0,"<=":!0,">=":!0,"<<":!0,">>":!0,">>>":!0},N={mod:!0,to:!0,in:!0,and:!0,xor:!0,or:!0,not:!0},A={true:!0,false:!1,null:null,undefined:void 0},F=["NaN","Infinity"],C={'"':'"',"'":"'","\\":"\\","/":"/",b:"\b",f:"\f",n:"\n",r:"\r",t:"\t"};function S(e,t){return e.expression.substr(e.index,t)}function T(e){return S(e,1)}function _(e){e.index++}function M(e){return e.expression.charAt(e.index-1)}function B(e){return e.expression.charAt(e.index+1)}function O(e){for(e.tokenType=b.NULL,e.token="",e.comment="";;){if("#"===T(e))for(;"\n"!==T(e)&&""!==T(e);)e.comment+=T(e),_(e);if(!E.isWhitespace(T(e),e.nestingLevel))break;_(e)}if(""!==T(e)){if("\n"===T(e)&&!e.nestingLevel)return e.tokenType=b.DELIMITER,e.token=T(e),void _(e);var t=T(e),r=S(e,2),n=S(e,3);if(3===n.length&&x[n])return e.tokenType=b.DELIMITER,e.token=n,_(e),_(e),void _(e);if(2===r.length&&x[r]&&("?."!==r||!E.isDigit(e.expression.charAt(e.index+2))))return e.tokenType=b.DELIMITER,e.token=r,_(e),void _(e);if(x[t])return e.tokenType=b.DELIMITER,e.token=t,void _(e);if(E.isDigitDot(t)){e.tokenType=b.NUMBER;var i=S(e,2);if("0b"===i||"0o"===i||"0x"===i){for(e.token+=T(e),_(e),e.token+=T(e),_(e);E.isAlpha(T(e),M(e),B(e))||E.isDigit(T(e));)e.token+=T(e),_(e);if("."===T(e))for(e.token+=".",_(e);E.isAlpha(T(e),M(e),B(e))||E.isDigit(T(e));)e.token+=T(e),_(e);else if("i"===T(e))for(e.token+="i",_(e);E.isDigit(T(e));)e.token+=T(e),_(e);return}if("."===T(e)){if(e.token+=T(e),_(e),!E.isDigit(T(e)))return void(e.tokenType=b.DELIMITER)}else{for(;E.isDigit(T(e));)e.token+=T(e),_(e);E.isDecimalMark(T(e),B(e))&&(e.token+=T(e),_(e))}for(;E.isDigit(T(e));)e.token+=T(e),_(e);if("E"===T(e)||"e"===T(e))if(E.isDigit(B(e))||"-"===B(e)||"+"===B(e)){if(e.token+=T(e),_(e),"+"!==T(e)&&"-"!==T(e)||(e.token+=T(e),_(e)),!E.isDigit(T(e)))throw le(e,'Digit expected, got "'+T(e)+'"');for(;E.isDigit(T(e));)e.token+=T(e),_(e);if(E.isDecimalMark(T(e),B(e)))throw le(e,'Digit expected, got "'+T(e)+'"')}else if(E.isDecimalMark(B(e),e.expression.charAt(e.index+2)))throw _(e),le(e,'Digit expected, got "'+T(e)+'"')}else{if(!E.isAlpha(T(e),M(e),B(e))){for(e.tokenType=b.UNKNOWN;""!==T(e);)e.token+=T(e),_(e);throw le(e,'Syntax error in part "'+e.token+'"')}for(;E.isAlpha(T(e),M(e),B(e))||E.isDigit(T(e));)e.token+=T(e),_(e);pe(N,e.token)?e.tokenType=b.DELIMITER:e.tokenType=b.SYMBOL}}else e.tokenType=b.DELIMITER}function I(e){do{O(e)}while("\n"===e.token)}function k(e){e.nestingLevel++}function R(e){e.nestingLevel--}function j(e,t){var r={extraNodes:{},expression:"",comment:"",index:0,token:"",tokenType:b.NULL,nestingLevel:0,conditionalLevel:null};n(r,{expression:e,extraNodes:t}),O(r);var i=function(e){var t,r,n=[];""!==e.token&&"\n"!==e.token&&";"!==e.token&&(t=z(e),e.comment&&(t.comment=e.comment));for(;"\n"===e.token||";"===e.token;)0===n.length&&t&&(r=";"!==e.token,n.push({node:t,visible:r})),O(e),"\n"!==e.token&&";"!==e.token&&""!==e.token&&(t=z(e),e.comment&&(t.comment=e.comment),r=";"!==e.token,n.push({node:t,visible:r}));return n.length>0?new u(n):(t||(t=new f(void 0),e.comment&&(t.comment=e.comment)),t)}(r);if(""!==r.token)throw r.tokenType===b.DELIMITER?he(r,"Unexpected operator "+r.token):le(r,'Unexpected part "'+r.token+'"');return i}function z(e){var t,r,n,i,a=function(e){var t=function(e){var t=U(e);for(;"or"===e.token;)I(e),t=new m("or","or",[t,U(e)]);return t}(e);for(;"?"===e.token;){var r=e.conditionalLevel;e.conditionalLevel=e.nestingLevel,I(e);var n=t,i=z(e);if(":"!==e.token)throw le(e,"False part of conditional expression expected");e.conditionalLevel=null,I(e);var a=z(e);t=new c(n,i,a),e.conditionalLevel=r}return t}(e);if("="===e.token){if(ne(a))return t=a.name,I(e),n=z(e),new s(new y(t),n);if(L(a)){if(a.optionalChaining)throw le(e,"Cannot assign to optional chain");return I(e),n=z(e),new s(a.object,a.index,n)}
1if(J(a)&&ne(a.fn)&&(i=!0,r=[],t=a.name,a.args.forEach(function(e,t){ne(e)?r[t]=e.name:i=!1}),i))return I(e),n=z(e),new l(t,r,n);throw le(e,"Invalid left hand side of assignment operator =")}return a}function U(e){for(var t=P(e);"xor"===e.token;)I(e),t=new m("xor","xor",[t,P(e)]);return t}function P(e){for(var t=q(e);"and"===e.token;)I(e),t=new m("and","and",[t,q(e)]);return t}function q(e){for(var t=$(e);"|"===e.token;)I(e),t=new m("|","bitOr",[t,$(e)]);return t}function $(e){for(var t=H(e);"^|"===e.token;)I(e),t=new m("^|","bitXor",[t,H(e)]);return t}function H(e){for(var t=G(e);"&"===e.token;)I(e),t=new m("&","bitAnd",[t,G(e)]);return t}function G(e){for(var t=[Y(e)],r=[],n={"==":"equal","!=":"unequal","<":"smaller",">":"larger","<=":"smallerEq",">=":"largerEq"};pe(n,e.token);){var i={name:e.token,fn:n[e.token]};r.push(i),I(e),t.push(Y(e))}return 1===t.length?t[0]:2===t.length?new m(r[0].name,r[0].fn,t):new D(r.map(e=>e.fn),t)}function Y(e){var t,r,n,i;t=Z(e);for(var a={"<<":"leftShift",">>":"rightArithShift",">>>":"rightLogShift"};pe(a,e.token);)n=a[r=e.token],I(e),i=[t,Z(e)],t=new m(r,n,i);return t}function Z(e){var t,r,n,i;t=X(e);for(var a={to:"to",in:"to"};pe(a,e.token);)n=a[r=e.token],I(e),"in"===r&&"])},;".includes(e.token)?t=new m("*","multiply",[t,new y("in")],!0):(i=[t,X(e)],t=new m(r,n,i));return t}function X(e){var t,r=[];if(":"===e.token){if(e.conditionalLevel===e.nestingLevel)throw le(e,"The true-expression of a conditional operator may not be empty");t=new f(1)}else t=K(e);if(":"===e.token&&e.conditionalLevel!==e.nestingLevel){for(r.push(t);":"===e.token&&r.length<3;)I(e),")"===e.token||"]"===e.token||","===e.token||""===e.token?r.push(new y("end")):r.push(K(e));t=3===r.length?new v(r[0],r[2],r[1]):new v(r[0],r[1])}return t}function K(e){var t,r,n,i;t=ee(e);for(var a={"+":"add","-":"subtract"};pe(a,e.token);){n=a[r=e.token],I(e);var o=ee(e);i=o.isPercentage?[t,new m("*","multiply",[t,o])]:[t,o],t=new m(r,n,i)}return t}function ee(e){var t,r,n,i;r=t=te(e);for(var a={"*":"multiply",".*":"dotMultiply","/":"divide","./":"dotDivide","%":"mod",mod:"mod"};pe(a,e.token);)i=a[n=e.token],I(e),r=te(e),t=new m(n,i,[t,r]);return t}function te(e){var t,r;for(r=t=re(e);e.tokenType===b.SYMBOL||"in"===e.token&&W(t)||"in"===e.token&&Q(t)&&"unaryMinus"===t.fn&&W(t.args[0])||!(e.tokenType!==b.NUMBER||W(r)||Q(r)&&"!"!==r.op)||"("===e.token;)r=re(e),t=new m("*","multiply",[t,r],!0);return t}function re(e){for(var t=ie(e),r=t,i=[];"/"===e.token&&V(r);){if(i.push(n({},e)),I(e),e.tokenType!==b.NUMBER){n(e,i.pop());break}if(i.push(n({},e)),I(e),e.tokenType!==b.SYMBOL&&"("!==e.token&&"in"!==e.token){i.pop(),n(e,i.pop());break}n(e,i.pop()),i.pop(),r=ie(e),t=new m("/","divide",[t,r])}return t}function ie(e){var t=ae(e);if("%"===e.token){var r=n({},e);I(e);try{ae(e),n(e,r)}catch(i){t=new m("/","divide",[t,new f(100)],!1,!0)}}return t}function ae(e){var t,r,n,i={"-":"unaryMinus","+":"unaryPlus","~":"bitNot",not:"not"};return pe(i,e.token)?(n=i[e.token],t=e.token,I(e),r=[ae(e)],new m(t,n,r)):function(e){var t,r,n,i;t=function(e){var t=oe(e);for(;"??"===e.token;)I(e),t=new m("??","nullish",[t,oe(e)]);return t}(e),("^"===e.token||".^"===e.token)&&(n="^"===(r=e.token)?"pow":"dotPow",I(e),i=[t,ae(e)],t=new m(r,n,i));return t}(e)}function oe(e){var t,n,a;t=function(e){var t=[];if(e.tokenType===b.SYMBOL&&pe(e.extraNodes,e.token)){var n=e.extraNodes[e.token];if(O(e),"("===e.token){if(t=[],k(e),O(e),")"!==e.token)for(t.push(z(e));","===e.token;)O(e),t.push(z(e));if(")"!==e.token)throw le(e,"Parenthesis ) expected");R(e),O(e)}return new n(t)}return function(e){var t;if(e.tokenType===b.SYMBOL||e.tokenType===b.DELIMITER&&e.token in N)return t=e.token,O(e),se(e,pe(A,t)?new f(A[t]):F.includes(t)?new f(r(t,"number")):new y(t));return function(e){var t;if('"'===e.token||"'"===e.token)return t=ue(e,e.token),se(e,new f(t));return function(e){var t,n,a,s;if("["===e.token){if(k(e),O(e),"]"!==e.token){var u=ce(e);if(";"===e.token){for(a=1,n=[u];";"===e.token;)O(e),"]"!==e.token&&(n[a]=ce(e),a++);if("]"!==e.token)throw le(e,"End of matrix ] expected");R(e),O(e),s=n[0].items.length;for(var c=1;c<a;c++)if(n[c].items.length!==s)throw he(e,"Column dimensions mismatch ("+n[c].items.length+" !== "+s+")");t=new o(n)}else{if("]"!==e.token)throw le(e,"End of matrix ] expected");R(e),O(e),t=u}}else R(e),O(e),t=new o([]);return se(e,t)}return function(e){if("{"===e.token){var t;k(e);var n={};do{if(O(e),"}"!==e.token){if('"'===e.token||"'"===e.token)t=ue(e,e.token);else{if(!(e.tokenType===b.SYMBOL||e.tokenType===b.DELIMITER&&e.token in N))throw le(e,"Symbol or string expected as object key");t=e.token,O(e)}if(":"!==e.token)throw le(e,"Colon : expected after object key");O(e),n[t]=z(e)}}while(","===e.token);if("}"!==e.token)throw le(e,"Comma , or bracket } expected after object value");R(e),O(e);var a=new d(n);return a=se(e,a)}return function(e){var t;if(e.tokenType===b.NUMBER){t=e.token,O(e);var n=function(e,t){if("bigint"===t.number)try{BigInt(e)}catch(r){return t.numberFallback}return t.number}(t,i),a=r(t,n);return new f(a)}return function(e){var t;if("("===e.token){if(k(e),O(e),t=z(e),")"!==e.token)throw le(e,"Parenthesis ) expected");return R(e),O(e),t=se(e,t=new g(t))}return function(e){throw""===e.token?le(e,"Unexpected end of expression"):le(e,"Value expected")}(e)}(e)}(e)}(e)}(e)}(e)}(e)}(e);for(var s={"!":"factorial","'":"ctranspose"};pe(s,e.token);)a=s[n=e.token],O(e),t=se(e,t=new m(n,a,[t]));return t}function se(e,t,r){for(var n;;){var i=!1;"?."===e.token&&(i=!0,O(e));var o=("("===e.token||"["===e.token||"."===e.token)&&!0;if(!i&&!o)break;if(n=[],"("===e.token){if(!(i||ne(t)||L(t)))return t;if(k(e),O(e),")"!==e.token)for(n.push(z(e));","===e.token;)O(e),n.push(z(e));if(")"!==e.token)throw le(e,"Parenthesis ) expected");R(e),O(e),t=new p(t,n,i)}else if("["===e.token){if(k(e),O(e),"]"!==e.token)for(n.push(z(e));","===e.token;)O(e),n.push(z(e));if("]"!==e.token)throw le(e,"Parenthesis ] expected");R(e),O(e),t=new a(t,new h(n),i)}else{if(i||O(e),!(e.tokenType===b.SYMBOL||e.tokenType===b.DELIMITER&&e.token in N)){var s="Property name expected after ";throw le(e,s+=i?"optional chain":"dot")}n.push(new f(e.token)),O(e);t=new a(t,new h(n,!0),i)}}return t}function ue(e,t){for(var r="";""!==T(e)&&T(e)!==t;)if("\\"===T(e)){_(e);var n=T(e),i=C[n];if(void 0!==i)r+=i,e.index+=1;else{if("u"!==n)throw le(e,"Bad escape character \\".concat(n));var a=e.expression.slice(e.index+1,e.index+5);if(!/^[0-9A-Fa-f]{4}$/.test(a))throw le(e,"Invalid unicode character \\u".concat(a));r+=String.fromCharCode(parseInt(a,16)),e.index+=5}}else r+=T(e),_(e);if(O(e),e.token!==t)throw le(e,"End of string ".concat(t," expected"));return O(e),r}function ce(e){for(var t=[z(e)],r=1;","===e.token;)O(e),"]"!==e.token&&";"!==e.token&&(t[r]=z(e),r++);return new o(t)}function fe(e){return e.index-e.token.length+1}function le(e,t){var r=fe(e),n=new SyntaxError(t+" (char "+r+")");return n.char=r,n}function he(e,t){var r=fe(e),n=new SyntaxError(t+" (char "+r+")");return n.char=r,n}return E.isAlpha=function(e,t,r){return E.isValidLatinOrGreek(e)||E.isValidMathSymbol(e,r)||E.isValidMathSymbol(t,e)},E.isValidLatinOrGreek=function(e){return/^[a-zA-Z_$\u00C0-\u02AF\u0370-\u03FF\u2100-\u214F]$/.test(e)},E.isValidMathSymbol=function(e,t){return/^[\uD835]$/.test(e)&&/^[\uDC00-\uDFFF]$/.test(t)&&/^[^\uDC55\uDC9D\uDCA0\uDCA1\uDCA3\uDCA4\uDCA7\uDCA8\uDCAD\uDCBA\uDCBC\uDCC4\uDD06\uDD0B\uDD0C\uDD15\uDD1D\uDD3A\uDD3F\uDD45\uDD47-\uDD49\uDD51\uDEA6\uDEA7\uDFCC\uDFCD]$/.test(t)},E.isWhitespace=function(e,t){return" "===e||"\t"===e||" "===e||"\n"===e&&t>0},E.isDecimalMark=function(e,t){return"."===e&&"/"!==t&&"*"!==t&&"^"!==t},E.isDigitDot=function(e){return e>="0"&&e<="9"||"."===e},E.isDigit=function(e){return e>="0"&&e<="9"},t.addConversion({from:"string",to:"Node",convert:E}),E}),Zo="evaluate",Xo=be(Zo,["typed","parse"],e=>{var{typed:t,parse:r}=e;return t(Zo,{string:function(e){var t=d();
1return r(e).compile().evaluate(t)},"string, Map | Object":function(e,t){return r(e).compile().evaluate(t)},"Array | Matrix":function(e){var t=d();return $n(e,function(e){return r(e).compile().evaluate(t)})},"Array | Matrix, Map | Object":function(e,t){return $n(e,function(e){return r(e).compile().evaluate(t)})}})}),Ko={createBigNumberClass:Nr},Qo={createComplexClass:Or},es={createMatrixClass:en},ts={MatrixDependencies:es,createDenseMatrixClass:qn},rs={createFractionClass:Qr},ns={BigNumberDependencies:Ko,ComplexDependencies:Qo,DenseMatrixDependencies:ts,FractionDependencies:rs,createTyped:ze},is={typedDependencies:ns,createAbs:Ni},as={createNode:Qa},os={typedDependencies:ns,createEqualScalar:mi},ss={MatrixDependencies:es,equalScalarDependencies:os,typedDependencies:ns,createSparseMatrixClass:gi},us={typedDependencies:ns,createAddScalar:Fi},cs={DenseMatrixDependencies:ts,MatrixDependencies:es,SparseMatrixDependencies:ss,typedDependencies:ns,createMatrix:wi},fs={DenseMatrixDependencies:ts,SparseMatrixDependencies:ss,equalScalarDependencies:os,matrixDependencies:cs,typedDependencies:ns,createEqual:La},ls={isIntegerDependencies:{equalDependencies:fs,typedDependencies:ns,createIsInteger:Wn},matrixDependencies:cs,typedDependencies:ns,createConcat:pa},ps={BigNumberDependencies:Ko,matrixDependencies:cs,typedDependencies:ns,createZeros:Fa},hs={addDependencies:{DenseMatrixDependencies:ts,SparseMatrixDependencies:ss,addScalarDependencies:us,concatDependencies:ls,equalScalarDependencies:os,matrixDependencies:cs,typedDependencies:ns,createAdd:Za},matrixDependencies:cs,typedDependencies:ns,zerosDependencies:ps,createSubset:Ea},ds={typedDependencies:ns,createNot:ca},ms={concatDependencies:ls,equalScalarDependencies:os,matrixDependencies:cs,notDependencies:ds,typedDependencies:ns,zerosDependencies:ps,createAnd:Ua},gs={FractionDependencies:rs,typedDependencies:ns,createFraction:yi},vs={typedDependencies:ns,createNumber:vi},Ds={bignumberDependencies:{BigNumberDependencies:Ko,typedDependencies:ns,createBignumber:Di},fractionDependencies:gs,numberDependencies:vs,createNumeric:Ba},ys={numericDependencies:Ds,typedDependencies:ns,createDivideScalar:Ia},Es={BigNumberDependencies:Ko,DenseMatrixDependencies:ts,equalScalarDependencies:os,matrixDependencies:cs,typedDependencies:ns,zerosDependencies:ps,createRound:za},ws={typedDependencies:ns,createMultiplyScalar:na},bs={BigNumberDependencies:Ko,DenseMatrixDependencies:ts,SparseMatrixDependencies:ss,matrixDependencies:cs,typedDependencies:ns,createIdentity:da},xs={typedDependencies:ns,createSize:Da},Ns={addScalarDependencies:us,dotDependencies:{addScalarDependencies:us,conjDependencies:{typedDependencies:ns,createConj:ua},multiplyScalarDependencies:ws,sizeDependencies:xs,typedDependencies:ns,createDot:Xa},equalScalarDependencies:os,matrixDependencies:cs,multiplyScalarDependencies:ws,typedDependencies:ns,createMultiply:aa},As={typedDependencies:ns,createSubtractScalar:Si},Fs={typedDependencies:ns,createUnaryMinus:xi},Cs={UnitDependencies:{BigNumberDependencies:Ko,ComplexDependencies:Qo,FractionDependencies:rs,absDependencies:is,addScalarDependencies:us,divideScalarDependencies:ys,equalDependencies:fs,fixDependencies:{ComplexDependencies:Qo,DenseMatrixDependencies:ts,ceilDependencies:{DenseMatrixDependencies:ts,equalScalarDependencies:os,matrixDependencies:cs,roundDependencies:Es,typedDependencies:ns,zerosDependencies:ps,createCeil:Ri},equalScalarDependencies:os,floorDependencies:{DenseMatrixDependencies:ts,equalScalarDependencies:os,matrixDependencies:cs,roundDependencies:Es,typedDependencies:ns,zerosDependencies:ps,createFloor:Gi},matrixDependencies:cs,typedDependencies:ns,zerosDependencies:ps,createFix:Pi},formatDependencies:{typedDependencies:ns,createFormat:Ma},isNumericDependencies:{typedDependencies:ns,createIsNumeric:ui},multiplyScalarDependencies:ws,numberDependencies:vs,powDependencies:{ComplexDependencies:Qo,fractionDependencies:gs,identityDependencies:bs,invDepen
vendor: 4,141 bytes, line 1
1dencies:{absDependencies:is,addScalarDependencies:us,detDependencies:{divideScalarDependencies:ys,isZeroDependencies:{equalScalarDependencies:os,typedDependencies:ns,createIsZero:fi},matrixDependencies:cs,multiplyDependencies:Ns,subtractScalarDependencies:As,typedDependencies:ns,unaryMinusDependencies:Fs,createDet:be("det",["typed","matrix","subtractScalar","multiply","divideScalar","isZero","unaryMinus"],e=>{var{typed:t,matrix:r,subtractScalar:n,multiply:i,divideScalar:a,isZero:o,unaryMinus:s}=e;return t("det",{any:function(e){return oe(e)},"Array | Matrix":function(e){var t;switch((t=x(e)?e.size():Array.isArray(e)?(e=r(e)).size():[]).length){case 0:return oe(e);case 1:if(1===t[0])return oe(e.valueOf()[0]);if(0===t[0])return 1;throw new RangeError("Matrix must be square (size: "+sn(t)+")");case 2:var u=t[0],c=t[1];if(u===c)return function(e,t){if(1===t)return oe(e[0][0]);if(2===t)return n(i(e[0][0],e[1][1]),i(e[1][0],e[0][1]));for(var r=!1,u=new Array(t).fill(0).map((e,t)=>t),c=0;c<t;c++){var f=u[c];if(o(e[f][c])){var l=void 0;for(l=c+1;l<t;l++)if(!o(e[u[l]][c])){f=u[l],u[l]=u[c],u[c]=f,r=!r;break}if(l===t)return e[f][c]}for(var p=e[f][c],h=0===c?1:e[u[c-1]][c-1],d=c+1;d<t;d++)for(var m=u[d],g=c+1;g<t;g++)e[m][g]=a(n(i(e[m][g],p),i(e[m][c],e[f][g])),h)}var v=e[u[t-1]][t-1];return r?s(v):v}(e.clone().valueOf(),u);if(0===c)return 1;throw new RangeError("Matrix must be square (size: "+sn(t)+")");default:throw new RangeError("Matrix must be two dimensional (size: "+sn(t)+")")}}})})},divideScalarDependencies:ys,identityDependencies:bs,matrixDependencies:cs,multiplyDependencies:Ns,typedDependencies:ns,unaryMinusDependencies:Fs,createInv:be("inv",["typed","matrix","divideScalar","addScalar","multiply","unaryMinus","det","identity","abs"],e=>{var{typed:t,matrix:r,divideScalar:n,addScalar:i,multiply:a,unaryMinus:o,det:s,identity:u,abs:c}=e;return t("inv",{"Array | Matrix":function(e){var t=x(e)?e.size():dn(e);switch(t.length){case 1:if(1===t[0])return x(e)?r([n(1,e.valueOf()[0])]):[n(1,e[0])];throw new RangeError("Matrix must be square (size: "+sn(t)+")");case 2:var i=t[0],a=t[1];if(i===a)return x(e)?r(f(e.valueOf(),i,a),e.storage()):f(e,i,a);throw new RangeError("Matrix must be square (size: "+sn(t)+")");default:throw new RangeError("Matrix must be two dimensional (size: "+sn(t)+")")}},any:function(e){return n(1,e)}});function f(e,t,r){var f,l,p,h,d;if(1===t){if(0===(h=e[0][0]))throw Error("Cannot calculate inverse, determinant is zero");return[[n(1,h)]]}if(2===t){var m=s(e);if(0===m)throw Error("Cannot calculate inverse, determinant is zero");return[[n(e[1][1],m),n(o(e[0][1]),m)],[n(o(e[1][0]),m),n(e[0][0],m)]]}var g=e.concat();for(f=0;f<t;f++)g[f]=g[f].concat();for(var v=u(t).valueOf(),D=0;D<r;D++){var y=c(g[D][D]),E=D;for(f=D+1;f<t;)c(g[f][D])>y&&(y=c(g[f][D]),E=f),f++;if(0===y)throw Error("Cannot calculate inverse, determinant is zero");(f=E)!==D&&(d=g[D],g[D]=g[f],g[f]=d,d=v[D],v[D]=v[f],v[f]=d);var w=g[D],b=v[D];for(f=0;f<t;f++){var x=g[f],N=v[f];if(f!==D){if(0!==x[D]){for(p=n(o(x[D]),w[D]),l=D;l<r;l++)x[l]=i(x[l],a(p,w[l]));for(l=0;l<r;l++)N[l]=i(N[l],a(p,b[l]))}}else{for(p=w[D],l=D;l<r;l++)x[l]=n(x[l],p);for(l=0;l<r;l++)N[l]=n(N[l],p)}}}return v}})},matrixDependencies:cs,multiplyDependencies:Ns,numberDependencies:vs,typedDependencies:ns,createPow:ka},roundDependencies:Es,subtractScalarDependencies:As,createUnitClass:Ja},NodeDependencies:as,createSymbolNode:Go},Ss={parseDependencies:{AccessorNodeDependencies:{NodeDependencies:as,subsetDependencies:hs,createAccessorNode:no},ArrayNodeDependencies:{NodeDependencies:as,createArrayNode:ao},AssignmentNodeDependencies:{matrixDependencies:cs,NodeDependencies:as,subsetDependencies:hs,createAssignmentNode:mo},BlockNodeDependencies:{NodeDependencies:as,ResultSetDependencies:{createResultSet:He},createBlockNode:vo},ConditionalNodeDependencies:{NodeDependencies:as,createConditionalNode:yo},ConstantNodeDependencies:{NodeDependencies:as,isBoundedDependencies:{typedDependencies:ns,createIsBounded:pi},createConstantNode:So},FunctionAssignmentNodeDependencies:{NodeDependencies:as,typedDependencies:ns,createFunctionAssignmentNode:_o}
1,FunctionNodeDependencies:{NodeDependencies:as,SymbolNodeDependencies:Cs,createFunctionNode:Vo},IndexNodeDependencies:{NodeDependencies:as,sizeDependencies:xs,createIndexNode:Bo},ObjectNodeDependencies:{NodeDependencies:as,createObjectNode:Io},OperatorNodeDependencies:{NodeDependencies:as,createOperatorNode:zo},ParenthesisNodeDependencies:{NodeDependencies:as,createParenthesisNode:Po},RangeNodeDependencies:{NodeDependencies:as,createRangeNode:qo},RelationalNodeDependencies:{NodeDependencies:as,createRelationalNode:Ho},SymbolNodeDependencies:Cs,numericDependencies:Ds,typedDependencies:ns,createParse:Jo},typedDependencies:ns,createEvaluate:Xo},Ts={DenseMatrixDependencies:ts,concatDependencies:ls,equalScalarDependencies:os,matrixDependencies:cs,typedDependencies:ns,createOr:fa},_s={exports:{}};const Ms=t(function(){if(Ro)return _s.exports;function e(){}return Ro=1,e.prototype={on:function(e,t,r){var n=this.e||(this.e={});return(n[e]||(n[e]=[])).push({fn:t,ctx:r}),this},once:function(e,t,r){var n=this;function i(){n.off(e,i),t.apply(r,arguments)}return i._=t,this.on(e,i,r)},emit:function(e){for(var t=[].slice.call(arguments,1),r=((this.e||(this.e={}))[e]||[]).slice(),n=0,i=r.length;n<i;n++)r[n].fn.apply(r[n].ctx,t);return this},off:function(e,t){var r=this.e||(this.e={}),n=r[e],i=[];if(n&&t)for(var a=0,o=n.length;a<o;a++)n[a].fn!==t&&n[a].fn._!==t&&i.push(n[a]);return i.length?r[e]=i:delete r[e],this}},_s.exports=e,_s.exports.TinyEmitter=e,_s.exports}());function Bs(e,t,r,n){function i(t,i,o){var s,u;if(o.wrap&&"function"==typeof i&&(i=function(e){var t=function(){for(var t=[],n=0,i=arguments.length;n<i;n++){var a=arguments[n];t[n]=a&&a.valueOf()}return e.apply(r,t)};e.transform&&(t.transform=e.transform);return t}(i)),"function"==typeof(u=i)&&"string"==typeof u.signature&&(i=e(t,{[i.signature]:i})),e.isTypedFunction(r[t])&&e.isTypedFunction(i))return i=o.override?e(t,i.signatures):e(r[t],i),r[t]=i,delete n[t],a(t,i),void r.emit("import",t,function(){return i});var c=void 0!==r[t],f=null===(s=r.Unit)||void 0===s?void 0:s.isValuelessUnit(t);if(!c&&!f||o.override)return r[t]=i,delete n[t],a(t,i),void r.emit("import",t,function(){return i});if(!o.silent)throw new Error('Cannot import "'+t+'": already exists')}function a(e,t){t&&"function"==typeof t.transform?(r.expression.transform[e]=t.transform,c(e)&&(r.expression.mathWithTransform[e]=t.transform)):(delete r.expression.transform[e],c(e)&&(r.expression.mathWithTransform[e]=t))}function o(e){delete r.expression.transform[e],c(e)?r.expression.mathWithTransform[e]=r[e]:delete r.expression.mathWithTransform[e]}function s(t,i){var a,s,u=arguments.length>2&&void 0!==arguments[2]?arguments[2]:t.fn;if(u.includes("."))throw new Error("Factory name should not contain a nested path. Name: "+JSON.stringify(u));var c=f(t)?r.expression.transform:r,p=u in r.expression.transform,h=pe(c,u)?c[u]:void 0,d=function(){var n={};t.dependencies.map(Ne).forEach(e=>{if(e.includes("."))throw new Error("Factory dependency should not contain a nested path. Name: "+JSON.stringify(e));"math"===e?n.math=r:"mathWithTransform"===e?n.mathWithTransform=r.expression.mathWithTransform:"classes"===e?n.classes=r:n[e]=r[e]});var a=t(n);if(a&&"function"==typeof a.transform)throw new Error('Transforms cannot be attached to factory functions. Please create a separate function for it with export const path = "expression.transform"');if(void 0===h||i.override)return a;
1if(e.isTypedFunction(h)&&e.isTypedFunction(a))return e(h,a);if(i.silent)return h;throw new Error('Cannot import "'+u+'": already exists')},m=null!==(a=null===(s=t.meta)||void 0===s?void 0:s.formerly)&&void 0!==a?a:"",g=f(t)||function(e){return!(e.fn.includes(".")||pe(l,e.fn)||e.meta&&e.meta.isClass)}(t),v=r.expression.mathWithTransform;t.meta&&!1===t.meta.lazy?(c[u]=d(),m&&(c[m]=c[u]),h&&p?(o(u),m&&o(m)):g&&(le(v,u,()=>c[u]),m&&le(v,m,()=>c[u]))):(le(c,u,d),m&&le(c,m,d),h&&p?(o(u),m&&o(m)):g&&(le(v,u,()=>c[u]),m&&le(v,m,()=>c[u]))),n[u]=t,r.emit("import",u,d)}function u(e){return"function"==typeof e||"number"==typeof e||"string"==typeof e||"boolean"==typeof e||null===e||E(e)||D(e)||g(e)||y(e)||x(e)||Array.isArray(e)}function c(e){return!pe(l,e)}function f(e){return void 0!==e&&void 0!==e.meta&&!0===e.meta.isTransformFunction||!1}var l={expression:!0,type:!0,docs:!0,error:!0,json:!0,chain:!0};return function(e,t){var r=arguments.length;if(1!==r&&2!==r)throw new ta("import",r,1,2);t||(t={});var n={};for(var a in function e(r,n,i){if(Array.isArray(n))n.forEach(t=>e(r,t));else if(k(n)||"object"==typeof(s=n)&&"Module"===s[Symbol.toStringTag])for(var a in n)pe(n,a)&&e(r,n[a],a);else if(xe(n)||void 0!==i){var o=xe(n)?f(n)?n.fn+".transform":n.fn:i;if(pe(r,o)&&r[o]!==n&&!t.silent)throw new Error('Cannot import "'+o+'" twice');r[o]=n}else if(!t.silent)throw new TypeError("Factory, Object, or Array expected");var s}(n,e),n)if(pe(n,a)){var o=n[a];if(xe(o))s(o,t);else if(u(o))i(a,o,t);else if(!t.silent)throw new TypeError("Factory, Object, or Array expected")}}}function Os(e,t){var r=n({},i,t);if("function"!=typeof Object.create)throw new Error("ES5 not supported by this JavaScript engine. Please load the es5-shim and es5-sham library for compatibility.");var a,o,s=(a={isNumber:m,isComplex:D,isBigNumber:g,isBigInt:v,isFraction:y,isUnit:E,isString:w,isArray:b,isMatrix:x,isCollection:N,isDenseMatrix:A,isSparseMatrix:F,isRange:C,isIndex:S,isBoolean:T,isResultSet:_,isHelp:M,isFunction:B,isDate:O,isRegExp:I,isObject:k,isMap:R,isPartitionedMap:j,isObjectWrappingMap:z,isNull:U,isUndefined:P,isAccessorNode:L,isArrayNode:q,isAssignmentNode:$,isBlockNode:H,isConditionalNode:G,isConstantNode:W,isFunctionAssignmentNode:Y,isFunctionNode:J,isIndexNode:Z,isNode:X,isObjectNode:K,isOperatorNode:Q,isParenthesisNode:ee,isRangeNode:te,isRelationalNode:re,isSymbolNode:ne,isChain:ie},o=new Ms,a.on=o.on.bind(o),a.off=o.off.bind(o),a.once=o.once.bind(o),a.emit=o.emit.bind(o),a);s.config=me(r,s.emit),s.expression={transform:{},mathWithTransform:{config:s.config}};var u={};function c(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];return s.typed.apply(s.typed,t)}c.isTypedFunction=we.isTypedFunction;var f=Bs(c,0,s,u);return s.import=f,s.on("config",()=>{Object.values(u).forEach(e=>{e&&e.meta&&e.meta.recreateOnConfigChange&&f(e,{override:!0})})}),s.create=Os.bind(null,e),s.factory=be,s.import(Object.values(ce(e))),s.ArgumentsError=ta,s.DimensionError=pn,s.IndexError=hn,s}export{ms as a,Ss as b,Os as c,r as d,fs as e,t as g,ds as n,Ts as o};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.