quanta_sim
Version:
A comprehensive quantum computing simulator library with support for quantum circuits, gates, measurements, and classical conditional operations
8 lines • 196 kB
JavaScript
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).QuantaSim={})}(this,function(t){"use strict";function e(){return e=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var n in r)({}).hasOwnProperty.call(r,n)&&(t[n]=r[n])}return t},e.apply(null,arguments)}var r={epsilon:1e-12,matrix:"Matrix",number:"number",precision:64,predictable:!1,randomSeed:null};function n(t){return"number"==typeof t}function i(t){return!(!t||"object"!=typeof t||"function"!=typeof t.constructor)&&(!0===t.isBigNumber&&"object"==typeof t.constructor.prototype&&!0===t.constructor.prototype.isBigNumber||"function"==typeof t.constructor.isDecimal&&!0===t.constructor.isDecimal(t))}function u(t){return t&&"object"==typeof t&&!0===Object.getPrototypeOf(t).isComplex||!1}function o(t){return t&&"object"==typeof t&&!0===Object.getPrototypeOf(t).isFraction||!1}function a(t){return t&&!0===t.constructor.prototype.isUnit||!1}function s(t){return"string"==typeof t}var c=Array.isArray;function f(t){return t&&!0===t.constructor.prototype.isMatrix||!1}function l(t){return Array.isArray(t)||f(t)}function h(t){return t&&t.isDenseMatrix&&!0===t.constructor.prototype.isMatrix||!1}function p(t){return t&&t.isSparseMatrix&&!0===t.constructor.prototype.isMatrix||!1}function D(t){return t&&!0===t.constructor.prototype.isRange||!1}function d(t){return t&&!0===t.constructor.prototype.isIndex||!1}function m(t){return"boolean"==typeof t}function g(t){return t&&!0===t.constructor.prototype.isResultSet||!1}function y(t){return t&&!0===t.constructor.prototype.isHelp||!1}function w(t){return"function"==typeof t}function v(t){return t instanceof Date}function C(t){return t instanceof RegExp}function F(t){return!(!t||"object"!=typeof t||t.constructor!==Object||u(t)||o(t))}function A(t){return null===t}function E(t){return void 0===t}function b(t){return t&&!0===t.isAccessorNode&&!0===t.constructor.prototype.isNode||!1}function x(t){return t&&!0===t.isArrayNode&&!0===t.constructor.prototype.isNode||!1}function M(t){return t&&!0===t.isAssignmentNode&&!0===t.constructor.prototype.isNode||!1}function _(t){return t&&!0===t.isBlockNode&&!0===t.constructor.prototype.isNode||!1}function B(t){return t&&!0===t.isConditionalNode&&!0===t.constructor.prototype.isNode||!1}function N(t){return t&&!0===t.isConstantNode&&!0===t.constructor.prototype.isNode||!1}function S(t){return t&&!0===t.isFunctionAssignmentNode&&!0===t.constructor.prototype.isNode||!1}function T(t){return t&&!0===t.isFunctionNode&&!0===t.constructor.prototype.isNode||!1}function z(t){return t&&!0===t.isIndexNode&&!0===t.constructor.prototype.isNode||!1}function O(t){return t&&!0===t.isNode&&!0===t.constructor.prototype.isNode||!1}function q(t){return t&&!0===t.isObjectNode&&!0===t.constructor.prototype.isNode||!1}function R(t){return t&&!0===t.isOperatorNode&&!0===t.constructor.prototype.isNode||!1}function I(t){return t&&!0===t.isParenthesisNode&&!0===t.constructor.prototype.isNode||!1}function P(t){return t&&!0===t.isRangeNode&&!0===t.constructor.prototype.isNode||!1}function k(t){return t&&!0===t.isRelationalNode&&!0===t.constructor.prototype.isNode||!1}function j(t){return t&&!0===t.isSymbolNode&&!0===t.constructor.prototype.isNode||!1}function U(t){return t&&!0===t.constructor.prototype.isChain||!1}function G(t){var e=typeof t;return"object"===e?null===t?"null":i(t)?"BigNumber":t.constructor&&t.constructor.name?t.constructor.name:"Object":e}function Q(t){var e=typeof t;if("number"===e||"string"===e||"boolean"===e||null==t)return t;if("function"==typeof t.clone)return t.clone();if(Array.isArray(t))return t.map(function(t){return Q(t)});if(t instanceof Date)return new Date(t.valueOf());if(i(t))return t;if(F(t))return function(t,e){var r={};for(var n in t)Z(t,n)&&(r[n]=e(t[n]));return r}(t,Q);throw new TypeError("Cannot clone: unknown type of value (value: ".concat(t,")"))}function V(t,e){for(var r in e)Z(e,r)&&(t[r]=e[r]);return t}function $(t,e){var r,n,i;if(Array.isArray(t)){if(!Array.isArray(e))return!1;if(t.length!==e.length)return!1;for(n=0,i=t.length;n<i;n++)if(!$(t[n],e[n]))return!1;return!0}if("function"==typeof t)return t===e;if(t instanceof Object){if(Array.isArray(e)||!(e instanceof Object))return!1;for(r in t)if(!(r in e)||!$(t[r],e[r]))return!1;for(r in e)if(!(r in t))return!1;return!0}return t===e}function Z(t,e){return t&&Object.hasOwnProperty.call(t,e)}var X=function(t){if(t)throw new Error("The global config is readonly. \nPlease create a mathjs instance if you want to change the default configuration. \nExample:\n\n import { create, all } from 'mathjs';\n const mathjs = create(all);\n mathjs.config({ number: 'BigNumber' });\n");return Object.freeze(r)};e(X,r,{MATRIX_OPTIONS:["Matrix","Array"],NUMBER_OPTIONS:["number","BigNumber","Fraction"]});"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;function Y(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var L={exports:{}};!function(t){t.exports=function(){function t(){return!0}function e(){return!1}function r(){}const n="Argument is not a typed-function.";function i(){function u(t){return"object"==typeof t&&null!==t&&t.constructor===Object}const o=[{name:"number",test:function(t){return"number"==typeof t}},{name:"string",test:function(t){return"string"==typeof t}},{name:"boolean",test:function(t){return"boolean"==typeof t}},{name:"Function",test:function(t){return"function"==typeof t}},{name:"Array",test:Array.isArray},{name:"Date",test:function(t){return t instanceof Date}},{name:"RegExp",test:function(t){return t instanceof RegExp}},{name:"Object",test:u},{name:"null",test:function(t){return null===t}},{name:"undefined",test:function(t){return void 0===t}}],a={name:"any",test:t,isAny:!0};let s,c,f=0,l={createCount:0};function h(t){const e=s.get(t);if(e)return e;let r='Unknown type "'+t+'"';const n=t.toLowerCase();let i;for(i of c)if(i.toLowerCase()===n){r+='. Did you mean "'+i+'" ?';break}throw new TypeError(r)}function p(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"any";const r=e?h(e).index:c.length,n=[];for(let e=0;e<t.length;++e){if(!t[e]||"string"!=typeof t[e].name||"function"!=typeof t[e].test)throw new TypeError("Object with properties {name: string, test: function} expected");const i=t[e].name;if(s.has(i))throw new TypeError('Duplicate type name "'+i+'"');n.push(i),s.set(i,{name:i,test:t[e].test,isAny:t[e].isAny,index:r+e,conversionsTo:[]})}const i=c.slice(r);c=c.slice(0,r).concat(n).concat(i);for(let t=r+n.length;t<c.length;++t)s.get(c[t]).index=t}function D(){s=new Map,c=[],f=0,p([a],!1)}function d(){let t;for(t of c)s.get(t).conversionsTo=[];f=0}function m(t){const e=c.filter(e=>{const r=s.get(e);return!r.isAny&&r.test(t)});return e.length?e:["any"]}function g(t){return t&&"function"==typeof t&&"_typedFunctionData"in t}function y(t,e,r){if(!g(t))throw new TypeError(n);const i=r&&r.exact,u=b(Array.isArray(e)?e.join(","):e),o=C(u);if(!i||o in t.signatures){const e=t._typedFunctionData.signatureMap.get(o);if(e)return e}const a=u.length;let s,c;if(i){let e;for(e in s=[],t.signatures)s.push(t._typedFunctionData.signatureMap.get(e))}else s=t._typedFunctionData.signatures;for(let t=0;t<a;++t){const e=u[t],r=[];let n;for(n of s){const i=B(n.params,t);if(i&&(!e.restParam||i.restParam)){if(!i.hasAny){const t=E(i);if(e.types.some(e=>!t.has(e.name)))continue}r.push(n)}}if(s=r,0===s.length)break}for(c of s)if(c.params.length<=a)return c;throw new TypeError("Signature not found (signature: "+(t.name||"unnamed")+"("+C(u,", ")+"))")}function w(t,e,r){return y(t,e,r).implementation}function v(t,e){const r=h(e);if(r.test(t))return t;const n=r.conversionsTo;if(0===n.length)throw new Error("There are no conversions to "+e+" defined.");for(let e=0;e<n.length;e++)if(h(n[e].from).test(t))return n[e].convert(t);throw new Error("Cannot convert "+t+" to "+e)}function C(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:",";return t.map(t=>t.name).join(e)}function F(t){const e=0===t.indexOf("..."),r=(e?t.length>3?t.slice(3):"any":t).split("|").map(t=>h(t.trim()));let n=!1,i=e?"...":"";return{types:r.map(function(t){return n=t.isAny||n,i+=t.name+"|",{name:t.name,typeIndex:t.index,test:t.test,isAny:t.isAny,conversion:null,conversionIndex:-1}}),name:i.slice(0,-1),hasAny:n,hasConversion:!1,restParam:e}}function A(t){const e=P(t.types.map(t=>t.name));let r=t.hasAny,n=t.name;const i=e.map(function(t){const e=h(t.from);return r=e.isAny||r,n+="|"+t.from,{name:t.from,typeIndex:e.index,test:e.test,isAny:e.isAny,conversion:t,conversionIndex:t.index}});return{types:t.types.concat(i),name:n,hasAny:r,hasConversion:i.length>0,restParam:t.restParam}}function E(t){return t.typeSet||(t.typeSet=new Set,t.types.forEach(e=>t.typeSet.add(e.name))),t.typeSet}function b(t){const e=[];if("string"!=typeof t)throw new TypeError("Signatures must be strings");const r=t.trim();if(""===r)return e;const n=r.split(",");for(let t=0;t<n.length;++t){const r=F(n[t].trim());if(r.restParam&&t!==n.length-1)throw new SyntaxError('Unexpected rest parameter "'+n[t]+'": only allowed for the last parameter');if(0===r.types.length)return null;e.push(r)}return e}function x(t){const e=H(t);return!!e&&e.restParam}function M(e){if(e&&0!==e.types.length){if(1===e.types.length)return h(e.types[0].name).test;if(2===e.types.length){const t=h(e.types[0].name).test,r=h(e.types[1].name).test;return function(e){return t(e)||r(e)}}{const t=e.types.map(function(t){return h(t.name).test});return function(e){for(let r=0;r<t.length;r++)if(t[r](e))return!0;return!1}}}return t}function _(t){let e,r,n;if(x(t)){e=L(t).map(M);const r=e.length,n=M(H(t)),i=function(t){for(let e=r;e<t.length;e++)if(!n(t[e]))return!1;return!0};return function(t){for(let r=0;r<e.length;r++)if(!e[r](t[r]))return!1;return i(t)&&t.length>=r+1}}return 0===t.length?function(t){return 0===t.length}:1===t.length?(r=M(t[0]),function(t){return r(t[0])&&1===t.length}):2===t.length?(r=M(t[0]),n=M(t[1]),function(t){return r(t[0])&&n(t[1])&&2===t.length}):(e=t.map(M),function(t){for(let r=0;r<e.length;r++)if(!e[r](t[r]))return!1;return t.length===e.length})}function B(t,e){return e<t.length?t[e]:x(t)?H(t):null}function N(t,e){const r=B(t,e);return r?E(r):new Set}function S(t){return null===t.conversion||void 0===t.conversion}function T(t,e){const r=new Set;return t.forEach(t=>{const n=N(t.params,e);let i;for(i of n)r.add(i)}),r.has("any")?["any"]:Array.from(r)}function z(t,e,r){let n,i;const u=t||"unnamed";let o,a=r;for(o=0;o<e.length;o++){const t=[];if(a.forEach(r=>{const n=M(B(r.params,o));(o<r.params.length||x(r.params))&&n(e[o])&&t.push(r)}),0===t.length){if(i=T(a,o),i.length>0){const t=m(e[o]);return n=new TypeError("Unexpected type of argument in function "+u+" (expected: "+i.join(" or ")+", actual: "+t.join(" | ")+", index: "+o+")"),n.data={category:"wrongType",fn:u,index:o,actual:t,expected:i},n}}else a=t}const s=a.map(function(t){return x(t.params)?1/0:t.params.length});if(e.length<Math.min.apply(null,s))return i=T(a,o),n=new TypeError("Too few arguments in function "+u+" (expected: "+i.join(" or ")+", index: "+e.length+")"),n.data={category:"tooFewArgs",fn:u,index:e.length,expected:i},n;const c=Math.max.apply(null,s);if(e.length>c)return n=new TypeError("Too many arguments in function "+u+" (expected: "+c+", actual: "+e.length+")"),n.data={category:"tooManyArgs",fn:u,index:e.length,expectedLength:c},n;const f=[];for(let t=0;t<e.length;++t)f.push(m(e[t]).join("|"));return n=new TypeError('Arguments of type "'+f.join(", ")+'" do not match any of the defined signatures of function '+u+"."),n.data={category:"mismatch",actual:f},n}function O(t){let e=c.length+1;for(let r=0;r<t.types.length;r++)S(t.types[r])&&(e=Math.min(e,t.types[r].typeIndex));return e}function q(t){let e=f+1;for(let r=0;r<t.types.length;r++)S(t.types[r])||(e=Math.min(e,t.types[r].conversionIndex));return e}function R(t,e){if(t.hasAny){if(!e.hasAny)return 1}else if(e.hasAny)return-1;if(t.restParam){if(!e.restParam)return 1}else if(e.restParam)return-1;if(t.hasConversion){if(!e.hasConversion)return 1}else if(e.hasConversion)return-1;const r=O(t)-O(e);if(r<0)return-1;if(r>0)return 1;const n=q(t)-q(e);return n<0?-1:n>0?1:0}function I(t,e){const r=t.params,n=e.params,i=H(r),u=H(n),o=x(r),a=x(n);if(o&&i.hasAny){if(!a||!u.hasAny)return 1}else if(a&&u.hasAny)return-1;let s,c=0,f=0;for(s of r)s.hasAny&&++c,s.hasConversion&&++f;let l=0,h=0;for(s of n)s.hasAny&&++l,s.hasConversion&&++h;if(c!==l)return c-l;if(o&&i.hasConversion){if(!a||!u.hasConversion)return 1}else if(a&&u.hasConversion)return-1;if(f!==h)return f-h;if(o){if(!a)return 1}else if(a)return-1;const p=(r.length-n.length)*(o?-1:1);if(0!==p)return p;const D=[];let d,m=0;for(let t=0;t<r.length;++t){const e=R(r[t],n[t]);D.push(e),m+=e}if(0!==m)return m;for(d of D)if(0!==d)return d;return 0}function P(t){if(0===t.length)return[];const e=t.map(h);t.length>1&&e.sort((t,e)=>t.index-e.index);let r=e[0].conversionsTo;if(1===t.length)return r;r=r.concat([]);const n=new Set(t);for(let t=1;t<e.length;++t){let i;for(i of e[t].conversionsTo)n.has(i.from)||(r.push(i),n.add(i.from))}return r}function k(t,e){let r=e;if(t.some(t=>t.hasConversion)){const n=x(t),i=t.map(j);r=function(){const t=[],r=n?arguments.length-1:arguments.length;for(let e=0;e<r;e++)t[e]=i[e](arguments[e]);return n&&(t[r]=arguments[r].map(i[r])),e.apply(this,t)}}let n=r;if(x(t)){const e=t.length-1;n=function(){return r.apply(this,J(arguments,0,e).concat([J(arguments,e)]))}}return n}function j(t){let e,r,n,i;const u=[],o=[];switch(t.types.forEach(function(t){t.conversion&&(u.push(h(t.conversion.from).test),o.push(t.conversion.convert))}),o.length){case 0:return function(t){return t};case 1:return e=u[0],n=o[0],function(t){return e(t)?n(t):t};case 2:return e=u[0],r=u[1],n=o[0],i=o[1],function(t){return e(t)?n(t):r(t)?i(t):t};default:return function(t){for(let e=0;e<o.length;e++)if(u[e](t))return o[e](t);return t}}}function U(t){function e(t,r,n){if(r<t.length){const i=t[r];let u=[];if(i.restParam){const t=i.types.filter(S);t.length<i.types.length&&u.push({types:t,name:"..."+t.map(t=>t.name).join("|"),hasAny:t.some(t=>t.isAny),hasConversion:!1,restParam:!0}),u.push(i)}else u=i.types.map(function(t){return{types:[t],name:t.name,hasAny:t.isAny,hasConversion:t.conversion,restParam:!1}});return K(u,function(i){return e(t,r+1,n.concat([i]))})}return[n]}return e(t,0,[])}function G(t,e){const r=Math.max(t.length,e.length);for(let n=0;n<r;n++){const r=N(t,n),i=N(e,n);let u,o=!1;for(u of i)if(r.has(u)){o=!0;break}if(!o)return!1}const n=t.length,i=e.length,u=x(t),o=x(e);return u?o?n===i:i>=n:o?n>=i:n===i}function Q(t){return t.map(t=>it(t)?rt(t.referToSelf.callback):nt(t)?et(t.referTo.references,t.referTo.callback):t)}function V(t,e,r){const n=[];let i;for(i of t){let t=r[i];if("number"!=typeof t)throw new TypeError('No definition for referenced signature "'+i+'"');if(t=e[t],"function"!=typeof t)return!1;n.push(t)}return n}function $(t,e,r){const n=Q(t),i=new Array(n.length).fill(!1);let u=!0;for(;u;){u=!1;let t=!0;for(let o=0;o<n.length;++o){if(i[o])continue;const a=n[o];if(it(a))n[o]=a.referToSelf.callback(r),n[o].referToSelf=a.referToSelf,i[o]=!0,t=!1;else if(nt(a)){const r=V(a.referTo.references,n,e);r?(n[o]=a.referTo.callback.apply(this,r),n[o].referTo=a.referTo,i[o]=!0,t=!1):u=!0}}if(t&&u)throw new SyntaxError("Circular reference detected in resolving typed.referTo")}return n}function Z(t){const e=/\bthis(\(|\.signatures\b)/;Object.keys(t).forEach(r=>{const n=t[r];if(e.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.")})}function X(t,n){if(l.createCount++,0===Object.keys(n).length)throw new SyntaxError("No signatures provided");l.warnAgainstDeprecatedThis&&Z(n);const i=[],u=[],o={},a=[];let s;for(s in n){if(!Object.prototype.hasOwnProperty.call(n,s))continue;const t=b(s);if(!t)continue;i.forEach(function(e){if(G(e,t))throw new TypeError('Conflicting signatures "'+C(e)+'" and "'+C(t)+'".')}),i.push(t);const e=u.length;u.push(n[s]);const r=t.map(A);let c;for(c of U(r)){const t=C(c);a.push({params:c,name:t,fn:e}),c.every(t=>!t.hasConversion)&&(o[t]=e)}}a.sort(I);const c=$(u,o,st);let f;for(f in o)Object.prototype.hasOwnProperty.call(o,f)&&(o[f]=c[o[f]]);const h=[],p=new Map;for(f of a)p.has(f.name)||(f.fn=c[f.fn],h.push(f),p.set(f.name,f));const D=h[0]&&h[0].params.length<=2&&!x(h[0].params),d=h[1]&&h[1].params.length<=2&&!x(h[1].params),m=h[2]&&h[2].params.length<=2&&!x(h[2].params),g=h[3]&&h[3].params.length<=2&&!x(h[3].params),y=h[4]&&h[4].params.length<=2&&!x(h[4].params),w=h[5]&&h[5].params.length<=2&&!x(h[5].params),v=D&&d&&m&&g&&y&&w;for(let t=0;t<h.length;++t)h[t].test=_(h[t].params);const F=D?M(h[0].params[0]):e,E=d?M(h[1].params[0]):e,B=m?M(h[2].params[0]):e,N=g?M(h[3].params[0]):e,S=y?M(h[4].params[0]):e,T=w?M(h[5].params[0]):e,z=D?M(h[0].params[1]):e,O=d?M(h[1].params[1]):e,q=m?M(h[2].params[1]):e,R=g?M(h[3].params[1]):e,P=y?M(h[4].params[1]):e,j=w?M(h[5].params[1]):e;for(let t=0;t<h.length;++t)h[t].implementation=k(h[t].params,h[t].fn);const Q=D?h[0].implementation:r,V=d?h[1].implementation:r,X=m?h[2].implementation:r,Y=g?h[3].implementation:r,L=y?h[4].implementation:r,H=w?h[5].implementation:r,J=D?h[0].params.length:-1,W=d?h[1].params.length:-1,K=m?h[2].params.length:-1,tt=g?h[3].params.length:-1,et=y?h[4].params.length:-1,rt=w?h[5].params.length:-1,nt=v?6:0,it=h.length,ut=h.map(t=>t.test),ot=h.map(t=>t.implementation),at=function(){for(let t=nt;t<it;t++)if(ut[t](arguments))return ot[t].apply(this,arguments);return l.onMismatch(t,arguments,h)};function st(t,e){return arguments.length===J&&F(t)&&z(e)?Q.apply(this,arguments):arguments.length===W&&E(t)&&O(e)?V.apply(this,arguments):arguments.length===K&&B(t)&&q(e)?X.apply(this,arguments):arguments.length===tt&&N(t)&&R(e)?Y.apply(this,arguments):arguments.length===et&&S(t)&&P(e)?L.apply(this,arguments):arguments.length===rt&&T(t)&&j(e)?H.apply(this,arguments):at.apply(this,arguments)}try{Object.defineProperty(st,"name",{value:t})}catch(t){}return st.signatures=o,st._typedFunctionData={signatures:h,signatureMap:p},st}function Y(t,e,r){throw z(t,e,r)}function L(t){return J(t,0,t.length-1)}function H(t){return t[t.length-1]}function J(t,e,r){return Array.prototype.slice.call(t,e,r)}function W(t,e){for(let r=0;r<t.length;r++)if(e(t[r]))return t[r]}function K(t,e){return Array.prototype.concat.apply([],t.map(e))}function tt(){const t=L(arguments).map(t=>C(b(t))),e=H(arguments);if("function"!=typeof e)throw new TypeError("Callback function expected as last argument");return et(t,e)}function et(t,e){return{referTo:{references:t,callback:e}}}function rt(t){if("function"!=typeof t)throw new TypeError("Callback function expected as first argument");return{referToSelf:{callback:t}}}function nt(t){return t&&"object"==typeof t.referTo&&Array.isArray(t.referTo.references)&&"function"==typeof t.referTo.callback}function it(t){return t&&"object"==typeof t.referToSelf&&"function"==typeof t.referToSelf.callback}function ut(t,e){if(!t)return e;if(e&&e!==t){const r=new Error("Function names do not match (expected: "+t+", actual: "+e+")");throw r.data={actual:e,expected:t},r}return t}function ot(t){let e;for(const r in t)Object.prototype.hasOwnProperty.call(t,r)&&(g(t[r])||"string"==typeof t[r].signature)&&(e=ut(e,t[r].name));return e}function at(t,e){let r;for(r in e)if(Object.prototype.hasOwnProperty.call(e,r)){if(r in t&&e[r]!==t[r]){const n=new Error('Signature "'+r+'" is defined twice');throw n.data={signature:r,sourceFunction:e[r],destFunction:t[r]},n}t[r]=e[r]}}D(),p(o);const st=l;function ct(t){if(!t||"string"!=typeof t.from||"string"!=typeof t.to||"function"!=typeof t.convert)throw new TypeError("Object with properties {from: string, to: string, convert: function} expected");if(t.to===t.from)throw new SyntaxError('Illegal to define conversion from "'+t.from+'" to itself.')}return l=function(t){const e="string"==typeof t;let r=e?t:"";const n={};for(let t=e?1:0;t<arguments.length;++t){const i=arguments[t];let o,a={};if("function"==typeof i?(o=i.name,"string"==typeof i.signature?a[i.signature]=i:g(i)&&(a=i.signatures)):u(i)&&(a=i,e||(o=ot(i))),0===Object.keys(a).length){const e=new TypeError("Argument to 'typed' at index "+t+" is not a (typed) function, nor an object with signatures as keys and functions as values.");throw e.data={index:t,argument:i},e}e||(r=ut(r,o)),at(n,a)}return X(r||"",n)},l.create=i,l.createCount=st.createCount,l.onMismatch=Y,l.throwMismatchError=Y,l.createError=z,l.clear=D,l.clearConversions=d,l.addTypes=p,l._findType=h,l.referTo=tt,l.referToSelf=rt,l.convert=v,l.findSignature=y,l.find=w,l.isTypedFunction=g,l.warnAgainstDeprecatedThis=!0,l.addType=function(t,e){let r="any";!1!==e&&s.has("Object")&&(r="Object"),l.addTypes([t],r)},l.addConversion=function(t){let e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{override:!1};ct(t);const r=h(t.to),n=r.conversionsTo.find(e=>e.from===t.from);if(n){if(!e||!e.override)throw new Error('There is already a conversion from "'+t.from+'" to "'+r.name+'"');l.removeConversion({from:n.from,to:t.to,convert:n.convert})}r.conversionsTo.push({from:t.from,convert:t.convert,index:f++})},l.addConversions=function(t,e){t.forEach(t=>l.addConversion(t,e))},l.removeConversion=function(t){ct(t);const e=h(t.to),r=W(e.conversionsTo,e=>e.from===t.from);if(!r)throw new Error("Attempt to remove nonexistent conversion from "+t.from+" to "+t.to);if(r.convert!==t.convert)throw new Error("Conversion to remove does not match existing conversion");const n=e.conversionsTo.indexOf(r);e.conversionsTo.splice(n,1)},l.resolve=function(t,e){if(!g(t))throw new TypeError(n);const r=t._typedFunctionData.signatures;for(let t=0;t<r.length;++t)if(r[t].test(e))return r[t];return null},l}var u=i();return u}()}(L);var H=Y(L.exports);function J(t){return"boolean"==typeof t||!!isFinite(t)&&t===Math.round(t)}function W(t,e,r){var n={2:"0b",8:"0o",16:"0x"}[e],i="";if(r){if(r<1)throw new Error("size must be in greater than 0");if(!J(r))throw new Error("size must be an integer");if(t>2**(r-1)-1||t<-(2**(r-1)))throw new Error("Value must be in range [-2^".concat(r-1,", 2^").concat(r-1,"-1]"));if(!J(t))throw new Error("Value must be an integer");t<0&&(t+=2**r),i="i".concat(r)}var u="";return t<0&&(t=-t,u="-"),"".concat(u).concat(n).concat(t.toString(e)).concat(i)}function K(t,e){if("function"==typeof e)return e(t);if(t===1/0)return"Infinity";if(t===-1/0)return"-Infinity";if(isNaN(t))return"NaN";var{notation:r,precision:i,wordSize:u}=tt(e);switch(r){case"fixed":return function(t,e){if(isNaN(t)||!isFinite(t))return String(t);var r=et(t),n="number"==typeof e?nt(r,r.exponent+1+e):r,i=n.coefficients,u=n.exponent+1,o=u+(e||0);i.length<o&&(i=i.concat(it(o-i.length)));u<0&&(i=it(1-u).concat(i),u=1);u<i.length&&i.splice(u,0,0===u?"0.":".");return n.sign+i.join("")}(t,i);case"exponential":return rt(t,i);case"engineering":return function(t,e){if(isNaN(t)||!isFinite(t))return String(t);var r=et(t),i=nt(r,e),u=i.exponent,o=i.coefficients,a=u%3==0?u:u<0?u-3-u%3:u-u%3;if(n(e))for(;e>o.length||u-a+1>o.length;)o.push(0);else for(var s=Math.abs(u-a)-(o.length-1),c=0;c<s;c++)o.push(0);var f=Math.abs(u-a),l=1;for(;f>0;)l++,f--;var h=o.slice(l).join(""),p=n(e)&&h.length||h.match(/[1-9]/)?"."+h:"",D=o.slice(0,l).join("")+p+"e"+(u>=0?"+":"")+a.toString();return i.sign+D}(t,i);case"bin":return W(t,2,u);case"oct":return W(t,8,u);case"hex":return W(t,16,u);case"auto":return function(t,e,r){if(isNaN(t)||!isFinite(t))return String(t);var n=st(null==r?void 0:r.lowerExp,-3),i=st(null==r?void 0:r.upperExp,5),u=et(t),o=e?nt(u,e):u;if(o.exponent<n||o.exponent>=i)return rt(t,e);var a=o.coefficients,s=o.exponent;a.length<e&&(a=a.concat(it(e-a.length))),a=a.concat(it(s-a.length+1+(a.length<e?e-a.length:0)));var c=s>0?s:0;return c<(a=it(-s).concat(a)).length-1&&a.splice(c+1,0,"."),o.sign+a.join("")}(t,i,e).replace(/((\.\d*?)(0+))($|e)/,function(){var t=arguments[2],e=arguments[4];return"."!==t?t+e:e});default:throw new Error('Unknown notation "'+r+'". Choose "auto", "exponential", "fixed", "bin", "oct", or "hex.')}}function tt(t){var e,r,u="auto";if(void 0!==t)if(n(t))e=t;else if(i(t))e=t.toNumber();else{if(!F(t))throw new Error("Unsupported type of options, number, BigNumber, or object expected");void 0!==t.precision&&(e=at(t.precision,()=>{throw new Error('Option "precision" must be a number or BigNumber')})),void 0!==t.wordSize&&(r=at(t.wordSize,()=>{throw new Error('Option "wordSize" must be a number or BigNumber')})),t.notation&&(u=t.notation)}return{notation:u,precision:e,wordSize:r}}function et(t){var e=String(t).toLowerCase().match(/^(-?)(\d+\.?\d*)(e([+-]?\d+))?$/);if(!e)throw new SyntaxError("Invalid number "+t);var r=e[1],n=e[2],i=parseFloat(e[4]||"0"),u=n.indexOf(".");i+=-1!==u?u-1:n.length-1;var o=n.replace(".","").replace(/^0*/,function(t){return i-=t.length,""}).replace(/0*$/,"").split("").map(function(t){return parseInt(t)});return 0===o.length&&(o.push(0),i++),{sign:r,coefficients:o,exponent:i}}function rt(t,e){if(isNaN(t)||!isFinite(t))return String(t);var r=et(t),n=e?nt(r,e):r,i=n.coefficients,u=n.exponent;i.length<e&&(i=i.concat(it(e-i.length)));var o=i.shift();return n.sign+o+(i.length>0?"."+i.join(""):"")+"e"+(u>=0?"+":"")+u}function nt(t,e){for(var r={sign:t.sign,coefficients:t.coefficients,exponent:t.exponent},n=r.coefficients;e<=0;)n.unshift(0),r.exponent++,e++;if(n.length>e&&n.splice(e,n.length-e)[0]>=5){var i=e-1;for(n[i]++;10===n[i];)n.pop(),0===i&&(n.unshift(0),r.exponent++,i++),n[--i]++}return r}function it(t){for(var e=[],r=0;r<t;r++)e.push(0);return e}var ut=Number.EPSILON||2220446049250313e-31;function ot(t,e,r){if(null==r)return t===e;if(t===e)return!0;if(isNaN(t)||isNaN(e))return!1;if(isFinite(t)&&isFinite(e)){var n=Math.abs(t-e);return n<=ut||n<=Math.max(Math.abs(t),Math.abs(e))*r}return!1}function at(t,e){return n(t)?t:i(t)?t.toNumber():void e()}function st(t,e){return n(t)?t:i(t)?t.toNumber():e}function ct(t,e,r,n){function i(n){var i=function(t,e){for(var r={},n=0;n<e.length;n++){var i=e[n],u=t[i];void 0!==u&&(r[i]=u)}return r}(n,e.map(ft));return function(t,e,r){var n=e.filter(t=>!function(t){return t&&"?"===t[0]}(t)).every(t=>void 0!==r[t]);if(!n){var i=e.filter(t=>void 0===r[t]);throw new Error('Cannot create function "'.concat(t,'", ')+"some dependencies are missing: ".concat(i.map(t=>'"'.concat(t,'"')).join(", "),"."))}}(t,e,n),r(i)}return i.isFactory=!0,i.fn=t,i.dependencies=e.slice().sort(),n&&(i.meta=n),i}function ft(t){return t&&"?"===t[0]?t.slice(1):t}function lt(t,e){if(pt(t)&&ht(t,e))return t[e];if("function"==typeof t[e]&&function(t,e){if(null==t||"function"!=typeof t[e])return!1;if(Z(t,e)&&Object.getPrototypeOf&&e in Object.getPrototypeOf(t))return!1;if(Z(dt,e))return!0;if(e in Object.prototype)return!1;if(e in Function.prototype)return!1;return!0}(t,e))throw new Error('Cannot access method "'+e+'" as a property');throw new Error('No access to property "'+e+'"')}function ht(t,e){return!(!t||"object"!=typeof t)&&(!!Z(Dt,e)||!(e in Object.prototype)&&!(e in Function.prototype))}function pt(t){return"object"==typeof t&&t&&t.constructor===Object}var Dt={length:!0,name:!0},dt={toString:!0,valueOf:!0,toLocaleString:!0};class mt{constructor(t){this.wrappedObject=t,this[Symbol.iterator]=this.entries}keys(){return Object.keys(this.wrappedObject).values()}get(t){return lt(this.wrappedObject,t)}set(t,e){return function(t,e,r){if(pt(t)&&ht(t,e))return t[e]=r,r;throw new Error('No access to property "'+e+'"')}(this.wrappedObject,t,e),this}has(t){return e=this.wrappedObject,t in e;var e}entries(){return t=this.keys(),e=t=>[t,this.get(t)],{next:()=>{var r=t.next();return r.done?r:{value:e(r.value),done:!1}}};var t,e}forEach(t){for(var e of this.keys())t(this.get(e),e,this)}delete(t){delete this.wrappedObject[t]}clear(){for(var t of this.keys())this.delete(t)}get size(){return Object.keys(this.wrappedObject).length}}function gt(t){return!!t&&(t instanceof Map||t instanceof mt||"function"==typeof t.set&&"function"==typeof t.get&&"function"==typeof t.keys&&"function"==typeof t.has)}var yt=function(){return yt=H.create,H},wt=ct("typed",["?BigNumber","?Complex","?DenseMatrix","?Fraction"],function(t){var{BigNumber:e,Complex:r,DenseMatrix:G,Fraction:Q}=t,V=yt();return V.clear(),V.addTypes([{name:"number",test:n},{name:"Complex",test:u},{name:"BigNumber",test:i},{name:"Fraction",test:o},{name:"Unit",test:a},{name:"identifier",test:t=>s&&/^(?:[A-Za-z\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u0870-\u0887\u0889-\u088E\u08A0-\u08C9\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u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061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16F1-\u16F8\u1700-\u1711\u171F-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1878\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4C\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BF\u31F0-\u31FF\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA7CA\uA7D0\uA7D1\uA7D3\uA7D5-\uA7D9\uA7F2-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\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DC75\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD44\uDD47\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE3F\uDE40\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC5F-\uDC61\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDEB8\uDF00-\uDF1A\uDF40-\uDF46]|\uD806[\uDC00-\uDC2B\uDCA0-\uDCDF\uDCFF-\uDD06\uDD09\uDD0C-\uDD13\uDD15\uDD16\uDD18-\uDD2F\uDD3F\uDD41\uDDA0-\uDDA7\uDDAA-\uDDD0\uDDE1\uDDE3\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE89\uDE9D\uDEB0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD89\uDD98\uDEE0-\uDEF2\uDF02\uDF04-\uDF10\uDF12-\uDF33\uDFB0]|\uD808[\uDC00-\uDF99]|\uD809[\uDC80-\uDD43]|\uD80B[\uDF90-\uDFF0]|[\uD80C\uD81C-\uD820\uD822\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879\uD880-\uD883\uD885-\uD887][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2F\uDC41-\uDC46]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uD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uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDEDF\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF39\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A\uDF50-\uDFFF]|\uD888[\uDC00-\uDFAF])(?:[0-9A-Za-z\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u0870-\u0887\u0889-\u088E\u08A0-\u08C9\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C5D\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16F1-\u16F8\u1700-\u1711\u171F-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1878\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4C\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BF\u31F0-\u31FF\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA7CA\uA7D0\uA7D1\uA7D3\uA7D5-\uA7D9\uA7F2-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF2D-\uDF40\uDF42-\uDF49\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDD70-\uDD7A\uDD7C-\uDD8A\uDD8C-\uDD92\uDD94\uDD95\uDD97-\uDDA1\uDDA3-\uDDB1\uDDB3-\uDDB9\uDDBB\uDDBC\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67\uDF80-\uDF85\uDF87-\uDFB0\uDFB2-\uDFBA]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE35\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2\uDD00-\uDD23\uDE80-\uDEA9\uDEB0\uDEB1\uDF00-\uDF1C\uDF27\uDF30-\uDF45\uDF70-\uDF81\uDFB0-\uDFC4\uDFE0-\uDFF6]|\uD804[\uDC03-\uDC37\uDC71\uDC72\uDC75\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD44\uDD47\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE3F\uDE40\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC5F-\uDC61\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDEB8\uDF00-\uDF1A\uDF40-\uDF46]|\uD806[\uDC00-\uDC2B\uDCA0-\uDCDF\uDCFF-\uDD06\uDD09\uDD0C-\uDD13\uDD15\uDD16\uDD18-\uDD2F\uDD3F\uDD41\uDDA0-\uDDA7\uDDAA-\uDDD0\uDDE1\uDDE3\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE89\uDE9D\uDEB0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD89\uDD98\uDEE0-\uDEF2\uDF02\uDF04-\uDF10\uDF12-\uDF33\uDFB0]|\uD808[\uDC00-\uDF99]|\uD809[\uDC80-\uDD43]|\uD80B[\uDF90-\uDFF0]|[\uD80C\uD81C-\uD820\uD822\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879\uD880-\uD883\uD885-\uD887][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2F\uDC41-\uDC46]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE70-\uDEBE\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDE40-\uDE7F\uDF00-\uDF4A\uDF50\uD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DE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDEDF\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF39\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A\uDF50-\uDFFF]|\uD888[\uDC00-\uDFAF])*$/.test(t)},{name:"string",test:s},{name:"Chain",test:U},{name:"Array",test:c},{name:"Matrix",test:f},{name:"DenseMatrix",test:h},{name:"SparseMatrix",test:p},{name:"Range",test:D},{name:"Index",test:d},{name:"boolean",test:m},{name:"ResultSet",test:g},{name:"Help",test:y},{name:"function",test:w},{name:"Date",test:v},{name:"RegExp",test:C},{name:"null",test:A},{name:"undefined",test:E},{name:"AccessorNode",test:b},{name:"ArrayNode",test:x},{name:"AssignmentNode",test:M},{name:"BlockNode",test:_},{name:"ConditionalNode",test:B},{name:"ConstantNode",test:N},{name:"FunctionNode",test:T},{name:"FunctionAssignmentNode",test:S},{name:"IndexNode",test:z},{name:"Node",test:O},{name:"ObjectNode",test:q},{name:"OperatorNode",test:R},{name:"ParenthesisNode",test:I},{name:"RangeNode",test:P},{name:"RelationalNode",test:k},{name:"SymbolNode",test:j},{name:"Map",test:gt},{name:"Object",test:F}]),V.addConversions([{from:"number",to:"BigNumber",convert:function(t){if(e||vt(t),t.toExponential().replace(/e.*$/,"").replace(/^0\.?0*|\./,"").length>15)throw new TypeError("Cannot implicitly convert a number with >15 significant digits to BigNumber (value: "+t+"). Use function bignumber(x) to convert to BigNumber.");return new e(t)}},{from:"number",to:"Complex",convert:function(t){return r||Ct(t),new r(t,0)}},{from:"BigNumber",to:"Complex",convert:function(t){return r||Ct(t),new r(t.toNumber(),0)}},{from:"Fraction",to:"BigNumber",convert:function(t){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(t){return r||Ct(t),new r(t.valueOf(),0)}},{from:"number",to:"Fraction",convert:function(t){Q||Ft(t);var e=new Q(t);if(e.valueOf()!==t)throw new TypeError("Cannot implicitly convert a number to a Fraction when there will be a loss of precision (value: "+t+"). Use function fraction(x) to convert to Fraction.");return e}},{from:"string",to:"number",convert:function(t){var e=Number(t);if(isNaN(e))throw new Error('Cannot convert "'+t+'" to a number');return e}},{from:"string",to:"BigNumber",convert:function(t){e||vt(t);try{return new e(t)}catch(e){throw new Error('Cannot convert "'+t+'" to BigNumber')}}},{from:"string",to:"Fraction",convert:function(t){Q||Ft(t);try{return new Q(t)}catch(e){throw new Error('Cannot convert "'+t+'" to Fraction')}}},{from:"string",to:"Complex",convert:function(t){r||Ct(t);try{return new r(t)}catch(e){throw new Error('Cannot convert "'+t+'" to Complex')}}},{from:"boolean",to:"number",convert:function(t){return+t}},{from:"boolean",to:"BigNumber",convert:function(t){return e||vt(t),new e(+t)}},{from:"boolean",to:"Fraction",convert:function(t){return Q||Ft(t),new Q(+t)}},{from:"boolean",to:"string",convert:function(t){return String(t)}},{from:"Array",to:"Matrix",convert:function(t){return G||function(){throw new Error("Cannot convert array into a Matrix: no class 'DenseMatrix' provided")}(),new G(t)}},{from:"Matrix",to:"Array",convert:function(t){return t.valueOf()}}]),V.onMismatch=(t,e,r)=>{var n=V.createError(t,e,r);if(["wrongType","mismatch"].includes(n.data.category)&&1===e.length&&l(e[0])&&r.some(t=>!t.params.includes(","))){var i=new TypeError("Function '".concat(t,"' doesn't apply to matrices. To call it ")+"elementwise on a matrix 'M', try 'map(M, ".concat(t,")'."));throw i.data=n.data,i}throw n},V.onMismatch=(t,e,r)=>{var n=V.createError(t,e,r);if(["wrongType","mismatch"].includes(n.data.category)&&1===e.length&&l(e[0])&&r.some(t=>!t.params.includes(","))){var i=new TypeError("Function '".concat(t,"' doesn't apply to matrices. To call it ")+"elementwise on a matrix 'M', try 'map(M, ".concat(t,")'."));throw i.data=n.data,i}throw n},V});function vt(t){throw new Error("Cannot convert value ".concat(t," into a BigNumber: no class 'BigNumber' provided"))}function Ct(t){throw new Error("Cannot convert value ".concat(t," into a Complex number: no class 'Complex' provided"))}function Ft(t){throw new Error("Cannot convert value ".concat(t," into a Fraction, no class 'Fraction' provided."))}
/*!
* decimal.js v10.6.0
* An arbitrary-precision Decimal type for JavaScript.
* https://github.com/MikeMcl/decimal.js
* Copyright (c) 2025 Michael Mclaughlin <M8ch88l@gmail.com>
* MIT Licence
*/var At,Et,bt=9e15,xt=1e9,Mt="0123456789abcdef",_t="2.3025850929940456840179914546843642076011014886287729760333279009675726096773524802359972050895982983419677840422862486334095254650828067566662873690987816894829072083255546808437998948262331985283935053089653777326288461633662222876982198867465436674744042432743651550489343149393914796194044002221051017141748003688084012647080685567743216228355220114804663715659121373450747856947683463616792101806445070648000277502684916746550586856935673420670581136429224554405758925724208241314695689016758940256776311356919292033376587141660230105703089634572075440370847469940168269282808481184289314848524948644871927809676271275775397027668605952496716674183485704422507197965004714951050492214776567636938662976979522110718264549734772662425709429322582798502585509785265383207606726317164309505995087807523710333101197857547331541421808427