(function(Dr,d){typeof exports=="object"&&typeof module<"u"?d(exports,require("vue"),require("@abi-software/plotvuer"),require("https://mapcore-demo.org/current/opencor-wasm/0.0.3/libopencor.js")):typeof define=="function"&&define.amd?define(["exports","vue","@abi-software/plotvuer","https://mapcore-demo.org/current/opencor-wasm/0.0.3/libopencor.js"],d):(Dr=typeof globalThis<"u"?globalThis:Dr||self,d(Dr.SimulationVuer={},Dr.Vue,Dr["@abi-software/plotvuer"],Dr.libOpenCOR))})(this,function(Dr,d,_y,ns){"use strict";const It=(e,r,{checkForDefaultPrevented:t=!0}={})=>a=>{const i=e==null?void 0:e(a);if(t===!1||!i)return r==null?void 0:r(a)};var Il;const yr=typeof window<"u",Ty=e=>typeof e=="string",Rl=()=>{},as=yr&&((Il=window==null?void 0:window.navigator)==null?void 0:Il.userAgent)&&/iP(ad|hone|od)/.test(window.navigator.userAgent);function zl(e){return typeof e=="function"?e():d.unref(e)}function Fy(e){return e}function hi(e){return d.getCurrentScope()?(d.onScopeDispose(e),!0):!1}function By(e,r=!0){d.getCurrentInstance()?d.onMounted(e):r?e():d.nextTick(e)}function Rt(e){var r;const t=zl(e);return(r=t==null?void 0:t.$el)!=null?r:t}const gi=yr?window:void 0;function zr(...e){let r,t,n,a;if(Ty(e[0])||Array.isArray(e[0])?([t,n,a]=e,r=gi):[r,t,n,a]=e,!r)return Rl;Array.isArray(t)||(t=[t]),Array.isArray(n)||(n=[n]);const i=[],o=()=>{i.forEach(c=>c()),i.length=0},l=(c,f,m,p)=>(c.addEventListener(f,m,p),()=>c.removeEventListener(f,m,p)),u=d.watch(()=>[Rt(r),zl(a)],([c,f])=>{o(),c&&i.push(...t.flatMap(m=>n.map(p=>l(c,m,p,f))))},{immediate:!0,flush:"post"}),s=()=>{u(),o()};return hi(s),s}let Pl=!1;function Oy(e,r,t={}){const{window:n=gi,ignore:a=[],capture:i=!0,detectIframe:o=!1}=t;if(!n)return;as&&!Pl&&(Pl=!0,Array.from(n.document.body.children).forEach(m=>m.addEventListener("click",Rl)));let l=!0;const u=m=>a.some(p=>{if(typeof p=="string")return Array.from(n.document.querySelectorAll(p)).some(v=>v===m.target||m.composedPath().includes(v));{const v=Rt(p);return v&&(m.target===v||m.composedPath().includes(v))}}),c=[zr(n,"click",m=>{const p=Rt(e);if(!(!p||p===m.target||m.composedPath().includes(p))){if(m.detail===0&&(l=!u(m)),!l){l=!0;return}r(m)}},{passive:!0,capture:i}),zr(n,"pointerdown",m=>{const p=Rt(e);p&&(l=!m.composedPath().includes(p)&&!u(m))},{passive:!0}),o&&zr(n,"blur",m=>{var p;const v=Rt(e);((p=n.document.activeElement)==null?void 0:p.tagName)==="IFRAME"&&!(v!=null&&v.contains(n.document.activeElement))&&r(m)})].filter(Boolean);return()=>c.forEach(m=>m())}function kl(e,r=!1){const t=d.ref(),n=()=>t.value=!!e();return n(),By(n,r),t}const ql=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},Ll="__vueuse_ssr_handlers__";ql[Ll]=ql[Ll]||{};var Vl=Object.getOwnPropertySymbols,$y=Object.prototype.hasOwnProperty,Iy=Object.prototype.propertyIsEnumerable,Ry=(e,r)=>{var t={};for(var n in e)$y.call(e,n)&&r.indexOf(n)<0&&(t[n]=e[n]);if(e!=null&&Vl)for(var n of Vl(e))r.indexOf(n)<0&&Iy.call(e,n)&&(t[n]=e[n]);return t};function zt(e,r,t={}){const n=t,{window:a=gi}=n,i=Ry(n,["window"]);let o;const l=kl(()=>a&&"ResizeObserver"in a),u=()=>{o&&(o.disconnect(),o=void 0)},s=d.watch(()=>Rt(e),f=>{u(),l.value&&a&&f&&(o=new ResizeObserver(r),o.observe(f,i))},{immediate:!0,flush:"post"}),c=()=>{u(),s()};return hi(c),{isSupported:l,stop:c}}var Ul=Object.getOwnPropertySymbols,zy=Object.prototype.hasOwnProperty,Py=Object.prototype.propertyIsEnumerable,ky=(e,r)=>{var t={};for(var n in e)zy.call(e,n)&&r.indexOf(n)<0&&(t[n]=e[n]);if(e!=null&&Ul)for(var n of Ul(e))r.indexOf(n)<0&&Py.call(e,n)&&(t[n]=e[n]);return t};function qy(e,r,t={}){const n=t,{window:a=gi}=n,i=ky(n,["window"]);let o;const l=kl(()=>a&&"MutationObserver"in a),u=()=>{o&&(o.disconnect(),o=void 0)},s=d.watch(()=>Rt(e),f=>{u(),l.value&&a&&f&&(o=new MutationObserver(r),o.observe(f,i))},{immediate:!0}),c=()=>{u(),s()};return hi(c),{isSupported:l,stop:c}}var Hl;(function(e){e.UP="UP",e.RIGHT="RIGHT",e.DOWN="DOWN",e.LEFT="LEFT",e.NONE="NONE"})(Hl||(Hl={}));var Ly=Object.defineProperty,Zl=Object.getOwnPropertySymbols,Vy=Object.prototype.hasOwnProperty,Uy=Object.prototype.propertyIsEnumerable,Gl=(e,r,t)=>r in e?Ly(e,r,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[r]=t,Hy=(e,r)=>{for(var t in r||(r={}))Vy.call(r,t)&&Gl(e,t,r[t]);if(Zl)for(var t of Zl(r))Uy.call(r,t)&&Gl(e,t,r[t]);return e};Hy({linear:Fy},{easeInSine:[.12,0,.39,0],easeOutSine:[.61,1,.88,1],easeInOutSine:[.37,0,.63,1],easeInQuad:[.11,0,.5,0],easeOutQuad:[.5,1,.89,1],easeInOutQuad:[.45,0,.55,1],easeInCubic:[.32,0,.67,0],easeOutCubic:[.33,1,.68,1],easeInOutCubic:[.65,0,.35,1],easeInQuart:[.5,0,.75,0],easeOutQuart:[.25,1,.5,1],easeInOutQuart:[.76,0,.24,1],easeInQuint:[.64,0,.78,0],easeOutQuint:[.22,1,.36,1],easeInOutQuint:[.83,0,.17,1],easeInExpo:[.7,0,.84,0],easeOutExpo:[.16,1,.3,1],easeInOutExpo:[.87,0,.13,1],easeInCirc:[.55,0,1,.45],easeOutCirc:[0,.55,.45,1],easeInOutCirc:[.85,0,.15,1],easeInBack:[.36,0,.66,-.56],easeOutBack:[.34,1.56,.64,1],easeInOutBack:[.68,-.6,.32,1.6]});const Zy=()=>yr&&/firefox/i.test(window.navigator.userAgent);/** * @vue/shared v3.5.20 * (c) 2018-present Yuxi (Evan) You and Vue contributors * @license MIT **/process.env.NODE_ENV!=="production"&&Object.freeze({}),process.env.NODE_ENV!=="production"&&Object.freeze([]);const $a=()=>{},Gy=Object.prototype.hasOwnProperty,Wl=(e,r)=>Gy.call(e,r),Et=Array.isArray,Fr=e=>typeof e=="function",Jr=e=>typeof e=="string",Ur=e=>e!==null&&typeof e=="object",Wy=Object.prototype.toString,jy=e=>Wy.call(e),is=e=>jy(e).slice(8,-1),jl=e=>{const r=Object.create(null);return t=>r[t]||(r[t]=e(t))},Ky=/-(\w)/g,Jy=jl(e=>e.replace(Ky,(r,t)=>t?t.toUpperCase():"")),Yy=/\B([A-Z])/g,Xy=jl(e=>e.replace(Yy,"-$1").toLowerCase());var Kl=typeof global=="object"&&global&&global.Object===Object&&global,Qy=typeof self=="object"&&self&&self.Object===Object&&self,Dt=Kl||Qy||Function("return this")(),St=Dt.Symbol,Jl=Object.prototype,e1=Jl.hasOwnProperty,r1=Jl.toString,Ia=St?St.toStringTag:void 0;function t1(e){var r=e1.call(e,Ia),t=e[Ia];try{e[Ia]=void 0;var n=!0}catch{}var a=r1.call(e);return n&&(r?e[Ia]=t:delete e[Ia]),a}var n1=Object.prototype,a1=n1.toString;function i1(e){return a1.call(e)}var o1="[object Null]",s1="[object Undefined]",Yl=St?St.toStringTag:void 0;function Wn(e){return e==null?e===void 0?s1:o1:Yl&&Yl in Object(e)?t1(e):i1(e)}function jn(e){return e!=null&&typeof e=="object"}var u1="[object Symbol]";function yi(e){return typeof e=="symbol"||jn(e)&&Wn(e)==u1}function l1(e,r){for(var t=-1,n=e==null?0:e.length,a=Array(n);++t0){if(++r>=I1)return arguments[0]}else r=0;return e.apply(void 0,arguments)}}function k1(e){return function(){return e}}var bi=function(){try{var e=Mn(Object,"defineProperty");return e({},"",{}),e}catch{}}(),q1=bi?function(e,r){return bi(e,"toString",{configurable:!0,enumerable:!1,value:k1(r),writable:!0})}:nc,L1=P1(q1);function V1(e,r,t,n){e.length;for(var a=t+1;a--;)if(r(e[a],a,e))return a;return-1}var U1=9007199254740991,H1=/^(?:0|[1-9]\d*)$/;function us(e,r){var t=typeof e;return r=r??U1,!!r&&(t=="number"||t!="symbol"&&H1.test(e))&&e>-1&&e%1==0&&e-1&&e%1==0&&e<=J1}function Y1(e){return e!=null&&cs(e.length)&&!ac(e)}var X1=Object.prototype;function Q1(e){var r=e&&e.constructor,t=typeof r=="function"&&r.prototype||X1;return e===t}function eb(e,r){for(var t=-1,n=Array(e);++t-1}function sw(e,r){var t=this.__data__,n=wi(t,e);return n<0?(++this.size,t.push([e,r])):t[n][1]=r,this}function Pt(e){var r=-1,t=e==null?0:e.length;for(this.clear();++rl))return!1;var s=i.get(e),c=i.get(r);if(s&&c)return s==r&&c==e;var f=-1,m=!0,p=t&Kw?new Ai:void 0;for(i.set(e,r),i.set(r,e);++f=r||D<0||f&&S>=i}function b(){var y=xs();if(w(y))return A(y);l=setTimeout(b,h(y))}function A(y){return l=void 0,m&&n?p(y):(n=a=void 0,o)}function g(){l!==void 0&&clearTimeout(l),s=0,n=u=a=l=void 0}function N(){return l===void 0?o:A(xs())}function x(){var y=xs(),D=w(y);if(n=arguments,a=this,u=y,D){if(l===void 0)return v(u);if(f)return clearTimeout(l),l=setTimeout(b,r),p(u)}return l===void 0&&(l=setTimeout(b,r)),o}return x.cancel=g,x.flush=N,x}function Rx(e,r,t){var n=e==null?0:e.length;if(!n)return-1;var a=n-1;return V1(e,Bx(r),a)}function Si(e){for(var r=-1,t=e==null?0:e.length,n={};++re===void 0,Ic=e=>typeof e=="boolean",lr=e=>typeof e=="number",Tn=e=>typeof Element>"u"?!1:e instanceof Element,Vx=e=>Jr(e)?!Number.isNaN(Number(e)):!1,Ux=(e="")=>e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d"),Rc=e=>Object.keys(e);class zc extends Error{constructor(r){super(r),this.name="ElementPlusError"}}function Es(e,r){throw new zc(`[${e}] ${r}`)}function hr(e,r){if(process.env.NODE_ENV!=="production"){const t=Jr(e)?new zc(`[${e}] ${r}`):e;console.warn(t)}}const Hx="utils/dom/style",Pc=(e="")=>e.split(" ").filter(r=>!!r.trim()),kc=(e,r)=>{!e||!r.trim()||e.classList.add(...Pc(r))},Ci=(e,r)=>{!e||!r.trim()||e.classList.remove(...Pc(r))},qa=(e,r)=>{var t;if(!yr||!e||!r)return"";let n=Jy(r);n==="float"&&(n="cssFloat");try{const a=e.style[n];if(a)return a;const i=(t=document.defaultView)==null?void 0:t.getComputedStyle(e,"");return i?i[n]:""}catch{return e.style[n]}};function Ds(e,r="px"){if(!e)return"";if(lr(e)||Vx(e))return`${e}${r}`;if(Jr(e))return e;hr(Hx,"binding value must be a string or number")}function Zx(e,r){if(!yr)return;if(!r){e.scrollTop=0;return}const t=[];let n=r.offsetParent;for(;n!==null&&e!==n&&e.contains(n);)t.push(n),n=n.offsetParent;const a=r.offsetTop+t.reduce((u,s)=>u+s.offsetTop,0),i=a+r.offsetHeight,o=e.scrollTop,l=o+e.clientHeight;al&&(e.scrollTop=i-e.clientHeight)}/*! Element Plus Icons Vue v2.3.2 */var Gx=d.defineComponent({name:"ArrowDown",__name:"arrow-down",setup(e){return(r,t)=>(d.openBlock(),d.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[d.createElementVNode("path",{fill:"currentColor",d:"M831.872 340.864 512 652.672 192.128 340.864a30.59 30.59 0 0 0-42.752 0 29.12 29.12 0 0 0 0 41.6L489.664 714.24a32 32 0 0 0 44.672 0l340.288-331.712a29.12 29.12 0 0 0 0-41.728 30.59 30.59 0 0 0-42.752 0z"})]))}}),qc=Gx,Wx=d.defineComponent({name:"ArrowUp",__name:"arrow-up",setup(e){return(r,t)=>(d.openBlock(),d.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[d.createElementVNode("path",{fill:"currentColor",d:"m488.832 344.32-339.84 356.672a32 32 0 0 0 0 44.16l.384.384a29.44 29.44 0 0 0 42.688 0l320-335.872 319.872 335.872a29.44 29.44 0 0 0 42.688 0l.384-.384a32 32 0 0 0 0-44.16L535.168 344.32a32 32 0 0 0-46.336 0"})]))}}),jx=Wx,Kx=d.defineComponent({name:"CircleCheck",__name:"circle-check",setup(e){return(r,t)=>(d.openBlock(),d.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[d.createElementVNode("path",{fill:"currentColor",d:"M512 896a384 384 0 1 0 0-768 384 384 0 0 0 0 768m0 64a448 448 0 1 1 0-896 448 448 0 0 1 0 896"}),d.createElementVNode("path",{fill:"currentColor",d:"M745.344 361.344a32 32 0 0 1 45.312 45.312l-288 288a32 32 0 0 1-45.312 0l-160-160a32 32 0 1 1 45.312-45.312L480 626.752z"})]))}}),Jx=Kx,Yx=d.defineComponent({name:"CircleClose",__name:"circle-close",setup(e){return(r,t)=>(d.openBlock(),d.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[d.createElementVNode("path",{fill:"currentColor",d:"m466.752 512-90.496-90.496a32 32 0 0 1 45.248-45.248L512 466.752l90.496-90.496a32 32 0 1 1 45.248 45.248L557.248 512l90.496 90.496a32 32 0 1 1-45.248 45.248L512 557.248l-90.496 90.496a32 32 0 0 1-45.248-45.248z"}),d.createElementVNode("path",{fill:"currentColor",d:"M512 896a384 384 0 1 0 0-768 384 384 0 0 0 0 768m0 64a448 448 0 1 1 0-896 448 448 0 0 1 0 896"})]))}}),Ss=Yx,Xx=d.defineComponent({name:"Close",__name:"close",setup(e){return(r,t)=>(d.openBlock(),d.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[d.createElementVNode("path",{fill:"currentColor",d:"M764.288 214.592 512 466.88 259.712 214.592a31.936 31.936 0 0 0-45.12 45.12L466.752 512 214.528 764.224a31.936 31.936 0 1 0 45.12 45.184L512 557.184l252.288 252.288a31.936 31.936 0 0 0 45.12-45.12L557.12 512.064l252.288-252.352a31.936 31.936 0 1 0-45.12-45.184z"})]))}}),Lc=Xx,Qx=d.defineComponent({name:"Hide",__name:"hide",setup(e){return(r,t)=>(d.openBlock(),d.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[d.createElementVNode("path",{fill:"currentColor",d:"M876.8 156.8c0-9.6-3.2-16-9.6-22.4s-12.8-9.6-22.4-9.6-16 3.2-22.4 9.6L736 220.8c-64-32-137.6-51.2-224-60.8-160 16-288 73.6-377.6 176S0 496 0 512s48 73.6 134.4 176c22.4 25.6 44.8 48 73.6 67.2l-86.4 89.6c-6.4 6.4-9.6 12.8-9.6 22.4s3.2 16 9.6 22.4 12.8 9.6 22.4 9.6 16-3.2 22.4-9.6l704-710.4c3.2-6.4 6.4-12.8 6.4-22.4m-646.4 528Q115.2 579.2 76.8 512q43.2-72 153.6-172.8C304 272 400 230.4 512 224c64 3.2 124.8 19.2 176 44.8l-54.4 54.4C598.4 300.8 560 288 512 288c-64 0-115.2 22.4-160 64s-64 96-64 160c0 48 12.8 89.6 35.2 124.8L256 707.2c-9.6-6.4-19.2-16-25.6-22.4m140.8-96Q352 555.2 352 512c0-44.8 16-83.2 48-112s67.2-48 112-48c28.8 0 54.4 6.4 73.6 19.2zM889.599 336c-12.8-16-28.8-28.8-41.6-41.6l-48 48c73.6 67.2 124.8 124.8 150.4 169.6q-43.2 72-153.6 172.8c-73.6 67.2-172.8 108.8-284.8 115.2-51.2-3.2-99.2-12.8-140.8-28.8l-48 48c57.6 22.4 118.4 38.4 188.8 44.8 160-16 288-73.6 377.6-176S1024 528 1024 512s-48.001-73.6-134.401-176"}),d.createElementVNode("path",{fill:"currentColor",d:"M511.998 672c-12.8 0-25.6-3.2-38.4-6.4l-51.2 51.2c28.8 12.8 57.6 19.2 89.6 19.2 64 0 115.2-22.4 160-64 41.6-41.6 64-96 64-160 0-32-6.4-64-19.2-89.6l-51.2 51.2c3.2 12.8 6.4 25.6 6.4 38.4 0 44.8-16 83.2-48 112s-67.2 48-112 48"})]))}}),e2=Qx,r2=d.defineComponent({name:"Loading",__name:"loading",setup(e){return(r,t)=>(d.openBlock(),d.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[d.createElementVNode("path",{fill:"currentColor",d:"M512 64a32 32 0 0 1 32 32v192a32 32 0 0 1-64 0V96a32 32 0 0 1 32-32m0 640a32 32 0 0 1 32 32v192a32 32 0 1 1-64 0V736a32 32 0 0 1 32-32m448-192a32 32 0 0 1-32 32H736a32 32 0 1 1 0-64h192a32 32 0 0 1 32 32m-640 0a32 32 0 0 1-32 32H96a32 32 0 0 1 0-64h192a32 32 0 0 1 32 32M195.2 195.2a32 32 0 0 1 45.248 0L376.32 331.008a32 32 0 0 1-45.248 45.248L195.2 240.448a32 32 0 0 1 0-45.248m452.544 452.544a32 32 0 0 1 45.248 0L828.8 783.552a32 32 0 0 1-45.248 45.248L647.744 692.992a32 32 0 0 1 0-45.248M828.8 195.264a32 32 0 0 1 0 45.184L692.992 376.32a32 32 0 0 1-45.248-45.248l135.808-135.808a32 32 0 0 1 45.248 0m-452.544 452.48a32 32 0 0 1 0 45.248L240.448 828.8a32 32 0 0 1-45.248-45.248l135.808-135.808a32 32 0 0 1 45.248 0"})]))}}),Vc=r2,t2=d.defineComponent({name:"Minus",__name:"minus",setup(e){return(r,t)=>(d.openBlock(),d.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[d.createElementVNode("path",{fill:"currentColor",d:"M128 544h768a32 32 0 1 0 0-64H128a32 32 0 0 0 0 64"})]))}}),n2=t2,a2=d.defineComponent({name:"Plus",__name:"plus",setup(e){return(r,t)=>(d.openBlock(),d.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[d.createElementVNode("path",{fill:"currentColor",d:"M480 480V128a32 32 0 0 1 64 0v352h352a32 32 0 1 1 0 64H544v352a32 32 0 1 1-64 0V544H128a32 32 0 0 1 0-64z"})]))}}),i2=a2,o2=d.defineComponent({name:"View",__name:"view",setup(e){return(r,t)=>(d.openBlock(),d.createElementBlock("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 1024 1024"},[d.createElementVNode("path",{fill:"currentColor",d:"M512 160c320 0 512 352 512 352S832 864 512 864 0 512 0 512s192-352 512-352m0 64c-225.28 0-384.128 208.064-436.8 288 52.608 79.872 211.456 288 436.8 288 225.28 0 384.128-208.064 436.8-288-52.608-79.872-211.456-288-436.8-288m0 64a224 224 0 1 1 0 448 224 224 0 0 1 0-448m0 64a160.19 160.19 0 0 0-160 160c0 88.192 71.744 160 160 160s160-71.808 160-160-71.744-160-160-160"})]))}}),s2=o2;const Uc="__epPropKey",Ue=e=>e,u2=e=>Ur(e)&&!!e[Uc],Mi=(e,r)=>{if(!Ur(e)||u2(e))return e;const{values:t,required:n,default:a,type:i,validator:o}=e,u={type:i,required:!!n,validator:t||o?s=>{let c=!1,f=[];if(t&&(f=Array.from(t),Wl(e,"default")&&f.push(a),c||(c=f.includes(s))),o&&(c||(c=o(s))),!c&&f.length>0){const m=[...new Set(f)].map(p=>JSON.stringify(p)).join(", ");d.warn(`Invalid prop: validation failed${r?` for prop "${r}"`:""}. Expected one of [${m}], got value ${JSON.stringify(s)}.`)}return c}:void 0,[Uc]:!0};return Wl(e,"default")&&(u.default=a),u},cr=e=>Si(Object.entries(e).map(([r,t])=>[r,Mi(t,r)])),Kn=Ue([String,Object,Function]),Hc={validating:Vc,success:Jx,error:Ss},nt=(e,r)=>{if(e.install=t=>{for(const n of[e,...Object.values(r??{})])t.component(n.name,n)},r)for(const[t,n]of Object.entries(r))e[t]=n;return e},Cs=e=>(e.install=$a,e),Jn={tab:"Tab",enter:"Enter",space:"Space",left:"ArrowLeft",up:"ArrowUp",right:"ArrowRight",down:"ArrowDown",esc:"Escape",delete:"Delete",pageUp:"PageUp",pageDown:"PageDown",home:"Home",end:"End"},gr="update:modelValue",Yn="change",Fn="input",Zc=["","default","small","large"],l2=e=>/([\uAC00-\uD7AF\u3130-\u318F])+/gi.test(e),c2=e=>e,f2=["class","style"],m2=/^on[A-Z]/,d2=(e={})=>{const{excludeListeners:r=!1,excludeKeys:t}=e,n=d.computed(()=>((t==null?void 0:t.value)||[]).concat(f2)),a=d.getCurrentInstance();return a?d.computed(()=>{var i;return Si(Object.entries((i=a.proxy)==null?void 0:i.$attrs).filter(([o])=>!n.value.includes(o)&&!(r&&m2.test(o))))}):(hr("use-attrs","getCurrentInstance() returned null. useAttrs() must be called at the top of a setup function"),d.computed(()=>({})))},p2=({from:e,replacement:r,scope:t,version:n,ref:a,type:i="API"},o)=>{d.watch(()=>d.unref(o),l=>{l&&hr(t,`[${i}] ${e} is about to be deprecated in version ${n}, please use ${r} instead. For more detail, please visit: ${a} `)},{immediate:!0})};var v2={name:"en",el:{breadcrumb:{label:"Breadcrumb"},colorpicker:{confirm:"OK",clear:"Clear",defaultLabel:"color picker",description:"current color is {color}. press enter to select a new color.",alphaLabel:"pick alpha value"},datepicker:{now:"Now",today:"Today",cancel:"Cancel",clear:"Clear",confirm:"OK",dateTablePrompt:"Use the arrow keys and enter to select the day of the month",monthTablePrompt:"Use the arrow keys and enter to select the month",yearTablePrompt:"Use the arrow keys and enter to select the year",selectedDate:"Selected date",selectDate:"Select date",selectTime:"Select time",startDate:"Start Date",startTime:"Start Time",endDate:"End Date",endTime:"End Time",prevYear:"Previous Year",nextYear:"Next Year",prevMonth:"Previous Month",nextMonth:"Next Month",year:"",month1:"January",month2:"February",month3:"March",month4:"April",month5:"May",month6:"June",month7:"July",month8:"August",month9:"September",month10:"October",month11:"November",month12:"December",week:"week",weeks:{sun:"Sun",mon:"Mon",tue:"Tue",wed:"Wed",thu:"Thu",fri:"Fri",sat:"Sat"},weeksFull:{sun:"Sunday",mon:"Monday",tue:"Tuesday",wed:"Wednesday",thu:"Thursday",fri:"Friday",sat:"Saturday"},months:{jan:"Jan",feb:"Feb",mar:"Mar",apr:"Apr",may:"May",jun:"Jun",jul:"Jul",aug:"Aug",sep:"Sep",oct:"Oct",nov:"Nov",dec:"Dec"}},inputNumber:{decrease:"decrease number",increase:"increase number"},select:{loading:"Loading",noMatch:"No matching data",noData:"No data",placeholder:"Select"},mention:{loading:"Loading"},dropdown:{toggleDropdown:"Toggle Dropdown"},cascader:{noMatch:"No matching data",loading:"Loading",placeholder:"Select",noData:"No data"},pagination:{goto:"Go to",pagesize:"/page",total:"Total {total}",pageClassifier:"",page:"Page",prev:"Go to previous page",next:"Go to next page",currentPage:"page {pager}",prevPages:"Previous {pager} pages",nextPages:"Next {pager} pages",deprecationWarning:"Deprecated usages detected, please refer to the el-pagination documentation for more details"},dialog:{close:"Close this dialog"},drawer:{close:"Close this dialog"},messagebox:{title:"Message",confirm:"OK",cancel:"Cancel",error:"Illegal input",close:"Close this dialog"},upload:{deleteTip:"press delete to remove",delete:"Delete",preview:"Preview",continue:"Continue"},slider:{defaultLabel:"slider between {min} and {max}",defaultRangeStartLabel:"pick start value",defaultRangeEndLabel:"pick end value"},table:{emptyText:"No Data",confirmFilter:"Confirm",resetFilter:"Reset",clearFilter:"All",sumText:"Sum"},tour:{next:"Next",previous:"Previous",finish:"Finish"},tree:{emptyText:"No Data"},transfer:{noMatch:"No matching data",noData:"No data",titles:["List 1","List 2"],filterPlaceholder:"Enter keyword",noCheckedFormat:"{total} items",hasCheckedFormat:"{checked}/{total} checked"},image:{error:"FAILED"},pageHeader:{title:"Back"},popconfirm:{confirmButtonText:"Yes",cancelButtonText:"No"},carousel:{leftArrow:"Carousel arrow left",rightArrow:"Carousel arrow right",indicator:"Carousel switch to index {index}"}}};const h2=e=>(r,t)=>g2(r,t,d.unref(e)),g2=(e,r,t)=>qt(t,e,e).replace(/\{(\w+)\}/g,(n,a)=>{var i;return`${(i=r==null?void 0:r[a])!=null?i:`{${a}}`}`}),y2=e=>{const r=d.computed(()=>d.unref(e).name),t=d.isRef(e)?e:d.ref(e);return{lang:r,locale:t,t:h2(e)}},Gc=Symbol("localeContextKey"),_i=e=>{const r=e||d.inject(Gc,d.ref());return y2(d.computed(()=>r.value||v2))},Ti="el",b2="is-",Bn=(e,r,t,n,a)=>{let i=`${e}-${r}`;return t&&(i+=`-${t}`),n&&(i+=`__${n}`),a&&(i+=`--${a}`),i},Wc=Symbol("namespaceContextKey"),Ms=e=>{const r=e||(d.getCurrentInstance()?d.inject(Wc,d.ref(Ti)):d.ref(Ti));return d.computed(()=>d.unref(r)||Ti)},fr=(e,r)=>{const t=Ms(r);return{namespace:t,b:(h="")=>Bn(t.value,e,h,"",""),e:h=>h?Bn(t.value,e,"",h,""):"",m:h=>h?Bn(t.value,e,"","",h):"",be:(h,w)=>h&&w?Bn(t.value,e,h,w,""):"",em:(h,w)=>h&&w?Bn(t.value,e,"",h,w):"",bm:(h,w)=>h&&w?Bn(t.value,e,h,"",w):"",bem:(h,w,b)=>h&&w&&b?Bn(t.value,e,h,w,b):"",is:(h,...w)=>{const b=w.length>=1?w[0]:!0;return h&&b?`${b2}${h}`:""},cssVar:h=>{const w={};for(const b in h)h[b]&&(w[`--${t.value}-${b}`]=h[b]);return w},cssVarName:h=>`--${t.value}-${h}`,cssVarBlock:h=>{const w={};for(const b in h)h[b]&&(w[`--${t.value}-${e}-${b}`]=h[b]);return w},cssVarBlockName:h=>`--${t.value}-${e}-${h}`}},w2=Mi({type:Ue(Boolean),default:null}),x2=Mi({type:Ue(Function)}),N2=e=>{const r=`update:${e}`,t=`onUpdate:${e}`,n=[r],a={[e]:w2,[t]:x2};return{useModelToggle:({indicator:o,toggleReason:l,shouldHideWhenRouteChanges:u,shouldProceed:s,onShow:c,onHide:f})=>{const m=d.getCurrentInstance(),{emit:p}=m,v=m.props,h=d.computed(()=>Fr(v[t])),w=d.computed(()=>v[e]===null),b=D=>{o.value!==!0&&(o.value=!0,l&&(l.value=D),Fr(c)&&c(D))},A=D=>{o.value!==!1&&(o.value=!1,l&&(l.value=D),Fr(f)&&f(D))},g=D=>{if(v.disabled===!0||Fr(s)&&!s())return;const S=h.value&&yr;S&&p(r,!0),(w.value||!S)&&b(D)},N=D=>{if(v.disabled===!0||!yr)return;const S=h.value&&yr;S&&p(r,!1),(w.value||!S)&&A(D)},x=D=>{Ic(D)&&(v.disabled&&D?h.value&&p(r,!1):o.value!==D&&(D?b():A()))},y=()=>{o.value?N():g()};return d.watch(()=>v[e],x),u&&m.appContext.config.globalProperties.$route!==void 0&&d.watch(()=>({...m.proxy.$route}),()=>{u.value&&o.value&&N()}),d.onMounted(()=>{x(v[e])}),{hide:N,show:g,toggle:y,hasUpdateHandler:h}},useModelToggleProps:a,useModelToggleEmits:n}},jc=e=>{const r=d.getCurrentInstance();return d.computed(()=>{var t,n;return(n=(t=r==null?void 0:r.proxy)==null?void 0:t.$props)==null?void 0:n[e]})};var Hr="top",at="bottom",it="right",Zr="left",_s="auto",La=[Hr,at,it,Zr],Xn="start",Va="end",A2="clippingParents",Kc="viewport",Ua="popper",E2="reference",Jc=La.reduce(function(e,r){return e.concat([r+"-"+Xn,r+"-"+Va])},[]),Qn=[].concat(La,[_s]).reduce(function(e,r){return e.concat([r,r+"-"+Xn,r+"-"+Va])},[]),D2="beforeRead",S2="read",C2="afterRead",M2="beforeMain",_2="main",T2="afterMain",F2="beforeWrite",B2="write",O2="afterWrite",$2=[D2,S2,C2,M2,_2,T2,F2,B2,O2];function Ct(e){return e?(e.nodeName||"").toLowerCase():null}function pt(e){if(e==null)return window;if(e.toString()!=="[object Window]"){var r=e.ownerDocument;return r&&r.defaultView||window}return e}function ea(e){var r=pt(e).Element;return e instanceof r||e instanceof Element}function ot(e){var r=pt(e).HTMLElement;return e instanceof r||e instanceof HTMLElement}function Ts(e){if(typeof ShadowRoot>"u")return!1;var r=pt(e).ShadowRoot;return e instanceof r||e instanceof ShadowRoot}function I2(e){var r=e.state;Object.keys(r.elements).forEach(function(t){var n=r.styles[t]||{},a=r.attributes[t]||{},i=r.elements[t];!ot(i)||!Ct(i)||(Object.assign(i.style,n),Object.keys(a).forEach(function(o){var l=a[o];l===!1?i.removeAttribute(o):i.setAttribute(o,l===!0?"":l)}))})}function R2(e){var r=e.state,t={popper:{position:r.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(r.elements.popper.style,t.popper),r.styles=t,r.elements.arrow&&Object.assign(r.elements.arrow.style,t.arrow),function(){Object.keys(r.elements).forEach(function(n){var a=r.elements[n],i=r.attributes[n]||{},o=Object.keys(r.styles.hasOwnProperty(n)?r.styles[n]:t[n]),l=o.reduce(function(u,s){return u[s]="",u},{});!ot(a)||!Ct(a)||(Object.assign(a.style,l),Object.keys(i).forEach(function(u){a.removeAttribute(u)}))})}}var Yc={name:"applyStyles",enabled:!0,phase:"write",fn:I2,effect:R2,requires:["computeStyles"]};function Mt(e){return e.split("-")[0]}var On=Math.max,Fi=Math.min,ra=Math.round;function ta(e,r){r===void 0&&(r=!1);var t=e.getBoundingClientRect(),n=1,a=1;if(ot(e)&&r){var i=e.offsetHeight,o=e.offsetWidth;o>0&&(n=ra(t.width)/o||1),i>0&&(a=ra(t.height)/i||1)}return{width:t.width/n,height:t.height/a,top:t.top/a,right:t.right/n,bottom:t.bottom/a,left:t.left/n,x:t.left/n,y:t.top/a}}function Fs(e){var r=ta(e),t=e.offsetWidth,n=e.offsetHeight;return Math.abs(r.width-t)<=1&&(t=r.width),Math.abs(r.height-n)<=1&&(n=r.height),{x:e.offsetLeft,y:e.offsetTop,width:t,height:n}}function Xc(e,r){var t=r.getRootNode&&r.getRootNode();if(e.contains(r))return!0;if(t&&Ts(t)){var n=r;do{if(n&&e.isSameNode(n))return!0;n=n.parentNode||n.host}while(n)}return!1}function Ht(e){return pt(e).getComputedStyle(e)}function z2(e){return["table","td","th"].indexOf(Ct(e))>=0}function an(e){return((ea(e)?e.ownerDocument:e.document)||window.document).documentElement}function Bi(e){return Ct(e)==="html"?e:e.assignedSlot||e.parentNode||(Ts(e)?e.host:null)||an(e)}function Qc(e){return!ot(e)||Ht(e).position==="fixed"?null:e.offsetParent}function P2(e){var r=navigator.userAgent.toLowerCase().indexOf("firefox")!==-1,t=navigator.userAgent.indexOf("Trident")!==-1;if(t&&ot(e)){var n=Ht(e);if(n.position==="fixed")return null}var a=Bi(e);for(Ts(a)&&(a=a.host);ot(a)&&["html","body"].indexOf(Ct(a))<0;){var i=Ht(a);if(i.transform!=="none"||i.perspective!=="none"||i.contain==="paint"||["transform","perspective"].indexOf(i.willChange)!==-1||r&&i.willChange==="filter"||r&&i.filter&&i.filter!=="none")return a;a=a.parentNode}return null}function Ha(e){for(var r=pt(e),t=Qc(e);t&&z2(t)&&Ht(t).position==="static";)t=Qc(t);return t&&(Ct(t)==="html"||Ct(t)==="body"&&Ht(t).position==="static")?r:t||P2(e)||r}function Bs(e){return["top","bottom"].indexOf(e)>=0?"x":"y"}function Za(e,r,t){return On(e,Fi(r,t))}function k2(e,r,t){var n=Za(e,r,t);return n>t?t:n}function ef(){return{top:0,right:0,bottom:0,left:0}}function rf(e){return Object.assign({},ef(),e)}function tf(e,r){return r.reduce(function(t,n){return t[n]=e,t},{})}var q2=function(e,r){return e=typeof e=="function"?e(Object.assign({},r.rects,{placement:r.placement})):e,rf(typeof e!="number"?e:tf(e,La))};function L2(e){var r,t=e.state,n=e.name,a=e.options,i=t.elements.arrow,o=t.modifiersData.popperOffsets,l=Mt(t.placement),u=Bs(l),s=[Zr,it].indexOf(l)>=0,c=s?"height":"width";if(!(!i||!o)){var f=q2(a.padding,t),m=Fs(i),p=u==="y"?Hr:Zr,v=u==="y"?at:it,h=t.rects.reference[c]+t.rects.reference[u]-o[u]-t.rects.popper[c],w=o[u]-t.rects.reference[u],b=Ha(i),A=b?u==="y"?b.clientHeight||0:b.clientWidth||0:0,g=h/2-w/2,N=f[p],x=A-m[c]-f[v],y=A/2-m[c]/2+g,D=Za(N,y,x),S=u;t.modifiersData[n]=(r={},r[S]=D,r.centerOffset=D-y,r)}}function V2(e){var r=e.state,t=e.options,n=t.element,a=n===void 0?"[data-popper-arrow]":n;a!=null&&(typeof a=="string"&&(a=r.elements.popper.querySelector(a),!a)||!Xc(r.elements.popper,a)||(r.elements.arrow=a))}var U2={name:"arrow",enabled:!0,phase:"main",fn:L2,effect:V2,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function na(e){return e.split("-")[1]}var H2={top:"auto",right:"auto",bottom:"auto",left:"auto"};function Z2(e){var r=e.x,t=e.y,n=window,a=n.devicePixelRatio||1;return{x:ra(r*a)/a||0,y:ra(t*a)/a||0}}function nf(e){var r,t=e.popper,n=e.popperRect,a=e.placement,i=e.variation,o=e.offsets,l=e.position,u=e.gpuAcceleration,s=e.adaptive,c=e.roundOffsets,f=e.isFixed,m=o.x,p=m===void 0?0:m,v=o.y,h=v===void 0?0:v,w=typeof c=="function"?c({x:p,y:h}):{x:p,y:h};p=w.x,h=w.y;var b=o.hasOwnProperty("x"),A=o.hasOwnProperty("y"),g=Zr,N=Hr,x=window;if(s){var y=Ha(t),D="clientHeight",S="clientWidth";if(y===pt(t)&&(y=an(t),Ht(y).position!=="static"&&l==="absolute"&&(D="scrollHeight",S="scrollWidth")),y=y,a===Hr||(a===Zr||a===it)&&i===Va){N=at;var E=f&&y===x&&x.visualViewport?x.visualViewport.height:y[D];h-=E-n.height,h*=u?1:-1}if(a===Zr||(a===Hr||a===at)&&i===Va){g=it;var C=f&&y===x&&x.visualViewport?x.visualViewport.width:y[S];p-=C-n.width,p*=u?1:-1}}var _=Object.assign({position:l},s&&H2),F=c===!0?Z2({x:p,y:h}):{x:p,y:h};if(p=F.x,h=F.y,u){var I;return Object.assign({},_,(I={},I[N]=A?"0":"",I[g]=b?"0":"",I.transform=(x.devicePixelRatio||1)<=1?"translate("+p+"px, "+h+"px)":"translate3d("+p+"px, "+h+"px, 0)",I))}return Object.assign({},_,(r={},r[N]=A?h+"px":"",r[g]=b?p+"px":"",r.transform="",r))}function G2(e){var r=e.state,t=e.options,n=t.gpuAcceleration,a=n===void 0?!0:n,i=t.adaptive,o=i===void 0?!0:i,l=t.roundOffsets,u=l===void 0?!0:l,s={placement:Mt(r.placement),variation:na(r.placement),popper:r.elements.popper,popperRect:r.rects.popper,gpuAcceleration:a,isFixed:r.options.strategy==="fixed"};r.modifiersData.popperOffsets!=null&&(r.styles.popper=Object.assign({},r.styles.popper,nf(Object.assign({},s,{offsets:r.modifiersData.popperOffsets,position:r.options.strategy,adaptive:o,roundOffsets:u})))),r.modifiersData.arrow!=null&&(r.styles.arrow=Object.assign({},r.styles.arrow,nf(Object.assign({},s,{offsets:r.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:u})))),r.attributes.popper=Object.assign({},r.attributes.popper,{"data-popper-placement":r.placement})}var af={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:G2,data:{}},Oi={passive:!0};function W2(e){var r=e.state,t=e.instance,n=e.options,a=n.scroll,i=a===void 0?!0:a,o=n.resize,l=o===void 0?!0:o,u=pt(r.elements.popper),s=[].concat(r.scrollParents.reference,r.scrollParents.popper);return i&&s.forEach(function(c){c.addEventListener("scroll",t.update,Oi)}),l&&u.addEventListener("resize",t.update,Oi),function(){i&&s.forEach(function(c){c.removeEventListener("scroll",t.update,Oi)}),l&&u.removeEventListener("resize",t.update,Oi)}}var of={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:W2,data:{}},j2={left:"right",right:"left",bottom:"top",top:"bottom"};function $i(e){return e.replace(/left|right|bottom|top/g,function(r){return j2[r]})}var K2={start:"end",end:"start"};function sf(e){return e.replace(/start|end/g,function(r){return K2[r]})}function Os(e){var r=pt(e),t=r.pageXOffset,n=r.pageYOffset;return{scrollLeft:t,scrollTop:n}}function $s(e){return ta(an(e)).left+Os(e).scrollLeft}function J2(e){var r=pt(e),t=an(e),n=r.visualViewport,a=t.clientWidth,i=t.clientHeight,o=0,l=0;return n&&(a=n.width,i=n.height,/^((?!chrome|android).)*safari/i.test(navigator.userAgent)||(o=n.offsetLeft,l=n.offsetTop)),{width:a,height:i,x:o+$s(e),y:l}}function Y2(e){var r,t=an(e),n=Os(e),a=(r=e.ownerDocument)==null?void 0:r.body,i=On(t.scrollWidth,t.clientWidth,a?a.scrollWidth:0,a?a.clientWidth:0),o=On(t.scrollHeight,t.clientHeight,a?a.scrollHeight:0,a?a.clientHeight:0),l=-n.scrollLeft+$s(e),u=-n.scrollTop;return Ht(a||t).direction==="rtl"&&(l+=On(t.clientWidth,a?a.clientWidth:0)-i),{width:i,height:o,x:l,y:u}}function Is(e){var r=Ht(e),t=r.overflow,n=r.overflowX,a=r.overflowY;return/auto|scroll|overlay|hidden/.test(t+a+n)}function uf(e){return["html","body","#document"].indexOf(Ct(e))>=0?e.ownerDocument.body:ot(e)&&Is(e)?e:uf(Bi(e))}function Ga(e,r){var t;r===void 0&&(r=[]);var n=uf(e),a=n===((t=e.ownerDocument)==null?void 0:t.body),i=pt(n),o=a?[i].concat(i.visualViewport||[],Is(n)?n:[]):n,l=r.concat(o);return a?l:l.concat(Ga(Bi(o)))}function Rs(e){return Object.assign({},e,{left:e.x,top:e.y,right:e.x+e.width,bottom:e.y+e.height})}function X2(e){var r=ta(e);return r.top=r.top+e.clientTop,r.left=r.left+e.clientLeft,r.bottom=r.top+e.clientHeight,r.right=r.left+e.clientWidth,r.width=e.clientWidth,r.height=e.clientHeight,r.x=r.left,r.y=r.top,r}function lf(e,r){return r===Kc?Rs(J2(e)):ea(r)?X2(r):Rs(Y2(an(e)))}function Q2(e){var r=Ga(Bi(e)),t=["absolute","fixed"].indexOf(Ht(e).position)>=0,n=t&&ot(e)?Ha(e):e;return ea(n)?r.filter(function(a){return ea(a)&&Xc(a,n)&&Ct(a)!=="body"}):[]}function eN(e,r,t){var n=r==="clippingParents"?Q2(e):[].concat(r),a=[].concat(n,[t]),i=a[0],o=a.reduce(function(l,u){var s=lf(e,u);return l.top=On(s.top,l.top),l.right=Fi(s.right,l.right),l.bottom=Fi(s.bottom,l.bottom),l.left=On(s.left,l.left),l},lf(e,i));return o.width=o.right-o.left,o.height=o.bottom-o.top,o.x=o.left,o.y=o.top,o}function cf(e){var r=e.reference,t=e.element,n=e.placement,a=n?Mt(n):null,i=n?na(n):null,o=r.x+r.width/2-t.width/2,l=r.y+r.height/2-t.height/2,u;switch(a){case Hr:u={x:o,y:r.y-t.height};break;case at:u={x:o,y:r.y+r.height};break;case it:u={x:r.x+r.width,y:l};break;case Zr:u={x:r.x-t.width,y:l};break;default:u={x:r.x,y:r.y}}var s=a?Bs(a):null;if(s!=null){var c=s==="y"?"height":"width";switch(i){case Xn:u[s]=u[s]-(r[c]/2-t[c]/2);break;case Va:u[s]=u[s]+(r[c]/2-t[c]/2);break}}return u}function Wa(e,r){r===void 0&&(r={});var t=r,n=t.placement,a=n===void 0?e.placement:n,i=t.boundary,o=i===void 0?A2:i,l=t.rootBoundary,u=l===void 0?Kc:l,s=t.elementContext,c=s===void 0?Ua:s,f=t.altBoundary,m=f===void 0?!1:f,p=t.padding,v=p===void 0?0:p,h=rf(typeof v!="number"?v:tf(v,La)),w=c===Ua?E2:Ua,b=e.rects.popper,A=e.elements[m?w:c],g=eN(ea(A)?A:A.contextElement||an(e.elements.popper),o,u),N=ta(e.elements.reference),x=cf({reference:N,element:b,placement:a}),y=Rs(Object.assign({},b,x)),D=c===Ua?y:N,S={top:g.top-D.top+h.top,bottom:D.bottom-g.bottom+h.bottom,left:g.left-D.left+h.left,right:D.right-g.right+h.right},E=e.modifiersData.offset;if(c===Ua&&E){var C=E[a];Object.keys(S).forEach(function(_){var F=[it,at].indexOf(_)>=0?1:-1,I=[Hr,at].indexOf(_)>=0?"y":"x";S[_]+=C[I]*F})}return S}function rN(e,r){r===void 0&&(r={});var t=r,n=t.placement,a=t.boundary,i=t.rootBoundary,o=t.padding,l=t.flipVariations,u=t.allowedAutoPlacements,s=u===void 0?Qn:u,c=na(n),f=c?l?Jc:Jc.filter(function(v){return na(v)===c}):La,m=f.filter(function(v){return s.indexOf(v)>=0});m.length===0&&(m=f);var p=m.reduce(function(v,h){return v[h]=Wa(e,{placement:h,boundary:a,rootBoundary:i,padding:o})[Mt(h)],v},{});return Object.keys(p).sort(function(v,h){return p[v]-p[h]})}function tN(e){if(Mt(e)===_s)return[];var r=$i(e);return[sf(e),r,sf(r)]}function nN(e){var r=e.state,t=e.options,n=e.name;if(!r.modifiersData[n]._skip){for(var a=t.mainAxis,i=a===void 0?!0:a,o=t.altAxis,l=o===void 0?!0:o,u=t.fallbackPlacements,s=t.padding,c=t.boundary,f=t.rootBoundary,m=t.altBoundary,p=t.flipVariations,v=p===void 0?!0:p,h=t.allowedAutoPlacements,w=r.options.placement,b=Mt(w),A=b===w,g=u||(A||!v?[$i(w)]:tN(w)),N=[w].concat(g).reduce(function(Q,se){return Q.concat(Mt(se)===_s?rN(r,{placement:se,boundary:c,rootBoundary:f,padding:s,flipVariations:v,allowedAutoPlacements:h}):se)},[]),x=r.rects.reference,y=r.rects.popper,D=new Map,S=!0,E=N[0],C=0;C=0,$=R?"width":"height",M=Wa(r,{placement:_,boundary:c,rootBoundary:f,altBoundary:m,padding:s}),T=R?I?it:Zr:I?at:Hr;x[$]>y[$]&&(T=$i(T));var k=$i(T),O=[];if(i&&O.push(M[F]<=0),l&&O.push(M[T]<=0,M[k]<=0),O.every(function(Q){return Q})){E=_,S=!1;break}D.set(_,O)}if(S)for(var W=v?3:1,X=function(Q){var se=N.find(function(re){var q=D.get(re);if(q)return q.slice(0,Q).every(function(Z){return Z})});if(se)return E=se,"break"},U=W;U>0;U--){var z=X(U);if(z==="break")break}r.placement!==E&&(r.modifiersData[n]._skip=!0,r.placement=E,r.reset=!0)}}var aN={name:"flip",enabled:!0,phase:"main",fn:nN,requiresIfExists:["offset"],data:{_skip:!1}};function ff(e,r,t){return t===void 0&&(t={x:0,y:0}),{top:e.top-r.height-t.y,right:e.right-r.width+t.x,bottom:e.bottom-r.height+t.y,left:e.left-r.width-t.x}}function mf(e){return[Hr,it,at,Zr].some(function(r){return e[r]>=0})}function iN(e){var r=e.state,t=e.name,n=r.rects.reference,a=r.rects.popper,i=r.modifiersData.preventOverflow,o=Wa(r,{elementContext:"reference"}),l=Wa(r,{altBoundary:!0}),u=ff(o,n),s=ff(l,a,i),c=mf(u),f=mf(s);r.modifiersData[t]={referenceClippingOffsets:u,popperEscapeOffsets:s,isReferenceHidden:c,hasPopperEscaped:f},r.attributes.popper=Object.assign({},r.attributes.popper,{"data-popper-reference-hidden":c,"data-popper-escaped":f})}var oN={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:iN};function sN(e,r,t){var n=Mt(e),a=[Zr,Hr].indexOf(n)>=0?-1:1,i=typeof t=="function"?t(Object.assign({},r,{placement:e})):t,o=i[0],l=i[1];return o=o||0,l=(l||0)*a,[Zr,it].indexOf(n)>=0?{x:l,y:o}:{x:o,y:l}}function uN(e){var r=e.state,t=e.options,n=e.name,a=t.offset,i=a===void 0?[0,0]:a,o=Qn.reduce(function(c,f){return c[f]=sN(f,r.rects,i),c},{}),l=o[r.placement],u=l.x,s=l.y;r.modifiersData.popperOffsets!=null&&(r.modifiersData.popperOffsets.x+=u,r.modifiersData.popperOffsets.y+=s),r.modifiersData[n]=o}var lN={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:uN};function cN(e){var r=e.state,t=e.name;r.modifiersData[t]=cf({reference:r.rects.reference,element:r.rects.popper,placement:r.placement})}var df={name:"popperOffsets",enabled:!0,phase:"read",fn:cN,data:{}};function fN(e){return e==="x"?"y":"x"}function mN(e){var r=e.state,t=e.options,n=e.name,a=t.mainAxis,i=a===void 0?!0:a,o=t.altAxis,l=o===void 0?!1:o,u=t.boundary,s=t.rootBoundary,c=t.altBoundary,f=t.padding,m=t.tether,p=m===void 0?!0:m,v=t.tetherOffset,h=v===void 0?0:v,w=Wa(r,{boundary:u,rootBoundary:s,padding:f,altBoundary:c}),b=Mt(r.placement),A=na(r.placement),g=!A,N=Bs(b),x=fN(N),y=r.modifiersData.popperOffsets,D=r.rects.reference,S=r.rects.popper,E=typeof h=="function"?h(Object.assign({},r.rects,{placement:r.placement})):h,C=typeof E=="number"?{mainAxis:E,altAxis:E}:Object.assign({mainAxis:0,altAxis:0},E),_=r.modifiersData.offset?r.modifiersData.offset[r.placement]:null,F={x:0,y:0};if(y){if(i){var I,R=N==="y"?Hr:Zr,$=N==="y"?at:it,M=N==="y"?"height":"width",T=y[N],k=T+w[R],O=T-w[$],W=p?-S[M]/2:0,X=A===Xn?D[M]:S[M],U=A===Xn?-S[M]:-D[M],z=r.elements.arrow,Q=p&&z?Fs(z):{width:0,height:0},se=r.modifiersData["arrow#persistent"]?r.modifiersData["arrow#persistent"].padding:ef(),re=se[R],q=se[$],Z=Za(0,D[M],Q[M]),j=g?D[M]/2-W-Z-re-C.mainAxis:X-Z-re-C.mainAxis,Y=g?-D[M]/2+W+Z+q+C.mainAxis:U+Z+q+C.mainAxis,ee=r.elements.arrow&&Ha(r.elements.arrow),te=ee?N==="y"?ee.clientTop||0:ee.clientLeft||0:0,oe=(I=_==null?void 0:_[N])!=null?I:0,ve=T+j-oe-te,L=T+Y-oe,H=Za(p?Fi(k,ve):k,T,p?On(O,L):O);y[N]=H,F[N]=H-T}if(l){var ne,ie=N==="x"?Hr:Zr,de=N==="x"?at:it,me=y[x],be=x==="y"?"height":"width",Ne=me+w[ie],V=me-w[de],K=[Hr,Zr].indexOf(b)!==-1,G=(ne=_==null?void 0:_[x])!=null?ne:0,ae=K?Ne:me-D[be]-S[be]-G+C.altAxis,ce=K?me+D[be]+S[be]-G-C.altAxis:V,fe=p&&K?k2(ae,me,ce):Za(p?ae:Ne,me,p?ce:V);y[x]=fe,F[x]=fe-me}r.modifiersData[n]=F}}var dN={name:"preventOverflow",enabled:!0,phase:"main",fn:mN,requiresIfExists:["offset"]};function pN(e){return{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}}function vN(e){return e===pt(e)||!ot(e)?Os(e):pN(e)}function hN(e){var r=e.getBoundingClientRect(),t=ra(r.width)/e.offsetWidth||1,n=ra(r.height)/e.offsetHeight||1;return t!==1||n!==1}function gN(e,r,t){t===void 0&&(t=!1);var n=ot(r),a=ot(r)&&hN(r),i=an(r),o=ta(e,a),l={scrollLeft:0,scrollTop:0},u={x:0,y:0};return(n||!n&&!t)&&((Ct(r)!=="body"||Is(i))&&(l=vN(r)),ot(r)?(u=ta(r,!0),u.x+=r.clientLeft,u.y+=r.clientTop):i&&(u.x=$s(i))),{x:o.left+l.scrollLeft-u.x,y:o.top+l.scrollTop-u.y,width:o.width,height:o.height}}function yN(e){var r=new Map,t=new Set,n=[];e.forEach(function(i){r.set(i.name,i)});function a(i){t.add(i.name);var o=[].concat(i.requires||[],i.requiresIfExists||[]);o.forEach(function(l){if(!t.has(l)){var u=r.get(l);u&&a(u)}}),n.push(i)}return e.forEach(function(i){t.has(i.name)||a(i)}),n}function bN(e){var r=yN(e);return $2.reduce(function(t,n){return t.concat(r.filter(function(a){return a.phase===n}))},[])}function wN(e){var r;return function(){return r||(r=new Promise(function(t){Promise.resolve().then(function(){r=void 0,t(e())})})),r}}function xN(e){var r=e.reduce(function(t,n){var a=t[n.name];return t[n.name]=a?Object.assign({},a,n,{options:Object.assign({},a.options,n.options),data:Object.assign({},a.data,n.data)}):n,t},{});return Object.keys(r).map(function(t){return r[t]})}var pf={placement:"bottom",modifiers:[],strategy:"absolute"};function vf(){for(var e=arguments.length,r=new Array(e),t=0;t{const n={name:"updateState",enabled:!0,phase:"write",fn:({state:u})=>{const s=SN(u);Object.assign(o.value,s)},requires:["computeStyles"]},a=d.computed(()=>{const{onFirstUpdate:u,placement:s,strategy:c,modifiers:f}=d.unref(t);return{onFirstUpdate:u,placement:s||"bottom",strategy:c||"absolute",modifiers:[...f||[],n,{name:"applyStyles",enabled:!1}]}}),i=d.shallowRef(),o=d.ref({styles:{popper:{position:d.unref(a).strategy,left:"0",top:"0"},arrow:{position:"absolute"}},attributes:{}}),l=()=>{i.value&&(i.value.destroy(),i.value=void 0)};return d.watch(a,u=>{const s=d.unref(i);s&&s.setOptions(u)},{deep:!0}),d.watch([e,r],([u,s])=>{l(),!(!u||!s)&&(i.value=EN(u,s,d.unref(a)))}),d.onBeforeUnmount(()=>{l()}),{state:d.computed(()=>{var u;return{...((u=d.unref(i))==null?void 0:u.state)||{}}}),styles:d.computed(()=>d.unref(o).styles),attributes:d.computed(()=>d.unref(o).attributes),update:()=>{var u;return(u=d.unref(i))==null?void 0:u.update()},forceUpdate:()=>{var u;return(u=d.unref(i))==null?void 0:u.forceUpdate()},instanceRef:d.computed(()=>d.unref(i))}};function SN(e){const r=Object.keys(e.elements),t=Si(r.map(a=>[a,e.styles[a]||{}])),n=Si(r.map(a=>[a,e.attributes[a]]));return{styles:t,attributes:n}}function hf(){let e;const r=(n,a)=>{t(),e=window.setTimeout(n,a)},t=()=>window.clearTimeout(e);return hi(()=>t()),{registerTimeout:r,cancelTimeout:t}}const Ps={prefix:Math.floor(Math.random()*1e4),current:0},CN=Symbol("elIdInjection"),gf=()=>d.getCurrentInstance()?d.inject(CN,Ps):Ps,Ii=e=>{const r=gf();!yr&&r===Ps&&hr("IdInjection",`Looks like you are using server rendering, you must provide a id provider to ensure the hydration process to be succeed usage: app.provide(ID_INJECTION_KEY, { prefix: number, current: number, })`);const t=Ms();return d.computed(()=>d.unref(e)||`${t.value}-id-${r.prefix}-${r.current++}`)};let aa=[];const yf=e=>{const r=e;r.key===Jn.esc&&aa.forEach(t=>t(r))},MN=e=>{d.onMounted(()=>{aa.length===0&&document.addEventListener("keydown",yf),yr&&aa.push(e)}),d.onBeforeUnmount(()=>{aa=aa.filter(r=>r!==e),aa.length===0&&yr&&document.removeEventListener("keydown",yf)})};let bf;const wf=()=>{const e=Ms(),r=gf(),t=d.computed(()=>`${e.value}-popper-container-${r.prefix}`),n=d.computed(()=>`#${t.value}`);return{id:t,selector:n}},_N=e=>{const r=document.createElement("div");return r.id=e,document.body.appendChild(r),r},TN=()=>{const{id:e,selector:r}=wf();return d.onBeforeMount(()=>{yr&&(process.env.NODE_ENV==="test"||!bf||!document.body.querySelector(r.value))&&(bf=_N(e.value))}),{id:e,selector:r}},FN=cr({showAfter:{type:Number,default:0},hideAfter:{type:Number,default:200},autoClose:{type:Number,default:0}}),BN=({showAfter:e,hideAfter:r,autoClose:t,open:n,close:a})=>{const{registerTimeout:i}=hf(),{registerTimeout:o,cancelTimeout:l}=hf();return{onOpen:c=>{i(()=>{n(c);const f=d.unref(t);lr(f)&&f>0&&o(()=>{a(c)},f)},d.unref(e))},onClose:c=>{l(),i(()=>{a(c)},d.unref(r))}}},xf=Symbol("elForwardRef"),ON=e=>{const r=t=>{e.value=t};d.provide(xf,{setForwardRef:r})},$N=e=>({mounted(r){e(r)},updated(r){e(r)},unmounted(){e(null)}}),Nf={current:0},Af=d.ref(0),Ef=2e3,Df=Symbol("elZIndexContextKey"),Sf=Symbol("zIndexContextKey"),Cf=e=>{const r=d.getCurrentInstance()?d.inject(Df,Nf):Nf,t=e||(d.getCurrentInstance()?d.inject(Sf,void 0):void 0),n=d.computed(()=>{const o=d.unref(t);return lr(o)?o:Ef}),a=d.computed(()=>n.value+Af.value),i=()=>(r.current++,Af.value=r.current,a.value);return!yr&&!d.inject(Df)&&hr("ZIndexInjection",`Looks like you are using server rendering, you must provide a z-index provider to ensure the hydration process to be succeed usage: app.provide(ZINDEX_INJECTION_KEY, { current: 0 })`),{initialZIndex:n,currentZIndex:a,nextZIndex:i}};function IN(e){let r;function t(){if(e.value==null)return;const{selectionStart:a,selectionEnd:i,value:o}=e.value;if(a==null||i==null)return;const l=o.slice(0,Math.max(0,a)),u=o.slice(Math.max(0,i));r={selectionStart:a,selectionEnd:i,value:o,beforeTxt:l,afterTxt:u}}function n(){if(e.value==null||r==null)return;const{value:a}=e.value,{beforeTxt:i,afterTxt:o,selectionStart:l}=r;if(i==null||o==null||l==null)return;let u=a.length;if(a.endsWith(o))u=a.length-o.length;else if(a.startsWith(i))u=i.length;else{const s=i[l-1],c=a.indexOf(s,l-1);c!==-1&&(u=c+1)}e.value.setSelectionRange(u,u)}return[t,n]}const ia=Mi({type:String,values:Zc,required:!1}),Mf=Symbol("size"),RN=()=>{const e=d.inject(Mf,{});return d.computed(()=>d.unref(e.size)||"")};function _f(e,{beforeFocus:r,afterFocus:t,beforeBlur:n,afterBlur:a}={}){const i=d.getCurrentInstance(),{emit:o}=i,l=d.shallowRef(),u=d.ref(!1),s=m=>{Fr(r)&&r(m)||u.value||(u.value=!0,o("focus",m),t==null||t())},c=m=>{var p;Fr(n)&&n(m)||m.relatedTarget&&((p=l.value)!=null&&p.contains(m.relatedTarget))||(u.value=!1,o("blur",m),a==null||a())},f=()=>{var m,p;(m=l.value)!=null&&m.contains(document.activeElement)&&l.value!==document.activeElement||(p=e.value)==null||p.focus()};return d.watch(l,m=>{m&&m.setAttribute("tabindex","-1")}),zr(l,"focus",s,!0),zr(l,"blur",c,!0),zr(l,"click",f,!0),process.env.NODE_ENV==="test"&&d.onMounted(()=>{const m=Tn(e.value)?e.value:document.querySelector("input,textarea");m&&(zr(m,"focus",s,!0),zr(m,"blur",c,!0))}),{isFocused:u,wrapperRef:l,handleFocus:s,handleBlur:c}}function Tf({afterComposition:e,emit:r}){const t=d.ref(!1),n=l=>{r==null||r("compositionstart",l),t.value=!0},a=l=>{var u;r==null||r("compositionupdate",l);const s=(u=l.target)==null?void 0:u.value,c=s[s.length-1]||"";t.value=!l2(c)},i=l=>{r==null||r("compositionend",l),t.value&&(t.value=!1,d.nextTick(()=>e(l)))};return{isComposing:t,handleComposition:l=>{l.type==="compositionend"?i(l):a(l)},handleCompositionStart:n,handleCompositionUpdate:a,handleCompositionEnd:i}}const Ff=Symbol("emptyValuesContextKey"),zN="use-empty-values",PN=["",void 0,null],kN=void 0,qN=cr({emptyValues:Array,valueOnClear:{type:[String,Number,Boolean,Function],default:void 0,validator:e=>Fr(e)?!e():!e}}),LN=(e,r)=>{const t=d.getCurrentInstance()?d.inject(Ff,d.ref({})):d.ref({}),n=d.computed(()=>e.emptyValues||t.value.emptyValues||PN),a=d.computed(()=>Fr(e.valueOnClear)?e.valueOnClear():e.valueOnClear!==void 0?e.valueOnClear:Fr(t.value.valueOnClear)?t.value.valueOnClear():t.value.valueOnClear!==void 0?t.value.valueOnClear:kN),i=o=>n.value.includes(o);return n.value.includes(a.value)||hr(zN,"value-on-clear should be a value of empty-values"),{emptyValues:n,valueOnClear:a,isEmptyValue:i}},VN=cr({ariaLabel:String,ariaOrientation:{type:String,values:["horizontal","vertical","undefined"]},ariaControls:String}),$n=e=>Lx(VN,e),Bf=Symbol(),Ri=d.ref();function ks(e,r=void 0){const t=d.getCurrentInstance()?d.inject(Bf,Ri):Ri;return e?d.computed(()=>{var n,a;return(a=(n=t.value)==null?void 0:n[e])!=null?a:r}):t}function UN(e,r){const t=ks(),n=fr(e,d.computed(()=>{var l;return((l=t.value)==null?void 0:l.namespace)||Ti})),a=_i(d.computed(()=>{var l;return(l=t.value)==null?void 0:l.locale})),i=Cf(d.computed(()=>{var l;return((l=t.value)==null?void 0:l.zIndex)||Ef})),o=d.computed(()=>{var l;return d.unref(r)||((l=t.value)==null?void 0:l.size)||""});return HN(d.computed(()=>d.unref(t)||{})),{ns:n,locale:a,zIndex:i,size:o}}const HN=(e,r,t=!1)=>{var n;const a=!!d.getCurrentInstance(),i=a?ks():void 0,o=(n=void 0)!=null?n:a?d.provide:void 0;if(!o){hr("provideGlobalConfig","provideGlobalConfig() can only be used inside setup().");return}const l=d.computed(()=>{const u=d.unref(e);return i!=null&&i.value?ZN(i.value,u):u});return o(Bf,l),o(Gc,d.computed(()=>l.value.locale)),o(Wc,d.computed(()=>l.value.namespace)),o(Sf,d.computed(()=>l.value.zIndex)),o(Mf,{size:d.computed(()=>l.value.size||"")}),o(Ff,d.computed(()=>({emptyValues:l.value.emptyValues,valueOnClear:l.value.valueOnClear}))),(t||!Ri.value)&&(Ri.value=l.value),l},ZN=(e,r)=>{const t=[...new Set([...Rc(e),...Rc(r)])],n={};for(const a of t)n[a]=r[a]!==void 0?r[a]:e[a];return n};var mr=(e,r)=>{const t=e.__vccOpts||e;for(const[n,a]of r)t[n]=a;return t};const GN=cr({size:{type:Ue([Number,String])},color:{type:String}}),WN=d.defineComponent({name:"ElIcon",inheritAttrs:!1}),jN=d.defineComponent({...WN,props:GN,setup(e){const r=e,t=fr("icon"),n=d.computed(()=>{const{size:a,color:i}=r;return!a&&!i?{}:{fontSize:Ut(a)?void 0:Ds(a),"--color":i}});return(a,i)=>(d.openBlock(),d.createElementBlock("i",d.mergeProps({class:d.unref(t).b(),style:d.unref(n)},a.$attrs),[d.renderSlot(a.$slots,"default")],16))}});var KN=mr(jN,[["__file","icon.vue"]]);const st=nt(KN),qs=Symbol("formContextKey"),zi=Symbol("formItemContextKey"),oa=(e,r={})=>{const t=d.ref(void 0),n=r.prop?t:jc("size"),a=r.global?t:RN(),i=r.form?{size:void 0}:d.inject(qs,void 0),o=r.formItem?{size:void 0}:d.inject(zi,void 0);return d.computed(()=>n.value||d.unref(e)||(o==null?void 0:o.size)||(i==null?void 0:i.size)||a.value||"")},Pi=e=>{const r=jc("disabled"),t=d.inject(qs,void 0);return d.computed(()=>r.value||d.unref(e)||(t==null?void 0:t.disabled)||!1)},ja=()=>{const e=d.inject(qs,void 0),r=d.inject(zi,void 0);return{form:e,formItem:r}},Ls=(e,{formItemContext:r,disableIdGeneration:t,disableIdManagement:n})=>{t||(t=d.ref(!1)),n||(n=d.ref(!1));const a=d.ref();let i;const o=d.computed(()=>{var l;return!!(!(e.label||e.ariaLabel)&&r&&r.inputIds&&((l=r.inputIds)==null?void 0:l.length)<=1)});return d.onMounted(()=>{i=d.watch([d.toRef(e,"id"),t],([l,u])=>{const s=l??(u?void 0:Ii().value);s!==a.value&&(r!=null&&r.removeInputId&&(a.value&&r.removeInputId(a.value),!(n!=null&&n.value)&&!u&&s&&r.addInputId(s)),a.value=s)},{immediate:!0})}),d.onUnmounted(()=>{i&&i(),r!=null&&r.removeInputId&&a.value&&r.removeInputId(a.value)}),{isLabeledByFormItem:o,inputId:a}};let vt;const JN=` height:0 !important; visibility:hidden !important; ${Zy()?"":"overflow:hidden !important;"} position:absolute !important; z-index:-1000 !important; top:0 !important; right:0 !important; `,YN=["letter-spacing","line-height","padding-top","padding-bottom","font-family","font-weight","font-size","text-rendering","text-transform","width","text-indent","padding-left","padding-right","border-width","box-sizing"];function XN(e){const r=window.getComputedStyle(e),t=r.getPropertyValue("box-sizing"),n=Number.parseFloat(r.getPropertyValue("padding-bottom"))+Number.parseFloat(r.getPropertyValue("padding-top")),a=Number.parseFloat(r.getPropertyValue("border-bottom-width"))+Number.parseFloat(r.getPropertyValue("border-top-width"));return{contextStyle:YN.map(o=>`${o}:${r.getPropertyValue(o)}`).join(";"),paddingSize:n,borderSize:a,boxSizing:t}}function Of(e,r=1,t){var n;vt||(vt=document.createElement("textarea"),document.body.appendChild(vt));const{paddingSize:a,borderSize:i,boxSizing:o,contextStyle:l}=XN(e);vt.setAttribute("style",`${l};${JN}`),vt.value=e.value||e.placeholder||"";let u=vt.scrollHeight;const s={};o==="border-box"?u=u+i:o==="content-box"&&(u=u-a),vt.value="";const c=vt.scrollHeight-a;if(lr(r)){let f=c*r;o==="border-box"&&(f=f+a+i),u=Math.max(f,u),s.minHeight=`${f}px`}if(lr(t)){let f=c*t;o==="border-box"&&(f=f+a+i),u=Math.min(f,u)}return s.height=`${u}px`,(n=vt.parentNode)==null||n.removeChild(vt),vt=void 0,s}const QN=cr({id:{type:String,default:void 0},size:ia,disabled:Boolean,modelValue:{type:Ue([String,Number,Object]),default:""},maxlength:{type:[String,Number]},minlength:{type:[String,Number]},type:{type:String,default:"text"},resize:{type:String,values:["none","both","horizontal","vertical"]},autosize:{type:Ue([Boolean,Object]),default:!1},autocomplete:{type:String,default:"off"},formatter:{type:Function},parser:{type:Function},placeholder:{type:String},form:{type:String},readonly:Boolean,clearable:Boolean,showPassword:Boolean,showWordLimit:Boolean,suffixIcon:{type:Kn},prefixIcon:{type:Kn},containerRole:{type:String,default:void 0},tabindex:{type:[String,Number],default:0},validateEvent:{type:Boolean,default:!0},inputStyle:{type:Ue([Object,Array,String]),default:()=>c2({})},autofocus:Boolean,rows:{type:Number,default:2},...$n(["ariaLabel"])}),eA={[gr]:e=>Jr(e),input:e=>Jr(e),change:e=>Jr(e),focus:e=>e instanceof FocusEvent,blur:e=>e instanceof FocusEvent,clear:()=>!0,mouseleave:e=>e instanceof MouseEvent,mouseenter:e=>e instanceof MouseEvent,keydown:e=>e instanceof Event,compositionstart:e=>e instanceof CompositionEvent,compositionupdate:e=>e instanceof CompositionEvent,compositionend:e=>e instanceof CompositionEvent},rA=d.defineComponent({name:"ElInput",inheritAttrs:!1}),tA=d.defineComponent({...rA,props:QN,emits:eA,setup(e,{expose:r,emit:t}){const n=e,a=d.useAttrs(),i=d.useSlots(),o=d.computed(()=>{const G={};return n.containerRole==="combobox"&&(G["aria-haspopup"]=a["aria-haspopup"],G["aria-owns"]=a["aria-owns"],G["aria-expanded"]=a["aria-expanded"]),G}),l=d.computed(()=>[n.type==="textarea"?w.b():h.b(),h.m(p.value),h.is("disabled",v.value),h.is("exceed",z.value),{[h.b("group")]:i.prepend||i.append,[h.m("prefix")]:i.prefix||n.prefixIcon,[h.m("suffix")]:i.suffix||n.suffixIcon||n.clearable||n.showPassword,[h.bm("suffix","password-clear")]:O.value&&W.value,[h.b("hidden")]:n.type==="hidden"},a.class]),u=d.computed(()=>[h.e("wrapper"),h.is("focus",E.value)]),s=d2({excludeKeys:d.computed(()=>Object.keys(o.value))}),{form:c,formItem:f}=ja(),{inputId:m}=Ls(n,{formItemContext:f}),p=oa(),v=Pi(),h=fr("input"),w=fr("textarea"),b=d.shallowRef(),A=d.shallowRef(),g=d.ref(!1),N=d.ref(!1),x=d.ref(),y=d.shallowRef(n.inputStyle),D=d.computed(()=>b.value||A.value),{wrapperRef:S,isFocused:E,handleFocus:C,handleBlur:_}=_f(D,{beforeFocus(){return v.value},afterBlur(){var G;n.validateEvent&&((G=f==null?void 0:f.validate)==null||G.call(f,"blur").catch(ae=>hr(ae)))}}),F=d.computed(()=>{var G;return(G=c==null?void 0:c.statusIcon)!=null?G:!1}),I=d.computed(()=>(f==null?void 0:f.validateState)||""),R=d.computed(()=>I.value&&Hc[I.value]),$=d.computed(()=>N.value?s2:e2),M=d.computed(()=>[a.style]),T=d.computed(()=>[n.inputStyle,y.value,{resize:n.resize}]),k=d.computed(()=>Vt(n.modelValue)?"":String(n.modelValue)),O=d.computed(()=>n.clearable&&!v.value&&!n.readonly&&!!k.value&&(E.value||g.value)),W=d.computed(()=>n.showPassword&&!v.value&&!n.readonly&&!!k.value&&(!!k.value||E.value)),X=d.computed(()=>n.showWordLimit&&!!n.maxlength&&(n.type==="text"||n.type==="textarea")&&!v.value&&!n.readonly&&!n.showPassword),U=d.computed(()=>k.value.length),z=d.computed(()=>!!X.value&&U.value>Number(n.maxlength)),Q=d.computed(()=>!!i.suffix||!!n.suffixIcon||O.value||n.showPassword||X.value||!!I.value&&F.value),[se,re]=IN(b);zt(A,G=>{if(j(),!X.value||n.resize!=="both")return;const ae=G[0],{width:ce}=ae.contentRect;x.value={right:`calc(100% - ${ce+15+6}px)`}});const q=()=>{const{type:G,autosize:ae}=n;if(!(!yr||G!=="textarea"||!A.value))if(ae){const ce=Ur(ae)?ae.minRows:void 0,fe=Ur(ae)?ae.maxRows:void 0,xe=Of(A.value,ce,fe);y.value={overflowY:"hidden",...xe},d.nextTick(()=>{A.value.offsetHeight,y.value=xe})}else y.value={minHeight:Of(A.value).minHeight}},j=(G=>{let ae=!1;return()=>{var ce;if(ae||!n.autosize)return;((ce=A.value)==null?void 0:ce.offsetParent)===null||(G(),ae=!0)}})(q),Y=()=>{const G=D.value,ae=n.formatter?n.formatter(k.value):k.value;!G||G.value===ae||(G.value=ae)},ee=async G=>{se();let{value:ae}=G.target;if(n.formatter&&(ae=n.parser?n.parser(ae):ae),!oe.value){if(ae===k.value){Y();return}t(gr,ae),t("input",ae),await d.nextTick(),Y(),re()}},te=G=>{t("change",G.target.value)},{isComposing:oe,handleCompositionStart:ve,handleCompositionUpdate:L,handleCompositionEnd:H}=Tf({emit:t,afterComposition:ee}),ne=()=>{N.value=!N.value,ie()},ie=async()=>{var G;await d.nextTick(),(G=D.value)==null||G.focus()},de=()=>{var G;return(G=D.value)==null?void 0:G.blur()},me=G=>{g.value=!1,t("mouseleave",G)},be=G=>{g.value=!0,t("mouseenter",G)},Ne=G=>{t("keydown",G)},V=()=>{var G;(G=D.value)==null||G.select()},K=()=>{t(gr,""),t("change",""),t("clear"),t("input","")};return d.watch(()=>n.modelValue,()=>{var G;d.nextTick(()=>q()),n.validateEvent&&((G=f==null?void 0:f.validate)==null||G.call(f,"change").catch(ae=>hr(ae)))}),d.watch(k,()=>Y()),d.watch(()=>n.type,async()=>{await d.nextTick(),Y(),q()}),d.onMounted(()=>{!n.formatter&&n.parser&&hr("ElInput","If you set the parser, you also need to set the formatter."),Y(),d.nextTick(q)}),r({input:b,textarea:A,ref:D,textareaStyle:T,autosize:d.toRef(n,"autosize"),isComposing:oe,focus:ie,blur:de,select:V,clear:K,resizeTextarea:q}),(G,ae)=>(d.openBlock(),d.createElementBlock("div",d.mergeProps(d.unref(o),{class:[d.unref(l),{[d.unref(h).bm("group","append")]:G.$slots.append,[d.unref(h).bm("group","prepend")]:G.$slots.prepend}],style:d.unref(M),role:G.containerRole,onMouseenter:be,onMouseleave:me}),[d.createCommentVNode(" input "),G.type!=="textarea"?(d.openBlock(),d.createElementBlock(d.Fragment,{key:0},[d.createCommentVNode(" prepend slot "),G.$slots.prepend?(d.openBlock(),d.createElementBlock("div",{key:0,class:d.normalizeClass(d.unref(h).be("group","prepend"))},[d.renderSlot(G.$slots,"prepend")],2)):d.createCommentVNode("v-if",!0),d.createElementVNode("div",{ref_key:"wrapperRef",ref:S,class:d.normalizeClass(d.unref(u))},[d.createCommentVNode(" prefix slot "),G.$slots.prefix||G.prefixIcon?(d.openBlock(),d.createElementBlock("span",{key:0,class:d.normalizeClass(d.unref(h).e("prefix"))},[d.createElementVNode("span",{class:d.normalizeClass(d.unref(h).e("prefix-inner"))},[d.renderSlot(G.$slots,"prefix"),G.prefixIcon?(d.openBlock(),d.createBlock(d.unref(st),{key:0,class:d.normalizeClass(d.unref(h).e("icon"))},{default:d.withCtx(()=>[(d.openBlock(),d.createBlock(d.resolveDynamicComponent(G.prefixIcon)))]),_:1},8,["class"])):d.createCommentVNode("v-if",!0)],2)],2)):d.createCommentVNode("v-if",!0),d.createElementVNode("input",d.mergeProps({id:d.unref(m),ref_key:"input",ref:b,class:d.unref(h).e("inner")},d.unref(s),{minlength:G.minlength,maxlength:G.maxlength,type:G.showPassword?N.value?"text":"password":G.type,disabled:d.unref(v),readonly:G.readonly,autocomplete:G.autocomplete,tabindex:G.tabindex,"aria-label":G.ariaLabel,placeholder:G.placeholder,style:G.inputStyle,form:G.form,autofocus:G.autofocus,onCompositionstart:d.unref(ve),onCompositionupdate:d.unref(L),onCompositionend:d.unref(H),onInput:ee,onChange:te,onKeydown:Ne}),null,16,["id","minlength","maxlength","type","disabled","readonly","autocomplete","tabindex","aria-label","placeholder","form","autofocus","onCompositionstart","onCompositionupdate","onCompositionend"]),d.createCommentVNode(" suffix slot "),d.unref(Q)?(d.openBlock(),d.createElementBlock("span",{key:1,class:d.normalizeClass(d.unref(h).e("suffix"))},[d.createElementVNode("span",{class:d.normalizeClass(d.unref(h).e("suffix-inner"))},[!d.unref(O)||!d.unref(W)||!d.unref(X)?(d.openBlock(),d.createElementBlock(d.Fragment,{key:0},[d.renderSlot(G.$slots,"suffix"),G.suffixIcon?(d.openBlock(),d.createBlock(d.unref(st),{key:0,class:d.normalizeClass(d.unref(h).e("icon"))},{default:d.withCtx(()=>[(d.openBlock(),d.createBlock(d.resolveDynamicComponent(G.suffixIcon)))]),_:1},8,["class"])):d.createCommentVNode("v-if",!0)],64)):d.createCommentVNode("v-if",!0),d.unref(O)?(d.openBlock(),d.createBlock(d.unref(st),{key:1,class:d.normalizeClass([d.unref(h).e("icon"),d.unref(h).e("clear")]),onMousedown:d.withModifiers(d.unref($a),["prevent"]),onClick:K},{default:d.withCtx(()=>[d.createVNode(d.unref(Ss))]),_:1},8,["class","onMousedown"])):d.createCommentVNode("v-if",!0),d.unref(W)?(d.openBlock(),d.createBlock(d.unref(st),{key:2,class:d.normalizeClass([d.unref(h).e("icon"),d.unref(h).e("password")]),onClick:ne},{default:d.withCtx(()=>[(d.openBlock(),d.createBlock(d.resolveDynamicComponent(d.unref($))))]),_:1},8,["class"])):d.createCommentVNode("v-if",!0),d.unref(X)?(d.openBlock(),d.createElementBlock("span",{key:3,class:d.normalizeClass(d.unref(h).e("count"))},[d.createElementVNode("span",{class:d.normalizeClass(d.unref(h).e("count-inner"))},d.toDisplayString(d.unref(U))+" / "+d.toDisplayString(G.maxlength),3)],2)):d.createCommentVNode("v-if",!0),d.unref(I)&&d.unref(R)&&d.unref(F)?(d.openBlock(),d.createBlock(d.unref(st),{key:4,class:d.normalizeClass([d.unref(h).e("icon"),d.unref(h).e("validateIcon"),d.unref(h).is("loading",d.unref(I)==="validating")])},{default:d.withCtx(()=>[(d.openBlock(),d.createBlock(d.resolveDynamicComponent(d.unref(R))))]),_:1},8,["class"])):d.createCommentVNode("v-if",!0)],2)],2)):d.createCommentVNode("v-if",!0)],2),d.createCommentVNode(" append slot "),G.$slots.append?(d.openBlock(),d.createElementBlock("div",{key:1,class:d.normalizeClass(d.unref(h).be("group","append"))},[d.renderSlot(G.$slots,"append")],2)):d.createCommentVNode("v-if",!0)],64)):(d.openBlock(),d.createElementBlock(d.Fragment,{key:1},[d.createCommentVNode(" textarea "),d.createElementVNode("textarea",d.mergeProps({id:d.unref(m),ref_key:"textarea",ref:A,class:[d.unref(w).e("inner"),d.unref(h).is("focus",d.unref(E))]},d.unref(s),{minlength:G.minlength,maxlength:G.maxlength,tabindex:G.tabindex,disabled:d.unref(v),readonly:G.readonly,autocomplete:G.autocomplete,style:d.unref(T),"aria-label":G.ariaLabel,placeholder:G.placeholder,form:G.form,autofocus:G.autofocus,rows:G.rows,onCompositionstart:d.unref(ve),onCompositionupdate:d.unref(L),onCompositionend:d.unref(H),onInput:ee,onFocus:d.unref(C),onBlur:d.unref(_),onChange:te,onKeydown:Ne}),null,16,["id","minlength","maxlength","tabindex","disabled","readonly","autocomplete","aria-label","placeholder","form","autofocus","rows","onCompositionstart","onCompositionupdate","onCompositionend","onFocus","onBlur"]),d.unref(X)?(d.openBlock(),d.createElementBlock("span",{key:0,style:d.normalizeStyle(x.value),class:d.normalizeClass(d.unref(h).e("count"))},d.toDisplayString(d.unref(U))+" / "+d.toDisplayString(G.maxlength),7)):d.createCommentVNode("v-if",!0)],64))],16,["role"]))}});var nA=mr(tA,[["__file","input.vue"]]);const aA=nt(nA),sa=4,iA={vertical:{offset:"offsetHeight",scroll:"scrollTop",scrollSize:"scrollHeight",size:"height",key:"vertical",axis:"Y",client:"clientY",direction:"top"},horizontal:{offset:"offsetWidth",scroll:"scrollLeft",scrollSize:"scrollWidth",size:"width",key:"horizontal",axis:"X",client:"clientX",direction:"left"}},oA=({move:e,size:r,bar:t})=>({[t.size]:r,transform:`translate${t.axis}(${e}%)`}),Vs=Symbol("scrollbarContextKey"),sA=cr({vertical:Boolean,size:String,move:Number,ratio:{type:Number,required:!0},always:Boolean}),uA="Thumb";var $f=mr(d.defineComponent({__name:"thumb",props:sA,setup(e){const r=e,t=d.inject(Vs),n=fr("scrollbar");t||Es(uA,"can not inject scrollbar context");const a=d.ref(),i=d.ref(),o=d.ref({}),l=d.ref(!1);let u=!1,s=!1,c=yr?document.onselectstart:null;const f=d.computed(()=>iA[r.vertical?"vertical":"horizontal"]),m=d.computed(()=>oA({size:r.size,move:r.move,bar:f.value})),p=d.computed(()=>a.value[f.value.offset]**2/t.wrapElement[f.value.scrollSize]/r.ratio/i.value[f.value.offset]),v=y=>{var D;if(y.stopPropagation(),y.ctrlKey||[1,2].includes(y.button))return;(D=window.getSelection())==null||D.removeAllRanges(),w(y);const S=y.currentTarget;S&&(o.value[f.value.axis]=S[f.value.offset]-(y[f.value.client]-S.getBoundingClientRect()[f.value.direction]))},h=y=>{if(!i.value||!a.value||!t.wrapElement)return;const D=Math.abs(y.target.getBoundingClientRect()[f.value.direction]-y[f.value.client]),S=i.value[f.value.offset]/2,E=(D-S)*100*p.value/a.value[f.value.offset];t.wrapElement[f.value.scroll]=E*t.wrapElement[f.value.scrollSize]/100},w=y=>{y.stopImmediatePropagation(),u=!0,document.addEventListener("mousemove",b),document.addEventListener("mouseup",A),c=document.onselectstart,document.onselectstart=()=>!1},b=y=>{if(!a.value||!i.value||u===!1)return;const D=o.value[f.value.axis];if(!D)return;const S=(a.value.getBoundingClientRect()[f.value.direction]-y[f.value.client])*-1,E=i.value[f.value.offset]-D,C=(S-E)*100*p.value/a.value[f.value.offset];t.wrapElement[f.value.scroll]=C*t.wrapElement[f.value.scrollSize]/100},A=()=>{u=!1,o.value[f.value.axis]=0,document.removeEventListener("mousemove",b),document.removeEventListener("mouseup",A),x(),s&&(l.value=!1)},g=()=>{s=!1,l.value=!!r.size},N=()=>{s=!0,l.value=u};d.onBeforeUnmount(()=>{x(),document.removeEventListener("mouseup",A)});const x=()=>{document.onselectstart!==c&&(document.onselectstart=c)};return zr(d.toRef(t,"scrollbarElement"),"mousemove",g),zr(d.toRef(t,"scrollbarElement"),"mouseleave",N),(y,D)=>(d.openBlock(),d.createBlock(d.Transition,{name:d.unref(n).b("fade"),persisted:""},{default:d.withCtx(()=>[d.withDirectives(d.createElementVNode("div",{ref_key:"instance",ref:a,class:d.normalizeClass([d.unref(n).e("bar"),d.unref(n).is(d.unref(f).key)]),onMousedown:h},[d.createElementVNode("div",{ref_key:"thumb",ref:i,class:d.normalizeClass(d.unref(n).e("thumb")),style:d.normalizeStyle(d.unref(m)),onMousedown:v},null,38)],34),[[d.vShow,y.always||l.value]])]),_:1},8,["name"]))}}),[["__file","thumb.vue"]]);const lA=cr({always:{type:Boolean,default:!0},minSize:{type:Number,required:!0}});var cA=mr(d.defineComponent({__name:"bar",props:lA,setup(e,{expose:r}){const t=e,n=d.inject(Vs),a=d.ref(0),i=d.ref(0),o=d.ref(""),l=d.ref(""),u=d.ref(1),s=d.ref(1);return r({handleScroll:m=>{if(m){const p=m.offsetHeight-sa,v=m.offsetWidth-sa;i.value=m.scrollTop*100/p*u.value,a.value=m.scrollLeft*100/v*s.value}},update:()=>{const m=n==null?void 0:n.wrapElement;if(!m)return;const p=m.offsetHeight-sa,v=m.offsetWidth-sa,h=p**2/m.scrollHeight,w=v**2/m.scrollWidth,b=Math.max(h,t.minSize),A=Math.max(w,t.minSize);u.value=h/(p-h)/(b/(p-b)),s.value=w/(v-w)/(A/(v-A)),l.value=b+sa(d.openBlock(),d.createElementBlock(d.Fragment,null,[d.createVNode($f,{move:a.value,ratio:s.value,size:o.value,always:m.always},null,8,["move","ratio","size","always"]),d.createVNode($f,{move:i.value,ratio:u.value,size:l.value,vertical:"",always:m.always},null,8,["move","ratio","size","always"])],64))}}),[["__file","bar.vue"]]);const fA=cr({height:{type:[String,Number],default:""},maxHeight:{type:[String,Number],default:""},native:{type:Boolean,default:!1},wrapStyle:{type:Ue([String,Object,Array]),default:""},wrapClass:{type:[String,Array],default:""},viewClass:{type:[String,Array],default:""},viewStyle:{type:[String,Array,Object],default:""},noresize:Boolean,tag:{type:String,default:"div"},always:Boolean,minSize:{type:Number,default:20},tabindex:{type:[String,Number],default:void 0},id:String,role:String,...$n(["ariaLabel","ariaOrientation"])}),mA={scroll:({scrollTop:e,scrollLeft:r})=>[e,r].every(lr)},Us="ElScrollbar",dA=d.defineComponent({name:Us}),pA=d.defineComponent({...dA,props:fA,emits:mA,setup(e,{expose:r,emit:t}){const n=e,a=fr("scrollbar");let i,o,l=0,u=0;const s=d.ref(),c=d.ref(),f=d.ref(),m=d.ref(),p=d.computed(()=>{const x={};return n.height&&(x.height=Ds(n.height)),n.maxHeight&&(x.maxHeight=Ds(n.maxHeight)),[n.wrapStyle,x]}),v=d.computed(()=>[n.wrapClass,a.e("wrap"),{[a.em("wrap","hidden-default")]:!n.native}]),h=d.computed(()=>[a.e("view"),n.viewClass]),w=()=>{var x;c.value&&((x=m.value)==null||x.handleScroll(c.value),l=c.value.scrollTop,u=c.value.scrollLeft,t("scroll",{scrollTop:c.value.scrollTop,scrollLeft:c.value.scrollLeft}))};function b(x,y){Ur(x)?c.value.scrollTo(x):lr(x)&&lr(y)&&c.value.scrollTo(x,y)}const A=x=>{if(!lr(x)){hr(Us,"value must be a number");return}c.value.scrollTop=x},g=x=>{if(!lr(x)){hr(Us,"value must be a number");return}c.value.scrollLeft=x},N=()=>{var x;(x=m.value)==null||x.update()};return d.watch(()=>n.noresize,x=>{x?(i==null||i(),o==null||o()):({stop:i}=zt(f,N),o=zr("resize",N))},{immediate:!0}),d.watch(()=>[n.maxHeight,n.height],()=>{n.native||d.nextTick(()=>{var x;N(),c.value&&((x=m.value)==null||x.handleScroll(c.value))})}),d.provide(Vs,d.reactive({scrollbarElement:s,wrapElement:c})),d.onActivated(()=>{c.value&&(c.value.scrollTop=l,c.value.scrollLeft=u)}),d.onMounted(()=>{n.native||d.nextTick(()=>{N()})}),d.onUpdated(()=>N()),r({wrapRef:c,update:N,scrollTo:b,setScrollTop:A,setScrollLeft:g,handleScroll:w}),(x,y)=>(d.openBlock(),d.createElementBlock("div",{ref_key:"scrollbarRef",ref:s,class:d.normalizeClass(d.unref(a).b())},[d.createElementVNode("div",{ref_key:"wrapRef",ref:c,class:d.normalizeClass(d.unref(v)),style:d.normalizeStyle(d.unref(p)),tabindex:x.tabindex,onScroll:w},[(d.openBlock(),d.createBlock(d.resolveDynamicComponent(x.tag),{id:x.id,ref_key:"resizeRef",ref:f,class:d.normalizeClass(d.unref(h)),style:d.normalizeStyle(x.viewStyle),role:x.role,"aria-label":x.ariaLabel,"aria-orientation":x.ariaOrientation},{default:d.withCtx(()=>[d.renderSlot(x.$slots,"default")]),_:3},8,["id","class","style","role","aria-label","aria-orientation"]))],46,["tabindex"]),x.native?d.createCommentVNode("v-if",!0):(d.openBlock(),d.createBlock(cA,{key:0,ref_key:"barRef",ref:m,always:x.always,"min-size":x.minSize},null,8,["always","min-size"]))],2))}});var vA=mr(pA,[["__file","scrollbar.vue"]]);const hA=nt(vA),Hs=Symbol("popper"),If=Symbol("popperContent"),Rf=cr({role:{type:String,values:["dialog","grid","group","listbox","menu","navigation","tooltip","tree"],default:"tooltip"}}),gA=d.defineComponent({name:"ElPopper",inheritAttrs:!1}),yA=d.defineComponent({...gA,props:Rf,setup(e,{expose:r}){const t=e,n=d.ref(),a=d.ref(),i=d.ref(),o=d.ref(),l=d.computed(()=>t.role),u={triggerRef:n,popperInstanceRef:a,contentRef:i,referenceRef:o,role:l};return r(u),d.provide(Hs,u),(s,c)=>d.renderSlot(s.$slots,"default")}});var bA=mr(yA,[["__file","popper.vue"]]);const zf=cr({arrowOffset:{type:Number,default:5}}),wA=d.defineComponent({name:"ElPopperArrow",inheritAttrs:!1}),xA=d.defineComponent({...wA,props:zf,setup(e,{expose:r}){const t=e,n=fr("popper"),{arrowOffset:a,arrowRef:i,arrowStyle:o}=d.inject(If,void 0);return d.watch(()=>t.arrowOffset,l=>{a.value=l}),d.onBeforeUnmount(()=>{i.value=void 0}),r({arrowRef:i}),(l,u)=>(d.openBlock(),d.createElementBlock("span",{ref_key:"arrowRef",ref:i,class:d.normalizeClass(d.unref(n).e("arrow")),style:d.normalizeStyle(d.unref(o)),"data-popper-arrow":""},null,6))}});var NA=mr(xA,[["__file","arrow.vue"]]);const Zs="ElOnlyChild",AA=d.defineComponent({name:Zs,setup(e,{slots:r,attrs:t}){var n;const a=d.inject(xf),i=$N((n=a==null?void 0:a.setForwardRef)!=null?n:$a);return()=>{var o;const l=(o=r.default)==null?void 0:o.call(r,t);if(!l)return null;if(l.length>1)return hr(Zs,"requires exact only one valid child."),null;const u=Pf(l);return u?d.withDirectives(d.cloneVNode(u,t),[[i]]):(hr(Zs,"no valid child node found"),null)}}});function Pf(e){if(!e)return null;const r=e;for(const t of r){if(Ur(t))switch(t.type){case d.Comment:continue;case d.Text:case"svg":return kf(t);case d.Fragment:return Pf(t.children);default:return t}return kf(t)}return null}function kf(e){const r=fr("only-child");return d.createVNode("span",{class:r.e("content")},[e])}const qf=cr({virtualRef:{type:Ue(Object)},virtualTriggering:Boolean,onMouseenter:{type:Ue(Function)},onMouseleave:{type:Ue(Function)},onClick:{type:Ue(Function)},onKeydown:{type:Ue(Function)},onFocus:{type:Ue(Function)},onBlur:{type:Ue(Function)},onContextmenu:{type:Ue(Function)},id:String,open:Boolean}),EA=d.defineComponent({name:"ElPopperTrigger",inheritAttrs:!1}),DA=d.defineComponent({...EA,props:qf,setup(e,{expose:r}){const t=e,{role:n,triggerRef:a}=d.inject(Hs,void 0);ON(a);const i=d.computed(()=>l.value?t.id:void 0),o=d.computed(()=>{if(n&&n.value==="tooltip")return t.open&&t.id?t.id:void 0}),l=d.computed(()=>{if(n&&n.value!=="tooltip")return n.value}),u=d.computed(()=>l.value?`${t.open}`:void 0);let s;const c=["onMouseenter","onMouseleave","onClick","onKeydown","onFocus","onBlur","onContextmenu"];return d.onMounted(()=>{d.watch(()=>t.virtualRef,f=>{f&&(a.value=Rt(f))},{immediate:!0}),d.watch(a,(f,m)=>{s==null||s(),s=void 0,Tn(f)&&(c.forEach(p=>{var v;const h=t[p];h&&(f.addEventListener(p.slice(2).toLowerCase(),h),(v=m==null?void 0:m.removeEventListener)==null||v.call(m,p.slice(2).toLowerCase(),h))}),s=d.watch([i,o,l,u],p=>{["aria-controls","aria-describedby","aria-haspopup","aria-expanded"].forEach((v,h)=>{Vt(p[h])?f.removeAttribute(v):f.setAttribute(v,p[h])})},{immediate:!0})),Tn(m)&&["aria-controls","aria-describedby","aria-haspopup","aria-expanded"].forEach(p=>m.removeAttribute(p))},{immediate:!0})}),d.onBeforeUnmount(()=>{if(s==null||s(),s=void 0,a.value&&Tn(a.value)){const f=a.value;c.forEach(m=>{const p=t[m];p&&f.removeEventListener(m.slice(2).toLowerCase(),p)}),a.value=void 0}}),r({triggerRef:a}),(f,m)=>f.virtualTriggering?d.createCommentVNode("v-if",!0):(d.openBlock(),d.createBlock(d.unref(AA),d.mergeProps({key:0},f.$attrs,{"aria-controls":d.unref(i),"aria-describedby":d.unref(o),"aria-expanded":d.unref(u),"aria-haspopup":d.unref(l)}),{default:d.withCtx(()=>[d.renderSlot(f.$slots,"default")]),_:3},16,["aria-controls","aria-describedby","aria-expanded","aria-haspopup"]))}});var SA=mr(DA,[["__file","trigger.vue"]]);const Gs="focus-trap.focus-after-trapped",Ws="focus-trap.focus-after-released",CA="focus-trap.focusout-prevented",Lf={cancelable:!0,bubbles:!1},MA={cancelable:!0,bubbles:!1},Vf="focusAfterTrapped",Uf="focusAfterReleased",_A=Symbol("elFocusTrap"),js=d.ref(),ki=d.ref(0),Ks=d.ref(0);let qi=0;const Hf=e=>{const r=[],t=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:n=>{const a=n.tagName==="INPUT"&&n.type==="hidden";return n.disabled||n.hidden||a?NodeFilter.FILTER_SKIP:n.tabIndex>=0||n===document.activeElement?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;t.nextNode();)r.push(t.currentNode);return r},Zf=(e,r)=>{for(const t of e)if(!TA(t,r))return t},TA=(e,r)=>{if(process.env.NODE_ENV==="test")return!1;if(getComputedStyle(e).visibility==="hidden")return!0;for(;e;){if(r&&e===r)return!1;if(getComputedStyle(e).display==="none")return!0;e=e.parentElement}return!1},FA=e=>{const r=Hf(e),t=Zf(r,e),n=Zf(r.reverse(),e);return[t,n]},BA=e=>e instanceof HTMLInputElement&&"select"in e,on=(e,r)=>{if(e&&e.focus){const t=document.activeElement;e.focus({preventScroll:!0}),Ks.value=window.performance.now(),e!==t&&BA(e)&&r&&e.select()}};function Gf(e,r){const t=[...e],n=e.indexOf(r);return n!==-1&&t.splice(n,1),t}const OA=()=>{let e=[];return{push:n=>{const a=e[0];a&&n!==a&&a.pause(),e=Gf(e,n),e.unshift(n)},remove:n=>{var a,i;e=Gf(e,n),(i=(a=e[0])==null?void 0:a.resume)==null||i.call(a)}}},$A=(e,r=!1)=>{const t=document.activeElement;for(const n of e)if(on(n,r),document.activeElement!==t)return},Wf=OA(),IA=()=>ki.value>Ks.value,Li=()=>{js.value="pointer",ki.value=window.performance.now()},jf=()=>{js.value="keyboard",ki.value=window.performance.now()},RA=()=>(d.onMounted(()=>{qi===0&&(document.addEventListener("mousedown",Li),document.addEventListener("touchstart",Li),document.addEventListener("keydown",jf)),qi++}),d.onBeforeUnmount(()=>{qi--,qi<=0&&(document.removeEventListener("mousedown",Li),document.removeEventListener("touchstart",Li),document.removeEventListener("keydown",jf))}),{focusReason:js,lastUserFocusTimestamp:ki,lastAutomatedFocusTimestamp:Ks}),Vi=e=>new CustomEvent(CA,{...MA,detail:e}),zA=d.defineComponent({name:"ElFocusTrap",inheritAttrs:!1,props:{loop:Boolean,trapped:Boolean,focusTrapEl:Object,focusStartEl:{type:[Object,String],default:"first"}},emits:[Vf,Uf,"focusin","focusout","focusout-prevented","release-requested"],setup(e,{emit:r}){const t=d.ref();let n,a;const{focusReason:i}=RA();MN(v=>{e.trapped&&!o.paused&&r("release-requested",v)});const o={paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}},l=v=>{if(!e.loop&&!e.trapped||o.paused)return;const{key:h,altKey:w,ctrlKey:b,metaKey:A,currentTarget:g,shiftKey:N}=v,{loop:x}=e,y=h===Jn.tab&&!w&&!b&&!A,D=document.activeElement;if(y&&D){const S=g,[E,C]=FA(S);if(E&&C){if(!N&&D===C){const F=Vi({focusReason:i.value});r("focusout-prevented",F),F.defaultPrevented||(v.preventDefault(),x&&on(E,!0))}else if(N&&[E,S].includes(D)){const F=Vi({focusReason:i.value});r("focusout-prevented",F),F.defaultPrevented||(v.preventDefault(),x&&on(C,!0))}}else if(D===S){const F=Vi({focusReason:i.value});r("focusout-prevented",F),F.defaultPrevented||v.preventDefault()}}};d.provide(_A,{focusTrapRef:t,onKeydown:l}),d.watch(()=>e.focusTrapEl,v=>{v&&(t.value=v)},{immediate:!0}),d.watch([t],([v],[h])=>{v&&(v.addEventListener("keydown",l),v.addEventListener("focusin",c),v.addEventListener("focusout",f)),h&&(h.removeEventListener("keydown",l),h.removeEventListener("focusin",c),h.removeEventListener("focusout",f))});const u=v=>{r(Vf,v)},s=v=>r(Uf,v),c=v=>{const h=d.unref(t);if(!h)return;const w=v.target,b=v.relatedTarget,A=w&&h.contains(w);e.trapped||b&&h.contains(b)||(n=b),A&&r("focusin",v),!o.paused&&e.trapped&&(A?a=w:on(a,!0))},f=v=>{const h=d.unref(t);if(!(o.paused||!h))if(e.trapped){const w=v.relatedTarget;!Vt(w)&&!h.contains(w)&&setTimeout(()=>{if(!o.paused&&e.trapped){const b=Vi({focusReason:i.value});r("focusout-prevented",b),b.defaultPrevented||on(a,!0)}},0)}else{const w=v.target;w&&h.contains(w)||r("focusout",v)}};async function m(){await d.nextTick();const v=d.unref(t);if(v){Wf.push(o);const h=v.contains(document.activeElement)?n:document.activeElement;if(n=h,!v.contains(h)){const b=new Event(Gs,Lf);v.addEventListener(Gs,u),v.dispatchEvent(b),b.defaultPrevented||d.nextTick(()=>{let A=e.focusStartEl;Jr(A)||(on(A),document.activeElement!==A&&(A="first")),A==="first"&&$A(Hf(v),!0),(document.activeElement===h||A==="container")&&on(v)})}}}function p(){const v=d.unref(t);if(v){v.removeEventListener(Gs,u);const h=new CustomEvent(Ws,{...Lf,detail:{focusReason:i.value}});v.addEventListener(Ws,s),v.dispatchEvent(h),!h.defaultPrevented&&(i.value=="keyboard"||!IA()||v.contains(document.activeElement))&&on(n??document.body),v.removeEventListener(Ws,s),Wf.remove(o)}}return d.onMounted(()=>{e.trapped&&m(),d.watch(()=>e.trapped,v=>{v?m():p()})}),d.onBeforeUnmount(()=>{e.trapped&&p(),t.value&&(t.value.removeEventListener("keydown",l),t.value.removeEventListener("focusin",c),t.value.removeEventListener("focusout",f),t.value=void 0)}),{onKeydown:l}}});function PA(e,r,t,n,a,i){return d.renderSlot(e.$slots,"default",{handleKeydown:e.onKeydown})}var kA=mr(zA,[["render",PA],["__file","focus-trap.vue"]]);const qA=["fixed","absolute"],LA=cr({boundariesPadding:{type:Number,default:0},fallbackPlacements:{type:Ue(Array),default:void 0},gpuAcceleration:{type:Boolean,default:!0},offset:{type:Number,default:12},placement:{type:String,values:Qn,default:"bottom"},popperOptions:{type:Ue(Object),default:()=>({})},strategy:{type:String,values:qA,default:"absolute"}}),Kf=cr({...LA,id:String,style:{type:Ue([String,Array,Object])},className:{type:Ue([String,Array,Object])},effect:{type:Ue(String),default:"dark"},visible:Boolean,enterable:{type:Boolean,default:!0},pure:Boolean,focusOnShow:{type:Boolean,default:!1},trapping:{type:Boolean,default:!1},popperClass:{type:Ue([String,Array,Object])},popperStyle:{type:Ue([String,Array,Object])},referenceEl:{type:Ue(Object)},triggerTargetEl:{type:Ue(Object)},stopPopperMouseEvent:{type:Boolean,default:!0},virtualTriggering:Boolean,zIndex:Number,...$n(["ariaLabel"])}),VA={mouseenter:e=>e instanceof MouseEvent,mouseleave:e=>e instanceof MouseEvent,focus:()=>!0,blur:()=>!0,close:()=>!0},UA=(e,r=[])=>{const{placement:t,strategy:n,popperOptions:a}=e,i={placement:t,strategy:n,...a,modifiers:[...ZA(e),...r]};return GA(i,a==null?void 0:a.modifiers),i},HA=e=>{if(yr)return Rt(e)};function ZA(e){const{offset:r,gpuAcceleration:t,fallbackPlacements:n}=e;return[{name:"offset",options:{offset:[0,r??12]}},{name:"preventOverflow",options:{padding:{top:2,bottom:2,left:5,right:5}}},{name:"flip",options:{padding:5,fallbackPlacements:n}},{name:"computeStyles",options:{gpuAcceleration:t}}]}function GA(e,r){r&&(e.modifiers=[...e.modifiers,...r??[]])}const WA=0,jA=e=>{const{popperInstanceRef:r,contentRef:t,triggerRef:n,role:a}=d.inject(Hs,void 0),i=d.ref(),o=d.ref(),l=d.computed(()=>({name:"eventListeners",enabled:!!e.visible})),u=d.computed(()=>{var b;const A=d.unref(i),g=(b=d.unref(o))!=null?b:WA;return{name:"arrow",enabled:!zx(A),options:{element:A,padding:g}}}),s=d.computed(()=>({onFirstUpdate:()=>{v()},...UA(e,[d.unref(u),d.unref(l)])})),c=d.computed(()=>HA(e.referenceEl)||d.unref(n)),{attributes:f,state:m,styles:p,update:v,forceUpdate:h,instanceRef:w}=DN(c,t,s);return d.watch(w,b=>r.value=b),d.onMounted(()=>{d.watch(()=>{var b;return(b=d.unref(c))==null?void 0:b.getBoundingClientRect()},()=>{v()})}),{attributes:f,arrowRef:i,contentRef:t,instanceRef:w,state:m,styles:p,role:a,forceUpdate:h,update:v}},KA=(e,{attributes:r,styles:t,role:n})=>{const{nextZIndex:a}=Cf(),i=fr("popper"),o=d.computed(()=>d.unref(r).popper),l=d.ref(lr(e.zIndex)?e.zIndex:a()),u=d.computed(()=>[i.b(),i.is("pure",e.pure),i.is(e.effect),e.popperClass]),s=d.computed(()=>[{zIndex:d.unref(l)},d.unref(t).popper,e.popperStyle||{}]),c=d.computed(()=>n.value==="dialog"?"false":void 0),f=d.computed(()=>d.unref(t).arrow||{});return{ariaModal:c,arrowStyle:f,contentAttrs:o,contentClass:u,contentStyle:s,contentZIndex:l,updateZIndex:()=>{l.value=lr(e.zIndex)?e.zIndex:a()}}},JA=(e,r)=>{const t=d.ref(!1),n=d.ref();return{focusStartRef:n,trapped:t,onFocusAfterReleased:s=>{var c;((c=s.detail)==null?void 0:c.focusReason)!=="pointer"&&(n.value="first",r("blur"))},onFocusAfterTrapped:()=>{r("focus")},onFocusInTrap:s=>{e.visible&&!t.value&&(s.target&&(n.value=s.target),t.value=!0)},onFocusoutPrevented:s=>{e.trapping||(s.detail.focusReason==="pointer"&&s.preventDefault(),t.value=!1)},onReleaseRequested:()=>{t.value=!1,r("close")}}},YA=d.defineComponent({name:"ElPopperContent"}),XA=d.defineComponent({...YA,props:Kf,emits:VA,setup(e,{expose:r,emit:t}){const n=e,{focusStartRef:a,trapped:i,onFocusAfterReleased:o,onFocusAfterTrapped:l,onFocusInTrap:u,onFocusoutPrevented:s,onReleaseRequested:c}=JA(n,t),{attributes:f,arrowRef:m,contentRef:p,styles:v,instanceRef:h,role:w,update:b}=jA(n),{ariaModal:A,arrowStyle:g,contentAttrs:N,contentClass:x,contentStyle:y,updateZIndex:D}=KA(n,{styles:v,attributes:f,role:w}),S=d.inject(zi,void 0),E=d.ref();d.provide(If,{arrowStyle:g,arrowRef:m,arrowOffset:E}),S&&d.provide(zi,{...S,addInputId:$a,removeInputId:$a});let C;const _=(I=!0)=>{b(),I&&D()},F=()=>{_(!1),n.visible&&n.focusOnShow?i.value=!0:n.visible===!1&&(i.value=!1)};return d.onMounted(()=>{d.watch(()=>n.triggerTargetEl,(I,R)=>{C==null||C(),C=void 0;const $=d.unref(I||p.value),M=d.unref(R||p.value);Tn($)&&(C=d.watch([w,()=>n.ariaLabel,A,()=>n.id],T=>{["role","aria-label","aria-modal","id"].forEach((k,O)=>{Vt(T[O])?$.removeAttribute(k):$.setAttribute(k,T[O])})},{immediate:!0})),M!==$&&Tn(M)&&["role","aria-label","aria-modal","id"].forEach(T=>{M.removeAttribute(T)})},{immediate:!0}),d.watch(()=>n.visible,F,{immediate:!0})}),d.onBeforeUnmount(()=>{C==null||C(),C=void 0}),r({popperContentRef:p,popperInstanceRef:h,updatePopper:_,contentStyle:y}),(I,R)=>(d.openBlock(),d.createElementBlock("div",d.mergeProps({ref_key:"contentRef",ref:p},d.unref(N),{style:d.unref(y),class:d.unref(x),tabindex:"-1",onMouseenter:$=>I.$emit("mouseenter",$),onMouseleave:$=>I.$emit("mouseleave",$)}),[d.createVNode(d.unref(kA),{trapped:d.unref(i),"trap-on-focus-in":!0,"focus-trap-el":d.unref(p),"focus-start-el":d.unref(a),onFocusAfterTrapped:d.unref(l),onFocusAfterReleased:d.unref(o),onFocusin:d.unref(u),onFocusoutPrevented:d.unref(s),onReleaseRequested:d.unref(c)},{default:d.withCtx(()=>[d.renderSlot(I.$slots,"default")]),_:3},8,["trapped","focus-trap-el","focus-start-el","onFocusAfterTrapped","onFocusAfterReleased","onFocusin","onFocusoutPrevented","onReleaseRequested"])],16,["onMouseenter","onMouseleave"]))}});var QA=mr(XA,[["__file","content.vue"]]);const eE=nt(bA),Js=Symbol("elTooltip"),Ys=cr({...FN,...Kf,appendTo:{type:Ue([String,Object])},content:{type:String,default:""},rawContent:Boolean,persistent:Boolean,visible:{type:Ue(Boolean),default:null},transition:String,teleported:{type:Boolean,default:!0},disabled:Boolean,...$n(["ariaLabel"])}),Jf=cr({...qf,disabled:Boolean,trigger:{type:Ue([String,Array]),default:"hover"},triggerKeys:{type:Ue(Array),default:()=>[Jn.enter,Jn.space]}}),{useModelToggleProps:rE,useModelToggleEmits:tE,useModelToggle:nE}=N2("visible"),aE=cr({...Rf,...rE,...Ys,...Jf,...zf,showArrow:{type:Boolean,default:!0}}),iE=[...tE,"before-show","before-hide","show","hide","open","close"],oE=(e,r)=>Et(e)?e.includes(r):e===r,ua=(e,r,t)=>n=>{oE(d.unref(e),r)&&t(n)},sE=d.defineComponent({name:"ElTooltipTrigger"}),uE=d.defineComponent({...sE,props:Jf,setup(e,{expose:r}){const t=e,n=fr("tooltip"),{controlled:a,id:i,open:o,onOpen:l,onClose:u,onToggle:s}=d.inject(Js,void 0),c=d.ref(null),f=()=>{if(d.unref(a)||t.disabled)return!0},m=d.toRef(t,"trigger"),p=It(f,ua(m,"hover",l)),v=It(f,ua(m,"hover",u)),h=It(f,ua(m,"click",N=>{N.button===0&&s(N)})),w=It(f,ua(m,"focus",l)),b=It(f,ua(m,"focus",u)),A=It(f,ua(m,"contextmenu",N=>{N.preventDefault(),s(N)})),g=It(f,N=>{const{code:x}=N;t.triggerKeys.includes(x)&&(N.preventDefault(),s(N))});return r({triggerRef:c}),(N,x)=>(d.openBlock(),d.createBlock(d.unref(SA),{id:d.unref(i),"virtual-ref":N.virtualRef,open:d.unref(o),"virtual-triggering":N.virtualTriggering,class:d.normalizeClass(d.unref(n).e("trigger")),onBlur:d.unref(b),onClick:d.unref(h),onContextmenu:d.unref(A),onFocus:d.unref(w),onMouseenter:d.unref(p),onMouseleave:d.unref(v),onKeydown:d.unref(g)},{default:d.withCtx(()=>[d.renderSlot(N.$slots,"default")]),_:3},8,["id","virtual-ref","open","virtual-triggering","class","onBlur","onClick","onContextmenu","onFocus","onMouseenter","onMouseleave","onKeydown"]))}});var lE=mr(uE,[["__file","trigger.vue"]]);const cE=cr({to:{type:Ue([String,Object]),required:!0},disabled:Boolean});var fE=mr(d.defineComponent({__name:"teleport",props:cE,setup(e){return(r,t)=>r.disabled?d.renderSlot(r.$slots,"default",{key:0}):(d.openBlock(),d.createBlock(d.Teleport,{key:1,to:r.to},[d.renderSlot(r.$slots,"default")],8,["to"]))}}),[["__file","teleport.vue"]]);const mE=nt(fE),dE=d.defineComponent({name:"ElTooltipContent",inheritAttrs:!1}),pE=d.defineComponent({...dE,props:Ys,setup(e,{expose:r}){const t=e,{selector:n}=wf(),a=fr("tooltip"),i=d.ref(null);let o;const{controlled:l,id:u,open:s,trigger:c,onClose:f,onOpen:m,onShow:p,onHide:v,onBeforeShow:h,onBeforeHide:w}=d.inject(Js,void 0),b=d.computed(()=>t.transition||`${a.namespace.value}-fade-in-linear`),A=d.computed(()=>process.env.NODE_ENV==="test"?!0:t.persistent);d.onBeforeUnmount(()=>{o==null||o()});const g=d.computed(()=>d.unref(A)?!0:d.unref(s)),N=d.computed(()=>t.disabled?!1:d.unref(s)),x=d.computed(()=>t.appendTo||n.value),y=d.computed(()=>{var M;return(M=t.style)!=null?M:{}}),D=d.ref(!0),S=()=>{v(),D.value=!0},E=()=>{if(d.unref(l))return!0},C=It(E,()=>{t.enterable&&d.unref(c)==="hover"&&m()}),_=It(E,()=>{d.unref(c)==="hover"&&f()}),F=()=>{var M,T;(T=(M=i.value)==null?void 0:M.updatePopper)==null||T.call(M),h==null||h()},I=()=>{w==null||w()},R=()=>{p(),o=Oy(d.computed(()=>{var M;return(M=i.value)==null?void 0:M.popperContentRef}),()=>{if(d.unref(l))return;d.unref(c)!=="hover"&&f()})},$=()=>{t.virtualTriggering||f()};return d.watch(()=>d.unref(s),M=>{M?D.value=!1:o==null||o()},{flush:"post"}),d.watch(()=>t.content,()=>{var M,T;(T=(M=i.value)==null?void 0:M.updatePopper)==null||T.call(M)}),r({contentRef:i}),(M,T)=>(d.openBlock(),d.createBlock(d.unref(mE),{disabled:!M.teleported,to:d.unref(x)},{default:d.withCtx(()=>[d.createVNode(d.Transition,{name:d.unref(b),onAfterLeave:S,onBeforeEnter:F,onAfterEnter:R,onBeforeLeave:I},{default:d.withCtx(()=>[d.unref(g)?d.withDirectives((d.openBlock(),d.createBlock(d.unref(QA),d.mergeProps({key:0,id:d.unref(u),ref_key:"contentRef",ref:i},M.$attrs,{"aria-label":M.ariaLabel,"aria-hidden":D.value,"boundaries-padding":M.boundariesPadding,"fallback-placements":M.fallbackPlacements,"gpu-acceleration":M.gpuAcceleration,offset:M.offset,placement:M.placement,"popper-options":M.popperOptions,strategy:M.strategy,effect:M.effect,enterable:M.enterable,pure:M.pure,"popper-class":M.popperClass,"popper-style":[M.popperStyle,d.unref(y)],"reference-el":M.referenceEl,"trigger-target-el":M.triggerTargetEl,visible:d.unref(N),"z-index":M.zIndex,onMouseenter:d.unref(C),onMouseleave:d.unref(_),onBlur:$,onClose:d.unref(f)}),{default:d.withCtx(()=>[d.renderSlot(M.$slots,"default")]),_:3},16,["id","aria-label","aria-hidden","boundaries-padding","fallback-placements","gpu-acceleration","offset","placement","popper-options","strategy","effect","enterable","pure","popper-class","popper-style","reference-el","trigger-target-el","visible","z-index","onMouseenter","onMouseleave","onClose"])),[[d.vShow,d.unref(N)]]):d.createCommentVNode("v-if",!0)]),_:3},8,["name"])]),_:3},8,["disabled","to"]))}});var vE=mr(pE,[["__file","content.vue"]]);const hE=d.defineComponent({name:"ElTooltip"}),gE=d.defineComponent({...hE,props:aE,emits:iE,setup(e,{expose:r,emit:t}){const n=e;TN();const a=Ii(),i=d.ref(),o=d.ref(),l=()=>{var b;const A=d.unref(i);A&&((b=A.popperInstanceRef)==null||b.update())},u=d.ref(!1),s=d.ref(),{show:c,hide:f,hasUpdateHandler:m}=nE({indicator:u,toggleReason:s}),{onOpen:p,onClose:v}=BN({showAfter:d.toRef(n,"showAfter"),hideAfter:d.toRef(n,"hideAfter"),autoClose:d.toRef(n,"autoClose"),open:c,close:f}),h=d.computed(()=>Ic(n.visible)&&!m.value);d.provide(Js,{controlled:h,id:a,open:d.readonly(u),trigger:d.toRef(n,"trigger"),onOpen:b=>{p(b)},onClose:b=>{v(b)},onToggle:b=>{d.unref(u)?v(b):p(b)},onShow:()=>{t("show",s.value)},onHide:()=>{t("hide",s.value)},onBeforeShow:()=>{t("before-show",s.value)},onBeforeHide:()=>{t("before-hide",s.value)},updatePopper:l}),d.watch(()=>n.disabled,b=>{b&&u.value&&(u.value=!1)});const w=b=>{var A,g;const N=(g=(A=o.value)==null?void 0:A.contentRef)==null?void 0:g.popperContentRef,x=(b==null?void 0:b.relatedTarget)||document.activeElement;return N&&N.contains(x)};return d.onDeactivated(()=>u.value&&f()),r({popperRef:i,contentRef:o,isFocusInsideContent:w,updatePopper:l,onOpen:p,onClose:v,hide:f}),(b,A)=>(d.openBlock(),d.createBlock(d.unref(eE),{ref_key:"popperRef",ref:i,role:b.role},{default:d.withCtx(()=>[d.createVNode(lE,{disabled:b.disabled,trigger:b.trigger,"trigger-keys":b.triggerKeys,"virtual-ref":b.virtualRef,"virtual-triggering":b.virtualTriggering},{default:d.withCtx(()=>[b.$slots.default?d.renderSlot(b.$slots,"default",{key:0}):d.createCommentVNode("v-if",!0)]),_:3},8,["disabled","trigger","trigger-keys","virtual-ref","virtual-triggering"]),d.createVNode(vE,{ref_key:"contentRef",ref:o,"aria-label":b.ariaLabel,"boundaries-padding":b.boundariesPadding,content:b.content,disabled:b.disabled,effect:b.effect,enterable:b.enterable,"fallback-placements":b.fallbackPlacements,"hide-after":b.hideAfter,"gpu-acceleration":b.gpuAcceleration,offset:b.offset,persistent:b.persistent,"popper-class":b.popperClass,"popper-style":b.popperStyle,placement:b.placement,"popper-options":b.popperOptions,pure:b.pure,"raw-content":b.rawContent,"reference-el":b.referenceEl,"trigger-target-el":b.triggerTargetEl,"show-after":b.showAfter,strategy:b.strategy,teleported:b.teleported,transition:b.transition,"virtual-triggering":b.virtualTriggering,"z-index":b.zIndex,"append-to":b.appendTo},{default:d.withCtx(()=>[d.renderSlot(b.$slots,"content",{},()=>[b.rawContent?(d.openBlock(),d.createElementBlock("span",{key:0,innerHTML:b.content},null,8,["innerHTML"])):(d.openBlock(),d.createElementBlock("span",{key:1},d.toDisplayString(b.content),1))]),b.showArrow?(d.openBlock(),d.createBlock(d.unref(NA),{key:0,"arrow-offset":b.arrowOffset},null,8,["arrow-offset"])):d.createCommentVNode("v-if",!0)]),_:3},8,["aria-label","boundaries-padding","content","disabled","effect","enterable","fallback-placements","hide-after","gpu-acceleration","offset","persistent","popper-class","popper-style","placement","popper-options","pure","raw-content","reference-el","trigger-target-el","show-after","strategy","teleported","transition","virtual-triggering","z-index","append-to"])]),_:3},8,["role"]))}});var yE=mr(gE,[["__file","tooltip.vue"]]);const Yf=nt(yE),Xf=Symbol("buttonGroupContextKey"),bE=(e,r)=>{p2({from:"type.text",replacement:"link",version:"3.0.0",scope:"props",ref:"https://element-plus.org/en-US/component/button.html#button-attributes"},d.computed(()=>e.type==="text"));const t=d.inject(Xf,void 0),n=ks("button"),{form:a}=ja(),i=oa(d.computed(()=>t==null?void 0:t.size)),o=Pi(),l=d.ref(),u=d.useSlots(),s=d.computed(()=>e.type||(t==null?void 0:t.type)||""),c=d.computed(()=>{var v,h,w;return(w=(h=e.autoInsertSpace)!=null?h:(v=n.value)==null?void 0:v.autoInsertSpace)!=null?w:!1}),f=d.computed(()=>e.tag==="button"?{ariaDisabled:o.value||e.loading,disabled:o.value||e.loading,autofocus:e.autofocus,type:e.nativeType}:{}),m=d.computed(()=>{var v;const h=(v=u.default)==null?void 0:v.call(u);if(c.value&&(h==null?void 0:h.length)===1){const w=h[0];if((w==null?void 0:w.type)===d.Text){const b=w.children;return new RegExp("^\\p{Unified_Ideograph}{2}$","u").test(b.trim())}}return!1});return{_disabled:o,_size:i,_type:s,_ref:l,_props:f,shouldAddSpace:m,handleClick:v=>{if(o.value||e.loading){v.stopPropagation();return}e.nativeType==="reset"&&(a==null||a.resetFields()),r("click",v)}}},Xs=cr({size:ia,disabled:Boolean,type:{type:String,values:["default","primary","success","warning","info","danger","text",""],default:""},icon:{type:Kn},nativeType:{type:String,values:["button","submit","reset"],default:"button"},loading:Boolean,loadingIcon:{type:Kn,default:()=>Vc},plain:Boolean,text:Boolean,link:Boolean,bg:Boolean,autofocus:Boolean,round:Boolean,circle:Boolean,color:String,dark:Boolean,autoInsertSpace:{type:Boolean,default:void 0},tag:{type:Ue([String,Object]),default:"button"}}),wE={click:e=>e instanceof MouseEvent};function Sr(e,r){xE(e)&&(e="100%");var t=NE(e);return e=r===360?e:Math.min(r,Math.max(0,parseFloat(e))),t&&(e=parseInt(String(e*r),10)/100),Math.abs(e-r)<1e-6?1:(r===360?e=(e<0?e%r+r:e%r)/parseFloat(String(r)):e=e%r/parseFloat(String(r)),e)}function Ui(e){return Math.min(1,Math.max(0,e))}function xE(e){return typeof e=="string"&&e.indexOf(".")!==-1&&parseFloat(e)===1}function NE(e){return typeof e=="string"&&e.indexOf("%")!==-1}function Qf(e){return e=parseFloat(e),(isNaN(e)||e<0||e>1)&&(e=1),e}function Hi(e){return e<=1?"".concat(Number(e)*100,"%"):e}function In(e){return e.length===1?"0"+e:String(e)}function AE(e,r,t){return{r:Sr(e,255)*255,g:Sr(r,255)*255,b:Sr(t,255)*255}}function em(e,r,t){e=Sr(e,255),r=Sr(r,255),t=Sr(t,255);var n=Math.max(e,r,t),a=Math.min(e,r,t),i=0,o=0,l=(n+a)/2;if(n===a)o=0,i=0;else{var u=n-a;switch(o=l>.5?u/(2-n-a):u/(n+a),n){case e:i=(r-t)/u+(r1&&(t-=1),t<1/6?e+(r-e)*(6*t):t<1/2?r:t<2/3?e+(r-e)*(2/3-t)*6:e}function EE(e,r,t){var n,a,i;if(e=Sr(e,360),r=Sr(r,100),t=Sr(t,100),r===0)a=t,i=t,n=t;else{var o=t<.5?t*(1+r):t+r-t*r,l=2*t-o;n=Qs(l,o,e+1/3),a=Qs(l,o,e),i=Qs(l,o,e-1/3)}return{r:n*255,g:a*255,b:i*255}}function rm(e,r,t){e=Sr(e,255),r=Sr(r,255),t=Sr(t,255);var n=Math.max(e,r,t),a=Math.min(e,r,t),i=0,o=n,l=n-a,u=n===0?0:l/n;if(n===a)i=0;else{switch(n){case e:i=(r-t)/l+(r>16,g:(e&65280)>>8,b:e&255}}var eu={aliceblue:"#f0f8ff",antiquewhite:"#faebd7",aqua:"#00ffff",aquamarine:"#7fffd4",azure:"#f0ffff",beige:"#f5f5dc",bisque:"#ffe4c4",black:"#000000",blanchedalmond:"#ffebcd",blue:"#0000ff",blueviolet:"#8a2be2",brown:"#a52a2a",burlywood:"#deb887",cadetblue:"#5f9ea0",chartreuse:"#7fff00",chocolate:"#d2691e",coral:"#ff7f50",cornflowerblue:"#6495ed",cornsilk:"#fff8dc",crimson:"#dc143c",cyan:"#00ffff",darkblue:"#00008b",darkcyan:"#008b8b",darkgoldenrod:"#b8860b",darkgray:"#a9a9a9",darkgreen:"#006400",darkgrey:"#a9a9a9",darkkhaki:"#bdb76b",darkmagenta:"#8b008b",darkolivegreen:"#556b2f",darkorange:"#ff8c00",darkorchid:"#9932cc",darkred:"#8b0000",darksalmon:"#e9967a",darkseagreen:"#8fbc8f",darkslateblue:"#483d8b",darkslategray:"#2f4f4f",darkslategrey:"#2f4f4f",darkturquoise:"#00ced1",darkviolet:"#9400d3",deeppink:"#ff1493",deepskyblue:"#00bfff",dimgray:"#696969",dimgrey:"#696969",dodgerblue:"#1e90ff",firebrick:"#b22222",floralwhite:"#fffaf0",forestgreen:"#228b22",fuchsia:"#ff00ff",gainsboro:"#dcdcdc",ghostwhite:"#f8f8ff",goldenrod:"#daa520",gold:"#ffd700",gray:"#808080",green:"#008000",greenyellow:"#adff2f",grey:"#808080",honeydew:"#f0fff0",hotpink:"#ff69b4",indianred:"#cd5c5c",indigo:"#4b0082",ivory:"#fffff0",khaki:"#f0e68c",lavenderblush:"#fff0f5",lavender:"#e6e6fa",lawngreen:"#7cfc00",lemonchiffon:"#fffacd",lightblue:"#add8e6",lightcoral:"#f08080",lightcyan:"#e0ffff",lightgoldenrodyellow:"#fafad2",lightgray:"#d3d3d3",lightgreen:"#90ee90",lightgrey:"#d3d3d3",lightpink:"#ffb6c1",lightsalmon:"#ffa07a",lightseagreen:"#20b2aa",lightskyblue:"#87cefa",lightslategray:"#778899",lightslategrey:"#778899",lightsteelblue:"#b0c4de",lightyellow:"#ffffe0",lime:"#00ff00",limegreen:"#32cd32",linen:"#faf0e6",magenta:"#ff00ff",maroon:"#800000",mediumaquamarine:"#66cdaa",mediumblue:"#0000cd",mediumorchid:"#ba55d3",mediumpurple:"#9370db",mediumseagreen:"#3cb371",mediumslateblue:"#7b68ee",mediumspringgreen:"#00fa9a",mediumturquoise:"#48d1cc",mediumvioletred:"#c71585",midnightblue:"#191970",mintcream:"#f5fffa",mistyrose:"#ffe4e1",moccasin:"#ffe4b5",navajowhite:"#ffdead",navy:"#000080",oldlace:"#fdf5e6",olive:"#808000",olivedrab:"#6b8e23",orange:"#ffa500",orangered:"#ff4500",orchid:"#da70d6",palegoldenrod:"#eee8aa",palegreen:"#98fb98",paleturquoise:"#afeeee",palevioletred:"#db7093",papayawhip:"#ffefd5",peachpuff:"#ffdab9",peru:"#cd853f",pink:"#ffc0cb",plum:"#dda0dd",powderblue:"#b0e0e6",purple:"#800080",rebeccapurple:"#663399",red:"#ff0000",rosybrown:"#bc8f8f",royalblue:"#4169e1",saddlebrown:"#8b4513",salmon:"#fa8072",sandybrown:"#f4a460",seagreen:"#2e8b57",seashell:"#fff5ee",sienna:"#a0522d",silver:"#c0c0c0",skyblue:"#87ceeb",slateblue:"#6a5acd",slategray:"#708090",slategrey:"#708090",snow:"#fffafa",springgreen:"#00ff7f",steelblue:"#4682b4",tan:"#d2b48c",teal:"#008080",thistle:"#d8bfd8",tomato:"#ff6347",turquoise:"#40e0d0",violet:"#ee82ee",wheat:"#f5deb3",white:"#ffffff",whitesmoke:"#f5f5f5",yellow:"#ffff00",yellowgreen:"#9acd32"};function _E(e){var r={r:0,g:0,b:0},t=1,n=null,a=null,i=null,o=!1,l=!1;return typeof e=="string"&&(e=BE(e)),typeof e=="object"&&(Zt(e.r)&&Zt(e.g)&&Zt(e.b)?(r=AE(e.r,e.g,e.b),o=!0,l=String(e.r).substr(-1)==="%"?"prgb":"rgb"):Zt(e.h)&&Zt(e.s)&&Zt(e.v)?(n=Hi(e.s),a=Hi(e.v),r=DE(e.h,n,a),o=!0,l="hsv"):Zt(e.h)&&Zt(e.s)&&Zt(e.l)&&(n=Hi(e.s),i=Hi(e.l),r=EE(e.h,n,i),o=!0,l="hsl"),Object.prototype.hasOwnProperty.call(e,"a")&&(t=e.a)),t=Qf(t),{ok:o,format:e.format||l,r:Math.min(255,Math.max(r.r,0)),g:Math.min(255,Math.max(r.g,0)),b:Math.min(255,Math.max(r.b,0)),a:t}}var TE="[-\\+]?\\d+%?",FE="[-\\+]?\\d*\\.\\d+%?",sn="(?:".concat(FE,")|(?:").concat(TE,")"),ru="[\\s|\\(]+(".concat(sn,")[,|\\s]+(").concat(sn,")[,|\\s]+(").concat(sn,")\\s*\\)?"),tu="[\\s|\\(]+(".concat(sn,")[,|\\s]+(").concat(sn,")[,|\\s]+(").concat(sn,")[,|\\s]+(").concat(sn,")\\s*\\)?"),ht={CSS_UNIT:new RegExp(sn),rgb:new RegExp("rgb"+ru),rgba:new RegExp("rgba"+tu),hsl:new RegExp("hsl"+ru),hsla:new RegExp("hsla"+tu),hsv:new RegExp("hsv"+ru),hsva:new RegExp("hsva"+tu),hex3:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex6:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,hex4:/^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,hex8:/^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/};function BE(e){if(e=e.trim().toLowerCase(),e.length===0)return!1;var r=!1;if(eu[e])e=eu[e],r=!0;else if(e==="transparent")return{r:0,g:0,b:0,a:0,format:"name"};var t=ht.rgb.exec(e);return t?{r:t[1],g:t[2],b:t[3]}:(t=ht.rgba.exec(e),t?{r:t[1],g:t[2],b:t[3],a:t[4]}:(t=ht.hsl.exec(e),t?{h:t[1],s:t[2],l:t[3]}:(t=ht.hsla.exec(e),t?{h:t[1],s:t[2],l:t[3],a:t[4]}:(t=ht.hsv.exec(e),t?{h:t[1],s:t[2],v:t[3]}:(t=ht.hsva.exec(e),t?{h:t[1],s:t[2],v:t[3],a:t[4]}:(t=ht.hex8.exec(e),t?{r:Yr(t[1]),g:Yr(t[2]),b:Yr(t[3]),a:nm(t[4]),format:r?"name":"hex8"}:(t=ht.hex6.exec(e),t?{r:Yr(t[1]),g:Yr(t[2]),b:Yr(t[3]),format:r?"name":"hex"}:(t=ht.hex4.exec(e),t?{r:Yr(t[1]+t[1]),g:Yr(t[2]+t[2]),b:Yr(t[3]+t[3]),a:nm(t[4]+t[4]),format:r?"name":"hex8"}:(t=ht.hex3.exec(e),t?{r:Yr(t[1]+t[1]),g:Yr(t[2]+t[2]),b:Yr(t[3]+t[3]),format:r?"name":"hex"}:!1)))))))))}function Zt(e){return!!ht.CSS_UNIT.exec(String(e))}var OE=function(){function e(r,t){r===void 0&&(r=""),t===void 0&&(t={});var n;if(r instanceof e)return r;typeof r=="number"&&(r=ME(r)),this.originalInput=r;var a=_E(r);this.originalInput=r,this.r=a.r,this.g=a.g,this.b=a.b,this.a=a.a,this.roundA=Math.round(100*this.a)/100,this.format=(n=t.format)!==null&&n!==void 0?n:a.format,this.gradientType=t.gradientType,this.r<1&&(this.r=Math.round(this.r)),this.g<1&&(this.g=Math.round(this.g)),this.b<1&&(this.b=Math.round(this.b)),this.isValid=a.ok}return e.prototype.isDark=function(){return this.getBrightness()<128},e.prototype.isLight=function(){return!this.isDark()},e.prototype.getBrightness=function(){var r=this.toRgb();return(r.r*299+r.g*587+r.b*114)/1e3},e.prototype.getLuminance=function(){var r=this.toRgb(),t,n,a,i=r.r/255,o=r.g/255,l=r.b/255;return i<=.03928?t=i/12.92:t=Math.pow((i+.055)/1.055,2.4),o<=.03928?n=o/12.92:n=Math.pow((o+.055)/1.055,2.4),l<=.03928?a=l/12.92:a=Math.pow((l+.055)/1.055,2.4),.2126*t+.7152*n+.0722*a},e.prototype.getAlpha=function(){return this.a},e.prototype.setAlpha=function(r){return this.a=Qf(r),this.roundA=Math.round(100*this.a)/100,this},e.prototype.isMonochrome=function(){var r=this.toHsl().s;return r===0},e.prototype.toHsv=function(){var r=rm(this.r,this.g,this.b);return{h:r.h*360,s:r.s,v:r.v,a:this.a}},e.prototype.toHsvString=function(){var r=rm(this.r,this.g,this.b),t=Math.round(r.h*360),n=Math.round(r.s*100),a=Math.round(r.v*100);return this.a===1?"hsv(".concat(t,", ").concat(n,"%, ").concat(a,"%)"):"hsva(".concat(t,", ").concat(n,"%, ").concat(a,"%, ").concat(this.roundA,")")},e.prototype.toHsl=function(){var r=em(this.r,this.g,this.b);return{h:r.h*360,s:r.s,l:r.l,a:this.a}},e.prototype.toHslString=function(){var r=em(this.r,this.g,this.b),t=Math.round(r.h*360),n=Math.round(r.s*100),a=Math.round(r.l*100);return this.a===1?"hsl(".concat(t,", ").concat(n,"%, ").concat(a,"%)"):"hsla(".concat(t,", ").concat(n,"%, ").concat(a,"%, ").concat(this.roundA,")")},e.prototype.toHex=function(r){return r===void 0&&(r=!1),tm(this.r,this.g,this.b,r)},e.prototype.toHexString=function(r){return r===void 0&&(r=!1),"#"+this.toHex(r)},e.prototype.toHex8=function(r){return r===void 0&&(r=!1),SE(this.r,this.g,this.b,this.a,r)},e.prototype.toHex8String=function(r){return r===void 0&&(r=!1),"#"+this.toHex8(r)},e.prototype.toHexShortString=function(r){return r===void 0&&(r=!1),this.a===1?this.toHexString(r):this.toHex8String(r)},e.prototype.toRgb=function(){return{r:Math.round(this.r),g:Math.round(this.g),b:Math.round(this.b),a:this.a}},e.prototype.toRgbString=function(){var r=Math.round(this.r),t=Math.round(this.g),n=Math.round(this.b);return this.a===1?"rgb(".concat(r,", ").concat(t,", ").concat(n,")"):"rgba(".concat(r,", ").concat(t,", ").concat(n,", ").concat(this.roundA,")")},e.prototype.toPercentageRgb=function(){var r=function(t){return"".concat(Math.round(Sr(t,255)*100),"%")};return{r:r(this.r),g:r(this.g),b:r(this.b),a:this.a}},e.prototype.toPercentageRgbString=function(){var r=function(t){return Math.round(Sr(t,255)*100)};return this.a===1?"rgb(".concat(r(this.r),"%, ").concat(r(this.g),"%, ").concat(r(this.b),"%)"):"rgba(".concat(r(this.r),"%, ").concat(r(this.g),"%, ").concat(r(this.b),"%, ").concat(this.roundA,")")},e.prototype.toName=function(){if(this.a===0)return"transparent";if(this.a<1)return!1;for(var r="#"+tm(this.r,this.g,this.b,!1),t=0,n=Object.entries(eu);t=0,i=!t&&a&&(r.startsWith("hex")||r==="name");return i?r==="name"&&this.a===0?this.toName():this.toRgbString():(r==="rgb"&&(n=this.toRgbString()),r==="prgb"&&(n=this.toPercentageRgbString()),(r==="hex"||r==="hex6")&&(n=this.toHexString()),r==="hex3"&&(n=this.toHexString(!0)),r==="hex4"&&(n=this.toHex8String(!0)),r==="hex8"&&(n=this.toHex8String()),r==="name"&&(n=this.toName()),r==="hsl"&&(n=this.toHslString()),r==="hsv"&&(n=this.toHsvString()),n||this.toHexString())},e.prototype.toNumber=function(){return(Math.round(this.r)<<16)+(Math.round(this.g)<<8)+Math.round(this.b)},e.prototype.clone=function(){return new e(this.toString())},e.prototype.lighten=function(r){r===void 0&&(r=10);var t=this.toHsl();return t.l+=r/100,t.l=Ui(t.l),new e(t)},e.prototype.brighten=function(r){r===void 0&&(r=10);var t=this.toRgb();return t.r=Math.max(0,Math.min(255,t.r-Math.round(255*-(r/100)))),t.g=Math.max(0,Math.min(255,t.g-Math.round(255*-(r/100)))),t.b=Math.max(0,Math.min(255,t.b-Math.round(255*-(r/100)))),new e(t)},e.prototype.darken=function(r){r===void 0&&(r=10);var t=this.toHsl();return t.l-=r/100,t.l=Ui(t.l),new e(t)},e.prototype.tint=function(r){return r===void 0&&(r=10),this.mix("white",r)},e.prototype.shade=function(r){return r===void 0&&(r=10),this.mix("black",r)},e.prototype.desaturate=function(r){r===void 0&&(r=10);var t=this.toHsl();return t.s-=r/100,t.s=Ui(t.s),new e(t)},e.prototype.saturate=function(r){r===void 0&&(r=10);var t=this.toHsl();return t.s+=r/100,t.s=Ui(t.s),new e(t)},e.prototype.greyscale=function(){return this.desaturate(100)},e.prototype.spin=function(r){var t=this.toHsl(),n=(t.h+r)%360;return t.h=n<0?360+n:n,new e(t)},e.prototype.mix=function(r,t){t===void 0&&(t=50);var n=this.toRgb(),a=new e(r).toRgb(),i=t/100,o={r:(a.r-n.r)*i+n.r,g:(a.g-n.g)*i+n.g,b:(a.b-n.b)*i+n.b,a:(a.a-n.a)*i+n.a};return new e(o)},e.prototype.analogous=function(r,t){r===void 0&&(r=6),t===void 0&&(t=30);var n=this.toHsl(),a=360/t,i=[this];for(n.h=(n.h-(a*r>>1)+720)%360;--r;)n.h=(n.h+a)%360,i.push(new e(n));return i},e.prototype.complement=function(){var r=this.toHsl();return r.h=(r.h+180)%360,new e(r)},e.prototype.monochromatic=function(r){r===void 0&&(r=6);for(var t=this.toHsv(),n=t.h,a=t.s,i=t.v,o=[],l=1/r;r--;)o.push(new e({h:n,s:a,v:i})),i=(i+l)%1;return o},e.prototype.splitcomplement=function(){var r=this.toHsl(),t=r.h;return[this,new e({h:(t+72)%360,s:r.s,l:r.l}),new e({h:(t+216)%360,s:r.s,l:r.l})]},e.prototype.onBackground=function(r){var t=this.toRgb(),n=new e(r).toRgb(),a=t.a+n.a*(1-t.a);return new e({r:(t.r*t.a+n.r*n.a*(1-t.a))/a,g:(t.g*t.a+n.g*n.a*(1-t.a))/a,b:(t.b*t.a+n.b*n.a*(1-t.a))/a,a})},e.prototype.triad=function(){return this.polyad(3)},e.prototype.tetrad=function(){return this.polyad(4)},e.prototype.polyad=function(r){for(var t=this.toHsl(),n=t.h,a=[this],i=360/r,o=1;o{let n={},a=e.color;if(a){const i=a.match(/var\((.*?)\)/);i&&(a=window.getComputedStyle(window.document.documentElement).getPropertyValue(i[1]));const o=new OE(a),l=e.dark?o.tint(20).toString():un(o,20);if(e.plain)n=t.cssVarBlock({"bg-color":e.dark?un(o,90):o.tint(90).toString(),"text-color":a,"border-color":e.dark?un(o,50):o.tint(50).toString(),"hover-text-color":`var(${t.cssVarName("color-white")})`,"hover-bg-color":a,"hover-border-color":a,"active-bg-color":l,"active-text-color":`var(${t.cssVarName("color-white")})`,"active-border-color":l}),r.value&&(n[t.cssVarBlockName("disabled-bg-color")]=e.dark?un(o,90):o.tint(90).toString(),n[t.cssVarBlockName("disabled-text-color")]=e.dark?un(o,50):o.tint(50).toString(),n[t.cssVarBlockName("disabled-border-color")]=e.dark?un(o,80):o.tint(80).toString());else{const u=e.dark?un(o,30):o.tint(30).toString(),s=o.isDark()?`var(${t.cssVarName("color-white")})`:`var(${t.cssVarName("color-black")})`;if(n=t.cssVarBlock({"bg-color":a,"text-color":s,"border-color":a,"hover-bg-color":u,"hover-text-color":s,"hover-border-color":u,"active-bg-color":l,"active-border-color":l}),r.value){const c=e.dark?un(o,50):o.tint(50).toString();n[t.cssVarBlockName("disabled-bg-color")]=c,n[t.cssVarBlockName("disabled-text-color")]=e.dark?"rgba(255, 255, 255, 0.5)":`var(${t.cssVarName("color-white")})`,n[t.cssVarBlockName("disabled-border-color")]=c}}}return n})}const IE=d.defineComponent({name:"ElButton"}),RE=d.defineComponent({...IE,props:Xs,emits:wE,setup(e,{expose:r,emit:t}){const n=e,a=$E(n),i=fr("button"),{_ref:o,_size:l,_type:u,_disabled:s,_props:c,shouldAddSpace:f,handleClick:m}=bE(n,t),p=d.computed(()=>[i.b(),i.m(u.value),i.m(l.value),i.is("disabled",s.value),i.is("loading",n.loading),i.is("plain",n.plain),i.is("round",n.round),i.is("circle",n.circle),i.is("text",n.text),i.is("link",n.link),i.is("has-bg",n.bg)]);return r({ref:o,size:l,type:u,disabled:s,shouldAddSpace:f}),(v,h)=>(d.openBlock(),d.createBlock(d.resolveDynamicComponent(v.tag),d.mergeProps({ref_key:"_ref",ref:o},d.unref(c),{class:d.unref(p),style:d.unref(a),onClick:d.unref(m)}),{default:d.withCtx(()=>[v.loading?(d.openBlock(),d.createElementBlock(d.Fragment,{key:0},[v.$slots.loading?d.renderSlot(v.$slots,"loading",{key:0}):(d.openBlock(),d.createBlock(d.unref(st),{key:1,class:d.normalizeClass(d.unref(i).is("loading"))},{default:d.withCtx(()=>[(d.openBlock(),d.createBlock(d.resolveDynamicComponent(v.loadingIcon)))]),_:1},8,["class"]))],64)):v.icon||v.$slots.icon?(d.openBlock(),d.createBlock(d.unref(st),{key:1},{default:d.withCtx(()=>[v.icon?(d.openBlock(),d.createBlock(d.resolveDynamicComponent(v.icon),{key:0})):d.renderSlot(v.$slots,"icon",{key:1})]),_:3})):d.createCommentVNode("v-if",!0),v.$slots.default?(d.openBlock(),d.createElementBlock("span",{key:2,class:d.normalizeClass({[d.unref(i).em("text","expand")]:d.unref(f)})},[d.renderSlot(v.$slots,"default")],2)):d.createCommentVNode("v-if",!0)]),_:3},16,["class","style","onClick"]))}});var zE=mr(RE,[["__file","button.vue"]]);const PE={size:Xs.size,type:Xs.type},kE=d.defineComponent({name:"ElButtonGroup"}),qE=d.defineComponent({...kE,props:PE,setup(e){const r=e;d.provide(Xf,d.reactive({size:d.toRef(r,"size"),type:d.toRef(r,"type")}));const t=fr("button");return(n,a)=>(d.openBlock(),d.createElementBlock("div",{class:d.normalizeClass(d.unref(t).b("group"))},[d.renderSlot(n.$slots,"default")],2))}});var am=mr(qE,[["__file","button-group.vue"]]);const im=nt(zE,{ButtonGroup:am});Cs(am);var Rn=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Zi(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function LE(e){if(e.__esModule)return e;var r=e.default;if(typeof r=="function"){var t=function n(){return this instanceof n?Reflect.construct(r,arguments,this.constructor):r.apply(this,arguments)};t.prototype=r.prototype}else t={};return Object.defineProperty(t,"__esModule",{value:!0}),Object.keys(e).forEach(function(n){var a=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,a.get?a:{enumerable:!0,get:function(){return e[n]}})}),t}const ln=new Map;if(yr){let e;document.addEventListener("mousedown",r=>e=r),document.addEventListener("mouseup",r=>{if(e){for(const t of ln.values())for(const{documentHandler:n}of t)n(r,e);e=void 0}})}function om(e,r){let t=[];return Array.isArray(r.arg)?t=r.arg:Tn(r.arg)&&t.push(r.arg),function(n,a){const i=r.instance.popperRef,o=n.target,l=a==null?void 0:a.target,u=!r||!r.instance,s=!o||!l,c=e.contains(o)||e.contains(l),f=e===o,m=t.length&&t.some(v=>v==null?void 0:v.contains(o))||t.length&&t.includes(l),p=i&&(i.contains(o)||i.contains(l));u||s||c||f||m||p||r.value(n,a)}}const VE={beforeMount(e,r){ln.has(e)||ln.set(e,[]),ln.get(e).push({documentHandler:om(e,r),bindingFn:r.value})},updated(e,r){ln.has(e)||ln.set(e,[]);const t=ln.get(e),n=t.findIndex(i=>i.bindingFn===r.oldValue),a={documentHandler:om(e,r),bindingFn:r.value};n>=0?t.splice(n,1,a):t.push(a)},unmounted(e){ln.delete(e)}},UE=100,HE=600,sm={beforeMount(e,r){const t=r.value,{interval:n=UE,delay:a=HE}=Fr(t)?{}:t;let i,o;const l=()=>Fr(t)?t():t.handler(),u=()=>{o&&(clearTimeout(o),o=void 0),i&&(clearInterval(i),i=void 0)};e.addEventListener("mousedown",s=>{s.button===0&&(u(),l(),document.addEventListener("mouseup",()=>u(),{once:!0}),o=setTimeout(()=>{i=setInterval(()=>{l()},n)},a))})}},nu=cr({type:{type:String,values:["primary","success","info","warning","danger"],default:"primary"},closable:Boolean,disableTransitions:Boolean,hit:Boolean,color:String,size:{type:String,values:Zc},effect:{type:String,values:["dark","light","plain"],default:"light"},round:Boolean}),ZE={close:e=>e instanceof MouseEvent,click:e=>e instanceof MouseEvent},GE=d.defineComponent({name:"ElTag"}),WE=d.defineComponent({...GE,props:nu,emits:ZE,setup(e,{emit:r}){const t=e,n=oa(),a=fr("tag"),i=d.computed(()=>{const{type:s,hit:c,effect:f,closable:m,round:p}=t;return[a.b(),a.is("closable",m),a.m(s||"primary"),a.m(n.value),a.m(f),a.is("hit",c),a.is("round",p)]}),o=s=>{r("close",s)},l=s=>{r("click",s)},u=s=>{s.component.subTree.component.bum=null};return(s,c)=>s.disableTransitions?(d.openBlock(),d.createElementBlock("span",{key:0,class:d.normalizeClass(d.unref(i)),style:d.normalizeStyle({backgroundColor:s.color}),onClick:l},[d.createElementVNode("span",{class:d.normalizeClass(d.unref(a).e("content"))},[d.renderSlot(s.$slots,"default")],2),s.closable?(d.openBlock(),d.createBlock(d.unref(st),{key:0,class:d.normalizeClass(d.unref(a).e("close")),onClick:d.withModifiers(o,["stop"])},{default:d.withCtx(()=>[d.createVNode(d.unref(Lc))]),_:1},8,["class","onClick"])):d.createCommentVNode("v-if",!0)],6)):(d.openBlock(),d.createBlock(d.Transition,{key:1,name:`${d.unref(a).namespace.value}-zoom-in-center`,appear:"",onVnodeMounted:u},{default:d.withCtx(()=>[d.createElementVNode("span",{class:d.normalizeClass(d.unref(i)),style:d.normalizeStyle({backgroundColor:s.color}),onClick:l},[d.createElementVNode("span",{class:d.normalizeClass(d.unref(a).e("content"))},[d.renderSlot(s.$slots,"default")],2),s.closable?(d.openBlock(),d.createBlock(d.unref(st),{key:0,class:d.normalizeClass(d.unref(a).e("close")),onClick:d.withModifiers(o,["stop"])},{default:d.withCtx(()=>[d.createVNode(d.unref(Lc))]),_:1},8,["class","onClick"])):d.createCommentVNode("v-if",!0)],6)]),_:3},8,["name"]))}});var jE=mr(WE,[["__file","tag.vue"]]);const KE=nt(jE),JE=cr({direction:{type:String,values:["horizontal","vertical"],default:"horizontal"},contentPosition:{type:String,values:["left","center","right"],default:"center"},borderStyle:{type:Ue(String),default:"solid"}}),YE=d.defineComponent({name:"ElDivider"}),XE=d.defineComponent({...YE,props:JE,setup(e){const r=e,t=fr("divider"),n=d.computed(()=>t.cssVar({"border-style":r.borderStyle}));return(a,i)=>(d.openBlock(),d.createElementBlock("div",{class:d.normalizeClass([d.unref(t).b(),d.unref(t).m(a.direction)]),style:d.normalizeStyle(d.unref(n)),role:"separator"},[a.$slots.default&&a.direction!=="vertical"?(d.openBlock(),d.createElementBlock("div",{key:0,class:d.normalizeClass([d.unref(t).e("text"),d.unref(t).is(a.contentPosition)])},[d.renderSlot(a.$slots,"default")],2)):d.createCommentVNode("v-if",!0)],6))}});var QE=mr(XE,[["__file","divider.vue"]]);const um=nt(QE),eD=cr({id:{type:String,default:void 0},step:{type:Number,default:1},stepStrictly:Boolean,max:{type:Number,default:Number.POSITIVE_INFINITY},min:{type:Number,default:Number.NEGATIVE_INFINITY},modelValue:Number,readonly:Boolean,disabled:Boolean,size:ia,controls:{type:Boolean,default:!0},controlsPosition:{type:String,default:"",values:["","right"]},valueOnClear:{type:[String,Number,null],validator:e=>e===null||lr(e)||["min","max"].includes(e),default:null},name:String,placeholder:String,precision:{type:Number,validator:e=>e>=0&&e===Number.parseInt(`${e}`,10)},validateEvent:{type:Boolean,default:!0},...$n(["ariaLabel"])}),rD={[Yn]:(e,r)=>r!==e,blur:e=>e instanceof FocusEvent,focus:e=>e instanceof FocusEvent,[Fn]:e=>lr(e)||Vt(e),[gr]:e=>lr(e)||Vt(e)},tD=d.defineComponent({name:"ElInputNumber"}),nD=d.defineComponent({...tD,props:eD,emits:rD,setup(e,{expose:r,emit:t}){const n=e,{t:a}=_i(),i=fr("input-number"),o=d.ref(),l=d.reactive({currentValue:n.modelValue,userInput:null}),{formItem:u}=ja(),s=d.computed(()=>lr(n.modelValue)&&n.modelValue<=n.min),c=d.computed(()=>lr(n.modelValue)&&n.modelValue>=n.max),f=d.computed(()=>{const $=b(n.step);return Ut(n.precision)?Math.max(b(n.modelValue),$):($>n.precision&&hr("InputNumber","precision should not be less than the decimal places of step"),n.precision)}),m=d.computed(()=>n.controls&&n.controlsPosition==="right"),p=oa(),v=Pi(),h=d.computed(()=>{if(l.userInput!==null)return l.userInput;let $=l.currentValue;if(Vt($))return"";if(lr($)){if(Number.isNaN($))return"";Ut(n.precision)||($=$.toFixed(n.precision))}return $}),w=($,M)=>{if(Ut(M)&&(M=f.value),M===0)return Math.round($);let T=String($);const k=T.indexOf(".");if(k===-1||!T.replace(".","").split("")[k+M])return $;const X=T.length;return T.charAt(X-1)==="5"&&(T=`${T.slice(0,Math.max(0,X-1))}6`),Number.parseFloat(Number(T).toFixed(M))},b=$=>{if(Vt($))return 0;const M=$.toString(),T=M.indexOf(".");let k=0;return T!==-1&&(k=M.length-T-1),k},A=($,M=1)=>lr($)?w($+n.step*M):l.currentValue,g=()=>{if(n.readonly||v.value||c.value)return;const $=Number(h.value)||0,M=A($);y(M),t(Fn,l.currentValue),I()},N=()=>{if(n.readonly||v.value||s.value)return;const $=Number(h.value)||0,M=A($,-1);y(M),t(Fn,l.currentValue),I()},x=($,M)=>{const{max:T,min:k,step:O,precision:W,stepStrictly:X,valueOnClear:U}=n;TT||zT?T:k,M&&t(gr,z)),z},y=($,M=!0)=>{var T;const k=l.currentValue,O=x($);if(!M){t(gr,O);return}k===O&&$||(l.userInput=null,t(gr,O),k!==O&&t(Yn,O,k),n.validateEvent&&((T=u==null?void 0:u.validate)==null||T.call(u,"change").catch(W=>hr(W))),l.currentValue=O)},D=$=>{l.userInput=$;const M=$===""?null:Number($);t(Fn,M),y(M,!1)},S=$=>{const M=$!==""?Number($):"";(lr(M)&&!Number.isNaN(M)||$==="")&&y(M),I(),l.userInput=null},E=()=>{var $,M;(M=($=o.value)==null?void 0:$.focus)==null||M.call($)},C=()=>{var $,M;(M=($=o.value)==null?void 0:$.blur)==null||M.call($)},_=$=>{t("focus",$)},F=$=>{var M;l.userInput=null,t("blur",$),n.validateEvent&&((M=u==null?void 0:u.validate)==null||M.call(u,"blur").catch(T=>hr(T)))},I=()=>{l.currentValue!==n.modelValue&&(l.currentValue=n.modelValue)},R=$=>{document.activeElement===$.target&&$.preventDefault()};return d.watch(()=>n.modelValue,($,M)=>{const T=x($,!0);l.userInput===null&&T!==M&&(l.currentValue=T)},{immediate:!0}),d.onMounted(()=>{var $;const{min:M,max:T,modelValue:k}=n,O=($=o.value)==null?void 0:$.input;if(O.setAttribute("role","spinbutton"),Number.isFinite(T)?O.setAttribute("aria-valuemax",String(T)):O.removeAttribute("aria-valuemax"),Number.isFinite(M)?O.setAttribute("aria-valuemin",String(M)):O.removeAttribute("aria-valuemin"),O.setAttribute("aria-valuenow",l.currentValue||l.currentValue===0?String(l.currentValue):""),O.setAttribute("aria-disabled",String(v.value)),!lr(k)&&k!=null){let W=Number(k);Number.isNaN(W)&&(W=null),t(gr,W)}O.addEventListener("wheel",R,{passive:!1})}),d.onUpdated(()=>{var $,M;const T=($=o.value)==null?void 0:$.input;T==null||T.setAttribute("aria-valuenow",`${(M=l.currentValue)!=null?M:""}`)}),r({focus:E,blur:C}),($,M)=>(d.openBlock(),d.createElementBlock("div",{class:d.normalizeClass([d.unref(i).b(),d.unref(i).m(d.unref(p)),d.unref(i).is("disabled",d.unref(v)),d.unref(i).is("without-controls",!$.controls),d.unref(i).is("controls-right",d.unref(m))]),onDragstart:d.withModifiers(()=>{},["prevent"])},[$.controls?d.withDirectives((d.openBlock(),d.createElementBlock("span",{key:0,role:"button","aria-label":d.unref(a)("el.inputNumber.decrease"),class:d.normalizeClass([d.unref(i).e("decrease"),d.unref(i).is("disabled",d.unref(s))]),onKeydown:d.withKeys(N,["enter"])},[d.renderSlot($.$slots,"decrease-icon",{},()=>[d.createVNode(d.unref(st),null,{default:d.withCtx(()=>[d.unref(m)?(d.openBlock(),d.createBlock(d.unref(qc),{key:0})):(d.openBlock(),d.createBlock(d.unref(n2),{key:1}))]),_:1})])],42,["aria-label","onKeydown"])),[[d.unref(sm),N]]):d.createCommentVNode("v-if",!0),$.controls?d.withDirectives((d.openBlock(),d.createElementBlock("span",{key:1,role:"button","aria-label":d.unref(a)("el.inputNumber.increase"),class:d.normalizeClass([d.unref(i).e("increase"),d.unref(i).is("disabled",d.unref(c))]),onKeydown:d.withKeys(g,["enter"])},[d.renderSlot($.$slots,"increase-icon",{},()=>[d.createVNode(d.unref(st),null,{default:d.withCtx(()=>[d.unref(m)?(d.openBlock(),d.createBlock(d.unref(jx),{key:0})):(d.openBlock(),d.createBlock(d.unref(i2),{key:1}))]),_:1})])],42,["aria-label","onKeydown"])),[[d.unref(sm),g]]):d.createCommentVNode("v-if",!0),d.createVNode(d.unref(aA),{id:$.id,ref_key:"input",ref:o,type:"number",step:$.step,"model-value":d.unref(h),placeholder:$.placeholder,readonly:$.readonly,disabled:d.unref(v),size:d.unref(p),max:$.max,min:$.min,name:$.name,"aria-label":$.ariaLabel,"validate-event":!1,onKeydown:[d.withKeys(d.withModifiers(g,["prevent"]),["up"]),d.withKeys(d.withModifiers(N,["prevent"]),["down"])],onBlur:F,onFocus:_,onInput:D,onChange:S},d.createSlots({_:2},[$.$slots.prefix?{name:"prefix",fn:d.withCtx(()=>[d.renderSlot($.$slots,"prefix")])}:void 0,$.$slots.suffix?{name:"suffix",fn:d.withCtx(()=>[d.renderSlot($.$slots,"suffix")])}:void 0]),1032,["id","step","model-value","placeholder","readonly","disabled","size","max","min","name","aria-label","onKeydown"])],42,["onDragstart"]))}});var aD=mr(nD,[["__file","input-number.vue"]]);const au=nt(aD),lm=Symbol("ElSelectGroup"),Gi=Symbol("ElSelect");function iD(e,r){const t=d.inject(Gi),n=d.inject(lm,{disabled:!1}),a=d.computed(()=>c(tn(t.props.modelValue),e.value)),i=d.computed(()=>{var p;if(t.props.multiple){const v=tn((p=t.props.modelValue)!=null?p:[]);return!a.value&&v.length>=t.props.multipleLimit&&t.props.multipleLimit>0}else return!1}),o=d.computed(()=>e.label||(Ur(e.value)?"":e.value)),l=d.computed(()=>e.value||e.label||""),u=d.computed(()=>e.disabled||r.groupDisabled||i.value),s=d.getCurrentInstance(),c=(p=[],v)=>{if(Ur(e.value)){const h=t.props.valueKey;return p&&p.some(w=>d.toRaw(qt(w,h))===qt(v,h))}else return p&&p.includes(v)},f=()=>{!e.disabled&&!n.disabled&&(t.states.hoveringIndex=t.optionsArray.indexOf(s.proxy))},m=p=>{const v=new RegExp(Ux(p),"i");r.visible=v.test(o.value)||e.created};return d.watch(()=>o.value,()=>{!e.created&&!t.props.remote&&t.setSelected()}),d.watch(()=>e.value,(p,v)=>{const{remote:h,valueKey:w}=t.props;if(p!==v&&(t.onOptionDestroy(v,s.proxy),t.onOptionCreate(s.proxy)),!e.created&&!h){if(w&&Ur(p)&&Ur(v)&&p[w]===v[w])return;t.setSelected()}}),d.watch(()=>n.disabled,()=>{r.groupDisabled=n.disabled},{immediate:!0}),{select:t,currentLabel:o,currentValue:l,itemSelected:a,isDisabled:u,hoverItem:f,updateOption:m}}const oD=d.defineComponent({name:"ElOption",componentName:"ElOption",props:{value:{required:!0,type:[String,Number,Boolean,Object]},label:[String,Number],created:Boolean,disabled:Boolean},setup(e){const r=fr("select"),t=Ii(),n=d.computed(()=>[r.be("dropdown","item"),r.is("disabled",d.unref(l)),r.is("selected",d.unref(o)),r.is("hovering",d.unref(m))]),a=d.reactive({index:-1,groupDisabled:!1,visible:!0,hover:!1}),{currentLabel:i,itemSelected:o,isDisabled:l,select:u,hoverItem:s,updateOption:c}=iD(e,a),{visible:f,hover:m}=d.toRefs(a),p=d.getCurrentInstance().proxy;u.onOptionCreate(p),d.onBeforeUnmount(()=>{const h=p.value,{selected:w}=u.states,A=(u.props.multiple?w:[w]).some(g=>g.value===p.value);d.nextTick(()=>{u.states.cachedOptions.get(h)===p&&!A&&u.states.cachedOptions.delete(h)}),u.onOptionDestroy(h,p)});function v(){l.value||u.handleOptionSelect(p)}return{ns:r,id:t,containerKls:n,currentLabel:i,itemSelected:o,isDisabled:l,select:u,hoverItem:s,updateOption:c,visible:f,hover:m,selectOptionClick:v,states:a}}});function sD(e,r,t,n,a,i){return d.withDirectives((d.openBlock(),d.createElementBlock("li",{id:e.id,class:d.normalizeClass(e.containerKls),role:"option","aria-disabled":e.isDisabled||void 0,"aria-selected":e.itemSelected,onMouseenter:e.hoverItem,onClick:d.withModifiers(e.selectOptionClick,["stop"])},[d.renderSlot(e.$slots,"default",{},()=>[d.createElementVNode("span",null,d.toDisplayString(e.currentLabel),1)])],42,["id","aria-disabled","aria-selected","onMouseenter","onClick"])),[[d.vShow,e.visible]])}var iu=mr(oD,[["render",sD],["__file","option.vue"]]);const uD=d.defineComponent({name:"ElSelectDropdown",componentName:"ElSelectDropdown",setup(){const e=d.inject(Gi),r=fr("select"),t=d.computed(()=>e.props.popperClass),n=d.computed(()=>e.props.multiple),a=d.computed(()=>e.props.fitInputWidth),i=d.ref("");function o(){var l;i.value=`${(l=e.selectRef)==null?void 0:l.offsetWidth}px`}return d.onMounted(()=>{o(),zt(e.selectRef,o)}),{ns:r,minWidth:i,popperClass:t,isMultiple:n,isFitInputWidth:a}}});function lD(e,r,t,n,a,i){return d.openBlock(),d.createElementBlock("div",{class:d.normalizeClass([e.ns.b("dropdown"),e.ns.is("multiple",e.isMultiple),e.popperClass]),style:d.normalizeStyle({[e.isFitInputWidth?"width":"minWidth"]:e.minWidth})},[e.$slots.header?(d.openBlock(),d.createElementBlock("div",{key:0,class:d.normalizeClass(e.ns.be("dropdown","header"))},[d.renderSlot(e.$slots,"header")],2)):d.createCommentVNode("v-if",!0),d.renderSlot(e.$slots,"default"),e.$slots.footer?(d.openBlock(),d.createElementBlock("div",{key:1,class:d.normalizeClass(e.ns.be("dropdown","footer"))},[d.renderSlot(e.$slots,"footer")],2)):d.createCommentVNode("v-if",!0)],6)}var cD=mr(uD,[["render",lD],["__file","select-dropdown.vue"]]);const fD=11,mD=(e,r)=>{const{t}=_i(),n=Ii(),a=fr("select"),i=fr("input"),o=d.reactive({inputValue:"",options:new Map,cachedOptions:new Map,disabledOptions:new Map,optionValues:[],selected:[],selectionWidth:0,calculatorWidth:0,collapseItemWidth:0,selectedLabel:"",hoveringIndex:-1,previousQuery:null,inputHovering:!1,menuVisibleOnFocus:!1,isBeforeHide:!1}),l=d.ref(null),u=d.ref(null),s=d.ref(null),c=d.ref(null),f=d.ref(null),m=d.ref(null),p=d.ref(null),v=d.ref(null),h=d.ref(null),w=d.ref(null),b=d.ref(null),A=d.ref(null),{isComposing:g,handleCompositionStart:N,handleCompositionUpdate:x,handleCompositionEnd:y}=Tf({afterComposition:le=>ce(le)}),{wrapperRef:D,isFocused:S}=_f(f,{beforeFocus(){return M.value},afterFocus(){e.automaticDropdown&&!E.value&&(E.value=!0,o.menuVisibleOnFocus=!0)},beforeBlur(le){var Ee,He;return((Ee=s.value)==null?void 0:Ee.isFocusInsideContent(le))||((He=c.value)==null?void 0:He.isFocusInsideContent(le))},afterBlur(){E.value=!1,o.menuVisibleOnFocus=!1}}),E=d.ref(!1),C=d.ref(),{form:_,formItem:F}=ja(),{inputId:I}=Ls(e,{formItemContext:F}),{valueOnClear:R,isEmptyValue:$}=LN(e),M=d.computed(()=>e.disabled||(_==null?void 0:_.disabled)),T=d.computed(()=>Et(e.modelValue)?e.modelValue.length>0:!$(e.modelValue)),k=d.computed(()=>e.clearable&&!M.value&&o.inputHovering&&T.value),O=d.computed(()=>e.remote&&e.filterable&&!e.remoteShowSuffix?"":e.suffixIcon),W=d.computed(()=>a.is("reverse",O.value&&E.value)),X=d.computed(()=>(F==null?void 0:F.validateState)||""),U=d.computed(()=>Hc[X.value]),z=d.computed(()=>e.remote?300:0),Q=d.computed(()=>e.loading?e.loadingText||t("el.select.loading"):e.remote&&!o.inputValue&&o.options.size===0?!1:e.filterable&&o.inputValue&&o.options.size>0&&se.value===0?e.noMatchText||t("el.select.noMatch"):o.options.size===0?e.noDataText||t("el.select.noData"):null),se=d.computed(()=>re.value.filter(le=>le.visible).length),re=d.computed(()=>{const le=Array.from(o.options.values()),Ee=[];return o.optionValues.forEach(He=>{const ir=le.findIndex($t=>$t.value===He);ir>-1&&Ee.push(le[ir])}),Ee.length>=le.length?Ee:le}),q=d.computed(()=>Array.from(o.cachedOptions.values())),Z=d.computed(()=>{const le=re.value.filter(Ee=>!Ee.created).some(Ee=>Ee.currentLabel===o.inputValue);return e.filterable&&e.allowCreate&&o.inputValue!==""&&!le}),j=()=>{e.filterable&&Fr(e.filterMethod)||e.filterable&&e.remote&&Fr(e.remoteMethod)||re.value.forEach(le=>{var Ee;(Ee=le.updateOption)==null||Ee.call(le,o.inputValue)})},Y=oa(),ee=d.computed(()=>["small"].includes(Y.value)?"small":"default"),te=d.computed({get(){return E.value&&Q.value!==!1},set(le){E.value=le}}),oe=d.computed(()=>{if(e.multiple&&!Ut(e.modelValue))return tn(e.modelValue).length===0&&!o.inputValue;const le=Et(e.modelValue)?e.modelValue[0]:e.modelValue;return e.filterable||Ut(le)?!o.inputValue:!0}),ve=d.computed(()=>{var le;const Ee=(le=e.placeholder)!=null?le:t("el.select.placeholder");return e.multiple||!T.value?Ee:o.selectedLabel}),L=d.computed(()=>as?null:"mouseenter");d.watch(()=>e.modelValue,(le,Ee)=>{e.multiple&&e.filterable&&!e.reserveKeyword&&(o.inputValue="",H("")),ie(),!As(le,Ee)&&e.validateEvent&&(F==null||F.validate("change").catch(He=>hr(He)))},{flush:"post",deep:!0}),d.watch(()=>E.value,le=>{le?H(o.inputValue):(o.inputValue="",o.previousQuery=null,o.isBeforeHide=!0),r("visible-change",le)}),d.watch(()=>o.options.entries(),()=>{var le;if(!yr)return;const Ee=((le=l.value)==null?void 0:le.querySelectorAll("input"))||[];(!e.filterable&&!e.defaultFirstOption&&!Ut(e.modelValue)||!Array.from(Ee).includes(document.activeElement))&&ie(),e.defaultFirstOption&&(e.filterable||e.remote)&&se.value&&ne()},{flush:"post"}),d.watch(()=>o.hoveringIndex,le=>{lr(le)&&le>-1?C.value=re.value[le]||{}:C.value={},re.value.forEach(Ee=>{Ee.hover=C.value===Ee})}),d.watchEffect(()=>{o.isBeforeHide||j()});const H=le=>{o.previousQuery===le||g.value||(o.previousQuery=le,e.filterable&&Fr(e.filterMethod)?e.filterMethod(le):e.filterable&&e.remote&&Fr(e.remoteMethod)&&e.remoteMethod(le),e.defaultFirstOption&&(e.filterable||e.remote)&&se.value?d.nextTick(ne):d.nextTick(me))},ne=()=>{const le=re.value.filter(ir=>ir.visible&&!ir.disabled&&!ir.states.groupDisabled),Ee=le.find(ir=>ir.created),He=le[0];o.hoveringIndex=Oe(re.value,Ee||He)},ie=()=>{if(e.multiple)o.selectedLabel="";else{const Ee=Et(e.modelValue)?e.modelValue[0]:e.modelValue,He=de(Ee);o.selectedLabel=He.currentLabel,o.selected=[He];return}const le=[];Ut(e.modelValue)||tn(e.modelValue).forEach(Ee=>{le.push(de(Ee))}),o.selected=le},de=le=>{let Ee;const He=is(le).toLowerCase()==="object",ir=is(le).toLowerCase()==="null",$t=is(le).toLowerCase()==="undefined";for(let en=o.cachedOptions.size-1;en>=0;en--){const mt=q.value[en];if(He?qt(mt.value,e.valueKey)===qt(le,e.valueKey):mt.value===le){Ee={value:le,currentLabel:mt.currentLabel,get isDisabled(){return mt.isDisabled}};break}}if(Ee)return Ee;const Sn=He?le.label:!ir&&!$t?le:"";return{value:le,currentLabel:Sn}},me=()=>{o.hoveringIndex=re.value.findIndex(le=>o.selected.some(Ee=>di(Ee)===di(le)))},be=()=>{o.selectionWidth=u.value.getBoundingClientRect().width},Ne=()=>{o.calculatorWidth=m.value.getBoundingClientRect().width},V=()=>{o.collapseItemWidth=b.value.getBoundingClientRect().width},K=()=>{var le,Ee;(Ee=(le=s.value)==null?void 0:le.updatePopper)==null||Ee.call(le)},G=()=>{var le,Ee;(Ee=(le=c.value)==null?void 0:le.updatePopper)==null||Ee.call(le)},ae=()=>{o.inputValue.length>0&&!E.value&&(E.value=!0),H(o.inputValue)},ce=le=>{if(o.inputValue=le.target.value,e.remote)fe();else return ae()},fe=Ns(()=>{ae()},z.value),xe=le=>{As(e.modelValue,le)||r(Yn,le)},ye=le=>Rx(le,Ee=>!o.disabledOptions.has(Ee)),Ae=le=>{if(e.multiple&&le.code!==Jn.delete&&le.target.value.length<=0){const Ee=tn(e.modelValue).slice(),He=ye(Ee);if(He<0)return;const ir=Ee[He];Ee.splice(He,1),r(gr,Ee),xe(Ee),r("remove-tag",ir)}},we=(le,Ee)=>{const He=o.selected.indexOf(Ee);if(He>-1&&!M.value){const ir=tn(e.modelValue).slice();ir.splice(He,1),r(gr,ir),xe(ir),r("remove-tag",Ee.value)}le.stopPropagation(),Te()},Ge=le=>{le.stopPropagation();const Ee=e.multiple?[]:R.value;if(e.multiple)for(const He of o.selected)He.isDisabled&&Ee.push(He.value);r(gr,Ee),xe(Ee),o.hoveringIndex=-1,E.value=!1,r("clear"),Te()},Ke=le=>{var Ee;if(e.multiple){const He=tn((Ee=e.modelValue)!=null?Ee:[]).slice(),ir=Oe(He,le.value);ir>-1?He.splice(ir,1):(e.multipleLimit<=0||He.length{sr(le)})},Oe=(le=[],Ee)=>{if(!Ur(Ee))return le.indexOf(Ee);const He=e.valueKey;let ir=-1;return le.some(($t,Sn)=>d.toRaw(qt($t,He))===qt(Ee,He)?(ir=Sn,!0):!1),ir},sr=le=>{var Ee,He,ir,$t,Sn;const Oa=Et(le)?le[0]:le;let en=null;if(Oa!=null&&Oa.value){const mt=re.value.filter(rs=>rs.value===Oa.value);mt.length>0&&(en=mt[0].$el)}if(s.value&&en){const mt=($t=(ir=(He=(Ee=s.value)==null?void 0:Ee.popperRef)==null?void 0:He.contentRef)==null?void 0:ir.querySelector)==null?void 0:$t.call(ir,`.${a.be("dropdown","wrap")}`);mt&&Zx(mt,en)}(Sn=A.value)==null||Sn.handleScroll()},B=le=>{o.options.set(le.value,le),o.cachedOptions.set(le.value,le),le.disabled&&o.disabledOptions.set(le.value,le)},J=(le,Ee)=>{o.options.get(le)===Ee&&o.options.delete(le)},ue=d.computed(()=>{var le,Ee;return(Ee=(le=s.value)==null?void 0:le.popperRef)==null?void 0:Ee.contentRef}),ge=()=>{o.isBeforeHide=!1,d.nextTick(()=>sr(o.selected))},Te=()=>{var le;(le=f.value)==null||le.focus()},ke=()=>{var le;(le=f.value)==null||le.blur()},Vr=le=>{Ge(le)},mi=()=>{E.value=!1,S.value&&ke()},Sl=()=>{o.inputValue.length>0?o.inputValue="":E.value=!1},Qo=()=>{M.value||(as&&(o.inputHovering=!0),o.menuVisibleOnFocus?o.menuVisibleOnFocus=!1:E.value=!E.value)},Cl=()=>{E.value?re.value[o.hoveringIndex]&&Ke(re.value[o.hoveringIndex]):Qo()},di=le=>Ur(le.value)?qt(le.value,e.valueKey):le.value,Ml=d.computed(()=>re.value.filter(le=>le.visible).every(le=>le.disabled)),_l=d.computed(()=>e.multiple?e.collapseTags?o.selected.slice(0,e.maxCollapseTags):o.selected:[]),Tl=d.computed(()=>e.multiple?e.collapseTags?o.selected.slice(e.maxCollapseTags):[]:[]),es=le=>{if(!E.value){E.value=!0;return}if(!(o.options.size===0||o.filteredOptionsCount===0||g.value)&&!Ml.value){le==="next"?(o.hoveringIndex++,o.hoveringIndex===o.options.size&&(o.hoveringIndex=0)):le==="prev"&&(o.hoveringIndex--,o.hoveringIndex<0&&(o.hoveringIndex=o.options.size-1));const Ee=re.value[o.hoveringIndex];(Ee.disabled===!0||Ee.states.groupDisabled===!0||!Ee.visible)&&es(le),d.nextTick(()=>sr(C.value))}},Fl=()=>{if(!u.value)return 0;const le=window.getComputedStyle(u.value);return Number.parseFloat(le.gap||"6px")},Bl=d.computed(()=>{const le=Fl();return{maxWidth:`${b.value&&e.maxCollapseTags===1?o.selectionWidth-o.collapseItemWidth-le:o.selectionWidth}px`}}),Ol=d.computed(()=>({maxWidth:`${o.selectionWidth}px`})),$l=d.computed(()=>({width:`${Math.max(o.calculatorWidth,fD)}px`}));return zt(u,be),zt(m,Ne),zt(h,K),zt(D,K),zt(w,G),zt(b,V),d.onMounted(()=>{ie()}),{inputId:I,contentId:n,nsSelect:a,nsInput:i,states:o,isFocused:S,expanded:E,optionsArray:re,hoverOption:C,selectSize:Y,filteredOptionsCount:se,resetCalculatorWidth:Ne,updateTooltip:K,updateTagTooltip:G,debouncedOnInputChange:fe,onInput:ce,deletePrevTag:Ae,deleteTag:we,deleteSelected:Ge,handleOptionSelect:Ke,scrollToOption:sr,hasModelValue:T,shouldShowPlaceholder:oe,currentPlaceholder:ve,mouseEnterEventName:L,showClose:k,iconComponent:O,iconReverse:W,validateState:X,validateIcon:U,showNewOption:Z,updateOptions:j,collapseTagSize:ee,setSelected:ie,selectDisabled:M,emptyText:Q,handleCompositionStart:N,handleCompositionUpdate:x,handleCompositionEnd:y,onOptionCreate:B,onOptionDestroy:J,handleMenuEnter:ge,focus:Te,blur:ke,handleClearClick:Vr,handleClickOutside:mi,handleEsc:Sl,toggleMenu:Qo,selectOption:Cl,getValueKey:di,navigateOptions:es,dropdownMenuVisible:te,showTagList:_l,collapseTagList:Tl,tagStyle:Bl,collapseTagStyle:Ol,inputStyle:$l,popperRef:ue,inputRef:f,tooltipRef:s,tagTooltipRef:c,calculatorRef:m,prefixRef:p,suffixRef:v,selectRef:l,wrapperRef:D,selectionRef:u,scrollbarRef:A,menuRef:h,tagMenuRef:w,collapseItemRef:b}};var dD=d.defineComponent({name:"ElOptions",setup(e,{slots:r}){const t=d.inject(Gi);let n=[];return()=>{var a,i;const o=(a=r.default)==null?void 0:a.call(r),l=[];function u(s){Et(s)&&s.forEach(c=>{var f,m,p,v;const h=(f=(c==null?void 0:c.type)||{})==null?void 0:f.name;h==="ElOptionGroup"?u(!Jr(c.children)&&!Et(c.children)&&Fr((m=c.children)==null?void 0:m.default)?(p=c.children)==null?void 0:p.default():c.children):h==="ElOption"?l.push((v=c.props)==null?void 0:v.value):Et(c.children)&&u(c.children)})}return o.length&&u((i=o[0])==null?void 0:i.children),As(l,n)||(n=l,t&&(t.states.optionValues=l)),o}}});const pD=cr({name:String,id:String,modelValue:{type:[Array,String,Number,Boolean,Object],default:void 0},autocomplete:{type:String,default:"off"},automaticDropdown:Boolean,size:ia,effect:{type:Ue(String),default:"light"},disabled:Boolean,clearable:Boolean,filterable:Boolean,allowCreate:Boolean,loading:Boolean,popperClass:{type:String,default:""},popperOptions:{type:Ue(Object),default:()=>({})},remote:Boolean,loadingText:String,noMatchText:String,noDataText:String,remoteMethod:Function,filterMethod:Function,multiple:Boolean,multipleLimit:{type:Number,default:0},placeholder:{type:String},defaultFirstOption:Boolean,reserveKeyword:{type:Boolean,default:!0},valueKey:{type:String,default:"value"},collapseTags:Boolean,collapseTagsTooltip:Boolean,maxCollapseTags:{type:Number,default:1},teleported:Ys.teleported,persistent:{type:Boolean,default:!0},clearIcon:{type:Kn,default:Ss},fitInputWidth:Boolean,suffixIcon:{type:Kn,default:qc},tagType:{...nu.type,default:"info"},tagEffect:{...nu.effect,default:"light"},validateEvent:{type:Boolean,default:!0},remoteShowSuffix:Boolean,placement:{type:Ue(String),values:Qn,default:"bottom-start"},fallbackPlacements:{type:Ue(Array),default:["bottom-start","top-start","right","left"]},appendTo:String,...qN,...$n(["ariaLabel"])}),cm="ElSelect",vD=d.defineComponent({name:cm,componentName:cm,components:{ElSelectMenu:cD,ElOption:iu,ElOptions:dD,ElTag:KE,ElScrollbar:hA,ElTooltip:Yf,ElIcon:st},directives:{ClickOutside:VE},props:pD,emits:[gr,Yn,"remove-tag","clear","visible-change","focus","blur"],setup(e,{emit:r}){const t=d.computed(()=>{const{modelValue:i,multiple:o}=e,l=o?[]:void 0;return Et(i)?o?i:l:o?l:i}),n=d.reactive({...d.toRefs(e),modelValue:t}),a=mD(n,r);return d.provide(Gi,d.reactive({props:n,states:a.states,optionsArray:a.optionsArray,handleOptionSelect:a.handleOptionSelect,onOptionCreate:a.onOptionCreate,onOptionDestroy:a.onOptionDestroy,selectRef:a.selectRef,setSelected:a.setSelected})),{...a,modelValue:t}}});function hD(e,r,t,n,a,i){const o=d.resolveComponent("el-tag"),l=d.resolveComponent("el-tooltip"),u=d.resolveComponent("el-icon"),s=d.resolveComponent("el-option"),c=d.resolveComponent("el-options"),f=d.resolveComponent("el-scrollbar"),m=d.resolveComponent("el-select-menu"),p=d.resolveDirective("click-outside");return d.withDirectives((d.openBlock(),d.createElementBlock("div",{ref:"selectRef",class:d.normalizeClass([e.nsSelect.b(),e.nsSelect.m(e.selectSize)]),[d.toHandlerKey(e.mouseEnterEventName)]:v=>e.states.inputHovering=!0,onMouseleave:v=>e.states.inputHovering=!1},[d.createVNode(l,{ref:"tooltipRef",visible:e.dropdownMenuVisible,placement:e.placement,teleported:e.teleported,"popper-class":[e.nsSelect.e("popper"),e.popperClass],"popper-options":e.popperOptions,"fallback-placements":e.fallbackPlacements,effect:e.effect,pure:"",trigger:"click",transition:`${e.nsSelect.namespace.value}-zoom-in-top`,"stop-popper-mouse-event":!1,"gpu-acceleration":!1,persistent:e.persistent,"append-to":e.appendTo,onBeforeShow:e.handleMenuEnter,onHide:v=>e.states.isBeforeHide=!1},{default:d.withCtx(()=>{var v;return[d.createElementVNode("div",{ref:"wrapperRef",class:d.normalizeClass([e.nsSelect.e("wrapper"),e.nsSelect.is("focused",e.isFocused),e.nsSelect.is("hovering",e.states.inputHovering),e.nsSelect.is("filterable",e.filterable),e.nsSelect.is("disabled",e.selectDisabled)]),onClick:d.withModifiers(e.toggleMenu,["prevent"])},[e.$slots.prefix?(d.openBlock(),d.createElementBlock("div",{key:0,ref:"prefixRef",class:d.normalizeClass(e.nsSelect.e("prefix"))},[d.renderSlot(e.$slots,"prefix")],2)):d.createCommentVNode("v-if",!0),d.createElementVNode("div",{ref:"selectionRef",class:d.normalizeClass([e.nsSelect.e("selection"),e.nsSelect.is("near",e.multiple&&!e.$slots.prefix&&!!e.states.selected.length)])},[e.multiple?d.renderSlot(e.$slots,"tag",{key:0},()=>[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(e.showTagList,h=>(d.openBlock(),d.createElementBlock("div",{key:e.getValueKey(h),class:d.normalizeClass(e.nsSelect.e("selected-item"))},[d.createVNode(o,{closable:!e.selectDisabled&&!h.isDisabled,size:e.collapseTagSize,type:e.tagType,effect:e.tagEffect,"disable-transitions":"",style:d.normalizeStyle(e.tagStyle),onClose:w=>e.deleteTag(w,h)},{default:d.withCtx(()=>[d.createElementVNode("span",{class:d.normalizeClass(e.nsSelect.e("tags-text"))},[d.renderSlot(e.$slots,"label",{label:h.currentLabel,value:h.value},()=>[d.createTextVNode(d.toDisplayString(h.currentLabel),1)])],2)]),_:2},1032,["closable","size","type","effect","style","onClose"])],2))),128)),e.collapseTags&&e.states.selected.length>e.maxCollapseTags?(d.openBlock(),d.createBlock(l,{key:0,ref:"tagTooltipRef",disabled:e.dropdownMenuVisible||!e.collapseTagsTooltip,"fallback-placements":["bottom","top","right","left"],effect:e.effect,placement:"bottom",teleported:e.teleported},{default:d.withCtx(()=>[d.createElementVNode("div",{ref:"collapseItemRef",class:d.normalizeClass(e.nsSelect.e("selected-item"))},[d.createVNode(o,{closable:!1,size:e.collapseTagSize,type:e.tagType,effect:e.tagEffect,"disable-transitions":"",style:d.normalizeStyle(e.collapseTagStyle)},{default:d.withCtx(()=>[d.createElementVNode("span",{class:d.normalizeClass(e.nsSelect.e("tags-text"))}," + "+d.toDisplayString(e.states.selected.length-e.maxCollapseTags),3)]),_:1},8,["size","type","effect","style"])],2)]),content:d.withCtx(()=>[d.createElementVNode("div",{ref:"tagMenuRef",class:d.normalizeClass(e.nsSelect.e("selection"))},[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(e.collapseTagList,h=>(d.openBlock(),d.createElementBlock("div",{key:e.getValueKey(h),class:d.normalizeClass(e.nsSelect.e("selected-item"))},[d.createVNode(o,{class:"in-tooltip",closable:!e.selectDisabled&&!h.isDisabled,size:e.collapseTagSize,type:e.tagType,effect:e.tagEffect,"disable-transitions":"",onClose:w=>e.deleteTag(w,h)},{default:d.withCtx(()=>[d.createElementVNode("span",{class:d.normalizeClass(e.nsSelect.e("tags-text"))},[d.renderSlot(e.$slots,"label",{label:h.currentLabel,value:h.value},()=>[d.createTextVNode(d.toDisplayString(h.currentLabel),1)])],2)]),_:2},1032,["closable","size","type","effect","onClose"])],2))),128))],2)]),_:3},8,["disabled","effect","teleported"])):d.createCommentVNode("v-if",!0)]):d.createCommentVNode("v-if",!0),e.selectDisabled?d.createCommentVNode("v-if",!0):(d.openBlock(),d.createElementBlock("div",{key:1,class:d.normalizeClass([e.nsSelect.e("selected-item"),e.nsSelect.e("input-wrapper"),e.nsSelect.is("hidden",!e.filterable)])},[d.withDirectives(d.createElementVNode("input",{id:e.inputId,ref:"inputRef","onUpdate:modelValue":h=>e.states.inputValue=h,type:"text",name:e.name,class:d.normalizeClass([e.nsSelect.e("input"),e.nsSelect.is(e.selectSize)]),disabled:e.selectDisabled,autocomplete:e.autocomplete,style:d.normalizeStyle(e.inputStyle),role:"combobox",readonly:!e.filterable,spellcheck:"false","aria-activedescendant":((v=e.hoverOption)==null?void 0:v.id)||"","aria-controls":e.contentId,"aria-expanded":e.dropdownMenuVisible,"aria-label":e.ariaLabel,"aria-autocomplete":"none","aria-haspopup":"listbox",onKeydown:[d.withKeys(d.withModifiers(h=>e.navigateOptions("next"),["stop","prevent"]),["down"]),d.withKeys(d.withModifiers(h=>e.navigateOptions("prev"),["stop","prevent"]),["up"]),d.withKeys(d.withModifiers(e.handleEsc,["stop","prevent"]),["esc"]),d.withKeys(d.withModifiers(e.selectOption,["stop","prevent"]),["enter"]),d.withKeys(d.withModifiers(e.deletePrevTag,["stop"]),["delete"])],onCompositionstart:e.handleCompositionStart,onCompositionupdate:e.handleCompositionUpdate,onCompositionend:e.handleCompositionEnd,onInput:e.onInput,onClick:d.withModifiers(e.toggleMenu,["stop"])},null,46,["id","onUpdate:modelValue","name","disabled","autocomplete","readonly","aria-activedescendant","aria-controls","aria-expanded","aria-label","onKeydown","onCompositionstart","onCompositionupdate","onCompositionend","onInput","onClick"]),[[d.vModelText,e.states.inputValue]]),e.filterable?(d.openBlock(),d.createElementBlock("span",{key:0,ref:"calculatorRef","aria-hidden":"true",class:d.normalizeClass(e.nsSelect.e("input-calculator")),textContent:d.toDisplayString(e.states.inputValue)},null,10,["textContent"])):d.createCommentVNode("v-if",!0)],2)),e.shouldShowPlaceholder?(d.openBlock(),d.createElementBlock("div",{key:2,class:d.normalizeClass([e.nsSelect.e("selected-item"),e.nsSelect.e("placeholder"),e.nsSelect.is("transparent",!e.hasModelValue||e.expanded&&!e.states.inputValue)])},[e.hasModelValue?d.renderSlot(e.$slots,"label",{key:0,label:e.currentPlaceholder,value:e.modelValue},()=>[d.createElementVNode("span",null,d.toDisplayString(e.currentPlaceholder),1)]):(d.openBlock(),d.createElementBlock("span",{key:1},d.toDisplayString(e.currentPlaceholder),1))],2)):d.createCommentVNode("v-if",!0)],2),d.createElementVNode("div",{ref:"suffixRef",class:d.normalizeClass(e.nsSelect.e("suffix"))},[e.iconComponent&&!e.showClose?(d.openBlock(),d.createBlock(u,{key:0,class:d.normalizeClass([e.nsSelect.e("caret"),e.nsSelect.e("icon"),e.iconReverse])},{default:d.withCtx(()=>[(d.openBlock(),d.createBlock(d.resolveDynamicComponent(e.iconComponent)))]),_:1},8,["class"])):d.createCommentVNode("v-if",!0),e.showClose&&e.clearIcon?(d.openBlock(),d.createBlock(u,{key:1,class:d.normalizeClass([e.nsSelect.e("caret"),e.nsSelect.e("icon"),e.nsSelect.e("clear")]),onClick:e.handleClearClick},{default:d.withCtx(()=>[(d.openBlock(),d.createBlock(d.resolveDynamicComponent(e.clearIcon)))]),_:1},8,["class","onClick"])):d.createCommentVNode("v-if",!0),e.validateState&&e.validateIcon?(d.openBlock(),d.createBlock(u,{key:2,class:d.normalizeClass([e.nsInput.e("icon"),e.nsInput.e("validateIcon")])},{default:d.withCtx(()=>[(d.openBlock(),d.createBlock(d.resolveDynamicComponent(e.validateIcon)))]),_:1},8,["class"])):d.createCommentVNode("v-if",!0)],2)],10,["onClick"])]}),content:d.withCtx(()=>[d.createVNode(m,{ref:"menuRef"},{default:d.withCtx(()=>[e.$slots.header?(d.openBlock(),d.createElementBlock("div",{key:0,class:d.normalizeClass(e.nsSelect.be("dropdown","header")),onClick:d.withModifiers(()=>{},["stop"])},[d.renderSlot(e.$slots,"header")],10,["onClick"])):d.createCommentVNode("v-if",!0),d.withDirectives(d.createVNode(f,{id:e.contentId,ref:"scrollbarRef",tag:"ul","wrap-class":e.nsSelect.be("dropdown","wrap"),"view-class":e.nsSelect.be("dropdown","list"),class:d.normalizeClass([e.nsSelect.is("empty",e.filteredOptionsCount===0)]),role:"listbox","aria-label":e.ariaLabel,"aria-orientation":"vertical"},{default:d.withCtx(()=>[e.showNewOption?(d.openBlock(),d.createBlock(s,{key:0,value:e.states.inputValue,created:!0},null,8,["value"])):d.createCommentVNode("v-if",!0),d.createVNode(c,null,{default:d.withCtx(()=>[d.renderSlot(e.$slots,"default")]),_:3})]),_:3},8,["id","wrap-class","view-class","class","aria-label"]),[[d.vShow,e.states.options.size>0&&!e.loading]]),e.$slots.loading&&e.loading?(d.openBlock(),d.createElementBlock("div",{key:1,class:d.normalizeClass(e.nsSelect.be("dropdown","loading"))},[d.renderSlot(e.$slots,"loading")],2)):e.loading||e.filteredOptionsCount===0?(d.openBlock(),d.createElementBlock("div",{key:2,class:d.normalizeClass(e.nsSelect.be("dropdown","empty"))},[d.renderSlot(e.$slots,"empty",{},()=>[d.createElementVNode("span",null,d.toDisplayString(e.emptyText),1)])],2)):d.createCommentVNode("v-if",!0),e.$slots.footer?(d.openBlock(),d.createElementBlock("div",{key:3,class:d.normalizeClass(e.nsSelect.be("dropdown","footer")),onClick:d.withModifiers(()=>{},["stop"])},[d.renderSlot(e.$slots,"footer")],10,["onClick"])):d.createCommentVNode("v-if",!0)]),_:3},512)]),_:3},8,["visible","placement","teleported","popper-class","popper-options","fallback-placements","effect","transition","persistent","append-to","onBeforeShow","onHide"])],16,["onMouseleave"])),[[p,e.handleClickOutside,e.popperRef]])}var gD=mr(vD,[["render",hD],["__file","select.vue"]]);const yD=d.defineComponent({name:"ElOptionGroup",componentName:"ElOptionGroup",props:{label:String,disabled:Boolean},setup(e){const r=fr("select"),t=d.ref(null),n=d.getCurrentInstance(),a=d.ref([]);d.provide(lm,d.reactive({...d.toRefs(e)}));const i=d.computed(()=>a.value.some(s=>s.visible===!0)),o=s=>{var c,f;return((c=s.type)==null?void 0:c.name)==="ElOption"&&!!((f=s.component)!=null&&f.proxy)},l=s=>{const c=tn(s),f=[];return c.forEach(m=>{var p,v;o(m)?f.push(m.component.proxy):(p=m.children)!=null&&p.length?f.push(...l(m.children)):(v=m.component)!=null&&v.subTree&&f.push(...l(m.component.subTree))}),f},u=()=>{a.value=l(n.subTree)};return d.onMounted(()=>{u()}),qy(t,u,{attributes:!0,subtree:!0,childList:!0}),{groupRef:t,visible:i,ns:r}}});function bD(e,r,t,n,a,i){return d.withDirectives((d.openBlock(),d.createElementBlock("ul",{ref:"groupRef",class:d.normalizeClass(e.ns.be("group","wrap"))},[d.createElementVNode("li",{class:d.normalizeClass(e.ns.be("group","title"))},d.toDisplayString(e.label),3),d.createElementVNode("li",null,[d.createElementVNode("ul",{class:d.normalizeClass(e.ns.b("group"))},[d.renderSlot(e.$slots,"default")],2)])],2)),[[d.vShow,e.visible]])}var fm=mr(yD,[["render",bD],["__file","option-group.vue"]]);const mm=nt(gD,{Option:iu,OptionGroup:fm}),dm=Cs(iu);Cs(fm);const pm=Symbol("sliderContextKey"),wD=cr({modelValue:{type:Ue([Number,Array]),default:0},id:{type:String,default:void 0},min:{type:Number,default:0},max:{type:Number,default:100},step:{type:Number,default:1},showInput:Boolean,showInputControls:{type:Boolean,default:!0},size:ia,inputSize:ia,showStops:Boolean,showTooltip:{type:Boolean,default:!0},formatTooltip:{type:Ue(Function),default:void 0},disabled:Boolean,range:Boolean,vertical:Boolean,height:String,debounce:{type:Number,default:300},rangeStartLabel:{type:String,default:void 0},rangeEndLabel:{type:String,default:void 0},formatValueText:{type:Ue(Function),default:void 0},tooltipClass:{type:String,default:void 0},placement:{type:String,values:Qn,default:"top"},marks:{type:Ue(Object)},validateEvent:{type:Boolean,default:!0},...$n(["ariaLabel"])}),ou=e=>lr(e)||Et(e)&&e.every(lr),xD={[gr]:ou,[Fn]:ou,[Yn]:ou},ND=(e,r,t)=>{const n=d.ref();return d.onMounted(async()=>{e.range?(Array.isArray(e.modelValue)?(r.firstValue=Math.max(e.min,e.modelValue[0]),r.secondValue=Math.min(e.max,e.modelValue[1])):(r.firstValue=e.min,r.secondValue=e.max),r.oldValue=[r.firstValue,r.secondValue]):(typeof e.modelValue!="number"||Number.isNaN(e.modelValue)?r.firstValue=e.min:r.firstValue=Math.min(e.max,Math.max(e.min,e.modelValue)),r.oldValue=r.firstValue),zr(window,"resize",t),await d.nextTick(),t()}),{sliderWrapper:n}},AD=e=>d.computed(()=>e.marks?Object.keys(e.marks).map(Number.parseFloat).sort((t,n)=>t-n).filter(t=>t<=e.max&&t>=e.min).map(t=>({point:t,position:(t-e.min)*100/(e.max-e.min),mark:e.marks[t]})):[]),ED=(e,r,t)=>{const{form:n,formItem:a}=ja(),i=d.shallowRef(),o=d.ref(),l=d.ref(),u={firstButton:o,secondButton:l},s=d.computed(()=>e.disabled||(n==null?void 0:n.disabled)||!1),c=d.computed(()=>Math.min(r.firstValue,r.secondValue)),f=d.computed(()=>Math.max(r.firstValue,r.secondValue)),m=d.computed(()=>e.range?`${100*(f.value-c.value)/(e.max-e.min)}%`:`${100*(r.firstValue-e.min)/(e.max-e.min)}%`),p=d.computed(()=>e.range?`${100*(c.value-e.min)/(e.max-e.min)}%`:"0%"),v=d.computed(()=>e.vertical?{height:e.height}:{}),h=d.computed(()=>e.vertical?{height:m.value,bottom:p.value}:{width:m.value,left:p.value}),w=()=>{i.value&&(r.sliderSize=i.value[`client${e.vertical?"Height":"Width"}`])},b=F=>{const I=e.min+F*(e.max-e.min)/100;if(!e.range)return o;let R;return Math.abs(c.value-I)r.secondValue?"firstButton":"secondButton",u[R]},A=F=>{const I=b(F);return I.value.setPosition(F),I},g=F=>{r.firstValue=F??e.min,x(e.range?[c.value,f.value]:F??e.min)},N=F=>{r.secondValue=F,e.range&&x([c.value,f.value])},x=F=>{t(gr,F),t(Fn,F)},y=async()=>{await d.nextTick(),t(Yn,e.range?[c.value,f.value]:e.modelValue)},D=F=>{var I,R,$,M,T,k;if(s.value||r.dragging)return;w();let O=0;if(e.vertical){const W=($=(R=(I=F.touches)==null?void 0:I.item(0))==null?void 0:R.clientY)!=null?$:F.clientY;O=(i.value.getBoundingClientRect().bottom-W)/r.sliderSize*100}else{const W=(k=(T=(M=F.touches)==null?void 0:M.item(0))==null?void 0:T.clientX)!=null?k:F.clientX,X=i.value.getBoundingClientRect().left;O=(W-X)/r.sliderSize*100}if(!(O<0||O>100))return A(O)};return{elFormItem:a,slider:i,firstButton:o,secondButton:l,sliderDisabled:s,minValue:c,maxValue:f,runwayStyle:v,barStyle:h,resetSize:w,setPosition:A,emitChange:y,onSliderWrapperPrevent:F=>{var I,R;((I=u.firstButton.value)!=null&&I.dragging||(R=u.secondButton.value)!=null&&R.dragging)&&F.preventDefault()},onSliderClick:F=>{D(F)&&y()},onSliderDown:async F=>{const I=D(F);I&&(await d.nextTick(),I.value.onButtonDown(F))},onSliderMarkerDown:F=>{s.value||r.dragging||A(F)},setFirstValue:g,setSecondValue:N}},{left:DD,down:SD,right:CD,up:MD,home:_D,end:TD,pageUp:FD,pageDown:BD}=Jn,OD=(e,r,t)=>{const n=d.ref(),a=d.ref(!1),i=d.computed(()=>r.value instanceof Function),o=d.computed(()=>i.value&&r.value(e.modelValue)||e.modelValue),l=Ns(()=>{t.value&&(a.value=!0)},50),u=Ns(()=>{t.value&&(a.value=!1)},50);return{tooltip:n,tooltipVisible:a,formatValue:o,displayTooltip:l,hideTooltip:u}},$D=(e,r,t)=>{const{disabled:n,min:a,max:i,step:o,showTooltip:l,precision:u,sliderSize:s,formatTooltip:c,emitChange:f,resetSize:m,updateDragging:p}=d.inject(pm),{tooltip:v,tooltipVisible:h,formatValue:w,displayTooltip:b,hideTooltip:A}=OD(e,c,l),g=d.ref(),N=d.computed(()=>`${(e.modelValue-a.value)/(i.value-a.value)*100}%`),x=d.computed(()=>e.vertical?{bottom:N.value}:{left:N.value}),y=()=>{r.hovering=!0,b()},D=()=>{r.hovering=!1,r.dragging||A()},S=U=>{n.value||(U.preventDefault(),k(U),window.addEventListener("mousemove",O),window.addEventListener("touchmove",O),window.addEventListener("mouseup",W),window.addEventListener("touchend",W),window.addEventListener("contextmenu",W),g.value.focus())},E=U=>{n.value||(r.newPosition=Number.parseFloat(N.value)+U/(i.value-a.value)*100,X(r.newPosition),f())},C=()=>{E(-o.value)},_=()=>{E(o.value)},F=()=>{E(-o.value*4)},I=()=>{E(o.value*4)},R=()=>{n.value||(X(0),f())},$=()=>{n.value||(X(100),f())},M=U=>{let z=!0;[DD,SD].includes(U.key)?C():[CD,MD].includes(U.key)?_():U.key===_D?R():U.key===TD?$():U.key===BD?F():U.key===FD?I():z=!1,z&&U.preventDefault()},T=U=>{let z,Q;return U.type.startsWith("touch")?(Q=U.touches[0].clientY,z=U.touches[0].clientX):(Q=U.clientY,z=U.clientX),{clientX:z,clientY:Q}},k=U=>{r.dragging=!0,r.isClick=!0;const{clientX:z,clientY:Q}=T(U);e.vertical?r.startY=Q:r.startX=z,r.startPosition=Number.parseFloat(N.value),r.newPosition=r.startPosition},O=U=>{if(r.dragging){r.isClick=!1,b(),m();let z;const{clientX:Q,clientY:se}=T(U);e.vertical?(r.currentY=se,z=(r.startY-r.currentY)/s.value*100):(r.currentX=Q,z=(r.currentX-r.startX)/s.value*100),r.newPosition=r.startPosition+z,X(r.newPosition)}},W=()=>{r.dragging&&(setTimeout(()=>{r.dragging=!1,r.hovering||A(),r.isClick||X(r.newPosition),f()},0),window.removeEventListener("mousemove",O),window.removeEventListener("touchmove",O),window.removeEventListener("mouseup",W),window.removeEventListener("touchend",W),window.removeEventListener("contextmenu",W))},X=async U=>{if(U===null||Number.isNaN(+U))return;U<0?U=0:U>100&&(U=100);const z=100/((i.value-a.value)/o.value);let se=Math.round(U/z)*z*(i.value-a.value)*.01+a.value;se=Number.parseFloat(se.toFixed(u.value)),se!==e.modelValue&&t(gr,se),!r.dragging&&e.modelValue!==r.oldValue&&(r.oldValue=e.modelValue),await d.nextTick(),r.dragging&&b(),v.value.updatePopper()};return d.watch(()=>r.dragging,U=>{p(U)}),zr(g,"touchstart",S,{passive:!1}),{disabled:n,button:g,tooltip:v,tooltipVisible:h,showTooltip:l,wrapperStyle:x,formatValue:w,handleMouseEnter:y,handleMouseLeave:D,onButtonDown:S,onKeyDown:M,setPosition:X}},ID=(e,r,t,n)=>({stops:d.computed(()=>{if(!e.showStops||e.min>e.max)return[];if(e.step===0)return hr("ElSlider","step should not be 0."),[];const o=(e.max-e.min)/e.step,l=100*e.step/(e.max-e.min),u=Array.from({length:o-1}).map((s,c)=>(c+1)*l);return e.range?u.filter(s=>s<100*(t.value-e.min)/(e.max-e.min)||s>100*(n.value-e.min)/(e.max-e.min)):u.filter(s=>s>100*(r.firstValue-e.min)/(e.max-e.min))}),getStopStyle:o=>e.vertical?{bottom:`${o}%`}:{left:`${o}%`}}),RD=(e,r,t,n,a,i)=>{const o=s=>{a(gr,s),a(Fn,s)},l=()=>e.range?![t.value,n.value].every((s,c)=>s===r.oldValue[c]):e.modelValue!==r.oldValue,u=()=>{var s,c;e.min>e.max&&Es("Slider","min should not be greater than max.");const f=e.modelValue;e.range&&Array.isArray(f)?f[1]e.max?o([e.max,e.max]):f[0]e.max?o([f[0],e.max]):(r.firstValue=f[0],r.secondValue=f[1],l()&&(e.validateEvent&&((s=i==null?void 0:i.validate)==null||s.call(i,"change").catch(m=>hr(m))),r.oldValue=f.slice())):!e.range&&typeof f=="number"&&!Number.isNaN(f)&&(fe.max?o(e.max):(r.firstValue=f,l()&&(e.validateEvent&&((c=i==null?void 0:i.validate)==null||c.call(i,"change").catch(m=>hr(m))),r.oldValue=f)))};u(),d.watch(()=>r.dragging,s=>{s||u()}),d.watch(()=>e.modelValue,(s,c)=>{r.dragging||Array.isArray(s)&&Array.isArray(c)&&s.every((f,m)=>f===c[m])&&r.firstValue===s[0]&&r.secondValue===s[1]||u()},{deep:!0}),d.watch(()=>[e.min,e.max],()=>{u()})},zD=cr({modelValue:{type:Number,default:0},vertical:Boolean,tooltipClass:String,placement:{type:String,values:Qn,default:"top"}}),PD={[gr]:e=>lr(e)},kD=d.defineComponent({name:"ElSliderButton"}),qD=d.defineComponent({...kD,props:zD,emits:PD,setup(e,{expose:r,emit:t}){const n=e,a=fr("slider"),i=d.reactive({hovering:!1,dragging:!1,isClick:!1,startX:0,currentX:0,startY:0,currentY:0,startPosition:0,newPosition:0,oldValue:n.modelValue}),{disabled:o,button:l,tooltip:u,showTooltip:s,tooltipVisible:c,wrapperStyle:f,formatValue:m,handleMouseEnter:p,handleMouseLeave:v,onButtonDown:h,onKeyDown:w,setPosition:b}=$D(n,i,t),{hovering:A,dragging:g}=d.toRefs(i);return r({onButtonDown:h,onKeyDown:w,setPosition:b,hovering:A,dragging:g}),(N,x)=>(d.openBlock(),d.createElementBlock("div",{ref_key:"button",ref:l,class:d.normalizeClass([d.unref(a).e("button-wrapper"),{hover:d.unref(A),dragging:d.unref(g)}]),style:d.normalizeStyle(d.unref(f)),tabindex:d.unref(o)?-1:0,onMouseenter:d.unref(p),onMouseleave:d.unref(v),onMousedown:d.unref(h),onFocus:d.unref(p),onBlur:d.unref(v),onKeydown:d.unref(w)},[d.createVNode(d.unref(Yf),{ref_key:"tooltip",ref:u,visible:d.unref(c),placement:N.placement,"fallback-placements":["top","bottom","right","left"],"stop-popper-mouse-event":!1,"popper-class":N.tooltipClass,disabled:!d.unref(s),persistent:""},{content:d.withCtx(()=>[d.createElementVNode("span",null,d.toDisplayString(d.unref(m)),1)]),default:d.withCtx(()=>[d.createElementVNode("div",{class:d.normalizeClass([d.unref(a).e("button"),{hover:d.unref(A),dragging:d.unref(g)}])},null,2)]),_:1},8,["visible","placement","popper-class","disabled"])],46,["tabindex","onMouseenter","onMouseleave","onMousedown","onFocus","onBlur","onKeydown"]))}});var vm=mr(qD,[["__file","button.vue"]]);const LD=cr({mark:{type:Ue([String,Object]),default:void 0}});var VD=d.defineComponent({name:"ElSliderMarker",props:LD,setup(e){const r=fr("slider"),t=d.computed(()=>Jr(e.mark)?e.mark:e.mark.label),n=d.computed(()=>Jr(e.mark)?void 0:e.mark.style);return()=>d.h("div",{class:r.e("marks-text"),style:n.value},t.value)}});const UD=d.defineComponent({name:"ElSlider"}),HD=d.defineComponent({...UD,props:wD,emits:xD,setup(e,{expose:r,emit:t}){const n=e,a=fr("slider"),{t:i}=_i(),o=d.reactive({firstValue:0,secondValue:0,oldValue:0,dragging:!1,sliderSize:1}),{elFormItem:l,slider:u,firstButton:s,secondButton:c,sliderDisabled:f,minValue:m,maxValue:p,runwayStyle:v,barStyle:h,resetSize:w,emitChange:b,onSliderWrapperPrevent:A,onSliderClick:g,onSliderDown:N,onSliderMarkerDown:x,setFirstValue:y,setSecondValue:D}=ED(n,o,t),{stops:S,getStopStyle:E}=ID(n,o,m,p),{inputId:C,isLabeledByFormItem:_}=Ls(n,{formItemContext:l}),F=oa(),I=d.computed(()=>n.inputSize||F.value),R=d.computed(()=>n.ariaLabel||i("el.slider.defaultLabel",{min:n.min,max:n.max})),$=d.computed(()=>n.range?n.rangeStartLabel||i("el.slider.defaultRangeStartLabel"):R.value),M=d.computed(()=>n.formatValueText?n.formatValueText(z.value):`${z.value}`),T=d.computed(()=>n.rangeEndLabel||i("el.slider.defaultRangeEndLabel")),k=d.computed(()=>n.formatValueText?n.formatValueText(Q.value):`${Q.value}`),O=d.computed(()=>[a.b(),a.m(F.value),a.is("vertical",n.vertical),{[a.m("with-input")]:n.showInput}]),W=AD(n);RD(n,o,m,p,t,l);const X=d.computed(()=>{const q=[n.min,n.max,n.step].map(Z=>{const j=`${Z}`.split(".")[1];return j?j.length:0});return Math.max.apply(null,q)}),{sliderWrapper:U}=ND(n,o,w),{firstValue:z,secondValue:Q,sliderSize:se}=d.toRefs(o),re=q=>{o.dragging=q};return zr(U,"touchstart",A,{passive:!1}),zr(U,"touchmove",A,{passive:!1}),d.provide(pm,{...d.toRefs(n),sliderSize:se,disabled:f,precision:X,emitChange:b,resetSize:w,updateDragging:re}),r({onSliderClick:g}),(q,Z)=>{var j,Y;return d.openBlock(),d.createElementBlock("div",{id:q.range?d.unref(C):void 0,ref_key:"sliderWrapper",ref:U,class:d.normalizeClass(d.unref(O)),role:q.range?"group":void 0,"aria-label":q.range&&!d.unref(_)?d.unref(R):void 0,"aria-labelledby":q.range&&d.unref(_)?(j=d.unref(l))==null?void 0:j.labelId:void 0},[d.createElementVNode("div",{ref_key:"slider",ref:u,class:d.normalizeClass([d.unref(a).e("runway"),{"show-input":q.showInput&&!q.range},d.unref(a).is("disabled",d.unref(f))]),style:d.normalizeStyle(d.unref(v)),onMousedown:d.unref(N),onTouchstartPassive:d.unref(N)},[d.createElementVNode("div",{class:d.normalizeClass(d.unref(a).e("bar")),style:d.normalizeStyle(d.unref(h))},null,6),d.createVNode(vm,{id:q.range?void 0:d.unref(C),ref_key:"firstButton",ref:s,"model-value":d.unref(z),vertical:q.vertical,"tooltip-class":q.tooltipClass,placement:q.placement,role:"slider","aria-label":q.range||!d.unref(_)?d.unref($):void 0,"aria-labelledby":!q.range&&d.unref(_)?(Y=d.unref(l))==null?void 0:Y.labelId:void 0,"aria-valuemin":q.min,"aria-valuemax":q.range?d.unref(Q):q.max,"aria-valuenow":d.unref(z),"aria-valuetext":d.unref(M),"aria-orientation":q.vertical?"vertical":"horizontal","aria-disabled":d.unref(f),"onUpdate:modelValue":d.unref(y)},null,8,["id","model-value","vertical","tooltip-class","placement","aria-label","aria-labelledby","aria-valuemin","aria-valuemax","aria-valuenow","aria-valuetext","aria-orientation","aria-disabled","onUpdate:modelValue"]),q.range?(d.openBlock(),d.createBlock(vm,{key:0,ref_key:"secondButton",ref:c,"model-value":d.unref(Q),vertical:q.vertical,"tooltip-class":q.tooltipClass,placement:q.placement,role:"slider","aria-label":d.unref(T),"aria-valuemin":d.unref(z),"aria-valuemax":q.max,"aria-valuenow":d.unref(Q),"aria-valuetext":d.unref(k),"aria-orientation":q.vertical?"vertical":"horizontal","aria-disabled":d.unref(f),"onUpdate:modelValue":d.unref(D)},null,8,["model-value","vertical","tooltip-class","placement","aria-label","aria-valuemin","aria-valuemax","aria-valuenow","aria-valuetext","aria-orientation","aria-disabled","onUpdate:modelValue"])):d.createCommentVNode("v-if",!0),q.showStops?(d.openBlock(),d.createElementBlock("div",{key:1},[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(d.unref(S),(ee,te)=>(d.openBlock(),d.createElementBlock("div",{key:te,class:d.normalizeClass(d.unref(a).e("stop")),style:d.normalizeStyle(d.unref(E)(ee))},null,6))),128))])):d.createCommentVNode("v-if",!0),d.unref(W).length>0?(d.openBlock(),d.createElementBlock(d.Fragment,{key:2},[d.createElementVNode("div",null,[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(d.unref(W),(ee,te)=>(d.openBlock(),d.createElementBlock("div",{key:te,style:d.normalizeStyle(d.unref(E)(ee.position)),class:d.normalizeClass([d.unref(a).e("stop"),d.unref(a).e("marks-stop")])},null,6))),128))]),d.createElementVNode("div",{class:d.normalizeClass(d.unref(a).e("marks"))},[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(d.unref(W),(ee,te)=>(d.openBlock(),d.createBlock(d.unref(VD),{key:te,mark:ee.mark,style:d.normalizeStyle(d.unref(E)(ee.position)),onMousedown:d.withModifiers(oe=>d.unref(x)(ee.position),["stop"])},null,8,["mark","style","onMousedown"]))),128))],2)],64)):d.createCommentVNode("v-if",!0)],46,["onMousedown","onTouchstartPassive"]),q.showInput&&!q.range?(d.openBlock(),d.createBlock(d.unref(au),{key:0,ref:"input","model-value":d.unref(z),class:d.normalizeClass(d.unref(a).e("input")),step:q.step,disabled:d.unref(f),controls:q.showInputControls,min:q.min,max:q.max,precision:d.unref(X),debounce:q.debounce,size:d.unref(I),"onUpdate:modelValue":d.unref(y),onChange:d.unref(b)},null,8,["model-value","class","step","disabled","controls","min","max","precision","debounce","size","onUpdate:modelValue","onChange"])):d.createCommentVNode("v-if",!0)],10,["id","role","aria-label","aria-labelledby"])}}});var ZD=mr(HD,[["__file","slider.vue"]]);const hm=nt(ZD);function GD(e){let r;const t=d.ref(!1),n=d.reactive({...e,originalPosition:"",originalOverflow:"",visible:!1});function a(m){n.text=m}function i(){const m=n.parent,p=f.ns;if(!m.vLoadingAddClassList){let v=m.getAttribute("loading-number");v=Number.parseInt(v)-1,v?m.setAttribute("loading-number",v.toString()):(Ci(m,p.bm("parent","relative")),m.removeAttribute("loading-number")),Ci(m,p.bm("parent","hidden"))}o(),c.unmount()}function o(){var m,p;(p=(m=f.$el)==null?void 0:m.parentNode)==null||p.removeChild(f.$el)}function l(){var m;e.beforeClose&&!e.beforeClose()||(t.value=!0,clearTimeout(r),r=setTimeout(u,400),n.visible=!1,(m=e.closed)==null||m.call(e))}function u(){if(!t.value)return;const m=n.parent;t.value=!1,m.vLoadingAddClassList=void 0,i()}const s=d.defineComponent({name:"ElLoading",setup(m,{expose:p}){const{ns:v,zIndex:h}=UN("loading");return p({ns:v,zIndex:h}),()=>{const w=n.spinner||n.svg,b=d.h("svg",{class:"circular",viewBox:n.svgViewBox?n.svgViewBox:"0 0 50 50",...w?{innerHTML:w}:{}},[d.h("circle",{class:"path",cx:"25",cy:"25",r:"20",fill:"none"})]),A=n.text?d.h("p",{class:v.b("text")},[n.text]):void 0;return d.h(d.Transition,{name:v.b("fade"),onAfterLeave:u},{default:d.withCtx(()=>[d.withDirectives(d.createVNode("div",{style:{backgroundColor:n.background||""},class:[v.b("mask"),n.customClass,n.fullscreen?"is-fullscreen":""]},[d.h("div",{class:v.b("spinner")},[b,A])]),[[d.vShow,n.visible]])])})}}}),c=d.createApp(s),f=c.mount(document.createElement("div"));return{...d.toRefs(n),setText:a,removeElLoadingChild:o,close:l,handleAfterLeave:u,vm:f,get $el(){return f.$el}}}let Wi;const su=function(e={}){if(!yr)return;const r=WD(e);if(r.fullscreen&&Wi)return Wi;const t=GD({...r,closed:()=>{var a;(a=r.closed)==null||a.call(r),r.fullscreen&&(Wi=void 0)}});jD(r,r.parent,t),gm(r,r.parent,t),r.parent.vLoadingAddClassList=()=>gm(r,r.parent,t);let n=r.parent.getAttribute("loading-number");return n?n=`${Number.parseInt(n)+1}`:n="1",r.parent.setAttribute("loading-number",n),r.parent.appendChild(t.$el),d.nextTick(()=>t.visible.value=r.visible),r.fullscreen&&(Wi=t),t},WD=e=>{var r,t,n,a;let i;return Jr(e.target)?i=(r=document.querySelector(e.target))!=null?r:document.body:i=e.target||document.body,{parent:i===document.body||e.body?document.body:i,background:e.background||"",svg:e.svg||"",svgViewBox:e.svgViewBox||"",spinner:e.spinner||!1,text:e.text||"",fullscreen:i===document.body&&((t=e.fullscreen)!=null?t:!0),lock:(n=e.lock)!=null?n:!1,customClass:e.customClass||"",visible:(a=e.visible)!=null?a:!0,beforeClose:e.beforeClose,closed:e.closed,target:i}},jD=async(e,r,t)=>{const{nextZIndex:n}=t.vm.zIndex||t.vm._.exposed.zIndex,a={};if(e.fullscreen)t.originalPosition.value=qa(document.body,"position"),t.originalOverflow.value=qa(document.body,"overflow"),a.zIndex=n();else if(e.parent===document.body){t.originalPosition.value=qa(document.body,"position"),await d.nextTick();for(const i of["top","left"]){const o=i==="top"?"scrollTop":"scrollLeft";a[i]=`${e.target.getBoundingClientRect()[i]+document.body[o]+document.documentElement[o]-Number.parseInt(qa(document.body,`margin-${i}`),10)}px`}for(const i of["height","width"])a[i]=`${e.target.getBoundingClientRect()[i]}px`}else t.originalPosition.value=qa(r,"position");for(const[i,o]of Object.entries(a))t.$el.style[i]=o},gm=(e,r,t)=>{const n=t.vm.ns||t.vm._.exposed.ns;["absolute","fixed","sticky"].includes(t.originalPosition.value)?Ci(r,n.bm("parent","relative")):kc(r,n.bm("parent","relative")),e.fullscreen&&e.lock?kc(r,n.bm("parent","hidden")):Ci(r,n.bm("parent","hidden"))},ji=Symbol("ElLoading"),ym=(e,r)=>{var t,n,a,i;const o=r.instance,l=m=>Ur(r.value)?r.value[m]:void 0,u=m=>{const p=Jr(m)&&(o==null?void 0:o[m])||m;return p&&d.ref(p)},s=m=>u(l(m)||e.getAttribute(`element-loading-${Xy(m)}`)),c=(t=l("fullscreen"))!=null?t:r.modifiers.fullscreen,f={text:s("text"),svg:s("svg"),svgViewBox:s("svgViewBox"),spinner:s("spinner"),background:s("background"),customClass:s("customClass"),fullscreen:c,target:(n=l("target"))!=null?n:c?void 0:e,body:(a=l("body"))!=null?a:r.modifiers.body,lock:(i=l("lock"))!=null?i:r.modifiers.lock};e[ji]={options:f,instance:su(f)}},KD=(e,r)=>{for(const t of Object.keys(r))d.isRef(r[t])&&(r[t].value=e[t])},uu={mounted(e,r){r.value&&ym(e,r)},updated(e,r){const t=e[ji];r.oldValue!==r.value&&(r.value&&!r.oldValue?ym(e,r):r.value&&r.oldValue?Ur(r.value)&&KD(r.value,t.options):t==null||t.instance.close())},unmounted(e){var r;(r=e[ji])==null||r.instance.close(),e[ji]=null}},JD={install(e){e.directive("loading",uu),e.config.globalProperties.$loading=su},directive:uu,service:su};function Br(){return Br=Object.assign?Object.assign.bind():function(e){for(var r=1;rthis.has(r)).values()}get(r){return Pr(this.wrappedObject,r)}set(r,t){return la(this.wrappedObject,r,t),this}has(r){return Ki(this.wrappedObject,r)&&r in this.wrappedObject}entries(){return xm(this.keys(),r=>[r,this.get(r)])}forEach(r){for(var t of this.keys())r(this.get(t),t,this)}delete(r){Ki(this.wrappedObject,r)&&delete this.wrappedObject[r]}clear(){for(var r of this.keys())this.delete(r)}get size(){return Object.keys(this.wrappedObject).length}}class wm{constructor(r,t,n){this.a=r,this.b=t,this.bKeys=n,this[Symbol.iterator]=this.entries}get(r){return this.bKeys.has(r)?this.b.get(r):this.a.get(r)}set(r,t){return this.bKeys.has(r)?this.b.set(r,t):this.a.set(r,t),this}has(r){return this.b.has(r)||this.a.has(r)}keys(){return new Set([...this.a.keys(),...this.b.keys()])[Symbol.iterator]()}entries(){return xm(this.keys(),r=>[r,this.get(r)])}forEach(r){for(var t of this.keys())r(this.get(t),t,this)}delete(r){return this.bKeys.has(r)?this.b.delete(r):this.a.delete(r)}clear(){this.a.clear(),this.b.clear()}get size(){return[...this.keys()].length}}function xm(e,r){return{next:()=>{var t=e.next();return t.done?t:{value:r(t.value),done:!1}}}}function Ka(){return new Map}function ca(e){if(!e)return Ka();if(Pn(e))return e;if(fa(e))return new Ji(e);throw new Error("createMap can create maps from objects or Maps")}function rS(e){if(e instanceof Ji)return e.wrappedObject;var r={};for(var t of e.keys()){var n=e.get(t);la(r,t,n)}return r}function Re(e){return typeof e=="number"}function Ie(e){return!e||typeof e!="object"||typeof e.constructor!="function"?!1:e.isBigNumber===!0&&typeof e.constructor.prototype=="object"&&e.constructor.prototype.isBigNumber===!0||typeof e.constructor.isDecimal=="function"&&e.constructor.isDecimal(e)===!0}function Nm(e){return typeof e=="bigint"}function gt(e){return e&&typeof e=="object"&&Object.getPrototypeOf(e).isComplex===!0||!1}function zn(e){return e&&typeof e=="object"&&Object.getPrototypeOf(e).isFraction===!0||!1}function Gr(e){return e&&e.constructor.prototype.isUnit===!0||!1}function Cr(e){return typeof e=="string"}var Xe=Array.isArray;function _e(e){return e&&e.constructor.prototype.isMatrix===!0||!1}function Xr(e){return Array.isArray(e)||_e(e)}function Ja(e){return e&&e.isDenseMatrix&&e.constructor.prototype.isMatrix===!0||!1}function cn(e){return e&&e.isSparseMatrix&&e.constructor.prototype.isMatrix===!0||!1}function Yi(e){return e&&e.constructor.prototype.isRange===!0||!1}function Ya(e){return e&&e.constructor.prototype.isIndex===!0||!1}function Am(e){return typeof e=="boolean"}function Em(e){return e&&e.constructor.prototype.isResultSet===!0||!1}function cu(e){return e&&e.constructor.prototype.isHelp===!0||!1}function Dm(e){return typeof e=="function"}function Sm(e){return e instanceof Date}function Cm(e){return e instanceof RegExp}function fa(e){return!!(e&&typeof e=="object"&&e.constructor===Object&&!gt(e)&&!zn(e))}function Pn(e){return e?e instanceof Map||e instanceof Ji||typeof e.set=="function"&&typeof e.get=="function"&&typeof e.keys=="function"&&typeof e.has=="function":!1}function tS(e){return Pn(e)&&Pn(e.a)&&Pn(e.b)}function nS(e){return Pn(e)&&fa(e.wrappedObject)}function Mm(e){return e===null}function _m(e){return e===void 0}function fn(e){return e&&e.isAccessorNode===!0&&e.constructor.prototype.isNode===!0||!1}function Qr(e){return e&&e.isArrayNode===!0&&e.constructor.prototype.isNode===!0||!1}function Tm(e){return e&&e.isAssignmentNode===!0&&e.constructor.prototype.isNode===!0||!1}function Fm(e){return e&&e.isBlockNode===!0&&e.constructor.prototype.isNode===!0||!1}function Bm(e){return e&&e.isConditionalNode===!0&&e.constructor.prototype.isNode===!0||!1}function Ze(e){return e&&e.isConstantNode===!0&&e.constructor.prototype.isNode===!0||!1}function fu(e){return Ze(e)||pr(e)&&e.args.length===1&&Ze(e.args[0])&&"-+~".includes(e.op)}function ma(e){return e&&e.isFunctionAssignmentNode===!0&&e.constructor.prototype.isNode===!0||!1}function Gt(e){return e&&e.isFunctionNode===!0&&e.constructor.prototype.isNode===!0||!1}function kn(e){return e&&e.isIndexNode===!0&&e.constructor.prototype.isNode===!0||!1}function Qe(e){return e&&e.isNode===!0&&e.constructor.prototype.isNode===!0||!1}function Xa(e){return e&&e.isObjectNode===!0&&e.constructor.prototype.isNode===!0||!1}function pr(e){return e&&e.isOperatorNode===!0&&e.constructor.prototype.isNode===!0||!1}function _t(e){return e&&e.isParenthesisNode===!0&&e.constructor.prototype.isNode===!0||!1}function Om(e){return e&&e.isRangeNode===!0&&e.constructor.prototype.isNode===!0||!1}function $m(e){return e&&e.isRelationalNode===!0&&e.constructor.prototype.isNode===!0||!1}function br(e){return e&&e.isSymbolNode===!0&&e.constructor.prototype.isNode===!0||!1}function mu(e){return e&&e.constructor.prototype.isChain===!0||!1}function tr(e){var r=typeof e;return r==="object"?e===null?"null":Ie(e)?"BigNumber":e.constructor&&e.constructor.name?e.constructor.name:"Object":r}function Fe(e){var r=typeof e;if(r==="number"||r==="bigint"||r==="string"||r==="boolean"||e===null||e===void 0)return e;if(typeof e.clone=="function")return e.clone();if(Array.isArray(e))return e.map(function(t){return Fe(t)});if(e instanceof Date)return new Date(e.valueOf());if(Ie(e))return e;if(fa(e))return aS(e,Fe);if(r==="function")return e;throw new TypeError("Cannot clone: unknown type of value (value: ".concat(e,")"))}function aS(e,r){var t={};for(var n in e)De(e,n)&&(t[n]=r(e[n]));return t}function Im(e,r){for(var t in r)De(r,t)&&(e[t]=r[t]);return e}function Rm(e,r){if(Array.isArray(r))throw new TypeError("Arrays are not supported by deepExtend");for(var t in r)if(De(r,t)&&!(t in Object.prototype)&&!(t in Function.prototype))if(r[t]&&r[t].constructor===Object)e[t]===void 0&&(e[t]={}),e[t]&&e[t].constructor===Object?Rm(e[t],r[t]):e[t]=r[t];else{if(Array.isArray(r[t]))throw new TypeError("Arrays are not supported by deepExtend");e[t]=r[t]}return e}function Wt(e,r){var t,n,a;if(Array.isArray(e)){if(!Array.isArray(r)||e.length!==r.length)return!1;for(n=0,a=e.length;n{Object.defineProperty(t,n,{get:()=>e[n],enumerable:!0,configurable:!0})}),t}function qm(e,r,t){e[r]!==void 0&&!t.includes(e[r])&&console.warn('Warning: Unknown value "'+e[r]+'" for configuration option "'+r+'". Available options: '+t.map(n=>JSON.stringify(n)).join(", ")+".")}function Lm(){return!0}function ut(){return!1}function da(){}const Vm="Argument is not a typed-function.";function Um(){function e(V){return typeof V=="object"&&V!==null&&V.constructor===Object}const r=[{name:"number",test:function(V){return typeof V=="number"}},{name:"string",test:function(V){return typeof V=="string"}},{name:"boolean",test:function(V){return typeof V=="boolean"}},{name:"Function",test:function(V){return typeof V=="function"}},{name:"Array",test:Array.isArray},{name:"Date",test:function(V){return V instanceof Date}},{name:"RegExp",test:function(V){return V instanceof RegExp}},{name:"Object",test:e},{name:"null",test:function(V){return V===null}},{name:"undefined",test:function(V){return V===void 0}}],t={name:"any",test:Lm,isAny:!0};let n,a,i=0,o={createCount:0};function l(V){const K=n.get(V);if(K)return K;let G='Unknown type "'+V+'"';const ae=V.toLowerCase();let ce;for(ce of a)if(ce.toLowerCase()===ae){G+='. Did you mean "'+ce+'" ?';break}throw new TypeError(G)}function u(V){let K=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"any";const G=K?l(K).index:a.length,ae=[];for(let fe=0;fe{const ae=n.get(G);return!ae.isAny&&ae.test(V)});return K.length?K:["any"]}function m(V){return V&&typeof V=="function"&&"_typedFunctionData"in V}function p(V,K,G){if(!m(V))throw new TypeError(Vm);const ae=G&&G.exact,ce=Array.isArray(K)?K.join(","):K,fe=N(ce),xe=w(fe);if(!ae||xe in V.signatures){const Ge=V._typedFunctionData.signatureMap.get(xe);if(Ge)return Ge}const ye=fe.length;let Ae;if(ae){Ae=[];let Ge;for(Ge in V.signatures)Ae.push(V._typedFunctionData.signatureMap.get(Ge))}else Ae=V._typedFunctionData.signatures;for(let Ge=0;Ge!J.has(ue.name)))continue}Oe.push(sr)}}if(Ae=Oe,Ae.length===0)break}let we;for(we of Ae)if(we.params.length<=ye)return we;throw new TypeError("Signature not found (signature: "+(V.name||"unnamed")+"("+w(fe,", ")+"))")}function v(V,K,G){return p(V,K,G).implementation}function h(V,K){const G=l(K);if(G.test(V))return V;const ae=G.conversionsTo;if(ae.length===0)throw new Error("There are no conversions to "+K+" defined.");for(let ce=0;ce1&&arguments[1]!==void 0?arguments[1]:",";return V.map(G=>G.name).join(K)}function b(V){const K=V.indexOf("...")===0,ae=(K?V.length>3?V.slice(3):"any":V).split("|").map(ye=>l(ye.trim()));let ce=!1,fe=K?"...":"";return{types:ae.map(function(ye){return ce=ye.isAny||ce,fe+=ye.name+"|",{name:ye.name,typeIndex:ye.index,test:ye.test,isAny:ye.isAny,conversion:null,conversionIndex:-1}}),name:fe.slice(0,-1),hasAny:ce,hasConversion:!1,restParam:K}}function A(V){const K=V.types.map(xe=>xe.name),G=T(K);let ae=V.hasAny,ce=V.name;const fe=G.map(function(xe){const ye=l(xe.from);return ae=ye.isAny||ae,ce+="|"+xe.from,{name:xe.from,typeIndex:ye.index,test:ye.test,isAny:ye.isAny,conversion:xe,conversionIndex:xe.index}});return{types:V.types.concat(fe),name:ce,hasAny:ae,hasConversion:fe.length>0,restParam:V.restParam}}function g(V){return V.typeSet||(V.typeSet=new Set,V.types.forEach(K=>V.typeSet.add(K.name))),V.typeSet}function N(V){const K=[];if(typeof V!="string")throw new TypeError("Signatures must be strings");const G=V.trim();if(G==="")return K;const ae=G.split(",");for(let ce=0;ce=ce+1}}else return V.length===0?function(fe){return fe.length===0}:V.length===1?(G=y(V[0]),function(fe){return G(fe[0])&&fe.length===1}):V.length===2?(G=y(V[0]),ae=y(V[1]),function(fe){return G(fe[0])&&ae(fe[1])&&fe.length===2}):(K=V.map(y),function(fe){for(let xe=0;xe{const ce=E(ae.params,K);let fe;for(fe of ce)G.add(fe)}),G.has("any")?["any"]:Array.from(G)}function F(V,K,G){let ae,ce;const fe=V||"unnamed";let xe=G,ye;for(ye=0;ye{const sr=S(Oe.params,ye),B=y(sr);(ye0){const Oe=f(K[ye]);return ae=new TypeError("Unexpected type of argument in function "+fe+" (expected: "+ce.join(" or ")+", actual: "+Oe.join(" | ")+", index: "+ye+")"),ae.data={category:"wrongType",fn:fe,index:ye,actual:Oe,expected:ce},ae}}else xe=Ke}const Ae=xe.map(function(Ke){return x(Ke.params)?1/0:Ke.params.length});if(K.lengthwe)return ae=new TypeError("Too many arguments in function "+fe+" (expected: "+we+", actual: "+K.length+")"),ae.data={category:"tooManyArgs",fn:fe,index:K.length,expectedLength:we},ae;const Ge=[];for(let Ke=0;Ke0)return 1;const ae=R(V)-R(K);return ae<0?-1:ae>0?1:0}function M(V,K){const G=V.params,ae=K.params,ce=j(G),fe=j(ae),xe=x(G),ye=x(ae);if(xe&&ce.hasAny){if(!ye||!fe.hasAny)return 1}else if(ye&&fe.hasAny)return-1;let Ae=0,we=0,Ge;for(Ge of G)Ge.hasAny&&++Ae,Ge.hasConversion&&++we;let Ke=0,Oe=0;for(Ge of ae)Ge.hasAny&&++Ke,Ge.hasConversion&&++Oe;if(Ae!==Ke)return Ae-Ke;if(xe&&ce.hasConversion){if(!ye||!fe.hasConversion)return 1}else if(ye&&fe.hasConversion)return-1;if(we!==Oe)return we-Oe;if(xe){if(!ye)return 1}else if(ye)return-1;const sr=(G.length-ae.length)*(xe?-1:1);if(sr!==0)return sr;const B=[];let J=0;for(let ge=0;ge1&&K.sort((ce,fe)=>ce.index-fe.index);let G=K[0].conversionsTo;if(V.length===1)return G;G=G.concat([]);const ae=new Set(V);for(let ce=1;cece.hasConversion)){const ce=x(V),fe=V.map(O);G=function(){const ye=[],Ae=ce?arguments.length-1:arguments.length;for(let we=0;weAe.name).join("|"),hasAny:ye.some(Ae=>Ae.isAny),hasConversion:!1,restParam:!0}),xe.push(fe)}else xe=fe.types.map(function(ye){return{types:[ye],name:ye.name,hasAny:ye.isAny,hasConversion:ye.conversion,restParam:!1}});return te(xe,function(ye){return K(G,ae+1,ce.concat([ye]))})}else return[ce]}return K(V,0,[])}function X(V,K){const G=Math.max(V.length,K.length);for(let ye=0;ye=ae:xe?ae>=ce:ae===ce}function U(V){return V.map(K=>ne(K)?L(K.referToSelf.callback):H(K)?ve(K.referTo.references,K.referTo.callback):K)}function z(V,K,G){const ae=[];let ce;for(ce of V){let fe=G[ce];if(typeof fe!="number")throw new TypeError('No definition for referenced signature "'+ce+'"');if(fe=K[fe],typeof fe!="function")return!1;ae.push(fe)}return ae}function Q(V,K,G){const ae=U(V),ce=new Array(ae.length).fill(!1);let fe=!0;for(;fe;){fe=!1;let xe=!0;for(let ye=0;ye{const ae=V[G];if(K.test(ae.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 re(V,K){if(o.createCount++,Object.keys(K).length===0)throw new SyntaxError("No signatures provided");o.warnAgainstDeprecatedThis&&se(K);const G=[],ae=[],ce={},fe=[];let xe;for(xe in K){if(!Object.prototype.hasOwnProperty.call(K,xe))continue;const rr=N(xe);if(!rr)continue;G.forEach(function(vi){if(X(vi,rr))throw new TypeError('Conflicting signatures "'+w(vi)+'" and "'+w(rr)+'".')}),G.push(rr);const Kr=ae.length;ae.push(K[xe]);const hL=rr.map(A);let ts;for(ts of W(hL)){const vi=w(ts);fe.push({params:ts,name:vi,fn:Kr}),ts.every(gL=>!gL.hasConversion)&&(ce[vi]=Kr)}}fe.sort(M);const ye=Q(ae,ce,pi);let Ae;for(Ae in ce)Object.prototype.hasOwnProperty.call(ce,Ae)&&(ce[Ae]=ye[ce[Ae]]);const we=[],Ge=new Map;for(Ae of fe)Ge.has(Ae.name)||(Ae.fn=ye[Ae.fn],we.push(Ae),Ge.set(Ae.name,Ae));const Ke=we[0]&&we[0].params.length<=2&&!x(we[0].params),Oe=we[1]&&we[1].params.length<=2&&!x(we[1].params),sr=we[2]&&we[2].params.length<=2&&!x(we[2].params),B=we[3]&&we[3].params.length<=2&&!x(we[3].params),J=we[4]&&we[4].params.length<=2&&!x(we[4].params),ue=we[5]&&we[5].params.length<=2&&!x(we[5].params),ge=Ke&&Oe&&sr&&B&&J&&ue;for(let rr=0;rrrr.test),pL=we.map(rr=>rr.implementation),vL=function(){for(let Kr=mt;Krw(N(G))),K=j(arguments);if(typeof K!="function")throw new TypeError("Callback function expected as last argument");return ve(V,K)}function ve(V,K){return{referTo:{references:V,callback:K}}}function L(V){if(typeof V!="function")throw new TypeError("Callback function expected as first argument");return{referToSelf:{callback:V}}}function H(V){return V&&typeof V.referTo=="object"&&Array.isArray(V.referTo.references)&&typeof V.referTo.callback=="function"}function ne(V){return V&&typeof V.referToSelf=="object"&&typeof V.referToSelf.callback=="function"}function ie(V,K){if(!V)return K;if(K&&K!==V){const G=new Error("Function names do not match (expected: "+V+", actual: "+K+")");throw G.data={actual:K,expected:V},G}return V}function de(V){let K;for(const G in V)Object.prototype.hasOwnProperty.call(V,G)&&(m(V[G])||typeof V[G].signature=="string")&&(K=ie(K,V[G].name));return K}function me(V,K){let G;for(G in K)if(Object.prototype.hasOwnProperty.call(K,G)){if(G in V&&K[G]!==V[G]){const ae=new Error('Signature "'+G+'" is defined twice');throw ae.data={signature:G,sourceFunction:K[G],destFunction:V[G]},ae}V[G]=K[G]}}const be=o;o=function(V){const K=typeof V=="string",G=K?1:0;let ae=K?V:"";const ce={};for(let fe=G;fe1&&arguments[1]!==void 0?arguments[1]:{override:!1};Ne(V);const G=l(V.to),ae=G.conversionsTo.find(ce=>ce.from===V.from);if(ae)if(K&&K.override)o.removeConversion({from:ae.from,to:V.to,convert:ae.convert});else throw new Error('There is already a conversion from "'+V.from+'" to "'+G.name+'"');G.conversionsTo.push({from:V.from,convert:V.convert,index:i++})},o.addConversions=function(V,K){V.forEach(G=>o.addConversion(G,K))},o.removeConversion=function(V){Ne(V);const K=l(V.to),G=ee(K.conversionsTo,ce=>ce.from===V.from);if(!G)throw new Error("Attempt to remove nonexistent conversion from "+V.from+" to "+V.to);if(G.convert!==V.convert)throw new Error("Conversion to remove does not match existing conversion");const ae=K.conversionsTo.indexOf(G);K.conversionsTo.splice(ae,1)},o.resolve=function(V,K){if(!m(V))throw new TypeError(Vm);const G=V._typedFunctionData.signatures;for(let ae=0;ae!cS(i)).every(i=>t[i]!==void 0);if(!n){var a=r.filter(i=>t[i]===void 0);throw new Error('Cannot create function "'.concat(e,'", ')+"some dependencies are missing: ".concat(a.map(i=>'"'.concat(i,'"')).join(", "),"."))}}function cS(e){return e&&e[0]==="?"}function Hm(e){return e&&e[0]==="?"?e.slice(1):e}function Ce(e){return typeof e=="boolean"?!0:isFinite(e)?e===Math.round(e):!1}function fS(e){return/^-?\d+$/.test(e)}function mn(e,r){return r.number==="bigint"&&!fS(e)?r.numberFallback:r.number}var dn=Math.sign||function(e){return e>0?1:e<0?-1:0},mS=Math.log2||function(r){return Math.log(r)/Math.LN2},dS=Math.log10||function(r){return Math.log(r)/Math.LN10},pS=Math.log1p||function(e){return Math.log(e+1)},vS=Math.cbrt||function(r){if(r===0)return r;var t=r<0,n;return t&&(r=-r),isFinite(r)?(n=Math.exp(Math.log(r)/3),n=(r/(n*n)+2*n)/3):n=r,t?-n:n},hS=Math.expm1||function(r){return r>=2e-4||r<=-2e-4?Math.exp(r)-1:r+r*r/2+r*r*r/6};function du(e,r,t){var n={2:"0b",8:"0o",16:"0x"},a=n[r],i="";if(t){if(t<1)throw new Error("size must be in greater than 0");if(!Ce(t))throw new Error("size must be an integer");if(e>2**(t-1)-1||e<-(2**(t-1)))throw new Error("Value must be in range [-2^".concat(t-1,", 2^").concat(t-1,"-1]"));if(!Ce(e))throw new Error("Value must be an integer");e<0&&(e=e+2**t),i="i".concat(t)}var o="";return e<0&&(e=-e,o="-"),"".concat(o).concat(a).concat(e.toString(r)).concat(i)}function qn(e,r){if(typeof r=="function")return r(e);if(e===1/0)return"Infinity";if(e===-1/0)return"-Infinity";if(isNaN(e))return"NaN";var{notation:t,precision:n,wordSize:a}=Zm(r);switch(t){case"fixed":return Gm(e,n);case"exponential":return Wm(e,n);case"engineering":return gS(e,n);case"bin":return du(e,2,a);case"oct":return du(e,8,a);case"hex":return du(e,16,a);case"auto":return yS(e,n,r).replace(/((\.\d*?)(0+))($|e)/,function(){var i=arguments[2],o=arguments[4];return i!=="."?i+o:o});default:throw new Error('Unknown notation "'+t+'". Choose "auto", "exponential", "fixed", "bin", "oct", or "hex.')}}function Zm(e){var r="auto",t,n;if(e!==void 0)if(Re(e))t=e;else if(Ie(e))t=e.toNumber();else if(fa(e))e.precision!==void 0&&(t=jm(e.precision,()=>{throw new Error('Option "precision" must be a number or BigNumber')})),e.wordSize!==void 0&&(n=jm(e.wordSize,()=>{throw new Error('Option "wordSize" must be a number or BigNumber')})),e.notation&&(r=e.notation);else throw new Error("Unsupported type of options, number, BigNumber, or object expected");return{notation:r,precision:t,wordSize:n}}function ri(e){var r=String(e).toLowerCase().match(/^(-?)(\d+\.?\d*)(e([+-]?\d+))?$/);if(!r)throw new SyntaxError("Invalid number "+e);var t=r[1],n=r[2],a=parseFloat(r[4]||"0"),i=n.indexOf(".");a+=i!==-1?i-1:n.length-1;var o=n.replace(".","").replace(/^0*/,function(l){return a-=l.length,""}).replace(/0*$/,"").split("").map(function(l){return parseInt(l)});return o.length===0&&(o.push(0),a++),{sign:t,coefficients:o,exponent:a}}function gS(e,r){if(isNaN(e)||!isFinite(e))return String(e);var t=ri(e),n=Qi(t,r),a=n.exponent,i=n.coefficients,o=a%3===0?a:a<0?a-3-a%3:a-a%3;if(Re(r))for(;r>i.length||a-o+1>i.length;)i.push(0);else for(var l=Math.abs(a-o)-(i.length-1),u=0;u0;)c++,s--;var f=i.slice(c).join(""),m=Re(r)&&f.length||f.match(/[1-9]/)?"."+f:"",p=i.slice(0,c).join("")+m+"e"+(a>=0?"+":"")+o.toString();return n.sign+p}function Gm(e,r){if(isNaN(e)||!isFinite(e))return String(e);var t=ri(e),n=typeof r=="number"?Qi(t,t.exponent+1+r):t,a=n.coefficients,i=n.exponent+1,o=i+(r||0);return a.length0?"."+a.join(""):"")+"e"+(i>=0?"+":"")+i}function yS(e,r,t){if(isNaN(e)||!isFinite(e))return String(e);var n=Km(t==null?void 0:t.lowerExp,-3),a=Km(t==null?void 0:t.upperExp,5),i=ri(e),o=r?Qi(i,r):i;if(o.exponent=a)return Wm(e,r);var l=o.coefficients,u=o.exponent;l.length0?u:0;return sr){var a=n.splice(r,n.length-r);if(a[0]>=5){var i=r-1;for(n[i]++;n[i]===10;)n.pop(),i===0&&(n.unshift(0),t.exponent++,i++),i--,n[i]++}}return t}function pa(e){for(var r=[],t=0;t2&&arguments[2]!==void 0?arguments[2]:1e-8,n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0;if(t<=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(r)?!1:!isFinite(e)||!isFinite(r)?e===r:e===r?!0:Math.abs(e-r)<=Math.max(t*Math.max(Math.abs(e),Math.abs(r)),n)}var wS=Math.acosh||function(e){return Math.log(Math.sqrt(e*e-1)+e)},xS=Math.asinh||function(e){return Math.log(Math.sqrt(e*e+1)+e)},NS=Math.atanh||function(e){return Math.log((1+e)/(1-e))/2},AS=Math.cosh||function(e){return(Math.exp(e)+Math.exp(-e))/2},ES=Math.sinh||function(e){return(Math.exp(e)-Math.exp(-e))/2},DS=Math.tanh||function(e){var r=Math.exp(2*e);return(r-1)/(r+1)};function SS(e,r){var t=!0,n=r>0?!0:r<0?!1:1/r===1/0;return t^n?-e:e}function jm(e,r){if(Re(e))return e;if(Ie(e))return e.toNumber();r()}function Km(e,r){return Re(e)?e:Ie(e)?e.toNumber():r}var Jm=function(){return Jm=Qa.create,Qa},CS=["?BigNumber","?Complex","?DenseMatrix","?Fraction"],MS=P("typed",CS,function(r){var{BigNumber:t,Complex:n,DenseMatrix:a,Fraction:i}=r,o=Jm();return o.clear(),o.addTypes([{name:"number",test:Re},{name:"Complex",test:gt},{name:"BigNumber",test:Ie},{name:"bigint",test:Nm},{name:"Fraction",test:zn},{name:"Unit",test:Gr},{name:"identifier",test:l=>Cr&&/^(?:[A-Za-z\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u0870-\u0887\u0889-\u088E\u08A0-\u08C9\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C5D\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16F1-\u16F8\u1700-\u1711\u171F-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1878\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4C\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\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-\uA7CD\uA7D0\uA7D1\uA7D3\uA7D5-\uA7DC\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\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\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-\uDEC4\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\uDEE0-\uDEF2\uDF02\uDF04-\uDF10\uDF12-\uDF33\uDFB0]|\uD808[\uDC00-\uDF99]|\uD809[\uDC80-\uDD43]|\uD80B[\uDF90-\uDFF0]|[\uD80C\uD80E\uD80F\uD81C-\uD820\uD822\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879\uD880-\uD883\uD885-\uD887][\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\uDF00-\uDF4A\uDF50\uDF93-\uDF9F\uDFE0\uDFE1\uDFE3]|\uD821[\uDC00-\uDFF7]|\uD823[\uDC00-\uDCD5\uDCFF-\uDD08]|\uD82B[\uDFF0-\uDFF3\uDFF5-\uDFFB\uDFFD\uDFFE]|\uD82C[\uDC00-\uDD22\uDD32\uDD50-\uDD52\uDD55\uDD64-\uDD67\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD837[\uDF00-\uDF1E\uDF25-\uDF2A]|\uD838[\uDC30-\uDC6D\uDD00-\uDD2C\uDD37-\uDD3D\uDD4E\uDE90-\uDEAD\uDEC0-\uDEEB]|\uD839[\uDCD0-\uDCEB\uDDD0-\uDDED\uDDF0\uDFE0-\uDFE6\uDFE8-\uDFEB\uDFED\uDFEE\uDFF0-\uDFFE]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43\uDD4B]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDEDF\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF39\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0\uDFF0-\uDFFF]|\uD87B[\uDC00-\uDE5D]|\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-\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-\uA7CD\uA7D0\uA7D1\uA7D3\uA7D5-\uA7DC\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\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\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-\uDEC4\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\uDEE0-\uDEF2\uDF02\uDF04-\uDF10\uDF12-\uDF33\uDFB0]|\uD808[\uDC00-\uDF99]|\uD809[\uDC80-\uDD43]|\uD80B[\uDF90-\uDFF0]|[\uD80C\uD80E\uD80F\uD81C-\uD820\uD822\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879\uD880-\uD883\uD885-\uD887][\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\uDF00-\uDF4A\uDF50\uDF93-\uDF9F\uDFE0\uDFE1\uDFE3]|\uD821[\uDC00-\uDFF7]|\uD823[\uDC00-\uDCD5\uDCFF-\uDD08]|\uD82B[\uDFF0-\uDFF3\uDFF5-\uDFFB\uDFFD\uDFFE]|\uD82C[\uDC00-\uDD22\uDD32\uDD50-\uDD52\uDD55\uDD64-\uDD67\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD837[\uDF00-\uDF1E\uDF25-\uDF2A]|\uD838[\uDC30-\uDC6D\uDD00-\uDD2C\uDD37-\uDD3D\uDD4E\uDE90-\uDEAD\uDEC0-\uDEEB]|\uD839[\uDCD0-\uDCEB\uDDD0-\uDDED\uDDF0\uDFE0-\uDFE6\uDFE8-\uDFEB\uDFED\uDFEE\uDFF0-\uDFFE]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43\uDD4B]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDEDF\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF39\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0\uDFF0-\uDFFF]|\uD87B[\uDC00-\uDE5D]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A\uDF50-\uDFFF]|\uD888[\uDC00-\uDFAF])*$/.test(l)},{name:"string",test:Cr},{name:"Chain",test:mu},{name:"Array",test:Xe},{name:"Matrix",test:_e},{name:"DenseMatrix",test:Ja},{name:"SparseMatrix",test:cn},{name:"Range",test:Yi},{name:"Index",test:Ya},{name:"boolean",test:Am},{name:"ResultSet",test:Em},{name:"Help",test:cu},{name:"function",test:Dm},{name:"Date",test:Sm},{name:"RegExp",test:Cm},{name:"null",test:Mm},{name:"undefined",test:_m},{name:"AccessorNode",test:fn},{name:"ArrayNode",test:Qr},{name:"AssignmentNode",test:Tm},{name:"BlockNode",test:Fm},{name:"ConditionalNode",test:Bm},{name:"ConstantNode",test:Ze},{name:"FunctionNode",test:Gt},{name:"FunctionAssignmentNode",test:ma},{name:"IndexNode",test:kn},{name:"Node",test:Qe},{name:"ObjectNode",test:Xa},{name:"OperatorNode",test:pr},{name:"ParenthesisNode",test:_t},{name:"RangeNode",test:Om},{name:"RelationalNode",test:$m},{name:"SymbolNode",test:br},{name:"Map",test:Pn},{name:"Object",test:fa}]),o.addConversions([{from:"number",to:"BigNumber",convert:function(u){if(t||eo(u),bS(u)>15)throw new TypeError("Cannot implicitly convert a number with >15 significant digits to BigNumber (value: "+u+"). Use function bignumber(x) to convert to BigNumber.");return new t(u)}},{from:"number",to:"Complex",convert:function(u){return n||ro(u),new n(u,0)}},{from:"BigNumber",to:"Complex",convert:function(u){return n||ro(u),new n(u.toNumber(),0)}},{from:"bigint",to:"number",convert:function(u){if(u>Number.MAX_SAFE_INTEGER)throw new TypeError("Cannot implicitly convert bigint to number: value exceeds the max safe integer value (value: "+u+")");return Number(u)}},{from:"bigint",to:"BigNumber",convert:function(u){return t||eo(u),new t(u.toString())}},{from:"bigint",to:"Fraction",convert:function(u){return i||to(u),new i(u.toString())}},{from:"Fraction",to:"BigNumber",convert:function(u){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(u){return n||ro(u),new n(u.valueOf(),0)}},{from:"number",to:"Fraction",convert:function(u){i||to(u);var s=new i(u);if(s.valueOf()!==u)throw new TypeError("Cannot implicitly convert a number to a Fraction when there will be a loss of precision (value: "+u+"). Use function fraction(x) to convert to Fraction.");return s}},{from:"string",to:"number",convert:function(u){var s=Number(u);if(isNaN(s))throw new Error('Cannot convert "'+u+'" to a number');return s}},{from:"string",to:"BigNumber",convert:function(u){t||eo(u);try{return new t(u)}catch{throw new Error('Cannot convert "'+u+'" to BigNumber')}}},{from:"string",to:"bigint",convert:function(u){try{return BigInt(u)}catch{throw new Error('Cannot convert "'+u+'" to BigInt')}}},{from:"string",to:"Fraction",convert:function(u){i||to(u);try{return new i(u)}catch{throw new Error('Cannot convert "'+u+'" to Fraction')}}},{from:"string",to:"Complex",convert:function(u){n||ro(u);try{return new n(u)}catch{throw new Error('Cannot convert "'+u+'" to Complex')}}},{from:"boolean",to:"number",convert:function(u){return+u}},{from:"boolean",to:"BigNumber",convert:function(u){return t||eo(u),new t(+u)}},{from:"boolean",to:"bigint",convert:function(u){return BigInt(+u)}},{from:"boolean",to:"Fraction",convert:function(u){return i||to(u),new i(+u)}},{from:"boolean",to:"string",convert:function(u){return String(u)}},{from:"Array",to:"Matrix",convert:function(u){return a||_S(),new a(u)}},{from:"Matrix",to:"Array",convert:function(u){return u.valueOf()}}]),o.onMismatch=(l,u,s)=>{var c=o.createError(l,u,s);if(["wrongType","mismatch"].includes(c.data.category)&&u.length===1&&Xr(u[0])&&s.some(m=>!m.params.includes(","))){var f=new TypeError("Function '".concat(l,"' doesn't apply to matrices. To call it ")+"elementwise on a matrix 'M', try 'map(M, ".concat(l,")'."));throw f.data=c.data,f}throw c},o.onMismatch=(l,u,s)=>{var c=o.createError(l,u,s);if(["wrongType","mismatch"].includes(c.data.category)&&u.length===1&&Xr(u[0])&&s.some(m=>!m.params.includes(","))){var f=new TypeError("Function '".concat(l,"' doesn't apply to matrices. To call it ")+"elementwise on a matrix 'M', try 'map(M, ".concat(l,")'."));throw f.data=c.data,f}throw c},o});function eo(e){throw new Error("Cannot convert value ".concat(e," into a BigNumber: no class 'BigNumber' provided"))}function ro(e){throw new Error("Cannot convert value ".concat(e," into a Complex number: no class 'Complex' provided"))}function _S(){throw new Error("Cannot convert array into a Matrix: no class 'DenseMatrix' provided")}function to(e){throw new Error("Cannot convert value ".concat(e," into a Fraction, no class 'Fraction' provided."))}var TS="ResultSet",FS=[],BS=P(TS,FS,()=>{function e(r){if(!(this instanceof e))throw new SyntaxError("Constructor must be called with the new operator");this.entries=r||[]}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(r){return new e(r.entries)},e},{isClass:!0});/*! * decimal.js v10.6.0 * An arbitrary-precision Decimal type for JavaScript. * https://github.com/MikeMcl/decimal.js * Copyright (c) 2025 Michael Mclaughlin * MIT Licence */var va=9e15,pn=1e9,pu="0123456789abcdef",no="2.3025850929940456840179914546843642076011014886287729760333279009675726096773524802359972050895982983419677840422862486334095254650828067566662873690987816894829072083255546808437998948262331985283935053089653777326288461633662222876982198867465436674744042432743651550489343149393914796194044002221051017141748003688084012647080685567743216228355220114804663715659121373450747856947683463616792101806445070648000277502684916746550586856935673420670581136429224554405758925724208241314695689016758940256776311356919292033376587141660230105703089634572075440370847469940168269282808481184289314848524948644871927809676271275775397027668605952496716674183485704422507197965004714951050492214776567636938662976979522110718264549734772662425709429322582798502585509785265383207606726317164309505995087807523710333101197857547331541421808427543863591778117054309827482385045648019095610299291824318237525357709750539565187697510374970888692180205189339507238539205144634197265287286965110862571492198849978748873771345686209167058",ao="3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679821480865132823066470938446095505822317253594081284811174502841027019385211055596446229489549303819644288109756659334461284756482337867831652712019091456485669234603486104543266482133936072602491412737245870066063155881748815209209628292540917153643678925903600113305305488204665213841469519415116094330572703657595919530921861173819326117931051185480744623799627495673518857527248912279381830119491298336733624406566430860213949463952247371907021798609437027705392171762931767523846748184676694051320005681271452635608277857713427577896091736371787214684409012249534301465495853710507922796892589235420199561121290219608640344181598136297747713099605187072113499999983729780499510597317328160963185950244594553469083026425223082533446850352619311881710100031378387528865875332083814206171776691473035982534904287554687311595628638823537875937519577818577805321712268066130019278766111959092164201989380952572010654858632789",vu={precision:20,rounding:4,modulo:1,toExpNeg:-7,toExpPos:21,minE:-va,maxE:va,crypto:!1},Ym,jt,ze=!0,io="[DecimalError] ",vn=io+"Invalid argument: ",Xm=io+"Precision limit exceeded",Qm=io+"crypto unavailable",ed="[object Decimal]",Or=Math.floor,wr=Math.pow,OS=/^0b([01]+(\.[01]*)?|\.[01]+)(p[+-]?\d+)?$/i,$S=/^0x([0-9a-f]+(\.[0-9a-f]*)?|\.[0-9a-f]+)(p[+-]?\d+)?$/i,IS=/^0o([0-7]+(\.[0-7]*)?|\.[0-7]+)(p[+-]?\d+)?$/i,rd=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,yt=1e7,Be=7,RS=9007199254740991,zS=no.length-1,hu=ao.length-1,he={toStringTag:ed};he.absoluteValue=he.abs=function(){var e=new this.constructor(this);return e.s<0&&(e.s=1),Me(e)},he.ceil=function(){return Me(new this.constructor(this),this.e+1,2)},he.clampedTo=he.clamp=function(e,r){var t,n=this,a=n.constructor;if(e=new a(e),r=new a(r),!e.s||!r.s)return new a(NaN);if(e.gt(r))throw Error(vn+r);return t=n.cmp(e),t<0?e:n.cmp(r)>0?r:new a(n)},he.comparedTo=he.cmp=function(e){var r,t,n,a,i=this,o=i.d,l=(e=new i.constructor(e)).d,u=i.s,s=e.s;if(!o||!l)return!u||!s?NaN:u!==s?u:o===l?0:!o^u<0?1:-1;if(!o[0]||!l[0])return o[0]?u:l[0]?-s:0;if(u!==s)return u;if(i.e!==e.e)return i.e>e.e^u<0?1:-1;for(n=o.length,a=l.length,r=0,t=nl[r]^u<0?1:-1;return n===a?0:n>a^u<0?1:-1},he.cosine=he.cos=function(){var e,r,t=this,n=t.constructor;return t.d?t.d[0]?(e=n.precision,r=n.rounding,n.precision=e+Math.max(t.e,t.sd())+Be,n.rounding=1,t=PS(n,sd(n,t)),n.precision=e,n.rounding=r,Me(jt==2||jt==3?t.neg():t,e,r,!0)):new n(1):new n(NaN)},he.cubeRoot=he.cbrt=function(){var e,r,t,n,a,i,o,l,u,s,c=this,f=c.constructor;if(!c.isFinite()||c.isZero())return new f(c);for(ze=!1,i=c.s*wr(c.s*c,1/3),!i||Math.abs(i)==1/0?(t=_r(c.d),e=c.e,(i=(e-t.length+1)%3)&&(t+=i==1||i==-2?"0":"00"),i=wr(t,1/3),e=Or((e+1)/3)-(e%3==(e<0?-1:2)),i==1/0?t="5e"+e:(t=i.toExponential(),t=t.slice(0,t.indexOf("e")+1)+e),n=new f(t),n.s=c.s):n=new f(i.toString()),o=(e=f.precision)+3;;)if(l=n,u=l.times(l).times(l),s=u.plus(c),n=or(s.plus(c).times(l),s.plus(u),o+2,1),_r(l.d).slice(0,o)===(t=_r(n.d)).slice(0,o))if(t=t.slice(o-3,o+1),t=="9999"||!a&&t=="4999"){if(!a&&(Me(l,e+1,0),l.times(l).times(l).eq(c))){n=l;break}o+=4,a=1}else{(!+t||!+t.slice(1)&&t.charAt(0)=="5")&&(Me(n,e+1,1),r=!n.times(n).times(n).eq(c));break}return ze=!0,Me(n,e,f.rounding,r)},he.decimalPlaces=he.dp=function(){var e,r=this.d,t=NaN;if(r){if(e=r.length-1,t=(e-Or(this.e/Be))*Be,e=r[e],e)for(;e%10==0;e/=10)t--;t<0&&(t=0)}return t},he.dividedBy=he.div=function(e){return or(this,new this.constructor(e))},he.dividedToIntegerBy=he.divToInt=function(e){var r=this,t=r.constructor;return Me(or(r,new t(e),0,1,1),t.precision,t.rounding)},he.equals=he.eq=function(e){return this.cmp(e)===0},he.floor=function(){return Me(new this.constructor(this),this.e+1,3)},he.greaterThan=he.gt=function(e){return this.cmp(e)>0},he.greaterThanOrEqualTo=he.gte=function(e){var r=this.cmp(e);return r==1||r===0},he.hyperbolicCosine=he.cosh=function(){var e,r,t,n,a,i=this,o=i.constructor,l=new o(1);if(!i.isFinite())return new o(i.s?1/0:NaN);if(i.isZero())return l;t=o.precision,n=o.rounding,o.precision=t+Math.max(i.e,i.sd())+4,o.rounding=1,a=i.d.length,a<32?(e=Math.ceil(a/3),r=(1/co(4,e)).toString()):(e=16,r="2.3283064365386962890625e-10"),i=ha(o,1,i.times(r),new o(1),!0);for(var u,s=e,c=new o(8);s--;)u=i.times(i),i=l.minus(u.times(c.minus(u.times(c))));return Me(i,o.precision=t,o.rounding=n,!0)},he.hyperbolicSine=he.sinh=function(){var e,r,t,n,a=this,i=a.constructor;if(!a.isFinite()||a.isZero())return new i(a);if(r=i.precision,t=i.rounding,i.precision=r+Math.max(a.e,a.sd())+4,i.rounding=1,n=a.d.length,n<3)a=ha(i,2,a,a,!0);else{e=1.4*Math.sqrt(n),e=e>16?16:e|0,a=a.times(1/co(5,e)),a=ha(i,2,a,a,!0);for(var o,l=new i(5),u=new i(16),s=new i(20);e--;)o=a.times(a),a=a.times(l.plus(o.times(u.times(o).plus(s))))}return i.precision=r,i.rounding=t,Me(a,r,t,!0)},he.hyperbolicTangent=he.tanh=function(){var e,r,t=this,n=t.constructor;return t.isFinite()?t.isZero()?new n(t):(e=n.precision,r=n.rounding,n.precision=e+7,n.rounding=1,or(t.sinh(),t.cosh(),n.precision=e,n.rounding=r)):new n(t.s)},he.inverseCosine=he.acos=function(){var e=this,r=e.constructor,t=e.abs().cmp(1),n=r.precision,a=r.rounding;return t!==-1?t===0?e.isNeg()?Ft(r,n,a):new r(0):new r(NaN):e.isZero()?Ft(r,n+4,a).times(.5):(r.precision=n+6,r.rounding=1,e=new r(1).minus(e).div(e.plus(1)).sqrt().atan(),r.precision=n,r.rounding=a,e.times(2))},he.inverseHyperbolicCosine=he.acosh=function(){var e,r,t=this,n=t.constructor;return t.lte(1)?new n(t.eq(1)?0:NaN):t.isFinite()?(e=n.precision,r=n.rounding,n.precision=e+Math.max(Math.abs(t.e),t.sd())+4,n.rounding=1,ze=!1,t=t.times(t).minus(1).sqrt().plus(t),ze=!0,n.precision=e,n.rounding=r,t.ln()):new n(t)},he.inverseHyperbolicSine=he.asinh=function(){var e,r,t=this,n=t.constructor;return!t.isFinite()||t.isZero()?new n(t):(e=n.precision,r=n.rounding,n.precision=e+2*Math.max(Math.abs(t.e),t.sd())+6,n.rounding=1,ze=!1,t=t.times(t).plus(1).sqrt().plus(t),ze=!0,n.precision=e,n.rounding=r,t.ln())},he.inverseHyperbolicTangent=he.atanh=function(){var e,r,t,n,a=this,i=a.constructor;return a.isFinite()?a.e>=0?new i(a.abs().eq(1)?a.s/0:a.isZero()?a:NaN):(e=i.precision,r=i.rounding,n=a.sd(),Math.max(n,e)<2*-a.e-1?Me(new i(a),e,r,!0):(i.precision=t=n-a.e,a=or(a.plus(1),new i(1).minus(a),t+e,1),i.precision=e+4,i.rounding=1,a=a.ln(),i.precision=e,i.rounding=r,a.times(.5))):new i(NaN)},he.inverseSine=he.asin=function(){var e,r,t,n,a=this,i=a.constructor;return a.isZero()?new i(a):(r=a.abs().cmp(1),t=i.precision,n=i.rounding,r!==-1?r===0?(e=Ft(i,t+4,n).times(.5),e.s=a.s,e):new i(NaN):(i.precision=t+6,i.rounding=1,a=a.div(new i(1).minus(a.times(a)).sqrt().plus(1)).atan(),i.precision=t,i.rounding=n,a.times(2)))},he.inverseTangent=he.atan=function(){var e,r,t,n,a,i,o,l,u,s=this,c=s.constructor,f=c.precision,m=c.rounding;if(s.isFinite()){if(s.isZero())return new c(s);if(s.abs().eq(1)&&f+4<=hu)return o=Ft(c,f+4,m).times(.25),o.s=s.s,o}else{if(!s.s)return new c(NaN);if(f+4<=hu)return o=Ft(c,f+4,m).times(.5),o.s=s.s,o}for(c.precision=l=f+10,c.rounding=1,t=Math.min(28,l/Be+2|0),e=t;e;--e)s=s.div(s.times(s).plus(1).sqrt().plus(1));for(ze=!1,r=Math.ceil(l/Be),n=1,u=s.times(s),o=new c(s),a=s;e!==-1;)if(a=a.times(u),i=o.minus(a.div(n+=2)),a=a.times(u),o=i.plus(a.div(n+=2)),o.d[r]!==void 0)for(e=r;o.d[e]===i.d[e]&&e--;);return t&&(o=o.times(2<this.d.length-2},he.isNaN=function(){return!this.s},he.isNegative=he.isNeg=function(){return this.s<0},he.isPositive=he.isPos=function(){return this.s>0},he.isZero=function(){return!!this.d&&this.d[0]===0},he.lessThan=he.lt=function(e){return this.cmp(e)<0},he.lessThanOrEqualTo=he.lte=function(e){return this.cmp(e)<1},he.logarithm=he.log=function(e){var r,t,n,a,i,o,l,u,s=this,c=s.constructor,f=c.precision,m=c.rounding,p=5;if(e==null)e=new c(10),r=!0;else{if(e=new c(e),t=e.d,e.s<0||!t||!t[0]||e.eq(1))return new c(NaN);r=e.eq(10)}if(t=s.d,s.s<0||!t||!t[0]||s.eq(1))return new c(t&&!t[0]?-1/0:s.s!=1?NaN:t?0:1/0);if(r)if(t.length>1)i=!0;else{for(a=t[0];a%10===0;)a/=10;i=a!==1}if(ze=!1,l=f+p,o=gn(s,l),n=r?uo(c,l+10):gn(e,l),u=or(o,n,l,1),ti(u.d,a=f,m))do if(l+=10,o=gn(s,l),n=r?uo(c,l+10):gn(e,l),u=or(o,n,l,1),!i){+_r(u.d).slice(a+1,a+15)+1==1e14&&(u=Me(u,f+1,0));break}while(ti(u.d,a+=10,m));return ze=!0,Me(u,f,m)},he.minus=he.sub=function(e){var r,t,n,a,i,o,l,u,s,c,f,m,p=this,v=p.constructor;if(e=new v(e),!p.d||!e.d)return!p.s||!e.s?e=new v(NaN):p.d?e.s=-e.s:e=new v(e.d||p.s!==e.s?p:NaN),e;if(p.s!=e.s)return e.s=-e.s,p.plus(e);if(s=p.d,m=e.d,l=v.precision,u=v.rounding,!s[0]||!m[0]){if(m[0])e.s=-e.s;else if(s[0])e=new v(p);else return new v(u===3?-0:0);return ze?Me(e,l,u):e}if(t=Or(e.e/Be),c=Or(p.e/Be),s=s.slice(),i=c-t,i){for(f=i<0,f?(r=s,i=-i,o=m.length):(r=m,t=c,o=s.length),n=Math.max(Math.ceil(l/Be),o)+2,i>n&&(i=n,r.length=1),r.reverse(),n=i;n--;)r.push(0);r.reverse()}else{for(n=s.length,o=m.length,f=n0;--n)s[o++]=0;for(n=m.length;n>i;){if(s[--n]o?i+1:o+1,a>o&&(a=o,t.length=1),t.reverse();a--;)t.push(0);t.reverse()}for(o=s.length,a=c.length,o-a<0&&(a=o,t=c,c=s,s=t),r=0;a;)r=(s[--a]=s[a]+c[a]+r)/yt|0,s[a]%=yt;for(r&&(s.unshift(r),++n),o=s.length;s[--o]==0;)s.pop();return e.d=s,e.e=so(s,n),ze?Me(e,l,u):e},he.precision=he.sd=function(e){var r,t=this;if(e!==void 0&&e!==!!e&&e!==1&&e!==0)throw Error(vn+e);return t.d?(r=td(t.d),e&&t.e+1>r&&(r=t.e+1)):r=NaN,r},he.round=function(){var e=this,r=e.constructor;return Me(new r(e),e.e+1,r.rounding)},he.sine=he.sin=function(){var e,r,t=this,n=t.constructor;return t.isFinite()?t.isZero()?new n(t):(e=n.precision,r=n.rounding,n.precision=e+Math.max(t.e,t.sd())+Be,n.rounding=1,t=qS(n,sd(n,t)),n.precision=e,n.rounding=r,Me(jt>2?t.neg():t,e,r,!0)):new n(NaN)},he.squareRoot=he.sqrt=function(){var e,r,t,n,a,i,o=this,l=o.d,u=o.e,s=o.s,c=o.constructor;if(s!==1||!l||!l[0])return new c(!s||s<0&&(!l||l[0])?NaN:l?o:1/0);for(ze=!1,s=Math.sqrt(+o),s==0||s==1/0?(r=_r(l),(r.length+u)%2==0&&(r+="0"),s=Math.sqrt(r),u=Or((u+1)/2)-(u<0||u%2),s==1/0?r="5e"+u:(r=s.toExponential(),r=r.slice(0,r.indexOf("e")+1)+u),n=new c(r)):n=new c(s.toString()),t=(u=c.precision)+3;;)if(i=n,n=i.plus(or(o,i,t+2,1)).times(.5),_r(i.d).slice(0,t)===(r=_r(n.d)).slice(0,t))if(r=r.slice(t-3,t+1),r=="9999"||!a&&r=="4999"){if(!a&&(Me(i,u+1,0),i.times(i).eq(o))){n=i;break}t+=4,a=1}else{(!+r||!+r.slice(1)&&r.charAt(0)=="5")&&(Me(n,u+1,1),e=!n.times(n).eq(o));break}return ze=!0,Me(n,u,c.rounding,e)},he.tangent=he.tan=function(){var e,r,t=this,n=t.constructor;return t.isFinite()?t.isZero()?new n(t):(e=n.precision,r=n.rounding,n.precision=e+10,n.rounding=1,t=t.sin(),t.s=1,t=or(t,new n(1).minus(t.times(t)).sqrt(),e+10,0),n.precision=e,n.rounding=r,Me(jt==2||jt==4?t.neg():t,e,r,!0)):new n(NaN)},he.times=he.mul=function(e){var r,t,n,a,i,o,l,u,s,c=this,f=c.constructor,m=c.d,p=(e=new f(e)).d;if(e.s*=c.s,!m||!m[0]||!p||!p[0])return new f(!e.s||m&&!m[0]&&!p||p&&!p[0]&&!m?NaN:!m||!p?e.s/0:e.s*0);for(t=Or(c.e/Be)+Or(e.e/Be),u=m.length,s=p.length,u=0;){for(r=0,a=u+n;a>n;)l=i[a]+p[n]*m[a-n-1]+r,i[a--]=l%yt|0,r=l/yt|0;i[a]=(i[a]+r)%yt|0}for(;!i[--o];)i.pop();return r?++t:i.shift(),e.d=i,e.e=so(i,t),ze?Me(e,f.precision,f.rounding):e},he.toBinary=function(e,r){return yu(this,2,e,r)},he.toDecimalPlaces=he.toDP=function(e,r){var t=this,n=t.constructor;return t=new n(t),e===void 0?t:(Wr(e,0,pn),r===void 0?r=n.rounding:Wr(r,0,8),Me(t,e+t.e+1,r))},he.toExponential=function(e,r){var t,n=this,a=n.constructor;return e===void 0?t=Tt(n,!0):(Wr(e,0,pn),r===void 0?r=a.rounding:Wr(r,0,8),n=Me(new a(n),e+1,r),t=Tt(n,!0,e+1)),n.isNeg()&&!n.isZero()?"-"+t:t},he.toFixed=function(e,r){var t,n,a=this,i=a.constructor;return e===void 0?t=Tt(a):(Wr(e,0,pn),r===void 0?r=i.rounding:Wr(r,0,8),n=Me(new i(a),e+a.e+1,r),t=Tt(n,!1,e+n.e+1)),a.isNeg()&&!a.isZero()?"-"+t:t},he.toFraction=function(e){var r,t,n,a,i,o,l,u,s,c,f,m,p=this,v=p.d,h=p.constructor;if(!v)return new h(p);if(s=t=new h(1),n=u=new h(0),r=new h(n),i=r.e=td(v)-p.e-1,o=i%Be,r.d[0]=wr(10,o<0?Be+o:o),e==null)e=i>0?r:s;else{if(l=new h(e),!l.isInt()||l.lt(s))throw Error(vn+l);e=l.gt(r)?i>0?r:s:l}for(ze=!1,l=new h(_r(v)),c=h.precision,h.precision=i=v.length*Be*2;f=or(l,r,0,1,1),a=t.plus(f.times(n)),a.cmp(e)!=1;)t=n,n=a,a=s,s=u.plus(f.times(a)),u=a,a=r,r=l.minus(f.times(a)),l=a;return a=or(e.minus(t),n,0,1,1),u=u.plus(a.times(s)),t=t.plus(a.times(n)),u.s=s.s=p.s,m=or(s,n,i,1).minus(p).abs().cmp(or(u,t,i,1).minus(p).abs())<1?[s,n]:[u,t],h.precision=c,ze=!0,m},he.toHexadecimal=he.toHex=function(e,r){return yu(this,16,e,r)},he.toNearest=function(e,r){var t=this,n=t.constructor;if(t=new n(t),e==null){if(!t.d)return t;e=new n(1),r=n.rounding}else{if(e=new n(e),r===void 0?r=n.rounding:Wr(r,0,8),!t.d)return e.s?t:e;if(!e.d)return e.s&&(e.s=t.s),e}return e.d[0]?(ze=!1,t=or(t,e,0,r,1).times(e),ze=!0,Me(t)):(e.s=t.s,t=e),t},he.toNumber=function(){return+this},he.toOctal=function(e,r){return yu(this,8,e,r)},he.toPower=he.pow=function(e){var r,t,n,a,i,o,l=this,u=l.constructor,s=+(e=new u(e));if(!l.d||!e.d||!l.d[0]||!e.d[0])return new u(wr(+l,s));if(l=new u(l),l.eq(1))return l;if(n=u.precision,i=u.rounding,e.eq(1))return Me(l,n,i);if(r=Or(e.e/Be),r>=e.d.length-1&&(t=s<0?-s:s)<=RS)return a=nd(u,l,t,n),e.s<0?new u(1).div(a):Me(a,n,i);if(o=l.s,o<0){if(ru.maxE+1||r0?o/0:0):(ze=!1,u.rounding=l.s=1,t=Math.min(12,(r+"").length),a=gu(e.times(gn(l,n+t)),n),a.d&&(a=Me(a,n+5,1),ti(a.d,n,i)&&(r=n+10,a=Me(gu(e.times(gn(l,r+t)),r),r+5,1),+_r(a.d).slice(n+1,n+15)+1==1e14&&(a=Me(a,n+1,0)))),a.s=o,ze=!0,u.rounding=i,Me(a,n,i))},he.toPrecision=function(e,r){var t,n=this,a=n.constructor;return e===void 0?t=Tt(n,n.e<=a.toExpNeg||n.e>=a.toExpPos):(Wr(e,1,pn),r===void 0?r=a.rounding:Wr(r,0,8),n=Me(new a(n),e,r),t=Tt(n,e<=n.e||n.e<=a.toExpNeg,e)),n.isNeg()&&!n.isZero()?"-"+t:t},he.toSignificantDigits=he.toSD=function(e,r){var t=this,n=t.constructor;return e===void 0?(e=n.precision,r=n.rounding):(Wr(e,1,pn),r===void 0?r=n.rounding:Wr(r,0,8)),Me(new n(t),e,r)},he.toString=function(){var e=this,r=e.constructor,t=Tt(e,e.e<=r.toExpNeg||e.e>=r.toExpPos);return e.isNeg()&&!e.isZero()?"-"+t:t},he.truncated=he.trunc=function(){return Me(new this.constructor(this),this.e+1,1)},he.valueOf=he.toJSON=function(){var e=this,r=e.constructor,t=Tt(e,e.e<=r.toExpNeg||e.e>=r.toExpPos);return e.isNeg()?"-"+t:t};function _r(e){var r,t,n,a=e.length-1,i="",o=e[0];if(a>0){for(i+=o,r=1;rt)throw Error(vn+e)}function ti(e,r,t,n){var a,i,o,l;for(i=e[0];i>=10;i/=10)--r;return--r<0?(r+=Be,a=0):(a=Math.ceil((r+1)/Be),r%=Be),i=wr(10,Be-r),l=e[a]%i|0,n==null?r<3?(r==0?l=l/100|0:r==1&&(l=l/10|0),o=t<4&&l==99999||t>3&&l==49999||l==5e4||l==0):o=(t<4&&l+1==i||t>3&&l+1==i/2)&&(e[a+1]/i/100|0)==wr(10,r-2)-1||(l==i/2||l==0)&&(e[a+1]/i/100|0)==0:r<4?(r==0?l=l/1e3|0:r==1?l=l/100|0:r==2&&(l=l/10|0),o=(n||t<4)&&l==9999||!n&&t>3&&l==4999):o=((n||t<4)&&l+1==i||!n&&t>3&&l+1==i/2)&&(e[a+1]/i/1e3|0)==wr(10,r-3)-1,o}function oo(e,r,t){for(var n,a=[0],i,o=0,l=e.length;ot-1&&(a[n+1]===void 0&&(a[n+1]=0),a[n+1]+=a[n]/t|0,a[n]%=t)}return a.reverse()}function PS(e,r){var t,n,a;if(r.isZero())return r;n=r.d.length,n<32?(t=Math.ceil(n/3),a=(1/co(4,t)).toString()):(t=16,a="2.3283064365386962890625e-10"),e.precision+=t,r=ha(e,1,r.times(a),new e(1));for(var i=t;i--;){var o=r.times(r);r=o.times(o).minus(o).times(8).plus(1)}return e.precision-=t,r}var or=function(){function e(n,a,i){var o,l=0,u=n.length;for(n=n.slice();u--;)o=n[u]*a+l,n[u]=o%i|0,l=o/i|0;return l&&n.unshift(l),n}function r(n,a,i,o){var l,u;if(i!=o)u=i>o?1:-1;else for(l=u=0;la[l]?1:-1;break}return u}function t(n,a,i,o){for(var l=0;i--;)n[i]-=l,l=n[i]1;)n.shift()}return function(n,a,i,o,l,u){var s,c,f,m,p,v,h,w,b,A,g,N,x,y,D,S,E,C,_,F,I=n.constructor,R=n.s==a.s?1:-1,$=n.d,M=a.d;if(!$||!$[0]||!M||!M[0])return new I(!n.s||!a.s||($?M&&$[0]==M[0]:!M)?NaN:$&&$[0]==0||!M?R*0:R/0);for(u?(p=1,c=n.e-a.e):(u=yt,p=Be,c=Or(n.e/p)-Or(a.e/p)),_=M.length,E=$.length,b=new I(R),A=b.d=[],f=0;M[f]==($[f]||0);f++);if(M[f]>($[f]||0)&&c--,i==null?(y=i=I.precision,o=I.rounding):l?y=i+(n.e-a.e)+1:y=i,y<0)A.push(1),v=!0;else{if(y=y/p+2|0,f=0,_==1){for(m=0,M=M[0],y++;(f1&&(M=e(M,m,u),$=e($,m,u),_=M.length,E=$.length),S=_,g=$.slice(0,_),N=g.length;N<_;)g[N++]=0;F=M.slice(),F.unshift(0),C=M[0],M[1]>=u/2&&++C;do m=0,s=r(M,g,_,N),s<0?(x=g[0],_!=N&&(x=x*u+(g[1]||0)),m=x/C|0,m>1?(m>=u&&(m=u-1),h=e(M,m,u),w=h.length,N=g.length,s=r(h,g,w,N),s==1&&(m--,t(h,_=10;m/=10)f++;b.e=f+c*p-1,Me(b,l?i+b.e+1:i,o,v)}return b}}();function Me(e,r,t,n){var a,i,o,l,u,s,c,f,m,p=e.constructor;e:if(r!=null){if(f=e.d,!f)return e;for(a=1,l=f[0];l>=10;l/=10)a++;if(i=r-a,i<0)i+=Be,o=r,c=f[m=0],u=c/wr(10,a-o-1)%10|0;else if(m=Math.ceil((i+1)/Be),l=f.length,m>=l)if(n){for(;l++<=m;)f.push(0);c=u=0,a=1,i%=Be,o=i-Be+1}else break e;else{for(c=l=f[m],a=1;l>=10;l/=10)a++;i%=Be,o=i-Be+a,u=o<0?0:c/wr(10,a-o-1)%10|0}if(n=n||r<0||f[m+1]!==void 0||(o<0?c:c%wr(10,a-o-1)),s=t<4?(u||n)&&(t==0||t==(e.s<0?3:2)):u>5||u==5&&(t==4||n||t==6&&(i>0?o>0?c/wr(10,a-o):0:f[m-1])%10&1||t==(e.s<0?8:7)),r<1||!f[0])return f.length=0,s?(r-=e.e+1,f[0]=wr(10,(Be-r%Be)%Be),e.e=-r||0):f[0]=e.e=0,e;if(i==0?(f.length=m,l=1,m--):(f.length=m+1,l=wr(10,Be-i),f[m]=o>0?(c/wr(10,a-o)%wr(10,o)|0)*l:0),s)for(;;)if(m==0){for(i=1,o=f[0];o>=10;o/=10)i++;for(o=f[0]+=l,l=1;o>=10;o/=10)l++;i!=l&&(e.e++,f[0]==yt&&(f[0]=1));break}else{if(f[m]+=l,f[m]!=yt)break;f[m--]=0,l=1}for(i=f.length;f[--i]===0;)f.pop()}return ze&&(e.e>p.maxE?(e.d=null,e.e=NaN):e.e0?i=i.charAt(0)+"."+i.slice(1)+hn(n):o>1&&(i=i.charAt(0)+"."+i.slice(1)),i=i+(e.e<0?"e":"e+")+e.e):a<0?(i="0."+hn(-a-1)+i,t&&(n=t-o)>0&&(i+=hn(n))):a>=o?(i+=hn(a+1-o),t&&(n=t-a-1)>0&&(i=i+"."+hn(n))):((n=a+1)0&&(a+1===o&&(i+="."),i+=hn(n))),i}function so(e,r){var t=e[0];for(r*=Be;t>=10;t/=10)r++;return r}function uo(e,r,t){if(r>zS)throw ze=!0,t&&(e.precision=t),Error(Xm);return Me(new e(no),r,1,!0)}function Ft(e,r,t){if(r>hu)throw Error(Xm);return Me(new e(ao),r,t,!0)}function td(e){var r=e.length-1,t=r*Be+1;if(r=e[r],r){for(;r%10==0;r/=10)t--;for(r=e[0];r>=10;r/=10)t++}return t}function hn(e){for(var r="";e--;)r+="0";return r}function nd(e,r,t,n){var a,i=new e(1),o=Math.ceil(n/Be+4);for(ze=!1;;){if(t%2&&(i=i.times(r),ud(i.d,o)&&(a=!0)),t=Or(t/2),t===0){t=i.d.length-1,a&&i.d[t]===0&&++i.d[t];break}r=r.times(r),ud(r.d,o)}return ze=!0,i}function ad(e){return e.d[e.d.length-1]&1}function id(e,r,t){for(var n,a,i=new e(r[0]),o=0;++o17)return new m(e.d?e.d[0]?e.s<0?0:1/0:1:e.s?e.s<0?0:e:NaN);for(r==null?(ze=!1,u=v):u=r,l=new m(.03125);e.e>-2;)e=e.times(l),f+=5;for(n=Math.log(wr(2,f))/Math.LN10*2+5|0,u+=n,t=i=o=new m(1),m.precision=u;;){if(i=Me(i.times(e),u,1),t=t.times(++c),l=o.plus(or(i,t,u,1)),_r(l.d).slice(0,u)===_r(o.d).slice(0,u)){for(a=f;a--;)o=Me(o.times(o),u,1);if(r==null)if(s<3&&ti(o.d,u-n,p,s))m.precision=u+=10,t=i=l=new m(1),c=0,s++;else return Me(o,m.precision=v,p,ze=!0);else return m.precision=v,o}o=l}}function gn(e,r){var t,n,a,i,o,l,u,s,c,f,m,p=1,v=10,h=e,w=h.d,b=h.constructor,A=b.rounding,g=b.precision;if(h.s<0||!w||!w[0]||!h.e&&w[0]==1&&w.length==1)return new b(w&&!w[0]?-1/0:h.s!=1?NaN:w?0:h);if(r==null?(ze=!1,c=g):c=r,b.precision=c+=v,t=_r(w),n=t.charAt(0),Math.abs(i=h.e)<15e14){for(;n<7&&n!=1||n==1&&t.charAt(1)>3;)h=h.times(e),t=_r(h.d),n=t.charAt(0),p++;i=h.e,n>1?(h=new b("0."+t),i++):h=new b(n+"."+t.slice(1))}else return s=uo(b,c+2,g).times(i+""),h=gn(new b(n+"."+t.slice(1)),c-v).plus(s),b.precision=g,r==null?Me(h,g,A,ze=!0):h;for(f=h,u=o=h=or(h.minus(1),h.plus(1),c,1),m=Me(h.times(h),c,1),a=3;;){if(o=Me(o.times(m),c,1),s=u.plus(or(o,new b(a),c,1)),_r(s.d).slice(0,c)===_r(u.d).slice(0,c))if(u=u.times(2),i!==0&&(u=u.plus(uo(b,c+2,g).times(i+""))),u=or(u,new b(p),c,1),r==null)if(ti(u.d,c-v,A,l))b.precision=c+=v,s=o=h=or(f.minus(1),f.plus(1),c,1),m=Me(h.times(h),c,1),a=l=1;else return Me(u,b.precision=g,A,ze=!0);else return b.precision=g,u;u=s,a+=2}}function od(e){return String(e.s*e.s/0)}function lo(e,r){var t,n,a;for((t=r.indexOf("."))>-1&&(r=r.replace(".","")),(n=r.search(/e/i))>0?(t<0&&(t=n),t+=+r.slice(n+1),r=r.substring(0,n)):t<0&&(t=r.length),n=0;r.charCodeAt(n)===48;n++);for(a=r.length;r.charCodeAt(a-1)===48;--a);if(r=r.slice(n,a),r){if(a-=n,e.e=t=t-n-1,e.d=[],n=(t+1)%Be,t<0&&(n+=Be),ne.constructor.maxE?(e.d=null,e.e=NaN):e.e-1){if(r=r.replace(/(\d)_(?=\d)/g,"$1"),rd.test(r))return lo(e,r)}else if(r==="Infinity"||r==="NaN")return+r||(e.s=NaN),e.e=NaN,e.d=null,e;if($S.test(r))t=16,r=r.toLowerCase();else if(OS.test(r))t=2;else if(IS.test(r))t=8;else throw Error(vn+r);for(i=r.search(/p/i),i>0?(u=+r.slice(i+1),r=r.substring(2,i)):r=r.slice(2),i=r.indexOf("."),o=i>=0,n=e.constructor,o&&(r=r.replace(".",""),l=r.length,i=l-i,a=nd(n,new n(t),i,i*2)),s=oo(r,t,yt),c=s.length-1,i=c;s[i]===0;--i)s.pop();return i<0?new n(e.s*0):(e.e=so(s,c),e.d=s,ze=!1,o&&(e=or(e,a,l*4)),u&&(e=e.times(Math.abs(u)<54?wr(2,u):yn.pow(2,u))),ze=!0,e)}function qS(e,r){var t,n=r.d.length;if(n<3)return r.isZero()?r:ha(e,2,r,r);t=1.4*Math.sqrt(n),t=t>16?16:t|0,r=r.times(1/co(5,t)),r=ha(e,2,r,r);for(var a,i=new e(5),o=new e(16),l=new e(20);t--;)a=r.times(r),r=r.times(i.plus(a.times(o.times(a).minus(l))));return r}function ha(e,r,t,n,a){var i,o,l,u,s=e.precision,c=Math.ceil(s/Be);for(ze=!1,u=t.times(t),l=new e(n);;){if(o=or(l.times(u),new e(r++*r++),s,1),l=a?n.plus(o):n.minus(o),n=or(o.times(u),new e(r++*r++),s,1),o=l.plus(n),o.d[c]!==void 0){for(i=c;o.d[i]===l.d[i]&&i--;);if(i==-1)break}i=l,l=n,n=o,o=i}return ze=!0,o.d.length=c+1,o}function co(e,r){for(var t=e;--r;)t*=e;return t}function sd(e,r){var t,n=r.s<0,a=Ft(e,e.precision,1),i=a.times(.5);if(r=r.abs(),r.lte(i))return jt=n?4:1,r;if(t=r.divToInt(a),t.isZero())jt=n?3:2;else{if(r=r.minus(t.times(a)),r.lte(i))return jt=ad(t)?n?2:3:n?4:1,r;jt=ad(t)?n?1:4:n?3:2}return r.minus(a).abs()}function yu(e,r,t,n){var a,i,o,l,u,s,c,f,m,p=e.constructor,v=t!==void 0;if(v?(Wr(t,1,pn),n===void 0?n=p.rounding:Wr(n,0,8)):(t=p.precision,n=p.rounding),!e.isFinite())c=od(e);else{for(c=Tt(e),o=c.indexOf("."),v?(a=2,r==16?t=t*4-3:r==8&&(t=t*3-2)):a=r,o>=0&&(c=c.replace(".",""),m=new p(1),m.e=c.length-o,m.d=oo(Tt(m),10,a),m.e=m.d.length),f=oo(c,10,a),i=u=f.length;f[--u]==0;)f.pop();if(!f[0])c=v?"0p+0":"0";else{if(o<0?i--:(e=new p(e),e.d=f,e.e=i,e=or(e,m,t,n,0,a),f=e.d,i=e.e,s=Ym),o=f[t],l=a/2,s=s||f[t+1]!==void 0,s=n<4?(o!==void 0||s)&&(n===0||n===(e.s<0?3:2)):o>l||o===l&&(n===4||s||n===6&&f[t-1]&1||n===(e.s<0?8:7)),f.length=t,s)for(;++f[--t]>a-1;)f[t]=0,t||(++i,f.unshift(1));for(u=f.length;!f[u-1];--u);for(o=0,c="";o1)if(r==16||r==8){for(o=r==16?4:3,--u;u%o;u++)c+="0";for(f=oo(c,a,r),u=f.length;!f[u-1];--u);for(o=1,c="1.";ou)for(i-=u;i--;)c+="0";else ir)return e.length=r,!0}function LS(e){return new this(e).abs()}function VS(e){return new this(e).acos()}function US(e){return new this(e).acosh()}function HS(e,r){return new this(e).plus(r)}function ZS(e){return new this(e).asin()}function GS(e){return new this(e).asinh()}function WS(e){return new this(e).atan()}function jS(e){return new this(e).atanh()}function KS(e,r){e=new this(e),r=new this(r);var t,n=this.precision,a=this.rounding,i=n+4;return!e.s||!r.s?t=new this(NaN):!e.d&&!r.d?(t=Ft(this,i,1).times(r.s>0?.25:.75),t.s=e.s):!r.d||e.isZero()?(t=r.s<0?Ft(this,n,a):new this(0),t.s=e.s):!e.d||r.isZero()?(t=Ft(this,i,1).times(.5),t.s=e.s):r.s<0?(this.precision=i,this.rounding=1,t=this.atan(or(e,r,i,1)),r=Ft(this,i,1),this.precision=n,this.rounding=a,t=e.s<0?t.minus(r):t.plus(r)):t=this.atan(or(e,r,i,1)),t}function JS(e){return new this(e).cbrt()}function YS(e){return Me(e=new this(e),e.e+1,2)}function XS(e,r,t){return new this(e).clamp(r,t)}function QS(e){if(!e||typeof e!="object")throw Error(io+"Object expected");var r,t,n,a=e.defaults===!0,i=["precision",1,pn,"rounding",0,8,"toExpNeg",-va,0,"toExpPos",0,va,"maxE",0,va,"minE",-va,0,"modulo",0,9];for(r=0;r=i[r+1]&&n<=i[r+2])this[t]=n;else throw Error(vn+t+": "+n);if(t="crypto",a&&(this[t]=vu[t]),(n=e[t])!==void 0)if(n===!0||n===!1||n===0||n===1)if(n)if(typeof crypto<"u"&&crypto&&(crypto.getRandomValues||crypto.randomBytes))this[t]=!0;else throw Error(Qm);else this[t]=!1;else throw Error(vn+t+": "+n);return this}function eC(e){return new this(e).cos()}function rC(e){return new this(e).cosh()}function ld(e){var r,t,n;function a(i){var o,l,u,s=this;if(!(s instanceof a))return new a(i);if(s.constructor=a,cd(i)){s.s=i.s,ze?!i.d||i.e>a.maxE?(s.e=NaN,s.d=null):i.e=10;l/=10)o++;ze?o>a.maxE?(s.e=NaN,s.d=null):o=429e7?r[i]=crypto.getRandomValues(new Uint32Array(1))[0]:l[i++]=a%1e7;else if(crypto.randomBytes){for(r=crypto.randomBytes(n*=4);i=214e7?crypto.randomBytes(4).copy(r,i):(l.push(a%1e7),i+=4);i=n/4}else throw Error(Qm);else for(;i=10;a/=10)n++;n{var{on:r,config:t}=e,n=yn.clone({precision:t.precision,modulo:yn.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(a){return new n(a.value)},r&&r("config",function(a,i){a.precision!==i.precision&&n.config({precision:a.precision})}),n},{isClass:!0});const $r=Math.cosh||function(e){return Math.abs(e)<1e-9?1-e:(Math.exp(e)+Math.exp(-e))*.5},lt=Math.sinh||function(e){return Math.abs(e)<1e-9?e:(Math.exp(e)-Math.exp(-e))*.5},_C=function(e){const r=Math.PI/4;if(-r>e||e>r)return Math.cos(e)-1;const t=e*e;return t*(t*(t*(t*(t*(t*(t*(t/20922789888e3-1/87178291200)+1/479001600)-1/3628800)+1/40320)-1/720)+1/24)-1/2)},bu=function(e,r){return e=Math.abs(e),r=Math.abs(r),e0&&ga();break;case"number":t.im=0,t.re=e;break;default:ga()}return isNaN(t.re)||isNaN(t.im),t};function pe(e,r){if(!(this instanceof pe))return new pe(e,r);const t=Ln(e,r);this.re=t.re,this.im=t.im}pe.prototype={re:0,im:0,sign:function(){const e=bu(this.re,this.im);return new pe(this.re/e,this.im/e)},add:function(e,r){const t=Ln(e,r),n=this.isInfinite(),a=!(isFinite(t.re)&&isFinite(t.im));return n||a?n&&a?pe.NAN:pe.INFINITY:new pe(this.re+t.re,this.im+t.im)},sub:function(e,r){const t=Ln(e,r),n=this.isInfinite(),a=!(isFinite(t.re)&&isFinite(t.im));return n||a?n&&a?pe.NAN:pe.INFINITY:new pe(this.re-t.re,this.im-t.im)},mul:function(e,r){const t=Ln(e,r),n=this.isInfinite(),a=!(isFinite(t.re)&&isFinite(t.im)),i=this.re===0&&this.im===0,o=t.re===0&&t.im===0;return n&&o||a&&i?pe.NAN:n||a?pe.INFINITY:t.im===0&&this.im===0?new pe(this.re*t.re,0):new pe(this.re*t.re-this.im*t.im,this.re*t.im+this.im*t.re)},div:function(e,r){const t=Ln(e,r),n=this.isInfinite(),a=!(isFinite(t.re)&&isFinite(t.im)),i=this.re===0&&this.im===0,o=t.re===0&&t.im===0;if(i&&o||n&&a)return pe.NAN;if(o||n)return pe.INFINITY;if(i||a)return pe.ZERO;if(t.im===0)return new pe(this.re/t.re,this.im/t.re);if(Math.abs(t.re)0)return new pe(Math.pow(this.re,t.re),0);if(this.re===0)switch((t.re%4+4)%4){case 0:return new pe(Math.pow(this.im,t.re),0);case 1:return new pe(0,Math.pow(this.im,t.re));case 2:return new pe(-Math.pow(this.im,t.re),0);case 3:return new pe(0,-Math.pow(this.im,t.re))}}if(n&&t.re>0)return pe.ZERO;const i=Math.atan2(this.im,this.re),o=wu(this.re,this.im);let l=Math.exp(t.re*o-t.im*i),u=t.im*o+t.re*i;return new pe(l*Math.cos(u),l*Math.sin(u))},sqrt:function(){const e=this.re,r=this.im;if(r===0)return e>=0?new pe(Math.sqrt(e),0):new pe(0,Math.sqrt(-e));const t=bu(e,r);let n=Math.sqrt(.5*(t+Math.abs(e))),a=Math.abs(r)/(2*n);return e>=0?new pe(n,r<0?-a:a):new pe(a,r<0?-n:n)},exp:function(){const e=Math.exp(this.re);return this.im===0?new pe(e,0):new pe(e*Math.cos(this.im),e*Math.sin(this.im))},expm1:function(){const e=this.re,r=this.im;return new pe(Math.expm1(e)*Math.cos(r)+_C(r),Math.exp(e)*Math.sin(r))},log:function(){const e=this.re,r=this.im;return r===0&&e>0?new pe(Math.log(e),0):new pe(wu(e,r),Math.atan2(r,e))},abs:function(){return bu(this.re,this.im)},arg:function(){return Math.atan2(this.im,this.re)},sin:function(){const e=this.re,r=this.im;return new pe(Math.sin(e)*$r(r),Math.cos(e)*lt(r))},cos:function(){const e=this.re,r=this.im;return new pe(Math.cos(e)*$r(r),-Math.sin(e)*lt(r))},tan:function(){const e=2*this.re,r=2*this.im,t=Math.cos(e)+$r(r);return new pe(Math.sin(e)/t,lt(r)/t)},cot:function(){const e=2*this.re,r=2*this.im,t=Math.cos(e)-$r(r);return new pe(-Math.sin(e)/t,lt(r)/t)},sec:function(){const e=this.re,r=this.im,t=.5*$r(2*r)+.5*Math.cos(2*e);return new pe(Math.cos(e)*$r(r)/t,Math.sin(e)*lt(r)/t)},csc:function(){const e=this.re,r=this.im,t=.5*$r(2*r)-.5*Math.cos(2*e);return new pe(Math.sin(e)*$r(r)/t,-Math.cos(e)*lt(r)/t)},asin:function(){const e=this.re,r=this.im,t=new pe(r*r-e*e+1,-2*e*r).sqrt(),n=new pe(t.re-r,t.im+e).log();return new pe(n.im,-n.re)},acos:function(){const e=this.re,r=this.im,t=new pe(r*r-e*e+1,-2*e*r).sqrt(),n=new pe(t.re-r,t.im+e).log();return new pe(Math.PI/2-n.im,n.re)},atan:function(){const e=this.re,r=this.im;if(e===0){if(r===1)return new pe(0,1/0);if(r===-1)return new pe(0,-1/0)}const t=e*e+(1-r)*(1-r),n=new pe((1-r*r-e*e)/t,-2*e/t).log();return new pe(-.5*n.im,.5*n.re)},acot:function(){const e=this.re,r=this.im;if(r===0)return new pe(Math.atan2(1,e),0);const t=e*e+r*r;return t!==0?new pe(e/t,-r/t).atan():new pe(e!==0?e/0:0,r!==0?-r/0:0).atan()},asec:function(){const e=this.re,r=this.im;if(e===0&&r===0)return new pe(0,1/0);const t=e*e+r*r;return t!==0?new pe(e/t,-r/t).acos():new pe(e!==0?e/0:0,r!==0?-r/0:0).acos()},acsc:function(){const e=this.re,r=this.im;if(e===0&&r===0)return new pe(Math.PI/2,1/0);const t=e*e+r*r;return t!==0?new pe(e/t,-r/t).asin():new pe(e!==0?e/0:0,r!==0?-r/0:0).asin()},sinh:function(){const e=this.re,r=this.im;return new pe(lt(e)*Math.cos(r),$r(e)*Math.sin(r))},cosh:function(){const e=this.re,r=this.im;return new pe($r(e)*Math.cos(r),lt(e)*Math.sin(r))},tanh:function(){const e=2*this.re,r=2*this.im,t=$r(e)+Math.cos(r);return new pe(lt(e)/t,Math.sin(r)/t)},coth:function(){const e=2*this.re,r=2*this.im,t=$r(e)-Math.cos(r);return new pe(lt(e)/t,-Math.sin(r)/t)},csch:function(){const e=this.re,r=this.im,t=Math.cos(2*r)-$r(2*e);return new pe(-2*lt(e)*Math.cos(r)/t,2*$r(e)*Math.sin(r)/t)},sech:function(){const e=this.re,r=this.im,t=Math.cos(2*r)+$r(2*e);return new pe(2*$r(e)*Math.cos(r)/t,-2*lt(e)*Math.sin(r)/t)},asinh:function(){let e=this.im;this.im=-this.re,this.re=e;const r=this.asin();return this.re=-this.im,this.im=e,e=r.re,r.re=-r.im,r.im=e,r},acosh:function(){const e=this.acos();if(e.im<=0){const r=e.re;e.re=-e.im,e.im=r}else{const r=e.im;e.im=-e.re,e.re=r}return e},atanh:function(){const e=this.re,r=this.im,t=e>1&&r===0,n=1-e,a=1+e,i=n*n+r*r,o=i!==0?new pe((a*n-r*r)/i,(r*n+a*r)/i):new pe(e!==-1?e/0:0,r!==0?r/0:0),l=o.re;return o.re=wu(o.re,o.im)/2,o.im=Math.atan2(o.im,l)/2,t&&(o.im=-o.im),o},acoth:function(){const e=this.re,r=this.im;if(e===0&&r===0)return new pe(0,Math.PI/2);const t=e*e+r*r;return t!==0?new pe(e/t,-r/t).atanh():new pe(e!==0?e/0:0,r!==0?-r/0:0).atanh()},acsch:function(){const e=this.re,r=this.im;if(r===0)return new pe(e!==0?Math.log(e+Math.sqrt(e*e+1)):1/0,0);const t=e*e+r*r;return t!==0?new pe(e/t,-r/t).asinh():new pe(e!==0?e/0:0,r!==0?-r/0:0).asinh()},asech:function(){const e=this.re,r=this.im;if(this.isZero())return pe.INFINITY;const t=e*e+r*r;return t!==0?new pe(e/t,-r/t).acosh():new pe(e!==0?e/0:0,r!==0?-r/0:0).acosh()},inverse:function(){if(this.isZero())return pe.INFINITY;if(this.isInfinite())return pe.ZERO;const e=this.re,r=this.im,t=e*e+r*r;return new pe(e/t,-r/t)},conjugate:function(){return new pe(this.re,-this.im)},neg:function(){return new pe(-this.re,-this.im)},ceil:function(e){return e=Math.pow(10,e||0),new pe(Math.ceil(this.re*e)/e,Math.ceil(this.im*e)/e)},floor:function(e){return e=Math.pow(10,e||0),new pe(Math.floor(this.re*e)/e,Math.floor(this.im*e)/e)},round:function(e){return e=Math.pow(10,e||0),new pe(Math.round(this.re*e)/e,Math.round(this.im*e)/e)},equals:function(e,r){const t=Ln(e,r);return Math.abs(t.re-this.re)<=pe.EPSILON&&Math.abs(t.im-this.im)<=pe.EPSILON},clone:function(){return new pe(this.re,this.im)},toString:function(){let e=this.re,r=this.im,t="";return this.isNaN()?"NaN":this.isInfinite()?"Infinity":(Math.abs(e)(Object.defineProperty(pe,"name",{value:"Complex"}),pe.prototype.constructor=pe,pe.prototype.type="Complex",pe.prototype.isComplex=!0,pe.prototype.toJSON=function(){return{mathjs:"Complex",re:this.re,im:this.im}},pe.prototype.toPolar=function(){return{r:this.abs(),phi:this.arg()}},pe.prototype.format=function(e){var r="",t=this.im,n=this.re,a=qn(this.re,e),i=qn(this.im,e),o=Re(e)?e:e?e.precision:null;if(o!==null){var l=Math.pow(10,-o);Math.abs(n/t)r.re?1:e.rer.im?1:e.im1&&(r[t]=(r[t]||0)+1):r[e]=(r[e]||0)+1,r}var et=function(e,r){var t=0,n=1,a=1,i=0,o=0,l=0,u=1,s=1,c=0,f=1,m=1,p=1,v=1e7,h;if(e!=null)if(r!==void 0){if(t=e,n=r,a=t*n,t%1!==0||n%1!==0)throw PC()}else switch(typeof e){case"object":{if("d"in e&&"n"in e)t=e.n,n=e.d,"s"in e&&(t*=e.s);else if(0 in e)t=e[0],1 in e&&(n=e[1]);else throw fo();a=t*n;break}case"number":{if(e<0&&(a=e,e=-e),e%1===0)t=e;else if(e>0){for(e>=1&&(s=Math.pow(10,Math.floor(1+Math.log(e)/Math.LN10)),e/=s);f<=v&&p<=v;)if(h=(c+m)/(f+p),e===h){f+p<=v?(t=c+m,n=f+p):p>f?(t=m,n=p):(t=c,n=f);break}else e>h?(c+=m,f+=p):(m+=c,p+=f),f>v?(t=m,n=p):(t=c,n=f);t*=s}else(isNaN(e)||isNaN(r))&&(n=t=NaN);break}case"string":{if(f=e.match(/\d+|./g),f===null)throw fo();if(f[c]==="-"?(a=-1,c++):f[c]==="+"&&c++,f.length===c+1?o=Kt(f[c++],a):f[c+1]==="."||f[c]==="."?(f[c]!=="."&&(i=Kt(f[c++],a)),c++,(c+1===f.length||f[c+1]==="("&&f[c+3]===")"||f[c+1]==="'"&&f[c+3]==="'")&&(o=Kt(f[c],a),u=Math.pow(10,f[c].length),c++),(f[c]==="("&&f[c+2]===")"||f[c]==="'"&&f[c+2]==="'")&&(l=Kt(f[c+1],a),s=Math.pow(10,f[c+1].length)-1,c+=3)):f[c+1]==="/"||f[c+1]===":"?(o=Kt(f[c],a),u=Kt(f[c+2],1),c+=3):f[c+3]==="/"&&f[c+1]===" "&&(i=Kt(f[c],a),o=Kt(f[c+2],a),u=Kt(f[c+4],1),c+=5),f.length<=c){n=u*s,a=t=l+n*i+s*o;break}}default:throw fo()}if(n===0)throw xu();Se.s=a<0?-1:1,Se.n=Math.abs(t),Se.d=Math.abs(n)};function IC(e,r,t){for(var n=1;r>0;e=e*e%t,r>>=1)r&1&&(n=n*e%t);return n}function RC(e,r){for(;r%2===0;r/=2);for(;r%5===0;r/=5);if(r===1)return 0;for(var t=10%r,n=1;t!==1;n++)if(t=t*10%r,n>$C)return 0;return n}function zC(e,r,t){for(var n=1,a=IC(10,t,r),i=0;i<300;i++){if(n===a)return i;n=n*10%r,a=a*10%r}return 0}function ya(e,r){if(!e)return r;if(!r)return e;for(;;){if(e%=r,!e)return r;if(r%=e,!r)return e}}function Ir(e,r){if(et(e,r),this instanceof Ir)e=ya(Se.d,Se.n),this.s=Se.s,this.n=Se.n/e,this.d=Se.d/e;else return dr(Se.s*Se.n,Se.d)}var xu=function(){return new Error("Division by Zero")},fo=function(){return new Error("Invalid argument")},PC=function(){return new Error("Parameters must be integer")};Ir.prototype={s:1,n:0,d:1,abs:function(){return dr(this.n,this.d)},neg:function(){return dr(-this.s*this.n,this.d)},add:function(e,r){return et(e,r),dr(this.s*this.n*Se.d+Se.s*this.d*Se.n,this.d*Se.d)},sub:function(e,r){return et(e,r),dr(this.s*this.n*Se.d-Se.s*this.d*Se.n,this.d*Se.d)},mul:function(e,r){return et(e,r),dr(this.s*Se.s*this.n*Se.n,this.d*Se.d)},div:function(e,r){return et(e,r),dr(this.s*Se.s*this.n*Se.d,this.d*Se.n)},clone:function(){return dr(this.s*this.n,this.d)},mod:function(e,r){if(isNaN(this.n)||isNaN(this.d))return new Ir(NaN);if(e===void 0)return dr(this.s*this.n%this.d,1);if(et(e,r),Se.n===0&&this.d===0)throw xu();return dr(this.s*(Se.d*this.n)%(Se.n*this.d),Se.d*this.d)},gcd:function(e,r){return et(e,r),dr(ya(Se.n,this.n)*ya(Se.d,this.d),Se.d*this.d)},lcm:function(e,r){return et(e,r),Se.n===0&&this.n===0?dr(0,1):dr(Se.n*this.n,ya(Se.n,this.n)*ya(Se.d,this.d))},ceil:function(e){return e=Math.pow(10,e||0),isNaN(this.n)||isNaN(this.d)?new Ir(NaN):dr(Math.ceil(e*this.s*this.n/this.d),e)},floor:function(e){return e=Math.pow(10,e||0),isNaN(this.n)||isNaN(this.d)?new Ir(NaN):dr(Math.floor(e*this.s*this.n/this.d),e)},round:function(e){return e=Math.pow(10,e||0),isNaN(this.n)||isNaN(this.d)?new Ir(NaN):dr(Math.round(e*this.s*this.n/this.d),e)},roundTo:function(e,r){return et(e,r),dr(this.s*Math.round(this.n*Se.d/(this.d*Se.n))*Se.n,Se.d)},inverse:function(){return dr(this.s*this.d,this.n)},pow:function(e,r){if(et(e,r),Se.d===1)return Se.s<0?dr(Math.pow(this.s*this.d,Se.n),Math.pow(this.n,Se.n)):dr(Math.pow(this.s*this.n,Se.n),Math.pow(this.d,Se.n));if(this.s<0)return null;var t=fd(this.n),n=fd(this.d),a=1,i=1;for(var o in t)if(o!=="1"){if(o==="0"){a=0;break}if(t[o]*=Se.n,t[o]%Se.d===0)t[o]/=Se.d;else return null;a*=Math.pow(o,t[o])}for(var o in n)if(o!=="1"){if(n[o]*=Se.n,n[o]%Se.d===0)n[o]/=Se.d;else return null;i*=Math.pow(o,n[o])}return Se.s<0?dr(i,a):dr(a,i)},equals:function(e,r){return et(e,r),this.s*this.n*Se.d===Se.s*Se.n*this.d},compare:function(e,r){et(e,r);var t=this.s*this.n*Se.d-Se.s*Se.n*this.d;return(0=0;i--)a=a.inverse().add(t[i]);if(Math.abs(a.sub(r).valueOf())0&&(t+=r,t+=" ",n%=a),t+=n,t+="/",t+=a),t},toLatex:function(e){var r,t="",n=this.n,a=this.d;return this.s<0&&(t+="-"),a===1?t+=n:(e&&(r=Math.floor(n/a))>0&&(t+=r,n%=a),t+="\\frac{",t+=n,t+="}{",t+=a,t+="}"),t},toContinued:function(){var e,r=this.n,t=this.d,n=[];if(isNaN(r)||isNaN(t))return n;do n.push(Math.floor(r/t)),e=r%t,r=t,t=e;while(r!==1);return n},toString:function(e){var r=this.n,t=this.d;if(isNaN(r)||isNaN(t))return"NaN";e=e||15;var n=RC(r,t),a=zC(r,t,n),i=this.s<0?"-":"";if(i+=r/t|0,r%=t,r*=10,r&&(i+="."),n){for(var o=a;o--;)i+=r/t|0,r%=t,r*=10;i+="(";for(var o=n;o--;)i+=r/t|0,r%=t,r*=10;i+=")"}else for(var o=e;r&&o--;)i+=r/t|0,r%=t,r*=10;return i}};var kC="Fraction",qC=[],LC=P(kC,qC,()=>(Object.defineProperty(Ir,"name",{value:"Fraction"}),Ir.prototype.constructor=Ir,Ir.prototype.type="Fraction",Ir.prototype.isFraction=!0,Ir.prototype.toJSON=function(){return{mathjs:"Fraction",n:this.s*this.n,d:this.d}},Ir.fromJSON=function(e){return new Ir(e)},Ir),{isClass:!0}),VC="Range",UC=[],HC=P(VC,UC,()=>{function e(r,t,n){if(!(this instanceof e))throw new SyntaxError("Constructor must be called with the new operator");var a=r!=null,i=t!=null,o=n!=null;if(a){if(Ie(r))r=r.toNumber();else if(typeof r!="number")throw new TypeError("Parameter start must be a number")}if(i){if(Ie(t))t=t.toNumber();else if(typeof t!="number")throw new TypeError("Parameter end must be a number")}if(o){if(Ie(n))n=n.toNumber();else if(typeof n!="number")throw new TypeError("Parameter step must be a number")}this.start=a?parseFloat(r):0,this.end=i?parseFloat(t):0,this.step=o?parseFloat(n):1}return e.prototype.type="Range",e.prototype.isRange=!0,e.parse=function(r){if(typeof r!="string")return null;var t=r.split(":"),n=t.map(function(i){return parseFloat(i)}),a=n.some(function(i){return isNaN(i)});if(a)return null;switch(n.length){case 2:return new e(n[0],n[1]);case 3:return new e(n[0],n[2],n[1]);default:return null}},e.prototype.clone=function(){return new e(this.start,this.end,this.step)},e.prototype.size=function(){var r=0,t=this.start,n=this.step,a=this.end,i=a-t;return dn(n)===dn(i)?r=Math.ceil(i/n):i===0&&(r=0),isNaN(r)&&(r=0),[r]},e.prototype.min=function(){var r=this.size()[0];if(r>0)return this.step>0?this.start:this.start+(r-1)*this.step},e.prototype.max=function(){var r=this.size()[0];if(r>0)return this.step>0?this.start+(r-1)*this.step:this.start},e.prototype.forEach=function(r){var t=this.start,n=this.step,a=this.end,i=0;if(n>0)for(;ta;)r(t,[i],this),t+=n,i++},e.prototype.map=function(r){var t=[];return this.forEach(function(n,a,i){t[a[0]]=r(n,a,i)}),t},e.prototype.toArray=function(){var r=[];return this.forEach(function(t,n){r[n[0]]=t}),r},e.prototype.valueOf=function(){return this.toArray()},e.prototype.format=function(r){var t=qn(this.start,r);return this.step!==1&&(t+=":"+qn(this.step,r)),t+=":"+qn(this.end,r),t},e.prototype.toString=function(){return this.format()},e.prototype.toJSON=function(){return{mathjs:"Range",start:this.start,end:this.end,step:this.step}},e.fromJSON=function(r){return new e(r.start,r.end,r.step)},e},{isClass:!0}),ZC="Matrix",GC=[],WC=P(ZC,GC,()=>{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(r,t){throw new Error("Cannot invoke create on a Matrix interface")},e.prototype.subset=function(r,t,n){throw new Error("Cannot invoke subset on a Matrix interface")},e.prototype.get=function(r){throw new Error("Cannot invoke get on a Matrix interface")},e.prototype.set=function(r,t,n){throw new Error("Cannot invoke set on a Matrix interface")},e.prototype.resize=function(r,t){throw new Error("Cannot invoke resize on a Matrix interface")},e.prototype.reshape=function(r,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(r,t){throw new Error("Cannot invoke map on a Matrix interface")},e.prototype.forEach=function(r){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(r){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 Nu(e,r,t){var n=e.constructor,a=new n(2),i="";if(t){if(t<1)throw new Error("size must be in greater than 0");if(!Ce(t))throw new Error("size must be an integer");if(e.greaterThan(a.pow(t-1).sub(1))||e.lessThan(a.pow(t-1).mul(-1)))throw new Error("Value must be in range [-2^".concat(t-1,", 2^").concat(t-1,"-1]"));if(!e.isInteger())throw new Error("Value must be an integer");e.lessThan(0)&&(e=e.add(a.pow(t))),i="i".concat(t)}switch(r){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(r," not supported "))}}function jC(e,r){if(typeof r=="function")return r(e);if(!e.isFinite())return e.isNaN()?"NaN":e.gt(0)?"Infinity":"-Infinity";var{notation:t,precision:n,wordSize:a}=Zm(r);switch(t){case"fixed":return JC(e,n);case"exponential":return md(e,n);case"engineering":return KC(e,n);case"bin":return Nu(e,2,a);case"oct":return Nu(e,8,a);case"hex":return Nu(e,16,a);case"auto":{var i=dd(r==null?void 0:r.lowerExp,-3),o=dd(r==null?void 0:r.upperExp,5);if(e.isZero())return"0";var l,u=e.toSignificantDigits(n),s=u.e;return s>=i&&s=0?"+":"")+n.toString()}function md(e,r){return r!==void 0?e.toExponential(r-1):e.toExponential()}function JC(e,r){return e.toFixed(r)}function dd(e,r){return Re(e)?e:Ie(e)?e.toNumber():r}function YC(e,r){var t=e.length-r.length,n=e.length;return e.substring(t,n)===r}function Ve(e,r){var t=XC(e,r);return r&&typeof r=="object"&&"truncate"in r&&t.length>r.truncate?t.substring(0,r.truncate-3)+"...":t}function XC(e,r){if(typeof e=="number")return qn(e,r);if(Ie(e))return jC(e,r);if(QC(e))return!r||r.fraction!=="decimal"?e.s*e.n+"/"+e.d:e.toString();if(Array.isArray(e))return vd(e,r);if(Cr(e))return ba(e);if(typeof e=="function")return e.syntax?String(e.syntax):"function";if(e&&typeof e=="object"){if(typeof e.format=="function")return e.format(r);if(e&&e.toString(r)!=={}.toString())return e.toString(r);var t=Object.keys(e).map(n=>ba(n)+": "+Ve(e[n],r));return"{"+t.join(", ")+"}"}return String(e)}function ba(e){for(var r=String(e),t="",n=0;n/g,">"),r}function vd(e,r){if(Array.isArray(e)){for(var t="[",n=e.length,a=0;ar?1:-1}function qe(e,r,t){if(!(this instanceof qe))throw new SyntaxError("Constructor must be called with the new operator");this.actual=e,this.expected=r,this.relation=t,this.message="Dimension mismatch ("+(Array.isArray(e)?"["+e.join(", ")+"]":e)+" "+(this.relation||"!=")+" "+(Array.isArray(r)?"["+r.join(", ")+"]":r)+")",this.stack=new Error().stack}qe.prototype=new RangeError,qe.prototype.constructor=RangeError,qe.prototype.name="DimensionError",qe.prototype.isDimensionError=!0;function ft(e,r,t){if(!(this instanceof ft))throw new SyntaxError("Constructor must be called with the new operator");this.index=e,arguments.length<3?(this.min=0,this.max=r):(this.min=r,this.max=t),this.min!==void 0&&this.index=this.max?this.message="Index out of range ("+this.index+" > "+(this.max-1)+")":this.message="Index out of range ("+this.index+")",this.stack=new Error().stack}ft.prototype=new RangeError,ft.prototype.constructor=RangeError,ft.prototype.name="IndexError",ft.prototype.isIndexError=!0;function $e(e){for(var r=[];Array.isArray(e);)r.push(e.length),e=e[0];return r}function hd(e,r,t){var n,a=e.length;if(a!==r[t])throw new qe(a,r[t]);if(t")}function gd(e,r){var t=r.length===0;if(t){if(Array.isArray(e))throw new qe(e.length,0)}else hd(e,r,0)}function mo(e,r){var t=e.isMatrix?e._size:$e(e),n=r._sourceSize;n.forEach((a,i)=>{if(a!==null&&a!==t[i])throw new qe(a,t[i])})}function nr(e,r){if(e!==void 0){if(!Re(e)||!Ce(e))throw new TypeError("Index must be an integer (value: "+e+")");if(e<0||typeof r=="number"&&e>=r)throw new ft(e,r)}}function wa(e){for(var r=0;r=0,u=r%t===0;if(l)if(u)n[i]=-r/t;else throw new Error("Could not replace wildcard, since "+r+" is no multiple of "+-t);return n}function yd(e){return e.reduce((r,t)=>r*t,1)}function eM(e,r){for(var t=e,n,a=r.length-1;a>0;a--){var i=r[a];n=[];for(var o=t.length/i,l=0;lr.test(t))}function Ed(e,r){return Array.prototype.join.call(e,r)}function Na(e){if(!Array.isArray(e))throw new TypeError("Array input expected");if(e.length===0)return e;var r=[],t=0;r[0]={value:e[0],identifier:0};for(var n=1;n1)return e.slice(1).reduce(function(t,n){return Dd(t,n,r,0)},e[0]);throw new Error("Wrong number of arguments in function concat")}function Cu(){for(var e=arguments.length,r=new Array(e),t=0;tm.length),a=Math.max(...n),i=new Array(a).fill(null),o=0;oi[c]&&(i[c]=l[s])}for(var f=0;f1||e[a]>r[i])throw new Error("shape missmatch: missmatch is found in arg with shape (".concat(e,") not possible to broadcast dimension ").concat(n," with size ").concat(e[a]," to size ").concat(r[i]))}}function Vn(e,r){var t=$e(e);if(Wt(t,r))return e;Cd(t,r);var n=Cu(t,r),a=n.length,i=[...Array(a-t.length).fill(1),...t],o=nM(e);t.lengtha[i],e)}function _u(e,r,t,n){return Array.isArray(e)?e.map(function(a,i){return _u(a,r.concat(i),t,n)}):n(e,r,t)}function nM(e){return Br([],e)}function Un(e,r,t){if(Qa.isTypedFunction(e)){var n=(r.isMatrix?r.size():$e(r)).map(()=>0),a=r.isMatrix?r.get(n):Mu(r,n),i=Object.keys(e.signatures).length===1,o=aM(e,a,n,r),l=i?Object.values(e.signatures)[0]:e;return o>=1&&o<=3?function(){for(var u=arguments.length,s=new Array(u),c=0;c0;i--){var o=a.slice(0,i);if(Qa.resolve(e,o)!==null)return i}}function Md(e,r,t,n){try{return e(...r)}catch(a){iM(a,r,t,n)}}function iM(e,r,t,n){var a;if(e instanceof TypeError&&((a=e.data)===null||a===void 0?void 0:a.category)==="wrongType"){var i=[];throw i.push("value: ".concat(tr(r[0]))),r.length>=2&&i.push("index: ".concat(tr(r[1]))),r.length>=3&&i.push("array: ".concat(tr(r[2]))),new TypeError("Function ".concat(t," cannot apply callback arguments ")+"".concat(n,"(").concat(i.join(", "),") at index ").concat(JSON.stringify(r[1])))}else throw new TypeError("Function ".concat(t," cannot apply callback arguments ")+"to function ".concat(n,": ").concat(e.message))}var oM="DenseMatrix",sM=["Matrix"],uM=P(oM,sM,e=>{var{Matrix:r}=e;function t(c,f){if(!(this instanceof t))throw new SyntaxError("Constructor must be called with the new operator");if(f&&!Cr(f))throw new Error("Invalid datatype: "+f);if(_e(c))c.type==="DenseMatrix"?(this._data=Fe(c._data),this._size=Fe(c._size),this._datatype=f||c._datatype):(this._data=c.toArray(),this._size=c.size(),this._datatype=f||c._datatype);else if(c&&Xe(c.data)&&Xe(c.size))this._data=c.data,this._size=c.size,gd(this._data,this._size),this._datatype=f||c.datatype;else if(Xe(c))this._data=s(c),this._size=$e(this._data),gd(this._data,this._size),this._datatype=f;else{if(c)throw new TypeError("Unsupported type of data ("+tr(c)+")");this._data=[],this._size=[0],this._datatype=f}}t.prototype=new r,t.prototype.createDenseMatrix=function(c,f){return new t(c,f)},Object.defineProperty(t,"name",{value:"DenseMatrix"}),t.prototype.constructor=t,t.prototype.type="DenseMatrix",t.prototype.isDenseMatrix=!0,t.prototype.getDataType=function(){return ho(this._data,tr)},t.prototype.storage=function(){return"dense"},t.prototype.datatype=function(){return this._datatype},t.prototype.create=function(c,f){return new t(c,f)},t.prototype.subset=function(c,f,m){switch(arguments.length){case 1:return n(this,c);case 2:case 3:return i(this,c,f,m);default:throw new SyntaxError("Wrong number of arguments")}},t.prototype.get=function(c){return Mu(this._data,c)},t.prototype.set=function(c,f,m){if(!Xe(c))throw new TypeError("Array expected");if(c.length");var g=f.max().map(function(y){return y+1});u(c,g,p);var N=v.length,x=0;o(c._data,f,m,N,x)}return c}function o(c,f,m,p,v){var h=v===p-1,w=f.dimension(v);h?w.forEach(function(b,A){nr(b),c[b]=m[A[0]]}):w.forEach(function(b,A){nr(b),o(c[b],f,m[A[0]],p,v+1)})}t.prototype.resize=function(c,f,m){if(!Xr(c))throw new TypeError("Array or Matrix expected");var p=c.valueOf().map(h=>Array.isArray(h)&&h.length===1?h[0]:h),v=m?this.clone():this;return l(v,p,f)};function l(c,f,m){if(f.length===0){for(var p=c._data;Xe(p);)p=p[0];return p}return c._size=f.slice(0),c._data=xa(c._data,c._size,m),c}t.prototype.reshape=function(c,f){var m=f?this.clone():this;m._data=Du(m._data,c);var p=m._size.reduce((v,h)=>v*h);return m._size=Su(c,p),m};function u(c,f,m){for(var p=c._size.slice(0),v=!1;p.lengthp[h]&&(p[h]=f[h],v=!0);v&&l(c,p,m)}t.prototype.clone=function(){var c=new t({data:Fe(this._data),size:Fe(this._size),datatype:this._datatype});return c},t.prototype.size=function(){return this._size.slice(0)},t.prototype._forEach=function(c){var f=this,m=f.size();if(m.length===1){for(var p=0;p=0;A--){if(v[A]++,v[A]===m[A]){v[A]=0;continue}h[A]=A===0?f._data[v[A]]:h[A-1][v[A]];for(var g=A;g[g[b]]);f.push(new t(A,c._datatype))},h=0;h0?c:0,m=c<0?-c:0,p=this._size[0],v=this._size[1],h=Math.min(p-m,v-f),w=[],b=0;b0?m:0,h=m<0?-m:0,w=c[0],b=c[1],A=Math.min(w-h,b-v),g;if(Xe(f)){if(f.length!==A)throw new Error("Invalid value array length");g=function(S){return f[S]}}else if(_e(f)){var N=f.size();if(N.length!==1||N[0]!==A)throw new Error("Invalid matrix length");g=function(S){return f.get([S])}}else g=function(){return f};p||(p=Ie(g(0))?g(0).mul(0):0);var x=[];if(c.length>0){x=xa(x,c,p);for(var y=0;y{var{typed:r}=e;return r(_d,{any:Fe})});function Td(e){var r=e.length,t=e[0].length,n,a,i=[];for(a=0;a=n.length)throw new ft(r,n.length);return _e(e)?e.create(yo(e.valueOf(),r,t),e.datatype()):yo(e,r,t)}function yo(e,r,t){var n,a,i,o;if(r<=0)if(Array.isArray(e[0])){for(o=Td(e),a=[],n=0;n{var{typed:r}=e;return r(Bd,{number:Ce,BigNumber:function(n){return n.isInt()},bigint:function(n){return!0},Fraction:function(n){return n.d===1&&isFinite(n.n)},"Array | Matrix":r.referToSelf(t=>n=>Le(n,t))})}),bt="number",Ea="number, number";function Od(e){return Math.abs(e)}Od.signature=bt;function $d(e,r){return e+r}$d.signature=Ea;function Id(e,r){return e-r}Id.signature=Ea;function Rd(e,r){return e*r}Rd.signature=Ea;function zd(e){return-e}zd.signature=bt;function Pd(e){return e}Pd.signature=bt;function ni(e){return vS(e)}ni.signature=bt;function kd(e){return e*e*e}kd.signature=bt;function qd(e){return Math.exp(e)}qd.signature=bt;function Ld(e){return hS(e)}Ld.signature=bt;function Vd(e,r){if(!Ce(e)||!Ce(r))throw new Error("Parameters in function lcm must be integer numbers");if(e===0||r===0)return 0;for(var t,n=e*r;r!==0;)t=r,r=e%t,e=t;return Math.abs(n/e)}Vd.signature=Ea;function dM(e,r){return Math.log(e)}function Ud(e){return dS(e)}Ud.signature=bt;function Hd(e){return mS(e)}Hd.signature=bt;function Zd(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:2,t=r<0;if(t&&(r=-r),r===0)throw new Error("Root must be non-zero");if(e<0&&Math.abs(r)%2!==1)throw new Error("Root must be odd when a is negative.");if(e===0)return t?1/0:0;if(!isFinite(e))return t?0:e;var n=Math.pow(Math.abs(e),1/r);return n=e<0?-n:n,t?1/n:n}function Tu(e){return dn(e)}Tu.signature=bt;function Gd(e){return e*e}Gd.signature=bt;function Wd(e,r){var t,n,a,i=0,o=1,l=1,u=0;if(!Ce(e)||!Ce(r))throw new Error("Parameters in function xgcd must be integer numbers");for(;r;)n=Math.floor(e/r),a=e-n*r,t=i,i=o-n*i,o=t,t=l,l=u-n*l,u=t,e=r,r=a;var s;return e<0?s=[-e,-o,-u]:s=[e,e?o:0,u],s}Wd.signature=Ea;function jd(e,r){return e*e<1&&r===1/0||e*e>1&&r===-1/0?0:Math.pow(e,r)}jd.signature=Ea;function ai(e){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;if(!Ce(r)||r<0||r>15)throw new Error("Number of decimals in function round must be an integer from 0 to 15 inclusive");return parseFloat(Gm(e,r))}var pM="number",Da="number, number";function Kd(e,r){if(!Ce(e)||!Ce(r))throw new Error("Integers expected in function bitAnd");return e&r}Kd.signature=Da;function Jd(e){if(!Ce(e))throw new Error("Integer expected in function bitNot");return~e}Jd.signature=pM;function Yd(e,r){if(!Ce(e)||!Ce(r))throw new Error("Integers expected in function bitOr");return e|r}Yd.signature=Da;function Xd(e,r){if(!Ce(e)||!Ce(r))throw new Error("Integers expected in function bitXor");return e^r}Xd.signature=Da;function Qd(e,r){if(!Ce(e)||!Ce(r))throw new Error("Integers expected in function leftShift");return e<>r}ep.signature=Da;function rp(e,r){if(!Ce(e)||!Ce(r))throw new Error("Integers expected in function rightLogShift");return e>>>r}rp.signature=Da;function Yt(e,r){if(r>1;return Yt(e,t)*Yt(t+1,r)}function tp(e,r){if(!Ce(e)||e<0)throw new TypeError("Positive integer value expected in function combinations");if(!Ce(r)||r<0)throw new TypeError("Positive integer value expected in function combinations");if(r>e)throw new TypeError("k must be less than or equal to n");for(var t=e-r,n=1,a=r171?1/0:Yt(1,e-1);if(e<.5)return Math.PI/(Math.sin(Math.PI*e)*bo(1-e));if(e>=171.35)return 1/0;if(e>85){var t=e*e,n=t*e,a=n*e,i=a*e;return Math.sqrt(2*Math.PI/e)*Math.pow(e/Math.E,e)*(1+1/(12*e)+1/(288*t)-139/(51840*n)-571/(2488320*a)+163879/(209018880*i)+5246819/(75246796800*i*e))}--e,r=Sa[0];for(var o=1;o=1;n--)t+=op[n]/(e+n);return ip+(e+.5)*Math.log(r)-r+Math.log(t)}wo.signature="number";var Rr="number";function sp(e){return wS(e)}sp.signature=Rr;function up(e){return Math.atan(1/e)}up.signature=Rr;function lp(e){return isFinite(e)?(Math.log((e+1)/e)+Math.log(e/(e-1)))/2:0}lp.signature=Rr;function cp(e){return Math.asin(1/e)}cp.signature=Rr;function fp(e){var r=1/e;return Math.log(r+Math.sqrt(r*r+1))}fp.signature=Rr;function mp(e){return Math.acos(1/e)}mp.signature=Rr;function dp(e){var r=1/e,t=Math.sqrt(r*r-1);return Math.log(t+r)}dp.signature=Rr;function pp(e){return xS(e)}pp.signature=Rr;function vp(e){return NS(e)}vp.signature=Rr;function hp(e){return 1/Math.tan(e)}hp.signature=Rr;function gp(e){var r=Math.exp(2*e);return(r+1)/(r-1)}gp.signature=Rr;function yp(e){return 1/Math.sin(e)}yp.signature=Rr;function bp(e){return e===0?Number.POSITIVE_INFINITY:Math.abs(2/(Math.exp(e)-Math.exp(-e)))*dn(e)}bp.signature=Rr;function wp(e){return 1/Math.cos(e)}wp.signature=Rr;function xp(e){return 2/(Math.exp(e)+Math.exp(-e))}xp.signature=Rr;function Np(e){return ES(e)}Np.signature=Rr;var Iu="number";function Ap(e){return e<0}Ap.signature=Iu;function Ep(e){return e>0}Ep.signature=Iu;function Dp(e){return Number.isNaN(e)}Dp.signature=Iu;function jr(e,r){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1e-9,n=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0;if(t<=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()||r.isNaN()?!1:!e.isFinite()||!r.isFinite()?e.eq(r):e.eq(r)?!0:e.minus(r).abs().lte(e.constructor.max(e.constructor.max(e.abs(),r.abs()).mul(t),n))}var Sp="isNegative",NM=["typed","config"],AM=P(Sp,NM,e=>{var{typed:r,config:t}=e;return r(Sp,{number:n=>Mr(n,0,t.relTol,t.absTol)?!1:Ap(n),BigNumber:n=>jr(n,new n.constructor(0),t.relTol,t.absTol)?!1:n.isNeg()&&!n.isZero()&&!n.isNaN(),bigint:n=>n<0n,Fraction:n=>n.s<0,Unit:r.referToSelf(n=>a=>r.find(n,a.valueType())(a.value)),"Array | Matrix":r.referToSelf(n=>a=>Le(a,n))})}),Cp="isNumeric",EM=["typed"],DM=P(Cp,EM,e=>{var{typed:r}=e;return r(Cp,{"number | BigNumber | bigint | Fraction | boolean":()=>!0,"Complex | Unit | string | null | undefined | Node":()=>!1,"Array | Matrix":r.referToSelf(t=>n=>Le(n,t))})}),Mp="hasNumericValue",SM=["typed","isNumeric"],CM=P(Mp,SM,e=>{var{typed:r,isNumeric:t}=e;return r(Mp,{boolean:()=>!0,string:function(a){return a.trim().length>0&&!isNaN(Number(a))},any:function(a){return t(a)}})}),_p="isPositive",MM=["typed","config"],_M=P(_p,MM,e=>{var{typed:r,config:t}=e;return r(_p,{number:n=>Mr(n,0,t.relTol,t.absTol)?!1:Ep(n),BigNumber:n=>jr(n,new n.constructor(0),t.relTol,t.absTol)?!1:!n.isNeg()&&!n.isZero()&&!n.isNaN(),bigint:n=>n>0n,Fraction:n=>n.s>0&&n.n>0,Unit:r.referToSelf(n=>a=>r.find(n,a.valueType())(a.value)),"Array | Matrix":r.referToSelf(n=>a=>Le(a,n))})}),Tp="isZero",TM=["typed","equalScalar"],FM=P(Tp,TM,e=>{var{typed:r,equalScalar:t}=e;return r(Tp,{"number | BigNumber | Complex | Fraction":n=>t(n,0),bigint:n=>n===0n,Unit:r.referToSelf(n=>a=>r.find(n,a.valueType())(a.value)),"Array | Matrix":r.referToSelf(n=>a=>Le(a,n))})}),Fp="isNaN",BM=["typed"],OM=P(Fp,BM,e=>{var{typed:r}=e;return r(Fp,{number:Dp,BigNumber:function(n){return n.isNaN()},bigint:function(n){return!1},Fraction:function(n){return!1},Complex:function(n){return n.isNaN()},Unit:function(n){return Number.isNaN(n.value)},"Array | Matrix":r.referToSelf(t=>n=>Le(n,t))})}),Bp="typeOf",$M=["typed"],IM=P(Bp,$M,e=>{var{typed:r}=e;return r(Bp,{any:tr})});function RM(e,r,t,n){return Mr(e.re,r.re,t,n)&&Mr(e.im,r.im,t,n)}var Ca=P("compareUnits",["typed"],e=>{var{typed:r}=e;return{"Unit, Unit":r.referToSelf(t=>(n,a)=>{if(!n.equalBase(a))throw new Error("Cannot compare units with different base");return r.find(t,[n.valueType(),a.valueType()])(n.value,a.value)})}}),xo="equalScalar",zM=["typed","config"],PM=P(xo,zM,e=>{var{typed:r,config:t}=e,n=Ca({typed:r});return r(xo,{"boolean, boolean":function(i,o){return i===o},"number, number":function(i,o){return Mr(i,o,t.relTol,t.absTol)},"BigNumber, BigNumber":function(i,o){return i.eq(o)||jr(i,o,t.relTol,t.absTol)},"bigint, bigint":function(i,o){return i===o},"Fraction, Fraction":function(i,o){return i.equals(o)},"Complex, Complex":function(i,o){return RM(i,o,t.relTol,t.absTol)}},n)});P(xo,["typed","config"],e=>{var{typed:r,config:t}=e;return r(xo,{"number, number":function(a,i){return Mr(a,i,t.relTol,t.absTol)}})});var kM="SparseMatrix",qM=["typed","equalScalar","Matrix"],LM=P(kM,qM,e=>{var{typed:r,equalScalar:t,Matrix:n}=e;function a(h,w){if(!(this instanceof a))throw new SyntaxError("Constructor must be called with the new operator");if(w&&!Cr(w))throw new Error("Invalid datatype: "+w);if(_e(h))i(this,h,w);else if(h&&Xe(h.index)&&Xe(h.ptr)&&Xe(h.size))this._values=h.values,this._index=h.index,this._ptr=h.ptr,this._size=h.size,this._datatype=w||h.datatype;else if(Xe(h))o(this,h,w);else{if(h)throw new TypeError("Unsupported type of data ("+tr(h)+")");this._values=[],this._index=[],this._ptr=[0],this._size=[0,0],this._datatype=w}}function i(h,w,b){w.type==="SparseMatrix"?(h._values=w._values?Fe(w._values):void 0,h._index=Fe(w._index),h._ptr=Fe(w._ptr),h._size=Fe(w._size),h._datatype=b||w._datatype):o(h,w.valueOf(),b||w._datatype)}function o(h,w,b){h._values=[],h._index=[],h._ptr=[],h._datatype=b;var A=w.length,g=0,N=t,x=0;if(Cr(b)&&(N=r.find(t,[b,b])||t,x=r.convert(0,b)),A>0){var y=0;do{h._ptr.push(h._index.length);for(var D=0;D");if(g.length===1){var S=w.dimension(0);S.forEach(function(_,F){nr(_),h.set([_,0],b[F[0]],A)})}else{var E=w.dimension(0),C=w.dimension(1);E.forEach(function(_,F){nr(_),C.forEach(function(I,R){nr(I),h.set([_,I],b[F[0]][R[0]],A)})})}}return h}a.prototype.get=function(h){if(!Xe(h))throw new TypeError("Array expected");if(h.length!==this._size.length)throw new qe(h.length,this._size.length);if(!this._values)throw new Error("Cannot invoke get on a Pattern only matrix");var w=h[0],b=h[1];nr(w,this._size[0]),nr(b,this._size[1]);var A=s(w,this._ptr[b],this._ptr[b+1],this._index);return AN-1||g>x-1)&&(m(this,Math.max(A+1,N),Math.max(g+1,x),b),N=this._size[0],x=this._size[1]),nr(A,N),nr(g,x);var S=s(A,this._ptr[g],this._ptr[g+1],this._index);return SArray.isArray(N)&&N.length===1?N[0]:N);if(A.length!==2)throw new Error("Only two dimensions matrix are supported");A.forEach(function(N){if(!Re(N)||!Ce(N)||N<0)throw new TypeError("Invalid size, must contain positive integers (size: "+Ve(A)+")")});var g=b?this.clone():this;return m(g,A[0],A[1],w)};function m(h,w,b,A){var g=A||0,N=t,x=0;Cr(h._datatype)&&(N=r.find(t,[h._datatype,h._datatype])||t,x=r.convert(0,h._datatype),g=r.convert(g,h._datatype));var y=!N(g,x),D=h._size[0],S=h._size[1],E,C,_;if(b>S){for(C=S;CD){if(y){var F=0;for(C=0;Cw-1&&(h._values.splice(_,1),h._index.splice(_,1),R++)}h._ptr[C]=h._values.length}return h._size[0]=w,h._size[1]=b,h}a.prototype.reshape=function(h,w){if(!Xe(h))throw new TypeError("Array expected");if(h.length!==2)throw new Error("Sparse matrices can only be reshaped in two dimensions");h.forEach(function(O){if(!Re(O)||!Ce(O)||O<=-2||O===0)throw new TypeError("Invalid size, must contain positive integers or -1 (size: "+Ve(h)+")")});var b=this._size[0]*this._size[1];h=Su(h,b);var A=h[0]*h[1];if(b!==A)throw new Error("Reshaping sparse matrix will result in the wrong number of elements");var g=w?this.clone():this;if(this._size[0]===h[0]&&this._size[1]===h[1])return g;for(var N=[],x=0;x=w&&M<=b&&_(h._values[$],M-w,F-A)}else{for(var T={},k=I;k "+(this._values?Ve(this._values[D],h):"X")}return g},a.prototype.toString=function(){return Ve(this.toArray())},a.prototype.toJSON=function(){return{mathjs:"SparseMatrix",values:this._values,index:this._index,ptr:this._ptr,size:this._size,datatype:this._datatype}},a.prototype.diagonal=function(h){if(h){if(Ie(h)&&(h=h.toNumber()),!Re(h)||!Ce(h))throw new TypeError("The parameter k must be an integer number")}else h=0;var w=h>0?h:0,b=h<0?-h:0,A=this._size[0],g=this._size[1],N=Math.min(A-b,g-w),x=[],y=[],D=[];D[0]=0;for(var S=w;S0?b:0,D=b<0?-b:0,S=h[0],E=h[1],C=Math.min(S-D,E-y),_;if(Xe(w)){if(w.length!==C)throw new Error("Invalid value array length");_=function(W){return w[W]}}else if(_e(w)){var F=w.size();if(F.length!==1||F[0]!==C)throw new Error("Invalid matrix length");_=function(W){return w.get([W])}}else _=function(){return w};for(var I=[],R=[],$=[],M=0;M=0&&T=D||g[E]!==w)){var _=A?A[S]:void 0;g.splice(E,0,w),A&&A.splice(E,0,_),g.splice(E<=S?S+1:S,1),A&&A.splice(E<=S?S+1:S,1);continue}if(E=D||g[S]!==h)){var F=A?A[E]:void 0;g.splice(S,0,h),A&&A.splice(S,0,F),g.splice(S<=E?E+1:E,1),A&&A.splice(S<=E?E+1:E,1)}}},a},{isClass:!0}),VM="number",UM=["typed"];function HM(e){var r=e.match(/(0[box])([0-9a-fA-F]*)\.([0-9a-fA-F]*)/);if(r){var t={"0b":2,"0o":8,"0x":16}[r[1]],n=r[2],a=r[3];return{input:e,radix:t,integerPart:n,fractionalPart:a}}else return null}function ZM(e){for(var r=parseInt(e.integerPart,e.radix),t=0,n=0;n{var{typed:r}=e,t=r("number",{"":function(){return 0},number:function(a){return a},string:function(a){if(a==="NaN")return NaN;var i=HM(a);if(i)return ZM(i);var o=0,l=a.match(/(0[box][0-9a-fA-F]*)i([0-9]*)/);l&&(o=Number(l[2]),a=l[1]);var u=Number(a);if(isNaN(u))throw new SyntaxError('String "'+a+'" is not a valid number');if(l){if(u>2**o-1)throw new SyntaxError('String "'.concat(a,'" is out of range'));u>=2**(o-1)&&(u=u-2**o)}return u},BigNumber:function(a){return a.toNumber()},bigint:function(a){return Number(a)},Fraction:function(a){return a.valueOf()},Unit:r.referToSelf(n=>a=>{var i=a.clone();return i.value=n(a.value),i}),null:function(a){return 0},"Unit, string | Unit":function(a,i){return a.toNumber(i)},"Array | Matrix":r.referToSelf(n=>a=>Le(a,n))});return t.fromJSON=function(n){return parseFloat(n.value)},t}),WM="bigint",jM=["typed"],KM=P(WM,jM,e=>{var{typed:r}=e,t=r("bigint",{"":function(){return 0n},bigint:function(a){return a},number:function(a){return BigInt(a.toFixed())},BigNumber:function(a){return BigInt(a.round().toString())},Fraction:function(a){return BigInt(a.valueOf().toFixed())},"string | boolean":function(a){return BigInt(a)},null:function(a){return 0n},"Array | Matrix":r.referToSelf(n=>a=>Le(a,n))});return t.fromJSON=function(n){return BigInt(n.value)},t}),Op="string",JM=["typed"],YM=P(Op,JM,e=>{var{typed:r}=e;return r(Op,{"":function(){return""},number:qn,null:function(n){return"null"},boolean:function(n){return n+""},string:function(n){return n},"Array | Matrix":r.referToSelf(t=>n=>Le(n,t)),any:function(n){return String(n)}})}),$p="boolean",XM=["typed"],QM=P($p,XM,e=>{var{typed:r}=e;return r($p,{"":function(){return!1},boolean:function(n){return n},number:function(n){return!!n},null:function(n){return!1},BigNumber:function(n){return!n.isZero()},string:function(n){var a=n.toLowerCase();if(a==="true")return!0;if(a==="false")return!1;var i=Number(n);if(n!==""&&!isNaN(i))return!!i;throw new Error('Cannot convert "'+n+'" to a boolean')},"Array | Matrix":r.referToSelf(t=>n=>Le(n,t))})}),e_="bignumber",r_=["typed","BigNumber"],t_=P(e_,r_,e=>{var{typed:r,BigNumber:t}=e;return r("bignumber",{"":function(){return new t(0)},number:function(a){return new t(a+"")},string:function(a){var i=a.match(/(0[box][0-9a-fA-F]*)i([0-9]*)/);if(i){var o=i[2],l=t(i[1]),u=new t(2).pow(Number(o));if(l.gt(u.sub(1)))throw new SyntaxError('String "'.concat(a,'" is out of range'));var s=new t(2).pow(Number(o)-1);return l.gte(s)?l.sub(u):l}return new t(a)},BigNumber:function(a){return a},bigint:function(a){return new t(a.toString())},Unit:r.referToSelf(n=>a=>{var i=a.clone();return i.value=n(a.value),i}),Fraction:function(a){return new t(a.n).div(a.d).times(a.s)},null:function(a){return new t(0)},"Array | Matrix":r.referToSelf(n=>a=>Le(a,n))})}),n_="complex",a_=["typed","Complex"],i_=P(n_,a_,e=>{var{typed:r,Complex:t}=e;return r("complex",{"":function(){return t.ZERO},number:function(a){return new t(a,0)},"number, number":function(a,i){return new t(a,i)},"BigNumber, BigNumber":function(a,i){return new t(a.toNumber(),i.toNumber())},Fraction:function(a){return new t(a.valueOf(),0)},Complex:function(a){return a.clone()},string:function(a){return t(a)},null:function(a){return t(0)},Object:function(a){if("re"in a&&"im"in a)return new t(a.re,a.im);if("r"in a&&"phi"in a||"abs"in a&&"arg"in a)return new t(a);throw new Error("Expected object with properties (re and im) or (r and phi) or (abs and arg)")},"Array | Matrix":r.referToSelf(n=>a=>Le(a,n))})}),o_="fraction",s_=["typed","Fraction"],u_=P(o_,s_,e=>{var{typed:r,Fraction:t}=e;return r("fraction",{number:function(a){if(!isFinite(a)||isNaN(a))throw new Error(a+" cannot be represented as a fraction");return new t(a)},string:function(a){return new t(a)},"number, number":function(a,i){return new t(a,i)},null:function(a){return new t(0)},BigNumber:function(a){return new t(a.toString())},bigint:function(a){return new t(a.toString())},Fraction:function(a){return a},Unit:r.referToSelf(n=>a=>{var i=a.clone();return i.value=n(a.value),i}),Object:function(a){return new t(a)},"Array | Matrix":r.referToSelf(n=>a=>Le(a,n))})}),Ip="matrix",l_=["typed","Matrix","DenseMatrix","SparseMatrix"],c_=P(Ip,l_,e=>{var{typed:r,Matrix:t,DenseMatrix:n,SparseMatrix:a}=e;return r(Ip,{"":function(){return i([])},string:function(l){return i([],l)},"string, string":function(l,u){return i([],l,u)},Array:function(l){return i(l)},Matrix:function(l){return i(l,l.storage())},"Array | Matrix, string":i,"Array | Matrix, string, string":i});function i(o,l,u){if(l==="dense"||l==="default"||l===void 0)return new n(o,u);if(l==="sparse")return new a(o,u);throw new TypeError("Unknown matrix type "+JSON.stringify(l)+".")}}),Rp="matrixFromFunction",f_=["typed","matrix","isZero"],m_=P(Rp,f_,e=>{var{typed:r,matrix:t,isZero:n}=e;return r(Rp,{"Array | Matrix, function, string, string":function(o,l,u,s){return a(o,l,u,s)},"Array | Matrix, function, string":function(o,l,u){return a(o,l,u)},"Matrix, function":function(o,l){return a(o,l,"dense")},"Array, function":function(o,l){return a(o,l,"dense").toArray()},"Array | Matrix, string, function":function(o,l,u){return a(o,u,l)},"Array | Matrix, string, string, function":function(o,l,u,s){return a(o,s,l,u)}});function a(i,o,l,u){var s;return u!==void 0?s=t(l,u):s=t(l),s.resize(i),s.forEach(function(c,f){var m=o(f);n(m)||s.set(f,m)}),s}}),zp="matrixFromRows",d_=["typed","matrix","flatten","size"],p_=P(zp,d_,e=>{var{typed:r,matrix:t,flatten:n,size:a}=e;return r(zp,{"...Array":function(u){return i(u)},"...Matrix":function(u){return t(i(u.map(s=>s.toArray())))}});function i(l){if(l.length===0)throw new TypeError("At least one row is needed to construct a matrix.");var u=o(l[0]),s=[];for(var c of l){var f=o(c);if(f!==u)throw new TypeError("The vectors had different length: "+(u|0)+" ≠ "+(f|0));s.push(n(c))}return s}function o(l){var u=a(l);if(u.length===1)return u[0];if(u.length===2){if(u[0]===1)return u[1];if(u[1]===1)return u[0];throw new TypeError("At least one of the arguments is not a vector.")}else throw new TypeError("Only one- or two-dimensional vectors are supported.")}}),Pp="matrixFromColumns",v_=["typed","matrix","flatten","size"],h_=P(Pp,v_,e=>{var{typed:r,matrix:t,flatten:n,size:a}=e;return r(Pp,{"...Array":function(u){return i(u)},"...Matrix":function(u){return t(i(u.map(s=>s.toArray())))}});function i(l){if(l.length===0)throw new TypeError("At least one column is needed to construct a matrix.");for(var u=o(l[0]),s=[],c=0;c{var{typed:r}=e;return r(kp,{"Unit, Array":function(n,a){return n.splitUnit(a)}})}),qp="unaryMinus",b_=["typed"],w_=P(qp,b_,e=>{var{typed:r}=e;return r(qp,{number:zd,"Complex | BigNumber | Fraction":t=>t.neg(),bigint:t=>-t,Unit:r.referToSelf(t=>n=>{var a=n.clone();return a.value=r.find(t,a.valueType())(n.value),a}),"Array | Matrix":r.referToSelf(t=>n=>Le(n,t))})}),Lp="unaryPlus",x_=["typed","config","numeric"],N_=P(Lp,x_,e=>{var{typed:r,config:t,numeric:n}=e;return r(Lp,{number:Pd,Complex:function(i){return i},BigNumber:function(i){return i},bigint:function(i){return i},Fraction:function(i){return i},Unit:function(i){return i.clone()},"Array | Matrix":r.referToSelf(a=>i=>Le(i,a)),boolean:function(i){return n(i?1:0,t.number)},string:function(i){return n(i,mn(i,t))}})}),Vp="abs",A_=["typed"],E_=P(Vp,A_,e=>{var{typed:r}=e;return r(Vp,{number:Od,"Complex | BigNumber | Fraction | Unit":t=>t.abs(),bigint:t=>t<0n?-t:t,"Array | Matrix":r.referToSelf(t=>n=>Le(n,t))})}),Up="apply",D_=["typed","isInteger"],Ru=P(Up,D_,e=>{var{typed:r,isInteger:t}=e;return r(Up,{"Array | Matrix, number | BigNumber, function":function(a,i,o){if(!t(i))throw new TypeError("Integer number expected for dimension");var l=Array.isArray(a)?$e(a):a.size();if(i<0||i>=l.length)throw new ft(i,l.length);return _e(a)?a.create(No(a.valueOf(),i,o),a.datatype()):No(a,i,o)}})});function No(e,r,t){var n,a,i;if(r<=0)if(Array.isArray(e[0])){for(i=S_(e),a=[],n=0;n{var{typed:r}=e;return r(Hp,{"number, number":$d,"Complex, Complex":function(n,a){return n.add(a)},"BigNumber, BigNumber":function(n,a){return n.plus(a)},"bigint, bigint":function(n,a){return n+a},"Fraction, Fraction":function(n,a){return n.add(a)},"Unit, Unit":r.referToSelf(t=>(n,a)=>{if(n.value===null||n.value===void 0)throw new Error("Parameter x contains a unit with undefined value");if(a.value===null||a.value===void 0)throw new Error("Parameter y contains a unit with undefined value");if(!n.equalBase(a))throw new Error("Units do not match");var i=n.clone();return i.value=r.find(t,[i.valueType(),a.valueType()])(i.value,a.value),i.fixPrefix=!1,i})})}),Zp="subtractScalar",__=["typed"],T_=P(Zp,__,e=>{var{typed:r}=e;return r(Zp,{"number, number":Id,"Complex, Complex":function(n,a){return n.sub(a)},"BigNumber, BigNumber":function(n,a){return n.minus(a)},"bigint, bigint":function(n,a){return n-a},"Fraction, Fraction":function(n,a){return n.sub(a)},"Unit, Unit":r.referToSelf(t=>(n,a)=>{if(n.value===null||n.value===void 0)throw new Error("Parameter x contains a unit with undefined value");if(a.value===null||a.value===void 0)throw new Error("Parameter y contains a unit with undefined value");if(!n.equalBase(a))throw new Error("Units do not match");var i=n.clone();return i.value=r.find(t,[i.valueType(),a.valueType()])(i.value,a.value),i.fixPrefix=!1,i})})}),Gp="cbrt",F_=["config","typed","isNegative","unaryMinus","matrix","Complex","BigNumber","Fraction"],B_=P(Gp,F_,e=>{var{config:r,typed:t,isNegative:n,unaryMinus:a,matrix:i,Complex:o,BigNumber:l,Fraction:u}=e;return t(Gp,{number:ni,Complex:s,"Complex, boolean":s,BigNumber:function(m){return m.cbrt()},Unit:c});function s(f,m){var p=f.arg()/3,v=f.abs(),h=new o(ni(v),0).mul(new o(0,p).exp());if(m){var w=[h,new o(ni(v),0).mul(new o(0,p+Math.PI*2/3).exp()),new o(ni(v),0).mul(new o(0,p-Math.PI*2/3).exp())];return r.matrix==="Array"?w:i(w)}else return h}function c(f){if(f.value&>(f.value)){var m=f.clone();return m.value=1,m=m.pow(1/3),m.value=s(f.value),m}else{var p=n(f.value);p&&(f.value=a(f.value));var v;Ie(f.value)?v=new l(1).div(3):zn(f.value)?v=new u(1,3):v=1/3;var h=f.pow(v);return p&&(h.value=a(h.value)),h}}}),O_="matAlgo11xS0s",$_=["typed","equalScalar"],Tr=P(O_,$_,e=>{var{typed:r,equalScalar:t}=e;return function(a,i,o,l){var u=a._values,s=a._index,c=a._ptr,f=a._size,m=a._datatype;if(!u)throw new Error("Cannot perform operation on Pattern Sparse Matrix and Scalar value");var p=f[0],v=f[1],h,w=t,b=0,A=o;typeof m=="string"&&(h=m,w=r.find(t,[h,h]),b=r.convert(0,h),i=r.convert(i,h),A=r.find(o,[h,h]));for(var g=[],N=[],x=[],y=0;y{var{typed:r,DenseMatrix:t}=e;return function(a,i,o,l){var u=a._values,s=a._index,c=a._ptr,f=a._size,m=a._datatype;if(!u)throw new Error("Cannot perform operation on Pattern Sparse Matrix and Scalar value");var p=f[0],v=f[1],h,w=o;typeof m=="string"&&(h=m,i=r.convert(i,h),w=r.find(o,[h,h]));for(var b=[],A=[],g=[],N=0;N{var{typed:r}=e;return function(a,i,o,l){var u=a._data,s=a._size,c=a._datatype,f,m=o;typeof c=="string"&&(f=c,i=r.convert(i,f),m=r.find(o,[f,f]));var p=s.length>0?t(m,0,s,s[0],u,i,l):[];return a.createDenseMatrix({data:p,size:Fe(s),datatype:f})};function t(n,a,i,o,l,u,s){var c=[];if(a===i.length-1)for(var f=0;f{var{typed:r,config:t,round:n}=e;return r(zu,{number:function(i){return Mr(i,n(i),t.relTol,t.absTol)?n(i):Math.ceil(i)},"number, number":function(i,o){if(Mr(i,n(i,o),t.relTol,t.absTol))return n(i,o);var[l,u]="".concat(i,"e").split("e"),s=Math.ceil(Number("".concat(l,"e").concat(Number(u)+o)));return[l,u]="".concat(s,"e").split("e"),Number("".concat(l,"e").concat(Number(u)-o))}})}),L_=P(zu,k_,e=>{var{typed:r,config:t,round:n,matrix:a,equalScalar:i,zeros:o,DenseMatrix:l}=e,u=Tr({typed:r,equalScalar:i}),s=xr({typed:r,DenseMatrix:l}),c=wt({typed:r}),f=q_({typed:r,config:t,round:n});return r("ceil",{number:f.signatures.number,"number,number":f.signatures["number,number"],Complex:function(p){return p.ceil()},"Complex, number":function(p,v){return p.ceil(v)},"Complex, BigNumber":function(p,v){return p.ceil(v.toNumber())},BigNumber:function(p){return jr(p,n(p),t.relTol,t.absTol)?n(p):p.ceil()},"BigNumber, BigNumber":function(p,v){return jr(p,n(p,v),t.relTol,t.absTol)?n(p,v):p.toDecimalPlaces(v.toNumber(),yn.ROUND_CEIL)},Fraction:function(p){return p.ceil()},"Fraction, number":function(p,v){return p.ceil(v)},"Fraction, BigNumber":function(p,v){return p.ceil(v.toNumber())},"Array | Matrix":r.referToSelf(m=>p=>Le(p,m)),"Array, number | BigNumber":r.referToSelf(m=>(p,v)=>Le(p,h=>m(h,v))),"SparseMatrix, number | BigNumber":r.referToSelf(m=>(p,v)=>u(p,v,m,!1)),"DenseMatrix, number | BigNumber":r.referToSelf(m=>(p,v)=>c(p,v,m,!1)),"number | Complex | Fraction | BigNumber, Array":r.referToSelf(m=>(p,v)=>c(a(v),p,m,!0).valueOf()),"number | Complex | Fraction | BigNumber, Matrix":r.referToSelf(m=>(p,v)=>i(p,0)?o(v.size(),v.storage()):v.storage()==="dense"?c(v,p,m,!0):s(v,p,m,!0))})}),Wp="cube",V_=["typed"],U_=P(Wp,V_,e=>{var{typed:r}=e;return r(Wp,{number:kd,Complex:function(n){return n.mul(n).mul(n)},BigNumber:function(n){return n.times(n).times(n)},bigint:function(n){return n*n*n},Fraction:function(n){return n.pow(3)},Unit:function(n){return n.pow(3)}})}),jp="exp",H_=["typed"],Z_=P(jp,H_,e=>{var{typed:r}=e;return r(jp,{number:qd,Complex:function(n){return n.exp()},BigNumber:function(n){return n.exp()}})}),Kp="expm1",G_=["typed","Complex"],W_=P(Kp,G_,e=>{var{typed:r,Complex:t}=e;return r(Kp,{number:Ld,Complex:function(a){var i=Math.exp(a.re);return new t(i*Math.cos(a.im)-1,i*Math.sin(a.im))},BigNumber:function(a){return a.exp().minus(1)}})}),Pu="fix",j_=["typed","Complex","matrix","ceil","floor","equalScalar","zeros","DenseMatrix"],K_=P(Pu,["typed","ceil","floor"],e=>{var{typed:r,ceil:t,floor:n}=e;return r(Pu,{number:function(i){return i>0?n(i):t(i)},"number, number":function(i,o){return i>0?n(i,o):t(i,o)}})}),J_=P(Pu,j_,e=>{var{typed:r,Complex:t,matrix:n,ceil:a,floor:i,equalScalar:o,zeros:l,DenseMatrix:u}=e,s=xr({typed:r,DenseMatrix:u}),c=wt({typed:r}),f=K_({typed:r,ceil:a,floor:i});return r("fix",{number:f.signatures.number,"number, number | BigNumber":f.signatures["number,number"],Complex:function(p){return new t(p.re>0?Math.floor(p.re):Math.ceil(p.re),p.im>0?Math.floor(p.im):Math.ceil(p.im))},"Complex, number":function(p,v){return new t(p.re>0?i(p.re,v):a(p.re,v),p.im>0?i(p.im,v):a(p.im,v))},"Complex, BigNumber":function(p,v){var h=v.toNumber();return new t(p.re>0?i(p.re,h):a(p.re,h),p.im>0?i(p.im,h):a(p.im,h))},BigNumber:function(p){return p.isNegative()?a(p):i(p)},"BigNumber, number | BigNumber":function(p,v){return p.isNegative()?a(p,v):i(p,v)},Fraction:function(p){return p.s<0?p.ceil():p.floor()},"Fraction, number | BigNumber":function(p,v){return p.s<0?a(p,v):i(p,v)},"Array | Matrix":r.referToSelf(m=>p=>Le(p,m)),"Array | Matrix, number | BigNumber":r.referToSelf(m=>(p,v)=>Le(p,h=>m(h,v))),"number | Complex | Fraction | BigNumber, Array":r.referToSelf(m=>(p,v)=>c(n(v),p,m,!0).valueOf()),"number | Complex | Fraction | BigNumber, Matrix":r.referToSelf(m=>(p,v)=>o(p,0)?l(v.size(),v.storage()):v.storage()==="dense"?c(v,p,m,!0):s(v,p,m,!0))})}),ku="floor",Y_=["typed","config","round","matrix","equalScalar","zeros","DenseMatrix"],X_=P(ku,["typed","config","round"],e=>{var{typed:r,config:t,round:n}=e;return r(ku,{number:function(i){return Mr(i,n(i),t.relTol,t.absTol)?n(i):Math.floor(i)},"number, number":function(i,o){if(Mr(i,n(i,o),t.relTol,t.absTol))return n(i,o);var[l,u]="".concat(i,"e").split("e"),s=Math.floor(Number("".concat(l,"e").concat(Number(u)+o)));return[l,u]="".concat(s,"e").split("e"),Number("".concat(l,"e").concat(Number(u)-o))}})}),Jp=P(ku,Y_,e=>{var{typed:r,config:t,round:n,matrix:a,equalScalar:i,zeros:o,DenseMatrix:l}=e,u=Tr({typed:r,equalScalar:i}),s=xr({typed:r,DenseMatrix:l}),c=wt({typed:r}),f=X_({typed:r,config:t,round:n});return r("floor",{number:f.signatures.number,"number,number":f.signatures["number,number"],Complex:function(p){return p.floor()},"Complex, number":function(p,v){return p.floor(v)},"Complex, BigNumber":function(p,v){return p.floor(v.toNumber())},BigNumber:function(p){return jr(p,n(p),t.relTol,t.absTol)?n(p):p.floor()},"BigNumber, BigNumber":function(p,v){return jr(p,n(p,v),t.relTol,t.absTol)?n(p,v):p.toDecimalPlaces(v.toNumber(),yn.ROUND_FLOOR)},Fraction:function(p){return p.floor()},"Fraction, number":function(p,v){return p.floor(v)},"Fraction, BigNumber":function(p,v){return p.floor(v.toNumber())},"Array | Matrix":r.referToSelf(m=>p=>Le(p,m)),"Array, number | BigNumber":r.referToSelf(m=>(p,v)=>Le(p,h=>m(h,v))),"SparseMatrix, number | BigNumber":r.referToSelf(m=>(p,v)=>u(p,v,m,!1)),"DenseMatrix, number | BigNumber":r.referToSelf(m=>(p,v)=>c(p,v,m,!1)),"number | Complex | Fraction | BigNumber, Array":r.referToSelf(m=>(p,v)=>c(a(v),p,m,!0).valueOf()),"number | Complex | Fraction | BigNumber, Matrix":r.referToSelf(m=>(p,v)=>i(p,0)?o(v.size(),v.storage()):v.storage()==="dense"?c(v,p,m,!0):s(v,p,m,!0))})}),Q_="matAlgo02xDS0",e3=["typed","equalScalar"],xt=P(Q_,e3,e=>{var{typed:r,equalScalar:t}=e;return function(a,i,o,l){var u=a._data,s=a._size,c=a._datatype||a.getDataType(),f=i._values,m=i._index,p=i._ptr,v=i._size,h=i._datatype||i._data===void 0?i._datatype:i.getDataType();if(s.length!==v.length)throw new qe(s.length,v.length);if(s[0]!==v[0]||s[1]!==v[1])throw new RangeError("Dimension mismatch. Matrix A ("+s+") must match Matrix B ("+v+")");if(!f)throw new Error("Cannot perform operation on Dense Matrix and Pattern Sparse Matrix");var w=s[0],b=s[1],A,g=t,N=0,x=o;typeof c=="string"&&c===h&&c!=="mixed"&&(A=c,g=r.find(t,[A,A]),N=r.convert(0,A),x=r.find(o,[A,A]));for(var y=[],D=[],S=[],E=0;E{var{typed:r}=e;return function(n,a,i,o){var l=n._data,u=n._size,s=n._datatype||n.getDataType(),c=a._values,f=a._index,m=a._ptr,p=a._size,v=a._datatype||a._data===void 0?a._datatype:a.getDataType();if(u.length!==p.length)throw new qe(u.length,p.length);if(u[0]!==p[0]||u[1]!==p[1])throw new RangeError("Dimension mismatch. Matrix A ("+u+") must match Matrix B ("+p+")");if(!c)throw new Error("Cannot perform operation on Dense Matrix and Pattern Sparse Matrix");var h=u[0],w=u[1],b,A=0,g=i;typeof s=="string"&&s===v&&s!=="mixed"&&(b=s,A=r.convert(0,b),g=r.find(i,[b,b]));for(var N=[],x=0;x{var{typed:r,equalScalar:t}=e;return function(a,i,o){var l=a._values,u=a._index,s=a._ptr,c=a._size,f=a._datatype||a._data===void 0?a._datatype:a.getDataType(),m=i._values,p=i._index,v=i._ptr,h=i._size,w=i._datatype||i._data===void 0?i._datatype:i.getDataType();if(c.length!==h.length)throw new qe(c.length,h.length);if(c[0]!==h[0]||c[1]!==h[1])throw new RangeError("Dimension mismatch. Matrix A ("+c+") must match Matrix B ("+h+")");var b=c[0],A=c[1],g,N=t,x=0,y=o;typeof f=="string"&&f===w&&f!=="mixed"&&(g=f,N=r.find(t,[g,g]),x=r.convert(0,g),y=r.find(o,[g,g]));var D=l&&m?[]:void 0,S=[],E=[],C=D?[]:void 0,_=D?[]:void 0,F=[],I=[],R,$,M,T;for($=0;${var{typed:r}=e;return function(a,i,o){var l=a._data,u=a._size,s=a._datatype,c=i._data,f=i._size,m=i._datatype,p=[];if(u.length!==f.length)throw new qe(u.length,f.length);for(var v=0;v0?t(w,0,p,p[0],l,c):[];return a.createDenseMatrix({data:b,size:p,datatype:h})};function t(n,a,i,o,l,u){var s=[];if(a===i.length-1)for(var c=0;cu3(n,t))}function u3(e,r){return Wt(e.size(),r)?e:e.create(Vn(e.valueOf(),r),e.datatype())}var l3="matrixAlgorithmSuite",c3=["typed","matrix"],ar=P(l3,c3,e=>{var{typed:r,matrix:t}=e,n=s3({typed:r}),a=wt({typed:r});return function(o){var l=o.elop,u=o.SD||o.DS,s;l?(s={"DenseMatrix, DenseMatrix":(p,v)=>n(...Ar(p,v),l),"Array, Array":(p,v)=>n(...Ar(t(p),t(v)),l).valueOf(),"Array, DenseMatrix":(p,v)=>n(...Ar(t(p),v),l),"DenseMatrix, Array":(p,v)=>n(...Ar(p,t(v)),l)},o.SS&&(s["SparseMatrix, SparseMatrix"]=(p,v)=>o.SS(...Ar(p,v),l,!1)),o.DS&&(s["DenseMatrix, SparseMatrix"]=(p,v)=>o.DS(...Ar(p,v),l,!1),s["Array, SparseMatrix"]=(p,v)=>o.DS(...Ar(t(p),v),l,!1)),u&&(s["SparseMatrix, DenseMatrix"]=(p,v)=>u(...Ar(v,p),l,!0),s["SparseMatrix, Array"]=(p,v)=>u(...Ar(t(v),p),l,!0))):(s={"DenseMatrix, DenseMatrix":r.referToSelf(p=>(v,h)=>n(...Ar(v,h),p)),"Array, Array":r.referToSelf(p=>(v,h)=>n(...Ar(t(v),t(h)),p).valueOf()),"Array, DenseMatrix":r.referToSelf(p=>(v,h)=>n(...Ar(t(v),h),p)),"DenseMatrix, Array":r.referToSelf(p=>(v,h)=>n(...Ar(v,t(h)),p))},o.SS&&(s["SparseMatrix, SparseMatrix"]=r.referToSelf(p=>(v,h)=>o.SS(...Ar(v,h),p,!1))),o.DS&&(s["DenseMatrix, SparseMatrix"]=r.referToSelf(p=>(v,h)=>o.DS(...Ar(v,h),p,!1)),s["Array, SparseMatrix"]=r.referToSelf(p=>(v,h)=>o.DS(...Ar(t(v),h),p,!1))),u&&(s["SparseMatrix, DenseMatrix"]=r.referToSelf(p=>(v,h)=>u(...Ar(h,v),p,!0)),s["SparseMatrix, Array"]=r.referToSelf(p=>(v,h)=>u(...Ar(t(h),v),p,!0))));var c=o.scalar||"any",f=o.Ds||o.Ss;f&&(l?(s["DenseMatrix,"+c]=(p,v)=>a(p,v,l,!1),s[c+", DenseMatrix"]=(p,v)=>a(v,p,l,!0),s["Array,"+c]=(p,v)=>a(t(p),v,l,!1).valueOf(),s[c+", Array"]=(p,v)=>a(t(v),p,l,!0).valueOf()):(s["DenseMatrix,"+c]=r.referToSelf(p=>(v,h)=>a(v,h,p,!1)),s[c+", DenseMatrix"]=r.referToSelf(p=>(v,h)=>a(h,v,p,!0)),s["Array,"+c]=r.referToSelf(p=>(v,h)=>a(t(v),h,p,!1).valueOf()),s[c+", Array"]=r.referToSelf(p=>(v,h)=>a(t(h),v,p,!0).valueOf())));var m=o.sS!==void 0?o.sS:o.Ss;return l?(o.Ss&&(s["SparseMatrix,"+c]=(p,v)=>o.Ss(p,v,l,!1)),m&&(s[c+", SparseMatrix"]=(p,v)=>m(v,p,l,!0))):(o.Ss&&(s["SparseMatrix,"+c]=r.referToSelf(p=>(v,h)=>o.Ss(v,h,p,!1))),m&&(s[c+", SparseMatrix"]=r.referToSelf(p=>(v,h)=>m(h,v,p,!0)))),l&&l.signatures&&Im(s,l.signatures),s}}),Yp="mod",f3=["typed","config","round","matrix","equalScalar","zeros","DenseMatrix","concat"],Xp=P(Yp,f3,e=>{var{typed:r,config:t,round:n,matrix:a,equalScalar:i,zeros:o,DenseMatrix:l,concat:u}=e,s=Jp({typed:r,config:t,round:n,matrix:a,equalScalar:i,zeros:o,DenseMatrix:l}),c=xt({typed:r,equalScalar:i}),f=kr({typed:r}),m=Ao({typed:r,equalScalar:i}),p=Tr({typed:r,equalScalar:i}),v=xr({typed:r,DenseMatrix:l}),h=ar({typed:r,matrix:a,concat:u});return r(Yp,{"number, number":w,"BigNumber, BigNumber":function(A,g){return g.isZero()?A:A.sub(g.mul(s(A.div(g))))},"bigint, bigint":function(A,g){if(g===0n)return A;if(A<0){var N=A%g;return N===0n?N:N+g}return A%g},"Fraction, Fraction":function(A,g){return g.equals(0)?A:A.sub(g.mul(s(A.div(g))))}},h({SS:m,DS:f,SD:c,Ss:p,sS:v}));function w(b,A){return A===0?b:b-A*s(b/A)}}),m3="matAlgo01xDSid",d3=["typed"],wn=P(m3,d3,e=>{var{typed:r}=e;return function(n,a,i,o){var l=n._data,u=n._size,s=n._datatype||n.getDataType(),c=a._values,f=a._index,m=a._ptr,p=a._size,v=a._datatype||a._data===void 0?a._datatype:a.getDataType();if(u.length!==p.length)throw new qe(u.length,p.length);if(u[0]!==p[0]||u[1]!==p[1])throw new RangeError("Dimension mismatch. Matrix A ("+u+") must match Matrix B ("+p+")");if(!c)throw new Error("Cannot perform operation on Dense Matrix and Pattern Sparse Matrix");var h=u[0],w=u[1],b=typeof s=="string"&&s!=="mixed"&&s===v?s:void 0,A=b?r.find(i,[b,b]):i,g,N,x=[];for(g=0;g{var{typed:r,equalScalar:t}=e;return function(a,i,o){var l=a._values,u=a._index,s=a._ptr,c=a._size,f=a._datatype||a._data===void 0?a._datatype:a.getDataType(),m=i._values,p=i._index,v=i._ptr,h=i._size,w=i._datatype||i._data===void 0?i._datatype:i.getDataType();if(c.length!==h.length)throw new qe(c.length,h.length);if(c[0]!==h[0]||c[1]!==h[1])throw new RangeError("Dimension mismatch. Matrix A ("+c+") must match Matrix B ("+h+")");var b=c[0],A=c[1],g,N=t,x=0,y=o;typeof f=="string"&&f===w&&f!=="mixed"&&(g=f,N=r.find(t,[g,g]),x=r.convert(0,g),y=r.find(o,[g,g]));var D=l&&m?[]:void 0,S=[],E=[],C=l&&m?[]:void 0,_=l&&m?[]:void 0,F=[],I=[],R,$,M,T,k;for($=0;${var{typed:r,DenseMatrix:t}=e;return function(a,i,o,l){var u=a._values,s=a._index,c=a._ptr,f=a._size,m=a._datatype;if(!u)throw new Error("Cannot perform operation on Pattern Sparse Matrix and Scalar value");var p=f[0],v=f[1],h,w=o;typeof m=="string"&&(h=m,i=r.convert(i,h),w=r.find(o,[h,h]));for(var b=[],A=[],g=[],N=0;NArray.isArray(r))}var w3=P(Qp,y3,e=>{var{typed:r,matrix:t,config:n,round:a,equalScalar:i,zeros:o,BigNumber:l,DenseMatrix:u,concat:s}=e,c=Xp({typed:r,config:n,round:a,matrix:t,equalScalar:i,zeros:o,DenseMatrix:u,concat:s}),f=wn({typed:r}),m=qu({typed:r,equalScalar:i}),p=Hn({typed:r,DenseMatrix:u}),v=ar({typed:r,matrix:t,concat:s});return r(Qp,{"number, number":h,"BigNumber, BigNumber":w,"Fraction, Fraction":(b,A)=>b.gcd(A)},v({SS:m,DS:f,Ss:p}),{[b3]:r.referToSelf(b=>(A,g,N)=>{for(var x=b(A,g),y=0;yA=>{if(A.length===1&&Array.isArray(A[0])&&ev(A[0]))return b(...A[0]);if(ev(A))return b(...A);throw new Xt("gcd() supports only 1d matrices!")}),Matrix:r.referToSelf(b=>A=>b(A.toArray()))});function h(b,A){if(!Ce(b)||!Ce(A))throw new Error("Parameters in function gcd must be integer numbers");for(var g;A!==0;)g=c(b,A),b=A,A=g;return b<0?-b:b}function w(b,A){if(!b.isInt()||!A.isInt())throw new Error("Parameters in function gcd must be integer numbers");for(var g=new l(0);!A.isZero();){var N=c(b,A);b=A,A=N}return b.lt(g)?b.neg():b}}),x3="matAlgo06xS0S0",N3=["typed","equalScalar"],Eo=P(x3,N3,e=>{var{typed:r,equalScalar:t}=e;return function(a,i,o){var l=a._values,u=a._size,s=a._datatype||a._data===void 0?a._datatype:a.getDataType(),c=i._values,f=i._size,m=i._datatype||i._data===void 0?i._datatype:i.getDataType();if(u.length!==f.length)throw new qe(u.length,f.length);if(u[0]!==f[0]||u[1]!==f[1])throw new RangeError("Dimension mismatch. Matrix A ("+u+") must match Matrix B ("+f+")");var p=u[0],v=u[1],h,w=t,b=0,A=o;typeof s=="string"&&s===m&&s!=="mixed"&&(h=s,w=r.find(t,[h,h]),b=r.convert(0,h),A=r.find(o,[h,h]));for(var g=l&&c?[]:void 0,N=[],x=[],y=g?[]:void 0,D=[],S=[],E=0;E{var{typed:r,matrix:t,equalScalar:n,concat:a}=e,i=xt({typed:r,equalScalar:n}),o=Eo({typed:r,equalScalar:n}),l=Tr({typed:r,equalScalar:n}),u=ar({typed:r,matrix:t,concat:a}),s="number | BigNumber | Fraction | Matrix | Array",c={};return c["".concat(s,", ").concat(s,", ...").concat(s)]=r.referToSelf(m=>(p,v,h)=>{for(var w=m(p,v),b=0;bm.lcm(p)},u({SS:o,DS:i,Ss:l}),c);function f(m,p){if(!m.isInt()||!p.isInt())throw new Error("Parameters in function lcm must be integer numbers");if(m.isZero())return m;if(p.isZero())return p;for(var v=m.times(p);!p.isZero();){var h=p;p=m.mod(h),m=h}return v.div(m).abs()}}),tv="log10",D3=["typed","config","Complex"],S3=P(tv,D3,e=>{var{typed:r,config:t,Complex:n}=e;return r(tv,{number:function(i){return i>=0||t.predictable?Ud(i):new n(i,0).log().div(Math.LN10)},Complex:function(i){return new n(i).log().div(Math.LN10)},BigNumber:function(i){return!i.isNegative()||t.predictable?i.log():new n(i.toNumber(),0).log().div(Math.LN10)},"Array | Matrix":r.referToSelf(a=>i=>Le(i,a))})}),nv="log2",C3=["typed","config","Complex"],M3=P(nv,C3,e=>{var{typed:r,config:t,Complex:n}=e;return r(nv,{number:function(o){return o>=0||t.predictable?Hd(o):a(new n(o,0))},Complex:a,BigNumber:function(o){return!o.isNegative()||t.predictable?o.log(2):a(new n(o.toNumber(),0))},"Array | Matrix":r.referToSelf(i=>o=>Le(o,i))});function a(i){var o=Math.sqrt(i.re*i.re+i.im*i.im);return new n(Math.log2?Math.log2(o):Math.log(o)/Math.LN2,Math.atan2(i.im,i.re)/Math.LN2)}}),_3="multiplyScalar",T3=["typed"],F3=P(_3,T3,e=>{var{typed:r}=e;return r("multiplyScalar",{"number, number":Rd,"Complex, Complex":function(n,a){return n.mul(a)},"BigNumber, BigNumber":function(n,a){return n.times(a)},"bigint, bigint":function(n,a){return n*a},"Fraction, Fraction":function(n,a){return n.mul(a)},"number | Fraction | BigNumber | Complex, Unit":(t,n)=>n.multiply(t),"Unit, number | Fraction | BigNumber | Complex | Unit":(t,n)=>t.multiply(n)})}),av="multiply",B3=["typed","matrix","addScalar","multiplyScalar","equalScalar","dot"],O3=P(av,B3,e=>{var{typed:r,matrix:t,addScalar:n,multiplyScalar:a,equalScalar:i,dot:o}=e,l=Tr({typed:r,equalScalar:i}),u=wt({typed:r});function s(x,y){switch(x.length){case 1:switch(y.length){case 1:if(x[0]!==y[0])throw new RangeError("Dimension mismatch in multiplication. Vectors must have the same length");break;case 2:if(x[0]!==y[0])throw new RangeError("Dimension mismatch in multiplication. Vector length ("+x[0]+") must match Matrix rows ("+y[0]+")");break;default:throw new Error("Can only multiply a 1 or 2 dimensional matrix (Matrix B has "+y.length+" dimensions)")}break;case 2:switch(y.length){case 1:if(x[1]!==y[0])throw new RangeError("Dimension mismatch in multiplication. Matrix columns ("+x[1]+") must match Vector length ("+y[0]+")");break;case 2:if(x[1]!==y[0])throw new RangeError("Dimension mismatch in multiplication. Matrix A columns ("+x[1]+") must match Matrix B rows ("+y[0]+")");break;default:throw new Error("Can only multiply a 1 or 2 dimensional matrix (Matrix B has "+y.length+" dimensions)")}break;default:throw new Error("Can only multiply a 1 or 2 dimensional matrix (Matrix A has "+x.length+" dimensions)")}}function c(x,y,D){if(D===0)throw new Error("Cannot multiply two empty vectors");return o(x,y)}function f(x,y){if(y.storage()!=="dense")throw new Error("Support for SparseMatrix not implemented");return m(x,y)}function m(x,y){var D=x._data,S=x._size,E=x._datatype||x.getDataType(),C=y._data,_=y._size,F=y._datatype||y.getDataType(),I=S[0],R=_[1],$,M=n,T=a;E&&F&&E===F&&typeof E=="string"&&E!=="mixed"&&($=E,M=r.find(n,[$,$]),T=r.find(a,[$,$]));for(var k=[],O=0;Oq)for(var j=0,Y=0;Y<$;Y++){for(var ee=Y+1,te=void 0,oe=q;oe(y,D)=>{s($e(y),$e(D));var S=x(t(y),t(D));return _e(S)?S.valueOf():S}),"Matrix, Matrix":function(y,D){var S=y.size(),E=D.size();return s(S,E),S.length===1?E.length===1?c(y,D,S[0]):f(y,D):E.length===1?p(y,D):v(y,D)},"Matrix, Array":r.referTo("Matrix,Matrix",x=>(y,D)=>x(y,t(D))),"Array, Matrix":r.referToSelf(x=>(y,D)=>x(t(y,D.storage()),D)),"SparseMatrix, any":function(y,D){return l(y,D,a,!1)},"DenseMatrix, any":function(y,D){return u(y,D,a,!1)},"any, SparseMatrix":function(y,D){return l(D,y,a,!0)},"any, DenseMatrix":function(y,D){return u(D,y,a,!0)},"Array, any":function(y,D){return u(t(y),D,a,!1).valueOf()},"any, Array":function(y,D){return u(t(D),y,a,!0).valueOf()},"any, any":a,"any, any, ...any":r.referToSelf(x=>(y,D,S)=>{for(var E=x(y,D),C=0;C{var{typed:r,matrix:t,equalScalar:n,BigNumber:a,concat:i}=e,o=wn({typed:r}),l=xt({typed:r,equalScalar:n}),u=Eo({typed:r,equalScalar:n}),s=Tr({typed:r,equalScalar:n}),c=ar({typed:r,matrix:t,concat:i});function f(){throw new Error("Complex number not supported in function nthRoot. Use nthRoots instead.")}return r(iv,{number:Zd,"number, number":Zd,BigNumber:p=>m(p,new a(2)),"BigNumber, BigNumber":m,Complex:f,"Complex, number":f,Array:r.referTo("DenseMatrix,number",p=>v=>p(t(v),2).valueOf()),DenseMatrix:r.referTo("DenseMatrix,number",p=>v=>p(v,2)),SparseMatrix:r.referTo("SparseMatrix,number",p=>v=>p(v,2)),"SparseMatrix, SparseMatrix":r.referToSelf(p=>(v,h)=>{if(h.density()===1)return u(v,h,p);throw new Error("Root must be non-zero")}),"DenseMatrix, SparseMatrix":r.referToSelf(p=>(v,h)=>{if(h.density()===1)return o(v,h,p,!1);throw new Error("Root must be non-zero")}),"Array, SparseMatrix":r.referTo("DenseMatrix,SparseMatrix",p=>(v,h)=>p(t(v),h)),"number | BigNumber, SparseMatrix":r.referToSelf(p=>(v,h)=>{if(h.density()===1)return s(h,v,p,!0);throw new Error("Root must be non-zero")})},c({scalar:"number | BigNumber",SD:l,Ss:s,sS:!1}));function m(p,v){var h=a.precision,w=a.clone({precision:h+2}),b=new a(0),A=new w(1),g=v.isNegative();if(g&&(v=v.neg()),v.isZero())throw new Error("Root must be non-zero");if(p.isNegative()&&!v.abs().mod(2).equals(1))throw new Error("Root must be odd when a is negative.");if(p.isZero())return g?new w(1/0):0;if(!p.isFinite())return g?b:p;var N=p.abs().pow(A.div(v));return N=p.isNeg()?N.neg():N,new a((g?A.div(N):N).toPrecision(h))}}),ov="sign",R3=["typed","BigNumber","Fraction","complex"],z3=P(ov,R3,e=>{var{typed:r,BigNumber:t,complex:n,Fraction:a}=e;return r(ov,{number:Tu,Complex:function(o){return o.im===0?n(Tu(o.re)):o.sign()},BigNumber:function(o){return new t(o.cmp(0))},bigint:function(o){return o>0n?1n:o<0n?-1n:0n},Fraction:function(o){return new a(o.s,1)},"Array | Matrix":r.referToSelf(i=>o=>Le(o,i)),Unit:r.referToSelf(i=>o=>{if(!o._isDerived()&&o.units[0].unit.offset!==0)throw new TypeError("sign is ambiguous for units with offset");return r.find(i,o.valueType())(o.value)})})}),P3="sqrt",k3=["config","typed","Complex"],q3=P(P3,k3,e=>{var{config:r,typed:t,Complex:n}=e;return t("sqrt",{number:a,Complex:function(o){return o.sqrt()},BigNumber:function(o){return!o.isNegative()||r.predictable?o.sqrt():a(o.toNumber())},Unit:function(o){return o.pow(.5)}});function a(i){return isNaN(i)?NaN:i>=0||r.predictable?Math.sqrt(i):new n(i,0).sqrt()}}),sv="square",L3=["typed"],V3=P(sv,L3,e=>{var{typed:r}=e;return r(sv,{number:Gd,Complex:function(n){return n.mul(n)},BigNumber:function(n){return n.times(n)},bigint:function(n){return n*n},Fraction:function(n){return n.mul(n)},Unit:function(n){return n.pow(2)}})}),uv="subtract",U3=["typed","matrix","equalScalar","subtractScalar","unaryMinus","DenseMatrix","concat"],H3=P(uv,U3,e=>{var{typed:r,matrix:t,equalScalar:n,subtractScalar:a,unaryMinus:i,DenseMatrix:o,concat:l}=e,u=wn({typed:r}),s=kr({typed:r}),c=Ao({typed:r,equalScalar:n}),f=Hn({typed:r,DenseMatrix:o}),m=xr({typed:r,DenseMatrix:o}),p=ar({typed:r,matrix:t,concat:l});return r(uv,{"any, any":a},p({elop:a,SS:c,DS:u,SD:s,Ss:m,sS:f}))}),lv="xgcd",Z3=["typed","config","matrix","BigNumber"],G3=P(lv,Z3,e=>{var{typed:r,config:t,matrix:n,BigNumber:a}=e;return r(lv,{"number, number":function(l,u){var s=Wd(l,u);return t.matrix==="Array"?s:n(s)},"BigNumber, BigNumber":i});function i(o,l){var u,s,c,f=new a(0),m=new a(1),p=f,v=m,h=m,w=f;if(!o.isInt()||!l.isInt())throw new Error("Parameters in function xgcd must be integer numbers");for(;!l.isZero();)s=o.div(l).floor(),c=o.mod(l),u=p,p=v.minus(s.times(p)),v=u,u=h,h=w.minus(s.times(h)),w=u,o=l,l=c;var b;return o.lt(f)?b=[o.neg(),v.neg(),w.neg()]:b=[o,o.isZero()?0:v,w],t.matrix==="Array"?b:n(b)}}),cv="invmod",W3=["typed","config","BigNumber","xgcd","equal","smaller","mod","add","isInteger"],j3=P(cv,W3,e=>{var{typed:r,config:t,BigNumber:n,xgcd:a,equal:i,smaller:o,mod:l,add:u,isInteger:s}=e;return r(cv,{"number, number":c,"BigNumber, BigNumber":c});function c(f,m){if(!s(f)||!s(m))throw new Error("Parameters in function invmod must be integer numbers");if(f=l(f,m),i(m,0))throw new Error("Divisor must be non zero");var p=a(f,m);p=p.valueOf();var[v,h]=p;return i(v,n(1))?(h=l(h,m),o(h,n(0))&&(h=u(h,m)),h):NaN}}),K3="matAlgo09xS0Sf",J3=["typed","equalScalar"],fv=P(K3,J3,e=>{var{typed:r,equalScalar:t}=e;return function(a,i,o){var l=a._values,u=a._index,s=a._ptr,c=a._size,f=a._datatype||a._data===void 0?a._datatype:a.getDataType(),m=i._values,p=i._index,v=i._ptr,h=i._size,w=i._datatype||i._data===void 0?i._datatype:i.getDataType();if(c.length!==h.length)throw new qe(c.length,h.length);if(c[0]!==h[0]||c[1]!==h[1])throw new RangeError("Dimension mismatch. Matrix A ("+c+") must match Matrix B ("+h+")");var b=c[0],A=c[1],g,N=t,x=0,y=o;typeof f=="string"&&f===w&&f!=="mixed"&&(g=f,N=r.find(t,[g,g]),x=r.convert(0,g),y=r.find(o,[g,g]));var D=l&&m?[]:void 0,S=[],E=[],C=D?[]:void 0,_=[],F,I,R,$,M;for(I=0;I{var{typed:r,matrix:t,equalScalar:n,multiplyScalar:a,concat:i}=e,o=xt({typed:r,equalScalar:n}),l=fv({typed:r,equalScalar:n}),u=Tr({typed:r,equalScalar:n}),s=ar({typed:r,matrix:t,concat:i});return r(mv,s({elop:a,SS:l,DS:o,Ss:u}))});function Q3(e,r){if(e.isFinite()&&!e.isInteger()||r.isFinite()&&!r.isInteger())throw new Error("Integers expected in function bitAnd");var t=e.constructor;if(e.isNaN()||r.isNaN())return new t(NaN);if(e.isZero()||r.eq(-1)||e.eq(r))return e;if(r.isZero()||e.eq(-1))return r;if(!e.isFinite()||!r.isFinite()){if(!e.isFinite()&&!r.isFinite())return e.isNegative()===r.isNegative()?e:new t(0);if(!e.isFinite())return r.isNegative()?e:e.isNegative()?new t(0):r;if(!r.isFinite())return e.isNegative()?r:r.isNegative()?new t(0):e}return Vu(e,r,function(n,a){return n&a})}function ii(e){if(e.isFinite()&&!e.isInteger())throw new Error("Integer expected in function bitNot");var r=e.constructor,t=r.precision;r.config({precision:1e9});var n=e.plus(new r(1));return n.s=-n.s||null,r.config({precision:t}),n}function eT(e,r){if(e.isFinite()&&!e.isInteger()||r.isFinite()&&!r.isInteger())throw new Error("Integers expected in function bitOr");var t=e.constructor;if(e.isNaN()||r.isNaN())return new t(NaN);var n=new t(-1);return e.isZero()||r.eq(n)||e.eq(r)?r:r.isZero()||e.eq(n)?e:!e.isFinite()||!r.isFinite()?!e.isFinite()&&!e.isNegative()&&r.isNegative()||e.isNegative()&&!r.isNegative()&&!r.isFinite()?n:e.isNegative()&&r.isNegative()?e.isFinite()?e:r:e.isFinite()?r:e:Vu(e,r,function(a,i){return a|i})}function Vu(e,r,t){var n=e.constructor,a,i,o=+(e.s<0),l=+(r.s<0);if(o){a=Do(ii(e));for(var u=0;u0;)t(c[--p],f[--v])===h&&(w=w.plus(b)),b=b.times(A);for(;v>0;)t(m,f[--v])===h&&(w=w.plus(b)),b=b.times(A);return n.config({precision:g}),h===0&&(w.s=-w.s),w}function Do(e){for(var r=e.d,t=r[0]+"",n=1;n0)if(++l>s)for(l-=s;l--;)u+="0";else l1&&((c[p+1]===null||c[p+1]===void 0)&&(c[p+1]=0),c[p+1]+=c[p]>>1,c[p]&=1)}return c.reverse()}function rT(e,r){if(e.isFinite()&&!e.isInteger()||r.isFinite()&&!r.isInteger())throw new Error("Integers expected in function bitXor");var t=e.constructor;if(e.isNaN()||r.isNaN())return new t(NaN);if(e.isZero())return r;if(r.isZero())return e;if(e.eq(r))return new t(0);var n=new t(-1);return e.eq(n)?ii(r):r.eq(n)?ii(e):!e.isFinite()||!r.isFinite()?!e.isFinite()&&!r.isFinite()?n:new t(e.isNegative()===r.isNegative()?1/0:-1/0):Vu(e,r,function(a,i){return a^i})}function tT(e,r){if(e.isFinite()&&!e.isInteger()||r.isFinite()&&!r.isInteger())throw new Error("Integers expected in function leftShift");var t=e.constructor;return e.isNaN()||r.isNaN()||r.isNegative()&&!r.isZero()?new t(NaN):e.isZero()||r.isZero()?e:!e.isFinite()&&!r.isFinite()?new t(NaN):r.lt(55)?e.times(Math.pow(2,r.toNumber())+""):e.times(new t(2).pow(r))}function nT(e,r){if(e.isFinite()&&!e.isInteger()||r.isFinite()&&!r.isInteger())throw new Error("Integers expected in function rightArithShift");var t=e.constructor;return e.isNaN()||r.isNaN()||r.isNegative()&&!r.isZero()?new t(NaN):e.isZero()||r.isZero()?e:r.isFinite()?r.lt(55)?e.div(Math.pow(2,r.toNumber())+"").floor():e.div(new t(2).pow(r)).floor():e.isNegative()?new t(-1):e.isFinite()?new t(0):new t(NaN)}var dv="bitAnd",aT=["typed","matrix","equalScalar","concat"],pv=P(dv,aT,e=>{var{typed:r,matrix:t,equalScalar:n,concat:a}=e,i=xt({typed:r,equalScalar:n}),o=Eo({typed:r,equalScalar:n}),l=Tr({typed:r,equalScalar:n}),u=ar({typed:r,matrix:t,concat:a});return r(dv,{"number, number":Kd,"BigNumber, BigNumber":Q3,"bigint, bigint":(s,c)=>s&c},u({SS:o,DS:i,Ss:l}))}),vv="bitNot",iT=["typed"],oT=P(vv,iT,e=>{var{typed:r}=e;return r(vv,{number:Jd,BigNumber:ii,bigint:t=>~t,"Array | Matrix":r.referToSelf(t=>n=>Le(n,t))})}),hv="bitOr",sT=["typed","matrix","equalScalar","DenseMatrix","concat"],gv=P(hv,sT,e=>{var{typed:r,matrix:t,equalScalar:n,DenseMatrix:a,concat:i}=e,o=wn({typed:r}),l=qu({typed:r,equalScalar:n}),u=Hn({typed:r,DenseMatrix:a}),s=ar({typed:r,matrix:t,concat:i});return r(hv,{"number, number":Yd,"BigNumber, BigNumber":eT,"bigint, bigint":(c,f)=>c|f},s({SS:l,DS:o,Ss:u}))}),uT="matAlgo07xSSf",lT=["typed","DenseMatrix"],Bt=P(uT,lT,e=>{var{typed:r,DenseMatrix:t}=e;return function(i,o,l){var u=i._size,s=i._datatype||i._data===void 0?i._datatype:i.getDataType(),c=o._size,f=o._datatype||o._data===void 0?o._datatype:o.getDataType();if(u.length!==c.length)throw new qe(u.length,c.length);if(u[0]!==c[0]||u[1]!==c[1])throw new RangeError("Dimension mismatch. Matrix A ("+u+") must match Matrix B ("+c+")");var m=u[0],p=u[1],v,h=0,w=l;typeof s=="string"&&s===f&&s!=="mixed"&&(v=s,h=r.convert(0,v),w=r.find(l,[v,v]));var b,A,g=[];for(b=0;b{var{typed:r,matrix:t,DenseMatrix:n,concat:a}=e,i=kr({typed:r}),o=Bt({typed:r,DenseMatrix:n}),l=xr({typed:r,DenseMatrix:n}),u=ar({typed:r,matrix:t,concat:a});return r(yv,{"number, number":Xd,"BigNumber, BigNumber":rT,"bigint, bigint":(s,c)=>s^c},u({SS:o,DS:i,Ss:l}))}),bv="arg",mT=["typed"],dT=P(bv,mT,e=>{var{typed:r}=e;return r(bv,{number:function(n){return Math.atan2(0,n)},BigNumber:function(n){return n.constructor.atan2(0,n)},Complex:function(n){return n.arg()},"Array | Matrix":r.referToSelf(t=>n=>Le(n,t))})}),wv="conj",pT=["typed"],vT=P(wv,pT,e=>{var{typed:r}=e;return r(wv,{"number | BigNumber | Fraction":t=>t,Complex:t=>t.conjugate(),"Array | Matrix":r.referToSelf(t=>n=>Le(n,t))})}),xv="im",hT=["typed"],gT=P(xv,hT,e=>{var{typed:r}=e;return r(xv,{number:()=>0,"BigNumber | Fraction":t=>t.mul(0),Complex:t=>t.im,"Array | Matrix":r.referToSelf(t=>n=>Le(n,t))})}),Nv="re",yT=["typed"],bT=P(Nv,yT,e=>{var{typed:r}=e;return r(Nv,{"number | BigNumber | Fraction":t=>t,Complex:t=>t.re,"Array | Matrix":r.referToSelf(t=>n=>Le(n,t))})}),Av="not",wT=["typed"],xT=P(Av,wT,e=>{var{typed:r}=e;return r(Av,{"null | undefined":()=>!0,number:np,Complex:function(n){return n.re===0&&n.im===0},BigNumber:function(n){return n.isZero()||n.isNaN()},bigint:t=>!t,Unit:r.referToSelf(t=>n=>r.find(t,n.valueType())(n.value)),"Array | Matrix":r.referToSelf(t=>n=>Le(n,t))})}),Ev="or",NT=["typed","matrix","equalScalar","DenseMatrix","concat"],Dv=P(Ev,NT,e=>{var{typed:r,matrix:t,equalScalar:n,DenseMatrix:a,concat:i}=e,o=kr({typed:r}),l=Ao({typed:r,equalScalar:n}),u=xr({typed:r,DenseMatrix:a}),s=ar({typed:r,matrix:t,concat:i});return r(Ev,{"number, number":Bu,"Complex, Complex":function(f,m){return f.re!==0||f.im!==0||m.re!==0||m.im!==0},"BigNumber, BigNumber":function(f,m){return!f.isZero()&&!f.isNaN()||!m.isZero()&&!m.isNaN()},"bigint, bigint":Bu,"Unit, Unit":r.referToSelf(c=>(f,m)=>c(f.value||0,m.value||0))},s({SS:l,DS:o,Ss:u}))}),Sv="xor",AT=["typed","matrix","DenseMatrix","concat"],ET=P(Sv,AT,e=>{var{typed:r,matrix:t,DenseMatrix:n,concat:a}=e,i=kr({typed:r}),o=Bt({typed:r,DenseMatrix:n}),l=xr({typed:r,DenseMatrix:n}),u=ar({typed:r,matrix:t,concat:a});return r(Sv,{"number, number":Ou,"Complex, Complex":function(c,f){return(c.re!==0||c.im!==0)!=(f.re!==0||f.im!==0)},"bigint, bigint":Ou,"BigNumber, BigNumber":function(c,f){return(!c.isZero()&&!c.isNaN())!=(!f.isZero()&&!f.isNaN())},"Unit, Unit":r.referToSelf(s=>(c,f)=>s(c.value||0,f.value||0))},u({SS:o,DS:i,Ss:l}))}),Cv="concat",DT=["typed","matrix","isInteger"],Mv=P(Cv,DT,e=>{var{typed:r,matrix:t,isInteger:n}=e;return r(Cv,{"...Array | Matrix | number | BigNumber":function(i){var o,l=i.length,u=-1,s,c=!1,f=[];for(o=0;o0&&u>s)throw new ft(u,s+1)}else{var p=Fe(m).valueOf(),v=$e(p);if(f[o]=p,s=u,u=v.length-1,o>0&&u!==s)throw new qe(s+1,u+1)}}if(f.length===0)throw new SyntaxError("At least one matrix expected");for(var h=f.shift();f.length;)h=Sd(h,f.shift(),u);return c?t(h):h},"...string":function(i){return i.join("")}})}),_v="column",ST=["typed","Index","matrix","range"],Tv=P(_v,ST,e=>{var{typed:r,Index:t,matrix:n,range:a}=e;return r(_v,{"Matrix, number":i,"Array, number":function(l,u){return i(n(Fe(l)),u).valueOf()}});function i(o,l){if(o.size().length!==2)throw new Error("Only two dimensional matrix is supported");nr(l,o.size()[1]);var u=a(0,o.size()[0]),s=new t(u,l),c=o.subset(s);return _e(c)?c:n([[c]])}}),Fv="count",CT=["typed","size","prod"],MT=P(Fv,CT,e=>{var{typed:r,size:t,prod:n}=e;return r(Fv,{string:function(i){return i.length},"Matrix | Array":function(i){return n(t(i))}})}),Bv="cross",_T=["typed","matrix","subtract","multiply"],TT=P(Bv,_T,e=>{var{typed:r,matrix:t,subtract:n,multiply:a}=e;return r(Bv,{"Matrix, Matrix":function(l,u){return t(i(l.toArray(),u.toArray()))},"Matrix, Array":function(l,u){return t(i(l.toArray(),u))},"Array, Matrix":function(l,u){return t(i(l,u.toArray()))},"Array, Array":i});function i(o,l){var u=Math.max($e(o).length,$e(l).length);o=po(o),l=po(l);var s=$e(o),c=$e(l);if(s.length!==1||c.length!==1||s[0]!==3||c[0]!==3)throw new RangeError("Vectors with length 3 expected (Size A = ["+s.join(", ")+"], B = ["+c.join(", ")+"])");var f=[n(a(o[1],l[2]),a(o[2],l[1])),n(a(o[2],l[0]),a(o[0],l[2])),n(a(o[0],l[1]),a(o[1],l[0]))];return u>1?[f]:f}}),Ov="diag",FT=["typed","matrix","DenseMatrix","SparseMatrix"],BT=P(Ov,FT,e=>{var{typed:r,matrix:t,DenseMatrix:n,SparseMatrix:a}=e;return r(Ov,{Array:function(s){return i(s,0,$e(s),null)},"Array, number":function(s,c){return i(s,c,$e(s),null)},"Array, BigNumber":function(s,c){return i(s,c.toNumber(),$e(s),null)},"Array, string":function(s,c){return i(s,0,$e(s),c)},"Array, number, string":function(s,c,f){return i(s,c,$e(s),f)},"Array, BigNumber, string":function(s,c,f){return i(s,c.toNumber(),$e(s),f)},Matrix:function(s){return i(s,0,s.size(),s.storage())},"Matrix, number":function(s,c){return i(s,c,s.size(),s.storage())},"Matrix, BigNumber":function(s,c){return i(s,c.toNumber(),s.size(),s.storage())},"Matrix, string":function(s,c){return i(s,0,s.size(),c)},"Matrix, number, string":function(s,c,f){return i(s,c,s.size(),f)},"Matrix, BigNumber, string":function(s,c,f){return i(s,c.toNumber(),s.size(),f)}});function i(u,s,c,f){if(!Ce(s))throw new TypeError("Second parameter in function diag must be an integer");var m=s>0?s:0,p=s<0?-s:0;switch(c.length){case 1:return o(u,s,f,c[0],p,m);case 2:return l(u,s,f,c,p,m)}throw new RangeError("Matrix for function diag must be 2 dimensional")}function o(u,s,c,f,m,p){var v=[f+m,f+p];if(c&&c!=="sparse"&&c!=="dense")throw new TypeError("Unknown matrix type ".concat(c,'"'));var h=c==="sparse"?a.diagonal(v,u,s):n.diagonal(v,u,s);return c!==null?h:h.valueOf()}function l(u,s,c,f,m,p){if(_e(u)){var v=u.diagonal(s);return c!==null?c!==v.storage()?t(v,c):v:v.valueOf()}for(var h=Math.min(f[0]-m,f[1]-p),w=[],b=0;b{var{typed:r}=e;return r("filter",{"Array, function":Iv,"Matrix, function":function(n,a){return n.create(Iv(n.valueOf(),a),n.datatype())},"Array, RegExp":Ad,"Matrix, RegExp":function(n,a){return n.create(Ad(n.valueOf(),a),n.datatype())}})});function Iv(e,r){var t=Un(r,e,"filter");return rM(e,function(n,a,i){return t(n,[a],i)})}var Rv="flatten",IT=["typed"],RT=P(Rv,IT,e=>{var{typed:r}=e;return r(Rv,{Array:function(n){return We(n)},Matrix:function(n){return n.create(We(n.toArray()),n.datatype())}})}),Uu="forEach",zT=["typed"],zv=P(Uu,zT,e=>{var{typed:r}=e;return r(Uu,{"Array, function":PT,"Matrix, function":function(n,a){n.forEach(a)}})});function PT(e,r){_u(e,[],e,Un(r,e,Uu))}var Pv="getMatrixDataType",kT=["typed"],qT=P(Pv,kT,e=>{var{typed:r}=e;return r(Pv,{Array:function(n){return ho(n,tr)},Matrix:function(n){return n.getDataType()}})}),kv="identity",LT=["typed","config","matrix","BigNumber","DenseMatrix","SparseMatrix"],VT=P(kv,LT,e=>{var{typed:r,config:t,matrix:n,BigNumber:a,DenseMatrix:i,SparseMatrix:o}=e;return r(kv,{"":function(){return t.matrix==="Matrix"?n([]):[]},string:function(c){return n(c)},"number | BigNumber":function(c){return u(c,c,t.matrix==="Matrix"?"dense":void 0)},"number | BigNumber, string":function(c,f){return u(c,c,f)},"number | BigNumber, number | BigNumber":function(c,f){return u(c,f,t.matrix==="Matrix"?"dense":void 0)},"number | BigNumber, number | BigNumber, string":function(c,f,m){return u(c,f,m)},Array:function(c){return l(c)},"Array, string":function(c,f){return l(c,f)},Matrix:function(c){return l(c.valueOf(),c.storage())},"Matrix, string":function(c,f){return l(c.valueOf(),f)}});function l(s,c){switch(s.length){case 0:return c?n(c):[];case 1:return u(s[0],s[0],c);case 2:return u(s[0],s[1],c);default:throw new Error("Vector containing two values expected")}}function u(s,c,f){var m=Ie(s)||Ie(c)?a:null;if(Ie(s)&&(s=s.toNumber()),Ie(c)&&(c=c.toNumber()),!Ce(s)||s<1)throw new Error("Parameters in function identity must be positive integers");if(!Ce(c)||c<1)throw new Error("Parameters in function identity must be positive integers");var p=m?new a(1):1,v=m?new m(0):0,h=[s,c];if(f){if(f==="sparse")return o.diagonal(h,p,0,v);if(f==="dense")return i.diagonal(h,p,0,v);throw new TypeError('Unknown matrix type "'.concat(f,'"'))}for(var w=xa([],h,v),b=s{var{typed:r,matrix:t,multiplyScalar:n}=e;return r(qv,{"Matrix, Matrix":function(o,l){return t(a(o.toArray(),l.toArray()))},"Matrix, Array":function(o,l){return t(a(o.toArray(),l))},"Array, Matrix":function(o,l){return t(a(o,l.toArray()))},"Array, Array":a});function a(i,o){if($e(i).length===1&&(i=[i]),$e(o).length===1&&(o=[o]),$e(i).length>2||$e(o).length>2)throw new RangeError("Vectors with dimensions greater then 2 are not supported expected (Size x = "+JSON.stringify(i.length)+", y = "+JSON.stringify(o.length)+")");var l=[],u=[];return i.map(function(s){return o.map(function(c){return u=[],l.push(u),s.map(function(f){return c.map(function(m){return u.push(n(f,m))})})})})&&l}}),Hu="map",ZT=["typed"],Lv=P(Hu,ZT,e=>{var{typed:r}=e;return r(Hu,{"Array, function":n,"Matrix, function":function(i,o){return i.map(o)},"Array|Matrix, Array|Matrix, ...Array|Matrix|function":(a,i,o)=>t([a,i,...o.slice(0,o.length-1)],o[o.length-1])});function t(a,i){if(typeof i!="function")throw new Error("Last argument must be a callback function");var o=a[0].isMatrix,l=Cu(...a.map(N=>N.isMatrix?N.size():$e(N))),u=o?(N,x)=>N.get(x):Mu,s=o?a.map(N=>N.isMatrix?N.create(Vn(N.toArray(),l),N.datatype()):a[0].create(Vn(N.valueOf(),l))):a.map(N=>N.isMatrix?Vn(N.toArray(),l):Vn(N,l)),c;if(r.isTypedFunction(i)){var f=l.map(()=>0),m=s.map(N=>u(N,f)),p=g(i,m,f,s);c=b(p)}else{var v=a.length,h=A(i,v);c=b(h)}var w=(N,x)=>c([N,...s.slice(1).map(y=>u(y,x))],x);if(o)return s[0].map(w);return n(s[0],w);function b(N){switch(N){case 0:return x=>i(...x);case 1:return(x,y)=>i(...x,y);case 2:return(x,y)=>i(...x,y,...s)}}function A(N,x){return N.length>x+1?2:N.length===x+1?1:0}function g(N,x,y,D){return r.resolve(N,[...x,y,...D])!==null?2:r.resolve(N,[...x,y])!==null?1:(r.resolve(N,x)!==null,0)}}function n(a,i){return _u(a,[],a,Un(i,a,Hu))}}),Vv="diff",GT=["typed","matrix","subtract","number"],Uv=P(Vv,GT,e=>{var{typed:r,matrix:t,subtract:n,number:a}=e;return r(Vv,{"Array | Matrix":function(c){return _e(c)?t(o(c.toArray())):o(c)},"Array | Matrix, number":function(c,f){if(!Ce(f))throw new RangeError("Dimension must be a whole number");return _e(c)?t(i(c.toArray(),f)):i(c,f)},"Array, BigNumber":r.referTo("Array,number",s=>(c,f)=>s(c,a(f))),"Matrix, BigNumber":r.referTo("Matrix,number",s=>(c,f)=>s(c,a(f)))});function i(s,c){if(_e(s)&&(s=s.toArray()),!Array.isArray(s))throw RangeError("Array/Matrix does not have that many dimensions");if(c>0){var f=[];return s.forEach(m=>{f.push(i(m,c-1))}),f}else{if(c===0)return o(s);throw RangeError("Cannot have negative dimension")}}function o(s){for(var c=[],f=s.length,m=1;m{var{typed:r,config:t,matrix:n,BigNumber:a}=e;return r("ones",{"":function(){return t.matrix==="Array"?i([]):i([],"default")},"...number | BigNumber | string":function(s){var c=s[s.length-1];if(typeof c=="string"){var f=s.pop();return i(s,f)}else return t.matrix==="Array"?i(s):i(s,"default")},Array:i,Matrix:function(s){var c=s.storage();return i(s.valueOf(),c)},"Array | Matrix, string":function(s,c){return i(s.valueOf(),c)}});function i(u,s){var c=o(u),f=c?new a(1):1;if(l(u),s){var m=n(s);return u.length>0?m.resize(u,f):m}else{var p=[];return u.length>0?xa(p,u,f):p}}function o(u){var s=!1;return u.forEach(function(c,f,m){Ie(c)&&(s=!0,m[f]=c.toNumber())}),s}function l(u){u.forEach(function(s){if(typeof s!="number"||!Ce(s)||s<0)throw new Error("Parameters in function ones must be positive integers")})}});function Zu(){throw new Error('No "bignumber" implementation available')}function Hv(){throw new Error('No "fraction" implementation available')}function Zv(){throw new Error('No "matrix" implementation available')}var Gv="range",JT=["typed","config","?matrix","?bignumber","smaller","smallerEq","larger","largerEq","add","isPositive"],Wv=P(Gv,JT,e=>{var{typed:r,config:t,matrix:n,bignumber:a,smaller:i,smallerEq:o,larger:l,largerEq:u,add:s,isPositive:c}=e;return r(Gv,{string:m,"string, boolean":m,"number, number":function(w,b){return f(p(w,b,1,!1))},"number, number, number":function(w,b,A){return f(p(w,b,A,!1))},"number, number, boolean":function(w,b,A){return f(p(w,b,1,A))},"number, number, number, boolean":function(w,b,A,g){return f(p(w,b,A,g))},"BigNumber, BigNumber":function(w,b){var A=w.constructor;return f(p(w,b,new A(1),!1))},"BigNumber, BigNumber, BigNumber":function(w,b,A){return f(p(w,b,A,!1))},"BigNumber, BigNumber, boolean":function(w,b,A){var g=w.constructor;return f(p(w,b,new g(1),A))},"BigNumber, BigNumber, BigNumber, boolean":function(w,b,A,g){return f(p(w,b,A,g))},"Unit, Unit, Unit":function(w,b,A){return f(p(w,b,A,!1))},"Unit, Unit, Unit, boolean":function(w,b,A,g){return f(p(w,b,A,g))}});function f(h){return t.matrix==="Matrix"?n?n(h):Zv():h}function m(h,w){var b=v(h);if(!b)throw new SyntaxError('String "'+h+'" is no valid range');return t.number==="BigNumber"?(a===void 0&&Zu(),f(p(a(b.start),a(b.end),a(b.step)))):f(p(b.start,b.end,b.step,w))}function p(h,w,b,A){for(var g=[],N=c(b)?A?o:i:A?u:l,x=h;N(x,w);)g.push(x),x=s(x,b);return g}function v(h){var w=h.split(":"),b=w.map(function(g){return Number(g)}),A=b.some(function(g){return isNaN(g)});if(A)return null;switch(b.length){case 2:return{start:b[0],end:b[1],step:1};case 3:return{start:b[0],end:b[2],step:b[1]};default:return null}}}),jv="reshape",YT=["typed","isInteger","matrix"],XT=P(jv,YT,e=>{var{typed:r,isInteger:t}=e;return r(jv,{"Matrix, Array":function(a,i){return a.reshape(i,!0)},"Array, Array":function(a,i){return i.forEach(function(o){if(!t(o))throw new TypeError("Invalid size for dimension: "+o)}),Du(a,i)}})}),QT="resize",eF=["config","matrix"],rF=P(QT,eF,e=>{var{config:r,matrix:t}=e;return function(i,o,l){if(arguments.length!==2&&arguments.length!==3)throw new Xt("resize",arguments.length,2,3);if(_e(o)&&(o=o.valueOf()),Ie(o[0])&&(o=o.map(function(c){return Ie(c)?c.toNumber():c})),_e(i))return i.resize(o,l,!0);if(typeof i=="string")return n(i,o,l);var u=Array.isArray(i)?!1:r.matrix!=="Array";if(o.length===0){for(;Array.isArray(i);)i=i[0];return Fe(i)}else{Array.isArray(i)||(i=[i]),i=Fe(i);var s=xa(i,o,l);return u?t(s):s}};function n(a,i,o){if(o!==void 0){if(typeof o!="string"||o.length!==1)throw new TypeError("Single character expected as defaultValue")}else o=" ";if(i.length!==1)throw new qe(i.length,1);var l=i[0];if(typeof l!="number"||!Ce(l))throw new TypeError("Invalid size, must contain positive integers (size: "+Ve(i)+")");if(a.length>l)return a.substring(0,l);if(a.length{var{typed:r,multiply:t,rotationMatrix:n}=e;return r(Kv,{"Array , number | BigNumber | Complex | Unit":function(o,l){a(o,2);var u=t(n(l),o);return u.toArray()},"Matrix , number | BigNumber | Complex | Unit":function(o,l){return a(o,2),t(n(l),o)},"Array, number | BigNumber | Complex | Unit, Array | Matrix":function(o,l,u){a(o,3);var s=t(n(l,u),o);return s},"Matrix, number | BigNumber | Complex | Unit, Array | Matrix":function(o,l,u){return a(o,3),t(n(l,u),o)}});function a(i,o){var l=Array.isArray(i)?$e(i):i.size();if(l.length>2)throw new RangeError("Vector must be of dimensions 1x".concat(o));if(l.length===2&&l[1]!==1)throw new RangeError("Vector must be of dimensions 1x".concat(o));if(l[0]!==o)throw new RangeError("Vector must be of dimensions 1x".concat(o))}}),Jv="rotationMatrix",aF=["typed","config","multiplyScalar","addScalar","unaryMinus","norm","matrix","BigNumber","DenseMatrix","SparseMatrix","cos","sin"],iF=P(Jv,aF,e=>{var{typed:r,config:t,multiplyScalar:n,addScalar:a,unaryMinus:i,norm:o,BigNumber:l,matrix:u,DenseMatrix:s,SparseMatrix:c,cos:f,sin:m}=e;return r(Jv,{"":function(){return t.matrix==="Matrix"?u([]):[]},string:function(g){return u(g)},"number | BigNumber | Complex | Unit":function(g){return p(g,t.matrix==="Matrix"?"dense":void 0)},"number | BigNumber | Complex | Unit, string":function(g,N){return p(g,N)},"number | BigNumber | Complex | Unit, Array":function(g,N){var x=u(N);return v(x),b(g,x,void 0)},"number | BigNumber | Complex | Unit, Matrix":function(g,N){v(N);var x=N.storage()||(t.matrix==="Matrix"?"dense":void 0);return b(g,N,x)},"number | BigNumber | Complex | Unit, Array, string":function(g,N,x){var y=u(N);return v(y),b(g,y,x)},"number | BigNumber | Complex | Unit, Matrix, string":function(g,N,x){return v(N),b(g,N,x)}});function p(A,g){var N=Ie(A),x=N?new l(-1):-1,y=f(A),D=m(A),S=[[y,n(x,D)],[D,y]];return w(S,g)}function v(A){var g=A.size();if(g.length<1||g[0]!==3)throw new RangeError("Vector must be of dimensions 1x3")}function h(A){return A.reduce((g,N)=>n(g,N))}function w(A,g){if(g){if(g==="sparse")return new c(A);if(g==="dense")return new s(A);throw new TypeError('Unknown matrix type "'.concat(g,'"'))}return A}function b(A,g,N){var x=o(g);if(x===0)throw new RangeError("Rotation around zero vector");var y=Ie(A)?l:null,D=y?new y(1):1,S=y?new y(-1):-1,E=y?new y(g.get([0])/x):g.get([0])/x,C=y?new y(g.get([1])/x):g.get([1])/x,_=y?new y(g.get([2])/x):g.get([2])/x,F=f(A),I=a(D,i(F)),R=m(A),$=a(F,h([E,E,I])),M=a(h([E,C,I]),h([S,_,R])),T=a(h([E,_,I]),h([C,R])),k=a(h([E,C,I]),h([_,R])),O=a(F,h([C,C,I])),W=a(h([C,_,I]),h([S,E,R])),X=a(h([E,_,I]),h([S,C,R])),U=a(h([C,_,I]),h([E,R])),z=a(F,h([_,_,I])),Q=[[$,M,T],[k,O,W],[X,U,z]];return w(Q,N)}}),Yv="row",oF=["typed","Index","matrix","range"],Xv=P(Yv,oF,e=>{var{typed:r,Index:t,matrix:n,range:a}=e;return r(Yv,{"Matrix, number":i,"Array, number":function(l,u){return i(n(Fe(l)),u).valueOf()}});function i(o,l){if(o.size().length!==2)throw new Error("Only two dimensional matrix is supported");nr(l,o.size()[0]);var u=a(0,o.size()[1]),s=new t(l,u),c=o.subset(s);return _e(c)?c:n([[c]])}}),Qv="size",sF=["typed","config","?matrix"],uF=P(Qv,sF,e=>{var{typed:r,config:t,matrix:n}=e;return r(Qv,{Matrix:function(i){return i.create(i.size(),"number")},Array:$e,string:function(i){return t.matrix==="Array"?[i.length]:n([i.length],"dense","number")},"number | Complex | BigNumber | Unit | boolean | null":function(i){return t.matrix==="Array"?[]:n?n([],"dense","number"):Zv()}})}),eh="squeeze",lF=["typed"],cF=P(eh,lF,e=>{var{typed:r}=e;return r(eh,{Array:function(n){return po(Fe(n))},Matrix:function(n){var a=po(n.toArray());return Array.isArray(a)?n.create(a,n.datatype()):a},any:function(n){return Fe(n)}})}),rh="subset",fF=["typed","matrix","zeros","add"],th=P(rh,fF,e=>{var{typed:r,matrix:t,zeros:n,add:a}=e;return r(rh,{"Matrix, Index":function(l,u){return wa(u)?t():(mo(l,u),l.subset(u))},"Array, Index":r.referTo("Matrix, Index",function(o){return function(l,u){var s=o(t(l),u);return u.isScalar()?s:s.valueOf()}}),"Object, Index":dF,"string, Index":mF,"Matrix, Index, any, any":function(l,u,s,c){return wa(u)?l:(mo(l,u),l.clone().subset(u,i(s,u),c))},"Array, Index, any, any":r.referTo("Matrix, Index, any, any",function(o){return function(l,u,s,c){var f=o(t(l),u,s,c);return f.isMatrix?f.valueOf():f}}),"Array, Index, any":r.referTo("Matrix, Index, any, any",function(o){return function(l,u,s){return o(t(l),u,s,void 0).valueOf()}}),"Matrix, Index, any":r.referTo("Matrix, Index, any, any",function(o){return function(l,u,s){return o(l,u,s,void 0)}}),"string, Index, string":nh,"string, Index, string, string":nh,"Object, Index, any":pF});function i(o,l){if(typeof o=="string")throw new Error("can't boradcast a string");if(l._isScalar)return o;var u=l.size();if(u.every(s=>s>0))try{return a(o,n(u))}catch{return o}else return o}});function mF(e,r){if(!Ya(r))throw new TypeError("Index expected");if(wa(r))return"";if(mo(Array.from(e),r),r.size().length!==1)throw new qe(r.size().length,1);var t=e.length;nr(r.min()[0],t),nr(r.max()[0],t);var n=r.dimension(0),a="";return n.forEach(function(i){a+=e.charAt(i)}),a}function nh(e,r,t,n){if(!r||r.isIndex!==!0)throw new TypeError("Index expected");if(wa(r))return e;if(mo(Array.from(e),r),r.size().length!==1)throw new qe(r.size().length,1);if(n!==void 0){if(typeof n!="string"||n.length!==1)throw new TypeError("Single character expected as defaultValue")}else n=" ";var a=r.dimension(0),i=a.size()[0];if(i!==t.length)throw new qe(a.size()[0],t.length);var o=e.length;nr(r.min()[0]),nr(r.max()[0]);for(var l=[],u=0;uo)for(var s=o-1,c=l.length;s{var{typed:r,matrix:t}=e;return r(ah,{Array:o=>n(t(o)).valueOf(),Matrix:n,any:Fe});function n(o){var l=o.size(),u;switch(l.length){case 1:u=o.clone();break;case 2:{var s=l[0],c=l[1];if(c===0)throw new RangeError("Cannot transpose a 2D matrix with no columns (size: "+Ve(l)+")");switch(o.storage()){case"dense":u=a(o,s,c);break;case"sparse":u=i(o,s,c);break}}break;default:throw new RangeError("Matrix must be a vector or two dimensional (size: "+Ve(l)+")")}return u}function a(o,l,u){for(var s=o._data,c=[],f,m=0;m{var{typed:r,transpose:t,conj:n}=e;return r(ih,{any:function(i){return n(t(i))}})}),oh="zeros",bF=["typed","config","matrix","BigNumber"],wF=P(oh,bF,e=>{var{typed:r,config:t,matrix:n,BigNumber:a}=e;return r(oh,{"":function(){return t.matrix==="Array"?i([]):i([],"default")},"...number | BigNumber | string":function(s){var c=s[s.length-1];if(typeof c=="string"){var f=s.pop();return i(s,f)}else return t.matrix==="Array"?i(s):i(s,"default")},Array:i,Matrix:function(s){var c=s.storage();return i(s.valueOf(),c)},"Array | Matrix, string":function(s,c){return i(s.valueOf(),c)}});function i(u,s){var c=o(u),f=c?new a(0):0;if(l(u),s){var m=n(s);return u.length>0?m.resize(u,f):m}else{var p=[];return u.length>0?xa(p,u,f):p}}function o(u){var s=!1;return u.forEach(function(c,f,m){Ie(c)&&(s=!0,m[f]=c.toNumber())}),s}function l(u){u.forEach(function(s){if(typeof s!="number"||!Ce(s)||s<0)throw new Error("Parameters in function zeros must be positive integers")})}}),sh="fft",xF=["typed","matrix","addScalar","multiplyScalar","divideScalar","exp","tau","i","dotDivide","conj","pow","ceil","log2"],NF=P(sh,xF,e=>{var{typed:r,matrix:t,addScalar:n,multiplyScalar:a,divideScalar:i,exp:o,tau:l,i:u,dotDivide:s,conj:c,pow:f,ceil:m,log2:p}=e;return r(sh,{Array:v,Matrix:function(g){return g.create(v(g.valueOf()),g.datatype())}});function v(A){var g=$e(A);return g.length===1?b(A,g[0]):h(A.map(N=>v(N,g.slice(1))),0)}function h(A,g){var N=$e(A);if(g!==0)return new Array(N[0]).fill(0).map((y,D)=>h(A[D],g-1));if(N.length===1)return b(A);function x(y){var D=$e(y);return new Array(D[1]).fill(0).map((S,E)=>new Array(D[0]).fill(0).map((C,_)=>y[_][E]))}return x(h(x(A),1))}function w(A){for(var g=A.length,N=o(i(a(-1,a(u,l)),g)),x=[],y=1-g;ya(A[T],x[g-1+T])),...new Array(D-g).fill(0)],E=[...new Array(g+g-1).fill(0).map((M,T)=>i(1,x[T])),...new Array(D-(g+g-1)).fill(0)],C=b(S),_=b(E),F=new Array(D).fill(0).map((M,T)=>a(C[T],_[T])),I=s(c(v(c(F))),D),R=[],$=g-1;$E%2===0)),...b(A.filter((S,E)=>E%2===1))],x=0;x{var{typed:r,fft:t,dotDivide:n,conj:a}=e;return r(uh,{"Array | Matrix":function(o){var l=_e(o)?o.size():$e(o);return n(a(t(a(o))),l.reduce((u,s)=>u*s,1))}})});function oi(e){"@babel/helpers - typeof";return oi=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(r){return typeof r}:function(r){return r&&typeof Symbol=="function"&&r.constructor===Symbol&&r!==Symbol.prototype?"symbol":typeof r},oi(e)}function DF(e,r){if(oi(e)!="object"||!e)return e;var t=e[Symbol.toPrimitive];if(t!==void 0){var n=t.call(e,r);if(oi(n)!="object")return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return(r==="string"?String:Number)(e)}function SF(e){var r=DF(e,"string");return oi(r)=="symbol"?r:r+""}function Nr(e,r,t){return(r=SF(r))in e?Object.defineProperty(e,r,{value:t,enumerable:!0,configurable:!0,writable:!0}):e[r]=t,e}function lh(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),t.push.apply(t,n)}return t}function CF(e){for(var r=1;r{var{typed:r,add:t,subtract:n,multiply:a,divide:i,max:o,map:l,abs:u,isPositive:s,isNegative:c,larger:f,smaller:m,matrix:p,bignumber:v,unaryMinus:h}=e;function w(S){return function(E,C,_,F){var I=!(C.length===2&&(C.every(y)||C.every(Gr)));if(I)throw new Error('"tspan" must be an Array of two numeric values or two units [tStart, tEnd]');var R=C[0],$=C[1],M=f($,R),T=F.firstStep;if(T!==void 0&&!s(T))throw new Error('"firstStep" must be positive');var k=F.maxStep;if(k!==void 0&&!s(k))throw new Error('"maxStep" must be positive');var O=F.minStep;if(O&&c(O))throw new Error('"minStep" must be positive or zero');var W=[R,$,T,O,k].filter(V=>V!==void 0);if(!(W.every(y)||W.every(Gr)))throw new Error('Inconsistent type of "t" dependant variables');for(var X=1,U=F.tol?F.tol:1e-4,z=F.minDelta?F.minDelta:.2,Q=F.maxDelta?F.maxDelta:5,se=F.maxIter?F.maxIter:1e4,re=[R,$,..._,k,O].some(Ie),[q,Z,j,Y]=re?[v(S.a),v(S.c),v(S.b),v(S.bp)]:[S.a,S.c,S.b,S.bp],ee=T?M?T:h(T):i(n($,R),X),te=[R],oe=[_],ve=n(j,Y),L=0,H=0,ne=N(M),ie=x(M);ne(te[L],$);){var de=[];ee=ie(te[L],$,ee),de.push(E(te[L],oe[L]));for(var me=1;meGr(V)?V.value:V)));be1/4&&(te.push(t(te[L],ee)),oe.push(t(oe[L],a(ee,j,de))),L++);var Ne=.84*(U/be)**(1/5);if(m(Ne,z)?Ne=z:f(Ne,Q)&&(Ne=Q),Ne=re?v(Ne):Ne,ee=a(ee,Ne),k&&f(u(ee),k)?ee=M?k:h(k):O&&m(u(ee),O)&&(ee=M?O:h(O)),H++,H>se)throw new Error("Maximum number of iterations reached, try changing options")}return{t:te,y:oe}}}function b(S,E,C,_){var F=[[],[.5],[0,.75],[.2222222222222222,.3333333333333333,.4444444444444444]],I=[null,1/2,3/4,1],R=[2/9,1/3,4/9,0],$=[7/24,1/4,1/3,1/8],M={a:F,c:I,b:R,bp:$};return w(M)(S,E,C,_)}function A(S,E,C,_){var F=[[],[.2],[.075,.225],[.9777777777777777,-3.7333333333333334,3.5555555555555554],[2.9525986892242035,-11.595793324188385,9.822892851699436,-.2908093278463649],[2.8462752525252526,-10.757575757575758,8.906422717743473,.2784090909090909,-.2735313036020583],[.09114583333333333,0,.44923629829290207,.6510416666666666,-.322376179245283,.13095238095238096]],I=[null,1/5,3/10,4/5,8/9,1,1],R=[35/384,0,500/1113,125/192,-2187/6784,11/84,0],$=[5179/57600,0,7571/16695,393/640,-92097/339200,187/2100,1/40],M={a:F,c:I,b:R,bp:$};return w(M)(S,E,C,_)}function g(S,E,C,_){var F=_.method?_.method:"RK45",I={RK23:b,RK45:A};if(F.toUpperCase()in I){var R=CF({},_);return delete R.method,I[F.toUpperCase()](S,E,C,R)}else{var $=Object.keys(I).map(T=>'"'.concat(T,'"')),M="".concat($.slice(0,-1).join(", ")," and ").concat($.slice(-1));throw new Error('Unavailable method "'.concat(F,'". Available methods are ').concat(M))}}function N(S){return S?m:f}function x(S){var E=S?f:m;return function(C,_,F){var I=t(C,F);return E(I,_)?n(_,C):F}}function y(S){return Ie(S)||Re(S)}function D(S,E,C,_){var F=g(S,E.toArray(),C.toArray(),_);return{t:p(F.t),y:p(F.y)}}return r("solveODE",{"function, Array, Array, Object":g,"function, Matrix, Matrix, Object":D,"function, Array, Array":(S,E,C)=>g(S,E,C,{}),"function, Matrix, Matrix":(S,E,C)=>D(S,E,C,{}),"function, Array, number | BigNumber | Unit":(S,E,C)=>{var _=g(S,E,[C],{});return{t:_.t,y:_.y.map(F=>F[0])}},"function, Matrix, number | BigNumber | Unit":(S,E,C)=>{var _=g(S,E.toArray(),[C],{});return{t:p(_.t),y:p(_.y.map(F=>F[0]))}},"function, Array, number | BigNumber | Unit, Object":(S,E,C,_)=>{var F=g(S,E,[C],_);return{t:F.t,y:F.y.map(I=>I[0])}},"function, Matrix, number | BigNumber | Unit, Object":(S,E,C,_)=>{var F=g(S,E.toArray(),[C],_);return{t:p(F.t),y:p(F.y.map(I=>I[0]))}}})}),FF="erf",BF=["typed"],OF=P(FF,BF,e=>{var{typed:r}=e;return r("name",{number:function(o){var l=Math.abs(o);return l>=RF?dn(o):l<=$F?dn(o)*t(l):l<=4?dn(o)*(1-n(l)):dn(o)*(1-a(l))},"Array | Matrix":r.referToSelf(i=>o=>Le(o,i))});function t(i){var o=i*i,l=Qt[0][4]*o,u=o,s;for(s=0;s<3;s+=1)l=(l+Qt[0][s])*o,u=(u+Ma[0][s])*o;return i*(l+Qt[0][3])/(u+Ma[0][3])}function n(i){var o=Qt[1][8]*i,l=i,u;for(u=0;u<7;u+=1)o=(o+Qt[1][u])*i,l=(l+Ma[1][u])*i;var s=(o+Qt[1][7])/(l+Ma[1][7]),c=parseInt(i*16)/16,f=(i-c)*(i+c);return Math.exp(-c*c)*Math.exp(-f)*s}function a(i){var o=1/(i*i),l=Qt[2][5]*o,u=o,s;for(s=0;s<4;s+=1)l=(l+Qt[2][s])*o,u=(u+Ma[2][s])*o;var c=o*(l+Qt[2][4])/(u+Ma[2][4]);c=(IF-c)/i,o=parseInt(i*16)/16;var f=(i-o)*(i+o);return Math.exp(-o*o)*Math.exp(-f)*c}}),$F=.46875,IF=.5641895835477563,Qt=[[3.1611237438705655,113.86415415105016,377.485237685302,3209.3775891384694,.18577770618460315],[.5641884969886701,8.883149794388377,66.11919063714163,298.6351381974001,881.952221241769,1712.0476126340707,2051.0783778260716,1230.3393547979972,21531153547440383e-24],[.30532663496123236,.36034489994980445,.12578172611122926,.016083785148742275,.0006587491615298378,.016315387137302097]],Ma=[[23.601290952344122,244.02463793444417,1282.6165260773723,2844.236833439171],[15.744926110709835,117.6939508913125,537.1811018620099,1621.3895745666903,3290.7992357334597,4362.619090143247,3439.3676741437216,1230.3393548037495],[2.568520192289822,1.8729528499234604,.5279051029514285,.06051834131244132,.0023352049762686918]],RF=Math.pow(2,53),ch="zeta",zF=["typed","config","multiply","pow","divide","factorial","equal","smallerEq","isNegative","gamma","sin","subtract","add","?Complex","?BigNumber","pi"],PF=P(ch,zF,e=>{var{typed:r,config:t,multiply:n,pow:a,divide:i,factorial:o,equal:l,smallerEq:u,isNegative:s,gamma:c,sin:f,subtract:m,add:p,Complex:v,BigNumber:h,pi:w}=e;return r(ch,{number:y=>b(y,D=>D,()=>20),BigNumber:y=>b(y,D=>new h(D),()=>Math.abs(Math.log10(t.relTol))),Complex:A});function b(y,D,S){return l(y,0)?D(-.5):l(y,1)?D(NaN):isFinite(y)?g(y,D,S,E=>E):s(y)?D(NaN):D(1)}function A(y){return y.re===0&&y.im===0?new v(-.5):y.re===1?new v(NaN,NaN):y.re===1/0&&y.im===0?new v(1):y.im===1/0||y.re===-1/0?new v(NaN,NaN):g(y,D=>D,D=>Math.round(1.3*15+.9*Math.abs(D.im)),D=>D.re)}function g(y,D,S,E){var C=S(y);if(E(y)>-(C-1)/2)return x(y,D(C),D);var _=n(a(2,y),a(D(w),m(y,1)));return _=n(_,f(n(i(D(w),2),y))),_=n(_,c(m(1,y))),n(_,g(m(1,y),D,S,E))}function N(y,D){for(var S=y,E=y;u(E,D);E=p(E,1)){var C=i(n(o(p(D,m(E,1))),a(4,E)),n(o(m(D,E)),o(n(2,E))));S=p(S,C)}return n(D,S)}function x(y,D,S){for(var E=i(1,n(N(S(0),D),m(1,a(2,m(1,y))))),C=S(0),_=S(1);u(_,D);_=p(_,1))C=p(C,i(n((-1)**(_-1),N(_,D)),a(_,y)));return n(E,C)}}),fh="mode",kF=["typed","isNaN","isNumeric"],qF=P(fh,kF,e=>{var{typed:r,isNaN:t,isNumeric:n}=e;return r(fh,{"Array | Matrix":a,"...":function(o){return a(o)}});function a(i){i=We(i.valueOf());var o=i.length;if(o===0)throw new Error("Cannot calculate mode of an empty array");for(var l={},u=[],s=0,c=0;cs&&(s=l[f],u=[f])}return u}});function qr(e,r,t){var n;return String(e).includes("Unexpected type")?(n=arguments.length>2?" (type: "+tr(t)+", value: "+JSON.stringify(t)+")":" (type: "+e.data.actual+")",new TypeError("Cannot calculate "+r+", unexpected type of argument"+n)):String(e).includes("complex numbers")?(n=arguments.length>2?" (type: "+tr(t)+", value: "+JSON.stringify(t)+")":"",new TypeError("Cannot calculate "+r+", no ordering relation is defined for complex numbers"+n)):e}var mh="prod",LF=["typed","config","multiplyScalar","numeric"],VF=P(mh,LF,e=>{var{typed:r,config:t,multiplyScalar:n,numeric:a}=e;return r(mh,{"Array | Matrix":i,"Array | Matrix, number | BigNumber":function(l,u){throw new Error("prod(A, dim) is not yet supported")},"...":function(l){return i(l)}});function i(o){var l;if(Jt(o,function(u){try{l=l===void 0?u:n(l,u)}catch(s){throw qr(s,"prod",u)}}),typeof l=="string"&&(l=a(l,mn(l,t))),l===void 0)throw new Error("Cannot calculate prod of an empty array");return l}}),dh="format",UF=["typed"],HF=P(dh,UF,e=>{var{typed:r}=e;return r(dh,{any:Ve,"any, Object | function | number | BigNumber":Ve})}),ph="bin",ZF=["typed","format"],GF=P(ph,ZF,e=>{var{typed:r,format:t}=e;return r(ph,{"number | BigNumber":function(a){return t(a,{notation:"bin"})},"number | BigNumber, number | BigNumber":function(a,i){return t(a,{notation:"bin",wordSize:i})}})}),vh="oct",WF=["typed","format"],jF=P(vh,WF,e=>{var{typed:r,format:t}=e;return r(vh,{"number | BigNumber":function(a){return t(a,{notation:"oct"})},"number | BigNumber, number | BigNumber":function(a,i){return t(a,{notation:"oct",wordSize:i})}})}),hh="hex",KF=["typed","format"],JF=P(hh,KF,e=>{var{typed:r,format:t}=e;return r(hh,{"number | BigNumber":function(a){return t(a,{notation:"hex"})},"number | BigNumber, number | BigNumber":function(a,i){return t(a,{notation:"hex",wordSize:i})}})}),gh=/\$([\w.]+)/g,yh="print",YF=["typed"],bh=P(yh,YF,e=>{var{typed:r}=e;return r(yh,{"string, Object | Array":wh,"string, Object | Array, number | Object":wh})});function wh(e,r,t){return e.replace(gh,function(n,a){var i=a.split("."),o=r[i.shift()];for(o!==void 0&&o.isMatrix&&(o=o.toArray());i.length&&o!==void 0;){var l=i.shift();o=l?o[l]:o+"."}return o!==void 0?Cr(o)?o:Ve(o,t):n})}var xh="to",XF=["typed","matrix","concat"],QF=P(xh,XF,e=>{var{typed:r,matrix:t,concat:n}=e,a=ar({typed:r,matrix:t,concat:n});return r(xh,{"Unit, Unit | string":(i,o)=>i.to(o)},a({Ds:!0}))}),Nh="isPrime",eB=["typed"],rB=P(Nh,eB,e=>{var{typed:r}=e;return r(Nh,{number:function(n){if(n<=3)return n>1;if(n%2===0||n%3===0)return!1;for(var a=5;a*a<=n;a+=6)if(n%a===0||n%(a+2)===0)return!1;return!0},bigint:function(n){if(n<=3n)return n>1n;if(n%2n===0n||n%3n===0n)return!1;for(var a=5n;a*a<=n;a+=6n)if(n%a===0n||n%(a+2n)===0n)return!1;return!0},BigNumber:function(n){if(n.lte(3))return n.gt(1);if(n.mod(2).eq(0)||n.mod(3).eq(0))return!1;if(n.lt(Math.pow(2,32))){for(var a=n.toNumber(),i=5;i*i<=a;i+=6)if(a%i===0||a%(i+2)===0)return!1;return!0}function o(A,g,N){for(var x=1;!g.eq(0);)g.mod(2).eq(0)?(g=g.div(2),A=A.mul(A).mod(N)):(g=g.sub(1),x=A.mul(x).mod(N));return x}var l=n.constructor.clone({precision:n.toFixed(0).length*2});n=new l(n);for(var u=0,s=n.sub(1);s.mod(2).eq(0);)s=s.div(2),u+=1;var c=null;if(n.lt("3317044064679887385961981"))c=[2,3,5,7,11,13,17,19,23,29,31,37,41].filter(A=>An=>Le(n,t))})}),tB="numeric",nB=["number","?bignumber","?fraction"],aB=P(tB,nB,e=>{var{number:r,bignumber:t,fraction:n}=e,a={string:!0,number:!0,BigNumber:!0,Fraction:!0},i={number:o=>r(o),BigNumber:t?o=>t(o):Zu,bigint:o=>BigInt(o),Fraction:n?o=>n(o):Hv};return function(l){var u=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"number",s=arguments.length>2?arguments[2]:void 0;if(s!==void 0)throw new SyntaxError("numeric() takes one or two arguments");var c=tr(l);if(!(c in a))throw new TypeError("Cannot convert "+l+' of type "'+c+'"; valid input types are '+Object.keys(a).join(", "));if(!(u in i))throw new TypeError("Cannot convert "+l+' to type "'+u+'"; valid output types are '+Object.keys(i).join(", "));return u===c?l:i[u](l)}}),Ah="divideScalar",iB=["typed","numeric"],oB=P(Ah,iB,e=>{var{typed:r,numeric:t}=e;return r(Ah,{"number, number":function(a,i){return a/i},"Complex, Complex":function(a,i){return a.div(i)},"BigNumber, BigNumber":function(a,i){return a.div(i)},"bigint, bigint":function(a,i){return a/i},"Fraction, Fraction":function(a,i){return a.div(i)},"Unit, number | Complex | Fraction | BigNumber | Unit":(n,a)=>n.divide(a),"number | Fraction | Complex | BigNumber, Unit":(n,a)=>a.divideInto(n)})}),Eh="pow",sB=["typed","config","identity","multiply","matrix","inv","fraction","number","Complex"],uB=P(Eh,sB,e=>{var{typed:r,config:t,identity:n,multiply:a,matrix:i,inv:o,number:l,fraction:u,Complex:s}=e;return r(Eh,{"number, number":c,"Complex, Complex":function(v,h){return v.pow(h)},"BigNumber, BigNumber":function(v,h){return h.isInteger()||v>=0||t.predictable?v.pow(h):new s(v.toNumber(),0).pow(h.toNumber(),0)},"bigint, bigint":(p,v)=>p**v,"Fraction, Fraction":function(v,h){var w=v.pow(h);if(w!=null)return w;if(t.predictable)throw new Error("Result of pow is non-rational and cannot be expressed as a fraction");return c(v.valueOf(),h.valueOf())},"Array, number":f,"Array, BigNumber":function(v,h){return f(v,h.toNumber())},"Matrix, number":m,"Matrix, BigNumber":function(v,h){return m(v,h.toNumber())},"Unit, number | BigNumber":function(v,h){return v.pow(h)}});function c(p,v){if(t.predictable&&!Ce(v)&&p<0)try{var h=u(v),w=l(h);if((v===w||Math.abs((v-w)/v)<1e-14)&&h.d%2===1)return(h.n%2===0?1:-1)*Math.pow(-p,v)}catch{}return t.predictable&&(p<-1&&v===1/0||p>-1&&p<0&&v===-1/0)?NaN:Ce(v)||p>=0||t.predictable?jd(p,v):p*p<1&&v===1/0||p*p>1&&v===-1/0?0:new s(p,0).pow(v,0)}function f(p,v){if(!Ce(v))throw new TypeError("For A^b, b must be an integer (value is "+v+")");var h=$e(p);if(h.length!==2)throw new Error("For A^b, A must be 2 dimensional (A has "+h.length+" dimensions)");if(h[0]!==h[1])throw new Error("For A^b, A must be square (size is "+h[0]+"x"+h[1]+")");if(v<0)try{return f(o(p),-v)}catch(A){throw A.message==="Cannot calculate inverse, determinant is zero"?new TypeError("For A^b, when A is not invertible, b must be a positive integer (value is "+v+")"):A}for(var w=n(h[0]).valueOf(),b=p;v>=1;)(v&1)===1&&(w=a(b,w)),v>>=1,b=a(b,b);return w}function m(p,v){return i(f(p.valueOf(),v))}}),_a="Number of decimals in function round must be an integer",Dh="round",lB=["typed","config","matrix","equalScalar","zeros","BigNumber","DenseMatrix"],cB=P(Dh,lB,e=>{var{typed:r,config:t,matrix:n,equalScalar:a,zeros:i,BigNumber:o,DenseMatrix:l}=e,u=Tr({typed:r,equalScalar:a}),s=xr({typed:r,DenseMatrix:l}),c=wt({typed:r});function f(m){return Math.abs(ri(m).exponent)}return r(Dh,{number:function(p){var v=ai(p,f(t.relTol)),h=Mr(p,v,t.relTol,t.absTol)?v:p;return ai(h)},"number, number":function(p,v){var h=f(t.relTol);if(v>=h)return ai(p,v);var w=ai(p,h),b=Mr(p,w,t.relTol,t.absTol)?w:p;return ai(b,v)},"number, BigNumber":function(p,v){if(!v.isInteger())throw new TypeError(_a);return new o(p).toDecimalPlaces(v.toNumber())},Complex:function(p){return p.round()},"Complex, number":function(p,v){if(v%1)throw new TypeError(_a);return p.round(v)},"Complex, BigNumber":function(p,v){if(!v.isInteger())throw new TypeError(_a);var h=v.toNumber();return p.round(h)},BigNumber:function(p){var v=new o(p).toDecimalPlaces(f(t.relTol)),h=jr(p,v,t.relTol,t.absTol)?v:p;return h.toDecimalPlaces(0)},"BigNumber, BigNumber":function(p,v){if(!v.isInteger())throw new TypeError(_a);var h=f(t.relTol);if(v>=h)return p.toDecimalPlaces(v.toNumber());var w=p.toDecimalPlaces(h),b=jr(p,w,t.relTol,t.absTol)?w:p;return b.toDecimalPlaces(v.toNumber())},Fraction:function(p){return p.round()},"Fraction, number":function(p,v){if(v%1)throw new TypeError(_a);return p.round(v)},"Fraction, BigNumber":function(p,v){if(!v.isInteger())throw new TypeError(_a);return p.round(v.toNumber())},"Unit, number, Unit":r.referToSelf(m=>function(p,v,h){var w=p.toNumeric(h);return h.multiply(m(w,v))}),"Unit, BigNumber, Unit":r.referToSelf(m=>(p,v,h)=>m(p,v.toNumber(),h)),"Unit, Unit":r.referToSelf(m=>(p,v)=>m(p,0,v)),"Array | Matrix, number, Unit":r.referToSelf(m=>(p,v,h)=>Le(p,w=>m(w,v,h))),"Array | Matrix, BigNumber, Unit":r.referToSelf(m=>(p,v,h)=>m(p,v.toNumber(),h)),"Array | Matrix, Unit":r.referToSelf(m=>(p,v)=>m(p,0,v)),"Array | Matrix":r.referToSelf(m=>p=>Le(p,m)),"SparseMatrix, number | BigNumber":r.referToSelf(m=>(p,v)=>u(p,v,m,!1)),"DenseMatrix, number | BigNumber":r.referToSelf(m=>(p,v)=>c(p,v,m,!1)),"Array, number | BigNumber":r.referToSelf(m=>(p,v)=>c(n(p),v,m,!1).valueOf()),"number | Complex | BigNumber | Fraction, SparseMatrix":r.referToSelf(m=>(p,v)=>a(p,0)?i(v.size(),v.storage()):s(v,p,m,!0)),"number | Complex | BigNumber | Fraction, DenseMatrix":r.referToSelf(m=>(p,v)=>a(p,0)?i(v.size(),v.storage()):c(v,p,m,!0)),"number | Complex | BigNumber | Fraction, Array":r.referToSelf(m=>(p,v)=>c(n(v),p,m,!0).valueOf())})}),Sh="log",fB=["config","typed","divideScalar","Complex"],mB=P(Sh,fB,e=>{var{typed:r,config:t,divideScalar:n,Complex:a}=e;return r(Sh,{number:function(o){return o>=0||t.predictable?dM(o):new a(o,0).log()},Complex:function(o){return o.log()},BigNumber:function(o){return!o.isNegative()||t.predictable?o.ln():new a(o.toNumber(),0).log()},"any, any":r.referToSelf(i=>(o,l)=>n(i(o),i(l)))})}),Ch="log1p",dB=["typed","config","divideScalar","log","Complex"],pB=P(Ch,dB,e=>{var{typed:r,config:t,divideScalar:n,log:a,Complex:i}=e;return r(Ch,{number:function(u){return u>=-1||t.predictable?pS(u):o(new i(u,0))},Complex:o,BigNumber:function(u){var s=u.plus(1);return!s.isNegative()||t.predictable?s.ln():o(new i(u.toNumber(),0))},"Array | Matrix":r.referToSelf(l=>u=>Le(u,l)),"any, any":r.referToSelf(l=>(u,s)=>n(l(u),a(s)))});function o(l){var u=l.re+1;return new i(Math.log(Math.sqrt(u*u+l.im*l.im)),Math.atan2(l.im,u))}}),Mh="nthRoots",vB=["config","typed","divideScalar","Complex"],hB=P(Mh,vB,e=>{var{typed:r,config:t,divideScalar:n,Complex:a}=e,i=[function(u){return new a(u,0)},function(u){return new a(0,u)},function(u){return new a(-u,0)},function(u){return new a(0,-u)}];function o(l,u){if(u<0)throw new Error("Root must be greater than zero");if(u===0)throw new Error("Root must be non-zero");if(u%1!==0)throw new Error("Root must be an integer");if(l===0||l.abs()===0)return[new a(0,0)];var s=typeof l=="number",c;(s||l.re===0||l.im===0)&&(s?c=2*+(l<0):l.im===0?c=2*+(l.re<0):c=2*+(l.im<0)+1);for(var f=l.arg(),m=l.abs(),p=[],v=Math.pow(m,1/u),h=0;h{var{typed:r,equalScalar:t,matrix:n,pow:a,DenseMatrix:i,concat:o}=e,l=kr({typed:r}),u=Bt({typed:r,DenseMatrix:i}),s=Tr({typed:r,equalScalar:t}),c=xr({typed:r,DenseMatrix:i}),f=ar({typed:r,matrix:n,concat:o}),m={};for(var p in a.signatures)Object.prototype.hasOwnProperty.call(a.signatures,p)&&!p.includes("Matrix")&&!p.includes("Array")&&(m[p]=a.signatures[p]);var v=r(m);return r(_h,f({elop:v,SS:u,DS:l,Ss:s,sS:c}))}),Th="dotDivide",bB=["typed","matrix","equalScalar","divideScalar","DenseMatrix","concat"],wB=P(Th,bB,e=>{var{typed:r,matrix:t,equalScalar:n,divideScalar:a,DenseMatrix:i,concat:o}=e,l=xt({typed:r,equalScalar:n}),u=kr({typed:r}),s=Bt({typed:r,DenseMatrix:i}),c=Tr({typed:r,equalScalar:n}),f=xr({typed:r,DenseMatrix:i}),m=ar({typed:r,matrix:t,concat:o});return r(Th,m({elop:a,SS:s,DS:u,SD:l,Ss:c,sS:f}))});function si(e){var{DenseMatrix:r}=e;return function(n,a,i){var o=n.size();if(o.length!==2)throw new RangeError("Matrix must be two dimensional (size: "+Ve(o)+")");var l=o[0],u=o[1];if(l!==u)throw new RangeError("Matrix must be square (size: "+Ve(o)+")");var s=[];if(_e(a)){var c=a.size(),f=a._data;if(c.length===1){if(c[0]!==l)throw new RangeError("Dimension mismatch. Matrix columns must match vector length.");for(var m=0;m{var{typed:r,matrix:t,divideScalar:n,multiplyScalar:a,subtractScalar:i,equalScalar:o,DenseMatrix:l}=e,u=si({DenseMatrix:l});return r(Fh,{"SparseMatrix, Array | Matrix":function(m,p){return c(m,p)},"DenseMatrix, Array | Matrix":function(m,p){return s(m,p)},"Array, Array | Matrix":function(m,p){var v=t(m),h=s(v,p);return h.valueOf()}});function s(f,m){m=u(f,m,!0);for(var p=m._data,v=f._size[0],h=f._size[1],w=[],b=f._data,A=0;AN&&(D.push(w[_]),S.push(F))}if(o(y,0))throw new Error("Linear system cannot be solved since matrix is singular");for(var I=n(x,y),R=0,$=S.length;R<$;R++){var M=S[R];p[M]=[i(p[M][0]||0,a(I,D[R]))]}g[N]=[I]}}return new l({data:g,size:[v,1]})}}),Bh="usolve",AB=["typed","matrix","divideScalar","multiplyScalar","subtractScalar","equalScalar","DenseMatrix"],EB=P(Bh,AB,e=>{var{typed:r,matrix:t,divideScalar:n,multiplyScalar:a,subtractScalar:i,equalScalar:o,DenseMatrix:l}=e,u=si({DenseMatrix:l});return r(Bh,{"SparseMatrix, Array | Matrix":function(m,p){return c(m,p)},"DenseMatrix, Array | Matrix":function(m,p){return s(m,p)},"Array, Array | Matrix":function(m,p){var v=t(m),h=s(v,p);return h.valueOf()}});function s(f,m){m=u(f,m,!0);for(var p=m._data,v=f._size[0],h=f._size[1],w=[],b=f._data,A=h-1;A>=0;A--){var g=p[A][0]||0,N=void 0;if(o(g,0))N=0;else{var x=b[A][A];if(o(x,0))throw new Error("Linear system cannot be solved since matrix is singular");N=n(g,x);for(var y=A-1;y>=0;y--)p[y]=[i(p[y][0]||0,a(N,b[y][A]))]}w[A]=[N]}return new l({data:w,size:[v,1]})}function c(f,m){m=u(f,m,!0);for(var p=m._data,v=f._size[0],h=f._size[1],w=f._values,b=f._index,A=f._ptr,g=[],N=h-1;N>=0;N--){var x=p[N][0]||0;if(o(x,0))g[N]=[0];else{for(var y=0,D=[],S=[],E=A[N],C=A[N+1],_=C-1;_>=E;_--){var F=b[_];F===N?y=w[_]:F{var{typed:r,matrix:t,divideScalar:n,multiplyScalar:a,subtractScalar:i,equalScalar:o,DenseMatrix:l}=e,u=si({DenseMatrix:l});return r(Oh,{"SparseMatrix, Array | Matrix":function(m,p){return c(m,p)},"DenseMatrix, Array | Matrix":function(m,p){return s(m,p)},"Array, Array | Matrix":function(m,p){var v=t(m),h=s(v,p);return h.map(w=>w.valueOf())}});function s(f,m){for(var p=[u(f,m,!0)._data.map(S=>S[0])],v=f._data,h=f._size[0],w=f._size[1],b=0;bnew l({data:S.map(E=>[E]),size:[h,1]}))}function c(f,m){for(var p=[u(f,m,!0)._data.map(X=>X[0])],v=f._size[0],h=f._size[1],w=f._values,b=f._index,A=f._ptr,g=0;gg&&(D.push(w[F]),S.push(I))}if(o(_,0))if(o(y[g],0)){if(x===0){var T=[...y];T[g]=1;for(var k=0,O=S.length;knew l({data:X.map(U=>[U]),size:[v,1]}))}}),$h="usolveAll",CB=["typed","matrix","divideScalar","multiplyScalar","subtractScalar","equalScalar","DenseMatrix"],MB=P($h,CB,e=>{var{typed:r,matrix:t,divideScalar:n,multiplyScalar:a,subtractScalar:i,equalScalar:o,DenseMatrix:l}=e,u=si({DenseMatrix:l});return r($h,{"SparseMatrix, Array | Matrix":function(m,p){return c(m,p)},"DenseMatrix, Array | Matrix":function(m,p){return s(m,p)},"Array, Array | Matrix":function(m,p){var v=t(m),h=s(v,p);return h.map(w=>w.valueOf())}});function s(f,m){for(var p=[u(f,m,!0)._data.map(S=>S[0])],v=f._data,h=f._size[0],w=f._size[1],b=w-1;b>=0;b--)for(var A=p.length,g=0;g=0;D--)y[D]=i(y[D],v[D][b]);p.push(y)}}else{if(g===0)return[];p.splice(g,1),g-=1,A-=1}else{N[b]=n(N[b],v[b][b]);for(var x=b-1;x>=0;x--)N[x]=i(N[x],a(N[b],v[x][b]))}}return p.map(S=>new l({data:S.map(E=>[E]),size:[h,1]}))}function c(f,m){for(var p=[u(f,m,!0)._data.map(X=>X[0])],v=f._size[0],h=f._size[1],w=f._values,b=f._index,A=f._ptr,g=h-1;g>=0;g--)for(var N=p.length,x=0;x=E;F--){var I=b[F];I===g?_=w[F]:Inew l({data:X.map(U=>[U]),size:[v,1]}))}}),_B="matAlgo08xS0Sid",TB=["typed","equalScalar"],Gu=P(_B,TB,e=>{var{typed:r,equalScalar:t}=e;return function(a,i,o){var l=a._values,u=a._index,s=a._ptr,c=a._size,f=a._datatype||a._data===void 0?a._datatype:a.getDataType(),m=i._values,p=i._index,v=i._ptr,h=i._size,w=i._datatype||i._data===void 0?i._datatype:i.getDataType();if(c.length!==h.length)throw new qe(c.length,h.length);if(c[0]!==h[0]||c[1]!==h[1])throw new RangeError("Dimension mismatch. Matrix A ("+c+") must match Matrix B ("+h+")");if(!l||!m)throw new Error("Cannot perform operation on Pattern Sparse Matrices");var b=c[0],A=c[1],g,N=t,x=0,y=o;typeof f=="string"&&f===w&&f!=="mixed"&&(g=f,N=r.find(t,[g,g]),x=r.convert(0,g),y=r.find(o,[g,g]));for(var D=[],S=[],E=[],C=[],_=[],F,I,R,$,M=0;M{var{typed:r,matrix:t}=e;return{"Array, number":r.referTo("DenseMatrix, number",n=>(a,i)=>n(t(a),i).valueOf()),"Array, BigNumber":r.referTo("DenseMatrix, BigNumber",n=>(a,i)=>n(t(a),i).valueOf()),"number, Array":r.referTo("number, DenseMatrix",n=>(a,i)=>n(a,t(i)).valueOf()),"BigNumber, Array":r.referTo("BigNumber, DenseMatrix",n=>(a,i)=>n(a,t(i)).valueOf())}}),Ih="leftShift",FB=["typed","matrix","equalScalar","zeros","DenseMatrix","concat"],BB=P(Ih,FB,e=>{var{typed:r,matrix:t,equalScalar:n,zeros:a,DenseMatrix:i,concat:o}=e,l=wn({typed:r}),u=xt({typed:r,equalScalar:n}),s=Gu({typed:r,equalScalar:n}),c=Hn({typed:r,DenseMatrix:i}),f=Tr({typed:r,equalScalar:n}),m=wt({typed:r}),p=ar({typed:r,matrix:t,concat:o}),v=Wu({typed:r,matrix:t});return r(Ih,{"number, number":Qd,"BigNumber, BigNumber":tT,"bigint, bigint":(h,w)=>h<(w,b)=>n(b,0)?w.clone():f(w,b,h,!1)),"DenseMatrix, number | BigNumber":r.referToSelf(h=>(w,b)=>n(b,0)?w.clone():m(w,b,h,!1)),"number | BigNumber, SparseMatrix":r.referToSelf(h=>(w,b)=>n(w,0)?a(b.size(),b.storage()):c(b,w,h,!0)),"number | BigNumber, DenseMatrix":r.referToSelf(h=>(w,b)=>n(w,0)?a(b.size(),b.storage()):m(b,w,h,!0))},v,p({SS:s,DS:l,SD:u}))}),Rh="rightArithShift",OB=["typed","matrix","equalScalar","zeros","DenseMatrix","concat"],$B=P(Rh,OB,e=>{var{typed:r,matrix:t,equalScalar:n,zeros:a,DenseMatrix:i,concat:o}=e,l=wn({typed:r}),u=xt({typed:r,equalScalar:n}),s=Gu({typed:r,equalScalar:n}),c=Hn({typed:r,DenseMatrix:i}),f=Tr({typed:r,equalScalar:n}),m=wt({typed:r}),p=ar({typed:r,matrix:t,concat:o}),v=Wu({typed:r,matrix:t});return r(Rh,{"number, number":ep,"BigNumber, BigNumber":nT,"bigint, bigint":(h,w)=>h>>w,"SparseMatrix, number | BigNumber":r.referToSelf(h=>(w,b)=>n(b,0)?w.clone():f(w,b,h,!1)),"DenseMatrix, number | BigNumber":r.referToSelf(h=>(w,b)=>n(b,0)?w.clone():m(w,b,h,!1)),"number | BigNumber, SparseMatrix":r.referToSelf(h=>(w,b)=>n(w,0)?a(b.size(),b.storage()):c(b,w,h,!0)),"number | BigNumber, DenseMatrix":r.referToSelf(h=>(w,b)=>n(w,0)?a(b.size(),b.storage()):m(b,w,h,!0))},v,p({SS:s,DS:l,SD:u}))}),zh="rightLogShift",IB=["typed","matrix","equalScalar","zeros","DenseMatrix","concat"],RB=P(zh,IB,e=>{var{typed:r,matrix:t,equalScalar:n,zeros:a,DenseMatrix:i,concat:o}=e,l=wn({typed:r}),u=xt({typed:r,equalScalar:n}),s=Gu({typed:r,equalScalar:n}),c=Hn({typed:r,DenseMatrix:i}),f=Tr({typed:r,equalScalar:n}),m=wt({typed:r}),p=ar({typed:r,matrix:t,concat:o}),v=Wu({typed:r,matrix:t});return r(zh,{"number, number":rp,"SparseMatrix, number | BigNumber":r.referToSelf(h=>(w,b)=>n(b,0)?w.clone():f(w,b,h,!1)),"DenseMatrix, number | BigNumber":r.referToSelf(h=>(w,b)=>n(b,0)?w.clone():m(w,b,h,!1)),"number | BigNumber, SparseMatrix":r.referToSelf(h=>(w,b)=>n(w,0)?a(b.size(),b.storage()):c(b,w,h,!0)),"number | BigNumber, DenseMatrix":r.referToSelf(h=>(w,b)=>n(w,0)?a(b.size(),b.storage()):m(b,w,h,!0))},v,p({SS:s,DS:l,SD:u}))}),Ph="and",zB=["typed","matrix","equalScalar","zeros","not","concat"],kh=P(Ph,zB,e=>{var{typed:r,matrix:t,equalScalar:n,zeros:a,not:i,concat:o}=e,l=xt({typed:r,equalScalar:n}),u=Eo({typed:r,equalScalar:n}),s=Tr({typed:r,equalScalar:n}),c=wt({typed:r}),f=ar({typed:r,matrix:t,concat:o});return r(Ph,{"number, number":$u,"Complex, Complex":function(p,v){return(p.re!==0||p.im!==0)&&(v.re!==0||v.im!==0)},"BigNumber, BigNumber":function(p,v){return!p.isZero()&&!v.isZero()&&!p.isNaN()&&!v.isNaN()},"bigint, bigint":$u,"Unit, Unit":r.referToSelf(m=>(p,v)=>m(p.value||0,v.value||0)),"SparseMatrix, any":r.referToSelf(m=>(p,v)=>i(v)?a(p.size(),p.storage()):s(p,v,m,!1)),"DenseMatrix, any":r.referToSelf(m=>(p,v)=>i(v)?a(p.size(),p.storage()):c(p,v,m,!1)),"any, SparseMatrix":r.referToSelf(m=>(p,v)=>i(p)?a(p.size(),p.storage()):s(v,p,m,!0)),"any, DenseMatrix":r.referToSelf(m=>(p,v)=>i(p)?a(p.size(),p.storage()):c(v,p,m,!0)),"Array, any":r.referToSelf(m=>(p,v)=>m(t(p),v).valueOf()),"any, Array":r.referToSelf(m=>(p,v)=>m(p,t(v)).valueOf())},f({SS:u,DS:l}))}),So="compare",PB=["typed","config","matrix","equalScalar","BigNumber","Fraction","DenseMatrix","concat"],kB=P(So,PB,e=>{var{typed:r,config:t,equalScalar:n,matrix:a,BigNumber:i,Fraction:o,DenseMatrix:l,concat:u}=e,s=kr({typed:r}),c=Ao({typed:r,equalScalar:n}),f=xr({typed:r,DenseMatrix:l}),m=ar({typed:r,matrix:a,concat:u}),p=Ca({typed:r});return r(So,qB({typed:r,config:t}),{"boolean, boolean":function(h,w){return h===w?0:h>w?1:-1},"BigNumber, BigNumber":function(h,w){return jr(h,w,t.relTol,t.absTol)?new i(0):new i(h.cmp(w))},"bigint, bigint":function(h,w){return h===w?0n:h>w?1n:-1n},"Fraction, Fraction":function(h,w){return new o(h.compare(w))},"Complex, Complex":function(){throw new TypeError("No ordering relation is defined for complex numbers")}},p,m({SS:c,DS:s,Ss:f}))}),qB=P(So,["typed","config"],e=>{var{typed:r,config:t}=e;return r(So,{"number, number":function(a,i){return Mr(a,i,t.relTol,t.absTol)?0:a>i?1:-1}})}),LB=function e(r,t){var n=/(^([+\-]?(?:0|[1-9]\d*)(?:\.\d*)?(?:[eE][+\-]?\d+)?)?$|^0x[0-9a-f]+$|\d+)/gi,a=/(^[ ]*|[ ]*$)/g,i=/(^([\w ]+,?[\w ]+)?[\w ]+,?[\w ]+\d+:\d+(:\d+)?[\w ]?|^\d{1,4}[\/\-]\d{1,4}[\/\-]\d{1,4}|^\w+, \w+ \d+, \d{4})/,o=/^0x[0-9a-f]+$/i,l=/^0/,u=function(g){return e.insensitive&&(""+g).toLowerCase()||""+g},s=u(r).replace(a,"")||"",c=u(t).replace(a,"")||"",f=s.replace(n,"\0$1\0").replace(/\0$/,"").replace(/^\0/,"").split("\0"),m=c.replace(n,"\0$1\0").replace(/\0$/,"").replace(/^\0/,"").split("\0"),p=parseInt(s.match(o),16)||f.length!==1&&s.match(i)&&Date.parse(s),v=parseInt(c.match(o),16)||p&&c.match(i)&&Date.parse(c)||null,h,w;if(v){if(pv)return 1}for(var b=0,A=Math.max(f.length,m.length);bw)return 1}return 0};const Ta=Zi(LB);var qh="compareNatural",VB=["typed","compare"],UB=P(qh,VB,e=>{var{typed:r,compare:t}=e,n=t.signatures["boolean,boolean"];return r(qh,{"any, any":a});function a(u,s){var c=tr(u),f=tr(s),m;if((c==="number"||c==="BigNumber"||c==="Fraction")&&(f==="number"||f==="BigNumber"||f==="Fraction"))return m=t(u,s),m.toString()!=="0"?m>0?1:-1:Ta(c,f);var p=["Array","DenseMatrix","SparseMatrix"];if(p.includes(c)||p.includes(f))return m=i(a,u,s),m!==0?m:Ta(c,f);if(c!==f)return Ta(c,f);if(c==="Complex")return HB(u,s);if(c==="Unit")return u.equalBase(s)?a(u.value,s.value):o(a,u.formatUnits(),s.formatUnits());if(c==="boolean")return n(u,s);if(c==="string")return Ta(u,s);if(c==="Object")return l(a,u,s);if(c==="null"||c==="undefined")return 0;throw new TypeError('Unsupported type of value "'+c+'"')}function i(u,s,c){return cn(s)&&cn(c)?o(u,s.toJSON().values,c.toJSON().values):cn(s)?i(u,s.toArray(),c):cn(c)?i(u,s,c.toArray()):Ja(s)?i(u,s.toJSON().data,c):Ja(c)?i(u,s,c.toJSON().data):Array.isArray(s)?Array.isArray(c)?o(u,s,c):i(u,s,[c]):i(u,[s],c)}function o(u,s,c){for(var f=0,m=Math.min(s.length,c.length);fc.length?1:s.lengthr.re?1:e.rer.im?1:e.im{var{typed:r,matrix:t,concat:n}=e,a=ar({typed:r,matrix:t,concat:n});return r(Lh,Au,a({elop:Au,Ds:!0}))}),Co="equal",WB=["typed","matrix","equalScalar","DenseMatrix","concat"],jB=P(Co,WB,e=>{var{typed:r,matrix:t,equalScalar:n,DenseMatrix:a,concat:i}=e,o=kr({typed:r}),l=Bt({typed:r,DenseMatrix:a}),u=xr({typed:r,DenseMatrix:a}),s=ar({typed:r,matrix:t,concat:i});return r(Co,KB({typed:r,equalScalar:n}),s({elop:n,SS:l,DS:o,Ss:u}))}),KB=P(Co,["typed","equalScalar"],e=>{var{typed:r,equalScalar:t}=e;return r(Co,{"any, any":function(a,i){return a===null?i===null:i===null?a===null:a===void 0?i===void 0:i===void 0?a===void 0:t(a,i)}})}),Vh="equalText",JB=["typed","compareText","isZero"],YB=P(Vh,JB,e=>{var{typed:r,compareText:t,isZero:n}=e;return r(Vh,{"any, any":function(i,o){return n(t(i,o))}})}),Mo="smaller",XB=["typed","config","matrix","DenseMatrix","concat"],QB=P(Mo,XB,e=>{var{typed:r,config:t,matrix:n,DenseMatrix:a,concat:i}=e,o=kr({typed:r}),l=Bt({typed:r,DenseMatrix:a}),u=xr({typed:r,DenseMatrix:a}),s=ar({typed:r,matrix:n,concat:i}),c=Ca({typed:r});return r(Mo,e4({typed:r,config:t}),{"boolean, boolean":(f,m)=>fff.compare(m)===-1,"Complex, Complex":function(m,p){throw new TypeError("No ordering relation is defined for complex numbers")}},c,s({SS:l,DS:o,Ss:u}))}),e4=P(Mo,["typed","config"],e=>{var{typed:r,config:t}=e;return r(Mo,{"number, number":function(a,i){return a{var{typed:r,config:t,matrix:n,DenseMatrix:a,concat:i}=e,o=kr({typed:r}),l=Bt({typed:r,DenseMatrix:a}),u=xr({typed:r,DenseMatrix:a}),s=ar({typed:r,matrix:n,concat:i}),c=Ca({typed:r});return r(_o,n4({typed:r,config:t}),{"boolean, boolean":(f,m)=>f<=m,"BigNumber, BigNumber":function(m,p){return m.lte(p)||jr(m,p,t.relTol,t.absTol)},"bigint, bigint":(f,m)=>f<=m,"Fraction, Fraction":(f,m)=>f.compare(m)!==1,"Complex, Complex":function(){throw new TypeError("No ordering relation is defined for complex numbers")}},c,s({SS:l,DS:o,Ss:u}))}),n4=P(_o,["typed","config"],e=>{var{typed:r,config:t}=e;return r(_o,{"number, number":function(a,i){return a<=i||Mr(a,i,t.relTol,t.absTol)}})}),To="larger",a4=["typed","config","matrix","DenseMatrix","concat"],i4=P(To,a4,e=>{var{typed:r,config:t,matrix:n,DenseMatrix:a,concat:i}=e,o=kr({typed:r}),l=Bt({typed:r,DenseMatrix:a}),u=xr({typed:r,DenseMatrix:a}),s=ar({typed:r,matrix:n,concat:i}),c=Ca({typed:r});return r(To,o4({typed:r,config:t}),{"boolean, boolean":(f,m)=>f>m,"BigNumber, BigNumber":function(m,p){return m.gt(p)&&!jr(m,p,t.relTol,t.absTol)},"bigint, bigint":(f,m)=>f>m,"Fraction, Fraction":(f,m)=>f.compare(m)===1,"Complex, Complex":function(){throw new TypeError("No ordering relation is defined for complex numbers")}},c,s({SS:l,DS:o,Ss:u}))}),o4=P(To,["typed","config"],e=>{var{typed:r,config:t}=e;return r(To,{"number, number":function(a,i){return a>i&&!Mr(a,i,t.relTol,t.absTol)}})}),Fo="largerEq",s4=["typed","config","matrix","DenseMatrix","concat"],u4=P(Fo,s4,e=>{var{typed:r,config:t,matrix:n,DenseMatrix:a,concat:i}=e,o=kr({typed:r}),l=Bt({typed:r,DenseMatrix:a}),u=xr({typed:r,DenseMatrix:a}),s=ar({typed:r,matrix:n,concat:i}),c=Ca({typed:r});return r(Fo,l4({typed:r,config:t}),{"boolean, boolean":(f,m)=>f>=m,"BigNumber, BigNumber":function(m,p){return m.gte(p)||jr(m,p,t.relTol,t.absTol)},"bigint, bigint":function(m,p){return m>=p},"Fraction, Fraction":(f,m)=>f.compare(m)!==-1,"Complex, Complex":function(){throw new TypeError("No ordering relation is defined for complex numbers")}},c,s({SS:l,DS:o,Ss:u}))}),l4=P(Fo,["typed","config"],e=>{var{typed:r,config:t}=e;return r(Fo,{"number, number":function(a,i){return a>=i||Mr(a,i,t.relTol,t.absTol)}})}),Uh="deepEqual",c4=["typed","equal"],f4=P(Uh,c4,e=>{var{typed:r,equal:t}=e;return r(Uh,{"any, any":function(i,o){return n(i.valueOf(),o.valueOf())}});function n(a,i){if(Array.isArray(a))if(Array.isArray(i)){var o=a.length;if(o!==i.length)return!1;for(var l=0;l{var{typed:r,config:t,equalScalar:n,matrix:a,DenseMatrix:i,concat:o}=e,l=kr({typed:r}),u=Bt({typed:r,DenseMatrix:i}),s=xr({typed:r,DenseMatrix:i}),c=ar({typed:r,matrix:a,concat:o});return r(Bo,p4({typed:r,equalScalar:n}),c({elop:f,SS:u,DS:l,Ss:s}));function f(m,p){return!n(m,p)}}),p4=P(Bo,["typed","equalScalar"],e=>{var{typed:r,equalScalar:t}=e;return r(Bo,{"any, any":function(a,i){return a===null?i!==null:i===null?a!==null:a===void 0?i!==void 0:i===void 0?a!==void 0:!t(a,i)}})}),Hh="partitionSelect",v4=["typed","isNumeric","isNaN","compare"],h4=P(Hh,v4,e=>{var{typed:r,isNumeric:t,isNaN:n,compare:a}=e,i=a,o=(s,c)=>-a(s,c);return r(Hh,{"Array | Matrix, number":function(c,f){return l(c,f,i)},"Array | Matrix, number, string":function(c,f,m){if(m==="asc")return l(c,f,i);if(m==="desc")return l(c,f,o);throw new Error('Compare string must be "asc" or "desc"')},"Array | Matrix, number, function":l});function l(s,c,f){if(!Ce(c)||c<0)throw new Error("k must be a non-negative integer");if(_e(s)){var m=s.size();if(m.length>1)throw new Error("Only one dimensional matrices supported");return u(s.valueOf(),c,f)}if(Array.isArray(s))return u(s,c,f)}function u(s,c,f){if(c>=s.length)throw new Error("k out of bounds");for(var m=0;m=0){var A=s[w];s[w]=s[h],s[h]=A,--w}else++h;f(s[h],b)>0&&--h,c<=h?v=h:p=h+1}return s[c]}}),Zh="sort",g4=["typed","matrix","compare","compareNatural"],y4=P(Zh,g4,e=>{var{typed:r,matrix:t,compare:n,compareNatural:a}=e,i=n,o=(c,f)=>-n(c,f);return r(Zh,{Array:function(f){return u(f),f.sort(i)},Matrix:function(f){return s(f),t(f.toArray().sort(i),f.storage())},"Array, function":function(f,m){return u(f),f.sort(m)},"Matrix, function":function(f,m){return s(f),t(f.toArray().sort(m),f.storage())},"Array, string":function(f,m){return u(f),f.sort(l(m))},"Matrix, string":function(f,m){return s(f),t(f.toArray().sort(l(m)),f.storage())}});function l(c){if(c==="asc")return i;if(c==="desc")return o;if(c==="natural")return a;throw new Error('String "asc", "desc", or "natural" expected')}function u(c){if($e(c).length!==1)throw new Error("One dimensional array expected")}function s(c){if(c.size().length!==1)throw new Error("One dimensional matrix expected")}}),Gh="max",b4=["typed","config","numeric","larger"],Wh=P(Gh,b4,e=>{var{typed:r,config:t,numeric:n,larger:a}=e;return r(Gh,{"Array | Matrix":o,"Array | Matrix, number | BigNumber":function(u,s){return go(u,s.valueOf(),i)},"...":function(u){if(Aa(u))throw new TypeError("Scalar values expected in function max");return o(u)}});function i(l,u){try{return a(l,u)?l:u}catch(s){throw qr(s,"max",u)}}function o(l){var u;if(Jt(l,function(s){try{isNaN(s)&&typeof s=="number"?u=NaN:(u===void 0||a(s,u))&&(u=s)}catch(c){throw qr(c,"max",s)}}),u===void 0)throw new Error("Cannot calculate max of an empty array");return typeof u=="string"&&(u=n(u,mn(u,t))),u}}),jh="min",w4=["typed","config","numeric","smaller"],Kh=P(jh,w4,e=>{var{typed:r,config:t,numeric:n,smaller:a}=e;return r(jh,{"Array | Matrix":o,"Array | Matrix, number | BigNumber":function(u,s){return go(u,s.valueOf(),i)},"...":function(u){if(Aa(u))throw new TypeError("Scalar values expected in function min");return o(u)}});function i(l,u){try{return a(l,u)?l:u}catch(s){throw qr(s,"min",u)}}function o(l){var u;if(Jt(l,function(s){try{isNaN(s)&&typeof s=="number"?u=NaN:(u===void 0||a(s,u))&&(u=s)}catch(c){throw qr(c,"min",s)}}),u===void 0)throw new Error("Cannot calculate min of an empty array");return typeof u=="string"&&(u=n(u,mn(u,t))),u}}),x4="ImmutableDenseMatrix",N4=["smaller","DenseMatrix"],A4=P(x4,N4,e=>{var{smaller:r,DenseMatrix:t}=e;function n(a,i){if(!(this instanceof n))throw new SyntaxError("Constructor must be called with the new operator");if(i&&!Cr(i))throw new Error("Invalid datatype: "+i);if(_e(a)||Xe(a)){var o=new t(a,i);this._data=o._data,this._size=o._size,this._datatype=o._datatype,this._min=null,this._max=null}else if(a&&Xe(a.data)&&Xe(a.size))this._data=a.data,this._size=a.size,this._datatype=a.datatype,this._min=typeof a.min<"u"?a.min:null,this._max=typeof a.max<"u"?a.max:null;else{if(a)throw new TypeError("Unsupported type of data ("+tr(a)+")");this._data=[],this._size=[0],this._datatype=i,this._min=null,this._max=null}}return n.prototype=new t,n.prototype.type="ImmutableDenseMatrix",n.prototype.isImmutableDenseMatrix=!0,n.prototype.subset=function(a){switch(arguments.length){case 1:{var i=t.prototype.subset.call(this,a);return _e(i)?new n({data:i._data,size:i._size,datatype:i._datatype}):i}case 2:case 3:throw new Error("Cannot invoke set subset on an Immutable Matrix instance");default:throw new SyntaxError("Wrong number of arguments")}},n.prototype.set=function(){throw new Error("Cannot invoke set on an Immutable Matrix instance")},n.prototype.resize=function(){throw new Error("Cannot invoke resize on an Immutable Matrix instance")},n.prototype.reshape=function(){throw new Error("Cannot invoke reshape on an Immutable Matrix instance")},n.prototype.clone=function(){return new n({data:Fe(this._data),size:Fe(this._size),datatype:this._datatype})},n.prototype.toJSON=function(){return{mathjs:"ImmutableDenseMatrix",data:this._data,size:this._size,datatype:this._datatype}},n.fromJSON=function(a){return new n(a)},n.prototype.swapRows=function(){throw new Error("Cannot invoke swapRows on an Immutable Matrix instance")},n.prototype.min=function(){if(this._min===null){var a=null;this.forEach(function(i){(a===null||r(i,a))&&(a=i)}),this._min=a!==null?a:void 0}return this._min},n.prototype.max=function(){if(this._max===null){var a=null;this.forEach(function(i){(a===null||r(a,i))&&(a=i)}),this._max=a!==null?a:void 0}return this._max},n},{isClass:!0}),E4="Index",D4=["ImmutableDenseMatrix","getMatrixDataType"],S4=P(E4,D4,e=>{var{ImmutableDenseMatrix:r,getMatrixDataType:t}=e;function n(i){if(!(this instanceof n))throw new SyntaxError("Constructor must be called with the new operator");this._dimensions=[],this._sourceSize=[],this._isScalar=!0;for(var o=0,l=arguments.length;o{t&&r.push(n)}),r}var C4="FibonacciHeap",M4=["smaller","larger"],_4=P(C4,M4,e=>{var{smaller:r,larger:t}=e,n=1/Math.log((1+Math.sqrt(5))/2);function a(){if(!(this instanceof a))throw new SyntaxError("Constructor must be called with the new operator");this._minimum=null,this._size=0}a.prototype.type="FibonacciHeap",a.prototype.isFibonacciHeap=!0,a.prototype.insert=function(c,f){var m={key:c,value:f,degree:0};if(this._minimum){var p=this._minimum;m.left=p,m.right=p.right,p.right=m,m.right.left=m,r(c,p.key)&&(this._minimum=m)}else m.left=m,m.right=m,this._minimum=m;return this._size++,m},a.prototype.size=function(){return this._size},a.prototype.clear=function(){this._minimum=null,this._size=0},a.prototype.isEmpty=function(){return this._size===0},a.prototype.extractMinimum=function(){var c=this._minimum;if(c===null)return c;for(var f=this._minimum,m=c.degree,p=c.child;m>0;){var v=p.right;p.left.right=p.right,p.right.left=p.left,p.left=f,p.right=f.right,f.right=p,p.right.left=p,p.parent=null,p=v,m--}return c.left.right=c.right,c.right.left=c.left,c===c.right?f=null:(f=c.right,f=s(f,this._size)),this._size--,this._minimum=f,c},a.prototype.remove=function(c){this._minimum=i(this._minimum,c,-1),this.extractMinimum()};function i(c,f,m){f.key=m;var p=f.parent;return p&&r(f.key,p.key)&&(o(c,f,p),l(c,p)),r(f.key,c.key)&&(c=f),c}function o(c,f,m){f.left.right=f.right,f.right.left=f.left,m.degree--,m.child===f&&(m.child=f.right),m.degree===0&&(m.child=null),f.left=c,f.right=c.right,c.right=f,f.right.left=f,f.parent=null,f.mark=!1}function l(c,f){var m=f.parent;m&&(f.mark?(o(c,f,m),l(m)):f.mark=!0)}var u=function(f,m){f.left.right=f.right,f.right.left=f.left,f.parent=m,m.child?(f.left=m.child,f.right=m.child.right,m.child.right=f,f.right.left=f):(m.child=f,f.right=f,f.left=f),m.degree++,f.mark=!1};function s(c,f){var m=Math.floor(Math.log(f)*n)+1,p=new Array(m),v=0,h=c;if(h)for(v++,h=h.right;h!==c;)v++,h=h.right;for(var w;v>0;){for(var b=h.degree,A=h.right;w=p[b],!!w;){if(t(h.key,w.key)){var g=w;w=h,h=g}u(w,h),p[b]=null,b++}p[b]=h,h=A,v--}c=null;for(var N=0;N{var{addScalar:r,equalScalar:t,FibonacciHeap:n}=e;function a(){if(!(this instanceof a))throw new SyntaxError("Constructor must be called with the new operator");this._values=[],this._heap=new n}return a.prototype.type="Spa",a.prototype.isSpa=!0,a.prototype.set=function(i,o){if(this._values[i])this._values[i].value=o;else{var l=this._heap.insert(i,o);this._values[i]=l}},a.prototype.get=function(i){var o=this._values[i];return o?o.value:0},a.prototype.accumulate=function(i,o){var l=this._values[i];l?l.value=r(l.value,o):(l=this._heap.insert(i,o),this._values[i]=l)},a.prototype.forEach=function(i,o,l){var u=this._heap,s=this._values,c=[],f=u.extractMinimum();for(f&&c.push(f);f&&f.key<=o;)f.key>=i&&(t(f.value,0)||l(f.key,f.value,this)),f=u.extractMinimum(),f&&c.push(f);for(var m=0;m1&&arguments[1]!==void 0?arguments[1]:{};return t=t??Number.POSITIVE_INFINITY,r=r??JSON.stringify,function n(){typeof n.cache!="object"&&(n.cache={values:new Map,lru:O4(t||Number.POSITIVE_INFINITY)});for(var a=[],i=0;i{var{on:r,config:t,addScalar:n,subtractScalar:a,multiplyScalar:i,divideScalar:o,pow:l,abs:u,fix:s,round:c,equal:f,isNumeric:m,format:p,number:v,Complex:h,BigNumber:w,Fraction:b}=e,A=v;function g(L,H){if(!(this instanceof g))throw new Error("Constructor must be called with the new operator");if(!(L==null||m(L)||gt(L)))throw new TypeError("First parameter in Unit constructor must be number, BigNumber, Fraction, Complex, or undefined");if(this.fixPrefix=!1,this.skipAutomaticSimplification=!0,H===void 0)this.units=[],this.dimensions=k.map(ie=>0);else if(typeof H=="string"){var ne=g.parse(H);this.units=ne.units,this.dimensions=ne.dimensions}else if(Gr(H)&&H.value===null)this.fixPrefix=H.fixPrefix,this.skipAutomaticSimplification=H.skipAutomaticSimplification,this.dimensions=H.dimensions.slice(0),this.units=H.units.map(ie=>Br({},ie));else throw new TypeError("Second parameter in Unit constructor must be a string or valueless Unit");this.value=this._normalize(L)}Object.defineProperty(g,"name",{value:"Unit"}),g.prototype.constructor=g,g.prototype.type="Unit",g.prototype.isUnit=!0;var N,x,y;function D(){for(;y===" "||y===" ";)C()}function S(L){return L>="0"&&L<="9"||L==="."}function E(L){return L>="0"&&L<="9"}function C(){x++,y=N.charAt(x)}function _(L){x=L,y=N.charAt(x)}function F(){var L="",H=x;if(y==="+"?C():y==="-"&&(L+=y,C()),!S(y))return _(H),null;if(y==="."){if(L+=y,C(),!E(y))return _(H),null}else{for(;E(y);)L+=y,C();y==="."&&(L+=y,C())}for(;E(y);)L+=y,C();if(y==="E"||y==="e"){var ne="",ie=x;if(ne+=y,C(),(y==="+"||y==="-")&&(ne+=y,C()),!E(y))return _(ie),L;for(L=L+ne;E(y);)L+=y,C()}return L}function I(){for(var L="";E(y)||g.isValidAlpha(y);)L+=y,C();var H=L.charAt(0);return g.isValidAlpha(H)?L:null}function R(L){return y===L?(C(),L):null}g.parse=function(L,H){if(H=H||{},N=L,x=-1,y="",typeof N!="string")throw new TypeError("Invalid argument in Unit.parse, string expected");var ne=new g;ne.units=[];var ie=1,de=!1;C(),D();var me=F(),be=null;if(me){if(t.number==="BigNumber")be=new w(me);else if(t.number==="Fraction")try{be=new b(me)}catch{be=parseFloat(me)}else be=parseFloat(me);D(),R("*")?(ie=1,de=!0):R("/")&&(ie=-1,de=!0)}for(var Ne=[],V=1;;){for(D();y==="(";)Ne.push(ie),V*=ie,ie=1,C(),D();var K=void 0;if(y){var G=y;if(K=I(),K===null)throw new SyntaxError('Unexpected "'+G+'" in "'+N+'" at index '+x.toString())}else break;var ae=$(K);if(ae===null)throw new SyntaxError('Unit "'+K+'" not found.');var ce=ie*V;if(D(),R("^")){D();var fe=F();if(fe===null)throw new SyntaxError('In "'+L+'", "^" must be followed by a floating-point number');ce*=fe}ne.units.push({unit:ae.unit,prefix:ae.prefix,power:ce});for(var xe=0;xe1||Math.abs(this.units[0].power-1)>1e-15},g.prototype._normalize=function(L){if(L==null||this.units.length===0)return L;for(var H=L,ne=g._getNumberConverter(tr(L)),ie=0;ie{if(De(z,L)){var H=z[L],ne=H.prefixes[""];return{unit:H,prefix:ne}}for(var ie in z)if(De(z,ie)&&YC(L,ie)){var de=z[ie],me=L.length-ie.length,be=L.substring(0,me),Ne=De(de.prefixes,be)?de.prefixes[be]:void 0;if(Ne!==void 0)return{unit:de,prefix:Ne}}return null},{hasher:L=>L[0],limit:100});g.isValuelessUnit=function(L){return $(L)!==null},g.prototype.hasBase=function(L){if(typeof L=="string"&&(L=O[L]),!L)return!1;for(var H=0;H1e-12)return!1;return!0},g.prototype.equalBase=function(L){for(var H=0;H1e-12)return!1;return!0},g.prototype.equals=function(L){return this.equalBase(L)&&f(this.value,L.value)},g.prototype.multiply=function(L){for(var H=this.clone(),ne=Gr(L)?L:new g(L),ie=0;ie0?this.formatUnits():null,fixPrefix:this.fixPrefix}},g.fromJSON=function(L){var H,ne=new g(L.value,(H=L.unit)!==null&&H!==void 0?H:void 0);return ne.fixPrefix=L.fixPrefix||!1,ne},g.prototype.valueOf=g.prototype.toString,g.prototype.simplify=function(){var L=this.clone(),H=[],ne;for(var ie in q)if(De(q,ie)&&L.hasBase(O[ie])){ne=ie;break}if(ne==="NONE")L.units=[];else{var de;if(ne&&De(q,ne)&&(de=q[ne]),de)L.units=[{unit:de.unit,prefix:de.prefix,power:1}];else{for(var me=!1,be=0;be1e-12&&(De(q,Ne)?H.push({unit:q[Ne].unit,prefix:q[Ne].prefix,power:L.dimensions[be]||0}):me=!0)}H.length1e-12)if(De(re.si,ie))H.push({unit:re.si[ie].unit,prefix:re.si[ie].prefix,power:L.dimensions[ne]||0});else throw new Error("Cannot express custom unit "+ie+" in SI units")}return L.units=H,L.fixPrefix=!0,L.skipAutomaticSimplification=!0,this.value!==null?(L.value=null,this.to(L)):L},g.prototype.formatUnits=function(){for(var L="",H="",ne=0,ie=0,de=0;de0?(ne++,L+=" "+this.units[de].prefix.name+this.units[de].unit.name,Math.abs(this.units[de].power-1)>1e-15&&(L+="^"+this.units[de].power)):this.units[de].power<0&&ie++;if(ie>0)for(var me=0;me0?(H+=" "+this.units[me].prefix.name+this.units[me].unit.name,Math.abs(this.units[me].power+1)>1e-15&&(H+="^"+-this.units[me].power)):(H+=" "+this.units[me].prefix.name+this.units[me].unit.name,H+="^"+this.units[me].power));L=L.substr(1),H=H.substr(1),ne>1&&ie>0&&(L="("+L+")"),ie>1&&ne>0&&(H="("+H+")");var be=L;return ne>0&&ie>0&&(be+=" / "),be+=H,be},g.prototype.format=function(L){var H=this.skipAutomaticSimplification||this.value===null?this.clone():this.simplify(),ne=!1;typeof H.value<"u"&&H.value!==null&>(H.value)&&(ne=Math.abs(H.value.re)<1e-14);for(var ie in H.units)De(H.units,ie)&&H.units[ie].unit&&(H.units[ie].unit.name==="VA"&&ne?H.units[ie].unit=z.VAR:H.units[ie].unit.name==="VAR"&&!ne&&(H.units[ie].unit=z.VA));H.units.length===1&&!H.fixPrefix&&Math.abs(H.units[0].power-Math.round(H.units[0].power))<1e-14&&(H.units[0].prefix=H._bestPrefix());var de=H._denormalize(H.value),me=H.value!==null?p(de,L||{}):"",be=H.formatUnits();return H.value&>(H.value)&&(me="("+me+")"),be.length>0&&me.length>0&&(me+=" "),me+=be,me},g.prototype._bestPrefix=function(){if(this.units.length!==1)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 L=this.value!==null?u(this.value):0,H=u(this.units[0].unit.value),ne=this.units[0].prefix;if(L===0)return ne;var ie=this.units[0].power,de=Math.log(L/Math.pow(ne.value*H,ie))/Math.LN10-1.2;if(de>-2.200001&&de<1.800001)return ne;de=Math.abs(de);var me=this.units[0].unit.prefixes;for(var be in me)if(De(me,be)){var Ne=me[be];if(Ne.scientific){var V=Math.abs(Math.log(L/Math.pow(Ne.value*H,ie))/Math.LN10-1.2);(V0)},z={meter:{name:"meter",base:O.LENGTH,prefixes:T.LONG,value:1,offset:0},inch:{name:"inch",base:O.LENGTH,prefixes:T.NONE,value:.0254,offset:0},foot:{name:"foot",base:O.LENGTH,prefixes:T.NONE,value:.3048,offset:0},yard:{name:"yard",base:O.LENGTH,prefixes:T.NONE,value:.9144,offset:0},mile:{name:"mile",base:O.LENGTH,prefixes:T.NONE,value:1609.344,offset:0},link:{name:"link",base:O.LENGTH,prefixes:T.NONE,value:.201168,offset:0},rod:{name:"rod",base:O.LENGTH,prefixes:T.NONE,value:5.0292,offset:0},chain:{name:"chain",base:O.LENGTH,prefixes:T.NONE,value:20.1168,offset:0},angstrom:{name:"angstrom",base:O.LENGTH,prefixes:T.NONE,value:1e-10,offset:0},m:{name:"m",base:O.LENGTH,prefixes:T.SHORT,value:1,offset:0},in:{name:"in",base:O.LENGTH,prefixes:T.NONE,value:.0254,offset:0},ft:{name:"ft",base:O.LENGTH,prefixes:T.NONE,value:.3048,offset:0},yd:{name:"yd",base:O.LENGTH,prefixes:T.NONE,value:.9144,offset:0},mi:{name:"mi",base:O.LENGTH,prefixes:T.NONE,value:1609.344,offset:0},li:{name:"li",base:O.LENGTH,prefixes:T.NONE,value:.201168,offset:0},rd:{name:"rd",base:O.LENGTH,prefixes:T.NONE,value:5.02921,offset:0},ch:{name:"ch",base:O.LENGTH,prefixes:T.NONE,value:20.1168,offset:0},mil:{name:"mil",base:O.LENGTH,prefixes:T.NONE,value:254e-7,offset:0},m2:{name:"m2",base:O.SURFACE,prefixes:T.SQUARED,value:1,offset:0},sqin:{name:"sqin",base:O.SURFACE,prefixes:T.NONE,value:64516e-8,offset:0},sqft:{name:"sqft",base:O.SURFACE,prefixes:T.NONE,value:.09290304,offset:0},sqyd:{name:"sqyd",base:O.SURFACE,prefixes:T.NONE,value:.83612736,offset:0},sqmi:{name:"sqmi",base:O.SURFACE,prefixes:T.NONE,value:2589988110336e-6,offset:0},sqrd:{name:"sqrd",base:O.SURFACE,prefixes:T.NONE,value:25.29295,offset:0},sqch:{name:"sqch",base:O.SURFACE,prefixes:T.NONE,value:404.6873,offset:0},sqmil:{name:"sqmil",base:O.SURFACE,prefixes:T.NONE,value:64516e-14,offset:0},acre:{name:"acre",base:O.SURFACE,prefixes:T.NONE,value:4046.86,offset:0},hectare:{name:"hectare",base:O.SURFACE,prefixes:T.NONE,value:1e4,offset:0},m3:{name:"m3",base:O.VOLUME,prefixes:T.CUBIC,value:1,offset:0},L:{name:"L",base:O.VOLUME,prefixes:T.SHORT,value:.001,offset:0},l:{name:"l",base:O.VOLUME,prefixes:T.SHORT,value:.001,offset:0},litre:{name:"litre",base:O.VOLUME,prefixes:T.LONG,value:.001,offset:0},cuin:{name:"cuin",base:O.VOLUME,prefixes:T.NONE,value:16387064e-12,offset:0},cuft:{name:"cuft",base:O.VOLUME,prefixes:T.NONE,value:.028316846592,offset:0},cuyd:{name:"cuyd",base:O.VOLUME,prefixes:T.NONE,value:.764554857984,offset:0},teaspoon:{name:"teaspoon",base:O.VOLUME,prefixes:T.NONE,value:5e-6,offset:0},tablespoon:{name:"tablespoon",base:O.VOLUME,prefixes:T.NONE,value:15e-6,offset:0},drop:{name:"drop",base:O.VOLUME,prefixes:T.NONE,value:5e-8,offset:0},gtt:{name:"gtt",base:O.VOLUME,prefixes:T.NONE,value:5e-8,offset:0},minim:{name:"minim",base:O.VOLUME,prefixes:T.NONE,value:61611519921875e-21,offset:0},fluiddram:{name:"fluiddram",base:O.VOLUME,prefixes:T.NONE,value:36966911953125e-19,offset:0},fluidounce:{name:"fluidounce",base:O.VOLUME,prefixes:T.NONE,value:295735295625e-16,offset:0},gill:{name:"gill",base:O.VOLUME,prefixes:T.NONE,value:.00011829411825,offset:0},cc:{name:"cc",base:O.VOLUME,prefixes:T.NONE,value:1e-6,offset:0},cup:{name:"cup",base:O.VOLUME,prefixes:T.NONE,value:.0002365882365,offset:0},pint:{name:"pint",base:O.VOLUME,prefixes:T.NONE,value:.000473176473,offset:0},quart:{name:"quart",base:O.VOLUME,prefixes:T.NONE,value:.000946352946,offset:0},gallon:{name:"gallon",base:O.VOLUME,prefixes:T.NONE,value:.003785411784,offset:0},beerbarrel:{name:"beerbarrel",base:O.VOLUME,prefixes:T.NONE,value:.117347765304,offset:0},oilbarrel:{name:"oilbarrel",base:O.VOLUME,prefixes:T.NONE,value:.158987294928,offset:0},hogshead:{name:"hogshead",base:O.VOLUME,prefixes:T.NONE,value:.238480942392,offset:0},g:{name:"g",base:O.MASS,prefixes:T.SHORT,value:.001,offset:0},gram:{name:"gram",base:O.MASS,prefixes:T.LONG,value:.001,offset:0},ton:{name:"ton",base:O.MASS,prefixes:T.SHORT,value:907.18474,offset:0},t:{name:"t",base:O.MASS,prefixes:T.SHORT,value:1e3,offset:0},tonne:{name:"tonne",base:O.MASS,prefixes:T.LONG,value:1e3,offset:0},grain:{name:"grain",base:O.MASS,prefixes:T.NONE,value:6479891e-11,offset:0},dram:{name:"dram",base:O.MASS,prefixes:T.NONE,value:.0017718451953125,offset:0},ounce:{name:"ounce",base:O.MASS,prefixes:T.NONE,value:.028349523125,offset:0},poundmass:{name:"poundmass",base:O.MASS,prefixes:T.NONE,value:.45359237,offset:0},hundredweight:{name:"hundredweight",base:O.MASS,prefixes:T.NONE,value:45.359237,offset:0},stick:{name:"stick",base:O.MASS,prefixes:T.NONE,value:.115,offset:0},stone:{name:"stone",base:O.MASS,prefixes:T.NONE,value:6.35029318,offset:0},gr:{name:"gr",base:O.MASS,prefixes:T.NONE,value:6479891e-11,offset:0},dr:{name:"dr",base:O.MASS,prefixes:T.NONE,value:.0017718451953125,offset:0},oz:{name:"oz",base:O.MASS,prefixes:T.NONE,value:.028349523125,offset:0},lbm:{name:"lbm",base:O.MASS,prefixes:T.NONE,value:.45359237,offset:0},cwt:{name:"cwt",base:O.MASS,prefixes:T.NONE,value:45.359237,offset:0},s:{name:"s",base:O.TIME,prefixes:T.SHORT,value:1,offset:0},min:{name:"min",base:O.TIME,prefixes:T.NONE,value:60,offset:0},h:{name:"h",base:O.TIME,prefixes:T.NONE,value:3600,offset:0},second:{name:"second",base:O.TIME,prefixes:T.LONG,value:1,offset:0},sec:{name:"sec",base:O.TIME,prefixes:T.LONG,value:1,offset:0},minute:{name:"minute",base:O.TIME,prefixes:T.NONE,value:60,offset:0},hour:{name:"hour",base:O.TIME,prefixes:T.NONE,value:3600,offset:0},day:{name:"day",base:O.TIME,prefixes:T.NONE,value:86400,offset:0},week:{name:"week",base:O.TIME,prefixes:T.NONE,value:7*86400,offset:0},month:{name:"month",base:O.TIME,prefixes:T.NONE,value:2629800,offset:0},year:{name:"year",base:O.TIME,prefixes:T.NONE,value:31557600,offset:0},decade:{name:"decade",base:O.TIME,prefixes:T.NONE,value:315576e3,offset:0},century:{name:"century",base:O.TIME,prefixes:T.NONE,value:315576e4,offset:0},millennium:{name:"millennium",base:O.TIME,prefixes:T.NONE,value:315576e5,offset:0},hertz:{name:"Hertz",base:O.FREQUENCY,prefixes:T.LONG,value:1,offset:0,reciprocal:!0},Hz:{name:"Hz",base:O.FREQUENCY,prefixes:T.SHORT,value:1,offset:0,reciprocal:!0},rad:{name:"rad",base:O.ANGLE,prefixes:T.SHORT,value:1,offset:0},radian:{name:"radian",base:O.ANGLE,prefixes:T.LONG,value:1,offset:0},deg:{name:"deg",base:O.ANGLE,prefixes:T.SHORT,value:null,offset:0},degree:{name:"degree",base:O.ANGLE,prefixes:T.LONG,value:null,offset:0},grad:{name:"grad",base:O.ANGLE,prefixes:T.SHORT,value:null,offset:0},gradian:{name:"gradian",base:O.ANGLE,prefixes:T.LONG,value:null,offset:0},cycle:{name:"cycle",base:O.ANGLE,prefixes:T.NONE,value:null,offset:0},arcsec:{name:"arcsec",base:O.ANGLE,prefixes:T.NONE,value:null,offset:0},arcmin:{name:"arcmin",base:O.ANGLE,prefixes:T.NONE,value:null,offset:0},A:{name:"A",base:O.CURRENT,prefixes:T.SHORT,value:1,offset:0},ampere:{name:"ampere",base:O.CURRENT,prefixes:T.LONG,value:1,offset:0},K:{name:"K",base:O.TEMPERATURE,prefixes:T.SHORT,value:1,offset:0},degC:{name:"degC",base:O.TEMPERATURE,prefixes:T.SHORT,value:1,offset:273.15},degF:{name:"degF",base:O.TEMPERATURE,prefixes:T.SHORT,value:new b(5,9),offset:459.67},degR:{name:"degR",base:O.TEMPERATURE,prefixes:T.SHORT,value:new b(5,9),offset:0},kelvin:{name:"kelvin",base:O.TEMPERATURE,prefixes:T.LONG,value:1,offset:0},celsius:{name:"celsius",base:O.TEMPERATURE,prefixes:T.LONG,value:1,offset:273.15},fahrenheit:{name:"fahrenheit",base:O.TEMPERATURE,prefixes:T.LONG,value:new b(5,9),offset:459.67},rankine:{name:"rankine",base:O.TEMPERATURE,prefixes:T.LONG,value:new b(5,9),offset:0},mol:{name:"mol",base:O.AMOUNT_OF_SUBSTANCE,prefixes:T.SHORT,value:1,offset:0},mole:{name:"mole",base:O.AMOUNT_OF_SUBSTANCE,prefixes:T.LONG,value:1,offset:0},cd:{name:"cd",base:O.LUMINOUS_INTENSITY,prefixes:T.SHORT,value:1,offset:0},candela:{name:"candela",base:O.LUMINOUS_INTENSITY,prefixes:T.LONG,value:1,offset:0},N:{name:"N",base:O.FORCE,prefixes:T.SHORT,value:1,offset:0},newton:{name:"newton",base:O.FORCE,prefixes:T.LONG,value:1,offset:0},dyn:{name:"dyn",base:O.FORCE,prefixes:T.SHORT,value:1e-5,offset:0},dyne:{name:"dyne",base:O.FORCE,prefixes:T.LONG,value:1e-5,offset:0},lbf:{name:"lbf",base:O.FORCE,prefixes:T.NONE,value:4.4482216152605,offset:0},poundforce:{name:"poundforce",base:O.FORCE,prefixes:T.NONE,value:4.4482216152605,offset:0},kip:{name:"kip",base:O.FORCE,prefixes:T.LONG,value:4448.2216,offset:0},kilogramforce:{name:"kilogramforce",base:O.FORCE,prefixes:T.NONE,value:9.80665,offset:0},J:{name:"J",base:O.ENERGY,prefixes:T.SHORT,value:1,offset:0},joule:{name:"joule",base:O.ENERGY,prefixes:T.LONG,value:1,offset:0},erg:{name:"erg",base:O.ENERGY,prefixes:T.SHORTLONG,value:1e-7,offset:0},Wh:{name:"Wh",base:O.ENERGY,prefixes:T.SHORT,value:3600,offset:0},BTU:{name:"BTU",base:O.ENERGY,prefixes:T.BTU,value:1055.05585262,offset:0},eV:{name:"eV",base:O.ENERGY,prefixes:T.SHORT,value:1602176565e-28,offset:0},electronvolt:{name:"electronvolt",base:O.ENERGY,prefixes:T.LONG,value:1602176565e-28,offset:0},W:{name:"W",base:O.POWER,prefixes:T.SHORT,value:1,offset:0},watt:{name:"watt",base:O.POWER,prefixes:T.LONG,value:1,offset:0},hp:{name:"hp",base:O.POWER,prefixes:T.NONE,value:745.6998715386,offset:0},VAR:{name:"VAR",base:O.POWER,prefixes:T.SHORT,value:h.I,offset:0},VA:{name:"VA",base:O.POWER,prefixes:T.SHORT,value:1,offset:0},Pa:{name:"Pa",base:O.PRESSURE,prefixes:T.SHORT,value:1,offset:0},psi:{name:"psi",base:O.PRESSURE,prefixes:T.NONE,value:6894.75729276459,offset:0},atm:{name:"atm",base:O.PRESSURE,prefixes:T.NONE,value:101325,offset:0},bar:{name:"bar",base:O.PRESSURE,prefixes:T.SHORTLONG,value:1e5,offset:0},torr:{name:"torr",base:O.PRESSURE,prefixes:T.NONE,value:133.322,offset:0},mmHg:{name:"mmHg",base:O.PRESSURE,prefixes:T.NONE,value:133.322,offset:0},mmH2O:{name:"mmH2O",base:O.PRESSURE,prefixes:T.NONE,value:9.80665,offset:0},cmH2O:{name:"cmH2O",base:O.PRESSURE,prefixes:T.NONE,value:98.0665,offset:0},coulomb:{name:"coulomb",base:O.ELECTRIC_CHARGE,prefixes:T.LONG,value:1,offset:0},C:{name:"C",base:O.ELECTRIC_CHARGE,prefixes:T.SHORT,value:1,offset:0},farad:{name:"farad",base:O.ELECTRIC_CAPACITANCE,prefixes:T.LONG,value:1,offset:0},F:{name:"F",base:O.ELECTRIC_CAPACITANCE,prefixes:T.SHORT,value:1,offset:0},volt:{name:"volt",base:O.ELECTRIC_POTENTIAL,prefixes:T.LONG,value:1,offset:0},V:{name:"V",base:O.ELECTRIC_POTENTIAL,prefixes:T.SHORT,value:1,offset:0},ohm:{name:"ohm",base:O.ELECTRIC_RESISTANCE,prefixes:T.SHORTLONG,value:1,offset:0},henry:{name:"henry",base:O.ELECTRIC_INDUCTANCE,prefixes:T.LONG,value:1,offset:0},H:{name:"H",base:O.ELECTRIC_INDUCTANCE,prefixes:T.SHORT,value:1,offset:0},siemens:{name:"siemens",base:O.ELECTRIC_CONDUCTANCE,prefixes:T.LONG,value:1,offset:0},S:{name:"S",base:O.ELECTRIC_CONDUCTANCE,prefixes:T.SHORT,value:1,offset:0},weber:{name:"weber",base:O.MAGNETIC_FLUX,prefixes:T.LONG,value:1,offset:0},Wb:{name:"Wb",base:O.MAGNETIC_FLUX,prefixes:T.SHORT,value:1,offset:0},tesla:{name:"tesla",base:O.MAGNETIC_FLUX_DENSITY,prefixes:T.LONG,value:1,offset:0},T:{name:"T",base:O.MAGNETIC_FLUX_DENSITY,prefixes:T.SHORT,value:1,offset:0},b:{name:"b",base:O.BIT,prefixes:T.BINARY_SHORT,value:1,offset:0},bits:{name:"bits",base:O.BIT,prefixes:T.BINARY_LONG,value:1,offset:0},B:{name:"B",base:O.BIT,prefixes:T.BINARY_SHORT,value:8,offset:0},bytes:{name:"bytes",base:O.BIT,prefixes:T.BINARY_LONG,value:8,offset:0}},Q={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 se(L){if(L.number==="BigNumber"){var H=ju(w);z.rad.value=new w(1),z.deg.value=H.div(180),z.grad.value=H.div(200),z.cycle.value=H.times(2),z.arcsec.value=H.div(648e3),z.arcmin.value=H.div(10800)}else z.rad.value=1,z.deg.value=Math.PI/180,z.grad.value=Math.PI/200,z.cycle.value=Math.PI*2,z.arcsec.value=Math.PI/648e3,z.arcmin.value=Math.PI/10800;z.radian.value=z.rad.value,z.degree.value=z.deg.value,z.gradian.value=z.grad.value}se(t),r&&r("config",function(L,H){L.number!==H.number&&se(L)});var re={si:{NONE:{unit:U,prefix:T.NONE[""]},LENGTH:{unit:z.m,prefix:T.SHORT[""]},MASS:{unit:z.g,prefix:T.SHORT.k},TIME:{unit:z.s,prefix:T.SHORT[""]},CURRENT:{unit:z.A,prefix:T.SHORT[""]},TEMPERATURE:{unit:z.K,prefix:T.SHORT[""]},LUMINOUS_INTENSITY:{unit:z.cd,prefix:T.SHORT[""]},AMOUNT_OF_SUBSTANCE:{unit:z.mol,prefix:T.SHORT[""]},ANGLE:{unit:z.rad,prefix:T.SHORT[""]},BIT:{unit:z.bits,prefix:T.SHORT[""]},FORCE:{unit:z.N,prefix:T.SHORT[""]},ENERGY:{unit:z.J,prefix:T.SHORT[""]},POWER:{unit:z.W,prefix:T.SHORT[""]},PRESSURE:{unit:z.Pa,prefix:T.SHORT[""]},ELECTRIC_CHARGE:{unit:z.C,prefix:T.SHORT[""]},ELECTRIC_CAPACITANCE:{unit:z.F,prefix:T.SHORT[""]},ELECTRIC_POTENTIAL:{unit:z.V,prefix:T.SHORT[""]},ELECTRIC_RESISTANCE:{unit:z.ohm,prefix:T.SHORT[""]},ELECTRIC_INDUCTANCE:{unit:z.H,prefix:T.SHORT[""]},ELECTRIC_CONDUCTANCE:{unit:z.S,prefix:T.SHORT[""]},MAGNETIC_FLUX:{unit:z.Wb,prefix:T.SHORT[""]},MAGNETIC_FLUX_DENSITY:{unit:z.T,prefix:T.SHORT[""]},FREQUENCY:{unit:z.Hz,prefix:T.SHORT[""]}}};re.cgs=JSON.parse(JSON.stringify(re.si)),re.cgs.LENGTH={unit:z.m,prefix:T.SHORT.c},re.cgs.MASS={unit:z.g,prefix:T.SHORT[""]},re.cgs.FORCE={unit:z.dyn,prefix:T.SHORT[""]},re.cgs.ENERGY={unit:z.erg,prefix:T.NONE[""]},re.us=JSON.parse(JSON.stringify(re.si)),re.us.LENGTH={unit:z.ft,prefix:T.NONE[""]},re.us.MASS={unit:z.lbm,prefix:T.NONE[""]},re.us.TEMPERATURE={unit:z.degF,prefix:T.NONE[""]},re.us.FORCE={unit:z.lbf,prefix:T.NONE[""]},re.us.ENERGY={unit:z.BTU,prefix:T.BTU[""]},re.us.POWER={unit:z.hp,prefix:T.NONE[""]},re.us.PRESSURE={unit:z.psi,prefix:T.NONE[""]},re.auto=JSON.parse(JSON.stringify(re.si));var q=re.auto;g.setUnitSystem=function(L){if(De(re,L))q=re[L];else throw new Error("Unit system "+L+" does not exist. Choices are: "+Object.keys(re).join(", "))},g.getUnitSystem=function(){for(var L in re)if(De(re,L)&&re[L]===q)return L},g.typeConverters={BigNumber:function(H){return H!=null&&H.isFraction?new w(H.n).div(H.d).times(H.s):new w(H+"")},Fraction:function(H){return new b(H)},Complex:function(H){return H},number:function(H){return H!=null&&H.isFraction?v(H):H}},g.prototype._numberConverter=function(){var L=g.typeConverters[this.valueType()];if(L)return L;throw new TypeError('Unsupported Unit value type "'+this.valueType()+'"')},g._getNumberConverter=function(L){if(!g.typeConverters[L])throw new TypeError('Unsupported type "'+L+'"');return g.typeConverters[L]};for(var Z in z)if(De(z,Z)){var j=z[Z];j.dimensions=j.base.dimensions}for(var Y in Q)if(De(Q,Y)){var ee=z[Q[Y]],te={};for(var oe in ee)De(ee,oe)&&(te[oe]=ee[oe]);te.name=Y,z[Y]=te}g.isValidAlpha=function(H){return/^[a-zA-Z]$/.test(H)};function ve(L){for(var H=0;H0&&!(g.isValidAlpha(y)||E(y)))throw new Error('Invalid unit name (only alphanumeric characters are allowed): "'+L+'"')}}return g.createUnit=function(L,H){if(typeof L!="object")throw new TypeError("createUnit expects first parameter to be of type 'Object'");if(H&&H.override){for(var ne in L)if(De(L,ne)&&g.deleteUnit(ne),L[ne].aliases)for(var ie=0;ie"u"||H===null)&&(H={}),typeof L!="string")throw new TypeError("createUnitSingle expects first parameter to be of type 'string'");if(De(z,L))throw new Error('Cannot create unit "'+L+'": a unit with that name already exists');ve(L);var ne=null,ie=[],de=0,me,be,Ne;if(H&&H.type==="Unit")ne=H.clone();else if(typeof H=="string")H!==""&&(me=H);else if(typeof H=="object")me=H.definition,be=H.prefixes,de=H.offset,Ne=H.baseName,H.aliases&&(ie=H.aliases.valueOf());else throw new TypeError('Cannot create unit "'+L+'" from "'+H.toString()+'": expecting "string" or "Unit" or "Object"');if(ie){for(var V=0;V1e-12){ye=!1;break}if(ye){fe=!0,K.base=O[xe];break}}if(!fe){Ne=Ne||L+"_STUFF";var we={dimensions:ne.dimensions.slice(0)};we.key=Ne,O[Ne]=we,q[Ne]={unit:K,prefix:T.NONE[""]},K.base=O[Ne]}}else{if(Ne=Ne||L+"_STUFF",k.indexOf(Ne)>=0)throw new Error('Cannot create new base unit "'+L+'": a base unit with that name already exists (and cannot be overridden)');k.push(Ne);for(var G in O)De(O,G)&&(O[G].dimensions[k.length-1]=0);for(var ae={dimensions:[]},ce=0;ce{var{typed:r,Unit:t}=e;return r(Xh,{Unit:function(a){return a.clone()},string:function(a){return t.isValuelessUnit(a)?new t(null,a):t.parse(a,{allowNoUnits:!0})},"number | BigNumber | Fraction | Complex, string | Unit":function(a,i){return new t(a,i)},"number | BigNumber | Fraction":function(a){return new t(a)},"Array | Matrix":r.referToSelf(n=>a=>Le(a,n))})}),Qh="sparse",V4=["typed","SparseMatrix"],U4=P(Qh,V4,e=>{var{typed:r,SparseMatrix:t}=e;return r(Qh,{"":function(){return new t([])},string:function(a){return new t([],a)},"Array | Matrix":function(a){return new t(a)},"Array | Matrix, string":function(a,i){return new t(a,i)}})}),e0="createUnit",H4=["typed","Unit"],Z4=P(e0,H4,e=>{var{typed:r,Unit:t}=e;return r(e0,{"Object, Object":function(a,i){return t.createUnit(a,i)},Object:function(a){return t.createUnit(a,{})},"string, Unit | string | Object, Object":function(a,i,o){var l={};return l[a]=i,t.createUnit(l,o)},"string, Unit | string | Object":function(a,i){var o={};return o[a]=i,t.createUnit(o,{})},string:function(a){var i={};return i[a]={},t.createUnit(i,{})}})}),r0="acos",G4=["typed","config","Complex"],W4=P(r0,G4,e=>{var{typed:r,config:t,Complex:n}=e;return r(r0,{number:function(i){return i>=-1&&i<=1||t.predictable?Math.acos(i):new n(i,0).acos()},Complex:function(i){return i.acos()},BigNumber:function(i){return i.acos()}})}),t0="acosh",j4=["typed","config","Complex"],K4=P(t0,j4,e=>{var{typed:r,config:t,Complex:n}=e;return r(t0,{number:function(i){return i>=1||t.predictable?sp(i):i<=-1?new n(Math.log(Math.sqrt(i*i-1)-i),Math.PI):new n(i,0).acosh()},Complex:function(i){return i.acosh()},BigNumber:function(i){return i.acosh()}})}),n0="acot",J4=["typed","BigNumber"],Y4=P(n0,J4,e=>{var{typed:r,BigNumber:t}=e;return r(n0,{number:up,Complex:function(a){return a.acot()},BigNumber:function(a){return new t(1).div(a).atan()}})}),a0="acoth",X4=["typed","config","Complex","BigNumber"],Q4=P(a0,X4,e=>{var{typed:r,config:t,Complex:n,BigNumber:a}=e;return r(a0,{number:function(o){return o>=1||o<=-1||t.predictable?lp(o):new n(o,0).acoth()},Complex:function(o){return o.acoth()},BigNumber:function(o){return new a(1).div(o).atanh()}})}),i0="acsc",eO=["typed","config","Complex","BigNumber"],rO=P(i0,eO,e=>{var{typed:r,config:t,Complex:n,BigNumber:a}=e;return r(i0,{number:function(o){return o<=-1||o>=1||t.predictable?cp(o):new n(o,0).acsc()},Complex:function(o){return o.acsc()},BigNumber:function(o){return new a(1).div(o).asin()}})}),o0="acsch",tO=["typed","BigNumber"],nO=P(o0,tO,e=>{var{typed:r,BigNumber:t}=e;return r(o0,{number:fp,Complex:function(a){return a.acsch()},BigNumber:function(a){return new t(1).div(a).asinh()}})}),s0="asec",aO=["typed","config","Complex","BigNumber"],iO=P(s0,aO,e=>{var{typed:r,config:t,Complex:n,BigNumber:a}=e;return r(s0,{number:function(o){return o<=-1||o>=1||t.predictable?mp(o):new n(o,0).asec()},Complex:function(o){return o.asec()},BigNumber:function(o){return new a(1).div(o).acos()}})}),u0="asech",oO=["typed","config","Complex","BigNumber"],sO=P(u0,oO,e=>{var{typed:r,config:t,Complex:n,BigNumber:a}=e;return r(u0,{number:function(o){if(o<=1&&o>=-1||t.predictable){var l=1/o;if(l>0||t.predictable)return dp(o);var u=Math.sqrt(l*l-1);return new n(Math.log(u-l),Math.PI)}return new n(o,0).asech()},Complex:function(o){return o.asech()},BigNumber:function(o){return new a(1).div(o).acosh()}})}),l0="asin",uO=["typed","config","Complex"],lO=P(l0,uO,e=>{var{typed:r,config:t,Complex:n}=e;return r(l0,{number:function(i){return i>=-1&&i<=1||t.predictable?Math.asin(i):new n(i,0).asin()},Complex:function(i){return i.asin()},BigNumber:function(i){return i.asin()}})}),cO="asinh",fO=["typed"],mO=P(cO,fO,e=>{var{typed:r}=e;return r("asinh",{number:pp,Complex:function(n){return n.asinh()},BigNumber:function(n){return n.asinh()}})}),dO="atan",pO=["typed"],vO=P(dO,pO,e=>{var{typed:r}=e;return r("atan",{number:function(n){return Math.atan(n)},Complex:function(n){return n.atan()},BigNumber:function(n){return n.atan()}})}),c0="atan2",hO=["typed","matrix","equalScalar","BigNumber","DenseMatrix","concat"],gO=P(c0,hO,e=>{var{typed:r,matrix:t,equalScalar:n,BigNumber:a,DenseMatrix:i,concat:o}=e,l=xt({typed:r,equalScalar:n}),u=kr({typed:r}),s=fv({typed:r,equalScalar:n}),c=Tr({typed:r,equalScalar:n}),f=xr({typed:r,DenseMatrix:i}),m=ar({typed:r,matrix:t,concat:o});return r(c0,{"number, number":Math.atan2,"BigNumber, BigNumber":(p,v)=>a.atan2(p,v)},m({scalar:"number | BigNumber",SS:s,DS:u,SD:l,Ss:c,sS:f}))}),f0="atanh",yO=["typed","config","Complex"],bO=P(f0,yO,e=>{var{typed:r,config:t,Complex:n}=e;return r(f0,{number:function(i){return i<=1&&i>=-1||t.predictable?vp(i):new n(i,0).atanh()},Complex:function(i){return i.atanh()},BigNumber:function(i){return i.atanh()}})}),Fa=P("trigUnit",["typed"],e=>{var{typed:r}=e;return{Unit:r.referToSelf(t=>n=>{if(!n.hasBase(n.constructor.BASE_UNITS.ANGLE))throw new TypeError("Unit in function cot is no angle");return r.find(t,n.valueType())(n.value)})}}),m0="cos",wO=["typed"],xO=P(m0,wO,e=>{var{typed:r}=e,t=Fa({typed:r});return r(m0,{number:Math.cos,"Complex | BigNumber":n=>n.cos()},t)}),d0="cosh",NO=["typed"],AO=P(d0,NO,e=>{var{typed:r}=e;return r(d0,{number:AS,"Complex | BigNumber":t=>t.cosh()})}),p0="cot",EO=["typed","BigNumber"],DO=P(p0,EO,e=>{var{typed:r,BigNumber:t}=e,n=Fa({typed:r});return r(p0,{number:hp,Complex:a=>a.cot(),BigNumber:a=>new t(1).div(a.tan())},n)}),v0="coth",SO=["typed","BigNumber"],CO=P(v0,SO,e=>{var{typed:r,BigNumber:t}=e;return r(v0,{number:gp,Complex:n=>n.coth(),BigNumber:n=>new t(1).div(n.tanh())})}),h0="csc",MO=["typed","BigNumber"],_O=P(h0,MO,e=>{var{typed:r,BigNumber:t}=e,n=Fa({typed:r});return r(h0,{number:yp,Complex:a=>a.csc(),BigNumber:a=>new t(1).div(a.sin())},n)}),g0="csch",TO=["typed","BigNumber"],FO=P(g0,TO,e=>{var{typed:r,BigNumber:t}=e;return r(g0,{number:bp,Complex:n=>n.csch(),BigNumber:n=>new t(1).div(n.sinh())})}),y0="sec",BO=["typed","BigNumber"],OO=P(y0,BO,e=>{var{typed:r,BigNumber:t}=e,n=Fa({typed:r});return r(y0,{number:wp,Complex:a=>a.sec(),BigNumber:a=>new t(1).div(a.cos())},n)}),b0="sech",$O=["typed","BigNumber"],IO=P(b0,$O,e=>{var{typed:r,BigNumber:t}=e;return r(b0,{number:xp,Complex:n=>n.sech(),BigNumber:n=>new t(1).div(n.cosh())})}),w0="sin",RO=["typed"],zO=P(w0,RO,e=>{var{typed:r}=e,t=Fa({typed:r});return r(w0,{number:Math.sin,"Complex | BigNumber":n=>n.sin()},t)}),x0="sinh",PO=["typed"],kO=P(x0,PO,e=>{var{typed:r}=e;return r(x0,{number:Np,"Complex | BigNumber":t=>t.sinh()})}),N0="tan",qO=["typed"],LO=P(N0,qO,e=>{var{typed:r}=e,t=Fa({typed:r});return r(N0,{number:Math.tan,"Complex | BigNumber":n=>n.tan()},t)}),VO="tanh",UO=["typed"],HO=P(VO,UO,e=>{var{typed:r}=e;return r("tanh",{number:DS,"Complex | BigNumber":t=>t.tanh()})}),A0="setCartesian",ZO=["typed","size","subset","compareNatural","Index","DenseMatrix"],GO=P(A0,ZO,e=>{var{typed:r,size:t,subset:n,compareNatural:a,Index:i,DenseMatrix:o}=e;return r(A0,{"Array | Matrix, Array | Matrix":function(u,s){var c=[];if(n(t(u),new i(0))!==0&&n(t(s),new i(0))!==0){var f=We(Array.isArray(u)?u:u.toArray()).sort(a),m=We(Array.isArray(s)?s:s.toArray()).sort(a);c=[];for(var p=0;p{var{typed:r,size:t,subset:n,compareNatural:a,Index:i,DenseMatrix:o}=e;return r(E0,{"Array | Matrix, Array | Matrix":function(u,s){var c;if(n(t(u),new i(0))===0)c=[];else{if(n(t(s),new i(0))===0)return We(u.toArray());var f=Na(We(Array.isArray(u)?u:u.toArray()).sort(a)),m=Na(We(Array.isArray(s)?s:s.toArray()).sort(a));c=[];for(var p,v=0;v{var{typed:r,size:t,subset:n,compareNatural:a,Index:i,DenseMatrix:o}=e;return r(D0,{"Array | Matrix":function(u){var s;if(n(t(u),new i(0))===0)s=[];else{var c=We(Array.isArray(u)?u:u.toArray()).sort(a);s=[],s.push(c[0]);for(var f=1;f{var{typed:r,size:t,subset:n,compareNatural:a,Index:i,DenseMatrix:o}=e;return r(S0,{"Array | Matrix, Array | Matrix":function(u,s){var c;if(n(t(u),new i(0))===0||n(t(s),new i(0))===0)c=[];else{var f=Na(We(Array.isArray(u)?u:u.toArray()).sort(a)),m=Na(We(Array.isArray(s)?s:s.toArray()).sort(a));c=[];for(var p=0;p{var{typed:r,size:t,subset:n,compareNatural:a,Index:i}=e;return r(C0,{"Array | Matrix, Array | Matrix":function(l,u){if(n(t(l),new i(0))===0)return!0;if(n(t(u),new i(0))===0)return!1;for(var s=Na(We(Array.isArray(l)?l:l.toArray()).sort(a)),c=Na(We(Array.isArray(u)?u:u.toArray()).sort(a)),f,m=0;m{var{typed:r,size:t,subset:n,compareNatural:a,Index:i}=e;return r(M0,{"number | BigNumber | Fraction | Complex, Array | Matrix":function(l,u){if(n(t(u),new i(0))===0)return 0;for(var s=We(Array.isArray(u)?u:u.toArray()),c=0,f=0;f{var{typed:r,size:t,subset:n,compareNatural:a,Index:i}=e;return r(_0,{"Array | Matrix":function(s){if(n(t(s),new i(0))===0)return[];for(var c=We(Array.isArray(s)?s:s.toArray()).sort(a),f=[],m=0;m.toString(2).length<=c.length;)f.push(o(c,m.toString(2).split("").reverse())),m++;return l(f)}});function o(u,s){for(var c=[],f=0;f0;c--)for(var f=0;fu[f+1].length&&(s=u[f],u[f]=u[f+1],u[f+1]=s);return u}}),T0="setSize",i5=["typed","compareNatural"],o5=P(T0,i5,e=>{var{typed:r,compareNatural:t}=e;return r(T0,{"Array | Matrix":function(a){return Array.isArray(a)?We(a).length:We(a.toArray()).length},"Array | Matrix, boolean":function(a,i){if(i===!1||a.length===0)return Array.isArray(a)?We(a).length:We(a.toArray()).length;for(var o=We(Array.isArray(a)?a:a.toArray()).sort(t),l=1,u=1;u{var{typed:r,size:t,concat:n,subset:a,setDifference:i,Index:o}=e;return r(F0,{"Array | Matrix, Array | Matrix":function(u,s){if(a(t(u),new o(0))===0)return We(s);if(a(t(s),new o(0))===0)return We(u);var c=We(u),f=We(s);return n(i(c,f),i(f,c))}})}),B0="setUnion",l5=["typed","size","concat","subset","setIntersect","setSymDifference","Index"],c5=P(B0,l5,e=>{var{typed:r,size:t,concat:n,subset:a,setIntersect:i,setSymDifference:o,Index:l}=e;return r(B0,{"Array | Matrix, Array | Matrix":function(s,c){if(a(t(s),new l(0))===0)return We(c);if(a(t(c),new l(0))===0)return We(s);var f=We(s),m=We(c);return n(o(f,m),i(f,m))}})}),O0="add",f5=["typed","matrix","addScalar","equalScalar","DenseMatrix","SparseMatrix","concat"],m5=P(O0,f5,e=>{var{typed:r,matrix:t,addScalar:n,equalScalar:a,DenseMatrix:i,SparseMatrix:o,concat:l}=e,u=wn({typed:r}),s=qu({typed:r,equalScalar:a}),c=Hn({typed:r,DenseMatrix:i}),f=ar({typed:r,matrix:t,concat:l});return r(O0,{"any, any":n,"any, any, ...any":r.referToSelf(m=>(p,v,h)=>{for(var w=m(p,v),b=0;b{var{typed:r,abs:t,addScalar:n,divideScalar:a,multiplyScalar:i,sqrt:o,smaller:l,isPositive:u}=e;return r($0,{"... number | BigNumber":s,Array:s,Matrix:c=>s(We(c.toArray()))});function s(c){for(var f=0,m=0,p=0;p{var{typed:r,abs:t,add:n,pow:a,conj:i,sqrt:o,multiply:l,equalScalar:u,larger:s,smaller:c,matrix:f,ctranspose:m,eigs:p}=e;return r(I0,{number:Math.abs,Complex:function(S){return S.abs()},BigNumber:function(S){return S.abs()},boolean:function(S){return Math.abs(S)},Array:function(S){return y(f(S),2)},Matrix:function(S){return y(S,2)},"Array, number | BigNumber | string":function(S,E){return y(f(S),E)},"Matrix, number | BigNumber | string":function(S,E){return y(S,E)}});function v(D){var S=0;return D.forEach(function(E){var C=t(E);s(C,S)&&(S=C)},!0),S}function h(D){var S;return D.forEach(function(E){var C=t(E);(!S||c(C,S))&&(S=C)},!0),S||0}function w(D,S){if(S===Number.POSITIVE_INFINITY||S==="inf")return v(D);if(S===Number.NEGATIVE_INFINITY||S==="-inf")return h(D);if(S==="fro")return y(D,2);if(typeof S=="number"&&!isNaN(S)){if(!u(S,0)){var E=0;return D.forEach(function(C){E=n(a(t(C),S),E)},!0),a(E,1/S)}return Number.POSITIVE_INFINITY}throw new Error("Unsupported parameter value")}function b(D){var S=0;return D.forEach(function(E,C){S=n(S,l(E,i(E)))}),t(o(S))}function A(D){var S=[],E=0;return D.forEach(function(C,_){var F=_[1],I=n(S[F]||0,t(C));s(I,E)&&(E=I),S[F]=I},!0),E}function g(D){var S=D.size();if(S[0]!==S[1])throw new RangeError("Invalid matrix dimensions");var E=m(D),C=l(E,D),_=p(C).values.toArray(),F=_[_.length-1];return t(o(F))}function N(D){var S=[],E=0;return D.forEach(function(C,_){var F=_[0],I=n(S[F]||0,t(C));s(I,E)&&(E=I),S[F]=I},!0),E}function x(D,S){if(S===1)return A(D);if(S===Number.POSITIVE_INFINITY||S==="inf")return N(D);if(S==="fro")return b(D);if(S===2)return g(D);throw new Error("Unsupported parameter value "+S)}function y(D,S){var E=D.size();if(E.length===1)return w(D,S);if(E.length===2){if(E[0]&&E[1])return x(D,S);throw new RangeError("Invalid matrix dimensions")}}}),R0="dot",g5=["typed","addScalar","multiplyScalar","conj","size"],y5=P(R0,g5,e=>{var{typed:r,addScalar:t,multiplyScalar:n,conj:a,size:i}=e;return r(R0,{"Array | DenseMatrix, Array | DenseMatrix":l,"SparseMatrix, SparseMatrix":u});function o(c,f){var m=s(c),p=s(f),v,h;if(m.length===1)v=m[0];else if(m.length===2&&m[1]===1)v=m[0];else throw new RangeError("Expected a column vector, instead got a matrix of size ("+m.join(", ")+")");if(p.length===1)h=p[0];else if(p.length===2&&p[1]===1)h=p[0];else throw new RangeError("Expected a column vector, instead got a matrix of size ("+p.join(", ")+")");if(v!==h)throw new RangeError("Vectors must have equal length ("+v+" != "+h+")");if(v===0)throw new RangeError("Cannot calculate the dot product of empty vectors");return v}function l(c,f){var m=o(c,f),p=_e(c)?c._data:c,v=_e(c)?c._datatype||c.getDataType():void 0,h=_e(f)?f._data:f,w=_e(f)?f._datatype||f.getDataType():void 0,b=s(c).length===2,A=s(f).length===2,g=t,N=n;if(v&&w&&v===w&&typeof v=="string"&&v!=="mixed"){var x=v;g=r.find(t,[x,x]),N=r.find(n,[x,x])}if(!b&&!A){for(var y=N(a(p[0]),h[0]),D=1;Dy){N++;continue}x===y&&(w=b(w,A(p[g],h[N])),g++,N++)}return w}function s(c){return _e(c)?c.size():i(c)}}),b5="trace",w5=["typed","matrix","add"],x5=P(b5,w5,e=>{var{typed:r,matrix:t,add:n}=e;return r("trace",{Array:function(l){return a(t(l))},SparseMatrix:i,DenseMatrix:a,any:Fe});function a(o){var l=o._size,u=o._data;switch(l.length){case 1:if(l[0]===1)return Fe(u[0]);throw new RangeError("Matrix must be square (size: "+Ve(l)+")");case 2:{var s=l[0],c=l[1];if(s===c){for(var f=0,m=0;m0)for(var v=0;vv)break}return p}throw new RangeError("Matrix must be square (size: "+Ve(c)+")")}}),z0="index",N5=["typed","Index"],A5=P(z0,N5,e=>{var{typed:r,Index:t}=e;return r(z0,{"...number | string | BigNumber | Range | Array | Matrix":function(a){var i=a.map(function(l){return Ie(l)?l.toNumber():Xe(l)||_e(l)?l.map(function(u){return Ie(u)?u.toNumber():u}):l}),o=new t;return t.apply(o,i),o}})}),P0=new Set(["end"]),E5="Node",D5=["mathWithTransform"],S5=P(E5,D5,e=>{var{mathWithTransform:r}=e;function t(a){for(var i of[...P0])if(a.has(i))throw new Error('Scope contains an illegal symbol, "'+i+'" is a reserved keyword')}class n{get type(){return"Node"}get isNode(){return!0}evaluate(i){return this.compile().evaluate(i)}compile(){var i=this._compile(r,{}),o={},l=null;function u(s){var c=ca(s);return t(c),i(c,o,l)}return{evaluate:u}}_compile(i,o){throw new Error("Method _compile must be implemented by type "+this.type)}forEach(i){throw new Error("Cannot run forEach on a Node interface")}map(i){throw new Error("Cannot run map on a Node interface")}_ifNode(i){if(!Qe(i))throw new TypeError("Callback function must return a Node");return i}traverse(i){i(this,null,null);function o(l,u){l.forEach(function(s,c,f){u(s,c,f),o(s,u)})}o(this,i)}transform(i){function o(l,u,s){var c=i(l,u,s);return c!==l?c:l.map(o)}return o(this,null,null)}filter(i){var o=[];return this.traverse(function(l,u,s){i(l,u,s)&&o.push(l)}),o}clone(){throw new Error("Cannot clone a Node interface")}cloneDeep(){return this.map(function(i){return i.cloneDeep()})}equals(i){return i?this.type===i.type&&Wt(this,i):!1}toString(i){var o=this._getCustomString(i);return typeof o<"u"?o:this._toString(i)}_toString(){throw new Error("_toString not implemented for "+this.type)}toJSON(){throw new Error("Cannot serialize object: toJSON not implemented by "+this.type)}toHTML(i){var o=this._getCustomString(i);return typeof o<"u"?o:this._toHTML(i)}_toHTML(){throw new Error("_toHTML not implemented for "+this.type)}toTex(i){var o=this._getCustomString(i);return typeof o<"u"?o:this._toTex(i)}_toTex(i){throw new Error("_toTex not implemented for "+this.type)}_getCustomString(i){if(i&&typeof i=="object")switch(typeof i.handler){case"object":case"undefined":return;case"function":return i.handler(this,i);default:throw new TypeError("Object or function expected as callback")}}getIdentifier(){return this.type}getContent(){return this}}return n},{isClass:!0,isNode:!0});function Lr(e){return e&&e.isIndexError?new ft(e.index+1,e.min+1,e.max!==void 0?e.max+1:void 0):e}function k0(e){var{subset:r}=e;return function(n,a){try{if(Array.isArray(n))return r(n,a);if(n&&typeof n.subset=="function")return n.subset(a);if(typeof n=="string")return r(n,a);if(typeof n=="object"){if(!a.isObjectProperty())throw new TypeError("Cannot apply a numeric index as object property");return Pr(n,a.getObjectProperty())}else throw new TypeError("Cannot apply index: unsupported type of object")}catch(i){throw Lr(i)}}}var $o="AccessorNode",C5=["subset","Node"],M5=P($o,C5,e=>{var{subset:r,Node:t}=e,n=k0({subset:r});function a(o){return!(fn(o)||Qr(o)||Ze(o)||Gt(o)||Xa(o)||_t(o)||br(o))}class i extends t{constructor(l,u){if(super(),!Qe(l))throw new TypeError('Node expected for parameter "object"');if(!kn(u))throw new TypeError('IndexNode expected for parameter "index"');this.object=l,this.index=u}get name(){return this.index?this.index.isObjectProperty()?this.index.getObjectProperty():"":this.object.name||""}get type(){return $o}get isAccessorNode(){return!0}_compile(l,u){var s=this.object._compile(l,u),c=this.index._compile(l,u);if(this.index.isObjectProperty()){var f=this.index.getObjectProperty();return function(p,v,h){return Pr(s(p,v,h),f)}}else return function(p,v,h){var w=s(p,v,h),b=c(p,v,w);return n(w,b)}}forEach(l){l(this.object,"object",this),l(this.index,"index",this)}map(l){return new i(this._ifNode(l(this.object,"object",this)),this._ifNode(l(this.index,"index",this)))}clone(){return new i(this.object,this.index)}_toString(l){var u=this.object.toString(l);return a(this.object)&&(u="("+u+")"),u+this.index.toString(l)}_toHTML(l){var u=this.object.toHTML(l);return a(this.object)&&(u='('+u+')'),u+this.index.toHTML(l)}_toTex(l){var u=this.object.toTex(l);return a(this.object)&&(u="\\left(' + object + '\\right)"),u+this.index.toTex(l)}toJSON(){return{mathjs:$o,object:this.object,index:this.index}}static fromJSON(l){return new i(l.object,l.index)}}return Nr(i,"name",$o),i},{isClass:!0,isNode:!0}),Io="ArrayNode",_5=["Node"],T5=P(Io,_5,e=>{var{Node:r}=e;class t extends r{constructor(a){if(super(),this.items=a||[],!Array.isArray(this.items)||!this.items.every(Qe))throw new TypeError("Array containing Nodes expected")}get type(){return Io}get isArrayNode(){return!0}_compile(a,i){var o=bn(this.items,function(s){return s._compile(a,i)}),l=a.config.matrix!=="Array";if(l){var u=a.matrix;return function(c,f,m){return u(bn(o,function(p){return p(c,f,m)}))}}else return function(c,f,m){return bn(o,function(p){return p(c,f,m)})}}forEach(a){for(var i=0;i['+i.join(',')+']'}_toTex(a){function i(o,l){var u=o.some(Qr)&&!o.every(Qr),s=l||u,c=s?"&":"\\\\",f=o.map(function(m){return m.items?i(m.items,!l):m.toTex(a)}).join(c);return u||!s||s&&!l?"\\begin{bmatrix}"+f+"\\end{bmatrix}":f}return i(this.items,!1)}}return Nr(t,"name",Io),t},{isClass:!0,isNode:!0});function F5(e){var{subset:r,matrix:t}=e;return function(a,i,o){try{if(Array.isArray(a)){var l=t(a).subset(i,o).valueOf();return l.forEach((u,s)=>{a[s]=u}),a}else{if(a&&typeof a.subset=="function")return a.subset(i,o);if(typeof a=="string")return r(a,i,o);if(typeof a=="object"){if(!i.isObjectProperty())throw TypeError("Cannot apply a numeric index as object property");return la(a,i.getObjectProperty(),o),a}else throw new TypeError("Cannot apply index: unsupported type of object")}}catch(u){throw Lr(u)}}}var Nt=[{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"]},"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:factorial":{op:"!",associativity:"left"}},{"OperatorNode:ctranspose":{op:"'",associativity:"left"}}];function Ro(e,r){if(!r||r!=="auto")return e;for(var t=e;_t(t);)t=t.content;return t}function er(e,r,t,n){var a=e;r!=="keep"&&(a=e.getContent());for(var i=a.getIdentifier(),o=null,l=0;l{var{subset:r,matrix:t,Node:n}=e,a=k0({subset:r}),i=F5({subset:r,matrix:t});function o(u,s,c){s||(s="keep");var f=er(u,s,c),m=er(u.value,s,c);return s==="all"||m!==null&&m<=f}class l extends n{constructor(s,c,f){if(super(),this.object=s,this.index=f?c:null,this.value=f||c,!br(s)&&!fn(s))throw new TypeError('SymbolNode or AccessorNode expected as "object"');if(br(s)&&s.name==="end")throw new Error('Cannot assign to symbol "end"');if(this.index&&!kn(this.index))throw new TypeError('IndexNode expected as "index"');if(!Qe(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 zo}get isAssignmentNode(){return!0}_compile(s,c){var f=this.object._compile(s,c),m=this.index?this.index._compile(s,c):null,p=this.value._compile(s,c),v=this.object.name;if(this.index)if(this.index.isObjectProperty()){var h=this.index.getObjectProperty();return function(N,x,y){var D=f(N,x,y),S=p(N,x,y);return la(D,h,S),S}}else{if(br(this.object))return function(N,x,y){var D=f(N,x,y),S=p(N,x,y),E=m(N,x,D);return N.set(v,i(D,E,S)),S};var w=this.object.object._compile(s,c);if(this.object.index.isObjectProperty()){var b=this.object.index.getObjectProperty();return function(N,x,y){var D=w(N,x,y),S=Pr(D,b),E=m(N,x,S),C=p(N,x,y);return la(D,b,i(S,E,C)),C}}else{var A=this.object.index._compile(s,c);return function(N,x,y){var D=w(N,x,y),S=A(N,x,D),E=a(D,S),C=m(N,x,E),_=p(N,x,y);return i(D,S,i(E,C,_)),_}}}else{if(!br(this.object))throw new TypeError("SymbolNode expected as object");return function(N,x,y){var D=p(N,x,y);return N.set(v,D),D}}}forEach(s){s(this.object,"object",this),this.index&&s(this.index,"index",this),s(this.value,"value",this)}map(s){var c=this._ifNode(s(this.object,"object",this)),f=this.index?this._ifNode(s(this.index,"index",this)):null,m=this._ifNode(s(this.value,"value",this));return new l(c,f,m)}clone(){return new l(this.object,this.index,this.value)}_toString(s){var c=this.object.toString(s),f=this.index?this.index.toString(s):"",m=this.value.toString(s);return o(this,s&&s.parenthesis,s&&s.implicit)&&(m="("+m+")"),c+f+" = "+m}toJSON(){return{mathjs:zo,object:this.object,index:this.index,value:this.value}}static fromJSON(s){return new l(s.object,s.index,s.value)}_toHTML(s){var c=this.object.toHTML(s),f=this.index?this.index.toHTML(s):"",m=this.value.toHTML(s);return o(this,s&&s.parenthesis,s&&s.implicit)&&(m='('+m+')'),c+f+'='+m}_toTex(s){var c=this.object.toTex(s),f=this.index?this.index.toTex(s):"",m=this.value.toTex(s);return o(this,s&&s.parenthesis,s&&s.implicit)&&(m="\\left(".concat(m,"\\right)")),c+f+"="+m}}return Nr(l,"name",zo),l},{isClass:!0,isNode:!0}),Po="BlockNode",I5=["ResultSet","Node"],R5=P(Po,I5,e=>{var{ResultSet:r,Node:t}=e;class n extends t{constructor(i){if(super(),!Array.isArray(i))throw new Error("Array expected");this.blocks=i.map(function(o){var l=o&&o.node,u=o&&o.visible!==void 0?o.visible:!0;if(!Qe(l))throw new TypeError('Property "node" must be a Node');if(typeof u!="boolean")throw new TypeError('Property "visible" must be a boolean');return{node:l,visible:u}})}get type(){return Po}get isBlockNode(){return!0}_compile(i,o){var l=bn(this.blocks,function(u){return{evaluate:u.node._compile(i,o),visible:u.visible}});return function(s,c,f){var m=[];return Nd(l,function(v){var h=v.evaluate(s,c,f);v.visible&&m.push(h)}),new r(m)}}forEach(i){for(var o=0;o;')}).join('
')}_toTex(i){return this.blocks.map(function(o){return o.node.toTex(i)+(o.visible?"":";")}).join(`\\;\\; `)}}return Nr(n,"name",Po),n},{isClass:!0,isNode:!0}),ko="ConditionalNode",z5=["Node"],P5=P(ko,z5,e=>{var{Node:r}=e;function t(a){if(typeof a=="number"||typeof a=="boolean"||typeof a=="string")return!!a;if(a){if(Ie(a))return!a.isZero();if(gt(a))return!!(a.re||a.im);if(Gr(a))return!!a.value}if(a==null)return!1;throw new TypeError('Unsupported type of condition "'+tr(a)+'"')}class n extends r{constructor(i,o,l){if(super(),!Qe(i))throw new TypeError("Parameter condition must be a Node");if(!Qe(o))throw new TypeError("Parameter trueExpr must be a Node");if(!Qe(l))throw new TypeError("Parameter falseExpr must be a Node");this.condition=i,this.trueExpr=o,this.falseExpr=l}get type(){return ko}get isConditionalNode(){return!0}_compile(i,o){var l=this.condition._compile(i,o),u=this.trueExpr._compile(i,o),s=this.falseExpr._compile(i,o);return function(f,m,p){return t(l(f,m,p))?u(f,m,p):s(f,m,p)}}forEach(i){i(this.condition,"condition",this),i(this.trueExpr,"trueExpr",this),i(this.falseExpr,"falseExpr",this)}map(i){return new n(this._ifNode(i(this.condition,"condition",this)),this._ifNode(i(this.trueExpr,"trueExpr",this)),this._ifNode(i(this.falseExpr,"falseExpr",this)))}clone(){return new n(this.condition,this.trueExpr,this.falseExpr)}_toString(i){var o=i&&i.parenthesis?i.parenthesis:"keep",l=er(this,o,i&&i.implicit),u=this.condition.toString(i),s=er(this.condition,o,i&&i.implicit);(o==="all"||this.condition.type==="OperatorNode"||s!==null&&s<=l)&&(u="("+u+")");var c=this.trueExpr.toString(i),f=er(this.trueExpr,o,i&&i.implicit);(o==="all"||this.trueExpr.type==="OperatorNode"||f!==null&&f<=l)&&(c="("+c+")");var m=this.falseExpr.toString(i),p=er(this.falseExpr,o,i&&i.implicit);return(o==="all"||this.falseExpr.type==="OperatorNode"||p!==null&&p<=l)&&(m="("+m+")"),u+" ? "+c+" : "+m}toJSON(){return{mathjs:ko,condition:this.condition,trueExpr:this.trueExpr,falseExpr:this.falseExpr}}static fromJSON(i){return new n(i.condition,i.trueExpr,i.falseExpr)}_toHTML(i){var o=i&&i.parenthesis?i.parenthesis:"keep",l=er(this,o,i&&i.implicit),u=this.condition.toHTML(i),s=er(this.condition,o,i&&i.implicit);(o==="all"||this.condition.type==="OperatorNode"||s!==null&&s<=l)&&(u='('+u+')');var c=this.trueExpr.toHTML(i),f=er(this.trueExpr,o,i&&i.implicit);(o==="all"||this.trueExpr.type==="OperatorNode"||f!==null&&f<=l)&&(c='('+c+')');var m=this.falseExpr.toHTML(i),p=er(this.falseExpr,o,i&&i.implicit);return(o==="all"||this.falseExpr.type==="OperatorNode"||p!==null&&p<=l)&&(m='('+m+')'),u+'?'+c+':'+m}_toTex(i){return"\\begin{cases} {"+this.trueExpr.toTex(i)+"}, &\\quad{\\text{if }\\;"+this.condition.toTex(i)+"}\\\\{"+this.falseExpr.toTex(i)+"}, &\\quad{\\text{otherwise}}\\end{cases}"}}return Nr(n,"name",ko),n},{isClass:!0,isNode:!0}),Yu=Object.assign||function(e){for(var r=1;r1&&arguments[1]!==void 0?arguments[1]:{},t=r.preserveFormatting,n=t===void 0?!1:t,a=r.escapeMapFn,i=a===void 0?L5:a,o=String(e),l="",u=i(Yu({},k5),n?Yu({},q5):{}),s=Object.keys(u),c=function(){var m=!1;s.forEach(function(p,v){m||o.length>=p.length&&o.slice(0,p.length)===p&&(l+=u[s[v]],o=o.slice(p.length,o.length),m=!0)}),m||(l+=o.slice(0,1),o=o.slice(1,o.length))};o;)c();return l};const U5=Zi(V5);var Xu={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{?}"},je={transpose:"^\\top",ctranspose:"^H",factorial:"!",pow:"^",dotPow:".^\\wedge",unaryPlus:"+",unaryMinus:"-",bitNot:"\\~",not:"\\neg",multiply:"\\cdot",divide:"\\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"},q0={abs:{1:"\\left|${args[0]}\\right|"},add:{2:"\\left(${args[0]}".concat(je.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(je.dotDivide,"${args[1]}\\right)")},dotMultiply:{2:"\\left(${args[0]}".concat(je.dotMultiply,"${args[1]}\\right)")},dotPow:{2:"\\left(${args[0]}".concat(je.dotPow,"${args[1]}\\right)")},exp:{1:"\\exp\\left(${args[0]}\\right)"},expm1:"\\left(e".concat(je.pow,"{${args[0]}}-1\\right)"),fix:{1:"\\mathrm{${name}}\\left(${args[0]}\\right)"},floor:{1:"\\left\\lfloor${args[0]}\\right\\rfloor"},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(je.mod,"${args[1]}\\right)")},multiply:{2:"\\left(${args[0]}".concat(je.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(je.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(je.subtract,"${args[1]}\\right)")},unaryMinus:{1:"".concat(je.unaryMinus,"\\left(${args[0]}\\right)")},unaryPlus:{1:"".concat(je.unaryPlus,"\\left(${args[0]}\\right)")},bitAnd:{2:"\\left(${args[0]}".concat(je.bitAnd,"${args[1]}\\right)")},bitNot:{1:je.bitNot+"\\left(${args[0]}\\right)"},bitOr:{2:"\\left(${args[0]}".concat(je.bitOr,"${args[1]}\\right)")},bitXor:{2:"\\left(${args[0]}".concat(je.bitXor,"${args[1]}\\right)")},leftShift:{2:"\\left(${args[0]}".concat(je.leftShift,"${args[1]}\\right)")},rightArithShift:{2:"\\left(${args[0]}".concat(je.rightArithShift,"${args[1]}\\right)")},rightLogShift:{2:"\\left(${args[0]}".concat(je.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(je.and,"${args[1]}\\right)")},not:{1:je.not+"\\left(${args[0]}\\right)"},or:{2:"\\left(${args[0]}".concat(je.or,"${args[1]}\\right)")},xor:{2:"\\left(${args[0]}".concat(je.xor,"${args[1]}\\right)")},cross:{2:"\\left(${args[0]}\\right)\\times\\left(${args[1]}\\right)"},ctranspose:{1:"\\left(${args[0]}\\right)".concat(je.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(je.pow,"{\\frac{1}{2}}")},trace:{1:"\\mathrm{tr}\\left(${args[0]}\\right)"},transpose:{1:"\\left(${args[0]}\\right)".concat(je.transpose)},combinations:{2:"\\binom{${args[0]}}{${args[1]}}"},combinationsWithRep:{2:"\\left(\\!\\!{\\binom{${args[0]}}{${args[1]}}}\\!\\!\\right)"},factorial:{1:"\\left(${args[0]}\\right)".concat(je.factorial)},gamma:{1:"\\Gamma\\left(${args[0]}\\right)"},lgamma:{1:"\\ln\\Gamma\\left(${args[0]}\\right)"},equal:{2:"\\left(${args[0]}".concat(je.equal,"${args[1]}\\right)")},larger:{2:"\\left(${args[0]}".concat(je.larger,"${args[1]}\\right)")},largerEq:{2:"\\left(${args[0]}".concat(je.largerEq,"${args[1]}\\right)")},smaller:{2:"\\left(${args[0]}".concat(je.smaller,"${args[1]}\\right)")},smallerEq:{2:"\\left(${args[0]}".concat(je.smallerEq,"${args[1]}\\right)")},unequal:{2:"\\left(${args[0]}".concat(je.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(je.to,"${args[1]}\\right)")},numeric:function(r,t){return r.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(Xu.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)"}},H5="\\mathrm{${name}}\\left(${args}\\right)",L0={deg:"^\\circ"};function Qu(e){return U5(e,{preserveFormatting:!0})}function V0(e,r){return r=typeof r>"u"?!1:r,r?De(L0,e)?L0[e]:"\\mathrm{"+Qu(e)+"}":De(Xu,e)?Xu[e]:Qu(e)}var qo="ConstantNode",Z5=["Node"],G5=P(qo,Z5,e=>{var{Node:r}=e;class t extends r{constructor(a){super(),this.value=a}get type(){return qo}get isConstantNode(){return!0}_compile(a,i){var o=this.value;return function(){return o}}forEach(a){}map(a){return this.clone()}clone(){return new t(this.value)}_toString(a){return Ve(this.value,a)}_toHTML(a){var i=this._toString(a);switch(tr(this.value)){case"number":case"bigint":case"BigNumber":case"Fraction":return''+i+"";case"string":return''+i+"";case"boolean":return''+i+"";case"null":return''+i+"";case"undefined":return''+i+"";default:return''+i+""}}toJSON(){return{mathjs:qo,value:this.value}}static fromJSON(a){return new t(a.value)}_toTex(a){var i=this._toString(a),o=tr(this.value);switch(o){case"string":return"\\mathtt{"+Qu(i)+"}";case"number":case"BigNumber":{var l=o==="BigNumber"?this.value.isFinite():isFinite(this.value);if(!l)return this.value.valueOf()<0?"-\\infty":"\\infty";var u=i.toLowerCase().indexOf("e");return u!==-1?i.substring(0,u)+"\\cdot10^{"+i.substring(u+1)+"}":i}case"bigint":return i.toString();case"Fraction":return this.value.toLatex();default:return i}}}return Nr(t,"name",qo),t},{isClass:!0,isNode:!0}),Lo="FunctionAssignmentNode",W5=["typed","Node"],j5=P(Lo,W5,e=>{var{typed:r,Node:t}=e;function n(i,o,l){var u=er(i,o,l),s=er(i.expr,o,l);return o==="all"||s!==null&&s<=u}class a extends t{constructor(o,l,u){if(super(),typeof o!="string")throw new TypeError('String expected for parameter "name"');if(!Array.isArray(l))throw new TypeError('Array containing strings or objects expected for parameter "params"');if(!Qe(u))throw new TypeError('Node expected for parameter "expr"');if(P0.has(o))throw new Error('Illegal function name, "'+o+'" is a reserved keyword');var s=new Set;for(var c of l){var f=typeof c=="string"?c:c.name;if(s.has(f))throw new Error('Duplicate parameter name "'.concat(f,'"'));s.add(f)}this.name=o,this.params=l.map(function(m){return m&&m.name||m}),this.types=l.map(function(m){return m&&m.type||"any"}),this.expr=u}get type(){return Lo}get isFunctionAssignmentNode(){return!0}_compile(o,l){var u=Object.create(l);Nd(this.params,function(v){u[v]=!0});var s=this.expr._compile(o,u),c=this.name,f=this.params,m=Ed(this.types,","),p=c+"("+Ed(this.params,", ")+")";return function(h,w,b){var A={};A[m]=function(){for(var N=Object.create(w),x=0;x'+ct(this.params[s])+"");var c=this.expr.toHTML(o);return n(this,l,o&&o.implicit)&&(c='('+c+')'),''+ct(this.name)+'('+u.join(',')+')='+c}_toTex(o){var l=o&&o.parenthesis?o.parenthesis:"keep",u=this.expr.toTex(o);return n(this,l,o&&o.implicit)&&(u="\\left(".concat(u,"\\right)")),"\\mathrm{"+this.name+"}\\left("+this.params.map(V0).join(",")+"\\right)="+u}}return Nr(a,"name",Lo),a},{isClass:!0,isNode:!0}),Vo="IndexNode",K5=["Node","size"],J5=P(Vo,K5,e=>{var{Node:r,size:t}=e;class n extends r{constructor(i,o){if(super(),this.dimensions=i,this.dotNotation=o||!1,!Array.isArray(i)||!i.every(Qe))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 Vo}get isIndexNode(){return!0}_compile(i,o){var l=bn(this.dimensions,function(s,c){var f=s.filter(v=>v.isSymbolNode&&v.name==="end").length>0;if(f){var m=Object.create(o);m.end=!0;var p=s._compile(i,m);return function(h,w,b){if(!_e(b)&&!Xe(b)&&!Cr(b))throw new TypeError('Cannot resolve "end": context must be a Matrix, Array, or string but is '+tr(b));var A=t(b).valueOf(),g=Object.create(w);return g.end=A[c],p(h,g,b)}}else return s._compile(i,o)}),u=Pr(i,"index");return function(c,f,m){var p=bn(l,function(v){return v(c,f,m)});return u(...p)}}forEach(i){for(var o=0;o.'+ct(this.getObjectProperty())+"":'['+o.join(',')+']'}_toTex(i){var o=this.dimensions.map(function(l){return l.toTex(i)});return this.dotNotation?"."+this.getObjectProperty():"_{"+o.join(",")+"}"}}return Nr(n,"name",Vo),n},{isClass:!0,isNode:!0}),Uo="ObjectNode",Y5=["Node"],X5=P(Uo,Y5,e=>{var{Node:r}=e;class t extends r{constructor(a){if(super(),this.properties=a||{},a&&(typeof a!="object"||!Object.keys(a).every(function(i){return Qe(a[i])})))throw new TypeError("Object containing Nodes expected")}get type(){return Uo}get isObjectNode(){return!0}_compile(a,i){var o={};for(var l in this.properties)if(De(this.properties,l)){var u=ba(l),s=JSON.parse(u),c=Pr(this.properties,l);o[s]=c._compile(a,i)}return function(m,p,v){var h={};for(var w in o)De(o,w)&&(h[w]=o[w](m,p,v));return h}}forEach(a){for(var i in this.properties)De(this.properties,i)&&a(this.properties[i],"properties["+ba(i)+"]",this)}map(a){var i={};for(var o in this.properties)De(this.properties,o)&&(i[o]=this._ifNode(a(this.properties[o],"properties["+ba(o)+"]",this)));return new t(i)}clone(){var a={};for(var i in this.properties)De(this.properties,i)&&(a[i]=this.properties[i]);return new t(a)}_toString(a){var i=[];for(var o in this.properties)De(this.properties,o)&&i.push(ba(o)+": "+this.properties[o].toString(a));return"{"+i.join(", ")+"}"}toJSON(){return{mathjs:Uo,properties:this.properties}}static fromJSON(a){return new t(a.properties)}_toHTML(a){var i=[];for(var o in this.properties)De(this.properties,o)&&i.push(''+ct(o)+':'+this.properties[o].toHTML(a));return'{'+i.join(',')+'}'}_toTex(a){var i=[];for(var o in this.properties)De(this.properties,o)&&i.push("\\mathbf{"+o+":} & "+this.properties[o].toTex(a)+"\\\\");var l="\\left\\{\\begin{array}{ll}"+i.join(` `)+"\\end{array}\\right\\}";return l}}return Nr(t,"name",Uo),t},{isClass:!0,isNode:!0});function ci(e,r){return new wm(e,new Ji(r),new Set(Object.keys(r)))}var Ho="OperatorNode",Q5=["Node"],e8=P(Ho,Q5,e=>{var{Node:r}=e;function t(i,o){var l=i;if(o==="auto")for(;_t(l);)l=l.content;return Ze(l)?!0:pr(l)?t(l.args[0],o):!1}function n(i,o,l,u,s){var c=er(i,o,l),f=li(i,o);if(o==="all"||u.length>2&&i.getIdentifier()!=="OperatorNode:add"&&i.getIdentifier()!=="OperatorNode:multiply")return u.map(function(C){switch(C.getContent().type){case"ArrayNode":case"ConstantNode":case"SymbolNode":case"ParenthesisNode":return!1;default:return!0}});var m;switch(u.length){case 0:m=[];break;case 1:{var p=er(u[0],o,l,i);if(s&&p!==null){var v,h;if(o==="keep"?(v=u[0].getIdentifier(),h=i.getIdentifier()):(v=u[0].getContent().getIdentifier(),h=i.getContent().getIdentifier()),Nt[c][h].latexLeftParens===!1){m=[!1];break}if(Nt[p][v].latexParens===!1){m=[!1];break}}if(p===null){m=[!1];break}if(p<=c){m=[!0];break}m=[!1]}break;case 2:{var w,b=er(u[0],o,l,i),A=Ju(i,u[0],o);b===null?w=!1:b===c&&f==="right"&&!A||b=2&&i.getIdentifier()==="OperatorNode:multiply"&&i.implicit&&o!=="all"&&l==="hide")for(var E=1;E2&&(this.getIdentifier()==="OperatorNode:add"||this.getIdentifier()==="OperatorNode:multiply")){var w=s.map(function(b,A){return b=b.toString(o),c[A]&&(b="("+b+")"),b});return this.implicit&&this.getIdentifier()==="OperatorNode:multiply"&&u==="hide"?w.join(" "):w.join(" "+this.op+" ")}else return this.fn+"("+this.args.join(", ")+")"}toJSON(){return{mathjs:Ho,op:this.op,fn:this.fn,args:this.args,implicit:this.implicit,isPercentage:this.isPercentage}}static fromJSON(o){return new a(o.op,o.fn,o.args,o.implicit,o.isPercentage)}_toHTML(o){var l=o&&o.parenthesis?o.parenthesis:"keep",u=o&&o.implicit?o.implicit:"hide",s=this.args,c=n(this,l,u,s,!1);if(s.length===1){var f=li(this,l),m=s[0].toHTML(o);return c[0]&&(m='('+m+')'),f==="right"?''+ct(this.op)+""+m:m+''+ct(this.op)+""}else if(s.length===2){var p=s[0].toHTML(o),v=s[1].toHTML(o);return c[0]&&(p='('+p+')'),c[1]&&(v='('+v+')'),this.implicit&&this.getIdentifier()==="OperatorNode:multiply"&&u==="hide"?p+''+v:p+''+ct(this.op)+""+v}else{var h=s.map(function(w,b){return w=w.toHTML(o),c[b]&&(w='('+w+')'),w});return s.length>2&&(this.getIdentifier()==="OperatorNode:add"||this.getIdentifier()==="OperatorNode:multiply")?this.implicit&&this.getIdentifier()==="OperatorNode:multiply"&&u==="hide"?h.join(''):h.join(''+ct(this.op)+""):''+ct(this.fn)+'('+h.join(',')+')'}}_toTex(o){var l=o&&o.parenthesis?o.parenthesis:"keep",u=o&&o.implicit?o.implicit:"hide",s=this.args,c=n(this,l,u,s,!0),f=je[this.fn];if(f=typeof f>"u"?this.op:f,s.length===1){var m=li(this,l),p=s[0].toTex(o);return c[0]&&(p="\\left(".concat(p,"\\right)")),m==="right"?f+p:p+f}else if(s.length===2){var v=s[0],h=v.toTex(o);c[0]&&(h="\\left(".concat(h,"\\right)"));var w=s[1],b=w.toTex(o);c[1]&&(b="\\left(".concat(b,"\\right)"));var A;switch(l==="keep"?A=v.getIdentifier():A=v.getContent().getIdentifier(),this.getIdentifier()){case"OperatorNode:divide":return f+"{"+h+"}{"+b+"}";case"OperatorNode:pow":switch(h="{"+h+"}",b="{"+b+"}",A){case"ConditionalNode":case"OperatorNode:divide":h="\\left(".concat(h,"\\right)")}break;case"OperatorNode:multiply":if(this.implicit&&u==="hide")return h+"~"+b}return h+f+b}else if(s.length>2&&(this.getIdentifier()==="OperatorNode:add"||this.getIdentifier()==="OperatorNode:multiply")){var g=s.map(function(N,x){return N=N.toTex(o),c[x]&&(N="\\left(".concat(N,"\\right)")),N});return this.getIdentifier()==="OperatorNode:multiply"&&this.implicit&&u==="hide"?g.join("~"):g.join(f)}else return"\\mathrm{"+this.fn+"}\\left("+s.map(function(N){return N.toTex(o)}).join(",")+"\\right)"}getIdentifier(){return this.type+":"+this.fn}}return Nr(a,"name",Ho),a},{isClass:!0,isNode:!0}),Zo="ParenthesisNode",r8=["Node"],t8=P(Zo,r8,e=>{var{Node:r}=e;class t extends r{constructor(a){if(super(),!Qe(a))throw new TypeError('Node expected for parameter "content"');this.content=a}get type(){return Zo}get isParenthesisNode(){return!0}_compile(a,i){return this.content._compile(a,i)}getContent(){return this.content.getContent()}forEach(a){a(this.content,"content",this)}map(a){var i=a(this.content,"content",this);return new t(i)}clone(){return new t(this.content)}_toString(a){return!a||a&&!a.parenthesis||a&&a.parenthesis==="keep"?"("+this.content.toString(a)+")":this.content.toString(a)}toJSON(){return{mathjs:Zo,content:this.content}}static fromJSON(a){return new t(a.content)}_toHTML(a){return!a||a&&!a.parenthesis||a&&a.parenthesis==="keep"?'('+this.content.toHTML(a)+')':this.content.toHTML(a)}_toTex(a){return!a||a&&!a.parenthesis||a&&a.parenthesis==="keep"?"\\left(".concat(this.content.toTex(a),"\\right)"):this.content.toTex(a)}}return Nr(t,"name",Zo),t},{isClass:!0,isNode:!0}),Go="RangeNode",n8=["Node"],a8=P(Go,n8,e=>{var{Node:r}=e;function t(a,i,o){var l=er(a,i,o),u={},s=er(a.start,i,o);if(u.start=s!==null&&s<=l||i==="all",a.step){var c=er(a.step,i,o);u.step=c!==null&&c<=l||i==="all"}var f=er(a.end,i,o);return u.end=f!==null&&f<=l||i==="all",u}class n extends r{constructor(i,o,l){if(super(),!Qe(i))throw new TypeError("Node expected");if(!Qe(o))throw new TypeError("Node expected");if(l&&!Qe(l))throw new TypeError("Node expected");if(arguments.length>3)throw new Error("Too many arguments");this.start=i,this.end=o,this.step=l||null}get type(){return Go}get isRangeNode(){return!0}needsEnd(){var i=this.filter(function(o){return br(o)&&o.name==="end"});return i.length>0}_compile(i,o){var l=i.range,u=this.start._compile(i,o),s=this.end._compile(i,o);if(this.step){var c=this.step._compile(i,o);return function(m,p,v){return l(u(m,p,v),s(m,p,v),c(m,p,v))}}else return function(m,p,v){return l(u(m,p,v),s(m,p,v))}}forEach(i){i(this.start,"start",this),i(this.end,"end",this),this.step&&i(this.step,"step",this)}map(i){return new n(this._ifNode(i(this.start,"start",this)),this._ifNode(i(this.end,"end",this)),this.step&&this._ifNode(i(this.step,"step",this)))}clone(){return new n(this.start,this.end,this.step&&this.step)}_toString(i){var o=i&&i.parenthesis?i.parenthesis:"keep",l=t(this,o,i&&i.implicit),u,s=this.start.toString(i);if(l.start&&(s="("+s+")"),u=s,this.step){var c=this.step.toString(i);l.step&&(c="("+c+")"),u+=":"+c}var f=this.end.toString(i);return l.end&&(f="("+f+")"),u+=":"+f,u}toJSON(){return{mathjs:Go,start:this.start,end:this.end,step:this.step}}static fromJSON(i){return new n(i.start,i.end,i.step)}_toHTML(i){var o=i&&i.parenthesis?i.parenthesis:"keep",l=t(this,o,i&&i.implicit),u,s=this.start.toHTML(i);if(l.start&&(s='('+s+')'),u=s,this.step){var c=this.step.toHTML(i);l.step&&(c='('+c+')'),u+=':'+c}var f=this.end.toHTML(i);return l.end&&(f='('+f+')'),u+=':'+f,u}_toTex(i){var o=i&&i.parenthesis?i.parenthesis:"keep",l=t(this,o,i&&i.implicit),u=this.start.toTex(i);if(l.start&&(u="\\left(".concat(u,"\\right)")),this.step){var s=this.step.toTex(i);l.step&&(s="\\left(".concat(s,"\\right)")),u+=":"+s}var c=this.end.toTex(i);return l.end&&(c="\\left(".concat(c,"\\right)")),u+=":"+c,u}}return Nr(n,"name",Go),n},{isClass:!0,isNode:!0}),Wo="RelationalNode",i8=["Node"],o8=P(Wo,i8,e=>{var{Node:r}=e,t={equal:"==",unequal:"!=",smaller:"<",larger:">",smallerEq:"<=",largerEq:">="};class n extends r{constructor(i,o){if(super(),!Array.isArray(i))throw new TypeError("Parameter conditionals must be an array");if(!Array.isArray(o))throw new TypeError("Parameter params must be an array");if(i.length!==o.length-1)throw new TypeError("Parameter params must contain exactly one more element than parameter conditionals");this.conditionals=i,this.params=o}get type(){return Wo}get isRelationalNode(){return!0}_compile(i,o){var l=this,u=this.params.map(s=>s._compile(i,o));return function(c,f,m){for(var p,v=u[0](c,f,m),h=0;hi(o,"params["+l+"]",this),this)}map(i){return new n(this.conditionals.slice(),this.params.map((o,l)=>this._ifNode(i(o,"params["+l+"]",this)),this))}clone(){return new n(this.conditionals,this.params)}_toString(i){for(var o=i&&i.parenthesis?i.parenthesis:"keep",l=er(this,o,i&&i.implicit),u=this.params.map(function(f,m){var p=er(f,o,i&&i.implicit);return o==="all"||p!==null&&p<=l?"("+f.toString(i)+")":f.toString(i)}),s=u[0],c=0;c('+f.toHTML(i)+')':f.toHTML(i)}),s=u[0],c=0;c'+ct(t[this.conditionals[c]])+""+u[c+1];return s}_toTex(i){for(var o=i&&i.parenthesis?i.parenthesis:"keep",l=er(this,o,i&&i.implicit),u=this.params.map(function(f,m){var p=er(f,o,i&&i.implicit);return o==="all"||p!==null&&p<=l?"\\left("+f.toTex(i)+"\right)":f.toTex(i)}),s=u[0],c=0;c{var{math:r,Unit:t,Node:n}=e;function a(o){return t?t.isValuelessUnit(o):!1}class i extends n{constructor(l){if(super(),typeof l!="string")throw new TypeError('String expected for parameter "name"');this.name=l}get type(){return"SymbolNode"}get isSymbolNode(){return!0}_compile(l,u){var s=this.name;if(u[s]===!0)return function(f,m,p){return Pr(m,s)};if(s in l)return function(f,m,p){return f.has(s)?f.get(s):Pr(l,s)};var c=a(s);return function(f,m,p){return f.has(s)?f.get(s):c?new t(null,s):i.onUndefinedSymbol(s)}}forEach(l){}map(l){return this.clone()}static onUndefinedSymbol(l){throw new Error("Undefined symbol "+l)}clone(){return new i(this.name)}_toString(l){return this.name}_toHTML(l){var u=ct(this.name);return u==="true"||u==="false"?''+u+"":u==="i"?''+u+"":u==="Infinity"?''+u+"":u==="NaN"?''+u+"":u==="null"?''+u+"":u==="undefined"?''+u+"":''+u+""}toJSON(){return{mathjs:"SymbolNode",name:this.name}}static fromJSON(l){return new i(l.name)}_toTex(l){var u=!1;typeof r[this.name]>"u"&&a(this.name)&&(u=!0);var s=V0(this.name,u);return s[0]==="\\"?s:" "+s}}return i},{isClass:!0,isNode:!0}),jo="FunctionNode",c8=["math","Node","SymbolNode"],f8=P(jo,c8,e=>{var r,{math:t,Node:n,SymbolNode:a}=e,i=u=>Ve(u,{truncate:78});function o(u,s,c){for(var f="",m=/\$(?:\{([a-z_][a-z_0-9]*)(?:\[([0-9]+)\])?\}|\$)/gi,p=0,v;(v=m.exec(u))!==null;)if(f+=u.substring(p,v.index),p=v.index,v[0]==="$$")f+="$",p++;else{p+=v[0].length;var h=s[v[1]];if(!h)throw new ReferenceError("Template: Property "+v[1]+" does not exist.");if(v[2]===void 0)switch(typeof h){case"string":f+=h;break;case"object":if(Qe(h))f+=h.toTex(c);else if(Array.isArray(h))f+=h.map(function(w,b){if(Qe(w))return w.toTex(c);throw new TypeError("Template: "+v[1]+"["+b+"] is not a Node.")}).join(",");else throw new TypeError("Template: "+v[1]+" has to be a Node, String or array of Nodes");break;default:throw new TypeError("Template: "+v[1]+" has to be a Node, String or array of Nodes")}else if(Qe(h[v[2]]&&h[v[2]]))f+=h[v[2]].toTex(c);else throw new TypeError("Template: "+v[1]+"["+v[2]+"] is not a Node.")}return f+=u.slice(p),f}class l extends n{constructor(s,c){if(super(),typeof s=="string"&&(s=new a(s)),!Qe(s))throw new TypeError('Node expected as parameter "fn"');if(!Array.isArray(c)||!c.every(Qe))throw new TypeError('Array containing Nodes expected for parameter "args"');this.fn=s,this.args=c||[]}get name(){return this.fn.name||""}get type(){return jo}get isFunctionNode(){return!0}_compile(s,c){var f=this.args.map(S=>S._compile(s,c));if(br(this.fn)){var m=this.fn.name;if(c[m]){var b=this.args;return function(E,C,_){var F=Pr(C,m);if(typeof F!="function")throw new TypeError("Argument '".concat(m,"' was not a function; received: ").concat(i(F)));if(F.rawArgs)return F(b,s,ci(E,C));var I=f.map(R=>R(E,C,_));return F.apply(F,I)}}else{var p=m in s?Pr(s,m):void 0,v=typeof p=="function"&&p.rawArgs===!0,h=S=>{var E;if(S.has(m))E=S.get(m);else if(m in s)E=Pr(s,m);else return l.onUndefinedFunction(m);if(typeof E=="function")return E;throw new TypeError("'".concat(m,`' is not a function; its value is: `).concat(i(E)))};if(v){var w=this.args;return function(E,C,_){var F=h(E);if(F.rawArgs===!0)return F(w,s,ci(E,C));var I=f.map(R=>R(E,C,_));return F(...I)}}else switch(f.length){case 0:return function(E,C,_){var F=h(E);return F()};case 1:return function(E,C,_){var F=h(E),I=f[0];return F(I(E,C,_))};case 2:return function(E,C,_){var F=h(E),I=f[0],R=f[1];return F(I(E,C,_),R(E,C,_))};default:return function(E,C,_){var F=h(E),I=f.map(R=>R(E,C,_));return F(...I)}}}}else if(fn(this.fn)&&kn(this.fn.index)&&this.fn.index.isObjectProperty()){var A=this.fn.object._compile(s,c),g=this.fn.index.getObjectProperty(),N=this.args;return function(E,C,_){var F=A(E,C,_),I=YD(F,g);if(I!=null&&I.rawArgs)return I(N,s,ci(E,C));var R=f.map($=>$(E,C,_));return I.apply(F,R)}}else{var x=this.fn.toString(),y=this.fn._compile(s,c),D=this.args;return function(E,C,_){var F=y(E,C,_);if(typeof F!="function")throw new TypeError("Expression '".concat(x,"' did not evaluate to a function; value is:")+` `.concat(i(F)));if(F.rawArgs)return F(D,s,ci(E,C));var I=f.map(R=>R(E,C,_));return F.apply(F,I)}}}forEach(s){s(this.fn,"fn",this);for(var c=0;c'+ct(this.fn)+'('+c.join(',')+')'}toTex(s){var c;return s&&typeof s.handler=="object"&&De(s.handler,this.name)&&(c=s.handler[this.name](this,s)),typeof c<"u"?c:super.toTex(s)}_toTex(s){var c=this.args.map(function(p){return p.toTex(s)}),f;q0[this.name]&&(f=q0[this.name]),t[this.name]&&(typeof t[this.name].toTex=="function"||typeof t[this.name].toTex=="object"||typeof t[this.name].toTex=="string")&&(f=t[this.name].toTex);var m;switch(typeof f){case"function":m=f(this,s);break;case"string":m=o(f,this,s);break;case"object":switch(typeof f[c.length]){case"function":m=f[c.length](this,s);break;case"string":m=o(f[c.length],this,s);break}}return typeof m<"u"?m:o(H5,this,s)}getIdentifier(){return this.type+":"+this.name}}return r=l,Nr(l,"name",jo),Nr(l,"onUndefinedFunction",function(u){throw new Error("Undefined function "+u)}),Nr(l,"fromJSON",function(u){return new r(u.fn,u.args)}),l},{isClass:!0,isNode:!0}),U0="parse",m8=["typed","numeric","config","AccessorNode","ArrayNode","AssignmentNode","BlockNode","ConditionalNode","ConstantNode","FunctionAssignmentNode","FunctionNode","IndexNode","ObjectNode","OperatorNode","ParenthesisNode","RangeNode","RelationalNode","SymbolNode"],d8=P(U0,m8,e=>{var{typed:r,numeric:t,config:n,AccessorNode:a,ArrayNode:i,AssignmentNode:o,BlockNode:l,ConditionalNode:u,ConstantNode:s,FunctionAssignmentNode:c,FunctionNode:f,IndexNode:m,ObjectNode:p,OperatorNode:v,ParenthesisNode:h,RangeNode:w,RelationalNode:b,SymbolNode:A}=e,g=r(U0,{string:function(J){return X(J,{})},"Array | Matrix":function(J){return N(J,{})},"string, Object":function(J,ue){var ge=ue.nodes!==void 0?ue.nodes:{};return X(J,ge)},"Array | Matrix, Object":N});function N(B){var J=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},ue=J.nodes!==void 0?J.nodes:{};return Le(B,function(ge){if(typeof ge!="string")throw new TypeError("String expected");return X(ge,ue)})}var x={NULL:0,DELIMITER:1,NUMBER:2,SYMBOL:3,UNKNOWN:4},y={",":!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},D={mod:!0,to:!0,in:!0,and:!0,xor:!0,or:!0,not:!0},S={true:!0,false:!1,null:null,undefined:void 0},E=["NaN","Infinity"],C={'"':'"',"'":"'","\\":"\\","/":"/",b:"\b",f:"\f",n:` `,r:"\r",t:" "};function _(){return{extraNodes:{},expression:"",comment:"",index:0,token:"",tokenType:x.NULL,nestingLevel:0,conditionalLevel:null}}function F(B,J){return B.expression.substr(B.index,J)}function I(B){return F(B,1)}function R(B){B.index++}function $(B){return B.expression.charAt(B.index-1)}function M(B){return B.expression.charAt(B.index+1)}function T(B){for(B.tokenType=x.NULL,B.token="",B.comment="";;){if(I(B)==="#")for(;I(B)!==` `&&I(B)!=="";)B.comment+=I(B),R(B);if(g.isWhitespace(I(B),B.nestingLevel))R(B);else break}if(I(B)===""){B.tokenType=x.DELIMITER;return}if(I(B)===` `&&!B.nestingLevel){B.tokenType=x.DELIMITER,B.token=I(B),R(B);return}var J=I(B),ue=F(B,2),ge=F(B,3);if(ge.length===3&&y[ge]){B.tokenType=x.DELIMITER,B.token=ge,R(B),R(B),R(B);return}if(ue.length===2&&y[ue]){B.tokenType=x.DELIMITER,B.token=ue,R(B),R(B);return}if(y[J]){B.tokenType=x.DELIMITER,B.token=J,R(B);return}if(g.isDigitDot(J)){B.tokenType=x.NUMBER;var Te=F(B,2);if(Te==="0b"||Te==="0o"||Te==="0x"){for(B.token+=I(B),R(B),B.token+=I(B),R(B);g.isHexDigit(I(B));)B.token+=I(B),R(B);if(I(B)===".")for(B.token+=".",R(B);g.isHexDigit(I(B));)B.token+=I(B),R(B);else if(I(B)==="i")for(B.token+="i",R(B);g.isDigit(I(B));)B.token+=I(B),R(B);return}if(I(B)==="."){if(B.token+=I(B),R(B),!g.isDigit(I(B))){B.tokenType=x.DELIMITER;return}}else{for(;g.isDigit(I(B));)B.token+=I(B),R(B);g.isDecimalMark(I(B),M(B))&&(B.token+=I(B),R(B))}for(;g.isDigit(I(B));)B.token+=I(B),R(B);if(I(B)==="E"||I(B)==="e"){if(g.isDigit(M(B))||M(B)==="-"||M(B)==="+"){if(B.token+=I(B),R(B),(I(B)==="+"||I(B)==="-")&&(B.token+=I(B),R(B)),!g.isDigit(I(B)))throw Oe(B,'Digit expected, got "'+I(B)+'"');for(;g.isDigit(I(B));)B.token+=I(B),R(B);if(g.isDecimalMark(I(B),M(B)))throw Oe(B,'Digit expected, got "'+I(B)+'"')}else if(M(B)===".")throw R(B),Oe(B,'Digit expected, got "'+I(B)+'"')}return}if(g.isAlpha(I(B),$(B),M(B))){for(;g.isAlpha(I(B),$(B),M(B))||g.isDigit(I(B));)B.token+=I(B),R(B);De(D,B.token)?B.tokenType=x.DELIMITER:B.tokenType=x.SYMBOL;return}for(B.tokenType=x.UNKNOWN;I(B)!=="";)B.token+=I(B),R(B);throw Oe(B,'Syntax error in part "'+B.token+'"')}function k(B){do T(B);while(B.token===` `)}function O(B){B.nestingLevel++}function W(B){B.nestingLevel--}g.isAlpha=function(J,ue,ge){return g.isValidLatinOrGreek(J)||g.isValidMathSymbol(J,ge)||g.isValidMathSymbol(ue,J)},g.isValidLatinOrGreek=function(J){return/^[a-zA-Z_$\u00C0-\u02AF\u0370-\u03FF\u2100-\u214F]$/.test(J)},g.isValidMathSymbol=function(J,ue){return/^[\uD835]$/.test(J)&&/^[\uDC00-\uDFFF]$/.test(ue)&&/^[^\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(ue)},g.isWhitespace=function(J,ue){return J===" "||J===" "||J===` `&&ue>0},g.isDecimalMark=function(J,ue){return J==="."&&ue!=="/"&&ue!=="*"&&ue!=="^"},g.isDigitDot=function(J){return J>="0"&&J<="9"||J==="."},g.isDigit=function(J){return J>="0"&&J<="9"},g.isHexDigit=function(J){return J>="0"&&J<="9"||J>="a"&&J<="f"||J>="A"&&J<="F"};function X(B,J){var ue=_();Br(ue,{expression:B,extraNodes:J}),T(ue);var ge=U(ue);if(ue.token!=="")throw ue.tokenType===x.DELIMITER?sr(ue,"Unexpected operator "+ue.token):Oe(ue,'Unexpected part "'+ue.token+'"');return ge}function U(B){var J,ue=[],ge;for(B.token!==""&&B.token!==` `&&B.token!==";"&&(J=z(B),B.comment&&(J.comment=B.comment));B.token===` `||B.token===";";)ue.length===0&&J&&(ge=B.token!==";",ue.push({node:J,visible:ge})),T(B),B.token!==` `&&B.token!==";"&&B.token!==""&&(J=z(B),B.comment&&(J.comment=B.comment),ge=B.token!==";",ue.push({node:J,visible:ge}));return ue.length>0?new l(ue):(J||(J=new s(void 0),B.comment&&(J.comment=B.comment)),J)}function z(B){var J,ue,ge,Te,ke=Q(B);if(B.token==="="){if(br(ke))return J=ke.name,k(B),ge=z(B),new o(new A(J),ge);if(fn(ke))return k(B),ge=z(B),new o(ke.object,ke.index,ge);if(Gt(ke)&&br(ke.fn)&&(Te=!0,ue=[],J=ke.name,ke.args.forEach(function(Vr,mi){br(Vr)?ue[mi]=Vr.name:Te=!1}),Te))return k(B),ge=z(B),new c(J,ue,ge);throw Oe(B,"Invalid left hand side of assignment operator =")}return ke}function Q(B){for(var J=se(B);B.token==="?";){var ue=B.conditionalLevel;B.conditionalLevel=B.nestingLevel,k(B);var ge=J,Te=z(B);if(B.token!==":")throw Oe(B,"False part of conditional expression expected");B.conditionalLevel=null,k(B);var ke=z(B);J=new u(ge,Te,ke),B.conditionalLevel=ue}return J}function se(B){for(var J=re(B);B.token==="or";)k(B),J=new v("or","or",[J,re(B)]);return J}function re(B){for(var J=q(B);B.token==="xor";)k(B),J=new v("xor","xor",[J,q(B)]);return J}function q(B){for(var J=Z(B);B.token==="and";)k(B),J=new v("and","and",[J,Z(B)]);return J}function Z(B){for(var J=j(B);B.token==="|";)k(B),J=new v("|","bitOr",[J,j(B)]);return J}function j(B){for(var J=Y(B);B.token==="^|";)k(B),J=new v("^|","bitXor",[J,Y(B)]);return J}function Y(B){for(var J=ee(B);B.token==="&";)k(B),J=new v("&","bitAnd",[J,ee(B)]);return J}function ee(B){for(var J=[te(B)],ue=[],ge={"==":"equal","!=":"unequal","<":"smaller",">":"larger","<=":"smallerEq",">=":"largerEq"};De(ge,B.token);){var Te={name:B.token,fn:ge[B.token]};ue.push(Te),k(B),J.push(te(B))}return J.length===1?J[0]:J.length===2?new v(ue[0].name,ue[0].fn,J):new b(ue.map(ke=>ke.fn),J)}function te(B){var J,ue,ge,Te;J=oe(B);for(var ke={"<<":"leftShift",">>":"rightArithShift",">>>":"rightLogShift"};De(ke,B.token);)ue=B.token,ge=ke[ue],k(B),Te=[J,oe(B)],J=new v(ue,ge,Te);return J}function oe(B){var J,ue,ge,Te;J=ve(B);for(var ke={to:"to",in:"to"};De(ke,B.token);)ue=B.token,ge=ke[ue],k(B),ue==="in"&&B.token===""?J=new v("*","multiply",[J,new A("in")],!0):(Te=[J,ve(B)],J=new v(ue,ge,Te));return J}function ve(B){var J,ue=[];if(B.token===":"?J=new s(1):J=L(B),B.token===":"&&B.conditionalLevel!==B.nestingLevel){for(ue.push(J);B.token===":"&&ue.length<3;)k(B),B.token===")"||B.token==="]"||B.token===","||B.token===""?ue.push(new A("end")):ue.push(L(B));ue.length===3?J=new w(ue[0],ue[2],ue[1]):J=new w(ue[0],ue[1])}return J}function L(B){var J,ue,ge,Te;J=H(B);for(var ke={"+":"add","-":"subtract"};De(ke,B.token);){ue=B.token,ge=ke[ue],k(B);var Vr=H(B);Vr.isPercentage?Te=[J,new v("*","multiply",[J,Vr])]:Te=[J,Vr],J=new v(ue,ge,Te)}return J}function H(B){var J,ue,ge,Te;J=ne(B),ue=J;for(var ke={"*":"multiply",".*":"dotMultiply","/":"divide","./":"dotDivide"};De(ke,B.token);)ge=B.token,Te=ke[ge],k(B),ue=ne(B),J=new v(ge,Te,[J,ue]);return J}function ne(B){var J,ue;for(J=ie(B),ue=J;B.tokenType===x.SYMBOL||B.token==="in"&&Ze(J)||B.token==="in"&&pr(J)&&J.fn==="unaryMinus"&&Ze(J.args[0])||B.tokenType===x.NUMBER&&!Ze(ue)&&(!pr(ue)||ue.op==="!")||B.token==="(";)ue=ie(B),J=new v("*","multiply",[J,ue],!0);return J}function ie(B){for(var J=de(B),ue=J,ge=[];B.token==="/"&&fu(ue);)if(ge.push(Br({},B)),k(B),B.tokenType===x.NUMBER)if(ge.push(Br({},B)),k(B),B.tokenType===x.SYMBOL||B.token==="("||B.token==="in")Br(B,ge.pop()),ge.pop(),ue=de(B),J=new v("/","divide",[J,ue]);else{ge.pop(),Br(B,ge.pop());break}else{Br(B,ge.pop());break}return J}function de(B){var J,ue,ge,Te;J=me(B);for(var ke={"%":"mod",mod:"mod"};De(ke,B.token);)ue=B.token,ge=ke[ue],k(B),ue==="%"&&B.tokenType===x.DELIMITER&&B.token!=="("?J=new v("/","divide",[J,new s(100)],!1,!0):(Te=[J,me(B)],J=new v(ue,ge,Te));return J}function me(B){var J,ue,ge,Te={"-":"unaryMinus","+":"unaryPlus","~":"bitNot",not:"not"};return De(Te,B.token)?(ge=Te[B.token],J=B.token,k(B),ue=[me(B)],new v(J,ge,ue)):be(B)}function be(B){var J,ue,ge,Te;return J=Ne(B),(B.token==="^"||B.token===".^")&&(ue=B.token,ge=ue==="^"?"pow":"dotPow",k(B),Te=[J,me(B)],J=new v(ue,ge,Te)),J}function Ne(B){var J,ue,ge,Te;J=V(B);for(var ke={"!":"factorial","'":"ctranspose"};De(ke,B.token);)ue=B.token,ge=ke[ue],T(B),Te=[J],J=new v(ue,ge,Te),J=G(B,J);return J}function V(B){var J=[];if(B.tokenType===x.SYMBOL&&De(B.extraNodes,B.token)){var ue=B.extraNodes[B.token];if(T(B),B.token==="("){if(J=[],O(B),T(B),B.token!==")")for(J.push(z(B));B.token===",";)T(B),J.push(z(B));if(B.token!==")")throw Oe(B,"Parenthesis ) expected");W(B),T(B)}return new ue(J)}return K(B)}function K(B){var J,ue;return B.tokenType===x.SYMBOL||B.tokenType===x.DELIMITER&&B.token in D?(ue=B.token,T(B),De(S,ue)?J=new s(S[ue]):E.includes(ue)?J=new s(t(ue,"number")):J=new A(ue),J=G(B,J),J):ae(B)}function G(B,J,ue){for(var ge;B.token==="("||B.token==="["||B.token===".";)if(ge=[],B.token==="(")if(br(J)||fn(J)){if(O(B),T(B),B.token!==")")for(ge.push(z(B));B.token===",";)T(B),ge.push(z(B));if(B.token!==")")throw Oe(B,"Parenthesis ) expected");W(B),T(B),J=new f(J,ge)}else return J;else if(B.token==="["){if(O(B),T(B),B.token!=="]")for(ge.push(z(B));B.token===",";)T(B),ge.push(z(B));if(B.token!=="]")throw Oe(B,"Parenthesis ] expected");W(B),T(B),J=new a(J,new m(ge))}else{T(B);var Te=B.tokenType===x.SYMBOL||B.tokenType===x.DELIMITER&&B.token in D;if(!Te)throw Oe(B,"Property name expected after dot");ge.push(new s(B.token)),T(B);var ke=!0;J=new a(J,new m(ge,ke))}return J}function ae(B){var J,ue;return B.token==='"'||B.token==="'"?(ue=ce(B,B.token),J=new s(ue),J=G(B,J),J):fe(B)}function ce(B,J){for(var ue="";I(B)!==""&&I(B)!==J;)if(I(B)==="\\"){R(B);var ge=I(B),Te=C[ge];if(Te!==void 0)ue+=Te,B.index+=1;else if(ge==="u"){var ke=B.expression.slice(B.index+1,B.index+5);if(/^[0-9A-Fa-f]{4}$/.test(ke))ue+=String.fromCharCode(parseInt(ke,16)),B.index+=5;else throw Oe(B,"Invalid unicode character \\u".concat(ke))}else throw Oe(B,"Bad escape character \\".concat(ge))}else ue+=I(B),R(B);if(T(B),B.token!==J)throw Oe(B,"End of string ".concat(J," expected"));return T(B),ue}function fe(B){var J,ue,ge,Te;if(B.token==="["){if(O(B),T(B),B.token!=="]"){var ke=xe(B);if(B.token===";"){for(ge=1,ue=[ke];B.token===";";)T(B),B.token!=="]"&&(ue[ge]=xe(B),ge++);if(B.token!=="]")throw Oe(B,"End of matrix ] expected");W(B),T(B),Te=ue[0].items.length;for(var Vr=1;Vr{var{typed:r,parse:t}=e;return r(H0,{string:function(a){return t(a).compile()},"Array | Matrix":function(a){return Le(a,function(i){return t(i).compile()})}})}),Z0="evaluate",h8=["typed","parse"],g8=P(Z0,h8,e=>{var{typed:r,parse:t}=e;return r(Z0,{string:function(a){var i=Ka();return t(a).compile().evaluate(i)},"string, Map | Object":function(a,i){return t(a).compile().evaluate(i)},"Array | Matrix":function(a){var i=Ka();return Le(a,function(o){return t(o).compile().evaluate(i)})},"Array | Matrix, Map | Object":function(a,i){return Le(a,function(o){return t(o).compile().evaluate(i)})}})}),y8="Parser",b8=["evaluate","parse"],w8=P(y8,b8,e=>{var{evaluate:r,parse:t}=e;function n(){if(!(this instanceof n))throw new SyntaxError("Constructor must be called with the new operator");Object.defineProperty(this,"scope",{value:Ka(),writable:!1})}n.prototype.type="Parser",n.prototype.isParser=!0,n.prototype.evaluate=function(i){return r(i,this.scope)},n.prototype.get=function(i){if(this.scope.has(i))return this.scope.get(i)},n.prototype.getAll=function(){return rS(this.scope)},n.prototype.getAllAsMap=function(){return this.scope};function a(i){if(i.length===0)return!1;for(var o=0;o0&&t.isDigit(u);if(!c)return!1}return!0}return n.prototype.set=function(i,o){if(!a(i))throw new Error("Invalid variable name: '".concat(i,"'. Variable names must follow the specified rules."));return this.scope.set(i,o),o},n.prototype.remove=function(i){this.scope.delete(i)},n.prototype.clear=function(){this.scope.clear()},n},{isClass:!0}),G0="parser",x8=["typed","Parser"],N8=P(G0,x8,e=>{var{typed:r,Parser:t}=e;return r(G0,{"":function(){return new t}})}),W0="lup",A8=["typed","matrix","abs","addScalar","divideScalar","multiplyScalar","subtractScalar","larger","equalScalar","unaryMinus","DenseMatrix","SparseMatrix","Spa"],E8=P(W0,A8,e=>{var{typed:r,matrix:t,abs:n,addScalar:a,divideScalar:i,multiplyScalar:o,subtractScalar:l,larger:u,equalScalar:s,unaryMinus:c,DenseMatrix:f,SparseMatrix:m,Spa:p}=e;return r(W0,{DenseMatrix:function(b){return v(b)},SparseMatrix:function(b){return h(b)},Array:function(b){var A=t(b),g=v(A);return{L:g.L.valueOf(),U:g.U.valueOf(),p:g.p}}});function v(w){var b=w._size[0],A=w._size[1],g=Math.min(b,A),N=Fe(w._data),x=[],y=[b,g],D=[],S=[g,A],E,C,_,F=[];for(E=0;E0)for(E=0;E0&&z.forEach(0,M-1,function(j,Y){m._forEachRow(j,D,S,E,function(ee,te){ee>j&&z.accumulate(ee,c(o(te,Y)))})});var re=M,q=z.get(M),Z=n(q);z.forEach(M+1,b-1,function(j,Y){var ee=n(Y);u(ee,Z)&&(re=j,Z=ee,q=Y)}),M!==re&&(m._swapRows(M,re,C[1],D,S,E),m._swapRows(M,re,R[1],_,F,I),z.swap(M,re),W(M,re)),z.forEach(0,b-1,function(j,Y){j<=M?(_.push(Y),F.push(j)):(Y=i(Y,q),s(Y,0)||(D.push(Y),S.push(j)))})};for(M=0;M{var{typed:r,matrix:t,zeros:n,identity:a,isZero:i,equal:o,sign:l,sqrt:u,conj:s,unaryMinus:c,addScalar:f,divideScalar:m,multiplyScalar:p,subtractScalar:v,complex:h}=e;return Br(r(j0,{DenseMatrix:function(N){return b(N)},SparseMatrix:function(N){return A()},Array:function(N){var x=t(N),y=b(x);return{Q:y.Q.valueOf(),R:y.R.valueOf()}}}),{_denseQRimpl:w});function w(g){var N=g._size[0],x=g._size[1],y=a([N],"dense"),D=y._data,S=g.clone(),E=S._data,C,_,F,I=n([N],"");for(F=0;F0)for(var y=x[0][0].type==="Complex"?h(0):0,D=0;D=0;){var u=t[o+l],s=t[n+u];s===-1?(l--,i[r++]=u):(t[n+u]=t[a+s],++l,t[o+l]=s)}return r}function M8(e,r){if(!e)return null;var t=0,n,a=[],i=[],o=0,l=r,u=2*r;for(n=0;n=0;n--)e[n]!==-1&&(i[l+n]=i[o+e[n]],i[o+e[n]]=n);for(n=0;n{var{add:r,multiply:t,transpose:n}=e;return function(c,f){if(!f||c<=0||c>3)return null;var m=f._size,p=m[0],v=m[1],h=0,w=Math.max(16,10*Math.sqrt(v));w=Math.min(v-2,w);var b=a(c,f,p,v,w);T8(b,u,null);for(var A=b._index,g=b._ptr,N=g[v],x=[],y=[],D=0,S=v+1,E=2*(v+1),C=3*(v+1),_=4*(v+1),F=5*(v+1),I=6*(v+1),R=7*(v+1),$=x,M=i(v,g,y,D,C,$,E,R,S,I,_,F),T=o(v,g,y,F,_,I,w,S,C,$,E),k=0,O,W,X,U,z,Q,se,re,q,Z,j,Y,ee,te,oe,ve;TL?(Q=X,se=ie,re=y[D+X]-L):(Q=A[ie++],se=g[Q],re=y[D+Q]),z=1;z<=re;z++)O=A[se++],!((q=y[S+O])<=0)&&(ne+=q,y[S+O]=-q,A[me++]=O,y[E+O]!==-1&&($[y[E+O]]=$[O]),$[O]!==-1?y[E+$[O]]=y[E+O]:y[C+y[F+O]]=y[E+O]);Q!==X&&(g[Q]=xn(X),y[I+Q]=0)}for(L!==0&&(N=me),y[F+X]=ne,g[X]=de,y[D+X]=me-de,y[_+X]=-2,M=l(M,h,y,I,v),Z=de;Z=M?y[I+Q]-=q:y[I+Q]!==0&&(y[I+Q]=y[F+Q]+be)}for(Z=de;Z0?(ve+=Ne,A[te++]=Q,oe+=Q):(g[Q]=xn(X),y[I+Q]=0)}y[_+O]=te-Y+1;var V=te,K=Y+y[D+O];for(ie=ee+1;ie=0))for(oe=$[O],O=y[R+oe],y[R+oe]=-1;O!==-1&&y[E+O]!==-1;O=y[E+O],M++){for(re=y[D+O],j=y[_+O],ie=g[O]+1;ie<=g[O]+re-1;ie++)y[I+A[ie]]=M;var ae=O;for(W=y[E+O];W!==-1;){var ce=y[D+W]===re&&y[_+W]===j;for(ie=g[W]+1;ce&&ie<=g[W]+re-1;ie++)y[I+A[ie]]!==M&&(ce=0);ce?(g[W]=xn(O),y[S+O]+=y[S+W],y[S+W]=0,y[_+W]=-1,W=y[E+W],y[E+ae]=W):(ae=W,W=y[E+W])}}for(ie=de,Z=de;Z=0;W--)y[S+W]>0||(y[E+W]=y[C+g[W]],y[C+g[W]]=W);for(Q=v;Q>=0;Q--)y[S+Q]<=0||g[Q]!==-1&&(y[E+Q]=y[C+g[Q]],y[C+g[Q]]=Q);for(X=0,O=0;O<=v;O++)g[O]===-1&&(X=K0(O,X,y,C,E,x,I));return x.splice(x.length-1,1),x};function a(s,c,f,m,p){var v=n(c);if(s===1&&m===f)return r(c,v);if(s===2){for(var h=v._index,w=v._ptr,b=0,A=0;Ap))for(var N=w[A+1];gh)f[w+x]=0,f[p+x]=-1,N++,c[x]=xn(s),f[w+s]++;else{var D=f[b+y];D!==-1&&(A[D]=x),f[g+x]=f[b+y],f[b+y]=x}}return N}function l(s,c,f,m,p){if(s<2||s+c<0){for(var v=0;v{var{transpose:r}=e;return function(t,n,a,i){if(!t||!n||!a)return null;var o=t._size,l=o[0],u=o[1],s,c,f,m,p,v,h,w=4*u+(i?u+l+1:0),b=[],A=0,g=u,N=2*u,x=3*u,y=4*u,D=5*u+1;for(f=0;f=1&&S[c]++,F.jleaf===2&&S[F.q]--}n[c]!==-1&&(b[A+c]=n[c])}for(c=0;c{var{add:r,multiply:t,transpose:n}=e,a=O8({add:r,multiply:t,transpose:n}),i=z8({transpose:n});return function(u,s,c){var f=s._ptr,m=s._size,p=m[1],v,h={};if(h.q=a(u,s),u&&!h.q)return null;if(c){var w=u?C8(s,null,h.q):s;h.parent=_8(w);var b=M8(h.parent,p);if(h.cp=i(w,h.parent,b,1),w&&h.parent&&h.cp&&o(w,h))for(h.unz=0,v=0;v=0;D--)for(E=s[D],C=s[D+1],S=E;S=0;y--)h[y]=-1,D=w[y],D!==-1&&(b[x+D]++===0&&(b[N+D]=y),b[A+y]=b[g+D],b[g+D]=y);for(u.lnz=0,u.m2=m,D=0;D=0;){e=n[m];var p=a?a[e]:e;el(o,e)||(J0(o,e),n[u+m]=p<0?0:Y0(o[p]));var v=1;for(c=n[u+m],f=p<0?0:Y0(o[p+1]);c{var{divideScalar:r,multiply:t,subtract:n}=e;return function(i,o,l,u,s,c,f){var m=i._values,p=i._index,v=i._ptr,h=i._size,w=h[1],b=o._values,A=o._index,g=o._ptr,N,x,y,D,S=V8(i,o,l,u,c);for(N=S;N{var{abs:r,divideScalar:t,multiply:n,subtract:a,larger:i,largerEq:o,SparseMatrix:l}=e,u=Z8({divideScalar:t,multiply:n,subtract:a});return function(c,f,m){if(!c)return null;var p=c._size,v=p[1],h,w=100,b=100;f&&(h=f.q,w=f.lnz||w,b=f.unz||b);var A=[],g=[],N=[],x=new l({values:A,index:g,ptr:N,size:[v,v]}),y=[],D=[],S=[],E=new l({values:y,index:D,ptr:S,size:[v,v]}),C=[],_,F,I=[],R=[];for(_=0;_{var{typed:r,abs:t,add:n,multiply:a,transpose:i,divideScalar:o,subtract:l,larger:u,largerEq:s,SparseMatrix:c}=e,f=q8({add:n,multiply:a,transpose:i}),m=j8({abs:t,divideScalar:o,multiply:a,subtract:l,larger:u,largerEq:s,SparseMatrix:c});return r(X0,{"SparseMatrix, number, number":function(v,h,w){if(!Ce(h)||h<0||h>3)throw new Error("Symbolic Ordering and Analysis order must be an integer number in the interval [0, 3]");if(w<0||w>1)throw new Error("Partial pivoting threshold must be a number from 0 to 1");var b=f(h,v,!1),A=m(v,b,w);return{L:A.L,U:A.U,p:A.pinv,q:b.q,toString:function(){return"L: "+this.L.toString()+` U: `+this.U.toString()+` p: `+this.p.toString()+(this.q?` q: `+this.q.toString():"")+` `}}}})});function Q0(e,r){var t,n=r.length,a=[];if(e)for(t=0;t{var{typed:r,matrix:t,lup:n,slu:a,usolve:i,lsolve:o,DenseMatrix:l}=e,u=si({DenseMatrix:l});return r(eg,{"Array, Array | Matrix":function(m,p){m=t(m);var v=n(m),h=c(v.L,v.U,v.p,null,p);return h.valueOf()},"DenseMatrix, Array | Matrix":function(m,p){var v=n(m);return c(v.L,v.U,v.p,null,p)},"SparseMatrix, Array | Matrix":function(m,p){var v=n(m);return c(v.L,v.U,v.p,null,p)},"SparseMatrix, Array | Matrix, number, number":function(m,p,v,h){var w=a(m,v,h);return c(w.L,w.U,w.p,w.q,p)},"Object, Array | Matrix":function(m,p){return c(m.L,m.U,m.p,m.q,p)}});function s(f){if(_e(f))return f;if(Xe(f))return t(f);throw new TypeError("Invalid Matrix LU decomposition")}function c(f,m,p,v,h){f=s(f),m=s(m),p&&(h=u(f,h,!0),h._data=Q0(p,h._data));var w=o(f,h),b=i(m,w);return v&&(b._data=Q0(v,b._data)),b}}),rg="polynomialRoot",Q8=["typed","isZero","equalScalar","add","subtract","multiply","divide","sqrt","unaryMinus","cbrt","typeOf","im","re"],e6=P(rg,Q8,e=>{var{typed:r,isZero:t,equalScalar:n,add:a,subtract:i,multiply:o,divide:l,sqrt:u,unaryMinus:s,cbrt:c,typeOf:f,im:m,re:p}=e;return r(rg,{"number|Complex, ...number|Complex":(v,h)=>{for(var w=[v,...h];w.length>0&&t(w[w.length-1]);)w.pop();if(w.length<2)throw new RangeError("Polynomial [".concat(v,", ").concat(h,"] must have a non-zero non-constant coefficient"));switch(w.length){case 2:return[s(l(w[0],w[1]))];case 3:{var[b,A,g]=w,N=o(2,g),x=o(A,A),y=o(4,g,b);if(n(x,y))return[l(s(A),N)];var D=u(i(x,y));return[l(i(D,A),N),l(i(s(D),A),N)]}case 4:{var[S,E,C,_]=w,F=s(o(3,_)),I=o(C,C),R=o(3,_,E),$=a(o(2,C,C,C),o(27,_,_,S)),M=o(9,_,C,E);if(n(I,R)&&n($,M))return[l(C,F)];var T=i(I,R),k=i($,M),O=a(o(18,_,C,E,S),o(C,C,E,E)),W=a(o(4,C,C,C,S),o(4,_,E,E,E),o(27,_,_,S,S));if(n(O,W))return[l(i(o(4,_,C,E),a(o(9,_,_,S),o(C,C,C))),o(_,T)),l(i(o(9,_,S),o(C,E)),o(2,T))];var X;n(I,R)?X=k:X=l(a(k,u(i(o(k,k),o(4,T,T,T)))),2);var U=!0,z=c(X,U).toArray().map(Q=>l(a(C,Q,l(T,Q)),F));return z.map(Q=>f(Q)==="Complex"&&n(p(Q),p(Q)+m(Q))?p(Q):Q)}default:throw new RangeError("only implemented for cubic or lower-order polynomials, not ".concat(w))}}})}),r6="Help",t6=["evaluate"],n6=P(r6,t6,e=>{var{evaluate:r}=e;function t(n){if(!(this instanceof t))throw new SyntaxError("Constructor must be called with the new operator");if(!n)throw new Error('Argument "doc" missing');this.doc=n}return t.prototype.type="Help",t.prototype.isHelp=!0,t.prototype.toString=function(){var n=this.doc||{},a=` `;if(n.name&&(a+="Name: "+n.name+` `),n.category&&(a+="Category: "+n.category+` `),n.description&&(a+=`Description: `+n.description+` `),n.syntax&&(a+=`Syntax: `+n.syntax.join(` `)+` `),n.examples){a+=`Examples: `;for(var i=!1,o=r("config()"),l={config:f=>(i=!0,r("config(newConfig)",{newConfig:f}))},u=0;ui!=="mathjs").forEach(i=>{a[i]=n[i]}),new t(a)},t.prototype.valueOf=t.prototype.toString,t},{isClass:!0}),a6="Chain",i6=["?on","math","typed"],o6=P(a6,i6,e=>{var{on:r,math:t,typed:n}=e;function a(s){if(!(this instanceof a))throw new SyntaxError("Constructor must be called with the new operator");mu(s)?this.value=s.value:this.value=s}a.prototype.type="Chain",a.prototype.isChain=!0,a.prototype.done=function(){return this.value},a.prototype.valueOf=function(){return this.value},a.prototype.toString=function(){return Ve(this.value)},a.prototype.toJSON=function(){return{mathjs:"Chain",value:this.value}},a.fromJSON=function(s){return new a(s.value)};function i(s,c){typeof c=="function"&&(a.prototype[s]=l(c))}function o(s,c){Xi(a.prototype,s,function(){var m=c();if(typeof m=="function")return l(m)})}function l(s){return function(){if(arguments.length===0)return new a(s(this.value));for(var c=[this.value],f=0;fs[v])};for(var m in s)f(m)}};var u={expression:!0,docs:!0,type:!0,classes:!0,json:!0,error:!0,isChain:!0};return a.createProxy(t),r&&r("import",function(s,c,f){f||o(s,c)}),a},{isClass:!0}),tg={name:"e",category:"Constants",syntax:["e"],description:"Euler's number, the base of the natural logarithm. Approximately equal to 2.71828",examples:["e","e ^ 2","exp(2)","log(e)"],seealso:["exp"]},s6={name:"false",category:"Constants",syntax:["false"],description:"Boolean value false",examples:["false"],seealso:["true"]},u6={name:"i",category:"Constants",syntax:["i"],description:"Imaginary unit, defined as i*i=-1. A complex number is described as a + b*i, where a is the real part, and b is the imaginary part.",examples:["i","i * i","sqrt(-1)"],seealso:[]},l6={name:"Infinity",category:"Constants",syntax:["Infinity"],description:"Infinity, a number which is larger than the maximum number that can be handled by a floating point number.",examples:["Infinity","1 / 0"],seealso:[]},c6={name:"LN10",category:"Constants",syntax:["LN10"],description:"Returns the natural logarithm of 10, approximately equal to 2.302",examples:["LN10","log(10)"],seealso:[]},f6={name:"LN2",category:"Constants",syntax:["LN2"],description:"Returns the natural logarithm of 2, approximately equal to 0.693",examples:["LN2","log(2)"],seealso:[]},m6={name:"LOG10E",category:"Constants",syntax:["LOG10E"],description:"Returns the base-10 logarithm of E, approximately equal to 0.434",examples:["LOG10E","log(e, 10)"],seealso:[]},d6={name:"LOG2E",category:"Constants",syntax:["LOG2E"],description:"Returns the base-2 logarithm of E, approximately equal to 1.442",examples:["LOG2E","log(e, 2)"],seealso:[]},p6={name:"NaN",category:"Constants",syntax:["NaN"],description:"Not a number",examples:["NaN","0 / 0"],seealso:[]},v6={name:"null",category:"Constants",syntax:["null"],description:"Value null",examples:["null"],seealso:["true","false"]},h6={name:"phi",category:"Constants",syntax:["phi"],description:"Phi is the golden ratio. Two quantities are in the golden ratio if their ratio is the same as the ratio of their sum to the larger of the two quantities. Phi is defined as `(1 + sqrt(5)) / 2` and is approximately 1.618034...",examples:["phi"],seealso:[]},ng={name:"pi",category:"Constants",syntax:["pi"],description:"The number pi is a mathematical constant that is the ratio of a circle's circumference to its diameter, and is approximately equal to 3.14159",examples:["pi","sin(pi/2)"],seealso:["tau"]},g6={name:"SQRT1_2",category:"Constants",syntax:["SQRT1_2"],description:"Returns the square root of 1/2, approximately equal to 0.707",examples:["SQRT1_2","sqrt(1/2)"],seealso:[]},y6={name:"SQRT2",category:"Constants",syntax:["SQRT2"],description:"Returns the square root of 2, approximately equal to 1.414",examples:["SQRT2","sqrt(2)"],seealso:[]},b6={name:"tau",category:"Constants",syntax:["tau"],description:"Tau is the ratio constant of a circle's circumference to radius, equal to 2 * pi, approximately 6.2832.",examples:["tau","2 * pi"],seealso:["pi"]},w6={name:"true",category:"Constants",syntax:["true"],description:"Boolean value true",examples:["true"],seealso:["false"]},x6={name:"version",category:"Constants",syntax:["version"],description:"A string with the version number of math.js",examples:["version"],seealso:[]},N6={name:"bignumber",category:"Construction",syntax:["bignumber(x)"],description:"Create a big number from a number or string.",examples:["0.1 + 0.2","bignumber(0.1) + bignumber(0.2)",'bignumber("7.2")','bignumber("7.2e500")',"bignumber([0.1, 0.2, 0.3])"],seealso:["boolean","bigint","complex","fraction","index","matrix","string","unit"]},A6={name:"bigint",category:"Construction",syntax:["bigint(x)"],description:"Create a bigint, an integer with an arbitrary number of digits, from a number or string.",examples:["123123123123123123 # a large number will lose digits",'bigint("123123123123123123")','bignumber(["1", "3", "5"])'],seealso:["boolean","bignumber","number","complex","fraction","index","matrix","string","unit"]},E6={name:"boolean",category:"Construction",syntax:["x","boolean(x)"],description:"Convert a string or number into a boolean.",examples:["boolean(0)","boolean(1)","boolean(3)",'boolean("true")','boolean("false")',"boolean([1, 0, 1, 1])"],seealso:["bignumber","complex","index","matrix","number","string","unit"]},D6={name:"complex",category:"Construction",syntax:["complex()","complex(re, im)","complex(string)"],description:"Create a complex number.",examples:["complex()","complex(2, 3)",'complex("7 - 2i")'],seealso:["bignumber","boolean","index","matrix","number","string","unit"]},S6={name:"createUnit",category:"Construction",syntax:["createUnit(definitions)","createUnit(name, definition)"],description:"Create a user-defined unit and register it with the Unit type.",examples:['createUnit("foo")','createUnit("knot", {definition: "0.514444444 m/s", aliases: ["knots", "kt", "kts"]})','createUnit("mph", "1 mile/hour")'],seealso:["unit","splitUnit"]},C6={name:"fraction",category:"Construction",syntax:["fraction(num)","fraction(matrix)","fraction(num,den)","fraction({n: num, d: den})"],description:"Create a fraction from a number or from integer numerator and denominator.",examples:["fraction(0.125)","fraction(1, 3) + fraction(2, 5)","fraction({n: 333, d: 53})","fraction([sqrt(9), sqrt(10), sqrt(11)])"],seealso:["bignumber","boolean","complex","index","matrix","string","unit"]},M6={name:"index",category:"Construction",syntax:["[start]","[start:end]","[start:step:end]","[start1, start 2, ...]","[start1:end1, start2:end2, ...]","[start1:step1:end1, start2:step2:end2, ...]"],description:"Create an index to get or replace a subset of a matrix",examples:["A = [1, 2, 3; 4, 5, 6]","A[1, :]","A[1, 2] = 50","A[1:2, 1:2] = 1","B = [1, 2, 3]","B[B>1 and B<3]"],seealso:["bignumber","boolean","complex","matrix,","number","range","string","unit"]},_6={name:"matrix",category:"Construction",syntax:["[]","[a1, b1, ...; a2, b2, ...]","matrix()",'matrix("dense")',"matrix([...])"],description:"Create a matrix.",examples:["[]","[1, 2, 3]","[1, 2, 3; 4, 5, 6]","matrix()","matrix([3, 4])",'matrix([3, 4; 5, 6], "sparse")','matrix([3, 4; 5, 6], "sparse", "number")'],seealso:["bignumber","boolean","complex","index","number","string","unit","sparse"]},T6={name:"number",category:"Construction",syntax:["x","number(x)","number(unit, valuelessUnit)"],description:"Create a number or convert a string or boolean into a number.",examples:["2","2e3","4.05","number(2)",'number("7.2")',"number(true)","number([true, false, true, true])",'number(unit("52cm"), "m")'],seealso:["bignumber","bigint","boolean","complex","fraction","index","matrix","string","unit"]},F6={name:"sparse",category:"Construction",syntax:["sparse()","sparse([a1, b1, ...; a1, b2, ...])",'sparse([a1, b1, ...; a1, b2, ...], "number")'],description:"Create a sparse matrix.",examples:["sparse()","sparse([3, 4; 5, 6])",'sparse([3, 0; 5, 0], "number")'],seealso:["bignumber","boolean","complex","index","number","string","unit","matrix"]},B6={name:"splitUnit",category:"Construction",syntax:["splitUnit(unit: Unit, parts: Unit[])"],description:"Split a unit in an array of units whose sum is equal to the original unit.",examples:['splitUnit(1 m, ["feet", "inch"])'],seealso:["unit","createUnit"]},O6={name:"string",category:"Construction",syntax:['"text"',"string(x)"],description:"Create a string or convert a value to a string",examples:['"Hello World!"',"string(4.2)","string(3 + 2i)"],seealso:["bignumber","boolean","complex","index","matrix","number","unit"]},$6={name:"unit",category:"Construction",syntax:["value unit","unit(value, unit)","unit(string)"],description:"Create a unit.",examples:["5.5 mm","3 inch",'unit(7.1, "kilogram")','unit("23 deg")'],seealso:["bignumber","boolean","complex","index","matrix","number","string"]},I6={name:"config",category:"Core",syntax:["config()","config(options)"],description:"Get configuration or change configuration.",examples:["config()","1/3 + 1/4",'config({number: "Fraction"})',"1/3 + 1/4"],seealso:[]},R6={name:"import",category:"Core",syntax:["import(functions)","import(functions, options)"],description:"Import functions or constants from an object.",examples:["import({myFn: f(x)=x^2, myConstant: 32 })","myFn(2)","myConstant"],seealso:[]},z6={name:"typed",category:"Core",syntax:["typed(signatures)","typed(name, signatures)"],description:"Create a typed function.",examples:['double = typed({ "number": f(x)=x+x, "string": f(x)=concat(x,x) })',"double(2)",'double("hello")'],seealso:[]},P6={name:"derivative",category:"Algebra",syntax:["derivative(expr, variable)","derivative(expr, variable, {simplify: boolean})"],description:"Takes the derivative of an expression expressed in parser Nodes. The derivative will be taken over the supplied variable in the second parameter. If there are multiple variables in the expression, it will return a partial derivative.",examples:['derivative("2x^3", "x")','derivative("2x^3", "x", {simplify: false})','derivative("2x^2 + 3x + 4", "x")','derivative("sin(2x)", "x")','f = parse("x^2 + x")','x = parse("x")',"df = derivative(f, x)","df.evaluate({x: 3})"],seealso:["simplify","parse","evaluate"]},k6={name:"leafCount",category:"Algebra",syntax:["leafCount(expr)"],description:"Computes the number of leaves in the parse tree of the given expression",examples:['leafCount("e^(i*pi)-1")','leafCount(parse("{a: 22/7, b: 10^(1/2)}"))'],seealso:["simplify"]},q6={name:"lsolve",category:"Algebra",syntax:["x=lsolve(L, b)"],description:"Finds one solution of the linear system L * x = b where L is an [n x n] lower triangular matrix and b is a [n] column vector.",examples:["a = [-2, 3; 2, 1]","b = [11, 9]","x = lsolve(a, b)"],seealso:["lsolveAll","lup","lusolve","usolve","matrix","sparse"]},L6={name:"lsolveAll",category:"Algebra",syntax:["x=lsolveAll(L, b)"],description:"Finds all solutions of the linear system L * x = b where L is an [n x n] lower triangular matrix and b is a [n] column vector.",examples:["a = [-2, 3; 2, 1]","b = [11, 9]","x = lsolve(a, b)"],seealso:["lsolve","lup","lusolve","usolve","matrix","sparse"]},V6={name:"lup",category:"Algebra",syntax:["lup(m)"],description:"Calculate the Matrix LU decomposition with partial pivoting. Matrix A is decomposed in three matrices (L, U, P) where P * A = L * U",examples:["lup([[2, 1], [1, 4]])","lup(matrix([[2, 1], [1, 4]]))","lup(sparse([[2, 1], [1, 4]]))"],seealso:["lusolve","lsolve","usolve","matrix","sparse","slu","qr"]},U6={name:"lusolve",category:"Algebra",syntax:["x=lusolve(A, b)","x=lusolve(lu, b)"],description:"Solves the linear system A * x = b where A is an [n x n] matrix and b is a [n] column vector.",examples:["a = [-2, 3; 2, 1]","b = [11, 9]","x = lusolve(a, b)"],seealso:["lup","slu","lsolve","usolve","matrix","sparse"]},H6={name:"polynomialRoot",category:"Algebra",syntax:["x=polynomialRoot(-6, 3)","x=polynomialRoot(4, -4, 1)","x=polynomialRoot(-8, 12, -6, 1)"],description:"Finds the roots of a univariate polynomial given by its coefficients starting from constant, linear, and so on, increasing in degree.",examples:["a = polynomialRoot(-6, 11, -6, 1)"],seealso:["cbrt","sqrt"]},Z6={name:"qr",category:"Algebra",syntax:["qr(A)"],description:"Calculates the Matrix QR decomposition. Matrix `A` is decomposed in two matrices (`Q`, `R`) where `Q` is an orthogonal matrix and `R` is an upper triangular matrix.",examples:["qr([[1, -1, 4], [1, 4, -2], [1, 4, 2], [1, -1, 0]])"],seealso:["lup","slu","matrix"]},G6={name:"rationalize",category:"Algebra",syntax:["rationalize(expr)","rationalize(expr, scope)","rationalize(expr, scope, detailed)"],description:"Transform a rationalizable expression in a rational fraction. If rational fraction is one variable polynomial then converts the numerator and denominator in canonical form, with decreasing exponents, returning the coefficients of numerator.",examples:['rationalize("2x/y - y/(x+1)")','rationalize("2x/y - y/(x+1)", true)'],seealso:["simplify"]},W6={name:"resolve",category:"Algebra",syntax:["resolve(node, scope)"],description:"Recursively substitute variables in an expression tree.",examples:['resolve(parse("1 + x"), { x: 7 })','resolve(parse("size(text)"), { text: "Hello World" })','resolve(parse("x + y"), { x: parse("3z") })','resolve(parse("3x"), { x: parse("y+z"), z: parse("w^y") })'],seealso:["simplify","evaluate"],mayThrow:["ReferenceError"]},j6={name:"simplify",category:"Algebra",syntax:["simplify(expr)","simplify(expr, rules)"],description:"Simplify an expression tree.",examples:['simplify("3 + 2 / 4")','simplify("2x + x")','f = parse("x * (x + 2 + x)")',"simplified = simplify(f)","simplified.evaluate({x: 2})"],seealso:["simplifyCore","derivative","evaluate","parse","rationalize","resolve"]},K6={name:"simplifyConstant",category:"Algebra",syntax:["simplifyConstant(expr)","simplifyConstant(expr, options)"],description:"Replace constant subexpressions of node with their values.",examples:['simplifyConstant("(3-3)*x")','simplifyConstant(parse("z-cos(tau/8)"))'],seealso:["simplify","simplifyCore","evaluate"]},J6={name:"simplifyCore",category:"Algebra",syntax:["simplifyCore(node)"],description:"Perform simple one-pass simplifications on an expression tree.",examples:['simplifyCore(parse("0*x"))','simplifyCore(parse("(x+0)*2"))'],seealso:["simplify","simplifyConstant","evaluate"]},Y6={name:"slu",category:"Algebra",syntax:["slu(A, order, threshold)"],description:"Calculate the Matrix LU decomposition with full pivoting. Matrix A is decomposed in two matrices (L, U) and two permutation vectors (pinv, q) where P * A * Q = L * U",examples:["slu(sparse([4.5, 0, 3.2, 0; 3.1, 2.9, 0, 0.9; 0, 1.7, 3, 0; 3.5, 0.4, 0, 1]), 1, 0.001)"],seealso:["lusolve","lsolve","usolve","matrix","sparse","lup","qr"]},X6={name:"symbolicEqual",category:"Algebra",syntax:["symbolicEqual(expr1, expr2)","symbolicEqual(expr1, expr2, options)"],description:"Returns true if the difference of the expressions simplifies to 0",examples:['symbolicEqual("x*y","y*x")','symbolicEqual("abs(x^2)", "x^2")','symbolicEqual("abs(x)", "x", {context: {abs: {trivial: true}}})'],seealso:["simplify","evaluate"]},Q6={name:"usolve",category:"Algebra",syntax:["x=usolve(U, b)"],description:"Finds one solution of the linear system U * x = b where U is an [n x n] upper triangular matrix and b is a [n] column vector.",examples:["x=usolve(sparse([1, 1, 1, 1; 0, 1, 1, 1; 0, 0, 1, 1; 0, 0, 0, 1]), [1; 2; 3; 4])"],seealso:["usolveAll","lup","lusolve","lsolve","matrix","sparse"]},e$={name:"usolveAll",category:"Algebra",syntax:["x=usolve(U, b)"],description:"Finds all solutions of the linear system U * x = b where U is an [n x n] upper triangular matrix and b is a [n] column vector.",examples:["x=usolve(sparse([1, 1, 1, 1; 0, 1, 1, 1; 0, 0, 1, 1; 0, 0, 0, 1]), [1; 2; 3; 4])"],seealso:["usolve","lup","lusolve","lsolve","matrix","sparse"]},r$={name:"abs",category:"Arithmetic",syntax:["abs(x)"],description:"Compute the absolute value.",examples:["abs(3.5)","abs(-4.2)"],seealso:["sign"]},t$={name:"add",category:"Operators",syntax:["x + y","add(x, y)"],description:"Add two values.",examples:["a = 2.1 + 3.6","a - 3.6","3 + 2i","3 cm + 2 inch",'"2.3" + "4"'],seealso:["subtract"]},n$={name:"cbrt",category:"Arithmetic",syntax:["cbrt(x)","cbrt(x, allRoots)"],description:"Compute the cubic root value. If x = y * y * y, then y is the cubic root of x. When `x` is a number or complex number, an optional second argument `allRoots` can be provided to return all three cubic roots. If not provided, the principal root is returned",examples:["cbrt(64)","cube(4)","cbrt(-8)","cbrt(2 + 3i)","cbrt(8i)","cbrt(8i, true)","cbrt(27 m^3)"],seealso:["square","sqrt","cube","multiply"]},a$={name:"ceil",category:"Arithmetic",syntax:["ceil(x)"],description:"Round a value towards plus infinity. If x is complex, both real and imaginary part are rounded towards plus infinity.",examples:["ceil(3.2)","ceil(3.8)","ceil(-4.2)"],seealso:["floor","fix","round"]},i$={name:"cube",category:"Arithmetic",syntax:["cube(x)"],description:"Compute the cube of a value. The cube of x is x * x * x.",examples:["cube(2)","2^3","2 * 2 * 2"],seealso:["multiply","square","pow"]},o$={name:"divide",category:"Operators",syntax:["x / y","divide(x, y)"],description:"Divide two values.",examples:["a = 2 / 3","a * 3","4.5 / 2","3 + 4 / 2","(3 + 4) / 2","18 km / 4.5"],seealso:["multiply"]},s$={name:"dotDivide",category:"Operators",syntax:["x ./ y","dotDivide(x, y)"],description:"Divide two values element wise.",examples:["a = [1, 2, 3; 4, 5, 6]","b = [2, 1, 1; 3, 2, 5]","a ./ b"],seealso:["multiply","dotMultiply","divide"]},u$={name:"dotMultiply",category:"Operators",syntax:["x .* y","dotMultiply(x, y)"],description:"Multiply two values element wise.",examples:["a = [1, 2, 3; 4, 5, 6]","b = [2, 1, 1; 3, 2, 5]","a .* b"],seealso:["multiply","divide","dotDivide"]},l$={name:"dotPow",category:"Operators",syntax:["x .^ y","dotPow(x, y)"],description:"Calculates the power of x to y element wise.",examples:["a = [1, 2, 3; 4, 5, 6]","a .^ 2"],seealso:["pow"]},c$={name:"exp",category:"Arithmetic",syntax:["exp(x)"],description:"Calculate the exponent of a value.",examples:["exp(1.3)","e ^ 1.3","log(exp(1.3))","x = 2.4","(exp(i*x) == cos(x) + i*sin(x)) # Euler's formula"],seealso:["expm","expm1","pow","log"]},f$={name:"expm",category:"Arithmetic",syntax:["exp(x)"],description:"Compute the matrix exponential, expm(A) = e^A. The matrix must be square. Not to be confused with exp(a), which performs element-wise exponentiation.",examples:["expm([[0,2],[0,0]])"],seealso:["exp"]},m$={name:"expm1",category:"Arithmetic",syntax:["expm1(x)"],description:"Calculate the value of subtracting 1 from the exponential value.",examples:["expm1(2)","pow(e, 2) - 1","log(expm1(2) + 1)"],seealso:["exp","pow","log"]},d$={name:"fix",category:"Arithmetic",syntax:["fix(x)"],description:"Round a value towards zero. If x is complex, both real and imaginary part are rounded towards zero.",examples:["fix(3.2)","fix(3.8)","fix(-4.2)","fix(-4.8)"],seealso:["ceil","floor","round"]},p$={name:"floor",category:"Arithmetic",syntax:["floor(x)"],description:"Round a value towards minus infinity.If x is complex, both real and imaginary part are rounded towards minus infinity.",examples:["floor(3.2)","floor(3.8)","floor(-4.2)"],seealso:["ceil","fix","round"]},v$={name:"gcd",category:"Arithmetic",syntax:["gcd(a, b)","gcd(a, b, c, ...)"],description:"Compute the greatest common divisor.",examples:["gcd(8, 12)","gcd(-4, 6)","gcd(25, 15, -10)"],seealso:["lcm","xgcd"]},h$={name:"hypot",category:"Arithmetic",syntax:["hypot(a, b, c, ...)","hypot([a, b, c, ...])"],description:"Calculate the hypotenuse of a list with values.",examples:["hypot(3, 4)","sqrt(3^2 + 4^2)","hypot(-2)","hypot([3, 4, 5])"],seealso:["abs","norm"]},g$={name:"invmod",category:"Arithmetic",syntax:["invmod(a, b)"],description:"Calculate the (modular) multiplicative inverse of a modulo b. Solution to the equation ax ≣ 1 (mod b)",examples:["invmod(8, 12)","invmod(7, 13)","invmod(15151, 15122)"],seealso:["gcd","xgcd"]},y$={name:"lcm",category:"Arithmetic",syntax:["lcm(x, y)"],description:"Compute the least common multiple.",examples:["lcm(4, 6)","lcm(6, 21)","lcm(6, 21, 5)"],seealso:["gcd"]},b$={name:"log",category:"Arithmetic",syntax:["log(x)","log(x, base)"],description:"Compute the logarithm of a value. If no base is provided, the natural logarithm of x is calculated. If base if provided, the logarithm is calculated for the specified base. log(x, base) is defined as log(x) / log(base).",examples:["log(3.5)","a = log(2.4)","exp(a)","10 ^ 4","log(10000, 10)","log(10000) / log(10)","b = log(1024, 2)","2 ^ b"],seealso:["exp","log1p","log2","log10"]},w$={name:"log10",category:"Arithmetic",syntax:["log10(x)"],description:"Compute the 10-base logarithm of a value.",examples:["log10(0.00001)","log10(10000)","10 ^ 4","log(10000) / log(10)","log(10000, 10)"],seealso:["exp","log"]},x$={name:"log1p",category:"Arithmetic",syntax:["log1p(x)","log1p(x, base)"],description:"Calculate the logarithm of a `value+1`",examples:["log1p(2.5)","exp(log1p(1.4))","pow(10, 4)","log1p(9999, 10)","log1p(9999) / log(10)"],seealso:["exp","log","log2","log10"]},N$={name:"log2",category:"Arithmetic",syntax:["log2(x)"],description:"Calculate the 2-base of a value. This is the same as calculating `log(x, 2)`.",examples:["log2(0.03125)","log2(16)","log2(16) / log2(2)","pow(2, 4)"],seealso:["exp","log1p","log","log10"]},A$={name:"mod",category:"Operators",syntax:["x % y","x mod y","mod(x, y)"],description:"Calculates the modulus, the remainder of an integer division.",examples:["7 % 3","11 % 2","10 mod 4","isOdd(x) = x % 2","isOdd(2)","isOdd(3)"],seealso:["divide"]},E$={name:"multiply",category:"Operators",syntax:["x * y","multiply(x, y)"],description:"multiply two values.",examples:["a = 2.1 * 3.4","a / 3.4","2 * 3 + 4","2 * (3 + 4)","3 * 2.1 km"],seealso:["divide"]},D$={name:"norm",category:"Arithmetic",syntax:["norm(x)","norm(x, p)"],description:"Calculate the norm of a number, vector or matrix.",examples:["abs(-3.5)","norm(-3.5)","norm(3 - 4i)","norm([1, 2, -3], Infinity)","norm([1, 2, -3], -Infinity)","norm([3, 4], 2)","norm([[1, 2], [3, 4]], 1)",'norm([[1, 2], [3, 4]], "inf")','norm([[1, 2], [3, 4]], "fro")']},S$={name:"nthRoot",category:"Arithmetic",syntax:["nthRoot(a)","nthRoot(a, root)"],description:'Calculate the nth root of a value. The principal nth root of a positive real number A, is the positive real solution of the equation "x^root = A".',examples:["4 ^ 3","nthRoot(64, 3)","nthRoot(9, 2)","sqrt(9)"],seealso:["nthRoots","pow","sqrt"]},C$={name:"nthRoots",category:"Arithmetic",syntax:["nthRoots(A)","nthRoots(A, root)"],description:'Calculate the nth roots of a value. An nth root of a positive real number A, is a positive real solution of the equation "x^root = A". This function returns an array of complex values.',examples:["nthRoots(1)","nthRoots(1, 3)"],seealso:["sqrt","pow","nthRoot"]},M$={name:"pow",category:"Operators",syntax:["x ^ y","pow(x, y)"],description:"Calculates the power of x to y, x^y.",examples:["2^3","2*2*2","1 + e ^ (pi * i)","pow([[1, 2], [4, 3]], 2)","pow([[1, 2], [4, 3]], -1)"],seealso:["multiply","nthRoot","nthRoots","sqrt"]},_$={name:"round",category:"Arithmetic",syntax:["round(x)","round(x, n)","round(unit, valuelessUnit)","round(unit, n, valuelessUnit)"],description:"round a value towards the nearest integer.If x is complex, both real and imaginary part are rounded towards the nearest integer. When n is specified, the value is rounded to n decimals.",examples:["round(3.2)","round(3.8)","round(-4.2)","round(-4.8)","round(pi, 3)","round(123.45678, 2)","round(3.241cm, 2, cm)","round([3.2, 3.8, -4.7])"],seealso:["ceil","floor","fix"]},T$={name:"sign",category:"Arithmetic",syntax:["sign(x)"],description:"Compute the sign of a value. The sign of a value x is 1 when x>1, -1 when x<0, and 0 when x=0.",examples:["sign(3.5)","sign(-4.2)","sign(0)"],seealso:["abs"]},F$={name:"sqrt",category:"Arithmetic",syntax:["sqrt(x)"],description:"Compute the square root value. If x = y * y, then y is the square root of x.",examples:["sqrt(25)","5 * 5","sqrt(-1)"],seealso:["square","sqrtm","multiply","nthRoot","nthRoots","pow"]},B$={name:"sqrtm",category:"Arithmetic",syntax:["sqrtm(x)"],description:"Calculate the principal square root of a square matrix. The principal square root matrix `X` of another matrix `A` is such that `X * X = A`.",examples:["sqrtm([[33, 24], [48, 57]])"],seealso:["sqrt","abs","square","multiply"]},O$={name:"sylvester",category:"Algebra",syntax:["sylvester(A,B,C)"],description:"Solves the real-valued Sylvester equation AX+XB=C for X",examples:["sylvester([[-1, -2], [1, 1]], [[-2, 1], [-1, 2]], [[-3, 2], [3, 0]])","A = [[-1, -2], [1, 1]]; B = [[2, -1], [1, -2]]; C = [[-3, 2], [3, 0]]","sylvester(A, B, C)"],seealso:["schur","lyap"]},$$={name:"schur",category:"Algebra",syntax:["schur(A)"],description:"Performs a real Schur decomposition of the real matrix A = UTU'",examples:["schur([[1, 0], [-4, 3]])","A = [[1, 0], [-4, 3]]","schur(A)"],seealso:["lyap","sylvester"]},I$={name:"lyap",category:"Algebra",syntax:["lyap(A,Q)"],description:"Solves the Continuous-time Lyapunov equation AP+PA'+Q=0 for P",examples:["lyap([[-2, 0], [1, -4]], [[3, 1], [1, 3]])","A = [[-2, 0], [1, -4]]","Q = [[3, 1], [1, 3]]","lyap(A,Q)"],seealso:["schur","sylvester"]},R$={name:"square",category:"Arithmetic",syntax:["square(x)"],description:"Compute the square of a value. The square of x is x * x.",examples:["square(3)","sqrt(9)","3^2","3 * 3"],seealso:["multiply","pow","sqrt","cube"]},z$={name:"subtract",category:"Operators",syntax:["x - y","subtract(x, y)"],description:"subtract two values.",examples:["a = 5.3 - 2","a + 2","2/3 - 1/6","2 * 3 - 3","2.1 km - 500m"],seealso:["add"]},P$={name:"unaryMinus",category:"Operators",syntax:["-x","unaryMinus(x)"],description:"Inverse the sign of a value. Converts booleans and strings to numbers.",examples:["-4.5","-(-5.6)",'-"22"'],seealso:["add","subtract","unaryPlus"]},k$={name:"unaryPlus",category:"Operators",syntax:["+x","unaryPlus(x)"],description:"Converts booleans and strings to numbers.",examples:["+true",'+"2"'],seealso:["add","subtract","unaryMinus"]},q$={name:"xgcd",category:"Arithmetic",syntax:["xgcd(a, b)"],description:"Calculate the extended greatest common divisor for two values. The result is an array [d, x, y] with 3 entries, where d is the greatest common divisor, and d = x * a + y * b.",examples:["xgcd(8, 12)","gcd(8, 12)","xgcd(36163, 21199)"],seealso:["gcd","lcm"]},L$={name:"bitAnd",category:"Bitwise",syntax:["x & y","bitAnd(x, y)"],description:"Bitwise AND operation. Performs the logical AND operation on each pair of the corresponding bits of the two given values by multiplying them. If both bits in the compared position are 1, the bit in the resulting binary representation is 1, otherwise, the result is 0",examples:["5 & 3","bitAnd(53, 131)","[1, 12, 31] & 42"],seealso:["bitNot","bitOr","bitXor","leftShift","rightArithShift","rightLogShift"]},V$={name:"bitNot",category:"Bitwise",syntax:["~x","bitNot(x)"],description:"Bitwise NOT operation. Performs a logical negation on each bit of the given value. Bits that are 0 become 1, and those that are 1 become 0.",examples:["~1","~2","bitNot([2, -3, 4])"],seealso:["bitAnd","bitOr","bitXor","leftShift","rightArithShift","rightLogShift"]},U$={name:"bitOr",category:"Bitwise",syntax:["x | y","bitOr(x, y)"],description:"Bitwise OR operation. Performs the logical inclusive OR operation on each pair of corresponding bits of the two given values. The result in each position is 1 if the first bit is 1 or the second bit is 1 or both bits are 1, otherwise, the result is 0.",examples:["5 | 3","bitOr([1, 2, 3], 4)"],seealso:["bitAnd","bitNot","bitXor","leftShift","rightArithShift","rightLogShift"]},H$={name:"bitXor",category:"Bitwise",syntax:["bitXor(x, y)"],description:"Bitwise XOR operation, exclusive OR. Performs the logical exclusive OR operation on each pair of corresponding bits of the two given values. The result in each position is 1 if only the first bit is 1 or only the second bit is 1, but will be 0 if both are 0 or both are 1.",examples:["bitOr(1, 2)","bitXor([2, 3, 4], 4)"],seealso:["bitAnd","bitNot","bitOr","leftShift","rightArithShift","rightLogShift"]},Z$={name:"leftShift",category:"Bitwise",syntax:["x << y","leftShift(x, y)"],description:"Bitwise left logical shift of a value x by y number of bits.",examples:["4 << 1","8 >> 1"],seealso:["bitAnd","bitNot","bitOr","bitXor","rightArithShift","rightLogShift"]},G$={name:"rightArithShift",category:"Bitwise",syntax:["x >> y","rightArithShift(x, y)"],description:"Bitwise right arithmetic shift of a value x by y number of bits.",examples:["8 >> 1","4 << 1","-12 >> 2"],seealso:["bitAnd","bitNot","bitOr","bitXor","leftShift","rightLogShift"]},W$={name:"rightLogShift",category:"Bitwise",syntax:["x >>> y","rightLogShift(x, y)"],description:"Bitwise right logical shift of a value x by y number of bits.",examples:["8 >>> 1","4 << 1","-12 >>> 2"],seealso:["bitAnd","bitNot","bitOr","bitXor","leftShift","rightArithShift"]},j$={name:"bellNumbers",category:"Combinatorics",syntax:["bellNumbers(n)"],description:"The Bell Numbers count the number of partitions of a set. A partition is a pairwise disjoint subset of S whose union is S. `bellNumbers` only takes integer arguments. The following condition must be enforced: n >= 0.",examples:["bellNumbers(3)","bellNumbers(8)"],seealso:["stirlingS2"]},K$={name:"catalan",category:"Combinatorics",syntax:["catalan(n)"],description:"The Catalan Numbers enumerate combinatorial structures of many different types. catalan only takes integer arguments. The following condition must be enforced: n >= 0.",examples:["catalan(3)","catalan(8)"],seealso:["bellNumbers"]},J$={name:"composition",category:"Combinatorics",syntax:["composition(n, k)"],description:"The composition counts of n into k parts. composition only takes integer arguments. The following condition must be enforced: k <= n.",examples:["composition(5, 3)"],seealso:["combinations"]},Y$={name:"stirlingS2",category:"Combinatorics",syntax:["stirlingS2(n, k)"],description:"he Stirling numbers of the second kind, counts the number of ways to partition a set of n labelled objects into k nonempty unlabelled subsets. `stirlingS2` only takes integer arguments. The following condition must be enforced: k <= n. If n = k or k = 1, then s(n,k) = 1.",examples:["stirlingS2(5, 3)"],seealso:["bellNumbers"]},X$={name:"arg",category:"Complex",syntax:["arg(x)"],description:"Compute the argument of a complex value. If x = a+bi, the argument is computed as atan2(b, a).",examples:["arg(2 + 2i)","atan2(3, 2)","arg(2 + 3i)"],seealso:["re","im","conj","abs"]},Q$={name:"conj",category:"Complex",syntax:["conj(x)"],description:"Compute the complex conjugate of a complex value. If x = a+bi, the complex conjugate is a-bi.",examples:["conj(2 + 3i)","conj(2 - 3i)","conj(-5.2i)"],seealso:["re","im","abs","arg"]},e9={name:"im",category:"Complex",syntax:["im(x)"],description:"Get the imaginary part of a complex number.",examples:["im(2 + 3i)","re(2 + 3i)","im(-5.2i)","im(2.4)"],seealso:["re","conj","abs","arg"]},r9={name:"re",category:"Complex",syntax:["re(x)"],description:"Get the real part of a complex number.",examples:["re(2 + 3i)","im(2 + 3i)","re(-5.2i)","re(2.4)"],seealso:["im","conj","abs","arg"]},t9={name:"evaluate",category:"Expression",syntax:["evaluate(expression)","evaluate(expression, scope)","evaluate([expr1, expr2, expr3, ...])","evaluate([expr1, expr2, expr3, ...], scope)"],description:"Evaluate an expression or an array with expressions.",examples:['evaluate("2 + 3")','evaluate("sqrt(16)")','evaluate("2 inch to cm")','evaluate("sin(x * pi)", { "x": 1/2 })','evaluate(["width=2", "height=4","width*height"])'],seealso:[]},n9={name:"help",category:"Expression",syntax:["help(object)","help(string)"],description:"Display documentation on a function or data type.",examples:["help(sqrt)",'help("complex")'],seealso:[]},a9={name:"distance",category:"Geometry",syntax:["distance([x1, y1], [x2, y2])","distance([[x1, y1], [x2, y2]])"],description:"Calculates the Euclidean distance between two points.",examples:["distance([0,0], [4,4])","distance([[0,0], [4,4]])"],seealso:[]},i9={name:"intersect",category:"Geometry",syntax:["intersect(expr1, expr2, expr3, expr4)","intersect(expr1, expr2, expr3)"],description:"Computes the intersection point of lines and/or planes.",examples:["intersect([0, 0], [10, 10], [10, 0], [0, 10])","intersect([1, 0, 1], [4, -2, 2], [1, 1, 1, 6])"],seealso:[]},o9={name:"and",category:"Logical",syntax:["x and y","and(x, y)"],description:"Logical and. Test whether two values are both defined with a nonzero/nonempty value.",examples:["true and false","true and true","2 and 4"],seealso:["not","or","xor"]},s9={name:"not",category:"Logical",syntax:["not x","not(x)"],description:"Logical not. Flips the boolean value of given argument.",examples:["not true","not false","not 2","not 0"],seealso:["and","or","xor"]},u9={name:"or",category:"Logical",syntax:["x or y","or(x, y)"],description:"Logical or. Test if at least one value is defined with a nonzero/nonempty value.",examples:["true or false","false or false","0 or 4"],seealso:["not","and","xor"]},l9={name:"xor",category:"Logical",syntax:["x xor y","xor(x, y)"],description:"Logical exclusive or, xor. Test whether one and only one value is defined with a nonzero/nonempty value.",examples:["true xor false","false xor false","true xor true","0 xor 4"],seealso:["not","and","or"]},c9={name:"column",category:"Matrix",syntax:["column(x, index)"],description:"Return a column from a matrix or array.",examples:["A = [[1, 2], [3, 4]]","column(A, 1)","column(A, 2)"],seealso:["row","matrixFromColumns"]},f9={name:"concat",category:"Matrix",syntax:["concat(A, B, C, ...)","concat(A, B, C, ..., dim)"],description:"Concatenate matrices. By default, the matrices are concatenated by the last dimension. The dimension on which to concatenate can be provided as last argument.",examples:["A = [1, 2; 5, 6]","B = [3, 4; 7, 8]","concat(A, B)","concat(A, B, 1)","concat(A, B, 2)"],seealso:["det","diag","identity","inv","ones","range","size","squeeze","subset","trace","transpose","zeros"]},m9={name:"count",category:"Matrix",syntax:["count(x)"],description:"Count the number of elements of a matrix, array or string.",examples:["a = [1, 2; 3, 4; 5, 6]","count(a)","size(a)",'count("hello world")'],seealso:["size"]},d9={name:"cross",category:"Matrix",syntax:["cross(A, B)"],description:"Calculate the cross product for two vectors in three dimensional space.",examples:["cross([1, 1, 0], [0, 1, 1])","cross([3, -3, 1], [4, 9, 2])","cross([2, 3, 4], [5, 6, 7])"],seealso:["multiply","dot"]},p9={name:"ctranspose",category:"Matrix",syntax:["x'","ctranspose(x)"],description:"Complex Conjugate and Transpose a matrix",examples:["a = [1, 2, 3; 4, 5, 6]","a'","ctranspose(a)"],seealso:["concat","det","diag","identity","inv","ones","range","size","squeeze","subset","trace","zeros"]},v9={name:"det",category:"Matrix",syntax:["det(x)"],description:"Calculate the determinant of a matrix",examples:["det([1, 2; 3, 4])","det([-2, 2, 3; -1, 1, 3; 2, 0, -1])"],seealso:["concat","diag","identity","inv","ones","range","size","squeeze","subset","trace","transpose","zeros"]},h9={name:"diag",category:"Matrix",syntax:["diag(x)","diag(x, k)"],description:"Create a diagonal matrix or retrieve the diagonal of a matrix. When x is a vector, a matrix with the vector values on the diagonal will be returned. When x is a matrix, a vector with the diagonal values of the matrix is returned. When k is provided, the k-th diagonal will be filled in or retrieved, if k is positive, the values are placed on the super diagonal. When k is negative, the values are placed on the sub diagonal.",examples:["diag(1:3)","diag(1:3, 1)","a = [1, 2, 3; 4, 5, 6; 7, 8, 9]","diag(a)"],seealso:["concat","det","identity","inv","ones","range","size","squeeze","subset","trace","transpose","zeros"]},g9={name:"diff",category:"Matrix",syntax:["diff(arr)","diff(arr, dim)"],description:["Create a new matrix or array with the difference of the passed matrix or array.","Dim parameter is optional and used to indicate the dimension of the array/matrix to apply the difference","If no dimension parameter is passed it is assumed as dimension 0","Dimension is zero-based in javascript and one-based in the parser","Arrays must be 'rectangular' meaning arrays like [1, 2]","If something is passed as a matrix it will be returned as a matrix but other than that all matrices are converted to arrays"],examples:["A = [1, 2, 4, 7, 0]","diff(A)","diff(A, 1)","B = [[1, 2], [3, 4]]","diff(B)","diff(B, 1)","diff(B, 2)","diff(B, bignumber(2))","diff([[1, 2], matrix([3, 4])], 2)"],seealso:["subtract","partitionSelect"]},y9={name:"dot",category:"Matrix",syntax:["dot(A, B)","A * B"],description:"Calculate the dot product of two vectors. The dot product of A = [a1, a2, a3, ..., an] and B = [b1, b2, b3, ..., bn] is defined as dot(A, B) = a1 * b1 + a2 * b2 + a3 * b3 + ... + an * bn",examples:["dot([2, 4, 1], [2, 2, 3])","[2, 4, 1] * [2, 2, 3]"],seealso:["multiply","cross"]},b9={name:"eigs",category:"Matrix",syntax:["eigs(x)"],description:"Calculate the eigenvalues and optionally eigenvectors of a square matrix",examples:["eigs([[5, 2.3], [2.3, 1]])","eigs([[1, 2, 3], [4, 5, 6], [7, 8, 9]], { precision: 1e-6, eigenvectors: false })"],seealso:["inv"]},w9={name:"filter",category:"Matrix",syntax:["filter(x, test)"],description:"Filter items in a matrix.",examples:["isPositive(x) = x > 0","filter([6, -2, -1, 4, 3], isPositive)","filter([6, -2, 0, 1, 0], x != 0)"],seealso:["sort","map","forEach"]},x9={name:"flatten",category:"Matrix",syntax:["flatten(x)"],description:"Flatten a multi dimensional matrix into a single dimensional matrix.",examples:["a = [1, 2, 3; 4, 5, 6]","size(a)","b = flatten(a)","size(b)"],seealso:["concat","resize","size","squeeze"]},N9={name:"forEach",category:"Matrix",syntax:["forEach(x, callback)"],description:"Iterates over all elements of a matrix/array, and executes the given callback function.",examples:["numberOfPets = {}","addPet(n) = numberOfPets[n] = (numberOfPets[n] ? numberOfPets[n]:0 ) + 1;",'forEach(["Dog","Cat","Cat"], addPet)',"numberOfPets"],seealso:["map","sort","filter"]},A9={name:"getMatrixDataType",category:"Matrix",syntax:["getMatrixDataType(x)"],description:'Find the data type of all elements in a matrix or array, for example "number" if all items are a number and "Complex" if all values are complex numbers. If a matrix contains more than one data type, it will return "mixed".',examples:["getMatrixDataType([1, 2, 3])","getMatrixDataType([[5 cm], [2 inch]])",'getMatrixDataType([1, "text"])',"getMatrixDataType([1, bignumber(4)])"],seealso:["matrix","sparse","typeOf"]},E9={name:"identity",category:"Matrix",syntax:["identity(n)","identity(m, n)","identity([m, n])"],description:"Returns the identity matrix with size m-by-n. The matrix has ones on the diagonal and zeros elsewhere.",examples:["identity(3)","identity(3, 5)","a = [1, 2, 3; 4, 5, 6]","identity(size(a))"],seealso:["concat","det","diag","inv","ones","range","size","squeeze","subset","trace","transpose","zeros"]},D9={name:"inv",category:"Matrix",syntax:["inv(x)"],description:"Calculate the inverse of a matrix",examples:["inv([1, 2; 3, 4])","inv(4)","1 / 4"],seealso:["concat","det","diag","identity","ones","range","size","squeeze","subset","trace","transpose","zeros"]},S9={name:"pinv",category:"Matrix",syntax:["pinv(x)"],description:"Calculate the Moore–Penrose inverse of a matrix",examples:["pinv([1, 2; 3, 4])","pinv([[1, 0], [0, 1], [0, 1]])","pinv(4)"],seealso:["inv"]},C9={name:"kron",category:"Matrix",syntax:["kron(x, y)"],description:"Calculates the Kronecker product of 2 matrices or vectors.",examples:["kron([[1, 0], [0, 1]], [[1, 2], [3, 4]])","kron([1,1], [2,3,4])"],seealso:["multiply","dot","cross"]},M9={name:"map",category:"Matrix",syntax:["map(x, callback)","map(x, y, ..., callback)"],description:"Create a new matrix or array with the results of the callback function executed on each entry of the matrix/array or the matrices/arrays.",examples:["map([1, 2, 3], square)","map([1, 2], [3, 4], f(a,b) = a + b)"],seealso:["filter","forEach"]},_9={name:"matrixFromColumns",category:"Matrix",syntax:["matrixFromColumns(...arr)","matrixFromColumns(row1, row2)","matrixFromColumns(row1, row2, row3)"],description:"Create a dense matrix from vectors as individual columns.",examples:["matrixFromColumns([1, 2, 3], [[4],[5],[6]])"],seealso:["matrix","matrixFromRows","matrixFromFunction","zeros"]},T9={name:"matrixFromFunction",category:"Matrix",syntax:["matrixFromFunction(size, fn)","matrixFromFunction(size, fn, format)","matrixFromFunction(size, fn, format, datatype)","matrixFromFunction(size, format, fn)","matrixFromFunction(size, format, datatype, fn)"],description:"Create a matrix by evaluating a generating function at each index.",examples:["f(I) = I[1] - I[2]","matrixFromFunction([3,3], f)","g(I) = I[1] - I[2] == 1 ? 4 : 0",'matrixFromFunction([100, 100], "sparse", g)',"matrixFromFunction([5], random)"],seealso:["matrix","matrixFromRows","matrixFromColumns","zeros"]},F9={name:"matrixFromRows",category:"Matrix",syntax:["matrixFromRows(...arr)","matrixFromRows(row1, row2)","matrixFromRows(row1, row2, row3)"],description:"Create a dense matrix from vectors as individual rows.",examples:["matrixFromRows([1, 2, 3], [[4],[5],[6]])"],seealso:["matrix","matrixFromColumns","matrixFromFunction","zeros"]},B9={name:"ones",category:"Matrix",syntax:["ones(m)","ones(m, n)","ones(m, n, p, ...)","ones([m])","ones([m, n])","ones([m, n, p, ...])"],description:"Create a matrix containing ones.",examples:["ones(3)","ones(3, 5)","ones([2,3]) * 4.5","a = [1, 2, 3; 4, 5, 6]","ones(size(a))"],seealso:["concat","det","diag","identity","inv","range","size","squeeze","subset","trace","transpose","zeros"]},O9={name:"partitionSelect",category:"Matrix",syntax:["partitionSelect(x, k)","partitionSelect(x, k, compare)"],description:"Partition-based selection of an array or 1D matrix. Will find the kth smallest value, and mutates the input array. Uses Quickselect.",examples:["partitionSelect([5, 10, 1], 2)",'partitionSelect(["C", "B", "A", "D"], 1, compareText)',"arr = [5, 2, 1]","partitionSelect(arr, 0) # returns 1, arr is now: [1, 2, 5]","arr","partitionSelect(arr, 1, 'desc') # returns 2, arr is now: [5, 2, 1]","arr"],seealso:["sort"]},$9={name:"range",category:"Type",syntax:["start:end","start:step:end","range(start, end)","range(start, end, step)","range(string)"],description:"Create a range. Lower bound of the range is included, upper bound is excluded.",examples:["1:5","3:-1:-3","range(3, 7)","range(0, 12, 2)",'range("4:10")',"range(1m, 1m, 3m)","a = [1, 2, 3, 4; 5, 6, 7, 8]","a[1:2, 1:2]"],seealso:["concat","det","diag","identity","inv","ones","size","squeeze","subset","trace","transpose","zeros"]},I9={name:"reshape",category:"Matrix",syntax:["reshape(x, sizes)"],description:"Reshape a multi dimensional array to fit the specified dimensions.",examples:["reshape([1, 2, 3, 4, 5, 6], [2, 3])","reshape([[1, 2], [3, 4]], [1, 4])","reshape([[1, 2], [3, 4]], [4])","reshape([1, 2, 3, 4], [-1, 2])"],seealso:["size","squeeze","resize"]},R9={name:"resize",category:"Matrix",syntax:["resize(x, size)","resize(x, size, defaultValue)"],description:"Resize a matrix.",examples:["resize([1,2,3,4,5], [3])","resize([1,2,3], [5])","resize([1,2,3], [5], -1)","resize(2, [2, 3])",'resize("hello", [8], "!")'],seealso:["size","subset","squeeze","reshape"]},z9={name:"rotate",category:"Matrix",syntax:["rotate(w, theta)","rotate(w, theta, v)"],description:"Returns a 2-D rotation matrix (2x2) for a given angle (in radians). Returns a 2-D rotation matrix (3x3) of a given angle (in radians) around given axis.",examples:["rotate([1, 0], pi / 2)",'rotate(matrix([1, 0]), unit("35deg"))','rotate([1, 0, 0], unit("90deg"), [0, 0, 1])','rotate(matrix([1, 0, 0]), unit("90deg"), matrix([0, 0, 1]))'],seealso:["matrix","rotationMatrix"]},P9={name:"rotationMatrix",category:"Matrix",syntax:["rotationMatrix(theta)","rotationMatrix(theta, v)","rotationMatrix(theta, v, format)"],description:"Returns a 2-D rotation matrix (2x2) for a given angle (in radians). Returns a 2-D rotation matrix (3x3) of a given angle (in radians) around given axis.",examples:["rotationMatrix(pi / 2)",'rotationMatrix(unit("45deg"), [0, 0, 1])','rotationMatrix(1, matrix([0, 0, 1]), "sparse")'],seealso:["cos","sin"]},k9={name:"row",category:"Matrix",syntax:["row(x, index)"],description:"Return a row from a matrix or array.",examples:["A = [[1, 2], [3, 4]]","row(A, 1)","row(A, 2)"],seealso:["column","matrixFromRows"]},q9={name:"size",category:"Matrix",syntax:["size(x)"],description:"Calculate the size of a matrix.",examples:["size(2.3)",'size("hello world")',"a = [1, 2; 3, 4; 5, 6]","size(a)","size(1:6)"],seealso:["concat","count","det","diag","identity","inv","ones","range","squeeze","subset","trace","transpose","zeros"]},L9={name:"sort",category:"Matrix",syntax:["sort(x)","sort(x, compare)"],description:'Sort the items in a matrix. Compare can be a string "asc", "desc", "natural", or a custom sort function.',examples:["sort([5, 10, 1])",'sort(["C", "B", "A", "D"], "natural")',"sortByLength(a, b) = size(a)[1] - size(b)[1]",'sort(["Langdon", "Tom", "Sara"], sortByLength)','sort(["10", "1", "2"], "natural")'],seealso:["map","filter","forEach"]},V9={name:"squeeze",category:"Matrix",syntax:["squeeze(x)"],description:"Remove inner and outer singleton dimensions from a matrix.",examples:["a = zeros(3,2,1)","size(squeeze(a))","b = zeros(1,1,3)","size(squeeze(b))"],seealso:["concat","det","diag","identity","inv","ones","range","size","subset","trace","transpose","zeros"]},U9={name:"subset",category:"Matrix",syntax:["value(index)","value(index) = replacement","subset(value, [index])","subset(value, [index], replacement)"],description:"Get or set a subset of the entries of a matrix or characters of a string. Indexes are one-based. There should be one index specification for each dimension of the target. Each specification can be a single index, a list of indices, or a range in colon notation `l:u`. In a range, both the lower bound l and upper bound u are included; and if a bound is omitted it defaults to the most extreme valid value. The cartesian product of the indices specified in each dimension determines the target of the operation.",examples:["d = [1, 2; 3, 4]","e = []","e[1, 1:2] = [5, 6]","e[2, :] = [7, 8]","f = d * e","f[2, 1]","f[:, 1]","f[[1,2], [1,3]] = [9, 10; 11, 12]","f"],seealso:["concat","det","diag","identity","inv","ones","range","size","squeeze","trace","transpose","zeros"]},H9={name:"trace",category:"Matrix",syntax:["trace(A)"],description:"Calculate the trace of a matrix: the sum of the elements on the main diagonal of a square matrix.",examples:["A = [1, 2, 3; -1, 2, 3; 2, 0, 3]","trace(A)"],seealso:["concat","det","diag","identity","inv","ones","range","size","squeeze","subset","transpose","zeros"]},Z9={name:"transpose",category:"Matrix",syntax:["x'","transpose(x)"],description:"Transpose a matrix",examples:["a = [1, 2, 3; 4, 5, 6]","a'","transpose(a)"],seealso:["concat","det","diag","identity","inv","ones","range","size","squeeze","subset","trace","zeros"]},G9={name:"zeros",category:"Matrix",syntax:["zeros(m)","zeros(m, n)","zeros(m, n, p, ...)","zeros([m])","zeros([m, n])","zeros([m, n, p, ...])"],description:"Create a matrix containing zeros.",examples:["zeros(3)","zeros(3, 5)","a = [1, 2, 3; 4, 5, 6]","zeros(size(a))"],seealso:["concat","det","diag","identity","inv","ones","range","size","squeeze","subset","trace","transpose"]},W9={name:"fft",category:"Matrix",syntax:["fft(x)"],description:"Calculate N-dimensional Fourier transform",examples:["fft([[1, 0], [1, 0]])"],seealso:["ifft"]},j9={name:"ifft",category:"Matrix",syntax:["ifft(x)"],description:"Calculate N-dimensional inverse Fourier transform",examples:["ifft([[2, 2], [0, 0]])"],seealso:["fft"]},K9={name:"combinations",category:"Probability",syntax:["combinations(n, k)"],description:"Compute the number of combinations of n items taken k at a time",examples:["combinations(7, 5)"],seealso:["combinationsWithRep","permutations","factorial"]},J9={name:"combinationsWithRep",category:"Probability",syntax:["combinationsWithRep(n, k)"],description:"Compute the number of combinations of n items taken k at a time with replacements.",examples:["combinationsWithRep(7, 5)"],seealso:["combinations","permutations","factorial"]},Y9={name:"factorial",category:"Probability",syntax:["n!","factorial(n)"],description:"Compute the factorial of a value",examples:["5!","5 * 4 * 3 * 2 * 1","3!"],seealso:["combinations","combinationsWithRep","permutations","gamma"]},X9={name:"gamma",category:"Probability",syntax:["gamma(n)"],description:"Compute the gamma function. For small values, the Lanczos approximation is used, and for large values the extended Stirling approximation.",examples:["gamma(4)","3!","gamma(1/2)","sqrt(pi)"],seealso:["factorial"]},Q9={name:"lgamma",category:"Probability",syntax:["lgamma(n)"],description:"Logarithm of the gamma function for real, positive numbers and complex numbers, using Lanczos approximation for numbers and Stirling series for complex numbers.",examples:["lgamma(4)","lgamma(1/2)","lgamma(i)","lgamma(complex(1.1, 2))"],seealso:["gamma"]},eI={name:"kldivergence",category:"Probability",syntax:["kldivergence(x, y)"],description:"Calculate the Kullback-Leibler (KL) divergence between two distributions.",examples:["kldivergence([0.7,0.5,0.4], [0.2,0.9,0.5])"],seealso:[]},rI={name:"multinomial",category:"Probability",syntax:["multinomial(A)"],description:"Multinomial Coefficients compute the number of ways of picking a1, a2, ..., ai unordered outcomes from `n` possibilities. multinomial takes one array of integers as an argument. The following condition must be enforced: every ai > 0.",examples:["multinomial([1, 2, 1])"],seealso:["combinations","factorial"]},tI={name:"permutations",category:"Probability",syntax:["permutations(n)","permutations(n, k)"],description:"Compute the number of permutations of n items taken k at a time",examples:["permutations(5)","permutations(5, 3)"],seealso:["combinations","combinationsWithRep","factorial"]},nI={name:"pickRandom",category:"Probability",syntax:["pickRandom(array)","pickRandom(array, number)","pickRandom(array, weights)","pickRandom(array, number, weights)","pickRandom(array, weights, number)"],description:"Pick a random entry from a given array.",examples:["pickRandom(0:10)","pickRandom([1, 3, 1, 6])","pickRandom([1, 3, 1, 6], 2)","pickRandom([1, 3, 1, 6], [2, 3, 2, 1])","pickRandom([1, 3, 1, 6], 2, [2, 3, 2, 1])","pickRandom([1, 3, 1, 6], [2, 3, 2, 1], 2)"],seealso:["random","randomInt"]},aI={name:"random",category:"Probability",syntax:["random()","random(max)","random(min, max)","random(size)","random(size, max)","random(size, min, max)"],description:"Return a random number.",examples:["random()","random(10, 20)","random([2, 3])"],seealso:["pickRandom","randomInt"]},iI={name:"randomInt",category:"Probability",syntax:["randomInt(max)","randomInt(min, max)","randomInt(size)","randomInt(size, max)","randomInt(size, min, max)"],description:"Return a random integer number",examples:["randomInt(10, 20)","randomInt([2, 3], 10)"],seealso:["pickRandom","random"]},oI={name:"compare",category:"Relational",syntax:["compare(x, y)"],description:"Compare two values. Returns 1 when x > y, -1 when x < y, and 0 when x == y.",examples:["compare(2, 3)","compare(3, 2)","compare(2, 2)","compare(5cm, 40mm)","compare(2, [1, 2, 3])"],seealso:["equal","unequal","smaller","smallerEq","largerEq","compareNatural","compareText"]},sI={name:"compareNatural",category:"Relational",syntax:["compareNatural(x, y)"],description:"Compare two values of any type in a deterministic, natural way. Returns 1 when x > y, -1 when x < y, and 0 when x == y.",examples:["compareNatural(2, 3)","compareNatural(3, 2)","compareNatural(2, 2)","compareNatural(5cm, 40mm)",'compareNatural("2", "10")',"compareNatural(2 + 3i, 2 + 4i)","compareNatural([1, 2, 4], [1, 2, 3])","compareNatural([1, 5], [1, 2, 3])","compareNatural([1, 2], [1, 2])","compareNatural({a: 2}, {a: 4})"],seealso:["equal","unequal","smaller","smallerEq","largerEq","compare","compareText"]},uI={name:"compareText",category:"Relational",syntax:["compareText(x, y)"],description:"Compare two strings lexically. Comparison is case sensitive. Returns 1 when x > y, -1 when x < y, and 0 when x == y.",examples:['compareText("B", "A")','compareText("A", "B")','compareText("A", "A")','compareText("2", "10")','compare("2", "10")',"compare(2, 10)",'compareNatural("2", "10")','compareText("B", ["A", "B", "C"])'],seealso:["compare","compareNatural"]},lI={name:"deepEqual",category:"Relational",syntax:["deepEqual(x, y)"],description:"Check equality of two matrices element wise. Returns true if the size of both matrices is equal and when and each of the elements are equal.",examples:["deepEqual([1,3,4], [1,3,4])","deepEqual([1,3,4], [1,3])"],seealso:["equal","unequal","smaller","larger","smallerEq","largerEq","compare"]},cI={name:"equal",category:"Relational",syntax:["x == y","equal(x, y)"],description:"Check equality of two values. Returns true if the values are equal, and false if not.",examples:["2+2 == 3","2+2 == 4","a = 3.2","b = 6-2.8","a == b","50cm == 0.5m"],seealso:["unequal","smaller","larger","smallerEq","largerEq","compare","deepEqual","equalText"]},fI={name:"equalText",category:"Relational",syntax:["equalText(x, y)"],description:"Check equality of two strings. Comparison is case sensitive. Returns true if the values are equal, and false if not.",examples:['equalText("Hello", "Hello")','equalText("a", "A")','equal("2e3", "2000")','equalText("2e3", "2000")','equalText("B", ["A", "B", "C"])'],seealso:["compare","compareNatural","compareText","equal"]},mI={name:"larger",category:"Relational",syntax:["x > y","larger(x, y)"],description:"Check if value x is larger than y. Returns true if x is larger than y, and false if not.",examples:["2 > 3","5 > 2*2","a = 3.3","b = 6-2.8","(a > b)","(b < a)","5 cm > 2 inch"],seealso:["equal","unequal","smaller","smallerEq","largerEq","compare"]},dI={name:"largerEq",category:"Relational",syntax:["x >= y","largerEq(x, y)"],description:"Check if value x is larger or equal to y. Returns true if x is larger or equal to y, and false if not.",examples:["2 >= 1+1","2 > 1+1","a = 3.2","b = 6-2.8","(a >= b)"],seealso:["equal","unequal","smallerEq","smaller","compare"]},pI={name:"smaller",category:"Relational",syntax:["x < y","smaller(x, y)"],description:"Check if value x is smaller than value y. Returns true if x is smaller than y, and false if not.",examples:["2 < 3","5 < 2*2","a = 3.3","b = 6-2.8","(a < b)","5 cm < 2 inch"],seealso:["equal","unequal","larger","smallerEq","largerEq","compare"]},vI={name:"smallerEq",category:"Relational",syntax:["x <= y","smallerEq(x, y)"],description:"Check if value x is smaller or equal to value y. Returns true if x is smaller than y, and false if not.",examples:["2 <= 1+1","2 < 1+1","a = 3.2","b = 6-2.8","(a <= b)"],seealso:["equal","unequal","larger","smaller","largerEq","compare"]},hI={name:"unequal",category:"Relational",syntax:["x != y","unequal(x, y)"],description:"Check unequality of two values. Returns true if the values are unequal, and false if they are equal.",examples:["2+2 != 3","2+2 != 4","a = 3.2","b = 6-2.8","a != b","50cm != 0.5m","5 cm != 2 inch"],seealso:["equal","smaller","larger","smallerEq","largerEq","compare","deepEqual"]},gI={name:"setCartesian",category:"Set",syntax:["setCartesian(set1, set2)"],description:"Create the cartesian product of two (multi)sets. Multi-dimension arrays will be converted to single-dimension arrays and the values will be sorted in ascending order before the operation.",examples:["setCartesian([1, 2], [3, 4])"],seealso:["setUnion","setIntersect","setDifference","setPowerset"]},yI={name:"setDifference",category:"Set",syntax:["setDifference(set1, set2)"],description:"Create the difference of two (multi)sets: every element of set1, that is not the element of set2. Multi-dimension arrays will be converted to single-dimension arrays before the operation.",examples:["setDifference([1, 2, 3, 4], [3, 4, 5, 6])","setDifference([[1, 2], [3, 4]], [[3, 4], [5, 6]])"],seealso:["setUnion","setIntersect","setSymDifference"]},bI={name:"setDistinct",category:"Set",syntax:["setDistinct(set)"],description:"Collect the distinct elements of a multiset. A multi-dimension array will be converted to a single-dimension array before the operation.",examples:["setDistinct([1, 1, 1, 2, 2, 3])"],seealso:["setMultiplicity"]},wI={name:"setIntersect",category:"Set",syntax:["setIntersect(set1, set2)"],description:"Create the intersection of two (multi)sets. Multi-dimension arrays will be converted to single-dimension arrays before the operation.",examples:["setIntersect([1, 2, 3, 4], [3, 4, 5, 6])","setIntersect([[1, 2], [3, 4]], [[3, 4], [5, 6]])"],seealso:["setUnion","setDifference"]},xI={name:"setIsSubset",category:"Set",syntax:["setIsSubset(set1, set2)"],description:"Check whether a (multi)set is a subset of another (multi)set: every element of set1 is the element of set2. Multi-dimension arrays will be converted to single-dimension arrays before the operation.",examples:["setIsSubset([1, 2], [3, 4, 5, 6])","setIsSubset([3, 4], [3, 4, 5, 6])"],seealso:["setUnion","setIntersect","setDifference"]},NI={name:"setMultiplicity",category:"Set",syntax:["setMultiplicity(element, set)"],description:"Count the multiplicity of an element in a multiset. A multi-dimension array will be converted to a single-dimension array before the operation.",examples:["setMultiplicity(1, [1, 2, 2, 4])","setMultiplicity(2, [1, 2, 2, 4])"],seealso:["setDistinct","setSize"]},AI={name:"setPowerset",category:"Set",syntax:["setPowerset(set)"],description:"Create the powerset of a (multi)set: the powerset contains very possible subsets of a (multi)set. A multi-dimension array will be converted to a single-dimension array before the operation.",examples:["setPowerset([1, 2, 3])"],seealso:["setCartesian"]},EI={name:"setSize",category:"Set",syntax:["setSize(set)","setSize(set, unique)"],description:'Count the number of elements of a (multi)set. When the second parameter "unique" is true, count only the unique values. A multi-dimension array will be converted to a single-dimension array before the operation.',examples:["setSize([1, 2, 2, 4])","setSize([1, 2, 2, 4], true)"],seealso:["setUnion","setIntersect","setDifference"]},DI={name:"setSymDifference",category:"Set",syntax:["setSymDifference(set1, set2)"],description:"Create the symmetric difference of two (multi)sets. Multi-dimension arrays will be converted to single-dimension arrays before the operation.",examples:["setSymDifference([1, 2, 3, 4], [3, 4, 5, 6])","setSymDifference([[1, 2], [3, 4]], [[3, 4], [5, 6]])"],seealso:["setUnion","setIntersect","setDifference"]},SI={name:"setUnion",category:"Set",syntax:["setUnion(set1, set2)"],description:"Create the union of two (multi)sets. Multi-dimension arrays will be converted to single-dimension arrays before the operation.",examples:["setUnion([1, 2, 3, 4], [3, 4, 5, 6])","setUnion([[1, 2], [3, 4]], [[3, 4], [5, 6]])"],seealso:["setIntersect","setDifference"]},CI={name:"zpk2tf",category:"Signal",syntax:["zpk2tf(z, p, k)"],description:"Compute the transfer function of a zero-pole-gain model.",examples:["zpk2tf([1, 2], [-1, -2], 1)","zpk2tf([1, 2], [-1, -2])","zpk2tf([1 - 3i, 2 + 2i], [-1, -2])"],seealso:[]},MI={name:"freqz",category:"Signal",syntax:["freqz(b, a)","freqz(b, a, w)"],description:"Calculates the frequency response of a filter given its numerator and denominator coefficients.",examples:["freqz([1, 2], [1, 2, 3])","freqz([1, 2], [1, 2, 3], [0, 1])","freqz([1, 2], [1, 2, 3], 512)"],seealso:[]},_I={name:"erf",category:"Special",syntax:["erf(x)"],description:"Compute the erf function of a value using a rational Chebyshev approximations for different intervals of x",examples:["erf(0.2)","erf(-0.5)","erf(4)"],seealso:[]},TI={name:"zeta",category:"Special",syntax:["zeta(s)"],description:"Compute the Riemann Zeta Function using an infinite series and Riemann's Functional Equation for the entire complex plane",examples:["zeta(0.2)","zeta(-0.5)","zeta(4)"],seealso:[]},FI={name:"mad",category:"Statistics",syntax:["mad(a, b, c, ...)","mad(A)"],description:"Compute the median absolute deviation of a matrix or a list with values. The median absolute deviation is defined as the median of the absolute deviations from the median.",examples:["mad(10, 20, 30)","mad([1, 2, 3])"],seealso:["mean","median","std","abs"]},BI={name:"max",category:"Statistics",syntax:["max(a, b, c, ...)","max(A)","max(A, dimension)"],description:"Compute the maximum value of a list of values.",examples:["max(2, 3, 4, 1)","max([2, 3, 4, 1])","max([2, 5; 4, 3])","max([2, 5; 4, 3], 1)","max([2, 5; 4, 3], 2)","max(2.7, 7.1, -4.5, 2.0, 4.1)","min(2.7, 7.1, -4.5, 2.0, 4.1)"],seealso:["mean","median","min","prod","std","sum","variance"]},OI={name:"mean",category:"Statistics",syntax:["mean(a, b, c, ...)","mean(A)","mean(A, dimension)"],description:"Compute the arithmetic mean of a list of values.",examples:["mean(2, 3, 4, 1)","mean([2, 3, 4, 1])","mean([2, 5; 4, 3])","mean([2, 5; 4, 3], 1)","mean([2, 5; 4, 3], 2)","mean([1.0, 2.7, 3.2, 4.0])"],seealso:["max","median","min","prod","std","sum","variance"]},$I={name:"median",category:"Statistics",syntax:["median(a, b, c, ...)","median(A)"],description:"Compute the median of all values. The values are sorted and the middle value is returned. In case of an even number of values, the average of the two middle values is returned.",examples:["median(5, 2, 7)","median([3, -1, 5, 7])"],seealso:["max","mean","min","prod","std","sum","variance","quantileSeq"]},II={name:"min",category:"Statistics",syntax:["min(a, b, c, ...)","min(A)","min(A, dimension)"],description:"Compute the minimum value of a list of values.",examples:["min(2, 3, 4, 1)","min([2, 3, 4, 1])","min([2, 5; 4, 3])","min([2, 5; 4, 3], 1)","min([2, 5; 4, 3], 2)","min(2.7, 7.1, -4.5, 2.0, 4.1)","max(2.7, 7.1, -4.5, 2.0, 4.1)"],seealso:["max","mean","median","prod","std","sum","variance"]},RI={name:"mode",category:"Statistics",syntax:["mode(a, b, c, ...)","mode(A)","mode(A, a, b, B, c, ...)"],description:"Computes the mode of all values as an array. In case mode being more than one, multiple values are returned in an array.",examples:["mode(2, 1, 4, 3, 1)","mode([1, 2.7, 3.2, 4, 2.7])","mode(1, 4, 6, 1, 6)"],seealso:["max","mean","min","median","prod","std","sum","variance"]},zI={name:"prod",category:"Statistics",syntax:["prod(a, b, c, ...)","prod(A)"],description:"Compute the product of all values.",examples:["prod(2, 3, 4)","prod([2, 3, 4])","prod([2, 5; 4, 3])"],seealso:["max","mean","min","median","min","std","sum","variance"]},PI={name:"quantileSeq",category:"Statistics",syntax:["quantileSeq(A, prob[, sorted])","quantileSeq(A, [prob1, prob2, ...][, sorted])","quantileSeq(A, N[, sorted])"],description:`Compute the prob order quantile of a matrix or a list with values. The sequence is sorted and the middle value is returned. Supported types of sequence values are: Number, BigNumber, Unit Supported types of probability are: Number, BigNumber. In case of a (multi dimensional) array or matrix, the prob order quantile of all elements will be calculated.`,examples:["quantileSeq([3, -1, 5, 7], 0.5)","quantileSeq([3, -1, 5, 7], [1/3, 2/3])","quantileSeq([3, -1, 5, 7], 2)","quantileSeq([-1, 3, 5, 7], 0.5, true)"],seealso:["mean","median","min","max","prod","std","sum","variance"]},kI={name:"std",category:"Statistics",syntax:["std(a, b, c, ...)","std(A)","std(A, dimension)","std(A, normalization)","std(A, dimension, normalization)"],description:'Compute the standard deviation of all values, defined as std(A) = sqrt(variance(A)). Optional parameter normalization can be "unbiased" (default), "uncorrected", or "biased".',examples:["std(2, 4, 6)","std([2, 4, 6, 8])",'std([2, 4, 6, 8], "uncorrected")','std([2, 4, 6, 8], "biased")',"std([1, 2, 3; 4, 5, 6])"],seealso:["max","mean","min","median","prod","sum","variance"]},qI={name:"cumsum",category:"Statistics",syntax:["cumsum(a, b, c, ...)","cumsum(A)"],description:"Compute the cumulative sum of all values.",examples:["cumsum(2, 3, 4, 1)","cumsum([2, 3, 4, 1])","cumsum([1, 2; 3, 4])","cumsum([1, 2; 3, 4], 1)","cumsum([1, 2; 3, 4], 2)"],seealso:["max","mean","median","min","prod","std","sum","variance"]},LI={name:"sum",category:"Statistics",syntax:["sum(a, b, c, ...)","sum(A)","sum(A, dimension)"],description:"Compute the sum of all values.",examples:["sum(2, 3, 4, 1)","sum([2, 3, 4, 1])","sum([2, 5; 4, 3])"],seealso:["max","mean","median","min","prod","std","sum","variance"]},VI={name:"variance",category:"Statistics",syntax:["variance(a, b, c, ...)","variance(A)","variance(A, dimension)","variance(A, normalization)","variance(A, dimension, normalization)"],description:'Compute the variance of all values. Optional parameter normalization can be "unbiased" (default), "uncorrected", or "biased".',examples:["variance(2, 4, 6)","variance([2, 4, 6, 8])",'variance([2, 4, 6, 8], "uncorrected")','variance([2, 4, 6, 8], "biased")',"variance([1, 2, 3; 4, 5, 6])"],seealso:["max","mean","min","median","min","prod","std","sum"]},UI={name:"corr",category:"Statistics",syntax:["corr(A,B)"],description:"Compute the correlation coefficient of a two list with values, For matrices, the matrix correlation coefficient is calculated.",examples:["corr([2, 4, 6, 8],[1, 2, 3, 6])","corr(matrix([[1, 2.2, 3, 4.8, 5], [1, 2, 3, 4, 5]]), matrix([[4, 5.3, 6.6, 7, 8], [1, 2, 3, 4, 5]]))"],seealso:["max","mean","min","median","min","prod","std","sum"]},HI={name:"acos",category:"Trigonometry",syntax:["acos(x)"],description:"Compute the inverse cosine of a value in radians.",examples:["acos(0.5)","acos(cos(2.3))"],seealso:["cos","atan","asin"]},ZI={name:"acosh",category:"Trigonometry",syntax:["acosh(x)"],description:"Calculate the hyperbolic arccos of a value, defined as `acosh(x) = ln(sqrt(x^2 - 1) + x)`.",examples:["acosh(1.5)"],seealso:["cosh","asinh","atanh"]},GI={name:"acot",category:"Trigonometry",syntax:["acot(x)"],description:"Calculate the inverse cotangent of a value.",examples:["acot(0.5)","acot(cot(0.5))","acot(2)"],seealso:["cot","atan"]},WI={name:"acoth",category:"Trigonometry",syntax:["acoth(x)"],description:"Calculate the inverse hyperbolic tangent of a value, defined as `acoth(x) = (ln((x+1)/x) + ln(x/(x-1))) / 2`.",examples:["acoth(2)","acoth(0.5)"],seealso:["acsch","asech"]},jI={name:"acsc",category:"Trigonometry",syntax:["acsc(x)"],description:"Calculate the inverse cotangent of a value.",examples:["acsc(2)","acsc(csc(0.5))","acsc(0.5)"],seealso:["csc","asin","asec"]},KI={name:"acsch",category:"Trigonometry",syntax:["acsch(x)"],description:"Calculate the inverse hyperbolic cosecant of a value, defined as `acsch(x) = ln(1/x + sqrt(1/x^2 + 1))`.",examples:["acsch(0.5)"],seealso:["asech","acoth"]},JI={name:"asec",category:"Trigonometry",syntax:["asec(x)"],description:"Calculate the inverse secant of a value.",examples:["asec(0.5)","asec(sec(0.5))","asec(2)"],seealso:["acos","acot","acsc"]},YI={name:"asech",category:"Trigonometry",syntax:["asech(x)"],description:"Calculate the inverse secant of a value.",examples:["asech(0.5)"],seealso:["acsch","acoth"]},XI={name:"asin",category:"Trigonometry",syntax:["asin(x)"],description:"Compute the inverse sine of a value in radians.",examples:["asin(0.5)","asin(sin(0.5))"],seealso:["sin","acos","atan"]},QI={name:"asinh",category:"Trigonometry",syntax:["asinh(x)"],description:"Calculate the hyperbolic arcsine of a value, defined as `asinh(x) = ln(x + sqrt(x^2 + 1))`.",examples:["asinh(0.5)"],seealso:["acosh","atanh"]},eR={name:"atan",category:"Trigonometry",syntax:["atan(x)"],description:"Compute the inverse tangent of a value in radians.",examples:["atan(0.5)","atan(tan(0.5))"],seealso:["tan","acos","asin"]},rR={name:"atan2",category:"Trigonometry",syntax:["atan2(y, x)"],description:"Computes the principal value of the arc tangent of y/x in radians.",examples:["atan2(2, 2) / pi","angle = 60 deg in rad","x = cos(angle)","y = sin(angle)","atan2(y, x)"],seealso:["sin","cos","tan"]},tR={name:"atanh",category:"Trigonometry",syntax:["atanh(x)"],description:"Calculate the hyperbolic arctangent of a value, defined as `atanh(x) = ln((1 + x)/(1 - x)) / 2`.",examples:["atanh(0.5)"],seealso:["acosh","asinh"]},nR={name:"cos",category:"Trigonometry",syntax:["cos(x)"],description:"Compute the cosine of x in radians.",examples:["cos(2)","cos(pi / 4) ^ 2","cos(180 deg)","cos(60 deg)","sin(0.2)^2 + cos(0.2)^2"],seealso:["acos","sin","tan"]},aR={name:"cosh",category:"Trigonometry",syntax:["cosh(x)"],description:"Compute the hyperbolic cosine of x in radians.",examples:["cosh(0.5)"],seealso:["sinh","tanh","coth"]},iR={name:"cot",category:"Trigonometry",syntax:["cot(x)"],description:"Compute the cotangent of x in radians. Defined as 1/tan(x)",examples:["cot(2)","1 / tan(2)"],seealso:["sec","csc","tan"]},oR={name:"coth",category:"Trigonometry",syntax:["coth(x)"],description:"Compute the hyperbolic cotangent of x in radians.",examples:["coth(2)","1 / tanh(2)"],seealso:["sech","csch","tanh"]},sR={name:"csc",category:"Trigonometry",syntax:["csc(x)"],description:"Compute the cosecant of x in radians. Defined as 1/sin(x)",examples:["csc(2)","1 / sin(2)"],seealso:["sec","cot","sin"]},uR={name:"csch",category:"Trigonometry",syntax:["csch(x)"],description:"Compute the hyperbolic cosecant of x in radians. Defined as 1/sinh(x)",examples:["csch(2)","1 / sinh(2)"],seealso:["sech","coth","sinh"]},lR={name:"sec",category:"Trigonometry",syntax:["sec(x)"],description:"Compute the secant of x in radians. Defined as 1/cos(x)",examples:["sec(2)","1 / cos(2)"],seealso:["cot","csc","cos"]},cR={name:"sech",category:"Trigonometry",syntax:["sech(x)"],description:"Compute the hyperbolic secant of x in radians. Defined as 1/cosh(x)",examples:["sech(2)","1 / cosh(2)"],seealso:["coth","csch","cosh"]},fR={name:"sin",category:"Trigonometry",syntax:["sin(x)"],description:"Compute the sine of x in radians.",examples:["sin(2)","sin(pi / 4) ^ 2","sin(90 deg)","sin(30 deg)","sin(0.2)^2 + cos(0.2)^2"],seealso:["asin","cos","tan"]},mR={name:"sinh",category:"Trigonometry",syntax:["sinh(x)"],description:"Compute the hyperbolic sine of x in radians.",examples:["sinh(0.5)"],seealso:["cosh","tanh"]},dR={name:"tan",category:"Trigonometry",syntax:["tan(x)"],description:"Compute the tangent of x in radians.",examples:["tan(0.5)","sin(0.5) / cos(0.5)","tan(pi / 4)","tan(45 deg)"],seealso:["atan","sin","cos"]},pR={name:"tanh",category:"Trigonometry",syntax:["tanh(x)"],description:"Compute the hyperbolic tangent of x in radians.",examples:["tanh(0.5)","sinh(0.5) / cosh(0.5)"],seealso:["sinh","cosh"]},vR={name:"to",category:"Units",syntax:["x to unit","to(x, unit)"],description:"Change the unit of a value.",examples:["5 inch to cm","3.2kg to g","16 bytes in bits"],seealso:[]},hR={name:"bin",category:"Utils",syntax:["bin(value)"],description:"Format a number as binary",examples:["bin(2)"],seealso:["oct","hex"]},gR={name:"clone",category:"Utils",syntax:["clone(x)"],description:"Clone a variable. Creates a copy of primitive variables, and a deep copy of matrices",examples:["clone(3.5)","clone(2 - 4i)","clone(45 deg)","clone([1, 2; 3, 4])",'clone("hello world")'],seealso:[]},yR={name:"format",category:"Utils",syntax:["format(value)","format(value, precision)"],description:"Format a value of any type as string.",examples:["format(2.3)","format(3 - 4i)","format([])","format(pi, 3)"],seealso:["print"]},bR={name:"hasNumericValue",category:"Utils",syntax:["hasNumericValue(x)"],description:"Test whether a value is an numeric value. In case of a string, true is returned if the string contains a numeric value.",examples:["hasNumericValue(2)",'hasNumericValue("2")','isNumeric("2")',"hasNumericValue(0)","hasNumericValue(bignumber(500))","hasNumericValue(fraction(0.125))","hasNumericValue(2 + 3i)",'hasNumericValue([2.3, "foo", false])'],seealso:["isInteger","isZero","isNegative","isPositive","isNaN","isNumeric"]},wR={name:"hex",category:"Utils",syntax:["hex(value)"],description:"Format a number as hexadecimal",examples:["hex(240)"],seealso:["bin","oct"]},xR={name:"isInteger",category:"Utils",syntax:["isInteger(x)"],description:"Test whether a value is an integer number.",examples:["isInteger(2)","isInteger(3.5)","isInteger([3, 0.5, -2])"],seealso:["isNegative","isNumeric","isPositive","isZero"]},NR={name:"isNaN",category:"Utils",syntax:["isNaN(x)"],description:"Test whether a value is NaN (not a number)",examples:["isNaN(2)","isNaN(0 / 0)","isNaN(NaN)","isNaN(Infinity)"],seealso:["isNegative","isNumeric","isPositive","isZero"]},AR={name:"isNegative",category:"Utils",syntax:["isNegative(x)"],description:"Test whether a value is negative: smaller than zero.",examples:["isNegative(2)","isNegative(0)","isNegative(-4)","isNegative([3, 0.5, -2])"],seealso:["isInteger","isNumeric","isPositive","isZero"]},ER={name:"isNumeric",category:"Utils",syntax:["isNumeric(x)"],description:"Test whether a value is a numeric value. Returns true when the input is a number, BigNumber, Fraction, or boolean.",examples:["isNumeric(2)",'isNumeric("2")','hasNumericValue("2")',"isNumeric(0)","isNumeric(bignumber(500))","isNumeric(fraction(0.125))","isNumeric(2 + 3i)",'isNumeric([2.3, "foo", false])'],seealso:["isInteger","isZero","isNegative","isPositive","isNaN","hasNumericValue"]},DR={name:"isPositive",category:"Utils",syntax:["isPositive(x)"],description:"Test whether a value is positive: larger than zero.",examples:["isPositive(2)","isPositive(0)","isPositive(-4)","isPositive([3, 0.5, -2])"],seealso:["isInteger","isNumeric","isNegative","isZero"]},SR={name:"isPrime",category:"Utils",syntax:["isPrime(x)"],description:"Test whether a value is prime: has no divisors other than itself and one.",examples:["isPrime(3)","isPrime(-2)","isPrime([2, 17, 100])"],seealso:["isInteger","isNumeric","isNegative","isZero"]},CR={name:"isZero",category:"Utils",syntax:["isZero(x)"],description:"Test whether a value is zero.",examples:["isZero(2)","isZero(0)","isZero(-4)","isZero([3, 0, -2, 0])"],seealso:["isInteger","isNumeric","isNegative","isPositive"]},MR={name:"numeric",category:"Utils",syntax:["numeric(x)"],description:"Convert a numeric input to a specific numeric type: number, BigNumber, bigint, or Fraction.",examples:['numeric("4")','numeric("4", "number")','numeric("4", "bigint")','numeric("4", "BigNumber")','numeric("4", "Fraction")','numeric(4, "Fraction")','numeric(fraction(2, 5), "number")'],seealso:["number","bigint","fraction","bignumber","string","format"]},_R={name:"oct",category:"Utils",syntax:["oct(value)"],description:"Format a number as octal",examples:["oct(56)"],seealso:["bin","hex"]},TR={name:"print",category:"Utils",syntax:["print(template, values)","print(template, values, precision)"],description:"Interpolate values into a string template.",examples:['print("Lucy is $age years old", {age: 5})','print("The value of pi is $pi", {pi: pi}, 3)','print("Hello, $user.name!", {user: {name: "John"}})','print("Values: $1, $2, $3", [6, 9, 4])'],seealso:["format"]},FR={name:"typeOf",category:"Utils",syntax:["typeOf(x)"],description:"Get the type of a variable.",examples:["typeOf(3.5)","typeOf(2 - 4i)","typeOf(45 deg)",'typeOf("hello world")'],seealso:["getMatrixDataType"]},BR={name:"solveODE",category:"Numeric",syntax:["solveODE(func, tspan, y0)","solveODE(func, tspan, y0, options)"],description:"Numerical Integration of Ordinary Differential Equations.",examples:["f(t,y) = y","tspan = [0, 4]","solveODE(f, tspan, 1)","solveODE(f, tspan, [1, 2])",'solveODE(f, tspan, 1, { method:"RK23", maxStep:0.1 })'],seealso:["derivative","simplifyCore"]},OR={bignumber:N6,bigint:A6,boolean:E6,complex:D6,createUnit:S6,fraction:C6,index:M6,matrix:_6,number:T6,sparse:F6,splitUnit:B6,string:O6,unit:$6,e:tg,E:tg,false:s6,i:u6,Infinity:l6,LN2:f6,LN10:c6,LOG2E:d6,LOG10E:m6,NaN:p6,null:v6,pi:ng,PI:ng,phi:h6,SQRT1_2:g6,SQRT2:y6,tau:b6,true:w6,version:x6,speedOfLight:{description:"Speed of light in vacuum",examples:["speedOfLight"]},gravitationConstant:{description:"Newtonian constant of gravitation",examples:["gravitationConstant"]},planckConstant:{description:"Planck constant",examples:["planckConstant"]},reducedPlanckConstant:{description:"Reduced Planck constant",examples:["reducedPlanckConstant"]},magneticConstant:{description:"Magnetic constant (vacuum permeability)",examples:["magneticConstant"]},electricConstant:{description:"Electric constant (vacuum permeability)",examples:["electricConstant"]},vacuumImpedance:{description:"Characteristic impedance of vacuum",examples:["vacuumImpedance"]},coulomb:{description:"Coulomb's constant",examples:["coulomb"]},elementaryCharge:{description:"Elementary charge",examples:["elementaryCharge"]},bohrMagneton:{description:"Bohr magneton",examples:["bohrMagneton"]},conductanceQuantum:{description:"Conductance quantum",examples:["conductanceQuantum"]},inverseConductanceQuantum:{description:"Inverse conductance quantum",examples:["inverseConductanceQuantum"]},magneticFluxQuantum:{description:"Magnetic flux quantum",examples:["magneticFluxQuantum"]},nuclearMagneton:{description:"Nuclear magneton",examples:["nuclearMagneton"]},klitzing:{description:"Von Klitzing constant",examples:["klitzing"]},bohrRadius:{description:"Bohr radius",examples:["bohrRadius"]},classicalElectronRadius:{description:"Classical electron radius",examples:["classicalElectronRadius"]},electronMass:{description:"Electron mass",examples:["electronMass"]},fermiCoupling:{description:"Fermi coupling constant",examples:["fermiCoupling"]},fineStructure:{description:"Fine-structure constant",examples:["fineStructure"]},hartreeEnergy:{description:"Hartree energy",examples:["hartreeEnergy"]},protonMass:{description:"Proton mass",examples:["protonMass"]},deuteronMass:{description:"Deuteron Mass",examples:["deuteronMass"]},neutronMass:{description:"Neutron mass",examples:["neutronMass"]},quantumOfCirculation:{description:"Quantum of circulation",examples:["quantumOfCirculation"]},rydberg:{description:"Rydberg constant",examples:["rydberg"]},thomsonCrossSection:{description:"Thomson cross section",examples:["thomsonCrossSection"]},weakMixingAngle:{description:"Weak mixing angle",examples:["weakMixingAngle"]},efimovFactor:{description:"Efimov factor",examples:["efimovFactor"]},atomicMass:{description:"Atomic mass constant",examples:["atomicMass"]},avogadro:{description:"Avogadro's number",examples:["avogadro"]},boltzmann:{description:"Boltzmann constant",examples:["boltzmann"]},faraday:{description:"Faraday constant",examples:["faraday"]},firstRadiation:{description:"First radiation constant",examples:["firstRadiation"]},loschmidt:{description:"Loschmidt constant at T=273.15 K and p=101.325 kPa",examples:["loschmidt"]},gasConstant:{description:"Gas constant",examples:["gasConstant"]},molarPlanckConstant:{description:"Molar Planck constant",examples:["molarPlanckConstant"]},molarVolume:{description:"Molar volume of an ideal gas at T=273.15 K and p=101.325 kPa",examples:["molarVolume"]},sackurTetrode:{description:"Sackur-Tetrode constant at T=1 K and p=101.325 kPa",examples:["sackurTetrode"]},secondRadiation:{description:"Second radiation constant",examples:["secondRadiation"]},stefanBoltzmann:{description:"Stefan-Boltzmann constant",examples:["stefanBoltzmann"]},wienDisplacement:{description:"Wien displacement law constant",examples:["wienDisplacement"]},molarMass:{description:"Molar mass constant",examples:["molarMass"]},molarMassC12:{description:"Molar mass constant of carbon-12",examples:["molarMassC12"]},gravity:{description:"Standard acceleration of gravity (standard acceleration of free-fall on Earth)",examples:["gravity"]},planckLength:{description:"Planck length",examples:["planckLength"]},planckMass:{description:"Planck mass",examples:["planckMass"]},planckTime:{description:"Planck time",examples:["planckTime"]},planckCharge:{description:"Planck charge",examples:["planckCharge"]},planckTemperature:{description:"Planck temperature",examples:["planckTemperature"]},derivative:P6,lsolve:q6,lsolveAll:L6,lup:V6,lusolve:U6,leafCount:k6,polynomialRoot:H6,resolve:W6,simplify:j6,simplifyConstant:K6,simplifyCore:J6,symbolicEqual:X6,rationalize:G6,slu:Y6,usolve:Q6,usolveAll:e$,qr:Z6,abs:r$,add:t$,cbrt:n$,ceil:a$,cube:i$,divide:o$,dotDivide:s$,dotMultiply:u$,dotPow:l$,exp:c$,expm:f$,expm1:m$,fix:d$,floor:p$,gcd:v$,hypot:h$,lcm:y$,log:b$,log2:N$,log1p:x$,log10:w$,mod:A$,multiply:E$,norm:D$,nthRoot:S$,nthRoots:C$,pow:M$,round:_$,sign:T$,sqrt:F$,sqrtm:B$,square:R$,subtract:z$,unaryMinus:P$,unaryPlus:k$,xgcd:q$,invmod:g$,bitAnd:L$,bitNot:V$,bitOr:U$,bitXor:H$,leftShift:Z$,rightArithShift:G$,rightLogShift:W$,bellNumbers:j$,catalan:K$,composition:J$,stirlingS2:Y$,config:I6,import:R6,typed:z6,arg:X$,conj:Q$,re:r9,im:e9,evaluate:t9,help:n9,distance:a9,intersect:i9,and:o9,not:s9,or:u9,xor:l9,concat:f9,count:m9,cross:d9,column:c9,ctranspose:p9,det:v9,diag:h9,diff:g9,dot:y9,getMatrixDataType:A9,identity:E9,filter:w9,flatten:x9,forEach:N9,inv:D9,pinv:S9,eigs:b9,kron:C9,matrixFromFunction:T9,matrixFromRows:F9,matrixFromColumns:_9,map:M9,ones:B9,partitionSelect:O9,range:$9,resize:R9,reshape:I9,rotate:z9,rotationMatrix:P9,row:k9,size:q9,sort:L9,squeeze:V9,subset:U9,trace:H9,transpose:Z9,zeros:G9,fft:W9,ifft:j9,sylvester:O$,schur:$$,lyap:I$,solveODE:BR,combinations:K9,combinationsWithRep:J9,factorial:Y9,gamma:X9,kldivergence:eI,lgamma:Q9,multinomial:rI,permutations:tI,pickRandom:nI,random:aI,randomInt:iI,compare:oI,compareNatural:sI,compareText:uI,deepEqual:lI,equal:cI,equalText:fI,larger:mI,largerEq:dI,smaller:pI,smallerEq:vI,unequal:hI,setCartesian:gI,setDifference:yI,setDistinct:bI,setIntersect:wI,setIsSubset:xI,setMultiplicity:NI,setPowerset:AI,setSize:EI,setSymDifference:DI,setUnion:SI,zpk2tf:CI,freqz:MI,erf:_I,zeta:TI,cumsum:qI,mad:FI,max:BI,mean:OI,median:$I,min:II,mode:RI,prod:zI,quantileSeq:PI,std:kI,sum:LI,variance:VI,corr:UI,acos:HI,acosh:ZI,acot:GI,acoth:WI,acsc:jI,acsch:KI,asec:JI,asech:YI,asin:XI,asinh:QI,atan:eR,atanh:tR,atan2:rR,cos:nR,cosh:aR,cot:iR,coth:oR,csc:sR,csch:uR,sec:lR,sech:cR,sin:fR,sinh:mR,tan:dR,tanh:pR,to:vR,clone:gR,format:yR,bin:hR,oct:_R,hex:wR,isNaN:NR,isInteger:xR,isNegative:AR,isNumeric:ER,hasNumericValue:bR,isPositive:DR,isPrime:SR,isZero:CR,print:TR,typeOf:FR,numeric:MR},ag="help",$R=["typed","mathWithTransform","Help"],IR=P(ag,$R,e=>{var{typed:r,mathWithTransform:t,Help:n}=e;return r(ag,{any:function(i){var o,l=i;if(typeof i!="string"){for(o in t)if(De(t,o)&&i===t[o]){l=o;break}}var u=Pr(OR,l);if(!u){var s=typeof l=="function"?l.name:l;throw new Error('No documentation found on "'+s+'"')}return new n(u)}})}),ig="chain",RR=["typed","Chain"],zR=P(ig,RR,e=>{var{typed:r,Chain:t}=e;return r(ig,{"":function(){return new t},any:function(a){return new t(a)}})}),og="det",PR=["typed","matrix","subtractScalar","multiply","divideScalar","isZero","unaryMinus"],kR=P(og,PR,e=>{var{typed:r,matrix:t,subtractScalar:n,multiply:a,divideScalar:i,isZero:o,unaryMinus:l}=e;return r(og,{any:function(c){return Fe(c)},"Array | Matrix":function(c){var f;switch(_e(c)?f=c.size():Array.isArray(c)?(c=t(c),f=c.size()):f=[],f.length){case 0:return Fe(c);case 1:if(f[0]===1)return Fe(c.valueOf()[0]);if(f[0]===0)return 1;throw new RangeError("Matrix must be square (size: "+Ve(f)+")");case 2:{var m=f[0],p=f[1];if(m===p)return u(c.clone().valueOf(),m);if(p===0)return 1;throw new RangeError("Matrix must be square (size: "+Ve(f)+")")}default:throw new RangeError("Matrix must be two dimensional (size: "+Ve(f)+")")}}});function u(s,c,f){if(c===1)return Fe(s[0][0]);if(c===2)return n(a(s[0][0],s[1][1]),a(s[1][0],s[0][1]));for(var m=!1,p=new Array(c).fill(0).map((D,S)=>S),v=0;v{var{typed:r,matrix:t,divideScalar:n,addScalar:a,multiply:i,unaryMinus:o,det:l,identity:u,abs:s}=e;return r(sg,{"Array | Matrix":function(m){var p=_e(m)?m.size():$e(m);switch(p.length){case 1:if(p[0]===1)return _e(m)?t([n(1,m.valueOf()[0])]):[n(1,m[0])];throw new RangeError("Matrix must be square (size: "+Ve(p)+")");case 2:{var v=p[0],h=p[1];if(v===h)return _e(m)?t(c(m.valueOf(),v,h),m.storage()):c(m,v,h);throw new RangeError("Matrix must be square (size: "+Ve(p)+")")}default:throw new RangeError("Matrix must be two dimensional (size: "+Ve(p)+")")}},any:function(m){return n(1,m)}});function c(f,m,p){var v,h,w,b,A;if(m===1){if(b=f[0][0],b===0)throw Error("Cannot calculate inverse, determinant is zero");return[[n(1,b)]]}else if(m===2){var g=l(f);if(g===0)throw Error("Cannot calculate inverse, determinant is zero");return[[n(f[1][1],g),n(o(f[0][1]),g)],[n(o(f[1][0]),g),n(f[0][0],g)]]}else{var N=f.concat();for(v=0;vD&&(D=s(N[v][y]),S=v),v++;if(D===0)throw Error("Cannot calculate inverse, determinant is zero");v=S,v!==y&&(A=N[y],N[y]=N[v],N[v]=A,A=x[y],x[y]=x[v],x[v]=A);var E=N[y],C=x[y];for(v=0;v{var{typed:r,matrix:t,inv:n,deepEqual:a,equal:i,dotDivide:o,dot:l,ctranspose:u,divideScalar:s,multiply:c,add:f,Complex:m}=e;return r(ug,{"Array | Matrix":function(g){var N=_e(g)?g.size():$e(g);switch(N.length){case 1:return b(g)?u(g):N[0]===1?n(g):o(u(g),l(g,g));case 2:{if(b(g))return u(g);var x=N[0],y=N[1];if(x===y)try{return n(g)}catch(D){if(!(D instanceof Error&&D.message.match(/Cannot calculate inverse, determinant is zero/)))throw D}return _e(g)?t(p(g.valueOf(),x,y),g.storage()):p(g,x,y)}default:throw new RangeError("Matrix must be two dimensional (size: "+Ve(N)+")")}},any:function(g){return i(g,0)?Fe(g):s(1,g)}});function p(A,g,N){var{C:x,F:y}=h(A,g,N),D=c(n(c(u(x),x)),u(x)),S=c(u(y),n(c(y,u(y))));return c(S,D)}function v(A,g,N){for(var x=Fe(A),y=0,D=0;DS.filter((C,_)=>_!w(l(x[E],x[E])));return{C:y,F:D}}function w(A){return i(f(A,m(1,1)),f(0,m(1,1)))}function b(A){return a(f(A,m(1,1)),f(c(A,0),m(1,1)))}});function HR(e){var{addScalar:r,subtract:t,flatten:n,multiply:a,multiplyScalar:i,divideScalar:o,sqrt:l,abs:u,bignumber:s,diag:c,size:f,reshape:m,inv:p,qr:v,usolve:h,usolveAll:w,equal:b,complex:A,larger:g,smaller:N,matrixFromColumns:x,dot:y}=e;function D(U,z,Q,se){var re=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,q=S(U,z,Q,se,re);E(U,z,Q,se,re,q);var{values:Z,C:j}=C(U,z,Q,se,re);if(re){var Y=_(U,z,j,q,Z,Q,se);return{values:Z,eigenvectors:Y}}return{values:Z}}function S(U,z,Q,se,re){var q=se==="BigNumber",Z=se==="Complex",j=q?s(0):0,Y=q?s(1):Z?A(1):1,ee=q?s(1):1,te=q?s(10):2,oe=i(te,te),ve;re&&(ve=Array(z).fill(Y));for(var L=!1;!L;){L=!0;for(var H=0;H1&&(L=c(Array(te-1).fill(j)))),te-=1,Y.pop();for(var Ne=0;Ne2&&(L=c(Array(te-2).fill(j)))),te-=2,Y.pop(),Y.pop();for(var K=0;K+t(u(ce),u(fe))),H>100){var G=Error("The eigenvalues failed to converge. Only found these eigenvalues: "+ee.join(", "));throw G.values=ee,G.vectors=[],G}var ae=re?a(ve,$(oe,z)):void 0;return{values:ee,C:ae}}function _(U,z,Q,se,re,q,Z){var j=p(Q),Y=a(j,U,Q),ee=Z==="BigNumber",te=Z==="Complex",oe=ee?s(0):te?A(0):0,ve=ee?s(1):te?A(1):1,L=[],H=[];for(var ne of re){var ie=M(L,ne,b);ie===-1?(L.push(ne),H.push(1)):H[ie]+=1}for(var de=[],me=L.length,be=Array(z).fill(oe),Ne=c(Array(z).fill(ve)),V=function(){var ae=L[K],ce=t(Y,a(ae,Ne)),fe=w(ce,be);for(fe.shift();fe.lengtha(ye,Ae)),de.push(...fe.map(Ae=>({value:ae,vector:n(Ae)})))},K=0;K=5)return null;for(j=0;;){var Y=h(U,Z);if(N(W(O(Z,[Y])),se))break;if(++j>=10)return null;Z=X(Y)}return Z}function k(U,z,Q){var se=Q==="BigNumber",re=Q==="Complex",q=Array(U).fill(0).map(Z=>2*Math.random()-1);return se&&(q=q.map(Z=>s(Z))),re&&(q=q.map(Z=>A(Z))),q=O(q,z),X(q,Q)}function O(U,z){var Q=f(U);for(var se of z)se=m(se,Q),U=t(U,a(o(y(se,U),y(se,se)),se));return U}function W(U){return u(l(y(U,U)))}function X(U,z){var Q=z==="BigNumber",se=z==="Complex",re=Q?s(1):se?A(1):1;return a(o(re,W(U)),U)}return D}function ZR(e){var{config:r,addScalar:t,subtract:n,abs:a,atan:i,cos:o,sin:l,multiplyScalar:u,inv:s,bignumber:c,multiply:f,add:m}=e;function p(E,C){var _=arguments.length>2&&arguments[2]!==void 0?arguments[2]:r.relTol,F=arguments.length>3?arguments[3]:void 0,I=arguments.length>4?arguments[4]:void 0;if(F==="number")return v(E,_,I);if(F==="BigNumber")return h(E,_,I);throw TypeError("Unsupported data type: "+F)}function v(E,C,_){var F=E.length,I=Math.abs(C/F),R,$;if(_){$=new Array(F);for(var M=0;M=Math.abs(I);){var k=T[0][0],O=T[0][1];R=w(E[k][k],E[O][O],E[k][O]),E=x(E,R,k,O),_&&($=A($,R,k,O)),T=y(E)}for(var W=Array(F).fill(0),X=0;X=a(I);){var k=T[0][0],O=T[0][1];R=b(E[k][k],E[O][O],E[k][O]),E=N(E,R,k,O),_&&($=g($,R,k,O)),T=D(E)}for(var W=Array(F).fill(0),X=0;X({value:I[z],vector:U}));return{values:I,eigenvectors:X}}return p}var GR="eigs",WR=["config","typed","matrix","addScalar","equal","subtract","abs","atan","cos","sin","multiplyScalar","divideScalar","inv","bignumber","multiply","add","larger","column","flatten","number","complex","sqrt","diag","size","reshape","qr","usolve","usolveAll","im","re","smaller","matrixFromColumns","dot"],jR=P(GR,WR,e=>{var{config:r,typed:t,matrix:n,addScalar:a,subtract:i,equal:o,abs:l,atan:u,cos:s,sin:c,multiplyScalar:f,divideScalar:m,inv:p,bignumber:v,multiply:h,add:w,larger:b,column:A,flatten:g,number:N,complex:x,sqrt:y,diag:D,size:S,reshape:E,qr:C,usolve:_,usolveAll:F,im:I,re:R,smaller:$,matrixFromColumns:M,dot:T}=e,k=ZR({config:r,addScalar:a,subtract:i,abs:l,atan:u,cos:s,sin:c,multiplyScalar:f,inv:p,bignumber:v,multiply:h,add:w}),O=HR({addScalar:a,subtract:i,multiply:h,multiplyScalar:f,flatten:g,divideScalar:m,sqrt:y,abs:l,bignumber:v,diag:D,size:S,reshape:E,qr:C,inv:p,usolve:_,usolveAll:F,equal:o,complex:x,larger:b,smaller:$,matrixFromColumns:M,dot:T});return t("eigs",{Array:function(q){return W(n(q))},"Array, number|BigNumber":function(q,Z){return W(n(q),{precision:Z})},"Array, Object"(re,q){return W(n(re),q)},Matrix:function(q){return W(q,{matricize:!0})},"Matrix, number|BigNumber":function(q,Z){return W(q,{precision:Z,matricize:!0})},"Matrix, Object":function(q,Z){var j={matricize:!0};return Br(j,Z),W(q,j)}});function W(re){var q,Z=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},j="eigenvectors"in Z?Z.eigenvectors:!0,Y=(q=Z.precision)!==null&&q!==void 0?q:r.relTol,ee=X(re,Y,j);return Z.matricize&&(ee.values=n(ee.values),j&&(ee.eigenvectors=ee.eigenvectors.map(te=>{var{value:oe,vector:ve}=te;return{value:oe,vector:n(ve)}}))),j&&Object.defineProperty(ee,"vectors",{enumerable:!1,get:()=>{throw new Error("eigs(M).vectors replaced with eigs(M).eigenvectors")}}),ee}function X(re,q,Z){var j=re.toArray(),Y=re.size();if(Y.length!==2||Y[0]!==Y[1])throw new RangeError("Matrix must be square (size: ".concat(Ve(Y),")"));var ee=Y[0];if(z(j,ee,q)&&(Q(j,ee),U(j,ee,q))){var te=se(re,j,ee);return k(j,ee,q,te,Z)}var oe=se(re,j,ee);return O(j,ee,q,oe,Z)}function U(re,q,Z){for(var j=0;j{var{typed:r,abs:t,add:n,identity:a,inv:i,multiply:o}=e;return r(lg,{Matrix:function(f){var m=f.size();if(m.length!==2||m[0]!==m[1])throw new RangeError("Matrix must be square (size: "+Ve(m)+")");for(var p=m[0],v=1e-15,h=l(f),w=u(h,v),b=w.q,A=w.j,g=o(f,Math.pow(2,-A)),N=a(p),x=a(p),y=1,D=g,S=-1,E=1;E<=b;E++)E>1&&(D=o(D,g),S=-S),y=y*(b-E+1)/((2*b-E+1)*E),N=n(N,o(y,D)),x=n(x,o(y*S,D));for(var C=o(i(x),N),_=0;_{var{typed:r,abs:t,add:n,multiply:a,map:i,sqrt:o,subtract:l,inv:u,size:s,max:c,identity:f}=e,m=1e3,p=1e-6;function v(h){var w,b=0,A=h,g=f(s(h));do{var N=A;if(A=a(.5,n(N,u(g))),g=a(.5,n(g,u(N))),w=c(t(l(A,N))),w>p&&++b>m)throw new Error("computing square root of matrix: iterative method could not converge")}while(w>p);return A}return r(cg,{"Array | Matrix":function(w){var b=_e(w)?w.size():$e(w);switch(b.length){case 1:if(b[0]===1)return i(w,o);throw new RangeError("Matrix must be square (size: "+Ve(b)+")");case 2:{var A=b[0],g=b[1];if(A===g)return v(w);throw new RangeError("Matrix must be square (size: "+Ve(b)+")")}default:throw new RangeError("Matrix must be at most two dimensional (size: "+Ve(b)+")")}}})}),fg="sylvester",QR=["typed","schur","matrixFromColumns","matrix","multiply","range","concat","transpose","index","subset","add","subtract","identity","lusolve","abs"],ez=P(fg,QR,e=>{var{typed:r,schur:t,matrixFromColumns:n,matrix:a,multiply:i,range:o,concat:l,transpose:u,index:s,subset:c,add:f,subtract:m,identity:p,lusolve:v,abs:h}=e;return r(fg,{"Matrix, Matrix, Matrix":w,"Array, Matrix, Matrix":function(A,g,N){return w(a(A),g,N)},"Array, Array, Matrix":function(A,g,N){return w(a(A),a(g),N)},"Array, Matrix, Array":function(A,g,N){return w(a(A),g,a(N))},"Matrix, Array, Matrix":function(A,g,N){return w(A,a(g),N)},"Matrix, Array, Array":function(A,g,N){return w(A,a(g),a(N))},"Matrix, Matrix, Array":function(A,g,N){return w(A,g,a(N))},"Array, Array, Array":function(A,g,N){return w(a(A),a(g),a(N)).toArray()}});function w(b,A,g){for(var N=A.size()[0],x=b.size()[0],y=t(b),D=y.T,S=y.U,E=t(i(-1,A)),C=E.T,_=E.U,F=i(i(u(S),g),_),I=o(0,x),R=[],$=(te,oe)=>l(te,oe,1),M=(te,oe)=>l(te,oe,0),T=0;T1e-5){for(var k=M(c(F,s(I,T)),c(F,s(I,T+1))),O=0;O{var{typed:r,matrix:t,identity:n,multiply:a,qr:i,norm:o,subtract:l}=e;return r(mg,{Array:function(c){var f=u(t(c));return{U:f.U.valueOf(),T:f.T.valueOf()}},Matrix:function(c){return u(c)}});function u(s){var c=s.size()[0],f=s,m=n(c),p=0,v;do{v=f;var h=i(f),w=h.Q,b=h.R;if(f=a(b,w),m=a(m,w),p++>100)break}while(o(l(f,v))>1e-4);return{U:m,T:f}}}),dg="lyap",nz=["typed","matrix","sylvester","multiply","transpose"],az=P(dg,nz,e=>{var{typed:r,matrix:t,sylvester:n,multiply:a,transpose:i}=e;return r(dg,{"Matrix, Matrix":function(l,u){return n(l,i(l),a(-1,u))},"Array, Matrix":function(l,u){return n(t(l),i(t(l)),a(-1,u))},"Matrix, Array":function(l,u){return n(l,i(t(l)),t(a(-1,u)))},"Array, Array":function(l,u){return n(t(l),i(t(l)),t(a(-1,u))).toArray()}})}),iz="divide",oz=["typed","matrix","multiply","equalScalar","divideScalar","inv"],sz=P(iz,oz,e=>{var{typed:r,matrix:t,multiply:n,equalScalar:a,divideScalar:i,inv:o}=e,l=Tr({typed:r,equalScalar:a}),u=wt({typed:r});return r("divide",Im({"Array | Matrix, Array | Matrix":function(c,f){return n(c,o(f))},"DenseMatrix, any":function(c,f){return u(c,f,i,!1)},"SparseMatrix, any":function(c,f){return l(c,f,i,!1)},"Array, any":function(c,f){return u(t(c),f,i,!1).valueOf()},"any, Array | Matrix":function(c,f){return n(c,o(f))}},i.signatures))}),pg="distance",uz=["typed","addScalar","subtractScalar","divideScalar","multiplyScalar","deepEqual","sqrt","abs"],lz=P(pg,uz,e=>{var{typed:r,addScalar:t,subtractScalar:n,multiplyScalar:a,divideScalar:i,deepEqual:o,sqrt:l,abs:u}=e;return r(pg,{"Array, Array, Array":function(x,y,D){if(x.length===2&&y.length===2&&D.length===2){if(!c(x))throw new TypeError("Array with 2 numbers or BigNumbers expected for first argument");if(!c(y))throw new TypeError("Array with 2 numbers or BigNumbers expected for second argument");if(!c(D))throw new TypeError("Array with 2 numbers or BigNumbers expected for third argument");if(o(y,D))throw new TypeError("LinePoint1 should not be same with LinePoint2");var S=n(D[1],y[1]),E=n(y[0],D[0]),C=n(a(D[0],y[1]),a(y[0],D[1]));return w(x[0],x[1],S,E,C)}else throw new TypeError("Invalid Arguments: Try again")},"Object, Object, Object":function(x,y,D){if(Object.keys(x).length===2&&Object.keys(y).length===2&&Object.keys(D).length===2){if(!c(x))throw new TypeError("Values of pointX and pointY should be numbers or BigNumbers");if(!c(y))throw new TypeError("Values of lineOnePtX and lineOnePtY should be numbers or BigNumbers");if(!c(D))throw new TypeError("Values of lineTwoPtX and lineTwoPtY should be numbers or BigNumbers");if(o(v(y),v(D)))throw new TypeError("LinePoint1 should not be same with LinePoint2");if("pointX"in x&&"pointY"in x&&"lineOnePtX"in y&&"lineOnePtY"in y&&"lineTwoPtX"in D&&"lineTwoPtY"in D){var S=n(D.lineTwoPtY,y.lineOnePtY),E=n(y.lineOnePtX,D.lineTwoPtX),C=n(a(D.lineTwoPtX,y.lineOnePtY),a(y.lineOnePtX,D.lineTwoPtY));return w(x.pointX,x.pointY,S,E,C)}else throw new TypeError("Key names do not match")}else throw new TypeError("Invalid Arguments: Try again")},"Array, Array":function(x,y){if(x.length===2&&y.length===3){if(!c(x))throw new TypeError("Array with 2 numbers or BigNumbers expected for first argument");if(!f(y))throw new TypeError("Array with 3 numbers or BigNumbers expected for second argument");return w(x[0],x[1],y[0],y[1],y[2])}else if(x.length===3&&y.length===6){if(!f(x))throw new TypeError("Array with 3 numbers or BigNumbers expected for first argument");if(!p(y))throw new TypeError("Array with 6 numbers or BigNumbers expected for second argument");return b(x[0],x[1],x[2],y[0],y[1],y[2],y[3],y[4],y[5])}else if(x.length===y.length&&x.length>0){if(!m(x))throw new TypeError("All values of an array should be numbers or BigNumbers");if(!m(y))throw new TypeError("All values of an array should be numbers or BigNumbers");return A(x,y)}else throw new TypeError("Invalid Arguments: Try again")},"Object, Object":function(x,y){if(Object.keys(x).length===2&&Object.keys(y).length===3){if(!c(x))throw new TypeError("Values of pointX and pointY should be numbers or BigNumbers");if(!f(y))throw new TypeError("Values of xCoeffLine, yCoeffLine and constant should be numbers or BigNumbers");if("pointX"in x&&"pointY"in x&&"xCoeffLine"in y&&"yCoeffLine"in y&&"constant"in y)return w(x.pointX,x.pointY,y.xCoeffLine,y.yCoeffLine,y.constant);throw new TypeError("Key names do not match")}else if(Object.keys(x).length===3&&Object.keys(y).length===6){if(!f(x))throw new TypeError("Values of pointX, pointY and pointZ should be numbers or BigNumbers");if(!p(y))throw new TypeError("Values of x0, y0, z0, a, b and c should be numbers or BigNumbers");if("pointX"in x&&"pointY"in x&&"x0"in y&&"y0"in y&&"z0"in y&&"a"in y&&"b"in y&&"c"in y)return b(x.pointX,x.pointY,x.pointZ,y.x0,y.y0,y.z0,y.a,y.b,y.c);throw new TypeError("Key names do not match")}else if(Object.keys(x).length===2&&Object.keys(y).length===2){if(!c(x))throw new TypeError("Values of pointOneX and pointOneY should be numbers or BigNumbers");if(!c(y))throw new TypeError("Values of pointTwoX and pointTwoY should be numbers or BigNumbers");if("pointOneX"in x&&"pointOneY"in x&&"pointTwoX"in y&&"pointTwoY"in y)return A([x.pointOneX,x.pointOneY],[y.pointTwoX,y.pointTwoY]);throw new TypeError("Key names do not match")}else if(Object.keys(x).length===3&&Object.keys(y).length===3){if(!f(x))throw new TypeError("Values of pointOneX, pointOneY and pointOneZ should be numbers or BigNumbers");if(!f(y))throw new TypeError("Values of pointTwoX, pointTwoY and pointTwoZ should be numbers or BigNumbers");if("pointOneX"in x&&"pointOneY"in x&&"pointOneZ"in x&&"pointTwoX"in y&&"pointTwoY"in y&&"pointTwoZ"in y)return A([x.pointOneX,x.pointOneY,x.pointOneZ],[y.pointTwoX,y.pointTwoY,y.pointTwoZ]);throw new TypeError("Key names do not match")}else throw new TypeError("Invalid Arguments: Try again")},Array:function(x){if(!h(x))throw new TypeError("Incorrect array format entered for pairwise distance calculation");return g(x)}});function s(N){return typeof N=="number"||Ie(N)}function c(N){return N.constructor!==Array&&(N=v(N)),s(N[0])&&s(N[1])}function f(N){return N.constructor!==Array&&(N=v(N)),s(N[0])&&s(N[1])&&s(N[2])}function m(N){return Array.isArray(N)||(N=v(N)),N.every(s)}function p(N){return N.constructor!==Array&&(N=v(N)),s(N[0])&&s(N[1])&&s(N[2])&&s(N[3])&&s(N[4])&&s(N[5])}function v(N){for(var x=Object.keys(N),y=[],D=0;Dx.length!==2||!s(x[0])||!s(x[1])))return!1}else if(N[0].length===3&&s(N[0][0])&&s(N[0][1])&&s(N[0][2])){if(N.some(x=>x.length!==3||!s(x[0])||!s(x[1])||!s(x[2])))return!1}else return!1;return!0}function w(N,x,y,D,S){var E=u(t(t(a(y,N),a(D,x)),S)),C=l(t(a(y,y),a(D,D)));return i(E,C)}function b(N,x,y,D,S,E,C,_,F){var I=[n(a(n(S,x),F),a(n(E,y),_)),n(a(n(E,y),C),a(n(D,N),F)),n(a(n(D,N),_),a(n(S,x),C))];I=l(t(t(a(I[0],I[0]),a(I[1],I[1])),a(I[2],I[2])));var R=l(t(t(a(C,C),a(_,_)),a(F,F)));return i(I,R)}function A(N,x){for(var y=N.length,D=0,S=0,E=0;E{var{typed:r,config:t,abs:n,add:a,addScalar:i,matrix:o,multiply:l,multiplyScalar:u,divideScalar:s,subtract:c,smaller:f,equalScalar:m,flatten:p,isZero:v,isNumeric:h}=e;return r("intersect",{"Array, Array, Array":w,"Array, Array, Array, Array":b,"Matrix, Matrix, Matrix":function(_,F,I){var R=w(_.valueOf(),F.valueOf(),I.valueOf());return R===null?null:o(R)},"Matrix, Matrix, Matrix, Matrix":function(_,F,I,R){var $=b(_.valueOf(),F.valueOf(),I.valueOf(),R.valueOf());return $===null?null:o($)}});function w(C,_,F){if(C=A(C),_=A(_),F=A(F),!N(C))throw new TypeError("Array with 3 numbers or BigNumbers expected for first argument");if(!N(_))throw new TypeError("Array with 3 numbers or BigNumbers expected for second argument");if(!x(F))throw new TypeError("Array with 4 numbers expected as third argument");return E(C[0],C[1],C[2],_[0],_[1],_[2],F[0],F[1],F[2],F[3])}function b(C,_,F,I){if(C=A(C),_=A(_),F=A(F),I=A(I),C.length===2){if(!g(C))throw new TypeError("Array with 2 numbers or BigNumbers expected for first argument");if(!g(_))throw new TypeError("Array with 2 numbers or BigNumbers expected for second argument");if(!g(F))throw new TypeError("Array with 2 numbers or BigNumbers expected for third argument");if(!g(I))throw new TypeError("Array with 2 numbers or BigNumbers expected for fourth argument");return y(C,_,F,I)}else if(C.length===3){if(!N(C))throw new TypeError("Array with 3 numbers or BigNumbers expected for first argument");if(!N(_))throw new TypeError("Array with 3 numbers or BigNumbers expected for second argument");if(!N(F))throw new TypeError("Array with 3 numbers or BigNumbers expected for third argument");if(!N(I))throw new TypeError("Array with 3 numbers or BigNumbers expected for fourth argument");return S(C[0],C[1],C[2],_[0],_[1],_[2],F[0],F[1],F[2],I[0],I[1],I[2])}else throw new TypeError("Arrays with two or thee dimensional points expected")}function A(C){return C.length===1?C[0]:C.length>1&&Array.isArray(C[0])&&C.every(_=>Array.isArray(_)&&_.length===1)?p(C):C}function g(C){return C.length===2&&h(C[0])&&h(C[1])}function N(C){return C.length===3&&h(C[0])&&h(C[1])&&h(C[2])}function x(C){return C.length===4&&h(C[0])&&h(C[1])&&h(C[2])&&h(C[3])}function y(C,_,F,I){var R=C,$=F,M=c(R,_),T=c($,I),k=c(u(M[0],T[1]),u(T[0],M[1]));if(v(k)||f(n(k),t.relTol))return null;var O=u(T[0],R[1]),W=u(T[1],R[0]),X=u(T[0],$[1]),U=u(T[1],$[0]),z=s(i(c(c(O,W),X),U),k);return a(l(M,z),R)}function D(C,_,F,I,R,$,M,T,k,O,W,X){var U=u(c(C,_),c(F,I)),z=u(c(R,$),c(M,T)),Q=u(c(k,O),c(W,X));return i(i(U,z),Q)}function S(C,_,F,I,R,$,M,T,k,O,W,X){var U=D(C,M,O,M,_,T,W,T,F,k,X,k),z=D(O,M,I,C,W,T,R,_,X,k,$,F),Q=D(C,M,I,C,_,T,R,_,F,k,$,F),se=D(O,M,O,M,W,T,W,T,X,k,X,k),re=D(I,C,I,C,R,_,R,_,$,F,$,F),q=c(u(U,z),u(Q,se)),Z=c(u(re,se),u(z,z));if(v(Z))return null;var j=s(q,Z),Y=s(i(U,u(j,z)),se),ee=i(C,u(j,c(I,C))),te=i(_,u(j,c(R,_))),oe=i(F,u(j,c($,F))),ve=i(M,u(Y,c(O,M))),L=i(T,u(Y,c(W,T))),H=i(k,u(Y,c(X,k)));return m(ee,ve)&&m(te,L)&&m(oe,H)?[ee,te,oe]:null}function E(C,_,F,I,R,$,M,T,k,O){var W=u(C,M),X=u(I,M),U=u(_,T),z=u(R,T),Q=u(F,k),se=u($,k),re=c(c(c(O,W),U),Q),q=c(c(c(i(i(X,z),se),W),U),Q),Z=s(re,q),j=i(C,u(Z,c(I,C))),Y=i(_,u(Z,c(R,_))),ee=i(F,u(Z,c($,F)));return[j,Y,ee]}}),vg="sum",dz=["typed","config","add","numeric"],hg=P(vg,dz,e=>{var{typed:r,config:t,add:n,numeric:a}=e;return r(vg,{"Array | Matrix":i,"Array | Matrix, number | BigNumber":o,"...":function(u){if(Aa(u))throw new TypeError("Scalar values expected in function sum");return i(u)}});function i(l){var u;return Jt(l,function(s){try{u=u===void 0?s:n(u,s)}catch(c){throw qr(c,"sum",s)}}),u===void 0&&(u=a(0,t.number)),typeof u=="string"&&(u=a(u,mn(u,t))),u}function o(l,u){try{var s=go(l,u,n);return s}catch(c){throw qr(c,"sum")}}}),Ko="cumsum",pz=["typed","add","unaryPlus"],gg=P(Ko,pz,e=>{var{typed:r,add:t,unaryPlus:n}=e;return r(Ko,{Array:a,Matrix:function(s){return s.create(a(s.valueOf(),s.datatype()))},"Array, number | BigNumber":o,"Matrix, number | BigNumber":function(s,c){return s.create(o(s.valueOf(),c),s.datatype())},"...":function(s){if(Aa(s))throw new TypeError("All values expected to be scalar in function cumsum");return a(s)}});function a(u){try{return i(u)}catch(s){throw qr(s,Ko)}}function i(u){if(u.length===0)return[];for(var s=[n(u[0])],c=1;c=c.length)throw new ft(s,c.length);try{return l(u,s)}catch(f){throw qr(f,Ko)}}function l(u,s){var c,f,m;if(s<=0){var p=u[0][0];if(Array.isArray(p)){for(m=Td(u),f=[],c=0;c{var{typed:r,add:t,divide:n}=e;return r(yg,{"Array | Matrix":i,"Array | Matrix, number | BigNumber":a,"...":function(l){if(Aa(l))throw new TypeError("Scalar values expected in function mean");return i(l)}});function a(o,l){try{var u=go(o,l,t),s=Array.isArray(o)?$e(o):o.size();return n(u,s[l])}catch(c){throw qr(c,"mean")}}function i(o){var l,u=0;if(Jt(o,function(s){try{l=l===void 0?s:t(l,s),u++}catch(c){throw qr(c,"mean",s)}}),u===0)throw new Error("Cannot calculate the mean of an empty array");return n(l,u)}}),wg="median",hz=["typed","add","divide","compare","partitionSelect"],gz=P(wg,hz,e=>{var{typed:r,add:t,divide:n,compare:a,partitionSelect:i}=e;function o(s){try{s=We(s.valueOf());var c=s.length;if(c===0)throw new Error("Cannot calculate median of an empty array");if(c%2===0){for(var f=c/2-1,m=i(s,f+1),p=s[f],v=0;v0&&(p=s[v]);return u(p,m)}else{var h=i(s,(c-1)/2);return l(h)}}catch(w){throw qr(w,"median")}}var l=r({"number | BigNumber | Complex | Unit":function(c){return c}}),u=r({"number | BigNumber | Complex | Unit, number | BigNumber | Complex | Unit":function(c,f){return n(t(c,f),2)}});return r(wg,{"Array | Matrix":o,"Array | Matrix, number | BigNumber":function(c,f){throw new Error("median(A, dim) is not yet supported")},"...":function(c){if(Aa(c))throw new TypeError("Scalar values expected in function median");return o(c)}})}),xg="mad",yz=["typed","abs","map","median","subtract"],bz=P(xg,yz,e=>{var{typed:r,abs:t,map:n,median:a,subtract:i}=e;return r(xg,{"Array | Matrix":o,"...":function(u){return o(u)}});function o(l){if(l=We(l.valueOf()),l.length===0)throw new Error("Cannot calculate median absolute deviation (mad) of an empty array");try{var u=a(l);return a(n(l,function(s){return t(i(s,u))}))}catch(s){throw s instanceof TypeError&&s.message.includes("median")?new TypeError(s.message.replace("median","mad")):qr(s,"mad")}}}),rl="unbiased",Ng="variance",wz=["typed","add","subtract","multiply","divide","apply","isNaN"],Ag=P(Ng,wz,e=>{var{typed:r,add:t,subtract:n,multiply:a,divide:i,apply:o,isNaN:l}=e;return r(Ng,{"Array | Matrix":function(f){return u(f,rl)},"Array | Matrix, string":u,"Array | Matrix, number | BigNumber":function(f,m){return s(f,m,rl)},"Array | Matrix, number | BigNumber, string":s,"...":function(f){return u(f,rl)}});function u(c,f){var m,p=0;if(c.length===0)throw new SyntaxError("Function variance requires one or more parameters (0 provided)");if(Jt(c,function(w){try{m=m===void 0?w:t(m,w),p++}catch(b){throw qr(b,"variance",w)}}),p===0)throw new Error("Cannot calculate variance of an empty array");var v=i(m,p);if(m=void 0,Jt(c,function(w){var b=n(w,v);m=m===void 0?a(b,b):t(m,a(b,b))}),l(m))return m;switch(f){case"uncorrected":return i(m,p);case"biased":return i(m,p+1);case"unbiased":{var h=Ie(m)?m.mul(0):0;return p===1?h:i(m,p-1)}default:throw new Error('Unknown normalization "'+f+'". Choose "unbiased" (default), "uncorrected", or "biased".')}}function s(c,f,m){try{if(c.length===0)throw new SyntaxError("Function variance requires one or more parameters (0 provided)");return o(c,f,p=>u(p,m))}catch(p){throw qr(p,"variance")}}}),Eg="quantileSeq",xz=["typed","?bignumber","add","subtract","divide","multiply","partitionSelect","compare","isInteger","smaller","smallerEq","larger"],Dg=P(Eg,xz,e=>{var{typed:r,bignumber:t,add:n,subtract:a,divide:i,multiply:o,partitionSelect:l,compare:u,isInteger:s,smaller:c,smallerEq:f,larger:m}=e,p=Ru({typed:r,isInteger:s});return r(Eg,{"Array | Matrix, number | BigNumber":(A,g)=>h(A,g,!1),"Array | Matrix, number | BigNumber, number":(A,g,N)=>v(A,g,!1,N,h),"Array | Matrix, number | BigNumber, boolean":h,"Array | Matrix, number | BigNumber, boolean, number":(A,g,N,x)=>v(A,g,N,x,h),"Array | Matrix, Array | Matrix":(A,g)=>w(A,g,!1),"Array | Matrix, Array | Matrix, number":(A,g,N)=>v(A,g,!1,N,w),"Array | Matrix, Array | Matrix, boolean":w,"Array | Matrix, Array | Matrix, boolean, number":(A,g,N,x)=>v(A,g,N,x,w)});function v(A,g,N,x,y){return p(A,x,D=>y(D,g,N))}function h(A,g,N){var x,y=A.valueOf();if(c(g,0))throw new Error("N/prob must be non-negative");if(f(g,1))return Re(g)?b(y,g,N):t(b(y,g,N));if(m(g,1)){if(!s(g))throw new Error("N must be a positive integer");if(m(g,4294967295))throw new Error("N must be less than or equal to 2^32-1, as that is the maximum length of an Array");var D=n(g,1);x=[];for(var S=0;c(S,g);S++){var E=i(S+1,D);x.push(b(y,E,N))}return Re(g)?x:t(x)}}function w(A,g,N){for(var x=A.valueOf(),y=g.valueOf(),D=[],S=0;S0&&(C=x[F])}return n(o(C,a(1,E)),o(_,E))}}),Sg="std",Nz=["typed","map","sqrt","variance"],Cg=P(Sg,Nz,e=>{var{typed:r,map:t,sqrt:n,variance:a}=e;return r(Sg,{"Array | Matrix":i,"Array | Matrix, string":i,"Array | Matrix, number | BigNumber":i,"Array | Matrix, number | BigNumber, string":i,"...":function(l){return i(l)}});function i(o,l){if(o.length===0)throw new SyntaxError("Function std requires one or more parameters (0 provided)");try{var u=a.apply(null,arguments);return Xr(u)?t(u,n):n(u)}catch(s){throw s instanceof TypeError&&s.message.includes(" variance")?new TypeError(s.message.replace(" variance"," std")):s}}}),Mg="corr",Az=["typed","matrix","mean","sqrt","sum","add","subtract","multiply","pow","divide"],Ez=P(Mg,Az,e=>{var{typed:r,matrix:t,sqrt:n,sum:a,add:i,subtract:o,multiply:l,pow:u,divide:s}=e;return r(Mg,{"Array, Array":function(p,v){return c(p,v)},"Matrix, Matrix":function(p,v){var h=c(p.toArray(),v.toArray());return Array.isArray(h)?t(h):h}});function c(m,p){var v=[];if(Array.isArray(m[0])&&Array.isArray(p[0])){if(m.length!==p.length)throw new SyntaxError("Dimension mismatch. Array A and B must have the same length.");for(var h=0;hi(y,l(D,p[S])),0),A=a(m.map(y=>u(y,2))),g=a(p.map(y=>u(y,2))),N=o(l(v,b),l(h,w)),x=n(l(o(l(v,A),u(h,2)),o(l(v,g),u(w,2))));return s(N,x)}}),_g="combinations",Dz=["typed"],Sz=P(_g,Dz,e=>{var{typed:r}=e;return r(_g,{"number, number":tp,"BigNumber, BigNumber":function(n,a){var i=n.constructor,o,l,u=n.minus(a),s=new i(1);if(!Tg(n)||!Tg(a))throw new TypeError("Positive integer value expected in function combinations");if(a.gt(n))throw new TypeError("k must be less than n in function combinations");if(o=s,a.lt(u))for(l=s;l.lte(u);l=l.plus(s))o=o.times(a.plus(l)).dividedBy(l);else for(l=s;l.lte(a);l=l.plus(s))o=o.times(u.plus(l)).dividedBy(l);return o}})});function Tg(e){return e.isInteger()&&e.gte(0)}var Fg="combinationsWithRep",Cz=["typed"],Mz=P(Fg,Cz,e=>{var{typed:r}=e;return r(Fg,{"number, number":function(n,a){if(!Ce(n)||n<0)throw new TypeError("Positive integer value expected in function combinationsWithRep");if(!Ce(a)||a<0)throw new TypeError("Positive integer value expected in function combinationsWithRep");if(n<1)throw new TypeError("k must be less than or equal to n + k - 1");if(a{var{typed:r,config:t,multiplyScalar:n,pow:a,BigNumber:i,Complex:o}=e;function l(s){if(s.im===0)return bo(s.re);if(s.re<.5){var c=new o(1-s.re,-s.im),f=new o(Math.PI*s.re,Math.PI*s.im);return new o(Math.PI).div(f.sin()).div(l(c))}s=new o(s.re-1,s.im);for(var m=new o(Sa[0],0),p=1;p2;)m-=2,v+=m,p=p.times(v);return new i(p.toPrecision(i.precision))}}),$g="lgamma",Fz=["Complex","typed"],Bz=P($g,Fz,e=>{var{Complex:r,typed:t}=e,n=7,a=7,i=[-.029550653594771242,.00641025641025641,-.0019175269175269176,.0008417508417508417,-.0005952380952380953,.0007936507936507937,-.002777777777777778,.08333333333333333];return t($g,{number:wo,Complex:o,BigNumber:function(){throw new Error("mathjs doesn't yet provide an implementation of the algorithm lgamma for BigNumber")}});function o(s){var c=6.283185307179586,f=1.1447298858494002,m=.1;if(s.isNaN())return new r(NaN,NaN);if(s.im===0)return new r(wo(s.re),0);if(s.re>=n||Math.abs(s.im)>=a)return l(s);if(s.re<=m){var p=SS(c,s.im)*Math.floor(.5*s.re+.25),v=s.mul(Math.PI).sin().log(),h=o(new r(1-s.re,-s.im));return new r(f,p).sub(v).sub(h)}else return s.im>=0?u(s):u(s.conjugate()).conjugate()}function l(s){for(var c=s.sub(.5).mul(s.log()).sub(s).add(ip),f=new r(1,0).div(s),m=f.div(s),p=i[0],v=i[1],h=2*m.re,w=m.re*m.re+m.im*m.im,b=2;b<8;b++){var A=v;v=-w*p+i[b],p=h*p+A}var g=f.mul(m.mul(p).add(v));return c.add(g)}function u(s){var c=0,f=0,m=s;for(s=s.add(1);s.re<=n;){m=m.mul(s);var p=m.im<0?1:0;p!==0&&f===0&&c++,f=p,s=s.add(1)}return l(s).sub(m.log()).sub(new r(0,c*2*Math.PI*1))}}),Ig="factorial",Oz=["typed","gamma"],$z=P(Ig,Oz,e=>{var{typed:r,gamma:t}=e;return r(Ig,{number:function(a){if(a<0)throw new Error("Value must be non-negative");return t(a+1)},BigNumber:function(a){if(a.isNegative())throw new Error("Value must be non-negative");return t(a.plus(1))},"Array | Matrix":r.referToSelf(n=>a=>Le(a,n))})}),Rg="kldivergence",Iz=["typed","matrix","divide","sum","multiply","map","dotDivide","log","isNumeric"],Rz=P(Rg,Iz,e=>{var{typed:r,matrix:t,divide:n,sum:a,multiply:i,map:o,dotDivide:l,log:u,isNumeric:s}=e;return r(Rg,{"Array, Array":function(m,p){return c(t(m),t(p))},"Matrix, Array":function(m,p){return c(m,t(p))},"Array, Matrix":function(m,p){return c(t(m),p)},"Matrix, Matrix":function(m,p){return c(m,p)}});function c(f,m){var p=m.size().length,v=f.size().length;if(p>1)throw new Error("first object must be one dimensional");if(v>1)throw new Error("second object must be one dimensional");if(p!==v)throw new Error("Length of two vectors must be equal");var h=a(f);if(h===0)throw new Error("Sum of elements in first object must be non zero");var w=a(m);if(w===0)throw new Error("Sum of elements in second object must be non zero");var b=n(f,a(f)),A=n(m,a(m)),g=a(i(b,o(l(b,A),N=>u(N))));return s(g)?g:Number.NaN}}),zg="multinomial",zz=["typed","add","divide","multiply","factorial","isInteger","isPositive"],Pz=P(zg,zz,e=>{var{typed:r,add:t,divide:n,multiply:a,factorial:i,isInteger:o,isPositive:l}=e;return r(zg,{"Array | Matrix":function(s){var c=0,f=1;return Jt(s,function(m){if(!o(m)||!l(m))throw new TypeError("Positive integer value expected in function multinomial");c=t(c,m),f=a(f,i(m))}),n(i(c),f)}})}),Pg="permutations",kz=["typed","factorial"],qz=P(Pg,kz,e=>{var{typed:r,factorial:t}=e;return r(Pg,{"number | BigNumber":t,"number, number":function(a,i){if(!Ce(a)||a<0)throw new TypeError("Positive integer value expected in function permutations");if(!Ce(i)||i<0)throw new TypeError("Positive integer value expected in function permutations");if(i>a)throw new TypeError("second argument k must be less than or equal to first argument n");return Yt(a-i+1,a)},"BigNumber, BigNumber":function(a,i){var o,l;if(!kg(a)||!kg(i))throw new TypeError("Positive integer value expected in function permutations");if(i.gt(a))throw new TypeError("second argument k must be less than or equal to first argument n");var u=a.mul(0).add(1);for(o=u,l=a.minus(i).plus(1);l.lte(a);l=l.plus(1))o=o.times(l);return o}})});function kg(e){return e.isInteger()&&e.gte(0)}var tl={exports:{}};tl.exports,function(e){(function(r,t,n){function a(u){var s=this,c=l();s.next=function(){var f=2091639*s.s0+s.c*23283064365386963e-26;return s.s0=s.s1,s.s1=s.s2,s.s2=f-(s.c=f|0)},s.c=1,s.s0=c(" "),s.s1=c(" "),s.s2=c(" "),s.s0-=c(u),s.s0<0&&(s.s0+=1),s.s1-=c(u),s.s1<0&&(s.s1+=1),s.s2-=c(u),s.s2<0&&(s.s2+=1),c=null}function i(u,s){return s.c=u.c,s.s0=u.s0,s.s1=u.s1,s.s2=u.s2,s}function o(u,s){var c=new a(u),f=s&&s.state,m=c.next;return m.int32=function(){return c.next()*4294967296|0},m.double=function(){return m()+(m()*2097152|0)*11102230246251565e-32},m.quick=m,f&&(typeof f=="object"&&i(f,c),m.state=function(){return i(c,{})}),m}function l(){var u=4022871197,s=function(c){c=String(c);for(var f=0;f>>0,m-=u,m*=u,u=m>>>0,m-=u,u+=m*4294967296}return(u>>>0)*23283064365386963e-26};return s}t&&t.exports?t.exports=o:this.alea=o})(Rn,e)}(tl);var Lz=tl.exports,nl={exports:{}};nl.exports,function(e){(function(r,t,n){function a(l){var u=this,s="";u.x=0,u.y=0,u.z=0,u.w=0,u.next=function(){var f=u.x^u.x<<11;return u.x=u.y,u.y=u.z,u.z=u.w,u.w^=u.w>>>19^f^f>>>8},l===(l|0)?u.x=l:s+=l;for(var c=0;c>>0)/4294967296};return f.double=function(){do var m=s.next()>>>11,p=(s.next()>>>0)/4294967296,v=(m+p)/(1<<21);while(v===0);return v},f.int32=s.next,f.quick=f,c&&(typeof c=="object"&&i(c,s),f.state=function(){return i(s,{})}),f}t&&t.exports?t.exports=o:this.xor128=o})(Rn,e)}(nl);var Vz=nl.exports,al={exports:{}};al.exports,function(e){(function(r,t,n){function a(l){var u=this,s="";u.next=function(){var f=u.x^u.x>>>2;return u.x=u.y,u.y=u.z,u.z=u.w,u.w=u.v,(u.d=u.d+362437|0)+(u.v=u.v^u.v<<4^(f^f<<1))|0},u.x=0,u.y=0,u.z=0,u.w=0,u.v=0,l===(l|0)?u.x=l:s+=l;for(var c=0;c>>4),u.next()}function i(l,u){return u.x=l.x,u.y=l.y,u.z=l.z,u.w=l.w,u.v=l.v,u.d=l.d,u}function o(l,u){var s=new a(l),c=u&&u.state,f=function(){return(s.next()>>>0)/4294967296};return f.double=function(){do var m=s.next()>>>11,p=(s.next()>>>0)/4294967296,v=(m+p)/(1<<21);while(v===0);return v},f.int32=s.next,f.quick=f,c&&(typeof c=="object"&&i(c,s),f.state=function(){return i(s,{})}),f}t&&t.exports?t.exports=o:this.xorwow=o})(Rn,e)}(al);var Uz=al.exports,il={exports:{}};il.exports,function(e){(function(r,t,n){function a(l){var u=this;u.next=function(){var c=u.x,f=u.i,m,p;return m=c[f],m^=m>>>7,p=m^m<<24,m=c[f+1&7],p^=m^m>>>10,m=c[f+3&7],p^=m^m>>>3,m=c[f+4&7],p^=m^m<<7,m=c[f+7&7],m=m^m<<13,p^=m^m<<9,c[f]=p,u.i=f+1&7,p};function s(c,f){var m,p=[];if(f===(f|0))p[0]=f;else for(f=""+f,m=0;m0;--m)c.next()}s(u,l)}function i(l,u){return u.x=l.x.slice(),u.i=l.i,u}function o(l,u){l==null&&(l=+new Date);var s=new a(l),c=u&&u.state,f=function(){return(s.next()>>>0)/4294967296};return f.double=function(){do var m=s.next()>>>11,p=(s.next()>>>0)/4294967296,v=(m+p)/(1<<21);while(v===0);return v},f.int32=s.next,f.quick=f,c&&(c.x&&i(c,s),f.state=function(){return i(s,{})}),f}t&&t.exports?t.exports=o:this.xorshift7=o})(Rn,e)}(il);var Hz=il.exports,ol={exports:{}};ol.exports,function(e){(function(r,t,n){function a(l){var u=this;u.next=function(){var c=u.w,f=u.X,m=u.i,p,v;return u.w=c=c+1640531527|0,v=f[m+34&127],p=f[m=m+1&127],v^=v<<13,p^=p<<17,v^=v>>>15,p^=p>>>12,v=f[m]=v^p,u.i=m,v+(c^c>>>16)|0};function s(c,f){var m,p,v,h,w,b=[],A=128;for(f===(f|0)?(p=f,f=null):(f=f+"\0",p=0,A=Math.max(A,f.length)),v=0,h=-32;h>>15,p^=p<<4,p^=p>>>13,h>=0&&(w=w+1640531527|0,m=b[h&127]^=p+w,v=m==0?v+1:0);for(v>=128&&(b[(f&&f.length||0)&127]=-1),v=127,h=4*128;h>0;--h)p=b[v+34&127],m=b[v=v+1&127],p^=p<<13,m^=m<<17,p^=p>>>15,m^=m>>>12,b[v]=p^m;c.w=w,c.X=b,c.i=v}s(u,l)}function i(l,u){return u.i=l.i,u.w=l.w,u.X=l.X.slice(),u}function o(l,u){l==null&&(l=+new Date);var s=new a(l),c=u&&u.state,f=function(){return(s.next()>>>0)/4294967296};return f.double=function(){do var m=s.next()>>>11,p=(s.next()>>>0)/4294967296,v=(m+p)/(1<<21);while(v===0);return v},f.int32=s.next,f.quick=f,c&&(c.X&&i(c,s),f.state=function(){return i(s,{})}),f}t&&t.exports?t.exports=o:this.xor4096=o})(Rn,e)}(ol);var Zz=ol.exports,sl={exports:{}};sl.exports,function(e){(function(r,t,n){function a(l){var u=this,s="";u.next=function(){var f=u.b,m=u.c,p=u.d,v=u.a;return f=f<<25^f>>>7^m,m=m-p|0,p=p<<24^p>>>8^v,v=v-f|0,u.b=f=f<<20^f>>>12^m,u.c=m=m-p|0,u.d=p<<16^m>>>16^v,u.a=v-f|0},u.a=0,u.b=0,u.c=-1640531527,u.d=1367130551,l===Math.floor(l)?(u.a=l/4294967296|0,u.b=l|0):s+=l;for(var c=0;c>>0)/4294967296};return f.double=function(){do var m=s.next()>>>11,p=(s.next()>>>0)/4294967296,v=(m+p)/(1<<21);while(v===0);return v},f.int32=s.next,f.quick=f,c&&(typeof c=="object"&&i(c,s),f.state=function(){return i(s,{})}),f}t&&t.exports?t.exports=o:this.tychei=o})(Rn,e)}(sl);var Gz=sl.exports,qg={exports:{}};const Wz=LE(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})));(function(e){(function(r,t,n){var a=256,i=6,o=52,l="random",u=n.pow(a,i),s=n.pow(2,o),c=s*2,f=a-1,m;function p(N,x,y){var D=[];x=x==!0?{entropy:!0}:x||{};var S=b(w(x.entropy?[N,g(t)]:N??A(),3),D),E=new v(D),C=function(){for(var _=E.g(i),F=u,I=0;_=c;)_/=2,F/=2,I>>>=1;return(_+I)/F};return C.int32=function(){return E.g(4)|0},C.quick=function(){return E.g(4)/4294967296},C.double=C,b(g(E.S),t),(x.pass||y||function(_,F,I,R){return R&&(R.S&&h(R,E),_.state=function(){return h(E,{})}),I?(n[l]=_,F):_})(C,S,"global"in x?x.global:this==n,x.state)}function v(N){var x,y=N.length,D=this,S=0,E=D.i=D.j=0,C=D.S=[];for(y||(N=[y++]);S{var{typed:r,config:t,on:n}=e,a=Ba(t.randomSeed);return n&&n("config",function(o,l){o.randomSeed!==l.randomSeed&&(a=Ba(o.randomSeed))}),r(Vg,{"Array | Matrix":function(l){return i(l,{})},"Array | Matrix, Object":function(l,u){return i(l,u)},"Array | Matrix, number":function(l,u){return i(l,{number:u})},"Array | Matrix, Array | Matrix":function(l,u){return i(l,{weights:u})},"Array | Matrix, Array | Matrix, number":function(l,u,s){return i(l,{number:s,weights:u})},"Array | Matrix, number, Array | Matrix":function(l,u,s){return i(l,{number:u,weights:s})}});function i(o,l){var{number:u,weights:s,elementWise:c=!0}=l,f=typeof u>"u";f&&(u=1);var m=_e(o)?o.create:_e(s)?s.create:null;o=o.valueOf(),s&&(s=s.valueOf()),c===!0&&(o=We(o),s=We(s));var p=0;if(typeof s<"u"){if(s.length!==o.length)throw new Error("Weights must have the same length as possibles");for(var v=0,h=s.length;v"u")A=o[Math.floor(a()*w)];else for(var g=a()*p,N=0,x=o.length;N1)for(var n=0,a=e.shift();n{var{typed:r,config:t,on:n}=e,a=Ba(t.randomSeed);return n&&n("config",function(l,u){l.randomSeed!==u.randomSeed&&(a=Ba(l.randomSeed))}),r(Ug,{"":()=>o(0,1),number:l=>o(0,l),"number, number":(l,u)=>o(l,u),"Array | Matrix":l=>i(l,0,1),"Array | Matrix, number":(l,u)=>i(l,0,u),"Array | Matrix, number, number":(l,u,s)=>i(l,u,s)});function i(l,u,s){var c=ul(l.valueOf(),()=>o(u,s));return _e(l)?l.create(c,"number"):c}function o(l,u){return l+a()*(u-l)}}),Hg="randomInt",sP=["typed","config","?on"],uP=P(Hg,sP,e=>{var{typed:r,config:t,on:n}=e,a=Ba(t.randomSeed);return n&&n("config",function(l,u){l.randomSeed!==u.randomSeed&&(a=Ba(l.randomSeed))}),r(Hg,{"":()=>o(0,1),number:l=>o(0,l),"number, number":(l,u)=>o(l,u),"Array | Matrix":l=>i(l,0,1),"Array | Matrix, number":(l,u)=>i(l,0,u),"Array | Matrix, number, number":(l,u,s)=>i(l,u,s)});function i(l,u,s){var c=ul(l.valueOf(),()=>o(u,s));return _e(l)?l.create(c,"number"):c}function o(l,u){return Math.floor(l+a()*(u-l))}}),Zg="stirlingS2",lP=["typed","addScalar","subtractScalar","multiplyScalar","divideScalar","pow","factorial","combinations","isNegative","isInteger","number","?bignumber","larger"],cP=P(Zg,lP,e=>{var{typed:r,addScalar:t,subtractScalar:n,multiplyScalar:a,divideScalar:i,pow:o,factorial:l,combinations:u,isNegative:s,isInteger:c,number:f,bignumber:m,larger:p}=e,v=[],h=[];return r(Zg,{"number | BigNumber, number | BigNumber":function(b,A){if(!c(b)||s(b)||!c(A)||s(A))throw new TypeError("Non-negative integer value expected in function stirlingS2");if(p(A,b))throw new TypeError("k must be less than or equal to n in function stirlingS2");var g=!(Re(b)&&Re(A)),N=g?h:v,x=g?m:f,y=f(b),D=f(A);if(N[y]&&N[y].length>D)return N[y][D];for(var S=0;S<=y;++S)if(N[S]||(N[S]=[x(S===0?1:0)]),S!==0)for(var E=N[S],C=N[S-1],_=E.length;_<=S&&_<=D;++_)_===S?E[_]=1:E[_]=t(a(x(_),C[_]),C[_-1]);return N[y][D]}})}),Gg="bellNumbers",fP=["typed","addScalar","isNegative","isInteger","stirlingS2"],mP=P(Gg,fP,e=>{var{typed:r,addScalar:t,isNegative:n,isInteger:a,stirlingS2:i}=e;return r(Gg,{"number | BigNumber":function(l){if(!a(l)||n(l))throw new TypeError("Non-negative integer value expected in function bellNumbers");for(var u=0,s=0;s<=l;s++)u=t(u,i(l,s));return u}})}),Wg="catalan",dP=["typed","addScalar","divideScalar","multiplyScalar","combinations","isNegative","isInteger"],pP=P(Wg,dP,e=>{var{typed:r,addScalar:t,divideScalar:n,multiplyScalar:a,combinations:i,isNegative:o,isInteger:l}=e;return r(Wg,{"number | BigNumber":function(s){if(!l(s)||o(s))throw new TypeError("Non-negative integer value expected in function catalan");return n(i(a(s,2),s),t(s,1))}})}),jg="composition",vP=["typed","addScalar","combinations","isNegative","isPositive","isInteger","larger"],hP=P(jg,vP,e=>{var{typed:r,addScalar:t,combinations:n,isPositive:a,isNegative:i,isInteger:o,larger:l}=e;return r(jg,{"number | BigNumber, number | BigNumber":function(s,c){if(!o(s)||!a(s)||!o(c)||!a(c))throw new TypeError("Positive integer value expected in function composition");if(l(c,s))throw new TypeError("k must be less than or equal to n in function composition");return n(t(s,-1),t(c,-1))}})}),Kg="leafCount",gP=["parse","typed"],yP=P(Kg,gP,e=>{var{parse:r,typed:t}=e;function n(a){var i=0;return a.forEach(o=>{i+=n(o)}),i||1}return t(Kg,{Node:function(i){return n(i)}})});function Jg(e){return Ze(e)||pr(e)&&e.isUnary()&&Ze(e.args[0])}function Jo(e){return!!(Ze(e)||(Gt(e)||pr(e))&&e.args.every(Jo)||_t(e)&&Jo(e.content))}function Yg(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter(function(a){return Object.getOwnPropertyDescriptor(e,a).enumerable})),t.push.apply(t,n)}return t}function ll(e){for(var r=1;r{var{FunctionNode:r,OperatorNode:t,SymbolNode:n}=e,a=!0,i=!1,o="defaultF",l={add:{trivial:a,total:a,commutative:a,associative:a},unaryPlus:{trivial:a,total:a,commutative:a,associative:a},subtract:{trivial:i,total:a,commutative:i,associative:i},multiply:{trivial:a,total:a,commutative:a,associative:a},divide:{trivial:i,total:a,commutative:i,associative:i},paren:{trivial:a,total:a,commutative:a,associative:i},defaultF:{trivial:i,total:a,commutative:i,associative:i}},u={divide:{total:i},log:{total:i}},s={subtract:{total:i},abs:{trivial:a},log:{total:a}};function c(g,N){var x=arguments.length>2&&arguments[2]!==void 0?arguments[2]:l,y=o;if(typeof g=="string"?y=g:pr(g)?y=g.fn.toString():Gt(g)?y=g.name:_t(g)&&(y="paren"),De(x,y)){var D=x[y];if(De(D,N))return D[N];if(De(l,y))return l[y][N]}if(De(x,o)){var S=x[o];return De(S,N)?S[N]:l[o][N]}if(De(l,y)){var E=l[y];if(De(E,N))return E[N]}return l[o][N]}function f(g){var N=arguments.length>1&&arguments[1]!==void 0?arguments[1]:l;return c(g,"commutative",N)}function m(g){var N=arguments.length>1&&arguments[1]!==void 0?arguments[1]:l;return c(g,"associative",N)}function p(g,N){var x=ll({},g);for(var y in N)De(g,y)?x[y]=ll(ll({},N[y]),g[y]):x[y]=N[y];return x}function v(g,N){if(!g.args||g.args.length===0)return g;g.args=h(g,N);for(var x=0;x2&&m(g,N)){for(var S=g.args.pop();g.args.length>0;)S=x([g.args.pop(),S]);g.args=S.args}}}function b(g,N){if(!(!g.args||g.args.length===0)){for(var x=A(g),y=g.args.length,D=0;D2&&m(g,N)){for(var S=g.args.shift();g.args.length>0;)S=x([S,g.args.shift()]);g.args=S.args}}}function A(g){return pr(g)?function(N){try{return new t(g.op,g.fn,N,g.implicit)}catch(x){return console.error(x),[]}}:function(N){return new r(new n(g.name),N)}}return{createMakeNodeFunction:A,hasProperty:c,isCommutative:f,isAssociative:m,mergeContext:p,flatten:v,allChildren:h,unflattenr:w,unflattenl:b,defaultContext:l,realContext:u,positiveContext:s}}),xP="simplify",NP=["typed","parse","equal","resolve","simplifyConstant","simplifyCore","AccessorNode","ArrayNode","ConstantNode","FunctionNode","IndexNode","ObjectNode","OperatorNode","ParenthesisNode","SymbolNode"],AP=P(xP,NP,e=>{var{typed:r,parse:t,equal:n,resolve:a,simplifyConstant:i,simplifyCore:o,AccessorNode:l,ArrayNode:u,ConstantNode:s,FunctionNode:c,IndexNode:f,ObjectNode:m,OperatorNode:p,ParenthesisNode:v,SymbolNode:h}=e,{hasProperty:w,isCommutative:b,isAssociative:A,mergeContext:g,flatten:N,unflattenr:x,unflattenl:y,createMakeNodeFunction:D,defaultContext:S,realContext:E,positiveContext:C}=cl({FunctionNode:c,OperatorNode:p,SymbolNode:h});r.addConversion({from:"Object",to:"Map",convert:ca});var _=r("simplify",{Node:k,"Node, Map":(q,Z)=>k(q,!1,Z),"Node, Map, Object":(q,Z,j)=>k(q,!1,Z,j),"Node, Array":k,"Node, Array, Map":k,"Node, Array, Map, Object":k});r.removeConversion({from:"Object",to:"Map",convert:ca}),_.defaultContext=S,_.realContext=E,_.positiveContext=C;function F(q){return q.transform(function(Z){return _t(Z)?F(Z.content):Z})}var I={true:!0,false:!0,e:!0,i:!0,Infinity:!0,LN2:!0,LN10:!0,LOG2E:!0,LOG10E:!0,NaN:!0,phi:!0,pi:!0,SQRT1_2:!0,SQRT2:!0,tau:!0};_.rules=[o,{l:"log(e)",r:"1"},{s:"n-n1 -> n+-n1",assuming:{subtract:{total:!0}}},{s:"n-n -> 0",assuming:{subtract:{total:!1}}},{s:"-(cl*v) -> v * (-cl)",assuming:{multiply:{commutative:!0},subtract:{total:!0}}},{s:"-(cl*v) -> (-cl) * v",assuming:{multiply:{commutative:!1},subtract:{total:!0}}},{s:"-(v*cl) -> v * (-cl)",assuming:{multiply:{commutative:!1},subtract:{total:!0}}},{l:"-(n1/n2)",r:"-n1/n2"},{l:"-v",r:"v * (-1)"},{l:"(n1 + n2)*(-1)",r:"n1*(-1) + n2*(-1)",repeat:!0},{l:"n/n1^n2",r:"n*n1^-n2"},{l:"n/n1",r:"n*n1^-1"},{s:"(n1*n2)^n3 -> n1^n3 * n2^n3",assuming:{multiply:{commutative:!0}}},{s:"(n1*n2)^(-1) -> n2^(-1) * n1^(-1)",assuming:{multiply:{commutative:!1}}},{s:"(n ^ n1) ^ n2 -> n ^ (n1 * n2)",assuming:{divide:{total:!0}}},{l:" vd * ( vd * n1 + n2)",r:"vd^2 * n1 + vd * n2"},{s:" vd * (vd^n4 * n1 + n2) -> vd^(1+n4) * n1 + vd * n2",assuming:{divide:{total:!0}}},{s:"vd^n3 * ( vd * n1 + n2) -> vd^(n3+1) * n1 + vd^n3 * n2",assuming:{divide:{total:!0}}},{s:"vd^n3 * (vd^n4 * n1 + n2) -> vd^(n3+n4) * n1 + vd^n3 * n2",assuming:{divide:{total:!0}}},{l:"n*n",r:"n^2"},{s:"n * n^n1 -> n^(n1+1)",assuming:{divide:{total:!0}}},{s:"n^n1 * n^n2 -> n^(n1+n2)",assuming:{divide:{total:!0}}},i,{s:"n+n -> 2*n",assuming:{add:{total:!0}}},{l:"n+-n",r:"0"},{l:"vd*n + vd",r:"vd*(n+1)"},{l:"n3*n1 + n3*n2",r:"n3*(n1+n2)"},{l:"n3^(-n4)*n1 + n3 * n2",r:"n3^(-n4)*(n1 + n3^(n4+1) *n2)"},{l:"n3^(-n4)*n1 + n3^n5 * n2",r:"n3^(-n4)*(n1 + n3^(n4+n5)*n2)"},{s:"n*vd + vd -> (n+1)*vd",assuming:{multiply:{commutative:!1}}},{s:"vd + n*vd -> (1+n)*vd",assuming:{multiply:{commutative:!1}}},{s:"n1*n3 + n2*n3 -> (n1+n2)*n3",assuming:{multiply:{commutative:!1}}},{s:"n^n1 * n -> n^(n1+1)",assuming:{divide:{total:!0},multiply:{commutative:!1}}},{s:"n1*n3^(-n4) + n2 * n3 -> (n1 + n2*n3^(n4 + 1))*n3^(-n4)",assuming:{multiply:{commutative:!1}}},{s:"n1*n3^(-n4) + n2 * n3^n5 -> (n1 + n2*n3^(n4 + n5))*n3^(-n4)",assuming:{multiply:{commutative:!1}}},{l:"n*cd + cd",r:"(n+1)*cd"},{s:"cd*n + cd -> cd*(n+1)",assuming:{multiply:{commutative:!1}}},{s:"cd + cd*n -> cd*(1+n)",assuming:{multiply:{commutative:!1}}},i,{s:"(-n)*n1 -> -(n*n1)",assuming:{subtract:{total:!0}}},{s:"n1*(-n) -> -(n1*n)",assuming:{subtract:{total:!0},multiply:{commutative:!1}}},{s:"ce+ve -> ve+ce",assuming:{add:{commutative:!0}},imposeContext:{add:{commutative:!1}}},{s:"vd*cd -> cd*vd",assuming:{multiply:{commutative:!0}},imposeContext:{multiply:{commutative:!1}}},{l:"n+-n1",r:"n-n1"},{l:"n+-(n1)",r:"n-(n1)"},{s:"n*(n1^-1) -> n/n1",assuming:{multiply:{commutative:!0}}},{s:"n*n1^-n2 -> n/n1^n2",assuming:{multiply:{commutative:!0}}},{s:"n^-1 -> 1/n",assuming:{multiply:{commutative:!0}}},{l:"n^1",r:"n"},{s:"n*(n1/n2) -> (n*n1)/n2",assuming:{multiply:{associative:!0}}},{s:"n-(n1+n2) -> n-n1-n2",assuming:{addition:{associative:!0,commutative:!0}}},{l:"1*n",r:"n",imposeContext:{multiply:{commutative:!0}}},{s:"n1/(n2/n3) -> (n1*n3)/n2",assuming:{multiply:{associative:!0}}},{l:"n1/(-n2)",r:"-n1/n2"}];function R(q,Z){var j={};if(q.s){var Y=q.s.split("->");if(Y.length===2)j.l=Y[0],j.r=Y[1];else throw SyntaxError("Could not parse rule: "+q.s)}else j.l=q.l,j.r=q.r;j.l=F(t(j.l)),j.r=F(t(j.r));for(var ee of["imposeContext","repeat","assuming"])ee in q&&(j[ee]=q[ee]);if(q.evaluate&&(j.evaluate=t(q.evaluate)),A(j.l,Z)){var te=!b(j.l,Z),oe;te&&(oe=T());var ve=D(j.l),L=T();j.expanded={},j.expanded.l=ve([j.l,L]),N(j.expanded.l,Z),x(j.expanded.l,Z),j.expanded.r=ve([j.r,L]),te&&(j.expandedNC1={},j.expandedNC1.l=ve([oe,j.l]),j.expandedNC1.r=ve([oe,j.r]),j.expandedNC2={},j.expandedNC2.l=ve([oe,j.expanded.l]),j.expandedNC2.r=ve([oe,j.expanded.r]))}return j}function $(q,Z){for(var j=[],Y=0;Y2&&arguments[2]!==void 0?arguments[2]:Ka(),Y=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},ee=Y.consoleDebug;Z=$(Z||_.rules,Y.context);var te=a(q,j);te=F(te);for(var oe={},ve=te.toString({parenthesis:"all"});!oe[ve];){oe[ve]=!0,M=0;var L=ve;ee&&console.log("Working on: ",ve);for(var H=0;H ").concat(Z[H].r.toString()))),ee){var ie=te.toString({parenthesis:"all"});ie!==L&&(console.log("Applying",ne,"produced",ie),L=ie)}y(te,Y.context)}ve=te.toString({parenthesis:"all"})}return te}function O(q,Z,j){var Y=q;if(q)for(var ee=0;ee1&&(L=te(q.args.slice(0,ve))),ee=q.args.slice(ve),Y=ee.length===1?ee[0]:te(ee),j.push(te([L,Y]))}return j}function U(q,Z){var j={placeholders:{}};if(!q.placeholders&&!Z.placeholders)return j;if(q.placeholders){if(!Z.placeholders)return q}else return Z;for(var Y in q.placeholders)if(De(q.placeholders,Y)&&(j.placeholders[Y]=q.placeholders[Y],De(Z.placeholders,Y)&&!re(q.placeholders[Y],Z.placeholders[Y])))return null;for(var ee in Z.placeholders)De(Z.placeholders,ee)&&(j.placeholders[ee]=Z.placeholders[ee]);return j}function z(q,Z){var j=[];if(q.length===0||Z.length===0)return j;for(var Y,ee=0;ee2)throw new Error("permuting >2 commutative non-associative rule arguments not yet implemented");var L=se(q.args[0],Z.args[1],j);if(L.length===0)return[];var H=se(q.args[1],Z.args[0],j);if(H.length===0)return[];te=[L,H]}ee=Q(te)}else if(Z.args.length>=2&&q.args.length===2){for(var ne=X(Z,j),ie=[],de=0;de2)throw Error("Unexpected non-binary associative function: "+q.toString());return[]}}else if(q instanceof h){if(q.name.length===0)throw new Error("Symbol in rule has 0 length...!?");if(I[q.name]){if(q.name!==Z.name)return[]}else switch(q.name[1]>="a"&&q.name[1]<="z"?q.name.substring(0,2):q.name[0]){case"n":case"_p":ee[0].placeholders[q.name]=Z;break;case"c":case"cl":if(Ze(Z))ee[0].placeholders[q.name]=Z;else return[];break;case"v":if(!Ze(Z))ee[0].placeholders[q.name]=Z;else return[];break;case"vl":if(br(Z))ee[0].placeholders[q.name]=Z;else return[];break;case"cd":if(Jg(Z))ee[0].placeholders[q.name]=Z;else return[];break;case"vd":if(!Jg(Z))ee[0].placeholders[q.name]=Z;else return[];break;case"ce":if(Jo(Z))ee[0].placeholders[q.name]=Z;else return[];break;case"ve":if(!Jo(Z))ee[0].placeholders[q.name]=Z;else return[];break;default:throw new Error("Invalid symbol in rule: "+q.name)}}else if(q instanceof s){if(!n(q.value,Z.value))return[]}else return[];return ee}function re(q,Z){if(q instanceof s&&Z instanceof s){if(!n(q.value,Z.value))return!1}else if(q instanceof h&&Z instanceof h){if(q.name!==Z.name)return!1}else if(q instanceof p&&Z instanceof p||q instanceof c&&Z instanceof c){if(q instanceof p){if(q.op!==Z.op||q.fn!==Z.fn)return!1}else if(q instanceof c&&q.name!==Z.name)return!1;if(q.args.length!==Z.args.length)return!1;for(var j=0;j{var{typed:r,config:t,mathWithTransform:n,matrix:a,fraction:i,bignumber:o,AccessorNode:l,ArrayNode:u,ConstantNode:s,FunctionNode:c,IndexNode:f,ObjectNode:m,OperatorNode:p,SymbolNode:v}=e,{isCommutative:h,isAssociative:w,allChildren:b,createMakeNodeFunction:A}=cl({FunctionNode:c,OperatorNode:p,SymbolNode:v}),g=r("simplifyConstant",{Node:$=>D(R($,{})),"Node, Object":function(M,T){return D(R(M,T))}});function N($){return zn($)?$.valueOf():$ instanceof Array?$.map(N):_e($)?a(N($.valueOf())):$}function x($,M,T){try{return n[$].apply(null,M)}catch{return M=M.map(N),E(n[$].apply(null,M),T)}}var y=r({Fraction:_,number:function(M){return M<0?C(new s(-M)):new s(M)},BigNumber:function(M){return M<0?C(new s(-M)):new s(M)},bigint:function(M){return M<0n?C(new s(-M)):new s(M)},Complex:function(M){throw new Error("Cannot convert Complex number to Node")},string:function(M){return new s(M)},Matrix:function(M){return new u(M.valueOf().map(T=>y(T)))}});function D($){return Qe($)?$:y($)}function S($,M){var T=M&&M.exactFractions!==!1;if(T&&isFinite($)&&i){var k=i($),O=M&&typeof M.fractionsLimit=="number"?M.fractionsLimit:1/0;if(k.valueOf()===$&&k.n0;)if(Ze(k[0])&&typeof k[0].value!="string"){var O=E(k.shift().value,T);Qr($)?$=$.items[O-1]:($=$.valueOf()[O-1],$ instanceof Array&&($=a($)))}else if(k.length>1&&Ze(k[1])&&typeof k[1].value!="string"){var W=E(k[1].value,T),X=[],U=Qr($)?$.items:$.valueOf();for(var z of U)if(Qr(z))X.push(z.items[W-1]);else if(_e($))X.push(z[W-1]);else break;if(X.length===U.length)Qr($)?$=new u(X):$=a(X),k.splice(1,1);else break}else break;return k.length===M.dimensions.length?new l(D($),M):k.length>0?(M=new f(k),new l(D($),M)):$}if(Xa($)&&M.dimensions.length===1&&Ze(M.dimensions[0])){var Q=M.dimensions[0].value;return Q in $.properties?$.properties[Q]:new s}return new l(D($),M)}function I($,M,T,k){var O=M.shift(),W=M.reduce((X,U)=>{if(!Qe(U)){var z=X.pop();if(Qe(z))return[z,U];try{return X.push(x($,[z,U],k)),X}catch{X.push(z)}}X.push(D(X.pop()));var Q=X.length===1?X[0]:T(X);return[T([Q,D(U)])]},[O]);return W.length===1?W[0]:T([W[0],y(W[1])])}function R($,M){switch($.type){case"SymbolNode":return $;case"ConstantNode":switch(typeof $.value){case"number":return E($.value,M);case"bigint":return E($.value,M);case"string":return $.value;default:if(!isNaN($.value))return E($.value,M)}return $;case"FunctionNode":if(n[$.name]&&n[$.name].rawArgs)return $;{var T=["add","multiply"];if(!T.includes($.name)){var k=$.args.map(ee=>R(ee,M));if(!k.some(Qe))try{return x($.name,k,M)}catch{}if($.name==="size"&&k.length===1&&Qr(k[0])){for(var O=[],W=k[0];Qr(W);)O.push(W.items.length),W=W.items[0];return a(O)}return new c($.name,k.map(D))}}case"OperatorNode":{var X=$.fn.toString(),U,z,Q=A($);if(pr($)&&$.isUnary())U=[R($.args[0],M)],Qe(U[0])?z=Q(U):z=x(X,U,M);else if(w($,M.context))if(U=b($,M.context),U=U.map(ee=>R(ee,M)),h(X,M.context)){for(var se=[],re=[],q=0;q1?(z=I(X,se,Q,M),re.unshift(z),z=I(X,re,Q,M)):z=I(X,U,Q,M)}else z=I(X,U,Q,M);else U=$.args.map(ee=>R(ee,M)),z=I(X,U,Q,M);return z}case"ParenthesisNode":return R($.content,M);case"AccessorNode":return F(R($.object,M),R($.index,M),M);case"ArrayNode":{var Z=$.items.map(ee=>R(ee,M));return Z.some(Qe)?new u(Z.map(D)):a(Z)}case"IndexNode":return new f($.dimensions.map(ee=>g(ee,M)));case"ObjectNode":{var j={};for(var Y in $.properties)j[Y]=g($.properties[Y],M);return new m(j)}case"AssignmentNode":case"BlockNode":case"FunctionAssignmentNode":case"RangeNode":case"ConditionalNode":default:throw new Error("Unimplemented node type in simplifyConstant: ".concat($.type))}}return g}),Xg="simplifyCore",CP=["typed","parse","equal","isZero","add","subtract","multiply","divide","pow","AccessorNode","ArrayNode","ConstantNode","FunctionNode","IndexNode","ObjectNode","OperatorNode","ParenthesisNode","SymbolNode"],MP=P(Xg,CP,e=>{var{typed:r,parse:t,equal:n,isZero:a,add:i,subtract:o,multiply:l,divide:u,pow:s,AccessorNode:c,ArrayNode:f,ConstantNode:m,FunctionNode:p,IndexNode:v,ObjectNode:h,OperatorNode:w,ParenthesisNode:b,SymbolNode:A}=e,g=new m(0),N=new m(1),x=new m(!0),y=new m(!1);function D(_){return pr(_)&&["and","not","or"].includes(_.op)}var{hasProperty:S,isCommutative:E}=cl({FunctionNode:p,OperatorNode:w,SymbolNode:A});function C(_){var F=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},I=F?F.context:void 0;if(S(_,"trivial",I)){if(Gt(_)&&_.args.length===1)return C(_.args[0],F);var R=!1,$=0;if(_.forEach(re=>{++$,$===1&&(R=C(re,F))}),$===1)return R}var M=_;if(Gt(M)){var T=B5(M.name);if(T){if(M.args.length>2&&S(M,"associative",I))for(;M.args.length>2;){var k=M.args.pop(),O=M.args.pop();M.args.push(new w(T,M.name,[k,O]))}M=new w(T,M.name,M.args)}else return new p(C(M.fn),M.args.map(re=>C(re,F)))}if(pr(M)&&M.isUnary()){var W=C(M.args[0],F);if(M.op==="~"&&pr(W)&&W.isUnary()&&W.op==="~"||M.op==="not"&&pr(W)&&W.isUnary()&&W.op==="not"&&D(W.args[0]))return W.args[0];var X=!0;if(M.op==="-"&&pr(W)&&(W.isBinary()&&W.fn==="subtract"&&(M=new w("-","subtract",[W.args[1],W.args[0]]),X=!1),W.isUnary()&&W.op==="-"))return W.args[0];if(X)return new w(M.op,M.fn,[W])}if(pr(M)&&M.isBinary()){var U=C(M.args[0],F),z=C(M.args[1],F);if(M.op==="+"){if(Ze(U)&&a(U.value))return z;if(Ze(z)&&a(z.value))return U;pr(z)&&z.isUnary()&&z.op==="-"&&(z=z.args[0],M=new w("-","subtract",[U,z]))}if(M.op==="-")return pr(z)&&z.isUnary()&&z.op==="-"?C(new w("+","add",[U,z.args[0]]),F):Ze(U)&&a(U.value)?C(new w("-","unaryMinus",[z])):Ze(z)&&a(z.value)?U:new w(M.op,M.fn,[U,z]);if(M.op==="*"){if(Ze(U)){if(a(U.value))return g;if(n(U.value,1))return z}if(Ze(z)){if(a(z.value))return g;if(n(z.value,1))return U;if(E(M,I))return new w(M.op,M.fn,[z,U],M.implicit)}return new w(M.op,M.fn,[U,z],M.implicit)}if(M.op==="/")return Ze(U)&&a(U.value)?g:Ze(z)&&n(z.value,1)?U:new w(M.op,M.fn,[U,z]);if(M.op==="^"&&Ze(z)){if(a(z.value))return N;if(n(z.value,1))return U}if(M.op==="and"){if(Ze(U))if(U.value){if(D(z))return z;if(Ze(z))return z.value?x:y}else return y;if(Ze(z))if(z.value){if(D(U))return U}else return y}if(M.op==="or"){if(Ze(U)){if(U.value)return x;if(D(z))return z}if(Ze(z)){if(z.value)return x;if(D(U))return U}}return new w(M.op,M.fn,[U,z])}if(pr(M))return new w(M.op,M.fn,M.args.map(re=>C(re,F)));if(Qr(M))return new f(M.items.map(re=>C(re,F)));if(fn(M))return new c(C(M.object,F),C(M.index,F));if(kn(M))return new v(M.dimensions.map(re=>C(re,F)));if(Xa(M)){var Q={};for(var se in M.properties)Q[se]=C(M.properties[se],F);return new h(Q)}return M}return r(Xg,{Node:C,"Node,Object":C})}),_P="resolve",TP=["typed","parse","ConstantNode","FunctionNode","OperatorNode","ParenthesisNode"],FP=P(_P,TP,e=>{var{typed:r,parse:t,ConstantNode:n,FunctionNode:a,OperatorNode:i,ParenthesisNode:o}=e;function l(u,s){var c=arguments.length>2&&arguments[2]!==void 0?arguments[2]:new Set;if(!s)return u;if(br(u)){if(c.has(u.name)){var f=Array.from(c).join(", ");throw new ReferenceError("recursive loop of variable definitions among {".concat(f,"}"))}var m=s.get(u.name);if(Qe(m)){var p=new Set(c);return p.add(u.name),l(m,s,p)}else return typeof m=="number"?t(String(m)):m!==void 0?new n(m):u}else if(pr(u)){var v=u.args.map(function(w){return l(w,s,c)});return new i(u.op,u.fn,v,u.implicit)}else{if(_t(u))return new o(l(u.content,s,c));if(Gt(u)){var h=u.args.map(function(w){return l(w,s,c)});return new a(u.name,h)}}return u.map(w=>l(w,s,c))}return r("resolve",{Node:l,"Node, Map | null | undefined":l,"Node, Object":(u,s)=>l(u,ca(s)),"Array | Matrix":r.referToSelf(u=>s=>s.map(c=>u(c))),"Array | Matrix, null | undefined":r.referToSelf(u=>s=>s.map(c=>u(c))),"Array, Object":r.referTo("Array,Map",u=>(s,c)=>u(s,ca(c))),"Matrix, Object":r.referTo("Matrix,Map",u=>(s,c)=>u(s,ca(c))),"Array | Matrix, Map":r.referToSelf(u=>(s,c)=>s.map(f=>u(f,c)))})}),Qg="symbolicEqual",BP=["parse","simplify","typed","OperatorNode"],OP=P(Qg,BP,e=>{var{parse:r,simplify:t,typed:n,OperatorNode:a}=e;function i(o,l){var u=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},s=new a("-","subtract",[o,l]),c=t(s,{},u);return Ze(c)&&!c.value}return n(Qg,{"Node, Node":i,"Node, Node, Object":i})}),ey="derivative",$P=["typed","config","parse","simplify","equal","isZero","numeric","ConstantNode","FunctionNode","OperatorNode","ParenthesisNode","SymbolNode"],IP=P(ey,$P,e=>{var{typed:r,config:t,parse:n,simplify:a,equal:i,isZero:o,numeric:l,ConstantNode:u,FunctionNode:s,OperatorNode:c,ParenthesisNode:f,SymbolNode:m}=e;function p(N,x){var y=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{simplify:!0},D={};b(D,N,x.name);var S=A(N,D);return y.simplify?a(S):S}function v(N){var x=n(N);if(!x.isSymbolNode)throw new TypeError("Invalid variable. "+"Cannot parse ".concat(JSON.stringify(N)," into a variable in function derivative"));return x}var h=r(ey,{"Node, SymbolNode":p,"Node, SymbolNode, Object":p,"Node, string":(N,x)=>p(N,v(x)),"Node, string, Object":(N,x,y)=>p(N,v(x),y)});h._simplify=!0,h.toTex=function(N){return w.apply(null,N.args)};var w=r("_derivTex",{"Node, SymbolNode":function(x,y){return Ze(x)&&tr(x.value)==="string"?w(n(x.value).toString(),y.toString(),1):w(x.toTex(),y.toString(),1)},"Node, ConstantNode":function(x,y){if(tr(y.value)==="string")return w(x,n(y.value));throw new Error("The second parameter to 'derivative' is a non-string constant")},"Node, SymbolNode, ConstantNode":function(x,y,D){return w(x.toString(),y.name,D.value)},"string, string, number":function(x,y,D){var S;return D===1?S="{d\\over d"+y+"}":S="{d^{"+D+"}\\over d"+y+"^{"+D+"}}",S+"\\left[".concat(x,"\\right]")}}),b=r("constTag",{"Object, ConstantNode, string":function(x,y){return x[y]=!0,!0},"Object, SymbolNode, string":function(x,y,D){return y.name!==D?(x[y]=!0,!0):!1},"Object, ParenthesisNode, string":function(x,y,D){return b(x,y.content,D)},"Object, FunctionAssignmentNode, string":function(x,y,D){return y.params.includes(D)?b(x,y.expr,D):(x[y]=!0,!0)},"Object, FunctionNode | OperatorNode, string":function(x,y,D){if(y.args.length>0){for(var S=b(x,y.args[0],D),E=1;E0){var S=x.args.filter(function(M){return y[M]===void 0}),E=S.length===1?S[0]:new c("*","multiply",S),C=D.concat(A(E,y));return new c("*","multiply",C)}return new c("+","add",x.args.map(function(M){return new c("*","multiply",x.args.map(function(T){return T===M?A(T,y):T.clone()}))}))}if(x.op==="/"&&x.isBinary()){var _=x.args[0],F=x.args[1];return y[F]!==void 0?new c("/","divide",[A(_,y),F]):y[_]!==void 0?new c("*","multiply",[new c("-","unaryMinus",[_]),new c("/","divide",[A(F,y),new c("^","pow",[F.clone(),g(2)])])]):new c("/","divide",[new c("-","subtract",[new c("*","multiply",[A(_,y),F.clone()]),new c("*","multiply",[_.clone(),A(F,y)])]),new c("^","pow",[F.clone(),g(2)])])}if(x.op==="^"&&x.isBinary()){var I=x.args[0],R=x.args[1];if(y[I]!==void 0)return Ze(I)&&(o(I.value)||i(I.value,1))?g(0):new c("*","multiply",[x,new c("*","multiply",[new s("log",[I.clone()]),A(R.clone(),y)])]);if(y[R]!==void 0){if(Ze(R)){if(o(R.value))return g(0);if(i(R.value,1))return A(I,y)}var $=new c("^","pow",[I.clone(),new c("-","subtract",[R,g(1)])]);return new c("*","multiply",[R.clone(),new c("*","multiply",[A(I,y),$])])}return new c("*","multiply",[new c("^","pow",[I.clone(),R.clone()]),new c("+","add",[new c("*","multiply",[A(I,y),new c("/","divide",[R.clone(),I.clone()])]),new c("*","multiply",[A(R,y),new s("log",[I.clone()])])])])}throw new Error('Cannot process operator "'+x.op+'" in derivative: the operator is not supported, undefined, or the number of arguments passed to it are not supported')}});function g(N,x){return new u(l(N,mn(String(N),t)))}return h}),ry="rationalize",RP=["config","typed","equal","isZero","add","subtract","multiply","divide","pow","parse","simplifyConstant","simplifyCore","simplify","?bignumber","?fraction","mathWithTransform","matrix","AccessorNode","ArrayNode","ConstantNode","FunctionNode","IndexNode","ObjectNode","OperatorNode","SymbolNode","ParenthesisNode"],zP=P(ry,RP,e=>{var{config:r,typed:t,equal:n,isZero:a,add:i,subtract:o,multiply:l,divide:u,pow:s,parse:c,simplifyConstant:f,simplifyCore:m,simplify:p,fraction:v,bignumber:h,mathWithTransform:w,matrix:b,AccessorNode:A,ArrayNode:g,ConstantNode:N,FunctionNode:x,IndexNode:y,ObjectNode:D,OperatorNode:S,SymbolNode:E,ParenthesisNode:C}=e;function _(M){var T=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},k=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,O=I(),W=F(M,T,!0,O.firstRules),X=W.variables.length,U={exactFractions:!1},z={exactFractions:!0};if(M=W.expression,X>=1){M=R(M);var Q,se,re=!0,q=!1;M=p(M,O.firstRules,{},U);for(var Z;se=re?O.distrDivRules:O.sucDivRules,M=p(M,se,{},z),re=!re,Z=M.toString(),Z!==Q;)q=!0,Q=Z;q&&(M=p(M,O.firstRulesAgain,{},U)),M=p(M,O.finalRules,{},U)}var j=[],Y={};return M.type==="OperatorNode"&&M.isBinary()&&M.op==="/"?(X===1&&(M.args[0]=$(M.args[0],j),M.args[1]=$(M.args[1])),k&&(Y.numerator=M.args[0],Y.denominator=M.args[1])):(X===1&&(M=$(M,j)),k&&(Y.numerator=M,Y.denominator=null)),k?(Y.coefficients=j,Y.variables=W.variables,Y.expression=M,Y):M}return t(ry,{Node:_,"Node, boolean":(M,T)=>_(M,{},T),"Node, Object":_,"Node, Object, boolean":_});function F(M,T,k,O){var W=[],X=p(M,O,T,{exactFractions:!1});k=!!k;var U="+-*"+(k?"/":"");Q(X);var z={};return z.expression=X,z.variables=W,z;function Q(se){var re=se.type;if(re==="FunctionNode")throw new Error("There is an unsolved function call");if(re==="OperatorNode")if(se.op==="^"){if(se.args[1].type!=="ConstantNode"||!Ce(parseFloat(se.args[1].value)))throw new Error("There is a non-integer exponent");Q(se.args[0])}else{if(!U.includes(se.op))throw new Error("Operator "+se.op+" invalid in polynomial expression");for(var q=0;q1;if(O==="OperatorNode"&&M.isBinary()){var X=!1,U;if(M.op==="^"&&(M.args[0].type==="ParenthesisNode"||M.args[0].type==="OperatorNode")&&M.args[1].type==="ConstantNode"&&(U=parseFloat(M.args[1].value),X=U>=2&&Ce(U)),X){if(U>2){var z=M.args[0],Q=new S("^","pow",[M.args[0].cloneDeep(),new N(U-1)]);M=new S("*","multiply",[z,Q])}else M=new S("*","multiply",[M.args[0],M.args[0].cloneDeep()]);W&&(k==="content"?T.content=M:T.args[k]=M)}}if(O==="ParenthesisNode")R(M.content,M,"content");else if(O!=="ConstantNode"&&O!=="SymbolNode")for(var se=0;se=0;z--)if(T[z]!==0){var Q=new N(X?T[z]:Math.abs(T[z])),se=T[z]<0?"-":"+";if(z>0){var re=new E(W);if(z>1){var q=new N(z);re=new S("^","pow",[re,q])}T[z]===-1&&X?Q=new S("-","unaryMinus",[re]):Math.abs(T[z])===1?Q=re:Q=new S("*","multiply",[Q,re])}X?U=Q:se==="+"?U=new S("+","add",[U,Q]):U=new S("-","subtract",[U,Q]),X=!1}if(X)return new N(0);return U;function Z(j,Y,ee){var te=j.type;if(te==="FunctionNode")throw new Error("There is an unsolved function call");if(te==="OperatorNode"){if(!"+-*^".includes(j.op))throw new Error("Operator "+j.op+" invalid");if(Y!==null){if((j.fn==="unaryMinus"||j.fn==="pow")&&Y.fn!=="add"&&Y.fn!=="subtract"&&Y.fn!=="multiply")throw new Error("Invalid "+j.op+" placing");if((j.fn==="subtract"||j.fn==="add"||j.fn==="multiply")&&Y.fn!=="add"&&Y.fn!=="subtract")throw new Error("Invalid "+j.op+" placing");if((j.fn==="subtract"||j.fn==="add"||j.fn==="unaryMinus")&&ee.noFil!==0)throw new Error("Invalid "+j.op+" placing")}(j.op==="^"||j.op==="*")&&(ee.fire=j.op);for(var oe=0;oeO&&(T[ve]=0),T[ve]+=ee.cte*(ee.oper==="+"?1:-1),O=Math.max(ve,O);return}ee.cte=ve,ee.fire===""&&(T[0]+=ee.cte*(ee.oper==="+"?1:-1))}else throw new Error("Type "+te+" is not allowed")}}}),ty="zpk2tf",PP=["typed","add","multiply","Complex","number"],kP=P(ty,PP,e=>{var{typed:r,add:t,multiply:n,Complex:a,number:i}=e;return r(ty,{"Array,Array,number":function(s,c,f){return o(s,c,f)},"Array,Array":function(s,c){return o(s,c,1)},"Matrix,Matrix,number":function(s,c,f){return o(s.valueOf(),c.valueOf(),f)},"Matrix,Matrix":function(s,c){return o(s.valueOf(),c.valueOf(),1)}});function o(u,s,c){u.some(A=>A.type==="BigNumber")&&(u=u.map(A=>i(A))),s.some(A=>A.type==="BigNumber")&&(s=s.map(A=>i(A)));for(var f=[a(1,0)],m=[a(1,0)],p=0;p=0&&f-m{var{typed:r,add:t,multiply:n,Complex:a,divide:i,matrix:o}=e;return r(ny,{"Array, Array":function(c,f){var m=u(512);return l(c,f,m)},"Array, Array, Array":function(c,f,m){return l(c,f,m)},"Array, Array, number":function(c,f,m){if(m<0)throw new Error("w must be a positive number");var p=u(m);return l(c,f,p)},"Matrix, Matrix":function(c,f){var m=u(512),{w:p,h:v}=l(c.valueOf(),f.valueOf(),m);return{w:o(p),h:o(v)}},"Matrix, Matrix, Matrix":function(c,f,m){var{h:p}=l(c.valueOf(),f.valueOf(),m.valueOf());return{h:o(p),w:o(m)}},"Matrix, Matrix, number":function(c,f,m){if(m<0)throw new Error("w must be a positive number");var p=u(m),{h:v}=l(c.valueOf(),f.valueOf(),p);return{h:o(v),w:o(p)}}});function l(s,c,f){for(var m=[],p=[],v=0;v{var{classes:r}=e;return function(n,a){var i=r[a&&a.mathjs];return i&&typeof i.fromJSON=="function"?i.fromJSON(a):a}}),ZP="replacer",GP=[],WP=P(ZP,GP,()=>function(r,t){return typeof t=="number"&&(!isFinite(t)||isNaN(t))?{mathjs:"number",value:String(t)}:typeof t=="bigint"?{mathjs:"bigint",value:String(t)}:t}),jP="13.2.3",KP=P("true",[],()=>!0),JP=P("false",[],()=>!1),YP=P("null",[],()=>null),XP=rt("Infinity",["config","?BigNumber"],e=>{var{config:r,BigNumber:t}=e;return r.number==="BigNumber"?new t(1/0):1/0}),QP=rt("NaN",["config","?BigNumber"],e=>{var{config:r,BigNumber:t}=e;return r.number==="BigNumber"?new t(NaN):NaN}),e7=rt("pi",["config","?BigNumber"],e=>{var{config:r,BigNumber:t}=e;return r.number==="BigNumber"?ju(t):vM}),r7=rt("tau",["config","?BigNumber"],e=>{var{config:r,BigNumber:t}=e;return r.number==="BigNumber"?R4(t):hM}),t7=rt("e",["config","?BigNumber"],e=>{var{config:r,BigNumber:t}=e;return r.number==="BigNumber"?$4(t):gM}),n7=rt("phi",["config","?BigNumber"],e=>{var{config:r,BigNumber:t}=e;return r.number==="BigNumber"?I4(t):yM}),a7=rt("LN2",["config","?BigNumber"],e=>{var{config:r,BigNumber:t}=e;return r.number==="BigNumber"?new t(2).ln():Math.LN2}),i7=rt("LN10",["config","?BigNumber"],e=>{var{config:r,BigNumber:t}=e;return r.number==="BigNumber"?new t(10).ln():Math.LN10}),o7=rt("LOG2E",["config","?BigNumber"],e=>{var{config:r,BigNumber:t}=e;return r.number==="BigNumber"?new t(1).div(new t(2).ln()):Math.LOG2E}),s7=rt("LOG10E",["config","?BigNumber"],e=>{var{config:r,BigNumber:t}=e;return r.number==="BigNumber"?new t(1).div(new t(10).ln()):Math.LOG10E}),u7=rt("SQRT1_2",["config","?BigNumber"],e=>{var{config:r,BigNumber:t}=e;return r.number==="BigNumber"?new t("0.5").sqrt():Math.SQRT1_2}),l7=rt("SQRT2",["config","?BigNumber"],e=>{var{config:r,BigNumber:t}=e;return r.number==="BigNumber"?new t(2).sqrt():Math.SQRT2}),c7=rt("i",["Complex"],e=>{var{Complex:r}=e;return r.I}),f7=P("PI",["pi"],e=>{var{pi:r}=e;return r}),m7=P("E",["e"],e=>{var{e:r}=e;return r}),d7=P("version",[],()=>jP);function rt(e,r,t){return P(e,r,t,{recreateOnConfigChange:!0})}var p7=Pe("speedOfLight","299792458","m s^-1"),v7=Pe("gravitationConstant","6.67430e-11","m^3 kg^-1 s^-2"),h7=Pe("planckConstant","6.62607015e-34","J s"),g7=Pe("reducedPlanckConstant","1.0545718176461565e-34","J s"),y7=Pe("magneticConstant","1.25663706212e-6","N A^-2"),b7=Pe("electricConstant","8.8541878128e-12","F m^-1"),w7=Pe("vacuumImpedance","376.730313667","ohm"),x7=Pe("coulomb","8.987551792261171e9","N m^2 C^-2"),N7=Pe("elementaryCharge","1.602176634e-19","C"),A7=Pe("bohrMagneton","9.2740100783e-24","J T^-1"),E7=Pe("conductanceQuantum","7.748091729863649e-5","S"),D7=Pe("inverseConductanceQuantum","12906.403729652257","ohm"),S7=Pe("magneticFluxQuantum","2.0678338484619295e-15","Wb"),C7=Pe("nuclearMagneton","5.0507837461e-27","J T^-1"),M7=Pe("klitzing","25812.807459304513","ohm"),_7=Pe("bohrRadius","5.29177210903e-11","m"),T7=Pe("classicalElectronRadius","2.8179403262e-15","m"),F7=Pe("electronMass","9.1093837015e-31","kg"),B7=Pe("fermiCoupling","1.1663787e-5","GeV^-2"),O7=Yo("fineStructure",.0072973525693),$7=Pe("hartreeEnergy","4.3597447222071e-18","J"),I7=Pe("protonMass","1.67262192369e-27","kg"),R7=Pe("deuteronMass","3.3435830926e-27","kg"),z7=Pe("neutronMass","1.6749271613e-27","kg"),P7=Pe("quantumOfCirculation","3.6369475516e-4","m^2 s^-1"),k7=Pe("rydberg","10973731.568160","m^-1"),q7=Pe("thomsonCrossSection","6.6524587321e-29","m^2"),L7=Yo("weakMixingAngle",.2229),V7=Yo("efimovFactor",22.7),U7=Pe("atomicMass","1.66053906660e-27","kg"),H7=Pe("avogadro","6.02214076e23","mol^-1"),Z7=Pe("boltzmann","1.380649e-23","J K^-1"),G7=Pe("faraday","96485.33212331001","C mol^-1"),W7=Pe("firstRadiation","3.7417718521927573e-16","W m^2"),j7=Pe("loschmidt","2.686780111798444e25","m^-3"),K7=Pe("gasConstant","8.31446261815324","J K^-1 mol^-1"),J7=Pe("molarPlanckConstant","3.990312712893431e-10","J s mol^-1"),Y7=Pe("molarVolume","0.022413969545014137","m^3 mol^-1"),X7=Yo("sackurTetrode",-1.16487052358),Q7=Pe("secondRadiation","0.014387768775039337","m K"),ek=Pe("stefanBoltzmann","5.67037441918443e-8","W m^-2 K^-4"),rk=Pe("wienDisplacement","2.897771955e-3","m K"),tk=Pe("molarMass","0.99999999965e-3","kg mol^-1"),nk=Pe("molarMassC12","11.9999999958e-3","kg mol^-1"),ak=Pe("gravity","9.80665","m s^-2"),ik=Pe("planckLength","1.616255e-35","m"),ok=Pe("planckMass","2.176435e-8","kg"),sk=Pe("planckTime","5.391245e-44","s"),uk=Pe("planckCharge","1.87554603778e-18","C"),lk=Pe("planckTemperature","1.416785e+32","K");function Pe(e,r,t){var n=["config","Unit","BigNumber"];return P(e,n,a=>{var{config:i,Unit:o,BigNumber:l}=a,u=i.number==="BigNumber"?new l(r):parseFloat(r),s=new o(u,t);return s.fixPrefix=!0,s})}function Yo(e,r){var t=["config","BigNumber"];return P(e,t,n=>{var{config:a,BigNumber:i}=n;return a.number==="BigNumber"?new i(r):r})}var ck="apply",fk=["typed","isInteger"],mk=P(ck,fk,e=>{var{typed:r,isInteger:t}=e,n=Ru({typed:r,isInteger:t});return r("apply",{"...any":function(i){var o=i[1];Re(o)?i[1]=o-1:Ie(o)&&(i[1]=o.minus(1));try{return n.apply(null,i)}catch(l){throw Lr(l)}}})},{isTransformFunction:!0}),dk="column",pk=["typed","Index","matrix","range"],vk=P(dk,pk,e=>{var{typed:r,Index:t,matrix:n,range:a}=e,i=Tv({typed:r,Index:t,matrix:n,range:a});return r("column",{"...any":function(l){var u=l.length-1,s=l[u];Re(s)&&(l[u]=s-1);try{return i.apply(null,l)}catch(c){throw Lr(c)}}})},{isTransformFunction:!0});function fl(e,r,t){var n=e.filter(function(u){return br(u)&&!(u.name in r)&&!t.has(u.name)})[0];if(!n)throw new Error('No undefined variable found in inline expression "'+e+'"');var a=n.name,i=new Map,o=new wm(t,i,new Set([a])),l=e.compile();return function(s){return i.set(a,s),l.evaluate(o)}}var hk="transformCallback",gk=["typed"],ml=P(hk,gk,e=>{var{typed:r}=e;return function(n,a){return r.isTypedFunction(n)?t(n,a):ay(n,n.length,a)};function t(n,a){var i=Object.fromEntries(Object.entries(n.signatures).map(o=>{var[l,u]=o,s=l.split(",").length;return r.isTypedFunction(u)?[l,t(u,a)]:[l,ay(u,s,a)]}));return typeof n.name=="string"?r(n.name,i):r(i)}});function ay(e,r,t){return r===t?e:r===t+1?function(){for(var n=arguments.length,a=new Array(n),i=0;it+1?function(){for(var n=arguments.length,a=new Array(n),i=0;ir+1)}var yk="filter",bk=["typed"],wk=P(yk,bk,e=>{var{typed:r}=e;function t(a,i,o){var l=$v({typed:r}),u=ml({typed:r});if(a.length===0)return l();var s=a[0];if(a.length===1)return l(s);var c=a.length-1,f=a[c];return s&&(s=n(s,o)),f&&(br(f)||ma(f)?f=n(f,o):f=fl(f,i,o)),l(s,u(f,c))}t.rawArgs=!0;function n(a,i){return a.compile().evaluate(i)}return t},{isTransformFunction:!0}),xk="forEach",Nk=["typed"],Ak=P(xk,Nk,e=>{var{typed:r}=e,t=zv({typed:r}),n=ml({typed:r});function a(o,l,u){if(o.length===0)return t();var s=o[0];if(o.length===1)return t(s);var c=o.length-1,f=o[c];return s&&(s=i(s,u)),f&&(br(f)||ma(f)?f=i(f,u):f=fl(f,l,u)),t(s,n(f,c))}a.rawArgs=!0;function i(o,l){return o.compile().evaluate(l)}return a},{isTransformFunction:!0}),Ek="index",Dk=["Index","getMatrixDataType"],Sk=P(Ek,Dk,e=>{var{Index:r,getMatrixDataType:t}=e;return function(){for(var a=[],i=0,o=arguments.length;i0?0:2;else if(l&&l.isSet===!0)l=l.map(function(s){return s-1});else if(Xe(l)||_e(l))t(l)!=="boolean"&&(l=l.map(function(s){return s-1}));else if(Re(l))l--;else if(Ie(l))l=l.toNumber()-1;else if(typeof l!="string")throw new TypeError("Dimension must be an Array, Matrix, number, string, or Range");a[i]=l}var u=new r;return r.apply(u,a),u}},{isTransformFunction:!0}),Ck="map",Mk=["typed"],_k=P(Ck,Mk,e=>{var{typed:r}=e,t=Lv({typed:r}),n=ml({typed:r});function a(i,o,l){if(i.length===0)return t();if(i.length===1)return t(i[0]);var u=i.length-1,s=i.slice(0,u),c=i[u];return s=s.map(m=>f(m,l)),c&&(br(c)||ma(c)?c=f(c,l):c=fl(c,o,l)),t(...s,n(c,u));function f(m,p){return m.compile().evaluate(p)}}return a.rawArgs=!0,a},{isTransformFunction:!0});function Tk(e){return Re(e)?e-1:Ie(e)?e.minus(1):e}function Fk(e){return Re(e)||Ie(e)}function Nn(e){if(e.length===2&&Xr(e[0])){e=e.slice();var r=e[1];Fk(r)&&(e[1]=Tk(r))}return e}var Bk="max",Ok=["typed","config","numeric","larger"],$k=P(Bk,Ok,e=>{var{typed:r,config:t,numeric:n,larger:a}=e,i=Wh({typed:r,config:t,numeric:n,larger:a});return r("max",{"...any":function(l){l=Nn(l);try{return i.apply(null,l)}catch(u){throw Lr(u)}}})},{isTransformFunction:!0}),Ik="mean",Rk=["typed","add","divide"],zk=P(Ik,Rk,e=>{var{typed:r,add:t,divide:n}=e,a=bg({typed:r,add:t,divide:n});return r("mean",{"...any":function(o){o=Nn(o);try{return a.apply(null,o)}catch(l){throw Lr(l)}}})},{isTransformFunction:!0}),Pk="min",kk=["typed","config","numeric","smaller"],qk=P(Pk,kk,e=>{var{typed:r,config:t,numeric:n,smaller:a}=e,i=Kh({typed:r,config:t,numeric:n,smaller:a});return r("min",{"...any":function(l){l=Nn(l);try{return i.apply(null,l)}catch(u){throw Lr(u)}}})},{isTransformFunction:!0}),Lk="range",Vk=["typed","config","?matrix","?bignumber","smaller","smallerEq","larger","largerEq","add","isPositive"],Uk=P(Lk,Vk,e=>{var{typed:r,config:t,matrix:n,bignumber:a,smaller:i,smallerEq:o,larger:l,largerEq:u,add:s,isPositive:c}=e,f=Wv({typed:r,config:t,matrix:n,bignumber:a,smaller:i,smallerEq:o,larger:l,largerEq:u,add:s,isPositive:c});return r("range",{"...any":function(p){var v=p.length-1,h=p[v];return typeof h!="boolean"&&p.push(!0),f.apply(null,p)}})},{isTransformFunction:!0}),Hk="row",Zk=["typed","Index","matrix","range"],Gk=P(Hk,Zk,e=>{var{typed:r,Index:t,matrix:n,range:a}=e,i=Xv({typed:r,Index:t,matrix:n,range:a});return r("row",{"...any":function(l){var u=l.length-1,s=l[u];Re(s)&&(l[u]=s-1);try{return i.apply(null,l)}catch(c){throw Lr(c)}}})},{isTransformFunction:!0}),Wk="subset",jk=["typed","matrix","zeros","add"],Kk=P(Wk,jk,e=>{var{typed:r,matrix:t,zeros:n,add:a}=e,i=th({typed:r,matrix:t,zeros:n,add:a});return r("subset",{"...any":function(l){try{return i.apply(null,l)}catch(u){throw Lr(u)}}})},{isTransformFunction:!0}),Jk="concat",Yk=["typed","matrix","isInteger"],Xk=P(Jk,Yk,e=>{var{typed:r,matrix:t,isInteger:n}=e,a=Mv({typed:r,matrix:t,isInteger:n});return r("concat",{"...any":function(o){var l=o.length-1,u=o[l];Re(u)?o[l]=u-1:Ie(u)&&(o[l]=u.minus(1));try{return a.apply(null,o)}catch(s){throw Lr(s)}}})},{isTransformFunction:!0}),oy="diff",Qk=["typed","matrix","subtract","number","bignumber"],eq=P(oy,Qk,e=>{var{typed:r,matrix:t,subtract:n,number:a,bignumber:i}=e,o=Uv({typed:r,matrix:t,subtract:n,number:a,bignumber:i});return r(oy,{"...any":function(u){u=Nn(u);try{return o.apply(null,u)}catch(s){throw Lr(s)}}})},{isTransformFunction:!0}),rq="std",tq=["typed","map","sqrt","variance"],nq=P(rq,tq,e=>{var{typed:r,map:t,sqrt:n,variance:a}=e,i=Cg({typed:r,map:t,sqrt:n,variance:a});return r("std",{"...any":function(l){l=Nn(l);try{return i.apply(null,l)}catch(u){throw Lr(u)}}})},{isTransformFunction:!0}),sy="sum",aq=["typed","config","add","numeric"],iq=P(sy,aq,e=>{var{typed:r,config:t,add:n,numeric:a}=e,i=hg({typed:r,config:t,add:n,numeric:a});return r(sy,{"...any":function(l){l=Nn(l);try{return i.apply(null,l)}catch(u){throw Lr(u)}}})},{isTransformFunction:!0}),oq="quantileSeq",sq=["typed","bignumber","add","subtract","divide","multiply","partitionSelect","compare","isInteger","smaller","smallerEq","larger"],uq=P(oq,sq,e=>{var{typed:r,bignumber:t,add:n,subtract:a,divide:i,multiply:o,partitionSelect:l,compare:u,isInteger:s,smaller:c,smallerEq:f,larger:m}=e,p=Dg({typed:r,bignumber:t,add:n,subtract:a,divide:i,multiply:o,partitionSelect:l,compare:u,isInteger:s,smaller:c,smallerEq:f,larger:m});return r("quantileSeq",{"Array | Matrix, number | BigNumber":p,"Array | Matrix, number | BigNumber, number":(h,w,b)=>p(h,w,v(b)),"Array | Matrix, number | BigNumber, boolean":p,"Array | Matrix, number | BigNumber, boolean, number":(h,w,b,A)=>p(h,w,b,v(A)),"Array | Matrix, Array | Matrix":p,"Array | Matrix, Array | Matrix, number":(h,w,b)=>p(h,w,v(b)),"Array | Matrix, Array | Matrix, boolean":p,"Array | Matrix, Array | Matrix, boolean, number":(h,w,b,A)=>p(h,w,b,v(A))});function v(h){return Nn([[],h])[1]}},{isTransformFunction:!0}),uy="cumsum",lq=["typed","add","unaryPlus"],cq=P(uy,lq,e=>{var{typed:r,add:t,unaryPlus:n}=e,a=gg({typed:r,add:t,unaryPlus:n});return r(uy,{"...any":function(o){if(o.length===2&&Xr(o[0])){var l=o[1];Re(l)?o[1]=l-1:Ie(l)&&(o[1]=l.minus(1))}try{return a.apply(null,o)}catch(u){throw Lr(u)}}})},{isTransformFunction:!0}),ly="variance",fq=["typed","add","subtract","multiply","divide","apply","isNaN"],mq=P(ly,fq,e=>{var{typed:r,add:t,subtract:n,multiply:a,divide:i,apply:o,isNaN:l}=e,u=Ag({typed:r,add:t,subtract:n,multiply:a,divide:i,apply:o,isNaN:l});return r(ly,{"...any":function(c){c=Nn(c);try{return u.apply(null,c)}catch(f){throw Lr(f)}}})},{isTransformFunction:!0}),cy="print",dq=["typed","matrix","zeros","add"],pq=P(cy,dq,e=>{var{typed:r,matrix:t,zeros:n,add:a}=e,i=bh({typed:r,matrix:t,zeros:n,add:a});return r(cy,{"string, Object | Array":function(u,s){return i(o(u),s)},"string, Object | Array, number | Object":function(u,s,c){return i(o(u),s,c)}});function o(l){return l.replace(gh,u=>{var s=u.slice(1).split("."),c=s.map(function(f){return!isNaN(f)&&f.length>0?parseInt(f)-1:f});return"$"+c.join(".")})}},{isTransformFunction:!0}),vq="and",hq=["typed","matrix","zeros","add","equalScalar","not","concat"],gq=P(vq,hq,e=>{var{typed:r,matrix:t,equalScalar:n,zeros:a,not:i,concat:o}=e,l=kh({typed:r,matrix:t,equalScalar:n,zeros:a,not:i,concat:o});function u(s,c,f){var m=s[0].compile().evaluate(f);if(!Xr(m)&&!l(m,!0))return!1;var p=s[1].compile().evaluate(f);return l(m,p)}return u.rawArgs=!0,u},{isTransformFunction:!0}),yq="or",bq=["typed","matrix","equalScalar","DenseMatrix","concat"],wq=P(yq,bq,e=>{var{typed:r,matrix:t,equalScalar:n,DenseMatrix:a,concat:i}=e,o=Dv({typed:r,matrix:t,equalScalar:n,DenseMatrix:a,concat:i});function l(u,s,c){var f=u[0].compile().evaluate(c);if(!Xr(f)&&o(f,!1))return!0;var m=u[1].compile().evaluate(c);return o(f,m)}return l.rawArgs=!0,l},{isTransformFunction:!0}),xq="bitAnd",Nq=["typed","matrix","zeros","add","equalScalar","not","concat"],Aq=P(xq,Nq,e=>{var{typed:r,matrix:t,equalScalar:n,zeros:a,not:i,concat:o}=e,l=pv({typed:r,matrix:t,equalScalar:n,zeros:a,not:i,concat:o});function u(s,c,f){var m=s[0].compile().evaluate(f);if(!Xr(m)){if(isNaN(m))return NaN;if(m===0||m===!1)return 0}var p=s[1].compile().evaluate(f);return l(m,p)}return u.rawArgs=!0,u},{isTransformFunction:!0}),Eq="bitOr",Dq=["typed","matrix","equalScalar","DenseMatrix","concat"],Sq=P(Eq,Dq,e=>{var{typed:r,matrix:t,equalScalar:n,DenseMatrix:a,concat:i}=e,o=gv({typed:r,matrix:t,equalScalar:n,DenseMatrix:a,concat:i});function l(u,s,c){var f=u[0].compile().evaluate(c);if(!Xr(f)){if(isNaN(f))return NaN;if(f===-1)return-1;if(f===!0)return 1}var m=u[1].compile().evaluate(c);return o(f,m)}return l.rawArgs=!0,l},{isTransformFunction:!0}),fy=Object.freeze(Object.defineProperty({__proto__:null,createAbs:E_,createAccessorNode:M5,createAcos:W4,createAcosh:K4,createAcot:Y4,createAcoth:Q4,createAcsc:rO,createAcsch:nO,createAdd:m5,createAddScalar:M_,createAnd:kh,createAndTransform:gq,createApply:Ru,createApplyTransform:mk,createArg:dT,createArrayNode:T5,createAsec:iO,createAsech:sO,createAsin:lO,createAsinh:mO,createAssignmentNode:$5,createAtan:vO,createAtan2:gO,createAtanh:bO,createAtomicMass:U7,createAvogadro:H7,createBellNumbers:mP,createBigNumberClass:MC,createBigint:KM,createBignumber:t_,createBin:GF,createBitAnd:pv,createBitAndTransform:Aq,createBitNot:oT,createBitOr:gv,createBitOrTransform:Sq,createBitXor:fT,createBlockNode:R5,createBohrMagneton:A7,createBohrRadius:_7,createBoltzmann:Z7,createBoolean:QM,createCatalan:pP,createCbrt:B_,createCeil:L_,createChain:zR,createChainClass:o6,createClassicalElectronRadius:T7,createClone:cM,createColumn:Tv,createColumnTransform:vk,createCombinations:Sz,createCombinationsWithRep:Mz,createCompare:kB,createCompareNatural:UB,createCompareText:GB,createCompile:v8,createComplex:i_,createComplexClass:OC,createComposition:hP,createConcat:Mv,createConcatTransform:Xk,createConditionalNode:P5,createConductanceQuantum:E7,createConj:vT,createConstantNode:G5,createCorr:Ez,createCos:xO,createCosh:AO,createCot:DO,createCoth:CO,createCoulomb:x7,createCount:MT,createCreateUnit:Z4,createCross:TT,createCsc:_O,createCsch:FO,createCtranspose:yF,createCube:U_,createCumSum:gg,createCumSumTransform:cq,createDeepEqual:f4,createDenseMatrixClass:uM,createDerivative:IP,createDet:kR,createDeuteronMass:R7,createDiag:BT,createDiff:Uv,createDiffTransform:eq,createDistance:lz,createDivide:sz,createDivideScalar:oB,createDot:y5,createDotDivide:wB,createDotMultiply:X3,createDotPow:yB,createE:t7,createEfimovFactor:V7,createEigs:jR,createElectricConstant:b7,createElectronMass:F7,createElementaryCharge:N7,createEqual:jB,createEqualScalar:PM,createEqualText:YB,createErf:OF,createEvaluate:g8,createExp:Z_,createExpm:JR,createExpm1:W_,createFactorial:$z,createFalse:JP,createFaraday:G7,createFermiCoupling:B7,createFft:NF,createFibonacciHeapClass:_4,createFilter:$v,createFilterTransform:wk,createFineStructure:O7,createFirstRadiation:W7,createFix:J_,createFlatten:RT,createFloor:Jp,createForEach:zv,createForEachTransform:Ak,createFormat:HF,createFraction:u_,createFractionClass:LC,createFreqz:LP,createFunctionAssignmentNode:j5,createFunctionNode:f8,createGamma:Tz,createGasConstant:K7,createGcd:w3,createGetMatrixDataType:qT,createGravitationConstant:v7,createGravity:ak,createHartreeEnergy:$7,createHasNumericValue:CM,createHelp:IR,createHelpClass:n6,createHex:JF,createHypot:p5,createI:c7,createIdentity:VT,createIfft:EF,createIm:gT,createImmutableDenseMatrixClass:A4,createIndex:A5,createIndexClass:S4,createIndexNode:J5,createIndexTransform:Sk,createInfinity:XP,createIntersect:mz,createInv:LR,createInverseConductanceQuantum:D7,createInvmod:j3,createIsInteger:mM,createIsNaN:OM,createIsNegative:AM,createIsNumeric:DM,createIsPositive:_M,createIsPrime:rB,createIsZero:FM,createKldivergence:Rz,createKlitzing:M7,createKron:HT,createLN10:i7,createLN2:a7,createLOG10E:s7,createLOG2E:o7,createLarger:i4,createLargerEq:u4,createLcm:E3,createLeafCount:yP,createLeftShift:BB,createLgamma:Bz,createLog:mB,createLog10:S3,createLog1p:pB,createLog2:M3,createLoschmidt:j7,createLsolve:NB,createLsolveAll:SB,createLup:E8,createLusolve:X8,createLyap:az,createMad:bz,createMagneticConstant:y7,createMagneticFluxQuantum:S7,createMap:Lv,createMapTransform:_k,createMatrix:c_,createMatrixClass:WC,createMatrixFromColumns:h_,createMatrixFromFunction:m_,createMatrixFromRows:p_,createMax:Wh,createMaxTransform:$k,createMean:bg,createMeanTransform:zk,createMedian:gz,createMin:Kh,createMinTransform:qk,createMod:Xp,createMode:qF,createMolarMass:tk,createMolarMassC12:nk,createMolarPlanckConstant:J7,createMolarVolume:Y7,createMultinomial:Pz,createMultiply:O3,createMultiplyScalar:F3,createNaN:QP,createNeutronMass:z7,createNode:S5,createNorm:h5,createNot:xT,createNthRoot:I3,createNthRoots:hB,createNuclearMagneton:C7,createNull:YP,createNumber:GM,createNumeric:aB,createObjectNode:X5,createOct:jF,createOnes:KT,createOperatorNode:e8,createOr:Dv,createOrTransform:wq,createParenthesisNode:t8,createParse:d8,createParser:N8,createParserClass:w8,createPartitionSelect:h4,createPermutations:qz,createPhi:n7,createPi:e7,createPickRandom:aP,createPinv:UR,createPlanckCharge:uk,createPlanckConstant:h7,createPlanckLength:ik,createPlanckMass:ok,createPlanckTemperature:lk,createPlanckTime:sk,createPolynomialRoot:e6,createPow:uB,createPrint:bh,createPrintTransform:pq,createProd:VF,createProtonMass:I7,createQr:S8,createQuantileSeq:Dg,createQuantileSeqTransform:uq,createQuantumOfCirculation:P7,createRandom:oP,createRandomInt:uP,createRange:Wv,createRangeClass:HC,createRangeNode:a8,createRangeTransform:Uk,createRationalize:zP,createRe:bT,createReducedPlanckConstant:g7,createRelationalNode:o8,createReplacer:WP,createReshape:XT,createResize:rF,createResolve:FP,createResultSet:BS,createReviver:HP,createRightArithShift:$B,createRightLogShift:RB,createRotate:nF,createRotationMatrix:iF,createRound:cB,createRow:Xv,createRowTransform:Gk,createRydberg:k7,createSQRT1_2:u7,createSQRT2:l7,createSackurTetrode:X7,createSchur:tz,createSec:OO,createSech:IO,createSecondRadiation:Q7,createSetCartesian:GO,createSetDifference:jO,createSetDistinct:JO,createSetIntersect:XO,createSetIsSubset:e5,createSetMultiplicity:t5,createSetPowerset:a5,createSetSize:o5,createSetSymDifference:u5,createSetUnion:c5,createSign:z3,createSimplify:AP,createSimplifyConstant:SP,createSimplifyCore:MP,createSin:zO,createSinh:kO,createSize:uF,createSlu:J8,createSmaller:QB,createSmallerEq:t4,createSolveODE:TF,createSort:y4,createSpaClass:B4,createSparse:U4,createSparseMatrixClass:LM,createSpeedOfLight:p7,createSplitUnit:y_,createSqrt:q3,createSqrtm:XR,createSquare:V3,createSqueeze:cF,createStd:Cg,createStdTransform:nq,createStefanBoltzmann:ek,createStirlingS2:cP,createString:YM,createSubset:th,createSubsetTransform:Kk,createSubtract:H3,createSubtractScalar:T_,createSum:hg,createSumTransform:iq,createSylvester:ez,createSymbolNode:l8,createSymbolicEqual:OP,createTan:LO,createTanh:HO,createTau:r7,createThomsonCrossSection:q7,createTo:QF,createTrace:x5,createTranspose:hF,createTrue:KP,createTypeOf:IM,createTyped:MS,createUnaryMinus:w_,createUnaryPlus:N_,createUnequal:d4,createUnitClass:k4,createUnitFunction:L4,createUppercaseE:m7,createUppercasePi:f7,createUsolve:EB,createUsolveAll:MB,createVacuumImpedance:w7,createVariance:Ag,createVarianceTransform:mq,createVersion:d7,createWeakMixingAngle:L7,createWienDisplacement:rk,createXgcd:G3,createXor:ET,createZeros:wF,createZeta:PF,createZpk2tf:kP},Symbol.toStringTag,{value:"Module"})),dl={exports:{}};function pl(){}pl.prototype={on:function(e,r,t){var n=this.e||(this.e={});return(n[e]||(n[e]=[])).push({fn:r,ctx:t}),this},once:function(e,r,t){var n=this;function a(){n.off(e,a),r.apply(t,arguments)}return a._=r,this.on(e,a,t)},emit:function(e){var r=[].slice.call(arguments,1),t=((this.e||(this.e={}))[e]||[]).slice(),n=0,a=t.length;for(n;ng(D,F));else if(typeof S=="object")for(var C in S)De(S,C)&&g(D,S[C],C);else if(ei(S)||E!==void 0){var _=ei(S)?v(S)?S.fn+".transform":S.fn:E;if(De(D,_)&&D[_]!==S&&!b.silent)throw new Error('Cannot import "'+_+'" twice');D[_]=S}else if(!b.silent)throw new TypeError("Factory, Object, or Array expected")}var N={};g(N,w);for(var x in N)if(De(N,x)){var y=N[x];if(ei(y))s(y,b);else if(c(y))i(x,y,b);else if(!b.silent)throw new TypeError("Factory, Object, or Array expected")}}function i(w,b,A){if(A.wrap&&typeof b=="function"&&(b=u(b)),f(b)&&(b=e(w,{[b.signature]:b})),e.isTypedFunction(t[w])&&e.isTypedFunction(b)){A.override?b=e(w,b.signatures):b=e(t[w],b),t[w]=b,delete n[w],o(w,b),t.emit("import",w,function(){return b});return}if(t[w]===void 0||A.override){t[w]=b,delete n[w],o(w,b),t.emit("import",w,function(){return b});return}if(!A.silent)throw new Error('Cannot import "'+w+'": already exists')}function o(w,b){b&&typeof b.transform=="function"?(t.expression.transform[w]=b.transform,m(w)&&(t.expression.mathWithTransform[w]=b.transform)):(delete t.expression.transform[w],m(w)&&(t.expression.mathWithTransform[w]=b))}function l(w){delete t.expression.transform[w],m(w)?t.expression.mathWithTransform[w]=t[w]:delete t.expression.mathWithTransform[w]}function u(w){var b=function(){for(var g=[],N=0,x=arguments.length;N2&&arguments[2]!==void 0?arguments[2]:w.fn;if(A.includes("."))throw new Error("Factory name should not contain a nested path. Name: "+JSON.stringify(A));var g=v(w)?t.expression.transform:t,N=A in t.expression.transform,x=De(g,A)?g[A]:void 0,y=function(){var S={};w.dependencies.map(Hm).forEach(C=>{if(C.includes("."))throw new Error("Factory dependency should not contain a nested path. Name: "+JSON.stringify(C));C==="math"?S.math=t:C==="mathWithTransform"?S.mathWithTransform=t.expression.mathWithTransform:C==="classes"?S.classes=t:S[C]=t[C]});var E=w(S);if(E&&typeof E.transform=="function")throw new Error('Transforms cannot be attached to factory functions. Please create a separate function for it with export const path = "expression.transform"');if(x===void 0||b.override)return E;if(e.isTypedFunction(x)&&e.isTypedFunction(E))return e(x,E);if(b.silent)return x;throw new Error('Cannot import "'+A+'": already exists')};!w.meta||w.meta.lazy!==!1?(Xi(g,A,y),x&&N?l(A):(v(w)||p(w))&&Xi(t.expression.mathWithTransform,A,()=>g[A])):(g[A]=y(),x&&N?l(A):(v(w)||p(w))&&Xi(t.expression.mathWithTransform,A,()=>g[A])),n[A]=w,t.emit("import",A,y)}function c(w){return typeof w=="function"||typeof w=="number"||typeof w=="string"||typeof w=="boolean"||w===null||Gr(w)||gt(w)||Ie(w)||zn(w)||_e(w)||Array.isArray(w)}function f(w){return typeof w=="function"&&typeof w.signature=="string"}function m(w){return!De(h,w)}function p(w){return!w.fn.includes(".")&&!De(h,w.fn)&&(!w.meta||!w.meta.isClass)}function v(w){return w!==void 0&&w.meta!==void 0&&w.meta.isTransformFunction===!0||!1}var h={expression:!0,type:!0,docs:!0,error:!0,json:!0,chain:!0};return a}function vl(e,r){var t=Br({},bm,r);if(typeof Object.create!="function")throw new Error("ES5 not supported by this JavaScript engine. Please load the es5-shim and es5-sham library for compatibility.");var n=_q({isNumber:Re,isComplex:gt,isBigNumber:Ie,isBigInt:Nm,isFraction:zn,isUnit:Gr,isString:Cr,isArray:Xe,isMatrix:_e,isCollection:Xr,isDenseMatrix:Ja,isSparseMatrix:cn,isRange:Yi,isIndex:Ya,isBoolean:Am,isResultSet:Em,isHelp:cu,isFunction:Dm,isDate:Sm,isRegExp:Cm,isObject:fa,isMap:Pn,isPartitionedMap:tS,isObjectWrappingMap:nS,isNull:Mm,isUndefined:_m,isAccessorNode:fn,isArrayNode:Qr,isAssignmentNode:Tm,isBlockNode:Fm,isConditionalNode:Bm,isConstantNode:Ze,isFunctionAssignmentNode:ma,isFunctionNode:Gt,isIndexNode:kn,isNode:Qe,isObjectNode:Xa,isOperatorNode:pr,isParenthesisNode:_t,isRangeNode:Om,isRelationalNode:$m,isSymbolNode:br,isChain:mu});n.config=uS(t,n.emit),n.expression={transform:{},mathWithTransform:{config:n.config}};var a=[],i=[];function o(c){if(ei(c))return c(n);var f=c[Object.keys(c)[0]];if(ei(f))return f(n);if(!oS(c))throw console.warn("Factory object with properties `type`, `name`, and `factory` expected",c),new Error("Factory object with properties `type`, `name`, and `factory` expected");var m=a.indexOf(c),p;return m===-1?(c.math===!0?p=c.factory(n.type,t,o,n.typed,n):p=c.factory(n.type,t,o,n.typed),a.push(c),i.push(p)):p=i[m],p}var l={};function u(){for(var c=arguments.length,f=new Array(c),m=0;m{Object.values(l).forEach(c=>{c&&c.meta&&c.meta.recreateOnConfigChange&&s(c,{override:!0})})}),n.create=vl.bind(null,e),n.factory=P,n.import(Object.values(iS(e))),n.ArgumentsError=Xt,n.DimensionError=qe,n.IndexError=ft,n}const Fq=vl(fy,{}),my="simcore/services/comp/opencor";function hl(e,r){let t=-1;const n=new Fq.parser;return e.simulationUiInfo.input.forEach(a=>{++t,n.set(a.id,e.$refs.simInput[t].vModel)}),n.evaluate(r)}function dy(e){e.$nextTick(()=>{let r=-1;e.simulationUiInfo.input.forEach(t=>{++r,e.$refs.simInput[r].visible=t.visible===void 0?!0:hl(e,t.visible)}),e.libopencor!==void 0&&(e.userMessage="Running the model...",e.showUserMessage=!0,e.$nextTick(()=>{e.runSimulation()}))})}function py(e){if(!e.hasFinalisedUi&&e.isMounted&&e.hasValidSimulationUiInfo){e.$refs.output.classList.add("x"+e.simulationUiInfo.output.plots.length);let r=-1;e.simulationUiInfo.output.plots.forEach(()=>{e.simulationResults[++r]=[{x:[],y:[],type:"scatter"}]}),dy(e),e.hasFinalisedUi=!0}}const vy=(e,r)=>{const t=e.__vccOpts||e;for(const[n,a]of r)t[n]=a;return t},Bq={name:"SimulationVuerInput",components:{ElInputNumber:au,ElOption:dm,ElSelect:mm,ElSlider:hm},props:{defaultValue:{required:!0,type:Number},maximumValue:{type:Number},minimumValue:{type:Number},name:{required:!0,type:String},possibleValues:{type:Array},stepValue:{type:Number}},data:function(){return{isDiscrete:this.possibleValues!==void 0,labelClasses:"default "+(this.possibleValues!==void 0?"discrete":"scalar"),visible:!0,vModel:this.defaultValue}},methods:{updateUi:function(){dy(this.$parent)}}},Oq={key:1,class:"sliders-and-fields"};function $q(e,r,t,n,a,i){const o=dm,l=mm,u=hm,s=au;return d.withDirectives((d.openBlock(),d.createElementBlock("div",null,[d.createElementVNode("p",{class:d.normalizeClass(e.labelClasses)},d.toDisplayString(t.name),3),e.isDiscrete?(d.openBlock(),d.createBlock(l,{key:0,class:"discrete","popper-class":"discrete-popper",size:"small",modelValue:e.vModel,"onUpdate:modelValue":r[0]||(r[0]=c=>e.vModel=c),teleported:!1,onChange:r[1]||(r[1]=c=>i.updateUi())},{default:d.withCtx(()=>[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(t.possibleValues,c=>(d.openBlock(),d.createBlock(o,{key:c.value,label:c.name,value:c.value},null,8,["label","value"]))),128))]),_:1},8,["modelValue"])):d.createCommentVNode("",!0),e.isDiscrete?d.createCommentVNode("",!0):(d.openBlock(),d.createElementBlock("div",Oq,[d.createVNode(u,{modelValue:e.vModel,"onUpdate:modelValue":r[2]||(r[2]=c=>e.vModel=c),max:t.maximumValue,min:t.minimumValue,"show-input":!1,"show-tooltip":!1,step:t.stepValue,onInput:r[3]||(r[3]=c=>i.updateUi())},null,8,["modelValue","max","min","step"]),d.createVNode(s,{class:"scalar",size:"small",modelValue:e.vModel,"onUpdate:modelValue":r[4]||(r[4]=c=>e.vModel=c),controls:!1,max:t.maximumValue,min:t.minimumValue,step:t.stepValue,"step-strictly":!0,onInput:r[5]||(r[5]=c=>i.updateUi())},null,8,["modelValue","max","min","step"])]))],512)),[[d.vShow,e.visible]])}const hy=vy(Bq,[["render",$q],["__scopeId","data-v-463a29a2"]]);var vr={},gl=vr.ValidationError=function(r,t,n,a,i,o){if(Array.isArray(a)?(this.path=a,this.property=a.reduce(function(u,s){return u+yy(s)},"instance")):a!==void 0&&(this.property=a),r&&(this.message=r),n){var l=n.$id||n.id;this.schema=l||n}t!==void 0&&(this.instance=t),this.name=i,this.argument=o,this.stack=this.toString()};gl.prototype.toString=function(){return this.property+" "+this.message};var Xo=vr.ValidatorResult=function(r,t,n,a){this.instance=r,this.schema=t,this.options=n,this.path=a.path,this.propertyPath=a.propertyPath,this.errors=[],this.throwError=n&&n.throwError,this.throwFirst=n&&n.throwFirst,this.throwAll=n&&n.throwAll,this.disableFormat=n&&n.disableFormat===!0};Xo.prototype.addError=function(r){var t;if(typeof r=="string")t=new gl(r,this.instance,this.schema,this.path);else{if(!r)throw new Error("Missing error detail");if(!r.message)throw new Error("Missing error message");if(!r.name)throw new Error("Missing validator type");t=new gl(r.message,this.instance,this.schema,this.path,r.name,r.argument)}if(this.errors.push(t),this.throwFirst)throw new Gn(this);if(this.throwError)throw t;return t},Xo.prototype.importErrors=function(r){typeof r=="string"||r&&r.validatorType?this.addError(r):r&&r.errors&&(this.errors=this.errors.concat(r.errors))};function Iq(e,r){return r+": "+e.toString()+` `}Xo.prototype.toString=function(r){return this.errors.map(Iq).join("")},Object.defineProperty(Xo.prototype,"valid",{get:function(){return!this.errors.length}}),vr.ValidatorResultError=Gn;function Gn(e){typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,Gn),this.instance=e.instance,this.schema=e.schema,this.options=e.options,this.errors=e.errors}Gn.prototype=new Error,Gn.prototype.constructor=Gn,Gn.prototype.name="Validation Error";var gy=vr.SchemaError=function e(r,t){this.message=r,this.schema=t,Error.call(this,r),typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,e)};gy.prototype=Object.create(Error.prototype,{constructor:{value:gy,enumerable:!1},name:{value:"SchemaError",enumerable:!1}});var yl=vr.SchemaContext=function(r,t,n,a,i){this.schema=r,this.options=t,Array.isArray(n)?(this.path=n,this.propertyPath=n.reduce(function(o,l){return o+yy(l)},"instance")):this.propertyPath=n,this.base=a,this.schemas=i};yl.prototype.resolve=function(r){return by(this.base,r)},yl.prototype.makeChild=function(r,t){var n=t===void 0?this.path:this.path.concat([t]),a=r.$id||r.id;let i=by(this.base,a||"");var o=new yl(r,this.options,n,i,Object.create(this.schemas));return a&&!o.schemas[i]&&(o.schemas[i]=r),o};var At=vr.FORMAT_REGEXPS={"date-time":/^\d{4}-(?:0[0-9]{1}|1[0-2]{1})-(3[01]|0[1-9]|[12][0-9])[tT ](2[0-4]|[01][0-9]):([0-5][0-9]):(60|[0-5][0-9])(\.\d+)?([zZ]|[+-]([0-5][0-9]):(60|[0-5][0-9]))$/,date:/^\d{4}-(?:0[0-9]{1}|1[0-2]{1})-(3[01]|0[1-9]|[12][0-9])$/,time:/^(2[0-4]|[01][0-9]):([0-5][0-9]):(60|[0-5][0-9])$/,duration:/P(T\d+(H(\d+M(\d+S)?)?|M(\d+S)?|S)|\d+(D|M(\d+D)?|Y(\d+M(\d+D)?)?)(T\d+(H(\d+M(\d+S)?)?|M(\d+S)?|S))?|\d+W)/i,email:/^(?:[\w\!\#\$\%\&\'\*\+\-\/\=\?\^\`\{\|\}\~]+\.)*[\w\!\#\$\%\&\'\*\+\-\/\=\?\^\`\{\|\}\~]+@(?:(?:(?:[a-zA-Z0-9](?:[a-zA-Z0-9\-](?!\.)){0,61}[a-zA-Z0-9]?\.)+[a-zA-Z0-9](?:[a-zA-Z0-9\-](?!$)){0,61}[a-zA-Z0-9]?)|(?:\[(?:(?:[01]?\d{1,2}|2[0-4]\d|25[0-5])\.){3}(?:[01]?\d{1,2}|2[0-4]\d|25[0-5])\]))$/,"idn-email":/^("(?:[!#-\[\]-\u{10FFFF}]|\\[\t -\u{10FFFF}])*"|[!#-'*+\-/-9=?A-Z\^-\u{10FFFF}](?:\.?[!#-'*+\-/-9=?A-Z\^-\u{10FFFF}])*)@([!#-'*+\-/-9=?A-Z\^-\u{10FFFF}](?:\.?[!#-'*+\-/-9=?A-Z\^-\u{10FFFF}])*|\[[!-Z\^-\u{10FFFF}]*\])$/u,"ip-address":/^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/,ipv6:/^\s*((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(%.+)?\s*$/,uri:/^[a-zA-Z][a-zA-Z0-9+.-]*:[^\s]*$/,"uri-reference":/^(((([A-Za-z][+\-.0-9A-Za-z]*(:%[0-9A-Fa-f]{2}|:[!$&-.0-;=?-Z_a-z~]|[/?])|\?)(%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~])*|([A-Za-z][+\-.0-9A-Za-z]*:?)?)|([A-Za-z][+\-.0-9A-Za-z]*:)?\/((%[0-9A-Fa-f]{2}|\/((%[0-9A-Fa-f]{2}|[!$&-.0-9;=A-Z_a-z~])+|(\[(([Vv][0-9A-Fa-f]+\.[!$&-.0-;=A-Z_a-z~]+)?|[.0-:A-Fa-f]+)\])?)(:\d*)?[/?]|[!$&-.0-;=?-Z_a-z~])(%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~])*|(\/((%[0-9A-Fa-f]{2}|[!$&-.0-9;=A-Z_a-z~])+|(\[(([Vv][0-9A-Fa-f]+\.[!$&-.0-;=A-Z_a-z~]+)?|[.0-:A-Fa-f]+)\])?)(:\d*)?)?))#(%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~])*|(([A-Za-z][+\-.0-9A-Za-z]*)?%[0-9A-Fa-f]{2}|[!$&-.0-9;=@_~]|[A-Za-z][+\-.0-9A-Za-z]*[!$&-*,;=@_~])(%[0-9A-Fa-f]{2}|[!$&-.0-9;=@-Z_a-z~])*((([/?](%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~])*)?#|[/?])(%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~])*)?|([A-Za-z][+\-.0-9A-Za-z]*(:%[0-9A-Fa-f]{2}|:[!$&-.0-;=?-Z_a-z~]|[/?])|\?)(%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~])*|([A-Za-z][+\-.0-9A-Za-z]*:)?\/((%[0-9A-Fa-f]{2}|\/((%[0-9A-Fa-f]{2}|[!$&-.0-9;=A-Z_a-z~])+|(\[(([Vv][0-9A-Fa-f]+\.[!$&-.0-;=A-Z_a-z~]+)?|[.0-:A-Fa-f]+)\])?)(:\d*)?[/?]|[!$&-.0-;=?-Z_a-z~])(%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~])*|\/((%[0-9A-Fa-f]{2}|[!$&-.0-9;=A-Z_a-z~])+(:\d*)?|(\[(([Vv][0-9A-Fa-f]+\.[!$&-.0-;=A-Z_a-z~]+)?|[.0-:A-Fa-f]+)\])?:\d*|\[(([Vv][0-9A-Fa-f]+\.[!$&-.0-;=A-Z_a-z~]+)?|[.0-:A-Fa-f]+)\])?)?|[A-Za-z][+\-.0-9A-Za-z]*:?)?$/,iri:/^[a-zA-Z][a-zA-Z0-9+.-]*:[^\s]*$/,"iri-reference":/^(((([A-Za-z][+\-.0-9A-Za-z]*(:%[0-9A-Fa-f]{2}|:[!$&-.0-;=?-Z_a-z~-\u{10FFFF}]|[/?])|\?)(%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~-\u{10FFFF}])*|([A-Za-z][+\-.0-9A-Za-z]*:?)?)|([A-Za-z][+\-.0-9A-Za-z]*:)?\/((%[0-9A-Fa-f]{2}|\/((%[0-9A-Fa-f]{2}|[!$&-.0-9;=A-Z_a-z~-\u{10FFFF}])+|(\[(([Vv][0-9A-Fa-f]+\.[!$&-.0-;=A-Z_a-z~-\u{10FFFF}]+)?|[.0-:A-Fa-f]+)\])?)(:\d*)?[/?]|[!$&-.0-;=?-Z_a-z~-\u{10FFFF}])(%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~-\u{10FFFF}])*|(\/((%[0-9A-Fa-f]{2}|[!$&-.0-9;=A-Z_a-z~-\u{10FFFF}])+|(\[(([Vv][0-9A-Fa-f]+\.[!$&-.0-;=A-Z_a-z~-\u{10FFFF}]+)?|[.0-:A-Fa-f]+)\])?)(:\d*)?)?))#(%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~-\u{10FFFF}])*|(([A-Za-z][+\-.0-9A-Za-z]*)?%[0-9A-Fa-f]{2}|[!$&-.0-9;=@_~-\u{10FFFF}]|[A-Za-z][+\-.0-9A-Za-z]*[!$&-*,;=@_~-\u{10FFFF}])(%[0-9A-Fa-f]{2}|[!$&-.0-9;=@-Z_a-z~-\u{10FFFF}])*((([/?](%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~-\u{10FFFF}])*)?#|[/?])(%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~-\u{10FFFF}])*)?|([A-Za-z][+\-.0-9A-Za-z]*(:%[0-9A-Fa-f]{2}|:[!$&-.0-;=?-Z_a-z~-\u{10FFFF}]|[/?])|\?)(%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~-\u{10FFFF}])*|([A-Za-z][+\-.0-9A-Za-z]*:)?\/((%[0-9A-Fa-f]{2}|\/((%[0-9A-Fa-f]{2}|[!$&-.0-9;=A-Z_a-z~-\u{10FFFF}])+|(\[(([Vv][0-9A-Fa-f]+\.[!$&-.0-;=A-Z_a-z~-\u{10FFFF}]+)?|[.0-:A-Fa-f]+)\])?)(:\d*)?[/?]|[!$&-.0-;=?-Z_a-z~-\u{10FFFF}])(%[0-9A-Fa-f]{2}|[!$&-;=?-Z_a-z~-\u{10FFFF}])*|\/((%[0-9A-Fa-f]{2}|[!$&-.0-9;=A-Z_a-z~-\u{10FFFF}])+(:\d*)?|(\[(([Vv][0-9A-Fa-f]+\.[!$&-.0-;=A-Z_a-z~-\u{10FFFF}]+)?|[.0-:A-Fa-f]+)\])?:\d*|\[(([Vv][0-9A-Fa-f]+\.[!$&-.0-;=A-Z_a-z~-\u{10FFFF}]+)?|[.0-:A-Fa-f]+)\])?)?|[A-Za-z][+\-.0-9A-Za-z]*:?)?$/u,uuid:/^[0-9A-F]{8}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{4}-[0-9A-F]{12}$/i,"uri-template":/(%[0-9a-f]{2}|[!#$&(-;=?@\[\]_a-z~]|\{[!#&+,./;=?@|]?(%[0-9a-f]{2}|[0-9_a-z])(\.?(%[0-9a-f]{2}|[0-9_a-z]))*(:[1-9]\d{0,3}|\*)?(,(%[0-9a-f]{2}|[0-9_a-z])(\.?(%[0-9a-f]{2}|[0-9_a-z]))*(:[1-9]\d{0,3}|\*)?)*\})*/iu,"json-pointer":/^(\/([\x00-\x2e0-@\[-}\x7f]|~[01])*)*$/iu,"relative-json-pointer":/^\d+(#|(\/([\x00-\x2e0-@\[-}\x7f]|~[01])*)*)$/iu,hostname:/^(?=.{1,255}$)[0-9A-Za-z](?:(?:[0-9A-Za-z]|-){0,61}[0-9A-Za-z])?(?:\.[0-9A-Za-z](?:(?:[0-9A-Za-z]|-){0,61}[0-9A-Za-z])?)*\.?$/,"host-name":/^(?=.{1,255}$)[0-9A-Za-z](?:(?:[0-9A-Za-z]|-){0,61}[0-9A-Za-z])?(?:\.[0-9A-Za-z](?:(?:[0-9A-Za-z]|-){0,61}[0-9A-Za-z])?)*\.?$/,"utc-millisec":function(e){return typeof e=="string"&&parseFloat(e)===parseInt(e,10)&&!isNaN(e)},regex:function(e){var r=!0;try{new RegExp(e)}catch{r=!1}return r},style:/[\r\n\t ]*[^\r\n\t ][^:]*:[\r\n\t ]*[^\r\n\t ;]*[\r\n\t ]*;?/,color:/^(#?([0-9A-Fa-f]{3}){1,2}\b|aqua|black|blue|fuchsia|gray|green|lime|maroon|navy|olive|orange|purple|red|silver|teal|white|yellow|(rgb\(\s*\b([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\b\s*,\s*\b([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\b\s*,\s*\b([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])\b\s*\))|(rgb\(\s*(\d?\d%|100%)+\s*,\s*(\d?\d%|100%)+\s*,\s*(\d?\d%|100%)+\s*\)))$/,phone:/^\+(?:[0-9] ?){6,14}[0-9]$/,alpha:/^[a-zA-Z]+$/,alphanumeric:/^[a-zA-Z0-9]+$/};At.regexp=At.regex,At.pattern=At.regex,At.ipv4=At["ip-address"],vr.isFormat=function(r,t,n){if(typeof r=="string"&&At[t]!==void 0){if(At[t]instanceof RegExp)return At[t].test(r);if(typeof At[t]=="function")return At[t](r)}else if(n&&n.customFormats&&typeof n.customFormats[t]=="function")return n.customFormats[t](r);return!0};var yy=vr.makeSuffix=function(r){return r=r.toString(),!r.match(/[.\s\[\]]/)&&!r.match(/^[\d]/)?"."+r:r.match(/^\d+$/)?"["+r+"]":"["+JSON.stringify(r)+"]"};vr.deepCompareStrict=function e(r,t){if(typeof r!=typeof t)return!1;if(Array.isArray(r))return!Array.isArray(t)||r.length!==t.length?!1:r.every(function(i,o){return e(r[o],t[o])});if(typeof r=="object"){if(!r||!t)return r===t;var n=Object.keys(r),a=Object.keys(t);return n.length!==a.length?!1:n.every(function(i){return e(r[i],t[i])})}return r===t};function Rq(e,r,t,n){typeof t=="object"?r[n]=bl(e[n],t):e.indexOf(t)===-1&&r.push(t)}function zq(e,r,t){r[t]=e[t]}function Pq(e,r,t,n){typeof r[n]!="object"||!r[n]?t[n]=r[n]:e[n]?t[n]=bl(e[n],r[n]):t[n]=r[n]}function bl(e,r){var t=Array.isArray(r),n=t&&[]||{};return t?(e=e||[],n=n.concat(e),r.forEach(Rq.bind(null,e,n))):(e&&typeof e=="object"&&Object.keys(e).forEach(zq.bind(null,e,n)),Object.keys(r).forEach(Pq.bind(null,e,r,n))),n}vr.deepMerge=bl,vr.objectGetPath=function(r,t){for(var n=t.split("/").slice(1),a;typeof(a=n.shift())=="string";){var i=decodeURIComponent(a.replace(/~0/,"~").replace(/~1/g,"/"));if(!(i in r))return;r=r[i]}return r};function kq(e){return"/"+encodeURIComponent(e).replace(/~/g,"%7E")}vr.encodePath=function(r){return r.map(kq).join("")},vr.getDecimalPlaces=function(r){var t=0;if(isNaN(r))return t;typeof r!="number"&&(r=Number(r));var n=r.toString().split("e");if(n.length===2){if(n[1][0]!=="-")return t;t=Number(n[1].slice(1))}var a=n[0].split(".");return a.length===2&&(t+=a[1].length),t},vr.isSchema=function(r){return typeof r=="object"&&r||typeof r=="boolean"};var by=vr.resolveUrl=function(r,t){const n=new URL(t,new URL(r,"resolve://"));if(n.protocol==="resolve:"){const{pathname:a,search:i,hash:o}=n;return a+i+o}return n.toString()},tt=vr,Je=tt.ValidatorResult,An=tt.SchemaError,wl={};wl.ignoreProperties={id:!0,default:!0,description:!0,title:!0,additionalItems:!0,then:!0,else:!0,$schema:!0,$ref:!0,extends:!0};var Ye=wl.validators={};Ye.type=function(r,t,n,a){if(r===void 0)return null;var i=new Je(r,t,n,a),o=Array.isArray(t.type)?t.type:[t.type];if(!o.some(this.testType.bind(this,r,t,n,a))){var l=o.map(function(u){if(u){var s=u.$id||u.id;return s?"<"+s+">":u+""}});i.addError({name:"type",argument:l,message:"is not of a type(s) "+l})}return i};function xl(e,r,t,n,a){var i=r.throwError,o=r.throwAll;r.throwError=!1,r.throwAll=!1;var l=this.validateSchema(e,a,r,t);return r.throwError=i,r.throwAll=o,!l.valid&&n instanceof Function&&n(l),l.valid}Ye.anyOf=function(r,t,n,a){if(r===void 0)return null;var i=new Je(r,t,n,a),o=new Je(r,t,n,a);if(!Array.isArray(t.anyOf))throw new An("anyOf must be an array");if(!t.anyOf.some(xl.bind(this,r,n,a,function(u){o.importErrors(u)}))){var l=t.anyOf.map(function(u,s){var c=u.$id||u.id;return c?"<"+c+">":u.title&&JSON.stringify(u.title)||u.$ref&&"<"+u.$ref+">"||"[subschema "+s+"]"});n.nestedErrors&&i.importErrors(o),i.addError({name:"anyOf",argument:l,message:"is not any of "+l.join(",")})}return i},Ye.allOf=function(r,t,n,a){if(r===void 0)return null;if(!Array.isArray(t.allOf))throw new An("allOf must be an array");var i=new Je(r,t,n,a),o=this;return t.allOf.forEach(function(l,u){var s=o.validateSchema(r,l,n,a);if(!s.valid){var c=l.$id||l.id,f=c||l.title&&JSON.stringify(l.title)||l.$ref&&"<"+l.$ref+">"||"[subschema "+u+"]";i.addError({name:"allOf",argument:{id:f,length:s.errors.length,valid:s},message:"does not match allOf schema "+f+" with "+s.errors.length+" error[s]:"}),i.importErrors(s)}}),i},Ye.oneOf=function(r,t,n,a){if(r===void 0)return null;if(!Array.isArray(t.oneOf))throw new An("oneOf must be an array");var i=new Je(r,t,n,a),o=new Je(r,t,n,a),l=t.oneOf.filter(xl.bind(this,r,n,a,function(s){o.importErrors(s)})).length,u=t.oneOf.map(function(s,c){var f=s.$id||s.id;return f||s.title&&JSON.stringify(s.title)||s.$ref&&"<"+s.$ref+">"||"[subschema "+c+"]"});return l!==1&&(n.nestedErrors&&i.importErrors(o),i.addError({name:"oneOf",argument:u,message:"is not exactly one from "+u.join(",")})),i},Ye.if=function(r,t,n,a){if(r===void 0)return null;if(!tt.isSchema(t.if))throw new Error('Expected "if" keyword to be a schema');var i=xl.call(this,r,n,a,null,t.if),o=new Je(r,t,n,a),l;if(i){if(t.then===void 0)return;if(!tt.isSchema(t.then))throw new Error('Expected "then" keyword to be a schema');l=this.validateSchema(r,t.then,n,a.makeChild(t.then)),o.importErrors(l)}else{if(t.else===void 0)return;if(!tt.isSchema(t.else))throw new Error('Expected "else" keyword to be a schema');l=this.validateSchema(r,t.else,n,a.makeChild(t.else)),o.importErrors(l)}return o};function Nl(e,r){if(Object.hasOwnProperty.call(e,r))return e[r];if(r in e){for(;e=Object.getPrototypeOf(e);)if(Object.propertyIsEnumerable.call(e,r))return e[r]}}Ye.propertyNames=function(r,t,n,a){if(this.types.object(r)){var i=new Je(r,t,n,a),o=t.propertyNames!==void 0?t.propertyNames:{};if(!tt.isSchema(o))throw new An('Expected "propertyNames" to be a schema (object or boolean)');for(var l in r)if(Nl(r,l)!==void 0){var u=this.validateSchema(l,o,n,a.makeChild(o));i.importErrors(u)}return i}},Ye.properties=function(r,t,n,a){if(this.types.object(r)){var i=new Je(r,t,n,a),o=t.properties||{};for(var l in o){var u=o[l];if(u!==void 0){if(u===null)throw new An('Unexpected null, expected schema in "properties"');typeof n.preValidateProperty=="function"&&n.preValidateProperty(r,l,u,n,a);var s=Nl(r,l),c=this.validateSchema(s,u,n,a.makeChild(u,l));c.instance!==i.instance[l]&&(i.instance[l]=c.instance),i.importErrors(c)}}return i}};function wy(e,r,t,n,a,i){if(this.types.object(e)&&!(r.properties&&r.properties[a]!==void 0))if(r.additionalProperties===!1)i.addError({name:"additionalProperties",argument:a,message:"is not allowed to have the additional property "+JSON.stringify(a)});else{var o=r.additionalProperties||{};typeof t.preValidateProperty=="function"&&t.preValidateProperty(e,a,o,t,n);var l=this.validateSchema(e[a],o,t,n.makeChild(o,a));l.instance!==i.instance[a]&&(i.instance[a]=l.instance),i.importErrors(l)}}Ye.patternProperties=function(r,t,n,a){if(this.types.object(r)){var i=new Je(r,t,n,a),o=t.patternProperties||{};for(var l in r){var u=!0;for(var s in o){var c=o[s];if(c!==void 0){if(c===null)throw new An('Unexpected null, expected schema in "patternProperties"');try{var f=new RegExp(s,"u")}catch{f=new RegExp(s)}if(f.test(l)){u=!1,typeof n.preValidateProperty=="function"&&n.preValidateProperty(r,l,c,n,a);var m=this.validateSchema(r[l],c,n,a.makeChild(c,l));m.instance!==i.instance[l]&&(i.instance[l]=m.instance),i.importErrors(m)}}}u&&wy.call(this,r,t,n,a,l,i)}return i}},Ye.additionalProperties=function(r,t,n,a){if(this.types.object(r)){if(t.patternProperties)return null;var i=new Je(r,t,n,a);for(var o in r)wy.call(this,r,t,n,a,o,i);return i}},Ye.minProperties=function(r,t,n,a){if(this.types.object(r)){var i=new Je(r,t,n,a),o=Object.keys(r);return o.length>=t.minProperties||i.addError({name:"minProperties",argument:t.minProperties,message:"does not meet minimum property length of "+t.minProperties}),i}},Ye.maxProperties=function(r,t,n,a){if(this.types.object(r)){var i=new Je(r,t,n,a),o=Object.keys(r);return o.length<=t.maxProperties||i.addError({name:"maxProperties",argument:t.maxProperties,message:"does not meet maximum property length of "+t.maxProperties}),i}},Ye.items=function(r,t,n,a){var i=this;if(this.types.array(r)&&t.items!==void 0){var o=new Je(r,t,n,a);return r.every(function(l,u){if(Array.isArray(t.items))var s=t.items[u]===void 0?t.additionalItems:t.items[u];else var s=t.items;if(s===void 0)return!0;if(s===!1)return o.addError({name:"items",message:"additionalItems not permitted"}),!1;var c=i.validateSchema(l,s,n,a.makeChild(s,u));return c.instance!==o.instance[u]&&(o.instance[u]=c.instance),o.importErrors(c),!0}),o}},Ye.contains=function(r,t,n,a){var i=this;if(this.types.array(r)&&t.contains!==void 0){if(!tt.isSchema(t.contains))throw new Error('Expected "contains" keyword to be a schema');var o=new Je(r,t,n,a),l=r.some(function(u,s){var c=i.validateSchema(u,t.contains,n,a.makeChild(t.contains,s));return c.errors.length===0});return l===!1&&o.addError({name:"contains",argument:t.contains,message:"must contain an item matching given schema"}),o}},Ye.minimum=function(r,t,n,a){if(this.types.number(r)){var i=new Je(r,t,n,a);return t.exclusiveMinimum&&t.exclusiveMinimum===!0?r>t.minimum||i.addError({name:"minimum",argument:t.minimum,message:"must be greater than "+t.minimum}):r>=t.minimum||i.addError({name:"minimum",argument:t.minimum,message:"must be greater than or equal to "+t.minimum}),i}},Ye.maximum=function(r,t,n,a){if(this.types.number(r)){var i=new Je(r,t,n,a);return t.exclusiveMaximum&&t.exclusiveMaximum===!0?rt.exclusiveMinimum;return o||i.addError({name:"exclusiveMinimum",argument:t.exclusiveMinimum,message:"must be strictly greater than "+t.exclusiveMinimum}),i}},Ye.exclusiveMaximum=function(r,t,n,a){if(typeof t.exclusiveMaximum!="boolean"&&this.types.number(r)){var i=new Je(r,t,n,a),o=r=t.minLength||i.addError({name:"minLength",argument:t.minLength,message:"does not meet minimum length of "+t.minLength}),i}},Ye.maxLength=function(r,t,n,a){if(this.types.string(r)){var i=new Je(r,t,n,a),o=r.match(/[\uDC00-\uDFFF]/g),l=r.length-(o?o.length:0);return l<=t.maxLength||i.addError({name:"maxLength",argument:t.maxLength,message:"does not meet maximum length of "+t.maxLength}),i}},Ye.minItems=function(r,t,n,a){if(this.types.array(r)){var i=new Je(r,t,n,a);return r.length>=t.minItems||i.addError({name:"minItems",argument:t.minItems,message:"does not meet minimum length of "+t.minItems}),i}},Ye.maxItems=function(r,t,n,a){if(this.types.array(r)){var i=new Je(r,t,n,a);return r.length<=t.maxItems||i.addError({name:"maxItems",argument:t.maxItems,message:"does not meet maximum length of "+t.maxItems}),i}};function qq(e,r,t){var n,a=t.length;for(n=r+1,a;n already exists with different definition");return o[m]}o[m]=s,m[m.length-1]=="#"&&(o[m.substring(0,m.length-1)]=s)}a(m+"/items",Array.isArray(s.items)?s.items:[s.items]),a(m+"/extends",Array.isArray(s.extends)?s.extends:[s.extends]),n(m+"/additionalItems",s.additionalItems),i(m+"/properties",s.properties),n(m+"/additionalProperties",s.additionalProperties),i(m+"/definitions",s.definitions),i(m+"/patternProperties",s.patternProperties),i(m+"/dependencies",s.dependencies),a(m+"/disallow",s.disallow),a(m+"/allOf",s.allOf),a(m+"/anyOf",s.anyOf),a(m+"/oneOf",s.oneOf),n(m+"/not",s.not)}function a(u,s){if(Array.isArray(s))for(var c=0;c"u"}),this.schemas[i]},Er.prototype.addSubSchemaArray=function(r,t){if(Array.isArray(t))for(var n=0;n",r);var l=En.objectGetPath(n.schemas[o],i.substr(1));if(l===void 0)throw new fi("no such schema "+i+" located in <"+o+">",r);return{subschema:l,switchSchema:t}},Er.prototype.testType=function(r,t,n,a,i){if(i!==void 0){if(i===null)throw new fi('Unexpected null in "type" keyword');if(typeof this.types[i]=="function")return this.types[i].call(this,r);if(i&&typeof i=="object"){var o=this.validateSchema(r,i,n,a);return o===void 0||!(o&&o.errors.length)}return!0}};var Ot=Er.prototype.types={};Ot.string=function(r){return typeof r=="string"},Ot.number=function(r){return typeof r=="number"&&isFinite(r)},Ot.integer=function(r){return typeof r=="number"&&r%1===0},Ot.boolean=function(r){return typeof r=="boolean"},Ot.array=function(r){return Array.isArray(r)},Ot.null=function(r){return r===null},Ot.date=function(r){return r instanceof Date},Ot.any=function(r){return!0},Ot.object=function(r){return r&&typeof r=="object"&&!Array.isArray(r)&&!(r instanceof Date)};var Hq=Er,My;My=Hq,vr.ValidatorResult,vr.ValidatorResultError,vr.ValidationError,vr.SchemaError;function Zq(e,r){const t=new My,n={additionalProperties:!1,properties:{input:{items:{oneOf:[{additionalProperties:!1,properties:{defaultValue:{required:!0,type:"number"},id:{type:"string"},name:{required:!0,type:"string"},possibleValues:{items:{additionalProperties:!1,properties:{name:{required:!0,type:"string"},value:{required:!0,type:"number"}},type:"object"},minItems:1,required:!0,type:"array"},visible:{type:"string"}}},{additionalProperties:!1,properties:{defaultValue:{required:!0,type:"number"},id:{type:"string"},maximumValue:{required:!0,type:"number"},minimumValue:{required:!0,type:"number"},name:{required:!0,type:"string"},stepValue:{type:"number"},visible:{type:"string"}}}],type:"object"},minItems:1,required:!0,type:"array"},output:{additionalProperties:!1,minItems:1,properties:{data:{items:{additionalProperties:!1,properties:{id:{required:!0,type:"string"},name:{required:!0,type:"string"}},type:"object"},minItems:1,required:!0,type:"array"},plots:{items:{additionalProperties:!1,properties:{xAxisTitle:{required:!0,type:"string"},xValue:{required:!0,type:"string"},yAxisTitle:{required:!0,type:"string"},yValue:{required:!0,type:"string"}},type:"object"},maxItems:9,minItems:1,required:!0,type:"array"}},required:!0,type:"object"},parameters:{items:{additionalProperties:!1,properties:{name:{required:!0,type:"string"},value:{required:!0,type:"string"}},type:"object"},type:"array"},simulation:{additionalProperties:!1,properties:{opencor:{additionalProperties:!1,properties:{endingPoint:{type:"number"},pointInterval:{type:"number"},resource:{required:!0,type:"string"}},type:"object"},solvers:{items:{additionalProperties:!1,properties:{if:{type:"string"},input:{additionalProperties:!1,properties:{name:{required:!0,type:"string"},value:{required:!0,type:"string"}},type:"object"},name:{required:!0,type:"string"},version:{required:!0,type:"string"}},type:"object"},minItems:1,required:!0,type:"array"}},required:r,type:"object"}},type:"object"},a=t.validate(e,n,{nestedErrors:!0});if(!a.valid)return console.warn(a.toString()),!1;const i={};if(!e.input.every(c=>{if(c.id!==void 0){if(c.id==="")return console.warn("JSON: the input id must not be empty."),!1;if(i[c.id]!==void 0)return console.warn("JSON: the input id must be unique ("+c.id+" is used more than once)."),!1;i[c.id]=!0}if(c.name==="")return console.warn("JSON: the input name must not be empty."),!1;if(c.possibleValues!==void 0){if(!c.possibleValues.every(p=>p.name===""?(console.warn("JSON: an input possible value must not be empty."),!1):!0))return!1;const f=c.possibleValues.map(p=>p.value),m={};if(!f.every(p=>m[p]!==void 0?(console.warn("JSON: an input possible value must have a unique value ("+p+" is used more than once)."),!1):(m[p]=!0,!0)))return!1;if(!f.includes(c.defaultValue))return console.warn("JSON: the input default value ("+c.defaultValue+") must be one of the possible values ("+f.join(", ")+")."),!1}if(c.minimumValue!==void 0&&c.maximumValue!==void 0){if(c.minimumValue>=c.maximumValue)return console.warn("JSON: the input minimum value ("+c.minimumValue+") must be lower than the maximum value ("+c.maximumValue+")."),!1;if(c.defaultValuec.maximumValue)return console.warn("JSON: the input default value ("+c.defaultValue+") must be greater or equal than the minimum value ("+c.minimumValue+") and lower or equal than the maximum value ("+c.maximumValue+")."),!1;const f=c.maximumValue-c.minimumValue;if(c.stepValue!==void 0){if(c.stepValue<=0||c.stepValue>f)return console.warn("JSON: the input step value ("+c.stepValue+") must be greater than zero and lower or equal than the range value ("+f+")."),!1;if(!Number.isInteger(f/c.stepValue))return console.warn("JSON: the input step value ("+c.stepValue+") must be a factor of the range value ("+f+")."),!1}else if(!Number.isInteger(f))return console.warn("JSON: the (default) input step value (1) must be a factor of the range value ("+f+")."),!1}return c.visible!==void 0&&c.visible===""?(console.warn("JSON: the input visible must not be empty."),!1):!0}))return!1;const l={};if(!e.output.data.every(c=>{if(c.id!==void 0){if(c.id==="")return console.warn("JSON: the output data id must not be empty."),!1;if(l[c.id]!==void 0)return console.warn("JSON: the output data id must be unique ("+c.id+" is used more than once)."),!1;l[c.id]=!0}return c.name===""?(console.warn("JSON: the output data name must not be empty."),!1):!0})||!e.output.plots.every(c=>c.xAxisTitle===""?(console.warn("JSON: the output plot X axis title must not be empty."),!1):c.xValue===""?(console.warn("JSON: the output plot X value must not be empty."),!1):c.yAxisTitle===""?(console.warn("JSON: the output plot Y axis title must not be empty."),!1):c.yValue===""?(console.warn("JSON: the output plot Y value must not be empty."),!1):!0)||e.parameters!==void 0&&!e.parameters.every(f=>f.name===""?(console.warn("JSON: the parameter name must not be empty."),!1):f.value===""?(console.warn("JSON: the parameter value must not be empty."),!1):!0))return!1;if(r){let c=!1;if(!e.simulation.solvers.every(f=>{if(f.if!==void 0&&f.if==="")return console.warn("JSON: a simulation solver if must not be empty."),!1;if(f.input!==void 0){if(f.input.name==="")return console.warn("JSON: a simulation solver input name must not be empty."),!1;if(f.input.value==="")return console.warn("JSON: a simulation solver input value must not be empty."),!1}return f.name===""?(console.warn("JSON: a simulation solver name must not be empty."),!1):(c=c||f.name===my,f.version===""?(console.warn("JSON: a simulation solver version must not be empty."),!1):!0)}))return!1;if(c&&e.simulation.opencor===void 0)return console.warn("JSON: the simulation solver for OpenCOR is specified so simulation OpenCOR settings must also be specified."),!1;if(e.simulation.opencor!==void 0){if(e.simulation.opencor.resource==="")return console.warn("JSON: the simulation OpenCOR resource must not be empty."),!1;if(e.simulation.opencor.endingPoint!==void 0)if(e.simulation.opencor.pointInterval!==void 0){if(e.simulation.opencor.endingPoint<=0)return console.warn("JSON: the simulation OpenCOR ending point ("+e.simulation.opencor.endingPoint+") must be greater than zero."),!1;if(e.simulation.opencor.pointInterval<=0)return console.warn("JSON: the simulation OpenCOR point interval ("+e.simulation.opencor.pointInterval+") must be greater than zero."),!1}else return console.warn("JSON: a simulation OpenCOR ending point is specified so a simulation OpenCOR point interval must also be specified."),!1;else if(e.simulation.opencor.pointInterval!==void 0)return console.warn("JSON: a simulation OpenCOR point interval is specified so a simulation OpenCOR ending point must also be specified."),!1}}return!0}const Gq="libOpenCOR",Wq="oSPARC",Dl="https://models.physiomeproject.org/",jq=vl(fy,{}),Dn=Object.freeze({DATASET_ID:"dataset_id",DATASET_URL:"dataset_url",PMR_PATH:"pmr_path",RAW_COMBINE_ARCHIVE:"raw_combine_archive"}),Kq={LIBOPENCOR_SOLVER:Gq,OSPARC_SOLVER:Wq,name:"SimulationVuer",components:{PlotVuer:_y.PlotVuer,SimulationVuerInput:hy,ElButton:im,ElDivider:um,ElLoading:JD},props:{apiLocation:{required:!0,type:String},id:{required:!0,type:[Number,String,Uint8Array]}},data:function(){let e;if(typeof this.id=="number"?e=Dn.DATASET_ID:this.id instanceof Uint8Array?e=Dn.RAW_COMBINE_ARCHIVE:this.id.startsWith("https://")?e=Dn.DATASET_URL:e=Dn.PMR_PATH,e===Dn.DATASET_ID){const r=new XMLHttpRequest;r.open("GET",this.apiLocation+"/sim/dataset/"+this.id),r.onreadystatechange=()=>{if(r.readyState===4&&r.status===200){const t=JSON.parse(r.responseText);this.name=t.name,this.uuid=t.study!==void 0?t.study.uuid:void 0}},r.send()}return{errorMessage:"",fileManager:void 0,hasFinalisedUi:!1,hasValidSimulationUiInfo:!1,idType:e,instance:void 0,isMounted:!1,isSimulationValid:!0,layout:[],libopencor:void 0,libopencorSet:!1,model:void 0,name:null,opencorBasedSimulation:!0,output:void 0,perfectScollbarOptions:{suppressScrollX:!0},showUserMessage:!1,simulationResults:{},simulationResultsId:{},simulationUiInfo:{},solver:void 0,userMessage:"",ui:null,uuid:null}},methods:{plotMetadata(e){return{version:"1.1.0",type:"plot",attrs:{style:"timeseries",layout:this.layout[e]}}},manageFile(e,r){let t=this.fileManager.file(e);t===null&&(t=new this.libopencor.File(e));const n=this.libopencor._malloc(r.length);return new Uint8Array(this.libopencor.HEAPU8.buffer,n,r.length).set(r),t.setContents(n,r.length),this.libopencor._free(n),t},runSimulation(){if(this.instance===void 0){const a=new this.libopencor.SedDocument(this.fileManager.file(Dl+this.id));this.model=d.markRaw(a.model()),this.instance=d.markRaw(a.instantiate()),a.delete()}this.model.removeAllChanges();for(const[a,i]of Object.entries(this.parametersData())){const o=a.split("/");this.model.addChange(new this.libopencor.SedChangeAttribute(o[0],o[1],i.toString()))}this.instance.run();const e={},r=this.instance.task(0);let t=!0,n;for(const a of this.outputData()){if(n=!1,a===r.voiName&&(e[a]=r.voiAsArray,n=!0),e[a]===void 0){for(let i=0;i{(t.if===void 0||hl(this,t.if))&&(this.solver=t)}),this.solver===void 0){this.hasValidSimulationUiInfo=!1,this.errorMessage="no solver name and/or solver version specified";return}this.opencorBasedSimulation=this.solver.name===my}this.simulationUiInfo.output.data.forEach(t=>{this.simulationResultsId[t.id]=t.name});let r=-1;this.simulationUiInfo.output.plots.forEach(t=>{++r,this.layout[r]={paper_bgcolor:"rgba(0, 0, 0, 0)",plot_bgcolor:"rgba(0, 0, 0, 0)",autosize:!0,margin:{t:25,l:55,r:25,b:30,pad:4},loading:!1,options:{responsive:!0,scrollZoom:!0},dragmode:"pan",xaxis:{title:{text:t.xAxisTitle,font:{size:10}}},yaxis:{title:{text:t.yAxisTitle,font:{size:10}}}}}),this.$nextTick(()=>{py(this)})},extractAndBuildSimulationUi(e,r){this.libopencor=d.markRaw(e),this.libopencorSet=!0,this.fileManager=d.markRaw(this.libopencor.FileManager.instance());const t=this.manageFile(Dl+this.id,r);if(t.type.value!==e.File.Type.COMBINE_ARCHIVE.value)this.showUserMessage=!1;else{const n=new TextDecoder,a=t.childFileFromFileName("simulation.json");if(a===null)this.errorMessage="no simulation JSON file could be found",this.showUserMessage=!1;else{const i=JSON.parse(n.decode(a.contents()));this.showUserMessage=!1,this.$nextTick(()=>{this.buildSimulationUi(i)})}}},runOnOsparc(){window.open(`https://osparc.io/study/${this.uuid}`,"_blank")},viewDataset(){window.open(`https://sparc.science/datasets/${this.id}?type=dataset`,"_blank")},viewWorkspace(){const e=Dl+this.id;window.open(e.substring(0,e.lastIndexOf("/")),"_blank")},parametersData(){const e={};return this.simulationUiInfo.parameters.forEach(r=>{e[r.name]=hl(this,r.value)}),e},outputData(){return this.output===void 0&&this.simulationUiInfo.output.data!==void 0&&(this.output=[],this.simulationUiInfo.output.data.forEach(e=>{this.output.push(e.name)})),this.output},retrieveRequest(){const e={solver:this.solver};if(this.opencorBasedSimulation){e.opencor={model_url:this.simulationUiInfo.simulation.opencor.resource,json_config:{}},this.simulationUiInfo.simulation.opencor.endingPoint!==void 0&&this.simulationUiInfo.simulation.opencor.pointInterval!==void 0&&(e.opencor.json_config.simulation={"Ending point":this.simulationUiInfo.simulation.opencor.endingPoint,"Point interval":this.simulationUiInfo.simulation.opencor.pointInterval}),e.opencor.json_config.parameters=this.parametersData();const r=this.outputData();r!==void 0&&(e.opencor.json_config.output=r)}else e.osparc={},e.osparc.job_inputs=this.parametersData();return e},processSimulationResults(e){if(typeof e=="string"){const n=/[ \t]+/g,a=e.trim().split(` `),i=a[0].trim().split(n).length;e={};for(let l=0;l{++o;let u=-1;l.trim().split(n).forEach(c=>{e[++u][o]=Number(c)})})}const r=new jq.parser;Object.keys(this.simulationResultsId).forEach(n=>{r.set(n,e[this.simulationResultsId[n]])});let t=-1;this.simulationUiInfo.output.plots.forEach(n=>{this.simulationResults[++t]=[{x:r.evaluate(n.xValue),y:r.evaluate(n.yValue),type:"scatter"}]})},showHttpIssue(e){this.isSimulationValid=!1,this.showUserMessage=!1,this.errorMessage=e.statusText.toLowerCase()+" ("+e.status+")"},checkSimulation(e){const r=new XMLHttpRequest;r.open("POST",this.apiLocation+"/check_simulation"),r.setRequestHeader("Content-type","application/json"),r.onreadystatechange=()=>{if(r.readyState===4)if(r.status===200){let t=JSON.parse(r.responseText);if(this.isSimulationValid=t.status==="ok",this.isSimulationValid)if(t.results!==void 0)this.showUserMessage=!1,this.processSimulationResults(t.results);else{let n=this;setTimeout(function(){n.checkSimulation(e)},1e3)}else this.showUserMessage=!1,this.errorMessage=t.description}else this.showHttpIssue(r)},r.send(JSON.stringify(e))},startSimulation(){this.userMessage="Loading simulation results...",this.showUserMessage=!0,this.$nextTick(()=>{this.simulationResults={};const e=new XMLHttpRequest;e.open("POST",this.apiLocation+"/start_simulation"),e.setRequestHeader("Content-type","application/json"),e.onreadystatechange=()=>{if(e.readyState===4)if(e.status===200){let r=JSON.parse(e.responseText);this.isSimulationValid=r.status==="ok",this.isSimulationValid?this.checkSimulation(r.data):(this.showUserMessage=!1,this.errorMessage=r.description)}else this.showHttpIssue(e)},e.send(JSON.stringify(this.retrieveRequest()))})}},created:function(){this.idType===Dn.DATASET_ID?(this.userMessage="Retrieving UI information...",this.showUserMessage=!0,this.$nextTick(()=>{const e=new XMLHttpRequest;e.open("GET",this.apiLocation+"/simulation_ui_file/"+this.id),e.onreadystatechange=()=>{e.readyState===4&&(this.showUserMessage=!1,e.status===200?this.$nextTick(()=>{this.buildSimulationUi(JSON.parse(e.responseText))}):this.errorMessage="the simulation dataset could not be retrieved")},e.send()})):this.idType===Dn.DATASET_URL?(this.userMessage="Retrieving COMBINE archive...",this.showUserMessage=!0,this.$nextTick(()=>{const e=new XMLHttpRequest;e.open("GET",this.id),e.responseType="arraybuffer",e.onreadystatechange=()=>{e.readyState===4&&(e.status===200?ns().then(r=>{this.extractAndBuildSimulationUi(r,new Uint8Array(e.response))}):(this.errorMessage="the COMBINE archive could not be retrieved",this.showUserMessage=!1))},e.send()})):this.idType===Dn.PMR_PATH?(this.userMessage="Retrieving COMBINE archive from PMR...",this.showUserMessage=!0,this.$nextTick(()=>{const e=new XMLHttpRequest;e.open("POST",this.apiLocation+"/pmr_file"),e.setRequestHeader("Content-type","application/json"),e.onreadystatechange=()=>{e.readyState===4&&(e.status===200?ns().then(r=>{this.extractAndBuildSimulationUi(r,Uint8Array.from(atob(e.response),t=>t.charCodeAt(0)))}):(this.errorMessage="the COMBINE archive chould not be retrieved from PMR",this.showUserMessage=!1))},e.send(JSON.stringify({path:this.id}))})):(this.userMessage="Retrieving COMBINE archive...",this.showUserMessage=!0,this.$nextTick(()=>{ns().then(e=>{this.extractAndBuildSimulationUi(e,this.id)})}))},mounted:function(){this.isMounted=!0,py(this)}},Jq=["element-loading-text"],Yq={key:0,class:"default error"},Xq={key:1,class:"main"},Qq={class:"main-left"},eL={key:0,class:"default name"},rL={class:"input scrollbar"},tL={key:2,class:"primary-button"},nL={key:3,class:"secondary-button"},aL={key:4,class:"secondary-button"},iL={key:5,class:"secondary-button"},oL={key:6,class:"default note"},sL={class:"main-right",ref:"output"},uL={class:"main-right"},lL={class:"default error"},cL=["innerHTML"];function fL(e,r,t,n,a,i){const o=um,l=hy,u=im,s=d.resolveComponent("PlotVuer"),c=uu;return d.withDirectives((d.openBlock(),d.createElementBlock("div",{class:"simulation-vuer","element-loading-text":e.userMessage},[!e.hasValidSimulationUiInfo&&!e.showUserMessage?(d.openBlock(),d.createElementBlock("p",Yq,[r[4]||(r[4]=d.createElementVNode("span",{class:"error"},"Error:",-1)),d.createTextVNode(" "+d.toDisplayString(e.errorMessage)+".",1)])):d.createCommentVNode("",!0),e.hasValidSimulationUiInfo?(d.openBlock(),d.createElementBlock("div",Xq,[d.createElementVNode("div",Qq,[e.libopencorSet?d.createCommentVNode("",!0):(d.openBlock(),d.createElementBlock("p",eL,d.toDisplayString(e.name),1)),e.libopencorSet?d.createCommentVNode("",!0):(d.openBlock(),d.createBlock(o,{key:1})),r[9]||(r[9]=d.createElementVNode("p",{class:"default input-parameters"},"Input parameters",-1)),d.createElementVNode("div",rL,[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(e.simulationUiInfo.input,(f,m)=>(d.openBlock(),d.createBlock(l,{ref_for:!0,ref:"simInput",defaultValue:f.defaultValue,key:`input-${m}`,name:f.name,maximumValue:f.maximumValue,minimumValue:f.minimumValue,possibleValues:f.possibleValues,stepValue:f.stepValue},null,8,["defaultValue","name","maximumValue","minimumValue","possibleValues","stepValue"]))),128))]),e.libopencorSet?d.createCommentVNode("",!0):(d.openBlock(),d.createElementBlock("div",tL,[d.createVNode(u,{type:"primary",size:"small",onClick:r[0]||(r[0]=f=>i.startSimulation())},{default:d.withCtx(()=>[...r[5]||(r[5]=[d.createTextVNode("Run Simulation",-1)])]),_:1})])),e.uuid?(d.openBlock(),d.createElementBlock("div",nL,[d.createVNode(u,{size:"small",onClick:r[1]||(r[1]=f=>i.runOnOsparc())},{default:d.withCtx(()=>[...r[6]||(r[6]=[d.createTextVNode("Run on oSPARC",-1)])]),_:1})])):d.createCommentVNode("",!0),e.libopencorSet?d.createCommentVNode("",!0):(d.openBlock(),d.createElementBlock("div",aL,[d.createVNode(u,{size:"small",onClick:r[2]||(r[2]=f=>i.viewDataset())},{default:d.withCtx(()=>[...r[7]||(r[7]=[d.createTextVNode("View Dataset",-1)])]),_:1})])),e.libopencorSet&&e.idType==="pmr_path"?(d.openBlock(),d.createElementBlock("div",iL,[d.createVNode(u,{size:"small",onClick:r[3]||(r[3]=f=>i.viewWorkspace())},{default:d.withCtx(()=>[...r[8]||(r[8]=[d.createTextVNode("View Workspace",-1)])]),_:1})])):d.createCommentVNode("",!0),e.uuid?(d.openBlock(),d.createElementBlock("p",oL,"Additional parameters are available on oSPARC")):d.createCommentVNode("",!0)]),d.withDirectives(d.createElementVNode("div",sL,[(d.openBlock(!0),d.createElementBlock(d.Fragment,null,d.renderList(e.simulationUiInfo.output.plots,(f,m)=>(d.openBlock(),d.createBlock(s,{key:`output-${m}`,metadata:i.plotMetadata(m),"data-source":{data:e.simulationResults[m]},plotLayout:e.layout[m],plotType:"plotly-only",selectorUi:!1},null,8,["metadata","data-source","plotLayout"]))),128))],512),[[d.vShow,e.isSimulationValid]]),d.withDirectives(d.createElementVNode("div",uL,[d.createElementVNode("p",lL,[r[10]||(r[10]=d.createElementVNode("span",{class:"error"},"Error:",-1)),r[11]||(r[11]=d.createTextVNode()),d.createElementVNode("span",{innerHTML:e.errorMessage},null,8,cL),r[12]||(r[12]=d.createTextVNode(".",-1))])],512),[[d.vShow,!e.isSimulationValid]])])):d.createCommentVNode("",!0)],8,Jq)),[[c,e.showUserMessage]])}const mL=vy(Kq,[["render",fL],["__scopeId","data-v-295b46c4"]]);Dr.SimulationVuer=mL,Object.defineProperty(Dr,Symbol.toStringTag,{value:"Module"})});