Files
cours/.obsidian/plugins/obsidian-meta-bind-plugin/main.js

204 lines
1.3 MiB

/*
-------------------------------------------
Meta Bind - Release Build
-------------------------------------------
By: Moritz Jung (https://www.moritzjung.dev/)
Time: Tue, 12 Aug 2025 08:58:39 GMT
Version: 1.4.5
-------------------------------------------
THIS IS A GENERATED/BUNDLED FILE BY ESBUILD
if you want to view the source, please visit the github repository of this plugin
-------------------------------------------
Copyright (C) 2025 Moritz Jung
-------------------------------------------
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
"use strict";var cG=Object.create;var km=Object.defineProperty;var fG=Object.getOwnPropertyDescriptor;var pG=Object.getOwnPropertyNames;var mG=Object.getPrototypeOf,dG=Object.prototype.hasOwnProperty;var jn=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),hs=(t,e)=>{for(var r in e)km(t,r,{get:e[r],enumerable:!0})},NT=(t,e,r,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of pG(e))!dG.call(t,n)&&n!==r&&km(t,n,{get:()=>e[n],enumerable:!(i=fG(e,n))||i.enumerable});return t};var Ar=(t,e,r)=>(r=t!=null?cG(mG(t)):{},NT(e||!t||!t.__esModule?km(r,"default",{value:t,enumerable:!0}):r,t)),hG=t=>NT(km({},"__esModule",{value:!0}),t);var Bm=jn(Yi=>{"use strict";Object.defineProperty(Yi,"__esModule",{value:!0});Yi.P_HELPERS=Yi.ParserHelpers=Yi.validateRegexFlags=Yi.validateRange=Yi.getIndex=Yi.arrayUnion=void 0;var Cx=Om();function gG(t,e){if(t===void 0&&e===void 0)return;if(t===void 0)return e;if(e===void 0)return t;let r=[...t];for(let i of e)r.includes(i)||r.push(i);return r}Yi.arrayUnion=gG;function vG(t){return t===void 0?-1:t.index}Yi.getIndex=vG;function yG(t,e){if(e<t)throw new Error(`Invalid Range: max might not be smaller than min. Received [${t}, ${e}].`);if(t<0||e<0)throw new Error(`Invalid Range: max and min might not be smaller than 0. Received [${t}, ${e}].`);if(t===1/0||e===1/0)throw new Error(`Invalid Range: max and min might not be infinity. Received [${t}, ${e}].`);if(!Number.isInteger(t)||!Number.isInteger(e))throw new Error(`Invalid Range: max and min must be integers. Received [${t}, ${e}].`)}Yi.validateRange=yG;function bG(t){for(let e of t)if(e!=="i"&&e!=="m"&&e!=="s"&&e!=="u")throw new Error(`RegExp flag '${e}' is not allowed. The only allowed flags are 'i', 'm', 's' and 'u'.`)}Yi.validateRegexFlags=bG;var Pm=class{followedBy(e){return new Cx.Parser(function(i){return e.p(i.copy())})}notFollowedBy(e){return new Cx.Parser(function(i){let n=i.copy(),o=e.p(n),a=i.sliceTo(n.position.index);return o.success?i.fail("not '"+a+"'"):i.succeed(void 0)})}test(e){return new Cx.Parser(function(i){let n=i.input[i.position.index];return!i.atEOF()&&e(n)?i.succeedOffset(1,n):i.fail(`a character matching ${e}`)})}};Yi.ParserHelpers=Pm;Yi.P_HELPERS=new Pm});var MT=jn(Rm=>{"use strict";Object.defineProperty(Rm,"__esModule",{value:!0});Rm.ParserContext=void 0;var $x=Bm(),Ix=class t{constructor(e,r){this.input=e,this.position=r}moveToPosition(e){return this.position=e,this}copy(){return new t(this.input,{index:this.position.index,column:this.position.column,line:this.position.line})}getPosition(){return{index:this.position.index,column:this.position.column,line:this.position.line}}atEOF(){return this.position.index>=this.input.length}advanceTo(e){if(e<this.position.index)throw new Error(`Can not advance backwards. Current pos ${this.position.index}. Advance target index ${e}.`);if(e!==this.position.index){for(let r=this.position.index;r<e;r++)this.input[r]===`
`?(this.position.line+=1,this.position.column=1):this.position.column+=1;this.position.index=e}}sliceTo(e){return this.input.slice(this.position.index,e)}succeedOffset(e,r){return this.succeedAt(this.position.index+e,r)}failOffset(e,r){return this.failAt(this.position.index+e,r)}succeed(e){return this.succeedAt(this.position.index,e)}fail(e){return this.failAt(this.position.index,e)}succeedAt(e,r){return this.advanceTo(e),{success:!0,value:r,furthest:void 0,expected:void 0}}failAt(e,r){return this.advanceTo(e),{success:!1,value:void 0,furthest:this.position,expected:Array.isArray(r)?r:[r]}}merge(e,r){if(e===void 0)return r;let i=(0,$x.getIndex)(e.furthest),n=(0,$x.getIndex)(r.furthest);if(n>i)return r;let o=n===i?(0,$x.arrayUnion)(e.expected,r.expected):e.expected;return r.furthest=e.furthest,r.expected=o,r}};Rm.ParserContext=Ix});var Ji=jn(Um=>{"use strict";Object.defineProperty(Um,"__esModule",{value:!0});Um.P=void 0;var vo=Om(),Lm=Bm(),Fx=class t{static sequence(...e){if(e.length===0)throw new Error("sequence must have at least one parser argument");return new vo.Parser(function(i){let n,o=new Array(e.length);for(let a=0;a<e.length;a++){let l=e[a].p(i);if(n=i.merge(n,l),!n.success)return n;o[a]=n.value}return n.value=o,n})}static sequenceMap(e,...r){if(r.length===0)throw new Error("sequenceMap must have at least one parser argument");return new vo.Parser(function(n){let o,a=new Array(r.length);for(let s=0;s<r.length;s++){let u=r[s].p(n);if(o=n.merge(o,u),!o.success)return o;a[s]=o.value}return o.value=e(...a),o})}static createLanguage(e){let r={},i={},n={};for(let o in e)n[o]=t.reference(()=>e[o](r,n)),Object.defineProperty(i,o,{get:()=>{if(r[o]!==void 0)return r[o];throw new Error(`Can not access rule '${o}' in language. Rule is not yet defined. Try to access it via 'ref'.`)}});for(let o in e)r[o]=e[o](i,n);return r}static or(...e){if(e.length===0)throw new Error("or must have at least one alternative");return new vo.Parser(function(i){let n;for(let o of e){let a=o,s=i.copy(),l=a.p(s);if(n=i.merge(n,l),n.success)return i.moveToPosition(s.position),n}return n})}static separateBy(e,r){return this.separateByNotEmpty(e,r).or(t.succeed([]))}static separateByNotEmpty(e,r){return this.sequenceMap(function(n,o){return o.unshift(n),o},e,r.then(e).many())}static string(e){let r="'"+e+"'";return new vo.Parser(function(n){for(let o=0;o<e.length;o++)if(n.input[n.position.index+o]!==e[o])return n.fail(r);return n.succeedAt(n.position.index+e.length,e)})}static regexp(e,r){(0,Lm.validateRegexFlags)(e.flags);let i=e.source;return r!==void 0?new vo.Parser(function(o){let a=o.input.slice(o.position.index),s=e.exec(a);if(s!==null){let l=r??0;if(l>=0&&l<=s.length){let c=s[0],f=s[l];return o.succeedOffset(c.length,f)}let u="expected valid match group (0 to "+s.length+") in "+i;return o.fail(u)}else return o.fail(i)}):new vo.Parser(function(o){let a=o.input.slice(o.position.index),s=e.exec(a);if(s!==null){let l=s[0];return o.succeedOffset(l.length,l)}else return o.fail(i)})}static succeed(e){return new vo.Parser(function(i){return i.succeed(e)})}static fail(e){return new vo.Parser(function(i){return i.fail(e)})}static oneOf(e){return Lm.P_HELPERS.test(function(i){return e.includes(i)}).describe(`one character of '${e}'`)}static noneOf(e){return Lm.P_HELPERS.test(function(i){return!e.includes(i)}).describe(`no character of '${e}'`)}static oneStringOf(e){return this.or(...e.map(r=>this.string(r))).describe(e.map(r=>`'${r}'`).join(" or "))}static manyOf(e){return new vo.Parser(function(i){let n=i.position.index;for(;n<i.input.length&&e.includes(i.input[n]);n++);return i.succeedAt(n,i.sliceTo(n))})}static manyNotOf(e){return new vo.Parser(function(i){let n=i.position.index;for(;n<i.input.length&&!e.includes(i.input[n]);n++);return i.succeedAt(n,i.sliceTo(n))})}static custom(e){return new vo.Parser(e)}static range(e,r){let i=e.charCodeAt(0),n=r.charCodeAt(0);return Lm.P_HELPERS.test(function(a){let s=a.charCodeAt(0);return i<=s&&s<=n}).describe(`${e}-${r}`)}static takeWhile(e){return new vo.Parser(function(i){let n=i.position.index;for(;n<i.input.length&&e(i.input[n]);)n++;return i.succeedAt(n,i.input.slice(i.position.index,n))})}static reference(e){return new vo.Parser(function(i){return e().p(i)})}};Um.P=Fx});var $T=jn(Vl=>{"use strict";Object.defineProperty(Vl,"__esModule",{value:!0});Vl.ParsingError=Vl.createParsingErrorMessage=void 0;function CT(t,e,r){let i=`Expected ${e.expected.sort().join(" or ")}`,n=`Parse Failure: ${i} at index ${e.furthest.index}, line ${e.furthest.line}, column ${e.furthest.column}.`;if(r){let a=t.split(`
`)[e.furthest.line-1],s=`${e.furthest.line} | `;n+=`
${s}${a}`,n+=`
${" ".repeat(e.furthest.column-1+s.length)}^ (${i})`}return n}Vl.createParsingErrorMessage=CT;var kx=class extends Error{constructor(e,r){super(CT(e,r,!0))}};Vl.ParsingError=kx});var Om=jn(zm=>{"use strict";Object.defineProperty(zm,"__esModule",{value:!0});zm.Parser=void 0;var xG=MT(),qo=Ji(),Px=Bm(),ql=yo(),_G=$T(),Bx=class t{constructor(e){this.p=e}tryParse(e){return this.p(new xG.ParserContext(e,{index:0,line:1,column:1}))}parse(e){let r=this.tryParse(e);if(r.success)return r.value;throw new _G.ParsingError(e,r)}or(e){return qo.P.or(this,e)}trim(e){return this.wrap(e,e)}trimString(e){return this.trim(qo.P.string(e))}wrap(e,r){let i=this;return new t(function(o){let a=e.p(o);if(!a.success)return a;let s=o.merge(a,i.p(o));if(!s.success)return s;let l=o.merge(s,r.p(o));return l.success?o.merge(l,o.succeed(s.value)):l})}wrapString(e,r){return this.wrap(qo.P.string(e),qo.P.string(r))}then(e){let r=this;return new t(function(n){let o=r.p(n);if(!o.success)return o;let a=n.merge(o,e.p(n));return a.success,a})}skip(e){let r=this;return new t(function(n){let o=r.p(n);if(!o.success)return o;let a=n.merge(o,e.p(n));return a.success?n.merge(a,n.succeed(o.value)):a})}and(e){return qo.P.sequence(this,e)}many(){let e=this;return new t(function(i){let n,o=i.position.index,a=[];for(;;){let s=i.copy(),l=e.p(s);if(n=i.merge(n,l),n.success){if(s.position.index===o)throw new Error("infinite loop in many() parser detected");i.moveToPosition(s.position),a.push(n.value)}else return i.merge(n,i.succeed(a))}})}repeat(e,r){(0,Px.validateRange)(e,r);let i=this;return new t(function(o){let a,s,l=[],u=0;for(;u<e;u++)if(a=i.p(o),s=o.merge(s,a),a.success)l.push(a.value);else return s;for(;u<r;u++){let c=o.copy();if(a=i.p(c),s=o.merge(s,a),a.success)o.moveToPosition(c.position),l.push(a.value);else break}return o.merge(s,o.succeed(l))})}atMost(e){return this.repeat(0,e)}atLeast(e){return qo.P.sequenceMap((r,i)=>r.concat(i),this.repeat(e,e),this.many())}separateBy(e){return qo.P.separateBy(this,e)}separateByNotEmpty(e){return qo.P.separateByNotEmpty(this,e)}result(e){return this.map(()=>e)}map(e){let r=this;return new t(function(n){let o=r.p(n);return o.success&&(o.value=e(o.value)),o})}marker(){return qo.P.sequenceMap(function(r,i,n){return{value:i,range:{from:r,to:n}}},ql.P_UTILS.position(),this,ql.P_UTILS.position())}namedMarker(e){return qo.P.sequenceMap(function(i,n,o){return{value:n,name:e,range:{from:i,to:o}}},ql.P_UTILS.position(),this,ql.P_UTILS.position())}node(e){return qo.P.sequenceMap(function(i,n,o){return e(n,{from:i,to:o})},ql.P_UTILS.position(),this,ql.P_UTILS.position())}followedBy(e){return this.skip(Px.P_HELPERS.followedBy(e))}notFollowedBy(e){return this.skip(Px.P_HELPERS.notFollowedBy(e))}describe(e){typeof e=="string"&&(e=[e]);let r=this;return new t(function(n){let o=r.p(n);return o.expected!==void 0&&o.expected.length!==0&&(o.expected=e),o})}box(e){let r=this;return new t(function(n){var o;let a=r.p(n);return a.expected!==void 0&&a.expected.length!==0&&(a.expected=[`(${(o=a.expected)===null||o===void 0?void 0:o.join(" or ")} as part of ${e})`]),a})}optional(e){return this.or(qo.P.succeed(e))}chain(e){let r=this;return new t(function(n){let o=r.p(n);if(!o.success)return o;let s=e(o.value).p(n);return n.merge(o,s)})}thenEof(){let e=this;return new t(function(i){let n=e.p(i);return n.success?i.atEOF()?n:i.merge(n,i.fail("eof")):n})}memorize(){let e=this,r="",i=new Map,n=new Map;return new t(function(a){let s=a.position.index;if(a.input!==r)r=a.input,i.clear(),n.clear();else{let u=i.get(s),c=n.get(s);if(u!==void 0&&c!==void 0)return a.moveToPosition(Object.assign({},c)),Object.assign({},u)}let l=e.p(a);return i.set(s,Object.assign({},l)),n.set(s,a.getPosition()),l})}};zm.Parser=Bx});var yo=jn(qm=>{"use strict";Object.defineProperty(qm,"__esModule",{value:!0});qm.P_UTILS=void 0;var Vm=Om(),Zr=Ji(),Ox=class t{static position(){return new Vm.Parser(e=>e.succeed(e.getPosition()))}static any(){return new Vm.Parser(e=>e.atEOF()?e.fail("any character"):e.succeedOffset(1,e.input[e.position.index]))}static remaining(){return new Vm.Parser(e=>e.succeedAt(e.input.length,e.input.slice(e.position.index)))}static eof(){return new Vm.Parser(e=>e.atEOF()?e.succeed(void 0):e.fail("eof"))}static digit(){return Zr.P.regexp(/^[0-9]/).describe("a digit")}static digits(){return Zr.P.regexp(/^[0-9]+/).describe("multiple digits")}static letter(){return Zr.P.regexp(/^[a-z]/i).describe("a letter")}static letters(){return Zr.P.regexp(/^[a-z]+/i).describe("multiple letters")}static unicodeLetter(){return Zr.P.regexp(/^\p{L}/iu).describe("a unicode letter")}static unicodeLetters(){return Zr.P.regexp(/^\p{L}+/iu).describe("multiple unicode letters")}static unicodeAlphanumeric(){return Zr.P.regexp(/^[\p{L}\p{N}]/iu).describe("a unicode alphanumeric character")}static unicodeAlphanumerics(){return Zr.P.regexp(/^[\p{L}\p{N}]+/iu).describe("multiple unicode alphanumeric characters")}static optionalWhitespace(){return Zr.P.regexp(/^\s*/).describe("optional whitespace")}static whitespace(){return Zr.P.regexp(/^\s+/).describe("whitespace")}static cr(){return Zr.P.string("\r")}static lf(){return Zr.P.string(`
`)}static crlf(){return Zr.P.string(`\r
`)}static newline(){return Zr.P.or(this.crlf(),this.lf(),this.cr()).describe("newline")}static prefix(e,r,i){return Zr.P.sequenceMap((n,o)=>n.reduce((a,s)=>i(s,a),o),e.many(),r)}static postfix(e,r,i){return Zr.P.sequenceMap((n,o)=>o.reduce((a,s)=>i(s,a),n),r,e.many())}static binaryRight(e,r,i){return Zr.P.sequenceMap((n,o)=>n.reverse().reduce((a,s)=>{let[l,u]=s;return i(l,u,a)},o),Zr.P.sequence(r,e.trim(this.optionalWhitespace())).many(),r)}static binaryLeft(e,r,i){return Zr.P.sequenceMap((n,o)=>o.reduce((a,s)=>{let[l,u]=s;return i(a,l,u)},n),r,Zr.P.sequence(e.trim(this.optionalWhitespace()),r).many())}static binaryRightRange(e,r,i){return Zr.P.sequenceMap((n,o,a)=>n.reverse().reduce((s,l)=>{let[u,c,f]=l;return i({from:u,to:a},c,f,s)},o),Zr.P.sequence(t.position(),r,e.trim(this.optionalWhitespace())).many(),r,t.position())}static binaryLeftRange(e,r,i){return Zr.P.sequenceMap((n,o,a)=>a.reduce((s,l)=>{let[u,c,f]=l;return i({from:n,to:f},s,u,c)},o),t.position(),r,Zr.P.sequence(e.trim(this.optionalWhitespace()),r,t.position()).many())}static func(e,r,i){let n=typeof e=="string"?Zr.P.string(e):e;return Zr.P.sequenceMap((o,a,s,l,u,c)=>i(o,l),n,Zr.P.string("("),this.optionalWhitespace(),r,this.optionalWhitespace(),Zr.P.string(")"))}};qm.P_UTILS=Ox});var ip=jn((G_,gc)=>{(function(t,e){typeof G_=="object"&&typeof gc<"u"?gc.exports=e():typeof define=="function"&&define.amd?define(e):t.moment=e()})(G_,function(){"use strict";var t;function e(){return t.apply(null,arguments)}function r(g){t=g}function i(g){return g instanceof Array||Object.prototype.toString.call(g)==="[object Array]"}function n(g){return g!=null&&Object.prototype.toString.call(g)==="[object Object]"}function o(g,A){return Object.prototype.hasOwnProperty.call(g,A)}function a(g){if(Object.getOwnPropertyNames)return Object.getOwnPropertyNames(g).length===0;var A;for(A in g)if(o(g,A))return!1;return!0}function s(g){return g===void 0}function l(g){return typeof g=="number"||Object.prototype.toString.call(g)==="[object Number]"}function u(g){return g instanceof Date||Object.prototype.toString.call(g)==="[object Date]"}function c(g,A){var F=[],P,j=g.length;for(P=0;P<j;++P)F.push(A(g[P],P));return F}function f(g,A){for(var F in A)o(A,F)&&(g[F]=A[F]);return o(A,"toString")&&(g.toString=A.toString),o(A,"valueOf")&&(g.valueOf=A.valueOf),g}function m(g,A,F,P){return oT(g,A,F,P,!0).utc()}function p(){return{empty:!1,unusedTokens:[],unusedInput:[],overflow:-2,charsLeftOver:0,nullInput:!1,invalidEra:null,invalidMonth:null,invalidFormat:!1,userInvalidated:!1,iso:!1,parsedDateParts:[],era:null,meridiem:null,rfc2822:!1,weekdayMismatch:!1}}function d(g){return g._pf==null&&(g._pf=p()),g._pf}var h;Array.prototype.some?h=Array.prototype.some:h=function(g){var A=Object(this),F=A.length>>>0,P;for(P=0;P<F;P++)if(P in A&&g.call(this,A[P],P,A))return!0;return!1};function v(g){var A=null,F=!1,P=g._d&&!isNaN(g._d.getTime());if(P&&(A=d(g),F=h.call(A.parsedDateParts,function(j){return j!=null}),P=A.overflow<0&&!A.empty&&!A.invalidEra&&!A.invalidMonth&&!A.invalidWeekday&&!A.weekdayMismatch&&!A.nullInput&&!A.invalidFormat&&!A.userInvalidated&&(!A.meridiem||A.meridiem&&F),g._strict&&(P=P&&A.charsLeftOver===0&&A.unusedTokens.length===0&&A.bigHour===void 0)),Object.isFrozen==null||!Object.isFrozen(g))g._isValid=P;else return P;return g._isValid}function y(g){var A=m(NaN);return g!=null?f(d(A),g):d(A).userInvalidated=!0,A}var S=e.momentProperties=[],b=!1;function _(g,A){var F,P,j,se=S.length;if(s(A._isAMomentObject)||(g._isAMomentObject=A._isAMomentObject),s(A._i)||(g._i=A._i),s(A._f)||(g._f=A._f),s(A._l)||(g._l=A._l),s(A._strict)||(g._strict=A._strict),s(A._tzm)||(g._tzm=A._tzm),s(A._isUTC)||(g._isUTC=A._isUTC),s(A._offset)||(g._offset=A._offset),s(A._pf)||(g._pf=d(A)),s(A._locale)||(g._locale=A._locale),se>0)for(F=0;F<se;F++)P=S[F],j=A[P],s(j)||(g[P]=j);return g}function w(g){_(this,g),this._d=new Date(g._d!=null?g._d.getTime():NaN),this.isValid()||(this._d=new Date(NaN)),b===!1&&(b=!0,e.updateOffset(this),b=!1)}function x(g){return g instanceof w||g!=null&&g._isAMomentObject!=null}function E(g){e.suppressDeprecationWarnings===!1&&typeof console<"u"&&console.warn&&console.warn("Deprecation warning: "+g)}function T(g,A){var F=!0;return f(function(){if(e.deprecationHandler!=null&&e.deprecationHandler(null,g),F){var P=[],j,se,Me,xt=arguments.length;for(se=0;se<xt;se++){if(j="",typeof arguments[se]=="object"){j+=`
[`+se+"] ";for(Me in arguments[0])o(arguments[0],Me)&&(j+=Me+": "+arguments[0][Me]+", ");j=j.slice(0,-2)}else j=arguments[se];P.push(j)}E(g+`
Arguments: `+Array.prototype.slice.call(P).join("")+`
`+new Error().stack),F=!1}return A.apply(this,arguments)},A)}var D={};function M(g,A){e.deprecationHandler!=null&&e.deprecationHandler(g,A),D[g]||(E(A),D[g]=!0)}e.suppressDeprecationWarnings=!1,e.deprecationHandler=null;function C(g){return typeof Function<"u"&&g instanceof Function||Object.prototype.toString.call(g)==="[object Function]"}function $(g){var A,F;for(F in g)o(g,F)&&(A=g[F],C(A)?this[F]=A:this["_"+F]=A);this._config=g,this._dayOfMonthOrdinalParseLenient=new RegExp((this._dayOfMonthOrdinalParse.source||this._ordinalParse.source)+"|"+/\d{1,2}/.source)}function O(g,A){var F=f({},g),P;for(P in A)o(A,P)&&(n(g[P])&&n(A[P])?(F[P]={},f(F[P],g[P]),f(F[P],A[P])):A[P]!=null?F[P]=A[P]:delete F[P]);for(P in g)o(g,P)&&!o(A,P)&&n(g[P])&&(F[P]=f({},F[P]));return F}function R(g){g!=null&&this.set(g)}var L;Object.keys?L=Object.keys:L=function(g){var A,F=[];for(A in g)o(g,A)&&F.push(A);return F};var k={sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"};function V(g,A,F){var P=this._calendar[g]||this._calendar.sameElse;return C(P)?P.call(A,F):P}function J(g,A,F){var P=""+Math.abs(g),j=A-P.length,se=g>=0;return(se?F?"+":"":"-")+Math.pow(10,Math.max(0,j)).toString().substr(1)+P}var W=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|N{1,5}|YYYYYY|YYYYY|YYYY|YY|y{2,4}|yo?|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,Q=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,ie={},B={};function Z(g,A,F,P){var j=P;typeof P=="string"&&(j=function(){return this[P]()}),g&&(B[g]=j),A&&(B[A[0]]=function(){return J(j.apply(this,arguments),A[1],A[2])}),F&&(B[F]=function(){return this.localeData().ordinal(j.apply(this,arguments),g)})}function q(g){return g.match(/\[[\s\S]/)?g.replace(/^\[|\]$/g,""):g.replace(/\\/g,"")}function xe(g){var A=g.match(W),F,P;for(F=0,P=A.length;F<P;F++)B[A[F]]?A[F]=B[A[F]]:A[F]=q(A[F]);return function(j){var se="",Me;for(Me=0;Me<P;Me++)se+=C(A[Me])?A[Me].call(j,g):A[Me];return se}}function de(g,A){return g.isValid()?(A=be(A,g.localeData()),ie[A]=ie[A]||xe(A),ie[A](g)):g.localeData().invalidDate()}function be(g,A){var F=5;function P(j){return A.longDateFormat(j)||j}for(Q.lastIndex=0;F>=0&&Q.test(g);)g=g.replace(Q,P),Q.lastIndex=0,F-=1;return g}var G={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"};function K(g){var A=this._longDateFormat[g],F=this._longDateFormat[g.toUpperCase()];return A||!F?A:(this._longDateFormat[g]=F.match(W).map(function(P){return P==="MMMM"||P==="MM"||P==="DD"||P==="dddd"?P.slice(1):P}).join(""),this._longDateFormat[g])}var re="Invalid date";function ae(){return this._invalidDate}var le="%d",Se=/\d{1,2}/;function _e(g){return this._ordinal.replace("%d",g)}var Oe={future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",w:"a week",ww:"%d weeks",M:"a month",MM:"%d months",y:"a year",yy:"%d years"};function st(g,A,F,P){var j=this._relativeTime[F];return C(j)?j(g,A,F,P):j.replace(/%d/i,g)}function yt(g,A){var F=this._relativeTime[g>0?"future":"past"];return C(F)?F(A):F.replace(/%s/i,A)}var Qe={D:"date",dates:"date",date:"date",d:"day",days:"day",day:"day",e:"weekday",weekdays:"weekday",weekday:"weekday",E:"isoWeekday",isoweekdays:"isoWeekday",isoweekday:"isoWeekday",DDD:"dayOfYear",dayofyears:"dayOfYear",dayofyear:"dayOfYear",h:"hour",hours:"hour",hour:"hour",ms:"millisecond",milliseconds:"millisecond",millisecond:"millisecond",m:"minute",minutes:"minute",minute:"minute",M:"month",months:"month",month:"month",Q:"quarter",quarters:"quarter",quarter:"quarter",s:"second",seconds:"second",second:"second",gg:"weekYear",weekyears:"weekYear",weekyear:"weekYear",GG:"isoWeekYear",isoweekyears:"isoWeekYear",isoweekyear:"isoWeekYear",w:"week",weeks:"week",week:"week",W:"isoWeek",isoweeks:"isoWeek",isoweek:"isoWeek",y:"year",years:"year",year:"year"};function ut(g){return typeof g=="string"?Qe[g]||Qe[g.toLowerCase()]:void 0}function H(g){var A={},F,P;for(P in g)o(g,P)&&(F=ut(P),F&&(A[F]=g[P]));return A}var oe={date:9,day:11,weekday:11,isoWeekday:11,dayOfYear:4,hour:13,millisecond:16,minute:14,month:8,quarter:7,second:15,weekYear:1,isoWeekYear:1,week:5,isoWeek:5,year:1};function ve(g){var A=[],F;for(F in g)o(g,F)&&A.push({unit:F,priority:oe[F]});return A.sort(function(P,j){return P.priority-j.priority}),A}var De=/\d/,Ee=/\d\d/,Ue=/\d{3}/,He=/\d{4}/,nt=/[+-]?\d{6}/,ke=/\d\d?/,Y=/\d\d\d\d?/,me=/\d\d\d\d\d\d?/,ce=/\d{1,3}/,Ce=/\d{1,4}/,Pe=/[+-]?\d{1,6}/,we=/\d+/,We=/[+-]?\d+/,I=/Z|[+-]\d\d:?\d\d/gi,X=/Z|[+-]\d\d(?::?\d\d)?/gi,ne=/[+-]?\d+(\.\d{1,3})?/,Ne=/[0-9]{0,256}['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFF07\uFF10-\uFFEF]{1,256}|[\u0600-\u06FF\/]{1,256}(\s*?[\u0600-\u06FF]{1,256}){1,2}/i,Xe=/^[1-9]\d?/,gt=/^([1-9]\d|\d)/,lr;lr={};function Ve(g,A,F){lr[g]=C(A)?A:function(P,j){return P&&F?F:A}}function yi(g,A){return o(lr,g)?lr[g](A._strict,A._locale):new RegExp(ki(g))}function ki(g){return en(g.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(A,F,P,j,se){return F||P||j||se}))}function en(g){return g.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}function Vn(g){return g<0?Math.ceil(g)||0:Math.floor(g)}function cr(g){var A=+g,F=0;return A!==0&&isFinite(A)&&(F=Vn(A)),F}var tu={};function Cr(g,A){var F,P=A,j;for(typeof g=="string"&&(g=[g]),l(A)&&(P=function(se,Me){Me[A]=cr(se)}),j=g.length,F=0;F<j;F++)tu[g[F]]=P}function Gi(g,A){Cr(g,function(F,P,j,se){j._w=j._w||{},A(F,j._w,j,se)})}function Vo(g,A,F){A!=null&&o(tu,g)&&tu[g](A,F._a,F,g)}function go(g){return g%4===0&&g%100!==0||g%400===0}var Nn=0,qn=1,Wi=2,ln=3,ai=4,Mn=5,Hi=6,vf=7,Fl=8;Z("Y",0,0,function(){var g=this.year();return g<=9999?J(g,4):"+"+g}),Z(0,["YY",2],0,function(){return this.year()%100}),Z(0,["YYYY",4],0,"year"),Z(0,["YYYYY",5],0,"year"),Z(0,["YYYYYY",6,!0],0,"year"),Ve("Y",We),Ve("YY",ke,Ee),Ve("YYYY",Ce,He),Ve("YYYYY",Pe,nt),Ve("YYYYYY",Pe,nt),Cr(["YYYYY","YYYYYY"],Nn),Cr("YYYY",function(g,A){A[Nn]=g.length===2?e.parseTwoDigitYear(g):cr(g)}),Cr("YY",function(g,A){A[Nn]=e.parseTwoDigitYear(g)}),Cr("Y",function(g,A){A[Nn]=parseInt(g,10)});function as(g){return go(g)?366:365}e.parseTwoDigitYear=function(g){return cr(g)+(cr(g)>68?1900:2e3)};var ss=Ma("FullYear",!0);function kl(){return go(this.year())}function Ma(g,A){return function(F){return F!=null?(Pl(this,g,F),e.updateOffset(this,A),this):fa(this,g)}}function fa(g,A){if(!g.isValid())return NaN;var F=g._d,P=g._isUTC;switch(A){case"Milliseconds":return P?F.getUTCMilliseconds():F.getMilliseconds();case"Seconds":return P?F.getUTCSeconds():F.getSeconds();case"Minutes":return P?F.getUTCMinutes():F.getMinutes();case"Hours":return P?F.getUTCHours():F.getHours();case"Date":return P?F.getUTCDate():F.getDate();case"Day":return P?F.getUTCDay():F.getDay();case"Month":return P?F.getUTCMonth():F.getMonth();case"FullYear":return P?F.getUTCFullYear():F.getFullYear();default:return NaN}}function Pl(g,A,F){var P,j,se,Me,xt;if(!(!g.isValid()||isNaN(F))){switch(P=g._d,j=g._isUTC,A){case"Milliseconds":return void(j?P.setUTCMilliseconds(F):P.setMilliseconds(F));case"Seconds":return void(j?P.setUTCSeconds(F):P.setSeconds(F));case"Minutes":return void(j?P.setUTCMinutes(F):P.setMinutes(F));case"Hours":return void(j?P.setUTCHours(F):P.setHours(F));case"Date":return void(j?P.setUTCDate(F):P.setDate(F));case"FullYear":break;default:return}se=F,Me=g.month(),xt=g.date(),xt=xt===29&&Me===1&&!go(se)?28:xt,j?P.setUTCFullYear(se,Me,xt):P.setFullYear(se,Me,xt)}}function Bl(g){return g=ut(g),C(this[g])?this[g]():this}function yf(g,A){if(typeof g=="object"){g=H(g);var F=ve(g),P,j=F.length;for(P=0;P<j;P++)this[F[P].unit](g[F[P].unit])}else if(g=ut(g),C(this[g]))return this[g](A);return this}function bf(g,A){return(g%A+A)%A}var tn;Array.prototype.indexOf?tn=Array.prototype.indexOf:tn=function(g){var A;for(A=0;A<this.length;++A)if(this[A]===g)return A;return-1};function z(g,A){if(isNaN(g)||isNaN(A))return NaN;var F=bf(A,12);return g+=(A-F)/12,F===1?go(g)?29:28:31-F%7%2}Z("M",["MM",2],"Mo",function(){return this.month()+1}),Z("MMM",0,0,function(g){return this.localeData().monthsShort(this,g)}),Z("MMMM",0,0,function(g){return this.localeData().months(this,g)}),Ve("M",ke,Xe),Ve("MM",ke,Ee),Ve("MMM",function(g,A){return A.monthsShortRegex(g)}),Ve("MMMM",function(g,A){return A.monthsRegex(g)}),Cr(["M","MM"],function(g,A){A[qn]=cr(g)-1}),Cr(["MMM","MMMM"],function(g,A,F,P){var j=F._locale.monthsParse(g,P,F._strict);j!=null?A[qn]=j:d(F).invalidMonth=g});var te="January_February_March_April_May_June_July_August_September_October_November_December".split("_"),$e="Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),et=/D[oD]?(\[[^\[\]]*\]|\s)+MMMM?/,qe=Ne,qt=Ne;function $r(g,A){return g?i(this._months)?this._months[g.month()]:this._months[(this._months.isFormat||et).test(A)?"format":"standalone"][g.month()]:i(this._months)?this._months:this._months.standalone}function Fn(g,A){return g?i(this._monthsShort)?this._monthsShort[g.month()]:this._monthsShort[et.test(A)?"format":"standalone"][g.month()]:i(this._monthsShort)?this._monthsShort:this._monthsShort.standalone}function kn(g,A,F){var P,j,se,Me=g.toLocaleLowerCase();if(!this._monthsParse)for(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[],P=0;P<12;++P)se=m([2e3,P]),this._shortMonthsParse[P]=this.monthsShort(se,"").toLocaleLowerCase(),this._longMonthsParse[P]=this.months(se,"").toLocaleLowerCase();return F?A==="MMM"?(j=tn.call(this._shortMonthsParse,Me),j!==-1?j:null):(j=tn.call(this._longMonthsParse,Me),j!==-1?j:null):A==="MMM"?(j=tn.call(this._shortMonthsParse,Me),j!==-1?j:(j=tn.call(this._longMonthsParse,Me),j!==-1?j:null)):(j=tn.call(this._longMonthsParse,Me),j!==-1?j:(j=tn.call(this._shortMonthsParse,Me),j!==-1?j:null))}function us(g,A,F){var P,j,se;if(this._monthsParseExact)return kn.call(this,g,A,F);for(this._monthsParse||(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[]),P=0;P<12;P++){if(j=m([2e3,P]),F&&!this._longMonthsParse[P]&&(this._longMonthsParse[P]=new RegExp("^"+this.months(j,"").replace(".","")+"$","i"),this._shortMonthsParse[P]=new RegExp("^"+this.monthsShort(j,"").replace(".","")+"$","i")),!F&&!this._monthsParse[P]&&(se="^"+this.months(j,"")+"|^"+this.monthsShort(j,""),this._monthsParse[P]=new RegExp(se.replace(".",""),"i")),F&&A==="MMMM"&&this._longMonthsParse[P].test(g))return P;if(F&&A==="MMM"&&this._shortMonthsParse[P].test(g))return P;if(!F&&this._monthsParse[P].test(g))return P}}function WA(g,A){if(!g.isValid())return g;if(typeof A=="string"){if(/^\d+$/.test(A))A=cr(A);else if(A=g.localeData().monthsParse(A),!l(A))return g}var F=A,P=g.date();return P=P<29?P:Math.min(P,z(g.year(),F)),g._isUTC?g._d.setUTCMonth(F,P):g._d.setMonth(F,P),g}function HA(g){return g!=null?(WA(this,g),e.updateOffset(this,!0),this):fa(this,"Month")}function Wq(){return z(this.year(),this.month())}function Hq(g){return this._monthsParseExact?(o(this,"_monthsRegex")||YA.call(this),g?this._monthsShortStrictRegex:this._monthsShortRegex):(o(this,"_monthsShortRegex")||(this._monthsShortRegex=qe),this._monthsShortStrictRegex&&g?this._monthsShortStrictRegex:this._monthsShortRegex)}function Yq(g){return this._monthsParseExact?(o(this,"_monthsRegex")||YA.call(this),g?this._monthsStrictRegex:this._monthsRegex):(o(this,"_monthsRegex")||(this._monthsRegex=qt),this._monthsStrictRegex&&g?this._monthsStrictRegex:this._monthsRegex)}function YA(){function g(er,yr){return yr.length-er.length}var A=[],F=[],P=[],j,se,Me,xt;for(j=0;j<12;j++)se=m([2e3,j]),Me=en(this.monthsShort(se,"")),xt=en(this.months(se,"")),A.push(Me),F.push(xt),P.push(xt),P.push(Me);A.sort(g),F.sort(g),P.sort(g),this._monthsRegex=new RegExp("^("+P.join("|")+")","i"),this._monthsShortRegex=this._monthsRegex,this._monthsStrictRegex=new RegExp("^("+F.join("|")+")","i"),this._monthsShortStrictRegex=new RegExp("^("+A.join("|")+")","i")}function Jq(g,A,F,P,j,se,Me){var xt;return g<100&&g>=0?(xt=new Date(g+400,A,F,P,j,se,Me),isFinite(xt.getFullYear())&&xt.setFullYear(g)):xt=new Date(g,A,F,P,j,se,Me),xt}function xf(g){var A,F;return g<100&&g>=0?(F=Array.prototype.slice.call(arguments),F[0]=g+400,A=new Date(Date.UTC.apply(null,F)),isFinite(A.getUTCFullYear())&&A.setUTCFullYear(g)):A=new Date(Date.UTC.apply(null,arguments)),A}function Sm(g,A,F){var P=7+A-F,j=(7+xf(g,0,P).getUTCDay()-A)%7;return-j+P-1}function JA(g,A,F,P,j){var se=(7+F-P)%7,Me=Sm(g,P,j),xt=1+7*(A-1)+se+Me,er,yr;return xt<=0?(er=g-1,yr=as(er)+xt):xt>as(g)?(er=g+1,yr=xt-as(g)):(er=g,yr=xt),{year:er,dayOfYear:yr}}function _f(g,A,F){var P=Sm(g.year(),A,F),j=Math.floor((g.dayOfYear()-P-1)/7)+1,se,Me;return j<1?(Me=g.year()-1,se=j+ls(Me,A,F)):j>ls(g.year(),A,F)?(se=j-ls(g.year(),A,F),Me=g.year()+1):(Me=g.year(),se=j),{week:se,year:Me}}function ls(g,A,F){var P=Sm(g,A,F),j=Sm(g+1,A,F);return(as(g)-P+j)/7}Z("w",["ww",2],"wo","week"),Z("W",["WW",2],"Wo","isoWeek"),Ve("w",ke,Xe),Ve("ww",ke,Ee),Ve("W",ke,Xe),Ve("WW",ke,Ee),Gi(["w","ww","W","WW"],function(g,A,F,P){A[P.substr(0,1)]=cr(g)});function Xq(g){return _f(g,this._week.dow,this._week.doy).week}var Kq={dow:0,doy:6};function Qq(){return this._week.dow}function e7(){return this._week.doy}function t7(g){var A=this.localeData().week(this);return g==null?A:this.add((g-A)*7,"d")}function r7(g){var A=_f(this,1,4).week;return g==null?A:this.add((g-A)*7,"d")}Z("d",0,"do","day"),Z("dd",0,0,function(g){return this.localeData().weekdaysMin(this,g)}),Z("ddd",0,0,function(g){return this.localeData().weekdaysShort(this,g)}),Z("dddd",0,0,function(g){return this.localeData().weekdays(this,g)}),Z("e",0,0,"weekday"),Z("E",0,0,"isoWeekday"),Ve("d",ke),Ve("e",ke),Ve("E",ke),Ve("dd",function(g,A){return A.weekdaysMinRegex(g)}),Ve("ddd",function(g,A){return A.weekdaysShortRegex(g)}),Ve("dddd",function(g,A){return A.weekdaysRegex(g)}),Gi(["dd","ddd","dddd"],function(g,A,F,P){var j=F._locale.weekdaysParse(g,P,F._strict);j!=null?A.d=j:d(F).invalidWeekday=g}),Gi(["d","e","E"],function(g,A,F,P){A[P]=cr(g)});function n7(g,A){return typeof g!="string"?g:isNaN(g)?(g=A.weekdaysParse(g),typeof g=="number"?g:null):parseInt(g,10)}function i7(g,A){return typeof g=="string"?A.weekdaysParse(g)%7||7:isNaN(g)?null:g}function mx(g,A){return g.slice(A,7).concat(g.slice(0,A))}var o7="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),XA="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),a7="Su_Mo_Tu_We_Th_Fr_Sa".split("_"),s7=Ne,u7=Ne,l7=Ne;function c7(g,A){var F=i(this._weekdays)?this._weekdays:this._weekdays[g&&g!==!0&&this._weekdays.isFormat.test(A)?"format":"standalone"];return g===!0?mx(F,this._week.dow):g?F[g.day()]:F}function f7(g){return g===!0?mx(this._weekdaysShort,this._week.dow):g?this._weekdaysShort[g.day()]:this._weekdaysShort}function p7(g){return g===!0?mx(this._weekdaysMin,this._week.dow):g?this._weekdaysMin[g.day()]:this._weekdaysMin}function m7(g,A,F){var P,j,se,Me=g.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],P=0;P<7;++P)se=m([2e3,1]).day(P),this._minWeekdaysParse[P]=this.weekdaysMin(se,"").toLocaleLowerCase(),this._shortWeekdaysParse[P]=this.weekdaysShort(se,"").toLocaleLowerCase(),this._weekdaysParse[P]=this.weekdays(se,"").toLocaleLowerCase();return F?A==="dddd"?(j=tn.call(this._weekdaysParse,Me),j!==-1?j:null):A==="ddd"?(j=tn.call(this._shortWeekdaysParse,Me),j!==-1?j:null):(j=tn.call(this._minWeekdaysParse,Me),j!==-1?j:null):A==="dddd"?(j=tn.call(this._weekdaysParse,Me),j!==-1||(j=tn.call(this._shortWeekdaysParse,Me),j!==-1)?j:(j=tn.call(this._minWeekdaysParse,Me),j!==-1?j:null)):A==="ddd"?(j=tn.call(this._shortWeekdaysParse,Me),j!==-1||(j=tn.call(this._weekdaysParse,Me),j!==-1)?j:(j=tn.call(this._minWeekdaysParse,Me),j!==-1?j:null)):(j=tn.call(this._minWeekdaysParse,Me),j!==-1||(j=tn.call(this._weekdaysParse,Me),j!==-1)?j:(j=tn.call(this._shortWeekdaysParse,Me),j!==-1?j:null))}function d7(g,A,F){var P,j,se;if(this._weekdaysParseExact)return m7.call(this,g,A,F);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),P=0;P<7;P++){if(j=m([2e3,1]).day(P),F&&!this._fullWeekdaysParse[P]&&(this._fullWeekdaysParse[P]=new RegExp("^"+this.weekdays(j,"").replace(".","\\.?")+"$","i"),this._shortWeekdaysParse[P]=new RegExp("^"+this.weekdaysShort(j,"").replace(".","\\.?")+"$","i"),this._minWeekdaysParse[P]=new RegExp("^"+this.weekdaysMin(j,"").replace(".","\\.?")+"$","i")),this._weekdaysParse[P]||(se="^"+this.weekdays(j,"")+"|^"+this.weekdaysShort(j,"")+"|^"+this.weekdaysMin(j,""),this._weekdaysParse[P]=new RegExp(se.replace(".",""),"i")),F&&A==="dddd"&&this._fullWeekdaysParse[P].test(g))return P;if(F&&A==="ddd"&&this._shortWeekdaysParse[P].test(g))return P;if(F&&A==="dd"&&this._minWeekdaysParse[P].test(g))return P;if(!F&&this._weekdaysParse[P].test(g))return P}}function h7(g){if(!this.isValid())return g!=null?this:NaN;var A=fa(this,"Day");return g!=null?(g=n7(g,this.localeData()),this.add(g-A,"d")):A}function g7(g){if(!this.isValid())return g!=null?this:NaN;var A=(this.day()+7-this.localeData()._week.dow)%7;return g==null?A:this.add(g-A,"d")}function v7(g){if(!this.isValid())return g!=null?this:NaN;if(g!=null){var A=i7(g,this.localeData());return this.day(this.day()%7?A:A-7)}else return this.day()||7}function y7(g){return this._weekdaysParseExact?(o(this,"_weekdaysRegex")||dx.call(this),g?this._weekdaysStrictRegex:this._weekdaysRegex):(o(this,"_weekdaysRegex")||(this._weekdaysRegex=s7),this._weekdaysStrictRegex&&g?this._weekdaysStrictRegex:this._weekdaysRegex)}function b7(g){return this._weekdaysParseExact?(o(this,"_weekdaysRegex")||dx.call(this),g?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(o(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=u7),this._weekdaysShortStrictRegex&&g?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)}function x7(g){return this._weekdaysParseExact?(o(this,"_weekdaysRegex")||dx.call(this),g?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(o(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=l7),this._weekdaysMinStrictRegex&&g?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)}function dx(){function g(Pi,ds){return ds.length-Pi.length}var A=[],F=[],P=[],j=[],se,Me,xt,er,yr;for(se=0;se<7;se++)Me=m([2e3,1]).day(se),xt=en(this.weekdaysMin(Me,"")),er=en(this.weekdaysShort(Me,"")),yr=en(this.weekdays(Me,"")),A.push(xt),F.push(er),P.push(yr),j.push(xt),j.push(er),j.push(yr);A.sort(g),F.sort(g),P.sort(g),j.sort(g),this._weekdaysRegex=new RegExp("^("+j.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+P.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+F.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+A.join("|")+")","i")}function hx(){return this.hours()%12||12}function _7(){return this.hours()||24}Z("H",["HH",2],0,"hour"),Z("h",["hh",2],0,hx),Z("k",["kk",2],0,_7),Z("hmm",0,0,function(){return""+hx.apply(this)+J(this.minutes(),2)}),Z("hmmss",0,0,function(){return""+hx.apply(this)+J(this.minutes(),2)+J(this.seconds(),2)}),Z("Hmm",0,0,function(){return""+this.hours()+J(this.minutes(),2)}),Z("Hmmss",0,0,function(){return""+this.hours()+J(this.minutes(),2)+J(this.seconds(),2)});function KA(g,A){Z(g,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),A)})}KA("a",!0),KA("A",!1);function QA(g,A){return A._meridiemParse}Ve("a",QA),Ve("A",QA),Ve("H",ke,gt),Ve("h",ke,Xe),Ve("k",ke,Xe),Ve("HH",ke,Ee),Ve("hh",ke,Ee),Ve("kk",ke,Ee),Ve("hmm",Y),Ve("hmmss",me),Ve("Hmm",Y),Ve("Hmmss",me),Cr(["H","HH"],ln),Cr(["k","kk"],function(g,A,F){var P=cr(g);A[ln]=P===24?0:P}),Cr(["a","A"],function(g,A,F){F._isPm=F._locale.isPM(g),F._meridiem=g}),Cr(["h","hh"],function(g,A,F){A[ln]=cr(g),d(F).bigHour=!0}),Cr("hmm",function(g,A,F){var P=g.length-2;A[ln]=cr(g.substr(0,P)),A[ai]=cr(g.substr(P)),d(F).bigHour=!0}),Cr("hmmss",function(g,A,F){var P=g.length-4,j=g.length-2;A[ln]=cr(g.substr(0,P)),A[ai]=cr(g.substr(P,2)),A[Mn]=cr(g.substr(j)),d(F).bigHour=!0}),Cr("Hmm",function(g,A,F){var P=g.length-2;A[ln]=cr(g.substr(0,P)),A[ai]=cr(g.substr(P))}),Cr("Hmmss",function(g,A,F){var P=g.length-4,j=g.length-2;A[ln]=cr(g.substr(0,P)),A[ai]=cr(g.substr(P,2)),A[Mn]=cr(g.substr(j))});function w7(g){return(g+"").toLowerCase().charAt(0)==="p"}var S7=/[ap]\.?m?\.?/i,D7=Ma("Hours",!0);function E7(g,A,F){return g>11?F?"pm":"PM":F?"am":"AM"}var eT={calendar:k,longDateFormat:G,invalidDate:re,ordinal:le,dayOfMonthOrdinalParse:Se,relativeTime:Oe,months:te,monthsShort:$e,week:Kq,weekdays:o7,weekdaysMin:a7,weekdaysShort:XA,meridiemParse:S7},cn={},wf={},Sf;function A7(g,A){var F,P=Math.min(g.length,A.length);for(F=0;F<P;F+=1)if(g[F]!==A[F])return F;return P}function tT(g){return g&&g.toLowerCase().replace("_","-")}function T7(g){for(var A=0,F,P,j,se;A<g.length;){for(se=tT(g[A]).split("-"),F=se.length,P=tT(g[A+1]),P=P?P.split("-"):null;F>0;){if(j=Dm(se.slice(0,F).join("-")),j)return j;if(P&&P.length>=F&&A7(se,P)>=F-1)break;F--}A++}return Sf}function N7(g){return!!(g&&g.match("^[^/\\\\]*$"))}function Dm(g){var A=null,F;if(cn[g]===void 0&&typeof gc<"u"&&gc&&gc.exports&&N7(g))try{A=Sf._abbr,F=require,F("./locale/"+g),ru(A)}catch{cn[g]=null}return cn[g]}function ru(g,A){var F;return g&&(s(A)?F=cs(g):F=gx(g,A),F?Sf=F:typeof console<"u"&&console.warn&&console.warn("Locale "+g+" not found. Did you forget to load it?")),Sf._abbr}function gx(g,A){if(A!==null){var F,P=eT;if(A.abbr=g,cn[g]!=null)M("defineLocaleOverride","use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale See http://momentjs.com/guides/#/warnings/define-locale/ for more info."),P=cn[g]._config;else if(A.parentLocale!=null)if(cn[A.parentLocale]!=null)P=cn[A.parentLocale]._config;else if(F=Dm(A.parentLocale),F!=null)P=F._config;else return wf[A.parentLocale]||(wf[A.parentLocale]=[]),wf[A.parentLocale].push({name:g,config:A}),null;return cn[g]=new R(O(P,A)),wf[g]&&wf[g].forEach(function(j){gx(j.name,j.config)}),ru(g),cn[g]}else return delete cn[g],null}function M7(g,A){if(A!=null){var F,P,j=eT;cn[g]!=null&&cn[g].parentLocale!=null?cn[g].set(O(cn[g]._config,A)):(P=Dm(g),P!=null&&(j=P._config),A=O(j,A),P==null&&(A.abbr=g),F=new R(A),F.parentLocale=cn[g],cn[g]=F),ru(g)}else cn[g]!=null&&(cn[g].parentLocale!=null?(cn[g]=cn[g].parentLocale,g===ru()&&ru(g)):cn[g]!=null&&delete cn[g]);return cn[g]}function cs(g){var A;if(g&&g._locale&&g._locale._abbr&&(g=g._locale._abbr),!g)return Sf;if(!i(g)){if(A=Dm(g),A)return A;g=[g]}return T7(g)}function C7(){return L(cn)}function vx(g){var A,F=g._a;return F&&d(g).overflow===-2&&(A=F[qn]<0||F[qn]>11?qn:F[Wi]<1||F[Wi]>z(F[Nn],F[qn])?Wi:F[ln]<0||F[ln]>24||F[ln]===24&&(F[ai]!==0||F[Mn]!==0||F[Hi]!==0)?ln:F[ai]<0||F[ai]>59?ai:F[Mn]<0||F[Mn]>59?Mn:F[Hi]<0||F[Hi]>999?Hi:-1,d(g)._overflowDayOfYear&&(A<Nn||A>Wi)&&(A=Wi),d(g)._overflowWeeks&&A===-1&&(A=vf),d(g)._overflowWeekday&&A===-1&&(A=Fl),d(g).overflow=A),g}var $7=/^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,I7=/^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d|))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,F7=/Z|[+-]\d\d(?::?\d\d)?/,Em=[["YYYYYY-MM-DD",/[+-]\d{6}-\d\d-\d\d/],["YYYY-MM-DD",/\d{4}-\d\d-\d\d/],["GGGG-[W]WW-E",/\d{4}-W\d\d-\d/],["GGGG-[W]WW",/\d{4}-W\d\d/,!1],["YYYY-DDD",/\d{4}-\d{3}/],["YYYY-MM",/\d{4}-\d\d/,!1],["YYYYYYMMDD",/[+-]\d{10}/],["YYYYMMDD",/\d{8}/],["GGGG[W]WWE",/\d{4}W\d{3}/],["GGGG[W]WW",/\d{4}W\d{2}/,!1],["YYYYDDD",/\d{7}/],["YYYYMM",/\d{6}/,!1],["YYYY",/\d{4}/,!1]],yx=[["HH:mm:ss.SSSS",/\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss,SSSS",/\d\d:\d\d:\d\d,\d+/],["HH:mm:ss",/\d\d:\d\d:\d\d/],["HH:mm",/\d\d:\d\d/],["HHmmss.SSSS",/\d\d\d\d\d\d\.\d+/],["HHmmss,SSSS",/\d\d\d\d\d\d,\d+/],["HHmmss",/\d\d\d\d\d\d/],["HHmm",/\d\d\d\d/],["HH",/\d\d/]],k7=/^\/?Date\((-?\d+)/i,P7=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|([+-]\d{4}))$/,B7={UT:0,GMT:0,EDT:-240,EST:-300,CDT:-300,CST:-360,MDT:-360,MST:-420,PDT:-420,PST:-480};function rT(g){var A,F,P=g._i,j=$7.exec(P)||I7.exec(P),se,Me,xt,er,yr=Em.length,Pi=yx.length;if(j){for(d(g).iso=!0,A=0,F=yr;A<F;A++)if(Em[A][1].exec(j[1])){Me=Em[A][0],se=Em[A][2]!==!1;break}if(Me==null){g._isValid=!1;return}if(j[3]){for(A=0,F=Pi;A<F;A++)if(yx[A][1].exec(j[3])){xt=(j[2]||" ")+yx[A][0];break}if(xt==null){g._isValid=!1;return}}if(!se&&xt!=null){g._isValid=!1;return}if(j[4])if(F7.exec(j[4]))er="Z";else{g._isValid=!1;return}g._f=Me+(xt||"")+(er||""),xx(g)}else g._isValid=!1}function O7(g,A,F,P,j,se){var Me=[R7(g),$e.indexOf(A),parseInt(F,10),parseInt(P,10),parseInt(j,10)];return se&&Me.push(parseInt(se,10)),Me}function R7(g){var A=parseInt(g,10);return A<=49?2e3+A:A<=999?1900+A:A}function L7(g){return g.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").replace(/^\s\s*/,"").replace(/\s\s*$/,"")}function U7(g,A,F){if(g){var P=XA.indexOf(g),j=new Date(A[0],A[1],A[2]).getDay();if(P!==j)return d(F).weekdayMismatch=!0,F._isValid=!1,!1}return!0}function z7(g,A,F){if(g)return B7[g];if(A)return 0;var P=parseInt(F,10),j=P%100,se=(P-j)/100;return se*60+j}function nT(g){var A=P7.exec(L7(g._i)),F;if(A){if(F=O7(A[4],A[3],A[2],A[5],A[6],A[7]),!U7(A[1],F,g))return;g._a=F,g._tzm=z7(A[8],A[9],A[10]),g._d=xf.apply(null,g._a),g._d.setUTCMinutes(g._d.getUTCMinutes()-g._tzm),d(g).rfc2822=!0}else g._isValid=!1}function V7(g){var A=k7.exec(g._i);if(A!==null){g._d=new Date(+A[1]);return}if(rT(g),g._isValid===!1)delete g._isValid;else return;if(nT(g),g._isValid===!1)delete g._isValid;else return;g._strict?g._isValid=!1:e.createFromInputFallback(g)}e.createFromInputFallback=T("value provided is not in a recognized RFC2822 or ISO format. moment construction falls back to js Date(), which is not reliable across all browsers and versions. Non RFC2822/ISO date formats are discouraged. Please refer to http://momentjs.com/guides/#/warnings/js-date/ for more info.",function(g){g._d=new Date(g._i+(g._useUTC?" UTC":""))});function Ol(g,A,F){return g??A??F}function q7(g){var A=new Date(e.now());return g._useUTC?[A.getUTCFullYear(),A.getUTCMonth(),A.getUTCDate()]:[A.getFullYear(),A.getMonth(),A.getDate()]}function bx(g){var A,F,P=[],j,se,Me;if(!g._d){for(j=q7(g),g._w&&g._a[Wi]==null&&g._a[qn]==null&&j7(g),g._dayOfYear!=null&&(Me=Ol(g._a[Nn],j[Nn]),(g._dayOfYear>as(Me)||g._dayOfYear===0)&&(d(g)._overflowDayOfYear=!0),F=xf(Me,0,g._dayOfYear),g._a[qn]=F.getUTCMonth(),g._a[Wi]=F.getUTCDate()),A=0;A<3&&g._a[A]==null;++A)g._a[A]=P[A]=j[A];for(;A<7;A++)g._a[A]=P[A]=g._a[A]==null?A===2?1:0:g._a[A];g._a[ln]===24&&g._a[ai]===0&&g._a[Mn]===0&&g._a[Hi]===0&&(g._nextDay=!0,g._a[ln]=0),g._d=(g._useUTC?xf:Jq).apply(null,P),se=g._useUTC?g._d.getUTCDay():g._d.getDay(),g._tzm!=null&&g._d.setUTCMinutes(g._d.getUTCMinutes()-g._tzm),g._nextDay&&(g._a[ln]=24),g._w&&typeof g._w.d<"u"&&g._w.d!==se&&(d(g).weekdayMismatch=!0)}}function j7(g){var A,F,P,j,se,Me,xt,er,yr;A=g._w,A.GG!=null||A.W!=null||A.E!=null?(se=1,Me=4,F=Ol(A.GG,g._a[Nn],_f(rn(),1,4).year),P=Ol(A.W,1),j=Ol(A.E,1),(j<1||j>7)&&(er=!0)):(se=g._locale._week.dow,Me=g._locale._week.doy,yr=_f(rn(),se,Me),F=Ol(A.gg,g._a[Nn],yr.year),P=Ol(A.w,yr.week),A.d!=null?(j=A.d,(j<0||j>6)&&(er=!0)):A.e!=null?(j=A.e+se,(A.e<0||A.e>6)&&(er=!0)):j=se),P<1||P>ls(F,se,Me)?d(g)._overflowWeeks=!0:er!=null?d(g)._overflowWeekday=!0:(xt=JA(F,P,j,se,Me),g._a[Nn]=xt.year,g._dayOfYear=xt.dayOfYear)}e.ISO_8601=function(){},e.RFC_2822=function(){};function xx(g){if(g._f===e.ISO_8601){rT(g);return}if(g._f===e.RFC_2822){nT(g);return}g._a=[],d(g).empty=!0;var A=""+g._i,F,P,j,se,Me,xt=A.length,er=0,yr,Pi;for(j=be(g._f,g._locale).match(W)||[],Pi=j.length,F=0;F<Pi;F++)se=j[F],P=(A.match(yi(se,g))||[])[0],P&&(Me=A.substr(0,A.indexOf(P)),Me.length>0&&d(g).unusedInput.push(Me),A=A.slice(A.indexOf(P)+P.length),er+=P.length),B[se]?(P?d(g).empty=!1:d(g).unusedTokens.push(se),Vo(se,P,g)):g._strict&&!P&&d(g).unusedTokens.push(se);d(g).charsLeftOver=xt-er,A.length>0&&d(g).unusedInput.push(A),g._a[ln]<=12&&d(g).bigHour===!0&&g._a[ln]>0&&(d(g).bigHour=void 0),d(g).parsedDateParts=g._a.slice(0),d(g).meridiem=g._meridiem,g._a[ln]=Z7(g._locale,g._a[ln],g._meridiem),yr=d(g).era,yr!==null&&(g._a[Nn]=g._locale.erasConvertYear(yr,g._a[Nn])),bx(g),vx(g)}function Z7(g,A,F){var P;return F==null?A:g.meridiemHour!=null?g.meridiemHour(A,F):(g.isPM!=null&&(P=g.isPM(F),P&&A<12&&(A+=12),!P&&A===12&&(A=0)),A)}function G7(g){var A,F,P,j,se,Me,xt=!1,er=g._f.length;if(er===0){d(g).invalidFormat=!0,g._d=new Date(NaN);return}for(j=0;j<er;j++)se=0,Me=!1,A=_({},g),g._useUTC!=null&&(A._useUTC=g._useUTC),A._f=g._f[j],xx(A),v(A)&&(Me=!0),se+=d(A).charsLeftOver,se+=d(A).unusedTokens.length*10,d(A).score=se,xt?se<P&&(P=se,F=A):(P==null||se<P||Me)&&(P=se,F=A,Me&&(xt=!0));f(g,F||A)}function W7(g){if(!g._d){var A=H(g._i),F=A.day===void 0?A.date:A.day;g._a=c([A.year,A.month,F,A.hour,A.minute,A.second,A.millisecond],function(P){return P&&parseInt(P,10)}),bx(g)}}function H7(g){var A=new w(vx(iT(g)));return A._nextDay&&(A.add(1,"d"),A._nextDay=void 0),A}function iT(g){var A=g._i,F=g._f;return g._locale=g._locale||cs(g._l),A===null||F===void 0&&A===""?y({nullInput:!0}):(typeof A=="string"&&(g._i=A=g._locale.preparse(A)),x(A)?new w(vx(A)):(u(A)?g._d=A:i(F)?G7(g):F?xx(g):Y7(g),v(g)||(g._d=null),g))}function Y7(g){var A=g._i;s(A)?g._d=new Date(e.now()):u(A)?g._d=new Date(A.valueOf()):typeof A=="string"?V7(g):i(A)?(g._a=c(A.slice(0),function(F){return parseInt(F,10)}),bx(g)):n(A)?W7(g):l(A)?g._d=new Date(A):e.createFromInputFallback(g)}function oT(g,A,F,P,j){var se={};return(A===!0||A===!1)&&(P=A,A=void 0),(F===!0||F===!1)&&(P=F,F=void 0),(n(g)&&a(g)||i(g)&&g.length===0)&&(g=void 0),se._isAMomentObject=!0,se._useUTC=se._isUTC=j,se._l=F,se._i=g,se._f=A,se._strict=P,H7(se)}function rn(g,A,F,P){return oT(g,A,F,P,!1)}var J7=T("moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var g=rn.apply(null,arguments);return this.isValid()&&g.isValid()?g<this?this:g:y()}),X7=T("moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/",function(){var g=rn.apply(null,arguments);return this.isValid()&&g.isValid()?g>this?this:g:y()});function aT(g,A){var F,P;if(A.length===1&&i(A[0])&&(A=A[0]),!A.length)return rn();for(F=A[0],P=1;P<A.length;++P)(!A[P].isValid()||A[P][g](F))&&(F=A[P]);return F}function K7(){var g=[].slice.call(arguments,0);return aT("isBefore",g)}function Q7(){var g=[].slice.call(arguments,0);return aT("isAfter",g)}var ej=function(){return Date.now?Date.now():+new Date},Df=["year","quarter","month","week","day","hour","minute","second","millisecond"];function tj(g){var A,F=!1,P,j=Df.length;for(A in g)if(o(g,A)&&!(tn.call(Df,A)!==-1&&(g[A]==null||!isNaN(g[A]))))return!1;for(P=0;P<j;++P)if(g[Df[P]]){if(F)return!1;parseFloat(g[Df[P]])!==cr(g[Df[P]])&&(F=!0)}return!0}function rj(){return this._isValid}function nj(){return pa(NaN)}function Am(g){var A=H(g),F=A.year||0,P=A.quarter||0,j=A.month||0,se=A.week||A.isoWeek||0,Me=A.day||0,xt=A.hour||0,er=A.minute||0,yr=A.second||0,Pi=A.millisecond||0;this._isValid=tj(A),this._milliseconds=+Pi+yr*1e3+er*6e4+xt*1e3*60*60,this._days=+Me+se*7,this._months=+j+P*3+F*12,this._data={},this._locale=cs(),this._bubble()}function Tm(g){return g instanceof Am}function _x(g){return g<0?Math.round(-1*g)*-1:Math.round(g)}function ij(g,A,F){var P=Math.min(g.length,A.length),j=Math.abs(g.length-A.length),se=0,Me;for(Me=0;Me<P;Me++)(F&&g[Me]!==A[Me]||!F&&cr(g[Me])!==cr(A[Me]))&&se++;return se+j}function sT(g,A){Z(g,0,0,function(){var F=this.utcOffset(),P="+";return F<0&&(F=-F,P="-"),P+J(~~(F/60),2)+A+J(~~F%60,2)})}sT("Z",":"),sT("ZZ",""),Ve("Z",X),Ve("ZZ",X),Cr(["Z","ZZ"],function(g,A,F){F._useUTC=!0,F._tzm=wx(X,g)});var oj=/([\+\-]|\d\d)/gi;function wx(g,A){var F=(A||"").match(g),P,j,se;return F===null?null:(P=F[F.length-1]||[],j=(P+"").match(oj)||["-",0,0],se=+(j[1]*60)+cr(j[2]),se===0?0:j[0]==="+"?se:-se)}function Sx(g,A){var F,P;return A._isUTC?(F=A.clone(),P=(x(g)||u(g)?g.valueOf():rn(g).valueOf())-F.valueOf(),F._d.setTime(F._d.valueOf()+P),e.updateOffset(F,!1),F):rn(g).local()}function Dx(g){return-Math.round(g._d.getTimezoneOffset())}e.updateOffset=function(){};function aj(g,A,F){var P=this._offset||0,j;if(!this.isValid())return g!=null?this:NaN;if(g!=null){if(typeof g=="string"){if(g=wx(X,g),g===null)return this}else Math.abs(g)<16&&!F&&(g=g*60);return!this._isUTC&&A&&(j=Dx(this)),this._offset=g,this._isUTC=!0,j!=null&&this.add(j,"m"),P!==g&&(!A||this._changeInProgress?fT(this,pa(g-P,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,e.updateOffset(this,!0),this._changeInProgress=null)),this}else return this._isUTC?P:Dx(this)}function sj(g,A){return g!=null?(typeof g!="string"&&(g=-g),this.utcOffset(g,A),this):-this.utcOffset()}function uj(g){return this.utcOffset(0,g)}function lj(g){return this._isUTC&&(this.utcOffset(0,g),this._isUTC=!1,g&&this.subtract(Dx(this),"m")),this}function cj(){if(this._tzm!=null)this.utcOffset(this._tzm,!1,!0);else if(typeof this._i=="string"){var g=wx(I,this._i);g!=null?this.utcOffset(g):this.utcOffset(0,!0)}return this}function fj(g){return this.isValid()?(g=g?rn(g).utcOffset():0,(this.utcOffset()-g)%60===0):!1}function pj(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()}function mj(){if(!s(this._isDSTShifted))return this._isDSTShifted;var g={},A;return _(g,this),g=iT(g),g._a?(A=g._isUTC?m(g._a):rn(g._a),this._isDSTShifted=this.isValid()&&ij(g._a,A.toArray())>0):this._isDSTShifted=!1,this._isDSTShifted}function dj(){return this.isValid()?!this._isUTC:!1}function hj(){return this.isValid()?this._isUTC:!1}function uT(){return this.isValid()?this._isUTC&&this._offset===0:!1}var gj=/^(-|\+)?(?:(\d*)[. ])?(\d+):(\d+)(?::(\d+)(\.\d*)?)?$/,vj=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;function pa(g,A){var F=g,P=null,j,se,Me;return Tm(g)?F={ms:g._milliseconds,d:g._days,M:g._months}:l(g)||!isNaN(+g)?(F={},A?F[A]=+g:F.milliseconds=+g):(P=gj.exec(g))?(j=P[1]==="-"?-1:1,F={y:0,d:cr(P[Wi])*j,h:cr(P[ln])*j,m:cr(P[ai])*j,s:cr(P[Mn])*j,ms:cr(_x(P[Hi]*1e3))*j}):(P=vj.exec(g))?(j=P[1]==="-"?-1:1,F={y:Ru(P[2],j),M:Ru(P[3],j),w:Ru(P[4],j),d:Ru(P[5],j),h:Ru(P[6],j),m:Ru(P[7],j),s:Ru(P[8],j)}):F==null?F={}:typeof F=="object"&&("from"in F||"to"in F)&&(Me=yj(rn(F.from),rn(F.to)),F={},F.ms=Me.milliseconds,F.M=Me.months),se=new Am(F),Tm(g)&&o(g,"_locale")&&(se._locale=g._locale),Tm(g)&&o(g,"_isValid")&&(se._isValid=g._isValid),se}pa.fn=Am.prototype,pa.invalid=nj;function Ru(g,A){var F=g&&parseFloat(g.replace(",","."));return(isNaN(F)?0:F)*A}function lT(g,A){var F={};return F.months=A.month()-g.month()+(A.year()-g.year())*12,g.clone().add(F.months,"M").isAfter(A)&&--F.months,F.milliseconds=+A-+g.clone().add(F.months,"M"),F}function yj(g,A){var F;return g.isValid()&&A.isValid()?(A=Sx(A,g),g.isBefore(A)?F=lT(g,A):(F=lT(A,g),F.milliseconds=-F.milliseconds,F.months=-F.months),F):{milliseconds:0,months:0}}function cT(g,A){return function(F,P){var j,se;return P!==null&&!isNaN(+P)&&(M(A,"moment()."+A+"(period, number) is deprecated. Please use moment()."+A+"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info."),se=F,F=P,P=se),j=pa(F,P),fT(this,j,g),this}}function fT(g,A,F,P){var j=A._milliseconds,se=_x(A._days),Me=_x(A._months);g.isValid()&&(P=P??!0,Me&&WA(g,fa(g,"Month")+Me*F),se&&Pl(g,"Date",fa(g,"Date")+se*F),j&&g._d.setTime(g._d.valueOf()+j*F),P&&e.updateOffset(g,se||Me))}var bj=cT(1,"add"),xj=cT(-1,"subtract");function pT(g){return typeof g=="string"||g instanceof String}function _j(g){return x(g)||u(g)||pT(g)||l(g)||Sj(g)||wj(g)||g===null||g===void 0}function wj(g){var A=n(g)&&!a(g),F=!1,P=["years","year","y","months","month","M","days","day","d","dates","date","D","hours","hour","h","minutes","minute","m","seconds","second","s","milliseconds","millisecond","ms"],j,se,Me=P.length;for(j=0;j<Me;j+=1)se=P[j],F=F||o(g,se);return A&&F}function Sj(g){var A=i(g),F=!1;return A&&(F=g.filter(function(P){return!l(P)&&pT(g)}).length===0),A&&F}function Dj(g){var A=n(g)&&!a(g),F=!1,P=["sameDay","nextDay","lastDay","nextWeek","lastWeek","sameElse"],j,se;for(j=0;j<P.length;j+=1)se=P[j],F=F||o(g,se);return A&&F}function Ej(g,A){var F=g.diff(A,"days",!0);return F<-6?"sameElse":F<-1?"lastWeek":F<0?"lastDay":F<1?"sameDay":F<2?"nextDay":F<7?"nextWeek":"sameElse"}function Aj(g,A){arguments.length===1&&(arguments[0]?_j(arguments[0])?(g=arguments[0],A=void 0):Dj(arguments[0])&&(A=arguments[0],g=void 0):(g=void 0,A=void 0));var F=g||rn(),P=Sx(F,this).startOf("day"),j=e.calendarFormat(this,P)||"sameElse",se=A&&(C(A[j])?A[j].call(this,F):A[j]);return this.format(se||this.localeData().calendar(j,this,rn(F)))}function Tj(){return new w(this)}function Nj(g,A){var F=x(g)?g:rn(g);return this.isValid()&&F.isValid()?(A=ut(A)||"millisecond",A==="millisecond"?this.valueOf()>F.valueOf():F.valueOf()<this.clone().startOf(A).valueOf()):!1}function Mj(g,A){var F=x(g)?g:rn(g);return this.isValid()&&F.isValid()?(A=ut(A)||"millisecond",A==="millisecond"?this.valueOf()<F.valueOf():this.clone().endOf(A).valueOf()<F.valueOf()):!1}function Cj(g,A,F,P){var j=x(g)?g:rn(g),se=x(A)?A:rn(A);return this.isValid()&&j.isValid()&&se.isValid()?(P=P||"()",(P[0]==="("?this.isAfter(j,F):!this.isBefore(j,F))&&(P[1]===")"?this.isBefore(se,F):!this.isAfter(se,F))):!1}function $j(g,A){var F=x(g)?g:rn(g),P;return this.isValid()&&F.isValid()?(A=ut(A)||"millisecond",A==="millisecond"?this.valueOf()===F.valueOf():(P=F.valueOf(),this.clone().startOf(A).valueOf()<=P&&P<=this.clone().endOf(A).valueOf())):!1}function Ij(g,A){return this.isSame(g,A)||this.isAfter(g,A)}function Fj(g,A){return this.isSame(g,A)||this.isBefore(g,A)}function kj(g,A,F){var P,j,se;if(!this.isValid())return NaN;if(P=Sx(g,this),!P.isValid())return NaN;switch(j=(P.utcOffset()-this.utcOffset())*6e4,A=ut(A),A){case"year":se=Nm(this,P)/12;break;case"month":se=Nm(this,P);break;case"quarter":se=Nm(this,P)/3;break;case"second":se=(this-P)/1e3;break;case"minute":se=(this-P)/6e4;break;case"hour":se=(this-P)/36e5;break;case"day":se=(this-P-j)/864e5;break;case"week":se=(this-P-j)/6048e5;break;default:se=this-P}return F?se:Vn(se)}function Nm(g,A){if(g.date()<A.date())return-Nm(A,g);var F=(A.year()-g.year())*12+(A.month()-g.month()),P=g.clone().add(F,"months"),j,se;return A-P<0?(j=g.clone().add(F-1,"months"),se=(A-P)/(P-j)):(j=g.clone().add(F+1,"months"),se=(A-P)/(j-P)),-(F+se)||0}e.defaultFormat="YYYY-MM-DDTHH:mm:ssZ",e.defaultFormatUtc="YYYY-MM-DDTHH:mm:ss[Z]";function Pj(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")}function Bj(g){if(!this.isValid())return null;var A=g!==!0,F=A?this.clone().utc():this;return F.year()<0||F.year()>9999?de(F,A?"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYYYY-MM-DD[T]HH:mm:ss.SSSZ"):C(Date.prototype.toISOString)?A?this.toDate().toISOString():new Date(this.valueOf()+this.utcOffset()*60*1e3).toISOString().replace("Z",de(F,"Z")):de(F,A?"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYY-MM-DD[T]HH:mm:ss.SSSZ")}function Oj(){if(!this.isValid())return"moment.invalid(/* "+this._i+" */)";var g="moment",A="",F,P,j,se;return this.isLocal()||(g=this.utcOffset()===0?"moment.utc":"moment.parseZone",A="Z"),F="["+g+'("]',P=0<=this.year()&&this.year()<=9999?"YYYY":"YYYYYY",j="-MM-DD[T]HH:mm:ss.SSS",se=A+'[")]',this.format(F+P+j+se)}function Rj(g){g||(g=this.isUtc()?e.defaultFormatUtc:e.defaultFormat);var A=de(this,g);return this.localeData().postformat(A)}function Lj(g,A){return this.isValid()&&(x(g)&&g.isValid()||rn(g).isValid())?pa({to:this,from:g}).locale(this.locale()).humanize(!A):this.localeData().invalidDate()}function Uj(g){return this.from(rn(),g)}function zj(g,A){return this.isValid()&&(x(g)&&g.isValid()||rn(g).isValid())?pa({from:this,to:g}).locale(this.locale()).humanize(!A):this.localeData().invalidDate()}function Vj(g){return this.to(rn(),g)}function mT(g){var A;return g===void 0?this._locale._abbr:(A=cs(g),A!=null&&(this._locale=A),this)}var dT=T("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",function(g){return g===void 0?this.localeData():this.locale(g)});function hT(){return this._locale}var Mm=1e3,Rl=60*Mm,Cm=60*Rl,gT=(365*400+97)*24*Cm;function Ll(g,A){return(g%A+A)%A}function vT(g,A,F){return g<100&&g>=0?new Date(g+400,A,F)-gT:new Date(g,A,F).valueOf()}function yT(g,A,F){return g<100&&g>=0?Date.UTC(g+400,A,F)-gT:Date.UTC(g,A,F)}function qj(g){var A,F;if(g=ut(g),g===void 0||g==="millisecond"||!this.isValid())return this;switch(F=this._isUTC?yT:vT,g){case"year":A=F(this.year(),0,1);break;case"quarter":A=F(this.year(),this.month()-this.month()%3,1);break;case"month":A=F(this.year(),this.month(),1);break;case"week":A=F(this.year(),this.month(),this.date()-this.weekday());break;case"isoWeek":A=F(this.year(),this.month(),this.date()-(this.isoWeekday()-1));break;case"day":case"date":A=F(this.year(),this.month(),this.date());break;case"hour":A=this._d.valueOf(),A-=Ll(A+(this._isUTC?0:this.utcOffset()*Rl),Cm);break;case"minute":A=this._d.valueOf(),A-=Ll(A,Rl);break;case"second":A=this._d.valueOf(),A-=Ll(A,Mm);break}return this._d.setTime(A),e.updateOffset(this,!0),this}function jj(g){var A,F;if(g=ut(g),g===void 0||g==="millisecond"||!this.isValid())return this;switch(F=this._isUTC?yT:vT,g){case"year":A=F(this.year()+1,0,1)-1;break;case"quarter":A=F(this.year(),this.month()-this.month()%3+3,1)-1;break;case"month":A=F(this.year(),this.month()+1,1)-1;break;case"week":A=F(this.year(),this.month(),this.date()-this.weekday()+7)-1;break;case"isoWeek":A=F(this.year(),this.month(),this.date()-(this.isoWeekday()-1)+7)-1;break;case"day":case"date":A=F(this.year(),this.month(),this.date()+1)-1;break;case"hour":A=this._d.valueOf(),A+=Cm-Ll(A+(this._isUTC?0:this.utcOffset()*Rl),Cm)-1;break;case"minute":A=this._d.valueOf(),A+=Rl-Ll(A,Rl)-1;break;case"second":A=this._d.valueOf(),A+=Mm-Ll(A,Mm)-1;break}return this._d.setTime(A),e.updateOffset(this,!0),this}function Zj(){return this._d.valueOf()-(this._offset||0)*6e4}function Gj(){return Math.floor(this.valueOf()/1e3)}function Wj(){return new Date(this.valueOf())}function Hj(){var g=this;return[g.year(),g.month(),g.date(),g.hour(),g.minute(),g.second(),g.millisecond()]}function Yj(){var g=this;return{years:g.year(),months:g.month(),date:g.date(),hours:g.hours(),minutes:g.minutes(),seconds:g.seconds(),milliseconds:g.milliseconds()}}function Jj(){return this.isValid()?this.toISOString():null}function Xj(){return v(this)}function Kj(){return f({},d(this))}function Qj(){return d(this).overflow}function eZ(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}}Z("N",0,0,"eraAbbr"),Z("NN",0,0,"eraAbbr"),Z("NNN",0,0,"eraAbbr"),Z("NNNN",0,0,"eraName"),Z("NNNNN",0,0,"eraNarrow"),Z("y",["y",1],"yo","eraYear"),Z("y",["yy",2],0,"eraYear"),Z("y",["yyy",3],0,"eraYear"),Z("y",["yyyy",4],0,"eraYear"),Ve("N",Ex),Ve("NN",Ex),Ve("NNN",Ex),Ve("NNNN",fZ),Ve("NNNNN",pZ),Cr(["N","NN","NNN","NNNN","NNNNN"],function(g,A,F,P){var j=F._locale.erasParse(g,P,F._strict);j?d(F).era=j:d(F).invalidEra=g}),Ve("y",we),Ve("yy",we),Ve("yyy",we),Ve("yyyy",we),Ve("yo",mZ),Cr(["y","yy","yyy","yyyy"],Nn),Cr(["yo"],function(g,A,F,P){var j;F._locale._eraYearOrdinalRegex&&(j=g.match(F._locale._eraYearOrdinalRegex)),F._locale.eraYearOrdinalParse?A[Nn]=F._locale.eraYearOrdinalParse(g,j):A[Nn]=parseInt(g,10)});function tZ(g,A){var F,P,j,se=this._eras||cs("en")._eras;for(F=0,P=se.length;F<P;++F){switch(typeof se[F].since){case"string":j=e(se[F].since).startOf("day"),se[F].since=j.valueOf();break}switch(typeof se[F].until){case"undefined":se[F].until=1/0;break;case"string":j=e(se[F].until).startOf("day").valueOf(),se[F].until=j.valueOf();break}}return se}function rZ(g,A,F){var P,j,se=this.eras(),Me,xt,er;for(g=g.toUpperCase(),P=0,j=se.length;P<j;++P)if(Me=se[P].name.toUpperCase(),xt=se[P].abbr.toUpperCase(),er=se[P].narrow.toUpperCase(),F)switch(A){case"N":case"NN":case"NNN":if(xt===g)return se[P];break;case"NNNN":if(Me===g)return se[P];break;case"NNNNN":if(er===g)return se[P];break}else if([Me,xt,er].indexOf(g)>=0)return se[P]}function nZ(g,A){var F=g.since<=g.until?1:-1;return A===void 0?e(g.since).year():e(g.since).year()+(A-g.offset)*F}function iZ(){var g,A,F,P=this.localeData().eras();for(g=0,A=P.length;g<A;++g)if(F=this.clone().startOf("day").valueOf(),P[g].since<=F&&F<=P[g].until||P[g].until<=F&&F<=P[g].since)return P[g].name;return""}function oZ(){var g,A,F,P=this.localeData().eras();for(g=0,A=P.length;g<A;++g)if(F=this.clone().startOf("day").valueOf(),P[g].since<=F&&F<=P[g].until||P[g].until<=F&&F<=P[g].since)return P[g].narrow;return""}function aZ(){var g,A,F,P=this.localeData().eras();for(g=0,A=P.length;g<A;++g)if(F=this.clone().startOf("day").valueOf(),P[g].since<=F&&F<=P[g].until||P[g].until<=F&&F<=P[g].since)return P[g].abbr;return""}function sZ(){var g,A,F,P,j=this.localeData().eras();for(g=0,A=j.length;g<A;++g)if(F=j[g].since<=j[g].until?1:-1,P=this.clone().startOf("day").valueOf(),j[g].since<=P&&P<=j[g].until||j[g].until<=P&&P<=j[g].since)return(this.year()-e(j[g].since).year())*F+j[g].offset;return this.year()}function uZ(g){return o(this,"_erasNameRegex")||Ax.call(this),g?this._erasNameRegex:this._erasRegex}function lZ(g){return o(this,"_erasAbbrRegex")||Ax.call(this),g?this._erasAbbrRegex:this._erasRegex}function cZ(g){return o(this,"_erasNarrowRegex")||Ax.call(this),g?this._erasNarrowRegex:this._erasRegex}function Ex(g,A){return A.erasAbbrRegex(g)}function fZ(g,A){return A.erasNameRegex(g)}function pZ(g,A){return A.erasNarrowRegex(g)}function mZ(g,A){return A._eraYearOrdinalRegex||we}function Ax(){var g=[],A=[],F=[],P=[],j,se,Me,xt,er,yr=this.eras();for(j=0,se=yr.length;j<se;++j)Me=en(yr[j].name),xt=en(yr[j].abbr),er=en(yr[j].narrow),A.push(Me),g.push(xt),F.push(er),P.push(Me),P.push(xt),P.push(er);this._erasRegex=new RegExp("^("+P.join("|")+")","i"),this._erasNameRegex=new RegExp("^("+A.join("|")+")","i"),this._erasAbbrRegex=new RegExp("^("+g.join("|")+")","i"),this._erasNarrowRegex=new RegExp("^("+F.join("|")+")","i")}Z(0,["gg",2],0,function(){return this.weekYear()%100}),Z(0,["GG",2],0,function(){return this.isoWeekYear()%100});function $m(g,A){Z(0,[g,g.length],0,A)}$m("gggg","weekYear"),$m("ggggg","weekYear"),$m("GGGG","isoWeekYear"),$m("GGGGG","isoWeekYear"),Ve("G",We),Ve("g",We),Ve("GG",ke,Ee),Ve("gg",ke,Ee),Ve("GGGG",Ce,He),Ve("gggg",Ce,He),Ve("GGGGG",Pe,nt),Ve("ggggg",Pe,nt),Gi(["gggg","ggggg","GGGG","GGGGG"],function(g,A,F,P){A[P.substr(0,2)]=cr(g)}),Gi(["gg","GG"],function(g,A,F,P){A[P]=e.parseTwoDigitYear(g)});function dZ(g){return bT.call(this,g,this.week(),this.weekday()+this.localeData()._week.dow,this.localeData()._week.dow,this.localeData()._week.doy)}function hZ(g){return bT.call(this,g,this.isoWeek(),this.isoWeekday(),1,4)}function gZ(){return ls(this.year(),1,4)}function vZ(){return ls(this.isoWeekYear(),1,4)}function yZ(){var g=this.localeData()._week;return ls(this.year(),g.dow,g.doy)}function bZ(){var g=this.localeData()._week;return ls(this.weekYear(),g.dow,g.doy)}function bT(g,A,F,P,j){var se;return g==null?_f(this,P,j).year:(se=ls(g,P,j),A>se&&(A=se),xZ.call(this,g,A,F,P,j))}function xZ(g,A,F,P,j){var se=JA(g,A,F,P,j),Me=xf(se.year,0,se.dayOfYear);return this.year(Me.getUTCFullYear()),this.month(Me.getUTCMonth()),this.date(Me.getUTCDate()),this}Z("Q",0,"Qo","quarter"),Ve("Q",De),Cr("Q",function(g,A){A[qn]=(cr(g)-1)*3});function _Z(g){return g==null?Math.ceil((this.month()+1)/3):this.month((g-1)*3+this.month()%3)}Z("D",["DD",2],"Do","date"),Ve("D",ke,Xe),Ve("DD",ke,Ee),Ve("Do",function(g,A){return g?A._dayOfMonthOrdinalParse||A._ordinalParse:A._dayOfMonthOrdinalParseLenient}),Cr(["D","DD"],Wi),Cr("Do",function(g,A){A[Wi]=cr(g.match(ke)[0])});var xT=Ma("Date",!0);Z("DDD",["DDDD",3],"DDDo","dayOfYear"),Ve("DDD",ce),Ve("DDDD",Ue),Cr(["DDD","DDDD"],function(g,A,F){F._dayOfYear=cr(g)});function wZ(g){var A=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return g==null?A:this.add(g-A,"d")}Z("m",["mm",2],0,"minute"),Ve("m",ke,gt),Ve("mm",ke,Ee),Cr(["m","mm"],ai);var SZ=Ma("Minutes",!1);Z("s",["ss",2],0,"second"),Ve("s",ke,gt),Ve("ss",ke,Ee),Cr(["s","ss"],Mn);var DZ=Ma("Seconds",!1);Z("S",0,0,function(){return~~(this.millisecond()/100)}),Z(0,["SS",2],0,function(){return~~(this.millisecond()/10)}),Z(0,["SSS",3],0,"millisecond"),Z(0,["SSSS",4],0,function(){return this.millisecond()*10}),Z(0,["SSSSS",5],0,function(){return this.millisecond()*100}),Z(0,["SSSSSS",6],0,function(){return this.millisecond()*1e3}),Z(0,["SSSSSSS",7],0,function(){return this.millisecond()*1e4}),Z(0,["SSSSSSSS",8],0,function(){return this.millisecond()*1e5}),Z(0,["SSSSSSSSS",9],0,function(){return this.millisecond()*1e6}),Ve("S",ce,De),Ve("SS",ce,Ee),Ve("SSS",ce,Ue);var nu,_T;for(nu="SSSS";nu.length<=9;nu+="S")Ve(nu,we);function EZ(g,A){A[Hi]=cr(("0."+g)*1e3)}for(nu="S";nu.length<=9;nu+="S")Cr(nu,EZ);_T=Ma("Milliseconds",!1),Z("z",0,0,"zoneAbbr"),Z("zz",0,0,"zoneName");function AZ(){return this._isUTC?"UTC":""}function TZ(){return this._isUTC?"Coordinated Universal Time":""}var Ze=w.prototype;Ze.add=bj,Ze.calendar=Aj,Ze.clone=Tj,Ze.diff=kj,Ze.endOf=jj,Ze.format=Rj,Ze.from=Lj,Ze.fromNow=Uj,Ze.to=zj,Ze.toNow=Vj,Ze.get=Bl,Ze.invalidAt=Qj,Ze.isAfter=Nj,Ze.isBefore=Mj,Ze.isBetween=Cj,Ze.isSame=$j,Ze.isSameOrAfter=Ij,Ze.isSameOrBefore=Fj,Ze.isValid=Xj,Ze.lang=dT,Ze.locale=mT,Ze.localeData=hT,Ze.max=X7,Ze.min=J7,Ze.parsingFlags=Kj,Ze.set=yf,Ze.startOf=qj,Ze.subtract=xj,Ze.toArray=Hj,Ze.toObject=Yj,Ze.toDate=Wj,Ze.toISOString=Bj,Ze.inspect=Oj,typeof Symbol<"u"&&Symbol.for!=null&&(Ze[Symbol.for("nodejs.util.inspect.custom")]=function(){return"Moment<"+this.format()+">"}),Ze.toJSON=Jj,Ze.toString=Pj,Ze.unix=Gj,Ze.valueOf=Zj,Ze.creationData=eZ,Ze.eraName=iZ,Ze.eraNarrow=oZ,Ze.eraAbbr=aZ,Ze.eraYear=sZ,Ze.year=ss,Ze.isLeapYear=kl,Ze.weekYear=dZ,Ze.isoWeekYear=hZ,Ze.quarter=Ze.quarters=_Z,Ze.month=HA,Ze.daysInMonth=Wq,Ze.week=Ze.weeks=t7,Ze.isoWeek=Ze.isoWeeks=r7,Ze.weeksInYear=yZ,Ze.weeksInWeekYear=bZ,Ze.isoWeeksInYear=gZ,Ze.isoWeeksInISOWeekYear=vZ,Ze.date=xT,Ze.day=Ze.days=h7,Ze.weekday=g7,Ze.isoWeekday=v7,Ze.dayOfYear=wZ,Ze.hour=Ze.hours=D7,Ze.minute=Ze.minutes=SZ,Ze.second=Ze.seconds=DZ,Ze.millisecond=Ze.milliseconds=_T,Ze.utcOffset=aj,Ze.utc=uj,Ze.local=lj,Ze.parseZone=cj,Ze.hasAlignedHourOffset=fj,Ze.isDST=pj,Ze.isLocal=dj,Ze.isUtcOffset=hj,Ze.isUtc=uT,Ze.isUTC=uT,Ze.zoneAbbr=AZ,Ze.zoneName=TZ,Ze.dates=T("dates accessor is deprecated. Use date instead.",xT),Ze.months=T("months accessor is deprecated. Use month instead",HA),Ze.years=T("years accessor is deprecated. Use year instead",ss),Ze.zone=T("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",sj),Ze.isDSTShifted=T("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",mj);function NZ(g){return rn(g*1e3)}function MZ(){return rn.apply(null,arguments).parseZone()}function wT(g){return g}var Ir=R.prototype;Ir.calendar=V,Ir.longDateFormat=K,Ir.invalidDate=ae,Ir.ordinal=_e,Ir.preparse=wT,Ir.postformat=wT,Ir.relativeTime=st,Ir.pastFuture=yt,Ir.set=$,Ir.eras=tZ,Ir.erasParse=rZ,Ir.erasConvertYear=nZ,Ir.erasAbbrRegex=lZ,Ir.erasNameRegex=uZ,Ir.erasNarrowRegex=cZ,Ir.months=$r,Ir.monthsShort=Fn,Ir.monthsParse=us,Ir.monthsRegex=Yq,Ir.monthsShortRegex=Hq,Ir.week=Xq,Ir.firstDayOfYear=e7,Ir.firstDayOfWeek=Qq,Ir.weekdays=c7,Ir.weekdaysMin=p7,Ir.weekdaysShort=f7,Ir.weekdaysParse=d7,Ir.weekdaysRegex=y7,Ir.weekdaysShortRegex=b7,Ir.weekdaysMinRegex=x7,Ir.isPM=w7,Ir.meridiem=E7;function Im(g,A,F,P){var j=cs(),se=m().set(P,A);return j[F](se,g)}function ST(g,A,F){if(l(g)&&(A=g,g=void 0),g=g||"",A!=null)return Im(g,A,F,"month");var P,j=[];for(P=0;P<12;P++)j[P]=Im(g,P,F,"month");return j}function Tx(g,A,F,P){typeof g=="boolean"?(l(A)&&(F=A,A=void 0),A=A||""):(A=g,F=A,g=!1,l(A)&&(F=A,A=void 0),A=A||"");var j=cs(),se=g?j._week.dow:0,Me,xt=[];if(F!=null)return Im(A,(F+se)%7,P,"day");for(Me=0;Me<7;Me++)xt[Me]=Im(A,(Me+se)%7,P,"day");return xt}function CZ(g,A){return ST(g,A,"months")}function $Z(g,A){return ST(g,A,"monthsShort")}function IZ(g,A,F){return Tx(g,A,F,"weekdays")}function FZ(g,A,F){return Tx(g,A,F,"weekdaysShort")}function kZ(g,A,F){return Tx(g,A,F,"weekdaysMin")}ru("en",{eras:[{since:"0001-01-01",until:1/0,offset:1,name:"Anno Domini",narrow:"AD",abbr:"AD"},{since:"0000-12-31",until:-1/0,offset:1,name:"Before Christ",narrow:"BC",abbr:"BC"}],dayOfMonthOrdinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(g){var A=g%10,F=cr(g%100/10)===1?"th":A===1?"st":A===2?"nd":A===3?"rd":"th";return g+F}}),e.lang=T("moment.lang is deprecated. Use moment.locale instead.",ru),e.langData=T("moment.langData is deprecated. Use moment.localeData instead.",cs);var fs=Math.abs;function PZ(){var g=this._data;return this._milliseconds=fs(this._milliseconds),this._days=fs(this._days),this._months=fs(this._months),g.milliseconds=fs(g.milliseconds),g.seconds=fs(g.seconds),g.minutes=fs(g.minutes),g.hours=fs(g.hours),g.months=fs(g.months),g.years=fs(g.years),this}function DT(g,A,F,P){var j=pa(A,F);return g._milliseconds+=P*j._milliseconds,g._days+=P*j._days,g._months+=P*j._months,g._bubble()}function BZ(g,A){return DT(this,g,A,1)}function OZ(g,A){return DT(this,g,A,-1)}function ET(g){return g<0?Math.floor(g):Math.ceil(g)}function RZ(){var g=this._milliseconds,A=this._days,F=this._months,P=this._data,j,se,Me,xt,er;return g>=0&&A>=0&&F>=0||g<=0&&A<=0&&F<=0||(g+=ET(Nx(F)+A)*864e5,A=0,F=0),P.milliseconds=g%1e3,j=Vn(g/1e3),P.seconds=j%60,se=Vn(j/60),P.minutes=se%60,Me=Vn(se/60),P.hours=Me%24,A+=Vn(Me/24),er=Vn(AT(A)),F+=er,A-=ET(Nx(er)),xt=Vn(F/12),F%=12,P.days=A,P.months=F,P.years=xt,this}function AT(g){return g*4800/146097}function Nx(g){return g*146097/4800}function LZ(g){if(!this.isValid())return NaN;var A,F,P=this._milliseconds;if(g=ut(g),g==="month"||g==="quarter"||g==="year")switch(A=this._days+P/864e5,F=this._months+AT(A),g){case"month":return F;case"quarter":return F/3;case"year":return F/12}else switch(A=this._days+Math.round(Nx(this._months)),g){case"week":return A/7+P/6048e5;case"day":return A+P/864e5;case"hour":return A*24+P/36e5;case"minute":return A*1440+P/6e4;case"second":return A*86400+P/1e3;case"millisecond":return Math.floor(A*864e5)+P;default:throw new Error("Unknown unit "+g)}}function ps(g){return function(){return this.as(g)}}var TT=ps("ms"),UZ=ps("s"),zZ=ps("m"),VZ=ps("h"),qZ=ps("d"),jZ=ps("w"),ZZ=ps("M"),GZ=ps("Q"),WZ=ps("y"),HZ=TT;function YZ(){return pa(this)}function JZ(g){return g=ut(g),this.isValid()?this[g+"s"]():NaN}function Lu(g){return function(){return this.isValid()?this._data[g]:NaN}}var XZ=Lu("milliseconds"),KZ=Lu("seconds"),QZ=Lu("minutes"),eG=Lu("hours"),tG=Lu("days"),rG=Lu("months"),nG=Lu("years");function iG(){return Vn(this.days()/7)}var ms=Math.round,Ul={ss:44,s:45,m:45,h:22,d:26,w:null,M:11};function oG(g,A,F,P,j){return j.relativeTime(A||1,!!F,g,P)}function aG(g,A,F,P){var j=pa(g).abs(),se=ms(j.as("s")),Me=ms(j.as("m")),xt=ms(j.as("h")),er=ms(j.as("d")),yr=ms(j.as("M")),Pi=ms(j.as("w")),ds=ms(j.as("y")),iu=se<=F.ss&&["s",se]||se<F.s&&["ss",se]||Me<=1&&["m"]||Me<F.m&&["mm",Me]||xt<=1&&["h"]||xt<F.h&&["hh",xt]||er<=1&&["d"]||er<F.d&&["dd",er];return F.w!=null&&(iu=iu||Pi<=1&&["w"]||Pi<F.w&&["ww",Pi]),iu=iu||yr<=1&&["M"]||yr<F.M&&["MM",yr]||ds<=1&&["y"]||["yy",ds],iu[2]=A,iu[3]=+g>0,iu[4]=P,oG.apply(null,iu)}function sG(g){return g===void 0?ms:typeof g=="function"?(ms=g,!0):!1}function uG(g,A){return Ul[g]===void 0?!1:A===void 0?Ul[g]:(Ul[g]=A,g==="s"&&(Ul.ss=A-1),!0)}function lG(g,A){if(!this.isValid())return this.localeData().invalidDate();var F=!1,P=Ul,j,se;return typeof g=="object"&&(A=g,g=!1),typeof g=="boolean"&&(F=g),typeof A=="object"&&(P=Object.assign({},Ul,A),A.s!=null&&A.ss==null&&(P.ss=A.s-1)),j=this.localeData(),se=aG(this,!F,P,j),F&&(se=j.pastFuture(+this,se)),j.postformat(se)}var Mx=Math.abs;function zl(g){return(g>0)-(g<0)||+g}function Fm(){if(!this.isValid())return this.localeData().invalidDate();var g=Mx(this._milliseconds)/1e3,A=Mx(this._days),F=Mx(this._months),P,j,se,Me,xt=this.asSeconds(),er,yr,Pi,ds;return xt?(P=Vn(g/60),j=Vn(P/60),g%=60,P%=60,se=Vn(F/12),F%=12,Me=g?g.toFixed(3).replace(/\.?0+$/,""):"",er=xt<0?"-":"",yr=zl(this._months)!==zl(xt)?"-":"",Pi=zl(this._days)!==zl(xt)?"-":"",ds=zl(this._milliseconds)!==zl(xt)?"-":"",er+"P"+(se?yr+se+"Y":"")+(F?yr+F+"M":"")+(A?Pi+A+"D":"")+(j||P||g?"T":"")+(j?ds+j+"H":"")+(P?ds+P+"M":"")+(g?ds+Me+"S":"")):"P0D"}var xr=Am.prototype;xr.isValid=rj,xr.abs=PZ,xr.add=BZ,xr.subtract=OZ,xr.as=LZ,xr.asMilliseconds=TT,xr.asSeconds=UZ,xr.asMinutes=zZ,xr.asHours=VZ,xr.asDays=qZ,xr.asWeeks=jZ,xr.asMonths=ZZ,xr.asQuarters=GZ,xr.asYears=WZ,xr.valueOf=HZ,xr._bubble=RZ,xr.clone=YZ,xr.get=JZ,xr.milliseconds=XZ,xr.seconds=KZ,xr.minutes=QZ,xr.hours=eG,xr.days=tG,xr.weeks=iG,xr.months=rG,xr.years=nG,xr.humanize=lG,xr.toISOString=Fm,xr.toString=Fm,xr.toJSON=Fm,xr.locale=mT,xr.localeData=hT,xr.toIsoString=T("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",Fm),xr.lang=dT,Z("X",0,0,"unix"),Z("x",0,0,"valueOf"),Ve("x",We),Ve("X",ne),Cr("X",function(g,A,F){F._d=new Date(parseFloat(g)*1e3)}),Cr("x",function(g,A,F){F._d=new Date(cr(g))});return e.version="2.30.1",r(rn),e.fn=Ze,e.min=K7,e.max=Q7,e.now=ej,e.utc=m,e.unix=NZ,e.months=CZ,e.isDate=u,e.locale=ru,e.invalid=y,e.duration=pa,e.isMoment=x,e.weekdays=IZ,e.parseZone=MZ,e.localeData=cs,e.isDuration=Tm,e.monthsShort=$Z,e.weekdaysMin=kZ,e.defineLocale=gx,e.updateLocale=M7,e.locales=C7,e.weekdaysShort=FZ,e.normalizeUnits=ut,e.relativeTimeRounding=sG,e.relativeTimeThreshold=uG,e.calendarFormat=Ej,e.prototype=Ze,e.HTML5_FMT={DATETIME_LOCAL:"YYYY-MM-DDTHH:mm",DATETIME_LOCAL_SECONDS:"YYYY-MM-DDTHH:mm:ss",DATETIME_LOCAL_MS:"YYYY-MM-DDTHH:mm:ss.SSS",DATE:"YYYY-MM-DD",TIME:"HH:mm",TIME_SECONDS:"HH:mm:ss",TIME_MS:"HH:mm:ss.SSS",WEEK:"GGGG-[W]WW",MONTH:"YYYY-MM"},e})});var Lv=jn((bD,xD)=>{(function(t,e){typeof bD=="object"&&typeof xD<"u"?xD.exports=e():typeof define=="function"&&define.amd?define(e):(t=typeof globalThis<"u"?globalThis:t||self,t["'typed'"]=e())})(bD,function(){"use strict";function t(){return!0}function e(){return!1}function r(){}let i="Argument is not a typed-function.";function n(){function a(Y){return typeof Y=="object"&&Y!==null&&Y.constructor===Object}let s=[{name:"number",test:function(Y){return typeof Y=="number"}},{name:"string",test:function(Y){return typeof Y=="string"}},{name:"boolean",test:function(Y){return typeof Y=="boolean"}},{name:"Function",test:function(Y){return typeof Y=="function"}},{name:"Array",test:Array.isArray},{name:"Date",test:function(Y){return Y instanceof Date}},{name:"RegExp",test:function(Y){return Y instanceof RegExp}},{name:"Object",test:a},{name:"null",test:function(Y){return Y===null}},{name:"undefined",test:function(Y){return Y===void 0}}],l={name:"any",test:t,isAny:!0},u,c,f=0,m={createCount:0};function p(Y){let me=u.get(Y);if(me)return me;let ce='Unknown type "'+Y+'"',Ce=Y.toLowerCase(),Pe;for(Pe of c)if(Pe.toLowerCase()===Ce){ce+='. Did you mean "'+Pe+'" ?';break}throw new TypeError(ce)}function d(Y){let me=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"any",ce=me?p(me).index:c.length,Ce=[];for(let we=0;we<Y.length;++we){if(!Y[we]||typeof Y[we].name!="string"||typeof Y[we].test!="function")throw new TypeError("Object with properties {name: string, test: function} expected");let We=Y[we].name;if(u.has(We))throw new TypeError('Duplicate type name "'+We+'"');Ce.push(We),u.set(We,{name:We,test:Y[we].test,isAny:Y[we].isAny,index:ce+we,conversionsTo:[]})}let Pe=c.slice(ce);c=c.slice(0,ce).concat(Ce).concat(Pe);for(let we=ce+Ce.length;we<c.length;++we)u.get(c[we]).index=we}function h(){u=new Map,c=[],f=0,d([l],!1)}h(),d(s);function v(){let Y;for(Y of c)u.get(Y).conversionsTo=[];f=0}function y(Y){let me=c.filter(ce=>{let Ce=u.get(ce);return!Ce.isAny&&Ce.test(Y)});return me.length?me:["any"]}function S(Y){return Y&&typeof Y=="function"&&"_typedFunctionData"in Y}function b(Y,me,ce){if(!S(Y))throw new TypeError(i);let Ce=ce&&ce.exact,Pe=Array.isArray(me)?me.join(","):me,we=M(Pe),We=x(we);if(!Ce||We in Y.signatures){let Ne=Y._typedFunctionData.signatureMap.get(We);if(Ne)return Ne}let I=we.length,X;if(Ce){X=[];let Ne;for(Ne in Y.signatures)X.push(Y._typedFunctionData.signatureMap.get(Ne))}else X=Y._typedFunctionData.signatures;for(let Ne=0;Ne<I;++Ne){let Xe=we[Ne],gt=[],lr;for(lr of X){let Ve=R(lr.params,Ne);if(!(!Ve||Xe.restParam&&!Ve.restParam)){if(!Ve.hasAny){let yi=D(Ve);if(Xe.types.some(ki=>!yi.has(ki.name)))continue}gt.push(lr)}}if(X=gt,X.length===0)break}let ne;for(ne of X)if(ne.params.length<=I)return ne;throw new TypeError("Signature not found (signature: "+(Y.name||"unnamed")+"("+x(we,", ")+"))")}function _(Y,me,ce){return b(Y,me,ce).implementation}function w(Y,me){let ce=p(me);if(ce.test(Y))return Y;let Ce=ce.conversionsTo;if(Ce.length===0)throw new Error("There are no conversions to "+me+" defined.");for(let Pe=0;Pe<Ce.length;Pe++)if(p(Ce[Pe].from).test(Y))return Ce[Pe].convert(Y);throw new Error("Cannot convert "+Y+" to "+me)}function x(Y){let me=arguments.length>1&&arguments[1]!==void 0?arguments[1]:",";return Y.map(ce=>ce.name).join(me)}function E(Y){let me=Y.indexOf("...")===0,Ce=(me?Y.length>3?Y.slice(3):"any":Y).split("|").map(I=>p(I.trim())),Pe=!1,we=me?"...":"";return{types:Ce.map(function(I){return Pe=I.isAny||Pe,we+=I.name+"|",{name:I.name,typeIndex:I.index,test:I.test,isAny:I.isAny,conversion:null,conversionIndex:-1}}),name:we.slice(0,-1),hasAny:Pe,hasConversion:!1,restParam:me}}function T(Y){let me=Y.types.map(We=>We.name),ce=Z(me),Ce=Y.hasAny,Pe=Y.name,we=ce.map(function(We){let I=p(We.from);return Ce=I.isAny||Ce,Pe+="|"+We.from,{name:We.from,typeIndex:I.index,test:I.test,isAny:I.isAny,conversion:We,conversionIndex:We.index}});return{types:Y.types.concat(we),name:Pe,hasAny:Ce,hasConversion:we.length>0,restParam:Y.restParam}}function D(Y){return Y.typeSet||(Y.typeSet=new Set,Y.types.forEach(me=>Y.typeSet.add(me.name))),Y.typeSet}function M(Y){let me=[];if(typeof Y!="string")throw new TypeError("Signatures must be strings");let ce=Y.trim();if(ce==="")return me;let Ce=ce.split(",");for(let Pe=0;Pe<Ce.length;++Pe){let we=E(Ce[Pe].trim());if(we.restParam&&Pe!==Ce.length-1)throw new SyntaxError('Unexpected rest parameter "'+Ce[Pe]+'": only allowed for the last parameter');if(we.types.length===0)return null;me.push(we)}return me}function C(Y){let me=Oe(Y);return me?me.restParam:!1}function $(Y){if(!Y||Y.types.length===0)return t;if(Y.types.length===1)return p(Y.types[0].name).test;if(Y.types.length===2){let me=p(Y.types[0].name).test,ce=p(Y.types[1].name).test;return function(Pe){return me(Pe)||ce(Pe)}}else{let me=Y.types.map(function(ce){return p(ce.name).test});return function(Ce){for(let Pe=0;Pe<me.length;Pe++)if(me[Pe](Ce))return!0;return!1}}}function O(Y){let me,ce,Ce;if(C(Y)){me=_e(Y).map($);let Pe=me.length,we=$(Oe(Y)),We=function(I){for(let X=Pe;X<I.length;X++)if(!we(I[X]))return!1;return!0};return function(X){for(let ne=0;ne<me.length;ne++)if(!me[ne](X[ne]))return!1;return We(X)&&X.length>=Pe+1}}else return Y.length===0?function(we){return we.length===0}:Y.length===1?(ce=$(Y[0]),function(we){return ce(we[0])&&we.length===1}):Y.length===2?(ce=$(Y[0]),Ce=$(Y[1]),function(we){return ce(we[0])&&Ce(we[1])&&we.length===2}):(me=Y.map($),function(we){for(let We=0;We<me.length;We++)if(!me[We](we[We]))return!1;return we.length===me.length})}function R(Y,me){return me<Y.length?Y[me]:C(Y)?Oe(Y):null}function L(Y,me){let ce=R(Y,me);return ce?D(ce):new Set}function k(Y){return Y.conversion===null||Y.conversion===void 0}function V(Y,me){let ce=new Set;return Y.forEach(Ce=>{let Pe=L(Ce.params,me),we;for(we of Pe)ce.add(we)}),ce.has("any")?["any"]:Array.from(ce)}function J(Y,me,ce){let Ce,Pe,we=Y||"unnamed",We=ce,I;for(I=0;I<me.length;I++){let Xe=[];if(We.forEach(gt=>{let lr=R(gt.params,I),Ve=$(lr);(I<gt.params.length||C(gt.params))&&Ve(me[I])&&Xe.push(gt)}),Xe.length===0){if(Pe=V(We,I),Pe.length>0){let gt=y(me[I]);return Ce=new TypeError("Unexpected type of argument in function "+we+" (expected: "+Pe.join(" or ")+", actual: "+gt.join(" | ")+", index: "+I+")"),Ce.data={category:"wrongType",fn:we,index:I,actual:gt,expected:Pe},Ce}}else We=Xe}let X=We.map(function(Xe){return C(Xe.params)?1/0:Xe.params.length});if(me.length<Math.min.apply(null,X))return Pe=V(We,I),Ce=new TypeError("Too few arguments in function "+we+" (expected: "+Pe.join(" or ")+", index: "+me.length+")"),Ce.data={category:"tooFewArgs",fn:we,index:me.length,expected:Pe},Ce;let ne=Math.max.apply(null,X);if(me.length>ne)return Ce=new TypeError("Too many arguments in function "+we+" (expected: "+ne+", actual: "+me.length+")"),Ce.data={category:"tooManyArgs",fn:we,index:me.length,expectedLength:ne},Ce;let Ne=[];for(let Xe=0;Xe<me.length;++Xe)Ne.push(y(me[Xe]).join("|"));return Ce=new TypeError('Arguments of type "'+Ne.join(", ")+'" do not match any of the defined signatures of function '+we+"."),Ce.data={category:"mismatch",actual:Ne},Ce}function W(Y){let me=c.length+1;for(let ce=0;ce<Y.types.length;ce++)k(Y.types[ce])&&(me=Math.min(me,Y.types[ce].typeIndex));return me}function Q(Y){let me=f+1;for(let ce=0;ce<Y.types.length;ce++)k(Y.types[ce])||(me=Math.min(me,Y.types[ce].conversionIndex));return me}function ie(Y,me){if(Y.hasAny){if(!me.hasAny)return 1}else if(me.hasAny)return-1;if(Y.restParam){if(!me.restParam)return 1}else if(me.restParam)return-1;if(Y.hasConversion){if(!me.hasConversion)return 1}else if(me.hasConversion)return-1;let ce=W(Y)-W(me);if(ce<0)return-1;if(ce>0)return 1;let Ce=Q(Y)-Q(me);return Ce<0?-1:Ce>0?1:0}function B(Y,me){let ce=Y.params,Ce=me.params,Pe=Oe(ce),we=Oe(Ce),We=C(ce),I=C(Ce);if(We&&Pe.hasAny){if(!I||!we.hasAny)return 1}else if(I&&we.hasAny)return-1;let X=0,ne=0,Ne;for(Ne of ce)Ne.hasAny&&++X,Ne.hasConversion&&++ne;let Xe=0,gt=0;for(Ne of Ce)Ne.hasAny&&++Xe,Ne.hasConversion&&++gt;if(X!==Xe)return X-Xe;if(We&&Pe.hasConversion){if(!I||!we.hasConversion)return 1}else if(I&&we.hasConversion)return-1;if(ne!==gt)return ne-gt;if(We){if(!I)return 1}else if(I)return-1;let lr=(ce.length-Ce.length)*(We?-1:1);if(lr!==0)return lr;let Ve=[],yi=0;for(let en=0;en<ce.length;++en){let Vn=ie(ce[en],Ce[en]);Ve.push(Vn),yi+=Vn}if(yi!==0)return yi;let ki;for(ki of Ve)if(ki!==0)return ki;return 0}function Z(Y){if(Y.length===0)return[];let me=Y.map(p);Y.length>1&&me.sort((Pe,we)=>Pe.index-we.index);let ce=me[0].conversionsTo;if(Y.length===1)return ce;ce=ce.concat([]);let Ce=new Set(Y);for(let Pe=1;Pe<me.length;++Pe){let we;for(we of me[Pe].conversionsTo)Ce.has(we.from)||(ce.push(we),Ce.add(we.from))}return ce}function q(Y,me){let ce=me;if(Y.some(Pe=>Pe.hasConversion)){let Pe=C(Y),we=Y.map(xe);ce=function(){let I=[],X=Pe?arguments.length-1:arguments.length;for(let ne=0;ne<X;ne++)I[ne]=we[ne](arguments[ne]);return Pe&&(I[X]=arguments[X].map(we[X])),me.apply(this,I)}}let Ce=ce;if(C(Y)){let Pe=Y.length-1;Ce=function(){return ce.apply(this,st(arguments,0,Pe).concat([st(arguments,Pe)]))}}return Ce}function xe(Y){let me,ce,Ce,Pe,we=[],We=[];switch(Y.types.forEach(function(I){I.conversion&&(we.push(p(I.conversion.from).test),We.push(I.conversion.convert))}),We.length){case 0:return function(X){return X};case 1:return me=we[0],Ce=We[0],function(X){return me(X)?Ce(X):X};case 2:return me=we[0],ce=we[1],Ce=We[0],Pe=We[1],function(X){return me(X)?Ce(X):ce(X)?Pe(X):X};default:return function(X){for(let ne=0;ne<We.length;ne++)if(we[ne](X))return We[ne](X);return X}}}function de(Y){function me(ce,Ce,Pe){if(Ce<ce.length){let we=ce[Ce],We=[];if(we.restParam){let I=we.types.filter(k);I.length<we.types.length&&We.push({types:I,name:"..."+I.map(X=>X.name).join("|"),hasAny:I.some(X=>X.isAny),hasConversion:!1,restParam:!0}),We.push(we)}else We=we.types.map(function(I){return{types:[I],name:I.name,hasAny:I.isAny,hasConversion:I.conversion,restParam:!1}});return Qe(We,function(I){return me(ce,Ce+1,Pe.concat([I]))})}else return[Pe]}return me(Y,0,[])}function be(Y,me){let ce=Math.max(Y.length,me.length);for(let I=0;I<ce;I++){let X=L(Y,I),ne=L(me,I),Ne=!1,Xe;for(Xe of ne)if(X.has(Xe)){Ne=!0;break}if(!Ne)return!1}let Ce=Y.length,Pe=me.length,we=C(Y),We=C(me);return we?We?Ce===Pe:Pe>=Ce:We?Ce>=Pe:Ce===Pe}function G(Y){return Y.map(me=>De(me)?oe(me.referToSelf.callback):ve(me)?H(me.referTo.references,me.referTo.callback):me)}function K(Y,me,ce){let Ce=[],Pe;for(Pe of Y){let we=ce[Pe];if(typeof we!="number")throw new TypeError('No definition for referenced signature "'+Pe+'"');if(we=me[we],typeof we!="function")return!1;Ce.push(we)}return Ce}function re(Y,me,ce){let Ce=G(Y),Pe=new Array(Ce.length).fill(!1),we=!0;for(;we;){we=!1;let We=!0;for(let I=0;I<Ce.length;++I){if(Pe[I])continue;let X=Ce[I];if(De(X))Ce[I]=X.referToSelf.callback(ce),Ce[I].referToSelf=X.referToSelf,Pe[I]=!0,We=!1;else if(ve(X)){let ne=K(X.referTo.references,Ce,me);ne?(Ce[I]=X.referTo.callback.apply(this,ne),Ce[I].referTo=X.referTo,Pe[I]=!0,We=!1):we=!0}}if(We&&we)throw new SyntaxError("Circular reference detected in resolving typed.referTo")}return Ce}function ae(Y){let me=/\bthis(\(|\.signatures\b)/;Object.keys(Y).forEach(ce=>{let Ce=Y[ce];if(me.test(Ce.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 le(Y,me){if(m.createCount++,Object.keys(me).length===0)throw new SyntaxError("No signatures provided");m.warnAgainstDeprecatedThis&&ae(me);let ce=[],Ce=[],Pe={},we=[],We;for(We in me){if(!Object.prototype.hasOwnProperty.call(me,We))continue;let qe=M(We);if(!qe)continue;ce.forEach(function(kn){if(be(kn,qe))throw new TypeError('Conflicting signatures "'+x(kn)+'" and "'+x(qe)+'".')}),ce.push(qe);let qt=Ce.length;Ce.push(me[We]);let $r=qe.map(T),Fn;for(Fn of de($r)){let kn=x(Fn);we.push({params:Fn,name:kn,fn:qt}),Fn.every(us=>!us.hasConversion)&&(Pe[kn]=qt)}}we.sort(B);let I=re(Ce,Pe,et),X;for(X in Pe)Object.prototype.hasOwnProperty.call(Pe,X)&&(Pe[X]=I[Pe[X]]);let ne=[],Ne=new Map;for(X of we)Ne.has(X.name)||(X.fn=I[X.fn],ne.push(X),Ne.set(X.name,X));let Xe=ne[0]&&ne[0].params.length<=2&&!C(ne[0].params),gt=ne[1]&&ne[1].params.length<=2&&!C(ne[1].params),lr=ne[2]&&ne[2].params.length<=2&&!C(ne[2].params),Ve=ne[3]&&ne[3].params.length<=2&&!C(ne[3].params),yi=ne[4]&&ne[4].params.length<=2&&!C(ne[4].params),ki=ne[5]&&ne[5].params.length<=2&&!C(ne[5].params),en=Xe&&gt&&lr&&Ve&&yi&&ki;for(let qe=0;qe<ne.length;++qe)ne[qe].test=O(ne[qe].params);let Vn=Xe?$(ne[0].params[0]):e,cr=gt?$(ne[1].params[0]):e,tu=lr?$(ne[2].params[0]):e,Cr=Ve?$(ne[3].params[0]):e,Gi=yi?$(ne[4].params[0]):e,Vo=ki?$(ne[5].params[0]):e,go=Xe?$(ne[0].params[1]):e,Nn=gt?$(ne[1].params[1]):e,qn=lr?$(ne[2].params[1]):e,Wi=Ve?$(ne[3].params[1]):e,ln=yi?$(ne[4].params[1]):e,ai=ki?$(ne[5].params[1]):e;for(let qe=0;qe<ne.length;++qe)ne[qe].implementation=q(ne[qe].params,ne[qe].fn);let Mn=Xe?ne[0].implementation:r,Hi=gt?ne[1].implementation:r,vf=lr?ne[2].implementation:r,Fl=Ve?ne[3].implementation:r,as=yi?ne[4].implementation:r,ss=ki?ne[5].implementation:r,kl=Xe?ne[0].params.length:-1,Ma=gt?ne[1].params.length:-1,fa=lr?ne[2].params.length:-1,Pl=Ve?ne[3].params.length:-1,Bl=yi?ne[4].params.length:-1,yf=ki?ne[5].params.length:-1,bf=en?6:0,tn=ne.length,z=ne.map(qe=>qe.test),te=ne.map(qe=>qe.implementation),$e=function(){for(let qt=bf;qt<tn;qt++)if(z[qt](arguments))return te[qt].apply(this,arguments);return m.onMismatch(Y,arguments,ne)};function et(qe,qt){return arguments.length===kl&&Vn(qe)&&go(qt)?Mn.apply(this,arguments):arguments.length===Ma&&cr(qe)&&Nn(qt)?Hi.apply(this,arguments):arguments.length===fa&&tu(qe)&&qn(qt)?vf.apply(this,arguments):arguments.length===Pl&&Cr(qe)&&Wi(qt)?Fl.apply(this,arguments):arguments.length===Bl&&Gi(qe)&&ln(qt)?as.apply(this,arguments):arguments.length===yf&&Vo(qe)&&ai(qt)?ss.apply(this,arguments):$e.apply(this,arguments)}try{Object.defineProperty(et,"name",{value:Y})}catch{}return et.signatures=Pe,et._typedFunctionData={signatures:ne,signatureMap:Ne},et}function Se(Y,me,ce){throw J(Y,me,ce)}function _e(Y){return st(Y,0,Y.length-1)}function Oe(Y){return Y[Y.length-1]}function st(Y,me,ce){return Array.prototype.slice.call(Y,me,ce)}function yt(Y,me){for(let ce=0;ce<Y.length;ce++)if(me(Y[ce]))return Y[ce]}function Qe(Y,me){return Array.prototype.concat.apply([],Y.map(me))}function ut(){let Y=_e(arguments).map(ce=>x(M(ce))),me=Oe(arguments);if(typeof me!="function")throw new TypeError("Callback function expected as last argument");return H(Y,me)}function H(Y,me){return{referTo:{references:Y,callback:me}}}function oe(Y){if(typeof Y!="function")throw new TypeError("Callback function expected as first argument");return{referToSelf:{callback:Y}}}function ve(Y){return Y&&typeof Y.referTo=="object"&&Array.isArray(Y.referTo.references)&&typeof Y.referTo.callback=="function"}function De(Y){return Y&&typeof Y.referToSelf=="object"&&typeof Y.referToSelf.callback=="function"}function Ee(Y,me){if(!Y)return me;if(me&&me!==Y){let ce=new Error("Function names do not match (expected: "+Y+", actual: "+me+")");throw ce.data={actual:me,expected:Y},ce}return Y}function Ue(Y){let me;for(let ce in Y)Object.prototype.hasOwnProperty.call(Y,ce)&&(S(Y[ce])||typeof Y[ce].signature=="string")&&(me=Ee(me,Y[ce].name));return me}function He(Y,me){let ce;for(ce in me)if(Object.prototype.hasOwnProperty.call(me,ce)){if(ce in Y&&me[ce]!==Y[ce]){let Ce=new Error('Signature "'+ce+'" is defined twice');throw Ce.data={signature:ce,sourceFunction:me[ce],destFunction:Y[ce]},Ce}Y[ce]=me[ce]}}let nt=m;m=function(Y){let me=typeof Y=="string",ce=me?1:0,Ce=me?Y:"",Pe={};for(let we=ce;we<arguments.length;++we){let We=arguments[we],I={},X;if(typeof We=="function"?(X=We.name,typeof We.signature=="string"?I[We.signature]=We:S(We)&&(I=We.signatures)):a(We)&&(I=We,me||(X=Ue(We))),Object.keys(I).length===0){let ne=new TypeError("Argument to 'typed' at index "+we+" is not a (typed) function, nor an object with signatures as keys and functions as values.");throw ne.data={index:we,argument:We},ne}me||(Ce=Ee(Ce,X)),He(Pe,I)}return le(Ce||"",Pe)},m.create=n,m.createCount=nt.createCount,m.onMismatch=Se,m.throwMismatchError=Se,m.createError=J,m.clear=h,m.clearConversions=v,m.addTypes=d,m._findType=p,m.referTo=ut,m.referToSelf=oe,m.convert=w,m.findSignature=b,m.find=_,m.isTypedFunction=S,m.warnAgainstDeprecatedThis=!0,m.addType=function(Y,me){let ce="any";me!==!1&&u.has("Object")&&(ce="Object"),m.addTypes([Y],ce)};function ke(Y){if(!Y||typeof Y.from!="string"||typeof Y.to!="string"||typeof Y.convert!="function")throw new TypeError("Object with properties {from: string, to: string, convert: function} expected");if(Y.to===Y.from)throw new SyntaxError('Illegal to define conversion from "'+Y.from+'" to itself.')}return m.addConversion=function(Y){let me=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{override:!1};ke(Y);let ce=p(Y.to),Ce=ce.conversionsTo.find(Pe=>Pe.from===Y.from);if(Ce)if(me&&me.override)m.removeConversion({from:Ce.from,to:Y.to,convert:Ce.convert});else throw new Error('There is already a conversion from "'+Y.from+'" to "'+ce.name+'"');ce.conversionsTo.push({from:Y.from,convert:Y.convert,index:f++})},m.addConversions=function(Y,me){Y.forEach(ce=>m.addConversion(ce,me))},m.removeConversion=function(Y){ke(Y);let me=p(Y.to),ce=yt(me.conversionsTo,Pe=>Pe.from===Y.from);if(!ce)throw new Error("Attempt to remove nonexistent conversion from "+Y.from+" to "+Y.to);if(ce.convert!==Y.convert)throw new Error("Conversion to remove does not match existing conversion");let Ce=me.conversionsTo.indexOf(ce);me.conversionsTo.splice(Ce,1)},m.resolve=function(Y,me){if(!S(Y))throw new TypeError(i);let ce=Y._typedFunctionData.signatures;for(let Ce=0;Ce<ce.length;++Ce)if(ce[Ce].test(me))return ce[Ce];return null},m}var o=n();return o})});var hO=jn((y7e,dO)=>{dO.exports=function t(e,r){"use strict";var i=/(^([+\-]?(?:0|[1-9]\d*)(?:\.\d*)?(?:[eE][+\-]?\d+)?)?$|^0x[0-9a-f]+$|\d+)/gi,n=/(^[ ]*|[ ]*$)/g,o=/(^([\w ]+,?[\w ]+)?[\w ]+,?[\w ]+\d+:\d+(:\d+)?[\w ]?|^\d{1,4}[\/\-]\d{1,4}[\/\-]\d{1,4}|^\w+, \w+ \d+, \d{4})/,a=/^0x[0-9a-f]+$/i,s=/^0/,l=function(b){return t.insensitive&&(""+b).toLowerCase()||""+b},u=l(e).replace(n,"")||"",c=l(r).replace(n,"")||"",f=u.replace(i,"\0$1\0").replace(/\0$/,"").replace(/^\0/,"").split("\0"),m=c.replace(i,"\0$1\0").replace(/\0$/,"").replace(/^\0/,"").split("\0"),p=parseInt(u.match(a),16)||f.length!==1&&u.match(o)&&Date.parse(u),d=parseInt(c.match(a),16)||p&&c.match(o)&&Date.parse(c)||null,h,v;if(d){if(p<d)return-1;if(p>d)return 1}for(var y=0,S=Math.max(f.length,m.length);y<S;y++){if(h=!(f[y]||"").match(s)&&parseFloat(f[y])||f[y]||0,v=!(m[y]||"").match(s)&&parseFloat(m[y])||m[y]||0,isNaN(h)!==isNaN(v))return isNaN(h)?1:-1;if(typeof h!=typeof v&&(h+="",v+=""),h<v)return-1;if(h>v)return 1}return 0}});var IL=jn((UHe,$L)=>{"use strict";var jE=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(t[i]=r[i])}return t},dae={"{":"\\{","}":"\\}","\\":"\\textbackslash{}","#":"\\#",$:"\\$","%":"\\%","&":"\\&","^":"\\textasciicircum{}",_:"\\_","~":"\\textasciitilde{}"},hae={"\u2013":"\\--","\u2014":"\\---"," ":"~"," ":"\\qquad{}","\r\n":"\\newline{}","\n":"\\newline{}"},gae=function(e,r){return jE({},e,r)};$L.exports=function(t){for(var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},r=e.preserveFormatting,i=r===void 0?!1:r,n=e.escapeMapFn,o=n===void 0?gae:n,a=String(t),s="",l=o(jE({},dae),i?jE({},hae):{}),u=Object.keys(l),c=function(){var m=!1;u.forEach(function(p,d){m||a.length>=p.length&&a.slice(0,p.length)===p&&(s+=l[u[d]],a=a.slice(p.length,a.length),m=!0)}),m||(s+=a.slice(0,1),a=a.slice(1,a.length))};a;)c();return s}});var s5=jn((a5,KE)=>{(function(t,e,r){function i(s){var l=this,u=a();l.next=function(){var c=2091639*l.s0+l.c*23283064365386963e-26;return l.s0=l.s1,l.s1=l.s2,l.s2=c-(l.c=c|0)},l.c=1,l.s0=u(" "),l.s1=u(" "),l.s2=u(" "),l.s0-=u(s),l.s0<0&&(l.s0+=1),l.s1-=u(s),l.s1<0&&(l.s1+=1),l.s2-=u(s),l.s2<0&&(l.s2+=1),u=null}function n(s,l){return l.c=s.c,l.s0=s.s0,l.s1=s.s1,l.s2=s.s2,l}function o(s,l){var u=new i(s),c=l&&l.state,f=u.next;return f.int32=function(){return u.next()*4294967296|0},f.double=function(){return f()+(f()*2097152|0)*11102230246251565e-32},f.quick=f,c&&(typeof c=="object"&&n(c,u),f.state=function(){return n(u,{})}),f}function a(){var s=4022871197,l=function(u){u=String(u);for(var c=0;c<u.length;c++){s+=u.charCodeAt(c);var f=.02519603282416938*s;s=f>>>0,f-=s,f*=s,s=f>>>0,f-=s,s+=f*4294967296}return(s>>>0)*23283064365386963e-26};return l}e&&e.exports?e.exports=o:r&&r.amd?r(function(){return o}):this.alea=o})(a5,typeof KE=="object"&&KE,typeof define=="function"&&define)});var l5=jn((u5,QE)=>{(function(t,e,r){function i(a){var s=this,l="";s.x=0,s.y=0,s.z=0,s.w=0,s.next=function(){var c=s.x^s.x<<11;return s.x=s.y,s.y=s.z,s.z=s.w,s.w^=s.w>>>19^c^c>>>8},a===(a|0)?s.x=a:l+=a;for(var u=0;u<l.length+64;u++)s.x^=l.charCodeAt(u)|0,s.next()}function n(a,s){return s.x=a.x,s.y=a.y,s.z=a.z,s.w=a.w,s}function o(a,s){var l=new i(a),u=s&&s.state,c=function(){return(l.next()>>>0)/4294967296};return c.double=function(){do var f=l.next()>>>11,m=(l.next()>>>0)/4294967296,p=(f+m)/(1<<21);while(p===0);return p},c.int32=l.next,c.quick=c,u&&(typeof u=="object"&&n(u,l),c.state=function(){return n(l,{})}),c}e&&e.exports?e.exports=o:r&&r.amd?r(function(){return o}):this.xor128=o})(u5,typeof QE=="object"&&QE,typeof define=="function"&&define)});var f5=jn((c5,eA)=>{(function(t,e,r){function i(a){var s=this,l="";s.next=function(){var c=s.x^s.x>>>2;return s.x=s.y,s.y=s.z,s.z=s.w,s.w=s.v,(s.d=s.d+362437|0)+(s.v=s.v^s.v<<4^(c^c<<1))|0},s.x=0,s.y=0,s.z=0,s.w=0,s.v=0,a===(a|0)?s.x=a:l+=a;for(var u=0;u<l.length+64;u++)s.x^=l.charCodeAt(u)|0,u==l.length&&(s.d=s.x<<10^s.x>>>4),s.next()}function n(a,s){return s.x=a.x,s.y=a.y,s.z=a.z,s.w=a.w,s.v=a.v,s.d=a.d,s}function o(a,s){var l=new i(a),u=s&&s.state,c=function(){return(l.next()>>>0)/4294967296};return c.double=function(){do var f=l.next()>>>11,m=(l.next()>>>0)/4294967296,p=(f+m)/(1<<21);while(p===0);return p},c.int32=l.next,c.quick=c,u&&(typeof u=="object"&&n(u,l),c.state=function(){return n(l,{})}),c}e&&e.exports?e.exports=o:r&&r.amd?r(function(){return o}):this.xorwow=o})(c5,typeof eA=="object"&&eA,typeof define=="function"&&define)});var m5=jn((p5,tA)=>{(function(t,e,r){function i(a){var s=this;s.next=function(){var u=s.x,c=s.i,f,m,p;return f=u[c],f^=f>>>7,m=f^f<<24,f=u[c+1&7],m^=f^f>>>10,f=u[c+3&7],m^=f^f>>>3,f=u[c+4&7],m^=f^f<<7,f=u[c+7&7],f=f^f<<13,m^=f^f<<9,u[c]=m,s.i=c+1&7,m};function l(u,c){var f,m,p=[];if(c===(c|0))m=p[0]=c;else for(c=""+c,f=0;f<c.length;++f)p[f&7]=p[f&7]<<15^c.charCodeAt(f)+p[f+1&7]<<13;for(;p.length<8;)p.push(0);for(f=0;f<8&&p[f]===0;++f);for(f==8?m=p[7]=-1:m=p[f],u.x=p,u.i=0,f=256;f>0;--f)u.next()}l(s,a)}function n(a,s){return s.x=a.x.slice(),s.i=a.i,s}function o(a,s){a==null&&(a=+new Date);var l=new i(a),u=s&&s.state,c=function(){return(l.next()>>>0)/4294967296};return c.double=function(){do var f=l.next()>>>11,m=(l.next()>>>0)/4294967296,p=(f+m)/(1<<21);while(p===0);return p},c.int32=l.next,c.quick=c,u&&(u.x&&n(u,l),c.state=function(){return n(l,{})}),c}e&&e.exports?e.exports=o:r&&r.amd?r(function(){return o}):this.xorshift7=o})(p5,typeof tA=="object"&&tA,typeof define=="function"&&define)});var h5=jn((d5,rA)=>{(function(t,e,r){function i(a){var s=this;s.next=function(){var u=s.w,c=s.X,f=s.i,m,p;return s.w=u=u+1640531527|0,p=c[f+34&127],m=c[f=f+1&127],p^=p<<13,m^=m<<17,p^=p>>>15,m^=m>>>12,p=c[f]=p^m,s.i=f,p+(u^u>>>16)|0};function l(u,c){var f,m,p,d,h,v=[],y=128;for(c===(c|0)?(m=c,c=null):(c=c+"\0",m=0,y=Math.max(y,c.length)),p=0,d=-32;d<y;++d)c&&(m^=c.charCodeAt((d+32)%c.length)),d===0&&(h=m),m^=m<<10,m^=m>>>15,m^=m<<4,m^=m>>>13,d>=0&&(h=h+1640531527|0,f=v[d&127]^=m+h,p=f==0?p+1:0);for(p>=128&&(v[(c&&c.length||0)&127]=-1),p=127,d=512;d>0;--d)m=v[p+34&127],f=v[p=p+1&127],m^=m<<13,f^=f<<17,m^=m>>>15,f^=f>>>12,v[p]=m^f;u.w=h,u.X=v,u.i=p}l(s,a)}function n(a,s){return s.i=a.i,s.w=a.w,s.X=a.X.slice(),s}function o(a,s){a==null&&(a=+new Date);var l=new i(a),u=s&&s.state,c=function(){return(l.next()>>>0)/4294967296};return c.double=function(){do var f=l.next()>>>11,m=(l.next()>>>0)/4294967296,p=(f+m)/(1<<21);while(p===0);return p},c.int32=l.next,c.quick=c,u&&(u.X&&n(u,l),c.state=function(){return n(l,{})}),c}e&&e.exports?e.exports=o:r&&r.amd?r(function(){return o}):this.xor4096=o})(d5,typeof rA=="object"&&rA,typeof define=="function"&&define)});var v5=jn((g5,nA)=>{(function(t,e,r){function i(a){var s=this,l="";s.next=function(){var c=s.b,f=s.c,m=s.d,p=s.a;return c=c<<25^c>>>7^f,f=f-m|0,m=m<<24^m>>>8^p,p=p-c|0,s.b=c=c<<20^c>>>12^f,s.c=f=f-m|0,s.d=m<<16^f>>>16^p,s.a=p-c|0},s.a=0,s.b=0,s.c=-1640531527,s.d=1367130551,a===Math.floor(a)?(s.a=a/4294967296|0,s.b=a|0):l+=a;for(var u=0;u<l.length+20;u++)s.b^=l.charCodeAt(u)|0,s.next()}function n(a,s){return s.a=a.a,s.b=a.b,s.c=a.c,s.d=a.d,s}function o(a,s){var l=new i(a),u=s&&s.state,c=function(){return(l.next()>>>0)/4294967296};return c.double=function(){do var f=l.next()>>>11,m=(l.next()>>>0)/4294967296,p=(f+m)/(1<<21);while(p===0);return p},c.int32=l.next,c.quick=c,u&&(typeof u=="object"&&n(u,l),c.state=function(){return n(l,{})}),c}e&&e.exports?e.exports=o:r&&r.amd?r(function(){return o}):this.tychei=o})(g5,typeof nA=="object"&&nA,typeof define=="function"&&define)});var b5=jn((y5,xb)=>{(function(t,e,r){var i=256,n=6,o=52,a="random",s=r.pow(i,n),l=r.pow(2,o),u=l*2,c=i-1,f;function m(b,_,w){var x=[];_=_==!0?{entropy:!0}:_||{};var E=v(h(_.entropy?[b,S(e)]:b??y(),3),x),T=new p(x),D=function(){for(var M=T.g(n),C=s,$=0;M<l;)M=(M+$)*i,C*=i,$=T.g(1);for(;M>=u;)M/=2,C/=2,$>>>=1;return(M+$)/C};return D.int32=function(){return T.g(4)|0},D.quick=function(){return T.g(4)/4294967296},D.double=D,v(S(T.S),e),(_.pass||w||function(M,C,$,O){return O&&(O.S&&d(O,T),M.state=function(){return d(T,{})}),$?(r[a]=M,C):M})(D,E,"global"in _?_.global:this==r,_.state)}function p(b){var _,w=b.length,x=this,E=0,T=x.i=x.j=0,D=x.S=[];for(w||(b=[w++]);E<i;)D[E]=E++;for(E=0;E<i;E++)D[E]=D[T=c&T+b[E%w]+(_=D[E])],D[T]=_;(x.g=function(M){for(var C,$=0,O=x.i,R=x.j,L=x.S;M--;)C=L[O=c&O+1],$=$*i+L[c&(L[O]=L[R=c&R+C])+(L[R]=C)];return x.i=O,x.j=R,$})(i)}function d(b,_){return _.i=b.i,_.j=b.j,_.S=b.S.slice(),_}function h(b,_){var w=[],x=typeof b,E;if(_&&x=="object")for(E in b)try{w.push(h(b[E],_-1))}catch{}return w.length?w:x=="string"?b:b+"\0"}function v(b,_){for(var w=b+"",x,E=0;E<w.length;)_[c&E]=c&(x^=_[c&E]*19)+w.charCodeAt(E++);return S(_)}function y(){try{var b;return f&&(b=f.randomBytes)?b=b(i):(b=new Uint8Array(i),(t.crypto||t.msCrypto).getRandomValues(b)),S(b)}catch{var _=t.navigator,w=_&&_.plugins;return[+new Date,t,w,t.screen,S(e)]}}function S(b){return String.fromCharCode.apply(0,b)}if(v(r.random(),e),typeof xb=="object"&&xb.exports){xb.exports=m;try{f=require("crypto")}catch{}}else typeof define=="function"&&define.amd?define(function(){return m}):r["seed"+a]=m})(typeof self<"u"?self:y5,[],Math)});var _5=jn((xlt,x5)=>{var Fse=s5(),kse=l5(),Pse=f5(),Bse=m5(),Ose=h5(),Rse=v5(),Nl=b5();Nl.alea=Fse;Nl.xor128=kse;Nl.xorwow=Pse;Nl.xorshift7=Bse;Nl.xor4096=Ose;Nl.tychei=Rse;x5.exports=Nl});var Q9=jn((zyt,cA)=>{function lA(){}lA.prototype={on:function(t,e,r){var i=this.e||(this.e={});return(i[t]||(i[t]=[])).push({fn:e,ctx:r}),this},once:function(t,e,r){var i=this;function n(){i.off(t,n),e.apply(r,arguments)}return n._=e,this.on(t,n,r)},emit:function(t){var e=[].slice.call(arguments,1),r=((this.e||(this.e={}))[t]||[]).slice(),i=0,n=r.length;for(i;i<n;i++)r[i].fn.apply(r[i].ctx,e);return this},off:function(t,e){var r=this.e||(this.e={}),i=r[t],n=[];if(i&&e)for(var o=0,a=i.length;o<a;o++)i[o].fn!==e&&i[o].fn._!==e&&n.push(i[o]);return n.length?r[t]=n:delete r[t],this}};cA.exports=lA;cA.exports.TinyEmitter=lA});var vfe={};hs(vfe,{ObsMetaBind:()=>fx,default:()=>px});module.exports=hG(vfe);var os=require("obsidian");var GT=Ar(yo());var Bi=(r=>(r.INLINE="inline",r.BLOCK="block",r))(Bi||{}),jl=(l=>(l.INPUT="INPUT",l.VIEW="VIEW",l.JS_VIEW="JS_VIEW",l.TABLE="TABLE",l.BUTTON_GROUP="BUTTON_GROUP",l.BUTTON="BUTTON",l.EMBED="EMBED",l.EXCLUDED="EXCLUDED",l))(jl||{}),ou=class{linePosition;constructor(e){this.linePosition=e}getPosition(){return this.linePosition}};function jm(t){return t==="INPUT"||t==="VIEW"||t==="BUTTON_GROUP"}var Zn=class extends Error{errorLevel;effect;cause;tip;docs;context;positionContext;constructor(e){super(""),this.errorLevel=e.errorLevel,this.effect=e.effect,this.cause=e.cause,this.tip=e.tip,this.docs=e.docs,this.context=e.context,this.positionContext=e.positionContext,this.updateMessage()}updateMessage(){this.cause instanceof Error?this.message=`[${this.getErrorType()}] "${this.effect}" caused by error "${this.cause.message}"`:this.message=`[${this.getErrorType()}] "${this.effect}" caused by "${this.cause}"`}log(){console.log(this.message,this.stack,this.context)}},jt=class extends Zn{getErrorType(){return"MB_INTERNAL"}},ma=class extends Zn{getErrorType(){return"MB_PARSING"}},gs=class extends Zn{getErrorType(){return"MB_VALIDATION"}},Zm=class extends Zn{getErrorType(){return"MB_BIND_TARGET"}};var Br=class extends Zn{getErrorType(){return"MB_ARGUMENT"}},da=class extends Zn{getErrorType(){return"MB_JS"}},Uu=class extends Zn{getErrorType(){return"MB_EXPRESSION"}};var Ef=class extends Zn{getErrorType(){return"MB_EXAMPLE"}};var vs=class extends Zn{getErrorType(){return"MB_BUTTON"}},Af=class extends Zn{getErrorType(){return"MB_DEPENDENCY"}};function fn(t,e){let r=t.thenEof().tryParse(e);if(r.success)return r.value;throw new Zl("ERROR","parsiNOM parser",e,r)}var Zl=class extends Zn{str;parseFailure;source;constructor(e,r,i,n){super({errorLevel:e,effect:"Failed to parse. Check that your syntax is correct.",cause:`expected ${n.expected.sort().join(" or ")}`}),this.str=i,this.parseFailure=n,this.source=r,this.updateMessage2()}getErrorType(){return"MB_PARSINOM"}updateMessage2(){this.cause instanceof Error?this.message=`[${this.getErrorType()}] "${this.effect}" caused by error "${this.cause.message}"
`:this.message=`[${this.getErrorType()}] "${this.effect}" caused by "${this.cause}"
`;let r=this.str.split(`
`)[this.parseFailure.furthest.line-1],i=`${this.parseFailure.furthest.line} | `;this.positionContext=`${i}${r}`,this.positionContext+=`
${this.getUnderline(i.length)}
`,this.message+=`
`+this.positionContext}getUnderline(e){let r=" ".repeat(this.parseFailure.furthest.column+e-1),i=`^ (${this.cause})`;return r+i}},Pn=class extends Zn{str;position;source;constructor(e,r,i,n,o,a){super({errorLevel:e,effect:"Failed to validate the result of the parser.",cause:i,docs:a}),this.str=n,this.position=o,this.source=r,this.updateMessage2()}getErrorType(){return"MB_VALIDATION"}updateMessage2(){if(this.cause instanceof Error?this.message=`[${this.getErrorType()}] "${this.effect}" caused by error "${this.cause.message}"
`:this.message=`[${this.getErrorType()}] "${this.effect}" caused by "${this.cause}"
`,this.str&&this.position){let r=this.str.split(`
`)[this.position.from.line-1],i=`${this.position.from.line} | `;this.positionContext=`${i}${r}`,this.positionContext+=`
${this.getUnderline(i.length,r.length)}
`,this.message+=`
`+this.positionContext}}getUnderline(e,r){if(this.position===void 0)return"";let i=" ".repeat(this.position.from.column+e-1),n=this.position.to.line===this.position.from.line?this.position.to.column:r,o="^".repeat(n-this.position.from.column);return i+o}};var vn=Ar(yo()),Vx=Ar(Ji());var BT=Ar(yo()),Ri=Ar(Ji());var Tf=Ar(yo()),bo=Ar(Ji()),Gn=bo.P.sequence(bo.P.or(Tf.P_UTILS.unicodeLetter(),bo.P.oneOf("_$")),bo.P.or(Tf.P_UTILS.unicodeAlphanumeric(),bo.P.oneOf("-_$")).many()).map(t=>t[0]+t[1].join("")).describe("identifier"),IT=bo.P.sequenceMap((t,e)=>t+e.map(r=>r[0]+r[1]).join(""),Gn,bo.P.sequence(Tf.P_UTILS.optionalWhitespace(),Gn).many()).describe("identifier with spaces"),wG=bo.P.string("\\").then(Tf.P_UTILS.any()).map(t=>t==="'"?"'":t==="\\"?"\\":"\\"+t);function FT(t){return bo.P.or(wG,bo.P.noneOf(t+"\\")).many().map(e=>e.join("")).trim(bo.P.string(t))}var Gm=FT("'"),kT=FT('"'),Gl=bo.P.manyNotOf("{}[]#^|:?").box("file path");function Oi(t,e){return{value:t,position:e}}function jo(t){if(t!==void 0)return typeof t=="string"?{value:t}:t}var Vu=(r=>(r.OBJECT="object",r.ARRAY="array",r))(Vu||{}),Wm=class{parent;access;child;constructor(e,r,i){this.parent=e,this.access=r,this.child=i}};function SG(t,e){return t[e]}function PT(t,e,r){t[e]=r}var zu=class{type;prop;index;constructor(e,r){if(this.type=e,this.prop=e==="object"?r:"",this.index=e==="array"?Number(r):0,Number.isNaN(this.index))throw new Error("can not access array with non number index")}get(e){if(this.type==="object"){if(typeof e!="object"||e==null)throw new Error("can not access property of non-object");return new Wm(e,this,SG(e,this.prop))}else{if(typeof e!="object"||e==null||!Array.isArray(e))throw new Error("can not access property of non-array");return new Wm(e,this,e[this.index])}}set(e,r){if(this.type==="object"){if(typeof e!="object"||e==null)throw new Error("can not access property of non-object");PT(e,this.prop,r)}else{if(typeof e!="object"||e==null||!Array.isArray(e))throw new Error("can not access property of non-array");e[this.index]=r}}create(e){if(this.type==="object"){if(typeof e!="object"||e==null)throw new Error("can not access property of non-object");PT(e,this.prop,void 0)}else{if(typeof e!="object"||e==null||!Array.isArray(e))throw new Error("can not access property of non-array");e[this.index]=void 0}}toUnvalidatedPropAccess(){return this.type==="object"?{type:this.type,prop:{value:this.prop}}:{type:this.type,prop:{value:this.index.toString()}}}};var OT=Gn.node((t,e)=>({type:"object",prop:Oi(t,e)})),Rx=Ri.P.or(BT.P_UTILS.digits().wrap(Ri.P.string("["),Ri.P.string("]")).node((t,e)=>({type:"array",prop:Oi(t,e)})),kT.wrap(Ri.P.string("["),Ri.P.string("]")).node((t,e)=>({type:"object",prop:Oi(t,e)}))),DG=Ri.P.or(Ri.P.sequenceMap(t=>({storagePath:void 0,listenToChildren:!0,storageProp:t}),Rx.atLeast(1)),Ri.P.sequenceMap((t,e)=>({storagePath:void 0,listenToChildren:!0,storageProp:[t,...e]}),OT,Rx.many())),EG=Ri.P.sequenceMap((t,e)=>[t,...e],OT,Rx.many()),Lx=Ri.P.sequenceMap((t,e)=>(t.storageProp=t.storageProp.concat(e.flat()),t),DG,Ri.P.string(".").then(EG).many()),Ca=Ri.P.sequenceMap((t,e,r)=>(r.storageType=t,r.storagePath=e,r),Gn.describe("storage type").node(Oi).skip(Ri.P.string("^").describe('storage type separator "^"')).optional(),Gl.describe("storage path").node(Oi).skip(Ri.P.string("#").describe('storage/file path separator "#"')).optional(),Lx.describe("property path")).box("bind target");var Hm=Ar(yo()),$a=Ar(Ji());var Ux=$a.P.regexp(/^[^()',]+/).describe("any character except parentheses, single quotation marks and commas"),AG=$a.P.or(Gm,Ux).node(Oi),TG=$a.P.separateBy(AG,$a.P.string(",").describe('argument value separator ","').trim(Hm.P_UTILS.optionalWhitespace())),NG=$a.P.sequenceMap((t,e)=>({name:t,value:e}),Gn.node(Oi),TG.trim(Hm.P_UTILS.optionalWhitespace()).wrap($a.P.string("(").describe('argument value paren "("'),$a.P.string(")").describe('argument value paren ")"')).optional([])),Nf=$a.P.separateBy(NG,$a.P.string(",").describe('argument separator ","').trim(Hm.P_UTILS.optionalWhitespace()));var Xi=Ar(yo()),Bn=Ar(Ji());var MG=Bn.P.string("\\").then(Xi.P_UTILS.any()).map(t=>t==="["?"[":t==="]"?"]":t==="{"?"{":t==="}"?"}":t==="\\"?"\\":"\\"+t),Ym=Bn.P.sequenceMap((t,e)=>t+e.flat().join(""),Bn.P.manyNotOf("{}[]\\"),Bn.P.sequence(MG,Bn.P.manyNotOf("{}[]\\")).many()).box("View Field Content"),CG=Bn.P.sequenceMap((t,e)=>[t,...e.flat()],Ym,Bn.P.sequence(Ca.wrapString("{","}"),Ym).many()),$G=Bn.P.sequenceMap((t,e,r)=>{let i=r===void 0?void 0:r[1];return{viewFieldType:t,writeToBindTarget:i,arguments:e,templateDeclaration:void 0}},Gn.node(Oi).trim(Xi.P_UTILS.optionalWhitespace()).optional().describe("input field type"),Nf.trim(Xi.P_UTILS.optionalWhitespace()).wrapString("(",")").trim(Xi.P_UTILS.optionalWhitespace()).optional([]),Bn.P.sequence(Bn.P.string(":").trim(Xi.P_UTILS.optionalWhitespace()),Ca).trim(Xi.P_UTILS.optionalWhitespace()).optional()),RT=Bn.P.sequenceMap((t,e,r,i)=>i===void 0?{viewFieldType:void 0,writeToBindTarget:void 0,arguments:[],templateDeclaration:e}:(i.templateDeclaration=e,i),Bn.P.string("VIEW"),CG.wrapString("[","]"),Xi.P_UTILS.optionalWhitespace(),$G.wrapString("[","]").optional(),Xi.P_UTILS.eof()),IG=Bn.P.sequenceMap((t,e,r,i)=>(e!==void 0&&(t.listenToChildren=!0),{bindTarget:t,name:i}),Ca.wrapString("{","}"),Bn.P.string(" and children").optional(),Bn.P.string(" as "),Gn),LT=Bn.P.sequenceMap((t,e,r,i)=>({bindTargetMappings:t,writeToBindTarget:e,hidden:r!==void 0,code:i}),IG.separateBy(Xi.P_UTILS.whitespace()).skip(Xi.P_UTILS.whitespace()),Bn.P.string("save to ").then(Ca.wrapString("{","}")).skip(Xi.P_UTILS.whitespace()).optional(),Bn.P.string("hidden").skip(Xi.P_UTILS.whitespace()).optional(),Bn.P.string("---").then(Xi.P_UTILS.remaining()));var zx=Ar(Ji());var Wl=class{range;tokenClass;constructor(e,r){this.range=e,this.tokenClass=r}};var zt=class t{static sequence(...e){return zx.P.sequenceMap((...r)=>r.flat(2).filter(i=>i!==void 0),...e)}static separateBy(e,r){return t.sequence(e,t.sequence(r,e).many()).optional([])}static highlight(e,r){return e.node((i,n)=>[new Wl(n,r)])}static highlightStr(e,r){return t.highlight(zx.P.string(e),r)}};var qx=zt.highlight(Gn,"ident"),Jm=zt.highlight(Gn,"keyword"),jx=zt.highlightStr(",","control"),Xm=zt.highlightStr("(","control"),Km=zt.highlightStr(")","control"),Hl=zt.highlightStr("[","control"),Yl=zt.highlightStr("]","control"),kG=zt.highlight(Gm,"string"),PG=zt.highlight(Ux,"ident"),BG=Vx.P.or(PG,kG),OG=zt.separateBy(BG,jx.trim(vn.P_UTILS.optionalWhitespace())),RG=zt.sequence(Jm,zt.sequence(Xm,OG.trim(vn.P_UTILS.optionalWhitespace()),Km).optional()),Zx=zt.separateBy(RG,jx.trim(vn.P_UTILS.optionalWhitespace())),Jl=zt.sequence(zt.sequence(qx,zt.highlightStr("^","control")).optional(),zt.sequence(zt.highlight(Gl,"ident"),zt.highlightStr("#","control")).optional(),zt.highlight(Lx,"ident")),LG=zt.sequence(Jm.trim(vn.P_UTILS.optionalWhitespace()),zt.sequence(Xm,Zx.trim(vn.P_UTILS.optionalWhitespace()),Km).trim(vn.P_UTILS.optionalWhitespace()).optional(),zt.sequence(zt.highlightStr(":","control").trim(vn.P_UTILS.optionalWhitespace()),Jl).trim(vn.P_UTILS.optionalWhitespace()).optional()),UG=zt.sequence(Jm.trim(vn.P_UTILS.optionalWhitespace()).optional(),zt.sequence(Xm,Zx.trim(vn.P_UTILS.optionalWhitespace()),Km).trim(vn.P_UTILS.optionalWhitespace()).optional(),zt.sequence(zt.highlightStr(":","control").trim(vn.P_UTILS.optionalWhitespace()),Jl).trim(vn.P_UTILS.optionalWhitespace()).optional()),zT=Vx.P.or(zt.sequence(zt.highlightStr("INPUT","control"),Hl,qx.trim(vn.P_UTILS.optionalWhitespace()),Yl.skip(vn.P_UTILS.optionalWhitespace()),Hl,UG,Yl),zt.sequence(zt.highlightStr("INPUT","control"),Hl,LG,Yl)),UT=zt.highlight(Ym,"ident"),zG=zt.sequence(zt.highlightStr("{","string"),Jl,zt.highlightStr("}","string")),VG=zt.sequence(UT,zt.sequence(zG,UT).many()),qG=zt.sequence(Jm.trim(vn.P_UTILS.optionalWhitespace()).optional(),zt.sequence(Xm,Zx.trim(vn.P_UTILS.optionalWhitespace()).optional(),Km).trim(vn.P_UTILS.optionalWhitespace()).optional(),zt.sequence(zt.highlightStr(":","control").trim(vn.P_UTILS.optionalWhitespace()),Jl).trim(vn.P_UTILS.optionalWhitespace()).optional()),VT=zt.sequence(zt.highlightStr("VIEW","control"),Hl,VG,Yl,zt.sequence(Hl.skip(vn.P_UTILS.optionalWhitespace()),qG,Yl).optional()),qT=zt.sequence(zt.highlightStr("BUTTON","control"),Hl,zt.separateBy(qx,jx.trim(vn.P_UTILS.optionalWhitespace())),Yl);var ys=class{str;highlights;parsingError;constructor(e,r,i){this.str=e,this.highlights=r.filter(n=>n.range.from.index!==n.range.to.index),this.parsingError=i}getHighlights(){if(this.parsingError===void 0)return this.highlights;let e;return this.str[this.parsingError.parseFailure.furthest.index]===`
`?e={index:this.parsingError.parseFailure.furthest.index+1,column:1,line:this.parsingError.parseFailure.furthest.line+1}:e={index:this.parsingError.parseFailure.furthest.index+1,column:this.parsingError.parseFailure.furthest.column+1,line:this.parsingError.parseFailure.furthest.line},[new Wl({from:this.parsingError.parseFailure.furthest,to:e},"error")]}};function Mf(t,e,r){return Math.min(Math.max(t,e),r)}function Qm(t,e,r){return t!==void 0?Math.min(Math.max(t,e),r):void 0}function Gx(t,e,r,i,n){return(t-e)/(r-e)*(n-i)+i}function Wx(t,e){return(t%e+e)%e}function bs(t,e){if(t===null&&e===null)return!0;if(t===null||e===null||typeof t!=typeof e)return!1;if(typeof t=="object"&&typeof e=="object"){if(Array.isArray(t)&&Array.isArray(e)){if(t.length!==e.length)return!1;for(let n=0;n<t.length;n++)if(!bs(t[n],e[n]))return!1;return!0}if(Array.isArray(t)||Array.isArray(e))return!1;let r=Object.keys(t),i=Object.keys(e);if(r.length!==i.length)return!1;for(let n of r)if(!bs(t[n],e[n]))return!1;return!0}return t===e}function Hx(t){return!!t}function Yx(t){if(t===void 0)return t;let e=Reflect.ownKeys(t);for(let r of e){let i=t[r];(i&&typeof i=="object"||typeof i=="function")&&Yx(i)}return Object.freeze(t)}function _r(){return window.crypto.randomUUID()}function Xl(t){try{return new URL(t),!0}catch{return!1}}function ed(t){window.open(t,"_blank")}function ZT(t,e,r=", ",i="and"){return t.length===0?"":(t=t.map(e),t.length===1?t[0]:t.length===2?`${t[0]} ${i} ${t[1]}`:`${t.slice(0,-1).join(r)} ${i} ${t.slice(-1)}`)}function bi(t,e){t.innerHTML="",t.className="";let r=document.createElement("span");r.className="mb-warning mb-unloaded",r.innerText=`[MB_UNLOADED] ${e}`,t.appendChild(r)}var ht=class{static createElement(e,r,i){let n=document.createElement(r);return i?.text&&(n.innerText=i.text),i?.class&&(n.className=i.class),e.appendChild(n),n}static addClass(e,r){e.classList.add(...r.split(" "))}static addClasses(e,r){e.classList.add(...r)}static removeClass(e,r){e.classList.remove(...r.split(" "))}static hasClass(e,r){return e.classList.contains(r)}static removeAllClasses(e){e.className=""}static empty(e){for(;e.lastChild;)e.removeChild(e.lastChild)}};function td(...t){if(t.length===0)return"/";if(t.length===1)return jT(t[0]);let e=t[0].startsWith("/")?t[0].substring(1):t[0];for(let r=1;r<t.length;r++){if(t[r]===""||t[r]==="/")continue;let i=e.endsWith("/"),n=t[r].startsWith("/");i&&n?e+=t[r].substring(1):!i&&!n?e+="/"+t[r]:e+=t[r]}return jT(e)}function jT(t){return t.startsWith("/")&&(t=t.substring(1)),t.endsWith("/")&&(t=t.substring(0,t.length-1)),t===""?"/":t}function rd(t,e){return e=e.startsWith(".")?e:"."+e,t.endsWith(e)?t:t+e}function nd(t){return t===void 0?[]:Array.isArray(t)?t:[t]}var id=class{mb;constructor(e){this.mb=e}highlightInputFieldDeclaration(e,r){return this.highlightWithParser(e,r,zT)}highlightViewFieldDeclaration(e,r){return this.highlightWithParser(e,r,VT)}highlightInlineButtonDeclaration(e,r){return this.highlightWithParser(e,r,qT)}highlight(e,r,i){if(r==="INPUT")return this.highlightInputFieldDeclaration(e,i);if(r==="VIEW")return this.highlightViewFieldDeclaration(e,i);if(r==="BUTTON_GROUP")return this.highlightInlineButtonDeclaration(e,i);throw new Error(`Unknown MDRCType ${r}`)}highlightBindTarget(e,r){return this.highlightWithParser(e,r,Jl)}highlightWithParser(e,r,i){try{return r?new ys(e,fn(i.trim(GT.P_UTILS.optionalWhitespace()).thenEof(),e)):new ys(e,fn(i.thenEof(),e))}catch(n){return n instanceof Zl?new ys(e,[],n):(console.error(n),new ys(e,[]))}}};var Gr=(n=>(n.DEFAULT="default",n.PRIMARY="primary",n.DESTRUCTIVE="destructive",n.PLAIN="plain",n))(Gr||{}),Wn=(d=>(d.COMMAND="command",d.JS="js",d.OPEN="open",d.INPUT="input",d.SLEEP="sleep",d.TEMPLATER_CREATE_NOTE="templaterCreateNote",d.RUN_TEMPLATER_FILE="runTemplaterFile",d.UPDATE_METADATA="updateMetadata",d.CREATE_NOTE="createNote",d.REPLACE_IN_NOTE="replaceInNote",d.REGEXP_REPLACE_IN_NOTE="regexpReplaceInNote",d.REPLACE_SELF="replaceSelf",d.INSERT_INTO_NOTE="insertIntoNote",d.INLINE_JS="inlineJS",d))(Wn||{}),Cf=class t{type;shiftKey;ctrlKey;altKey;constructor(e,r,i,n){this.type=e,this.shiftKey=r,this.ctrlKey=i,this.altKey=n}static fromMouseEvent(e,r){return new t(r,e.shiftKey,e.ctrlKey,e.altKey)}openInNewTab(){return this.type==="middle"||this.ctrlKey}};var Ur=class{actionType;mb;constructor(e,r){this.actionType=e,this.mb=r}};var ad=class extends Ur{constructor(e){super("command",e)}async run(e,r,i,n,o){this.mb.internal.executeCommandById(r.command)}create(){return{type:"command",command:""}}getActionLabel(){return"Run a command"}};var sd=class extends Ur{constructor(e){super("createNote",e)}async run(e,r,i,n,o){if(r.openIfAlreadyExists){let a=rd(td(r.folderPath??"",r.fileName),"md");if(await this.mb.file.exists(a)){await this.mb.file.open(a,"",!1);return}}await this.mb.file.create(r.folderPath??"",r.fileName,"md",r.openNote??!1,o.openInNewTab())}create(){return{type:"createNote",folderPath:"/",fileName:"Untitled",openNote:!0,openIfAlreadyExists:!1}}getActionLabel(){return"Create a new note"}};var ud=class extends Ur{constructor(e){super("inlineJS",e)}async run(e,r,i,n,o){if(!this.mb.getSettings().enableJs)throw new da({errorLevel:"CRITICAL",effect:"Can't run button action that requires JS evaluation.",cause:"JS evaluation is disabled in the plugin settings."});let a={buttonConfig:structuredClone(e),args:structuredClone(r.args),buttonContext:structuredClone(n),click:structuredClone(o)};(await this.mb.internal.jsEngineRunCode(r.code,i,a))()}create(){return{type:"inlineJS",code:'console.log("Hello world")',args:{}}}getActionLabel(){return"Run JavaScript code"}};var ld=class extends Ur{constructor(e){super("input",e)}async run(e,r,i,n,o){let a=document.activeElement;a&&a instanceof HTMLInputElement&&(a.setRangeText(r.str,a.selectionStart,a.selectionEnd,"end"),a.dispatchEvent(new Event("input",{bubbles:!0})))}create(){return{type:"input",str:""}}getActionLabel(){return"Insert text at cursor"}};var Ql=Ar(yo()),xo=Ar(Ji());function WT(t){if(t==="+")return"+";if(t==="-")return"-";throw new Error(`Invalid LineNumberOp: ${t}`)}function jG(t){if(t===void 0)return 1;if(t==="+")return 1;if(t==="-")return-1;throw new Error(`Invalid LineNumberOp: ${t}`)}var Kl=class{literal;op;number;constructor(e,r,i){this.literal=e,this.op=r,this.number=i}evaluate(e){let r=this.resolveLiteral(e),i=jG(this.op);return r!==void 0&&this.number!==void 0?r+this.number*i:this.number!==void 0?this.number*i:r!==void 0?r:0}resolveLiteral(e){if(this.literal!==void 0){if(this.literal in e)return e[this.literal];throw new Error(`Error while evaluating line number expression: Literal "${this.literal}" not available.`)}}};var Jx=xo.P.sequenceMap((t,e)=>t===void 0?e:-e,xo.P.string("-").optional(),xo.P.or(xo.P.sequenceMap((t,e,r)=>Number(t+e+r),Ql.P_UTILS.digits(),xo.P.string("."),Ql.P_UTILS.digits()),Ql.P_UTILS.digits().map(t=>Number(t)))).thenEof(),$f=xo.P.sequenceMap((t,e)=>t===void 0?e:-e,xo.P.string("-").optional(),Ql.P_UTILS.digits().map(t=>Number(t))).thenEof(),If=xo.P.or(xo.P.sequenceMap((t,e,r)=>new Kl(t,WT(e),r),Gn,xo.P.or(xo.P.string("+"),xo.P.string("-")).trim(Ql.P_UTILS.optionalWhitespace()),$f),Gn.map(t=>new Kl(t,void 0,void 0)),$f.map(t=>new Kl(void 0,void 0,t)));var cd=class extends Ur{constructor(e){super("insertIntoNote",e)}async run(e,r,i,n,o){let a=r.templater?await this.mb.internal.evaluateTemplaterTemplate(this.mb.file.resolveFilePathLike(r.value),i):r.value,s=fn(If,r.line.toString());await this.mb.file.atomicModify(i,l=>{let u=l.split(`
`),c=this.mb.file.createLineNumberContext(l,n.position),f=s.evaluate(c);if(f<1||f>u.length)throw new Error("Line number out of bounds");return u=[...u.slice(0,f-1),a,...u.slice(f-1)],u.join(`
`)})}create(){return{type:"insertIntoNote",line:0,value:"Some text",templater:!1}}getActionLabel(){return"Insert text into the note"}};var fd=class extends Ur{constructor(e){super("js",e)}async run(e,r,i,n,o){if(!this.mb.getSettings().enableJs)throw new da({errorLevel:"CRITICAL",effect:"Can't run button action that requires JS evaluation.",cause:"JS evaluation is disabled in the plugin settings."});let a={buttonConfig:structuredClone(e),args:structuredClone(r.args),buttonContext:structuredClone(n),click:structuredClone(o)};(await this.mb.internal.jsEngineRunFile(r.file,i,a))()}create(){return{type:"js",file:"",args:{}}}getActionLabel(){return"Run a JavaScript file"}};var HT=Ar(yo()),si=Ar(Ji());var YT=si.P.sequence(Gl,si.P.or(si.P.string("#").then(si.P.manyNotOf("[]#|:")),si.P.string("#").result(void 0),si.P.succeed(void 0)),si.P.string("|").then(si.P.manyNotOf("[]")).optional()),pd=si.P.or(si.P.sequenceMap((t,e)=>new qu(t!==void 0,e[0],e[1],e[2],!0),si.P.string("!").optional(),YT.wrapString("[[","]]")),si.P.sequenceMap((t,e,r)=>{let i=!Xl(r);return new qu(t!==void 0,r,void 0,e,i)},si.P.string("!").optional(),si.P.manyNotOf("[]").wrapString("[","]"),si.P.manyNotOf("()").wrapString("(",")"))),ZG=si.P.separateBy(pd,si.P.string(",").trim(HT.P_UTILS.optionalWhitespace())),qu=class t{isEmbed;target;block;alias;internal;constructor(e,r,i,n,o){this.isEmbed=e,this.target=r,this.block=i,this.alias=n,this.internal=o??!0}static fromUrl(e){return new t(!1,e.href,void 0,e.hostname,!1)}fullTarget(){return this.block?`${this.target}#${this.block}`:this.target}open(e,r,i){this.internal?e.file.open(this.fullTarget(),r,i):ed(this.target)}toString(){let e=this.isEmbed?"!":"";if(this.internal){let r=this.alias?`|${this.alias}`:"";return`${e}[[${this.fullTarget()}${r}]]`}else{let r=this.alias??this.fullTarget();return`${e}[${r}](${this.fullTarget()})`}}},_n=class t{static parseLink(e){return fn(pd.thenEof(),e)}static parseLinkList(e){return fn(ZG.thenEof(),e)}static isLink(e){return pd.thenEof().tryParse(e).success}static urlToLink(e){return qu.fromUrl(e)}static parseLinkOrUrl(e){return Xl(e)?t.urlToLink(new URL(e)):t.parseLink(e)}static interpretAsLink(e){let r=pd.thenEof().tryParse(e);if(r.success)return r.value;let i=YT.thenEof().tryParse(e);if(i.success)return new qu(!1,i.value[0],i.value[1],i.value[2],!0);if(Xl(e)){let n=new URL(e);return qu.fromUrl(n)}}};var md=class extends Ur{constructor(e){super("open",e)}async run(e,r,i,n,o){let a=o.openInNewTab()||(r.newTab??!1),s=_n.interpretAsLink(r.link);if(!s)throw new Error("Invalid link");s.open(this.mb,i,a)}create(){return{type:"open",link:"",newTab:!0}}getActionLabel(){return"Open a link"}};var dd=class extends Ur{constructor(e){super("regexpReplaceInNote",e)}async run(e,r,i,n,o){if(r.regexp==="")throw new Error("Regexp cannot be empty");await this.mb.file.atomicModify(i,a=>a.replace(new RegExp(r.regexp,r.regexpFlags??"g"),r.replacement))}create(){return{type:"regexpReplaceInNote",regexp:"([A-Z])\\w+",replacement:"Replacement text",regexpFlags:"g"}}getActionLabel(){return"Replace text in note using regexp"}};var hd=class extends Ur{constructor(e){super("replaceInNote",e)}async run(e,r,i,n,o){let a=r.templater?await this.mb.internal.evaluateTemplaterTemplate(this.mb.file.resolveFilePathLike(r.replacement),i):r.replacement,s=fn(If,r.fromLine.toString()),l=fn(If,r.toLine.toString());await this.mb.file.atomicModify(i,u=>{let c=u.split(`
`),f=this.mb.file.createLineNumberContext(u,n.position),m=s.evaluate(f),p=l.evaluate(f);if(m>p)throw new Error(`From line (${m}) can't be greater than to line (${p})`);if(m<1)throw new Error(`From line (${m}) can't smaller than 1.`);if(p>c.length)throw new Error(`To line (${p}) can't greater than the file length ${c.length}.`);return c=[...c.slice(0,m-1),a,...c.slice(p)],c.join(`
`)})}create(){return{type:"replaceInNote",fromLine:0,toLine:0,replacement:"Replacement text",templater:!1}}getActionLabel(){return"Replace text in note"}};var gd=class extends Ur{constructor(e){super("replaceSelf",e)}async run(e,r,i,n,o){if(n.isInline)throw new Error("Replace self action not supported for inline buttons");if(n.position===void 0)throw new Error("Position of the button in the note is unknown");if(n.position.lineStart>n.position.lineEnd)throw new Error("Position of the button in the note is invalid");let a=n.position,s=r.templater?await this.mb.internal.evaluateTemplaterTemplate(this.mb.file.resolveFilePathLike(r.replacement),i):r.replacement;await this.mb.file.atomicModify(i,l=>{let u=l.split(`
`);if(a.lineStart<0||a.lineEnd>u.length)throw new Error("Position of the button in the note is out of bounds");return u=[...u.slice(0,a.lineStart),s,...u.slice(a.lineEnd+1)],u.join(`
`)})}create(){return{type:"replaceSelf",replacement:"Replacement text",templater:!1}}getActionLabel(){return"Replace button with text"}};var vd=class extends Ur{constructor(e){super("runTemplaterFile",e)}async run(e,r,i,n,o){let a=this.mb.file.resolveFilePathLike(r.templateFile);await this.mb.internal.evaluateTemplaterTemplate(a,i)}create(){return{type:"runTemplaterFile",templateFile:""}}getActionLabel(){return"Run a templater file"}};var yd=class extends Ur{constructor(e){super("sleep",e)}async run(e,r,i,n,o){await new Promise(a=>setTimeout(a,r.ms))}create(){return{type:"sleep",ms:0}}getActionLabel(){return"Sleep for some time"}};var bd=class extends Ur{constructor(e){super("templaterCreateNote",e)}async run(e,r,i,n,o){if(r.openIfAlreadyExists&&r.fileName){let a=rd(td(r.folderPath??"",r.fileName),"md");if(await this.mb.file.exists(a)){await this.mb.file.open(a,"",!1);return}}await this.mb.internal.createNoteWithTemplater(r.templateFile,r.folderPath,r.fileName,r.openNote,o.openInNewTab())}create(){return{type:"templaterCreateNote",templateFile:"",folderPath:"/",fileName:"",openNote:!0,openIfAlreadyExists:!1}}getActionLabel(){return"Create a new note using Templater"}};function _o(t){if(t.toLowerCase()==="null")return null;if(t==="true")return!0;if(t==="false")return!1;{let e=Jx.tryParse(t);return e.success?e.value:t}}function yn(t){return t===void 0||t===null?"":typeof t=="string"?t:typeof t=="boolean"?t?"true":"false":t.toString()}function au(t){return t===null||typeof t=="string"||typeof t=="boolean"||typeof t=="number"}function Zo(t){if(t!=null){if(au(t))return[t];if(typeof t=="object"&&Array.isArray(t))return t.filter(e=>au(e))}}function ec(t){if(typeof t=="number")return t;if(typeof t=="string"){let e=Jx.tryParse(t);if(e.success)return e.value}}function Ia(t){return au(t)?yn(t):void 0}function su(t){return au(t)?t:void 0}function ju(t,e){return Array.isArray(t)?t.map(r=>Xx(r,e)).filter(r=>r!=="").join(", "):Xx(t,e)}function Xx(t,e){return t==null?e?"":"null":typeof t=="function"?"<function>":typeof t=="object"||Array.isArray(t)?JSON.stringify(t):t.toString()}function XT(t,e){return Array.isArray(t)?t.map(r=>JT(r,e)).filter(r=>r!==""):JT(t,e)}function JT(t,e){return typeof t=="string"?_n.isLink(t)?_n.parseLink(t):Xl(t)?_n.urlToLink(new URL(t)):t:Xx(t,e)}var xd=class extends Ur{constructor(e){super("updateMetadata",e)}async run(e,r,i,n,o){let a=this.mb.bindTargetParser.fromStringAndValidate(r.bindTarget,i);if(r.evaluate){if(!this.mb.getSettings().enableJs)throw new da({errorLevel:"CRITICAL",effect:"Can't run button action that requires JS evaluation.",cause:"JS evaluation is disabled in the plugin settings."});let s=new Function("x","getMetadata",`return ${r.value};`);this.mb.api.updateMetadata(a,l=>s(l,u=>this.mb.api.getMetadata(this.mb.api.parseBindTarget(u,i))))}else this.mb.api.setMetadata(a,_o(r.value))}create(){return{type:"updateMetadata",bindTarget:"",evaluate:!1,value:""}}getActionLabel(){return"Update metadata"}};var _d=class{mb;actionContexts;constructor(e){this.mb=e,this.actionContexts={command:new ad(e),open:new md(e),js:new fd(e),input:new ld(e),sleep:new yd(e),templaterCreateNote:new bd(e),updateMetadata:new xd(e),createNote:new sd(e),replaceInNote:new hd(e),replaceSelf:new gd(e),regexpReplaceInNote:new dd(e),insertIntoNote:new cd(e),inlineJS:new ud(e),runTemplaterFile:new vd(e)}}createDefaultButtonConfig(){return{label:"This is a button",icon:"",style:"default",class:"",cssStyle:"",backgroundImage:"",tooltip:"",id:"",hidden:!1,actions:[]}}async runButtonActions(e,r,i,n){try{if(e.action)await this.runAction(e,e.action,r,i,n);else if(e.actions)for(let o of e.actions)await this.runAction(e,o,r,i,n);else console.warn("meta-bind | ButtonMDRC >> no action defined")}catch(o){console.warn("meta-bind | ButtonMDRC >> error while running action",o),this.mb.internal.showNotice("meta-bind | Error while running button action. Check the console for details.")}}createDefaultAction(e){return this.actionContexts[e].create()}async runAction(e,r,i,n,o){let a=r.type;await this.actionContexts[a].run(e,r,i,n,o)}getActionLabel(e){return this.actionContexts[e].getActionLabel()}};var rr=class{errors;otherError;subject;constructor(e){this.subject=e,this.errors=[]}add(e){e instanceof Error?(e instanceof Zn?this.errors.push(e):this.otherError=e,console.warn(e)):(console.trace(""),console.warn("[MB_ERROR_CONTAINER] received invalid error type",e))}merge(e){return this.errors=this.errors.concat(e.errors),e.otherError&&(this.otherError=e.otherError),this}hasErrors(){if(this.otherError)return!0;for(let e of this.errors)if(e.errorLevel==="ERROR"||e.errorLevel==="CRITICAL")return!0;return!1}hasCriticalErrors(){if(this.otherError)return!0;for(let e of this.errors)if(e.errorLevel==="CRITICAL")return!0;return!1}hasWarnings(){for(let e of this.errors)if(e.errorLevel==="WARNING")return!0;return!1}isEmpty(){return this.errors.length===0&&!this.otherError}getErrors(){let e=this.errors.filter(r=>r.errorLevel==="ERROR"||r.errorLevel==="CRITICAL");return this.otherError?e.concat([this.otherError]):e}getWarnings(){return this.errors.filter(e=>e.errorLevel==="WARNING")}};var wd=class{value;count;constructor(e){this.value=e,this.count=1}getValue(){return this.value}increment(){return this.count+=1,this.count}decrement(){return this.count-=1,this.count}getCount(){return this.count}isEmpty(){return this.count===0}};var Sd=class{mb;buttons;buttonLoadListeners;buttonTemplates;constructor(e){this.mb=e,this.buttons=new Map,this.buttonLoadListeners=new Map,this.buttonTemplates=new Map}setButtonTemplates(e){let r=new Set,i=new rr("ButtonManager");this.buttonTemplates.clear();for(let n of e)n.id===void 0||n.id===""?i.add(new vs({errorLevel:"ERROR",cause:`Button with label "${n.label}" has no id, but button templates must have an id.`,effect:"Button templates could not be saved."})):r.has(n.id)?i.add(new vs({errorLevel:"ERROR",cause:`Button id "${n.id}" is not unique. The same id is used by multiple buttons.`,effect:"Button templates could not be saved."})):(r.add(n.id),this.buttonTemplates.set(n.id,n));return i.hasErrors()&&this.buttonTemplates.clear(),i}registerButtonLoadListener(e,r,i){let n=this.getButton(e,r);n&&i(n),this.buttonLoadListeners.has(e)||this.buttonLoadListeners.set(e,new Map);let o=this.buttonLoadListeners.get(e);o.has(r)||o.set(r,new Map);let a=o.get(r),s=_r();return a.set(s,i),()=>this.removeButtonLoadListener(e,r,s)}notifyButtonLoadListeners(e,r){let i=this.getButton(e,r);if(!i)throw new Error(`ButtonManager | button with id ${r} does not exist`);let n=this.buttonLoadListeners.get(e);if(!n)return;let o=n.get(r);if(o)for(let[a,s]of o)s(i)}removeButtonLoadListener(e,r,i){let n=this.buttonLoadListeners.get(e);if(!n)return;let o=n.get(r);o&&(o.delete(i),o.size===0&&n.delete(r),n.size===0&&this.buttonLoadListeners.delete(e))}addButton(e,r){if(r.id===void 0||r.id==="")throw new Error("ButtonManager | button id is undefined");if(this.buttonTemplates.has(r.id))throw new Error(`ButtonManager | button with id "${r.id}" already exists in the button templates`);this.buttons.has(e)||this.buttons.set(e,new Map),this.buttons.get(e).set(r.id,new wd(r)),this.notifyButtonLoadListeners(e,r.id)}getButton(e,r){if(this.buttonTemplates.has(r))return this.buttonTemplates.get(r);let i=this.buttons.get(e);if(i)return i.get(r)?.getValue()}removeButton(e,r){let i=this.buttons.get(e);i&&(i.get(r)?.decrement(),i.get(r)?.isEmpty()&&i.delete(r),i.size===0&&this.buttons.delete(e))}};var uu=(x=>(x.TOGGLE="toggle",x.SLIDER="slider",x.TEXT="text",x.TEXT_AREA="textArea",x.SELECT="select",x.MULTI_SELECT="multiSelect",x.DATE="date",x.TIME="time",x.DATE_PICKER="datePicker",x.NUMBER="number",x.SUGGESTER="suggester",x.EDITOR="editor",x.IMAGE_SUGGESTER="imageSuggester",x.PROGRESS_BAR="progressBar",x.INLINE_SELECT="inlineSelect",x.LIST="list",x.LIST_SUGGESTER="listSuggester",x.INLINE_LIST_SUGGESTER="inlineListSuggester",x.INLINE_LIST="inlineList",x.IMAGE_LIST_SUGGESTER="imageListSuggester",x.DATE_TIME="dateTime",x.INVALID="invalid",x))(uu||{}),nn=(S=>(S.CLASS="class",S.ADD_LABELS="addLabels",S.MIN_VALUE="minValue",S.MAX_VALUE="maxValue",S.STEP_SIZE="stepSize",S.OPTION="option",S.TITLE="title",S.OPTION_QUERY="optionQuery",S.SHOWCASE="showcase",S.ON_VALUE="onValue",S.OFF_VALUE="offValue",S.DEFAULT_VALUE="defaultValue",S.PLACEHOLDER="placeholder",S.USE_LINKS="useLinks",S.LIMIT="limit",S.MULTI_LINE="multiLine",S.ALLOW_OTHER="allowOther",S.INVALID="invalid",S))(nn||{}),Dd={toggle:{type:"toggle",allowInBlock:!0,allowInline:!0},slider:{type:"slider",allowInBlock:!0,allowInline:!0},text:{type:"text",allowInBlock:!0,allowInline:!0},textArea:{type:"textArea",allowInBlock:!0,allowInline:!0},select:{type:"select",allowInBlock:!0,allowInline:!1},multiSelect:{type:"multiSelect",allowInBlock:!0,allowInline:!1},date:{type:"date",allowInBlock:!0,allowInline:!0},time:{type:"time",allowInBlock:!0,allowInline:!0},datePicker:{type:"datePicker",allowInBlock:!0,allowInline:!0},number:{type:"number",allowInBlock:!0,allowInline:!0},suggester:{type:"suggester",allowInBlock:!0,allowInline:!0},editor:{type:"editor",allowInBlock:!0,allowInline:!1},imageSuggester:{type:"imageSuggester",allowInBlock:!0,allowInline:!0},progressBar:{type:"progressBar",allowInBlock:!0,allowInline:!1},inlineSelect:{type:"inlineSelect",allowInBlock:!0,allowInline:!0},list:{type:"list",allowInBlock:!0,allowInline:!1},listSuggester:{type:"listSuggester",allowInBlock:!0,allowInline:!1},inlineListSuggester:{type:"inlineListSuggester",allowInBlock:!0,allowInline:!0},inlineList:{type:"inlineList",allowInBlock:!0,allowInline:!0},imageListSuggester:{type:"imageListSuggester",allowInBlock:!0,allowInline:!1},dateTime:{type:"dateTime",allowInBlock:!0,allowInline:!0},invalid:{type:"invalid",allowInBlock:!1,allowInline:!1}};var wr={addLabels:{type:"addLabels",allowedFieldTypes:["slider","progressBar"],values:[[],[{name:"value",allowed:["true","false"],description:""}]],allowMultiple:!1},class:{type:"class",allowedFieldTypes:[],values:[[{name:"className",allowed:[],description:"the name of the css class to add"}]],allowMultiple:!0},defaultValue:{type:"defaultValue",allowedFieldTypes:[],values:[[{name:"value",allowed:[],description:""}]],allowMultiple:!1},maxValue:{type:"maxValue",allowedFieldTypes:["slider","progressBar"],values:[[{name:"value",allowed:["number"],description:"the maximally allowed value"}]],allowMultiple:!1},minValue:{type:"minValue",allowedFieldTypes:["slider","progressBar"],values:[[{name:"value",allowed:["number"],description:"the minimally allowed value"}]],allowMultiple:!1},stepSize:{type:"stepSize",allowedFieldTypes:["slider","progressBar"],values:[[{name:"value",allowed:["number"],description:"the step size for sliders"}]],allowMultiple:!1},offValue:{type:"offValue",allowedFieldTypes:["toggle"],values:[[{name:"value",allowed:[],description:"the value for the off state"}]],allowMultiple:!1},onValue:{type:"onValue",allowedFieldTypes:["toggle"],values:[[{name:"value",allowed:[],description:"the value for the off state"}]],allowMultiple:!1},option:{type:"option",allowedFieldTypes:["select","multiSelect","suggester","imageSuggester","inlineSelect","listSuggester","inlineListSuggester","imageListSuggester"],values:[[{name:"value",allowed:[],description:"the value and display name of the option"}],[{name:"value",allowed:[],description:"the value of the option"},{name:"name",allowed:[],description:"the display name of the option"}]],allowMultiple:!0},optionQuery:{type:"optionQuery",allowedFieldTypes:["suggester","imageSuggester","listSuggester","inlineListSuggester","imageListSuggester"],values:[[{name:"value",allowed:[],description:"the query for options"}]],allowMultiple:!0},placeholder:{type:"placeholder",allowedFieldTypes:["text","textArea","number","list","inlineList"],values:[[{name:"value",allowed:[],description:""}]],allowMultiple:!1},showcase:{type:"showcase",allowedFieldTypes:[],values:[[],[{name:"value",allowed:["true","false"],description:""}]],allowMultiple:!1},title:{type:"title",allowedFieldTypes:[],values:[[{name:"value",allowed:[],description:""}]],allowMultiple:!1},useLinks:{type:"useLinks",allowedFieldTypes:["suggester","listSuggester","inlineListSuggester"],values:[[],[{name:"value",allowed:["true","partial","false"],description:""}]],allowMultiple:!1},limit:{type:"limit",allowedFieldTypes:["text","textArea","list","inlineList"],values:[[{name:"value",allowed:["number"],description:"a character limit for text fields"}]],allowMultiple:!1},multiLine:{type:"multiLine",allowedFieldTypes:["list"],values:[[],[{name:"value",allowed:["true","false"],description:""}]],allowMultiple:!1},allowOther:{type:"allowOther",allowedFieldTypes:["suggester","listSuggester","inlineListSuggester"],values:[[],[{name:"value",allowed:["true","false"],description:""}]],allowMultiple:!1},invalid:{type:"invalid",allowedFieldTypes:[],values:[[]],allowMultiple:!0}},Ff=(o=>(o.MATH="math",o.TEXT="text",o.LINK="link",o.IMAGE="image",o.INVALID="invalid",o))(Ff||{}),Zu=(n=>(n.RENDER_MARKDOWN="renderMarkdown",n.HIDDEN="hidden",n.CLASS="class",n.INVALID="invalid",n))(Zu||{}),tc={renderMarkdown:{type:"renderMarkdown",allowedFieldTypes:["text"],values:[[],[{name:"value",allowed:["true","false"],description:""}]],allowMultiple:!1},hidden:{type:"hidden",allowedFieldTypes:[],values:[[],[{name:"value",allowed:["true","false"],description:""}]],allowMultiple:!1},class:{type:"class",allowedFieldTypes:[],values:[[{name:"className",allowed:[],description:"the name of the css class to add"}]],allowMultiple:!0},invalid:{type:"invalid",allowedFieldTypes:[],values:[[]],allowMultiple:!0}},Ed=8;var Be=!1;var Ki=Array.isArray,KT=Array.prototype.indexOf,kf=Array.from,Kx=Object.keys,xi=Object.defineProperty,Qi=Object.getOwnPropertyDescriptor,Qx=Object.getOwnPropertyDescriptors,Ad=Object.prototype,QT=Array.prototype,Gu=Object.getPrototypeOf,e_=Object.isExtensible;var eo=()=>{};function Pf(t){for(var e=0;e<t.length;e++)t[e]()}function eN(){var t,e,r=new Promise((i,n)=>{t=i,e=n});return{promise:r,resolve:t,reject:e}}var to=Symbol("$state"),Bf=Symbol("legacy props"),tN=Symbol(""),Td=Symbol("proxy path"),rc=new class extends Error{name="StaleReactionError";message="The reaction that called `getAbortSignal()` was re-run or destroyed"};var nc=3,Go=8;function rN(){if(Be){let t=new Error("await_outside_boundary\nCannot await outside a `<svelte:boundary>` with a `pending` snippet\nhttps://svelte.dev/e/await_outside_boundary");throw t.name="Svelte error",t}else throw new Error("https://svelte.dev/e/await_outside_boundary")}function Of(t){if(Be){let e=new Error(`lifecycle_outside_component
\`${t}(...)\` can only be used during component initialisation
https://svelte.dev/e/lifecycle_outside_component`);throw e.name="Svelte error",e}else throw new Error("https://svelte.dev/e/lifecycle_outside_component")}function nN(){if(Be){let t=new Error("async_derived_orphan\nCannot create a `$derived(...)` with an `await` expression outside of an effect tree\nhttps://svelte.dev/e/async_derived_orphan");throw t.name="Svelte error",t}else throw new Error("https://svelte.dev/e/async_derived_orphan")}function t_(){if(Be){let t=new Error("bind_invalid_checkbox_value\nUsing `bind:value` together with a checkbox input is not allowed. Use `bind:checked` instead\nhttps://svelte.dev/e/bind_invalid_checkbox_value");throw t.name="Svelte error",t}else throw new Error("https://svelte.dev/e/bind_invalid_checkbox_value")}function iN(){if(Be){let t=new Error(`derived_references_self
A derived value cannot reference itself recursively
https://svelte.dev/e/derived_references_self`);throw t.name="Svelte error",t}else throw new Error("https://svelte.dev/e/derived_references_self")}function oN(t){if(Be){let e=new Error(`effect_in_teardown
\`${t}\` cannot be used inside an effect cleanup function
https://svelte.dev/e/effect_in_teardown`);throw e.name="Svelte error",e}else throw new Error("https://svelte.dev/e/effect_in_teardown")}function aN(){if(Be){let t=new Error("effect_in_unowned_derived\nEffect cannot be created inside a `$derived` value that was not itself created inside an effect\nhttps://svelte.dev/e/effect_in_unowned_derived");throw t.name="Svelte error",t}else throw new Error("https://svelte.dev/e/effect_in_unowned_derived")}function sN(t){if(Be){let e=new Error(`effect_orphan
\`${t}\` can only be used inside an effect (e.g. during component initialisation)
https://svelte.dev/e/effect_orphan`);throw e.name="Svelte error",e}else throw new Error("https://svelte.dev/e/effect_orphan")}function uN(){if(Be){let t=new Error(`effect_update_depth_exceeded
Maximum update depth exceeded. This typically indicates that an effect reads and writes the same piece of state
https://svelte.dev/e/effect_update_depth_exceeded`);throw t.name="Svelte error",t}else throw new Error("https://svelte.dev/e/effect_update_depth_exceeded")}function lN(){if(Be){let t=new Error("flush_sync_in_effect\nCannot use `flushSync` inside an effect\nhttps://svelte.dev/e/flush_sync_in_effect");throw t.name="Svelte error",t}else throw new Error("https://svelte.dev/e/flush_sync_in_effect")}function cN(){if(Be){let t=new Error(`hydration_failed
Failed to hydrate the application
https://svelte.dev/e/hydration_failed`);throw t.name="Svelte error",t}else throw new Error("https://svelte.dev/e/hydration_failed")}function fN(){if(Be){let t=new Error("invalid_snippet\nCould not `{@render}` snippet due to the expression being `null` or `undefined`. Consider using optional chaining `{@render snippet?.()}`\nhttps://svelte.dev/e/invalid_snippet");throw t.name="Svelte error",t}else throw new Error("https://svelte.dev/e/invalid_snippet")}function pN(t){if(Be){let e=new Error(`props_invalid_value
Cannot do \`bind:${t}={undefined}\` when \`${t}\` has a fallback value
https://svelte.dev/e/props_invalid_value`);throw e.name="Svelte error",e}else throw new Error("https://svelte.dev/e/props_invalid_value")}function mN(t){if(Be){let e=new Error(`props_rest_readonly
Rest element properties of \`$props()\` such as \`${t}\` are readonly
https://svelte.dev/e/props_rest_readonly`);throw e.name="Svelte error",e}else throw new Error("https://svelte.dev/e/props_rest_readonly")}function dN(t){if(Be){let e=new Error(`rune_outside_svelte
The \`${t}\` rune is only available inside \`.svelte\` and \`.svelte.js/ts\` files
https://svelte.dev/e/rune_outside_svelte`);throw e.name="Svelte error",e}else throw new Error("https://svelte.dev/e/rune_outside_svelte")}function hN(){if(Be){let t=new Error("state_descriptors_fixed\nProperty descriptors defined on `$state` objects must contain `value` and always be `enumerable`, `configurable` and `writable`.\nhttps://svelte.dev/e/state_descriptors_fixed");throw t.name="Svelte error",t}else throw new Error("https://svelte.dev/e/state_descriptors_fixed")}function gN(){if(Be){let t=new Error("state_prototype_fixed\nCannot set prototype of `$state` object\nhttps://svelte.dev/e/state_prototype_fixed");throw t.name="Svelte error",t}else throw new Error("https://svelte.dev/e/state_prototype_fixed")}function vN(){if(Be){let t=new Error("state_unsafe_mutation\nUpdating state inside `$derived(...)`, `$inspect(...)` or a template expression is forbidden. If the value should not be reactive, declare it without `$state`\nhttps://svelte.dev/e/state_unsafe_mutation");throw t.name="Svelte error",t}else throw new Error("https://svelte.dev/e/state_unsafe_mutation")}var xs={};var Xr=Symbol(),Wo=Symbol("filename"),yN=Symbol("hmr"),bN="http://www.w3.org/1999/xhtml";var Wu="font-weight: bold",Hu="font-weight: normal";function xN(t){Be?console.warn(`%c[svelte] await_reactivity_loss
%cDetected reactivity loss when reading \`${t}\`. This happens when state is read in an async function after an earlier \`await\`
https://svelte.dev/e/await_reactivity_loss`,Wu,Hu):console.warn("https://svelte.dev/e/await_reactivity_loss")}function _N(t,e){Be?console.warn(`%c[svelte] await_waterfall
%cAn async derived, \`${t}\` (${e}) was not read immediately after it resolved. This often indicates an unnecessary waterfall, which can slow down your app
https://svelte.dev/e/await_waterfall`,Wu,Hu):console.warn("https://svelte.dev/e/await_waterfall")}function wN(t,e,r){Be?console.warn(`%c[svelte] hydration_attribute_changed
%cThe \`${t}\` attribute on \`${e}\` changed its value between server and client renders. The client value, \`${r}\`, will be ignored in favour of the server value
https://svelte.dev/e/hydration_attribute_changed`,Wu,Hu):console.warn("https://svelte.dev/e/hydration_attribute_changed")}function Yu(t){Be?console.warn(`%c[svelte] hydration_mismatch
%c${t?`Hydration failed because the initial UI does not match what was rendered on the server. The error occurred near ${t}`:"Hydration failed because the initial UI does not match what was rendered on the server"}
https://svelte.dev/e/hydration_mismatch`,Wu,Hu):console.warn("https://svelte.dev/e/hydration_mismatch")}function SN(){Be?console.warn(`%c[svelte] lifecycle_double_unmount
%cTried to unmount a component that was not mounted
https://svelte.dev/e/lifecycle_double_unmount`,Wu,Hu):console.warn("https://svelte.dev/e/lifecycle_double_unmount")}function DN(){Be?console.warn("%c[svelte] select_multiple_invalid_value\n%cThe `value` property of a `<select multiple>` element should be an array, but it received a non-array value. The selection will be kept as is.\nhttps://svelte.dev/e/select_multiple_invalid_value",Wu,Hu):console.warn("https://svelte.dev/e/select_multiple_invalid_value")}function Nd(t){Be?console.warn(`%c[svelte] state_proxy_equality_mismatch
%cReactive \`$state(...)\` proxies and the values they proxy have different identities. Because of this, comparisons with \`${t}\` will produce unexpected results
https://svelte.dev/e/state_proxy_equality_mismatch`,Wu,Hu):console.warn("https://svelte.dev/e/state_proxy_equality_mismatch")}var It=!1;function Si(t){It=t}var Xt;function pn(t){if(t===null)throw Yu(),xs;return Xt=t}function Di(){return pn(di(Xt))}function pe(t){if(It){if(di(Xt)!==null)throw Yu(),xs;Xt=t}}function Nt(t=1){if(It){for(var e=t,r=Xt;e--;)r=di(r);Xt=r}}function Xu(){for(var t=0,e=Xt;;){if(e.nodeType===Go){var r=e.data;if(r==="]"){if(t===0)return e;t-=1}else(r==="["||r==="[!")&&(t+=1)}var i=di(e);e.remove(),e=i}}function Md(t){if(!t||t.nodeType!==Go)throw Yu(),xs;return t.data}function Cd(t){return t===this.v}function $d(t,e){return t!=t?e==e:t!==e||t!==null&&typeof t=="object"||typeof t=="function"}function Id(t){return!$d(t,this.v)}var ha=!1,_s=!1,Fa=!1;var HG="font-weight: bold",YG="font-weight: normal";function r_(t){Be?console.warn(`%c[svelte] state_snapshot_uncloneable
%c${t?`The following properties cannot be cloned with \`$state.snapshot\` \u2014 the return value contains the originals:
${t}`:"Value cannot be cloned with `$state.snapshot` \u2014 the original value was returned"}
https://svelte.dev/e/state_snapshot_uncloneable`,HG,YG):console.warn("https://svelte.dev/e/state_snapshot_uncloneable")}var JG=[];function bt(t,e=!1){if(Be&&!e){let r=[],i=Lf(t,new Map,"",r);if(r.length===1&&r[0]==="")r_();else if(r.length>0){let n=r.length>10?r.slice(0,7):r.slice(0,10),o=r.length-n.length,a=n.map(s=>`- <value>${s}`).join(`
`);o>0&&(a+=`
- ...and ${o} more`),r_(a)}return i}return Lf(t,new Map,"",JG)}function Lf(t,e,r,i,n=null){if(typeof t=="object"&&t!==null){var o=e.get(t);if(o!==void 0)return o;if(t instanceof Map)return new Map(t);if(t instanceof Set)return new Set(t);if(Ki(t)){var a=Array(t.length);e.set(t,a),n!==null&&e.set(n,a);for(var s=0;s<t.length;s+=1){var l=t[s];s in t&&(a[s]=Lf(l,e,Be?`${r}[${s}]`:r,i))}return a}if(Gu(t)===Ad){a={},e.set(t,a),n!==null&&e.set(n,a);for(var u in t)a[u]=Lf(t[u],e,Be?`${r}.${u}`:r,i);return a}if(t instanceof Date)return structuredClone(t);if(typeof t.toJSON=="function")return Lf(t.toJSON(),e,Be?`${r}.toJSON()`:r,i,t)}if(t instanceof EventTarget)return t;try{return structuredClone(t)}catch{return Be&&i.push(r),t}}var Uf=null;function ka(t){let e=Error(),r=e.stack;if(!r)return null;let i=r.split(`
`),n=[`
`];for(let o=0;o<i.length;o++){let a=i[o];if(a!=="Error"){if(a.includes("validate_each_keys"))return null;a.includes("svelte/src/internal")||n.push(a)}}return n.length===1?null:(xi(e,"stack",{value:n.join(`
`)}),xi(e,"name",{value:`${t}Error`}),e)}function Ho(t,e){return t.label=e,Fd(t.v,e),t}function Fd(t,e){return t?.[Td]?.(e),t}var gr=null;function fu(t){gr=t}var ws=null;function kd(t){ws=t}var ga=null;function zf(t){ga=t}function Ae(t,e=!1,r){gr={p:gr,c:null,e:null,s:t,x:null,l:_s&&!e?{s:null,u:null,$:[]}:null},Be&&(gr.function=r,ga=r)}function Te(t){var e=gr,r=e.e;if(r!==null){e.e=null;for(var i of r)n_(i)}return t!==void 0&&(e.x=t),gr=e.p,Be&&(ga=gr?.function??null),t??{}}function Yo(){return!_s||gr!==null&&gr.l===null}var i_=new WeakMap;function o_(t){var e=Tt;if(e===null)return Zt.f|=8388608,t;if(Be&&t instanceof Error&&!i_.has(t)&&i_.set(t,XG(t,e)),(e.f&32768)===0){if((e.f&128)===0)throw!e.parent&&t instanceof Error&&TN(t),t;e.b.error(t)}else oc(t,e)}function oc(t,e){for(;e!==null;){if((e.f&128)!==0)try{e.b.error(t);return}catch(r){t=r}e=e.parent}throw t instanceof Error&&TN(t),t}function XG(t,e){let r=Qi(t,"message");if(!(r&&!r.configurable)){for(var i=Vf?" ":" ",n=`
${i}in ${e.fn?.name||"<unknown>"}`,o=e.ctx;o!==null;)n+=`
${i}in ${o.function?.[Wo].split("/").pop()}`,o=o.p;return{message:t.message+`
${n}
`,stack:t.stack?.split(`
`).filter(a=>!a.includes("svelte/src/internal")).join(`
`)}}}function TN(t){let e=i_.get(t);e&&(xi(t,"message",{value:e.message}),xi(t,"stack",{value:e.stack}))}var KG=typeof requestIdleCallback>"u"?t=>setTimeout(t,1):requestIdleCallback,qf=[],jf=[];function NN(){var t=qf;qf=[],Pf(t)}function MN(){var t=jf;jf=[],Pf(t)}function Jo(t){qf.length===0&&queueMicrotask(NN),qf.push(t)}function CN(t){jf.length===0&&KG(MN),jf.push(t)}function $N(){qf.length>0&&NN(),jf.length>0&&MN()}var che=589952;function Bd(){for(var t=Tt.b;t!==null&&!t.has_pending_snippet();)t=t.parent;return t===null&&rN(),t}var Ds=null;function l_(t){Ds=t}var Gf=new Set;function Ku(t){var e=2050,r=Zt!==null&&(Zt.f&2)!==0?Zt:null;Tt===null||r!==null&&(r.f&256)!==0?e|=256:Tt.f|=524288;let i={ctx:gr,deps:null,effects:null,equals:Cd,f:e,fn:t,reactions:null,rv:0,v:Xr,wv:0,parent:r??Tt,ac:null};return Be&&Fa&&(i.created=ka("CreatedAt")),i}function c_(t,e){let r=Tt;r===null&&nN();var i=r.b,n=void 0,o=So(Xr),a=null,s=!Zt;return IN(()=>{Be&&(Ds=Tt);try{var l=t()}catch(p){l=Promise.reject(p)}Be&&(Ds=null);var u=()=>l;n=a?.then(u,u)??Promise.resolve(l),a=n;var c=Sr,f=i.pending;s&&(i.update_pending_count(1),f||c.increment());let m=(p,d=void 0)=>{a=null,Ds=null,f||c.activate(),d?d!==rc&&(o.f|=8388608,Ba(o,d)):((o.f&8388608)!==0&&(o.f^=8388608),Ba(o,p),Be&&e!==void 0&&(Gf.add(o),setTimeout(()=>{Gf.has(o)&&(_N(o.label,e),Gf.delete(o))}))),s&&(i.update_pending_count(-1),f||c.decrement()),Ld()};if(n.then(m,p=>m(null,p||"unknown")),c)return()=>{queueMicrotask(()=>c.neuter())}}),Be&&(o.f|=4194304),new Promise(l=>{function u(c){function f(){c===n?l(o):u(n)}c.then(f,f)}u(n)})}function fr(t){let e=Ku(t);return Ud(e),e}function Qu(t){let e=Ku(t);return e.equals=Id,e}function Od(t){var e=t.effects;if(e!==null){t.effects=null;for(var r=0;r<e.length;r+=1)Yn(e[r])}}var s_=[];function QG(t){for(var e=t.parent;e!==null;){if((e.f&2)===0)return e;e=e.parent}return null}function Wf(t){var e,r=Tt;if(hi(QG(t)),Be){let i=el;u_(new Set);try{s_.includes(t)&&iN(),s_.push(t),Od(t),e=Rd(t)}finally{hi(r),u_(i),s_.pop()}}else try{Od(t),e=Rd(t)}finally{hi(r)}return e}function f_(t){var e=Wf(t);if(t.equals(e)||(t.v=e,t.wv=Hf()),!va)if(pu!==null)pu.set(t,t.v);else{var r=(Es||(t.f&256)!==0)&&t.deps!==null?4096:1024;On(t,r)}}function zd(t,e,r){let i=Yo()?Ku:Qu;if(e.length===0){r(t.map(i));return}var n=Sr,o=Tt,a=eW(),s=Bd();Promise.all(e.map(l=>c_(l))).then(l=>{n?.activate(),a();try{r([...t.map(i),...l])}catch(u){(o.f&16384)===0&&oc(u,o)}n?.deactivate(),Ld()}).catch(l=>{s.error(l)})}function eW(){var t=Tt,e=Zt,r=gr;return function(){hi(t),li(e),fu(r),Be&&l_(null)}}function Ld(){hi(null),li(null),fu(null),Be&&l_(null)}var Yf=new Set,Sr=null,Jf=null,pu=null,a_=new Set,qd=[];function kN(){let t=qd.shift();qd.length>0&&queueMicrotask(kN),t()}var tl=[],Zd=null,p_=!1,Vd=!1,Pa=class t{current=new Map;#t=new Map;#e=new Set;#r=0;#l=null;#c=!1;#o=[];#a=[];#n=[];#i=[];#s=[];#f=[];#p=[];skipped_effects=new Set;process(e){tl=[],Jf=null;var r=null;if(Yf.size>1){r=new Map,pu=new Map;for(let[o,a]of this.current)r.set(o,{v:o.v,wv:o.wv}),o.v=a;for(let o of Yf)if(o!==this)for(let[a,s]of o.#t)r.has(a)||(r.set(a,{v:a.v,wv:a.wv}),a.v=s)}for(let o of e)this.#d(o);if(this.#o.length===0&&this.#r===0){this.#m();var i=this.#n,n=this.#i;this.#n=[],this.#i=[],this.#s=[],Jf=Sr,Sr=null,FN(i),FN(n),Sr===null?Sr=this:Yf.delete(this),this.#l?.resolve()}else this.#u(this.#n),this.#u(this.#i),this.#u(this.#s);if(r){for(let[o,{v:a,wv:s}]of r)o.wv<=s&&(o.v=a);pu=null}for(let o of this.#o)As(o);for(let o of this.#a)As(o);this.#o=[],this.#a=[]}#d(e){e.f^=1024;for(var r=e.first;r!==null;){var i=r.f,n=(i&96)!==0,o=n&&(i&1024)!==0,a=o||(i&8192)!==0||this.skipped_effects.has(r);if(!a&&r.fn!==null){if(n)r.f^=1024;else if((i&1024)===0)if((i&4)!==0)this.#i.push(r);else if(ha&&(i&8)!==0)this.#n.push(r);else if((i&4194304)!==0){var s=r.b?.pending?this.#a:this.#o;s.push(r)}else mu(r)&&((r.f&16)!==0&&this.#s.push(r),As(r));var l=r.first;if(l!==null){r=l;continue}}var u=r.parent;for(r=r.next;r===null&&u!==null;)r=u.next,u=u.parent}}#u(e){for(let r of e)((r.f&2048)!==0?this.#f:this.#p).push(r),On(r,1024);e.length=0}capture(e,r){this.#t.has(e)||this.#t.set(e,r),this.current.set(e,e.v)}activate(){Sr=this}deactivate(){Sr=null,Jf=null;for(let e of a_)if(a_.delete(e),e(),Sr!==null)break}neuter(){this.#c=!0}flush(){tl.length>0?m_():this.#m(),Sr===this&&(this.#r===0&&Yf.delete(this),this.deactivate())}#m(){if(!this.#c)for(let e of this.#e)e();this.#e.clear()}increment(){this.#r+=1}decrement(){if(this.#r-=1,this.#r===0){for(let e of this.#f)On(e,2048),Ra(e);for(let e of this.#p)On(e,4096),Ra(e);this.#n=[],this.#i=[],this.flush()}else this.deactivate()}add_callback(e){this.#e.add(e)}settled(){return(this.#l??=eN()).promise}static ensure(){if(Sr===null){let e=Sr=new t;Yf.add(Sr),Vd||t.enqueue(()=>{Sr===e&&e.flush()})}return Sr}static enqueue(e){qd.length===0&&queueMicrotask(kN),qd.unshift(e)}};function sc(t){ha&&Tt!==null&&lN();var e=Vd;Vd=!0;try{var r;for(t&&(m_(),r=t());;){if($N(),tl.length===0&&(Sr?.flush(),tl.length===0))return Zd=null,r;m_()}}finally{Vd=e}}function m_(){var t=rl;p_=!0;try{var e=0;for(d_(!0);tl.length>0;){var r=Pa.ensure();if(e++>1e3){if(Be){var i=new Map;for(let o of r.current.keys())for(let[a,s]of o.updated??[]){var n=i.get(a);n||(n={error:s.error,count:0},i.set(a,n)),n.count+=s.count}for(let o of i.values())console.error(o.error)}tW()}r.process(tl),Ns.clear()}}finally{p_=!1,d_(t),Zd=null}}function tW(){try{uN()}catch(t){Be&&xi(t,"stack",{value:""}),oc(t,Zd)}}function FN(t){var e=t.length;if(e!==0){for(var r=0;r<e;){var i=t[r++];if((i.f&24576)===0&&mu(i)){var n=Sr?Sr.current.size:0;if(As(i),i.deps===null&&i.first===null&&i.nodes_start===null&&(i.teardown===null&&i.ac===null?g_(i):i.fn=null),Sr!==null&&Sr.current.size>n&&(i.f&1048576)!==0)break}}for(;r<e;)Ra(t[r++])}}function Ra(t){for(var e=Zd=t;e.parent!==null;){e=e.parent;var r=e.f;if(p_&&e===Tt&&(r&16)!==0)return;if((r&96)!==0){if((r&1024)===0)return;e.f^=1024}}tl.push(e)}var el=new Set,Ns=new Map;function u_(t){el=t}var v_=!1;function PN(){v_=!0}function So(t,e){var r={f:0,v:t,reactions:null,equals:Cd,rv:0,wv:0};return Be&&Fa&&(r.created=e??ka("CreatedAt"),r.updated=null,r.set_during_effect=!1,r.trace=null),r}function ft(t,e){let r=So(t,e);return Ud(r),r}function nl(t,e=!1,r=!0){let i=So(t);return e||(i.equals=Id),_s&&r&&gr!==null&&gr.l!==null&&(gr.l.s??=[]).push(i),i}function Re(t,e,r=!1){Zt!==null&&(!ro||(Zt.f&131072)!==0)&&Yo()&&(Zt.f&4325394)!==0&&!La?.includes(t)&&vN();let i=r?wt(e):e;return Be&&Fd(i,t.label),Ba(t,i)}function Ba(t,e){if(!t.equals(e)){var r=t.v;va?Ns.set(t,e):Ns.set(t,r),t.v=e;var i=Pa.ensure();if(i.capture(t,r),Be){if(Fa||Tt!==null){let n=ka("UpdatedAt");if(n!==null){t.updated??=new Map;let o=t.updated.get(n.stack);o||(o={error:n,count:0},t.updated.set(n.stack,o)),o.count++}}Tt!==null&&(t.set_during_effect=!0)}(t.f&2)!==0&&((t.f&2048)!==0&&Wf(t),On(t,(t.f&256)===0?1024:4096)),t.wv=Hf(),BN(t,2048),Yo()&&Tt!==null&&(Tt.f&1024)!==0&&(Tt.f&96)===0&&(Eo===null?ON([t]):Eo.push(t)),Be&&el.size>0&&!v_&&y_()}return e}function y_(){v_=!1;let t=Array.from(el);for(let e of t)(e.f&1024)!==0&&On(e,4096),mu(e)&&As(e);el.clear()}function Zf(t){Re(t,t.v+1)}function BN(t,e){var r=t.reactions;if(r!==null)for(var i=Yo(),n=r.length,o=0;o<n;o++){var a=r[o],s=a.f;if(!(!i&&a===Tt)){if(Be&&(s&131072)!==0){el.add(a);continue}var l=(s&2048)===0;l&&On(a,e),(s&2)!==0?BN(a,4096):l&&Ra(a)}}}var rW=/^[a-zA-Z_$][a-zA-Z_$0-9]*$/;function wt(t){if(typeof t!="object"||t===null||to in t)return t;let e=Gu(t);if(e!==Ad&&e!==QT)return t;var r=new Map,i=Ki(t),n=ft(0),o=Be&&Fa?ka("CreatedAt"):null,a=du,s=c=>{if(du===a)return c();var f=Zt,m=du;li(null),b_(a);var p=c();return li(f),b_(m),p};i&&(r.set("length",ft(t.length,o)),Be&&(t=iW(t)));var l="";function u(c){l=c,Ho(n,`${l} version`);for(let[f,m]of r)Ho(m,il(l,f))}return new Proxy(t,{defineProperty(c,f,m){(!("value"in m)||m.configurable===!1||m.enumerable===!1||m.writable===!1)&&hN();var p=r.get(f);return p===void 0?p=s(()=>{var d=ft(m.value,o);return r.set(f,d),Be&&typeof f=="string"&&Ho(d,il(l,f)),d}):Re(p,m.value,!0),!0},deleteProperty(c,f){var m=r.get(f);if(m===void 0){if(f in c){let p=s(()=>ft(Xr,o));r.set(f,p),Zf(n),Be&&Ho(p,il(l,f))}}else Re(m,Xr),Zf(n);return!0},get(c,f,m){if(f===to)return t;if(Be&&f===Td)return u;var p=r.get(f),d=f in c;if(p===void 0&&(!d||Qi(c,f)?.writable)&&(p=s(()=>{var v=wt(d?c[f]:Xr),y=ft(v,o);return Be&&Ho(y,il(l,f)),y}),r.set(f,p)),p!==void 0){var h=U(p);return h===Xr?void 0:h}return Reflect.get(c,f,m)},getOwnPropertyDescriptor(c,f){var m=Reflect.getOwnPropertyDescriptor(c,f);if(m&&"value"in m){var p=r.get(f);p&&(m.value=U(p))}else if(m===void 0){var d=r.get(f),h=d?.v;if(d!==void 0&&h!==Xr)return{enumerable:!0,configurable:!0,value:h,writable:!0}}return m},has(c,f){if(f===to)return!0;var m=r.get(f),p=m!==void 0&&m.v!==Xr||Reflect.has(c,f);if(m!==void 0||Tt!==null&&(!p||Qi(c,f)?.writable)){m===void 0&&(m=s(()=>{var h=p?wt(c[f]):Xr,v=ft(h,o);return Be&&Ho(v,il(l,f)),v}),r.set(f,m));var d=U(m);if(d===Xr)return!1}return p},set(c,f,m,p){var d=r.get(f),h=f in c;if(i&&f==="length")for(var v=m;v<d.v;v+=1){var y=r.get(v+"");y!==void 0?Re(y,Xr):v in c&&(y=s(()=>ft(Xr,o)),r.set(v+"",y),Be&&Ho(y,il(l,v)))}if(d===void 0)(!h||Qi(c,f)?.writable)&&(d=s(()=>ft(void 0,o)),Re(d,wt(m)),r.set(f,d),Be&&Ho(d,il(l,f)));else{h=d.v!==Xr;var S=s(()=>wt(m));Re(d,S)}var b=Reflect.getOwnPropertyDescriptor(c,f);if(b?.set&&b.set.call(p,m),!h){if(i&&typeof f=="string"){var _=r.get("length"),w=Number(f);Number.isInteger(w)&&w>=_.v&&Re(_,w+1)}Zf(n)}return!0},ownKeys(c){U(n);var f=Reflect.ownKeys(c).filter(d=>{var h=r.get(d);return h===void 0||h.v!==Xr});for(var[m,p]of r)p.v!==Xr&&!(m in c)&&f.push(m);return f},setPrototypeOf(){gN()}})}function il(t,e){return typeof e=="symbol"?`${t}[Symbol(${e.description??""})]`:rW.test(e)?`${t}.${e}`:/^\d+$/.test(e)?`${t}[${e}]`:`${t}['${e}']`}function uc(t){try{if(t!==null&&typeof t=="object"&&to in t)return t[to]}catch{}return t}function x_(t,e){return Object.is(uc(t),uc(e))}var nW=new Set(["copyWithin","fill","pop","push","reverse","shift","sort","splice","unshift"]);function iW(t){return new Proxy(t,{get(e,r,i){var n=Reflect.get(e,r,i);return nW.has(r)?function(...o){PN();var a=n.apply(this,o);return y_(),a}:n}})}function RN(){let t=Array.prototype,e=Array.__svelte_cleanup;e&&e();let{indexOf:r,lastIndexOf:i,includes:n}=t;t.indexOf=function(o,a){let s=r.call(this,o,a);if(s===-1){for(let l=a??0;l<this.length;l+=1)if(uc(this[l])===o){Nd("array.indexOf(...)");break}}return s},t.lastIndexOf=function(o,a){let s=i.call(this,o,a??this.length-1);if(s===-1){for(let l=0;l<=(a??this.length-1);l+=1)if(uc(this[l])===o){Nd("array.lastIndexOf(...)");break}}return s},t.includes=function(o,a){let s=n.call(this,o,a);if(!s){for(let l=0;l<this.length;l+=1)if(uc(this[l])===o){Nd("array.includes(...)");break}}return s},Array.__svelte_cleanup=()=>{t.indexOf=r,t.lastIndexOf=i,t.includes=n}}var Ms,LN,Vf,UN,zN;function Gd(){if(Ms===void 0){Ms=window,LN=document,Vf=/Firefox/.test(navigator.userAgent);var t=Element.prototype,e=Node.prototype,r=Text.prototype;UN=Qi(e,"firstChild").get,zN=Qi(e,"nextSibling").get,e_(t)&&(t.__click=void 0,t.__className=void 0,t.__attributes=null,t.__style=void 0,t.__e=void 0),e_(r)&&(r.__t=void 0),Be&&(t.__svelte_meta=null,RN())}}function Jn(t=""){return document.createTextNode(t)}function Sn(t){return UN.call(t)}function di(t){return zN.call(t)}function he(t,e){if(!It)return Sn(t);var r=Sn(Xt);if(r===null)r=Xt.appendChild(Jn());else if(e&&r.nodeType!==nc){var i=Jn();return r?.before(i),pn(i),i}return pn(r),r}function je(t,e){if(!It){var r=Sn(t);return r instanceof Comment&&r.data===""?di(r):r}if(e&&Xt?.nodeType!==nc){var i=Jn();return Xt?.before(i),pn(i),i}return Xt}function fe(t,e=1,r=!1){let i=It?Xt:t;for(var n;e--;)n=i,i=di(i);if(!It)return i;if(r&&i?.nodeType!==nc){var o=Jn();return i===null?n?.after(o):i.before(o),pn(o),o}return pn(i),i}function lc(t){t.textContent=""}function cc(){if(!ha)return!1;var t=Tt.f;return(t&32768)!==0}function Cn(t){It&&Sn(t)!==null&&lc(t)}var VN=!1;function Wd(){VN||(VN=!0,document.addEventListener("reset",t=>{Promise.resolve().then(()=>{if(!t.defaultPrevented)for(let e of t.target.elements)e.__on_r?.()})},{capture:!0}))}function Cs(t){var e=Zt,r=Tt;li(null),hi(null);try{return t()}finally{li(e),hi(r)}}function Hd(t,e,r,i=r){t.addEventListener(e,()=>Cs(r));let n=t.__on_r;n?t.__on_r=()=>{n(),i(!0)}:t.__on_r=()=>i(!0),Wd()}function jN(t){Tt===null&&Zt===null&&sN(t),Zt!==null&&(Zt.f&256)!==0&&Tt===null&&aN(),va&&oN(t)}function oW(t,e){var r=e.last;r===null?e.last=e.first=t:(r.next=t,t.prev=r,e.last=t)}function Ua(t,e,r,i=!0){var n=Tt;if(Be)for(;n!==null&&(n.f&131072)!==0;)n=n.parent;n!==null&&(n.f&8192)!==0&&(t|=8192);var o={ctx:gr,deps:null,nodes_start:null,nodes_end:null,f:t|2048,first:null,fn:e,last:null,next:null,parent:n,b:n&&n.b,prev:null,teardown:null,transitions:null,wv:0,ac:null};if(Be&&(o.component_function=ga),r)try{As(o),o.f|=32768}catch(l){throw Yn(o),l}else e!==null&&Ra(o);var a=r&&o.deps===null&&o.first===null&&o.nodes_start===null&&o.teardown===null&&(o.f&524288)===0;if(!a&&i&&(n!==null&&oW(o,n),Zt!==null&&(Zt.f&2)!==0&&(t&64)===0)){var s=Zt;(s.effects??=[]).push(o)}return o}function no(t){let e=Ua(8,null,!1);return On(e,1024),e.teardown=t,e}function io(t){jN("$effect"),Be&&xi(t,"name",{value:"$effect"});var e=Tt.f,r=!Zt&&(e&32)!==0&&(e&32768)===0;if(r){var i=gr;(i.e??=[]).push(t)}else return n_(t)}function n_(t){return Ua(1048580,t,!1)}function w_(t){Pa.ensure();let e=Ua(64,t,!0);return()=>{Yn(e)}}function ZN(t){Pa.ensure();let e=Ua(64,t,!0);return(r={})=>new Promise(i=>{r.outro?Oa(e,()=>{Yn(e),i(void 0)}):(Yn(e),i(void 0))})}function Ao(t){return Ua(4,t,!1)}function IN(t){return Ua(4718592,t,!0)}function Ei(t,e=0){return Ua(8|e,t,!0)}function ze(t,e=[],r=[]){zd(e,r,i=>{Ua(8,()=>t(...i.map(U)),!0)})}function Li(t,e=0){var r=Ua(16|e,t,!0);return Be&&(r.dev_stack=ws),r}function Hn(t,e=!0){return Ua(32,t,!0,e)}function S_(t){var e=t.teardown;if(e!==null){let r=va,i=Zt;__(!0),li(null);try{e.call(null)}finally{__(r),li(i)}}}function D_(t,e=!1){var r=t.first;for(t.first=t.last=null;r!==null;){let n=r.ac;n!==null&&Cs(()=>{n.abort(rc)});var i=r.next;(r.f&64)!==0?r.parent=null:Yn(r,e),r=i}}function GN(t){for(var e=t.first;e!==null;){var r=e.next;(e.f&32)===0&&Yn(e),e=r}}function Yn(t,e=!0){var r=!1;(e||(t.f&262144)!==0)&&t.nodes_start!==null&&t.nodes_end!==null&&(WN(t.nodes_start,t.nodes_end),r=!0),D_(t,e&&!r),Qf(t,0),On(t,16384);var i=t.transitions;if(i!==null)for(let o of i)o.stop();S_(t);var n=t.parent;n!==null&&n.first!==null&&g_(t),Be&&(t.component_function=null),t.next=t.prev=t.teardown=t.ctx=t.deps=t.fn=t.nodes_start=t.nodes_end=t.ac=null}function WN(t,e){for(;t!==null;){var r=t===e?null:di(t);t.remove(),t=r}}function g_(t){var e=t.parent,r=t.prev,i=t.next;r!==null&&(r.next=i),i!==null&&(i.prev=r),e!==null&&(e.first===t&&(e.first=i),e.last===t&&(e.last=r))}function Oa(t,e){var r=[];Yd(t,r,!0),E_(r,()=>{Yn(t),e&&e()})}function E_(t,e){var r=t.length;if(r>0){var i=()=>--r||e();for(var n of t)n.out(i)}else e()}function Yd(t,e,r){if((t.f&8192)===0){if(t.f^=8192,t.transitions!==null)for(let a of t.transitions)(a.is_global||r)&&e.push(a);for(var i=t.first;i!==null;){var n=i.next,o=(i.f&65536)!==0||(i.f&32)!==0;Yd(i,e,o?r:!1),i=n}}}function ol(t){HN(t,!0)}function HN(t,e){if((t.f&8192)!==0){t.f^=8192,(t.f&1024)===0&&(On(t,2048),Ra(t));for(var r=t.first;r!==null;){var i=r.next,n=(r.f&65536)!==0||(r.f&32)!==0;HN(r,n?e:!1),r=i}if(t.transitions!==null)for(let o of t.transitions)(o.is_global||e)&&o.in()}}var YN=null;var rl=!1;function d_(t){rl=t}var va=!1;function __(t){va=t}var Zt=null,ro=!1;function li(t){Zt=t}var Tt=null;function hi(t){Tt=t}var La=null;function Ud(t){Zt!==null&&(!ha||(Zt.f&2)!==0)&&(La===null?La=[t]:La.push(t))}var Vi=null,To=0,Eo=null;function ON(t){Eo=t}var JN=1,ep=0,du=ep;function b_(t){du=t}var Es=!1;function Hf(){return++JN}function mu(t){var e=t.f;if((e&2048)!==0)return!0;if((e&4096)!==0){var r=t.deps,i=(e&256)!==0;if(r!==null){var n,o,a=(e&512)!==0,s=i&&Tt!==null&&!Es,l=r.length;if((a||s)&&(Tt===null||(Tt.f&16384)===0)){var u=t,c=u.parent;for(n=0;n<l;n++)o=r[n],(a||!o?.reactions?.includes(u))&&(o.reactions??=[]).push(u);a&&(u.f^=512),s&&c!==null&&(c.f&256)===0&&(u.f^=256)}for(n=0;n<l;n++)if(o=r[n],mu(o)&&f_(o),o.wv>t.wv)return!0}(!i||Tt!==null&&!Es)&&On(t,1024)}return!1}function XN(t,e,r=!0){var i=t.reactions;if(i!==null&&!(!ha&&La?.includes(t)))for(var n=0;n<i.length;n++){var o=i[n];(o.f&2)!==0?XN(o,e,!1):e===o&&(r?On(o,2048):(o.f&1024)!==0&&On(o,4096),Ra(o))}}function Rd(t){var e=Vi,r=To,i=Eo,n=Zt,o=Es,a=La,s=gr,l=ro,u=du,c=t.f;Vi=null,To=0,Eo=null,Es=(c&256)!==0&&(ro||!rl||Zt===null),Zt=(c&96)===0?t:null,La=null,fu(t.ctx),ro=!1,du=++ep,t.ac!==null&&(Cs(()=>{t.ac.abort(rc)}),t.ac=null);try{t.f|=2097152;var f=t.fn,m=f(),p=t.deps;if(Vi!==null){var d;if(Qf(t,To),p!==null&&To>0)for(p.length=To+Vi.length,d=0;d<Vi.length;d++)p[To+d]=Vi[d];else t.deps=p=Vi;if(!Es||(c&2)!==0&&t.reactions!==null)for(d=To;d<p.length;d++)(p[d].reactions??=[]).push(t)}else p!==null&&To<p.length&&(Qf(t,To),p.length=To);if(Yo()&&Eo!==null&&!ro&&p!==null&&(t.f&6146)===0)for(d=0;d<Eo.length;d++)XN(Eo[d],t);return n!==null&&n!==t&&(ep++,Eo!==null&&(i===null?i=Eo:i.push(...Eo))),(t.f&8388608)!==0&&(t.f^=8388608),m}catch(h){return o_(h)}finally{t.f^=2097152,Vi=e,To=r,Eo=i,Zt=n,Es=o,La=a,fu(s),ro=l,du=u}}function aW(t,e){let r=e.reactions;if(r!==null){var i=KT.call(r,t);if(i!==-1){var n=r.length-1;n===0?r=e.reactions=null:(r[i]=r[n],r.pop())}}r===null&&(e.f&2)!==0&&(Vi===null||!Vi.includes(e))&&(On(e,4096),(e.f&768)===0&&(e.f^=512),Od(e),Qf(e,0))}function Qf(t,e){var r=t.deps;if(r!==null)for(var i=e;i<r.length;i++)aW(t,r[i])}function As(t){var e=t.f;if((e&16384)===0){On(t,1024);var r=Tt,i=rl;if(Tt=t,rl=!0,Be){var n=ga;zf(t.component_function);var o=ws;kd(t.dev_stack??ws)}try{(e&16)!==0?GN(t):D_(t),S_(t);var a=Rd(t);if(t.teardown=typeof a=="function"?a:null,t.wv=JN,Be&&Fa&&(t.f&2048)!==0&&t.deps!==null)for(var s of t.deps)s.set_during_effect&&(s.wv=Hf(),s.set_during_effect=!1)}finally{rl=i,Tt=r,Be&&(zf(n),kd(o))}}}function U(t){var e=t.f,r=(e&2)!==0;if(YN?.add(t),Zt!==null&&!ro){var i=Tt!==null&&(Tt.f&16384)!==0;if(!i&&!La?.includes(t)){var n=Zt.deps;if((Zt.f&2097152)!==0)t.rv<ep&&(t.rv=ep,Vi===null&&n!==null&&n[To]===t?To++:Vi===null?Vi=[t]:(!Es||!Vi.includes(t))&&Vi.push(t));else{(Zt.deps??=[]).push(t);var o=t.reactions;o===null?t.reactions=[Zt]:o.includes(Zt)||o.push(Zt)}}}else if(r&&t.deps===null&&t.effects===null){var a=t,s=a.parent;s!==null&&(s.f&256)===0&&(a.f^=256)}if(Be){if(Ds){var l=(Ds.f&2097152)!==0,u=Ds.deps?.includes(t);if(!l&&!ro&&!u){xN(t.label);var c=ka("TracedAt");c&&console.warn(c)}}if(Gf.delete(t),Fa&&!ro&&Uf!==null&&Zt!==null&&Uf.reaction===Zt){if(t.trace)t.trace();else if(c=ka("TracedAt"),c){var f=Uf.entries.get(t);f===void 0&&(f={traces:[]},Uf.entries.set(t,f));var m=f.traces[f.traces.length-1];c.stack!==m?.stack&&f.traces.push(c)}}}if(va){if(Ns.has(t))return Ns.get(t);if(r){a=t;var p=a.v;return((a.f&1024)===0&&a.reactions!==null||KN(a))&&(p=Wf(a)),Ns.set(a,p),p}}else if(r){if(a=t,pu?.has(a))return pu.get(a);mu(a)&&f_(a)}if((t.f&8388608)!==0)throw t.v;return t.v}function KN(t){if(t.v===Xr)return!0;if(t.deps===null)return!1;for(let e of t.deps)if(Ns.has(e)||(e.f&2)!==0&&KN(e))return!0;return!1}function on(t){var e=ro;try{return ro=!0,t()}finally{ro=e}}var sW=-7169;function On(t,e){t.f=t.f&sW|e}var lW=["allowfullscreen","async","autofocus","autoplay","checked","controls","default","disabled","formnovalidate","hidden","indeterminate","inert","ismap","loop","multiple","muted","nomodule","novalidate","open","playsinline","readonly","required","reversed","seamless","selected","webkitdirectory","defer","disablepictureinpicture","disableremoteplayback"];var fve=[...lW,"formNoValidate","isMap","noModule","playsInline","readOnly","value","volume","defaultValue","defaultChecked","srcObject","noValidate","allowFullscreen","disablePictureInPicture","disableRemotePlayback"];var cW=["touchstart","touchmove"];function QN(t){return cW.includes(t)}var fW=["$state","$state.raw","$derived","$derived.by"],pve=[...fW,"$state.snapshot","$props","$props.id","$bindable","$effect","$effect.pre","$effect.tracking","$effect.root","$effect.pending","$inspect","$inspect().with","$inspect.trace","$host"];var A_=new Set,Kd=new Set;function nM(t,e,r,i={}){function n(o){if(i.capture||fc.call(e,o),!o.cancelBubble)return Cs(()=>r?.call(this,o))}return t.startsWith("pointer")||t.startsWith("touch")||t==="wheel"?Jo(()=>{e.addEventListener(t,n,i)}):e.addEventListener(t,n,i),n}function Ai(t,e,r,i,n){var o={capture:i,passive:n},a=nM(t,e,r,o);(e===document.body||e===window||e===document||e instanceof HTMLMediaElement)&&no(()=>{e.removeEventListener(t,a,o)})}function Ft(t){for(var e=0;e<t.length;e++)A_.add(t[e]);for(var r of Kd)r(t)}var rM=null;function fc(t){var e=this,r=e.ownerDocument,i=t.type,n=t.composedPath?.()||[],o=n[0]||t.target;rM=t;var a=0,s=rM===t&&t.__root;if(s){var l=n.indexOf(s);if(l!==-1&&(e===document||e===window)){t.__root=e;return}var u=n.indexOf(e);if(u===-1)return;l<=u&&(a=l)}if(o=n[a]||t.target,o!==e){xi(t,"currentTarget",{configurable:!0,get(){return o||r}});var c=Zt,f=Tt;li(null),hi(null);try{for(var m,p=[];o!==null;){var d=o.assignedSlot||o.parentNode||o.host||null;try{var h=o["__"+i];if(h!=null&&(!o.disabled||t.target===o))if(Ki(h)){var[v,...y]=h;v.apply(o,[t,...y])}else h.call(o,t)}catch(S){m?p.push(S):m=S}if(t.cancelBubble||d===e||d===null)break;o=d}if(m){for(let S of p)queueMicrotask(()=>{throw S});throw m}}finally{t.__root=e,delete t.currentTarget,li(c),hi(f)}}}var mW;function iM(){mW=void 0}function tp(t){var e=document.createElement("template");return e.innerHTML=t.replaceAll("<!>","<!---->"),e.content}function qi(t,e){var r=Tt;r.nodes_start===null&&(r.nodes_start=t,r.nodes_end=e)}function ue(t,e){var r=(e&1)!==0,i=(e&2)!==0,n,o=!t.startsWith("<!>");return()=>{if(It)return qi(Xt,null),Xt;n===void 0&&(n=tp(o?t:"<!>"+t),r||(n=Sn(n)));var a=i||Vf?document.importNode(n,!0):n.cloneNode(!0);if(r){var s=Sn(a),l=a.lastChild;qi(s,l)}else qi(a,a);return a}}function hW(t,e,r="svg"){var i=!t.startsWith("<!>"),n=(e&1)!==0,o=`<${r}>${i?t:"<!>"+t}</${r}>`,a;return()=>{if(It)return qi(Xt,null),Xt;if(!a){var s=tp(o),l=Sn(s);if(n)for(a=document.createDocumentFragment();Sn(l);)a.appendChild(Sn(l));else a=Sn(l)}var u=a.cloneNode(!0);if(n){var c=Sn(u),f=u.lastChild;qi(c,f)}else qi(u,u);return u}}function Qd(t,e){return hW(t,e,"svg")}function Gt(t=""){if(!It){var e=Jn(t+"");return qi(e,e),e}var r=Xt;return r.nodeType!==nc&&(r.before(r=Jn()),pn(r)),qi(r,r),r}function Or(){if(It)return qi(Xt,null),Xt;var t=document.createDocumentFragment(),e=document.createComment(""),r=Jn();return t.append(e,r),qi(e,r),t}function ee(t,e){if(It){Tt.nodes_end=Xt,Di();return}t!==null&&t.before(e)}var T_=!0;function St(t,e){var r=e==null?"":typeof e=="object"?e+"":e;r!==(t.__t??=t.nodeValue)&&(t.__t=r,t.nodeValue=r+"")}function Fr(t,e){return sM(t,e)}function M_(t,e){Gd(),e.intro=e.intro??!1;let r=e.target,i=It,n=Xt;try{for(var o=Sn(r);o&&(o.nodeType!==Go||o.data!=="[");)o=di(o);if(!o)throw xs;Si(!0),pn(o),Di();let a=sM(t,{...e,anchor:o});if(Xt===null||Xt.nodeType!==Go||Xt.data!=="]")throw Yu(),xs;return Si(!1),a}catch(a){if(a instanceof Error&&a.message.split(`
`).some(s=>s.startsWith("https://svelte.dev/e/")))throw a;return a!==xs&&console.warn("Failed to hydrate: ",a),e.recover===!1&&cN(),Gd(),lc(r),Si(!1),Fr(t,e)}finally{Si(i),pn(n),iM()}}var pc=new Map;function sM(t,{target:e,anchor:r,props:i={},events:n,context:o,intro:a=!0}){Gd();var s=new Set,l=f=>{for(var m=0;m<f.length;m++){var p=f[m];if(!s.has(p)){s.add(p);var d=QN(p);e.addEventListener(p,fc,{passive:d});var h=pc.get(p);h===void 0?(document.addEventListener(p,fc,{passive:d}),pc.set(p,1)):pc.set(p,h+1)}}};l(kf(A_)),Kd.add(l);var u=void 0,c=ZN(()=>{var f=r??e.appendChild(Jn());return Hn(()=>{if(o){Ae({});var m=gr;m.c=o}n&&(i.$$events=n),It&&qi(f,null),T_=a,u=t(f,i)||{},T_=!0,It&&(Tt.nodes_end=Xt),o&&Te()}),()=>{for(var m of s){e.removeEventListener(m,fc);var p=pc.get(m);--p===0?(document.removeEventListener(m,fc),pc.delete(m)):pc.set(m,p)}Kd.delete(l),f!==r&&f.parentNode?.removeChild(f)}});return N_.set(u,c),u}var N_=new WeakMap;function Dr(t,e){let r=N_.get(t);return r?(N_.delete(t),r(e)):(Be&&SN(),Promise.resolve())}function ot(t,e,r=!1){It&&Di();var i=t,n=null,o=null,a=Xr,s=r?65536:0,l=!1;let u=(p,d=!0)=>{l=!0,m(d,p)};var c=null;function f(){c!==null&&(c.lastChild.remove(),i.before(c),c=null);var p=a?n:o,d=a?o:n;p&&ol(p),d&&Oa(d,()=>{a?o=null:n=null})}let m=(p,d)=>{if(a===(a=p))return;let h=!1;if(It){let w=Md(i)==="[!";!!a===w&&(i=Xu(),pn(i),Si(!1),h=!0)}var v=cc(),y=i;if(v&&(c=document.createDocumentFragment(),c.append(y=Jn())),a?n??=d&&Hn(()=>d(y)):o??=d&&Hn(()=>d(y)),v){var S=Sr,b=a?n:o,_=a?o:n;b&&S.skipped_effects.delete(b),_&&S.skipped_effects.add(_),S.add_callback(f)}else f();h&&Si(!0)};Li(()=>{l=!1,e(u),l||m(null,null)},s),It&&(i=Xt)}var rp=null;function Kt(t,e){return e}function bW(t,e,r){for(var i=t.items,n=[],o=e.length,a=0;a<o;a++)Yd(e[a].e,n,!0);var s=o>0&&n.length===0&&r!==null;if(s){var l=r.parentNode;lc(l),l.append(r),i.clear(),za(t,e[0].prev,e[o-1].next)}E_(n,()=>{for(var u=0;u<o;u++){var c=e[u];s||(i.delete(c.k),za(t,c.prev,c.next)),Yn(c.e,!s)}})}function Wt(t,e,r,i,n,o=null){var a=t,s={flags:e,items:new Map,first:null},l=(e&4)!==0;if(l){var u=t;a=It?pn(Sn(u)):u.appendChild(Jn())}It&&Di();var c=null,f=!1,m=new Map,p=Qu(()=>{var y=r();return Ki(y)?y:y==null?[]:kf(y)}),d,h;function v(){xW(h,d,s,m,a,n,e,i,r),o!==null&&(d.length===0?c?ol(c):c=Hn(()=>o(a)):c!==null&&Oa(c,()=>{c=null}))}Li(()=>{h??=Tt,d=U(p);var y=d.length;if(f&&y===0)return;f=y===0;let S=!1;if(It){var b=Md(a)==="[!";b!==(y===0)&&(a=Xu(),pn(a),Si(!1),S=!0)}if(It){for(var _=null,w,x=0;x<y;x++){if(Xt.nodeType===Go&&Xt.data==="]"){a=Xt,S=!0,Si(!1);break}var E=d[x],T=i(E,x);w=$_(Xt,s,_,null,E,T,x,n,e,r),s.items.set(T,w),_=w}y>0&&pn(Xu())}if(It)y===0&&o&&(c=Hn(()=>o(a)));else if(cc()){var D=new Set,M=Sr;for(x=0;x<y;x+=1){E=d[x],T=i(E,x);var C=s.items.get(T)??m.get(T);C?(e&3)!==0&&lM(C,E,x,e):(w=$_(null,s,null,null,E,T,x,n,e,r,!0),m.set(T,w)),D.add(T)}for(let[$,O]of s.items)D.has($)||M.skipped_effects.add(O.e);M.add_callback(v)}else v();S&&Si(!0),U(p)}),It&&(a=Xt)}function xW(t,e,r,i,n,o,a,s,l){var u=(a&8)!==0,c=(a&3)!==0,f=e.length,m=r.items,p=r.first,d=p,h,v=null,y,S=[],b=[],_,w,x,E;if(u)for(E=0;E<f;E+=1)_=e[E],w=s(_,E),x=m.get(w),x!==void 0&&(x.a?.measure(),(y??=new Set).add(x));for(E=0;E<f;E+=1){if(_=e[E],w=s(_,E),x=m.get(w),x===void 0){var T=i.get(w);if(T!==void 0){i.delete(w),m.set(w,T);var D=v?v.next:d;za(r,v,T),za(r,T,D),C_(T,D,n),v=T}else{var M=d?d.e.nodes_start:n;v=$_(M,r,v,v===null?r.first:v.next,_,w,E,o,a,l)}m.set(w,v),S=[],b=[],d=v.next;continue}if(c&&lM(x,_,E,a),(x.e.f&8192)!==0&&(ol(x.e),u&&(x.a?.unfix(),(y??=new Set).delete(x))),x!==d){if(h!==void 0&&h.has(x)){if(S.length<b.length){var C=b[0],$;v=C.prev;var O=S[0],R=S[S.length-1];for($=0;$<S.length;$+=1)C_(S[$],C,n);for($=0;$<b.length;$+=1)h.delete(b[$]);za(r,O.prev,R.next),za(r,v,O),za(r,R,C),d=C,v=R,E-=1,S=[],b=[]}else h.delete(x),C_(x,d,n),za(r,x.prev,x.next),za(r,x,v===null?r.first:v.next),za(r,v,x),v=x;continue}for(S=[],b=[];d!==null&&d.k!==w;)(d.e.f&8192)===0&&(h??=new Set).add(d),b.push(d),d=d.next;if(d===null)continue;x=d}S.push(x),v=x,d=x.next}if(d!==null||h!==void 0){for(var L=h===void 0?[]:kf(h);d!==null;)(d.e.f&8192)===0&&L.push(d),d=d.next;var k=L.length;if(k>0){var V=(a&4)!==0&&f===0?n:null;if(u){for(E=0;E<k;E+=1)L[E].a?.measure();for(E=0;E<k;E+=1)L[E].a?.fix()}bW(r,L,V)}}u&&Jo(()=>{if(y!==void 0)for(x of y)x.a?.apply()}),t.first=r.first&&r.first.e,t.last=v&&v.e;for(var J of i.values())Yn(J.e);i.clear()}function lM(t,e,r,i){(i&1)!==0&&Ba(t.v,e),(i&2)!==0?Ba(t.i,r):t.i=r}function $_(t,e,r,i,n,o,a,s,l,u,c){var f=rp,m=(l&1)!==0,p=(l&16)===0,d=m?p?nl(n,!1,!1):So(n):n,h=(l&2)===0?a:So(a);Be&&m&&(d.trace=()=>{var S=typeof h=="number"?a:h.v;u()[S]});var v={i:h,v:d,k:o,a:null,e:null,prev:r,next:i};rp=v;try{if(t===null){var y=document.createDocumentFragment();y.append(t=Jn())}return v.e=Hn(()=>s(t,d,h,u),It),v.e.prev=r&&r.e,v.e.next=i&&i.e,r===null?c||(e.first=v):(r.next=v,r.e.next=v.e),i!==null&&(i.prev=v,i.e.prev=v.e),v}finally{rp=f}}function C_(t,e,r){for(var i=t.next?t.next.e.nodes_start:r,n=e?e.e.nodes_start:r,o=t.e.nodes_start;o!==null&&o!==i;){var a=di(o);n.before(o),o=a}}function za(t,e,r){e===null?t.first=r:(e.next=r,e.e.next=r&&r.e),r!==null&&(r.prev=e,r.e.prev=e&&e.e)}function Ko(t,e,...r){var i=t,n=eo,o;Li(()=>{n!==(n=e())&&(o&&(Yn(o),o=null),Be&&n==null&&fN(),o=Hn(()=>n(i,...r)))},65536),It&&(i=Xt)}function fM(t){var e,r,i="";if(typeof t=="string"||typeof t=="number")i+=t;else if(typeof t=="object")if(Array.isArray(t)){var n=t.length;for(e=0;e<n;e++)t[e]&&(r=fM(t[e]))&&(i&&(i+=" "),i+=r)}else for(r in t)t[r]&&(i&&(i+=" "),i+=r);return i}function pM(){for(var t,e,r=0,i="",n=arguments.length;r<n;r++)(t=arguments[r])&&(e=fM(t))&&(i&&(i+=" "),i+=e);return i}function $s(t){return typeof t=="object"?pM(t):t??""}var mM=[...`
\r\f\xA0\v\uFEFF`];function hM(t,e,r){var i=t==null?"":""+t;if(e&&(i=i?i+" "+e:e),r){for(var n in r)if(r[n])i=i?i+" "+n:n;else if(i.length)for(var o=n.length,a=0;(a=i.indexOf(n,a))>=0;){var s=a+o;(a===0||mM.includes(i[a-1]))&&(s===i.length||mM.includes(i[s]))?i=(a===0?"":i.substring(0,a))+i.substring(s+1):a=s}}return i===""?null:i}function dM(t,e=!1){var r=e?" !important;":";",i="";for(var n in t){var o=t[n];o!=null&&o!==""&&(i+=" "+n+": "+o+r)}return i}function I_(t){return t[0]!=="-"||t[1]!=="-"?t.toLowerCase():t}function gM(t,e){if(e){var r="",i,n;if(Array.isArray(e)?(i=e[0],n=e[1]):i=e,t){t=String(t).replaceAll(/\s*\/\*.*?\*\/\s*/g,"").trim();var o=!1,a=0,s=!1,l=[];i&&l.push(...Object.keys(i).map(I_)),n&&l.push(...Object.keys(n).map(I_));var u=0,c=-1;let h=t.length;for(var f=0;f<h;f++){var m=t[f];if(s?m==="/"&&t[f-1]==="*"&&(s=!1):o?o===m&&(o=!1):m==="/"&&t[f+1]==="*"?s=!0:m==='"'||m==="'"?o=m:m==="("?a++:m===")"&&a--,!s&&o===!1&&a===0){if(m===":"&&c===-1)c=f;else if(m===";"||f===h-1){if(c!==-1){var p=I_(t.substring(u,c).trim());if(!l.includes(p)){m!==";"&&f++;var d=t.substring(u,f).trim();r+=" "+d+";"}}u=f+1,c=-1}}}}return i&&(r+=dM(i)),n&&(r+=dM(n,!0)),r=r.trim(),r===""?null:r}return t==null?null:String(t)}function zr(t,e,r,i,n,o){var a=t.__className;if(It||a!==r||a===void 0){var s=hM(r,i,o);(!It||s!==t.getAttribute("class"))&&(s==null?t.removeAttribute("class"):e?t.className=s:t.setAttribute("class",s)),t.__className=r}else if(o&&n!==o)for(var l in o){var u=!!o[l];(n==null||u!==!!n[l])&&t.classList.toggle(l,u)}return o}function F_(t,e={},r,i){for(var n in r){var o=r[n];e[n]!==o&&(r[n]==null?t.style.removeProperty(n):t.style.setProperty(n,o,i))}}function mc(t,e,r,i){var n=t.__style;if(It||n!==e){var o=gM(e,i);(!It||o!==t.getAttribute("style"))&&(o==null?t.removeAttribute("style"):t.style.cssText=o),t.__style=e}else i&&(Array.isArray(i)?(F_(t,r?.[0],i[0]),F_(t,r?.[1],i[1],"important")):F_(t,r,i));return i}function rh(t,e,r=!1){if(t.multiple){if(e==null)return;if(!Ki(e))return DN();for(var i of t.options)i.selected=e.includes(np(i));return}for(i of t.options){var n=np(i);if(x_(n,e)){i.selected=!0;return}}(!r||e!==void 0)&&(t.selectedIndex=-1)}function k_(t){var e=new MutationObserver(()=>{rh(t,t.__value)});e.observe(t,{childList:!0,subtree:!0,attributes:!0,attributeFilter:["value"]}),no(()=>{e.disconnect()})}function dc(t,e,r=e){var i=!0;Hd(t,"change",n=>{var o=n?"[selected]":":checked",a;if(t.multiple)a=[].map.call(t.querySelectorAll(o),np);else{var s=t.querySelector(o)??t.querySelector("option:not([disabled])");a=s&&np(s)}r(a)}),Ao(()=>{var n=e();if(rh(t,n,i),i&&n===void 0){var o=t.querySelector(":checked");o!==null&&(n=np(o),r(n))}t.__value=n,i=!1}),k_(t)}function np(t){return"__value"in t?t.__value:t.value}var EW=Symbol("class"),AW=Symbol("style"),TW=Symbol("is custom element"),NW=Symbol("is html");function Mt(t){if(It){var e=!1,r=()=>{if(!e){if(e=!0,t.hasAttribute("value")){var i=t.value;lt(t,"value",null),t.value=i}if(t.hasAttribute("checked")){var n=t.checked;lt(t,"checked",null),t.checked=n}}};t.__on_r=r,CN(r),Wd()}}function B_(t,e){var r=O_(t);r.value===(r.value=e??void 0)||t.value===e&&(e!==0||t.nodeName!=="PROGRESS")||(t.value=e??"")}function Is(t,e){var r=O_(t);r.checked!==(r.checked=e??void 0)&&(t.checked=e)}function lt(t,e,r,i){var n=O_(t);if(It&&(n[e]=t.getAttribute(e),e==="src"||e==="srcset"||e==="href"&&t.nodeName==="LINK")){i||CW(t,e,r??"");return}n[e]!==(n[e]=r)&&(e==="loading"&&(t[tN]=r),r==null?t.removeAttribute(e):typeof r!="string"&&MW(t).includes(e)?t[e]=r:t.setAttribute(e,r))}function O_(t){return t.__attributes??={[TW]:t.nodeName.includes("-"),[NW]:t.namespaceURI===bN}}var vM=new Map;function MW(t){var e=vM.get(t.nodeName);if(e)return e;vM.set(t.nodeName,e=[]);for(var r,i=t,n=Element.prototype;n!==i;){r=Qx(i);for(var o in r)r[o].set&&e.push(o);i=Gu(i)}return e}function CW(t,e,r){Be&&(e==="srcset"&&$W(t,r)||P_(t.getAttribute(e)??"",r)||wN(e,t.outerHTML.replace(t.innerHTML,t.innerHTML&&"..."),String(r)))}function P_(t,e){return t===e?!0:new URL(t,document.baseURI).href===new URL(e,document.baseURI).href}function yM(t){return t.split(",").map(e=>e.trim().split(" ").filter(Boolean))}function $W(t,e){var r=yM(t.srcset),i=yM(e);return i.length===r.length&&i.every(([n,o],a)=>o===r[a][1]&&(P_(r[a][0],n)||P_(n,r[a][0])))}function At(t,e,r=e){var i=Yo(),n=new WeakSet;Hd(t,"input",o=>{Be&&t.type==="checkbox"&&t_();var a=o?t.defaultValue:t.value;if(a=R_(t)?L_(a):a,r(a),Sr!==null&&n.add(Sr),i&&a!==(a=e())){var s=t.selectionStart,l=t.selectionEnd;t.value=a??"",l!==null&&(t.selectionStart=s,t.selectionEnd=Math.min(l,t.value.length))}}),(It&&t.defaultValue!==t.value||on(e)==null&&t.value)&&(r(R_(t)?L_(t.value):t.value),Sr!==null&&n.add(Sr)),Ei(()=>{Be&&t.type==="checkbox"&&t_();var o=e();if(t===document.activeElement){var a=Jf??Sr;if(n.has(a))return}R_(t)&&o===L_(t.value)||t.type==="date"&&!o&&!t.value||o!==t.value&&(t.value=o??"")})}function R_(t){var e=t.type;return e==="number"||e==="range"}function L_(t){return t===""?null:+t}function bM(t,e){return t===e||t?.[to]===e}function xa(t={},e,r,i){return Ao(()=>{var n,o;return Ei(()=>{n=o,o=i?.()||[],on(()=>{t!==r(...o)&&(e(t,...o),n&&bM(r(...n),t)&&e(null,...n))})}),()=>{Jo(()=>{o&&bM(r(...o),t)&&e(null,...o)})}}),t}var ih=!1,vwe=Symbol();function z_(t){var e=ih;try{return ih=!1,[t(),ih]}finally{ih=e}}var zW={get(t,e){if(!t.exclude.includes(e))return t.props[e]},set(t,e){return Be&&mN(`${t.name}.${String(e)}`),!1},getOwnPropertyDescriptor(t,e){if(!t.exclude.includes(e)&&e in t.props)return{enumerable:!0,configurable:!0,value:t.props[e]}},has(t,e){return t.exclude.includes(e)?!1:e in t.props},ownKeys(t){return Reflect.ownKeys(t.props).filter(e=>!t.exclude.includes(e))}};function nr(t,e,r){return new Proxy(Be?{props:t,exclude:e,name:r,other:{},to_proxy:[]}:{props:t,exclude:e},zW)}function pt(t,e,r,i){var n=!_s||(r&2)!==0,o=(r&8)!==0,a=(r&16)!==0,s=i,l=!0,u=()=>(l&&(l=!1,s=a?on(i):i),s),c;if(o){var f=to in t||Bf in t;c=Qi(t,e)?.set??(f&&e in t?b=>t[e]=b:void 0)}var m,p=!1;o?[m,p]=z_(()=>t[e]):m=t[e],m===void 0&&i!==void 0&&(m=u(),c&&(n&&pN(e),c(m)));var d;if(n?d=()=>{var b=t[e];return b===void 0?u():(l=!0,b)}:d=()=>{var b=t[e];return b!==void 0&&(s=void 0),b===void 0?s:b},n&&(r&4)===0)return d;if(c){var h=t.$$legacy;return function(b,_){return arguments.length>0?((!n||!_||h||p)&&c(_?d():b),b):d()}}var v=!1,y=((r&1)!==0?Ku:Qu)(()=>(v=!1,d()));Be&&(y.label=e),o&&U(y);var S=Tt;return function(b,_){if(arguments.length>0){let w=_?U(y):n&&o?wt(b):b;return Re(y,w),v=!0,s!==void 0&&(s=w),b}return va&&v||(S.f&16384)!==0?y.v:U(y)}}function xM(t){return new V_(t)}var V_=class{#t;#e;constructor(e){var r=new Map,i=(o,a)=>{var s=nl(a,!1,!1);return r.set(o,s),s};let n=new Proxy({...e.props||{},$$events:{}},{get(o,a){return U(r.get(a)??i(a,Reflect.get(o,a)))},has(o,a){return a===Bf?!0:(U(r.get(a)??i(a,Reflect.get(o,a))),Reflect.has(o,a))},set(o,a,s){return Re(r.get(a)??i(a,s),s),Reflect.set(o,a,s)}});this.#e=(e.hydrate?M_:Fr)(e.component,{target:e.target,anchor:e.anchor,props:n,context:e.context,intro:e.intro??!1,recover:e.recover}),!ha&&(!e?.props?.$$host||e.sync===!1)&&sc(),this.#t=n.$$events;for(let o of Object.keys(this.#e))o==="$set"||o==="$destroy"||o==="$on"||xi(this,o,{get(){return this.#e[o]},set(a){this.#e[o]=a},enumerable:!0});this.#e.$set=o=>{Object.assign(n,o)},this.#e.$destroy=()=>{Dr(this.#e)}}$set(e){this.#e.$set(e)}$on(e,r){this.#t[e]=this.#t[e]||[];let i=(...n)=>r.call(this,...n);return this.#t[e].push(i),()=>{this.#t[e]=this.#t[e].filter(n=>n!==i)}}$destroy(){this.#e.$destroy()}};var HW;typeof HTMLElement=="function"&&(HW=class extends HTMLElement{$$ctor;$$s;$$c;$$cn=!1;$$d={};$$r=!1;$$p_d={};$$l={};$$l_u=new Map;$$me;constructor(t,e,r){super(),this.$$ctor=t,this.$$s=e,r&&this.attachShadow({mode:"open"})}addEventListener(t,e,r){if(this.$$l[t]=this.$$l[t]||[],this.$$l[t].push(e),this.$$c){let i=this.$$c.$on(t,e);this.$$l_u.set(e,i)}super.addEventListener(t,e,r)}removeEventListener(t,e,r){if(super.removeEventListener(t,e,r),this.$$c){let i=this.$$l_u.get(e);i&&(i(),this.$$l_u.delete(e))}}async connectedCallback(){if(this.$$cn=!0,!this.$$c){let t=function(i){return n=>{let o=document.createElement("slot");i!=="default"&&(o.name=i),ee(n,o)}};if(await Promise.resolve(),!this.$$cn||this.$$c)return;let e={},r=YW(this);for(let i of this.$$s)i in r&&(i==="default"&&!this.$$d.children?(this.$$d.children=t(i),e.default=!0):e[i]=t(i));for(let i of this.attributes){let n=this.$$g_p(i.name);n in this.$$d||(this.$$d[n]=q_(n,i.value,this.$$p_d,"toProp"))}for(let i in this.$$p_d)!(i in this.$$d)&&this[i]!==void 0&&(this.$$d[i]=this[i],delete this[i]);this.$$c=xM({component:this.$$ctor,target:this.shadowRoot||this,props:{...this.$$d,$$slots:e,$$host:this}}),this.$$me=w_(()=>{Ei(()=>{this.$$r=!0;for(let i of Kx(this.$$c)){if(!this.$$p_d[i]?.reflect)continue;this.$$d[i]=this.$$c[i];let n=q_(i,this.$$d[i],this.$$p_d,"toAttribute");n==null?this.removeAttribute(this.$$p_d[i].attribute||i):this.setAttribute(this.$$p_d[i].attribute||i,n)}this.$$r=!1})});for(let i in this.$$l)for(let n of this.$$l[i]){let o=this.$$c.$on(i,n);this.$$l_u.set(n,o)}this.$$l={}}}attributeChangedCallback(t,e,r){this.$$r||(t=this.$$g_p(t),this.$$d[t]=q_(t,r,this.$$p_d,"toProp"),this.$$c?.$set({[t]:this.$$d[t]}))}disconnectedCallback(){this.$$cn=!1,Promise.resolve().then(()=>{!this.$$cn&&this.$$c&&(this.$$c.$destroy(),this.$$me(),this.$$c=void 0)})}$$g_p(t){return Kx(this.$$p_d).find(e=>this.$$p_d[e].attribute===t||!this.$$p_d[e].attribute&&e.toLowerCase()===t)||t}});function q_(t,e,r,i){let n=r[t]?.type;if(e=n==="Boolean"&&typeof e!="boolean"?e!=null:e,!i||!r[t])return e;if(i==="toAttribute")switch(n){case"Object":case"Array":return e==null?null:JSON.stringify(e);case"Boolean":return e?"":null;case"Number":return e??null;default:return e}else switch(n){case"Object":case"Array":return e&&JSON.parse(e);case"Boolean":return e;case"Number":return e!=null?+e:e;default:return e}}function YW(t){let e={};return t.childNodes.forEach(r=>{e[r.slot||"default"]=!0}),e}if(Be){let t=function(e){if(!(e in globalThis)){let r;Object.defineProperty(globalThis,e,{configurable:!0,get:()=>{if(r!==void 0)return r;dN(e)},set:i=>{r=i}})}};t("$state"),t("$effect"),t("$derived"),t("$inspect"),t("$props"),t("$bindable")}function j_(t){gr===null&&Of("onMount"),_s&&gr.l!==null?XW(gr).m.push(t):io(()=>{let e=on(t);if(typeof e=="function")return e})}function hc(t){gr===null&&Of("onDestroy"),j_(()=>()=>on(t))}function XW(t){var e=t.l;return e.u??={a:[],b:[],m:[]}}var oh=class{mb;svelteComponent;svelteComponentInstance;mounted;onValueChange;constructor(e,r,i){this.mb=e,this.mounted=!1,this.svelteComponent=r,this.onValueChange=i}setValue(e){this.svelteComponentInstance?.setValue(e)}getInstance(){return this.svelteComponentInstance}mount(e,r,i={}){let n=Object.assign({mb:this.mb,value:r,onValueChange:this.onValueChange},i);this.svelteComponentInstance=Fr(this.svelteComponent,{target:e,props:n}),this.mounted=!0}unmount(){this.svelteComponentInstance&&Dr(this.svelteComponentInstance),this.mounted=!1}isMounted(){return this.mounted}};var Ti=class{mounted;targetEl;onUnmountCbs;constructor(){this.mounted=!1,this.targetEl=void 0,this.onUnmountCbs=[]}isMounted(){return this.mounted}getTargetEl(){return this.targetEl}mount(e){if(this.mounted||this.targetEl){console.warn("Mountable is already mounted",this);return}if(e===void 0){console.error("Mountable target element is undefined",this);return}this.mounted=!0,this.targetEl=e,this.onMount(e)}unmount(){if(!this.mounted||!this.targetEl){console.warn("Mountable is not mounted",this);return}this.mounted=!1,this.onUnmount(this.targetEl);for(let e of this.onUnmountCbs)e();this.targetEl=void 0}registerUnmountCb(e){this.onUnmountCbs.push(e)}};var ah=class{listeners;constructor(){this.listeners=[]}registerListener(e){let r=e;return r.uuid=_r(),this.listeners.push(r),r}unregisterListener(e){this.unregisterListenerById(e.uuid)}unregisterListenerById(e){this.listeners=this.listeners.filter(r=>r.uuid!==e)}unregisterAllListeners(){this.listeners=[]}notifyListeners(e){for(let r of this.listeners)try{r.callback(e)}catch(i){let n=i instanceof Error?i:String(i);console.error(new jt({errorLevel:"ERROR",effect:"error while calling listener callback",cause:n}))}}},bn=class extends ah{value;constructor(e){super(),this.value=e}get(){return this.value}set(e){this.value=e,this.notifyListeners(e)}},sh=class extends ah{value;mapFn;constructor(e,r){super(),this.value=r(e),this.mapFn=r}get(){return this.value}set(e){this.value=this.mapFn(e),this.notifyListeners(this.value)}setDirect(e){this.value=e,this.notifyListeners(e)}};var or=class extends Ti{mb;mountable;svelteWrapper;inputSignal;metadataSubscription;mountTarget;constructor(e){super(),this.mountable=e,this.mb=e.mb}reverseMapValue(e){let r=this.rawReverseMapValue(e);if(r!==void 0)return r;let i=this.rawReverseMapValue(this.getDefaultValue());return i!==void 0?i:this.getFallbackDefaultValue()}mapValue(e){return this.rawMapValue(e)}getValue(){return this.inputSignal?this.inputSignal.get():this.getDefaultValue()}getInternalValue(){return this.reverseMapValue(this.getValue())}setValue(e){this.inputSignal?.setDirect(e),this.notifySubscription(e)}setInternalValue(e){this.setValue(this.mapValue(e))}notifySubscription(e){this.metadataSubscription?.write(e)}getDefaultValue(){let e=this.mountable.getArgument("defaultValue");if(e===void 0)return this.mapValue(this.getFallbackDefaultValue());let r=this.filterValue(e.value);return r!==void 0?r:this.mapValue(this.getFallbackDefaultValue())}updateDataAttributes(e){this.mountTarget&&(this.mountTarget.dataset.internalValue=JSON.stringify(e))}getMountArgs(){return{}}onMount(e){this.mountTarget=e,this.svelteWrapper=new oh(this.mb,this.getSvelteComponent(),i=>{this.updateDataAttributes(i),this.notifySubscription(this.mapValue(i))}),this.inputSignal=new sh(void 0,i=>{let n=this.filterValue(i);return n!==void 0?n:this.getDefaultValue()}),this.inputSignal.registerListener({callback:i=>this.svelteWrapper?.setValue(this.reverseMapValue(i))}),this.inputSignal.registerListener({callback:i=>{this.updateDataAttributes(this.reverseMapValue(i))}}),this.updateDataAttributes(this.getInternalValue());let r=this.mountable.getBindTarget();r&&(this.metadataSubscription=this.mountable.mb.metadataManager.subscribe(this.mountable.getUuid(),this.inputSignal,r,()=>this.mountable.unmount())),this.svelteWrapper.mount(e,this.reverseMapValue(this.getValue()),this.getMountArgs())}onUnmount(){this.mountTarget=void 0,this.inputSignal?.unregisterAllListeners(),this.metadataSubscription?.unsubscribe(),this.svelteWrapper?.unmount()}};typeof window<"u"&&((window.__svelte??={}).v??=new Set).add("5");var QW=(t,e,r,i)=>r.onValueChange(bt(U(i))),eH=ue('<input type="date"/>');function Z_(t,e){Ae(e,!0);let r=nr(e,["$$slots","$$events","$$legacy"]),i=ft(wt(e.value));function n(a){Re(i,a,!0)}var o=eH();return Mt(o),o.__input=[QW,r,e,i],At(o,()=>U(i),a=>Re(i,a)),ee(t,o),Te({setValue:n})}Ft(["input"]);var W_=Ar(ip()),fi=class t{static dateFormat;static stringify(e){return e.format(this.dateFormat)}static parse(e){return(0,W_.default)(e,t.dateFormat)}static getDefaultDate(){return(0,W_.default)(new Date)}static getDefaultDay(){return new Date().getDate()}static getDefaultMonth(){return 1}static getDefaultYear(){return new Date().getFullYear()}};var uh=class extends or{filterValue(e){return Ia(e)}getFallbackDefaultValue(){return fi.stringify(fi.getDefaultDate())}getSvelteComponent(){return Z_}rawMapValue(e){return e}rawReverseMapValue(e){return e}};var tH=ue('<div class="mb-icon-wrapper"></div>');function Rr(t,e){Ae(e,!0);let r=pt(e,"iconName",3,""),i=ft(void 0);io(()=>U(i)?e.mb.internal.setIcon(U(i),r()):void 0);var n=Or(),o=je(n);{var a=s=>{var l=tH();xa(l,u=>Re(i,u),()=>U(i)),ee(s,l)};ot(o,s=>{r().length>0&&s(a)})}ee(t,n),Te()}function rH(t,e,r){r.showDatePicker()}function nH(t,e,r){t.key===" "&&r.showDatePicker()}var iH=ue('<div class="mb-date-picker-input" role="button" tabindex="0"><span class="mb-date-picker-text"> </span> <!></div>');function H_(t,e){Ae(e,!0);let r=nr(e,["$$slots","$$events","$$legacy"]),i=ft(wt(e.value));function n(u){Re(i,u,!0)}var o=iH();o.__click=[rH,r,e],o.__keydown=[nH,r,e];var a=he(o),s=he(a,!0);pe(a);var l=fe(a,2);return Rr(l,{get mb(){return e.mb},iconName:"calendar"}),pe(o),ze(u=>St(s,u),[()=>U(i)?U(i).format(e.dateFormat):"none"]),ee(t,o),Te({setValue:n})}Ft(["click","keydown"]);var lh=class extends or{options;constructor(e){super(e),this.options=this.mountable.getArguments("option")}filterValue(e){if(e===null)return null;if(e===void 0||typeof e!="string")return;let r=fi.parse(e);if(r.isValid())return fi.stringify(r)}getFallbackDefaultValue(){return fi.getDefaultDate()}getSvelteComponent(){return H_}rawMapValue(e){return e===null?null:(console.log("value",e,fi.stringify(e),fi.dateFormat),fi.stringify(e))}rawReverseMapValue(e){if(e===null)return null;let r=fi.parse(e);if(r.isValid())return r}getMountArgs(){return{dateFormat:this.mountable.mb.getSettings().preferredDateFormat,showDatePicker:()=>{this.mountable.mb.internal.openDatePickerModal(this.getInternalValue(),e=>this.setInternalValue(e))}}}};var oH=(t,e,r,i)=>r.onValueChange(bt(U(i))),aH=ue('<input type="datetime-local"/>');function Y_(t,e){Ae(e,!0);let r=nr(e,["$$slots","$$events","$$legacy"]),i=ft(wt(e.value));function n(a){Re(i,a,!0)}var o=aH();return Mt(o),o.__input=[oH,r,e,i],At(o,()=>U(i),a=>Re(i,a)),ee(t,o),Te({setValue:n})}Ft(["input"]);var ch=class extends or{filterValue(e){return Ia(e)}getFallbackDefaultValue(){return fi.stringify(fi.getDefaultDate())}getSvelteComponent(){return Y_}rawMapValue(e){return e}rawReverseMapValue(e){return e}};var sH=ue("<div></div>");function J_(t,e){Ae(e,!0);let r,i;hc(()=>{i?.()});async function n(a){i?.(),ht.empty(r),i=await e.mb.internal.renderMarkdown(a,r,e.filePath)}io(()=>void n(e.value));var o=sH();xa(o,a=>r=a,()=>r),ee(t,o),Te()}var uH=(t,e)=>e(),lH=(t,e)=>e(),cH=(t,e,r,i)=>r.onValueChange(bt(U(i))),fH=ue("<textarea></textarea>"),pH=ue('<div class="mb-editor-input card" role="button" tabindex="0"><!></div>');function X_(t,e){Ae(e,!0);let r=nr(e,["$$slots","$$events","$$legacy"]),i=ft(wt(e.value)),n=ft(!1);function o(p){Re(i,p,!0)}function a(){Re(n,!1)}function s(){Re(n,!0)}function l(p){p.key===" "&&s()}var u=pH();u.__click=[uH,s];var c=he(u);{var f=p=>{var d=fH();Cn(d),d.__focusout=[lH,a],d.__input=[cH,r,e,i],At(d,()=>U(i),h=>Re(i,h)),ee(p,d)},m=p=>{J_(p,{get value(){return U(i)},get mb(){return e.mb},get filePath(){return e.filePath}})};ot(c,p=>{U(n)?p(f):p(m,!1)})}return pe(u),Ai("keypress",u,p=>l(p)),ee(t,u),Te({setValue:o})}Ft(["click","focusout","input"]);var fh=class extends or{mdUnloadCallback;filterValue(e){return au(e)?e?.toString():void 0}getFallbackDefaultValue(){return""}getSvelteComponent(){return X_}rawReverseMapValue(e){return e}rawMapValue(e){return e}getMountArgs(){return{render:(e,r)=>void this.renderInElement(e,r),filePath:this.mountable.getFilePath()}}async renderInElement(e,r){this.mdUnloadCallback?.(),e.innerHTML="",this.mdUnloadCallback=await this.mountable.mb.internal.renderMarkdown(r,e,this.mountable.getFilePath())}onUnmount(){super.onUnmount(),this.mdUnloadCallback?.()}};var mH=ue("<button><!></button>");function Dt(t,e){Ae(e,!0);let r=pt(e,"variant",19,()=>"default"),i=pt(e,"disabled",3,!1),n=pt(e,"tooltip",3,""),o=pt(e,"classes",3,""),a=pt(e,"onclick",3,()=>{});var s=mH();let l;s.__click=function(...c){a()?.apply(this,c)};var u=he(s);Ko(u,()=>e.children),pe(s),ze(c=>{l=zr(s,1,`mb-button-inner ${o()??""}`,null,l,c),lt(s,"aria-label",n()),s.disabled=i()},[()=>({"mod-cta":r()==="primary","mod-warning":r()==="destructive","mod-plain":r()==="plain",disabled:i()})]),ee(t,s),Te()}Ft(["click"]);var dH=ue('<div class="mb-image-card" role="listitem"><img class="mb-image-card-image"/></div>'),hH=ue('<div class="mb-image-card-grid"></div> <div class="mb-list-input"><!></div>',1);function K_(t,e){Ae(e,!0);let r=nr(e,["$$slots","$$events","$$legacy"]),i=ft(wt(e.value));function n(m){Re(i,m,!0)}function o(m){U(i).push(m),e.onValueChange(bt(U(i)))}function a(m){U(i).splice(m,1),e.onValueChange(bt(U(i)))}function s(m,p){let d=[];p>0&&d.push({name:"Move left",icon:"arrow-left",onclick:()=>{let h=U(i)[p-1];U(i)[p-1]=U(i)[p],U(i)[p]=h,e.onValueChange(bt(U(i)))}}),p<U(i).length-1&&d.push({name:"Move right",icon:"arrow-right",onclick:()=>{let h=U(i)[p+1];U(i)[p+1]=U(i)[p],U(i)[p]=h,e.onValueChange(bt(U(i)))}}),d.push({name:"Copy image path",icon:"copy",onclick:()=>{let h=U(i)[p];navigator.clipboard.writeText(h).then(()=>{e.mb.internal.showNotice("Image path copied to clipboard")}).catch(()=>{e.mb.internal.showNotice("Failed to copy image path to clipboard")})}}),d.push({name:"Remove",icon:"x",warning:!0,onclick:()=>a(p)}),e.mb.internal.createContextMenu(d).showWithEvent(m)}var l=hH(),u=je(l);Wt(u,21,()=>U(i),Kt,(m,p,d)=>{var h=dH();h.__contextmenu=y=>s(y,d);var v=he(h);pe(h),ze((y,S)=>{lt(h,"data-value",y),lt(v,"src",S),lt(v,"alt",U(p)),lt(v,"aria-label",U(p))},[()=>yn(U(p)),()=>e.mb.internal.imagePathToUri(U(p))]),ee(m,h)}),pe(u);var c=fe(u,2),f=he(c);return Dt(f,{get variant(){return"default"},onclick:()=>e.showSuggester(),children:(m,p)=>{Nt();var d=Gt("Add new image");ee(m,d)},$$slots:{default:!0}}),pe(c),ee(t,l),Te({setValue:n,pushValue:o})}Ft(["contextmenu"]);var ph=class extends or{filterValue(e){return Zo(e)}getFallbackDefaultValue(){return[]}getSvelteComponent(){return K_}rawMapValue(e){return e}rawReverseMapValue(e){return e.map(r=>yn(r)).filter(r=>r!==void 0)}getMountArgs(){return{showSuggester:()=>this.openModal()}}openModal(){this.mountable.mb.internal.openImageSuggesterModal(this,!1,e=>{e!==void 0&&this.svelteWrapper?.getInstance()?.pushValue(e)})}};var gH=(t,e)=>e(t),vH=ue('<div class="mb-image-card"><img class="mb-image-card-image"/> <!></div>'),yH=ue('<div class="mb-image-empty"><!></div>');function Q_(t,e){Ae(e,!0);let r=nr(e,["$$slots","$$events","$$legacy"]),i=ft(wt(e.value));function n(c){Re(i,c,!0)}function o(c){let f=[];f.push({name:"Edit",icon:"pencil",onclick:()=>{e.showSuggester()}}),f.push({name:"Remove",icon:"x",warning:!0,onclick:()=>e.clear()}),e.mb.internal.createContextMenu(f).showWithEvent(c)}var a=Or(),s=je(a);{var l=c=>{var f=vH();f.__contextmenu=[gH,o];var m=he(f),p=fe(m,2);Dt(p,{get variant(){return"plain"},onclick:d=>o(d),classes:"mb-image-card-button",children:(d,h)=>{Rr(d,{iconName:"ellipsis-vertical",get mb(){return e.mb}})},$$slots:{default:!0}}),pe(f),ze(d=>{lt(m,"src",d),lt(m,"alt",U(i)),lt(m,"aria-label",U(i))},[()=>e.mb.internal.imagePathToUri(U(i))]),ee(c,f)},u=c=>{var f=yH(),m=he(f);Dt(m,{get variant(){return"plain"},onclick:()=>e.showSuggester(),tooltip:"Select image",children:(p,d)=>{Nt();var h=Gt("No image selected. Click to select.");ee(p,h)},$$slots:{default:!0}}),pe(f),ee(c,f)};ot(s,c=>{U(i)?c(l):c(u,!1)})}return ee(t,a),Te({setValue:n})}Ft(["contextmenu"]);var mh=class extends or{filterValue(e){return au(e)?e:void 0}getFallbackDefaultValue(){}getSvelteComponent(){return Q_}rawMapValue(e){return e}rawReverseMapValue(e){return yn(e)}getMountArgs(){return{showSuggester:()=>this.openModal(),clear:()=>this.setInternalValue(void 0)}}openModal(){this.mountable.mb.internal.openImageSuggesterModal(this,!0,e=>this.setInternalValue(e))}};var bH=ue('<a target="_blank" rel="noopener"> </a>'),xH=ue('<a target="_blank" rel="noopener"> </a>');function Fs(t,e){Ae(e,!0);let r=fr(()=>e.mdLink.block?`${e.mdLink.target}#${e.mdLink.block}`:e.mdLink.target),i=fr(()=>e.mdLink.internal?"internal-link":"external-link");var n=Or(),o=je(n);{var a=l=>{var u=bH(),c=he(u,!0);pe(u),ze(()=>{lt(u,"data-href",U(r)),lt(u,"href",U(r)),zr(u,1,$s(U(i))),lt(u,"aria-label",U(r)),St(c,e.mdLink.alias)}),ee(l,u)},s=l=>{var u=xH(),c=he(u,!0);pe(u),ze(()=>{lt(u,"data-href",U(r)),lt(u,"href",U(r)),zr(u,1,$s(U(i))),St(c,U(r))}),ee(l,u)};ot(o,l=>{e.mdLink.alias?l(a):l(s,!1)})}ee(t,n),Te()}var _H=ue("<!><span>,</span> <span></span>",1),wH=ue("<!> <!>",1);function op(t,e){Ae(e,!0);let r=pt(e,"elements",19,()=>[]);var i=wH(),n=je(i);Wt(n,17,()=>r().slice(0,r().length-1),Kt,(a,s)=>{var l=_H(),u=je(l);Ko(u,()=>e.children,()=>U(s)),Nt(3),ee(a,l)});var o=fe(n,2);Ko(o,()=>e.children,()=>r()[r().length-1]),ee(t,i),Te()}var SH=ue('<span class="mb-whitespace-pre"> </span>'),DH=ue("<span> </span>"),EH=ue("<span><!></span>"),AH=ue("<span><!></span>");function No(t,e){Ae(e,!0);let r=pt(e,"value",3,void 0),i=fr(()=>XT(r(),!1));var n=Or(),o=je(n);{var a=l=>{var u=SH(),c=he(u,!0);pe(u),ze(()=>St(c,U(i))),ee(l,u)},s=l=>{var u=Or(),c=je(u);{var f=p=>{var d=EH(),h=he(d);op(h,{get elements(){return U(i)},children:(y,S=eo)=>{var b=Or(),_=je(b);{var w=E=>{var T=DH(),D=he(T,!0);pe(T),ze(()=>St(D,S())),ee(E,T)},x=E=>{Fs(E,{get mdLink(){return S()}})};ot(_,E=>{typeof S()=="string"?E(w):E(x,!1)})}ee(y,b)},$$slots:{default:!0}}),pe(d),ee(p,d)},m=p=>{var d=AH(),h=he(d);Fs(h,{get mdLink(){return U(i)}}),pe(d),ee(p,d)};ot(c,p=>{Array.isArray(U(i))?p(f):p(m,!1)},!0)}ee(l,u)};ot(o,l=>{typeof U(i)=="string"?l(a):l(s,!1)})}ee(t,n),Te()}function TH(t,e,r){t.key===" "&&r.showInput()}var NH=ue('<div class="mb-inline-list-item" role="listitem"><!></div>'),MH=(t,e,r)=>r.showInput(),CH=ue('<div class="mb-inline-list"><!> <div class="mb-inline-list-add" role="button" tabindex="0"><span>&#x200B;</span> <!></div></div>');function e0(t,e){Ae(e,!0);let r=nr(e,["$$slots","$$events","$$legacy"]),i=ft(wt(e.value));function n(m){Re(i,m,!0)}function o(m){U(i).push(m),e.onValueChange(bt(U(i)))}function a(m){U(i).splice(m,1),e.onValueChange(bt(U(i)))}function s(m,p){let d=[];p>0&&d.push({name:"Move left",icon:"arrow-left",onclick:()=>{let h=U(i)[p-1];U(i)[p-1]=U(i)[p],U(i)[p]=h,e.onValueChange(bt(U(i)))}}),p<U(i).length-1&&d.push({name:"Move right",icon:"arrow-right",onclick:()=>{let h=U(i)[p+1];U(i)[p+1]=U(i)[p],U(i)[p]=h,e.onValueChange(bt(U(i)))}}),d.push({name:"Edit",icon:"pencil",onclick:()=>{e.mb.internal.openTextPromptModal({title:"Meta Bind List",subTitle:"Edit the value of a list item.",value:yn(U(i)[p]),multiline:!1,onSubmit:h=>{U(i)[p]=h,e.onValueChange(bt(U(i)))},onCancel:()=>{}})}}),d.push({name:"Remove",icon:"x",warning:!0,onclick:()=>a(p)}),e.mb.internal.createContextMenu(d).showWithEvent(m)}var l=CH(),u=he(l);Wt(u,17,()=>U(i),Kt,(m,p,d)=>{var h=NH();h.__contextmenu=y=>s(y,d);var v=he(h);No(v,{get value(){return U(p)}}),pe(h),ze(y=>lt(h,"data-value",y),[()=>yn(U(p))]),ee(m,h)});var c=fe(u,2);c.__click=[MH,r,e],c.__keydown=[TH,r,e];var f=fe(he(c),2);return Rr(f,{get mb(){return e.mb},iconName:"plus"}),pe(c),pe(l),ee(t,l),Te({setValue:n,pushValue:o})}Ft(["contextmenu","click","keydown"]);var dh=class extends or{filterValue(e){return Zo(e)}getFallbackDefaultValue(){return[]}getSvelteComponent(){return e0}rawMapValue(e){return e}rawReverseMapValue(e){return e}getMountArgs(){return{showInput:()=>this.openModal()}}openModal(){this.mountable.mb.internal.openTextPromptModal({title:"Meta Bind List",subTitle:"Create a new List Element.",value:"",multiline:!1,onSubmit:e=>{this.svelteWrapper?.getInstance()?.pushValue(e)},onCancel:()=>{}})}};function $H(t,e,r){if(!r.allowOther){r.showSuggester();return}r.mb.internal.createContextMenu([{name:"From Options",onclick:()=>r.showSuggester()},{name:"From Text",onclick:()=>r.showTextPrompt()}]).showWithEvent(t)}function IH(t,e,r){t.key===" "&&r.showSuggester()}var FH=ue('<div class="mb-inline-list-item" role="listitem"><!></div>'),kH=ue('<div class="mb-inline-list"><!> <div class="mb-inline-list-add" role="button" tabindex="0"><span>&#x200B;</span> <!></div></div>');function t0(t,e){Ae(e,!0);let r=nr(e,["$$slots","$$events","$$legacy"]),i=ft(wt(e.value));function n(m){Re(i,m,!0)}function o(m){U(i).push(m),e.onValueChange(bt(U(i)))}function a(m){U(i).splice(m,1),e.onValueChange(bt(U(i)))}function s(m,p){let d=[];p>0&&d.push({name:"Move left",icon:"arrow-left",onclick:()=>{let h=U(i)[p-1];U(i)[p-1]=U(i)[p],U(i)[p]=h,e.onValueChange(bt(U(i)))}}),p<U(i).length-1&&d.push({name:"Move right",icon:"arrow-right",onclick:()=>{let h=U(i)[p+1];U(i)[p+1]=U(i)[p],U(i)[p]=h,e.onValueChange(bt(U(i)))}}),d.push({name:"Remove",icon:"x",warning:!0,onclick:()=>a(p)}),e.mb.internal.createContextMenu(d).showWithEvent(m)}var l=kH(),u=he(l);Wt(u,17,()=>U(i),Kt,(m,p,d)=>{var h=FH();h.__contextmenu=y=>s(y,d);var v=he(h);No(v,{get value(){return U(p)}}),pe(h),ze(y=>lt(h,"data-value",y),[()=>yn(U(p))]),ee(m,h)});var c=fe(u,2);c.__click=[$H,r,e],c.__keydown=[IH,r,e];var f=fe(he(c),2);return Rr(f,{get mb(){return e.mb},iconName:"plus"}),pe(c),pe(l),ee(t,l),Te({setValue:n,pushValue:o})}Ft(["contextmenu","click","keydown"]);var hh=class extends or{filterValue(e){return Zo(e)}getFallbackDefaultValue(){return[]}getSvelteComponent(){return t0}rawMapValue(e){return e}rawReverseMapValue(e){return e}getMountArgs(){return{showSuggester:()=>this.openModal(),showTextPrompt:()=>this.openTextModal(),allowOther:this.mountable.getArgument("allowOther")?.value===!0}}openModal(){this.mountable.mb.internal.openSuggesterModal(this,e=>{this.svelteWrapper?.getInstance()?.pushValue(e.value)})}openTextModal(){this.mountable.mb.internal.openTextPromptModal({title:"Meta Bind List Suggester",subTitle:"Create a new List Element.",value:"",multiline:!1,onSubmit:e=>{this.svelteWrapper?.getInstance()?.pushValue(e)},onCancel:()=>{}})}};var PH=(t,e)=>e(),BH=ue("<option> </option>"),OH=ue('<select class="dropdown"></select>');function r0(t,e){Ae(e,!0);let r=nr(e,["$$slots","$$events","$$legacy"]),i=ft(wt(e.value));function n(s){Re(i,s,!0)}function o(){e.onValueChange(bt(U(i)))}var a=OH();return a.__change=[PH,o],Wt(a,21,()=>e.options,Kt,(s,l)=>{var u=BH(),c=he(u,!0);pe(u);var f={};ze(()=>{St(c,U(l).name),f!==(f=U(l).value)&&(u.value=(u.__value=U(l).value)??"")}),ee(s,u)}),pe(a),dc(a,()=>U(i),s=>Re(i,s)),ee(t,a),Te({setValue:n})}Ft(["change"]);var gh=class extends or{options;constructor(e){super(e),this.options=this.mountable.getArguments("option")}filterValue(e){return su(e)}getFallbackDefaultValue(){return null}getSvelteComponent(){return r0}rawMapValue(e){return e}rawReverseMapValue(e){return e}getMountArgs(){return{options:this.options}}};var RH=ue('<div class="mb-list-item" role="listitem"><!></div>'),LH=ue('<span class="mb-list-empty">Empty</span>'),UH=ue('<textarea tabindex="0"></textarea>'),zH=(t,e,r)=>{t.key==="Enter"&&U(e).length>0&&r()},VH=ue('<input type="text" tabindex="0"/>'),qH=ue("<span> </span>"),jH=ue('<div class="mb-list-items"></div> <div class="mb-list-input"><!> <!> <!></div>',1);function n0(t,e){Ae(e,!0);let r=nr(e,["$$slots","$$events","$$legacy"]),i=ft(wt(e.value)),n=ft("");function o(b){Re(i,b,!0)}function a(){U(i).push(U(n)),e.onValueChange(bt(U(i))),Re(n,"")}function s(b){U(i).splice(b,1),e.onValueChange(bt(U(i)))}function l(b,_){let w=_.toString();return`${b.toString().padStart(w.length,"0")}/${w}`}function u(b,_){let w=[];_>0&&w.push({name:"Move up",icon:"arrow-up",onclick:()=>{let x=U(i)[_-1];U(i)[_-1]=U(i)[_],U(i)[_]=x,e.onValueChange(bt(U(i)))}}),_<U(i).length-1&&w.push({name:"Move down",icon:"arrow-down",onclick:()=>{let x=U(i)[_+1];U(i)[_+1]=U(i)[_],U(i)[_]=x,e.onValueChange(bt(U(i)))}}),w.push({name:"Edit",icon:"pencil",onclick:()=>{e.mb.internal.openTextPromptModal({title:"Meta Bind List",subTitle:"Edit the value of a list item.",value:yn(U(i)[_]),multiline:e.multiLine,onSubmit:x=>{U(i)[_]=x,e.onValueChange(bt(U(i)))},onCancel:()=>{}})}}),w.push({name:"Remove",icon:"x",warning:!0,onclick:()=>s(_)}),e.mb.internal.createContextMenu(w).showWithEvent(b)}var c=jH(),f=je(c);Wt(f,21,()=>U(i),Kt,(b,_,w)=>{var x=RH();x.__contextmenu=T=>u(T,w);var E=he(x);No(E,{get value(){return U(_)}}),pe(x),ze(T=>lt(x,"data-value",T),[()=>yn(U(_))]),ee(b,x)},b=>{var _=LH();ee(b,_)}),pe(f);var m=fe(f,2),p=he(m);{var d=b=>{var _=UH();Cn(_),ze(()=>{lt(_,"placeholder",e.placeholder),lt(_,"maxlength",e.limit)}),At(_,()=>U(n),w=>Re(n,w)),ee(b,_)},h=b=>{var _=VH();Mt(_),_.__keyup=[zH,n,a],ze(()=>{lt(_,"placeholder",e.placeholder),lt(_,"maxlength",e.limit)}),At(_,()=>U(n),w=>Re(n,w)),ee(b,_)};ot(p,b=>{e.multiLine?b(d):b(h,!1)})}var v=fe(p,2);{var y=b=>{var _=qH(),w=he(_,!0);pe(_),ze(x=>{zr(_,1,`mb-content-limit-indicator ${U(i).length>e.limit?"mb-content-limit-indicator-overflow":""}`),St(w,x)},[()=>l(U(i).length,e.limit)]),ee(b,_)};ot(v,b=>{e.limit!==void 0&&b(y)})}var S=fe(v,2);{let b=fr(()=>!U(n));Dt(S,{onclick:()=>a(),get disabled(){return U(b)},children:(_,w)=>{Rr(_,{get mb(){return e.mb},iconName:"plus"})},$$slots:{default:!0}})}return pe(m),ee(t,c),Te({setValue:o})}Ft(["contextmenu","keyup"]);var vh=class extends or{filterValue(e){return Zo(e)}getFallbackDefaultValue(){return[]}getSvelteComponent(){return n0}rawMapValue(e){return e}rawReverseMapValue(e){return e}getMountArgs(){return{placeholder:this.mountable.getArgument("placeholder")?.value??"New Entry...",limit:this.mountable.getArgument("limit")?.value,multiLine:this.mountable.getArgument("multiLine")?.value===!0}}};var ZH=ue('<div class="mb-list-item" role="listitem"><!></div>'),GH=ue('<span class="mb-list-empty">Empty</span>'),WH=ue('<div class="mb-list-items"></div> <div class="mb-list-input"><!> <!></div>',1);function i0(t,e){Ae(e,!0);let r=nr(e,["$$slots","$$events","$$legacy"]),i=ft(wt(e.value));function n(d){Re(i,d,!0)}function o(d){U(i).push(d),e.onValueChange(bt(U(i)))}function a(d){U(i).splice(d,1),e.onValueChange(bt(U(i)))}function s(d,h){let v=[];h>0&&v.push({name:"Move up",icon:"arrow-up",onclick:()=>{let y=U(i)[h-1];U(i)[h-1]=U(i)[h],U(i)[h]=y,e.onValueChange(bt(U(i)))}}),h<U(i).length-1&&v.push({name:"Move down",icon:"arrow-down",onclick:()=>{let y=U(i)[h+1];U(i)[h+1]=U(i)[h],U(i)[h]=y,e.onValueChange(bt(U(i)))}}),v.push({name:"Remove",icon:"x",warning:!0,onclick:()=>a(h)}),e.mb.internal.createContextMenu(v).showWithEvent(d)}var l=WH(),u=je(l);Wt(u,21,()=>U(i),Kt,(d,h,v)=>{var y=ZH();y.__contextmenu=b=>s(b,v);var S=he(y);No(S,{get value(){return U(h)}}),pe(y),ze(b=>lt(y,"data-value",b),[()=>yn(U(h))]),ee(d,y)},d=>{var h=GH();ee(d,h)}),pe(u);var c=fe(u,2),f=he(c);Dt(f,{get variant(){return"default"},onclick:()=>e.showSuggester(),children:(d,h)=>{Nt();var v=Gt("Add new item");ee(d,v)},$$slots:{default:!0}});var m=fe(f,2);{var p=d=>{Dt(d,{get variant(){return"default"},onclick:()=>e.showTextPrompt(),children:(h,v)=>{Nt();var y=Gt("Add other item");ee(h,y)},$$slots:{default:!0}})};ot(m,d=>{e.allowOther&&d(p)})}return pe(c),ee(t,l),Te({setValue:n,pushValue:o})}Ft(["contextmenu"]);var yh=class extends or{filterValue(e){return Zo(e)}getFallbackDefaultValue(){return[]}getSvelteComponent(){return i0}rawMapValue(e){return e}rawReverseMapValue(e){return e}getMountArgs(){return{showSuggester:()=>this.openModal(),showTextPrompt:()=>this.openTextModal(),allowOther:this.mountable.getArgument("allowOther")?.value===!0}}openModal(){this.mountable.mb.internal.openSuggesterModal(this,e=>{this.svelteWrapper?.getInstance()?.pushValue(e.value)})}openTextModal(){this.mountable.mb.internal.openTextPromptModal({title:"Meta Bind List Suggester",subTitle:"Create a new List Element.",value:"",multiline:!1,onSubmit:e=>{this.svelteWrapper?.getInstance()?.pushValue(e)},onCancel:()=>{}})}};var HH=(t,e,r)=>{t.target instanceof HTMLInputElement||e(U(r).value)},YH=(t,e,r)=>e(U(r).value),JH=ue('<div role="button" tabindex="0"><input type="checkbox"/> <!></div>');function o0(t,e){Ae(e,!0);let r=nr(e,["$$slots","$$events","$$legacy"]),i=ft(wt(e.value));function n(u){Re(i,u,!0)}function o(u){U(i).includes(u)?Re(i,U(i).filter(c=>c!==u),!0):U(i).push(u),e.onValueChange(bt(U(i)))}function a(u,c){u.key===" "&&o(c)}var s=Or(),l=je(s);return Wt(l,17,()=>e.options,Kt,(u,c)=>{var f=JH();let m;f.__click=[HH,o,c];var p=he(f);Mt(p),p.__input=[YH,o,c];var d=fe(p,2);No(d,{get value(){return U(c).name}}),pe(f),ze((h,v,y)=>{m=zr(f,1,"mb-select-input-element mb-mod-multi",null,m,h),lt(f,"data-value",v),Is(p,y)},[()=>({"is-selected":U(i).includes(U(c).value)}),()=>yn(U(c).value),()=>U(i).includes(U(c).value)]),Ai("keypress",f,h=>a(h,U(c).value)),ee(u,f)}),ee(t,s),Te({setValue:n})}Ft(["click","input"]);var bh=class extends or{options;constructor(e){super(e),this.options=this.mountable.getArguments("option")}filterValue(e){return Zo(e)}getFallbackDefaultValue(){return[]}getSvelteComponent(){return o0}rawMapValue(e){return e}rawReverseMapValue(e){return e}getMountArgs(){return{options:this.options}}};var XH=(t,e,r,i)=>r.onValueChange(bt(U(i))),KH=ue('<input type="number" tabindex="0"/>');function a0(t,e){Ae(e,!0);let r=nr(e,["$$slots","$$events","$$legacy"]),i=ft(wt(e.value));function n(a){Re(i,a,!0)}var o=KH();return Mt(o),o.__input=[XH,r,e,i],ze(()=>lt(o,"placeholder",e.placeholder)),At(o,()=>U(i),a=>Re(i,a)),ee(t,o),Te({setValue:n})}Ft(["input"]);var xh=class extends or{filterValue(e){return ec(e)}getFallbackDefaultValue(){return null}getSvelteComponent(){return a0}rawReverseMapValue(e){return e}rawMapValue(e){return e}getMountArgs(){return{placeholder:this.mountable.getArgument("placeholder")?.value??"Number"}}};function _M(t,e,r){e(),r(t)}var QH=ue('<span class="mb-progress-bar-value"> </span> <span class="mb-progress-bar-label-left"> </span> <span class="mb-progress-bar-label-right"> </span>',1),eY=ue('<div class="mb-progress-bar-input" tabindex="0" role="button"><div class="mb-progress-bar-progress" role="slider" tabindex="0"></div> <!></div>');function s0(t,e){Ae(e,!0);let r=nr(e,["$$slots","$$events","$$legacy"]),i=ft(wt(e.value)),n=!1,o,a=0,s;function l(w){Re(i,w,!0)}function u(w){Re(i,w,!0),e.onValueChange(w)}function c(w){return w=Mf(w,e.minValue,e.maxValue),Gx(w,e.minValue,e.maxValue,0,100)}function f(){n=!0}function m(){n=!1}function p(w){if(!n)return;w.stopPropagation&&w.stopPropagation(),w.preventDefault&&w.preventDefault();let x=w instanceof TouchEvent?w.touches[0].clientX:w.clientX;d(x)}function d(w){let x=o.getBoundingClientRect();w=Mf(w,x.left,x.right);let E=Gx(w,x.left,x.right,e.minValue,e.maxValue);E=h(E,e.stepSize),u(E)}function h(w,x){return Number.parseFloat((Math.round(w/x)*x).toFixed(10))}function v(w){a<50&&(a+=1);let x=Math.ceil(a/5);if(w.key==="ArrowUp"||w.key==="ArrowRight"){let E=Mf(U(i)+x,e.minValue,e.maxValue);u(E)}if(w.key==="ArrowDown"||w.key==="ArrowLeft"){let E=Mf(U(i)-x,e.minValue,e.maxValue);u(E)}window.clearTimeout(s),s=window.setTimeout(()=>a=1,100)}var y=eY();Ai("touchmove",Ms,p,void 0,!1),Ai("touchcancel",Ms,m),Ai("touchend",Ms,m),Ai("mousemove",Ms,p),Ai("mouseup",Ms,m),y.__keydown=v,y.__mousedown=[_M,f,p],y.__touchstart=[_M,f,p];var S=he(y),b=fe(S,2);{var _=w=>{var x=QH(),E=je(x),T=he(E,!0);pe(E);var D=fe(E,2),M=he(D,!0);pe(D);var C=fe(D,2),$=he(C,!0);pe(C),ze(()=>{St(T,U(i)),St(M,e.minValue),St($,e.maxValue)}),ee(w,x)};ot(b,w=>{e.addLabels&&w(_)})}return pe(y),xa(y,w=>o=w,()=>o),ze((w,x)=>{lt(y,"aria-label",w),mc(S,x),lt(S,"aria-valuemin",e.minValue),lt(S,"aria-valuemax",e.maxValue),lt(S,"aria-valuenow",U(i))},[()=>U(i).toString(),()=>`width: ${c(U(i))}%`]),Ai("dragstart",S,()=>n=!0),ee(t,y),Te({setValue:l})}Ft(["keydown","mousedown","touchstart"]);var _h=class extends or{minValue;maxValue;stepSize;constructor(e){if(super(e),this.minValue=this.mountable.getArgument("minValue")?.value??0,this.maxValue=this.mountable.getArgument("maxValue")?.value??100,this.stepSize=this.mountable.getArgument("stepSize")?.value??1,this.minValue>=this.maxValue)throw new Br({errorLevel:"ERROR",effect:"can not create progress bar input field",cause:`minValue (${this.maxValue}) must be less than maxValue (${this.maxValue})`})}filterValue(e){return Qm(ec(e),this.minValue,this.maxValue)}getFallbackDefaultValue(){return this.minValue}getSvelteComponent(){return s0}rawReverseMapValue(e){return e}rawMapValue(e){return e}getMountArgs(){return{minValue:this.minValue,maxValue:this.maxValue,stepSize:this.stepSize,addLabels:(this.mountable.getArgument("addLabels")?.value??!0)===!0}}};var tY=(t,e,r)=>{t.target instanceof HTMLInputElement||e(U(r).value)},rY=(t,e,r)=>e(U(r).value),nY=ue('<div role="button" tabindex="0"><input type="checkbox"/> <!></div>');function u0(t,e){Ae(e,!0);let r=nr(e,["$$slots","$$events","$$legacy"]),i=ft(wt(e.value));function n(u){Re(i,u,!0)}function o(u){U(i)===u?Re(i,null):Re(i,u,!0),e.onValueChange(bt(U(i)))}function a(u,c){u.key===" "&&o(c)}var s=Or(),l=je(s);return Wt(l,17,()=>e.options,Kt,(u,c)=>{var f=nY();let m;f.__click=[tY,o,c];var p=he(f);Mt(p),p.__input=[rY,o,c];var d=fe(p,2);No(d,{get value(){return U(c).name}}),pe(f),ze((h,v)=>{m=zr(f,1,"mb-select-input-element",null,m,h),lt(f,"data-value",v),Is(p,U(c).value===U(i))},[()=>({"is-selected":U(c).value===U(i)}),()=>yn(U(c).value)]),Ai("keypress",f,h=>a(h,U(c).value)),ee(u,f)}),ee(t,s),Te({setValue:n})}Ft(["click","input"]);var wh=class extends or{options;constructor(e){super(e),this.options=this.mountable.getArguments("option")}filterValue(e){return su(e)}getFallbackDefaultValue(){return null}getSvelteComponent(){return u0}rawMapValue(e){return e}rawReverseMapValue(e){return e}getMountArgs(){return{options:this.options}}};var iY=ue('<span class="mb-slider-input-label"> </span>'),oY=(t,e,r,i)=>r.onValueChange(bt(U(i))),aY=ue('<span class="mb-slider-input-label"> </span>'),sY=ue('<!> <input class="mb-slider-input slider" type="range" tabindex="0"/> <!>',1);function l0(t,e){Ae(e,!0);let r=nr(e,["$$slots","$$events","$$legacy"]),i=ft(wt(e.value));function n(f){Re(i,f,!0)}var o=sY(),a=je(o);{var s=f=>{var m=iY(),p=he(m,!0);pe(m),ze(()=>St(p,e.minValue)),ee(f,m)};ot(a,f=>{e.addLabels&&f(s)})}var l=fe(a,2);Mt(l),l.__input=[oY,r,e,i];var u=fe(l,2);{var c=f=>{var m=aY(),p=he(m,!0);pe(m),ze(()=>St(p,e.maxValue)),ee(f,m)};ot(u,f=>{e.addLabels&&f(c)})}return ze(f=>{lt(l,"aria-label",f),lt(l,"min",e.minValue),lt(l,"max",e.maxValue),lt(l,"step",e.stepSize)},[()=>U(i).toString()]),At(l,()=>U(i),f=>Re(i,f)),ee(t,o),Te({setValue:n})}Ft(["input"]);var Sh=class extends or{minValue;maxValue;stepSize;constructor(e){if(super(e),this.minValue=this.mountable.getArgument("minValue")?.value??0,this.maxValue=this.mountable.getArgument("maxValue")?.value??100,this.stepSize=this.mountable.getArgument("stepSize")?.value??1,this.minValue>=this.maxValue)throw new Br({errorLevel:"ERROR",effect:"can not create slider input field",cause:`minValue (${this.maxValue}) must be less than maxValue (${this.maxValue})`})}filterValue(e){return Qm(ec(e),this.minValue,this.maxValue)}getFallbackDefaultValue(){return this.minValue}getSvelteComponent(){return l0}rawReverseMapValue(e){return e}rawMapValue(e){return e}getMountArgs(){return{minValue:this.minValue,maxValue:this.maxValue,stepSize:this.stepSize,addLabels:this.mountable.getArgument("addLabels")?.value===!0}}};var uY=ue("<span> </span>"),lY=ue('<div class="mb-suggest-input"><div class="mb-suggest-text"><!></div> <!> <!></div>');function c0(t,e){Ae(e,!0);let r=nr(e,["$$slots","$$events","$$legacy"]),i=ft(wt(e.value));function n(h){Re(i,h,!0)}let o=fr(()=>U(i)?.toString()??"null"),a=fr(()=>{if(_n.isLink(U(o)))try{return _n.parseLink(U(o))}catch(h){console.warn(h)}});var s=lY(),l=he(s),u=he(l);{var c=h=>{Fs(h,{get mdLink(){return U(a)}})},f=h=>{var v=uY(),y=he(v,!0);pe(v),ze(()=>St(y,U(o))),ee(h,v)};ot(u,h=>{U(a)!==void 0?h(c):h(f,!1)})}pe(l);var m=fe(l,2);Dt(m,{get variant(){return"plain"},get onclick(){return e.showSuggester},children:(h,v)=>{Rr(h,{get mb(){return e.mb},iconName:"list"})},$$slots:{default:!0}});var p=fe(m,2);{var d=h=>{Dt(h,{get variant(){return"plain"},get onclick(){return e.showTextPrompt},children:(v,y)=>{Rr(v,{get mb(){return e.mb},iconName:"pencil"})},$$slots:{default:!0}})};ot(p,h=>{e.allowOther&&h(d)})}return pe(s),ee(t,s),Te({setValue:n})}var Dh=class extends or{filterValue(e){return su(e)}getFallbackDefaultValue(){return null}getSvelteComponent(){return c0}rawMapValue(e){return e}rawReverseMapValue(e){return e}getMountArgs(){return{showSuggester:()=>this.openModal(),showTextPrompt:()=>this.openTextModal(),allowOther:this.mountable.getArgument("allowOther")?.value===!0}}openModal(){this.mountable.mb.internal.openSuggesterModal(this,e=>this.setInternalValue(e.value))}openTextModal(){this.mountable.mb.internal.openTextPromptModal({title:"Meta Bind Suggester",subTitle:"Set the suggester value.",value:"",multiline:!1,onSubmit:e=>{this.setInternalValue(e)},onCancel:()=>{}})}};var cY=(t,e,r,i)=>r.onValueChange(bt(U(i))),fY=ue("<span> </span>"),pY=ue('<input type="text" tabindex="0"/> <!>',1);function f0(t,e){Ae(e,!0);let r=nr(e,["$$slots","$$events","$$legacy"]),i=ft(wt(e.value));function n(c){Re(i,c,!0)}function o(c,f){let m=f.toString();return`${c.toString().padStart(m.length,"0")}/${m}`}var a=pY(),s=je(a);Mt(s),s.__input=[cY,r,e,i];var l=fe(s,2);{var u=c=>{var f=fY(),m=he(f,!0);pe(f),ze(p=>{zr(f,1,`mb-content-limit-indicator ${U(i).length>e.limit?"mb-content-limit-indicator-overflow":""}`),St(m,p)},[()=>o(U(i).length,e.limit)]),ee(c,f)};ot(l,c=>{e.limit!==void 0&&c(u)})}return ze(()=>{lt(s,"placeholder",e.placeholder),lt(s,"maxlength",e.limit)}),At(s,()=>U(i),c=>Re(i,c)),ee(t,a),Te({setValue:n})}Ft(["input"]);var Eh=class extends or{filterValue(e){return Ia(e)}getFallbackDefaultValue(){return""}getSvelteComponent(){return f0}rawReverseMapValue(e){return e}rawMapValue(e){return e}getMountArgs(){return{placeholder:this.mountable.getArgument("placeholder")?.value??"Text",limit:this.mountable.getArgument("limit")?.value}}};var mY=(t,e,r,i)=>r.onValueChange(bt(U(i))),dY=ue('<textarea class="mb-input-textarea" tabindex="0"></textarea>');function p0(t,e){Ae(e,!0);let r=nr(e,["$$slots","$$events","$$legacy"]),i=ft(wt(e.value));function n(a){Re(i,a,!0)}var o=dY();return Cn(o),o.__input=[mY,r,e,i],ze(()=>{lt(o,"placeholder",e.placeholder),lt(o,"maxlength",e.limit)}),At(o,()=>U(i),a=>Re(i,a)),ee(t,o),Te({setValue:n})}Ft(["input"]);var Ah=class extends or{filterValue(e){return Ia(e)}getFallbackDefaultValue(){return""}getSvelteComponent(){return p0}rawReverseMapValue(e){return e}rawMapValue(e){return e}getMountArgs(){return{placeholder:this.mountable.getArgument("placeholder")?.value??"Text",limit:this.mountable.getArgument("limit")?.value}}};var hY=(t,e,r,i)=>r.onValueChange(bt(U(i))),gY=ue('<input type="time"/>');function m0(t,e){Ae(e,!0);let r=nr(e,["$$slots","$$events","$$legacy"]),i=ft(wt(e.value));function n(a){Re(i,a,!0)}var o=gY();return Mt(o),o.__input=[hY,r,e,i],At(o,()=>U(i),a=>Re(i,a)),ee(t,o),Te({setValue:n})}Ft(["input"]);var Th=class extends or{filterValue(e){return Ia(e)}getFallbackDefaultValue(){return"00:00"}getSvelteComponent(){return m0}rawMapValue(e){return e}rawReverseMapValue(e){return e}};var vY=(t,e)=>e(),yY=(t,e)=>e(t),bY=ue('<div role="switch" tabindex="0"><input type="checkbox" tabindex="-1"/></div>');function d0(t,e){Ae(e,!0);let r=nr(e,["$$slots","$$events","$$legacy"]),i=ft(wt(e.value));function n(c){Re(i,c,!0)}function o(){Re(i,!U(i)),e.onValueChange(bt(U(i)))}function a(c){c.key===" "&&o()}var s=bY();let l;s.__click=[vY,o],s.__keydown=[yY,a];var u=he(s);return Mt(u),pe(s),ze(c=>{l=zr(s,1,"checkbox-container",null,l,c),lt(s,"aria-checked",U(i)),Is(u,U(i))},[()=>({"is-enabled":U(i)})]),ee(t,s),Te({setValue:n})}Ft(["click","keydown"]);var Nh=class extends or{onValue;offValue;constructor(e){super(e),this.onValue=this.mountable.getArgument("onValue")?.value??!0,this.offValue=this.mountable.getArgument("offValue")?.value??!1}filterValue(e){return e===this.onValue||e===this.offValue?su(e):void 0}getFallbackDefaultValue(){return!1}getSvelteComponent(){return d0}rawReverseMapValue(e){return e===this.onValue?!0:(e===this.offValue,!1)}rawMapValue(e){return e?this.onValue:this.offValue}};var Ht=class{static linkToInputField(e){return`https://www.moritzjung.dev/obsidian-meta-bind-plugin-docs/reference/inputfields/${e.toLowerCase()}/`}static linkToInputFieldArgument(e){return`https://www.moritzjung.dev/obsidian-meta-bind-plugin-docs/reference/inputfieldarguments/${e.toLowerCase()}/`}static linkToViewField(e){return`https://www.moritzjung.dev/obsidian-meta-bind-plugin-docs/reference/viewfields/${e.toLowerCase()}/`}static linkToViewFieldArgument(e){return`https://www.moritzjung.dev/obsidian-meta-bind-plugin-docs/reference/viewfieldarguments/${e.toLowerCase()}/`}static linkToInputFields(){return"https://www.moritzjung.dev/obsidian-meta-bind-plugin-docs/guides/inputfields/"}static linkToViewFields(){return"https://www.moritzjung.dev/obsidian-meta-bind-plugin-docs/guides/viewfields/"}static linkToButtons(){return"https://www.moritzjung.dev/obsidian-meta-bind-plugin-docs/guides/buttons/#button-configuration"}static linkToButtonConfig(){return"https://www.moritzjung.dev/obsidian-meta-bind-plugin-docs/guides/buttons/#button-configuration"}static linkToSearch(e){return`https://www.moritzjung.dev/obsidian-meta-bind-plugin-docs/?s=${encodeURIComponent(e)}`}static linkToHome(){return"https://www.moritzjung.dev/obsidian-meta-bind-plugin-docs/"}static linkToGithub(){return"https://github.com/mProjectsCode/obsidian-meta-bind-plugin"}static linkToIssues(){return"https://github.com/mProjectsCode/obsidian-meta-bind-plugin/issues"}static linkToCanaryBuilds(){return"https://www.moritzjung.dev/obsidian-meta-bind-plugin-docs/guides/installation/#canary-builds"}static open(e){ed(e)}};var Mh=class{mb;constructor(e){this.mb=e}createInputField(e){let r=e.declaration.inputFieldType,i=e.renderChildType;if(r!=="invalid"&&this.checkRenderChildTypeAllowed(r,i),r==="toggle")return new Nh(e);if(r==="slider")return new Sh(e);if(r==="text")return new Eh(e);if(r==="textArea")return new Ah(e);if(r==="select")return new wh(e);if(r==="multiSelect")return new bh(e);if(r==="datePicker")return new lh(e);if(r==="number")return new xh(e);if(r==="suggester")return new Dh(e);if(r==="editor")return new fh(e);if(r==="progressBar")return new _h(e);if(r==="inlineSelect")return new gh(e);if(r==="imageSuggester")return new mh(e);if(r==="list")return new vh(e);if(r==="listSuggester")return new yh(e);if(r==="date")return new uh(e);if(r==="time")return new Th(e);if(r==="inlineListSuggester")return new hh(e);if(r==="inlineList")return new dh(e);if(r==="imageListSuggester")return new ph(e);if(r==="dateTime")return new ch(e);}checkRenderChildTypeAllowed(e,r){if(this.mb.getSettings().ignoreCodeBlockRestrictions)return;let i=Dd[e];if(r==="block"&&!i.allowInBlock)throw new ma({errorLevel:"ERROR",effect:"can not create input field",cause:`input fields of type '${e}' are not allowed inside of code blocks`,docs:[Ht.linkToInputField(e)]});if(r==="inline"&&!i.allowInline)throw new ma({errorLevel:"ERROR",effect:"can not create input field",cause:`input fields of type '${e}' are not allowed inside of inline code blocks`,docs:[Ht.linkToInputField(e)]})}};var Va=class extends Ti{mb;mountable;metadataSubscription;variables;hidden;constructor(e){super(),this.mountable=e,this.mb=e.mb,this.variables=[],this.hidden=!1}async initialRender(e){ht.addClass(e,"mb-view-text"),this.hidden=this.mountable.getArgument("hidden")?.value??!1,this.hidden&&ht.addClass(e,"mb-view-hidden"),await this.onInitialRender(e)}async rerender(e,r){this.hidden||await this.onRerender(e,r)}onMount(e){this.buildVariables(),this.initialRender(e),this.metadataSubscription=this.mountable.mb.metadataManager.subscribeDerived(this.mountable.getUuid(),this.mountable.getDeclaration().writeToBindTarget,this.variables.map(r=>r.bindTargetDeclaration),this.variables.map(r=>r.metadataSignal),async()=>{let r=await this.computeValue();return this.rerender(e,r),this.mapValue(r)},()=>this.mountable.unmount())}onUnmount(){this.metadataSubscription?.unsubscribe()}};var xY=ue('<div class="mb-image-card"><img class="mb-image-card-image"/></div>');function h0(t,e){Ae(e,!0);let r=pt(e,"internal",3,!0),i=fr(()=>r()?e.mb.internal.imagePathToUri(e.image):e.image);var n=xY(),o=he(n);pe(n),ze(()=>{lt(o,"src",U(i)),lt(o,"alt",e.image)}),ee(t,n),Te()}var _Y=ue("<span>No images</span>"),wY=ue('<div class="mb-image-card-grid"></div>');function g0(t,e){Ae(e,!0);let r=pt(e,"images",23,()=>[]);function i(o){r(o)}var n=wY();return Wt(n,21,r,Kt,(o,a)=>{h0(o,{get mb(){return e.mb},get image(){return U(a).link},get internal(){return U(a).internal}})},o=>{var a=_Y();ee(o,a)}),pe(n),ee(t,n),Te({updateImages:i})}var Ch=class extends Va{component;linkVariable;constructor(e){super(e)}buildVariables(){let e=this.mountable.getDeclaration().templateDeclaration.filter(i=>typeof i=="string"?i:!0);if(e.length!==1)throw new gs({errorLevel:"ERROR",effect:"can not create view field",cause:"image view filed only supports exactly a single bind target and not text content"});let r=e[0];if(typeof r=="string")throw new gs({errorLevel:"ERROR",effect:"can not create view field",cause:"image view filed only supports exactly a single bind target and not text content"});r.listenToChildren=!0,this.linkVariable={bindTargetDeclaration:r,metadataSignal:new bn(void 0),uuid:_r(),contextName:"MB_VAR_0"},this.variables.push(this.linkVariable)}computeValue(){let e=this.linkVariable.metadataSignal.get();if(typeof e=="string"){let r=_n.interpretAsLink(e);return r===void 0?void 0:[r]}else return Array.isArray(e)?e.filter(r=>typeof r=="string").map(r=>_n.interpretAsLink(r)).filter(r=>r!==void 0):void 0}mapValue(e){return e===void 0?"":Array.isArray(e)?e.map(r=>r.toString()):e.toString()}onInitialRender(e){this.component=Fr(g0,{target:e,props:{images:[],mb:this.mountable.mb}})}async onRerender(e,r){this.component?.updateImages(nd(r).map(i=>({link:i.target,internal:i.internal})))}onUnmount(){super.onUnmount(),this.component&&Dr(this.component)}};var SY=ue("<span></span>");function v0(t,e){Ae(e,!0);let r=pt(e,"mdLinkList",7);function i(l){r(l)}var n=Or(),o=je(n);{var a=l=>{var u=SY();ee(l,u)},s=l=>{var u=Or(),c=je(u);{var f=p=>{Fs(p,{get mdLink(){return r()[0]}})},m=p=>{op(p,{get elements(){return r()},children:(h,v=eo)=>{Fs(h,{get mdLink(){return v()}})},$$slots:{default:!0}})};ot(c,p=>{r().length===1?p(f):p(m,!1)},!0)}ee(l,u)};ot(o,l=>{r().length===0?l(a):l(s,!1)})}return ee(t,n),Te({updateList:i})}var $h=class extends Va{component;linkVariable;aliasVariable;constructor(e){super(e)}buildVariables(){let e=this.mountable.getDeclaration().templateDeclaration.filter(o=>typeof o=="string"?o:!0);if(e.length!==1&&e.length!==2&&e.length!==3)throw new gs({errorLevel:"ERROR",effect:"can not create view field",cause:'link view field must be of form "{bindTarget}" or "{bindTarget}|{bindTarget}"'});let r=e[0],i=e[1],n=e[2];if(this.variables=[],e.length===1){if(typeof r=="string")throw new gs({errorLevel:"ERROR",effect:"can not create view field",cause:'link view field must be of form "{bindTarget}" or "{bindTarget}|{bindTarget}"'});r.listenToChildren=!0,this.linkVariable={bindTargetDeclaration:r,metadataSignal:new bn(void 0),uuid:_r(),contextName:"MB_VAR_0"},this.variables.push(this.linkVariable)}else if(e.length===2||e.length===3){if(typeof r=="string"||typeof i!="string")throw new gs({errorLevel:"ERROR",effect:"can not create view field",cause:'link view field must be of form "{bindTarget}", "{bindTarget}|alias", or "{bindTarget}|{bindTarget}"'});r.listenToChildren=!0,this.linkVariable={bindTargetDeclaration:r,metadataSignal:new bn(void 0),uuid:_r(),contextName:"MB_VAR_0"},this.variables.push(this.linkVariable),e.length===2?this.aliasVariable=i.slice(1):typeof n=="string"?this.aliasVariable=n:(n.listenToChildren=!0,this.aliasVariable={bindTargetDeclaration:n,metadataSignal:new bn(void 0),uuid:_r(),contextName:"MB_VAR_1"},this.variables.push(this.aliasVariable))}else throw new Error("unreachable")}getAlias(){if(this.aliasVariable)return typeof this.aliasVariable=="string"?this.aliasVariable:ju(this.aliasVariable.metadataSignal.get(),this.mountable.mb.getSettings().viewFieldDisplayNullAsEmpty)}computeValue(){let e=this.linkVariable.metadataSignal.get(),r=this.getAlias();if(typeof e=="string"){let i=_n.interpretAsLink(e);return i===void 0?void 0:(r&&(i.alias=r),[i])}else return Array.isArray(e)?e.filter(i=>typeof i=="string").map(i=>_n.interpretAsLink(i)).filter(i=>i!==void 0):void 0}mapValue(e){return e===void 0?"":Array.isArray(e)?e.map(r=>r.toString()):e.toString()}onInitialRender(e){this.component=Fr(v0,{target:e,props:{mdLinkList:[]}})}async onRerender(e,r){this.component?.updateList(nd(r))}onUnmount(){super.onUnmount(),this.component&&Dr(this.component)}};var Ih=class extends Va{container;expression;expressionStr;hidden;constructor(e){super(e),this.hidden=!1}buildVariables(){let e=0;this.expressionStr="",this.variables=[];for(let r of this.mountable.getDeclaration().templateDeclaration??[])if(typeof r!="string"){let i={bindTargetDeclaration:r,metadataSignal:new bn(void 0),uuid:_r(),contextName:`MB_VAR_${e}`};this.variables.push(i),this.expressionStr+=i.contextName,e+=1}else this.expressionStr+=r;this.expression=this.mb.math.compile(this.expressionStr)}buildMathJSContext(){let e={};for(let r of this.variables??[])!r.contextName||!r.metadataSignal||(e[r.contextName]=r.metadataSignal.get()??"");return e}computeValue(){if(!this.expression)return this.handleComputeError(new Uu({errorLevel:"ERROR",effect:"failed to evaluate expression",cause:"expression is undefined"}));let e=this.buildMathJSContext();try{let r=`${this.expression.evaluate(e)}`;return{value:_o(r),error:!1}}catch(r){return r instanceof Error?this.handleComputeError(new Uu({errorLevel:"ERROR",effect:"failed to evaluate expression",cause:r,context:{expression:this.expressionStr,context:e}})):this.handleComputeError(new Error("failed to evaluate js expression because of unexpected thrown value"))}}mapValue(e){return e.value}onInitialRender(e){}onRerender(e,r){let i=ju(r?.value,this.mountable.mb.getSettings().viewFieldDisplayNullAsEmpty)??"";r?.error?ht.addClass(e,"mb-error"):ht.removeClass(e,"mb-error"),e.innerText=i}handleComputeError(e){return console.warn(e),{error:!0,value:e.message}}};var Fh=class extends Va{textParts;renderMarkdown;markdownUnloadCallback;constructor(e){super(e),this.renderMarkdown=!1}buildVariables(){this.textParts=[];let e=0;this.variables=[];for(let r of this.mountable.getDeclaration().templateDeclaration??[])if(typeof r!="string"){let i={bindTargetDeclaration:r,metadataSignal:new bn(void 0),uuid:_r(),contextName:`MB_VAR_${e}`};this.variables.push(i),this.textParts.push(i),e+=1}else this.textParts.push(r)}computeValue(){if(!this.textParts)throw new Uu({errorLevel:"CRITICAL",effect:"failed to evaluate text view field",cause:"content parts is undefined"});return this.textParts.map(e=>typeof e=="string"?e:ju(e.metadataSignal.get(),this.mountable.mb.getSettings().viewFieldDisplayNullAsEmpty)).join("")}mapValue(e){return e}onInitialRender(e){this.renderMarkdown=this.mountable.getArgument("renderMarkdown")?.value??!1,this.renderMarkdown&&ht.addClass(e,"mb-view-markdown")}async onRerender(e,r){let i=ju(r,this.mountable.mb.getSettings().viewFieldDisplayNullAsEmpty)??"";this.renderMarkdown?(this.markdownUnloadCallback?.(),ht.empty(e),this.markdownUnloadCallback=await this.mountable.mb.internal.renderMarkdown(i,e,this.mountable.getFilePath())):e.innerText=i}onUnmount(){super.onUnmount(),this.markdownUnloadCallback?.()}};var kh=class{mb;constructor(e){this.mb=e}createViewField(e){let r=e.declaration.viewFieldType;if(r==="math")return new Ih(e);if(r==="text")return new Fh(e);if(r==="link")return new $h(e);if(r==="image")return new Ch(e);}};var mn=class extends Error{},ap=class extends Error{};var wM=function(t,e,r,i){function n(o){return o instanceof r?o:new r(function(a){a(o)})}return new(r||(r=Promise))(function(o,a){function s(c){try{u(i.next(c))}catch(f){a(f)}}function l(c){try{u(i.throw(c))}catch(f){a(f)}}function u(c){c.done?o(c.value):n(c.value).then(s,l)}u((i=i.apply(t,e||[])).next())})},DY=function(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=t[Symbol.asyncIterator],r;return e?e.call(t):(t=typeof __values=="function"?__values(t):t[Symbol.iterator](),r={},i("next"),i("throw"),i("return"),r[Symbol.asyncIterator]=function(){return this},r);function i(o){r[o]=t[o]&&function(a){return new Promise(function(s,l){a=t[o](a),n(s,l,a.done,a.value)})}}function n(o,a,s,l){Promise.resolve(l).then(function(u){o({value:u,done:s})},a)}};function EY(t,e,r){let i=r;for(let n of kr(t))i=e(i,n);return i}function AY(t,e,r){return wM(this,void 0,void 0,function*(){var i,n,o,a;let s=r;try{for(var l=!0,u=DY(Pr(t)),c;c=yield u.next(),i=c.done,!i;l=!0)a=c.value,l=!1,s=yield e(s,a)}catch(f){n={error:f}}finally{try{!l&&!i&&(o=u.return)&&(yield o.call(u))}finally{if(n)throw n.error}}return s})}function y0(t){switch(!0){case t instanceof Array:return t.length;case qa(t):return t.length;case t instanceof Set:return t.size;case t instanceof Map:return t.size}return EY(t,e=>e+1,0)}function SM(t){return wM(this,void 0,void 0,function*(){switch(!0){case t instanceof Array:case qa(t):case t instanceof Set:case t instanceof Map:return y0(t)}return yield AY(t,e=>e+1,0)})}var DM={chunkwise:LM,chunkwiseOverlap:Bh,compress:TM,dropWhile:MM,enumerate:qM,filter:OM,flatMap:PM,flatten:b0,groupBy:QM,keys:WM,limit:zM,map:AM,pairwise:al,repeat:FM,skip:YM,slice:ZM,sort:tC,takeWhile:$M,values:XM,chunkwiseAsync:UM,chunkwiseOverlapAsync:Oh,compressAsync:NM,dropWhileAsync:CM,enumerateAsync:jM,filterAsync:RM,flatMapAsync:BM,flattenAsync:x0,groupByAsync:eC,keysAsync:HM,limitAsync:VM,mapAsync:Ph,pairwiseAsync:sp,repeatAsync:kM,skipAsync:JM,sliceAsync:GM,sortAsync:rC,takeWhileAsync:IM,valuesAsync:KM};var EM={allMatch:nC,allUnique:oC,anyMatch:sC,exactlyN:lC,isEmpty:fC,isAsyncIterable:ks,isIterable:oo,isIterator:Qo,isReversed:mC,isSorted:hC,isString:qa,noneMatch:vC,same:bC,sameCount:_C,allMatchAsync:iC,allUniqueAsync:aC,anyMatchAsync:uC,exactlyNAsync:cC,isEmptyAsync:pC,isReversedAsync:dC,isSortedAsync:gC,noneMatchAsync:yC,sameAsync:xC,sameCountAsync:wC};var vc=function(t){return this instanceof vc?(this.v=t,this):new vc(t)},TY=function(t,e,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var i=r.apply(t,e||[]),n,o=[];return n=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),s("next"),s("throw"),s("return",a),n[Symbol.asyncIterator]=function(){return this},n;function a(p){return function(d){return Promise.resolve(d).then(p,f)}}function s(p,d){i[p]&&(n[p]=function(h){return new Promise(function(v,y){o.push([p,h,v,y])>1||l(p,h)})},d&&(n[p]=d(n[p])))}function l(p,d){try{u(i[p](d))}catch(h){m(o[0][3],h)}}function u(p){p.value instanceof vc?Promise.resolve(p.value.v).then(c,f):m(o[0][2],p)}function c(p){l("next",p)}function f(p){l("throw",p)}function m(p,d){p(d),o.shift(),o.length&&l(o[0][0],o[0][1])}},_a;(function(t){t[t.SHORTEST=0]="SHORTEST",t[t.LONGEST=1]="LONGEST",t[t.STRICT_EQUAL=2]="STRICT_EQUAL"})(_a||(_a={}));function*_0(t,e,...r){if(r.length===0)return;let i=[];for(let n of r)i.push(SC(n));e:for(;;){let n=DM.map(i,l=>l.next()),o=[],a=!0,s=!1;for(let l of n){let u;l.done?(a=!1,u=e):(s=!0,u=l.value),o.push(u)}if(!a&&s)switch(t){case _a.SHORTEST:break e;case _a.STRICT_EQUAL:throw new ap("Iterators must have equal lengths")}if(!s)break;yield o}}function w0(t,e,...r){return TY(this,arguments,function*(){if(r.length===0)return yield vc(void 0);let n=[];for(let o of r)n.push(DC(o));e:for(;;){let o=[];for(let u of n){let c=yield vc(u.next());o.push(c)}let a=[],s=!0,l=!1;for(let u of o){let c;u.done?(s=!1,c=e):(l=!0,c=u.value),a.push(c)}if(!s&&l)switch(t){case _a.SHORTEST:break e;case _a.STRICT_EQUAL:throw new ap("Iterators must have equal lengths")}if(!l)break;yield yield vc(a)}})}var hu=function(t){return this instanceof hu?(this.v=t,this):new hu(t)},NY=function(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=t[Symbol.asyncIterator],r;return e?e.call(t):(t=typeof __values=="function"?__values(t):t[Symbol.iterator](),r={},i("next"),i("throw"),i("return"),r[Symbol.asyncIterator]=function(){return this},r);function i(o){r[o]=t[o]&&function(a){return new Promise(function(s,l){a=t[o](a),n(s,l,a.done,a.value)})}}function n(o,a,s,l){Promise.resolve(l).then(function(u){o({value:u,done:s})},a)}},MY=function(t,e,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var i=r.apply(t,e||[]),n,o=[];return n=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),s("next"),s("throw"),s("return",a),n[Symbol.asyncIterator]=function(){return this},n;function a(p){return function(d){return Promise.resolve(d).then(p,f)}}function s(p,d){i[p]&&(n[p]=function(h){return new Promise(function(v,y){o.push([p,h,v,y])>1||l(p,h)})},d&&(n[p]=d(n[p])))}function l(p,d){try{u(i[p](d))}catch(h){m(o[0][3],h)}}function u(p){p.value instanceof hu?Promise.resolve(p.value.v).then(c,f):m(o[0][2],p)}function c(p){l("next",p)}function f(p){l("throw",p)}function m(p,d){p(d),o.shift(),o.length&&l(o[0][0],o[0][1])}};function*S0(t,e){let r=new Set;if(t instanceof Map){e===void 0&&(e=i=>i[1]);for(let i of t){let n=e(i);r.has(n)||(yield i,r.add(n))}}else{e===void 0&&(e=i=>i);for(let i of kr(t)){let n=e(i);r.has(n)||(yield i,r.add(n))}}}function EC(t,e){return MY(this,arguments,function*(){var i,n,o,a;let s=new Set;if(t instanceof Map)for(let f of S0(t,e))yield yield hu(yield hu(f));else{e===void 0&&(e=f=>f);try{for(var l=!0,u=NY(Pr(t)),c;c=yield hu(u.next()),i=c.done,!i;l=!0){a=c.value,l=!1;let f=a,m=e(f);s.has(m)||(yield yield hu(f),s.add(m))}}catch(f){n={error:f}}finally{try{!l&&!i&&(o=u.return)&&(yield hu(o.call(u)))}finally{if(n)throw n.error}}}})}var $n=function(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=t[Symbol.asyncIterator],r;return e?e.call(t):(t=typeof __values=="function"?__values(t):t[Symbol.iterator](),r={},i("next"),i("throw"),i("return"),r[Symbol.asyncIterator]=function(){return this},r);function i(o){r[o]=t[o]&&function(a){return new Promise(function(s,l){a=t[o](a),n(s,l,a.done,a.value)})}}function n(o,a,s,l){Promise.resolve(l).then(function(u){o({value:u,done:s})},a)}},at=function(t){return this instanceof at?(this.v=t,this):new at(t)},Xn=function(t,e,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var i=r.apply(t,e||[]),n,o=[];return n=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),s("next"),s("throw"),s("return",a),n[Symbol.asyncIterator]=function(){return this},n;function a(p){return function(d){return Promise.resolve(d).then(p,f)}}function s(p,d){i[p]&&(n[p]=function(h){return new Promise(function(v,y){o.push([p,h,v,y])>1||l(p,h)})},d&&(n[p]=d(n[p])))}function l(p,d){try{u(i[p](d))}catch(h){m(o[0][3],h)}}function u(p){p.value instanceof at?Promise.resolve(p.value.v).then(c,f):m(o[0][2],p)}function c(p){l("next",p)}function f(p){l("throw",p)}function m(p,d){p(d),o.shift(),o.length&&l(o[0][0],o[0][1])}};function*AM(t,e){for(let r of kr(t))yield e(r)}function Ph(t,e){return Xn(this,arguments,function*(){var i,n,o,a;try{for(var s=!0,l=$n(Pr(t)),u;u=yield at(l.next()),i=u.done,!i;s=!0)a=u.value,s=!1,yield yield at(yield at(e(a)))}catch(c){n={error:c}}finally{try{!s&&!i&&(o=l.return)&&(yield at(o.call(l)))}finally{if(n)throw n.error}}})}function*TM(t,e){for(let[r,i]of yc(t,e))i&&(yield r)}function NM(t,e){return Xn(this,arguments,function*(){var i,n,o,a;try{for(var s=!0,l=$n(TC(t,e)),u;u=yield at(l.next()),i=u.done,!i;s=!0){a=u.value,s=!1;let[c,f]=a;f&&(yield yield at(c))}}catch(c){n={error:c}}finally{try{!s&&!i&&(o=l.return)&&(yield at(o.call(l)))}finally{if(n)throw n.error}}})}function*MM(t,e){let r=!0;for(let i of kr(t)){if(r){if(!e(i)){r=!1,yield i;continue}continue}yield i}}function CM(t,e){return Xn(this,arguments,function*(){var i,n,o,a;let s=!0;try{for(var l=!0,u=$n(Pr(t)),c;c=yield at(u.next()),i=c.done,!i;l=!0){a=c.value,l=!1;let f=a;if(s){if(!(yield at(e(f)))){s=!1,yield yield at(f);continue}continue}yield yield at(f)}}catch(f){n={error:f}}finally{try{!l&&!i&&(o=u.return)&&(yield at(o.call(u)))}finally{if(n)throw n.error}}})}function*$M(t,e){for(let r of kr(t))if(e(r))yield r;else break}function IM(t,e){return Xn(this,arguments,function*(){var i,n,o,a;try{for(var s=!0,l=$n(Pr(t)),u;u=yield at(l.next()),i=u.done,!i;s=!0){a=u.value,s=!1;let c=a;if(yield at(e(c)))yield yield at(c);else break}}catch(c){n={error:c}}finally{try{!s&&!i&&(o=l.return)&&(yield at(o.call(l)))}finally{if(n)throw n.error}}})}function*FM(t,e){if(e<0)throw new mn(`Number of repetitions cannot be negative: ${e}`);for(let r=e;r>0;--r)yield t}function kM(t,e){return Xn(this,arguments,function*(){if(e<0)throw new mn(`Number of repetitions cannot be negative: ${e}`);let i=yield at(t);for(let n=e;n>0;--n)yield yield at(i)})}function*PM(t,e){for(let r of kr(t)){let i=e(r,e);if(oo(i))for(let n of kr(i))yield n;else yield i}}function BM(t,e){return Xn(this,arguments,function*(){var i,n,o,a,s,l,u,c;try{for(var f=!0,m=$n(Pr(t)),p;p=yield at(m.next()),i=p.done,!i;f=!0){a=p.value,f=!1;let S=yield at(e(a,e));if(oo(S)||ks(S))try{for(var d=!0,h=(l=void 0,$n(Pr(S))),v;v=yield at(h.next()),s=v.done,!s;d=!0)c=v.value,d=!1,yield yield at(c)}catch(b){l={error:b}}finally{try{!d&&!s&&(u=h.return)&&(yield at(u.call(h)))}finally{if(l)throw l.error}}else yield yield at(S)}}catch(y){n={error:y}}finally{try{!f&&!i&&(o=m.return)&&(yield at(o.call(m)))}finally{if(n)throw n.error}}})}function*b0(t,e=1/0){if(e<1){for(let r of kr(t))t instanceof Map&&(r=r[1]),yield r;return}for(let r of kr(t))if(t instanceof Map&&(r=r[1]),(oo(r)||Qo(r))&&!qa(r))for(let i of b0(r,e-1))yield i;else yield r}function x0(t){return Xn(this,arguments,function*(r,i=1/0){var n,o,a,s,l,u,c,f,m,p,d,h;if(i<1){try{for(var v=!0,y=$n(Pr(r)),S;S=yield at(y.next()),n=S.done,!n;v=!0){s=S.value,v=!1;let D=s;r instanceof Map&&(D=D[1]),yield yield at(D)}}catch(D){o={error:D}}finally{try{!v&&!n&&(a=y.return)&&(yield at(a.call(y)))}finally{if(o)throw o.error}}return yield at(void 0)}try{for(var b=!0,_=$n(Pr(r)),w;w=yield at(_.next()),l=w.done,!l;b=!0){f=w.value,b=!1;let D=f;if(r instanceof Map&&(D=D[1]),(ks(D)||oo(D)||Qo(D))&&!qa(D))try{for(var x=!0,E=(p=void 0,$n(x0(D,i-1))),T;T=yield at(E.next()),m=T.done,!m;x=!0)h=T.value,x=!1,yield yield at(h)}catch(M){p={error:M}}finally{try{!x&&!m&&(d=E.return)&&(yield at(d.call(E)))}finally{if(p)throw p.error}}else yield yield at(D)}}catch(D){u={error:D}}finally{try{!b&&!l&&(c=_.return)&&(yield at(c.call(_)))}finally{if(u)throw u.error}}})}function*OM(t,e){for(let r of kr(t))e(r)&&(yield r)}function RM(t,e){return Xn(this,arguments,function*(){var i,n,o,a;try{for(var s=!0,l=$n(Pr(t)),u;u=yield at(l.next()),i=u.done,!i;s=!0){a=u.value,s=!1;let c=a;(yield at(e(c)))&&(yield yield at(c))}}catch(c){n={error:c}}finally{try{!s&&!i&&(o=l.return)&&(yield at(o.call(l)))}finally{if(n)throw n.error}}})}function*Bh(t,e,r,i=!0){if(e<1)throw new mn(`Chunk size must be \u2265 1. Got ${e}`);if(r>=e)throw new mn("Overlap size must be less than chunk size");let n=[],o=!1;for(let a of kr(t))o=!1,n.push(a),n.length===e&&(yield n,n=n.slice(e-r),o=!0);!o&&n.length>0&&i&&(yield n)}function Oh(t,e,r){return Xn(this,arguments,function*(n,o,a,s=!0){var l,u,c,f;if(o<1)throw new mn(`Chunk size must be \u2265 1. Got ${o}`);if(a>=o)throw new mn("Overlap size must be less than chunk size");let m=[],p=!1;try{for(var d=!0,h=$n(Pr(n)),v;v=yield at(h.next()),l=v.done,!l;d=!0){f=v.value,d=!1;let y=f;p=!1,m.push(y),m.length===o&&(yield yield at(m),m=m.slice(o-a),p=!0)}}catch(y){u={error:y}}finally{try{!d&&!l&&(c=h.return)&&(yield at(c.call(h)))}finally{if(u)throw u.error}}!p&&m.length>0&&s&&(yield yield at(m))})}function*LM(t,e){for(let r of Bh(t,e,0))yield r}function UM(t,e){return Xn(this,arguments,function*(){var i,n,o,a;try{for(var s=!0,l=$n(Oh(t,e,0)),u;u=yield at(l.next()),i=u.done,!i;s=!0)a=u.value,s=!1,yield yield at(a)}catch(c){n={error:c}}finally{try{!s&&!i&&(o=l.return)&&(yield at(o.call(l)))}finally{if(n)throw n.error}}})}function*al(t){let e=Bh(t,2,1,!1);for(let r of e)yield r}function sp(t){return Xn(this,arguments,function*(){var r,i,n,o;let a=Oh(t,2,1,!1);try{for(var s=!0,l=$n(a),u;u=yield at(l.next()),r=u.done,!r;s=!0)o=u.value,s=!1,yield yield at(o)}catch(c){i={error:c}}finally{try{!s&&!r&&(n=l.return)&&(yield at(n.call(l)))}finally{if(i)throw i.error}}})}function*zM(t,e){if(e<0)throw new mn(`Limit must be \u2265 0. Got ${e}`);let r=0;for(let i of kr(t)){if(r>=e)return;yield i,++r}}function VM(t,e){return Xn(this,arguments,function*(){var i,n,o,a;if(e<0)throw new mn(`Limit must be \u2265 0. Got ${e}`);let s=0;try{for(var l=!0,u=$n(Pr(t)),c;c=yield at(u.next()),i=c.done,!i;l=!0){a=c.value,l=!1;let f=a;if(s>=e)return yield at(void 0);yield yield at(f),++s}}catch(f){n={error:f}}finally{try{!l&&!i&&(o=u.return)&&(yield at(o.call(u)))}finally{if(n)throw n.error}}})}function*qM(t){let e=0;for(let r of kr(t))yield[e++,r]}function jM(t){return Xn(this,arguments,function*(){var r,i,n,o;let a=0;try{for(var s=!0,l=$n(Pr(t)),u;u=yield at(l.next()),r=u.done,!r;s=!0){o=u.value,s=!1;let c=o;yield yield at([a++,c])}}catch(c){i={error:c}}finally{try{!s&&!r&&(n=l.return)&&(yield at(n.call(l)))}finally{if(i)throw i.error}}})}function*ZM(t,e=0,r,i=1){if(e<0)throw new mn("Parameter 'start' cannot be negative");if(r!==void 0&&r<0)throw new mn("Parameter 'count' cannot be negative");if(i<=0)throw new mn("Parameter 'step' must be positive");let n=0,o=0;for(let a of kr(t))if(!(n++<e||(n-e-1)%i!==0)){if(o++===r&&r!==void 0)break;yield a}}function GM(t){return Xn(this,arguments,function*(r,i=0,n,o=1){var a,s,l,u;if(i<0)throw new mn("Parameter 'start' cannot be negative");if(n!==void 0&&n<0)throw new mn("Parameter 'count' cannot be negative");if(o<=0)throw new mn("Parameter 'step' must be positive");let c=0,f=0;try{for(var m=!0,p=$n(Pr(r)),d;d=yield at(p.next()),a=d.done,!a;m=!0){u=d.value,m=!1;let h=u;if(!(c++<i||(c-i-1)%o!==0)){if(f++===n&&n!==void 0)break;yield yield at(h)}}}catch(h){s={error:h}}finally{try{!m&&!a&&(l=p.return)&&(yield at(l.call(p)))}finally{if(s)throw s.error}}})}function*WM(t){for(let[e]of kr(t))yield e}function HM(t){return Xn(this,arguments,function*(){var r,i,n,o;try{for(var a=!0,s=$n(Pr(t)),l;l=yield at(s.next()),r=l.done,!r;a=!0){o=l.value,a=!1;let[u]=o;yield yield at(u)}}catch(u){i={error:u}}finally{try{!a&&!r&&(n=s.return)&&(yield at(n.call(s)))}finally{if(i)throw i.error}}})}function*YM(t,e,r=0){if(e<0||r<0)throw new mn;let i=-r;for(let n of kr(t))(i<0||i>=e)&&(yield n),++i}function JM(t,e){return Xn(this,arguments,function*(i,n,o=0){var a,s,l,u;if(n<0||o<0)throw new mn;let c=-o;try{for(var f=!0,m=$n(Pr(i)),p;p=yield at(m.next()),a=p.done,!a;f=!0){u=p.value,f=!1;let d=u;(c<0||c>=n)&&(yield yield at(d)),++c}}catch(d){s={error:d}}finally{try{!f&&!a&&(l=m.return)&&(yield at(l.call(m)))}finally{if(s)throw s.error}}})}function*XM(t){for(let[,e]of kr(t))yield e}function KM(t){return Xn(this,arguments,function*(){var r,i,n,o;try{for(var a=!0,s=$n(Pr(t)),l;l=yield at(s.next()),r=l.done,!r;a=!0){o=l.value,a=!1;let[,u]=o;yield yield at(u)}}catch(u){i={error:u}}finally{try{!a&&!r&&(n=s.return)&&(yield at(n.call(s)))}finally{if(i)throw i.error}}})}function*QM(t,e,r){let i=new Map,n=o=>{i.has(o)||(r!==void 0?i.set(o,{}):i.set(o,[]))};for(let o of kr(t)){let a=e(o),s=r!==void 0?r(o):void 0,l=(oo(a)||Qo(a))&&!qa(a)?a:[a];for(let u of S0(l))n(u),s===void 0?i.get(u).push(o):i.get(u)[s]=o}for(let o of i)yield o}function eC(t,e,r){return Xn(this,arguments,function*(){var n,o,a,s,l,u,c,f;let m=new Map,p=_=>{m.has(_)||(r!==void 0?m.set(_,{}):m.set(_,[]))};try{for(var d=!0,h=$n(Pr(t)),v;v=yield at(h.next()),n=v.done,!n;d=!0){s=v.value,d=!1;let _=s,w=yield at(e(_)),x=r!==void 0?yield at(r(_)):void 0,E=(ks(w)||oo(w)||Qo(w))&&!qa(w)?w:[w];try{for(var y=!0,S=(u=void 0,$n(EC(E))),b;b=yield at(S.next()),l=b.done,!l;y=!0){f=b.value,y=!1;let T=f;p(T),x===void 0?m.get(T).push(_):m.get(T)[x]=_}}catch(T){u={error:T}}finally{try{!y&&!l&&(c=S.return)&&(yield at(c.call(S)))}finally{if(u)throw u.error}}}}catch(_){o={error:_}}finally{try{!d&&!n&&(a=h.return)&&(yield at(a.call(h)))}finally{if(o)throw o.error}}for(let _ of m)yield yield at(_)})}function*tC(t,e){let r=AC(t);e!==void 0?r.sort(e):r.sort();for(let i of r)yield i}function rC(t,e){return Xn(this,arguments,function*(){let i=yield at(Rh(t));e!==void 0?i.sort(e):i.sort();for(let n of i)yield yield at(n)})}var wa=function(t,e,r,i){function n(o){return o instanceof r?o:new r(function(a){a(o)})}return new(r||(r=Promise))(function(o,a){function s(c){try{u(i.next(c))}catch(f){a(f)}}function l(c){try{u(i.throw(c))}catch(f){a(f)}}function u(c){c.done?o(c.value):n(c.value).then(s,l)}u((i=i.apply(t,e||[])).next())})},Ps=function(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=t[Symbol.asyncIterator],r;return e?e.call(t):(t=typeof __values=="function"?__values(t):t[Symbol.iterator](),r={},i("next"),i("throw"),i("return"),r[Symbol.asyncIterator]=function(){return this},r);function i(o){r[o]=t[o]&&function(a){return new Promise(function(s,l){a=t[o](a),n(s,l,a.done,a.value)})}}function n(o,a,s,l){Promise.resolve(l).then(function(u){o({value:u,done:s})},a)}};function nC(t,e){for(let r of kr(t))if(!e(r))return!1;return!0}function iC(t,e){return wa(this,void 0,void 0,function*(){var r,i,n,o;try{for(var a=!0,s=Ps(Pr(t)),l;l=yield s.next(),r=l.done,!r;a=!0)if(o=l.value,a=!1,!(yield e(o)))return!1}catch(u){i={error:u}}finally{try{!a&&!r&&(n=s.return)&&(yield n.call(s))}finally{if(i)throw i.error}}return!0})}function oC(t){let e=new Set;for(let r of kr(t)){if(e.has(r))return!1;e.add(r)}return!0}function aC(t){return wa(this,void 0,void 0,function*(){var e,r,i,n;let o=new Set;try{for(var a=!0,s=Ps(Pr(t)),l;l=yield s.next(),e=l.done,!e;a=!0){n=l.value,a=!1;let u=n;if(o.has(u))return!1;o.add(u)}}catch(u){r={error:u}}finally{try{!a&&!e&&(i=s.return)&&(yield i.call(s))}finally{if(r)throw r.error}}return!0})}function sC(t,e){for(let r of kr(t))if(e(r))return!0;return!1}function uC(t,e){return wa(this,void 0,void 0,function*(){var r,i,n,o;try{for(var a=!0,s=Ps(Pr(t)),l;l=yield s.next(),r=l.done,!r;a=!0)if(o=l.value,a=!1,yield e(o))return!0}catch(u){i={error:u}}finally{try{!a&&!r&&(n=s.return)&&(yield n.call(s))}finally{if(i)throw i.error}}return!1})}function lC(t,e,r){if(e<0)return!1;r===void 0&&(r=n=>!!n);let i=0;for(let n of kr(t))if(r(n)&&(i++,i>e))return!1;return i===e}function cC(t,e,r){return wa(this,void 0,void 0,function*(){var i,n,o,a;if(e<0)return!1;r===void 0&&(r=f=>!!f);let s=0;try{for(var l=!0,u=Ps(Pr(t)),c;c=yield u.next(),i=c.done,!i;l=!0)if(a=c.value,l=!1,(yield r(a))&&(s++,s>e))return!1}catch(f){n={error:f}}finally{try{!l&&!i&&(o=u.return)&&(yield o.call(u))}finally{if(n)throw n.error}}return s===e})}function fC(t){for(let e of kr(t))return!1;return!0}function pC(t){return wa(this,void 0,void 0,function*(){var e,r,i,n;try{for(var o=!0,a=Ps(Pr(t)),s;s=yield a.next(),e=s.done,!e;o=!0){n=s.value,o=!1;let l=n;return!1}}catch(l){r={error:l}}finally{try{!o&&!e&&(i=a.return)&&(yield i.call(a))}finally{if(r)throw r.error}}return!0})}function oo(t){return t==null?!1:typeof t[Symbol.iterator]=="function"}function ks(t){return t==null?!1:typeof t[Symbol.asyncIterator]=="function"}function Qo(t){return t==null?!1:t.next!==void 0&&typeof t.next=="function"}function mC(t){for(let[e,r]of al(kr(t)))if(e<r)return!1;return!0}function dC(t){return wa(this,void 0,void 0,function*(){var e,r,i,n;try{for(var o=!0,a=Ps(sp(Pr(t))),s;s=yield a.next(),e=s.done,!e;o=!0){n=s.value,o=!1;let[l,u]=n;if(l<u)return!1}}catch(l){r={error:l}}finally{try{!o&&!e&&(i=a.return)&&(yield i.call(a))}finally{if(r)throw r.error}}return!0})}function hC(t){for(let[e,r]of al(kr(t)))if(e>r)return!1;return!0}function gC(t){return wa(this,void 0,void 0,function*(){var e,r,i,n;try{for(var o=!0,a=Ps(sp(Pr(t))),s;s=yield a.next(),e=s.done,!e;o=!0){n=s.value,o=!1;let[l,u]=n;if(l>u)return!1}}catch(l){r={error:l}}finally{try{!o&&!e&&(i=a.return)&&(yield i.call(a))}finally{if(r)throw r.error}}return!0})}function qa(t){return typeof t=="string"||t instanceof String}function vC(t,e){for(let r of kr(t))if(e(r))return!1;return!0}function yC(t,e){return wa(this,void 0,void 0,function*(){var r,i,n,o;try{for(var a=!0,s=Ps(Pr(t)),l;l=yield s.next(),r=l.done,!r;a=!0)if(o=l.value,a=!1,yield e(o))return!1}catch(u){i={error:u}}finally{try{!a&&!r&&(n=s.return)&&(yield n.call(s))}finally{if(i)throw i.error}}return!0})}function bC(...t){try{for(let e of NC(...t))for(let[r,i]of al(e))if(r!==i)return!1}catch{return!1}return!0}function xC(...t){return wa(this,void 0,void 0,function*(){var e,r,i,n;try{try{for(var o=!0,a=Ps(MC(...t)),s;s=yield a.next(),e=s.done,!e;o=!0){n=s.value,o=!1;let l=n;for(let[u,c]of al(l))if(u!==c)return!1}}catch(l){r={error:l}}finally{try{!o&&!e&&(i=a.return)&&(yield i.call(a))}finally{if(r)throw r.error}}}catch{return!1}return!0})}function _C(...t){if(t.length<=1)return!0;let e=t.map(r=>y0(r));return new Set(e).size===1}function wC(...t){return wa(this,void 0,void 0,function*(){if(t.length<=1)return!0;let e=yield Ph(t,r=>wa(this,void 0,void 0,function*(){return yield SM(r)}));return new Set(yield Rh(e)).size===1})}var CY=function(t,e,r,i){function n(o){return o instanceof r?o:new r(function(a){a(o)})}return new(r||(r=Promise))(function(o,a){function s(c){try{u(i.next(c))}catch(f){a(f)}}function l(c){try{u(i.throw(c))}catch(f){a(f)}}function u(c){c.done?o(c.value):n(c.value).then(s,l)}u((i=i.apply(t,e||[])).next())})},ja=function(t){return this instanceof ja?(this.v=t,this):new ja(t)},D0=function(t,e,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var i=r.apply(t,e||[]),n,o=[];return n=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),s("next"),s("throw"),s("return",a),n[Symbol.asyncIterator]=function(){return this},n;function a(p){return function(d){return Promise.resolve(d).then(p,f)}}function s(p,d){i[p]&&(n[p]=function(h){return new Promise(function(v,y){o.push([p,h,v,y])>1||l(p,h)})},d&&(n[p]=d(n[p])))}function l(p,d){try{u(i[p](d))}catch(h){m(o[0][3],h)}}function u(p){p.value instanceof ja?Promise.resolve(p.value.v).then(c,f):m(o[0][2],p)}function c(p){l("next",p)}function f(p){l("throw",p)}function m(p,d){p(d),o.shift(),o.length&&l(o[0][0],o[0][1])}},CC=function(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=t[Symbol.asyncIterator],r;return e?e.call(t):(t=typeof __values=="function"?__values(t):t[Symbol.iterator](),r={},i("next"),i("throw"),i("return"),r[Symbol.asyncIterator]=function(){return this},r);function i(o){r[o]=t[o]&&function(a){return new Promise(function(s,l){a=t[o](a),n(s,l,a.done,a.value)})}}function n(o,a,s,l){Promise.resolve(l).then(function(u){o({value:u,done:s})},a)}};function kr(t){if(oo(t))return t;if(Qo(t))return{[Symbol.iterator](){return t}};if(typeof t=="object"&&t!==null)return function*(){for(let e in t)Object.prototype.hasOwnProperty.call(t,e)&&(yield[e,t[e]])}();throw new mn("Given collection is not iterable or iterator.")}function Pr(t){if(ks(t))return t;if(Qo(t))return{[Symbol.asyncIterator](){return D0(this,arguments,function*(){for(;;){let r=yield ja(t.next());if(r.done)return yield ja(void 0);yield yield ja(r.value)}})}};if(typeof t=="object"&&t!==null&&(t=kr(t)),oo(t))return{[Symbol.asyncIterator](){return D0(this,arguments,function*(){for(let r of t)yield yield ja(r)})}};throw new mn("Given collection is not async iterable or iterator.")}function SC(t){if(Qo(t))return t;if(oo(t))return function*(){for(let e of t)yield e}();throw new mn("Given collection is not iterable or iterator.")}function DC(t){if((Qo(t)||oo(t))&&(t=Pr(t)),ks(t))return function(){return D0(this,arguments,function*(){var e,r,i,n;try{for(var o=!0,a=CC(t),s;s=yield ja(a.next()),e=s.done,!e;o=!0)n=s.value,o=!1,yield yield ja(n)}catch(l){r={error:l}}finally{try{!o&&!e&&(i=a.return)&&(yield ja(i.call(a)))}finally{if(r)throw r.error}}})}();throw new mn("Given collection is not iterable or iterator.")}function AC(t){if(Array.isArray(t))return t;let e=[];for(let r of kr(t))e.push(r);return e}function Rh(t){return CY(this,void 0,void 0,function*(){var e,r,i,n;if(Array.isArray(t))return t;let o=[];try{for(var a=!0,s=CC(Pr(t)),l;l=yield s.next(),e=l.done,!e;a=!0){n=l.value,a=!1;let u=n;o.push(u)}}catch(u){r={error:u}}finally{try{!a&&!e&&(i=s.return)&&(yield i.call(s))}finally{if(r)throw r.error}}return o})}var $C=function(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=t[Symbol.asyncIterator],r;return e?e.call(t):(t=typeof __values=="function"?__values(t):t[Symbol.iterator](),r={},i("next"),i("throw"),i("return"),r[Symbol.asyncIterator]=function(){return this},r);function i(o){r[o]=t[o]&&function(a){return new Promise(function(s,l){a=t[o](a),n(s,l,a.done,a.value)})}}function n(o,a,s,l){Promise.resolve(l).then(function(u){o({value:u,done:s})},a)}},Bs=function(t){return this instanceof Bs?(this.v=t,this):new Bs(t)},IC=function(t,e,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var i=r.apply(t,e||[]),n,o=[];return n=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),s("next"),s("throw"),s("return",a),n[Symbol.asyncIterator]=function(){return this},n;function a(p){return function(d){return Promise.resolve(d).then(p,f)}}function s(p,d){i[p]&&(n[p]=function(h){return new Promise(function(v,y){o.push([p,h,v,y])>1||l(p,h)})},d&&(n[p]=d(n[p])))}function l(p,d){try{u(i[p](d))}catch(h){m(o[0][3],h)}}function u(p){p.value instanceof Bs?Promise.resolve(p.value.v).then(c,f):m(o[0][2],p)}function c(p){l("next",p)}function f(p){l("throw",p)}function m(p,d){p(d),o.shift(),o.length&&l(o[0][0],o[0][1])}};function*yc(...t){for(let e of _0(_a.SHORTEST,void 0,...t))yield e}function TC(...t){return IC(this,arguments,function*(){var r,i,n,o;try{for(var a=!0,s=$C(w0(_a.SHORTEST,void 0,...t)),l;l=yield Bs(s.next()),r=l.done,!r;a=!0)o=l.value,a=!1,yield yield Bs(o)}catch(u){i={error:u}}finally{try{!a&&!r&&(n=s.return)&&(yield Bs(n.call(s)))}finally{if(i)throw i.error}}})}function*NC(...t){for(let e of _0(_a.STRICT_EQUAL,void 0,...t))yield e}function MC(...t){return IC(this,arguments,function*(){var r,i,n,o;try{for(var a=!0,s=$C(w0(_a.STRICT_EQUAL,void 0,...t)),l;l=yield Bs(s.next()),r=l.done,!r;a=!0)o=l.value,a=!1,yield yield Bs(o)}catch(u){i={error:u}}finally{try{!a&&!r&&(n=s.return)&&(yield Bs(n.call(s)))}finally{if(i)throw i.error}}})}var Lh=class{uuid;metadataManager;bindTarget;dependencies;dependencySignals;dependencySubscriptions;computeFunction;deleted;onDelete;constructor(e,r,i,n,o,a,s){this.uuid=e,this.metadataManager=r,this.bindTarget=i,this.dependencies=n,this.dependencySignals=o,this.dependencySubscriptions=[],this.computeFunction=a,this.onDelete=s,this.deleted=!1}init(){for(let[e,r]of yc(this.dependencies,this.dependencySignals)){let i=this.uuid+"/"+_r();this.dependencySubscriptions.push(this.metadataManager.subscribe(i,r,e,()=>this.delete())),r.registerListener({callback:()=>void this.computeValue()})}this.computeValue()}async computeValue(){try{let e=await this.computeFunction();if(this.bindTarget){let r=this.metadataManager.readShortLived(this.bindTarget);bs(r,e)||this.metadataManager.write(e,this.bindTarget,this.uuid)}}catch(e){let r=e instanceof Error?e:String(e);console.warn(new jt({errorLevel:"ERROR",effect:"Failed to run derived metadata computation",cause:r}))}}unsubscribe(){for(let e of this.dependencySubscriptions)e.unsubscribe();this.metadataManager.unsubscribe(this)}onUpdate(e){return!1}updatable(){return!1}getDependencies(){return this.dependencies}delete(){this.deleted=!0;for(let e of this.dependencySubscriptions)e.deleted||e.delete();this.onDelete(),this.unsubscribe()}};var Uh=class{uuid;metadataManager;bindTarget;dependencies;dependencySignals;dependencySubscriptions;effectFunction;deleted;onDelete;constructor(e,r,i,n,o,a){this.uuid=e,this.metadataManager=r,this.bindTarget=void 0,this.dependencies=i,this.dependencySignals=n,this.dependencySubscriptions=[],this.effectFunction=o,this.deleted=!1,this.onDelete=a}init(){for(let[e,r]of yc(this.dependencies,this.dependencySignals)){let i=this.uuid+"/"+_r();this.dependencySubscriptions.push(this.metadataManager.subscribe(i,r,e,()=>this.delete())),r.registerListener({callback:()=>void this.runEffect()})}this.runEffect()}async runEffect(){try{await this.effectFunction()}catch(e){let r=e instanceof Error?e:String(e);console.warn(new jt({errorLevel:"ERROR",effect:"Failed to run metadata effect",cause:r}))}}unsubscribe(){for(let e of this.dependencySubscriptions)e.unsubscribe();this.metadataManager.unsubscribe(this)}onUpdate(e){return!1}updatable(){return!1}getDependencies(){return this.dependencies}delete(){this.deleted=!0;for(let e of this.dependencySubscriptions)e.deleted||e.delete();this.onDelete(),this.unsubscribe()}};var zh=class{uuid;callbackSignal;value;metadataManager;bindTarget;deleted;onDelete;constructor(e,r,i,n,o){this.uuid=e,this.callbackSignal=r,this.metadataManager=i,this.bindTarget=n,this.onDelete=o,this.deleted=!1,this.value=void 0}unsubscribe(){this.metadataManager.unsubscribe(this)}write(e){let r=this.metadataManager.readShortLived(this.bindTarget);bs(r,e)||(this.value=e,this.metadataManager.write(e,this.bindTarget,this.uuid))}read(){return this.metadataManager.read(this.bindTarget)}onUpdate(e){try{if(!bs(this.value,e)){let r=structuredClone(e);return this.value=r,this.callbackSignal.set(r),!0}}catch(r){let i=r instanceof Error?r:String(r);console.warn(new jt({errorLevel:"ERROR",effect:"Failed to notify subscription of updated value in the cache",cause:i}))}return!1}updatable(){return!0}getDependencies(){return[]}delete(){this.deleted=!0,this.onDelete()}};var Sa=class{static get(e,r){return r.get(e).child}static tryGet(e,r){return r.tryGet(e)?.child}static fullGet(e,r){return r.get(e)}static set(e,r,i){r.set(e,i)}static setAndCreate(e,r,i){r.setAndCreate(e,i)}};var $Y=5,IY=300;function E0(t,e){return t===void 0||e===void 0||t.storageType!==e.storageType||t.storagePath!==e.storagePath?!1:FC(t.storageProp,e.storageProp,e.listenToChildren)}function FC(t,e,r){let i=t.path,n=e.path;for(let o=0;o<Math.min(i.length,n.length);o++)if(i[o].type!==n[o].type||i[o].prop!==n[o].prop)return!1;return i.length>n.length?r:!0}function FY(t){return t===void 0?"undefined":`${t.storagePath}#${t.storageProp.toString()}`}var bc=class{sources;defaultSource;constructor(){this.sources=new Map,this.defaultSource="CHANGE_THE_DEFAULT_SOURCE"}registerSource(e){this.sources.set(e.id,e)}setDefaultSource(e){if(this.sources.has(e))this.defaultSource=e;else throw new jt({errorLevel:"CRITICAL",effect:"can not set default source",cause:`Source "${e}" does not exist`})}unregisterSource(e){this.sources.delete(e.id)}getSource(e){return this.sources.get(e)}iterateSources(){return this.sources.keys()}subscribe(e,r,i,n){let o=new zh(e,r,this,i,n);return this.subscribeSubscription(o),o}subscribeDerived(e,r,i,n,o,a){let s=new Lh(e,this,r,i,n,o,a);return this.checkForLoops(s),s.init(),this.subscribeSubscription(s),s}subscribeEffect(e,r,i,n,o){let a=new Uh(e,this,r,i,n,o);return a.init(),this.subscribeSubscription(a),a}unsubscribe(e){if(e.bindTarget===void 0)return;let r=this.getSource(e.bindTarget.storageType);if(r===void 0)throw new jt({errorLevel:"ERROR",effect:"can not unsubscribe subscription",cause:`Source "${e.bindTarget.storageType}" does not exist`});let i=r.unsubscribe(e);i.subscriptions.length===0&&(i.cyclesWithoutListeners=0)}subscribeSubscription(e){if(e.bindTarget===void 0)return;let r=this.getSource(e.bindTarget.storageType);if(r===void 0)throw new jt({errorLevel:"ERROR",effect:"can not subscribe subscription",cause:`Source "${e.bindTarget.storageType}" does not exist`});let i=r.subscribe(e);i.cyclesWithoutListeners=0;let n=r.readCacheItem(i,e.bindTarget.storageProp);e.onUpdate(n)}checkForLoops(e){for(let r of this.getAllSubscriptionsToDependencies(e))this.recCheckForLoops([e,r])}recCheckForLoops(e){let r=e.at(0),i=e.at(-1);if(!(i===void 0||r===void 0)){if(E0(r.bindTarget,i.bindTarget))throw new Zm({errorLevel:"ERROR",effect:"bind target dependency loop detected",cause:`the loop is as follows: ${e.map(n=>`"${FY(n.bindTarget)}"`).join(" -> ")}`,docs:["https://mprojectscode.github.io/obsidian-meta-bind-plugin-docs/guides/viewfields/#circular-dependencies"]});for(let n of this.getAllSubscriptionsToDependencies(i))this.recCheckForLoops([...e,n])}}getAllSubscriptionsToDependencies(e){return e.getDependencies().map(r=>this.getAllSubscriptionsToBindTarget(r)).flat()}getAllSubscriptionsToBindTarget(e){if(e===void 0)return[];let r=this.getCacheItemForBindTarget(e);if(!r)return[];let i=[];for(let n of r.subscriptions)E0(n.bindTarget,e)&&i.push(n);return r.subscriptions.filter(n=>E0(n.bindTarget,e))}getCacheItemForBindTarget(e){return this.getSource(e.storageType)?.getCacheItemForStoragePath(e.storagePath)}async cycle(){let e=[];for(let r of this.sources.values())e.push(this.cycleSource(r));for(let r of await Promise.allSettled(e))r.status==="rejected"&&console.warn("meta-bind | MetadataManager >> failed to cycle source",r.reason)}async cycleSource(e){let r=[],i=await Promise.allSettled(e.getCacheItems().map(async n=>{if(e.onCycle(n),n.dirty)try{await e.syncExternal(n),n.dirty=!1}catch(o){console.warn(`failed to sync changes to external source for ${e.id}`,o)}n.externalWriteLock>0&&(n.externalWriteLock-=1),n.subscriptions.length===0&&(n.cyclesWithoutListeners+=1),n.cyclesWithoutListeners>IY&&e.shouldDelete(n)&&r.push(n)}));for(let n of i)n.status==="rejected"&&console.warn(`meta-bind | MetadataManager >> failed to cycle cache item in source ${e.id}`,n.reason)}write(e,r,i){let n=this.getSource(r.storageType);if(n===void 0)throw new jt({errorLevel:"ERROR",effect:"can not write to cache",cause:`Source "${r.storageType}" does not exist`});let o=n.writeCache(structuredClone(e),r);o.dirty=!0,o.externalWriteLock=$Y,this.notifyListeners(r,i)}read(e){let r=this.getSource(e.storageType);if(r===void 0)throw new jt({errorLevel:"ERROR",effect:"can not read metadata",cause:`Source "${e.storageType}" does not exist`});return structuredClone(r.readCache(e))}readShortLived(e){let r=this.getSource(e.storageType);if(r===void 0)throw new jt({errorLevel:"ERROR",effect:"can not read metadata",cause:`Source "${e.storageType}" does not exist`});return r.readCache(e)}isCacheExternalWriteLocked(e){return e.externalWriteLock>0}notifyListeners(e,r){let i=this.getSource(e.storageType);if(i===void 0)throw new jt({errorLevel:"ERROR",effect:"can notify listeners metadata",cause:`Source "${e.storageType}" does not exist`});let n=i.getCacheItemForStoragePath(e.storagePath);if(n!==void 0){for(let o of n.subscriptions)if(!(r!==void 0&&r===o.uuid||o.bindTarget===void 0||!o.updatable())&&FC(e.storageProp,o.bindTarget.storageProp,o.bindTarget.listenToChildren)){let a=i.readCache(o.bindTarget);o.onUpdate(a)}}}notifyAllListeners(e,r){for(let i of r.subscriptions){if(i.bindTarget===void 0)continue;let n=e.readCache(i.bindTarget);i.onUpdate(n)}}deleteCachesForStoragePath(e){for(let r of this.sources.values()){let i=r.getCacheItemForStoragePath(e);i!==void 0&&(i.subscriptions.forEach(n=>n.delete()),r.deleteCache(i))}}getDefaultCacheItem(){return{subscriptions:[],externalWriteLock:0,dirty:!1,cyclesWithoutListeners:0}}onExternalUpdate(e,r,i){let n=e.getCacheItemForStoragePath(r);if(n===void 0||this.isCacheExternalWriteLocked(n))return;e.writeEntireCache(i,n);let o=0;for(let a of n.subscriptions){if(a.bindTarget===void 0||!a.updatable())continue;let s=Sa.tryGet(i,a.bindTarget.storageProp);a.onUpdate(s)&&(o+=1)}}onStoragePathDeleted(e){this.deleteCachesForStoragePath(e)}onStoragePathRenamed(e,r){this.deleteCachesForStoragePath(e)}};var Vh=class{activeMountables;constructor(){this.activeMountables=new Map}unloadFile(e){for(let r of this.activeMountables.values())r.getFilePath()===e&&r.unmount()}unload(){for(let e of this.activeMountables.values())e.unmount()}registerMountable(e){this.activeMountables.set(e.getUuid(),e)}unregisterMountable(e){this.activeMountables.delete(e.getUuid())}};var gu=class t{path;constructor(e){this.path=e}get(e){if(this.path.length===0)throw new Error("can not use empty path to access object");let r=this.path[0].get(e);for(let i of this.path.slice(1))r=i.get(r.child);return r}tryGet(e){try{return this.get(e)}catch{return}}set(e,r){if(this.path.length===0)throw new Error("can not use empty path to access object");let i=this.path[0].get(e);for(let n of this.path.slice(1))i=n.get(i.child);i.access.set(i.parent,r)}setAndCreate(e,r){if(this.path.length===0)throw new Error("can not use empty path to access object");let i=this.path[0].get(e);i.child===void 0&&(i.access.set(i.parent,this.getNextPathElementValue(0,r)),i=i.access.get(i.parent));for(let n=1;n<this.path.length;n++)i=this.path[n].get(i.child),i.child===void 0&&(i.access.set(i.parent,this.getNextPathElementValue(n,r)),i=i.access.get(i.parent));i.access.set(i.parent,r)}getNextPathElement(e){return this.path[e+1]}getNextPathElementValue(e,r){let i=this.getNextPathElement(e);return i===void 0?r:i.type==="object"?{}:[]}toStringArray(){return this.path.map(e=>e.prop)}toString(){return this.toStringArray().join(".")}concat(e){return new t(this.path.concat(e.path))}compareDiffArray(e){let r=Math.min(this.path.length,e.length);for(let i=0;i<r;i++){let n=this.path[i],o=e[i];if(n.prop!==o.toString())return!1}return!0}};var qh=class{mb;constructor(e){this.mb=e}fromString(e){return fn(Ca,e)}fromStringAndValidate(e,r,i){return this.validate(e,this.fromString(e),r,i)}fromExistingDeclaration(e){if(e!==void 0)return{storageType:jo(e.storageType),storagePath:jo(e.storagePath),storageProp:e.storageProp.path.map(r=>r.toUnvalidatedPropAccess()),listenToChildren:e.listenToChildren}}validate(e,r,i,n){let o=new gu(r.storageProp.map(m=>new zu(m.type,m.prop.value))),a;r.storageType===void 0?a=this.mb.metadataManager.defaultSource:a=this.validateStorageType(r.storageType,e);let s=r.storagePath!==void 0,l=r.storagePath??{value:i},u=this.mb.metadataManager.getSource(a);if(u===void 0)throw new jt({errorLevel:"CRITICAL",effect:"can not validate bind target",cause:`Source '${a}' not found. But validation was successful. This should not happen.`,context:{fullDeclaration:e,sources:[...this.mb.metadataManager.sources.keys()]}});let c=u.validateStoragePath(l,s,e,this),f={storageType:a,storagePath:c,storageProp:o,listenToChildren:r.listenToChildren};return u.id==="scope"?this.resolveScope(f,n):f}resolveScope(e,r){if(r===void 0)throw new Pn("ERROR","Bind Target Scope Validator","Failed to resolve bind target scope, no scope provided");return e.storageType=r.scope.storageType,e.storagePath=r.scope.storagePath,e.storageProp=r.scope.storageProp.concat(e.storageProp),e}validateStorageType(e,r){for(let i of this.mb.metadataManager.iterateSources())if(i===e.value)return i;throw new Pn("ERROR","Bind Target Validator",`Encountered invalid identifier. Expected token to be a storage type but received '${e?.value}'.`,r,e?.position)}validateStoragePathAsFilePath(e,r){let i=e?.value;if(i===void 0)throw new Pn("ERROR","Bind Target Validator","Failed to parse bind target. Bind target storage path is undefined.",r,e?.position);let n=this.mb.file.getPathByName(i);if(n===void 0)throw new Pn("ERROR","Bind Target Validator",`Failed to parse bind target. Bind target file path '${i}' not found.`,r,e?.position);return n}};var RI=Ar(yo()),Zp=Ar(Ji());var ge={};hs(ge,{$brand:()=>T0,$input:()=>L1,$output:()=>R1,NEVER:()=>A0,TimePrecision:()=>V1,ZodAny:()=>tI,ZodArray:()=>oI,ZodBase64:()=>KS,ZodBase64URL:()=>QS,ZodBigInt:()=>jp,ZodBigIntFormat:()=>nD,ZodBoolean:()=>qp,ZodCIDRv4:()=>JS,ZodCIDRv6:()=>XS,ZodCUID:()=>qS,ZodCUID2:()=>jS,ZodCatch:()=>wI,ZodCustom:()=>qg,ZodCustomStringFormat:()=>rD,ZodDate:()=>zg,ZodDefault:()=>gI,ZodDiscriminatedUnion:()=>aI,ZodE164:()=>eD,ZodEmail:()=>LS,ZodEmoji:()=>zS,ZodEnum:()=>Up,ZodError:()=>TX,ZodFile:()=>dI,ZodFirstPartyTypeKind:()=>hD,ZodGUID:()=>Bg,ZodIPv4:()=>HS,ZodIPv6:()=>YS,ZodISODate:()=>Ig,ZodISODateTime:()=>$g,ZodISODuration:()=>kg,ZodISOTime:()=>Fg,ZodIntersection:()=>sI,ZodIssueCode:()=>kK,ZodJWT:()=>tD,ZodKSUID:()=>WS,ZodLazy:()=>NI,ZodLiteral:()=>mI,ZodMap:()=>fI,ZodNaN:()=>DI,ZodNanoID:()=>VS,ZodNever:()=>nI,ZodNonOptional:()=>mD,ZodNull:()=>Q$,ZodNullable:()=>hI,ZodNumber:()=>Vp,ZodNumberFormat:()=>Ic,ZodObject:()=>Vg,ZodOptional:()=>pD,ZodPipe:()=>dD,ZodPrefault:()=>yI,ZodPromise:()=>CI,ZodReadonly:()=>EI,ZodRealError:()=>$c,ZodRecord:()=>uD,ZodSet:()=>pI,ZodString:()=>zp,ZodStringFormat:()=>Kr,ZodSuccess:()=>_I,ZodSymbol:()=>X$,ZodTemplateLiteral:()=>TI,ZodTransform:()=>cD,ZodTuple:()=>lI,ZodType:()=>pr,ZodULID:()=>ZS,ZodURL:()=>US,ZodUUID:()=>Vs,ZodUndefined:()=>K$,ZodUnion:()=>aD,ZodUnknown:()=>rI,ZodVoid:()=>iI,ZodXID:()=>GS,_ZodString:()=>RS,_default:()=>vI,any:()=>uK,array:()=>oD,base64:()=>WX,base64url:()=>HX,bigint:()=>nK,boolean:()=>J$,catch:()=>SI,check:()=>NK,cidrv4:()=>ZX,cidrv6:()=>GX,clone:()=>ao,coerce:()=>gD,config:()=>Rn,core:()=>zs,cuid:()=>RX,cuid2:()=>LX,custom:()=>MK,date:()=>cK,discriminatedUnion:()=>hK,e164:()=>YX,email:()=>MX,emoji:()=>BX,endsWith:()=>Ip,enum:()=>lD,file:()=>wK,flattenError:()=>vp,float32:()=>QX,float64:()=>eK,formatError:()=>yp,function:()=>AS,getErrorMap:()=>BK,globalRegistry:()=>Wa,gt:()=>Ls,gte:()=>so,guid:()=>CX,hostname:()=>KX,includes:()=>Cp,instanceof:()=>CK,int:()=>OS,int32:()=>tK,int64:()=>iK,intersection:()=>uI,ipv4:()=>qX,ipv6:()=>jX,iso:()=>Pg,json:()=>IK,jwt:()=>JX,keyof:()=>fK,ksuid:()=>VX,lazy:()=>MI,length:()=>Cc,literal:()=>_K,locales:()=>Dp,looseObject:()=>dK,lowercase:()=>Np,lt:()=>Rs,lte:()=>ea,map:()=>yK,maxLength:()=>Mc,maxSize:()=>Nc,mime:()=>Fp,minLength:()=>bu,minSize:()=>dl,multipleOf:()=>ml,nan:()=>EK,nanoid:()=>OX,nativeEnum:()=>xK,negative:()=>gS,never:()=>iD,nonnegative:()=>yS,nonoptional:()=>xI,nonpositive:()=>vS,normalize:()=>kp,null:()=>eI,nullable:()=>Lg,nullish:()=>SK,number:()=>Y$,object:()=>pK,optional:()=>Rg,overwrite:()=>Us,parse:()=>IS,parseAsync:()=>FS,partialRecord:()=>vK,pipe:()=>Ug,positive:()=>hS,prefault:()=>bI,preprocess:()=>FK,prettifyError:()=>R0,promise:()=>TK,property:()=>bS,readonly:()=>AI,record:()=>cI,refine:()=>$I,regex:()=>Tp,regexes:()=>Os,registry:()=>sg,safeParse:()=>kS,safeParseAsync:()=>PS,set:()=>bK,setErrorMap:()=>PK,size:()=>Ap,startsWith:()=>$p,strictObject:()=>mK,string:()=>BS,stringFormat:()=>XX,stringbool:()=>$K,success:()=>DK,superRefine:()=>II,symbol:()=>aK,templateLiteral:()=>AK,toJSONSchema:()=>TS,toLowerCase:()=>Bp,toUpperCase:()=>Op,transform:()=>fD,treeifyError:()=>O0,trim:()=>Pp,tuple:()=>gK,uint32:()=>rK,uint64:()=>oK,ulid:()=>UX,undefined:()=>sK,union:()=>sD,unknown:()=>Og,uppercase:()=>Mp,url:()=>PX,uuid:()=>$X,uuidv4:()=>IX,uuidv6:()=>FX,uuidv7:()=>kX,void:()=>lK,xid:()=>zX});var zs={};hs(zs,{$ZodAny:()=>p1,$ZodArray:()=>_p,$ZodAsyncError:()=>Za,$ZodBase64:()=>r1,$ZodBase64URL:()=>n1,$ZodBigInt:()=>ig,$ZodBigIntFormat:()=>u1,$ZodBoolean:()=>xp,$ZodCIDRv4:()=>Qw,$ZodCIDRv6:()=>e1,$ZodCUID:()=>Vw,$ZodCUID2:()=>qw,$ZodCatch:()=>$1,$ZodCheck:()=>an,$ZodCheckBigIntFormat:()=>yw,$ZodCheckEndsWith:()=>Cw,$ZodCheckGreaterThan:()=>eg,$ZodCheckIncludes:()=>Nw,$ZodCheckLengthEquals:()=>Dw,$ZodCheckLessThan:()=>Qh,$ZodCheckLowerCase:()=>Aw,$ZodCheckMaxLength:()=>ww,$ZodCheckMaxSize:()=>bw,$ZodCheckMimeType:()=>Iw,$ZodCheckMinLength:()=>Sw,$ZodCheckMinSize:()=>xw,$ZodCheckMultipleOf:()=>gw,$ZodCheckNumberFormat:()=>vw,$ZodCheckOverwrite:()=>Fw,$ZodCheckProperty:()=>$w,$ZodCheckRegex:()=>Ew,$ZodCheckSizeEquals:()=>_w,$ZodCheckStartsWith:()=>Mw,$ZodCheckStringFormat:()=>Dc,$ZodCheckUpperCase:()=>Tw,$ZodCustom:()=>O1,$ZodCustomStringFormat:()=>a1,$ZodDate:()=>h1,$ZodDefault:()=>T1,$ZodDiscriminatedUnion:()=>v1,$ZodE164:()=>i1,$ZodEmail:()=>Rw,$ZodEmoji:()=>Uw,$ZodEnum:()=>w1,$ZodError:()=>gp,$ZodFile:()=>D1,$ZodFunction:()=>Cg,$ZodGUID:()=>Bw,$ZodIPv4:()=>Xw,$ZodIPv6:()=>Kw,$ZodISODate:()=>Hw,$ZodISODateTime:()=>Ww,$ZodISODuration:()=>Jw,$ZodISOTime:()=>Yw,$ZodIntersection:()=>y1,$ZodJWT:()=>o1,$ZodKSUID:()=>Gw,$ZodLazy:()=>B1,$ZodLiteral:()=>S1,$ZodMap:()=>x1,$ZodNaN:()=>I1,$ZodNanoID:()=>zw,$ZodNever:()=>m1,$ZodNonOptional:()=>M1,$ZodNull:()=>f1,$ZodNullable:()=>A1,$ZodNumber:()=>ng,$ZodNumberFormat:()=>s1,$ZodObject:()=>g1,$ZodOptional:()=>E1,$ZodPipe:()=>Sp,$ZodPrefault:()=>N1,$ZodPromise:()=>P1,$ZodReadonly:()=>F1,$ZodRealError:()=>Sc,$ZodRecord:()=>b1,$ZodRegistry:()=>Ac,$ZodSet:()=>_1,$ZodString:()=>fl,$ZodStringFormat:()=>Wr,$ZodSuccess:()=>C1,$ZodSymbol:()=>l1,$ZodTemplateLiteral:()=>k1,$ZodTransform:()=>wp,$ZodTuple:()=>pl,$ZodType:()=>ar,$ZodULID:()=>jw,$ZodURL:()=>Lw,$ZodUUID:()=>Ow,$ZodUndefined:()=>c1,$ZodUnion:()=>og,$ZodUnknown:()=>Ec,$ZodVoid:()=>d1,$ZodXID:()=>Zw,$brand:()=>T0,$constructor:()=>ye,$input:()=>L1,$output:()=>R1,Doc:()=>bp,JSONSchema:()=>G$,JSONSchemaGenerator:()=>Lp,NEVER:()=>A0,TimePrecision:()=>V1,_any:()=>lS,_array:()=>Rp,_base64:()=>Eg,_base64url:()=>Ag,_bigint:()=>rS,_boolean:()=>eS,_catch:()=>xX,_check:()=>Z$,_cidrv4:()=>Sg,_cidrv6:()=>Dg,_coercedBigint:()=>nS,_coercedBoolean:()=>tS,_coercedDate:()=>mS,_coercedNumber:()=>H1,_coercedString:()=>z1,_cuid:()=>gg,_cuid2:()=>vg,_custom:()=>wS,_date:()=>pS,_default:()=>vX,_discriminatedUnion:()=>aX,_e164:()=>Tg,_email:()=>ug,_emoji:()=>dg,_endsWith:()=>Ip,_enum:()=>fX,_file:()=>_S,_float32:()=>J1,_float64:()=>X1,_gt:()=>Ls,_gte:()=>so,_guid:()=>Ep,_includes:()=>Cp,_int:()=>Y1,_int32:()=>K1,_int64:()=>iS,_intersection:()=>sX,_ipv4:()=>_g,_ipv6:()=>wg,_isoDate:()=>j1,_isoDateTime:()=>q1,_isoDuration:()=>G1,_isoTime:()=>Z1,_jwt:()=>Ng,_ksuid:()=>xg,_lazy:()=>DX,_length:()=>Cc,_literal:()=>mX,_lowercase:()=>Np,_lt:()=>Rs,_lte:()=>ea,_map:()=>lX,_max:()=>ea,_maxLength:()=>Mc,_maxSize:()=>Nc,_mime:()=>Fp,_min:()=>so,_minLength:()=>bu,_minSize:()=>dl,_multipleOf:()=>ml,_nan:()=>dS,_nanoid:()=>hg,_nativeEnum:()=>pX,_negative:()=>gS,_never:()=>cS,_nonnegative:()=>yS,_nonoptional:()=>yX,_nonpositive:()=>vS,_normalize:()=>kp,_null:()=>uS,_nullable:()=>gX,_number:()=>W1,_optional:()=>hX,_overwrite:()=>Us,_parse:()=>Gh,_parseAsync:()=>Hh,_pipe:()=>_X,_positive:()=>hS,_promise:()=>EX,_property:()=>bS,_readonly:()=>wX,_record:()=>uX,_refine:()=>SS,_regex:()=>Tp,_safeParse:()=>Jh,_safeParseAsync:()=>Xh,_set:()=>cX,_size:()=>Ap,_startsWith:()=>$p,_string:()=>U1,_stringFormat:()=>Mg,_stringbool:()=>ES,_success:()=>bX,_superRefine:()=>DS,_symbol:()=>aS,_templateLiteral:()=>SX,_toLowerCase:()=>Bp,_toUpperCase:()=>Op,_transform:()=>dX,_trim:()=>Pp,_tuple:()=>xS,_uint32:()=>Q1,_uint64:()=>oS,_ulid:()=>yg,_undefined:()=>sS,_union:()=>oX,_unknown:()=>Tc,_uppercase:()=>Mp,_url:()=>mg,_uuid:()=>lg,_uuidv4:()=>cg,_uuidv6:()=>fg,_uuidv7:()=>pg,_void:()=>fS,_xid:()=>bg,clone:()=>ao,config:()=>Rn,flattenError:()=>vp,formatError:()=>yp,function:()=>AS,globalConfig:()=>up,globalRegistry:()=>Wa,isValidBase64:()=>t1,isValidBase64URL:()=>QC,isValidJWT:()=>e$,locales:()=>Dp,parse:()=>Wh,parseAsync:()=>Yh,prettifyError:()=>R0,regexes:()=>Os,registry:()=>sg,safeParse:()=>L0,safeParseAsync:()=>U0,toDotPath:()=>BC,toJSONSchema:()=>TS,treeifyError:()=>O0,util:()=>Ke,version:()=>kw});var A0=Object.freeze({status:"aborted"});function ye(t,e,r){function i(s,l){var u;Object.defineProperty(s,"_zod",{value:s._zod??{},enumerable:!1}),(u=s._zod).traits??(u.traits=new Set),s._zod.traits.add(t),e(s,l);for(let c in a.prototype)c in s||Object.defineProperty(s,c,{value:a.prototype[c].bind(s)});s._zod.constr=a,s._zod.def=l}let n=r?.Parent??Object;class o extends n{}Object.defineProperty(o,"name",{value:t});function a(s){var l;let u=r?.Parent?new o:this;i(u,s),(l=u._zod).deferred??(l.deferred=[]);for(let c of u._zod.deferred)c();return u}return Object.defineProperty(a,"init",{value:i}),Object.defineProperty(a,Symbol.hasInstance,{value:s=>r?.Parent&&s instanceof r.Parent?!0:s?._zod?.traits?.has(t)}),Object.defineProperty(a,"name",{value:t}),a}var T0=Symbol("zod_brand"),Za=class extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},up={};function Rn(t){return t&&Object.assign(up,t),up}var Ke={};hs(Ke,{BIGINT_FORMAT_RANGES:()=>B0,Class:()=>M0,NUMBER_FORMAT_RANGES:()=>P0,aborted:()=>ll,allowsEval:()=>$0,assert:()=>LY,assertEqual:()=>PY,assertIs:()=>OY,assertNever:()=>RY,assertNotEqual:()=>BY,assignProp:()=>sl,cached:()=>fp,captureStackTrace:()=>Zh,cleanEnum:()=>eJ,cleanRegex:()=>pp,clone:()=>ao,cloneDef:()=>zY,createTransparentProxy:()=>WY,defineLazy:()=>Tr,esc:()=>jh,escapeRegex:()=>Ga,extend:()=>JY,finalizeIssue:()=>Co,floatSafeRemainder:()=>C0,getElementAtPath:()=>VY,getEnumValues:()=>cp,getLengthableOrigin:()=>hp,getParsedType:()=>GY,getSizableOrigin:()=>dp,isObject:()=>xc,isPlainObject:()=>ul,issue:()=>wc,joinValues:()=>Ie,jsonStringifyReplacer:()=>_c,merge:()=>XY,mergeDefs:()=>yu,normalizeParams:()=>Ye,nullish:()=>vu,numKeys:()=>ZY,objectClone:()=>UY,omit:()=>YY,optionalKeys:()=>k0,partial:()=>KY,pick:()=>HY,prefixIssues:()=>Mo,primitiveTypes:()=>F0,promiseAllObject:()=>qY,propertyKeyTypes:()=>mp,randomString:()=>jY,required:()=>QY,shallowClone:()=>I0,stringifyPrimitive:()=>tt,unwrapMessage:()=>lp});function PY(t){return t}function BY(t){return t}function OY(t){}function RY(t){throw new Error}function LY(t){}function cp(t){let e=Object.values(t).filter(i=>typeof i=="number");return Object.entries(t).filter(([i,n])=>e.indexOf(+i)===-1).map(([i,n])=>n)}function Ie(t,e="|"){return t.map(r=>tt(r)).join(e)}function _c(t,e){return typeof e=="bigint"?e.toString():e}function fp(t){return{get value(){{let r=t();return Object.defineProperty(this,"value",{value:r}),r}throw new Error("cached value already set")}}}function vu(t){return t==null}function pp(t){let e=t.startsWith("^")?1:0,r=t.endsWith("$")?t.length-1:t.length;return t.slice(e,r)}function C0(t,e){let r=(t.toString().split(".")[1]||"").length,i=e.toString(),n=(i.split(".")[1]||"").length;if(n===0&&/\d?e-\d?/.test(i)){let l=i.match(/\d?e-(\d?)/);l?.[1]&&(n=Number.parseInt(l[1]))}let o=r>n?r:n,a=Number.parseInt(t.toFixed(o).replace(".","")),s=Number.parseInt(e.toFixed(o).replace(".",""));return a%s/10**o}var kC=Symbol("evaluating");function Tr(t,e,r){let i;Object.defineProperty(t,e,{get(){if(i!==kC)return i===void 0&&(i=kC,i=r()),i},set(n){Object.defineProperty(t,e,{value:n})},configurable:!0})}function UY(t){return Object.create(Object.getPrototypeOf(t),Object.getOwnPropertyDescriptors(t))}function sl(t,e,r){Object.defineProperty(t,e,{value:r,writable:!0,enumerable:!0,configurable:!0})}function yu(...t){let e={};for(let r of t){let i=Object.getOwnPropertyDescriptors(r);Object.assign(e,i)}return Object.defineProperties({},e)}function zY(t){return yu(t._zod.def)}function VY(t,e){return e?e.reduce((r,i)=>r?.[i],t):t}function qY(t){let e=Object.keys(t),r=e.map(i=>t[i]);return Promise.all(r).then(i=>{let n={};for(let o=0;o<e.length;o++)n[e[o]]=i[o];return n})}function jY(t=10){let e="abcdefghijklmnopqrstuvwxyz",r="";for(let i=0;i<t;i++)r+=e[Math.floor(Math.random()*e.length)];return r}function jh(t){return JSON.stringify(t)}var Zh="captureStackTrace"in Error?Error.captureStackTrace:(...t)=>{};function xc(t){return typeof t=="object"&&t!==null&&!Array.isArray(t)}var $0=fp(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let t=Function;return new t(""),!0}catch{return!1}});function ul(t){if(xc(t)===!1)return!1;let e=t.constructor;if(e===void 0)return!0;let r=e.prototype;return!(xc(r)===!1||Object.prototype.hasOwnProperty.call(r,"isPrototypeOf")===!1)}function I0(t){return ul(t)?{...t}:t}function ZY(t){let e=0;for(let r in t)Object.prototype.hasOwnProperty.call(t,r)&&e++;return e}var GY=t=>{let e=typeof t;switch(e){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN(t)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":return Array.isArray(t)?"array":t===null?"null":t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?"promise":typeof Map<"u"&&t instanceof Map?"map":typeof Set<"u"&&t instanceof Set?"set":typeof Date<"u"&&t instanceof Date?"date":typeof File<"u"&&t instanceof File?"file":"object";default:throw new Error(`Unknown data type: ${e}`)}},mp=new Set(["string","number","symbol"]),F0=new Set(["string","number","bigint","boolean","symbol","undefined"]);function Ga(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function ao(t,e,r){let i=new t._zod.constr(e??t._zod.def);return(!e||r?.parent)&&(i._zod.parent=t),i}function Ye(t){let e=t;if(!e)return{};if(typeof e=="string")return{error:()=>e};if(e?.message!==void 0){if(e?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");e.error=e.message}return delete e.message,typeof e.error=="string"?{...e,error:()=>e.error}:e}function WY(t){let e;return new Proxy({},{get(r,i,n){return e??(e=t()),Reflect.get(e,i,n)},set(r,i,n,o){return e??(e=t()),Reflect.set(e,i,n,o)},has(r,i){return e??(e=t()),Reflect.has(e,i)},deleteProperty(r,i){return e??(e=t()),Reflect.deleteProperty(e,i)},ownKeys(r){return e??(e=t()),Reflect.ownKeys(e)},getOwnPropertyDescriptor(r,i){return e??(e=t()),Reflect.getOwnPropertyDescriptor(e,i)},defineProperty(r,i,n){return e??(e=t()),Reflect.defineProperty(e,i,n)}})}function tt(t){return typeof t=="bigint"?t.toString()+"n":typeof t=="string"?`"${t}"`:`${t}`}function k0(t){return Object.keys(t).filter(e=>t[e]._zod.optin==="optional"&&t[e]._zod.optout==="optional")}var P0={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},B0={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};function HY(t,e){let r=t._zod.def,i=yu(t._zod.def,{get shape(){let n={};for(let o in e){if(!(o in r.shape))throw new Error(`Unrecognized key: "${o}"`);e[o]&&(n[o]=r.shape[o])}return sl(this,"shape",n),n},checks:[]});return ao(t,i)}function YY(t,e){let r=t._zod.def,i=yu(t._zod.def,{get shape(){let n={...t._zod.def.shape};for(let o in e){if(!(o in r.shape))throw new Error(`Unrecognized key: "${o}"`);e[o]&&delete n[o]}return sl(this,"shape",n),n},checks:[]});return ao(t,i)}function JY(t,e){if(!ul(e))throw new Error("Invalid input to extend: expected a plain object");let r=yu(t._zod.def,{get shape(){let i={...t._zod.def.shape,...e};return sl(this,"shape",i),i},checks:[]});return ao(t,r)}function XY(t,e){let r=yu(t._zod.def,{get shape(){let i={...t._zod.def.shape,...e._zod.def.shape};return sl(this,"shape",i),i},get catchall(){return e._zod.def.catchall},checks:[]});return ao(t,r)}function KY(t,e,r){let i=yu(e._zod.def,{get shape(){let n=e._zod.def.shape,o={...n};if(r)for(let a in r){if(!(a in n))throw new Error(`Unrecognized key: "${a}"`);r[a]&&(o[a]=t?new t({type:"optional",innerType:n[a]}):n[a])}else for(let a in n)o[a]=t?new t({type:"optional",innerType:n[a]}):n[a];return sl(this,"shape",o),o},checks:[]});return ao(e,i)}function QY(t,e,r){let i=yu(e._zod.def,{get shape(){let n=e._zod.def.shape,o={...n};if(r)for(let a in r){if(!(a in o))throw new Error(`Unrecognized key: "${a}"`);r[a]&&(o[a]=new t({type:"nonoptional",innerType:n[a]}))}else for(let a in n)o[a]=new t({type:"nonoptional",innerType:n[a]});return sl(this,"shape",o),o},checks:[]});return ao(e,i)}function ll(t,e=0){for(let r=e;r<t.issues.length;r++)if(t.issues[r]?.continue!==!0)return!0;return!1}function Mo(t,e){return e.map(r=>{var i;return(i=r).path??(i.path=[]),r.path.unshift(t),r})}function lp(t){return typeof t=="string"?t:t?.message}function Co(t,e,r){let i={...t,path:t.path??[]};if(!t.message){let n=lp(t.inst?._zod.def?.error?.(t))??lp(e?.error?.(t))??lp(r.customError?.(t))??lp(r.localeError?.(t))??"Invalid input";i.message=n}return delete i.inst,delete i.continue,e?.reportInput||delete i.input,i}function dp(t){return t instanceof Set?"set":t instanceof Map?"map":t instanceof File?"file":"unknown"}function hp(t){return Array.isArray(t)?"array":typeof t=="string"?"string":"unknown"}function wc(...t){let[e,r,i]=t;return typeof e=="string"?{message:e,code:"custom",input:r,inst:i}:{...e}}function eJ(t){return Object.entries(t).filter(([e,r])=>Number.isNaN(Number.parseInt(e,10))).map(e=>e[1])}var M0=class{constructor(...e){}};var PC=(t,e)=>{t.name="$ZodError",Object.defineProperty(t,"_zod",{value:t._zod,enumerable:!1}),Object.defineProperty(t,"issues",{value:e,enumerable:!1}),t.message=JSON.stringify(e,_c,2),Object.defineProperty(t,"toString",{value:()=>t.message,enumerable:!1})},gp=ye("$ZodError",PC),Sc=ye("$ZodError",PC,{Parent:Error});function vp(t,e=r=>r.message){let r={},i=[];for(let n of t.issues)n.path.length>0?(r[n.path[0]]=r[n.path[0]]||[],r[n.path[0]].push(e(n))):i.push(e(n));return{formErrors:i,fieldErrors:r}}function yp(t,e){let r=e||function(o){return o.message},i={_errors:[]},n=o=>{for(let a of o.issues)if(a.code==="invalid_union"&&a.errors.length)a.errors.map(s=>n({issues:s}));else if(a.code==="invalid_key")n({issues:a.issues});else if(a.code==="invalid_element")n({issues:a.issues});else if(a.path.length===0)i._errors.push(r(a));else{let s=i,l=0;for(;l<a.path.length;){let u=a.path[l];l===a.path.length-1?(s[u]=s[u]||{_errors:[]},s[u]._errors.push(r(a))):s[u]=s[u]||{_errors:[]},s=s[u],l++}}};return n(t),i}function O0(t,e){let r=e||function(o){return o.message},i={errors:[]},n=(o,a=[])=>{var s,l;for(let u of o.issues)if(u.code==="invalid_union"&&u.errors.length)u.errors.map(c=>n({issues:c},u.path));else if(u.code==="invalid_key")n({issues:u.issues},u.path);else if(u.code==="invalid_element")n({issues:u.issues},u.path);else{let c=[...a,...u.path];if(c.length===0){i.errors.push(r(u));continue}let f=i,m=0;for(;m<c.length;){let p=c[m],d=m===c.length-1;typeof p=="string"?(f.properties??(f.properties={}),(s=f.properties)[p]??(s[p]={errors:[]}),f=f.properties[p]):(f.items??(f.items=[]),(l=f.items)[p]??(l[p]={errors:[]}),f=f.items[p]),d&&f.errors.push(r(u)),m++}}};return n(t),i}function BC(t){let e=[],r=t.map(i=>typeof i=="object"?i.key:i);for(let i of r)typeof i=="number"?e.push(`[${i}]`):typeof i=="symbol"?e.push(`[${JSON.stringify(String(i))}]`):/[^\w$]/.test(i)?e.push(`[${JSON.stringify(i)}]`):(e.length&&e.push("."),e.push(i));return e.join("")}function R0(t){let e=[],r=[...t.issues].sort((i,n)=>(i.path??[]).length-(n.path??[]).length);for(let i of r)e.push(`\u2716 ${i.message}`),i.path?.length&&e.push(` \u2192 at ${BC(i.path)}`);return e.join(`
`)}var Gh=t=>(e,r,i,n)=>{let o=i?Object.assign(i,{async:!1}):{async:!1},a=e._zod.run({value:r,issues:[]},o);if(a instanceof Promise)throw new Za;if(a.issues.length){let s=new(n?.Err??t)(a.issues.map(l=>Co(l,o,Rn())));throw Zh(s,n?.callee),s}return a.value},Wh=Gh(Sc),Hh=t=>async(e,r,i,n)=>{let o=i?Object.assign(i,{async:!0}):{async:!0},a=e._zod.run({value:r,issues:[]},o);if(a instanceof Promise&&(a=await a),a.issues.length){let s=new(n?.Err??t)(a.issues.map(l=>Co(l,o,Rn())));throw Zh(s,n?.callee),s}return a.value},Yh=Hh(Sc),Jh=t=>(e,r,i)=>{let n=i?{...i,async:!1}:{async:!1},o=e._zod.run({value:r,issues:[]},n);if(o instanceof Promise)throw new Za;return o.issues.length?{success:!1,error:new(t??gp)(o.issues.map(a=>Co(a,n,Rn())))}:{success:!0,data:o.value}},L0=Jh(Sc),Xh=t=>async(e,r,i)=>{let n=i?Object.assign(i,{async:!0}):{async:!0},o=e._zod.run({value:r,issues:[]},n);return o instanceof Promise&&(o=await o),o.issues.length?{success:!1,error:new t(o.issues.map(a=>Co(a,n,Rn())))}:{success:!0,data:o.value}},U0=Xh(Sc);var Os={};hs(Os,{base64:()=>tw,base64url:()=>Kh,bigint:()=>uw,boolean:()=>fw,browserEmail:()=>cJ,cidrv4:()=>Q0,cidrv6:()=>ew,cuid:()=>z0,cuid2:()=>V0,date:()=>iw,datetime:()=>aw,domain:()=>pJ,duration:()=>W0,e164:()=>nw,email:()=>Y0,emoji:()=>J0,extendedDuration:()=>rJ,guid:()=>H0,hostname:()=>rw,html5Email:()=>aJ,idnEmail:()=>lJ,integer:()=>lw,ipv4:()=>X0,ipv6:()=>K0,ksuid:()=>Z0,lowercase:()=>dw,nanoid:()=>G0,null:()=>pw,number:()=>cw,rfc5322Email:()=>sJ,string:()=>sw,time:()=>ow,ulid:()=>q0,undefined:()=>mw,unicodeEmail:()=>uJ,uppercase:()=>hw,uuid:()=>cl,uuid4:()=>nJ,uuid6:()=>iJ,uuid7:()=>oJ,xid:()=>j0});var z0=/^[cC][^\s-]{8,}$/,V0=/^[0-9a-z]+$/,q0=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,j0=/^[0-9a-vA-V]{20}$/,Z0=/^[A-Za-z0-9]{27}$/,G0=/^[a-zA-Z0-9_-]{21}$/,W0=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,rJ=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,H0=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,cl=t=>t?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${t}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000)$/,nJ=cl(4),iJ=cl(6),oJ=cl(7),Y0=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,aJ=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[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])?)*$/,sJ=/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,uJ=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,lJ=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,cJ=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[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])?)*$/,fJ="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";function J0(){return new RegExp(fJ,"u")}var X0=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,K0=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})$/,Q0=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,ew=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,tw=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Kh=/^[A-Za-z0-9_-]*$/,rw=/^(?=.{1,253}\.?$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?)*\.?$/,pJ=/^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/,nw=/^\+(?:[0-9]){6,14}[0-9]$/,OC="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",iw=new RegExp(`^${OC}$`);function RC(t){let e="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof t.precision=="number"?t.precision===-1?`${e}`:t.precision===0?`${e}:[0-5]\\d`:`${e}:[0-5]\\d\\.\\d{${t.precision}}`:`${e}(?::[0-5]\\d(?:\\.\\d+)?)?`}function ow(t){return new RegExp(`^${RC(t)}$`)}function aw(t){let e=RC({precision:t.precision}),r=["Z"];t.local&&r.push(""),t.offset&&r.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let i=`${e}(?:${r.join("|")})`;return new RegExp(`^${OC}T(?:${i})$`)}var sw=t=>{let e=t?`[\\s\\S]{${t?.minimum??0},${t?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${e}$`)},uw=/^\d+n?$/,lw=/^\d+$/,cw=/^-?\d+(?:\.\d+)?/i,fw=/true|false/i,pw=/null/i;var mw=/undefined/i;var dw=/^[^A-Z]*$/,hw=/^[^a-z]*$/;var an=ye("$ZodCheck",(t,e)=>{var r;t._zod??(t._zod={}),t._zod.def=e,(r=t._zod).onattach??(r.onattach=[])}),UC={number:"number",bigint:"bigint",object:"date"},Qh=ye("$ZodCheckLessThan",(t,e)=>{an.init(t,e);let r=UC[typeof e.value];t._zod.onattach.push(i=>{let n=i._zod.bag,o=(e.inclusive?n.maximum:n.exclusiveMaximum)??Number.POSITIVE_INFINITY;e.value<o&&(e.inclusive?n.maximum=e.value:n.exclusiveMaximum=e.value)}),t._zod.check=i=>{(e.inclusive?i.value<=e.value:i.value<e.value)||i.issues.push({origin:r,code:"too_big",maximum:e.value,input:i.value,inclusive:e.inclusive,inst:t,continue:!e.abort})}}),eg=ye("$ZodCheckGreaterThan",(t,e)=>{an.init(t,e);let r=UC[typeof e.value];t._zod.onattach.push(i=>{let n=i._zod.bag,o=(e.inclusive?n.minimum:n.exclusiveMinimum)??Number.NEGATIVE_INFINITY;e.value>o&&(e.inclusive?n.minimum=e.value:n.exclusiveMinimum=e.value)}),t._zod.check=i=>{(e.inclusive?i.value>=e.value:i.value>e.value)||i.issues.push({origin:r,code:"too_small",minimum:e.value,input:i.value,inclusive:e.inclusive,inst:t,continue:!e.abort})}}),gw=ye("$ZodCheckMultipleOf",(t,e)=>{an.init(t,e),t._zod.onattach.push(r=>{var i;(i=r._zod.bag).multipleOf??(i.multipleOf=e.value)}),t._zod.check=r=>{if(typeof r.value!=typeof e.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof r.value=="bigint"?r.value%e.value===BigInt(0):C0(r.value,e.value)===0)||r.issues.push({origin:typeof r.value,code:"not_multiple_of",divisor:e.value,input:r.value,inst:t,continue:!e.abort})}}),vw=ye("$ZodCheckNumberFormat",(t,e)=>{an.init(t,e),e.format=e.format||"float64";let r=e.format?.includes("int"),i=r?"int":"number",[n,o]=P0[e.format];t._zod.onattach.push(a=>{let s=a._zod.bag;s.format=e.format,s.minimum=n,s.maximum=o,r&&(s.pattern=lw)}),t._zod.check=a=>{let s=a.value;if(r){if(!Number.isInteger(s)){a.issues.push({expected:i,format:e.format,code:"invalid_type",continue:!1,input:s,inst:t});return}if(!Number.isSafeInteger(s)){s>0?a.issues.push({input:s,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:t,origin:i,continue:!e.abort}):a.issues.push({input:s,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:t,origin:i,continue:!e.abort});return}}s<n&&a.issues.push({origin:"number",input:s,code:"too_small",minimum:n,inclusive:!0,inst:t,continue:!e.abort}),s>o&&a.issues.push({origin:"number",input:s,code:"too_big",maximum:o,inst:t})}}),yw=ye("$ZodCheckBigIntFormat",(t,e)=>{an.init(t,e);let[r,i]=B0[e.format];t._zod.onattach.push(n=>{let o=n._zod.bag;o.format=e.format,o.minimum=r,o.maximum=i}),t._zod.check=n=>{let o=n.value;o<r&&n.issues.push({origin:"bigint",input:o,code:"too_small",minimum:r,inclusive:!0,inst:t,continue:!e.abort}),o>i&&n.issues.push({origin:"bigint",input:o,code:"too_big",maximum:i,inst:t})}}),bw=ye("$ZodCheckMaxSize",(t,e)=>{var r;an.init(t,e),(r=t._zod.def).when??(r.when=i=>{let n=i.value;return!vu(n)&&n.size!==void 0}),t._zod.onattach.push(i=>{let n=i._zod.bag.maximum??Number.POSITIVE_INFINITY;e.maximum<n&&(i._zod.bag.maximum=e.maximum)}),t._zod.check=i=>{let n=i.value;n.size<=e.maximum||i.issues.push({origin:dp(n),code:"too_big",maximum:e.maximum,input:n,inst:t,continue:!e.abort})}}),xw=ye("$ZodCheckMinSize",(t,e)=>{var r;an.init(t,e),(r=t._zod.def).when??(r.when=i=>{let n=i.value;return!vu(n)&&n.size!==void 0}),t._zod.onattach.push(i=>{let n=i._zod.bag.minimum??Number.NEGATIVE_INFINITY;e.minimum>n&&(i._zod.bag.minimum=e.minimum)}),t._zod.check=i=>{let n=i.value;n.size>=e.minimum||i.issues.push({origin:dp(n),code:"too_small",minimum:e.minimum,input:n,inst:t,continue:!e.abort})}}),_w=ye("$ZodCheckSizeEquals",(t,e)=>{var r;an.init(t,e),(r=t._zod.def).when??(r.when=i=>{let n=i.value;return!vu(n)&&n.size!==void 0}),t._zod.onattach.push(i=>{let n=i._zod.bag;n.minimum=e.size,n.maximum=e.size,n.size=e.size}),t._zod.check=i=>{let n=i.value,o=n.size;if(o===e.size)return;let a=o>e.size;i.issues.push({origin:dp(n),...a?{code:"too_big",maximum:e.size}:{code:"too_small",minimum:e.size},inclusive:!0,exact:!0,input:i.value,inst:t,continue:!e.abort})}}),ww=ye("$ZodCheckMaxLength",(t,e)=>{var r;an.init(t,e),(r=t._zod.def).when??(r.when=i=>{let n=i.value;return!vu(n)&&n.length!==void 0}),t._zod.onattach.push(i=>{let n=i._zod.bag.maximum??Number.POSITIVE_INFINITY;e.maximum<n&&(i._zod.bag.maximum=e.maximum)}),t._zod.check=i=>{let n=i.value;if(n.length<=e.maximum)return;let a=hp(n);i.issues.push({origin:a,code:"too_big",maximum:e.maximum,inclusive:!0,input:n,inst:t,continue:!e.abort})}}),Sw=ye("$ZodCheckMinLength",(t,e)=>{var r;an.init(t,e),(r=t._zod.def).when??(r.when=i=>{let n=i.value;return!vu(n)&&n.length!==void 0}),t._zod.onattach.push(i=>{let n=i._zod.bag.minimum??Number.NEGATIVE_INFINITY;e.minimum>n&&(i._zod.bag.minimum=e.minimum)}),t._zod.check=i=>{let n=i.value;if(n.length>=e.minimum)return;let a=hp(n);i.issues.push({origin:a,code:"too_small",minimum:e.minimum,inclusive:!0,input:n,inst:t,continue:!e.abort})}}),Dw=ye("$ZodCheckLengthEquals",(t,e)=>{var r;an.init(t,e),(r=t._zod.def).when??(r.when=i=>{let n=i.value;return!vu(n)&&n.length!==void 0}),t._zod.onattach.push(i=>{let n=i._zod.bag;n.minimum=e.length,n.maximum=e.length,n.length=e.length}),t._zod.check=i=>{let n=i.value,o=n.length;if(o===e.length)return;let a=hp(n),s=o>e.length;i.issues.push({origin:a,...s?{code:"too_big",maximum:e.length}:{code:"too_small",minimum:e.length},inclusive:!0,exact:!0,input:i.value,inst:t,continue:!e.abort})}}),Dc=ye("$ZodCheckStringFormat",(t,e)=>{var r,i;an.init(t,e),t._zod.onattach.push(n=>{let o=n._zod.bag;o.format=e.format,e.pattern&&(o.patterns??(o.patterns=new Set),o.patterns.add(e.pattern))}),e.pattern?(r=t._zod).check??(r.check=n=>{e.pattern.lastIndex=0,!e.pattern.test(n.value)&&n.issues.push({origin:"string",code:"invalid_format",format:e.format,input:n.value,...e.pattern?{pattern:e.pattern.toString()}:{},inst:t,continue:!e.abort})}):(i=t._zod).check??(i.check=()=>{})}),Ew=ye("$ZodCheckRegex",(t,e)=>{Dc.init(t,e),t._zod.check=r=>{e.pattern.lastIndex=0,!e.pattern.test(r.value)&&r.issues.push({origin:"string",code:"invalid_format",format:"regex",input:r.value,pattern:e.pattern.toString(),inst:t,continue:!e.abort})}}),Aw=ye("$ZodCheckLowerCase",(t,e)=>{e.pattern??(e.pattern=dw),Dc.init(t,e)}),Tw=ye("$ZodCheckUpperCase",(t,e)=>{e.pattern??(e.pattern=hw),Dc.init(t,e)}),Nw=ye("$ZodCheckIncludes",(t,e)=>{an.init(t,e);let r=Ga(e.includes),i=new RegExp(typeof e.position=="number"?`^.{${e.position}}${r}`:r);e.pattern=i,t._zod.onattach.push(n=>{let o=n._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(i)}),t._zod.check=n=>{n.value.includes(e.includes,e.position)||n.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:e.includes,input:n.value,inst:t,continue:!e.abort})}}),Mw=ye("$ZodCheckStartsWith",(t,e)=>{an.init(t,e);let r=new RegExp(`^${Ga(e.prefix)}.*`);e.pattern??(e.pattern=r),t._zod.onattach.push(i=>{let n=i._zod.bag;n.patterns??(n.patterns=new Set),n.patterns.add(r)}),t._zod.check=i=>{i.value.startsWith(e.prefix)||i.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:e.prefix,input:i.value,inst:t,continue:!e.abort})}}),Cw=ye("$ZodCheckEndsWith",(t,e)=>{an.init(t,e);let r=new RegExp(`.*${Ga(e.suffix)}$`);e.pattern??(e.pattern=r),t._zod.onattach.push(i=>{let n=i._zod.bag;n.patterns??(n.patterns=new Set),n.patterns.add(r)}),t._zod.check=i=>{i.value.endsWith(e.suffix)||i.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:e.suffix,input:i.value,inst:t,continue:!e.abort})}});function LC(t,e,r){t.issues.length&&e.issues.push(...Mo(r,t.issues))}var $w=ye("$ZodCheckProperty",(t,e)=>{an.init(t,e),t._zod.check=r=>{let i=e.schema._zod.run({value:r.value[e.property],issues:[]},{});if(i instanceof Promise)return i.then(n=>LC(n,r,e.property));LC(i,r,e.property)}}),Iw=ye("$ZodCheckMimeType",(t,e)=>{an.init(t,e);let r=new Set(e.mime);t._zod.onattach.push(i=>{i._zod.bag.mime=e.mime}),t._zod.check=i=>{r.has(i.value.type)||i.issues.push({code:"invalid_value",values:e.mime,input:i.value.type,inst:t,continue:!e.abort})}}),Fw=ye("$ZodCheckOverwrite",(t,e)=>{an.init(t,e),t._zod.check=r=>{r.value=e.tx(r.value)}});var bp=class{constructor(e=[]){this.content=[],this.indent=0,this&&(this.args=e)}indented(e){this.indent+=1,e(this),this.indent-=1}write(e){if(typeof e=="function"){e(this,{execution:"sync"}),e(this,{execution:"async"});return}let i=e.split(`
`).filter(a=>a),n=Math.min(...i.map(a=>a.length-a.trimStart().length)),o=i.map(a=>a.slice(n)).map(a=>" ".repeat(this.indent*2)+a);for(let a of o)this.content.push(a)}compile(){let e=Function,r=this?.args,n=[...(this?.content??[""]).map(o=>` ${o}`)];return new e(...r,n.join(`
`))}};var kw={major:4,minor:0,patch:17};var ar=ye("$ZodType",(t,e)=>{var r;t??(t={}),t._zod.def=e,t._zod.bag=t._zod.bag||{},t._zod.version=kw;let i=[...t._zod.def.checks??[]];t._zod.traits.has("$ZodCheck")&&i.unshift(t);for(let n of i)for(let o of n._zod.onattach)o(t);if(i.length===0)(r=t._zod).deferred??(r.deferred=[]),t._zod.deferred?.push(()=>{t._zod.run=t._zod.parse});else{let n=(o,a,s)=>{let l=ll(o),u;for(let c of a){if(c._zod.def.when){if(!c._zod.def.when(o))continue}else if(l)continue;let f=o.issues.length,m=c._zod.check(o);if(m instanceof Promise&&s?.async===!1)throw new Za;if(u||m instanceof Promise)u=(u??Promise.resolve()).then(async()=>{await m,o.issues.length!==f&&(l||(l=ll(o,f)))});else{if(o.issues.length===f)continue;l||(l=ll(o,f))}}return u?u.then(()=>o):o};t._zod.run=(o,a)=>{let s=t._zod.parse(o,a);if(s instanceof Promise){if(a.async===!1)throw new Za;return s.then(l=>n(l,i,a))}return n(s,i,a)}}t["~standard"]={validate:n=>{try{let o=L0(t,n);return o.success?{value:o.data}:{issues:o.error?.issues}}catch{return U0(t,n).then(a=>a.success?{value:a.data}:{issues:a.error?.issues})}},vendor:"zod",version:1}}),fl=ye("$ZodString",(t,e)=>{ar.init(t,e),t._zod.pattern=[...t?._zod.bag?.patterns??[]].pop()??sw(t._zod.bag),t._zod.parse=(r,i)=>{if(e.coerce)try{r.value=String(r.value)}catch{}return typeof r.value=="string"||r.issues.push({expected:"string",code:"invalid_type",input:r.value,inst:t}),r}}),Wr=ye("$ZodStringFormat",(t,e)=>{Dc.init(t,e),fl.init(t,e)}),Bw=ye("$ZodGUID",(t,e)=>{e.pattern??(e.pattern=H0),Wr.init(t,e)}),Ow=ye("$ZodUUID",(t,e)=>{if(e.version){let i={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[e.version];if(i===void 0)throw new Error(`Invalid UUID version: "${e.version}"`);e.pattern??(e.pattern=cl(i))}else e.pattern??(e.pattern=cl());Wr.init(t,e)}),Rw=ye("$ZodEmail",(t,e)=>{e.pattern??(e.pattern=Y0),Wr.init(t,e)}),Lw=ye("$ZodURL",(t,e)=>{Wr.init(t,e),t._zod.check=r=>{try{let i=r.value.trim(),n=new URL(i);e.hostname&&(e.hostname.lastIndex=0,e.hostname.test(n.hostname)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:rw.source,input:r.value,inst:t,continue:!e.abort})),e.protocol&&(e.protocol.lastIndex=0,e.protocol.test(n.protocol.endsWith(":")?n.protocol.slice(0,-1):n.protocol)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:e.protocol.source,input:r.value,inst:t,continue:!e.abort})),e.normalize?r.value=n.href:r.value=i;return}catch{r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:t,continue:!e.abort})}}}),Uw=ye("$ZodEmoji",(t,e)=>{e.pattern??(e.pattern=J0()),Wr.init(t,e)}),zw=ye("$ZodNanoID",(t,e)=>{e.pattern??(e.pattern=G0),Wr.init(t,e)}),Vw=ye("$ZodCUID",(t,e)=>{e.pattern??(e.pattern=z0),Wr.init(t,e)}),qw=ye("$ZodCUID2",(t,e)=>{e.pattern??(e.pattern=V0),Wr.init(t,e)}),jw=ye("$ZodULID",(t,e)=>{e.pattern??(e.pattern=q0),Wr.init(t,e)}),Zw=ye("$ZodXID",(t,e)=>{e.pattern??(e.pattern=j0),Wr.init(t,e)}),Gw=ye("$ZodKSUID",(t,e)=>{e.pattern??(e.pattern=Z0),Wr.init(t,e)}),Ww=ye("$ZodISODateTime",(t,e)=>{e.pattern??(e.pattern=aw(e)),Wr.init(t,e)}),Hw=ye("$ZodISODate",(t,e)=>{e.pattern??(e.pattern=iw),Wr.init(t,e)}),Yw=ye("$ZodISOTime",(t,e)=>{e.pattern??(e.pattern=ow(e)),Wr.init(t,e)}),Jw=ye("$ZodISODuration",(t,e)=>{e.pattern??(e.pattern=W0),Wr.init(t,e)}),Xw=ye("$ZodIPv4",(t,e)=>{e.pattern??(e.pattern=X0),Wr.init(t,e),t._zod.onattach.push(r=>{let i=r._zod.bag;i.format="ipv4"})}),Kw=ye("$ZodIPv6",(t,e)=>{e.pattern??(e.pattern=K0),Wr.init(t,e),t._zod.onattach.push(r=>{let i=r._zod.bag;i.format="ipv6"}),t._zod.check=r=>{try{new URL(`http://[${r.value}]`)}catch{r.issues.push({code:"invalid_format",format:"ipv6",input:r.value,inst:t,continue:!e.abort})}}}),Qw=ye("$ZodCIDRv4",(t,e)=>{e.pattern??(e.pattern=Q0),Wr.init(t,e)}),e1=ye("$ZodCIDRv6",(t,e)=>{e.pattern??(e.pattern=ew),Wr.init(t,e),t._zod.check=r=>{let[i,n]=r.value.split("/");try{if(!n)throw new Error;let o=Number(n);if(`${o}`!==n)throw new Error;if(o<0||o>128)throw new Error;new URL(`http://[${i}]`)}catch{r.issues.push({code:"invalid_format",format:"cidrv6",input:r.value,inst:t,continue:!e.abort})}}});function t1(t){if(t==="")return!0;if(t.length%4!==0)return!1;try{return atob(t),!0}catch{return!1}}var r1=ye("$ZodBase64",(t,e)=>{e.pattern??(e.pattern=tw),Wr.init(t,e),t._zod.onattach.push(r=>{r._zod.bag.contentEncoding="base64"}),t._zod.check=r=>{t1(r.value)||r.issues.push({code:"invalid_format",format:"base64",input:r.value,inst:t,continue:!e.abort})}});function QC(t){if(!Kh.test(t))return!1;let e=t.replace(/[-_]/g,i=>i==="-"?"+":"/"),r=e.padEnd(Math.ceil(e.length/4)*4,"=");return t1(r)}var n1=ye("$ZodBase64URL",(t,e)=>{e.pattern??(e.pattern=Kh),Wr.init(t,e),t._zod.onattach.push(r=>{r._zod.bag.contentEncoding="base64url"}),t._zod.check=r=>{QC(r.value)||r.issues.push({code:"invalid_format",format:"base64url",input:r.value,inst:t,continue:!e.abort})}}),i1=ye("$ZodE164",(t,e)=>{e.pattern??(e.pattern=nw),Wr.init(t,e)});function e$(t,e=null){try{let r=t.split(".");if(r.length!==3)return!1;let[i]=r;if(!i)return!1;let n=JSON.parse(atob(i));return!("typ"in n&&n?.typ!=="JWT"||!n.alg||e&&(!("alg"in n)||n.alg!==e))}catch{return!1}}var o1=ye("$ZodJWT",(t,e)=>{Wr.init(t,e),t._zod.check=r=>{e$(r.value,e.alg)||r.issues.push({code:"invalid_format",format:"jwt",input:r.value,inst:t,continue:!e.abort})}}),a1=ye("$ZodCustomStringFormat",(t,e)=>{Wr.init(t,e),t._zod.check=r=>{e.fn(r.value)||r.issues.push({code:"invalid_format",format:e.format,input:r.value,inst:t,continue:!e.abort})}}),ng=ye("$ZodNumber",(t,e)=>{ar.init(t,e),t._zod.pattern=t._zod.bag.pattern??cw,t._zod.parse=(r,i)=>{if(e.coerce)try{r.value=Number(r.value)}catch{}let n=r.value;if(typeof n=="number"&&!Number.isNaN(n)&&Number.isFinite(n))return r;let o=typeof n=="number"?Number.isNaN(n)?"NaN":Number.isFinite(n)?void 0:"Infinity":void 0;return r.issues.push({expected:"number",code:"invalid_type",input:n,inst:t,...o?{received:o}:{}}),r}}),s1=ye("$ZodNumber",(t,e)=>{vw.init(t,e),ng.init(t,e)}),xp=ye("$ZodBoolean",(t,e)=>{ar.init(t,e),t._zod.pattern=fw,t._zod.parse=(r,i)=>{if(e.coerce)try{r.value=!!r.value}catch{}let n=r.value;return typeof n=="boolean"||r.issues.push({expected:"boolean",code:"invalid_type",input:n,inst:t}),r}}),ig=ye("$ZodBigInt",(t,e)=>{ar.init(t,e),t._zod.pattern=uw,t._zod.parse=(r,i)=>{if(e.coerce)try{r.value=BigInt(r.value)}catch{}return typeof r.value=="bigint"||r.issues.push({expected:"bigint",code:"invalid_type",input:r.value,inst:t}),r}}),u1=ye("$ZodBigInt",(t,e)=>{yw.init(t,e),ig.init(t,e)}),l1=ye("$ZodSymbol",(t,e)=>{ar.init(t,e),t._zod.parse=(r,i)=>{let n=r.value;return typeof n=="symbol"||r.issues.push({expected:"symbol",code:"invalid_type",input:n,inst:t}),r}}),c1=ye("$ZodUndefined",(t,e)=>{ar.init(t,e),t._zod.pattern=mw,t._zod.values=new Set([void 0]),t._zod.optin="optional",t._zod.optout="optional",t._zod.parse=(r,i)=>{let n=r.value;return typeof n>"u"||r.issues.push({expected:"undefined",code:"invalid_type",input:n,inst:t}),r}}),f1=ye("$ZodNull",(t,e)=>{ar.init(t,e),t._zod.pattern=pw,t._zod.values=new Set([null]),t._zod.parse=(r,i)=>{let n=r.value;return n===null||r.issues.push({expected:"null",code:"invalid_type",input:n,inst:t}),r}}),p1=ye("$ZodAny",(t,e)=>{ar.init(t,e),t._zod.parse=r=>r}),Ec=ye("$ZodUnknown",(t,e)=>{ar.init(t,e),t._zod.parse=r=>r}),m1=ye("$ZodNever",(t,e)=>{ar.init(t,e),t._zod.parse=(r,i)=>(r.issues.push({expected:"never",code:"invalid_type",input:r.value,inst:t}),r)}),d1=ye("$ZodVoid",(t,e)=>{ar.init(t,e),t._zod.parse=(r,i)=>{let n=r.value;return typeof n>"u"||r.issues.push({expected:"void",code:"invalid_type",input:n,inst:t}),r}}),h1=ye("$ZodDate",(t,e)=>{ar.init(t,e),t._zod.parse=(r,i)=>{if(e.coerce)try{r.value=new Date(r.value)}catch{}let n=r.value,o=n instanceof Date;return o&&!Number.isNaN(n.getTime())||r.issues.push({expected:"date",code:"invalid_type",input:n,...o?{received:"Invalid Date"}:{},inst:t}),r}});function VC(t,e,r){t.issues.length&&e.issues.push(...Mo(r,t.issues)),e.value[r]=t.value}var _p=ye("$ZodArray",(t,e)=>{ar.init(t,e),t._zod.parse=(r,i)=>{let n=r.value;if(!Array.isArray(n))return r.issues.push({expected:"array",code:"invalid_type",input:n,inst:t}),r;r.value=Array(n.length);let o=[];for(let a=0;a<n.length;a++){let s=n[a],l=e.element._zod.run({value:s,issues:[]},i);l instanceof Promise?o.push(l.then(u=>VC(u,r,a))):VC(l,r,a)}return o.length?Promise.all(o).then(()=>r):r}});function tg(t,e,r,i){t.issues.length&&e.issues.push(...Mo(r,t.issues)),t.value===void 0?r in i&&(e.value[r]=void 0):e.value[r]=t.value}var g1=ye("$ZodObject",(t,e)=>{ar.init(t,e);let r=fp(()=>{let f=Object.keys(e.shape);for(let p of f)if(!e.shape[p]._zod.traits.has("$ZodType"))throw new Error(`Invalid element at key "${p}": expected a Zod schema`);let m=k0(e.shape);return{shape:e.shape,keys:f,keySet:new Set(f),numKeys:f.length,optionalKeys:new Set(m)}});Tr(t._zod,"propValues",()=>{let f=e.shape,m={};for(let p in f){let d=f[p]._zod;if(d.values){m[p]??(m[p]=new Set);for(let h of d.values)m[p].add(h)}}return m});let i=f=>{let m=new bp(["shape","payload","ctx"]),p=r.value,d=S=>{let b=jh(S);return`shape[${b}]._zod.run({ value: input[${b}], issues: [] }, ctx)`};m.write("const input = payload.value;");let h=Object.create(null),v=0;for(let S of p.keys)h[S]=`key_${v++}`;m.write("const newResult = {}");for(let S of p.keys){let b=h[S],_=jh(S);m.write(`const ${b} = ${d(S)};`),m.write(`
if (${b}.issues.length) {
payload.issues = payload.issues.concat(${b}.issues.map(iss => ({
...iss,
path: iss.path ? [${_}, ...iss.path] : [${_}]
})));
}
if (${b}.value === undefined) {
if (${_} in input) {
newResult[${_}] = undefined;
}
} else {
newResult[${_}] = ${b}.value;
}
`)}m.write("payload.value = newResult;"),m.write("return payload;");let y=m.compile();return(S,b)=>y(f,S,b)},n,o=xc,a=!up.jitless,l=a&&$0.value,u=e.catchall,c;t._zod.parse=(f,m)=>{c??(c=r.value);let p=f.value;if(!o(p))return f.issues.push({expected:"object",code:"invalid_type",input:p,inst:t}),f;let d=[];if(a&&l&&m?.async===!1&&m.jitless!==!0)n||(n=i(e.shape)),f=n(f,m);else{f.value={};let b=c.shape;for(let _ of c.keys){let x=b[_]._zod.run({value:p[_],issues:[]},m);x instanceof Promise?d.push(x.then(E=>tg(E,f,_,p))):tg(x,f,_,p)}}if(!u)return d.length?Promise.all(d).then(()=>f):f;let h=[],v=c.keySet,y=u._zod,S=y.def.type;for(let b of Object.keys(p)){if(v.has(b))continue;if(S==="never"){h.push(b);continue}let _=y.run({value:p[b],issues:[]},m);_ instanceof Promise?d.push(_.then(w=>tg(w,f,b,p))):tg(_,f,b,p)}return h.length&&f.issues.push({code:"unrecognized_keys",keys:h,input:p,inst:t}),d.length?Promise.all(d).then(()=>f):f}});function qC(t,e,r,i){for(let o of t)if(o.issues.length===0)return e.value=o.value,e;let n=t.filter(o=>!ll(o));return n.length===1?(e.value=n[0].value,n[0]):(e.issues.push({code:"invalid_union",input:e.value,inst:r,errors:t.map(o=>o.issues.map(a=>Co(a,i,Rn())))}),e)}var og=ye("$ZodUnion",(t,e)=>{ar.init(t,e),Tr(t._zod,"optin",()=>e.options.some(n=>n._zod.optin==="optional")?"optional":void 0),Tr(t._zod,"optout",()=>e.options.some(n=>n._zod.optout==="optional")?"optional":void 0),Tr(t._zod,"values",()=>{if(e.options.every(n=>n._zod.values))return new Set(e.options.flatMap(n=>Array.from(n._zod.values)))}),Tr(t._zod,"pattern",()=>{if(e.options.every(n=>n._zod.pattern)){let n=e.options.map(o=>o._zod.pattern);return new RegExp(`^(${n.map(o=>pp(o.source)).join("|")})$`)}});let r=e.options.length===1,i=e.options[0]._zod.run;t._zod.parse=(n,o)=>{if(r)return i(n,o);let a=!1,s=[];for(let l of e.options){let u=l._zod.run({value:n.value,issues:[]},o);if(u instanceof Promise)s.push(u),a=!0;else{if(u.issues.length===0)return u;s.push(u)}}return a?Promise.all(s).then(l=>qC(l,n,t,o)):qC(s,n,t,o)}}),v1=ye("$ZodDiscriminatedUnion",(t,e)=>{og.init(t,e);let r=t._zod.parse;Tr(t._zod,"propValues",()=>{let n={};for(let o of e.options){let a=o._zod.propValues;if(!a||Object.keys(a).length===0)throw new Error(`Invalid discriminated union option at index "${e.options.indexOf(o)}"`);for(let[s,l]of Object.entries(a)){n[s]||(n[s]=new Set);for(let u of l)n[s].add(u)}}return n});let i=fp(()=>{let n=e.options,o=new Map;for(let a of n){let s=a._zod.propValues?.[e.discriminator];if(!s||s.size===0)throw new Error(`Invalid discriminated union option at index "${e.options.indexOf(a)}"`);for(let l of s){if(o.has(l))throw new Error(`Duplicate discriminator value "${String(l)}"`);o.set(l,a)}}return o});t._zod.parse=(n,o)=>{let a=n.value;if(!xc(a))return n.issues.push({code:"invalid_type",expected:"object",input:a,inst:t}),n;let s=i.value.get(a?.[e.discriminator]);return s?s._zod.run(n,o):e.unionFallback?r(n,o):(n.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",discriminator:e.discriminator,input:a,path:[e.discriminator],inst:t}),n)}}),y1=ye("$ZodIntersection",(t,e)=>{ar.init(t,e),t._zod.parse=(r,i)=>{let n=r.value,o=e.left._zod.run({value:n,issues:[]},i),a=e.right._zod.run({value:n,issues:[]},i);return o instanceof Promise||a instanceof Promise?Promise.all([o,a]).then(([l,u])=>jC(r,l,u)):jC(r,o,a)}});function Pw(t,e){if(t===e)return{valid:!0,data:t};if(t instanceof Date&&e instanceof Date&&+t==+e)return{valid:!0,data:t};if(ul(t)&&ul(e)){let r=Object.keys(e),i=Object.keys(t).filter(o=>r.indexOf(o)!==-1),n={...t,...e};for(let o of i){let a=Pw(t[o],e[o]);if(!a.valid)return{valid:!1,mergeErrorPath:[o,...a.mergeErrorPath]};n[o]=a.data}return{valid:!0,data:n}}if(Array.isArray(t)&&Array.isArray(e)){if(t.length!==e.length)return{valid:!1,mergeErrorPath:[]};let r=[];for(let i=0;i<t.length;i++){let n=t[i],o=e[i],a=Pw(n,o);if(!a.valid)return{valid:!1,mergeErrorPath:[i,...a.mergeErrorPath]};r.push(a.data)}return{valid:!0,data:r}}return{valid:!1,mergeErrorPath:[]}}function jC(t,e,r){if(e.issues.length&&t.issues.push(...e.issues),r.issues.length&&t.issues.push(...r.issues),ll(t))return t;let i=Pw(e.value,r.value);if(!i.valid)throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(i.mergeErrorPath)}`);return t.value=i.data,t}var pl=ye("$ZodTuple",(t,e)=>{ar.init(t,e);let r=e.items,i=r.length-[...r].reverse().findIndex(n=>n._zod.optin!=="optional");t._zod.parse=(n,o)=>{let a=n.value;if(!Array.isArray(a))return n.issues.push({input:a,inst:t,expected:"tuple",code:"invalid_type"}),n;n.value=[];let s=[];if(!e.rest){let u=a.length>r.length,c=a.length<i-1;if(u||c)return n.issues.push({...u?{code:"too_big",maximum:r.length}:{code:"too_small",minimum:r.length},input:a,inst:t,origin:"array"}),n}let l=-1;for(let u of r){if(l++,l>=a.length&&l>=i)continue;let c=u._zod.run({value:a[l],issues:[]},o);c instanceof Promise?s.push(c.then(f=>rg(f,n,l))):rg(c,n,l)}if(e.rest){let u=a.slice(r.length);for(let c of u){l++;let f=e.rest._zod.run({value:c,issues:[]},o);f instanceof Promise?s.push(f.then(m=>rg(m,n,l))):rg(f,n,l)}}return s.length?Promise.all(s).then(()=>n):n}});function rg(t,e,r){t.issues.length&&e.issues.push(...Mo(r,t.issues)),e.value[r]=t.value}var b1=ye("$ZodRecord",(t,e)=>{ar.init(t,e),t._zod.parse=(r,i)=>{let n=r.value;if(!ul(n))return r.issues.push({expected:"record",code:"invalid_type",input:n,inst:t}),r;let o=[];if(e.keyType._zod.values){let a=e.keyType._zod.values;r.value={};for(let l of a)if(typeof l=="string"||typeof l=="number"||typeof l=="symbol"){let u=e.valueType._zod.run({value:n[l],issues:[]},i);u instanceof Promise?o.push(u.then(c=>{c.issues.length&&r.issues.push(...Mo(l,c.issues)),r.value[l]=c.value})):(u.issues.length&&r.issues.push(...Mo(l,u.issues)),r.value[l]=u.value)}let s;for(let l in n)a.has(l)||(s=s??[],s.push(l));s&&s.length>0&&r.issues.push({code:"unrecognized_keys",input:n,inst:t,keys:s})}else{r.value={};for(let a of Reflect.ownKeys(n)){if(a==="__proto__")continue;let s=e.keyType._zod.run({value:a,issues:[]},i);if(s instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(s.issues.length){r.issues.push({code:"invalid_key",origin:"record",issues:s.issues.map(u=>Co(u,i,Rn())),input:a,path:[a],inst:t}),r.value[s.value]=s.value;continue}let l=e.valueType._zod.run({value:n[a],issues:[]},i);l instanceof Promise?o.push(l.then(u=>{u.issues.length&&r.issues.push(...Mo(a,u.issues)),r.value[s.value]=u.value})):(l.issues.length&&r.issues.push(...Mo(a,l.issues)),r.value[s.value]=l.value)}}return o.length?Promise.all(o).then(()=>r):r}}),x1=ye("$ZodMap",(t,e)=>{ar.init(t,e),t._zod.parse=(r,i)=>{let n=r.value;if(!(n instanceof Map))return r.issues.push({expected:"map",code:"invalid_type",input:n,inst:t}),r;let o=[];r.value=new Map;for(let[a,s]of n){let l=e.keyType._zod.run({value:a,issues:[]},i),u=e.valueType._zod.run({value:s,issues:[]},i);l instanceof Promise||u instanceof Promise?o.push(Promise.all([l,u]).then(([c,f])=>{ZC(c,f,r,a,n,t,i)})):ZC(l,u,r,a,n,t,i)}return o.length?Promise.all(o).then(()=>r):r}});function ZC(t,e,r,i,n,o,a){t.issues.length&&(mp.has(typeof i)?r.issues.push(...Mo(i,t.issues)):r.issues.push({code:"invalid_key",origin:"map",input:n,inst:o,issues:t.issues.map(s=>Co(s,a,Rn()))})),e.issues.length&&(mp.has(typeof i)?r.issues.push(...Mo(i,e.issues)):r.issues.push({origin:"map",code:"invalid_element",input:n,inst:o,key:i,issues:e.issues.map(s=>Co(s,a,Rn()))})),r.value.set(t.value,e.value)}var _1=ye("$ZodSet",(t,e)=>{ar.init(t,e),t._zod.parse=(r,i)=>{let n=r.value;if(!(n instanceof Set))return r.issues.push({input:n,inst:t,expected:"set",code:"invalid_type"}),r;let o=[];r.value=new Set;for(let a of n){let s=e.valueType._zod.run({value:a,issues:[]},i);s instanceof Promise?o.push(s.then(l=>GC(l,r))):GC(s,r)}return o.length?Promise.all(o).then(()=>r):r}});function GC(t,e){t.issues.length&&e.issues.push(...t.issues),e.value.add(t.value)}var w1=ye("$ZodEnum",(t,e)=>{ar.init(t,e);let r=cp(e.entries),i=new Set(r);t._zod.values=i,t._zod.pattern=new RegExp(`^(${r.filter(n=>mp.has(typeof n)).map(n=>typeof n=="string"?Ga(n):n.toString()).join("|")})$`),t._zod.parse=(n,o)=>{let a=n.value;return i.has(a)||n.issues.push({code:"invalid_value",values:r,input:a,inst:t}),n}}),S1=ye("$ZodLiteral",(t,e)=>{if(ar.init(t,e),e.values.length===0)throw new Error("Cannot create literal schema with no valid values");t._zod.values=new Set(e.values),t._zod.pattern=new RegExp(`^(${e.values.map(r=>typeof r=="string"?Ga(r):r?Ga(r.toString()):String(r)).join("|")})$`),t._zod.parse=(r,i)=>{let n=r.value;return t._zod.values.has(n)||r.issues.push({code:"invalid_value",values:e.values,input:n,inst:t}),r}}),D1=ye("$ZodFile",(t,e)=>{ar.init(t,e),t._zod.parse=(r,i)=>{let n=r.value;return n instanceof File||r.issues.push({expected:"file",code:"invalid_type",input:n,inst:t}),r}}),wp=ye("$ZodTransform",(t,e)=>{ar.init(t,e),t._zod.parse=(r,i)=>{let n=e.transform(r.value,r);if(i.async)return(n instanceof Promise?n:Promise.resolve(n)).then(a=>(r.value=a,r));if(n instanceof Promise)throw new Za;return r.value=n,r}});function WC(t,e){return t.issues.length&&e===void 0?{issues:[],value:void 0}:t}var E1=ye("$ZodOptional",(t,e)=>{ar.init(t,e),t._zod.optin="optional",t._zod.optout="optional",Tr(t._zod,"values",()=>e.innerType._zod.values?new Set([...e.innerType._zod.values,void 0]):void 0),Tr(t._zod,"pattern",()=>{let r=e.innerType._zod.pattern;return r?new RegExp(`^(${pp(r.source)})?$`):void 0}),t._zod.parse=(r,i)=>{if(e.innerType._zod.optin==="optional"){let n=e.innerType._zod.run(r,i);return n instanceof Promise?n.then(o=>WC(o,r.value)):WC(n,r.value)}return r.value===void 0?r:e.innerType._zod.run(r,i)}}),A1=ye("$ZodNullable",(t,e)=>{ar.init(t,e),Tr(t._zod,"optin",()=>e.innerType._zod.optin),Tr(t._zod,"optout",()=>e.innerType._zod.optout),Tr(t._zod,"pattern",()=>{let r=e.innerType._zod.pattern;return r?new RegExp(`^(${pp(r.source)}|null)$`):void 0}),Tr(t._zod,"values",()=>e.innerType._zod.values?new Set([...e.innerType._zod.values,null]):void 0),t._zod.parse=(r,i)=>r.value===null?r:e.innerType._zod.run(r,i)}),T1=ye("$ZodDefault",(t,e)=>{ar.init(t,e),t._zod.optin="optional",Tr(t._zod,"values",()=>e.innerType._zod.values),t._zod.parse=(r,i)=>{if(r.value===void 0)return r.value=e.defaultValue,r;let n=e.innerType._zod.run(r,i);return n instanceof Promise?n.then(o=>HC(o,e)):HC(n,e)}});function HC(t,e){return t.value===void 0&&(t.value=e.defaultValue),t}var N1=ye("$ZodPrefault",(t,e)=>{ar.init(t,e),t._zod.optin="optional",Tr(t._zod,"values",()=>e.innerType._zod.values),t._zod.parse=(r,i)=>(r.value===void 0&&(r.value=e.defaultValue),e.innerType._zod.run(r,i))}),M1=ye("$ZodNonOptional",(t,e)=>{ar.init(t,e),Tr(t._zod,"values",()=>{let r=e.innerType._zod.values;return r?new Set([...r].filter(i=>i!==void 0)):void 0}),t._zod.parse=(r,i)=>{let n=e.innerType._zod.run(r,i);return n instanceof Promise?n.then(o=>YC(o,t)):YC(n,t)}});function YC(t,e){return!t.issues.length&&t.value===void 0&&t.issues.push({code:"invalid_type",expected:"nonoptional",input:t.value,inst:e}),t}var C1=ye("$ZodSuccess",(t,e)=>{ar.init(t,e),t._zod.parse=(r,i)=>{let n=e.innerType._zod.run(r,i);return n instanceof Promise?n.then(o=>(r.value=o.issues.length===0,r)):(r.value=n.issues.length===0,r)}}),$1=ye("$ZodCatch",(t,e)=>{ar.init(t,e),Tr(t._zod,"optin",()=>e.innerType._zod.optin),Tr(t._zod,"optout",()=>e.innerType._zod.optout),Tr(t._zod,"values",()=>e.innerType._zod.values),t._zod.parse=(r,i)=>{let n=e.innerType._zod.run(r,i);return n instanceof Promise?n.then(o=>(r.value=o.value,o.issues.length&&(r.value=e.catchValue({...r,error:{issues:o.issues.map(a=>Co(a,i,Rn()))},input:r.value}),r.issues=[]),r)):(r.value=n.value,n.issues.length&&(r.value=e.catchValue({...r,error:{issues:n.issues.map(o=>Co(o,i,Rn()))},input:r.value}),r.issues=[]),r)}}),I1=ye("$ZodNaN",(t,e)=>{ar.init(t,e),t._zod.parse=(r,i)=>((typeof r.value!="number"||!Number.isNaN(r.value))&&r.issues.push({input:r.value,inst:t,expected:"nan",code:"invalid_type"}),r)}),Sp=ye("$ZodPipe",(t,e)=>{ar.init(t,e),Tr(t._zod,"values",()=>e.in._zod.values),Tr(t._zod,"optin",()=>e.in._zod.optin),Tr(t._zod,"optout",()=>e.out._zod.optout),Tr(t._zod,"propValues",()=>e.in._zod.propValues),t._zod.parse=(r,i)=>{let n=e.in._zod.run(r,i);return n instanceof Promise?n.then(o=>JC(o,e,i)):JC(n,e,i)}});function JC(t,e,r){return t.issues.length?t:e.out._zod.run({value:t.value,issues:t.issues},r)}var F1=ye("$ZodReadonly",(t,e)=>{ar.init(t,e),Tr(t._zod,"propValues",()=>e.innerType._zod.propValues),Tr(t._zod,"values",()=>e.innerType._zod.values),Tr(t._zod,"optin",()=>e.innerType._zod.optin),Tr(t._zod,"optout",()=>e.innerType._zod.optout),t._zod.parse=(r,i)=>{let n=e.innerType._zod.run(r,i);return n instanceof Promise?n.then(XC):XC(n)}});function XC(t){return t.value=Object.freeze(t.value),t}var k1=ye("$ZodTemplateLiteral",(t,e)=>{ar.init(t,e);let r=[];for(let i of e.parts)if(typeof i=="object"&&i!==null){if(!i._zod.pattern)throw new Error(`Invalid template literal part, no pattern found: ${[...i._zod.traits].shift()}`);let n=i._zod.pattern instanceof RegExp?i._zod.pattern.source:i._zod.pattern;if(!n)throw new Error(`Invalid template literal part: ${i._zod.traits}`);let o=n.startsWith("^")?1:0,a=n.endsWith("$")?n.length-1:n.length;r.push(n.slice(o,a))}else if(i===null||F0.has(typeof i))r.push(Ga(`${i}`));else throw new Error(`Invalid template literal part: ${i}`);t._zod.pattern=new RegExp(`^${r.join("")}$`),t._zod.parse=(i,n)=>typeof i.value!="string"?(i.issues.push({input:i.value,inst:t,expected:"template_literal",code:"invalid_type"}),i):(t._zod.pattern.lastIndex=0,t._zod.pattern.test(i.value)||i.issues.push({input:i.value,inst:t,code:"invalid_format",format:e.format??"template_literal",pattern:t._zod.pattern.source}),i)}),P1=ye("$ZodPromise",(t,e)=>{ar.init(t,e),t._zod.parse=(r,i)=>Promise.resolve(r.value).then(n=>e.innerType._zod.run({value:n,issues:[]},i))}),B1=ye("$ZodLazy",(t,e)=>{ar.init(t,e),Tr(t._zod,"innerType",()=>e.getter()),Tr(t._zod,"pattern",()=>t._zod.innerType._zod.pattern),Tr(t._zod,"propValues",()=>t._zod.innerType._zod.propValues),Tr(t._zod,"optin",()=>t._zod.innerType._zod.optin??void 0),Tr(t._zod,"optout",()=>t._zod.innerType._zod.optout??void 0),t._zod.parse=(r,i)=>t._zod.innerType._zod.run(r,i)}),O1=ye("$ZodCustom",(t,e)=>{an.init(t,e),ar.init(t,e),t._zod.parse=(r,i)=>r,t._zod.check=r=>{let i=r.value,n=e.fn(i);if(n instanceof Promise)return n.then(o=>KC(o,r,i,t));KC(n,r,i,t)}});function KC(t,e,r,i){if(!t){let n={code:"custom",input:r,inst:i,path:[...i._zod.def.path??[]],continue:!i._zod.def.abort};i._zod.def.params&&(n.params=i._zod.def.params),e.issues.push(wc(n))}}var Dp={};hs(Dp,{ar:()=>r$,az:()=>n$,be:()=>o$,ca:()=>a$,cs:()=>s$,da:()=>u$,de:()=>l$,en:()=>ag,eo:()=>c$,es:()=>f$,fa:()=>p$,fi:()=>m$,fr:()=>d$,frCA:()=>h$,he:()=>g$,hu:()=>v$,id:()=>y$,is:()=>b$,it:()=>x$,ja:()=>_$,kh:()=>w$,ko:()=>S$,mk:()=>D$,ms:()=>E$,nl:()=>A$,no:()=>T$,ota:()=>N$,pl:()=>C$,ps:()=>M$,pt:()=>$$,ru:()=>F$,sl:()=>k$,sv:()=>P$,ta:()=>B$,th:()=>O$,tr:()=>R$,ua:()=>L$,ur:()=>U$,vi:()=>z$,yo:()=>j$,zhCN:()=>V$,zhTW:()=>q$});var mJ=()=>{let t={string:{unit:"\u062D\u0631\u0641",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"},file:{unit:"\u0628\u0627\u064A\u062A",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"},array:{unit:"\u0639\u0646\u0635\u0631",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"},set:{unit:"\u0639\u0646\u0635\u0631",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"}};function e(n){return t[n]??null}let r=n=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"number";case"object":{if(Array.isArray(n))return"array";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={regex:"\u0645\u062F\u062E\u0644",email:"\u0628\u0631\u064A\u062F \u0625\u0644\u0643\u062A\u0631\u0648\u0646\u064A",url:"\u0631\u0627\u0628\u0637",emoji:"\u0625\u064A\u0645\u0648\u062C\u064A",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u062A\u0627\u0631\u064A\u062E \u0648\u0648\u0642\u062A \u0628\u0645\u0639\u064A\u0627\u0631 ISO",date:"\u062A\u0627\u0631\u064A\u062E \u0628\u0645\u0639\u064A\u0627\u0631 ISO",time:"\u0648\u0642\u062A \u0628\u0645\u0639\u064A\u0627\u0631 ISO",duration:"\u0645\u062F\u0629 \u0628\u0645\u0639\u064A\u0627\u0631 ISO",ipv4:"\u0639\u0646\u0648\u0627\u0646 IPv4",ipv6:"\u0639\u0646\u0648\u0627\u0646 IPv6",cidrv4:"\u0645\u062F\u0649 \u0639\u0646\u0627\u0648\u064A\u0646 \u0628\u0635\u064A\u063A\u0629 IPv4",cidrv6:"\u0645\u062F\u0649 \u0639\u0646\u0627\u0648\u064A\u0646 \u0628\u0635\u064A\u063A\u0629 IPv6",base64:"\u0646\u064E\u0635 \u0628\u062A\u0631\u0645\u064A\u0632 base64-encoded",base64url:"\u0646\u064E\u0635 \u0628\u062A\u0631\u0645\u064A\u0632 base64url-encoded",json_string:"\u0646\u064E\u0635 \u0639\u0644\u0649 \u0647\u064A\u0626\u0629 JSON",e164:"\u0631\u0642\u0645 \u0647\u0627\u062A\u0641 \u0628\u0645\u0639\u064A\u0627\u0631 E.164",jwt:"JWT",template_literal:"\u0645\u062F\u062E\u0644"};return n=>{switch(n.code){case"invalid_type":return`\u0645\u062F\u062E\u0644\u0627\u062A \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644\u0629: \u064A\u0641\u062A\u0631\u0636 \u0625\u062F\u062E\u0627\u0644 ${n.expected}\u060C \u0648\u0644\u0643\u0646 \u062A\u0645 \u0625\u062F\u062E\u0627\u0644 ${r(n.input)}`;case"invalid_value":return n.values.length===1?`\u0645\u062F\u062E\u0644\u0627\u062A \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644\u0629: \u064A\u0641\u062A\u0631\u0636 \u0625\u062F\u062E\u0627\u0644 ${tt(n.values[0])}`:`\u0627\u062E\u062A\u064A\u0627\u0631 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062A\u0648\u0642\u0639 \u0627\u0646\u062A\u0642\u0627\u0621 \u0623\u062D\u062F \u0647\u0630\u0647 \u0627\u0644\u062E\u064A\u0627\u0631\u0627\u062A: ${Ie(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",a=e(n.origin);return a?` \u0623\u0643\u0628\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0623\u0646 \u062A\u0643\u0648\u0646 ${n.origin??"\u0627\u0644\u0642\u064A\u0645\u0629"} ${o} ${n.maximum.toString()} ${a.unit??"\u0639\u0646\u0635\u0631"}`:`\u0623\u0643\u0628\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0623\u0646 \u062A\u0643\u0648\u0646 ${n.origin??"\u0627\u0644\u0642\u064A\u0645\u0629"} ${o} ${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",a=e(n.origin);return a?`\u0623\u0635\u063A\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0644\u0640 ${n.origin} \u0623\u0646 \u064A\u0643\u0648\u0646 ${o} ${n.minimum.toString()} ${a.unit}`:`\u0623\u0635\u063A\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0644\u0640 ${n.origin} \u0623\u0646 \u064A\u0643\u0648\u0646 ${o} ${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0628\u062F\u0623 \u0628\u0640 "${n.prefix}"`:o.format==="ends_with"?`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0646\u062A\u0647\u064A \u0628\u0640 "${o.suffix}"`:o.format==="includes"?`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u062A\u0636\u0645\u0651\u064E\u0646 "${o.includes}"`:o.format==="regex"?`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0637\u0627\u0628\u0642 \u0627\u0644\u0646\u0645\u0637 ${o.pattern}`:`${i[o.format]??n.format} \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644`}case"not_multiple_of":return`\u0631\u0642\u0645 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0643\u0648\u0646 \u0645\u0646 \u0645\u0636\u0627\u0639\u0641\u0627\u062A ${n.divisor}`;case"unrecognized_keys":return`\u0645\u0639\u0631\u0641${n.keys.length>1?"\u0627\u062A":""} \u063A\u0631\u064A\u0628${n.keys.length>1?"\u0629":""}: ${Ie(n.keys,"\u060C ")}`;case"invalid_key":return`\u0645\u0639\u0631\u0641 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644 \u0641\u064A ${n.origin}`;case"invalid_union":return"\u0645\u062F\u062E\u0644 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644";case"invalid_element":return`\u0645\u062F\u062E\u0644 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644 \u0641\u064A ${n.origin}`;default:return"\u0645\u062F\u062E\u0644 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644"}}};function r$(){return{localeError:mJ()}}var dJ=()=>{let t={string:{unit:"simvol",verb:"olmal\u0131d\u0131r"},file:{unit:"bayt",verb:"olmal\u0131d\u0131r"},array:{unit:"element",verb:"olmal\u0131d\u0131r"},set:{unit:"element",verb:"olmal\u0131d\u0131r"}};function e(n){return t[n]??null}let r=n=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"number";case"object":{if(Array.isArray(n))return"array";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",jwt:"JWT",template_literal:"input"};return n=>{switch(n.code){case"invalid_type":return`Yanl\u0131\u015F d\u0259y\u0259r: g\xF6zl\u0259nil\u0259n ${n.expected}, daxil olan ${r(n.input)}`;case"invalid_value":return n.values.length===1?`Yanl\u0131\u015F d\u0259y\u0259r: g\xF6zl\u0259nil\u0259n ${tt(n.values[0])}`:`Yanl\u0131\u015F se\xE7im: a\u015Fa\u011F\u0131dak\u0131lardan biri olmal\u0131d\u0131r: ${Ie(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",a=e(n.origin);return a?`\xC7ox b\xF6y\xFCk: g\xF6zl\u0259nil\u0259n ${n.origin??"d\u0259y\u0259r"} ${o}${n.maximum.toString()} ${a.unit??"element"}`:`\xC7ox b\xF6y\xFCk: g\xF6zl\u0259nil\u0259n ${n.origin??"d\u0259y\u0259r"} ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",a=e(n.origin);return a?`\xC7ox ki\xE7ik: g\xF6zl\u0259nil\u0259n ${n.origin} ${o}${n.minimum.toString()} ${a.unit}`:`\xC7ox ki\xE7ik: g\xF6zl\u0259nil\u0259n ${n.origin} ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Yanl\u0131\u015F m\u0259tn: "${o.prefix}" il\u0259 ba\u015Flamal\u0131d\u0131r`:o.format==="ends_with"?`Yanl\u0131\u015F m\u0259tn: "${o.suffix}" il\u0259 bitm\u0259lidir`:o.format==="includes"?`Yanl\u0131\u015F m\u0259tn: "${o.includes}" daxil olmal\u0131d\u0131r`:o.format==="regex"?`Yanl\u0131\u015F m\u0259tn: ${o.pattern} \u015Fablonuna uy\u011Fun olmal\u0131d\u0131r`:`Yanl\u0131\u015F ${i[o.format]??n.format}`}case"not_multiple_of":return`Yanl\u0131\u015F \u0259d\u0259d: ${n.divisor} il\u0259 b\xF6l\xFCn\u0259 bil\u0259n olmal\u0131d\u0131r`;case"unrecognized_keys":return`Tan\u0131nmayan a\xE7ar${n.keys.length>1?"lar":""}: ${Ie(n.keys,", ")}`;case"invalid_key":return`${n.origin} daxilind\u0259 yanl\u0131\u015F a\xE7ar`;case"invalid_union":return"Yanl\u0131\u015F d\u0259y\u0259r";case"invalid_element":return`${n.origin} daxilind\u0259 yanl\u0131\u015F d\u0259y\u0259r`;default:return"Yanl\u0131\u015F d\u0259y\u0259r"}}};function n$(){return{localeError:dJ()}}function i$(t,e,r,i){let n=Math.abs(t),o=n%10,a=n%100;return a>=11&&a<=19?i:o===1?e:o>=2&&o<=4?r:i}var hJ=()=>{let t={string:{unit:{one:"\u0441\u0456\u043C\u0432\u0430\u043B",few:"\u0441\u0456\u043C\u0432\u0430\u043B\u044B",many:"\u0441\u0456\u043C\u0432\u0430\u043B\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"},array:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u044B",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"},set:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u044B",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"},file:{unit:{one:"\u0431\u0430\u0439\u0442",few:"\u0431\u0430\u0439\u0442\u044B",many:"\u0431\u0430\u0439\u0442\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"}};function e(n){return t[n]??null}let r=n=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"\u043B\u0456\u043A";case"object":{if(Array.isArray(n))return"\u043C\u0430\u0441\u0456\u045E";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={regex:"\u0443\u0432\u043E\u0434",email:"email \u0430\u0434\u0440\u0430\u0441",url:"URL",emoji:"\u044D\u043C\u043E\u0434\u0437\u0456",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0434\u0430\u0442\u0430 \u0456 \u0447\u0430\u0441",date:"ISO \u0434\u0430\u0442\u0430",time:"ISO \u0447\u0430\u0441",duration:"ISO \u043F\u0440\u0430\u0446\u044F\u0433\u043B\u0430\u0441\u0446\u044C",ipv4:"IPv4 \u0430\u0434\u0440\u0430\u0441",ipv6:"IPv6 \u0430\u0434\u0440\u0430\u0441",cidrv4:"IPv4 \u0434\u044B\u044F\u043F\u0430\u0437\u043E\u043D",cidrv6:"IPv6 \u0434\u044B\u044F\u043F\u0430\u0437\u043E\u043D",base64:"\u0440\u0430\u0434\u043E\u043A \u0443 \u0444\u0430\u0440\u043C\u0430\u0446\u0435 base64",base64url:"\u0440\u0430\u0434\u043E\u043A \u0443 \u0444\u0430\u0440\u043C\u0430\u0446\u0435 base64url",json_string:"JSON \u0440\u0430\u0434\u043E\u043A",e164:"\u043D\u0443\u043C\u0430\u0440 E.164",jwt:"JWT",template_literal:"\u0443\u0432\u043E\u0434"};return n=>{switch(n.code){case"invalid_type":return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434: \u0447\u0430\u043A\u0430\u045E\u0441\u044F ${n.expected}, \u0430\u0442\u0440\u044B\u043C\u0430\u043D\u0430 ${r(n.input)}`;case"invalid_value":return n.values.length===1?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F ${tt(n.values[0])}`:`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0432\u0430\u0440\u044B\u044F\u043D\u0442: \u0447\u0430\u043A\u0430\u045E\u0441\u044F \u0430\u0434\u0437\u0456\u043D \u0437 ${Ie(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",a=e(n.origin);if(a){let s=Number(n.maximum),l=i$(s,a.unit.one,a.unit.few,a.unit.many);return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u0432\u044F\u043B\u0456\u043A\u0456: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${n.origin??"\u0437\u043D\u0430\u0447\u044D\u043D\u043D\u0435"} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 ${a.verb} ${o}${n.maximum.toString()} ${l}`}return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u0432\u044F\u043B\u0456\u043A\u0456: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${n.origin??"\u0437\u043D\u0430\u0447\u044D\u043D\u043D\u0435"} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 \u0431\u044B\u0446\u044C ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",a=e(n.origin);if(a){let s=Number(n.minimum),l=i$(s,a.unit.one,a.unit.few,a.unit.many);return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u043C\u0430\u043B\u044B: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${n.origin} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 ${a.verb} ${o}${n.minimum.toString()} ${l}`}return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u043C\u0430\u043B\u044B: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${n.origin} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 \u0431\u044B\u0446\u044C ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u043F\u0430\u0447\u044B\u043D\u0430\u0446\u0446\u0430 \u0437 "${o.prefix}"`:o.format==="ends_with"?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0437\u0430\u043A\u0430\u043D\u0447\u0432\u0430\u0446\u0446\u0430 \u043D\u0430 "${o.suffix}"`:o.format==="includes"?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0437\u043C\u044F\u0448\u0447\u0430\u0446\u044C "${o.includes}"`:o.format==="regex"?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0430\u0434\u043F\u0430\u0432\u044F\u0434\u0430\u0446\u044C \u0448\u0430\u0431\u043B\u043E\u043D\u0443 ${o.pattern}`:`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B ${i[o.format]??n.format}`}case"not_multiple_of":return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u043B\u0456\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0431\u044B\u0446\u044C \u043A\u0440\u0430\u0442\u043D\u044B\u043C ${n.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u0430\u0441\u043F\u0430\u0437\u043D\u0430\u043D\u044B ${n.keys.length>1?"\u043A\u043B\u044E\u0447\u044B":"\u043A\u043B\u044E\u0447"}: ${Ie(n.keys,", ")}`;case"invalid_key":return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u043A\u043B\u044E\u0447 \u0443 ${n.origin}`;case"invalid_union":return"\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434";case"invalid_element":return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u0430\u0435 \u0437\u043D\u0430\u0447\u044D\u043D\u043D\u0435 \u045E ${n.origin}`;default:return"\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434"}}};function o$(){return{localeError:hJ()}}var gJ=()=>{let t={string:{unit:"car\xE0cters",verb:"contenir"},file:{unit:"bytes",verb:"contenir"},array:{unit:"elements",verb:"contenir"},set:{unit:"elements",verb:"contenir"}};function e(n){return t[n]??null}let r=n=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"number";case"object":{if(Array.isArray(n))return"array";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={regex:"entrada",email:"adre\xE7a electr\xF2nica",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data i hora ISO",date:"data ISO",time:"hora ISO",duration:"durada ISO",ipv4:"adre\xE7a IPv4",ipv6:"adre\xE7a IPv6",cidrv4:"rang IPv4",cidrv6:"rang IPv6",base64:"cadena codificada en base64",base64url:"cadena codificada en base64url",json_string:"cadena JSON",e164:"n\xFAmero E.164",jwt:"JWT",template_literal:"entrada"};return n=>{switch(n.code){case"invalid_type":return`Tipus inv\xE0lid: s'esperava ${n.expected}, s'ha rebut ${r(n.input)}`;case"invalid_value":return n.values.length===1?`Valor inv\xE0lid: s'esperava ${tt(n.values[0])}`:`Opci\xF3 inv\xE0lida: s'esperava una de ${Ie(n.values," o ")}`;case"too_big":{let o=n.inclusive?"com a m\xE0xim":"menys de",a=e(n.origin);return a?`Massa gran: s'esperava que ${n.origin??"el valor"} contingu\xE9s ${o} ${n.maximum.toString()} ${a.unit??"elements"}`:`Massa gran: s'esperava que ${n.origin??"el valor"} fos ${o} ${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?"com a m\xEDnim":"m\xE9s de",a=e(n.origin);return a?`Massa petit: s'esperava que ${n.origin} contingu\xE9s ${o} ${n.minimum.toString()} ${a.unit}`:`Massa petit: s'esperava que ${n.origin} fos ${o} ${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Format inv\xE0lid: ha de comen\xE7ar amb "${o.prefix}"`:o.format==="ends_with"?`Format inv\xE0lid: ha d'acabar amb "${o.suffix}"`:o.format==="includes"?`Format inv\xE0lid: ha d'incloure "${o.includes}"`:o.format==="regex"?`Format inv\xE0lid: ha de coincidir amb el patr\xF3 ${o.pattern}`:`Format inv\xE0lid per a ${i[o.format]??n.format}`}case"not_multiple_of":return`N\xFAmero inv\xE0lid: ha de ser m\xFAltiple de ${n.divisor}`;case"unrecognized_keys":return`Clau${n.keys.length>1?"s":""} no reconeguda${n.keys.length>1?"s":""}: ${Ie(n.keys,", ")}`;case"invalid_key":return`Clau inv\xE0lida a ${n.origin}`;case"invalid_union":return"Entrada inv\xE0lida";case"invalid_element":return`Element inv\xE0lid a ${n.origin}`;default:return"Entrada inv\xE0lida"}}};function a$(){return{localeError:gJ()}}var vJ=()=>{let t={string:{unit:"znak\u016F",verb:"m\xEDt"},file:{unit:"bajt\u016F",verb:"m\xEDt"},array:{unit:"prvk\u016F",verb:"m\xEDt"},set:{unit:"prvk\u016F",verb:"m\xEDt"}};function e(n){return t[n]??null}let r=n=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"\u010D\xEDslo";case"string":return"\u0159et\u011Bzec";case"boolean":return"boolean";case"bigint":return"bigint";case"function":return"funkce";case"symbol":return"symbol";case"undefined":return"undefined";case"object":{if(Array.isArray(n))return"pole";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={regex:"regul\xE1rn\xED v\xFDraz",email:"e-mailov\xE1 adresa",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"datum a \u010Das ve form\xE1tu ISO",date:"datum ve form\xE1tu ISO",time:"\u010Das ve form\xE1tu ISO",duration:"doba trv\xE1n\xED ISO",ipv4:"IPv4 adresa",ipv6:"IPv6 adresa",cidrv4:"rozsah IPv4",cidrv6:"rozsah IPv6",base64:"\u0159et\u011Bzec zak\xF3dovan\xFD ve form\xE1tu base64",base64url:"\u0159et\u011Bzec zak\xF3dovan\xFD ve form\xE1tu base64url",json_string:"\u0159et\u011Bzec ve form\xE1tu JSON",e164:"\u010D\xEDslo E.164",jwt:"JWT",template_literal:"vstup"};return n=>{switch(n.code){case"invalid_type":return`Neplatn\xFD vstup: o\u010Dek\xE1v\xE1no ${n.expected}, obdr\u017Eeno ${r(n.input)}`;case"invalid_value":return n.values.length===1?`Neplatn\xFD vstup: o\u010Dek\xE1v\xE1no ${tt(n.values[0])}`:`Neplatn\xE1 mo\u017Enost: o\u010Dek\xE1v\xE1na jedna z hodnot ${Ie(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",a=e(n.origin);return a?`Hodnota je p\u0159\xEDli\u0161 velk\xE1: ${n.origin??"hodnota"} mus\xED m\xEDt ${o}${n.maximum.toString()} ${a.unit??"prvk\u016F"}`:`Hodnota je p\u0159\xEDli\u0161 velk\xE1: ${n.origin??"hodnota"} mus\xED b\xFDt ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",a=e(n.origin);return a?`Hodnota je p\u0159\xEDli\u0161 mal\xE1: ${n.origin??"hodnota"} mus\xED m\xEDt ${o}${n.minimum.toString()} ${a.unit??"prvk\u016F"}`:`Hodnota je p\u0159\xEDli\u0161 mal\xE1: ${n.origin??"hodnota"} mus\xED b\xFDt ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED za\u010D\xEDnat na "${o.prefix}"`:o.format==="ends_with"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED kon\u010Dit na "${o.suffix}"`:o.format==="includes"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED obsahovat "${o.includes}"`:o.format==="regex"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED odpov\xEDdat vzoru ${o.pattern}`:`Neplatn\xFD form\xE1t ${i[o.format]??n.format}`}case"not_multiple_of":return`Neplatn\xE9 \u010D\xEDslo: mus\xED b\xFDt n\xE1sobkem ${n.divisor}`;case"unrecognized_keys":return`Nezn\xE1m\xE9 kl\xED\u010De: ${Ie(n.keys,", ")}`;case"invalid_key":return`Neplatn\xFD kl\xED\u010D v ${n.origin}`;case"invalid_union":return"Neplatn\xFD vstup";case"invalid_element":return`Neplatn\xE1 hodnota v ${n.origin}`;default:return"Neplatn\xFD vstup"}}};function s$(){return{localeError:vJ()}}var yJ=()=>{let t={string:{unit:"tegn",verb:"havde"},file:{unit:"bytes",verb:"havde"},array:{unit:"elementer",verb:"indeholdt"},set:{unit:"elementer",verb:"indeholdt"}},e={string:"streng",number:"tal",boolean:"boolean",array:"liste",object:"objekt",set:"s\xE6t",file:"fil"};function r(a){return t[a]??null}function i(a){return e[a]??a}let n=a=>{let s=typeof a;switch(s){case"number":return Number.isNaN(a)?"NaN":"tal";case"object":return Array.isArray(a)?"liste":a===null?"null":Object.getPrototypeOf(a)!==Object.prototype&&a.constructor?a.constructor.name:"objekt"}return s},o={regex:"input",email:"e-mailadresse",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dato- og klokkesl\xE6t",date:"ISO-dato",time:"ISO-klokkesl\xE6t",duration:"ISO-varighed",ipv4:"IPv4-omr\xE5de",ipv6:"IPv6-omr\xE5de",cidrv4:"IPv4-spektrum",cidrv6:"IPv6-spektrum",base64:"base64-kodet streng",base64url:"base64url-kodet streng",json_string:"JSON-streng",e164:"E.164-nummer",jwt:"JWT",template_literal:"input"};return a=>{switch(a.code){case"invalid_type":return`Ugyldigt input: forventede ${i(a.expected)}, fik ${i(n(a.input))}`;case"invalid_value":return a.values.length===1?`Ugyldig v\xE6rdi: forventede ${tt(a.values[0])}`:`Ugyldigt valg: forventede en af f\xF8lgende ${Ie(a.values,"|")}`;case"too_big":{let s=a.inclusive?"<=":"<",l=r(a.origin),u=i(a.origin);return l?`For stor: forventede ${u??"value"} ${l.verb} ${s} ${a.maximum.toString()} ${l.unit??"elementer"}`:`For stor: forventede ${u??"value"} havde ${s} ${a.maximum.toString()}`}case"too_small":{let s=a.inclusive?">=":">",l=r(a.origin),u=i(a.origin);return l?`For lille: forventede ${u} ${l.verb} ${s} ${a.minimum.toString()} ${l.unit}`:`For lille: forventede ${u} havde ${s} ${a.minimum.toString()}`}case"invalid_format":{let s=a;return s.format==="starts_with"?`Ugyldig streng: skal starte med "${s.prefix}"`:s.format==="ends_with"?`Ugyldig streng: skal ende med "${s.suffix}"`:s.format==="includes"?`Ugyldig streng: skal indeholde "${s.includes}"`:s.format==="regex"?`Ugyldig streng: skal matche m\xF8nsteret ${s.pattern}`:`Ugyldig ${o[s.format]??a.format}`}case"not_multiple_of":return`Ugyldigt tal: skal v\xE6re deleligt med ${a.divisor}`;case"unrecognized_keys":return`${a.keys.length>1?"Ukendte n\xF8gler":"Ukendt n\xF8gle"}: ${Ie(a.keys,", ")}`;case"invalid_key":return`Ugyldig n\xF8gle i ${a.origin}`;case"invalid_union":return"Ugyldigt input: matcher ingen af de tilladte typer";case"invalid_element":return`Ugyldig v\xE6rdi i ${a.origin}`;default:return"Ugyldigt input"}}};function u$(){return{localeError:yJ()}}var bJ=()=>{let t={string:{unit:"Zeichen",verb:"zu haben"},file:{unit:"Bytes",verb:"zu haben"},array:{unit:"Elemente",verb:"zu haben"},set:{unit:"Elemente",verb:"zu haben"}};function e(n){return t[n]??null}let r=n=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"Zahl";case"object":{if(Array.isArray(n))return"Array";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={regex:"Eingabe",email:"E-Mail-Adresse",url:"URL",emoji:"Emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-Datum und -Uhrzeit",date:"ISO-Datum",time:"ISO-Uhrzeit",duration:"ISO-Dauer",ipv4:"IPv4-Adresse",ipv6:"IPv6-Adresse",cidrv4:"IPv4-Bereich",cidrv6:"IPv6-Bereich",base64:"Base64-codierter String",base64url:"Base64-URL-codierter String",json_string:"JSON-String",e164:"E.164-Nummer",jwt:"JWT",template_literal:"Eingabe"};return n=>{switch(n.code){case"invalid_type":return`Ung\xFCltige Eingabe: erwartet ${n.expected}, erhalten ${r(n.input)}`;case"invalid_value":return n.values.length===1?`Ung\xFCltige Eingabe: erwartet ${tt(n.values[0])}`:`Ung\xFCltige Option: erwartet eine von ${Ie(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",a=e(n.origin);return a?`Zu gro\xDF: erwartet, dass ${n.origin??"Wert"} ${o}${n.maximum.toString()} ${a.unit??"Elemente"} hat`:`Zu gro\xDF: erwartet, dass ${n.origin??"Wert"} ${o}${n.maximum.toString()} ist`}case"too_small":{let o=n.inclusive?">=":">",a=e(n.origin);return a?`Zu klein: erwartet, dass ${n.origin} ${o}${n.minimum.toString()} ${a.unit} hat`:`Zu klein: erwartet, dass ${n.origin} ${o}${n.minimum.toString()} ist`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Ung\xFCltiger String: muss mit "${o.prefix}" beginnen`:o.format==="ends_with"?`Ung\xFCltiger String: muss mit "${o.suffix}" enden`:o.format==="includes"?`Ung\xFCltiger String: muss "${o.includes}" enthalten`:o.format==="regex"?`Ung\xFCltiger String: muss dem Muster ${o.pattern} entsprechen`:`Ung\xFCltig: ${i[o.format]??n.format}`}case"not_multiple_of":return`Ung\xFCltige Zahl: muss ein Vielfaches von ${n.divisor} sein`;case"unrecognized_keys":return`${n.keys.length>1?"Unbekannte Schl\xFCssel":"Unbekannter Schl\xFCssel"}: ${Ie(n.keys,", ")}`;case"invalid_key":return`Ung\xFCltiger Schl\xFCssel in ${n.origin}`;case"invalid_union":return"Ung\xFCltige Eingabe";case"invalid_element":return`Ung\xFCltiger Wert in ${n.origin}`;default:return"Ung\xFCltige Eingabe"}}};function l$(){return{localeError:bJ()}}var xJ=t=>{let e=typeof t;switch(e){case"number":return Number.isNaN(t)?"NaN":"number";case"object":{if(Array.isArray(t))return"array";if(t===null)return"null";if(Object.getPrototypeOf(t)!==Object.prototype&&t.constructor)return t.constructor.name}}return e},_J=()=>{let t={string:{unit:"characters",verb:"to have"},file:{unit:"bytes",verb:"to have"},array:{unit:"items",verb:"to have"},set:{unit:"items",verb:"to have"}};function e(i){return t[i]??null}let r={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",jwt:"JWT",template_literal:"input"};return i=>{switch(i.code){case"invalid_type":return`Invalid input: expected ${i.expected}, received ${xJ(i.input)}`;case"invalid_value":return i.values.length===1?`Invalid input: expected ${tt(i.values[0])}`:`Invalid option: expected one of ${Ie(i.values,"|")}`;case"too_big":{let n=i.inclusive?"<=":"<",o=e(i.origin);return o?`Too big: expected ${i.origin??"value"} to have ${n}${i.maximum.toString()} ${o.unit??"elements"}`:`Too big: expected ${i.origin??"value"} to be ${n}${i.maximum.toString()}`}case"too_small":{let n=i.inclusive?">=":">",o=e(i.origin);return o?`Too small: expected ${i.origin} to have ${n}${i.minimum.toString()} ${o.unit}`:`Too small: expected ${i.origin} to be ${n}${i.minimum.toString()}`}case"invalid_format":{let n=i;return n.format==="starts_with"?`Invalid string: must start with "${n.prefix}"`:n.format==="ends_with"?`Invalid string: must end with "${n.suffix}"`:n.format==="includes"?`Invalid string: must include "${n.includes}"`:n.format==="regex"?`Invalid string: must match pattern ${n.pattern}`:`Invalid ${r[n.format]??i.format}`}case"not_multiple_of":return`Invalid number: must be a multiple of ${i.divisor}`;case"unrecognized_keys":return`Unrecognized key${i.keys.length>1?"s":""}: ${Ie(i.keys,", ")}`;case"invalid_key":return`Invalid key in ${i.origin}`;case"invalid_union":return"Invalid input";case"invalid_element":return`Invalid value in ${i.origin}`;default:return"Invalid input"}}};function ag(){return{localeError:_J()}}var wJ=t=>{let e=typeof t;switch(e){case"number":return Number.isNaN(t)?"NaN":"nombro";case"object":{if(Array.isArray(t))return"tabelo";if(t===null)return"senvalora";if(Object.getPrototypeOf(t)!==Object.prototype&&t.constructor)return t.constructor.name}}return e},SJ=()=>{let t={string:{unit:"karaktrojn",verb:"havi"},file:{unit:"bajtojn",verb:"havi"},array:{unit:"elementojn",verb:"havi"},set:{unit:"elementojn",verb:"havi"}};function e(i){return t[i]??null}let r={regex:"enigo",email:"retadreso",url:"URL",emoji:"emo\u011Dio",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-datotempo",date:"ISO-dato",time:"ISO-tempo",duration:"ISO-da\u016Dro",ipv4:"IPv4-adreso",ipv6:"IPv6-adreso",cidrv4:"IPv4-rango",cidrv6:"IPv6-rango",base64:"64-ume kodita karaktraro",base64url:"URL-64-ume kodita karaktraro",json_string:"JSON-karaktraro",e164:"E.164-nombro",jwt:"JWT",template_literal:"enigo"};return i=>{switch(i.code){case"invalid_type":return`Nevalida enigo: atendi\u011Dis ${i.expected}, ricevi\u011Dis ${wJ(i.input)}`;case"invalid_value":return i.values.length===1?`Nevalida enigo: atendi\u011Dis ${tt(i.values[0])}`:`Nevalida opcio: atendi\u011Dis unu el ${Ie(i.values,"|")}`;case"too_big":{let n=i.inclusive?"<=":"<",o=e(i.origin);return o?`Tro granda: atendi\u011Dis ke ${i.origin??"valoro"} havu ${n}${i.maximum.toString()} ${o.unit??"elementojn"}`:`Tro granda: atendi\u011Dis ke ${i.origin??"valoro"} havu ${n}${i.maximum.toString()}`}case"too_small":{let n=i.inclusive?">=":">",o=e(i.origin);return o?`Tro malgranda: atendi\u011Dis ke ${i.origin} havu ${n}${i.minimum.toString()} ${o.unit}`:`Tro malgranda: atendi\u011Dis ke ${i.origin} estu ${n}${i.minimum.toString()}`}case"invalid_format":{let n=i;return n.format==="starts_with"?`Nevalida karaktraro: devas komenci\u011Di per "${n.prefix}"`:n.format==="ends_with"?`Nevalida karaktraro: devas fini\u011Di per "${n.suffix}"`:n.format==="includes"?`Nevalida karaktraro: devas inkluzivi "${n.includes}"`:n.format==="regex"?`Nevalida karaktraro: devas kongrui kun la modelo ${n.pattern}`:`Nevalida ${r[n.format]??i.format}`}case"not_multiple_of":return`Nevalida nombro: devas esti oblo de ${i.divisor}`;case"unrecognized_keys":return`Nekonata${i.keys.length>1?"j":""} \u015Dlosilo${i.keys.length>1?"j":""}: ${Ie(i.keys,", ")}`;case"invalid_key":return`Nevalida \u015Dlosilo en ${i.origin}`;case"invalid_union":return"Nevalida enigo";case"invalid_element":return`Nevalida valoro en ${i.origin}`;default:return"Nevalida enigo"}}};function c$(){return{localeError:SJ()}}var DJ=()=>{let t={string:{unit:"caracteres",verb:"tener"},file:{unit:"bytes",verb:"tener"},array:{unit:"elementos",verb:"tener"},set:{unit:"elementos",verb:"tener"}};function e(n){return t[n]??null}let r=n=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"n\xFAmero";case"object":{if(Array.isArray(n))return"arreglo";if(n===null)return"nulo";if(Object.getPrototypeOf(n)!==Object.prototype)return n.constructor.name}}return o},i={regex:"entrada",email:"direcci\xF3n de correo electr\xF3nico",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"fecha y hora ISO",date:"fecha ISO",time:"hora ISO",duration:"duraci\xF3n ISO",ipv4:"direcci\xF3n IPv4",ipv6:"direcci\xF3n IPv6",cidrv4:"rango IPv4",cidrv6:"rango IPv6",base64:"cadena codificada en base64",base64url:"URL codificada en base64",json_string:"cadena JSON",e164:"n\xFAmero E.164",jwt:"JWT",template_literal:"entrada"};return n=>{switch(n.code){case"invalid_type":return`Entrada inv\xE1lida: se esperaba ${n.expected}, recibido ${r(n.input)}`;case"invalid_value":return n.values.length===1?`Entrada inv\xE1lida: se esperaba ${tt(n.values[0])}`:`Opci\xF3n inv\xE1lida: se esperaba una de ${Ie(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",a=e(n.origin);return a?`Demasiado grande: se esperaba que ${n.origin??"valor"} tuviera ${o}${n.maximum.toString()} ${a.unit??"elementos"}`:`Demasiado grande: se esperaba que ${n.origin??"valor"} fuera ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",a=e(n.origin);return a?`Demasiado peque\xF1o: se esperaba que ${n.origin} tuviera ${o}${n.minimum.toString()} ${a.unit}`:`Demasiado peque\xF1o: se esperaba que ${n.origin} fuera ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Cadena inv\xE1lida: debe comenzar con "${o.prefix}"`:o.format==="ends_with"?`Cadena inv\xE1lida: debe terminar en "${o.suffix}"`:o.format==="includes"?`Cadena inv\xE1lida: debe incluir "${o.includes}"`:o.format==="regex"?`Cadena inv\xE1lida: debe coincidir con el patr\xF3n ${o.pattern}`:`Inv\xE1lido ${i[o.format]??n.format}`}case"not_multiple_of":return`N\xFAmero inv\xE1lido: debe ser m\xFAltiplo de ${n.divisor}`;case"unrecognized_keys":return`Llave${n.keys.length>1?"s":""} desconocida${n.keys.length>1?"s":""}: ${Ie(n.keys,", ")}`;case"invalid_key":return`Llave inv\xE1lida en ${n.origin}`;case"invalid_union":return"Entrada inv\xE1lida";case"invalid_element":return`Valor inv\xE1lido en ${n.origin}`;default:return"Entrada inv\xE1lida"}}};function f$(){return{localeError:DJ()}}var EJ=()=>{let t={string:{unit:"\u06A9\u0627\u0631\u0627\u06A9\u062A\u0631",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"},file:{unit:"\u0628\u0627\u06CC\u062A",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"},array:{unit:"\u0622\u06CC\u062A\u0645",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"},set:{unit:"\u0622\u06CC\u062A\u0645",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"}};function e(n){return t[n]??null}let r=n=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"\u0639\u062F\u062F";case"object":{if(Array.isArray(n))return"\u0622\u0631\u0627\u06CC\u0647";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={regex:"\u0648\u0631\u0648\u062F\u06CC",email:"\u0622\u062F\u0631\u0633 \u0627\u06CC\u0645\u06CC\u0644",url:"URL",emoji:"\u0627\u06CC\u0645\u0648\u062C\u06CC",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u062A\u0627\u0631\u06CC\u062E \u0648 \u0632\u0645\u0627\u0646 \u0627\u06CC\u0632\u0648",date:"\u062A\u0627\u0631\u06CC\u062E \u0627\u06CC\u0632\u0648",time:"\u0632\u0645\u0627\u0646 \u0627\u06CC\u0632\u0648",duration:"\u0645\u062F\u062A \u0632\u0645\u0627\u0646 \u0627\u06CC\u0632\u0648",ipv4:"IPv4 \u0622\u062F\u0631\u0633",ipv6:"IPv6 \u0622\u062F\u0631\u0633",cidrv4:"IPv4 \u062F\u0627\u0645\u0646\u0647",cidrv6:"IPv6 \u062F\u0627\u0645\u0646\u0647",base64:"base64-encoded \u0631\u0634\u062A\u0647",base64url:"base64url-encoded \u0631\u0634\u062A\u0647",json_string:"JSON \u0631\u0634\u062A\u0647",e164:"E.164 \u0639\u062F\u062F",jwt:"JWT",template_literal:"\u0648\u0631\u0648\u062F\u06CC"};return n=>{switch(n.code){case"invalid_type":return`\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A ${n.expected} \u0645\u06CC\u200C\u0628\u0648\u062F\u060C ${r(n.input)} \u062F\u0631\u06CC\u0627\u0641\u062A \u0634\u062F`;case"invalid_value":return n.values.length===1?`\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A ${tt(n.values[0])} \u0645\u06CC\u200C\u0628\u0648\u062F`:`\u06AF\u0632\u06CC\u0646\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A \u06CC\u06A9\u06CC \u0627\u0632 ${Ie(n.values,"|")} \u0645\u06CC\u200C\u0628\u0648\u062F`;case"too_big":{let o=n.inclusive?"<=":"<",a=e(n.origin);return a?`\u062E\u06CC\u0644\u06CC \u0628\u0632\u0631\u06AF: ${n.origin??"\u0645\u0642\u062F\u0627\u0631"} \u0628\u0627\u06CC\u062F ${o}${n.maximum.toString()} ${a.unit??"\u0639\u0646\u0635\u0631"} \u0628\u0627\u0634\u062F`:`\u062E\u06CC\u0644\u06CC \u0628\u0632\u0631\u06AF: ${n.origin??"\u0645\u0642\u062F\u0627\u0631"} \u0628\u0627\u06CC\u062F ${o}${n.maximum.toString()} \u0628\u0627\u0634\u062F`}case"too_small":{let o=n.inclusive?">=":">",a=e(n.origin);return a?`\u062E\u06CC\u0644\u06CC \u06A9\u0648\u0686\u06A9: ${n.origin} \u0628\u0627\u06CC\u062F ${o}${n.minimum.toString()} ${a.unit} \u0628\u0627\u0634\u062F`:`\u062E\u06CC\u0644\u06CC \u06A9\u0648\u0686\u06A9: ${n.origin} \u0628\u0627\u06CC\u062F ${o}${n.minimum.toString()} \u0628\u0627\u0634\u062F`}case"invalid_format":{let o=n;return o.format==="starts_with"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0628\u0627 "${o.prefix}" \u0634\u0631\u0648\u0639 \u0634\u0648\u062F`:o.format==="ends_with"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0628\u0627 "${o.suffix}" \u062A\u0645\u0627\u0645 \u0634\u0648\u062F`:o.format==="includes"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0634\u0627\u0645\u0644 "${o.includes}" \u0628\u0627\u0634\u062F`:o.format==="regex"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0628\u0627 \u0627\u0644\u06AF\u0648\u06CC ${o.pattern} \u0645\u0637\u0627\u0628\u0642\u062A \u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F`:`${i[o.format]??n.format} \u0646\u0627\u0645\u0639\u062A\u0628\u0631`}case"not_multiple_of":return`\u0639\u062F\u062F \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0645\u0636\u0631\u0628 ${n.divisor} \u0628\u0627\u0634\u062F`;case"unrecognized_keys":return`\u06A9\u0644\u06CC\u062F${n.keys.length>1?"\u0647\u0627\u06CC":""} \u0646\u0627\u0634\u0646\u0627\u0633: ${Ie(n.keys,", ")}`;case"invalid_key":return`\u06A9\u0644\u06CC\u062F \u0646\u0627\u0634\u0646\u0627\u0633 \u062F\u0631 ${n.origin}`;case"invalid_union":return"\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631";case"invalid_element":return`\u0645\u0642\u062F\u0627\u0631 \u0646\u0627\u0645\u0639\u062A\u0628\u0631 \u062F\u0631 ${n.origin}`;default:return"\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631"}}};function p$(){return{localeError:EJ()}}var AJ=()=>{let t={string:{unit:"merkki\xE4",subject:"merkkijonon"},file:{unit:"tavua",subject:"tiedoston"},array:{unit:"alkiota",subject:"listan"},set:{unit:"alkiota",subject:"joukon"},number:{unit:"",subject:"luvun"},bigint:{unit:"",subject:"suuren kokonaisluvun"},int:{unit:"",subject:"kokonaisluvun"},date:{unit:"",subject:"p\xE4iv\xE4m\xE4\xE4r\xE4n"}};function e(n){return t[n]??null}let r=n=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"number";case"object":{if(Array.isArray(n))return"array";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={regex:"s\xE4\xE4nn\xF6llinen lauseke",email:"s\xE4hk\xF6postiosoite",url:"URL-osoite",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-aikaleima",date:"ISO-p\xE4iv\xE4m\xE4\xE4r\xE4",time:"ISO-aika",duration:"ISO-kesto",ipv4:"IPv4-osoite",ipv6:"IPv6-osoite",cidrv4:"IPv4-alue",cidrv6:"IPv6-alue",base64:"base64-koodattu merkkijono",base64url:"base64url-koodattu merkkijono",json_string:"JSON-merkkijono",e164:"E.164-luku",jwt:"JWT",template_literal:"templaattimerkkijono"};return n=>{switch(n.code){case"invalid_type":return`Virheellinen tyyppi: odotettiin ${n.expected}, oli ${r(n.input)}`;case"invalid_value":return n.values.length===1?`Virheellinen sy\xF6te: t\xE4ytyy olla ${tt(n.values[0])}`:`Virheellinen valinta: t\xE4ytyy olla yksi seuraavista: ${Ie(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",a=e(n.origin);return a?`Liian suuri: ${a.subject} t\xE4ytyy olla ${o}${n.maximum.toString()} ${a.unit}`.trim():`Liian suuri: arvon t\xE4ytyy olla ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",a=e(n.origin);return a?`Liian pieni: ${a.subject} t\xE4ytyy olla ${o}${n.minimum.toString()} ${a.unit}`.trim():`Liian pieni: arvon t\xE4ytyy olla ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Virheellinen sy\xF6te: t\xE4ytyy alkaa "${o.prefix}"`:o.format==="ends_with"?`Virheellinen sy\xF6te: t\xE4ytyy loppua "${o.suffix}"`:o.format==="includes"?`Virheellinen sy\xF6te: t\xE4ytyy sis\xE4lt\xE4\xE4 "${o.includes}"`:o.format==="regex"?`Virheellinen sy\xF6te: t\xE4ytyy vastata s\xE4\xE4nn\xF6llist\xE4 lauseketta ${o.pattern}`:`Virheellinen ${i[o.format]??n.format}`}case"not_multiple_of":return`Virheellinen luku: t\xE4ytyy olla luvun ${n.divisor} monikerta`;case"unrecognized_keys":return`${n.keys.length>1?"Tuntemattomat avaimet":"Tuntematon avain"}: ${Ie(n.keys,", ")}`;case"invalid_key":return"Virheellinen avain tietueessa";case"invalid_union":return"Virheellinen unioni";case"invalid_element":return"Virheellinen arvo joukossa";default:return"Virheellinen sy\xF6te"}}};function m$(){return{localeError:AJ()}}var TJ=()=>{let t={string:{unit:"caract\xE8res",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"\xE9l\xE9ments",verb:"avoir"},set:{unit:"\xE9l\xE9ments",verb:"avoir"}};function e(n){return t[n]??null}let r=n=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"nombre";case"object":{if(Array.isArray(n))return"tableau";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={regex:"entr\xE9e",email:"adresse e-mail",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"date et heure ISO",date:"date ISO",time:"heure ISO",duration:"dur\xE9e ISO",ipv4:"adresse IPv4",ipv6:"adresse IPv6",cidrv4:"plage IPv4",cidrv6:"plage IPv6",base64:"cha\xEEne encod\xE9e en base64",base64url:"cha\xEEne encod\xE9e en base64url",json_string:"cha\xEEne JSON",e164:"num\xE9ro E.164",jwt:"JWT",template_literal:"entr\xE9e"};return n=>{switch(n.code){case"invalid_type":return`Entr\xE9e invalide : ${n.expected} attendu, ${r(n.input)} re\xE7u`;case"invalid_value":return n.values.length===1?`Entr\xE9e invalide : ${tt(n.values[0])} attendu`:`Option invalide : une valeur parmi ${Ie(n.values,"|")} attendue`;case"too_big":{let o=n.inclusive?"<=":"<",a=e(n.origin);return a?`Trop grand : ${n.origin??"valeur"} doit ${a.verb} ${o}${n.maximum.toString()} ${a.unit??"\xE9l\xE9ment(s)"}`:`Trop grand : ${n.origin??"valeur"} doit \xEAtre ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",a=e(n.origin);return a?`Trop petit : ${n.origin} doit ${a.verb} ${o}${n.minimum.toString()} ${a.unit}`:`Trop petit : ${n.origin} doit \xEAtre ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Cha\xEEne invalide : doit commencer par "${o.prefix}"`:o.format==="ends_with"?`Cha\xEEne invalide : doit se terminer par "${o.suffix}"`:o.format==="includes"?`Cha\xEEne invalide : doit inclure "${o.includes}"`:o.format==="regex"?`Cha\xEEne invalide : doit correspondre au mod\xE8le ${o.pattern}`:`${i[o.format]??n.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit \xEAtre un multiple de ${n.divisor}`;case"unrecognized_keys":return`Cl\xE9${n.keys.length>1?"s":""} non reconnue${n.keys.length>1?"s":""} : ${Ie(n.keys,", ")}`;case"invalid_key":return`Cl\xE9 invalide dans ${n.origin}`;case"invalid_union":return"Entr\xE9e invalide";case"invalid_element":return`Valeur invalide dans ${n.origin}`;default:return"Entr\xE9e invalide"}}};function d$(){return{localeError:TJ()}}var NJ=()=>{let t={string:{unit:"caract\xE8res",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"\xE9l\xE9ments",verb:"avoir"},set:{unit:"\xE9l\xE9ments",verb:"avoir"}};function e(n){return t[n]??null}let r=n=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"number";case"object":{if(Array.isArray(n))return"array";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={regex:"entr\xE9e",email:"adresse courriel",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"date-heure ISO",date:"date ISO",time:"heure ISO",duration:"dur\xE9e ISO",ipv4:"adresse IPv4",ipv6:"adresse IPv6",cidrv4:"plage IPv4",cidrv6:"plage IPv6",base64:"cha\xEEne encod\xE9e en base64",base64url:"cha\xEEne encod\xE9e en base64url",json_string:"cha\xEEne JSON",e164:"num\xE9ro E.164",jwt:"JWT",template_literal:"entr\xE9e"};return n=>{switch(n.code){case"invalid_type":return`Entr\xE9e invalide : attendu ${n.expected}, re\xE7u ${r(n.input)}`;case"invalid_value":return n.values.length===1?`Entr\xE9e invalide : attendu ${tt(n.values[0])}`:`Option invalide : attendu l'une des valeurs suivantes ${Ie(n.values,"|")}`;case"too_big":{let o=n.inclusive?"\u2264":"<",a=e(n.origin);return a?`Trop grand : attendu que ${n.origin??"la valeur"} ait ${o}${n.maximum.toString()} ${a.unit}`:`Trop grand : attendu que ${n.origin??"la valeur"} soit ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?"\u2265":">",a=e(n.origin);return a?`Trop petit : attendu que ${n.origin} ait ${o}${n.minimum.toString()} ${a.unit}`:`Trop petit : attendu que ${n.origin} soit ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Cha\xEEne invalide : doit commencer par "${o.prefix}"`:o.format==="ends_with"?`Cha\xEEne invalide : doit se terminer par "${o.suffix}"`:o.format==="includes"?`Cha\xEEne invalide : doit inclure "${o.includes}"`:o.format==="regex"?`Cha\xEEne invalide : doit correspondre au motif ${o.pattern}`:`${i[o.format]??n.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit \xEAtre un multiple de ${n.divisor}`;case"unrecognized_keys":return`Cl\xE9${n.keys.length>1?"s":""} non reconnue${n.keys.length>1?"s":""} : ${Ie(n.keys,", ")}`;case"invalid_key":return`Cl\xE9 invalide dans ${n.origin}`;case"invalid_union":return"Entr\xE9e invalide";case"invalid_element":return`Valeur invalide dans ${n.origin}`;default:return"Entr\xE9e invalide"}}};function h$(){return{localeError:NJ()}}var MJ=()=>{let t={string:{unit:"\u05D0\u05D5\u05EA\u05D9\u05D5\u05EA",verb:"\u05DC\u05DB\u05DC\u05D5\u05DC"},file:{unit:"\u05D1\u05D9\u05D9\u05D8\u05D9\u05DD",verb:"\u05DC\u05DB\u05DC\u05D5\u05DC"},array:{unit:"\u05E4\u05E8\u05D9\u05D8\u05D9\u05DD",verb:"\u05DC\u05DB\u05DC\u05D5\u05DC"},set:{unit:"\u05E4\u05E8\u05D9\u05D8\u05D9\u05DD",verb:"\u05DC\u05DB\u05DC\u05D5\u05DC"}};function e(n){return t[n]??null}let r=n=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"number";case"object":{if(Array.isArray(n))return"array";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={regex:"\u05E7\u05DC\u05D8",email:"\u05DB\u05EA\u05D5\u05D1\u05EA \u05D0\u05D9\u05DE\u05D9\u05D9\u05DC",url:"\u05DB\u05EA\u05D5\u05D1\u05EA \u05E8\u05E9\u05EA",emoji:"\u05D0\u05D9\u05DE\u05D5\u05D2'\u05D9",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u05EA\u05D0\u05E8\u05D9\u05DA \u05D5\u05D6\u05DE\u05DF ISO",date:"\u05EA\u05D0\u05E8\u05D9\u05DA ISO",time:"\u05D6\u05DE\u05DF ISO",duration:"\u05DE\u05E9\u05DA \u05D6\u05DE\u05DF ISO",ipv4:"\u05DB\u05EA\u05D5\u05D1\u05EA IPv4",ipv6:"\u05DB\u05EA\u05D5\u05D1\u05EA IPv6",cidrv4:"\u05D8\u05D5\u05D5\u05D7 IPv4",cidrv6:"\u05D8\u05D5\u05D5\u05D7 IPv6",base64:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D1\u05D1\u05E1\u05D9\u05E1 64",base64url:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D1\u05D1\u05E1\u05D9\u05E1 64 \u05DC\u05DB\u05EA\u05D5\u05D1\u05D5\u05EA \u05E8\u05E9\u05EA",json_string:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA JSON",e164:"\u05DE\u05E1\u05E4\u05E8 E.164",jwt:"JWT",template_literal:"\u05E7\u05DC\u05D8"};return n=>{switch(n.code){case"invalid_type":return`\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05E6\u05E8\u05D9\u05DA ${n.expected}, \u05D4\u05EA\u05E7\u05D1\u05DC ${r(n.input)}`;case"invalid_value":return n.values.length===1?`\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05E6\u05E8\u05D9\u05DA ${tt(n.values[0])}`:`\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05E6\u05E8\u05D9\u05DA \u05D0\u05D7\u05EA \u05DE\u05D4\u05D0\u05E4\u05E9\u05E8\u05D5\u05D9\u05D5\u05EA ${Ie(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",a=e(n.origin);return a?`\u05D2\u05D3\u05D5\u05DC \u05DE\u05D3\u05D9: ${n.origin??"value"} \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${o}${n.maximum.toString()} ${a.unit??"elements"}`:`\u05D2\u05D3\u05D5\u05DC \u05DE\u05D3\u05D9: ${n.origin??"value"} \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",a=e(n.origin);return a?`\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${n.origin} \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${o}${n.minimum.toString()} ${a.unit}`:`\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${n.origin} \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05E0\u05D4: \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05EA\u05D7\u05D9\u05DC \u05D1"${o.prefix}"`:o.format==="ends_with"?`\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05E0\u05D4: \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05E1\u05EA\u05D9\u05D9\u05DD \u05D1 "${o.suffix}"`:o.format==="includes"?`\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05E0\u05D4: \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05DB\u05DC\u05D5\u05DC "${o.includes}"`:o.format==="regex"?`\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05E0\u05D4: \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05EA\u05D0\u05D9\u05DD \u05DC\u05EA\u05D1\u05E0\u05D9\u05EA ${o.pattern}`:`${i[o.format]??n.format} \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF`}case"not_multiple_of":return`\u05DE\u05E1\u05E4\u05E8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05D7\u05D9\u05D9\u05D1 \u05DC\u05D4\u05D9\u05D5\u05EA \u05DE\u05DB\u05E4\u05DC\u05D4 \u05E9\u05DC ${n.divisor}`;case"unrecognized_keys":return`\u05DE\u05E4\u05EA\u05D7${n.keys.length>1?"\u05D5\u05EA":""} \u05DC\u05D0 \u05DE\u05D6\u05D5\u05D4${n.keys.length>1?"\u05D9\u05DD":"\u05D4"}: ${Ie(n.keys,", ")}`;case"invalid_key":return`\u05DE\u05E4\u05EA\u05D7 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF \u05D1${n.origin}`;case"invalid_union":return"\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF";case"invalid_element":return`\u05E2\u05E8\u05DA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF \u05D1${n.origin}`;default:return"\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF"}}};function g$(){return{localeError:MJ()}}var CJ=()=>{let t={string:{unit:"karakter",verb:"legyen"},file:{unit:"byte",verb:"legyen"},array:{unit:"elem",verb:"legyen"},set:{unit:"elem",verb:"legyen"}};function e(n){return t[n]??null}let r=n=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"sz\xE1m";case"object":{if(Array.isArray(n))return"t\xF6mb";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={regex:"bemenet",email:"email c\xEDm",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO id\u0151b\xE9lyeg",date:"ISO d\xE1tum",time:"ISO id\u0151",duration:"ISO id\u0151intervallum",ipv4:"IPv4 c\xEDm",ipv6:"IPv6 c\xEDm",cidrv4:"IPv4 tartom\xE1ny",cidrv6:"IPv6 tartom\xE1ny",base64:"base64-k\xF3dolt string",base64url:"base64url-k\xF3dolt string",json_string:"JSON string",e164:"E.164 sz\xE1m",jwt:"JWT",template_literal:"bemenet"};return n=>{switch(n.code){case"invalid_type":return`\xC9rv\xE9nytelen bemenet: a v\xE1rt \xE9rt\xE9k ${n.expected}, a kapott \xE9rt\xE9k ${r(n.input)}`;case"invalid_value":return n.values.length===1?`\xC9rv\xE9nytelen bemenet: a v\xE1rt \xE9rt\xE9k ${tt(n.values[0])}`:`\xC9rv\xE9nytelen opci\xF3: valamelyik \xE9rt\xE9k v\xE1rt ${Ie(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",a=e(n.origin);return a?`T\xFAl nagy: ${n.origin??"\xE9rt\xE9k"} m\xE9rete t\xFAl nagy ${o}${n.maximum.toString()} ${a.unit??"elem"}`:`T\xFAl nagy: a bemeneti \xE9rt\xE9k ${n.origin??"\xE9rt\xE9k"} t\xFAl nagy: ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",a=e(n.origin);return a?`T\xFAl kicsi: a bemeneti \xE9rt\xE9k ${n.origin} m\xE9rete t\xFAl kicsi ${o}${n.minimum.toString()} ${a.unit}`:`T\xFAl kicsi: a bemeneti \xE9rt\xE9k ${n.origin} t\xFAl kicsi ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`\xC9rv\xE9nytelen string: "${o.prefix}" \xE9rt\xE9kkel kell kezd\u0151dnie`:o.format==="ends_with"?`\xC9rv\xE9nytelen string: "${o.suffix}" \xE9rt\xE9kkel kell v\xE9gz\u0151dnie`:o.format==="includes"?`\xC9rv\xE9nytelen string: "${o.includes}" \xE9rt\xE9ket kell tartalmaznia`:o.format==="regex"?`\xC9rv\xE9nytelen string: ${o.pattern} mint\xE1nak kell megfelelnie`:`\xC9rv\xE9nytelen ${i[o.format]??n.format}`}case"not_multiple_of":return`\xC9rv\xE9nytelen sz\xE1m: ${n.divisor} t\xF6bbsz\xF6r\xF6s\xE9nek kell lennie`;case"unrecognized_keys":return`Ismeretlen kulcs${n.keys.length>1?"s":""}: ${Ie(n.keys,", ")}`;case"invalid_key":return`\xC9rv\xE9nytelen kulcs ${n.origin}`;case"invalid_union":return"\xC9rv\xE9nytelen bemenet";case"invalid_element":return`\xC9rv\xE9nytelen \xE9rt\xE9k: ${n.origin}`;default:return"\xC9rv\xE9nytelen bemenet"}}};function v$(){return{localeError:CJ()}}var $J=()=>{let t={string:{unit:"karakter",verb:"memiliki"},file:{unit:"byte",verb:"memiliki"},array:{unit:"item",verb:"memiliki"},set:{unit:"item",verb:"memiliki"}};function e(n){return t[n]??null}let r=n=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"number";case"object":{if(Array.isArray(n))return"array";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={regex:"input",email:"alamat email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"tanggal dan waktu format ISO",date:"tanggal format ISO",time:"jam format ISO",duration:"durasi format ISO",ipv4:"alamat IPv4",ipv6:"alamat IPv6",cidrv4:"rentang alamat IPv4",cidrv6:"rentang alamat IPv6",base64:"string dengan enkode base64",base64url:"string dengan enkode base64url",json_string:"string JSON",e164:"angka E.164",jwt:"JWT",template_literal:"input"};return n=>{switch(n.code){case"invalid_type":return`Input tidak valid: diharapkan ${n.expected}, diterima ${r(n.input)}`;case"invalid_value":return n.values.length===1?`Input tidak valid: diharapkan ${tt(n.values[0])}`:`Pilihan tidak valid: diharapkan salah satu dari ${Ie(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",a=e(n.origin);return a?`Terlalu besar: diharapkan ${n.origin??"value"} memiliki ${o}${n.maximum.toString()} ${a.unit??"elemen"}`:`Terlalu besar: diharapkan ${n.origin??"value"} menjadi ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",a=e(n.origin);return a?`Terlalu kecil: diharapkan ${n.origin} memiliki ${o}${n.minimum.toString()} ${a.unit}`:`Terlalu kecil: diharapkan ${n.origin} menjadi ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`String tidak valid: harus dimulai dengan "${o.prefix}"`:o.format==="ends_with"?`String tidak valid: harus berakhir dengan "${o.suffix}"`:o.format==="includes"?`String tidak valid: harus menyertakan "${o.includes}"`:o.format==="regex"?`String tidak valid: harus sesuai pola ${o.pattern}`:`${i[o.format]??n.format} tidak valid`}case"not_multiple_of":return`Angka tidak valid: harus kelipatan dari ${n.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali ${n.keys.length>1?"s":""}: ${Ie(n.keys,", ")}`;case"invalid_key":return`Kunci tidak valid di ${n.origin}`;case"invalid_union":return"Input tidak valid";case"invalid_element":return`Nilai tidak valid di ${n.origin}`;default:return"Input tidak valid"}}};function y$(){return{localeError:$J()}}var IJ=t=>{let e=typeof t;switch(e){case"number":return Number.isNaN(t)?"NaN":"n\xFAmer";case"object":{if(Array.isArray(t))return"fylki";if(t===null)return"null";if(Object.getPrototypeOf(t)!==Object.prototype&&t.constructor)return t.constructor.name}}return e},FJ=()=>{let t={string:{unit:"stafi",verb:"a\xF0 hafa"},file:{unit:"b\xE6ti",verb:"a\xF0 hafa"},array:{unit:"hluti",verb:"a\xF0 hafa"},set:{unit:"hluti",verb:"a\xF0 hafa"}};function e(i){return t[i]??null}let r={regex:"gildi",email:"netfang",url:"vefsl\xF3\xF0",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dagsetning og t\xEDmi",date:"ISO dagsetning",time:"ISO t\xEDmi",duration:"ISO t\xEDmalengd",ipv4:"IPv4 address",ipv6:"IPv6 address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded strengur",base64url:"base64url-encoded strengur",json_string:"JSON strengur",e164:"E.164 t\xF6lugildi",jwt:"JWT",template_literal:"gildi"};return i=>{switch(i.code){case"invalid_type":return`Rangt gildi: \xDE\xFA sl\xF3st inn ${IJ(i.input)} \xFEar sem \xE1 a\xF0 vera ${i.expected}`;case"invalid_value":return i.values.length===1?`Rangt gildi: gert r\xE1\xF0 fyrir ${tt(i.values[0])}`:`\xD3gilt val: m\xE1 vera eitt af eftirfarandi ${Ie(i.values,"|")}`;case"too_big":{let n=i.inclusive?"<=":"<",o=e(i.origin);return o?`Of st\xF3rt: gert er r\xE1\xF0 fyrir a\xF0 ${i.origin??"gildi"} hafi ${n}${i.maximum.toString()} ${o.unit??"hluti"}`:`Of st\xF3rt: gert er r\xE1\xF0 fyrir a\xF0 ${i.origin??"gildi"} s\xE9 ${n}${i.maximum.toString()}`}case"too_small":{let n=i.inclusive?">=":">",o=e(i.origin);return o?`Of l\xEDti\xF0: gert er r\xE1\xF0 fyrir a\xF0 ${i.origin} hafi ${n}${i.minimum.toString()} ${o.unit}`:`Of l\xEDti\xF0: gert er r\xE1\xF0 fyrir a\xF0 ${i.origin} s\xE9 ${n}${i.minimum.toString()}`}case"invalid_format":{let n=i;return n.format==="starts_with"?`\xD3gildur strengur: ver\xF0ur a\xF0 byrja \xE1 "${n.prefix}"`:n.format==="ends_with"?`\xD3gildur strengur: ver\xF0ur a\xF0 enda \xE1 "${n.suffix}"`:n.format==="includes"?`\xD3gildur strengur: ver\xF0ur a\xF0 innihalda "${n.includes}"`:n.format==="regex"?`\xD3gildur strengur: ver\xF0ur a\xF0 fylgja mynstri ${n.pattern}`:`Rangt ${r[n.format]??i.format}`}case"not_multiple_of":return`R\xF6ng tala: ver\xF0ur a\xF0 vera margfeldi af ${i.divisor}`;case"unrecognized_keys":return`\xD3\xFEekkt ${i.keys.length>1?"ir lyklar":"ur lykill"}: ${Ie(i.keys,", ")}`;case"invalid_key":return`Rangur lykill \xED ${i.origin}`;case"invalid_union":return"Rangt gildi";case"invalid_element":return`Rangt gildi \xED ${i.origin}`;default:return"Rangt gildi"}}};function b$(){return{localeError:FJ()}}var kJ=()=>{let t={string:{unit:"caratteri",verb:"avere"},file:{unit:"byte",verb:"avere"},array:{unit:"elementi",verb:"avere"},set:{unit:"elementi",verb:"avere"}};function e(n){return t[n]??null}let r=n=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"numero";case"object":{if(Array.isArray(n))return"vettore";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={regex:"input",email:"indirizzo email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data e ora ISO",date:"data ISO",time:"ora ISO",duration:"durata ISO",ipv4:"indirizzo IPv4",ipv6:"indirizzo IPv6",cidrv4:"intervallo IPv4",cidrv6:"intervallo IPv6",base64:"stringa codificata in base64",base64url:"URL codificata in base64",json_string:"stringa JSON",e164:"numero E.164",jwt:"JWT",template_literal:"input"};return n=>{switch(n.code){case"invalid_type":return`Input non valido: atteso ${n.expected}, ricevuto ${r(n.input)}`;case"invalid_value":return n.values.length===1?`Input non valido: atteso ${tt(n.values[0])}`:`Opzione non valida: atteso uno tra ${Ie(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",a=e(n.origin);return a?`Troppo grande: ${n.origin??"valore"} deve avere ${o}${n.maximum.toString()} ${a.unit??"elementi"}`:`Troppo grande: ${n.origin??"valore"} deve essere ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",a=e(n.origin);return a?`Troppo piccolo: ${n.origin} deve avere ${o}${n.minimum.toString()} ${a.unit}`:`Troppo piccolo: ${n.origin} deve essere ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Stringa non valida: deve iniziare con "${o.prefix}"`:o.format==="ends_with"?`Stringa non valida: deve terminare con "${o.suffix}"`:o.format==="includes"?`Stringa non valida: deve includere "${o.includes}"`:o.format==="regex"?`Stringa non valida: deve corrispondere al pattern ${o.pattern}`:`Invalid ${i[o.format]??n.format}`}case"not_multiple_of":return`Numero non valido: deve essere un multiplo di ${n.divisor}`;case"unrecognized_keys":return`Chiav${n.keys.length>1?"i":"e"} non riconosciut${n.keys.length>1?"e":"a"}: ${Ie(n.keys,", ")}`;case"invalid_key":return`Chiave non valida in ${n.origin}`;case"invalid_union":return"Input non valido";case"invalid_element":return`Valore non valido in ${n.origin}`;default:return"Input non valido"}}};function x$(){return{localeError:kJ()}}var PJ=()=>{let t={string:{unit:"\u6587\u5B57",verb:"\u3067\u3042\u308B"},file:{unit:"\u30D0\u30A4\u30C8",verb:"\u3067\u3042\u308B"},array:{unit:"\u8981\u7D20",verb:"\u3067\u3042\u308B"},set:{unit:"\u8981\u7D20",verb:"\u3067\u3042\u308B"}};function e(n){return t[n]??null}let r=n=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"\u6570\u5024";case"object":{if(Array.isArray(n))return"\u914D\u5217";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={regex:"\u5165\u529B\u5024",email:"\u30E1\u30FC\u30EB\u30A2\u30C9\u30EC\u30B9",url:"URL",emoji:"\u7D75\u6587\u5B57",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO\u65E5\u6642",date:"ISO\u65E5\u4ED8",time:"ISO\u6642\u523B",duration:"ISO\u671F\u9593",ipv4:"IPv4\u30A2\u30C9\u30EC\u30B9",ipv6:"IPv6\u30A2\u30C9\u30EC\u30B9",cidrv4:"IPv4\u7BC4\u56F2",cidrv6:"IPv6\u7BC4\u56F2",base64:"base64\u30A8\u30F3\u30B3\u30FC\u30C9\u6587\u5B57\u5217",base64url:"base64url\u30A8\u30F3\u30B3\u30FC\u30C9\u6587\u5B57\u5217",json_string:"JSON\u6587\u5B57\u5217",e164:"E.164\u756A\u53F7",jwt:"JWT",template_literal:"\u5165\u529B\u5024"};return n=>{switch(n.code){case"invalid_type":return`\u7121\u52B9\u306A\u5165\u529B: ${n.expected}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F\u304C\u3001${r(n.input)}\u304C\u5165\u529B\u3055\u308C\u307E\u3057\u305F`;case"invalid_value":return n.values.length===1?`\u7121\u52B9\u306A\u5165\u529B: ${tt(n.values[0])}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F`:`\u7121\u52B9\u306A\u9078\u629E: ${Ie(n.values,"\u3001")}\u306E\u3044\u305A\u308C\u304B\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`;case"too_big":{let o=n.inclusive?"\u4EE5\u4E0B\u3067\u3042\u308B":"\u3088\u308A\u5C0F\u3055\u3044",a=e(n.origin);return a?`\u5927\u304D\u3059\u304E\u308B\u5024: ${n.origin??"\u5024"}\u306F${n.maximum.toString()}${a.unit??"\u8981\u7D20"}${o}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:`\u5927\u304D\u3059\u304E\u308B\u5024: ${n.origin??"\u5024"}\u306F${n.maximum.toString()}${o}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`}case"too_small":{let o=n.inclusive?"\u4EE5\u4E0A\u3067\u3042\u308B":"\u3088\u308A\u5927\u304D\u3044",a=e(n.origin);return a?`\u5C0F\u3055\u3059\u304E\u308B\u5024: ${n.origin}\u306F${n.minimum.toString()}${a.unit}${o}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:`\u5C0F\u3055\u3059\u304E\u308B\u5024: ${n.origin}\u306F${n.minimum.toString()}${o}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`}case"invalid_format":{let o=n;return o.format==="starts_with"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: "${o.prefix}"\u3067\u59CB\u307E\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:o.format==="ends_with"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: "${o.suffix}"\u3067\u7D42\u308F\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:o.format==="includes"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: "${o.includes}"\u3092\u542B\u3080\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:o.format==="regex"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: \u30D1\u30BF\u30FC\u30F3${o.pattern}\u306B\u4E00\u81F4\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:`\u7121\u52B9\u306A${i[o.format]??n.format}`}case"not_multiple_of":return`\u7121\u52B9\u306A\u6570\u5024: ${n.divisor}\u306E\u500D\u6570\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`;case"unrecognized_keys":return`\u8A8D\u8B58\u3055\u308C\u3066\u3044\u306A\u3044\u30AD\u30FC${n.keys.length>1?"\u7FA4":""}: ${Ie(n.keys,"\u3001")}`;case"invalid_key":return`${n.origin}\u5185\u306E\u7121\u52B9\u306A\u30AD\u30FC`;case"invalid_union":return"\u7121\u52B9\u306A\u5165\u529B";case"invalid_element":return`${n.origin}\u5185\u306E\u7121\u52B9\u306A\u5024`;default:return"\u7121\u52B9\u306A\u5165\u529B"}}};function _$(){return{localeError:PJ()}}var BJ=()=>{let t={string:{unit:"\u178F\u17BD\u17A2\u1780\u17D2\u179F\u179A",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"},file:{unit:"\u1794\u17C3",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"},array:{unit:"\u1792\u17B6\u178F\u17BB",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"},set:{unit:"\u1792\u17B6\u178F\u17BB",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"}};function e(n){return t[n]??null}let r=n=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"\u1798\u17B7\u1793\u1798\u17C2\u1793\u1787\u17B6\u179B\u17C1\u1781 (NaN)":"\u179B\u17C1\u1781";case"object":{if(Array.isArray(n))return"\u17A2\u17B6\u179A\u17C1 (Array)";if(n===null)return"\u1782\u17D2\u1798\u17B6\u1793\u178F\u1798\u17D2\u179B\u17C3 (null)";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={regex:"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B",email:"\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793\u17A2\u17CA\u17B8\u1798\u17C2\u179B",url:"URL",emoji:"\u179F\u1789\u17D2\u1789\u17B6\u17A2\u17B6\u179A\u1798\u17D2\u1798\u178E\u17CD",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u1780\u17B6\u179B\u1794\u179A\u17B7\u1785\u17D2\u1786\u17C1\u1791 \u1793\u17B7\u1784\u1798\u17C9\u17C4\u1784 ISO",date:"\u1780\u17B6\u179B\u1794\u179A\u17B7\u1785\u17D2\u1786\u17C1\u1791 ISO",time:"\u1798\u17C9\u17C4\u1784 ISO",duration:"\u179A\u1799\u17C8\u1796\u17C1\u179B ISO",ipv4:"\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv4",ipv6:"\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv6",cidrv4:"\u178A\u17C2\u1793\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv4",cidrv6:"\u178A\u17C2\u1793\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv6",base64:"\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u17A2\u17CA\u17B7\u1780\u17BC\u178A base64",base64url:"\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u17A2\u17CA\u17B7\u1780\u17BC\u178A base64url",json_string:"\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A JSON",e164:"\u179B\u17C1\u1781 E.164",jwt:"JWT",template_literal:"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B"};return n=>{switch(n.code){case"invalid_type":return`\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${n.expected} \u1794\u17C9\u17BB\u1793\u17D2\u178F\u17C2\u1791\u1791\u17BD\u179B\u1794\u17B6\u1793 ${r(n.input)}`;case"invalid_value":return n.values.length===1?`\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${tt(n.values[0])}`:`\u1787\u1798\u17D2\u179A\u17BE\u179F\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1787\u17B6\u1798\u17BD\u1799\u1780\u17D2\u1793\u17BB\u1784\u1785\u17C6\u178E\u17C4\u1798 ${Ie(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",a=e(n.origin);return a?`\u1792\u17C6\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${n.origin??"\u178F\u1798\u17D2\u179B\u17C3"} ${o} ${n.maximum.toString()} ${a.unit??"\u1792\u17B6\u178F\u17BB"}`:`\u1792\u17C6\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${n.origin??"\u178F\u1798\u17D2\u179B\u17C3"} ${o} ${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",a=e(n.origin);return a?`\u178F\u17BC\u1785\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${n.origin} ${o} ${n.minimum.toString()} ${a.unit}`:`\u178F\u17BC\u1785\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${n.origin} ${o} ${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1785\u17B6\u1794\u17CB\u1795\u17D2\u178F\u17BE\u1798\u178A\u17C4\u1799 "${o.prefix}"`:o.format==="ends_with"?`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1794\u1789\u17D2\u1785\u1794\u17CB\u178A\u17C4\u1799 "${o.suffix}"`:o.format==="includes"?`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1798\u17B6\u1793 "${o.includes}"`:o.format==="regex"?`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u178F\u17C2\u1795\u17D2\u1782\u17BC\u1795\u17D2\u1782\u1784\u1793\u17B9\u1784\u1791\u1798\u17D2\u179A\u1784\u17CB\u178A\u17C2\u179B\u1794\u17B6\u1793\u1780\u17C6\u178E\u178F\u17CB ${o.pattern}`:`\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 ${i[o.format]??n.format}`}case"not_multiple_of":return`\u179B\u17C1\u1781\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u178F\u17C2\u1787\u17B6\u1796\u17A0\u17BB\u1782\u17BB\u178E\u1793\u17C3 ${n.divisor}`;case"unrecognized_keys":return`\u179A\u1780\u1783\u17BE\u1789\u179F\u17C4\u1798\u17B7\u1793\u179F\u17D2\u1782\u17B6\u179B\u17CB\u17D6 ${Ie(n.keys,", ")}`;case"invalid_key":return`\u179F\u17C4\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u1793\u17C5\u1780\u17D2\u1793\u17BB\u1784 ${n.origin}`;case"invalid_union":return"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C";case"invalid_element":return`\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u1793\u17C5\u1780\u17D2\u1793\u17BB\u1784 ${n.origin}`;default:return"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C"}}};function w$(){return{localeError:BJ()}}var OJ=()=>{let t={string:{unit:"\uBB38\uC790",verb:"to have"},file:{unit:"\uBC14\uC774\uD2B8",verb:"to have"},array:{unit:"\uAC1C",verb:"to have"},set:{unit:"\uAC1C",verb:"to have"}};function e(n){return t[n]??null}let r=n=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"number";case"object":{if(Array.isArray(n))return"array";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={regex:"\uC785\uB825",email:"\uC774\uBA54\uC77C \uC8FC\uC18C",url:"URL",emoji:"\uC774\uBAA8\uC9C0",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \uB0A0\uC9DC\uC2DC\uAC04",date:"ISO \uB0A0\uC9DC",time:"ISO \uC2DC\uAC04",duration:"ISO \uAE30\uAC04",ipv4:"IPv4 \uC8FC\uC18C",ipv6:"IPv6 \uC8FC\uC18C",cidrv4:"IPv4 \uBC94\uC704",cidrv6:"IPv6 \uBC94\uC704",base64:"base64 \uC778\uCF54\uB529 \uBB38\uC790\uC5F4",base64url:"base64url \uC778\uCF54\uB529 \uBB38\uC790\uC5F4",json_string:"JSON \uBB38\uC790\uC5F4",e164:"E.164 \uBC88\uD638",jwt:"JWT",template_literal:"\uC785\uB825"};return n=>{switch(n.code){case"invalid_type":return`\uC798\uBABB\uB41C \uC785\uB825: \uC608\uC0C1 \uD0C0\uC785\uC740 ${n.expected}, \uBC1B\uC740 \uD0C0\uC785\uC740 ${r(n.input)}\uC785\uB2C8\uB2E4`;case"invalid_value":return n.values.length===1?`\uC798\uBABB\uB41C \uC785\uB825: \uAC12\uC740 ${tt(n.values[0])} \uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4`:`\uC798\uBABB\uB41C \uC635\uC158: ${Ie(n.values,"\uB610\uB294 ")} \uC911 \uD558\uB098\uC5EC\uC57C \uD569\uB2C8\uB2E4`;case"too_big":{let o=n.inclusive?"\uC774\uD558":"\uBBF8\uB9CC",a=o==="\uBBF8\uB9CC"?"\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4":"\uC5EC\uC57C \uD569\uB2C8\uB2E4",s=e(n.origin),l=s?.unit??"\uC694\uC18C";return s?`${n.origin??"\uAC12"}\uC774 \uB108\uBB34 \uD07D\uB2C8\uB2E4: ${n.maximum.toString()}${l} ${o}${a}`:`${n.origin??"\uAC12"}\uC774 \uB108\uBB34 \uD07D\uB2C8\uB2E4: ${n.maximum.toString()} ${o}${a}`}case"too_small":{let o=n.inclusive?"\uC774\uC0C1":"\uCD08\uACFC",a=o==="\uC774\uC0C1"?"\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4":"\uC5EC\uC57C \uD569\uB2C8\uB2E4",s=e(n.origin),l=s?.unit??"\uC694\uC18C";return s?`${n.origin??"\uAC12"}\uC774 \uB108\uBB34 \uC791\uC2B5\uB2C8\uB2E4: ${n.minimum.toString()}${l} ${o}${a}`:`${n.origin??"\uAC12"}\uC774 \uB108\uBB34 \uC791\uC2B5\uB2C8\uB2E4: ${n.minimum.toString()} ${o}${a}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "${o.prefix}"(\uC73C)\uB85C \uC2DC\uC791\uD574\uC57C \uD569\uB2C8\uB2E4`:o.format==="ends_with"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "${o.suffix}"(\uC73C)\uB85C \uB05D\uB098\uC57C \uD569\uB2C8\uB2E4`:o.format==="includes"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "${o.includes}"\uC744(\uB97C) \uD3EC\uD568\uD574\uC57C \uD569\uB2C8\uB2E4`:o.format==="regex"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: \uC815\uADDC\uC2DD ${o.pattern} \uD328\uD134\uACFC \uC77C\uCE58\uD574\uC57C \uD569\uB2C8\uB2E4`:`\uC798\uBABB\uB41C ${i[o.format]??n.format}`}case"not_multiple_of":return`\uC798\uBABB\uB41C \uC22B\uC790: ${n.divisor}\uC758 \uBC30\uC218\uC5EC\uC57C \uD569\uB2C8\uB2E4`;case"unrecognized_keys":return`\uC778\uC2DD\uD560 \uC218 \uC5C6\uB294 \uD0A4: ${Ie(n.keys,", ")}`;case"invalid_key":return`\uC798\uBABB\uB41C \uD0A4: ${n.origin}`;case"invalid_union":return"\uC798\uBABB\uB41C \uC785\uB825";case"invalid_element":return`\uC798\uBABB\uB41C \uAC12: ${n.origin}`;default:return"\uC798\uBABB\uB41C \uC785\uB825"}}};function S$(){return{localeError:OJ()}}var RJ=()=>{let t={string:{unit:"\u0437\u043D\u0430\u0446\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"},file:{unit:"\u0431\u0430\u0458\u0442\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"},array:{unit:"\u0441\u0442\u0430\u0432\u043A\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"},set:{unit:"\u0441\u0442\u0430\u0432\u043A\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"}};function e(n){return t[n]??null}let r=n=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"\u0431\u0440\u043E\u0458";case"object":{if(Array.isArray(n))return"\u043D\u0438\u0437\u0430";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={regex:"\u0432\u043D\u0435\u0441",email:"\u0430\u0434\u0440\u0435\u0441\u0430 \u043D\u0430 \u0435-\u043F\u043E\u0448\u0442\u0430",url:"URL",emoji:"\u0435\u043C\u043E\u045F\u0438",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0434\u0430\u0442\u0443\u043C \u0438 \u0432\u0440\u0435\u043C\u0435",date:"ISO \u0434\u0430\u0442\u0443\u043C",time:"ISO \u0432\u0440\u0435\u043C\u0435",duration:"ISO \u0432\u0440\u0435\u043C\u0435\u0442\u0440\u0430\u0435\u045A\u0435",ipv4:"IPv4 \u0430\u0434\u0440\u0435\u0441\u0430",ipv6:"IPv6 \u0430\u0434\u0440\u0435\u0441\u0430",cidrv4:"IPv4 \u043E\u043F\u0441\u0435\u0433",cidrv6:"IPv6 \u043E\u043F\u0441\u0435\u0433",base64:"base64-\u0435\u043D\u043A\u043E\u0434\u0438\u0440\u0430\u043D\u0430 \u043D\u0438\u0437\u0430",base64url:"base64url-\u0435\u043D\u043A\u043E\u0434\u0438\u0440\u0430\u043D\u0430 \u043D\u0438\u0437\u0430",json_string:"JSON \u043D\u0438\u0437\u0430",e164:"E.164 \u0431\u0440\u043E\u0458",jwt:"JWT",template_literal:"\u0432\u043D\u0435\u0441"};return n=>{switch(n.code){case"invalid_type":return`\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${n.expected}, \u043F\u0440\u0438\u043C\u0435\u043D\u043E ${r(n.input)}`;case"invalid_value":return n.values.length===1?`Invalid input: expected ${tt(n.values[0])}`:`\u0413\u0440\u0435\u0448\u0430\u043D\u0430 \u043E\u043F\u0446\u0438\u0458\u0430: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 \u0435\u0434\u043D\u0430 ${Ie(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",a=e(n.origin);return a?`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u0433\u043E\u043B\u0435\u043C: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${n.origin??"\u0432\u0440\u0435\u0434\u043D\u043E\u0441\u0442\u0430"} \u0434\u0430 \u0438\u043C\u0430 ${o}${n.maximum.toString()} ${a.unit??"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0438"}`:`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u0433\u043E\u043B\u0435\u043C: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${n.origin??"\u0432\u0440\u0435\u0434\u043D\u043E\u0441\u0442\u0430"} \u0434\u0430 \u0431\u0438\u0434\u0435 ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",a=e(n.origin);return a?`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u043C\u0430\u043B: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${n.origin} \u0434\u0430 \u0438\u043C\u0430 ${o}${n.minimum.toString()} ${a.unit}`:`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u043C\u0430\u043B: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${n.origin} \u0434\u0430 \u0431\u0438\u0434\u0435 ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0437\u0430\u043F\u043E\u0447\u043D\u0443\u0432\u0430 \u0441\u043E "${o.prefix}"`:o.format==="ends_with"?`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0437\u0430\u0432\u0440\u0448\u0443\u0432\u0430 \u0441\u043E "${o.suffix}"`:o.format==="includes"?`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0432\u043A\u043B\u0443\u0447\u0443\u0432\u0430 "${o.includes}"`:o.format==="regex"?`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u043E\u0434\u0433\u043E\u0430\u0440\u0430 \u043D\u0430 \u043F\u0430\u0442\u0435\u0440\u043D\u043E\u0442 ${o.pattern}`:`Invalid ${i[o.format]??n.format}`}case"not_multiple_of":return`\u0413\u0440\u0435\u0448\u0435\u043D \u0431\u0440\u043E\u0458: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0431\u0438\u0434\u0435 \u0434\u0435\u043B\u0438\u0432 \u0441\u043E ${n.divisor}`;case"unrecognized_keys":return`${n.keys.length>1?"\u041D\u0435\u043F\u0440\u0435\u043F\u043E\u0437\u043D\u0430\u0435\u043D\u0438 \u043A\u043B\u0443\u0447\u0435\u0432\u0438":"\u041D\u0435\u043F\u0440\u0435\u043F\u043E\u0437\u043D\u0430\u0435\u043D \u043A\u043B\u0443\u0447"}: ${Ie(n.keys,", ")}`;case"invalid_key":return`\u0413\u0440\u0435\u0448\u0435\u043D \u043A\u043B\u0443\u0447 \u0432\u043E ${n.origin}`;case"invalid_union":return"\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441";case"invalid_element":return`\u0413\u0440\u0435\u0448\u043D\u0430 \u0432\u0440\u0435\u0434\u043D\u043E\u0441\u0442 \u0432\u043E ${n.origin}`;default:return"\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441"}}};function D$(){return{localeError:RJ()}}var LJ=()=>{let t={string:{unit:"aksara",verb:"mempunyai"},file:{unit:"bait",verb:"mempunyai"},array:{unit:"elemen",verb:"mempunyai"},set:{unit:"elemen",verb:"mempunyai"}};function e(n){return t[n]??null}let r=n=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"nombor";case"object":{if(Array.isArray(n))return"array";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={regex:"input",email:"alamat e-mel",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"tarikh masa ISO",date:"tarikh ISO",time:"masa ISO",duration:"tempoh ISO",ipv4:"alamat IPv4",ipv6:"alamat IPv6",cidrv4:"julat IPv4",cidrv6:"julat IPv6",base64:"string dikodkan base64",base64url:"string dikodkan base64url",json_string:"string JSON",e164:"nombor E.164",jwt:"JWT",template_literal:"input"};return n=>{switch(n.code){case"invalid_type":return`Input tidak sah: dijangka ${n.expected}, diterima ${r(n.input)}`;case"invalid_value":return n.values.length===1?`Input tidak sah: dijangka ${tt(n.values[0])}`:`Pilihan tidak sah: dijangka salah satu daripada ${Ie(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",a=e(n.origin);return a?`Terlalu besar: dijangka ${n.origin??"nilai"} ${a.verb} ${o}${n.maximum.toString()} ${a.unit??"elemen"}`:`Terlalu besar: dijangka ${n.origin??"nilai"} adalah ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",a=e(n.origin);return a?`Terlalu kecil: dijangka ${n.origin} ${a.verb} ${o}${n.minimum.toString()} ${a.unit}`:`Terlalu kecil: dijangka ${n.origin} adalah ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`String tidak sah: mesti bermula dengan "${o.prefix}"`:o.format==="ends_with"?`String tidak sah: mesti berakhir dengan "${o.suffix}"`:o.format==="includes"?`String tidak sah: mesti mengandungi "${o.includes}"`:o.format==="regex"?`String tidak sah: mesti sepadan dengan corak ${o.pattern}`:`${i[o.format]??n.format} tidak sah`}case"not_multiple_of":return`Nombor tidak sah: perlu gandaan ${n.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali: ${Ie(n.keys,", ")}`;case"invalid_key":return`Kunci tidak sah dalam ${n.origin}`;case"invalid_union":return"Input tidak sah";case"invalid_element":return`Nilai tidak sah dalam ${n.origin}`;default:return"Input tidak sah"}}};function E$(){return{localeError:LJ()}}var UJ=()=>{let t={string:{unit:"tekens"},file:{unit:"bytes"},array:{unit:"elementen"},set:{unit:"elementen"}};function e(n){return t[n]??null}let r=n=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"getal";case"object":{if(Array.isArray(n))return"array";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={regex:"invoer",email:"emailadres",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datum en tijd",date:"ISO datum",time:"ISO tijd",duration:"ISO duur",ipv4:"IPv4-adres",ipv6:"IPv6-adres",cidrv4:"IPv4-bereik",cidrv6:"IPv6-bereik",base64:"base64-gecodeerde tekst",base64url:"base64 URL-gecodeerde tekst",json_string:"JSON string",e164:"E.164-nummer",jwt:"JWT",template_literal:"invoer"};return n=>{switch(n.code){case"invalid_type":return`Ongeldige invoer: verwacht ${n.expected}, ontving ${r(n.input)}`;case"invalid_value":return n.values.length===1?`Ongeldige invoer: verwacht ${tt(n.values[0])}`:`Ongeldige optie: verwacht \xE9\xE9n van ${Ie(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",a=e(n.origin);return a?`Te lang: verwacht dat ${n.origin??"waarde"} ${o}${n.maximum.toString()} ${a.unit??"elementen"} bevat`:`Te lang: verwacht dat ${n.origin??"waarde"} ${o}${n.maximum.toString()} is`}case"too_small":{let o=n.inclusive?">=":">",a=e(n.origin);return a?`Te kort: verwacht dat ${n.origin} ${o}${n.minimum.toString()} ${a.unit} bevat`:`Te kort: verwacht dat ${n.origin} ${o}${n.minimum.toString()} is`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Ongeldige tekst: moet met "${o.prefix}" beginnen`:o.format==="ends_with"?`Ongeldige tekst: moet op "${o.suffix}" eindigen`:o.format==="includes"?`Ongeldige tekst: moet "${o.includes}" bevatten`:o.format==="regex"?`Ongeldige tekst: moet overeenkomen met patroon ${o.pattern}`:`Ongeldig: ${i[o.format]??n.format}`}case"not_multiple_of":return`Ongeldig getal: moet een veelvoud van ${n.divisor} zijn`;case"unrecognized_keys":return`Onbekende key${n.keys.length>1?"s":""}: ${Ie(n.keys,", ")}`;case"invalid_key":return`Ongeldige key in ${n.origin}`;case"invalid_union":return"Ongeldige invoer";case"invalid_element":return`Ongeldige waarde in ${n.origin}`;default:return"Ongeldige invoer"}}};function A$(){return{localeError:UJ()}}var zJ=()=>{let t={string:{unit:"tegn",verb:"\xE5 ha"},file:{unit:"bytes",verb:"\xE5 ha"},array:{unit:"elementer",verb:"\xE5 inneholde"},set:{unit:"elementer",verb:"\xE5 inneholde"}};function e(n){return t[n]??null}let r=n=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"tall";case"object":{if(Array.isArray(n))return"liste";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={regex:"input",email:"e-postadresse",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dato- og klokkeslett",date:"ISO-dato",time:"ISO-klokkeslett",duration:"ISO-varighet",ipv4:"IPv4-omr\xE5de",ipv6:"IPv6-omr\xE5de",cidrv4:"IPv4-spekter",cidrv6:"IPv6-spekter",base64:"base64-enkodet streng",base64url:"base64url-enkodet streng",json_string:"JSON-streng",e164:"E.164-nummer",jwt:"JWT",template_literal:"input"};return n=>{switch(n.code){case"invalid_type":return`Ugyldig input: forventet ${n.expected}, fikk ${r(n.input)}`;case"invalid_value":return n.values.length===1?`Ugyldig verdi: forventet ${tt(n.values[0])}`:`Ugyldig valg: forventet en av ${Ie(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",a=e(n.origin);return a?`For stor(t): forventet ${n.origin??"value"} til \xE5 ha ${o}${n.maximum.toString()} ${a.unit??"elementer"}`:`For stor(t): forventet ${n.origin??"value"} til \xE5 ha ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",a=e(n.origin);return a?`For lite(n): forventet ${n.origin} til \xE5 ha ${o}${n.minimum.toString()} ${a.unit}`:`For lite(n): forventet ${n.origin} til \xE5 ha ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Ugyldig streng: m\xE5 starte med "${o.prefix}"`:o.format==="ends_with"?`Ugyldig streng: m\xE5 ende med "${o.suffix}"`:o.format==="includes"?`Ugyldig streng: m\xE5 inneholde "${o.includes}"`:o.format==="regex"?`Ugyldig streng: m\xE5 matche m\xF8nsteret ${o.pattern}`:`Ugyldig ${i[o.format]??n.format}`}case"not_multiple_of":return`Ugyldig tall: m\xE5 v\xE6re et multiplum av ${n.divisor}`;case"unrecognized_keys":return`${n.keys.length>1?"Ukjente n\xF8kler":"Ukjent n\xF8kkel"}: ${Ie(n.keys,", ")}`;case"invalid_key":return`Ugyldig n\xF8kkel i ${n.origin}`;case"invalid_union":return"Ugyldig input";case"invalid_element":return`Ugyldig verdi i ${n.origin}`;default:return"Ugyldig input"}}};function T$(){return{localeError:zJ()}}var VJ=()=>{let t={string:{unit:"harf",verb:"olmal\u0131d\u0131r"},file:{unit:"bayt",verb:"olmal\u0131d\u0131r"},array:{unit:"unsur",verb:"olmal\u0131d\u0131r"},set:{unit:"unsur",verb:"olmal\u0131d\u0131r"}};function e(n){return t[n]??null}let r=n=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"numara";case"object":{if(Array.isArray(n))return"saf";if(n===null)return"gayb";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={regex:"giren",email:"epostag\xE2h",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO heng\xE2m\u0131",date:"ISO tarihi",time:"ISO zaman\u0131",duration:"ISO m\xFCddeti",ipv4:"IPv4 ni\u015F\xE2n\u0131",ipv6:"IPv6 ni\u015F\xE2n\u0131",cidrv4:"IPv4 menzili",cidrv6:"IPv6 menzili",base64:"base64-\u015Fifreli metin",base64url:"base64url-\u015Fifreli metin",json_string:"JSON metin",e164:"E.164 say\u0131s\u0131",jwt:"JWT",template_literal:"giren"};return n=>{switch(n.code){case"invalid_type":return`F\xE2sit giren: umulan ${n.expected}, al\u0131nan ${r(n.input)}`;case"invalid_value":return n.values.length===1?`F\xE2sit giren: umulan ${tt(n.values[0])}`:`F\xE2sit tercih: m\xFBteberler ${Ie(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",a=e(n.origin);return a?`Fazla b\xFCy\xFCk: ${n.origin??"value"}, ${o}${n.maximum.toString()} ${a.unit??"elements"} sahip olmal\u0131yd\u0131.`:`Fazla b\xFCy\xFCk: ${n.origin??"value"}, ${o}${n.maximum.toString()} olmal\u0131yd\u0131.`}case"too_small":{let o=n.inclusive?">=":">",a=e(n.origin);return a?`Fazla k\xFC\xE7\xFCk: ${n.origin}, ${o}${n.minimum.toString()} ${a.unit} sahip olmal\u0131yd\u0131.`:`Fazla k\xFC\xE7\xFCk: ${n.origin}, ${o}${n.minimum.toString()} olmal\u0131yd\u0131.`}case"invalid_format":{let o=n;return o.format==="starts_with"?`F\xE2sit metin: "${o.prefix}" ile ba\u015Flamal\u0131.`:o.format==="ends_with"?`F\xE2sit metin: "${o.suffix}" ile bitmeli.`:o.format==="includes"?`F\xE2sit metin: "${o.includes}" ihtiv\xE2 etmeli.`:o.format==="regex"?`F\xE2sit metin: ${o.pattern} nak\u015F\u0131na uymal\u0131.`:`F\xE2sit ${i[o.format]??n.format}`}case"not_multiple_of":return`F\xE2sit say\u0131: ${n.divisor} kat\u0131 olmal\u0131yd\u0131.`;case"unrecognized_keys":return`Tan\u0131nmayan anahtar ${n.keys.length>1?"s":""}: ${Ie(n.keys,", ")}`;case"invalid_key":return`${n.origin} i\xE7in tan\u0131nmayan anahtar var.`;case"invalid_union":return"Giren tan\u0131namad\u0131.";case"invalid_element":return`${n.origin} i\xE7in tan\u0131nmayan k\u0131ymet var.`;default:return"K\u0131ymet tan\u0131namad\u0131."}}};function N$(){return{localeError:VJ()}}var qJ=()=>{let t={string:{unit:"\u062A\u0648\u06A9\u064A",verb:"\u0648\u0644\u0631\u064A"},file:{unit:"\u0628\u0627\u06CC\u067C\u0633",verb:"\u0648\u0644\u0631\u064A"},array:{unit:"\u062A\u0648\u06A9\u064A",verb:"\u0648\u0644\u0631\u064A"},set:{unit:"\u062A\u0648\u06A9\u064A",verb:"\u0648\u0644\u0631\u064A"}};function e(n){return t[n]??null}let r=n=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"\u0639\u062F\u062F";case"object":{if(Array.isArray(n))return"\u0627\u0631\u06D0";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={regex:"\u0648\u0631\u0648\u062F\u064A",email:"\u0628\u0631\u06CC\u069A\u0646\u0627\u0644\u06CC\u06A9",url:"\u06CC\u0648 \u0622\u0631 \u0627\u0644",emoji:"\u0627\u06CC\u0645\u0648\u062C\u064A",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u0646\u06CC\u067C\u0647 \u0627\u0648 \u0648\u062E\u062A",date:"\u0646\u06D0\u067C\u0647",time:"\u0648\u062E\u062A",duration:"\u0645\u0648\u062F\u0647",ipv4:"\u062F IPv4 \u067E\u062A\u0647",ipv6:"\u062F IPv6 \u067E\u062A\u0647",cidrv4:"\u062F IPv4 \u0633\u0627\u062D\u0647",cidrv6:"\u062F IPv6 \u0633\u0627\u062D\u0647",base64:"base64-encoded \u0645\u062A\u0646",base64url:"base64url-encoded \u0645\u062A\u0646",json_string:"JSON \u0645\u062A\u0646",e164:"\u062F E.164 \u0634\u0645\u06D0\u0631\u0647",jwt:"JWT",template_literal:"\u0648\u0631\u0648\u062F\u064A"};return n=>{switch(n.code){case"invalid_type":return`\u0646\u0627\u0633\u0645 \u0648\u0631\u0648\u062F\u064A: \u0628\u0627\u06CC\u062F ${n.expected} \u0648\u0627\u06CC, \u0645\u06AB\u0631 ${r(n.input)} \u062A\u0631\u0644\u0627\u0633\u0647 \u0634\u0648`;case"invalid_value":return n.values.length===1?`\u0646\u0627\u0633\u0645 \u0648\u0631\u0648\u062F\u064A: \u0628\u0627\u06CC\u062F ${tt(n.values[0])} \u0648\u0627\u06CC`:`\u0646\u0627\u0633\u0645 \u0627\u0646\u062A\u062E\u0627\u0628: \u0628\u0627\u06CC\u062F \u06CC\u0648 \u0644\u0647 ${Ie(n.values,"|")} \u0685\u062E\u0647 \u0648\u0627\u06CC`;case"too_big":{let o=n.inclusive?"<=":"<",a=e(n.origin);return a?`\u0689\u06CC\u0631 \u0644\u0648\u06CC: ${n.origin??"\u0627\u0631\u0632\u069A\u062A"} \u0628\u0627\u06CC\u062F ${o}${n.maximum.toString()} ${a.unit??"\u0639\u0646\u0635\u0631\u0648\u0646\u0647"} \u0648\u0644\u0631\u064A`:`\u0689\u06CC\u0631 \u0644\u0648\u06CC: ${n.origin??"\u0627\u0631\u0632\u069A\u062A"} \u0628\u0627\u06CC\u062F ${o}${n.maximum.toString()} \u0648\u064A`}case"too_small":{let o=n.inclusive?">=":">",a=e(n.origin);return a?`\u0689\u06CC\u0631 \u06A9\u0648\u0686\u0646\u06CC: ${n.origin} \u0628\u0627\u06CC\u062F ${o}${n.minimum.toString()} ${a.unit} \u0648\u0644\u0631\u064A`:`\u0689\u06CC\u0631 \u06A9\u0648\u0686\u0646\u06CC: ${n.origin} \u0628\u0627\u06CC\u062F ${o}${n.minimum.toString()} \u0648\u064A`}case"invalid_format":{let o=n;return o.format==="starts_with"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F \u062F "${o.prefix}" \u0633\u0631\u0647 \u067E\u06CC\u0644 \u0634\u064A`:o.format==="ends_with"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F \u062F "${o.suffix}" \u0633\u0631\u0647 \u067E\u0627\u06CC \u062A\u0647 \u0648\u0631\u0633\u064A\u0696\u064A`:o.format==="includes"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F "${o.includes}" \u0648\u0644\u0631\u064A`:o.format==="regex"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F \u062F ${o.pattern} \u0633\u0631\u0647 \u0645\u0637\u0627\u0628\u0642\u062A \u0648\u0644\u0631\u064A`:`${i[o.format]??n.format} \u0646\u0627\u0633\u0645 \u062F\u06CC`}case"not_multiple_of":return`\u0646\u0627\u0633\u0645 \u0639\u062F\u062F: \u0628\u0627\u06CC\u062F \u062F ${n.divisor} \u0645\u0636\u0631\u0628 \u0648\u064A`;case"unrecognized_keys":return`\u0646\u0627\u0633\u0645 ${n.keys.length>1?"\u06A9\u0644\u06CC\u0689\u0648\u0646\u0647":"\u06A9\u0644\u06CC\u0689"}: ${Ie(n.keys,", ")}`;case"invalid_key":return`\u0646\u0627\u0633\u0645 \u06A9\u0644\u06CC\u0689 \u067E\u0647 ${n.origin} \u06A9\u06D0`;case"invalid_union":return"\u0646\u0627\u0633\u0645\u0647 \u0648\u0631\u0648\u062F\u064A";case"invalid_element":return`\u0646\u0627\u0633\u0645 \u0639\u0646\u0635\u0631 \u067E\u0647 ${n.origin} \u06A9\u06D0`;default:return"\u0646\u0627\u0633\u0645\u0647 \u0648\u0631\u0648\u062F\u064A"}}};function M$(){return{localeError:qJ()}}var jJ=()=>{let t={string:{unit:"znak\xF3w",verb:"mie\u0107"},file:{unit:"bajt\xF3w",verb:"mie\u0107"},array:{unit:"element\xF3w",verb:"mie\u0107"},set:{unit:"element\xF3w",verb:"mie\u0107"}};function e(n){return t[n]??null}let r=n=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"liczba";case"object":{if(Array.isArray(n))return"tablica";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={regex:"wyra\u017Cenie",email:"adres email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data i godzina w formacie ISO",date:"data w formacie ISO",time:"godzina w formacie ISO",duration:"czas trwania ISO",ipv4:"adres IPv4",ipv6:"adres IPv6",cidrv4:"zakres IPv4",cidrv6:"zakres IPv6",base64:"ci\u0105g znak\xF3w zakodowany w formacie base64",base64url:"ci\u0105g znak\xF3w zakodowany w formacie base64url",json_string:"ci\u0105g znak\xF3w w formacie JSON",e164:"liczba E.164",jwt:"JWT",template_literal:"wej\u015Bcie"};return n=>{switch(n.code){case"invalid_type":return`Nieprawid\u0142owe dane wej\u015Bciowe: oczekiwano ${n.expected}, otrzymano ${r(n.input)}`;case"invalid_value":return n.values.length===1?`Nieprawid\u0142owe dane wej\u015Bciowe: oczekiwano ${tt(n.values[0])}`:`Nieprawid\u0142owa opcja: oczekiwano jednej z warto\u015Bci ${Ie(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",a=e(n.origin);return a?`Za du\u017Ca warto\u015B\u0107: oczekiwano, \u017Ce ${n.origin??"warto\u015B\u0107"} b\u0119dzie mie\u0107 ${o}${n.maximum.toString()} ${a.unit??"element\xF3w"}`:`Zbyt du\u017C(y/a/e): oczekiwano, \u017Ce ${n.origin??"warto\u015B\u0107"} b\u0119dzie wynosi\u0107 ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",a=e(n.origin);return a?`Za ma\u0142a warto\u015B\u0107: oczekiwano, \u017Ce ${n.origin??"warto\u015B\u0107"} b\u0119dzie mie\u0107 ${o}${n.minimum.toString()} ${a.unit??"element\xF3w"}`:`Zbyt ma\u0142(y/a/e): oczekiwano, \u017Ce ${n.origin??"warto\u015B\u0107"} b\u0119dzie wynosi\u0107 ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi zaczyna\u0107 si\u0119 od "${o.prefix}"`:o.format==="ends_with"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi ko\u0144czy\u0107 si\u0119 na "${o.suffix}"`:o.format==="includes"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi zawiera\u0107 "${o.includes}"`:o.format==="regex"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi odpowiada\u0107 wzorcowi ${o.pattern}`:`Nieprawid\u0142ow(y/a/e) ${i[o.format]??n.format}`}case"not_multiple_of":return`Nieprawid\u0142owa liczba: musi by\u0107 wielokrotno\u015Bci\u0105 ${n.divisor}`;case"unrecognized_keys":return`Nierozpoznane klucze${n.keys.length>1?"s":""}: ${Ie(n.keys,", ")}`;case"invalid_key":return`Nieprawid\u0142owy klucz w ${n.origin}`;case"invalid_union":return"Nieprawid\u0142owe dane wej\u015Bciowe";case"invalid_element":return`Nieprawid\u0142owa warto\u015B\u0107 w ${n.origin}`;default:return"Nieprawid\u0142owe dane wej\u015Bciowe"}}};function C$(){return{localeError:jJ()}}var ZJ=()=>{let t={string:{unit:"caracteres",verb:"ter"},file:{unit:"bytes",verb:"ter"},array:{unit:"itens",verb:"ter"},set:{unit:"itens",verb:"ter"}};function e(n){return t[n]??null}let r=n=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"n\xFAmero";case"object":{if(Array.isArray(n))return"array";if(n===null)return"nulo";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={regex:"padr\xE3o",email:"endere\xE7o de e-mail",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data e hora ISO",date:"data ISO",time:"hora ISO",duration:"dura\xE7\xE3o ISO",ipv4:"endere\xE7o IPv4",ipv6:"endere\xE7o IPv6",cidrv4:"faixa de IPv4",cidrv6:"faixa de IPv6",base64:"texto codificado em base64",base64url:"URL codificada em base64",json_string:"texto JSON",e164:"n\xFAmero E.164",jwt:"JWT",template_literal:"entrada"};return n=>{switch(n.code){case"invalid_type":return`Tipo inv\xE1lido: esperado ${n.expected}, recebido ${r(n.input)}`;case"invalid_value":return n.values.length===1?`Entrada inv\xE1lida: esperado ${tt(n.values[0])}`:`Op\xE7\xE3o inv\xE1lida: esperada uma das ${Ie(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",a=e(n.origin);return a?`Muito grande: esperado que ${n.origin??"valor"} tivesse ${o}${n.maximum.toString()} ${a.unit??"elementos"}`:`Muito grande: esperado que ${n.origin??"valor"} fosse ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",a=e(n.origin);return a?`Muito pequeno: esperado que ${n.origin} tivesse ${o}${n.minimum.toString()} ${a.unit}`:`Muito pequeno: esperado que ${n.origin} fosse ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Texto inv\xE1lido: deve come\xE7ar com "${o.prefix}"`:o.format==="ends_with"?`Texto inv\xE1lido: deve terminar com "${o.suffix}"`:o.format==="includes"?`Texto inv\xE1lido: deve incluir "${o.includes}"`:o.format==="regex"?`Texto inv\xE1lido: deve corresponder ao padr\xE3o ${o.pattern}`:`${i[o.format]??n.format} inv\xE1lido`}case"not_multiple_of":return`N\xFAmero inv\xE1lido: deve ser m\xFAltiplo de ${n.divisor}`;case"unrecognized_keys":return`Chave${n.keys.length>1?"s":""} desconhecida${n.keys.length>1?"s":""}: ${Ie(n.keys,", ")}`;case"invalid_key":return`Chave inv\xE1lida em ${n.origin}`;case"invalid_union":return"Entrada inv\xE1lida";case"invalid_element":return`Valor inv\xE1lido em ${n.origin}`;default:return"Campo inv\xE1lido"}}};function $$(){return{localeError:ZJ()}}function I$(t,e,r,i){let n=Math.abs(t),o=n%10,a=n%100;return a>=11&&a<=19?i:o===1?e:o>=2&&o<=4?r:i}var GJ=()=>{let t={string:{unit:{one:"\u0441\u0438\u043C\u0432\u043E\u043B",few:"\u0441\u0438\u043C\u0432\u043E\u043B\u0430",many:"\u0441\u0438\u043C\u0432\u043E\u043B\u043E\u0432"},verb:"\u0438\u043C\u0435\u0442\u044C"},file:{unit:{one:"\u0431\u0430\u0439\u0442",few:"\u0431\u0430\u0439\u0442\u0430",many:"\u0431\u0430\u0439\u0442"},verb:"\u0438\u043C\u0435\u0442\u044C"},array:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u043E\u0432"},verb:"\u0438\u043C\u0435\u0442\u044C"},set:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u043E\u0432"},verb:"\u0438\u043C\u0435\u0442\u044C"}};function e(n){return t[n]??null}let r=n=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"\u0447\u0438\u0441\u043B\u043E";case"object":{if(Array.isArray(n))return"\u043C\u0430\u0441\u0441\u0438\u0432";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={regex:"\u0432\u0432\u043E\u0434",email:"email \u0430\u0434\u0440\u0435\u0441",url:"URL",emoji:"\u044D\u043C\u043E\u0434\u0437\u0438",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0434\u0430\u0442\u0430 \u0438 \u0432\u0440\u0435\u043C\u044F",date:"ISO \u0434\u0430\u0442\u0430",time:"ISO \u0432\u0440\u0435\u043C\u044F",duration:"ISO \u0434\u043B\u0438\u0442\u0435\u043B\u044C\u043D\u043E\u0441\u0442\u044C",ipv4:"IPv4 \u0430\u0434\u0440\u0435\u0441",ipv6:"IPv6 \u0430\u0434\u0440\u0435\u0441",cidrv4:"IPv4 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D",cidrv6:"IPv6 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D",base64:"\u0441\u0442\u0440\u043E\u043A\u0430 \u0432 \u0444\u043E\u0440\u043C\u0430\u0442\u0435 base64",base64url:"\u0441\u0442\u0440\u043E\u043A\u0430 \u0432 \u0444\u043E\u0440\u043C\u0430\u0442\u0435 base64url",json_string:"JSON \u0441\u0442\u0440\u043E\u043A\u0430",e164:"\u043D\u043E\u043C\u0435\u0440 E.164",jwt:"JWT",template_literal:"\u0432\u0432\u043E\u0434"};return n=>{switch(n.code){case"invalid_type":return`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0432\u043E\u0434: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C ${n.expected}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D\u043E ${r(n.input)}`;case"invalid_value":return n.values.length===1?`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0432\u043E\u0434: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C ${tt(n.values[0])}`:`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0430\u0440\u0438\u0430\u043D\u0442: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C \u043E\u0434\u043D\u043E \u0438\u0437 ${Ie(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",a=e(n.origin);if(a){let s=Number(n.maximum),l=I$(s,a.unit.one,a.unit.few,a.unit.many);return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u0431\u043E\u043B\u044C\u0448\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${n.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435"} \u0431\u0443\u0434\u0435\u0442 \u0438\u043C\u0435\u0442\u044C ${o}${n.maximum.toString()} ${l}`}return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u0431\u043E\u043B\u044C\u0448\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${n.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435"} \u0431\u0443\u0434\u0435\u0442 ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",a=e(n.origin);if(a){let s=Number(n.minimum),l=I$(s,a.unit.one,a.unit.few,a.unit.many);return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u043C\u0430\u043B\u0435\u043D\u044C\u043A\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${n.origin} \u0431\u0443\u0434\u0435\u0442 \u0438\u043C\u0435\u0442\u044C ${o}${n.minimum.toString()} ${l}`}return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u043C\u0430\u043B\u0435\u043D\u044C\u043A\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${n.origin} \u0431\u0443\u0434\u0435\u0442 ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u043D\u0430\u0447\u0438\u043D\u0430\u0442\u044C\u0441\u044F \u0441 "${o.prefix}"`:o.format==="ends_with"?`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u0437\u0430\u043A\u0430\u043D\u0447\u0438\u0432\u0430\u0442\u044C\u0441\u044F \u043D\u0430 "${o.suffix}"`:o.format==="includes"?`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u0441\u043E\u0434\u0435\u0440\u0436\u0430\u0442\u044C "${o.includes}"`:o.format==="regex"?`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u0441\u043E\u043E\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u043E\u0432\u0430\u0442\u044C \u0448\u0430\u0431\u043B\u043E\u043D\u0443 ${o.pattern}`:`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 ${i[o.format]??n.format}`}case"not_multiple_of":return`\u041D\u0435\u0432\u0435\u0440\u043D\u043E\u0435 \u0447\u0438\u0441\u043B\u043E: \u0434\u043E\u043B\u0436\u043D\u043E \u0431\u044B\u0442\u044C \u043A\u0440\u0430\u0442\u043D\u044B\u043C ${n.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u0430\u0441\u043F\u043E\u0437\u043D\u0430\u043D\u043D${n.keys.length>1?"\u044B\u0435":"\u044B\u0439"} \u043A\u043B\u044E\u0447${n.keys.length>1?"\u0438":""}: ${Ie(n.keys,", ")}`;case"invalid_key":return`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u043A\u043B\u044E\u0447 \u0432 ${n.origin}`;case"invalid_union":return"\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0435 \u0432\u0445\u043E\u0434\u043D\u044B\u0435 \u0434\u0430\u043D\u043D\u044B\u0435";case"invalid_element":return`\u041D\u0435\u0432\u0435\u0440\u043D\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435 \u0432 ${n.origin}`;default:return"\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0435 \u0432\u0445\u043E\u0434\u043D\u044B\u0435 \u0434\u0430\u043D\u043D\u044B\u0435"}}};function F$(){return{localeError:GJ()}}var WJ=()=>{let t={string:{unit:"znakov",verb:"imeti"},file:{unit:"bajtov",verb:"imeti"},array:{unit:"elementov",verb:"imeti"},set:{unit:"elementov",verb:"imeti"}};function e(n){return t[n]??null}let r=n=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"\u0161tevilo";case"object":{if(Array.isArray(n))return"tabela";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={regex:"vnos",email:"e-po\u0161tni naslov",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datum in \u010Das",date:"ISO datum",time:"ISO \u010Das",duration:"ISO trajanje",ipv4:"IPv4 naslov",ipv6:"IPv6 naslov",cidrv4:"obseg IPv4",cidrv6:"obseg IPv6",base64:"base64 kodiran niz",base64url:"base64url kodiran niz",json_string:"JSON niz",e164:"E.164 \u0161tevilka",jwt:"JWT",template_literal:"vnos"};return n=>{switch(n.code){case"invalid_type":return`Neveljaven vnos: pri\u010Dakovano ${n.expected}, prejeto ${r(n.input)}`;case"invalid_value":return n.values.length===1?`Neveljaven vnos: pri\u010Dakovano ${tt(n.values[0])}`:`Neveljavna mo\u017Enost: pri\u010Dakovano eno izmed ${Ie(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",a=e(n.origin);return a?`Preveliko: pri\u010Dakovano, da bo ${n.origin??"vrednost"} imelo ${o}${n.maximum.toString()} ${a.unit??"elementov"}`:`Preveliko: pri\u010Dakovano, da bo ${n.origin??"vrednost"} ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",a=e(n.origin);return a?`Premajhno: pri\u010Dakovano, da bo ${n.origin} imelo ${o}${n.minimum.toString()} ${a.unit}`:`Premajhno: pri\u010Dakovano, da bo ${n.origin} ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Neveljaven niz: mora se za\u010Deti z "${o.prefix}"`:o.format==="ends_with"?`Neveljaven niz: mora se kon\u010Dati z "${o.suffix}"`:o.format==="includes"?`Neveljaven niz: mora vsebovati "${o.includes}"`:o.format==="regex"?`Neveljaven niz: mora ustrezati vzorcu ${o.pattern}`:`Neveljaven ${i[o.format]??n.format}`}case"not_multiple_of":return`Neveljavno \u0161tevilo: mora biti ve\u010Dkratnik ${n.divisor}`;case"unrecognized_keys":return`Neprepoznan${n.keys.length>1?"i klju\u010Di":" klju\u010D"}: ${Ie(n.keys,", ")}`;case"invalid_key":return`Neveljaven klju\u010D v ${n.origin}`;case"invalid_union":return"Neveljaven vnos";case"invalid_element":return`Neveljavna vrednost v ${n.origin}`;default:return"Neveljaven vnos"}}};function k$(){return{localeError:WJ()}}var HJ=()=>{let t={string:{unit:"tecken",verb:"att ha"},file:{unit:"bytes",verb:"att ha"},array:{unit:"objekt",verb:"att inneh\xE5lla"},set:{unit:"objekt",verb:"att inneh\xE5lla"}};function e(n){return t[n]??null}let r=n=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"antal";case"object":{if(Array.isArray(n))return"lista";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={regex:"regulj\xE4rt uttryck",email:"e-postadress",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-datum och tid",date:"ISO-datum",time:"ISO-tid",duration:"ISO-varaktighet",ipv4:"IPv4-intervall",ipv6:"IPv6-intervall",cidrv4:"IPv4-spektrum",cidrv6:"IPv6-spektrum",base64:"base64-kodad str\xE4ng",base64url:"base64url-kodad str\xE4ng",json_string:"JSON-str\xE4ng",e164:"E.164-nummer",jwt:"JWT",template_literal:"mall-literal"};return n=>{switch(n.code){case"invalid_type":return`Ogiltig inmatning: f\xF6rv\xE4ntat ${n.expected}, fick ${r(n.input)}`;case"invalid_value":return n.values.length===1?`Ogiltig inmatning: f\xF6rv\xE4ntat ${tt(n.values[0])}`:`Ogiltigt val: f\xF6rv\xE4ntade en av ${Ie(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",a=e(n.origin);return a?`F\xF6r stor(t): f\xF6rv\xE4ntade ${n.origin??"v\xE4rdet"} att ha ${o}${n.maximum.toString()} ${a.unit??"element"}`:`F\xF6r stor(t): f\xF6rv\xE4ntat ${n.origin??"v\xE4rdet"} att ha ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",a=e(n.origin);return a?`F\xF6r lite(t): f\xF6rv\xE4ntade ${n.origin??"v\xE4rdet"} att ha ${o}${n.minimum.toString()} ${a.unit}`:`F\xF6r lite(t): f\xF6rv\xE4ntade ${n.origin??"v\xE4rdet"} att ha ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Ogiltig str\xE4ng: m\xE5ste b\xF6rja med "${o.prefix}"`:o.format==="ends_with"?`Ogiltig str\xE4ng: m\xE5ste sluta med "${o.suffix}"`:o.format==="includes"?`Ogiltig str\xE4ng: m\xE5ste inneh\xE5lla "${o.includes}"`:o.format==="regex"?`Ogiltig str\xE4ng: m\xE5ste matcha m\xF6nstret "${o.pattern}"`:`Ogiltig(t) ${i[o.format]??n.format}`}case"not_multiple_of":return`Ogiltigt tal: m\xE5ste vara en multipel av ${n.divisor}`;case"unrecognized_keys":return`${n.keys.length>1?"Ok\xE4nda nycklar":"Ok\xE4nd nyckel"}: ${Ie(n.keys,", ")}`;case"invalid_key":return`Ogiltig nyckel i ${n.origin??"v\xE4rdet"}`;case"invalid_union":return"Ogiltig input";case"invalid_element":return`Ogiltigt v\xE4rde i ${n.origin??"v\xE4rdet"}`;default:return"Ogiltig input"}}};function P$(){return{localeError:HJ()}}var YJ=()=>{let t={string:{unit:"\u0B8E\u0BB4\u0BC1\u0BA4\u0BCD\u0BA4\u0BC1\u0B95\u0BCD\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"},file:{unit:"\u0BAA\u0BC8\u0B9F\u0BCD\u0B9F\u0BC1\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"},array:{unit:"\u0B89\u0BB1\u0BC1\u0BAA\u0BCD\u0BAA\u0BC1\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"},set:{unit:"\u0B89\u0BB1\u0BC1\u0BAA\u0BCD\u0BAA\u0BC1\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"}};function e(n){return t[n]??null}let r=n=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"\u0B8E\u0BA3\u0BCD \u0B85\u0BB2\u0BCD\u0BB2\u0BBE\u0BA4\u0BA4\u0BC1":"\u0B8E\u0BA3\u0BCD";case"object":{if(Array.isArray(n))return"\u0B85\u0BA3\u0BBF";if(n===null)return"\u0BB5\u0BC6\u0BB1\u0BC1\u0BAE\u0BC8";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={regex:"\u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1",email:"\u0BAE\u0BBF\u0BA9\u0BCD\u0BA9\u0B9E\u0BCD\u0B9A\u0BB2\u0BCD \u0BAE\u0BC1\u0B95\u0BB5\u0BB0\u0BBF",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0BA4\u0BC7\u0BA4\u0BBF \u0BA8\u0BC7\u0BB0\u0BAE\u0BCD",date:"ISO \u0BA4\u0BC7\u0BA4\u0BBF",time:"ISO \u0BA8\u0BC7\u0BB0\u0BAE\u0BCD",duration:"ISO \u0B95\u0BBE\u0BB2 \u0B85\u0BB3\u0BB5\u0BC1",ipv4:"IPv4 \u0BAE\u0BC1\u0B95\u0BB5\u0BB0\u0BBF",ipv6:"IPv6 \u0BAE\u0BC1\u0B95\u0BB5\u0BB0\u0BBF",cidrv4:"IPv4 \u0BB5\u0BB0\u0BAE\u0BCD\u0BAA\u0BC1",cidrv6:"IPv6 \u0BB5\u0BB0\u0BAE\u0BCD\u0BAA\u0BC1",base64:"base64-encoded \u0B9A\u0BB0\u0BAE\u0BCD",base64url:"base64url-encoded \u0B9A\u0BB0\u0BAE\u0BCD",json_string:"JSON \u0B9A\u0BB0\u0BAE\u0BCD",e164:"E.164 \u0B8E\u0BA3\u0BCD",jwt:"JWT",template_literal:"input"};return n=>{switch(n.code){case"invalid_type":return`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${n.expected}, \u0BAA\u0BC6\u0BB1\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${r(n.input)}`;case"invalid_value":return n.values.length===1?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${tt(n.values[0])}`:`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0BB5\u0BBF\u0BB0\u0BC1\u0BAA\u0BCD\u0BAA\u0BAE\u0BCD: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${Ie(n.values,"|")} \u0B87\u0BB2\u0BCD \u0B92\u0BA9\u0BCD\u0BB1\u0BC1`;case"too_big":{let o=n.inclusive?"<=":"<",a=e(n.origin);return a?`\u0BAE\u0BBF\u0B95 \u0BAA\u0BC6\u0BB0\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${n.origin??"\u0BAE\u0BA4\u0BBF\u0BAA\u0BCD\u0BAA\u0BC1"} ${o}${n.maximum.toString()} ${a.unit??"\u0B89\u0BB1\u0BC1\u0BAA\u0BCD\u0BAA\u0BC1\u0B95\u0BB3\u0BCD"} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:`\u0BAE\u0BBF\u0B95 \u0BAA\u0BC6\u0BB0\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${n.origin??"\u0BAE\u0BA4\u0BBF\u0BAA\u0BCD\u0BAA\u0BC1"} ${o}${n.maximum.toString()} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`}case"too_small":{let o=n.inclusive?">=":">",a=e(n.origin);return a?`\u0BAE\u0BBF\u0B95\u0B9A\u0BCD \u0B9A\u0BBF\u0BB1\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${n.origin} ${o}${n.minimum.toString()} ${a.unit} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:`\u0BAE\u0BBF\u0B95\u0B9A\u0BCD \u0B9A\u0BBF\u0BB1\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${n.origin} ${o}${n.minimum.toString()} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`}case"invalid_format":{let o=n;return o.format==="starts_with"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: "${o.prefix}" \u0B87\u0BB2\u0BCD \u0BA4\u0BCA\u0B9F\u0B99\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:o.format==="ends_with"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: "${o.suffix}" \u0B87\u0BB2\u0BCD \u0BAE\u0BC1\u0B9F\u0BBF\u0BB5\u0B9F\u0BC8\u0BAF \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:o.format==="includes"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: "${o.includes}" \u0B90 \u0B89\u0BB3\u0BCD\u0BB3\u0B9F\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:o.format==="regex"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: ${o.pattern} \u0BAE\u0BC1\u0BB1\u0BC8\u0BAA\u0BBE\u0B9F\u0BCD\u0B9F\u0BC1\u0B9F\u0BA9\u0BCD \u0BAA\u0BCA\u0BB0\u0BC1\u0BA8\u0BCD\u0BA4 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 ${i[o.format]??n.format}`}case"not_multiple_of":return`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B8E\u0BA3\u0BCD: ${n.divisor} \u0B87\u0BA9\u0BCD \u0BAA\u0BB2\u0BAE\u0BBE\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`;case"unrecognized_keys":return`\u0B85\u0B9F\u0BC8\u0BAF\u0BBE\u0BB3\u0BAE\u0BCD \u0BA4\u0BC6\u0BB0\u0BBF\u0BAF\u0BBE\u0BA4 \u0BB5\u0BBF\u0B9A\u0BC8${n.keys.length>1?"\u0B95\u0BB3\u0BCD":""}: ${Ie(n.keys,", ")}`;case"invalid_key":return`${n.origin} \u0B87\u0BB2\u0BCD \u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0BB5\u0BBF\u0B9A\u0BC8`;case"invalid_union":return"\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1";case"invalid_element":return`${n.origin} \u0B87\u0BB2\u0BCD \u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0BAE\u0BA4\u0BBF\u0BAA\u0BCD\u0BAA\u0BC1`;default:return"\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1"}}};function B$(){return{localeError:YJ()}}var JJ=()=>{let t={string:{unit:"\u0E15\u0E31\u0E27\u0E2D\u0E31\u0E01\u0E29\u0E23",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"},file:{unit:"\u0E44\u0E1A\u0E15\u0E4C",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"},array:{unit:"\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"},set:{unit:"\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"}};function e(n){return t[n]??null}let r=n=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"\u0E44\u0E21\u0E48\u0E43\u0E0A\u0E48\u0E15\u0E31\u0E27\u0E40\u0E25\u0E02 (NaN)":"\u0E15\u0E31\u0E27\u0E40\u0E25\u0E02";case"object":{if(Array.isArray(n))return"\u0E2D\u0E32\u0E23\u0E4C\u0E40\u0E23\u0E22\u0E4C (Array)";if(n===null)return"\u0E44\u0E21\u0E48\u0E21\u0E35\u0E04\u0E48\u0E32 (null)";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={regex:"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E17\u0E35\u0E48\u0E1B\u0E49\u0E2D\u0E19",email:"\u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48\u0E2D\u0E35\u0E40\u0E21\u0E25",url:"URL",emoji:"\u0E2D\u0E34\u0E42\u0E21\u0E08\u0E34",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u0E27\u0E31\u0E19\u0E17\u0E35\u0E48\u0E40\u0E27\u0E25\u0E32\u0E41\u0E1A\u0E1A ISO",date:"\u0E27\u0E31\u0E19\u0E17\u0E35\u0E48\u0E41\u0E1A\u0E1A ISO",time:"\u0E40\u0E27\u0E25\u0E32\u0E41\u0E1A\u0E1A ISO",duration:"\u0E0A\u0E48\u0E27\u0E07\u0E40\u0E27\u0E25\u0E32\u0E41\u0E1A\u0E1A ISO",ipv4:"\u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48 IPv4",ipv6:"\u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48 IPv6",cidrv4:"\u0E0A\u0E48\u0E27\u0E07 IP \u0E41\u0E1A\u0E1A IPv4",cidrv6:"\u0E0A\u0E48\u0E27\u0E07 IP \u0E41\u0E1A\u0E1A IPv6",base64:"\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E41\u0E1A\u0E1A Base64",base64url:"\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E41\u0E1A\u0E1A Base64 \u0E2A\u0E33\u0E2B\u0E23\u0E31\u0E1A URL",json_string:"\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E41\u0E1A\u0E1A JSON",e164:"\u0E40\u0E1A\u0E2D\u0E23\u0E4C\u0E42\u0E17\u0E23\u0E28\u0E31\u0E1E\u0E17\u0E4C\u0E23\u0E30\u0E2B\u0E27\u0E48\u0E32\u0E07\u0E1B\u0E23\u0E30\u0E40\u0E17\u0E28 (E.164)",jwt:"\u0E42\u0E17\u0E40\u0E04\u0E19 JWT",template_literal:"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E17\u0E35\u0E48\u0E1B\u0E49\u0E2D\u0E19"};return n=>{switch(n.code){case"invalid_type":return`\u0E1B\u0E23\u0E30\u0E40\u0E20\u0E17\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19 ${n.expected} \u0E41\u0E15\u0E48\u0E44\u0E14\u0E49\u0E23\u0E31\u0E1A ${r(n.input)}`;case"invalid_value":return n.values.length===1?`\u0E04\u0E48\u0E32\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19 ${tt(n.values[0])}`:`\u0E15\u0E31\u0E27\u0E40\u0E25\u0E37\u0E2D\u0E01\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19\u0E2B\u0E19\u0E36\u0E48\u0E07\u0E43\u0E19 ${Ie(n.values,"|")}`;case"too_big":{let o=n.inclusive?"\u0E44\u0E21\u0E48\u0E40\u0E01\u0E34\u0E19":"\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32",a=e(n.origin);return a?`\u0E40\u0E01\u0E34\u0E19\u0E01\u0E33\u0E2B\u0E19\u0E14: ${n.origin??"\u0E04\u0E48\u0E32"} \u0E04\u0E27\u0E23\u0E21\u0E35${o} ${n.maximum.toString()} ${a.unit??"\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23"}`:`\u0E40\u0E01\u0E34\u0E19\u0E01\u0E33\u0E2B\u0E19\u0E14: ${n.origin??"\u0E04\u0E48\u0E32"} \u0E04\u0E27\u0E23\u0E21\u0E35${o} ${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?"\u0E2D\u0E22\u0E48\u0E32\u0E07\u0E19\u0E49\u0E2D\u0E22":"\u0E21\u0E32\u0E01\u0E01\u0E27\u0E48\u0E32",a=e(n.origin);return a?`\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32\u0E01\u0E33\u0E2B\u0E19\u0E14: ${n.origin} \u0E04\u0E27\u0E23\u0E21\u0E35${o} ${n.minimum.toString()} ${a.unit}`:`\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32\u0E01\u0E33\u0E2B\u0E19\u0E14: ${n.origin} \u0E04\u0E27\u0E23\u0E21\u0E35${o} ${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E15\u0E49\u0E2D\u0E07\u0E02\u0E36\u0E49\u0E19\u0E15\u0E49\u0E19\u0E14\u0E49\u0E27\u0E22 "${o.prefix}"`:o.format==="ends_with"?`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E15\u0E49\u0E2D\u0E07\u0E25\u0E07\u0E17\u0E49\u0E32\u0E22\u0E14\u0E49\u0E27\u0E22 "${o.suffix}"`:o.format==="includes"?`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E15\u0E49\u0E2D\u0E07\u0E21\u0E35 "${o.includes}" \u0E2D\u0E22\u0E39\u0E48\u0E43\u0E19\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21`:o.format==="regex"?`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E15\u0E49\u0E2D\u0E07\u0E15\u0E23\u0E07\u0E01\u0E31\u0E1A\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E17\u0E35\u0E48\u0E01\u0E33\u0E2B\u0E19\u0E14 ${o.pattern}`:`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: ${i[o.format]??n.format}`}case"not_multiple_of":return`\u0E15\u0E31\u0E27\u0E40\u0E25\u0E02\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E15\u0E49\u0E2D\u0E07\u0E40\u0E1B\u0E47\u0E19\u0E08\u0E33\u0E19\u0E27\u0E19\u0E17\u0E35\u0E48\u0E2B\u0E32\u0E23\u0E14\u0E49\u0E27\u0E22 ${n.divisor} \u0E44\u0E14\u0E49\u0E25\u0E07\u0E15\u0E31\u0E27`;case"unrecognized_keys":return`\u0E1E\u0E1A\u0E04\u0E35\u0E22\u0E4C\u0E17\u0E35\u0E48\u0E44\u0E21\u0E48\u0E23\u0E39\u0E49\u0E08\u0E31\u0E01: ${Ie(n.keys,", ")}`;case"invalid_key":return`\u0E04\u0E35\u0E22\u0E4C\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07\u0E43\u0E19 ${n.origin}`;case"invalid_union":return"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E44\u0E21\u0E48\u0E15\u0E23\u0E07\u0E01\u0E31\u0E1A\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E22\u0E39\u0E40\u0E19\u0E35\u0E22\u0E19\u0E17\u0E35\u0E48\u0E01\u0E33\u0E2B\u0E19\u0E14\u0E44\u0E27\u0E49";case"invalid_element":return`\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07\u0E43\u0E19 ${n.origin}`;default:return"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07"}}};function O$(){return{localeError:JJ()}}var XJ=t=>{let e=typeof t;switch(e){case"number":return Number.isNaN(t)?"NaN":"number";case"object":{if(Array.isArray(t))return"array";if(t===null)return"null";if(Object.getPrototypeOf(t)!==Object.prototype&&t.constructor)return t.constructor.name}}return e},KJ=()=>{let t={string:{unit:"karakter",verb:"olmal\u0131"},file:{unit:"bayt",verb:"olmal\u0131"},array:{unit:"\xF6\u011Fe",verb:"olmal\u0131"},set:{unit:"\xF6\u011Fe",verb:"olmal\u0131"}};function e(i){return t[i]??null}let r={regex:"girdi",email:"e-posta adresi",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO tarih ve saat",date:"ISO tarih",time:"ISO saat",duration:"ISO s\xFCre",ipv4:"IPv4 adresi",ipv6:"IPv6 adresi",cidrv4:"IPv4 aral\u0131\u011F\u0131",cidrv6:"IPv6 aral\u0131\u011F\u0131",base64:"base64 ile \u015Fifrelenmi\u015F metin",base64url:"base64url ile \u015Fifrelenmi\u015F metin",json_string:"JSON dizesi",e164:"E.164 say\u0131s\u0131",jwt:"JWT",template_literal:"\u015Eablon dizesi"};return i=>{switch(i.code){case"invalid_type":return`Ge\xE7ersiz de\u011Fer: beklenen ${i.expected}, al\u0131nan ${XJ(i.input)}`;case"invalid_value":return i.values.length===1?`Ge\xE7ersiz de\u011Fer: beklenen ${tt(i.values[0])}`:`Ge\xE7ersiz se\xE7enek: a\u015Fa\u011F\u0131dakilerden biri olmal\u0131: ${Ie(i.values,"|")}`;case"too_big":{let n=i.inclusive?"<=":"<",o=e(i.origin);return o?`\xC7ok b\xFCy\xFCk: beklenen ${i.origin??"de\u011Fer"} ${n}${i.maximum.toString()} ${o.unit??"\xF6\u011Fe"}`:`\xC7ok b\xFCy\xFCk: beklenen ${i.origin??"de\u011Fer"} ${n}${i.maximum.toString()}`}case"too_small":{let n=i.inclusive?">=":">",o=e(i.origin);return o?`\xC7ok k\xFC\xE7\xFCk: beklenen ${i.origin} ${n}${i.minimum.toString()} ${o.unit}`:`\xC7ok k\xFC\xE7\xFCk: beklenen ${i.origin} ${n}${i.minimum.toString()}`}case"invalid_format":{let n=i;return n.format==="starts_with"?`Ge\xE7ersiz metin: "${n.prefix}" ile ba\u015Flamal\u0131`:n.format==="ends_with"?`Ge\xE7ersiz metin: "${n.suffix}" ile bitmeli`:n.format==="includes"?`Ge\xE7ersiz metin: "${n.includes}" i\xE7ermeli`:n.format==="regex"?`Ge\xE7ersiz metin: ${n.pattern} desenine uymal\u0131`:`Ge\xE7ersiz ${r[n.format]??i.format}`}case"not_multiple_of":return`Ge\xE7ersiz say\u0131: ${i.divisor} ile tam b\xF6l\xFCnebilmeli`;case"unrecognized_keys":return`Tan\u0131nmayan anahtar${i.keys.length>1?"lar":""}: ${Ie(i.keys,", ")}`;case"invalid_key":return`${i.origin} i\xE7inde ge\xE7ersiz anahtar`;case"invalid_union":return"Ge\xE7ersiz de\u011Fer";case"invalid_element":return`${i.origin} i\xE7inde ge\xE7ersiz de\u011Fer`;default:return"Ge\xE7ersiz de\u011Fer"}}};function R$(){return{localeError:KJ()}}var QJ=()=>{let t={string:{unit:"\u0441\u0438\u043C\u0432\u043E\u043B\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"},file:{unit:"\u0431\u0430\u0439\u0442\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"},array:{unit:"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"},set:{unit:"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"}};function e(n){return t[n]??null}let r=n=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"\u0447\u0438\u0441\u043B\u043E";case"object":{if(Array.isArray(n))return"\u043C\u0430\u0441\u0438\u0432";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={regex:"\u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456",email:"\u0430\u0434\u0440\u0435\u0441\u0430 \u0435\u043B\u0435\u043A\u0442\u0440\u043E\u043D\u043D\u043E\u0457 \u043F\u043E\u0448\u0442\u0438",url:"URL",emoji:"\u0435\u043C\u043E\u0434\u0437\u0456",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u0434\u0430\u0442\u0430 \u0442\u0430 \u0447\u0430\u0441 ISO",date:"\u0434\u0430\u0442\u0430 ISO",time:"\u0447\u0430\u0441 ISO",duration:"\u0442\u0440\u0438\u0432\u0430\u043B\u0456\u0441\u0442\u044C ISO",ipv4:"\u0430\u0434\u0440\u0435\u0441\u0430 IPv4",ipv6:"\u0430\u0434\u0440\u0435\u0441\u0430 IPv6",cidrv4:"\u0434\u0456\u0430\u043F\u0430\u0437\u043E\u043D IPv4",cidrv6:"\u0434\u0456\u0430\u043F\u0430\u0437\u043E\u043D IPv6",base64:"\u0440\u044F\u0434\u043E\u043A \u0443 \u043A\u043E\u0434\u0443\u0432\u0430\u043D\u043D\u0456 base64",base64url:"\u0440\u044F\u0434\u043E\u043A \u0443 \u043A\u043E\u0434\u0443\u0432\u0430\u043D\u043D\u0456 base64url",json_string:"\u0440\u044F\u0434\u043E\u043A JSON",e164:"\u043D\u043E\u043C\u0435\u0440 E.164",jwt:"JWT",template_literal:"\u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456"};return n=>{switch(n.code){case"invalid_type":return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F ${n.expected}, \u043E\u0442\u0440\u0438\u043C\u0430\u043D\u043E ${r(n.input)}`;case"invalid_value":return n.values.length===1?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F ${tt(n.values[0])}`:`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0430 \u043E\u043F\u0446\u0456\u044F: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F \u043E\u0434\u043D\u0435 \u0437 ${Ie(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",a=e(n.origin);return a?`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u0432\u0435\u043B\u0438\u043A\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${n.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044F"} ${a.verb} ${o}${n.maximum.toString()} ${a.unit??"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0456\u0432"}`:`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u0432\u0435\u043B\u0438\u043A\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${n.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044F"} \u0431\u0443\u0434\u0435 ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",a=e(n.origin);return a?`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u043C\u0430\u043B\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${n.origin} ${a.verb} ${o}${n.minimum.toString()} ${a.unit}`:`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u043C\u0430\u043B\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${n.origin} \u0431\u0443\u0434\u0435 ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u043F\u043E\u0447\u0438\u043D\u0430\u0442\u0438\u0441\u044F \u0437 "${o.prefix}"`:o.format==="ends_with"?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u0437\u0430\u043A\u0456\u043D\u0447\u0443\u0432\u0430\u0442\u0438\u0441\u044F \u043D\u0430 "${o.suffix}"`:o.format==="includes"?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u043C\u0456\u0441\u0442\u0438\u0442\u0438 "${o.includes}"`:o.format==="regex"?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u0432\u0456\u0434\u043F\u043E\u0432\u0456\u0434\u0430\u0442\u0438 \u0448\u0430\u0431\u043B\u043E\u043D\u0443 ${o.pattern}`:`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 ${i[o.format]??n.format}`}case"not_multiple_of":return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0435 \u0447\u0438\u0441\u043B\u043E: \u043F\u043E\u0432\u0438\u043D\u043D\u043E \u0431\u0443\u0442\u0438 \u043A\u0440\u0430\u0442\u043D\u0438\u043C ${n.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u043E\u0437\u043F\u0456\u0437\u043D\u0430\u043D\u0438\u0439 \u043A\u043B\u044E\u0447${n.keys.length>1?"\u0456":""}: ${Ie(n.keys,", ")}`;case"invalid_key":return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u043A\u043B\u044E\u0447 \u0443 ${n.origin}`;case"invalid_union":return"\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456";case"invalid_element":return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044F \u0443 ${n.origin}`;default:return"\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456"}}};function L$(){return{localeError:QJ()}}var eX=()=>{let t={string:{unit:"\u062D\u0631\u0648\u0641",verb:"\u06C1\u0648\u0646\u0627"},file:{unit:"\u0628\u0627\u0626\u0679\u0633",verb:"\u06C1\u0648\u0646\u0627"},array:{unit:"\u0622\u0626\u0679\u0645\u0632",verb:"\u06C1\u0648\u0646\u0627"},set:{unit:"\u0622\u0626\u0679\u0645\u0632",verb:"\u06C1\u0648\u0646\u0627"}};function e(n){return t[n]??null}let r=n=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"\u0646\u0645\u0628\u0631";case"object":{if(Array.isArray(n))return"\u0622\u0631\u06D2";if(n===null)return"\u0646\u0644";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={regex:"\u0627\u0646 \u067E\u0679",email:"\u0627\u06CC \u0645\u06CC\u0644 \u0627\u06CC\u0688\u0631\u06CC\u0633",url:"\u06CC\u0648 \u0622\u0631 \u0627\u06CC\u0644",emoji:"\u0627\u06CC\u0645\u0648\u062C\u06CC",uuid:"\u06CC\u0648 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",uuidv4:"\u06CC\u0648 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC \u0648\u06CC 4",uuidv6:"\u06CC\u0648 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC \u0648\u06CC 6",nanoid:"\u0646\u06CC\u0646\u0648 \u0622\u0626\u06CC \u0688\u06CC",guid:"\u062C\u06CC \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",cuid:"\u0633\u06CC \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",cuid2:"\u0633\u06CC \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC 2",ulid:"\u06CC\u0648 \u0627\u06CC\u0644 \u0622\u0626\u06CC \u0688\u06CC",xid:"\u0627\u06CC\u06A9\u0633 \u0622\u0626\u06CC \u0688\u06CC",ksuid:"\u06A9\u06D2 \u0627\u06CC\u0633 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",datetime:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u0688\u06CC\u0679 \u0679\u0627\u0626\u0645",date:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u062A\u0627\u0631\u06CC\u062E",time:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u0648\u0642\u062A",duration:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u0645\u062F\u062A",ipv4:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 4 \u0627\u06CC\u0688\u0631\u06CC\u0633",ipv6:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 6 \u0627\u06CC\u0688\u0631\u06CC\u0633",cidrv4:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 4 \u0631\u06CC\u0646\u062C",cidrv6:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 6 \u0631\u06CC\u0646\u062C",base64:"\u0628\u06CC\u0633 64 \u0627\u0646 \u06A9\u0648\u0688\u0688 \u0633\u0679\u0631\u0646\u06AF",base64url:"\u0628\u06CC\u0633 64 \u06CC\u0648 \u0622\u0631 \u0627\u06CC\u0644 \u0627\u0646 \u06A9\u0648\u0688\u0688 \u0633\u0679\u0631\u0646\u06AF",json_string:"\u062C\u06D2 \u0627\u06CC\u0633 \u0627\u0648 \u0627\u06CC\u0646 \u0633\u0679\u0631\u0646\u06AF",e164:"\u0627\u06CC 164 \u0646\u0645\u0628\u0631",jwt:"\u062C\u06D2 \u0688\u0628\u0644\u06CC\u0648 \u0679\u06CC",template_literal:"\u0627\u0646 \u067E\u0679"};return n=>{switch(n.code){case"invalid_type":return`\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679: ${n.expected} \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627\u060C ${r(n.input)} \u0645\u0648\u0635\u0648\u0644 \u06C1\u0648\u0627`;case"invalid_value":return n.values.length===1?`\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679: ${tt(n.values[0])} \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`:`\u063A\u0644\u0637 \u0622\u067E\u0634\u0646: ${Ie(n.values,"|")} \u0645\u06CC\u06BA \u0633\u06D2 \u0627\u06CC\u06A9 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`;case"too_big":{let o=n.inclusive?"<=":"<",a=e(n.origin);return a?`\u0628\u06C1\u062A \u0628\u0691\u0627: ${n.origin??"\u0648\u06CC\u0644\u06CC\u0648"} \u06A9\u06D2 ${o}${n.maximum.toString()} ${a.unit??"\u0639\u0646\u0627\u0635\u0631"} \u06C1\u0648\u0646\u06D2 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u06D2`:`\u0628\u06C1\u062A \u0628\u0691\u0627: ${n.origin??"\u0648\u06CC\u0644\u06CC\u0648"} \u06A9\u0627 ${o}${n.maximum.toString()} \u06C1\u0648\u0646\u0627 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`}case"too_small":{let o=n.inclusive?">=":">",a=e(n.origin);return a?`\u0628\u06C1\u062A \u0686\u06BE\u0648\u0679\u0627: ${n.origin} \u06A9\u06D2 ${o}${n.minimum.toString()} ${a.unit} \u06C1\u0648\u0646\u06D2 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u06D2`:`\u0628\u06C1\u062A \u0686\u06BE\u0648\u0679\u0627: ${n.origin} \u06A9\u0627 ${o}${n.minimum.toString()} \u06C1\u0648\u0646\u0627 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`}case"invalid_format":{let o=n;return o.format==="starts_with"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: "${o.prefix}" \u0633\u06D2 \u0634\u0631\u0648\u0639 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:o.format==="ends_with"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: "${o.suffix}" \u067E\u0631 \u062E\u062A\u0645 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:o.format==="includes"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: "${o.includes}" \u0634\u0627\u0645\u0644 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:o.format==="regex"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: \u067E\u06CC\u0679\u0631\u0646 ${o.pattern} \u0633\u06D2 \u0645\u06CC\u0686 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:`\u063A\u0644\u0637 ${i[o.format]??n.format}`}case"not_multiple_of":return`\u063A\u0644\u0637 \u0646\u0645\u0628\u0631: ${n.divisor} \u06A9\u0627 \u0645\u0636\u0627\u0639\u0641 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`;case"unrecognized_keys":return`\u063A\u06CC\u0631 \u062A\u0633\u0644\u06CC\u0645 \u0634\u062F\u06C1 \u06A9\u06CC${n.keys.length>1?"\u0632":""}: ${Ie(n.keys,"\u060C ")}`;case"invalid_key":return`${n.origin} \u0645\u06CC\u06BA \u063A\u0644\u0637 \u06A9\u06CC`;case"invalid_union":return"\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679";case"invalid_element":return`${n.origin} \u0645\u06CC\u06BA \u063A\u0644\u0637 \u0648\u06CC\u0644\u06CC\u0648`;default:return"\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679"}}};function U$(){return{localeError:eX()}}var tX=()=>{let t={string:{unit:"k\xFD t\u1EF1",verb:"c\xF3"},file:{unit:"byte",verb:"c\xF3"},array:{unit:"ph\u1EA7n t\u1EED",verb:"c\xF3"},set:{unit:"ph\u1EA7n t\u1EED",verb:"c\xF3"}};function e(n){return t[n]??null}let r=n=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"s\u1ED1";case"object":{if(Array.isArray(n))return"m\u1EA3ng";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={regex:"\u0111\u1EA7u v\xE0o",email:"\u0111\u1ECBa ch\u1EC9 email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ng\xE0y gi\u1EDD ISO",date:"ng\xE0y ISO",time:"gi\u1EDD ISO",duration:"kho\u1EA3ng th\u1EDDi gian ISO",ipv4:"\u0111\u1ECBa ch\u1EC9 IPv4",ipv6:"\u0111\u1ECBa ch\u1EC9 IPv6",cidrv4:"d\u1EA3i IPv4",cidrv6:"d\u1EA3i IPv6",base64:"chu\u1ED7i m\xE3 h\xF3a base64",base64url:"chu\u1ED7i m\xE3 h\xF3a base64url",json_string:"chu\u1ED7i JSON",e164:"s\u1ED1 E.164",jwt:"JWT",template_literal:"\u0111\u1EA7u v\xE0o"};return n=>{switch(n.code){case"invalid_type":return`\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i ${n.expected}, nh\u1EADn \u0111\u01B0\u1EE3c ${r(n.input)}`;case"invalid_value":return n.values.length===1?`\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i ${tt(n.values[0])}`:`T\xF9y ch\u1ECDn kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i m\u1ED9t trong c\xE1c gi\xE1 tr\u1ECB ${Ie(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",a=e(n.origin);return a?`Qu\xE1 l\u1EDBn: mong \u0111\u1EE3i ${n.origin??"gi\xE1 tr\u1ECB"} ${a.verb} ${o}${n.maximum.toString()} ${a.unit??"ph\u1EA7n t\u1EED"}`:`Qu\xE1 l\u1EDBn: mong \u0111\u1EE3i ${n.origin??"gi\xE1 tr\u1ECB"} ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",a=e(n.origin);return a?`Qu\xE1 nh\u1ECF: mong \u0111\u1EE3i ${n.origin} ${a.verb} ${o}${n.minimum.toString()} ${a.unit}`:`Qu\xE1 nh\u1ECF: mong \u0111\u1EE3i ${n.origin} ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i b\u1EAFt \u0111\u1EA7u b\u1EB1ng "${o.prefix}"`:o.format==="ends_with"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i k\u1EBFt th\xFAc b\u1EB1ng "${o.suffix}"`:o.format==="includes"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i bao g\u1ED3m "${o.includes}"`:o.format==="regex"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i kh\u1EDBp v\u1EDBi m\u1EABu ${o.pattern}`:`${i[o.format]??n.format} kh\xF4ng h\u1EE3p l\u1EC7`}case"not_multiple_of":return`S\u1ED1 kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i l\xE0 b\u1ED9i s\u1ED1 c\u1EE7a ${n.divisor}`;case"unrecognized_keys":return`Kh\xF3a kh\xF4ng \u0111\u01B0\u1EE3c nh\u1EADn d\u1EA1ng: ${Ie(n.keys,", ")}`;case"invalid_key":return`Kh\xF3a kh\xF4ng h\u1EE3p l\u1EC7 trong ${n.origin}`;case"invalid_union":return"\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7";case"invalid_element":return`Gi\xE1 tr\u1ECB kh\xF4ng h\u1EE3p l\u1EC7 trong ${n.origin}`;default:return"\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7"}}};function z$(){return{localeError:tX()}}var rX=()=>{let t={string:{unit:"\u5B57\u7B26",verb:"\u5305\u542B"},file:{unit:"\u5B57\u8282",verb:"\u5305\u542B"},array:{unit:"\u9879",verb:"\u5305\u542B"},set:{unit:"\u9879",verb:"\u5305\u542B"}};function e(n){return t[n]??null}let r=n=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"\u975E\u6570\u5B57(NaN)":"\u6570\u5B57";case"object":{if(Array.isArray(n))return"\u6570\u7EC4";if(n===null)return"\u7A7A\u503C(null)";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={regex:"\u8F93\u5165",email:"\u7535\u5B50\u90AE\u4EF6",url:"URL",emoji:"\u8868\u60C5\u7B26\u53F7",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO\u65E5\u671F\u65F6\u95F4",date:"ISO\u65E5\u671F",time:"ISO\u65F6\u95F4",duration:"ISO\u65F6\u957F",ipv4:"IPv4\u5730\u5740",ipv6:"IPv6\u5730\u5740",cidrv4:"IPv4\u7F51\u6BB5",cidrv6:"IPv6\u7F51\u6BB5",base64:"base64\u7F16\u7801\u5B57\u7B26\u4E32",base64url:"base64url\u7F16\u7801\u5B57\u7B26\u4E32",json_string:"JSON\u5B57\u7B26\u4E32",e164:"E.164\u53F7\u7801",jwt:"JWT",template_literal:"\u8F93\u5165"};return n=>{switch(n.code){case"invalid_type":return`\u65E0\u6548\u8F93\u5165\uFF1A\u671F\u671B ${n.expected}\uFF0C\u5B9E\u9645\u63A5\u6536 ${r(n.input)}`;case"invalid_value":return n.values.length===1?`\u65E0\u6548\u8F93\u5165\uFF1A\u671F\u671B ${tt(n.values[0])}`:`\u65E0\u6548\u9009\u9879\uFF1A\u671F\u671B\u4EE5\u4E0B\u4E4B\u4E00 ${Ie(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",a=e(n.origin);return a?`\u6570\u503C\u8FC7\u5927\uFF1A\u671F\u671B ${n.origin??"\u503C"} ${o}${n.maximum.toString()} ${a.unit??"\u4E2A\u5143\u7D20"}`:`\u6570\u503C\u8FC7\u5927\uFF1A\u671F\u671B ${n.origin??"\u503C"} ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",a=e(n.origin);return a?`\u6570\u503C\u8FC7\u5C0F\uFF1A\u671F\u671B ${n.origin} ${o}${n.minimum.toString()} ${a.unit}`:`\u6570\u503C\u8FC7\u5C0F\uFF1A\u671F\u671B ${n.origin} ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u4EE5 "${o.prefix}" \u5F00\u5934`:o.format==="ends_with"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u4EE5 "${o.suffix}" \u7ED3\u5C3E`:o.format==="includes"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u5305\u542B "${o.includes}"`:o.format==="regex"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u6EE1\u8DB3\u6B63\u5219\u8868\u8FBE\u5F0F ${o.pattern}`:`\u65E0\u6548${i[o.format]??n.format}`}case"not_multiple_of":return`\u65E0\u6548\u6570\u5B57\uFF1A\u5FC5\u987B\u662F ${n.divisor} \u7684\u500D\u6570`;case"unrecognized_keys":return`\u51FA\u73B0\u672A\u77E5\u7684\u952E(key): ${Ie(n.keys,", ")}`;case"invalid_key":return`${n.origin} \u4E2D\u7684\u952E(key)\u65E0\u6548`;case"invalid_union":return"\u65E0\u6548\u8F93\u5165";case"invalid_element":return`${n.origin} \u4E2D\u5305\u542B\u65E0\u6548\u503C(value)`;default:return"\u65E0\u6548\u8F93\u5165"}}};function V$(){return{localeError:rX()}}var nX=()=>{let t={string:{unit:"\u5B57\u5143",verb:"\u64C1\u6709"},file:{unit:"\u4F4D\u5143\u7D44",verb:"\u64C1\u6709"},array:{unit:"\u9805\u76EE",verb:"\u64C1\u6709"},set:{unit:"\u9805\u76EE",verb:"\u64C1\u6709"}};function e(n){return t[n]??null}let r=n=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"number";case"object":{if(Array.isArray(n))return"array";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={regex:"\u8F38\u5165",email:"\u90F5\u4EF6\u5730\u5740",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u65E5\u671F\u6642\u9593",date:"ISO \u65E5\u671F",time:"ISO \u6642\u9593",duration:"ISO \u671F\u9593",ipv4:"IPv4 \u4F4D\u5740",ipv6:"IPv6 \u4F4D\u5740",cidrv4:"IPv4 \u7BC4\u570D",cidrv6:"IPv6 \u7BC4\u570D",base64:"base64 \u7DE8\u78BC\u5B57\u4E32",base64url:"base64url \u7DE8\u78BC\u5B57\u4E32",json_string:"JSON \u5B57\u4E32",e164:"E.164 \u6578\u503C",jwt:"JWT",template_literal:"\u8F38\u5165"};return n=>{switch(n.code){case"invalid_type":return`\u7121\u6548\u7684\u8F38\u5165\u503C\uFF1A\u9810\u671F\u70BA ${n.expected}\uFF0C\u4F46\u6536\u5230 ${r(n.input)}`;case"invalid_value":return n.values.length===1?`\u7121\u6548\u7684\u8F38\u5165\u503C\uFF1A\u9810\u671F\u70BA ${tt(n.values[0])}`:`\u7121\u6548\u7684\u9078\u9805\uFF1A\u9810\u671F\u70BA\u4EE5\u4E0B\u5176\u4E2D\u4E4B\u4E00 ${Ie(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",a=e(n.origin);return a?`\u6578\u503C\u904E\u5927\uFF1A\u9810\u671F ${n.origin??"\u503C"} \u61C9\u70BA ${o}${n.maximum.toString()} ${a.unit??"\u500B\u5143\u7D20"}`:`\u6578\u503C\u904E\u5927\uFF1A\u9810\u671F ${n.origin??"\u503C"} \u61C9\u70BA ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",a=e(n.origin);return a?`\u6578\u503C\u904E\u5C0F\uFF1A\u9810\u671F ${n.origin} \u61C9\u70BA ${o}${n.minimum.toString()} ${a.unit}`:`\u6578\u503C\u904E\u5C0F\uFF1A\u9810\u671F ${n.origin} \u61C9\u70BA ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u4EE5 "${o.prefix}" \u958B\u982D`:o.format==="ends_with"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u4EE5 "${o.suffix}" \u7D50\u5C3E`:o.format==="includes"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u5305\u542B "${o.includes}"`:o.format==="regex"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u7B26\u5408\u683C\u5F0F ${o.pattern}`:`\u7121\u6548\u7684 ${i[o.format]??n.format}`}case"not_multiple_of":return`\u7121\u6548\u7684\u6578\u5B57\uFF1A\u5FC5\u9808\u70BA ${n.divisor} \u7684\u500D\u6578`;case"unrecognized_keys":return`\u7121\u6CD5\u8B58\u5225\u7684\u9375\u503C${n.keys.length>1?"\u5011":""}\uFF1A${Ie(n.keys,"\u3001")}`;case"invalid_key":return`${n.origin} \u4E2D\u6709\u7121\u6548\u7684\u9375\u503C`;case"invalid_union":return"\u7121\u6548\u7684\u8F38\u5165\u503C";case"invalid_element":return`${n.origin} \u4E2D\u6709\u7121\u6548\u7684\u503C`;default:return"\u7121\u6548\u7684\u8F38\u5165\u503C"}}};function q$(){return{localeError:nX()}}var iX=()=>{let t={string:{unit:"\xE0mi",verb:"n\xED"},file:{unit:"bytes",verb:"n\xED"},array:{unit:"nkan",verb:"n\xED"},set:{unit:"nkan",verb:"n\xED"}};function e(n){return t[n]??null}let r=n=>{let o=typeof n;switch(o){case"number":return Number.isNaN(n)?"NaN":"n\u1ECD\u0301mb\xE0";case"object":{if(Array.isArray(n))return"akop\u1ECD";if(n===null)return"null";if(Object.getPrototypeOf(n)!==Object.prototype&&n.constructor)return n.constructor.name}}return o},i={regex:"\u1EB9\u0300r\u1ECD \xECb\xE1w\u1ECDl\xE9",email:"\xE0d\xEDr\u1EB9\u0301s\xEC \xECm\u1EB9\u0301l\xEC",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\xE0k\xF3k\xF2 ISO",date:"\u1ECDj\u1ECD\u0301 ISO",time:"\xE0k\xF3k\xF2 ISO",duration:"\xE0k\xF3k\xF2 t\xF3 p\xE9 ISO",ipv4:"\xE0d\xEDr\u1EB9\u0301s\xEC IPv4",ipv6:"\xE0d\xEDr\u1EB9\u0301s\xEC IPv6",cidrv4:"\xE0gb\xE8gb\xE8 IPv4",cidrv6:"\xE0gb\xE8gb\xE8 IPv6",base64:"\u1ECD\u0300r\u1ECD\u0300 t\xED a k\u1ECD\u0301 n\xED base64",base64url:"\u1ECD\u0300r\u1ECD\u0300 base64url",json_string:"\u1ECD\u0300r\u1ECD\u0300 JSON",e164:"n\u1ECD\u0301mb\xE0 E.164",jwt:"JWT",template_literal:"\u1EB9\u0300r\u1ECD \xECb\xE1w\u1ECDl\xE9"};return n=>{switch(n.code){case"invalid_type":return`\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e: a n\xED l\xE1ti fi ${n.expected}, \xE0m\u1ECD\u0300 a r\xED ${r(n.input)}`;case"invalid_value":return n.values.length===1?`\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e: a n\xED l\xE1ti fi ${tt(n.values[0])}`:`\xC0\u1E63\xE0y\xE0n a\u1E63\xEC\u1E63e: yan \u1ECD\u0300kan l\xE1ra ${Ie(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",a=e(n.origin);return a?`T\xF3 p\u1ECD\u0300 j\xF9: a n\xED l\xE1ti j\u1EB9\u0301 p\xE9 ${n.origin??"iye"} ${a.verb} ${o}${n.maximum} ${a.unit}`:`T\xF3 p\u1ECD\u0300 j\xF9: a n\xED l\xE1ti j\u1EB9\u0301 ${o}${n.maximum}`}case"too_small":{let o=n.inclusive?">=":">",a=e(n.origin);return a?`K\xE9r\xE9 ju: a n\xED l\xE1ti j\u1EB9\u0301 p\xE9 ${n.origin} ${a.verb} ${o}${n.minimum} ${a.unit}`:`K\xE9r\xE9 ju: a n\xED l\xE1ti j\u1EB9\u0301 ${o}${n.minimum}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 b\u1EB9\u0300r\u1EB9\u0300 p\u1EB9\u0300l\xFA "${o.prefix}"`:o.format==="ends_with"?`\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 par\xED p\u1EB9\u0300l\xFA "${o.suffix}"`:o.format==="includes"?`\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 n\xED "${o.includes}"`:o.format==="regex"?`\u1ECC\u0300r\u1ECD\u0300 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 b\xE1 \xE0p\u1EB9\u1EB9r\u1EB9 mu ${o.pattern}`:`A\u1E63\xEC\u1E63e: ${i[o.format]??n.format}`}case"not_multiple_of":return`N\u1ECD\u0301mb\xE0 a\u1E63\xEC\u1E63e: gb\u1ECD\u0301d\u1ECD\u0300 j\u1EB9\u0301 \xE8y\xE0 p\xEDp\xEDn ti ${n.divisor}`;case"unrecognized_keys":return`B\u1ECDt\xECn\xEC \xE0\xECm\u1ECD\u0300: ${Ie(n.keys,", ")}`;case"invalid_key":return`B\u1ECDt\xECn\xEC a\u1E63\xEC\u1E63e n\xEDn\xFA ${n.origin}`;case"invalid_union":return"\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e";case"invalid_element":return`Iye a\u1E63\xEC\u1E63e n\xEDn\xFA ${n.origin}`;default:return"\xCCb\xE1w\u1ECDl\xE9 a\u1E63\xEC\u1E63e"}}};function j$(){return{localeError:iX()}}var R1=Symbol("ZodOutput"),L1=Symbol("ZodInput"),Ac=class{constructor(){this._map=new Map,this._idmap=new Map}add(e,...r){let i=r[0];if(this._map.set(e,i),i&&typeof i=="object"&&"id"in i){if(this._idmap.has(i.id))throw new Error(`ID ${i.id} already exists in the registry`);this._idmap.set(i.id,e)}return this}clear(){return this._map=new Map,this._idmap=new Map,this}remove(e){let r=this._map.get(e);return r&&typeof r=="object"&&"id"in r&&this._idmap.delete(r.id),this._map.delete(e),this}get(e){let r=e._zod.parent;if(r){let i={...this.get(r)??{}};delete i.id;let n={...i,...this._map.get(e)};return Object.keys(n).length?n:void 0}return this._map.get(e)}has(e){return this._map.has(e)}};function sg(){return new Ac}var Wa=sg();function U1(t,e){return new t({type:"string",...Ye(e)})}function z1(t,e){return new t({type:"string",coerce:!0,...Ye(e)})}function ug(t,e){return new t({type:"string",format:"email",check:"string_format",abort:!1,...Ye(e)})}function Ep(t,e){return new t({type:"string",format:"guid",check:"string_format",abort:!1,...Ye(e)})}function lg(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,...Ye(e)})}function cg(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...Ye(e)})}function fg(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...Ye(e)})}function pg(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...Ye(e)})}function mg(t,e){return new t({type:"string",format:"url",check:"string_format",abort:!1,...Ye(e)})}function dg(t,e){return new t({type:"string",format:"emoji",check:"string_format",abort:!1,...Ye(e)})}function hg(t,e){return new t({type:"string",format:"nanoid",check:"string_format",abort:!1,...Ye(e)})}function gg(t,e){return new t({type:"string",format:"cuid",check:"string_format",abort:!1,...Ye(e)})}function vg(t,e){return new t({type:"string",format:"cuid2",check:"string_format",abort:!1,...Ye(e)})}function yg(t,e){return new t({type:"string",format:"ulid",check:"string_format",abort:!1,...Ye(e)})}function bg(t,e){return new t({type:"string",format:"xid",check:"string_format",abort:!1,...Ye(e)})}function xg(t,e){return new t({type:"string",format:"ksuid",check:"string_format",abort:!1,...Ye(e)})}function _g(t,e){return new t({type:"string",format:"ipv4",check:"string_format",abort:!1,...Ye(e)})}function wg(t,e){return new t({type:"string",format:"ipv6",check:"string_format",abort:!1,...Ye(e)})}function Sg(t,e){return new t({type:"string",format:"cidrv4",check:"string_format",abort:!1,...Ye(e)})}function Dg(t,e){return new t({type:"string",format:"cidrv6",check:"string_format",abort:!1,...Ye(e)})}function Eg(t,e){return new t({type:"string",format:"base64",check:"string_format",abort:!1,...Ye(e)})}function Ag(t,e){return new t({type:"string",format:"base64url",check:"string_format",abort:!1,...Ye(e)})}function Tg(t,e){return new t({type:"string",format:"e164",check:"string_format",abort:!1,...Ye(e)})}function Ng(t,e){return new t({type:"string",format:"jwt",check:"string_format",abort:!1,...Ye(e)})}var V1={Any:null,Minute:-1,Second:0,Millisecond:3,Microsecond:6};function q1(t,e){return new t({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...Ye(e)})}function j1(t,e){return new t({type:"string",format:"date",check:"string_format",...Ye(e)})}function Z1(t,e){return new t({type:"string",format:"time",check:"string_format",precision:null,...Ye(e)})}function G1(t,e){return new t({type:"string",format:"duration",check:"string_format",...Ye(e)})}function W1(t,e){return new t({type:"number",checks:[],...Ye(e)})}function H1(t,e){return new t({type:"number",coerce:!0,checks:[],...Ye(e)})}function Y1(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"safeint",...Ye(e)})}function J1(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"float32",...Ye(e)})}function X1(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"float64",...Ye(e)})}function K1(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"int32",...Ye(e)})}function Q1(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"uint32",...Ye(e)})}function eS(t,e){return new t({type:"boolean",...Ye(e)})}function tS(t,e){return new t({type:"boolean",coerce:!0,...Ye(e)})}function rS(t,e){return new t({type:"bigint",...Ye(e)})}function nS(t,e){return new t({type:"bigint",coerce:!0,...Ye(e)})}function iS(t,e){return new t({type:"bigint",check:"bigint_format",abort:!1,format:"int64",...Ye(e)})}function oS(t,e){return new t({type:"bigint",check:"bigint_format",abort:!1,format:"uint64",...Ye(e)})}function aS(t,e){return new t({type:"symbol",...Ye(e)})}function sS(t,e){return new t({type:"undefined",...Ye(e)})}function uS(t,e){return new t({type:"null",...Ye(e)})}function lS(t){return new t({type:"any"})}function Tc(t){return new t({type:"unknown"})}function cS(t,e){return new t({type:"never",...Ye(e)})}function fS(t,e){return new t({type:"void",...Ye(e)})}function pS(t,e){return new t({type:"date",...Ye(e)})}function mS(t,e){return new t({type:"date",coerce:!0,...Ye(e)})}function dS(t,e){return new t({type:"nan",...Ye(e)})}function Rs(t,e){return new Qh({check:"less_than",...Ye(e),value:t,inclusive:!1})}function ea(t,e){return new Qh({check:"less_than",...Ye(e),value:t,inclusive:!0})}function Ls(t,e){return new eg({check:"greater_than",...Ye(e),value:t,inclusive:!1})}function so(t,e){return new eg({check:"greater_than",...Ye(e),value:t,inclusive:!0})}function hS(t){return Ls(0,t)}function gS(t){return Rs(0,t)}function vS(t){return ea(0,t)}function yS(t){return so(0,t)}function ml(t,e){return new gw({check:"multiple_of",...Ye(e),value:t})}function Nc(t,e){return new bw({check:"max_size",...Ye(e),maximum:t})}function dl(t,e){return new xw({check:"min_size",...Ye(e),minimum:t})}function Ap(t,e){return new _w({check:"size_equals",...Ye(e),size:t})}function Mc(t,e){return new ww({check:"max_length",...Ye(e),maximum:t})}function bu(t,e){return new Sw({check:"min_length",...Ye(e),minimum:t})}function Cc(t,e){return new Dw({check:"length_equals",...Ye(e),length:t})}function Tp(t,e){return new Ew({check:"string_format",format:"regex",...Ye(e),pattern:t})}function Np(t){return new Aw({check:"string_format",format:"lowercase",...Ye(t)})}function Mp(t){return new Tw({check:"string_format",format:"uppercase",...Ye(t)})}function Cp(t,e){return new Nw({check:"string_format",format:"includes",...Ye(e),includes:t})}function $p(t,e){return new Mw({check:"string_format",format:"starts_with",...Ye(e),prefix:t})}function Ip(t,e){return new Cw({check:"string_format",format:"ends_with",...Ye(e),suffix:t})}function bS(t,e,r){return new $w({check:"property",property:t,schema:e,...Ye(r)})}function Fp(t,e){return new Iw({check:"mime_type",mime:t,...Ye(e)})}function Us(t){return new Fw({check:"overwrite",tx:t})}function kp(t){return Us(e=>e.normalize(t))}function Pp(){return Us(t=>t.trim())}function Bp(){return Us(t=>t.toLowerCase())}function Op(){return Us(t=>t.toUpperCase())}function Rp(t,e,r){return new t({type:"array",element:e,...Ye(r)})}function oX(t,e,r){return new t({type:"union",options:e,...Ye(r)})}function aX(t,e,r,i){return new t({type:"union",options:r,discriminator:e,...Ye(i)})}function sX(t,e,r){return new t({type:"intersection",left:e,right:r})}function xS(t,e,r,i){let n=r instanceof ar,o=n?i:r,a=n?r:null;return new t({type:"tuple",items:e,rest:a,...Ye(o)})}function uX(t,e,r,i){return new t({type:"record",keyType:e,valueType:r,...Ye(i)})}function lX(t,e,r,i){return new t({type:"map",keyType:e,valueType:r,...Ye(i)})}function cX(t,e,r){return new t({type:"set",valueType:e,...Ye(r)})}function fX(t,e,r){let i=Array.isArray(e)?Object.fromEntries(e.map(n=>[n,n])):e;return new t({type:"enum",entries:i,...Ye(r)})}function pX(t,e,r){return new t({type:"enum",entries:e,...Ye(r)})}function mX(t,e,r){return new t({type:"literal",values:Array.isArray(e)?e:[e],...Ye(r)})}function _S(t,e){return new t({type:"file",...Ye(e)})}function dX(t,e){return new t({type:"transform",transform:e})}function hX(t,e){return new t({type:"optional",innerType:e})}function gX(t,e){return new t({type:"nullable",innerType:e})}function vX(t,e,r){return new t({type:"default",innerType:e,get defaultValue(){return typeof r=="function"?r():I0(r)}})}function yX(t,e,r){return new t({type:"nonoptional",innerType:e,...Ye(r)})}function bX(t,e){return new t({type:"success",innerType:e})}function xX(t,e,r){return new t({type:"catch",innerType:e,catchValue:typeof r=="function"?r:()=>r})}function _X(t,e,r){return new t({type:"pipe",in:e,out:r})}function wX(t,e){return new t({type:"readonly",innerType:e})}function SX(t,e,r){return new t({type:"template_literal",parts:e,...Ye(r)})}function DX(t,e){return new t({type:"lazy",getter:e})}function EX(t,e){return new t({type:"promise",innerType:e})}function wS(t,e,r){let i=Ye(r);return i.abort??(i.abort=!0),new t({type:"custom",check:"custom",fn:e,...i})}function SS(t,e,r){return new t({type:"custom",check:"custom",fn:e,...Ye(r)})}function DS(t){let e=Z$(r=>(r.addIssue=i=>{if(typeof i=="string")r.issues.push(wc(i,r.value,e._zod.def));else{let n=i;n.fatal&&(n.continue=!1),n.code??(n.code="custom"),n.input??(n.input=r.value),n.inst??(n.inst=e),n.continue??(n.continue=!e._zod.def.abort),r.issues.push(wc(n))}},t(r.value,r)));return e}function Z$(t,e){let r=new an({check:"custom",...Ye(e)});return r._zod.check=t,r}function ES(t,e){let r=Ye(e),i=r.truthy??["true","1","yes","on","y","enabled"],n=r.falsy??["false","0","no","off","n","disabled"];r.case!=="sensitive"&&(i=i.map(d=>typeof d=="string"?d.toLowerCase():d),n=n.map(d=>typeof d=="string"?d.toLowerCase():d));let o=new Set(i),a=new Set(n),s=t.Pipe??Sp,l=t.Boolean??xp,u=t.String??fl,c=t.Transform??wp,f=new c({type:"transform",transform:(d,h)=>{let v=d;return r.case!=="sensitive"&&(v=v.toLowerCase()),o.has(v)?!0:a.has(v)?!1:(h.issues.push({code:"invalid_value",expected:"stringbool",values:[...o,...a],input:h.value,inst:f,continue:!1}),{})},error:r.error}),m=new s({type:"pipe",in:new u({type:"string",error:r.error}),out:f,error:r.error});return new s({type:"pipe",in:m,out:new l({type:"boolean",error:r.error}),error:r.error})}function Mg(t,e,r,i={}){let n=Ye(i),o={...Ye(i),check:"string_format",type:"string",format:e,fn:typeof r=="function"?r:s=>r.test(s),...n};return r instanceof RegExp&&(o.pattern=r),new t(o)}var Cg=class{constructor(e){this._def=e,this.def=e}implement(e){if(typeof e!="function")throw new Error("implement() must be called with a function");let r=(...i)=>{let n=this._def.input?Wh(this._def.input,i,void 0,{callee:r}):i;if(!Array.isArray(n))throw new Error("Invalid arguments schema: not an array or tuple schema.");let o=e(...n);return this._def.output?Wh(this._def.output,o,void 0,{callee:r}):o};return r}implementAsync(e){if(typeof e!="function")throw new Error("implement() must be called with a function");let r=async(...i)=>{let n=this._def.input?await Yh(this._def.input,i,void 0,{callee:r}):i;if(!Array.isArray(n))throw new Error("Invalid arguments schema: not an array or tuple schema.");let o=await e(...n);return this._def.output?Yh(this._def.output,o,void 0,{callee:r}):o};return r}input(...e){let r=this.constructor;return Array.isArray(e[0])?new r({type:"function",input:new pl({type:"tuple",items:e[0],rest:e[1]}),output:this._def.output}):new r({type:"function",input:e[0],output:this._def.output})}output(e){let r=this.constructor;return new r({type:"function",input:this._def.input,output:e})}};function AS(t){return new Cg({type:"function",input:Array.isArray(t?.input)?xS(pl,t?.input):t?.input??Rp(_p,Tc(Ec)),output:t?.output??Tc(Ec)})}var Lp=class{constructor(e){this.counter=0,this.metadataRegistry=e?.metadata??Wa,this.target=e?.target??"draft-2020-12",this.unrepresentable=e?.unrepresentable??"throw",this.override=e?.override??(()=>{}),this.io=e?.io??"output",this.seen=new Map}process(e,r={path:[],schemaPath:[]}){var i;let n=e._zod.def,o={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},a=this.seen.get(e);if(a)return a.count++,r.schemaPath.includes(e)&&(a.cycle=r.path),a.schema;let s={schema:{},count:1,cycle:void 0,path:r.path};this.seen.set(e,s);let l=e._zod.toJSONSchema?.();if(l)s.schema=l;else{let f={...r,schemaPath:[...r.schemaPath,e],path:r.path},m=e._zod.parent;if(m)s.ref=m,this.process(m,f),this.seen.get(m).isParent=!0;else{let p=s.schema;switch(n.type){case"string":{let d=p;d.type="string";let{minimum:h,maximum:v,format:y,patterns:S,contentEncoding:b}=e._zod.bag;if(typeof h=="number"&&(d.minLength=h),typeof v=="number"&&(d.maxLength=v),y&&(d.format=o[y]??y,d.format===""&&delete d.format),b&&(d.contentEncoding=b),S&&S.size>0){let _=[...S];_.length===1?d.pattern=_[0].source:_.length>1&&(s.schema.allOf=[..._.map(w=>({...this.target==="draft-7"||this.target==="draft-4"?{type:"string"}:{},pattern:w.source}))])}break}case"number":{let d=p,{minimum:h,maximum:v,format:y,multipleOf:S,exclusiveMaximum:b,exclusiveMinimum:_}=e._zod.bag;typeof y=="string"&&y.includes("int")?d.type="integer":d.type="number",typeof _=="number"&&(this.target==="draft-4"?(d.minimum=_,d.exclusiveMinimum=!0):d.exclusiveMinimum=_),typeof h=="number"&&(d.minimum=h,typeof _=="number"&&this.target!=="draft-4"&&(_>=h?delete d.minimum:delete d.exclusiveMinimum)),typeof b=="number"&&(this.target==="draft-4"?(d.maximum=b,d.exclusiveMaximum=!0):d.exclusiveMaximum=b),typeof v=="number"&&(d.maximum=v,typeof b=="number"&&this.target!=="draft-4"&&(b<=v?delete d.maximum:delete d.exclusiveMaximum)),typeof S=="number"&&(d.multipleOf=S);break}case"boolean":{let d=p;d.type="boolean";break}case"bigint":{if(this.unrepresentable==="throw")throw new Error("BigInt cannot be represented in JSON Schema");break}case"symbol":{if(this.unrepresentable==="throw")throw new Error("Symbols cannot be represented in JSON Schema");break}case"null":{p.type="null";break}case"any":break;case"unknown":break;case"undefined":{if(this.unrepresentable==="throw")throw new Error("Undefined cannot be represented in JSON Schema");break}case"void":{if(this.unrepresentable==="throw")throw new Error("Void cannot be represented in JSON Schema");break}case"never":{p.not={};break}case"date":{if(this.unrepresentable==="throw")throw new Error("Date cannot be represented in JSON Schema");break}case"array":{let d=p,{minimum:h,maximum:v}=e._zod.bag;typeof h=="number"&&(d.minItems=h),typeof v=="number"&&(d.maxItems=v),d.type="array",d.items=this.process(n.element,{...f,path:[...f.path,"items"]});break}case"object":{let d=p;d.type="object",d.properties={};let h=n.shape;for(let S in h)d.properties[S]=this.process(h[S],{...f,path:[...f.path,"properties",S]});let v=new Set(Object.keys(h)),y=new Set([...v].filter(S=>{let b=n.shape[S]._zod;return this.io==="input"?b.optin===void 0:b.optout===void 0}));y.size>0&&(d.required=Array.from(y)),n.catchall?._zod.def.type==="never"?d.additionalProperties=!1:n.catchall?n.catchall&&(d.additionalProperties=this.process(n.catchall,{...f,path:[...f.path,"additionalProperties"]})):this.io==="output"&&(d.additionalProperties=!1);break}case"union":{let d=p;d.anyOf=n.options.map((h,v)=>this.process(h,{...f,path:[...f.path,"anyOf",v]}));break}case"intersection":{let d=p,h=this.process(n.left,{...f,path:[...f.path,"allOf",0]}),v=this.process(n.right,{...f,path:[...f.path,"allOf",1]}),y=b=>"allOf"in b&&Object.keys(b).length===1,S=[...y(h)?h.allOf:[h],...y(v)?v.allOf:[v]];d.allOf=S;break}case"tuple":{let d=p;d.type="array";let h=n.items.map((S,b)=>this.process(S,{...f,path:[...f.path,"prefixItems",b]}));if(this.target==="draft-2020-12"?d.prefixItems=h:d.items=h,n.rest){let S=this.process(n.rest,{...f,path:[...f.path,"items"]});this.target==="draft-2020-12"?d.items=S:d.additionalItems=S}n.rest&&(d.items=this.process(n.rest,{...f,path:[...f.path,"items"]}));let{minimum:v,maximum:y}=e._zod.bag;typeof v=="number"&&(d.minItems=v),typeof y=="number"&&(d.maxItems=y);break}case"record":{let d=p;d.type="object",this.target!=="draft-4"&&(d.propertyNames=this.process(n.keyType,{...f,path:[...f.path,"propertyNames"]})),d.additionalProperties=this.process(n.valueType,{...f,path:[...f.path,"additionalProperties"]});break}case"map":{if(this.unrepresentable==="throw")throw new Error("Map cannot be represented in JSON Schema");break}case"set":{if(this.unrepresentable==="throw")throw new Error("Set cannot be represented in JSON Schema");break}case"enum":{let d=p,h=cp(n.entries);h.every(v=>typeof v=="number")&&(d.type="number"),h.every(v=>typeof v=="string")&&(d.type="string"),d.enum=h;break}case"literal":{let d=p,h=[];for(let v of n.values)if(v===void 0){if(this.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof v=="bigint"){if(this.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");h.push(Number(v))}else h.push(v);if(h.length!==0)if(h.length===1){let v=h[0];d.type=v===null?"null":typeof v,this.target==="draft-4"?d.enum=[v]:d.const=v}else h.every(v=>typeof v=="number")&&(d.type="number"),h.every(v=>typeof v=="string")&&(d.type="string"),h.every(v=>typeof v=="boolean")&&(d.type="string"),h.every(v=>v===null)&&(d.type="null"),d.enum=h;break}case"file":{let d=p,h={type:"string",format:"binary",contentEncoding:"binary"},{minimum:v,maximum:y,mime:S}=e._zod.bag;v!==void 0&&(h.minLength=v),y!==void 0&&(h.maxLength=y),S?S.length===1?(h.contentMediaType=S[0],Object.assign(d,h)):d.anyOf=S.map(b=>({...h,contentMediaType:b})):Object.assign(d,h);break}case"transform":{if(this.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema");break}case"nullable":{let d=this.process(n.innerType,f);p.anyOf=[d,{type:"null"}];break}case"nonoptional":{this.process(n.innerType,f),s.ref=n.innerType;break}case"success":{let d=p;d.type="boolean";break}case"default":{this.process(n.innerType,f),s.ref=n.innerType,p.default=JSON.parse(JSON.stringify(n.defaultValue));break}case"prefault":{this.process(n.innerType,f),s.ref=n.innerType,this.io==="input"&&(p._prefault=JSON.parse(JSON.stringify(n.defaultValue)));break}case"catch":{this.process(n.innerType,f),s.ref=n.innerType;let d;try{d=n.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}p.default=d;break}case"nan":{if(this.unrepresentable==="throw")throw new Error("NaN cannot be represented in JSON Schema");break}case"template_literal":{let d=p,h=e._zod.pattern;if(!h)throw new Error("Pattern not found in template literal");d.type="string",d.pattern=h.source;break}case"pipe":{let d=this.io==="input"?n.in._zod.def.type==="transform"?n.out:n.in:n.out;this.process(d,f),s.ref=d;break}case"readonly":{this.process(n.innerType,f),s.ref=n.innerType,p.readOnly=!0;break}case"promise":{this.process(n.innerType,f),s.ref=n.innerType;break}case"optional":{this.process(n.innerType,f),s.ref=n.innerType;break}case"lazy":{let d=e._zod.innerType;this.process(d,f),s.ref=d;break}case"custom":{if(this.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema");break}default:}}}let u=this.metadataRegistry.get(e);return u&&Object.assign(s.schema,u),this.io==="input"&&Kn(e)&&(delete s.schema.examples,delete s.schema.default),this.io==="input"&&s.schema._prefault&&((i=s.schema).default??(i.default=s.schema._prefault)),delete s.schema._prefault,this.seen.get(e).schema}emit(e,r){let i={cycles:r?.cycles??"ref",reused:r?.reused??"inline",external:r?.external??void 0},n=this.seen.get(e);if(!n)throw new Error("Unprocessed schema. This is a bug in Zod.");let o=c=>{let f=this.target==="draft-2020-12"?"$defs":"definitions";if(i.external){let h=i.external.registry.get(c[0])?.id,v=i.external.uri??(S=>S);if(h)return{ref:v(h)};let y=c[1].defId??c[1].schema.id??`schema${this.counter++}`;return c[1].defId=y,{defId:y,ref:`${v("__shared")}#/${f}/${y}`}}if(c[1]===n)return{ref:"#"};let p=`#/${f}/`,d=c[1].schema.id??`__schema${this.counter++}`;return{defId:d,ref:p+d}},a=c=>{if(c[1].schema.$ref)return;let f=c[1],{ref:m,defId:p}=o(c);f.def={...f.schema},p&&(f.defId=p);let d=f.schema;for(let h in d)delete d[h];d.$ref=m};if(i.cycles==="throw")for(let c of this.seen.entries()){let f=c[1];if(f.cycle)throw new Error(`Cycle detected: #/${f.cycle?.join("/")}/<root>
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let c of this.seen.entries()){let f=c[1];if(e===c[0]){a(c);continue}if(i.external){let p=i.external.registry.get(c[0])?.id;if(e!==c[0]&&p){a(c);continue}}if(this.metadataRegistry.get(c[0])?.id){a(c);continue}if(f.cycle){a(c);continue}if(f.count>1&&i.reused==="ref"){a(c);continue}}let s=(c,f)=>{let m=this.seen.get(c),p=m.def??m.schema,d={...p};if(m.ref===null)return;let h=m.ref;if(m.ref=null,h){s(h,f);let v=this.seen.get(h).schema;v.$ref&&(f.target==="draft-7"||f.target==="draft-4")?(p.allOf=p.allOf??[],p.allOf.push(v)):(Object.assign(p,v),Object.assign(p,d))}m.isParent||this.override({zodSchema:c,jsonSchema:p,path:m.path??[]})};for(let c of[...this.seen.entries()].reverse())s(c[0],{target:this.target});let l={};if(this.target==="draft-2020-12"?l.$schema="https://json-schema.org/draft/2020-12/schema":this.target==="draft-7"?l.$schema="http://json-schema.org/draft-07/schema#":this.target==="draft-4"?l.$schema="http://json-schema.org/draft-04/schema#":console.warn(`Invalid target: ${this.target}`),i.external?.uri){let c=i.external.registry.get(e)?.id;if(!c)throw new Error("Schema is missing an `id` property");l.$id=i.external.uri(c)}Object.assign(l,n.def);let u=i.external?.defs??{};for(let c of this.seen.entries()){let f=c[1];f.def&&f.defId&&(u[f.defId]=f.def)}i.external||Object.keys(u).length>0&&(this.target==="draft-2020-12"?l.$defs=u:l.definitions=u);try{return JSON.parse(JSON.stringify(l))}catch{throw new Error("Error converting schema to JSON.")}}};function TS(t,e){if(t instanceof Ac){let i=new Lp(e),n={};for(let s of t._idmap.entries()){let[l,u]=s;i.process(u)}let o={},a={registry:t,uri:e?.uri,defs:n};for(let s of t._idmap.entries()){let[l,u]=s;o[l]=i.emit(u,{...e,external:a})}if(Object.keys(n).length>0){let s=i.target==="draft-2020-12"?"$defs":"definitions";o.__shared={[s]:n}}return{schemas:o}}let r=new Lp(e);return r.process(t),r.emit(t,e)}function Kn(t,e){let r=e??{seen:new Set};if(r.seen.has(t))return!1;r.seen.add(t);let n=t._zod.def;switch(n.type){case"string":case"number":case"bigint":case"boolean":case"date":case"symbol":case"undefined":case"null":case"any":case"unknown":case"never":case"void":case"literal":case"enum":case"nan":case"file":case"template_literal":return!1;case"array":return Kn(n.element,r);case"object":{for(let o in n.shape)if(Kn(n.shape[o],r))return!0;return!1}case"union":{for(let o of n.options)if(Kn(o,r))return!0;return!1}case"intersection":return Kn(n.left,r)||Kn(n.right,r);case"tuple":{for(let o of n.items)if(Kn(o,r))return!0;return!!(n.rest&&Kn(n.rest,r))}case"record":return Kn(n.keyType,r)||Kn(n.valueType,r);case"map":return Kn(n.keyType,r)||Kn(n.valueType,r);case"set":return Kn(n.valueType,r);case"promise":case"optional":case"nonoptional":case"nullable":case"readonly":return Kn(n.innerType,r);case"lazy":return Kn(n.getter(),r);case"default":return Kn(n.innerType,r);case"prefault":return Kn(n.innerType,r);case"custom":return!1;case"transform":return!0;case"pipe":return Kn(n.in,r)||Kn(n.out,r);case"success":return!1;case"catch":return!1;default:}throw new Error(`Unknown schema type: ${n.type}`)}var G$={};var Pg={};hs(Pg,{ZodISODate:()=>Ig,ZodISODateTime:()=>$g,ZodISODuration:()=>kg,ZodISOTime:()=>Fg,date:()=>MS,datetime:()=>NS,duration:()=>$S,time:()=>CS});var $g=ye("ZodISODateTime",(t,e)=>{Ww.init(t,e),Kr.init(t,e)});function NS(t){return q1($g,t)}var Ig=ye("ZodISODate",(t,e)=>{Hw.init(t,e),Kr.init(t,e)});function MS(t){return j1(Ig,t)}var Fg=ye("ZodISOTime",(t,e)=>{Yw.init(t,e),Kr.init(t,e)});function CS(t){return Z1(Fg,t)}var kg=ye("ZodISODuration",(t,e)=>{Jw.init(t,e),Kr.init(t,e)});function $S(t){return G1(kg,t)}var H$=(t,e)=>{gp.init(t,e),t.name="ZodError",Object.defineProperties(t,{format:{value:r=>yp(t,r)},flatten:{value:r=>vp(t,r)},addIssue:{value:r=>{t.issues.push(r),t.message=JSON.stringify(t.issues,_c,2)}},addIssues:{value:r=>{t.issues.push(...r),t.message=JSON.stringify(t.issues,_c,2)}},isEmpty:{get(){return t.issues.length===0}}})},TX=ye("ZodError",H$),$c=ye("ZodError",H$,{Parent:Error});var IS=Gh($c),FS=Hh($c),kS=Jh($c),PS=Xh($c);var pr=ye("ZodType",(t,e)=>(ar.init(t,e),t.def=e,Object.defineProperty(t,"_def",{value:e}),t.check=(...r)=>t.clone({...e,checks:[...e.checks??[],...r.map(i=>typeof i=="function"?{_zod:{check:i,def:{check:"custom"},onattach:[]}}:i)]}),t.clone=(r,i)=>ao(t,r,i),t.brand=()=>t,t.register=(r,i)=>(r.add(t,i),t),t.parse=(r,i)=>IS(t,r,i,{callee:t.parse}),t.safeParse=(r,i)=>kS(t,r,i),t.parseAsync=async(r,i)=>FS(t,r,i,{callee:t.parseAsync}),t.safeParseAsync=async(r,i)=>PS(t,r,i),t.spa=t.safeParseAsync,t.refine=(r,i)=>t.check($I(r,i)),t.superRefine=r=>t.check(II(r)),t.overwrite=r=>t.check(Us(r)),t.optional=()=>Rg(t),t.nullable=()=>Lg(t),t.nullish=()=>Rg(Lg(t)),t.nonoptional=r=>xI(t,r),t.array=()=>oD(t),t.or=r=>sD([t,r]),t.and=r=>uI(t,r),t.transform=r=>Ug(t,fD(r)),t.default=r=>vI(t,r),t.prefault=r=>bI(t,r),t.catch=r=>SI(t,r),t.pipe=r=>Ug(t,r),t.readonly=()=>AI(t),t.describe=r=>{let i=t.clone();return Wa.add(i,{description:r}),i},Object.defineProperty(t,"description",{get(){return Wa.get(t)?.description},configurable:!0}),t.meta=(...r)=>{if(r.length===0)return Wa.get(t);let i=t.clone();return Wa.add(i,r[0]),i},t.isOptional=()=>t.safeParse(void 0).success,t.isNullable=()=>t.safeParse(null).success,t)),RS=ye("_ZodString",(t,e)=>{fl.init(t,e),pr.init(t,e);let r=t._zod.bag;t.format=r.format??null,t.minLength=r.minimum??null,t.maxLength=r.maximum??null,t.regex=(...i)=>t.check(Tp(...i)),t.includes=(...i)=>t.check(Cp(...i)),t.startsWith=(...i)=>t.check($p(...i)),t.endsWith=(...i)=>t.check(Ip(...i)),t.min=(...i)=>t.check(bu(...i)),t.max=(...i)=>t.check(Mc(...i)),t.length=(...i)=>t.check(Cc(...i)),t.nonempty=(...i)=>t.check(bu(1,...i)),t.lowercase=i=>t.check(Np(i)),t.uppercase=i=>t.check(Mp(i)),t.trim=()=>t.check(Pp()),t.normalize=(...i)=>t.check(kp(...i)),t.toLowerCase=()=>t.check(Bp()),t.toUpperCase=()=>t.check(Op())}),zp=ye("ZodString",(t,e)=>{fl.init(t,e),RS.init(t,e),t.email=r=>t.check(ug(LS,r)),t.url=r=>t.check(mg(US,r)),t.jwt=r=>t.check(Ng(tD,r)),t.emoji=r=>t.check(dg(zS,r)),t.guid=r=>t.check(Ep(Bg,r)),t.uuid=r=>t.check(lg(Vs,r)),t.uuidv4=r=>t.check(cg(Vs,r)),t.uuidv6=r=>t.check(fg(Vs,r)),t.uuidv7=r=>t.check(pg(Vs,r)),t.nanoid=r=>t.check(hg(VS,r)),t.guid=r=>t.check(Ep(Bg,r)),t.cuid=r=>t.check(gg(qS,r)),t.cuid2=r=>t.check(vg(jS,r)),t.ulid=r=>t.check(yg(ZS,r)),t.base64=r=>t.check(Eg(KS,r)),t.base64url=r=>t.check(Ag(QS,r)),t.xid=r=>t.check(bg(GS,r)),t.ksuid=r=>t.check(xg(WS,r)),t.ipv4=r=>t.check(_g(HS,r)),t.ipv6=r=>t.check(wg(YS,r)),t.cidrv4=r=>t.check(Sg(JS,r)),t.cidrv6=r=>t.check(Dg(XS,r)),t.e164=r=>t.check(Tg(eD,r)),t.datetime=r=>t.check(NS(r)),t.date=r=>t.check(MS(r)),t.time=r=>t.check(CS(r)),t.duration=r=>t.check($S(r))});function BS(t){return U1(zp,t)}var Kr=ye("ZodStringFormat",(t,e)=>{Wr.init(t,e),RS.init(t,e)}),LS=ye("ZodEmail",(t,e)=>{Rw.init(t,e),Kr.init(t,e)});function MX(t){return ug(LS,t)}var Bg=ye("ZodGUID",(t,e)=>{Bw.init(t,e),Kr.init(t,e)});function CX(t){return Ep(Bg,t)}var Vs=ye("ZodUUID",(t,e)=>{Ow.init(t,e),Kr.init(t,e)});function $X(t){return lg(Vs,t)}function IX(t){return cg(Vs,t)}function FX(t){return fg(Vs,t)}function kX(t){return pg(Vs,t)}var US=ye("ZodURL",(t,e)=>{Lw.init(t,e),Kr.init(t,e)});function PX(t){return mg(US,t)}var zS=ye("ZodEmoji",(t,e)=>{Uw.init(t,e),Kr.init(t,e)});function BX(t){return dg(zS,t)}var VS=ye("ZodNanoID",(t,e)=>{zw.init(t,e),Kr.init(t,e)});function OX(t){return hg(VS,t)}var qS=ye("ZodCUID",(t,e)=>{Vw.init(t,e),Kr.init(t,e)});function RX(t){return gg(qS,t)}var jS=ye("ZodCUID2",(t,e)=>{qw.init(t,e),Kr.init(t,e)});function LX(t){return vg(jS,t)}var ZS=ye("ZodULID",(t,e)=>{jw.init(t,e),Kr.init(t,e)});function UX(t){return yg(ZS,t)}var GS=ye("ZodXID",(t,e)=>{Zw.init(t,e),Kr.init(t,e)});function zX(t){return bg(GS,t)}var WS=ye("ZodKSUID",(t,e)=>{Gw.init(t,e),Kr.init(t,e)});function VX(t){return xg(WS,t)}var HS=ye("ZodIPv4",(t,e)=>{Xw.init(t,e),Kr.init(t,e)});function qX(t){return _g(HS,t)}var YS=ye("ZodIPv6",(t,e)=>{Kw.init(t,e),Kr.init(t,e)});function jX(t){return wg(YS,t)}var JS=ye("ZodCIDRv4",(t,e)=>{Qw.init(t,e),Kr.init(t,e)});function ZX(t){return Sg(JS,t)}var XS=ye("ZodCIDRv6",(t,e)=>{e1.init(t,e),Kr.init(t,e)});function GX(t){return Dg(XS,t)}var KS=ye("ZodBase64",(t,e)=>{r1.init(t,e),Kr.init(t,e)});function WX(t){return Eg(KS,t)}var QS=ye("ZodBase64URL",(t,e)=>{n1.init(t,e),Kr.init(t,e)});function HX(t){return Ag(QS,t)}var eD=ye("ZodE164",(t,e)=>{i1.init(t,e),Kr.init(t,e)});function YX(t){return Tg(eD,t)}var tD=ye("ZodJWT",(t,e)=>{o1.init(t,e),Kr.init(t,e)});function JX(t){return Ng(tD,t)}var rD=ye("ZodCustomStringFormat",(t,e)=>{a1.init(t,e),Kr.init(t,e)});function XX(t,e,r={}){return Mg(rD,t,e,r)}function KX(t){return Mg(rD,"hostname",Os.hostname,t)}var Vp=ye("ZodNumber",(t,e)=>{ng.init(t,e),pr.init(t,e),t.gt=(i,n)=>t.check(Ls(i,n)),t.gte=(i,n)=>t.check(so(i,n)),t.min=(i,n)=>t.check(so(i,n)),t.lt=(i,n)=>t.check(Rs(i,n)),t.lte=(i,n)=>t.check(ea(i,n)),t.max=(i,n)=>t.check(ea(i,n)),t.int=i=>t.check(OS(i)),t.safe=i=>t.check(OS(i)),t.positive=i=>t.check(Ls(0,i)),t.nonnegative=i=>t.check(so(0,i)),t.negative=i=>t.check(Rs(0,i)),t.nonpositive=i=>t.check(ea(0,i)),t.multipleOf=(i,n)=>t.check(ml(i,n)),t.step=(i,n)=>t.check(ml(i,n)),t.finite=()=>t;let r=t._zod.bag;t.minValue=Math.max(r.minimum??Number.NEGATIVE_INFINITY,r.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,t.maxValue=Math.min(r.maximum??Number.POSITIVE_INFINITY,r.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,t.isInt=(r.format??"").includes("int")||Number.isSafeInteger(r.multipleOf??.5),t.isFinite=!0,t.format=r.format??null});function Y$(t){return W1(Vp,t)}var Ic=ye("ZodNumberFormat",(t,e)=>{s1.init(t,e),Vp.init(t,e)});function OS(t){return Y1(Ic,t)}function QX(t){return J1(Ic,t)}function eK(t){return X1(Ic,t)}function tK(t){return K1(Ic,t)}function rK(t){return Q1(Ic,t)}var qp=ye("ZodBoolean",(t,e)=>{xp.init(t,e),pr.init(t,e)});function J$(t){return eS(qp,t)}var jp=ye("ZodBigInt",(t,e)=>{ig.init(t,e),pr.init(t,e),t.gte=(i,n)=>t.check(so(i,n)),t.min=(i,n)=>t.check(so(i,n)),t.gt=(i,n)=>t.check(Ls(i,n)),t.gte=(i,n)=>t.check(so(i,n)),t.min=(i,n)=>t.check(so(i,n)),t.lt=(i,n)=>t.check(Rs(i,n)),t.lte=(i,n)=>t.check(ea(i,n)),t.max=(i,n)=>t.check(ea(i,n)),t.positive=i=>t.check(Ls(BigInt(0),i)),t.negative=i=>t.check(Rs(BigInt(0),i)),t.nonpositive=i=>t.check(ea(BigInt(0),i)),t.nonnegative=i=>t.check(so(BigInt(0),i)),t.multipleOf=(i,n)=>t.check(ml(i,n));let r=t._zod.bag;t.minValue=r.minimum??null,t.maxValue=r.maximum??null,t.format=r.format??null});function nK(t){return rS(jp,t)}var nD=ye("ZodBigIntFormat",(t,e)=>{u1.init(t,e),jp.init(t,e)});function iK(t){return iS(nD,t)}function oK(t){return oS(nD,t)}var X$=ye("ZodSymbol",(t,e)=>{l1.init(t,e),pr.init(t,e)});function aK(t){return aS(X$,t)}var K$=ye("ZodUndefined",(t,e)=>{c1.init(t,e),pr.init(t,e)});function sK(t){return sS(K$,t)}var Q$=ye("ZodNull",(t,e)=>{f1.init(t,e),pr.init(t,e)});function eI(t){return uS(Q$,t)}var tI=ye("ZodAny",(t,e)=>{p1.init(t,e),pr.init(t,e)});function uK(){return lS(tI)}var rI=ye("ZodUnknown",(t,e)=>{Ec.init(t,e),pr.init(t,e)});function Og(){return Tc(rI)}var nI=ye("ZodNever",(t,e)=>{m1.init(t,e),pr.init(t,e)});function iD(t){return cS(nI,t)}var iI=ye("ZodVoid",(t,e)=>{d1.init(t,e),pr.init(t,e)});function lK(t){return fS(iI,t)}var zg=ye("ZodDate",(t,e)=>{h1.init(t,e),pr.init(t,e),t.min=(i,n)=>t.check(so(i,n)),t.max=(i,n)=>t.check(ea(i,n));let r=t._zod.bag;t.minDate=r.minimum?new Date(r.minimum):null,t.maxDate=r.maximum?new Date(r.maximum):null});function cK(t){return pS(zg,t)}var oI=ye("ZodArray",(t,e)=>{_p.init(t,e),pr.init(t,e),t.element=e.element,t.min=(r,i)=>t.check(bu(r,i)),t.nonempty=r=>t.check(bu(1,r)),t.max=(r,i)=>t.check(Mc(r,i)),t.length=(r,i)=>t.check(Cc(r,i)),t.unwrap=()=>t.element});function oD(t,e){return Rp(oI,t,e)}function fK(t){let e=t._zod.def.shape;return lD(Object.keys(e))}var Vg=ye("ZodObject",(t,e)=>{g1.init(t,e),pr.init(t,e),Ke.defineLazy(t,"shape",()=>e.shape),t.keyof=()=>lD(Object.keys(t._zod.def.shape)),t.catchall=r=>t.clone({...t._zod.def,catchall:r}),t.passthrough=()=>t.clone({...t._zod.def,catchall:Og()}),t.loose=()=>t.clone({...t._zod.def,catchall:Og()}),t.strict=()=>t.clone({...t._zod.def,catchall:iD()}),t.strip=()=>t.clone({...t._zod.def,catchall:void 0}),t.extend=r=>Ke.extend(t,r),t.merge=r=>Ke.merge(t,r),t.pick=r=>Ke.pick(t,r),t.omit=r=>Ke.omit(t,r),t.partial=(...r)=>Ke.partial(pD,t,r[0]),t.required=(...r)=>Ke.required(mD,t,r[0])});function pK(t,e){let r={type:"object",get shape(){return Ke.assignProp(this,"shape",t?Ke.objectClone(t):{}),this.shape},...Ke.normalizeParams(e)};return new Vg(r)}function mK(t,e){return new Vg({type:"object",get shape(){return Ke.assignProp(this,"shape",Ke.objectClone(t)),this.shape},catchall:iD(),...Ke.normalizeParams(e)})}function dK(t,e){return new Vg({type:"object",get shape(){return Ke.assignProp(this,"shape",Ke.objectClone(t)),this.shape},catchall:Og(),...Ke.normalizeParams(e)})}var aD=ye("ZodUnion",(t,e)=>{og.init(t,e),pr.init(t,e),t.options=e.options});function sD(t,e){return new aD({type:"union",options:t,...Ke.normalizeParams(e)})}var aI=ye("ZodDiscriminatedUnion",(t,e)=>{aD.init(t,e),v1.init(t,e)});function hK(t,e,r){return new aI({type:"union",options:e,discriminator:t,...Ke.normalizeParams(r)})}var sI=ye("ZodIntersection",(t,e)=>{y1.init(t,e),pr.init(t,e)});function uI(t,e){return new sI({type:"intersection",left:t,right:e})}var lI=ye("ZodTuple",(t,e)=>{pl.init(t,e),pr.init(t,e),t.rest=r=>t.clone({...t._zod.def,rest:r})});function gK(t,e,r){let i=e instanceof ar,n=i?r:e,o=i?e:null;return new lI({type:"tuple",items:t,rest:o,...Ke.normalizeParams(n)})}var uD=ye("ZodRecord",(t,e)=>{b1.init(t,e),pr.init(t,e),t.keyType=e.keyType,t.valueType=e.valueType});function cI(t,e,r){return new uD({type:"record",keyType:t,valueType:e,...Ke.normalizeParams(r)})}function vK(t,e,r){let i=ao(t);return i._zod.values=void 0,new uD({type:"record",keyType:i,valueType:e,...Ke.normalizeParams(r)})}var fI=ye("ZodMap",(t,e)=>{x1.init(t,e),pr.init(t,e),t.keyType=e.keyType,t.valueType=e.valueType});function yK(t,e,r){return new fI({type:"map",keyType:t,valueType:e,...Ke.normalizeParams(r)})}var pI=ye("ZodSet",(t,e)=>{_1.init(t,e),pr.init(t,e),t.min=(...r)=>t.check(dl(...r)),t.nonempty=r=>t.check(dl(1,r)),t.max=(...r)=>t.check(Nc(...r)),t.size=(...r)=>t.check(Ap(...r))});function bK(t,e){return new pI({type:"set",valueType:t,...Ke.normalizeParams(e)})}var Up=ye("ZodEnum",(t,e)=>{w1.init(t,e),pr.init(t,e),t.enum=e.entries,t.options=Object.values(e.entries);let r=new Set(Object.keys(e.entries));t.extract=(i,n)=>{let o={};for(let a of i)if(r.has(a))o[a]=e.entries[a];else throw new Error(`Key ${a} not found in enum`);return new Up({...e,checks:[],...Ke.normalizeParams(n),entries:o})},t.exclude=(i,n)=>{let o={...e.entries};for(let a of i)if(r.has(a))delete o[a];else throw new Error(`Key ${a} not found in enum`);return new Up({...e,checks:[],...Ke.normalizeParams(n),entries:o})}});function lD(t,e){let r=Array.isArray(t)?Object.fromEntries(t.map(i=>[i,i])):t;return new Up({type:"enum",entries:r,...Ke.normalizeParams(e)})}function xK(t,e){return new Up({type:"enum",entries:t,...Ke.normalizeParams(e)})}var mI=ye("ZodLiteral",(t,e)=>{S1.init(t,e),pr.init(t,e),t.values=new Set(e.values),Object.defineProperty(t,"value",{get(){if(e.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return e.values[0]}})});function _K(t,e){return new mI({type:"literal",values:Array.isArray(t)?t:[t],...Ke.normalizeParams(e)})}var dI=ye("ZodFile",(t,e)=>{D1.init(t,e),pr.init(t,e),t.min=(r,i)=>t.check(dl(r,i)),t.max=(r,i)=>t.check(Nc(r,i)),t.mime=(r,i)=>t.check(Fp(Array.isArray(r)?r:[r],i))});function wK(t){return _S(dI,t)}var cD=ye("ZodTransform",(t,e)=>{wp.init(t,e),pr.init(t,e),t._zod.parse=(r,i)=>{r.addIssue=o=>{if(typeof o=="string")r.issues.push(Ke.issue(o,r.value,e));else{let a=o;a.fatal&&(a.continue=!1),a.code??(a.code="custom"),a.input??(a.input=r.value),a.inst??(a.inst=t),r.issues.push(Ke.issue(a))}};let n=e.transform(r.value,r);return n instanceof Promise?n.then(o=>(r.value=o,r)):(r.value=n,r)}});function fD(t){return new cD({type:"transform",transform:t})}var pD=ye("ZodOptional",(t,e)=>{E1.init(t,e),pr.init(t,e),t.unwrap=()=>t._zod.def.innerType});function Rg(t){return new pD({type:"optional",innerType:t})}var hI=ye("ZodNullable",(t,e)=>{A1.init(t,e),pr.init(t,e),t.unwrap=()=>t._zod.def.innerType});function Lg(t){return new hI({type:"nullable",innerType:t})}function SK(t){return Rg(Lg(t))}var gI=ye("ZodDefault",(t,e)=>{T1.init(t,e),pr.init(t,e),t.unwrap=()=>t._zod.def.innerType,t.removeDefault=t.unwrap});function vI(t,e){return new gI({type:"default",innerType:t,get defaultValue(){return typeof e=="function"?e():Ke.shallowClone(e)}})}var yI=ye("ZodPrefault",(t,e)=>{N1.init(t,e),pr.init(t,e),t.unwrap=()=>t._zod.def.innerType});function bI(t,e){return new yI({type:"prefault",innerType:t,get defaultValue(){return typeof e=="function"?e():Ke.shallowClone(e)}})}var mD=ye("ZodNonOptional",(t,e)=>{M1.init(t,e),pr.init(t,e),t.unwrap=()=>t._zod.def.innerType});function xI(t,e){return new mD({type:"nonoptional",innerType:t,...Ke.normalizeParams(e)})}var _I=ye("ZodSuccess",(t,e)=>{C1.init(t,e),pr.init(t,e),t.unwrap=()=>t._zod.def.innerType});function DK(t){return new _I({type:"success",innerType:t})}var wI=ye("ZodCatch",(t,e)=>{$1.init(t,e),pr.init(t,e),t.unwrap=()=>t._zod.def.innerType,t.removeCatch=t.unwrap});function SI(t,e){return new wI({type:"catch",innerType:t,catchValue:typeof e=="function"?e:()=>e})}var DI=ye("ZodNaN",(t,e)=>{I1.init(t,e),pr.init(t,e)});function EK(t){return dS(DI,t)}var dD=ye("ZodPipe",(t,e)=>{Sp.init(t,e),pr.init(t,e),t.in=e.in,t.out=e.out});function Ug(t,e){return new dD({type:"pipe",in:t,out:e})}var EI=ye("ZodReadonly",(t,e)=>{F1.init(t,e),pr.init(t,e),t.unwrap=()=>t._zod.def.innerType});function AI(t){return new EI({type:"readonly",innerType:t})}var TI=ye("ZodTemplateLiteral",(t,e)=>{k1.init(t,e),pr.init(t,e)});function AK(t,e){return new TI({type:"template_literal",parts:t,...Ke.normalizeParams(e)})}var NI=ye("ZodLazy",(t,e)=>{B1.init(t,e),pr.init(t,e),t.unwrap=()=>t._zod.def.getter()});function MI(t){return new NI({type:"lazy",getter:t})}var CI=ye("ZodPromise",(t,e)=>{P1.init(t,e),pr.init(t,e),t.unwrap=()=>t._zod.def.innerType});function TK(t){return new CI({type:"promise",innerType:t})}var qg=ye("ZodCustom",(t,e)=>{O1.init(t,e),pr.init(t,e)});function NK(t){let e=new an({check:"custom"});return e._zod.check=t,e}function MK(t,e){return wS(qg,t??(()=>!0),e)}function $I(t,e={}){return SS(qg,t,e)}function II(t){return DS(t)}function CK(t,e={error:`Input not instance of ${t.name}`}){let r=new qg({type:"custom",check:"custom",fn:i=>i instanceof t,abort:!0,...Ke.normalizeParams(e)});return r._zod.bag.Class=t,r}var $K=(...t)=>ES({Pipe:dD,Boolean:qp,String:zp,Transform:cD},...t);function IK(t){let e=MI(()=>sD([BS(t),Y$(),J$(),eI(),oD(e),cI(BS(),e)]));return e}function FK(t,e){return Ug(fD(t),e)}var kK={invalid_type:"invalid_type",too_big:"too_big",too_small:"too_small",invalid_format:"invalid_format",not_multiple_of:"not_multiple_of",unrecognized_keys:"unrecognized_keys",invalid_union:"invalid_union",invalid_key:"invalid_key",invalid_element:"invalid_element",invalid_value:"invalid_value",custom:"custom"};function PK(t){Rn({customError:t})}function BK(){return Rn().customError}var hD;hD||(hD={});var gD={};hs(gD,{bigint:()=>UK,boolean:()=>LK,date:()=>zK,number:()=>RK,string:()=>OK});function OK(t){return z1(zp,t)}function RK(t){return H1(Vp,t)}function LK(t){return tS(qp,t)}function UK(t){return nS(jp,t)}function zK(t){return mS(zg,t)}Rn(ag());function xu(){return ge.custom(t=>typeof t=="function")}function PI(t,e){return r=>{r.value[t]===void 0==(r.value[e]===void 0)&&r.issues.push({code:"custom",message:`Either ${t} or ${e} must be used, but not both.`,input:r.value})}}function Rt(){return function(t){return t}}function sn(t,e){let r=t.safeParse(e);if(!r.success)throw new jt({errorLevel:"CRITICAL",effect:"Failed to run function due to invalid arguments. Check that the arguments that you are passing to the function match the type definition of the function.",cause:r.error})}function BI(t,e){return t.safeParse(e)}var FI=["zeroth","first","second","third","fourth","fifth","sixth","seventh","eighth","ninth","tenth","eleventh","twelfth","thirteenth","fourteenth","fifteenth","sixteenth","seventeenth","eighteenth","nineteenth"],kI=["twent","thirt","fort","fift","sixt","sevent","eight","ninet"];function VK(t){return t<20?FI[t]:t%10===0?kI[Math.floor(t/10)-2]+"ieth":kI[Math.floor(t/10)-2]+"y-"+FI[t%10]}function jg(t){let e="";for(let r of t.issues){let i=qK(r.path);e+=`\u2716 ${r.message??r.code}
\u2192 at '${i}'
`}return e.trim()}function qK(t){return!t||t.length===0?"unknown location":t.map(e=>typeof e=="string"?e:typeof e=="symbol"?e.toString():VK(e+1)+" element").join(" > ")}function jK(t,e,r){return ge.number({error:i=>i.input===void 0?`The ${t} action requires a specified ${r} with the '${e}' field.`:`The ${t} action requires the value of the '${e}' fields to be a number, but got ${typeof i.input}.`})}function pi(t,e,r){return ge.string({error:i=>i.input===void 0?`The ${t} action requires a specified ${r} with the '${e}' field.`:`The ${t} action requires the value of the '${e}' fields to be a string, but got ${typeof i.input}.`})}function Zg(t,e,r){return ge.coerce.string({error:i=>i.input===void 0?`The ${t} action requires a specified ${r} with the '${e}' field.`:`The ${t} action requires the value of the '${e}' fields to be a string, but got ${typeof i.input}.`})}function qs(t,e,r){return ge.boolean({error:i=>i.input===void 0?`The ${t} action requires a specified ${r} with the '${e}' field.`:`The ${t} action requires the value of the '${e}' fields to be a boolean, but got ${typeof i.input}.`})}var ZK=Rt()(ge.object({type:ge.literal("command"),command:pi("command","command","command to run")})),GK=Rt()(ge.object({type:ge.literal("js"),file:pi("js","file","file path to the file to run"),args:ge.record(ge.string(),ge.unknown()).optional()})),WK=Rt()(ge.object({type:ge.literal("open"),link:pi("open","link","link to open"),newTab:qs("open","newTab","").optional()})),HK=Rt()(ge.object({type:ge.literal("input"),str:pi("input","str","value to input")})),YK=Rt()(ge.object({type:ge.literal("sleep"),ms:jK("sleep","ms","duration")})),JK=Rt()(ge.object({type:ge.literal("templaterCreateNote"),templateFile:pi("templaterCreateNote","templateFile","template file path"),folderPath:pi("templaterCreateNote","folderPath","folder path").optional(),fileName:pi("templaterCreateNote","fileName","file name").optional(),openNote:qs("templaterCreateNote","openNote","value for whether to open the note").optional(),openIfAlreadyExists:qs("templaterCreateNote","openIfAlreadyExists","value for whether to open the note if it already exists").optional()})),XK=Rt()(ge.object({type:ge.literal("runTemplaterFile"),templateFile:pi("runTemplaterFile","templateFile","template file path")})),KK=Rt()(ge.object({type:ge.literal("updateMetadata"),bindTarget:pi("updateMetadata","bindTarget","bind target to the metadata to update"),evaluate:qs("updateMetadata","evaluate","value for whether to evaluate the value as a JavaScript expression"),value:Zg("updateMetadata","value for the update","value")})),QK=Rt()(ge.object({type:ge.literal("createNote"),folderPath:pi("createNote","folderPath","folder path").optional(),fileName:pi("createNote","fileName","file name"),openNote:qs("createNote","openNote","value for whether to open the note").optional(),openIfAlreadyExists:qs("createNote","openIfAlreadyExists","value for whether to open the note if it already exists").optional()})),eQ=Rt()(ge.object({type:ge.literal("replaceInNote"),fromLine:Zg("replaceInNote","fromLine","line to replace from"),toLine:Zg("replaceInNote","toLine","line to replace to"),replacement:pi("replaceInNote","replacement","replacement string"),templater:qs("replaceInNote","templater","value for whether to use Templater").optional()})),tQ=Rt()(ge.object({type:ge.literal("replaceSelf"),replacement:pi("replaceSelf","replacement","replacement string"),templater:qs("replaceSelf","templater","value for whether to use Templater").optional()})),rQ=Rt()(ge.object({type:ge.literal("regexpReplaceInNote"),regexp:pi("regexpReplaceInNote","regexp","search regular expression"),regexpFlags:pi("regexpReplaceInNote","regexpFlags","regular expression flags string").optional(),replacement:pi("regexpReplaceInNote","replacement","replacement string")})),nQ=Rt()(ge.object({type:ge.literal("insertIntoNote"),line:Zg("insertIntoNote","line","line to insert at"),value:pi("insertIntoNote","value","string to insert"),templater:qs("insertIntoNote","templater","value for whether to use Templater").optional()})),iQ=Rt()(ge.object({type:ge.literal("inlineJS"),code:pi("inlineJS","code","code string to run"),args:ge.record(ge.string(),ge.unknown()).optional()})),OI=Rt()(ge.discriminatedUnion("type",[ZK,GK,WK,HK,YK,JK,KK,QK,eQ,tQ,rQ,nQ,iQ,XK])),oQ=ge.nativeEnum(Gr),Fc=Rt()(ge.object({label:ge.string(),icon:ge.string().optional(),style:oQ,class:ge.string().optional(),cssStyle:ge.string().optional(),backgroundImage:ge.string().optional(),tooltip:ge.string().optional(),id:ge.string().optional(),hidden:ge.boolean().optional(),action:OI.optional(),actions:OI.array().optional()}).check(PI("action","actions")));var aQ=Zp.P.sequenceMap((t,e)=>e,Zp.P.string("BUTTON"),Zp.P.manyNotOf("[],^").separateBy(Zp.P.string(",").trim(RI.P_UTILS.optionalWhitespace())).wrapString("[","]")),Gg=class{mb;constructor(e){this.mb=e}fromGroupString(e){let r=new rr("ButtonGroup"),i=[];try{i=fn(aQ,e)}catch(n){r.add(n)}return{declarationString:e,referencedButtonIds:i,errorCollection:r}}validateGroup(e){return{declarationString:void 0,referencedButtonIds:e.referencedButtonIds,errorCollection:new rr("ButtonGroup")}}fromString(e){let r=new rr("Button"),i;try{let n=this.mb.internal.parseYaml(e);i=this.validateConfig(n)}catch(n){r.add(n)}return{declarationString:e,config:i,errorCollection:r}}validateConfig(e){let r=BI(Fc,e);if(!r.success){let i=jg(r.error);throw new vs({errorLevel:"ERROR",effect:"The validation for the button config failed.",cause:"Your button syntax seems to be invalid. Check that your button config follows what is described in the docs.",positionContext:i,docs:[Ht.linkToButtonConfig()]})}return r.data}validate(e){let r=new rr("Button"),i;try{i=this.validateConfig(e)}catch(n){r.add(n)}return{declarationString:void 0,config:i,errorCollection:r}}};var kc=class{arguments=[];add(e){this.arguments.push(e)}validate(){let e={};for(let r of Object.values(nn))e[r]=0;for(let r of this.arguments){let i=r.getConfig();if(e[i.type]+=1,e[i.type]>1&&!i.allowMultiple)throw new Br({errorLevel:"ERROR",effect:"failed to validate argument container",cause:`argument '${i.type}' does not allow duplicates`,docs:[Ht.linkToSearch(i.type)]})}}mergeByOverride(e){for(let r of e.arguments){let i=r.getConfig();i.allowMultiple||(this.arguments=this.arguments.filter(n=>n.getConfig().type!==i.type)),this.arguments.push(r)}return this.validate(),this}mergeByThrow(e){for(let r of e.arguments){let i=r.getConfig();if(!i.allowMultiple&&this.arguments.filter(n=>n.getConfig().type===i.type).length>0)throw new Br({errorLevel:"ERROR",effect:"failed to merge argument container",cause:"can not merge FieldArgumentContainers, since arguments overlap"});this.arguments.push(r)}return this.validate(),this}getAll(e){return this.arguments.filter(r=>r.getConfig().type===e)}get(e){return this.getAll(e).at(0)}};var Wg=class extends kc{getAll(e){return super.getAll(e)}get(e){return this.getAll(e).at(0)}};var Pc=class{value;parseValue(e){this.validateValues(e,this.getConfig().values),this._parseValue(e)}validateValues(e,r){if(r.find(i=>i.length===e.length)===void 0)throw new Br({errorLevel:"WARNING",effect:`Failed to parse argument value for argument '${this.getConfig().type}'.`,cause:`Expected argument values to follow the form ${r.map(i=>i.length===0?"none":i.map(n=>`'${n.name}'`).join(", ")).join(" or ")}. Received arguments of length ${e.length}.`,docs:[Ht.linkToSearch(this.getConfig().type)]})}isAllowed(e){return this.getConfig().allowedFieldTypes.length===0?!0:this.getConfig().allowedFieldTypes.includes(e)}getAllowedFieldsAsString(){return this.getConfig().allowedFieldTypes.length===0?"all":this.getConfig().allowedFieldTypes.join(", ")}};var vr=class extends Pc{};var Hg=class extends vr{value=!0;_parseValue(e){this.value=e[0]===void 0||e[0]?.value.toLowerCase()==="true"}getConfig(){return wr.addLabels}};var Yg=class extends vr{value=!0;_parseValue(e){this.value=e[0]===void 0||e[0]?.value.toLowerCase()==="true"}getConfig(){return wr.allowOther}};var Jg=class extends vr{value=[];_parseValue(e){this.value=e[0].value.split(" ")}getConfig(){return wr.class}};var Xg=class extends vr{value="";_parseValue(e){this.value=_o(e[0].value)}getConfig(){return wr.defaultValue}};var Kg=class extends vr{value=void 0;_parseValue(e){if(this.value=Number.parseInt(e[0].value),Number.isNaN(this.value))throw new Br({errorLevel:"WARNING",effect:"failed to set value for input field argument",cause:"value of argument 'limit' must be of type number",docs:[Ht.linkToInputFieldArgument(this.getConfig().type)]});if(this.value<=0)throw new Br({errorLevel:"WARNING",effect:"failed to set value for input field argument",cause:"value of argument 'limit' must be a positive number",docs:[Ht.linkToInputFieldArgument(this.getConfig().type)]})}getConfig(){return wr.limit}};var Qg=class extends vr{value=100;_parseValue(e){if(this.value=Number.parseFloat(e[0].value),Number.isNaN(this.value))throw new Br({errorLevel:"WARNING",effect:"failed to set value for input field argument",cause:"value of argument 'maxValue' must be of type number",docs:[Ht.linkToInputFieldArgument(this.getConfig().type)]})}getConfig(){return wr.maxValue}};var ev=class extends vr{value=0;_parseValue(e){if(this.value=Number.parseFloat(e[0].value),Number.isNaN(this.value))throw new Br({errorLevel:"WARNING",effect:"failed to set value for input field argument",cause:"value of argument 'minValue' must be of type number",docs:[Ht.linkToInputFieldArgument(this.getConfig().type)]})}getConfig(){return wr.minValue}};var tv=class extends vr{value=!0;_parseValue(e){this.value=e[0]===void 0||e[0]?.value.toLowerCase()==="true"}getConfig(){return wr.multiLine}};var rv=class extends vr{value=!1;_parseValue(e){this.value=_o(e[0].value)}getConfig(){return wr.offValue}};var nv=class extends vr{value=!0;_parseValue(e){this.value=_o(e[0].value)}getConfig(){return wr.onValue}};var iv=class extends vr{value="";name="";_parseValue(e){e.length===1?(this.value=_o(e[0].value),this.name=e[0].value):e.length===2&&(this.value=_o(e[0].value),this.name=e[1].value)}getConfig(){return wr.option}};var ov=class extends vr{value="";_parseValue(e){this.value=e[0].value}getConfig(){return wr.optionQuery}};var av=class extends vr{value="";_parseValue(e){this.value=e[0].value}getConfig(){return wr.placeholder}};var sv=class extends vr{value=!0;_parseValue(e){this.value=e[0]===void 0||e[0]?.value.toLowerCase()==="true"}getConfig(){return wr.showcase}};var uv=class extends vr{value=0;_parseValue(e){if(this.value=Number.parseFloat(e[0].value),Number.isNaN(this.value))throw new Br({errorLevel:"WARNING",effect:"failed to set value for input field argument",cause:"value of argument 'stepSize' must be of type number",docs:[Ht.linkToInputFieldArgument(this.getConfig().type)]});if(this.value<=0)throw new Br({errorLevel:"WARNING",effect:"failed to set value for input field argument",cause:"value of argument 'stepSize' must be a positive number",docs:[Ht.linkToInputFieldArgument(this.getConfig().type)]})}getConfig(){return wr.stepSize}};var lv=class extends vr{value="";_parseValue(e){this.value=e[0].value}getConfig(){return wr.title}};function LI(t,e,r){return r==="true"?`[[${t}|${e}]]`:r==="partial"?`[[${e}]]`:`${e}`}var cv=class extends vr{value="true";_parseValue(e){let r=e[0]?.value.toLowerCase();if(r===void 0){this.value="true";return}if(r==="true"||r==="partial"||r==="false"){this.value=r;return}throw new Br({errorLevel:"WARNING",effect:"failed to set value for input field argument",cause:`value of argument 'useLinks' must be one of ${ZT(["true","partial","false"],i=>`'${i}'`,", ","or")}`,docs:[Ht.linkToInputFieldArgument(this.getConfig().type)]})}getConfig(){return wr.useLinks}};var UI={class:Jg,addLabels:Hg,minValue:ev,maxValue:Qg,stepSize:uv,option:iv,title:lv,optionQuery:ov,showcase:sv,offValue:rv,onValue:nv,defaultValue:Xg,placeholder:av,useLinks:cv,limit:Kg,allowOther:Yg,multiLine:tv},fv=class{static createInputFieldArgument(e){if(e in UI){let r=UI[e];if(r)return new r}throw new ma({errorLevel:"WARNING",effect:"can not crate input field argument",cause:`unknown argument '${e}'`})}};var pv=class{unvalidatedDeclaration;errorCollection;filePath;mb;constructor(e,r,i){this.mb=e,this.unvalidatedDeclaration=r,this.filePath=i,this.errorCollection=new rr("input field declaration")}validate(e){let r=this.validateInputFieldType(),i=this.validateBindTarget(e),n=this.validateArguments(r),o={declarationString:this.unvalidatedDeclaration.declarationString,inputFieldType:r,bindTarget:i,argumentContainer:n,errorCollection:this.errorCollection.merge(this.unvalidatedDeclaration.errorCollection)};return this.checkForDeprecation(o),o}validateInputFieldType(){let e=this.unvalidatedDeclaration.inputFieldType;for(let r of Object.entries(uu))if(r[1]===e?.value)return r[1];return this.errorCollection.add(new Pn("ERROR","Declaration Validator",`Encountered invalid identifier. Expected an input field type but received '${e?.value}'.`,this.unvalidatedDeclaration.declarationString,e?.position)),"invalid"}checkForDeprecation(e){}validateBindTarget(e){if(this.unvalidatedDeclaration.bindTarget!==void 0)try{return this.mb.bindTargetParser.validate(this.unvalidatedDeclaration.declarationString,this.unvalidatedDeclaration.bindTarget,this.filePath,e)}catch(r){this.errorCollection.add(r)}}validateArguments(e){let r=new Wg;for(let i of this.unvalidatedDeclaration.arguments){let n=this.validateArgumentType(i.name);if(n==="invalid")continue;let o=fv.createInputFieldArgument(n);if(!o.isAllowed(e)){this.errorCollection.add(new Pn("WARNING","Declaration Validator",`Failed to parse input field arguments. Argument "${i.name.value}" is only applicable to "${o.getAllowedFieldsAsString()}" input fields.`,this.unvalidatedDeclaration.declarationString,i.name.position));continue}try{o.parseValue(i.value)}catch(a){this.errorCollection.add(a);continue}r.add(o)}try{r.validate()}catch(i){this.errorCollection.add(i)}return r}validateArgumentType(e){for(let r of Object.entries(nn))if(r[1]===e.value)return r[1];return this.errorCollection.add(new Pn("WARNING","Declaration Validator",`Encountered invalid identifier. Expected an input field argument type but received '${e.value}'.`,this.unvalidatedDeclaration.declarationString,e.position)),"invalid"}};var Ni=Ar(yo()),Hr=Ar(Ji());var uQ=Hr.P.sequenceMap((t,e,r)=>{let i=r===void 0?void 0:r[1];return{inputFieldType:t,arguments:e,bindTarget:i}},Gn.node(Oi).trim(Ni.P_UTILS.optionalWhitespace()).describe("input field type"),Nf.trim(Ni.P_UTILS.optionalWhitespace()).wrap(Hr.P.string("(").describe('arguments paren "("'),Hr.P.string(")").describe('arguments paren ")"')).trim(Ni.P_UTILS.optionalWhitespace()).optional([]),Hr.P.sequence(Hr.P.string(":").trim(Ni.P_UTILS.optionalWhitespace()).describe('bind target separator ":"'),Ca).trim(Ni.P_UTILS.optionalWhitespace()).optional()),zI=Hr.P.sequenceMap((t,e,r)=>{let i=r===void 0?void 0:r[1];return{inputFieldType:t,arguments:e,bindTarget:i}},Gn.node(Oi).trim(Ni.P_UTILS.optionalWhitespace()).optional().describe("input field type"),Nf.trim(Ni.P_UTILS.optionalWhitespace()).wrap(Hr.P.string("(").describe('arguments paren "("'),Hr.P.string(")").describe('arguments paren ")"')).trim(Ni.P_UTILS.optionalWhitespace()).optional([]),Hr.P.sequence(Hr.P.string(":").trim(Ni.P_UTILS.optionalWhitespace()).describe('bind target separator ":"'),Ca).trim(Ni.P_UTILS.optionalWhitespace()).optional()),VI=Hr.P.or(Hr.P.sequenceMap((t,e,r)=>(r.templateName=e,r),Hr.P.string("INPUT"),Hr.P.sequenceMap((t,e,r)=>e,Hr.P.string("["),IT.node(Oi).trim(Ni.P_UTILS.optionalWhitespace()).describe("template name"),Hr.P.string("]").skip(Ni.P_UTILS.optionalWhitespace())),zI.wrap(Hr.P.string("["),Hr.P.string("]")),Ni.P_UTILS.eof()),Hr.P.sequenceMap((t,e)=>e,Hr.P.string("INPUT"),uQ.wrap(Hr.P.string("["),Hr.P.string("]")),Ni.P_UTILS.eof())),qI=Hr.P.sequenceMap((t,e)=>e,Hr.P.string("INPUT"),zI.wrap(Hr.P.string("["),Hr.P.string("]")),Ni.P_UTILS.eof());var mv=class{mb;templates;constructor(e){this.mb=e,this.templates=[]}fromString(e){let r=new rr("InputField");try{let i=fn(VI,e),n=this.partialToFullDeclaration(i,e,r);return n=this.applyTemplate(n),n}catch(i){r.add(i)}return{declarationString:e,inputFieldType:{value:"invalid"},bindTarget:void 0,arguments:[],errorCollection:r}}fromStringAndValidate(e,r,i){return this.validate(this.fromString(e),r,i)}fromSimpleDeclaration(e){return{declarationString:void 0,inputFieldType:jo(e.inputFieldType),bindTarget:this.mb.bindTargetParser.fromExistingDeclaration(e.bindTarget),arguments:(e.arguments??[]).map(r=>({name:jo(r.name),value:r.value.map(i=>jo(i))})),errorCollection:new rr("InputField")}}fromSimpleDeclarationAndValidate(e,r,i){return this.validate(this.fromSimpleDeclaration(e),r,i)}partialToFullDeclaration(e,r,i){return{...structuredClone(e),declarationString:r,errorCollection:i}}validate(e,r,i){return new pv(this.mb,e,r).validate(i)}merge(e,r){let i;return e.bindTarget===void 0?i=r.bindTarget:(i=e.bindTarget,r.bindTarget?.storagePath!==void 0&&(i.storagePath=r.bindTarget.storagePath),r.bindTarget?.storageProp!==void 0&&(i.storageProp=r.bindTarget.storageProp)),{declarationString:r.declarationString,inputFieldType:r.inputFieldType??e.inputFieldType,bindTarget:i,arguments:r.arguments.concat(e.arguments).reduce((n,o)=>(n.find(a=>a.name===o.name)===void 0&&n.push(o),n),[]),errorCollection:new rr("input field declaration").merge(e.errorCollection).merge(r.errorCollection)}}parseTemplateString(e){let r=new rr("InputFieldParser");try{let i=fn(qI,e);return this.partialToFullDeclaration(i,e,r)}catch(i){r.add(i)}return{declarationString:e,inputFieldType:{value:"invalid"},bindTarget:void 0,arguments:[],errorCollection:r}}parseTemplates(e){this.templates=[];let r=new rr("input field template parser");for(let i of e){let n=this.parseTemplateString(i.declaration);r.merge(n.errorCollection);let o={name:i.name,template:n};this.templates.push(Yx(o))}return r}getTemplate(e){return this.templates.find(r=>r.name===e)?.template}applyTemplate(e){if(e.templateName===void 0)return e;let r=this.getTemplate(e.templateName.value);return r===void 0?(e.errorCollection.add(new Pn("WARNING","Input Field Parser",`Invalid template name. Could not find a template with the name '${e.templateName.value}'.`,e.declarationString,e.templateName.position,["https://mprojectscode.github.io/obsidian-meta-bind-plugin-docs/guides/templates/"])),e):this.merge(r,e)}};var dv=class{mb;constructor(e){this.mb=e}fromString(e){let r=new rr("JsViewFieldDeclaration");try{let i=fn(LT,e);return this.partialToFullDeclaration(i,e,r)}catch(i){r.add(i)}return{declarationString:e,errorCollection:r,bindTargetMappings:[],writeToBindTarget:void 0,hidden:!1,code:""}}fromStringAndValidate(e,r){return this.validate(this.fromString(e),r)}fromSimpleDeclaration(e){let r=new rr("JsViewFieldDeclaration");return{declarationString:void 0,code:e.code,bindTargetMappings:e.bindTargetMappings.map(i=>({bindTarget:this.mb.bindTargetParser.fromExistingDeclaration(i.bindTarget),name:i.name})),writeToBindTarget:this.mb.bindTargetParser.fromExistingDeclaration(e.writeToBindTarget),hidden:e.hidden??!1,errorCollection:r}}fromSimpleDeclarationAndValidate(e,r){return this.validate(this.fromSimpleDeclaration(e),r)}partialToFullDeclaration(e,r,i){let n=e;return n.declarationString=r,n.errorCollection=i,n.bindTargetMappings=[...n.bindTargetMappings],n}validate(e,r){let i={};i.declarationString=e.declarationString,i.errorCollection=e.errorCollection;try{return i.bindTargetMappings=e.bindTargetMappings.map(n=>({bindTarget:this.mb.bindTargetParser.validate(e.declarationString,n.bindTarget,r),name:n.name})),e.writeToBindTarget!==void 0&&(i.writeToBindTarget=this.mb.bindTargetParser.validate(e.declarationString,e.writeToBindTarget,r)),i.code=e.code,i.hidden=e.hidden,i}catch(n){i.errorCollection.add(n)}return{declarationString:e.declarationString,errorCollection:i.errorCollection,bindTargetMappings:[],writeToBindTarget:void 0,hidden:!1,code:""}}};var hv=class extends kc{getAll(e){return super.getAll(e)}get(e){return this.getAll(e).at(0)}};var _u=class extends Pc{};var gv=class extends _u{value=[];_parseValue(e){this.value=e[0].value.split(" ")}getConfig(){return tc.class}};var vv=class extends _u{value=!0;_parseValue(e){this.value=e[0]===void 0||e[0]?.value.toLowerCase()==="true"}getConfig(){return tc.hidden}};var yv=class extends _u{value=!0;_parseValue(e){this.value=e[0]===void 0||e[0]?.value.toLowerCase()==="true"}getConfig(){return tc.renderMarkdown}};var jI={renderMarkdown:yv,hidden:vv,class:gv},bv=class{static createViewFieldArgument(e){if(e in jI){let r=jI[e];if(r)return new r}throw new ma({errorLevel:"WARNING",effect:"can not crate view field argument",cause:`unknown argument '${e}'`})}};var xv=class{unvalidatedDeclaration;errorCollection;filePath;mb;constructor(e,r,i){this.unvalidatedDeclaration=e,this.mb=i,this.filePath=r,this.errorCollection=new rr("view field declaration")}validate(e){let r=this.validateInputFieldType(),i=this.validateBindTarget(e),n=this.validateArguments(r),o=this.validateTemplateDeclaration(e),a={declarationString:this.unvalidatedDeclaration.declarationString,viewFieldType:r,writeToBindTarget:i,argumentContainer:n,templateDeclaration:o,errorCollection:this.errorCollection.merge(this.unvalidatedDeclaration.errorCollection)};return this.checkForDeprecation(a),a}validateInputFieldType(){let e=this.unvalidatedDeclaration.viewFieldType;if(e===void 0)return"math";for(let r of Object.entries(Ff))if(r[1]===e?.value)return r[1];return this.errorCollection.add(new Pn("ERROR","Declaration Validator",`Encountered invalid identifier. Expected a view field type but received '${e.value}'.`,this.unvalidatedDeclaration.declarationString,e.position)),"invalid"}checkForDeprecation(e){}validateBindTarget(e){if(this.unvalidatedDeclaration.writeToBindTarget!==void 0)return this.mb.bindTargetParser.validate(this.unvalidatedDeclaration.declarationString,this.unvalidatedDeclaration.writeToBindTarget,this.filePath,e)}validateArguments(e){let r=new hv;for(let i of this.unvalidatedDeclaration.arguments){let n=this.validateArgumentType(i.name);if(n==="invalid")continue;let o=bv.createViewFieldArgument(n);if(!o.isAllowed(e)){this.errorCollection.add(new Pn("WARNING","Declaration Validator",`Failed to parse view field arguments. Argument "${i.name.value}" is only applicable to "${o.getAllowedFieldsAsString()}" view fields.`,this.unvalidatedDeclaration.declarationString,i.name.position));continue}try{o.parseValue(i.value)}catch(a){this.errorCollection.add(a);continue}r.add(o)}try{r.validate()}catch(i){this.errorCollection.add(i)}return r}validateArgumentType(e){for(let r of Object.entries(Zu))if(r[1]===e.value)return r[1];return this.errorCollection.add(new Pn("WARNING","Declaration Validator",`Encountered invalid identifier. Expected a view field argument type but received '${e.value}'.`,this.unvalidatedDeclaration.declarationString,e.position)),"invalid"}validateTemplateDeclaration(e){try{return this.unvalidatedDeclaration.templateDeclaration?.map(r=>typeof r=="string"?r:this.mb.bindTargetParser.validate(this.unvalidatedDeclaration.declarationString,r,this.filePath,e))??[]}catch(r){return this.errorCollection.add(r),[]}}};var _v=class{mb;constructor(e){this.mb=e}fromString(e){let r=new rr("ViewFieldDeclaration");try{let i=fn(RT,e);return this.partialToFullDeclaration(i,e,r)}catch(i){r.add(i)}return{declarationString:e,errorCollection:r,viewFieldType:{value:"invalid"},writeToBindTarget:void 0,arguments:[],templateDeclaration:[]}}fromStringAndValidate(e,r,i){return this.validate(this.fromString(e),r,i)}fromSimpleDeclaration(e){let r=new rr("ViewFieldDeclaration");return{declarationString:void 0,templateDeclaration:(e.templateDeclaration??[]).map(i=>typeof i=="string"?i:this.mb.bindTargetParser.fromExistingDeclaration(i)),viewFieldType:jo(e.viewFieldType),arguments:(e.arguments??[]).map(i=>({name:jo(i.name),value:i.value.map(n=>jo(n))})),writeToBindTarget:this.mb.bindTargetParser.fromExistingDeclaration(e.writeToBindTarget),errorCollection:r}}fromSimpleDeclarationAndValidate(e,r,i){return this.validate(this.fromSimpleDeclaration(e),r,i)}partialToFullDeclaration(e,r,i){return{...structuredClone(e),declarationString:r,errorCollection:i}}validate(e,r,i){return new xv(e,r,this.mb).validate(i)}};var GI=Ar(ip());var ZI=["January","February","March","April","May","June","July","August","September","October","November","December"],hl=[{index:0,name:"Sunday",shortName:"Su"},{index:1,name:"Monday",shortName:"Mo"},{index:2,name:"Tuesday",shortName:"Tu"},{index:3,name:"Wednesday",shortName:"We"},{index:4,name:"Thursday",shortName:"Th"},{index:5,name:"Friday",shortName:"Fr"},{index:6,name:"Saturday",shortName:"Sa"}],Gp={devMode:!1,ignoreCodeBlockRestrictions:!1,preferredDateFormat:"YYYY-MM-DD",firstWeekday:hl[1],syncInterval:200,enableJs:!1,viewFieldDisplayNullAsEmpty:!1,enableSyntaxHighlighting:!0,enableEditorRightClickMenu:!0,inputFieldTemplates:[],buttonTemplates:[],excludedFolders:["templates"]},wv=50,Sv=1e3;var vD=hl[1];function WI(t){vD=t}function HI(t){return ZI[t]}function YI(t,e){let r=(0,GI.default)(new Date(e,t)).daysInMonth(),i=new Array(42).fill(0),n=lQ(new Date(e,t,1));for(let o=0;o<r;o++)i[o+n]=o+1;return i=i[i.length-7]?i:i.slice(0,-7),i=i[i.length-7]?i:i.slice(0,-7),i}function lQ(t){return Wx(t.getDay()-vD.index,7)}function JI(){return hl.map(e=>({index:Wx(e.index-vD.index,7),name:e.name,shortName:e.shortName})).sort((e,r)=>e.index-r.index).map(e=>e.shortName)}function XI(){let t=0;return()=>++t}function Dn(){return Dn=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var r=arguments[e];for(var i in r)({}).hasOwnProperty.call(r,i)&&(t[i]=r[i])}return t},Dn.apply(null,arguments)}var Dv={relTol:1e-12,absTol:1e-15,matrix:"Matrix",number:"number",numberFallback:"number",precision:64,predictable:!1,randomSeed:null};function Yr(t,e){if(Wp(t,e))return t[e];throw typeof t[e]=="function"&&Ev(t,e)?new Error('Cannot access method "'+e+'" as a property'):new Error('No access to property "'+e+'"')}function Ha(t,e,r){if(Wp(t,e))return t[e]=r,r;throw new Error('No access to property "'+e+'"')}function Wp(t,e){return!cQ(t)&&!Array.isArray(t)?!1:rt(fQ,e)?!0:!(e in Object.prototype||e in Function.prototype)}function KI(t,e){if(!Ev(t,e))throw new Error('No access to method "'+e+'"');return t[e]}function Ev(t,e){return t==null||typeof t[e]!="function"||rt(t,e)&&Object.getPrototypeOf&&e in Object.getPrototypeOf(t)?!1:rt(pQ,e)?!0:!(e in Object.prototype||e in Function.prototype)}function cQ(t){return typeof t=="object"&&t&&t.constructor===Object}var fQ={length:!0,name:!0},pQ={toString:!0,valueOf:!0,toLocaleString:!0};var wu=class{constructor(e){this.wrappedObject=e,this[Symbol.iterator]=this.entries}keys(){return Object.keys(this.wrappedObject).filter(e=>this.has(e)).values()}get(e){return Yr(this.wrappedObject,e)}set(e,r){return Ha(this.wrappedObject,e,r),this}has(e){return Wp(this.wrappedObject,e)&&e in this.wrappedObject}entries(){return QI(this.keys(),e=>[e,this.get(e)])}forEach(e){for(var r of this.keys())e(this.get(r),r,this)}delete(e){Wp(this.wrappedObject,e)&&delete this.wrappedObject[e]}clear(){for(var e of this.keys())this.delete(e)}get size(){return Object.keys(this.wrappedObject).length}},Bc=class{constructor(e,r,i){this.a=e,this.b=r,this.bKeys=i,this[Symbol.iterator]=this.entries}get(e){return this.bKeys.has(e)?this.b.get(e):this.a.get(e)}set(e,r){return this.bKeys.has(e)?this.b.set(e,r):this.a.set(e,r),this}has(e){return this.b.has(e)||this.a.has(e)}keys(){return new Set([...this.a.keys(),...this.b.keys()])[Symbol.iterator]()}entries(){return QI(this.keys(),e=>[e,this.get(e)])}forEach(e){for(var r of this.keys())e(this.get(r),r,this)}delete(e){return this.bKeys.has(e)?this.b.delete(e):this.a.delete(e)}clear(){this.a.clear(),this.b.clear()}get size(){return[...this.keys()].length}};function QI(t,e){return{next:()=>{var r=t.next();return r.done?r:{value:e(r.value),done:!1}}}}function Su(){return new Map}function js(t){if(!t)return Su();if(Ya(t))return t;if($o(t))return new wu(t);throw new Error("createMap can create maps from objects or Maps")}function eF(t){if(t instanceof wu)return t.wrappedObject;var e={};for(var r of t.keys()){var i=t.get(r);Ha(e,r,i)}return e}function Et(t){return typeof t=="number"}function mt(t){return!t||typeof t!="object"||typeof t.constructor!="function"?!1:t.isBigNumber===!0&&typeof t.constructor.prototype=="object"&&t.constructor.prototype.isBigNumber===!0||typeof t.constructor.isDecimal=="function"&&t.constructor.isDecimal(t)===!0}function Ja(t){return typeof t=="bigint"}function Qn(t){return t&&typeof t=="object"&&Object.getPrototypeOf(t).isComplex===!0||!1}function Io(t){return t&&typeof t=="object"&&Object.getPrototypeOf(t).isFraction===!0||!1}function En(t){return t&&t.constructor.prototype.isUnit===!0||!1}function Qr(t){return typeof t=="string"}var sr=Array.isArray;function Je(t){return t&&t.constructor.prototype.isMatrix===!0||!1}function un(t){return Array.isArray(t)||Je(t)}function Zs(t){return t&&t.isDenseMatrix&&t.constructor.prototype.isMatrix===!0||!1}function Fo(t){return t&&t.isSparseMatrix&&t.constructor.prototype.isMatrix===!0||!1}function Du(t){return t&&t.constructor.prototype.isRange===!0||!1}function Xa(t){return t&&t.constructor.prototype.isIndex===!0||!1}function Av(t){return typeof t=="boolean"}function Tv(t){return t&&t.constructor.prototype.isResultSet===!0||!1}function Oc(t){return t&&t.constructor.prototype.isHelp===!0||!1}function Nv(t){return typeof t=="function"}function Mv(t){return t instanceof Date}function Cv(t){return t instanceof RegExp}function $o(t){return!!(t&&typeof t=="object"&&t.constructor===Object&&!Qn(t)&&!Io(t))}function Ya(t){return t?t instanceof Map||t instanceof wu||typeof t.set=="function"&&typeof t.get=="function"&&typeof t.keys=="function"&&typeof t.has=="function":!1}function tF(t){return Ya(t)&&Ya(t.a)&&Ya(t.b)}function rF(t){return Ya(t)&&$o(t.wrappedObject)}function $v(t){return t===null}function Iv(t){return t===void 0}function ji(t){return t&&t.isAccessorNode===!0&&t.constructor.prototype.isNode===!0||!1}function ei(t){return t&&t.isArrayNode===!0&&t.constructor.prototype.isNode===!0||!1}function Fv(t){return t&&t.isAssignmentNode===!0&&t.constructor.prototype.isNode===!0||!1}function kv(t){return t&&t.isBlockNode===!0&&t.constructor.prototype.isNode===!0||!1}function Pv(t){return t&&t.isConditionalNode===!0&&t.constructor.prototype.isNode===!0||!1}function Lt(t){return t&&t.isConstantNode===!0&&t.constructor.prototype.isNode===!0||!1}function Hp(t){return Lt(t)||Lr(t)&&t.args.length===1&&Lt(t.args[0])&&"-+~".includes(t.op)}function ta(t){return t&&t.isFunctionAssignmentNode===!0&&t.constructor.prototype.isNode===!0||!1}function gi(t){return t&&t.isFunctionNode===!0&&t.constructor.prototype.isNode===!0||!1}function uo(t){return t&&t.isIndexNode===!0&&t.constructor.prototype.isNode===!0||!1}function Yt(t){return t&&t.isNode===!0&&t.constructor.prototype.isNode===!0||!1}function Ka(t){return t&&t.isObjectNode===!0&&t.constructor.prototype.isNode===!0||!1}function Lr(t){return t&&t.isOperatorNode===!0&&t.constructor.prototype.isNode===!0||!1}function ti(t){return t&&t.isParenthesisNode===!0&&t.constructor.prototype.isNode===!0||!1}function Bv(t){return t&&t.isRangeNode===!0&&t.constructor.prototype.isNode===!0||!1}function Ov(t){return t&&t.isRelationalNode===!0&&t.constructor.prototype.isNode===!0||!1}function Nr(t){return t&&t.isSymbolNode===!0&&t.constructor.prototype.isNode===!0||!1}function Rc(t){return t&&t.constructor.prototype.isChain===!0||!1}function ir(t){var e=typeof t;return e==="object"?t===null?"null":mt(t)?"BigNumber":t.constructor&&t.constructor.name?t.constructor.name:"Object":e}function dt(t){var e=typeof t;if(e==="number"||e==="bigint"||e==="string"||e==="boolean"||t===null||t===void 0)return t;if(typeof t.clone=="function")return t.clone();if(Array.isArray(t))return t.map(function(r){return dt(r)});if(t instanceof Date)return new Date(t.valueOf());if(mt(t))return t;if($o(t))return mQ(t,dt);if(e==="function")return t;throw new TypeError("Cannot clone: unknown type of value (value: ".concat(t,")"))}function mQ(t,e){var r={};for(var i in t)rt(t,i)&&(r[i]=e(t[i]));return r}function Rv(t,e){for(var r in e)rt(e,r)&&(t[r]=e[r]);return t}function yD(t,e){if(Array.isArray(e))throw new TypeError("Arrays are not supported by deepExtend");for(var r in e)if(rt(e,r)&&!(r in Object.prototype)&&!(r in Function.prototype))if(e[r]&&e[r].constructor===Object)t[r]===void 0&&(t[r]={}),t[r]&&t[r].constructor===Object?yD(t[r],e[r]):t[r]=e[r];else{if(Array.isArray(e[r]))throw new TypeError("Arrays are not supported by deepExtend");t[r]=e[r]}return t}function lo(t,e){var r,i,n;if(Array.isArray(t)){if(!Array.isArray(e)||t.length!==e.length)return!1;for(i=0,n=t.length;i<n;i++)if(!lo(t[i],e[i]))return!1;return!0}else{if(typeof t=="function")return t===e;if(t instanceof Object){if(Array.isArray(e)||!(e instanceof Object))return!1;for(r in t)if(!(r in e)||!lo(t[r],e[r]))return!1;for(r in e)if(!(r in t))return!1;return!0}else return t===e}}function nF(t){var e={};return iF(t,e),e}function iF(t,e){for(var r in t)if(rt(t,r)){var i=t[r];typeof i=="object"&&i!==null?iF(i,e):e[r]=i}}function Gs(t,e,r){var i=!0,n;Object.defineProperty(t,e,{get:function(){return i&&(n=r(),i=!1),n},set:function(a){n=a,i=!1},configurable:!0,enumerable:!0})}function rt(t,e){return t&&Object.hasOwnProperty.call(t,e)}function oF(t){return t&&typeof t.factory=="function"}function aF(t,e){for(var r={},i=0;i<e.length;i++){var n=e[i],o=t[n];o!==void 0&&(r[n]=o)}return r}var sF=["Matrix","Array"],uF=["number","BigNumber","Fraction"];function cF(t,e){function r(i){if(i){if(i.epsilon!==void 0){console.warn('Warning: The configuration option "epsilon" is deprecated. Use "relTol" and "absTol" instead.');var n=dt(i);return n.relTol=i.epsilon,n.absTol=i.epsilon*.001,delete n.epsilon,r(n)}var o=dt(t);lF(i,"matrix",sF),lF(i,"number",uF),yD(t,i);var a=dt(t),s=dt(i);return e("config",a,o,s),a}else return dt(t)}return r.MATRIX_OPTIONS=sF,r.NUMBER_OPTIONS=uF,Object.keys(Dv).forEach(i=>{Object.defineProperty(r,i,{get:()=>t[i],enumerable:!0,configurable:!0})}),r}function lF(t,e,r){t[e]!==void 0&&!r.includes(t[e])&&console.warn('Warning: Unknown value "'+t[e]+'" for configuration option "'+e+'". Available options: '+r.map(i=>JSON.stringify(i)).join(", ")+".")}var sA={};hs(sA,{createAbs:()=>nP,createAccessorNode:()=>DL,createAcos:()=>eR,createAcosh:()=>rR,createAcot:()=>iR,createAcoth:()=>aR,createAcsc:()=>uR,createAcsch:()=>cR,createAdd:()=>mL,createAddScalar:()=>aP,createAnd:()=>ky,createAndTransform:()=>Y9,createArg:()=>a2,createArrayNode:()=>EL,createAsec:()=>pR,createAsech:()=>dR,createAsin:()=>gR,createAsinh:()=>vR,createAssignmentNode:()=>NL,createAtan:()=>yR,createAtan2:()=>xR,createAtanh:()=>wR,createAtomicMass:()=>K8,createAvogadro:()=>Q8,createBellNumbers:()=>$5,createBigNumberClass:()=>zF,createBigint:()=>kk,createBignumber:()=>Lk,createBin:()=>wB,createBitAnd:()=>yy,createBitAndTransform:()=>X9,createBitNot:()=>t2,createBitOr:()=>by,createBitOrTransform:()=>K9,createBitXor:()=>i2,createBlockNode:()=>ML,createBohrMagneton:()=>I8,createBohrRadius:()=>R8,createBoltzmann:()=>e9,createBoolean:()=>Rk,createCatalan:()=>F5,createCbrt:()=>cP,createCeil:()=>fP,createChain:()=>aV,createChainClass:()=>D4,createClassicalElectronRadius:()=>L8,createClone:()=>uk,createColumn:()=>wy,createColumnTransform:()=>_9,createCombinations:()=>qV,createCombinationsWithRep:()=>GV,createCompare:()=>mO,createCompareNatural:()=>vO,createCompareText:()=>bO,createCompile:()=>YL,createComplex:()=>Uk,createComplexClass:()=>VF,createComposition:()=>P5,createConcat:()=>_y,createConcatTransform:()=>B9,createConditionalNode:()=>CL,createConductanceQuantum:()=>F8,createConj:()=>u2,createConstantNode:()=>BL,createCorr:()=>UV,createCos:()=>DR,createCosh:()=>AR,createCot:()=>NR,createCoth:()=>CR,createCoulomb:()=>M8,createCoulombConstant:()=>C8,createCount:()=>_2,createCreateUnit:()=>KO,createCross:()=>S2,createCsc:()=>IR,createCsch:()=>kR,createCtranspose:()=>tB,createCube:()=>mP,createCumSum:()=>hb,createCumSumTransform:()=>j9,createDeepEqual:()=>NO,createDenseMatrixClass:()=>ak,createDerivative:()=>W5,createDet:()=>uV,createDeuteronMass:()=>Z8,createDiag:()=>E2,createDiff:()=>Ay,createDiffTransform:()=>R9,createDistance:()=>NV,createDivide:()=>AV,createDivideScalar:()=>OB,createDot:()=>bL,createDotDivide:()=>XB,createDotMultiply:()=>WP,createDotPow:()=>YB,createE:()=>c8,createEfimovFactor:()=>X8,createEigs:()=>hV,createElectricConstant:()=>T8,createElectronMass:()=>U8,createElementaryCharge:()=>$8,createEqual:()=>xO,createEqualScalar:()=>$k,createEqualText:()=>wO,createErf:()=>pB,createEvaluate:()=>XL,createExp:()=>hP,createExpm:()=>vV,createExpm1:()=>vP,createFactorial:()=>KV,createFalse:()=>i8,createFaraday:()=>t9,createFermiCoupling:()=>z8,createFft:()=>oB,createFibonacciHeapClass:()=>LO,createFilter:()=>Sy,createFilterTransform:()=>D9,createFineStructure:()=>V8,createFirstRadiation:()=>r9,createFix:()=>yP,createFlatten:()=>N2,createFloor:()=>dy,createForEach:()=>Dy,createForEachTransform:()=>E9,createFormat:()=>xB,createFraction:()=>zk,createFractionClass:()=>jF,createFreqz:()=>Q5,createFunctionAssignmentNode:()=>OL,createFunctionNode:()=>ZL,createGamma:()=>HV,createGasConstant:()=>i9,createGcd:()=>SP,createGetMatrixDataType:()=>C2,createGravitationConstant:()=>S8,createGravity:()=>m9,createHartreeEnergy:()=>q8,createHasNumericValue:()=>_k,createHelp:()=>iV,createHelpClass:()=>S4,createHex:()=>AB,createHypot:()=>hL,createI:()=>y8,createIdentity:()=>I2,createIfft:()=>sB,createIm:()=>c2,createImmutableDenseMatrixClass:()=>BO,createIndex:()=>wL,createIndexClass:()=>RO,createIndexNode:()=>RL,createIndexTransform:()=>A9,createInfinity:()=>a8,createIntersect:()=>MV,createInv:()=>cV,createInverseConductanceQuantum:()=>k8,createInvmod:()=>ZP,createIsInteger:()=>ck,createIsNaN:()=>Tk,createIsNegative:()=>vk,createIsNumeric:()=>bk,createIsPositive:()=>Sk,createIsPrime:()=>kB,createIsZero:()=>Ek,createKldivergence:()=>e5,createKlitzing:()=>O8,createKron:()=>k2,createLN10:()=>m8,createLN2:()=>p8,createLOG10E:()=>h8,createLOG2E:()=>d8,createLarger:()=>EO,createLargerEq:()=>AO,createLcm:()=>EP,createLeafCount:()=>O5,createLeftShift:()=>sO,createLgamma:()=>JV,createLog:()=>qB,createLog10:()=>TP,createLog1p:()=>ZB,createLog2:()=>MP,createLoschmidt:()=>n9,createLsolve:()=>QB,createLsolveAll:()=>nO,createLup:()=>r4,createLusolve:()=>x4,createLyap:()=>EV,createMad:()=>PV,createMagneticConstant:()=>A8,createMagneticFluxQuantum:()=>P8,createMap:()=>Ey,createMapSlices:()=>sm,createMapSlicesTransform:()=>x9,createMapTransform:()=>T9,createMatrix:()=>qk,createMatrixClass:()=>GF,createMatrixFromColumns:()=>Yk,createMatrixFromFunction:()=>Zk,createMatrixFromRows:()=>Wk,createMax:()=>Vy,createMaxTransform:()=>C9,createMean:()=>gb,createMeanTransform:()=>$9,createMedian:()=>FV,createMin:()=>qy,createMinTransform:()=>I9,createMod:()=>hy,createMode:()=>gB,createMolarMass:()=>f9,createMolarMassC12:()=>p9,createMolarPlanckConstant:()=>o9,createMolarVolume:()=>a9,createMultinomial:()=>r5,createMultiply:()=>IP,createMultiplyScalar:()=>CP,createNaN:()=>s8,createNeutronMass:()=>G8,createNode:()=>SL,createNorm:()=>vL,createNot:()=>d2,createNthRoot:()=>kP,createNthRoots:()=>WB,createNuclearMagneton:()=>B8,createNull:()=>o8,createNumber:()=>Fk,createNumeric:()=>PB,createObjectNode:()=>LL,createOct:()=>DB,createOnes:()=>B2,createOperatorNode:()=>UL,createOr:()=>xy,createOrTransform:()=>J9,createParenthesisNode:()=>zL,createParse:()=>WL,createParser:()=>e4,createParserClass:()=>KL,createPartitionSelect:()=>$O,createPermutations:()=>o5,createPhi:()=>f8,createPi:()=>u8,createPickRandom:()=>S5,createPinv:()=>pV,createPlanckCharge:()=>v9,createPlanckConstant:()=>D8,createPlanckLength:()=>d9,createPlanckMass:()=>h9,createPlanckTemperature:()=>y9,createPlanckTime:()=>g9,createPolynomialRoot:()=>w4,createPow:()=>LB,createPrint:()=>Fy,createPrintTransform:()=>H9,createProd:()=>yB,createProtonMass:()=>j8,createQr:()=>i4,createQuantileSeq:()=>yb,createQuantileSeqTransform:()=>V9,createQuantumOfCirculation:()=>W8,createRandom:()=>E5,createRandomInt:()=>T5,createRange:()=>My,createRangeClass:()=>ZF,createRangeNode:()=>VL,createRangeTransform:()=>F9,createRationalize:()=>Y5,createRe:()=>p2,createReducedPlanckConstant:()=>E8,createRelationalNode:()=>qL,createReplacer:()=>t8,createReshape:()=>L2,createResize:()=>U2,createResolve:()=>q5,createResultSet:()=>AF,createReviver:()=>e8,createRightArithShift:()=>lO,createRightLogShift:()=>fO,createRotate:()=>V2,createRotationMatrix:()=>j2,createRound:()=>zB,createRow:()=>Cy,createRowTransform:()=>k9,createRydberg:()=>H8,createSQRT1_2:()=>g8,createSQRT2:()=>v8,createSackurTetrode:()=>s9,createSchur:()=>SV,createSec:()=>BR,createSech:()=>RR,createSecondRadiation:()=>u9,createSetCartesian:()=>WR,createSetDifference:()=>YR,createSetDistinct:()=>XR,createSetIntersect:()=>QR,createSetIsSubset:()=>tL,createSetMultiplicity:()=>nL,createSetPowerset:()=>oL,createSetSize:()=>sL,createSetSymDifference:()=>lL,createSetUnion:()=>fL,createSign:()=>BP,createSimplify:()=>L5,createSimplifyConstant:()=>U5,createSimplifyCore:()=>V5,createSin:()=>UR,createSinh:()=>VR,createSize:()=>W2,createSlu:()=>y4,createSmaller:()=>SO,createSmallerEq:()=>DO,createSolveODE:()=>fB,createSort:()=>FO,createSpaClass:()=>UO,createSparse:()=>JO,createSparseMatrixClass:()=>Ik,createSpeedOfLight:()=>w8,createSplitUnit:()=>Xk,createSqrt:()=>OP,createSqrtm:()=>bV,createSquare:()=>LP,createSqueeze:()=>Y2,createStd:()=>bb,createStdTransform:()=>L9,createStefanBoltzmann:()=>l9,createStirlingS2:()=>M5,createString:()=>Bk,createSubset:()=>$y,createSubsetTransform:()=>P9,createSubtract:()=>zP,createSubtractScalar:()=>uP,createSum:()=>mb,createSumTransform:()=>z9,createSylvester:()=>_V,createSymbolNode:()=>jL,createSymbolicEqual:()=>Z5,createTan:()=>jR,createTanh:()=>ZR,createTau:()=>l8,createThomsonCrossSection:()=>Y8,createTo:()=>CB,createToBest:()=>IB,createTrace:()=>xL,createTranspose:()=>Q2,createTrue:()=>n8,createTypeOf:()=>Mk,createTyped:()=>EF,createUnaryMinus:()=>Qk,createUnaryPlus:()=>tP,createUnequal:()=>MO,createUnitClass:()=>GO,createUnitFunction:()=>HO,createUppercaseE:()=>x8,createUppercasePi:()=>b8,createUsolve:()=>tO,createUsolveAll:()=>oO,createVacuumImpedance:()=>N8,createVariance:()=>vb,createVarianceTransform:()=>G9,createVersion:()=>_8,createWeakMixingAngle:()=>J8,createWienDisplacement:()=>c9,createXgcd:()=>qP,createXor:()=>v2,createZeros:()=>nB,createZeta:()=>dB,createZpk2tf:()=>X5});var ED=Ar(Lv(),1);function N(t,e,r,i){function n(o){var a=aF(o,e.map(_D));return dQ(t,e,o),r(a)}return n.isFactory=!0,n.fn=t,n.dependencies=e.slice().sort(),i&&(n.meta=i),n}function gl(t){return typeof t=="function"&&typeof t.fn=="string"&&Array.isArray(t.dependencies)}function dQ(t,e,r){var i=e.filter(o=>!hQ(o)).every(o=>r[o]!==void 0);if(!i){var n=e.filter(o=>r[o]===void 0);throw new Error('Cannot create function "'.concat(t,'", ')+"some dependencies are missing: ".concat(n.map(o=>'"'.concat(o,'"')).join(", "),"."))}}function hQ(t){return t&&t[0]==="?"}function _D(t){return t&&t[0]==="?"?t.slice(1):t}function Ge(t){return typeof t=="boolean"?!0:isFinite(t)?t===Math.round(t):!1}function Mi(t,e){if(e.number==="bigint")try{BigInt(t)}catch{return e.numberFallback}return e.number}var ra=Math.sign||function(t){return t>0?1:t<0?-1:0},mF=Math.log2||function(e){return Math.log(e)/Math.LN2},dF=Math.log10||function(e){return Math.log(e)/Math.LN10},Uv=Math.log1p||function(t){return Math.log(t+1)},hF=Math.cbrt||function(e){if(e===0)return e;var r=e<0,i;return r&&(e=-e),isFinite(e)?(i=Math.exp(Math.log(e)/3),i=(e/(i*i)+2*i)/3):i=e,r?-i:i},gF=Math.expm1||function(e){return e>=2e-4||e<=-2e-4?Math.exp(e)-1:e+e*e/2+e*e*e/6};function wD(t,e,r){var i={2:"0b",8:"0o",16:"0x"},n=i[e],o="";if(r){if(r<1)throw new Error("size must be in greater than 0");if(!Ge(r))throw new Error("size must be an integer");if(t>2**(r-1)-1||t<-(2**(r-1)))throw new Error("Value must be in range [-2^".concat(r-1,", 2^").concat(r-1,"-1]"));if(!Ge(t))throw new Error("Value must be an integer");t<0&&(t=t+2**r),o="i".concat(r)}var a="";return t<0&&(t=-t,a="-"),"".concat(a).concat(n).concat(t.toString(e)).concat(o)}function Da(t,e){if(typeof e=="function")return e(t);if(t===1/0)return"Infinity";if(t===-1/0)return"-Infinity";if(isNaN(t))return"NaN";var{notation:r,precision:i,wordSize:n}=SD(e);switch(r){case"fixed":return DD(t,i);case"exponential":return vF(t,i);case"engineering":return gQ(t,i);case"bin":return wD(t,2,n);case"oct":return wD(t,8,n);case"hex":return wD(t,16,n);case"auto":return vQ(t,i,e).replace(/((\.\d*?)(0+))($|e)/,function(){var o=arguments[2],a=arguments[4];return o!=="."?o+a:a});default:throw new Error('Unknown notation "'+r+'". Choose "auto", "exponential", "fixed", "bin", "oct", or "hex.')}}function SD(t){var e="auto",r,i;if(t!==void 0)if(Et(t))r=t;else if(mt(t))r=t.toNumber();else if($o(t))t.precision!==void 0&&(r=fF(t.precision,()=>{throw new Error('Option "precision" must be a number or BigNumber')})),t.wordSize!==void 0&&(i=fF(t.wordSize,()=>{throw new Error('Option "wordSize" must be a number or BigNumber')})),t.notation&&(e=t.notation);else throw new Error("Unsupported type of options, number, BigNumber, or object expected");return{notation:e,precision:r,wordSize:i}}function Uc(t){var e=String(t).toLowerCase().match(/^(-?)(\d+\.?\d*)(e([+-]?\d+))?$/);if(!e)throw new SyntaxError("Invalid number "+t);var r=e[1],i=e[2],n=parseFloat(e[4]||"0"),o=i.indexOf(".");n+=o!==-1?o-1:i.length-1;var a=i.replace(".","").replace(/^0*/,function(s){return n-=s.length,""}).replace(/0*$/,"").split("").map(function(s){return parseInt(s)});return a.length===0&&(a.push(0),n++),{sign:r,coefficients:a,exponent:n}}function gQ(t,e){if(isNaN(t)||!isFinite(t))return String(t);var r=Uc(t),i=zv(r,e),n=i.exponent,o=i.coefficients,a=n%3===0?n:n<0?n-3-n%3:n-n%3;if(Et(e))for(;e>o.length||n-a+1>o.length;)o.push(0);else for(var s=Math.abs(n-a)-(o.length-1),l=0;l<s;l++)o.push(0);for(var u=Math.abs(n-a),c=1;u>0;)c++,u--;var f=o.slice(c).join(""),m=Et(e)&&f.length||f.match(/[1-9]/)?"."+f:"",p=o.slice(0,c).join("")+m+"e"+(n>=0?"+":"")+a.toString();return i.sign+p}function DD(t,e){if(isNaN(t)||!isFinite(t))return String(t);var r=Uc(t),i=typeof e=="number"?zv(r,r.exponent+1+e):r,n=i.coefficients,o=i.exponent+1,a=o+(e||0);return n.length<a&&(n=n.concat(Lc(a-n.length))),o<0&&(n=Lc(-o+1).concat(n),o=1),o<n.length&&n.splice(o,0,o===0?"0.":"."),i.sign+n.join("")}function vF(t,e){if(isNaN(t)||!isFinite(t))return String(t);var r=Uc(t),i=e?zv(r,e):r,n=i.coefficients,o=i.exponent;n.length<e&&(n=n.concat(Lc(e-n.length)));var a=n.shift();return i.sign+a+(n.length>0?"."+n.join(""):"")+"e"+(o>=0?"+":"")+o}function vQ(t,e,r){if(isNaN(t)||!isFinite(t))return String(t);var i=pF(r?.lowerExp,-3),n=pF(r?.upperExp,5),o=Uc(t),a=e?zv(o,e):o;if(a.exponent<i||a.exponent>=n)return vF(t,e);var s=a.coefficients,l=a.exponent;s.length<e&&(s=s.concat(Lc(e-s.length))),s=s.concat(Lc(l-s.length+1+(s.length<e?e-s.length:0))),s=Lc(-l).concat(s);var u=l>0?l:0;return u<s.length-1&&s.splice(u+1,0,"."),a.sign+s.join("")}function zv(t,e){for(var r={sign:t.sign,coefficients:t.coefficients,exponent:t.exponent},i=r.coefficients;e<=0;)i.unshift(0),r.exponent++,e++;if(i.length>e){var n=i.splice(e,i.length-e);if(n[0]>=5){var o=e-1;for(i[o]++;i[o]===10;)i.pop(),o===0&&(i.unshift(0),r.exponent++,o++),o--,i[o]++}}return r}function Lc(t){for(var e=[],r=0;r<t;r++)e.push(0);return e}function yF(t){return t.toExponential().replace(/e.*$/,"").replace(/^0\.?0*|\./,"").length}function jr(t,e){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1e-8,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0;if(r<=0)throw new Error("Relative tolerance must be greater than 0");if(i<0)throw new Error("Absolute tolerance must be at least 0");return isNaN(t)||isNaN(e)?!1:!isFinite(t)||!isFinite(e)?t===e:t===e?!0:Math.abs(t-e)<=Math.max(r*Math.max(Math.abs(t),Math.abs(e)),i)}var bF=Math.acosh||function(t){return Math.log(Math.sqrt(t*t-1)+t)},xF=Math.asinh||function(t){return Math.log(Math.sqrt(t*t+1)+t)},_F=Math.atanh||function(t){return Math.log((1+t)/(1-t))/2},Vv=Math.cosh||function(t){return(Math.exp(t)+Math.exp(-t))/2},wF=Math.sinh||function(t){return(Math.exp(t)-Math.exp(-t))/2},qv=Math.tanh||function(t){var e=Math.exp(2*t);return(e-1)/(e+1)};function SF(t,e){var r=t>0?!0:t<0?!1:1/t===1/0,i=e>0?!0:e<0?!1:1/e===1/0;return r^i?-t:t}function fF(t,e){if(Et(t))return t;if(mt(t))return t.toNumber();e()}function pF(t,e){return Et(t)?t:mt(t)?t.toNumber():e}var DF=function(){return DF=ED.default.create,ED.default},yQ=["?BigNumber","?Complex","?DenseMatrix","?Fraction"],EF=N("typed",yQ,function(e){var{BigNumber:r,Complex:i,DenseMatrix:n,Fraction:o}=e,a=DF();return a.clear(),a.addTypes([{name:"number",test:Et},{name:"Complex",test:Qn},{name:"BigNumber",test:mt},{name:"bigint",test:Ja},{name:"Fraction",test:Io},{name:"Unit",test:En},{name:"identifier",test:s=>Qr&&/^(?:[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(s)},{name:"string",test:Qr},{name:"Chain",test:Rc},{name:"Array",test:sr},{name:"Matrix",test:Je},{name:"DenseMatrix",test:Zs},{name:"SparseMatrix",test:Fo},{name:"Range",test:Du},{name:"Index",test:Xa},{name:"boolean",test:Av},{name:"ResultSet",test:Tv},{name:"Help",test:Oc},{name:"function",test:Nv},{name:"Date",test:Mv},{name:"RegExp",test:Cv},{name:"null",test:$v},{name:"undefined",test:Iv},{name:"AccessorNode",test:ji},{name:"ArrayNode",test:ei},{name:"AssignmentNode",test:Fv},{name:"BlockNode",test:kv},{name:"ConditionalNode",test:Pv},{name:"ConstantNode",test:Lt},{name:"FunctionNode",test:gi},{name:"FunctionAssignmentNode",test:ta},{name:"IndexNode",test:uo},{name:"Node",test:Yt},{name:"ObjectNode",test:Ka},{name:"OperatorNode",test:Lr},{name:"ParenthesisNode",test:ti},{name:"RangeNode",test:Bv},{name:"RelationalNode",test:Ov},{name:"SymbolNode",test:Nr},{name:"Map",test:Ya},{name:"Object",test:$o}]),a.addConversions([{from:"number",to:"BigNumber",convert:function(l){if(r||jv(l),yF(l)>15)throw new TypeError("Cannot implicitly convert a number with >15 significant digits to BigNumber (value: "+l+"). Use function bignumber(x) to convert to BigNumber.");return new r(l)}},{from:"number",to:"Complex",convert:function(l){return i||Zv(l),new i(l,0)}},{from:"BigNumber",to:"Complex",convert:function(l){return i||Zv(l),new i(l.toNumber(),0)}},{from:"bigint",to:"number",convert:function(l){if(l>Number.MAX_SAFE_INTEGER)throw new TypeError("Cannot implicitly convert bigint to number: value exceeds the max safe integer value (value: "+l+")");return Number(l)}},{from:"bigint",to:"BigNumber",convert:function(l){return r||jv(l),new r(l.toString())}},{from:"bigint",to:"Fraction",convert:function(l){return o||Gv(l),new o(l)}},{from:"Fraction",to:"BigNumber",convert:function(l){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(l){return i||Zv(l),new i(l.valueOf(),0)}},{from:"number",to:"Fraction",convert:function(l){o||Gv(l);var u=new o(l);if(u.valueOf()!==l)throw new TypeError("Cannot implicitly convert a number to a Fraction when there will be a loss of precision (value: "+l+"). Use function fraction(x) to convert to Fraction.");return u}},{from:"string",to:"number",convert:function(l){var u=Number(l);if(isNaN(u))throw new Error('Cannot convert "'+l+'" to a number');return u}},{from:"string",to:"BigNumber",convert:function(l){r||jv(l);try{return new r(l)}catch{throw new Error('Cannot convert "'+l+'" to BigNumber')}}},{from:"string",to:"bigint",convert:function(l){try{return BigInt(l)}catch{throw new Error('Cannot convert "'+l+'" to BigInt')}}},{from:"string",to:"Fraction",convert:function(l){o||Gv(l);try{return new o(l)}catch{throw new Error('Cannot convert "'+l+'" to Fraction')}}},{from:"string",to:"Complex",convert:function(l){i||Zv(l);try{return new i(l)}catch{throw new Error('Cannot convert "'+l+'" to Complex')}}},{from:"boolean",to:"number",convert:function(l){return+l}},{from:"boolean",to:"BigNumber",convert:function(l){return r||jv(l),new r(+l)}},{from:"boolean",to:"bigint",convert:function(l){return BigInt(+l)}},{from:"boolean",to:"Fraction",convert:function(l){return o||Gv(l),new o(+l)}},{from:"boolean",to:"string",convert:function(l){return String(l)}},{from:"Array",to:"Matrix",convert:function(l){return n||bQ(),new n(l)}},{from:"Matrix",to:"Array",convert:function(l){return l.valueOf()}}]),a.onMismatch=(s,l,u)=>{var c=a.createError(s,l,u);if(["wrongType","mismatch"].includes(c.data.category)&&l.length===1&&un(l[0])&&u.some(m=>!m.params.includes(","))){var f=new TypeError("Function '".concat(s,"' doesn't apply to matrices. To call it ")+"elementwise on a matrix 'M', try 'map(M, ".concat(s,")'."));throw f.data=c.data,f}throw c},a.onMismatch=(s,l,u)=>{var c=a.createError(s,l,u);if(["wrongType","mismatch"].includes(c.data.category)&&l.length===1&&un(l[0])&&u.some(m=>!m.params.includes(","))){var f=new TypeError("Function '".concat(s,"' doesn't apply to matrices. To call it ")+"elementwise on a matrix 'M', try 'map(M, ".concat(s,")'."));throw f.data=c.data,f}throw c},a});function jv(t){throw new Error("Cannot convert value ".concat(t," into a BigNumber: no class 'BigNumber' provided"))}function Zv(t){throw new Error("Cannot convert value ".concat(t," into a Complex number: no class 'Complex' provided"))}function bQ(){throw new Error("Cannot convert array into a Matrix: no class 'DenseMatrix' provided")}function Gv(t){throw new Error("Cannot convert value ".concat(t," into a Fraction, no class 'Fraction' provided."))}var xQ="ResultSet",_Q=[],AF=N(xQ,_Q,()=>{function t(e){if(!(this instanceof t))throw new SyntaxError("Constructor must be called with the new operator");this.entries=e||[]}return t.prototype.type="ResultSet",t.prototype.isResultSet=!0,t.prototype.valueOf=function(){return this.entries},t.prototype.toString=function(){return"["+this.entries.map(String).join(", ")+"]"},t.prototype.toJSON=function(){return{mathjs:"ResultSet",entries:this.entries}},t.fromJSON=function(e){return new t(e.entries)},t},{isClass:!0});var zc=9e15,Nu=1e9,AD="0123456789abcdef",Yv="2.3025850929940456840179914546843642076011014886287729760333279009675726096773524802359972050895982983419677840422862486334095254650828067566662873690987816894829072083255546808437998948262331985283935053089653777326288461633662222876982198867465436674744042432743651550489343149393914796194044002221051017141748003688084012647080685567743216228355220114804663715659121373450747856947683463616792101806445070648000277502684916746550586856935673420670581136429224554405758925724208241314695689016758940256776311356919292033376587141660230105703089634572075440370847469940168269282808481184289314848524948644871927809676271275775397027668605952496716674183485704422507197965004714951050492214776567636938662976979522110718264549734772662425709429322582798502585509785265383207606726317164309505995087807523710333101197857547331541421808427543863591778117054309827482385045648019095610299291824318237525357709750539565187697510374970888692180205189339507238539205144634197265287286965110862571492198849978748873771345686209167058",Jv="3.1415926535897932384626433832795028841971693993751058209749445923078164062862089986280348253421170679821480865132823066470938446095505822317253594081284811174502841027019385211055596446229489549303819644288109756659334461284756482337867831652712019091456485669234603486104543266482133936072602491412737245870066063155881748815209209628292540917153643678925903600113305305488204665213841469519415116094330572703657595919530921861173819326117931051185480744623799627495673518857527248912279381830119491298336733624406566430860213949463952247371907021798609437027705392171762931767523846748184676694051320005681271452635608277857713427577896091736371787214684409012249534301465495853710507922796892589235420199561121290219608640344181598136297747713099605187072113499999983729780499510597317328160963185950244594553469083026425223082533446850352619311881710100031378387528865875332083814206171776691473035982534904287554687311595628638823537875937519577818577805321712268066130019278766111959092164201989380952572010654858632789",TD={precision:20,rounding:4,modulo:1,toExpNeg:-7,toExpPos:21,minE:-zc,maxE:zc,crypto:!1},CF,Ws,tr=!0,Kv="[DecimalError] ",Tu=Kv+"Invalid argument: ",$F=Kv+"Precision limit exceeded",IF=Kv+"crypto unavailable",FF="[object Decimal]",Ci=Math.floor,ri=Math.pow,wQ=/^0b([01]+(\.[01]*)?|\.[01]+)(p[+-]?\d+)?$/i,SQ=/^0x([0-9a-f]+(\.[0-9a-f]*)?|\.[0-9a-f]+)(p[+-]?\d+)?$/i,DQ=/^0o([0-7]+(\.[0-7]*)?|\.[0-7]+)(p[+-]?\d+)?$/i,kF=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,Ea=1e7,Vt=7,EQ=9007199254740991,AQ=Yv.length-1,ND=Jv.length-1,Le={toStringTag:FF};Le.absoluteValue=Le.abs=function(){var t=new this.constructor(this);return t.s<0&&(t.s=1),kt(t)};Le.ceil=function(){return kt(new this.constructor(this),this.e+1,2)};Le.clampedTo=Le.clamp=function(t,e){var r,i=this,n=i.constructor;if(t=new n(t),e=new n(e),!t.s||!e.s)return new n(NaN);if(t.gt(e))throw Error(Tu+e);return r=i.cmp(t),r<0?t:i.cmp(e)>0?e:new n(i)};Le.comparedTo=Le.cmp=function(t){var e,r,i,n,o=this,a=o.d,s=(t=new o.constructor(t)).d,l=o.s,u=t.s;if(!a||!s)return!l||!u?NaN:l!==u?l:a===s?0:!a^l<0?1:-1;if(!a[0]||!s[0])return a[0]?l:s[0]?-u:0;if(l!==u)return l;if(o.e!==t.e)return o.e>t.e^l<0?1:-1;for(i=a.length,n=s.length,e=0,r=i<n?i:n;e<r;++e)if(a[e]!==s[e])return a[e]>s[e]^l<0?1:-1;return i===n?0:i>n^l<0?1:-1};Le.cosine=Le.cos=function(){var t,e,r=this,i=r.constructor;return r.d?r.d[0]?(t=i.precision,e=i.rounding,i.precision=t+Math.max(r.e,r.sd())+Vt,i.rounding=1,r=TQ(i,LF(i,r)),i.precision=t,i.rounding=e,kt(Ws==2||Ws==3?r.neg():r,t,e,!0)):new i(1):new i(NaN)};Le.cubeRoot=Le.cbrt=function(){var t,e,r,i,n,o,a,s,l,u,c=this,f=c.constructor;if(!c.isFinite()||c.isZero())return new f(c);for(tr=!1,o=c.s*ri(c.s*c,1/3),!o||Math.abs(o)==1/0?(r=vi(c.d),t=c.e,(o=(t-r.length+1)%3)&&(r+=o==1||o==-2?"0":"00"),o=ri(r,1/3),t=Ci((t+1)/3)-(t%3==(t<0?-1:2)),o==1/0?r="5e"+t:(r=o.toExponential(),r=r.slice(0,r.indexOf("e")+1)+t),i=new f(r),i.s=c.s):i=new f(o.toString()),a=(t=f.precision)+3;;)if(s=i,l=s.times(s).times(s),u=l.plus(c),i=Jr(u.plus(c).times(s),u.plus(l),a+2,1),vi(s.d).slice(0,a)===(r=vi(i.d)).slice(0,a))if(r=r.slice(a-3,a+1),r=="9999"||!n&&r=="4999"){if(!n&&(kt(s,t+1,0),s.times(s).times(s).eq(c))){i=s;break}a+=4,n=1}else{(!+r||!+r.slice(1)&&r.charAt(0)=="5")&&(kt(i,t+1,1),e=!i.times(i).times(i).eq(c));break}return tr=!0,kt(i,t,f.rounding,e)};Le.decimalPlaces=Le.dp=function(){var t,e=this.d,r=NaN;if(e){if(t=e.length-1,r=(t-Ci(this.e/Vt))*Vt,t=e[t],t)for(;t%10==0;t/=10)r--;r<0&&(r=0)}return r};Le.dividedBy=Le.div=function(t){return Jr(this,new this.constructor(t))};Le.dividedToIntegerBy=Le.divToInt=function(t){var e=this,r=e.constructor;return kt(Jr(e,new r(t),0,1,1),r.precision,r.rounding)};Le.equals=Le.eq=function(t){return this.cmp(t)===0};Le.floor=function(){return kt(new this.constructor(this),this.e+1,3)};Le.greaterThan=Le.gt=function(t){return this.cmp(t)>0};Le.greaterThanOrEqualTo=Le.gte=function(t){var e=this.cmp(t);return e==1||e===0};Le.hyperbolicCosine=Le.cosh=function(){var t,e,r,i,n,o=this,a=o.constructor,s=new a(1);if(!o.isFinite())return new a(o.s?1/0:NaN);if(o.isZero())return s;r=a.precision,i=a.rounding,a.precision=r+Math.max(o.e,o.sd())+4,a.rounding=1,n=o.d.length,n<32?(t=Math.ceil(n/3),e=(1/ey(4,t)).toString()):(t=16,e="2.3283064365386962890625e-10"),o=Vc(a,1,o.times(e),new a(1),!0);for(var l,u=t,c=new a(8);u--;)l=o.times(o),o=s.minus(l.times(c.minus(l.times(c))));return kt(o,a.precision=r,a.rounding=i,!0)};Le.hyperbolicSine=Le.sinh=function(){var t,e,r,i,n=this,o=n.constructor;if(!n.isFinite()||n.isZero())return new o(n);if(e=o.precision,r=o.rounding,o.precision=e+Math.max(n.e,n.sd())+4,o.rounding=1,i=n.d.length,i<3)n=Vc(o,2,n,n,!0);else{t=1.4*Math.sqrt(i),t=t>16?16:t|0,n=n.times(1/ey(5,t)),n=Vc(o,2,n,n,!0);for(var a,s=new o(5),l=new o(16),u=new o(20);t--;)a=n.times(n),n=n.times(s.plus(a.times(l.times(a).plus(u))))}return o.precision=e,o.rounding=r,kt(n,e,r,!0)};Le.hyperbolicTangent=Le.tanh=function(){var t,e,r=this,i=r.constructor;return r.isFinite()?r.isZero()?new i(r):(t=i.precision,e=i.rounding,i.precision=t+7,i.rounding=1,Jr(r.sinh(),r.cosh(),i.precision=t,i.rounding=e)):new i(r.s)};Le.inverseCosine=Le.acos=function(){var t=this,e=t.constructor,r=t.abs().cmp(1),i=e.precision,n=e.rounding;return r!==-1?r===0?t.isNeg()?Qa(e,i,n):new e(0):new e(NaN):t.isZero()?Qa(e,i+4,n).times(.5):(e.precision=i+6,e.rounding=1,t=new e(1).minus(t).div(t.plus(1)).sqrt().atan(),e.precision=i,e.rounding=n,t.times(2))};Le.inverseHyperbolicCosine=Le.acosh=function(){var t,e,r=this,i=r.constructor;return r.lte(1)?new i(r.eq(1)?0:NaN):r.isFinite()?(t=i.precision,e=i.rounding,i.precision=t+Math.max(Math.abs(r.e),r.sd())+4,i.rounding=1,tr=!1,r=r.times(r).minus(1).sqrt().plus(r),tr=!0,i.precision=t,i.rounding=e,r.ln()):new i(r)};Le.inverseHyperbolicSine=Le.asinh=function(){var t,e,r=this,i=r.constructor;return!r.isFinite()||r.isZero()?new i(r):(t=i.precision,e=i.rounding,i.precision=t+2*Math.max(Math.abs(r.e),r.sd())+6,i.rounding=1,tr=!1,r=r.times(r).plus(1).sqrt().plus(r),tr=!0,i.precision=t,i.rounding=e,r.ln())};Le.inverseHyperbolicTangent=Le.atanh=function(){var t,e,r,i,n=this,o=n.constructor;return n.isFinite()?n.e>=0?new o(n.abs().eq(1)?n.s/0:n.isZero()?n:NaN):(t=o.precision,e=o.rounding,i=n.sd(),Math.max(i,t)<2*-n.e-1?kt(new o(n),t,e,!0):(o.precision=r=i-n.e,n=Jr(n.plus(1),new o(1).minus(n),r+t,1),o.precision=t+4,o.rounding=1,n=n.ln(),o.precision=t,o.rounding=e,n.times(.5))):new o(NaN)};Le.inverseSine=Le.asin=function(){var t,e,r,i,n=this,o=n.constructor;return n.isZero()?new o(n):(e=n.abs().cmp(1),r=o.precision,i=o.rounding,e!==-1?e===0?(t=Qa(o,r+4,i).times(.5),t.s=n.s,t):new o(NaN):(o.precision=r+6,o.rounding=1,n=n.div(new o(1).minus(n.times(n)).sqrt().plus(1)).atan(),o.precision=r,o.rounding=i,n.times(2)))};Le.inverseTangent=Le.atan=function(){var t,e,r,i,n,o,a,s,l,u=this,c=u.constructor,f=c.precision,m=c.rounding;if(u.isFinite()){if(u.isZero())return new c(u);if(u.abs().eq(1)&&f+4<=ND)return a=Qa(c,f+4,m).times(.25),a.s=u.s,a}else{if(!u.s)return new c(NaN);if(f+4<=ND)return a=Qa(c,f+4,m).times(.5),a.s=u.s,a}for(c.precision=s=f+10,c.rounding=1,r=Math.min(28,s/Vt+2|0),t=r;t;--t)u=u.div(u.times(u).plus(1).sqrt().plus(1));for(tr=!1,e=Math.ceil(s/Vt),i=1,l=u.times(u),a=new c(u),n=u;t!==-1;)if(n=n.times(l),o=a.minus(n.div(i+=2)),n=n.times(l),a=o.plus(n.div(i+=2)),a.d[e]!==void 0)for(t=e;a.d[t]===o.d[t]&&t--;);return r&&(a=a.times(2<<r-1)),tr=!0,kt(a,c.precision=f,c.rounding=m,!0)};Le.isFinite=function(){return!!this.d};Le.isInteger=Le.isInt=function(){return!!this.d&&Ci(this.e/Vt)>this.d.length-2};Le.isNaN=function(){return!this.s};Le.isNegative=Le.isNeg=function(){return this.s<0};Le.isPositive=Le.isPos=function(){return this.s>0};Le.isZero=function(){return!!this.d&&this.d[0]===0};Le.lessThan=Le.lt=function(t){return this.cmp(t)<0};Le.lessThanOrEqualTo=Le.lte=function(t){return this.cmp(t)<1};Le.logarithm=Le.log=function(t){var e,r,i,n,o,a,s,l,u=this,c=u.constructor,f=c.precision,m=c.rounding,p=5;if(t==null)t=new c(10),e=!0;else{if(t=new c(t),r=t.d,t.s<0||!r||!r[0]||t.eq(1))return new c(NaN);e=t.eq(10)}if(r=u.d,u.s<0||!r||!r[0]||u.eq(1))return new c(r&&!r[0]?-1/0:u.s!=1?NaN:r?0:1/0);if(e)if(r.length>1)o=!0;else{for(n=r[0];n%10===0;)n/=10;o=n!==1}if(tr=!1,s=f+p,a=Au(u,s),i=e?Xv(c,s+10):Au(t,s),l=Jr(a,i,s,1),Yp(l.d,n=f,m))do if(s+=10,a=Au(u,s),i=e?Xv(c,s+10):Au(t,s),l=Jr(a,i,s,1),!o){+vi(l.d).slice(n+1,n+15)+1==1e14&&(l=kt(l,f+1,0));break}while(Yp(l.d,n+=10,m));return tr=!0,kt(l,f,m)};Le.minus=Le.sub=function(t){var e,r,i,n,o,a,s,l,u,c,f,m,p=this,d=p.constructor;if(t=new d(t),!p.d||!t.d)return!p.s||!t.s?t=new d(NaN):p.d?t.s=-t.s:t=new d(t.d||p.s!==t.s?p:NaN),t;if(p.s!=t.s)return t.s=-t.s,p.plus(t);if(u=p.d,m=t.d,s=d.precision,l=d.rounding,!u[0]||!m[0]){if(m[0])t.s=-t.s;else if(u[0])t=new d(p);else return new d(l===3?-0:0);return tr?kt(t,s,l):t}if(r=Ci(t.e/Vt),c=Ci(p.e/Vt),u=u.slice(),o=c-r,o){for(f=o<0,f?(e=u,o=-o,a=m.length):(e=m,r=c,a=u.length),i=Math.max(Math.ceil(s/Vt),a)+2,o>i&&(o=i,e.length=1),e.reverse(),i=o;i--;)e.push(0);e.reverse()}else{for(i=u.length,a=m.length,f=i<a,f&&(a=i),i=0;i<a;i++)if(u[i]!=m[i]){f=u[i]<m[i];break}o=0}for(f&&(e=u,u=m,m=e,t.s=-t.s),a=u.length,i=m.length-a;i>0;--i)u[a++]=0;for(i=m.length;i>o;){if(u[--i]<m[i]){for(n=i;n&&u[--n]===0;)u[n]=Ea-1;--u[n],u[i]+=Ea}u[i]-=m[i]}for(;u[--a]===0;)u.pop();for(;u[0]===0;u.shift())--r;return u[0]?(t.d=u,t.e=Qv(u,r),tr?kt(t,s,l):t):new d(l===3?-0:0)};Le.modulo=Le.mod=function(t){var e,r=this,i=r.constructor;return t=new i(t),!r.d||!t.s||t.d&&!t.d[0]?new i(NaN):!t.d||r.d&&!r.d[0]?kt(new i(r),i.precision,i.rounding):(tr=!1,i.modulo==9?(e=Jr(r,t.abs(),0,3,1),e.s*=t.s):e=Jr(r,t,0,i.modulo,1),e=e.times(t),tr=!0,r.minus(e))};Le.naturalExponential=Le.exp=function(){return MD(this)};Le.naturalLogarithm=Le.ln=function(){return Au(this)};Le.negated=Le.neg=function(){var t=new this.constructor(this);return t.s=-t.s,kt(t)};Le.plus=Le.add=function(t){var e,r,i,n,o,a,s,l,u,c,f=this,m=f.constructor;if(t=new m(t),!f.d||!t.d)return!f.s||!t.s?t=new m(NaN):f.d||(t=new m(t.d||f.s===t.s?f:NaN)),t;if(f.s!=t.s)return t.s=-t.s,f.minus(t);if(u=f.d,c=t.d,s=m.precision,l=m.rounding,!u[0]||!c[0])return c[0]||(t=new m(f)),tr?kt(t,s,l):t;if(o=Ci(f.e/Vt),i=Ci(t.e/Vt),u=u.slice(),n=o-i,n){for(n<0?(r=u,n=-n,a=c.length):(r=c,i=o,a=u.length),o=Math.ceil(s/Vt),a=o>a?o+1:a+1,n>a&&(n=a,r.length=1),r.reverse();n--;)r.push(0);r.reverse()}for(a=u.length,n=c.length,a-n<0&&(n=a,r=c,c=u,u=r),e=0;n;)e=(u[--n]=u[n]+c[n]+e)/Ea|0,u[n]%=Ea;for(e&&(u.unshift(e),++i),a=u.length;u[--a]==0;)u.pop();return t.d=u,t.e=Qv(u,i),tr?kt(t,s,l):t};Le.precision=Le.sd=function(t){var e,r=this;if(t!==void 0&&t!==!!t&&t!==1&&t!==0)throw Error(Tu+t);return r.d?(e=PF(r.d),t&&r.e+1>e&&(e=r.e+1)):e=NaN,e};Le.round=function(){var t=this,e=t.constructor;return kt(new e(t),t.e+1,e.rounding)};Le.sine=Le.sin=function(){var t,e,r=this,i=r.constructor;return r.isFinite()?r.isZero()?new i(r):(t=i.precision,e=i.rounding,i.precision=t+Math.max(r.e,r.sd())+Vt,i.rounding=1,r=MQ(i,LF(i,r)),i.precision=t,i.rounding=e,kt(Ws>2?r.neg():r,t,e,!0)):new i(NaN)};Le.squareRoot=Le.sqrt=function(){var t,e,r,i,n,o,a=this,s=a.d,l=a.e,u=a.s,c=a.constructor;if(u!==1||!s||!s[0])return new c(!u||u<0&&(!s||s[0])?NaN:s?a:1/0);for(tr=!1,u=Math.sqrt(+a),u==0||u==1/0?(e=vi(s),(e.length+l)%2==0&&(e+="0"),u=Math.sqrt(e),l=Ci((l+1)/2)-(l<0||l%2),u==1/0?e="5e"+l:(e=u.toExponential(),e=e.slice(0,e.indexOf("e")+1)+l),i=new c(e)):i=new c(u.toString()),r=(l=c.precision)+3;;)if(o=i,i=o.plus(Jr(a,o,r+2,1)).times(.5),vi(o.d).slice(0,r)===(e=vi(i.d)).slice(0,r))if(e=e.slice(r-3,r+1),e=="9999"||!n&&e=="4999"){if(!n&&(kt(o,l+1,0),o.times(o).eq(a))){i=o;break}r+=4,n=1}else{(!+e||!+e.slice(1)&&e.charAt(0)=="5")&&(kt(i,l+1,1),t=!i.times(i).eq(a));break}return tr=!0,kt(i,l,c.rounding,t)};Le.tangent=Le.tan=function(){var t,e,r=this,i=r.constructor;return r.isFinite()?r.isZero()?new i(r):(t=i.precision,e=i.rounding,i.precision=t+10,i.rounding=1,r=r.sin(),r.s=1,r=Jr(r,new i(1).minus(r.times(r)).sqrt(),t+10,0),i.precision=t,i.rounding=e,kt(Ws==2||Ws==4?r.neg():r,t,e,!0)):new i(NaN)};Le.times=Le.mul=function(t){var e,r,i,n,o,a,s,l,u,c=this,f=c.constructor,m=c.d,p=(t=new f(t)).d;if(t.s*=c.s,!m||!m[0]||!p||!p[0])return new f(!t.s||m&&!m[0]&&!p||p&&!p[0]&&!m?NaN:!m||!p?t.s/0:t.s*0);for(r=Ci(c.e/Vt)+Ci(t.e/Vt),l=m.length,u=p.length,l<u&&(o=m,m=p,p=o,a=l,l=u,u=a),o=[],a=l+u,i=a;i--;)o.push(0);for(i=u;--i>=0;){for(e=0,n=l+i;n>i;)s=o[n]+p[i]*m[n-i-1]+e,o[n--]=s%Ea|0,e=s/Ea|0;o[n]=(o[n]+e)%Ea|0}for(;!o[--a];)o.pop();return e?++r:o.shift(),t.d=o,t.e=Qv(o,r),tr?kt(t,f.precision,f.rounding):t};Le.toBinary=function(t,e){return CD(this,2,t,e)};Le.toDecimalPlaces=Le.toDP=function(t,e){var r=this,i=r.constructor;return r=new i(r),t===void 0?r:(co(t,0,Nu),e===void 0?e=i.rounding:co(e,0,8),kt(r,t+r.e+1,e))};Le.toExponential=function(t,e){var r,i=this,n=i.constructor;return t===void 0?r=es(i,!0):(co(t,0,Nu),e===void 0?e=n.rounding:co(e,0,8),i=kt(new n(i),t+1,e),r=es(i,!0,t+1)),i.isNeg()&&!i.isZero()?"-"+r:r};Le.toFixed=function(t,e){var r,i,n=this,o=n.constructor;return t===void 0?r=es(n):(co(t,0,Nu),e===void 0?e=o.rounding:co(e,0,8),i=kt(new o(n),t+n.e+1,e),r=es(i,!1,t+i.e+1)),n.isNeg()&&!n.isZero()?"-"+r:r};Le.toFraction=function(t){var e,r,i,n,o,a,s,l,u,c,f,m,p=this,d=p.d,h=p.constructor;if(!d)return new h(p);if(u=r=new h(1),i=l=new h(0),e=new h(i),o=e.e=PF(d)-p.e-1,a=o%Vt,e.d[0]=ri(10,a<0?Vt+a:a),t==null)t=o>0?e:u;else{if(s=new h(t),!s.isInt()||s.lt(u))throw Error(Tu+s);t=s.gt(e)?o>0?e:u:s}for(tr=!1,s=new h(vi(d)),c=h.precision,h.precision=o=d.length*Vt*2;f=Jr(s,e,0,1,1),n=r.plus(f.times(i)),n.cmp(t)!=1;)r=i,i=n,n=u,u=l.plus(f.times(n)),l=n,n=e,e=s.minus(f.times(n)),s=n;return n=Jr(t.minus(r),i,0,1,1),l=l.plus(n.times(u)),r=r.plus(n.times(i)),l.s=u.s=p.s,m=Jr(u,i,o,1).minus(p).abs().cmp(Jr(l,r,o,1).minus(p).abs())<1?[u,i]:[l,r],h.precision=c,tr=!0,m};Le.toHexadecimal=Le.toHex=function(t,e){return CD(this,16,t,e)};Le.toNearest=function(t,e){var r=this,i=r.constructor;if(r=new i(r),t==null){if(!r.d)return r;t=new i(1),e=i.rounding}else{if(t=new i(t),e===void 0?e=i.rounding:co(e,0,8),!r.d)return t.s?r:t;if(!t.d)return t.s&&(t.s=r.s),t}return t.d[0]?(tr=!1,r=Jr(r,t,0,e,1).times(t),tr=!0,kt(r)):(t.s=r.s,r=t),r};Le.toNumber=function(){return+this};Le.toOctal=function(t,e){return CD(this,8,t,e)};Le.toPower=Le.pow=function(t){var e,r,i,n,o,a,s=this,l=s.constructor,u=+(t=new l(t));if(!s.d||!t.d||!s.d[0]||!t.d[0])return new l(ri(+s,u));if(s=new l(s),s.eq(1))return s;if(i=l.precision,o=l.rounding,t.eq(1))return kt(s,i,o);if(e=Ci(t.e/Vt),e>=t.d.length-1&&(r=u<0?-u:u)<=EQ)return n=BF(l,s,r,i),t.s<0?new l(1).div(n):kt(n,i,o);if(a=s.s,a<0){if(e<t.d.length-1)return new l(NaN);if((t.d[e]&1)==0&&(a=1),s.e==0&&s.d[0]==1&&s.d.length==1)return s.s=a,s}return r=ri(+s,u),e=r==0||!isFinite(r)?Ci(u*(Math.log("0."+vi(s.d))/Math.LN10+s.e+1)):new l(r+"").e,e>l.maxE+1||e<l.minE-1?new l(e>0?a/0:0):(tr=!1,l.rounding=s.s=1,r=Math.min(12,(e+"").length),n=MD(t.times(Au(s,i+r)),i),n.d&&(n=kt(n,i+5,1),Yp(n.d,i,o)&&(e=i+10,n=kt(MD(t.times(Au(s,e+r)),e),e+5,1),+vi(n.d).slice(i+1,i+15)+1==1e14&&(n=kt(n,i+1,0)))),n.s=a,tr=!0,l.rounding=o,kt(n,i,o))};Le.toPrecision=function(t,e){var r,i=this,n=i.constructor;return t===void 0?r=es(i,i.e<=n.toExpNeg||i.e>=n.toExpPos):(co(t,1,Nu),e===void 0?e=n.rounding:co(e,0,8),i=kt(new n(i),t,e),r=es(i,t<=i.e||i.e<=n.toExpNeg,t)),i.isNeg()&&!i.isZero()?"-"+r:r};Le.toSignificantDigits=Le.toSD=function(t,e){var r=this,i=r.constructor;return t===void 0?(t=i.precision,e=i.rounding):(co(t,1,Nu),e===void 0?e=i.rounding:co(e,0,8)),kt(new i(r),t,e)};Le.toString=function(){var t=this,e=t.constructor,r=es(t,t.e<=e.toExpNeg||t.e>=e.toExpPos);return t.isNeg()&&!t.isZero()?"-"+r:r};Le.truncated=Le.trunc=function(){return kt(new this.constructor(this),this.e+1,1)};Le.valueOf=Le.toJSON=function(){var t=this,e=t.constructor,r=es(t,t.e<=e.toExpNeg||t.e>=e.toExpPos);return t.isNeg()?"-"+r:r};function vi(t){var e,r,i,n=t.length-1,o="",a=t[0];if(n>0){for(o+=a,e=1;e<n;e++)i=t[e]+"",r=Vt-i.length,r&&(o+=Eu(r)),o+=i;a=t[e],i=a+"",r=Vt-i.length,r&&(o+=Eu(r))}else if(a===0)return"0";for(;a%10===0;)a/=10;return o+a}function co(t,e,r){if(t!==~~t||t<e||t>r)throw Error(Tu+t)}function Yp(t,e,r,i){var n,o,a,s;for(o=t[0];o>=10;o/=10)--e;return--e<0?(e+=Vt,n=0):(n=Math.ceil((e+1)/Vt),e%=Vt),o=ri(10,Vt-e),s=t[n]%o|0,i==null?e<3?(e==0?s=s/100|0:e==1&&(s=s/10|0),a=r<4&&s==99999||r>3&&s==49999||s==5e4||s==0):a=(r<4&&s+1==o||r>3&&s+1==o/2)&&(t[n+1]/o/100|0)==ri(10,e-2)-1||(s==o/2||s==0)&&(t[n+1]/o/100|0)==0:e<4?(e==0?s=s/1e3|0:e==1?s=s/100|0:e==2&&(s=s/10|0),a=(i||r<4)&&s==9999||!i&&r>3&&s==4999):a=((i||r<4)&&s+1==o||!i&&r>3&&s+1==o/2)&&(t[n+1]/o/1e3|0)==ri(10,e-3)-1,a}function Wv(t,e,r){for(var i,n=[0],o,a=0,s=t.length;a<s;){for(o=n.length;o--;)n[o]*=e;for(n[0]+=AD.indexOf(t.charAt(a++)),i=0;i<n.length;i++)n[i]>r-1&&(n[i+1]===void 0&&(n[i+1]=0),n[i+1]+=n[i]/r|0,n[i]%=r)}return n.reverse()}function TQ(t,e){var r,i,n;if(e.isZero())return e;i=e.d.length,i<32?(r=Math.ceil(i/3),n=(1/ey(4,r)).toString()):(r=16,n="2.3283064365386962890625e-10"),t.precision+=r,e=Vc(t,1,e.times(n),new t(1));for(var o=r;o--;){var a=e.times(e);e=a.times(a).minus(a).times(8).plus(1)}return t.precision-=r,e}var Jr=function(){function t(i,n,o){var a,s=0,l=i.length;for(i=i.slice();l--;)a=i[l]*n+s,i[l]=a%o|0,s=a/o|0;return s&&i.unshift(s),i}function e(i,n,o,a){var s,l;if(o!=a)l=o>a?1:-1;else for(s=l=0;s<o;s++)if(i[s]!=n[s]){l=i[s]>n[s]?1:-1;break}return l}function r(i,n,o,a){for(var s=0;o--;)i[o]-=s,s=i[o]<n[o]?1:0,i[o]=s*a+i[o]-n[o];for(;!i[0]&&i.length>1;)i.shift()}return function(i,n,o,a,s,l){var u,c,f,m,p,d,h,v,y,S,b,_,w,x,E,T,D,M,C,$,O=i.constructor,R=i.s==n.s?1:-1,L=i.d,k=n.d;if(!L||!L[0]||!k||!k[0])return new O(!i.s||!n.s||(L?k&&L[0]==k[0]:!k)?NaN:L&&L[0]==0||!k?R*0:R/0);for(l?(p=1,c=i.e-n.e):(l=Ea,p=Vt,c=Ci(i.e/p)-Ci(n.e/p)),C=k.length,D=L.length,y=new O(R),S=y.d=[],f=0;k[f]==(L[f]||0);f++);if(k[f]>(L[f]||0)&&c--,o==null?(x=o=O.precision,a=O.rounding):s?x=o+(i.e-n.e)+1:x=o,x<0)S.push(1),d=!0;else{if(x=x/p+2|0,f=0,C==1){for(m=0,k=k[0],x++;(f<D||m)&&x--;f++)E=m*l+(L[f]||0),S[f]=E/k|0,m=E%k|0;d=m||f<D}else{for(m=l/(k[0]+1)|0,m>1&&(k=t(k,m,l),L=t(L,m,l),C=k.length,D=L.length),T=C,b=L.slice(0,C),_=b.length;_<C;)b[_++]=0;$=k.slice(),$.unshift(0),M=k[0],k[1]>=l/2&&++M;do m=0,u=e(k,b,C,_),u<0?(w=b[0],C!=_&&(w=w*l+(b[1]||0)),m=w/M|0,m>1?(m>=l&&(m=l-1),h=t(k,m,l),v=h.length,_=b.length,u=e(h,b,v,_),u==1&&(m--,r(h,C<v?$:k,v,l))):(m==0&&(u=m=1),h=k.slice()),v=h.length,v<_&&h.unshift(0),r(b,h,_,l),u==-1&&(_=b.length,u=e(k,b,C,_),u<1&&(m++,r(b,C<_?$:k,_,l))),_=b.length):u===0&&(m++,b=[0]),S[f++]=m,u&&b[0]?b[_++]=L[T]||0:(b=[L[T]],_=1);while((T++<D||b[0]!==void 0)&&x--);d=b[0]!==void 0}S[0]||S.shift()}if(p==1)y.e=c,CF=d;else{for(f=1,m=S[0];m>=10;m/=10)f++;y.e=f+c*p-1,kt(y,s?o+y.e+1:o,a,d)}return y}}();function kt(t,e,r,i){var n,o,a,s,l,u,c,f,m,p=t.constructor;e:if(e!=null){if(f=t.d,!f)return t;for(n=1,s=f[0];s>=10;s/=10)n++;if(o=e-n,o<0)o+=Vt,a=e,c=f[m=0],l=c/ri(10,n-a-1)%10|0;else if(m=Math.ceil((o+1)/Vt),s=f.length,m>=s)if(i){for(;s++<=m;)f.push(0);c=l=0,n=1,o%=Vt,a=o-Vt+1}else break e;else{for(c=s=f[m],n=1;s>=10;s/=10)n++;o%=Vt,a=o-Vt+n,l=a<0?0:c/ri(10,n-a-1)%10|0}if(i=i||e<0||f[m+1]!==void 0||(a<0?c:c%ri(10,n-a-1)),u=r<4?(l||i)&&(r==0||r==(t.s<0?3:2)):l>5||l==5&&(r==4||i||r==6&&(o>0?a>0?c/ri(10,n-a):0:f[m-1])%10&1||r==(t.s<0?8:7)),e<1||!f[0])return f.length=0,u?(e-=t.e+1,f[0]=ri(10,(Vt-e%Vt)%Vt),t.e=-e||0):f[0]=t.e=0,t;if(o==0?(f.length=m,s=1,m--):(f.length=m+1,s=ri(10,Vt-o),f[m]=a>0?(c/ri(10,n-a)%ri(10,a)|0)*s:0),u)for(;;)if(m==0){for(o=1,a=f[0];a>=10;a/=10)o++;for(a=f[0]+=s,s=1;a>=10;a/=10)s++;o!=s&&(t.e++,f[0]==Ea&&(f[0]=1));break}else{if(f[m]+=s,f[m]!=Ea)break;f[m--]=0,s=1}for(o=f.length;f[--o]===0;)f.pop()}return tr&&(t.e>p.maxE?(t.d=null,t.e=NaN):t.e<p.minE&&(t.e=0,t.d=[0])),t}function es(t,e,r){if(!t.isFinite())return RF(t);var i,n=t.e,o=vi(t.d),a=o.length;return e?(r&&(i=r-a)>0?o=o.charAt(0)+"."+o.slice(1)+Eu(i):a>1&&(o=o.charAt(0)+"."+o.slice(1)),o=o+(t.e<0?"e":"e+")+t.e):n<0?(o="0."+Eu(-n-1)+o,r&&(i=r-a)>0&&(o+=Eu(i))):n>=a?(o+=Eu(n+1-a),r&&(i=r-n-1)>0&&(o=o+"."+Eu(i))):((i=n+1)<a&&(o=o.slice(0,i)+"."+o.slice(i)),r&&(i=r-a)>0&&(n+1===a&&(o+="."),o+=Eu(i))),o}function Qv(t,e){var r=t[0];for(e*=Vt;r>=10;r/=10)e++;return e}function Xv(t,e,r){if(e>AQ)throw tr=!0,r&&(t.precision=r),Error($F);return kt(new t(Yv),e,1,!0)}function Qa(t,e,r){if(e>ND)throw Error($F);return kt(new t(Jv),e,r,!0)}function PF(t){var e=t.length-1,r=e*Vt+1;if(e=t[e],e){for(;e%10==0;e/=10)r--;for(e=t[0];e>=10;e/=10)r++}return r}function Eu(t){for(var e="";t--;)e+="0";return e}function BF(t,e,r,i){var n,o=new t(1),a=Math.ceil(i/Vt+4);for(tr=!1;;){if(r%2&&(o=o.times(e),NF(o.d,a)&&(n=!0)),r=Ci(r/2),r===0){r=o.d.length-1,n&&o.d[r]===0&&++o.d[r];break}e=e.times(e),NF(e.d,a)}return tr=!0,o}function TF(t){return t.d[t.d.length-1]&1}function OF(t,e,r){for(var i,n,o=new t(e[0]),a=0;++a<e.length;){if(n=new t(e[a]),!n.s){o=n;break}i=o.cmp(n),(i===r||i===0&&o.s===r)&&(o=n)}return o}function MD(t,e){var r,i,n,o,a,s,l,u=0,c=0,f=0,m=t.constructor,p=m.rounding,d=m.precision;if(!t.d||!t.d[0]||t.e>17)return new m(t.d?t.d[0]?t.s<0?0:1/0:1:t.s?t.s<0?0:t:NaN);for(e==null?(tr=!1,l=d):l=e,s=new m(.03125);t.e>-2;)t=t.times(s),f+=5;for(i=Math.log(ri(2,f))/Math.LN10*2+5|0,l+=i,r=o=a=new m(1),m.precision=l;;){if(o=kt(o.times(t),l,1),r=r.times(++c),s=a.plus(Jr(o,r,l,1)),vi(s.d).slice(0,l)===vi(a.d).slice(0,l)){for(n=f;n--;)a=kt(a.times(a),l,1);if(e==null)if(u<3&&Yp(a.d,l-i,p,u))m.precision=l+=10,r=o=s=new m(1),c=0,u++;else return kt(a,m.precision=d,p,tr=!0);else return m.precision=d,a}a=s}}function Au(t,e){var r,i,n,o,a,s,l,u,c,f,m,p=1,d=10,h=t,v=h.d,y=h.constructor,S=y.rounding,b=y.precision;if(h.s<0||!v||!v[0]||!h.e&&v[0]==1&&v.length==1)return new y(v&&!v[0]?-1/0:h.s!=1?NaN:v?0:h);if(e==null?(tr=!1,c=b):c=e,y.precision=c+=d,r=vi(v),i=r.charAt(0),Math.abs(o=h.e)<15e14){for(;i<7&&i!=1||i==1&&r.charAt(1)>3;)h=h.times(t),r=vi(h.d),i=r.charAt(0),p++;o=h.e,i>1?(h=new y("0."+r),o++):h=new y(i+"."+r.slice(1))}else return u=Xv(y,c+2,b).times(o+""),h=Au(new y(i+"."+r.slice(1)),c-d).plus(u),y.precision=b,e==null?kt(h,b,S,tr=!0):h;for(f=h,l=a=h=Jr(h.minus(1),h.plus(1),c,1),m=kt(h.times(h),c,1),n=3;;){if(a=kt(a.times(m),c,1),u=l.plus(Jr(a,new y(n),c,1)),vi(u.d).slice(0,c)===vi(l.d).slice(0,c))if(l=l.times(2),o!==0&&(l=l.plus(Xv(y,c+2,b).times(o+""))),l=Jr(l,new y(p),c,1),e==null)if(Yp(l.d,c-d,S,s))y.precision=c+=d,u=a=h=Jr(f.minus(1),f.plus(1),c,1),m=kt(h.times(h),c,1),n=s=1;else return kt(l,y.precision=b,S,tr=!0);else return y.precision=b,l;l=u,n+=2}}function RF(t){return String(t.s*t.s/0)}function Hv(t,e){var r,i,n;for((r=e.indexOf("."))>-1&&(e=e.replace(".","")),(i=e.search(/e/i))>0?(r<0&&(r=i),r+=+e.slice(i+1),e=e.substring(0,i)):r<0&&(r=e.length),i=0;e.charCodeAt(i)===48;i++);for(n=e.length;e.charCodeAt(n-1)===48;--n);if(e=e.slice(i,n),e){if(n-=i,t.e=r=r-i-1,t.d=[],i=(r+1)%Vt,r<0&&(i+=Vt),i<n){for(i&&t.d.push(+e.slice(0,i)),n-=Vt;i<n;)t.d.push(+e.slice(i,i+=Vt));e=e.slice(i),i=Vt-e.length}else i-=n;for(;i--;)e+="0";t.d.push(+e),tr&&(t.e>t.constructor.maxE?(t.d=null,t.e=NaN):t.e<t.constructor.minE&&(t.e=0,t.d=[0]))}else t.e=0,t.d=[0];return t}function NQ(t,e){var r,i,n,o,a,s,l,u,c;if(e.indexOf("_")>-1){if(e=e.replace(/(\d)_(?=\d)/g,"$1"),kF.test(e))return Hv(t,e)}else if(e==="Infinity"||e==="NaN")return+e||(t.s=NaN),t.e=NaN,t.d=null,t;if(SQ.test(e))r=16,e=e.toLowerCase();else if(wQ.test(e))r=2;else if(DQ.test(e))r=8;else throw Error(Tu+e);for(o=e.search(/p/i),o>0?(l=+e.slice(o+1),e=e.substring(2,o)):e=e.slice(2),o=e.indexOf("."),a=o>=0,i=t.constructor,a&&(e=e.replace(".",""),s=e.length,o=s-o,n=BF(i,new i(r),o,o*2)),u=Wv(e,r,Ea),c=u.length-1,o=c;u[o]===0;--o)u.pop();return o<0?new i(t.s*0):(t.e=Qv(u,c),t.d=u,tr=!1,a&&(t=Jr(t,n,s*4)),l&&(t=t.times(Math.abs(l)<54?ri(2,l):Jp.pow(2,l))),tr=!0,t)}function MQ(t,e){var r,i=e.d.length;if(i<3)return e.isZero()?e:Vc(t,2,e,e);r=1.4*Math.sqrt(i),r=r>16?16:r|0,e=e.times(1/ey(5,r)),e=Vc(t,2,e,e);for(var n,o=new t(5),a=new t(16),s=new t(20);r--;)n=e.times(e),e=e.times(o.plus(n.times(a.times(n).minus(s))));return e}function Vc(t,e,r,i,n){var o,a,s,l,u=1,c=t.precision,f=Math.ceil(c/Vt);for(tr=!1,l=r.times(r),s=new t(i);;){if(a=Jr(s.times(l),new t(e++*e++),c,1),s=n?i.plus(a):i.minus(a),i=Jr(a.times(l),new t(e++*e++),c,1),a=s.plus(i),a.d[f]!==void 0){for(o=f;a.d[o]===s.d[o]&&o--;);if(o==-1)break}o=s,s=i,i=a,a=o,u++}return tr=!0,a.d.length=f+1,a}function ey(t,e){for(var r=t;--e;)r*=t;return r}function LF(t,e){var r,i=e.s<0,n=Qa(t,t.precision,1),o=n.times(.5);if(e=e.abs(),e.lte(o))return Ws=i?4:1,e;if(r=e.divToInt(n),r.isZero())Ws=i?3:2;else{if(e=e.minus(r.times(n)),e.lte(o))return Ws=TF(r)?i?2:3:i?4:1,e;Ws=TF(r)?i?1:4:i?3:2}return e.minus(n).abs()}function CD(t,e,r,i){var n,o,a,s,l,u,c,f,m,p=t.constructor,d=r!==void 0;if(d?(co(r,1,Nu),i===void 0?i=p.rounding:co(i,0,8)):(r=p.precision,i=p.rounding),!t.isFinite())c=RF(t);else{for(c=es(t),a=c.indexOf("."),d?(n=2,e==16?r=r*4-3:e==8&&(r=r*3-2)):n=e,a>=0&&(c=c.replace(".",""),m=new p(1),m.e=c.length-a,m.d=Wv(es(m),10,n),m.e=m.d.length),f=Wv(c,10,n),o=l=f.length;f[--l]==0;)f.pop();if(!f[0])c=d?"0p+0":"0";else{if(a<0?o--:(t=new p(t),t.d=f,t.e=o,t=Jr(t,m,r,i,0,n),f=t.d,o=t.e,u=CF),a=f[r],s=n/2,u=u||f[r+1]!==void 0,u=i<4?(a!==void 0||u)&&(i===0||i===(t.s<0?3:2)):a>s||a===s&&(i===4||u||i===6&&f[r-1]&1||i===(t.s<0?8:7)),f.length=r,u)for(;++f[--r]>n-1;)f[r]=0,r||(++o,f.unshift(1));for(l=f.length;!f[l-1];--l);for(a=0,c="";a<l;a++)c+=AD.charAt(f[a]);if(d){if(l>1)if(e==16||e==8){for(a=e==16?4:3,--l;l%a;l++)c+="0";for(f=Wv(c,n,e),l=f.length;!f[l-1];--l);for(a=1,c="1.";a<l;a++)c+=AD.charAt(f[a])}else c=c.charAt(0)+"."+c.slice(1);c=c+(o<0?"p":"p+")+o}else if(o<0){for(;++o;)c="0"+c;c="0."+c}else if(++o>l)for(o-=l;o--;)c+="0";else o<l&&(c=c.slice(0,o)+"."+c.slice(o))}c=(e==16?"0x":e==2?"0b":e==8?"0o":"")+c}return t.s<0?"-"+c:c}function NF(t,e){if(t.length>e)return t.length=e,!0}function CQ(t){return new this(t).abs()}function $Q(t){return new this(t).acos()}function IQ(t){return new this(t).acosh()}function FQ(t,e){return new this(t).plus(e)}function kQ(t){return new this(t).asin()}function PQ(t){return new this(t).asinh()}function BQ(t){return new this(t).atan()}function OQ(t){return new this(t).atanh()}function RQ(t,e){t=new this(t),e=new this(e);var r,i=this.precision,n=this.rounding,o=i+4;return!t.s||!e.s?r=new this(NaN):!t.d&&!e.d?(r=Qa(this,o,1).times(e.s>0?.25:.75),r.s=t.s):!e.d||t.isZero()?(r=e.s<0?Qa(this,i,n):new this(0),r.s=t.s):!t.d||e.isZero()?(r=Qa(this,o,1).times(.5),r.s=t.s):e.s<0?(this.precision=o,this.rounding=1,r=this.atan(Jr(t,e,o,1)),e=Qa(this,o,1),this.precision=i,this.rounding=n,r=t.s<0?r.minus(e):r.plus(e)):r=this.atan(Jr(t,e,o,1)),r}function LQ(t){return new this(t).cbrt()}function UQ(t){return kt(t=new this(t),t.e+1,2)}function zQ(t,e,r){return new this(t).clamp(e,r)}function VQ(t){if(!t||typeof t!="object")throw Error(Kv+"Object expected");var e,r,i,n=t.defaults===!0,o=["precision",1,Nu,"rounding",0,8,"toExpNeg",-zc,0,"toExpPos",0,zc,"maxE",0,zc,"minE",-zc,0,"modulo",0,9];for(e=0;e<o.length;e+=3)if(r=o[e],n&&(this[r]=TD[r]),(i=t[r])!==void 0)if(Ci(i)===i&&i>=o[e+1]&&i<=o[e+2])this[r]=i;else throw Error(Tu+r+": "+i);if(r="crypto",n&&(this[r]=TD[r]),(i=t[r])!==void 0)if(i===!0||i===!1||i===0||i===1)if(i)if(typeof crypto<"u"&&crypto&&(crypto.getRandomValues||crypto.randomBytes))this[r]=!0;else throw Error(IF);else this[r]=!1;else throw Error(Tu+r+": "+i);return this}function qQ(t){return new this(t).cos()}function jQ(t){return new this(t).cosh()}function UF(t){var e,r,i;function n(o){var a,s,l,u=this;if(!(u instanceof n))return new n(o);if(u.constructor=n,MF(o)){u.s=o.s,tr?!o.d||o.e>n.maxE?(u.e=NaN,u.d=null):o.e<n.minE?(u.e=0,u.d=[0]):(u.e=o.e,u.d=o.d.slice()):(u.e=o.e,u.d=o.d?o.d.slice():o.d);return}if(l=typeof o,l==="number"){if(o===0){u.s=1/o<0?-1:1,u.e=0,u.d=[0];return}if(o<0?(o=-o,u.s=-1):u.s=1,o===~~o&&o<1e7){for(a=0,s=o;s>=10;s/=10)a++;tr?a>n.maxE?(u.e=NaN,u.d=null):a<n.minE?(u.e=0,u.d=[0]):(u.e=a,u.d=[o]):(u.e=a,u.d=[o]);return}if(o*0!==0){o||(u.s=NaN),u.e=NaN,u.d=null;return}return Hv(u,o.toString())}if(l==="string")return(s=o.charCodeAt(0))===45?(o=o.slice(1),u.s=-1):(s===43&&(o=o.slice(1)),u.s=1),kF.test(o)?Hv(u,o):NQ(u,o);if(l==="bigint")return o<0?(o=-o,u.s=-1):u.s=1,Hv(u,o.toString());throw Error(Tu+o)}if(n.prototype=Le,n.ROUND_UP=0,n.ROUND_DOWN=1,n.ROUND_CEIL=2,n.ROUND_FLOOR=3,n.ROUND_HALF_UP=4,n.ROUND_HALF_DOWN=5,n.ROUND_HALF_EVEN=6,n.ROUND_HALF_CEIL=7,n.ROUND_HALF_FLOOR=8,n.EUCLID=9,n.config=n.set=VQ,n.clone=UF,n.isDecimal=MF,n.abs=CQ,n.acos=$Q,n.acosh=IQ,n.add=FQ,n.asin=kQ,n.asinh=PQ,n.atan=BQ,n.atanh=OQ,n.atan2=RQ,n.cbrt=LQ,n.ceil=UQ,n.clamp=zQ,n.cos=qQ,n.cosh=jQ,n.div=ZQ,n.exp=GQ,n.floor=WQ,n.hypot=HQ,n.ln=YQ,n.log=JQ,n.log10=KQ,n.log2=XQ,n.max=QQ,n.min=eee,n.mod=tee,n.mul=ree,n.pow=nee,n.random=iee,n.round=oee,n.sign=aee,n.sin=see,n.sinh=uee,n.sqrt=lee,n.sub=cee,n.sum=fee,n.tan=pee,n.tanh=mee,n.trunc=dee,t===void 0&&(t={}),t&&t.defaults!==!0)for(i=["precision","rounding","toExpNeg","toExpPos","maxE","minE","modulo","crypto"],e=0;e<i.length;)t.hasOwnProperty(r=i[e++])||(t[r]=this[r]);return n.config(t),n}function ZQ(t,e){return new this(t).div(e)}function GQ(t){return new this(t).exp()}function WQ(t){return kt(t=new this(t),t.e+1,3)}function HQ(){var t,e,r=new this(0);for(tr=!1,t=0;t<arguments.length;)if(e=new this(arguments[t++]),e.d)r.d&&(r=r.plus(e.times(e)));else{if(e.s)return tr=!0,new this(1/0);r=e}return tr=!0,r.sqrt()}function MF(t){return t instanceof Jp||t&&t.toStringTag===FF||!1}function YQ(t){return new this(t).ln()}function JQ(t,e){return new this(t).log(e)}function XQ(t){return new this(t).log(2)}function KQ(t){return new this(t).log(10)}function QQ(){return OF(this,arguments,-1)}function eee(){return OF(this,arguments,1)}function tee(t,e){return new this(t).mod(e)}function ree(t,e){return new this(t).mul(e)}function nee(t,e){return new this(t).pow(e)}function iee(t){var e,r,i,n,o=0,a=new this(1),s=[];if(t===void 0?t=this.precision:co(t,1,Nu),i=Math.ceil(t/Vt),this.crypto)if(crypto.getRandomValues)for(e=crypto.getRandomValues(new Uint32Array(i));o<i;)n=e[o],n>=429e7?e[o]=crypto.getRandomValues(new Uint32Array(1))[0]:s[o++]=n%1e7;else if(crypto.randomBytes){for(e=crypto.randomBytes(i*=4);o<i;)n=e[o]+(e[o+1]<<8)+(e[o+2]<<16)+((e[o+3]&127)<<24),n>=214e7?crypto.randomBytes(4).copy(e,o):(s.push(n%1e7),o+=4);o=i/4}else throw Error(IF);else for(;o<i;)s[o++]=Math.random()*1e7|0;for(i=s[--o],t%=Vt,i&&t&&(n=ri(10,Vt-t),s[o]=(i/n|0)*n);s[o]===0;o--)s.pop();if(o<0)r=0,s=[0];else{for(r=-1;s[0]===0;r-=Vt)s.shift();for(i=1,n=s[0];n>=10;n/=10)i++;i<Vt&&(r-=Vt-i)}return a.e=r,a.d=s,a}function oee(t){return kt(t=new this(t),t.e+1,this.rounding)}function aee(t){return t=new this(t),t.d?t.d[0]?t.s:0*t.s:t.s||NaN}function see(t){return new this(t).sin()}function uee(t){return new this(t).sinh()}function lee(t){return new this(t).sqrt()}function cee(t,e){return new this(t).sub(e)}function fee(){var t=0,e=arguments,r=new this(e[t]);for(tr=!1;r.s&&++t<e.length;)r=r.plus(e[t]);return tr=!0,kt(r,this.precision,this.rounding)}function pee(t){return new this(t).tan()}function mee(t){return new this(t).tanh()}function dee(t){return kt(t=new this(t),t.e+1,1)}Le[Symbol.for("nodejs.util.inspect.custom")]=Le.toString;Le[Symbol.toStringTag]="Decimal";var Jp=Le.constructor=UF(TD);Yv=new Jp(Yv);Jv=new Jp(Jv);var vl=Jp;var hee="BigNumber",gee=["?on","config"],zF=N(hee,gee,t=>{var{on:e,config:r}=t,i=vl.clone({precision:r.precision,modulo:vl.EUCLID});return i.prototype=Object.create(i.prototype),i.prototype.type="BigNumber",i.prototype.isBigNumber=!0,i.prototype.toJSON=function(){return{mathjs:"BigNumber",value:this.toString()}},i.fromJSON=function(n){return new i(n.value)},e&&e("config",function(n,o){n.precision!==o.precision&&i.config({precision:n.precision})}),i},{isClass:!0});var $i=Math.cosh||function(t){return Math.abs(t)<1e-9?1-t:(Math.exp(t)+Math.exp(-t))*.5},na=Math.sinh||function(t){return Math.abs(t)<1e-9?t:(Math.exp(t)-Math.exp(-t))*.5},vee=function(t){let e=Math.PI/4;if(-e>t||t>e)return Math.cos(t)-1;let r=t*t;return r*(r*(r*(r*(r*(r*(r*(r/20922789888e3-1/87178291200)+1/479001600)-1/3628800)+1/40320)-1/720)+1/24)-1/2)},$D=function(t,e){return t=Math.abs(t),e=Math.abs(e),t<e&&([t,e]=[e,t]),t<1e8?Math.sqrt(t*t+e*e):(e/=t,t*Math.sqrt(1+e*e))},qc=function(){throw SyntaxError("Invalid Param")};function ID(t,e){let r=Math.abs(t),i=Math.abs(e);return t===0?Math.log(i):e===0?Math.log(r):r<3e3&&i<3e3?Math.log(t*t+e*e)*.5:(t=t*.5,e=e*.5,.5*Math.log(t*t+e*e)+Math.LN2)}var yee={re:0,im:0},yl=function(t,e){let r=yee;if(t==null)r.re=r.im=0;else if(e!==void 0)r.re=t,r.im=e;else switch(typeof t){case"object":if("im"in t&&"re"in t)r.re=t.re,r.im=t.im;else if("abs"in t&&"arg"in t){if(!isFinite(t.abs)&&isFinite(t.arg))return Fe.INFINITY;r.re=t.abs*Math.cos(t.arg),r.im=t.abs*Math.sin(t.arg)}else if("r"in t&&"phi"in t){if(!isFinite(t.r)&&isFinite(t.phi))return Fe.INFINITY;r.re=t.r*Math.cos(t.phi),r.im=t.r*Math.sin(t.phi)}else t.length===2?(r.re=t[0],r.im=t[1]):qc();break;case"string":r.im=r.re=0;let i=t.replace(/_/g,"").match(/\d+\.?\d*e[+-]?\d+|\d+\.?\d*|\.\d+|./g),n=1,o=0;i===null&&qc();for(let a=0;a<i.length;a++){let s=i[a];s===" "||s===" "||s===`
`||(s==="+"?n++:s==="-"?o++:s==="i"||s==="I"?(n+o===0&&qc(),i[a+1]!==" "&&!isNaN(i[a+1])?(r.im+=parseFloat((o%2?"-":"")+i[a+1]),a++):r.im+=parseFloat((o%2?"-":"")+"1"),n=o=0):((n+o===0||isNaN(s))&&qc(),i[a+1]==="i"||i[a+1]==="I"?(r.im+=parseFloat((o%2?"-":"")+s),a++):r.re+=parseFloat((o%2?"-":"")+s),n=o=0))}n+o>0&&qc();break;case"number":r.im=0,r.re=t;break;default:qc()}return isNaN(r.re)||isNaN(r.im),r};function Fe(t,e){if(!(this instanceof Fe))return new Fe(t,e);let r=yl(t,e);this.re=r.re,this.im=r.im}Fe.prototype={re:0,im:0,sign:function(){let t=$D(this.re,this.im);return new Fe(this.re/t,this.im/t)},add:function(t,e){let r=yl(t,e),i=this.isInfinite(),n=!(isFinite(r.re)&&isFinite(r.im));return i||n?i&&n?Fe.NAN:Fe.INFINITY:new Fe(this.re+r.re,this.im+r.im)},sub:function(t,e){let r=yl(t,e),i=this.isInfinite(),n=!(isFinite(r.re)&&isFinite(r.im));return i||n?i&&n?Fe.NAN:Fe.INFINITY:new Fe(this.re-r.re,this.im-r.im)},mul:function(t,e){let r=yl(t,e),i=this.isInfinite(),n=!(isFinite(r.re)&&isFinite(r.im)),o=this.re===0&&this.im===0,a=r.re===0&&r.im===0;return i&&a||n&&o?Fe.NAN:i||n?Fe.INFINITY:r.im===0&&this.im===0?new Fe(this.re*r.re,0):new Fe(this.re*r.re-this.im*r.im,this.re*r.im+this.im*r.re)},div:function(t,e){let r=yl(t,e),i=this.isInfinite(),n=!(isFinite(r.re)&&isFinite(r.im)),o=this.re===0&&this.im===0,a=r.re===0&&r.im===0;if(o&&a||i&&n)return Fe.NAN;if(a||i)return Fe.INFINITY;if(o||n)return Fe.ZERO;if(r.im===0)return new Fe(this.re/r.re,this.im/r.re);if(Math.abs(r.re)<Math.abs(r.im)){let s=r.re/r.im,l=r.re*s+r.im;return new Fe((this.re*s+this.im)/l,(this.im*s-this.re)/l)}else{let s=r.im/r.re,l=r.im*s+r.re;return new Fe((this.re+this.im*s)/l,(this.im-this.re*s)/l)}},pow:function(t,e){let r=yl(t,e),i=this.re===0&&this.im===0;if(r.re===0&&r.im===0)return Fe.ONE;if(r.im===0){if(this.im===0&&this.re>0)return new Fe(Math.pow(this.re,r.re),0);if(this.re===0)switch((r.re%4+4)%4){case 0:return new Fe(Math.pow(this.im,r.re),0);case 1:return new Fe(0,Math.pow(this.im,r.re));case 2:return new Fe(-Math.pow(this.im,r.re),0);case 3:return new Fe(0,-Math.pow(this.im,r.re))}}if(i&&r.re>0)return Fe.ZERO;let o=Math.atan2(this.im,this.re),a=ID(this.re,this.im),s=Math.exp(r.re*a-r.im*o),l=r.im*a+r.re*o;return new Fe(s*Math.cos(l),s*Math.sin(l))},sqrt:function(){let t=this.re,e=this.im;if(e===0)return t>=0?new Fe(Math.sqrt(t),0):new Fe(0,Math.sqrt(-t));let r=$D(t,e),i=Math.sqrt(.5*(r+Math.abs(t))),n=Math.abs(e)/(2*i);return t>=0?new Fe(i,e<0?-n:n):new Fe(n,e<0?-i:i)},exp:function(){let t=Math.exp(this.re);return this.im===0?new Fe(t,0):new Fe(t*Math.cos(this.im),t*Math.sin(this.im))},expm1:function(){let t=this.re,e=this.im;return new Fe(Math.expm1(t)*Math.cos(e)+vee(e),Math.exp(t)*Math.sin(e))},log:function(){let t=this.re,e=this.im;return e===0&&t>0?new Fe(Math.log(t),0):new Fe(ID(t,e),Math.atan2(e,t))},abs:function(){return $D(this.re,this.im)},arg:function(){return Math.atan2(this.im,this.re)},sin:function(){let t=this.re,e=this.im;return new Fe(Math.sin(t)*$i(e),Math.cos(t)*na(e))},cos:function(){let t=this.re,e=this.im;return new Fe(Math.cos(t)*$i(e),-Math.sin(t)*na(e))},tan:function(){let t=2*this.re,e=2*this.im,r=Math.cos(t)+$i(e);return new Fe(Math.sin(t)/r,na(e)/r)},cot:function(){let t=2*this.re,e=2*this.im,r=Math.cos(t)-$i(e);return new Fe(-Math.sin(t)/r,na(e)/r)},sec:function(){let t=this.re,e=this.im,r=.5*$i(2*e)+.5*Math.cos(2*t);return new Fe(Math.cos(t)*$i(e)/r,Math.sin(t)*na(e)/r)},csc:function(){let t=this.re,e=this.im,r=.5*$i(2*e)-.5*Math.cos(2*t);return new Fe(Math.sin(t)*$i(e)/r,-Math.cos(t)*na(e)/r)},asin:function(){let t=this.re,e=this.im,r=new Fe(e*e-t*t+1,-2*t*e).sqrt(),i=new Fe(r.re-e,r.im+t).log();return new Fe(i.im,-i.re)},acos:function(){let t=this.re,e=this.im,r=new Fe(e*e-t*t+1,-2*t*e).sqrt(),i=new Fe(r.re-e,r.im+t).log();return new Fe(Math.PI/2-i.im,i.re)},atan:function(){let t=this.re,e=this.im;if(t===0){if(e===1)return new Fe(0,1/0);if(e===-1)return new Fe(0,-1/0)}let r=t*t+(1-e)*(1-e),i=new Fe((1-e*e-t*t)/r,-2*t/r).log();return new Fe(-.5*i.im,.5*i.re)},acot:function(){let t=this.re,e=this.im;if(e===0)return new Fe(Math.atan2(1,t),0);let r=t*t+e*e;return r!==0?new Fe(t/r,-e/r).atan():new Fe(t!==0?t/0:0,e!==0?-e/0:0).atan()},asec:function(){let t=this.re,e=this.im;if(t===0&&e===0)return new Fe(0,1/0);let r=t*t+e*e;return r!==0?new Fe(t/r,-e/r).acos():new Fe(t!==0?t/0:0,e!==0?-e/0:0).acos()},acsc:function(){let t=this.re,e=this.im;if(t===0&&e===0)return new Fe(Math.PI/2,1/0);let r=t*t+e*e;return r!==0?new Fe(t/r,-e/r).asin():new Fe(t!==0?t/0:0,e!==0?-e/0:0).asin()},sinh:function(){let t=this.re,e=this.im;return new Fe(na(t)*Math.cos(e),$i(t)*Math.sin(e))},cosh:function(){let t=this.re,e=this.im;return new Fe($i(t)*Math.cos(e),na(t)*Math.sin(e))},tanh:function(){let t=2*this.re,e=2*this.im,r=$i(t)+Math.cos(e);return new Fe(na(t)/r,Math.sin(e)/r)},coth:function(){let t=2*this.re,e=2*this.im,r=$i(t)-Math.cos(e);return new Fe(na(t)/r,-Math.sin(e)/r)},csch:function(){let t=this.re,e=this.im,r=Math.cos(2*e)-$i(2*t);return new Fe(-2*na(t)*Math.cos(e)/r,2*$i(t)*Math.sin(e)/r)},sech:function(){let t=this.re,e=this.im,r=Math.cos(2*e)+$i(2*t);return new Fe(2*$i(t)*Math.cos(e)/r,-2*na(t)*Math.sin(e)/r)},asinh:function(){let t=this.im;this.im=-this.re,this.re=t;let e=this.asin();return this.re=-this.im,this.im=t,t=e.re,e.re=-e.im,e.im=t,e},acosh:function(){let t=this.acos();if(t.im<=0){let e=t.re;t.re=-t.im,t.im=e}else{let e=t.im;t.im=-t.re,t.re=e}return t},atanh:function(){let t=this.re,e=this.im,r=t>1&&e===0,i=1-t,n=1+t,o=i*i+e*e,a=o!==0?new Fe((n*i-e*e)/o,(e*i+n*e)/o):new Fe(t!==-1?t/0:0,e!==0?e/0:0),s=a.re;return a.re=ID(a.re,a.im)/2,a.im=Math.atan2(a.im,s)/2,r&&(a.im=-a.im),a},acoth:function(){let t=this.re,e=this.im;if(t===0&&e===0)return new Fe(0,Math.PI/2);let r=t*t+e*e;return r!==0?new Fe(t/r,-e/r).atanh():new Fe(t!==0?t/0:0,e!==0?-e/0:0).atanh()},acsch:function(){let t=this.re,e=this.im;if(e===0)return new Fe(t!==0?Math.log(t+Math.sqrt(t*t+1)):1/0,0);let r=t*t+e*e;return r!==0?new Fe(t/r,-e/r).asinh():new Fe(t!==0?t/0:0,e!==0?-e/0:0).asinh()},asech:function(){let t=this.re,e=this.im;if(this.isZero())return Fe.INFINITY;let r=t*t+e*e;return r!==0?new Fe(t/r,-e/r).acosh():new Fe(t!==0?t/0:0,e!==0?-e/0:0).acosh()},inverse:function(){if(this.isZero())return Fe.INFINITY;if(this.isInfinite())return Fe.ZERO;let t=this.re,e=this.im,r=t*t+e*e;return new Fe(t/r,-e/r)},conjugate:function(){return new Fe(this.re,-this.im)},neg:function(){return new Fe(-this.re,-this.im)},ceil:function(t){return t=Math.pow(10,t||0),new Fe(Math.ceil(this.re*t)/t,Math.ceil(this.im*t)/t)},floor:function(t){return t=Math.pow(10,t||0),new Fe(Math.floor(this.re*t)/t,Math.floor(this.im*t)/t)},round:function(t){return t=Math.pow(10,t||0),new Fe(Math.round(this.re*t)/t,Math.round(this.im*t)/t)},equals:function(t,e){let r=yl(t,e);return Math.abs(r.re-this.re)<=Fe.EPSILON&&Math.abs(r.im-this.im)<=Fe.EPSILON},clone:function(){return new Fe(this.re,this.im)},toString:function(){let t=this.re,e=this.im,r="";return this.isNaN()?"NaN":this.isInfinite()?"Infinity":(Math.abs(t)<Fe.EPSILON&&(t=0),Math.abs(e)<Fe.EPSILON&&(e=0),e===0?r+t:(t!==0?(r+=t,r+=" ",e<0?(e=-e,r+="-"):r+="+",r+=" "):e<0&&(e=-e,r+="-"),e!==1&&(r+=e),r+"i"))},toVector:function(){return[this.re,this.im]},valueOf:function(){return this.im===0?this.re:null},isNaN:function(){return isNaN(this.re)||isNaN(this.im)},isZero:function(){return this.im===0&&this.re===0},isFinite:function(){return isFinite(this.re)&&isFinite(this.im)},isInfinite:function(){return!this.isFinite()}};Fe.ZERO=new Fe(0,0);Fe.ONE=new Fe(1,0);Fe.I=new Fe(0,1);Fe.PI=new Fe(Math.PI,0);Fe.E=new Fe(Math.E,0);Fe.INFINITY=new Fe(1/0,1/0);Fe.NAN=new Fe(NaN,NaN);Fe.EPSILON=1e-15;var bee="Complex",xee=[],VF=N(bee,xee,()=>(Object.defineProperty(Fe,"name",{value:"Complex"}),Fe.prototype.constructor=Fe,Fe.prototype.type="Complex",Fe.prototype.isComplex=!0,Fe.prototype.toJSON=function(){return{mathjs:"Complex",re:this.re,im:this.im}},Fe.prototype.toPolar=function(){return{r:this.abs(),phi:this.arg()}},Fe.prototype.format=function(t){var e="",r=this.im,i=this.re,n=Da(this.re,t),o=Da(this.im,t),a=Et(t)?t:t?t.precision:null;if(a!==null){var s=Math.pow(10,-a);Math.abs(i/r)<s&&(i=0),Math.abs(r/i)<s&&(r=0)}return r===0?e=n:i===0?r===1?e="i":r===-1?e="-i":e=o+"i":r<0?r===-1?e=n+" - i":e=n+" - "+o.substring(1)+"i":r===1?e=n+" + i":e=n+" + "+o+"i",e},Fe.fromPolar=function(t){switch(arguments.length){case 1:{var e=arguments[0];if(typeof e=="object")return Fe(e);throw new TypeError("Input has to be an object with r and phi keys.")}case 2:{var r=arguments[0],i=arguments[1];if(Et(r)){if(En(i)&&i.hasBase("ANGLE")&&(i=i.toNumber("rad")),Et(i))return new Fe({r,phi:i});throw new TypeError("Phi is not a number nor an angle unit.")}else throw new TypeError("Radius r is not a number.")}default:throw new SyntaxError("Wrong number of arguments in function fromPolar")}},Fe.prototype.valueOf=Fe.prototype.toString,Fe.fromJSON=function(t){return new Fe(t)},Fe.compare=function(t,e){return t.re>e.re?1:t.re<e.re?-1:t.im>e.im?1:t.im<e.im?-1:0},Fe),{isClass:!0});typeof BigInt>"u"&&(BigInt=function(t){if(isNaN(t))throw new Error("");return t});var Pt=BigInt(0),ur=BigInt(1),Xp=BigInt(2),FD=BigInt(5),fo=BigInt(10),_ee=2e3,ct={s:ur,n:Pt,d:ur};function Hs(t,e){try{t=BigInt(t)}catch{throw Mu()}return t*e}function Aa(t){return typeof t=="bigint"?t:Math.floor(t)}function dn(t,e){if(e===Pt)throw kD();let r=Object.create(ko.prototype);r.s=t<Pt?-ur:ur,t=t<Pt?-t:t;let i=bl(t,e);return r.n=t/i,r.d=e/i,r}function jc(t){let e={},r=t,i=Xp,n=FD-ur;for(;n<=r;){for(;r%i===Pt;)r/=i,e[i]=(e[i]||Pt)+ur;n+=ur+Xp*i++}return r!==t?r>1&&(e[r]=(e[r]||Pt)+ur):e[t]=(e[t]||Pt)+ur,e}var mi=function(t,e){let r=Pt,i=ur,n=ur;if(t!=null)if(e!==void 0){if(typeof t=="bigint")r=t;else{if(isNaN(t))throw Mu();if(t%1!==0)throw qF();r=BigInt(t)}if(typeof e=="bigint")i=e;else{if(isNaN(e))throw Mu();if(e%1!==0)throw qF();i=BigInt(e)}n=r*i}else if(typeof t=="object"){if("d"in t&&"n"in t)r=BigInt(t.n),i=BigInt(t.d),"s"in t&&(r*=BigInt(t.s));else if(0 in t)r=BigInt(t[0]),1 in t&&(i=BigInt(t[1]));else if(typeof t=="bigint")r=t;else throw Mu();n=r*i}else if(typeof t=="number"){if(isNaN(t))throw Mu();if(t<0&&(n=-ur,t=-t),t%1===0)r=BigInt(t);else if(t>0){let o=1,a=0,s=1,l=1,u=1,c=1e7;for(t>=1&&(o=10**Math.floor(1+Math.log10(t)),t/=o);s<=c&&u<=c;){let f=(a+l)/(s+u);if(t===f){s+u<=c?(r=a+l,i=s+u):u>s?(r=l,i=u):(r=a,i=s);break}else t>f?(a+=l,s+=u):(l+=a,u+=s),s>c?(r=l,i=u):(r=a,i=s)}r=BigInt(r)*BigInt(o),i=BigInt(i)}}else if(typeof t=="string"){let o=0,a=Pt,s=Pt,l=Pt,u=ur,c=ur,f=t.replace(/_/g,"").match(/\d+|./g);if(f===null)throw Mu();if(f[o]==="-"?(n=-ur,o++):f[o]==="+"&&o++,f.length===o+1?s=Hs(f[o++],n):f[o+1]==="."||f[o]==="."?(f[o]!=="."&&(a=Hs(f[o++],n)),o++,(o+1===f.length||f[o+1]==="("&&f[o+3]===")"||f[o+1]==="'"&&f[o+3]==="'")&&(s=Hs(f[o],n),u=fo**BigInt(f[o].length),o++),(f[o]==="("&&f[o+2]===")"||f[o]==="'"&&f[o+2]==="'")&&(l=Hs(f[o+1],n),c=fo**BigInt(f[o+1].length)-ur,o+=3)):f[o+1]==="/"||f[o+1]===":"?(s=Hs(f[o],n),u=Hs(f[o+2],ur),o+=3):f[o+3]==="/"&&f[o+1]===" "&&(a=Hs(f[o],n),s=Hs(f[o+2],n),u=Hs(f[o+4],ur),o+=5),f.length<=o)i=u*c,n=r=l+i*a+c*s;else throw Mu()}else if(typeof t=="bigint")r=t,n=t,i=ur;else throw Mu();if(i===Pt)throw kD();ct.s=n<Pt?-ur:ur,ct.n=r<Pt?-r:r,ct.d=i<Pt?-i:i};function wee(t,e,r){let i=ur;for(;e>Pt;t=t*t%r,e>>=ur)e&ur&&(i=i*t%r);return i}function See(t,e){for(;e%Xp===Pt;e/=Xp);for(;e%FD===Pt;e/=FD);if(e===ur)return Pt;let r=fo%e,i=1;for(;r!==ur;i++)if(r=r*fo%e,i>_ee)return Pt;return BigInt(i)}function Dee(t,e,r){let i=ur,n=wee(fo,r,e);for(let o=0;o<300;o++){if(i===n)return BigInt(o);i=i*fo%e,n=n*fo%e}return 0}function bl(t,e){if(!t)return e;if(!e)return t;for(;;){if(t%=e,!t)return e;if(e%=t,!e)return t}}function ko(t,e){if(mi(t,e),this instanceof ko)t=bl(ct.d,ct.n),this.s=ct.s,this.n=ct.n/t,this.d=ct.d/t;else return dn(ct.s*ct.n,ct.d)}var kD=function(){return new Error("Division by Zero")},Mu=function(){return new Error("Invalid argument")},qF=function(){return new Error("Parameters must be integer")};ko.prototype={s:ur,n:Pt,d:ur,abs:function(){return dn(this.n,this.d)},neg:function(){return dn(-this.s*this.n,this.d)},add:function(t,e){return mi(t,e),dn(this.s*this.n*ct.d+ct.s*this.d*ct.n,this.d*ct.d)},sub:function(t,e){return mi(t,e),dn(this.s*this.n*ct.d-ct.s*this.d*ct.n,this.d*ct.d)},mul:function(t,e){return mi(t,e),dn(this.s*ct.s*this.n*ct.n,this.d*ct.d)},div:function(t,e){return mi(t,e),dn(this.s*ct.s*this.n*ct.d,this.d*ct.n)},clone:function(){return dn(this.s*this.n,this.d)},mod:function(t,e){if(t===void 0)return dn(this.s*this.n%this.d,ur);if(mi(t,e),Pt===ct.n*this.d)throw kD();return dn(this.s*(ct.d*this.n)%(ct.n*this.d),ct.d*this.d)},gcd:function(t,e){return mi(t,e),dn(bl(ct.n,this.n)*bl(ct.d,this.d),ct.d*this.d)},lcm:function(t,e){return mi(t,e),ct.n===Pt&&this.n===Pt?dn(Pt,ur):dn(ct.n*this.n,bl(ct.n,this.n)*bl(ct.d,this.d))},inverse:function(){return dn(this.s*this.d,this.n)},pow:function(t,e){if(mi(t,e),ct.d===ur)return ct.s<Pt?dn((this.s*this.d)**ct.n,this.n**ct.n):dn((this.s*this.n)**ct.n,this.d**ct.n);if(this.s<Pt)return null;let r=jc(this.n),i=jc(this.d),n=ur,o=ur;for(let a in r)if(a!=="1"){if(a==="0"){n=Pt;break}if(r[a]*=ct.n,r[a]%ct.d===Pt)r[a]/=ct.d;else return null;n*=BigInt(a)**r[a]}for(let a in i)if(a!=="1"){if(i[a]*=ct.n,i[a]%ct.d===Pt)i[a]/=ct.d;else return null;o*=BigInt(a)**i[a]}return ct.s<Pt?dn(o,n):dn(n,o)},log:function(t,e){if(mi(t,e),this.s<=Pt||ct.s<=Pt)return null;let r={},i=jc(ct.n),n=jc(ct.d),o=jc(this.n),a=jc(this.d);for(let u in n)i[u]=(i[u]||Pt)-n[u];for(let u in a)o[u]=(o[u]||Pt)-a[u];for(let u in i)u!=="1"&&(r[u]=!0);for(let u in o)u!=="1"&&(r[u]=!0);let s=null,l=null;for(let u in r){let c=i[u]||Pt,f=o[u]||Pt;if(c===Pt){if(f!==Pt)return null;continue}let m=f,p=c,d=bl(m,p);if(m/=d,p/=d,s===null&&l===null)s=m,l=p;else if(m*l!==s*p)return null}return s!==null&&l!==null?dn(s,l):null},equals:function(t,e){return mi(t,e),this.s*this.n*ct.d===ct.s*ct.n*this.d},lt:function(t,e){return mi(t,e),this.s*this.n*ct.d<ct.s*ct.n*this.d},lte:function(t,e){return mi(t,e),this.s*this.n*ct.d<=ct.s*ct.n*this.d},gt:function(t,e){return mi(t,e),this.s*this.n*ct.d>ct.s*ct.n*this.d},gte:function(t,e){return mi(t,e),this.s*this.n*ct.d>=ct.s*ct.n*this.d},compare:function(t,e){mi(t,e);let r=this.s*this.n*ct.d-ct.s*ct.n*this.d;return(Pt<r)-(r<Pt)},ceil:function(t){return t=fo**BigInt(t||0),dn(Aa(this.s*t*this.n/this.d)+(t*this.n%this.d>Pt&&this.s>=Pt?ur:Pt),t)},floor:function(t){return t=fo**BigInt(t||0),dn(Aa(this.s*t*this.n/this.d)-(t*this.n%this.d>Pt&&this.s<Pt?ur:Pt),t)},round:function(t){return t=fo**BigInt(t||0),dn(Aa(this.s*t*this.n/this.d)+this.s*((this.s>=Pt?ur:Pt)+Xp*(t*this.n%this.d)>this.d?ur:Pt),t)},roundTo:function(t,e){mi(t,e);let r=this.n*ct.d,i=this.d*ct.n,n=r%i,o=Aa(r/i);return n+n>=i&&o++,dn(this.s*o*ct.n,ct.d)},divisible:function(t,e){return mi(t,e),!(!(ct.n*this.d)||this.n*ct.d%(ct.n*this.d))},valueOf:function(){return Number(this.s*this.n)/Number(this.d)},toString:function(t){let e=this.n,r=this.d;t=t||15;let i=See(e,r),n=Dee(e,r,i),o=this.s<Pt?"-":"";if(o+=Aa(e/r),e%=r,e*=fo,e&&(o+="."),i){for(let a=n;a--;)o+=Aa(e/r),e%=r,e*=fo;o+="(";for(let a=i;a--;)o+=Aa(e/r),e%=r,e*=fo;o+=")"}else for(let a=t;e&&a--;)o+=Aa(e/r),e%=r,e*=fo;return o},toFraction:function(t){let e=this.n,r=this.d,i=this.s<Pt?"-":"";if(r===ur)i+=e;else{let n=Aa(e/r);t&&n>Pt&&(i+=n,i+=" ",e%=r),i+=e,i+="/",i+=r}return i},toLatex:function(t){let e=this.n,r=this.d,i=this.s<Pt?"-":"";if(r===ur)i+=e;else{let n=Aa(e/r);t&&n>Pt&&(i+=n,e%=r),i+="\\frac{",i+=e,i+="}{",i+=r,i+="}"}return i},toContinued:function(){let t=this.n,e=this.d,r=[];do{r.push(Aa(t/e));let i=t%e;t=e,e=i}while(t!==ur);return r},simplify:function(t){let e=BigInt(1/(t||.001)|0),r=this.abs(),i=r.toContinued();for(let n=1;n<i.length;n++){let o=dn(i[n-1],ur);for(let s=n-2;s>=0;s--)o=o.inverse().add(i[s]);let a=o.sub(r);if(a.n*e<a.d)return o.mul(this.s)}return this}};var Eee="Fraction",Aee=[],jF=N(Eee,Aee,()=>(Object.defineProperty(ko,"name",{value:"Fraction"}),ko.prototype.constructor=ko,ko.prototype.type="Fraction",ko.prototype.isFraction=!0,ko.prototype.toJSON=function(){return{mathjs:"Fraction",n:String(this.s*this.n),d:String(this.d)}},ko.fromJSON=function(t){return new ko(t)},ko),{isClass:!0});var Tee="Range",Nee=[],ZF=N(Tee,Nee,()=>{function t(e,r,i){if(!(this instanceof t))throw new SyntaxError("Constructor must be called with the new operator");var n=e!=null,o=r!=null,a=i!=null;if(n){if(mt(e))e=e.toNumber();else if(typeof e!="number"&&!Ja(e))throw new TypeError("Parameter start must be a number or bigint")}if(o){if(mt(r))r=r.toNumber();else if(typeof r!="number"&&!Ja(r))throw new TypeError("Parameter end must be a number or bigint")}if(a){if(mt(i))i=i.toNumber();else if(typeof i!="number"&&!Ja(i))throw new TypeError("Parameter step must be a number or bigint")}this.start=n?parseFloat(e):0,this.end=o?parseFloat(r):0,this.step=a?parseFloat(i):1}return t.prototype.type="Range",t.prototype.isRange=!0,t.parse=function(e){if(typeof e!="string")return null;var r=e.split(":"),i=r.map(function(o){return parseFloat(o)}),n=i.some(function(o){return isNaN(o)});if(n)return null;switch(i.length){case 2:return new t(i[0],i[1]);case 3:return new t(i[0],i[2],i[1]);default:return null}},t.prototype.clone=function(){return new t(this.start,this.end,this.step)},t.prototype.size=function(){var e=0,r=this.start,i=this.step,n=this.end,o=n-r;return ra(i)===ra(o)?e=Math.ceil(o/i):o===0&&(e=0),isNaN(e)&&(e=0),[e]},t.prototype.min=function(){var e=this.size()[0];if(e>0)return this.step>0?this.start:this.start+(e-1)*this.step},t.prototype.max=function(){var e=this.size()[0];if(e>0)return this.step>0?this.start+(e-1)*this.step:this.start},t.prototype.forEach=function(e){var r=this.start,i=this.step,n=this.end,o=0;if(i>0)for(;r<n;)e(r,[o],this),r+=i,o++;else if(i<0)for(;r>n;)e(r,[o],this),r+=i,o++},t.prototype.map=function(e){var r=[];return this.forEach(function(i,n,o){r[n[0]]=e(i,n,o)}),r},t.prototype.toArray=function(){var e=[];return this.forEach(function(r,i){e[i[0]]=r}),e},t.prototype.valueOf=function(){return this.toArray()},t.prototype.format=function(e){var r=Da(this.start,e);return this.step!==1&&(r+=":"+Da(this.step,e)),r+=":"+Da(this.end,e),r},t.prototype.toString=function(){return this.format()},t.prototype.toJSON=function(){return{mathjs:"Range",start:this.start,end:this.end,step:this.step}},t.fromJSON=function(e){return new t(e.start,e.end,e.step)},t},{isClass:!0});var Mee="Matrix",Cee=[],GF=N(Mee,Cee,()=>{function t(){if(!(this instanceof t))throw new SyntaxError("Constructor must be called with the new operator")}return t.prototype.type="Matrix",t.prototype.isMatrix=!0,t.prototype.storage=function(){throw new Error("Cannot invoke storage on a Matrix interface")},t.prototype.datatype=function(){throw new Error("Cannot invoke datatype on a Matrix interface")},t.prototype.create=function(e,r){throw new Error("Cannot invoke create on a Matrix interface")},t.prototype.subset=function(e,r,i){throw new Error("Cannot invoke subset on a Matrix interface")},t.prototype.get=function(e){throw new Error("Cannot invoke get on a Matrix interface")},t.prototype.set=function(e,r,i){throw new Error("Cannot invoke set on a Matrix interface")},t.prototype.resize=function(e,r){throw new Error("Cannot invoke resize on a Matrix interface")},t.prototype.reshape=function(e,r){throw new Error("Cannot invoke reshape on a Matrix interface")},t.prototype.clone=function(){throw new Error("Cannot invoke clone on a Matrix interface")},t.prototype.size=function(){throw new Error("Cannot invoke size on a Matrix interface")},t.prototype.map=function(e,r){throw new Error("Cannot invoke map on a Matrix interface")},t.prototype.forEach=function(e){throw new Error("Cannot invoke forEach on a Matrix interface")},t.prototype[Symbol.iterator]=function(){throw new Error("Cannot iterate a Matrix interface")},t.prototype.toArray=function(){throw new Error("Cannot invoke toArray on a Matrix interface")},t.prototype.valueOf=function(){throw new Error("Cannot invoke valueOf on a Matrix interface")},t.prototype.format=function(e){throw new Error("Cannot invoke format on a Matrix interface")},t.prototype.toString=function(){throw new Error("Cannot invoke toString on a Matrix interface")},t},{isClass:!0});function PD(t,e,r){var i=t.constructor,n=new i(2),o="";if(r){if(r<1)throw new Error("size must be in greater than 0");if(!Ge(r))throw new Error("size must be an integer");if(t.greaterThan(n.pow(r-1).sub(1))||t.lessThan(n.pow(r-1).mul(-1)))throw new Error("Value must be in range [-2^".concat(r-1,", 2^").concat(r-1,"-1]"));if(!t.isInteger())throw new Error("Value must be an integer");t.lessThan(0)&&(t=t.add(n.pow(r))),o="i".concat(r)}switch(e){case 2:return"".concat(t.toBinary()).concat(o);case 8:return"".concat(t.toOctal()).concat(o);case 16:return"".concat(t.toHexadecimal()).concat(o);default:throw new Error("Base ".concat(e," not supported "))}}function YF(t,e){if(typeof e=="function")return e(t);if(!t.isFinite())return t.isNaN()?"NaN":t.gt(0)?"Infinity":"-Infinity";var{notation:r,precision:i,wordSize:n}=SD(e);switch(r){case"fixed":return Iee(t,i);case"exponential":return WF(t,i);case"engineering":return $ee(t,i);case"bin":return PD(t,2,n);case"oct":return PD(t,8,n);case"hex":return PD(t,16,n);case"auto":{var o=HF(e?.lowerExp,-3),a=HF(e?.upperExp,5);if(t.isZero())return"0";var s,l=t.toSignificantDigits(i),u=l.e;return u>=o&&u<a?s=l.toFixed():s=WF(t,i),s.replace(/((\.\d*?)(0+))($|e)/,function(){var c=arguments[2],f=arguments[4];return c!=="."?c+f:f})}default:throw new Error('Unknown notation "'+r+'". Choose "auto", "exponential", "fixed", "bin", "oct", or "hex.')}}function $ee(t,e){var r=t.e,i=r%3===0?r:r<0?r-3-r%3:r-r%3,n=t.mul(Math.pow(10,-i)),o=n.toPrecision(e);if(o.includes("e")){var a=t.constructor;o=new a(o).toFixed()}return o+"e"+(r>=0?"+":"")+i.toString()}function WF(t,e){return e!==void 0?t.toExponential(e-1):t.toExponential()}function Iee(t,e){return t.toFixed(e)}function HF(t,e){return Et(t)?t:mt(t)?t.toNumber():e}function XF(t,e){var r=t.length-e.length,i=t.length;return t.substring(r,i)===e}function Ct(t,e){var r=Fee(t,e);return e&&typeof e=="object"&&"truncate"in e&&r.length>e.truncate?r.substring(0,e.truncate-3)+"...":r}function Fee(t,e){if(typeof t=="number")return Da(t,e);if(mt(t))return YF(t,e);if(kee(t))return!e||e.fraction!=="decimal"?"".concat(t.s*t.n,"/").concat(t.d):t.toString();if(Array.isArray(t))return KF(t,e);if(Qr(t))return xl(t);if(typeof t=="function")return t.syntax?String(t.syntax):"function";if(t&&typeof t=="object"){if(typeof t.format=="function")return t.format(e);if(t&&t.toString(e)!=={}.toString())return t.toString(e);var r=Object.keys(t).map(i=>xl(i)+": "+Ct(t[i],e));return"{"+r.join(", ")+"}"}return String(t)}function xl(t){for(var e=String(t),r="",i=0;i<e.length;){var n=e.charAt(i);r+=n in JF?JF[n]:n,i++}return'"'+r+'"'}var JF={'"':'\\"',"\\":"\\\\","\b":"\\b","\f":"\\f","\n":"\\n","\r":"\\r"," ":"\\t"};function ni(t){var e=String(t);return e=e.replace(/&/g,"&amp;").replace(/"/g,"&quot;").replace(/'/g,"&#39;").replace(/</g,"&lt;").replace(/>/g,"&gt;"),e}function KF(t,e){if(Array.isArray(t)){for(var r="[",i=t.length,n=0;n<i;n++)n!==0&&(r+=", "),r+=KF(t[n],e);return r+="]",r}else return Ct(t,e)}function kee(t){return t&&typeof t=="object"&&typeof t.s=="bigint"&&typeof t.n=="bigint"&&typeof t.d=="bigint"||!1}function ty(t,e){if(!Qr(t))throw new TypeError("Unexpected type of argument in function compareText (expected: string or Array or Matrix, actual: "+ir(t)+", index: 0)");if(!Qr(e))throw new TypeError("Unexpected type of argument in function compareText (expected: string or Array or Matrix, actual: "+ir(e)+", index: 1)");return t===e?0:t>e?1:-1}function $t(t,e,r){if(!(this instanceof $t))throw new SyntaxError("Constructor must be called with the new operator");this.actual=t,this.expected=e,this.relation=r,this.message="Dimension mismatch ("+(Array.isArray(t)?"["+t.join(", ")+"]":t)+" "+(this.relation||"!=")+" "+(Array.isArray(e)?"["+e.join(", ")+"]":e)+")",this.stack=new Error().stack}$t.prototype=new RangeError;$t.prototype.constructor=RangeError;$t.prototype.name="DimensionError";$t.prototype.isDimensionError=!0;function ii(t,e,r){if(!(this instanceof ii))throw new SyntaxError("Constructor must be called with the new operator");this.index=t,arguments.length<3?(this.min=0,this.max=e):(this.min=e,this.max=r),this.min!==void 0&&this.index<this.min?this.message="Index out of range ("+this.index+" < "+this.min+")":this.max!==void 0&&this.index>=this.max?this.message="Index out of range ("+this.index+" > "+(this.max-1)+")":this.message="Index out of range ("+this.index+")",this.stack=new Error().stack}ii.prototype=new RangeError;ii.prototype.constructor=RangeError;ii.prototype.name="IndexError";ii.prototype.isIndexError=!0;function vt(t){for(var e=[];Array.isArray(t);)e.push(t.length),t=t[0];return e}function QF(t,e,r){var i,n=t.length;if(n!==e[r])throw new $t(n,e[r]);if(r<e.length-1){var o=r+1;for(i=0;i<n;i++){var a=t[i];if(!Array.isArray(a))throw new $t(e.length-1,e.length,"<");QF(t[i],e,o)}}else for(i=0;i<n;i++)if(Array.isArray(t[i]))throw new $t(e.length+1,e.length,">")}function OD(t,e){var r=e.length===0;if(r){if(Array.isArray(t))throw new $t(t.length,0)}else QF(t,e,0)}function Kp(t,e){var r=t.isMatrix?t._size:vt(t),i=e._sourceSize;i.forEach((n,o)=>{if(n!==null&&n!==r[o])throw new $t(n,r[o])})}function Mr(t,e){if(t!==void 0){if(!Et(t)||!Ge(t))throw new TypeError("Index must be an integer (value: "+t+")");if(t<0||typeof e=="number"&&t>=e)throw new ii(t,e)}}function _l(t){for(var e=0;e<t._dimensions.length;++e){var r=t._dimensions[e];if(r._data&&sr(r._data)){if(r._size[0]===0)return!0}else if(r.isRange){if(r.start===r.end)return!0}else if(Qr(r)&&r.length===0)return!0}return!1}function Ta(t,e,r){if(!Array.isArray(e))throw new TypeError("Array expected");if(e.length===0)throw new Error("Resizing to scalar is not supported");e.forEach(function(n){if(!Et(n)||!Ge(n)||n<0)throw new TypeError("Invalid size, must contain positive integers (size: "+Ct(e)+")")}),(Et(t)||mt(t))&&(t=[t]);var i=r!==void 0?r:0;return BD(t,e,0,i),t}function BD(t,e,r,i){var n,o,a=t.length,s=e[r],l=Math.min(a,s);if(t.length=s,r<e.length-1){var u=r+1;for(n=0;n<l;n++)o=t[n],Array.isArray(o)||(o=[o],t[n]=o),BD(o,e,u,i);for(n=l;n<s;n++)o=[],t[n]=o,BD(o,e,u,i)}else{for(n=0;n<l;n++)for(;Array.isArray(t[n]);)t[n]=t[n][0];for(n=l;n<s;n++)t[n]=i}}function Qp(t,e){var r=Ut(t,!0),i=r.length;if(!Array.isArray(t)||!Array.isArray(e))throw new TypeError("Array expected");if(e.length===0)throw new $t(0,i,"!=");e=em(e,i);var n=ek(e);if(i!==n)throw new $t(n,i,"!=");try{return Pee(r,e)}catch(o){throw o instanceof $t?new $t(n,i,"!="):o}}function em(t,e){var r=ek(t),i=t.slice(),n=-1,o=t.indexOf(n),a=t.indexOf(n,o+1)>=0;if(a)throw new Error("More than one wildcard in sizes");var s=o>=0,l=e%r===0;if(s)if(l)i[o]=-e/r;else throw new Error("Could not replace wildcard, since "+e+" is no multiple of "+-r);return i}function ek(t){return t.reduce((e,r)=>e*r,1)}function Pee(t,e){for(var r=t,i,n=e.length-1;n>0;n--){var o=e[n];i=[];for(var a=r.length/o,s=0;s<a;s++)i.push(r.slice(s*o,(s+1)*o));r=i}return r}function Zc(t,e){for(var r=e||vt(t);Array.isArray(t)&&t.length===1;)t=t[0],r.shift();for(var i=r.length;r[i-1]===1;)i--;return i<r.length&&(t=tk(t,i,0),r.length=i),t}function tk(t,e,r){var i,n;if(r<e){var o=r+1;for(i=0,n=t.length;i<n;i++)t[i]=tk(t[i],e,o)}else for(;Array.isArray(t);)t=t[0];return t}function ry(t,e,r,i){var n=i||vt(t);if(r)for(var o=0;o<r;o++)t=[t],n.unshift(1);for(t=rk(t,e,0);n.length<e;)n.push(1);return t}function rk(t,e,r){var i,n;if(Array.isArray(t)){var o=r+1;for(i=0,n=t.length;i<n;i++)t[i]=rk(t[i],e,o)}else for(var a=r;a<e;a++)t=[t];return t}function Ut(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;if(!Array.isArray(t))return t;if(typeof e!="boolean")throw new TypeError("Boolean expected for second argument of flatten");var r=[];return e?n(t):i(t),r;function i(o){for(var a=0;a<o.length;a++){var s=o[a];Array.isArray(s)?i(s):r.push(s)}}function n(o){if(Array.isArray(o[0]))for(var a=0;a<o.length;a++)n(o[a]);else for(var s=0;s<o.length;s++)r.push(o[s])}}function ia(t,e){return Array.prototype.map.call(t,e)}function ny(t,e){Array.prototype.forEach.call(t,e)}function RD(t,e){if(vt(t).length!==1)throw new Error("Only one dimensional matrices supported");return Array.prototype.filter.call(t,e)}function LD(t,e){if(vt(t).length!==1)throw new Error("Only one dimensional matrices supported");return Array.prototype.filter.call(t,r=>e.test(r))}function UD(t,e){return Array.prototype.join.call(t,e)}function Ys(t){if(!Array.isArray(t))throw new TypeError("Array input expected");if(t.length===0)return t;var e=[],r=0;e[0]={value:t[0],identifier:0};for(var i=1;i<t.length;i++)t[i]===t[i-1]?r++:r=0,e.push({value:t[i],identifier:r});return e}function Gc(t){if(!Array.isArray(t))throw new TypeError("Array input expected");if(t.length===0)return t;for(var e=[],r=0;r<t.length;r++)e.push(t[r].value);return e}function wl(t,e){for(var r,i=0,n=0;n<t.length;n++){var o=t[n],a=Array.isArray(o);if(n===0&&a&&(i=o.length),a&&o.length!==i)return;var s=a?wl(o,e):e(o);if(r===void 0)r=s;else if(r!==s)return"mixed"}return r}function nk(t,e,r,i){if(i<r){if(t.length!==e.length)throw new $t(t.length,e.length);for(var n=[],o=0;o<t.length;o++)n[o]=nk(t[o],e[o],r,i+1);return n}else return t.concat(e)}function zD(){var t=Array.prototype.slice.call(arguments,0,-1),e=Array.prototype.slice.call(arguments,-1);if(t.length===1)return t[0];if(t.length>1)return t.slice(1).reduce(function(r,i){return nk(r,i,e,0)},t[0]);throw new Error("Wrong number of arguments in function concat")}function tm(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];for(var i=e.map(m=>m.length),n=Math.max(...i),o=new Array(n).fill(null),a=0;a<e.length;a++)for(var s=e[a],l=i[a],u=0;u<l;u++){var c=n-l+u;s[u]>o[c]&&(o[c]=s[u])}for(var f=0;f<e.length;f++)ik(e[f],o);return o}function ik(t,e){for(var r=e.length,i=t.length,n=0;n<i;n++){var o=r-i+n;if(t[n]<e[o]&&t[n]>1||t[n]>e[o])throw new Error("shape mismatch: mismatch is found in arg with shape (".concat(t,") not possible to broadcast dimension ").concat(i," with size ").concat(t[n]," to size ").concat(e[o]))}}function ts(t,e){var r=vt(t);if(lo(r,e))return t;ik(r,e);var i=tm(r,e),n=i.length,o=[...Array(n-r.length).fill(1),...r],a=Oee(t);r.length<n&&(a=Qp(a,o),r=vt(a));for(var s=0;s<n;s++)r[s]<i[s]&&(a=Bee(a,i[s],s),r=vt(a));return a}function Bee(t,e,r){return zD(...Array(e).fill(t),r)}function Wc(t,e){if(!Array.isArray(t))throw new Error("Array expected");var r=vt(t);if(e.length!==r.length)throw new $t(e.length,r.length);for(var i=0;i<e.length;i++)Mr(e[i],r[i]);return e.reduce((n,o)=>n[o],t)}function rm(t,e){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;if(t.length===0)return[];if(r)return o(t);var i=[];return n(t,0);function n(a,s){if(Array.isArray(a)){for(var l=a.length,u=Array(l),c=0;c<l;c++)i[s]=c,u[c]=n(a[c],s+1);return u}else return e(a,i.slice(0,s),t)}function o(a){if(Array.isArray(a)){for(var s=a.length,l=Array(s),u=0;u<s;u++)l[u]=o(a[u]);return l}else return e(a)}}function iy(t,e){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;if(t.length===0)return;if(r){o(t);return}var i=[];n(t,0);function n(a,s){if(Array.isArray(a))for(var l=a.length,u=0;u<l;u++)i[s]=u,n(a[u],s+1);else e(a,i.slice(0,s),t)}function o(a){if(Array.isArray(a))for(var s=a.length,l=0;l<s;l++)o(a[l]);else e(a)}}function Oee(t){return Dn([],t)}var VD=Ar(Lv(),1);function oa(t,e,r){var i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(VD.default.isTypedFunction(t)){var n;if(i)n=1;else{var o=(e.isMatrix?e.size():vt(e)).map(()=>0),a=e.isMatrix?e.get(o):Wc(e,o);n=Uee(t,a,o,e)}var s;if(e.isMatrix&&e.dataType!=="mixed"&&e.dataType!==void 0){var l=Ree(t,n);s=l!==void 0?l:t}else s=t;return n>=1&&n<=3?{isUnary:n===1,fn:function(){for(var c=arguments.length,f=new Array(c),m=0;m<c;m++)f[m]=arguments[m];return ok(s,f.slice(0,n),r,t.name)}}:{isUnary:!1,fn:function(){for(var c=arguments.length,f=new Array(c),m=0;m<c;m++)f[m]=arguments[m];return ok(s,f,r,t.name)}}}return i===void 0?{isUnary:Lee(t),fn:t}:{isUnary:i,fn:t}}function Ree(t,e){var r=[];if(Object.entries(t.signatures).forEach(i=>{var[n,o]=i;n.split(",").length===e&&r.push(o)}),r.length===1)return r[0]}function Lee(t){if(t.length!==1)return!1;var e=t.toString();if(/arguments/.test(e))return!1;var r=e.match(/\(.*?\)/);return!/\.\.\./.test(r)}function Uee(t,e,r,i){for(var n=[e,r,i],o=3;o>0;o--){var a=n.slice(0,o);if(VD.default.resolve(t,a)!==null)return o}}function ok(t,e,r,i){try{return t(...e)}catch(n){zee(n,e,r,i)}}function zee(t,e,r,i){var n;if(t instanceof TypeError&&((n=t.data)===null||n===void 0?void 0:n.category)==="wrongType"){var o=[];throw o.push("value: ".concat(ir(e[0]))),e.length>=2&&o.push("index: ".concat(ir(e[1]))),e.length>=3&&o.push("array: ".concat(ir(e[2]))),new TypeError("Function ".concat(r," cannot apply callback arguments ")+"".concat(i,"(").concat(o.join(", "),") at index ").concat(JSON.stringify(e[1])))}else throw new TypeError("Function ".concat(r," cannot apply callback arguments ")+"to function ".concat(i,": ").concat(t.message))}var Vee="DenseMatrix",qee=["Matrix"],ak=N(Vee,qee,t=>{var{Matrix:e}=t;function r(c,f){if(!(this instanceof r))throw new SyntaxError("Constructor must be called with the new operator");if(f&&!Qr(f))throw new Error("Invalid datatype: "+f);if(Je(c))c.type==="DenseMatrix"?(this._data=dt(c._data),this._size=dt(c._size),this._datatype=f||c._datatype):(this._data=c.toArray(),this._size=c.size(),this._datatype=f||c._datatype);else if(c&&sr(c.data)&&sr(c.size))this._data=c.data,this._size=c.size,OD(this._data,this._size),this._datatype=f||c.datatype;else if(sr(c))this._data=u(c),this._size=vt(this._data),OD(this._data,this._size),this._datatype=f;else{if(c)throw new TypeError("Unsupported type of data ("+ir(c)+")");this._data=[],this._size=[0],this._datatype=f}}r.prototype=new e,r.prototype.createDenseMatrix=function(c,f){return new r(c,f)},Object.defineProperty(r,"name",{value:"DenseMatrix"}),r.prototype.constructor=r,r.prototype.type="DenseMatrix",r.prototype.isDenseMatrix=!0,r.prototype.getDataType=function(){return wl(this._data,ir)},r.prototype.storage=function(){return"dense"},r.prototype.datatype=function(){return this._datatype},r.prototype.create=function(c,f){return new r(c,f)},r.prototype.subset=function(c,f,m){switch(arguments.length){case 1:return i(this,c);case 2:case 3:return o(this,c,f,m);default:throw new SyntaxError("Wrong number of arguments")}},r.prototype.get=function(c){return Wc(this._data,c)},r.prototype.set=function(c,f,m){if(!sr(c))throw new TypeError("Array expected");if(c.length<this._size.length)throw new $t(c.length,this._size.length,"<");var p,d,h,v=c.map(function(S){return S+1});l(this,v,m);var y=this._data;for(p=0,d=c.length-1;p<d;p++)h=c[p],Mr(h,y.length),y=y[h];return h=c[c.length-1],Mr(h,y.length),y[h]=f,this};function i(c,f){if(!Xa(f))throw new TypeError("Invalid index");var m=f.isScalar();if(m)return c.get(f.min());var p=f.size();if(p.length!==c._size.length)throw new $t(p.length,c._size.length);for(var d=f.min(),h=f.max(),v=0,y=c._size.length;v<y;v++)Mr(d[v],c._size[v]),Mr(h[v],c._size[v]);var S=new r([]),b=n(c._data,f);return S._size=b.size,S._datatype=c._datatype,S._data=b.data,S}function n(c,f){var m=f.size().length-1,p=Array(m);return{data:d(c),size:p};function d(h){var v=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,y=f.dimension(v);return p[v]=y.size()[0],v<m?y.map(S=>(Mr(S,h.length),d(h[S],v+1))).valueOf():y.map(S=>(Mr(S,h.length),h[S])).valueOf()}}function o(c,f,m,p){if(!f||f.isIndex!==!0)throw new TypeError("Invalid index");var d=f.size(),h=f.isScalar(),v;if(Je(m)?(v=m.size(),m=m.valueOf()):v=vt(m),h){if(v.length!==0)throw new TypeError("Scalar expected");c.set(f.min(),m,p)}else{if(!lo(v,d))try{v.length===0?m=ts([m],d):m=ts(m,d),v=vt(m)}catch{}if(d.length<c._size.length)throw new $t(d.length,c._size.length,"<");if(v.length<d.length){for(var y=0,S=0;d[y]===1&&v[y]===1;)y++;for(;d[y]===1;)S++,y++;m=ry(m,d.length,S,v)}if(!lo(d,v))throw new $t(d,v,">");var b=f.max().map(function(_){return _+1});l(c,b,p),a(c._data,f,m)}return c}function a(c,f,m){var p=f.size().length-1;d(c,m);function d(h,v){var y=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,S=f.dimension(y);y<p?S.forEach((b,_)=>{Mr(b,h.length),d(h[b],v[_[0]],y+1)}):S.forEach((b,_)=>{Mr(b,h.length),h[b]=v[_[0]]})}}r.prototype.resize=function(c,f,m){if(!un(c))throw new TypeError("Array or Matrix expected");var p=c.valueOf().map(h=>Array.isArray(h)&&h.length===1?h[0]:h),d=m?this.clone():this;return s(d,p,f)};function s(c,f,m){if(f.length===0){for(var p=c._data;sr(p);)p=p[0];return p}return c._size=f.slice(0),c._data=Ta(c._data,c._size,m),c}r.prototype.reshape=function(c,f){var m=f?this.clone():this;m._data=Qp(m._data,c);var p=m._size.reduce((d,h)=>d*h);return m._size=em(c,p),m};function l(c,f,m){for(var p=c._size.slice(0),d=!1;p.length<f.length;)p.push(0),d=!0;for(var h=0,v=f.length;h<v;h++)f[h]>p[h]&&(p[h]=f[h],d=!0);d&&s(c,p,m)}r.prototype.clone=function(){var c=new r({data:dt(this._data),size:dt(this._size),datatype:this._datatype});return c},r.prototype.size=function(){return this._size.slice(0)},r.prototype.map=function(c){var f=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,m=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,p=this,d=p._size.length-1;if(d<0)return p.clone();var h=oa(c,p,"map",m),v=h.fn,y=p.create(void 0,p._datatype);if(y._size=p._size,m||h.isUnary)return y._data=E(p._data),y;if(d===0){for(var S=p.valueOf(),b=Array(S.length),_=0;_<S.length;_++)b[_]=v(S[_],[_],p);return y._data=b,y}var w=[];return y._data=x(p._data),y;function x(T){var D=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,M=Array(T.length);if(D<d)for(var C=0;C<T.length;C++)w[D]=C,M[C]=x(T[C],D+1);else for(var $=0;$<T.length;$++)w[D]=$,M[$]=v(T[$],w.slice(),p);return M}function E(T){var D=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,M=Array(T.length);if(D<d)for(var C=0;C<T.length;C++)M[C]=E(T[C],D+1);else for(var $=0;$<T.length;$++)M[$]=v(T[$]);return M}},r.prototype.forEach=function(c){var f=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,m=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,p=this,d=p._size.length-1;if(d<0)return;var h=oa(c,p,"map",m),v=h.fn;if(m||h.isUnary){_(p._data);return}if(d===0){for(var y=0;y<p._data.length;y++)v(p._data[y],[y],p);return}var S=[];b(p._data);function b(w){var x=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;if(x<d)for(var E=0;E<w.length;E++)S[x]=E,b(w[E],x+1);else for(var T=0;T<w.length;T++)S[x]=T,v(w[T],S.slice(),p)}function _(w){var x=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;if(x<d)for(var E=0;E<w.length;E++)_(w[E],x+1);else for(var T=0;T<w.length;T++)v(w[T])}},r.prototype[Symbol.iterator]=function*(){var c=this._size.length-1;if(!(c<0)){if(c===0){for(var f=0;f<this._data.length;f++)yield{value:this._data[f],index:[f]};return}var m=[],p=function*(h,v){if(v<c)for(var y=0;y<h.length;y++)m[v]=y,yield*p(h[y],v+1);else for(var S=0;S<h.length;S++)m[v]=S,yield{value:h[S],index:m.slice()}};yield*p(this._data,0)}},r.prototype.rows=function(){var c=[],f=this.size();if(f.length!==2)throw new TypeError("Rows can only be returned for a 2D matrix.");var m=this._data;for(var p of m)c.push(new r([p],this._datatype));return c},r.prototype.columns=function(){var c=this,f=[],m=this.size();if(m.length!==2)throw new TypeError("Rows can only be returned for a 2D matrix.");for(var p=this._data,d=function(y){var S=p.map(b=>[b[y]]);f.push(new r(S,c._datatype))},h=0;h<m[1];h++)d(h);return f},r.prototype.toArray=function(){return dt(this._data)},r.prototype.valueOf=function(){return this._data},r.prototype.format=function(c){return Ct(this._data,c)},r.prototype.toString=function(){return Ct(this._data)},r.prototype.toJSON=function(){return{mathjs:"DenseMatrix",data:this._data,size:this._size,datatype:this._datatype}},r.prototype.diagonal=function(c){if(c){if(mt(c)&&(c=c.toNumber()),!Et(c)||!Ge(c))throw new TypeError("The parameter k must be an integer number")}else c=0;for(var f=c>0?c:0,m=c<0?-c:0,p=this._size[0],d=this._size[1],h=Math.min(p-m,d-f),v=[],y=0;y<h;y++)v[y]=this._data[y+m][y+f];return new r({data:v,size:[h],datatype:this._datatype})},r.diagonal=function(c,f,m,p){if(!sr(c))throw new TypeError("Array expected, size parameter");if(c.length!==2)throw new Error("Only two dimensions matrix are supported");if(c=c.map(function(E){if(mt(E)&&(E=E.toNumber()),!Et(E)||!Ge(E)||E<1)throw new Error("Size values must be positive integers");return E}),m){if(mt(m)&&(m=m.toNumber()),!Et(m)||!Ge(m))throw new TypeError("The parameter k must be an integer number")}else m=0;var d=m>0?m:0,h=m<0?-m:0,v=c[0],y=c[1],S=Math.min(v-h,y-d),b;if(sr(f)){if(f.length!==S)throw new Error("Invalid value array length");b=function(T){return f[T]}}else if(Je(f)){var _=f.size();if(_.length!==1||_[0]!==S)throw new Error("Invalid matrix length");b=function(T){return f.get([T])}}else b=function(){return f};p||(p=mt(b(0))?b(0).mul(0):0);var w=[];if(c.length>0){w=Ta(w,c,p);for(var x=0;x<S;x++)w[x+h][x+d]=b(x)}return new r({data:w,size:[v,y]})},r.fromJSON=function(c){return new r(c)},r.prototype.swapRows=function(c,f){if(!Et(c)||!Ge(c)||!Et(f)||!Ge(f))throw new Error("Row index must be positive integers");if(this._size.length!==2)throw new Error("Only two dimensional matrix is supported");return Mr(c,this._size[0]),Mr(f,this._size[0]),r._swapRows(c,f,this._data),this},r._swapRows=function(c,f,m){var p=m[c];m[c]=m[f],m[f]=p};function u(c){return Je(c)?u(c.valueOf()):sr(c)?c.map(u):c}return r},{isClass:!0});var sk="clone",jee=["typed"],uk=N(sk,jee,t=>{var{typed:e}=t;return e(sk,{any:dt})});function oy(t){var e=t.length,r=t[0].length,i,n,o=[];for(n=0;n<r;n++){var a=[];for(i=0;i<e;i++)a.push(t[i][n]);o.push(a)}return o}function aa(t){for(var e=0;e<t.length;e++)if(un(t[e]))return!0;return!1}function Zi(t,e){Je(t)?t.forEach(r=>e(r),!1,!0):iy(t,e,!0)}function it(t,e,r){if(!r)return Je(t)?t.map(n=>e(n),!1,!0):rm(t,e,!0);var i=n=>n===0?n:e(n);return Je(t)?t.map(n=>i(n),!1,!0):rm(t,i,!0)}function Cu(t,e,r){var i=Array.isArray(t)?vt(t):t.size();if(e<0||e>=i.length)throw new ii(e,i.length);return Je(t)?t.create(ay(t.valueOf(),e,r),t.datatype()):ay(t,e,r)}function ay(t,e,r){var i,n,o,a;if(e<=0)if(Array.isArray(t[0])){for(a=oy(t),n=[],i=0;i<a.length;i++)n[i]=ay(a[i],e-1,r);return n}else{for(o=t[0],i=1;i<t.length;i++)o=r(o,t[i]);return o}else{for(n=[],i=0;i<t.length;i++)n[i]=ay(t[i],e-1,r);return n}}function qD(t,e,r,i,n,o,a,s,l,u,c){var f=t._values,m=t._index,p=t._ptr,d,h,v,y;if(i)for(h=p[e],v=p[e+1],d=h;d<v;d++)y=m[d],r[y]!==o?(r[y]=o,a.push(y),u?(i[y]=l?s(f[d],c):s(c,f[d]),n[y]=o):i[y]=f[d]):(i[y]=l?s(f[d],i[y]):s(i[y],f[d]),n[y]=o);else for(h=p[e],v=p[e+1],d=h;d<v;d++)y=m[d],r[y]!==o?(r[y]=o,a.push(y)):n[y]=o}var lk="isInteger",Zee=["typed"],ck=N(lk,Zee,t=>{var{typed:e}=t;return e(lk,{number:Ge,BigNumber:function(i){return i.isInt()},bigint:function(i){return!0},Fraction:function(i){return i.d===1n},"Array | Matrix":e.referToSelf(r=>i=>it(i,r))})});var po="number",Js="number, number";function jD(t){return Math.abs(t)}jD.signature=po;function ZD(t,e){return t+e}ZD.signature=Js;function GD(t,e){return t-e}GD.signature=Js;function WD(t,e){return t*e}WD.signature=Js;function Gee(t,e){return t/e}Gee.signature=Js;function HD(t){return-t}HD.signature=po;function YD(t){return t}YD.signature=po;function Hc(t){return hF(t)}Hc.signature=po;function JD(t){return t*t*t}JD.signature=po;function XD(t){return Math.exp(t)}XD.signature=po;function KD(t){return gF(t)}KD.signature=po;function Wee(t,e){if(!Ge(t)||!Ge(e))throw new Error("Parameters in function gcd must be integer numbers");for(var r;e!==0;)r=t%e,t=e,e=r;return t<0?-t:t}Wee.signature=Js;function QD(t,e){if(!Ge(t)||!Ge(e))throw new Error("Parameters in function lcm must be integer numbers");if(t===0||e===0)return 0;for(var r,i=t*e;e!==0;)r=e,e=t%r,t=r;return Math.abs(i/t)}QD.signature=Js;function eE(t,e){return e?Math.log(t)/Math.log(e):Math.log(t)}function nm(t){return dF(t)}nm.signature=po;function sy(t){return mF(t)}sy.signature=po;function Hee(t){return Uv(t)}Hee.signature=po;function Yee(t,e){return e===0?t:t-e*Math.floor(t/e)}Yee.signature=Js;function tE(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:2,r=e<0;if(r&&(e=-e),e===0)throw new Error("Root must be non-zero");if(t<0&&Math.abs(e)%2!==1)throw new Error("Root must be odd when a is negative.");if(t===0)return r?1/0:0;if(!isFinite(t))return r?0:t;var i=Math.pow(Math.abs(t),1/e);return i=t<0?-i:i,r?1/i:i}function uy(t){return ra(t)}uy.signature=po;function Jee(t){return Math.sqrt(t)}Jee.signature=po;function rE(t){return t*t}rE.signature=po;function nE(t,e){var r,i,n,o=0,a=1,s=1,l=0;if(!Ge(t)||!Ge(e))throw new Error("Parameters in function xgcd must be integer numbers");for(;e;)i=Math.floor(t/e),n=t-i*e,r=o,o=a-i*o,a=r,r=s,s=l-i*s,l=r,t=e,e=n;var u;return t<0?u=[-t,-a,-l]:u=[t,t?a:0,l],u}nE.signature=Js;function iE(t,e){return t*t<1&&e===1/0||t*t>1&&e===-1/0?0:Math.pow(t,e)}iE.signature=Js;function Yc(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;if(!Ge(e)||e<0||e>15)throw new Error("Number of decimals in function round must be an integer from 0 to 15 inclusive");return parseFloat(DD(t,e))}function Xee(t){return Math.abs(t)}Xee.signature=po;var Kee="number",Jc="number, number";function oE(t,e){if(!Ge(t)||!Ge(e))throw new Error("Integers expected in function bitAnd");return t&e}oE.signature=Jc;function aE(t){if(!Ge(t))throw new Error("Integer expected in function bitNot");return~t}aE.signature=Kee;function sE(t,e){if(!Ge(t)||!Ge(e))throw new Error("Integers expected in function bitOr");return t|e}sE.signature=Jc;function uE(t,e){if(!Ge(t)||!Ge(e))throw new Error("Integers expected in function bitXor");return t^e}uE.signature=Jc;function lE(t,e){if(!Ge(t)||!Ge(e))throw new Error("Integers expected in function leftShift");return t<<e}lE.signature=Jc;function cE(t,e){if(!Ge(t)||!Ge(e))throw new Error("Integers expected in function rightArithShift");return t>>e}cE.signature=Jc;function fE(t,e){if(!Ge(t)||!Ge(e))throw new Error("Integers expected in function rightLogShift");return t>>>e}fE.signature=Jc;function Po(t,e){if(e<t)return 1;if(e===t)return e;var r=e+t>>1;return Po(t,r)*Po(r+1,e)}function pE(t,e){if(!Ge(t)||t<0)throw new TypeError("Positive integer value expected in function combinations");if(!Ge(e)||e<0)throw new TypeError("Positive integer value expected in function combinations");if(e>t)throw new TypeError("k must be less than or equal to n");for(var r=t-e,i=1,n=e<r?r+1:e+1,o=2,a=e<r?e:r,s=n;s<=t;++s)for(i*=s;o<=a&&i%o===0;)i/=o,++o;return o<=a&&(i/=Po(o,a)),i}pE.signature="number, number";var fk=Math.PI,pk=2*Math.PI,mk=Math.E,dk=1.618033988749895;var Qee="number",mE="number, number";function dE(t){return!t}dE.signature=Qee;function ly(t,e){return!!(t||e)}ly.signature=mE;function cy(t,e){return!!t!=!!e}cy.signature=mE;function fy(t,e){return!!(t&&e)}fy.signature=mE;function im(t){var e;if(Ge(t))return t<=0?isFinite(t)?1/0:NaN:t>171?1/0:Po(1,t-1);if(t<.5)return Math.PI/(Math.sin(Math.PI*t)*im(1-t));if(t>=171.35)return 1/0;if(t>85){var r=t*t,i=r*t,n=i*t,o=n*t;return Math.sqrt(2*Math.PI/t)*Math.pow(t/Math.E,t)*(1+1/(12*t)+1/(288*r)-139/(51840*i)-571/(2488320*n)+163879/(209018880*o)+5246819/(75246796800*o*t))}--t,e=Sl[0];for(var a=1;a<Sl.length;++a)e+=Sl[a]/(t+a);var s=t+hE+.5;return Math.sqrt(2*Math.PI)*Math.pow(s,t+.5)*Math.exp(-s)*e}im.signature="number";var hE=4.7421875,Sl=[.9999999999999971,57.15623566586292,-59.59796035547549,14.136097974741746,-.4919138160976202,3399464998481189e-20,4652362892704858e-20,-9837447530487956e-20,.0001580887032249125,-.00021026444172410488,.00021743961811521265,-.0001643181065367639,8441822398385275e-20,-26190838401581408e-21,36899182659531625e-22],gE=.9189385332046728,ete=5,tte=7,hk=[1.000000000190015,76.18009172947146,-86.50532032941678,24.01409824083091,-1.231739572450155,.001208650973866179,-5395239384953e-18];function om(t){if(t<0)return NaN;if(t===0)return 1/0;if(!isFinite(t))return t;if(t<.5)return Math.log(Math.PI/Math.sin(Math.PI*t))-om(1-t);t=t-1;for(var e=t+ete+.5,r=hk[0],i=tte-1;i>=1;i--)r+=hk[i]/(t+i);return gE+(t+.5)*Math.log(e)-e+Math.log(r)}om.signature="number";var hn="number",rte="number, number";function nte(t){return Math.acos(t)}nte.signature=hn;function vE(t){return bF(t)}vE.signature=hn;function yE(t){return Math.atan(1/t)}yE.signature=hn;function bE(t){return isFinite(t)?(Math.log((t+1)/t)+Math.log(t/(t-1)))/2:0}bE.signature=hn;function xE(t){return Math.asin(1/t)}xE.signature=hn;function _E(t){var e=1/t;return Math.log(e+Math.sqrt(e*e+1))}_E.signature=hn;function wE(t){return Math.acos(1/t)}wE.signature=hn;function SE(t){var e=1/t,r=Math.sqrt(e*e-1);return Math.log(r+e)}SE.signature=hn;function ite(t){return Math.asin(t)}ite.signature=hn;function DE(t){return xF(t)}DE.signature=hn;function ote(t){return Math.atan(t)}ote.signature=hn;function ate(t,e){return Math.atan2(t,e)}ate.signature=rte;function EE(t){return _F(t)}EE.signature=hn;function ste(t){return Math.cos(t)}ste.signature=hn;function ute(t){return Vv(t)}ute.signature=hn;function AE(t){return 1/Math.tan(t)}AE.signature=hn;function TE(t){var e=Math.exp(2*t);return(e+1)/(e-1)}TE.signature=hn;function NE(t){return 1/Math.sin(t)}NE.signature=hn;function ME(t){return t===0?Number.POSITIVE_INFINITY:Math.abs(2/(Math.exp(t)-Math.exp(-t)))*ra(t)}ME.signature=hn;function CE(t){return 1/Math.cos(t)}CE.signature=hn;function $E(t){return 2/(Math.exp(t)+Math.exp(-t))}$E.signature=hn;function lte(t){return Math.sin(t)}lte.signature=hn;function IE(t){return wF(t)}IE.signature=hn;function cte(t){return Math.tan(t)}cte.signature=hn;function fte(t){return qv(t)}fte.signature=hn;var am="number";function pte(t){return Ge(t)}pte.signature=am;function FE(t){return t<0}FE.signature=am;function kE(t){return t>0}kE.signature=am;function mte(t){return t===0}mte.signature=am;function PE(t){return Number.isNaN(t)}PE.signature=am;function xn(t,e){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1e-9,i=arguments.length>3&&arguments[3]!==void 0?arguments[3]:0;if(r<=0)throw new Error("Relative tolerance must be greater than 0");if(i<0)throw new Error("Absolute tolerance must be at least 0");return t.isNaN()||e.isNaN()?!1:!t.isFinite()||!e.isFinite()?t.eq(e):t.eq(e)?!0:t.minus(e).abs().lte(t.constructor.max(t.constructor.max(t.abs(),e.abs()).mul(r),i))}var gk="isNegative",dte=["typed","config"],vk=N(gk,dte,t=>{var{typed:e,config:r}=t;return e(gk,{number:i=>jr(i,0,r.relTol,r.absTol)?!1:FE(i),BigNumber:i=>xn(i,new i.constructor(0),r.relTol,r.absTol)?!1:i.isNeg()&&!i.isZero()&&!i.isNaN(),bigint:i=>i<0n,Fraction:i=>i.s<0n,Unit:e.referToSelf(i=>n=>e.find(i,n.valueType())(n.value)),"Array | Matrix":e.referToSelf(i=>n=>it(n,i))})});var yk="isNumeric",hte=["typed"],bk=N(yk,hte,t=>{var{typed:e}=t;return e(yk,{"number | BigNumber | bigint | Fraction | boolean":()=>!0,"Complex | Unit | string | null | undefined | Node":()=>!1,"Array | Matrix":e.referToSelf(r=>i=>it(i,r))})});var xk="hasNumericValue",gte=["typed","isNumeric"],_k=N(xk,gte,t=>{var{typed:e,isNumeric:r}=t;return e(xk,{boolean:()=>!0,string:function(n){return n.trim().length>0&&!isNaN(Number(n))},any:function(n){return r(n)}})});var wk="isPositive",vte=["typed","config"],Sk=N(wk,vte,t=>{var{typed:e,config:r}=t;return e(wk,{number:i=>jr(i,0,r.relTol,r.absTol)?!1:kE(i),BigNumber:i=>xn(i,new i.constructor(0),r.relTol,r.absTol)?!1:!i.isNeg()&&!i.isZero()&&!i.isNaN(),bigint:i=>i>0n,Fraction:i=>i.s>0n&&i.n>0n,Unit:e.referToSelf(i=>n=>e.find(i,n.valueType())(n.value)),"Array | Matrix":e.referToSelf(i=>n=>it(n,i))})});var Dk="isZero",yte=["typed","equalScalar"],Ek=N(Dk,yte,t=>{var{typed:e,equalScalar:r}=t;return e(Dk,{"number | BigNumber | Complex | Fraction":i=>r(i,0),bigint:i=>i===0n,Unit:e.referToSelf(i=>n=>e.find(i,n.valueType())(n.value)),"Array | Matrix":e.referToSelf(i=>n=>it(n,i))})});var Ak="isNaN",bte=["typed"],Tk=N(Ak,bte,t=>{var{typed:e}=t;return e(Ak,{number:PE,BigNumber:function(i){return i.isNaN()},bigint:function(i){return!1},Fraction:function(i){return!1},Complex:function(i){return i.isNaN()},Unit:function(i){return Number.isNaN(i.value)},"Array | Matrix":e.referToSelf(r=>i=>it(i,r))})});var Nk="typeOf",xte=["typed"],Mk=N(Nk,xte,t=>{var{typed:e}=t;return e(Nk,{any:ir})});function Ck(t,e,r,i){return jr(t.re,e.re,r,i)&&jr(t.im,e.im,r,i)}var sa=N("compareUnits",["typed"],t=>{var{typed:e}=t;return{"Unit, Unit":e.referToSelf(r=>(i,n)=>{if(!i.equalBase(n))throw new Error("Cannot compare units with different base");return e.find(r,[i.valueType(),n.valueType()])(i.value,n.value)})}});var py="equalScalar",_te=["typed","config"],$k=N(py,_te,t=>{var{typed:e,config:r}=t,i=sa({typed:e});return e(py,{"boolean, boolean":function(o,a){return o===a},"number, number":function(o,a){return jr(o,a,r.relTol,r.absTol)},"BigNumber, BigNumber":function(o,a){return o.eq(a)||xn(o,a,r.relTol,r.absTol)},"bigint, bigint":function(o,a){return o===a},"Fraction, Fraction":function(o,a){return o.equals(a)},"Complex, Complex":function(o,a){return Ck(o,a,r.relTol,r.absTol)}},i)}),kLe=N(py,["typed","config"],t=>{var{typed:e,config:r}=t;return e(py,{"number, number":function(n,o){return jr(n,o,r.relTol,r.absTol)}})});var wte="SparseMatrix",Ste=["typed","equalScalar","Matrix"],Ik=N(wte,Ste,t=>{var{typed:e,equalScalar:r,Matrix:i}=t;function n(h,v){if(!(this instanceof n))throw new SyntaxError("Constructor must be called with the new operator");if(v&&!Qr(v))throw new Error("Invalid datatype: "+v);if(Je(h))o(this,h,v);else if(h&&sr(h.index)&&sr(h.ptr)&&sr(h.size))this._values=h.values,this._index=h.index,this._ptr=h.ptr,this._size=h.size,this._datatype=v||h.datatype;else if(sr(h))a(this,h,v);else{if(h)throw new TypeError("Unsupported type of data ("+ir(h)+")");this._values=[],this._index=[],this._ptr=[0],this._size=[0,0],this._datatype=v}}function o(h,v,y){v.type==="SparseMatrix"?(h._values=v._values?dt(v._values):void 0,h._index=dt(v._index),h._ptr=dt(v._ptr),h._size=dt(v._size),h._datatype=y||v._datatype):a(h,v.valueOf(),y||v._datatype)}function a(h,v,y){h._values=[],h._index=[],h._ptr=[],h._datatype=y;var S=v.length,b=0,_=r,w=0;if(Qr(y)&&(_=e.find(r,[y,y])||r,w=e.convert(0,y)),S>0){var x=0;do{h._ptr.push(h._index.length);for(var E=0;E<S;E++){var T=v[E];if(sr(T)){if(x===0&&b<T.length&&(b=T.length),x<T.length){var D=T[x];_(D,w)||(h._values.push(D),h._index.push(E))}}else x===0&&b<1&&(b=1),_(T,w)||(h._values.push(T),h._index.push(E))}x++}while(x<b)}h._ptr.push(h._index.length),h._size=[S,b]}n.prototype=new i,n.prototype.createSparseMatrix=function(h,v){return new n(h,v)},Object.defineProperty(n,"name",{value:"SparseMatrix"}),n.prototype.constructor=n,n.prototype.type="SparseMatrix",n.prototype.isSparseMatrix=!0,n.prototype.getDataType=function(){return wl(this._values,ir)},n.prototype.storage=function(){return"sparse"},n.prototype.datatype=function(){return this._datatype},n.prototype.create=function(h,v){return new n(h,v)},n.prototype.density=function(){var h=this._size[0],v=this._size[1];return h!==0&&v!==0?this._index.length/(h*v):0},n.prototype.subset=function(h,v,y){if(!this._values)throw new Error("Cannot invoke subset on a Pattern only matrix");switch(arguments.length){case 1:return s(this,h);case 2:case 3:return l(this,h,v,y);default:throw new SyntaxError("Wrong number of arguments")}};function s(h,v){if(!Xa(v))throw new TypeError("Invalid index");var y=v.isScalar();if(y)return h.get(v.min());var S=v.size();if(S.length!==h._size.length)throw new $t(S.length,h._size.length);var b,_,w,x,E=v.min(),T=v.max();for(b=0,_=h._size.length;b<_;b++)Mr(E[b],h._size[b]),Mr(T[b],h._size[b]);var D=h._values,M=h._index,C=h._ptr,$=v.dimension(0),O=v.dimension(1),R=[],L=[];$.forEach(function(W,Q){L[W]=Q[0],R[W]=!0});var k=D?[]:void 0,V=[],J=[];return O.forEach(function(W){for(J.push(V.length),w=C[W],x=C[W+1];w<x;w++)b=M[w],R[b]===!0&&(V.push(L[b]),k&&k.push(D[w]))}),J.push(V.length),new n({values:k,index:V,ptr:J,size:S,datatype:h._datatype})}function l(h,v,y,S){if(!v||v.isIndex!==!0)throw new TypeError("Invalid index");var b=v.size(),_=v.isScalar(),w;if(Je(y)?(w=y.size(),y=y.toArray()):w=vt(y),_){if(w.length!==0)throw new TypeError("Scalar expected");h.set(v.min(),y,S)}else{if(b.length!==1&&b.length!==2)throw new $t(b.length,h._size.length,"<");if(w.length<b.length){for(var x=0,E=0;b[x]===1&&w[x]===1;)x++;for(;b[x]===1;)E++,x++;y=ry(y,b.length,E,w)}if(!lo(b,w))throw new $t(b,w,">");if(b.length===1){var T=v.dimension(0);T.forEach(function(C,$){Mr(C),h.set([C,0],y[$[0]],S)})}else{var D=v.dimension(0),M=v.dimension(1);D.forEach(function(C,$){Mr(C),M.forEach(function(O,R){Mr(O),h.set([C,O],y[$[0]][R[0]],S)})})}}return h}n.prototype.get=function(h){if(!sr(h))throw new TypeError("Array expected");if(h.length!==this._size.length)throw new $t(h.length,this._size.length);if(!this._values)throw new Error("Cannot invoke get on a Pattern only matrix");var v=h[0],y=h[1];Mr(v,this._size[0]),Mr(y,this._size[1]);var S=u(v,this._ptr[y],this._ptr[y+1],this._index);return S<this._ptr[y+1]&&this._index[S]===v?this._values[S]:0},n.prototype.set=function(h,v,y){if(!sr(h))throw new TypeError("Array expected");if(h.length!==this._size.length)throw new $t(h.length,this._size.length);if(!this._values)throw new Error("Cannot invoke set on a Pattern only matrix");var S=h[0],b=h[1],_=this._size[0],w=this._size[1],x=r,E=0;Qr(this._datatype)&&(x=e.find(r,[this._datatype,this._datatype])||r,E=e.convert(0,this._datatype)),(S>_-1||b>w-1)&&(m(this,Math.max(S+1,_),Math.max(b+1,w),y),_=this._size[0],w=this._size[1]),Mr(S,_),Mr(b,w);var T=u(S,this._ptr[b],this._ptr[b+1],this._index);return T<this._ptr[b+1]&&this._index[T]===S?x(v,E)?c(T,b,this._values,this._index,this._ptr):this._values[T]=v:x(v,E)||f(T,S,b,v,this._values,this._index,this._ptr),this};function u(h,v,y,S){if(y-v===0)return y;for(var b=v;b<y;b++)if(S[b]===h)return b;return v}function c(h,v,y,S,b){y.splice(h,1),S.splice(h,1);for(var _=v+1;_<b.length;_++)b[_]--}function f(h,v,y,S,b,_,w){b.splice(h,0,S),_.splice(h,0,v);for(var x=y+1;x<w.length;x++)w[x]++}n.prototype.resize=function(h,v,y){if(!un(h))throw new TypeError("Array or Matrix expected");var S=h.valueOf().map(_=>Array.isArray(_)&&_.length===1?_[0]:_);if(S.length!==2)throw new Error("Only two dimensions matrix are supported");S.forEach(function(_){if(!Et(_)||!Ge(_)||_<0)throw new TypeError("Invalid size, must contain positive integers (size: "+Ct(S)+")")});var b=y?this.clone():this;return m(b,S[0],S[1],v)};function m(h,v,y,S){var b=S||0,_=r,w=0;Qr(h._datatype)&&(_=e.find(r,[h._datatype,h._datatype])||r,w=e.convert(0,h._datatype),b=e.convert(b,h._datatype));var x=!_(b,w),E=h._size[0],T=h._size[1],D,M,C;if(y>T){for(M=T;M<y;M++)if(h._ptr[M]=h._values.length,x)for(D=0;D<E;D++)h._values.push(b),h._index.push(D);h._ptr[y]=h._values.length}else y<T&&(h._ptr.splice(y+1,T-y),h._values.splice(h._ptr[y],h._values.length),h._index.splice(h._ptr[y],h._index.length));if(T=y,v>E){if(x){var $=0;for(M=0;M<T;M++){h._ptr[M]=h._ptr[M]+$,C=h._ptr[M+1]+$;var O=0;for(D=E;D<v;D++,O++)h._values.splice(C+O,0,b),h._index.splice(C+O,0,D),$++}h._ptr[T]=h._values.length}}else if(v<E){var R=0;for(M=0;M<T;M++){h._ptr[M]=h._ptr[M]-R;var L=h._ptr[M],k=h._ptr[M+1]-R;for(C=L;C<k;C++)D=h._index[C],D>v-1&&(h._values.splice(C,1),h._index.splice(C,1),R++)}h._ptr[M]=h._values.length}return h._size[0]=v,h._size[1]=y,h}n.prototype.reshape=function(h,v){if(!sr(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(W){if(!Et(W)||!Ge(W)||W<=-2||W===0)throw new TypeError("Invalid size, must contain positive integers or -1 (size: "+Ct(h)+")")});var y=this._size[0]*this._size[1];h=em(h,y);var S=h[0]*h[1];if(y!==S)throw new Error("Reshaping sparse matrix will result in the wrong number of elements");var b=v?this.clone():this;if(this._size[0]===h[0]&&this._size[1]===h[1])return b;for(var _=[],w=0;w<b._ptr.length;w++)for(var x=0;x<b._ptr[w+1]-b._ptr[w];x++)_.push(w);for(var E=b._values.slice(),T=b._index.slice(),D=0;D<b._index.length;D++){var M=T[D],C=_[D],$=M*b._size[1]+C;_[D]=$%h[1],T[D]=Math.floor($/h[1])}b._values.length=0,b._index.length=0,b._ptr.length=h[1]+1,b._size=h.slice();for(var O=0;O<b._ptr.length;O++)b._ptr[O]=0;for(var R=0;R<E.length;R++){var L=T[R],k=_[R],V=E[R],J=u(L,b._ptr[k],b._ptr[k+1],b._index);f(J,L,k,V,b._values,b._index,b._ptr)}return b},n.prototype.clone=function(){var h=new n({values:this._values?dt(this._values):void 0,index:dt(this._index),ptr:dt(this._ptr),size:dt(this._size),datatype:this._datatype});return h},n.prototype.size=function(){return this._size.slice(0)},n.prototype.map=function(h,v){if(!this._values)throw new Error("Cannot invoke map on a Pattern only matrix");var y=this,S=this._size[0],b=this._size[1],_=oa(h,y,"map"),w=function(E,T,D){return _.fn(E,[T,D],y)};return p(this,0,S-1,0,b-1,w,v)};function p(h,v,y,S,b,_,w){var x=[],E=[],T=[],D=r,M=0;Qr(h._datatype)&&(D=e.find(r,[h._datatype,h._datatype])||r,M=e.convert(0,h._datatype));for(var C=function(Z,q,xe){var de=_(Z,q,xe);D(de,M)||(x.push(de),E.push(q))},$=S;$<=b;$++){T.push(x.length);var O=h._ptr[$],R=h._ptr[$+1];if(w)for(var L=O;L<R;L++){var k=h._index[L];k>=v&&k<=y&&C(h._values[L],k-v,$-S)}else{for(var V={},J=O;J<R;J++){var W=h._index[J];V[W]=h._values[J]}for(var Q=v;Q<=y;Q++){var ie=Q in V?V[Q]:0;C(ie,Q-v,$-S)}}}return T.push(x.length),new n({values:x,index:E,ptr:T,size:[y-v+1,b-S+1]})}n.prototype.forEach=function(h,v){if(!this._values)throw new Error("Cannot invoke forEach on a Pattern only matrix");for(var y=this,S=this._size[0],b=this._size[1],_=oa(h,y,"forEach"),w=0;w<b;w++){var x=this._ptr[w],E=this._ptr[w+1];if(v)for(var T=x;T<E;T++){var D=this._index[T];_.fn(this._values[T],[D,w],y)}else{for(var M={},C=x;C<E;C++){var $=this._index[C];M[$]=this._values[C]}for(var O=0;O<S;O++){var R=O in M?M[O]:0;_.fn(R,[O,w],y)}}}},n.prototype[Symbol.iterator]=function*(){if(!this._values)throw new Error("Cannot iterate a Pattern only matrix");for(var h=this._size[1],v=0;v<h;v++)for(var y=this._ptr[v],S=this._ptr[v+1],b=y;b<S;b++){var _=this._index[b];yield{value:this._values[b],index:[_,v]}}},n.prototype.toArray=function(){return d(this._values,this._index,this._ptr,this._size,!0)},n.prototype.valueOf=function(){return d(this._values,this._index,this._ptr,this._size,!1)};function d(h,v,y,S,b){var _=S[0],w=S[1],x=[],E,T;for(E=0;E<_;E++)for(x[E]=[],T=0;T<w;T++)x[E][T]=0;for(T=0;T<w;T++)for(var D=y[T],M=y[T+1],C=D;C<M;C++)E=v[C],x[E][T]=h?b?dt(h[C]):h[C]:1;return x}return n.prototype.format=function(h){for(var v=this._size[0],y=this._size[1],S=this.density(),b="Sparse Matrix ["+Ct(v,h)+" x "+Ct(y,h)+"] density: "+Ct(S,h)+`
`,_=0;_<y;_++)for(var w=this._ptr[_],x=this._ptr[_+1],E=w;E<x;E++){var T=this._index[E];b+=`
(`+Ct(T,h)+", "+Ct(_,h)+") ==> "+(this._values?Ct(this._values[E],h):"X")}return b},n.prototype.toString=function(){return Ct(this.toArray())},n.prototype.toJSON=function(){return{mathjs:"SparseMatrix",values:this._values,index:this._index,ptr:this._ptr,size:this._size,datatype:this._datatype}},n.prototype.diagonal=function(h){if(h){if(mt(h)&&(h=h.toNumber()),!Et(h)||!Ge(h))throw new TypeError("The parameter k must be an integer number")}else h=0;var v=h>0?h:0,y=h<0?-h:0,S=this._size[0],b=this._size[1],_=Math.min(S-y,b-v),w=[],x=[],E=[];E[0]=0;for(var T=v;T<b&&w.length<_;T++)for(var D=this._ptr[T],M=this._ptr[T+1],C=D;C<M;C++){var $=this._index[C];if($===T-v+y){w.push(this._values[C]),x[w.length-1]=$-y;break}}return E.push(w.length),new n({values:w,index:x,ptr:E,size:[_,1]})},n.fromJSON=function(h){return new n(h)},n.diagonal=function(h,v,y,S,b){if(!sr(h))throw new TypeError("Array expected, size parameter");if(h.length!==2)throw new Error("Only two dimensions matrix are supported");if(h=h.map(function(W){if(mt(W)&&(W=W.toNumber()),!Et(W)||!Ge(W)||W<1)throw new Error("Size values must be positive integers");return W}),y){if(mt(y)&&(y=y.toNumber()),!Et(y)||!Ge(y))throw new TypeError("The parameter k must be an integer number")}else y=0;var _=r,w=0;Qr(b)&&(_=e.find(r,[b,b])||r,w=e.convert(0,b));var x=y>0?y:0,E=y<0?-y:0,T=h[0],D=h[1],M=Math.min(T-E,D-x),C;if(sr(v)){if(v.length!==M)throw new Error("Invalid value array length");C=function(Q){return v[Q]}}else if(Je(v)){var $=v.size();if($.length!==1||$[0]!==M)throw new Error("Invalid matrix length");C=function(Q){return v.get([Q])}}else C=function(){return v};for(var O=[],R=[],L=[],k=0;k<D;k++){L.push(O.length);var V=k-x;if(V>=0&&V<M){var J=C(V);_(J,w)||(R.push(V+E),O.push(J))}}return L.push(O.length),new n({values:O,index:R,ptr:L,size:[T,D]})},n.prototype.swapRows=function(h,v){if(!Et(h)||!Ge(h)||!Et(v)||!Ge(v))throw new Error("Row index must be positive integers");if(this._size.length!==2)throw new Error("Only two dimensional matrix is supported");return Mr(h,this._size[0]),Mr(v,this._size[0]),n._swapRows(h,v,this._size[1],this._values,this._index,this._ptr),this},n._forEachRow=function(h,v,y,S,b){for(var _=S[h],w=S[h+1],x=_;x<w;x++)b(y[x],v[x])},n._swapRows=function(h,v,y,S,b,_){for(var w=0;w<y;w++){var x=_[w],E=_[w+1],T=u(h,x,E,b),D=u(v,x,E,b);if(T<E&&D<E&&b[T]===h&&b[D]===v){if(S){var M=S[T];S[T]=S[D],S[D]=M}continue}if(T<E&&b[T]===h&&(D>=E||b[D]!==v)){var C=S?S[T]:void 0;b.splice(D,0,v),S&&S.splice(D,0,C),b.splice(D<=T?T+1:T,1),S&&S.splice(D<=T?T+1:T,1);continue}if(D<E&&b[D]===v&&(T>=E||b[T]!==h)){var $=S?S[D]:void 0;b.splice(T,0,h),S&&S.splice(T,0,$),b.splice(T<=D?D+1:D,1),S&&S.splice(T<=D?D+1:D,1)}}},n},{isClass:!0});var Dte="number",Ete=["typed"];function Ate(t){var e=t.match(/(0[box])([0-9a-fA-F]*)\.([0-9a-fA-F]*)/);if(e){var r={"0b":2,"0o":8,"0x":16}[e[1]],i=e[2],n=e[3];return{input:t,radix:r,integerPart:i,fractionalPart:n}}else return null}function Tte(t){for(var e=parseInt(t.integerPart,t.radix),r=0,i=0;i<t.fractionalPart.length;i++){var n=parseInt(t.fractionalPart[i],t.radix);r+=n/Math.pow(t.radix,i+1)}var o=e+r;if(isNaN(o))throw new SyntaxError('String "'+t.input+'" is not a valid number');return o}var Fk=N(Dte,Ete,t=>{var{typed:e}=t,r=e("number",{"":function(){return 0},number:function(n){return n},string:function(n){if(n==="NaN")return NaN;var o=Ate(n);if(o)return Tte(o);var a=0,s=n.match(/(0[box][0-9a-fA-F]*)i([0-9]*)/);s&&(a=Number(s[2]),n=s[1]);var l=Number(n);if(isNaN(l))throw new SyntaxError('String "'+n+'" is not a valid number');if(s){if(l>2**a-1)throw new SyntaxError('String "'.concat(n,'" is out of range'));l>=2**(a-1)&&(l=l-2**a)}return l},BigNumber:function(n){return n.toNumber()},bigint:function(n){return Number(n)},Fraction:function(n){return n.valueOf()},Unit:e.referToSelf(i=>n=>{var o=n.clone();return o.value=i(n.value),o}),null:function(n){return 0},"Unit, string | Unit":function(n,o){return n.toNumber(o)},"Array | Matrix":e.referToSelf(i=>n=>it(n,i))});return r.fromJSON=function(i){return parseFloat(i.value)},r});var Nte="bigint",Mte=["typed"],kk=N(Nte,Mte,t=>{var{typed:e}=t,r=e("bigint",{"":function(){return 0n},bigint:function(n){return n},number:function(n){return BigInt(n.toFixed())},BigNumber:function(n){return BigInt(n.round().toString())},Fraction:function(n){return BigInt(n.valueOf().toFixed())},"string | boolean":function(n){return BigInt(n)},null:function(n){return 0n},"Array | Matrix":e.referToSelf(i=>n=>it(n,i))});return r.fromJSON=function(i){return BigInt(i.value)},r});var Pk="string",Cte=["typed"],Bk=N(Pk,Cte,t=>{var{typed:e}=t;return e(Pk,{"":function(){return""},number:Da,null:function(i){return"null"},boolean:function(i){return i+""},string:function(i){return i},"Array | Matrix":e.referToSelf(r=>i=>it(i,r)),any:function(i){return String(i)}})});var Ok="boolean",$te=["typed"],Rk=N(Ok,$te,t=>{var{typed:e}=t;return e(Ok,{"":function(){return!1},boolean:function(i){return i},number:function(i){return!!i},null:function(i){return!1},BigNumber:function(i){return!i.isZero()},string:function(i){var n=i.toLowerCase();if(n==="true")return!0;if(n==="false")return!1;var o=Number(i);if(i!==""&&!isNaN(o))return!!o;throw new Error('Cannot convert "'+i+'" to a boolean')},"Array | Matrix":e.referToSelf(r=>i=>it(i,r))})});var Ite="bignumber",Fte=["typed","BigNumber"],Lk=N(Ite,Fte,t=>{var{typed:e,BigNumber:r}=t;return e("bignumber",{"":function(){return new r(0)},number:function(n){return new r(n+"")},string:function(n){var o=n.match(/(0[box][0-9a-fA-F]*)i([0-9]*)/);if(o){var a=o[2],s=r(o[1]),l=new r(2).pow(Number(a));if(s.gt(l.sub(1)))throw new SyntaxError('String "'.concat(n,'" is out of range'));var u=new r(2).pow(Number(a)-1);return s.gte(u)?s.sub(l):s}return new r(n)},BigNumber:function(n){return n},bigint:function(n){return new r(n.toString())},Unit:e.referToSelf(i=>n=>{var o=n.clone();return o.value=i(n.value),o}),Fraction:function(n){return new r(String(n.n)).div(String(n.d)).times(String(n.s))},null:function(n){return new r(0)},"Array | Matrix":e.referToSelf(i=>n=>it(n,i))})});var kte="complex",Pte=["typed","Complex"],Uk=N(kte,Pte,t=>{var{typed:e,Complex:r}=t;return e("complex",{"":function(){return r.ZERO},number:function(n){return new r(n,0)},"number, number":function(n,o){return new r(n,o)},"BigNumber, BigNumber":function(n,o){return new r(n.toNumber(),o.toNumber())},Fraction:function(n){return new r(n.valueOf(),0)},Complex:function(n){return n.clone()},string:function(n){return r(n)},null:function(n){return r(0)},Object:function(n){if("re"in n&&"im"in n)return new r(n.re,n.im);if("r"in n&&"phi"in n||"abs"in n&&"arg"in n)return new r(n);throw new Error("Expected object with properties (re and im) or (r and phi) or (abs and arg)")},"Array | Matrix":e.referToSelf(i=>n=>it(n,i))})});var Bte="fraction",Ote=["typed","Fraction"],zk=N(Bte,Ote,t=>{var{typed:e,Fraction:r}=t;return e("fraction",{number:function(n){if(!isFinite(n)||isNaN(n))throw new Error(n+" cannot be represented as a fraction");return new r(n)},string:function(n){return new r(n)},"number, number":function(n,o){return new r(n,o)},"bigint, bigint":function(n,o){return new r(n,o)},null:function(n){return new r(0)},BigNumber:function(n){return new r(n.toString())},bigint:function(n){return new r(n.toString())},Fraction:function(n){return n},Unit:e.referToSelf(i=>n=>{var o=n.clone();return o.value=i(n.value),o}),Object:function(n){return new r(n)},"Array | Matrix":e.referToSelf(i=>n=>it(n,i))})});var Vk="matrix",Rte=["typed","Matrix","DenseMatrix","SparseMatrix"],qk=N(Vk,Rte,t=>{var{typed:e,Matrix:r,DenseMatrix:i,SparseMatrix:n}=t;return e(Vk,{"":function(){return o([])},string:function(s){return o([],s)},"string, string":function(s,l){return o([],s,l)},Array:function(s){return o(s)},Matrix:function(s){return o(s,s.storage())},"Array | Matrix, string":o,"Array | Matrix, string, string":o});function o(a,s,l){if(s==="dense"||s==="default"||s===void 0)return new i(a,l);if(s==="sparse")return new n(a,l);throw new TypeError("Unknown matrix type "+JSON.stringify(s)+".")}});var jk="matrixFromFunction",Lte=["typed","matrix","isZero"],Zk=N(jk,Lte,t=>{var{typed:e,matrix:r,isZero:i}=t;return e(jk,{"Array | Matrix, function, string, string":function(a,s,l,u){return n(a,s,l,u)},"Array | Matrix, function, string":function(a,s,l){return n(a,s,l)},"Matrix, function":function(a,s){return n(a,s,"dense")},"Array, function":function(a,s){return n(a,s,"dense").toArray()},"Array | Matrix, string, function":function(a,s,l){return n(a,l,s)},"Array | Matrix, string, string, function":function(a,s,l,u){return n(a,u,s,l)}});function n(o,a,s,l){var u;return l!==void 0?u=r(s,l):u=r(s),u.resize(o),u.forEach(function(c,f){var m=a(f);i(m)||u.set(f,m)}),u}});var Gk="matrixFromRows",Ute=["typed","matrix","flatten","size"],Wk=N(Gk,Ute,t=>{var{typed:e,matrix:r,flatten:i,size:n}=t;return e(Gk,{"...Array":function(l){return o(l)},"...Matrix":function(l){return r(o(l.map(u=>u.toArray())))}});function o(s){if(s.length===0)throw new TypeError("At least one row is needed to construct a matrix.");var l=a(s[0]),u=[];for(var c of s){var f=a(c);if(f!==l)throw new TypeError("The vectors had different length: "+(l|0)+" \u2260 "+(f|0));u.push(i(c))}return u}function a(s){var l=n(s);if(l.length===1)return l[0];if(l.length===2){if(l[0]===1)return l[1];if(l[1]===1)return l[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.")}});var Hk="matrixFromColumns",zte=["typed","matrix","flatten","size"],Yk=N(Hk,zte,t=>{var{typed:e,matrix:r,flatten:i,size:n}=t;return e(Hk,{"...Array":function(l){return o(l)},"...Matrix":function(l){return r(o(l.map(u=>u.toArray())))}});function o(s){if(s.length===0)throw new TypeError("At least one column is needed to construct a matrix.");for(var l=a(s[0]),u=[],c=0;c<l;c++)u[c]=[];for(var f of s){var m=a(f);if(m!==l)throw new TypeError("The vectors had different length: "+(l|0)+" \u2260 "+(m|0));for(var p=i(f),d=0;d<l;d++)u[d].push(p[d])}return u}function a(s){var l=n(s);if(l.length===1)return l[0];if(l.length===2){if(l[0]===1)return l[1];if(l[1]===1)return l[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.")}});var Jk="splitUnit",Vte=["typed"],Xk=N(Jk,Vte,t=>{var{typed:e}=t;return e(Jk,{"Unit, Array":function(i,n){return i.splitUnit(n)}})});var Kk="unaryMinus",qte=["typed"],Qk=N(Kk,qte,t=>{var{typed:e}=t;return e(Kk,{number:HD,"Complex | BigNumber | Fraction":r=>r.neg(),bigint:r=>-r,Unit:e.referToSelf(r=>i=>{var n=i.clone();return n.value=e.find(r,n.valueType())(i.value),n}),"Array | Matrix":e.referToSelf(r=>i=>it(i,r,!0))})});var eP="unaryPlus",jte=["typed","config","numeric"],tP=N(eP,jte,t=>{var{typed:e,config:r,numeric:i}=t;return e(eP,{number:YD,Complex:function(o){return o},BigNumber:function(o){return o},bigint:function(o){return o},Fraction:function(o){return o},Unit:function(o){return o.clone()},"Array | Matrix":e.referToSelf(n=>o=>it(o,n,!0)),boolean:function(o){return i(o?1:0,r.number)},string:function(o){return i(o,Mi(o,r))}})});var rP="abs",Zte=["typed"],nP=N(rP,Zte,t=>{var{typed:e}=t;return e(rP,{number:jD,"Complex | BigNumber | Fraction | Unit":r=>r.abs(),bigint:r=>r<0n?-r:r,"Array | Matrix":e.referToSelf(r=>i=>it(i,r,!0))})});var iP="mapSlices",Gte=["typed","isInteger"],sm=N(iP,Gte,t=>{var{typed:e,isInteger:r}=t;return e(iP,{"Array | Matrix, number | BigNumber, function":function(n,o,a){if(!r(o))throw new TypeError("Integer number expected for dimension");var s=Array.isArray(n)?vt(n):n.size();if(o<0||o>=s.length)throw new ii(o,s.length);return Je(n)?n.create(my(n.valueOf(),o,a),n.datatype()):my(n,o,a)}})},{formerly:"apply"});function my(t,e,r){var i,n,o;if(e<=0)if(Array.isArray(t[0])){for(o=Wte(t),n=[],i=0;i<o.length;i++)n[i]=my(o[i],e-1,r);return n}else return r(t);else{for(n=[],i=0;i<t.length;i++)n[i]=my(t[i],e-1,r);return n}}function Wte(t){var e=t.length,r=t[0].length,i,n,o=[];for(n=0;n<r;n++){var a=[];for(i=0;i<e;i++)a.push(t[i][n]);o.push(a)}return o}var oP="addScalar",Hte=["typed"],aP=N(oP,Hte,t=>{var{typed:e}=t;return e(oP,{"number, number":ZD,"Complex, Complex":function(i,n){return i.add(n)},"BigNumber, BigNumber":function(i,n){return i.plus(n)},"bigint, bigint":function(i,n){return i+n},"Fraction, Fraction":function(i,n){return i.add(n)},"Unit, Unit":e.referToSelf(r=>(i,n)=>{if(i.value===null||i.value===void 0)throw new Error("Parameter x contains a unit with undefined value");if(n.value===null||n.value===void 0)throw new Error("Parameter y contains a unit with undefined value");if(!i.equalBase(n))throw new Error("Units do not match");var o=i.clone();return o.value=e.find(r,[o.valueType(),n.valueType()])(o.value,n.value),o.fixPrefix=!1,o})})});var sP="subtractScalar",Yte=["typed"],uP=N(sP,Yte,t=>{var{typed:e}=t;return e(sP,{"number, number":GD,"Complex, Complex":function(i,n){return i.sub(n)},"BigNumber, BigNumber":function(i,n){return i.minus(n)},"bigint, bigint":function(i,n){return i-n},"Fraction, Fraction":function(i,n){return i.sub(n)},"Unit, Unit":e.referToSelf(r=>(i,n)=>{if(i.value===null||i.value===void 0)throw new Error("Parameter x contains a unit with undefined value");if(n.value===null||n.value===void 0)throw new Error("Parameter y contains a unit with undefined value");if(!i.equalBase(n))throw new Error("Units do not match");var o=i.clone();return o.value=e.find(r,[o.valueType(),n.valueType()])(o.value,n.value),o.fixPrefix=!1,o})})});var lP="cbrt",Jte=["config","typed","isNegative","unaryMinus","matrix","Complex","BigNumber","Fraction"],cP=N(lP,Jte,t=>{var{config:e,typed:r,isNegative:i,unaryMinus:n,matrix:o,Complex:a,BigNumber:s,Fraction:l}=t;return r(lP,{number:Hc,Complex:u,"Complex, boolean":u,BigNumber:function(m){return m.cbrt()},Unit:c});function u(f,m){var p=f.arg()/3,d=f.abs(),h=new a(Hc(d),0).mul(new a(0,p).exp());if(m){var v=[h,new a(Hc(d),0).mul(new a(0,p+Math.PI*2/3).exp()),new a(Hc(d),0).mul(new a(0,p-Math.PI*2/3).exp())];return e.matrix==="Array"?v:o(v)}else return h}function c(f){if(f.value&&Qn(f.value)){var m=f.clone();return m.value=1,m=m.pow(1/3),m.value=u(f.value),m}else{var p=i(f.value);p&&(f.value=n(f.value));var d;mt(f.value)?d=new s(1).div(3):Io(f.value)?d=new l(1,3):d=1/3;var h=f.pow(d);return p&&(h.value=n(h.value)),h}}});var Xte="matAlgo11xS0s",Kte=["typed","equalScalar"],Er=N(Xte,Kte,t=>{var{typed:e,equalScalar:r}=t;return function(n,o,a,s){var l=n._values,u=n._index,c=n._ptr,f=n._size,m=n._datatype;if(!l)throw new Error("Cannot perform operation on Pattern Sparse Matrix and Scalar value");var p=f[0],d=f[1],h,v=r,y=0,S=a;typeof m=="string"&&(h=m,v=e.find(r,[h,h]),y=e.convert(0,h),o=e.convert(o,h),S=e.find(a,[h,h]));for(var b=[],_=[],w=[],x=0;x<d;x++){w[x]=_.length;for(var E=c[x],T=c[x+1],D=E;D<T;D++){var M=u[D],C=s?S(o,l[D]):S(l[D],o);v(C,y)||(_.push(M),b.push(C))}}return w[d]=_.length,n.createSparseMatrix({values:b,index:_,ptr:w,size:[p,d],datatype:h})}});var Qte="matAlgo12xSfs",ere=["typed","DenseMatrix"],mr=N(Qte,ere,t=>{var{typed:e,DenseMatrix:r}=t;return function(n,o,a,s){var l=n._values,u=n._index,c=n._ptr,f=n._size,m=n._datatype;if(!l)throw new Error("Cannot perform operation on Pattern Sparse Matrix and Scalar value");var p=f[0],d=f[1],h,v=a;typeof m=="string"&&(h=m,o=e.convert(o,h),v=e.find(a,[h,h]));for(var y=[],S=[],b=[],_=0;_<d;_++){for(var w=_+1,x=c[_],E=c[_+1],T=x;T<E;T++){var D=u[T];S[D]=l[T],b[D]=w}for(var M=0;M<p;M++)_===0&&(y[M]=[]),b[M]===w?y[M][_]=s?v(o,S[M]):v(S[M],o):y[M][_]=s?v(o,0):v(0,o)}return new r({data:y,size:[p,d],datatype:h})}});var tre="matAlgo14xDs",rre=["typed"],An=N(tre,rre,t=>{var{typed:e}=t;return function(n,o,a,s){var l=n._data,u=n._size,c=n._datatype,f,m=a;typeof c=="string"&&(f=c,o=e.convert(o,f),m=e.find(a,[f,f]));var p=u.length>0?r(m,0,u,u[0],l,o,s):[];return n.createDenseMatrix({data:p,size:dt(u),datatype:f})};function r(i,n,o,a,s,l,u){var c=[];if(n===o.length-1)for(var f=0;f<a;f++)c[f]=u?i(l,s[f]):i(s[f],l);else for(var m=0;m<a;m++)c[m]=r(i,n+1,o,o[n+1],s[m],l,u);return c}});var BE="ceil",nre=["typed","config","round","matrix","equalScalar","zeros","DenseMatrix"],ire=new vl(10),ore=N(BE,["typed","config","round"],t=>{var{typed:e,config:r,round:i}=t;function n(o){var a=Math.ceil(o),s=i(o);return a===s?a:jr(o,s,r.relTol,r.absTol)&&!jr(o,a,r.relTol,r.absTol)?s:a}return e(BE,{number:n,"number, number":function(a,s){if(!Ge(s))throw new RangeError("number of decimals in function ceil must be an integer");if(s<0||s>15)throw new RangeError("number of decimals in ceil number must be in range 0-15");var l=10**s;return n(a*l)/l}})}),fP=N(BE,nre,t=>{var{typed:e,config:r,round:i,matrix:n,equalScalar:o,zeros:a,DenseMatrix:s}=t,l=Er({typed:e,equalScalar:o}),u=mr({typed:e,DenseMatrix:s}),c=An({typed:e}),f=ore({typed:e,config:r,round:i});function m(p){var d=(y,S)=>xn(y,S,r.relTol,r.absTol),h=p.ceil(),v=i(p);return h.eq(v)?h:d(p,v)&&!d(p,h)?v:h}return e("ceil",{number:f.signatures.number,"number,number":f.signatures["number,number"],Complex:function(d){return d.ceil()},"Complex, number":function(d,h){return d.ceil(h)},"Complex, BigNumber":function(d,h){return d.ceil(h.toNumber())},BigNumber:m,"BigNumber, BigNumber":function(d,h){var v=ire.pow(h);return m(d.mul(v)).div(v)},bigint:p=>p,"bigint, number":(p,d)=>p,"bigint, BigNumber":(p,d)=>p,Fraction:function(d){return d.ceil()},"Fraction, number":function(d,h){return d.ceil(h)},"Fraction, BigNumber":function(d,h){return d.ceil(h.toNumber())},"Unit, number, Unit":e.referToSelf(p=>function(d,h,v){var y=d.toNumeric(v);return v.multiply(p(y,h))}),"Unit, BigNumber, Unit":e.referToSelf(p=>(d,h,v)=>p(d,h.toNumber(),v)),"Array | Matrix, number | BigNumber, Unit":e.referToSelf(p=>(d,h,v)=>it(d,y=>p(y,h,v),!0)),"Array | Matrix | Unit, Unit":e.referToSelf(p=>(d,h)=>p(d,0,h)),"Array | Matrix":e.referToSelf(p=>d=>it(d,p,!0)),"Array, number | BigNumber":e.referToSelf(p=>(d,h)=>it(d,v=>p(v,h),!0)),"SparseMatrix, number | BigNumber":e.referToSelf(p=>(d,h)=>l(d,h,p,!1)),"DenseMatrix, number | BigNumber":e.referToSelf(p=>(d,h)=>c(d,h,p,!1)),"number | Complex | Fraction | BigNumber, Array":e.referToSelf(p=>(d,h)=>c(n(h),d,p,!0).valueOf()),"number | Complex | Fraction | BigNumber, Matrix":e.referToSelf(p=>(d,h)=>o(d,0)?a(h.size(),h.storage()):h.storage()==="dense"?c(h,d,p,!0):u(h,d,p,!0))})});var pP="cube",are=["typed"],mP=N(pP,are,t=>{var{typed:e}=t;return e(pP,{number:JD,Complex:function(i){return i.mul(i).mul(i)},BigNumber:function(i){return i.times(i).times(i)},bigint:function(i){return i*i*i},Fraction:function(i){return i.pow(3)},Unit:function(i){return i.pow(3)}})});var dP="exp",sre=["typed"],hP=N(dP,sre,t=>{var{typed:e}=t;return e(dP,{number:XD,Complex:function(i){return i.exp()},BigNumber:function(i){return i.exp()}})});var gP="expm1",ure=["typed","Complex"],vP=N(gP,ure,t=>{var{typed:e,Complex:r}=t;return e(gP,{number:KD,Complex:function(n){var o=Math.exp(n.re);return new r(o*Math.cos(n.im)-1,o*Math.sin(n.im))},BigNumber:function(n){return n.exp().minus(1)}})});var OE="fix",lre=["typed","Complex","matrix","ceil","floor","equalScalar","zeros","DenseMatrix"],cre=N(OE,["typed","ceil","floor"],t=>{var{typed:e,ceil:r,floor:i}=t;return e(OE,{number:function(o){return o>0?i(o):r(o)},"number, number":function(o,a){return o>0?i(o,a):r(o,a)}})}),yP=N(OE,lre,t=>{var{typed:e,Complex:r,matrix:i,ceil:n,floor:o,equalScalar:a,zeros:s,DenseMatrix:l}=t,u=mr({typed:e,DenseMatrix:l}),c=An({typed:e}),f=cre({typed:e,ceil:n,floor:o});return e("fix",{number:f.signatures.number,"number, number | BigNumber":f.signatures["number,number"],Complex:function(p){return new r(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,d){return new r(p.re>0?o(p.re,d):n(p.re,d),p.im>0?o(p.im,d):n(p.im,d))},"Complex, BigNumber":function(p,d){var h=d.toNumber();return new r(p.re>0?o(p.re,h):n(p.re,h),p.im>0?o(p.im,h):n(p.im,h))},BigNumber:function(p){return p.isNegative()?n(p):o(p)},"BigNumber, number | BigNumber":function(p,d){return p.isNegative()?n(p,d):o(p,d)},bigint:m=>m,"bigint, number":(m,p)=>m,"bigint, BigNumber":(m,p)=>m,Fraction:function(p){return p.s<0n?p.ceil():p.floor()},"Fraction, number | BigNumber":function(p,d){return p.s<0n?n(p,d):o(p,d)},"Unit, number, Unit":e.referToSelf(m=>function(p,d,h){var v=p.toNumeric(h);return h.multiply(m(v,d))}),"Unit, BigNumber, Unit":e.referToSelf(m=>(p,d,h)=>m(p,d.toNumber(),h)),"Array | Matrix, number | BigNumber, Unit":e.referToSelf(m=>(p,d,h)=>it(p,v=>m(v,d,h),!0)),"Array | Matrix | Unit, Unit":e.referToSelf(m=>(p,d)=>m(p,0,d)),"Array | Matrix":e.referToSelf(m=>p=>it(p,m,!0)),"Array | Matrix, number | BigNumber":e.referToSelf(m=>(p,d)=>it(p,h=>m(h,d),!0)),"number | Complex | Fraction | BigNumber, Array":e.referToSelf(m=>(p,d)=>c(i(d),p,m,!0).valueOf()),"number | Complex | Fraction | BigNumber, Matrix":e.referToSelf(m=>(p,d)=>a(p,0)?s(d.size(),d.storage()):d.storage()==="dense"?c(d,p,m,!0):u(d,p,m,!0))})});var RE="floor",fre=["typed","config","round","matrix","equalScalar","zeros","DenseMatrix"],pre=new vl(10),mre=N(RE,["typed","config","round"],t=>{var{typed:e,config:r,round:i}=t;function n(o){var a=Math.floor(o),s=i(o);return a===s?a:jr(o,s,r.relTol,r.absTol)&&!jr(o,a,r.relTol,r.absTol)?s:a}return e(RE,{number:n,"number, number":function(a,s){if(!Ge(s))throw new RangeError("number of decimals in function floor must be an integer");if(s<0||s>15)throw new RangeError("number of decimals in floor number must be in range 0 - 15");var l=10**s;return n(a*l)/l}})}),dy=N(RE,fre,t=>{var{typed:e,config:r,round:i,matrix:n,equalScalar:o,zeros:a,DenseMatrix:s}=t,l=Er({typed:e,equalScalar:o}),u=mr({typed:e,DenseMatrix:s}),c=An({typed:e}),f=mre({typed:e,config:r,round:i});function m(p){var d=(y,S)=>xn(y,S,r.relTol,r.absTol),h=p.floor(),v=i(p);return h.eq(v)?h:d(p,v)&&!d(p,h)?v:h}return e("floor",{number:f.signatures.number,"number,number":f.signatures["number,number"],Complex:function(d){return d.floor()},"Complex, number":function(d,h){return d.floor(h)},"Complex, BigNumber":function(d,h){return d.floor(h.toNumber())},BigNumber:m,"BigNumber, BigNumber":function(d,h){var v=pre.pow(h);return m(d.mul(v)).div(v)},bigint:p=>p,"bigint, number":(p,d)=>p,"bigint, BigNumber":(p,d)=>p,Fraction:function(d){return d.floor()},"Fraction, number":function(d,h){return d.floor(h)},"Fraction, BigNumber":function(d,h){return d.floor(h.toNumber())},"Unit, number, Unit":e.referToSelf(p=>function(d,h,v){var y=d.toNumeric(v);return v.multiply(p(y,h))}),"Unit, BigNumber, Unit":e.referToSelf(p=>(d,h,v)=>p(d,h.toNumber(),v)),"Array | Matrix, number | BigNumber, Unit":e.referToSelf(p=>(d,h,v)=>it(d,y=>p(y,h,v),!0)),"Array | Matrix | Unit, Unit":e.referToSelf(p=>(d,h)=>p(d,0,h)),"Array | Matrix":e.referToSelf(p=>d=>it(d,p,!0)),"Array, number | BigNumber":e.referToSelf(p=>(d,h)=>it(d,v=>p(v,h),!0)),"SparseMatrix, number | BigNumber":e.referToSelf(p=>(d,h)=>l(d,h,p,!1)),"DenseMatrix, number | BigNumber":e.referToSelf(p=>(d,h)=>c(d,h,p,!1)),"number | Complex | Fraction | BigNumber, Array":e.referToSelf(p=>(d,h)=>c(n(h),d,p,!0).valueOf()),"number | Complex | Fraction | BigNumber, Matrix":e.referToSelf(p=>(d,h)=>o(d,0)?a(h.size(),h.storage()):h.storage()==="dense"?c(h,d,p,!0):u(h,d,p,!0))})});var dre="matAlgo02xDS0",hre=["typed","equalScalar"],Tn=N(dre,hre,t=>{var{typed:e,equalScalar:r}=t;return function(n,o,a,s){var l=n._data,u=n._size,c=n._datatype||n.getDataType(),f=o._values,m=o._index,p=o._ptr,d=o._size,h=o._datatype||o._data===void 0?o._datatype:o.getDataType();if(u.length!==d.length)throw new $t(u.length,d.length);if(u[0]!==d[0]||u[1]!==d[1])throw new RangeError("Dimension mismatch. Matrix A ("+u+") must match Matrix B ("+d+")");if(!f)throw new Error("Cannot perform operation on Dense Matrix and Pattern Sparse Matrix");var v=u[0],y=u[1],S,b=r,_=0,w=a;typeof c=="string"&&c===h&&c!=="mixed"&&(S=c,b=e.find(r,[S,S]),_=e.convert(0,S),w=e.find(a,[S,S]));for(var x=[],E=[],T=[],D=0;D<y;D++){T[D]=E.length;for(var M=p[D],C=p[D+1],$=M;$<C;$++){var O=m[$],R=s?w(f[$],l[O][D]):w(l[O][D],f[$]);b(R,_)||(E.push(O),x.push(R))}}return T[y]=E.length,o.createSparseMatrix({values:x,index:E,ptr:T,size:[v,y],datatype:c===n._datatype&&h===o._datatype?S:void 0})}});var gre="matAlgo03xDSf",vre=["typed"],Vr=N(gre,vre,t=>{var{typed:e}=t;return function(i,n,o,a){var s=i._data,l=i._size,u=i._datatype||i.getDataType(),c=n._values,f=n._index,m=n._ptr,p=n._size,d=n._datatype||n._data===void 0?n._datatype:n.getDataType();if(l.length!==p.length)throw new $t(l.length,p.length);if(l[0]!==p[0]||l[1]!==p[1])throw new RangeError("Dimension mismatch. Matrix A ("+l+") must match Matrix B ("+p+")");if(!c)throw new Error("Cannot perform operation on Dense Matrix and Pattern Sparse Matrix");var h=l[0],v=l[1],y,S=0,b=o;typeof u=="string"&&u===d&&u!=="mixed"&&(y=u,S=e.convert(0,y),b=e.find(o,[y,y]));for(var _=[],w=0;w<h;w++)_[w]=[];for(var x=[],E=[],T=0;T<v;T++){for(var D=T+1,M=m[T],C=m[T+1],$=M;$<C;$++){var O=f[$];x[O]=a?b(c[$],s[O][T]):b(s[O][T],c[$]),E[O]=D}for(var R=0;R<h;R++)E[R]===D?_[R][T]=x[R]:_[R][T]=a?b(S,s[R][T]):b(s[R][T],S)}return i.createDenseMatrix({data:_,size:[h,v],datatype:u===i._datatype&&d===n._datatype?y:void 0})}});var yre="matAlgo05xSfSf",bre=["typed","equalScalar"],$u=N(yre,bre,t=>{var{typed:e,equalScalar:r}=t;return function(n,o,a){var s=n._values,l=n._index,u=n._ptr,c=n._size,f=n._datatype||n._data===void 0?n._datatype:n.getDataType(),m=o._values,p=o._index,d=o._ptr,h=o._size,v=o._datatype||o._data===void 0?o._datatype:o.getDataType();if(c.length!==h.length)throw new $t(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 y=c[0],S=c[1],b,_=r,w=0,x=a;typeof f=="string"&&f===v&&f!=="mixed"&&(b=f,_=e.find(r,[b,b]),w=e.convert(0,b),x=e.find(a,[b,b]));var E=s&&m?[]:void 0,T=[],D=[],M=E?[]:void 0,C=E?[]:void 0,$=[],O=[],R,L,k,V;for(L=0;L<S;L++){D[L]=T.length;var J=L+1;for(k=u[L],V=u[L+1];k<V;k++)R=l[k],T.push(R),$[R]=J,M&&(M[R]=s[k]);for(k=d[L],V=d[L+1];k<V;k++)R=p[k],$[R]!==J&&T.push(R),O[R]=J,C&&(C[R]=m[k]);if(E)for(k=D[L];k<T.length;){R=T[k];var W=$[R],Q=O[R];if(W===J||Q===J){var ie=W===J?M[R]:w,B=Q===J?C[R]:w,Z=x(ie,B);_(Z,w)?T.splice(k,1):(E.push(Z),k++)}}}return D[S]=T.length,n.createSparseMatrix({values:E,index:T,ptr:D,size:[y,S],datatype:f===n._datatype&&v===o._datatype?b:void 0})}});var xre="matAlgo13xDD",_re=["typed"],bP=N(xre,_re,t=>{var{typed:e}=t;return function(n,o,a){var s=n._data,l=n._size,u=n._datatype,c=o._data,f=o._size,m=o._datatype,p=[];if(l.length!==f.length)throw new $t(l.length,f.length);for(var d=0;d<l.length;d++){if(l[d]!==f[d])throw new RangeError("Dimension mismatch. Matrix A ("+l+") must match Matrix B ("+f+")");p[d]=l[d]}var h,v=a;typeof u=="string"&&u===m&&(h=u,v=e.find(a,[h,h]));var y=p.length>0?r(v,0,p,p[0],s,c):[];return n.createDenseMatrix({data:y,size:p,datatype:h})};function r(i,n,o,a,s,l){var u=[];if(n===o.length-1)for(var c=0;c<a;c++)u[c]=i(s[c],l[c]);else for(var f=0;f<a;f++)u[f]=r(i,n+1,o,o[n+1],s[f],l[f]);return u}});function oi(t,e){if(lo(t.size(),e.size()))return[t,e];var r=tm(t.size(),e.size());return[t,e].map(i=>wre(i,r))}function wre(t,e){return lo(t.size(),e)?t:t.create(ts(t.valueOf(),e),t.datatype())}var Sre="matrixAlgorithmSuite",Dre=["typed","matrix"],Bt=N(Sre,Dre,t=>{var{typed:e,matrix:r}=t,i=bP({typed:e}),n=An({typed:e});return function(a){var s=a.elop,l=a.SD||a.DS,u;s?(u={"DenseMatrix, DenseMatrix":(p,d)=>i(...oi(p,d),s),"Array, Array":(p,d)=>i(...oi(r(p),r(d)),s).valueOf(),"Array, DenseMatrix":(p,d)=>i(...oi(r(p),d),s),"DenseMatrix, Array":(p,d)=>i(...oi(p,r(d)),s)},a.SS&&(u["SparseMatrix, SparseMatrix"]=(p,d)=>a.SS(...oi(p,d),s,!1)),a.DS&&(u["DenseMatrix, SparseMatrix"]=(p,d)=>a.DS(...oi(p,d),s,!1),u["Array, SparseMatrix"]=(p,d)=>a.DS(...oi(r(p),d),s,!1)),l&&(u["SparseMatrix, DenseMatrix"]=(p,d)=>l(...oi(d,p),s,!0),u["SparseMatrix, Array"]=(p,d)=>l(...oi(r(d),p),s,!0))):(u={"DenseMatrix, DenseMatrix":e.referToSelf(p=>(d,h)=>i(...oi(d,h),p)),"Array, Array":e.referToSelf(p=>(d,h)=>i(...oi(r(d),r(h)),p).valueOf()),"Array, DenseMatrix":e.referToSelf(p=>(d,h)=>i(...oi(r(d),h),p)),"DenseMatrix, Array":e.referToSelf(p=>(d,h)=>i(...oi(d,r(h)),p))},a.SS&&(u["SparseMatrix, SparseMatrix"]=e.referToSelf(p=>(d,h)=>a.SS(...oi(d,h),p,!1))),a.DS&&(u["DenseMatrix, SparseMatrix"]=e.referToSelf(p=>(d,h)=>a.DS(...oi(d,h),p,!1)),u["Array, SparseMatrix"]=e.referToSelf(p=>(d,h)=>a.DS(...oi(r(d),h),p,!1))),l&&(u["SparseMatrix, DenseMatrix"]=e.referToSelf(p=>(d,h)=>l(...oi(h,d),p,!0)),u["SparseMatrix, Array"]=e.referToSelf(p=>(d,h)=>l(...oi(r(h),d),p,!0))));var c=a.scalar||"any",f=a.Ds||a.Ss;f&&(s?(u["DenseMatrix,"+c]=(p,d)=>n(p,d,s,!1),u[c+", DenseMatrix"]=(p,d)=>n(d,p,s,!0),u["Array,"+c]=(p,d)=>n(r(p),d,s,!1).valueOf(),u[c+", Array"]=(p,d)=>n(r(d),p,s,!0).valueOf()):(u["DenseMatrix,"+c]=e.referToSelf(p=>(d,h)=>n(d,h,p,!1)),u[c+", DenseMatrix"]=e.referToSelf(p=>(d,h)=>n(h,d,p,!0)),u["Array,"+c]=e.referToSelf(p=>(d,h)=>n(r(d),h,p,!1).valueOf()),u[c+", Array"]=e.referToSelf(p=>(d,h)=>n(r(h),d,p,!0).valueOf())));var m=a.sS!==void 0?a.sS:a.Ss;return s?(a.Ss&&(u["SparseMatrix,"+c]=(p,d)=>a.Ss(p,d,s,!1)),m&&(u[c+", SparseMatrix"]=(p,d)=>m(d,p,s,!0))):(a.Ss&&(u["SparseMatrix,"+c]=e.referToSelf(p=>(d,h)=>a.Ss(d,h,p,!1))),m&&(u[c+", SparseMatrix"]=e.referToSelf(p=>(d,h)=>m(h,d,p,!0)))),s&&s.signatures&&Rv(u,s.signatures),u}});var xP="mod",Ere=["typed","config","round","matrix","equalScalar","zeros","DenseMatrix","concat"],hy=N(xP,Ere,t=>{var{typed:e,config:r,round:i,matrix:n,equalScalar:o,zeros:a,DenseMatrix:s,concat:l}=t,u=dy({typed:e,config:r,round:i,matrix:n,equalScalar:o,zeros:a,DenseMatrix:s}),c=Tn({typed:e,equalScalar:o}),f=Vr({typed:e}),m=$u({typed:e,equalScalar:o}),p=Er({typed:e,equalScalar:o}),d=mr({typed:e,DenseMatrix:s}),h=Bt({typed:e,matrix:n,concat:l});return e(xP,{"number, number":v,"BigNumber, BigNumber":function(S,b){return b.isZero()?S:S.sub(b.mul(u(S.div(b))))},"bigint, bigint":function(S,b){if(b===0n)return S;if(S<0){var _=S%b;return _===0n?_:_+b}return S%b},"Fraction, Fraction":function(S,b){return b.equals(0)?S:S.sub(b.mul(u(S.div(b))))}},h({SS:m,DS:f,SD:c,Ss:p,sS:d}));function v(y,S){return S===0?y:y-S*u(y/S)}});var Are="matAlgo01xDSid",Tre=["typed"],Ii=N(Are,Tre,t=>{var{typed:e}=t;return function(i,n,o,a){var s=i._data,l=i._size,u=i._datatype||i.getDataType(),c=n._values,f=n._index,m=n._ptr,p=n._size,d=n._datatype||n._data===void 0?n._datatype:n.getDataType();if(l.length!==p.length)throw new $t(l.length,p.length);if(l[0]!==p[0]||l[1]!==p[1])throw new RangeError("Dimension mismatch. Matrix A ("+l+") must match Matrix B ("+p+")");if(!c)throw new Error("Cannot perform operation on Dense Matrix and Pattern Sparse Matrix");var h=l[0],v=l[1],y=typeof u=="string"&&u!=="mixed"&&u===d?u:void 0,S=y?e.find(o,[y,y]):o,b,_,w=[];for(b=0;b<h;b++)w[b]=[];var x=[],E=[];for(_=0;_<v;_++){for(var T=_+1,D=m[_],M=m[_+1],C=D;C<M;C++)b=f[C],x[b]=a?S(c[C],s[b][_]):S(s[b][_],c[C]),E[b]=T;for(b=0;b<h;b++)E[b]===T?w[b][_]=x[b]:w[b][_]=s[b][_]}return i.createDenseMatrix({data:w,size:[h,v],datatype:u===i._datatype&&d===n._datatype?y:void 0})}});var Nre="matAlgo04xSidSid",Mre=["typed","equalScalar"],Xc=N(Nre,Mre,t=>{var{typed:e,equalScalar:r}=t;return function(n,o,a){var s=n._values,l=n._index,u=n._ptr,c=n._size,f=n._datatype||n._data===void 0?n._datatype:n.getDataType(),m=o._values,p=o._index,d=o._ptr,h=o._size,v=o._datatype||o._data===void 0?o._datatype:o.getDataType();if(c.length!==h.length)throw new $t(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 y=c[0],S=c[1],b,_=r,w=0,x=a;typeof f=="string"&&f===v&&f!=="mixed"&&(b=f,_=e.find(r,[b,b]),w=e.convert(0,b),x=e.find(a,[b,b]));var E=s&&m?[]:void 0,T=[],D=[],M=s&&m?[]:void 0,C=s&&m?[]:void 0,$=[],O=[],R,L,k,V,J;for(L=0;L<S;L++){D[L]=T.length;var W=L+1;for(V=u[L],J=u[L+1],k=V;k<J;k++)R=l[k],T.push(R),$[R]=W,M&&(M[R]=s[k]);for(V=d[L],J=d[L+1],k=V;k<J;k++)if(R=p[k],$[R]===W){if(M){var Q=x(M[R],m[k]);_(Q,w)?$[R]=null:M[R]=Q}}else T.push(R),O[R]=W,C&&(C[R]=m[k]);if(M&&C)for(k=D[L];k<T.length;)R=T[k],$[R]===W?(E[k]=M[R],k++):O[R]===W?(E[k]=C[R],k++):T.splice(k,1)}return D[S]=T.length,n.createSparseMatrix({values:E,index:T,ptr:D,size:[y,S],datatype:f===n._datatype&&v===o._datatype?b:void 0})}});var Cre="matAlgo10xSids",$re=["typed","DenseMatrix"],mo=N(Cre,$re,t=>{var{typed:e,DenseMatrix:r}=t;return function(n,o,a,s){var l=n._values,u=n._index,c=n._ptr,f=n._size,m=n._datatype;if(!l)throw new Error("Cannot perform operation on Pattern Sparse Matrix and Scalar value");var p=f[0],d=f[1],h,v=a;typeof m=="string"&&(h=m,o=e.convert(o,h),v=e.find(a,[h,h]));for(var y=[],S=[],b=[],_=0;_<d;_++){for(var w=_+1,x=c[_],E=c[_+1],T=x;T<E;T++){var D=u[T];S[D]=l[T],b[D]=w}for(var M=0;M<p;M++)_===0&&(y[M]=[]),b[M]===w?y[M][_]=s?v(o,S[M]):v(S[M],o):y[M][_]=o}return new r({data:y,size:[p,d],datatype:h})}});function Bo(t,e,r,i){if(!(this instanceof Bo))throw new SyntaxError("Constructor must be called with the new operator");this.fn=t,this.count=e,this.min=r,this.max=i,this.message="Wrong number of arguments in function "+t+" ("+e+" provided, "+r+(i!=null?"-"+i:"")+" expected)",this.stack=new Error().stack}Bo.prototype=new Error;Bo.prototype.constructor=Error;Bo.prototype.name="ArgumentsError";Bo.prototype.isArgumentsError=!0;var _P="gcd",Ire=["typed","config","round","matrix","equalScalar","zeros","BigNumber","DenseMatrix","concat"],LE="number | BigNumber | Fraction | Matrix | Array",Fre="".concat(LE,", ").concat(LE,", ...").concat(LE);function wP(t){return!t.some(e=>Array.isArray(e))}var SP=N(_P,Ire,t=>{var{typed:e,matrix:r,config:i,round:n,equalScalar:o,zeros:a,BigNumber:s,DenseMatrix:l,concat:u}=t,c=hy({typed:e,config:i,round:n,matrix:r,equalScalar:o,zeros:a,DenseMatrix:l,concat:u}),f=Ii({typed:e}),m=Xc({typed:e,equalScalar:o}),p=mo({typed:e,DenseMatrix:l}),d=Bt({typed:e,matrix:r,concat:u});return e(_P,{"number, number":h,"BigNumber, BigNumber":v,"Fraction, Fraction":(y,S)=>y.gcd(S)},d({SS:m,DS:f,Ss:p}),{[Fre]:e.referToSelf(y=>(S,b,_)=>{for(var w=y(S,b),x=0;x<_.length;x++)w=y(w,_[x]);return w}),Array:e.referToSelf(y=>S=>{if(S.length===1&&Array.isArray(S[0])&&wP(S[0]))return y(...S[0]);if(wP(S))return y(...S);throw new Bo("gcd() supports only 1d matrices!")}),Matrix:e.referToSelf(y=>S=>y(S.toArray()))});function h(y,S){if(!Ge(y)||!Ge(S))throw new Error("Parameters in function gcd must be integer numbers");for(var b;S!==0;)b=c(y,S),y=S,S=b;return y<0?-y:y}function v(y,S){if(!y.isInt()||!S.isInt())throw new Error("Parameters in function gcd must be integer numbers");for(var b=new s(0);!S.isZero();){var _=c(y,S);y=S,S=_}return y.lt(b)?y.neg():y}});var kre="matAlgo06xS0S0",Pre=["typed","equalScalar"],Iu=N(kre,Pre,t=>{var{typed:e,equalScalar:r}=t;return function(n,o,a){var s=n._values,l=n._size,u=n._datatype||n._data===void 0?n._datatype:n.getDataType(),c=o._values,f=o._size,m=o._datatype||o._data===void 0?o._datatype:o.getDataType();if(l.length!==f.length)throw new $t(l.length,f.length);if(l[0]!==f[0]||l[1]!==f[1])throw new RangeError("Dimension mismatch. Matrix A ("+l+") must match Matrix B ("+f+")");var p=l[0],d=l[1],h,v=r,y=0,S=a;typeof u=="string"&&u===m&&u!=="mixed"&&(h=u,v=e.find(r,[h,h]),y=e.convert(0,h),S=e.find(a,[h,h]));for(var b=s&&c?[]:void 0,_=[],w=[],x=b?[]:void 0,E=[],T=[],D=0;D<d;D++){w[D]=_.length;var M=D+1;if(qD(n,D,E,x,T,M,_,S),qD(o,D,E,x,T,M,_,S),x)for(var C=w[D];C<_.length;){var $=_[C];if(T[$]===M){var O=x[$];v(O,y)?_.splice(C,1):(b.push(O),C++)}else _.splice(C,1)}else for(var R=w[D];R<_.length;){var L=_[R];T[L]!==M?_.splice(R,1):R++}}return w[d]=_.length,n.createSparseMatrix({values:b,index:_,ptr:w,size:[p,d],datatype:u===n._datatype&&m===o._datatype?h:void 0})}});var DP="lcm",Bre=["typed","matrix","equalScalar","concat"],EP=N(DP,Bre,t=>{var{typed:e,matrix:r,equalScalar:i,concat:n}=t,o=Tn({typed:e,equalScalar:i}),a=Iu({typed:e,equalScalar:i}),s=Er({typed:e,equalScalar:i}),l=Bt({typed:e,matrix:r,concat:n}),u="number | BigNumber | Fraction | Matrix | Array",c={};return c["".concat(u,", ").concat(u,", ...").concat(u)]=e.referToSelf(m=>(p,d,h)=>{for(var v=m(p,d),y=0;y<h.length;y++)v=m(v,h[y]);return v}),e(DP,{"number, number":QD,"BigNumber, BigNumber":f,"Fraction, Fraction":(m,p)=>m.lcm(p)},l({SS:a,DS:o,Ss:s}),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 d=m.times(p);!p.isZero();){var h=p;p=m.mod(h),m=h}return d.div(m).abs()}});function Kc(t,e,r,i){return function(n){if(n>0||r.predictable){if(n<=0)return NaN;var o=n.toString(16),a=o.substring(0,15);return t*(o.length-a.length)+e(+("0x"+a))}return i(n.toNumber())}}var AP="log10",Ore=["typed","config","Complex"],Rre=nm(16),TP=N(AP,Ore,t=>{var{typed:e,config:r,Complex:i}=t;function n(a){return a.log().div(Math.LN10)}function o(a){return n(new i(a,0))}return e(AP,{number:function(s){return s>=0||r.predictable?nm(s):o(s)},bigint:Kc(Rre,nm,r,o),Complex:n,BigNumber:function(s){return!s.isNegative()||r.predictable?s.log():o(s.toNumber())},"Array | Matrix":e.referToSelf(a=>s=>it(s,a))})});var NP="log2",Lre=["typed","config","Complex"],MP=N(NP,Lre,t=>{var{typed:e,config:r,Complex:i}=t;function n(a){return o(new i(a,0))}return e(NP,{number:function(s){return s>=0||r.predictable?sy(s):n(s)},bigint:Kc(4,sy,r,n),Complex:o,BigNumber:function(s){return!s.isNegative()||r.predictable?s.log(2):n(s.toNumber())},"Array | Matrix":e.referToSelf(a=>s=>it(s,a))});function o(a){var s=Math.sqrt(a.re*a.re+a.im*a.im);return new i(Math.log2?Math.log2(s):Math.log(s)/Math.LN2,Math.atan2(a.im,a.re)/Math.LN2)}});var Ure="multiplyScalar",zre=["typed"],CP=N(Ure,zre,t=>{var{typed:e}=t;return e("multiplyScalar",{"number, number":WD,"Complex, Complex":function(i,n){return i.mul(n)},"BigNumber, BigNumber":function(i,n){return i.times(n)},"bigint, bigint":function(i,n){return i*n},"Fraction, Fraction":function(i,n){return i.mul(n)},"number | Fraction | BigNumber | Complex, Unit":(r,i)=>i.multiply(r),"Unit, number | Fraction | BigNumber | Complex | Unit":(r,i)=>r.multiply(i)})});var $P="multiply",Vre=["typed","matrix","addScalar","multiplyScalar","equalScalar","dot"],IP=N($P,Vre,t=>{var{typed:e,matrix:r,addScalar:i,multiplyScalar:n,equalScalar:o,dot:a}=t,s=Er({typed:e,equalScalar:o}),l=An({typed:e});function u(w,x){switch(w.length){case 1:switch(x.length){case 1:if(w[0]!==x[0])throw new RangeError("Dimension mismatch in multiplication. Vectors must have the same length");break;case 2:if(w[0]!==x[0])throw new RangeError("Dimension mismatch in multiplication. Vector length ("+w[0]+") must match Matrix rows ("+x[0]+")");break;default:throw new Error("Can only multiply a 1 or 2 dimensional matrix (Matrix B has "+x.length+" dimensions)")}break;case 2:switch(x.length){case 1:if(w[1]!==x[0])throw new RangeError("Dimension mismatch in multiplication. Matrix columns ("+w[1]+") must match Vector length ("+x[0]+")");break;case 2:if(w[1]!==x[0])throw new RangeError("Dimension mismatch in multiplication. Matrix A columns ("+w[1]+") must match Matrix B rows ("+x[0]+")");break;default:throw new Error("Can only multiply a 1 or 2 dimensional matrix (Matrix B has "+x.length+" dimensions)")}break;default:throw new Error("Can only multiply a 1 or 2 dimensional matrix (Matrix A has "+w.length+" dimensions)")}}function c(w,x,E){if(E===0)throw new Error("Cannot multiply two empty vectors");return a(w,x)}function f(w,x){if(x.storage()!=="dense")throw new Error("Support for SparseMatrix not implemented");return m(w,x)}function m(w,x){var E=w._data,T=w._size,D=w._datatype||w.getDataType(),M=x._data,C=x._size,$=x._datatype||x.getDataType(),O=T[0],R=C[1],L,k=i,V=n;D&&$&&D===$&&typeof D=="string"&&D!=="mixed"&&(L=D,k=e.find(i,[L,L]),V=e.find(n,[L,L]));for(var J=[],W=0;W<R;W++){for(var Q=V(E[0],M[0][W]),ie=1;ie<O;ie++)Q=k(Q,V(E[ie],M[ie][W]));J[W]=Q}return w.createDenseMatrix({data:J,size:[R],datatype:D===w._datatype&&$===x._datatype?L:void 0})}var p=e("_multiplyMatrixVector",{"DenseMatrix, any":h,"SparseMatrix, any":S}),d=e("_multiplyMatrixMatrix",{"DenseMatrix, DenseMatrix":v,"DenseMatrix, SparseMatrix":y,"SparseMatrix, DenseMatrix":b,"SparseMatrix, SparseMatrix":_});function h(w,x){var E=w._data,T=w._size,D=w._datatype||w.getDataType(),M=x._data,C=x._datatype||x.getDataType(),$=T[0],O=T[1],R,L=i,k=n;D&&C&&D===C&&typeof D=="string"&&D!=="mixed"&&(R=D,L=e.find(i,[R,R]),k=e.find(n,[R,R]));for(var V=[],J=0;J<$;J++){for(var W=E[J],Q=k(W[0],M[0]),ie=1;ie<O;ie++)Q=L(Q,k(W[ie],M[ie]));V[J]=Q}return w.createDenseMatrix({data:V,size:[$],datatype:D===w._datatype&&C===x._datatype?R:void 0})}function v(w,x){var E=w._data,T=w._size,D=w._datatype||w.getDataType(),M=x._data,C=x._size,$=x._datatype||x.getDataType(),O=T[0],R=T[1],L=C[1],k,V=i,J=n;D&&$&&D===$&&typeof D=="string"&&D!=="mixed"&&D!=="mixed"&&(k=D,V=e.find(i,[k,k]),J=e.find(n,[k,k]));for(var W=[],Q=0;Q<O;Q++){var ie=E[Q];W[Q]=[];for(var B=0;B<L;B++){for(var Z=J(ie[0],M[0][B]),q=1;q<R;q++)Z=V(Z,J(ie[q],M[q][B]));W[Q][B]=Z}}return w.createDenseMatrix({data:W,size:[O,L],datatype:D===w._datatype&&$===x._datatype?k:void 0})}function y(w,x){var E=w._data,T=w._size,D=w._datatype||w.getDataType(),M=x._values,C=x._index,$=x._ptr,O=x._size,R=x._datatype||x._data===void 0?x._datatype:x.getDataType();if(!M)throw new Error("Cannot multiply Dense Matrix times Pattern only Matrix");var L=T[0],k=O[1],V,J=i,W=n,Q=o,ie=0;D&&R&&D===R&&typeof D=="string"&&D!=="mixed"&&(V=D,J=e.find(i,[V,V]),W=e.find(n,[V,V]),Q=e.find(o,[V,V]),ie=e.convert(0,V));for(var B=[],Z=[],q=[],xe=x.createSparseMatrix({values:B,index:Z,ptr:q,size:[L,k],datatype:D===w._datatype&&R===x._datatype?V:void 0}),de=0;de<k;de++){q[de]=Z.length;var be=$[de],G=$[de+1];if(G>be)for(var K=0,re=0;re<L;re++){for(var ae=re+1,le=void 0,Se=be;Se<G;Se++){var _e=C[Se];K!==ae?(le=W(E[re][_e],M[Se]),K=ae):le=J(le,W(E[re][_e],M[Se]))}K===ae&&!Q(le,ie)&&(Z.push(re),B.push(le))}}return q[k]=Z.length,xe}function S(w,x){var E=w._values,T=w._index,D=w._ptr,M=w._datatype||w._data===void 0?w._datatype:w.getDataType();if(!E)throw new Error("Cannot multiply Pattern only Matrix times Dense Matrix");var C=x._data,$=x._datatype||x.getDataType(),O=w._size[0],R=x._size[0],L=[],k=[],V=[],J,W=i,Q=n,ie=o,B=0;M&&$&&M===$&&typeof M=="string"&&M!=="mixed"&&(J=M,W=e.find(i,[J,J]),Q=e.find(n,[J,J]),ie=e.find(o,[J,J]),B=e.convert(0,J));var Z=[],q=[];V[0]=0;for(var xe=0;xe<R;xe++){var de=C[xe];if(!ie(de,B))for(var be=D[xe],G=D[xe+1],K=be;K<G;K++){var re=T[K];q[re]?Z[re]=W(Z[re],Q(de,E[K])):(q[re]=!0,k.push(re),Z[re]=Q(de,E[K]))}}for(var ae=k.length,le=0;le<ae;le++){var Se=k[le];L[le]=Z[Se]}return V[1]=k.length,w.createSparseMatrix({values:L,index:k,ptr:V,size:[O,1],datatype:M===w._datatype&&$===x._datatype?J:void 0})}function b(w,x){var E=w._values,T=w._index,D=w._ptr,M=w._datatype||w._data===void 0?w._datatype:w.getDataType();if(!E)throw new Error("Cannot multiply Pattern only Matrix times Dense Matrix");var C=x._data,$=x._datatype||x.getDataType(),O=w._size[0],R=x._size[0],L=x._size[1],k,V=i,J=n,W=o,Q=0;M&&$&&M===$&&typeof M=="string"&&M!=="mixed"&&(k=M,V=e.find(i,[k,k]),J=e.find(n,[k,k]),W=e.find(o,[k,k]),Q=e.convert(0,k));for(var ie=[],B=[],Z=[],q=w.createSparseMatrix({values:ie,index:B,ptr:Z,size:[O,L],datatype:M===w._datatype&&$===x._datatype?k:void 0}),xe=[],de=[],be=0;be<L;be++){Z[be]=B.length;for(var G=be+1,K=0;K<R;K++){var re=C[K][be];if(!W(re,Q))for(var ae=D[K],le=D[K+1],Se=ae;Se<le;Se++){var _e=T[Se];de[_e]!==G?(de[_e]=G,B.push(_e),xe[_e]=J(re,E[Se])):xe[_e]=V(xe[_e],J(re,E[Se]))}}for(var Oe=Z[be],st=B.length,yt=Oe;yt<st;yt++){var Qe=B[yt];ie[yt]=xe[Qe]}}return Z[L]=B.length,q}function _(w,x){var E=w._values,T=w._index,D=w._ptr,M=w._datatype||w._data===void 0?w._datatype:w.getDataType(),C=x._values,$=x._index,O=x._ptr,R=x._datatype||x._data===void 0?x._datatype:x.getDataType(),L=w._size[0],k=x._size[1],V=E&&C,J,W=i,Q=n;M&&R&&M===R&&typeof M=="string"&&M!=="mixed"&&(J=M,W=e.find(i,[J,J]),Q=e.find(n,[J,J]));for(var ie=V?[]:void 0,B=[],Z=[],q=w.createSparseMatrix({values:ie,index:B,ptr:Z,size:[L,k],datatype:M===w._datatype&&R===x._datatype?J:void 0}),xe=V?[]:void 0,de=[],be,G,K,re,ae,le,Se,_e,Oe=0;Oe<k;Oe++){Z[Oe]=B.length;var st=Oe+1;for(ae=O[Oe],le=O[Oe+1],re=ae;re<le;re++)if(_e=$[re],V)for(G=D[_e],K=D[_e+1],be=G;be<K;be++)Se=T[be],de[Se]!==st?(de[Se]=st,B.push(Se),xe[Se]=Q(C[re],E[be])):xe[Se]=W(xe[Se],Q(C[re],E[be]));else for(G=D[_e],K=D[_e+1],be=G;be<K;be++)Se=T[be],de[Se]!==st&&(de[Se]=st,B.push(Se));if(V)for(var yt=Z[Oe],Qe=B.length,ut=yt;ut<Qe;ut++){var H=B[ut];ie[ut]=xe[H]}}return Z[k]=B.length,q}return e($P,n,{"Array, Array":e.referTo("Matrix, Matrix",w=>(x,E)=>{u(vt(x),vt(E));var T=w(r(x),r(E));return Je(T)?T.valueOf():T}),"Matrix, Matrix":function(x,E){var T=x.size(),D=E.size();return u(T,D),T.length===1?D.length===1?c(x,E,T[0]):f(x,E):D.length===1?p(x,E):d(x,E)},"Matrix, Array":e.referTo("Matrix,Matrix",w=>(x,E)=>w(x,r(E))),"Array, Matrix":e.referToSelf(w=>(x,E)=>w(r(x,E.storage()),E)),"SparseMatrix, any":function(x,E){return s(x,E,n,!1)},"DenseMatrix, any":function(x,E){return l(x,E,n,!1)},"any, SparseMatrix":function(x,E){return s(E,x,n,!0)},"any, DenseMatrix":function(x,E){return l(E,x,n,!0)},"Array, any":function(x,E){return l(r(x),E,n,!1).valueOf()},"any, Array":function(x,E){return l(r(E),x,n,!0).valueOf()},"any, any":n,"any, any, ...any":e.referToSelf(w=>(x,E,T)=>{for(var D=w(x,E),M=0;M<T.length;M++)D=w(D,T[M]);return D})})});var FP="nthRoot",qre=["typed","matrix","equalScalar","BigNumber","concat"],kP=N(FP,qre,t=>{var{typed:e,matrix:r,equalScalar:i,BigNumber:n,concat:o}=t,a=Ii({typed:e}),s=Tn({typed:e,equalScalar:i}),l=Iu({typed:e,equalScalar:i}),u=Er({typed:e,equalScalar:i}),c=Bt({typed:e,matrix:r,concat:o});function f(){throw new Error("Complex number not supported in function nthRoot. Use nthRoots instead.")}return e(FP,{number:tE,"number, number":tE,BigNumber:p=>m(p,new n(2)),"BigNumber, BigNumber":m,Complex:f,"Complex, number":f,Array:e.referTo("DenseMatrix,number",p=>d=>p(r(d),2).valueOf()),DenseMatrix:e.referTo("DenseMatrix,number",p=>d=>p(d,2)),SparseMatrix:e.referTo("SparseMatrix,number",p=>d=>p(d,2)),"SparseMatrix, SparseMatrix":e.referToSelf(p=>(d,h)=>{if(h.density()===1)return l(d,h,p);throw new Error("Root must be non-zero")}),"DenseMatrix, SparseMatrix":e.referToSelf(p=>(d,h)=>{if(h.density()===1)return a(d,h,p,!1);throw new Error("Root must be non-zero")}),"Array, SparseMatrix":e.referTo("DenseMatrix,SparseMatrix",p=>(d,h)=>p(r(d),h)),"number | BigNumber, SparseMatrix":e.referToSelf(p=>(d,h)=>{if(h.density()===1)return u(h,d,p,!0);throw new Error("Root must be non-zero")})},c({scalar:"number | BigNumber",SD:s,Ss:u,sS:!1}));function m(p,d){var h=n.precision,v=n.clone({precision:h+2}),y=new n(0),S=new v(1),b=d.isNegative();if(b&&(d=d.neg()),d.isZero())throw new Error("Root must be non-zero");if(p.isNegative()&&!d.abs().mod(2).equals(1))throw new Error("Root must be odd when a is negative.");if(p.isZero())return b?new v(1/0):0;if(!p.isFinite())return b?y:p;var _=p.abs().pow(S.div(d));return _=p.isNeg()?_.neg():_,new n((b?S.div(_):_).toPrecision(h))}});var PP="sign",jre=["typed","BigNumber","Fraction","complex"],BP=N(PP,jre,t=>{var{typed:e,BigNumber:r,complex:i,Fraction:n}=t;return e(PP,{number:uy,Complex:function(a){return a.im===0?i(uy(a.re)):a.sign()},BigNumber:function(a){return new r(a.cmp(0))},bigint:function(a){return a>0n?1n:a<0n?-1n:0n},Fraction:function(a){return a.n===0n?new n(0):new n(a.s)},"Array | Matrix":e.referToSelf(o=>a=>it(a,o,!0)),Unit:e.referToSelf(o=>a=>{if(!a._isDerived()&&a.units[0].unit.offset!==0)throw new TypeError("sign is ambiguous for units with offset");return e.find(o,a.valueType())(a.value)})})});var Zre="sqrt",Gre=["config","typed","Complex"],OP=N(Zre,Gre,t=>{var{config:e,typed:r,Complex:i}=t;return r("sqrt",{number:n,Complex:function(a){return a.sqrt()},BigNumber:function(a){return!a.isNegative()||e.predictable?a.sqrt():n(a.toNumber())},Unit:function(a){return a.pow(.5)}});function n(o){return isNaN(o)?NaN:o>=0||e.predictable?Math.sqrt(o):new i(o,0).sqrt()}});var RP="square",Wre=["typed"],LP=N(RP,Wre,t=>{var{typed:e}=t;return e(RP,{number:rE,Complex:function(i){return i.mul(i)},BigNumber:function(i){return i.times(i)},bigint:function(i){return i*i},Fraction:function(i){return i.mul(i)},Unit:function(i){return i.pow(2)}})});var UP="subtract",Hre=["typed","matrix","equalScalar","subtractScalar","unaryMinus","DenseMatrix","concat"],zP=N(UP,Hre,t=>{var{typed:e,matrix:r,equalScalar:i,subtractScalar:n,unaryMinus:o,DenseMatrix:a,concat:s}=t,l=Ii({typed:e}),u=Vr({typed:e}),c=$u({typed:e,equalScalar:i}),f=mo({typed:e,DenseMatrix:a}),m=mr({typed:e,DenseMatrix:a}),p=Bt({typed:e,matrix:r,concat:s});return e(UP,{"any, any":n},p({elop:n,SS:c,DS:l,SD:u,Ss:m,sS:f}))});var VP="xgcd",Yre=["typed","config","matrix","BigNumber"],qP=N(VP,Yre,t=>{var{typed:e,config:r,matrix:i,BigNumber:n}=t;return e(VP,{"number, number":function(s,l){var u=nE(s,l);return r.matrix==="Array"?u:i(u)},"BigNumber, BigNumber":o});function o(a,s){var l,u,c,f=new n(0),m=new n(1),p=f,d=m,h=m,v=f;if(!a.isInt()||!s.isInt())throw new Error("Parameters in function xgcd must be integer numbers");for(;!s.isZero();)u=a.div(s).floor(),c=a.mod(s),l=p,p=d.minus(u.times(p)),d=l,l=h,h=v.minus(u.times(h)),v=l,a=s,s=c;var y;return a.lt(f)?y=[a.neg(),d.neg(),v.neg()]:y=[a,a.isZero()?0:d,v],r.matrix==="Array"?y:i(y)}});var jP="invmod",Jre=["typed","config","BigNumber","xgcd","equal","smaller","mod","add","isInteger"],ZP=N(jP,Jre,t=>{var{typed:e,config:r,BigNumber:i,xgcd:n,equal:o,smaller:a,mod:s,add:l,isInteger:u}=t;return e(jP,{"number, number":c,"BigNumber, BigNumber":c});function c(f,m){if(!u(f)||!u(m))throw new Error("Parameters in function invmod must be integer numbers");if(f=s(f,m),o(m,0))throw new Error("Divisor must be non zero");var p=n(f,m);p=p.valueOf();var[d,h]=p;return o(d,i(1))?(h=s(h,m),a(h,i(0))&&(h=l(h,m)),h):NaN}});var Xre="matAlgo09xS0Sf",Kre=["typed","equalScalar"],gy=N(Xre,Kre,t=>{var{typed:e,equalScalar:r}=t;return function(n,o,a){var s=n._values,l=n._index,u=n._ptr,c=n._size,f=n._datatype||n._data===void 0?n._datatype:n.getDataType(),m=o._values,p=o._index,d=o._ptr,h=o._size,v=o._datatype||o._data===void 0?o._datatype:o.getDataType();if(c.length!==h.length)throw new $t(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 y=c[0],S=c[1],b,_=r,w=0,x=a;typeof f=="string"&&f===v&&f!=="mixed"&&(b=f,_=e.find(r,[b,b]),w=e.convert(0,b),x=e.find(a,[b,b]));var E=s&&m?[]:void 0,T=[],D=[],M=E?[]:void 0,C=[],$,O,R,L,k;for(O=0;O<S;O++){D[O]=T.length;var V=O+1;if(M)for(L=d[O],k=d[O+1],R=L;R<k;R++)$=p[R],C[$]=V,M[$]=m[R];for(L=u[O],k=u[O+1],R=L;R<k;R++)if($=l[R],M){var J=C[$]===V?M[$]:w,W=x(s[R],J);_(W,w)||(T.push($),E.push(W))}else T.push($)}return D[S]=T.length,n.createSparseMatrix({values:E,index:T,ptr:D,size:[y,S],datatype:f===n._datatype&&v===o._datatype?b:void 0})}});var GP="dotMultiply",Qre=["typed","matrix","equalScalar","multiplyScalar","concat"],WP=N(GP,Qre,t=>{var{typed:e,matrix:r,equalScalar:i,multiplyScalar:n,concat:o}=t,a=Tn({typed:e,equalScalar:i}),s=gy({typed:e,equalScalar:i}),l=Er({typed:e,equalScalar:i}),u=Bt({typed:e,matrix:r,concat:o});return e(GP,u({elop:n,SS:s,DS:a,Ss:l}))});function HP(t,e){if(t.isFinite()&&!t.isInteger()||e.isFinite()&&!e.isInteger())throw new Error("Integers expected in function bitAnd");var r=t.constructor;if(t.isNaN()||e.isNaN())return new r(NaN);if(t.isZero()||e.eq(-1)||t.eq(e))return t;if(e.isZero()||t.eq(-1))return e;if(!t.isFinite()||!e.isFinite()){if(!t.isFinite()&&!e.isFinite())return t.isNegative()===e.isNegative()?t:new r(0);if(!t.isFinite())return e.isNegative()?t:t.isNegative()?new r(0):e;if(!e.isFinite())return t.isNegative()?e:e.isNegative()?new r(0):t}return UE(t,e,function(i,n){return i&n})}function Qc(t){if(t.isFinite()&&!t.isInteger())throw new Error("Integer expected in function bitNot");var e=t.constructor,r=e.precision;e.config({precision:1e9});var i=t.plus(new e(1));return i.s=-i.s||null,e.config({precision:r}),i}function YP(t,e){if(t.isFinite()&&!t.isInteger()||e.isFinite()&&!e.isInteger())throw new Error("Integers expected in function bitOr");var r=t.constructor;if(t.isNaN()||e.isNaN())return new r(NaN);var i=new r(-1);return t.isZero()||e.eq(i)||t.eq(e)?e:e.isZero()||t.eq(i)?t:!t.isFinite()||!e.isFinite()?!t.isFinite()&&!t.isNegative()&&e.isNegative()||t.isNegative()&&!e.isNegative()&&!e.isFinite()?i:t.isNegative()&&e.isNegative()?t.isFinite()?t:e:t.isFinite()?e:t:UE(t,e,function(n,o){return n|o})}function UE(t,e,r){var i=t.constructor,n,o,a=+(t.s<0),s=+(e.s<0);if(a){n=vy(Qc(t));for(var l=0;l<n.length;++l)n[l]^=1}else n=vy(t);if(s){o=vy(Qc(e));for(var u=0;u<o.length;++u)o[u]^=1}else o=vy(e);var c,f,m;n.length<=o.length?(c=n,f=o,m=a):(c=o,f=n,m=s);var p=c.length,d=f.length,h=r(a,s)^1,v=new i(h^1),y=new i(1),S=new i(2),b=i.precision;for(i.config({precision:1e9});p>0;)r(c[--p],f[--d])===h&&(v=v.plus(y)),y=y.times(S);for(;d>0;)r(m,f[--d])===h&&(v=v.plus(y)),y=y.times(S);return i.config({precision:b}),h===0&&(v.s=-v.s),v}function vy(t){for(var e=t.d,r=e[0]+"",i=1;i<e.length;++i){for(var n=e[i]+"",o=7-n.length;o--;)n="0"+n;r+=n}for(var a=r.length;r.charAt(a)==="0";)a--;var s=t.e,l=r.slice(0,a+1||1),u=l.length;if(s>0)if(++s>u)for(s-=u;s--;)l+="0";else s<u&&(l=l.slice(0,s)+"."+l.slice(s));for(var c=[0],f=0;f<l.length;){for(var m=c.length;m--;)c[m]*=10;c[0]+=parseInt(l.charAt(f++));for(var p=0;p<c.length;++p)c[p]>1&&((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 JP(t,e){if(t.isFinite()&&!t.isInteger()||e.isFinite()&&!e.isInteger())throw new Error("Integers expected in function bitXor");var r=t.constructor;if(t.isNaN()||e.isNaN())return new r(NaN);if(t.isZero())return e;if(e.isZero())return t;if(t.eq(e))return new r(0);var i=new r(-1);return t.eq(i)?Qc(e):e.eq(i)?Qc(t):!t.isFinite()||!e.isFinite()?!t.isFinite()&&!e.isFinite()?i:new r(t.isNegative()===e.isNegative()?1/0:-1/0):UE(t,e,function(n,o){return n^o})}function XP(t,e){if(t.isFinite()&&!t.isInteger()||e.isFinite()&&!e.isInteger())throw new Error("Integers expected in function leftShift");var r=t.constructor;return t.isNaN()||e.isNaN()||e.isNegative()&&!e.isZero()?new r(NaN):t.isZero()||e.isZero()?t:!t.isFinite()&&!e.isFinite()?new r(NaN):e.lt(55)?t.times(Math.pow(2,e.toNumber())+""):t.times(new r(2).pow(e))}function KP(t,e){if(t.isFinite()&&!t.isInteger()||e.isFinite()&&!e.isInteger())throw new Error("Integers expected in function rightArithShift");var r=t.constructor;return t.isNaN()||e.isNaN()||e.isNegative()&&!e.isZero()?new r(NaN):t.isZero()||e.isZero()?t:e.isFinite()?e.lt(55)?t.div(Math.pow(2,e.toNumber())+"").floor():t.div(new r(2).pow(e)).floor():t.isNegative()?new r(-1):t.isFinite()?new r(0):new r(NaN)}var QP="bitAnd",ene=["typed","matrix","equalScalar","concat"],yy=N(QP,ene,t=>{var{typed:e,matrix:r,equalScalar:i,concat:n}=t,o=Tn({typed:e,equalScalar:i}),a=Iu({typed:e,equalScalar:i}),s=Er({typed:e,equalScalar:i}),l=Bt({typed:e,matrix:r,concat:n});return e(QP,{"number, number":oE,"BigNumber, BigNumber":HP,"bigint, bigint":(u,c)=>u&c},l({SS:a,DS:o,Ss:s}))});var e2="bitNot",tne=["typed"],t2=N(e2,tne,t=>{var{typed:e}=t;return e(e2,{number:aE,BigNumber:Qc,bigint:r=>~r,"Array | Matrix":e.referToSelf(r=>i=>it(i,r))})});var r2="bitOr",rne=["typed","matrix","equalScalar","DenseMatrix","concat"],by=N(r2,rne,t=>{var{typed:e,matrix:r,equalScalar:i,DenseMatrix:n,concat:o}=t,a=Ii({typed:e}),s=Xc({typed:e,equalScalar:i}),l=mo({typed:e,DenseMatrix:n}),u=Bt({typed:e,matrix:r,concat:o});return e(r2,{"number, number":sE,"BigNumber, BigNumber":YP,"bigint, bigint":(c,f)=>c|f},u({SS:s,DS:a,Ss:l}))});var nne="matAlgo07xSSf",ine=["typed","SparseMatrix"],Ln=N(nne,ine,t=>{var{typed:e,SparseMatrix:r}=t;return function(o,a,s){var l=o._size,u=o._datatype||o._data===void 0?o._datatype:o.getDataType(),c=a._size,f=a._datatype||a._data===void 0?a._datatype:a.getDataType();if(l.length!==c.length)throw new $t(l.length,c.length);if(l[0]!==c[0]||l[1]!==c[1])throw new RangeError("Dimension mismatch. Matrix A ("+l+") must match Matrix B ("+c+")");var m=l[0],p=l[1],d,h=0,v=s;typeof u=="string"&&u===f&&u!=="mixed"&&(d=u,h=e.convert(0,d),v=e.find(s,[d,d]));for(var y=[],S=[],b=new Array(p+1).fill(0),_=[],w=[],x=[],E=[],T=0;T<p;T++){var D=T+1,M=0;i(o,T,x,_,D),i(a,T,E,w,D);for(var C=0;C<m;C++){var $=x[C]===D?_[C]:h,O=E[C]===D?w[C]:h,R=v($,O);R!==0&&R!==!1&&(S.push(C),y.push(R),M++)}b[T+1]=b[T]+M}return new r({values:y,index:S,ptr:b,size:[m,p],datatype:u===o._datatype&&f===a._datatype?d:void 0})};function i(n,o,a,s,l){for(var u=n._values,c=n._index,f=n._ptr,m=f[o],p=f[o+1];m<p;m++){var d=c[m];a[d]=l,s[d]=u[m]}}});var n2="bitXor",one=["typed","matrix","DenseMatrix","concat","SparseMatrix"],i2=N(n2,one,t=>{var{typed:e,matrix:r,DenseMatrix:i,concat:n,SparseMatrix:o}=t,a=Vr({typed:e}),s=Ln({typed:e,SparseMatrix:o}),l=mr({typed:e,DenseMatrix:i}),u=Bt({typed:e,matrix:r,concat:n});return e(n2,{"number, number":uE,"BigNumber, BigNumber":JP,"bigint, bigint":(c,f)=>c^f},u({SS:s,DS:a,Ss:l}))});var o2="arg",ane=["typed"],a2=N(o2,ane,t=>{var{typed:e}=t;return e(o2,{number:function(i){return Math.atan2(0,i)},BigNumber:function(i){return i.constructor.atan2(0,i)},Complex:function(i){return i.arg()},"Array | Matrix":e.referToSelf(r=>i=>it(i,r))})});var s2="conj",sne=["typed"],u2=N(s2,sne,t=>{var{typed:e}=t;return e(s2,{"number | BigNumber | Fraction":r=>r,Complex:r=>r.conjugate(),Unit:e.referToSelf(r=>i=>new i.constructor(r(i.toNumeric()),i.formatUnits())),"Array | Matrix":e.referToSelf(r=>i=>it(i,r))})});var l2="im",une=["typed"],c2=N(l2,une,t=>{var{typed:e}=t;return e(l2,{number:()=>0,"BigNumber | Fraction":r=>r.mul(0),Complex:r=>r.im,"Array | Matrix":e.referToSelf(r=>i=>it(i,r))})});var f2="re",lne=["typed"],p2=N(f2,lne,t=>{var{typed:e}=t;return e(f2,{"number | BigNumber | Fraction":r=>r,Complex:r=>r.re,"Array | Matrix":e.referToSelf(r=>i=>it(i,r))})});var m2="not",cne=["typed"],d2=N(m2,cne,t=>{var{typed:e}=t;return e(m2,{"null | undefined":()=>!0,number:dE,Complex:function(i){return i.re===0&&i.im===0},BigNumber:function(i){return i.isZero()||i.isNaN()},bigint:r=>!r,Unit:e.referToSelf(r=>i=>e.find(r,i.valueType())(i.value)),"Array | Matrix":e.referToSelf(r=>i=>it(i,r))})});var h2="or",fne=["typed","matrix","equalScalar","DenseMatrix","concat"],xy=N(h2,fne,t=>{var{typed:e,matrix:r,equalScalar:i,DenseMatrix:n,concat:o}=t,a=Vr({typed:e}),s=$u({typed:e,equalScalar:i}),l=mr({typed:e,DenseMatrix:n}),u=Bt({typed:e,matrix:r,concat:o});return e(h2,{"number, number":ly,"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":ly,"Unit, Unit":e.referToSelf(c=>(f,m)=>c(f.value||0,m.value||0))},u({SS:s,DS:a,Ss:l}))});var g2="xor",pne=["typed","matrix","DenseMatrix","concat","SparseMatrix"],v2=N(g2,pne,t=>{var{typed:e,matrix:r,DenseMatrix:i,concat:n,SparseMatrix:o}=t,a=Vr({typed:e}),s=Ln({typed:e,SparseMatrix:o}),l=mr({typed:e,DenseMatrix:i}),u=Bt({typed:e,matrix:r,concat:n});return e(g2,{"number, number":cy,"Complex, Complex":function(f,m){return(f.re!==0||f.im!==0)!=(m.re!==0||m.im!==0)},"bigint, bigint":cy,"BigNumber, BigNumber":function(f,m){return(!f.isZero()&&!f.isNaN())!=(!m.isZero()&&!m.isNaN())},"Unit, Unit":e.referToSelf(c=>(f,m)=>c(f.value||0,m.value||0))},u({SS:s,DS:a,Ss:l}))});var y2="concat",mne=["typed","matrix","isInteger"],_y=N(y2,mne,t=>{var{typed:e,matrix:r,isInteger:i}=t;return e(y2,{"...Array | Matrix | number | BigNumber":function(o){var a,s=o.length,l=-1,u,c=!1,f=[];for(a=0;a<s;a++){var m=o[a];if(Je(m)&&(c=!0),Et(m)||mt(m)){if(a!==s-1)throw new Error("Dimension must be specified as last argument");if(u=l,l=m.valueOf(),!i(l))throw new TypeError("Integer number expected for dimension");if(l<0||a>0&&l>u)throw new ii(l,u+1)}else{var p=dt(m).valueOf(),d=vt(p);if(f[a]=p,u=l,l=d.length-1,a>0&&l!==u)throw new $t(u+1,l+1)}}if(f.length===0)throw new SyntaxError("At least one matrix expected");for(var h=f.shift();f.length;)h=zD(h,f.shift(),l);return c?r(h):h},"...string":function(o){return o.join("")}})});var b2="column",dne=["typed","Index","matrix","range"],wy=N(b2,dne,t=>{var{typed:e,Index:r,matrix:i,range:n}=t;return e(b2,{"Matrix, number":o,"Array, number":function(s,l){return o(i(dt(s)),l).valueOf()}});function o(a,s){if(a.size().length!==2)throw new Error("Only two dimensional matrix is supported");Mr(s,a.size()[1]);var l=n(0,a.size()[0]),u=new r(l,s),c=a.subset(u);return Je(c)?c:i([[c]])}});var x2="count",hne=["typed","size","prod"],_2=N(x2,hne,t=>{var{typed:e,size:r,prod:i}=t;return e(x2,{string:function(o){return o.length},"Matrix | Array":function(o){return i(r(o))}})});var w2="cross",gne=["typed","matrix","subtract","multiply"],S2=N(w2,gne,t=>{var{typed:e,matrix:r,subtract:i,multiply:n}=t;return e(w2,{"Matrix, Matrix":function(s,l){return r(o(s.toArray(),l.toArray()))},"Matrix, Array":function(s,l){return r(o(s.toArray(),l))},"Array, Matrix":function(s,l){return r(o(s,l.toArray()))},"Array, Array":o});function o(a,s){var l=Math.max(vt(a).length,vt(s).length);a=Zc(a),s=Zc(s);var u=vt(a),c=vt(s);if(u.length!==1||c.length!==1||u[0]!==3||c[0]!==3)throw new RangeError("Vectors with length 3 expected (Size A = ["+u.join(", ")+"], B = ["+c.join(", ")+"])");var f=[i(n(a[1],s[2]),n(a[2],s[1])),i(n(a[2],s[0]),n(a[0],s[2])),i(n(a[0],s[1]),n(a[1],s[0]))];return l>1?[f]:f}});var D2="diag",vne=["typed","matrix","DenseMatrix","SparseMatrix"],E2=N(D2,vne,t=>{var{typed:e,matrix:r,DenseMatrix:i,SparseMatrix:n}=t;return e(D2,{Array:function(u){return o(u,0,vt(u),null)},"Array, number":function(u,c){return o(u,c,vt(u),null)},"Array, BigNumber":function(u,c){return o(u,c.toNumber(),vt(u),null)},"Array, string":function(u,c){return o(u,0,vt(u),c)},"Array, number, string":function(u,c,f){return o(u,c,vt(u),f)},"Array, BigNumber, string":function(u,c,f){return o(u,c.toNumber(),vt(u),f)},Matrix:function(u){return o(u,0,u.size(),u.storage())},"Matrix, number":function(u,c){return o(u,c,u.size(),u.storage())},"Matrix, BigNumber":function(u,c){return o(u,c.toNumber(),u.size(),u.storage())},"Matrix, string":function(u,c){return o(u,0,u.size(),c)},"Matrix, number, string":function(u,c,f){return o(u,c,u.size(),f)},"Matrix, BigNumber, string":function(u,c,f){return o(u,c.toNumber(),u.size(),f)}});function o(l,u,c,f){if(!Ge(u))throw new TypeError("Second parameter in function diag must be an integer");var m=u>0?u:0,p=u<0?-u:0;switch(c.length){case 1:return a(l,u,f,c[0],p,m);case 2:return s(l,u,f,c,p,m)}throw new RangeError("Matrix for function diag must be 2 dimensional")}function a(l,u,c,f,m,p){var d=[f+m,f+p];if(c&&c!=="sparse"&&c!=="dense")throw new TypeError("Unknown matrix type ".concat(c,'"'));var h=c==="sparse"?n.diagonal(d,l,u):i.diagonal(d,l,u);return c!==null?h:h.valueOf()}function s(l,u,c,f,m,p){if(Je(l)){var d=l.diagonal(u);return c!==null?c!==d.storage()?r(d,c):d:d.valueOf()}for(var h=Math.min(f[0]-m,f[1]-p),v=[],y=0;y<h;y++)v[y]=l[y+m][y+p];return c!==null?r(v):v}});var yne="filter",bne=["typed"],Sy=N(yne,bne,t=>{var{typed:e}=t;return e("filter",{"Array, function":A2,"Matrix, function":function(i,n){return i.create(A2(i.valueOf(),n),i.datatype())},"Array, RegExp":LD,"Matrix, RegExp":function(i,n){return i.create(LD(i.valueOf(),n),i.datatype())}})});function A2(t,e){var r=oa(e,t,"filter");return r.isUnary?RD(t,r.fn):RD(t,function(i,n,o){return r.fn(i,[n],o)})}var T2="flatten",xne=["typed"],N2=N(T2,xne,t=>{var{typed:e}=t;return e(T2,{Array:function(i){return Ut(i)},Matrix:function(i){return i.create(Ut(i.valueOf(),!0),i.datatype())}})});var zE="forEach",_ne=["typed"],Dy=N(zE,_ne,t=>{var{typed:e}=t;return e(zE,{"Array, function":wne,"Matrix, function":function(i,n){i.forEach(n)}})});function wne(t,e){var r=oa(e,t,zE);iy(t,r.fn,r.isUnary)}var M2="getMatrixDataType",Sne=["typed"],C2=N(M2,Sne,t=>{var{typed:e}=t;return e(M2,{Array:function(i){return wl(i,ir)},Matrix:function(i){return i.getDataType()}})});var $2="identity",Dne=["typed","config","matrix","BigNumber","DenseMatrix","SparseMatrix"],I2=N($2,Dne,t=>{var{typed:e,config:r,matrix:i,BigNumber:n,DenseMatrix:o,SparseMatrix:a}=t;return e($2,{"":function(){return r.matrix==="Matrix"?i([]):[]},string:function(c){return i(c)},"number | BigNumber":function(c){return l(c,c,r.matrix==="Matrix"?"dense":void 0)},"number | BigNumber, string":function(c,f){return l(c,c,f)},"number | BigNumber, number | BigNumber":function(c,f){return l(c,f,r.matrix==="Matrix"?"dense":void 0)},"number | BigNumber, number | BigNumber, string":function(c,f,m){return l(c,f,m)},Array:function(c){return s(c)},"Array, string":function(c,f){return s(c,f)},Matrix:function(c){return s(c.valueOf(),c.storage())},"Matrix, string":function(c,f){return s(c.valueOf(),f)}});function s(u,c){switch(u.length){case 0:return c?i(c):[];case 1:return l(u[0],u[0],c);case 2:return l(u[0],u[1],c);default:throw new Error("Vector containing two values expected")}}function l(u,c,f){var m=mt(u)||mt(c)?n:null;if(mt(u)&&(u=u.toNumber()),mt(c)&&(c=c.toNumber()),!Ge(u)||u<1)throw new Error("Parameters in function identity must be positive integers");if(!Ge(c)||c<1)throw new Error("Parameters in function identity must be positive integers");var p=m?new n(1):1,d=m?new m(0):0,h=[u,c];if(f){if(f==="sparse")return a.diagonal(h,p,0,d);if(f==="dense")return o.diagonal(h,p,0,d);throw new TypeError('Unknown matrix type "'.concat(f,'"'))}for(var v=Ta([],h,d),y=u<c?u:c,S=0;S<y;S++)v[S][S]=p;return v}});var F2="kron",Ene=["typed","matrix","multiplyScalar"],k2=N(F2,Ene,t=>{var{typed:e,matrix:r,multiplyScalar:i}=t;return e(F2,{"Matrix, Matrix":function(a,s){return r(n(a.toArray(),s.toArray()))},"Matrix, Array":function(a,s){return r(n(a.toArray(),s))},"Array, Matrix":function(a,s){return r(n(a,s.toArray()))},"Array, Array":n});function n(o,a){if(vt(o).length===1&&(o=[o]),vt(a).length===1&&(a=[a]),vt(o).length>2||vt(a).length>2)throw new RangeError("Vectors with dimensions greater then 2 are not supported expected (Size x = "+JSON.stringify(o.length)+", y = "+JSON.stringify(a.length)+")");var s=[],l=[];return o.map(function(u){return a.map(function(c){return l=[],s.push(l),u.map(function(f){return c.map(function(m){return l.push(i(f,m))})})})})&&s}});var VE="map",Ane=["typed"],Ey=N(VE,Ane,t=>{var{typed:e}=t;return e(VE,{"Array, function":i,"Matrix, function":function(o,a){return o.map(a)},"Array|Matrix, Array|Matrix, ...Array|Matrix|function":(n,o,a)=>r([n,o,...a.slice(0,a.length-1)],a[a.length-1])});function r(n,o){if(typeof o!="function")throw new Error("Last argument must be a callback function");var a=n[0].isMatrix,s=tm(...n.map(_=>_.isMatrix?_.size():vt(_))),l=a?(_,w)=>_.get(w):Wc,u=a?n.map(_=>_.isMatrix?_.create(ts(_.toArray(),s),_.datatype()):n[0].create(ts(_.valueOf(),s))):n.map(_=>_.isMatrix?ts(_.toArray(),s):ts(_,s)),c;if(e.isTypedFunction(o)){var f=s.map(()=>0),m=u.map(_=>l(_,f)),p=b(o,m,f,u);c=y(p)}else{var d=n.length,h=S(o,d);c=y(h)}var v=(_,w)=>c([_,...u.slice(1).map(x=>l(x,w))],w);if(a)return u[0].map(v);return i(u[0],v);function y(_){switch(_){case 0:return w=>o(...w);case 1:return(w,x)=>o(...w,x);case 2:return(w,x)=>o(...w,x,...u)}}function S(_,w){return _.length>w+1?2:_.length===w+1?1:0}function b(_,w,x,E){return e.resolve(_,[...w,x,...E])!==null?2:e.resolve(_,[...w,x])!==null?1:(e.resolve(_,w)!==null,0)}}function i(n,o){var a=oa(o,n,VE);return rm(n,a.fn,a.isUnary)}});var P2="diff",Tne=["typed","matrix","subtract","number"],Ay=N(P2,Tne,t=>{var{typed:e,matrix:r,subtract:i,number:n}=t;return e(P2,{"Array | Matrix":function(c){return Je(c)?r(a(c.toArray())):a(c)},"Array | Matrix, number":function(c,f){if(!Ge(f))throw new RangeError("Dimension must be a whole number");return Je(c)?r(o(c.toArray(),f)):o(c,f)},"Array, BigNumber":e.referTo("Array,number",u=>(c,f)=>u(c,n(f))),"Matrix, BigNumber":e.referTo("Matrix,number",u=>(c,f)=>u(c,n(f)))});function o(u,c){if(Je(u)&&(u=u.toArray()),!Array.isArray(u))throw RangeError("Array/Matrix does not have that many dimensions");if(c>0){var f=[];return u.forEach(m=>{f.push(o(m,c-1))}),f}else{if(c===0)return a(u);throw RangeError("Cannot have negative dimension")}}function a(u){for(var c=[],f=u.length,m=1;m<f;m++)c.push(s(u[m-1],u[m]));return c}function s(u,c){Je(u)&&(u=u.toArray()),Je(c)&&(c=c.toArray());var f=Array.isArray(u),m=Array.isArray(c);if(f&&m)return l(u,c);if(!f&&!m)return i(c,u);throw TypeError("Cannot calculate difference between 1 array and 1 non-array")}function l(u,c){if(u.length!==c.length)throw RangeError("Not all sub-arrays have the same length");for(var f=[],m=u.length,p=0;p<m;p++)f.push(s(u[p],c[p]));return f}});var Nne="ones",Mne=["typed","config","matrix","BigNumber"],B2=N(Nne,Mne,t=>{var{typed:e,config:r,matrix:i,BigNumber:n}=t;return e("ones",{"":function(){return r.matrix==="Array"?o([]):o([],"default")},"...number | BigNumber | string":function(u){var c=u[u.length-1];if(typeof c=="string"){var f=u.pop();return o(u,f)}else return r.matrix==="Array"?o(u):o(u,"default")},Array:o,Matrix:function(u){var c=u.storage();return o(u.valueOf(),c)},"Array | Matrix, string":function(u,c){return o(u.valueOf(),c)}});function o(l,u){var c=a(l),f=c?new n(1):1;if(s(l),u){var m=i(u);return l.length>0?m.resize(l,f):m}else{var p=[];return l.length>0?Ta(p,l,f):p}}function a(l){var u=!1;return l.forEach(function(c,f,m){mt(c)&&(u=!0,m[f]=c.toNumber())}),u}function s(l){l.forEach(function(u){if(typeof u!="number"||!Ge(u)||u<0)throw new Error("Parameters in function ones must be positive integers")})}});function ef(){throw new Error('No "bignumber" implementation available')}function Ty(){throw new Error('No "fraction" implementation available')}function Ny(){throw new Error('No "matrix" implementation available')}var O2="range",Cne=["typed","config","?matrix","?bignumber","smaller","smallerEq","larger","largerEq","add","isPositive"],My=N(O2,Cne,t=>{var{typed:e,config:r,matrix:i,bignumber:n,smaller:o,smallerEq:a,larger:s,largerEq:l,add:u,isPositive:c}=t;return e(O2,{string:m,"string, boolean":m,number:function(v){throw new TypeError("Too few arguments to function range(): ".concat(v))},boolean:function(v){throw new TypeError("Unexpected type of argument 1 to function range(): ".concat(v,", number|bigint|BigNumber|Fraction"))},"number, number":function(v,y){return f(p(v,y,1,!1))},"number, number, number":function(v,y,S){return f(p(v,y,S,!1))},"number, number, boolean":function(v,y,S){return f(p(v,y,1,S))},"number, number, number, boolean":function(v,y,S,b){return f(p(v,y,S,b))},"bigint, bigint|number":function(v,y){return f(p(v,y,1n,!1))},"number, bigint":function(v,y){return f(p(BigInt(v),y,1n,!1))},"bigint, bigint|number, bigint|number":function(v,y,S){return f(p(v,y,BigInt(S),!1))},"number, bigint, bigint|number":function(v,y,S){return f(p(BigInt(v),y,BigInt(S),!1))},"bigint, bigint|number, boolean":function(v,y,S){return f(p(v,y,1n,S))},"number, bigint, boolean":function(v,y,S){return f(p(BigInt(v),y,1n,S))},"bigint, bigint|number, bigint|number, boolean":function(v,y,S,b){return f(p(v,y,BigInt(S),b))},"number, bigint, bigint|number, boolean":function(v,y,S,b){return f(p(BigInt(v),y,BigInt(S),b))},"BigNumber, BigNumber":function(v,y){var S=v.constructor;return f(p(v,y,new S(1),!1))},"BigNumber, BigNumber, BigNumber":function(v,y,S){return f(p(v,y,S,!1))},"BigNumber, BigNumber, boolean":function(v,y,S){var b=v.constructor;return f(p(v,y,new b(1),S))},"BigNumber, BigNumber, BigNumber, boolean":function(v,y,S,b){return f(p(v,y,S,b))},"Fraction, Fraction":function(v,y){return f(p(v,y,1,!1))},"Fraction, Fraction, Fraction":function(v,y,S){return f(p(v,y,S,!1))},"Fraction, Fraction, boolean":function(v,y,S){return f(p(v,y,1,S))},"Fraction, Fraction, Fraction, boolean":function(v,y,S,b){return f(p(v,y,S,b))},"Unit, Unit, Unit":function(v,y,S){return f(p(v,y,S,!1))},"Unit, Unit, Unit, boolean":function(v,y,S,b){return f(p(v,y,S,b))}});function f(h){return r.matrix==="Matrix"?i?i(h):Ny():h}function m(h,v){var y=d(h);if(!y)throw new SyntaxError('String "'+h+'" is no valid range');return r.number==="BigNumber"?(n===void 0&&ef(),f(p(n(y.start),n(y.end),n(y.step)),v)):f(p(y.start,y.end,y.step,v))}function p(h,v,y,S){for(var b=[],_=c(y)?S?a:o:S?l:s,w=h;_(w,v);)b.push(w),w=u(w,y);return b}function d(h){var v=h.split(":"),y=v.map(function(b){return Number(b)}),S=y.some(function(b){return isNaN(b)});if(S)return null;switch(y.length){case 2:return{start:y[0],end:y[1],step:1};case 3:return{start:y[0],end:y[2],step:y[1]};default:return null}}});var R2="reshape",$ne=["typed","isInteger","matrix"],L2=N(R2,$ne,t=>{var{typed:e,isInteger:r}=t;return e(R2,{"Matrix, Array":function(n,o){return n.reshape(o,!0)},"Array, Array":function(n,o){return o.forEach(function(a){if(!r(a))throw new TypeError("Invalid size for dimension: "+a)}),Qp(n,o)}})});var Ine="resize",Fne=["config","matrix"],U2=N(Ine,Fne,t=>{var{config:e,matrix:r}=t;return function(o,a,s){if(arguments.length!==2&&arguments.length!==3)throw new Bo("resize",arguments.length,2,3);if(Je(a)&&(a=a.valueOf()),mt(a[0])&&(a=a.map(function(c){return mt(c)?c.toNumber():c})),Je(o))return o.resize(a,s,!0);if(typeof o=="string")return i(o,a,s);var l=Array.isArray(o)?!1:e.matrix!=="Array";if(a.length===0){for(;Array.isArray(o);)o=o[0];return dt(o)}else{Array.isArray(o)||(o=[o]),o=dt(o);var u=Ta(o,a,s);return l?r(u):u}};function i(n,o,a){if(a!==void 0){if(typeof a!="string"||a.length!==1)throw new TypeError("Single character expected as defaultValue")}else a=" ";if(o.length!==1)throw new $t(o.length,1);var s=o[0];if(typeof s!="number"||!Ge(s))throw new TypeError("Invalid size, must contain positive integers (size: "+Ct(o)+")");if(n.length>s)return n.substring(0,s);if(n.length<s){for(var l=n,u=0,c=s-n.length;u<c;u++)l+=a;return l}else return n}});var z2="rotate",kne=["typed","multiply","rotationMatrix"],V2=N(z2,kne,t=>{var{typed:e,multiply:r,rotationMatrix:i}=t;return e(z2,{"Array , number | BigNumber | Complex | Unit":function(a,s){n(a,2);var l=r(i(s),a);return l.toArray()},"Matrix , number | BigNumber | Complex | Unit":function(a,s){return n(a,2),r(i(s),a)},"Array, number | BigNumber | Complex | Unit, Array | Matrix":function(a,s,l){n(a,3);var u=r(i(s,l),a);return u},"Matrix, number | BigNumber | Complex | Unit, Array | Matrix":function(a,s,l){return n(a,3),r(i(s,l),a)}});function n(o,a){var s=Array.isArray(o)?vt(o):o.size();if(s.length>2)throw new RangeError("Vector must be of dimensions 1x".concat(a));if(s.length===2&&s[1]!==1)throw new RangeError("Vector must be of dimensions 1x".concat(a));if(s[0]!==a)throw new RangeError("Vector must be of dimensions 1x".concat(a))}});var q2="rotationMatrix",Pne=["typed","config","multiplyScalar","addScalar","unaryMinus","norm","matrix","BigNumber","DenseMatrix","SparseMatrix","cos","sin"],j2=N(q2,Pne,t=>{var{typed:e,config:r,multiplyScalar:i,addScalar:n,unaryMinus:o,norm:a,BigNumber:s,matrix:l,DenseMatrix:u,SparseMatrix:c,cos:f,sin:m}=t;return e(q2,{"":function(){return r.matrix==="Matrix"?l([]):[]},string:function(b){return l(b)},"number | BigNumber | Complex | Unit":function(b){return p(b,r.matrix==="Matrix"?"dense":void 0)},"number | BigNumber | Complex | Unit, string":function(b,_){return p(b,_)},"number | BigNumber | Complex | Unit, Array":function(b,_){var w=l(_);return d(w),y(b,w,void 0)},"number | BigNumber | Complex | Unit, Matrix":function(b,_){d(_);var w=_.storage()||(r.matrix==="Matrix"?"dense":void 0);return y(b,_,w)},"number | BigNumber | Complex | Unit, Array, string":function(b,_,w){var x=l(_);return d(x),y(b,x,w)},"number | BigNumber | Complex | Unit, Matrix, string":function(b,_,w){return d(_),y(b,_,w)}});function p(S,b){var _=mt(S),w=_?new s(-1):-1,x=f(S),E=m(S),T=[[x,i(w,E)],[E,x]];return v(T,b)}function d(S){var b=S.size();if(b.length<1||b[0]!==3)throw new RangeError("Vector must be of dimensions 1x3")}function h(S){return S.reduce((b,_)=>i(b,_))}function v(S,b){if(b){if(b==="sparse")return new c(S);if(b==="dense")return new u(S);throw new TypeError('Unknown matrix type "'.concat(b,'"'))}return S}function y(S,b,_){var w=a(b);if(w===0)throw new RangeError("Rotation around zero vector");var x=mt(S)?s:null,E=x?new x(1):1,T=x?new x(-1):-1,D=x?new x(b.get([0])/w):b.get([0])/w,M=x?new x(b.get([1])/w):b.get([1])/w,C=x?new x(b.get([2])/w):b.get([2])/w,$=f(S),O=n(E,o($)),R=m(S),L=n($,h([D,D,O])),k=n(h([D,M,O]),h([T,C,R])),V=n(h([D,C,O]),h([M,R])),J=n(h([D,M,O]),h([C,R])),W=n($,h([M,M,O])),Q=n(h([M,C,O]),h([T,D,R])),ie=n(h([D,C,O]),h([T,M,R])),B=n(h([M,C,O]),h([D,R])),Z=n($,h([C,C,O])),q=[[L,k,V],[J,W,Q],[ie,B,Z]];return v(q,_)}});var Z2="row",Bne=["typed","Index","matrix","range"],Cy=N(Z2,Bne,t=>{var{typed:e,Index:r,matrix:i,range:n}=t;return e(Z2,{"Matrix, number":o,"Array, number":function(s,l){return o(i(dt(s)),l).valueOf()}});function o(a,s){if(a.size().length!==2)throw new Error("Only two dimensional matrix is supported");Mr(s,a.size()[0]);var l=n(0,a.size()[1]),u=new r(s,l),c=a.subset(u);return Je(c)?c:i([[c]])}});var G2="size",One=["typed","config","?matrix"],W2=N(G2,One,t=>{var{typed:e,config:r,matrix:i}=t;return e(G2,{Matrix:function(o){return o.create(o.size(),"number")},Array:vt,string:function(o){return r.matrix==="Array"?[o.length]:i([o.length],"dense","number")},"number | Complex | BigNumber | Unit | boolean | null":function(o){return r.matrix==="Array"?[]:i?i([],"dense","number"):Ny()}})});var H2="squeeze",Rne=["typed"],Y2=N(H2,Rne,t=>{var{typed:e}=t;return e(H2,{Array:function(i){return Zc(dt(i))},Matrix:function(i){var n=Zc(i.toArray());return Array.isArray(n)?i.create(n,i.datatype()):n},any:function(i){return dt(i)}})});var J2="subset",Lne=["typed","matrix","zeros","add"],$y=N(J2,Lne,t=>{var{typed:e,matrix:r,zeros:i,add:n}=t;return e(J2,{"Matrix, Index":function(s,l){return _l(l)?r():(Kp(s,l),s.subset(l))},"Array, Index":e.referTo("Matrix, Index",function(a){return function(s,l){var u=a(r(s),l);return l.isScalar()?u:u.valueOf()}}),"Object, Index":zne,"string, Index":Une,"Matrix, Index, any, any":function(s,l,u,c){return _l(l)?s:(Kp(s,l),s.clone().subset(l,o(u,l),c))},"Array, Index, any, any":e.referTo("Matrix, Index, any, any",function(a){return function(s,l,u,c){var f=a(r(s),l,u,c);return f.isMatrix?f.valueOf():f}}),"Array, Index, any":e.referTo("Matrix, Index, any, any",function(a){return function(s,l,u){return a(r(s),l,u,void 0).valueOf()}}),"Matrix, Index, any":e.referTo("Matrix, Index, any, any",function(a){return function(s,l,u){return a(s,l,u,void 0)}}),"string, Index, string":X2,"string, Index, string, string":X2,"Object, Index, any":Vne});function o(a,s){if(typeof a=="string")throw new Error("can't boradcast a string");if(s._isScalar)return a;var l=s.size();if(l.every(u=>u>0))try{return n(a,i(l))}catch{return a}else return a}});function Une(t,e){if(!Xa(e))throw new TypeError("Index expected");if(_l(e))return"";if(Kp(Array.from(t),e),e.size().length!==1)throw new $t(e.size().length,1);var r=t.length;Mr(e.min()[0],r),Mr(e.max()[0],r);var i=e.dimension(0),n="";return i.forEach(function(o){n+=t.charAt(o)}),n}function X2(t,e,r,i){if(!e||e.isIndex!==!0)throw new TypeError("Index expected");if(_l(e))return t;if(Kp(Array.from(t),e),e.size().length!==1)throw new $t(e.size().length,1);if(i!==void 0){if(typeof i!="string"||i.length!==1)throw new TypeError("Single character expected as defaultValue")}else i=" ";var n=e.dimension(0),o=n.size()[0];if(o!==r.length)throw new $t(n.size()[0],r.length);var a=t.length;Mr(e.min()[0]),Mr(e.max()[0]);for(var s=[],l=0;l<a;l++)s[l]=t.charAt(l);if(n.forEach(function(f,m){s[f]=r.charAt(m[0])}),s.length>a)for(var u=a-1,c=s.length;u<c;u++)s[u]||(s[u]=i);return s.join("")}function zne(t,e){if(!_l(e)){if(e.size().length!==1)throw new $t(e.size(),1);var r=e.dimension(0);if(typeof r!="string")throw new TypeError("String expected as index to retrieve an object property");return Yr(t,r)}}function Vne(t,e,r){if(_l(e))return t;if(e.size().length!==1)throw new $t(e.size(),1);var i=e.dimension(0);if(typeof i!="string")throw new TypeError("String expected as index to retrieve an object property");var n=dt(t);return Ha(n,i,r),n}var K2="transpose",qne=["typed","matrix"],Q2=N(K2,qne,t=>{var{typed:e,matrix:r}=t;return e(K2,{Array:a=>i(r(a)).valueOf(),Matrix:i,any:dt});function i(a){var s=a.size(),l;switch(s.length){case 1:l=a.clone();break;case 2:{var u=s[0],c=s[1];if(c===0)throw new RangeError("Cannot transpose a 2D matrix with no columns (size: "+Ct(s)+")");switch(a.storage()){case"dense":l=n(a,u,c);break;case"sparse":l=o(a,u,c);break}}break;default:throw new RangeError("Matrix must be a vector or two dimensional (size: "+Ct(s)+")")}return l}function n(a,s,l){for(var u=a._data,c=[],f,m=0;m<l;m++){f=c[m]=[];for(var p=0;p<s;p++)f[p]=dt(u[p][m])}return a.createDenseMatrix({data:c,size:[l,s],datatype:a._datatype})}function o(a,s,l){for(var u=a._values,c=a._index,f=a._ptr,m=u?[]:void 0,p=[],d=[],h=[],v=0;v<s;v++)h[v]=0;var y,S,b;for(y=0,S=c.length;y<S;y++)h[c[y]]++;for(var _=0,w=0;w<s;w++)d.push(_),_+=h[w],h[w]=d[w];for(d.push(_),b=0;b<l;b++)for(var x=f[b],E=f[b+1],T=x;T<E;T++){var D=h[c[T]]++;p[D]=b,u&&(m[D]=dt(u[T]))}return a.createSparseMatrix({values:m,index:p,ptr:d,size:[l,s],datatype:a._datatype})}});var eB="ctranspose",jne=["typed","transpose","conj"],tB=N(eB,jne,t=>{var{typed:e,transpose:r,conj:i}=t;return e(eB,{any:function(o){return i(r(o))}})});var rB="zeros",Zne=["typed","config","matrix","BigNumber"],nB=N(rB,Zne,t=>{var{typed:e,config:r,matrix:i,BigNumber:n}=t;return e(rB,{"":function(){return r.matrix==="Array"?o([]):o([],"default")},"...number | BigNumber | string":function(u){var c=u[u.length-1];if(typeof c=="string"){var f=u.pop();return o(u,f)}else return r.matrix==="Array"?o(u):o(u,"default")},Array:o,Matrix:function(u){var c=u.storage();return o(u.valueOf(),c)},"Array | Matrix, string":function(u,c){return o(u.valueOf(),c)}});function o(l,u){var c=a(l),f=c?new n(0):0;if(s(l),u){var m=i(u);return l.length>0?m.resize(l,f):m}else{var p=[];return l.length>0?Ta(p,l,f):p}}function a(l){var u=!1;return l.forEach(function(c,f,m){mt(c)&&(u=!0,m[f]=c.toNumber())}),u}function s(l){l.forEach(function(u){if(typeof u!="number"||!Ge(u)||u<0)throw new Error("Parameters in function zeros must be positive integers")})}});var iB="fft",Gne=["typed","matrix","addScalar","multiplyScalar","divideScalar","exp","tau","i","dotDivide","conj","pow","ceil","log2"],oB=N(iB,Gne,t=>{var{typed:e,matrix:r,addScalar:i,multiplyScalar:n,divideScalar:o,exp:a,tau:s,i:l,dotDivide:u,conj:c,pow:f,ceil:m,log2:p}=t;return e(iB,{Array:d,Matrix:function(b){return b.create(d(b.valueOf()),b.datatype())}});function d(S){var b=vt(S);return b.length===1?y(S,b[0]):h(S.map(_=>d(_,b.slice(1))),0)}function h(S,b){var _=vt(S);if(b!==0)return new Array(_[0]).fill(0).map((x,E)=>h(S[E],b-1));if(_.length===1)return y(S);function w(x){var E=vt(x);return new Array(E[1]).fill(0).map((T,D)=>new Array(E[0]).fill(0).map((M,C)=>x[C][D]))}return w(h(w(S),1))}function v(S){for(var b=S.length,_=a(o(n(-1,n(l,s)),b)),w=[],x=1-b;x<b;x++)w.push(f(_,o(f(x,2),2)));for(var E=f(2,m(p(b+b-1))),T=[...new Array(b).fill(0).map((k,V)=>n(S[V],w[b-1+V])),...new Array(E-b).fill(0)],D=[...new Array(b+b-1).fill(0).map((k,V)=>o(1,w[V])),...new Array(E-(b+b-1)).fill(0)],M=y(T),C=y(D),$=new Array(E).fill(0).map((k,V)=>n(M[V],C[V])),O=u(c(d(c($))),E),R=[],L=b-1;L<b+b-1;L++)R.push(n(O[L],w[L]));return R}function y(S){var b=S.length;if(b===1)return[S[0]];if(b%2===0){for(var _=[...y(S.filter((T,D)=>D%2===0),b/2),...y(S.filter((T,D)=>D%2===1),b/2)],w=0;w<b/2;w++){var x=_[w],E=n(_[w+b/2],a(n(n(s,l),o(-w,b))));_[w]=i(x,E),_[w+b/2]=i(x,n(-1,E))}return _}else return v(S)}});var aB="ifft",Wne=["typed","fft","dotDivide","conj"],sB=N(aB,Wne,t=>{var{typed:e,fft:r,dotDivide:i,conj:n}=t;return e(aB,{"Array | Matrix":function(a){var s=Je(a)?a.size():vt(a);return i(n(r(n(a))),s.reduce((l,u)=>l*u,1))}})});function Dl(t){"@babel/helpers - typeof";return Dl=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(e){return typeof e}:function(e){return e&&typeof Symbol=="function"&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},Dl(t)}function uB(t,e){if(Dl(t)!="object"||!t)return t;var r=t[Symbol.toPrimitive];if(r!==void 0){var i=r.call(t,e||"default");if(Dl(i)!="object")return i;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(t)}function lB(t){var e=uB(t,"string");return Dl(e)=="symbol"?e:e+""}function dr(t,e,r){return(e=lB(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function cB(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter(function(n){return Object.getOwnPropertyDescriptor(t,n).enumerable})),r.push.apply(r,i)}return r}function Hne(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?cB(Object(r),!0).forEach(function(i){dr(t,i,r[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):cB(Object(r)).forEach(function(i){Object.defineProperty(t,i,Object.getOwnPropertyDescriptor(r,i))})}return t}var Yne="solveODE",Jne=["typed","add","subtract","multiply","divide","max","map","abs","isPositive","isNegative","larger","smaller","matrix","bignumber","unaryMinus"],fB=N(Yne,Jne,t=>{var{typed:e,add:r,subtract:i,multiply:n,divide:o,max:a,map:s,abs:l,isPositive:u,isNegative:c,larger:f,smaller:m,matrix:p,bignumber:d,unaryMinus:h}=t;function v(T){return function(D,M,C,$){var O=!(M.length===2&&(M.every(x)||M.every(En)));if(O)throw new Error('"tspan" must be an Array of two numeric values or two units [tStart, tEnd]');var R=M[0],L=M[1],k=f(L,R),V=$.firstStep;if(V!==void 0&&!u(V))throw new Error('"firstStep" must be positive');var J=$.maxStep;if(J!==void 0&&!u(J))throw new Error('"maxStep" must be positive');var W=$.minStep;if(W&&c(W))throw new Error('"minStep" must be positive or zero');var Q=[R,L,V,W,J].filter(De=>De!==void 0);if(!(Q.every(x)||Q.every(En)))throw new Error('Inconsistent type of "t" dependant variables');for(var ie=1,B=$.tol?$.tol:1e-4,Z=$.minDelta?$.minDelta:.2,q=$.maxDelta?$.maxDelta:5,xe=$.maxIter?$.maxIter:1e4,de=[R,L,...C,J,W].some(mt),[be,G,K,re]=de?[d(T.a),d(T.c),d(T.b),d(T.bp)]:[T.a,T.c,T.b,T.bp],ae=V?k?V:h(V):o(i(L,R),ie),le=[R],Se=[C],_e=i(K,re),Oe=0,st=0,yt=_(k),Qe=w(k);yt(le[Oe],L);){var ut=[];ae=Qe(le[Oe],L,ae),ut.push(D(le[Oe],Se[Oe]));for(var H=1;H<G.length;++H)ut.push(D(r(le[Oe],n(G[H],ae)),r(Se[Oe],n(ae,be[H],ut))));var oe=a(l(s(n(_e,ut),De=>En(De)?De.value:De)));oe<B&&B/oe>1/4&&(le.push(r(le[Oe],ae)),Se.push(r(Se[Oe],n(ae,K,ut))),Oe++);var ve=.84*(B/oe)**(1/5);if(m(ve,Z)?ve=Z:f(ve,q)&&(ve=q),ve=de?d(ve):ve,ae=n(ae,ve),J&&f(l(ae),J)?ae=k?J:h(J):W&&m(l(ae),W)&&(ae=k?W:h(W)),st++,st>xe)throw new Error("Maximum number of iterations reached, try changing options")}return{t:le,y:Se}}}function y(T,D,M,C){var $=[[],[.5],[0,.75],[.2222222222222222,.3333333333333333,.4444444444444444]],O=[null,1/2,3/4,1],R=[2/9,1/3,4/9,0],L=[7/24,1/4,1/3,1/8],k={a:$,c:O,b:R,bp:L};return v(k)(T,D,M,C)}function S(T,D,M,C){var $=[[],[.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]],O=[null,1/5,3/10,4/5,8/9,1,1],R=[35/384,0,500/1113,125/192,-2187/6784,11/84,0],L=[5179/57600,0,7571/16695,393/640,-92097/339200,187/2100,1/40],k={a:$,c:O,b:R,bp:L};return v(k)(T,D,M,C)}function b(T,D,M,C){var $=C.method?C.method:"RK45",O={RK23:y,RK45:S};if($.toUpperCase()in O){var R=Hne({},C);return delete R.method,O[$.toUpperCase()](T,D,M,R)}else{var L=Object.keys(O).map(V=>'"'.concat(V,'"')),k="".concat(L.slice(0,-1).join(", ")," and ").concat(L.slice(-1));throw new Error('Unavailable method "'.concat($,'". Available methods are ').concat(k))}}function _(T){return T?m:f}function w(T){var D=T?f:m;return function(M,C,$){var O=r(M,$);return D(O,C)?i(C,M):$}}function x(T){return mt(T)||Et(T)}function E(T,D,M,C){var $=b(T,D.toArray(),M.toArray(),C);return{t:p($.t),y:p($.y)}}return e("solveODE",{"function, Array, Array, Object":b,"function, Matrix, Matrix, Object":E,"function, Array, Array":(T,D,M)=>b(T,D,M,{}),"function, Matrix, Matrix":(T,D,M)=>E(T,D,M,{}),"function, Array, number | BigNumber | Unit":(T,D,M)=>{var C=b(T,D,[M],{});return{t:C.t,y:C.y.map($=>$[0])}},"function, Matrix, number | BigNumber | Unit":(T,D,M)=>{var C=b(T,D.toArray(),[M],{});return{t:p(C.t),y:p(C.y.map($=>$[0]))}},"function, Array, number | BigNumber | Unit, Object":(T,D,M,C)=>{var $=b(T,D,[M],C);return{t:$.t,y:$.y.map(O=>O[0])}},"function, Matrix, number | BigNumber | Unit, Object":(T,D,M,C)=>{var $=b(T,D.toArray(),[M],C);return{t:p($.t),y:p($.y.map(O=>O[0]))}}})});var Xne="erf",Kne=["typed"],pB=N(Xne,Kne,t=>{var{typed:e}=t;return e("name",{number:function(a){var s=Math.abs(a);return s>=tie?ra(a):s<=Qne?ra(a)*r(s):s<=4?ra(a)*(1-i(s)):ra(a)*(1-n(s))},"Array | Matrix":e.referToSelf(o=>a=>it(a,o))});function r(o){var a=o*o,s=Xs[0][4]*a,l=a,u;for(u=0;u<3;u+=1)s=(s+Xs[0][u])*a,l=(l+tf[0][u])*a;return o*(s+Xs[0][3])/(l+tf[0][3])}function i(o){var a=Xs[1][8]*o,s=o,l;for(l=0;l<7;l+=1)a=(a+Xs[1][l])*o,s=(s+tf[1][l])*o;var u=(a+Xs[1][7])/(s+tf[1][7]),c=parseInt(o*16)/16,f=(o-c)*(o+c);return Math.exp(-c*c)*Math.exp(-f)*u}function n(o){var a=1/(o*o),s=Xs[2][5]*a,l=a,u;for(u=0;u<4;u+=1)s=(s+Xs[2][u])*a,l=(l+tf[2][u])*a;var c=a*(s+Xs[2][4])/(l+tf[2][4]);c=(eie-c)/o,a=parseInt(o*16)/16;var f=(o-a)*(o+a);return Math.exp(-a*a)*Math.exp(-f)*c}}),Qne=.46875,eie=.5641895835477563,Xs=[[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]],tf=[[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]],tie=Math.pow(2,53);var mB="zeta",rie=["typed","config","multiply","pow","divide","factorial","equal","smallerEq","isNegative","gamma","sin","subtract","add","?Complex","?BigNumber","pi"],dB=N(mB,rie,t=>{var{typed:e,config:r,multiply:i,pow:n,divide:o,factorial:a,equal:s,smallerEq:l,isNegative:u,gamma:c,sin:f,subtract:m,add:p,Complex:d,BigNumber:h,pi:v}=t;return e(mB,{number:x=>y(x,E=>E,()=>20),BigNumber:x=>y(x,E=>new h(E),()=>Math.abs(Math.log10(r.relTol))),Complex:S});function y(x,E,T){return s(x,0)?E(-.5):s(x,1)?E(NaN):isFinite(x)?b(x,E,T,D=>D):u(x)?E(NaN):E(1)}function S(x){return x.re===0&&x.im===0?new d(-.5):x.re===1?new d(NaN,NaN):x.re===1/0&&x.im===0?new d(1):x.im===1/0||x.re===-1/0?new d(NaN,NaN):b(x,E=>E,E=>Math.round(1.3*15+.9*Math.abs(E.im)),E=>E.re)}function b(x,E,T,D){var M=T(x);if(D(x)>-(M-1)/2)return w(x,E(M),E);var C=i(n(2,x),n(E(v),m(x,1)));return C=i(C,f(i(o(E(v),2),x))),C=i(C,c(m(1,x))),i(C,b(m(1,x),E,T,D))}function _(x,E){for(var T=x,D=x;l(D,E);D=p(D,1)){var M=o(i(a(p(E,m(D,1))),n(4,D)),i(a(m(E,D)),a(i(2,D))));T=p(T,M)}return i(E,T)}function w(x,E,T){for(var D=o(1,i(_(T(0),E),m(1,n(2,m(1,x))))),M=T(0),C=T(1);l(C,E);C=p(C,1))M=p(M,o(i((-1)**(C-1),_(C,E)),n(C,x)));return i(D,M)}});var hB="mode",nie=["typed","isNaN","isNumeric"],gB=N(hB,nie,t=>{var{typed:e,isNaN:r,isNumeric:i}=t;return e(hB,{"Array | Matrix":n,"...":function(a){return n(a)}});function n(o){o=Ut(o.valueOf());var a=o.length;if(a===0)throw new Error("Cannot calculate mode of an empty array");for(var s={},l=[],u=0,c=0;c<o.length;c++){var f=o[c];if(i(f)&&r(f))throw new Error("Cannot calculate mode of an array containing NaN values");f in s||(s[f]=0),s[f]++,s[f]===u?l.push(f):s[f]>u&&(u=s[f],l=[f])}return l}});function gn(t,e,r){var i;return String(t).includes("Unexpected type")?(i=arguments.length>2?" (type: "+ir(r)+", value: "+JSON.stringify(r)+")":" (type: "+t.data.actual+")",new TypeError("Cannot calculate "+e+", unexpected type of argument"+i)):String(t).includes("complex numbers")?(i=arguments.length>2?" (type: "+ir(r)+", value: "+JSON.stringify(r)+")":"",new TypeError("Cannot calculate "+e+", no ordering relation is defined for complex numbers"+i)):t}var vB="prod",iie=["typed","config","multiplyScalar","numeric"],yB=N(vB,iie,t=>{var{typed:e,config:r,multiplyScalar:i,numeric:n}=t;return e(vB,{"Array | Matrix":o,"Array | Matrix, number | BigNumber":function(s,l){throw new Error("prod(A, dim) is not yet supported")},"...":function(s){return o(s)}});function o(a){var s;if(Zi(a,function(l){try{s=s===void 0?l:i(s,l)}catch(u){throw gn(u,"prod",l)}}),typeof s=="string"&&(s=n(s,Mi(s,r))),s===void 0)throw new Error("Cannot calculate prod of an empty array");return s}});var bB="format",oie=["typed"],xB=N(bB,oie,t=>{var{typed:e}=t;return e(bB,{any:Ct,"any, Object | function | number | BigNumber":Ct})});var _B="bin",aie=["typed","format"],wB=N(_B,aie,t=>{var{typed:e,format:r}=t;return e(_B,{"number | BigNumber":function(n){return r(n,{notation:"bin"})},"number | BigNumber, number | BigNumber":function(n,o){return r(n,{notation:"bin",wordSize:o})}})});var SB="oct",sie=["typed","format"],DB=N(SB,sie,t=>{var{typed:e,format:r}=t;return e(SB,{"number | BigNumber":function(n){return r(n,{notation:"oct"})},"number | BigNumber, number | BigNumber":function(n,o){return r(n,{notation:"oct",wordSize:o})}})});var EB="hex",uie=["typed","format"],AB=N(EB,uie,t=>{var{typed:e,format:r}=t;return e(EB,{"number | BigNumber":function(n){return r(n,{notation:"hex"})},"number | BigNumber, number | BigNumber":function(n,o){return r(n,{notation:"hex",wordSize:o})}})});var Iy=/\$([\w.]+)/g;var TB="print",lie=["typed"],Fy=N(TB,lie,t=>{var{typed:e}=t;return e(TB,{"string, Object | Array":NB,"string, Object | Array, number | Object":NB})});function NB(t,e,r){return t.replace(Iy,function(i,n){var o=n.split("."),a=e[o.shift()];for(a!==void 0&&a.isMatrix&&(a=a.toArray());o.length&&a!==void 0;){var s=o.shift();a=s?a[s]:a+"."}return a!==void 0?Qr(a)?a:Ct(a,r):i})}var MB="to",cie=["typed","matrix","concat"],CB=N(MB,cie,t=>{var{typed:e,matrix:r,concat:i}=t,n=Bt({typed:e,matrix:r,concat:i});return e(MB,{"Unit, Unit | string":(o,a)=>o.to(a)},n({Ds:!0}))});var $B="toBest",fie=["typed"],IB=N($B,fie,t=>{var{typed:e}=t;return e($B,{Unit:r=>r.toBest(),"Unit, string":(r,i)=>r.toBest(i.split(",")),"Unit, string, Object":(r,i,n)=>r.toBest(i.split(","),n),"Unit, Array":(r,i)=>r.toBest(i),"Unit, Array, Object":(r,i,n)=>r.toBest(i,n)})});var FB="isPrime",pie=["typed"],kB=N(FB,pie,t=>{var{typed:e}=t;return e(FB,{number:function(i){if(i<=3)return i>1;if(i%2===0||i%3===0)return!1;for(var n=5;n*n<=i;n+=6)if(i%n===0||i%(n+2)===0)return!1;return!0},bigint:function(i){if(i<=3n)return i>1n;if(i%2n===0n||i%3n===0n)return!1;for(var n=5n;n*n<=i;n+=6n)if(i%n===0n||i%(n+2n)===0n)return!1;return!0},BigNumber:function(i){if(i.lte(3))return i.gt(1);if(i.mod(2).eq(0)||i.mod(3).eq(0))return!1;if(i.lt(Math.pow(2,32))){for(var n=i.toNumber(),o=5;o*o<=n;o+=6)if(n%o===0||n%(o+2)===0)return!1;return!0}function a(S,b,_){for(var w=1;!b.eq(0);)b.mod(2).eq(0)?(b=b.div(2),S=S.mul(S).mod(_)):(b=b.sub(1),w=S.mul(w).mod(_));return w}var s=i.constructor.clone({precision:i.toFixed(0).length*2});i=new s(i);for(var l=0,u=i.sub(1);u.mod(2).eq(0);)u=u.div(2),l+=1;var c=null;if(i.lt("3317044064679887385961981"))c=[2,3,5,7,11,13,17,19,23,29,31,37,41].filter(S=>S<i);else{var f=Math.min(i.toNumber()-2,Math.floor(2*Math.pow(i.toFixed(0).length*Math.log(10),2)));c=[];for(var m=2;m<=f;m+=1)c.push(f)}for(var p=0;p<c.length;p+=1){var d=c[p],h=a(i.sub(i).add(d),u,i);if(!h.eq(1)){for(var v=0,y=h;!y.eq(i.sub(1));v+=1,y=y.mul(y).mod(i))if(v===l-1)return!1}}return!0},"Array | Matrix":e.referToSelf(r=>i=>it(i,r))})});var mie="numeric",die=["number","?bignumber","?fraction"],PB=N(mie,die,t=>{var{number:e,bignumber:r,fraction:i}=t,n={string:!0,number:!0,BigNumber:!0,Fraction:!0},o={number:a=>e(a),BigNumber:r?a=>r(a):ef,bigint:a=>BigInt(a),Fraction:i?a=>i(a):Ty};return function(s){var l=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"number",u=arguments.length>2?arguments[2]:void 0;if(u!==void 0)throw new SyntaxError("numeric() takes one or two arguments");var c=ir(s);if(!(c in n))throw new TypeError("Cannot convert "+s+' of type "'+c+'"; valid input types are '+Object.keys(n).join(", "));if(!(l in o))throw new TypeError("Cannot convert "+s+' to type "'+l+'"; valid output types are '+Object.keys(o).join(", "));return l===c?s:o[l](s)}});var BB="divideScalar",hie=["typed","numeric"],OB=N(BB,hie,t=>{var{typed:e,numeric:r}=t;return e(BB,{"number, number":function(n,o){return n/o},"Complex, Complex":function(n,o){return n.div(o)},"BigNumber, BigNumber":function(n,o){return n.div(o)},"bigint, bigint":function(n,o){return n/o},"Fraction, Fraction":function(n,o){return n.div(o)},"Unit, number | Complex | Fraction | BigNumber | Unit":(i,n)=>i.divide(n),"number | Fraction | Complex | BigNumber, Unit":(i,n)=>n.divideInto(i)})});var RB="pow",gie=["typed","config","identity","multiply","matrix","inv","fraction","number","Complex"],LB=N(RB,gie,t=>{var{typed:e,config:r,identity:i,multiply:n,matrix:o,inv:a,number:s,fraction:l,Complex:u}=t;return e(RB,{"number, number":c,"Complex, Complex":function(d,h){return d.pow(h)},"BigNumber, BigNumber":function(d,h){return h.isInteger()||d>=0||r.predictable?d.pow(h):new u(d.toNumber(),0).pow(h.toNumber(),0)},"bigint, bigint":(p,d)=>p**d,"Fraction, Fraction":function(d,h){var v=d.pow(h);if(v!=null)return v;if(r.predictable)throw new Error("Result of pow is non-rational and cannot be expressed as a fraction");return c(d.valueOf(),h.valueOf())},"Array, number":f,"Array, BigNumber":function(d,h){return f(d,h.toNumber())},"Matrix, number":m,"Matrix, BigNumber":function(d,h){return m(d,h.toNumber())},"Unit, number | BigNumber":function(d,h){return d.pow(h)}});function c(p,d){if(r.predictable&&!Ge(d)&&p<0)try{var h=l(d),v=s(h);if((d===v||Math.abs((d-v)/d)<1e-14)&&h.d%2n===1n)return(h.n%2n===0n?1:-1)*Math.pow(-p,d)}catch{}return r.predictable&&(p<-1&&d===1/0||p>-1&&p<0&&d===-1/0)?NaN:Ge(d)||p>=0||r.predictable?iE(p,d):p*p<1&&d===1/0||p*p>1&&d===-1/0?0:new u(p,0).pow(d,0)}function f(p,d){if(!Ge(d))throw new TypeError("For A^b, b must be an integer (value is "+d+")");var h=vt(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(d<0)try{return f(a(p),-d)}catch(S){throw S.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 "+d+")"):S}for(var v=i(h[0]).valueOf(),y=p;d>=1;)(d&1)===1&&(v=n(y,v)),d>>=1,y=n(y,y);return v}function m(p,d){return o(f(p.valueOf(),d))}});var rf="Number of decimals in function round must be an integer",UB="round",vie=["typed","config","matrix","equalScalar","zeros","BigNumber","DenseMatrix"],zB=N(UB,vie,t=>{var{typed:e,config:r,matrix:i,equalScalar:n,zeros:o,BigNumber:a,DenseMatrix:s}=t,l=Er({typed:e,equalScalar:n}),u=mr({typed:e,DenseMatrix:s}),c=An({typed:e});function f(m){return Math.abs(Uc(m).exponent)}return e(UB,{number:function(p){var d=Yc(p,f(r.relTol)),h=jr(p,d,r.relTol,r.absTol)?d:p;return Yc(h)},"number, number":function(p,d){var h=f(r.relTol);if(d>=h)return Yc(p,d);var v=Yc(p,h),y=jr(p,v,r.relTol,r.absTol)?v:p;return Yc(y,d)},"number, BigNumber":function(p,d){if(!d.isInteger())throw new TypeError(rf);return new a(p).toDecimalPlaces(d.toNumber())},Complex:function(p){return p.round()},"Complex, number":function(p,d){if(d%1)throw new TypeError(rf);return p.round(d)},"Complex, BigNumber":function(p,d){if(!d.isInteger())throw new TypeError(rf);var h=d.toNumber();return p.round(h)},BigNumber:function(p){var d=new a(p).toDecimalPlaces(f(r.relTol)),h=xn(p,d,r.relTol,r.absTol)?d:p;return h.toDecimalPlaces(0)},"BigNumber, BigNumber":function(p,d){if(!d.isInteger())throw new TypeError(rf);var h=f(r.relTol);if(d>=h)return p.toDecimalPlaces(d.toNumber());var v=p.toDecimalPlaces(h),y=xn(p,v,r.relTol,r.absTol)?v:p;return y.toDecimalPlaces(d.toNumber())},bigint:m=>m,"bigint, number":(m,p)=>m,"bigint, BigNumber":(m,p)=>m,Fraction:function(p){return p.round()},"Fraction, number":function(p,d){if(d%1)throw new TypeError(rf);return p.round(d)},"Fraction, BigNumber":function(p,d){if(!d.isInteger())throw new TypeError(rf);return p.round(d.toNumber())},"Unit, number, Unit":e.referToSelf(m=>function(p,d,h){var v=p.toNumeric(h);return h.multiply(m(v,d))}),"Unit, BigNumber, Unit":e.referToSelf(m=>(p,d,h)=>m(p,d.toNumber(),h)),"Array | Matrix, number | BigNumber, Unit":e.referToSelf(m=>(p,d,h)=>it(p,v=>m(v,d,h),!0)),"Array | Matrix | Unit, Unit":e.referToSelf(m=>(p,d)=>m(p,0,d)),"Array | Matrix":e.referToSelf(m=>p=>it(p,m,!0)),"SparseMatrix, number | BigNumber":e.referToSelf(m=>(p,d)=>l(p,d,m,!1)),"DenseMatrix, number | BigNumber":e.referToSelf(m=>(p,d)=>c(p,d,m,!1)),"Array, number | BigNumber":e.referToSelf(m=>(p,d)=>c(i(p),d,m,!1).valueOf()),"number | Complex | BigNumber | Fraction, SparseMatrix":e.referToSelf(m=>(p,d)=>n(p,0)?o(d.size(),d.storage()):u(d,p,m,!0)),"number | Complex | BigNumber | Fraction, DenseMatrix":e.referToSelf(m=>(p,d)=>n(p,0)?o(d.size(),d.storage()):c(d,p,m,!0)),"number | Complex | BigNumber | Fraction, Array":e.referToSelf(m=>(p,d)=>c(i(d),p,m,!0).valueOf())})});var VB="log",yie=["config","typed","typeOf","divideScalar","Complex"],bie=Math.log(16),qB=N(VB,yie,t=>{var{typed:e,typeOf:r,config:i,divideScalar:n,Complex:o}=t;function a(l){return l.log()}function s(l){return a(new o(l,0))}return e(VB,{number:function(u){return u>=0||i.predictable?eE(u):s(u)},bigint:Kc(bie,eE,i,s),Complex:a,BigNumber:function(u){return!u.isNegative()||i.predictable?u.ln():s(u.toNumber())},"any, any":e.referToSelf(l=>(u,c)=>{if(r(u)==="Fraction"&&r(c)==="Fraction"){var f=u.log(c);if(f!==null)return f}return n(l(u),l(c))})})});var jB="log1p",xie=["typed","config","divideScalar","log","Complex"],ZB=N(jB,xie,t=>{var{typed:e,config:r,divideScalar:i,log:n,Complex:o}=t;return e(jB,{number:function(l){return l>=-1||r.predictable?Uv(l):a(new o(l,0))},Complex:a,BigNumber:function(l){var u=l.plus(1);return!u.isNegative()||r.predictable?u.ln():a(new o(l.toNumber(),0))},"Array | Matrix":e.referToSelf(s=>l=>it(l,s)),"any, any":e.referToSelf(s=>(l,u)=>i(s(l),n(u)))});function a(s){var l=s.re+1;return new o(Math.log(Math.sqrt(l*l+s.im*s.im)),Math.atan2(s.im,l))}});var GB="nthRoots",_ie=["config","typed","divideScalar","Complex"],WB=N(GB,_ie,t=>{var{typed:e,config:r,divideScalar:i,Complex:n}=t,o=[function(l){return new n(l,0)},function(l){return new n(0,l)},function(l){return new n(-l,0)},function(l){return new n(0,-l)}];function a(s,l){if(l<0)throw new Error("Root must be greater than zero");if(l===0)throw new Error("Root must be non-zero");if(l%1!==0)throw new Error("Root must be an integer");if(s===0||s.abs()===0)return[new n(0,0)];var u=typeof s=="number",c;(u||s.re===0||s.im===0)&&(u?c=2*+(s<0):s.im===0?c=2*+(s.re<0):c=2*+(s.im<0)+1);for(var f=s.arg(),m=s.abs(),p=[],d=Math.pow(m,1/l),h=0;h<l;h++){var v=(c+4*h)/l;if(v===Math.round(v)){p.push(o[v%4](d));continue}p.push(new n({r:d,phi:(f+2*Math.PI*h)/l}))}return p}return e(GB,{Complex:function(l){return a(l,2)},"Complex, number":a})});var HB="dotPow",wie=["typed","equalScalar","matrix","pow","DenseMatrix","concat","SparseMatrix"],YB=N(HB,wie,t=>{var{typed:e,equalScalar:r,matrix:i,pow:n,DenseMatrix:o,concat:a,SparseMatrix:s}=t,l=Vr({typed:e}),u=Ln({typed:e,SparseMatrix:s}),c=Er({typed:e,equalScalar:r}),f=mr({typed:e,DenseMatrix:o}),m=Bt({typed:e,matrix:i,concat:a}),p={};for(var d in n.signatures)Object.prototype.hasOwnProperty.call(n.signatures,d)&&!d.includes("Matrix")&&!d.includes("Array")&&(p[d]=n.signatures[d]);var h=e(p);return e(HB,m({elop:h,SS:u,DS:l,Ss:c,sS:f}))});var JB="dotDivide",Sie=["typed","matrix","equalScalar","divideScalar","DenseMatrix","concat","SparseMatrix"],XB=N(JB,Sie,t=>{var{typed:e,matrix:r,equalScalar:i,divideScalar:n,DenseMatrix:o,concat:a,SparseMatrix:s}=t,l=Tn({typed:e,equalScalar:i}),u=Vr({typed:e}),c=Ln({typed:e,SparseMatrix:s}),f=Er({typed:e,equalScalar:i}),m=mr({typed:e,DenseMatrix:o}),p=Bt({typed:e,matrix:r,concat:a});return e(JB,p({elop:n,SS:c,DS:u,SD:l,Ss:f,sS:m}))});function rs(t){var{DenseMatrix:e}=t;return function(i,n,o){var a=i.size();if(a.length!==2)throw new RangeError("Matrix must be two dimensional (size: "+Ct(a)+")");var s=a[0],l=a[1];if(s!==l)throw new RangeError("Matrix must be square (size: "+Ct(a)+")");var u=[];if(Je(n)){var c=n.size(),f=n._data;if(c.length===1){if(c[0]!==s)throw new RangeError("Dimension mismatch. Matrix columns must match vector length.");for(var m=0;m<s;m++)u[m]=[f[m]];return new e({data:u,size:[s,1],datatype:n._datatype})}if(c.length===2){if(c[0]!==s||c[1]!==1)throw new RangeError("Dimension mismatch. Matrix columns must match vector length.");if(Zs(n)){if(o){u=[];for(var p=0;p<s;p++)u[p]=[f[p][0]];return new e({data:u,size:[s,1],datatype:n._datatype})}return n}if(Fo(n)){for(var d=0;d<s;d++)u[d]=[0];for(var h=n._values,v=n._index,y=n._ptr,S=y[1],b=y[0];b<S;b++){var _=v[b];u[_][0]=h[b]}return new e({data:u,size:[s,1],datatype:n._datatype})}}throw new RangeError("Dimension mismatch. The right side has to be either 1- or 2-dimensional vector.")}if(sr(n)){var w=vt(n);if(w.length===1){if(w[0]!==s)throw new RangeError("Dimension mismatch. Matrix columns must match vector length.");for(var x=0;x<s;x++)u[x]=[n[x]];return new e({data:u,size:[s,1]})}if(w.length===2){if(w[0]!==s||w[1]!==1)throw new RangeError("Dimension mismatch. Matrix columns must match vector length.");for(var E=0;E<s;E++)u[E]=[n[E][0]];return new e({data:u,size:[s,1]})}throw new RangeError("Dimension mismatch. The right side has to be either 1- or 2-dimensional vector.")}}}var KB="lsolve",Die=["typed","matrix","divideScalar","multiplyScalar","subtractScalar","equalScalar","DenseMatrix"],QB=N(KB,Die,t=>{var{typed:e,matrix:r,divideScalar:i,multiplyScalar:n,subtractScalar:o,equalScalar:a,DenseMatrix:s}=t,l=rs({DenseMatrix:s});return e(KB,{"SparseMatrix, Array | Matrix":function(m,p){return c(m,p)},"DenseMatrix, Array | Matrix":function(m,p){return u(m,p)},"Array, Array | Matrix":function(m,p){var d=r(m),h=u(d,p);return h.valueOf()}});function u(f,m){m=l(f,m,!0);for(var p=m._data,d=f._size[0],h=f._size[1],v=[],y=f._data,S=0;S<h;S++){var b=p[S][0]||0,_=void 0;if(a(b,0))_=0;else{var w=y[S][S];if(a(w,0))throw new Error("Linear system cannot be solved since matrix is singular");_=i(b,w);for(var x=S+1;x<d;x++)p[x]=[o(p[x][0]||0,n(_,y[x][S]))]}v[S]=[_]}return new s({data:v,size:[d,1]})}function c(f,m){m=l(f,m,!0);for(var p=m._data,d=f._size[0],h=f._size[1],v=f._values,y=f._index,S=f._ptr,b=[],_=0;_<h;_++){var w=p[_][0]||0;if(a(w,0))b[_]=[0];else{for(var x=0,E=[],T=[],D=S[_],M=S[_+1],C=D;C<M;C++){var $=y[C];$===_?x=v[C]:$>_&&(E.push(v[C]),T.push($))}if(a(x,0))throw new Error("Linear system cannot be solved since matrix is singular");for(var O=i(w,x),R=0,L=T.length;R<L;R++){var k=T[R];p[k]=[o(p[k][0]||0,n(O,E[R]))]}b[_]=[O]}}return new s({data:b,size:[d,1]})}});var eO="usolve",Eie=["typed","matrix","divideScalar","multiplyScalar","subtractScalar","equalScalar","DenseMatrix"],tO=N(eO,Eie,t=>{var{typed:e,matrix:r,divideScalar:i,multiplyScalar:n,subtractScalar:o,equalScalar:a,DenseMatrix:s}=t,l=rs({DenseMatrix:s});return e(eO,{"SparseMatrix, Array | Matrix":function(m,p){return c(m,p)},"DenseMatrix, Array | Matrix":function(m,p){return u(m,p)},"Array, Array | Matrix":function(m,p){var d=r(m),h=u(d,p);return h.valueOf()}});function u(f,m){m=l(f,m,!0);for(var p=m._data,d=f._size[0],h=f._size[1],v=[],y=f._data,S=h-1;S>=0;S--){var b=p[S][0]||0,_=void 0;if(a(b,0))_=0;else{var w=y[S][S];if(a(w,0))throw new Error("Linear system cannot be solved since matrix is singular");_=i(b,w);for(var x=S-1;x>=0;x--)p[x]=[o(p[x][0]||0,n(_,y[x][S]))]}v[S]=[_]}return new s({data:v,size:[d,1]})}function c(f,m){m=l(f,m,!0);for(var p=m._data,d=f._size[0],h=f._size[1],v=f._values,y=f._index,S=f._ptr,b=[],_=h-1;_>=0;_--){var w=p[_][0]||0;if(a(w,0))b[_]=[0];else{for(var x=0,E=[],T=[],D=S[_],M=S[_+1],C=M-1;C>=D;C--){var $=y[C];$===_?x=v[C]:$<_&&(E.push(v[C]),T.push($))}if(a(x,0))throw new Error("Linear system cannot be solved since matrix is singular");for(var O=i(w,x),R=0,L=T.length;R<L;R++){var k=T[R];p[k]=[o(p[k][0],n(O,E[R]))]}b[_]=[O]}}return new s({data:b,size:[d,1]})}});var rO="lsolveAll",Aie=["typed","matrix","divideScalar","multiplyScalar","subtractScalar","equalScalar","DenseMatrix"],nO=N(rO,Aie,t=>{var{typed:e,matrix:r,divideScalar:i,multiplyScalar:n,subtractScalar:o,equalScalar:a,DenseMatrix:s}=t,l=rs({DenseMatrix:s});return e(rO,{"SparseMatrix, Array | Matrix":function(m,p){return c(m,p)},"DenseMatrix, Array | Matrix":function(m,p){return u(m,p)},"Array, Array | Matrix":function(m,p){var d=r(m),h=u(d,p);return h.map(v=>v.valueOf())}});function u(f,m){for(var p=[l(f,m,!0)._data.map(T=>T[0])],d=f._data,h=f._size[0],v=f._size[1],y=0;y<v;y++)for(var S=p.length,b=0;b<S;b++){var _=p[b];if(a(d[y][y],0))if(a(_[y],0)){if(b===0){var x=[..._];x[y]=1;for(var E=y+1;E<v;E++)x[E]=o(x[E],d[E][y]);p.push(x)}}else{if(b===0)return[];p.splice(b,1),b-=1,S-=1}else{_[y]=i(_[y],d[y][y]);for(var w=y+1;w<v;w++)_[w]=o(_[w],n(_[y],d[w][y]))}}return p.map(T=>new s({data:T.map(D=>[D]),size:[h,1]}))}function c(f,m){for(var p=[l(f,m,!0)._data.map(ie=>ie[0])],d=f._size[0],h=f._size[1],v=f._values,y=f._index,S=f._ptr,b=0;b<h;b++)for(var _=p.length,w=0;w<_;w++){for(var x=p[w],E=[],T=[],D=S[b],M=S[b+1],C=0,$=D;$<M;$++){var O=y[$];O===b?C=v[$]:O>b&&(E.push(v[$]),T.push(O))}if(a(C,0))if(a(x[b],0)){if(w===0){var V=[...x];V[b]=1;for(var J=0,W=T.length;J<W;J++){var Q=T[J];V[Q]=o(V[Q],E[J])}p.push(V)}}else{if(w===0)return[];p.splice(w,1),w-=1,_-=1}else{x[b]=i(x[b],C);for(var R=0,L=T.length;R<L;R++){var k=T[R];x[k]=o(x[k],n(x[b],E[R]))}}}return p.map(ie=>new s({data:ie.map(B=>[B]),size:[d,1]}))}});var iO="usolveAll",Tie=["typed","matrix","divideScalar","multiplyScalar","subtractScalar","equalScalar","DenseMatrix"],oO=N(iO,Tie,t=>{var{typed:e,matrix:r,divideScalar:i,multiplyScalar:n,subtractScalar:o,equalScalar:a,DenseMatrix:s}=t,l=rs({DenseMatrix:s});return e(iO,{"SparseMatrix, Array | Matrix":function(m,p){return c(m,p)},"DenseMatrix, Array | Matrix":function(m,p){return u(m,p)},"Array, Array | Matrix":function(m,p){var d=r(m),h=u(d,p);return h.map(v=>v.valueOf())}});function u(f,m){for(var p=[l(f,m,!0)._data.map(T=>T[0])],d=f._data,h=f._size[0],v=f._size[1],y=v-1;y>=0;y--)for(var S=p.length,b=0;b<S;b++){var _=p[b];if(a(d[y][y],0))if(a(_[y],0)){if(b===0){var x=[..._];x[y]=1;for(var E=y-1;E>=0;E--)x[E]=o(x[E],d[E][y]);p.push(x)}}else{if(b===0)return[];p.splice(b,1),b-=1,S-=1}else{_[y]=i(_[y],d[y][y]);for(var w=y-1;w>=0;w--)_[w]=o(_[w],n(_[y],d[w][y]))}}return p.map(T=>new s({data:T.map(D=>[D]),size:[h,1]}))}function c(f,m){for(var p=[l(f,m,!0)._data.map(ie=>ie[0])],d=f._size[0],h=f._size[1],v=f._values,y=f._index,S=f._ptr,b=h-1;b>=0;b--)for(var _=p.length,w=0;w<_;w++){for(var x=p[w],E=[],T=[],D=S[b],M=S[b+1],C=0,$=M-1;$>=D;$--){var O=y[$];O===b?C=v[$]:O<b&&(E.push(v[$]),T.push(O))}if(a(C,0))if(a(x[b],0)){if(w===0){var V=[...x];V[b]=1;for(var J=0,W=T.length;J<W;J++){var Q=T[J];V[Q]=o(V[Q],E[J])}p.push(V)}}else{if(w===0)return[];p.splice(w,1),w-=1,_-=1}else{x[b]=i(x[b],C);for(var R=0,L=T.length;R<L;R++){var k=T[R];x[k]=o(x[k],n(x[b],E[R]))}}}return p.map(ie=>new s({data:ie.map(B=>[B]),size:[d,1]}))}});var Nie="matAlgo08xS0Sid",Mie=["typed","equalScalar"],nf=N(Nie,Mie,t=>{var{typed:e,equalScalar:r}=t;return function(n,o,a){var s=n._values,l=n._index,u=n._ptr,c=n._size,f=n._datatype||n._data===void 0?n._datatype:n.getDataType(),m=o._values,p=o._index,d=o._ptr,h=o._size,v=o._datatype||o._data===void 0?o._datatype:o.getDataType();if(c.length!==h.length)throw new $t(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(!s||!m)throw new Error("Cannot perform operation on Pattern Sparse Matrices");var y=c[0],S=c[1],b,_=r,w=0,x=a;typeof f=="string"&&f===v&&f!=="mixed"&&(b=f,_=e.find(r,[b,b]),w=e.convert(0,b),x=e.find(a,[b,b]));for(var E=[],T=[],D=[],M=[],C=[],$,O,R,L,k=0;k<S;k++){D[k]=T.length;var V=k+1;for(O=u[k],R=u[k+1],$=O;$<R;$++)L=l[$],C[L]=V,M[L]=s[$],T.push(L);for(O=d[k],R=d[k+1],$=O;$<R;$++)L=p[$],C[L]===V&&(M[L]=x(M[L],m[$]));for($=D[k];$<T.length;){L=T[$];var J=M[L];_(J,w)?T.splice($,1):(E.push(J),$++)}}return D[S]=T.length,n.createSparseMatrix({values:E,index:T,ptr:D,size:[y,S],datatype:f===n._datatype&&v===o._datatype?b:void 0})}});var of=N("useMatrixForArrayScalar",["typed","matrix"],t=>{var{typed:e,matrix:r}=t;return{"Array, number":e.referTo("DenseMatrix, number",i=>(n,o)=>i(r(n),o).valueOf()),"Array, BigNumber":e.referTo("DenseMatrix, BigNumber",i=>(n,o)=>i(r(n),o).valueOf()),"number, Array":e.referTo("number, DenseMatrix",i=>(n,o)=>i(n,r(o)).valueOf()),"BigNumber, Array":e.referTo("BigNumber, DenseMatrix",i=>(n,o)=>i(n,r(o)).valueOf())}});var aO="leftShift",Cie=["typed","matrix","equalScalar","zeros","DenseMatrix","concat"],sO=N(aO,Cie,t=>{var{typed:e,matrix:r,equalScalar:i,zeros:n,DenseMatrix:o,concat:a}=t,s=Ii({typed:e}),l=Tn({typed:e,equalScalar:i}),u=nf({typed:e,equalScalar:i}),c=mo({typed:e,DenseMatrix:o}),f=Er({typed:e,equalScalar:i}),m=An({typed:e}),p=Bt({typed:e,matrix:r,concat:a}),d=of({typed:e,matrix:r});return e(aO,{"number, number":lE,"BigNumber, BigNumber":XP,"bigint, bigint":(h,v)=>h<<v,"SparseMatrix, number | BigNumber":e.referToSelf(h=>(v,y)=>i(y,0)?v.clone():f(v,y,h,!1)),"DenseMatrix, number | BigNumber":e.referToSelf(h=>(v,y)=>i(y,0)?v.clone():m(v,y,h,!1)),"number | BigNumber, SparseMatrix":e.referToSelf(h=>(v,y)=>i(v,0)?n(y.size(),y.storage()):c(y,v,h,!0)),"number | BigNumber, DenseMatrix":e.referToSelf(h=>(v,y)=>i(v,0)?n(y.size(),y.storage()):m(y,v,h,!0))},d,p({SS:u,DS:s,SD:l}))});var uO="rightArithShift",$ie=["typed","matrix","equalScalar","zeros","DenseMatrix","concat"],lO=N(uO,$ie,t=>{var{typed:e,matrix:r,equalScalar:i,zeros:n,DenseMatrix:o,concat:a}=t,s=Ii({typed:e}),l=Tn({typed:e,equalScalar:i}),u=nf({typed:e,equalScalar:i}),c=mo({typed:e,DenseMatrix:o}),f=Er({typed:e,equalScalar:i}),m=An({typed:e}),p=Bt({typed:e,matrix:r,concat:a}),d=of({typed:e,matrix:r});return e(uO,{"number, number":cE,"BigNumber, BigNumber":KP,"bigint, bigint":(h,v)=>h>>v,"SparseMatrix, number | BigNumber":e.referToSelf(h=>(v,y)=>i(y,0)?v.clone():f(v,y,h,!1)),"DenseMatrix, number | BigNumber":e.referToSelf(h=>(v,y)=>i(y,0)?v.clone():m(v,y,h,!1)),"number | BigNumber, SparseMatrix":e.referToSelf(h=>(v,y)=>i(v,0)?n(y.size(),y.storage()):c(y,v,h,!0)),"number | BigNumber, DenseMatrix":e.referToSelf(h=>(v,y)=>i(v,0)?n(y.size(),y.storage()):m(y,v,h,!0))},d,p({SS:u,DS:s,SD:l}))});var cO="rightLogShift",Iie=["typed","matrix","equalScalar","zeros","DenseMatrix","concat"],fO=N(cO,Iie,t=>{var{typed:e,matrix:r,equalScalar:i,zeros:n,DenseMatrix:o,concat:a}=t,s=Ii({typed:e}),l=Tn({typed:e,equalScalar:i}),u=nf({typed:e,equalScalar:i}),c=mo({typed:e,DenseMatrix:o}),f=Er({typed:e,equalScalar:i}),m=An({typed:e}),p=Bt({typed:e,matrix:r,concat:a}),d=of({typed:e,matrix:r});return e(cO,{"number, number":fE,"SparseMatrix, number | BigNumber":e.referToSelf(h=>(v,y)=>i(y,0)?v.clone():f(v,y,h,!1)),"DenseMatrix, number | BigNumber":e.referToSelf(h=>(v,y)=>i(y,0)?v.clone():m(v,y,h,!1)),"number | BigNumber, SparseMatrix":e.referToSelf(h=>(v,y)=>i(v,0)?n(y.size(),y.storage()):c(y,v,h,!0)),"number | BigNumber, DenseMatrix":e.referToSelf(h=>(v,y)=>i(v,0)?n(y.size(),y.storage()):m(y,v,h,!0))},d,p({SS:u,DS:s,SD:l}))});var pO="and",Fie=["typed","matrix","equalScalar","zeros","not","concat"],ky=N(pO,Fie,t=>{var{typed:e,matrix:r,equalScalar:i,zeros:n,not:o,concat:a}=t,s=Tn({typed:e,equalScalar:i}),l=Iu({typed:e,equalScalar:i}),u=Er({typed:e,equalScalar:i}),c=An({typed:e}),f=Bt({typed:e,matrix:r,concat:a});return e(pO,{"number, number":fy,"Complex, Complex":function(p,d){return(p.re!==0||p.im!==0)&&(d.re!==0||d.im!==0)},"BigNumber, BigNumber":function(p,d){return!p.isZero()&&!d.isZero()&&!p.isNaN()&&!d.isNaN()},"bigint, bigint":fy,"Unit, Unit":e.referToSelf(m=>(p,d)=>m(p.value||0,d.value||0)),"SparseMatrix, any":e.referToSelf(m=>(p,d)=>o(d)?n(p.size(),p.storage()):u(p,d,m,!1)),"DenseMatrix, any":e.referToSelf(m=>(p,d)=>o(d)?n(p.size(),p.storage()):c(p,d,m,!1)),"any, SparseMatrix":e.referToSelf(m=>(p,d)=>o(p)?n(p.size(),p.storage()):u(d,p,m,!0)),"any, DenseMatrix":e.referToSelf(m=>(p,d)=>o(p)?n(p.size(),p.storage()):c(d,p,m,!0)),"Array, any":e.referToSelf(m=>(p,d)=>m(r(p),d).valueOf()),"any, Array":e.referToSelf(m=>(p,d)=>m(p,r(d)).valueOf())},f({SS:l,DS:s}))});var Py="compare",kie=["typed","config","matrix","equalScalar","BigNumber","Fraction","DenseMatrix","concat"],mO=N(Py,kie,t=>{var{typed:e,config:r,equalScalar:i,matrix:n,BigNumber:o,Fraction:a,DenseMatrix:s,concat:l}=t,u=Vr({typed:e}),c=$u({typed:e,equalScalar:i}),f=mr({typed:e,DenseMatrix:s}),m=Bt({typed:e,matrix:n,concat:l}),p=sa({typed:e});return e(Py,Pie({typed:e,config:r}),{"boolean, boolean":function(h,v){return h===v?0:h>v?1:-1},"BigNumber, BigNumber":function(h,v){return xn(h,v,r.relTol,r.absTol)?new o(0):new o(h.cmp(v))},"bigint, bigint":function(h,v){return h===v?0n:h>v?1n:-1n},"Fraction, Fraction":function(h,v){return new a(h.compare(v))},"Complex, Complex":function(){throw new TypeError("No ordering relation is defined for complex numbers")}},p,m({SS:c,DS:u,Ss:f}))}),Pie=N(Py,["typed","config"],t=>{var{typed:e,config:r}=t;return e(Py,{"number, number":function(n,o){return jr(n,o,r.relTol,r.absTol)?0:n>o?1:-1}})});var El=Ar(hO(),1);var gO="compareNatural",Bie=["typed","compare"],vO=N(gO,Bie,t=>{var{typed:e,compare:r}=t,i=r.signatures["boolean,boolean"];return e(gO,{"any, any":n});function n(l,u){var c=ir(l),f=ir(u),m;if((c==="number"||c==="BigNumber"||c==="Fraction")&&(f==="number"||f==="BigNumber"||f==="Fraction"))return m=r(l,u),m.toString()!=="0"?m>0?1:-1:(0,El.default)(c,f);var p=["Array","DenseMatrix","SparseMatrix"];if(p.includes(c)||p.includes(f))return m=o(n,l,u),m!==0?m:(0,El.default)(c,f);if(c!==f)return(0,El.default)(c,f);if(c==="Complex")return Oie(l,u);if(c==="Unit")return l.equalBase(u)?n(l.value,u.value):a(n,l.formatUnits(),u.formatUnits());if(c==="boolean")return i(l,u);if(c==="string")return(0,El.default)(l,u);if(c==="Object")return s(n,l,u);if(c==="null"||c==="undefined")return 0;throw new TypeError('Unsupported type of value "'+c+'"')}function o(l,u,c){return Fo(u)&&Fo(c)?a(l,u.toJSON().values,c.toJSON().values):Fo(u)?o(l,u.toArray(),c):Fo(c)?o(l,u,c.toArray()):Zs(u)?o(l,u.toJSON().data,c):Zs(c)?o(l,u,c.toJSON().data):Array.isArray(u)?Array.isArray(c)?a(l,u,c):o(l,u,[c]):o(l,[u],c)}function a(l,u,c){for(var f=0,m=Math.min(u.length,c.length);f<m;f++){var p=l(u[f],c[f]);if(p!==0)return p}return u.length>c.length?1:u.length<c.length?-1:0}function s(l,u,c){var f=Object.keys(u),m=Object.keys(c);f.sort(El.default),m.sort(El.default);var p=a(l,f,m);if(p!==0)return p;for(var d=0;d<f.length;d++){var h=l(u[f[d]],c[m[d]]);if(h!==0)return h}return 0}});function Oie(t,e){return t.re>e.re?1:t.re<e.re?-1:t.im>e.im?1:t.im<e.im?-1:0}var yO="compareText",Rie=["typed","matrix","concat"];ty.signature="any, any";var bO=N(yO,Rie,t=>{var{typed:e,matrix:r,concat:i}=t,n=Bt({typed:e,matrix:r,concat:i});return e(yO,ty,n({elop:ty,Ds:!0}))});var By="equal",Lie=["typed","matrix","equalScalar","DenseMatrix","concat","SparseMatrix"],xO=N(By,Lie,t=>{var{typed:e,matrix:r,equalScalar:i,DenseMatrix:n,concat:o,SparseMatrix:a}=t,s=Vr({typed:e}),l=Ln({typed:e,SparseMatrix:a}),u=mr({typed:e,DenseMatrix:n}),c=Bt({typed:e,matrix:r,concat:o});return e(By,Uie({typed:e,equalScalar:i}),c({elop:i,SS:l,DS:s,Ss:u}))}),Uie=N(By,["typed","equalScalar"],t=>{var{typed:e,equalScalar:r}=t;return e(By,{"any, any":function(n,o){return n===null?o===null:o===null?n===null:n===void 0?o===void 0:o===void 0?n===void 0:r(n,o)}})});var _O="equalText",zie=["typed","compareText","isZero"],wO=N(_O,zie,t=>{var{typed:e,compareText:r,isZero:i}=t;return e(_O,{"any, any":function(o,a){return i(r(o,a))}})});var Oy="smaller",Vie=["typed","config","bignumber","matrix","DenseMatrix","concat","SparseMatrix"],SO=N(Oy,Vie,t=>{var{typed:e,config:r,bignumber:i,matrix:n,DenseMatrix:o,concat:a,SparseMatrix:s}=t,l=Vr({typed:e}),u=Ln({typed:e,SparseMatrix:s}),c=mr({typed:e,DenseMatrix:o}),f=Bt({typed:e,matrix:n,concat:a}),m=sa({typed:e});function p(d,h){return d.lt(h)&&!xn(d,h,r.relTol,r.absTol)}return e(Oy,qie({typed:e,config:r}),{"boolean, boolean":(d,h)=>d<h,"BigNumber, BigNumber":p,"bigint, bigint":(d,h)=>d<h,"Fraction, Fraction":(d,h)=>d.compare(h)===-1,"Fraction, BigNumber":function(h,v){return p(i(h),v)},"BigNumber, Fraction":function(h,v){return p(h,i(v))},"Complex, Complex":function(h,v){throw new TypeError("No ordering relation is defined for complex numbers")}},m,f({SS:u,DS:l,Ss:c}))}),qie=N(Oy,["typed","config"],t=>{var{typed:e,config:r}=t;return e(Oy,{"number, number":function(n,o){return n<o&&!jr(n,o,r.relTol,r.absTol)}})});var Ry="smallerEq",jie=["typed","config","matrix","DenseMatrix","concat","SparseMatrix"],DO=N(Ry,jie,t=>{var{typed:e,config:r,matrix:i,DenseMatrix:n,concat:o,SparseMatrix:a}=t,s=Vr({typed:e}),l=Ln({typed:e,SparseMatrix:a}),u=mr({typed:e,DenseMatrix:n}),c=Bt({typed:e,matrix:i,concat:o}),f=sa({typed:e});return e(Ry,Zie({typed:e,config:r}),{"boolean, boolean":(m,p)=>m<=p,"BigNumber, BigNumber":function(p,d){return p.lte(d)||xn(p,d,r.relTol,r.absTol)},"bigint, bigint":(m,p)=>m<=p,"Fraction, Fraction":(m,p)=>m.compare(p)!==1,"Complex, Complex":function(){throw new TypeError("No ordering relation is defined for complex numbers")}},f,c({SS:l,DS:s,Ss:u}))}),Zie=N(Ry,["typed","config"],t=>{var{typed:e,config:r}=t;return e(Ry,{"number, number":function(n,o){return n<=o||jr(n,o,r.relTol,r.absTol)}})});var Ly="larger",Gie=["typed","config","bignumber","matrix","DenseMatrix","concat","SparseMatrix"],EO=N(Ly,Gie,t=>{var{typed:e,config:r,bignumber:i,matrix:n,DenseMatrix:o,concat:a,SparseMatrix:s}=t,l=Vr({typed:e}),u=Ln({typed:e,SparseMatrix:s}),c=mr({typed:e,DenseMatrix:o}),f=Bt({typed:e,matrix:n,concat:a}),m=sa({typed:e});function p(d,h){return d.gt(h)&&!xn(d,h,r.relTol,r.absTol)}return e(Ly,Wie({typed:e,config:r}),{"boolean, boolean":(d,h)=>d>h,"BigNumber, BigNumber":p,"bigint, bigint":(d,h)=>d>h,"Fraction, Fraction":(d,h)=>d.compare(h)===1,"Fraction, BigNumber":function(h,v){return p(i(h),v)},"BigNumber, Fraction":function(h,v){return p(h,i(v))},"Complex, Complex":function(){throw new TypeError("No ordering relation is defined for complex numbers")}},m,f({SS:u,DS:l,Ss:c}))}),Wie=N(Ly,["typed","config"],t=>{var{typed:e,config:r}=t;return e(Ly,{"number, number":function(n,o){return n>o&&!jr(n,o,r.relTol,r.absTol)}})});var Uy="largerEq",Hie=["typed","config","matrix","DenseMatrix","concat","SparseMatrix"],AO=N(Uy,Hie,t=>{var{typed:e,config:r,matrix:i,DenseMatrix:n,concat:o,SparseMatrix:a}=t,s=Vr({typed:e}),l=Ln({typed:e,SparseMatrix:a}),u=mr({typed:e,DenseMatrix:n}),c=Bt({typed:e,matrix:i,concat:o}),f=sa({typed:e});return e(Uy,Yie({typed:e,config:r}),{"boolean, boolean":(m,p)=>m>=p,"BigNumber, BigNumber":function(p,d){return p.gte(d)||xn(p,d,r.relTol,r.absTol)},"bigint, bigint":function(p,d){return p>=d},"Fraction, Fraction":(m,p)=>m.compare(p)!==-1,"Complex, Complex":function(){throw new TypeError("No ordering relation is defined for complex numbers")}},f,c({SS:l,DS:s,Ss:u}))}),Yie=N(Uy,["typed","config"],t=>{var{typed:e,config:r}=t;return e(Uy,{"number, number":function(n,o){return n>=o||jr(n,o,r.relTol,r.absTol)}})});var TO="deepEqual",Jie=["typed","equal"],NO=N(TO,Jie,t=>{var{typed:e,equal:r}=t;return e(TO,{"any, any":function(o,a){return i(o.valueOf(),a.valueOf())}});function i(n,o){if(Array.isArray(n))if(Array.isArray(o)){var a=n.length;if(a!==o.length)return!1;for(var s=0;s<a;s++)if(!i(n[s],o[s]))return!1;return!0}else return!1;else return Array.isArray(o)?!1:r(n,o)}});var zy="unequal",Xie=["typed","config","equalScalar","matrix","DenseMatrix","concat","SparseMatrix"],MO=N(zy,Xie,t=>{var{typed:e,config:r,equalScalar:i,matrix:n,DenseMatrix:o,concat:a,SparseMatrix:s}=t,l=Vr({typed:e}),u=Ln({typed:e,SparseMatrix:s}),c=mr({typed:e,DenseMatrix:o}),f=Bt({typed:e,matrix:n,concat:a});return e(zy,Kie({typed:e,equalScalar:i}),f({elop:m,SS:u,DS:l,Ss:c}));function m(p,d){return!i(p,d)}}),Kie=N(zy,["typed","equalScalar"],t=>{var{typed:e,equalScalar:r}=t;return e(zy,{"any, any":function(n,o){return n===null?o!==null:o===null?n!==null:n===void 0?o!==void 0:o===void 0?n!==void 0:!r(n,o)}})});var CO="partitionSelect",Qie=["typed","isNumeric","isNaN","compare"],$O=N(CO,Qie,t=>{var{typed:e,isNumeric:r,isNaN:i,compare:n}=t,o=n,a=(u,c)=>-n(u,c);return e(CO,{"Array | Matrix, number":function(c,f){return s(c,f,o)},"Array | Matrix, number, string":function(c,f,m){if(m==="asc")return s(c,f,o);if(m==="desc")return s(c,f,a);throw new Error('Compare string must be "asc" or "desc"')},"Array | Matrix, number, function":s});function s(u,c,f){if(!Ge(c)||c<0)throw new Error("k must be a non-negative integer");if(Je(u)){var m=u.size();if(m.length>1)throw new Error("Only one dimensional matrices supported");return l(u.valueOf(),c,f)}if(Array.isArray(u))return l(u,c,f)}function l(u,c,f){if(c>=u.length)throw new Error("k out of bounds");for(var m=0;m<u.length;m++)if(r(u[m])&&i(u[m]))return u[m];for(var p=0,d=u.length-1;p<d;){for(var h=p,v=d,y=u[Math.floor(Math.random()*(d-p+1))+p];h<v;)if(f(u[h],y)>=0){var S=u[v];u[v]=u[h],u[h]=S,--v}else++h;f(u[h],y)>0&&--h,c<=h?d=h:p=h+1}return u[c]}});var IO="sort",eoe=["typed","matrix","compare","compareNatural"],FO=N(IO,eoe,t=>{var{typed:e,matrix:r,compare:i,compareNatural:n}=t,o=i,a=(c,f)=>-i(c,f);return e(IO,{Array:function(f){return l(f),f.sort(o)},Matrix:function(f){return u(f),r(f.toArray().sort(o),f.storage())},"Array, function":function(f,m){return l(f),f.sort(m)},"Matrix, function":function(f,m){return u(f),r(f.toArray().sort(m),f.storage())},"Array, string":function(f,m){return l(f),f.sort(s(m))},"Matrix, string":function(f,m){return u(f),r(f.toArray().sort(s(m)),f.storage())}});function s(c){if(c==="asc")return o;if(c==="desc")return a;if(c==="natural")return n;throw new Error('String "asc", "desc", or "natural" expected')}function l(c){if(vt(c).length!==1)throw new Error("One dimensional array expected")}function u(c){if(c.size().length!==1)throw new Error("One dimensional matrix expected")}});var kO="max",toe=["typed","config","numeric","larger","isNaN"],Vy=N(kO,toe,t=>{var{typed:e,config:r,numeric:i,larger:n,isNaN:o}=t;return e(kO,{"Array | Matrix":s,"Array | Matrix, number | BigNumber":function(u,c){return Cu(u,c.valueOf(),a)},"...":function(u){if(aa(u))throw new TypeError("Scalar values expected in function max");return s(u)}});function a(l,u){try{return n(l,u)?l:u}catch(c){throw gn(c,"max",u)}}function s(l){var u;if(Zi(l,function(c){try{(o(c)||u===void 0||n(c,u))&&(u=c)}catch(f){throw gn(f,"max",c)}}),u===void 0)throw new Error("Cannot calculate max of an empty array");return typeof u=="string"&&(u=i(u,Mi(u,r))),u}});var PO="min",roe=["typed","config","numeric","smaller","isNaN"],qy=N(PO,roe,t=>{var{typed:e,config:r,numeric:i,smaller:n,isNaN:o}=t;return e(PO,{"Array | Matrix":s,"Array | Matrix, number | BigNumber":function(u,c){return Cu(u,c.valueOf(),a)},"...":function(u){if(aa(u))throw new TypeError("Scalar values expected in function min");return s(u)}});function a(l,u){try{return n(l,u)?l:u}catch(c){throw gn(c,"min",u)}}function s(l){var u;if(Zi(l,function(c){try{(o(c)||u===void 0||n(c,u))&&(u=c)}catch(f){throw gn(f,"min",c)}}),u===void 0)throw new Error("Cannot calculate min of an empty array");return typeof u=="string"&&(u=i(u,Mi(u,r))),u}});var noe="ImmutableDenseMatrix",ioe=["smaller","DenseMatrix"],BO=N(noe,ioe,t=>{var{smaller:e,DenseMatrix:r}=t;function i(n,o){if(!(this instanceof i))throw new SyntaxError("Constructor must be called with the new operator");if(o&&!Qr(o))throw new Error("Invalid datatype: "+o);if(Je(n)||sr(n)){var a=new r(n,o);this._data=a._data,this._size=a._size,this._datatype=a._datatype,this._min=null,this._max=null}else if(n&&sr(n.data)&&sr(n.size))this._data=n.data,this._size=n.size,this._datatype=n.datatype,this._min=typeof n.min<"u"?n.min:null,this._max=typeof n.max<"u"?n.max:null;else{if(n)throw new TypeError("Unsupported type of data ("+ir(n)+")");this._data=[],this._size=[0],this._datatype=o,this._min=null,this._max=null}}return i.prototype=new r,i.prototype.type="ImmutableDenseMatrix",i.prototype.isImmutableDenseMatrix=!0,i.prototype.subset=function(n){switch(arguments.length){case 1:{var o=r.prototype.subset.call(this,n);return Je(o)?new i({data:o._data,size:o._size,datatype:o._datatype}):o}case 2:case 3:throw new Error("Cannot invoke set subset on an Immutable Matrix instance");default:throw new SyntaxError("Wrong number of arguments")}},i.prototype.set=function(){throw new Error("Cannot invoke set on an Immutable Matrix instance")},i.prototype.resize=function(){throw new Error("Cannot invoke resize on an Immutable Matrix instance")},i.prototype.reshape=function(){throw new Error("Cannot invoke reshape on an Immutable Matrix instance")},i.prototype.clone=function(){return new i({data:dt(this._data),size:dt(this._size),datatype:this._datatype})},i.prototype.toJSON=function(){return{mathjs:"ImmutableDenseMatrix",data:this._data,size:this._size,datatype:this._datatype}},i.fromJSON=function(n){return new i(n)},i.prototype.swapRows=function(){throw new Error("Cannot invoke swapRows on an Immutable Matrix instance")},i.prototype.min=function(){if(this._min===null){var n=null;this.forEach(function(o){(n===null||e(o,n))&&(n=o)}),this._min=n!==null?n:void 0}return this._min},i.prototype.max=function(){if(this._max===null){var n=null;this.forEach(function(o){(n===null||e(n,o))&&(n=o)}),this._max=n!==null?n:void 0}return this._max},i},{isClass:!0});var ooe="Index",aoe=["ImmutableDenseMatrix","getMatrixDataType"],RO=N(ooe,aoe,t=>{var{ImmutableDenseMatrix:e,getMatrixDataType:r}=t;function i(o){if(!(this instanceof i))throw new SyntaxError("Constructor must be called with the new operator");this._dimensions=[],this._sourceSize=[],this._isScalar=!0;for(var a=0,s=arguments.length;a<s;a++){var l=arguments[a],u=sr(l),c=Je(l),f=typeof l,m=null;if(Du(l))this._dimensions.push(l),this._isScalar=!1;else if(u||c){var p=void 0;r(l)==="boolean"?(u&&(p=n(OO(l).valueOf())),c&&(p=n(OO(l._data).valueOf())),m=l.valueOf().length):p=n(l.valueOf()),this._dimensions.push(p);var d=p.size();(d.length!==1||d[0]!==1||m!==null)&&(this._isScalar=!1)}else if(f==="number")this._dimensions.push(n([l]));else if(f==="bigint")this._dimensions.push(n([Number(l)]));else if(f==="string")this._dimensions.push(l);else throw new TypeError("Dimension must be an Array, Matrix, number, bigint, string, or Range");this._sourceSize.push(m)}}i.prototype.type="Index",i.prototype.isIndex=!0;function n(o){for(var a=0,s=o.length;a<s;a++)if(typeof o[a]!="number"||!Ge(o[a]))throw new TypeError("Index parameters must be positive integer numbers");return new e(o)}return i.prototype.clone=function(){var o=new i;return o._dimensions=dt(this._dimensions),o._isScalar=this._isScalar,o._sourceSize=this._sourceSize,o},i.create=function(o){var a=new i;return i.apply(a,o),a},i.prototype.size=function(){for(var o=[],a=0,s=this._dimensions.length;a<s;a++){var l=this._dimensions[a];o[a]=typeof l=="string"?1:l.size()[0]}return o},i.prototype.max=function(){for(var o=[],a=0,s=this._dimensions.length;a<s;a++){var l=this._dimensions[a];o[a]=typeof l=="string"?l:l.max()}return o},i.prototype.min=function(){for(var o=[],a=0,s=this._dimensions.length;a<s;a++){var l=this._dimensions[a];o[a]=typeof l=="string"?l:l.min()}return o},i.prototype.forEach=function(o){for(var a=0,s=this._dimensions.length;a<s;a++)o(this._dimensions[a],a,this)},i.prototype.dimension=function(o){return typeof o!="number"?null:this._dimensions[o]||null},i.prototype.isObjectProperty=function(){return this._dimensions.length===1&&typeof this._dimensions[0]=="string"},i.prototype.getObjectProperty=function(){return this.isObjectProperty()?this._dimensions[0]:null},i.prototype.isScalar=function(){return this._isScalar},i.prototype.toArray=function(){for(var o=[],a=0,s=this._dimensions.length;a<s;a++){var l=this._dimensions[a];o.push(typeof l=="string"?l:l.toArray())}return o},i.prototype.valueOf=i.prototype.toArray,i.prototype.toString=function(){for(var o=[],a=0,s=this._dimensions.length;a<s;a++){var l=this._dimensions[a];typeof l=="string"?o.push(JSON.stringify(l)):o.push(l.toString())}return"["+o.join(", ")+"]"},i.prototype.toJSON=function(){return{mathjs:"Index",dimensions:this._dimensions}},i.fromJSON=function(o){return i.create(o.dimensions)},i},{isClass:!0});function OO(t){var e=[];return t.forEach((r,i)=>{r&&e.push(i)}),e}var soe="FibonacciHeap",uoe=["smaller","larger"],LO=N(soe,uoe,t=>{var{smaller:e,larger:r}=t,i=1/Math.log((1+Math.sqrt(5))/2);function n(){if(!(this instanceof n))throw new SyntaxError("Constructor must be called with the new operator");this._minimum=null,this._size=0}n.prototype.type="FibonacciHeap",n.prototype.isFibonacciHeap=!0,n.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,e(c,p.key)&&(this._minimum=m)}else m.left=m,m.right=m,this._minimum=m;return this._size++,m},n.prototype.size=function(){return this._size},n.prototype.clear=function(){this._minimum=null,this._size=0},n.prototype.isEmpty=function(){return this._size===0},n.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 d=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=d,m--}return c.left.right=c.right,c.right.left=c.left,c===c.right?f=null:(f=c.right,f=u(f,this._size)),this._size--,this._minimum=f,c},n.prototype.remove=function(c){this._minimum=o(this._minimum,c,-1),this.extractMinimum()};function o(c,f,m){f.key=m;var p=f.parent;return p&&e(f.key,p.key)&&(a(c,f,p),s(c,p)),e(f.key,c.key)&&(c=f),c}function a(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 s(c,f){var m=f.parent;m&&(f.mark?(a(c,f,m),s(m)):f.mark=!0)}var l=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 u(c,f){var m=Math.floor(Math.log(f)*i)+1,p=new Array(m),d=0,h=c;if(h)for(d++,h=h.right;h!==c;)d++,h=h.right;for(var v;d>0;){for(var y=h.degree,S=h.right;v=p[y],!!v;){if(r(h.key,v.key)){var b=v;v=h,h=b}l(v,h),p[y]=null,y++}p[y]=h,h=S,d--}c=null;for(var _=0;_<m;_++)v=p[_],v&&(c?(v.left.right=v.right,v.right.left=v.left,v.left=c,v.right=c.right,c.right=v,v.right.left=v,e(v.key,c.key)&&(c=v)):c=v);return c}return n},{isClass:!0});var loe="Spa",coe=["addScalar","equalScalar","FibonacciHeap"],UO=N(loe,coe,t=>{var{addScalar:e,equalScalar:r,FibonacciHeap:i}=t;function n(){if(!(this instanceof n))throw new SyntaxError("Constructor must be called with the new operator");this._values=[],this._heap=new i}return n.prototype.type="Spa",n.prototype.isSpa=!0,n.prototype.set=function(o,a){if(this._values[o])this._values[o].value=a;else{var s=this._heap.insert(o,a);this._values[o]=s}},n.prototype.get=function(o){var a=this._values[o];return a?a.value:0},n.prototype.accumulate=function(o,a){var s=this._values[o];s?s.value=e(s.value,a):(s=this._heap.insert(o,a),this._values[o]=s)},n.prototype.forEach=function(o,a,s){var l=this._heap,u=this._values,c=[],f=l.extractMinimum();for(f&&c.push(f);f&&f.key<=a;)f.key>=o&&(r(f.value,0)||s(f.key,f.value,this)),f=l.extractMinimum(),f&&c.push(f);for(var m=0;m<c.length;m++){var p=c[m];f=l.insert(p.key,p.value),u[f.key]=f}},n.prototype.swap=function(o,a){var s=this._values[o],l=this._values[a];if(!s&&l)s=this._heap.insert(o,l.value),this._heap.remove(l),this._values[o]=s,this._values[a]=void 0;else if(s&&!l)l=this._heap.insert(a,s.value),this._heap.remove(s),this._values[a]=l,this._values[o]=void 0;else if(s&&l){var u=s.value;s.value=l.value,l.value=u}},n},{isClass:!0});function zO(t){var e=0,r=1,i=Object.create(null),n=Object.create(null),o=0,a=function(l){var u=n[l];if(u&&(delete i[u],delete n[l],--e,r===u)){if(!e){o=0,r=1;return}for(;!Object.prototype.hasOwnProperty.call(i,++r););}};return t=Math.abs(t),{hit:function(l){var u=n[l],c=++o;if(i[c]=l,n[l]=c,!u)return++e,e<=t?void 0:(l=i[r],a(l),l);if(delete i[u],r===u)for(;!Object.prototype.hasOwnProperty.call(i,++r););},delete:a,clear:function(){e=o=0,r=1,i=Object.create(null),n=Object.create(null)}}}function Al(t){var{hasher:e,limit:r}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};return r=r??Number.POSITIVE_INFINITY,e=e??JSON.stringify,function i(){typeof i.cache!="object"&&(i.cache={values:new Map,lru:zO(r||Number.POSITIVE_INFINITY)});for(var n=[],o=0;o<arguments.length;o++)n[o]=arguments[o];var a=e(n);if(i.cache.values.has(a))return i.cache.lru.hit(a),i.cache.values.get(a);var s=t.apply(t,n);return i.cache.values.set(a,s),i.cache.values.delete(i.cache.lru.hit(a)),s}}var VO=Al(function(t){return new t(1).exp()},{hasher:jy}),qO=Al(function(t){return new t(1).plus(new t(5).sqrt()).div(2)},{hasher:jy}),um=Al(function(t){return t.acos(-1)},{hasher:jy}),jO=Al(function(t){return um(t).times(2)},{hasher:jy});function jy(t){return t[0].precision}function ZO(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter(function(n){return Object.getOwnPropertyDescriptor(t,n).enumerable})),r.push.apply(r,i)}return r}function qE(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?ZO(Object(r),!0).forEach(function(i){dr(t,i,r[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):ZO(Object(r)).forEach(function(i){Object.defineProperty(t,i,Object.getOwnPropertyDescriptor(r,i))})}return t}var foe="Unit",poe=["?on","config","addScalar","subtractScalar","multiplyScalar","divideScalar","pow","abs","fix","round","equal","isNumeric","format","toBest","number","Complex","BigNumber","Fraction"],GO=N(foe,poe,t=>{var{on:e,config:r,addScalar:i,subtractScalar:n,multiplyScalar:o,divideScalar:a,pow:s,abs:l,fix:u,round:c,equal:f,isNumeric:m,format:p,toBest:d,number:h,Complex:v,BigNumber:y,Fraction:S}=t,b=h;function _(H,oe){if(!(this instanceof _))throw new Error("Constructor must be called with the new operator");if(!(H==null||m(H)||Qn(H)))throw new TypeError("First parameter in Unit constructor must be number, BigNumber, Fraction, Complex, or undefined");if(this.fixPrefix=!1,this.skipAutomaticSimplification=!0,oe===void 0)this.units=[],this.dimensions=Z.map(De=>0);else if(typeof oe=="string"){var ve=_.parse(oe);this.units=ve.units,this.dimensions=ve.dimensions}else if(En(oe)&&oe.value===null)this.fixPrefix=oe.fixPrefix,this.skipAutomaticSimplification=oe.skipAutomaticSimplification,this.dimensions=oe.dimensions.slice(0),this.units=oe.units.map(De=>Dn({},De));else throw new TypeError("Second parameter in Unit constructor must be a string or valueless Unit");this.value=this._normalize(H)}Object.defineProperty(_,"name",{value:"Unit"}),_.prototype.constructor=_,_.prototype.type="Unit",_.prototype.isUnit=!0;var w,x,E;function T(){for(;E===" "||E===" ";)C()}function D(H){return H>="0"&&H<="9"||H==="."}function M(H){return H>="0"&&H<="9"}function C(){x++,E=w.charAt(x)}function $(H){x=H,E=w.charAt(x)}function O(){var H="",oe=x;if(E==="+"?C():E==="-"&&(H+=E,C()),!D(E))return $(oe),null;if(E==="."){if(H+=E,C(),!M(E))return $(oe),null}else{for(;M(E);)H+=E,C();E==="."&&(H+=E,C())}for(;M(E);)H+=E,C();if(E==="E"||E==="e"){var ve="",De=x;if(ve+=E,C(),(E==="+"||E==="-")&&(ve+=E,C()),!M(E))return $(De),H;for(H=H+ve;M(E);)H+=E,C()}return H}function R(){for(var H="";M(E)||_.isValidAlpha(E);)H+=E,C();var oe=H.charAt(0);return _.isValidAlpha(oe)?H:null}function L(H){return E===H?(C(),H):null}_.parse=function(H,oe){if(oe=oe||{},w=H,x=-1,E="",typeof w!="string")throw new TypeError("Invalid argument in Unit.parse, string expected");var ve=new _;ve.units=[];var De=1,Ee=!1;C(),T();var Ue=O(),He=null;if(Ue){if(r.number==="BigNumber")He=new y(Ue);else if(r.number==="Fraction")try{He=new S(Ue)}catch{He=parseFloat(Ue)}else He=parseFloat(Ue);T(),L("*")?(De=1,Ee=!0):L("/")&&(De=-1,Ee=!0)}for(var nt=[],ke=1;;){for(T();E==="(";)nt.push(De),ke*=De,De=1,C(),T();var Y=void 0;if(E){var me=E;if(Y=R(),Y===null)throw new SyntaxError('Unexpected "'+me+'" in "'+w+'" at index '+x.toString())}else break;var ce=k(Y);if(ce===null)throw new SyntaxError('Unit "'+Y+'" not found.');var Ce=De*ke;if(T(),L("^")){T();var Pe=O();if(Pe===null)throw new SyntaxError('In "'+H+'", "^" must be followed by a floating-point number');Ce*=Pe}ve.units.push({unit:ce.unit,prefix:ce.prefix,power:Ce});for(var we=0;we<Z.length;we++)ve.dimensions[we]+=(ce.unit.dimensions[we]||0)*Ce;for(T();E===")";){if(nt.length===0)throw new SyntaxError('Unmatched ")" in "'+w+'" at index '+x.toString());ke/=nt.pop(),C(),T()}if(Ee=!1,L("*")?(De=1,Ee=!0):L("/")?(De=-1,Ee=!0):De=1,ce.unit.base){var We=ce.unit.base.key;ae.auto[We]={unit:ce.unit,prefix:ce.prefix}}}if(T(),E)throw new SyntaxError('Could not parse: "'+H+'"');if(Ee)throw new SyntaxError('Trailing characters: "'+H+'"');if(nt.length!==0)throw new SyntaxError('Unmatched "(" in "'+w+'"');if(ve.units.length===0&&!oe.allowNoUnits)throw new SyntaxError('"'+H+'" contains no units');return ve.value=He!==void 0?ve._normalize(He):null,ve},_.prototype.clone=function(){var H=new _;H.fixPrefix=this.fixPrefix,H.skipAutomaticSimplification=this.skipAutomaticSimplification,H.value=dt(this.value),H.dimensions=this.dimensions.slice(0),H.units=[];for(var oe=0;oe<this.units.length;oe++){H.units[oe]={};for(var ve in this.units[oe])rt(this.units[oe],ve)&&(H.units[oe][ve]=this.units[oe][ve])}return H},_.prototype.valueType=function(){return ir(this.value)},_.prototype._isDerived=function(){return this.units.length===0?!1:this.units.length>1||Math.abs(this.units[0].power-1)>1e-15},_.prototype._normalize=function(H){if(H==null||this.units.length===0)return H;for(var oe=H,ve=_._getNumberConverter(ir(H)),De=0;De<this.units.length;De++){var Ee=ve(this.units[De].unit.value),Ue=ve(this.units[De].prefix.value),He=ve(this.units[De].power);oe=o(oe,s(o(Ee,Ue),He))}return oe},_.prototype._denormalize=function(H,oe){if(H==null||this.units.length===0)return H;for(var ve=H,De=_._getNumberConverter(ir(H)),Ee=0;Ee<this.units.length;Ee++){var Ue=De(this.units[Ee].unit.value),He=De(this.units[Ee].prefix.value),nt=De(this.units[Ee].power);ve=a(ve,s(o(Ue,He),nt))}return ve};var k=Al(H=>{if(rt(G,H)){var oe=G[H],ve=oe.prefixes[""];return{unit:oe,prefix:ve}}for(var De in G)if(rt(G,De)&&XF(H,De)){var Ee=G[De],Ue=H.length-De.length,He=H.substring(0,Ue),nt=rt(Ee.prefixes,He)?Ee.prefixes[He]:void 0;if(nt!==void 0)return{unit:Ee,prefix:nt}}return null},{hasher:H=>H[0],limit:100});_.isValuelessUnit=function(H){return k(H)!==null},_.prototype.hasBase=function(H){if(typeof H=="string"&&(H=q[H]),!H)return!1;for(var oe=0;oe<Z.length;oe++)if(Math.abs((this.dimensions[oe]||0)-(H.dimensions[oe]||0))>1e-12)return!1;return!0},_.prototype.equalBase=function(H){for(var oe=0;oe<Z.length;oe++)if(Math.abs((this.dimensions[oe]||0)-(H.dimensions[oe]||0))>1e-12)return!1;return!0},_.prototype.equals=function(H){return this.equalBase(H)&&f(this.value,H.value)},_.prototype.multiply=function(H){for(var oe=this.clone(),ve=En(H)?H:new _(H),De=0;De<Z.length;De++)oe.dimensions[De]=(this.dimensions[De]||0)+(ve.dimensions[De]||0);for(var Ee=0;Ee<ve.units.length;Ee++){var Ue=qE({},ve.units[Ee]);oe.units.push(Ue)}if(this.value!==null||ve.value!==null){var He=this.value===null?this._normalize(J(ve.value)):this.value,nt=ve.value===null?ve._normalize(J(this.value)):ve.value;oe.value=o(He,nt)}else oe.value=null;return En(H)&&(oe.skipAutomaticSimplification=!1),V(oe)},_.prototype.divideInto=function(H){return new _(H).divide(this)},_.prototype.divide=function(H){for(var oe=this.clone(),ve=En(H)?H:new _(H),De=0;De<Z.length;De++)oe.dimensions[De]=(this.dimensions[De]||0)-(ve.dimensions[De]||0);for(var Ee=0;Ee<ve.units.length;Ee++){var Ue=qE(qE({},ve.units[Ee]),{},{power:-ve.units[Ee].power});oe.units.push(Ue)}if(this.value!==null||ve.value!==null){var He=this.value===null?this._normalize(J(ve.value)):this.value,nt=ve.value===null?ve._normalize(J(this.value)):ve.value;oe.value=a(He,nt)}else oe.value=null;return En(H)&&(oe.skipAutomaticSimplification=!1),V(oe)},_.prototype.pow=function(H){for(var oe=this.clone(),ve=0;ve<Z.length;ve++)oe.dimensions[ve]=(this.dimensions[ve]||0)*H;for(var De=0;De<oe.units.length;De++)oe.units[De].power*=H;return oe.value!==null?oe.value=s(oe.value,H):oe.value=null,oe.skipAutomaticSimplification=!1,V(oe)};function V(H){return H.equalBase(q.NONE)&&H.value!==null&&!r.predictable?H.value:H}function J(H){var oe=_._getNumberConverter(ir(H));return oe(1)}_.prototype.abs=function(){var H=this.clone();if(H.value!==null)if(H._isDerived()||H.units.length===0||H.units[0].unit.offset===0)H.value=l(H.value);else{var oe=H._numberConverter(),ve=oe(H.units[0].unit.value),De=oe(H.units[0].unit.offset),Ee=o(ve,De);H.value=n(l(i(H.value,Ee)),Ee)}for(var Ue in H.units)(H.units[Ue].unit.name==="VA"||H.units[Ue].unit.name==="VAR")&&(H.units[Ue].unit=G.W);return H},_.prototype.to=function(H){var oe=this.value===null?this._normalize(1):this.value,ve;if(typeof H=="string")ve=_.parse(H);else if(En(H))ve=H.clone();else throw new Error("String or Unit expected as parameter");if(!this.equalBase(ve))throw new Error("Units do not match ('".concat(ve.toString(),"' != '").concat(this.toString(),"')"));if(ve.value!==null)throw new Error("Cannot convert to a unit with a value");if(this.value===null||this._isDerived()||this.units.length===0||ve.units.length===0||this.units[0].unit.offset===ve.units[0].unit.offset)ve.value=dt(oe);else{var De=_._getNumberConverter(ir(oe)),Ee=this.units[0].unit.value,Ue=this.units[0].unit.offset,He=o(Ee,Ue),nt=ve.units[0].unit.value,ke=ve.units[0].unit.offset,Y=o(nt,ke);ve.value=i(oe,De(n(He,Y)))}return ve.fixPrefix=!0,ve.skipAutomaticSimplification=!0,ve},_.prototype.toNumber=function(H){return b(this.toNumeric(H))},_.prototype.toNumeric=function(H){var oe;return H?oe=this.to(H):oe=this.clone(),oe._isDerived()||oe.units.length===0?oe._denormalize(oe.value):oe._denormalize(oe.value,oe.units[0].prefix.value)},_.prototype.toString=function(){return this.format()},_.prototype.toJSON=function(){return{mathjs:"Unit",value:this._denormalize(this.value),unit:this.units.length>0?this.formatUnits():null,fixPrefix:this.fixPrefix}},_.fromJSON=function(H){var oe,ve=new _(H.value,(oe=H.unit)!==null&&oe!==void 0?oe:void 0);return ve.fixPrefix=H.fixPrefix||!1,ve},_.prototype.valueOf=_.prototype.toString,_.prototype.simplify=function(){var H=this.clone(),oe=[],ve;for(var De in le)if(rt(le,De)&&H.hasBase(q[De])){ve=De;break}if(ve==="NONE")H.units=[];else{var Ee;if(ve&&rt(le,ve)&&(Ee=le[ve]),Ee)H.units=[{unit:Ee.unit,prefix:Ee.prefix,power:1}];else{for(var Ue=!1,He=0;He<Z.length;He++){var nt=Z[He];Math.abs(H.dimensions[He]||0)>1e-12&&(rt(le,nt)?oe.push({unit:le[nt].unit,prefix:le[nt].prefix,power:H.dimensions[He]||0}):Ue=!0)}oe.length<H.units.length&&!Ue&&(H.units=oe)}}return H},_.prototype.toSI=function(){for(var H=this.clone(),oe=[],ve=0;ve<Z.length;ve++){var De=Z[ve];if(Math.abs(H.dimensions[ve]||0)>1e-12)if(rt(ae.si,De))oe.push({unit:ae.si[De].unit,prefix:ae.si[De].prefix,power:H.dimensions[ve]||0});else throw new Error("Cannot express custom unit "+De+" in SI units")}return H.units=oe,H.fixPrefix=!0,H.skipAutomaticSimplification=!0,this.value!==null?(H.value=null,this.to(H)):H},_.prototype.formatUnits=function(){for(var H="",oe="",ve=0,De=0,Ee=0;Ee<this.units.length;Ee++)this.units[Ee].power>0?(ve++,H+=" "+this.units[Ee].prefix.name+this.units[Ee].unit.name,Math.abs(this.units[Ee].power-1)>1e-15&&(H+="^"+this.units[Ee].power)):this.units[Ee].power<0&&De++;if(De>0)for(var Ue=0;Ue<this.units.length;Ue++)this.units[Ue].power<0&&(ve>0?(oe+=" "+this.units[Ue].prefix.name+this.units[Ue].unit.name,Math.abs(this.units[Ue].power+1)>1e-15&&(oe+="^"+-this.units[Ue].power)):(oe+=" "+this.units[Ue].prefix.name+this.units[Ue].unit.name,oe+="^"+this.units[Ue].power));H=H.substr(1),oe=oe.substr(1),ve>1&&De>0&&(H="("+H+")"),De>1&&ve>0&&(oe="("+oe+")");var He=H;return ve>0&&De>0&&(He+=" / "),He+=oe,He},_.prototype.toBest=function(){var H=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],oe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(H&&!Array.isArray(H))throw new Error("Invalid unit type. Expected string or Unit.");var ve=this.units[0].unit.prefixes;if(H&&H.length>0){var De=H.map(He=>{var nt=null;if(typeof He=="string"){if(nt=_.parse(He),!nt)throw new Error("Invalid unit type. Expected compatible string or Unit.")}else if(!En(He))throw new Error("Invalid unit type. Expected compatible string or Unit.");nt===null&&(nt=He.clone());try{return this.to(nt.formatUnits()),nt}catch{throw new Error("Invalid unit type. Expected compatible string or Unit.")}}),Ee=De.map(He=>He.units[0].prefix);this.units[0].unit.prefixes=Ee.reduce((He,nt)=>(He[nt.name]=nt,He),{}),this.units[0].prefix=Ee[0]}var Ue=W(this,oe).simp;return this.units[0].unit.prefixes=ve,Ue.fixPrefix=!0,Ue},_.prototype.format=function(H){var{simp:oe,valueStr:ve,unitStr:De}=W(this,H),Ee=ve;return oe.value&&Qn(oe.value)&&(Ee="("+Ee+")"),De.length>0&&Ee.length>0&&(Ee+=" "),Ee+=De,Ee};function W(H){var oe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},ve=H.skipAutomaticSimplification||H.value===null?H.clone():H.simplify();Q(ve),ie(ve,oe.offset);var De=ve._denormalize(ve.value),Ee=ve.value!==null?p(De,oe||{}):"",Ue=ve.formatUnits();return{simp:ve,valueStr:Ee,unitStr:Ue}}function Q(H){var oe=!1;typeof H.value<"u"&&H.value!==null&&Qn(H.value)&&(oe=Math.abs(H.value.re)<1e-14);for(var ve in H.units)rt(H.units,ve)&&H.units[ve].unit&&(H.units[ve].unit.name==="VA"&&oe?H.units[ve].unit=G.VAR:H.units[ve].unit.name==="VAR"&&!oe&&(H.units[ve].unit=G.VA))}function ie(H,oe){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(oe))}_.prototype._bestPrefix=function(){var H=arguments.length>0&&arguments[0]!==void 0?arguments[0]:1.2;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 oe=this.value!==null?l(this.value):0,ve=l(this.units[0].unit.value),De=this.units[0].prefix;if(oe===0)return De;var Ee=this.units[0].power,Ue=Math.log(oe/Math.pow(De.value*ve,Ee))/Math.LN10-H;if(Ue>-2.200001&&Ue<1.800001)return De;Ue=Math.abs(Ue);var He=this.units[0].unit.prefixes;for(var nt in He)if(rt(He,nt)){var ke=He[nt];if(ke.scientific){var Y=Math.abs(Math.log(oe/Math.pow(ke.value*ve,Ee))/Math.LN10-H);(Y<Ue||Y===Ue&&ke.name.length<De.name.length)&&(De=ke,Ue=Y)}}return De},_.prototype.splitUnit=function(H){for(var oe=this.clone(),ve=[],De=0;De<H.length&&(oe=oe.to(H[De]),De!==H.length-1);De++){var Ee=oe.toNumeric(),Ue=c(Ee),He=void 0,nt=f(Ue,Ee);nt?He=Ue:He=u(oe.toNumeric());var ke=new _(He,H[De].toString());ve.push(ke),oe=n(oe,ke)}for(var Y=0,me=0;me<ve.length;me++)Y=i(Y,ve[me].value);return f(Y,this.value)&&(oe.value=0),ve.push(oe),ve};var B={NONE:{"":{name:"",value:1,scientific:!0}},SHORT:{"":{name:"",value:1,scientific:!0},da:{name:"da",value:10,scientific:!1},h:{name:"h",value:100,scientific:!1},k:{name:"k",value:1e3,scientific:!0},M:{name:"M",value:1e6,scientific:!0},G:{name:"G",value:1e9,scientific:!0},T:{name:"T",value:1e12,scientific:!0},P:{name:"P",value:1e15,scientific:!0},E:{name:"E",value:1e18,scientific:!0},Z:{name:"Z",value:1e21,scientific:!0},Y:{name:"Y",value:1e24,scientific:!0},R:{name:"R",value:1e27,scientific:!0},Q:{name:"Q",value:1e30,scientific:!0},d:{name:"d",value:.1,scientific:!1},c:{name:"c",value:.01,scientific:!1},m:{name:"m",value:.001,scientific:!0},u:{name:"u",value:1e-6,scientific:!0},n:{name:"n",value:1e-9,scientific:!0},p:{name:"p",value:1e-12,scientific:!0},f:{name:"f",value:1e-15,scientific:!0},a:{name:"a",value:1e-18,scientific:!0},z:{name:"z",value:1e-21,scientific:!0},y:{name:"y",value:1e-24,scientific:!0},r:{name:"r",value:1e-27,scientific:!0},q:{name:"q",value:1e-30,scientific:!0}},LONG:{"":{name:"",value:1,scientific:!0},deca:{name:"deca",value:10,scientific:!1},hecto:{name:"hecto",value:100,scientific:!1},kilo:{name:"kilo",value:1e3,scientific:!0},mega:{name:"mega",value:1e6,scientific:!0},giga:{name:"giga",value:1e9,scientific:!0},tera:{name:"tera",value:1e12,scientific:!0},peta:{name:"peta",value:1e15,scientific:!0},exa:{name:"exa",value:1e18,scientific:!0},zetta:{name:"zetta",value:1e21,scientific:!0},yotta:{name:"yotta",value:1e24,scientific:!0},ronna:{name:"ronna",value:1e27,scientific:!0},quetta:{name:"quetta",value:1e30,scientific:!0},deci:{name:"deci",value:.1,scientific:!1},centi:{name:"centi",value:.01,scientific:!1},milli:{name:"milli",value:.001,scientific:!0},micro:{name:"micro",value:1e-6,scientific:!0},nano:{name:"nano",value:1e-9,scientific:!0},pico:{name:"pico",value:1e-12,scientific:!0},femto:{name:"femto",value:1e-15,scientific:!0},atto:{name:"atto",value:1e-18,scientific:!0},zepto:{name:"zepto",value:1e-21,scientific:!0},yocto:{name:"yocto",value:1e-24,scientific:!0},ronto:{name:"ronto",value:1e-27,scientific:!0},quecto:{name:"quecto",value:1e-30,scientific:!0}},SQUARED:{"":{name:"",value:1,scientific:!0},da:{name:"da",value:100,scientific:!1},h:{name:"h",value:1e4,scientific:!1},k:{name:"k",value:1e6,scientific:!0},M:{name:"M",value:1e12,scientific:!0},G:{name:"G",value:1e18,scientific:!0},T:{name:"T",value:1e24,scientific:!0},P:{name:"P",value:1e30,scientific:!0},E:{name:"E",value:1e36,scientific:!0},Z:{name:"Z",value:1e42,scientific:!0},Y:{name:"Y",value:1e48,scientific:!0},R:{name:"R",value:1e54,scientific:!0},Q:{name:"Q",value:1e60,scientific:!0},d:{name:"d",value:.01,scientific:!1},c:{name:"c",value:1e-4,scientific:!1},m:{name:"m",value:1e-6,scientific:!0},u:{name:"u",value:1e-12,scientific:!0},n:{name:"n",value:1e-18,scientific:!0},p:{name:"p",value:1e-24,scientific:!0},f:{name:"f",value:1e-30,scientific:!0},a:{name:"a",value:1e-36,scientific:!0},z:{name:"z",value:1e-42,scientific:!0},y:{name:"y",value:1e-48,scientific:!0},r:{name:"r",value:1e-54,scientific:!0},q:{name:"q",value:1e-60,scientific:!0}},CUBIC:{"":{name:"",value:1,scientific:!0},da:{name:"da",value:1e3,scientific:!1},h:{name:"h",value:1e6,scientific:!1},k:{name:"k",value:1e9,scientific:!0},M:{name:"M",value:1e18,scientific:!0},G:{name:"G",value:1e27,scientific:!0},T:{name:"T",value:1e36,scientific:!0},P:{name:"P",value:1e45,scientific:!0},E:{name:"E",value:1e54,scientific:!0},Z:{name:"Z",value:1e63,scientific:!0},Y:{name:"Y",value:1e72,scientific:!0},R:{name:"R",value:1e81,scientific:!0},Q:{name:"Q",value:1e90,scientific:!0},d:{name:"d",value:.001,scientific:!1},c:{name:"c",value:1e-6,scientific:!1},m:{name:"m",value:1e-9,scientific:!0},u:{name:"u",value:1e-18,scientific:!0},n:{name:"n",value:1e-27,scientific:!0},p:{name:"p",value:1e-36,scientific:!0},f:{name:"f",value:1e-45,scientific:!0},a:{name:"a",value:1e-54,scientific:!0},z:{name:"z",value:1e-63,scientific:!0},y:{name:"y",value:1e-72,scientific:!0},r:{name:"r",value:1e-81,scientific:!0},q:{name:"q",value:1e-90,scientific:!0}},BINARY_SHORT_SI:{"":{name:"",value:1,scientific:!0},k:{name:"k",value:1e3,scientific:!0},M:{name:"M",value:1e6,scientific:!0},G:{name:"G",value:1e9,scientific:!0},T:{name:"T",value:1e12,scientific:!0},P:{name:"P",value:1e15,scientific:!0},E:{name:"E",value:1e18,scientific:!0},Z:{name:"Z",value:1e21,scientific:!0},Y:{name:"Y",value:1e24,scientific:!0}},BINARY_SHORT_IEC:{"":{name:"",value:1,scientific:!0},Ki:{name:"Ki",value:1024,scientific:!0},Mi:{name:"Mi",value:Math.pow(1024,2),scientific:!0},Gi:{name:"Gi",value:Math.pow(1024,3),scientific:!0},Ti:{name:"Ti",value:Math.pow(1024,4),scientific:!0},Pi:{name:"Pi",value:Math.pow(1024,5),scientific:!0},Ei:{name:"Ei",value:Math.pow(1024,6),scientific:!0},Zi:{name:"Zi",value:Math.pow(1024,7),scientific:!0},Yi:{name:"Yi",value:Math.pow(1024,8),scientific:!0}},BINARY_LONG_SI:{"":{name:"",value:1,scientific:!0},kilo:{name:"kilo",value:1e3,scientific:!0},mega:{name:"mega",value:1e6,scientific:!0},giga:{name:"giga",value:1e9,scientific:!0},tera:{name:"tera",value:1e12,scientific:!0},peta:{name:"peta",value:1e15,scientific:!0},exa:{name:"exa",value:1e18,scientific:!0},zetta:{name:"zetta",value:1e21,scientific:!0},yotta:{name:"yotta",value:1e24,scientific:!0}},BINARY_LONG_IEC:{"":{name:"",value:1,scientific:!0},kibi:{name:"kibi",value:1024,scientific:!0},mebi:{name:"mebi",value:Math.pow(1024,2),scientific:!0},gibi:{name:"gibi",value:Math.pow(1024,3),scientific:!0},tebi:{name:"tebi",value:Math.pow(1024,4),scientific:!0},pebi:{name:"pebi",value:Math.pow(1024,5),scientific:!0},exi:{name:"exi",value:Math.pow(1024,6),scientific:!0},zebi:{name:"zebi",value:Math.pow(1024,7),scientific:!0},yobi:{name:"yobi",value:Math.pow(1024,8),scientific:!0}},BTU:{"":{name:"",value:1,scientific:!0},MM:{name:"MM",value:1e6,scientific:!0}}};B.SHORTLONG=Dn({},B.SHORT,B.LONG),B.BINARY_SHORT=Dn({},B.BINARY_SHORT_SI,B.BINARY_SHORT_IEC),B.BINARY_LONG=Dn({},B.BINARY_LONG_SI,B.BINARY_LONG_IEC);var Z=["MASS","LENGTH","TIME","CURRENT","TEMPERATURE","LUMINOUS_INTENSITY","AMOUNT_OF_SUBSTANCE","ANGLE","BIT"],q={NONE:{dimensions:[0,0,0,0,0,0,0,0,0]},MASS:{dimensions:[1,0,0,0,0,0,0,0,0]},LENGTH:{dimensions:[0,1,0,0,0,0,0,0,0]},TIME:{dimensions:[0,0,1,0,0,0,0,0,0]},CURRENT:{dimensions:[0,0,0,1,0,0,0,0,0]},TEMPERATURE:{dimensions:[0,0,0,0,1,0,0,0,0]},LUMINOUS_INTENSITY:{dimensions:[0,0,0,0,0,1,0,0,0]},AMOUNT_OF_SUBSTANCE:{dimensions:[0,0,0,0,0,0,1,0,0]},FORCE:{dimensions:[1,1,-2,0,0,0,0,0,0]},SURFACE:{dimensions:[0,2,0,0,0,0,0,0,0]},VOLUME:{dimensions:[0,3,0,0,0,0,0,0,0]},ENERGY:{dimensions:[1,2,-2,0,0,0,0,0,0]},POWER:{dimensions:[1,2,-3,0,0,0,0,0,0]},PRESSURE:{dimensions:[1,-1,-2,0,0,0,0,0,0]},ELECTRIC_CHARGE:{dimensions:[0,0,1,1,0,0,0,0,0]},ELECTRIC_CAPACITANCE:{dimensions:[-1,-2,4,2,0,0,0,0,0]},ELECTRIC_POTENTIAL:{dimensions:[1,2,-3,-1,0,0,0,0,0]},ELECTRIC_RESISTANCE:{dimensions:[1,2,-3,-2,0,0,0,0,0]},ELECTRIC_INDUCTANCE:{dimensions:[1,2,-2,-2,0,0,0,0,0]},ELECTRIC_CONDUCTANCE:{dimensions:[-1,-2,3,2,0,0,0,0,0]},MAGNETIC_FLUX:{dimensions:[1,2,-2,-1,0,0,0,0,0]},MAGNETIC_FLUX_DENSITY:{dimensions:[1,0,-2,-1,0,0,0,0,0]},FREQUENCY:{dimensions:[0,0,-1,0,0,0,0,0,0]},ANGLE:{dimensions:[0,0,0,0,0,0,0,1,0]},BIT:{dimensions:[0,0,0,0,0,0,0,0,1]}};for(var xe in q)rt(q,xe)&&(q[xe].key=xe);var de={},be={name:"",base:de,value:1,offset:0,dimensions:Z.map(H=>0)},G={meter:{name:"meter",base:q.LENGTH,prefixes:B.LONG,value:1,offset:0},inch:{name:"inch",base:q.LENGTH,prefixes:B.NONE,value:.0254,offset:0},foot:{name:"foot",base:q.LENGTH,prefixes:B.NONE,value:.3048,offset:0},yard:{name:"yard",base:q.LENGTH,prefixes:B.NONE,value:.9144,offset:0},mile:{name:"mile",base:q.LENGTH,prefixes:B.NONE,value:1609.344,offset:0},link:{name:"link",base:q.LENGTH,prefixes:B.NONE,value:.201168,offset:0},rod:{name:"rod",base:q.LENGTH,prefixes:B.NONE,value:5.0292,offset:0},chain:{name:"chain",base:q.LENGTH,prefixes:B.NONE,value:20.1168,offset:0},angstrom:{name:"angstrom",base:q.LENGTH,prefixes:B.NONE,value:1e-10,offset:0},m:{name:"m",base:q.LENGTH,prefixes:B.SHORT,value:1,offset:0},in:{name:"in",base:q.LENGTH,prefixes:B.NONE,value:.0254,offset:0},ft:{name:"ft",base:q.LENGTH,prefixes:B.NONE,value:.3048,offset:0},yd:{name:"yd",base:q.LENGTH,prefixes:B.NONE,value:.9144,offset:0},mi:{name:"mi",base:q.LENGTH,prefixes:B.NONE,value:1609.344,offset:0},li:{name:"li",base:q.LENGTH,prefixes:B.NONE,value:.201168,offset:0},rd:{name:"rd",base:q.LENGTH,prefixes:B.NONE,value:5.02921,offset:0},ch:{name:"ch",base:q.LENGTH,prefixes:B.NONE,value:20.1168,offset:0},mil:{name:"mil",base:q.LENGTH,prefixes:B.NONE,value:254e-7,offset:0},m2:{name:"m2",base:q.SURFACE,prefixes:B.SQUARED,value:1,offset:0},sqin:{name:"sqin",base:q.SURFACE,prefixes:B.NONE,value:64516e-8,offset:0},sqft:{name:"sqft",base:q.SURFACE,prefixes:B.NONE,value:.09290304,offset:0},sqyd:{name:"sqyd",base:q.SURFACE,prefixes:B.NONE,value:.83612736,offset:0},sqmi:{name:"sqmi",base:q.SURFACE,prefixes:B.NONE,value:2589988110336e-6,offset:0},sqrd:{name:"sqrd",base:q.SURFACE,prefixes:B.NONE,value:25.29295,offset:0},sqch:{name:"sqch",base:q.SURFACE,prefixes:B.NONE,value:404.6873,offset:0},sqmil:{name:"sqmil",base:q.SURFACE,prefixes:B.NONE,value:64516e-14,offset:0},acre:{name:"acre",base:q.SURFACE,prefixes:B.NONE,value:4046.86,offset:0},hectare:{name:"hectare",base:q.SURFACE,prefixes:B.NONE,value:1e4,offset:0},m3:{name:"m3",base:q.VOLUME,prefixes:B.CUBIC,value:1,offset:0},L:{name:"L",base:q.VOLUME,prefixes:B.SHORT,value:.001,offset:0},l:{name:"l",base:q.VOLUME,prefixes:B.SHORT,value:.001,offset:0},litre:{name:"litre",base:q.VOLUME,prefixes:B.LONG,value:.001,offset:0},cuin:{name:"cuin",base:q.VOLUME,prefixes:B.NONE,value:16387064e-12,offset:0},cuft:{name:"cuft",base:q.VOLUME,prefixes:B.NONE,value:.028316846592,offset:0},cuyd:{name:"cuyd",base:q.VOLUME,prefixes:B.NONE,value:.764554857984,offset:0},teaspoon:{name:"teaspoon",base:q.VOLUME,prefixes:B.NONE,value:5e-6,offset:0},tablespoon:{name:"tablespoon",base:q.VOLUME,prefixes:B.NONE,value:15e-6,offset:0},drop:{name:"drop",base:q.VOLUME,prefixes:B.NONE,value:5e-8,offset:0},gtt:{name:"gtt",base:q.VOLUME,prefixes:B.NONE,value:5e-8,offset:0},minim:{name:"minim",base:q.VOLUME,prefixes:B.NONE,value:61611519921875e-21,offset:0},fluiddram:{name:"fluiddram",base:q.VOLUME,prefixes:B.NONE,value:36966911953125e-19,offset:0},fluidounce:{name:"fluidounce",base:q.VOLUME,prefixes:B.NONE,value:295735295625e-16,offset:0},gill:{name:"gill",base:q.VOLUME,prefixes:B.NONE,value:.00011829411825,offset:0},cc:{name:"cc",base:q.VOLUME,prefixes:B.NONE,value:1e-6,offset:0},cup:{name:"cup",base:q.VOLUME,prefixes:B.NONE,value:.0002365882365,offset:0},pint:{name:"pint",base:q.VOLUME,prefixes:B.NONE,value:.000473176473,offset:0},quart:{name:"quart",base:q.VOLUME,prefixes:B.NONE,value:.000946352946,offset:0},gallon:{name:"gallon",base:q.VOLUME,prefixes:B.NONE,value:.003785411784,offset:0},beerbarrel:{name:"beerbarrel",base:q.VOLUME,prefixes:B.NONE,value:.117347765304,offset:0},oilbarrel:{name:"oilbarrel",base:q.VOLUME,prefixes:B.NONE,value:.158987294928,offset:0},hogshead:{name:"hogshead",base:q.VOLUME,prefixes:B.NONE,value:.238480942392,offset:0},g:{name:"g",base:q.MASS,prefixes:B.SHORT,value:.001,offset:0},gram:{name:"gram",base:q.MASS,prefixes:B.LONG,value:.001,offset:0},ton:{name:"ton",base:q.MASS,prefixes:B.SHORT,value:907.18474,offset:0},t:{name:"t",base:q.MASS,prefixes:B.SHORT,value:1e3,offset:0},tonne:{name:"tonne",base:q.MASS,prefixes:B.LONG,value:1e3,offset:0},grain:{name:"grain",base:q.MASS,prefixes:B.NONE,value:6479891e-11,offset:0},dram:{name:"dram",base:q.MASS,prefixes:B.NONE,value:.0017718451953125,offset:0},ounce:{name:"ounce",base:q.MASS,prefixes:B.NONE,value:.028349523125,offset:0},poundmass:{name:"poundmass",base:q.MASS,prefixes:B.NONE,value:.45359237,offset:0},hundredweight:{name:"hundredweight",base:q.MASS,prefixes:B.NONE,value:45.359237,offset:0},stick:{name:"stick",base:q.MASS,prefixes:B.NONE,value:.115,offset:0},stone:{name:"stone",base:q.MASS,prefixes:B.NONE,value:6.35029318,offset:0},gr:{name:"gr",base:q.MASS,prefixes:B.NONE,value:6479891e-11,offset:0},dr:{name:"dr",base:q.MASS,prefixes:B.NONE,value:.0017718451953125,offset:0},oz:{name:"oz",base:q.MASS,prefixes:B.NONE,value:.028349523125,offset:0},lbm:{name:"lbm",base:q.MASS,prefixes:B.NONE,value:.45359237,offset:0},cwt:{name:"cwt",base:q.MASS,prefixes:B.NONE,value:45.359237,offset:0},s:{name:"s",base:q.TIME,prefixes:B.SHORT,value:1,offset:0},min:{name:"min",base:q.TIME,prefixes:B.NONE,value:60,offset:0},h:{name:"h",base:q.TIME,prefixes:B.NONE,value:3600,offset:0},second:{name:"second",base:q.TIME,prefixes:B.LONG,value:1,offset:0},sec:{name:"sec",base:q.TIME,prefixes:B.LONG,value:1,offset:0},minute:{name:"minute",base:q.TIME,prefixes:B.NONE,value:60,offset:0},hour:{name:"hour",base:q.TIME,prefixes:B.NONE,value:3600,offset:0},day:{name:"day",base:q.TIME,prefixes:B.NONE,value:86400,offset:0},week:{name:"week",base:q.TIME,prefixes:B.NONE,value:7*86400,offset:0},month:{name:"month",base:q.TIME,prefixes:B.NONE,value:2629800,offset:0},year:{name:"year",base:q.TIME,prefixes:B.NONE,value:31557600,offset:0},decade:{name:"decade",base:q.TIME,prefixes:B.NONE,value:315576e3,offset:0},century:{name:"century",base:q.TIME,prefixes:B.NONE,value:315576e4,offset:0},millennium:{name:"millennium",base:q.TIME,prefixes:B.NONE,value:315576e5,offset:0},hertz:{name:"Hertz",base:q.FREQUENCY,prefixes:B.LONG,value:1,offset:0,reciprocal:!0},Hz:{name:"Hz",base:q.FREQUENCY,prefixes:B.SHORT,value:1,offset:0,reciprocal:!0},rad:{name:"rad",base:q.ANGLE,prefixes:B.SHORT,value:1,offset:0},radian:{name:"radian",base:q.ANGLE,prefixes:B.LONG,value:1,offset:0},deg:{name:"deg",base:q.ANGLE,prefixes:B.SHORT,value:null,offset:0},degree:{name:"degree",base:q.ANGLE,prefixes:B.LONG,value:null,offset:0},grad:{name:"grad",base:q.ANGLE,prefixes:B.SHORT,value:null,offset:0},gradian:{name:"gradian",base:q.ANGLE,prefixes:B.LONG,value:null,offset:0},cycle:{name:"cycle",base:q.ANGLE,prefixes:B.NONE,value:null,offset:0},arcsec:{name:"arcsec",base:q.ANGLE,prefixes:B.NONE,value:null,offset:0},arcmin:{name:"arcmin",base:q.ANGLE,prefixes:B.NONE,value:null,offset:0},A:{name:"A",base:q.CURRENT,prefixes:B.SHORT,value:1,offset:0},ampere:{name:"ampere",base:q.CURRENT,prefixes:B.LONG,value:1,offset:0},K:{name:"K",base:q.TEMPERATURE,prefixes:B.SHORT,value:1,offset:0},degC:{name:"degC",base:q.TEMPERATURE,prefixes:B.SHORT,value:1,offset:273.15},degF:{name:"degF",base:q.TEMPERATURE,prefixes:B.SHORT,value:new S(5,9),offset:459.67},degR:{name:"degR",base:q.TEMPERATURE,prefixes:B.SHORT,value:new S(5,9),offset:0},kelvin:{name:"kelvin",base:q.TEMPERATURE,prefixes:B.LONG,value:1,offset:0},celsius:{name:"celsius",base:q.TEMPERATURE,prefixes:B.LONG,value:1,offset:273.15},fahrenheit:{name:"fahrenheit",base:q.TEMPERATURE,prefixes:B.LONG,value:new S(5,9),offset:459.67},rankine:{name:"rankine",base:q.TEMPERATURE,prefixes:B.LONG,value:new S(5,9),offset:0},mol:{name:"mol",base:q.AMOUNT_OF_SUBSTANCE,prefixes:B.SHORT,value:1,offset:0},mole:{name:"mole",base:q.AMOUNT_OF_SUBSTANCE,prefixes:B.LONG,value:1,offset:0},cd:{name:"cd",base:q.LUMINOUS_INTENSITY,prefixes:B.SHORT,value:1,offset:0},candela:{name:"candela",base:q.LUMINOUS_INTENSITY,prefixes:B.LONG,value:1,offset:0},N:{name:"N",base:q.FORCE,prefixes:B.SHORT,value:1,offset:0},newton:{name:"newton",base:q.FORCE,prefixes:B.LONG,value:1,offset:0},dyn:{name:"dyn",base:q.FORCE,prefixes:B.SHORT,value:1e-5,offset:0},dyne:{name:"dyne",base:q.FORCE,prefixes:B.LONG,value:1e-5,offset:0},lbf:{name:"lbf",base:q.FORCE,prefixes:B.NONE,value:4.4482216152605,offset:0},poundforce:{name:"poundforce",base:q.FORCE,prefixes:B.NONE,value:4.4482216152605,offset:0},kip:{name:"kip",base:q.FORCE,prefixes:B.LONG,value:4448.2216,offset:0},kilogramforce:{name:"kilogramforce",base:q.FORCE,prefixes:B.NONE,value:9.80665,offset:0},J:{name:"J",base:q.ENERGY,prefixes:B.SHORT,value:1,offset:0},joule:{name:"joule",base:q.ENERGY,prefixes:B.LONG,value:1,offset:0},erg:{name:"erg",base:q.ENERGY,prefixes:B.SHORTLONG,value:1e-7,offset:0},Wh:{name:"Wh",base:q.ENERGY,prefixes:B.SHORT,value:3600,offset:0},BTU:{name:"BTU",base:q.ENERGY,prefixes:B.BTU,value:1055.05585262,offset:0},eV:{name:"eV",base:q.ENERGY,prefixes:B.SHORT,value:1602176565e-28,offset:0},electronvolt:{name:"electronvolt",base:q.ENERGY,prefixes:B.LONG,value:1602176565e-28,offset:0},W:{name:"W",base:q.POWER,prefixes:B.SHORT,value:1,offset:0},watt:{name:"watt",base:q.POWER,prefixes:B.LONG,value:1,offset:0},hp:{name:"hp",base:q.POWER,prefixes:B.NONE,value:745.6998715386,offset:0},VAR:{name:"VAR",base:q.POWER,prefixes:B.SHORT,value:v.I,offset:0},VA:{name:"VA",base:q.POWER,prefixes:B.SHORT,value:1,offset:0},Pa:{name:"Pa",base:q.PRESSURE,prefixes:B.SHORT,value:1,offset:0},psi:{name:"psi",base:q.PRESSURE,prefixes:B.NONE,value:6894.75729276459,offset:0},atm:{name:"atm",base:q.PRESSURE,prefixes:B.NONE,value:101325,offset:0},bar:{name:"bar",base:q.PRESSURE,prefixes:B.SHORTLONG,value:1e5,offset:0},torr:{name:"torr",base:q.PRESSURE,prefixes:B.NONE,value:133.322,offset:0},mmHg:{name:"mmHg",base:q.PRESSURE,prefixes:B.NONE,value:133.322,offset:0},mmH2O:{name:"mmH2O",base:q.PRESSURE,prefixes:B.NONE,value:9.80665,offset:0},cmH2O:{name:"cmH2O",base:q.PRESSURE,prefixes:B.NONE,value:98.0665,offset:0},coulomb:{name:"coulomb",base:q.ELECTRIC_CHARGE,prefixes:B.LONG,value:1,offset:0},C:{name:"C",base:q.ELECTRIC_CHARGE,prefixes:B.SHORT,value:1,offset:0},farad:{name:"farad",base:q.ELECTRIC_CAPACITANCE,prefixes:B.LONG,value:1,offset:0},F:{name:"F",base:q.ELECTRIC_CAPACITANCE,prefixes:B.SHORT,value:1,offset:0},volt:{name:"volt",base:q.ELECTRIC_POTENTIAL,prefixes:B.LONG,value:1,offset:0},V:{name:"V",base:q.ELECTRIC_POTENTIAL,prefixes:B.SHORT,value:1,offset:0},ohm:{name:"ohm",base:q.ELECTRIC_RESISTANCE,prefixes:B.SHORTLONG,value:1,offset:0},henry:{name:"henry",base:q.ELECTRIC_INDUCTANCE,prefixes:B.LONG,value:1,offset:0},H:{name:"H",base:q.ELECTRIC_INDUCTANCE,prefixes:B.SHORT,value:1,offset:0},siemens:{name:"siemens",base:q.ELECTRIC_CONDUCTANCE,prefixes:B.LONG,value:1,offset:0},S:{name:"S",base:q.ELECTRIC_CONDUCTANCE,prefixes:B.SHORT,value:1,offset:0},weber:{name:"weber",base:q.MAGNETIC_FLUX,prefixes:B.LONG,value:1,offset:0},Wb:{name:"Wb",base:q.MAGNETIC_FLUX,prefixes:B.SHORT,value:1,offset:0},tesla:{name:"tesla",base:q.MAGNETIC_FLUX_DENSITY,prefixes:B.LONG,value:1,offset:0},T:{name:"T",base:q.MAGNETIC_FLUX_DENSITY,prefixes:B.SHORT,value:1,offset:0},b:{name:"b",base:q.BIT,prefixes:B.BINARY_SHORT,value:1,offset:0},bits:{name:"bits",base:q.BIT,prefixes:B.BINARY_LONG,value:1,offset:0},B:{name:"B",base:q.BIT,prefixes:B.BINARY_SHORT,value:8,offset:0},bytes:{name:"bytes",base:q.BIT,prefixes:B.BINARY_LONG,value:8,offset:0}},K={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 re(H){if(H.number==="BigNumber"){var oe=um(y);G.rad.value=new y(1),G.deg.value=oe.div(180),G.grad.value=oe.div(200),G.cycle.value=oe.times(2),G.arcsec.value=oe.div(648e3),G.arcmin.value=oe.div(10800)}else G.rad.value=1,G.deg.value=Math.PI/180,G.grad.value=Math.PI/200,G.cycle.value=Math.PI*2,G.arcsec.value=Math.PI/648e3,G.arcmin.value=Math.PI/10800;G.radian.value=G.rad.value,G.degree.value=G.deg.value,G.gradian.value=G.grad.value}re(r),e&&e("config",function(H,oe){H.number!==oe.number&&re(H)});var ae={si:{NONE:{unit:be,prefix:B.NONE[""]},LENGTH:{unit:G.m,prefix:B.SHORT[""]},MASS:{unit:G.g,prefix:B.SHORT.k},TIME:{unit:G.s,prefix:B.SHORT[""]},CURRENT:{unit:G.A,prefix:B.SHORT[""]},TEMPERATURE:{unit:G.K,prefix:B.SHORT[""]},LUMINOUS_INTENSITY:{unit:G.cd,prefix:B.SHORT[""]},AMOUNT_OF_SUBSTANCE:{unit:G.mol,prefix:B.SHORT[""]},ANGLE:{unit:G.rad,prefix:B.SHORT[""]},BIT:{unit:G.bits,prefix:B.SHORT[""]},FORCE:{unit:G.N,prefix:B.SHORT[""]},ENERGY:{unit:G.J,prefix:B.SHORT[""]},POWER:{unit:G.W,prefix:B.SHORT[""]},PRESSURE:{unit:G.Pa,prefix:B.SHORT[""]},ELECTRIC_CHARGE:{unit:G.C,prefix:B.SHORT[""]},ELECTRIC_CAPACITANCE:{unit:G.F,prefix:B.SHORT[""]},ELECTRIC_POTENTIAL:{unit:G.V,prefix:B.SHORT[""]},ELECTRIC_RESISTANCE:{unit:G.ohm,prefix:B.SHORT[""]},ELECTRIC_INDUCTANCE:{unit:G.H,prefix:B.SHORT[""]},ELECTRIC_CONDUCTANCE:{unit:G.S,prefix:B.SHORT[""]},MAGNETIC_FLUX:{unit:G.Wb,prefix:B.SHORT[""]},MAGNETIC_FLUX_DENSITY:{unit:G.T,prefix:B.SHORT[""]},FREQUENCY:{unit:G.Hz,prefix:B.SHORT[""]}}};ae.cgs=JSON.parse(JSON.stringify(ae.si)),ae.cgs.LENGTH={unit:G.m,prefix:B.SHORT.c},ae.cgs.MASS={unit:G.g,prefix:B.SHORT[""]},ae.cgs.FORCE={unit:G.dyn,prefix:B.SHORT[""]},ae.cgs.ENERGY={unit:G.erg,prefix:B.NONE[""]},ae.us=JSON.parse(JSON.stringify(ae.si)),ae.us.LENGTH={unit:G.ft,prefix:B.NONE[""]},ae.us.MASS={unit:G.lbm,prefix:B.NONE[""]},ae.us.TEMPERATURE={unit:G.degF,prefix:B.NONE[""]},ae.us.FORCE={unit:G.lbf,prefix:B.NONE[""]},ae.us.ENERGY={unit:G.BTU,prefix:B.BTU[""]},ae.us.POWER={unit:G.hp,prefix:B.NONE[""]},ae.us.PRESSURE={unit:G.psi,prefix:B.NONE[""]},ae.auto=JSON.parse(JSON.stringify(ae.si));var le=ae.auto;_.setUnitSystem=function(H){if(rt(ae,H))le=ae[H];else throw new Error("Unit system "+H+" does not exist. Choices are: "+Object.keys(ae).join(", "))},_.getUnitSystem=function(){for(var H in ae)if(rt(ae,H)&&ae[H]===le)return H},_.typeConverters={BigNumber:function(oe){return oe!=null&&oe.isFraction?new y(String(oe.n)).div(String(oe.d)).times(String(oe.s)):new y(oe+"")},Fraction:function(oe){return new S(oe)},Complex:function(oe){return oe},number:function(oe){return oe!=null&&oe.isFraction?h(oe):oe}},_.prototype._numberConverter=function(){var H=_.typeConverters[this.valueType()];if(H)return H;throw new TypeError('Unsupported Unit value type "'+this.valueType()+'"')},_._getNumberConverter=function(H){if(!_.typeConverters[H])throw new TypeError('Unsupported type "'+H+'"');return _.typeConverters[H]};for(var Se in G)if(rt(G,Se)){var _e=G[Se];_e.dimensions=_e.base.dimensions}for(var Oe in K)if(rt(K,Oe)){var st=G[K[Oe]],yt={};for(var Qe in st)rt(st,Qe)&&(yt[Qe]=st[Qe]);yt.name=Oe,G[Oe]=yt}_.isValidAlpha=function(oe){return/^[a-zA-Z]$/.test(oe)};function ut(H){for(var oe=0;oe<H.length;oe++){if(E=H.charAt(oe),oe===0&&!_.isValidAlpha(E))throw new Error('Invalid unit name (must begin with alpha character): "'+H+'"');if(oe>0&&!(_.isValidAlpha(E)||M(E)))throw new Error('Invalid unit name (only alphanumeric characters are allowed): "'+H+'"')}}return _.createUnit=function(H,oe){if(typeof H!="object")throw new TypeError("createUnit expects first parameter to be of type 'Object'");if(oe&&oe.override){for(var ve in H)if(rt(H,ve)&&_.deleteUnit(ve),H[ve].aliases)for(var De=0;De<H[ve].aliases.length;De++)_.deleteUnit(H[ve].aliases[De])}var Ee;for(var Ue in H)rt(H,Ue)&&(Ee=_.createUnitSingle(Ue,H[Ue]));return Ee},_.createUnitSingle=function(H,oe){if((typeof oe>"u"||oe===null)&&(oe={}),typeof H!="string")throw new TypeError("createUnitSingle expects first parameter to be of type 'string'");if(rt(G,H))throw new Error('Cannot create unit "'+H+'": a unit with that name already exists');ut(H);var ve=null,De=[],Ee=0,Ue,He,nt;if(oe&&oe.type==="Unit")ve=oe.clone();else if(typeof oe=="string")oe!==""&&(Ue=oe);else if(typeof oe=="object")Ue=oe.definition,He=oe.prefixes,Ee=oe.offset,nt=oe.baseName,oe.aliases&&(De=oe.aliases.valueOf());else throw new TypeError('Cannot create unit "'+H+'" from "'+oe.toString()+'": expecting "string" or "Unit" or "Object"');if(De){for(var ke=0;ke<De.length;ke++)if(rt(G,De[ke]))throw new Error('Cannot create alias "'+De[ke]+'": a unit with that name already exists')}if(Ue&&typeof Ue=="string"&&!ve)try{ve=_.parse(Ue,{allowNoUnits:!0})}catch(lr){throw lr.message='Could not create unit "'+H+'" from "'+Ue+'": '+lr.message,lr}else Ue&&Ue.type==="Unit"&&(ve=Ue.clone());De=De||[],Ee=Ee||0,He&&He.toUpperCase?He=B[He.toUpperCase()]||B.NONE:He=B.NONE;var Y={};if(ve){Y={name:H,value:ve.value,dimensions:ve.dimensions.slice(0),prefixes:He,offset:Ee};var Pe=!1;for(var we in q)if(rt(q,we)){for(var We=!0,I=0;I<Z.length;I++)if(Math.abs((Y.dimensions[I]||0)-(q[we].dimensions[I]||0))>1e-12){We=!1;break}if(We){Pe=!0,Y.base=q[we];break}}if(!Pe){nt=nt||H+"_STUFF";var X={dimensions:ve.dimensions.slice(0)};X.key=nt,q[nt]=X,le[nt]={unit:Y,prefix:B.NONE[""]},Y.base=q[nt]}}else{if(nt=nt||H+"_STUFF",Z.indexOf(nt)>=0)throw new Error('Cannot create new base unit "'+H+'": a base unit with that name already exists (and cannot be overridden)');Z.push(nt);for(var me in q)rt(q,me)&&(q[me].dimensions[Z.length-1]=0);for(var ce={dimensions:[]},Ce=0;Ce<Z.length;Ce++)ce.dimensions[Ce]=0;ce.dimensions[Z.length-1]=1,ce.key=nt,q[nt]=ce,Y={name:H,value:1,dimensions:q[nt].dimensions.slice(0),prefixes:He,offset:Ee,base:q[nt]},le[nt]={unit:Y,prefix:B.NONE[""]}}_.UNITS[H]=Y;for(var ne=0;ne<De.length;ne++){var Ne=De[ne],Xe={};for(var gt in Y)rt(Y,gt)&&(Xe[gt]=Y[gt]);Xe.name=Ne,_.UNITS[Ne]=Xe}return delete k.cache,new _(null,H)},_.deleteUnit=function(H){delete _.UNITS[H],delete k.cache},_.PREFIXES=B,_.BASE_DIMENSIONS=Z,_.BASE_UNITS=q,_.UNIT_SYSTEMS=ae,_.UNITS=G,_},{isClass:!0});var WO="unit",moe=["typed","Unit"],HO=N(WO,moe,t=>{var{typed:e,Unit:r}=t;return e(WO,{Unit:function(n){return n.clone()},string:function(n){return r.isValuelessUnit(n)?new r(null,n):r.parse(n,{allowNoUnits:!0})},"number | BigNumber | Fraction | Complex, string | Unit":function(n,o){return new r(n,o)},"number | BigNumber | Fraction":function(n){return new r(n)},"Array | Matrix":e.referToSelf(i=>n=>it(n,i))})});var YO="sparse",doe=["typed","SparseMatrix"],JO=N(YO,doe,t=>{var{typed:e,SparseMatrix:r}=t;return e(YO,{"":function(){return new r([])},string:function(n){return new r([],n)},"Array | Matrix":function(n){return new r(n)},"Array | Matrix, string":function(n,o){return new r(n,o)}})});var XO="createUnit",hoe=["typed","Unit"],KO=N(XO,hoe,t=>{var{typed:e,Unit:r}=t;return e(XO,{"Object, Object":function(n,o){return r.createUnit(n,o)},Object:function(n){return r.createUnit(n,{})},"string, Unit | string | Object, Object":function(n,o,a){var s={};return s[n]=o,r.createUnit(s,a)},"string, Unit | string | Object":function(n,o){var a={};return a[n]=o,r.createUnit(a,{})},string:function(n){var o={};return o[n]={},r.createUnit(o,{})}})});var QO="acos",goe=["typed","config","Complex"],eR=N(QO,goe,t=>{var{typed:e,config:r,Complex:i}=t;return e(QO,{number:function(o){return o>=-1&&o<=1||r.predictable?Math.acos(o):new i(o,0).acos()},Complex:function(o){return o.acos()},BigNumber:function(o){return o.acos()}})});var tR="acosh",voe=["typed","config","Complex"],rR=N(tR,voe,t=>{var{typed:e,config:r,Complex:i}=t;return e(tR,{number:function(o){return o>=1||r.predictable?vE(o):o<=-1?new i(Math.log(Math.sqrt(o*o-1)-o),Math.PI):new i(o,0).acosh()},Complex:function(o){return o.acosh()},BigNumber:function(o){return o.acosh()}})});var nR="acot",yoe=["typed","BigNumber"],iR=N(nR,yoe,t=>{var{typed:e,BigNumber:r}=t;return e(nR,{number:yE,Complex:function(n){return n.acot()},BigNumber:function(n){return new r(1).div(n).atan()}})});var oR="acoth",boe=["typed","config","Complex","BigNumber"],aR=N(oR,boe,t=>{var{typed:e,config:r,Complex:i,BigNumber:n}=t;return e(oR,{number:function(a){return a>=1||a<=-1||r.predictable?bE(a):new i(a,0).acoth()},Complex:function(a){return a.acoth()},BigNumber:function(a){return new n(1).div(a).atanh()}})});var sR="acsc",xoe=["typed","config","Complex","BigNumber"],uR=N(sR,xoe,t=>{var{typed:e,config:r,Complex:i,BigNumber:n}=t;return e(sR,{number:function(a){return a<=-1||a>=1||r.predictable?xE(a):new i(a,0).acsc()},Complex:function(a){return a.acsc()},BigNumber:function(a){return new n(1).div(a).asin()}})});var lR="acsch",_oe=["typed","BigNumber"],cR=N(lR,_oe,t=>{var{typed:e,BigNumber:r}=t;return e(lR,{number:_E,Complex:function(n){return n.acsch()},BigNumber:function(n){return new r(1).div(n).asinh()}})});var fR="asec",woe=["typed","config","Complex","BigNumber"],pR=N(fR,woe,t=>{var{typed:e,config:r,Complex:i,BigNumber:n}=t;return e(fR,{number:function(a){return a<=-1||a>=1||r.predictable?wE(a):new i(a,0).asec()},Complex:function(a){return a.asec()},BigNumber:function(a){return new n(1).div(a).acos()}})});var mR="asech",Soe=["typed","config","Complex","BigNumber"],dR=N(mR,Soe,t=>{var{typed:e,config:r,Complex:i,BigNumber:n}=t;return e(mR,{number:function(a){if(a<=1&&a>=-1||r.predictable){var s=1/a;if(s>0||r.predictable)return SE(a);var l=Math.sqrt(s*s-1);return new i(Math.log(l-s),Math.PI)}return new i(a,0).asech()},Complex:function(a){return a.asech()},BigNumber:function(a){return new n(1).div(a).acosh()}})});var hR="asin",Doe=["typed","config","Complex"],gR=N(hR,Doe,t=>{var{typed:e,config:r,Complex:i}=t;return e(hR,{number:function(o){return o>=-1&&o<=1||r.predictable?Math.asin(o):new i(o,0).asin()},Complex:function(o){return o.asin()},BigNumber:function(o){return o.asin()}})});var Eoe="asinh",Aoe=["typed"],vR=N(Eoe,Aoe,t=>{var{typed:e}=t;return e("asinh",{number:DE,Complex:function(i){return i.asinh()},BigNumber:function(i){return i.asinh()}})});var Toe="atan",Noe=["typed"],yR=N(Toe,Noe,t=>{var{typed:e}=t;return e("atan",{number:function(i){return Math.atan(i)},Complex:function(i){return i.atan()},BigNumber:function(i){return i.atan()}})});var bR="atan2",Moe=["typed","matrix","equalScalar","BigNumber","DenseMatrix","concat"],xR=N(bR,Moe,t=>{var{typed:e,matrix:r,equalScalar:i,BigNumber:n,DenseMatrix:o,concat:a}=t,s=Tn({typed:e,equalScalar:i}),l=Vr({typed:e}),u=gy({typed:e,equalScalar:i}),c=Er({typed:e,equalScalar:i}),f=mr({typed:e,DenseMatrix:o}),m=Bt({typed:e,matrix:r,concat:a});return e(bR,{"number, number":Math.atan2,"BigNumber, BigNumber":(p,d)=>n.atan2(p,d)},m({scalar:"number | BigNumber",SS:u,DS:l,SD:s,Ss:c,sS:f}))});var _R="atanh",Coe=["typed","config","Complex"],wR=N(_R,Coe,t=>{var{typed:e,config:r,Complex:i}=t;return e(_R,{number:function(o){return o<=1&&o>=-1||r.predictable?EE(o):new i(o,0).atanh()},Complex:function(o){return o.atanh()},BigNumber:function(o){return o.atanh()}})});var ua=N("trigUnit",["typed"],t=>{var{typed:e}=t;return{Unit:e.referToSelf(r=>i=>{if(!i.hasBase(i.constructor.BASE_UNITS.ANGLE))throw new TypeError("Unit in function cot is no angle");return e.find(r,i.valueType())(i.value)})}});var SR="cos",$oe=["typed"],DR=N(SR,$oe,t=>{var{typed:e}=t,r=ua({typed:e});return e(SR,{number:Math.cos,"Complex | BigNumber":i=>i.cos()},r)});var ER="cosh",Ioe=["typed"],AR=N(ER,Ioe,t=>{var{typed:e}=t;return e(ER,{number:Vv,"Complex | BigNumber":r=>r.cosh()})});var TR="cot",Foe=["typed","BigNumber"],NR=N(TR,Foe,t=>{var{typed:e,BigNumber:r}=t,i=ua({typed:e});return e(TR,{number:AE,Complex:n=>n.cot(),BigNumber:n=>new r(1).div(n.tan())},i)});var MR="coth",koe=["typed","BigNumber"],CR=N(MR,koe,t=>{var{typed:e,BigNumber:r}=t;return e(MR,{number:TE,Complex:i=>i.coth(),BigNumber:i=>new r(1).div(i.tanh())})});var $R="csc",Poe=["typed","BigNumber"],IR=N($R,Poe,t=>{var{typed:e,BigNumber:r}=t,i=ua({typed:e});return e($R,{number:NE,Complex:n=>n.csc(),BigNumber:n=>new r(1).div(n.sin())},i)});var FR="csch",Boe=["typed","BigNumber"],kR=N(FR,Boe,t=>{var{typed:e,BigNumber:r}=t;return e(FR,{number:ME,Complex:i=>i.csch(),BigNumber:i=>new r(1).div(i.sinh())})});var PR="sec",Ooe=["typed","BigNumber"],BR=N(PR,Ooe,t=>{var{typed:e,BigNumber:r}=t,i=ua({typed:e});return e(PR,{number:CE,Complex:n=>n.sec(),BigNumber:n=>new r(1).div(n.cos())},i)});var OR="sech",Roe=["typed","BigNumber"],RR=N(OR,Roe,t=>{var{typed:e,BigNumber:r}=t;return e(OR,{number:$E,Complex:i=>i.sech(),BigNumber:i=>new r(1).div(i.cosh())})});var LR="sin",Loe=["typed"],UR=N(LR,Loe,t=>{var{typed:e}=t,r=ua({typed:e});return e(LR,{number:Math.sin,"Complex | BigNumber":i=>i.sin()},r)});var zR="sinh",Uoe=["typed"],VR=N(zR,Uoe,t=>{var{typed:e}=t;return e(zR,{number:IE,"Complex | BigNumber":r=>r.sinh()})});var qR="tan",zoe=["typed"],jR=N(qR,zoe,t=>{var{typed:e}=t,r=ua({typed:e});return e(qR,{number:Math.tan,"Complex | BigNumber":i=>i.tan()},r)});var Voe="tanh",qoe=["typed"],ZR=N(Voe,qoe,t=>{var{typed:e}=t;return e("tanh",{number:qv,"Complex | BigNumber":r=>r.tanh()})});var GR="setCartesian",joe=["typed","size","subset","compareNatural","Index","DenseMatrix"],WR=N(GR,joe,t=>{var{typed:e,size:r,subset:i,compareNatural:n,Index:o,DenseMatrix:a}=t;return e(GR,{"Array | Matrix, Array | Matrix":function(l,u){var c=[];if(i(r(l),new o(0))!==0&&i(r(u),new o(0))!==0){var f=Ut(Array.isArray(l)?l:l.toArray()).sort(n),m=Ut(Array.isArray(u)?u:u.toArray()).sort(n);c=[];for(var p=0;p<f.length;p++)for(var d=0;d<m.length;d++)c.push([f[p],m[d]])}return Array.isArray(l)&&Array.isArray(u)?c:new a(c)}})});var HR="setDifference",Zoe=["typed","size","subset","compareNatural","Index","DenseMatrix"],YR=N(HR,Zoe,t=>{var{typed:e,size:r,subset:i,compareNatural:n,Index:o,DenseMatrix:a}=t;return e(HR,{"Array | Matrix, Array | Matrix":function(l,u){var c;if(i(r(l),new o(0))===0)c=[];else{if(i(r(u),new o(0))===0)return Ut(l.toArray());var f=Ys(Ut(Array.isArray(l)?l:l.toArray()).sort(n)),m=Ys(Ut(Array.isArray(u)?u:u.toArray()).sort(n));c=[];for(var p,d=0;d<f.length;d++){p=!1;for(var h=0;h<m.length;h++)if(n(f[d].value,m[h].value)===0&&f[d].identifier===m[h].identifier){p=!0;break}p||c.push(f[d])}}return Array.isArray(l)&&Array.isArray(u)?Gc(c):new a(Gc(c))}})});var JR="setDistinct",Goe=["typed","size","subset","compareNatural","Index","DenseMatrix"],XR=N(JR,Goe,t=>{var{typed:e,size:r,subset:i,compareNatural:n,Index:o,DenseMatrix:a}=t;return e(JR,{"Array | Matrix":function(l){var u;if(i(r(l),new o(0))===0)u=[];else{var c=Ut(Array.isArray(l)?l:l.toArray()).sort(n);u=[],u.push(c[0]);for(var f=1;f<c.length;f++)n(c[f],c[f-1])!==0&&u.push(c[f])}return Array.isArray(l)?u:new a(u)}})});var KR="setIntersect",Woe=["typed","size","subset","compareNatural","Index","DenseMatrix"],QR=N(KR,Woe,t=>{var{typed:e,size:r,subset:i,compareNatural:n,Index:o,DenseMatrix:a}=t;return e(KR,{"Array | Matrix, Array | Matrix":function(l,u){var c;if(i(r(l),new o(0))===0||i(r(u),new o(0))===0)c=[];else{var f=Ys(Ut(Array.isArray(l)?l:l.toArray()).sort(n)),m=Ys(Ut(Array.isArray(u)?u:u.toArray()).sort(n));c=[];for(var p=0;p<f.length;p++)for(var d=0;d<m.length;d++)if(n(f[p].value,m[d].value)===0&&f[p].identifier===m[d].identifier){c.push(f[p]);break}}return Array.isArray(l)&&Array.isArray(u)?Gc(c):new a(Gc(c))}})});var eL="setIsSubset",Hoe=["typed","size","subset","compareNatural","Index"],tL=N(eL,Hoe,t=>{var{typed:e,size:r,subset:i,compareNatural:n,Index:o}=t;return e(eL,{"Array | Matrix, Array | Matrix":function(s,l){if(i(r(s),new o(0))===0)return!0;if(i(r(l),new o(0))===0)return!1;for(var u=Ys(Ut(Array.isArray(s)?s:s.toArray()).sort(n)),c=Ys(Ut(Array.isArray(l)?l:l.toArray()).sort(n)),f,m=0;m<u.length;m++){f=!1;for(var p=0;p<c.length;p++)if(n(u[m].value,c[p].value)===0&&u[m].identifier===c[p].identifier){f=!0;break}if(f===!1)return!1}return!0}})});var rL="setMultiplicity",Yoe=["typed","size","subset","compareNatural","Index"],nL=N(rL,Yoe,t=>{var{typed:e,size:r,subset:i,compareNatural:n,Index:o}=t;return e(rL,{"number | BigNumber | Fraction | Complex, Array | Matrix":function(s,l){if(i(r(l),new o(0))===0)return 0;for(var u=Ut(Array.isArray(l)?l:l.toArray()),c=0,f=0;f<u.length;f++)n(u[f],s)===0&&c++;return c}})});var iL="setPowerset",Joe=["typed","size","subset","compareNatural","Index"],oL=N(iL,Joe,t=>{var{typed:e,size:r,subset:i,compareNatural:n,Index:o}=t;return e(iL,{"Array | Matrix":function(u){if(i(r(u),new o(0))===0)return[];for(var c=Ut(Array.isArray(u)?u:u.toArray()).sort(n),f=[],m=0;m.toString(2).length<=c.length;)f.push(a(c,m.toString(2).split("").reverse())),m++;return s(f)}});function a(l,u){for(var c=[],f=0;f<u.length;f++)u[f]==="1"&&c.push(l[f]);return c}function s(l){for(var u=[],c=l.length-1;c>0;c--)for(var f=0;f<c;f++)l[f].length>l[f+1].length&&(u=l[f],l[f]=l[f+1],l[f+1]=u);return l}});var aL="setSize",Xoe=["typed","compareNatural"],sL=N(aL,Xoe,t=>{var{typed:e,compareNatural:r}=t;return e(aL,{"Array | Matrix":function(n){return Array.isArray(n)?Ut(n).length:Ut(n.toArray()).length},"Array | Matrix, boolean":function(n,o){if(o===!1||n.length===0)return Array.isArray(n)?Ut(n).length:Ut(n.toArray()).length;for(var a=Ut(Array.isArray(n)?n:n.toArray()).sort(r),s=1,l=1;l<a.length;l++)r(a[l],a[l-1])!==0&&s++;return s}})});var uL="setSymDifference",Koe=["typed","size","concat","subset","setDifference","Index"],lL=N(uL,Koe,t=>{var{typed:e,size:r,concat:i,subset:n,setDifference:o,Index:a}=t;return e(uL,{"Array | Matrix, Array | Matrix":function(l,u){if(n(r(l),new a(0))===0)return Ut(u);if(n(r(u),new a(0))===0)return Ut(l);var c=Ut(l),f=Ut(u);return i(o(c,f),o(f,c))}})});var cL="setUnion",Qoe=["typed","size","concat","subset","setIntersect","setSymDifference","Index"],fL=N(cL,Qoe,t=>{var{typed:e,size:r,concat:i,subset:n,setIntersect:o,setSymDifference:a,Index:s}=t;return e(cL,{"Array | Matrix, Array | Matrix":function(u,c){if(n(r(u),new s(0))===0)return Ut(c);if(n(r(c),new s(0))===0)return Ut(u);var f=Ut(u),m=Ut(c);return i(a(f,m),o(f,m))}})});var pL="add",eae=["typed","matrix","addScalar","equalScalar","DenseMatrix","SparseMatrix","concat"],mL=N(pL,eae,t=>{var{typed:e,matrix:r,addScalar:i,equalScalar:n,DenseMatrix:o,SparseMatrix:a,concat:s}=t,l=Ii({typed:e}),u=Xc({typed:e,equalScalar:n}),c=mo({typed:e,DenseMatrix:o}),f=Bt({typed:e,matrix:r,concat:s});return e(pL,{"any, any":i,"any, any, ...any":e.referToSelf(m=>(p,d,h)=>{for(var v=m(p,d),y=0;y<h.length;y++)v=m(v,h[y]);return v})},f({elop:i,DS:l,SS:u,Ss:c}))});var dL="hypot",tae=["typed","abs","addScalar","divideScalar","multiplyScalar","sqrt","smaller","isPositive"],hL=N(dL,tae,t=>{var{typed:e,abs:r,addScalar:i,divideScalar:n,multiplyScalar:o,sqrt:a,smaller:s,isPositive:l}=t;return e(dL,{"... number | BigNumber":u,Array:u,Matrix:c=>u(Ut(c.toArray(),!0))});function u(c){for(var f=0,m=0,p=0;p<c.length;p++){if(Qn(c[p]))throw new TypeError("Unexpected type of argument to hypot");var d=r(c[p]);s(m,d)?(f=o(f,o(n(m,d),n(m,d))),f=i(f,1),m=d):f=i(f,l(d)?o(n(d,m),n(d,m)):d)}return o(m,a(f))}});var gL="norm",rae=["typed","abs","add","pow","conj","sqrt","multiply","equalScalar","larger","smaller","matrix","ctranspose","eigs"],vL=N(gL,rae,t=>{var{typed:e,abs:r,add:i,pow:n,conj:o,sqrt:a,multiply:s,equalScalar:l,larger:u,smaller:c,matrix:f,ctranspose:m,eigs:p}=t;return e(gL,{number:Math.abs,Complex:function(T){return T.abs()},BigNumber:function(T){return T.abs()},boolean:function(T){return Math.abs(T)},Array:function(T){return x(f(T),2)},Matrix:function(T){return x(T,2)},"Array, number | BigNumber | string":function(T,D){return x(f(T),D)},"Matrix, number | BigNumber | string":function(T,D){return x(T,D)}});function d(E){var T=0;return E.forEach(function(D){var M=r(D);u(M,T)&&(T=M)},!0),T}function h(E){var T;return E.forEach(function(D){var M=r(D);(!T||c(M,T))&&(T=M)},!0),T||0}function v(E,T){if(T===Number.POSITIVE_INFINITY||T==="inf")return d(E);if(T===Number.NEGATIVE_INFINITY||T==="-inf")return h(E);if(T==="fro")return x(E,2);if(typeof T=="number"&&!isNaN(T)){if(!l(T,0)){var D=0;return E.forEach(function(M){D=i(n(r(M),T),D)},!0),n(D,1/T)}return Number.POSITIVE_INFINITY}throw new Error("Unsupported parameter value")}function y(E){var T=0;return E.forEach(function(D,M){T=i(T,s(D,o(D)))}),r(a(T))}function S(E){var T=[],D=0;return E.forEach(function(M,C){var $=C[1],O=i(T[$]||0,r(M));u(O,D)&&(D=O),T[$]=O},!0),D}function b(E){var T=E.size();if(T[0]!==T[1])throw new RangeError("Invalid matrix dimensions");var D=m(E),M=s(D,E),C=p(M).values.toArray(),$=C[C.length-1];return r(a($))}function _(E){var T=[],D=0;return E.forEach(function(M,C){var $=C[0],O=i(T[$]||0,r(M));u(O,D)&&(D=O),T[$]=O},!0),D}function w(E,T){if(T===1)return S(E);if(T===Number.POSITIVE_INFINITY||T==="inf")return _(E);if(T==="fro")return y(E);if(T===2)return b(E);throw new Error("Unsupported parameter value "+T)}function x(E,T){var D=E.size();if(D.length===1)return v(E,T);if(D.length===2){if(D[0]&&D[1])return w(E,T);throw new RangeError("Invalid matrix dimensions")}}});var yL="dot",nae=["typed","addScalar","multiplyScalar","conj","size"],bL=N(yL,nae,t=>{var{typed:e,addScalar:r,multiplyScalar:i,conj:n,size:o}=t;return e(yL,{"Array | DenseMatrix, Array | DenseMatrix":s,"SparseMatrix, SparseMatrix":l});function a(c,f){var m=u(c),p=u(f),d,h;if(m.length===1)d=m[0];else if(m.length===2&&m[1]===1)d=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(d!==h)throw new RangeError("Vectors must have equal length ("+d+" != "+h+")");if(d===0)throw new RangeError("Cannot calculate the dot product of empty vectors");return d}function s(c,f){var m=a(c,f),p=Je(c)?c._data:c,d=Je(c)?c._datatype||c.getDataType():void 0,h=Je(f)?f._data:f,v=Je(f)?f._datatype||f.getDataType():void 0,y=u(c).length===2,S=u(f).length===2,b=r,_=i;if(d&&v&&d===v&&typeof d=="string"&&d!=="mixed"){var w=d;b=e.find(r,[w,w]),_=e.find(i,[w,w])}if(!y&&!S){for(var x=_(n(p[0]),h[0]),E=1;E<m;E++)x=b(x,_(n(p[E]),h[E]));return x}if(!y&&S){for(var T=_(n(p[0]),h[0][0]),D=1;D<m;D++)T=b(T,_(n(p[D]),h[D][0]));return T}if(y&&!S){for(var M=_(n(p[0][0]),h[0]),C=1;C<m;C++)M=b(M,_(n(p[C][0]),h[C]));return M}if(y&&S){for(var $=_(n(p[0][0]),h[0][0]),O=1;O<m;O++)$=b($,_(n(p[O][0]),h[O][0]));return $}}function l(c,f){a(c,f);for(var m=c._index,p=c._values,d=f._index,h=f._values,v=0,y=r,S=i,b=0,_=0;b<m.length&&_<d.length;){var w=m[b],x=d[_];if(w<x){b++;continue}if(w>x){_++;continue}w===x&&(v=y(v,S(p[b],h[_])),b++,_++)}return v}function u(c){return Je(c)?c.size():o(c)}});var iae="trace",oae=["typed","matrix","add"],xL=N(iae,oae,t=>{var{typed:e,matrix:r,add:i}=t;return e("trace",{Array:function(s){return n(r(s))},SparseMatrix:o,DenseMatrix:n,any:dt});function n(a){var s=a._size,l=a._data;switch(s.length){case 1:if(s[0]===1)return dt(l[0]);throw new RangeError("Matrix must be square (size: "+Ct(s)+")");case 2:{var u=s[0],c=s[1];if(u===c){for(var f=0,m=0;m<u;m++)f=i(f,l[m][m]);return f}else throw new RangeError("Matrix must be square (size: "+Ct(s)+")")}default:throw new RangeError("Matrix must be two dimensional (size: "+Ct(s)+")")}}function o(a){var s=a._values,l=a._index,u=a._ptr,c=a._size,f=c[0],m=c[1];if(f===m){var p=0;if(s.length>0)for(var d=0;d<m;d++)for(var h=u[d],v=u[d+1],y=h;y<v;y++){var S=l[y];if(S===d){p=i(p,s[y]);break}if(S>d)break}return p}throw new RangeError("Matrix must be square (size: "+Ct(c)+")")}});var _L="index",aae=["typed","Index"],wL=N(_L,aae,t=>{var{typed:e,Index:r}=t;return e(_L,{"...number | string | BigNumber | Range | Array | Matrix":function(n){var o=n.map(function(s){return mt(s)?s.toNumber():sr(s)||Je(s)?s.map(function(l){return mt(l)?l.toNumber():l}):s}),a=new r;return r.apply(a,o),a}})});var Zy=new Set(["end"]);var sae="Node",uae=["mathWithTransform"],SL=N(sae,uae,t=>{var{mathWithTransform:e}=t;function r(n){for(var o of[...Zy])if(n.has(o))throw new Error('Scope contains an illegal symbol, "'+o+'" is a reserved keyword')}class i{get type(){return"Node"}get isNode(){return!0}evaluate(o){return this.compile().evaluate(o)}compile(){var o=this._compile(e,{}),a={},s=null;function l(u){var c=js(u);return r(c),o(c,a,s)}return{evaluate:l}}_compile(o,a){throw new Error("Method _compile must be implemented by type "+this.type)}forEach(o){throw new Error("Cannot run forEach on a Node interface")}map(o){throw new Error("Cannot run map on a Node interface")}_ifNode(o){if(!Yt(o))throw new TypeError("Callback function must return a Node");return o}traverse(o){o(this,null,null);function a(s,l){s.forEach(function(u,c,f){l(u,c,f),a(u,l)})}a(this,o)}transform(o){function a(s,l,u){var c=o(s,l,u);return c!==s?c:s.map(a)}return a(this,null,null)}filter(o){var a=[];return this.traverse(function(s,l,u){o(s,l,u)&&a.push(s)}),a}clone(){throw new Error("Cannot clone a Node interface")}cloneDeep(){return this.map(function(o){return o.cloneDeep()})}equals(o){return o?this.type===o.type&&lo(this,o):!1}toString(o){var a=this._getCustomString(o);return typeof a<"u"?a:this._toString(o)}_toString(){throw new Error("_toString not implemented for "+this.type)}toJSON(){throw new Error("Cannot serialize object: toJSON not implemented by "+this.type)}toHTML(o){var a=this._getCustomString(o);return typeof a<"u"?a:this._toHTML(o)}_toHTML(){throw new Error("_toHTML not implemented for "+this.type)}toTex(o){var a=this._getCustomString(o);return typeof a<"u"?a:this._toTex(o)}_toTex(o){throw new Error("_toTex not implemented for "+this.type)}_getCustomString(o){if(o&&typeof o=="object")switch(typeof o.handler){case"object":case"undefined":return;case"function":return o.handler(this,o);default:throw new TypeError("Object or function expected as callback")}}getIdentifier(){return this.type}getContent(){return this}}return i},{isClass:!0,isNode:!0});function qr(t){return t&&t.isIndexError?new ii(t.index+1,t.min+1,t.max!==void 0?t.max+1:void 0):t}function Gy(t){var{subset:e}=t;return function(i,n){try{if(Array.isArray(i))return e(i,n);if(i&&typeof i.subset=="function")return i.subset(n);if(typeof i=="string")return e(i,n);if(typeof i=="object"){if(!n.isObjectProperty())throw new TypeError("Cannot apply a numeric index as object property");return Yr(i,n.getObjectProperty())}else throw new TypeError("Cannot apply index: unsupported type of object")}catch(o){throw qr(o)}}}var Wy="AccessorNode",lae=["subset","Node"],DL=N(Wy,lae,t=>{var{subset:e,Node:r}=t,i=Gy({subset:e});function n(a){return!(ji(a)||ei(a)||Lt(a)||gi(a)||Ka(a)||ti(a)||Nr(a))}class o extends r{constructor(s,l){if(super(),!Yt(s))throw new TypeError('Node expected for parameter "object"');if(!uo(l))throw new TypeError('IndexNode expected for parameter "index"');this.object=s,this.index=l}get name(){return this.index?this.index.isObjectProperty()?this.index.getObjectProperty():"":this.object.name||""}get type(){return Wy}get isAccessorNode(){return!0}_compile(s,l){var u=this.object._compile(s,l),c=this.index._compile(s,l);if(this.index.isObjectProperty()){var f=this.index.getObjectProperty();return function(p,d,h){return Yr(u(p,d,h),f)}}else return function(p,d,h){var v=u(p,d,h),y=c(p,d,v);return i(v,y)}}forEach(s){s(this.object,"object",this),s(this.index,"index",this)}map(s){return new o(this._ifNode(s(this.object,"object",this)),this._ifNode(s(this.index,"index",this)))}clone(){return new o(this.object,this.index)}_toString(s){var l=this.object.toString(s);return n(this.object)&&(l="("+l+")"),l+this.index.toString(s)}_toHTML(s){var l=this.object.toHTML(s);return n(this.object)&&(l='<span class="math-parenthesis math-round-parenthesis">(</span>'+l+'<span class="math-parenthesis math-round-parenthesis">)</span>'),l+this.index.toHTML(s)}_toTex(s){var l=this.object.toTex(s);return n(this.object)&&(l="\\left(' + object + '\\right)"),l+this.index.toTex(s)}toJSON(){return{mathjs:Wy,object:this.object,index:this.index}}static fromJSON(s){return new o(s.object,s.index)}}return dr(o,"name",Wy),o},{isClass:!0,isNode:!0});var Hy="ArrayNode",cae=["Node"],EL=N(Hy,cae,t=>{var{Node:e}=t;class r extends e{constructor(n){if(super(),this.items=n||[],!Array.isArray(this.items)||!this.items.every(Yt))throw new TypeError("Array containing Nodes expected")}get type(){return Hy}get isArrayNode(){return!0}_compile(n,o){var a=ia(this.items,function(u){return u._compile(n,o)}),s=n.config.matrix!=="Array";if(s){var l=n.matrix;return function(c,f,m){return l(ia(a,function(p){return p(c,f,m)}))}}else return function(c,f,m){return ia(a,function(p){return p(c,f,m)})}}forEach(n){for(var o=0;o<this.items.length;o++){var a=this.items[o];n(a,"items["+o+"]",this)}}map(n){for(var o=[],a=0;a<this.items.length;a++)o[a]=this._ifNode(n(this.items[a],"items["+a+"]",this));return new r(o)}clone(){return new r(this.items.slice(0))}_toString(n){var o=this.items.map(function(a){return a.toString(n)});return"["+o.join(", ")+"]"}toJSON(){return{mathjs:Hy,items:this.items}}static fromJSON(n){return new r(n.items)}_toHTML(n){var o=this.items.map(function(a){return a.toHTML(n)});return'<span class="math-parenthesis math-square-parenthesis">[</span>'+o.join('<span class="math-separator">,</span>')+'<span class="math-parenthesis math-square-parenthesis">]</span>'}_toTex(n){function o(a,s){var l=a.some(ei)&&!a.every(ei),u=s||l,c=u?"&":"\\\\",f=a.map(function(m){return m.items?o(m.items,!s):m.toTex(n)}).join(c);return l||!u||u&&!s?"\\begin{bmatrix}"+f+"\\end{bmatrix}":f}return o(this.items,!1)}}return dr(r,"name",Hy),r},{isClass:!0,isNode:!0});function AL(t){var{subset:e,matrix:r}=t;return function(n,o,a){try{if(Array.isArray(n)){var s=r(n).subset(o,a).valueOf();return s.forEach((l,u)=>{n[u]=l}),n}else{if(n&&typeof n.subset=="function")return n.subset(o,a);if(typeof n=="string")return e(n,o,a);if(typeof n=="object"){if(!o.isObjectProperty())throw TypeError("Cannot apply a numeric index as object property");return Ha(n,o.getObjectProperty(),a),n}else throw new TypeError("Cannot apply index: unsupported type of object")}}catch(l){throw qr(l)}}}var la=[{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 Yy(t,e){if(!e||e!=="auto")return t;for(var r=t;ti(r);)r=r.content;return r}function br(t,e,r,i){var n=t;e!=="keep"&&(n=t.getContent());for(var o=n.getIdentifier(),a=null,s=0;s<la.length;s++)if(o in la[s]){a=s;break}if(o==="OperatorNode:multiply"&&n.implicit&&r!=="show"){var l=Yy(n.args[0],e);!(Lt(l)&&i&&i.getIdentifier()==="OperatorNode:divide"&&Hp(Yy(i.args[0],e)))&&!(l.getIdentifier()==="OperatorNode:divide"&&Hp(Yy(l.args[0],e))&&Lt(Yy(l.args[1])))&&(a+=1)}return a}function af(t,e){var r=t;e!=="keep"&&(r=t.getContent());var i=r.getIdentifier(),n=br(r,e);if(n===null)return null;var o=la[n][i];if(rt(o,"associativity")){if(o.associativity==="left")return"left";if(o.associativity==="right")return"right";throw Error("'"+i+"' has the invalid associativity '"+o.associativity+"'.")}return null}function Jy(t,e,r){var i=r!=="keep"?t.getContent():t,n=r!=="keep"?t.getContent():e,o=i.getIdentifier(),a=n.getIdentifier(),s=br(i,r);if(s===null)return null;var l=la[s][o];if(rt(l,"associativeWith")&&l.associativeWith instanceof Array){for(var u=0;u<l.associativeWith.length;u++)if(l.associativeWith[u]===a)return!0;return!1}return null}function TL(t){var e="OperatorNode:"+t;for(var r of la)if(e in r)return r[e].op;return null}var Xy="AssignmentNode",fae=["subset","?matrix","Node"],NL=N(Xy,fae,t=>{var{subset:e,matrix:r,Node:i}=t,n=Gy({subset:e}),o=AL({subset:e,matrix:r});function a(l,u,c){u||(u="keep");var f=br(l,u,c),m=br(l.value,u,c);return u==="all"||m!==null&&m<=f}class s extends i{constructor(u,c,f){if(super(),this.object=u,this.index=f?c:null,this.value=f||c,!Nr(u)&&!ji(u))throw new TypeError('SymbolNode or AccessorNode expected as "object"');if(Nr(u)&&u.name==="end")throw new Error('Cannot assign to symbol "end"');if(this.index&&!uo(this.index))throw new TypeError('IndexNode expected as "index"');if(!Yt(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 Xy}get isAssignmentNode(){return!0}_compile(u,c){var f=this.object._compile(u,c),m=this.index?this.index._compile(u,c):null,p=this.value._compile(u,c),d=this.object.name;if(this.index)if(this.index.isObjectProperty()){var h=this.index.getObjectProperty();return function(_,w,x){var E=f(_,w,x),T=p(_,w,x);return Ha(E,h,T),T}}else{if(Nr(this.object))return function(_,w,x){var E=f(_,w,x),T=p(_,w,x),D=m(_,w,E);return _.set(d,o(E,D,T)),T};var v=this.object.object._compile(u,c);if(this.object.index.isObjectProperty()){var y=this.object.index.getObjectProperty();return function(_,w,x){var E=v(_,w,x),T=Yr(E,y),D=m(_,w,T),M=p(_,w,x);return Ha(E,y,o(T,D,M)),M}}else{var S=this.object.index._compile(u,c);return function(_,w,x){var E=v(_,w,x),T=S(_,w,E),D=n(E,T),M=m(_,w,D),C=p(_,w,x);return o(E,T,o(D,M,C)),C}}}else{if(!Nr(this.object))throw new TypeError("SymbolNode expected as object");return function(_,w,x){var E=p(_,w,x);return _.set(d,E),E}}}forEach(u){u(this.object,"object",this),this.index&&u(this.index,"index",this),u(this.value,"value",this)}map(u){var c=this._ifNode(u(this.object,"object",this)),f=this.index?this._ifNode(u(this.index,"index",this)):null,m=this._ifNode(u(this.value,"value",this));return new s(c,f,m)}clone(){return new s(this.object,this.index,this.value)}_toString(u){var c=this.object.toString(u),f=this.index?this.index.toString(u):"",m=this.value.toString(u);return a(this,u&&u.parenthesis,u&&u.implicit)&&(m="("+m+")"),c+f+" = "+m}toJSON(){return{mathjs:Xy,object:this.object,index:this.index,value:this.value}}static fromJSON(u){return new s(u.object,u.index,u.value)}_toHTML(u){var c=this.object.toHTML(u),f=this.index?this.index.toHTML(u):"",m=this.value.toHTML(u);return a(this,u&&u.parenthesis,u&&u.implicit)&&(m='<span class="math-paranthesis math-round-parenthesis">(</span>'+m+'<span class="math-paranthesis math-round-parenthesis">)</span>'),c+f+'<span class="math-operator math-assignment-operator math-variable-assignment-operator math-binary-operator">=</span>'+m}_toTex(u){var c=this.object.toTex(u),f=this.index?this.index.toTex(u):"",m=this.value.toTex(u);return a(this,u&&u.parenthesis,u&&u.implicit)&&(m="\\left(".concat(m,"\\right)")),c+f+"="+m}}return dr(s,"name",Xy),s},{isClass:!0,isNode:!0});var Ky="BlockNode",pae=["ResultSet","Node"],ML=N(Ky,pae,t=>{var{ResultSet:e,Node:r}=t;class i extends r{constructor(o){if(super(),!Array.isArray(o))throw new Error("Array expected");this.blocks=o.map(function(a){var s=a&&a.node,l=a&&a.visible!==void 0?a.visible:!0;if(!Yt(s))throw new TypeError('Property "node" must be a Node');if(typeof l!="boolean")throw new TypeError('Property "visible" must be a boolean');return{node:s,visible:l}})}get type(){return Ky}get isBlockNode(){return!0}_compile(o,a){var s=ia(this.blocks,function(l){return{evaluate:l.node._compile(o,a),visible:l.visible}});return function(u,c,f){var m=[];return ny(s,function(d){var h=d.evaluate(u,c,f);d.visible&&m.push(h)}),new e(m)}}forEach(o){for(var a=0;a<this.blocks.length;a++)o(this.blocks[a].node,"blocks["+a+"].node",this)}map(o){for(var a=[],s=0;s<this.blocks.length;s++){var l=this.blocks[s],u=this._ifNode(o(l.node,"blocks["+s+"].node",this));a[s]={node:u,visible:l.visible}}return new i(a)}clone(){var o=this.blocks.map(function(a){return{node:a.node,visible:a.visible}});return new i(o)}_toString(o){return this.blocks.map(function(a){return a.node.toString(o)+(a.visible?"":";")}).join(`
`)}toJSON(){return{mathjs:Ky,blocks:this.blocks}}static fromJSON(o){return new i(o.blocks)}_toHTML(o){return this.blocks.map(function(a){return a.node.toHTML(o)+(a.visible?"":'<span class="math-separator">;</span>')}).join('<span class="math-separator"><br /></span>')}_toTex(o){return this.blocks.map(function(a){return a.node.toTex(o)+(a.visible?"":";")}).join(`\\;\\;
`)}}return dr(i,"name",Ky),i},{isClass:!0,isNode:!0});var Qy="ConditionalNode",mae=["Node"],CL=N(Qy,mae,t=>{var{Node:e}=t;function r(n){if(typeof n=="number"||typeof n=="boolean"||typeof n=="string")return!!n;if(n){if(mt(n))return!n.isZero();if(Qn(n))return!!(n.re||n.im);if(En(n))return!!n.value}if(n==null)return!1;throw new TypeError('Unsupported type of condition "'+ir(n)+'"')}class i extends e{constructor(o,a,s){if(super(),!Yt(o))throw new TypeError("Parameter condition must be a Node");if(!Yt(a))throw new TypeError("Parameter trueExpr must be a Node");if(!Yt(s))throw new TypeError("Parameter falseExpr must be a Node");this.condition=o,this.trueExpr=a,this.falseExpr=s}get type(){return Qy}get isConditionalNode(){return!0}_compile(o,a){var s=this.condition._compile(o,a),l=this.trueExpr._compile(o,a),u=this.falseExpr._compile(o,a);return function(f,m,p){return r(s(f,m,p))?l(f,m,p):u(f,m,p)}}forEach(o){o(this.condition,"condition",this),o(this.trueExpr,"trueExpr",this),o(this.falseExpr,"falseExpr",this)}map(o){return new i(this._ifNode(o(this.condition,"condition",this)),this._ifNode(o(this.trueExpr,"trueExpr",this)),this._ifNode(o(this.falseExpr,"falseExpr",this)))}clone(){return new i(this.condition,this.trueExpr,this.falseExpr)}_toString(o){var a=o&&o.parenthesis?o.parenthesis:"keep",s=br(this,a,o&&o.implicit),l=this.condition.toString(o),u=br(this.condition,a,o&&o.implicit);(a==="all"||this.condition.type==="OperatorNode"||u!==null&&u<=s)&&(l="("+l+")");var c=this.trueExpr.toString(o),f=br(this.trueExpr,a,o&&o.implicit);(a==="all"||this.trueExpr.type==="OperatorNode"||f!==null&&f<=s)&&(c="("+c+")");var m=this.falseExpr.toString(o),p=br(this.falseExpr,a,o&&o.implicit);return(a==="all"||this.falseExpr.type==="OperatorNode"||p!==null&&p<=s)&&(m="("+m+")"),l+" ? "+c+" : "+m}toJSON(){return{mathjs:Qy,condition:this.condition,trueExpr:this.trueExpr,falseExpr:this.falseExpr}}static fromJSON(o){return new i(o.condition,o.trueExpr,o.falseExpr)}_toHTML(o){var a=o&&o.parenthesis?o.parenthesis:"keep",s=br(this,a,o&&o.implicit),l=this.condition.toHTML(o),u=br(this.condition,a,o&&o.implicit);(a==="all"||this.condition.type==="OperatorNode"||u!==null&&u<=s)&&(l='<span class="math-parenthesis math-round-parenthesis">(</span>'+l+'<span class="math-parenthesis math-round-parenthesis">)</span>');var c=this.trueExpr.toHTML(o),f=br(this.trueExpr,a,o&&o.implicit);(a==="all"||this.trueExpr.type==="OperatorNode"||f!==null&&f<=s)&&(c='<span class="math-parenthesis math-round-parenthesis">(</span>'+c+'<span class="math-parenthesis math-round-parenthesis">)</span>');var m=this.falseExpr.toHTML(o),p=br(this.falseExpr,a,o&&o.implicit);return(a==="all"||this.falseExpr.type==="OperatorNode"||p!==null&&p<=s)&&(m='<span class="math-parenthesis math-round-parenthesis">(</span>'+m+'<span class="math-parenthesis math-round-parenthesis">)</span>'),l+'<span class="math-operator math-conditional-operator">?</span>'+c+'<span class="math-operator math-conditional-operator">:</span>'+m}_toTex(o){return"\\begin{cases} {"+this.trueExpr.toTex(o)+"}, &\\quad{\\text{if }\\;"+this.condition.toTex(o)+"}\\\\{"+this.falseExpr.toTex(o)+"}, &\\quad{\\text{otherwise}}\\end{cases}"}}return dr(i,"name",Qy),i},{isClass:!0,isNode:!0});var kL=Ar(IL(),1);var ZE={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{?}"},hr={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"},GE={abs:{1:"\\left|${args[0]}\\right|"},add:{2:"\\left(${args[0]}".concat(hr.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(hr.dotDivide,"${args[1]}\\right)")},dotMultiply:{2:"\\left(${args[0]}".concat(hr.dotMultiply,"${args[1]}\\right)")},dotPow:{2:"\\left(${args[0]}".concat(hr.dotPow,"${args[1]}\\right)")},exp:{1:"\\exp\\left(${args[0]}\\right)"},expm1:"\\left(e".concat(hr.pow,"{${args[0]}}-1\\right)"),fix:{1:"\\mathrm{${name}}\\left(${args[0]}\\right)"},floor:{1:"\\left\\lfloor${args[0]}\\right\\rfloor"},fraction:{2:"\\frac{${args[0]}}{${args[1]}}"},gcd:"\\gcd\\left(${args}\\right)",hypot:"\\hypot\\left(${args}\\right)",log:{1:"\\ln\\left(${args[0]}\\right)",2:"\\log_{${args[1]}}\\left(${args[0]}\\right)"},log10:{1:"\\log_{10}\\left(${args[0]}\\right)"},log1p:{1:"\\ln\\left(${args[0]}+1\\right)",2:"\\log_{${args[1]}}\\left(${args[0]}+1\\right)"},log2:"\\log_{2}\\left(${args[0]}\\right)",mod:{2:"\\left(${args[0]}".concat(hr.mod,"${args[1]}\\right)")},multiply:{2:"\\left(${args[0]}".concat(hr.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(hr.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(hr.subtract,"${args[1]}\\right)")},unaryMinus:{1:"".concat(hr.unaryMinus,"\\left(${args[0]}\\right)")},unaryPlus:{1:"".concat(hr.unaryPlus,"\\left(${args[0]}\\right)")},bitAnd:{2:"\\left(${args[0]}".concat(hr.bitAnd,"${args[1]}\\right)")},bitNot:{1:hr.bitNot+"\\left(${args[0]}\\right)"},bitOr:{2:"\\left(${args[0]}".concat(hr.bitOr,"${args[1]}\\right)")},bitXor:{2:"\\left(${args[0]}".concat(hr.bitXor,"${args[1]}\\right)")},leftShift:{2:"\\left(${args[0]}".concat(hr.leftShift,"${args[1]}\\right)")},rightArithShift:{2:"\\left(${args[0]}".concat(hr.rightArithShift,"${args[1]}\\right)")},rightLogShift:{2:"\\left(${args[0]}".concat(hr.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(hr.and,"${args[1]}\\right)")},not:{1:hr.not+"\\left(${args[0]}\\right)"},or:{2:"\\left(${args[0]}".concat(hr.or,"${args[1]}\\right)")},xor:{2:"\\left(${args[0]}".concat(hr.xor,"${args[1]}\\right)")},cross:{2:"\\left(${args[0]}\\right)\\times\\left(${args[1]}\\right)"},ctranspose:{1:"\\left(${args[0]}\\right)".concat(hr.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(hr.pow,"{\\frac{1}{2}}")},trace:{1:"\\mathrm{tr}\\left(${args[0]}\\right)"},transpose:{1:"\\left(${args[0]}\\right)".concat(hr.transpose)},combinations:{2:"\\binom{${args[0]}}{${args[1]}}"},combinationsWithRep:{2:"\\left(\\!\\!{\\binom{${args[0]}}{${args[1]}}}\\!\\!\\right)"},factorial:{1:"\\left(${args[0]}\\right)".concat(hr.factorial)},gamma:{1:"\\Gamma\\left(${args[0]}\\right)"},lgamma:{1:"\\ln\\Gamma\\left(${args[0]}\\right)"},equal:{2:"\\left(${args[0]}".concat(hr.equal,"${args[1]}\\right)")},larger:{2:"\\left(${args[0]}".concat(hr.larger,"${args[1]}\\right)")},largerEq:{2:"\\left(${args[0]}".concat(hr.largerEq,"${args[1]}\\right)")},smaller:{2:"\\left(${args[0]}".concat(hr.smaller,"${args[1]}\\right)")},smallerEq:{2:"\\left(${args[0]}".concat(hr.smallerEq,"${args[1]}\\right)")},unequal:{2:"\\left(${args[0]}".concat(hr.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(hr.to,"${args[1]}\\right)")},numeric:function(e,r){return e.args[0].toTex()},number:{0:"0",1:"\\left(${args[0]}\\right)",2:"\\left(\\left(${args[0]}\\right)${args[1]}\\right)"},string:{0:'\\mathtt{""}',1:"\\mathrm{string}\\left(${args[0]}\\right)"},bignumber:{0:"0",1:"\\left(${args[0]}\\right)"},bigint:{0:"0",1:"\\left(${args[0]}\\right)"},complex:{0:"0",1:"\\left(${args[0]}\\right)",2:"\\left(\\left(${args[0]}\\right)+".concat(ZE.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)"}},PL="\\mathrm{${name}}\\left(${args}\\right)",FL={deg:"^\\circ"};function eb(t){return(0,kL.default)(t,{preserveFormatting:!0})}function tb(t,e){return e=typeof e>"u"?!1:e,e?rt(FL,t)?FL[t]:"\\mathrm{"+eb(t)+"}":rt(ZE,t)?ZE[t]:eb(t)}var rb="ConstantNode",vae=["Node"],BL=N(rb,vae,t=>{var{Node:e}=t;class r extends e{constructor(n){super(),this.value=n}get type(){return rb}get isConstantNode(){return!0}_compile(n,o){var a=this.value;return function(){return a}}forEach(n){}map(n){return this.clone()}clone(){return new r(this.value)}_toString(n){return Ct(this.value,n)}_toHTML(n){var o=this._toString(n);switch(ir(this.value)){case"number":case"bigint":case"BigNumber":case"Fraction":return'<span class="math-number">'+o+"</span>";case"string":return'<span class="math-string">'+o+"</span>";case"boolean":return'<span class="math-boolean">'+o+"</span>";case"null":return'<span class="math-null-symbol">'+o+"</span>";case"undefined":return'<span class="math-undefined">'+o+"</span>";default:return'<span class="math-symbol">'+o+"</span>"}}toJSON(){return{mathjs:rb,value:this.value}}static fromJSON(n){return new r(n.value)}_toTex(n){var o=this._toString(n),a=ir(this.value);switch(a){case"string":return"\\mathtt{"+eb(o)+"}";case"number":case"BigNumber":{var s=a==="BigNumber"?this.value.isFinite():isFinite(this.value);if(!s)return this.value.valueOf()<0?"-\\infty":"\\infty";var l=o.toLowerCase().indexOf("e");return l!==-1?o.substring(0,l)+"\\cdot10^{"+o.substring(l+1)+"}":o}case"bigint":return o.toString();case"Fraction":return this.value.toLatex();default:return o}}}return dr(r,"name",rb),r},{isClass:!0,isNode:!0});var nb="FunctionAssignmentNode",yae=["typed","Node"],OL=N(nb,yae,t=>{var{typed:e,Node:r}=t;function i(o,a,s){var l=br(o,a,s),u=br(o.expr,a,s);return a==="all"||u!==null&&u<=l}class n extends r{constructor(a,s,l){if(super(),typeof a!="string")throw new TypeError('String expected for parameter "name"');if(!Array.isArray(s))throw new TypeError('Array containing strings or objects expected for parameter "params"');if(!Yt(l))throw new TypeError('Node expected for parameter "expr"');if(Zy.has(a))throw new Error('Illegal function name, "'+a+'" is a reserved keyword');var u=new Set;for(var c of s){var f=typeof c=="string"?c:c.name;if(u.has(f))throw new Error('Duplicate parameter name "'.concat(f,'"'));u.add(f)}this.name=a,this.params=s.map(function(m){return m&&m.name||m}),this.types=s.map(function(m){return m&&m.type||"any"}),this.expr=l}get type(){return nb}get isFunctionAssignmentNode(){return!0}_compile(a,s){var l=Object.create(s);ny(this.params,function(d){l[d]=!0});var u=this.expr._compile(a,l),c=this.name,f=this.params,m=UD(this.types,","),p=c+"("+UD(this.params,", ")+")";return function(h,v,y){var S={};S[m]=function(){for(var _=Object.create(v),w=0;w<f.length;w++)_[f[w]]=arguments[w];return u(h,_,y)};var b=e(c,S);return b.syntax=p,h.set(c,b),b}}forEach(a){a(this.expr,"expr",this)}map(a){var s=this._ifNode(a(this.expr,"expr",this));return new n(this.name,this.params.slice(0),s)}clone(){return new n(this.name,this.params.slice(0),this.expr)}_toString(a){var s=a&&a.parenthesis?a.parenthesis:"keep",l=this.expr.toString(a);return i(this,s,a&&a.implicit)&&(l="("+l+")"),this.name+"("+this.params.join(", ")+") = "+l}toJSON(){var a=this.types;return{mathjs:nb,name:this.name,params:this.params.map(function(s,l){return{name:s,type:a[l]}}),expr:this.expr}}static fromJSON(a){return new n(a.name,a.params,a.expr)}_toHTML(a){for(var s=a&&a.parenthesis?a.parenthesis:"keep",l=[],u=0;u<this.params.length;u++)l.push('<span class="math-symbol math-parameter">'+ni(this.params[u])+"</span>");var c=this.expr.toHTML(a);return i(this,s,a&&a.implicit)&&(c='<span class="math-parenthesis math-round-parenthesis">(</span>'+c+'<span class="math-parenthesis math-round-parenthesis">)</span>'),'<span class="math-function">'+ni(this.name)+'</span><span class="math-parenthesis math-round-parenthesis">(</span>'+l.join('<span class="math-separator">,</span>')+'<span class="math-parenthesis math-round-parenthesis">)</span><span class="math-operator math-assignment-operator math-variable-assignment-operator math-binary-operator">=</span>'+c}_toTex(a){var s=a&&a.parenthesis?a.parenthesis:"keep",l=this.expr.toTex(a);return i(this,s,a&&a.implicit)&&(l="\\left(".concat(l,"\\right)")),"\\mathrm{"+this.name+"}\\left("+this.params.map(tb).join(",")+"\\right)="+l}}return dr(n,"name",nb),n},{isClass:!0,isNode:!0});var ib="IndexNode",bae=["Node","size"],RL=N(ib,bae,t=>{var{Node:e,size:r}=t;class i extends e{constructor(o,a){if(super(),this.dimensions=o,this.dotNotation=a||!1,!Array.isArray(o)||!o.every(Yt))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 ib}get isIndexNode(){return!0}_compile(o,a){var s=ia(this.dimensions,function(u,c){var f=u.filter(d=>d.isSymbolNode&&d.name==="end").length>0;if(f){var m=Object.create(a);m.end=!0;var p=u._compile(o,m);return function(h,v,y){if(!Je(y)&&!sr(y)&&!Qr(y))throw new TypeError('Cannot resolve "end": context must be a Matrix, Array, or string but is '+ir(y));var S=r(y).valueOf(),b=Object.create(v);return b.end=S[c],p(h,b,y)}}else return u._compile(o,a)}),l=Yr(o,"index");return function(c,f,m){var p=ia(s,function(d){return d(c,f,m)});return l(...p)}}forEach(o){for(var a=0;a<this.dimensions.length;a++)o(this.dimensions[a],"dimensions["+a+"]",this)}map(o){for(var a=[],s=0;s<this.dimensions.length;s++)a[s]=this._ifNode(o(this.dimensions[s],"dimensions["+s+"]",this));return new i(a,this.dotNotation)}clone(){return new i(this.dimensions.slice(0),this.dotNotation)}isObjectProperty(){return this.dimensions.length===1&&Lt(this.dimensions[0])&&typeof this.dimensions[0].value=="string"}getObjectProperty(){return this.isObjectProperty()?this.dimensions[0].value:null}_toString(o){return this.dotNotation?"."+this.getObjectProperty():"["+this.dimensions.join(", ")+"]"}toJSON(){return{mathjs:ib,dimensions:this.dimensions,dotNotation:this.dotNotation}}static fromJSON(o){return new i(o.dimensions,o.dotNotation)}_toHTML(o){for(var a=[],s=0;s<this.dimensions.length;s++)a[s]=this.dimensions[s].toHTML();return this.dotNotation?'<span class="math-operator math-accessor-operator">.</span><span class="math-symbol math-property">'+ni(this.getObjectProperty())+"</span>":'<span class="math-parenthesis math-square-parenthesis">[</span>'+a.join('<span class="math-separator">,</span>')+'<span class="math-parenthesis math-square-parenthesis">]</span>'}_toTex(o){var a=this.dimensions.map(function(s){return s.toTex(o)});return this.dotNotation?"."+this.getObjectProperty():"_{"+a.join(",")+"}"}}return dr(i,"name",ib),i},{isClass:!0,isNode:!0});var ob="ObjectNode",xae=["Node"],LL=N(ob,xae,t=>{var{Node:e}=t;class r extends e{constructor(n){if(super(),this.properties=n||{},n&&(typeof n!="object"||!Object.keys(n).every(function(o){return Yt(n[o])})))throw new TypeError("Object containing Nodes expected")}get type(){return ob}get isObjectNode(){return!0}_compile(n,o){var a={};for(var s in this.properties)if(rt(this.properties,s)){var l=xl(s),u=JSON.parse(l),c=Yr(this.properties,s);a[u]=c._compile(n,o)}return function(m,p,d){var h={};for(var v in a)rt(a,v)&&(h[v]=a[v](m,p,d));return h}}forEach(n){for(var o in this.properties)rt(this.properties,o)&&n(this.properties[o],"properties["+xl(o)+"]",this)}map(n){var o={};for(var a in this.properties)rt(this.properties,a)&&(o[a]=this._ifNode(n(this.properties[a],"properties["+xl(a)+"]",this)));return new r(o)}clone(){var n={};for(var o in this.properties)rt(this.properties,o)&&(n[o]=this.properties[o]);return new r(n)}_toString(n){var o=[];for(var a in this.properties)rt(this.properties,a)&&o.push(xl(a)+": "+this.properties[a].toString(n));return"{"+o.join(", ")+"}"}toJSON(){return{mathjs:ob,properties:this.properties}}static fromJSON(n){return new r(n.properties)}_toHTML(n){var o=[];for(var a in this.properties)rt(this.properties,a)&&o.push('<span class="math-symbol math-property">'+ni(a)+'</span><span class="math-operator math-assignment-operator math-property-assignment-operator math-binary-operator">:</span>'+this.properties[a].toHTML(n));return'<span class="math-parenthesis math-curly-parenthesis">{</span>'+o.join('<span class="math-separator">,</span>')+'<span class="math-parenthesis math-curly-parenthesis">}</span>'}_toTex(n){var o=[];for(var a in this.properties)rt(this.properties,a)&&o.push("\\mathbf{"+a+":} & "+this.properties[a].toTex(n)+"\\\\");var s="\\left\\{\\begin{array}{ll}"+o.join(`
`)+"\\end{array}\\right\\}";return s}}return dr(r,"name",ob),r},{isClass:!0,isNode:!0});function Tl(t,e){return new Bc(t,new wu(e),new Set(Object.keys(e)))}var ab="OperatorNode",_ae=["Node"],UL=N(ab,_ae,t=>{var{Node:e}=t;function r(o,a){var s=o;if(a==="auto")for(;ti(s);)s=s.content;return Lt(s)?!0:Lr(s)?r(s.args[0],a):!1}function i(o,a,s,l,u){var c=br(o,a,s),f=af(o,a);if(a==="all"||l.length>2&&o.getIdentifier()!=="OperatorNode:add"&&o.getIdentifier()!=="OperatorNode:multiply")return l.map(function(M){switch(M.getContent().type){case"ArrayNode":case"ConstantNode":case"SymbolNode":case"ParenthesisNode":return!1;default:return!0}});var m;switch(l.length){case 0:m=[];break;case 1:{var p=br(l[0],a,s,o);if(u&&p!==null){var d,h;if(a==="keep"?(d=l[0].getIdentifier(),h=o.getIdentifier()):(d=l[0].getContent().getIdentifier(),h=o.getContent().getIdentifier()),la[c][h].latexLeftParens===!1){m=[!1];break}if(la[p][d].latexParens===!1){m=[!1];break}}if(p===null){m=[!1];break}if(p<=c){m=[!0];break}m=[!1]}break;case 2:{var v,y=br(l[0],a,s,o),S=Jy(o,l[0],a);y===null?v=!1:y===c&&f==="right"&&!S||y<c?v=!0:v=!1;var b,_=br(l[1],a,s,o),w=Jy(o,l[1],a);if(_===null?b=!1:_===c&&f==="left"&&!w||_<c?b=!0:b=!1,u){var x,E,T;a==="keep"?(x=o.getIdentifier(),E=o.args[0].getIdentifier(),T=o.args[1].getIdentifier()):(x=o.getContent().getIdentifier(),E=o.args[0].getContent().getIdentifier(),T=o.args[1].getContent().getIdentifier()),y!==null&&(la[c][x].latexLeftParens===!1&&(v=!1),la[y][E].latexParens===!1&&(v=!1)),_!==null&&(la[c][x].latexRightParens===!1&&(b=!1),la[_][T].latexParens===!1&&(b=!1))}m=[v,b]}break;default:(o.getIdentifier()==="OperatorNode:add"||o.getIdentifier()==="OperatorNode:multiply")&&(m=l.map(function(M){var C=br(M,a,s,o),$=Jy(o,M,a),O=af(M,a);return C===null?!1:c===C&&f===O&&!$?!0:C<c}));break}if(l.length>=2&&o.getIdentifier()==="OperatorNode:multiply"&&o.implicit&&a!=="all"&&s==="hide")for(var D=1;D<m.length;++D)r(l[D],a)&&!m[D-1]&&(a!=="keep"||!ti(l[D-1]))&&(m[D]=!0);return m}class n extends e{constructor(a,s,l,u,c){if(super(),typeof a!="string")throw new TypeError('string expected for parameter "op"');if(typeof s!="string")throw new TypeError('string expected for parameter "fn"');if(!Array.isArray(l)||!l.every(Yt))throw new TypeError('Array containing Nodes expected for parameter "args"');this.implicit=u===!0,this.isPercentage=c===!0,this.op=a,this.fn=s,this.args=l||[]}get type(){return ab}get isOperatorNode(){return!0}_compile(a,s){if(typeof this.fn!="string"||!Ev(a,this.fn))throw a[this.fn]?new Error('No access to function "'+this.fn+'"'):new Error("Function "+this.fn+' missing in provided namespace "math"');var l=Yr(a,this.fn),u=ia(this.args,function(d){return d._compile(a,s)});if(typeof l=="function"&&l.rawArgs===!0){var c=this.args;return function(h,v,y){return l(c,a,Tl(h,v))}}else if(u.length===1){var f=u[0];return function(h,v,y){return l(f(h,v,y))}}else if(u.length===2){var m=u[0],p=u[1];return function(h,v,y){return l(m(h,v,y),p(h,v,y))}}else return function(h,v,y){return l.apply(null,ia(u,function(S){return S(h,v,y)}))}}forEach(a){for(var s=0;s<this.args.length;s++)a(this.args[s],"args["+s+"]",this)}map(a){for(var s=[],l=0;l<this.args.length;l++)s[l]=this._ifNode(a(this.args[l],"args["+l+"]",this));return new n(this.op,this.fn,s,this.implicit,this.isPercentage)}clone(){return new n(this.op,this.fn,this.args.slice(0),this.implicit,this.isPercentage)}isUnary(){return this.args.length===1}isBinary(){return this.args.length===2}_toString(a){var s=a&&a.parenthesis?a.parenthesis:"keep",l=a&&a.implicit?a.implicit:"hide",u=this.args,c=i(this,s,l,u,!1);if(u.length===1){var f=af(this,s),m=u[0].toString(a);c[0]&&(m="("+m+")");var p=/[a-zA-Z]+/.test(this.op);return f==="right"?this.op+(p?" ":"")+m:f==="left"?m+(p?" ":"")+this.op:m+this.op}else if(u.length===2){var d=u[0].toString(a),h=u[1].toString(a);return c[0]&&(d="("+d+")"),c[1]&&(h="("+h+")"),this.implicit&&this.getIdentifier()==="OperatorNode:multiply"&&l==="hide"?d+" "+h:d+" "+this.op+" "+h}else if(u.length>2&&(this.getIdentifier()==="OperatorNode:add"||this.getIdentifier()==="OperatorNode:multiply")){var v=u.map(function(y,S){return y=y.toString(a),c[S]&&(y="("+y+")"),y});return this.implicit&&this.getIdentifier()==="OperatorNode:multiply"&&l==="hide"?v.join(" "):v.join(" "+this.op+" ")}else return this.fn+"("+this.args.join(", ")+")"}toJSON(){return{mathjs:ab,op:this.op,fn:this.fn,args:this.args,implicit:this.implicit,isPercentage:this.isPercentage}}static fromJSON(a){return new n(a.op,a.fn,a.args,a.implicit,a.isPercentage)}_toHTML(a){var s=a&&a.parenthesis?a.parenthesis:"keep",l=a&&a.implicit?a.implicit:"hide",u=this.args,c=i(this,s,l,u,!1);if(u.length===1){var f=af(this,s),m=u[0].toHTML(a);return c[0]&&(m='<span class="math-parenthesis math-round-parenthesis">(</span>'+m+'<span class="math-parenthesis math-round-parenthesis">)</span>'),f==="right"?'<span class="math-operator math-unary-operator math-lefthand-unary-operator">'+ni(this.op)+"</span>"+m:m+'<span class="math-operator math-unary-operator math-righthand-unary-operator">'+ni(this.op)+"</span>"}else if(u.length===2){var p=u[0].toHTML(a),d=u[1].toHTML(a);return c[0]&&(p='<span class="math-parenthesis math-round-parenthesis">(</span>'+p+'<span class="math-parenthesis math-round-parenthesis">)</span>'),c[1]&&(d='<span class="math-parenthesis math-round-parenthesis">(</span>'+d+'<span class="math-parenthesis math-round-parenthesis">)</span>'),this.implicit&&this.getIdentifier()==="OperatorNode:multiply"&&l==="hide"?p+'<span class="math-operator math-binary-operator math-implicit-binary-operator"></span>'+d:p+'<span class="math-operator math-binary-operator math-explicit-binary-operator">'+ni(this.op)+"</span>"+d}else{var h=u.map(function(v,y){return v=v.toHTML(a),c[y]&&(v='<span class="math-parenthesis math-round-parenthesis">(</span>'+v+'<span class="math-parenthesis math-round-parenthesis">)</span>'),v});return u.length>2&&(this.getIdentifier()==="OperatorNode:add"||this.getIdentifier()==="OperatorNode:multiply")?this.implicit&&this.getIdentifier()==="OperatorNode:multiply"&&l==="hide"?h.join('<span class="math-operator math-binary-operator math-implicit-binary-operator"></span>'):h.join('<span class="math-operator math-binary-operator math-explicit-binary-operator">'+ni(this.op)+"</span>"):'<span class="math-function">'+ni(this.fn)+'</span><span class="math-paranthesis math-round-parenthesis">(</span>'+h.join('<span class="math-separator">,</span>')+'<span class="math-paranthesis math-round-parenthesis">)</span>'}}_toTex(a){var s=a&&a.parenthesis?a.parenthesis:"keep",l=a&&a.implicit?a.implicit:"hide",u=this.args,c=i(this,s,l,u,!0),f=hr[this.fn];if(f=typeof f>"u"?this.op:f,u.length===1){var m=af(this,s),p=u[0].toTex(a);return c[0]&&(p="\\left(".concat(p,"\\right)")),m==="right"?f+p:p+f}else if(u.length===2){var d=u[0],h=d.toTex(a);c[0]&&(h="\\left(".concat(h,"\\right)"));var v=u[1],y=v.toTex(a);c[1]&&(y="\\left(".concat(y,"\\right)"));var S;switch(s==="keep"?S=d.getIdentifier():S=d.getContent().getIdentifier(),this.getIdentifier()){case"OperatorNode:divide":return f+"{"+h+"}{"+y+"}";case"OperatorNode:pow":switch(h="{"+h+"}",y="{"+y+"}",S){case"ConditionalNode":case"OperatorNode:divide":h="\\left(".concat(h,"\\right)")}break;case"OperatorNode:multiply":if(this.implicit&&l==="hide")return h+"~"+y}return h+f+y}else if(u.length>2&&(this.getIdentifier()==="OperatorNode:add"||this.getIdentifier()==="OperatorNode:multiply")){var b=u.map(function(_,w){return _=_.toTex(a),c[w]&&(_="\\left(".concat(_,"\\right)")),_});return this.getIdentifier()==="OperatorNode:multiply"&&this.implicit&&l==="hide"?b.join("~"):b.join(f)}else return"\\mathrm{"+this.fn+"}\\left("+u.map(function(_){return _.toTex(a)}).join(",")+"\\right)"}getIdentifier(){return this.type+":"+this.fn}}return dr(n,"name",ab),n},{isClass:!0,isNode:!0});var sb="ParenthesisNode",wae=["Node"],zL=N(sb,wae,t=>{var{Node:e}=t;class r extends e{constructor(n){if(super(),!Yt(n))throw new TypeError('Node expected for parameter "content"');this.content=n}get type(){return sb}get isParenthesisNode(){return!0}_compile(n,o){return this.content._compile(n,o)}getContent(){return this.content.getContent()}forEach(n){n(this.content,"content",this)}map(n){var o=n(this.content,"content",this);return new r(o)}clone(){return new r(this.content)}_toString(n){return!n||n&&!n.parenthesis||n&&n.parenthesis==="keep"?"("+this.content.toString(n)+")":this.content.toString(n)}toJSON(){return{mathjs:sb,content:this.content}}static fromJSON(n){return new r(n.content)}_toHTML(n){return!n||n&&!n.parenthesis||n&&n.parenthesis==="keep"?'<span class="math-parenthesis math-round-parenthesis">(</span>'+this.content.toHTML(n)+'<span class="math-parenthesis math-round-parenthesis">)</span>':this.content.toHTML(n)}_toTex(n){return!n||n&&!n.parenthesis||n&&n.parenthesis==="keep"?"\\left(".concat(this.content.toTex(n),"\\right)"):this.content.toTex(n)}}return dr(r,"name",sb),r},{isClass:!0,isNode:!0});var ub="RangeNode",Sae=["Node"],VL=N(ub,Sae,t=>{var{Node:e}=t;function r(n,o,a){var s=br(n,o,a),l={},u=br(n.start,o,a);if(l.start=u!==null&&u<=s||o==="all",n.step){var c=br(n.step,o,a);l.step=c!==null&&c<=s||o==="all"}var f=br(n.end,o,a);return l.end=f!==null&&f<=s||o==="all",l}class i extends e{constructor(o,a,s){if(super(),!Yt(o))throw new TypeError("Node expected");if(!Yt(a))throw new TypeError("Node expected");if(s&&!Yt(s))throw new TypeError("Node expected");if(arguments.length>3)throw new Error("Too many arguments");this.start=o,this.end=a,this.step=s||null}get type(){return ub}get isRangeNode(){return!0}needsEnd(){var o=this.filter(function(a){return Nr(a)&&a.name==="end"});return o.length>0}_compile(o,a){var s=o.range,l=this.start._compile(o,a),u=this.end._compile(o,a);if(this.step){var c=this.step._compile(o,a);return function(m,p,d){return s(l(m,p,d),u(m,p,d),c(m,p,d))}}else return function(m,p,d){return s(l(m,p,d),u(m,p,d))}}forEach(o){o(this.start,"start",this),o(this.end,"end",this),this.step&&o(this.step,"step",this)}map(o){return new i(this._ifNode(o(this.start,"start",this)),this._ifNode(o(this.end,"end",this)),this.step&&this._ifNode(o(this.step,"step",this)))}clone(){return new i(this.start,this.end,this.step&&this.step)}_toString(o){var a=o&&o.parenthesis?o.parenthesis:"keep",s=r(this,a,o&&o.implicit),l,u=this.start.toString(o);if(s.start&&(u="("+u+")"),l=u,this.step){var c=this.step.toString(o);s.step&&(c="("+c+")"),l+=":"+c}var f=this.end.toString(o);return s.end&&(f="("+f+")"),l+=":"+f,l}toJSON(){return{mathjs:ub,start:this.start,end:this.end,step:this.step}}static fromJSON(o){return new i(o.start,o.end,o.step)}_toHTML(o){var a=o&&o.parenthesis?o.parenthesis:"keep",s=r(this,a,o&&o.implicit),l,u=this.start.toHTML(o);if(s.start&&(u='<span class="math-parenthesis math-round-parenthesis">(</span>'+u+'<span class="math-parenthesis math-round-parenthesis">)</span>'),l=u,this.step){var c=this.step.toHTML(o);s.step&&(c='<span class="math-parenthesis math-round-parenthesis">(</span>'+c+'<span class="math-parenthesis math-round-parenthesis">)</span>'),l+='<span class="math-operator math-range-operator">:</span>'+c}var f=this.end.toHTML(o);return s.end&&(f='<span class="math-parenthesis math-round-parenthesis">(</span>'+f+'<span class="math-parenthesis math-round-parenthesis">)</span>'),l+='<span class="math-operator math-range-operator">:</span>'+f,l}_toTex(o){var a=o&&o.parenthesis?o.parenthesis:"keep",s=r(this,a,o&&o.implicit),l=this.start.toTex(o);if(s.start&&(l="\\left(".concat(l,"\\right)")),this.step){var u=this.step.toTex(o);s.step&&(u="\\left(".concat(u,"\\right)")),l+=":"+u}var c=this.end.toTex(o);return s.end&&(c="\\left(".concat(c,"\\right)")),l+=":"+c,l}}return dr(i,"name",ub),i},{isClass:!0,isNode:!0});var lb="RelationalNode",Dae=["Node"],qL=N(lb,Dae,t=>{var{Node:e}=t,r={equal:"==",unequal:"!=",smaller:"<",larger:">",smallerEq:"<=",largerEq:">="};class i extends e{constructor(o,a){if(super(),!Array.isArray(o))throw new TypeError("Parameter conditionals must be an array");if(!Array.isArray(a))throw new TypeError("Parameter params must be an array");if(o.length!==a.length-1)throw new TypeError("Parameter params must contain exactly one more element than parameter conditionals");this.conditionals=o,this.params=a}get type(){return lb}get isRelationalNode(){return!0}_compile(o,a){var s=this,l=this.params.map(u=>u._compile(o,a));return function(c,f,m){for(var p,d=l[0](c,f,m),h=0;h<s.conditionals.length;h++){p=d,d=l[h+1](c,f,m);var v=Yr(o,s.conditionals[h]);if(!v(p,d))return!1}return!0}}forEach(o){this.params.forEach((a,s)=>o(a,"params["+s+"]",this),this)}map(o){return new i(this.conditionals.slice(),this.params.map((a,s)=>this._ifNode(o(a,"params["+s+"]",this)),this))}clone(){return new i(this.conditionals,this.params)}_toString(o){for(var a=o&&o.parenthesis?o.parenthesis:"keep",s=br(this,a,o&&o.implicit),l=this.params.map(function(f,m){var p=br(f,a,o&&o.implicit);return a==="all"||p!==null&&p<=s?"("+f.toString(o)+")":f.toString(o)}),u=l[0],c=0;c<this.conditionals.length;c++)u+=" "+r[this.conditionals[c]],u+=" "+l[c+1];return u}toJSON(){return{mathjs:lb,conditionals:this.conditionals,params:this.params}}static fromJSON(o){return new i(o.conditionals,o.params)}_toHTML(o){for(var a=o&&o.parenthesis?o.parenthesis:"keep",s=br(this,a,o&&o.implicit),l=this.params.map(function(f,m){var p=br(f,a,o&&o.implicit);return a==="all"||p!==null&&p<=s?'<span class="math-parenthesis math-round-parenthesis">(</span>'+f.toHTML(o)+'<span class="math-parenthesis math-round-parenthesis">)</span>':f.toHTML(o)}),u=l[0],c=0;c<this.conditionals.length;c++)u+='<span class="math-operator math-binary-operator math-explicit-binary-operator">'+ni(r[this.conditionals[c]])+"</span>"+l[c+1];return u}_toTex(o){for(var a=o&&o.parenthesis?o.parenthesis:"keep",s=br(this,a,o&&o.implicit),l=this.params.map(function(f,m){var p=br(f,a,o&&o.implicit);return a==="all"||p!==null&&p<=s?"\\left("+f.toTex(o)+"\right)":f.toTex(o)}),u=l[0],c=0;c<this.conditionals.length;c++)u+=hr[this.conditionals[c]]+l[c+1];return u}}return dr(i,"name",lb),i},{isClass:!0,isNode:!0});var Eae="SymbolNode",Aae=["math","?Unit","Node"],jL=N(Eae,Aae,t=>{var{math:e,Unit:r,Node:i}=t;function n(a){return r?r.isValuelessUnit(a):!1}class o extends i{constructor(s){if(super(),typeof s!="string")throw new TypeError('String expected for parameter "name"');this.name=s}get type(){return"SymbolNode"}get isSymbolNode(){return!0}_compile(s,l){var u=this.name;if(l[u]===!0)return function(f,m,p){return Yr(m,u)};if(u in s)return function(f,m,p){return f.has(u)?f.get(u):Yr(s,u)};var c=n(u);return function(f,m,p){return f.has(u)?f.get(u):c?new r(null,u):o.onUndefinedSymbol(u)}}forEach(s){}map(s){return this.clone()}static onUndefinedSymbol(s){throw new Error("Undefined symbol "+s)}clone(){return new o(this.name)}_toString(s){return this.name}_toHTML(s){var l=ni(this.name);return l==="true"||l==="false"?'<span class="math-symbol math-boolean">'+l+"</span>":l==="i"?'<span class="math-symbol math-imaginary-symbol">'+l+"</span>":l==="Infinity"?'<span class="math-symbol math-infinity-symbol">'+l+"</span>":l==="NaN"?'<span class="math-symbol math-nan-symbol">'+l+"</span>":l==="null"?'<span class="math-symbol math-null-symbol">'+l+"</span>":l==="undefined"?'<span class="math-symbol math-undefined-symbol">'+l+"</span>":'<span class="math-symbol">'+l+"</span>"}toJSON(){return{mathjs:"SymbolNode",name:this.name}}static fromJSON(s){return new o(s.name)}_toTex(s){var l=!1;typeof e[this.name]>"u"&&n(this.name)&&(l=!0);var u=tb(this.name,l);return u[0]==="\\"?u:" "+u}}return o},{isClass:!0,isNode:!0});var cb="FunctionNode",Tae=["math","Node","SymbolNode"],ZL=N(cb,Tae,t=>{var e,{math:r,Node:i,SymbolNode:n}=t,o=l=>Ct(l,{truncate:78});function a(l,u,c){for(var f="",m=/\$(?:\{([a-z_][a-z_0-9]*)(?:\[([0-9]+)\])?\}|\$)/gi,p=0,d;(d=m.exec(l))!==null;)if(f+=l.substring(p,d.index),p=d.index,d[0]==="$$")f+="$",p++;else{p+=d[0].length;var h=u[d[1]];if(!h)throw new ReferenceError("Template: Property "+d[1]+" does not exist.");if(d[2]===void 0)switch(typeof h){case"string":f+=h;break;case"object":if(Yt(h))f+=h.toTex(c);else if(Array.isArray(h))f+=h.map(function(v,y){if(Yt(v))return v.toTex(c);throw new TypeError("Template: "+d[1]+"["+y+"] is not a Node.")}).join(",");else throw new TypeError("Template: "+d[1]+" has to be a Node, String or array of Nodes");break;default:throw new TypeError("Template: "+d[1]+" has to be a Node, String or array of Nodes")}else if(Yt(h[d[2]]&&h[d[2]]))f+=h[d[2]].toTex(c);else throw new TypeError("Template: "+d[1]+"["+d[2]+"] is not a Node.")}return f+=l.slice(p),f}class s extends i{constructor(u,c){if(super(),typeof u=="string"&&(u=new n(u)),!Yt(u))throw new TypeError('Node expected as parameter "fn"');if(!Array.isArray(c)||!c.every(Yt))throw new TypeError('Array containing Nodes expected for parameter "args"');this.fn=u,this.args=c||[]}get name(){return this.fn.name||""}get type(){return cb}get isFunctionNode(){return!0}_compile(u,c){var f=this.args.map(T=>T._compile(u,c));if(Nr(this.fn)){var m=this.fn.name;if(c[m]){var y=this.args;return function(D,M,C){var $=Yr(M,m);if(typeof $!="function")throw new TypeError("Argument '".concat(m,"' was not a function; received: ").concat(o($)));if($.rawArgs)return $(y,u,Tl(D,M));var O=f.map(R=>R(D,M,C));return $.apply($,O)}}else{var p=m in u?Yr(u,m):void 0,d=typeof p=="function"&&p.rawArgs===!0,h=T=>{var D;if(T.has(m))D=T.get(m);else if(m in u)D=Yr(u,m);else return s.onUndefinedFunction(m);if(typeof D=="function")return D;throw new TypeError("'".concat(m,`' is not a function; its value is:
`).concat(o(D)))};if(d){var v=this.args;return function(D,M,C){var $=h(D);if($.rawArgs===!0)return $(v,u,Tl(D,M));var O=f.map(R=>R(D,M,C));return $(...O)}}else switch(f.length){case 0:return function(D,M,C){var $=h(D);return $()};case 1:return function(D,M,C){var $=h(D),O=f[0];return $(O(D,M,C))};case 2:return function(D,M,C){var $=h(D),O=f[0],R=f[1];return $(O(D,M,C),R(D,M,C))};default:return function(D,M,C){var $=h(D),O=f.map(R=>R(D,M,C));return $(...O)}}}}else if(ji(this.fn)&&uo(this.fn.index)&&this.fn.index.isObjectProperty()){var S=this.fn.object._compile(u,c),b=this.fn.index.getObjectProperty(),_=this.args;return function(D,M,C){var $=S(D,M,C),O=KI($,b);if(O!=null&&O.rawArgs)return O(_,u,Tl(D,M));var R=f.map(L=>L(D,M,C));return O.apply($,R)}}else{var w=this.fn.toString(),x=this.fn._compile(u,c),E=this.args;return function(D,M,C){var $=x(D,M,C);if(typeof $!="function")throw new TypeError("Expression '".concat(w,"' did not evaluate to a function; value is:")+`
`.concat(o($)));if($.rawArgs)return $(E,u,Tl(D,M));var O=f.map(R=>R(D,M,C));return $.apply($,O)}}}forEach(u){u(this.fn,"fn",this);for(var c=0;c<this.args.length;c++)u(this.args[c],"args["+c+"]",this)}map(u){for(var c=this._ifNode(u(this.fn,"fn",this)),f=[],m=0;m<this.args.length;m++)f[m]=this._ifNode(u(this.args[m],"args["+m+"]",this));return new s(c,f)}clone(){return new s(this.fn,this.args.slice(0))}toString(u){var c,f=this.fn.toString(u);return u&&typeof u.handler=="object"&&rt(u.handler,f)&&(c=u.handler[f](this,u)),typeof c<"u"?c:super.toString(u)}_toString(u){var c=this.args.map(function(m){return m.toString(u)}),f=ta(this.fn)?"("+this.fn.toString(u)+")":this.fn.toString(u);return f+"("+c.join(", ")+")"}toJSON(){return{mathjs:cb,fn:this.fn,args:this.args}}_toHTML(u){var c=this.args.map(function(f){return f.toHTML(u)});return'<span class="math-function">'+ni(this.fn)+'</span><span class="math-paranthesis math-round-parenthesis">(</span>'+c.join('<span class="math-separator">,</span>')+'<span class="math-paranthesis math-round-parenthesis">)</span>'}toTex(u){var c;return u&&typeof u.handler=="object"&&rt(u.handler,this.name)&&(c=u.handler[this.name](this,u)),typeof c<"u"?c:super.toTex(u)}_toTex(u){var c=this.args.map(function(p){return p.toTex(u)}),f;GE[this.name]&&(f=GE[this.name]),r[this.name]&&(typeof r[this.name].toTex=="function"||typeof r[this.name].toTex=="object"||typeof r[this.name].toTex=="string")&&(f=r[this.name].toTex);var m;switch(typeof f){case"function":m=f(this,u);break;case"string":m=a(f,this,u);break;case"object":switch(typeof f[c.length]){case"function":m=f[c.length](this,u);break;case"string":m=a(f[c.length],this,u);break}}return typeof m<"u"?m:a(PL,this,u)}getIdentifier(){return this.type+":"+this.name}}return e=s,dr(s,"name",cb),dr(s,"onUndefinedFunction",function(l){throw new Error("Undefined function "+l)}),dr(s,"fromJSON",function(l){return new e(l.fn,l.args)}),s},{isClass:!0,isNode:!0});var GL="parse",Nae=["typed","numeric","config","AccessorNode","ArrayNode","AssignmentNode","BlockNode","ConditionalNode","ConstantNode","FunctionAssignmentNode","FunctionNode","IndexNode","ObjectNode","OperatorNode","ParenthesisNode","RangeNode","RelationalNode","SymbolNode"],WL=N(GL,Nae,t=>{var{typed:e,numeric:r,config:i,AccessorNode:n,ArrayNode:o,AssignmentNode:a,BlockNode:s,ConditionalNode:l,ConstantNode:u,FunctionAssignmentNode:c,FunctionNode:f,IndexNode:m,ObjectNode:p,OperatorNode:d,ParenthesisNode:h,RangeNode:v,RelationalNode:y,SymbolNode:S}=t,b=e(GL,{string:function(X){return ie(X,{})},"Array | Matrix":function(X){return _(X,{})},"string, Object":function(X,ne){var Ne=ne.nodes!==void 0?ne.nodes:{};return ie(X,Ne)},"Array | Matrix, Object":_});function _(I){var X=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},ne=X.nodes!==void 0?X.nodes:{};return it(I,function(Ne){if(typeof Ne!="string")throw new TypeError("String expected");return ie(Ne,ne)})}var w={NULL:0,DELIMITER:1,NUMBER:2,SYMBOL:3,UNKNOWN:4},x={",":!0,"(":!0,")":!0,"[":!0,"]":!0,"{":!0,"}":!0,'"':!0,"'":!0,";":!0,"+":!0,"-":!0,"*":!0,".*":!0,"/":!0,"./":!0,"%":!0,"^":!0,".^":!0,"~":!0,"!":!0,"&":!0,"|":!0,"^|":!0,"=":!0,":":!0,"?":!0,"==":!0,"!=":!0,"<":!0,">":!0,"<=":!0,">=":!0,"<<":!0,">>":!0,">>>":!0},E={mod:!0,to:!0,in:!0,and:!0,xor:!0,or:!0,not:!0},T={true:!0,false:!1,null:null,undefined:void 0},D=["NaN","Infinity"],M={'"':'"',"'":"'","\\":"\\","/":"/",b:"\b",f:"\f",n:`
`,r:"\r",t:" "};function C(){return{extraNodes:{},expression:"",comment:"",index:0,token:"",tokenType:w.NULL,nestingLevel:0,conditionalLevel:null}}function $(I,X){return I.expression.substr(I.index,X)}function O(I){return $(I,1)}function R(I){I.index++}function L(I){return I.expression.charAt(I.index-1)}function k(I){return I.expression.charAt(I.index+1)}function V(I){for(I.tokenType=w.NULL,I.token="",I.comment="";;){if(O(I)==="#")for(;O(I)!==`
`&&O(I)!=="";)I.comment+=O(I),R(I);if(b.isWhitespace(O(I),I.nestingLevel))R(I);else break}if(O(I)===""){I.tokenType=w.DELIMITER;return}if(O(I)===`
`&&!I.nestingLevel){I.tokenType=w.DELIMITER,I.token=O(I),R(I);return}var X=O(I),ne=$(I,2),Ne=$(I,3);if(Ne.length===3&&x[Ne]){I.tokenType=w.DELIMITER,I.token=Ne,R(I),R(I),R(I);return}if(ne.length===2&&x[ne]){I.tokenType=w.DELIMITER,I.token=ne,R(I),R(I);return}if(x[X]){I.tokenType=w.DELIMITER,I.token=X,R(I);return}if(b.isDigitDot(X)){I.tokenType=w.NUMBER;var Xe=$(I,2);if(Xe==="0b"||Xe==="0o"||Xe==="0x"){for(I.token+=O(I),R(I),I.token+=O(I),R(I);b.isHexDigit(O(I));)I.token+=O(I),R(I);if(O(I)===".")for(I.token+=".",R(I);b.isHexDigit(O(I));)I.token+=O(I),R(I);else if(O(I)==="i")for(I.token+="i",R(I);b.isDigit(O(I));)I.token+=O(I),R(I);return}if(O(I)==="."){if(I.token+=O(I),R(I),!b.isDigit(O(I))){I.tokenType=w.DELIMITER;return}}else{for(;b.isDigit(O(I));)I.token+=O(I),R(I);b.isDecimalMark(O(I),k(I))&&(I.token+=O(I),R(I))}for(;b.isDigit(O(I));)I.token+=O(I),R(I);if(O(I)==="E"||O(I)==="e"){if(b.isDigit(k(I))||k(I)==="-"||k(I)==="+"){if(I.token+=O(I),R(I),(O(I)==="+"||O(I)==="-")&&(I.token+=O(I),R(I)),!b.isDigit(O(I)))throw we(I,'Digit expected, got "'+O(I)+'"');for(;b.isDigit(O(I));)I.token+=O(I),R(I);if(b.isDecimalMark(O(I),k(I)))throw we(I,'Digit expected, got "'+O(I)+'"')}else if(b.isDecimalMark(k(I),I.expression.charAt(I.index+2)))throw R(I),we(I,'Digit expected, got "'+O(I)+'"')}return}if(b.isAlpha(O(I),L(I),k(I))){for(;b.isAlpha(O(I),L(I),k(I))||b.isDigit(O(I));)I.token+=O(I),R(I);rt(E,I.token)?I.tokenType=w.DELIMITER:I.tokenType=w.SYMBOL;return}for(I.tokenType=w.UNKNOWN;O(I)!=="";)I.token+=O(I),R(I);throw we(I,'Syntax error in part "'+I.token+'"')}function J(I){do V(I);while(I.token===`
`)}function W(I){I.nestingLevel++}function Q(I){I.nestingLevel--}b.isAlpha=function(X,ne,Ne){return b.isValidLatinOrGreek(X)||b.isValidMathSymbol(X,Ne)||b.isValidMathSymbol(ne,X)},b.isValidLatinOrGreek=function(X){return/^[a-zA-Z_$\u00C0-\u02AF\u0370-\u03FF\u2100-\u214F]$/.test(X)},b.isValidMathSymbol=function(X,ne){return/^[\uD835]$/.test(X)&&/^[\uDC00-\uDFFF]$/.test(ne)&&/^[^\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(ne)},b.isWhitespace=function(X,ne){return X===" "||X===" "||X==="\xA0"||X===`
`&&ne>0},b.isDecimalMark=function(X,ne){return X==="."&&ne!=="/"&&ne!=="*"&&ne!=="^"},b.isDigitDot=function(X){return X>="0"&&X<="9"||X==="."},b.isDigit=function(X){return X>="0"&&X<="9"},b.isHexDigit=function(X){return X>="0"&&X<="9"||X>="a"&&X<="f"||X>="A"&&X<="F"};function ie(I,X){var ne=C();Dn(ne,{expression:I,extraNodes:X}),V(ne);var Ne=B(ne);if(ne.token!=="")throw ne.tokenType===w.DELIMITER?We(ne,"Unexpected operator "+ne.token):we(ne,'Unexpected part "'+ne.token+'"');return Ne}function B(I){var X,ne=[],Ne;for(I.token!==""&&I.token!==`
`&&I.token!==";"&&(X=Z(I),I.comment&&(X.comment=I.comment));I.token===`
`||I.token===";";)ne.length===0&&X&&(Ne=I.token!==";",ne.push({node:X,visible:Ne})),V(I),I.token!==`
`&&I.token!==";"&&I.token!==""&&(X=Z(I),I.comment&&(X.comment=I.comment),Ne=I.token!==";",ne.push({node:X,visible:Ne}));return ne.length>0?new s(ne):(X||(X=new u(void 0),I.comment&&(X.comment=I.comment)),X)}function Z(I){var X,ne,Ne,Xe,gt=q(I);if(I.token==="="){if(Nr(gt))return X=gt.name,J(I),Ne=Z(I),new a(new S(X),Ne);if(ji(gt))return J(I),Ne=Z(I),new a(gt.object,gt.index,Ne);if(gi(gt)&&Nr(gt.fn)&&(Xe=!0,ne=[],X=gt.name,gt.args.forEach(function(lr,Ve){Nr(lr)?ne[Ve]=lr.name:Xe=!1}),Xe))return J(I),Ne=Z(I),new c(X,ne,Ne);throw we(I,"Invalid left hand side of assignment operator =")}return gt}function q(I){for(var X=xe(I);I.token==="?";){var ne=I.conditionalLevel;I.conditionalLevel=I.nestingLevel,J(I);var Ne=X,Xe=Z(I);if(I.token!==":")throw we(I,"False part of conditional expression expected");I.conditionalLevel=null,J(I);var gt=Z(I);X=new l(Ne,Xe,gt),I.conditionalLevel=ne}return X}function xe(I){for(var X=de(I);I.token==="or";)J(I),X=new d("or","or",[X,de(I)]);return X}function de(I){for(var X=be(I);I.token==="xor";)J(I),X=new d("xor","xor",[X,be(I)]);return X}function be(I){for(var X=G(I);I.token==="and";)J(I),X=new d("and","and",[X,G(I)]);return X}function G(I){for(var X=K(I);I.token==="|";)J(I),X=new d("|","bitOr",[X,K(I)]);return X}function K(I){for(var X=re(I);I.token==="^|";)J(I),X=new d("^|","bitXor",[X,re(I)]);return X}function re(I){for(var X=ae(I);I.token==="&";)J(I),X=new d("&","bitAnd",[X,ae(I)]);return X}function ae(I){for(var X=[le(I)],ne=[],Ne={"==":"equal","!=":"unequal","<":"smaller",">":"larger","<=":"smallerEq",">=":"largerEq"};rt(Ne,I.token);){var Xe={name:I.token,fn:Ne[I.token]};ne.push(Xe),J(I),X.push(le(I))}return X.length===1?X[0]:X.length===2?new d(ne[0].name,ne[0].fn,X):new y(ne.map(gt=>gt.fn),X)}function le(I){var X,ne,Ne,Xe;X=Se(I);for(var gt={"<<":"leftShift",">>":"rightArithShift",">>>":"rightLogShift"};rt(gt,I.token);)ne=I.token,Ne=gt[ne],J(I),Xe=[X,Se(I)],X=new d(ne,Ne,Xe);return X}function Se(I){var X,ne,Ne,Xe;X=_e(I);for(var gt={to:"to",in:"to"};rt(gt,I.token);)ne=I.token,Ne=gt[ne],J(I),ne==="in"&&"])},;".includes(I.token)?X=new d("*","multiply",[X,new S("in")],!0):(Xe=[X,_e(I)],X=new d(ne,Ne,Xe));return X}function _e(I){var X,ne=[];if(I.token===":"?X=new u(1):X=Oe(I),I.token===":"&&I.conditionalLevel!==I.nestingLevel){for(ne.push(X);I.token===":"&&ne.length<3;)J(I),I.token===")"||I.token==="]"||I.token===","||I.token===""?ne.push(new S("end")):ne.push(Oe(I));ne.length===3?X=new v(ne[0],ne[2],ne[1]):X=new v(ne[0],ne[1])}return X}function Oe(I){var X,ne,Ne,Xe;X=st(I);for(var gt={"+":"add","-":"subtract"};rt(gt,I.token);){ne=I.token,Ne=gt[ne],J(I);var lr=st(I);lr.isPercentage?Xe=[X,new d("*","multiply",[X,lr])]:Xe=[X,lr],X=new d(ne,Ne,Xe)}return X}function st(I){var X,ne,Ne,Xe;X=yt(I),ne=X;for(var gt={"*":"multiply",".*":"dotMultiply","/":"divide","./":"dotDivide","%":"mod",mod:"mod"};rt(gt,I.token);)if(Ne=I.token,Xe=gt[Ne],J(I),Ne==="%"&&I.tokenType===w.DELIMITER&&I.token!=="(")if(I.token!==""&&gt[I.token]){var lr=new d("/","divide",[X,new u(100)],!1,!0);Ne=I.token,Xe=gt[Ne],J(I),ne=yt(I),X=new d(Ne,Xe,[lr,ne])}else X=new d("/","divide",[X,new u(100)],!1,!0);else ne=yt(I),X=new d(Ne,Xe,[X,ne]);return X}function yt(I){var X,ne;for(X=Qe(I),ne=X;I.tokenType===w.SYMBOL||I.token==="in"&&Lt(X)||I.token==="in"&&Lr(X)&&X.fn==="unaryMinus"&&Lt(X.args[0])||I.tokenType===w.NUMBER&&!Lt(ne)&&(!Lr(ne)||ne.op==="!")||I.token==="(";)ne=Qe(I),X=new d("*","multiply",[X,ne],!0);return X}function Qe(I){for(var X=ut(I),ne=X,Ne=[];I.token==="/"&&Hp(ne);)if(Ne.push(Dn({},I)),J(I),I.tokenType===w.NUMBER)if(Ne.push(Dn({},I)),J(I),I.tokenType===w.SYMBOL||I.token==="("||I.token==="in")Dn(I,Ne.pop()),Ne.pop(),ne=ut(I),X=new d("/","divide",[X,ne]);else{Ne.pop(),Dn(I,Ne.pop());break}else{Dn(I,Ne.pop());break}return X}function ut(I){var X,ne,Ne,Xe={"-":"unaryMinus","+":"unaryPlus","~":"bitNot",not:"not"};return rt(Xe,I.token)?(Ne=Xe[I.token],X=I.token,J(I),ne=[ut(I)],new d(X,Ne,ne)):H(I)}function H(I){var X,ne,Ne,Xe;return X=oe(I),(I.token==="^"||I.token===".^")&&(ne=I.token,Ne=ne==="^"?"pow":"dotPow",J(I),Xe=[X,ut(I)],X=new d(ne,Ne,Xe)),X}function oe(I){var X,ne,Ne,Xe;X=ve(I);for(var gt={"!":"factorial","'":"ctranspose"};rt(gt,I.token);)ne=I.token,Ne=gt[ne],V(I),Xe=[X],X=new d(ne,Ne,Xe),X=Ee(I,X);return X}function ve(I){var X=[];if(I.tokenType===w.SYMBOL&&rt(I.extraNodes,I.token)){var ne=I.extraNodes[I.token];if(V(I),I.token==="("){if(X=[],W(I),V(I),I.token!==")")for(X.push(Z(I));I.token===",";)V(I),X.push(Z(I));if(I.token!==")")throw we(I,"Parenthesis ) expected");Q(I),V(I)}return new ne(X)}return De(I)}function De(I){var X,ne;return I.tokenType===w.SYMBOL||I.tokenType===w.DELIMITER&&I.token in E?(ne=I.token,V(I),rt(T,ne)?X=new u(T[ne]):D.includes(ne)?X=new u(r(ne,"number")):X=new S(ne),X=Ee(I,X),X):Ue(I)}function Ee(I,X,ne){for(var Ne;(I.token==="("||I.token==="["||I.token===".")&&(!ne||ne.includes(I.token));)if(Ne=[],I.token==="(")if(Nr(X)||ji(X)){if(W(I),V(I),I.token!==")")for(Ne.push(Z(I));I.token===",";)V(I),Ne.push(Z(I));if(I.token!==")")throw we(I,"Parenthesis ) expected");Q(I),V(I),X=new f(X,Ne)}else return X;else if(I.token==="["){if(W(I),V(I),I.token!=="]")for(Ne.push(Z(I));I.token===",";)V(I),Ne.push(Z(I));if(I.token!=="]")throw we(I,"Parenthesis ] expected");Q(I),V(I),X=new n(X,new m(Ne))}else{V(I);var Xe=I.tokenType===w.SYMBOL||I.tokenType===w.DELIMITER&&I.token in E;if(!Xe)throw we(I,"Property name expected after dot");Ne.push(new u(I.token)),V(I);var gt=!0;X=new n(X,new m(Ne,gt))}return X}function Ue(I){var X,ne;return I.token==='"'||I.token==="'"?(ne=He(I,I.token),X=new u(ne),X=Ee(I,X),X):nt(I)}function He(I,X){for(var ne="";O(I)!==""&&O(I)!==X;)if(O(I)==="\\"){R(I);var Ne=O(I),Xe=M[Ne];if(Xe!==void 0)ne+=Xe,I.index+=1;else if(Ne==="u"){var gt=I.expression.slice(I.index+1,I.index+5);if(/^[0-9A-Fa-f]{4}$/.test(gt))ne+=String.fromCharCode(parseInt(gt,16)),I.index+=5;else throw we(I,"Invalid unicode character \\u".concat(gt))}else throw we(I,"Bad escape character \\".concat(Ne))}else ne+=O(I),R(I);if(V(I),I.token!==X)throw we(I,"End of string ".concat(X," expected"));return V(I),ne}function nt(I){var X,ne,Ne,Xe;if(I.token==="["){if(W(I),V(I),I.token!=="]"){var gt=ke(I);if(I.token===";"){for(Ne=1,ne=[gt];I.token===";";)V(I),I.token!=="]"&&(ne[Ne]=ke(I),Ne++);if(I.token!=="]")throw we(I,"End of matrix ] expected");Q(I),V(I),Xe=ne[0].items.length;for(var lr=1;lr<Ne;lr++)if(ne[lr].items.length!==Xe)throw We(I,"Column dimensions mismatch ("+ne[lr].items.length+" !== "+Xe+")");X=new o(ne)}else{if(I.token!=="]")throw we(I,"End of matrix ] expected");Q(I),V(I),X=gt}}else Q(I),V(I),X=new o([]);return Ee(I,X)}return Y(I)}function ke(I){for(var X=[Z(I)],ne=1;I.token===",";)V(I),I.token!=="]"&&I.token!==";"&&(X[ne]=Z(I),ne++);return new o(X)}function Y(I){if(I.token==="{"){W(I);var X,ne={};do if(V(I),I.token!=="}"){if(I.token==='"'||I.token==="'")X=He(I,I.token);else if(I.tokenType===w.SYMBOL||I.tokenType===w.DELIMITER&&I.token in E)X=I.token,V(I);else throw we(I,"Symbol or string expected as object key");if(I.token!==":")throw we(I,"Colon : expected after object key");V(I),ne[X]=Z(I)}while(I.token===",");if(I.token!=="}")throw we(I,"Comma , or bracket } expected after object value");Q(I),V(I);var Ne=new p(ne);return Ne=Ee(I,Ne),Ne}return me(I)}function me(I){var X;if(I.tokenType===w.NUMBER){X=I.token,V(I);var ne=Mi(X,i),Ne=r(X,ne);return new u(Ne)}return ce(I)}function ce(I){var X;if(I.token==="("){if(W(I),V(I),X=Z(I),I.token!==")")throw we(I,"Parenthesis ) expected");return Q(I),V(I),X=new h(X),X=Ee(I,X),X}return Ce(I)}function Ce(I){throw I.token===""?we(I,"Unexpected end of expression"):we(I,"Value expected")}function Pe(I){return I.index-I.token.length+1}function we(I,X){var ne=Pe(I),Ne=new SyntaxError(X+" (char "+ne+")");return Ne.char=ne,Ne}function We(I,X){var ne=Pe(I),Ne=new SyntaxError(X+" (char "+ne+")");return Ne.char=ne,Ne}return e.addConversion({from:"string",to:"Node",convert:b}),b});var HL="compile",Mae=["typed","parse"],YL=N(HL,Mae,t=>{var{typed:e,parse:r}=t;return e(HL,{string:function(n){return r(n).compile()},"Array | Matrix":function(n){return it(n,function(o){return r(o).compile()})}})});var JL="evaluate",Cae=["typed","parse"],XL=N(JL,Cae,t=>{var{typed:e,parse:r}=t;return e(JL,{string:function(n){var o=Su();return r(n).compile().evaluate(o)},"string, Map | Object":function(n,o){return r(n).compile().evaluate(o)},"Array | Matrix":function(n){var o=Su();return it(n,function(a){return r(a).compile().evaluate(o)})},"Array | Matrix, Map | Object":function(n,o){return it(n,function(a){return r(a).compile().evaluate(o)})}})});var $ae="Parser",Iae=["evaluate","parse"],KL=N($ae,Iae,t=>{var{evaluate:e,parse:r}=t;function i(){if(!(this instanceof i))throw new SyntaxError("Constructor must be called with the new operator");Object.defineProperty(this,"scope",{value:Su(),writable:!1})}i.prototype.type="Parser",i.prototype.isParser=!0,i.prototype.evaluate=function(o){return e(o,this.scope)},i.prototype.get=function(o){if(this.scope.has(o))return this.scope.get(o)},i.prototype.getAll=function(){return eF(this.scope)},i.prototype.getAllAsMap=function(){return this.scope};function n(o){if(o.length===0)return!1;for(var a=0;a<o.length;a++){var s=o.charAt(a-1),l=o.charAt(a),u=o.charAt(a+1),c=r.isAlpha(l,s,u)||a>0&&r.isDigit(l);if(!c)return!1}return!0}return i.prototype.set=function(o,a){if(!n(o))throw new Error("Invalid variable name: '".concat(o,"'. Variable names must follow the specified rules."));return this.scope.set(o,a),a},i.prototype.remove=function(o){this.scope.delete(o)},i.prototype.clear=function(){this.scope.clear()},i},{isClass:!0});var QL="parser",Fae=["typed","Parser"],e4=N(QL,Fae,t=>{var{typed:e,Parser:r}=t;return e(QL,{"":function(){return new r}})});var t4="lup",kae=["typed","matrix","abs","addScalar","divideScalar","multiplyScalar","subtractScalar","larger","equalScalar","unaryMinus","DenseMatrix","SparseMatrix","Spa"],r4=N(t4,kae,t=>{var{typed:e,matrix:r,abs:i,addScalar:n,divideScalar:o,multiplyScalar:a,subtractScalar:s,larger:l,equalScalar:u,unaryMinus:c,DenseMatrix:f,SparseMatrix:m,Spa:p}=t;return e(t4,{DenseMatrix:function(y){return d(y)},SparseMatrix:function(y){return h(y)},Array:function(y){var S=r(y),b=d(S);return{L:b.L.valueOf(),U:b.U.valueOf(),p:b.p}}});function d(v){var y=v._size[0],S=v._size[1],b=Math.min(y,S),_=dt(v._data),w=[],x=[y,b],E=[],T=[b,S],D,M,C,$=[];for(D=0;D<y;D++)$[D]=D;for(M=0;M<S;M++){if(M>0)for(D=0;D<y;D++){var O=Math.min(D,M),R=0;for(C=0;C<O;C++)R=n(R,a(_[D][C],_[C][M]));_[D][M]=s(_[D][M],R)}var L=M,k=0,V=0;for(D=M;D<y;D++){var J=_[D][M],W=i(J);l(W,k)&&(L=D,k=W,V=J)}if(M!==L&&($[M]=[$[L],$[L]=$[M]][0],f._swapRows(M,L,_)),M<y)for(D=M+1;D<y;D++){var Q=_[D][M];u(Q,0)||(_[D][M]=o(_[D][M],V))}}for(M=0;M<S;M++)for(D=0;D<y;D++){if(M===0&&(D<S&&(E[D]=[]),w[D]=[]),D<M){D<S&&(E[D][M]=_[D][M]),M<y&&(w[D][M]=0);continue}if(D===M){D<S&&(E[D][M]=_[D][M]),M<y&&(w[D][M]=1);continue}D<S&&(E[D][M]=0),M<y&&(w[D][M]=_[D][M])}var ie=new f({data:w,size:x}),B=new f({data:E,size:T}),Z=[];for(D=0,b=$.length;D<b;D++)Z[$[D]]=D;return{L:ie,U:B,p:Z,toString:function(){return"L: "+this.L.toString()+`
U: `+this.U.toString()+`
P: `+this.p}}}function h(v){var y=v._size[0],S=v._size[1],b=Math.min(y,S),_=v._values,w=v._index,x=v._ptr,E=[],T=[],D=[],M=[y,b],C=[],$=[],O=[],R=[b,S],L,k,V,J=[],W=[];for(L=0;L<y;L++)J[L]=L,W[L]=L;var Q=function(Z,q){var xe=W[Z],de=W[q];J[xe]=q,J[de]=Z,W[Z]=de,W[q]=xe},ie=function(){var Z=new p;k<y&&(D.push(E.length),E.push(1),T.push(k)),O.push(C.length);var q=x[k],xe=x[k+1];for(V=q;V<xe;V++)L=w[V],Z.set(J[L],_[V]);k>0&&Z.forEach(0,k-1,function(K,re){m._forEachRow(K,E,T,D,function(ae,le){ae>K&&Z.accumulate(ae,c(a(le,re)))})});var de=k,be=Z.get(k),G=i(be);Z.forEach(k+1,y-1,function(K,re){var ae=i(re);l(ae,G)&&(de=K,G=ae,be=re)}),k!==de&&(m._swapRows(k,de,M[1],E,T,D),m._swapRows(k,de,R[1],C,$,O),Z.swap(k,de),Q(k,de)),Z.forEach(0,y-1,function(K,re){K<=k?(C.push(re),$.push(K)):(re=o(re,be),u(re,0)||(E.push(re),T.push(K)))})};for(k=0;k<S;k++)ie();return O.push(C.length),D.push(E.length),{L:new m({values:E,index:T,ptr:D,size:M}),U:new m({values:C,index:$,ptr:O,size:R}),p:J,toString:function(){return"L: "+this.L.toString()+`
U: `+this.U.toString()+`
P: `+this.p}}}});var n4="qr",Pae=["typed","matrix","zeros","identity","isZero","equal","sign","sqrt","conj","unaryMinus","addScalar","divideScalar","multiplyScalar","subtractScalar","complex"],i4=N(n4,Pae,t=>{var{typed:e,matrix:r,zeros:i,identity:n,isZero:o,equal:a,sign:s,sqrt:l,conj:u,unaryMinus:c,addScalar:f,divideScalar:m,multiplyScalar:p,subtractScalar:d,complex:h}=t;return Dn(e(n4,{DenseMatrix:function(_){return y(_)},SparseMatrix:function(_){return S(_)},Array:function(_){var w=r(_),x=y(w);return{Q:x.Q.valueOf(),R:x.R.valueOf()}}}),{_denseQRimpl:v});function v(b){var _=b._size[0],w=b._size[1],x=n([_],"dense"),E=x._data,T=b.clone(),D=T._data,M,C,$,O=i([_],"");for($=0;$<Math.min(w,_);++$){var R=D[$][$],L=c(a(R,0)?1:s(R)),k=u(L),V=0;for(M=$;M<_;M++)V=f(V,p(D[M][$],u(D[M][$])));var J=p(L,l(V));if(!o(J)){var W=d(R,J);for(O[$]=1,M=$+1;M<_;M++)O[M]=m(D[M][$],W);var Q=c(u(m(W,J))),ie=void 0;for(C=$;C<w;C++){for(ie=0,M=$;M<_;M++)ie=f(ie,p(u(O[M]),D[M][C]));for(ie=p(ie,Q),M=$;M<_;M++)D[M][C]=p(d(D[M][C],p(O[M],ie)),k)}for(M=0;M<_;M++){for(ie=0,C=$;C<_;C++)ie=f(ie,p(E[M][C],O[C]));for(ie=p(ie,Q),C=$;C<_;++C)E[M][C]=m(d(E[M][C],p(ie,u(O[C]))),k)}}}return{Q:x,R:T,toString:function(){return"Q: "+this.Q.toString()+`
R: `+this.R.toString()}}}function y(b){var _=v(b),w=_.R._data;if(b._data.length>0)for(var x=w[0][0].type==="Complex"?h(0):0,E=0;E<w.length;++E)for(var T=0;T<E&&T<(w[0]||[]).length;++T)w[E][T]=x;return _}function S(b){throw new Error("qr not implemented for sparse matrices yet")}});function o4(t,e,r,i){for(var n=t._values,o=t._index,a=t._ptr,s=t._size,l=t._datatype,u=s[0],c=s[1],f=i&&t._values?[]:null,m=[],p=[],d=0,h=0;h<c;h++){p[h]=d;for(var v=r?r[h]:h,y=a[v],S=a[v+1],b=y;b<S;b++){var _=e?e[o[b]]:o[b];m[d]=_,f&&(f[d]=n[b]),d++}}return p[c]=d,t.createSparseMatrix({values:f,index:m,ptr:p,size:[u,c],datatype:l})}function fb(t,e,r,i,n,o,a){var s=0;for(r[a]=t;s>=0;){var l=r[a+s],u=r[i+l];u===-1?(s--,o[e++]=l):(r[i+l]=r[n+u],++s,r[a+s]=u)}return e}function a4(t,e){if(!t)return null;var r=0,i,n=[],o=[],a=0,s=e,l=2*e;for(i=0;i<e;i++)o[a+i]=-1;for(i=e-1;i>=0;i--)t[i]!==-1&&(o[s+i]=o[a+t[i]],o[a+t[i]]=i);for(i=0;i<e;i++)t[i]===-1&&(r=fb(i,r,o,a,s,n,l));return n}function s4(t,e){if(!t)return null;var r=t._index,i=t._ptr,n=t._size,o=n[0],a=n[1],s=[],l=[],u=0,c=a,f,m;if(e)for(f=0;f<o;f++)l[c+f]=-1;for(var p=0;p<a;p++){s[p]=-1,l[u+p]=-1;for(var d=i[p],h=i[p+1],v=d;v<h;v++){var y=r[v];for(f=e?l[c+y]:y;f!==-1&&f<p;f=m)m=l[u+f],l[u+f]=p,m===-1&&(s[f]=p);e&&(l[c+y]=p)}}return s}function u4(t,e,r){for(var i=t._values,n=t._index,o=t._ptr,a=t._size,s=a[1],l=0,u=0;u<s;u++){var c=o[u];for(o[u]=l;c<o[u+1];c++)e(n[c],u,i?i[c]:1,r)&&(n[l]=n[c],i&&(i[l]=i[c]),l++)}return o[s]=l,n.splice(l,n.length-l),i&&i.splice(l,i.length-l),l}function Na(t){return-t-2}var Bae="csAmd",Oae=["add","multiply","transpose"],l4=N(Bae,Oae,t=>{var{add:e,multiply:r,transpose:i}=t;return function(c,f){if(!f||c<=0||c>3)return null;var m=f._size,p=m[0],d=m[1],h=0,v=Math.max(16,10*Math.sqrt(d));v=Math.min(d-2,v);var y=n(c,f,p,d,v);u4(y,l,null);for(var S=y._index,b=y._ptr,_=b[d],w=[],x=[],E=0,T=d+1,D=2*(d+1),M=3*(d+1),C=4*(d+1),$=5*(d+1),O=6*(d+1),R=7*(d+1),L=w,k=o(d,b,x,E,M,L,D,R,T,O,C,$),V=a(d,b,x,$,C,O,v,T,M,L,D),J=0,W,Q,ie,B,Z,q,xe,de,be,G,K,re,ae,le,Se,_e;V<d;){for(ie=-1;J<d&&(ie=x[M+J])===-1;J++);x[D+ie]!==-1&&(L[x[D+ie]]=-1),x[M+J]=x[D+ie];var Oe=x[C+ie],st=x[T+ie];V+=st;var yt=0;x[T+ie]=-st;var Qe=b[ie],ut=Oe===0?Qe:_,H=ut;for(B=1;B<=Oe+1;B++){for(B>Oe?(q=ie,xe=Qe,de=x[E+ie]-Oe):(q=S[Qe++],xe=b[q],de=x[E+q]),Z=1;Z<=de;Z++)W=S[xe++],!((be=x[T+W])<=0)&&(yt+=be,x[T+W]=-be,S[H++]=W,x[D+W]!==-1&&(L[x[D+W]]=L[W]),L[W]!==-1?x[D+L[W]]=x[D+W]:x[M+x[$+W]]=x[D+W]);q!==ie&&(b[q]=Na(ie),x[O+q]=0)}for(Oe!==0&&(_=H),x[$+ie]=yt,b[ie]=ut,x[E+ie]=H-ut,x[C+ie]=-2,k=s(k,h,x,O,d),G=ut;G<H;G++)if(W=S[G],!((K=x[C+W])<=0)){be=-x[T+W];var oe=k-be;for(Qe=b[W],re=b[W]+K-1;Qe<=re;Qe++)q=S[Qe],x[O+q]>=k?x[O+q]-=be:x[O+q]!==0&&(x[O+q]=x[$+q]+oe)}for(G=ut;G<H;G++){for(W=S[G],re=b[W],ae=re+x[C+W]-1,le=re,Se=0,_e=0,Qe=re;Qe<=ae;Qe++)if(q=S[Qe],x[O+q]!==0){var ve=x[O+q]-k;ve>0?(_e+=ve,S[le++]=q,Se+=q):(b[q]=Na(ie),x[O+q]=0)}x[C+W]=le-re+1;var De=le,Ee=re+x[E+W];for(Qe=ae+1;Qe<Ee;Qe++){Q=S[Qe];var Ue=x[T+Q];Ue<=0||(_e+=Ue,S[le++]=Q,Se+=Q)}_e===0?(b[W]=Na(ie),be=-x[T+W],yt-=be,st+=be,V+=be,x[T+W]=0,x[C+W]=-1):(x[$+W]=Math.min(x[$+W],_e),S[le]=S[De],S[De]=S[re],S[re]=ie,x[E+W]=le-re+1,Se=(Se<0?-Se:Se)%d,x[D+W]=x[R+Se],x[R+Se]=W,L[W]=Se)}for(x[$+ie]=yt,h=Math.max(h,yt),k=s(k+h,h,x,O,d),G=ut;G<H;G++)if(W=S[G],!(x[T+W]>=0))for(Se=L[W],W=x[R+Se],x[R+Se]=-1;W!==-1&&x[D+W]!==-1;W=x[D+W],k++){for(de=x[E+W],K=x[C+W],Qe=b[W]+1;Qe<=b[W]+de-1;Qe++)x[O+S[Qe]]=k;var He=W;for(Q=x[D+W];Q!==-1;){var nt=x[E+Q]===de&&x[C+Q]===K;for(Qe=b[Q]+1;nt&&Qe<=b[Q]+de-1;Qe++)x[O+S[Qe]]!==k&&(nt=0);nt?(b[Q]=Na(W),x[T+W]+=x[T+Q],x[T+Q]=0,x[C+Q]=-1,Q=x[D+Q],x[D+He]=Q):(He=Q,Q=x[D+Q])}}for(Qe=ut,G=ut;G<H;G++)W=S[G],!((be=-x[T+W])<=0)&&(x[T+W]=be,_e=x[$+W]+yt-be,_e=Math.min(_e,d-V-be),x[M+_e]!==-1&&(L[x[M+_e]]=W),x[D+W]=x[M+_e],L[W]=-1,x[M+_e]=W,J=Math.min(J,_e),x[$+W]=_e,S[Qe++]=W);x[T+ie]=st,(x[E+ie]=Qe-ut)===0&&(b[ie]=-1,x[O+ie]=0),Oe!==0&&(_=Qe)}for(W=0;W<d;W++)b[W]=Na(b[W]);for(Q=0;Q<=d;Q++)x[M+Q]=-1;for(Q=d;Q>=0;Q--)x[T+Q]>0||(x[D+Q]=x[M+b[Q]],x[M+b[Q]]=Q);for(q=d;q>=0;q--)x[T+q]<=0||b[q]!==-1&&(x[D+q]=x[M+b[q]],x[M+b[q]]=q);for(ie=0,W=0;W<=d;W++)b[W]===-1&&(ie=fb(W,ie,x,M,D,w,O));return w.splice(w.length-1,1),w};function n(u,c,f,m,p){var d=i(c);if(u===1&&m===f)return e(c,d);if(u===2){for(var h=d._index,v=d._ptr,y=0,S=0;S<f;S++){var b=v[S];if(v[S]=y,!(v[S+1]-b>p))for(var _=v[S+1];b<_;b++)h[y++]=h[b]}return v[f]=y,c=i(d),r(d,c)}return r(d,c)}function o(u,c,f,m,p,d,h,v,y,S,b,_){for(var w=0;w<u;w++)f[m+w]=c[w+1]-c[w];f[m+u]=0;for(var x=0;x<=u;x++)f[p+x]=-1,d[x]=-1,f[h+x]=-1,f[v+x]=-1,f[y+x]=1,f[S+x]=1,f[b+x]=0,f[_+x]=f[m+x];var E=s(0,0,f,S,u);return f[b+u]=-2,c[u]=-1,f[S+u]=0,E}function a(u,c,f,m,p,d,h,v,y,S,b){for(var _=0,w=0;w<u;w++){var x=f[m+w];if(x===0)f[p+w]=-2,_++,c[w]=-1,f[d+w]=0;else if(x>h)f[v+w]=0,f[p+w]=-1,_++,c[w]=Na(u),f[v+u]++;else{var E=f[y+x];E!==-1&&(S[E]=w),f[b+w]=f[y+x],f[y+x]=w}}return _}function s(u,c,f,m,p){if(u<2||u+c<0){for(var d=0;d<p;d++)f[m+d]!==0&&(f[m+d]=1);u=2}return u}function l(u,c){return u!==c}});function c4(t,e,r,i,n,o,a){var s,l,u=0,c;if(t<=e||r[i+e]<=r[n+t])return-1;r[n+t]=r[i+e];var f=r[o+t];if(r[o+t]=e,f===-1)u=1,c=t;else{for(u=2,c=f;c!==r[a+c];c=r[a+c]);for(s=f;s!==c;s=l)l=r[a+s],r[a+s]=c}return{jleaf:u,q:c}}var Rae="csCounts",Lae=["transpose"],f4=N(Rae,Lae,t=>{var{transpose:e}=t;return function(r,i,n,o){if(!r||!i||!n)return null;var a=r._size,s=a[0],l=a[1],u,c,f,m,p,d,h,v=4*l+(o?l+s+1:0),y=[],S=0,b=l,_=2*l,w=3*l,x=4*l,E=5*l+1;for(f=0;f<v;f++)y[f]=-1;var T=[],D=e(r),M=D._index,C=D._ptr;for(f=0;f<l;f++)for(c=n[f],T[c]=y[w+c]===-1?1:0;c!==-1&&y[w+c]===-1;c=i[c])y[w+c]=f;if(o){for(f=0;f<l;f++)y[n[f]]=f;for(u=0;u<s;u++){for(f=l,d=C[u],h=C[u+1],p=d;p<h;p++)f=Math.min(f,y[M[p]]);y[E+u]=y[x+f],y[x+f]=u}}for(u=0;u<l;u++)y[S+u]=u;for(f=0;f<l;f++){for(c=n[f],i[c]!==-1&&T[i[c]]--,m=o?y[x+f]:c;m!==-1;m=o?y[E+m]:-1)for(p=C[m];p<C[m+1];p++){u=M[p];var $=c4(u,c,y,w,b,_,S);$.jleaf>=1&&T[c]++,$.jleaf===2&&T[$.q]--}i[c]!==-1&&(y[S+c]=i[c])}for(c=0;c<l;c++)i[c]!==-1&&(T[i[c]]+=T[c]);return T}});var Uae="csSqr",zae=["add","multiply","transpose"],p4=N(Uae,zae,t=>{var{add:e,multiply:r,transpose:i}=t,n=l4({add:e,multiply:r,transpose:i}),o=f4({transpose:i});return function(l,u,c){var f=u._ptr,m=u._size,p=m[1],d,h={};if(h.q=n(l,u),l&&!h.q)return null;if(c){var v=l?o4(u,null,h.q,0):u;h.parent=s4(v,1);var y=a4(h.parent,p);if(h.cp=o(v,h.parent,y,1),v&&h.parent&&h.cp&&a(v,h))for(h.unz=0,d=0;d<p;d++)h.unz+=h.cp[d]}else h.unz=4*f[p]+p,h.lnz=h.unz;return h};function a(s,l){var u=s._ptr,c=s._index,f=s._size,m=f[0],p=f[1];l.pinv=[],l.leftmost=[];var d=l.parent,h=l.pinv,v=l.leftmost,y=[],S=0,b=m,_=m+p,w=m+2*p,x,E,T,D,M;for(E=0;E<p;E++)y[b+E]=-1,y[_+E]=-1,y[w+E]=0;for(x=0;x<m;x++)v[x]=-1;for(E=p-1;E>=0;E--)for(D=u[E],M=u[E+1],T=D;T<M;T++)v[c[T]]=E;for(x=m-1;x>=0;x--)h[x]=-1,E=v[x],E!==-1&&(y[w+E]++===0&&(y[_+E]=x),y[S+x]=y[b+E],y[b+E]=x);for(l.lnz=0,l.m2=m,E=0;E<p;E++)if(x=y[b+E],l.lnz++,x<0&&(x=l.m2++),h[x]=E,!(--w[E]<=0)){l.lnz+=y[w+E];var C=d[E];C!==-1&&(y[w+C]===0&&(y[_+C]=y[_+E]),y[S+y[_+E]]=y[b+C],y[b+C]=y[S+x],y[w+C]+=y[w+E])}for(x=0;x<m;x++)h[x]<0&&(h[x]=E++);return!0}});function lm(t,e){return t[e]<0}function pb(t,e){t[e]=Na(t[e])}function WE(t){return t<0?Na(t):t}function m4(t,e,r,i,n){var o=e._index,a=e._ptr,s=e._size,l=s[1],u,c,f,m=0;for(i[0]=t;m>=0;){t=i[m];var p=n?n[t]:t;lm(a,t)||(pb(a,t),i[l+m]=p<0?0:WE(a[p]));var d=1;for(c=i[l+m],f=p<0?0:WE(a[p+1]);c<f;c++)if(u=o[c],!lm(a,u)){i[l+m]=c,i[++m]=u,d=0;break}d&&(m--,i[--r]=t)}return r}function d4(t,e,r,i,n){var o=t._ptr,a=t._size,s=e._index,l=e._ptr,u=a[1],c,f,m,p=u;for(f=l[r],m=l[r+1],c=f;c<m;c++){var d=s[c];lm(o,d)||(p=m4(d,t,p,i,n))}for(c=p;c<u;c++)pb(o,i[c]);return p}var Vae="csSpsolve",qae=["divideScalar","multiply","subtract"],h4=N(Vae,qae,t=>{var{divideScalar:e,multiply:r,subtract:i}=t;return function(o,a,s,l,u,c,f){var m=o._values,p=o._index,d=o._ptr,h=o._size,v=h[1],y=a._values,S=a._index,b=a._ptr,_,w,x,E,T=d4(o,a,s,l,c);for(_=T;_<v;_++)u[l[_]]=0;for(w=b[s],x=b[s+1],_=w;_<x;_++)u[S[_]]=y[_];for(var D=T;D<v;D++){var M=l[D],C=c?c[M]:M;if(!(C<0))for(w=d[C],x=d[C+1],u[M]=e(u[M],m[f?w:x-1]),_=f?w+1:w,E=f?x:x-1;_<E;_++){var $=p[_];u[$]=i(u[$],r(m[_],u[M]))}}return T}});var jae="csLu",Zae=["abs","divideScalar","multiply","subtract","larger","largerEq","SparseMatrix"],g4=N(jae,Zae,t=>{var{abs:e,divideScalar:r,multiply:i,subtract:n,larger:o,largerEq:a,SparseMatrix:s}=t,l=h4({divideScalar:r,multiply:i,subtract:n});return function(c,f,m){if(!c)return null;var p=c._size,d=p[1],h,v=100,y=100;f&&(h=f.q,v=f.lnz||v,y=f.unz||y);var S=[],b=[],_=[],w=new s({values:S,index:b,ptr:_,size:[d,d]}),x=[],E=[],T=[],D=new s({values:x,index:E,ptr:T,size:[d,d]}),M=[],C,$,O=[],R=[];for(C=0;C<d;C++)O[C]=0,M[C]=-1,_[C+1]=0;v=0,y=0;for(var L=0;L<d;L++){_[L]=v,T[L]=y;var k=h?h[L]:L,V=l(w,c,k,R,O,M,1),J=-1,W=-1;for($=V;$<d;$++)if(C=R[$],M[C]<0){var Q=e(O[C]);o(Q,W)&&(W=Q,J=C)}else E[y]=M[C],x[y++]=O[C];if(J===-1||W<=0)return null;M[k]<0&&a(e(O[k]),i(W,m))&&(J=k);var ie=O[J];for(E[y]=L,x[y++]=ie,M[J]=L,b[v]=J,S[v++]=1,$=V;$<d;$++)C=R[$],M[C]<0&&(b[v]=C,S[v++]=r(O[C],ie)),O[C]=0}for(_[d]=v,T[d]=y,$=0;$<v;$++)b[$]=M[b[$]];return S.splice(v,S.length-v),b.splice(v,b.length-v),x.splice(y,x.length-y),E.splice(y,E.length-y),{L:w,U:D,pinv:M}}});var v4="slu",Gae=["typed","abs","add","multiply","transpose","divideScalar","subtract","larger","largerEq","SparseMatrix"],y4=N(v4,Gae,t=>{var{typed:e,abs:r,add:i,multiply:n,transpose:o,divideScalar:a,subtract:s,larger:l,largerEq:u,SparseMatrix:c}=t,f=p4({add:i,multiply:n,transpose:o}),m=g4({abs:r,divideScalar:a,multiply:n,subtract:s,larger:l,largerEq:u,SparseMatrix:c});return e(v4,{"SparseMatrix, number, number":function(d,h,v){if(!Ge(h)||h<0||h>3)throw new Error("Symbolic Ordering and Analysis order must be an integer number in the interval [0, 3]");if(v<0||v>1)throw new Error("Partial pivoting threshold must be a number from 0 to 1");var y=f(h,d,!1),S=m(d,y,v);return{L:S.L,U:S.U,p:S.pinv,q:y.q,toString:function(){return"L: "+this.L.toString()+`
U: `+this.U.toString()+`
p: `+this.p.toString()+(this.q?`
q: `+this.q.toString():"")+`
`}}}})});function HE(t,e){var r,i=e.length,n=[];if(t)for(r=0;r<i;r++)n[t[r]]=e[r];else for(r=0;r<i;r++)n[r]=e[r];return n}var b4="lusolve",Wae=["typed","matrix","lup","slu","usolve","lsolve","DenseMatrix"],x4=N(b4,Wae,t=>{var{typed:e,matrix:r,lup:i,slu:n,usolve:o,lsolve:a,DenseMatrix:s}=t,l=rs({DenseMatrix:s});return e(b4,{"Array, Array | Matrix":function(m,p){m=r(m);var d=i(m),h=c(d.L,d.U,d.p,null,p);return h.valueOf()},"DenseMatrix, Array | Matrix":function(m,p){var d=i(m);return c(d.L,d.U,d.p,null,p)},"SparseMatrix, Array | Matrix":function(m,p){var d=i(m);return c(d.L,d.U,d.p,null,p)},"SparseMatrix, Array | Matrix, number, number":function(m,p,d,h){var v=n(m,d,h);return c(v.L,v.U,v.p,v.q,p)},"Object, Array | Matrix":function(m,p){return c(m.L,m.U,m.p,m.q,p)}});function u(f){if(Je(f))return f;if(sr(f))return r(f);throw new TypeError("Invalid Matrix LU decomposition")}function c(f,m,p,d,h){f=u(f),m=u(m),p&&(h=l(f,h,!0),h._data=HE(p,h._data));var v=a(f,h),y=o(m,v);return d&&(y._data=HE(d,y._data)),y}});var _4="polynomialRoot",Hae=["typed","isZero","equalScalar","add","subtract","multiply","divide","sqrt","unaryMinus","cbrt","typeOf","im","re"],w4=N(_4,Hae,t=>{var{typed:e,isZero:r,equalScalar:i,add:n,subtract:o,multiply:a,divide:s,sqrt:l,unaryMinus:u,cbrt:c,typeOf:f,im:m,re:p}=t;return e(_4,{"number|Complex, ...number|Complex":(d,h)=>{for(var v=[d,...h];v.length>0&&r(v[v.length-1]);)v.pop();if(v.length<2)throw new RangeError("Polynomial [".concat(d,", ").concat(h,"] must have a non-zero non-constant coefficient"));switch(v.length){case 2:return[u(s(v[0],v[1]))];case 3:{var[y,S,b]=v,_=a(2,b),w=a(S,S),x=a(4,b,y);if(i(w,x))return[s(u(S),_)];var E=l(o(w,x));return[s(o(E,S),_),s(o(u(E),S),_)]}case 4:{var[T,D,M,C]=v,$=u(a(3,C)),O=a(M,M),R=a(3,C,D),L=n(a(2,M,M,M),a(27,C,C,T)),k=a(9,C,M,D);if(i(O,R)&&i(L,k))return[s(M,$)];var V=o(O,R),J=o(L,k),W=n(a(18,C,M,D,T),a(M,M,D,D)),Q=n(a(4,M,M,M,T),a(4,C,D,D,D),a(27,C,C,T,T));if(i(W,Q))return[s(o(a(4,C,M,D),n(a(9,C,C,T),a(M,M,M))),a(C,V)),s(o(a(9,C,T),a(M,D)),a(2,V))];var ie;i(O,R)?ie=J:ie=s(n(J,l(o(a(J,J),a(4,V,V,V)))),2);var B=!0,Z=c(ie,B).toArray().map(q=>s(n(M,q,s(V,q)),$));return Z.map(q=>f(q)==="Complex"&&i(p(q),p(q)+m(q))?p(q):q)}default:throw new RangeError("only implemented for cubic or lower-order polynomials, not ".concat(v))}}})});var Yae="Help",Jae=["evaluate"],S4=N(Yae,Jae,t=>{var{evaluate:e}=t;function r(i){if(!(this instanceof r))throw new SyntaxError("Constructor must be called with the new operator");if(!i)throw new Error('Argument "doc" missing');this.doc=i}return r.prototype.type="Help",r.prototype.isHelp=!0,r.prototype.toString=function(){var i=this.doc||{},n=`
`;if(i.name&&(n+="Name: "+i.name+`
`),i.category&&(n+="Category: "+i.category+`
`),i.description&&(n+=`Description:
`+i.description+`
`),i.syntax&&(n+=`Syntax:
`+i.syntax.join(`
`)+`
`),i.examples){n+=`Examples:
`;for(var o=!1,a=e("config()"),s={config:f=>(o=!0,e("config(newConfig)",{newConfig:f}))},l=0;l<i.examples.length;l++){var u=i.examples[l];n+=" "+u+`
`;var c=void 0;try{c=e(u,s)}catch(f){c=f}c!==void 0&&!Oc(c)&&(n+=" "+Ct(c,{precision:14})+`
`)}n+=`
`,o&&e("config(originalConfig)",{originalConfig:a})}return i.mayThrow&&i.mayThrow.length&&(n+="Throws: "+i.mayThrow.join(", ")+`
`),i.seealso&&i.seealso.length&&(n+="See also: "+i.seealso.join(", ")+`
`),n},r.prototype.toJSON=function(){var i=dt(this.doc);return i.mathjs="Help",i},r.fromJSON=function(i){var n={};return Object.keys(i).filter(o=>o!=="mathjs").forEach(o=>{n[o]=i[o]}),new r(n)},r.prototype.valueOf=r.prototype.toString,r},{isClass:!0});var Xae="Chain",Kae=["?on","math","typed"],D4=N(Xae,Kae,t=>{var{on:e,math:r,typed:i}=t;function n(u){if(!(this instanceof n))throw new SyntaxError("Constructor must be called with the new operator");Rc(u)?this.value=u.value:this.value=u}n.prototype.type="Chain",n.prototype.isChain=!0,n.prototype.done=function(){return this.value},n.prototype.valueOf=function(){return this.value},n.prototype.toString=function(){return Ct(this.value)},n.prototype.toJSON=function(){return{mathjs:"Chain",value:this.value}},n.fromJSON=function(u){return new n(u.value)};function o(u,c){typeof c=="function"&&(n.prototype[u]=s(c))}function a(u,c){Gs(n.prototype,u,function(){var m=c();if(typeof m=="function")return s(m)})}function s(u){return function(){if(arguments.length===0)return new n(u(this.value));for(var c=[this.value],f=0;f<arguments.length;f++)c[f+1]=arguments[f];if(i.isTypedFunction(u)){var m=i.resolve(u,c);if(m.params.length===1)throw new Error("chain function "+u.name+" cannot match rest parameter between chain value and additional arguments.");return new n(m.implementation.apply(u,c))}return new n(u.apply(u,c))}}n.createProxy=function(u,c){if(typeof u=="string")o(u,c);else{var f=function(d){rt(u,d)&&l[d]===void 0&&a(d,()=>u[d])};for(var m in u)f(m)}};var l={expression:!0,docs:!0,type:!0,classes:!0,json:!0,error:!0,isChain:!0};return n.createProxy(r),e&&e("import",function(u,c,f){f||a(u,c)}),n},{isClass:!0});var YE={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"]};var E4={name:"false",category:"Constants",syntax:["false"],description:"Boolean value false",examples:["false"],seealso:["true"]};var A4={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:[]};var T4={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:[]};var N4={name:"LN10",category:"Constants",syntax:["LN10"],description:"Returns the natural logarithm of 10, approximately equal to 2.302",examples:["LN10","log(10)"],seealso:[]};var M4={name:"LN2",category:"Constants",syntax:["LN2"],description:"Returns the natural logarithm of 2, approximately equal to 0.693",examples:["LN2","log(2)"],seealso:[]};var C4={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:[]};var $4={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:[]};var I4={name:"NaN",category:"Constants",syntax:["NaN"],description:"Not a number",examples:["NaN","0 / 0"],seealso:[]};var F4={name:"null",category:"Constants",syntax:["null"],description:"Value null",examples:["null"],seealso:["true","false"]};var k4={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:[]};var JE={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"]};var P4={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:[]};var B4={name:"SQRT2",category:"Constants",syntax:["SQRT2"],description:"Returns the square root of 2, approximately equal to 1.414",examples:["SQRT2","sqrt(2)"],seealso:[]};var O4={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"]};var R4={name:"true",category:"Constants",syntax:["true"],description:"Boolean value true",examples:["true"],seealso:["false"]};var L4={name:"version",category:"Constants",syntax:["version"],description:"A string with the version number of math.js",examples:["version"],seealso:[]};var U4={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"]};var z4={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"]};var V4={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"]};var q4={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"]};var j4={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"]};var Z4={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"]};var G4={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"]};var W4={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"]};var H4={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"]};var Y4={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"]};var J4={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"]};var X4={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"]};var K4={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"]};var Q4={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:[]};var eU={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:[]};var tU={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:[]};var rU={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"]};var nU={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"]};var iU={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"]};var oU={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"]};var aU={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"]};var sU={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"]};var uU={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"]};var lU={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"]};var cU={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"]};var fU={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"]};var pU={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"]};var mU={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"]};var dU={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"]};var hU={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"]};var gU={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"]};var vU={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"]};var yU={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"]};var bU={name:"abs",category:"Arithmetic",syntax:["abs(x)"],description:"Compute the absolute value.",examples:["abs(3.5)","abs(-4.2)"],seealso:["sign"]};var xU={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"]};var _U={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"]};var wU={name:"ceil",category:"Arithmetic",syntax:["ceil(x)","ceil(x, n)","ceil(unit, valuelessUnit)","ceil(unit, n, valuelessUnit)"],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)","ceil(3.241cm, cm)","ceil(3.241cm, 2, cm)"],seealso:["floor","fix","round"]};var SU={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"]};var DU={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"]};var EU={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"]};var AU={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"]};var TU={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"]};var NU={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"]};var MU={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"]};var CU={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"]};var $U={name:"fix",category:"Arithmetic",syntax:["fix(x)","fix(x, n)","fix(unit, valuelessUnit)","fix(unit, n, valuelessUnit)"],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)","fix(3.241cm, cm)","fix(3.241cm, 2, cm)"],seealso:["ceil","floor","round"]};var IU={name:"floor",category:"Arithmetic",syntax:["floor(x)","floor(x, n)","floor(unit, valuelessUnit)","floor(unit, n, valuelessUnit)"],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)","floor(3.241cm, cm)","floor(3.241cm, 2, cm)"],seealso:["ceil","fix","round"]};var FU={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"]};var kU={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"]};var PU={name:"invmod",category:"Arithmetic",syntax:["invmod(a, b)"],description:"Calculate the (modular) multiplicative inverse of a modulo b. Solution to the equation ax \u2263 1 (mod b)",examples:["invmod(8, 12)","invmod(7, 13)","invmod(15151, 15122)"],seealso:["gcd","xgcd"]};var BU={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"]};var OU={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"]};var RU={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"]};var LU={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"]};var UU={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"]};var zU={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"]};var VU={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"]};var qU={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")']};var jU={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"]};var ZU={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"]};var GU={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"]};var WU={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"]};var HU={name:"sign",category:"Arithmetic",syntax:["sign(x)"],description:"Compute the sign of a value. The sign of a value x is 1 when x>0, -1 when x<0, and 0 when x=0.",examples:["sign(3.5)","sign(-4.2)","sign(0)"],seealso:["abs"]};var YU={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"]};var JU={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"]};var XU={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"]};var KU={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"]};var QU={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"]};var ez={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"]};var tz={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"]};var rz={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"]};var nz={name:"unaryPlus",category:"Operators",syntax:["+x","unaryPlus(x)"],description:"Converts booleans and strings to numbers.",examples:["+true",'+"2"'],seealso:["add","subtract","unaryMinus"]};var iz={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"]};var oz={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"]};var az={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"]};var sz={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"]};var uz={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"]};var lz={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"]};var cz={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"]};var fz={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"]};var pz={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"]};var mz={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"]};var dz={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"]};var hz={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"]};var gz={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"]};var vz={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"]};var yz={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"]};var bz={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"]};var xz={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:["parser","parse","compile"]};var _z={name:"parser",category:"Expression",syntax:["parser()"],description:"Create a parser object that keeps a context of variables and their values, allowing the evaluation of expressions in that context.",examples:["myParser = parser()",'myParser.evaluate("sqrt(3^2 + 4^2)")','myParser.set("x", 3)','myParser.evaluate("y = x + 3")','myParser.evaluate(["y = x + 3", "y = y + 1"])','myParser.get("y")'],seealso:["evaluate","parse","compile"]};var wz={name:"parse",category:"Expression",syntax:["parse(expr)","parse(expr, options)","parse([expr1, expr2, expr3, ...])","parse([expr1, expr2, expr3, ...], options)"],description:"Parse an expression. Returns a node tree, which can be evaluated by invoking node.evaluate() or transformed into a functional object via node.compile().",examples:['node1 = parse("sqrt(3^2 + 4^2)")',"node1.evaluate()","code1 = node1.compile()","code1.evaluate()","scope = {a: 3, b: 4}",'node2 = parse("a * b")',"node2.evaluate(scope)","code2 = node2.compile()","code2.evaluate(scope)"],seealso:["parser","evaluate","compile"]};var Sz={name:"compile",category:"Expression",syntax:["compile(expr) ","compile([expr1, expr2, expr3, ...])"],description:"Parse and compile an expression. Returns a an object with a function evaluate([scope]) to evaluate the compiled expression.",examples:['code1 = compile("sqrt(3^2 + 4^2)")',"code1.evaluate() ",'code2 = compile("a * b")',"code2.evaluate({a: 3, b: 4})"],seealso:["parser","parse","evaluate"]};var Dz={name:"help",category:"Expression",syntax:["help(object)","help(string)"],description:"Display documentation on a function or data type.",examples:["help(sqrt)",'help("complex")'],seealso:[]};var Ez={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:[]};var Az={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:[]};var Tz={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"]};var Nz={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"]};var Mz={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"]};var Cz={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"]};var $z={name:"mapSlices",category:"Matrix",syntax:["mapSlices(A, dim, callback)"],description:"Generate a matrix one dimension less than A by applying callback to each slice of A along dimension dim.",examples:["A = [[1, 2], [3, 4]]","mapSlices(A, 1, sum)","mapSlices(A, 2, prod)"],seealso:["map","forEach"]};var Iz={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"]};var Fz={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"]};var kz={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"]};var Pz={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"]};var Bz={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"]};var Oz={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"]};var Rz={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"]};var Lz={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"]};var Uz={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"]};var zz={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"]};var Vz={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"]};var qz={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"]};var jz={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"]};var Zz={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"]};var Gz={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"]};var Wz={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"]};var Hz={name:"pinv",category:"Matrix",syntax:["pinv(x)"],description:"Calculate the Moore\u2013Penrose inverse of a matrix",examples:["pinv([1, 2; 3, 4])","pinv([[1, 0], [0, 1], [0, 1]])","pinv(4)"],seealso:["inv"]};var Yz={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"]};var Jz={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"]};var Xz={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"]};var Kz={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"]};var Qz={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"]};var e3={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"]};var t3={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"]};var r3={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"]};var n3={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"]};var i3={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"]};var o3={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"]};var a3={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"]};var s3={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"]};var u3={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"]};var l3={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"]};var c3={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"]};var f3={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"]};var p3={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"]};var m3={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"]};var d3={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"]};var h3={name:"fft",category:"Matrix",syntax:["fft(x)"],description:"Calculate N-dimensional Fourier transform",examples:["fft([[1, 0], [1, 0]])"],seealso:["ifft"]};var g3={name:"ifft",category:"Matrix",syntax:["ifft(x)"],description:"Calculate N-dimensional inverse Fourier transform",examples:["ifft([[2, 2], [0, 0]])"],seealso:["fft"]};var v3={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"]};var y3={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"]};var b3={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"]};var x3={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"]};var _3={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"]};var w3={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:[]};var S3={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"]};var D3={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"]};var E3={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"]};var A3={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"]};var T3={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"]};var N3={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"]};var M3={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"]};var C3={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"]};var $3={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"]};var I3={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"]};var F3={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"]};var k3={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. Comparing a value with NaN returns false.",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"]};var P3={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"]};var B3={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. Comparing a value with NaN returns false.",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"]};var O3={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"]};var R3={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"]};var L3={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"]};var U3={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"]};var z3={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"]};var V3={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"]};var q3={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"]};var j3={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"]};var Z3={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"]};var G3={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"]};var W3={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"]};var H3={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"]};var Y3={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:[]};var J3={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:[]};var X3={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:[]};var K3={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:[]};var Q3={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"]};var e6={name:"max",category:"Statistics",syntax:["max(a, b, c, ...)","max(A)","max(A, dimension)"],description:"Compute the maximum value of a list of values. If any NaN values are found, the function yields the last NaN in the input.",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"]};var t6={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"]};var r6={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"]};var n6={name:"min",category:"Statistics",syntax:["min(a, b, c, ...)","min(A)","min(A, dimension)"],description:"Compute the minimum value of a list of values. If any NaN values are found, the function yields the last NaN in the input.",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"]};var i6={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"]};var o6={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"]};var a6={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"]};var s6={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"]};var u6={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"]};var l6={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","variance"]};var c6={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"]};var f6={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"]};var p6={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"]};var m6={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"]};var d6={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"]};var h6={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"]};var g6={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"]};var v6={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"]};var y6={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"]};var b6={name:"asech",category:"Trigonometry",syntax:["asech(x)"],description:"Calculate the inverse secant of a value.",examples:["asech(0.5)"],seealso:["acsch","acoth"]};var x6={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"]};var _6={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"]};var w6={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"]};var S6={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"]};var D6={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"]};var E6={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"]};var A6={name:"cosh",category:"Trigonometry",syntax:["cosh(x)"],description:"Compute the hyperbolic cosine of x in radians.",examples:["cosh(0.5)"],seealso:["sinh","tanh","coth"]};var T6={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"]};var N6={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"]};var M6={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"]};var C6={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"]};var $6={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"]};var I6={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"]};var F6={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"]};var k6={name:"sinh",category:"Trigonometry",syntax:["sinh(x)"],description:"Compute the hyperbolic sine of x in radians.",examples:["sinh(0.5)"],seealso:["cosh","tanh"]};var P6={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"]};var B6={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"]};var O6={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:[]};var R6={name:"toBest",category:"Units",syntax:["toBest(x)","toBest(x, unitList)","toBest(x, unitList, options)"],description:"Converts to the most appropriate display unit.",examples:['toBest(unit(5000, "m"))','toBest(unit(3500000, "W"))','toBest(unit(0.000000123, "A"))','toBest(unit(10, "m"), "cm")','toBest(unit(10, "m"), "mm,km", {offset: 1.5})'],seealso:[]};var L6={name:"bin",category:"Utils",syntax:["bin(value)"],description:"Format a number as binary",examples:["bin(2)"],seealso:["oct","hex"]};var U6={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:[]};var z6={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"]};var V6={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"]};var q6={name:"hex",category:"Utils",syntax:["hex(value)"],description:"Format a number as hexadecimal",examples:["hex(240)"],seealso:["bin","oct"]};var j6={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"]};var Z6={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"]};var G6={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"]};var W6={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"]};var H6={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"]};var Y6={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"]};var J6={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"]};var X6={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"]};var K6={name:"oct",category:"Utils",syntax:["oct(value)"],description:"Format a number as octal",examples:["oct(56)"],seealso:["bin","hex"]};var Q6={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"]};var eV={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"]};var tV={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"]};var rV={bignumber:U4,bigint:z4,boolean:V4,complex:q4,createUnit:j4,fraction:Z4,index:G4,matrix:W4,number:H4,sparse:Y4,splitUnit:J4,string:X4,unit:K4,e:YE,E:YE,false:E4,i:A4,Infinity:T4,LN2:M4,LN10:N4,LOG2E:$4,LOG10E:C4,NaN:I4,null:F4,pi:JE,PI:JE,phi:k4,SQRT1_2:P4,SQRT2:B4,tau:O4,true:R4,version:L4,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. Deprecated in favor of coulombConstant",examples:["coulombConstant"]},coulombConstant:{description:"Coulomb's constant",examples:["coulombConstant"]},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:rU,lsolve:iU,lsolveAll:oU,lup:aU,lusolve:sU,leafCount:nU,polynomialRoot:uU,resolve:fU,simplify:pU,simplifyConstant:mU,simplifyCore:dU,symbolicEqual:gU,rationalize:cU,slu:hU,usolve:vU,usolveAll:yU,qr:lU,abs:bU,add:xU,cbrt:_U,ceil:wU,cube:SU,divide:DU,dotDivide:EU,dotMultiply:AU,dotPow:TU,exp:NU,expm:MU,expm1:CU,fix:$U,floor:IU,gcd:FU,hypot:kU,lcm:BU,log:OU,log2:UU,log1p:LU,log10:RU,mod:zU,multiply:VU,norm:qU,nthRoot:jU,nthRoots:ZU,pow:GU,round:WU,sign:HU,sqrt:YU,sqrtm:JU,square:ez,subtract:tz,unaryMinus:rz,unaryPlus:nz,xgcd:iz,invmod:PU,bitAnd:oz,bitNot:az,bitOr:sz,bitXor:uz,leftShift:lz,rightArithShift:cz,rightLogShift:fz,bellNumbers:pz,catalan:mz,composition:dz,stirlingS2:hz,config:Q4,import:eU,typed:tU,arg:gz,conj:vz,re:bz,im:yz,evaluate:xz,help:Dz,parse:wz,parser:_z,compile:Sz,distance:Ez,intersect:Az,and:Tz,not:Nz,or:Mz,xor:Cz,mapSlices:$z,concat:Fz,count:kz,cross:Pz,column:Iz,ctranspose:Bz,det:Oz,diag:Rz,diff:Lz,dot:Uz,getMatrixDataType:Zz,identity:Gz,filter:Vz,flatten:qz,forEach:jz,inv:Wz,pinv:Hz,eigs:zz,kron:Yz,matrixFromFunction:Kz,matrixFromRows:Qz,matrixFromColumns:Xz,map:Jz,ones:e3,partitionSelect:t3,range:r3,resize:i3,reshape:n3,rotate:o3,rotationMatrix:a3,row:s3,size:u3,sort:l3,squeeze:c3,subset:f3,trace:p3,transpose:m3,zeros:d3,fft:h3,ifft:g3,sylvester:XU,schur:KU,lyap:QU,solveODE:tV,combinations:v3,combinationsWithRep:y3,factorial:b3,gamma:x3,kldivergence:w3,lgamma:_3,multinomial:S3,permutations:D3,pickRandom:E3,random:A3,randomInt:T3,compare:N3,compareNatural:M3,compareText:C3,deepEqual:$3,equal:I3,equalText:F3,larger:k3,largerEq:P3,smaller:B3,smallerEq:O3,unequal:R3,setCartesian:L3,setDifference:U3,setDistinct:z3,setIntersect:V3,setIsSubset:q3,setMultiplicity:j3,setPowerset:Z3,setSize:G3,setSymDifference:W3,setUnion:H3,zpk2tf:Y3,freqz:J3,erf:X3,zeta:K3,cumsum:u6,mad:Q3,max:e6,mean:t6,median:r6,min:n6,mode:i6,prod:o6,quantileSeq:a6,std:s6,sum:l6,variance:c6,corr:f6,acos:p6,acosh:m6,acot:d6,acoth:h6,acsc:g6,acsch:v6,asec:y6,asech:b6,asin:x6,asinh:_6,atan:w6,atanh:D6,atan2:S6,cos:E6,cosh:A6,cot:T6,coth:N6,csc:M6,csch:C6,sec:$6,sech:I6,sin:F6,sinh:k6,tan:P6,tanh:B6,to:O6,toBest:R6,clone:U6,format:z6,bin:L6,oct:K6,hex:q6,isNaN:Z6,isInteger:j6,isNegative:G6,isNumeric:W6,hasNumericValue:V6,isPositive:H6,isPrime:Y6,isZero:J6,print:Q6,typeOf:eV,numeric:X6};var nV="help",Qae=["typed","mathWithTransform","Help"],iV=N(nV,Qae,t=>{var{typed:e,mathWithTransform:r,Help:i}=t;return e(nV,{any:function(o){var a,s=o;if(typeof o!="string"){for(a in r)if(rt(r,a)&&o===r[a]){s=a;break}}var l=Yr(rV,s);if(!l){var u=typeof s=="function"?s.name:s;throw new Error('No documentation found on "'+u+'"')}return new i(l)}})});var oV="chain",ese=["typed","Chain"],aV=N(oV,ese,t=>{var{typed:e,Chain:r}=t;return e(oV,{"":function(){return new r},any:function(n){return new r(n)}})});var sV="det",tse=["typed","matrix","subtractScalar","multiply","divideScalar","isZero","unaryMinus"],uV=N(sV,tse,t=>{var{typed:e,matrix:r,subtractScalar:i,multiply:n,divideScalar:o,isZero:a,unaryMinus:s}=t;return e(sV,{any:function(c){return dt(c)},"Array | Matrix":function(c){var f;switch(Je(c)?f=c.size():Array.isArray(c)?(c=r(c),f=c.size()):f=[],f.length){case 0:return dt(c);case 1:if(f[0]===1)return dt(c.valueOf()[0]);if(f[0]===0)return 1;throw new RangeError("Matrix must be square (size: "+Ct(f)+")");case 2:{var m=f[0],p=f[1];if(m===p)return l(c.clone().valueOf(),m,p);if(p===0)return 1;throw new RangeError("Matrix must be square (size: "+Ct(f)+")")}default:throw new RangeError("Matrix must be two dimensional (size: "+Ct(f)+")")}}});function l(u,c,f){if(c===1)return dt(u[0][0]);if(c===2)return i(n(u[0][0],u[1][1]),n(u[1][0],u[0][1]));for(var m=!1,p=new Array(c).fill(0).map((E,T)=>T),d=0;d<c;d++){var h=p[d];if(a(u[h][d])){var v=void 0;for(v=d+1;v<c;v++)if(!a(u[p[v]][d])){h=p[v],p[v]=p[d],p[d]=h,m=!m;break}if(v===c)return u[h][d]}for(var y=u[h][d],S=d===0?1:u[p[d-1]][d-1],b=d+1;b<c;b++)for(var _=p[b],w=d+1;w<c;w++)u[_][w]=o(i(n(u[_][w],y),n(u[_][d],u[h][w])),S)}var x=u[p[c-1]][c-1];return m?s(x):x}});var lV="inv",rse=["typed","matrix","divideScalar","addScalar","multiply","unaryMinus","det","identity","abs"],cV=N(lV,rse,t=>{var{typed:e,matrix:r,divideScalar:i,addScalar:n,multiply:o,unaryMinus:a,det:s,identity:l,abs:u}=t;return e(lV,{"Array | Matrix":function(m){var p=Je(m)?m.size():vt(m);switch(p.length){case 1:if(p[0]===1)return Je(m)?r([i(1,m.valueOf()[0])]):[i(1,m[0])];throw new RangeError("Matrix must be square (size: "+Ct(p)+")");case 2:{var d=p[0],h=p[1];if(d===h)return Je(m)?r(c(m.valueOf(),d,h),m.storage()):c(m,d,h);throw new RangeError("Matrix must be square (size: "+Ct(p)+")")}default:throw new RangeError("Matrix must be two dimensional (size: "+Ct(p)+")")}},any:function(m){return i(1,m)}});function c(f,m,p){var d,h,v,y,S;if(m===1){if(y=f[0][0],y===0)throw Error("Cannot calculate inverse, determinant is zero");return[[i(1,y)]]}else if(m===2){var b=s(f);if(b===0)throw Error("Cannot calculate inverse, determinant is zero");return[[i(f[1][1],b),i(a(f[0][1]),b)],[i(a(f[1][0]),b),i(f[0][0],b)]]}else{var _=f.concat();for(d=0;d<m;d++)_[d]=_[d].concat();for(var w=l(m).valueOf(),x=0;x<p;x++){var E=u(_[x][x]),T=x;for(d=x+1;d<m;)u(_[d][x])>E&&(E=u(_[d][x]),T=d),d++;if(E===0)throw Error("Cannot calculate inverse, determinant is zero");d=T,d!==x&&(S=_[x],_[x]=_[d],_[d]=S,S=w[x],w[x]=w[d],w[d]=S);var D=_[x],M=w[x];for(d=0;d<m;d++){var C=_[d],$=w[d];if(d!==x){if(C[x]!==0){for(v=i(a(C[x]),D[x]),h=x;h<p;h++)C[h]=n(C[h],o(v,D[h]));for(h=0;h<p;h++)$[h]=n($[h],o(v,M[h]))}}else{for(v=D[x],h=x;h<p;h++)C[h]=i(C[h],v);for(h=0;h<p;h++)$[h]=i($[h],v)}}}return w}}});var fV="pinv",nse=["typed","matrix","inv","deepEqual","equal","dotDivide","dot","ctranspose","divideScalar","multiply","add","Complex"],pV=N(fV,nse,t=>{var{typed:e,matrix:r,inv:i,deepEqual:n,equal:o,dotDivide:a,dot:s,ctranspose:l,divideScalar:u,multiply:c,add:f,Complex:m}=t;return e(fV,{"Array | Matrix":function(b){var _=Je(b)?b.size():vt(b);switch(_.length){case 1:return y(b)?l(b):_[0]===1?i(b):a(l(b),s(b,b));case 2:{if(y(b))return l(b);var w=_[0],x=_[1];if(w===x)try{return i(b)}catch(E){if(!(E instanceof Error&&E.message.match(/Cannot calculate inverse, determinant is zero/)))throw E}return Je(b)?r(p(b.valueOf(),w,x),b.storage()):p(b,w,x)}default:throw new RangeError("Matrix must be two dimensional (size: "+Ct(_)+")")}},any:function(b){return o(b,0)?dt(b):u(1,b)}});function p(S,b,_){var{C:w,F:x}=h(S,b,_),E=c(i(c(l(w),w)),l(w)),T=c(l(x),i(c(x,l(x))));return c(T,E)}function d(S,b,_){for(var w=dt(S),x=0,E=0;E<b;E++){if(_<=x)return w;for(var T=E;v(w[T][x]);)if(T++,b===T&&(T=E,x++,_===x))return w;[w[T],w[E]]=[w[E],w[T]];for(var D=w[E][x],M=0;M<_;M++)w[E][M]=a(w[E][M],D);for(var C=0;C<b;C++)if(C!==E){D=w[C][x];for(var $=0;$<_;$++)w[C][$]=f(w[C][$],c(-1,c(D,w[E][$])))}x++}return w}function h(S,b,_){var w=d(S,b,_),x=S.map((T,D)=>T.filter((M,C)=>C<b&&!v(s(w[C],w[C])))),E=w.filter((T,D)=>!v(s(w[D],w[D])));return{C:x,F:E}}function v(S){return o(f(S,m(1,1)),f(0,m(1,1)))}function y(S){return n(f(S,m(1,1)),f(c(S,0),m(1,1)))}});function mV(t){var{addScalar:e,subtract:r,flatten:i,multiply:n,multiplyScalar:o,divideScalar:a,sqrt:s,abs:l,bignumber:u,diag:c,size:f,reshape:m,inv:p,qr:d,usolve:h,usolveAll:v,equal:y,complex:S,larger:b,smaller:_,matrixFromColumns:w,dot:x}=t;function E(B,Z,q,xe){var de=arguments.length>4&&arguments[4]!==void 0?arguments[4]:!0,be=T(B,Z,q,xe,de);D(B,Z,q,xe,de,be);var{values:G,C:K}=M(B,Z,q,xe,de);if(de){var re=C(B,Z,K,be,G,q,xe);return{values:G,eigenvectors:re}}return{values:G}}function T(B,Z,q,xe,de){var be=xe==="BigNumber",G=xe==="Complex",K=be?u(0):0,re=be?u(1):G?S(1):1,ae=be?u(1):1,le=be?u(10):2,Se=o(le,le),_e;de&&(_e=Array(Z).fill(re));for(var Oe=!1;!Oe;){Oe=!0;for(var st=0;st<Z;st++){for(var yt=K,Qe=K,ut=0;ut<Z;ut++)st!==ut&&(yt=e(yt,l(B[ut][st])),Qe=e(Qe,l(B[st][ut])));if(!y(yt,0)&&!y(Qe,0)){for(var H=ae,oe=yt,ve=a(Qe,le),De=o(Qe,le);_(oe,ve);)oe=o(oe,Se),H=o(H,le);for(;b(oe,De);)oe=a(oe,Se),H=a(H,le);var Ee=_(a(e(oe,Qe),H),o(e(yt,Qe),.95));if(Ee){Oe=!1;for(var Ue=a(1,H),He=0;He<Z;He++)st!==He&&(B[st][He]=o(B[st][He],Ue),B[He][st]=o(B[He][st],H));de&&(_e[st]=o(_e[st],Ue))}}}}return de?c(_e):null}function D(B,Z,q,xe,de,be){var G=xe==="BigNumber",K=xe==="Complex",re=G?u(0):K?S(0):0;G&&(q=u(q));for(var ae=0;ae<Z-2;ae++){for(var le=0,Se=re,_e=ae+1;_e<Z;_e++){var Oe=B[_e][ae];_(l(Se),l(Oe))&&(Se=Oe,le=_e)}if(!_(l(Se),q)){if(le!==ae+1){var st=B[le];B[le]=B[ae+1],B[ae+1]=st;for(var yt=0;yt<Z;yt++){var Qe=B[yt][le];B[yt][le]=B[yt][ae+1],B[yt][ae+1]=Qe}if(de){var ut=be[le];be[le]=be[ae+1],be[ae+1]=ut}}for(var H=ae+2;H<Z;H++){var oe=a(B[H][ae],Se);if(oe!==0){for(var ve=0;ve<Z;ve++)B[H][ve]=r(B[H][ve],o(oe,B[ae+1][ve]));for(var De=0;De<Z;De++)B[De][ae+1]=e(B[De][ae+1],o(oe,B[De][H]));if(de)for(var Ee=0;Ee<Z;Ee++)be[H][Ee]=r(be[H][Ee],o(oe,be[ae+1][Ee]))}}}}return be}function M(B,Z,q,xe,de){var be=xe==="BigNumber",G=xe==="Complex",K=be?u(1):G?S(1):1;be&&(q=u(q));for(var re=dt(B),ae=[],le=Z,Se=[],_e=de?c(Array(Z).fill(K)):void 0,Oe=de?c(Array(le).fill(K)):void 0,st=0;st<=100;){st+=1;for(var yt=re[le-1][le-1],Qe=0;Qe<le;Qe++)re[Qe][Qe]=r(re[Qe][Qe],yt);var{Q:ut,R:H}=d(re);re=n(H,ut);for(var oe=0;oe<le;oe++)re[oe][oe]=e(re[oe][oe],yt);if(de&&(Oe=n(Oe,ut)),le===1||_(l(re[le-1][le-2]),q)){st=0,ae.push(re[le-1][le-1]),de&&(Se.unshift([[1]]),R(Oe,Z),_e=n(_e,Oe),le>1&&(Oe=c(Array(le-1).fill(K)))),le-=1,re.pop();for(var ve=0;ve<le;ve++)re[ve].pop()}else if(le===2||_(l(re[le-2][le-3]),q)){st=0;var De=$(re[le-2][le-2],re[le-2][le-1],re[le-1][le-2],re[le-1][le-1]);ae.push(...De),de&&(Se.unshift(O(re[le-2][le-2],re[le-2][le-1],re[le-1][le-2],re[le-1][le-1],De[0],De[1],q,xe)),R(Oe,Z),_e=n(_e,Oe),le>2&&(Oe=c(Array(le-2).fill(K)))),le-=2,re.pop(),re.pop();for(var Ee=0;Ee<le;Ee++)re[Ee].pop(),re[Ee].pop()}if(le===0)break}if(ae.sort((nt,ke)=>+r(l(nt),l(ke))),st>100){var Ue=Error("The eigenvalues failed to converge. Only found these eigenvalues: "+ae.join(", "));throw Ue.values=ae,Ue.vectors=[],Ue}var He=de?n(_e,L(Se,Z)):void 0;return{values:ae,C:He}}function C(B,Z,q,xe,de,be,G){var K=p(q),re=n(K,B,q),ae=G==="BigNumber",le=G==="Complex",Se=ae?u(0):le?S(0):0,_e=ae?u(1):le?S(1):1,Oe=[],st=[];for(var yt of de){var Qe=k(Oe,yt,y);Qe===-1?(Oe.push(yt),st.push(1)):st[Qe]+=1}for(var ut=[],H=Oe.length,oe=Array(Z).fill(Se),ve=c(Array(Z).fill(_e)),De=function(){var He=Oe[Ee],nt=r(re,n(He,ve)),ke=v(nt,oe);for(ke.shift();ke.length<st[Ee];){var Y=V(nt,Z,ke,be,G);if(Y===null)break;ke.push(Y)}var me=n(p(xe),q);ke=ke.map(ce=>n(me,ce)),ut.push(...ke.map(ce=>({value:He,vector:i(ce)})))},Ee=0;Ee<H;Ee++)De();return ut}function $(B,Z,q,xe){var de=e(B,xe),be=r(o(B,xe),o(Z,q)),G=o(de,.5),K=o(s(r(o(de,de),o(4,be))),.5);return[e(G,K),r(G,K)]}function O(B,Z,q,xe,de,be,G,K){var re=K==="BigNumber",ae=K==="Complex",le=re?u(0):ae?S(0):0,Se=re?u(1):ae?S(1):1;if(_(l(q),G))return[[Se,le],[le,Se]];if(b(l(r(de,be)),G))return[[r(de,xe),r(be,xe)],[q,q]];var _e=r(B,de),Oe=r(xe,de);return _(l(Z),G)&&_(l(Oe),G)?[[_e,Se],[q,le]]:[[Z,le],[Oe,Se]]}function R(B,Z){for(var q=0;q<B.length;q++)B[q].push(...Array(Z-B[q].length).fill(0));for(var xe=B.length;xe<Z;xe++)B.push(Array(Z).fill(0)),B[xe][xe]=1;return B}function L(B,Z){for(var q=[],xe=0;xe<Z;xe++)q[xe]=Array(Z).fill(0);var de=0;for(var be of B){for(var G=be.length,K=0;K<G;K++)for(var re=0;re<G;re++)q[de+K][de+re]=be[K][re];de+=G}return q}function k(B,Z,q){for(var xe=0;xe<B.length;xe++)if(q(B[xe],Z))return xe;return-1}function V(B,Z,q,xe,de){for(var be=de==="BigNumber"?u(1e3):1e3,G,K=0;K<5;++K){G=J(Z,q,de);try{G=h(B,G)}catch{continue}if(b(Q(G),be))break}if(K>=5)return null;for(K=0;;){var re=h(B,G);if(_(Q(W(G,[re])),xe))break;if(++K>=10)return null;G=ie(re)}return G}function J(B,Z,q){var xe=q==="BigNumber",de=q==="Complex",be=Array(B).fill(0).map(G=>2*Math.random()-1);return xe&&(be=be.map(G=>u(G))),de&&(be=be.map(G=>S(G))),be=W(be,Z),ie(be,q)}function W(B,Z){var q=f(B);for(var xe of Z)xe=m(xe,q),B=r(B,n(a(x(xe,B),x(xe,xe)),xe));return B}function Q(B){return l(s(x(B,B)))}function ie(B,Z){var q=Z==="BigNumber",xe=Z==="Complex",de=q?u(1):xe?S(1):1;return n(a(de,Q(B)),B)}return E}function dV(t){var{config:e,addScalar:r,subtract:i,abs:n,atan:o,cos:a,sin:s,multiplyScalar:l,inv:u,bignumber:c,multiply:f,add:m}=t;function p(D,M){var C=arguments.length>2&&arguments[2]!==void 0?arguments[2]:e.relTol,$=arguments.length>3?arguments[3]:void 0,O=arguments.length>4?arguments[4]:void 0;if($==="number")return d(D,C,O);if($==="BigNumber")return h(D,C,O);throw TypeError("Unsupported data type: "+$)}function d(D,M,C){var $=D.length,O=Math.abs(M/$),R,L;if(C){L=new Array($);for(var k=0;k<$;k++)L[k]=Array($).fill(0),L[k][k]=1}for(var V=x(D);Math.abs(V[1])>=Math.abs(O);){var J=V[0][0],W=V[0][1];R=v(D[J][J],D[W][W],D[J][W]),D=w(D,R,J,W),C&&(L=S(L,R,J,W)),V=x(D)}for(var Q=Array($).fill(0),ie=0;ie<$;ie++)Q[ie]=D[ie][ie];return T(dt(Q),L,C)}function h(D,M,C){var $=D.length,O=n(M/$),R,L;if(C){L=new Array($);for(var k=0;k<$;k++)L[k]=Array($).fill(0),L[k][k]=1}for(var V=E(D);n(V[1])>=n(O);){var J=V[0][0],W=V[0][1];R=y(D[J][J],D[W][W],D[J][W]),D=_(D,R,J,W),C&&(L=b(L,R,J,W)),V=E(D)}for(var Q=Array($).fill(0),ie=0;ie<$;ie++)Q[ie]=D[ie][ie];return T(dt(Q),L,C)}function v(D,M,C){var $=M-D;return Math.abs($)<=e.relTol?Math.PI/4:.5*Math.atan(2*C/(M-D))}function y(D,M,C){var $=i(M,D);return n($)<=e.relTol?c(-1).acos().div(4):l(.5,o(f(2,C,u($))))}function S(D,M,C,$){for(var O=D.length,R=Math.cos(M),L=Math.sin(M),k=Array(O).fill(0),V=Array(O).fill(0),J=0;J<O;J++)k[J]=R*D[J][C]-L*D[J][$],V[J]=L*D[J][C]+R*D[J][$];for(var W=0;W<O;W++)D[W][C]=k[W],D[W][$]=V[W];return D}function b(D,M,C,$){for(var O=D.length,R=a(M),L=s(M),k=Array(O).fill(c(0)),V=Array(O).fill(c(0)),J=0;J<O;J++)k[J]=i(l(R,D[J][C]),l(L,D[J][$])),V[J]=r(l(L,D[J][C]),l(R,D[J][$]));for(var W=0;W<O;W++)D[W][C]=k[W],D[W][$]=V[W];return D}function _(D,M,C,$){for(var O=D.length,R=c(a(M)),L=c(s(M)),k=l(R,R),V=l(L,L),J=Array(O).fill(c(0)),W=Array(O).fill(c(0)),Q=f(c(2),R,L,D[C][$]),ie=r(i(l(k,D[C][C]),Q),l(V,D[$][$])),B=m(l(V,D[C][C]),Q,l(k,D[$][$])),Z=0;Z<O;Z++)J[Z]=i(l(R,D[C][Z]),l(L,D[$][Z])),W[Z]=r(l(L,D[C][Z]),l(R,D[$][Z]));D[C][C]=ie,D[$][$]=B,D[C][$]=c(0),D[$][C]=c(0);for(var q=0;q<O;q++)q!==C&&q!==$&&(D[C][q]=J[q],D[q][C]=J[q],D[$][q]=W[q],D[q][$]=W[q]);return D}function w(D,M,C,$){for(var O=D.length,R=Math.cos(M),L=Math.sin(M),k=R*R,V=L*L,J=Array(O).fill(0),W=Array(O).fill(0),Q=k*D[C][C]-2*R*L*D[C][$]+V*D[$][$],ie=V*D[C][C]+2*R*L*D[C][$]+k*D[$][$],B=0;B<O;B++)J[B]=R*D[C][B]-L*D[$][B],W[B]=L*D[C][B]+R*D[$][B];D[C][C]=Q,D[$][$]=ie,D[C][$]=0,D[$][C]=0;for(var Z=0;Z<O;Z++)Z!==C&&Z!==$&&(D[C][Z]=J[Z],D[Z][C]=J[Z],D[$][Z]=W[Z],D[Z][$]=W[Z]);return D}function x(D){for(var M=D.length,C=0,$=[0,1],O=0;O<M;O++)for(var R=O+1;R<M;R++)Math.abs(C)<Math.abs(D[O][R])&&(C=Math.abs(D[O][R]),$=[O,R]);return[$,C]}function E(D){for(var M=D.length,C=0,$=[0,1],O=0;O<M;O++)for(var R=O+1;R<M;R++)n(C)<n(D[O][R])&&(C=n(D[O][R]),$=[O,R]);return[$,C]}function T(D,M,C){var $=D.length,O=Array($),R;if(C){R=Array($);for(var L=0;L<$;L++)R[L]=Array($)}for(var k=0;k<$;k++){for(var V=0,J=D[0],W=0;W<D.length;W++)n(D[W])<n(J)&&(V=W,J=D[V]);if(O[k]=D.splice(V,1)[0],C)for(var Q=0;Q<$;Q++)R[k][Q]=M[Q][V],M[Q].splice(V,1)}if(!C)return{values:O};var ie=R.map((B,Z)=>({value:O[Z],vector:B}));return{values:O,eigenvectors:ie}}return p}var ise="eigs",ose=["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"],hV=N(ise,ose,t=>{var{config:e,typed:r,matrix:i,addScalar:n,subtract:o,equal:a,abs:s,atan:l,cos:u,sin:c,multiplyScalar:f,divideScalar:m,inv:p,bignumber:d,multiply:h,add:v,larger:y,column:S,flatten:b,number:_,complex:w,sqrt:x,diag:E,size:T,reshape:D,qr:M,usolve:C,usolveAll:$,im:O,re:R,smaller:L,matrixFromColumns:k,dot:V}=t,J=dV({config:e,addScalar:n,subtract:o,column:S,flatten:b,equal:a,abs:s,atan:l,cos:u,sin:c,multiplyScalar:f,inv:p,bignumber:d,complex:w,multiply:h,add:v}),W=mV({config:e,addScalar:n,subtract:o,multiply:h,multiplyScalar:f,flatten:b,divideScalar:m,sqrt:x,abs:s,bignumber:d,diag:E,size:T,reshape:D,qr:M,inv:p,usolve:C,usolveAll:$,equal:a,complex:w,larger:y,smaller:L,matrixFromColumns:k,dot:V});return r("eigs",{Array:function(be){return Q(i(be))},"Array, number|BigNumber":function(be,G){return Q(i(be),{precision:G})},"Array, Object"(de,be){return Q(i(de),be)},Matrix:function(be){return Q(be,{matricize:!0})},"Matrix, number|BigNumber":function(be,G){return Q(be,{precision:G,matricize:!0})},"Matrix, Object":function(be,G){var K={matricize:!0};return Dn(K,G),Q(be,K)}});function Q(de){var be,G=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},K="eigenvectors"in G?G.eigenvectors:!0,re=(be=G.precision)!==null&&be!==void 0?be:e.relTol,ae=ie(de,re,K);return G.matricize&&(ae.values=i(ae.values),K&&(ae.eigenvectors=ae.eigenvectors.map(le=>{var{value:Se,vector:_e}=le;return{value:Se,vector:i(_e)}}))),K&&Object.defineProperty(ae,"vectors",{enumerable:!1,get:()=>{throw new Error("eigs(M).vectors replaced with eigs(M).eigenvectors")}}),ae}function ie(de,be,G){var K=de.toArray(),re=de.size();if(re.length!==2||re[0]!==re[1])throw new RangeError("Matrix must be square (size: ".concat(Ct(re),")"));var ae=re[0];if(Z(K,ae,be)&&(q(K,ae),B(K,ae,be))){var le=xe(de,K,ae);return J(K,ae,be,le,G)}var Se=xe(de,K,ae);return W(K,ae,be,Se,G)}function B(de,be,G){for(var K=0;K<be;K++)for(var re=K;re<be;re++)if(y(d(s(o(de[K][re],de[re][K]))),G))return!1;return!0}function Z(de,be,G){for(var K=0;K<be;K++)for(var re=0;re<be;re++)if(y(d(s(O(de[K][re]))),G))return!1;return!0}function q(de,be){for(var G=0;G<be;G++)for(var K=0;K<be;K++)de[G][K]=R(de[G][K])}function xe(de,be,G){var K=de.datatype();if(K==="number"||K==="BigNumber"||K==="Complex")return K;for(var re=!1,ae=!1,le=!1,Se=0;Se<G;Se++)for(var _e=0;_e<G;_e++){var Oe=be[Se][_e];if(Et(Oe)||Io(Oe))re=!0;else if(mt(Oe))ae=!0;else if(Qn(Oe))le=!0;else throw TypeError("Unsupported type in Matrix: "+ir(Oe))}if(ae&&le&&console.warn("Complex BigNumbers not supported, this operation will lose precission."),le){for(var st=0;st<G;st++)for(var yt=0;yt<G;yt++)be[st][yt]=w(be[st][yt]);return"Complex"}if(ae){for(var Qe=0;Qe<G;Qe++)for(var ut=0;ut<G;ut++)be[Qe][ut]=d(be[Qe][ut]);return"BigNumber"}if(re){for(var H=0;H<G;H++)for(var oe=0;oe<G;oe++)be[H][oe]=_(be[H][oe]);return"number"}else throw TypeError("Matrix contains unsupported types only.")}});var gV="expm",ase=["typed","abs","add","identity","inv","multiply"],vV=N(gV,ase,t=>{var{typed:e,abs:r,add:i,identity:n,inv:o,multiply:a}=t;return e(gV,{Matrix:function(f){var m=f.size();if(m.length!==2||m[0]!==m[1])throw new RangeError("Matrix must be square (size: "+Ct(m)+")");for(var p=m[0],d=1e-15,h=s(f),v=l(h,d),y=v.q,S=v.j,b=a(f,Math.pow(2,-S)),_=n(p),w=n(p),x=1,E=b,T=-1,D=1;D<=y;D++)D>1&&(E=a(E,b),T=-T),x=x*(y-D+1)/((2*y-D+1)*D),_=i(_,a(x,E)),w=i(w,a(x*T,E));for(var M=a(o(w),_),C=0;C<S;C++)M=a(M,M);return Fo(f)?f.createSparseMatrix(M):M}});function s(c){for(var f=c.size()[0],m=0,p=0;p<f;p++){for(var d=0,h=0;h<f;h++)d+=r(c.get([p,h]));m=Math.max(d,m)}return m}function l(c,f){for(var m=30,p=0;p<m;p++)for(var d=0;d<=p;d++){var h=p-d;if(u(c,d,h)<f)return{q:d,j:h}}throw new Error("Could not find acceptable parameters to compute the matrix exponential (try increasing maxSearchSize in expm.js)")}function u(c,f,m){for(var p=1,d=2;d<=f;d++)p*=d;for(var h=p,v=f+1;v<=2*f;v++)h*=v;var y=h*(2*f+1);return 8*Math.pow(c/Math.pow(2,m),2*f)*p*p/(h*y)}});var yV="sqrtm",sse=["typed","abs","add","multiply","map","sqrt","subtract","inv","size","max","identity"],bV=N(yV,sse,t=>{var{typed:e,abs:r,add:i,multiply:n,map:o,sqrt:a,subtract:s,inv:l,size:u,max:c,identity:f}=t,m=1e3,p=1e-6;function d(h){var v,y=0,S=h,b=f(u(h));do{var _=S;if(S=n(.5,i(_,l(b))),b=n(.5,i(b,l(_))),v=c(r(s(S,_))),v>p&&++y>m)throw new Error("computing square root of matrix: iterative method could not converge")}while(v>p);return S}return e(yV,{"Array | Matrix":function(v){var y=Je(v)?v.size():vt(v);switch(y.length){case 1:if(y[0]===1)return o(v,a);throw new RangeError("Matrix must be square (size: "+Ct(y)+")");case 2:{var S=y[0],b=y[1];if(S===b)return d(v);throw new RangeError("Matrix must be square (size: "+Ct(y)+")")}default:throw new RangeError("Matrix must be at most two dimensional (size: "+Ct(y)+")")}}})});var xV="sylvester",use=["typed","schur","matrixFromColumns","matrix","multiply","range","concat","transpose","index","subset","add","subtract","identity","lusolve","abs"],_V=N(xV,use,t=>{var{typed:e,schur:r,matrixFromColumns:i,matrix:n,multiply:o,range:a,concat:s,transpose:l,index:u,subset:c,add:f,subtract:m,identity:p,lusolve:d,abs:h}=t;return e(xV,{"Matrix, Matrix, Matrix":v,"Array, Matrix, Matrix":function(S,b,_){return v(n(S),b,_)},"Array, Array, Matrix":function(S,b,_){return v(n(S),n(b),_)},"Array, Matrix, Array":function(S,b,_){return v(n(S),b,n(_))},"Matrix, Array, Matrix":function(S,b,_){return v(S,n(b),_)},"Matrix, Array, Array":function(S,b,_){return v(S,n(b),n(_))},"Matrix, Matrix, Array":function(S,b,_){return v(S,b,n(_))},"Array, Array, Array":function(S,b,_){return v(n(S),n(b),n(_)).toArray()}});function v(y,S,b){for(var _=S.size()[0],w=y.size()[0],x=r(y),E=x.T,T=x.U,D=r(o(-1,S)),M=D.T,C=D.U,$=o(o(l(T),b),C),O=a(0,w),R=[],L=(le,Se)=>s(le,Se,1),k=(le,Se)=>s(le,Se,0),V=0;V<_;V++)if(V<_-1&&h(c(M,u(V+1,V)))>1e-5){for(var J=k(c($,u(O,V)),c($,u(O,V+1))),W=0;W<V;W++)J=f(J,k(o(R[W],c(M,u(W,V))),o(R[W],c(M,u(W,V+1)))));var Q=o(p(w),o(-1,c(M,u(V,V)))),ie=o(p(w),o(-1,c(M,u(V+1,V)))),B=o(p(w),o(-1,c(M,u(V,V+1)))),Z=o(p(w),o(-1,c(M,u(V+1,V+1)))),q=k(L(f(E,Q),ie),L(B,f(E,Z))),xe=d(q,J);R[V]=xe.subset(u(a(0,w),0)),R[V+1]=xe.subset(u(a(w,2*w),0)),V++}else{for(var de=c($,u(O,V)),be=0;be<V;be++)de=f(de,o(R[be],c(M,u(be,V))));var G=c(M,u(V,V)),K=m(E,o(G,p(w)));R[V]=d(K,de)}var re=n(i(...R)),ae=o(T,o(re,l(C)));return ae}});var wV="schur",lse=["typed","matrix","identity","multiply","qr","norm","subtract"],SV=N(wV,lse,t=>{var{typed:e,matrix:r,identity:i,multiply:n,qr:o,norm:a,subtract:s}=t;return e(wV,{Array:function(c){var f=l(r(c));return{U:f.U.valueOf(),T:f.T.valueOf()}},Matrix:function(c){return l(c)}});function l(u){var c=u.size()[0],f=u,m=i(c),p=0,d;do{d=f;var h=o(f),v=h.Q,y=h.R;if(f=n(y,v),m=n(m,v),p++>100)break}while(a(s(f,d))>1e-4);return{U:m,T:f}}});var DV="lyap",cse=["typed","matrix","sylvester","multiply","transpose"],EV=N(DV,cse,t=>{var{typed:e,matrix:r,sylvester:i,multiply:n,transpose:o}=t;return e(DV,{"Matrix, Matrix":function(s,l){return i(s,o(s),n(-1,l))},"Array, Matrix":function(s,l){return i(r(s),o(r(s)),n(-1,l))},"Matrix, Array":function(s,l){return i(s,o(r(s)),r(n(-1,l)))},"Array, Array":function(s,l){return i(r(s),o(r(s)),r(n(-1,l))).toArray()}})});var fse="divide",pse=["typed","matrix","multiply","equalScalar","divideScalar","inv"],AV=N(fse,pse,t=>{var{typed:e,matrix:r,multiply:i,equalScalar:n,divideScalar:o,inv:a}=t,s=Er({typed:e,equalScalar:n}),l=An({typed:e});return e("divide",Rv({"Array | Matrix, Array | Matrix":function(c,f){return i(c,a(f))},"DenseMatrix, any":function(c,f){return l(c,f,o,!1)},"SparseMatrix, any":function(c,f){return s(c,f,o,!1)},"Array, any":function(c,f){return l(r(c),f,o,!1).valueOf()},"any, Array | Matrix":function(c,f){return i(c,a(f))}},o.signatures))});var TV="distance",mse=["typed","addScalar","subtractScalar","divideScalar","multiplyScalar","deepEqual","sqrt","abs"],NV=N(TV,mse,t=>{var{typed:e,addScalar:r,subtractScalar:i,multiplyScalar:n,divideScalar:o,deepEqual:a,sqrt:s,abs:l}=t;return e(TV,{"Array, Array, Array":function(w,x,E){if(w.length===2&&x.length===2&&E.length===2){if(!c(w))throw new TypeError("Array with 2 numbers or BigNumbers expected for first argument");if(!c(x))throw new TypeError("Array with 2 numbers or BigNumbers expected for second argument");if(!c(E))throw new TypeError("Array with 2 numbers or BigNumbers expected for third argument");if(a(x,E))throw new TypeError("LinePoint1 should not be same with LinePoint2");var T=i(E[1],x[1]),D=i(x[0],E[0]),M=i(n(E[0],x[1]),n(x[0],E[1]));return v(w[0],w[1],T,D,M)}else throw new TypeError("Invalid Arguments: Try again")},"Object, Object, Object":function(w,x,E){if(Object.keys(w).length===2&&Object.keys(x).length===2&&Object.keys(E).length===2){if(!c(w))throw new TypeError("Values of pointX and pointY should be numbers or BigNumbers");if(!c(x))throw new TypeError("Values of lineOnePtX and lineOnePtY should be numbers or BigNumbers");if(!c(E))throw new TypeError("Values of lineTwoPtX and lineTwoPtY should be numbers or BigNumbers");if(a(d(x),d(E)))throw new TypeError("LinePoint1 should not be same with LinePoint2");if("pointX"in w&&"pointY"in w&&"lineOnePtX"in x&&"lineOnePtY"in x&&"lineTwoPtX"in E&&"lineTwoPtY"in E){var T=i(E.lineTwoPtY,x.lineOnePtY),D=i(x.lineOnePtX,E.lineTwoPtX),M=i(n(E.lineTwoPtX,x.lineOnePtY),n(x.lineOnePtX,E.lineTwoPtY));return v(w.pointX,w.pointY,T,D,M)}else throw new TypeError("Key names do not match")}else throw new TypeError("Invalid Arguments: Try again")},"Array, Array":function(w,x){if(w.length===2&&x.length===3){if(!c(w))throw new TypeError("Array with 2 numbers or BigNumbers expected for first argument");if(!f(x))throw new TypeError("Array with 3 numbers or BigNumbers expected for second argument");return v(w[0],w[1],x[0],x[1],x[2])}else if(w.length===3&&x.length===6){if(!f(w))throw new TypeError("Array with 3 numbers or BigNumbers expected for first argument");if(!p(x))throw new TypeError("Array with 6 numbers or BigNumbers expected for second argument");return y(w[0],w[1],w[2],x[0],x[1],x[2],x[3],x[4],x[5])}else if(w.length===x.length&&w.length>0){if(!m(w))throw new TypeError("All values of an array should be numbers or BigNumbers");if(!m(x))throw new TypeError("All values of an array should be numbers or BigNumbers");return S(w,x)}else throw new TypeError("Invalid Arguments: Try again")},"Object, Object":function(w,x){if(Object.keys(w).length===2&&Object.keys(x).length===3){if(!c(w))throw new TypeError("Values of pointX and pointY should be numbers or BigNumbers");if(!f(x))throw new TypeError("Values of xCoeffLine, yCoeffLine and constant should be numbers or BigNumbers");if("pointX"in w&&"pointY"in w&&"xCoeffLine"in x&&"yCoeffLine"in x&&"constant"in x)return v(w.pointX,w.pointY,x.xCoeffLine,x.yCoeffLine,x.constant);throw new TypeError("Key names do not match")}else if(Object.keys(w).length===3&&Object.keys(x).length===6){if(!f(w))throw new TypeError("Values of pointX, pointY and pointZ should be numbers or BigNumbers");if(!p(x))throw new TypeError("Values of x0, y0, z0, a, b and c should be numbers or BigNumbers");if("pointX"in w&&"pointY"in w&&"x0"in x&&"y0"in x&&"z0"in x&&"a"in x&&"b"in x&&"c"in x)return y(w.pointX,w.pointY,w.pointZ,x.x0,x.y0,x.z0,x.a,x.b,x.c);throw new TypeError("Key names do not match")}else if(Object.keys(w).length===2&&Object.keys(x).length===2){if(!c(w))throw new TypeError("Values of pointOneX and pointOneY should be numbers or BigNumbers");if(!c(x))throw new TypeError("Values of pointTwoX and pointTwoY should be numbers or BigNumbers");if("pointOneX"in w&&"pointOneY"in w&&"pointTwoX"in x&&"pointTwoY"in x)return S([w.pointOneX,w.pointOneY],[x.pointTwoX,x.pointTwoY]);throw new TypeError("Key names do not match")}else if(Object.keys(w).length===3&&Object.keys(x).length===3){if(!f(w))throw new TypeError("Values of pointOneX, pointOneY and pointOneZ should be numbers or BigNumbers");if(!f(x))throw new TypeError("Values of pointTwoX, pointTwoY and pointTwoZ should be numbers or BigNumbers");if("pointOneX"in w&&"pointOneY"in w&&"pointOneZ"in w&&"pointTwoX"in x&&"pointTwoY"in x&&"pointTwoZ"in x)return S([w.pointOneX,w.pointOneY,w.pointOneZ],[x.pointTwoX,x.pointTwoY,x.pointTwoZ]);throw new TypeError("Key names do not match")}else throw new TypeError("Invalid Arguments: Try again")},Array:function(w){if(!h(w))throw new TypeError("Incorrect array format entered for pairwise distance calculation");return b(w)}});function u(_){return typeof _=="number"||mt(_)}function c(_){return _.constructor!==Array&&(_=d(_)),u(_[0])&&u(_[1])}function f(_){return _.constructor!==Array&&(_=d(_)),u(_[0])&&u(_[1])&&u(_[2])}function m(_){return Array.isArray(_)||(_=d(_)),_.every(u)}function p(_){return _.constructor!==Array&&(_=d(_)),u(_[0])&&u(_[1])&&u(_[2])&&u(_[3])&&u(_[4])&&u(_[5])}function d(_){for(var w=Object.keys(_),x=[],E=0;E<w.length;E++)x.push(_[w[E]]);return x}function h(_){if(_[0].length===2&&u(_[0][0])&&u(_[0][1])){if(_.some(w=>w.length!==2||!u(w[0])||!u(w[1])))return!1}else if(_[0].length===3&&u(_[0][0])&&u(_[0][1])&&u(_[0][2])){if(_.some(w=>w.length!==3||!u(w[0])||!u(w[1])||!u(w[2])))return!1}else return!1;return!0}function v(_,w,x,E,T){var D=l(r(r(n(x,_),n(E,w)),T)),M=s(r(n(x,x),n(E,E)));return o(D,M)}function y(_,w,x,E,T,D,M,C,$){var O=[i(n(i(T,w),$),n(i(D,x),C)),i(n(i(D,x),M),n(i(E,_),$)),i(n(i(E,_),C),n(i(T,w),M))];O=s(r(r(n(O[0],O[0]),n(O[1],O[1])),n(O[2],O[2])));var R=s(r(r(n(M,M),n(C,C)),n($,$)));return o(O,R)}function S(_,w){for(var x=_.length,E=0,T=0,D=0;D<x;D++)T=i(_[D],w[D]),E=r(n(T,T),E);return s(E)}function b(_){for(var w=[],x=[],E=[],T=0;T<_.length-1;T++)for(var D=T+1;D<_.length;D++)_[0].length===2?(x=[_[T][0],_[T][1]],E=[_[D][0],_[D][1]]):_[0].length===3&&(x=[_[T][0],_[T][1],_[T][2]],E=[_[D][0],_[D][1],_[D][2]]),w.push(S(x,E));return w}});var dse="intersect",hse=["typed","config","abs","add","addScalar","matrix","multiply","multiplyScalar","divideScalar","subtract","smaller","equalScalar","flatten","isZero","isNumeric"],MV=N(dse,hse,t=>{var{typed:e,config:r,abs:i,add:n,addScalar:o,matrix:a,multiply:s,multiplyScalar:l,divideScalar:u,subtract:c,smaller:f,equalScalar:m,flatten:p,isZero:d,isNumeric:h}=t;return e("intersect",{"Array, Array, Array":v,"Array, Array, Array, Array":y,"Matrix, Matrix, Matrix":function(C,$,O){var R=v(C.valueOf(),$.valueOf(),O.valueOf());return R===null?null:a(R)},"Matrix, Matrix, Matrix, Matrix":function(C,$,O,R){var L=y(C.valueOf(),$.valueOf(),O.valueOf(),R.valueOf());return L===null?null:a(L)}});function v(M,C,$){if(M=S(M),C=S(C),$=S($),!_(M))throw new TypeError("Array with 3 numbers or BigNumbers expected for first argument");if(!_(C))throw new TypeError("Array with 3 numbers or BigNumbers expected for second argument");if(!w($))throw new TypeError("Array with 4 numbers expected as third argument");return D(M[0],M[1],M[2],C[0],C[1],C[2],$[0],$[1],$[2],$[3])}function y(M,C,$,O){if(M=S(M),C=S(C),$=S($),O=S(O),M.length===2){if(!b(M))throw new TypeError("Array with 2 numbers or BigNumbers expected for first argument");if(!b(C))throw new TypeError("Array with 2 numbers or BigNumbers expected for second argument");if(!b($))throw new TypeError("Array with 2 numbers or BigNumbers expected for third argument");if(!b(O))throw new TypeError("Array with 2 numbers or BigNumbers expected for fourth argument");return x(M,C,$,O)}else if(M.length===3){if(!_(M))throw new TypeError("Array with 3 numbers or BigNumbers expected for first argument");if(!_(C))throw new TypeError("Array with 3 numbers or BigNumbers expected for second argument");if(!_($))throw new TypeError("Array with 3 numbers or BigNumbers expected for third argument");if(!_(O))throw new TypeError("Array with 3 numbers or BigNumbers expected for fourth argument");return T(M[0],M[1],M[2],C[0],C[1],C[2],$[0],$[1],$[2],O[0],O[1],O[2])}else throw new TypeError("Arrays with two or thee dimensional points expected")}function S(M){return M.length===1?M[0]:M.length>1&&Array.isArray(M[0])&&M.every(C=>Array.isArray(C)&&C.length===1)?p(M):M}function b(M){return M.length===2&&h(M[0])&&h(M[1])}function _(M){return M.length===3&&h(M[0])&&h(M[1])&&h(M[2])}function w(M){return M.length===4&&h(M[0])&&h(M[1])&&h(M[2])&&h(M[3])}function x(M,C,$,O){var R=M,L=$,k=c(R,C),V=c(L,O),J=c(l(k[0],V[1]),l(V[0],k[1]));if(d(J)||f(i(J),r.relTol))return null;var W=l(V[0],R[1]),Q=l(V[1],R[0]),ie=l(V[0],L[1]),B=l(V[1],L[0]),Z=u(o(c(c(W,Q),ie),B),J);return n(s(k,Z),R)}function E(M,C,$,O,R,L,k,V,J,W,Q,ie){var B=l(c(M,C),c($,O)),Z=l(c(R,L),c(k,V)),q=l(c(J,W),c(Q,ie));return o(o(B,Z),q)}function T(M,C,$,O,R,L,k,V,J,W,Q,ie){var B=E(M,k,W,k,C,V,Q,V,$,J,ie,J),Z=E(W,k,O,M,Q,V,R,C,ie,J,L,$),q=E(M,k,O,M,C,V,R,C,$,J,L,$),xe=E(W,k,W,k,Q,V,Q,V,ie,J,ie,J),de=E(O,M,O,M,R,C,R,C,L,$,L,$),be=c(l(B,Z),l(q,xe)),G=c(l(de,xe),l(Z,Z));if(d(G))return null;var K=u(be,G),re=u(o(B,l(K,Z)),xe),ae=o(M,l(K,c(O,M))),le=o(C,l(K,c(R,C))),Se=o($,l(K,c(L,$))),_e=o(k,l(re,c(W,k))),Oe=o(V,l(re,c(Q,V))),st=o(J,l(re,c(ie,J)));return m(ae,_e)&&m(le,Oe)&&m(Se,st)?[ae,le,Se]:null}function D(M,C,$,O,R,L,k,V,J,W){var Q=l(M,k),ie=l(O,k),B=l(C,V),Z=l(R,V),q=l($,J),xe=l(L,J),de=c(c(c(W,Q),B),q),be=c(c(c(o(o(ie,Z),xe),Q),B),q),G=u(de,be),K=o(M,l(G,c(O,M))),re=o(C,l(G,c(R,C))),ae=o($,l(G,c(L,$)));return[K,re,ae]}});var CV="sum",gse=["typed","config","add","numeric"],mb=N(CV,gse,t=>{var{typed:e,config:r,add:i,numeric:n}=t;return e(CV,{"Array | Matrix":o,"Array | Matrix, number | BigNumber":a,"...":function(l){if(aa(l))throw new TypeError("Scalar values expected in function sum");return o(l)}});function o(s){var l;return Zi(s,function(u){try{l=l===void 0?u:i(l,u)}catch(c){throw gn(c,"sum",u)}}),l===void 0&&(l=n(0,r.number)),typeof l=="string"&&(l=n(l,Mi(l,r))),l}function a(s,l){try{var u=Cu(s,l,i);return u}catch(c){throw gn(c,"sum")}}});var db="cumsum",vse=["typed","add","unaryPlus"],hb=N(db,vse,t=>{var{typed:e,add:r,unaryPlus:i}=t;return e(db,{Array:n,Matrix:function(u){return u.create(n(u.valueOf(),u.datatype()))},"Array, number | BigNumber":a,"Matrix, number | BigNumber":function(u,c){return u.create(a(u.valueOf(),c),u.datatype())},"...":function(u){if(aa(u))throw new TypeError("All values expected to be scalar in function cumsum");return n(u)}});function n(l){try{return o(l)}catch(u){throw gn(u,db)}}function o(l){if(l.length===0)return[];for(var u=[i(l[0])],c=1;c<l.length;++c)u.push(r(u[c-1],l[c]));return u}function a(l,u){var c=vt(l);if(u<0||u>=c.length)throw new ii(u,c.length);try{return s(l,u)}catch(f){throw gn(f,db)}}function s(l,u){var c,f,m;if(u<=0){var p=l[0][0];if(Array.isArray(p)){for(m=oy(l),f=[],c=0;c<m.length;c++)f[c]=s(m[c],u-1);return f}else return o(l)}else{for(f=[],c=0;c<l.length;c++)f[c]=s(l[c],u-1);return f}}});var $V="mean",yse=["typed","add","divide"],gb=N($V,yse,t=>{var{typed:e,add:r,divide:i}=t;return e($V,{"Array | Matrix":o,"Array | Matrix, number | BigNumber":n,"...":function(s){if(aa(s))throw new TypeError("Scalar values expected in function mean");return o(s)}});function n(a,s){try{var l=Cu(a,s,r),u=Array.isArray(a)?vt(a):a.size();return i(l,u[s])}catch(c){throw gn(c,"mean")}}function o(a){var s,l=0;if(Zi(a,function(u){try{s=s===void 0?u:r(s,u),l++}catch(c){throw gn(c,"mean",u)}}),l===0)throw new Error("Cannot calculate the mean of an empty array");return i(s,l)}});var IV="median",bse=["typed","add","divide","compare","partitionSelect"],FV=N(IV,bse,t=>{var{typed:e,add:r,divide:i,compare:n,partitionSelect:o}=t;function a(u){try{u=Ut(u.valueOf());var c=u.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=o(u,f+1),p=u[f],d=0;d<f;++d)n(u[d],p)>0&&(p=u[d]);return l(p,m)}else{var h=o(u,(c-1)/2);return s(h)}}catch(v){throw gn(v,"median")}}var s=e({"number | BigNumber | Complex | Unit":function(c){return c}}),l=e({"number | BigNumber | Complex | Unit, number | BigNumber | Complex | Unit":function(c,f){return i(r(c,f),2)}});return e(IV,{"Array | Matrix":a,"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 a(c)}})});var kV="mad",xse=["typed","abs","map","median","subtract"],PV=N(kV,xse,t=>{var{typed:e,abs:r,map:i,median:n,subtract:o}=t;return e(kV,{"Array | Matrix":a,"...":function(l){return a(l)}});function a(s){if(s=Ut(s.valueOf()),s.length===0)throw new Error("Cannot calculate median absolute deviation (mad) of an empty array");try{var l=n(s);return n(i(s,function(u){return r(o(u,l))}))}catch(u){throw u instanceof TypeError&&u.message.includes("median")?new TypeError(u.message.replace("median","mad")):gn(u,"mad")}}});var XE="unbiased",BV="variance",_se=["typed","add","subtract","multiply","divide","mapSlices","isNaN"],vb=N(BV,_se,t=>{var{typed:e,add:r,subtract:i,multiply:n,divide:o,mapSlices:a,isNaN:s}=t;return e(BV,{"Array | Matrix":function(f){return l(f,XE)},"Array | Matrix, string":l,"Array | Matrix, number | BigNumber":function(f,m){return u(f,m,XE)},"Array | Matrix, number | BigNumber, string":u,"...":function(f){return l(f,XE)}});function l(c,f){var m,p=0;if(c.length===0)throw new SyntaxError("Function variance requires one or more parameters (0 provided)");if(Zi(c,function(v){try{m=m===void 0?v:r(m,v),p++}catch(y){throw gn(y,"variance",v)}}),p===0)throw new Error("Cannot calculate variance of an empty array");var d=o(m,p);if(m=void 0,Zi(c,function(v){var y=i(v,d);m=m===void 0?n(y,y):r(m,n(y,y))}),s(m))return m;switch(f){case"uncorrected":return o(m,p);case"biased":return o(m,p+1);case"unbiased":{var h=mt(m)?m.mul(0):0;return p===1?h:o(m,p-1)}default:throw new Error('Unknown normalization "'+f+'". Choose "unbiased" (default), "uncorrected", or "biased".')}}function u(c,f,m){try{if(c.length===0)throw new SyntaxError("Function variance requires one or more parameters (0 provided)");return a(c,f,p=>l(p,m))}catch(p){throw gn(p,"variance")}}});var OV="quantileSeq",wse=["typed","?bignumber","add","subtract","divide","multiply","partitionSelect","compare","isInteger","smaller","smallerEq","larger","mapSlices"],yb=N(OV,wse,t=>{var{typed:e,bignumber:r,add:i,subtract:n,divide:o,multiply:a,partitionSelect:s,compare:l,isInteger:u,smaller:c,smallerEq:f,larger:m,mapSlices:p}=t;return e(OV,{"Array | Matrix, number | BigNumber":(S,b)=>h(S,b,!1),"Array | Matrix, number | BigNumber, number":(S,b,_)=>d(S,b,!1,_,h),"Array | Matrix, number | BigNumber, boolean":h,"Array | Matrix, number | BigNumber, boolean, number":(S,b,_,w)=>d(S,b,_,w,h),"Array | Matrix, Array | Matrix":(S,b)=>v(S,b,!1),"Array | Matrix, Array | Matrix, number":(S,b,_)=>d(S,b,!1,_,v),"Array | Matrix, Array | Matrix, boolean":v,"Array | Matrix, Array | Matrix, boolean, number":(S,b,_,w)=>d(S,b,_,w,v)});function d(S,b,_,w,x){return p(S,w,E=>x(E,b,_))}function h(S,b,_){var w,x=S.valueOf();if(c(b,0))throw new Error("N/prob must be non-negative");if(f(b,1))return Et(b)?y(x,b,_):r(y(x,b,_));if(m(b,1)){if(!u(b))throw new Error("N must be a positive integer");if(m(b,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 E=i(b,1);w=[];for(var T=0;c(T,b);T++){var D=o(T+1,E);w.push(y(x,D,_))}return Et(b)?w:r(w)}}function v(S,b,_){for(var w=S.valueOf(),x=b.valueOf(),E=[],T=0;T<x.length;++T)E.push(y(w,x[T],_));return E}function y(S,b,_){var w=Ut(S),x=w.length;if(x===0)throw new Error("Cannot calculate quantile of an empty sequence");var E=Et(b)?b*(x-1):b.times(x-1),T=Et(b)?Math.floor(E):E.floor().toNumber(),D=Et(b)?E%1:E.minus(T);if(u(E))return _?w[E]:s(w,Et(b)?E:E.valueOf());var M,C;if(_)M=w[T],C=w[T+1];else{C=s(w,T+1),M=w[T];for(var $=0;$<T;++$)l(w[$],M)>0&&(M=w[$])}return i(a(M,n(1,D)),a(C,D))}});var RV="std",Sse=["typed","map","sqrt","variance"],bb=N(RV,Sse,t=>{var{typed:e,map:r,sqrt:i,variance:n}=t;return e(RV,{"Array | Matrix":o,"Array | Matrix, string":o,"Array | Matrix, number | BigNumber":o,"Array | Matrix, number | BigNumber, string":o,"...":function(s){return o(s)}});function o(a,s){if(a.length===0)throw new SyntaxError("Function std requires one or more parameters (0 provided)");try{var l=n.apply(null,arguments);return un(l)?r(l,i):i(l)}catch(u){throw u instanceof TypeError&&u.message.includes(" variance")?new TypeError(u.message.replace(" variance"," std")):u}}});var LV="corr",Dse=["typed","matrix","mean","sqrt","sum","add","subtract","multiply","pow","divide"],UV=N(LV,Dse,t=>{var{typed:e,matrix:r,sqrt:i,sum:n,add:o,subtract:a,multiply:s,pow:l,divide:u}=t;return e(LV,{"Array, Array":function(p,d){return c(p,d)},"Matrix, Matrix":function(p,d){var h=c(p.toArray(),d.toArray());return Array.isArray(h)?r(h):h}});function c(m,p){var d=[];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;h<m.length;h++){if(m[h].length!==p[h].length)throw new SyntaxError("Dimension mismatch. Array A and B must have the same number of elements.");d.push(f(m[h],p[h]))}return d}else{if(m.length!==p.length)throw new SyntaxError("Dimension mismatch. Array A and B must have the same number of elements.");return f(m,p)}}function f(m,p){var d=m.length,h=n(m),v=n(p),y=m.reduce((x,E,T)=>o(x,s(E,p[T])),0),S=n(m.map(x=>l(x,2))),b=n(p.map(x=>l(x,2))),_=a(s(d,y),s(h,v)),w=i(s(a(s(d,S),l(h,2)),a(s(d,b),l(v,2))));return u(_,w)}});var zV="combinations",Ese=["typed"],qV=N(zV,Ese,t=>{var{typed:e}=t;return e(zV,{"number, number":pE,"BigNumber, BigNumber":function(i,n){var o=i.constructor,a,s,l=i.minus(n),u=new o(1);if(!VV(i)||!VV(n))throw new TypeError("Positive integer value expected in function combinations");if(n.gt(i))throw new TypeError("k must be less than n in function combinations");if(a=u,n.lt(l))for(s=u;s.lte(l);s=s.plus(u))a=a.times(n.plus(s)).dividedBy(s);else for(s=u;s.lte(n);s=s.plus(u))a=a.times(l.plus(s)).dividedBy(s);return a}})});function VV(t){return t.isInteger()&&t.gte(0)}var jV="combinationsWithRep",Ase=["typed"],GV=N(jV,Ase,t=>{var{typed:e}=t;return e(jV,{"number, number":function(i,n){if(!Ge(i)||i<0)throw new TypeError("Positive integer value expected in function combinationsWithRep");if(!Ge(n)||n<0)throw new TypeError("Positive integer value expected in function combinationsWithRep");if(i<1)throw new TypeError("k must be less than or equal to n + k - 1");if(n<i-1){var o=Po(i,i+n-1);return o/Po(1,n)}var a=Po(n+1,i+n-1);return a/Po(1,i-1)},"BigNumber, BigNumber":function(i,n){var o=i.constructor,a,s,l=new o(1),u=i.minus(l);if(!ZV(i)||!ZV(n))throw new TypeError("Positive integer value expected in function combinationsWithRep");if(i.lt(l))throw new TypeError("k must be less than or equal to n + k - 1 in function combinationsWithRep");if(a=l,n.lt(u))for(s=l;s.lte(u);s=s.plus(l))a=a.times(n.plus(s)).dividedBy(s);else for(s=l;s.lte(n);s=s.plus(l))a=a.times(u.plus(s)).dividedBy(s);return a}})});function ZV(t){return t.isInteger()&&t.gte(0)}var WV="gamma",Tse=["typed","config","multiplyScalar","pow","BigNumber","Complex"],HV=N(WV,Tse,t=>{var{typed:e,config:r,multiplyScalar:i,pow:n,BigNumber:o,Complex:a}=t;function s(u){if(u.im===0)return im(u.re);if(u.re<.5){var c=new a(1-u.re,-u.im),f=new a(Math.PI*u.re,Math.PI*u.im);return new a(Math.PI).div(f.sin()).div(s(c))}u=new a(u.re-1,u.im);for(var m=new a(Sl[0],0),p=1;p<Sl.length;++p){var d=new a(Sl[p],0);m=m.add(d.div(u.add(p)))}var h=new a(u.re+hE+.5,u.im),v=Math.sqrt(2*Math.PI),y=h.pow(u.add(.5)),S=h.neg().exp();return m.mul(v).mul(y).mul(S)}return e(WV,{number:im,Complex:s,BigNumber:function(c){if(c.isInteger())return c.isNegative()||c.isZero()?new o(1/0):l(c.minus(1));if(!c.isFinite())return new o(c.isNegative()?NaN:1/0);throw new Error("Integer BigNumber expected")}});function l(u){if(u<8)return new o([1,1,2,6,24,120,720,5040][u]);var c=r.precision+(Math.log(u.toNumber())|0),f=o.clone({precision:c});if(u%2===1)return u.times(l(new o(u-1)));for(var m=u,p=new f(u),d=u.toNumber();m>2;)m-=2,d+=m,p=p.times(d);return new o(p.toPrecision(o.precision))}});var YV="lgamma",Nse=["Complex","typed"],JV=N(YV,Nse,t=>{var{Complex:e,typed:r}=t,i=7,n=7,o=[-.029550653594771242,.00641025641025641,-.0019175269175269176,.0008417508417508417,-.0005952380952380953,.0007936507936507937,-.002777777777777778,.08333333333333333];return r(YV,{number:om,Complex:a,BigNumber:function(){throw new Error("mathjs doesn't yet provide an implementation of the algorithm lgamma for BigNumber")}});function a(u){var c=6.283185307179586,f=1.1447298858494002,m=.1;if(u.isNaN())return new e(NaN,NaN);if(u.im===0)return new e(om(u.re),0);if(u.re>=i||Math.abs(u.im)>=n)return s(u);if(u.re<=m){var p=SF(c,u.im)*Math.floor(.5*u.re+.25),d=u.mul(Math.PI).sin().log(),h=a(new e(1-u.re,-u.im));return new e(f,p).sub(d).sub(h)}else return u.im>=0?l(u):l(u.conjugate()).conjugate()}function s(u){for(var c=u.sub(.5).mul(u.log()).sub(u).add(gE),f=new e(1,0).div(u),m=f.div(u),p=o[0],d=o[1],h=2*m.re,v=m.re*m.re+m.im*m.im,y=2;y<8;y++){var S=d;d=-v*p+o[y],p=h*p+S}var b=f.mul(m.mul(p).add(d));return c.add(b)}function l(u){var c=0,f=0,m=u;for(u=u.add(1);u.re<=i;){m=m.mul(u);var p=m.im<0?1:0;p!==0&&f===0&&c++,f=p,u=u.add(1)}return s(u).sub(m.log()).sub(new e(0,c*2*Math.PI*1))}});var XV="factorial",Mse=["typed","gamma"],KV=N(XV,Mse,t=>{var{typed:e,gamma:r}=t;return e(XV,{number:function(n){if(n<0)throw new Error("Value must be non-negative");return r(n+1)},BigNumber:function(n){if(n.isNegative())throw new Error("Value must be non-negative");return r(n.plus(1))},"Array | Matrix":e.referToSelf(i=>n=>it(n,i))})});var QV="kldivergence",Cse=["typed","matrix","divide","sum","multiply","map","dotDivide","log","isNumeric"],e5=N(QV,Cse,t=>{var{typed:e,matrix:r,divide:i,sum:n,multiply:o,map:a,dotDivide:s,log:l,isNumeric:u}=t;return e(QV,{"Array, Array":function(m,p){return c(r(m),r(p))},"Matrix, Array":function(m,p){return c(m,r(p))},"Array, Matrix":function(m,p){return c(r(m),p)},"Matrix, Matrix":function(m,p){return c(m,p)}});function c(f,m){var p=m.size().length,d=f.size().length;if(p>1)throw new Error("first object must be one dimensional");if(d>1)throw new Error("second object must be one dimensional");if(p!==d)throw new Error("Length of two vectors must be equal");var h=n(f);if(h===0)throw new Error("Sum of elements in first object must be non zero");var v=n(m);if(v===0)throw new Error("Sum of elements in second object must be non zero");var y=i(f,n(f)),S=i(m,n(m)),b=n(o(y,a(s(y,S),_=>l(_))));return u(b)?b:Number.NaN}});var t5="multinomial",$se=["typed","add","divide","multiply","factorial","isInteger","isPositive"],r5=N(t5,$se,t=>{var{typed:e,add:r,divide:i,multiply:n,factorial:o,isInteger:a,isPositive:s}=t;return e(t5,{"Array | Matrix":function(u){var c=0,f=1;return Zi(u,function(m){if(!a(m)||!s(m))throw new TypeError("Positive integer value expected in function multinomial");c=r(c,m),f=n(f,o(m))}),i(o(c),f)}})});var n5="permutations",Ise=["typed","factorial"],o5=N(n5,Ise,t=>{var{typed:e,factorial:r}=t;return e(n5,{"number | BigNumber":r,"number, number":function(n,o){if(!Ge(n)||n<0)throw new TypeError("Positive integer value expected in function permutations");if(!Ge(o)||o<0)throw new TypeError("Positive integer value expected in function permutations");if(o>n)throw new TypeError("second argument k must be less than or equal to first argument n");return Po(n-o+1,n)},"BigNumber, BigNumber":function(n,o){var a,s;if(!i5(n)||!i5(o))throw new TypeError("Positive integer value expected in function permutations");if(o.gt(n))throw new TypeError("second argument k must be less than or equal to first argument n");var l=n.mul(0).add(1);for(a=l,s=n.minus(o).plus(1);s.lte(n);s=s.plus(1))a=a.times(s);return a}})});function i5(t){return t.isInteger()&&t.gte(0)}var iA=Ar(_5(),1),Lse=(0,iA.default)(Date.now());function Ks(t){var e;function r(n){e=n===null?Lse:(0,iA.default)(String(n))}r(t);function i(){return e()}return i}var w5="pickRandom",Use=["typed","config","?on"],S5=N(w5,Use,t=>{var{typed:e,config:r,on:i}=t,n=Ks(r.randomSeed);return i&&i("config",function(a,s){a.randomSeed!==s.randomSeed&&(n=Ks(a.randomSeed))}),e(w5,{"Array | Matrix":function(s){return o(s,{})},"Array | Matrix, Object":function(s,l){return o(s,l)},"Array | Matrix, number":function(s,l){return o(s,{number:l})},"Array | Matrix, Array | Matrix":function(s,l){return o(s,{weights:l})},"Array | Matrix, Array | Matrix, number":function(s,l,u){return o(s,{number:u,weights:l})},"Array | Matrix, number, Array | Matrix":function(s,l,u){return o(s,{number:l,weights:u})}});function o(a,s){var{number:l,weights:u,elementWise:c=!0}=s,f=typeof l>"u";f&&(l=1);var m=Je(a)?a.create:Je(u)?u.create:null;a=a.valueOf(),u&&(u=u.valueOf()),c===!0&&(a=Ut(a),u=Ut(u));var p=0;if(typeof u<"u"){if(u.length!==a.length)throw new Error("Weights must have the same length as possibles");for(var d=0,h=u.length;d<h;d++){if(!Et(u[d])||u[d]<0)throw new Error("Weights must be an array of positive numbers");p+=u[d]}}for(var v=a.length,y=[],S;y.length<l;){if(typeof u>"u")S=a[Math.floor(n()*v)];else for(var b=n()*p,_=0,w=a.length;_<w;_++)if(b-=u[_],b<0){S=a[_];break}y.push(S)}return f?y[0]:m?m(y):y}});function cm(t,e){var r=[];if(t=t.slice(0),t.length>1)for(var i=0,n=t.shift();i<n;i++)r.push(cm(t,e));else for(var o=0,a=t.shift();o<a;o++)r.push(e());return r}var D5="random",zse=["typed","config","?on"],E5=N(D5,zse,t=>{var{typed:e,config:r,on:i}=t,n=Ks(r.randomSeed);return i&&i("config",function(s,l){s.randomSeed!==l.randomSeed&&(n=Ks(s.randomSeed))}),e(D5,{"":()=>a(0,1),number:s=>a(0,s),"number, number":(s,l)=>a(s,l),"Array | Matrix":s=>o(s,0,1),"Array | Matrix, number":(s,l)=>o(s,0,l),"Array | Matrix, number, number":(s,l,u)=>o(s,l,u)});function o(s,l,u){var c=cm(s.valueOf(),()=>a(l,u));return Je(s)?s.create(c,"number"):c}function a(s,l){return s+n()*(l-s)}});var A5="randomInt",Vse=["typed","config","log2","?on"],T5=N(A5,Vse,t=>{var{typed:e,config:r,log2:i,on:n}=t,o=Ks(r.randomSeed);return n&&n("config",function(u,c){u.randomSeed!==c.randomSeed&&(o=Ks(u.randomSeed))}),e(A5,{"":()=>s(0,2),number:u=>s(0,u),"number, number":(u,c)=>s(u,c),bigint:u=>l(0n,u),"bigint, bigint":l,"Array | Matrix":u=>a(u,0,1),"Array | Matrix, number":(u,c)=>a(u,0,c),"Array | Matrix, number, number":(u,c,f)=>a(u,c,f)});function a(u,c,f){var m=cm(u.valueOf(),()=>s(c,f));return Je(u)?u.create(m,"number"):m}function s(u,c){return Math.floor(u+o()*(c-u))}function l(u,c){var f=2n**30n,m=c-u;if(m<=f)return u+BigInt(s(0,Number(m)));for(var p=i(m),d=m;d>=m;){d=0n;for(var h=0;h<p;++h)d=2n*d+(o()<.5?0n:1n)}return u+d}});var N5="stirlingS2",qse=["typed","addScalar","subtractScalar","multiplyScalar","divideScalar","pow","factorial","combinations","isNegative","isInteger","number","?bignumber","larger"],M5=N(N5,qse,t=>{var{typed:e,addScalar:r,subtractScalar:i,multiplyScalar:n,divideScalar:o,pow:a,factorial:s,combinations:l,isNegative:u,isInteger:c,number:f,bignumber:m,larger:p}=t,d=[],h=[];return e(N5,{"number | BigNumber, number | BigNumber":function(y,S){if(!c(y)||u(y)||!c(S)||u(S))throw new TypeError("Non-negative integer value expected in function stirlingS2");if(p(S,y))throw new TypeError("k must be less than or equal to n in function stirlingS2");var b=!(Et(y)&&Et(S)),_=b?h:d,w=b?m:f,x=f(y),E=f(S);if(_[x]&&_[x].length>E)return _[x][E];for(var T=0;T<=x;++T)if(_[T]||(_[T]=[w(T===0?1:0)]),T!==0)for(var D=_[T],M=_[T-1],C=D.length;C<=T&&C<=E;++C)C===T?D[C]=1:D[C]=r(n(w(C),M[C]),M[C-1]);return _[x][E]}})});var C5="bellNumbers",jse=["typed","addScalar","isNegative","isInteger","stirlingS2"],$5=N(C5,jse,t=>{var{typed:e,addScalar:r,isNegative:i,isInteger:n,stirlingS2:o}=t;return e(C5,{"number | BigNumber":function(s){if(!n(s)||i(s))throw new TypeError("Non-negative integer value expected in function bellNumbers");for(var l=0,u=0;u<=s;u++)l=r(l,o(s,u));return l}})});var I5="catalan",Zse=["typed","addScalar","divideScalar","multiplyScalar","combinations","isNegative","isInteger"],F5=N(I5,Zse,t=>{var{typed:e,addScalar:r,divideScalar:i,multiplyScalar:n,combinations:o,isNegative:a,isInteger:s}=t;return e(I5,{"number | BigNumber":function(u){if(!s(u)||a(u))throw new TypeError("Non-negative integer value expected in function catalan");return i(o(n(u,2),u),r(u,1))}})});var k5="composition",Gse=["typed","addScalar","combinations","isNegative","isPositive","isInteger","larger"],P5=N(k5,Gse,t=>{var{typed:e,addScalar:r,combinations:i,isPositive:n,isNegative:o,isInteger:a,larger:s}=t;return e(k5,{"number | BigNumber, number | BigNumber":function(u,c){if(!a(u)||!n(u)||!a(c)||!n(c))throw new TypeError("Positive integer value expected in function composition");if(s(c,u))throw new TypeError("k must be less than or equal to n in function composition");return i(r(u,-1),r(c,-1))}})});var B5="leafCount",Wse=["parse","typed"],O5=N(B5,Wse,t=>{var{parse:e,typed:r}=t;function i(n){var o=0;return n.forEach(a=>{o+=i(a)}),o||1}return r(B5,{Node:function(o){return i(o)}})});function oA(t){return Lt(t)||Lr(t)&&t.isUnary()&&Lt(t.args[0])}function fm(t){return!!(Lt(t)||(gi(t)||Lr(t))&&t.args.every(fm)||ti(t)&&fm(t.content))}function R5(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter(function(n){return Object.getOwnPropertyDescriptor(t,n).enumerable})),r.push.apply(r,i)}return r}function aA(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?R5(Object(r),!0).forEach(function(i){dr(t,i,r[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):R5(Object(r)).forEach(function(i){Object.defineProperty(t,i,Object.getOwnPropertyDescriptor(r,i))})}return t}var Hse="simplifyUtil",Yse=["FunctionNode","OperatorNode","SymbolNode"],sf=N(Hse,Yse,t=>{var{FunctionNode:e,OperatorNode:r,SymbolNode:i}=t,n=!0,o=!1,a="defaultF",s={add:{trivial:n,total:n,commutative:n,associative:n},unaryPlus:{trivial:n,total:n,commutative:n,associative:n},subtract:{trivial:o,total:n,commutative:o,associative:o},multiply:{trivial:n,total:n,commutative:n,associative:n},divide:{trivial:o,total:n,commutative:o,associative:o},paren:{trivial:n,total:n,commutative:n,associative:o},defaultF:{trivial:o,total:n,commutative:o,associative:o}},l={divide:{total:o},log:{total:o}},u={subtract:{total:o},abs:{trivial:n},log:{total:n}};function c(b,_){var w=arguments.length>2&&arguments[2]!==void 0?arguments[2]:s,x=a;if(typeof b=="string"?x=b:Lr(b)?x=b.fn.toString():gi(b)?x=b.name:ti(b)&&(x="paren"),rt(w,x)){var E=w[x];if(rt(E,_))return E[_];if(rt(s,x))return s[x][_]}if(rt(w,a)){var T=w[a];return rt(T,_)?T[_]:s[a][_]}if(rt(s,x)){var D=s[x];if(rt(D,_))return D[_]}return s[a][_]}function f(b){var _=arguments.length>1&&arguments[1]!==void 0?arguments[1]:s;return c(b,"commutative",_)}function m(b){var _=arguments.length>1&&arguments[1]!==void 0?arguments[1]:s;return c(b,"associative",_)}function p(b,_){var w=aA({},b);for(var x in _)rt(b,x)?w[x]=aA(aA({},_[x]),b[x]):w[x]=_[x];return w}function d(b,_){if(!b.args||b.args.length===0)return b;b.args=h(b,_);for(var w=0;w<b.args.length;w++)d(b.args[w],_)}function h(b,_){var w,x=[],E=function(D){for(var M=0;M<D.args.length;M++){var C=D.args[M];Lr(C)&&w===C.op?E(C):x.push(C)}};return m(b,_)?(w=b.op,E(b),x):b.args}function v(b,_){if(!(!b.args||b.args.length===0)){for(var w=S(b),x=b.args.length,E=0;E<x;E++)v(b.args[E],_);if(x>2&&m(b,_)){for(var T=b.args.pop();b.args.length>0;)T=w([b.args.pop(),T]);b.args=T.args}}}function y(b,_){if(!(!b.args||b.args.length===0)){for(var w=S(b),x=b.args.length,E=0;E<x;E++)y(b.args[E],_);if(x>2&&m(b,_)){for(var T=b.args.shift();b.args.length>0;)T=w([T,b.args.shift()]);b.args=T.args}}}function S(b){return Lr(b)?function(_){try{return new r(b.op,b.fn,_,b.implicit)}catch(w){return console.error(w),[]}}:function(_){return new e(new i(b.name),_)}}return{createMakeNodeFunction:S,hasProperty:c,isCommutative:f,isAssociative:m,mergeContext:p,flatten:d,allChildren:h,unflattenr:v,unflattenl:y,defaultContext:s,realContext:l,positiveContext:u}});var Jse="simplify",Xse=["typed","parse","equal","resolve","simplifyConstant","simplifyCore","AccessorNode","ArrayNode","ConstantNode","FunctionNode","IndexNode","ObjectNode","OperatorNode","ParenthesisNode","SymbolNode","replacer"],L5=N(Jse,Xse,t=>{var{typed:e,parse:r,equal:i,resolve:n,simplifyConstant:o,simplifyCore:a,AccessorNode:s,ArrayNode:l,ConstantNode:u,FunctionNode:c,IndexNode:f,ObjectNode:m,OperatorNode:p,ParenthesisNode:d,SymbolNode:h,replacer:v}=t,{hasProperty:y,isCommutative:S,isAssociative:b,mergeContext:_,flatten:w,unflattenr:x,unflattenl:E,createMakeNodeFunction:T,defaultContext:D,realContext:M,positiveContext:C}=sf({FunctionNode:c,OperatorNode:p,SymbolNode:h});e.addConversion({from:"Object",to:"Map",convert:js});var $=e("simplify",{Node:W,"Node, Map":(G,K)=>W(G,!1,K),"Node, Map, Object":(G,K,re)=>W(G,!1,K,re),"Node, Array":W,"Node, Array, Map":W,"Node, Array, Map, Object":W});e.removeConversion({from:"Object",to:"Map",convert:js}),$.defaultContext=D,$.realContext=M,$.positiveContext=C;function O(G){return G.transform(function(K){return ti(K)?O(K.content):K})}var R={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=[a,{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}}},o,{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}}},o,{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 L(G,K){var re={};if(G.s){var ae=G.s.split("->");if(ae.length===2)re.l=ae[0],re.r=ae[1];else throw SyntaxError("Could not parse rule: "+G.s)}else re.l=G.l,re.r=G.r;re.l=O(r(re.l)),re.r=O(r(re.r));for(var le of["imposeContext","repeat","assuming"])le in G&&(re[le]=G[le]);if(G.evaluate&&(re.evaluate=r(G.evaluate)),b(re.l,K)){var Se=!S(re.l,K),_e;Se&&(_e=J());var Oe=T(re.l),st=J();re.expanded={},re.expanded.l=Oe([re.l,st]),w(re.expanded.l,K),x(re.expanded.l,K),re.expanded.r=Oe([re.r,st]),Se&&(re.expandedNC1={},re.expandedNC1.l=Oe([_e,re.l]),re.expandedNC1.r=Oe([_e,re.r]),re.expandedNC2={},re.expandedNC2.l=Oe([_e,re.expanded.l]),re.expandedNC2.r=Oe([_e,re.expanded.r]))}return re}function k(G,K){for(var re=[],ae=0;ae<G.length;ae++){var le=G[ae],Se=void 0,_e=typeof le;switch(_e){case"string":le={s:le};case"object":Se=L(le,K);break;case"function":Se=le;break;default:throw TypeError("Unsupported type of rule: "+_e)}re.push(Se)}return re}var V=0;function J(){return new h("_p"+V++)}function W(G,K){var re=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Su(),ae=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},le=ae.consoleDebug;K=k(K||$.rules,ae.context);var Se=n(G,re);Se=O(Se);for(var _e={},Oe=Se.toString({parenthesis:"all"});!_e[Oe];){_e[Oe]=!0,V=0;var st=Oe;le&&console.log("Working on: ",Oe);for(var yt=0;yt<K.length;yt++){var Qe="";if(typeof K[yt]=="function"?(Se=K[yt](Se,ae),le&&(Qe=K[yt].name)):(w(Se,ae.context),Se=ie(Se,K[yt],ae.context),le&&(Qe="".concat(K[yt].l.toString()," -> ").concat(K[yt].r.toString()))),le){var ut=Se.toString({parenthesis:"all"});ut!==st&&(console.log("Applying",Qe,"produced",ut),st=ut)}E(Se,ae.context)}Oe=Se.toString({parenthesis:"all"})}return Se}function Q(G,K,re){var ae=G;if(G)for(var le=0;le<G.length;++le){var Se=ie(G[le],K,re);Se!==G[le]&&(ae===G&&(ae=G.slice()),ae[le]=Se)}return ae}function ie(G,K,re){if(K.assuming){for(var ae in K.assuming)for(var le in K.assuming[ae])if(y(ae,le,re)!==K.assuming[ae][le])return G}var Se=_(K.imposeContext,re),_e=G;if(_e instanceof p||_e instanceof c){var Oe=Q(_e.args,K,re);Oe!==_e.args&&(_e=_e.clone(),_e.args=Oe)}else if(_e instanceof d){if(_e.content){var st=ie(_e.content,K,re);st!==_e.content&&(_e=new d(st))}}else if(_e instanceof l){var yt=Q(_e.items,K,re);yt!==_e.items&&(_e=new l(yt))}else if(_e instanceof s){var Qe=_e.object;_e.object&&(Qe=ie(_e.object,K,re));var ut=_e.index;_e.index&&(ut=ie(_e.index,K,re)),(Qe!==_e.object||ut!==_e.index)&&(_e=new s(Qe,ut))}else if(_e instanceof f){var H=Q(_e.dimensions,K,re);H!==_e.dimensions&&(_e=new f(H))}else if(_e instanceof m){var oe=!1,ve={};for(var De in _e.properties)ve[De]=ie(_e.properties[De],K,re),ve[De]!==_e.properties[De]&&(oe=!0);oe&&(_e=new m(ve))}var Ee=K.r,Ue=de(K.l,_e,Se)[0];if(!Ue&&K.expanded&&(Ee=K.expanded.r,Ue=de(K.expanded.l,_e,Se)[0]),!Ue&&K.expandedNC1&&(Ee=K.expandedNC1.r,Ue=de(K.expandedNC1.l,_e,Se)[0],Ue||(Ee=K.expandedNC2.r,Ue=de(K.expandedNC2.l,_e,Se)[0])),Ue){var He=_e.implicit;_e=Ee.clone(),He&&"implicit"in Ee&&(_e.implicit=!0),_e=_e.transform(function(nt){return nt.isSymbolNode&&rt(Ue.placeholders,nt.name)?Ue.placeholders[nt.name].clone():nt})}return K.repeat&&_e!==G&&(_e=ie(_e,K,re)),_e}function B(G,K){var re=[],ae,le,Se=T(G);if(S(G,K))for(var _e=0;_e<G.args.length;_e++)le=G.args.slice(0),le.splice(_e,1),ae=le.length===1?le[0]:Se(le),re.push(Se([G.args[_e],ae]));else for(var Oe=1;Oe<G.args.length;Oe++){var st=G.args[0];Oe>1&&(st=Se(G.args.slice(0,Oe))),le=G.args.slice(Oe),ae=le.length===1?le[0]:Se(le),re.push(Se([st,ae]))}return re}function Z(G,K){var re={placeholders:{}};if(!G.placeholders&&!K.placeholders)return re;if(G.placeholders){if(!K.placeholders)return G}else return K;for(var ae in G.placeholders)if(rt(G.placeholders,ae)&&(re.placeholders[ae]=G.placeholders[ae],rt(K.placeholders,ae)&&!be(G.placeholders[ae],K.placeholders[ae])))return null;for(var le in K.placeholders)rt(K.placeholders,le)&&(re.placeholders[le]=K.placeholders[le]);return re}function q(G,K){var re=[];if(G.length===0||K.length===0)return re;for(var ae,le=0;le<G.length;le++)for(var Se=0;Se<K.length;Se++)ae=Z(G[le],K[Se]),ae&&re.push(ae);return re}function xe(G){if(G.length===0)return G;for(var K=G.reduce(q),re=[],ae={},le=0;le<K.length;le++){var Se=JSON.stringify(K[le],v);ae[Se]||(ae[Se]=!0,re.push(K[le]))}return re}function de(G,K,re,ae){var le=[{placeholders:{}}];if(G instanceof p&&K instanceof p||G instanceof c&&K instanceof c){if(G instanceof p){if(G.op!==K.op||G.fn!==K.fn)return[]}else if(G instanceof c&&G.name!==K.name)return[];if(K.args.length===1&&G.args.length===1||!b(K,re)&&K.args.length===G.args.length||ae){for(var Se=[],_e=0;_e<G.args.length;_e++){var Oe=de(G.args[_e],K.args[_e],re);if(Oe.length===0)break;Se.push(Oe)}if(Se.length!==G.args.length){if(!S(K,re)||G.args.length===1)return[];if(G.args.length>2)throw new Error("permuting >2 commutative non-associative rule arguments not yet implemented");var st=de(G.args[0],K.args[1],re);if(st.length===0)return[];var yt=de(G.args[1],K.args[0],re);if(yt.length===0)return[];Se=[st,yt]}le=xe(Se)}else if(K.args.length>=2&&G.args.length===2){for(var Qe=B(K,re),ut=[],H=0;H<Qe.length;H++){var oe=de(G,Qe[H],re,!0);ut=ut.concat(oe)}return ut}else{if(G.args.length>2)throw Error("Unexpected non-binary associative function: "+G.toString());return[]}}else if(G instanceof h){if(G.name.length===0)throw new Error("Symbol in rule has 0 length...!?");if(R[G.name]){if(G.name!==K.name)return[]}else switch(G.name[1]>="a"&&G.name[1]<="z"?G.name.substring(0,2):G.name[0]){case"n":case"_p":le[0].placeholders[G.name]=K;break;case"c":case"cl":if(Lt(K))le[0].placeholders[G.name]=K;else return[];break;case"v":if(!Lt(K))le[0].placeholders[G.name]=K;else return[];break;case"vl":if(Nr(K))le[0].placeholders[G.name]=K;else return[];break;case"cd":if(oA(K))le[0].placeholders[G.name]=K;else return[];break;case"vd":if(!oA(K))le[0].placeholders[G.name]=K;else return[];break;case"ce":if(fm(K))le[0].placeholders[G.name]=K;else return[];break;case"ve":if(!fm(K))le[0].placeholders[G.name]=K;else return[];break;default:throw new Error("Invalid symbol in rule: "+G.name)}}else if(G instanceof u){if(!i(G.value,K.value))return[]}else return[];return le}function be(G,K){if(G instanceof u&&K instanceof u){if(!i(G.value,K.value))return!1}else if(G instanceof h&&K instanceof h){if(G.name!==K.name)return!1}else if(G instanceof p&&K instanceof p||G instanceof c&&K instanceof c){if(G instanceof p){if(G.op!==K.op||G.fn!==K.fn)return!1}else if(G instanceof c&&G.name!==K.name)return!1;if(G.args.length!==K.args.length)return!1;for(var re=0;re<G.args.length;re++)if(!be(G.args[re],K.args[re]))return!1}else return!1;return!0}return $});var Kse="simplifyConstant",Qse=["typed","config","mathWithTransform","matrix","?fraction","?bignumber","AccessorNode","ArrayNode","ConstantNode","FunctionNode","IndexNode","ObjectNode","OperatorNode","SymbolNode"],U5=N(Kse,Qse,t=>{var{typed:e,config:r,mathWithTransform:i,matrix:n,fraction:o,bignumber:a,AccessorNode:s,ArrayNode:l,ConstantNode:u,FunctionNode:c,IndexNode:f,ObjectNode:m,OperatorNode:p,SymbolNode:d}=t,{isCommutative:h,isAssociative:v,allChildren:y,createMakeNodeFunction:S}=sf({FunctionNode:c,OperatorNode:p,SymbolNode:d}),b=e("simplifyConstant",{Node:L=>E(R(L,{})),"Node, Object":function(k,V){return E(R(k,V))}});function _(L){return Io(L)?L.valueOf():L instanceof Array?L.map(_):Je(L)?n(_(L.valueOf())):L}function w(L,k,V){try{return i[L].apply(null,k)}catch{return k=k.map(_),D(i[L].apply(null,k),V)}}var x=e({Fraction:C,number:function(k){return k<0?M(new u(-k)):new u(k)},BigNumber:function(k){return k<0?M(new u(-k)):new u(k)},bigint:function(k){return k<0n?M(new u(-k)):new u(k)},Complex:function(k){throw new Error("Cannot convert Complex number to Node")},string:function(k){return new u(k)},Matrix:function(k){return new l(k.valueOf().map(V=>x(V)))}});function E(L){return Yt(L)?L:x(L)}function T(L,k){var V=k&&k.exactFractions!==!1;if(V&&isFinite(L)&&o){var J=o(L),W=k&&typeof k.fractionsLimit=="number"?k.fractionsLimit:1/0;if(J.valueOf()===L&&J.n<W&&J.d<W)return J}return L}var D=e({"string, Object":function(k,V){var J=Mi(k,r);if(J==="BigNumber")return a===void 0&&ef(),a(k);if(J==="bigint")return BigInt(k);if(J==="Fraction")return o===void 0&&Ty(),o(k);var W=parseFloat(k);return T(W,V)},"Fraction, Object":function(k,V){return k},"BigNumber, Object":function(k,V){return k},"number, Object":function(k,V){return T(k,V)},"bigint, Object":function(k,V){return k},"Complex, Object":function(k,V){return k.im!==0?k:T(k.re,V)},"Matrix, Object":function(k,V){return n(T(k.valueOf()))},"Array, Object":function(k,V){return k.map(T)}});function M(L){return new p("-","unaryMinus",[L])}function C(L){var k=W=>r.number==="BigNumber"&&a?a(W):Number(W),V=L.s*L.n,J=V<0n?new p("-","unaryMinus",[new u(-k(V))]):new u(k(V));return L.d===1n?J:new p("/","divide",[J,new u(k(L.d))])}function $(L,k,V){if(!uo(k))return new s(E(L),E(k));if(ei(L)||Je(L)){for(var J=Array.from(k.dimensions);J.length>0;)if(Lt(J[0])&&typeof J[0].value!="string"){var W=D(J.shift().value,V);ei(L)?L=L.items[W-1]:(L=L.valueOf()[W-1],L instanceof Array&&(L=n(L)))}else if(J.length>1&&Lt(J[1])&&typeof J[1].value!="string"){var Q=D(J[1].value,V),ie=[],B=ei(L)?L.items:L.valueOf();for(var Z of B)if(ei(Z))ie.push(Z.items[Q-1]);else if(Je(L))ie.push(Z[Q-1]);else break;if(ie.length===B.length)ei(L)?L=new l(ie):L=n(ie),J.splice(1,1);else break}else break;return J.length===k.dimensions.length?new s(E(L),k):J.length>0?(k=new f(J),new s(E(L),k)):L}if(Ka(L)&&k.dimensions.length===1&&Lt(k.dimensions[0])){var q=k.dimensions[0].value;return q in L.properties?L.properties[q]:new u}return new s(E(L),k)}function O(L,k,V,J){var W=k.shift(),Q=k.reduce((ie,B)=>{if(!Yt(B)){var Z=ie.pop();if(Yt(Z))return[Z,B];try{return ie.push(w(L,[Z,B],J)),ie}catch{ie.push(Z)}}ie.push(E(ie.pop()));var q=ie.length===1?ie[0]:V(ie);return[V([q,E(B)])]},[W]);return Q.length===1?Q[0]:V([Q[0],x(Q[1])])}function R(L,k){switch(L.type){case"SymbolNode":return L;case"ConstantNode":switch(typeof L.value){case"number":return D(L.value,k);case"bigint":return D(L.value,k);case"string":return L.value;default:if(!isNaN(L.value))return D(L.value,k)}return L;case"FunctionNode":if(i[L.name]&&i[L.name].rawArgs)return L;{var V=["add","multiply"];if(!V.includes(L.name)){var J=L.args.map(ae=>R(ae,k));if(!J.some(Yt))try{return w(L.name,J,k)}catch{}if(L.name==="size"&&J.length===1&&ei(J[0])){for(var W=[],Q=J[0];ei(Q);)W.push(Q.items.length),Q=Q.items[0];return n(W)}return new c(L.name,J.map(E))}}case"OperatorNode":{var ie=L.fn.toString(),B,Z,q=S(L);if(Lr(L)&&L.isUnary())B=[R(L.args[0],k)],Yt(B[0])?Z=q(B):Z=w(ie,B,k);else if(v(L,k.context))if(B=y(L,k.context),B=B.map(ae=>R(ae,k)),h(ie,k.context)){for(var xe=[],de=[],be=0;be<B.length;be++)Yt(B[be])?de.push(B[be]):xe.push(B[be]);xe.length>1?(Z=O(ie,xe,q,k),de.unshift(Z),Z=O(ie,de,q,k)):Z=O(ie,B,q,k)}else Z=O(ie,B,q,k);else B=L.args.map(ae=>R(ae,k)),Z=O(ie,B,q,k);return Z}case"ParenthesisNode":return R(L.content,k);case"AccessorNode":return $(R(L.object,k),R(L.index,k),k);case"ArrayNode":{var G=L.items.map(ae=>R(ae,k));return G.some(Yt)?new l(G.map(E)):n(G)}case"IndexNode":return new f(L.dimensions.map(ae=>b(ae,k)));case"ObjectNode":{var K={};for(var re in L.properties)K[re]=b(L.properties[re],k);return new m(K)}case"AssignmentNode":case"BlockNode":case"FunctionAssignmentNode":case"RangeNode":case"ConditionalNode":default:throw new Error("Unimplemented node type in simplifyConstant: ".concat(L.type))}}return b});var z5="simplifyCore",eue=["typed","parse","equal","isZero","add","subtract","multiply","divide","pow","AccessorNode","ArrayNode","ConstantNode","FunctionNode","IndexNode","ObjectNode","OperatorNode","ParenthesisNode","SymbolNode"],V5=N(z5,eue,t=>{var{typed:e,parse:r,equal:i,isZero:n,add:o,subtract:a,multiply:s,divide:l,pow:u,AccessorNode:c,ArrayNode:f,ConstantNode:m,FunctionNode:p,IndexNode:d,ObjectNode:h,OperatorNode:v,ParenthesisNode:y,SymbolNode:S}=t,b=new m(0),_=new m(1),w=new m(!0),x=new m(!1);function E(C){return Lr(C)&&["and","not","or"].includes(C.op)}var{hasProperty:T,isCommutative:D}=sf({FunctionNode:p,OperatorNode:v,SymbolNode:S});function M(C){var $=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},O=$?$.context:void 0;if(T(C,"trivial",O)){if(gi(C)&&C.args.length===1)return M(C.args[0],$);var R=!1,L=0;if(C.forEach(de=>{++L,L===1&&(R=M(de,$))}),L===1)return R}var k=C;if(gi(k)){var V=TL(k.name);if(V){if(k.args.length>2&&T(k,"associative",O))for(;k.args.length>2;){var J=k.args.pop(),W=k.args.pop();k.args.push(new v(V,k.name,[J,W]))}k=new v(V,k.name,k.args)}else return new p(M(k.fn),k.args.map(de=>M(de,$)))}if(Lr(k)&&k.isUnary()){var Q=M(k.args[0],$);if(k.op==="~"&&Lr(Q)&&Q.isUnary()&&Q.op==="~"||k.op==="not"&&Lr(Q)&&Q.isUnary()&&Q.op==="not"&&E(Q.args[0]))return Q.args[0];var ie=!0;if(k.op==="-"&&Lr(Q)&&(Q.isBinary()&&Q.fn==="subtract"&&(k=new v("-","subtract",[Q.args[1],Q.args[0]]),ie=!1),Q.isUnary()&&Q.op==="-"))return Q.args[0];if(ie)return new v(k.op,k.fn,[Q])}if(Lr(k)&&k.isBinary()){var B=M(k.args[0],$),Z=M(k.args[1],$);if(k.op==="+"){if(Lt(B)&&n(B.value))return Z;if(Lt(Z)&&n(Z.value))return B;Lr(Z)&&Z.isUnary()&&Z.op==="-"&&(Z=Z.args[0],k=new v("-","subtract",[B,Z]))}if(k.op==="-")return Lr(Z)&&Z.isUnary()&&Z.op==="-"?M(new v("+","add",[B,Z.args[0]]),$):Lt(B)&&n(B.value)?M(new v("-","unaryMinus",[Z])):Lt(Z)&&n(Z.value)?B:new v(k.op,k.fn,[B,Z]);if(k.op==="*"){if(Lt(B)){if(n(B.value))return b;if(i(B.value,1))return Z}if(Lt(Z)){if(n(Z.value))return b;if(i(Z.value,1))return B;if(D(k,O))return new v(k.op,k.fn,[Z,B],k.implicit)}return new v(k.op,k.fn,[B,Z],k.implicit)}if(k.op==="/")return Lt(B)&&n(B.value)?b:Lt(Z)&&i(Z.value,1)?B:new v(k.op,k.fn,[B,Z]);if(k.op==="^"&&Lt(Z)){if(n(Z.value))return _;if(i(Z.value,1))return B}if(k.op==="and"){if(Lt(B))if(B.value){if(E(Z))return Z;if(Lt(Z))return Z.value?w:x}else return x;if(Lt(Z))if(Z.value){if(E(B))return B}else return x}if(k.op==="or"){if(Lt(B)){if(B.value)return w;if(E(Z))return Z}if(Lt(Z)){if(Z.value)return w;if(E(B))return B}}return new v(k.op,k.fn,[B,Z])}if(Lr(k))return new v(k.op,k.fn,k.args.map(de=>M(de,$)));if(ei(k))return new f(k.items.map(de=>M(de,$)));if(ji(k))return new c(M(k.object,$),M(k.index,$));if(uo(k))return new d(k.dimensions.map(de=>M(de,$)));if(Ka(k)){var q={};for(var xe in k.properties)q[xe]=M(k.properties[xe],$);return new h(q)}return k}return e(z5,{Node:M,"Node,Object":M})});var tue="resolve",rue=["typed","parse","ConstantNode","FunctionNode","OperatorNode","ParenthesisNode"],q5=N(tue,rue,t=>{var{typed:e,parse:r,ConstantNode:i,FunctionNode:n,OperatorNode:o,ParenthesisNode:a}=t;function s(l,u){var c=arguments.length>2&&arguments[2]!==void 0?arguments[2]:new Set;if(!u)return l;if(Nr(l)){if(c.has(l.name)){var f=Array.from(c).join(", ");throw new ReferenceError("recursive loop of variable definitions among {".concat(f,"}"))}var m=u.get(l.name);if(Yt(m)){var p=new Set(c);return p.add(l.name),s(m,u,p)}else return typeof m=="number"?r(String(m)):m!==void 0?new i(m):l}else if(Lr(l)){var d=l.args.map(function(v){return s(v,u,c)});return new o(l.op,l.fn,d,l.implicit)}else{if(ti(l))return new a(s(l.content,u,c));if(gi(l)){var h=l.args.map(function(v){return s(v,u,c)});return new n(l.name,h)}}return l.map(v=>s(v,u,c))}return e("resolve",{Node:s,"Node, Map | null | undefined":s,"Node, Object":(l,u)=>s(l,js(u)),"Array | Matrix":e.referToSelf(l=>u=>u.map(c=>l(c))),"Array | Matrix, null | undefined":e.referToSelf(l=>u=>u.map(c=>l(c))),"Array, Object":e.referTo("Array,Map",l=>(u,c)=>l(u,js(c))),"Matrix, Object":e.referTo("Matrix,Map",l=>(u,c)=>l(u,js(c))),"Array | Matrix, Map":e.referToSelf(l=>(u,c)=>u.map(f=>l(f,c)))})});var j5="symbolicEqual",nue=["parse","simplify","typed","OperatorNode"],Z5=N(j5,nue,t=>{var{parse:e,simplify:r,typed:i,OperatorNode:n}=t;function o(a,s){var l=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},u=new n("-","subtract",[a,s]),c=r(u,{},l);return Lt(c)&&!c.value}return i(j5,{"Node, Node":o,"Node, Node, Object":o})});var G5="derivative",iue=["typed","config","parse","simplify","equal","isZero","numeric","ConstantNode","FunctionNode","OperatorNode","ParenthesisNode","SymbolNode"],W5=N(G5,iue,t=>{var{typed:e,config:r,parse:i,simplify:n,equal:o,isZero:a,numeric:s,ConstantNode:l,FunctionNode:u,OperatorNode:c,ParenthesisNode:f,SymbolNode:m}=t;function p(_,w){var x=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{simplify:!0},E=new Map,T=w.name;function D(C){var $=E.get(C);if($!==void 0)return $;var O=y(D,C,T);return E.set(C,O),O}var M=S(_,D);return x.simplify?n(M):M}function d(_){var w=i(_);if(!w.isSymbolNode)throw new TypeError("Invalid variable. "+"Cannot parse ".concat(JSON.stringify(_)," into a variable in function derivative"));return w}var h=e(G5,{"Node, SymbolNode":p,"Node, SymbolNode, Object":p,"Node, string":(_,w)=>p(_,d(w)),"Node, string, Object":(_,w,x)=>p(_,d(w),x)});h._simplify=!0,h.toTex=function(_){return v.apply(null,_.args)};var v=e("_derivTex",{"Node, SymbolNode":function(w,x){return Lt(w)&&ir(w.value)==="string"?v(i(w.value).toString(),x.toString(),1):v(w.toTex(),x.toString(),1)},"Node, ConstantNode":function(w,x){if(ir(x.value)==="string")return v(w,i(x.value));throw new Error("The second parameter to 'derivative' is a non-string constant")},"Node, SymbolNode, ConstantNode":function(w,x,E){return v(w.toString(),x.name,E.value)},"string, string, number":function(w,x,E){var T;return E===1?T="{d\\over d"+x+"}":T="{d^{"+E+"}\\over d"+x+"^{"+E+"}}",T+"\\left[".concat(w,"\\right]")}}),y=e("_isConst",{"function, ConstantNode, string":function(){return!0},"function, SymbolNode, string":function(w,x,E){return x.name!==E},"function, ParenthesisNode, string":function(w,x,E){return w(x.content,E)},"function, FunctionAssignmentNode, string":function(w,x,E){return x.params.includes(E)?w(x.expr,E):!0},"function, FunctionNode | OperatorNode, string":function(w,x,E){return x.args.every(T=>w(T,E))}}),S=e("_derivative",{"ConstantNode, function":function(){return b(0)},"SymbolNode, function":function(w,x){return x(w)?b(0):b(1)},"ParenthesisNode, function":function(w,x){return new f(S(w.content,x))},"FunctionAssignmentNode, function":function(w,x){return x(w)?b(0):S(w.expr,x)},"FunctionNode, function":function(w,x){if(x(w))return b(0);var E=w.args[0],T,D=!1,M=!1,C;switch(w.name){case"cbrt":D=!0,C=new c("*","multiply",[b(3),new c("^","pow",[E,new c("/","divide",[b(2),b(3)])])]);break;case"sqrt":case"nthRoot":if(w.args.length===1)D=!0,C=new c("*","multiply",[b(2),new u("sqrt",[E])]);else if(w.args.length===2)return T=new c("/","divide",[b(1),w.args[1]]),S(new c("^","pow",[E,T]),x);break;case"log10":T=b(10);case"log":if(!T&&w.args.length===1)C=E.clone(),D=!0;else if(w.args.length===1&&T||w.args.length===2&&x(w.args[1]))C=new c("*","multiply",[E.clone(),new u("log",[T||w.args[1]])]),D=!0;else if(w.args.length===2)return S(new c("/","divide",[new u("log",[E]),new u("log",[w.args[1]])]),x);break;case"pow":if(w.args.length===2)return S(new c("^","pow",[E,w.args[1]]),x);break;case"exp":C=new u("exp",[E.clone()]);break;case"sin":C=new u("cos",[E.clone()]);break;case"cos":C=new c("-","unaryMinus",[new u("sin",[E.clone()])]);break;case"tan":C=new c("^","pow",[new u("sec",[E.clone()]),b(2)]);break;case"sec":C=new c("*","multiply",[w,new u("tan",[E.clone()])]);break;case"csc":M=!0,C=new c("*","multiply",[w,new u("cot",[E.clone()])]);break;case"cot":M=!0,C=new c("^","pow",[new u("csc",[E.clone()]),b(2)]);break;case"asin":D=!0,C=new u("sqrt",[new c("-","subtract",[b(1),new c("^","pow",[E.clone(),b(2)])])]);break;case"acos":D=!0,M=!0,C=new u("sqrt",[new c("-","subtract",[b(1),new c("^","pow",[E.clone(),b(2)])])]);break;case"atan":D=!0,C=new c("+","add",[new c("^","pow",[E.clone(),b(2)]),b(1)]);break;case"asec":D=!0,C=new c("*","multiply",[new u("abs",[E.clone()]),new u("sqrt",[new c("-","subtract",[new c("^","pow",[E.clone(),b(2)]),b(1)])])]);break;case"acsc":D=!0,M=!0,C=new c("*","multiply",[new u("abs",[E.clone()]),new u("sqrt",[new c("-","subtract",[new c("^","pow",[E.clone(),b(2)]),b(1)])])]);break;case"acot":D=!0,M=!0,C=new c("+","add",[new c("^","pow",[E.clone(),b(2)]),b(1)]);break;case"sinh":C=new u("cosh",[E.clone()]);break;case"cosh":C=new u("sinh",[E.clone()]);break;case"tanh":C=new c("^","pow",[new u("sech",[E.clone()]),b(2)]);break;case"sech":M=!0,C=new c("*","multiply",[w,new u("tanh",[E.clone()])]);break;case"csch":M=!0,C=new c("*","multiply",[w,new u("coth",[E.clone()])]);break;case"coth":M=!0,C=new c("^","pow",[new u("csch",[E.clone()]),b(2)]);break;case"asinh":D=!0,C=new u("sqrt",[new c("+","add",[new c("^","pow",[E.clone(),b(2)]),b(1)])]);break;case"acosh":D=!0,C=new u("sqrt",[new c("-","subtract",[new c("^","pow",[E.clone(),b(2)]),b(1)])]);break;case"atanh":D=!0,C=new c("-","subtract",[b(1),new c("^","pow",[E.clone(),b(2)])]);break;case"asech":D=!0,M=!0,C=new c("*","multiply",[E.clone(),new u("sqrt",[new c("-","subtract",[b(1),new c("^","pow",[E.clone(),b(2)])])])]);break;case"acsch":D=!0,M=!0,C=new c("*","multiply",[new u("abs",[E.clone()]),new u("sqrt",[new c("+","add",[new c("^","pow",[E.clone(),b(2)]),b(1)])])]);break;case"acoth":D=!0,M=!0,C=new c("-","subtract",[b(1),new c("^","pow",[E.clone(),b(2)])]);break;case"abs":C=new c("/","divide",[new u(new m("abs"),[E.clone()]),E.clone()]);break;case"gamma":default:throw new Error('Cannot process function "'+w.name+'" in derivative: the function is not supported, undefined, or the number of arguments passed to it are not supported')}var $,O;D?($="/",O="divide"):($="*",O="multiply");var R=S(E,x);return M&&(R=new c("-","unaryMinus",[R])),new c($,O,[R,C])},"OperatorNode, function":function(w,x){if(x(w))return b(0);if(w.op==="+")return new c(w.op,w.fn,w.args.map(function(k){return S(k,x)}));if(w.op==="-"){if(w.isUnary())return new c(w.op,w.fn,[S(w.args[0],x)]);if(w.isBinary())return new c(w.op,w.fn,[S(w.args[0],x),S(w.args[1],x)])}if(w.op==="*"){var E=w.args.filter(function(k){return x(k)});if(E.length>0){var T=w.args.filter(function(k){return!x(k)}),D=T.length===1?T[0]:new c("*","multiply",T),M=E.concat(S(D,x));return new c("*","multiply",M)}return new c("+","add",w.args.map(function(k){return new c("*","multiply",w.args.map(function(V){return V===k?S(V,x):V.clone()}))}))}if(w.op==="/"&&w.isBinary()){var C=w.args[0],$=w.args[1];return x($)?new c("/","divide",[S(C,x),$]):x(C)?new c("*","multiply",[new c("-","unaryMinus",[C]),new c("/","divide",[S($,x),new c("^","pow",[$.clone(),b(2)])])]):new c("/","divide",[new c("-","subtract",[new c("*","multiply",[S(C,x),$.clone()]),new c("*","multiply",[C.clone(),S($,x)])]),new c("^","pow",[$.clone(),b(2)])])}if(w.op==="^"&&w.isBinary()){var O=w.args[0],R=w.args[1];if(x(O))return Lt(O)&&(a(O.value)||o(O.value,1))?b(0):new c("*","multiply",[w,new c("*","multiply",[new u("log",[O.clone()]),S(R.clone(),x)])]);if(x(R)){if(Lt(R)){if(a(R.value))return b(0);if(o(R.value,1))return S(O,x)}var L=new c("^","pow",[O.clone(),new c("-","subtract",[R,b(1)])]);return new c("*","multiply",[R.clone(),new c("*","multiply",[S(O,x),L])])}return new c("*","multiply",[new c("^","pow",[O.clone(),R.clone()]),new c("+","add",[new c("*","multiply",[S(O,x),new c("/","divide",[R.clone(),O.clone()])]),new c("*","multiply",[S(R,x),new u("log",[O.clone()])])])])}throw new Error('Cannot process operator "'+w.op+'" in derivative: the operator is not supported, undefined, or the number of arguments passed to it are not supported')}});function b(_,w){return new l(s(_,w||Mi(String(_),r)))}return h});var H5="rationalize",oue=["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"],Y5=N(H5,oue,t=>{var{config:e,typed:r,equal:i,isZero:n,add:o,subtract:a,multiply:s,divide:l,pow:u,parse:c,simplifyConstant:f,simplifyCore:m,simplify:p,fraction:d,bignumber:h,mathWithTransform:v,matrix:y,AccessorNode:S,ArrayNode:b,ConstantNode:_,FunctionNode:w,IndexNode:x,ObjectNode:E,OperatorNode:T,SymbolNode:D,ParenthesisNode:M}=t;function C(k){var V=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},J=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1,W=O(),Q=$(k,V,!0,W.firstRules),ie=Q.variables.length,B={exactFractions:!1},Z={exactFractions:!0};if(k=Q.expression,ie>=1){k=R(k);var q,xe,de=!0,be=!1;k=p(k,W.firstRules,{},B);for(var G;xe=de?W.distrDivRules:W.sucDivRules,k=p(k,xe,{},Z),de=!de,G=k.toString(),G!==q;)be=!0,q=G;be&&(k=p(k,W.firstRulesAgain,{},B)),k=p(k,W.finalRules,{},B)}var K=[],re={};return k.type==="OperatorNode"&&k.isBinary()&&k.op==="/"?(ie===1&&(k.args[0]=L(k.args[0],K),k.args[1]=L(k.args[1])),J&&(re.numerator=k.args[0],re.denominator=k.args[1])):(ie===1&&(k=L(k,K)),J&&(re.numerator=k,re.denominator=null)),J?(re.coefficients=K,re.variables=Q.variables,re.expression=k,re):k}return r(H5,{Node:C,"Node, boolean":(k,V)=>C(k,{},V),"Node, Object":C,"Node, Object, boolean":C});function $(k,V,J,W){var Q=[],ie=p(k,W,V,{exactFractions:!1});J=!!J;var B="+-*"+(J?"/":"");q(ie);var Z={};return Z.expression=ie,Z.variables=Q,Z;function q(xe){var de=xe.type;if(de==="FunctionNode")throw new Error("There is an unsolved function call");if(de==="OperatorNode")if(xe.op==="^"){if(xe.args[1].type!=="ConstantNode"||!Ge(parseFloat(xe.args[1].value)))throw new Error("There is a non-integer exponent");q(xe.args[0])}else{if(!B.includes(xe.op))throw new Error("Operator "+xe.op+" invalid in polynomial expression");for(var be=0;be<xe.args.length;be++)q(xe.args[be])}else if(de==="SymbolNode"){var G=xe.name,K=Q.indexOf(G);K===-1&&Q.push(G)}else if(de==="ParenthesisNode")q(xe.content);else if(de!=="ConstantNode")throw new Error("type "+de+" is not allowed in polynomial expression")}}function O(){var k=[m,{l:"n+n",r:"2*n"},{l:"n+-n",r:"0"},f,{l:"n*(n1^-1)",r:"n/n1"},{l:"n*n1^-n2",r:"n/n1^n2"},{l:"n1^-1",r:"1/n1"},{l:"n*(n1/n2)",r:"(n*n1)/n2"},{l:"1*n",r:"n"}],V=[{l:"(-n1)/(-n2)",r:"n1/n2"},{l:"(-n1)*(-n2)",r:"n1*n2"},{l:"n1--n2",r:"n1+n2"},{l:"n1-n2",r:"n1+(-n2)"},{l:"(n1+n2)*n3",r:"(n1*n3 + n2*n3)"},{l:"n1*(n2+n3)",r:"(n1*n2+n1*n3)"},{l:"c1*n + c2*n",r:"(c1+c2)*n"},{l:"c1*n + n",r:"(c1+1)*n"},{l:"c1*n - c2*n",r:"(c1-c2)*n"},{l:"c1*n - n",r:"(c1-1)*n"},{l:"v/c",r:"(1/c)*v"},{l:"v/-c",r:"-(1/c)*v"},{l:"-v*-c",r:"c*v"},{l:"-v*c",r:"-c*v"},{l:"v*-c",r:"-c*v"},{l:"v*c",r:"c*v"},{l:"-(-n1*n2)",r:"(n1*n2)"},{l:"-(n1*n2)",r:"(-n1*n2)"},{l:"-(-n1+n2)",r:"(n1-n2)"},{l:"-(n1+n2)",r:"(-n1-n2)"},{l:"(n1^n2)^n3",r:"(n1^(n2*n3))"},{l:"-(-n1/n2)",r:"(n1/n2)"},{l:"-(n1/n2)",r:"(-n1/n2)"}],J=[{l:"(n1/n2 + n3/n4)",r:"((n1*n4 + n3*n2)/(n2*n4))"},{l:"(n1/n2 + n3)",r:"((n1 + n3*n2)/n2)"},{l:"(n1 + n2/n3)",r:"((n1*n3 + n2)/n3)"}],W=[{l:"(n1/(n2/n3))",r:"((n1*n3)/n2)"},{l:"(n1/n2/n3)",r:"(n1/(n2*n3))"}],Q={};return Q.firstRules=k.concat(V,W),Q.distrDivRules=J,Q.sucDivRules=W,Q.firstRulesAgain=k.concat(V),Q.finalRules=[m,{l:"n*-n",r:"-n^2"},{l:"n*n",r:"n^2"},f,{l:"n*-n^n1",r:"-n^(n1+1)"},{l:"n*n^n1",r:"n^(n1+1)"},{l:"n^n1*-n^n2",r:"-n^(n1+n2)"},{l:"n^n1*n^n2",r:"n^(n1+n2)"},{l:"n^n1*-n",r:"-n^(n1+1)"},{l:"n^n1*n",r:"n^(n1+1)"},{l:"n^n1/-n",r:"-n^(n1-1)"},{l:"n^n1/n",r:"n^(n1-1)"},{l:"n/-n^n1",r:"-n^(1-n1)"},{l:"n/n^n1",r:"n^(1-n1)"},{l:"n^n1/-n^n2",r:"n^(n1-n2)"},{l:"n^n1/n^n2",r:"n^(n1-n2)"},{l:"n1+(-n2*n3)",r:"n1-n2*n3"},{l:"v*(-c)",r:"-c*v"},{l:"n1+-n2",r:"n1-n2"},{l:"v*c",r:"c*v"},{l:"(n1^n2)^n3",r:"(n1^(n2*n3))"}],Q}function R(k,V,J){var W=k.type,Q=arguments.length>1;if(W==="OperatorNode"&&k.isBinary()){var ie=!1,B;if(k.op==="^"&&(k.args[0].type==="ParenthesisNode"||k.args[0].type==="OperatorNode")&&k.args[1].type==="ConstantNode"&&(B=parseFloat(k.args[1].value),ie=B>=2&&Ge(B)),ie){if(B>2){var Z=k.args[0],q=new T("^","pow",[k.args[0].cloneDeep(),new _(B-1)]);k=new T("*","multiply",[Z,q])}else k=new T("*","multiply",[k.args[0],k.args[0].cloneDeep()]);Q&&(J==="content"?V.content=k:V.args[J]=k)}}if(W==="ParenthesisNode")R(k.content,k,"content");else if(W!=="ConstantNode"&&W!=="SymbolNode")for(var xe=0;xe<k.args.length;xe++)R(k.args[xe],k,xe);if(!Q)return k}function L(k,V){V===void 0&&(V=[]),V[0]=0;var J={};J.cte=1,J.oper="+",J.fire="";var W=0,Q="";G(k,null,J),W=V.length-1;for(var ie=!0,B,Z=W;Z>=0;Z--)if(V[Z]!==0){var q=new _(ie?V[Z]:Math.abs(V[Z])),xe=V[Z]<0?"-":"+";if(Z>0){var de=new D(Q);if(Z>1){var be=new _(Z);de=new T("^","pow",[de,be])}V[Z]===-1&&ie?q=new T("-","unaryMinus",[de]):Math.abs(V[Z])===1?q=de:q=new T("*","multiply",[q,de])}ie?B=q:xe==="+"?B=new T("+","add",[B,q]):B=new T("-","subtract",[B,q]),ie=!1}if(ie)return new _(0);return B;function G(K,re,ae){var le=K.type;if(le==="FunctionNode")throw new Error("There is an unsolved function call");if(le==="OperatorNode"){if(!"+-*^".includes(K.op))throw new Error("Operator "+K.op+" invalid");if(re!==null){if((K.fn==="unaryMinus"||K.fn==="pow")&&re.fn!=="add"&&re.fn!=="subtract"&&re.fn!=="multiply")throw new Error("Invalid "+K.op+" placing");if((K.fn==="subtract"||K.fn==="add"||K.fn==="multiply")&&re.fn!=="add"&&re.fn!=="subtract")throw new Error("Invalid "+K.op+" placing");if((K.fn==="subtract"||K.fn==="add"||K.fn==="unaryMinus")&&ae.noFil!==0)throw new Error("Invalid "+K.op+" placing")}(K.op==="^"||K.op==="*")&&(ae.fire=K.op);for(var Se=0;Se<K.args.length;Se++)K.fn==="unaryMinus"&&(ae.oper="-"),(K.op==="+"||K.fn==="subtract")&&(ae.fire="",ae.cte=1,ae.oper=Se===0?"+":K.op),ae.noFil=Se,G(K.args[Se],K,ae)}else if(le==="SymbolNode"){if(K.name!==Q&&Q!=="")throw new Error("There is more than one variable");if(Q=K.name,re===null){V[1]=1;return}if(re.op==="^"&&ae.noFil!==0)throw new Error("In power the variable should be the first parameter");if(re.op==="*"&&ae.noFil!==1)throw new Error("In multiply the variable should be the second parameter");(ae.fire===""||ae.fire==="*")&&(W<1&&(V[1]=0),V[1]+=ae.cte*(ae.oper==="+"?1:-1),W=Math.max(1,W))}else if(le==="ConstantNode"){var _e=parseFloat(K.value);if(re===null){V[0]=_e;return}if(re.op==="^"){if(ae.noFil!==1)throw new Error("Constant cannot be powered");if(!Ge(_e)||_e<=0)throw new Error("Non-integer exponent is not allowed");for(var Oe=W+1;Oe<_e;Oe++)V[Oe]=0;_e>W&&(V[_e]=0),V[_e]+=ae.cte*(ae.oper==="+"?1:-1),W=Math.max(_e,W);return}ae.cte=_e,ae.fire===""&&(V[0]+=ae.cte*(ae.oper==="+"?1:-1))}else throw new Error("Type "+le+" is not allowed")}}});var J5="zpk2tf",aue=["typed","add","multiply","Complex","number"],X5=N(J5,aue,t=>{var{typed:e,add:r,multiply:i,Complex:n,number:o}=t;return e(J5,{"Array,Array,number":function(u,c,f){return a(u,c,f)},"Array,Array":function(u,c){return a(u,c,1)},"Matrix,Matrix,number":function(u,c,f){return a(u.valueOf(),c.valueOf(),f)},"Matrix,Matrix":function(u,c){return a(u.valueOf(),c.valueOf(),1)}});function a(l,u,c){l.some(S=>S.type==="BigNumber")&&(l=l.map(S=>o(S))),u.some(S=>S.type==="BigNumber")&&(u=u.map(S=>o(S)));for(var f=[n(1,0)],m=[n(1,0)],p=0;p<l.length;p++){var d=l[p];typeof d=="number"&&(d=n(d,0)),f=s(f,[n(1,0),n(-d.re,-d.im)])}for(var h=0;h<u.length;h++){var v=u[h];typeof v=="number"&&(v=n(v,0)),m=s(m,[n(1,0),n(-v.re,-v.im)])}for(var y=0;y<f.length;y++)f[y]=i(f[y],c);return[f,m]}function s(l,u){for(var c=[],f=0;f<l.length+u.length-1;f++){c[f]=n(0,0);for(var m=0;m<l.length;m++)f-m>=0&&f-m<u.length&&(c[f]=r(c[f],i(l[m],u[f-m])))}return c}});var K5="freqz",sue=["typed","add","multiply","Complex","divide","matrix"],Q5=N(K5,sue,t=>{var{typed:e,add:r,multiply:i,Complex:n,divide:o,matrix:a}=t;return e(K5,{"Array, Array":function(c,f){var m=l(512);return s(c,f,m)},"Array, Array, Array":function(c,f,m){return s(c,f,m)},"Array, Array, number":function(c,f,m){if(m<0)throw new Error("w must be a positive number");var p=l(m);return s(c,f,p)},"Matrix, Matrix":function(c,f){var m=l(512),{w:p,h:d}=s(c.valueOf(),f.valueOf(),m);return{w:a(p),h:a(d)}},"Matrix, Matrix, Matrix":function(c,f,m){var{h:p}=s(c.valueOf(),f.valueOf(),m.valueOf());return{h:a(p),w:a(m)}},"Matrix, Matrix, number":function(c,f,m){if(m<0)throw new Error("w must be a positive number");var p=l(m),{h:d}=s(c.valueOf(),f.valueOf(),p);return{h:a(d),w:a(p)}}});function s(u,c,f){for(var m=[],p=[],d=0;d<f.length;d++){for(var h=n(0,0),v=n(0,0),y=0;y<u.length;y++)h=r(h,i(u[y],n(Math.cos(-y*f[d]),Math.sin(-y*f[d]))));for(var S=0;S<c.length;S++)v=r(v,i(c[S],n(Math.cos(-S*f[d]),Math.sin(-S*f[d]))));m.push(h),p.push(v)}for(var b=[],_=0;_<m.length;_++)b.push(o(m[_],p[_]));return{h:b,w:f}}function l(u){for(var c=[],f=0;f<u;f++)c.push(f/u*Math.PI);return c}});var uue="reviver",lue=["classes"],e8=N(uue,lue,t=>{var{classes:e}=t;return function(i,n){var o=e[n&&n.mathjs];return o&&typeof o.fromJSON=="function"?o.fromJSON(n):n}});var cue="replacer",fue=[],t8=N(cue,fue,()=>function(e,r){return typeof r=="number"&&(!isFinite(r)||isNaN(r))?{mathjs:"number",value:String(r)}:typeof r=="bigint"?{mathjs:"bigint",value:String(r)}:r});var r8="14.6.0";var n8=N("true",[],()=>!0),i8=N("false",[],()=>!1),o8=N("null",[],()=>null),a8=Oo("Infinity",["config","?BigNumber"],t=>{var{config:e,BigNumber:r}=t;return e.number==="BigNumber"?new r(1/0):1/0}),s8=Oo("NaN",["config","?BigNumber"],t=>{var{config:e,BigNumber:r}=t;return e.number==="BigNumber"?new r(NaN):NaN}),u8=Oo("pi",["config","?BigNumber"],t=>{var{config:e,BigNumber:r}=t;return e.number==="BigNumber"?um(r):fk}),l8=Oo("tau",["config","?BigNumber"],t=>{var{config:e,BigNumber:r}=t;return e.number==="BigNumber"?jO(r):pk}),c8=Oo("e",["config","?BigNumber"],t=>{var{config:e,BigNumber:r}=t;return e.number==="BigNumber"?VO(r):mk}),f8=Oo("phi",["config","?BigNumber"],t=>{var{config:e,BigNumber:r}=t;return e.number==="BigNumber"?qO(r):dk}),p8=Oo("LN2",["config","?BigNumber"],t=>{var{config:e,BigNumber:r}=t;return e.number==="BigNumber"?new r(2).ln():Math.LN2}),m8=Oo("LN10",["config","?BigNumber"],t=>{var{config:e,BigNumber:r}=t;return e.number==="BigNumber"?new r(10).ln():Math.LN10}),d8=Oo("LOG2E",["config","?BigNumber"],t=>{var{config:e,BigNumber:r}=t;return e.number==="BigNumber"?new r(1).div(new r(2).ln()):Math.LOG2E}),h8=Oo("LOG10E",["config","?BigNumber"],t=>{var{config:e,BigNumber:r}=t;return e.number==="BigNumber"?new r(1).div(new r(10).ln()):Math.LOG10E}),g8=Oo("SQRT1_2",["config","?BigNumber"],t=>{var{config:e,BigNumber:r}=t;return e.number==="BigNumber"?new r("0.5").sqrt():Math.SQRT1_2}),v8=Oo("SQRT2",["config","?BigNumber"],t=>{var{config:e,BigNumber:r}=t;return e.number==="BigNumber"?new r(2).sqrt():Math.SQRT2}),y8=Oo("i",["Complex"],t=>{var{Complex:e}=t;return e.I}),b8=N("PI",["pi"],t=>{var{pi:e}=t;return e}),x8=N("E",["e"],t=>{var{e}=t;return e}),_8=N("version",[],()=>r8);function Oo(t,e,r){return N(t,e,r,{recreateOnConfigChange:!0})}var w8=Qt("speedOfLight","299792458","m s^-1"),S8=Qt("gravitationConstant","6.67430e-11","m^3 kg^-1 s^-2"),D8=Qt("planckConstant","6.62607015e-34","J s"),E8=Qt("reducedPlanckConstant","1.0545718176461565e-34","J s"),A8=Qt("magneticConstant","1.25663706212e-6","N A^-2"),T8=Qt("electricConstant","8.8541878128e-12","F m^-1"),N8=Qt("vacuumImpedance","376.730313667","ohm"),M8=Qt("coulomb","8.987551792261171e9","N m^2 C^-2"),C8=Qt("coulombConstant","8.987551792261171e9","N m^2 C^-2"),$8=Qt("elementaryCharge","1.602176634e-19","C"),I8=Qt("bohrMagneton","9.2740100783e-24","J T^-1"),F8=Qt("conductanceQuantum","7.748091729863649e-5","S"),k8=Qt("inverseConductanceQuantum","12906.403729652257","ohm"),P8=Qt("magneticFluxQuantum","2.0678338484619295e-15","Wb"),B8=Qt("nuclearMagneton","5.0507837461e-27","J T^-1"),O8=Qt("klitzing","25812.807459304513","ohm");var R8=Qt("bohrRadius","5.29177210903e-11","m"),L8=Qt("classicalElectronRadius","2.8179403262e-15","m"),U8=Qt("electronMass","9.1093837015e-31","kg"),z8=Qt("fermiCoupling","1.1663787e-5","GeV^-2"),V8=_b("fineStructure",.0072973525693),q8=Qt("hartreeEnergy","4.3597447222071e-18","J"),j8=Qt("protonMass","1.67262192369e-27","kg"),Z8=Qt("deuteronMass","3.3435830926e-27","kg"),G8=Qt("neutronMass","1.6749271613e-27","kg"),W8=Qt("quantumOfCirculation","3.6369475516e-4","m^2 s^-1"),H8=Qt("rydberg","10973731.568160","m^-1"),Y8=Qt("thomsonCrossSection","6.6524587321e-29","m^2"),J8=_b("weakMixingAngle",.2229),X8=_b("efimovFactor",22.7),K8=Qt("atomicMass","1.66053906660e-27","kg"),Q8=Qt("avogadro","6.02214076e23","mol^-1"),e9=Qt("boltzmann","1.380649e-23","J K^-1"),t9=Qt("faraday","96485.33212331001","C mol^-1"),r9=Qt("firstRadiation","3.7417718521927573e-16","W m^2"),n9=Qt("loschmidt","2.686780111798444e25","m^-3"),i9=Qt("gasConstant","8.31446261815324","J K^-1 mol^-1"),o9=Qt("molarPlanckConstant","3.990312712893431e-10","J s mol^-1"),a9=Qt("molarVolume","0.022413969545014137","m^3 mol^-1"),s9=_b("sackurTetrode",-1.16487052358),u9=Qt("secondRadiation","0.014387768775039337","m K"),l9=Qt("stefanBoltzmann","5.67037441918443e-8","W m^-2 K^-4"),c9=Qt("wienDisplacement","2.897771955e-3","m K"),f9=Qt("molarMass","0.99999999965e-3","kg mol^-1"),p9=Qt("molarMassC12","11.9999999958e-3","kg mol^-1"),m9=Qt("gravity","9.80665","m s^-2"),d9=Qt("planckLength","1.616255e-35","m"),h9=Qt("planckMass","2.176435e-8","kg"),g9=Qt("planckTime","5.391245e-44","s"),v9=Qt("planckCharge","1.87554603778e-18","C"),y9=Qt("planckTemperature","1.416785e+32","K");function Qt(t,e,r){var i=["config","Unit","BigNumber"];return N(t,i,n=>{var{config:o,Unit:a,BigNumber:s}=n,l=o.number==="BigNumber"?new s(e):parseFloat(e),u=new a(l,r);return u.fixPrefix=!0,u})}function _b(t,e){var r=["config","BigNumber"];return N(t,r,i=>{var{config:n,BigNumber:o}=i;return n.number==="BigNumber"?new o(e):e})}function b9(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var i=Object.getOwnPropertySymbols(t);e&&(i=i.filter(function(n){return Object.getOwnPropertyDescriptor(t,n).enumerable})),r.push.apply(r,i)}return r}function pue(t){for(var e=1;e<arguments.length;e++){var r=arguments[e]!=null?arguments[e]:{};e%2?b9(Object(r),!0).forEach(function(i){dr(t,i,r[i])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):b9(Object(r)).forEach(function(i){Object.defineProperty(t,i,Object.getOwnPropertyDescriptor(r,i))})}return t}var mue="mapSlices",due=["typed","isInteger"],x9=N(mue,due,t=>{var{typed:e,isInteger:r}=t,i=sm({typed:e,isInteger:r});return e("mapSlices",{"...any":function(o){var a=o[1];Et(a)?o[1]=a-1:mt(a)&&(o[1]=a.minus(1));try{return i.apply(null,o)}catch(s){throw qr(s)}}})},pue({isTransformFunction:!0},sm.meta));var hue="column",gue=["typed","Index","matrix","range"],_9=N(hue,gue,t=>{var{typed:e,Index:r,matrix:i,range:n}=t,o=wy({typed:e,Index:r,matrix:i,range:n});return e("column",{"...any":function(s){var l=s.length-1,u=s[l];Et(u)&&(s[l]=u-1);try{return o.apply(null,s)}catch(c){throw qr(c)}}})},{isTransformFunction:!0});function uf(t,e,r){var i=t.filter(function(l){return Nr(l)&&!(l.name in e)&&!r.has(l.name)})[0];if(!i)throw new Error('No undefined variable found in inline expression "'+t+'"');var n=i.name,o=new Map,a=new Bc(r,o,new Set([n])),s=t.compile();return function(u){return o.set(n,u),s.evaluate(a)}}var vue="transformCallback",yue=["typed"],lf=N(vue,yue,t=>{var{typed:e}=t;return function(i,n){return e.isTypedFunction(i)?r(i,n):w9(i,i.length,n)};function r(i,n){var o=Object.fromEntries(Object.entries(i.signatures).map(a=>{var[s,l]=a,u=s.split(",").length;return e.isTypedFunction(l)?[s,r(l,n)]:[s,w9(l,u,n)]}));return typeof i.name=="string"?e(i.name,o):e(o)}});function w9(t,e,r){return e===r?t:e===r+1?function(){for(var i=arguments.length,n=new Array(i),o=0;o<i;o++)n[o]=arguments[o];var a=n.slice(0,r),s=S9(n[r]);return t(...a,s)}:e>r+1?function(){for(var i=arguments.length,n=new Array(i),o=0;o<i;o++)n[o]=arguments[o];var a=n.slice(0,r),s=S9(n[r]),l=n.slice(r+1);return t(...a,s,...l)}:t}function S9(t){return t.map(e=>e+1)}var bue="filter",xue=["typed"],D9=N(bue,xue,t=>{var{typed:e}=t;function r(n,o,a){var s=Sy({typed:e}),l=lf({typed:e});if(n.length===0)return s();var u=n[0];if(n.length===1)return s(u);var c=n.length-1,f=n[c];return u&&(u=i(u,a)),f&&(Nr(f)||ta(f)?f=i(f,a):f=uf(f,o,a)),s(u,l(f,c))}r.rawArgs=!0;function i(n,o){return n.compile().evaluate(o)}return r},{isTransformFunction:!0});var _ue="forEach",wue=["typed"],E9=N(_ue,wue,t=>{var{typed:e}=t,r=Dy({typed:e}),i=lf({typed:e});function n(a,s,l){if(a.length===0)return r();var u=a[0];if(a.length===1)return r(u);var c=a.length-1,f=a[c];return u&&(u=o(u,l)),f&&(Nr(f)||ta(f)?f=o(f,l):f=uf(f,s,l)),r(u,i(f,c))}n.rawArgs=!0;function o(a,s){return a.compile().evaluate(s)}return n},{isTransformFunction:!0});var Sue="index",Due=["Index","getMatrixDataType"],A9=N(Sue,Due,t=>{var{Index:e,getMatrixDataType:r}=t;return function(){for(var n=[],o=0,a=arguments.length;o<a;o++){var s=arguments[o];if(Du(s))s.start--,s.end-=s.step>0?0:2;else if(s&&s.isSet===!0)s=s.map(function(u){return u-1});else if(sr(s)||Je(s))r(s)!=="boolean"&&(s=s.map(function(u){return u-1}));else if(Et(s)||Ja(s))s--;else if(mt(s))s=s.toNumber()-1;else if(typeof s!="string")throw new TypeError("Dimension must be an Array, Matrix, number, bigint, string, or Range");n[o]=s}var l=new e;return e.apply(l,n),l}},{isTransformFunction:!0});var Eue="map",Aue=["typed"],T9=N(Eue,Aue,t=>{var{typed:e}=t,r=Ey({typed:e}),i=lf({typed:e});function n(o,a,s){if(o.length===0)return r();if(o.length===1)return r(o[0]);var l=o.length-1,u=o.slice(0,l),c=o[l];return u=u.map(m=>f(m,s)),c&&(Nr(c)||ta(c)?c=f(c,s):c=uf(c,a,s)),r(...u,i(c,l));function f(m,p){return m.compile().evaluate(p)}}return n.rawArgs=!0,n},{isTransformFunction:!0});function N9(t){return Et(t)?t-1:mt(t)?t.minus(1):t}function M9(t){return Et(t)||mt(t)}function Fi(t){if(t.length===2&&un(t[0])){t=t.slice();var e=t[1];M9(e)&&(t[1]=N9(e))}return t}var Tue="max",Nue=["typed","config","numeric","larger","isNaN"],C9=N(Tue,Nue,t=>{var{typed:e,config:r,numeric:i,larger:n,isNaN:o}=t,a=Vy({typed:e,config:r,numeric:i,larger:n,isNaN:o});return e("max",{"...any":function(l){l=Fi(l);try{return a.apply(null,l)}catch(u){throw qr(u)}}})},{isTransformFunction:!0});var Mue="mean",Cue=["typed","add","divide"],$9=N(Mue,Cue,t=>{var{typed:e,add:r,divide:i}=t,n=gb({typed:e,add:r,divide:i});return e("mean",{"...any":function(a){a=Fi(a);try{return n.apply(null,a)}catch(s){throw qr(s)}}})},{isTransformFunction:!0});var $ue="min",Iue=["typed","config","numeric","smaller","isNaN"],I9=N($ue,Iue,t=>{var{typed:e,config:r,numeric:i,smaller:n,isNaN:o}=t,a=qy({typed:e,config:r,numeric:i,smaller:n,isNaN:o});return e("min",{"...any":function(l){l=Fi(l);try{return a.apply(null,l)}catch(u){throw qr(u)}}})},{isTransformFunction:!0});var Fue="range",kue=["typed","config","?matrix","?bignumber","smaller","smallerEq","larger","largerEq","add","isPositive"],F9=N(Fue,kue,t=>{var{typed:e,config:r,matrix:i,bignumber:n,smaller:o,smallerEq:a,larger:s,largerEq:l,add:u,isPositive:c}=t,f=My({typed:e,config:r,matrix:i,bignumber:n,smaller:o,smallerEq:a,larger:s,largerEq:l,add:u,isPositive:c});return e("range",{"...any":function(p){var d=p.length-1,h=p[d];return typeof h!="boolean"&&p.push(!0),f.apply(null,p)}})},{isTransformFunction:!0});var Pue="row",Bue=["typed","Index","matrix","range"],k9=N(Pue,Bue,t=>{var{typed:e,Index:r,matrix:i,range:n}=t,o=Cy({typed:e,Index:r,matrix:i,range:n});return e("row",{"...any":function(s){var l=s.length-1,u=s[l];Et(u)&&(s[l]=u-1);try{return o.apply(null,s)}catch(c){throw qr(c)}}})},{isTransformFunction:!0});var Oue="subset",Rue=["typed","matrix","zeros","add"],P9=N(Oue,Rue,t=>{var{typed:e,matrix:r,zeros:i,add:n}=t,o=$y({typed:e,matrix:r,zeros:i,add:n});return e("subset",{"...any":function(s){try{return o.apply(null,s)}catch(l){throw qr(l)}}})},{isTransformFunction:!0});var Lue="concat",Uue=["typed","matrix","isInteger"],B9=N(Lue,Uue,t=>{var{typed:e,matrix:r,isInteger:i}=t,n=_y({typed:e,matrix:r,isInteger:i});return e("concat",{"...any":function(a){var s=a.length-1,l=a[s];Et(l)?a[s]=l-1:mt(l)&&(a[s]=l.minus(1));try{return n.apply(null,a)}catch(u){throw qr(u)}}})},{isTransformFunction:!0});var O9="diff",zue=["typed","matrix","subtract","number","bignumber"],R9=N(O9,zue,t=>{var{typed:e,matrix:r,subtract:i,number:n,bignumber:o}=t,a=Ay({typed:e,matrix:r,subtract:i,number:n,bignumber:o});return e(O9,{"...any":function(l){l=Fi(l);try{return a.apply(null,l)}catch(u){throw qr(u)}}})},{isTransformFunction:!0});var Vue="std",que=["typed","map","sqrt","variance"],L9=N(Vue,que,t=>{var{typed:e,map:r,sqrt:i,variance:n}=t,o=bb({typed:e,map:r,sqrt:i,variance:n});return e("std",{"...any":function(s){s=Fi(s);try{return o.apply(null,s)}catch(l){throw qr(l)}}})},{isTransformFunction:!0});var U9="sum",jue=["typed","config","add","numeric"],z9=N(U9,jue,t=>{var{typed:e,config:r,add:i,numeric:n}=t,o=mb({typed:e,config:r,add:i,numeric:n});return e(U9,{"...any":function(s){s=Fi(s);try{return o.apply(null,s)}catch(l){throw qr(l)}}})},{isTransformFunction:!0});var Zue="quantileSeq",Gue=["typed","bignumber","add","subtract","divide","multiply","partitionSelect","compare","isInteger","smaller","smallerEq","larger","mapSlices"],V9=N(Zue,Gue,t=>{var{typed:e,bignumber:r,add:i,subtract:n,divide:o,multiply:a,partitionSelect:s,compare:l,isInteger:u,smaller:c,smallerEq:f,larger:m,mapSlices:p}=t,d=yb({typed:e,bignumber:r,add:i,subtract:n,divide:o,multiply:a,partitionSelect:s,compare:l,isInteger:u,smaller:c,smallerEq:f,larger:m,mapSlices:p});return e("quantileSeq",{"Array | Matrix, number | BigNumber":d,"Array | Matrix, number | BigNumber, number":(v,y,S)=>d(v,y,h(S)),"Array | Matrix, number | BigNumber, boolean":d,"Array | Matrix, number | BigNumber, boolean, number":(v,y,S,b)=>d(v,y,S,h(b)),"Array | Matrix, Array | Matrix":d,"Array | Matrix, Array | Matrix, number":(v,y,S)=>d(v,y,h(S)),"Array | Matrix, Array | Matrix, boolean":d,"Array | Matrix, Array | Matrix, boolean, number":(v,y,S,b)=>d(v,y,S,h(b))});function h(v){return Fi([[],v])[1]}},{isTransformFunction:!0});var q9="cumsum",Wue=["typed","add","unaryPlus"],j9=N(q9,Wue,t=>{var{typed:e,add:r,unaryPlus:i}=t,n=hb({typed:e,add:r,unaryPlus:i});return e(q9,{"...any":function(a){if(a.length===2&&un(a[0])){var s=a[1];Et(s)?a[1]=s-1:mt(s)&&(a[1]=s.minus(1))}try{return n.apply(null,a)}catch(l){throw qr(l)}}})},{isTransformFunction:!0});var Z9="variance",Hue=["typed","add","subtract","multiply","divide","mapSlices","isNaN"],G9=N(Z9,Hue,t=>{var{typed:e,add:r,subtract:i,multiply:n,divide:o,mapSlices:a,isNaN:s}=t,l=vb({typed:e,add:r,subtract:i,multiply:n,divide:o,mapSlices:a,isNaN:s});return e(Z9,{"...any":function(c){c=Fi(c);try{return l.apply(null,c)}catch(f){throw qr(f)}}})},{isTransformFunction:!0});var W9="print",Yue=["typed","matrix","zeros","add"],H9=N(W9,Yue,t=>{var{typed:e,matrix:r,zeros:i,add:n}=t,o=Fy({typed:e,matrix:r,zeros:i,add:n});return e(W9,{"string, Object | Array":function(l,u){return o(a(l),u)},"string, Object | Array, number | Object":function(l,u,c){return o(a(l),u,c)}});function a(s){return s.replace(Iy,l=>{var u=l.slice(1).split("."),c=u.map(function(f){return!isNaN(f)&&f.length>0?parseInt(f)-1:f});return"$"+c.join(".")})}},{isTransformFunction:!0});var Jue="and",Xue=["typed","matrix","zeros","add","equalScalar","not","concat"],Y9=N(Jue,Xue,t=>{var{typed:e,matrix:r,equalScalar:i,zeros:n,not:o,concat:a}=t,s=ky({typed:e,matrix:r,equalScalar:i,zeros:n,not:o,concat:a});function l(u,c,f){var m=u[0].compile().evaluate(f);if(!un(m)&&!s(m,!0))return!1;var p=u[1].compile().evaluate(f);return s(m,p)}return l.rawArgs=!0,l},{isTransformFunction:!0});var Kue="or",Que=["typed","matrix","equalScalar","DenseMatrix","concat"],J9=N(Kue,Que,t=>{var{typed:e,matrix:r,equalScalar:i,DenseMatrix:n,concat:o}=t,a=xy({typed:e,matrix:r,equalScalar:i,DenseMatrix:n,concat:o});function s(l,u,c){var f=l[0].compile().evaluate(c);if(!un(f)&&a(f,!1))return!0;var m=l[1].compile().evaluate(c);return a(f,m)}return s.rawArgs=!0,s},{isTransformFunction:!0});var ele="bitAnd",tle=["typed","matrix","zeros","add","equalScalar","not","concat"],X9=N(ele,tle,t=>{var{typed:e,matrix:r,equalScalar:i,zeros:n,not:o,concat:a}=t,s=yy({typed:e,matrix:r,equalScalar:i,zeros:n,not:o,concat:a});function l(u,c,f){var m=u[0].compile().evaluate(f);if(!un(m)){if(isNaN(m))return NaN;if(m===0||m===!1)return 0}var p=u[1].compile().evaluate(f);return s(m,p)}return l.rawArgs=!0,l},{isTransformFunction:!0});var rle="bitOr",nle=["typed","matrix","equalScalar","DenseMatrix","concat"],K9=N(rle,nle,t=>{var{typed:e,matrix:r,equalScalar:i,DenseMatrix:n,concat:o}=t,a=by({typed:e,matrix:r,equalScalar:i,DenseMatrix:n,concat:o});function s(l,u,c){var f=l[0].compile().evaluate(c);if(!un(f)){if(isNaN(f))return NaN;if(f===-1)return-1;if(f===!0)return 1}var m=l[1].compile().evaluate(c);return a(f,m)}return s.rawArgs=!0,s},{isTransformFunction:!0});var uA=sA;var nq=Ar(Lv(),1);var eq=Ar(Q9(),1);function tq(t){var e=new eq.default;return t.on=e.on.bind(e),t.off=e.off.bind(e),t.once=e.once.bind(e),t.emit=e.emit.bind(e),t}function rq(t,e,r,i){function n(y,S){var b=arguments.length;if(b!==1&&b!==2)throw new Bo("import",b,1,2);S||(S={});function _(T,D,M){if(Array.isArray(D))D.forEach(O=>_(T,O));else if($o(D)||f(D))for(var C in D)rt(D,C)&&_(T,D[C],C);else if(gl(D)||M!==void 0){var $=gl(D)?h(D)?D.fn+".transform":D.fn:M;if(rt(T,$)&&T[$]!==D&&!S.silent)throw new Error('Cannot import "'+$+'" twice');T[$]=D}else if(!S.silent)throw new TypeError("Factory, Object, or Array expected")}var w={};_(w,y);for(var x in w)if(rt(w,x)){var E=w[x];if(gl(E))u(E,S);else if(c(E))o(x,E,S);else if(!S.silent)throw new TypeError("Factory, Object, or Array expected")}}function o(y,S,b){var _;if(b.wrap&&typeof S=="function"&&(S=l(S)),m(S)&&(S=t(y,{[S.signature]:S})),t.isTypedFunction(r[y])&&t.isTypedFunction(S)){b.override?S=t(y,S.signatures):S=t(r[y],S),r[y]=S,delete i[y],a(y,S),r.emit("import",y,function(){return S});return}var w=r[y]!==void 0,x=(_=r.Unit)===null||_===void 0?void 0:_.isValuelessUnit(y);if(!w&&!x||b.override){r[y]=S,delete i[y],a(y,S),r.emit("import",y,function(){return S});return}if(!b.silent)throw new Error('Cannot import "'+y+'": already exists')}function a(y,S){S&&typeof S.transform=="function"?(r.expression.transform[y]=S.transform,p(y)&&(r.expression.mathWithTransform[y]=S.transform)):(delete r.expression.transform[y],p(y)&&(r.expression.mathWithTransform[y]=S))}function s(y){delete r.expression.transform[y],p(y)?r.expression.mathWithTransform[y]=r[y]:delete r.expression.mathWithTransform[y]}function l(y){var S=function(){for(var _=[],w=0,x=arguments.length;w<x;w++){var E=arguments[w];_[w]=E&&E.valueOf()}return y.apply(r,_)};return y.transform&&(S.transform=y.transform),S}function u(y,S){var b,_,w=arguments.length>2&&arguments[2]!==void 0?arguments[2]:y.fn;if(w.includes("."))throw new Error("Factory name should not contain a nested path. Name: "+JSON.stringify(w));var x=h(y)?r.expression.transform:r,E=w in r.expression.transform,T=rt(x,w)?x[w]:void 0,D=function(){var R={};y.dependencies.map(_D).forEach(k=>{if(k.includes("."))throw new Error("Factory dependency should not contain a nested path. Name: "+JSON.stringify(k));k==="math"?R.math=r:k==="mathWithTransform"?R.mathWithTransform=r.expression.mathWithTransform:k==="classes"?R.classes=r:R[k]=r[k]});var L=y(R);if(L&&typeof L.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(T===void 0||S.override)return L;if(t.isTypedFunction(T)&&t.isTypedFunction(L))return t(T,L);if(S.silent)return T;throw new Error('Cannot import "'+w+'": already exists')},M=(b=(_=y.meta)===null||_===void 0?void 0:_.formerly)!==null&&b!==void 0?b:"",C=h(y)||d(y),$=r.expression.mathWithTransform;!y.meta||y.meta.lazy!==!1?(Gs(x,w,D),M&&Gs(x,M,D),T&&E?(s(w),M&&s(M)):C&&(Gs($,w,()=>x[w]),M&&Gs($,M,()=>x[w]))):(x[w]=D(),M&&(x[M]=x[w]),T&&E?(s(w),M&&s(M)):C&&(Gs($,w,()=>x[w]),M&&Gs($,M,()=>x[w]))),i[w]=y,r.emit("import",w,D)}function c(y){return typeof y=="function"||typeof y=="number"||typeof y=="string"||typeof y=="boolean"||y===null||En(y)||Qn(y)||mt(y)||Io(y)||Je(y)||Array.isArray(y)}function f(y){return typeof y=="object"&&y[Symbol.toStringTag]==="Module"}function m(y){return typeof y=="function"&&typeof y.signature=="string"}function p(y){return!rt(v,y)}function d(y){return!y.fn.includes(".")&&!rt(v,y.fn)&&(!y.meta||!y.meta.isClass)}function h(y){return y!==void 0&&y.meta!==void 0&&y.meta.isTransformFunction===!0||!1}var v={expression:!0,type:!0,docs:!0,error:!0,json:!0,chain:!0};return n}function wb(t,e){var r=Dn({},Dv,e);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 i=tq({isNumber:Et,isComplex:Qn,isBigNumber:mt,isBigInt:Ja,isFraction:Io,isUnit:En,isString:Qr,isArray:sr,isMatrix:Je,isCollection:un,isDenseMatrix:Zs,isSparseMatrix:Fo,isRange:Du,isIndex:Xa,isBoolean:Av,isResultSet:Tv,isHelp:Oc,isFunction:Nv,isDate:Mv,isRegExp:Cv,isObject:$o,isMap:Ya,isPartitionedMap:tF,isObjectWrappingMap:rF,isNull:$v,isUndefined:Iv,isAccessorNode:ji,isArrayNode:ei,isAssignmentNode:Fv,isBlockNode:kv,isConditionalNode:Pv,isConstantNode:Lt,isFunctionAssignmentNode:ta,isFunctionNode:gi,isIndexNode:uo,isNode:Yt,isObjectNode:Ka,isOperatorNode:Lr,isParenthesisNode:ti,isRangeNode:Bv,isRelationalNode:Ov,isSymbolNode:Nr,isChain:Rc});i.config=cF(r,i.emit),i.expression={transform:{},mathWithTransform:{config:i.config}};var n=[],o=[];function a(c){if(gl(c))return c(i);var f=c[Object.keys(c)[0]];if(gl(f))return f(i);if(!oF(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=n.indexOf(c),p;return m===-1?(c.math===!0?p=c.factory(i.type,r,a,i.typed,i):p=c.factory(i.type,r,a,i.typed),n.push(c),o.push(p)):p=o[m],p}var s={};function l(){for(var c=arguments.length,f=new Array(c),m=0;m<c;m++)f[m]=arguments[m];return i.typed.apply(i.typed,f)}l.isTypedFunction=nq.default.isTypedFunction;var u=rq(l,a,i,s);return i.import=u,i.on("config",()=>{Object.values(s).forEach(c=>{c&&c.meta&&c.meta.recreateOnConfigChange&&u(c,{override:!0})})}),i.create=wb.bind(null,t),i.factory=N,i.import(Object.values(nF(t))),i.ArgumentsError=Bo,i.DimensionError=$t,i.IndexError=ii,i}function iq(){return wb(uA,{})}var Sb=class{api;internal;file;inputFieldParser;viewFieldParser;jsViewFieldParser;buttonParser;bindTargetParser;syntaxHighlighting;inputFieldFactory;viewFieldFactory;buttonActionRunner;buttonManager;metadataManager;mountableManager;math;build;constructor(){this.inputFieldParser=new mv(this),this.viewFieldParser=new _v(this),this.jsViewFieldParser=new dv(this),this.buttonParser=new Gg(this),this.bindTargetParser=new qh(this),this.syntaxHighlighting=new id(this),this.inputFieldFactory=new Mh(this),this.viewFieldFactory=new kh(this),this.buttonActionRunner=new _d(this),this.buttonManager=new Sd(this),this.metadataManager=new bc,this.mountableManager=new Vh,this.math=iq(),this.build="1.4.5".includes("canary")?"canary":"release"}setComponents(e){Object.assign(this,e)}setSettings(e){this.updateInternalSettings(e),this.saveSettings(e)}updateSettings(e){let r=this.getSettings();e(r),this.setSettings(r)}loadTemplates(){let e=this.getSettings(),r=this.inputFieldParser.parseTemplates(e.inputFieldTemplates);r.hasErrors()&&console.warn("meta-bind | failed to parse input field templates",r);let i=this.buttonManager.setButtonTemplates(e.buttonTemplates);i.hasErrors()&&console.warn("meta-bind | failed to parse button templates",i)}updateInternalSettings(e){fi.dateFormat=e.preferredDateFormat,WI(e.firstWeekday),this.loadTemplates()}destroy(){this.mountableManager.unload()}};var cf=class{id;manager;cache;constructor(e,r){this.id=e,this.manager=r,this.cache=new Map}validateStoragePath(e,r,i,n){return n.validateStoragePathAsFilePath(e,i)}resolveBindTargetScope(e,r,i){return e}getOrCreateCacheItem(e){let r=this.getCacheItemForStoragePath(e);return r===void 0&&(r=this.getDefaultCacheItem(e),this.cache.set(e,r)),r}subscribe(e){if(e.bindTarget===void 0)throw new jt({errorLevel:"CRITICAL",effect:"can not subscribe",cause:"subscription bind target undefined"});let r=this.getOrCreateCacheItem(e.bindTarget.storagePath);return r.subscriptions.push(e),r}unsubscribe(e){if(e.bindTarget===void 0)throw new jt({errorLevel:"CRITICAL",effect:"can not unsubscribe",cause:"subscription bind target undefined"});let r=this.cache.get(e.bindTarget.storagePath);if(r===void 0)throw new jt({errorLevel:"CRITICAL",effect:"can not unsubscribe",cause:"cache item does not exist"});return r.subscriptions=r.subscriptions.filter(i=>i.uuid!==e.uuid),r}getCacheItemForStoragePath(e){return this.cache.get(e)}onCycle(e){}getCacheItems(){return Array.from(this.cache.values())}shouldDelete(e){return!0}deleteCache(e){this.cache.delete(e.storagePath)}writeCache(e,r){let i=this.getOrCreateCacheItem(r.storagePath);return Sa.setAndCreate(i.data,r.storageProp,e),i}writeEntireCache(e,r){r.data=e}readCache(e){if(e.storageType!==this.id)throw new jt({errorLevel:"ERROR",effect:"can not read cache",cause:`Source "${e.storageType}" does not match`});let r=this.getCacheItemForStoragePath(e.storagePath);return r===void 0?Sa.tryGet(this.readExternal(e.storagePath),e.storageProp):this.readCacheItem(r,e.storageProp)}readCacheItem(e,r){return Sa.tryGet(e.data,r)}readEntireCacheItem(e){return e.data}};var Db=class extends cf{readExternal(e){return{}}getDefaultCacheItem(e){return{data:{},storagePath:e,...this.manager.getDefaultCacheItem()}}syncExternal(e){return Promise.resolve()}};var Eb=class{id;manager;cache;constructor(e,r){this.id=e,this.manager=r,this.cache={data:{},...this.manager.getDefaultCacheItem()}}getOrCreateCacheItem(e){return this.cache}validateStoragePath(e,r,i,n){if(r)throw new Pn("ERROR","Bind target validator","Failed to parse bind target. Bind target storage type 'global_memory' does not support a storage path.",i,e.position);return""}deleteCache(e){}getCacheItemForStoragePath(e){}getCacheItems(){return[this.cache]}onCycle(e){}readCache(e){return this.readCacheItem(this.cache,e.storageProp)}readCacheItem(e,r){return Sa.tryGet(e.data,r)}shouldDelete(e){return!1}subscribe(e){return this.cache.subscriptions.push(e),this.cache}syncExternal(e){return Promise.resolve()}unsubscribe(e){return this.cache.subscriptions=this.cache.subscriptions.filter(r=>r.uuid!==e.uuid),this.cache}writeCache(e,r){return Sa.setAndCreate(this.cache.data,r.storageProp,e),this.cache}writeEntireCache(e,r){r.data=e}readEntireCacheItem(e){return e.data}},Ab=class{id;manager;constructor(e,r){this.id=e,this.manager=r}getOrCreateCacheItem(e){throw new jt({errorLevel:"CRITICAL",effect:"action not permitted",cause:"source 'scope' should have no cache items or subscriptions"})}validateStoragePath(e,r,i,n){if(r)throw new Pn("ERROR","Bind Target Validator","Failed to parse bind target. Bind target storage type 'scope' does not support a storage path.",i,e.position);return""}deleteCache(e){}getCacheItemForStoragePath(e){}getCacheItems(){return[]}onCycle(e){}readCache(e){}readCacheItem(e,r){}shouldDelete(e){return!0}subscribe(e){throw new jt({errorLevel:"CRITICAL",effect:"action not permitted",cause:"source 'scope' should have no cache items or subscriptions"})}syncExternal(e){return Promise.resolve()}unsubscribe(e){throw new jt({errorLevel:"CRITICAL",effect:"action not permitted",cause:"source 'scope' should have no cache items or subscriptions"})}writeCache(e,r){throw new jt({errorLevel:"CRITICAL",effect:"action not permitted",cause:"source 'scope' should have no cache items or subscriptions"})}writeEntireCache(e,r){}readEntireCacheItem(e){throw new jt({errorLevel:"CRITICAL",effect:"action not permitted",cause:"source 'scope' should have no cache items or subscriptions"})}};function Tb(t){var e=t.statementIndent,r=t.jsonld,i=t.json||r,n=t.typescript,o=t.wordCharacters||/[\w$\xa1-\uffff]/,a=function(){function z(Fn){return{type:Fn,style:"keyword"}}var te=z("keyword a"),$e=z("keyword b"),et=z("keyword c"),qe=z("keyword d"),qt=z("operator"),$r={type:"atom",style:"atom"};return{if:z("if"),while:te,with:te,else:$e,do:$e,try:$e,finally:$e,return:qe,break:qe,continue:qe,new:z("new"),delete:et,void:et,throw:et,debugger:z("debugger"),var:z("var"),const:z("var"),let:z("var"),function:z("function"),catch:z("catch"),for:z("for"),switch:z("switch"),case:z("case"),default:z("default"),in:qt,typeof:qt,instanceof:qt,true:$r,false:$r,null:$r,undefined:$r,NaN:$r,Infinity:$r,this:z("this"),class:z("class"),super:z("atom"),yield:et,export:z("export"),import:z("import"),extends:et,await:et}}(),s=/[+\-*&%=<>!?|~^@]/,l=/^@(context|id|value|language|type|container|list|set|reverse|index|base|vocab|graph)"/;function u(z){for(var te=!1,$e,et=!1;($e=z.next())!=null;){if(!te){if($e=="/"&&!et)return;$e=="["?et=!0:et&&$e=="]"&&(et=!1)}te=!te&&$e=="\\"}}var c,f;function m(z,te,$e){return c=z,f=$e,te}function p(z,te){var $e=z.next();if($e=='"'||$e=="'")return te.tokenize=d($e),te.tokenize(z,te);if($e=="."&&z.match(/^\d[\d_]*(?:[eE][+\-]?[\d_]+)?/))return m("number","number");if($e=="."&&z.match(".."))return m("spread","meta");if(/[\[\]{}\(\),;\:\.]/.test($e))return m($e);if($e=="="&&z.eat(">"))return m("=>","operator");if($e=="0"&&z.match(/^(?:x[\dA-Fa-f_]+|o[0-7_]+|b[01_]+)n?/))return m("number","number");if(/\d/.test($e))return z.match(/^[\d_]*(?:n|(?:\.[\d_]*)?(?:[eE][+\-]?[\d_]+)?)?/),m("number","number");if($e=="/")return z.eat("*")?(te.tokenize=h,h(z,te)):z.eat("/")?(z.skipToEnd(),m("comment","comment")):tn(z,te,1)?(u(z),z.match(/^\b(([gimyus])(?![gimyus]*\2))+\b/),m("regexp","string.special")):(z.eat("="),m("operator","operator",z.current()));if($e=="`")return te.tokenize=v,v(z,te);if($e=="#"&&z.peek()=="!")return z.skipToEnd(),m("meta","meta");if($e=="#"&&z.eatWhile(o))return m("variable","property");if($e=="<"&&z.match("!--")||$e=="-"&&z.match("->")&&!/\S/.test(z.string.slice(0,z.start)))return z.skipToEnd(),m("comment","comment");if(s.test($e))return($e!=">"||!te.lexical||te.lexical.type!=">")&&(z.eat("=")?($e=="!"||$e=="=")&&z.eat("="):/[<>*+\-|&?]/.test($e)&&(z.eat($e),$e==">"&&z.eat($e))),$e=="?"&&z.eat(".")?m("."):m("operator","operator",z.current());if(o.test($e)){z.eatWhile(o);var et=z.current();if(te.lastType!="."){if(a.propertyIsEnumerable(et)){var qe=a[et];return m(qe.type,qe.style,et)}if(et=="async"&&z.match(/^(\s|\/\*([^*]|\*(?!\/))*?\*\/)*[\[\(\w]/,!1))return m("async","keyword",et)}return m("variable","variable",et)}}function d(z){return function(te,$e){var et=!1,qe;if(r&&te.peek()=="@"&&te.match(l))return $e.tokenize=p,m("jsonld-keyword","meta");for(;(qe=te.next())!=null&&!(qe==z&&!et);)et=!et&&qe=="\\";return et||($e.tokenize=p),m("string","string")}}function h(z,te){for(var $e=!1,et;et=z.next();){if(et=="/"&&$e){te.tokenize=p;break}$e=et=="*"}return m("comment","comment")}function v(z,te){for(var $e=!1,et;(et=z.next())!=null;){if(!$e&&(et=="`"||et=="$"&&z.eat("{"))){te.tokenize=p;break}$e=!$e&&et=="\\"}return m("quasi","string.special",z.current())}var y="([{}])";function S(z,te){te.fatArrowAt&&(te.fatArrowAt=null);var $e=z.string.indexOf("=>",z.start);if(!($e<0)){if(n){var et=/:\s*(?:\w+(?:<[^>]*>|\[\])?|\{[^}]*\})\s*$/.exec(z.string.slice(z.start,$e));et&&($e=et.index)}for(var qe=0,qt=!1,$r=$e-1;$r>=0;--$r){var Fn=z.string.charAt($r),kn=y.indexOf(Fn);if(kn>=0&&kn<3){if(!qe){++$r;break}if(--qe==0){Fn=="("&&(qt=!0);break}}else if(kn>=3&&kn<6)++qe;else if(o.test(Fn))qt=!0;else if(/["'\/`]/.test(Fn))for(;;--$r){if($r==0)return;var us=z.string.charAt($r-1);if(us==Fn&&z.string.charAt($r-2)!="\\"){$r--;break}}else if(qt&&!qe){++$r;break}}qt&&!qe&&(te.fatArrowAt=$r)}}var b={atom:!0,number:!0,variable:!0,string:!0,regexp:!0,this:!0,import:!0,"jsonld-keyword":!0};function _(z,te,$e,et,qe,qt){this.indented=z,this.column=te,this.type=$e,this.prev=qe,this.info=qt,et!=null&&(this.align=et)}function w(z,te){for(var $e=z.localVars;$e;$e=$e.next)if($e.name==te)return!0;for(var et=z.context;et;et=et.prev)for(var $e=et.vars;$e;$e=$e.next)if($e.name==te)return!0}function x(z,te,$e,et,qe){var qt=z.cc;for(E.state=z,E.stream=qe,E.marked=null,E.cc=qt,E.style=te,z.lexical.hasOwnProperty("align")||(z.lexical.align=!0);;){var $r=qt.length?qt.pop():i?xe:Z;if($r($e,et)){for(;qt.length&&qt[qt.length-1].lex;)qt.pop()();return E.marked?E.marked:$e=="variable"&&w(z,et)?"variableName.local":te}}}var E={state:null,column:null,marked:null,cc:null};function T(){for(var z=arguments.length-1;z>=0;z--)E.cc.push(arguments[z])}function D(){return T.apply(null,arguments),!0}function M(z,te){for(var $e=te;$e;$e=$e.next)if($e.name==z)return!0;return!1}function C(z){var te=E.state;if(E.marked="def",te.context){if(te.lexical.info=="var"&&te.context&&te.context.block){var $e=$(z,te.context);if($e!=null){te.context=$e;return}}else if(!M(z,te.localVars)){te.localVars=new L(z,te.localVars);return}}t.globalVars&&!M(z,te.globalVars)&&(te.globalVars=new L(z,te.globalVars))}function $(z,te){if(te)if(te.block){var $e=$(z,te.prev);return $e?$e==te.prev?te:new R($e,te.vars,!0):null}else return M(z,te.vars)?te:new R(te.prev,new L(z,te.vars),!1);else return null}function O(z){return z=="public"||z=="private"||z=="protected"||z=="abstract"||z=="readonly"}function R(z,te,$e){this.prev=z,this.vars=te,this.block=$e}function L(z,te){this.name=z,this.next=te}var k=new L("this",new L("arguments",null));function V(){E.state.context=new R(E.state.context,E.state.localVars,!1),E.state.localVars=k}function J(){E.state.context=new R(E.state.context,E.state.localVars,!0),E.state.localVars=null}V.lex=J.lex=!0;function W(){E.state.localVars=E.state.context.vars,E.state.context=E.state.context.prev}W.lex=!0;function Q(z,te){var $e=function(){var et=E.state,qe=et.indented;if(et.lexical.type=="stat")qe=et.lexical.indented;else for(var qt=et.lexical;qt&&qt.type==")"&&qt.align;qt=qt.prev)qe=qt.indented;et.lexical=new _(qe,E.stream.column(),z,null,et.lexical,te)};return $e.lex=!0,$e}function ie(){var z=E.state;z.lexical.prev&&(z.lexical.type==")"&&(z.indented=z.lexical.indented),z.lexical=z.lexical.prev)}ie.lex=!0;function B(z){function te($e){return $e==z?D():z==";"||$e=="}"||$e==")"||$e=="]"?T():D(te)}return te}function Z(z,te){return z=="var"?D(Q("vardef",te),lr,B(";"),ie):z=="keyword a"?D(Q("form"),be,Z,ie):z=="keyword b"?D(Q("form"),Z,ie):z=="keyword d"?E.stream.match(/^\s*$/,!1)?D():D(Q("stat"),K,B(";"),ie):z=="debugger"?D(B(";")):z=="{"?D(Q("}"),J,He,ie,W):z==";"?D():z=="if"?(E.state.lexical.info=="else"&&E.state.cc[E.state.cc.length-1]==ie&&E.state.cc.pop()(),D(Q("form"),be,Z,ie,cr)):z=="function"?D(Vo):z=="for"?D(Q("form"),J,tu,Z,W,ie):z=="class"||n&&te=="interface"?(E.marked="keyword",D(Q("form",z=="class"?z:te),ln,ie)):z=="variable"?n&&te=="declare"?(E.marked="keyword",D(Z)):n&&(te=="module"||te=="enum"||te=="type")&&E.stream.match(/^\s*\w/,!1)?(E.marked="keyword",te=="enum"?D(Bl):te=="type"?D(Nn,B("operator"),ce,B(";")):D(Q("form"),Ve,B("{"),Q("}"),He,ie,ie)):n&&te=="namespace"?(E.marked="keyword",D(Q("form"),xe,Z,ie)):n&&te=="abstract"?(E.marked="keyword",D(Z)):D(Q("stat"),ut):z=="switch"?D(Q("form"),be,B("{"),Q("}","switch"),J,He,ie,ie,W):z=="case"?D(xe,B(":")):z=="default"?D(B(":")):z=="catch"?D(Q("form"),V,q,Z,ie,W):z=="export"?D(Q("stat"),vf,ie):z=="import"?D(Q("stat"),as,ie):z=="async"?D(Z):te=="@"?D(xe,Z):T(Q("stat"),xe,B(";"),ie)}function q(z){if(z=="(")return D(qn,B(")"))}function xe(z,te){return G(z,te,!1)}function de(z,te){return G(z,te,!0)}function be(z){return z!="("?T():D(Q(")"),K,B(")"),ie)}function G(z,te,$e){if(E.state.fatArrowAt==E.stream.start){var et=$e?Oe:_e;if(z=="(")return D(V,Q(")"),Ee(qn,")"),ie,B("=>"),et,W);if(z=="variable")return T(V,Ve,B("=>"),et,W)}var qe=$e?ae:re;return b.hasOwnProperty(z)?D(qe):z=="function"?D(Vo,qe):z=="class"||n&&te=="interface"?(E.marked="keyword",D(Q("form"),Wi,ie)):z=="keyword c"||z=="async"?D($e?de:xe):z=="("?D(Q(")"),K,B(")"),ie,qe):z=="operator"||z=="spread"?D($e?de:xe):z=="["?D(Q("]"),Pl,ie,qe):z=="{"?Ue(oe,"}",null,qe):z=="quasi"?T(le,qe):z=="new"?D(st($e)):D()}function K(z){return z.match(/[;\}\)\],]/)?T():T(xe)}function re(z,te){return z==","?D(K):ae(z,te,!1)}function ae(z,te,$e){var et=$e==!1?re:ae,qe=$e==!1?xe:de;if(z=="=>")return D(V,$e?Oe:_e,W);if(z=="operator")return/\+\+|--/.test(te)||n&&te=="!"?D(et):n&&te=="<"&&E.stream.match(/^([^<>]|<[^<>]*>)*>\s*\(/,!1)?D(Q(">"),Ee(ce,">"),ie,et):te=="?"?D(xe,B(":"),qe):D(qe);if(z=="quasi")return T(le,et);if(z!=";"){if(z=="(")return Ue(de,")","call",et);if(z==".")return D(H,et);if(z=="[")return D(Q("]"),K,B("]"),ie,et);if(n&&te=="as")return E.marked="keyword",D(ce,et);if(z=="regexp")return E.state.lastType=E.marked="operator",E.stream.backUp(E.stream.pos-E.stream.start-1),D(qe)}}function le(z,te){return z!="quasi"?T():te.slice(te.length-2)!="${"?D(le):D(K,Se)}function Se(z){if(z=="}")return E.marked="string.special",E.state.tokenize=v,D(le)}function _e(z){return S(E.stream,E.state),T(z=="{"?Z:xe)}function Oe(z){return S(E.stream,E.state),T(z=="{"?Z:de)}function st(z){return function(te){return te=="."?D(z?Qe:yt):te=="variable"&&n?D(Ne,z?ae:re):T(z?de:xe)}}function yt(z,te){if(te=="target")return E.marked="keyword",D(re)}function Qe(z,te){if(te=="target")return E.marked="keyword",D(ae)}function ut(z){return z==":"?D(ie,Z):T(re,B(";"),ie)}function H(z){if(z=="variable")return E.marked="property",D()}function oe(z,te){if(z=="async")return E.marked="property",D(oe);if(z=="variable"||E.style=="keyword"){if(E.marked="property",te=="get"||te=="set")return D(ve);var $e;return n&&E.state.fatArrowAt==E.stream.start&&($e=E.stream.match(/^\s*:\s*/,!1))&&(E.state.fatArrowAt=E.stream.pos+$e[0].length),D(De)}else{if(z=="number"||z=="string")return E.marked=r?"property":E.style+" property",D(De);if(z=="jsonld-keyword")return D(De);if(n&&O(te))return E.marked="keyword",D(oe);if(z=="[")return D(xe,nt,B("]"),De);if(z=="spread")return D(de,De);if(te=="*")return E.marked="keyword",D(oe);if(z==":")return T(De)}}function ve(z){return z!="variable"?T(De):(E.marked="property",D(Vo))}function De(z){if(z==":")return D(de);if(z=="(")return T(Vo)}function Ee(z,te,$e){function et(qe,qt){if($e?$e.indexOf(qe)>-1:qe==","){var $r=E.state.lexical;return $r.info=="call"&&($r.pos=($r.pos||0)+1),D(function(Fn,kn){return Fn==te||kn==te?T():T(z)},et)}return qe==te||qt==te?D():$e&&$e.indexOf(";")>-1?T(z):D(B(te))}return function(qe,qt){return qe==te||qt==te?D():T(z,et)}}function Ue(z,te,$e){for(var et=3;et<arguments.length;et++)E.cc.push(arguments[et]);return D(Q(te,$e),Ee(z,te),ie)}function He(z){return z=="}"?D():T(Z,He)}function nt(z,te){if(n){if(z==":")return D(ce);if(te=="?")return D(nt)}}function ke(z,te){if(n&&(z==":"||te=="in"))return D(ce)}function Y(z){if(n&&z==":")return E.stream.match(/^\s*\w+\s+is\b/,!1)?D(xe,me,ce):D(ce)}function me(z,te){if(te=="is")return E.marked="keyword",D()}function ce(z,te){if(te=="keyof"||te=="typeof"||te=="infer"||te=="readonly")return E.marked="keyword",D(te=="typeof"?de:ce);if(z=="variable"||te=="void")return E.marked="type",D(ne);if(te=="|"||te=="&")return D(ce);if(z=="string"||z=="number"||z=="atom")return D(ne);if(z=="[")return D(Q("]"),Ee(ce,"]",","),ie,ne);if(z=="{")return D(Q("}"),Pe,ie,ne);if(z=="(")return D(Ee(X,")"),Ce,ne);if(z=="<")return D(Ee(ce,">"),ce);if(z=="quasi")return T(We,ne)}function Ce(z){if(z=="=>")return D(ce)}function Pe(z){return z.match(/[\}\)\]]/)?D():z==","||z==";"?D(Pe):T(we,Pe)}function we(z,te){if(z=="variable"||E.style=="keyword")return E.marked="property",D(we);if(te=="?"||z=="number"||z=="string")return D(we);if(z==":")return D(ce);if(z=="[")return D(B("variable"),ke,B("]"),we);if(z=="(")return T(go,we);if(!z.match(/[;\}\)\],]/))return D()}function We(z,te){return z!="quasi"?T():te.slice(te.length-2)!="${"?D(We):D(ce,I)}function I(z){if(z=="}")return E.marked="string.special",E.state.tokenize=v,D(We)}function X(z,te){return z=="variable"&&E.stream.match(/^\s*[?:]/,!1)||te=="?"?D(X):z==":"?D(ce):z=="spread"?D(X):T(ce)}function ne(z,te){if(te=="<")return D(Q(">"),Ee(ce,">"),ie,ne);if(te=="|"||z=="."||te=="&")return D(ce);if(z=="[")return D(ce,B("]"),ne);if(te=="extends"||te=="implements")return E.marked="keyword",D(ce);if(te=="?")return D(ce,B(":"),ce)}function Ne(z,te){if(te=="<")return D(Q(">"),Ee(ce,">"),ie,ne)}function Xe(){return T(ce,gt)}function gt(z,te){if(te=="=")return D(ce)}function lr(z,te){return te=="enum"?(E.marked="keyword",D(Bl)):T(Ve,nt,en,Vn)}function Ve(z,te){if(n&&O(te))return E.marked="keyword",D(Ve);if(z=="variable")return C(te),D();if(z=="spread")return D(Ve);if(z=="[")return Ue(ki,"]");if(z=="{")return Ue(yi,"}")}function yi(z,te){return z=="variable"&&!E.stream.match(/^\s*:/,!1)?(C(te),D(en)):(z=="variable"&&(E.marked="property"),z=="spread"?D(Ve):z=="}"?T():z=="["?D(xe,B("]"),B(":"),yi):D(B(":"),Ve,en))}function ki(){return T(Ve,en)}function en(z,te){if(te=="=")return D(de)}function Vn(z){if(z==",")return D(lr)}function cr(z,te){if(z=="keyword b"&&te=="else")return D(Q("form","else"),Z,ie)}function tu(z,te){if(te=="await")return D(tu);if(z=="(")return D(Q(")"),Cr,ie)}function Cr(z){return z=="var"?D(lr,Gi):z=="variable"?D(Gi):T(Gi)}function Gi(z,te){return z==")"?D():z==";"?D(Gi):te=="in"||te=="of"?(E.marked="keyword",D(xe,Gi)):T(xe,Gi)}function Vo(z,te){if(te=="*")return E.marked="keyword",D(Vo);if(z=="variable")return C(te),D(Vo);if(z=="(")return D(V,Q(")"),Ee(qn,")"),ie,Y,Z,W);if(n&&te=="<")return D(Q(">"),Ee(Xe,">"),ie,Vo)}function go(z,te){if(te=="*")return E.marked="keyword",D(go);if(z=="variable")return C(te),D(go);if(z=="(")return D(V,Q(")"),Ee(qn,")"),ie,Y,W);if(n&&te=="<")return D(Q(">"),Ee(Xe,">"),ie,go)}function Nn(z,te){if(z=="keyword"||z=="variable")return E.marked="type",D(Nn);if(te=="<")return D(Q(">"),Ee(Xe,">"),ie)}function qn(z,te){return te=="@"&&D(xe,qn),z=="spread"?D(qn):n&&O(te)?(E.marked="keyword",D(qn)):n&&z=="this"?D(nt,en):T(Ve,nt,en)}function Wi(z,te){return z=="variable"?ln(z,te):ai(z,te)}function ln(z,te){if(z=="variable")return C(te),D(ai)}function ai(z,te){if(te=="<")return D(Q(">"),Ee(Xe,">"),ie,ai);if(te=="extends"||te=="implements"||n&&z==",")return te=="implements"&&(E.marked="keyword"),D(n?ce:xe,ai);if(z=="{")return D(Q("}"),Mn,ie)}function Mn(z,te){if(z=="async"||z=="variable"&&(te=="static"||te=="get"||te=="set"||n&&O(te))&&E.stream.match(/^\s+#?[\w$\xa1-\uffff]/,!1))return E.marked="keyword",D(Mn);if(z=="variable"||E.style=="keyword")return E.marked="property",D(Hi,Mn);if(z=="number"||z=="string")return D(Hi,Mn);if(z=="[")return D(xe,nt,B("]"),Hi,Mn);if(te=="*")return E.marked="keyword",D(Mn);if(n&&z=="(")return T(go,Mn);if(z==";"||z==",")return D(Mn);if(z=="}")return D();if(te=="@")return D(xe,Mn)}function Hi(z,te){if(te=="!"||te=="?")return D(Hi);if(z==":")return D(ce,en);if(te=="=")return D(de);var $e=E.state.lexical.prev,et=$e&&$e.info=="interface";return T(et?go:Vo)}function vf(z,te){return te=="*"?(E.marked="keyword",D(fa,B(";"))):te=="default"?(E.marked="keyword",D(xe,B(";"))):z=="{"?D(Ee(Fl,"}"),fa,B(";")):T(Z)}function Fl(z,te){if(te=="as")return E.marked="keyword",D(B("variable"));if(z=="variable")return T(de,Fl)}function as(z){return z=="string"?D():z=="("?T(xe):z=="."?T(re):T(ss,kl,fa)}function ss(z,te){return z=="{"?Ue(ss,"}"):(z=="variable"&&C(te),te=="*"&&(E.marked="keyword"),D(Ma))}function kl(z){if(z==",")return D(ss,kl)}function Ma(z,te){if(te=="as")return E.marked="keyword",D(ss)}function fa(z,te){if(te=="from")return E.marked="keyword",D(xe)}function Pl(z){return z=="]"?D():T(Ee(de,"]"))}function Bl(){return T(Q("form"),Ve,B("{"),Q("}"),Ee(yf,"}"),ie,ie)}function yf(){return T(Ve,en)}function bf(z,te){return z.lastType=="operator"||z.lastType==","||s.test(te.charAt(0))||/[,.]/.test(te.charAt(0))}function tn(z,te,$e){return te.tokenize==p&&/^(?:operator|sof|keyword [bcd]|case|new|export|default|spread|[\[{}\(,;:]|=>)$/.test(te.lastType)||te.lastType=="quasi"&&/\{\s*$/.test(z.string.slice(0,z.pos-($e||0)))}return{name:t.name,startState:function(z){var te={tokenize:p,lastType:"sof",cc:[],lexical:new _(-z,0,"block",!1),localVars:t.localVars,context:t.localVars&&new R(null,null,!1),indented:0};return t.globalVars&&typeof t.globalVars=="object"&&(te.globalVars=t.globalVars),te},token:function(z,te){if(z.sol()&&(te.lexical.hasOwnProperty("align")||(te.lexical.align=!1),te.indented=z.indentation(),S(z,te)),te.tokenize!=h&&z.eatSpace())return null;var $e=te.tokenize(z,te);return c=="comment"?$e:(te.lastType=c=="operator"&&(f=="++"||f=="--")?"incdec":c,x(te,$e,c,f,z))},indent:function(z,te,$e){if(z.tokenize==h||z.tokenize==v)return null;if(z.tokenize!=p)return 0;var et=te&&te.charAt(0),qe=z.lexical,qt;if(!/^\s*else\b/.test(te))for(var $r=z.cc.length-1;$r>=0;--$r){var Fn=z.cc[$r];if(Fn==ie)qe=qe.prev;else if(Fn!=cr&&Fn!=W)break}for(;(qe.type=="stat"||qe.type=="form")&&(et=="}"||(qt=z.cc[z.cc.length-1])&&(qt==re||qt==ae)&&!/^[,\.=+\-*:?[\(]/.test(te));)qe=qe.prev;e&&qe.type==")"&&qe.prev.type=="stat"&&(qe=qe.prev);var kn=qe.type,us=et==kn;return kn=="vardef"?qe.indented+(z.lastType=="operator"||z.lastType==","?qe.info.length+1:0):kn=="form"&&et=="{"?qe.indented:kn=="form"?qe.indented+$e.unit:kn=="stat"?qe.indented+(bf(z,te)?e||$e.unit:0):qe.info=="switch"&&!us&&t.doubleIndentSwitch!=!1?qe.indented+(/^(?:case|default)\b/.test(te)?$e.unit:2*$e.unit):qe.align?qe.column+(us?0:1):qe.indented+(us?0:$e.unit)},languageData:{indentOnInput:/^\s*(?:case .*?:|default:|\{|\})$/,commentTokens:i?void 0:{line:"//",block:{open:"/*",close:"*/"}},closeBrackets:{brackets:["(","[","{","'",'"',"`"]},wordChars:"$"}}}var pm=Tb({name:"javascript"}),Obt=Tb({name:"json",json:!0}),Rbt=Tb({name:"json",jsonld:!0}),Lbt=Tb({name:"typescript",typescript:!0});var ole=["true","false","on","off","yes","no"],ale=new RegExp("\\b(("+ole.join(")|(")+"))$","i"),mm={name:"yaml",token:function(t,e){var r=t.peek(),i=e.escaped;if(e.escaped=!1,r=="#"&&(t.pos==0||/\s/.test(t.string.charAt(t.pos-1))))return t.skipToEnd(),"comment";if(t.match(/^('([^']|\\.)*'?|"([^"]|\\.)*"?)/))return"string";if(e.literal&&t.indentation()>e.keyCol)return t.skipToEnd(),"string";if(e.literal&&(e.literal=!1),t.sol()){if(e.keyCol=0,e.pair=!1,e.pairStart=!1,t.match("---")||t.match("..."))return"def";if(t.match(/^\s*-\s+/))return"meta"}if(t.match(/^(\{|\}|\[|\])/))return r=="{"?e.inlinePairs++:r=="}"?e.inlinePairs--:r=="["?e.inlineList++:e.inlineList--,"meta";if(e.inlineList>0&&!i&&r==",")return t.next(),"meta";if(e.inlinePairs>0&&!i&&r==",")return e.keyCol=0,e.pair=!1,e.pairStart=!1,t.next(),"meta";if(e.pairStart){if(t.match(/^\s*(\||\>)\s*/))return e.literal=!0,"meta";if(t.match(/^\s*(\&|\*)[a-z0-9\._-]+\b/i))return"variable";if(e.inlinePairs==0&&t.match(/^\s*-?[0-9\.\,]+\s?$/)||e.inlinePairs>0&&t.match(/^\s*-?[0-9\.\,]+\s?(?=(,|}))/))return"number";if(t.match(ale))return"keyword"}return!e.pair&&t.match(/^\s*(?:[,\[\]{}&*!|>'"%@`][^\s'":]|[^,\[\]{}#&*!|>'"%@`])[^#]*?(?=\s*:($|\s))/)?(e.pair=!0,e.keyCol=t.indentation(),"atom"):e.pair&&t.match(/^:\s*/)?(e.pairStart=!0,"meta"):(e.pairStart=!1,e.escaped=r=="\\",t.next(),null)},startState:function(){return{pair:!1,pairStart:!1,keyCol:0,inlinePairs:0,inlineList:0,literal:!1,escaped:!1}},languageData:{commentTokens:{line:"#"}}};function oq(t){if(!t.getSettings().enableSyntaxHighlighting)return;window.CodeMirror.defineMode("meta-bind-button",r=>({startState:()=>mm.startState?.(4),blankLine:n=>mm.blankLine?.(n,4),copyState:n=>mm.startState?.(4),token:(n,o)=>`line-HyperMD-codeblock ${mm.token?.(n,o)}`})),window.CodeMirror.defineMode("meta-bind-js-view",r=>({startState:()=>pm.startState?.(4),blankLine:n=>pm.blankLine?.(n,4),copyState:n=>pm.startState?.(4),token:(n,o)=>`line-HyperMD-codeblock ${pm.token?.(n,o)}`}));let e=/^\s*(```+|~~~+)/;window.CodeMirror.defineMode("meta-bind",r=>({startState:()=>({str:void 0,mdrcType:void 0,highlights:void 0,line:1}),token:(n,o)=>{if(o.str===void 0){let l=[n.string],u=1,c=n.lookAhead(u);for(;c!==void 0&&!e.test(c)&&(l.push(c),u+=1,c=n.lookAhead(u),!(u>100)););o.str=l.filter(m=>m.trim()!=="").join(`
`);let f=t.api.isInlineFieldDeclarationAndGetType(o.str.trim());f===void 0?o.highlights=new ys(o.str,[]):(o.fieldType=f,o.highlights=t.syntaxHighlighting.highlight(o.str,o.fieldType,!0))}let s=o.highlights.getHighlights().filter(l=>l.range.from.line===o.line).find(l=>l.range.from.column===n.pos+1);return s===void 0?(n.next(),n.eol()&&(o.line+=1),"line-HyperMD-codeblock"):(n.eatWhile(()=>n.pos+1<s.range.to.column)||n.next(),n.eol()&&(o.line+=1),`line-HyperMD-codeblock mb-highlight-${s.tokenClass}`)}}))}var fA=require("@codemirror/language"),Ml=require("@codemirror/view");var Nb=require("obsidian");var aq=require("obsidian");var ns=class{static checkSelectionOverlap(e,r,i){if(!e)return!1;for(let n of e.ranges)if(n.to>=r&&n.from<=i)return!0;return!1}static checkRangeOverlap(e,r,i,n){return e<=n&&i<=r}static getContent(e,r,i){return e.sliceDoc(r,i)}static getCurrentFile(e){return e.state.field(aq.editorInfoField).file}static existsDecorationBetween(e,r,i){let n=!1;return e.between(r,i,()=>{n=!0}),n}static existsDecorationOfTypeBetween(e,r,i,n){let o=!1;return e.between(i,n,(a,s,l)=>{l.spec.mb_widgetType===r&&(o=!0)}),o}};function sq(t){return Ml.ViewPlugin.fromClass(class{decorations;component;constructor(e){this.component=new Nb.Component,this.component.load(),this.decorations=this.renderWidgets(e)??Ml.Decoration.none,e.dom.addEventListener("click",r=>this.handleClick(r))}handleClick(e){if(e.target instanceof HTMLElement){let r=e.target;for(;r!==null;){if(r.classList.contains("mb-input")){e.stopPropagation();break}r=r.parentElement}}}isLivePreview(e){return e.field(Nb.editorLivePreviewField)}update(e){this.decorations=this.decorations.map(e.changes),this.updateWidgets(e.view)}updateWidgets(e){this.decorations=this.decorations.update({filter:(r,i,n)=>EM.anyMatch(e.visibleRanges,a=>ns.checkRangeOverlap(r,i,a.from,a.to))?!0:(n.spec.mb_unload?.(),!1)});for(let{from:r,to:i}of e.visibleRanges)(0,fA.syntaxTree)(e.state).iterate({from:r,to:i,enter:n=>{let o=n.node,a=this.getRenderInfo(e,o);if(!a.data)return;if(!a.data.widgetType){this.removeDecoration(o);return}let s=a.data;a.shouldRender?(this.removeDecoration(o,"field"),this.addDecoration(o,e,"field",s)):a.shouldHighlight?(this.removeDecoration(o),this.addDecoration(o,e,"highlight",s)):this.removeDecoration(o)}})}removeDecoration(e,r){this.decorations=this.decorations.update({filterFrom:e.from-1,filterTo:e.to+1,filter:(i,n,o)=>{let a=o.spec;return!a.mb_widgetType||r&&a.mb_widgetType===r?!0:(a.mb_unload?.(),!1)}})}addDecoration(e,r,i,n){if(ns.existsDecorationOfTypeBetween(this.decorations,i,e.from,e.to))return;let o=ns.getCurrentFile(r);if(!o)return;let a=this.renderWidget(e,i,n,o),s=Array.isArray(a)?a:[a];s.length!==0&&(this.decorations=this.decorations.update({add:s}))}getRenderInfo(e,r){let i=new Set(r.type.name?.split("_"));if(i.has("inline-code")&&!i.has("formatting")){let n=this.readNode(e,r.from,r.to);if(!n.trulyInline)return{shouldRender:!1,shouldHighlight:!1,data:void 0};let o=ns.checkSelectionOverlap(e.state.selection,r.from,r.to),a=this.isLivePreview(e.state),s=!o&&a;return{shouldRender:s,shouldHighlight:!s&&t.getSettings().enableSyntaxHighlighting,data:n}}return{shouldRender:!1,shouldHighlight:!1,data:void 0}}readNode(e,r,i){let n=!1;try{let a=ns.getContent(e.state,r-1,i+1);n=a.startsWith("`")&&a.endsWith("`")}catch{}let o=ns.getContent(e.state,r,i);return{content:o,widgetType:t.api.isInlineFieldDeclarationAndGetType(o),trulyInline:n}}renderWidgets(e){let r=ns.getCurrentFile(e);if(!r)return;let i=[];for(let n of e.visibleRanges)(0,fA.syntaxTree)(e.state).iterate({from:n.from,to:n.to,enter:o=>{let a=o.node,s=this.getRenderInfo(e,a);if(!s.data?.widgetType)return;let l=s.data,u;s.shouldRender?u=this.renderWidget(a,"field",l,r):s.shouldHighlight&&(u=this.renderWidget(a,"highlight",l,r)),u&&(Array.isArray(u)?i.push(...u):i.push(u))}});return Ml.Decoration.set(i,!0)}renderWidget(e,r,i,n){if(r==="field"){let o=t.api.constructMDRCWidget(i.widgetType,i.content,n.path,this.component);return Ml.Decoration.replace({widget:o,mb_widgetType:"field",mb_unload:()=>{o.renderChild?.unload()}}).range(e.from-1,e.to+1)}else return t.syntaxHighlighting.highlight(i.content,i.widgetType,!1).getHighlights().map(a=>Ml.Decoration.mark({class:`mb-highlight-${a.tokenClass}`,mb_widgetType:"highlight"}).range(e.from+a.range.from.index,e.from+a.range.to.index))}destroy(){this.component.unload()}},{decorations:e=>e.decorations})}var uq=require("obsidian");var dm=Ar(yo()),hm=Ar(Ji());var sle=hm.P.sequenceMap((t,e,r,i)=>{let n=parseInt(t),o=parseInt(e),a=parseInt(r);return new ca(n,o,a,i)},dm.P_UTILS.digits().skip(hm.P.string(".")),dm.P_UTILS.digits().skip(hm.P.string(".")),dm.P_UTILS.digits(),hm.P.string("-").then(dm.P_UTILS.remaining()).optional()),ca=class t{major;minor;patch;prerelease;constructor(e,r,i,n){this.major=e,this.minor=r,this.patch=i,this.prerelease=n}static fromString(e){return fn(sle,e)}static lessThan(e,r){return e.major<r.major?!0:e.major>r.major?!1:e.minor<r.minor?!0:e.minor>r.minor?!1:e.patch<r.patch?!0:e.patch>r.patch||e.prerelease===void 0?!1:r.prerelease===void 0?!0:e.prerelease<r.prerelease}static greaterThan(e,r){return t.lessThan(r,e)}static equals(e,r){return e.major===r.major&&e.minor===r.minor&&e.patch===r.patch&&e.prerelease===r.prerelease}toString(){return`${this.major}.${this.minor}.${this.patch}${this.prerelease===void 0?"":`-${this.prerelease}`}`}};var Mb=class{mb;dependencies;constructor(e,r){this.mb=e,this.dependencies=r}getDependency(e){let r=this.dependencies.find(i=>i.pluginId===e);if(r===void 0)throw new Af({errorLevel:"CRITICAL",effect:"Dependency violation detected",cause:`Attempted to access dependency ${e} which is not a listed dependency. Please report this error.`});return r}getPlugin(e){return this.mb.app.plugins.getPlugin(e)}throwPluginNotFound(e){this.throwDependencyError(`Plugin ${e} is required, but not installed. Please install the plugin.`)}throwDependencyError(e){throw new uq.Notice(`meta-bind | Dependency Error: ${e}`,0),new Af({errorLevel:"ERROR",effect:"Dependency violation detected",cause:e})}checkDependencyVersion(e,r){ca.lessThan(r,e.minVersion)&&this.throwDependencyError(`Plugin ${e.pluginId} is outdated. Required version is at least ${e.minVersion}, installed version is ${r}. Please update the plugin.`),e.maxVersion!==void 0&&(ca.greaterThan(r,e.maxVersion)||ca.equals(r,e.maxVersion))&&this.throwDependencyError(`Plugin ${e.pluginId} is too new. Required version is lower than ${e.maxVersion}, installed version is ${r}. Please downgrade the plugin.`)}checkDependency(e){let r=this.getDependency(e),i=this.getPlugin(e);if(i==null)throw this.throwPluginNotFound(e),Error("unreachable");let n=ca.fromString(i.manifest.version);return this.checkDependencyVersion(r,n),i}};var mq=require("obsidian");var lq={date:"date",datePicker:"datePicker",dateTime:"dateTime",editor:"editor",imageSuggester:'imageSuggester(optionQuery(""))',imageListSuggester:'imageListSuggester(optionQuery(""))',inlineList:"inlineList",inlineListSuggester:"inlineListSuggester(option(apple), option(banana), option(lemon))",inlineSelect:"inlineSelect(option(apple), option(banana), option(lemon))",list:"list",listSuggester:"listSuggester(option(apple), option(banana), option(lemon))",multiSelect:"multiSelect(option(apple), option(banana), option(lemon))",number:"number",progressBar:"progressBar",select:"select(option(apple), option(banana), option(lemon))",slider:"slider(addLabels)",suggester:"suggester(option(apple), option(banana), option(lemon))",text:"text",textArea:"textArea",time:"time",toggle:"toggle",invalid:""},pA={image:[{title:"Image",declaration:"VIEW[{globalMemory^MB_VF_image_example}][image]",display:"VIEW[{imageExampleProperty}][image]",inputField:'INPUT[imageSuggester(optionQuery("")):globalMemory^MB_VF_image_example]'}],link:[{title:"Link",declaration:"VIEW[{globalMemory^MB_VF_link_example}][link]",display:"VIEW[{linkExampleProperty}][link]",inputField:'INPUT[suggester(optionQuery("")):globalMemory^MB_VF_link_example]'}],math:[{title:"Math",declaration:"VIEW[{globalMemory^MB_VF_math_example} + 2][math]",display:"VIEW[{mathExampleProperty} + 2][math]",inputField:"INPUT[number:globalMemory^MB_VF_math_example]"}],text:[{title:"Text",declaration:"VIEW[some text {globalMemory^MB_VF_text_example}][text]",display:"VIEW[some text {textExampleProperty}][text]",inputField:"INPUT[text:globalMemory^MB_VF_text_example]"},{title:"Markdown",declaration:"VIEW[**some markdown** {globalMemory^MB_VF_text_markdown_example}][text(renderMarkdown)]",display:"VIEW[**some markdown** {markdownExampleProperty}][text(renderMarkdown)]",inputField:"INPUT[text:globalMemory^MB_VF_text_markdown_example]"}],invalid:[]};function cq(t){let e=[];for(let[r,i]of Object.entries(lq)){if(i==="")continue;let n=t.inputFieldParser.fromString(`INPUT[${i}]`),o=t.inputFieldParser.fromSimpleDeclaration({inputFieldType:void 0,templateName:void 0,bindTarget:void 0,arguments:[{name:"showcase",value:["true"]},{name:"title",value:[r]}]});n=t.inputFieldParser.merge(n,o),n.declarationString=`INPUT[${i}]`;let a=t.inputFieldParser.validate(n,"",void 0);e.push([r,a])}return e}function fq(t){let e=[];for(let[r,i]of Object.entries(lq)){if(i==="")continue;let n=r,o="";Dd[n].allowInline?o=`\`INPUT[${i}:exampleProperty]\``:o=`
\`\`\`meta-bind
INPUT[${i}:exampleProperty]
\`\`\`
`,e.push([n,o])}return e.sort((r,i)=>r[0].localeCompare(i[0])),e}function pq(t){let e=[];for(let r of Object.values(pA))for(let i of r)e.push([i.title,`\`${i.display}\``]);return e.sort((r,i)=>r[0].localeCompare(i[0])),e}function dq(t,e,r){let i=fq(r),n=pq(r);t.addItem(o=>{o.setTitle("Meta Bind"),o.setIcon("blocks");let a=o.setSubmenu();a.addItem(s=>{s.setTitle("Input Field");let l=s.setSubmenu();for(let[u,c]of i)l.addItem(f=>{f.setTitle(u),f.onClick(()=>Cb(e,c))})}),a.addItem(s=>{s.setTitle("View Field");let l=s.setSubmenu();for(let[u,c]of n)l.addItem(f=>{f.setTitle(u),f.onClick(()=>Cb(e,c))})}),a.addItem(s=>{s.setTitle("Inline Button"),s.onClick(()=>{Cb(e,"`BUTTON[example-id]`")})}),a.addItem(s=>{s.setTitle("Button"),s.onClick(()=>{r.internal.openButtonBuilderModal({onOkay:l=>{Cb(e,`\`\`\`meta-bind-button
${(0,mq.stringifyYaml)(l)}
\`\`\``)},submitText:"Insert"})})})})}function Cb(t,e){t.replaceSelection(e)}var Un=class extends Ti{mb;filePath;uuid;constructor(e,r,i){super(),this.mb=e,this.filePath=i,this.uuid=r}getUuid(){return this.uuid}getFilePath(){return this.filePath}onMount(e){this.mb.mountableManager.registerMountable(this)}onUnmount(e){this.mb.mountableManager.unregisterMountable(this)}};var ff=class{scope;constructor(e){this.scope=e}};var Lo=Rt()(ge.string()),pf=Rt()(ge.enum(Bi)),gm=Rt()(ge.enum(jl)),gq=Rt()(ge.enum(uu)),vq=Rt()(ge.any()),mf=Rt()(ge.instanceof(ff)),wxt=Rt()(ge.instanceof(bn)),Sxt=Rt()(xu()),Dxt=Rt()(ge.instanceof(Un)),yq=Rt()(ge.instanceof(Ti)),bq=Rt()(ge.instanceof(ou)),hq=Rt()(ge.object({index:ge.number(),line:ge.number(),column:ge.number()})),ule=Rt()(ge.object({from:hq,to:hq})),Fu=Rt()(ge.object({value:ge.string(),position:ule.optional()})),xq=Rt()(ge.object({name:Fu,value:Fu.array()})),lle=Rt()(ge.object({type:ge.nativeEnum(Vu),prop:Fu})),mA=Rt()(ge.object({storageType:Fu.optional(),storagePath:Fu.optional(),storageProp:lle.array(),listenToChildren:ge.boolean()})),Ext=Rt()(ge.object({declarationString:ge.string().optional(),inputFieldType:Fu.optional(),templateName:Fu.optional(),bindTarget:mA.optional(),arguments:xq.array(),errorCollection:ge.instanceof(rr)})),Axt=Rt()(ge.object({declarationString:ge.string().optional(),templateDeclaration:ge.array(ge.union([ge.string(),mA])).optional(),viewFieldType:Fu.optional(),arguments:xq.array(),writeToBindTarget:mA.optional(),errorCollection:ge.instanceof(rr)})),Ro=Rt()(ge.object({storageType:ge.string(),storagePath:ge.string(),storageProp:ge.instanceof(gu),listenToChildren:ge.boolean()})),_q=Rt()(ge.object({name:ge.string(),value:ge.string().array()})),Txt=Rt()(ge.object({type:ge.nativeEnum(Vu),prop:ge.string()})),wq=Rt()(ge.object({inputFieldType:gq.optional(),templateName:ge.string().optional(),bindTarget:Ro.optional(),arguments:_q.array().optional()})),Sq=Rt()(ge.object({viewFieldType:gq.optional(),templateDeclaration:ge.union([ge.string(),Ro]).array().optional(),arguments:_q.array().optional(),writeToBindTarget:Ro.optional()})),cle=Rt()(ge.object({bindTarget:Ro,name:ge.string()})),fle=Rt()(ge.object({bindTargetMappings:cle.array(),writeToBindTarget:Ro.optional(),code:ge.string()})),ple=Rt()(ge.object({referencedButtonIds:ge.string().array()})),Dq=Rt()(ge.object({renderChildType:pf,declaration:ge.union([ge.string(),wq]),scope:mf.optional()})),Eq=Rt()(ge.object({renderChildType:pf,declaration:ge.union([ge.string(),Sq]),scope:mf.optional()})),Aq=Rt()(ge.object({declaration:ge.union([ge.string(),fle])})),Tq=Rt()(ge.object({bindTarget:Ro,tableHead:ge.string().array(),columns:ge.array(ge.union([wq,Sq,ge.string()]))})),Nq=Rt()(ge.object({renderChildType:pf,declaration:ge.union([ge.string(),ple]),position:bq.optional()})),Mq=Rt()(ge.object({declaration:ge.union([ge.string(),Fc]),position:bq.optional(),isPreview:ge.boolean()})),Cq=Rt()(ge.object({depth:ge.number(),content:ge.string()}));var dle=(t,e)=>e(t,"left"),hle=ue("<button><!> </button>");function vm(t,e){Ae(e,!0);let r=pt(e,"variant",19,()=>"default"),i=pt(e,"disabled",7,!1),n=pt(e,"tooltip",3,""),o=pt(e,"label",3,""),a=pt(e,"icon",3,""),s=pt(e,"cssStyle",3,""),l=pt(e,"backgroundImage",3,""),u=pt(e,"error",3,!1),c=pt(e,"onclick",3,()=>{}),f=pt(e,"onauxclick",3,()=>{});async function m(b,_){if(!i()){i(!0);try{_==="left"?await c()(b):_==="middle"&&await f()(b)}catch(w){console.warn("failed to run button component on click",w)}finally{i(!1)}}}var p=hle();let d,h;p.__click=[dle,m];var v=he(p);{var y=b=>{Rr(b,{get mb(){return e.mb},get iconName(){return a()}})};ot(v,b=>{a()&&b(y)})}var S=fe(v);pe(p),ze((b,_)=>{d=zr(p,1,"mb-button-inner",null,d,b),h=mc(p,s(),h,_),lt(p,"aria-label",n()),p.disabled=i(),St(S,` ${o()??""}`)},[()=>({"mod-cta":r()==="primary","mod-warning":r()==="destructive","mod-plain":r()==="plain",disabled:i(),"mb-error":u()}),()=>({"background-image":l()?`url("${l()}")`:void 0})]),Ai("auxclick",p,b=>m(b,"middle")),ee(t,p),Te()}Ft(["click"]);var ku=class extends Ti{mb;config;filePath;isInline;position;buttonComponent;isInGroup;isPreview;constructor(e,r,i,n,o,a,s){super(),this.mb=e,this.config=r,this.filePath=i,this.isInline=n==="inline",this.position=o,this.isInGroup=a,this.isPreview=s}onMount(e){ht.empty(e),ht.removeAllClasses(e),ht.addClasses(e,["mb-button",this.isInline?"mb-button-inline":"mb-button-block"]),!(!this.isInline&&!this.isPreview&&!this.isInGroup&&(this.config.id&&this.mb.buttonManager.addButton(this.filePath,this.config),this.config.hidden))&&(this.config.class&&ht.addClasses(e,this.config.class.split(" ").filter(r=>r!=="")),this.buttonComponent=Fr(vm,{target:e,props:{mb:this.mb,icon:this.config.icon,variant:this.config.style,label:this.config.label,tooltip:Hx(this.config.tooltip)?this.config.tooltip:void 0,cssStyle:this.config.cssStyle,backgroundImage:Hx(this.config.backgroundImage)?this.mb.internal.imagePathToUri(this.config.backgroundImage):void 0,onclick:async r=>{await this.mb.buttonActionRunner.runButtonActions(this.config,this.filePath,this.getContext(),Cf.fromMouseEvent(r,"left"))},onauxclick:async r=>{await this.mb.buttonActionRunner.runButtonActions(this.config,this.filePath,this.getContext(),Cf.fromMouseEvent(r,"left"))}}}))}getContext(){return{position:this.position?.getPosition(),isInGroup:this.isInGroup,isInline:this.isInline}}onUnmount(){this.buttonComponent&&Dr(this.buttonComponent),!this.isInline&&!this.isPreview&&this.config?.id&&this.mb.buttonManager.removeButton(this.filePath,this.config.id)}};var $b=class extends Ti{mb;referencedIds;filePath;renderChildType;notePosition;constructor(e,r,i,n,o){super(),this.mb=e,this.referencedIds=r,this.filePath=i,this.renderChildType=n,this.notePosition=o}renderInitialButton(e,r){return ht.removeAllClasses(e),ht.addClasses(e,["mb-button",this.renderChildType==="inline"?"mb-button-inline":"mb-button-block"]),Fr(vm,{target:e,props:{mb:this.mb,variant:"default",label:"Button ID not Found",tooltip:`No button with id '${r}' found`,error:!0,onclick:async()=>{}}})}onMount(e){ht.empty(e),ht.addClasses(e,["mb-button-group",this.renderChildType==="inline"?"mb-button-group-inline":"mb-button-group-block"]);for(let r of this.referencedIds){let i=ht.createElement(e,"span"),n=this.renderInitialButton(i,r),o,a=this.mb.buttonManager.registerButtonLoadListener(this.filePath,r,s=>{n&&Dr(n),n=void 0,o=new ku(this.mb,s,this.filePath,this.renderChildType,this.notePosition,!0,!1),o.mount(i)});this.registerUnmountCb(()=>{n&&Dr(n),n=void 0,o?.unmount(),a()})}}onUnmount(e){ht.empty(e)}};var Ib=class extends Un{errorCollection;declaration;buttonField;renderChildType;position;constructor(e,r,i,n,o,a){super(e,r,i),this.declaration=n,this.errorCollection=new rr(this.getUuid()),this.errorCollection.merge(n.errorCollection),this.renderChildType=o,this.position=a}onMount(e){if(super.onMount(e),ht.removeAllClasses(e),this.declaration.errorCollection.isEmpty())try{this.buttonField=new $b(this.mb,this.declaration.referencedButtonIds,this.getFilePath(),this.renderChildType,this.position),this.buttonField.mount(e)}catch(r){this.errorCollection.add(r),this.renderErrorIndicator(e)}else this.renderErrorIndicator(e)}renderErrorIndicator(e){this.mb.internal.createErrorIndicator(e,{errorCollection:this.errorCollection,errorText:"Errors caused the creation of the field to fail. Sometimes one error only occurs because of another.",warningText:"Warnings will not cause the creation of a field to fail, but they indicate that a part of the declaration was invalid or uses deprecated functionality.",code:this.declaration.declarationString})}onUnmount(e){super.onUnmount(e),this.buttonField?.unmount(),bi(e,"inline button")}};var Fb=class extends Un{errorCollection;declaration;position;buttonField;isPreview;constructor(e,r,i,n,o,a){super(e,r,i),this.declaration=n,this.position=o,this.isPreview=a,this.errorCollection=new rr(this.getUuid()),this.errorCollection.merge(n.errorCollection)}onMount(e){if(super.onMount(e),ht.removeAllClasses(e),this.declaration.config&&this.declaration.errorCollection.isEmpty())try{this.buttonField=new ku(this.mb,this.declaration.config,this.getFilePath(),"block",this.position,!1,this.isPreview),this.buttonField.mount(e)}catch(r){this.errorCollection.add(r),this.renderErrorIndicator(e)}else this.renderErrorIndicator(e)}renderErrorIndicator(e){this.mb.internal.createErrorIndicator(e,{errorCollection:this.errorCollection,errorText:"Errors caused the creation of the field to fail. Sometimes one error only occurs because of another.",warningText:"Warnings will not cause the creation of a field to fail, but they indicate that a part of the declaration was invalid or uses deprecated functionality.",code:this.declaration.declarationString})}onUnmount(e){super.onUnmount(e),this.buttonField?.unmount(),bi(e,"button")}};var kb=class extends Un{depth;content;markdownUnloadCallback;constructor(e,r,i,n,o){super(e,r,i),this.depth=n,this.content=o}async parseContent(){let e=this.content.split(`
`).map(o=>o.trim()).filter(o=>o.length>0);if(e.length===0)return{content:""};if(e.length>1)return{error:"Embed may only contain one link"};let r=e[0],i=_n.parseLink(r);if(!i.internal)return{error:`${r} is not an internal link`};let n=this.mb.file.getPathByName(i.target,this.getFilePath());return n===void 0?{error:`"${i.target}" is not created yet`}:{content:await this.mb.file.read(n)}}exceedsMaxDepth(){return this.depth>Ed}createEmbedMessage(e,r){e.createSpan({text:r,cls:"mb-embed-message"})}async renderContent(e){try{if(this.exceedsMaxDepth()){this.createEmbedMessage(e,"Max embed depth exceeded");return}let r=await this.parseContent();if(r.error){this.createEmbedMessage(e,r.error);return}if(r.content===void 0){this.createEmbedMessage(e,"Embed content not found");return}let i=r.content.replace(/(```+|~~~+)meta-bind-embed.*/g,`$1meta-bind-embed-internal-${this.depth+1}`);this.markdownUnloadCallback=await this.mb.internal.renderMarkdown(i,e,this.getFilePath())}catch(r){let i=new rr("Embed");i.add(r),this.mb.internal.createErrorIndicator(e,{errorCollection:i})}}onMount(e){super.onMount(e),e.addClass("mb-embed"),this.renderContent(e)}onUnmount(e){super.onUnmount(e),e.removeClass("mb-embed"),this.markdownUnloadCallback?.(),bi(e,"Embed")}};var Pb=class extends Un{constructor(e,r,i){super(e,r,i)}onMount(e){super.onMount(e),ht.empty(e),ht.createElement(e,"span",{text:"[META_BIND] This folder has been excluded in the settings",class:"mb-error"})}onUnmount(e){super.onUnmount(e),ht.empty(e),bi(e,"Excluded")}};var df=class extends Un{renderChildType;errorCollection;inputField;declarationString;declaration;constructor(e,r,i,n,o){super(e,r,i),this.renderChildType=n,this.declaration=o,this.declarationString=o.declarationString,this.errorCollection=new rr(this.getUuid()),this.errorCollection.merge(o.errorCollection)}hasArgument(e){return this.getArguments(e).length>0}getArgument(e){return this.getArguments(e).at(0)}getArguments(e){if(this.declaration.errorCollection.hasErrors())throw new jt({errorLevel:"CRITICAL",effect:"can not retrieve arguments",cause:"inputFieldDeclaration has errors"});return this.declaration.argumentContainer.getAll(e)}getBindTarget(){return this.declaration.bindTarget}shouldAddCardContainer(){let e=this.declaration.inputFieldType==="select"||this.declaration.inputFieldType==="multiSelect"||this.declaration.inputFieldType==="list",r=this.hasArgument("showcase")||this.hasArgument("title");return this.renderChildType==="block"&&(e||r)}createContainer(e){if(this.shouldAddCardContainer()){let r=ht.createElement(e,"div");ht.addClass(r,"mb-card");let i=this.getArgument("title");return i&&ht.createElement(r,"h3",{text:i.value}),r}return e}addShowcase(e){if(this.getArgument("showcase")&&this.shouldAddCardContainer()){let i=ht.createElement(e,"code",{class:"mb-none"}),n=ht.createElement(i,"a",{text:this.declarationString,class:"mb-no-link"});n.href=Ht.linkToInputField(this.declaration.inputFieldType)}}createInputField(){if(!this.errorCollection.hasErrors())try{this.inputField=this.mb.inputFieldFactory.createInputField(this)}catch(e){this.errorCollection.add(e)}!this.errorCollection.hasErrors()&&!this.inputField&&this.errorCollection.add(new jt({errorLevel:"CRITICAL",effect:"can't render input field",cause:"input field is undefined"}))}createErrorIndicator(e){this.mb.internal.createErrorIndicator(e,{errorCollection:this.errorCollection,errorText:"Errors caused the creation of the field to fail. Sometimes one error only occurs because of another.",warningText:"Warnings will not cause the creation of a field to fail, but they indicate that a part of the declaration was invalid or uses deprecated functionality.",code:this.declarationString})}onMount(e){if(super.onMount(e),ht.empty(e),ht.addClass(e,"mb-input"),this.createInputField(),this.errorCollection.hasErrors()){this.createErrorIndicator(e);return}let r=this.createContainer(e);this.createErrorIndicator(r);let i=ht.createElement(r,"div",{class:"mb-input-wrapper"});this.inputField?.mount(i);let n=this.getArguments("class");for(let o of n)ht.addClasses(i,o.value);ht.addClass(i,`mb-input-type-${this.declaration.inputFieldType}`),this.renderChildType==="block"?ht.addClass(e,"mb-input-block"):ht.addClass(e,"mb-input-inline"),this.addShowcase(r)}onUnmount(e){super.onUnmount(e),this.inputField?.unmount(),bi(e,"input field")}};var gle=ue("<div></div>");function Pu(t,e){Ae(e,!0);let r,i;io(()=>{i?.unmount(),i=e.mountable,i.mount(r)}),hc(()=>{i?.unmount()});var n=gle();xa(n,o=>r=o,()=>r),ee(t,n),Te()}var vle=ue("<th> </th>"),yle=ue("<td><!></td>"),ble=ue('<td class="meta-bind-error">invalid data</td>'),xle=ue('<tr><!><td class="mb-html-table-button-cell"><!></td></tr>'),_le=ue('<div class="mb-table-wrapper"><table class="mb-html-table"><thead><tr><!><th class="mb-html-table-button-cell"></th></tr></thead><tbody></tbody></table></div> <!>',1);function dA(t,e){Ae(e,!0);let r=pt(e,"tableHead",19,()=>[]),i=ft(wt([]));function n(p){Re(i,p,!0)}var o=_le(),a=je(o),s=he(a),l=he(s),u=he(l),c=he(u);Wt(c,17,r,Kt,(p,d)=>{var h=vle(),v=he(h,!0);pe(h),ze(()=>St(v,U(d))),ee(p,h)}),Nt(),pe(u),pe(l);var f=fe(l);Wt(f,21,()=>U(i),p=>p.index,(p,d)=>{var h=xle(),v=he(h);{var y=w=>{var x=Or(),E=je(x);Wt(E,17,()=>U(d).cells,Kt,(T,D)=>{var M=yle(),C=he(M);Pu(C,{get mountable(){return U(D)}}),pe(M),ee(T,M)}),ee(w,x)},S=w=>{var x=ble();ze(()=>lt(x,"colspan",r().length)),ee(w,x)};ot(v,w=>{U(d).isValid?w(y):w(S,!1)})}var b=fe(v),_=he(b);Dt(_,{onclick:()=>e.table.removeColumn(U(d).index),children:(w,x)=>{Rr(w,{get mb(){return e.table.mb},iconName:"x"})},$$slots:{default:!0}}),pe(b),pe(h),ee(p,h)}),pe(f),pe(s),pe(a);var m=fe(a,2);return Dt(m,{onclick:()=>e.table.addColumn(),children:(p,d)=>{Nt();var h=Gt("Add Row");ee(p,h)},$$slots:{default:!0}}),ee(t,o),Te({updateTable:n})}function Bb(t){return new gu(t.map(e=>$f.tryParse(e).success?new zu("array",e):new zu("object",e)))}var Ob=class extends Un{bindTarget;tableHead;columns;tableComponent;inputSignal;metadataSubscription;constructor(e,r,i,n,o,a){super(e,r,i),this.bindTarget=n,this.tableHead=o,this.columns=a,this.inputSignal=new bn(void 0)}registerSelfToMetadataManager(){this.metadataSubscription=this.mb.metadataManager.subscribe(this.getUuid(),this.inputSignal,this.bindTarget,()=>this.unmount())}unregisterSelfFromMetadataManager(){this.metadataSubscription?.unsubscribe()}updateMetadataManager(e){this.metadataSubscription?.write(e)}getValue(){return this.parseTableData(this.metadataSubscription?.read())}parseTableData(e){return Array.isArray(e)?e:[]}updateDisplayValue(e){e=e??[];let r=[];for(let i=0;i<e.length;i++)if(typeof e[i]=="object"){let n=new ff({storageType:this.bindTarget.storageType,storageProp:this.bindTarget.storageProp.concat(Bb([i.toString()])),storagePath:this.bindTarget.storagePath,listenToChildren:!1}),o=this.columns.map(a=>{if(typeof a=="string")return this.mb.api.createInlineFieldFromString(a,this.getFilePath(),n,"inline");if("inputFieldType"in a)return this.mb.api.createInputFieldMountable(this.getFilePath(),{declaration:a,scope:n,renderChildType:"inline"});if("viewFieldType"in a)return this.mb.api.createViewFieldMountable(this.getFilePath(),{declaration:a,scope:n,renderChildType:"inline"});throw new Error(`Unknown column type: ${JSON.stringify(a)}`)});r.push({cells:o,index:i,value:e[i],isValid:!0})}else r.push({cells:[],index:i,value:e[i],isValid:!1});this.tableComponent?.updateTable(r)}removeColumn(e){let r=this.getValue();r.splice(e,1),this.updateDisplayValue(r),this.updateMetadataManager(r)}addColumn(){let e=this.getValue();e.push({}),this.updateDisplayValue(e),this.updateMetadataManager(e)}onMount(e){super.onMount(e),this.tableComponent=Fr(dA,{target:e,props:{table:this,tableHead:this.tableHead}}),this.inputSignal.registerListener({callback:r=>{this.updateDisplayValue(this.parseTableData(r))}}),this.registerSelfToMetadataManager()}onUnmount(e){super.onUnmount(e),this.unregisterSelfFromMetadataManager(),this.tableComponent&&Dr(this.tableComponent),bi(e,"table")}};var Rb=class extends Un{errorCollection;declarationString;declaration;variables;metadataSubscription;jsRenderer;constructor(e,r,i,n){super(e,r,i),this.declaration=n,this.declarationString=n.declarationString,this.errorCollection=new rr(this.getUuid()),this.errorCollection.merge(n.errorCollection),this.variables=[],this.buildVariables()}buildVariables(){if(this.errorCollection.isEmpty())try{for(let e of this.declaration.bindTargetMappings??[])this.variables.push({bindTargetDeclaration:e.bindTarget,metadataSignal:new bn(void 0),uuid:_r(),contextName:e.name})}catch(e){this.errorCollection.add(e)}}buildContext(){let e={};for(let r of this.variables??[])!r.contextName||!r.metadataSignal||(e[r.contextName]=r.metadataSignal.get());return e}async evaluate(){return this.jsRenderer?.evaluate({bound:this.buildContext()})}registerSelfToMetadataManager(){this.metadataSubscription=this.mb.metadataManager.subscribeDerived(this.getUuid(),this.declaration.writeToBindTarget,this.variables.map(e=>e.bindTargetDeclaration),this.variables.map(e=>e.metadataSignal),async()=>await this.evaluate(),()=>this.unmount())}unregisterSelfFromMetadataManager(){this.metadataSubscription?.unsubscribe()}createErrorIndicator(e){this.mb.internal.createErrorIndicator(e,{errorCollection:this.errorCollection,errorText:"Errors caused the creation of the field to fail. Sometimes one error only occurs because of another.",warningText:"Warnings will not cause the creation of a field to fail, but they indicate that a part of the declaration was invalid or uses deprecated functionality.",code:this.declarationString})}onMount(e){if(super.onMount(e),ht.addClass(e,"mb-view"),ht.empty(e),this.mb.internal.isJsEngineAvailable()||this.errorCollection.add(new da({errorLevel:"ERROR",effect:"can not create js view field",cause:"The JS Engine plugin is not installed and enabled."})),this.mb.getSettings().enableJs||this.errorCollection.add(new da({errorLevel:"CRITICAL",effect:"Can't evaluate expression.",cause:"JS evaluation is disabled in the plugin settings."})),this.createErrorIndicator(e),this.errorCollection.hasErrors())return;let r=document.createElement("div");ht.addClass(r,"mb-view-wrapper"),this.jsRenderer=this.mb.internal.createJsRenderer(r,this.getFilePath(),this.declaration.code,this.declaration.hidden),this.registerSelfToMetadataManager(),e.appendChild(r)}onUnmount(e){super.onUnmount(e),this.unregisterSelfFromMetadataManager(),bi(e,"js view field")}};var Lb=class extends Un{renderChildType;errorCollection;viewField;declarationString;declaration;constructor(e,r,i,n,o){super(e,r,i),this.renderChildType=n,this.declaration=o,this.declarationString=o.declarationString,this.errorCollection=new rr(this.getUuid()),this.errorCollection.merge(o.errorCollection)}hasArgument(e){return this.getArguments(e).length>0}getArgument(e){return this.getArguments(e).at(0)}getArguments(e){if(this.declaration.errorCollection.hasErrors())throw new jt({errorLevel:"ERROR",effect:"an not retrieve arguments",cause:"viewFieldDeclaration has errors"});return this.declaration.argumentContainer.getAll(e)}getDeclaration(){return this.declaration}createViewField(){if(!this.errorCollection.hasErrors())try{this.viewField=this.mb.viewFieldFactory.createViewField(this)}catch(e){this.errorCollection.add(e)}!this.errorCollection.hasErrors()&&!this.viewField&&this.errorCollection.add(new jt({errorLevel:"CRITICAL",effect:"can't render view field",cause:"view field is undefined"}))}createErrorIndicator(e){this.mb.internal.createErrorIndicator(e,{errorCollection:this.errorCollection,errorText:"Errors caused the creation of the field to fail. Sometimes one error only occurs because of another.",warningText:"Warnings will not cause the creation of a field to fail, but they indicate that a part of the declaration was invalid or uses deprecated functionality.",code:this.declarationString})}onMount(e){if(super.onMount(e),ht.empty(e),ht.addClass(e,"mb-view"),this.createViewField(),this.errorCollection.hasErrors()){this.createErrorIndicator(e);return}let r=document.createElement("div");ht.addClass(r,"mb-view-wrapper");try{this.viewField?.mount(r)}catch(n){this.errorCollection.add(n)}this.createErrorIndicator(e),e.append(r);let i=this.getArguments("class");for(let n of i)ht.addClasses(r,n.value);ht.addClass(r,`mb-view-type-${this.declaration.viewFieldType}`),this.renderChildType==="block"?ht.addClass(e,"mb-view-block"):ht.addClass(e,"mb-view-inline")}onUnmount(e){super.onUnmount(e),this.viewField?.unmount(),bi(e,"view field")}};var Ub=class{mb;constructor(e){this.mb=e}createField(e,r,i,n=!0){if(sn(ge.object({type:gm,filePath:Lo,options:ge.any(),honorExcludedSetting:ge.boolean()}),{type:e,filePath:r,options:i,honorExcludedSetting:n}),this.mb.file.isExcludedFromRendering(r)&&n)return this.createExcludedMountable(r);if(e==="INPUT")return this.createInputFieldMountable(r,i);if(e==="VIEW")return this.createViewFieldMountable(r,i);if(e==="JS_VIEW")return this.createJsViewFieldMountable(r,i);if(e==="TABLE")return this.createTableMountable(r,i);if(e==="BUTTON_GROUP")return this.createButtonGroupMountable(r,i);if(e==="BUTTON")return this.createButtonMountable(r,i);if(e==="EMBED")return this.createEmbedMountable(r,i);if(e==="EXCLUDED")return this.createExcludedMountable(r);throw new Error(`Unknown field type: ${e}`)}createInlineFieldFromString(e,r,i,n="inline",o,a=!0){sn(ge.object({fieldString:ge.string(),filePath:Lo,scope:mf.optional(),renderChildType:pf,honorExcludedSetting:ge.boolean()}),{fieldString:e,filePath:r,scope:i,renderChildType:n,honorExcludedSetting:a});let s=this.isInlineFieldDeclarationAndGetType(e);if(s===void 0)throw new jt({errorLevel:"CRITICAL",effect:"failed to create inline field",cause:`Invalid inline mdrc type "${s}"`});return this.createInlineFieldOfTypeFromString(s,e,r,i,n,o,a)}createInlineFieldOfTypeFromString(e,r,i,n,o="inline",a,s=!0){if(sn(ge.object({type:gm,declaration:ge.string(),filePath:Lo,scope:mf.optional(),renderChildType:pf,honorExcludedSetting:ge.boolean()}),{type:e,declaration:r,filePath:i,scope:n,renderChildType:o,honorExcludedSetting:s}),this.mb.file.isExcludedFromRendering(i)&&s)return this.createExcludedMountable(i);if(e==="INPUT")return this.createInputFieldMountable(i,{renderChildType:o,declaration:r,scope:n});if(e==="VIEW")return this.createViewFieldMountable(i,{renderChildType:o,declaration:r,scope:n});if(e==="BUTTON_GROUP")return this.createButtonGroupMountable(i,{renderChildType:o,declaration:r,position:a});throw new jt({errorLevel:"CRITICAL",effect:"failed to create inline field",cause:`Invalid inline mdrc type "${e}"`})}createInputFieldMountable(e,r){sn(ge.object({filePath:Lo,options:Dq}),{filePath:e,options:r});let i=_r(),n;return typeof r.declaration=="string"?n=this.mb.inputFieldParser.fromStringAndValidate(r.declaration,e,r.scope):n=this.mb.inputFieldParser.fromSimpleDeclarationAndValidate(r.declaration,e,r.scope),new df(this.mb,i,e,r.renderChildType,n)}createViewFieldMountable(e,r){sn(ge.object({filePath:Lo,options:Eq}),{filePath:e,options:r});let i=_r(),n;return typeof r.declaration=="string"?n=this.mb.viewFieldParser.fromStringAndValidate(r.declaration,e,r.scope):n=this.mb.viewFieldParser.fromSimpleDeclarationAndValidate(r.declaration,e,r.scope),new Lb(this.mb,i,e,r.renderChildType,n)}createJsViewFieldMountable(e,r){sn(ge.object({filePath:Lo,options:Aq}),{filePath:e,options:r});let i=_r(),n;return typeof r.declaration=="string"?n=this.mb.jsViewFieldParser.fromStringAndValidate(r.declaration,e):n=this.mb.jsViewFieldParser.fromSimpleDeclarationAndValidate(r.declaration,e),new Rb(this.mb,i,e,n)}createTableMountable(e,r){sn(ge.object({filePath:Lo,options:Tq}),{filePath:e,options:r});let i=_r();return new Ob(this.mb,i,e,r.bindTarget,r.tableHead,r.columns)}createButtonGroupMountable(e,r){sn(ge.object({filePath:Lo,options:Nq}),{filePath:e,options:r});let i=_r(),n;return typeof r.declaration=="string"?n=this.mb.buttonParser.fromGroupString(r.declaration):n=this.mb.buttonParser.validateGroup(r.declaration),new Ib(this.mb,i,e,n,r.renderChildType,r.position)}createButtonMountable(e,r){sn(ge.object({filePath:Lo,options:Mq}),{filePath:e,options:r});let i=_r(),n;return typeof r.declaration=="string"?n=this.mb.buttonParser.fromString(r.declaration):n=this.mb.buttonParser.validate(r.declaration),new Fb(this.mb,i,e,n,r.position,r.isPreview)}createEmbedMountable(e,r){sn(ge.object({filePath:Lo,options:Cq}),{filePath:e,options:r});let i=_r();return new kb(this.mb,i,e,r.depth,r.content)}createExcludedMountable(e){sn(ge.object({filePath:Lo}),{filePath:e});let r=_r();return new Pb(this.mb,r,e)}getInlineFieldDeclarationPrefix(e){if(sn(ge.object({fieldType:gm}),{fieldType:e}),e==="INPUT")return"INPUT";if(e==="VIEW")return"VIEW";if(e==="BUTTON_GROUP")return"BUTTON";throw new jt({errorLevel:"CRITICAL",effect:"failed to get declaration prefix",cause:`Invalid inline mdrc type "${e}"`})}isInlineFieldDeclaration(e,r){sn(ge.object({fieldType:gm,str:ge.string()}),{fieldType:e,str:r});let i=this.getInlineFieldDeclarationPrefix(e)+"[";return r.startsWith(i)&&r.endsWith("]")}isInlineFieldDeclarationAndGetType(e){if(sn(ge.object({str:ge.string()}),{str:e}),!!e.endsWith("]"))for(let r of Object.values(jl)){if(!jm(r))continue;let i=this.getInlineFieldDeclarationPrefix(r)+"[";if(e.startsWith(i))return r}}createSignal(e){return new bn(e)}createBindTarget(e,r,i,n=!1){return sn(ge.object({storageType:ge.string(),storagePath:ge.string(),property:ge.string().array(),listenToChildren:ge.boolean()}),{storageType:e,storagePath:r,property:i,listenToChildren:n}),{storageType:e,storagePath:r,storageProp:Bb(i),listenToChildren:n}}parseBindTarget(e,r,i){return sn(ge.object({declarationString:ge.string(),filePath:Lo,scope:mf.optional()}),{declarationString:e,filePath:r,scope:i}),this.mb.bindTargetParser.fromStringAndValidate(e,r,i)}setMetadata(e,r){sn(ge.object({bindTarget:Ro}),{bindTarget:e}),this.mb.metadataManager.write(r,e)}getMetadata(e){return sn(ge.object({bindTarget:Ro}),{bindTarget:e}),this.mb.metadataManager.read(e)}updateMetadata(e,r){sn(ge.object({bindTarget:Ro,updateFn:xu()}),{bindTarget:e,updateFn:r});let i=this.mb.metadataManager.read(e),n=r(i);this.mb.metadataManager.write(n,e)}subscribeToMetadata(e,r,i){sn(ge.object({bindTarget:Ro,lifecycleHook:this.mb.internal.getLifecycleHookValidator(),callback:xu()}),{bindTarget:e,lifecycleHook:r,callback:i});let n=_r(),o=new bn(void 0);o.registerListener({callback:i});let a=this.mb.metadataManager.subscribe(n,o,e,()=>{o.unregisterAllListeners()});r.register(()=>{a.unsubscribe()})}createNotePosition(e,r){return sn(ge.object({lineStart:ge.number(),lineEnd:ge.number()}),{lineStart:e,lineEnd:r}),new ou({lineStart:e,lineEnd:r})}mathJSImport(e,r){this.mb.math.import(e,r)}};var $q=require("@codemirror/view"),zb=class extends $q.WidgetType{mb;type;content;filePath;parentComponent;renderChild;constructor(e,r,i,n,o){super(),this.type=e,this.content=r,this.filePath=i,this.parentComponent=n,this.mb=o}eq(e){return e.content===this.content}toDOM(e){let r=document.createElement("span");r.addClass("cm-inline-code");let i=this.mb.api.createInlineFieldOfTypeFromString(this.type,this.content,this.filePath,void 0);return this.renderChild=this.mb.api.wrapInMDRC(i,r,this.parentComponent),r}destroy(e){this.renderChild?.unload(),super.destroy(e)}};var Iq=require("obsidian"),Vb=class extends Iq.MarkdownRenderChild{mb;mountable;constructor(e,r,i){super(i),this.mb=e,this.mountable=r,this.mountable.registerUnmountCb(()=>{this.unload()})}onload(){this.mountable.mount(this.containerEl),super.onload()}onunload(){this.mountable.isMounted()&&this.mountable.unmount(),super.onunload()}};function Fq(t){return t.dependencyManager.checkDependency("dataview").api}function Bu(t){return t.dependencyManager.checkDependency("js-engine").api}function hA(t){return t.dependencyManager.checkDependency("templater-obsidian").templater}var wle=ge.object({addChild:xu()}),qb=class extends Ub{omb;constructor(e){super(e),this.omb=e}wrapInMDRC(e,r,i){sn(ge.object({field:yq,containerEl:vq,component:wle}),{field:e,containerEl:r,component:i});let n=new Vb(this.omb,e,r);return i.addChild(n),n}constructMDRCWidget(e,r,i,n){if(jm(e))return new zb(e,r,i,n,this.omb);throw new jt({errorLevel:"CRITICAL",effect:"failed to construct mdrc",cause:`Invalid inline field type "${e}"`})}reactiveMetadata(e,r,i){sn(ge.object({bindTargets:Ro.array(),lifecycleHook:this.mb.internal.getLifecycleHookValidator(),callback:xu()}),{bindTargets:e,lifecycleHook:r,callback:i});let n=Bu(this.omb),o=_r(),a=e.map(()=>new bn(void 0)),s=()=>Promise.resolve(),l=this.mb.metadataManager.subscribeEffect(o,e,a,()=>s(),()=>{});r.register(()=>l.unsubscribe());let u=n.reactive(i,...a.map(c=>c.get()));return s=()=>u.refresh(...a.map(c=>c.get())),u}};var Cl=require("obsidian");var jb=class{mb;constructor(e){this.mb=e}getFrontmatterLocation(e){let r=e.split(`
`);if(r.at(0)==="---"){for(let i=1;i<r.length;i++)if(r.at(i)==="---")return{lineStart:1,lineEnd:i+1}}}isExcludedFromRendering(e){for(let r of this.mb.getSettings().excludedFolders)if(e.startsWith(r))return!0;return!1}resolveFilePathLike(e,r){let i=_n.isLink(e)?_n.parseLink(e).target:e,n=this.mb.file.getPathByName(i,r);if(n===void 0)throw new ma({errorLevel:"ERROR",cause:`Could not find a file that matches "${e}".`,effect:`Could not resolve path or link "${e}" relative to "${r}".`});return n}createLineNumberContext(e,r){let n=e.split(`
`).length,o=this.mb.file.getFrontmatterLocation(e);return{fileStart:1,fileEnd:n,frontmatterStart:o?o.lineStart:1,frontmatterEnd:o?o.lineEnd:1,contentStart:o?o.lineEnd+1:1,contentEnd:n,selfStart:r?r.lineStart+1:void 0,selfEnd:r?r.lineEnd+1:void 0}}};var Zb=class extends jb{app;constructor(e){super(e),this.app=e.app}async read(e){let r=this.app.vault.getAbstractFileByPath(e);if(!r||!(r instanceof Cl.TFile))throw new Error(`file not found: ${e}`);return this.app.vault.cachedRead(r)}async write(e,r){let i=this.app.vault.getFileByPath(e);if(!i)throw new Error(`file not found: ${e}`);await this.app.vault.modify(i,r)}async exists(e){return this.app.vault.getFileByPath(e)!==null}async atomicModify(e,r){let i=this.app.vault.getFileByPath(e);if(!i)throw new Error(`file not found: ${e}`);await this.app.vault.process(i,n=>r(n))}async create(e,r,i,n=!1,o=!1){let a=this.app.vault.getAvailablePath((0,Cl.normalizePath)(e+"/"+r),i),s=await this.app.vault.create(a,"");return n&&await this.openInSourceMode(s,o),s.path}getAllFiles(){return this.app.vault.getAllLoadedFiles().filter(e=>e instanceof Cl.TFile).map(e=>e.path)}getAllFolders(){return this.app.vault.getAllLoadedFiles().filter(e=>e instanceof Cl.TFolder).map(e=>e.path)}async open(e,r,i){this.app.workspace.openLinkText(e,r,i)}async openInSourceMode(e,r){let i=this.app.workspace.getLeaf(r?"tab":!1);i&&await i.openFile(e,{state:{mode:"source"}})}getPathByName(e,r=""){return this.app.metadataCache.getFirstLinkpathDest(e,r)?.path}};var In=require("obsidian");var Gb=Ar(ip());var kq=Ar(ip());var Sle=ue('<div class="mb-calendar-cell mb-calendar-header-cell"><span class="mb-calendar-cell-text"> </span></div>'),Dle=(t,e,r)=>e(U(r)),Ele=(t,e,r)=>e(t,U(r)),Ale=ue('<div role="button" tabindex="0"><span class="mb-calendar-cell-text"> </span></div>'),Tle=ue('<div class="mb-calendar"><div class="mb-calendar-header"></div> <div class="mb-calendar-content"></div></div>');function gA(t,e){Ae(e,!0);let r=fr(()=>YI(e.month,e.year));function i(l){l&&e.dateChange((0,kq.default)(new Date(e.year,e.month,l)))}function n(l,u){l.key===" "&&i(u)}var o=Tle(),a=he(o);Wt(a,21,JI,Kt,(l,u)=>{var c=Sle(),f=he(c),m=he(f,!0);pe(f),pe(c),ze(()=>St(m,U(u))),ee(l,c)}),pe(a);var s=fe(a,2);Wt(s,21,()=>U(r),l=>XI(),(l,u)=>{var c=Ale();let f;c.__click=[Dle,i,u],c.__keydown=[Ele,n,u];var m=he(c),p=he(m,!0);pe(m),pe(c),ze(d=>{f=zr(c,1,"mb-calendar-cell",null,f,d),St(p,U(u)||"")},[()=>({"mb-calendar-highlight":U(u),"mb-calendar-content-cell":U(u),"mb-calendar-selected":e.selectedDate?.year()===e.year&&e.selectedDate?.month()===e.month&&e.selectedDate?.date()===U(u)})]),ee(l,c)}),pe(s),pe(o),ee(t,o),Te()}Ft(["click","keydown"]);function Nle(t,e,r){if(U(e)===11){Re(e,0),Re(r,U(r)+1);return}Re(e,U(e)+1)}function Mle(t,e,r){if(U(e)===0){Re(e,11),Re(r,U(r)-1);return}Re(e,U(e)-1)}function Cle(t,e){let r=t.target.value,i=Number.parseInt(r);Number.isNaN(i)||Re(e,i,!0)}function $le(t,e,r){e(null),r.dateChangeCallback(null)}function Ile(t,e,r){e((0,Gb.default)()),r.dateChangeCallback(e())}var Fle=ue('<div class="mb-date-picker"><div class="mb-date-picker-header"><button class="mb-date-picker-month-switch-button">Prev</button> <div class="mb-date-picker-header-text"><span class="mb-date-picker-header-text-month"> </span> <input class="mb-date-picker-header-text-year" type="number"/></div> <button class="mb-date-picker-month-switch-button">Next</button></div> <!> <div class="mb-date-picker-footer"><button class="mb-date-picker-util-button">Set no Date</button> <button class="mb-date-picker-util-button">Set to Now</button></div></div>');function vA(t,e){Ae(e,!0);let r=pt(e,"selectedDate",23,Gb.default),i=ft(0),n=ft(0);io(()=>{if(r())Re(i,r().month(),!0),Re(n,r().year(),!0);else{let S=(0,Gb.default)();Re(i,S.month(),!0),Re(n,S.year(),!0)}});function o(S){r(S),e.dateChangeCallback(S)}var a=Fle(),s=he(a),l=he(s);l.__click=[Mle,i,n];var u=fe(l,2),c=he(u),f=he(c,!0);pe(c);var m=fe(c,2);Mt(m),m.__input=[Cle,n],pe(u);var p=fe(u,2);p.__click=[Nle,i,n],pe(s);var d=fe(s,2);gA(d,{dateChange:o,get month(){return U(i)},get year(){return U(n)},get selectedDate(){return r()}});var h=fe(d,2),v=he(h);v.__click=[$le,r,e];var y=fe(v,2);y.__click=[Ile,r,e],pe(h),pe(a),ze((S,b)=>{St(f,S),B_(m,b)},[()=>HI(U(i)),()=>U(n).toString()]),ee(t,a),Te()}Ft(["click","input"]);var hf=class extends Ti{modal;setModal(e){this.modal=e}closeModal(){if(this.modal!==void 0)this.modal.close();else throw new jt({errorLevel:"CRITICAL",effect:"Failed to close modal",cause:"Modal reference in ModalContent is undefined"})}};var kle=ue('<div><div class="setting-item-info"><div class="setting-item-name"> </div> <div class="setting-item-description"> </div></div> <div><!></div></div>');function Ot(t,e){let r=pt(e,"name",3,""),i=pt(e,"description",3,""),n=pt(e,"heading",3,!1),o=pt(e,"vertical",3,!1);var a=kle();let s;var l=he(a),u=he(l),c=he(u,!0);pe(u);var f=fe(u,2),m=he(f,!0);pe(f),pe(l);var p=fe(l,2);let d;var h=he(p);{var v=y=>{var S=Or(),b=je(S);Ko(b,()=>e.children),ee(y,S)};ot(h,y=>{e.children&&y(v)})}pe(p),pe(a),ze((y,S)=>{s=zr(a,1,"setting-item",null,s,y),St(c,r()),St(m,i()),d=zr(p,1,"setting-item-control",null,d,S)},[()=>({"setting-item-heading":n(),"mb-vertical":o()}),()=>({"mb-vertical-control":o()})]),ee(t,a)}function yA(t,e){Ae(e,!0);let r=pt(e,"action",15);function i(){e.mb.internal.openCommandSelectModal(n=>{r(r().command=n.id,!0)})}{let n=fr(()=>r().command||"none");Ot(t,{get name(){return`Command: ${U(n)??""}`},description:"The command to execute when this action runs.",children:(o,a)=>{Dt(o,{get variant(){return"primary"},onclick:()=>i(),children:(s,l)=>{Nt();var u=Gt("Change");ee(s,u)},$$slots:{default:!0}})},$$slots:{default:!0}})}Te()}var Ple=(t,e,r)=>e(!U(r)),Ble=(t,e,r)=>{t.key===" "&&e(!U(r))},Ole=ue('<div role="switch" tabindex="0"><input type="checkbox" tabindex="-1"/></div>');function Uo(t,e){Ae(e,!0);let r=pt(e,"checked",15),i=fr(()=>r()??!1);var n=Ole();let o;n.__click=[Ple,r,i],n.__keydown=[Ble,r,i];var a=he(n);Mt(a),pe(n),ze(s=>{o=zr(n,1,"checkbox-container",null,o,s),lt(n,"aria-checked",U(i)),Is(a,U(i))},[()=>({"is-enabled":U(i)})]),ee(t,n),Te()}Ft(["click","keydown"]);var Rle=ue('<input type="text" placeholder="some name"/>'),Lle=ue("<!> <!> <!> <!>",1);function bA(t,e){Ae(e,!0);let r=pt(e,"action",15);function i(){e.mb.internal.openFolderSelectModal(u=>{r(r().folderPath=u,!0)})}var n=Lle(),o=je(n);{let u=fr(()=>r().folderPath||"none");Ot(o,{get name(){return`Folder: ${U(u)??""}`},description:"The folder to create a new note in.",children:(c,f)=>{Dt(c,{get variant(){return"primary"},onclick:()=>i(),tooltip:"Select from vault",children:(m,p)=>{Nt();var d=Gt("Change");ee(m,d)},$$slots:{default:!0}})},$$slots:{default:!0}})}var a=fe(o,2);{let u=fr(()=>r().fileName||"default");Ot(a,{get name(){return`File name: ${U(u)??""}`},description:"The file name of the new note.",children:(c,f)=>{var m=Rle();Mt(m),At(m,()=>r().fileName,p=>r(r().fileName=p,!0)),ee(c,m)},$$slots:{default:!0}})}var s=fe(a,2);Ot(s,{name:"Open note",description:"Whether to open the new note after this action ran.",children:(u,c)=>{Uo(u,{get checked(){return r().openNote},set checked(f){r(r().openNote=f,!0)}})},$$slots:{default:!0}});var l=fe(s,2);Ot(l,{name:"Open if note already exists",description:"Whether to open the note instead of creating a new one if the note already exists.",children:(u,c)=>{Uo(u,{get checked(){return r().openIfAlreadyExists},set checked(f){r(r().openIfAlreadyExists=f,!0)}})},$$slots:{default:!0}}),ee(t,n),Te()}function xA(t,e){Ae(e,!0);let r=pt(e,"action",15);function i(){e.mb.internal.openMarkdownFileSelectModal(n=>{r(r().templateFile=n,!0)})}{let n=fr(()=>r().templateFile||"default");Ot(t,{get name(){return`File path: ${U(n)??""}`},description:"The path to the templater file, relative to the vault root.",children:(o,a)=>{Dt(o,{get variant(){return"primary"},onclick:()=>i(),tooltip:"Select from vault",children:(s,l)=>{Nt();var u=Gt("Change");ee(s,u)},$$slots:{default:!0}})},$$slots:{default:!0}})}Te()}var Ule=ue('<!> <div class="meta-bind-full-width meta-bind-high"><textarea></textarea></div>',1);function _A(t,e){Ae(e,!0);let r=pt(e,"action",15);var i=Ule(),n=je(i);Ot(n,{name:"JS code",description:"The JavaScript code to run."});var o=fe(n,2),a=he(o);Cn(a),pe(o),At(a,()=>r().code,s=>r(r().code=s,!0)),ee(t,i),Te()}var zle=ue('<input type="text" placeholder="some text"/>');function wA(t,e){Ae(e,!0);let r=pt(e,"action",15);Ot(t,{name:"Text",description:"The text to input at the cursor.",children:(i,n)=>{var o=zle();Mt(o),At(o,()=>r().str,a=>r(r().str=a,!0)),ee(i,o)},$$slots:{default:!0}}),Te()}var Vle=ue('<input type="number" placeholder="0"/>'),qle=ue('<!> <!> <div class="meta-bind-full-width meta-bind-high"><textarea></textarea></div>',1);function SA(t,e){Ae(e,!0);let r=pt(e,"action",15);var i=qle(),n=je(i);Ot(n,{name:"Line",description:"The line number to insert at.",children:(l,u)=>{var c=Vle();Mt(c),At(c,()=>r().line,f=>r(r().line=f,!0)),ee(l,c)},$$slots:{default:!0}});var o=fe(n,2);Ot(o,{name:"Text to insert",description:"The text to insert into the note."});var a=fe(o,2),s=he(a);Cn(s),pe(a),At(s,()=>r().value,l=>r(r().value=l,!0)),ee(t,i),Te()}function DA(t,e){Ae(e,!0);let r=pt(e,"action",15);function i(){e.mb.internal.openFilteredFileSelectModal(n=>{r(r().file=n,!0)},n=>n.endsWith(".js"))}Ot(t,{name:"JS file",description:"The JavaScript file to run.",children:(n,o)=>{Dt(n,{get variant(){return"primary"},onclick:()=>i(),tooltip:"Select from vault",children:(a,s)=>{Nt();var l=Gt("Change");ee(a,l)},$$slots:{default:!0}})},$$slots:{default:!0}}),Te()}var jle=ue('<input type="text" placeholder="[[Some Note]] or https://www.example.com"/> <!>',1),Zle=ue("<!> <!>",1);function EA(t,e){Ae(e,!0);let r=pt(e,"action",15);function i(){e.mb.internal.openMarkdownFileSelectModal(s=>{r(r().link=s,!0)})}var n=Zle(),o=je(n);Ot(o,{name:"Link",description:"The link to open.",children:(s,l)=>{var u=jle(),c=je(u);Mt(c);var f=fe(c,2);Dt(f,{get variant(){return"primary"},onclick:()=>i(),tooltip:"Select from vault",children:(m,p)=>{Rr(m,{iconName:"list",get mb(){return e.mb}})},$$slots:{default:!0}}),At(c,()=>r().link,m=>r(r().link=m,!0)),ee(s,u)},$$slots:{default:!0}});var a=fe(o,2);Ot(a,{name:"New tab",description:"Whether to open the link in a new tab.",children:(s,l)=>{Uo(s,{get checked(){return r().newTab},set checked(u){r(r().newTab=u,!0)}})},$$slots:{default:!0}}),ee(t,n),Te()}var Gle=ue('<input type="text"/>'),Wle=ue('<input type="text" placeholder="g"/>'),Hle=ue('<!> <!> <!> <div class="meta-bind-full-width meta-bind-high"><textarea></textarea></div>',1);function AA(t,e){Ae(e,!0);let r=pt(e,"action",15);var i=Hle(),n=je(i);Ot(n,{name:"Regexp",description:"The regexp to find replacements.",children:(u,c)=>{var f=Gle();Mt(f),At(f,()=>r().regexp,m=>r(r().regexp=m,!0)),ee(u,f)},$$slots:{default:!0}});var o=fe(n,2);Ot(o,{name:"Regexp flags",description:"The regexp flags for this regexp.",children:(u,c)=>{var f=Wle();Mt(f),At(f,()=>r().regexpFlags,m=>r(r().regexpFlags=m,!0)),ee(u,f)},$$slots:{default:!0}});var a=fe(o,2);Ot(a,{name:"Replacement text",description:"The text to replace the button with."});var s=fe(a,2),l=he(s);Cn(l),pe(s),At(l,()=>r().replacement,u=>r(r().replacement=u,!0)),ee(t,i),Te()}var Yle=ue('<input type="number" placeholder="0"/>'),Jle=ue('<input type="number" placeholder="0"/>'),Xle=ue('<!> <!> <!> <div class="meta-bind-full-width meta-bind-high"><textarea></textarea></div>',1);function TA(t,e){Ae(e,!0);let r=pt(e,"action",15);var i=Xle(),n=je(i);Ot(n,{name:"Line from",description:"The line that marks the start of the area to replace.",children:(u,c)=>{var f=Yle();Mt(f),At(f,()=>r().fromLine,m=>r(r().fromLine=m,!0)),ee(u,f)},$$slots:{default:!0}});var o=fe(n,2);Ot(o,{name:"Line to",description:"The line that marks the end of the area to replace.",children:(u,c)=>{var f=Jle();Mt(f),At(f,()=>r().toLine,m=>r(r().toLine=m,!0)),ee(u,f)},$$slots:{default:!0}});var a=fe(o,2);Ot(a,{name:"Replacement text",description:"The text to replace the note section."});var s=fe(a,2),l=he(s);Cn(l),pe(s),At(l,()=>r().replacement,u=>r(r().replacement=u,!0)),ee(t,i),Te()}var Kle=ue('<!> <div class="meta-bind-full-width meta-bind-high"><textarea></textarea></div>',1);function NA(t,e){Ae(e,!0);let r=pt(e,"action",15);var i=Kle(),n=je(i);Ot(n,{name:"Replacement text",description:"The text to replace the match with."});var o=fe(n,2),a=he(o);Cn(a),pe(o),At(a,()=>r().replacement,s=>r(r().replacement=s,!0)),ee(t,i),Te()}var Qle=ue('<input type="number" placeholder="100 ms"/>');function MA(t,e){Ae(e,!0);let r=pt(e,"action",15);Ot(t,{name:"Sleep time",description:"The time to sleep in milliseconds.",children:(i,n)=>{var o=Qle();Mt(o),At(o,()=>r().ms,a=>r(r().ms=a,!0)),ee(i,o)},$$slots:{default:!0}}),Te()}var ece=ue('<input type="text" placeholder="some name"/>'),tce=ue("<!> <!> <!> <!> <!>",1);function CA(t,e){Ae(e,!0);let r=pt(e,"action",15);function i(f){e.mb.internal.openFileSelectModal(m=>{f.templateFile=m})}function n(f){e.mb.internal.openFolderSelectModal(m=>{f.folderPath=m})}var o=tce(),a=je(o);{let f=fr(()=>r().templateFile||"none");Ot(a,{get name(){return`Template file: ${U(f)??""}`},description:"The template file to create a new note of.",children:(m,p)=>{Dt(m,{get variant(){return"primary"},onclick:()=>i(r()),tooltip:"Select from vault",children:(d,h)=>{Nt();var v=Gt("Change");ee(d,v)},$$slots:{default:!0}})},$$slots:{default:!0}})}var s=fe(a,2);{let f=fr(()=>r().folderPath||"none");Ot(s,{get name(){return`Folder: ${U(f)??""}`},description:"The folder to create a new note in.",children:(m,p)=>{Dt(m,{get variant(){return"primary"},onclick:()=>n(r()),tooltip:"Select from vault",children:(d,h)=>{Nt();var v=Gt("Change");ee(d,v)},$$slots:{default:!0}})},$$slots:{default:!0}})}var l=fe(s,2);{let f=fr(()=>r().fileName||"default");Ot(l,{get name(){return`File name: ${U(f)??""}`},description:"The file name of the new note.",children:(m,p)=>{var d=ece();Mt(d),At(d,()=>r().fileName,h=>r(r().fileName=h,!0)),ee(m,d)},$$slots:{default:!0}})}var u=fe(l,2);Ot(u,{name:"Open note",description:"Whether to open the new note after this action ran.",children:(f,m)=>{Uo(f,{get checked(){return r().openNote},set checked(p){r(r().openNote=p,!0)}})},$$slots:{default:!0}});var c=fe(u,2);Ot(c,{name:"Open if note already exists",description:"Whether to open the note instead of creating a new one if the note already exists.",children:(f,m)=>{Uo(f,{get checked(){return r().openIfAlreadyExists},set checked(p){r(r().openIfAlreadyExists=p,!0)}})},$$slots:{default:!0}}),ee(t,o),Te()}var rce=ue('<input type="text" placeholder="some value"/>'),nce=ue('<input type="text" placeholder="some value"/>'),ice=ue("<!> <!> <!>",1);function $A(t,e){Ae(e,!0);let r=pt(e,"action",15);var i=ice(),n=je(i);Ot(n,{name:"Metadata property",description:"The metadata property in form of a bind target.",children:(s,l)=>{var u=rce();Mt(u),At(u,()=>r().bindTarget,c=>r(r().bindTarget=c,!0)),ee(s,u)},$$slots:{default:!0}});var o=fe(n,2);Ot(o,{name:"Value",description:"The new value.",children:(s,l)=>{var u=nce();Mt(u),At(u,()=>r().value,c=>r(r().value=c,!0)),ee(s,u)},$$slots:{default:!0}});var a=fe(o,2);Ot(a,{name:"Evaluate",description:"Whether to evaluate the value as a JS expression.",children:(s,l)=>{Uo(s,{get checked(){return r().evaluate},set checked(u){r(r().evaluate=u,!0)}})},$$slots:{default:!0}}),ee(t,i),Te()}var oce=ue("<div><!></div>");function Qs(t,e){Ae(e,!0);let r=pt(e,"reverse",3,!1),i=pt(e,"stretchChildren",3,!1),n=fr(()=>[r()?"mb-flex-row-reverse":"mb-flex-row",i()?"mb-flex-row-stretch":""].join(" "));var o=oce(),a=he(o);Ko(a,()=>e.children),pe(o),ze(()=>zr(o,1,$s(U(n)))),ee(t,o),Te()}var ace=ue('<div class="modal-button-container"><!></div>');function zo(t,e){var r=ace(),i=he(r);Ko(i,()=>e.children),pe(r),ee(t,r)}var sce=ue('<input type="text"/>'),uce=ue('<input type="text"/>'),lce=ue("<option> </option>"),cce=ue('<select class="dropdown"></select>'),fce=ue('<input type="text"/>'),pce=ue('<input type="text"/>'),mce=ue('<span style="word-break: break-word"> </span> <!> <!>',1),dce=ue('<input type="text"/>'),hce=ue('<input type="text"/>'),gce=ue("<option> </option>"),vce=ue("<h5> </h5> <!>",1),yce=ue("<!> <!> <!> <!> <!> <!> <!> <!> <!> <!> <!> <!> <!> <!> <!>",1),bce=ue("<!> <!>",1),xce=ue('<!> <!> <!> <!> <!> <!> <!> <!> <!> <h4>Actions</h4> Add action of type <select class="dropdown"></select> <!> <!> <h4>Preview</h4> <div></div> <!>',1);function IA(t,e){Ae(e,!0);let r=wt(e.buttonConfig),i,n,o=ft(wt("command"));hc(()=>{n?.unmount()}),io(()=>{n?.unmount(),i&&(ht.empty(i),n=new ku(e.mb,bt(r),"","block",void 0,!1,!0),n.mount(i))});function a(){r.actions?.push(e.mb.buttonActionRunner.createDefaultAction(U(o)))}function s($){r.actions?.splice($,1)}function l($){return e.mb.buttonActionRunner.getActionLabel($)}function u($,O){if(r.actions===void 0)return;let R=[];$>0&&R.push({name:"Move up",icon:"arrow-up",onclick:()=>{if(r.actions===void 0)return;let L=r.actions[$-1];r.actions[$-1]=r.actions[$],r.actions[$]=L}}),$<r.actions.length-1&&R.push({name:"Move down",icon:"arrow-down",onclick:()=>{if(r.actions===void 0)return;let L=r.actions[$+1];r.actions[$+1]=r.actions[$],r.actions[$]=L}}),R.push({name:"Remove",icon:"x",warning:!0,onclick:()=>s($)}),e.mb.internal.createContextMenu(R).showWithEvent(O)}function c(){e.mb.internal.openImageFileSelectModal($=>{r.backgroundImage=$})}function f(){r.backgroundImage=void 0}var m=xce(),p=je(m);Ot(p,{name:"Label",description:"The label shown on the button.",children:($,O)=>{var R=sce();Mt(R),At(R,()=>r.label,L=>r.label=L),ee($,R)},$$slots:{default:!0}});var d=fe(p,2);Ot(d,{name:"Icon",description:"The icon shown on the button. If left empty, no icon will show",children:($,O)=>{var R=uce();Mt(R),At(R,()=>r.icon,L=>r.icon=L),ee($,R)},$$slots:{default:!0}});var h=fe(d,2);Ot(h,{name:"Style",description:"The style variant of the button",children:($,O)=>{var R=cce();Wt(R,21,()=>Object.values(Gr),Kt,(L,k)=>{var V=lce(),J=he(V,!0);pe(V);var W={};ze(()=>{St(J,U(k)),W!==(W=U(k))&&(V.value=(V.__value=U(k))??"")}),ee(L,V)}),pe(R),dc(R,()=>r.style,L=>r.style=L),ee($,R)},$$slots:{default:!0}});var v=fe(h,2);Ot(v,{name:"CSS classes",description:"A list of CSS classes to add to the button. Multiple classes should be separated by a space.",children:($,O)=>{var R=fce();Mt(R),At(R,()=>r.class,L=>r.class=L),ee($,R)},$$slots:{default:!0}});var y=fe(v,2);Ot(y,{name:"CSS styles",description:"CSS styles to directly apply to the button.",children:($,O)=>{var R=pce();Mt(R),At(R,()=>r.cssStyle,L=>r.cssStyle=L),ee($,R)},$$slots:{default:!0}});var S=fe(y,2);Ot(S,{name:"Background image",description:"A background image to use in the button.",children:($,O)=>{var R=mce(),L=je(R),k=he(L,!0);pe(L);var V=fe(L,2);Dt(V,{get variant(){return"primary"},onclick:()=>c(),tooltip:"Select from vault",children:(W,Q)=>{Nt();var ie=Gt("Change");ee(W,ie)},$$slots:{default:!0}});var J=fe(V,2);Dt(J,{get variant(){return"default"},onclick:()=>f(),tooltip:"Reset to none",children:(W,Q)=>{Rr(W,{get mb(){return e.mb},iconName:"x"})},$$slots:{default:!0}}),ze(()=>St(k,r.backgroundImage||"none")),ee($,R)},$$slots:{default:!0}});var b=fe(S,2);Ot(b,{name:"Tooltip",description:"A tooltip to show when hovering the button. If not set, the button label will be shown instead.",children:($,O)=>{var R=dce();Mt(R),At(R,()=>r.tooltip,L=>r.tooltip=L),ee($,R)},$$slots:{default:!0}});var _=fe(b,2);Ot(_,{name:"ID",description:"An ID that allows the button to be referenced in inline buttons.",children:($,O)=>{var R=hce();Mt(R),At(R,()=>r.id,L=>r.id=L),ee($,R)},$$slots:{default:!0}});var w=fe(_,2);Ot(w,{name:"Hidden",description:"Whether to not render this button. This can be useful when using inline buttons.",children:($,O)=>{Uo($,{get checked(){return r.hidden},set checked(R){r.hidden=R}})},$$slots:{default:!0}});var x=fe(w,4);Wt(x,21,()=>Object.values(Wn),Kt,($,O)=>{var R=gce(),L=he(R,!0);pe(R);var k={};ze(()=>{St(L,U(O)),k!==(k=U(O))&&(R.value=(R.__value=U(O))??"")}),ee($,R)}),pe(x);var E=fe(x,2);Dt(E,{get variant(){return"primary"},onclick:()=>a(),children:($,O)=>{Nt();var R=Gt("Add Action");ee($,R)},$$slots:{default:!0}});var T=fe(E,2);{var D=$=>{var O=Or(),R=je(O);Wt(R,17,()=>r.actions??[],Kt,(L,k,V)=>{var J=yce(),W=je(J);Qs(W,{children:(ke,Y)=>{var me=vce(),ce=je(me),Ce=he(ce,!0);pe(ce);var Pe=fe(ce,2);Dt(Pe,{get variant(){return"plain"},onclick:we=>u(V,we),children:(we,We)=>{Rr(we,{iconName:"more-vertical",get mb(){return e.mb}})},$$slots:{default:!0}}),ze(we=>St(Ce,we),[()=>l(U(k).type)]),ee(ke,me)},$$slots:{default:!0}});var Q=fe(W,2);{var ie=ke=>{yA(ke,{get mb(){return e.mb},get action(){return r.actions[V]},set action(Y){r.actions[V]=Y}})};ot(Q,ke=>{U(k).type==="command"&&ke(ie)})}var B=fe(Q,2);{var Z=ke=>{EA(ke,{get mb(){return e.mb},get action(){return r.actions[V]},set action(Y){r.actions[V]=Y}})};ot(B,ke=>{U(k).type==="open"&&ke(Z)})}var q=fe(B,2);{var xe=ke=>{DA(ke,{get mb(){return e.mb},get action(){return r.actions[V]},set action(Y){r.actions[V]=Y}})};ot(q,ke=>{U(k).type==="js"&&ke(xe)})}var de=fe(q,2);{var be=ke=>{wA(ke,{get mb(){return e.mb},get action(){return r.actions[V]},set action(Y){r.actions[V]=Y}})};ot(de,ke=>{U(k).type==="input"&&ke(be)})}var G=fe(de,2);{var K=ke=>{MA(ke,{get mb(){return e.mb},get action(){return r.actions[V]},set action(Y){r.actions[V]=Y}})};ot(G,ke=>{U(k).type==="sleep"&&ke(K)})}var re=fe(G,2);{var ae=ke=>{CA(ke,{get mb(){return e.mb},get action(){return r.actions[V]},set action(Y){r.actions[V]=Y}})};ot(re,ke=>{U(k).type==="templaterCreateNote"&&ke(ae)})}var le=fe(re,2);{var Se=ke=>{$A(ke,{get mb(){return e.mb},get action(){return r.actions[V]},set action(Y){r.actions[V]=Y}})};ot(le,ke=>{U(k).type==="updateMetadata"&&ke(Se)})}var _e=fe(le,2);{var Oe=ke=>{bA(ke,{get mb(){return e.mb},get action(){return r.actions[V]},set action(Y){r.actions[V]=Y}})};ot(_e,ke=>{U(k).type==="createNote"&&ke(Oe)})}var st=fe(_e,2);{var yt=ke=>{xA(ke,{get mb(){return e.mb},get action(){return r.actions[V]},set action(Y){r.actions[V]=Y}})};ot(st,ke=>{U(k).type==="runTemplaterFile"&&ke(yt)})}var Qe=fe(st,2);{var ut=ke=>{TA(ke,{get mb(){return e.mb},get action(){return r.actions[V]},set action(Y){r.actions[V]=Y}})};ot(Qe,ke=>{U(k).type==="replaceInNote"&&ke(ut)})}var H=fe(Qe,2);{var oe=ke=>{AA(ke,{get mb(){return e.mb},get action(){return r.actions[V]},set action(Y){r.actions[V]=Y}})};ot(H,ke=>{U(k).type==="regexpReplaceInNote"&&ke(oe)})}var ve=fe(H,2);{var De=ke=>{NA(ke,{get mb(){return e.mb},get action(){return r.actions[V]},set action(Y){r.actions[V]=Y}})};ot(ve,ke=>{U(k).type==="replaceSelf"&&ke(De)})}var Ee=fe(ve,2);{var Ue=ke=>{SA(ke,{get mb(){return e.mb},get action(){return r.actions[V]},set action(Y){r.actions[V]=Y}})};ot(Ee,ke=>{U(k).type==="insertIntoNote"&&ke(Ue)})}var He=fe(Ee,2);{var nt=ke=>{_A(ke,{get mb(){return e.mb},get action(){return r.actions[V]},set action(Y){r.actions[V]=Y}})};ot(He,ke=>{U(k).type==="inlineJS"&&ke(nt)})}ee(L,J)}),ee($,O)};ot(T,$=>{r.actions&&$(D)})}var M=fe(T,4);xa(M,$=>i=$,()=>i);var C=fe(M,2);zo(C,{children:($,O)=>{var R=bce(),L=je(R);Dt(L,{get variant(){return"primary"},onclick:()=>e.modal.okay(bt(r)),children:(V,J)=>{Nt();var W=Gt();ze(()=>St(W,e.modal.options.submitText)),ee(V,W)},$$slots:{default:!0}});var k=fe(L,2);Dt(k,{get variant(){return"default"},onclick:()=>e.modal.cancel(),children:(V,J)=>{Nt();var W=Gt("Cancel");ee(V,W)},$$slots:{default:!0}}),ee($,R)},$$slots:{default:!0}}),dc(x,()=>U(o),$=>Re(o,$)),ee(t,m),Te()}var Wb=class extends hf{mb;component;options;constructor(e,r){super(),this.mb=e,this.options=r}onMount(e){ht.empty(e),this.component&&Dr(this.component),this.component=Fr(IA,{target:e,props:{mb:this.mb,modal:this,buttonConfig:this.options.config??this.mb.buttonActionRunner.createDefaultButtonConfig()}})}onUnmount(e){ht.empty(e),this.component&&Dr(this.component)}okay(e){this.closeModal(),this.options.onOkay(e)}cancel(){this.closeModal()}};var _ce=(t,e,r)=>r.onSelect(r.image),wce=(t,e,r,i)=>e(t,i.image),Sce=ue('<div class="mb-image-card" role="button" tabindex="0"><img class="mb-image-card-image"/> <div class="mb-image-card-footer"><span> </span></div></div>');function FA(t,e){Ae(e,!0);let r=nr(e,["$$slots","$$events","$$legacy"]);function i(u,c){u.key===" "&&e.onSelect(c)}var n=Sce();n.__click=[_ce,r,e],n.__keydown=[wce,i,r,e];var o=he(n),a=fe(o,2),s=he(a),l=he(s,!0);pe(s),pe(a),pe(n),ze(u=>{lt(o,"src",u),lt(o,"alt",e.image),St(l,e.image)},[()=>e.mb.internal.imagePathToUri(e.image)]),ee(t,n),Te()}Ft(["click","keydown"]);var Dce=ue("<!> <!>",1),Ece=ue('<div class="mb-image-modal-header"><input type="text" placeholder="Search images..."/></div> <div class="mb-image-card-grid"></div> <!>',1);function kA(t,e){Ae(e,!0);let r=ft(""),i=e.mb.internal.createFuzzySearch(),n=fr(()=>U(r)?(i.setSearch(U(r)),i.filterItems(e.options,c=>c.value)):e.options);var o=Ece(),a=je(o),s=he(a);Mt(s),pe(a);var l=fe(a,2);Wt(l,21,()=>U(n),Kt,(c,f)=>{FA(c,{get mb(){return e.mb},get image(){return U(f).value},get onSelect(){return e.onSelect}})}),pe(l);var u=fe(l,2);zo(u,{children:(c,f)=>{var m=Dce(),p=je(m);{var d=v=>{Dt(v,{get variant(){return"primary"},onclick:()=>e.onSelect(void 0),children:(y,S)=>{Nt();var b=Gt("Select none");ee(y,b)},$$slots:{default:!0}})};ot(p,v=>{e.canSelectNone&&v(d)})}var h=fe(p,2);Dt(h,{onclick:()=>e.onCancel(),children:(v,y)=>{Nt();var S=Gt("Cancel");ee(v,S)},$$slots:{default:!0}}),ee(c,m)},$$slots:{default:!0}}),At(s,()=>U(r),c=>Re(r,c)),ee(t,o),Te()}var $l=class extends hf{component;createComponent;constructor(e){super(),this.createComponent=e}onMount(e){ht.empty(e),this.component=this.createComponent(this,e)}onUnmount(e){this.component&&Dr(this.component),ht.empty(e)}};var Ace=ue("<textarea></textarea>"),Tce=ue('<input type="text"/>'),Nce=ue("<!> <!>",1),Mce=ue('<p> </p> <div class="mb-full-width-text-input"><!></div> <!>',1);function PA(t,e){Ae(e,!0);let r=ft(wt(e.options.value));var i=Mce(),n=je(i),o=he(n,!0);pe(n);var a=fe(n,2),s=he(a);{var l=f=>{var m=Ace();Cn(m),At(m,()=>U(r),p=>Re(r,p)),ee(f,m)},u=f=>{var m=Tce();Mt(m),At(m,()=>U(r),p=>Re(r,p)),ee(f,m)};ot(s,f=>{e.options.multiline?f(l):f(u,!1)})}pe(a);var c=fe(a,2);zo(c,{children:(f,m)=>{var p=Nce(),d=je(p);Dt(d,{get variant(){return"primary"},onclick:()=>e.options.onSubmit(bt(U(r))),children:(v,y)=>{Nt();var S=Gt("OK");ee(v,S)},$$slots:{default:!0}});var h=fe(d,2);Dt(h,{onclick:()=>e.options.onCancel(),children:(v,y)=>{Nt();var S=Gt("Cancel");ee(v,S)},$$slots:{default:!0}}),ee(f,p)},$$slots:{default:!0}}),ze(()=>St(o,e.options.subTitle)),ee(t,i),Te()}var is=class{mb;selectCallback;constructor(e,r){this.mb=e,this.selectCallback=r}onSelected(e){this.selectCallback(e)}};var Hb=class extends is{getItemText(e){return e.name}getItemDescription(e){}getItems(){return this.mb.internal.getAllCommands()}};var ym=class extends is{filterFunction;constructor(e,r,i){super(e,r),this.filterFunction=i}getItemText(e){return e}getItemDescription(e){}getItems(){return this.filterFunction!==void 0?this.mb.file.getAllFiles().filter(e=>this.filterFunction(e)):this.mb.file.getAllFiles()}};var Yb=class extends is{getItemText(e){return e}getItemDescription(e){}getItems(){return this.mb.file.getAllFolders()}};var Jb=class extends is{ipf;constructor(e,r,i){super(e,r),this.ipf=i}getItemText(e){return e.displayValue}getItemDescription(e){return e.displayDescription}getItems(){return this.mb.internal.getSuggesterOptions(this.ipf)}};var Cce=ue('<pre class="mb-pre"><code class="language-none mb-none"> </code></pre>'),$ce=ue("<tr><td>Tip</td><td> </td></tr>"),Ice=ue("<a> </a><br/>",1),Fce=ue("<tr><td>Docs</td><td></td></tr>"),kce=ue('<tr><td>Context</td><td><pre class="mb-pre"><code class="language-none mb-none"> </code></pre></td></tr>'),Pce=ue('<div class="mb-card mb-card-full-width markdown-rendered"><h6><span> </span> </h6> <!> <table><tbody><tr><td>Cause</td><td> </td></tr><tr><td>Effect</td><td> </td></tr><!><!><!></tbody></table></div>'),Bce=ue('<div class="mb-card"><pre class="mb-pre"><code class="language-none mb-none"> </code></pre></div>');function Xb(t,e){Ae(e,!0);var r=Or(),i=je(r);{var n=a=>{var s=Pce(),l=he(s),u=he(l),c=he(u);pe(u);var f=fe(u);pe(l);var m=fe(l,2);{var p=$=>{var O=Cce(),R=he(O),L=he(R,!0);pe(R),pe(O),ze(()=>St(L,e.error.positionContext)),ee($,O)};ot(m,$=>{e.error.positionContext&&$(p)})}var d=fe(m,2),h=he(d),v=he(h),y=fe(he(v)),S=he(y,!0);pe(y),pe(v);var b=fe(v),_=fe(he(b)),w=he(_,!0);pe(_),pe(b);var x=fe(b);{var E=$=>{var O=$ce(),R=fe(he(O)),L=he(R,!0);pe(R),pe(O),ze(()=>St(L,e.error.tip)),ee($,O)};ot(x,$=>{e.error.tip&&$(E)})}var T=fe(x);{var D=$=>{var O=Fce(),R=fe(he(O));Wt(R,21,()=>e.error.docs,Kt,(L,k)=>{var V=Ice(),J=je(V),W=he(J,!0);pe(J),Nt(),ze(()=>{lt(J,"href",U(k)),St(W,U(k))}),ee(L,V)}),pe(R),pe(O),ee($,O)};ot(T,$=>{e.error.docs&&$(D)})}var M=fe(T);{var C=$=>{var O=kce(),R=fe(he(O)),L=he(R),k=he(L),V=he(k,!0);pe(k),pe(L),pe(R),pe(O),ze(J=>St(V,J),[()=>JSON.stringify(e.error.context,null,4)]),ee($,O)};ot(M,$=>{e.error.context&&$(C)})}pe(h),pe(d),pe(s),ze($=>{zr(u,1,$s(e.error.errorLevel==="WARNING"?"mb-warning-text":"mb-error-text")),St(c,`${e.error.errorLevel??""}
[${$??""}]`),St(f,` - ${e.error.effect??""}`),St(S,e.error.cause),St(w,e.error.effect)},[()=>e.error.getErrorType()]),ee(a,s)},o=a=>{var s=Bce(),l=he(s),u=he(l),c=he(u,!0);pe(u),pe(l),pe(s),ze(()=>St(c,e.error.stack)),ee(a,s)};ot(i,a=>{e.error instanceof Zn?a(n):a(o,!1)})}ee(t,r),Te()}var Oce=ue("<p> </p>"),Rce=ue('<pre class="mb-pre"><code class="language-none meta-bind-none"> </code></pre>'),Lce=ue("<p> </p>"),Uce=ue("<h6>Errors</h6> <!> <!>",1),zce=ue("<p> </p>"),Vce=ue("<h6>Warnings</h6> <!> <!>",1),qce=ue("<!> <!> <!> <!>",1);function eu(t,e){Ae(e,!0);var r=qce(),i=je(r);{var n=f=>{var m=Oce(),p=he(m,!0);pe(m),ze(()=>St(p,e.settings.text)),ee(f,m)};ot(i,f=>{e.settings.text&&f(n)})}var o=fe(i,2);{var a=f=>{var m=Rce(),p=he(m),d=he(p,!0);pe(p),pe(m),ze(()=>St(d,e.settings.code)),ee(f,m)};ot(o,f=>{e.settings.code&&f(a)})}var s=fe(o,2);{var l=f=>{var m=Uce(),p=fe(je(m),2);{var d=v=>{var y=Lce(),S=he(y,!0);pe(y),ze(()=>St(S,e.settings.errorText)),ee(v,y)};ot(p,v=>{e.settings.errorText&&v(d)})}var h=fe(p,2);Wt(h,17,()=>e.settings.errorCollection.getErrors(),Kt,(v,y)=>{Xb(v,{get error(){return U(y)}})}),ee(f,m)};ot(s,f=>{e.settings.errorCollection.hasErrors()&&f(l)})}var u=fe(s,2);{var c=f=>{var m=Vce(),p=fe(je(m),2);{var d=v=>{var y=zce(),S=he(y,!0);pe(y),ze(()=>St(S,e.settings.warningText)),ee(v,y)};ot(p,v=>{e.settings.warningText&&v(d)})}var h=fe(p,2);Wt(h,17,()=>e.settings.errorCollection.getWarnings(),Kt,(v,y)=>{Xb(v,{get error(){return U(y)}})}),ee(f,m)};ot(u,f=>{e.settings.errorCollection.hasWarnings()&&f(c)})}ee(t,r),Te()}var jce=(t,e)=>e(),Zce=(t,e)=>{t.key===" "&&e()},Gce=ue('<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-alert-circle"><circle cx="12" cy="12" r="10"></circle><line x1="12" x2="12" y1="8" y2="12"></line><line x1="12" x2="12.01" y1="16" y2="16"></line></svg> <span class="mb-error">[META_BIND_ERROR]</span>',1),Wce=Qd('<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-alert-triangle"><path d="m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3Z"></path><line x1="12" x2="12" y1="9" y2="13"></line><line x1="12" x2="12.01" y1="17" y2="17"></line></svg>'),Hce=Qd('<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-info"><circle cx="12" cy="12" r="10"></circle><path d="M12 16v-4"></path><path d="M12 8h.01"></path></svg>'),Yce=ue('<div class="mb-error-collection" role="button" tabindex="0" aria-label="Click to view errors and warnings"><!></div>');function gf(t,e){Ae(e,!0);function r(){e.mb.internal.openErrorCollectionViewModal(e.settings)}var i=Or(),n=je(i);{var o=a=>{var s=Yce();s.__click=[jce,r],s.__keydown=[Zce,r];var l=he(s);{var u=f=>{var m=Gce();Nt(2),ee(f,m)},c=f=>{var m=Or(),p=je(m);{var d=v=>{var y=Wce();ee(v,y)},h=v=>{var y=Hce();ee(v,y)};ot(p,v=>{e.settings.errorCollection.hasWarnings()?v(d):v(h,!1)},!0)}ee(f,m)};ot(l,f=>{e.settings.errorCollection.hasErrors()?f(u):f(c,!1)})}pe(s),ee(a,s)};ot(n,a=>{e.settings.errorCollection.isEmpty()||a(o)})}ee(t,i),Te()}Ft(["click","keydown"]);var BA=["apng","avif","gif","jpg","jpeg","jfif","pjpeg","pjp","png","svg","webp"],Jce=BA.map(t=>`.${t}`),Kb=class{mb;constructor(e){this.mb=e}openCommandSelectModal(e){this.createSearchModal(new Hb(this.mb,e)).open()}openFileSelectModal(e){this.createSearchModal(new ym(this.mb,e)).open()}openFilteredFileSelectModal(e,r){this.createSearchModal(new ym(this.mb,e,r)).open()}openMarkdownFileSelectModal(e){this.openFilteredFileSelectModal(e,r=>r.endsWith(".md"))}openImageFileSelectModal(e){this.openFilteredFileSelectModal(e,r=>Jce.some(i=>r.endsWith(i)))}openFolderSelectModal(e){this.createSearchModal(new Yb(this.mb,e)).open()}openButtonBuilderModal(e){this.createModal(new Wb(this.mb,e),{title:"Meta Bind Button Builder"}).open()}openSuggesterModal(e,r){this.createSearchModal(new Jb(this.mb,r,e)).open()}openImageSuggesterModal(e,r,i){this.createModal(new $l((n,o)=>Fr(kA,{target:o,props:{mb:this.mb,options:this.getImageSuggesterOptions(e),canSelectNone:r,onSelect:a=>{i(a),n.closeModal()},onCancel:()=>{n.closeModal()}}})),{title:"Select an image from your Vault",classes:["mb-image-suggester-modal"]}).open()}openDatePickerModal(e,r){this.createModal(new $l((i,n)=>Fr(vA,{target:n,props:{selectedDate:e,dateChangeCallback:o=>{r(o),i.closeModal()}}})),{title:"Meta Bind date picker"}).open()}openTextPromptModal(e){this.createModal(new $l((r,i)=>Fr(PA,{target:i,props:{options:{...e,onSubmit:n=>{e.onSubmit(n),r.closeModal()},onCancel:()=>{e.onCancel(),r.closeModal()}}}})),e).open()}openErrorCollectionViewModal(e){this.createModal(new $l((r,i)=>Fr(eu,{target:i,props:{settings:e}})),{title:"Meta Bind error overview",classes:["mb-error-collection-modal","markdown-rendered"]}).open()}createErrorIndicator(e,r){let i=Fr(gf,{target:e,props:{mb:this.mb,settings:r}});return()=>{Dr(i)}}};var Pq=require("obsidian"),Qb=class{preparedSearch;constructor(){}setSearch(e){this.preparedSearch=(0,Pq.prepareFuzzySearch)(e)}filterItems(e,r){return this.preparedSearch?e.filter(i=>this.preparedSearch?.(r(i))?.score!=null):e}};var ho=require("obsidian");var Ou=class{value;displayValue;displayDescription;constructor(e,r,i){this.value=e,this.displayValue=r,this.displayDescription=i}valueAsString(){return this.value?.toString()??"null"}};function Bq(t){let e=[];for(let r of t.children)r instanceof ho.TFile&&Oq(r.extension)&&e.push(new Ou(r.path,r.name)),r instanceof ho.TFolder&&e.push(...Bq(r));return e}function Xce(t,e,r){let i=[];for(let n of r){let o=n.value;if(o.startsWith('"')&&o.endsWith('"'))o=o.substring(1,o.length-1);else{let s=new Br({errorLevel:"ERROR",effect:"failed to get suggest options",cause:"expected suggest option query for image suggester to start and end with double quotation marks"});new ho.Notice(`meta-bind | ${s.message}`),console.warn(s);continue}let a;if(o===""||o==="."?a=t.app.vault.getRoot():a=t.app.vault.getAbstractFileByPath(o),a==null){let s=new Br({errorLevel:"ERROR",effect:"failed to get suggest options",cause:`expected suggest option query ${o} for image suggester to exist`});new ho.Notice(`meta-bind | ${s.message}`),console.warn(s);continue}if(!(a instanceof ho.TFolder)){let s=new Br({errorLevel:"ERROR",effect:"failed to get suggest options",cause:`expected suggest option query ${n.value} for image suggester to be a folder`});new ho.Notice(`meta-bind | ${s.message}`),console.warn(s);continue}i.push(...Bq(a))}for(let n of e){let o=yn(n.value);if(!o){let s=new Br({errorLevel:"ERROR",effect:"failed to get suggest options",cause:`expected suggest option ${n.value} to be truthy`});new ho.Notice(`meta-bind | ${s.message}`),console.warn(s);continue}let a=t.app.vault.getAbstractFileByPath(o);if(!a){let s=new Br({errorLevel:"ERROR",effect:"failed to get suggest options",cause:`expected suggest option ${n.value} for image suggester to exist`});new ho.Notice(`meta-bind | ${s.message}`),console.warn(s);continue}if(!(a instanceof ho.TFile)){let s=new Br({errorLevel:"ERROR",effect:"failed to get suggest options",cause:`expected suggest option ${n.value} for image suggester to be a file`});new ho.Notice(`meta-bind | ${s.message}`),console.warn(s);continue}if(!Oq(a.extension)){let s=new Br({errorLevel:"ERROR",effect:"failed to get suggest options",cause:`expected suggest option ${n.value} for image suggester to be an image file`});new ho.Notice(`meta-bind | ${s.message}`),console.warn(s);continue}i.push(new Ou(a.path,a.name))}return i}function Oq(t){return BA.contains(t)}function Rq(t,e){let r=e.mountable.getArguments("option"),i=e.mountable.getArguments("optionQuery");return Xce(t,r,i)}var Lq=require("obsidian");var ex=class extends Lq.Modal{content;options;constructor(e,r,i){super(e.app),this.options=i,this.content=r,r.setModal(this)}onOpen(){this.options?.title&&this.titleEl.setText(this.options.title),this.options?.classes&&ht.addClasses(this.modalEl,this.options.classes),this.content.mount(this.contentEl)}onClose(){this.content.unmount()}};var bm=require("obsidian"),tx=class extends bm.FuzzySuggestModal{content;constructor(e,r){super(e.app),this.content=r}renderSuggestion(e,r){(0,bm.renderResults)(r.createDiv(),this.content.getItemText(e.item),e.match);let i=this.content.getItemDescription(e.item);i&&(0,bm.renderResults)(r.createEl("small",{cls:"mb-search-modal-element-description"}),i,{score:0,matches:[]})}getItems(){return this.content.getItems()}getItemText(e){return this.content.getItemText(e)}onChooseItem(e,r){this.content.onSelected(e)}};var Uq=require("obsidian");function Kce(t,e,r,i,n){let o=[];for(let a of r)o.push(new Ou(a.value,a.name,"option"));if(i.length>0){let a;try{a=Fq(t)}catch(l){return new Uq.Notice("meta-bind | Dataview needs to be installed and enabled to use suggest option queries. Check the console for more information."),console.warn("meta-bind | failed to get dataview api",l),o}let s=ge.object({name:ge.string().min(1),path:ge.string().min(1)});for(let l of i)a.pages(l.value,e).forEach(c=>{try{let f=c.file;if(!s.safeParse(f).success)return;let m=LI(f.path,f.name,n);o.push(new Ou(m,f.name,`file: ${f.path}`))}catch(f){console.warn("meta-bind | error while computing suggest options",f)}})}return o}function zq(t,e){let r=e.mountable.getArguments("option"),i=e.mountable.getArguments("optionQuery"),n=e.mountable.getArgument("useLinks");return Kce(t,e.mountable.getFilePath(),r,i,n===void 0?"true":n.value)}var Vq=require("obsidian"),rx=class{menu;constructor(){this.menu=new Vq.Menu}setItems(e){for(let r of e)this.menu.addItem(i=>{i.setTitle(r.name),r.icon&&i.setIcon(r.icon),r.warning&&i.setWarning(r.warning),i.onClick(r.onclick)})}show(e,r){this.menu.showAtPosition({x:e,y:r},document)}showWithEvent(e){this.menu.showAtMouseEvent(e),e.stopImmediatePropagation(),e.preventDefault()}};var OA=require("obsidian");var nx=class{mb;containerEl;filePath;jsEngine;code;hidden;renderComponent;constructor(e,r,i,n,o){this.mb=e,this.containerEl=r,this.filePath=i,this.code=n,this.hidden=o,this.jsEngine=Bu(this.mb),this.renderComponent=new OA.Component}async evaluateCode(e){let r=await this.jsEngine.internal.getContextForMarkdownOther(this.filePath);return this.jsEngine.internal.execute({code:this.code,context:r,container:this.containerEl,component:this.renderComponent,contextOverrides:e})}async evaluate(e){try{ht.empty(this.containerEl),ht.removeClass(this.containerEl,"mb-error"),this.renderComponent.unload(),this.renderComponent=new OA.Component,this.renderComponent.load();let r=await this.evaluateCode(e),i=this.jsEngine.internal.createRenderer(this.containerEl,this.filePath,this.renderComponent);return this.hidden||await i.render(r.result),i.convertToSimpleObject(r.result)}catch(r){r instanceof Error&&(this.containerEl.innerText=r.message,ht.addClass(this.containerEl,"mb-error"));return}}unload(){this.renderComponent.unload()}};var ix=class extends Kb{omb;app;constructor(e){super(e),this.omb=e,this.app=e.app}getLifecycleHookValidator(){return ge.instanceof(In.Component)}getImageSuggesterOptions(e){return Rq(this.omb,e)}getSuggesterOptions(e){return zq(this.omb,e)}async renderMarkdown(e,r,i){let n=new In.Component;return n.load(),await In.MarkdownRenderer.render(this.app,e,r,i,n),()=>n.unload()}executeCommandById(e){return this.app.commands.executeCommandById(e)}isJsEngineAvailable(){try{return Bu(this.omb),!0}catch{return!1}}async jsEngineRunFile(e,r,i,n){let o=Bu(this.omb),a=await o.internal.getContextForMarkdownCallingJSFile(r,e),s=new In.Component;return await o.internal.executeFile(e,{component:s,container:n,context:a,contextOverrides:i}),()=>s.unload()}async jsEngineRunCode(e,r,i,n){let o=Bu(this.omb),a=await o.internal.getContextForMarkdownOther(r),s=new In.Component;return await o.internal.execute({code:e,component:s,container:n,context:a,contextOverrides:i}),()=>s.unload()}createJsRenderer(e,r,i,n){return new nx(this.omb,e,r,i,n)}showNotice(e){new In.Notice(e)}parseYaml(e){return(0,In.parseYaml)(e)}stringifyYaml(e){return(0,In.stringifyYaml)(e)}setIcon(e,r){(0,In.setIcon)(e,r)}imagePathToUri(e){return this.app.vault.adapter.getResourcePath(e)}createModal(e,r){return new ex(this.omb,e,r)}createSearchModal(e){return new tx(this.omb,e)}getAllCommands(){return this.app.commands.listCommands().map(e=>({id:e.id,name:e.name}))}createFuzzySearch(){return new Qb}createContextMenu(e){let r=new rx;return r.setItems(e),r}async evaluateTemplaterTemplate(e,r){let i=hA(this.omb),n=this.app.vault.getAbstractFileByPath(e);if(!n||!(n instanceof In.TFile))throw new Error(`Template file not found: ${e}`);let o=this.app.vault.getAbstractFileByPath(r);if(!o||!(o instanceof In.TFile))throw new Error(`Target file not found: ${r}`);let a=i.create_running_config(n,o,4);return await i.read_and_parse_template(a)}async createNoteWithTemplater(e,r,i,n=!1,o=!1){let a=hA(this.omb),s=this.app.vault.getAbstractFileByPath(e);if(!s||!(s instanceof In.TFile))throw new Error(`Template file not found: ${e}`);let l;if(r!==void 0){let c=this.app.vault.getAbstractFileByPath(r);if(!c||!(c instanceof In.TFolder))throw new Error(`Folder not found: ${r}`);l=c}let u=await a.create_new_note_from_template(s,l,i,!1);return n&&u&&await this.mb.file.openInSourceMode(u,o),u?.path}};var RA=require("obsidian");var ox=class extends cf{mb;constructor(e,r,i){super(r,i),this.mb=e,this.mb.plugin.registerEvent(this.mb.app.metadataCache.on("changed",(n,o,a)=>{this.manager.onExternalUpdate(this,n.path,structuredClone(a.frontmatter)??{})}))}readExternal(e){let r=this.mb.app.vault.getAbstractFileByPath(e);if(r==null||!(r instanceof RA.TFile))throw new jt({errorLevel:"CRITICAL",effect:"can not get default cache item",cause:`no file for path "${e}" found or path is not a file`});let i=this.mb.app.metadataCache.getFileCache(r)?.frontmatter;return structuredClone(i)??{}}getDefaultCacheItem(e){let r=this.mb.app.vault.getAbstractFileByPath(e);if(r==null||!(r instanceof RA.TFile))throw new jt({errorLevel:"CRITICAL",effect:"can not get default cache item",cause:`no file for path "${e}" found or path is not a file`});let i=this.mb.app.metadataCache.getFileCache(r)?.frontmatter;return{data:structuredClone(i)??{},storagePath:e,file:r,...this.manager.getDefaultCacheItem()}}async syncExternal(e){return this.mb.app.fileManager.processFrontMatter(e.file,r=>{Object.assign(r,e.data)})}};var xm=class extends ou{ctx;element;constructor(e,r){super(void 0),this.ctx=e,this.element=r}getPosition(){let e=this.ctx.getSectionInfo(this.element);if(e)return{lineStart:e.lineStart,lineEnd:e.lineEnd}}};var qq=require("obsidian");function LA(t,e){Ae(e,!0);let r=new df(e.mb,_r(),"","block",e.declaration);Pu(t,{get mountable(){return r}}),Te()}var Qce=ue('<div class="mb-card"><h3> </h3> <!> <!> <code> </code></div>');function UA(t,e){Ae(e,!0);let r=e.mb.api.createInlineFieldFromString(e.declaration.inputField,"",void 0,"block"),i=e.mb.api.createInlineFieldFromString(e.declaration.declaration,"",void 0,"block");var n=Qce(),o=he(n),a=he(o,!0);pe(o);var s=fe(o,2);Pu(s,{get mountable(){return r}});var l=fe(s,2);Pu(l,{get mountable(){return i}});var u=fe(l,2),c=he(u,!0);pe(u),pe(n),ze(()=>{St(a,e.declaration.title),St(c,e.declaration.display)}),ee(t,n),Te()}var efe=ue("<h1>Meta Bind Playground</h1> <span><!> <!> <!></span>",1),tfe=ue(`<div class="mb-faq-view markdown-rendered"><!> <h2>Quick Reference</h2> <h3>Error Messages</h3> <p>When creating <a>Input Fields</a> or <a>View Fields</a> <strong>warnings</strong> ( <!> ) and <strong>errors</strong> ( <!> ) can occur. These are <strong>clickable</strong> and will show a modal with detailed information about the error
when clicked.</p> <h3>Unloaded Message</h3> <p>A message like this <span class="mb-warning">[MB_UNLOADED] ...</span> means that Obsidian told Meta Bind to unload
the field that was once displayed there. This usually happens when Meta Bind was disabled, such as after a plugin
update, or when another plugin is interfering with Meta Bind.</p> <p>Usually reopening the note or restarting Obsidian causes the field to display normally again.</p> <h3>Bind Targets</h3> <p><a href="https://mprojectscode.github.io/obsidian-meta-bind-plugin-docs/guides/inputfields/#binding-to-metadata">Bind Targets</a> let the plugin know what frontmatter properties to bind <a>Input Fields</a> and <a>View Fields</a> to.</p> <h2>Playground</h2> <h3>Input Fields</h3> <p><a>Input Fields</a> let you change the frontmatter of your notes from inside
of notes.</p> <!> <h3>View Fields</h3> <p><a>View Fields</a> let you view and perform calculations using the frontmatter
of your notes from inside of notes. They will update instantly to reflect changes to the frontmatter made by input
fields and as fast as obsidian allows it for changes from other sources.</p> <!></div>`);function zA(t,e){Ae(e,!0);let r="INPUT[someInputFieldDeclaration]",i=wt(new rr("exampleWarningErrorCollection")),n="INPUT[someInputFieldDeclaration]",o=wt(new rr("exampleErrorErrorCollection"));j_(()=>{i.add(new Ef({errorLevel:"WARNING",effect:"some example warning",cause:"some example reason"})),o.add(new Ef({errorLevel:"ERROR",effect:"some example error",cause:"some example reason"}))});var a=tfe(),s=he(a);Qs(s,{children:(x,E)=>{var T=efe(),D=fe(je(T),2),M=he(D);Dt(M,{get variant(){return"primary"},onclick:()=>{Ht.open(Ht.linkToHome())},children:(O,R)=>{Nt();var L=Gt("Docs");ee(O,L)},$$slots:{default:!0}});var C=fe(M,2);Dt(C,{onclick:()=>{Ht.open(Ht.linkToGithub())},children:(O,R)=>{Nt();var L=Gt("GitHub");ee(O,L)},$$slots:{default:!0}});var $=fe(C,2);Dt($,{onclick:()=>{Ht.open(Ht.linkToIssues())},children:(O,R)=>{Nt();var L=Gt("Report Issue");ee(O,L)},$$slots:{default:!0}}),pe(D),ee(x,T)},$$slots:{default:!0}});var l=fe(s,6),u=fe(he(l)),c=fe(u,2),f=fe(c,4);{let x=fr(()=>({errorCollection:i,code:r}));gf(f,{get mb(){return e.mb},get settings(){return U(x)}})}var m=fe(f,4);{let x=fr(()=>({errorCollection:o,code:n}));gf(m,{get mb(){return e.mb},get settings(){return U(x)}})}Nt(3),pe(l);var p=fe(l,10),d=fe(he(p),2),h=fe(d,2);Nt(),pe(p);var v=fe(p,6),y=he(v);Nt(),pe(v);var S=fe(v,2);Wt(S,17,()=>cq(e.mb),Kt,(x,E)=>{LA(x,{get declaration(){return U(E)[1]},get mb(){return e.mb}})});var b=fe(S,4),_=he(b);Nt(),pe(b);var w=fe(b,2);Wt(w,17,()=>Object.values(pA),Kt,(x,E)=>{var T=Or(),D=je(T);Wt(D,17,()=>U(E),Kt,(M,C)=>{UA(M,{get declaration(){return U(C)},get mb(){return e.mb}})}),ee(x,T)}),pe(a),ze((x,E,T,D,M,C)=>{lt(u,"href",x),lt(c,"href",E),lt(d,"href",T),lt(h,"href",D),lt(y,"href",M),lt(_,"href",C)},[()=>Ht.linkToInputFields(),()=>Ht.linkToViewFields(),()=>Ht.linkToInputFields(),()=>Ht.linkToViewFields(),()=>Ht.linkToInputFields(),()=>Ht.linkToViewFields()]),ee(t,a),Te()}var Il="mb-playground-view-type",ax=class extends qq.ItemView{component;mb;constructor(e,r){super(e),this.mb=r}getViewType(){return Il}getDisplayText(){return"Meta Bind playground"}async onOpen(){this.contentEl.empty(),this.component=Fr(zA,{target:this.contentEl,props:{mb:this.mb}})}async onClose(){this.component&&Dr(this.component)}};var zn=require("obsidian");var jq=require("obsidian");var wm=require("obsidian");var _m=require("obsidian");var rfe=ue("<span> </span> <!> <!> <!>",1),nfe=ue('<div class="mb-card markdown-rendered"><!> <pre class="mb-pre"><code class="mb-none"> </code></pre></div>');function VA(t,e){Ae(e,!0);let r=pt(e,"template",15);function i(){e.mb.internal.openButtonBuilderModal({submitText:"Submit",config:bt(r()),onOkay:c=>{r(c)}})}function n(){let c=(0,_m.stringifyYaml)(bt(r()));navigator.clipboard.writeText(c),new _m.Notice("meta-bind | Copied to clipboard")}var o=nfe(),a=he(o);Qs(a,{stretchChildren:!0,children:(c,f)=>{var m=rfe(),p=je(m),d=he(p,!0);pe(p);var h=fe(p,2);Dt(h,{onclick:()=>i(),get variant(){return"primary"},tooltip:"Edit",children:(S,b)=>{Rr(S,{get mb(){return e.mb},iconName:"pen-line"})},$$slots:{default:!0}});var v=fe(h,2);Dt(v,{onclick:()=>n(),get variant(){return"default"},tooltip:"Copy",children:(S,b)=>{Rr(S,{get mb(){return e.mb},iconName:"copy"})},$$slots:{default:!0}});var y=fe(v,2);Dt(y,{onclick:()=>e.onDelete(r()),get variant(){return"destructive"},tooltip:"Delete",children:(S,b)=>{Rr(S,{get mb(){return e.mb},iconName:"x"})},$$slots:{default:!0}}),ze(()=>St(d,r().id)),ee(c,m)},$$slots:{default:!0}});var s=fe(a,2),l=he(s),u=he(l,!0);pe(l),pe(s),pe(o),ze(c=>St(u,c),[()=>(0,_m.stringifyYaml)(r())]),ee(t,o),Te()}var ife=ue('<div><h3 class="mod-error">Some Templates Failed to Parse</h3> <!></div>'),ofe=ue("<!> <!>",1),afe=ue("<div><h2>Meta Bind Button Templates</h2> <!> <!> <!> <!> <!></div>");function qA(t,e){Ae(e,!0);let r=ft(void 0),i=ft(wt(e.buttonConfigs));function n(v){Re(i,U(i).filter(y=>y!==v),!0)}function o(){U(i).push(e.modal.mb.buttonActionRunner.createDefaultButtonConfig())}async function a(){let v;try{v=(0,wm.parseYaml)(await navigator.clipboard.readText())}catch(S){console.warn(S),new wm.Notice("meta-bind | Can not parse button config. Check your button syntax. See the console for more details.");return}let y=Fc.safeParse(v);if(!y.success){let S=jg(y.error);console.warn(new vs({errorLevel:"ERROR",effect:"can not parse button config",cause:"zod validation failed. Check your button syntax",positionContext:S,docs:[Ht.linkToButtonConfig()]})),new wm.Notice("meta-bind | Can not parse button config. Check your button syntax. See the console for more details.");return}U(i).push(v)}function s(){Re(r,e.modal.save(bt(U(i))),!0),U(r)===void 0&&e.modal.close()}function l(){e.modal.close()}var u=afe(),c=fe(he(u),2);Wt(c,17,()=>U(i),Kt,(v,y,S)=>{VA(v,{get mb(){return e.modal.mb},onDelete:n,get template(){return U(i)[S]},set template(b){U(i)[S]=b}})});var f=fe(c,2);Dt(f,{onclick:()=>o(),get variant(){return"primary"},tooltip:"Create new template",children:(v,y)=>{Nt();var S=Gt("Add Template");ee(v,S)},$$slots:{default:!0}});var m=fe(f,2);Dt(m,{onclick:()=>a(),get variant(){return"default"},tooltip:"Create new template from YAML in clipboard",children:(v,y)=>{Nt();var S=Gt("Add Template from Clipboard");ee(v,S)},$$slots:{default:!0}});var p=fe(m,2);{var d=v=>{var y=ife(),S=fe(he(y),2);{let b=fr(()=>({errorCollection:U(r)}));eu(S,{get settings(){return U(b)}})}pe(y),ee(v,y)};ot(p,v=>{U(r)&&v(d)})}var h=fe(p,2);zo(h,{children:(v,y)=>{var S=ofe(),b=je(S);Dt(b,{onclick:()=>s(),get variant(){return"primary"},tooltip:"Save changes",children:(w,x)=>{Nt();var E=Gt("Save");ee(w,E)},$$slots:{default:!0}});var _=fe(b,2);Dt(_,{onclick:()=>l(),tooltip:"Revert changes",children:(w,x)=>{Nt();var E=Gt("Cancel");ee(w,E)},$$slots:{default:!0}}),ee(v,S)},$$slots:{default:!0}}),pe(u),ee(t,u),Te()}var sx=class extends jq.Modal{mb;component;constructor(e,r){super(e),this.mb=r}onOpen(){this.contentEl.empty(),this.component&&Dr(this.component),this.component=Fr(qA,{target:this.contentEl,props:{buttonConfigs:structuredClone(this.mb.getSettings().buttonTemplates),modal:this}})}onClose(){this.contentEl.empty(),this.component&&Dr(this.component)}save(e){let r=this.mb.buttonManager.setButtonTemplates(e);if(r.hasErrors())return r;this.mb.updateSettings(i=>{i.buttonTemplates=e})}};var Zq=require("obsidian");var sfe=ue('<tr><td class="mb-excluded-folders-table-input-cell"><input type="text" placeholder="path/to/folder"/></td><td><!></td></tr>'),ufe=ue('<div><h3 class="mod-error">Some folder paths are invalid</h3> <!></div>'),lfe=ue("<!> <!>",1),cfe=ue('<div><table class="mb-excluded-folders-table"><thead><tr><th>Folder Path</th><th></th></tr></thead><tbody></tbody></table> <!> <!> <!></div>');function jA(t,e){Ae(e,!0);let r=ft(void 0),i=ft(wt(e.excludedFolders));function n(h){Re(i,U(i).filter(v=>v!==h),!0)}function o(){U(i).push("")}function a(){Re(r,e.modal.save(bt(U(i))),!0),U(r)===void 0&&e.modal.close()}function s(){e.modal.close()}var l=cfe(),u=he(l),c=fe(he(u));Wt(c,21,()=>U(i),Kt,(h,v,y)=>{var S=sfe(),b=he(S),_=he(b);Mt(_),pe(b);var w=fe(b),x=he(w);Dt(x,{onclick:()=>n(U(v)),tooltip:"Delete",children:(E,T)=>{Rr(E,{get mb(){return e.mb},iconName:"x"})},$$slots:{default:!0}}),pe(w),pe(S),At(_,()=>U(i)[y],E=>U(i)[y]=E),ee(h,S)}),pe(c),pe(u);var f=fe(u,2);Dt(f,{onclick:()=>o(),get variant(){return"primary"},tooltip:"Add new excluded folder",children:(h,v)=>{Nt();var y=Gt("Add folder");ee(h,y)},$$slots:{default:!0}});var m=fe(f,2);{var p=h=>{var v=ufe(),y=fe(he(v),2);{let S=fr(()=>({errorCollection:U(r)}));eu(y,{get settings(){return U(S)}})}pe(v),ee(h,v)};ot(m,h=>{U(r)&&h(p)})}var d=fe(m,2);zo(d,{children:(h,v)=>{var y=lfe(),S=je(y);Dt(S,{onclick:()=>a(),get variant(){return"primary"},tooltip:"Save changes",children:(_,w)=>{Nt();var x=Gt("Save");ee(_,x)},$$slots:{default:!0}});var b=fe(S,2);Dt(b,{onclick:()=>s(),tooltip:"Revert changes",children:(_,w)=>{Nt();var x=Gt("Cancel");ee(_,x)},$$slots:{default:!0}}),ee(h,y)},$$slots:{default:!0}}),pe(l),ee(t,l),Te()}var ux=class extends Zq.Modal{mb;component;constructor(e,r){super(e),this.mb=r}onOpen(){this.contentEl.empty(),this.component&&Dr(this.component),this.component=Fr(jA,{target:this.contentEl,props:{excludedFolders:structuredClone(this.mb.getSettings().excludedFolders),modal:this,mb:this.mb}})}onClose(){this.contentEl.empty(),this.component&&Dr(this.component)}save(e){for(let r of e)if(r===""){let i=new rr("Excluded folders");return i.add(new Error(`Invalid Folder Path '${r}'. Folder path may not be empty.`)),i}this.mb.updateSettings(r=>{r.excludedFolders=e})}};var Gq=require("obsidian");var ffe=ue('<input type="text" placeholder="template-name"/> <!>',1),pfe=ue('<div class="mb-card"><!> <textarea placeholder="INPUT[slider(addLabels)]" class="mb-textarea"></textarea></div>');function ZA(t,e){Ae(e,!0);let r=pt(e,"template",15);var i=pfe(),n=he(i);Qs(n,{children:(a,s)=>{var l=ffe(),u=je(l);Mt(u);var c=fe(u,2);Dt(c,{onclick:()=>e.onDelete(r()),get variant(){return"destructive"},tooltip:"Delete Template",children:(f,m)=>{Rr(f,{get mb(){return e.mb},iconName:"x"})},$$slots:{default:!0}}),At(u,()=>r().name,f=>r(r().name=f,!0)),ee(a,l)},$$slots:{default:!0}});var o=fe(n,2);Cn(o),pe(i),At(o,()=>r().declaration,a=>r(r().declaration=a,!0)),ee(t,i),Te()}var mfe=ue('<div><h3 class="mod-error">Some Templates Failed to Parse</h3> <!></div>'),dfe=ue("<!> <!>",1),hfe=ue("<div><h2>Meta Bind Input Field Templates</h2> <!> <!> <!> <!></div>");function GA(t,e){Ae(e,!0);let r=ft(void 0),i=ft(wt(e.inputFieldTemplates));function n(d){Re(i,U(i).filter(h=>h!==d),!0)}function o(){U(i).push({name:"",declaration:""})}function a(){Re(r,e.modal.save(bt(U(i))),!0),U(r)===void 0&&e.modal.close()}function s(){e.modal.close()}var l=hfe(),u=fe(he(l),2);Wt(u,17,()=>U(i),Kt,(d,h)=>{ZA(d,{get mb(){return e.modal.mb},get template(){return U(h)},onDelete:n})});var c=fe(u,2);Dt(c,{onclick:()=>o(),get variant(){return"primary"},tooltip:"Create New Template",children:(d,h)=>{Nt();var v=Gt("Add Template");ee(d,v)},$$slots:{default:!0}});var f=fe(c,2);{var m=d=>{var h=mfe(),v=fe(he(h),2);{let y=fr(()=>({errorCollection:U(r)}));eu(v,{get settings(){return U(y)}})}pe(h),ee(d,h)};ot(f,d=>{U(r)&&d(m)})}var p=fe(f,2);zo(p,{children:(d,h)=>{var v=dfe(),y=je(v);Dt(y,{onclick:()=>a(),get variant(){return"primary"},tooltip:"Save Changes",children:(b,_)=>{Nt();var w=Gt("Save");ee(b,w)},$$slots:{default:!0}});var S=fe(y,2);Dt(S,{onclick:()=>s(),tooltip:"Revert Changes",children:(b,_)=>{Nt();var w=Gt("Cancel");ee(b,w)},$$slots:{default:!0}}),ee(d,v)},$$slots:{default:!0}}),pe(l),ee(t,l),Te()}var lx=class extends Gq.Modal{mb;component;constructor(e,r){super(e),this.mb=r}onOpen(){this.contentEl.empty(),this.component&&Dr(this.component),this.component=Fr(GA,{target:this.contentEl,props:{inputFieldTemplates:structuredClone(this.mb.getSettings().inputFieldTemplates),modal:this}})}onClose(){this.contentEl.empty(),this.component&&Dr(this.component)}save(e){let r=this.mb.inputFieldParser.parseTemplates(e);if(r.hasErrors())return r;this.mb.updateSettings(i=>{i.inputFieldTemplates=e})}};var cx=class extends zn.PluginSettingTab{mb;constructor(e,r){super(e,r.plugin),this.mb=r}display(){let{containerEl:e}=this;if(e.empty(),this.mb.build==="dev"||this.mb.build==="canary"){e.createEl("p",{text:`You are using a ${this.mb.build} build (1.4.5). This build is not intended for production use. Use at your own risk.`,cls:"mb-error"});let r=new zn.ButtonComponent(e);r.setButtonText("Learn About Canary Builds"),r.setCta(),r.onClick(()=>{Ht.open(Ht.linkToCanaryBuilds())})}new zn.Setting(e).setName("Quick access").addButton(r=>{r.setCta(),r.setButtonText("Docs"),r.onClick(()=>{Ht.open(Ht.linkToHome())})}).addButton(r=>{r.setButtonText("Open FAQ"),r.onClick(()=>{this.mb.activateView(Il)})}).addButton(r=>{r.setButtonText("GitHub"),r.onClick(()=>{Ht.open(Ht.linkToGithub())})}).addButton(r=>{r.setButtonText("Report issue"),r.onClick(()=>{Ht.open(Ht.linkToIssues())})}),new zn.Setting(e).setName("Enable syntax highlighting").setDesc("Enable syntax highlighting for meta bind syntax. RESTART REQUIRED.").addToggle(r=>{r.setValue(this.mb.getSettings().enableSyntaxHighlighting),r.onChange(i=>{this.mb.updateSettings(n=>{n.enableSyntaxHighlighting=i})})}),new zn.Setting(e).setName("Enable editor right-click menu").setDesc("Enable a meta bind menu section in the editor right-click menu. RESTART REQUIRED.").addToggle(r=>{r.setValue(this.mb.getSettings().enableEditorRightClickMenu),r.onChange(i=>{this.mb.updateSettings(n=>{n.enableEditorRightClickMenu=i})})}),new zn.Setting(e).setName("Input field templates").setDesc("You can specify input field templates here, and access them using `INPUT[template_name][overrides (optional)]` in your notes.").addButton(r=>{r.setButtonText("Edit templates"),r.onClick(()=>{new lx(this.app,this.mb).open()})}),new zn.Setting(e).setName("Button templates").setDesc("You can specify button field templates here, and access them in inline buttons.").addButton(r=>{r.setButtonText("Edit templates"),r.onClick(()=>{new sx(this.app,this.mb).open()})}),new zn.Setting(e).setName("Excluded folders").setDesc("You can specify excluded folders here. The plugin will not work within excluded folders.").addButton(r=>{r.setButtonText("Edit excluded folders"),r.onClick(()=>{new ux(this.app,this.mb).open()})}),new zn.Setting(e).setName("View fields display null as empty").setDesc("Display nothing instead of null, if the frontmatter value is empty, in text view fields.").addToggle(r=>{r.setValue(this.mb.getSettings().viewFieldDisplayNullAsEmpty),r.onChange(i=>{this.mb.updateSettings(n=>{n.viewFieldDisplayNullAsEmpty=i})})}),new zn.Setting(e).setName("Enable JavaScript").setDesc("Enable features that run user written JavaScript. This is potentially DANGEROUS, thus it's disabled by default. RESTART REQUIRED.").addToggle(r=>{r.setValue(this.mb.getSettings().enableJs),r.onChange(i=>{this.mb.updateSettings(n=>{n.enableJs=i})})}),new zn.Setting(e).setName("Date and time").setHeading(),new zn.Setting(e).setName("Date format").setDesc("The date format to be used by this plugin. Changing this setting will break the parsing of existing date inputs. Here is a list of all available date tokes https://momentjs.com/docs/#/displaying/.").addText(r=>{r.setValue(this.mb.getSettings().preferredDateFormat),r.onChange(i=>{this.mb.updateSettings(n=>{n.preferredDateFormat=i})})}),new zn.Setting(e).setName("First weekday").setDesc("Specify the first weekday for the datepicker.").addDropdown(r=>{for(let i of hl)r.addOption(i.name,i.name);r.setValue(this.mb.getSettings().firstWeekday.name),r.onChange(i=>{this.mb.updateSettings(n=>{n.firstWeekday=hl.find(o=>o.name===i)})})}),new zn.Setting(e).setName("Advanced").setHeading(),new zn.Setting(e).setName("Dev mode").setDesc("Enable dev mode. Not recommended unless you want to debug this plugin.").addToggle(r=>{r.setValue(this.mb.getSettings().devMode),r.onChange(i=>{this.mb.updateSettings(n=>{n.devMode=i})})}),new zn.Setting(e).setName("Disable code block restrictions").setDesc("Disable restrictions on which input fields can be created in which code blocks. Not recommended unless you know what you are doing.").addToggle(r=>{r.setValue(this.mb.getSettings().ignoreCodeBlockRestrictions),r.onChange(i=>{this.mb.updateSettings(n=>{n.ignoreCodeBlockRestrictions=i})})}),new zn.Setting(e).setName("Sync interval").setDesc(`The interval in milli-seconds between disk writes. Changing this number is not recommended except if your hard drive is exceptionally slow. Standard: ${Gp.syncInterval}; Minimum: ${wv}; Maximum: ${Sv}`).addText(r=>{r.setValue(this.mb.getSettings().syncInterval.toString()),r.onChange(i=>{this.mb.updateSettings(n=>{n.syncInterval=Number.parseInt(i),Number.isNaN(n.syncInterval)&&(n.syncInterval=Gp.syncInterval),n.syncInterval<wv&&(n.syncInterval=wv),n.syncInterval>Sv&&(n.syncInterval=Sv)})})})}};var fx=class extends Sb{app;plugin;dependencyManager;constructor(e){super(),this.app=e.app,this.plugin=e,this.setComponents({api:new qb(this),internal:new ix(this),file:new Zb(this)}),this.plugin.addSettingTab(new cx(this.app,this)),this.dependencyManager=new Mb(this,[]),this.setUpDependencies(),this.setUpMetadataManager(),this.loadTemplates(),this.addPostProcessors(),this.plugin.registerEditorExtension(sq(this)),this.addCommands(),oq(this),this.plugin.registerView(Il,r=>new ax(r,this)),this.addStatusBarBuildIndicator(),this.getSettings().enableEditorRightClickMenu&&this.plugin.registerEvent(this.app.workspace.on("editor-menu",(r,i)=>{dq(r,i,this)}))}setUpDependencies(){this.dependencyManager.dependencies=[{name:"Dataview",pluginId:"dataview",minVersion:new ca(0,5,64)},{name:"JS Engine",pluginId:"js-engine",minVersion:new ca(0,3,0)},{name:"Templater",pluginId:"templater-obsidian",minVersion:new ca(2,2,3)}]}setUpMetadataManager(){this.metadataManager=new bc,this.metadataManager.registerSource(new ox(this,"frontmatter",this.metadataManager)),this.metadataManager.registerSource(new Db("memory",this.metadataManager)),this.metadataManager.registerSource(new Eb("globalMemory",this.metadataManager)),this.metadataManager.registerSource(new Ab("scope",this.metadataManager)),this.metadataManager.setDefaultSource("frontmatter"),this.plugin.registerEvent(this.app.vault.on("rename",(e,r)=>{this.mountableManager.unloadFile(r),this.metadataManager.onStoragePathRenamed(r,e.path)})),this.plugin.registerEvent(this.app.vault.on("delete",e=>{this.mountableManager.unloadFile(e.path),this.metadataManager.onStoragePathDeleted(e.path)})),this.plugin.registerInterval(window.setInterval(()=>this.metadataManager.cycle(),this.getSettings().syncInterval))}addPostProcessors(){this.plugin.registerMarkdownPostProcessor((e,r)=>{let i=e.querySelectorAll("code"),n=r.sourcePath;for(let o=0;o<i.length;o++){let a=i.item(o);if(a.hasClass("mb-none"))continue;let s=a.innerText,l=this.api.isInlineFieldDeclarationAndGetType(s);if(l===void 0)continue;let u=this.api.createInlineFieldOfTypeFromString(l,s,n,void 0);this.api.wrapInMDRC(u,a,r)}},1),this.plugin.registerMarkdownCodeBlockProcessor("meta-bind",async(e,r,i)=>{await(0,os.loadPrism)();let n=r,o=e.trim(),a=i.sourcePath,s=this.api.isInlineFieldDeclarationAndGetType(o);if(s===void 0)return;let l=this.api.createInlineFieldOfTypeFromString(s,o,a,void 0,"block",new xm(i,r));this.api.wrapInMDRC(l,n,i)}),this.plugin.registerMarkdownCodeBlockProcessor("meta-bind-js-view",async(e,r,i)=>{await(0,os.loadPrism)();let n=this.api.createJsViewFieldMountable(i.sourcePath,{declaration:e});this.api.wrapInMDRC(n,r,i)}),this.plugin.registerMarkdownCodeBlockProcessor("meta-bind-embed",async(e,r,i)=>{await(0,os.loadPrism)();let n=this.api.createEmbedMountable(i.sourcePath,{content:e,depth:0});this.api.wrapInMDRC(n,r,i)});for(let e=1;e<=Ed;e++)this.plugin.registerMarkdownCodeBlockProcessor(`meta-bind-embed-internal-${e}`,async(r,i,n)=>{await(0,os.loadPrism)();let o=this.api.createEmbedMountable(n.sourcePath,{content:r,depth:e});this.api.wrapInMDRC(o,i,n)});this.plugin.registerMarkdownCodeBlockProcessor("meta-bind-button",async(e,r,i)=>{await(0,os.loadPrism)();let n=this.api.createButtonMountable(i.sourcePath,{declaration:e,isPreview:!1,position:new xm(i,r)});this.api.wrapInMDRC(n,r,i)})}addCommands(){this.plugin.addCommand({id:"open-docs",name:"Open docs",callback:()=>{window.open("https://mprojectscode.github.io/obsidian-meta-bind-plugin-docs/","_blank")}}),this.plugin.addCommand({id:"open-playground",name:"Open playground",callback:()=>{this.activateView(Il)}}),this.plugin.addCommand({id:"open-help",name:"Open Help",callback:()=>{this.activateView(Il)}}),this.plugin.addCommand({id:"open-button-builder",name:"Open button builder",callback:()=>{this.internal.openButtonBuilderModal({onOkay:e=>{window.navigator.clipboard.writeText(`\`\`\`meta-bind-button
${(0,os.stringifyYaml)(e)}
\`\`\``)},submitText:"Copy to Clipboard"})}}),this.plugin.addCommand({id:"copy-command-id",name:"Select and copy command id",callback:()=>{this.internal.openCommandSelectModal(e=>{window.navigator.clipboard.writeText(e.id)})}})}addStatusBarBuildIndicator(){if(this.build==="dev"){let e=this.plugin.addStatusBarItem();e.setText("Meta Bind Dev Build"),e.addClass("mb-error"),this.plugin.register(()=>e.remove())}if(this.build==="canary"){let e=this.plugin.addStatusBarItem();e.setText("Meta Bind Canary Build (1.4.5)"),e.addClass("mb-error"),this.plugin.register(()=>e.remove())}}async activateView(e){let{workspace:r}=this.app,i,n=r.getLeavesOfType(e);n.length>0?i=n[0]:(i=r.getLeaf("tab"),await i.setViewState({type:e,active:!0})),await r.revealLeaf(i)}getSettings(){return this.plugin.settings}saveSettings(e){this.plugin.settings=e,this.plugin.saveSettings()}},px=class extends os.Plugin{mb;api;settings;async onload(){console.log("meta-bind | Main >> loading"),console.time("meta-bind | Main >> load-time"),await this.loadSettings(),this.mb=new fx(this),this.api=this.mb.api,this.mb.updateInternalSettings(this.settings),console.timeEnd("meta-bind | Main >> load-time")}onunload(){this.mb.destroy(),console.log("meta-bind | Main >> unload")}async loadSettings(){console.log("meta-bind | Main >> loading settings");let e=await this.loadData()??{};typeof e=="object"&&e!=null&&(delete e.inputTemplates,delete e.useUsDateInputOrder),this.settings=Object.assign({},Gp,e),bs(e,this.settings)||await this.saveSettings()}async saveSettings(){console.log("meta-bind | Main >> settings save"),await this.saveData(this.settings)}async onExternalSettingsChange(){await this.loadSettings(),this.mb.updateInternalSettings(this.settings)}};
/*! Bundled license information:
moment/moment.js:
(*! moment.js *)
(*! version : 2.30.1 *)
(*! authors : Tim Wood, Iskren Chernev, Moment.js contributors *)
(*! license : MIT *)
(*! momentjs.com *)
decimal.js/decimal.mjs:
(*!
* decimal.js v10.5.0
* An arbitrary-precision Decimal type for JavaScript.
* https://github.com/MikeMcl/decimal.js
* Copyright (c) 2025 Michael Mclaughlin <M8ch88l@gmail.com>
* MIT Licence
*)
*/
/* nosourcemap */