WritingSpace/.obsidian/plugins/obsidian-meta-bind-plugin/main.js

178 lines
1.1 MiB
JavaScript
Raw Normal View History

2025-01-22 08:00:25 +00:00
/*
-------------------------------------------
Meta Bind - Release Build
-------------------------------------------
By: Moritz Jung (https://www.moritzjung.dev/)
2025-07-15 10:58:45 +00:00
Time: Wed, 28 May 2025 10:09:10 GMT
Version: 1.4.2
2025-01-22 08:00:25 +00:00
-------------------------------------------
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/>.
*/
2025-07-15 10:58:45 +00:00
"use strict";var g8=Object.create;var Fp=Object.defineProperty;var v8=Object.getOwnPropertyDescriptor;var y8=Object.getOwnPropertyNames;var b8=Object.getPrototypeOf,x8=Object.prototype.hasOwnProperty;var On=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),F_=(t,e)=>{for(var r in e)Fp(t,r,{get:e[r],enumerable:!0})},I_=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of y8(e))!x8.call(t,i)&&i!==r&&Fp(t,i,{get:()=>e[i],enumerable:!(n=v8(e,i))||n.enumerable});return t};var Tr=(t,e,r)=>(r=t!=null?g8(b8(t)):{},I_(e||!t||!t.__esModule?Fp(r,"default",{value:t,enumerable:!0}):r,t)),w8=t=>I_(Fp({},"__esModule",{value:!0}),t);var Bp=On(Ui=>{"use strict";Object.defineProperty(Ui,"__esModule",{value:!0});Ui.P_HELPERS=Ui.ParserHelpers=Ui.validateRegexFlags=Ui.validateRange=Ui.getIndex=Ui.arrayUnion=void 0;var Ay=kp();function _8(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 n of e)r.includes(n)||r.push(n);return r}Ui.arrayUnion=_8;function A8(t){return t===void 0?-1:t.index}Ui.getIndex=A8;function D8(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}].`)}Ui.validateRange=D8;function S8(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'.`)}Ui.validateRegexFlags=S8;var Ip=class{followedBy(e){return new Ay.Parser(function(n){return e.p(n.copy())})}notFollowedBy(e){return new Ay.Parser(function(n){let i=n.copy(),a=e.p(i),o=n.sliceTo(i.position.index);return a.success?n.fail("not '"+o+"'"):n.succeed(void 0)})}test(e){return new Ay.Parser(function(n){let i=n.input[n.position.index];return!n.atEOF()&&e(i)?n.succeedOffset(1,i):n.fail(`a character matching ${e}`)})}};Ui.ParserHelpers=Ip;Ui.P_HELPERS=new Ip});var B_=On(Pp=>{"use strict";Object.defineProperty(Pp,"__esModule",{value:!0});Pp.ParserContext=void 0;var Dy=Bp(),Sy=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 n=(0,Dy.getIndex)(e.furthest),i=(0,Dy.getIndex)(r.furthest);if(i>n)return r;let a=i===n?(0,Dy.arrayUnion)(e.expected,r.expected):e.expected;return r.furthest=e.furthest,r.expected=a,r}};Pp.ParserContext=Sy});var qi=On(Op=>{"use strict";Object.defineProperty(Op,"__esModule",{value:!0});Op.P=void 0;var aa=kp(),$p=Bp(),Ey=class t{static sequence(...e){if(e.length===0)throw new Error("sequence must have at least one parser argument");return new aa.Parser(function(n){let i,a=new Array(e.length);for(let o=0;o<e.length;o++){let l=e[o].p(n);if(i=n.merge(i,l),!i.success)return i;a[o]=i.value}return i.value=a,i})}static sequenceMap(e,...r){if(r.length===0)throw new Error("sequenceMap must have at least one parser argument");return new aa.Parser(function(i){let a,o=new Array(r.length);for(let s=0;s<r.length;s++){let u=r[s].p(i);if(a=i.merge(a,u),!a.success)return a;o[s]=a.value}return a.value=e(...o),a})}static createLanguage(e){let r={},n={},i={};for(let a in e)i[a]=t.reference(()=>e[a](r,i)),Object.defineProperty(n,a,{get:()=>{if(r[a]!==void 0)return r[a];throw new Error(`Can not access rule '${a}' in language. Rule is not yet defined. Try to access it via 'ref'.`)}});for(let a in e)r[a]=e[a](n,i);return r}static or(...e){if(e.length===0)throw new Error("or must have at least one alternative");return new aa.Parser(function(n){let i;for(let a of e){let o=a,s=n.copy(),l=o.p(s);if(i=n.merge(i,l),i.success)return n.moveToPosition(s.position),i}return i})}static separateBy(e,r){return this.separateByNotEmpty(e,r).or(t.succeed([]))}static separateByNotEmpty(e,r){return this.sequenceMap(function(i,a){return a.unshift(i),a},e,r.then(e).many())}static string(e){let r="'"+e+"'";return new aa.Parser(function(i){for(let a=0;a<e.length;a++)if(i.input[i.position.index+a]!==e[a])return i.fail(r);return i.succeedAt(i.position.index+e.length,e)})}static regexp(e,r){(0,$p.validateRegexFlags)(e.flags);let n=e.source;return r!==void 0?new aa.Parser(function(a){let o=a.input.slice(a.position.index),s=e.exec(o);if(s!==null){let l=r??0;if(l>=0&&l<=s.length){let c=s[0],f=s[l];return a.succeedOffset(c.length,f)}let u="expected valid match group (0 to "+s.length+") in "+n;return a.fail(u)}else return a.fail(n)}):new aa.Parser(function(a){let o=a.input.slice(a.position.index),s=e.exec(o);if(s!==null){let l=s[0];return a.succeedOffset(l.length,l)}else return a.fail(n)})}static succeed(e){return new aa.Parser(function(n){return n.succeed(e)})}static fail(e){return new aa.Parser(function(n){return n.fail(e)})}static oneOf(e){return $p.P_HELPERS.test(function(n){return e.includes(n)}).describe(`one character of '${e}'`)}static noneOf(e){return $p.P_HELPERS.test(function(n){return!e.includes(n)}).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 aa.Parser(function(n){let i=n.position.index;for(;i<n.input.length&&e.includes(n.input[i]);i++);return n.succeedAt(i,n.sliceTo(i))})}static manyNotOf(e){return new aa.Parser(function(n){let i=n.position.index;for(;i<n.input.length&&!e.includes(n.input[i]);i++);return n.succeedAt(i,n.sliceTo(i))})}static custom(e){return new aa.Parser(e)}static range(e,r){let n=e.charCodeAt(0),i=r.charCodeAt(0);return $p.P_HELPERS.test(function(o){let s=o.charCodeAt(0);return n<=s&&s<=i}).describe(`${e}-${r}`)}static takeWhile(e){return new aa.Parser(function(n){let i=n.position.index;for(;i<n.i
2025-01-22 08:00:25 +00:00
`)[e.furthest.line-1],s=`${e.furthest.line} | `;i+=`
${s}${o}`,i+=`
2025-07-15 10:58:45 +00:00
${" ".repeat(e.furthest.column-1+s.length)}^ (${n})`}return i}xl.createParsingErrorMessage=k_;var Ty=class extends Error{constructor(e,r){super(k_(e,r,!0))}};xl.ParsingError=Ty});var kp=On(Rp=>{"use strict";Object.defineProperty(Rp,"__esModule",{value:!0});Rp.Parser=void 0;var E8=B_(),Na=qi(),My=Bp(),wl=oa(),T8=P_(),Cy=class t{constructor(e){this.p=e}tryParse(e){return this.p(new E8.ParserContext(e,{index:0,line:1,column:1}))}parse(e){let r=this.tryParse(e);if(r.success)return r.value;throw new T8.ParsingError(e,r)}or(e){return Na.P.or(this,e)}trim(e){return this.wrap(e,e)}trimString(e){return this.trim(Na.P.string(e))}wrap(e,r){let n=this;return new t(function(a){let o=e.p(a);if(!o.success)return o;let s=a.merge(o,n.p(a));if(!s.success)return s;let l=a.merge(s,r.p(a));return l.success?a.merge(l,a.succeed(s.value)):l})}wrapString(e,r){return this.wrap(Na.P.string(e),Na.P.string(r))}then(e){let r=this;return new t(function(i){let a=r.p(i);if(!a.success)return a;let o=i.merge(a,e.p(i));return o.success,o})}skip(e){let r=this;return new t(function(i){let a=r.p(i);if(!a.success)return a;let o=i.merge(a,e.p(i));return o.success?i.merge(o,i.succeed(a.value)):o})}and(e){return Na.P.sequence(this,e)}many(){let e=this;return new t(function(n){let i,a=n.position.index,o=[];for(;;){let s=n.copy(),l=e.p(s);if(i=n.merge(i,l),i.success){if(s.position.index===a)throw new Error("infinite loop in many() parser detected");n.moveToPosition(s.position),o.push(i.value)}else return n.merge(i,n.succeed(o))}})}repeat(e,r){(0,My.validateRange)(e,r);let n=this;return new t(function(a){let o,s,l=[],u=0;for(;u<e;u++)if(o=n.p(a),s=a.merge(s,o),o.success)l.push(o.value);else return s;for(;u<r;u++){let c=a.copy();if(o=n.p(c),s=a.merge(s,o),o.success)a.moveToPosition(c.position),l.push(o.value);else break}return a.merge(s,a.succeed(l))})}atMost(e){return this.repeat(0,e)}atLeast(e){return Na.P.sequenceMap((r,n)=>r.concat(n),this.repeat(e,e),this.many())}separateBy(e){return Na.P.separateBy(this,e)}separateByNotEmpty(e){return Na.P.separateByNotEmpty(this,e)}result(e){return this.map(()=>e)}map(e){let r=this;return new t(function(i){let a=r.p(i);return a.success&&(a.value=e(a.value)),a})}marker(){return Na.P.sequenceMap(function(r,n,i){return{value:n,range:{from:r,to:i}}},wl.P_UTILS.position(),this,wl.P_UTILS.position())}namedMarker(e){return Na.P.sequenceMap(function(n,i,a){return{value:i,name:e,range:{from:n,to:a}}},wl.P_UTILS.position(),this,wl.P_UTILS.position())}node(e){return Na.P.sequenceMap(function(n,i,a){return e(i,{from:n,to:a})},wl.P_UTILS.position(),this,wl.P_UTILS.position())}followedBy(e){return this.skip(My.P_HELPERS.followedBy(e))}notFollowedBy(e){return this.skip(My.P_HELPERS.notFollowedBy(e))}describe(e){typeof e=="string"&&(e=[e]);let r=this;return new t(function(i){let a=r.p(i);return a.expected!==void 0&&a.expected.length!==0&&(a.expected=e),a})}box(e){let r=this;return new t(function(i){var a;let o=r.p(i);return o.expected!==void 0&&o.expected.length!==0&&(o.expected=[`(${(a=o.expected)===null||a===void 0?void 0:a.join(" or ")} as part of ${e})`]),o})}optional(e){return this.or(Na.P.succeed(e))}chain(e){let r=this;return new t(function(i){let a=r.p(i);if(!a.success)return a;let s=e(a.value).p(i);return i.merge(a,s)})}thenEof(){let e=this;return new t(function(n){let i=e.p(n);return i.success?n.atEOF()?i:n.merge(i,n.fail("eof")):i})}memorize(){let e=this,r="",n=new Map,i=new Map;return new t(function(o){let s=o.position.index;if(o.input!==r)r=o.input,n.clear(),i.clear();else{let u=n.get(s),c=i.get(s);if(u!==void 0&&c!==void 0)return o.moveToPosition(Object.assign({},c)),Object.assign({},u)}let l=e.p(o);return n.set(s,Object.assign({},l)),i.set(s,o.getPosition()),l})}};Rp.Parser=Cy});var oa=On(Vp=>{"use strict";Object.defineProperty(Vp,"__esModule",{value:!0});Vp.P_UTILS=void 0;var Lp=kp(),Hr=qi(),Ny=class t{static position(){return new Lp.Parser(e=>e.succeed(e.getPosition()))}static any(){return new Lp.Parser(e=>e.atEOF()?e.fail("any character"):e.succeedOffset(1,e.input[e.position.index]))}static remaining(){return new Lp.Parser(
`)}static crlf(){return Hr.P.string(`\r
`)}static newline(){return Hr.P.or(this.crlf(),this.lf(),this.cr()).describe("newline")}static prefix(e,r,n){return Hr.P.sequenceMap((i,a)=>i.reduce((o,s)=>n(s,o),a),e.many(),r)}static postfix(e,r,n){return Hr.P.sequenceMap((i,a)=>a.reduce((o,s)=>n(s,o),i),r,e.many())}static binaryRight(e,r,n){return Hr.P.sequenceMap((i,a)=>i.reverse().reduce((o,s)=>{let[l,u]=s;return n(l,u,o)},a),Hr.P.sequence(r,e.trim(this.optionalWhitespace())).many(),r)}static binaryLeft(e,r,n){return Hr.P.sequenceMap((i,a)=>a.reduce((o,s)=>{let[l,u]=s;return n(o,l,u)},i),r,Hr.P.sequence(e.trim(this.optionalWhitespace()),r).many())}static binaryRightRange(e,r,n){return Hr.P.sequenceMap((i,a,o)=>i.reverse().reduce((s,l)=>{let[u,c,f]=l;return n({from:u,to:o},c,f,s)},a),Hr.P.sequence(t.position(),r,e.trim(this.optionalWhitespace())).many(),r,t.position())}static binaryLeftRange(e,r,n){return Hr.P.sequenceMap((i,a,o)=>o.reduce((s,l)=>{let[u,c,f]=l;return n({from:i,to:f},s,u,c)},a),t.position(),r,Hr.P.sequence(e.trim(this.optionalWhitespace()),r,t.position()).many())}static func(e,r,n){let i=typeof e=="string"?Hr.P.string(e):e;return Hr.P.sequenceMap((a,o,s,l,u,c)=>n(a,l),i,Hr.P.string("("),this.optionalWhitespace(),r,this.optionalWhitespace(),Hr.P.string(")"))}};Vp.P_UTILS=Ny});var Bf=On((Ib,Xl)=>{(function(t,e){typeof Ib=="object"&&typeof Xl<"u"?Xl.exports=e():typeof define=="function"&&define.amd?define(e):t.moment=e()})(Ib,function(){"use strict";var t;function e(){return t.apply(null,arguments)}function r(g){t=g}function n(g){return g instanceof Array||Object.prototype.toString.call(g)==="[object Array]"}function i(g){return g!=null&&Object.prototype.toString.call(g)==="[object Object]"}function a(g,S){return Object.prototype.hasOwnProperty.call(g,S)}function o(g){if(Object.getOwnPropertyNames)return Object.getOwnPropertyNames(g).length===0;var S;for(S in g)if(a(g,S))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,S){var B=[],$,H=g.length;for($=0;$<H;++$)B.push(S(g[$],$));return B}function f(g,S){for(var B in S)a(S,B)&&(g[B]=S[B]);return a(S,"toString")&&(g.toString=S.toString),a(S,"valueOf")&&(g.valueOf=S.valueOf),g}function m(g,S,B,$){return u_(g,S,B,$,!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 S=Object(this),B=S.length>>>0,$;for($=0;$<B;$++)if($ in S&&g.call(this,S[$],$,S))return!0;return!1};function b(g){var S=null,B=!1,$=g._d&&!isNaN(g._d.getTime());if($&&(S=d(g),B=h.call(S.parsedDateParts,function(H){return H!=null}),$=S.overflow<0&&!S.empty&&!S.invalidEra&&!S.invalidMonth&&!S.invalidWeekday&&!S.weekdayMismatch&&!S.nullInput&&!S.invalidFormat&&!S.userInvalidated&&(!S.meridiem||S.meridiem&&B),g._strict&&($=$&&S.charsLeftOver===0&&S.unusedTokens.length===0&&S.bigHour===void 0)),Object.isFrozen==null||!Object.isFrozen(g))g._isValid=$;else return $;return g._isValid}function y(g){var S=m(NaN);return g!=null?f(d(S),g):d(S).userInvalidated=!0,S}var D=e.momentProperties=[],v=!1;function A(g,S){var B,$,H,ae=D.length;if(s(S._isAMomentObject)||(g._isAMomentObject=S._isAMomentObject),s(S._i)||(g._i=S._i),s(S._f)||(g._f=S._f),s(S._l)||(g._l=S._l),s(S._strict)||(g._strict=S._strict),s(S._tzm)||(g._tzm=S._tzm),s(S._isUTC)||(g._isUTC=S._isUTC),s(S._offset)||(g._offset=S._offset),s(S._pf)||(g._pf=d(S)),s(S._locale)||(g._locale=S._locale),ae>0)for(B=0;B<ae;B++)$=D[B],H=S[$],s(H)||(g[$]=H);return g}function w(g){A(this,g),this._d=new Date(g._d!=null?g._d.getTime():NaN),this.isValid()||(this._d=new Date(NaN)),v===!1&&(v=!0,e.updateOffset(this),v=!1)}function x(g){return g instanceof w||g!=null&&g._isAMomentObject!=null}function E(g)
[`+ae+"] ";for(Te in arguments[0])a(arguments[0],Te)&&(H+=Te+": "+arguments[0][Te]+", ");H=H.slice(0,-2)}else H=arguments[ae];$.push(H)}E(g+`
Arguments: `+Array.prototype.slice.call($).join("")+`
`+new Error().stack),B=!1}return S.apply(this,arguments)},S)}var _={};function C(g,S){e.deprecationHandler!=null&&e.deprecationHandler(g,S),_[g]||(E(S),_[g]=!0)}e.suppressDeprecationWarnings=!1,e.deprecationHandler=null;function N(g){return typeof Function<"u"&&g instanceof Function||Object.prototype.toString.call(g)==="[object Function]"}function I(g){var S,B;for(B in g)a(g,B)&&(S=g[B],N(S)?this[B]=S:this["_"+B]=S);this._config=g,this._dayOfMonthOrdinalParseLenient=new RegExp((this._dayOfMonthOrdinalParse.source||this._ordinalParse.source)+"|"+/\d{1,2}/.source)}function R(g,S){var B=f({},g),$;for($ in S)a(S,$)&&(i(g[$])&&i(S[$])?(B[$]={},f(B[$],g[$]),f(B[$],S[$])):S[$]!=null?B[$]=S[$]:delete B[$]);for($ in g)a(g,$)&&!a(S,$)&&i(g[$])&&(B[$]=f({},B[$]));return B}function L(g){g!=null&&this.set(g)}var V;Object.keys?V=Object.keys:V=function(g){var S,B=[];for(S in g)a(g,S)&&B.push(S);return B};var P={sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"};function k(g,S,B){var $=this._calendar[g]||this._calendar.sameElse;return N($)?$.call(S,B):$}function W(g,S,B){var $=""+Math.abs(g),H=S-$.length,ae=g>=0;return(ae?B?"+":"":"-")+Math.pow(10,Math.max(0,H)).toString().substr(1)+$}var O=/(\[[^\[]*\])|(\\)?([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,ne={},X={};function U(g,S,B,$){var H=$;typeof $=="string"&&(H=function(){return this[$]()}),g&&(X[g]=H),S&&(X[S[0]]=function(){return W(H.apply(this,arguments),S[1],S[2])}),B&&(X[B]=function(){return this.localeData().ordinal(H.apply(this,arguments),g)})}function fe(g){return g.match(/\[[\s\S]/)?g.replace(/^\[|\]$/g,""):g.replace(/\\/g,"")}function xe(g){var S=g.match(O),B,$;for(B=0,$=S.length;B<$;B++)X[S[B]]?S[B]=X[S[B]]:S[B]=fe(S[B]);return function(H){var ae="",Te;for(Te=0;Te<$;Te++)ae+=N(S[Te])?S[Te].call(H,g):S[Te];return ae}}function oe(g,S){return g.isValid()?(S=be(S,g.localeData()),ne[S]=ne[S]||xe(S),ne[S](g)):g.localeData().invalidDate()}function be(g,S){var B=5;function $(H){return S.longDateFormat(H)||H}for(Q.lastIndex=0;B>=0&&Q.test(g);)g=g.replace(Q,$),Q.lastIndex=0,B-=1;return g}var ee={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 Z(g){var S=this._longDateFormat[g],B=this._longDateFormat[g.toUpperCase()];return S||!B?S:(this._longDateFormat[g]=B.match(O).map(function($){return $==="MMMM"||$==="MM"||$==="DD"||$==="dddd"?$.slice(1):$}).join(""),this._longDateFormat[g])}var re="Invalid date";function me(){return this._invalidDate}var ce="%d",Ae=/\d{1,2}/;function we(g){return this._ordinal.replace("%d",g)}var G={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 J(g,S,B,$){var H=this._relativeTime[B];return N(H)?H(g,S,B,$):H.replace(/%d/i,g)}function ge(g,S){var B=this._relativeTime[g>0?"future":"past"];return N(B)?B(S):B.replace(/%s/i,S)}var ye={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 De(g){return typeof g=="string"?ye[g]||ye[g
2025-01-22 08:00:25 +00:00
`:this.message=`[${this.getErrorType()}] "${this.effect}" caused by "${this.cause}"
`;let r=this.str.split(`
`)[this.parseFailure.furthest.line-1],n=`${this.parseFailure.furthest.line} | `;this.positionContext=`${n}${r}`,this.positionContext+=`
${this.getUnderline(n.length)}
`,this.message+=`
2025-07-15 10:58:45 +00:00
`+this.positionContext}getUnderline(e){let r=" ".repeat(this.parseFailure.furthest.column+e-1),n=`^ (${this.cause})`;return r+n}},Nn=class extends Rn{constructor(e,r,n,i,a,o){super({errorLevel:e,effect:"Failed to validate the result of the parser.",cause:n,docs:o}),this.str=i,this.position=a,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}"
2025-01-22 08:00:25 +00:00
`:this.message=`[${this.getErrorType()}] "${this.effect}" caused by "${this.cause}"
`,this.str&&this.position){let r=this.str.split(`
`)[this.position.from.line-1],n=`${this.position.from.line} | `;this.positionContext=`${n}${r}`,this.positionContext+=`
${this.getUnderline(n.length,r.length)}
`,this.message+=`
2025-07-15 10:58:45 +00:00
`+this.positionContext}}getUnderline(e,r){if(this.position===void 0)return"";let n=" ".repeat(this.position.from.column+e-1),i=this.position.to.line===this.position.from.line?this.position.to.column:r,a="^".repeat(i-this.position.from.column);return n+a}};var mn=Tr(oa()),Py=Tr(qi());var V_=Tr(oa()),Ci=Tr(qi());var rf=Tr(oa()),sa=Tr(qi()),Ln=sa.P.sequence(sa.P.or(rf.P_UTILS.unicodeLetter(),sa.P.oneOf("_$")),sa.P.or(rf.P_UTILS.unicodeAlphanumeric(),sa.P.oneOf("-_$")).many()).map(t=>t[0]+t[1].join("")).describe("identifier"),$_=sa.P.sequenceMap((t,e)=>t+e.map(r=>r[0]+r[1]).join(""),Ln,sa.P.sequence(rf.P_UTILS.optionalWhitespace(),Ln).many()).describe("identifier with spaces"),M8=sa.P.string("\\").then(rf.P_UTILS.any()).map(t=>t==="'"?"'":t==="\\"?"\\":"\\"+t);function O_(t){return sa.P.or(M8,sa.P.noneOf(t+"\\")).many().map(e=>e.join("")).trim(sa.P.string(t))}var zp=O_("'"),R_=O_('"'),Dl=sa.P.manyNotOf("{}[]#^|:?").box("file path");function Mi(t,e){return{value:t,position:e}}function Fa(t){if(t!==void 0)return typeof t=="string"?{value:t}:t}var bu=(r=>(r.OBJECT="object",r.ARRAY="array",r))(bu||{}),Hp=class{constructor(e,r,n){this.parent=e,this.access=r,this.child=n}};function C8(t,e){return t[e]}function L_(t,e,r){t[e]=r}var yu=class{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 Hp(e,this,C8(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 Hp(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");L_(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");L_(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 U_=Ln.node((t,e)=>({type:"object",prop:Mi(t,e)})),Fy=Ci.P.or(V_.P_UTILS.digits().wrap(Ci.P.string("["),Ci.P.string("]")).node((t,e)=>({type:"array",prop:Mi(t,e)})),R_.wrap(Ci.P.string("["),Ci.P.string("]")).node((t,e)=>({type:"object",prop:Mi(t,e)}))),N8=Ci.P.or(Ci.P.sequenceMap(t=>({storagePath:void 0,listenToChildren:!0,storageProp:t}),Fy.atLeast(1)),Ci.P.sequenceMap((t,e)=>({storagePath:void 0,listenToChildren:!0,storageProp:[t,...e]}),U_,Fy.many())),F8=Ci.P.sequenceMap((t,e)=>[t,...e],U_,Fy.many()),Iy=Ci.P.sequenceMap((t,e)=>(t.storageProp=t.storageProp.concat(e.flat()),t),N8,Ci.P.string(".").then(F8).many()),_o=Ci.P.sequenceMap((t,e,r)=>(r.storageType=t,r.storagePath=e,r),Ln.describe("storage type").node(Mi).skip(Ci.P.string("^").describe('storage type separator "^"')).optional(),Dl.describe("storage path").node(Mi).skip(Ci.P.string("#").describe('storage/file path separator "#"')).optional(),Iy.describe("property path")).box("bind target");var Gp=Tr(oa()),Ao=Tr(qi());var By=Ao.P.regexp(/^[^()',]+/).describe("any character except parentheses, single quotation marks and commas"),I8=Ao.P.or(zp,By).node(Mi),B8=Ao.P.separateBy(I8,Ao.P.string(",").describe('argument value separator ","').trim(Gp.P_UTILS.optionalWhitespace())),k8=Ao.P.sequenceMap((t,e)=>({name:t,value:e}),Ln.node(Mi),B8.trim(Gp.P_UTILS.optionalWhitespace()).wrap(Ao.P.string("(").describe('argument value paren "("'),Ao.P.string(")").describe('argument value paren ")"')).optional([])),nf=Ao.P.separateBy(k8,Ao.P.string(",").describe('argument separator ","').trim(Gp.P_UTILS.optionalWhitespace()));var zi=Tr(oa()),Fn=Tr(qi());var P8=Fn.P.string("\\").then(zi.P_UTILS.any
`?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 Sl({from:this.parsingError.parseFailure.furthest,to:e},"error")]}};function af(t,e,r){return Math.min(Math.max(t,e),r)}function Jp(t,e,r){return t!==void 0?Math.min(Math.max(t,e),r):void 0}function Ly(t,e,r,n,i){return(t-e)/(r-e)*(i-n)+n}function Vy(t,e){return(t%e+e)%e}function rs(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 i=0;i<t.length;i++)if(!rs(t[i],e[i]))return!1;return!0}if(Array.isArray(t)||Array.isArray(e))return!1;let r=Object.keys(t),n=Object.keys(e);if(r.length!==n.length)return!1;for(let i of r)if(!rs(t[i],e[i]))return!1;return!0}return t===e}function Uy(t){return!!t}function qy(t){if(t===void 0)return t;let e=Reflect.ownKeys(t);for(let r of e){let n=t[r];(n&&typeof n=="object"||typeof n=="function")&&qy(n)}return Object.freeze(t)}function _r(){return window.crypto.randomUUID()}function Cl(t){try{return new URL(t),!0}catch{return!1}}function Xp(t){window.open(t,"_blank")}function Z_(t,e,r=", ",n="and"){return t.length===0?"":(t=t.map(e),t.length===1?t[0]:t.length===2?`${t[0]} ${n} ${t[1]}`:`${t.slice(0,-1).join(r)} ${n} ${t.slice(-1)}`)}function ui(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 lt=class{static createElement(e,r,n){let i=document.createElement(r);return n?.text&&(i.innerText=n.text),n?.class&&(i.className=n.class),e.appendChild(i),i}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 Qp(...t){if(t.length===0)return"/";if(t.length===1)return j_(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 n=e.endsWith("/"),i=t[r].startsWith("/");n&&i?e+=t[r].substring(1):!n&&!i?e+="/"+t[r]:e+=t[r]}return j_(e)}function j_(t){return t.startsWith("/")&&(t=t.substring(1)),t.endsWith("/")&&(t=t.substring(0,t.length-1)),t===""?"/":t}function Kp(t,e){return e=e.startsWith(".")?e:"."+e,t.endsWith(e)?t:t+e}function em(t){return t===void 0?[]:Array.isArray(t)?t:[t]}var tm=class{constructor(e){this.mb=e}highlightInputFieldDeclaration(e,r){return this.highlightWithParser(e,r,G_)}highlightViewFieldDeclaration(e,r){return this.highlightWithParser(e,r,W_)}highlightInlineButtonDeclaration(e,r){return this.highlightWithParser(e,r,Y_)}highlight(e,r,n){if(r==="INPUT")return this.highlightInputFieldDeclaration(e,n);if(r==="VIEW")return this.highlightViewFieldDeclaration(e,n);if(r==="BUTTON_GROUP")return this.highlightInlineButtonDeclaration(e,n);throw new Error(`Unknown MDRCType ${r}`)}highlightBindTarget(e,r){return this.highlightWithParser(e,r,Ml)}highlightWithParser(e,r,n){try{return r?new ts(e,on(n.trim(J_.P_UTILS.optionalWhitespace()).thenEof(),e)):new ts(e,on(n.thenEof(),e))}catch(i){return i instanceof Al?new ts(e,[],i):(console.error(i),new ts(e,[]))}}};var Wr=(i=>(i.DEFAULT="default",i.PRIMARY="primary",i.DESTRUCTIVE="destructive",i.PLAIN="plain",i))(Wr||{}),Vn=(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))(Vn||{}),of=class t{constructor(e,r,n,i){this.type=e,this.shi
`),c=this.mb.file.createLineNumberContext(l,i.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),o,...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 um=class extends Lr{constructor(e){super("js",e)}async run(e,r,n,i,a){if(!this.mb.getSettings().enableJs)throw new ro({errorLevel:"CRITICAL",effect:"Can't run button action that requires JS evaluation.",cause:"JS evaluation is disabled in the plugin settings."});let o={buttonConfig:structuredClone(e),args:structuredClone(r.args),buttonContext:structuredClone(i),click:structuredClone(a)};(await this.mb.internal.jsEngineRunFile(r.file,n,o))()}create(){return{type:"js",file:"",args:{}}}getActionLabel(){return"Run a JavaScript file"}};var Q_=Tr(oa()),Qn=Tr(qi());var K_=Qn.P.sequence(Dl,Qn.P.or(Qn.P.string("#").then(Qn.P.manyNotOf("[]#|:")),Qn.P.string("#").result(void 0),Qn.P.succeed(void 0)),Qn.P.string("|").then(Qn.P.manyNotOf("[]")).optional()),lm=Qn.P.or(Qn.P.sequenceMap((t,e)=>new xu(t!==void 0,e[0],e[1],e[2],!0),Qn.P.string("!").optional(),K_.wrapString("[[","]]")),Qn.P.sequenceMap((t,e,r)=>{let n=!Cl(r);return new xu(t!==void 0,r,void 0,e,n)},Qn.P.string("!").optional(),Qn.P.manyNotOf("[]").wrapString("[","]"),Qn.P.manyNotOf("()").wrapString("(",")"))),X8=Qn.P.separateBy(lm,Qn.P.string(",").trim(Q_.P_UTILS.optionalWhitespace())),xu=class t{constructor(e,r,n,i,a){this.isEmbed=e,this.target=r,this.block=n,this.alias=i,this.internal=a??!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,n){this.internal?e.file.open(this.fullTarget(),r,n):Xp(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()})`}}},vn=class t{static parseLink(e){return on(lm.thenEof(),e)}static parseLinkList(e){return on(X8.thenEof(),e)}static isLink(e){return lm.thenEof().tryParse(e).success}static urlToLink(e){return xu.fromUrl(e)}static parseLinkOrUrl(e){return Cl(e)?t.urlToLink(new URL(e)):t.parseLink(e)}static interpretAsLink(e){let r=lm.thenEof().tryParse(e);if(r.success)return r.value;let n=K_.thenEof().tryParse(e);if(n.success)return new xu(!1,n.value[0],n.value[1],n.value[2],!0);if(Cl(e)){let i=new URL(e);return xu.fromUrl(i)}}};var cm=class extends Lr{constructor(e){super("open",e)}async run(e,r,n,i,a){let o=a.openInNewTab()||(r.newTab??!1),s=vn.interpretAsLink(r.link);if(!s)throw new Error("Invalid link");s.open(this.mb,n,o)}create(){return{type:"open",link:"",newTab:!0}}getActionLabel(){return"Open a link"}};var fm=class extends Lr{constructor(e){super("regexpReplaceInNote",e)}async run(e,r,n,i,a){if(r.regexp==="")throw new Error("Regexp cannot be empty");await this.mb.file.atomicModify(n,o=>o.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 pm=class extends Lr{constructor(e){super("replaceInNote",e)}async run(e,r,n,i,a){let o=r.templater?await this.mb.internal.evaluateTemplaterTemplate(this.mb.file.resolveFilePathLike(r.replacement),n):r.replacement,s=on(uf,r.fromLine.toString()),l=on(uf,r.toLine.toString());await this.mb.file.atomicModify(n,u=>{let c=u.split(`
`),f=this.mb.file.createLineNumberContext(u,i.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),o,...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 mm=class extends Lr{constructor(e){super("replaceSelf",e)}async run(e,r,n,i,a){if(i.isInline)throw new Error("Replace self action not supported for inline buttons");if(i.position===void 0)throw new Error("Position of the button in the note is unknown");if(i.position.lineStart>i.position.lineEnd)throw new Error("Position of the button in the note is invalid");let o=i.position,s=r.templater?await this.mb.internal.evaluateTemplaterTemplate(this.mb.file.resolveFilePathLike(r.replacement),n):r.replacement;await this.mb.file.atomicModify(n,l=>{let u=l.split(`
`);if(o.lineStart<0||o.lineEnd>u.length)throw new Error("Position of the button in the note is out of bounds");return u=[...u.slice(0,o.lineStart),s,...u.slice(o.lineEnd+1)],u.join(`
`)})}create(){return{type:"replaceSelf",replacement:"Replacement text",templater:!1}}getActionLabel(){return"Replace button with text"}};var dm=class extends Lr{constructor(e){super("runTemplaterFile",e)}async run(e,r,n,i,a){let o=this.mb.file.resolveFilePathLike(r.templateFile);await this.mb.internal.evaluateTemplaterTemplate(o,n)}create(){return{type:"runTemplaterFile",templateFile:""}}getActionLabel(){return"Run a templater file"}};var hm=class extends Lr{constructor(e){super("sleep",e)}async run(e,r,n,i,a){await new Promise(o=>setTimeout(o,r.ms))}create(){return{type:"sleep",ms:0}}getActionLabel(){return"Sleep for some time"}};var gm=class extends Lr{constructor(e){super("templaterCreateNote",e)}async run(e,r,n,i,a){if(r.openIfAlreadyExists&&r.fileName){let o=Kp(Qp(r.folderPath??"",r.fileName),"md");if(await this.mb.file.exists(o)){await this.mb.file.open(o,"",!1);return}}await this.mb.internal.createNoteWithTemplater(r.templateFile,r.folderPath,r.fileName,r.openNote,a.openInNewTab())}create(){return{type:"templaterCreateNote",templateFile:"",folderPath:"/",fileName:"",openNote:!0,openIfAlreadyExists:!1}}getActionLabel(){return"Create a new note using Templater"}};function la(t){if(t.toLowerCase()==="null")return null;if(t==="true")return!0;if(t==="false")return!1;{let e=zy.tryParse(t);return e.success?e.value:t}}function dn(t){return t===void 0||t===null?"":typeof t=="string"?t:typeof t=="boolean"?t?"true":"false":t.toString()}function Os(t){return t===null||typeof t=="string"||typeof t=="boolean"||typeof t=="number"}function Ia(t){if(t!=null){if(Os(t))return[t];if(typeof t=="object"&&Array.isArray(t))return t.filter(e=>Os(e))}}function Il(t){if(typeof t=="number")return t;if(typeof t=="string"){let e=zy.tryParse(t);if(e.success)return e.value}}function Do(t){return Os(t)?dn(t):void 0}function Rs(t){return Os(t)?t:void 0}function wu(t,e){return Array.isArray(t)?t.map(r=>Hy(r,e)).filter(r=>r!=="").join(", "):Hy(t,e)}function Hy(t,e){return t==null?e?"":"null":typeof t=="function"?"<function>":typeof t=="object"||Array.isArray(t)?JSON.stringify(t):t.toString()}function t1(t,e){return Array.isArray(t)?t.map(r=>e1(r,e)).filter(r=>r!==""):e1(t,e)}function e1(t,e){return typeof t=="string"?vn.isLink(t)?vn.parseLink(t):Cl(t)?vn.urlToLink(new URL(t)):t:Hy(t,e)}var vm=class extends Lr{constructor(e){super("updateMetadata",e)}async run(e,r,n,i,a){let o=this.mb.bindTargetParser.fromStringAndValidate(r.bindTarget,n);if(r.evaluate){if(!this.mb.getSettings().enableJs)throw new ro({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(o,l=>s(l,u=>this.mb.api.getMetadata(this.mb.api.parseBindTarget(u,n))))}else this.mb.api.setMetadata(o,la(r.value))}create(){return{type:"updateMetadata",bindTarget:"",evaluate:!1,value:""}}getActionLabel(){return"Update metadata"}};var ym=class{constructor(e){this.mb=e,this.actionContexts={command:new nm(e),open:new cm(e),js:new um(e),input:new om(e),sleep:new hm(e),templaterCreateNote:new gm(e),updateMetadata:new vm(e),createNote:new im(e),replaceInNote:new pm(e),replaceSelf:new mm(e),regexpReplaceInNote:new fm(e),insertIntoNote:new sm(e),inlineJS:new am(e),runTemplaterFile:new dm(e)}}createDefaultButtonConfig(){return{label:"This is a button",icon:"",style:"default",class:"",cssStyle:"",backgroundImage:"",tooltip:"",id:"",hidden:!1,actions:[]}}async runButtonActions(e,r,n,i){try{if(e.action)await this.runAction(e,e.action,r,n,i);else if(e.actions)for(let a of e.actions)await this.runAction(e,a,r,n,i);else console.warn("meta-bind | ButtonMDRC >> no action defined")}catch(a){console.warn("meta-bind | ButtonMDRC >> error while running action",a),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,n,i,a){let o=r.type;await this.actionContexts[o].run(e,r,n,i,a)}getActionLabel(e){return this.
2025-01-22 08:00:25 +00:00
A derived value cannot reference itself recursively
2025-07-15 10:58:45 +00:00
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 o1(t){if(Xe){let e=new Error(`effect_in_teardown
2025-01-22 08:00:25 +00:00
\`${t}\` cannot be used inside an effect cleanup function
2025-07-15 10:58:45 +00:00
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 s1(){if(Xe){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 u1(t){if(Xe){let e=new Error(`effect_orphan
2025-01-22 08:00:25 +00:00
\`${t}\` can only be used inside an effect (e.g. during component initialisation)
2025-07-15 10:58:45 +00:00
https://svelte.dev/e/effect_orphan`);throw e.name="Svelte error",e}else throw new Error("https://svelte.dev/e/effect_orphan")}function l1(){if(Xe){let t=new Error(`effect_update_depth_exceeded
2025-01-22 08:00:25 +00:00
Maximum update depth exceeded. This can happen when a reactive block or effect repeatedly sets a new value. Svelte limits the number of nested updates to prevent infinite loops
2025-07-15 10:58:45 +00:00
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 c1(){if(Xe){let t=new Error(`hydration_failed
2025-01-22 08:00:25 +00:00
Failed to hydrate the application
2025-07-15 10:58:45 +00:00
https://svelte.dev/e/hydration_failed`);throw t.name="Svelte error",t}else throw new Error("https://svelte.dev/e/hydration_failed")}function f1(){if(Xe){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 p1(t){if(Xe){let e=new Error(`props_invalid_value
2025-01-22 08:00:25 +00:00
Cannot do \`bind:${t}={undefined}\` when \`${t}\` has a fallback value
2025-07-15 10:58:45 +00:00
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 m1(t){if(Xe){let e=new Error(`props_rest_readonly
2025-01-22 08:00:25 +00:00
Rest element properties of \`$props()\` such as \`${t}\` are readonly
2025-07-15 10:58:45 +00:00
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 d1(t){if(Xe){let e=new Error(`rune_outside_svelte
2025-01-22 08:00:25 +00:00
The \`${t}\` rune is only available inside \`.svelte\` and \`.svelte.js/ts\` files
2025-07-15 10:58:45 +00:00
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 h1(){if(Xe){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 g1(){if(Xe){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 v1(){if(Xe){let t=new Error("state_unsafe_mutation\nUpdating state inside a derived 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 ns=!1,So=!1;var Vs="[",Us="[!",Du="]",qs={};var In=Symbol(),no=Symbol("filename"),y1=Symbol("hmr"),b1="http://www.w3.org/1999/xhtml";var K8="font-weight: bold",e6="font-weight: normal";function Zy(t){Xe?console.warn(`%c[svelte] state_snapshot_uncloneable
2025-01-22 08:00:25 +00:00
%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"}
2025-07-15 10:58:45 +00:00
https://svelte.dev/e/state_snapshot_uncloneable`,K8,e6):console.warn("https://svelte.dev/e/state_snapshot_uncloneable")}var t6=[];function ft(t,e=!1){if(Xe&&!e){let r=[],n=mf(t,new Map,"",r);if(r.length===1&&r[0]==="")Zy();else if(r.length>0){let i=r.length>10?r.slice(0,7):r.slice(0,10),a=r.length-i.length,o=i.map(s=>`- <value>${s}`).join(`
2025-01-22 08:00:25 +00:00
`);a>0&&(o+=`
2025-07-15 10:58:45 +00:00
- ...and ${a} more`),Zy(o)}return n}return mf(t,new Map,"",t6)}function mf(t,e,r,n,i=null){if(typeof t=="object"&&t!==null){var a=e.get(t);if(a!==void 0)return a;if(t instanceof Map)return new Map(t);if(t instanceof Set)return new Set(t);if(Ba(t)){var o=Array(t.length);e.set(t,o),i!==null&&e.set(i,o);for(var s=0;s<t.length;s+=1){var l=t[s];s in t&&(o[s]=mf(l,e,Xe?`${r}[${s}]`:r,n))}return o}if(Au(t)===Am){o={},e.set(t,o),i!==null&&e.set(i,o);for(var u in t)o[u]=mf(t[u],e,Xe?`${r}.${u}`:r,n);return o}if(t instanceof Date)return structuredClone(t);if(typeof t.toJSON=="function")return mf(t.toJSON(),e,Xe?`${r}.toJSON()`:r,n,t)}if(t instanceof EventTarget)return t;try{return structuredClone(t)}catch{return Xe&&n.push(r),t}}var df=null;function is(t){let e=Error(),r=e.stack;if(r){let n=r.split(`
2025-01-22 08:00:25 +00:00
`),i=[`
2025-07-15 10:58:45 +00:00
`];for(let a=0;a<n.length;a++){let o=n[a];if(o!=="Error"){if(o.includes("validate_each_keys"))return null;o.includes("svelte/src/internal")||i.push(o)}}if(i.length===1)return null;ni(e,"stack",{value:i.join(`
`)}),ni(e,"name",{value:`${t}Error`})}return e}function gf(t){if(Xe){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")}var gr=null;function vf(t){gr=t}var io=null;function yf(t){io=t}function Se(t,e=!1,r){var n=gr={p:gr,c:null,d:!1,e:null,m:!1,s:t,x:null,l:null};ns&&!e&&(gr.l={s:null,u:null,r1:[],r2:ao(!1)}),Gi(()=>{n.d=!0}),Xe&&(gr.function=r,io=r)}function Ee(t){let e=gr;if(e!==null){t!==void 0&&(e.x=t);let o=e.e;if(o!==null){var r=Xt,n=fr;e.e=null;try{for(var i=0;i<o.length;i++){var a=o[i];ii(a.effect),Un(a.reaction),Fi(a.fn)}}finally{ii(r),Un(n)}}gr=e.p,Xe&&(io=e.p?.function??null),e.m=!0}return t||{}}function Eo(){return!ns||gr!==null&&gr.l===null}function dt(t){if(typeof t!="object"||t===null||Hi in t)return t;let e=Au(t);if(e!==Am&&e!==n1)return t;var r=new Map,n=Ba(t),i=it(0),a=Xe&&So?is("CreatedAt"):null,o=fr,s=l=>{var u=fr;Un(o);var c=l();return Un(u),c};return n&&r.set("length",it(t.length,a)),new Proxy(t,{defineProperty(l,u,c){(!("value"in c)||c.configurable===!1||c.enumerable===!1||c.writable===!1)&&h1();var f=r.get(u);return f===void 0?(f=s(()=>it(c.value,a)),r.set(u,f)):ke(f,s(()=>dt(c.value))),!0},deleteProperty(l,u){var c=r.get(u);if(c===void 0)u in l&&(r.set(u,s(()=>it(In,a))),Jy(i));else{if(n&&typeof u=="string"){var f=r.get("length"),m=Number(u);Number.isInteger(m)&&m<f.v&&ke(f,m)}ke(c,In),Jy(i)}return!0},get(l,u,c){if(u===Hi)return t;var f=r.get(u),m=u in l;if(f===void 0&&(!m||ka(l,u)?.writable)&&(f=s(()=>it(dt(m?l[u]:In),a)),r.set(u,f)),f!==void 0){var p=q(f);return p===In?void 0:p}return Reflect.get(l,u,c)},getOwnPropertyDescriptor(l,u){var c=Reflect.getOwnPropertyDescriptor(l,u);if(c&&"value"in c){var f=r.get(u);f&&(c.value=q(f))}else if(c===void 0){var m=r.get(u),p=m?.v;if(m!==void 0&&p!==In)return{enumerable:!0,configurable:!0,value:p,writable:!0}}return c},has(l,u){if(u===Hi)return!0;var c=r.get(u),f=c!==void 0&&c.v!==In||Reflect.has(l,u);if(c!==void 0||Xt!==null&&(!f||ka(l,u)?.writable)){c===void 0&&(c=s(()=>it(f?dt(l[u]):In,a)),r.set(u,c));var m=q(c);if(m===In)return!1}return f},set(l,u,c,f){var m=r.get(u),p=u in l;if(n&&u==="length")for(var d=c;d<m.v;d+=1){var h=r.get(d+"");h!==void 0?ke(h,In):d in l&&(h=s(()=>it(In,a)),r.set(d+"",h))}m===void 0?(!p||ka(l,u)?.writable)&&(m=s(()=>it(void 0,a)),ke(m,s(()=>dt(c))),r.set(u,m)):(p=m.v!==In,ke(m,s(()=>dt(c))));var b=Reflect.getOwnPropertyDescriptor(l,u);if(b?.set&&b.set.call(f,c),!p){if(n&&typeof u=="string"){var y=r.get("length"),D=Number(u);Number.isInteger(D)&&D>=y.v&&ke(y,D+1)}Jy(i)}return!0},ownKeys(l){q(i);var u=Reflect.ownKeys(l).filter(m=>{var p=r.get(m);return p===void 0||p.v!==In});for(var[c,f]of r)f.v!==In&&!(c in l)&&u.push(c);return u},setPrototypeOf(){g1()}})}function Jy(t,e=1){ke(t,t.v+e)}function Pl(t){try{if(t!==null&&typeof t=="object"&&Hi in t)return t[Hi]}catch{}return t}function Xy(t,e){return Object.is(Pl(t),Pl(e))}function zs(t){var e=2050,r=fr!==null&&(fr.f&2)!==0?fr:null;Xt===null||r!==null&&(r.f&256)!==0?e|=256:Xt.f|=1048576;let n={ctx:gr,deps:null,effects:null,equals:Dm,f:e,fn:t,reactions:null,rv:0,v:null,wv:0,parent:r??Xt};return Xe&&So&&(n.created=is("CreatedAt")),n}function cr(t){let e=zs(t);return Mm(e),e}function bf(t){let e=zs(t);return e.equals=kl,e}function Em(t){var e=t.effects;if(e!==null){t.effects=null;for(var r=0;r<e.length;r+=1)ci(e[r])}}var Qy=[];function i6(t){for(var e=t.parent;e!==null;){if((e.f&2)===0)return e;e=e.parent}return null}function tb(t){var e,r=Xt;if(ii(i6(t)),Xe){let n=Su;Ky(new Set);try{Qy.includes(t)&&a1(),Qy.push(t),Em(t),e=Tm(t)}finally{ii(r),Ky(n),Qy.pop()}}else try{Em(t),e=Tm(t)}finally{ii(r)}return e}function rb(t){var e=tb(t),r=(as||(t.f&256)!==0)&&t.deps!==null?4096:1024;fi(t,r),t.equals(e)||(t.v=e,t.wv=xf())}var Su=new Set,$l=new Map;function Ky(t){Su=t}function ao(t,e){var r={f:0,v:t,reactions:null,equals:Dm,rv:0,wv:0};return Xe&&So&&(r.created=e??is("CreatedAt"),r.debug=null),r}function it(t,e){let r=ao(t,e);return Mm(r),r}function ss(t,e=!1){let r=ao(t);return e||(r.equals=kl),ns&&gr!==null&&gr.l!==null&&(gr.l.s??=[]).push(r),r}function ke(t,
2025-01-22 08:00:25 +00:00
%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
2025-07-15 10:58:45 +00:00
https://svelte.dev/e/hydration_attribute_changed`,Cm,Nm):console.warn("https://svelte.dev/e/hydration_attribute_changed")}function Ul(t){Xe?console.warn(`%c[svelte] hydration_mismatch
2025-01-22 08:00:25 +00:00
%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"}
2025-07-15 10:58:45 +00:00
https://svelte.dev/e/hydration_mismatch`,Cm,Nm):console.warn("https://svelte.dev/e/hydration_mismatch")}function D1(){Xe?console.warn(`%c[svelte] lifecycle_double_unmount
2025-01-22 08:00:25 +00:00
%cTried to unmount a component that was not mounted
2025-07-15 10:58:45 +00:00
https://svelte.dev/e/lifecycle_double_unmount`,Cm,Nm):console.warn("https://svelte.dev/e/lifecycle_double_unmount")}function Fm(t){Xe?console.warn(`%c[svelte] state_proxy_equality_mismatch
2025-01-22 08:00:25 +00:00
%cReactive \`$state(...)\` proxies and the values they proxy have different identities. Because of this, comparisons with \`${t}\` will produce unexpected results
2025-07-15 10:58:45 +00:00
https://svelte.dev/e/state_proxy_equality_mismatch`,Cm,Nm):console.warn("https://svelte.dev/e/state_proxy_equality_mismatch")}var Tt=!1;function pi(t){Tt=t}var jt;function un(t){if(t===null)throw Ul(),qs;return jt=t}function mi(){return un(di(jt))}function le(t){if(Tt){if(di(jt)!==null)throw Ul(),qs;jt=t}}function _t(t=1){if(Tt){for(var e=t,r=jt;e--;)r=di(r);jt=r}}function Tu(){for(var t=0,e=jt;;){if(e.nodeType===8){var r=e.data;if(r===Du){if(t===0)return e;t-=1}else(r===Vs||r===Us)&&(t+=1)}var n=di(e);e.remove(),e=n}}function S1(){let t=Array.prototype,e=Array.__svelte_cleanup;e&&e();let{indexOf:r,lastIndexOf:n,includes:i}=t;t.indexOf=function(a,o){let s=r.call(this,a,o);if(s===-1){for(let l=o??0;l<this.length;l+=1)if(Pl(this[l])===a){Fm("array.indexOf(...)");break}}return s},t.lastIndexOf=function(a,o){let s=n.call(this,a,o??this.length-1);if(s===-1){for(let l=0;l<=(o??this.length-1);l+=1)if(Pl(this[l])===a){Fm("array.lastIndexOf(...)");break}}return s},t.includes=function(a,o){let s=i.call(this,a,o);if(!s){for(let l=0;l<this.length;l+=1)if(Pl(this[l])===a){Fm("array.includes(...)");break}}return s},Array.__svelte_cleanup=()=>{t.indexOf=r,t.lastIndexOf=n,t.includes=i}}var us,E1,wf,T1,M1;function Im(){if(us===void 0){us=window,E1=document,wf=/Firefox/.test(navigator.userAgent);var t=Element.prototype,e=Node.prototype,r=Text.prototype;T1=ka(e,"firstChild").get,M1=ka(e,"nextSibling").get,Yy(t)&&(t.__click=void 0,t.__className=void 0,t.__attributes=null,t.__style=void 0,t.__e=void 0),Yy(r)&&(r.__t=void 0),Xe&&(t.__svelte_meta=null,S1())}}function Wi(t=""){return document.createTextNode(t)}function yn(t){return T1.call(t)}function di(t){return M1.call(t)}function ve(t,e){if(!Tt)return yn(t);var r=yn(jt);if(r===null)r=jt.appendChild(Wi());else if(e&&r.nodeType!==3){var n=Wi();return r?.before(n),un(n),n}return un(r),r}function We(t,e){if(!Tt){var r=yn(t);return r instanceof Comment&&r.data===""?di(r):r}if(e&&jt?.nodeType!==3){var n=Wi();return jt?.before(n),un(n),n}return jt}function ue(t,e=1,r=!1){let n=Tt?jt:t;for(var i;e--;)i=n,n=di(n);if(!Tt)return n;var a=n?.nodeType;if(r&&a!==3){var o=Wi();return n===null?i?.after(o):n.before(o),un(o),o}return un(n),n}function ql(t){t.textContent=""}function F1(t){Xt===null&&fr===null&&u1(t),fr!==null&&(fr.f&256)!==0&&Xt===null&&s1(),Eu&&o1(t)}function a6(t,e){var r=e.last;r===null?e.last=e.first=t:(r.next=t,t.prev=r,e.last=t)}function Mu(t,e,r,n=!0){var i=Xt;if(Xe)for(;i!==null&&(i.f&262144)!==0;)i=i.parent;var a={ctx:gr,deps:null,nodes_start:null,nodes_end:null,f:t|2048,first:null,fn:e,last:null,next:null,parent:i,prev:null,teardown:null,transitions:null,wv:0};if(Xe&&(a.component_function=io),r)try{Ll(a),a.f|=32768}catch(l){throw ci(a),l}else e!==null&&Vl(a);var o=r&&a.deps===null&&a.first===null&&a.nodes_start===null&&a.teardown===null&&(a.f&1048704)===0;if(!o&&n&&(i!==null&&a6(a,i),fr!==null&&(fr.f&2)!==0)){var s=fr;(s.effects??=[]).push(a)}return a}function Gi(t){let e=Mu(8,null,!1);return fi(e,1024),e.teardown=t,e}function Yi(t){F1("$effect");var e=Xt!==null&&(Xt.f&32)!==0&&gr!==null&&!gr.m;if(Xe&&ni(t,"name",{value:"$effect"}),e){var r=gr;(r.e??=[]).push({fn:t,effect:Xt,reaction:fr})}else{var n=Fi(t);return n}}function ob(t){let e=Mu(64,t,!0);return()=>{ci(e)}}function I1(t){let e=Mu(64,t,!0);return(r={})=>new Promise(n=>{r.outro?lo(e,()=>{ci(e),n(void 0)}):(ci(e),n(void 0))})}function Fi(t){return Mu(4,t,!1)}function ma(t){return Mu(8,t,!0)}function Le(t,e=[],r=zs){let n=e.map(r),i=()=>t(...n.map(q));return Xe&&ni(i,"name",{value:"{expression}"}),ji(i)}function ji(t,e=0){return Mu(24|e,t,!0)}function hi(t,e=!0){return Mu(40,t,!0,e)}function sb(t){var e=t.teardown;if(e!==null){let r=Eu,n=fr;ib(!0),Un(null);try{e.call(null)}finally{ib(r),Un(n)}}}function ub(t,e=!1){var r=t.first;for(t.first=t.last=null;r!==null;){var n=r.next;(r.f&64)!==0?r.parent=null:ci(r,e),r=n}}function B1(t){for(var e=t.first;e!==null;){var r=e.next;(e.f&32)===0&&ci(e),e=r}}function ci(t,e=!0){var r=!1;(e||(t.f&524288)!==0)&&t.nodes_start!==null&&(k1(t.nodes_start,t.nodes_end),r=!0),ub(t,e&&!r),Af(t,0),fi(t
${a.map(c=>`
2025-01-22 08:00:25 +00:00
${l}in ${c}`).join("")}
2025-07-15 10:58:45 +00:00
`}),ni(t,"component_stack",{value:a});let u=t.stack;if(u){let c=u.split(`
`),f=[];for(let m=0;m<c.length;m++){let p=c[m];p.includes("svelte/src/internal")||f.push(p)}ni(t,"stack",{value:f.join(`
`)})}}if(s6(t,e),U1(e))throw t}function G1(t,e,r=!0){var n=t.reactions;if(n!==null)for(var i=0;i<n.length;i++){var a=n[i];To?.includes(t)||((a.f&2)!==0?G1(a,e,!1):e===a&&(r?fi(a,2048):(a.f&1024)!==0&&fi(a,4096),Vl(a)))}}function Tm(t){var e=Bi,r=da,n=pa,i=fr,a=as,o=To,s=gr,l=$a,u=t.f;Bi=null,da=0,pa=null,as=(u&256)!==0&&($a||!Cu||fr===null),fr=(u&96)===0?t:null,To=null,vf(t.ctx),$a=!1,Rm++,t.f|=2097152;try{var c=(0,t.fn)(),f=t.deps;if(Bi!==null){var m;if(Af(t,da),f!==null&&da>0)for(f.length=da+Bi.length,m=0;m<Bi.length;m++)f[da+m]=Bi[m];else t.deps=f=Bi;if(!as)for(m=da;m<f.length;m++)(f[m].reactions??=[]).push(t)}else f!==null&&da<f.length&&(Af(t,da),f.length=da);if(Eo()&&pa!==null&&!$a&&f!==null&&(t.f&6146)===0)for(m=0;m<pa.length;m++)G1(pa[m],t);return i!==null&&i!==t&&(Rm++,pa!==null&&(n===null?n=pa:n.push(...pa))),c}finally{Bi=e,da=r,pa=n,fr=i,as=a,To=o,vf(s),$a=l,t.f^=2097152}}function u6(t,e){let r=e.reactions;if(r!==null){var n=r1.call(r,t);if(n!==-1){var i=r.length-1;i===0?r=e.reactions=null:(r[n]=r[i],r.pop())}}r===null&&(e.f&2)!==0&&(Bi===null||!Bi.includes(e))&&(fi(e,4096),(e.f&768)===0&&(e.f^=512),Em(e),Af(e,0))}function Af(t,e){var r=t.deps;if(r!==null)for(var n=e;n<r.length;n++)u6(t,r[n])}function Ll(t){var e=t.f;if((e&16384)===0){fi(t,1024);var r=Xt,n=gr,i=Cu;if(Xt=t,Cu=!0,Xe){var a=io;yf(t.component_function)}try{(e&16)!==0?B1(t):ub(t),sb(t);var o=Tm(t);t.teardown=typeof o=="function"?o:null,t.wv=H1;var s=t.deps;if(Xe&&So&&(t.f&2048)!==0&&s!==null)for(let u=0;u<s.length;u++){var l=s[u];l.trace_need_increase&&(l.wv=xf(),l.trace_need_increase=void 0,l.trace_v=void 0)}Xe&&Om.push(t)}catch(u){Gl(u,t,r,n||t.ctx)}finally{Cu=i,Xt=r,Xe&&yf(a)}}}function q1(){console.error("Last ten effects were: ",Om.slice(-10).map(t=>t.fn)),Om=[]}function l6(){try{l1()}catch(t){if(Xe&&ni(t,"stack",{value:""}),Ef!==null)if(Xe)try{Gl(t,Ef,null,null)}catch(e){throw q1(),e}else Gl(t,Ef,null,null);else throw Xe&&q1(),t}}function pb(){var t=Cu;try{var e=0;for(Cu=!0;Tf.length>0;){e++>1e3&&l6();var r=Tf,n=r.length;Tf=[];for(var i=0;i<n;i++){var a=f6(r[i]);c6(a)}$l.clear()}}finally{Hl=!1,Cu=t,Ef=null,Xe&&(Om=[])}}function c6(t){var e=t.length;if(e!==0)for(var r=0;r<e;r++){var n=t[r];if((n.f&24576)===0)try{Hs(n)&&(Ll(n),n.deps===null&&n.first===null&&n.nodes_start===null&&(n.teardown===null?lb(n):n.fn=null))}catch(i){Gl(i,n,null,n.ctx)}}}function Vl(t){Hl||(Hl=!0,queueMicrotask(pb));for(var e=Ef=t;e.parent!==null;){e=e.parent;var r=e.f;if((r&96)!==0){if((r&1024)===0)return;e.f^=1024}}Tf.push(e)}function f6(t){for(var e=[],r=t;r!==null;){var n=r.f,i=(n&96)!==0,a=i&&(n&1024)!==0;if(!a&&(n&8192)===0){if((n&4)!==0)e.push(r);else if(i)r.f^=1024;else try{Hs(r)&&Ll(r)}catch(l){Gl(l,r,null,r.ctx)}var o=r.first;if(o!==null){r=o;continue}}var s=r.parent;for(r=r.next;r===null&&s!==null;)r=s.next,s=s.parent}return e}function Mf(t){var e;for(t&&(Hl=!0,pb(),Hl=!0,e=t());;){if(L1(),Tf.length===0)return e;Hl=!0,pb()}}function q(t){var e=t.f,r=(e&2)!==0;if(hf!==null&&hf.add(t),fr!==null&&!$a){if(!To?.includes(t)){var n=fr.deps;t.rv<Rm&&(t.rv=Rm,Bi===null&&n!==null&&n[da]===t?da++:Bi===null?Bi=[t]:(!as||!Bi.includes(t))&&Bi.push(t))}}else if(r&&t.deps===null&&t.effects===null){var i=t,a=i.parent;a!==null&&(a.f&256)===0&&(i.f^=256)}if(r&&(i=t,Hs(i)&&rb(i)),Xe&&So&&df!==null&&fr!==null&&df.reaction===fr){if(t.debug)t.debug();else if(t.created){var o=df.entries.get(t);o===void 0&&(o={read:[]},df.entries.set(t,o)),o.read.push(is("TracedAt"))}}return Eu&&$l.has(t)?$l.get(t):t.v}function sn(t){var e=$a;try{return $a=!0,t()}finally{$a=e}}var p6=-7169;function fi(t,e){t.f=t.f&p6|e}var d6=["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 Kae=[...d6,"formNoValidate","isMap","noModule","playsInline","readOnly","value","volume","defaultValue","defaultChecked","srcOb
\r\f\xA0\v\uFEFF`];function sA(t,e,r){var n=t==null?"":""+t;if(e&&(n=n?n+" "+e:e),r){for(var i in r)if(r[i])n=n?n+" "+i:i;else if(n.length)for(var a=i.length,o=0;(o=n.indexOf(i,o))>=0;){var s=o+a;(o===0||aA.includes(n[o-1]))&&(s===n.length||aA.includes(n[s]))?n=(o===0?"":n.substring(0,o))+n.substring(s+1):o=s}}return n===""?null:n}function oA(t,e=!1){var r=e?" !important;":";",n="";for(var i in t){var a=t[i];a!=null&&a!==""&&(n+=" "+i+": "+a+r)}return n}function bb(t){return t[0]!=="-"||t[1]!=="-"?t.toLowerCase():t}function uA(t,e){if(e){var r="",n,i;if(Array.isArray(e)?(n=e[0],i=e[1]):n=e,t){t=String(t).replaceAll(/\s*\/\*.*?\*\/\s*/g,"").trim();var a=!1,o=0,s=!1,l=[];n&&l.push(...Object.keys(n).map(bb)),i&&l.push(...Object.keys(i).map(bb));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):a?a===m&&(a=!1):m==="/"&&t[f+1]==="*"?s=!0:m==='"'||m==="'"?a=m:m==="("?o++:m===")"&&o--,!s&&a===!1&&o===0){if(m===":"&&c===-1)c=f;else if(m===";"||f===h-1){if(c!==-1){var p=bb(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 n&&(r+=oA(n)),i&&(r+=oA(i,!0)),r=r.trim(),r===""?null:r}return t==null?null:String(t)}function Vr(t,e,r,n,i,a){var o=t.__className;if(Tt||o!==r||o===void 0){var s=sA(r,n,a);(!Tt||s!==t.getAttribute("class"))&&(s==null?t.removeAttribute("class"):e?t.className=s:t.setAttribute("class",s)),t.__className=r}else if(a&&i!==a)for(var l in a){var u=!!a[l];(i==null||u!==!!i[l])&&t.classList.toggle(l,u)}return a}function xb(t,e={},r,n){for(var i in r){var a=r[i];e[i]!==a&&(r[i]==null?t.style.removeProperty(i):t.style.setProperty(i,a,n))}}function jl(t,e,r,n){var i=t.__style;if(Tt||i!==e){var a=uA(e,n);(!Tt||a!==t.getAttribute("style"))&&(a==null?t.removeAttribute("style"):t.style.cssText=a),t.__style=e}else n&&(Array.isArray(n)?(xb(t,r?.[0],n[0]),xb(t,r?.[1],n[1],"important")):xb(t,r,n));return n}var C6=Symbol("class"),N6=Symbol("style"),F6=Symbol("is custom element"),I6=Symbol("is html");function At(t){if(Tt){var e=!1,r=()=>{if(!e){if(e=!0,t.hasAttribute("value")){var n=t.value;rt(t,"value",null),t.value=n}if(t.hasAttribute("checked")){var i=t.checked;rt(t,"checked",null),t.checked=i}}};t.__on_r=r,R1(r),Lm()}}function _b(t,e){var r=Ab(t);r.value===(r.value=e??void 0)||t.value===e&&(e!==0||t.nodeName!=="PROGRESS")||(t.value=e??"")}function cs(t,e){var r=Ab(t);r.checked!==(r.checked=e??void 0)&&(t.checked=e)}function rt(t,e,r,n){var i=Ab(t);if(Tt&&(i[e]=t.getAttribute(e),e==="src"||e==="srcset"||e==="href"&&t.nodeName==="LINK")){n||k6(t,e,r??"");return}i[e]!==(i[e]=r)&&(e==="loading"&&(t[i1]=r),r==null?t.removeAttribute(e):typeof r!="string"&&B6(t).includes(e)?t[e]=r:t.setAttribute(e,r))}function Ab(t){return t.__attributes??={[F6]:t.nodeName.includes("-"),[I6]:t.namespaceURI===b1}}var lA=new Map;function B6(t){var e=lA.get(t.nodeName);if(e)return e;lA.set(t.nodeName,e=[]);for(var r,n=t,i=Element.prototype;i!==n;){r=Wy(n);for(var a in r)r[a].set&&e.push(a);n=Au(n)}return e}function k6(t,e,r){Xe&&(e==="srcset"&&P6(t,r)||wb(t.getAttribute(e)??"",r)||A1(e,t.outerHTML.replace(t.innerHTML,t.innerHTML&&"..."),String(r)))}function wb(t,e){return t===e?!0:new URL(t,document.baseURI).href===new URL(e,document.baseURI).href}function cA(t){return t.split(",").map(e=>e.trim().split(" ").filter(Boolean))}function P6(t,e){var r=cA(t.srcset),n=cA(e);return n.length===r.length&&n.every(([i,a],o)=>a===r[o][1]&&(wb(r[o][0],i)||wb(i,r[o][0])))}function xt(t,e,r=e){var n=Eo();Vm(t,"input",i=>{Xe&&t.type==="checkbox"&&jy();var a=i?t.defaultValue:t.value;if(a=Db(t)?Sb(a):a,r(a),n&&a!==(a=e())){var o=t.selectionStart,s=t.selectionEnd;t.value=a??"",s!==null&&(t.selectionStart=o,t.selectionEnd=Math.min(s,t.value.length))}}),(Tt&&t.defaultValue!==t.value||sn(e)==null&&t.value)&&r(Db(t)?Sb(t.value):t.value),ma(()=>{Xe&&t.type==="checkbox"&&jy();var i=e();Db(t)&&i===Sb(t.value)||t.type==="date"&&!i&&!t.value||i!==t.value&&(t.value=i??"")})}function Db(t){var e=t.type;return e==="number"||e==="range"}function Sb(t){return t===""?null:+
OR `,issueSeparator:" AND ",prefix:null,includePath:!1});throw new es({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:n.message,docs:[qt.linkToButtonConfig()]})}return r.data}validate(e){let r=new er("Button"),n;try{n=this.validateConfig(e)}catch(i){r.add(i)}return{declarationString:void 0,config:n,errorCollection:r}}};var cc=class{constructor(){this.arguments=[]}add(e){this.arguments.push(e)}validate(){let e={};for(let r of Object.values(en))e[r]=0;for(let r of this.arguments){let n=r.getConfig();if(e[n.type]+=1,e[n.type]>1&&!n.allowMultiple)throw new $r({errorLevel:"ERROR",effect:"failed to validate argument container",cause:`argument '${n.type}' does not allow duplicates`,docs:[qt.linkToSearch(n.type)]})}}mergeByOverride(e){for(let r of e.arguments){let n=r.getConfig();n.allowMultiple||(this.arguments=this.arguments.filter(i=>i.getConfig().type!==n.type)),this.arguments.push(r)}return this.validate(),this}mergeByThrow(e){for(let r of e.arguments){let n=r.getConfig();if(!n.allowMultiple&&this.arguments.filter(i=>i.getConfig().type===n.type).length>0)throw new $r({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 Vd=class extends cc{getAll(e){return super.getAll(e)}get(e){return this.getAll(e).at(0)}};var fc=class{parseValue(e){this.validateValues(e,this.getConfig().values),this._parseValue(e)}validateValues(e,r){if(r.find(n=>n.length===e.length)===void 0)throw new $r({errorLevel:"WARNING",effect:`Failed to parse argument value for argument '${this.getConfig().type}'.`,cause:`Expected argument values to follow the form ${r.map(n=>n.length===0?"none":n.map(i=>`'${i.name}'`).join(", ")).join(" or ")}. Received arguments of length ${e.length}.`,docs:[qt.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 yr=class extends fc{};var Ud=class extends yr{constructor(){super(...arguments);this.value=!0}_parseValue(r){this.value=r[0]===void 0||r[0]?.value.toLowerCase()==="true"}getConfig(){return Ar.addLabels}};var qd=class extends yr{constructor(){super(...arguments);this.value=!0}_parseValue(r){this.value=r[0]===void 0||r[0]?.value.toLowerCase()==="true"}getConfig(){return Ar.allowOther}};var zd=class extends yr{constructor(){super(...arguments);this.value=[]}_parseValue(r){this.value=r[0].value.split(" ")}getConfig(){return Ar.class}};var Hd=class extends yr{constructor(){super(...arguments);this.value=""}_parseValue(r){this.value=la(r[0].value)}getConfig(){return Ar.defaultValue}};var Gd=class extends yr{constructor(){super(...arguments);this.value=void 0}_parseValue(r){if(this.value=Number.parseInt(r[0].value),Number.isNaN(this.value))throw new $r({errorLevel:"WARNING",effect:"failed to set value for input field argument",cause:"value of argument 'limit' must be of type number",docs:[qt.linkToInputFieldArgument(this.getConfig().type)]});if(this.value<=0)throw new $r({errorLevel:"WARNING",effect:"failed to set value for input field argument",cause:"value of argument 'limit' must be a positive number",docs:[qt.linkToInputFieldArgument(this.getConfig().type)]})}getConfig(){return Ar.limit}};var Wd=class extends yr{constructor(){super(...arguments);this.value=100}_parseValue(r){if(this.value=Number.parseFloat(r[0].value),Number.isNaN(this.value))throw new $r({errorLevel:"WARNING",effect:"failed to set value for input field argument",cause:"value of argument 'maxValue' must be of type number",docs:[qt.linkToInputFieldArgument(this.getConfig().type)]})}getConfig(){return Ar.maxValue}};var Yd=class
`||(s==="+"?i++:s==="-"?a++:s==="i"||s==="I"?(i+a===0&&bc(),n[o+1]!==" "&&!isNaN(n[o+1])?(r.im+=parseFloat((a%2?"-":"")+n[o+1]),o++):r.im+=parseFloat((a%2?"-":"")+"1"),i=a=0):((i+a===0||isNaN(s))&&bc(),n[o+1]==="i"||n[o+1]==="I"?(r.im+=parseFloat((a%2?"-":"")+s),o++):r.re+=parseFloat((a%2?"-":"")+s),i=a=0))}i+a>0&&bc();break;case"number":r.im=0,r.re=t;break;default:bc()}return isNaN(r.re)||isNaN(r.im),r};function Fe(t,e){if(!(this instanceof Fe))return new Fe(t,e);let r=Ju(t,e);this.re=r.re,this.im=r.im}Fe.prototype={re:0,im:0,sign:function(){let t=kx(this.re,this.im);return new Fe(this.re/t,this.im/t)},add:function(t,e){let r=Ju(t,e),n=this.isInfinite(),i=!(isFinite(r.re)&&isFinite(r.im));return n||i?n&&i?Fe.NAN:Fe.INFINITY:new Fe(this.re+r.re,this.im+r.im)},sub:function(t,e){let r=Ju(t,e),n=this.isInfinite(),i=!(isFinite(r.re)&&isFinite(r.im));return n||i?n&&i?Fe.NAN:Fe.INFINITY:new Fe(this.re-r.re,this.im-r.im)},mul:function(t,e){let r=Ju(t,e),n=this.isInfinite(),i=!(isFinite(r.re)&&isFinite(r.im)),a=this.re===0&&this.im===0,o=r.re===0&&r.im===0;return n&&o||i&&a?Fe.NAN:n||i?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=Ju(t,e),n=this.isInfinite(),i=!(isFinite(r.re)&&isFinite(r.im)),a=this.re===0&&this.im===0,o=r.re===0&&r.im===0;if(a&&o||n&&i)return Fe.NAN;if(o||n)return Fe.INFINITY;if(a||i)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=Ju(t,e),n=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(n&&r.re>0)return Fe.ZERO;let a=Math.atan2(this.im,this.re),o=Px(this.re,this.im),s=Math.exp(r.re*o-r.im*a),l=r.im*o+r.re*a;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=kx(t,e),n=Math.sqrt(.5*(r+Math.abs(t))),i=Math.abs(e)/(2*n);return t>=0?new Fe(n,e<0?-i:i):new Fe(i,e<0?-n:n)},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)+$H(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(Px(t,e),Math.atan2(e,t))},abs:function(){return kx(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)*Ga(e))},cos:function(){let t=this.re,e=this.im;return new Fe(Math.cos(t)*_i(e),-Math.sin(t)*Ga(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,Ga(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,Ga(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)*Ga(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)*Ga(e)/r)},asin:function(){let t=this.re,e=this.im,r=new Fe(e*e-t*t+1,-2*t*e).sqrt(),n=new Fe(r.re-e,r.im+t).log();return new Fe(n.im,-n.re)},acos:function(){let t=this.re,e=this.im,r=new Fe(e*e-t*t+1,-2*t*e).sqrt(),n=new Fe(r.re-e,r.im+t).log();return new Fe(Math.PI/2-n.im,n.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),n=new Fe((1-e*e-t*t)/r,-2*t/r).log();return new Fe(-.5*n.im,.5*n.re)},acot:function(){let t=this.re,e=this.im;if(e===0)r
`,A=0;A<y;A++)for(var w=this._ptr[A],x=this._ptr[A+1],E=w;E<x;E++){var T=this._index[E];v+=`
(`+Dt(T,h)+", "+Dt(A,h)+") ==> "+(this._values?Dt(this._values[E],h):"X")}return v},i.prototype.toString=function(){return Dt(this.toArray())},i.prototype.toJSON=function(){return{mathjs:"SparseMatrix",values:this._values,index:this._index,ptr:this._ptr,size:this._size,datatype:this._datatype}},i.prototype.diagonal=function(h){if(h){if(ot(h)&&(h=h.toNumber()),!bt(h)||!He(h))throw new TypeError("The parameter k must be an integer number")}else h=0;var b=h>0?h:0,y=h<0?-h:0,D=this._size[0],v=this._size[1],A=Math.min(D-y,v-b),w=[],x=[],E=[];E[0]=0;for(var T=b;T<v&&w.length<A;T++)for(var _=this._ptr[T],C=this._ptr[T+1],N=_;N<C;N++){var I=this._index[N];if(I===T-b+y){w.push(this._values[N]),x[w.length-1]=I-y;break}}return E.push(w.length),new i({values:w,index:x,ptr:E,size:[A,1]})},i.fromJSON=function(h){return new i(h)},i.diagonal=function(h,b,y,D,v){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(O){if(ot(O)&&(O=O.toNumber()),!bt(O)||!He(O)||O<1)throw new Error("Size values must be positive integers");return O}),y){if(ot(y)&&(y=y.toNumber()),!bt(y)||!He(y))throw new TypeError("The parameter k must be an integer number")}else y=0;var A=r,w=0;Jr(v)&&(A=e.find(r,[v,v])||r,w=e.convert(0,v));var x=y>0?y:0,E=y<0?-y:0,T=h[0],_=h[1],C=Math.min(T-E,_-x),N;if(sr(b)){if(b.length!==C)throw new Error("Invalid value array length");N=function(Q){return b[Q]}}else if(Ye(b)){var I=b.size();if(I.length!==1||I[0]!==C)throw new Error("Invalid matrix length");N=function(Q){return b.get([Q])}}else N=function(){return b};for(var R=[],L=[],V=[],P=0;P<_;P++){V.push(R.length);var k=P-x;if(k>=0&&k<C){var W=N(k);A(W,w)||(L.push(k+E),R.push(W))}}return V.push(R.length),new i({values:R,index:L,ptr:V,size:[T,_]})},i.prototype.swapRows=function(h,b){if(!bt(h)||!He(h)||!bt(b)||!He(b))throw new Error("Row index must be positive integers");if(this._size.length!==2)throw new Error("Only two dimensional matrix is supported");return Cr(h,this._size[0]),Cr(b,this._size[0]),i._swapRows(h,b,this._size[1],this._values,this._index,this._ptr),this},i._forEachRow=function(h,b,y,D,v){for(var A=D[h],w=D[h+1],x=A;x<w;x++)v(y[x],b[x])},i._swapRows=function(h,b,y,D,v,A){for(var w=0;w<y;w++){var x=A[w],E=A[w+1],T=u(h,x,E,v),_=u(b,x,E,v);if(T<E&&_<E&&v[T]===h&&v[_]===b){if(D){var C=D[T];D[T]=D[_],D[_]=C}continue}if(T<E&&v[T]===h&&(_>=E||v[_]!==b)){var N=D?D[T]:void 0;v.splice(_,0,b),D&&D.splice(_,0,N),v.splice(_<=T?T+1:T,1),D&&D.splice(_<=T?T+1:T,1);continue}if(_<E&&v[_]===b&&(T>=E||v[T]!==h)){var I=D?D[_]:void 0;v.splice(T,0,h),D&&D.splice(T,0,I),v.splice(T<=_?_+1:_,1),D&&D.splice(T<=_?_+1:_,1)}}},i},{isClass:!0});var zG="number",HG=["typed"];function GG(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]],n=e[2],i=e[3];return{input:t,radix:r,integerPart:n,fractionalPart:i}}else return null}function WG(t){for(var e=parseInt(t.integerPart,t.radix),r=0,n=0;n<t.fractionalPart.length;n++){var i=parseInt(t.fractionalPart[n],t.radix);r+=i/Math.pow(t.radix,n+1)}var a=e+r;if(isNaN(a))throw new SyntaxError('String "'+t.input+'" is not a valid number');return a}var GE=M(zG,HG,t=>{var{typed:e}=t,r=e("number",{"":function(){return 0},number:function(i){return i},string:function(i){if(i==="NaN")return NaN;var a=GG(i);if(a)return WG(a);var o=0,s=i.match(/(0[box][0-9a-fA-F]*)i([0-9]*)/);s&&(o=Number(s[2]),i=s[1]);var l=Number(i);if(isNaN(l))throw new SyntaxError('String "'+i+'" is not a valid number');if(s){if(l>2**o-1)throw new SyntaxError('String "'.concat(i,'" is out of range'));l>=2**(o-1)&&(l=l-2**o)}return l},BigNumber:function(i){return i.toNumber()},bigint:function(i){return Number(i)},Fraction:function(i){return i.valueOf()},Unit:e.referToSelf(n=>i=>{var a=i.clone();return a.value=n(i.value),a}),null:function(i){return 0},"Unit, string | Unit":function(i,a){return i.toNumber(a)},"Array | Matrix":e.referToSelf(n=>i=>Ke(i,n))});return r.fromJSON=function(n){return parseFloat(n.value)},r});var YG="bigint",jG=["typed"],WE=
`)}toJSON(){return{mathjs:Gg,blocks:this.blocks}}static fromJSON(a){return new n(a.blocks)}_toHTML(a){return this.blocks.map(function(o){return o.node.toHTML(a)+(o.visible?"":'<span class="math-separator">;</span>')}).join('<span class="math-separator"><br /></span>')}_toTex(a){return this.blocks.map(function(o){return o.node.toTex(a)+(o.visible?"":";")}).join(`\\;\\;
`)}}return dr(n,"name",Gg),n},{isClass:!0,isNode:!0});var Wg="ConditionalNode",FJ=["Node"],VI=M(Wg,FJ,t=>{var{Node:e}=t;function r(i){if(typeof i=="number"||typeof i=="boolean"||typeof i=="string")return!!i;if(i){if(ot(i))return!i.isZero();if(Hn(i))return!!(i.re||i.im);if(En(i))return!!i.value}if(i==null)return!1;throw new TypeError('Unsupported type of condition "'+ir(i)+'"')}class n extends e{constructor(a,o,s){if(super(),!Gt(a))throw new TypeError("Parameter condition must be a Node");if(!Gt(o))throw new TypeError("Parameter trueExpr must be a Node");if(!Gt(s))throw new TypeError("Parameter falseExpr must be a Node");this.condition=a,this.trueExpr=o,this.falseExpr=s}get type(){return Wg}get isConditionalNode(){return!0}_compile(a,o){var s=this.condition._compile(a,o),l=this.trueExpr._compile(a,o),u=this.falseExpr._compile(a,o);return function(f,m,p){return r(s(f,m,p))?l(f,m,p):u(f,m,p)}}forEach(a){a(this.condition,"condition",this),a(this.trueExpr,"trueExpr",this),a(this.falseExpr,"falseExpr",this)}map(a){return new n(this._ifNode(a(this.condition,"condition",this)),this._ifNode(a(this.trueExpr,"trueExpr",this)),this._ifNode(a(this.falseExpr,"falseExpr",this)))}clone(){return new n(this.condition,this.trueExpr,this.falseExpr)}_toString(a){var o=a&&a.parenthesis?a.parenthesis:"keep",s=xr(this,o,a&&a.implicit),l=this.condition.toString(a),u=xr(this.condition,o,a&&a.implicit);(o==="all"||this.condition.type==="OperatorNode"||u!==null&&u<=s)&&(l="("+l+")");var c=this.trueExpr.toString(a),f=xr(this.trueExpr,o,a&&a.implicit);(o==="all"||this.trueExpr.type==="OperatorNode"||f!==null&&f<=s)&&(c="("+c+")");var m=this.falseExpr.toString(a),p=xr(this.falseExpr,o,a&&a.implicit);return(o==="all"||this.falseExpr.type==="OperatorNode"||p!==null&&p<=s)&&(m="("+m+")"),l+" ? "+c+" : "+m}toJSON(){return{mathjs:Wg,condition:this.condition,trueExpr:this.trueExpr,falseExpr:this.falseExpr}}static fromJSON(a){return new n(a.condition,a.trueExpr,a.falseExpr)}_toHTML(a){var o=a&&a.parenthesis?a.parenthesis:"keep",s=xr(this,o,a&&a.implicit),l=this.condition.toHTML(a),u=xr(this.condition,o,a&&a.implicit);(o==="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(a),f=xr(this.trueExpr,o,a&&a.implicit);(o==="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(a),p=xr(this.falseExpr,o,a&&a.implicit);return(o==="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(a){return"\\begin{cases} {"+this.trueExpr.toTex(a)+"}, &\\quad{\\text{if }\\;"+this.condition.toTex(a)+"}\\\\{"+this.falseExpr.toTex(a)+"}, &\\quad{\\text{otherwise}}\\end{cases}"}}return dr(n,"name",Wg),n},{isClass:!0,isNode:!0});var HI=Tr(qI(),1);var j0={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:"
`)+"\\end{array}\\right\\}";return s}}return dr(r,"name",Qg),r},{isClass:!0,isNode:!0});function al(t,e){return new pc(t,new Ks(e),new Set(Object.keys(e)))}var Kg="OperatorNode",LJ=["Node"],JI=M(Kg,LJ,t=>{var{Node:e}=t;function r(a,o){var s=a;if(o==="auto")for(;Wn(s);)s=s.content;return kt(s)?!0:Rr(s)?r(s.args[0],o):!1}function n(a,o,s,l,u){var c=xr(a,o,s),f=Pc(a,o);if(o==="all"||l.length>2&&a.getIdentifier()!=="OperatorNode:add"&&a.getIdentifier()!=="OperatorNode:multiply")return l.map(function(C){switch(C.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=xr(l[0],o,s,a);if(u&&p!==null){var d,h;if(o==="keep"?(d=l[0].getIdentifier(),h=a.getIdentifier()):(d=l[0].getContent().getIdentifier(),h=a.getContent().getIdentifier()),Xa[c][h].latexLeftParens===!1){m=[!1];break}if(Xa[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 b,y=xr(l[0],o,s,a),D=zg(a,l[0],o);y===null?b=!1:y===c&&f==="right"&&!D||y<c?b=!0:b=!1;var v,A=xr(l[1],o,s,a),w=zg(a,l[1],o);if(A===null?v=!1:A===c&&f==="left"&&!w||A<c?v=!0:v=!1,u){var x,E,T;o==="keep"?(x=a.getIdentifier(),E=a.args[0].getIdentifier(),T=a.args[1].getIdentifier()):(x=a.getContent().getIdentifier(),E=a.args[0].getContent().getIdentifier(),T=a.args[1].getContent().getIdentifier()),y!==null&&(Xa[c][x].latexLeftParens===!1&&(b=!1),Xa[y][E].latexParens===!1&&(b=!1)),A!==null&&(Xa[c][x].latexRightParens===!1&&(v=!1),Xa[A][T].latexParens===!1&&(v=!1))}m=[b,v]}break;default:(a.getIdentifier()==="OperatorNode:add"||a.getIdentifier()==="OperatorNode:multiply")&&(m=l.map(function(C){var N=xr(C,o,s,a),I=zg(a,C,o),R=Pc(C,o);return N===null?!1:c===N&&f===R&&!I?!0:N<c}));break}if(l.length>=2&&a.getIdentifier()==="OperatorNode:multiply"&&a.implicit&&o!=="all"&&s==="hide")for(var _=1;_<m.length;++_)r(l[_],o)&&!m[_-1]&&(o!=="keep"||!Wn(l[_-1]))&&(m[_]=!0);return m}class i extends e{constructor(o,s,l,u,c){if(super(),typeof o!="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(Gt))throw new TypeError('Array containing Nodes expected for parameter "args"');this.implicit=u===!0,this.isPercentage=c===!0,this.op=o,this.fn=s,this.args=l||[]}get type(){return Kg}get isOperatorNode(){return!0}_compile(o,s){if(typeof this.fn!="string"||!yh(o,this.fn))throw o[this.fn]?new Error('No access to function "'+this.fn+'"'):new Error("Function "+this.fn+' missing in provided namespace "math"');var l=jr(o,this.fn),u=Wa(this.args,function(d){return d._compile(o,s)});if(typeof l=="function"&&l.rawArgs===!0){var c=this.args;return function(h,b,y){return l(c,o,al(h,b))}}else if(u.length===1){var f=u[0];return function(h,b,y){return l(f(h,b,y))}}else if(u.length===2){var m=u[0],p=u[1];return function(h,b,y){return l(m(h,b,y),p(h,b,y))}}else return function(h,b,y){return l.apply(null,Wa(u,function(D){return D(h,b,y)}))}}forEach(o){for(var s=0;s<this.args.length;s++)o(this.args[s],"args["+s+"]",this)}map(o){for(var s=[],l=0;l<this.args.length;l++)s[l]=this._ifNode(o(this.args[l],"args["+l+"]",this));return new i(this.op,this.fn,s,this.implicit,this.isPercentage)}clone(){return new i(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(o){var s=o&&o.parenthesis?o.parenthesis:"keep",l=o&&o.implicit?o.implicit:"hide",u=this.args,c=n(this,s,l,u,!1);if(u.length===1){var f=Pc(this,s),m=u[0].toString(o);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(o),h=u[1].toString(o);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()==="O
`).concat(a(_)))};if(d){var b=this.args;return function(_,C,N){var I=h(_);if(I.rawArgs===!0)return I(b,u,al(_,C));var R=f.map(L=>L(_,C,N));return I(...R)}}else switch(f.length){case 0:return function(_,C,N){var I=h(_);return I()};case 1:return function(_,C,N){var I=h(_),R=f[0];return I(R(_,C,N))};case 2:return function(_,C,N){var I=h(_),R=f[0],L=f[1];return I(R(_,C,N),L(_,C,N))};default:return function(_,C,N){var I=h(_),R=f.map(L=>L(_,C,N));return I(...R)}}}}else if($i(this.fn)&&Xi(this.fn.index)&&this.fn.index.isObjectProperty()){var D=this.fn.object._compile(u,c),v=this.fn.index.getObjectProperty(),A=this.args;return function(_,C,N){var I=D(_,C,N),R=cS(I,v);if(R!=null&&R.rawArgs)return R(A,u,al(_,C));var L=f.map(V=>V(_,C,N));return R.apply(I,L)}}else{var w=this.fn.toString(),x=this.fn._compile(u,c),E=this.args;return function(_,C,N){var I=x(_,C,N);if(typeof I!="function")throw new TypeError("Expression '".concat(w,"' did not evaluate to a function; value is:")+`
`.concat(a(I)));if(I.rawArgs)return I(E,u,al(_,C));var R=f.map(L=>L(_,C,N));return I.apply(I,R)}}}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"&&Ze(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=za(this.fn)?"("+this.fn.toString(u)+")":this.fn.toString(u);return f+"("+c.join(", ")+")"}toJSON(){return{mathjs:nv,fn:this.fn,args:this.args}}_toHTML(u){var c=this.args.map(function(f){return f.toHTML(u)});return'<span class="math-function">'+jn(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"&&Ze(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;Z0[this.name]&&(f=Z0[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=o(f,this,u);break;case"object":switch(typeof f[c.length]){case"function":m=f[c.length](this,u);break;case"string":m=o(f[c.length],this,u);break}}return typeof m<"u"?m:o(GI,this,u)}getIdentifier(){return this.type+":"+this.name}}return e=s,dr(s,"name",nv),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 r2="parse",WJ=["typed","numeric","config","AccessorNode","ArrayNode","AssignmentNode","BlockNode","ConditionalNode","ConstantNode","FunctionAssignmentNode","FunctionNode","IndexNode","ObjectNode","OperatorNode","ParenthesisNode","RangeNode","RelationalNode","SymbolNode"],n2=M(r2,WJ,t=>{var{typed:e,numeric:r,config:n,AccessorNode:i,ArrayNode:a,AssignmentNode:o,BlockNode:s,ConditionalNode:l,ConstantNode:u,FunctionAssignmentNode:c,FunctionNode:f,IndexNode:m,ObjectNode:p,OperatorNode:d,ParenthesisNode:h,RangeNode:b,RelationalNode:y,SymbolNode:D}=t,v=e(r2,{string:function(Y){return ne(Y,{})},"Array | Matrix":function(Y){return A(Y,{})},"string, Object":function(Y,ie){var Me=ie.nodes!==void 0?ie.nodes:{};return ne(Y,Me)},"Array | Matrix, Object":A});function A(F){var Y=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},ie=Y.nodes!==void 0?Y.nodes:{};return Ke(F,function(Me){if(typeof Me!="string")throw new TypeError("String expected");return ne(Me,ie)})}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},_=["NaN","Infinity"],C={'"':'"',"'":"'","\\":"\\","/":"/",b:"\b",f:"\f",n:`
`,r:"\r",t:" "};function N(){return{extraNodes:{},expression:"",comment:"",index:0,token:"",tokenType:w.NULL,nestingLevel:0,conditionalLevel:null}}function I(F,Y){return F.expression.substr(F.index,Y)}function R(F){return I(F,1)}function L(F){F.index++}function V(F){return F.expression.charAt(F.index-1)}function P(F){return F.expression.charAt(F.index+1)}function k(F){for(F.tokenType=w.NULL,F.token="",F.comment="";;){if(R(F)==="#")for(;R(F)!==`
`&&R(F)!=="";)F.comment+=R(F),L(F);if(v.isWhitespace(R(F),F.nestingLevel))L(F);else break}if(R(F)===""){F.tokenType=w.DELIMITER;return}if(R(F)===`
`&&!F.nestingLevel){F.tokenType=w.DELIMITER,F.token=R(F),L(F);return}var Y=R(F),ie=I(F,2),Me=I(F,3);if(Me.length===3&&x[Me]){F.tokenType=w.DELIMITER,F.token=Me,L(F),L(F),L(F);return}if(ie.length===2&&x[ie]){F.tokenType=w.DELIMITER,F.token=ie,L(F),L(F);return}if(x[Y]){F.tokenType=w.DELIMITER,F.token=Y,L(F);return}if(v.isDigitDot(Y)){F.tokenType=w.NUMBER;var Qe=I(F,2);if(Qe==="0b"||Qe==="0o"||Qe==="0x"){for(F.token+=R(F),L(F),F.token+=R(F),L(F);v.isHexDigit(R(F));)F.token+=R(F),L(F);if(R(F)===".")for(F.token+=".",L(F);v.isHexDigit(R(F));)F.token+=R(F),L(F);else if(R(F)==="i")for(F.token+="i",L(F);v.isDigit(R(F));)F.token+=R(F),L(F);return}if(R(F)==="."){if(F.token+=R(F),L(F),!v.isDigit(R(F))){F.tokenType=w.DELIMITER;return}}else{for(;v.isDigit(R(F));)F.token+=R(F),L(F);v.isDecimalMark(R(F),P(F))&&(F.token+=R(F),L(F))}for(;v.isDigit(R(F));)F.token+=R(F),L(F);if(R(F)==="E"||R(F)==="e"){if(v.isDigit(P(F))||P(F)==="-"||P(F)==="+"){if(F.token+=R(F),L(F),(R(F)==="+"||R(F)==="-")&&(F.token+=R(F),L(F)),!v.isDigit(R(F)))throw _e(F,'Digit expected, got "'+R(F)+'"');for(;v.isDigit(R(F));)F.token+=R(F),L(F);if(v.isDecimalMark(R(F),P(F)))throw _e(F,'Digit expected, got "'+R(F)+'"')}else if(v.isDecimalMark(P(F),F.expression.charAt(F.index+2)))throw L(F),_e(F,'Digit expected, got "'+R(F)+'"')}return}if(v.isAlpha(R(F),V(F),P(F))){for(;v.isAlpha(R(F),V(F),P(F))||v.isDigit(R(F));)F.token+=R(F),L(F);Ze(E,F.token)?F.tokenType=w.DELIMITER:F.tokenType=w.SYMBOL;return}for(F.tokenType=w.UNKNOWN;R(F)!=="";)F.token+=R(F),L(F);throw _e(F,'Syntax error in part "'+F.token+'"')}function W(F){do k(F);while(F.token===`
`)}function O(F){F.nestingLevel++}function Q(F){F.nestingLevel--}v.isAlpha=function(Y,ie,Me){return v.isValidLatinOrGreek(Y)||v.isValidMathSymbol(Y,Me)||v.isValidMathSymbol(ie,Y)},v.isValidLatinOrGreek=function(Y){return/^[a-zA-Z_$\u00C0-\u02AF\u0370-\u03FF\u2100-\u214F]$/.test(Y)},v.isValidMathSymbol=function(Y,ie){return/^[\uD835]$/.test(Y)&&/^[\uDC00-\uDFFF]$/.test(ie)&&/^[^\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(ie)},v.isWhitespace=function(Y,ie){return Y===" "||Y===" "||Y===`
`&&ie>0},v.isDecimalMark=function(Y,ie){return Y==="."&&ie!=="/"&&ie!=="*"&&ie!=="^"},v.isDigitDot=function(Y){return Y>="0"&&Y<="9"||Y==="."},v.isDigit=function(Y){return Y>="0"&&Y<="9"},v.isHexDigit=function(Y){return Y>="0"&&Y<="9"||Y>="a"&&Y<="f"||Y>="A"&&Y<="F"};function ne(F,Y){var ie=N();bn(ie,{expression:F,extraNodes:Y}),k(ie);var Me=X(ie);if(ie.token!=="")throw ie.tokenType===w.DELIMITER?Ge(ie,"Unexpected operator "+ie.token):_e(ie,'Unexpected part "'+ie.token+'"');return Me}function X(F){var Y,ie=[],Me;for(F.token!==""&&F.token!==`
2025-01-22 08:00:25 +00:00
`&&F.token!==";"&&(Y=U(F),F.comment&&(Y.comment=F.comment));F.token===`
2025-07-15 10:58:45 +00:00
`||F.token===";";)ie.length===0&&Y&&(Me=F.token!==";",ie.push({node:Y,visible:Me})),k(F),F.token!==`
`&&F.token!==";"&&F.token!==""&&(Y=U(F),F.comment&&(Y.comment=F.comment),Me=F.token!==";",ie.push({node:Y,visible:Me}));return ie.length>0?new s(ie):(Y||(Y=new u(void 0),F.comment&&(Y.comment=F.comment)),Y)}function U(F){var Y,ie,Me,Qe,gt=fe(F);if(F.token==="="){if(Mr(gt))return Y=gt.name,W(F),Me=U(F),new o(new D(Y),Me);if($i(gt))return W(F),Me=U(F),new o(gt.object,gt.index,Me);if(ai(gt)&&Mr(gt.fn)&&(Qe=!0,ie=[],Y=gt.name,gt.args.forEach(function(hr,Ve){Mr(hr)?ie[Ve]=hr.name:Qe=!1}),Qe))return W(F),Me=U(F),new c(Y,ie,Me);throw _e(F,"Invalid left hand side of assignment operator =")}return gt}function fe(F){for(var Y=xe(F);F.token==="?";){var ie=F.conditionalLevel;F.conditionalLevel=F.nestingLevel,W(F);var Me=Y,Qe=U(F);if(F.token!==":")throw _e(F,"False part of conditional expression expected");F.conditionalLevel=null,W(F);var gt=U(F);Y=new l(Me,Qe,gt),F.conditionalLevel=ie}return Y}function xe(F){for(var Y=oe(F);F.token==="or";)W(F),Y=new d("or","or",[Y,oe(F)]);return Y}function oe(F){for(var Y=be(F);F.token==="xor";)W(F),Y=new d("xor","xor",[Y,be(F)]);return Y}function be(F){for(var Y=ee(F);F.token==="and";)W(F),Y=new d("and","and",[Y,ee(F)]);return Y}function ee(F){for(var Y=Z(F);F.token==="|";)W(F),Y=new d("|","bitOr",[Y,Z(F)]);return Y}function Z(F){for(var Y=re(F);F.token==="^|";)W(F),Y=new d("^|","bitXor",[Y,re(F)]);return Y}function re(F){for(var Y=me(F);F.token==="&";)W(F),Y=new d("&","bitAnd",[Y,me(F)]);return Y}function me(F){for(var Y=[ce(F)],ie=[],Me={"==":"equal","!=":"unequal","<":"smaller",">":"larger","<=":"smallerEq",">=":"largerEq"};Ze(Me,F.token);){var Qe={name:F.token,fn:Me[F.token]};ie.push(Qe),W(F),Y.push(ce(F))}return Y.length===1?Y[0]:Y.length===2?new d(ie[0].name,ie[0].fn,Y):new y(ie.map(gt=>gt.fn),Y)}function ce(F){var Y,ie,Me,Qe;Y=Ae(F);for(var gt={"<<":"leftShift",">>":"rightArithShift",">>>":"rightLogShift"};Ze(gt,F.token);)ie=F.token,Me=gt[ie],W(F),Qe=[Y,Ae(F)],Y=new d(ie,Me,Qe);return Y}function Ae(F){var Y,ie,Me,Qe;Y=we(F);for(var gt={to:"to",in:"to"};Ze(gt,F.token);)ie=F.token,Me=gt[ie],W(F),ie==="in"&&F.token===""?Y=new d("*","multiply",[Y,new D("in")],!0):(Qe=[Y,we(F)],Y=new d(ie,Me,Qe));return Y}function we(F){var Y,ie=[];if(F.token===":"?Y=new u(1):Y=G(F),F.token===":"&&F.conditionalLevel!==F.nestingLevel){for(ie.push(Y);F.token===":"&&ie.length<3;)W(F),F.token===")"||F.token==="]"||F.token===","||F.token===""?ie.push(new D("end")):ie.push(G(F));ie.length===3?Y=new b(ie[0],ie[2],ie[1]):Y=new b(ie[0],ie[1])}return Y}function G(F){var Y,ie,Me,Qe;Y=J(F);for(var gt={"+":"add","-":"subtract"};Ze(gt,F.token);){ie=F.token,Me=gt[ie],W(F);var hr=J(F);hr.isPercentage?Qe=[Y,new d("*","multiply",[Y,hr])]:Qe=[Y,hr],Y=new d(ie,Me,Qe)}return Y}function J(F){var Y,ie,Me,Qe;Y=ge(F),ie=Y;for(var gt={"*":"multiply",".*":"dotMultiply","/":"divide","./":"dotDivide","%":"mod",mod:"mod"};Ze(gt,F.token);)if(Me=F.token,Qe=gt[Me],W(F),Me==="%"&&F.tokenType===w.DELIMITER&&F.token!=="(")if(F.token!==""&&gt[F.token]){var hr=new d("/","divide",[Y,new u(100)],!1,!0);Me=F.token,Qe=gt[Me],W(F),ie=ge(F),Y=new d(Me,Qe,[hr,ie])}else Y=new d("/","divide",[Y,new u(100)],!1,!0);else ie=ge(F),Y=new d(Me,Qe,[Y,ie]);return Y}function ge(F){var Y,ie;for(Y=ye(F),ie=Y;F.tokenType===w.SYMBOL||F.token==="in"&&kt(Y)||F.token==="in"&&Rr(Y)&&Y.fn==="unaryMinus"&&kt(Y.args[0])||F.tokenType===w.NUMBER&&!kt(ie)&&(!Rr(ie)||ie.op==="!")||F.token==="(";)ie=ye(F),Y=new d("*","multiply",[Y,ie],!0);return Y}function ye(F){for(var Y=De(F),ie=Y,Me=[];F.token==="/"&&Gf(ie);)if(Me.push(bn({},F)),W(F),F.tokenType===w.NUMBER)if(Me.push(bn({},F)),W(F),F.tokenType===w.SYMBOL||F.token==="("||F.token==="in")bn(F,Me.pop()),Me.pop(),ie=De(F),Y=new d("/","divide",[Y,ie]);else{Me.pop(),bn(F,Me.pop());break}else{bn(F,Me.pop());break}return Y}function De(F){var Y,ie,Me,Qe={"-":"unaryMinus","+":"unaryPlus","~":"bitNot",not:"not"};return Ze(Qe,F.token)?(Me=Qe[F.token],Y=F.token,W(F),ie=[De(F)],new d(Y,Me,ie)):Ie(F)}function Ie(F){var Y,ie,Me,Qe;return Y=Oe(F),(F.token==="^"||F.token===".^")&&(ie=F.token,Me=ie==="^"?"pow":"dotPow",W(F),Qe=[Y,De(F)],Y=new d(ie,
2025-01-22 08:00:25 +00:00
U: `+this.U.toString()+`
2025-07-15 10:58:45 +00:00
P: `+this.p}}}function h(b){var y=b._size[0],D=b._size[1],v=Math.min(y,D),A=b._values,w=b._index,x=b._ptr,E=[],T=[],_=[],C=[y,v],N=[],I=[],R=[],L=[v,D],V,P,k,W=[],O=[];for(V=0;V<y;V++)W[V]=V,O[V]=V;var Q=function(U,fe){var xe=O[U],oe=O[fe];W[xe]=fe,W[oe]=U,O[U]=oe,O[fe]=xe},ne=function(){var U=new p;P<y&&(_.push(E.length),E.push(1),T.push(P)),R.push(N.length);var fe=x[P],xe=x[P+1];for(k=fe;k<xe;k++)V=w[k],U.set(W[V],A[k]);P>0&&U.forEach(0,P-1,function(Z,re){m._forEachRow(Z,E,T,_,function(me,ce){me>Z&&U.accumulate(me,c(o(ce,re)))})});var oe=P,be=U.get(P),ee=n(be);U.forEach(P+1,y-1,function(Z,re){var me=n(re);l(me,ee)&&(oe=Z,ee=me,be=re)}),P!==oe&&(m._swapRows(P,oe,C[1],E,T,_),m._swapRows(P,oe,L[1],N,I,R),U.swap(P,oe),Q(P,oe)),U.forEach(0,y-1,function(Z,re){Z<=P?(N.push(re),I.push(Z)):(re=a(re,be),u(re,0)||(E.push(re),T.push(Z)))})};for(P=0;P<D;P++)ne();return R.push(N.length),_.push(E.length),{L:new m({values:E,index:T,ptr:_,size:C}),U:new m({values:N,index:I,ptr:R,size:L}),p:W,toString:function(){return"L: "+this.L.toString()+`
2025-01-22 08:00:25 +00:00
U: `+this.U.toString()+`
2025-07-15 10:58:45 +00:00
P: `+this.p}}}});var m2="qr",KJ=["typed","matrix","zeros","identity","isZero","equal","sign","sqrt","conj","unaryMinus","addScalar","divideScalar","multiplyScalar","subtractScalar","complex"],d2=M(m2,KJ,t=>{var{typed:e,matrix:r,zeros:n,identity:i,isZero:a,equal:o,sign:s,sqrt:l,conj:u,unaryMinus:c,addScalar:f,divideScalar:m,multiplyScalar:p,subtractScalar:d,complex:h}=t;return bn(e(m2,{DenseMatrix:function(A){return y(A)},SparseMatrix:function(A){return D(A)},Array:function(A){var w=r(A),x=y(w);return{Q:x.Q.valueOf(),R:x.R.valueOf()}}}),{_denseQRimpl:b});function b(v){var A=v._size[0],w=v._size[1],x=i([A],"dense"),E=x._data,T=v.clone(),_=T._data,C,N,I,R=n([A],"");for(I=0;I<Math.min(w,A);++I){var L=_[I][I],V=c(o(L,0)?1:s(L)),P=u(V),k=0;for(C=I;C<A;C++)k=f(k,p(_[C][I],u(_[C][I])));var W=p(V,l(k));if(!a(W)){var O=d(L,W);for(R[I]=1,C=I+1;C<A;C++)R[C]=m(_[C][I],O);var Q=c(u(m(O,W))),ne=void 0;for(N=I;N<w;N++){for(ne=0,C=I;C<A;C++)ne=f(ne,p(u(R[C]),_[C][N]));for(ne=p(ne,Q),C=I;C<A;C++)_[C][N]=p(d(_[C][N],p(R[C],ne)),P)}for(C=0;C<A;C++){for(ne=0,N=I;N<A;N++)ne=f(ne,p(E[C][N],R[N]));for(ne=p(ne,Q),N=I;N<A;++N)E[C][N]=m(d(E[C][N],p(ne,u(R[N]))),P)}}}return{Q:x,R:T,toString:function(){return"Q: "+this.Q.toString()+`
R: `+this.R.toString()}}}function y(v){var A=b(v),w=A.R._data;if(v._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 A}function D(v){throw new Error("qr not implemented for sparse matrices yet")}});function h2(t,e,r,n){for(var i=t._values,a=t._index,o=t._ptr,s=t._size,l=t._datatype,u=s[0],c=s[1],f=n&&t._values?[]:null,m=[],p=[],d=0,h=0;h<c;h++){p[h]=d;for(var b=r?r[h]:h,y=o[b],D=o[b+1],v=y;v<D;v++){var A=e?e[a[v]]:a[v];m[d]=A,f&&(f[d]=i[v]),d++}}return p[c]=d,t.createSparseMatrix({values:f,index:m,ptr:p,size:[u,c],datatype:l})}function iv(t,e,r,n,i,a,o){var s=0;for(r[o]=t;s>=0;){var l=r[o+s],u=r[n+l];u===-1?(s--,a[e++]=l):(r[n+l]=r[i+u],++s,r[o+s]=u)}return e}function g2(t,e){if(!t)return null;var r=0,n,i=[],a=[],o=0,s=e,l=2*e;for(n=0;n<e;n++)a[o+n]=-1;for(n=e-1;n>=0;n--)t[n]!==-1&&(a[s+n]=a[o+t[n]],a[o+t[n]]=n);for(n=0;n<e;n++)t[n]===-1&&(r=iv(n,r,a,o,s,i,l));return i}function v2(t,e){if(!t)return null;var r=t._index,n=t._ptr,i=t._size,a=i[0],o=i[1],s=[],l=[],u=0,c=o,f,m;if(e)for(f=0;f<a;f++)l[c+f]=-1;for(var p=0;p<o;p++){s[p]=-1,l[u+p]=-1;for(var d=n[p],h=n[p+1],b=d;b<h;b++){var y=r[b];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 y2(t,e,r){for(var n=t._values,i=t._index,a=t._ptr,o=t._size,s=o[1],l=0,u=0;u<s;u++){var c=a[u];for(a[u]=l;c<a[u+1];c++)e(i[c],u,n?n[c]:1,r)&&(i[l]=i[c],n&&(n[l]=n[c]),l++)}return a[s]=l,i.splice(l,i.length-l),n&&n.splice(l,n.length-l),l}function xo(t){return-t-2}var eX="csAmd",tX=["add","multiply","transpose"],b2=M(eX,tX,t=>{var{add:e,multiply:r,transpose:n}=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,b=Math.max(16,10*Math.sqrt(d));b=Math.min(d-2,b);var y=i(c,f,p,d,b);y2(y,l,null);for(var D=y._index,v=y._ptr,A=v[d],w=[],x=[],E=0,T=d+1,_=2*(d+1),C=3*(d+1),N=4*(d+1),I=5*(d+1),R=6*(d+1),L=7*(d+1),V=w,P=a(d,v,x,E,C,V,_,L,T,R,N,I),k=o(d,v,x,I,N,R,b,T,C,V,_),W=0,O,Q,ne,X,U,fe,xe,oe,be,ee,Z,re,me,ce,Ae,we;k<d;){for(ne=-1;W<d&&(ne=x[C+W])===-1;W++);x[_+ne]!==-1&&(V[x[_+ne]]=-1),x[C+W]=x[_+ne];var G=x[N+ne],J=x[T+ne];k+=J;var ge=0;x[T+ne]=-J;var ye=v[ne],De=G===0?ye:A,Ie=De;for(X=1;X<=G+1;X++){for(X>G?(fe=ne,xe=ye,oe=x[E+ne]-G):(fe=D[ye++],xe=v[fe],oe=x[E+fe]),U=1;U<=oe;U++)O=D[xe++],!((be=x[T+O])<=0)&&(ge+=be,x[T+O]=-be,D[Ie++]=O,x[_+O]!==-1&&(V[x[_+O]]=V[O]),V[O]!==-1?x[_+V[O]]=x[_+O]:x[C+x[I+O]]=x[_+O]);fe!==ne&&(v[fe]=xo(ne),x[R+fe]=0)}for(G!==0&&(A=Ie),x[I+ne]=ge,v[ne]=De,x[E+ne]=Ie-De,x[N+ne]=-2,P=s(P,h,x,R,d),ee=De;ee<Ie;ee++)if(O=D[ee],!((Z=x[N+O])<=0)){be=-x[T+O];var Oe=P-be;for(ye=v[O],re=v[O]+Z-1;ye<=re;ye++)fe=D[ye],x[R+fe]>=P?x[R+fe]-=be:x[R+fe]!==0&&(x[R+fe]=x[I+fe]+Oe)}for(ee=De;ee<Ie;ee++){for(O=D[ee],re=v[O],me=re+x[N+O]-1,ce=re,Ae=0,we=0,ye=re;ye<=me;ye++)if(fe=D[ye],x[R+fe]!==0){var Je=x[R+fe]-P;Je>0?(we+=Je,D[ce++]=fe,Ae+=fe):(v[fe]=xo(ne),x[R+fe]=0)}x[N+O]=ce-re+1;var wt=ce,qe=re+x[E+O];for(ye=me+1;ye<qe;ye++){Q=D[ye];var rr=x[T+Q];rr<=0||(we+=rr,D[ce++]=Q,Ae+=Q)}we===0?(v[O]=xo(ne),be=-x[T+O],ge-=be,J+=be,k+=be,x[T+O]=0,x[N+O]=-1):(x[I+O]=Math.min(x[I+O],we),D[ce]=D[wt],D[wt]=D[re],D[re]=ne,x[E+O]=ce-re+1,Ae=(Ae<0?-Ae:Ae)%d,x[_+O]=x[L+Ae],x[L+Ae]=O,V[O]=Ae)}for(x[I+ne]=ge,h=Math.max(h,ge),P=s(P+h,h,x,R,d),ee=De;ee<Ie;ee++)if(O=D[ee],!(x[T+O]>=0))for(Ae=V[O],O=x[L+Ae],x[L+Ae]=-1;O!==-1&&x[_+O]!==-1;O=x[_+O],P++){for(oe=x[E+O],Z=x[N+O],ye=v[O]+1;ye<=v[O]+oe-1;ye++)x[R+D[ye]]=P;var Wt=O;for(Q=x[_+O];Q!==-1;){var pr=x[E+Q]===oe&&x[N+Q]===Z;for(ye=v[Q]+1;pr&&ye<=v[Q]+oe-1;ye++)x[R+D[ye]]!==P&&(pr=0);pr?(v[Q]=xo(O),x[T+O]+=x[T+Q],x[T+Q]=0,x[N+Q]=-1,Q=x[_+Q],x[_+Wt]=Q):(Wt=Q,Q=x[_+Q])}}for(ye=De,ee=De;ee<Ie;ee++)O=D[ee],!((be=-x[T+O])<=0)&&(x[T+O]=be,we=x[I+O]+ge-be,we=Math.min(we,d-k-be),x[C+we]!==-1&&(V[x[C+we]]=O),x[_+O]=x[C+we],V[O]=-1,x[C+we]=O,W=Math.min(W,we),x[I+O]=we,D[ye++]=O);x[T+ne]=J,(x[E+ne]=ye-De)===0&&(v[ne]=-1,x[R+ne]=0),G!==0&&(A=ye)}for(O=0;O<d;O++)v[O]=xo(v[O]);for(Q=0;Q<=d;Q++)x[C+Q]=-1;for(Q=d;Q>=0;Q--)x[T+Q]>0||(x[_+Q]=x[C+v[Q]],x[C+v[Q]]=Q);for(fe=d;fe>=0;fe--)x[T+fe]<=0||v[fe]!==-1&&(x
2025-01-22 08:00:25 +00:00
U: `+this.U.toString()+`
p: `+this.p.toString()+(this.q?`
q: `+this.q.toString():"")+`
2025-07-15 10:58:45 +00:00
`}}}})});function X0(t,e){var r,n=e.length,i=[];if(t)for(r=0;r<n;r++)i[t[r]]=e[r];else for(r=0;r<n;r++)i[r]=e[r];return i}var C2="lusolve",fX=["typed","matrix","lup","slu","usolve","lsolve","DenseMatrix"],N2=M(C2,fX,t=>{var{typed:e,matrix:r,lup:n,slu:i,usolve:a,lsolve:o,DenseMatrix:s}=t,l=Uo({DenseMatrix:s});return e(C2,{"Array, Array | Matrix":function(m,p){m=r(m);var d=n(m),h=c(d.L,d.U,d.p,null,p);return h.valueOf()},"DenseMatrix, Array | Matrix":function(m,p){var d=n(m);return c(d.L,d.U,d.p,null,p)},"SparseMatrix, Array | Matrix":function(m,p){var d=n(m);return c(d.L,d.U,d.p,null,p)},"SparseMatrix, Array | Matrix, number, number":function(m,p,d,h){var b=i(m,d,h);return c(b.L,b.U,b.p,b.q,p)},"Object, Array | Matrix":function(m,p){return c(m.L,m.U,m.p,m.q,p)}});function u(f){if(Ye(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=X0(p,h._data));var b=o(f,h),y=a(m,b);return d&&(y._data=X0(d,y._data)),y}});var F2="polynomialRoot",pX=["typed","isZero","equalScalar","add","subtract","multiply","divide","sqrt","unaryMinus","cbrt","typeOf","im","re"],I2=M(F2,pX,t=>{var{typed:e,isZero:r,equalScalar:n,add:i,subtract:a,multiply:o,divide:s,sqrt:l,unaryMinus:u,cbrt:c,typeOf:f,im:m,re:p}=t;return e(F2,{"number|Complex, ...number|Complex":(d,h)=>{for(var b=[d,...h];b.length>0&&r(b[b.length-1]);)b.pop();if(b.length<2)throw new RangeError("Polynomial [".concat(d,", ").concat(h,"] must have a non-zero non-constant coefficient"));switch(b.length){case 2:return[u(s(b[0],b[1]))];case 3:{var[y,D,v]=b,A=o(2,v),w=o(D,D),x=o(4,v,y);if(n(w,x))return[s(u(D),A)];var E=l(a(w,x));return[s(a(E,D),A),s(a(u(E),D),A)]}case 4:{var[T,_,C,N]=b,I=u(o(3,N)),R=o(C,C),L=o(3,N,_),V=i(o(2,C,C,C),o(27,N,N,T)),P=o(9,N,C,_);if(n(R,L)&&n(V,P))return[s(C,I)];var k=a(R,L),W=a(V,P),O=i(o(18,N,C,_,T),o(C,C,_,_)),Q=i(o(4,C,C,C,T),o(4,N,_,_,_),o(27,N,N,T,T));if(n(O,Q))return[s(a(o(4,N,C,_),i(o(9,N,N,T),o(C,C,C))),o(N,k)),s(a(o(9,N,T),o(C,_)),o(2,k))];var ne;n(R,L)?ne=W:ne=s(i(W,l(a(o(W,W),o(4,k,k,k)))),2);var X=!0,U=c(ne,X).toArray().map(fe=>s(i(C,fe,s(k,fe)),I));return U.map(fe=>f(fe)==="Complex"&&n(p(fe),p(fe)+m(fe))?p(fe):fe)}default:throw new RangeError("only implemented for cubic or lower-order polynomials, not ".concat(b))}}})});var mX="Help",dX=["evaluate"],B2=M(mX,dX,t=>{var{evaluate:e}=t;function r(n){if(!(this instanceof r))throw new SyntaxError("Constructor must be called with the new operator");if(!n)throw new Error('Argument "doc" missing');this.doc=n}return r.prototype.type="Help",r.prototype.isHelp=!0,r.prototype.toString=function(){var n=this.doc||{},i=`
2025-01-22 08:00:25 +00:00
`;if(n.name&&(i+="Name: "+n.name+`
`),n.category&&(i+="Category: "+n.category+`
`),n.description&&(i+=`Description:
`+n.description+`
`),n.syntax&&(i+=`Syntax:
`+n.syntax.join(`
`)+`
`),n.examples){i+=`Examples:
`;for(var a=!1,o=e("config()"),s={config:f=>(a=!0,e("config(newConfig)",{newConfig:f}))},l=0;l<n.examples.length;l++){var u=n.examples[l];i+=" "+u+`
2025-07-15 10:58:45 +00:00
`;var c=void 0;try{c=e(u,s)}catch(f){c=f}c!==void 0&&!mc(c)&&(i+=" "+Dt(c,{precision:14})+`
2025-01-22 08:00:25 +00:00
`)}i+=`
`,a&&e("config(originalConfig)",{originalConfig:o})}return n.mayThrow&&n.mayThrow.length&&(i+="Throws: "+n.mayThrow.join(", ")+`
`),n.seealso&&n.seealso.length&&(i+="See also: "+n.seealso.join(", ")+`
2025-07-15 10:58:45 +00:00
`),i},r.prototype.toJSON=function(){var n=ut(this.doc);return n.mathjs="Help",n},r.fromJSON=function(n){var i={};return Object.keys(n).filter(a=>a!=="mathjs").forEach(a=>{i[a]=n[a]}),new r(i)},r.prototype.valueOf=r.prototype.toString,r},{isClass:!0});var hX="Chain",gX=["?on","math","typed"],k2=M(hX,gX,t=>{var{on:e,math:r,typed:n}=t;function i(u){if(!(this instanceof i))throw new SyntaxError("Constructor must be called with the new operator");dc(u)?this.value=u.value:this.value=u}i.prototype.type="Chain",i.prototype.isChain=!0,i.prototype.done=function(){return this.value},i.prototype.valueOf=function(){return this.value},i.prototype.toString=function(){return Dt(this.value)},i.prototype.toJSON=function(){return{mathjs:"Chain",value:this.value}},i.fromJSON=function(u){return new i(u.value)};function a(u,c){typeof c=="function"&&(i.prototype[u]=s(c))}function o(u,c){_s(i.prototype,u,function(){var m=c();if(typeof m=="function")return s(m)})}function s(u){return function(){if(arguments.length===0)return new i(u(this.value));for(var c=[this.value],f=0;f<arguments.length;f++)c[f+1]=arguments[f];if(n.isTypedFunction(u)){var m=n.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 i(m.implementation.apply(u,c))}return new i(u.apply(u,c))}}i.createProxy=function(u,c){if(typeof u=="string")a(u,c);else{var f=function(d){Ze(u,d)&&l[d]===void 0&&o(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 i.createProxy(r),e&&e("import",function(u,c,f){f||o(u,c)}),i},{isClass:!0});var Q0={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 P2={name:"false",category:"Constants",syntax:["false"],description:"Boolean value false",examples:["false"],seealso:["true"]};var $2={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 O2={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 R2={name:"LN10",category:"Constants",syntax:["LN10"],description:"Returns the natural logarithm of 10, approximately equal to 2.302",examples:["LN10","log(10)"],seealso:[]};var L2={name:"LN2",category:"Constants",syntax:["LN2"],description:"Returns the natural logarithm of 2, approximately equal to 0.693",examples:["LN2","log(2)"],seealso:[]};var V2={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 U2={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 q2={name:"NaN",category:"Constants",syntax:["NaN"],description:"Not a number",examples:["NaN","0 / 0"],seealso:[]};var z2={name:"null",category:"Constants",syntax:["null"],description:"Value null",examples:["null"],seealso:["true","false"]};var H2={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 K0={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 G2={name:"SQRT1_2",category:"Constants",syntax:["SQRT1_2"],description:"Returns the
2025-01-22 08:00:25 +00:00
2025-07-15 10:58:45 +00:00
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 d$={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 h$={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 g$={name:"sum",category:"Statistics",syntax:["sum(a, b, c, ...)","sum(A)","sum(A, dimension)"],description:"Compute the sum of all values.",examples:["sum(2, 3, 4, 1)","sum([2, 3, 4, 1])","sum([2, 5; 4, 3])"],seealso:["max","mean","median","min","prod","std","sum","variance"]};var v$={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 y$={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 b$={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 x$={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 w$={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 _$={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 A$={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 D$={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 S$={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 E$={name:"asech",category:"Trigonometry",syntax:["asech(x)"],description:"Calculate the inverse secant
`);let f=t.api.isInlineFieldDeclarationAndGetType(a.str.trim());f===void 0?a.highlights=new ts(a.str,[]):(a.fieldType=f,a.highlights=t.syntaxHighlighting.highlight(a.str,a.fieldType,!0))}let s=a.highlights.getHighlights().filter(l=>l.range.from.line===a.line).find(l=>l.range.from.column===i.pos+1);return s===void 0?(i.next(),i.eol()&&(a.line+=1),"line-HyperMD-codeblock"):(i.eatWhile(()=>i.pos+1<s.range.to.column)||i.next(),i.eol()&&(a.line+=1),`line-HyperMD-codeblock mb-highlight-${s.tokenClass}`)}}))}var dw=require("@codemirror/language"),sl=require("@codemirror/view");var wv=require("obsidian");var f4=require("obsidian");var Cs=class{static checkSelectionOverlap(e,r,n){if(!e)return!1;for(let i of e.ranges)if(i.to>=r&&i.from<=n)return!0;return!1}static checkRangeOverlap(e,r,n,i){return e<=i&&n<=r}static getContent(e,r,n){return e.sliceDoc(r,n)}static getCurrentFile(e){return e.state.field(f4.editorInfoField).file}static existsDecorationBetween(e,r,n){let i=!1;return e.between(r,n,()=>{i=!0}),i}static existsDecorationOfTypeBetween(e,r,n,i){let a=!1;return e.between(n,i,(o,s,l)=>{l.spec.mb_widgetType===r&&(a=!0)}),a}};function p4(t){return sl.ViewPlugin.fromClass(class{constructor(e){this.component=new wv.Component,this.component.load(),this.decorations=this.renderWidgets(e)??sl.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(wv.editorLivePreviewField)}update(e){this.decorations=this.decorations.map(e.changes),this.updateWidgets(e.view)}updateWidgets(e){this.decorations=this.decorations.update({filter:(r,n,i)=>xA.anyMatch(e.visibleRanges,o=>Cs.checkRangeOverlap(r,n,o.from,o.to))?!0:(i.spec.mb_unload?.(),!1)});for(let{from:r,to:n}of e.visibleRanges)(0,dw.syntaxTree)(e.state).iterate({from:r,to:n,enter:i=>{let a=i.node,o=this.getRenderInfo(e,a);o.widgetType===void 0||o.content===void 0||(o.shouldRender?(this.removeDecoration(a,"field"),this.addDecoration(a,e,"field",o.content,o.widgetType)):o.shouldHighlight?(this.removeDecoration(a,"highlight"),this.addDecoration(a,e,"highlight",o.content,o.widgetType)):this.removeDecoration(a))}})}removeDecoration(e,r){this.decorations.between(e.from-1,e.to+1,(n,i,a)=>{this.decorations=this.decorations.update({filterFrom:n,filterTo:i,filter:(o,s,l)=>{let u=l.spec;return r&&u.mb_widgetType===r?!0:(u.mb_unload?.(),!1)}})})}addDecoration(e,r,n,i,a){let o=e.from-1,s=e.to+1;if(Cs.existsDecorationOfTypeBetween(this.decorations,n,o,s))return;let l=Cs.getCurrentFile(r);if(!l)return;let u=this.renderWidget(e,a,n,i,l),c=Array.isArray(u)?u:[u];c.length!==0&&(this.decorations=this.decorations.update({add:c}))}getRenderInfo(e,r){let n=new Set(r.type.name?.split("_"));if(n.has("inline-code")&&!n.has("formatting")){let i=Cs.checkSelectionOverlap(e.state.selection,r.from-1,r.to+1),a=this.readNode(e,r.from,r.to),o=this.isLivePreview(e.state),s=!i&&o;return{shouldRender:s,shouldHighlight:!s&&t.getSettings().enableSyntaxHighlighting,content:a.content,widgetType:a.widgetType}}return{shouldRender:!1,shouldHighlight:!1,content:void 0,widgetType:void 0}}readNode(e,r,n){let i=Cs.getContent(e.state,r,n);return{content:i,widgetType:t.api.isInlineFieldDeclarationAndGetType(i)}}renderWidgets(e){let r=Cs.getCurrentFile(e);if(!r)return;let n=[];for(let i of e.visibleRanges)(0,dw.syntaxTree)(e.state).iterate({from:i.from,to:i.to,enter:a=>{let o=a.node,s=this.getRenderInfo(e,o);if(!s.widgetType||!s.content)return;let l;s.shouldRender&&(l=this.renderWidget(o,s.widgetType,"field",s.content,r)),s.shouldHighlight&&(l=this.renderWidget(o,s.widgetType,"highlight",s.content,r)),l&&(Array.isArray(l)?n.push(...l):n.push(l))}});return sl.Decoration.set(n,!0)}renderWidget(e,r,n,i,a){if(n==="field"){let o=t.api.constructMDRCWidget(r,i,a.path,this.component);return sl.Decoration.replace({widget:o,mb_widgetType:"field",mb_unload:()=>{o.renderChild?.unload()}}).range(e.from-1,e.to+1)}else return t.syntaxHighlighting.h
\`\`\`meta-bind
INPUT[${n}:exampleProperty]
\`\`\`
`,e.push([i,a])}return e.sort((r,n)=>r[0].localeCompare(n[0])),e}function v4(t){let e=[];for(let r of Object.values(hw))for(let n of r)e.push([n.title,`\`${n.display}\``]);return e.sort((r,n)=>r[0].localeCompare(n[0])),e}function b4(t,e,r){let n=g4(r),i=v4(r);t.addItem(a=>{a.setTitle("Meta Bind"),a.setIcon("blocks");let o=a.setSubmenu();o.addItem(s=>{s.setTitle("Input Field");let l=s.setSubmenu();for(let[u,c]of n)l.addItem(f=>{f.setTitle(u),f.onClick(()=>Av(e,c))})}),o.addItem(s=>{s.setTitle("View Field");let l=s.setSubmenu();for(let[u,c]of i)l.addItem(f=>{f.setTitle(u),f.onClick(()=>Av(e,c))})}),o.addItem(s=>{s.setTitle("Inline Button"),s.onClick(()=>{Av(e,"`BUTTON[example-id]`")})}),o.addItem(s=>{s.setTitle("Button"),s.onClick(()=>{r.internal.openButtonBuilderModal({onOkay:l=>{Av(e,`\`\`\`meta-bind-button
${(0,y4.stringifyYaml)(l)}
\`\`\``)},submitText:"Insert"})})})})}function Av(t,e){t.replaceSelection(e)}var L4=require("obsidian");var kn=class extends vi{constructor(e,r,n){super(),this.mb=e,this.filePath=n,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 Vc=class{constructor(e){this.scope=e}};var Ea=Bt()(he.string()),Uc=Bt()(he.nativeEnum(Ti)),mp=Bt()(he.nativeEnum(_l)),w4=Bt()(he.nativeEnum(Ls)),_4=Bt()(he.instanceof(HTMLElement)),qc=Bt()(he.instanceof(Vc)),rot=Bt()(he.instanceof(hn)),not=Bt()(he.function().args().returns(he.void())),iot=Bt()(he.instanceof(kn)),A4=Bt()(he.instanceof(vi)),D4=Bt()(he.instanceof($s)),x4=Bt()(he.object({index:he.number(),line:he.number(),column:he.number()})),TK=Bt()(he.object({from:x4,to:x4})),cu=Bt()(he.object({value:he.string(),position:TK.optional()})),S4=Bt()(he.object({name:cu,value:cu.array()})),MK=Bt()(he.object({type:he.nativeEnum(bu),prop:cu})),gw=Bt()(he.object({storageType:cu.optional(),storagePath:cu.optional(),storageProp:MK.array(),listenToChildren:he.boolean()})),aot=Bt()(he.object({declarationString:he.string().optional(),inputFieldType:cu.optional(),templateName:cu.optional(),bindTarget:gw.optional(),arguments:S4.array(),errorCollection:he.instanceof(er)})),oot=Bt()(he.object({declarationString:he.string().optional(),templateDeclaration:he.array(he.union([he.string(),gw])).optional(),viewFieldType:cu.optional(),arguments:S4.array(),writeToBindTarget:gw.optional(),errorCollection:he.instanceof(er)})),Sa=Bt()(he.object({storageType:he.string(),storagePath:he.string(),storageProp:he.instanceof(js),listenToChildren:he.boolean()})),E4=Bt()(he.object({name:he.string(),value:he.string().array()})),sot=Bt()(he.object({type:he.nativeEnum(bu),prop:he.string()})),T4=Bt()(he.object({inputFieldType:w4.optional(),templateName:he.string().optional(),bindTarget:Sa.optional(),arguments:E4.array().optional()})),M4=Bt()(he.object({viewFieldType:w4.optional(),templateDeclaration:he.union([he.string(),Sa]).array().optional(),arguments:E4.array().optional(),writeToBindTarget:Sa.optional()})),CK=Bt()(he.object({bindTarget:Sa,name:he.string()})),NK=Bt()(he.object({bindTargetMappings:CK.array(),writeToBindTarget:Sa.optional(),code:he.string()})),FK=Bt()(he.object({referencedButtonIds:he.string().array()})),C4=Bt()(he.object({renderChildType:Uc,declaration:he.union([he.string(),T4]),scope:qc.optional()})),N4=Bt()(he.object({renderChildType:Uc,declaration:he.union([he.string(),M4]),scope:qc.optional()})),F4=Bt()(he.object({declaration:he.union([he.string(),NK])})),I4=Bt()(he.object({bindTarget:Sa,tableHead:he.string().array(),columns:he.array(he.union([T4,M4,he.string()]))})),B4=Bt()(he.object({renderChildType:Uc,declaration:he.union([he.string(),FK]),position:D4.optional()})),k4=Bt()(he.object({declaration:he.union([he.string(),lc]),position:D4.optional(),isPreview:he.boolean()})),P4=Bt()(he.object({depth:he.number(),content:he.string()}));var BK=(t,e)=>e(t,"left"),kK=se("<button><!> </button>");function dp(t,e){Se(e,!0);let r=at(e,"variant",19,()=>"default"),n=at(e,"disabled",7,!1),i=at(e,"tooltip",3,""),a=at(e,"label",3,""),o=at(e,"icon",3,""),s=at(e,"cssStyle",3,""),l=at(e,"backgroundImage",3,""),u=at(e,"error",3,!1),c=at(e,"onclick",3,()=>{}),f=at(e,"onauxclick",3,()=>{});async function m(v,A){if(!n()){n(!0);try{A==="left"?await c()(v):A==="middle"&&await f()(v)}catch(w){console.warn("failed to run button component on click",w)}finally{n(!1)}}}var p=kK();let d,h;p.__click=[BK,m];var b=ve(p);{var y=v=>{Or(v,{get mb(){return e.mb},get iconName(){return o()}})};et(b,v=>{o()&&v(y)})}var D=ue(b);le(p),Le(v=>{d=Vr(p,1,"mb-button-inner",null,d,v),h=jl(p,s(),h,{"background-image":l()?`url("${l()}")`:void 0}),rt(p,"aria-label",i()),p.disabled=n(),vt(D,` ${a()??""}`)},[()=>({"mod-cta":r()==="primary","mod-warning":r()==="destructive","mod-plain":r()==="plain",disabled:n(),"mb-error":u()})]),gi("auxclick",p,v=>m(v,"middle")),K(t,p),Ee()}Mt(["click"]);var fu=class extends vi{co
`).map(a=>a.trim()).filter(a=>a.length>0);if(e.length===0)return{content:""};if(e.length>1)return{error:"Embed may only contain one link"};let r=e[0],n=vn.parseLink(r);if(!n.internal)return{error:`${r} is not an internal link`};let i=this.mb.file.getPathByName(n.target,this.getFilePath());return i===void 0?{error:`"${n.target}" is not created yet`}:{content:await this.mb.file.read(i)}}exceedsMaxDepth(){return this.depth>_m}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 n=r.content.replace(/(```+|~~~+)meta-bind-embed.*/g,`$1meta-bind-embed-internal-${this.depth+1}`);this.markdownUnloadCallback=await this.mb.internal.renderMarkdown(n,e,this.getFilePath())}catch(r){let n=new er("Embed");n.add(r),this.mb.internal.createErrorIndicator(e,{errorCollection:n})}}onMount(e){super.onMount(e),e.addClass("mb-embed"),this.renderContent(e)}onUnmount(e){super.onUnmount(e),e.removeClass("mb-embed"),this.markdownUnloadCallback?.(),ui(e,"Embed")}};var Mv=class extends kn{constructor(e,r,n){super(e,r,n)}onMount(e){super.onMount(e),lt.empty(e),lt.createElement(e,"span",{text:"[META_BIND] This folder has been excluded in the settings",class:"mb-error"})}onUnmount(e){super.onUnmount(e),lt.empty(e),ui(e,"Excluded")}};var zc=class extends kn{constructor(e,r,n,i,a){super(e,r,n),this.renderChildType=i,this.declaration=a,this.declarationString=a.declarationString,this.errorCollection=new er(this.getUuid()),this.errorCollection.merge(a.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 Lt({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=lt.createElement(e,"div");lt.addClass(r,"mb-card");let n=this.getArgument("title");return n&&lt.createElement(r,"h3",{text:n.value}),r}return e}addShowcase(e){if(this.getArgument("showcase")&&this.shouldAddCardContainer()){let n=lt.createElement(e,"code",{class:"mb-none"}),i=lt.createElement(n,"a",{text:this.declarationString,class:"mb-no-link"});i.href=qt.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 Lt({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),lt.empty(e),lt.addClass(e,"mb-input"),this.createInputField(),this.errorCollection.hasErrors()){this.createErrorIndicator(e);return}let r=this.createContainer(e);this.createErrorIndicator(r);let n=lt.createElement(r,"div",{class:"mb-input-wrapper"});this.inputField?.mount(n);let i=this.getArguments("class");for(let a of i)lt.addClasses(n,a.value);lt.addClass(n,`mb-input-type-${this.declaration.inputFieldType}`),this.renderChildTy
`);if(r.at(0)==="---"){for(let n=1;n<r.length;n++)if(r.at(n)==="---")return{lineStart:1,lineEnd:n+1}}}isExcludedFromRendering(e){for(let r of this.mb.getSettings().excludedFolders)if(e.startsWith(r))return!0;return!1}resolveFilePathLike(e,r){let n=vn.isLink(e)?vn.parseLink(e).target:e,i=this.mb.file.getPathByName(n,r);if(i===void 0)throw new to({errorLevel:"ERROR",cause:`Could not find a file that matches "${e}".`,effect:`Could not resolve path or link "${e}" relative to "${r}".`});return i}createLineNumberContext(e,r){let i=e.split(`
`).length,a=this.mb.file.getFrontmatterLocation(e);return{fileStart:1,fileEnd:i,frontmatterStart:a?a.lineStart:1,frontmatterEnd:a?a.lineEnd:1,contentStart:a?a.lineEnd+1:1,contentEnd:i,selfStart:r?r.lineStart+1:void 0,selfEnd:r?r.lineEnd+1:void 0}}};var Rv=class extends Ov{constructor(e){super(e),this.app=e.app}async read(e){let r=this.app.vault.getAbstractFileByPath(e);if(!r||!(r instanceof ul.TFile))throw new Error(`file not found: ${e}`);return this.app.vault.cachedRead(r)}async write(e,r){let n=this.app.vault.getFileByPath(e);if(!n)throw new Error(`file not found: ${e}`);await this.app.vault.modify(n,r)}async exists(e){return this.app.vault.getFileByPath(e)!==null}async atomicModify(e,r){let n=this.app.vault.getFileByPath(e);if(!n)throw new Error(`file not found: ${e}`);await this.app.vault.process(n,i=>r(i))}async create(e,r,n,i=!1,a=!1){let o=this.app.vault.getAvailablePath((0,ul.normalizePath)(e+"/"+r),n),s=await this.app.vault.create(o,"");return i&&await this.openInSourceMode(s,a),s.path}getAllFiles(){return this.app.vault.getAllLoadedFiles().filter(e=>e instanceof ul.TFile).map(e=>e.path)}getAllFolders(){return this.app.vault.getAllLoadedFiles().filter(e=>e instanceof ul.TFolder).map(e=>e.path)}async open(e,r,n){this.app.workspace.openLinkText(e,r,n)}async openInSourceMode(e,r){let n=this.app.workspace.getLeaf(r?"tab":!1);n&&await n.openFile(e,{state:{mode:"source"}})}getPathByName(e,r=""){return this.app.metadataCache.getFirstLinkpathDest(e,r)?.path}};var Tn=require("obsidian");var Lv=Tr(Bf());var V4=Tr(Bf());var qK=se('<div class="mb-calendar-cell mb-calendar-header-cell"><span class="mb-calendar-cell-text"> </span></div>'),zK=(t,e,r)=>e(q(r)),HK=(t,e,r)=>e(t,q(r)),GK=se('<div role="button" tabindex="0"><span class="mb-calendar-cell-text"> </span></div>'),WK=se('<div class="mb-calendar"><div class="mb-calendar-header"></div> <div class="mb-calendar-content"></div></div>');function bw(t,e){Se(e,!0);let r=cr(()=>sS(e.month,e.year));function n(l){l&&e.dateChange((0,V4.default)(new Date(e.year,e.month,l)))}function i(l,u){l.key===" "&&n(u)}var a=WK(),o=ve(a);Ut(o,21,uS,Zt,(l,u)=>{var c=qK(),f=ve(c),m=ve(f,!0);le(f),le(c),Le(()=>vt(m,q(u))),K(l,c)}),le(o);var s=ue(o,2);Ut(s,21,()=>q(r),l=>lS(),(l,u)=>{var c=GK();let f;c.__click=[zK,n,u],c.__keydown=[HK,i,u];var m=ve(c),p=ve(m,!0);le(m),le(c),Le(d=>{f=Vr(c,1,"mb-calendar-cell",null,f,d),vt(p,q(u)||"")},[()=>({"mb-calendar-highlight":q(u),"mb-calendar-content-cell":q(u),"mb-calendar-selected":e.selectedDate?.year()===e.year&&e.selectedDate?.month()===e.month&&e.selectedDate?.date()===q(u)})]),K(l,c)}),le(s),le(a),K(t,a),Ee()}Mt(["click","keydown"]);function YK(t,e,r){if(q(e)===11){ke(e,0),ke(r,q(r)+1);return}ke(e,q(e)+1)}function jK(t,e,r){if(q(e)===0){ke(e,11),ke(r,q(r)-1);return}ke(e,q(e)-1)}function ZK(t,e){let r=t.target.value,n=Number.parseInt(r);Number.isNaN(n)||ke(e,n,!0)}function JK(t,e,r){e(null),r.dateChangeCallback(null)}function XK(t,e,r){e((0,Lv.default)()),r.dateChangeCallback(e())}var QK=se('<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 xw(t,e){Se(e,!0);let r=at(e,"selectedDate",23,Lv.default),n=it(0),i=it(0);Yi(()=>{if(r())ke(n,r().month(),!0),ke(i,r().year(),!0);else{let D=(0,Lv.default)();ke(n,D.month(),!0),ke(i,D.year(),!0)}});function a(D){r(D),e.dateChangeCallback(D)}var o=QK(),s=ve(o),l=ve(s);l.__click=[jK,n,i];var u=ue(l,2),c=ve(u),f=ve(c,!0);le(c);var m=ue(c,2);At(m),m.__input=[ZK,i],le(u);var p=ue(u,2);p.__click=[YK,n,i],le(s);var d=ue(s,2);bw(d,{dateChange:a,get month(){return q(n)},get year(){return q(i)},get selectedDate(){return r()}});var h
[${I??""}]`),vt(f,` - ${e.error.effect??""}`),vt(D,e.error.cause),vt(w,e.error.effect)},[()=>e.error.getErrorType()]),K(o,s)},a=o=>{var s=tte(),l=ve(s),u=ve(l),c=ve(u,!0);le(u),le(l),le(s),Le(()=>vt(c,e.error.stack)),K(o,s)};et(n,o=>{e.error instanceof Rn?o(i):o(a,!1)})}K(t,r),Ee()}var rte=se("<p> </p>"),nte=se('<pre class="mb-pre"><code class="language-none meta-bind-none"> </code></pre>'),ite=se("<p> </p>"),ate=se("<h6>Errors</h6> <!> <!>",1),ote=se("<p> </p>"),ste=se("<h6>Warnings</h6> <!> <!>",1),ute=se("<!> <!> <!> <!>",1);function Fs(t,e){Se(e,!0);var r=ute(),n=We(r);{var i=f=>{var m=rte(),p=ve(m,!0);le(m),Le(()=>vt(p,e.settings.text)),K(f,m)};et(n,f=>{e.settings.text&&f(i)})}var a=ue(n,2);{var o=f=>{var m=nte(),p=ve(m),d=ve(p,!0);le(p),le(m),Le(()=>vt(d,e.settings.code)),K(f,m)};et(a,f=>{e.settings.code&&f(o)})}var s=ue(a,2);{var l=f=>{var m=ate(),p=ue(We(m),2);{var d=b=>{var y=ite(),D=ve(y,!0);le(y),Le(()=>vt(D,e.settings.errorText)),K(b,y)};et(p,b=>{e.settings.errorText&&b(d)})}var h=ue(p,2);Ut(h,17,()=>e.settings.errorCollection.getErrors(),Zt,(b,y)=>{Hv(b,{get error(){return q(y)}})}),K(f,m)};et(s,f=>{e.settings.errorCollection.hasErrors()&&f(l)})}var u=ue(s,2);{var c=f=>{var m=ste(),p=ue(We(m),2);{var d=b=>{var y=ote(),D=ve(y,!0);le(y),Le(()=>vt(D,e.settings.warningText)),K(b,y)};et(p,b=>{e.settings.warningText&&b(d)})}var h=ue(p,2);Ut(h,17,()=>e.settings.errorCollection.getWarnings(),Zt,(b,y)=>{Hv(b,{get error(){return q(y)}})}),K(f,m)};et(u,f=>{e.settings.errorCollection.hasWarnings()&&f(c)})}K(t,r),Ee()}var lte=(t,e)=>e(),cte=(t,e)=>{t.key===" "&&e()},fte=se('<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),pte=qm('<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>'),mte=qm('<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>'),dte=se('<div class="mb-error-collection" role="button" tabindex="0" aria-label="Click to view errors and warnings"><!></div>');function Gc(t,e){Se(e,!0);function r(){e.mb.internal.openErrorCollectionViewModal(e.settings)}var n=Gr(),i=We(n);{var a=o=>{var s=dte();s.__click=[lte,r],s.__keydown=[cte,r];var l=ve(s);{var u=f=>{var m=fte();_t(2),K(f,m)},c=(f,m)=>{{var p=h=>{var b=pte();K(h,b)},d=h=>{var b=mte();K(h,b)};et(f,h=>{e.settings.errorCollection.hasWarnings()?h(p):h(d,!1)},m)}};et(l,f=>{e.settings.errorCollection.hasErrors()?f(u):f(c,!1)})}le(s),K(o,s)};et(i,o=>{e.settings.errorCollection.isEmpty()||o(a)})}K(t,n),Ee()}Mt(["click","keydown"]);var Lw=["apng","avif","gif","jpg","jpeg","jfif","pjpeg","pjp","png","svg","webp"],hte=Lw.map(t=>`.${t}`),Gv=class{constructor(e){this.mb=e}openCommandSelectModal(e){this.createSearchModal(new Uv(this.mb,e)).open()}openFileSelectModal(e){this.createSearchModal(new hp(this.mb,e)).open()}openFilteredFileSelectModal(e,r){this.createSearchModal(new hp(this.mb,e,r)).open()}openMarkdownFileSelectModal(e){this.openFilteredFileSelectModal(e,r=>r.endsWith(".md"))}openImageFileSelectModal(e){this.openFilteredFileSelectModal(e,r=>hte.some(n=>r.endsWith(n)))}openFolderSelectModal(e){this.createSearchModal(new qv(this.mb,e)).open()}openButtonBuilderModal(e){this.createModal(new Vv(this.mb,e),{title
2025-01-22 08:00:25 +00:00
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
2025-07-15 10:58:45 +00:00
fields and as fast as obsidian allows it for changes from other sources.</p> <!></div>`);function Hw(t,e){Se(e,!0);let r="INPUT[someInputFieldDeclaration]",n=dt(new er("exampleWarningErrorCollection")),i="INPUT[someInputFieldDeclaration]",a=dt(new er("exampleErrorErrorCollection"));Nb(()=>{n.add(new ef({errorLevel:"WARNING",effect:"some example warning",cause:"some example reason"})),a.add(new ef({errorLevel:"ERROR",effect:"some example error",cause:"some example reason"}))});var o=xte(),s=ve(o);Ns(s,{children:(T,_)=>{var C=bte(),N=ue(We(C),2),I=ve(N);yt(I,{get variant(){return"primary"},onclick:()=>{qt.open(qt.linkToHome())},children:(V,P)=>{_t();var k=Vt("Docs");K(V,k)},$$slots:{default:!0}});var R=ue(I,2);yt(R,{onclick:()=>{qt.open(qt.linkToGithub())},children:(V,P)=>{_t();var k=Vt("GitHub");K(V,k)},$$slots:{default:!0}});var L=ue(R,2);yt(L,{onclick:()=>{qt.open(qt.linkToIssues())},children:(V,P)=>{_t();var k=Vt("Report Issue");K(V,k)},$$slots:{default:!0}}),le(N),K(T,C)},$$slots:{default:!0}});var l=ue(s,6),u=ue(ve(l)),c=ue(u,2),f=ue(c,4);let m=cr(()=>({errorCollection:n,code:r}));Gc(f,{get mb(){return e.mb},get settings(){return q(m)}});var p=ue(f,4);let d=cr(()=>({errorCollection:a,code:i}));Gc(p,{get mb(){return e.mb},get settings(){return q(d)}}),_t(3),le(l);var h=ue(l,10),b=ue(ve(h),2),y=ue(b,2);_t(),le(h);var D=ue(h,6),v=ve(D);_t(),le(D);var A=ue(D,2);Ut(A,17,()=>h4(e.mb),Zt,(T,_)=>{qw(T,{get declaration(){return q(_)[1]},get mb(){return e.mb}})});var w=ue(A,4),x=ve(w);_t(),le(w);var E=ue(w,2);Ut(E,17,()=>Object.values(hw),Zt,(T,_)=>{var C=Gr(),N=We(C);Ut(N,17,()=>q(_),Zt,(I,R)=>{zw(I,{get declaration(){return q(R)},get mb(){return e.mb}})}),K(T,C)}),le(o),Le((T,_,C,N,I,R)=>{rt(u,"href",T),rt(c,"href",_),rt(b,"href",C),rt(y,"href",N),rt(v,"href",I),rt(x,"href",R)},[()=>qt.linkToInputFields(),()=>qt.linkToViewFields(),()=>qt.linkToInputFields(),()=>qt.linkToViewFields(),()=>qt.linkToInputFields(),()=>qt.linkToViewFields()]),K(t,o),Ee()}var cl="mb-playground-view-type",Kv=class extends Z4.ItemView{constructor(e,r){super(e),this.mb=r}getViewType(){return cl}getDisplayText(){return"Meta Bind playground"}async onOpen(){this.contentEl.empty(),this.component=Br(Hw,{target:this.contentEl,props:{mb:this.mb}})}async onClose(){this.component&&Dr(this.component)}};var ri=require("obsidian");var J4=require("obsidian");var bp=require("obsidian");var yp=require("obsidian");var wte=se("<span> </span> <!> <!> <!>",1),_te=se('<div class="mb-card markdown-rendered"><!> <pre class="mb-pre"><code class="mb-none"> </code></pre></div>');function Gw(t,e){Se(e,!0);let r=at(e,"template",15);function n(){e.mb.internal.openButtonBuilderModal({submitText:"Submit",config:ft(r()),onOkay:c=>{r(c)}})}function i(){let c=(0,yp.stringifyYaml)(ft(r()));navigator.clipboard.writeText(c),new yp.Notice("meta-bind | Copied to clipboard")}var a=_te(),o=ve(a);Ns(o,{stretchChildren:!0,children:(c,f)=>{var m=wte(),p=We(m),d=ve(p,!0);le(p);var h=ue(p,2);yt(h,{onclick:()=>n(),get variant(){return"primary"},tooltip:"Edit",children:(D,v)=>{Or(D,{get mb(){return e.mb},iconName:"pen-line"})},$$slots:{default:!0}});var b=ue(h,2);yt(b,{onclick:()=>i(),get variant(){return"default"},tooltip:"Copy",children:(D,v)=>{Or(D,{get mb(){return e.mb},iconName:"copy"})},$$slots:{default:!0}});var y=ue(b,2);yt(y,{onclick:()=>e.onDelete(r()),get variant(){return"destructive"},tooltip:"Delete",children:(D,v)=>{Or(D,{get mb(){return e.mb},iconName:"x"})},$$slots:{default:!0}}),Le(()=>vt(d,r().id)),K(c,m)},$$slots:{default:!0}});var s=ue(o,2),l=ve(s),u=ve(l,!0);le(l),le(s),le(a),Le(c=>vt(u,c),[()=>(0,yp.stringifyYaml)(r())]),K(t,a),Ee()}var Ate=se('<div><h3 class="mod-error">Some Templates Failed to Parse</h3> <!></div>'),Dte=se("<!> <!>",1),Ste=se("<div><h2>Meta Bind Button Templates</h2> <!> <!> <!> <!> <!></div>");function Ww(t,e){Se(e,!0);let r=it(void 0),n=it(dt(e.buttonConfigs));function i(b){ke(n,q(n).filter(y=>y!==b),!0)}function a(){q(n).push(e.modal.mb.buttonActionRunner.createDefaultButtonConfig())}async function o(){let b;try{b=(0,bp.parseYaml)(await navigator.clip
OR `,issueSeparator:" AND ",prefix:null});console.warn(new es({errorLevel:"ERROR",effect:"can not parse button config",cause:"zod validation failed. Check your button syntax",positionContext:D.message,docs:[qt.linkToButtonConfig()]})),console.warn(D),new bp.Notice("meta-bind | Can not parse button config. Check your button syntax. See the console for more details.");return}q(n).push(b)}function s(){ke(r,e.modal.save(ft(q(n))),!0),q(r)===void 0&&e.modal.close()}function l(){e.modal.close()}var u=Ste(),c=ue(ve(u),2);Ut(c,17,()=>q(n),Zt,(b,y,D)=>{Gw(b,{get mb(){return e.modal.mb},onDelete:i,get template(){return q(n)[D]},set template(v){q(n)[D]=v}})});var f=ue(c,2);yt(f,{onclick:()=>a(),get variant(){return"primary"},tooltip:"Create new template",children:(b,y)=>{_t();var D=Vt("Add Template");K(b,D)},$$slots:{default:!0}});var m=ue(f,2);yt(m,{onclick:()=>o(),get variant(){return"default"},tooltip:"Create new template from YAML in clipboard",children:(b,y)=>{_t();var D=Vt("Add Template from Clipboard");K(b,D)},$$slots:{default:!0}});var p=ue(m,2);{var d=b=>{var y=Ate(),D=ue(ve(y),2);let v=cr(()=>({errorCollection:q(r)}));Fs(D,{get settings(){return q(v)}}),le(y),K(b,y)};et(p,b=>{q(r)&&b(d)})}var h=ue(p,2);Ma(h,{children:(b,y)=>{var D=Dte(),v=We(D);yt(v,{onclick:()=>s(),get variant(){return"primary"},tooltip:"Save changes",children:(w,x)=>{_t();var E=Vt("Save");K(w,E)},$$slots:{default:!0}});var A=ue(v,2);yt(A,{onclick:()=>l(),tooltip:"Revert changes",children:(w,x)=>{_t();var E=Vt("Cancel");K(w,E)},$$slots:{default:!0}}),K(b,D)},$$slots:{default:!0}}),le(u),K(t,u),Ee()}var ey=class extends J4.Modal{constructor(e,r){super(e),this.mb=r}onOpen(){this.contentEl.empty(),this.component&&Dr(this.component),this.component=Br(Ww,{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(n=>{n.buttonTemplates=e})}};var X4=require("obsidian");var Ete=se('<tr><td class="mb-excluded-folders-table-input-cell"><input type="text" placeholder="path/to/folder"></td><td><!></td></tr>'),Tte=se('<div><h3 class="mod-error">Some folder paths are invalid</h3> <!></div>'),Mte=se("<!> <!>",1),Cte=se('<div><table class="mb-excluded-folders-table"><thead><tr><th>Folder Path</th><th></th></tr></thead><tbody></tbody></table> <!> <!> <!></div>');function Yw(t,e){Se(e,!0);let r=it(void 0),n=it(dt(e.excludedFolders));function i(h){ke(n,q(n).filter(b=>b!==h),!0)}function a(){q(n).push("")}function o(){ke(r,e.modal.save(ft(q(n))),!0),q(r)===void 0&&e.modal.close()}function s(){e.modal.close()}var l=Cte(),u=ve(l),c=ue(ve(u));Ut(c,21,()=>q(n),Zt,(h,b,y)=>{var D=Ete(),v=ve(D),A=ve(v);At(A),le(v);var w=ue(v),x=ve(w);yt(x,{onclick:()=>i(q(b)),tooltip:"Delete",children:(E,T)=>{Or(E,{get mb(){return e.mb},iconName:"x"})},$$slots:{default:!0}}),le(w),le(D),xt(A,()=>q(n)[y],E=>q(n)[y]=E),K(h,D)}),le(c),le(u);var f=ue(u,2);yt(f,{onclick:()=>a(),get variant(){return"primary"},tooltip:"Add new excluded folder",children:(h,b)=>{_t();var y=Vt("Add folder");K(h,y)},$$slots:{default:!0}});var m=ue(f,2);{var p=h=>{var b=Tte(),y=ue(ve(b),2);let D=cr(()=>({errorCollection:q(r)}));Fs(y,{get settings(){return q(D)}}),le(b),K(h,b)};et(m,h=>{q(r)&&h(p)})}var d=ue(m,2);Ma(d,{children:(h,b)=>{var y=Mte(),D=We(y);yt(D,{onclick:()=>o(),get variant(){return"primary"},tooltip:"Save changes",children:(A,w)=>{_t();var x=Vt("Save");K(A,x)},$$slots:{default:!0}});var v=ue(D,2);yt(v,{onclick:()=>s(),tooltip:"Revert changes",children:(A,w)=>{_t();var x=Vt("Cancel");K(A,x)},$$slots:{default:!0}}),K(h,y)},$$slots:{default:!0}}),le(l),K(t,l),Ee()}var ty=class extends X4.Modal{constructor(e,r){super(e),this.mb=r}onOpen(){this.contentEl.empty(),this.component&&Dr(this.component),this.component=Br(Yw,{target:this.contentEl,props:{excludedFolders:structuredClone(this.mb.getSettings().excludedFolders),modal:this,mb:this.mb}})}onClose(){this.contentEl.empty(),this.component&&D
${(0,zo.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.2)"),e.addClass("mb-error"),this.plugin.register(()=>e.remove())}}async activateView(e){let{workspace:r}=this.app,n,i=r.getLeavesOfType(e);i.length>0?n=i[0]:(n=r.getLeaf("tab"),await n.setViewState({type:e,active:!0})),await r.revealLeaf(n)}getSettings(){return this.plugin.settings}saveSettings(e){this.plugin.settings=e,this.plugin.saveSettings()}},ay=class extends zo.Plugin{async onload(){console.log("meta-bind | Main >> loading"),console.time("meta-bind | Main >> load-time"),await this.loadSettings(),this.mb=new iy(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({},zf,e),rs(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)}};
2025-01-22 08:00:25 +00:00
/*! 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:
(*!
2025-07-15 10:58:45 +00:00
* decimal.js v10.5.0
2025-01-22 08:00:25 +00:00
* An arbitrary-precision Decimal type for JavaScript.
* https://github.com/MikeMcl/decimal.js
2025-07-15 10:58:45 +00:00
* Copyright (c) 2025 Michael Mclaughlin <M8ch88l@gmail.com>
2025-01-22 08:00:25 +00:00
* MIT Licence
*)
*/
/* nosourcemap */