diff --git a/.obsidian/graph.json b/.obsidian/graph.json index 139af63..0ab7405 100644 --- a/.obsidian/graph.json +++ b/.obsidian/graph.json @@ -25,6 +25,6 @@ "repelStrength": 10, "linkStrength": 1, "linkDistance": 250, - "scale": 0.18454855383603405, + "scale": 0.25873391628743153, "close": false } \ No newline at end of file diff --git a/.obsidian/plugins/digitalgarden/main.js b/.obsidian/plugins/digitalgarden/main.js index 165b814..7983fb0 100644 --- a/.obsidian/plugins/digitalgarden/main.js +++ b/.obsidian/plugins/digitalgarden/main.js @@ -14,10 +14,6 @@ var __getOwnPropSymbols = Object.getOwnPropertySymbols; var __getProtoOf = Object.getPrototypeOf; var __hasOwnProp = Object.prototype.hasOwnProperty; var __propIsEnum = Object.prototype.propertyIsEnumerable; -var __knownSymbol = (name, symbol) => (symbol = Symbol[name]) ? symbol : Symbol.for("Symbol." + name); -var __typeError = (msg) => { - throw TypeError(msg); -}; var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value; var __spreadValues = (a, b) => { for (var prop in b || (b = {})) @@ -70,7 +66,10 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge mod )); var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod); -var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value); +var __publicField = (obj, key, value) => { + __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value); + return value; +}; var __async = (__this, __arguments, generator) => { return new Promise((resolve, reject) => { var fulfilled = (value) => { @@ -91,50 +90,6 @@ var __async = (__this, __arguments, generator) => { step((generator = generator.apply(__this, __arguments)).next()); }); }; -var __await = function(promise, isYieldStar) { - this[0] = promise; - this[1] = isYieldStar; -}; -var __asyncGenerator = (__this, __arguments, generator) => { - var resume = (k, v, yes, no) => { - try { - var x = generator[k](v), isAwait = (v = x.value) instanceof __await, done = x.done; - Promise.resolve(isAwait ? v[0] : v).then((y) => isAwait ? resume(k === "return" ? k : "next", v[1] ? { done: y.done, value: y.value } : y, yes, no) : yes({ value: y, done })).catch((e) => resume("throw", e, yes, no)); - } catch (e) { - no(e); - } - }, method = (k) => it[k] = (x) => new Promise((yes, no) => resume(k, x, yes, no)), it = {}; - return generator = generator.apply(__this, __arguments), it[__knownSymbol("asyncIterator")] = () => it, method("next"), method("throw"), method("return"), it; -}; -var __yieldStar = (value) => { - var obj = value[__knownSymbol("asyncIterator")], isAwait = false, method, it = {}; - if (obj == null) { - obj = value[__knownSymbol("iterator")](); - method = (k) => it[k] = (x) => obj[k](x); - } else { - obj = obj.call(value); - method = (k) => it[k] = (v) => { - if (isAwait) { - isAwait = false; - if (k === "throw") throw v; - return v; - } - isAwait = true; - return { - done: false, - value: new __await(new Promise((resolve) => { - var x = obj[k](v); - if (!(x instanceof Object)) __typeError("Object expected"); - resolve(x); - }), 1) - }; - }; - } - return it[__knownSymbol("iterator")] = () => it, method("next"), "throw" in obj ? method("throw") : it.throw = (x) => { - throw x; - }, "return" in obj && method("return"), it; -}; -var __forAwait = (obj, it, method) => (it = obj[__knownSymbol("asyncIterator")]) ? it.call(obj) : (obj = obj[__knownSymbol("iterator")](), it = {}, method = (key, fn2) => (fn2 = obj[key]) && (it[key] = (arg) => new Promise((yes, no, done) => (arg = fn2.call(obj, arg), done = arg.done, Promise.resolve(arg.value).then((value) => yes({ value, done }), no)))), method("next"), method("return"), it); // node_modules/escape-string-regexp/index.js var require_escape_string_regexp = __commonJS({ @@ -1309,16 +1264,16 @@ var require_slugify = __commonJS({ // node_modules/crypto-js/core.js var require_core = __commonJS({ "node_modules/crypto-js/core.js"(exports, module2) { - (function(root, factory2) { + (function(root, factory) { if (typeof exports === "object") { - module2.exports = exports = factory2(); + module2.exports = exports = factory(); } else if (typeof define === "function" && define.amd) { - define([], factory2); + define([], factory); } else { - root.CryptoJS = factory2(); + root.CryptoJS = factory(); } })(exports, function() { - var CryptoJS = CryptoJS || (function(Math2, undefined2) { + var CryptoJS = CryptoJS || function(Math2, undefined2) { var crypto2; if (typeof window !== "undefined" && window.crypto) { crypto2 = window.crypto; @@ -1358,7 +1313,7 @@ var require_core = __commonJS({ } throw new Error("Native crypto module could not be used to get secure random number."); }; - var create = Object.create || /* @__PURE__ */ (function() { + var create = Object.create || function() { function F() { } return function(obj) { @@ -1368,10 +1323,10 @@ var require_core = __commonJS({ F.prototype = null; return subtype; }; - })(); + }(); var C = {}; var C_lib = C.lib = {}; - var Base = C_lib.Base = /* @__PURE__ */ (function() { + var Base = C_lib.Base = function() { return { /** * Creates a new object that inherits from this object. @@ -1470,7 +1425,7 @@ var require_core = __commonJS({ return this.init.prototype.extend(this); } }; - })(); + }(); var WordArray = C_lib.WordArray = Base.extend({ /** * Initializes a newly created word array. @@ -1908,7 +1863,7 @@ var require_core = __commonJS({ }); var C_algo = C.algo = {}; return C; - })(Math); + }(Math); return CryptoJS; }); } @@ -1917,13 +1872,13 @@ var require_core = __commonJS({ // node_modules/crypto-js/sha1.js var require_sha1 = __commonJS({ "node_modules/crypto-js/sha1.js"(exports, module2) { - (function(root, factory2) { + (function(root, factory) { if (typeof exports === "object") { - module2.exports = exports = factory2(require_core()); + module2.exports = exports = factory(require_core()); } else if (typeof define === "function" && define.amd) { - define(["./core"], factory2); + define(["./core"], factory); } else { - factory2(root.CryptoJS); + factory(root.CryptoJS); } })(exports, function(CryptoJS) { (function() { @@ -2008,13 +1963,13 @@ var require_sha1 = __commonJS({ // node_modules/crypto-js/enc-latin1.js var require_enc_latin1 = __commonJS({ "node_modules/crypto-js/enc-latin1.js"(exports, module2) { - (function(root, factory2) { + (function(root, factory) { if (typeof exports === "object") { - module2.exports = exports = factory2(require_core()); + module2.exports = exports = factory(require_core()); } else if (typeof define === "function" && define.amd) { - define(["./core"], factory2); + define(["./core"], factory); } else { - factory2(root.CryptoJS); + factory(root.CryptoJS); } })(exports, function(CryptoJS) { return CryptoJS.enc.Latin1; @@ -2360,7 +2315,8 @@ var require_wrappy = __commonJS({ "node_modules/wrappy/wrappy.js"(exports, module2) { module2.exports = wrappy; function wrappy(fn2, cb) { - if (fn2 && cb) return wrappy(fn2)(cb); + if (fn2 && cb) + return wrappy(fn2)(cb); if (typeof fn2 !== "function") throw new TypeError("need wrapper function"); Object.keys(fn2).forEach(function(k) { @@ -2407,7 +2363,8 @@ var require_once = __commonJS({ }); function once2(fn2) { var f = function() { - if (f.called) return f.value; + if (f.called) + return f.value; f.called = true; return f.value = fn2.apply(this, arguments); }; @@ -2432,7 +2389,7 @@ var require_once = __commonJS({ // node_modules/lz-string/libs/lz-string.js var require_lz_string = __commonJS({ "node_modules/lz-string/libs/lz-string.js"(exports, module2) { - var LZString2 = (function() { + var LZString2 = function() { var f = String.fromCharCode; var keyStrBase64 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="; var keyStrUriSafe = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+-$"; @@ -2448,14 +2405,13 @@ var require_lz_string = __commonJS({ } var LZString3 = { compressToBase64: function(input) { - if (input == null) return ""; + if (input == null) + return ""; var res = LZString3._compress(input, 6, function(a) { return keyStrBase64.charAt(a); }); switch (res.length % 4) { - // To produce valid Base64 default: - // When could this happen ? case 0: return res; case 1: @@ -2467,21 +2423,26 @@ var require_lz_string = __commonJS({ } }, decompressFromBase64: function(input) { - if (input == null) return ""; - if (input == "") return null; + if (input == null) + return ""; + if (input == "") + return null; return LZString3._decompress(input.length, 32, function(index) { return getBaseValue(keyStrBase64, input.charAt(index)); }); }, compressToUTF16: function(input) { - if (input == null) return ""; + if (input == null) + return ""; return LZString3._compress(input, 15, function(a) { return f(a + 32); }) + " "; }, decompressFromUTF16: function(compressed) { - if (compressed == null) return ""; - if (compressed == "") return null; + if (compressed == null) + return ""; + if (compressed == "") + return null; return LZString3._decompress(compressed.length, 16384, function(index) { return compressed.charCodeAt(index) - 32; }); @@ -2515,15 +2476,18 @@ var require_lz_string = __commonJS({ }, //compress into a string that is already URI encoded compressToEncodedURIComponent: function(input) { - if (input == null) return ""; + if (input == null) + return ""; return LZString3._compress(input, 6, function(a) { return keyStrUriSafe.charAt(a); }); }, //decompress from an output of compressToEncodedURIComponent decompressFromEncodedURIComponent: function(input) { - if (input == null) return ""; - if (input == "") return null; + if (input == null) + return ""; + if (input == "") + return null; input = input.replace(/ /g, "+"); return LZString3._decompress(input.length, 32, function(index) { return getBaseValue(keyStrUriSafe, input.charAt(index)); @@ -2535,7 +2499,8 @@ var require_lz_string = __commonJS({ }); }, _compress: function(uncompressed, bitsPerChar, getCharFromInt) { - if (uncompressed == null) return ""; + if (uncompressed == null) + return ""; var i, value, context_dictionary = {}, context_dictionaryToCreate = {}, context_c = "", context_wc = "", context_w = "", context_enlargeIn = 2, context_dictSize = 3, context_numBits = 2, context_data = [], context_data_val = 0, context_data_position = 0, ii; for (ii = 0; ii < uncompressed.length; ii += 1) { context_c = uncompressed.charAt(ii); @@ -2720,13 +2685,16 @@ var require_lz_string = __commonJS({ if (context_data_position == bitsPerChar - 1) { context_data.push(getCharFromInt(context_data_val)); break; - } else context_data_position++; + } else + context_data_position++; } return context_data.join(""); }, decompress: function(compressed) { - if (compressed == null) return ""; - if (compressed == "") return null; + if (compressed == null) + return ""; + if (compressed == "") + return null; return LZString3._decompress(compressed.length, 32768, function(index) { return compressed.charCodeAt(index); }); @@ -2870,7 +2838,7 @@ var require_lz_string = __commonJS({ } }; return LZString3; - })(); + }(); if (typeof define === "function" && define.amd) { define(function() { return LZString2; @@ -3317,7 +3285,8 @@ var require_lib = __commonJS({ /** @override **/ offset(ts) { const date = new Date(ts); - if (isNaN(date)) return NaN; + if (isNaN(date)) + return NaN; const dtf = makeDTF2(this.name); let [year, month, day, adOrBc, hour, minute, second] = dtf.formatToParts ? partsOffset2(dtf, date) : hackyOffset2(dtf, date); if (adOrBc === "BC") { @@ -3439,7 +3408,7 @@ var require_lib = __commonJS({ function mapMonths2(f) { const ms = []; for (let i = 1; i <= 12; i++) { - const dt = DateTime2.utc(2009, i, 1); + const dt = DateTime2.utc(2016, i, 1); ms.push(f(dt)); } return ms; @@ -3452,8 +3421,8 @@ var require_lib = __commonJS({ } return ms; } - function listStuff2(loc, length, englishFn, intlFn) { - const mode = loc.listingMode(); + function listStuff2(loc, length, defaultOK, englishFn, intlFn) { + const mode = loc.listingMode(defaultOK); if (mode === "error") { return null; } else if (mode === "en") { @@ -3476,7 +3445,8 @@ var require_lib = __commonJS({ const _a2 = opts, { padTo, floor } = _a2, otherOpts = __objRest(_a2, ["padTo", "floor"]); if (!forceSimple || Object.keys(otherOpts).length > 0) { const intlOpts = __spreadValues({ useGrouping: false }, opts); - if (opts.padTo > 0) intlOpts.minimumIntegerDigits = opts.padTo; + if (opts.padTo > 0) + intlOpts.minimumIntegerDigits = opts.padTo; this.inf = getCachedINF2(intl, intlOpts); } } @@ -3493,11 +3463,8 @@ var require_lib = __commonJS({ var PolyDateFormatter2 = class { constructor(dt, intl, opts) { this.opts = opts; - this.originalZone = void 0; let z = void 0; - if (this.opts.timeZone) { - this.dt = dt; - } else if (dt.zone.type === "fixed") { + if (dt.zone.isUniversal) { const gmtOffset = -1 * (dt.offset / 60); const offsetZ = gmtOffset >= 0 ? `Etc/GMT+${gmtOffset}` : `Etc/GMT${gmtOffset}`; if (dt.offset !== 0 && IANAZone2.create(offsetZ).valid) { @@ -3505,47 +3472,27 @@ var require_lib = __commonJS({ this.dt = dt; } else { z = "UTC"; - this.dt = dt.offset === 0 ? dt : dt.setZone("UTC").plus({ minutes: dt.offset }); - this.originalZone = dt.zone; + if (opts.timeZoneName) { + this.dt = dt; + } else { + this.dt = dt.offset === 0 ? dt : DateTime2.fromMillis(dt.ts + dt.offset * 60 * 1e3); + } } } else if (dt.zone.type === "system") { this.dt = dt; - } else if (dt.zone.type === "iana") { + } else { this.dt = dt; z = dt.zone.name; - } else { - z = "UTC"; - this.dt = dt.setZone("UTC").plus({ minutes: dt.offset }); - this.originalZone = dt.zone; } const intlOpts = __spreadValues({}, this.opts); intlOpts.timeZone = intlOpts.timeZone || z; this.dtf = getCachedDTF2(intl, intlOpts); } format() { - if (this.originalZone) { - return this.formatToParts().map(({ value }) => value).join(""); - } return this.dtf.format(this.dt.toJSDate()); } formatToParts() { - const parts = this.dtf.formatToParts(this.dt.toJSDate()); - if (this.originalZone) { - return parts.map((part) => { - if (part.type === "timeZoneName") { - const offsetName = this.originalZone.offsetName(this.dt.ts, { - locale: this.dt.locale, - format: this.opts.timeZoneName - }); - return __spreadProps(__spreadValues({}, part), { - value: offsetName - }); - } else { - return part; - } - }); - } - return parts; + return this.dtf.formatToParts(this.dt.toJSDate()); } resolvedOptions() { return this.dtf.resolvedOptions(); @@ -3635,8 +3582,8 @@ var require_lib = __commonJS({ redefaultToSystem(alts = {}) { return this.clone(__spreadProps(__spreadValues({}, alts), { defaultToEN: false })); } - months(length, format = false) { - return listStuff2(this, length, months2, () => { + months(length, format = false, defaultOK = true) { + return listStuff2(this, length, defaultOK, months2, () => { const intl = format ? { month: length, day: "numeric" } : { month: length }, formatStr = format ? "format" : "standalone"; if (!this.monthsCache[formatStr][length]) { this.monthsCache[formatStr][length] = mapMonths2((dt) => this.extract(dt, intl, "month")); @@ -3644,8 +3591,8 @@ var require_lib = __commonJS({ return this.monthsCache[formatStr][length]; }); } - weekdays(length, format = false) { - return listStuff2(this, length, weekdays2, () => { + weekdays(length, format = false, defaultOK = true) { + return listStuff2(this, length, defaultOK, weekdays2, () => { const intl = format ? { weekday: length, year: "numeric", month: "long", day: "numeric" } : { weekday: length }, formatStr = format ? "format" : "standalone"; if (!this.weekdaysCache[formatStr][length]) { this.weekdaysCache[formatStr][length] = mapWeekdays2( @@ -3655,10 +3602,11 @@ var require_lib = __commonJS({ return this.weekdaysCache[formatStr][length]; }); } - meridiems() { + meridiems(defaultOK = true) { return listStuff2( this, void 0, + defaultOK, () => meridiems2, () => { if (!this.meridiemCache) { @@ -3671,8 +3619,8 @@ var require_lib = __commonJS({ } ); } - eras(length) { - return listStuff2(this, length, eras2, () => { + eras(length, defaultOK = true) { + return listStuff2(this, length, defaultOK, eras2, () => { const intl = { era: length }; if (!this.eraCache[length]) { this.eraCache[length] = [DateTime2.utc(-40, 1, 1), DateTime2.utc(2017, 1, 1)].map( @@ -3831,13 +3779,17 @@ var require_lib = __commonJS({ return input; } else if (isString3(input)) { const lowered = input.toLowerCase(); - if (lowered === "default") return defaultZone3; - else if (lowered === "local" || lowered === "system") return SystemZone2.instance; - else if (lowered === "utc" || lowered === "gmt") return FixedOffsetZone2.utcInstance; - else return FixedOffsetZone2.parseSpecifier(lowered) || IANAZone2.create(input); + if (lowered === "default") + return defaultZone3; + else if (lowered === "local" || lowered === "system") + return SystemZone2.instance; + else if (lowered === "utc" || lowered === "gmt") + return FixedOffsetZone2.utcInstance; + else + return FixedOffsetZone2.parseSpecifier(lowered) || IANAZone2.create(input); } else if (isNumber3(input)) { return FixedOffsetZone2.instance(input); - } else if (typeof input === "object" && "offset" in input && typeof input.offset === "function") { + } else if (typeof input === "object" && input.offset && typeof input.offset === "number") { return input; } else { return new InvalidZone2(input); @@ -3936,10 +3888,10 @@ var require_lib = __commonJS({ /** * Set the cutoff year after which a string encoding a year as two digits is interpreted to occur in the current century. * @type {number} - * @example Settings.twoDigitCutoffYear = 0 // cut-off year is 0, so all 'yy' are interpreted as current century + * @example Settings.twoDigitCutoffYear = 0 // cut-off year is 0, so all 'yy' are interpretted as current century * @example Settings.twoDigitCutoffYear = 50 // '49' -> 1949; '50' -> 2050 - * @example Settings.twoDigitCutoffYear = 1950 // interpreted as 50 - * @example Settings.twoDigitCutoffYear = 2050 // ALSO interpreted as 50 + * @example Settings.twoDigitCutoffYear = 1950 // interpretted as 50 + * @example Settings.twoDigitCutoffYear = 2050 // ALSO interpretted as 50 */ static set twoDigitCutoffYear(cutoffYear) { twoDigitCutoffYear2 = cutoffYear % 100; @@ -4084,7 +4036,7 @@ var require_lib = __commonJS({ ); if (obj.year < 100 && obj.year >= 0) { d = new Date(d); - d.setUTCFullYear(obj.year, obj.month - 1, obj.day); + d.setUTCFullYear(d.getUTCFullYear() - 1900); } return +d; } @@ -4095,7 +4047,8 @@ var require_lib = __commonJS({ function untruncateYear2(year) { if (year > 99) { return year; - } else return year > Settings2.twoDigitCutoffYear ? 1900 + year : 2e3 + year; + } else + return year > Settings2.twoDigitCutoffYear ? 1900 + year : 2e3 + year; } function parseZoneInfo2(ts, offsetFormat, locale, timeZone = null) { const date = new Date(ts), intlOpts = { @@ -4132,7 +4085,8 @@ var require_lib = __commonJS({ for (const u in obj) { if (hasOwnProperty3(obj, u)) { const v = obj[u]; - if (v === void 0 || v === null) continue; + if (v === void 0 || v === null) + continue; normalized[normalizer(u)] = asNumber2(v); } } @@ -4322,7 +4276,7 @@ var require_lib = __commonJS({ const c = fmt.charAt(i); if (c === "'") { if (currentFull.length > 0) { - splits.push({ literal: bracketed || /^\s+$/.test(currentFull), val: currentFull }); + splits.push({ literal: bracketed, val: currentFull }); } current = null; currentFull = ""; @@ -4333,14 +4287,14 @@ var require_lib = __commonJS({ currentFull += c; } else { if (currentFull.length > 0) { - splits.push({ literal: /^\s+$/.test(currentFull), val: currentFull }); + splits.push({ literal: false, val: currentFull }); } currentFull = c; current = c; } } if (currentFull.length > 0) { - splits.push({ literal: bracketed || /^\s+$/.test(currentFull), val: currentFull }); + splits.push({ literal: bracketed, val: currentFull }); } return splits; } @@ -4359,21 +4313,21 @@ var require_lib = __commonJS({ const df = this.systemLoc.dtFormatter(dt, __spreadValues(__spreadValues({}, this.opts), opts)); return df.format(); } - dtFormatter(dt, opts = {}) { - return this.loc.dtFormatter(dt, __spreadValues(__spreadValues({}, this.opts), opts)); + formatDateTime(dt, opts = {}) { + const df = this.loc.dtFormatter(dt, __spreadValues(__spreadValues({}, this.opts), opts)); + return df.format(); } - formatDateTime(dt, opts) { - return this.dtFormatter(dt, opts).format(); + formatDateTimeParts(dt, opts = {}) { + const df = this.loc.dtFormatter(dt, __spreadValues(__spreadValues({}, this.opts), opts)); + return df.formatToParts(); } - formatDateTimeParts(dt, opts) { - return this.dtFormatter(dt, opts).formatToParts(); - } - formatInterval(interval, opts) { - const df = this.dtFormatter(interval.start, opts); + formatInterval(interval, opts = {}) { + const df = this.loc.dtFormatter(interval.start, __spreadValues(__spreadValues({}, this.opts), opts)); return df.dtf.formatRange(interval.start.toJSDate(), interval.end.toJSDate()); } - resolvedOptions(dt, opts) { - return this.dtFormatter(dt, opts).resolvedOptions(); + resolvedOptions(dt, opts = {}) { + const df = this.loc.dtFormatter(dt, __spreadValues(__spreadValues({}, this.opts), opts)); + return df.resolvedOptions(); } num(n3, p = 0) { if (this.opts.forceSimple) { @@ -4403,29 +4357,23 @@ var require_lib = __commonJS({ } }, era = (length) => knownEnglish ? eraForDateTime2(dt, length) : string({ era: length }, "era"), tokenToString = (token) => { switch (token) { - // ms case "S": return this.num(dt.millisecond); case "u": - // falls through case "SSS": return this.num(dt.millisecond, 3); - // seconds case "s": return this.num(dt.second); case "ss": return this.num(dt.second, 2); - // fractional seconds case "uu": return this.num(Math.floor(dt.millisecond / 10), 2); case "uuu": return this.num(Math.floor(dt.millisecond / 100)); - // minutes case "m": return this.num(dt.minute); case "mm": return this.num(dt.minute, 2); - // hours case "h": return this.num(dt.hour % 12 === 0 ? 12 : dt.hour % 12); case "hh": @@ -4434,7 +4382,6 @@ var require_lib = __commonJS({ return this.num(dt.hour); case "HH": return this.num(dt.hour, 2); - // offset case "Z": return formatOffset3({ format: "narrow", allowZ: this.opts.allowZ }); case "ZZ": @@ -4445,18 +4392,14 @@ var require_lib = __commonJS({ return dt.zone.offsetName(dt.ts, { format: "short", locale: this.loc.locale }); case "ZZZZZ": return dt.zone.offsetName(dt.ts, { format: "long", locale: this.loc.locale }); - // zone case "z": return dt.zoneName; - // meridiems case "a": return meridiem(); - // dates case "d": return useDateTimeFormatter ? string({ day: "numeric" }, "day") : this.num(dt.day); case "dd": return useDateTimeFormatter ? string({ day: "2-digit" }, "day") : this.num(dt.day, 2); - // weekdays - standalone case "c": return this.num(dt.weekday); case "ccc": @@ -4465,7 +4408,6 @@ var require_lib = __commonJS({ return weekday("long", true); case "ccccc": return weekday("narrow", true); - // weekdays - format case "E": return this.num(dt.weekday); case "EEE": @@ -4474,7 +4416,6 @@ var require_lib = __commonJS({ return weekday("long", false); case "EEEEE": return weekday("narrow", false); - // months - standalone case "L": return useDateTimeFormatter ? string({ month: "numeric", day: "numeric" }, "month") : this.num(dt.month); case "LL": @@ -4485,7 +4426,6 @@ var require_lib = __commonJS({ return month("long", true); case "LLLLL": return month("narrow", true); - // months - format case "M": return useDateTimeFormatter ? string({ month: "numeric" }, "month") : this.num(dt.month); case "MM": @@ -4496,7 +4436,6 @@ var require_lib = __commonJS({ return month("long", false); case "MMMMM": return month("narrow", false); - // years case "y": return useDateTimeFormatter ? string({ year: "numeric" }, "year") : this.num(dt.year); case "yy": @@ -4505,7 +4444,6 @@ var require_lib = __commonJS({ return useDateTimeFormatter ? string({ year: "numeric" }, "year") : this.num(dt.year, 4); case "yyyyyy": return useDateTimeFormatter ? string({ year: "numeric" }, "year") : this.num(dt.year, 6); - // eras case "G": return era("short"); case "GG": @@ -4706,7 +4644,8 @@ var require_lib = __commonJS({ hour: parseInteger2(hourStr), minute: parseInteger2(minuteStr) }; - if (secondStr) result.second = parseInteger2(secondStr); + if (secondStr) + result.second = parseInteger2(secondStr); if (weekdayStr) { result.weekday = weekdayStr.length > 3 ? weekdaysLong2.indexOf(weekdayStr) + 1 : weekdaysShort2.indexOf(weekdayStr) + 1; } @@ -4920,38 +4859,19 @@ var require_lib = __commonJS({ }; return new Duration2(conf); } - function durationToMillis2(matrix, vals) { - var _a2; - let sum = (_a2 = vals.milliseconds) != null ? _a2 : 0; - for (const unit of reverseUnits2.slice(1)) { - if (vals[unit]) { - sum += vals[unit] * matrix[unit]["milliseconds"]; - } - } - return sum; + function antiTrunc(n3) { + return n3 < 0 ? Math.floor(n3) : Math.ceil(n3); + } + function convert(matrix, fromMap, fromUnit, toMap, toUnit) { + const conv = matrix[toUnit][fromUnit], raw = fromMap[fromUnit] / conv, sameSign = Math.sign(raw) === Math.sign(toMap[toUnit]), added = !sameSign && toMap[toUnit] !== 0 && Math.abs(raw) <= 1 ? antiTrunc(raw) : Math.trunc(raw); + toMap[toUnit] += added; + fromMap[fromUnit] -= added * conv; } function normalizeValues2(matrix, vals) { - const factor = durationToMillis2(matrix, vals) < 0 ? -1 : 1; - orderedUnits$1.reduceRight((previous, current) => { + reverseUnits2.reduce((previous, current) => { if (!isUndefined3(vals[current])) { if (previous) { - const previousVal = vals[previous] * factor; - const conv = matrix[current][previous]; - const rollUp = Math.floor(previousVal / conv); - vals[current] += rollUp * factor; - vals[previous] -= rollUp * conv * factor; - } - return current; - } else { - return previous; - } - }, null); - orderedUnits$1.reduce((previous, current) => { - if (!isUndefined3(vals[current])) { - if (previous) { - const fraction = vals[previous] % 1; - vals[previous] -= fraction; - vals[current] += fraction * matrix[previous][current]; + convert(matrix, vals, previous, vals, current); } return current; } else { @@ -5140,7 +5060,8 @@ var require_lib = __commonJS({ millisecond: "milliseconds", milliseconds: "milliseconds" }[unit ? unit.toLowerCase() : unit]; - if (!normalized) throw new InvalidUnitError2(unit); + if (!normalized) + throw new InvalidUnitError2(unit); return normalized; } /** @@ -5208,7 +5129,6 @@ var require_lib = __commonJS({ * ``` */ toHuman(opts = {}) { - if (!this.isValid) return INVALID$2; const l3 = orderedUnits$1.map((unit) => { const val = this.values[unit]; if (isUndefined3(val)) { @@ -5224,7 +5144,8 @@ var require_lib = __commonJS({ * @return {Object} */ toObject() { - if (!this.isValid) return {}; + if (!this.isValid) + return {}; return __spreadValues({}, this.values); } /** @@ -5238,19 +5159,27 @@ var require_lib = __commonJS({ * @return {string} */ toISO() { - if (!this.isValid) return null; + if (!this.isValid) + return null; let s3 = "P"; - if (this.years !== 0) s3 += this.years + "Y"; - if (this.months !== 0 || this.quarters !== 0) s3 += this.months + this.quarters * 3 + "M"; - if (this.weeks !== 0) s3 += this.weeks + "W"; - if (this.days !== 0) s3 += this.days + "D"; + if (this.years !== 0) + s3 += this.years + "Y"; + if (this.months !== 0 || this.quarters !== 0) + s3 += this.months + this.quarters * 3 + "M"; + if (this.weeks !== 0) + s3 += this.weeks + "W"; + if (this.days !== 0) + s3 += this.days + "D"; if (this.hours !== 0 || this.minutes !== 0 || this.seconds !== 0 || this.milliseconds !== 0) s3 += "T"; - if (this.hours !== 0) s3 += this.hours + "H"; - if (this.minutes !== 0) s3 += this.minutes + "M"; + if (this.hours !== 0) + s3 += this.hours + "H"; + if (this.minutes !== 0) + s3 += this.minutes + "M"; if (this.seconds !== 0 || this.milliseconds !== 0) s3 += roundTo2(this.seconds + this.milliseconds / 1e3, 3) + "S"; - if (s3 === "P") s3 += "T0S"; + if (s3 === "P") + s3 += "T0S"; return s3; } /** @@ -5270,19 +5199,30 @@ var require_lib = __commonJS({ * @return {string} */ toISOTime(opts = {}) { - if (!this.isValid) return null; + if (!this.isValid) + return null; const millis = this.toMillis(); - if (millis < 0 || millis >= 864e5) return null; - opts = __spreadProps(__spreadValues({ + if (millis < 0 || millis >= 864e5) + return null; + opts = __spreadValues({ suppressMilliseconds: false, suppressSeconds: false, includePrefix: false, format: "extended" - }, opts), { - includeOffset: false - }); - const dateTime = DateTime2.fromMillis(millis, { zone: "UTC" }); - return dateTime.toISOTime(opts); + }, opts); + const value = this.shiftTo("hours", "minutes", "seconds", "milliseconds"); + let fmt = opts.format === "basic" ? "hhmm" : "hh:mm"; + if (!opts.suppressSeconds || value.seconds !== 0 || value.milliseconds !== 0) { + fmt += opts.format === "basic" ? "ss" : ":ss"; + if (!opts.suppressMilliseconds || value.milliseconds !== 0) { + fmt += ".SSS"; + } + } + let str = value.toFormat(fmt); + if (opts.includePrefix) { + str = "T" + str; + } + return str; } /** * Returns an ISO 8601 representation of this Duration appropriate for use in JSON. @@ -5303,8 +5243,7 @@ var require_lib = __commonJS({ * @return {number} */ toMillis() { - if (!this.isValid) return NaN; - return durationToMillis2(this.matrix, this.values); + return this.as("milliseconds"); } /** * Returns an milliseconds value of this Duration. Alias of {@link toMillis} @@ -5319,7 +5258,8 @@ var require_lib = __commonJS({ * @return {Duration} */ plus(duration) { - if (!this.isValid) return this; + if (!this.isValid) + return this; const dur = _Duration.fromDurationLike(duration), result = {}; for (const k of orderedUnits$1) { if (hasOwnProperty3(dur.values, k) || hasOwnProperty3(this.values, k)) { @@ -5334,7 +5274,8 @@ var require_lib = __commonJS({ * @return {Duration} */ minus(duration) { - if (!this.isValid) return this; + if (!this.isValid) + return this; const dur = _Duration.fromDurationLike(duration); return this.plus(dur.negate()); } @@ -5346,7 +5287,8 @@ var require_lib = __commonJS({ * @return {Duration} */ mapUnits(fn2) { - if (!this.isValid) return this; + if (!this.isValid) + return this; const result = {}; for (const k of Object.keys(this.values)) { result[k] = asNumber2(fn2(this.values[k], k)); @@ -5372,7 +5314,8 @@ var require_lib = __commonJS({ * @return {Duration} */ set(values) { - if (!this.isValid) return this; + if (!this.isValid) + return this; const mixed = __spreadValues(__spreadValues({}, this.values), normalizeObject2(values, _Duration.normalizeUnit)); return clone$1(this, { values: mixed }); } @@ -5399,21 +5342,13 @@ var require_lib = __commonJS({ } /** * Reduce this Duration to its canonical representation in its current units. - * Assuming the overall value of the Duration is positive, this means: - * - excessive values for lower-order units are converted to higher-order units (if possible, see first and second example) - * - negative lower-order units are converted to higher order units (there must be such a higher order unit, otherwise - * the overall value would be negative, see second example) - * - fractional values for higher-order units are converted to lower-order units (if possible, see fourth example) - * - * If the overall value is negative, the result of this method is equivalent to `this.negate().normalize().negate()`. * @example Duration.fromObject({ years: 2, days: 5000 }).normalize().toObject() //=> { years: 15, days: 255 } - * @example Duration.fromObject({ days: 5000 }).normalize().toObject() //=> { days: 5000 } * @example Duration.fromObject({ hours: 12, minutes: -45 }).normalize().toObject() //=> { hours: 11, minutes: 15 } - * @example Duration.fromObject({ years: 2.5, days: 0, hours: 0 }).normalize().toObject() //=> { years: 2, days: 182, hours: 12 } * @return {Duration} */ normalize() { - if (!this.isValid) return this; + if (!this.isValid) + return this; const vals = this.toObject(); normalizeValues2(this.matrix, vals); return clone$1(this, { values: vals }, true); @@ -5424,7 +5359,8 @@ var require_lib = __commonJS({ * @return {Duration} */ rescale() { - if (!this.isValid) return this; + if (!this.isValid) + return this; const vals = removeZeroes2(this.normalize().shiftToAll().toObject()); return clone$1(this, { values: vals }, true); } @@ -5434,7 +5370,8 @@ var require_lib = __commonJS({ * @return {Duration} */ shiftTo(...units) { - if (!this.isValid) return this; + if (!this.isValid) + return this; if (units.length === 0) { return this; } @@ -5455,6 +5392,11 @@ var require_lib = __commonJS({ const i = Math.trunc(own); built[k] = i; accumulated[k] = (own * 1e3 - i * 1e3) / 1e3; + for (const down in vals) { + if (orderedUnits$1.indexOf(down) > orderedUnits$1.indexOf(k)) { + convert(this.matrix, vals, down, built, k); + } + } } else if (isNumber3(vals[k])) { accumulated[k] = vals[k]; } @@ -5464,8 +5406,7 @@ var require_lib = __commonJS({ built[lastUnit] += key === lastUnit ? accumulated[key] : accumulated[key] / this.matrix[lastUnit][key]; } } - normalizeValues2(this.matrix, built); - return clone$1(this, { values: built }, true); + return clone$1(this, { values: built }, true).normalize(); } /** * Shift this Duration to all available units. @@ -5473,7 +5414,8 @@ var require_lib = __commonJS({ * @return {Duration} */ shiftToAll() { - if (!this.isValid) return this; + if (!this.isValid) + return this; return this.shiftTo( "years", "months", @@ -5491,7 +5433,8 @@ var require_lib = __commonJS({ * @return {Duration} */ negate() { - if (!this.isValid) return this; + if (!this.isValid) + return this; const negated = {}; for (const k of Object.keys(this.values)) { negated[k] = this.values[k] === 0 ? 0 : -this.values[k]; @@ -5597,7 +5540,8 @@ var require_lib = __commonJS({ return false; } function eq(v1, v2) { - if (v1 === void 0 || v1 === 0) return v2 === void 0 || v2 === 0; + if (v1 === void 0 || v1 === 0) + return v2 === void 0 || v2 === 0; return v1 === v2; } for (const u of orderedUnits$1) { @@ -5789,9 +5733,10 @@ var require_lib = __commonJS({ * @return {number} */ count(unit = "milliseconds") { - if (!this.isValid) return NaN; + if (!this.isValid) + return NaN; const start2 = this.start.startOf(unit), end2 = this.end.startOf(unit); - return Math.floor(end2.diff(start2, unit).get(unit)) + (end2.valueOf() !== this.end.valueOf()); + return Math.floor(end2.diff(start2, unit).get(unit)) + 1; } /** * Returns whether this Interval's start and end are both in the same unit of time @@ -5814,7 +5759,8 @@ var require_lib = __commonJS({ * @return {boolean} */ isAfter(dateTime) { - if (!this.isValid) return false; + if (!this.isValid) + return false; return this.s > dateTime; } /** @@ -5823,7 +5769,8 @@ var require_lib = __commonJS({ * @return {boolean} */ isBefore(dateTime) { - if (!this.isValid) return false; + if (!this.isValid) + return false; return this.e <= dateTime; } /** @@ -5832,7 +5779,8 @@ var require_lib = __commonJS({ * @return {boolean} */ contains(dateTime) { - if (!this.isValid) return false; + if (!this.isValid) + return false; return this.s <= dateTime && this.e > dateTime; } /** @@ -5843,7 +5791,8 @@ var require_lib = __commonJS({ * @return {Interval} */ set({ start: start2, end: end2 } = {}) { - if (!this.isValid) return this; + if (!this.isValid) + return this; return _Interval.fromDateTimes(start2 || this.s, end2 || this.e); } /** @@ -5852,7 +5801,8 @@ var require_lib = __commonJS({ * @return {Array} */ splitAt(...dateTimes) { - if (!this.isValid) return []; + if (!this.isValid) + return []; const sorted = dateTimes.map(friendlyDateTime2).filter((d) => this.contains(d)).sort(), results = []; let { s: s3 } = this, i = 0; while (s3 < this.e) { @@ -5891,7 +5841,8 @@ var require_lib = __commonJS({ * @return {Array} */ divideEqually(numberOfParts) { - if (!this.isValid) return []; + if (!this.isValid) + return []; return this.splitBy(this.length() / numberOfParts).slice(0, numberOfParts); } /** @@ -5908,7 +5859,8 @@ var require_lib = __commonJS({ * @return {boolean} */ abutsStart(other) { - if (!this.isValid) return false; + if (!this.isValid) + return false; return +this.e === +other.s; } /** @@ -5917,7 +5869,8 @@ var require_lib = __commonJS({ * @return {boolean} */ abutsEnd(other) { - if (!this.isValid) return false; + if (!this.isValid) + return false; return +other.e === +this.s; } /** @@ -5926,7 +5879,8 @@ var require_lib = __commonJS({ * @return {boolean} */ engulfs(other) { - if (!this.isValid) return false; + if (!this.isValid) + return false; return this.s <= other.s && this.e >= other.e; } /** @@ -5948,7 +5902,8 @@ var require_lib = __commonJS({ * @return {Interval} */ intersection(other) { - if (!this.isValid) return this; + if (!this.isValid) + return this; const s3 = this.s > other.s ? this.s : other.s, e = this.e < other.e ? this.e : other.e; if (s3 >= e) { return null; @@ -5963,7 +5918,8 @@ var require_lib = __commonJS({ * @return {Interval} */ union(other) { - if (!this.isValid) return this; + if (!this.isValid) + return this; const s3 = this.s < other.s ? this.s : other.s, e = this.e > other.e ? this.e : other.e; return _Interval.fromDateTimes(s3, e); } @@ -6028,7 +5984,8 @@ var require_lib = __commonJS({ * @return {string} */ toString() { - if (!this.isValid) return INVALID$1; + if (!this.isValid) + return INVALID$1; return `[${this.s.toISO()} \u2013 ${this.e.toISO()})`; } /** @@ -6059,7 +6016,8 @@ var require_lib = __commonJS({ * @return {string} */ toISO(opts) { - if (!this.isValid) return INVALID$1; + if (!this.isValid) + return INVALID$1; return `${this.s.toISO(opts)}/${this.e.toISO(opts)}`; } /** @@ -6069,7 +6027,8 @@ var require_lib = __commonJS({ * @return {string} */ toISODate() { - if (!this.isValid) return INVALID$1; + if (!this.isValid) + return INVALID$1; return `${this.s.toISODate()}/${this.e.toISODate()}`; } /** @@ -6080,7 +6039,8 @@ var require_lib = __commonJS({ * @return {string} */ toISOTime(opts) { - if (!this.isValid) return INVALID$1; + if (!this.isValid) + return INVALID$1; return `${this.s.toISOTime(opts)}/${this.e.toISOTime(opts)}`; } /** @@ -6095,7 +6055,8 @@ var require_lib = __commonJS({ * @return {string} */ toFormat(dateFormat, { separator = " \u2013 " } = {}) { - if (!this.isValid) return INVALID$1; + if (!this.isValid) + return INVALID$1; return `${this.s.toFormat(dateFormat)}${separator}${this.e.toFormat(dateFormat)}`; } /** @@ -6295,11 +6256,6 @@ var require_lib = __commonJS({ if (highWater > later) { results[unit]--; cursor = earlier.plus(results); - if (cursor > later) { - highWater = cursor; - results[unit]--; - cursor = earlier.plus(results); - } } else { cursor = highWater; } @@ -6436,12 +6392,10 @@ var require_lib = __commonJS({ return literal(t); } switch (t.val) { - // era case "G": - return oneOf2(loc.eras("short"), 0); + return oneOf2(loc.eras("short", false), 0); case "GG": - return oneOf2(loc.eras("long"), 0); - // years + return oneOf2(loc.eras("long", false), 0); case "y": return intUnit2(oneToSix); case "yy": @@ -6452,34 +6406,30 @@ var require_lib = __commonJS({ return intUnit2(fourToSix); case "yyyyyy": return intUnit2(six); - // months case "M": return intUnit2(oneOrTwo); case "MM": return intUnit2(two); case "MMM": - return oneOf2(loc.months("short", true), 1); + return oneOf2(loc.months("short", true, false), 1); case "MMMM": - return oneOf2(loc.months("long", true), 1); + return oneOf2(loc.months("long", true, false), 1); case "L": return intUnit2(oneOrTwo); case "LL": return intUnit2(two); case "LLL": - return oneOf2(loc.months("short", false), 1); + return oneOf2(loc.months("short", false, false), 1); case "LLLL": - return oneOf2(loc.months("long", false), 1); - // dates + return oneOf2(loc.months("long", false, false), 1); case "d": return intUnit2(oneOrTwo); case "dd": return intUnit2(two); - // ordinals case "o": return intUnit2(oneToThree); case "ooo": return intUnit2(three); - // time case "HH": return intUnit2(two); case "H": @@ -6510,45 +6460,34 @@ var require_lib = __commonJS({ return simple2(oneOrTwo); case "uuu": return intUnit2(one); - // meridiem case "a": return oneOf2(loc.meridiems(), 0); - // weekYear (k) case "kkkk": return intUnit2(four); case "kk": return intUnit2(twoToFour, untruncateYear2); - // weekNumber (W) case "W": return intUnit2(oneOrTwo); case "WW": return intUnit2(two); - // weekdays case "E": case "c": return intUnit2(one); case "EEE": - return oneOf2(loc.weekdays("short", false), 1); + return oneOf2(loc.weekdays("short", false, false), 1); case "EEEE": - return oneOf2(loc.weekdays("long", false), 1); + return oneOf2(loc.weekdays("long", false, false), 1); case "ccc": - return oneOf2(loc.weekdays("short", true), 1); + return oneOf2(loc.weekdays("short", true, false), 1); case "cccc": - return oneOf2(loc.weekdays("long", true), 1); - // offset/zone + return oneOf2(loc.weekdays("long", true, false), 1); case "Z": case "ZZ": return offset3(new RegExp(`([+-]${oneOrTwo.source})(?::(${two.source}))?`), 2); case "ZZZ": return offset3(new RegExp(`([+-]${oneOrTwo.source})(${two.source})?`), 2); - // we don't support ZZZZ (PST) or ZZZZZ (Pacific Standard Time) in parsing - // because we don't have any way to figure out what they are case "z": return simple2(/[a-z_+-/]{1,256}?/i); - // this special-case "token" represents a place where a macro-token expanded into a white-space literal - // in this case we accept any non-newline white-space - case " ": - return simple2(/[^\S\n\r]/); default: return literal(t); } @@ -6580,14 +6519,10 @@ var require_lib = __commonJS({ }, dayperiod: "a", dayPeriod: "a", - hour12: { + hour: { numeric: "h", "2-digit": "hh" }, - hour24: { - numeric: "H", - "2-digit": "HH" - }, minute: { numeric: "m", "2-digit": "mm" @@ -6601,31 +6536,16 @@ var require_lib = __commonJS({ short: "ZZZ" } }; - function tokenForPart2(part, formatOpts, resolvedOpts) { + function tokenForPart2(part, formatOpts) { const { type, value } = part; if (type === "literal") { - const isSpace = /^\s+$/.test(value); return { - literal: !isSpace, - val: isSpace ? " " : value + literal: true, + val: value }; } const style = formatOpts[type]; - let actualType = type; - if (type === "hour") { - if (formatOpts.hour12 != null) { - actualType = formatOpts.hour12 ? "hour12" : "hour24"; - } else if (formatOpts.hourCycle != null) { - if (formatOpts.hourCycle === "h11" || formatOpts.hourCycle === "h12") { - actualType = "hour12"; - } else { - actualType = "hour24"; - } - } else { - actualType = resolvedOpts.hour12 ? "hour12" : "hour24"; - } - } - let val = partTypeStyleToTokenVal2[actualType]; + let val = partTypeStyleToTokenVal2[type]; if (typeof val === "object") { val = val[style]; } @@ -6774,10 +6694,8 @@ var require_lib = __commonJS({ return null; } const formatter = Formatter2.create(locale, formatOpts); - const df = formatter.dtFormatter(getDummyDateTime2()); - const parts = df.formatToParts(); - const resolvedOpts = df.resolvedOptions(); - return parts.map((p) => tokenForPart2(p, formatOpts, resolvedOpts)); + const parts = formatter.formatDateTimeParts(getDummyDateTime2()); + return parts.map((p) => tokenForPart2(p, formatOpts)); } var nonLeapLadder2 = [0, 31, 59, 90, 120, 151, 181, 212, 243, 273, 304, 334]; var leapLadder2 = [0, 31, 60, 91, 121, 152, 182, 213, 244, 274, 305, 335]; @@ -6849,7 +6767,8 @@ var require_lib = __commonJS({ return unitOutOfRange2("week", obj.week); } else if (!validWeekday) { return unitOutOfRange2("weekday", obj.weekday); - } else return false; + } else + return false; } function hasInvalidOrdinalData2(obj) { const validYear = isInteger2(obj.year), validOrdinal = integerBetween2(obj.ordinal, 1, daysInYear2(obj.year)); @@ -6857,7 +6776,8 @@ var require_lib = __commonJS({ return unitOutOfRange2("year", obj.year); } else if (!validOrdinal) { return unitOutOfRange2("ordinal", obj.ordinal); - } else return false; + } else + return false; } function hasInvalidGregorianData2(obj) { const validYear = isInteger2(obj.year), validMonth = integerBetween2(obj.month, 1, 12), validDay = integerBetween2(obj.day, 1, daysInMonth2(obj.year, obj.month)); @@ -6867,7 +6787,8 @@ var require_lib = __commonJS({ return unitOutOfRange2("month", obj.month); } else if (!validDay) { return unitOutOfRange2("day", obj.day); - } else return false; + } else + return false; } function hasInvalidTimeData2(obj) { const { hour, minute, second, millisecond } = obj; @@ -6880,7 +6801,8 @@ var require_lib = __commonJS({ return unitOutOfRange2("second", second); } else if (!validMillisecond) { return unitOutOfRange2("millisecond", millisecond); - } else return false; + } else + return false; } var INVALID4 = "Invalid DateTime"; var MAX_DATE2 = 864e13; @@ -6958,7 +6880,7 @@ var require_lib = __commonJS({ } function parseDataToDateTime2(parsed, parsedZone, opts, format, text2, specificOffset) { const { setZone, zone } = opts; - if (parsed && Object.keys(parsed).length !== 0 || parsedZone) { + if (parsed && Object.keys(parsed).length !== 0) { const interpretationZone = parsedZone || zone, inst = DateTime2.fromObject(parsed, __spreadProps(__spreadValues({}, opts), { zone: interpretationZone, specificOffset @@ -6979,7 +6901,8 @@ var require_lib = __commonJS({ function toISODate2(o, extended) { const longFormat = o.c.year > 9999 || o.c.year < 0; let c = ""; - if (longFormat && o.c.year >= 0) c += "+"; + if (longFormat && o.c.year >= 0) + c += "+"; c += padStart2(o.c.year, longFormat ? 6 : 4); if (extended) { c += "-"; @@ -6997,13 +6920,13 @@ var require_lib = __commonJS({ if (extended) { c += ":"; c += padStart2(o.c.minute); - if (o.c.millisecond !== 0 || o.c.second !== 0 || !suppressSeconds) { + if (o.c.second !== 0 || !suppressSeconds) { c += ":"; } } else { c += padStart2(o.c.minute); } - if (o.c.millisecond !== 0 || o.c.second !== 0 || !suppressSeconds) { + if (o.c.second !== 0 || !suppressSeconds) { c += padStart2(o.c.second); if (o.c.millisecond !== 0 || !suppressMilliseconds) { c += "."; @@ -7091,7 +7014,8 @@ var require_lib = __commonJS({ weekyears: "weekYear", ordinal: "ordinal" }[unit.toLowerCase()]; - if (!normalized) throw new InvalidUnitError2(unit); + if (!normalized) + throw new InvalidUnitError2(unit); return normalized; } function quickDT2(obj, opts) { @@ -7123,7 +7047,8 @@ var require_lib = __commonJS({ if (opts.calendary) { if (!end2.hasSame(start2, unit)) { return end2.startOf(unit).diff(start2.startOf(unit), unit).get(unit); - } else return 0; + } else + return 0; } else { return end2.diff(start2, unit).get(unit); } @@ -7514,7 +7439,7 @@ var require_lib = __commonJS({ } /** * Create an invalid DateTime. - * @param {string} reason - simple string of why this DateTime is invalid. Should not contain parameters or anything else data-dependent. + * @param {DateTime} reason - simple string of why this DateTime is invalid. Should not contain parameters or anything else data-dependent * @param {string} [explanation=null] - longer explanation, may include parameters and other useful debugging information * @return {DateTime} */ @@ -7823,36 +7748,6 @@ var require_lib = __commonJS({ return this.offset > this.set({ month: 1, day: 1 }).offset || this.offset > this.set({ month: 5 }).offset; } } - /** - * Get those DateTimes which have the same local time as this DateTime, but a different offset from UTC - * in this DateTime's zone. During DST changes local time can be ambiguous, for example - * `2023-10-29T02:30:00` in `Europe/Berlin` can have offset `+01:00` or `+02:00`. - * This method will return both possible DateTimes if this DateTime's local time is ambiguous. - * @returns {DateTime[]} - */ - getPossibleOffsets() { - if (!this.isValid || this.isOffsetFixed) { - return [this]; - } - const dayMs = 864e5; - const minuteMs = 6e4; - const localTS = objToLocalTS2(this.c); - const oEarlier = this.zone.offset(localTS - dayMs); - const oLater = this.zone.offset(localTS + dayMs); - const o1 = this.zone.offset(localTS - oEarlier * minuteMs); - const o2 = this.zone.offset(localTS - oLater * minuteMs); - if (o1 === o2) { - return [this]; - } - const ts1 = localTS - o1 * minuteMs; - const ts2 = localTS - o2 * minuteMs; - const c1 = tsToObj2(ts1, o1); - const c2 = tsToObj2(ts2, o2); - if (c1.hour === c2.hour && c1.minute === c2.minute && c1.second === c2.second && c1.millisecond === c2.millisecond) { - return [clone3(this, { ts: ts1 }), clone3(this, { ts: ts2 })]; - } - return [this]; - } /** * Returns true if this DateTime is in a leap year, false otherwise * @example DateTime.local(2016).isInLeapYear //=> true @@ -7979,7 +7874,8 @@ var require_lib = __commonJS({ * @return {DateTime} */ set(values) { - if (!this.isValid) return this; + if (!this.isValid) + return this; const normalized = normalizeObject2(values, normalizeUnit2), settingWeekStuff = !isUndefined3(normalized.weekYear) || !isUndefined3(normalized.weekNumber) || !isUndefined3(normalized.weekday), containsOrdinal = !isUndefined3(normalized.ordinal), containsGregorYear = !isUndefined3(normalized.year), containsGregorMD = !isUndefined3(normalized.month) || !isUndefined3(normalized.day), containsGregor = containsGregorYear || containsGregorMD, definiteWeekDef = normalized.weekYear || normalized.weekNumber; if ((containsGregor || containsOrdinal) && definiteWeekDef) { throw new ConflictingSpecificationError2( @@ -8017,7 +7913,8 @@ var require_lib = __commonJS({ * @return {DateTime} */ plus(duration) { - if (!this.isValid) return this; + if (!this.isValid) + return this; const dur = Duration2.fromDurationLike(duration); return clone3(this, adjustTime2(this, dur)); } @@ -8028,7 +7925,8 @@ var require_lib = __commonJS({ @return {DateTime} */ minus(duration) { - if (!this.isValid) return this; + if (!this.isValid) + return this; const dur = Duration2.fromDurationLike(duration).negate(); return clone3(this, adjustTime2(this, dur)); } @@ -8043,26 +7941,22 @@ var require_lib = __commonJS({ * @return {DateTime} */ startOf(unit) { - if (!this.isValid) return this; + if (!this.isValid) + return this; const o = {}, normalizedUnit = Duration2.normalizeUnit(unit); switch (normalizedUnit) { case "years": o.month = 1; - // falls through case "quarters": case "months": o.day = 1; - // falls through case "weeks": case "days": o.hour = 0; - // falls through case "hours": o.minute = 0; - // falls through case "minutes": o.second = 0; - // falls through case "seconds": o.millisecond = 0; break; @@ -8363,7 +8257,8 @@ var require_lib = __commonJS({ * @return {Object} */ toObject(opts = {}) { - if (!this.isValid) return {}; + if (!this.isValid) + return {}; const base = __spreadValues({}, this.c); if (opts.includeConfig) { base.outputCalendar = this.outputCalendar; @@ -8432,7 +8327,8 @@ var require_lib = __commonJS({ * @return {boolean} */ hasSame(otherDateTime, unit) { - if (!this.isValid) return false; + if (!this.isValid) + return false; const inputMs = otherDateTime.valueOf(); const adjustedToZone = this.setZone(otherDateTime.zone, { keepLocalTime: true }); return adjustedToZone.startOf(unit) <= inputMs && inputMs <= adjustedToZone.endOf(unit); @@ -8466,7 +8362,8 @@ var require_lib = __commonJS({ * @example DateTime.now().minus({ hours: 36 }).toRelative({ round: false }) //=> "1.5 days ago" */ toRelative(options = {}) { - if (!this.isValid) return null; + if (!this.isValid) + return null; const base = options.base || _DateTime.fromObject({}, { zone: this.zone }), padding = options.padding ? this < base ? -options.padding : options.padding : 0; let units = ["years", "months", "days", "hours", "minutes", "seconds"]; let unit = options.unit; @@ -8494,7 +8391,8 @@ var require_lib = __commonJS({ * @example DateTime.now().minus({ days: 2 }).toRelativeCalendar() //=> "2 days ago" */ toRelativeCalendar(options = {}) { - if (!this.isValid) return null; + if (!this.isValid) + return null; return diffRelative2(options.base || _DateTime.fromObject({}, { zone: this.zone }), this, __spreadProps(__spreadValues({}, options), { numeric: "auto", units: ["years", "months", "days"], @@ -8742,13 +8640,10 @@ var require_lib = __commonJS({ enableDataviewJs: false, enableInlineDataviewJs: false, prettyRenderInlineFields: true, - prettyRenderInlineFieldsInLivePreview: true, dataviewJsKeyword: "dataviewjs" }); var Success = class _Success { constructor(value) { - __publicField(this, "value"); - __publicField(this, "successful"); this.value = value; this.successful = true; } @@ -8776,8 +8671,6 @@ var require_lib = __commonJS({ }; var Failure = class _Failure { constructor(error) { - __publicField(this, "error"); - __publicField(this, "successful"); this.error = error; this.successful = false; } @@ -8834,15 +8727,15 @@ var require_lib = __commonJS({ })(Result || (Result = {})); var commonjsGlobal = typeof globalThis !== "undefined" ? globalThis : typeof window !== "undefined" ? window : typeof global !== "undefined" ? global : typeof self !== "undefined" ? self : {}; var parsimmon_umd_min = { exports: {} }; - parsimmon_umd_min.exports; (function(module3, exports2) { - !(function(n3, t) { + !function(n3, t) { module3.exports = t(); - })("undefined" != typeof self ? self : commonjsGlobal, function() { - return (function(n3) { + }("undefined" != typeof self ? self : commonjsGlobal, function() { + return function(n3) { var t = {}; function r(e) { - if (t[e]) return t[e].exports; + if (t[e]) + return t[e].exports; var u = t[e] = { i: e, l: false, exports: {} }; return n3[e].call(u.exports, u, u.exports, r), u.l = true, u.exports; } @@ -8860,21 +8753,23 @@ var require_lib = __commonJS({ }, r.o = function(n4, t2) { return Object.prototype.hasOwnProperty.call(n4, t2); }, r.p = "", r(r.s = 0); - })([function(n3, t, r) { + }([function(n3, t, r) { function e(n4) { - if (!(this instanceof e)) return new e(n4); + if (!(this instanceof e)) + return new e(n4); this._ = n4; } var u = e.prototype; function o(n4, t2) { - for (var r2 = 0; r2 < n4; r2++) t2(r2); + for (var r2 = 0; r2 < n4; r2++) + t2(r2); } function i(n4, t2, r2) { - return (function(n5, t3) { + return function(n5, t3) { o(t3.length, function(r3) { n5(t3[r3], r3, t3); }); - })(function(r3, e2, u2) { + }(function(r3, e2, u2) { t2 = n4(t2, r3, e2, u2); }, r2), t2; } @@ -8887,34 +8782,37 @@ var require_lib = __commonJS({ var r2 = { v: 0, buf: t2 }; return o(n4, function() { var n5; - r2 = { v: r2.v << 1 | (n5 = r2.buf, n5[0] >> 7), buf: (function(n6) { + r2 = { v: r2.v << 1 | (n5 = r2.buf, n5[0] >> 7), buf: function(n6) { var t3 = i(function(n7, t4, r3, e2) { return n7.concat(r3 === e2.length - 1 ? Buffer.from([t4, 0]).readUInt16BE(0) : e2.readUInt16BE(r3)); }, [], n6); return Buffer.from(a(function(n7) { return (n7 << 1 & 65535) >> 8; }, t3)); - })(r2.buf) }; + }(r2.buf) }; }), r2; } function c() { return "undefined" != typeof Buffer; } function s3() { - if (!c()) throw new Error("Buffer global does not exist; please use webpack if you need to parse Buffers in the browser."); + if (!c()) + throw new Error("Buffer global does not exist; please use webpack if you need to parse Buffers in the browser."); } function l3(n4) { s3(); var t2 = i(function(n5, t3) { return n5 + t3; }, 0, n4); - if (t2 % 8 != 0) throw new Error("The bits [" + n4.join(", ") + "] add up to " + t2 + " which is not an even number of bytes; the total should be divisible by 8"); + if (t2 % 8 != 0) + throw new Error("The bits [" + n4.join(", ") + "] add up to " + t2 + " which is not an even number of bytes; the total should be divisible by 8"); var r2, u2 = t2 / 8, o2 = (r2 = function(n5) { return n5 > 48; }, i(function(n5, t3) { return n5 || (r2(t3) ? t3 : n5); }, null, n4)); - if (o2) throw new Error(o2 + " bit range requested exceeds 48 bit (6 byte) Number max."); + if (o2) + throw new Error(o2 + " bit range requested exceeds 48 bit (6 byte) Number max."); return new e(function(t3, r3) { var e2 = u2 + r3; return e2 > t3.length ? x(r3, u2.toString() + " bytes") : b(e2, i(function(n5, t4) { @@ -8929,7 +8827,8 @@ var require_lib = __commonJS({ }); } function p(n4, t2) { - if ("number" != typeof (r2 = t2) || Math.floor(r2) !== r2 || t2 < 0 || t2 > 6) throw new Error(n4 + " requires integer length in range [0, 6]."); + if ("number" != typeof (r2 = t2) || Math.floor(r2) !== r2 || t2 < 0 || t2 > 6) + throw new Error(n4 + " requires integer length in range [0, 6]."); var r2; } function d(n4) { @@ -8968,29 +8867,37 @@ var require_lib = __commonJS({ return E(t2) || (t2 = [t2]), { status: false, index: -1, value: null, furthest: n4, expected: t2 }; } function B(n4, t2) { - if (!t2) return n4; - if (n4.furthest > t2.furthest) return n4; - var r2 = n4.furthest === t2.furthest ? (function(n5, t3) { - if ((function() { - if (void 0 !== e._supportsSet) return e._supportsSet; + if (!t2) + return n4; + if (n4.furthest > t2.furthest) + return n4; + var r2 = n4.furthest === t2.furthest ? function(n5, t3) { + if (function() { + if (void 0 !== e._supportsSet) + return e._supportsSet; var n6 = "undefined" != typeof Set; return e._supportsSet = n6, n6; - })() && Array.from) { - for (var r3 = new Set(n5), u2 = 0; u2 < t3.length; u2++) r3.add(t3[u2]); + }() && Array.from) { + for (var r3 = new Set(n5), u2 = 0; u2 < t3.length; u2++) + r3.add(t3[u2]); var o2 = Array.from(r3); return o2.sort(), o2; } - for (var i2 = {}, a2 = 0; a2 < n5.length; a2++) i2[n5[a2]] = true; - for (var f2 = 0; f2 < t3.length; f2++) i2[t3[f2]] = true; + for (var i2 = {}, a2 = 0; a2 < n5.length; a2++) + i2[n5[a2]] = true; + for (var f2 = 0; f2 < t3.length; f2++) + i2[t3[f2]] = true; var c2 = []; - for (var s4 in i2) ({}).hasOwnProperty.call(i2, s4) && c2.push(s4); + for (var s4 in i2) + ({}).hasOwnProperty.call(i2, s4) && c2.push(s4); return c2.sort(), c2; - })(n4.expected, t2.expected) : t2.expected; + }(n4.expected, t2.expected) : t2.expected; return { status: n4.status, index: n4.index, value: n4.value, furthest: t2.furthest, expected: r2 }; } var j = {}; function S(n4, t2) { - if (w(n4)) return { offset: t2, line: -1, column: -1 }; + if (w(n4)) + return { offset: t2, line: -1, column: -1 }; n4 in j || (j[n4] = {}); for (var r2 = j[n4], e2 = 0, u2 = 0, o2 = 0, i2 = t2; i2 >= 0; ) { if (i2 in r2) { @@ -9003,19 +8910,23 @@ var require_lib = __commonJS({ return r2[t2] = { line: a2, lineStart: o2 }, { offset: t2, line: a2 + 1, column: f2 + 1 }; } function _(n4) { - if (!y(n4)) throw new Error("not a parser: " + n4); + if (!y(n4)) + throw new Error("not a parser: " + n4); } function L(n4, t2) { return "string" == typeof n4 ? n4.charAt(t2) : n4[t2]; } function O(n4) { - if ("number" != typeof n4) throw new Error("not a number: " + n4); + if ("number" != typeof n4) + throw new Error("not a number: " + n4); } function k(n4) { - if ("function" != typeof n4) throw new Error("not a function: " + n4); + if ("function" != typeof n4) + throw new Error("not a function: " + n4); } function P(n4) { - if ("string" != typeof n4) throw new Error("not a string: " + n4); + if ("string" != typeof n4) + throw new Error("not a string: " + n4); } var q = 2, A = 3, I = 8, F = 5 * I, M = 4 * I, z = " "; function R(n4, t2) { @@ -9030,21 +8941,24 @@ var require_lib = __commonJS({ } function D(n4, t2) { var r2, e2, u2, o2, f2, c2 = t2.index, s4 = c2.offset, l4 = 1; - if (s4 === n4.length) return "Got the end of the input"; + if (s4 === n4.length) + return "Got the end of the input"; if (w(n4)) { var h2 = s4 - s4 % I, p2 = s4 - h2, d2 = W(h2, F, M + I, n4.length), v2 = a(function(n5) { return a(function(n6) { return U(n6.toString(16), 2, "0"); }, n5); - }, (function(n5, t3) { + }, function(n5, t3) { var r3 = n5.length, e3 = [], u3 = 0; - if (r3 <= t3) return [n5.slice()]; - for (var o3 = 0; o3 < r3; o3++) e3[u3] || e3.push([]), e3[u3].push(n5[o3]), (o3 + 1) % t3 == 0 && u3++; + if (r3 <= t3) + return [n5.slice()]; + for (var o3 = 0; o3 < r3; o3++) + e3[u3] || e3.push([]), e3[u3].push(n5[o3]), (o3 + 1) % t3 == 0 && u3++; return e3; - })(n4.slice(d2.from, d2.to).toJSON().data, I)); - o2 = (function(n5) { + }(n4.slice(d2.from, d2.to).toJSON().data, I)); + o2 = function(n5) { return 0 === n5.from && 1 === n5.to ? { from: n5.from, to: n5.to } : { from: n5.from / I, to: Math.floor(n5.to / I) }; - })(d2), e2 = h2 / I, r2 = 3 * p2, p2 >= 4 && (r2 += 1), l4 = 2, u2 = a(function(n5) { + }(d2), e2 = h2 / I, r2 = 3 * p2, p2 >= 4 && (r2 += 1), l4 = 2, u2 = a(function(n5) { return n5.length <= 4 ? n5.join(" ") : n5.slice(0, 4).join(" ") + " " + n5.slice(4).join(" "); }, v2), (f2 = (8 * (o2.to > 0 ? o2.to - 1 : o2.to)).toString(16).length) < 2 && (f2 = 2); } else { @@ -9065,10 +8979,12 @@ var require_lib = __commonJS({ return void 0 !== n4.flags ? n4.flags : [n4.global ? "g" : "", n4.ignoreCase ? "i" : "", n4.multiline ? "m" : "", n4.unicode ? "u" : "", n4.sticky ? "y" : ""].join(""); } function C() { - for (var n4 = [].slice.call(arguments), t2 = n4.length, r2 = 0; r2 < t2; r2 += 1) _(n4[r2]); + for (var n4 = [].slice.call(arguments), t2 = n4.length, r2 = 0; r2 < t2; r2 += 1) + _(n4[r2]); return e(function(r3, e2) { for (var u2, o2 = new Array(t2), i2 = 0; i2 < t2; i2 += 1) { - if (!(u2 = B(n4[i2]._(r3, e2), u2)).status) return u2; + if (!(u2 = B(n4[i2]._(r3, e2), u2)).status) + return u2; o2[i2] = u2.value, e2 = u2.index; } return B(b(e2, o2), u2); @@ -9076,7 +8992,8 @@ var require_lib = __commonJS({ } function J() { var n4 = [].slice.call(arguments); - if (0 === n4.length) throw new Error("seqMap needs at least one argument"); + if (0 === n4.length) + throw new Error("seqMap needs at least one argument"); var t2 = n4.pop(); return k(t2), C.apply(null, n4).map(function(n5) { return t2.apply(null, n5); @@ -9084,10 +9001,14 @@ var require_lib = __commonJS({ } function T() { var n4 = [].slice.call(arguments), t2 = n4.length; - if (0 === t2) return Y("zero alternates"); - for (var r2 = 0; r2 < t2; r2 += 1) _(n4[r2]); + if (0 === t2) + return Y("zero alternates"); + for (var r2 = 0; r2 < t2; r2 += 1) + _(n4[r2]); return e(function(t3, r3) { - for (var e2, u2 = 0; u2 < n4.length; u2 += 1) if ((e2 = B(n4[u2]._(t3, r3), e2)).status) return e2; + for (var e2, u2 = 0; u2 < n4.length; u2 += 1) + if ((e2 = B(n4[u2]._(t3, r3), e2)).status) + return e2; return e2; }); } @@ -9108,16 +9029,18 @@ var require_lib = __commonJS({ }); } function Q(n4, t2) { - !(function(n5) { - if (!(n5 instanceof RegExp)) throw new Error("not a regexp: " + n5); + !function(n5) { + if (!(n5 instanceof RegExp)) + throw new Error("not a regexp: " + n5); for (var t3 = G(n5), r3 = 0; r3 < t3.length; r3++) { var e2 = t3.charAt(r3); - if ("i" !== e2 && "m" !== e2 && "u" !== e2 && "s" !== e2) throw new Error('unsupported regexp flag "' + e2 + '": ' + n5); + if ("i" !== e2 && "m" !== e2 && "u" !== e2 && "s" !== e2) + throw new Error('unsupported regexp flag "' + e2 + '": ' + n5); } - })(n4), arguments.length >= 2 ? O(t2) : t2 = 0; - var r2 = (function(n5) { + }(n4), arguments.length >= 2 ? O(t2) : t2 = 0; + var r2 = function(n5) { return RegExp("^(?:" + n5.source + ")", G(n5)); - })(n4), u2 = "" + n4; + }(n4), u2 = "" + n4; return e(function(n5, e2) { var o2 = r2.exec(n5.slice(e2)); if (o2) { @@ -9141,12 +9064,15 @@ var require_lib = __commonJS({ }); } function Z(n4) { - if (y(n4)) return e(function(t2, r2) { - var e2 = n4._(t2, r2); - return e2.index = r2, e2.value = "", e2; - }); - if ("string" == typeof n4) return Z(K(n4)); - if (n4 instanceof RegExp) return Z(Q(n4)); + if (y(n4)) + return e(function(t2, r2) { + var e2 = n4._(t2, r2); + return e2.index = r2, e2.value = "", e2; + }); + if ("string" == typeof n4) + return Z(K(n4)); + if (n4 instanceof RegExp) + return Z(Q(n4)); throw new Error("not a string, regexp, or parser: " + n4); } function $(n4) { @@ -9172,12 +9098,14 @@ var require_lib = __commonJS({ return Y("fantasy-land/empty"); } u.parse = function(n4) { - if ("string" != typeof n4 && !w(n4)) throw new Error(".parse must be called with a string or Buffer as its argument"); + if ("string" != typeof n4 && !w(n4)) + throw new Error(".parse must be called with a string or Buffer as its argument"); var t2, r2 = this.skip(an)._(n4, 0); return t2 = r2.status ? { status: true, value: r2.value } : { status: false, index: S(n4, r2.furthest), expected: r2.expected }, delete j[n4], t2; }, u.tryParse = function(n4) { var t2 = this.parse(n4); - if (t2.status) return t2.value; + if (t2.status) + return t2.value; var r2 = N(n4, t2), e2 = new Error(r2); throw e2.type = "ParsimmonError", e2.result = t2, e2; }, u.assert = function(n4, t2) { @@ -9202,18 +9130,22 @@ var require_lib = __commonJS({ var n4 = this; return e(function(t2, r2) { for (var e2 = [], u2 = void 0; ; ) { - if (!(u2 = B(n4._(t2, r2), u2)).status) return B(b(r2, e2), u2); - if (r2 === u2.index) throw new Error("infinite loop detected in .many() parser --- calling .many() on a parser which can accept zero characters is usually the cause"); + if (!(u2 = B(n4._(t2, r2), u2)).status) + return B(b(r2, e2), u2); + if (r2 === u2.index) + throw new Error("infinite loop detected in .many() parser --- calling .many() on a parser which can accept zero characters is usually the cause"); r2 = u2.index, e2.push(u2.value); } }); }, u.tieWith = function(n4) { return P(n4), this.map(function(t2) { - if ((function(n5) { - if (!E(n5)) throw new Error("not an array: " + n5); - })(t2), t2.length) { + if (function(n5) { + if (!E(n5)) + throw new Error("not an array: " + n5); + }(t2), t2.length) { P(t2[0]); - for (var r2 = t2[0], e2 = 1; e2 < t2.length; e2++) P(t2[e2]), r2 += n4 + t2[e2]; + for (var r2 = t2[0], e2 = 1; e2 < t2.length; e2++) + P(t2[e2]), r2 += n4 + t2[e2]; return r2; } return ""; @@ -9224,10 +9156,12 @@ var require_lib = __commonJS({ var r2 = this; return arguments.length < 2 && (t2 = n4), O(n4), O(t2), e(function(e2, u2) { for (var o2 = [], i2 = void 0, a2 = void 0, f2 = 0; f2 < n4; f2 += 1) { - if (a2 = B(i2 = r2._(e2, u2), a2), !i2.status) return a2; + if (a2 = B(i2 = r2._(e2, u2), a2), !i2.status) + return a2; u2 = i2.index, o2.push(i2.value); } - for (; f2 < t2 && (a2 = B(i2 = r2._(e2, u2), a2), i2.status); f2 += 1) u2 = i2.index, o2.push(i2.value); + for (; f2 < t2 && (a2 = B(i2 = r2._(e2, u2), a2), i2.status); f2 += 1) + u2 = i2.index, o2.push(i2.value); return B(b(u2, o2), a2); }); }, u.result = function(n4) { @@ -9307,11 +9241,12 @@ var require_lib = __commonJS({ }), fn2 = Q(/[0-9]/).desc("a digit"), cn = Q(/[0-9]*/).desc("optional digits"), sn = Q(/[a-z]/i).desc("a letter"), ln = Q(/[a-z]*/i).desc("optional letters"), hn = Q(/\s*/).desc("optional whitespace"), pn = Q(/\s+/).desc("whitespace"), dn = K("\r"), vn = K("\n"), gn = K("\r\n"), mn = T(gn, vn, dn).desc("newline"), yn = T(mn, an); e.all = on, e.alt = T, e.any = un, e.cr = dn, e.createLanguage = function(n4) { var t2 = {}; - for (var r2 in n4) ({}).hasOwnProperty.call(n4, r2) && (function(r3) { - t2[r3] = tn(function() { - return n4[r3](t2); - }); - })(r2); + for (var r2 in n4) + ({}).hasOwnProperty.call(n4, r2) && function(r3) { + t2[r3] = tn(function() { + return n4[r3](t2); + }); + }(r2); return t2; }, e.crlf = gn, e.custom = function(n4) { return e(n4(b, x)); @@ -9320,7 +9255,8 @@ var require_lib = __commonJS({ return n4.indexOf(t2) < 0; }).desc("none of '" + n4 + "'"); }, e.notFollowedBy = $, e.of = X, e.oneOf = function(n4) { - for (var t2 = n4.split(""), r2 = 0; r2 < t2.length; r2++) t2[r2] = "'" + t2[r2] + "'"; + for (var t2 = n4.split(""), r2 = 0; r2 < t2.length; r2++) + t2[r2] = "'" + t2[r2] + "'"; return nn(function(t3) { return n4.indexOf(t3) >= 0; }).desc(t2); @@ -9334,25 +9270,29 @@ var require_lib = __commonJS({ if (!y(a2)) { if (E(a2) && 2 === a2.length && "string" == typeof a2[0] && y(a2[1])) { var f2 = a2[0]; - if (Object.prototype.hasOwnProperty.call(t2, f2)) throw new Error("seqObj: duplicate key " + f2); + if (Object.prototype.hasOwnProperty.call(t2, f2)) + throw new Error("seqObj: duplicate key " + f2); t2[f2] = true, r2++; continue; } throw new Error("seqObj arguments must be parsers or [string, parser] array pairs."); } } - if (0 === r2) throw new Error("seqObj expects at least one named parser, found zero"); + if (0 === r2) + throw new Error("seqObj expects at least one named parser, found zero"); return e(function(n5, t3) { for (var r3, e2 = {}, i3 = 0; i3 < o2; i3 += 1) { var a3, f3; - if (E(u2[i3]) ? (a3 = u2[i3][0], f3 = u2[i3][1]) : (a3 = null, f3 = u2[i3]), !(r3 = B(f3._(n5, t3), r3)).status) return r3; + if (E(u2[i3]) ? (a3 = u2[i3][0], f3 = u2[i3][1]) : (a3 = null, f3 = u2[i3]), !(r3 = B(f3._(n5, t3), r3)).status) + return r3; a3 && (e2[a3] = r3.value), t3 = r3.index; } return B(b(t3, e2), r3); }); }, e.string = K, e.succeed = X, e.takeWhile = function(n4) { return k(n4), e(function(t2, r2) { - for (var e2 = r2; e2 < t2.length && n4(L(t2, e2)); ) e2++; + for (var e2 = r2; e2 < t2.length && n4(L(t2, e2)); ) + e2++; return b(e2, t2.slice(r2, e2)); }); }, e.test = nn, e.whitespace = pn, e["fantasy-land/empty"] = rn, e["fantasy-land/of"] = X, e.Binary = { bitSeq: l3, bitSeqObj: function(n4) { @@ -9360,13 +9300,16 @@ var require_lib = __commonJS({ var t2 = {}, r2 = 0, e2 = a(function(n5) { if (E(n5)) { var e3 = n5; - if (2 !== e3.length) throw new Error("[" + e3.join(", ") + "] should be length 2, got length " + e3.length); - if (P(e3[0]), O(e3[1]), Object.prototype.hasOwnProperty.call(t2, e3[0])) throw new Error("duplicate key in bitSeqObj: " + e3[0]); + if (2 !== e3.length) + throw new Error("[" + e3.join(", ") + "] should be length 2, got length " + e3.length); + if (P(e3[0]), O(e3[1]), Object.prototype.hasOwnProperty.call(t2, e3[0])) + throw new Error("duplicate key in bitSeqObj: " + e3[0]); return t2[e3[0]] = true, r2++, e3; } return O(n5), [null, n5]; }, n4); - if (r2 < 1) throw new Error("bitSeqObj expects at least one named pair, got [" + n4.join(", ") + "]"); + if (r2 < 1) + throw new Error("bitSeqObj expects at least one named pair, got [" + n4.join(", ") + "]"); var u2 = a(function(n5) { return n5[0]; }, e2); @@ -9380,7 +9323,8 @@ var require_lib = __commonJS({ }, u2)); }); }, byte: function(n4) { - if (s3(), O(n4), n4 > 255) throw new Error("Value specified to byte constructor (" + n4 + "=0x" + n4.toString(16) + ") is larger in value than a single byte."); + if (s3(), O(n4), n4 > 255) + throw new Error("Value specified to byte constructor (" + n4 + "=0x" + n4.toString(16) + ") is larger in value than a single byte."); var t2 = (n4 > 15 ? "0x" : "0x0") + n4.toString(16); return e(function(r2, e2) { var u2 = L(r2, e2); @@ -9405,10 +9349,9 @@ var require_lib = __commonJS({ }) }, n3.exports = e; }]); }); - })(parsimmon_umd_min, parsimmon_umd_min.exports); - var parsimmon_umd_minExports = parsimmon_umd_min.exports; + })(parsimmon_umd_min); var emojiRegex = () => { - return /[#*0-9]\uFE0F?\u20E3|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26AA\u26B0\u26B1\u26BD\u26BE\u26C4\u26C8\u26CF\u26D1\u26D3\u26E9\u26F0-\u26F5\u26F7\u26F8\u26FA\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2757\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B55\u3030\u303D\u3297\u3299]\uFE0F?|[\u261D\u270C\u270D](?:\uFE0F|\uD83C[\uDFFB-\uDFFF])?|[\u270A\u270B](?:\uD83C[\uDFFB-\uDFFF])?|[\u23E9-\u23EC\u23F0\u23F3\u25FD\u2693\u26A1\u26AB\u26C5\u26CE\u26D4\u26EA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2795-\u2797\u27B0\u27BF\u2B50]|\u26F9(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|\u2764\uFE0F?(?:\u200D(?:\uD83D\uDD25|\uD83E\uDE79))?|\uD83C(?:[\uDC04\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]\uFE0F?|[\uDF85\uDFC2\uDFC7](?:\uD83C[\uDFFB-\uDFFF])?|[\uDFC3\uDFC4\uDFCA](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDFCB\uDFCC](?:\uFE0F|\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uDDE6\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF]|\uDDE7\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF]|\uDDE8\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF]|\uDDE9\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF]|\uDDEA\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA]|\uDDEB\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7]|\uDDEC\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE]|\uDDED\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA]|\uDDEE\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9]|\uDDEF\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5]|\uDDF0\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF]|\uDDF1\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE]|\uDDF2\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF]|\uDDF3\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF]|\uDDF4\uD83C\uDDF2|\uDDF5\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE]|\uDDF6\uD83C\uDDE6|\uDDF7\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC]|\uDDF8\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF]|\uDDF9\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF]|\uDDFA\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF]|\uDDFB\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA]|\uDDFC\uD83C[\uDDEB\uDDF8]|\uDDFD\uD83C\uDDF0|\uDDFE\uD83C[\uDDEA\uDDF9]|\uDDFF\uD83C[\uDDE6\uDDF2\uDDFC]|\uDFF3\uFE0F?(?:\u200D(?:\u26A7\uFE0F?|\uD83C\uDF08))?|\uDFF4(?:\u200D\u2620\uFE0F?|\uDB40\uDC67\uDB40\uDC62\uDB40(?:\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDC73\uDB40\uDC63\uDB40\uDC74|\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F)?)|\uD83D(?:[\uDC08\uDC26](?:\u200D\u2B1B)?|[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3]\uFE0F?|[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC](?:\uD83C[\uDFFB-\uDFFF])?|[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD74\uDD90](?:\uFE0F|\uD83C[\uDFFB-\uDFFF])?|[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC25\uDC27-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEDC-\uDEDF\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB\uDFF0]|\uDC15(?:\u200D\uD83E\uDDBA)?|\uDC3B(?:\u200D\u2744\uFE0F?)?|\uDC41\uFE0F?(?:\u200D\uD83D\uDDE8\uFE0F?)?|\uDC68(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDC68\uDC69]\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE])))?))?|\uDC69(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?[\uDC68\uDC69]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?|\uDC69\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?))|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFE])))?))?|\uDC6F(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDD75(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDE2E(?:\u200D\uD83D\uDCA8)?|\uDE35(?:\u200D\uD83D\uDCAB)?|\uDE36(?:\u200D\uD83C\uDF2B\uFE0F?)?)|\uD83E(?:[\uDD0C\uDD0F\uDD18-\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5\uDEC3-\uDEC5\uDEF0\uDEF2-\uDEF8](?:\uD83C[\uDFFB-\uDFFF])?|[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDDDE\uDDDF](?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD0D\uDD0E\uDD10-\uDD17\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCC\uDDD0\uDDE0-\uDDFF\uDE70-\uDE7C\uDE80-\uDE88\uDE90-\uDEBD\uDEBF-\uDEC2\uDECE-\uDEDB\uDEE0-\uDEE8]|\uDD3C(?:\u200D[\u2640\u2642]\uFE0F?|\uD83C[\uDFFB-\uDFFF])?|\uDDD1(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83E\uDDD1))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?))?|\uDEF1(?:\uD83C(?:\uDFFB(?:\u200D\uD83E\uDEF2\uD83C[\uDFFC-\uDFFF])?|\uDFFC(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFD-\uDFFF])?|\uDFFD(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])?|\uDFFE(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFD\uDFFF])?|\uDFFF(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFE])?))?)/g; + return /(?:[#*0-9]\uFE0F?\u20E3|[\xA9\xAE\u203C\u2049\u2122\u2139\u2194-\u2199\u21A9\u21AA\u231A\u231B\u2328\u23CF\u23ED-\u23EF\u23F1\u23F2\u23F8-\u23FA\u24C2\u25AA\u25AB\u25B6\u25C0\u25FB\u25FC\u25FE\u2600-\u2604\u260E\u2611\u2614\u2615\u2618\u2620\u2622\u2623\u2626\u262A\u262E\u262F\u2638-\u263A\u2640\u2642\u2648-\u2653\u265F\u2660\u2663\u2665\u2666\u2668\u267B\u267E\u267F\u2692\u2694-\u2697\u2699\u269B\u269C\u26A0\u26A7\u26AA\u26B0\u26B1\u26BD\u26BE\u26C4\u26C8\u26CF\u26D1\u26D3\u26E9\u26F0-\u26F5\u26F7\u26F8\u26FA\u2702\u2708\u2709\u270F\u2712\u2714\u2716\u271D\u2721\u2733\u2734\u2744\u2747\u2757\u2763\u27A1\u2934\u2935\u2B05-\u2B07\u2B1B\u2B1C\u2B55\u3030\u303D\u3297\u3299]\uFE0F?|[\u261D\u270C\u270D](?:\uFE0F|\uD83C[\uDFFB-\uDFFF])?|[\u270A\u270B](?:\uD83C[\uDFFB-\uDFFF])?|[\u23E9-\u23EC\u23F0\u23F3\u25FD\u2693\u26A1\u26AB\u26C5\u26CE\u26D4\u26EA\u26FD\u2705\u2728\u274C\u274E\u2753-\u2755\u2795-\u2797\u27B0\u27BF\u2B50]|\u26F9(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|\u2764\uFE0F?(?:\u200D(?:\uD83D\uDD25|\uD83E\uDE79))?|\uD83C(?:[\uDC04\uDD70\uDD71\uDD7E\uDD7F\uDE02\uDE37\uDF21\uDF24-\uDF2C\uDF36\uDF7D\uDF96\uDF97\uDF99-\uDF9B\uDF9E\uDF9F\uDFCD\uDFCE\uDFD4-\uDFDF\uDFF5\uDFF7]\uFE0F?|[\uDF85\uDFC2\uDFC7](?:\uD83C[\uDFFB-\uDFFF])?|[\uDFC3\uDFC4\uDFCA](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDFCB\uDFCC](?:\uFE0F|\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDCCF\uDD8E\uDD91-\uDD9A\uDE01\uDE1A\uDE2F\uDE32-\uDE36\uDE38-\uDE3A\uDE50\uDE51\uDF00-\uDF20\uDF2D-\uDF35\uDF37-\uDF7C\uDF7E-\uDF84\uDF86-\uDF93\uDFA0-\uDFC1\uDFC5\uDFC6\uDFC8\uDFC9\uDFCF-\uDFD3\uDFE0-\uDFF0\uDFF8-\uDFFF]|\uDDE6\uD83C[\uDDE8-\uDDEC\uDDEE\uDDF1\uDDF2\uDDF4\uDDF6-\uDDFA\uDDFC\uDDFD\uDDFF]|\uDDE7\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEF\uDDF1-\uDDF4\uDDF6-\uDDF9\uDDFB\uDDFC\uDDFE\uDDFF]|\uDDE8\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDEE\uDDF0-\uDDF5\uDDF7\uDDFA-\uDDFF]|\uDDE9\uD83C[\uDDEA\uDDEC\uDDEF\uDDF0\uDDF2\uDDF4\uDDFF]|\uDDEA\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDED\uDDF7-\uDDFA]|\uDDEB\uD83C[\uDDEE-\uDDF0\uDDF2\uDDF4\uDDF7]|\uDDEC\uD83C[\uDDE6\uDDE7\uDDE9-\uDDEE\uDDF1-\uDDF3\uDDF5-\uDDFA\uDDFC\uDDFE]|\uDDED\uD83C[\uDDF0\uDDF2\uDDF3\uDDF7\uDDF9\uDDFA]|\uDDEE\uD83C[\uDDE8-\uDDEA\uDDF1-\uDDF4\uDDF6-\uDDF9]|\uDDEF\uD83C[\uDDEA\uDDF2\uDDF4\uDDF5]|\uDDF0\uD83C[\uDDEA\uDDEC-\uDDEE\uDDF2\uDDF3\uDDF5\uDDF7\uDDFC\uDDFE\uDDFF]|\uDDF1\uD83C[\uDDE6-\uDDE8\uDDEE\uDDF0\uDDF7-\uDDFB\uDDFE]|\uDDF2\uD83C[\uDDE6\uDDE8-\uDDED\uDDF0-\uDDFF]|\uDDF3\uD83C[\uDDE6\uDDE8\uDDEA-\uDDEC\uDDEE\uDDF1\uDDF4\uDDF5\uDDF7\uDDFA\uDDFF]|\uDDF4\uD83C\uDDF2|\uDDF5\uD83C[\uDDE6\uDDEA-\uDDED\uDDF0-\uDDF3\uDDF7-\uDDF9\uDDFC\uDDFE]|\uDDF6\uD83C\uDDE6|\uDDF7\uD83C[\uDDEA\uDDF4\uDDF8\uDDFA\uDDFC]|\uDDF8\uD83C[\uDDE6-\uDDEA\uDDEC-\uDDF4\uDDF7-\uDDF9\uDDFB\uDDFD-\uDDFF]|\uDDF9\uD83C[\uDDE6\uDDE8\uDDE9\uDDEB-\uDDED\uDDEF-\uDDF4\uDDF7\uDDF9\uDDFB\uDDFC\uDDFF]|\uDDFA\uD83C[\uDDE6\uDDEC\uDDF2\uDDF3\uDDF8\uDDFE\uDDFF]|\uDDFB\uD83C[\uDDE6\uDDE8\uDDEA\uDDEC\uDDEE\uDDF3\uDDFA]|\uDDFC\uD83C[\uDDEB\uDDF8]|\uDDFD\uD83C\uDDF0|\uDDFE\uD83C[\uDDEA\uDDF9]|\uDDFF\uD83C[\uDDE6\uDDF2\uDDFC]|\uDFF3\uFE0F?(?:\u200D(?:\u26A7\uFE0F?|\uD83C\uDF08))?|\uDFF4(?:\u200D\u2620\uFE0F?|\uDB40\uDC67\uDB40\uDC62\uDB40(?:\uDC65\uDB40\uDC6E\uDB40\uDC67|\uDC73\uDB40\uDC63\uDB40\uDC74|\uDC77\uDB40\uDC6C\uDB40\uDC73)\uDB40\uDC7F)?)|\uD83D(?:[\uDC3F\uDCFD\uDD49\uDD4A\uDD6F\uDD70\uDD73\uDD76-\uDD79\uDD87\uDD8A-\uDD8D\uDDA5\uDDA8\uDDB1\uDDB2\uDDBC\uDDC2-\uDDC4\uDDD1-\uDDD3\uDDDC-\uDDDE\uDDE1\uDDE3\uDDE8\uDDEF\uDDF3\uDDFA\uDECB\uDECD-\uDECF\uDEE0-\uDEE5\uDEE9\uDEF0\uDEF3]\uFE0F?|[\uDC42\uDC43\uDC46-\uDC50\uDC66\uDC67\uDC6B-\uDC6D\uDC72\uDC74-\uDC76\uDC78\uDC7C\uDC83\uDC85\uDC8F\uDC91\uDCAA\uDD7A\uDD95\uDD96\uDE4C\uDE4F\uDEC0\uDECC](?:\uD83C[\uDFFB-\uDFFF])?|[\uDC6E\uDC70\uDC71\uDC73\uDC77\uDC81\uDC82\uDC86\uDC87\uDE45-\uDE47\uDE4B\uDE4D\uDE4E\uDEA3\uDEB4-\uDEB6](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD74\uDD90](?:\uFE0F|\uD83C[\uDFFB-\uDFFF])?|[\uDC00-\uDC07\uDC09-\uDC14\uDC16-\uDC3A\uDC3C-\uDC3E\uDC40\uDC44\uDC45\uDC51-\uDC65\uDC6A\uDC79-\uDC7B\uDC7D-\uDC80\uDC84\uDC88-\uDC8E\uDC90\uDC92-\uDCA9\uDCAB-\uDCFC\uDCFF-\uDD3D\uDD4B-\uDD4E\uDD50-\uDD67\uDDA4\uDDFB-\uDE2D\uDE2F-\uDE34\uDE37-\uDE44\uDE48-\uDE4A\uDE80-\uDEA2\uDEA4-\uDEB3\uDEB7-\uDEBF\uDEC1-\uDEC5\uDED0-\uDED2\uDED5-\uDED7\uDEDD-\uDEDF\uDEEB\uDEEC\uDEF4-\uDEFC\uDFE0-\uDFEB\uDFF0]|\uDC08(?:\u200D\u2B1B)?|\uDC15(?:\u200D\uD83E\uDDBA)?|\uDC3B(?:\u200D\u2744\uFE0F?)?|\uDC41\uFE0F?(?:\u200D\uD83D\uDDE8\uFE0F?)?|\uDC68(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDC68\uDC69]\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?)|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?\uDC68\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D\uDC68\uD83C[\uDFFB-\uDFFE])))?))?|\uDC69(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:\uDC8B\u200D\uD83D)?[\uDC68\uDC69]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D(?:[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?|\uDC69\u200D\uD83D(?:\uDC66(?:\u200D\uD83D\uDC66)?|\uDC67(?:\u200D\uD83D[\uDC66\uDC67])?))|\uD83E[\uDDAF-\uDDB3\uDDBC\uDDBD])|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFC-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFD-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFD\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D\uD83D(?:[\uDC68\uDC69]|\uDC8B\u200D\uD83D[\uDC68\uDC69])\uD83C[\uDFFB-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83D[\uDC68\uDC69]\uD83C[\uDFFB-\uDFFE])))?))?|\uDC6F(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDD75(?:\uFE0F|\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|\uDE2E(?:\u200D\uD83D\uDCA8)?|\uDE35(?:\u200D\uD83D\uDCAB)?|\uDE36(?:\u200D\uD83C\uDF2B\uFE0F?)?)|\uD83E(?:[\uDD0C\uDD0F\uDD18-\uDD1F\uDD30-\uDD34\uDD36\uDD77\uDDB5\uDDB6\uDDBB\uDDD2\uDDD3\uDDD5\uDEC3-\uDEC5\uDEF0\uDEF2-\uDEF6](?:\uD83C[\uDFFB-\uDFFF])?|[\uDD26\uDD35\uDD37-\uDD39\uDD3D\uDD3E\uDDB8\uDDB9\uDDCD-\uDDCF\uDDD4\uDDD6-\uDDDD](?:\uD83C[\uDFFB-\uDFFF])?(?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDDDE\uDDDF](?:\u200D[\u2640\u2642]\uFE0F?)?|[\uDD0D\uDD0E\uDD10-\uDD17\uDD20-\uDD25\uDD27-\uDD2F\uDD3A\uDD3F-\uDD45\uDD47-\uDD76\uDD78-\uDDB4\uDDB7\uDDBA\uDDBC-\uDDCC\uDDD0\uDDE0-\uDDFF\uDE70-\uDE74\uDE78-\uDE7C\uDE80-\uDE86\uDE90-\uDEAC\uDEB0-\uDEBA\uDEC0-\uDEC2\uDED0-\uDED9\uDEE0-\uDEE7]|\uDD3C(?:\u200D[\u2640\u2642]\uFE0F?|\uD83C[\uDFFB-\uDFFF])?|\uDDD1(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83E\uDDD1))|\uD83C(?:\uDFFB(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFC-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFC(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFD-\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFD(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFE(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFD\uDFFF]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?|\uDFFF(?:\u200D(?:[\u2695\u2696\u2708]\uFE0F?|\u2764\uFE0F?\u200D(?:\uD83D\uDC8B\u200D)?\uD83E\uDDD1\uD83C[\uDFFB-\uDFFE]|\uD83C[\uDF3E\uDF73\uDF7C\uDF84\uDF93\uDFA4\uDFA8\uDFEB\uDFED]|\uD83D[\uDCBB\uDCBC\uDD27\uDD2C\uDE80\uDE92]|\uD83E(?:[\uDDAF-\uDDB3\uDDBC\uDDBD]|\uDD1D\u200D\uD83E\uDDD1\uD83C[\uDFFB-\uDFFF])))?))?|\uDEF1(?:\uD83C(?:\uDFFB(?:\u200D\uD83E\uDEF2\uD83C[\uDFFC-\uDFFF])?|\uDFFC(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFD-\uDFFF])?|\uDFFD(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB\uDFFC\uDFFE\uDFFF])?|\uDFFE(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFD\uDFFF])?|\uDFFF(?:\u200D\uD83E\uDEF2\uD83C[\uDFFB-\uDFFE])?))?))/g; }; function normalizeDuration(dur) { if (dur === void 0 || dur === null) @@ -9422,8 +9365,8 @@ var require_lib = __commonJS({ path = path.substring(0, path.length - 3); return path; } - parsimmon_umd_minExports.alt(parsimmon_umd_minExports.regex(new RegExp(emojiRegex(), "")), parsimmon_umd_minExports.regex(/[0-9\p{Letter}_-]+/u).map((str) => str.toLocaleLowerCase()), parsimmon_umd_minExports.whitespace.map((_) => "-"), parsimmon_umd_minExports.any.map((_) => "")).many().map((result) => result.join("")); - var HEADER_CANONICALIZER = parsimmon_umd_minExports.alt(parsimmon_umd_minExports.regex(new RegExp(emojiRegex(), "")), parsimmon_umd_minExports.regex(/[0-9\p{Letter}_-]+/u), parsimmon_umd_minExports.whitespace.map((_) => " "), parsimmon_umd_minExports.any.map((_) => " ")).many().map((result) => { + parsimmon_umd_min.exports.alt(parsimmon_umd_min.exports.regex(new RegExp(emojiRegex(), "")), parsimmon_umd_min.exports.regex(/[0-9\p{Letter}_-]+/u).map((str) => str.toLocaleLowerCase()), parsimmon_umd_min.exports.whitespace.map((_) => "-"), parsimmon_umd_min.exports.any.map((_) => "")).many().map((result) => result.join("")); + var HEADER_CANONICALIZER = parsimmon_umd_min.exports.alt(parsimmon_umd_min.exports.regex(new RegExp(emojiRegex(), "")), parsimmon_umd_min.exports.regex(/[0-9\p{Letter}_-]+/u), parsimmon_umd_min.exports.whitespace.map((_) => " "), parsimmon_umd_min.exports.any.map((_) => " ")).many().map((result) => { return result.join("").split(/\s+/).join(" ").trim(); }); function normalizeHeaderForLink(header) { @@ -9431,7 +9374,7 @@ var require_lib = __commonJS({ } function renderMinimalDuration(dur) { dur = normalizeDuration(dur); - dur = Duration2.fromObject(Object.fromEntries(Object.entries(dur.toObject()).filter(([, quantity]) => quantity != 0))); + dur = Duration2.fromObject(Object.fromEntries(Object.entries(dur.toObject()).filter(([, quantity]) => quantity > 0))); return dur.toHuman(); } var Values; @@ -9495,18 +9438,18 @@ var require_lib = __commonJS({ return { type: "array", value: val }; else if (isLink(val)) return { type: "link", value: val }; - else if (isFunction3(val)) + else if (isFunction2(val)) return { type: "function", value: val }; else if (isHtml(val)) return { type: "html", value: val }; - else if (isObject2(val)) + else if (isObject3(val)) return { type: "object", value: val }; else return void 0; } Values2.wrapValue = wrapValue; function mapLeaves(val, func) { - if (isObject2(val)) { + if (isObject3(val)) { let result = {}; for (let [key, value] of Object.entries(val)) result[key] = mapLeaves(value, func); @@ -9564,7 +9507,7 @@ var require_lib = __commonJS({ case "link": let link1 = wrap1.value; let link2 = wrap2.value; - let normalize = linkNormalizer != null ? linkNormalizer : ((x) => x); + let normalize = linkNormalizer !== null && linkNormalizer !== void 0 ? linkNormalizer : (x) => x; let pathCompare = normalize(link1.path).localeCompare(normalize(link2.path)); if (pathCompare != 0) return pathCompare; @@ -9577,7 +9520,7 @@ var require_lib = __commonJS({ return -1; if (!link1.subpath && !link2.subpath) return 0; - return ((_a2 = link1.subpath) != null ? _a2 : "").localeCompare((_b = link2.subpath) != null ? _b : ""); + return ((_a2 = link1.subpath) !== null && _a2 !== void 0 ? _a2 : "").localeCompare((_b = link2.subpath) !== null && _b !== void 0 ? _b : ""); case "date": return wrap1.value < wrap2.value ? -1 : wrap1.value.equals(wrap2.value) ? 0 : 1; case "duration": @@ -9616,7 +9559,7 @@ var require_lib = __commonJS({ Values2.compareValue = compareValue; function typeOf(val) { var _a2; - return (_a2 = wrapValue(val)) == null ? void 0 : _a2.type; + return (_a2 = wrapValue(val)) === null || _a2 === void 0 ? void 0 : _a2.type; } Values2.typeOf = typeOf; function isTruthy(field) { @@ -9708,14 +9651,14 @@ var require_lib = __commonJS({ } } Values2.isHtml = isHtml; - function isObject2(val) { + function isObject3(val) { return typeof val == "object" && !isHtml(val) && !isWidget(val) && !isArray2(val) && !isDuration(val) && !isDate4(val) && !isLink(val) && val !== void 0 && !isNull(val); } - Values2.isObject = isObject2; - function isFunction3(val) { + Values2.isObject = isObject3; + function isFunction2(val) { return typeof val == "function"; } - Values2.isFunction = isFunction3; + Values2.isFunction = isFunction2; })(Values || (Values = {})); var Groupings; (function(Groupings2) { @@ -9744,16 +9687,6 @@ var require_lib = __commonJS({ })(Groupings || (Groupings = {})); var Link = class _Link { constructor(fields) { - /** The file path this link points to. */ - __publicField(this, "path"); - /** The display name associated with the link. */ - __publicField(this, "display"); - /** The block ID or header this link points to within a file, if relevant. */ - __publicField(this, "subpath"); - /** Is this link an embedded link (!)? */ - __publicField(this, "embed"); - /** The type of this link, which determines what 'subpath' refers to, if anything. */ - __publicField(this, "type"); Object.assign(this, fields); } /** Create a link to a specific file. */ @@ -9866,11 +9799,11 @@ var require_lib = __commonJS({ /** Convert the inner part of the link to something that Obsidian can open / understand. */ obsidianLink() { var _a2, _b; - const escaped = this.path.replaceAll("|", "\\|"); + const escaped = this.path.replace("|", "\\|"); if (this.type == "header") - return escaped + "#" + ((_a2 = this.subpath) == null ? void 0 : _a2.replaceAll("|", "\\|")); + return escaped + "#" + ((_a2 = this.subpath) === null || _a2 === void 0 ? void 0 : _a2.replace("|", "\\|")); if (this.type == "block") - return escaped + "#^" + ((_b = this.subpath) == null ? void 0 : _b.replaceAll("|", "\\|")); + return escaped + "#^" + ((_b = this.subpath) === null || _b === void 0 ? void 0 : _b.replace("|", "\\|")); else return escaped; } @@ -9881,15 +9814,12 @@ var require_lib = __commonJS({ }; var Widget = class { constructor($widget) { - __publicField(this, "$widget"); this.$widget = $widget; } }; var ListPairWidget = class extends Widget { constructor(key, value) { super("dataview:list-pair"); - __publicField(this, "key"); - __publicField(this, "value"); this.key = key; this.value = value; } @@ -9900,14 +9830,12 @@ var require_lib = __commonJS({ var ExternalLinkWidget = class extends Widget { constructor(url, display) { super("dataview:external-link"); - __publicField(this, "url"); - __publicField(this, "display"); this.url = url; this.display = display; } markdown() { var _a2; - return `[${(_a2 = this.display) != null ? _a2 : this.url}](${this.url})`; + return `[${(_a2 = this.display) !== null && _a2 !== void 0 ? _a2 : this.url}](${this.url})`; } }; var Widgets; @@ -10092,7 +10020,7 @@ var require_lib = __commonJS({ return Link.infer(link, false, display); } function createBinaryParser(child, sep, combine) { - return parsimmon_umd_minExports.seqMap(child, parsimmon_umd_minExports.seq(parsimmon_umd_minExports.optWhitespace, sep, parsimmon_umd_minExports.optWhitespace, child).many(), (first, rest) => { + return parsimmon_umd_min.exports.seqMap(child, parsimmon_umd_min.exports.seq(parsimmon_umd_min.exports.optWhitespace, sep, parsimmon_umd_min.exports.optWhitespace, child).many(), (first, rest) => { if (rest.length == 0) return first; let node = combine(first, rest[0][1], rest[0][3]); @@ -10103,7 +10031,7 @@ var require_lib = __commonJS({ }); } function chainOpt(base, ...funcs) { - return parsimmon_umd_minExports.custom((success, failure) => { + return parsimmon_umd_min.exports.custom((success, failure) => { return (input, i) => { let result = base._(input, i); if (!result.status) @@ -10118,12 +10046,12 @@ var require_lib = __commonJS({ }; }); } - var EXPRESSION = parsimmon_umd_minExports.createLanguage({ + var EXPRESSION = parsimmon_umd_min.exports.createLanguage({ // A floating point number; the decimal point is optional. - number: (q) => parsimmon_umd_minExports.regexp(/-?[0-9]+(\.[0-9]+)?/).map((str) => Number.parseFloat(str)).desc("number"), + number: (q) => parsimmon_umd_min.exports.regexp(/-?[0-9]+(\.[0-9]+)?/).map((str) => Number.parseFloat(str)).desc("number"), // A quote-surrounded string which supports escape characters ('\'). - string: (q) => parsimmon_umd_minExports.string('"').then(parsimmon_umd_minExports.alt(q.escapeCharacter, parsimmon_umd_minExports.noneOf('"\\')).atLeast(0).map((chars) => chars.join(""))).skip(parsimmon_umd_minExports.string('"')).desc("string"), - escapeCharacter: (_) => parsimmon_umd_minExports.string("\\").then(parsimmon_umd_minExports.any).map((escaped) => { + string: (q) => parsimmon_umd_min.exports.string('"').then(parsimmon_umd_min.exports.alt(q.escapeCharacter, parsimmon_umd_min.exports.noneOf('"\\')).atLeast(0).map((chars) => chars.join(""))).skip(parsimmon_umd_min.exports.string('"')).desc("string"), + escapeCharacter: (_) => parsimmon_umd_min.exports.string("\\").then(parsimmon_umd_min.exports.any).map((escaped) => { if (escaped === '"') return '"'; if (escaped === "\\") @@ -10132,28 +10060,28 @@ var require_lib = __commonJS({ return "\\" + escaped; }), // A boolean true/false value. - bool: (_) => parsimmon_umd_minExports.regexp(/true|false|True|False/).map((str) => str.toLowerCase() == "true").desc("boolean ('true' or 'false')"), + bool: (_) => parsimmon_umd_min.exports.regexp(/true|false|True|False/).map((str) => str.toLowerCase() == "true").desc("boolean ('true' or 'false')"), // A tag of the form '#stuff/hello-there'. - tag: (_) => parsimmon_umd_minExports.seqMap(parsimmon_umd_minExports.string("#"), parsimmon_umd_minExports.alt(parsimmon_umd_minExports.regexp(/[^\u2000-\u206F\u2E00-\u2E7F'!"#$%&()*+,.:;<=>?@^`{|}~\[\]\\\s]/).desc("text")).many(), (start2, rest) => start2 + rest.join("")).desc("tag ('#hello/stuff')"), + tag: (_) => parsimmon_umd_min.exports.seqMap(parsimmon_umd_min.exports.string("#"), parsimmon_umd_min.exports.alt(parsimmon_umd_min.exports.regexp(/[^\u2000-\u206F\u2E00-\u2E7F'!"#$%&()*+,.:;<=>?@^`{|}~\[\]\\\s]/).desc("text")).many(), (start2, rest) => start2 + rest.join("")).desc("tag ('#hello/stuff')"), // A variable identifier, which is alphanumeric and must start with a letter or... emoji. - identifier: (_) => parsimmon_umd_minExports.seqMap(parsimmon_umd_minExports.alt(parsimmon_umd_minExports.regexp(new RegExp("\\p{Letter}", "u")), parsimmon_umd_minExports.regexp(EMOJI_REGEX).desc("text")), parsimmon_umd_minExports.alt(parsimmon_umd_minExports.regexp(/[0-9\p{Letter}_-]/u), parsimmon_umd_minExports.regexp(EMOJI_REGEX).desc("text")).many(), (first, rest) => first + rest.join("")).desc("variable identifier"), + identifier: (_) => parsimmon_umd_min.exports.seqMap(parsimmon_umd_min.exports.alt(parsimmon_umd_min.exports.regexp(new RegExp("\\p{Letter}", "u")), parsimmon_umd_min.exports.regexp(EMOJI_REGEX).desc("text")), parsimmon_umd_min.exports.alt(parsimmon_umd_min.exports.regexp(/[0-9\p{Letter}_-]/u), parsimmon_umd_min.exports.regexp(EMOJI_REGEX).desc("text")).many(), (first, rest) => first + rest.join("")).desc("variable identifier"), // An Obsidian link of the form [[]]. - link: (_) => parsimmon_umd_minExports.regexp(/\[\[([^\[\]]*?)\]\]/u, 1).map((linkInner) => parseInnerLink(linkInner)).desc("file link"), + link: (_) => parsimmon_umd_min.exports.regexp(/\[\[([^\[\]]*?)\]\]/u, 1).map((linkInner) => parseInnerLink(linkInner)).desc("file link"), // An embeddable link which can start with '!'. This overlaps with the normal negation operator, so it is only // provided for metadata parsing. - embedLink: (q) => parsimmon_umd_minExports.seqMap(parsimmon_umd_minExports.string("!").atMost(1), q.link, (p, l3) => { + embedLink: (q) => parsimmon_umd_min.exports.seqMap(parsimmon_umd_min.exports.string("!").atMost(1), q.link, (p, l3) => { if (p.length > 0) l3.embed = true; return l3; }).desc("file link"), // Binary plus or minus operator. - binaryPlusMinus: (_) => parsimmon_umd_minExports.regexp(/\+|-/).map((str) => str).desc("'+' or '-'"), + binaryPlusMinus: (_) => parsimmon_umd_min.exports.regexp(/\+|-/).map((str) => str).desc("'+' or '-'"), // Binary times or divide operator. - binaryMulDiv: (_) => parsimmon_umd_minExports.regexp(/\*|\/|%/).map((str) => str).desc("'*' or '/' or '%'"), + binaryMulDiv: (_) => parsimmon_umd_min.exports.regexp(/\*|\/|%/).map((str) => str).desc("'*' or '/' or '%'"), // Binary comparison operator. - binaryCompareOp: (_) => parsimmon_umd_minExports.regexp(/>=|<=|!=|>|<|=/).map((str) => str).desc("'>=' or '<=' or '!=' or '=' or '>' or '<'"), + binaryCompareOp: (_) => parsimmon_umd_min.exports.regexp(/>=|<=|!=|>|<|=/).map((str) => str).desc("'>=' or '<=' or '!=' or '=' or '>' or '<'"), // Binary boolean combination operator. - binaryBooleanOp: (_) => parsimmon_umd_minExports.regexp(/and|or|&|\|/i).map((str) => { + binaryBooleanOp: (_) => parsimmon_umd_min.exports.regexp(/and|or|&|\|/i).map((str) => { if (str.toLowerCase() == "and") return "&"; else if (str.toLowerCase() == "or") @@ -10162,62 +10090,62 @@ var require_lib = __commonJS({ return str; }).desc("'and' or 'or'"), // A date which can be YYYY-MM[-DDTHH:mm:ss]. - rootDate: (_) => parsimmon_umd_minExports.seqMap(parsimmon_umd_minExports.regexp(/\d{4}/), parsimmon_umd_minExports.string("-"), parsimmon_umd_minExports.regexp(/\d{2}/), (year, _2, month) => { + rootDate: (_) => parsimmon_umd_min.exports.seqMap(parsimmon_umd_min.exports.regexp(/\d{4}/), parsimmon_umd_min.exports.string("-"), parsimmon_umd_min.exports.regexp(/\d{2}/), (year, _2, month) => { return DateTime2.fromObject({ year: Number.parseInt(year), month: Number.parseInt(month) }); }).desc("date in format YYYY-MM[-DDTHH-MM-SS.MS]"), - dateShorthand: (_) => parsimmon_umd_minExports.alt(...Object.keys(DATE_SHORTHANDS).sort((a, b) => b.length - a.length).map(parsimmon_umd_minExports.string)), - date: (q) => chainOpt(q.rootDate, (ym) => parsimmon_umd_minExports.seqMap(parsimmon_umd_minExports.string("-"), parsimmon_umd_minExports.regexp(/\d{2}/), (_, day) => ym.set({ day: Number.parseInt(day) })), (ymd) => parsimmon_umd_minExports.seqMap(parsimmon_umd_minExports.string("T"), parsimmon_umd_minExports.regexp(/\d{2}/), (_, hour) => ymd.set({ hour: Number.parseInt(hour) })), (ymdh) => parsimmon_umd_minExports.seqMap(parsimmon_umd_minExports.string(":"), parsimmon_umd_minExports.regexp(/\d{2}/), (_, minute) => ymdh.set({ minute: Number.parseInt(minute) })), (ymdhm) => parsimmon_umd_minExports.seqMap(parsimmon_umd_minExports.string(":"), parsimmon_umd_minExports.regexp(/\d{2}/), (_, second) => ymdhm.set({ second: Number.parseInt(second) })), (ymdhms) => parsimmon_umd_minExports.alt( - parsimmon_umd_minExports.seqMap(parsimmon_umd_minExports.string("."), parsimmon_umd_minExports.regexp(/\d{3}/), (_, millisecond) => ymdhms.set({ millisecond: Number.parseInt(millisecond) })), - parsimmon_umd_minExports.succeed(ymdhms) + dateShorthand: (_) => parsimmon_umd_min.exports.alt(...Object.keys(DATE_SHORTHANDS).sort((a, b) => b.length - a.length).map(parsimmon_umd_min.exports.string)), + date: (q) => chainOpt(q.rootDate, (ym) => parsimmon_umd_min.exports.seqMap(parsimmon_umd_min.exports.string("-"), parsimmon_umd_min.exports.regexp(/\d{2}/), (_, day) => ym.set({ day: Number.parseInt(day) })), (ymd) => parsimmon_umd_min.exports.seqMap(parsimmon_umd_min.exports.string("T"), parsimmon_umd_min.exports.regexp(/\d{2}/), (_, hour) => ymd.set({ hour: Number.parseInt(hour) })), (ymdh) => parsimmon_umd_min.exports.seqMap(parsimmon_umd_min.exports.string(":"), parsimmon_umd_min.exports.regexp(/\d{2}/), (_, minute) => ymdh.set({ minute: Number.parseInt(minute) })), (ymdhm) => parsimmon_umd_min.exports.seqMap(parsimmon_umd_min.exports.string(":"), parsimmon_umd_min.exports.regexp(/\d{2}/), (_, second) => ymdhm.set({ second: Number.parseInt(second) })), (ymdhms) => parsimmon_umd_min.exports.alt( + parsimmon_umd_min.exports.seqMap(parsimmon_umd_min.exports.string("."), parsimmon_umd_min.exports.regexp(/\d{3}/), (_, millisecond) => ymdhms.set({ millisecond: Number.parseInt(millisecond) })), + parsimmon_umd_min.exports.succeed(ymdhms) // pass - ), (dt) => parsimmon_umd_minExports.alt(parsimmon_umd_minExports.seqMap(parsimmon_umd_minExports.string("+").or(parsimmon_umd_minExports.string("-")), parsimmon_umd_minExports.regexp(/\d{1,2}(:\d{2})?/), (pm, hr) => dt.setZone("UTC" + pm + hr, { keepLocalTime: true })), parsimmon_umd_minExports.seqMap(parsimmon_umd_minExports.string("Z"), () => dt.setZone("utc", { keepLocalTime: true })), parsimmon_umd_minExports.seqMap(parsimmon_umd_minExports.string("["), parsimmon_umd_minExports.regexp(/[0-9A-Za-z+-\/]+/u), parsimmon_umd_minExports.string("]"), (_a2, zone, _b) => dt.setZone(zone, { keepLocalTime: true })))).assert((dt) => dt.isValid, "valid date").desc("date in format YYYY-MM[-DDTHH-MM-SS.MS]"), + ), (dt) => parsimmon_umd_min.exports.alt(parsimmon_umd_min.exports.seqMap(parsimmon_umd_min.exports.string("+").or(parsimmon_umd_min.exports.string("-")), parsimmon_umd_min.exports.regexp(/\d{1,2}(:\d{2})?/), (pm, hr) => dt.setZone("UTC" + pm + hr, { keepLocalTime: true })), parsimmon_umd_min.exports.seqMap(parsimmon_umd_min.exports.string("Z"), () => dt.setZone("utc", { keepLocalTime: true })), parsimmon_umd_min.exports.seqMap(parsimmon_umd_min.exports.string("["), parsimmon_umd_min.exports.regexp(/[0-9A-Za-z+-\/]+/u), parsimmon_umd_min.exports.string("]"), (_a2, zone, _b) => dt.setZone(zone, { keepLocalTime: true })))).assert((dt) => dt.isValid, "valid date").desc("date in format YYYY-MM[-DDTHH-MM-SS.MS]"), // A date, plus various shorthand times of day it could be. - datePlus: (q) => parsimmon_umd_minExports.alt(q.dateShorthand.map((d) => DATE_SHORTHANDS[d]()), q.date).desc("date in format YYYY-MM[-DDTHH-MM-SS.MS] or in shorthand"), + datePlus: (q) => parsimmon_umd_min.exports.alt(q.dateShorthand.map((d) => DATE_SHORTHANDS[d]()), q.date).desc("date in format YYYY-MM[-DDTHH-MM-SS.MS] or in shorthand"), // A duration of time. - durationType: (_) => parsimmon_umd_minExports.alt(...Object.keys(DURATION_TYPES).sort((a, b) => b.length - a.length).map(parsimmon_umd_minExports.string)), - duration: (q) => parsimmon_umd_minExports.seqMap(q.number, parsimmon_umd_minExports.optWhitespace, q.durationType, (count, _, t) => DURATION_TYPES[t].mapUnits((x) => x * count)).sepBy1(parsimmon_umd_minExports.string(",").trim(parsimmon_umd_minExports.optWhitespace).or(parsimmon_umd_minExports.optWhitespace)).map((durations) => durations.reduce((p, c) => p.plus(c))).desc("duration like 4hr2min"), + durationType: (_) => parsimmon_umd_min.exports.alt(...Object.keys(DURATION_TYPES).sort((a, b) => b.length - a.length).map(parsimmon_umd_min.exports.string)), + duration: (q) => parsimmon_umd_min.exports.seqMap(q.number, parsimmon_umd_min.exports.optWhitespace, q.durationType, (count, _, t) => DURATION_TYPES[t].mapUnits((x) => x * count)).sepBy1(parsimmon_umd_min.exports.string(",").trim(parsimmon_umd_min.exports.optWhitespace).or(parsimmon_umd_min.exports.optWhitespace)).map((durations) => durations.reduce((p, c) => p.plus(c))).desc("duration like 4hr2min"), // A raw null value. - rawNull: (_) => parsimmon_umd_minExports.string("null"), + rawNull: (_) => parsimmon_umd_min.exports.string("null"), // Source parsing. tagSource: (q) => q.tag.map((tag) => Sources.tag(tag)), - csvSource: (q) => parsimmon_umd_minExports.seqMap(parsimmon_umd_minExports.string("csv(").skip(parsimmon_umd_minExports.optWhitespace), q.string, parsimmon_umd_minExports.string(")"), (_1, path, _2) => Sources.csv(path)), + csvSource: (q) => parsimmon_umd_min.exports.seqMap(parsimmon_umd_min.exports.string("csv(").skip(parsimmon_umd_min.exports.optWhitespace), q.string, parsimmon_umd_min.exports.string(")"), (_1, path, _2) => Sources.csv(path)), linkIncomingSource: (q) => q.link.map((link) => Sources.link(link.path, true)), - linkOutgoingSource: (q) => parsimmon_umd_minExports.seqMap(parsimmon_umd_minExports.string("outgoing(").skip(parsimmon_umd_minExports.optWhitespace), q.link, parsimmon_umd_minExports.string(")"), (_1, link, _2) => Sources.link(link.path, false)), + linkOutgoingSource: (q) => parsimmon_umd_min.exports.seqMap(parsimmon_umd_min.exports.string("outgoing(").skip(parsimmon_umd_min.exports.optWhitespace), q.link, parsimmon_umd_min.exports.string(")"), (_1, link, _2) => Sources.link(link.path, false)), folderSource: (q) => q.string.map((str) => Sources.folder(str)), - parensSource: (q) => parsimmon_umd_minExports.seqMap(parsimmon_umd_minExports.string("("), parsimmon_umd_minExports.optWhitespace, q.source, parsimmon_umd_minExports.optWhitespace, parsimmon_umd_minExports.string(")"), (_1, _2, field, _3, _4) => field), - negateSource: (q) => parsimmon_umd_minExports.seqMap(parsimmon_umd_minExports.alt(parsimmon_umd_minExports.string("-"), parsimmon_umd_minExports.string("!")), q.atomSource, (_, source) => Sources.negate(source)), - atomSource: (q) => parsimmon_umd_minExports.alt(q.parensSource, q.negateSource, q.linkOutgoingSource, q.linkIncomingSource, q.folderSource, q.tagSource, q.csvSource), + parensSource: (q) => parsimmon_umd_min.exports.seqMap(parsimmon_umd_min.exports.string("("), parsimmon_umd_min.exports.optWhitespace, q.source, parsimmon_umd_min.exports.optWhitespace, parsimmon_umd_min.exports.string(")"), (_1, _2, field, _3, _4) => field), + negateSource: (q) => parsimmon_umd_min.exports.seqMap(parsimmon_umd_min.exports.alt(parsimmon_umd_min.exports.string("-"), parsimmon_umd_min.exports.string("!")), q.atomSource, (_, source) => Sources.negate(source)), + atomSource: (q) => parsimmon_umd_min.exports.alt(q.parensSource, q.negateSource, q.linkOutgoingSource, q.linkIncomingSource, q.folderSource, q.tagSource, q.csvSource), binaryOpSource: (q) => createBinaryParser(q.atomSource, q.binaryBooleanOp.map((s3) => s3), Sources.binaryOp), source: (q) => q.binaryOpSource, // Field parsing. variableField: (q) => q.identifier.chain((r) => { if (KEYWORDS.includes(r.toUpperCase())) { - return parsimmon_umd_minExports.fail("Variable fields cannot be a keyword (" + KEYWORDS.join(" or ") + ")"); + return parsimmon_umd_min.exports.fail("Variable fields cannot be a keyword (" + KEYWORDS.join(" or ") + ")"); } else { - return parsimmon_umd_minExports.succeed(Fields.variable(r)); + return parsimmon_umd_min.exports.succeed(Fields.variable(r)); } }).desc("variable"), numberField: (q) => q.number.map((val) => Fields.literal(val)).desc("number"), stringField: (q) => q.string.map((val) => Fields.literal(val)).desc("string"), boolField: (q) => q.bool.map((val) => Fields.literal(val)).desc("boolean"), - dateField: (q) => parsimmon_umd_minExports.seqMap(parsimmon_umd_minExports.string("date("), parsimmon_umd_minExports.optWhitespace, q.datePlus, parsimmon_umd_minExports.optWhitespace, parsimmon_umd_minExports.string(")"), (prefix, _1, date, _2, postfix) => Fields.literal(date)).desc("date"), - durationField: (q) => parsimmon_umd_minExports.seqMap(parsimmon_umd_minExports.string("dur("), parsimmon_umd_minExports.optWhitespace, q.duration, parsimmon_umd_minExports.optWhitespace, parsimmon_umd_minExports.string(")"), (prefix, _1, dur, _2, postfix) => Fields.literal(dur)).desc("duration"), + dateField: (q) => parsimmon_umd_min.exports.seqMap(parsimmon_umd_min.exports.string("date("), parsimmon_umd_min.exports.optWhitespace, q.datePlus, parsimmon_umd_min.exports.optWhitespace, parsimmon_umd_min.exports.string(")"), (prefix, _1, date, _2, postfix) => Fields.literal(date)).desc("date"), + durationField: (q) => parsimmon_umd_min.exports.seqMap(parsimmon_umd_min.exports.string("dur("), parsimmon_umd_min.exports.optWhitespace, q.duration, parsimmon_umd_min.exports.optWhitespace, parsimmon_umd_min.exports.string(")"), (prefix, _1, dur, _2, postfix) => Fields.literal(dur)).desc("duration"), nullField: (q) => q.rawNull.map((_) => Fields.NULL), linkField: (q) => q.link.map((f) => Fields.literal(f)), - listField: (q) => q.field.sepBy(parsimmon_umd_minExports.string(",").trim(parsimmon_umd_minExports.optWhitespace)).wrap(parsimmon_umd_minExports.string("[").skip(parsimmon_umd_minExports.optWhitespace), parsimmon_umd_minExports.optWhitespace.then(parsimmon_umd_minExports.string("]"))).map((l3) => Fields.list(l3)).desc("list ('[1, 2, 3]')"), - objectField: (q) => parsimmon_umd_minExports.seqMap(q.identifier.or(q.string), parsimmon_umd_minExports.string(":").trim(parsimmon_umd_minExports.optWhitespace), q.field, (name, _sep, value) => { + listField: (q) => q.field.sepBy(parsimmon_umd_min.exports.string(",").trim(parsimmon_umd_min.exports.optWhitespace)).wrap(parsimmon_umd_min.exports.string("[").skip(parsimmon_umd_min.exports.optWhitespace), parsimmon_umd_min.exports.optWhitespace.then(parsimmon_umd_min.exports.string("]"))).map((l3) => Fields.list(l3)).desc("list ('[1, 2, 3]')"), + objectField: (q) => parsimmon_umd_min.exports.seqMap(q.identifier.or(q.string), parsimmon_umd_min.exports.string(":").trim(parsimmon_umd_min.exports.optWhitespace), q.field, (name, _sep, value) => { return { name, value }; - }).sepBy(parsimmon_umd_minExports.string(",").trim(parsimmon_umd_minExports.optWhitespace)).wrap(parsimmon_umd_minExports.string("{").skip(parsimmon_umd_minExports.optWhitespace), parsimmon_umd_minExports.optWhitespace.then(parsimmon_umd_minExports.string("}"))).map((vals) => { + }).sepBy(parsimmon_umd_min.exports.string(",").trim(parsimmon_umd_min.exports.optWhitespace)).wrap(parsimmon_umd_min.exports.string("{").skip(parsimmon_umd_min.exports.optWhitespace), parsimmon_umd_min.exports.optWhitespace.then(parsimmon_umd_min.exports.string("}"))).map((vals) => { let res = {}; for (let entry of vals) res[entry.name] = entry.value; return Fields.object(res); }).desc("object ('{ a: 1, b: 2 }')"), - atomInlineField: (q) => parsimmon_umd_minExports.alt(q.date, q.duration.map((d) => normalizeDuration(d)), q.string, q.tag, q.embedLink, q.bool, q.number, q.rawNull), - inlineFieldList: (q) => q.atomInlineField.sepBy(parsimmon_umd_minExports.string(",").trim(parsimmon_umd_minExports.optWhitespace).lookahead(q.atomInlineField)), - inlineField: (q) => parsimmon_umd_minExports.alt(parsimmon_umd_minExports.seqMap(q.atomInlineField, parsimmon_umd_minExports.string(",").trim(parsimmon_umd_minExports.optWhitespace), q.inlineFieldList, (f, _s, l3) => [f].concat(l3)), q.atomInlineField), - atomField: (q) => parsimmon_umd_minExports.alt( - // Place embed links above negated fields as they are the special parser case '![[thing]]' and are generally unambiguous. + atomInlineField: (q) => parsimmon_umd_min.exports.alt(q.date, q.duration.map((d) => normalizeDuration(d)), q.string, q.tag, q.embedLink, q.bool, q.number, q.rawNull), + inlineFieldList: (q) => q.atomInlineField.sepBy(parsimmon_umd_min.exports.string(",").trim(parsimmon_umd_min.exports.optWhitespace).lookahead(q.atomInlineField)), + inlineField: (q) => parsimmon_umd_min.exports.alt(parsimmon_umd_min.exports.seqMap(q.atomInlineField, parsimmon_umd_min.exports.string(",").trim(parsimmon_umd_min.exports.optWhitespace), q.inlineFieldList, (f, _s, l3) => [f].concat(l3)), q.atomInlineField), + atomField: (q) => parsimmon_umd_min.exports.alt( + // Place embed links above negated fields as they are the special parser case '![[thing]]' and are generally unambigious. q.embedLink.map((l3) => Fields.literal(l3)), q.negatedField, q.linkField, @@ -10233,7 +10161,7 @@ var require_lib = __commonJS({ q.nullField, q.variableField ), - indexField: (q) => parsimmon_umd_minExports.seqMap(q.atomField, parsimmon_umd_minExports.alt(q.dotPostfix, q.indexPostfix, q.functionPostfix).many(), (obj, postfixes) => { + indexField: (q) => parsimmon_umd_min.exports.seqMap(q.atomField, parsimmon_umd_min.exports.alt(q.dotPostfix, q.indexPostfix, q.functionPostfix).many(), (obj, postfixes) => { let result = obj; for (let post of postfixes) { switch (post.type) { @@ -10250,18 +10178,18 @@ var require_lib = __commonJS({ } return result; }), - negatedField: (q) => parsimmon_umd_minExports.seqMap(parsimmon_umd_minExports.string("!"), q.indexField, (_, field) => Fields.negate(field)).desc("negated field"), - parensField: (q) => parsimmon_umd_minExports.seqMap(parsimmon_umd_minExports.string("("), parsimmon_umd_minExports.optWhitespace, q.field, parsimmon_umd_minExports.optWhitespace, parsimmon_umd_minExports.string(")"), (_1, _2, field, _3, _4) => field), - lambdaField: (q) => parsimmon_umd_minExports.seqMap(q.identifier.sepBy(parsimmon_umd_minExports.string(",").trim(parsimmon_umd_minExports.optWhitespace)).wrap(parsimmon_umd_minExports.string("(").trim(parsimmon_umd_minExports.optWhitespace), parsimmon_umd_minExports.string(")").trim(parsimmon_umd_minExports.optWhitespace)), parsimmon_umd_minExports.string("=>").trim(parsimmon_umd_minExports.optWhitespace), q.field, (ident, _ignore, value) => { + negatedField: (q) => parsimmon_umd_min.exports.seqMap(parsimmon_umd_min.exports.string("!"), q.indexField, (_, field) => Fields.negate(field)).desc("negated field"), + parensField: (q) => parsimmon_umd_min.exports.seqMap(parsimmon_umd_min.exports.string("("), parsimmon_umd_min.exports.optWhitespace, q.field, parsimmon_umd_min.exports.optWhitespace, parsimmon_umd_min.exports.string(")"), (_1, _2, field, _3, _4) => field), + lambdaField: (q) => parsimmon_umd_min.exports.seqMap(q.identifier.sepBy(parsimmon_umd_min.exports.string(",").trim(parsimmon_umd_min.exports.optWhitespace)).wrap(parsimmon_umd_min.exports.string("(").trim(parsimmon_umd_min.exports.optWhitespace), parsimmon_umd_min.exports.string(")").trim(parsimmon_umd_min.exports.optWhitespace)), parsimmon_umd_min.exports.string("=>").trim(parsimmon_umd_min.exports.optWhitespace), q.field, (ident, _ignore, value) => { return { type: "lambda", arguments: ident, value }; }), - dotPostfix: (q) => parsimmon_umd_minExports.seqMap(parsimmon_umd_minExports.string("."), q.identifier, (_, field) => { + dotPostfix: (q) => parsimmon_umd_min.exports.seqMap(parsimmon_umd_min.exports.string("."), q.identifier, (_, field) => { return { type: "dot", field }; }), - indexPostfix: (q) => parsimmon_umd_minExports.seqMap(parsimmon_umd_minExports.string("["), parsimmon_umd_minExports.optWhitespace, q.field, parsimmon_umd_minExports.optWhitespace, parsimmon_umd_minExports.string("]"), (_, _2, field, _3, _4) => { + indexPostfix: (q) => parsimmon_umd_min.exports.seqMap(parsimmon_umd_min.exports.string("["), parsimmon_umd_min.exports.optWhitespace, q.field, parsimmon_umd_min.exports.optWhitespace, parsimmon_umd_min.exports.string("]"), (_, _2, field, _3, _4) => { return { type: "index", field }; }), - functionPostfix: (q) => parsimmon_umd_minExports.seqMap(parsimmon_umd_minExports.string("("), parsimmon_umd_minExports.optWhitespace, q.field.sepBy(parsimmon_umd_minExports.string(",").trim(parsimmon_umd_minExports.optWhitespace)), parsimmon_umd_minExports.optWhitespace, parsimmon_umd_minExports.string(")"), (_, _1, fields, _2, _3) => { + functionPostfix: (q) => parsimmon_umd_min.exports.seqMap(parsimmon_umd_min.exports.string("("), parsimmon_umd_min.exports.optWhitespace, q.field.sepBy(parsimmon_umd_min.exports.string(",").trim(parsimmon_umd_min.exports.optWhitespace)), parsimmon_umd_min.exports.optWhitespace, parsimmon_umd_min.exports.string(")"), (_, _1, fields, _2, _3) => { return { type: "function", fields }; }), // The precedence hierarchy of operators - multiply/divide, add/subtract, compare, and then boolean operations. @@ -10291,7 +10219,7 @@ var require_lib = __commonJS({ QueryFields2.sortBy = sortBy; })(QueryFields || (QueryFields = {})); function captureRaw(base) { - return parsimmon_umd_minExports.custom((success, failure) => { + return parsimmon_umd_min.exports.custom((success, failure) => { return (input, i) => { let result = base._(input, i); if (!result.status) @@ -10303,23 +10231,12 @@ var require_lib = __commonJS({ function stripNewlines(text2) { return text2.split(/[\r\n]+/).map((t) => t.trim()).join(""); } - function precededByWhitespaceIfNotEof(if_eof, parser) { - return parsimmon_umd_minExports.eof.map(if_eof).or(parsimmon_umd_minExports.whitespace.then(parser)); - } - var QUERY_LANGUAGE = parsimmon_umd_minExports.createLanguage({ + var QUERY_LANGUAGE = parsimmon_umd_min.exports.createLanguage({ // Simple atom parsing, like words, identifiers, numbers. - queryType: (q) => parsimmon_umd_minExports.alt(parsimmon_umd_minExports.regexp(/TABLE|LIST|TASK|CALENDAR/i)).map((str) => str.toLowerCase()).desc("query type ('TABLE', 'LIST', 'TASK', or 'CALENDAR')"), - explicitNamedField: (q) => parsimmon_umd_minExports.seqMap(EXPRESSION.field.skip(parsimmon_umd_minExports.whitespace), parsimmon_umd_minExports.regexp(/AS/i).skip(parsimmon_umd_minExports.whitespace), EXPRESSION.identifier.or(EXPRESSION.string), (field, _as, ident) => QueryFields.named(ident, field)), - comment: () => parsimmon_umd_minExports.Parser((input, i) => { - let line = input.substring(i); - if (!line.startsWith("//")) - return parsimmon_umd_minExports.makeFailure(i, "Not a comment"); - line = line.split("\n")[0]; - let comment = line.substring(2).trim(); - return parsimmon_umd_minExports.makeSuccess(i + line.length, comment); - }), - namedField: (q) => parsimmon_umd_minExports.alt(q.explicitNamedField, captureRaw(EXPRESSION.field).map(([value, text2]) => QueryFields.named(stripNewlines(text2), value))), - sortField: (q) => parsimmon_umd_minExports.seqMap(EXPRESSION.field.skip(parsimmon_umd_minExports.optWhitespace), parsimmon_umd_minExports.regexp(/ASCENDING|DESCENDING|ASC|DESC/i).atMost(1), (field, dir) => { + queryType: (q) => parsimmon_umd_min.exports.alt(parsimmon_umd_min.exports.regexp(/TABLE|LIST|TASK|CALENDAR/i)).map((str) => str.toLowerCase()).desc("query type ('TABLE', 'LIST', 'TASK', or 'CALENDAR')"), + explicitNamedField: (q) => parsimmon_umd_min.exports.seqMap(EXPRESSION.field.skip(parsimmon_umd_min.exports.whitespace), parsimmon_umd_min.exports.regexp(/AS/i).skip(parsimmon_umd_min.exports.whitespace), EXPRESSION.identifier.or(EXPRESSION.string), (field, _as, ident) => QueryFields.named(ident, field)), + namedField: (q) => parsimmon_umd_min.exports.alt(q.explicitNamedField, captureRaw(EXPRESSION.field).map(([value, text2]) => QueryFields.named(stripNewlines(text2), value))), + sortField: (q) => parsimmon_umd_min.exports.seqMap(EXPRESSION.field.skip(parsimmon_umd_min.exports.optWhitespace), parsimmon_umd_min.exports.regexp(/ASCENDING|DESCENDING|ASC|DESC/i).atMost(1), (field, dir) => { let direction = dir.length == 0 ? "ascending" : dir[0].toLowerCase(); if (direction == "desc") direction = "descending"; @@ -10330,54 +10247,53 @@ var require_lib = __commonJS({ direction }; }), - headerClause: (q) => q.queryType.chain((type) => { - switch (type) { - case "table": { - return precededByWhitespaceIfNotEof(() => ({ type, fields: [], showId: true }), parsimmon_umd_minExports.seqMap(parsimmon_umd_minExports.regexp(/WITHOUT\s+ID/i).skip(parsimmon_umd_minExports.optWhitespace).atMost(1), parsimmon_umd_minExports.sepBy(q.namedField, parsimmon_umd_minExports.string(",").trim(parsimmon_umd_minExports.optWhitespace)), (withoutId, fields) => { - return { type, fields, showId: withoutId.length == 0 }; - })); - } + headerClause: (q) => q.queryType.skip(parsimmon_umd_min.exports.whitespace).chain((qtype) => { + switch (qtype) { + case "table": + return parsimmon_umd_min.exports.seqMap(parsimmon_umd_min.exports.regexp(/WITHOUT\s+ID/i).skip(parsimmon_umd_min.exports.optWhitespace).atMost(1), parsimmon_umd_min.exports.sepBy(q.namedField, parsimmon_umd_min.exports.string(",").trim(parsimmon_umd_min.exports.optWhitespace)), (withoutId, fields) => { + return { type: "table", fields, showId: withoutId.length == 0 }; + }); case "list": - return precededByWhitespaceIfNotEof(() => ({ type, format: void 0, showId: true }), parsimmon_umd_minExports.seqMap(parsimmon_umd_minExports.regexp(/WITHOUT\s+ID/i).skip(parsimmon_umd_minExports.optWhitespace).atMost(1), EXPRESSION.field.atMost(1), (withoutId, format) => { + return parsimmon_umd_min.exports.seqMap(parsimmon_umd_min.exports.regexp(/WITHOUT\s+ID/i).skip(parsimmon_umd_min.exports.optWhitespace).atMost(1), EXPRESSION.field.atMost(1), (withoutId, format) => { return { - type, + type: "list", format: format.length == 1 ? format[0] : void 0, showId: withoutId.length == 0 }; - })); + }); case "task": - return parsimmon_umd_minExports.succeed({ type }); + return parsimmon_umd_min.exports.succeed({ type: "task" }); case "calendar": - return parsimmon_umd_minExports.whitespace.then(parsimmon_umd_minExports.seqMap(q.namedField, (field) => { + return parsimmon_umd_min.exports.seqMap(q.namedField, (field) => { return { - type, + type: "calendar", showId: true, field }; - })); + }); default: - return parsimmon_umd_minExports.fail(`Unrecognized query type '${type}'`); + return parsimmon_umd_min.exports.fail(`Unrecognized query type '${qtype}'`); } }).desc("TABLE or LIST or TASK or CALENDAR"), - fromClause: (q) => parsimmon_umd_minExports.seqMap(parsimmon_umd_minExports.regexp(/FROM/i), parsimmon_umd_minExports.whitespace, EXPRESSION.source, (_1, _2, source) => source), - whereClause: (q) => parsimmon_umd_minExports.seqMap(parsimmon_umd_minExports.regexp(/WHERE/i), parsimmon_umd_minExports.whitespace, EXPRESSION.field, (where, _, field) => { + fromClause: (q) => parsimmon_umd_min.exports.seqMap(parsimmon_umd_min.exports.regexp(/FROM/i), parsimmon_umd_min.exports.whitespace, EXPRESSION.source, (_1, _2, source) => source), + whereClause: (q) => parsimmon_umd_min.exports.seqMap(parsimmon_umd_min.exports.regexp(/WHERE/i), parsimmon_umd_min.exports.whitespace, EXPRESSION.field, (where, _, field) => { return { type: "where", clause: field }; }).desc("WHERE "), - sortByClause: (q) => parsimmon_umd_minExports.seqMap(parsimmon_umd_minExports.regexp(/SORT/i), parsimmon_umd_minExports.whitespace, q.sortField.sepBy1(parsimmon_umd_minExports.string(",").trim(parsimmon_umd_minExports.optWhitespace)), (sort, _1, fields) => { + sortByClause: (q) => parsimmon_umd_min.exports.seqMap(parsimmon_umd_min.exports.regexp(/SORT/i), parsimmon_umd_min.exports.whitespace, q.sortField.sepBy1(parsimmon_umd_min.exports.string(",").trim(parsimmon_umd_min.exports.optWhitespace)), (sort, _1, fields) => { return { type: "sort", fields }; }).desc("SORT field [ASC/DESC]"), - limitClause: (q) => parsimmon_umd_minExports.seqMap(parsimmon_umd_minExports.regexp(/LIMIT/i), parsimmon_umd_minExports.whitespace, EXPRESSION.field, (limit, _1, field) => { + limitClause: (q) => parsimmon_umd_min.exports.seqMap(parsimmon_umd_min.exports.regexp(/LIMIT/i), parsimmon_umd_min.exports.whitespace, EXPRESSION.field, (limit, _1, field) => { return { type: "limit", amount: field }; }).desc("LIMIT "), - flattenClause: (q) => parsimmon_umd_minExports.seqMap(parsimmon_umd_minExports.regexp(/FLATTEN/i).skip(parsimmon_umd_minExports.whitespace), q.namedField, (_, field) => { + flattenClause: (q) => parsimmon_umd_min.exports.seqMap(parsimmon_umd_min.exports.regexp(/FLATTEN/i).skip(parsimmon_umd_min.exports.whitespace), q.namedField, (_, field) => { return { type: "flatten", field }; }).desc("FLATTEN [AS ]"), - groupByClause: (q) => parsimmon_umd_minExports.seqMap(parsimmon_umd_minExports.regexp(/GROUP BY/i).skip(parsimmon_umd_minExports.whitespace), q.namedField, (_, field) => { + groupByClause: (q) => parsimmon_umd_min.exports.seqMap(parsimmon_umd_min.exports.regexp(/GROUP BY/i).skip(parsimmon_umd_min.exports.whitespace), q.namedField, (_, field) => { return { type: "group", field }; }).desc("GROUP BY [AS ]"), // Full query parsing. - clause: (q) => parsimmon_umd_minExports.alt(q.fromClause, q.whereClause, q.sortByClause, q.limitClause, q.groupByClause, q.flattenClause), - query: (q) => parsimmon_umd_minExports.seqMap(q.headerClause.trim(optionalWhitespaceOrComment), q.fromClause.trim(optionalWhitespaceOrComment).atMost(1), q.clause.trim(optionalWhitespaceOrComment).many(), (header, from, clauses) => { + clause: (q) => parsimmon_umd_min.exports.alt(q.fromClause, q.whereClause, q.sortByClause, q.limitClause, q.groupByClause, q.flattenClause), + query: (q) => parsimmon_umd_min.exports.seqMap(q.headerClause.trim(parsimmon_umd_min.exports.optWhitespace), q.fromClause.trim(parsimmon_umd_min.exports.optWhitespace).atMost(1), q.clause.trim(parsimmon_umd_min.exports.optWhitespace).many(), (header, from, clauses) => { return { header, source: from.length == 0 ? Sources.folder("") : from[0], @@ -10386,11 +10302,10 @@ var require_lib = __commonJS({ }; }) }); - var optionalWhitespaceOrComment = parsimmon_umd_minExports.alt(parsimmon_umd_minExports.whitespace, QUERY_LANGUAGE.comment).many().map((arr) => arr.join("")); var getAPI2 = (app) => { var _a2; if (app) - return (_a2 = app.plugins.plugins.dataview) == null ? void 0 : _a2.api; + return (_a2 = app.plugins.plugins.dataview) === null || _a2 === void 0 ? void 0 : _a2.api; else return window.DataviewAPI; }; @@ -10418,7 +10333,7 @@ var init_generateGardenSnapshot = __esm({ import_obsidian18 = require("obsidian"); import_promises = __toESM(require("fs/promises")); SNAPSHOT_PATH = "src/test/snapshot/snapshot.md"; - generateGardenSnapshot = (settings, publisher) => __async(null, null, function* () { + generateGardenSnapshot = (settings, publisher) => __async(void 0, null, function* () { const devPluginPath = settings.devPluginPath; if (!devPluginPath) { new import_obsidian18.Notice("devPluginPath missing, run generateGardenSettings.mjs"); @@ -10749,7 +10664,8 @@ var LimitReachedError = class extends Error { function throwIfLimitError(error) { if (error && typeof error === "object" && "status" in error && error.status === 403) { const responseData = extractResponseData(error); - if (!responseData) return; + if (!responseData) + return; const errorType = responseData.error; if (errorType === "build_limit_reached" || errorType === "storage_limit_exceeded") { throw new LimitReachedError(errorType, responseData); @@ -11347,8 +11263,28 @@ function getUserAgent() { // node_modules/@octokit/core/dist-web/index.js var import_before_after_hook = __toESM(require_before_after_hook()); +// node_modules/is-plain-object/dist/is-plain-object.mjs +function isObject(o) { + return Object.prototype.toString.call(o) === "[object Object]"; +} +function isPlainObject(o) { + var ctor, prot; + if (isObject(o) === false) + return false; + ctor = o.constructor; + if (ctor === void 0) + return true; + prot = ctor.prototype; + if (isObject(prot) === false) + return false; + if (prot.hasOwnProperty("isPrototypeOf") === false) { + return false; + } + return true; +} + // node_modules/@octokit/endpoint/dist-web/index.js -var VERSION2 = "9.0.6"; +var VERSION2 = "9.0.0"; var userAgent = `octokit-endpoint.js/${VERSION2} ${getUserAgent()}`; var DEFAULTS = { method: "GET", @@ -11370,17 +11306,6 @@ function lowercaseKeys(object) { return newObj; }, {}); } -function isPlainObject(value) { - if (typeof value !== "object" || value === null) - return false; - if (Object.prototype.toString.call(value) !== "[object Object]") - return false; - const proto = Object.getPrototypeOf(value); - if (proto === null) - return true; - const Ctor = Object.prototype.hasOwnProperty.call(proto, "constructor") && proto.constructor; - return typeof Ctor === "function" && Ctor instanceof Ctor && Function.prototype.call(Ctor) === Function.prototype.call(value); -} function mergeDeep(defaults2, options) { const result = Object.assign({}, defaults2); Object.keys(options).forEach((key) => { @@ -11438,9 +11363,9 @@ function addQueryParameters(url, parameters) { return `${name}=${encodeURIComponent(parameters[name])}`; }).join("&"); } -var urlVariableRegex = /\{[^{}}]+\}/g; +var urlVariableRegex = /\{[^}]+\}/g; function removeNonChars(variableName) { - return variableName.replace(new RegExp("(?:^\\W+)|(?:(? a.concat(b), []); } function omit(object, keysToOmit) { - const result = { __proto__: null }; - for (const key of Object.keys(object)) { - if (keysToOmit.indexOf(key) === -1) { - result[key] = object[key]; - } - } - return result; + return Object.keys(object).filter((option) => !keysToOmit.includes(option)).reduce((obj, key) => { + obj[key] = object[key]; + return obj; + }, {}); } function encodeReserved(str) { return str.split(/(%[0-9A-Fa-f]{2})/g).map(function(part) { @@ -11552,7 +11474,7 @@ function parseUrl(template) { } function expand(template, context) { var operators = ["+", "#", ".", "/", ";", "?", "&"]; - template = template.replace( + return template.replace( /\{([^\{\}]+)\}|([^\{\}]+)/g, function(_, expression, literal) { if (expression) { @@ -11582,11 +11504,6 @@ function expand(template, context) { } } ); - if (template === "/") { - return template; - } else { - return template.replace(/\/$/, ""); - } } function parse(options) { var _a2; @@ -11621,7 +11538,7 @@ function parse(options) { } if (url.endsWith("/graphql")) { if ((_a2 = options.mediaType.previews) == null ? void 0 : _a2.length) { - const previewsFromAcceptHeader = headers.accept.match(new RegExp("(? { const format = options.mediaType.format ? `.${options.mediaType.format}` : "+json"; return `application/vnd.github.${preview}-preview${format}`; @@ -11702,7 +11619,7 @@ var RequestError = class extends Error { if (options.request.headers.authorization) { requestCopy.headers = Object.assign({}, options.request.headers, { authorization: options.request.headers.authorization.replace( - new RegExp("(? __async(null, null, function* () { + signal: (_c = requestOptions.request) == null ? void 0 : _c.signal + }, requestOptions.body && { duplex: "half" })).then((response) => __async(this, null, function* () { url = response.url; status = response.status; for (const keyAndValue of response.headers) { headers[keyAndValue[0]] = keyAndValue[1]; } if ("deprecation" in headers) { - const matches = headers.link && headers.link.match(/<([^<>]+)>; rel="deprecation"/); + const matches = headers.link && headers.link.match(/<([^>]+)>; rel="deprecation"/); const deprecationLink = matches && matches.pop(); log.warn( `[@octokit/request] "${requestOptions.method} ${requestOptions.url}" is deprecated. It is scheduled to be removed on ${headers.sunset}${deprecationLink ? `. See ${deprecationLink}` : ""}` @@ -11840,15 +11745,7 @@ function fetchWrapper(requestOptions) { throw error; else if (error.name === "AbortError") throw error; - let message = error.message; - if (error.name === "TypeError" && "cause" in error) { - if (error.cause instanceof Error) { - message = error.cause.message; - } else if (typeof error.cause === "string") { - message = error.cause; - } - } - throw new RequestError(message, 500, { + throw new RequestError(error.message, 500, { request: requestOptions }); }); @@ -11857,7 +11754,7 @@ function getResponseData(response) { return __async(this, null, function* () { const contentType = response.headers.get("content-type"); if (/application\/json/.test(contentType)) { - return response.json().catch(() => response.text()).catch(() => ""); + return response.json(); } if (!contentType || /^text\/|charset=utf-8$/.test(contentType)) { return response.text(); @@ -11868,17 +11765,11 @@ function getResponseData(response) { function toErrorMessage(data) { if (typeof data === "string") return data; - let suffix; - if ("documentation_url" in data) { - suffix = ` - ${data.documentation_url}`; - } else { - suffix = ""; - } if ("message" in data) { if (Array.isArray(data.errors)) { - return `${data.message}: ${data.errors.map(JSON.stringify).join(", ")}${suffix}`; + return `${data.message}: ${data.errors.map(JSON.stringify).join(", ")}`; } - return `${data.message}${suffix}`; + return data.message; } return `Unknown error: ${JSON.stringify(data)}`; } @@ -12268,7 +12159,7 @@ var DigitalGardenSiteManager = class { } updateEnv() { return __async(this, null, function* () { - var _a2, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l; + var _a2, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p; const theme = JSON.parse(this.settings.theme); const baseTheme = this.settings.baseTheme; const siteName = this.settings.siteName; @@ -12277,7 +12168,7 @@ var DigitalGardenSiteManager = class { if (this.settings.gardenBaseUrl && !this.settings.gardenBaseUrl.startsWith("ghp_") && !this.settings.gardenBaseUrl.startsWith("github_pat") && this.settings.gardenBaseUrl.contains(".")) { gardenBaseUrl = this.settings.gardenBaseUrl; } - const envValues = __spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues({ + const envValues = __spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues(__spreadValues({ SITE_NAME_HEADER: siteName, SITE_MAIN_LANGUAGE: mainLanguage, SITE_BASE_URL: gardenBaseUrl, @@ -12300,19 +12191,27 @@ var DigitalGardenSiteManager = class { UI_SEARCH_BUTTON_TEXT: this.settings.uiStrings.searchButtonText }), ((_d = this.settings.uiStrings) == null ? void 0 : _d.searchPlaceholder) && { UI_SEARCH_PLACEHOLDER: this.settings.uiStrings.searchPlaceholder - }), ((_e = this.settings.uiStrings) == null ? void 0 : _e.searchEnterHint) && { + }), ((_e = this.settings.uiStrings) == null ? void 0 : _e.searchNotStarted) && { + UI_SEARCH_NOT_STARTED_TEXT: this.settings.uiStrings.searchNotStarted + }), ((_f = this.settings.uiStrings) == null ? void 0 : _f.searchEnterHotkey) && { + UI_SEARCH_ENTER_HOTKEY: this.settings.uiStrings.searchEnterHotkey + }), ((_g = this.settings.uiStrings) == null ? void 0 : _g.searchEnterHint) && { UI_SEARCH_ENTER_HINT: this.settings.uiStrings.searchEnterHint - }), ((_f = this.settings.uiStrings) == null ? void 0 : _f.searchNavigateHint) && { + }), ((_h = this.settings.uiStrings) == null ? void 0 : _h.searchNavigateHotkey) && { + UI_SEARCH_NAVIGATE_HOTKEY: this.settings.uiStrings.searchNavigateHotkey + }), ((_i = this.settings.uiStrings) == null ? void 0 : _i.searchNavigateHint) && { UI_SEARCH_NAVIGATE_HINT: this.settings.uiStrings.searchNavigateHint - }), ((_g = this.settings.uiStrings) == null ? void 0 : _g.searchCloseHint) && { + }), ((_j = this.settings.uiStrings) == null ? void 0 : _j.searchCloseHotkey) && { + UI_SEARCH_CLOSE_HOTKEY: this.settings.uiStrings.searchCloseHotkey + }), ((_k = this.settings.uiStrings) == null ? void 0 : _k.searchCloseHint) && { UI_SEARCH_CLOSE_HINT: this.settings.uiStrings.searchCloseHint - }), ((_h = this.settings.uiStrings) == null ? void 0 : _h.searchNoResults) && { + }), ((_l = this.settings.uiStrings) == null ? void 0 : _l.searchNoResults) && { UI_SEARCH_NO_RESULTS: this.settings.uiStrings.searchNoResults - }), ((_i = this.settings.uiStrings) == null ? void 0 : _i.canvasDragHint) && { + }), ((_m = this.settings.uiStrings) == null ? void 0 : _m.canvasDragHint) && { UI_CANVAS_DRAG_HINT: this.settings.uiStrings.canvasDragHint - }), ((_j = this.settings.uiStrings) == null ? void 0 : _j.canvasZoomHint) && { + }), ((_n = this.settings.uiStrings) == null ? void 0 : _n.canvasZoomHint) && { UI_CANVAS_ZOOM_HINT: this.settings.uiStrings.canvasZoomHint - }), ((_k = this.settings.uiStrings) == null ? void 0 : _k.canvasResetHint) && { + }), ((_o = this.settings.uiStrings) == null ? void 0 : _o.canvasResetHint) && { UI_CANVAS_RESET_HINT: this.settings.uiStrings.canvasResetHint }); if (theme.name !== "default") { @@ -12323,7 +12222,7 @@ var DigitalGardenSiteManager = class { const envSettings = Object.entries(keysToSet).map(([key, value]) => `${key}=${value}`).join("\n"); const base64Settings = gBase64.encode(envSettings); const currentFile = yield (yield this.getUserGardenConnection()).getFile(".env"); - const decodedCurrentFile = gBase64.decode((_l = currentFile == null ? void 0 : currentFile.content) != null ? _l : ""); + const decodedCurrentFile = gBase64.decode((_p = currentFile == null ? void 0 : currentFile.content) != null ? _p : ""); if (decodedCurrentFile === envSettings) { logger3.info("No changes to .env file"); new import_obsidian2.Notice("Settings already up to date!"); @@ -12478,9 +12377,9 @@ var BLOCKREF_REGEX = /(\^\w+([\r\n]|$))/g; var CODE_FENCE_REGEX = /`(.*?)`/g; var CODEBLOCK_REGEX = /```.*?[\r\n][\s\S]+?```/g; var EXCALIDRAW_REGEX = /:\[\[(\d*?,\d*?)\],.*?\]\]/g; -var TRANSCLUDED_SVG_REGEX = /!\[\[(.*?)(\.(svg))\|(.*?)\]\]|!\[\[(.*?)(\.(svg))\]\]/g; +var TRANSCLUDED_SVG_REGEX = /!\[\[(.*?)(\.(svg))\\?\|(.*?)\]\]|!\[\[(.*?)(\.(svg))\]\]/g; var PDF_REGEX = /!\[(.*?)\]\((.*?)(\.pdf)\)/g; -var TRANSCLUDED_PDF_REGEX = /!\[\[(.*?)(\.pdf)\|(.*?)\]\]|!\[\[(.*?)(\.pdf)\]\]/g; +var TRANSCLUDED_PDF_REGEX = /!\[\[(.*?)(\.pdf)\\?\|(.*?)\]\]|!\[\[(.*?)(\.pdf)\]\]/g; // src/compiler/GardenPageCompiler.ts var import_js_logger6 = __toESM(require_logger()); @@ -12496,7 +12395,8 @@ var DataviewCompiler = class { let replacedText = text2; const dataViewRegex = new RegExp("```\\s*dataview\\s(.+?)```", "gms"); const dvApi = (0, import_obsidian_dataview.getAPI)(); - if (!dvApi) return replacedText; + if (!dvApi) + return replacedText; const matches = text2.matchAll(dataViewRegex); const dataviewJsPrefix = dvApi.settings.dataviewJsKeyword; const dataViewJsRegex = new RegExp( @@ -12748,7 +12648,10 @@ var FrontmatterCompiler = class { publishedFrontMatter ); publishedFrontMatter = this.addTimestampsFrontmatter(file)(publishedFrontMatter); - const fullFrontMatter = (publishedFrontMatter == null ? void 0 : publishedFrontMatter.dgPassFrontmatter) ? __spreadValues(__spreadValues({}, fileFrontMatter), publishedFrontMatter) : publishedFrontMatter; + const userProperties = this.extractUserProperties(fileFrontMatter); + const fullFrontMatter = (publishedFrontMatter == null ? void 0 : publishedFrontMatter.dgPassFrontmatter) ? __spreadProps(__spreadValues(__spreadValues({}, fileFrontMatter), publishedFrontMatter), { + "dg-note-properties": userProperties + }) : __spreadProps(__spreadValues({}, publishedFrontMatter), { "dg-note-properties": userProperties }); const frontMatterString = JSON.stringify(fullFrontMatter); return `--- ${frontMatterString} @@ -12855,6 +12758,39 @@ ${frontMatterString} } return publishedFrontMatter; } + /** + * Extracts all user-defined frontmatter properties, excluding + * Obsidian internal fields and dg-* plugin fields that are already + * handled by the compilation pipeline. + */ + extractUserProperties(frontmatter) { + if (!frontmatter) + return {}; + const skipKeys = /* @__PURE__ */ new Set([ + "position", + // Obsidian internal + "dg-publish", + "dg-home", + "dg-path", + "dg-permalink", + "dg-hide", + "dg-hide-in-graph", + "dg-pinned", + "dg-metatags", + "dg-pass-frontmatter", + "dg-content-classes", + "dg-note-icon" + ]); + const userProps = {}; + for (const [key, value] of Object.entries(frontmatter)) { + if (skipKeys.has(key)) + continue; + if (key.startsWith("dg-") || key.startsWith("dg_")) + continue; + userProps[key] = value; + } + return userProps; + } }; // src/compiler/CanvasCompiler.ts @@ -12873,8 +12809,10 @@ var COLOR_PRESETS = { // purple }; function resolveColor(color) { - if (!color) return void 0; - if (color.startsWith("#")) return color; + if (!color) + return void 0; + if (color.startsWith("#")) + return color; return COLOR_PRESETS[color]; } function colorToId(color) { @@ -13204,7 +13142,8 @@ var CanvasCompiler = class { const edgeElements = edges.map((edge) => { const fromNode = nodeMap.get(edge.fromNode); const toNode = nodeMap.get(edge.toNode); - if (!fromNode || !toNode) return ""; + if (!fromNode || !toNode) + return ""; const fromPoint = this.getEdgePoint( fromNode, edge.fromSide || "right" @@ -13779,7 +13718,8 @@ var IANAZone = class _IANAZone extends Zone { /** @override **/ offset(ts) { const date = new Date(ts); - if (isNaN(date)) return NaN; + if (isNaN(date)) + return NaN; const dtf = makeDTF(this.name); let [year, month, day, adOrBc, hour, minute, second] = dtf.formatToParts ? partsOffset(dtf, date) : hackyOffset(dtf, date); if (adOrBc === "BC") { @@ -13940,7 +13880,8 @@ var PolyNumberFormatter = class { const _a2 = opts, { padTo, floor } = _a2, otherOpts = __objRest(_a2, ["padTo", "floor"]); if (!forceSimple || Object.keys(otherOpts).length > 0) { const intlOpts = __spreadValues({ useGrouping: false }, opts); - if (opts.padTo > 0) intlOpts.minimumIntegerDigits = opts.padTo; + if (opts.padTo > 0) + intlOpts.minimumIntegerDigits = opts.padTo; this.inf = getCachedINF(intl, intlOpts); } } @@ -14302,10 +14243,14 @@ function normalizeZone(input, defaultZone2) { return input; } else if (isString(input)) { const lowered = input.toLowerCase(); - if (lowered === "default") return defaultZone2; - else if (lowered === "local" || lowered === "system") return SystemZone.instance; - else if (lowered === "utc" || lowered === "gmt") return FixedOffsetZone.utcInstance; - else return FixedOffsetZone.parseSpecifier(lowered) || IANAZone.create(input); + if (lowered === "default") + return defaultZone2; + else if (lowered === "local" || lowered === "system") + return SystemZone.instance; + else if (lowered === "utc" || lowered === "gmt") + return FixedOffsetZone.utcInstance; + else + return FixedOffsetZone.parseSpecifier(lowered) || IANAZone.create(input); } else if (isNumber(input)) { return FixedOffsetZone.instance(input); } else if (typeof input === "object" && "offset" in input && typeof input.offset === "function") { @@ -14570,7 +14515,8 @@ function weeksInWeekYear(weekYear) { function untruncateYear(year) { if (year > 99) { return year; - } else return year > Settings.twoDigitCutoffYear ? 1900 + year : 2e3 + year; + } else + return year > Settings.twoDigitCutoffYear ? 1900 + year : 2e3 + year; } function parseZoneInfo(ts, offsetFormat, locale, timeZone = null) { const date = new Date(ts), intlOpts = { @@ -14607,7 +14553,8 @@ function normalizeObject(obj, normalizer) { for (const u in obj) { if (hasOwnProperty(obj, u)) { const v = obj[u]; - if (v === void 0 || v === null) continue; + if (v === void 0 || v === null) + continue; normalized[normalizer(u)] = asNumber(v); } } @@ -14883,29 +14830,23 @@ var Formatter = class _Formatter { } }, era = (length) => knownEnglish ? eraForDateTime(dt, length) : string({ era: length }, "era"), tokenToString = (token) => { switch (token) { - // ms case "S": return this.num(dt.millisecond); case "u": - // falls through case "SSS": return this.num(dt.millisecond, 3); - // seconds case "s": return this.num(dt.second); case "ss": return this.num(dt.second, 2); - // fractional seconds case "uu": return this.num(Math.floor(dt.millisecond / 10), 2); case "uuu": return this.num(Math.floor(dt.millisecond / 100)); - // minutes case "m": return this.num(dt.minute); case "mm": return this.num(dt.minute, 2); - // hours case "h": return this.num(dt.hour % 12 === 0 ? 12 : dt.hour % 12); case "hh": @@ -14914,7 +14855,6 @@ var Formatter = class _Formatter { return this.num(dt.hour); case "HH": return this.num(dt.hour, 2); - // offset case "Z": return formatOffset2({ format: "narrow", allowZ: this.opts.allowZ }); case "ZZ": @@ -14925,18 +14865,14 @@ var Formatter = class _Formatter { return dt.zone.offsetName(dt.ts, { format: "short", locale: this.loc.locale }); case "ZZZZZ": return dt.zone.offsetName(dt.ts, { format: "long", locale: this.loc.locale }); - // zone case "z": return dt.zoneName; - // meridiems case "a": return meridiem(); - // dates case "d": return useDateTimeFormatter ? string({ day: "numeric" }, "day") : this.num(dt.day); case "dd": return useDateTimeFormatter ? string({ day: "2-digit" }, "day") : this.num(dt.day, 2); - // weekdays - standalone case "c": return this.num(dt.weekday); case "ccc": @@ -14945,7 +14881,6 @@ var Formatter = class _Formatter { return weekday("long", true); case "ccccc": return weekday("narrow", true); - // weekdays - format case "E": return this.num(dt.weekday); case "EEE": @@ -14954,7 +14889,6 @@ var Formatter = class _Formatter { return weekday("long", false); case "EEEEE": return weekday("narrow", false); - // months - standalone case "L": return useDateTimeFormatter ? string({ month: "numeric", day: "numeric" }, "month") : this.num(dt.month); case "LL": @@ -14965,7 +14899,6 @@ var Formatter = class _Formatter { return month("long", true); case "LLLLL": return month("narrow", true); - // months - format case "M": return useDateTimeFormatter ? string({ month: "numeric" }, "month") : this.num(dt.month); case "MM": @@ -14976,7 +14909,6 @@ var Formatter = class _Formatter { return month("long", false); case "MMMMM": return month("narrow", false); - // years case "y": return useDateTimeFormatter ? string({ year: "numeric" }, "year") : this.num(dt.year); case "yy": @@ -14985,7 +14917,6 @@ var Formatter = class _Formatter { return useDateTimeFormatter ? string({ year: "numeric" }, "year") : this.num(dt.year, 4); case "yyyyyy": return useDateTimeFormatter ? string({ year: "numeric" }, "year") : this.num(dt.year, 6); - // eras case "G": return era("short"); case "GG": @@ -15190,7 +15121,8 @@ function fromStrings(weekdayStr, yearStr, monthStr, dayStr, hourStr, minuteStr, hour: parseInteger(hourStr), minute: parseInteger(minuteStr) }; - if (secondStr) result.second = parseInteger(secondStr); + if (secondStr) + result.second = parseInteger(secondStr); if (weekdayStr) { result.weekday = weekdayStr.length > 3 ? weekdaysLong.indexOf(weekdayStr) + 1 : weekdaysShort.indexOf(weekdayStr) + 1; } @@ -15626,7 +15558,8 @@ var Duration = class _Duration { millisecond: "milliseconds", milliseconds: "milliseconds" }[unit ? unit.toLowerCase() : unit]; - if (!normalized) throw new InvalidUnitError(unit); + if (!normalized) + throw new InvalidUnitError(unit); return normalized; } /** @@ -15694,7 +15627,8 @@ var Duration = class _Duration { * ``` */ toHuman(opts = {}) { - if (!this.isValid) return INVALID; + if (!this.isValid) + return INVALID; const l2 = orderedUnits.map((unit) => { const val = this.values[unit]; if (isUndefined(val)) { @@ -15710,7 +15644,8 @@ var Duration = class _Duration { * @return {Object} */ toObject() { - if (!this.isValid) return {}; + if (!this.isValid) + return {}; return __spreadValues({}, this.values); } /** @@ -15724,19 +15659,27 @@ var Duration = class _Duration { * @return {string} */ toISO() { - if (!this.isValid) return null; + if (!this.isValid) + return null; let s2 = "P"; - if (this.years !== 0) s2 += this.years + "Y"; - if (this.months !== 0 || this.quarters !== 0) s2 += this.months + this.quarters * 3 + "M"; - if (this.weeks !== 0) s2 += this.weeks + "W"; - if (this.days !== 0) s2 += this.days + "D"; + if (this.years !== 0) + s2 += this.years + "Y"; + if (this.months !== 0 || this.quarters !== 0) + s2 += this.months + this.quarters * 3 + "M"; + if (this.weeks !== 0) + s2 += this.weeks + "W"; + if (this.days !== 0) + s2 += this.days + "D"; if (this.hours !== 0 || this.minutes !== 0 || this.seconds !== 0 || this.milliseconds !== 0) s2 += "T"; - if (this.hours !== 0) s2 += this.hours + "H"; - if (this.minutes !== 0) s2 += this.minutes + "M"; + if (this.hours !== 0) + s2 += this.hours + "H"; + if (this.minutes !== 0) + s2 += this.minutes + "M"; if (this.seconds !== 0 || this.milliseconds !== 0) s2 += roundTo(this.seconds + this.milliseconds / 1e3, 3) + "S"; - if (s2 === "P") s2 += "T0S"; + if (s2 === "P") + s2 += "T0S"; return s2; } /** @@ -15756,9 +15699,11 @@ var Duration = class _Duration { * @return {string} */ toISOTime(opts = {}) { - if (!this.isValid) return null; + if (!this.isValid) + return null; const millis = this.toMillis(); - if (millis < 0 || millis >= 864e5) return null; + if (millis < 0 || millis >= 864e5) + return null; opts = __spreadProps(__spreadValues({ suppressMilliseconds: false, suppressSeconds: false, @@ -15789,7 +15734,8 @@ var Duration = class _Duration { * @return {number} */ toMillis() { - if (!this.isValid) return NaN; + if (!this.isValid) + return NaN; return durationToMillis(this.matrix, this.values); } /** @@ -15805,7 +15751,8 @@ var Duration = class _Duration { * @return {Duration} */ plus(duration) { - if (!this.isValid) return this; + if (!this.isValid) + return this; const dur = _Duration.fromDurationLike(duration), result = {}; for (const k of orderedUnits) { if (hasOwnProperty(dur.values, k) || hasOwnProperty(this.values, k)) { @@ -15820,7 +15767,8 @@ var Duration = class _Duration { * @return {Duration} */ minus(duration) { - if (!this.isValid) return this; + if (!this.isValid) + return this; const dur = _Duration.fromDurationLike(duration); return this.plus(dur.negate()); } @@ -15832,7 +15780,8 @@ var Duration = class _Duration { * @return {Duration} */ mapUnits(fn2) { - if (!this.isValid) return this; + if (!this.isValid) + return this; const result = {}; for (const k of Object.keys(this.values)) { result[k] = asNumber(fn2(this.values[k], k)); @@ -15858,7 +15807,8 @@ var Duration = class _Duration { * @return {Duration} */ set(values) { - if (!this.isValid) return this; + if (!this.isValid) + return this; const mixed = __spreadValues(__spreadValues({}, this.values), normalizeObject(values, _Duration.normalizeUnit)); return clone(this, { values: mixed }); } @@ -15899,7 +15849,8 @@ var Duration = class _Duration { * @return {Duration} */ normalize() { - if (!this.isValid) return this; + if (!this.isValid) + return this; const vals = this.toObject(); normalizeValues(this.matrix, vals); return clone(this, { values: vals }, true); @@ -15910,7 +15861,8 @@ var Duration = class _Duration { * @return {Duration} */ rescale() { - if (!this.isValid) return this; + if (!this.isValid) + return this; const vals = removeZeroes(this.normalize().shiftToAll().toObject()); return clone(this, { values: vals }, true); } @@ -15920,7 +15872,8 @@ var Duration = class _Duration { * @return {Duration} */ shiftTo(...units) { - if (!this.isValid) return this; + if (!this.isValid) + return this; if (units.length === 0) { return this; } @@ -15959,7 +15912,8 @@ var Duration = class _Duration { * @return {Duration} */ shiftToAll() { - if (!this.isValid) return this; + if (!this.isValid) + return this; return this.shiftTo( "years", "months", @@ -15977,7 +15931,8 @@ var Duration = class _Duration { * @return {Duration} */ negate() { - if (!this.isValid) return this; + if (!this.isValid) + return this; const negated = {}; for (const k of Object.keys(this.values)) { negated[k] = this.values[k] === 0 ? 0 : -this.values[k]; @@ -16083,7 +16038,8 @@ var Duration = class _Duration { return false; } function eq(v1, v2) { - if (v1 === void 0 || v1 === 0) return v2 === void 0 || v2 === 0; + if (v1 === void 0 || v1 === 0) + return v2 === void 0 || v2 === 0; return v1 === v2; } for (const u of orderedUnits) { @@ -16277,7 +16233,8 @@ var Interval = class _Interval { * @return {number} */ count(unit = "milliseconds") { - if (!this.isValid) return NaN; + if (!this.isValid) + return NaN; const start2 = this.start.startOf(unit), end2 = this.end.startOf(unit); return Math.floor(end2.diff(start2, unit).get(unit)) + (end2.valueOf() !== this.end.valueOf()); } @@ -16302,7 +16259,8 @@ var Interval = class _Interval { * @return {boolean} */ isAfter(dateTime) { - if (!this.isValid) return false; + if (!this.isValid) + return false; return this.s > dateTime; } /** @@ -16311,7 +16269,8 @@ var Interval = class _Interval { * @return {boolean} */ isBefore(dateTime) { - if (!this.isValid) return false; + if (!this.isValid) + return false; return this.e <= dateTime; } /** @@ -16320,7 +16279,8 @@ var Interval = class _Interval { * @return {boolean} */ contains(dateTime) { - if (!this.isValid) return false; + if (!this.isValid) + return false; return this.s <= dateTime && this.e > dateTime; } /** @@ -16331,7 +16291,8 @@ var Interval = class _Interval { * @return {Interval} */ set({ start: start2, end: end2 } = {}) { - if (!this.isValid) return this; + if (!this.isValid) + return this; return _Interval.fromDateTimes(start2 || this.s, end2 || this.e); } /** @@ -16340,7 +16301,8 @@ var Interval = class _Interval { * @return {Array} */ splitAt(...dateTimes) { - if (!this.isValid) return []; + if (!this.isValid) + return []; const sorted = dateTimes.map(friendlyDateTime).filter((d) => this.contains(d)).sort(), results = []; let { s: s2 } = this, i = 0; while (s2 < this.e) { @@ -16379,7 +16341,8 @@ var Interval = class _Interval { * @return {Array} */ divideEqually(numberOfParts) { - if (!this.isValid) return []; + if (!this.isValid) + return []; return this.splitBy(this.length() / numberOfParts).slice(0, numberOfParts); } /** @@ -16396,7 +16359,8 @@ var Interval = class _Interval { * @return {boolean} */ abutsStart(other) { - if (!this.isValid) return false; + if (!this.isValid) + return false; return +this.e === +other.s; } /** @@ -16405,7 +16369,8 @@ var Interval = class _Interval { * @return {boolean} */ abutsEnd(other) { - if (!this.isValid) return false; + if (!this.isValid) + return false; return +other.e === +this.s; } /** @@ -16414,7 +16379,8 @@ var Interval = class _Interval { * @return {boolean} */ engulfs(other) { - if (!this.isValid) return false; + if (!this.isValid) + return false; return this.s <= other.s && this.e >= other.e; } /** @@ -16436,7 +16402,8 @@ var Interval = class _Interval { * @return {Interval} */ intersection(other) { - if (!this.isValid) return this; + if (!this.isValid) + return this; const s2 = this.s > other.s ? this.s : other.s, e = this.e < other.e ? this.e : other.e; if (s2 >= e) { return null; @@ -16451,7 +16418,8 @@ var Interval = class _Interval { * @return {Interval} */ union(other) { - if (!this.isValid) return this; + if (!this.isValid) + return this; const s2 = this.s < other.s ? this.s : other.s, e = this.e > other.e ? this.e : other.e; return _Interval.fromDateTimes(s2, e); } @@ -16516,7 +16484,8 @@ var Interval = class _Interval { * @return {string} */ toString() { - if (!this.isValid) return INVALID2; + if (!this.isValid) + return INVALID2; return `[${this.s.toISO()} \u2013 ${this.e.toISO()})`; } /** @@ -16547,7 +16516,8 @@ var Interval = class _Interval { * @return {string} */ toISO(opts) { - if (!this.isValid) return INVALID2; + if (!this.isValid) + return INVALID2; return `${this.s.toISO(opts)}/${this.e.toISO(opts)}`; } /** @@ -16557,7 +16527,8 @@ var Interval = class _Interval { * @return {string} */ toISODate() { - if (!this.isValid) return INVALID2; + if (!this.isValid) + return INVALID2; return `${this.s.toISODate()}/${this.e.toISODate()}`; } /** @@ -16568,7 +16539,8 @@ var Interval = class _Interval { * @return {string} */ toISOTime(opts) { - if (!this.isValid) return INVALID2; + if (!this.isValid) + return INVALID2; return `${this.s.toISOTime(opts)}/${this.e.toISOTime(opts)}`; } /** @@ -16583,7 +16555,8 @@ var Interval = class _Interval { * @return {string} */ toFormat(dateFormat, { separator = " \u2013 " } = {}) { - if (!this.isValid) return INVALID2; + if (!this.isValid) + return INVALID2; return `${this.s.toFormat(dateFormat)}${separator}${this.e.toFormat(dateFormat)}`; } /** @@ -16932,12 +16905,10 @@ function unitForToken(token, loc) { return literal(t); } switch (t.val) { - // era case "G": return oneOf(loc.eras("short"), 0); case "GG": return oneOf(loc.eras("long"), 0); - // years case "y": return intUnit(oneToSix); case "yy": @@ -16948,7 +16919,6 @@ function unitForToken(token, loc) { return intUnit(fourToSix); case "yyyyyy": return intUnit(six); - // months case "M": return intUnit(oneOrTwo); case "MM": @@ -16965,17 +16935,14 @@ function unitForToken(token, loc) { return oneOf(loc.months("short", false), 1); case "LLLL": return oneOf(loc.months("long", false), 1); - // dates case "d": return intUnit(oneOrTwo); case "dd": return intUnit(two); - // ordinals case "o": return intUnit(oneToThree); case "ooo": return intUnit(three); - // time case "HH": return intUnit(two); case "H": @@ -17006,20 +16973,16 @@ function unitForToken(token, loc) { return simple(oneOrTwo); case "uuu": return intUnit(one); - // meridiem case "a": return oneOf(loc.meridiems(), 0); - // weekYear (k) case "kkkk": return intUnit(four); case "kk": return intUnit(twoToFour, untruncateYear); - // weekNumber (W) case "W": return intUnit(oneOrTwo); case "WW": return intUnit(two); - // weekdays case "E": case "c": return intUnit(one); @@ -17031,18 +16994,13 @@ function unitForToken(token, loc) { return oneOf(loc.weekdays("short", true), 1); case "cccc": return oneOf(loc.weekdays("long", true), 1); - // offset/zone case "Z": case "ZZ": return offset(new RegExp(`([+-]${oneOrTwo.source})(?::(${two.source}))?`), 2); case "ZZZ": return offset(new RegExp(`([+-]${oneOrTwo.source})(${two.source})?`), 2); - // we don't support ZZZZ (PST) or ZZZZZ (Pacific Standard Time) in parsing - // because we don't have any way to figure out what they are case "z": return simple(/[a-z_+-/]{1,256}?/i); - // this special-case "token" represents a place where a macro-token expanded into a white-space literal - // in this case we accept any non-newline white-space case " ": return simple(/[^\S\n\r]/); default: @@ -17347,7 +17305,8 @@ function hasInvalidWeekData(obj) { return unitOutOfRange("week", obj.week); } else if (!validWeekday) { return unitOutOfRange("weekday", obj.weekday); - } else return false; + } else + return false; } function hasInvalidOrdinalData(obj) { const validYear = isInteger(obj.year), validOrdinal = integerBetween(obj.ordinal, 1, daysInYear(obj.year)); @@ -17355,7 +17314,8 @@ function hasInvalidOrdinalData(obj) { return unitOutOfRange("year", obj.year); } else if (!validOrdinal) { return unitOutOfRange("ordinal", obj.ordinal); - } else return false; + } else + return false; } function hasInvalidGregorianData(obj) { const validYear = isInteger(obj.year), validMonth = integerBetween(obj.month, 1, 12), validDay = integerBetween(obj.day, 1, daysInMonth(obj.year, obj.month)); @@ -17365,7 +17325,8 @@ function hasInvalidGregorianData(obj) { return unitOutOfRange("month", obj.month); } else if (!validDay) { return unitOutOfRange("day", obj.day); - } else return false; + } else + return false; } function hasInvalidTimeData(obj) { const { hour, minute, second, millisecond } = obj; @@ -17378,7 +17339,8 @@ function hasInvalidTimeData(obj) { return unitOutOfRange("second", second); } else if (!validMillisecond) { return unitOutOfRange("millisecond", millisecond); - } else return false; + } else + return false; } // node_modules/luxon/src/datetime.js @@ -17479,7 +17441,8 @@ function toTechFormat(dt, format, allowZ = true) { function toISODate(o, extended) { const longFormat = o.c.year > 9999 || o.c.year < 0; let c = ""; - if (longFormat && o.c.year >= 0) c += "+"; + if (longFormat && o.c.year >= 0) + c += "+"; c += padStart(o.c.year, longFormat ? 6 : 4); if (extended) { c += "-"; @@ -17591,7 +17554,8 @@ function normalizeUnit(unit) { weekyears: "weekYear", ordinal: "ordinal" }[unit.toLowerCase()]; - if (!normalized) throw new InvalidUnitError(unit); + if (!normalized) + throw new InvalidUnitError(unit); return normalized; } function quickDT(obj, opts) { @@ -17623,7 +17587,8 @@ function diffRelative(start2, end2, opts) { if (opts.calendary) { if (!end2.hasSame(start2, unit)) { return end2.startOf(unit).diff(start2.startOf(unit), unit).get(unit); - } else return 0; + } else + return 0; } else { return end2.diff(start2, unit).get(unit); } @@ -18479,7 +18444,8 @@ var DateTime = class _DateTime { * @return {DateTime} */ set(values) { - if (!this.isValid) return this; + if (!this.isValid) + return this; const normalized = normalizeObject(values, normalizeUnit), settingWeekStuff = !isUndefined(normalized.weekYear) || !isUndefined(normalized.weekNumber) || !isUndefined(normalized.weekday), containsOrdinal = !isUndefined(normalized.ordinal), containsGregorYear = !isUndefined(normalized.year), containsGregorMD = !isUndefined(normalized.month) || !isUndefined(normalized.day), containsGregor = containsGregorYear || containsGregorMD, definiteWeekDef = normalized.weekYear || normalized.weekNumber; if ((containsGregor || containsOrdinal) && definiteWeekDef) { throw new ConflictingSpecificationError( @@ -18517,7 +18483,8 @@ var DateTime = class _DateTime { * @return {DateTime} */ plus(duration) { - if (!this.isValid) return this; + if (!this.isValid) + return this; const dur = Duration.fromDurationLike(duration); return clone2(this, adjustTime(this, dur)); } @@ -18528,7 +18495,8 @@ var DateTime = class _DateTime { @return {DateTime} */ minus(duration) { - if (!this.isValid) return this; + if (!this.isValid) + return this; const dur = Duration.fromDurationLike(duration).negate(); return clone2(this, adjustTime(this, dur)); } @@ -18543,26 +18511,22 @@ var DateTime = class _DateTime { * @return {DateTime} */ startOf(unit) { - if (!this.isValid) return this; + if (!this.isValid) + return this; const o = {}, normalizedUnit = Duration.normalizeUnit(unit); switch (normalizedUnit) { case "years": o.month = 1; - // falls through case "quarters": case "months": o.day = 1; - // falls through case "weeks": case "days": o.hour = 0; - // falls through case "hours": o.minute = 0; - // falls through case "minutes": o.second = 0; - // falls through case "seconds": o.millisecond = 0; break; @@ -18865,7 +18829,8 @@ var DateTime = class _DateTime { * @return {Object} */ toObject(opts = {}) { - if (!this.isValid) return {}; + if (!this.isValid) + return {}; const base = __spreadValues({}, this.c); if (opts.includeConfig) { base.outputCalendar = this.outputCalendar; @@ -18934,7 +18899,8 @@ var DateTime = class _DateTime { * @return {boolean} */ hasSame(otherDateTime, unit) { - if (!this.isValid) return false; + if (!this.isValid) + return false; const inputMs = otherDateTime.valueOf(); const adjustedToZone = this.setZone(otherDateTime.zone, { keepLocalTime: true }); return adjustedToZone.startOf(unit) <= inputMs && inputMs <= adjustedToZone.endOf(unit); @@ -18968,7 +18934,8 @@ var DateTime = class _DateTime { * @example DateTime.now().minus({ hours: 36 }).toRelative({ round: false }) //=> "1.5 days ago" */ toRelative(options = {}) { - if (!this.isValid) return null; + if (!this.isValid) + return null; const base = options.base || _DateTime.fromObject({}, { zone: this.zone }), padding = options.padding ? this < base ? -options.padding : options.padding : 0; let units = ["years", "months", "days", "hours", "minutes", "seconds"]; let unit = options.unit; @@ -18996,7 +18963,8 @@ var DateTime = class _DateTime { * @example DateTime.now().minus({ days: 2 }).toRelativeCalendar() //=> "2 days ago" */ toRelativeCalendar(options = {}) { - if (!this.isValid) return null; + if (!this.isValid) + return null; return diffRelative(options.base || _DateTime.fromObject({}, { zone: this.zone }), this, __spreadProps(__spreadValues({}, options), { numeric: "auto", units: ["years", "months", "days"], @@ -19414,9 +19382,9 @@ var GardenPageCompiler = class { const [name] = wikilink.substring(start2, end2).split("|"); return (0, import_obsidian5.getLinkpath)(name); }; - this.runCompilerSteps = (file, compilerSteps) => (text2) => __async(null, null, function* () { + this.runCompilerSteps = (file, compilerSteps) => (text2) => __async(this, null, function* () { return yield compilerSteps.reduce( - (previousStep, compilerStep) => __async(null, null, function* () { + (previousStep, compilerStep) => __async(this, null, function* () { const previousStepText = yield previousStep; return compilerStep(file)(previousStepText); }), @@ -19451,7 +19419,8 @@ var GardenPageCompiler = class { const codeFences = text2.match(CODE_FENCE_REGEX) || []; const excalidraw2 = text2.match(EXCALIDRAW_REGEX) || []; const matchesToSkip = [...codeBlocks, ...codeFences, ...excalidraw2]; - if (!obsidianCommentsMatches) return text2; + if (!obsidianCommentsMatches) + return text2; for (const commentMatch of obsidianCommentsMatches) { if (matchesToSkip.findIndex((x) => x.contains(commentMatch)) > -1) { continue; @@ -19464,7 +19433,7 @@ var GardenPageCompiler = class { const compiledFrontmatter = file.getCompiledFrontmatter(); return text2.replace(FRONTMATTER_REGEX, () => compiledFrontmatter); }; - this.convertDataViews = (file) => (text2) => __async(null, null, function* () { + this.convertDataViews = (file) => (text2) => __async(this, null, function* () { const dataviewCompiler = new DataviewCompiler(); return yield dataviewCompiler.compile(file)(text2); }); @@ -19608,6 +19577,13 @@ var GardenPageCompiler = class { transclusionMatch, excaliDrawCode ); + } else if (linkedFile.extension === "base") { + const baseFileText = yield this.vault.read(linkedFile); + const baseCodeBlock = "\n```base\n" + baseFileText + "\n```\n"; + transcludedText = transcludedText.replace( + transclusionMatch, + baseCodeBlock + ); } else if (linkedFile.extension === "md") { let fileText = yield publishLinkedFile.cachedRead(); const metadata = publishLinkedFile.getMetadata(); @@ -19716,7 +19692,7 @@ ${headerSection} if (transcludedSvgs) { for (const svg of transcludedSvgs) { try { - const [imageName, size] = svg.substring(svg.indexOf("[") + 2, svg.indexOf("]")).split("|"); + const [imageName, size] = svg.substring(svg.indexOf("[") + 2, svg.indexOf("]")).split(/\\?\|/); const imagePath = (0, import_obsidian5.getLinkpath)(imageName); if (imagePath === "") { continue; @@ -19746,7 +19722,7 @@ ${headerSection} if (linkedSvgMatches) { for (const svg of linkedSvgMatches) { try { - const [_imageName, size] = svg.substring(svg.indexOf("[") + 2, svg.indexOf("]")).split("|"); + const [_imageName, size] = svg.substring(svg.indexOf("[") + 2, svg.indexOf("]")).split(/\\?\|/); const pathStart = svg.lastIndexOf("(") + 1; const pathEnd = svg.lastIndexOf(")"); const imagePath = svg.substring(pathStart, pathEnd); @@ -19779,7 +19755,7 @@ ${headerSection} var _a2; const text2 = yield file.cachedRead(); const assets = []; - const transcludedImageRegex = /!\[\[(.*?)(\.(png|jpg|jpeg|gif|webp|pdf))\|(.*?)\]\]|!\[\[(.*?)(\.(png|jpg|jpeg|gif|webp|pdf))\]\]/g; + const transcludedImageRegex = /!\[\[(.*?)(\.(png|jpg|jpeg|gif|webp|pdf))\\?\|(.*?)\]\]|!\[\[(.*?)(\.(png|jpg|jpeg|gif|webp|pdf))\]\]/g; const transcludedImageMatches = text2.match(transcludedImageRegex); if (transcludedImageMatches) { for (let i = 0; i < transcludedImageMatches.length; i++) { @@ -19788,7 +19764,7 @@ ${headerSection} const [imageName, _] = imageMatch.substring( imageMatch.indexOf("[") + 2, imageMatch.indexOf("]") - ).split("|"); + ).split(/\\?\|/); const imagePath = (0, import_obsidian5.getLinkpath)(imageName); const linkedFile = this.resolveLinkedFile( imagePath, @@ -19857,7 +19833,7 @@ ${headerSection} const filePath = file.getPath(); const assets = []; let imageText = text2; - const transcludedImageRegex = /!\[\[(.*?)(\.(png|jpg|jpeg|gif|webp))\|(.*?)\]\]|!\[\[(.*?)(\.(png|jpg|jpeg|gif|webp))\]\]/g; + const transcludedImageRegex = /!\[\[(.*?)(\.(png|jpg|jpeg|gif|webp))\\?\|(.*?)\]\]|!\[\[(.*?)(\.(png|jpg|jpeg|gif|webp))\]\]/g; const transcludedImageMatches = text2.match(transcludedImageRegex); if (transcludedImageMatches) { for (let i = 0; i < transcludedImageMatches.length; i++) { @@ -19866,7 +19842,7 @@ ${headerSection} const [imageName, ...metaDataAndSize] = imageMatch.substring( imageMatch.indexOf("[") + 2, imageMatch.indexOf("]") - ).split("|"); + ).split(/\\?\|/); const lastValue = metaDataAndSize[metaDataAndSize.length - 1]; const hasSeveralValues = metaDataAndSize.length > 0; const lastValueIsSize = hasSeveralValues && !isNaN(parseInt(lastValue)); @@ -19893,11 +19869,11 @@ ${headerSection} const cmsImgPath = `/img/user/${linkedFile.path}`; let name = ""; if (metaData && size) { - name = `${imageName}|${metaData}|${size}`; + name = `${imageName}\\|${metaData}\\|${size}`; } else if (size) { - name = `${imageName}|${size}`; + name = `${imageName}\\|${size}`; } else if (metaData && metaData !== "") { - name = `${imageName}|${metaData}`; + name = `${imageName}\\|${metaData}`; } else { name = imageName; } @@ -20278,9 +20254,57 @@ ${headerSection} COMPILE_STEPS )(vaultFileText); const [text2, images] = yield this.convertEmbeddedAssets(file)(compiledText); + const frontmatterImages = yield this.extractFrontmatterAssets(file); + images.push(...frontmatterImages); return [text2, { images }]; }); } + /** + * Scan frontmatter properties for values that look like image paths + * and include them as assets so they get published alongside the note. + */ + extractFrontmatterAssets(file) { + return __async(this, null, function* () { + var _a2; + const assets = []; + const frontmatter = (_a2 = this.metadataCache.getFileCache(file.file)) == null ? void 0 : _a2.frontmatter; + if (!frontmatter) + return assets; + const imageExtensions = /\.(png|jpg|jpeg|gif|webp|svg)$/i; + const scanValue = (value) => __async(this, null, function* () { + if (typeof value === "string" && imageExtensions.test(value)) { + if (value.startsWith("http")) + return; + try { + const linkedFile = this.resolveLinkedFile( + value, + file.getPath() + ); + if (!linkedFile) + return; + const image = yield this.vault.readBinary(linkedFile); + const imageBase64 = (0, import_obsidian5.arrayBufferToBase64)(image); + assets.push({ + path: `/img/user/${linkedFile.path}`, + content: imageBase64, + localHash: generateBlobHashFromBase64(imageBase64) + }); + } catch (e) { + } + } else if (Array.isArray(value)) { + for (const item of value) { + yield scanValue(item); + } + } + }); + for (const [key, value] of Object.entries(frontmatter)) { + if (key === "position") + continue; + yield scanValue(value); + } + return assets; + }); + } generateTransclusionHeader(headerName, transcludedFile) { if (!headerName) { return headerName; @@ -20766,7 +20790,8 @@ function append_styles(target, style_sheet_id, styles) { } } function get_root_for_style(node) { - if (!node) return document; + if (!node) + return document; const root = node.getRootNode ? node.getRootNode() : node.ownerDocument; if (root && /** @type {ShadowRoot} */ root.host) { @@ -20795,7 +20820,8 @@ function detach(node) { } function destroy_each(iterations, detaching) { for (let i = 0; i < iterations.length; i += 1) { - if (iterations[i]) iterations[i].d(detaching); + if (iterations[i]) + iterations[i].d(detaching); } } function element(name) { @@ -20818,15 +20844,18 @@ function listen(node, event, handler, options) { return () => node.removeEventListener(event, handler, options); } function attr(node, attribute, value) { - if (value == null) node.removeAttribute(attribute); - else if (node.getAttribute(attribute) !== value) node.setAttribute(attribute, value); + if (value == null) + node.removeAttribute(attribute); + else if (node.getAttribute(attribute) !== value) + node.setAttribute(attribute, value); } function children(element2) { return Array.from(element2.childNodes); } function set_data(text2, data) { data = "" + data; - if (text2.data === data) return; + if (text2.data === data) + return; text2.data = /** @type {string} */ data; } @@ -20946,7 +20975,8 @@ function set_current_component(component) { current_component = component; } function get_current_component() { - if (!current_component) throw new Error("Function called outside component initialization"); + if (!current_component) + throw new Error("Function called outside component initialization"); return current_component; } function onMount(fn2) { @@ -21011,7 +21041,8 @@ function flush() { set_current_component(null); dirty_components.length = 0; flushidx = 0; - while (binding_callbacks.length) binding_callbacks.pop()(); + while (binding_callbacks.length) + binding_callbacks.pop()(); for (let i = 0; i < render_callbacks.length; i += 1) { const callback = render_callbacks[i]; if (!seen_callbacks.has(callback)) { @@ -21071,12 +21102,14 @@ function transition_in(block, local) { } function transition_out(block, local, detach2, callback) { if (block && block.o) { - if (outroing.has(block)) return; + if (outroing.has(block)) + return; outroing.add(block); outros.c.push(() => { outroing.delete(block); if (callback) { - if (detach2) block.d(1); + if (detach2) + block.d(1); callback(); } }); @@ -21090,7 +21123,8 @@ function transition_out(block, local, detach2, callback) { function handle_promise(promise, info) { const token = info.token = {}; function update2(type, index, key, value) { - if (info.token !== token) return; + if (info.token !== token) + return; info.resolved = value; let child_ctx = info.ctx; if (key !== void 0) { @@ -21121,7 +21155,8 @@ function handle_promise(promise, info) { needs_flush = true; } info.block = block; - if (info.blocks) info.blocks[index] = block; + if (info.blocks) + info.blocks[index] = block; if (needs_flush) { flush(); } @@ -21242,7 +21277,7 @@ function make_dirty(component, i) { } component.$$.dirty[i / 31 | 0] |= 1 << i % 31; } -function init(component, options, instance9, create_fragment9, not_equal, props, append_styles2 = null, dirty = [-1]) { +function init(component, options, instance9, create_fragment9, not_equal, props, append_styles2, dirty = [-1]) { const parent_component = current_component; set_current_component(component); const $$ = component.$$ = { @@ -21271,8 +21306,10 @@ function init(component, options, instance9, create_fragment9, not_equal, props, $$.ctx = instance9 ? instance9(component, options.props || {}, (i, ret, ...rest) => { const value = rest.length ? rest[0] : ret; if ($$.ctx && not_equal($$.ctx[i], $$.ctx[i] = value)) { - if (!$$.skip_bound && $$.bound[i]) $$.bound[i](value); - if (ready) make_dirty(component, i); + if (!$$.skip_bound && $$.bound[i]) + $$.bound[i](value); + if (ready) + make_dirty(component, i); } return ret; }) : []; @@ -21289,7 +21326,8 @@ function init(component, options, instance9, create_fragment9, not_equal, props, } else { $$.fragment && $$.fragment.c(); } - if (options.intro) transition_in(component.$$.fragment); + if (options.intro) + transition_in(component.$$.fragment); mount_component(component, options.target, options.anchor); end_hydrating(); flush(); @@ -21343,12 +21381,6 @@ if (typeof HTMLElement === "function") { this.$$l_u.delete(listener); } } - if (this.$$l[type]) { - const idx = this.$$l[type].indexOf(listener); - if (idx >= 0) { - this.$$l[type].splice(idx, 1); - } - } } connectedCallback() { return __async(this, null, function* () { @@ -21381,7 +21413,7 @@ if (typeof HTMLElement === "function") { }; }; yield Promise.resolve(); - if (!this.$$cn || this.$$c) { + if (!this.$$cn) { return; } const $$slots = {}; @@ -21397,12 +21429,6 @@ if (typeof HTMLElement === "function") { this.$$d[name] = get_custom_element_value(name, attribute.value, this.$$p_d, "toProp"); } } - for (const key in this.$$p_d) { - if (!(key in this.$$d) && this[key] !== void 0) { - this.$$d[key] = this[key]; - delete this[key]; - } - } this.$$c = new this.$$ctor({ target: this.shadowRoot || this, props: __spreadProps(__spreadValues({}, this.$$d), { @@ -21424,7 +21450,7 @@ if (typeof HTMLElement === "function") { "toAttribute" ); if (attribute_value == null) { - this.removeAttribute(this.$$p_d[key].attribute || key); + this.removeAttribute(key); } else { this.setAttribute(this.$$p_d[key].attribute || key, attribute_value); } @@ -21448,7 +21474,8 @@ if (typeof HTMLElement === "function") { // and setting attributes through setAttribute etc, this is helpful attributeChangedCallback(attr2, _oldValue, newValue) { var _a2; - if (this.$$r) return; + if (this.$$r) + return; attr2 = this.$$g_p(attr2); this.$$d[attr2] = get_custom_element_value(attr2, newValue, this.$$p_d, "toProp"); (_a2 = this.$$c) == null ? void 0 : _a2.$set({ [attr2]: this.$$d[attr2] }); @@ -21456,7 +21483,7 @@ if (typeof HTMLElement === "function") { disconnectedCallback() { this.$$cn = false; Promise.resolve().then(() => { - if (!this.$$cn && this.$$c) { + if (!this.$$cn) { this.$$c.$destroy(); this.$$c = void 0; } @@ -21494,7 +21521,6 @@ function get_custom_element_value(prop, value, props_definition, transform) { return value && JSON.parse(value); case "Boolean": return value; - // conversion already handled above case "Number": return value != null ? +value : value; default: @@ -21540,7 +21566,8 @@ var SvelteComponent = class { callbacks.push(callback); return () => { const index = callbacks.indexOf(callback); - if (index !== -1) callbacks.splice(index, 1); + if (index !== -1) + callbacks.splice(index, 1); }; } /** @@ -21621,7 +21648,8 @@ function create_fragment(ctx) { 1 && raw_value !== (raw_value = ((_a3 = (0, import_obsidian7.getIcon)( /*name*/ ctx2[0] - )) == null ? void 0 : _a3.outerHTML) + "")) html_tag.p(raw_value); + )) == null ? void 0 : _a3.outerHTML) + "")) + html_tag.p(raw_value); }, i: noop, o: noop, @@ -21636,7 +21664,8 @@ function create_fragment(ctx) { function instance($$self, $$props, $$invalidate) { let { name = "" } = $$props; $$self.$$set = ($$props2) => { - if ("name" in $$props2) $$invalidate(0, name = $$props2.name); + if ("name" in $$props2) + $$invalidate(0, name = $$props2.name); }; return [name]; } @@ -21690,12 +21719,14 @@ function create_if_block_5(ctx) { t0 = space(); create_component(icon.$$.fragment); t1 = space(); - if (if_block0) if_block0.c(); + if (if_block0) + if_block0.c(); t2 = space(); span1 = element("span"); t3 = text(t3_value); t4 = space(); - if (if_block1) if_block1.c(); + if (if_block1) + if_block1.c(); attr(span0, "class", "no-arrow svelte-gsbdto"); }, m(target, anchor) { @@ -21704,12 +21735,14 @@ function create_if_block_5(ctx) { append(span2, t0); mount_component(icon, span2, null); append(span2, t1); - if (if_block0) if_block0.m(span2, null); + if (if_block0) + if_block0.m(span2, null); append(span2, t2); append(span2, span1); append(span1, t3); append(span2, t4); - if (if_block1) if_block1.m(span2, null); + if (if_block1) + if_block1.m(span2, null); current = true; if (!mounted) { dispose = listen( @@ -21737,11 +21770,13 @@ function create_if_block_5(ctx) { } if ((!current || dirty & /*tree*/ 1) && t3_value !== (t3_value = /*tree*/ - ctx2[0].name + "")) set_data(t3, t3_value); + ctx2[0].name + "")) + set_data(t3, t3_value); if (dirty & /*enableShowDiff, tree*/ - 5) show_if = /*enableShowDiff*/ - ctx2[2] && !/*tree*/ - ctx2[0].path.endsWith(".canvas"); + 5) + show_if = /*enableShowDiff*/ + ctx2[2] && !/*tree*/ + ctx2[0].path.endsWith(".canvas"); if (show_if) { if (if_block1) { if_block1.p(ctx2, dirty); @@ -21764,7 +21799,8 @@ function create_if_block_5(ctx) { } }, i(local) { - if (current) return; + if (current) + return; transition_in(icon.$$.fragment, local); transition_in(if_block1); current = true; @@ -21779,8 +21815,10 @@ function create_if_block_5(ctx) { detach(span2); } destroy_component(icon); - if (if_block0) if_block0.d(); - if (if_block1) if_block1.d(); + if (if_block0) + if_block0.d(); + if (if_block1) + if_block1.d(); mounted = false; dispose(); } @@ -21803,7 +21841,8 @@ function create_if_block(ctx) { const if_blocks = []; function select_block_type_1(ctx2, dirty) { if (!/*isRoot*/ - ctx2[5]) return 0; + ctx2[5]) + return 0; return 1; } current_block_type_index = select_block_type_1(ctx, -1); @@ -21820,7 +21859,8 @@ function create_if_block(ctx) { t0 = space(); if_block0.c(); t1 = space(); - if (if_block1) if_block1.c(); + if (if_block1) + if_block1.c(); if_block1_anchor = empty(); attr(span0, "class", "arrow svelte-gsbdto"); toggle_class( @@ -21837,7 +21877,8 @@ function create_if_block(ctx) { append(span1, t0); if_blocks[current_block_type_index].m(span1, null); insert(target, t1, anchor); - if (if_block1) if_block1.m(target, anchor); + if (if_block1) + if_block1.m(target, anchor); insert(target, if_block1_anchor, anchor); current = true; if (!mounted) { @@ -21886,7 +21927,8 @@ function create_if_block(ctx) { } }, i(local) { - if (current) return; + if (current) + return; transition_in(icon.$$.fragment, local); transition_in(if_block0); transition_in(if_block1); @@ -21906,7 +21948,8 @@ function create_if_block(ctx) { } destroy_component(icon); if_blocks[current_block_type_index].d(); - if (if_block1) if_block1.d(detaching); + if (if_block1) + if_block1.d(detaching); mounted = false; dispose(); } @@ -21962,12 +22005,13 @@ function create_if_block_7(ctx) { input.checked = input_checked_value; } if (setIndeterminate_action && is_function(setIndeterminate_action.update) && dirty & /*tree*/ - 1) setIndeterminate_action.update.call(null, { - indeterminate: ( - /*tree*/ - ctx2[0].indeterminate - ) - }); + 1) + setIndeterminate_action.update.call(null, { + indeterminate: ( + /*tree*/ + ctx2[0].indeterminate + ) + }); }, d(detaching) { if (detaching) { @@ -22008,7 +22052,8 @@ function create_if_block_6(ctx) { }, p: noop, i(local) { - if (current) return; + if (current) + return; transition_in(icon.$$.fragment, local); current = true; }, @@ -22040,14 +22085,16 @@ function create_else_block(ctx) { ctx[1] && create_if_block_4(ctx); return { c() { - if (if_block) if_block.c(); + if (if_block) + if_block.c(); t0 = space(); span = element("span"); t1 = text(t1_value); attr(span, "class", "root-header svelte-gsbdto"); }, m(target, anchor) { - if (if_block) if_block.m(target, anchor); + if (if_block) + if_block.m(target, anchor); insert(target, t0, anchor); insert(target, span, anchor); append(span, t1); @@ -22077,7 +22124,8 @@ function create_else_block(ctx) { } if (dirty & /*tree*/ 1 && t1_value !== (t1_value = /*tree*/ - ctx2[0].name + "")) set_data(t1, t1_value); + ctx2[0].name + "")) + set_data(t1, t1_value); }, i: noop, o: noop, @@ -22086,7 +22134,8 @@ function create_else_block(ctx) { detach(t0); detach(span); } - if (if_block) if_block.d(detaching); + if (if_block) + if_block.d(detaching); mounted = false; dispose(); } @@ -22112,7 +22161,8 @@ function create_if_block_2(ctx) { c() { create_component(icon.$$.fragment); t0 = space(); - if (if_block) if_block.c(); + if (if_block) + if_block.c(); t1 = space(); span = element("span"); t2 = text(t2_value); @@ -22120,7 +22170,8 @@ function create_if_block_2(ctx) { m(target, anchor) { mount_component(icon, target, anchor); insert(target, t0, anchor); - if (if_block) if_block.m(target, anchor); + if (if_block) + if_block.m(target, anchor); insert(target, t1, anchor); insert(target, span, anchor); append(span, t2); @@ -22151,10 +22202,12 @@ function create_if_block_2(ctx) { } if ((!current || dirty & /*tree*/ 1) && t2_value !== (t2_value = /*tree*/ - ctx2[0].name + "")) set_data(t2, t2_value); + ctx2[0].name + "")) + set_data(t2, t2_value); }, i(local) { - if (current) return; + if (current) + return; transition_in(icon.$$.fragment, local); current = true; }, @@ -22169,7 +22222,8 @@ function create_if_block_2(ctx) { detach(span); } destroy_component(icon, detaching); - if (if_block) if_block.d(detaching); + if (if_block) + if_block.d(detaching); mounted = false; dispose(); } @@ -22225,12 +22279,13 @@ function create_if_block_4(ctx) { input.checked = input_checked_value; } if (setIndeterminate_action && is_function(setIndeterminate_action.update) && dirty & /*tree*/ - 1) setIndeterminate_action.update.call(null, { - indeterminate: ( - /*tree*/ - ctx2[0].indeterminate - ) - }); + 1) + setIndeterminate_action.update.call(null, { + indeterminate: ( + /*tree*/ + ctx2[0].indeterminate + ) + }); }, d(detaching) { if (detaching) { @@ -22291,12 +22346,13 @@ function create_if_block_3(ctx) { input.checked = input_checked_value; } if (setIndeterminate_action && is_function(setIndeterminate_action.update) && dirty & /*tree*/ - 1) setIndeterminate_action.update.call(null, { - indeterminate: ( - /*tree*/ - ctx2[0].indeterminate - ) - }); + 1) + setIndeterminate_action.update.call(null, { + indeterminate: ( + /*tree*/ + ctx2[0].indeterminate + ) + }); }, d(detaching) { if (detaching) { @@ -22365,7 +22421,8 @@ function create_if_block_1(ctx) { } }, i(local) { - if (current) return; + if (current) + return; for (let i = 0; i < each_value.length; i += 1) { transition_in(each_blocks[i]); } @@ -22426,18 +22483,22 @@ function create_each_block(ctx) { p(ctx2, dirty) { const treenode_changes = {}; if (dirty & /*enableShowDiff*/ - 4) treenode_changes.enableShowDiff = /*enableShowDiff*/ - ctx2[2]; + 4) + treenode_changes.enableShowDiff = /*enableShowDiff*/ + ctx2[2]; if (dirty & /*readOnly*/ - 2) treenode_changes.readOnly = /*readOnly*/ - ctx2[1]; + 2) + treenode_changes.readOnly = /*readOnly*/ + ctx2[1]; if (dirty & /*tree*/ - 1) treenode_changes.tree = /*child*/ - ctx2[14]; + 1) + treenode_changes.tree = /*child*/ + ctx2[14]; treenode.$set(treenode_changes); }, i(local) { - if (current) return; + if (current) + return; transition_in(treenode.$$.fragment, local); current = true; }, @@ -22462,9 +22523,11 @@ function create_fragment2(ctx) { if ( /*tree*/ ctx2[0].children - ) return 0; + ) + return 0; if (!/*isRoot*/ - ctx2[5]) return 1; + ctx2[5]) + return 1; return -1; } if (~(current_block_type_index = select_block_type(ctx, -1))) { @@ -22474,7 +22537,8 @@ function create_fragment2(ctx) { c() { ul = element("ul"); li = element("li"); - if (if_block) if_block.c(); + if (if_block) + if_block.c(); attr(li, "class", "svelte-gsbdto"); attr(ul, "class", "svelte-gsbdto"); toggle_class( @@ -22523,7 +22587,8 @@ function create_fragment2(ctx) { } }, i(local) { - if (current) return; + if (current) + return; transition_in(if_block); current = true; }, @@ -22572,14 +22637,18 @@ function instance2($$self, $$props, $$invalidate) { }; const showDiff_handler = (e) => dispatchShowDiff(e.detail.node); $$self.$$set = ($$props2) => { - if ("tree" in $$props2) $$invalidate(0, tree = $$props2.tree); - if ("readOnly" in $$props2) $$invalidate(1, readOnly = $$props2.readOnly); - if ("enableShowDiff" in $$props2) $$invalidate(2, enableShowDiff = $$props2.enableShowDiff); + if ("tree" in $$props2) + $$invalidate(0, tree = $$props2.tree); + if ("readOnly" in $$props2) + $$invalidate(1, readOnly = $$props2.readOnly); + if ("enableShowDiff" in $$props2) + $$invalidate(2, enableShowDiff = $$props2.enableShowDiff); }; $$self.$$.update = () => { if ($$self.$$.dirty & /*expanded*/ 8) { - $: $$invalidate(4, arrowDown = expanded); + $: + $$invalidate(4, arrowDown = expanded); } }; return [ @@ -22650,18 +22719,22 @@ function create_fragment3(ctx) { p(ctx2, [dirty]) { const node_changes = {}; if (dirty & /*tree*/ - 1) node_changes.tree = /*tree*/ - ctx2[0]; + 1) + node_changes.tree = /*tree*/ + ctx2[0]; if (dirty & /*readOnly*/ - 2) node_changes.readOnly = /*readOnly*/ - ctx2[1]; + 2) + node_changes.readOnly = /*readOnly*/ + ctx2[1]; if (dirty & /*enableShowDiff*/ - 4) node_changes.enableShowDiff = /*enableShowDiff*/ - ctx2[2]; + 4) + node_changes.enableShowDiff = /*enableShowDiff*/ + ctx2[2]; node.$set(node_changes); }, i(local) { - if (current) return; + if (current) + return; transition_in(node.$$.fragment, local); current = true; }, @@ -22680,7 +22753,8 @@ function create_fragment3(ctx) { function rebuildChildren(node, checkAsParent = true) { if (node.children) { for (const child of node.children) { - if (checkAsParent) child.checked = !!node.checked; + if (checkAsParent) + child.checked = !!node.checked; rebuildChildren(child, checkAsParent); } node.indeterminate = node.children.some((c) => c.indeterminate) || node.children.some((c) => !!c.checked) && node.children.some((c) => !c.checked); @@ -22727,10 +22801,14 @@ function instance3($$self, $$props, $$invalidate) { rebuildTree({ detail: { node: tree } }, false); const showDiff_handler = (e) => showDiff(e.detail.node.path); $$self.$$set = ($$props2) => { - if ("tree" in $$props2) $$invalidate(0, tree = $$props2.tree); - if ("readOnly" in $$props2) $$invalidate(1, readOnly = $$props2.readOnly); - if ("enableShowDiff" in $$props2) $$invalidate(2, enableShowDiff = $$props2.enableShowDiff); - if ("showDiff" in $$props2) $$invalidate(3, showDiff = $$props2.showDiff); + if ("tree" in $$props2) + $$invalidate(0, tree = $$props2.tree); + if ("readOnly" in $$props2) + $$invalidate(1, readOnly = $$props2.readOnly); + if ("enableShowDiff" in $$props2) + $$invalidate(2, enableShowDiff = $$props2.enableShowDiff); + if ("showDiff" in $$props2) + $$invalidate(3, showDiff = $$props2.showDiff); }; return [tree, readOnly, enableShowDiff, showDiff, rebuildTree, showDiff_handler]; } @@ -22749,21 +22827,21 @@ var TreeView_default = TreeView; // src/views/PublicationCenter/PublicationCenter.svelte function add_css2(target) { - append_styles(target, "svelte-ghd9h6", ".title-separator.svelte-ghd9h6{margin-top:0px;margin-bottom:15px}.footer-separator.svelte-ghd9h6{margin-top:15px;margin-bottom:15px}.footer.svelte-ghd9h6{display:flex;justify-content:flex-end}.loading-msg.svelte-ghd9h6{font-size:1.2rem;display:flex;align-items:center;flex-direction:column}button.svelte-ghd9h6{background-color:var(--interactive-accent);color:var(--text-on-accent);cursor:pointer;font-weight:bold}.loading-container.svelte-ghd9h6{width:100%;height:5px;margin-top:10px}.loading-bar.svelte-ghd9h6{background-color:var(--interactive-accent);height:100%;transition:all 0.5s ease-in-out}.published.svelte-ghd9h6{color:#8bff8b}.deleted.svelte-ghd9h6{color:#ff5757}.warning.svelte-ghd9h6{background-color:rgba(255, 150, 0, 0.1);border:1px solid rgba(255, 150, 0, 0.2);border-radius:4px;padding:10px;margin-bottom:15px}.callout-title.svelte-ghd9h6{font-weight:bold;margin-bottom:8px}.problematic-file.svelte-ghd9h6{display:flex;flex-direction:column;margin:5px 0;padding:5px 0;border-bottom:1px solid rgba(255, 150, 0, 0.1)}.file-path.svelte-ghd9h6{font-family:monospace;color:var(--text-muted)}.file-issue.svelte-ghd9h6{font-size:0.9em;margin-top:2px}"); + append_styles(target, "svelte-1eqmrov", ".title-separator.svelte-1eqmrov{margin-top:0px;margin-bottom:15px}.footer-separator.svelte-1eqmrov{margin-top:15px;margin-bottom:15px}.footer.svelte-1eqmrov{display:flex;justify-content:flex-end}.loading-msg.svelte-1eqmrov{font-size:1.2rem;display:flex;align-items:center;flex-direction:column}button.svelte-1eqmrov{background-color:var(--interactive-accent);color:var(--text-on-accent);cursor:pointer;font-weight:bold}.loading-container.svelte-1eqmrov{width:100%;height:5px;margin-top:10px}.loading-bar.svelte-1eqmrov{background-color:var(--interactive-accent);height:100%;transition:all 0.5s ease-in-out}.published.svelte-1eqmrov{color:#8bff8b}.deleted.svelte-1eqmrov{color:#ff5757}.warning.svelte-1eqmrov{background-color:rgba(255, 150, 0, 0.1);border:1px solid rgba(255, 150, 0, 0.2);border-radius:4px;padding:10px;margin-bottom:15px}.info.svelte-1eqmrov{background-color:rgba(0, 150, 255, 0.1);border:1px solid rgba(0, 150, 255, 0.2);border-radius:4px;padding:10px;margin-bottom:15px}.callout-header.svelte-1eqmrov{display:flex;justify-content:space-between;align-items:center}.dismiss-btn.svelte-1eqmrov{background:none;border:none;cursor:pointer;color:var(--text-muted);padding:2px;display:flex;align-items:center}.dismiss-btn.svelte-1eqmrov:hover{color:var(--text-normal)}.callout-title.svelte-1eqmrov{font-weight:bold;margin-bottom:8px}.problematic-file.svelte-1eqmrov{display:flex;flex-direction:column;margin:5px 0;padding:5px 0;border-bottom:1px solid rgba(255, 150, 0, 0.1)}.file-path.svelte-1eqmrov{font-family:monospace;color:var(--text-muted)}.file-issue.svelte-1eqmrov{font-size:0.9em;margin-top:2px}"); } function get_each_context_1(ctx, list, i) { const child_ctx = ctx.slice(); - child_ctx[28] = list[i]; + child_ctx[32] = list[i]; return child_ctx; } function get_each_context_2(ctx, list, i) { const child_ctx = ctx.slice(); - child_ctx[31] = list[i]; + child_ctx[35] = list[i]; return child_ctx; } function get_each_context2(ctx, list, i) { const child_ctx = ctx.slice(); - child_ctx[25] = list[i]; + child_ctx[29] = list[i]; return child_ctx; } function create_else_block2(ctx) { @@ -22794,7 +22872,7 @@ function create_else_block2(ctx) { let dispose; let if_block = ( /*failedPublish*/ - ctx[17].length > 0 && create_if_block_10(ctx) + ctx[21].length > 0 && create_if_block_122(ctx) ); let each_value_2 = ensure_array_like( /*unpublishedToPublish*/ @@ -22831,7 +22909,8 @@ function create_else_block2(ctx) { div1 = element("div"); t2 = text(t2_value); t3 = space(); - if (if_block) if_block.c(); + if (if_block) + if_block.c(); t4 = space(); div3 = element("div"); div2 = element("div"); @@ -22850,18 +22929,18 @@ function create_else_block2(ctx) { button = element("button"); button.textContent = "DONE"; attr(div0, "class", "callout-title-inner"); - attr(div2, "class", "loading-bar svelte-ghd9h6"); + attr(div2, "class", "loading-bar svelte-1eqmrov"); set_style( div2, "width", /*publishProgress*/ - ctx[13] + "%" + ctx[15] + "%" ); - attr(div3, "class", "loading-container svelte-ghd9h6"); + attr(div3, "class", "loading-container svelte-1eqmrov"); attr(div4, "class", "callout"); - attr(hr, "class", "footer-separator svelte-ghd9h6"); - attr(button, "class", "svelte-ghd9h6"); - attr(div5, "class", "footer svelte-ghd9h6"); + attr(hr, "class", "footer-separator svelte-1eqmrov"); + attr(button, "class", "svelte-1eqmrov"); + attr(div5, "class", "footer svelte-1eqmrov"); }, m(target, anchor) { insert(target, div6, anchor); @@ -22871,7 +22950,8 @@ function create_else_block2(ctx) { append(div4, div1); append(div1, t2); append(div4, t3); - if (if_block) if_block.m(div4, null); + if (if_block) + if_block.m(div4, null); append(div4, t4); append(div4, div3); append(div3, div2); @@ -22898,7 +22978,8 @@ function create_else_block2(ctx) { if (is_function( /*close*/ ctx[1] - )) ctx[1].apply(this, arguments); + )) + ctx[1].apply(this, arguments); }); mounted = true; } @@ -22910,22 +22991,24 @@ function create_else_block2(ctx) { ctx[6].length} of ${/*unpublishedToPublish*/ ctx[3].length + /*changedToPublish*/ ctx[4].length + /*pathsToDelete*/ - ctx[5].length} notes published`)) set_data(t2, t2_value); + ctx[5].length} notes published`)) + set_data(t2, t2_value); if ( /*failedPublish*/ - ctx[17].length > 0 - ) if_block.p(ctx, dirty); + ctx[21].length > 0 + ) + if_block.p(ctx, dirty); if (!current || dirty[0] & /*publishProgress*/ - 8192) { + 32768) { set_style( div2, "width", /*publishProgress*/ - ctx[13] + "%" + ctx[15] + "%" ); } if (dirty[0] & /*publishedPaths, unpublishedToPublish, changedToPublish, rotatingCog, processingPaths, failedPublish*/ - 164440) { + 2623576) { each_value_2 = ensure_array_like( /*unpublishedToPublish*/ ctx[3].concat( @@ -22953,7 +23036,7 @@ function create_else_block2(ctx) { check_outros(); } if (dirty[0] & /*publishedPaths, pathsToDelete, rotatingCog, processingPaths*/ - 33376) { + 526432) { each_value_1 = ensure_array_like( /*pathsToDelete*/ ctx[5] @@ -22979,7 +23062,8 @@ function create_else_block2(ctx) { } }, i(local) { - if (current) return; + if (current) + return; for (let i = 0; i < each_value_2.length; i += 1) { transition_in(each_blocks_1[i]); } @@ -23003,7 +23087,8 @@ function create_else_block2(ctx) { if (detaching) { detach(div6); } - if (if_block) if_block.d(); + if (if_block) + if_block.d(); destroy_each(each_blocks_1, detaching); destroy_each(each_blocks, detaching); mounted = false; @@ -23014,32 +23099,42 @@ function create_else_block2(ctx) { function create_if_block_12(ctx) { var _a2, _b, _c, _d; let t0; - let treeview0; let t1; - let treeview1; let t2; - let treeview2; + let treeview0; let t3; - let treeview3; + let treeview1; let t4; - let hr; + let treeview2; let t5; + let treeview3; + let t6; + let hr; + let t7; let div; let button; let current; let mounted; let dispose; - let if_block = ( + let if_block0 = ( /*problematicFiles*/ - ctx[8].length > 0 && create_if_block_22(ctx) + ctx[8].length > 0 && create_if_block_42(ctx) + ); + let if_block1 = ( + /*showImageFixNotice*/ + ctx[9] && create_if_block_32(ctx) + ); + let if_block2 = ( + /*showBasesNotice*/ + ctx[10] && create_if_block_22(ctx) ); treeview0 = new TreeView_default({ props: { tree: ( /*unpublishedNoteTree*/ - (_a2 = ctx[12]) != null ? _a2 : ( + (_a2 = ctx[14]) != null ? _a2 : ( /*emptyNode*/ - ctx[19] + ctx[23] ) ), showDiff: ( @@ -23052,9 +23147,9 @@ function create_if_block_12(ctx) { props: { tree: ( /*changedNotesTree*/ - (_b = ctx[11]) != null ? _b : ( + (_b = ctx[13]) != null ? _b : ( /*emptyNode*/ - ctx[19] + ctx[23] ) ), showDiff: ( @@ -23068,9 +23163,9 @@ function create_if_block_12(ctx) { props: { tree: ( /*deletedNoteTree*/ - (_c = ctx[10]) != null ? _c : ( + (_c = ctx[12]) != null ? _c : ( /*emptyNode*/ - ctx[19] + ctx[23] ) ), showDiff: ( @@ -23084,9 +23179,9 @@ function create_if_block_12(ctx) { readOnly: true, tree: ( /*publishedNotesTree*/ - (_d = ctx[14]) != null ? _d : ( + (_d = ctx[16]) != null ? _d : ( /*emptyNode*/ - ctx[19] + ctx[23] ) ), showDiff: ( @@ -23097,38 +23192,52 @@ function create_if_block_12(ctx) { }); return { c() { - if (if_block) if_block.c(); + if (if_block0) + if_block0.c(); t0 = space(); - create_component(treeview0.$$.fragment); + if (if_block1) + if_block1.c(); t1 = space(); - create_component(treeview1.$$.fragment); + if (if_block2) + if_block2.c(); t2 = space(); - create_component(treeview2.$$.fragment); + create_component(treeview0.$$.fragment); t3 = space(); - create_component(treeview3.$$.fragment); + create_component(treeview1.$$.fragment); t4 = space(); - hr = element("hr"); + create_component(treeview2.$$.fragment); t5 = space(); + create_component(treeview3.$$.fragment); + t6 = space(); + hr = element("hr"); + t7 = space(); div = element("div"); button = element("button"); button.textContent = "PUBLISH SELECTED"; - attr(hr, "class", "footer-separator svelte-ghd9h6"); - attr(button, "class", "svelte-ghd9h6"); - attr(div, "class", "footer svelte-ghd9h6"); + attr(hr, "class", "footer-separator svelte-1eqmrov"); + attr(button, "class", "svelte-1eqmrov"); + attr(div, "class", "footer svelte-1eqmrov"); }, m(target, anchor) { - if (if_block) if_block.m(target, anchor); + if (if_block0) + if_block0.m(target, anchor); insert(target, t0, anchor); - mount_component(treeview0, target, anchor); + if (if_block1) + if_block1.m(target, anchor); insert(target, t1, anchor); - mount_component(treeview1, target, anchor); + if (if_block2) + if_block2.m(target, anchor); insert(target, t2, anchor); - mount_component(treeview2, target, anchor); + mount_component(treeview0, target, anchor); insert(target, t3, anchor); - mount_component(treeview3, target, anchor); + mount_component(treeview1, target, anchor); insert(target, t4, anchor); - insert(target, hr, anchor); + mount_component(treeview2, target, anchor); insert(target, t5, anchor); + mount_component(treeview3, target, anchor); + insert(target, t6, anchor); + insert(target, hr, anchor); + insert(target, t7, anchor); insert(target, div, anchor); append(div, button); current = true; @@ -23137,7 +23246,7 @@ function create_if_block_12(ctx) { button, "click", /*publishMarkedNotes*/ - ctx[18] + ctx[22] ); mounted = true; } @@ -23148,64 +23257,121 @@ function create_if_block_12(ctx) { /*problematicFiles*/ ctx2[8].length > 0 ) { - if (if_block) { - if_block.p(ctx2, dirty); + if (if_block0) { + if_block0.p(ctx2, dirty); } else { - if_block = create_if_block_22(ctx2); - if_block.c(); - if_block.m(t0.parentNode, t0); + if_block0 = create_if_block_42(ctx2); + if_block0.c(); + if_block0.m(t0.parentNode, t0); } - } else if (if_block) { - if_block.d(1); - if_block = null; + } else if (if_block0) { + if_block0.d(1); + if_block0 = null; + } + if ( + /*showImageFixNotice*/ + ctx2[9] + ) { + if (if_block1) { + if_block1.p(ctx2, dirty); + if (dirty[0] & /*showImageFixNotice*/ + 512) { + transition_in(if_block1, 1); + } + } else { + if_block1 = create_if_block_32(ctx2); + if_block1.c(); + transition_in(if_block1, 1); + if_block1.m(t1.parentNode, t1); + } + } else if (if_block1) { + group_outros(); + transition_out(if_block1, 1, 1, () => { + if_block1 = null; + }); + check_outros(); + } + if ( + /*showBasesNotice*/ + ctx2[10] + ) { + if (if_block2) { + if_block2.p(ctx2, dirty); + if (dirty[0] & /*showBasesNotice*/ + 1024) { + transition_in(if_block2, 1); + } + } else { + if_block2 = create_if_block_22(ctx2); + if_block2.c(); + transition_in(if_block2, 1); + if_block2.m(t2.parentNode, t2); + } + } else if (if_block2) { + group_outros(); + transition_out(if_block2, 1, 1, () => { + if_block2 = null; + }); + check_outros(); } const treeview0_changes = {}; if (dirty[0] & /*unpublishedNoteTree*/ - 4096) treeview0_changes.tree = /*unpublishedNoteTree*/ - (_a3 = ctx2[12]) != null ? _a3 : ( - /*emptyNode*/ - ctx2[19] - ); + 16384) + treeview0_changes.tree = /*unpublishedNoteTree*/ + (_a3 = ctx2[14]) != null ? _a3 : ( + /*emptyNode*/ + ctx2[23] + ); if (dirty[0] & /*showDiff*/ - 1) treeview0_changes.showDiff = /*showDiff*/ - ctx2[0]; + 1) + treeview0_changes.showDiff = /*showDiff*/ + ctx2[0]; treeview0.$set(treeview0_changes); const treeview1_changes = {}; if (dirty[0] & /*changedNotesTree*/ - 2048) treeview1_changes.tree = /*changedNotesTree*/ - (_b2 = ctx2[11]) != null ? _b2 : ( - /*emptyNode*/ - ctx2[19] - ); + 8192) + treeview1_changes.tree = /*changedNotesTree*/ + (_b2 = ctx2[13]) != null ? _b2 : ( + /*emptyNode*/ + ctx2[23] + ); if (dirty[0] & /*showDiff*/ - 1) treeview1_changes.showDiff = /*showDiff*/ - ctx2[0]; + 1) + treeview1_changes.showDiff = /*showDiff*/ + ctx2[0]; treeview1.$set(treeview1_changes); const treeview2_changes = {}; if (dirty[0] & /*deletedNoteTree*/ - 1024) treeview2_changes.tree = /*deletedNoteTree*/ - (_c2 = ctx2[10]) != null ? _c2 : ( - /*emptyNode*/ - ctx2[19] - ); + 4096) + treeview2_changes.tree = /*deletedNoteTree*/ + (_c2 = ctx2[12]) != null ? _c2 : ( + /*emptyNode*/ + ctx2[23] + ); if (dirty[0] & /*showDiff*/ - 1) treeview2_changes.showDiff = /*showDiff*/ - ctx2[0]; + 1) + treeview2_changes.showDiff = /*showDiff*/ + ctx2[0]; treeview2.$set(treeview2_changes); const treeview3_changes = {}; if (dirty[0] & /*publishedNotesTree*/ - 16384) treeview3_changes.tree = /*publishedNotesTree*/ - (_d2 = ctx2[14]) != null ? _d2 : ( - /*emptyNode*/ - ctx2[19] - ); + 65536) + treeview3_changes.tree = /*publishedNotesTree*/ + (_d2 = ctx2[16]) != null ? _d2 : ( + /*emptyNode*/ + ctx2[23] + ); if (dirty[0] & /*showDiff*/ - 1) treeview3_changes.showDiff = /*showDiff*/ - ctx2[0]; + 1) + treeview3_changes.showDiff = /*showDiff*/ + ctx2[0]; treeview3.$set(treeview3_changes); }, i(local) { - if (current) return; + if (current) + return; + transition_in(if_block1); + transition_in(if_block2); transition_in(treeview0.$$.fragment, local); transition_in(treeview1.$$.fragment, local); transition_in(treeview2.$$.fragment, local); @@ -23213,6 +23379,8 @@ function create_if_block_12(ctx) { current = true; }, o(local) { + transition_out(if_block1); + transition_out(if_block2); transition_out(treeview0.$$.fragment, local); transition_out(treeview1.$$.fragment, local); transition_out(treeview2.$$.fragment, local); @@ -23226,11 +23394,18 @@ function create_if_block_12(ctx) { detach(t2); detach(t3); detach(t4); - detach(hr); detach(t5); + detach(t6); + detach(hr); + detach(t7); detach(div); } - if (if_block) if_block.d(detaching); + if (if_block0) + if_block0.d(detaching); + if (if_block1) + if_block1.d(detaching); + if (if_block2) + if_block2.d(detaching); destroy_component(treeview0, detaching); destroy_component(treeview1, detaching); destroy_component(treeview2, detaching); @@ -23246,7 +23421,7 @@ function create_if_block2(ctx) { let html_tag; let raw_value = ( /*bigRotatingCog*/ - ((_a2 = ctx[16]()) == null ? void 0 : _a2.outerHTML) + "" + ((_a2 = ctx[20]()) == null ? void 0 : _a2.outerHTML) + "" ); let t0; let div0; @@ -23258,7 +23433,7 @@ function create_if_block2(ctx) { div0 = element("div"); div0.textContent = "Calculating publication status"; html_tag.a = t0; - attr(div1, "class", "loading-msg svelte-ghd9h6"); + attr(div1, "class", "loading-msg svelte-1eqmrov"); }, m(target, anchor) { insert(target, div1, anchor); @@ -23276,13 +23451,13 @@ function create_if_block2(ctx) { } }; } -function create_if_block_10(ctx) { +function create_if_block_122(ctx) { let div; return { c() { div = element("div"); div.textContent = `${`(${/*failedPublish*/ - ctx[17].length} failed)`}`; + ctx[21].length} failed)`}`; }, m(target, anchor) { insert(target, div, anchor); @@ -23309,7 +23484,8 @@ function create_else_block_2(ctx) { }, p: noop, i(local) { - if (current) return; + if (current) + return; transition_in(icon.$$.fragment, local); current = true; }, @@ -23322,7 +23498,7 @@ function create_else_block_2(ctx) { } }; } -function create_if_block_9(ctx) { +function create_if_block_11(ctx) { let icon; let current; icon = new Icon_default({ props: { name: "cross" } }); @@ -23336,7 +23512,8 @@ function create_if_block_9(ctx) { }, p: noop, i(local) { - if (current) return; + if (current) + return; transition_in(icon.$$.fragment, local); current = true; }, @@ -23349,7 +23526,7 @@ function create_if_block_9(ctx) { } }; } -function create_if_block_8(ctx) { +function create_if_block_10(ctx) { let icon; let current; icon = new Icon_default({ props: { name: "check" } }); @@ -23363,7 +23540,8 @@ function create_if_block_8(ctx) { }, p: noop, i(local) { - if (current) return; + if (current) + return; transition_in(icon.$$.fragment, local); current = true; }, @@ -23376,12 +23554,12 @@ function create_if_block_8(ctx) { } }; } -function create_if_block_72(ctx) { +function create_if_block_9(ctx) { var _a2; let html_tag; let raw_value = ( /*rotatingCog*/ - ((_a2 = ctx[15]()) == null ? void 0 : _a2.outerHTML) + "" + ((_a2 = ctx[19]()) == null ? void 0 : _a2.outerHTML) + "" ); let html_anchor; return { @@ -23405,13 +23583,13 @@ function create_if_block_72(ctx) { } }; } -function create_if_block_62(ctx) { +function create_if_block_8(ctx) { let span; return { c() { span = element("span"); span.textContent = "- PUBLISHED"; - attr(span, "class", "published svelte-ghd9h6"); + attr(span, "class", "published svelte-1eqmrov"); }, m(target, anchor) { insert(target, span, anchor); @@ -23433,7 +23611,7 @@ function create_each_block_2(ctx) { let t0; let t1_value = ( /*note*/ - ctx[31].file.name + "" + ctx[35].file.name + "" ); let t1; let t2; @@ -23441,42 +23619,51 @@ function create_each_block_2(ctx) { /*publishedPaths*/ ctx[6].includes( /*note*/ - ctx[31].getPath() + ctx[35].getPath() ) ); let current; - const if_block_creators = [create_if_block_72, create_if_block_8, create_if_block_9, create_else_block_2]; + const if_block_creators = [create_if_block_9, create_if_block_10, create_if_block_11, create_else_block_2]; const if_blocks = []; function select_block_type_1(ctx2, dirty) { if (dirty[0] & /*processingPaths, unpublishedToPublish, changedToPublish*/ - 536) show_if_1 = null; + 2072) + show_if_1 = null; if (dirty[0] & /*publishedPaths, unpublishedToPublish, changedToPublish*/ - 88) show_if_2 = null; + 88) + show_if_2 = null; if (dirty[0] & /*unpublishedToPublish, changedToPublish*/ - 24) show_if_3 = null; - if (show_if_1 == null) show_if_1 = !!/*processingPaths*/ - ctx2[9].includes( - /*note*/ - ctx2[31].getPath() - ); - if (show_if_1) return 0; - if (show_if_2 == null) show_if_2 = !!/*publishedPaths*/ - ctx2[6].includes( - /*note*/ - ctx2[31].getPath() - ); - if (show_if_2) return 1; - if (show_if_3 == null) show_if_3 = !!/*failedPublish*/ - ctx2[17].includes( - /*note*/ - ctx2[31].getPath() - ); - if (show_if_3) return 2; + 24) + show_if_3 = null; + if (show_if_1 == null) + show_if_1 = !!/*processingPaths*/ + ctx2[11].includes( + /*note*/ + ctx2[35].getPath() + ); + if (show_if_1) + return 0; + if (show_if_2 == null) + show_if_2 = !!/*publishedPaths*/ + ctx2[6].includes( + /*note*/ + ctx2[35].getPath() + ); + if (show_if_2) + return 1; + if (show_if_3 == null) + show_if_3 = !!/*failedPublish*/ + ctx2[21].includes( + /*note*/ + ctx2[35].getPath() + ); + if (show_if_3) + return 2; return 3; } current_block_type_index = select_block_type_1(ctx, [-1, -1]); if_block0 = if_blocks[current_block_type_index] = if_block_creators[current_block_type_index](ctx); - let if_block1 = show_if && create_if_block_62(ctx); + let if_block1 = show_if && create_if_block_8(ctx); return { c() { div = element("div"); @@ -23484,7 +23671,8 @@ function create_each_block_2(ctx) { t0 = space(); t1 = text(t1_value); t2 = space(); - if (if_block1) if_block1.c(); + if (if_block1) + if_block1.c(); attr(div, "class", "note-list"); }, m(target, anchor) { @@ -23493,7 +23681,8 @@ function create_each_block_2(ctx) { append(div, t0); append(div, t1); append(div, t2); - if (if_block1) if_block1.m(div, null); + if (if_block1) + if_block1.m(div, null); current = true; }, p(ctx2, dirty) { @@ -23519,17 +23708,19 @@ function create_each_block_2(ctx) { } if ((!current || dirty[0] & /*unpublishedToPublish, changedToPublish*/ 24) && t1_value !== (t1_value = /*note*/ - ctx2[31].file.name + "")) set_data(t1, t1_value); + ctx2[35].file.name + "")) + set_data(t1, t1_value); if (dirty[0] & /*publishedPaths, unpublishedToPublish, changedToPublish*/ - 88) show_if = /*publishedPaths*/ - ctx2[6].includes( - /*note*/ - ctx2[31].getPath() - ); + 88) + show_if = /*publishedPaths*/ + ctx2[6].includes( + /*note*/ + ctx2[35].getPath() + ); if (show_if) { if (if_block1) { } else { - if_block1 = create_if_block_62(ctx2); + if_block1 = create_if_block_8(ctx2); if_block1.c(); if_block1.m(div, null); } @@ -23539,7 +23730,8 @@ function create_each_block_2(ctx) { } }, i(local) { - if (current) return; + if (current) + return; transition_in(if_block0); current = true; }, @@ -23552,7 +23744,8 @@ function create_each_block_2(ctx) { detach(div); } if_blocks[current_block_type_index].d(); - if (if_block1) if_block1.d(); + if (if_block1) + if_block1.d(); } }; } @@ -23570,7 +23763,8 @@ function create_else_block_1(ctx) { }, p: noop, i(local) { - if (current) return; + if (current) + return; transition_in(icon.$$.fragment, local); current = true; }, @@ -23583,7 +23777,7 @@ function create_else_block_1(ctx) { } }; } -function create_if_block_52(ctx) { +function create_if_block_72(ctx) { let icon; let current; icon = new Icon_default({ props: { name: "check" } }); @@ -23597,7 +23791,8 @@ function create_if_block_52(ctx) { }, p: noop, i(local) { - if (current) return; + if (current) + return; transition_in(icon.$$.fragment, local); current = true; }, @@ -23610,12 +23805,12 @@ function create_if_block_52(ctx) { } }; } -function create_if_block_42(ctx) { +function create_if_block_62(ctx) { var _a2; let html_tag; let raw_value = ( /*rotatingCog*/ - ((_a2 = ctx[15]()) == null ? void 0 : _a2.outerHTML) + "" + ((_a2 = ctx[19]()) == null ? void 0 : _a2.outerHTML) + "" ); let html_anchor; return { @@ -23639,13 +23834,13 @@ function create_if_block_42(ctx) { } }; } -function create_if_block_32(ctx) { +function create_if_block_52(ctx) { let span; return { c() { span = element("span"); span.textContent = "- DELETED"; - attr(span, "class", "deleted svelte-ghd9h6"); + attr(span, "class", "deleted svelte-1eqmrov"); }, m(target, anchor) { insert(target, span, anchor); @@ -23666,7 +23861,7 @@ function create_each_block_1(ctx) { let t0; let t1_value = ( /*path*/ - ctx[28].split("/").last() + "" + ctx[32].split("/").last() + "" ); let t1; let t2; @@ -23674,34 +23869,40 @@ function create_each_block_1(ctx) { /*publishedPaths*/ ctx[6].includes( /*path*/ - ctx[28] + ctx[32] ) ); let current; - const if_block_creators = [create_if_block_42, create_if_block_52, create_else_block_1]; + const if_block_creators = [create_if_block_62, create_if_block_72, create_else_block_1]; const if_blocks = []; function select_block_type_2(ctx2, dirty) { if (dirty[0] & /*processingPaths, pathsToDelete*/ - 544) show_if_1 = null; + 2080) + show_if_1 = null; if (dirty[0] & /*publishedPaths, pathsToDelete*/ - 96) show_if_2 = null; - if (show_if_1 == null) show_if_1 = !!/*processingPaths*/ - ctx2[9].includes( - /*path*/ - ctx2[28] - ); - if (show_if_1) return 0; - if (show_if_2 == null) show_if_2 = !!/*publishedPaths*/ - ctx2[6].includes( - /*path*/ - ctx2[28] - ); - if (show_if_2) return 1; + 96) + show_if_2 = null; + if (show_if_1 == null) + show_if_1 = !!/*processingPaths*/ + ctx2[11].includes( + /*path*/ + ctx2[32] + ); + if (show_if_1) + return 0; + if (show_if_2 == null) + show_if_2 = !!/*publishedPaths*/ + ctx2[6].includes( + /*path*/ + ctx2[32] + ); + if (show_if_2) + return 1; return 2; } current_block_type_index = select_block_type_2(ctx, [-1, -1]); if_block0 = if_blocks[current_block_type_index] = if_block_creators[current_block_type_index](ctx); - let if_block1 = show_if && create_if_block_32(ctx); + let if_block1 = show_if && create_if_block_52(ctx); return { c() { div = element("div"); @@ -23709,7 +23910,8 @@ function create_each_block_1(ctx) { t0 = space(); t1 = text(t1_value); t2 = space(); - if (if_block1) if_block1.c(); + if (if_block1) + if_block1.c(); attr(div, "class", "note-list"); }, m(target, anchor) { @@ -23718,7 +23920,8 @@ function create_each_block_1(ctx) { append(div, t0); append(div, t1); append(div, t2); - if (if_block1) if_block1.m(div, null); + if (if_block1) + if_block1.m(div, null); current = true; }, p(ctx2, dirty) { @@ -23744,17 +23947,19 @@ function create_each_block_1(ctx) { } if ((!current || dirty[0] & /*pathsToDelete*/ 32) && t1_value !== (t1_value = /*path*/ - ctx2[28].split("/").last() + "")) set_data(t1, t1_value); + ctx2[32].split("/").last() + "")) + set_data(t1, t1_value); if (dirty[0] & /*publishedPaths, pathsToDelete*/ - 96) show_if = /*publishedPaths*/ - ctx2[6].includes( - /*path*/ - ctx2[28] - ); + 96) + show_if = /*publishedPaths*/ + ctx2[6].includes( + /*path*/ + ctx2[32] + ); if (show_if) { if (if_block1) { } else { - if_block1 = create_if_block_32(ctx2); + if_block1 = create_if_block_52(ctx2); if_block1.c(); if_block1.m(div, null); } @@ -23764,7 +23969,8 @@ function create_each_block_1(ctx) { } }, i(local) { - if (current) return; + if (current) + return; transition_in(if_block0); current = true; }, @@ -23777,11 +23983,12 @@ function create_each_block_1(ctx) { detach(div); } if_blocks[current_block_type_index].d(); - if (if_block1) if_block1.d(); + if (if_block1) + if_block1.d(); } }; } -function create_if_block_22(ctx) { +function create_if_block_42(ctx) { let div2; let div0; let t1; @@ -23804,9 +24011,9 @@ function create_if_block_22(ctx) { for (let i = 0; i < each_blocks.length; i += 1) { each_blocks[i].c(); } - attr(div0, "class", "callout-title svelte-ghd9h6"); + attr(div0, "class", "callout-title svelte-1eqmrov"); attr(div1, "class", "callout-content"); - attr(div2, "class", "callout warning svelte-ghd9h6"); + attr(div2, "class", "callout warning svelte-1eqmrov"); }, m(target, anchor) { insert(target, div2, anchor); @@ -23856,14 +24063,14 @@ function create_each_block2(ctx) { let span0; let t0_value = ( /*file*/ - ctx[25].path + "" + ctx[29].path + "" ); let t0; let t1; let span1; let t2_value = ( /*file*/ - ctx[25].issue + "" + ctx[29].issue + "" ); let t2; let t3; @@ -23876,9 +24083,9 @@ function create_each_block2(ctx) { span1 = element("span"); t2 = text(t2_value); t3 = space(); - attr(span0, "class", "file-path svelte-ghd9h6"); - attr(span1, "class", "file-issue svelte-ghd9h6"); - attr(div, "class", "problematic-file svelte-ghd9h6"); + attr(span0, "class", "file-path svelte-1eqmrov"); + attr(span1, "class", "file-issue svelte-1eqmrov"); + attr(div, "class", "problematic-file svelte-1eqmrov"); }, m(target, anchor) { insert(target, div, anchor); @@ -23892,10 +24099,12 @@ function create_each_block2(ctx) { p(ctx2, dirty) { if (dirty[0] & /*problematicFiles*/ 256 && t0_value !== (t0_value = /*file*/ - ctx2[25].path + "")) set_data(t0, t0_value); + ctx2[29].path + "")) + set_data(t0, t0_value); if (dirty[0] & /*problematicFiles*/ 256 && t2_value !== (t2_value = /*file*/ - ctx2[25].issue + "")) set_data(t2, t2_value); + ctx2[29].issue + "")) + set_data(t2, t2_value); }, d(detaching) { if (detaching) { @@ -23904,6 +24113,154 @@ function create_each_block2(ctx) { } }; } +function create_if_block_32(ctx) { + let div3; + let div1; + let div0; + let t1; + let button; + let icon; + let t2; + let div2; + let current; + let mounted; + let dispose; + icon = new Icon_default({ props: { name: "x" } }); + return { + c() { + div3 = element("div"); + div1 = element("div"); + div0 = element("div"); + div0.textContent = "Image handling improved"; + t1 = space(); + button = element("button"); + create_component(icon.$$.fragment); + t2 = space(); + div2 = element("div"); + div2.innerHTML = `Images with size parameters (e.g. ![[image.png|200]]) are now handled differently to fix rendering in tables. + This may cause notes with images to show up as changed. This + is expected and safe to publish.`; + attr(div0, "class", "callout-title svelte-1eqmrov"); + attr(button, "class", "dismiss-btn svelte-1eqmrov"); + attr(button, "aria-label", "Dismiss notice"); + attr(div1, "class", "callout-header svelte-1eqmrov"); + attr(div2, "class", "callout-content"); + attr(div3, "class", "callout info svelte-1eqmrov"); + }, + m(target, anchor) { + insert(target, div3, anchor); + append(div3, div1); + append(div1, div0); + append(div1, t1); + append(div1, button); + mount_component(icon, button, null); + append(div3, t2); + append(div3, div2); + current = true; + if (!mounted) { + dispose = listen( + button, + "click", + /*dismissImageFixNotice*/ + ctx[17] + ); + mounted = true; + } + }, + p: noop, + i(local) { + if (current) + return; + transition_in(icon.$$.fragment, local); + current = true; + }, + o(local) { + transition_out(icon.$$.fragment, local); + current = false; + }, + d(detaching) { + if (detaching) { + detach(div3); + } + destroy_component(icon); + mounted = false; + dispose(); + } + }; +} +function create_if_block_22(ctx) { + let div3; + let div1; + let div0; + let t1; + let button; + let icon; + let t2; + let div2; + let current; + let mounted; + let dispose; + icon = new Icon_default({ props: { name: "x" } }); + return { + c() { + div3 = element("div"); + div1 = element("div"); + div0 = element("div"); + div0.textContent = "Bases support added"; + t1 = space(); + button = element("button"); + create_component(icon.$$.fragment); + t2 = space(); + div2 = element("div"); + div2.textContent = "Frontmatter properties are now nested differently to support\n Obsidian Bases. This may cause notes to show up as changed.\n This is expected and safe to publish. You must update your\n site template to use Bases."; + attr(div0, "class", "callout-title svelte-1eqmrov"); + attr(button, "class", "dismiss-btn svelte-1eqmrov"); + attr(button, "aria-label", "Dismiss notice"); + attr(div1, "class", "callout-header svelte-1eqmrov"); + attr(div2, "class", "callout-content"); + attr(div3, "class", "callout info svelte-1eqmrov"); + }, + m(target, anchor) { + insert(target, div3, anchor); + append(div3, div1); + append(div1, div0); + append(div1, t1); + append(div1, button); + mount_component(icon, button, null); + append(div3, t2); + append(div3, div2); + current = true; + if (!mounted) { + dispose = listen( + button, + "click", + /*dismissBasesNotice*/ + ctx[18] + ); + mounted = true; + } + }, + p: noop, + i(local) { + if (current) + return; + transition_in(icon.$$.fragment, local); + current = true; + }, + o(local) { + transition_out(icon.$$.fragment, local); + current = false; + }, + d(detaching) { + if (detaching) { + detach(div3); + } + destroy_component(icon); + mounted = false; + dispose(); + } + }; +} function create_fragment4(ctx) { let div; let hr; @@ -23915,9 +24272,11 @@ function create_fragment4(ctx) { const if_blocks = []; function select_block_type(ctx2, dirty) { if (!/*publishStatus*/ - ctx2[2]) return 0; + ctx2[2]) + return 0; if (!/*showPublishingView*/ - ctx2[7]) return 1; + ctx2[7]) + return 1; return 2; } current_block_type_index = select_block_type(ctx, [-1, -1]); @@ -23928,7 +24287,7 @@ function create_fragment4(ctx) { hr = element("hr"); t = space(); if_block.c(); - attr(hr, "class", "title-separator svelte-ghd9h6"); + attr(hr, "class", "title-separator svelte-1eqmrov"); }, m(target, anchor) { insert(target, div, anchor); @@ -23960,7 +24319,8 @@ function create_fragment4(ctx) { } }, i(local) { - if (current) return; + if (current) + return; transition_in(if_block); current = true; }, @@ -23976,6 +24336,8 @@ function create_fragment4(ctx) { } }; } +var IMAGE_FIX_NOTICE_KEY = "dg-dismissed-image-fix-notice"; +var BASES_NOTICE_KEY = "dg-dismissed-bases-support-notice"; function insertIntoTree(tree, pathComponents) { let currentNode = tree; for (let i = 0; i < pathComponents.length; i++) { @@ -24024,6 +24386,16 @@ function instance4($$self, $$props, $$invalidate) { let publishStatus; let showPublishingView = false; let problematicFiles = []; + let showImageFixNotice = !localStorage.getItem(IMAGE_FIX_NOTICE_KEY); + let showBasesNotice = !localStorage.getItem(BASES_NOTICE_KEY); + function dismissImageFixNotice() { + $$invalidate(9, showImageFixNotice = false); + localStorage.setItem(IMAGE_FIX_NOTICE_KEY, "true"); + } + function dismissBasesNotice() { + $$invalidate(10, showBasesNotice = false); + localStorage.setItem(BASES_NOTICE_KEY, "true"); + } function getPublishStatus() { return __awaiter(this, void 0, void 0, function* () { $$invalidate(2, publishStatus = yield publishStatusManager.getPublishStatus()); @@ -24032,7 +24404,8 @@ function instance4($$self, $$props, $$invalidate) { } function validateFiles() { $$invalidate(8, problematicFiles = []); - if (!publishStatus) return; + if (!publishStatus) + return; const homeFiles = [ ...publishStatus.publishedNotes, ...publishStatus.unpublishedNotes, @@ -24083,7 +24456,8 @@ function instance4($$self, $$props, $$invalidate) { let failedPublish = []; const publishMarkedNotes = () => __awaiter(void 0, void 0, void 0, function* () { var _a2, _b; - if (!unpublishedNoteTree || !changedNotesTree) return; + if (!unpublishedNoteTree || !changedNotesTree) + return; if (!publishStatus) { throw new Error("Publish status is undefined"); } @@ -24096,24 +24470,24 @@ function instance4($$self, $$props, $$invalidate) { $$invalidate(4, changedToPublish = (_b = publishStatus === null || publishStatus === void 0 ? void 0 : publishStatus.changedNotes.filter((note) => changedPaths.includes(note.getPath()))) !== null && _b !== void 0 ? _b : []); $$invalidate(7, showPublishingView = true); const allNotesToPublish = unpublishedToPublish.concat(changedToPublish); - $$invalidate(9, processingPaths = [...allNotesToPublish.map((note) => note.getPath())]); + $$invalidate(11, processingPaths = [...allNotesToPublish.map((note) => note.getPath())]); yield publisher.publishBatch(allNotesToPublish); $$invalidate(6, publishedPaths = [...processingPaths]); - $$invalidate(9, processingPaths = []); + $$invalidate(11, processingPaths = []); for (const path of notesToDelete) { - $$invalidate(9, processingPaths = [...processingPaths, path]); + $$invalidate(11, processingPaths = [...processingPaths, path]); yield publisher.deleteNote(path); - $$invalidate(9, processingPaths = processingPaths.filter((p) => p !== path)); + $$invalidate(11, processingPaths = processingPaths.filter((p) => p !== path)); $$invalidate(6, publishedPaths = [...publishedPaths, path]); } for (const path of imagesToDelete) { - $$invalidate(9, processingPaths = [...processingPaths, path]); + $$invalidate(11, processingPaths = [...processingPaths, path]); yield publisher.deleteImage(path); - $$invalidate(9, processingPaths = processingPaths.filter((p) => p !== path)); + $$invalidate(11, processingPaths = processingPaths.filter((p) => p !== path)); $$invalidate(6, publishedPaths = [...publishedPaths, path]); } $$invalidate(6, publishedPaths = [...publishedPaths, ...processingPaths]); - $$invalidate(9, processingPaths = []); + $$invalidate(11, processingPaths = []); }); const emptyNode = { name: "", @@ -24123,31 +24497,40 @@ function instance4($$self, $$props, $$invalidate) { checked: false }; $$self.$$set = ($$props2) => { - if ("publishStatusManager" in $$props2) $$invalidate(20, publishStatusManager = $$props2.publishStatusManager); - if ("publisher" in $$props2) $$invalidate(21, publisher = $$props2.publisher); - if ("showDiff" in $$props2) $$invalidate(0, showDiff = $$props2.showDiff); - if ("close" in $$props2) $$invalidate(1, close = $$props2.close); + if ("publishStatusManager" in $$props2) + $$invalidate(24, publishStatusManager = $$props2.publishStatusManager); + if ("publisher" in $$props2) + $$invalidate(25, publisher = $$props2.publisher); + if ("showDiff" in $$props2) + $$invalidate(0, showDiff = $$props2.showDiff); + if ("close" in $$props2) + $$invalidate(1, close = $$props2.close); }; $$self.$$.update = () => { if ($$self.$$.dirty[0] & /*publishStatus*/ 4) { - $: $$invalidate(14, publishedNotesTree = publishStatus && filePathsToTree(publishStatus.publishedNotes.map((note) => note.getPath()), "Published Notes")); + $: + $$invalidate(16, publishedNotesTree = publishStatus && filePathsToTree(publishStatus.publishedNotes.map((note) => note.getPath()), "Published Notes")); } if ($$self.$$.dirty[0] & /*publishStatus*/ 4) { - $: $$invalidate(11, changedNotesTree = publishStatus && filePathsToTree(publishStatus.changedNotes.map((note) => note.getPath()), "Changed Notes")); + $: + $$invalidate(13, changedNotesTree = publishStatus && filePathsToTree(publishStatus.changedNotes.map((note) => note.getPath()), "Changed Notes")); } if ($$self.$$.dirty[0] & /*publishStatus*/ 4) { - $: $$invalidate(10, deletedNoteTree = publishStatus && filePathsToTree([...publishStatus.deletedNotePaths, ...publishStatus.deletedImagePaths].map((path) => path.path), "Deleted Notes")); + $: + $$invalidate(12, deletedNoteTree = publishStatus && filePathsToTree([...publishStatus.deletedNotePaths, ...publishStatus.deletedImagePaths].map((path) => path.path), "Deleted Notes")); } if ($$self.$$.dirty[0] & /*publishStatus*/ 4) { - $: $$invalidate(12, unpublishedNoteTree = publishStatus && filePathsToTree(publishStatus.unpublishedNotes.map((note) => note.getPath()), "Unpublished Notes")); + $: + $$invalidate(14, unpublishedNoteTree = publishStatus && filePathsToTree(publishStatus.unpublishedNotes.map((note) => note.getPath()), "Unpublished Notes")); } if ($$self.$$.dirty[0] & /*publishedPaths, unpublishedToPublish, changedToPublish, pathsToDelete*/ 120) { - $: $$invalidate(13, publishProgress = (publishedPaths.length + failedPublish.length) / (unpublishedToPublish.length + changedToPublish.length + pathsToDelete.length) * 100); + $: + $$invalidate(15, publishProgress = (publishedPaths.length + failedPublish.length) / (unpublishedToPublish.length + changedToPublish.length + pathsToDelete.length) * 100); } }; return [ @@ -24160,12 +24543,16 @@ function instance4($$self, $$props, $$invalidate) { publishedPaths, showPublishingView, problematicFiles, + showImageFixNotice, + showBasesNotice, processingPaths, deletedNoteTree, changedNotesTree, unpublishedNoteTree, publishProgress, publishedNotesTree, + dismissImageFixNotice, + dismissBasesNotice, rotatingCog, bigRotatingCog, failedPublish, @@ -24185,8 +24572,8 @@ var PublicationCenter = class extends SvelteComponent { create_fragment4, safe_not_equal, { - publishStatusManager: 20, - publisher: 21, + publishStatusManager: 24, + publisher: 25, showDiff: 0, close: 1 }, @@ -24283,7 +24670,8 @@ function create_else_block3(ctx) { p(ctx2, dirty) { if (dirty & /*diff*/ 1 && t_value !== (t_value = /*part*/ - ctx2[1].value + "")) set_data(t, t_value); + ctx2[1].value + "")) + set_data(t, t_value); }, d(detaching) { if (detaching) { @@ -24315,7 +24703,8 @@ function create_if_block_23(ctx) { p(ctx2, dirty) { if (dirty & /*diff*/ 1 && t_value !== (t_value = /*part*/ - ctx2[1].value + "")) set_data(t, t_value); + ctx2[1].value + "")) + set_data(t, t_value); }, d(detaching) { if (detaching) { @@ -24347,7 +24736,8 @@ function create_if_block_13(ctx) { p(ctx2, dirty) { if (dirty & /*diff*/ 1 && t_value !== (t_value = /*part*/ - ctx2[1].value + "")) set_data(t, t_value); + ctx2[1].value + "")) + set_data(t, t_value); }, d(detaching) { if (detaching) { @@ -24362,11 +24752,13 @@ function create_each_block3(ctx) { if ( /*part*/ ctx2[1].added - ) return create_if_block_13; + ) + return create_if_block_13; if ( /*part*/ ctx2[1].removed - ) return create_if_block_23; + ) + return create_if_block_23; return create_else_block3; } let current_block_type = select_block_type(ctx, -1); @@ -24421,7 +24813,8 @@ function create_fragment5(ctx) { t2 = space(); hr = element("hr"); t3 = space(); - if (if_block) if_block.c(); + if (if_block) + if_block.c(); attr(div0, "class", "info callout"); }, m(target, anchor) { @@ -24430,7 +24823,8 @@ function create_fragment5(ctx) { append(div1, t2); append(div1, hr); append(div1, t3); - if (if_block) if_block.m(div1, null); + if (if_block) + if_block.m(div1, null); }, p(ctx2, [dirty]) { if ( @@ -24455,14 +24849,16 @@ function create_fragment5(ctx) { if (detaching) { detach(div1); } - if (if_block) if_block.d(); + if (if_block) + if_block.d(); } }; } function instance5($$self, $$props, $$invalidate) { let { diff: diff2 } = $$props; $$self.$$set = ($$props2) => { - if ("diff" in $$props2) $$invalidate(0, diff2 = $$props2.diff); + if ("diff" in $$props2) + $$invalidate(0, diff2 = $$props2.diff); }; return [diff2]; } @@ -24871,7 +25267,8 @@ var PublicationCenter2 = class { } addPlatformLink() { const linkInfo = this.getPlatformLinkInfo(); - if (!linkInfo) return; + if (!linkInfo) + return; const repoLink = this.modal.titleEl.createEl("a", { cls: "publication-center-repo-link", href: linkInfo.url, @@ -24999,8 +25396,7 @@ function bind(fn2, thisArg) { // node_modules/axios/lib/utils.js var { toString } = Object.prototype; var { getPrototypeOf } = Object; -var { iterator, toStringTag } = Symbol; -var kindOf = /* @__PURE__ */ ((cache) => (thing) => { +var kindOf = ((cache) => (thing) => { const str = toString.call(thing); return cache[str] || (cache[str] = str.slice(8, -1).toLowerCase()); })(/* @__PURE__ */ Object.create(null)); @@ -25027,37 +25423,26 @@ function isArrayBufferView(val) { var isString2 = typeOfTest("string"); var isFunction = typeOfTest("function"); var isNumber2 = typeOfTest("number"); -var isObject = (thing) => thing !== null && typeof thing === "object"; +var isObject2 = (thing) => thing !== null && typeof thing === "object"; var isBoolean = (thing) => thing === true || thing === false; -var isPlainObject3 = (val) => { +var isPlainObject2 = (val) => { if (kindOf(val) !== "object") { return false; } const prototype3 = getPrototypeOf(val); - return (prototype3 === null || prototype3 === Object.prototype || Object.getPrototypeOf(prototype3) === null) && !(toStringTag in val) && !(iterator in val); -}; -var isEmptyObject = (val) => { - if (!isObject(val) || isBuffer(val)) { - return false; - } - try { - return Object.keys(val).length === 0 && Object.getPrototypeOf(val) === Object.prototype; - } catch (e) { - return false; - } + return (prototype3 === null || prototype3 === Object.prototype || Object.getPrototypeOf(prototype3) === null) && !(Symbol.toStringTag in val) && !(Symbol.iterator in val); }; var isDate2 = kindOfTest("Date"); var isFile = kindOfTest("File"); var isBlob = kindOfTest("Blob"); var isFileList = kindOfTest("FileList"); -var isStream = (val) => isObject(val) && isFunction(val.pipe); +var isStream = (val) => isObject2(val) && isFunction(val.pipe); var isFormData = (thing) => { let kind; return thing && (typeof FormData === "function" && thing instanceof FormData || isFunction(thing.append) && ((kind = kindOf(thing)) === "formdata" || // detect form-data instance kind === "object" && isFunction(thing.toString) && thing.toString() === "[object FormData]")); }; var isURLSearchParams = kindOfTest("URLSearchParams"); -var [isReadableStream, isRequest, isResponse, isHeaders] = ["ReadableStream", "Request", "Response", "Headers"].map(kindOfTest); var trim = (str) => str.trim ? str.trim() : str.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, ""); function forEach(obj, fn2, { allOwnKeys = false } = {}) { if (obj === null || typeof obj === "undefined") { @@ -25073,9 +25458,6 @@ function forEach(obj, fn2, { allOwnKeys = false } = {}) { fn2.call(null, obj[i], i, obj); } } else { - if (isBuffer(obj)) { - return; - } const keys = allOwnKeys ? Object.getOwnPropertyNames(obj) : Object.keys(obj); const len = keys.length; let key; @@ -25086,9 +25468,6 @@ function forEach(obj, fn2, { allOwnKeys = false } = {}) { } } function findKey(obj, key) { - if (isBuffer(obj)) { - return null; - } key = key.toLowerCase(); const keys = Object.keys(obj); let i = keys.length; @@ -25102,22 +25481,23 @@ function findKey(obj, key) { return null; } var _global = (() => { - if (typeof globalThis !== "undefined") return globalThis; + if (typeof globalThis !== "undefined") + return globalThis; return typeof self !== "undefined" ? self : typeof window !== "undefined" ? window : global; })(); var isContextDefined = (context) => !isUndefined2(context) && context !== _global; function merge2() { - const { caseless, skipUndefined } = isContextDefined(this) && this || {}; + const { caseless } = isContextDefined(this) && this || {}; const result = {}; const assignValue = (val, key) => { const targetKey = caseless && findKey(result, key) || key; - if (isPlainObject3(result[targetKey]) && isPlainObject3(val)) { + if (isPlainObject2(result[targetKey]) && isPlainObject2(val)) { result[targetKey] = merge2(result[targetKey], val); - } else if (isPlainObject3(val)) { + } else if (isPlainObject2(val)) { result[targetKey] = merge2({}, val); } else if (isArray(val)) { result[targetKey] = val.slice(); - } else if (!skipUndefined || !isUndefined2(val)) { + } else { result[targetKey] = val; } }; @@ -25156,7 +25536,8 @@ var toFlatObject = (sourceObj, destObj, filter2, propFilter) => { let prop; const merged = {}; destObj = destObj || {}; - if (sourceObj == null) return destObj; + if (sourceObj == null) + return destObj; do { props = Object.getOwnPropertyNames(sourceObj); i = props.length; @@ -25181,26 +25562,29 @@ var endsWith = (str, searchString, position) => { return lastIndex !== -1 && lastIndex === position; }; var toArray = (thing) => { - if (!thing) return null; - if (isArray(thing)) return thing; + if (!thing) + return null; + if (isArray(thing)) + return thing; let i = thing.length; - if (!isNumber2(i)) return null; + if (!isNumber2(i)) + return null; const arr = new Array(i); while (i-- > 0) { arr[i] = thing[i]; } return arr; }; -var isTypedArray = /* @__PURE__ */ ((TypedArray) => { +var isTypedArray = ((TypedArray) => { return (thing) => { return TypedArray && thing instanceof TypedArray; }; })(typeof Uint8Array !== "undefined" && getPrototypeOf(Uint8Array)); var forEachEntry = (obj, fn2) => { - const generator = obj && obj[iterator]; - const _iterator = generator.call(obj); + const generator = obj && obj[Symbol.iterator]; + const iterator = generator.call(obj); let result; - while ((result = _iterator.next()) && !result.done) { + while ((result = iterator.next()) && !result.done) { const pair = result.value; fn2.call(obj, pair[0], pair[1]); } @@ -25241,7 +25625,8 @@ var freezeMethods = (obj) => { return false; } const value = obj[name]; - if (!isFunction(value)) return; + if (!isFunction(value)) + return; descriptor.enumerable = false; if ("writable" in descriptor) { descriptor.writable = false; @@ -25267,21 +25652,34 @@ var toObjectSet = (arrayOrString, delimiter) => { var noop2 = () => { }; var toFiniteNumber = (value, defaultValue) => { - return value != null && Number.isFinite(value = +value) ? value : defaultValue; + value = +value; + return Number.isFinite(value) ? value : defaultValue; +}; +var ALPHA = "abcdefghijklmnopqrstuvwxyz"; +var DIGIT = "0123456789"; +var ALPHABET = { + DIGIT, + ALPHA, + ALPHA_DIGIT: ALPHA + ALPHA.toUpperCase() + DIGIT +}; +var generateString = (size = 16, alphabet = ALPHABET.ALPHA_DIGIT) => { + let str = ""; + const { length } = alphabet; + while (size--) { + str += alphabet[Math.random() * length | 0]; + } + return str; }; function isSpecCompliantForm(thing) { - return !!(thing && isFunction(thing.append) && thing[toStringTag] === "FormData" && thing[iterator]); + return !!(thing && isFunction(thing.append) && thing[Symbol.toStringTag] === "FormData" && thing[Symbol.iterator]); } var toJSONObject = (obj) => { const stack = new Array(10); const visit = (source, i) => { - if (isObject(source)) { + if (isObject2(source)) { if (stack.indexOf(source) >= 0) { return; } - if (isBuffer(source)) { - return source; - } if (!("toJSON" in source)) { stack[i] = source; const target = isArray(source) ? [] : {}; @@ -25298,28 +25696,7 @@ var toJSONObject = (obj) => { return visit(obj, 0); }; var isAsyncFn = kindOfTest("AsyncFunction"); -var isThenable = (thing) => thing && (isObject(thing) || isFunction(thing)) && isFunction(thing.then) && isFunction(thing.catch); -var _setImmediate = ((setImmediateSupported, postMessageSupported) => { - if (setImmediateSupported) { - return setImmediate; - } - return postMessageSupported ? ((token, callbacks) => { - _global.addEventListener("message", ({ source, data }) => { - if (source === _global && data === token) { - callbacks.length && callbacks.shift()(); - } - }, false); - return (cb) => { - callbacks.push(cb); - _global.postMessage(token, "*"); - }; - })(`axios@${Math.random()}`, []) : (cb) => setTimeout(cb); -})( - typeof setImmediate === "function", - isFunction(_global.postMessage) -); -var asap = typeof queueMicrotask !== "undefined" ? queueMicrotask.bind(_global) : typeof process !== "undefined" && process.nextTick || _setImmediate; -var isIterable = (thing) => thing != null && isFunction(thing[iterator]); +var isThenable = (thing) => thing && (isObject2(thing) || isFunction(thing)) && isFunction(thing.then) && isFunction(thing.catch); var utils_default = { isArray, isArrayBuffer, @@ -25329,13 +25706,8 @@ var utils_default = { isString: isString2, isNumber: isNumber2, isBoolean, - isObject, - isPlainObject: isPlainObject3, - isEmptyObject, - isReadableStream, - isRequest, - isResponse, - isHeaders, + isObject: isObject2, + isPlainObject: isPlainObject2, isUndefined: isUndefined2, isDate: isDate2, isFile, @@ -25372,13 +25744,12 @@ var utils_default = { findKey, global: _global, isContextDefined, + ALPHABET, + generateString, isSpecCompliantForm, toJSONObject, isAsyncFn, - isThenable, - setImmediate: _setImmediate, - asap, - isIterable + isThenable }; // node_modules/axios/lib/core/AxiosError.js @@ -25394,10 +25765,7 @@ function AxiosError(message, code, config, request2, response) { code && (this.code = code); config && (this.config = config); request2 && (this.request = request2); - if (response) { - this.response = response; - this.status = response.status ? response.status : null; - } + response && (this.response = response); } utils_default.inherits(AxiosError, Error, { toJSON: function toJSON() { @@ -25416,7 +25784,7 @@ utils_default.inherits(AxiosError, Error, { // Axios config: utils_default.toJSONObject(this.config), code: this.code, - status: this.status + status: this.response && this.response.status ? this.response.status : null }; } }); @@ -25448,13 +25816,9 @@ AxiosError.from = (error, code, config, request2, response, customProps) => { }, (prop) => { return prop !== "isAxiosError"; }); - const msg = error && error.message ? error.message : "Error"; - const errCode = code == null && error ? error.code : code; - AxiosError.call(axiosError, msg, errCode, config, request2, response); - if (error && axiosError.cause == null) { - Object.defineProperty(axiosError, "cause", { value: error, configurable: true }); - } - axiosError.name = error && error.name || "Error"; + AxiosError.call(axiosError, error.message, code, config, request2, response); + axiosError.cause = error; + axiosError.name = error.name; customProps && Object.assign(axiosError, customProps); return axiosError; }; @@ -25471,7 +25835,8 @@ function removeBrackets(key) { return utils_default.endsWith(key, "[]") ? key.slice(0, -2) : key; } function renderKey(path, key, dots) { - if (!path) return key; + if (!path) + return key; return path.concat(key).map(function each(token, i) { token = removeBrackets(token); return !dots && i ? "[" + token + "]" : token; @@ -25505,13 +25870,11 @@ function toFormData(obj, formData, options) { throw new TypeError("visitor must be a function"); } function convertValue(value) { - if (value === null) return ""; + if (value === null) + return ""; if (utils_default.isDate(value)) { return value.toISOString(); } - if (utils_default.isBoolean(value)) { - return value.toString(); - } if (!useBlob && utils_default.isBlob(value)) { throw new AxiosError_default("Blob is not supported. Use a Buffer instead."); } @@ -25551,7 +25914,8 @@ function toFormData(obj, formData, options) { isVisitable }); function build(value, path) { - if (utils_default.isUndefined(value)) return; + if (utils_default.isUndefined(value)) + return; if (stack.indexOf(value) !== -1) { throw Error("Circular reference detected in " + path.join(".")); } @@ -25613,18 +25977,13 @@ var AxiosURLSearchParams_default = AxiosURLSearchParams; // node_modules/axios/lib/helpers/buildURL.js function encode3(val) { - return encodeURIComponent(val).replace(/%3A/gi, ":").replace(/%24/g, "$").replace(/%2C/gi, ",").replace(/%20/g, "+"); + return encodeURIComponent(val).replace(/%3A/gi, ":").replace(/%24/g, "$").replace(/%2C/gi, ",").replace(/%20/g, "+").replace(/%5B/gi, "[").replace(/%5D/gi, "]"); } function buildURL(url, params, options) { if (!params) { return url; } const _encode2 = options && options.encode || encode3; - if (utils_default.isFunction(options)) { - options = { - serialize: options - }; - } const serializeFn = options && options.serialize; let serializedParams; if (serializeFn) { @@ -25669,7 +26028,7 @@ var InterceptorManager = class { * * @param {Number} id The ID that was returned by `use` * - * @returns {void} + * @returns {Boolean} `true` if the interceptor was removed, `false` otherwise */ eject(id) { if (this.handlers[id]) { @@ -25723,6 +26082,17 @@ var FormData_default = typeof FormData !== "undefined" ? FormData : null; var Blob_default = typeof Blob !== "undefined" ? Blob : null; // node_modules/axios/lib/platform/browser/index.js +var isStandardBrowserEnv = (() => { + let product; + if (typeof navigator !== "undefined" && ((product = navigator.product) === "ReactNative" || product === "NativeScript" || product === "NS")) { + return false; + } + return typeof window !== "undefined" && typeof document !== "undefined"; +})(); +var isStandardBrowserWebWorkerEnv = (() => { + return typeof WorkerGlobalScope !== "undefined" && // eslint-disable-next-line no-undef + self instanceof WorkerGlobalScope && typeof self.importScripts === "function"; +})(); var browser_default = { isBrowser: true, classes: { @@ -25730,35 +26100,16 @@ var browser_default = { FormData: FormData_default, Blob: Blob_default }, + isStandardBrowserEnv, + isStandardBrowserWebWorkerEnv, protocols: ["http", "https", "file", "blob", "url", "data"] }; -// node_modules/axios/lib/platform/common/utils.js -var utils_exports = {}; -__export(utils_exports, { - hasBrowserEnv: () => hasBrowserEnv, - hasStandardBrowserEnv: () => hasStandardBrowserEnv, - hasStandardBrowserWebWorkerEnv: () => hasStandardBrowserWebWorkerEnv, - navigator: () => _navigator, - origin: () => origin -}); -var hasBrowserEnv = typeof window !== "undefined" && typeof document !== "undefined"; -var _navigator = typeof navigator === "object" && navigator || void 0; -var hasStandardBrowserEnv = hasBrowserEnv && (!_navigator || ["ReactNative", "NativeScript", "NS"].indexOf(_navigator.product) < 0); -var hasStandardBrowserWebWorkerEnv = (() => { - return typeof WorkerGlobalScope !== "undefined" && // eslint-disable-next-line no-undef - self instanceof WorkerGlobalScope && typeof self.importScripts === "function"; -})(); -var origin = hasBrowserEnv && window.location.href || "http://localhost"; - -// node_modules/axios/lib/platform/index.js -var platform_default = __spreadValues(__spreadValues({}, utils_exports), browser_default); - // node_modules/axios/lib/helpers/toURLEncodedForm.js function toURLEncodedForm(data, options) { - return toFormData_default(data, new platform_default.classes.URLSearchParams(), __spreadValues({ + return toFormData_default(data, new browser_default.classes.URLSearchParams(), Object.assign({ visitor: function(value, key, path, helpers) { - if (platform_default.isNode && utils_default.isBuffer(value)) { + if (browser_default.isNode && utils_default.isBuffer(value)) { this.append(key, value.toString("base64")); return false; } @@ -25788,7 +26139,6 @@ function arrayToObject(arr) { function formDataToJSON(formData) { function buildPath(path, value, target, index) { let name = path[index++]; - if (name === "__proto__") return true; const isNumericKey = Number.isFinite(+name); const isLast = index >= path.length; name = !name && utils_default.isArray(target) ? target.length : name; @@ -25836,7 +26186,7 @@ function stringifySafely(rawValue, parser, encoder) { } var defaults = { transitional: transitional_default, - adapter: ["xhr", "http", "fetch"], + adapter: browser_default.isNode ? "http" : "xhr", transformRequest: [function transformRequest(data, headers) { const contentType = headers.getContentType() || ""; const hasJSONContentType = contentType.indexOf("application/json") > -1; @@ -25846,9 +26196,12 @@ var defaults = { } const isFormData2 = utils_default.isFormData(data); if (isFormData2) { + if (!hasJSONContentType) { + return data; + } return hasJSONContentType ? JSON.stringify(formDataToJSON_default(data)) : data; } - if (utils_default.isArrayBuffer(data) || utils_default.isBuffer(data) || utils_default.isStream(data) || utils_default.isFile(data) || utils_default.isBlob(data) || utils_default.isReadableStream(data)) { + if (utils_default.isArrayBuffer(data) || utils_default.isBuffer(data) || utils_default.isStream(data) || utils_default.isFile(data) || utils_default.isBlob(data)) { return data; } if (utils_default.isArrayBufferView(data)) { @@ -25882,14 +26235,11 @@ var defaults = { const transitional2 = this.transitional || defaults.transitional; const forcedJSONParsing = transitional2 && transitional2.forcedJSONParsing; const JSONRequested = this.responseType === "json"; - if (utils_default.isResponse(data) || utils_default.isReadableStream(data)) { - return data; - } if (data && utils_default.isString(data) && (forcedJSONParsing && !this.responseType || JSONRequested)) { const silentJSONParsing = transitional2 && transitional2.silentJSONParsing; const strictJSONParsing = !silentJSONParsing && JSONRequested; try { - return JSON.parse(data, this.parseReviver); + return JSON.parse(data); } catch (e) { if (strictJSONParsing) { if (e.name === "SyntaxError") { @@ -25911,8 +26261,8 @@ var defaults = { maxContentLength: -1, maxBodyLength: -1, env: { - FormData: platform_default.classes.FormData, - Blob: platform_default.classes.Blob + FormData: browser_default.classes.FormData, + Blob: browser_default.classes.Blob }, validateStatus: function validateStatus(status) { return status >= 200 && status < 300; @@ -26002,7 +26352,8 @@ function matchHeaderValue(context, value, header, filter2, isHeaderNameFilter) { if (isHeaderNameFilter) { value = header; } - if (!utils_default.isString(value)) return; + if (!utils_default.isString(value)) + return; if (utils_default.isString(filter2)) { return value.indexOf(filter2) !== -1; } @@ -26047,15 +26398,6 @@ var AxiosHeaders = class { setHeaders(header, valueOrRewrite); } else if (utils_default.isString(header) && (header = header.trim()) && !isValidHeaderName(header)) { setHeaders(parseHeaders_default(header), valueOrRewrite); - } else if (utils_default.isObject(header) && utils_default.isIterable(header)) { - let obj = {}, dest, key; - for (const entry of header) { - if (!utils_default.isArray(entry)) { - throw TypeError("Object iterator must return a key-value pair"); - } - obj[key = entry[0]] = (dest = obj[key]) ? utils_default.isArray(dest) ? [...dest, entry[1]] : [dest, entry[1]] : entry[1]; - } - setHeaders(obj, valueOrRewrite); } else { header != null && setHeader(valueOrRewrite, header, rewrite); } @@ -26159,9 +26501,6 @@ var AxiosHeaders = class { toString() { return Object.entries(this.toJSON()).map(([header, value]) => header + ": " + value).join("\n"); } - getSetCookie() { - return this.get("set-cookie") || []; - } get [Symbol.toStringTag]() { return "AxiosHeaders"; } @@ -26247,6 +26586,111 @@ function settle(resolve, reject, response) { } } +// node_modules/axios/lib/helpers/cookies.js +var cookies_default = browser_default.isStandardBrowserEnv ? ( + // Standard browser envs support document.cookie + function standardBrowserEnv() { + return { + write: function write2(name, value, expires, path, domain, secure) { + const cookie = []; + cookie.push(name + "=" + encodeURIComponent(value)); + if (utils_default.isNumber(expires)) { + cookie.push("expires=" + new Date(expires).toGMTString()); + } + if (utils_default.isString(path)) { + cookie.push("path=" + path); + } + if (utils_default.isString(domain)) { + cookie.push("domain=" + domain); + } + if (secure === true) { + cookie.push("secure"); + } + document.cookie = cookie.join("; "); + }, + read: function read2(name) { + const match2 = document.cookie.match(new RegExp("(^|;\\s*)(" + name + ")=([^;]*)")); + return match2 ? decodeURIComponent(match2[3]) : null; + }, + remove: function remove(name) { + this.write(name, "", Date.now() - 864e5); + } + }; + }() +) : ( + // Non standard browser env (web workers, react-native) lack needed support. + function nonStandardBrowserEnv() { + return { + write: function write2() { + }, + read: function read2() { + return null; + }, + remove: function remove() { + } + }; + }() +); + +// node_modules/axios/lib/helpers/isAbsoluteURL.js +function isAbsoluteURL(url) { + return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(url); +} + +// node_modules/axios/lib/helpers/combineURLs.js +function combineURLs(baseURL, relativeURL) { + return relativeURL ? baseURL.replace(/\/+$/, "") + "/" + relativeURL.replace(/^\/+/, "") : baseURL; +} + +// node_modules/axios/lib/core/buildFullPath.js +function buildFullPath(baseURL, requestedURL) { + if (baseURL && !isAbsoluteURL(requestedURL)) { + return combineURLs(baseURL, requestedURL); + } + return requestedURL; +} + +// node_modules/axios/lib/helpers/isURLSameOrigin.js +var isURLSameOrigin_default = browser_default.isStandardBrowserEnv ? ( + // Standard browser envs have full support of the APIs needed to test + // whether the request URL is of the same origin as current location. + function standardBrowserEnv2() { + const msie = /(msie|trident)/i.test(navigator.userAgent); + const urlParsingNode = document.createElement("a"); + let originURL; + function resolveURL(url) { + let href = url; + if (msie) { + urlParsingNode.setAttribute("href", href); + href = urlParsingNode.href; + } + urlParsingNode.setAttribute("href", href); + return { + href: urlParsingNode.href, + protocol: urlParsingNode.protocol ? urlParsingNode.protocol.replace(/:$/, "") : "", + host: urlParsingNode.host, + search: urlParsingNode.search ? urlParsingNode.search.replace(/^\?/, "") : "", + hash: urlParsingNode.hash ? urlParsingNode.hash.replace(/^#/, "") : "", + hostname: urlParsingNode.hostname, + port: urlParsingNode.port, + pathname: urlParsingNode.pathname.charAt(0) === "/" ? urlParsingNode.pathname : "/" + urlParsingNode.pathname + }; + } + originURL = resolveURL(window.location.href); + return function isURLSameOrigin(requestURL) { + const parsed = utils_default.isString(requestURL) ? resolveURL(requestURL) : requestURL; + return parsed.protocol === originURL.protocol && parsed.host === originURL.host; + }; + }() +) : ( + // Non standard browser envs (web workers, react-native) lack needed support. + function nonStandardBrowserEnv2() { + return function isURLSameOrigin() { + return true; + }; + }() +); + // node_modules/axios/lib/helpers/parseProtocol.js function parseProtocol(url) { const match2 = /^([-+\w]{1,25})(:?\/\/|:)/.exec(url); @@ -26289,46 +26733,11 @@ function speedometer(samplesCount, min2) { } var speedometer_default = speedometer; -// node_modules/axios/lib/helpers/throttle.js -function throttle(fn2, freq) { - let timestamp = 0; - let threshold = 1e3 / freq; - let lastArgs; - let timer; - const invoke = (args, now3 = Date.now()) => { - timestamp = now3; - lastArgs = null; - if (timer) { - clearTimeout(timer); - timer = null; - } - fn2(...args); - }; - const throttled = (...args) => { - const now3 = Date.now(); - const passed = now3 - timestamp; - if (passed >= threshold) { - invoke(args, now3); - } else { - lastArgs = args; - if (!timer) { - timer = setTimeout(() => { - timer = null; - invoke(lastArgs); - }, threshold - passed); - } - } - }; - const flush2 = () => lastArgs && invoke(lastArgs); - return [throttled, flush2]; -} -var throttle_default = throttle; - -// node_modules/axios/lib/helpers/progressEventReducer.js -var progressEventReducer = (listener, isDownloadStream, freq = 3) => { +// node_modules/axios/lib/adapters/xhr.js +function progressEventReducer(listener, isDownloadStream) { let bytesNotified = 0; const _speedometer = speedometer_default(50, 250); - return throttle_default((e) => { + return (e) => { const loaded = e.loaded; const total = e.lengthComputable ? e.total : void 0; const progressBytes = loaded - bytesNotified; @@ -26342,234 +26751,43 @@ var progressEventReducer = (listener, isDownloadStream, freq = 3) => { bytes: progressBytes, rate: rate ? rate : void 0, estimated: rate && total && inRange ? (total - loaded) / rate : void 0, - event: e, - lengthComputable: total != null, - [isDownloadStream ? "download" : "upload"]: true + event: e }; + data[isDownloadStream ? "download" : "upload"] = true; listener(data); - }, freq); -}; -var progressEventDecorator = (total, throttled) => { - const lengthComputable = total != null; - return [(loaded) => throttled[0]({ - lengthComputable, - total, - loaded - }), throttled[1]]; -}; -var asyncDecorator = (fn2) => (...args) => utils_default.asap(() => fn2(...args)); - -// node_modules/axios/lib/helpers/isURLSameOrigin.js -var isURLSameOrigin_default = platform_default.hasStandardBrowserEnv ? /* @__PURE__ */ ((origin2, isMSIE) => (url) => { - url = new URL(url, platform_default.origin); - return origin2.protocol === url.protocol && origin2.host === url.host && (isMSIE || origin2.port === url.port); -})( - new URL(platform_default.origin), - platform_default.navigator && /(msie|trident)/i.test(platform_default.navigator.userAgent) -) : () => true; - -// node_modules/axios/lib/helpers/cookies.js -var cookies_default = platform_default.hasStandardBrowserEnv ? ( - // Standard browser envs support document.cookie - { - write(name, value, expires, path, domain, secure, sameSite) { - if (typeof document === "undefined") return; - const cookie = [`${name}=${encodeURIComponent(value)}`]; - if (utils_default.isNumber(expires)) { - cookie.push(`expires=${new Date(expires).toUTCString()}`); - } - if (utils_default.isString(path)) { - cookie.push(`path=${path}`); - } - if (utils_default.isString(domain)) { - cookie.push(`domain=${domain}`); - } - if (secure === true) { - cookie.push("secure"); - } - if (utils_default.isString(sameSite)) { - cookie.push(`SameSite=${sameSite}`); - } - document.cookie = cookie.join("; "); - }, - read(name) { - if (typeof document === "undefined") return null; - const match2 = document.cookie.match(new RegExp("(?:^|; )" + name + "=([^;]*)")); - return match2 ? decodeURIComponent(match2[1]) : null; - }, - remove(name) { - this.write(name, "", Date.now() - 864e5, "/"); - } - } -) : ( - // Non-standard browser env (web workers, react-native) lack needed support. - { - write() { - }, - read() { - return null; - }, - remove() { - } - } -); - -// node_modules/axios/lib/helpers/isAbsoluteURL.js -function isAbsoluteURL(url) { - return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(url); -} - -// node_modules/axios/lib/helpers/combineURLs.js -function combineURLs(baseURL, relativeURL) { - return relativeURL ? baseURL.replace(/\/?\/$/, "") + "/" + relativeURL.replace(/^\/+/, "") : baseURL; -} - -// node_modules/axios/lib/core/buildFullPath.js -function buildFullPath(baseURL, requestedURL, allowAbsoluteUrls) { - let isRelativeUrl = !isAbsoluteURL(requestedURL); - if (baseURL && (isRelativeUrl || allowAbsoluteUrls == false)) { - return combineURLs(baseURL, requestedURL); - } - return requestedURL; -} - -// node_modules/axios/lib/core/mergeConfig.js -var headersToObject = (thing) => thing instanceof AxiosHeaders_default ? __spreadValues({}, thing) : thing; -function mergeConfig(config1, config2) { - config2 = config2 || {}; - const config = {}; - function getMergedValue(target, source, prop, caseless) { - if (utils_default.isPlainObject(target) && utils_default.isPlainObject(source)) { - return utils_default.merge.call({ caseless }, target, source); - } else if (utils_default.isPlainObject(source)) { - return utils_default.merge({}, source); - } else if (utils_default.isArray(source)) { - return source.slice(); - } - return source; - } - function mergeDeepProperties(a, b, prop, caseless) { - if (!utils_default.isUndefined(b)) { - return getMergedValue(a, b, prop, caseless); - } else if (!utils_default.isUndefined(a)) { - return getMergedValue(void 0, a, prop, caseless); - } - } - function valueFromConfig2(a, b) { - if (!utils_default.isUndefined(b)) { - return getMergedValue(void 0, b); - } - } - function defaultToConfig2(a, b) { - if (!utils_default.isUndefined(b)) { - return getMergedValue(void 0, b); - } else if (!utils_default.isUndefined(a)) { - return getMergedValue(void 0, a); - } - } - function mergeDirectKeys(a, b, prop) { - if (prop in config2) { - return getMergedValue(a, b); - } else if (prop in config1) { - return getMergedValue(void 0, a); - } - } - const mergeMap = { - url: valueFromConfig2, - method: valueFromConfig2, - data: valueFromConfig2, - baseURL: defaultToConfig2, - transformRequest: defaultToConfig2, - transformResponse: defaultToConfig2, - paramsSerializer: defaultToConfig2, - timeout: defaultToConfig2, - timeoutMessage: defaultToConfig2, - withCredentials: defaultToConfig2, - withXSRFToken: defaultToConfig2, - adapter: defaultToConfig2, - responseType: defaultToConfig2, - xsrfCookieName: defaultToConfig2, - xsrfHeaderName: defaultToConfig2, - onUploadProgress: defaultToConfig2, - onDownloadProgress: defaultToConfig2, - decompress: defaultToConfig2, - maxContentLength: defaultToConfig2, - maxBodyLength: defaultToConfig2, - beforeRedirect: defaultToConfig2, - transport: defaultToConfig2, - httpAgent: defaultToConfig2, - httpsAgent: defaultToConfig2, - cancelToken: defaultToConfig2, - socketPath: defaultToConfig2, - responseEncoding: defaultToConfig2, - validateStatus: mergeDirectKeys, - headers: (a, b, prop) => mergeDeepProperties(headersToObject(a), headersToObject(b), prop, true) }; - utils_default.forEach(Object.keys(__spreadValues(__spreadValues({}, config1), config2)), function computeConfigValue(prop) { - const merge3 = mergeMap[prop] || mergeDeepProperties; - const configValue = merge3(config1[prop], config2[prop], prop); - utils_default.isUndefined(configValue) && merge3 !== mergeDirectKeys || (config[prop] = configValue); - }); - return config; } - -// node_modules/axios/lib/helpers/resolveConfig.js -var resolveConfig_default = (config) => { - const newConfig = mergeConfig({}, config); - let { data, withXSRFToken, xsrfHeaderName, xsrfCookieName, headers, auth: auth2 } = newConfig; - newConfig.headers = headers = AxiosHeaders_default.from(headers); - newConfig.url = buildURL(buildFullPath(newConfig.baseURL, newConfig.url, newConfig.allowAbsoluteUrls), config.params, config.paramsSerializer); - if (auth2) { - headers.set( - "Authorization", - "Basic " + btoa((auth2.username || "") + ":" + (auth2.password ? unescape(encodeURIComponent(auth2.password)) : "")) - ); - } - if (utils_default.isFormData(data)) { - if (platform_default.hasStandardBrowserEnv || platform_default.hasStandardBrowserWebWorkerEnv) { - headers.setContentType(void 0); - } else if (utils_default.isFunction(data.getHeaders)) { - const formHeaders = data.getHeaders(); - const allowedHeaders = ["content-type", "content-length"]; - Object.entries(formHeaders).forEach(([key, val]) => { - if (allowedHeaders.includes(key.toLowerCase())) { - headers.set(key, val); - } - }); - } - } - if (platform_default.hasStandardBrowserEnv) { - withXSRFToken && utils_default.isFunction(withXSRFToken) && (withXSRFToken = withXSRFToken(newConfig)); - if (withXSRFToken || withXSRFToken !== false && isURLSameOrigin_default(newConfig.url)) { - const xsrfValue = xsrfHeaderName && xsrfCookieName && cookies_default.read(xsrfCookieName); - if (xsrfValue) { - headers.set(xsrfHeaderName, xsrfValue); - } - } - } - return newConfig; -}; - -// node_modules/axios/lib/adapters/xhr.js var isXHRAdapterSupported = typeof XMLHttpRequest !== "undefined"; var xhr_default = isXHRAdapterSupported && function(config) { return new Promise(function dispatchXhrRequest(resolve, reject) { - const _config = resolveConfig_default(config); - let requestData = _config.data; - const requestHeaders = AxiosHeaders_default.from(_config.headers).normalize(); - let { responseType, onUploadProgress, onDownloadProgress } = _config; + let requestData = config.data; + const requestHeaders = AxiosHeaders_default.from(config.headers).normalize(); + const responseType = config.responseType; let onCanceled; - let uploadThrottled, downloadThrottled; - let flushUpload, flushDownload; function done() { - flushUpload && flushUpload(); - flushDownload && flushDownload(); - _config.cancelToken && _config.cancelToken.unsubscribe(onCanceled); - _config.signal && _config.signal.removeEventListener("abort", onCanceled); + if (config.cancelToken) { + config.cancelToken.unsubscribe(onCanceled); + } + if (config.signal) { + config.signal.removeEventListener("abort", onCanceled); + } + } + if (utils_default.isFormData(requestData)) { + if (browser_default.isStandardBrowserEnv || browser_default.isStandardBrowserWebWorkerEnv) { + requestHeaders.setContentType(false); + } else { + requestHeaders.setContentType("multipart/form-data;", false); + } } let request2 = new XMLHttpRequest(); - request2.open(_config.method.toUpperCase(), _config.url, true); - request2.timeout = _config.timeout; + if (config.auth) { + const username = config.auth.username || ""; + const password = config.auth.password ? unescape(encodeURIComponent(config.auth.password)) : ""; + requestHeaders.set("Authorization", "Basic " + btoa(username + ":" + password)); + } + const fullPath = buildFullPath(config.baseURL, config.url); + request2.open(config.method.toUpperCase(), buildURL(fullPath, config.params, config.paramsSerializer), true); + request2.timeout = config.timeout; function onloadend() { if (!request2) { return; @@ -26615,18 +26833,15 @@ var xhr_default = isXHRAdapterSupported && function(config) { reject(new AxiosError_default("Request aborted", AxiosError_default.ECONNABORTED, config, request2)); request2 = null; }; - request2.onerror = function handleError(event) { - const msg = event && event.message ? event.message : "Network Error"; - const err = new AxiosError_default(msg, AxiosError_default.ERR_NETWORK, config, request2); - err.event = event || null; - reject(err); + request2.onerror = function handleError() { + reject(new AxiosError_default("Network Error", AxiosError_default.ERR_NETWORK, config, request2)); request2 = null; }; request2.ontimeout = function handleTimeout() { - let timeoutErrorMessage = _config.timeout ? "timeout of " + _config.timeout + "ms exceeded" : "timeout exceeded"; - const transitional2 = _config.transitional || transitional_default; - if (_config.timeoutErrorMessage) { - timeoutErrorMessage = _config.timeoutErrorMessage; + let timeoutErrorMessage = config.timeout ? "timeout of " + config.timeout + "ms exceeded" : "timeout exceeded"; + const transitional2 = config.transitional || transitional_default; + if (config.timeoutErrorMessage) { + timeoutErrorMessage = config.timeoutErrorMessage; } reject(new AxiosError_default( timeoutErrorMessage, @@ -26636,28 +26851,31 @@ var xhr_default = isXHRAdapterSupported && function(config) { )); request2 = null; }; + if (browser_default.isStandardBrowserEnv) { + const xsrfValue = (config.withCredentials || isURLSameOrigin_default(fullPath)) && config.xsrfCookieName && cookies_default.read(config.xsrfCookieName); + if (xsrfValue) { + requestHeaders.set(config.xsrfHeaderName, xsrfValue); + } + } requestData === void 0 && requestHeaders.setContentType(null); if ("setRequestHeader" in request2) { utils_default.forEach(requestHeaders.toJSON(), function setRequestHeader(val, key) { request2.setRequestHeader(key, val); }); } - if (!utils_default.isUndefined(_config.withCredentials)) { - request2.withCredentials = !!_config.withCredentials; + if (!utils_default.isUndefined(config.withCredentials)) { + request2.withCredentials = !!config.withCredentials; } if (responseType && responseType !== "json") { - request2.responseType = _config.responseType; + request2.responseType = config.responseType; } - if (onDownloadProgress) { - [downloadThrottled, flushDownload] = progressEventReducer(onDownloadProgress, true); - request2.addEventListener("progress", downloadThrottled); + if (typeof config.onDownloadProgress === "function") { + request2.addEventListener("progress", progressEventReducer(config.onDownloadProgress, true)); } - if (onUploadProgress && request2.upload) { - [uploadThrottled, flushUpload] = progressEventReducer(onUploadProgress); - request2.upload.addEventListener("progress", uploadThrottled); - request2.upload.addEventListener("loadend", flushUpload); + if (typeof config.onUploadProgress === "function" && request2.upload) { + request2.upload.addEventListener("progress", progressEventReducer(config.onUploadProgress)); } - if (_config.cancelToken || _config.signal) { + if (config.cancelToken || config.signal) { onCanceled = (cancel) => { if (!request2) { return; @@ -26666,13 +26884,13 @@ var xhr_default = isXHRAdapterSupported && function(config) { request2.abort(); request2 = null; }; - _config.cancelToken && _config.cancelToken.subscribe(onCanceled); - if (_config.signal) { - _config.signal.aborted ? onCanceled() : _config.signal.addEventListener("abort", onCanceled); + config.cancelToken && config.cancelToken.subscribe(onCanceled); + if (config.signal) { + config.signal.aborted ? onCanceled() : config.signal.addEventListener("abort", onCanceled); } } - const protocol = parseProtocol(_config.url); - if (protocol && platform_default.protocols.indexOf(protocol) === -1) { + const protocol = parseProtocol(fullPath); + if (protocol && browser_default.protocols.indexOf(protocol) === -1) { reject(new AxiosError_default("Unsupported protocol " + protocol + ":", AxiosError_default.ERR_BAD_REQUEST, config)); return; } @@ -26680,354 +26898,10 @@ var xhr_default = isXHRAdapterSupported && function(config) { }); }; -// node_modules/axios/lib/helpers/composeSignals.js -var composeSignals = (signals, timeout) => { - const { length } = signals = signals ? signals.filter(Boolean) : []; - if (timeout || length) { - let controller = new AbortController(); - let aborted; - const onabort = function(reason) { - if (!aborted) { - aborted = true; - unsubscribe(); - const err = reason instanceof Error ? reason : this.reason; - controller.abort(err instanceof AxiosError_default ? err : new CanceledError_default(err instanceof Error ? err.message : err)); - } - }; - let timer = timeout && setTimeout(() => { - timer = null; - onabort(new AxiosError_default(`timeout ${timeout} of ms exceeded`, AxiosError_default.ETIMEDOUT)); - }, timeout); - const unsubscribe = () => { - if (signals) { - timer && clearTimeout(timer); - timer = null; - signals.forEach((signal2) => { - signal2.unsubscribe ? signal2.unsubscribe(onabort) : signal2.removeEventListener("abort", onabort); - }); - signals = null; - } - }; - signals.forEach((signal2) => signal2.addEventListener("abort", onabort)); - const { signal } = controller; - signal.unsubscribe = () => utils_default.asap(unsubscribe); - return signal; - } -}; -var composeSignals_default = composeSignals; - -// node_modules/axios/lib/helpers/trackStream.js -var streamChunk = function* (chunk, chunkSize) { - let len = chunk.byteLength; - if (!chunkSize || len < chunkSize) { - yield chunk; - return; - } - let pos = 0; - let end2; - while (pos < len) { - end2 = pos + chunkSize; - yield chunk.slice(pos, end2); - pos = end2; - } -}; -var readBytes = function(iterable, chunkSize) { - return __asyncGenerator(this, null, function* () { - try { - for (var iter = __forAwait(readStream(iterable)), more, temp, error; more = !(temp = yield new __await(iter.next())).done; more = false) { - const chunk = temp.value; - yield* __yieldStar(streamChunk(chunk, chunkSize)); - } - } catch (temp) { - error = [temp]; - } finally { - try { - more && (temp = iter.return) && (yield new __await(temp.call(iter))); - } finally { - if (error) - throw error[0]; - } - } - }); -}; -var readStream = function(stream) { - return __asyncGenerator(this, null, function* () { - if (stream[Symbol.asyncIterator]) { - yield* __yieldStar(stream); - return; - } - const reader = stream.getReader(); - try { - for (; ; ) { - const { done, value } = yield new __await(reader.read()); - if (done) { - break; - } - yield value; - } - } finally { - yield new __await(reader.cancel()); - } - }); -}; -var trackStream = (stream, chunkSize, onProgress, onFinish) => { - const iterator2 = readBytes(stream, chunkSize); - let bytes = 0; - let done; - let _onFinish = (e) => { - if (!done) { - done = true; - onFinish && onFinish(e); - } - }; - return new ReadableStream({ - pull(controller) { - return __async(this, null, function* () { - try { - const { done: done2, value } = yield iterator2.next(); - if (done2) { - _onFinish(); - controller.close(); - return; - } - let len = value.byteLength; - if (onProgress) { - let loadedBytes = bytes += len; - onProgress(loadedBytes); - } - controller.enqueue(new Uint8Array(value)); - } catch (err) { - _onFinish(err); - throw err; - } - }); - }, - cancel(reason) { - _onFinish(reason); - return iterator2.return(); - } - }, { - highWaterMark: 2 - }); -}; - -// node_modules/axios/lib/adapters/fetch.js -var DEFAULT_CHUNK_SIZE = 64 * 1024; -var { isFunction: isFunction2 } = utils_default; -var globalFetchAPI = (({ Request, Response }) => ({ - Request, - Response -}))(utils_default.global); -var { - ReadableStream: ReadableStream2, - TextEncoder: TextEncoder2 -} = utils_default.global; -var test = (fn2, ...args) => { - try { - return !!fn2(...args); - } catch (e) { - return false; - } -}; -var factory = (env) => { - env = utils_default.merge.call({ - skipUndefined: true - }, globalFetchAPI, env); - const { fetch: envFetch, Request, Response } = env; - const isFetchSupported = envFetch ? isFunction2(envFetch) : typeof fetch === "function"; - const isRequestSupported = isFunction2(Request); - const isResponseSupported = isFunction2(Response); - if (!isFetchSupported) { - return false; - } - const isReadableStreamSupported = isFetchSupported && isFunction2(ReadableStream2); - const encodeText = isFetchSupported && (typeof TextEncoder2 === "function" ? /* @__PURE__ */ ((encoder) => (str) => encoder.encode(str))(new TextEncoder2()) : (str) => __async(null, null, function* () { - return new Uint8Array(yield new Request(str).arrayBuffer()); - })); - const supportsRequestStream = isRequestSupported && isReadableStreamSupported && test(() => { - let duplexAccessed = false; - const hasContentType = new Request(platform_default.origin, { - body: new ReadableStream2(), - method: "POST", - get duplex() { - duplexAccessed = true; - return "half"; - } - }).headers.has("Content-Type"); - return duplexAccessed && !hasContentType; - }); - const supportsResponseStream = isResponseSupported && isReadableStreamSupported && test(() => utils_default.isReadableStream(new Response("").body)); - const resolvers = { - stream: supportsResponseStream && ((res) => res.body) - }; - isFetchSupported && (() => { - ["text", "arrayBuffer", "blob", "formData", "stream"].forEach((type) => { - !resolvers[type] && (resolvers[type] = (res, config) => { - let method = res && res[type]; - if (method) { - return method.call(res); - } - throw new AxiosError_default(`Response type '${type}' is not supported`, AxiosError_default.ERR_NOT_SUPPORT, config); - }); - }); - })(); - const getBodyLength = (body) => __async(null, null, function* () { - if (body == null) { - return 0; - } - if (utils_default.isBlob(body)) { - return body.size; - } - if (utils_default.isSpecCompliantForm(body)) { - const _request = new Request(platform_default.origin, { - method: "POST", - body - }); - return (yield _request.arrayBuffer()).byteLength; - } - if (utils_default.isArrayBufferView(body) || utils_default.isArrayBuffer(body)) { - return body.byteLength; - } - if (utils_default.isURLSearchParams(body)) { - body = body + ""; - } - if (utils_default.isString(body)) { - return (yield encodeText(body)).byteLength; - } - }); - const resolveBodyLength = (headers, body) => __async(null, null, function* () { - const length = utils_default.toFiniteNumber(headers.getContentLength()); - return length == null ? getBodyLength(body) : length; - }); - return (config) => __async(null, null, function* () { - let { - url, - method, - data, - signal, - cancelToken, - timeout, - onDownloadProgress, - onUploadProgress, - responseType, - headers, - withCredentials = "same-origin", - fetchOptions - } = resolveConfig_default(config); - let _fetch = envFetch || fetch; - responseType = responseType ? (responseType + "").toLowerCase() : "text"; - let composedSignal = composeSignals_default([signal, cancelToken && cancelToken.toAbortSignal()], timeout); - let request2 = null; - const unsubscribe = composedSignal && composedSignal.unsubscribe && (() => { - composedSignal.unsubscribe(); - }); - let requestContentLength; - try { - if (onUploadProgress && supportsRequestStream && method !== "get" && method !== "head" && (requestContentLength = yield resolveBodyLength(headers, data)) !== 0) { - let _request = new Request(url, { - method: "POST", - body: data, - duplex: "half" - }); - let contentTypeHeader; - if (utils_default.isFormData(data) && (contentTypeHeader = _request.headers.get("content-type"))) { - headers.setContentType(contentTypeHeader); - } - if (_request.body) { - const [onProgress, flush2] = progressEventDecorator( - requestContentLength, - progressEventReducer(asyncDecorator(onUploadProgress)) - ); - data = trackStream(_request.body, DEFAULT_CHUNK_SIZE, onProgress, flush2); - } - } - if (!utils_default.isString(withCredentials)) { - withCredentials = withCredentials ? "include" : "omit"; - } - const isCredentialsSupported = isRequestSupported && "credentials" in Request.prototype; - const resolvedOptions = __spreadProps(__spreadValues({}, fetchOptions), { - signal: composedSignal, - method: method.toUpperCase(), - headers: headers.normalize().toJSON(), - body: data, - duplex: "half", - credentials: isCredentialsSupported ? withCredentials : void 0 - }); - request2 = isRequestSupported && new Request(url, resolvedOptions); - let response = yield isRequestSupported ? _fetch(request2, fetchOptions) : _fetch(url, resolvedOptions); - const isStreamResponse = supportsResponseStream && (responseType === "stream" || responseType === "response"); - if (supportsResponseStream && (onDownloadProgress || isStreamResponse && unsubscribe)) { - const options = {}; - ["status", "statusText", "headers"].forEach((prop) => { - options[prop] = response[prop]; - }); - const responseContentLength = utils_default.toFiniteNumber(response.headers.get("content-length")); - const [onProgress, flush2] = onDownloadProgress && progressEventDecorator( - responseContentLength, - progressEventReducer(asyncDecorator(onDownloadProgress), true) - ) || []; - response = new Response( - trackStream(response.body, DEFAULT_CHUNK_SIZE, onProgress, () => { - flush2 && flush2(); - unsubscribe && unsubscribe(); - }), - options - ); - } - responseType = responseType || "text"; - let responseData = yield resolvers[utils_default.findKey(resolvers, responseType) || "text"](response, config); - !isStreamResponse && unsubscribe && unsubscribe(); - return yield new Promise((resolve, reject) => { - settle(resolve, reject, { - data: responseData, - headers: AxiosHeaders_default.from(response.headers), - status: response.status, - statusText: response.statusText, - config, - request: request2 - }); - }); - } catch (err) { - unsubscribe && unsubscribe(); - if (err && err.name === "TypeError" && /Load failed|fetch/i.test(err.message)) { - throw Object.assign( - new AxiosError_default("Network Error", AxiosError_default.ERR_NETWORK, config, request2), - { - cause: err.cause || err - } - ); - } - throw AxiosError_default.from(err, err && err.code, config, request2); - } - }); -}; -var seedCache = /* @__PURE__ */ new Map(); -var getFetch = (config) => { - let env = config && config.env || {}; - const { fetch: fetch2, Request, Response } = env; - const seeds = [ - Request, - Response, - fetch2 - ]; - let len = seeds.length, i = len, seed, target, map = seedCache; - while (i--) { - seed = seeds[i]; - target = map.get(seed); - target === void 0 && map.set(seed, target = i ? /* @__PURE__ */ new Map() : factory(env)); - map = target; - } - return target; -}; -var adapter = getFetch(); - // node_modules/axios/lib/adapters/adapters.js var knownAdapters = { http: null_default, - xhr: xhr_default, - fetch: { - get: getFetch - } + xhr: xhr_default }; utils_default.forEach(knownAdapters, (fn2, value) => { if (fn2) { @@ -27038,51 +26912,34 @@ utils_default.forEach(knownAdapters, (fn2, value) => { Object.defineProperty(fn2, "adapterName", { value }); } }); -var renderReason = (reason) => `- ${reason}`; -var isResolvedHandle = (adapter2) => utils_default.isFunction(adapter2) || adapter2 === null || adapter2 === false; -function getAdapter(adapters, config) { - adapters = utils_default.isArray(adapters) ? adapters : [adapters]; - const { length } = adapters; - let nameOrAdapter; - let adapter2; - const rejectedReasons = {}; - for (let i = 0; i < length; i++) { - nameOrAdapter = adapters[i]; - let id; - adapter2 = nameOrAdapter; - if (!isResolvedHandle(nameOrAdapter)) { - adapter2 = knownAdapters[(id = String(nameOrAdapter)).toLowerCase()]; - if (adapter2 === void 0) { - throw new AxiosError_default(`Unknown adapter '${id}'`); +var adapters_default = { + getAdapter: (adapters) => { + adapters = utils_default.isArray(adapters) ? adapters : [adapters]; + const { length } = adapters; + let nameOrAdapter; + let adapter; + for (let i = 0; i < length; i++) { + nameOrAdapter = adapters[i]; + if (adapter = utils_default.isString(nameOrAdapter) ? knownAdapters[nameOrAdapter.toLowerCase()] : nameOrAdapter) { + break; } } - if (adapter2 && (utils_default.isFunction(adapter2) || (adapter2 = adapter2.get(config)))) { - break; + if (!adapter) { + if (adapter === false) { + throw new AxiosError_default( + `Adapter ${nameOrAdapter} is not supported by the environment`, + "ERR_NOT_SUPPORT" + ); + } + throw new Error( + utils_default.hasOwnProp(knownAdapters, nameOrAdapter) ? `Adapter '${nameOrAdapter}' is not available in the build` : `Unknown adapter '${nameOrAdapter}'` + ); } - rejectedReasons[id || "#" + i] = adapter2; - } - if (!adapter2) { - const reasons = Object.entries(rejectedReasons).map( - ([id, state]) => `adapter ${id} ` + (state === false ? "is not supported by the environment" : "is not available in the build") - ); - let s2 = length ? reasons.length > 1 ? "since :\n" + reasons.map(renderReason).join("\n") : " " + renderReason(reasons[0]) : "as no adapter specified"; - throw new AxiosError_default( - `There is no suitable adapter to dispatch the request ` + s2, - "ERR_NOT_SUPPORT" - ); - } - return adapter2; -} -var adapters_default = { - /** - * Resolve an adapter from a list of adapter names or functions. - * @type {Function} - */ - getAdapter, - /** - * Exposes all known adapters - * @type {Object} - */ + if (!utils_default.isFunction(adapter)) { + throw new TypeError("adapter is not a function"); + } + return adapter; + }, adapters: knownAdapters }; @@ -27105,8 +26962,8 @@ function dispatchRequest(config) { if (["post", "put", "patch"].indexOf(config.method) !== -1) { config.headers.setContentType("application/x-www-form-urlencoded", false); } - const adapter2 = adapters_default.getAdapter(config.adapter || defaults_default.adapter, config); - return adapter2(config).then(function onAdapterResolution(response) { + const adapter = adapters_default.getAdapter(config.adapter || defaults_default.adapter); + return adapter(config).then(function onAdapterResolution(response) { throwIfCancellationRequested(config); response.data = transformData.call( config, @@ -27131,8 +26988,87 @@ function dispatchRequest(config) { }); } +// node_modules/axios/lib/core/mergeConfig.js +var headersToObject = (thing) => thing instanceof AxiosHeaders_default ? thing.toJSON() : thing; +function mergeConfig(config1, config2) { + config2 = config2 || {}; + const config = {}; + function getMergedValue(target, source, caseless) { + if (utils_default.isPlainObject(target) && utils_default.isPlainObject(source)) { + return utils_default.merge.call({ caseless }, target, source); + } else if (utils_default.isPlainObject(source)) { + return utils_default.merge({}, source); + } else if (utils_default.isArray(source)) { + return source.slice(); + } + return source; + } + function mergeDeepProperties(a, b, caseless) { + if (!utils_default.isUndefined(b)) { + return getMergedValue(a, b, caseless); + } else if (!utils_default.isUndefined(a)) { + return getMergedValue(void 0, a, caseless); + } + } + function valueFromConfig2(a, b) { + if (!utils_default.isUndefined(b)) { + return getMergedValue(void 0, b); + } + } + function defaultToConfig2(a, b) { + if (!utils_default.isUndefined(b)) { + return getMergedValue(void 0, b); + } else if (!utils_default.isUndefined(a)) { + return getMergedValue(void 0, a); + } + } + function mergeDirectKeys(a, b, prop) { + if (prop in config2) { + return getMergedValue(a, b); + } else if (prop in config1) { + return getMergedValue(void 0, a); + } + } + const mergeMap = { + url: valueFromConfig2, + method: valueFromConfig2, + data: valueFromConfig2, + baseURL: defaultToConfig2, + transformRequest: defaultToConfig2, + transformResponse: defaultToConfig2, + paramsSerializer: defaultToConfig2, + timeout: defaultToConfig2, + timeoutMessage: defaultToConfig2, + withCredentials: defaultToConfig2, + adapter: defaultToConfig2, + responseType: defaultToConfig2, + xsrfCookieName: defaultToConfig2, + xsrfHeaderName: defaultToConfig2, + onUploadProgress: defaultToConfig2, + onDownloadProgress: defaultToConfig2, + decompress: defaultToConfig2, + maxContentLength: defaultToConfig2, + maxBodyLength: defaultToConfig2, + beforeRedirect: defaultToConfig2, + transport: defaultToConfig2, + httpAgent: defaultToConfig2, + httpsAgent: defaultToConfig2, + cancelToken: defaultToConfig2, + socketPath: defaultToConfig2, + responseEncoding: defaultToConfig2, + validateStatus: mergeDirectKeys, + headers: (a, b) => mergeDeepProperties(headersToObject(a), headersToObject(b), true) + }; + utils_default.forEach(Object.keys(Object.assign({}, config1, config2)), function computeConfigValue(prop) { + const merge3 = mergeMap[prop] || mergeDeepProperties; + const configValue = merge3(config1[prop], config2[prop], prop); + utils_default.isUndefined(configValue) && merge3 !== mergeDirectKeys || (config[prop] = configValue); + }); + return config; +} + // node_modules/axios/lib/env/data.js -var VERSION7 = "1.13.2"; +var VERSION7 = "1.5.0"; // node_modules/axios/lib/helpers/validator.js var validators = {}; @@ -27165,12 +27101,6 @@ validators.transitional = function transitional(validator, version2, message) { return validator ? validator(value, opt, opts) : true; }; }; -validators.spelling = function spelling(correctSpelling) { - return (value, opt) => { - console.warn(`${opt} is likely a misspelling of ${correctSpelling}`); - return true; - }; -}; function assertOptions(options, schema, allowUnknown) { if (typeof options !== "object") { throw new AxiosError_default("options must be an object", AxiosError_default.ERR_BAD_OPTION_VALUE); @@ -27202,7 +27132,7 @@ var validator_default = { var validators2 = validator_default.validators; var Axios = class { constructor(instanceConfig) { - this.defaults = instanceConfig || {}; + this.defaults = instanceConfig; this.interceptors = { request: new InterceptorManager_default(), response: new InterceptorManager_default() @@ -27217,28 +27147,6 @@ var Axios = class { * @returns {Promise} The Promise to be fulfilled */ request(configOrUrl, config) { - return __async(this, null, function* () { - try { - return yield this._request(configOrUrl, config); - } catch (err) { - if (err instanceof Error) { - let dummy = {}; - Error.captureStackTrace ? Error.captureStackTrace(dummy) : dummy = new Error(); - const stack = dummy.stack ? dummy.stack.replace(/^.+\n/, "") : ""; - try { - if (!err.stack) { - err.stack = stack; - } else if (stack && !String(err.stack).endsWith(stack.replace(/^.+\n.+\n/, ""))) { - err.stack += "\n" + stack; - } - } catch (e) { - } - } - throw err; - } - }); - } - _request(configOrUrl, config) { if (typeof configOrUrl === "string") { config = config || {}; config.url = configOrUrl; @@ -27266,16 +27174,6 @@ var Axios = class { }, true); } } - if (config.allowAbsoluteUrls !== void 0) { - } else if (this.defaults.allowAbsoluteUrls !== void 0) { - config.allowAbsoluteUrls = this.defaults.allowAbsoluteUrls; - } else { - config.allowAbsoluteUrls = true; - } - validator_default.assertOptions(config, { - baseUrl: validators2.spelling("baseURL"), - withXsrfToken: validators2.spelling("withXSRFToken") - }, true); config.method = (config.method || this.defaults.method || "get").toLowerCase(); let contextHeaders = headers && utils_default.merge( headers.common, @@ -27306,8 +27204,8 @@ var Axios = class { let len; if (!synchronousRequestInterceptors) { const chain = [dispatchRequest.bind(this), void 0]; - chain.unshift(...requestInterceptorChain); - chain.push(...responseInterceptorChain); + chain.unshift.apply(chain, requestInterceptorChain); + chain.push.apply(chain, responseInterceptorChain); len = chain.length; promise = Promise.resolve(config); while (i < len) { @@ -27317,6 +27215,7 @@ var Axios = class { } len = requestInterceptorChain.length; let newConfig = config; + i = 0; while (i < len) { const onFulfilled = requestInterceptorChain[i++]; const onRejected = requestInterceptorChain[i++]; @@ -27341,7 +27240,7 @@ var Axios = class { } getUri(config) { config = mergeConfig(this.defaults, config); - const fullPath = buildFullPath(config.baseURL, config.url, config.allowAbsoluteUrls); + const fullPath = buildFullPath(config.baseURL, config.url); return buildURL(fullPath, config.params, config.paramsSerializer); } }; @@ -27384,7 +27283,8 @@ var CancelToken = class _CancelToken { }); const token = this; this.promise.then((cancel) => { - if (!token._listeners) return; + if (!token._listeners) + return; let i = token._listeners.length; while (i-- > 0) { token._listeners[i](cancel); @@ -27444,15 +27344,6 @@ var CancelToken = class _CancelToken { this._listeners.splice(index, 1); } } - toAbortSignal() { - const controller = new AbortController(); - const abort = (err) => { - controller.abort(err); - }; - this.subscribe(abort); - controller.signal.unsubscribe = () => this.unsubscribe(abort); - return controller.signal; - } /** * Returns an object that contains a new `CancelToken` and a function that, when called, * cancels the `CancelToken`. @@ -27546,13 +27437,7 @@ var HttpStatusCode = { InsufficientStorage: 507, LoopDetected: 508, NotExtended: 510, - NetworkAuthenticationRequired: 511, - WebServerIsDown: 521, - ConnectionTimedOut: 522, - OriginIsUnreachable: 523, - TimeoutOccurred: 524, - SslHandshakeFailed: 525, - InvalidSslCertificate: 526 + NetworkAuthenticationRequired: 511 }; Object.entries(HttpStatusCode).forEach(([key, value]) => { HttpStatusCode[value] = key; @@ -27608,7 +27493,7 @@ var { AxiosHeaders: AxiosHeaders2, HttpStatusCode: HttpStatusCode2, formToJSON, - getAdapter: getAdapter2, + getAdapter, mergeConfig: mergeConfig2 } = axios_default; @@ -28571,7 +28456,8 @@ function flip(_ref) { }; for (var _i = numberOfChecks; _i > 0; _i--) { var _ret = _loop(_i); - if (_ret === "break") break; + if (_ret === "break") + break; } } if (state.placement !== firstFittingPlacement) { @@ -29270,7 +29156,7 @@ function addFilterInput(filter2, el, idx, plugin) { } }); const patternField = new import_obsidian12.TextComponent(el); - patternField.setPlaceholder("regex pattern").setValue(filter2.pattern).onChange((value) => __async(null, null, function* () { + patternField.setPlaceholder("regex pattern").setValue(filter2.pattern).onChange((value) => __async(this, null, function* () { if (!value) { return; } @@ -29281,7 +29167,7 @@ function addFilterInput(filter2, el, idx, plugin) { patternEl.style.width = "250px"; item.appendChild(patternEl); const replaceField = new import_obsidian12.TextComponent(el); - replaceField.setPlaceholder("replacement").setValue(filter2.replace).onChange((value) => __async(null, null, function* () { + replaceField.setPlaceholder("replacement").setValue(filter2.replace).onChange((value) => __async(this, null, function* () { if (!value) { return; } @@ -29293,7 +29179,7 @@ function addFilterInput(filter2, el, idx, plugin) { replaceEl.style.marginLeft = "5px"; item.appendChild(replaceEl); const flagField = new import_obsidian12.TextComponent(el); - flagField.setPlaceholder("flags").setValue(filter2.flags).onChange((value) => __async(null, null, function* () { + flagField.setPlaceholder("flags").setValue(filter2.flags).onChange((value) => __async(this, null, function* () { if (!value) { return; } @@ -29307,7 +29193,7 @@ function addFilterInput(filter2, el, idx, plugin) { const removeButton = new import_obsidian12.ButtonComponent(el); removeButton.setIcon("minus"); removeButton.setTooltip("Remove filter"); - removeButton.onClick(() => __async(null, null, function* () { + removeButton.onClick(() => __async(this, null, function* () { plugin.settings.customFilters.splice(idx, 1); el.empty(); for (let i = 0; i < plugin.settings.customFilters.length; i++) { @@ -29583,7 +29469,8 @@ function create_if_block_24(ctx) { p(ctx2, dirty) { if (dirty & /*diff*/ 1 && t_value !== (t_value = /*part*/ - ctx2[1].value + "")) set_data(t, t_value); + ctx2[1].value + "")) + set_data(t, t_value); }, d(detaching) { if (detaching) { @@ -29612,7 +29499,8 @@ function create_if_block_14(ctx) { p(ctx2, dirty) { if (dirty & /*diff*/ 1 && t_value !== (t_value = /*part*/ - ctx2[1].value + "")) set_data(t, t_value); + ctx2[1].value + "")) + set_data(t, t_value); }, d(detaching) { if (detaching) { @@ -29627,28 +29515,33 @@ function create_each_block4(ctx) { if ( /*part*/ ctx2[1].added - ) return create_if_block_14; + ) + return create_if_block_14; if ( /*part*/ ctx2[1].removed - ) return create_if_block_24; + ) + return create_if_block_24; } let current_block_type = select_block_type(ctx, -1); let if_block = current_block_type && current_block_type(ctx); return { c() { - if (if_block) if_block.c(); + if (if_block) + if_block.c(); if_block_anchor = empty(); }, m(target, anchor) { - if (if_block) if_block.m(target, anchor); + if (if_block) + if_block.m(target, anchor); insert(target, if_block_anchor, anchor); }, p(ctx2, dirty) { if (current_block_type === (current_block_type = select_block_type(ctx2, dirty)) && if_block) { if_block.p(ctx2, dirty); } else { - if (if_block) if_block.d(1); + if (if_block) + if_block.d(1); if_block = current_block_type && current_block_type(ctx2); if (if_block) { if_block.c(); @@ -29675,11 +29568,13 @@ function create_fragment6(ctx) { return { c() { div = element("div"); - if (if_block) if_block.c(); + if (if_block) + if_block.c(); }, m(target, anchor) { insert(target, div, anchor); - if (if_block) if_block.m(div, null); + if (if_block) + if_block.m(div, null); }, p(ctx2, [dirty]) { if ( @@ -29704,14 +29599,16 @@ function create_fragment6(ctx) { if (detaching) { detach(div); } - if (if_block) if_block.d(); + if (if_block) + if_block.d(); } }; } function instance6($$self, $$props, $$invalidate) { let { diff: diff2 } = $$props; $$self.$$set = ($$props2) => { - if ("diff" in $$props2) $$invalidate(0, diff2 = $$props2.diff); + if ("diff" in $$props2) + $$invalidate(0, diff2 = $$props2.diff); }; return [diff2]; } @@ -29768,7 +29665,8 @@ function create_if_block5(ctx) { p(ctx2, dirty) { if (dirty & /*diff*/ 8 && t0_value !== (t0_value = /*diff*/ - ctx2[3].length + "")) set_data(t0, t0_value); + ctx2[3].length + "")) + set_data(t0, t0_value); }, d(detaching) { if (detaching) { @@ -29796,12 +29694,14 @@ function create_each_block5(ctx) { p(ctx2, dirty) { const linediff_changes = {}; if (dirty & /*diff*/ - 8) linediff_changes.diff = /*change*/ - ctx2[9]; + 8) + linediff_changes.diff = /*change*/ + ctx2[9]; linediff.$set(linediff_changes); }, i(local) { - if (current) return; + if (current) + return; transition_in(linediff.$$.fragment, local); current = true; }, @@ -29847,7 +29747,8 @@ function create_fragment7(ctx) { if ( /*diff*/ ctx2[3].length > 0 - ) return create_if_block5; + ) + return create_if_block5; return create_else_block4; } let current_block_type = select_block_type(ctx, -1); @@ -29966,7 +29867,8 @@ function create_fragment7(ctx) { if (is_function( /*closeModal*/ ctx[1] - )) ctx[1].apply(this, arguments); + )) + ctx[1].apply(this, arguments); }) ]; mounted = true; @@ -30021,7 +29923,8 @@ function create_fragment7(ctx) { } }, i(local) { - if (current) return; + if (current) + return; for (let i = 0; i < each_value.length; i += 1) { transition_in(each_blocks[i]); } @@ -30074,9 +29977,12 @@ function instance7($$self, $$props, $$invalidate) { closeModal(); }; $$self.$$set = ($$props2) => { - if ("publisher" in $$props2) $$invalidate(6, publisher = $$props2.publisher); - if ("settings" in $$props2) $$invalidate(0, settings = $$props2.settings); - if ("closeModal" in $$props2) $$invalidate(1, closeModal = $$props2.closeModal); + if ("publisher" in $$props2) + $$invalidate(6, publisher = $$props2.publisher); + if ("settings" in $$props2) + $$invalidate(0, settings = $$props2.settings); + if ("closeModal" in $$props2) + $$invalidate(1, closeModal = $$props2.closeModal); }; return [ settings, @@ -30182,7 +30088,8 @@ function create_else_block5(ctx) { update_await_block_branch(info, ctx, dirty); }, i(local) { - if (current) return; + if (current) + return; transition_in(info.block); current = true; }, @@ -30346,7 +30253,8 @@ function create_then_block(ctx) { if ( /*pageInfo*/ ctx2[12] - ) return 0; + ) + return 0; return 1; } current_block_type_index = select_block_type_1(ctx, -1); @@ -30365,7 +30273,8 @@ function create_then_block(ctx) { if_block.p(ctx2, dirty); }, i(local) { - if (current) return; + if (current) + return; transition_in(if_block); current = true; }, @@ -30464,11 +30373,13 @@ function create_if_block_15(ctx) { if ( /*limitsLoading*/ ctx2[4] - ) return create_if_block_25; + ) + return create_if_block_25; if ( /*limits*/ ctx2[3] - ) return create_if_block_33; + ) + return create_if_block_33; } let current_block_type = select_block_type_2(ctx, -1); let if_block = current_block_type && current_block_type(ctx); @@ -30493,7 +30404,8 @@ function create_if_block_15(ctx) { create_component(icon1.$$.fragment); t7 = text(" Open Forestry.md Dashboard"); t8 = space(); - if (if_block) if_block.c(); + if (if_block) + if_block.c(); if_block_anchor = empty(); attr(div0, "class", "setting-item-name"); set_style(div0, "display", "flex"); @@ -30529,7 +30441,8 @@ function create_if_block_15(ctx) { mount_component(icon1, a, null); append(a, t7); insert(target, t8, anchor); - if (if_block) if_block.m(target, anchor); + if (if_block) + if_block.m(target, anchor); insert(target, if_block_anchor, anchor); current = true; if (!mounted) { @@ -30546,7 +30459,8 @@ function create_if_block_15(ctx) { if (current_block_type === (current_block_type = select_block_type_2(ctx2, dirty)) && if_block) { if_block.p(ctx2, dirty); } else { - if (if_block) if_block.d(1); + if (if_block) + if_block.d(1); if_block = current_block_type && current_block_type(ctx2); if (if_block) { if_block.c(); @@ -30555,7 +30469,8 @@ function create_if_block_15(ctx) { } }, i(local) { - if (current) return; + if (current) + return; transition_in(icon0.$$.fragment, local); transition_in(icon1.$$.fragment, local); current = true; @@ -30673,7 +30588,8 @@ function create_if_block_33(ctx) { t7 = text(" / "); t8 = text(t8_value); t9 = space(); - if (if_block0) if_block0.c(); + if (if_block0) + if_block0.c(); t10 = space(); div2 = element("div"); span2 = element("span"); @@ -30693,7 +30609,8 @@ function create_if_block_33(ctx) { t20 = text(" / "); t21 = text(t21_value); t22 = space(); - if (if_block1) if_block1.c(); + if (if_block1) + if_block1.c(); set_style(div0, "font-weight", "600"); set_style(div0, "margin-bottom", "8px"); set_style( @@ -30741,7 +30658,8 @@ function create_if_block_33(ctx) { append(span1, t7); append(span1, t8); append(div4, t9); - if (if_block0) if_block0.m(div4, null); + if (if_block0) + if_block0.m(div4, null); append(div4, t10); append(div4, div2); append(div2, span2); @@ -30759,19 +30677,23 @@ function create_if_block_33(ctx) { append(span5, t20); append(span5, t21); append(div5, t22); - if (if_block1) if_block1.m(div5, null); + if (if_block1) + if_block1.m(div5, null); }, p(ctx2, dirty) { if (dirty & /*limits*/ 8 && t1_value !== (t1_value = /*limits*/ - ctx2[3].plan + "")) set_data(t1, t1_value); + ctx2[3].plan + "")) + set_data(t1, t1_value); if (dirty & /*limits*/ 8 && t6_value !== (t6_value = /*limits*/ ctx2[3].builds.monthlyLimit - /*limits*/ - ctx2[3].builds.monthlyRemaining + "")) set_data(t6, t6_value); + ctx2[3].builds.monthlyRemaining + "")) + set_data(t6, t6_value); if (dirty & /*limits*/ 8 && t8_value !== (t8_value = /*limits*/ - ctx2[3].builds.monthlyLimit + "")) set_data(t8, t8_value); + ctx2[3].builds.monthlyLimit + "")) + set_data(t8, t8_value); if (dirty & /*limits*/ 8) { set_style( @@ -30798,10 +30720,12 @@ function create_if_block_33(ctx) { } if (dirty & /*limits*/ 8 && t13_value !== (t13_value = /*limits*/ - ctx2[3].storage.usedFormatted + "")) set_data(t13, t13_value); + ctx2[3].storage.usedFormatted + "")) + set_data(t13, t13_value); if (dirty & /*limits*/ 8 && t15_value !== (t15_value = /*limits*/ - ctx2[3].storage.limitFormatted + "")) set_data(t15, t15_value); + ctx2[3].storage.limitFormatted + "")) + set_data(t15, t15_value); if (dirty & /*limits*/ 8) { set_style( @@ -30814,10 +30738,12 @@ function create_if_block_33(ctx) { } if (dirty & /*limits*/ 8 && t19_value !== (t19_value = /*limits*/ - ctx2[3].sites.current + "")) set_data(t19, t19_value); + ctx2[3].sites.current + "")) + set_data(t19, t19_value); if (dirty & /*limits*/ 8 && t21_value !== (t21_value = /*limits*/ - ctx2[3].sites.limit + "")) set_data(t21, t21_value); + ctx2[3].sites.limit + "")) + set_data(t21, t21_value); if ( /*limits*/ ctx2[3].builds.monthlyRemaining === 0 || /*limits*/ @@ -30839,8 +30765,10 @@ function create_if_block_33(ctx) { if (detaching) { detach(div5); } - if (if_block0) if_block0.d(); - if (if_block1) if_block1.d(); + if (if_block0) + if_block0.d(); + if (if_block1) + if_block1.d(); } }; } @@ -30895,7 +30823,8 @@ function create_if_block_53(ctx) { p(ctx2, dirty) { if (dirty & /*limits*/ 8 && t2_value !== (t2_value = /*limits*/ - ctx2[3].builds.starterCreditsRemaining + "")) set_data(t2, t2_value); + ctx2[3].builds.starterCreditsRemaining + "")) + set_data(t2, t2_value); }, d(detaching) { if (detaching) { @@ -30956,7 +30885,8 @@ function create_key_block(ctx) { const if_blocks = []; function select_block_type(ctx2, dirty) { if (!/*settings*/ - ctx2[0].forestrySettings.apiKey) return 0; + ctx2[0].forestrySettings.apiKey) + return 0; return 1; } current_block_type_index = select_block_type(ctx, -1); @@ -30994,7 +30924,8 @@ function create_key_block(ctx) { } }, i(local) { - if (current) return; + if (current) + return; transition_in(if_block); current = true; }, @@ -31057,7 +30988,8 @@ function create_fragment8(ctx) { } }, i(local) { - if (current) return; + if (current) + return; transition_in(icon.$$.fragment, local); transition_in(key_block); current = true; @@ -31109,7 +31041,8 @@ function instance8($$self, $$props, $$invalidate) { return pageInfo; }); const fetchLimits = () => __awaiter(void 0, void 0, void 0, function* () { - if (!settings.forestrySettings.apiKey) return; + if (!settings.forestrySettings.apiKey) + return; $$invalidate(4, limitsLoading = true); try { $$invalidate(3, limits = yield new ForestryApi(settings.forestrySettings.apiKey).getUserLimits()); @@ -31123,16 +31056,20 @@ function instance8($$self, $$props, $$invalidate) { $$invalidate(2, apiKey); } $$self.$$set = ($$props2) => { - if ("settings" in $$props2) $$invalidate(0, settings = $$props2.settings); - if ("saveSettings" in $$props2) $$invalidate(8, saveSettings = $$props2.saveSettings); - if ("onConnect" in $$props2) $$invalidate(9, onConnect = $$props2.onConnect); + if ("settings" in $$props2) + $$invalidate(0, settings = $$props2.settings); + if ("saveSettings" in $$props2) + $$invalidate(8, saveSettings = $$props2.saveSettings); + if ("onConnect" in $$props2) + $$invalidate(9, onConnect = $$props2.onConnect); }; $$self.$$.update = () => { if ($$self.$$.dirty & /*settings*/ 1) { - $: if (settings.forestrySettings.apiKey) { - fetchLimits(); - } + $: + if (settings.forestrySettings.apiKey) { + fetchLimits(); + } } }; return [ @@ -31322,7 +31259,8 @@ var SettingView = class { cls: "mod-cta dg-apply-settings-button" }); applyButton.addEventListener("click", () => __async(this, null, function* () { - if (!hasUnsavedChanges) return; + if (!hasUnsavedChanges) + return; yield this.saveSiteSettingsAndUpdateEnv( this.app.metadataCache, this.settings, @@ -31520,7 +31458,8 @@ var SettingView = class { cls: "mod-cta dg-apply-settings-button" }); applyButton.addEventListener("click", () => __async(this, null, function* () { - if (!hasUnsavedChanges) return; + if (!hasUnsavedChanges) + return; yield this.saveSiteSettingsAndUpdateEnv( this.app.metadataCache, this.settings, @@ -31587,6 +31526,41 @@ var SettingView = class { envKey: "UI_SEARCH_PREVIEW_PLACEHOLDER", controlKey: "searchPreviewPlaceholder", settingsKey: "searchPreviewPlaceholder" + }, + { + envKey: "UI_SEARCH_NOT_STARTED_TEXT", + controlKey: "searchNotStarted", + settingsKey: "searchNotStarted" + }, + { + envKey: "UI_SEARCH_ENTER_HOTKEY", + controlKey: "searchEnterHotkey", + settingsKey: "searchEnterHotkey" + }, + { + envKey: "UI_SEARCH_NAVIGATE_HOTKEY", + controlKey: "searchNavigateHotkey", + settingsKey: "searchNavigateHotkey" + }, + { + envKey: "UI_SEARCH_CLOSE_HOTKEY", + controlKey: "searchCloseHotkey", + settingsKey: "searchCloseHotkey" + }, + { + envKey: "UI_CANVAS_DRAG_HINT", + controlKey: "canvasDragHint", + settingsKey: "canvasDragHint" + }, + { + envKey: "UI_CANVAS_ZOOM_HINT", + controlKey: "canvasZoomHint", + settingsKey: "canvasZoomHint" + }, + { + envKey: "UI_CANVAS_RESET_HINT", + controlKey: "canvasResetHint", + settingsKey: "canvasResetHint" } ]; const loadRemoteSettings = () => __async(this, null, function* () { @@ -31701,6 +31675,65 @@ var SettingView = class { markAsChanged(); }); }); + new import_obsidian15.Setting(uiStringsModal.contentEl).setName("Search not started text").setDesc('Default: "Enter your search text in the box above"').addText((text2) => { + var _a2, _b; + textControls["searchNotStarted"] = text2; + text2.setPlaceholder("Enter your search text in the box above").setValue((_b = (_a2 = this.settings.uiStrings) == null ? void 0 : _a2.searchNotStarted) != null ? _b : "").onChange((val) => { + this.settings.uiStrings.searchNotStarted = val; + markAsChanged(); + }); + }); + new import_obsidian15.Setting(uiStringsModal.contentEl).setName("Enter hotkey label").setDesc('Default: "Enter"').addText((text2) => { + var _a2, _b; + textControls["searchEnterHotkey"] = text2; + text2.setPlaceholder("Enter").setValue((_b = (_a2 = this.settings.uiStrings) == null ? void 0 : _a2.searchEnterHotkey) != null ? _b : "").onChange((val) => { + this.settings.uiStrings.searchEnterHotkey = val; + markAsChanged(); + }); + }); + new import_obsidian15.Setting(uiStringsModal.contentEl).setName("Navigate hotkey label").setDesc('Default: "\u21C5"').addText((text2) => { + var _a2, _b; + textControls["searchNavigateHotkey"] = text2; + text2.setPlaceholder("\u21C5").setValue( + (_b = (_a2 = this.settings.uiStrings) == null ? void 0 : _a2.searchNavigateHotkey) != null ? _b : "" + ).onChange((val) => { + this.settings.uiStrings.searchNavigateHotkey = val; + markAsChanged(); + }); + }); + new import_obsidian15.Setting(uiStringsModal.contentEl).setName("Close hotkey label").setDesc('Default: "ESC"').addText((text2) => { + var _a2, _b; + textControls["searchCloseHotkey"] = text2; + text2.setPlaceholder("ESC").setValue((_b = (_a2 = this.settings.uiStrings) == null ? void 0 : _a2.searchCloseHotkey) != null ? _b : "").onChange((val) => { + this.settings.uiStrings.searchCloseHotkey = val; + markAsChanged(); + }); + }); + uiStringsModal.contentEl.createEl("h3", { text: "Canvas" }).addClass("dg-ui-strings-section-header"); + new import_obsidian15.Setting(uiStringsModal.contentEl).setName("Drag hint").setDesc('Default: "Drag to pan"').addText((text2) => { + var _a2, _b; + textControls["canvasDragHint"] = text2; + text2.setPlaceholder("Drag to pan").setValue((_b = (_a2 = this.settings.uiStrings) == null ? void 0 : _a2.canvasDragHint) != null ? _b : "").onChange((val) => { + this.settings.uiStrings.canvasDragHint = val; + markAsChanged(); + }); + }); + new import_obsidian15.Setting(uiStringsModal.contentEl).setName("Zoom hint").setDesc('Default: "Scroll to zoom"').addText((text2) => { + var _a2, _b; + textControls["canvasZoomHint"] = text2; + text2.setPlaceholder("Scroll to zoom").setValue((_b = (_a2 = this.settings.uiStrings) == null ? void 0 : _a2.canvasZoomHint) != null ? _b : "").onChange((val) => { + this.settings.uiStrings.canvasZoomHint = val; + markAsChanged(); + }); + }); + new import_obsidian15.Setting(uiStringsModal.contentEl).setName("Reset hint").setDesc('Default: "Double-click to reset"').addText((text2) => { + var _a2, _b; + textControls["canvasResetHint"] = text2; + text2.setPlaceholder("Double-click to reset").setValue((_b = (_a2 = this.settings.uiStrings) == null ? void 0 : _a2.canvasResetHint) != null ? _b : "").onChange((val) => { + this.settings.uiStrings.canvasResetHint = val; + markAsChanged(); + }); + }); }); } initializeThemesSettings() { @@ -32263,7 +32296,8 @@ var SettingView = class { const settings = {}; for (const line of envContent.split("\n")) { const trimmedLine = line.trim(); - if (!trimmedLine || trimmedLine.startsWith("#")) continue; + if (!trimmedLine || trimmedLine.startsWith("#")) + continue; const [key, ...valueParts] = trimmedLine.split("="); if (key) { settings[key.trim()] = valueParts.join("=").trim(); @@ -32910,11 +32944,18 @@ var DEFAULT_SETTINGS = { noBacklinksMessage: "", searchButtonText: "", searchPlaceholder: "", + searchNotStarted: "", + searchEnterHotkey: "", searchEnterHint: "", + searchNavigateHotkey: "", searchNavigateHint: "", + searchCloseHotkey: "", searchCloseHint: "", searchNoResults: "", - searchPreviewPlaceholder: "" + searchPreviewPlaceholder: "", + canvasDragHint: "", + canvasZoomHint: "", + canvasResetHint: "" }, logLevel: void 0 }; @@ -33441,6 +33482,14 @@ js-logger/src/logger.js: * Jonny Reeves, http://jonnyreeves.co.uk/ * js-logger may be freely distributed under the MIT license. *) + +is-plain-object/dist/is-plain-object.mjs: + (*! + * is-plain-object + * + * Copyright (c) 2014-2017, Jon Schlinkert. + * Released under the MIT License. + *) */ /* nosourcemap */ \ No newline at end of file diff --git a/.obsidian/plugins/digitalgarden/manifest.json b/.obsidian/plugins/digitalgarden/manifest.json index ff4a3d8..96de386 100644 --- a/.obsidian/plugins/digitalgarden/manifest.json +++ b/.obsidian/plugins/digitalgarden/manifest.json @@ -1,7 +1,7 @@ { "id": "digitalgarden", "name": "Digital Garden", - "version": "2.72.0", + "version": "2.74.0", "minAppVersion": "1.10.0", "description": "Publish your notes to the web for others to enjoy. For free.", "author": "Ole Eskild Steensen", diff --git a/.obsidian/plugins/homepage/main.js b/.obsidian/plugins/homepage/main.js index 2a035f6..7555b93 100644 --- a/.obsidian/plugins/homepage/main.js +++ b/.obsidian/plugins/homepage/main.js @@ -1,3 +1,3 @@ -"use strict";var $e=Object.create;var z=Object.defineProperty;var Qe=Object.getOwnPropertyDescriptor;var Ze=Object.getOwnPropertyNames;var Xe=Object.getPrototypeOf,et=Object.prototype.hasOwnProperty;var tt=(n,t)=>()=>(t||n((t={exports:{}}).exports,t),t.exports),at=(n,t)=>{for(var e in t)z(n,e,{get:t[e],enumerable:!0})},be=(n,t,e,a)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of Ze(t))!et.call(n,i)&&i!==e&&z(n,i,{get:()=>t[i],enumerable:!(a=Qe(t,i))||a.enumerable});return n};var nt=(n,t,e)=>(e=n!=null?$e(Xe(n)):{},be(t||!n||!n.__esModule?z(e,"default",{value:n,enumerable:!0}):e,n)),it=n=>be(z({},"__esModule",{value:!0}),n);var _e=tt(l=>{"use strict";Object.defineProperty(l,"__esModule",{value:!0});var m=require("obsidian"),ie="YYYY-MM-DD",oe="gggg-[W]ww",Se="YYYY-MM",Me="YYYY-[Q]Q",Fe="YYYY";function H(n){let t=window.app.plugins.getPlugin("periodic-notes");return t&&t.settings?.[n]?.enabled}function W(){try{let{internalPlugins:n,plugins:t}=window.app;if(H("daily")){let{format:o,folder:s,template:c}=t.getPlugin("periodic-notes")?.settings?.daily||{};return{format:o||ie,folder:s?.trim()||"",template:c?.trim()||""}}let{folder:e,format:a,template:i}=n.getPluginById("daily-notes")?.instance?.options||{};return{format:a||ie,folder:e?.trim()||"",template:i?.trim()||""}}catch(n){console.info("No custom daily note settings found!",n)}}function I(){try{let n=window.app.plugins,t=n.getPlugin("calendar")?.options,e=n.getPlugin("periodic-notes")?.settings?.weekly;if(H("weekly"))return{format:e.format||oe,folder:e.folder?.trim()||"",template:e.template?.trim()||""};let a=t||{};return{format:a.weeklyNoteFormat||oe,folder:a.weeklyNoteFolder?.trim()||"",template:a.weeklyNoteTemplate?.trim()||""}}catch(n){console.info("No custom weekly note settings found!",n)}}function _(){let n=window.app.plugins;try{let t=H("monthly")&&n.getPlugin("periodic-notes")?.settings?.monthly||{};return{format:t.format||Se,folder:t.folder?.trim()||"",template:t.template?.trim()||""}}catch(t){console.info("No custom monthly note settings found!",t)}}function V(){let n=window.app.plugins;try{let t=H("quarterly")&&n.getPlugin("periodic-notes")?.settings?.quarterly||{};return{format:t.format||Me,folder:t.folder?.trim()||"",template:t.template?.trim()||""}}catch(t){console.info("No custom quarterly note settings found!",t)}}function U(){let n=window.app.plugins;try{let t=H("yearly")&&n.getPlugin("periodic-notes")?.settings?.yearly||{};return{format:t.format||Fe,folder:t.folder?.trim()||"",template:t.template?.trim()||""}}catch(t){console.info("No custom yearly note settings found!",t)}}function Ae(...n){let t=[];for(let a=0,i=n.length;a{let ee=a(),te=n.clone().set({hour:ee.get("hour"),minute:ee.get("minute"),second:ee.get("second")});return M&&te.add(parseInt(N,10),y),f?te.format(f.substring(1).trim()):te.format(o)}).replace(/{{\s*yesterday\s*}}/gi,n.clone().subtract(1,"day").format(o)).replace(/{{\s*tomorrow\s*}}/gi,n.clone().add(1,"d").format(o)));return t.foldManager.save(u,w),u}catch(u){console.error(`Failed to create file: '${v}'`,u),new m.Notice("Unable to create new file.")}}function pt(n,t){return t[P(n,"day")]??null}function dt(){let{vault:n}=window.app,{folder:t}=W(),e=n.getAbstractFileByPath(m.normalizePath(t));if(!e)throw new se("Failed to find daily notes folder");let a={};return m.Vault.recurseChildren(e,i=>{if(i instanceof m.TFile){let o=L(i,"day");if(o){let s=P(o,"day");a[s]=i}}}),a}var re=class extends Error{};function ut(){let{moment:n}=window,t=n.localeData()._week.dow,e=["sunday","monday","tuesday","wednesday","thursday","friday","saturday"];for(;t;)e.push(e.shift()),t--;return e}function gt(n){return ut().indexOf(n.toLowerCase())}async function Ce(n){let{vault:t}=window.app,{template:e,format:a,folder:i}=I(),[o,s]=await O(e),c=n.format(a),w=await Y(i,c);try{let p=await t.create(w,o.replace(/{{\s*(date|time)\s*(([+-]\d+)([yqmwdhs]))?\s*(:.+?)?}}/gi,(v,u,d,S,M,N)=>{let y=window.moment(),f=n.clone().set({hour:y.get("hour"),minute:y.get("minute"),second:y.get("second")});return d&&f.add(parseInt(S,10),M),N?f.format(N.substring(1).trim()):f.format(a)}).replace(/{{\s*title\s*}}/gi,c).replace(/{{\s*time\s*}}/gi,window.moment().format("HH:mm")).replace(/{{\s*(sunday|monday|tuesday|wednesday|thursday|friday|saturday)\s*:(.*?)}}/gi,(v,u,d)=>{let S=gt(u);return n.weekday(S).format(d.trim())}));return window.app.foldManager.save(p,s),p}catch(p){console.error(`Failed to create file: '${w}'`,p),new m.Notice("Unable to create new file.")}}function mt(n,t){return t[P(n,"week")]??null}function ht(){let n={};if(!Re())return n;let{vault:t}=window.app,{folder:e}=I(),a=t.getAbstractFileByPath(m.normalizePath(e));if(!a)throw new re("Failed to find weekly notes folder");return m.Vault.recurseChildren(a,i=>{if(i instanceof m.TFile){let o=L(i,"week");if(o){let s=P(o,"week");n[s]=i}}}),n}var le=class extends Error{};async function xe(n){let{vault:t}=window.app,{template:e,format:a,folder:i}=_(),[o,s]=await O(e),c=n.format(a),w=await Y(i,c);try{let p=await t.create(w,o.replace(/{{\s*(date|time)\s*(([+-]\d+)([yqmwdhs]))?\s*(:.+?)?}}/gi,(v,u,d,S,M,N)=>{let y=window.moment(),f=n.clone().set({hour:y.get("hour"),minute:y.get("minute"),second:y.get("second")});return d&&f.add(parseInt(S,10),M),N?f.format(N.substring(1).trim()):f.format(a)}).replace(/{{\s*date\s*}}/gi,c).replace(/{{\s*time\s*}}/gi,window.moment().format("HH:mm")).replace(/{{\s*title\s*}}/gi,c));return window.app.foldManager.save(p,s),p}catch(p){console.error(`Failed to create file: '${w}'`,p),new m.Notice("Unable to create new file.")}}function ft(n,t){return t[P(n,"month")]??null}function wt(){let n={};if(!He())return n;let{vault:t}=window.app,{folder:e}=_(),a=t.getAbstractFileByPath(m.normalizePath(e));if(!a)throw new le("Failed to find monthly notes folder");return m.Vault.recurseChildren(a,i=>{if(i instanceof m.TFile){let o=L(i,"month");if(o){let s=P(o,"month");n[s]=i}}}),n}var ce=class extends Error{};async function yt(n){let{vault:t}=window.app,{template:e,format:a,folder:i}=V(),[o,s]=await O(e),c=n.format(a),w=await Y(i,c);try{let p=await t.create(w,o.replace(/{{\s*(date|time)\s*(([+-]\d+)([yqmwdhs]))?\s*(:.+?)?}}/gi,(v,u,d,S,M,N)=>{let y=window.moment(),f=n.clone().set({hour:y.get("hour"),minute:y.get("minute"),second:y.get("second")});return d&&f.add(parseInt(S,10),M),N?f.format(N.substring(1).trim()):f.format(a)}).replace(/{{\s*date\s*}}/gi,c).replace(/{{\s*time\s*}}/gi,window.moment().format("HH:mm")).replace(/{{\s*title\s*}}/gi,c));return window.app.foldManager.save(p,s),p}catch(p){console.error(`Failed to create file: '${w}'`,p),new m.Notice("Unable to create new file.")}}function vt(n,t){return t[P(n,"quarter")]??null}function bt(){let n={};if(!We())return n;let{vault:t}=window.app,{folder:e}=V(),a=t.getAbstractFileByPath(m.normalizePath(e));if(!a)throw new ce("Failed to find quarterly notes folder");return m.Vault.recurseChildren(a,i=>{if(i instanceof m.TFile){let o=L(i,"quarter");if(o){let s=P(o,"quarter");n[s]=i}}}),n}var pe=class extends Error{};async function Nt(n){let{vault:t}=window.app,{template:e,format:a,folder:i}=U(),[o,s]=await O(e),c=n.format(a),w=await Y(i,c);try{let p=await t.create(w,o.replace(/{{\s*(date|time)\s*(([+-]\d+)([yqmwdhs]))?\s*(:.+?)?}}/gi,(v,u,d,S,M,N)=>{let y=window.moment(),f=n.clone().set({hour:y.get("hour"),minute:y.get("minute"),second:y.get("second")});return d&&f.add(parseInt(S,10),M),N?f.format(N.substring(1).trim()):f.format(a)}).replace(/{{\s*date\s*}}/gi,c).replace(/{{\s*time\s*}}/gi,window.moment().format("HH:mm")).replace(/{{\s*title\s*}}/gi,c));return window.app.foldManager.save(p,s),p}catch(p){console.error(`Failed to create file: '${w}'`,p),new m.Notice("Unable to create new file.")}}function Dt(n,t){return t[P(n,"year")]??null}function kt(){let n={};if(!Ie())return n;let{vault:t}=window.app,{folder:e}=U(),a=t.getAbstractFileByPath(m.normalizePath(e));if(!a)throw new pe("Failed to find yearly notes folder");return m.Vault.recurseChildren(a,i=>{if(i instanceof m.TFile){let o=L(i,"year");if(o){let s=P(o,"year");n[s]=i}}}),n}function Tt(){let{app:n}=window,t=n.internalPlugins.plugins["daily-notes"];if(t&&t.enabled)return!0;let e=n.plugins.getPlugin("periodic-notes");return e&&e.settings?.daily?.enabled}function Re(){let{app:n}=window;if(n.plugins.getPlugin("calendar"))return!0;let t=n.plugins.getPlugin("periodic-notes");return t&&t.settings?.weekly?.enabled}function He(){let{app:n}=window,t=n.plugins.getPlugin("periodic-notes");return t&&t.settings?.monthly?.enabled}function We(){let{app:n}=window,t=n.plugins.getPlugin("periodic-notes");return t&&t.settings?.quarterly?.enabled}function Ie(){let{app:n}=window,t=n.plugins.getPlugin("periodic-notes");return t&&t.settings?.yearly?.enabled}function Pt(n){let t={day:W,week:I,month:_,quarter:V,year:U}[n];return t()}function St(n,t){return{day:Le,month:xe,week:Ce}[n](t)}l.DEFAULT_DAILY_NOTE_FORMAT=ie;l.DEFAULT_MONTHLY_NOTE_FORMAT=Se;l.DEFAULT_QUARTERLY_NOTE_FORMAT=Me;l.DEFAULT_WEEKLY_NOTE_FORMAT=oe;l.DEFAULT_YEARLY_NOTE_FORMAT=Fe;l.appHasDailyNotesPluginLoaded=Tt;l.appHasMonthlyNotesPluginLoaded=He;l.appHasQuarterlyNotesPluginLoaded=We;l.appHasWeeklyNotesPluginLoaded=Re;l.appHasYearlyNotesPluginLoaded=Ie;l.createDailyNote=Le;l.createMonthlyNote=xe;l.createPeriodicNote=St;l.createQuarterlyNote=yt;l.createWeeklyNote=Ce;l.createYearlyNote=Nt;l.getAllDailyNotes=dt;l.getAllMonthlyNotes=wt;l.getAllQuarterlyNotes=bt;l.getAllWeeklyNotes=ht;l.getAllYearlyNotes=kt;l.getDailyNote=pt;l.getDailyNoteSettings=W;l.getDateFromFile=L;l.getDateFromPath=ct;l.getDateUID=P;l.getMonthlyNote=ft;l.getMonthlyNoteSettings=_;l.getPeriodicNoteSettings=Pt;l.getQuarterlyNote=vt;l.getQuarterlyNoteSettings=V;l.getTemplateInfo=O;l.getWeeklyNote=mt;l.getWeeklyNoteSettings=I;l.getYearlyNote=Dt;l.getYearlyNoteSettings=U});var Ot={};at(Ot,{default:()=>X});module.exports=it(Ot);var k=require("obsidian");var b=require("obsidian");var ue=require("obsidian");var E=require("obsidian");function T(n){return n?n.extension=="md"?n.path.slice(0,-3):n.path:""}function Ne(n){return n.split("/").slice(-1)[0].contains(".")?n:`${n}.md`}function ae(n,t=void 0){let e=n.vault.getFiles();if(t){let a=n.vault.getFolderByPath(t);if(!a)return;e=De(a)}if(e.filter(a=>["md","canvas","base"].contains(a.extension)),e.length){let a=Math.floor(Math.random()*e.length);return T(e[a])}}function De(n){let t=[];for(let e of n.children)e instanceof E.TFolder?t.push(...De(e)):t.push(e);return t}function ke(n){return n.workspace.getActiveViewOfType(E.View)?.getViewType()=="empty"}function ne(n,t){return n.localeCompare(t,void 0,{sensitivity:"accent"})===0}function q(n){return new Promise(t=>setTimeout(t,n))}async function Te(n){let t=n.workspace.getLayout();t.main={id:"5324373015726ba8",type:"split",children:[{id:"4509724f8bf84da7",type:"tabs",children:[{id:"e7a7b303c61786dc",type:"leaf",state:{type:"empty",state:{},icon:"lucide-file",title:"New tab"}}]}],direction:"vertical"},t.active="e7a7b303c61786dc",await n.workspace.changeLayout(t),E.Platform.isMobile&&(n.workspace.rightSplit?.updateInfo(),ot(n))}function ot(n){let t=n.internalPlugins.plugins.sync?.instance;t&&n.workspace.onLayoutReady(()=>{t.statusIconEl=n.workspace.rightSplit.addHeaderButton("sync-small",t.openStatusIconMenu.bind(t)),t.statusIconEl.addEventListener("contextmenu",t.openStatusIconMenu.bind(t)),t.statusIconEl.addClass("sync-status-icon")})}function Pe(n){let t=n.internalPlugins.plugins.sync,e=[new Promise(a=>{let i=async()=>{a(),n.workspace.off("layout-change",i)};n.workspace.on("layout-change",i)})];return t.enabled&&t.instance.syncing&&e.push(new Promise(a=>{let i=async()=>{a(),t.instance.off("status-change",i)};t.instance.on("status-change",i)})),Promise.race([Promise.all(e),new Promise(a=>setTimeout(a,1500))])}var g=nt(_e()),Mt="custom-journal-locale",de={["Daily Note"]:{noun:"day",adjective:"daily",create:g.createDailyNote,get:g.getDailyNote,getAll:g.getAllDailyNotes},["Weekly Note"]:{noun:"week",adjective:"weekly",create:g.createWeeklyNote,get:g.getWeeklyNote,getAll:g.getAllWeeklyNotes},["Monthly Note"]:{noun:"month",adjective:"monthly",create:g.createMonthlyNote,get:g.getMonthlyNote,getAll:g.getAllMonthlyNotes},["Yearly Note"]:{noun:"year",adjective:"yearly",create:g.createYearlyNote,get:g.getYearlyNote,getAll:g.getAllYearlyNotes}},J=["Daily Note","Weekly Note","Monthly Note","Yearly Note"],Ve="Date-dependent file";async function Ue(n,t){let e=t.communityPlugins["periodic-notes"],a=de[n],i=(0,ue.moment)().startOf(a.noun),o;if(Be(e)){let s=a.getAll();Object.keys(s).length?o=a.get(i,s)||await a.create(i):o=await a.create(i),o||(o=a.get(i,s))}else e.cache.initialize(),o=e.getPeriodicNote(a.noun,i)||await e.createPeriodicNote(a.noun,i);return T(o)}function Ye(n,t){if(n=="Daily Note"&&t.internalPlugins["daily-notes"]?.enabled)return!0;let e=t.communityPlugins["periodic-notes"];if(!e)return!1;if(Be(e)){let a=de[n].adjective;return e.settings[a]?.enabled}else{let a=de[n].noun;return e?.calendarSetManager?.getActiveSet()[a]?.enabled}}function Be(n){return(n?.manifest.version||"0").startsWith("0")}function je(n){return!!n.plugin.communityPlugins.journals.getJournal(n.data.value)}async function Ge(n,t){let e=t.communityPlugins.journals,a=e.getJournal(n),i=a.config.value.autoCreate;e.reprocessNotes(),a.config.value.autoCreate=!0,await a.autoCreate(),a.config.value.autoCreate=i;let o=(0,ue.moment)().locale(Mt).startOf("day");return a.getNotePath(a?.get(o)).replace(/\.md$/,"")}var ge={["Replace all open notes"]:"Replace all open notes",["Replace last note"]:"Replace last note",["Keep open notes"]:"Keep open notes",["Default view"]:"Default view",["Reading view"]:"Reading view",["Editing view (Source)"]:"Editing view (Source)",["Editing view (Live Preview)"]:"Editing view (Live Preview)",["File"]:"File",["Workspace"]:"Workspace",["Random file"]:"Random file",["Random in folder"]:"Random in folder",["New note"]:"New note",["Graph view"]:"Graph view",["Nothing"]:"Nothing",["Journal"]:"Journal",["Daily Note"]:"Daily Note",["Weekly Note"]:"Weekly Note",["Monthly Note"]:"Monthly Note",["Yearly Note"]:"Yearly Note",["Both"]:"Both",["Startup only"]:"Startup only",["Manual only"]:"Manual only",openHomepage:"Open homepage",setToActiveFile:"Set to active file",copyDebugInfo:"Copy debug info",pluginUnavailable:"The active homepage cannot be opened due to plugin unavailablity.",journalUnavailable:'Cannot find the journal "?0" to use as the homepage.',workspaceUnavailable:'Cannot find the workspace "?0" to use as the homepage.',noteUnavailable:'Cannot find the file "?0" to use as the homepage.',homepageChanged:'The homepage has been changed to "?0".',momentUpgradeNotice:"Date-dependent notes in Homepage have been removed. Set your homepage as a Periodic or Daily Note instead.",openOnStartup:"Open on startup",openOnStartupDesc:"When launching Obsidian, open the homepage.",openOnStartupWarn:'This will override the built-in "Default file to open" setting.',openWhenEmpty:"Open when empty",openWhenEmptyDesc:"When there are no tabs open, open the homepage.",alwaysApply:"Use when opening normally",alwaysApplyDesc:"Use homepage settings when opening it normally, such as from a link or the file browser.",separateMobile:"Separate mobile homepage",separateMobileDesc:"For mobile devices, store the homepage and its settings separately.",separateMobileWarnMobile:"Mobile settings are stored separately. Therefore, changes to other settings will not affect desktop devices. To edit desktop settings, use a desktop device.",separateMobileWarnDesktop:"Mobile settings are stored separately. Therefore, changes to other settings will not affect mobile devices. To edit mobile settings, use a mobile device.",commandsGroup:"Commands",commandsDesc:"Select commands that will be executed when opening the homepage.",commandsAddButton:"Add...",commandUnavailable:"This command can't be found, so it won't be executed. It may belong to a disabled plugin.",commandsReally:"Really?",vaultGroup:"Vault environment",openMode:"Opening method",openModeDesc:"Determine how extant tabs and views are affected on startup.",manualOpenMode:"Manual opening method",manualOpenModeDesc:"Determine how extant tabs and views are affected when opening with commands or the ribbon button.",pin:"Pin",pinDesc:"Pin the homepage when opening.",hideReleaseNotes:"Hide release notes",hideReleaseNotesDesc:"Never display release notes when Obsidian updates.",autoCreate:"Auto-create",autoCreateDesc:"When the homepage doesn't exist, create a note with its name.",autoCreateWarn:"If this vault is synced using unofficial services, this may lead to content being overwritten.",openingGroup:"Opened view",view:"Homepage view",viewDesc:"Choose what view to open the homepage in.",revertView:"Revert view on close",revertViewDesc:"When navigating away from the homepage, restore the default view.",autoScroll:"Auto-scroll",autoScrollDesc:"When opening the homepage, scroll to the bottom and focus on the last line",refreshDataview:"Refresh Dataview",refreshDataviewDesc:"Always attempt to reload Dataview views when opening the homepage",refreshDataviewWarn:"Requires Dataview auto-refresh to be enabled.",FileDesc:"Enter a note, base, or canvas to use.",WorkspaceDesc:"Enter an Obsidian workspace to use.","New noteDesc":"Enter a prefix to use. A note using that prefix will be created for each Obsidian session.","Graph viewDesc":"Your graph view will be used.",NothingDesc:"Nothing will occur by default. Any commands added will still take effect.","Random fileDesc":"A random note, base, or canvas from your Obsidian folder will be selected.","Random in folderDesc":"Enter a folder. A random note, base, or canvas from it will be selected.",JournalDesc:"Enter a Journal to use.","Daily noteDesc":"Your Daily Note or Periodic Daily Note will be used.","Weekly noteDesc":"Your Periodic Weekly Note will be used.","Monthly noteDesc":"Your Periodic Monthly Note will be used.","Yearly noteDesc":"Your Periodic Yearly Note will be used.",homepageSettingTitle:"Homepage",pluginUnavailableSettings:"The plugin required for this homepage type isn't available.",copyDebugInfoNotice:"Copied homepage debug information to clipboard"};var Ke={["Replace all open notes"]:"\u0417\u0430\u043C\u0435\u043D\u0438\u0442\u044C \u0432\u0441\u0435 \u043E\u0442\u043A\u0440\u044B\u0442\u044B\u0435 \u0437\u0430\u043C\u0435\u0442\u043A\u0438",["Replace last note"]:"\u0417\u0430\u043C\u0435\u043D\u0438\u0442\u044C \u043F\u043E\u0441\u043B\u0435\u0434\u043D\u044E\u044E \u0437\u0430\u043C\u0435\u0442\u043A\u0443",["Keep open notes"]:"\u041E\u0441\u0442\u0430\u0432\u0438\u0442\u044C \u043E\u0442\u043A\u0440\u044B\u0442\u044B\u0435 \u0437\u0430\u043C\u0435\u0442\u043A\u0438",["Default view"]:"\u041F\u043E \u0443\u043C\u043E\u043B\u0447\u0430\u043D\u0438\u044E",["Reading view"]:"\u041F\u0440\u043E\u0441\u043C\u043E\u0442\u0440",["Editing view (Source)"]:"\u041F\u0440\u043E\u0441\u043C\u043E\u0442\u0440 \u0438\u0441\u0445\u043E\u0434\u043D\u043E\u0433\u043E \u043A\u043E\u0434\u0430",["Editing view (Live Preview)"]:"\u0414\u0438\u043D\u0430\u043C\u0438\u0447\u0435\u0441\u043A\u0438\u0439 \u043F\u0440\u043E\u0441\u043C\u043E\u0442\u0440",["File"]:"\u0424\u0430\u0439\u043B",["Workspace"]:"\u0420\u0430\u0431\u043E\u0447\u0435\u0435 \u043F\u0440\u043E\u0441\u0442\u0440\u0430\u043D\u0441\u0442\u0432\u043E",["Random file"]:"\u0421\u043B\u0443\u0447\u0430\u0439\u043D\u044B\u0439 \u0444\u0430\u0439\u043B",["Random in folder"]:"\u0421\u043B\u0443\u0447\u0430\u0439\u043D\u044B\u0439 \u0444\u0430\u0439\u043B \u0438\u0437 \u043F\u0430\u043F\u043A\u0438",["New note"]:"\u041D\u043E\u0432\u0430\u044F \u0437\u0430\u043C\u0435\u0442\u043A\u0430",["Graph view"]:"\u0413\u0440\u0430\u0444",["Nothing"]:"\u041D\u0438\u0447\u0435\u0433\u043E",["Journal"]:"\u0416\u0443\u0440\u043D\u0430\u043B",["Daily Note"]:"\u0415\u0436\u0435\u0434\u043D\u0435\u0432\u043D\u0430\u044F \u0437\u0430\u043C\u0435\u0442\u043A\u0430",["Weekly Note"]:"\u0415\u0436\u0435\u043D\u0435\u0434\u0435\u043B\u044C\u043D\u0430\u044F \u0437\u0430\u043C\u0435\u0442\u043A\u0430",["Monthly Note"]:"\u0415\u0436\u0435\u043C\u0435\u0441\u044F\u0447\u043D\u0430\u044F \u0437\u0430\u043C\u0435\u0442\u043A\u0430",["Yearly Note"]:"\u0415\u0436\u0435\u0433\u043E\u0434\u043D\u0430\u044F \u0437\u0430\u043C\u0435\u0442\u043A\u0430",["Both"]:"\u041E\u0431\u0430 \u0432\u0430\u0440\u0438\u0430\u043D\u0442\u0430",["Startup only"]:"\u0422\u043E\u043B\u044C\u043A\u043E \u043F\u0440\u0438 \u0437\u0430\u043F\u0443\u0441\u043A\u0435",["Manual only"]:"\u0422\u043E\u043B\u044C\u043A\u043E \u0432\u0440\u0443\u0447\u043D\u0443\u044E",openHomepage:"\u041E\u0442\u043A\u0440\u044B\u0442\u044C \u0434\u043E\u043C\u0430\u0448\u043D\u044E\u044E \u0441\u0442\u0440\u0430\u043D\u0438\u0446\u0443",setToActiveFile:"\u0418\u0441\u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u044C \u0430\u043A\u0442\u0438\u0432\u043D\u044B\u0439 \u0444\u0430\u0439\u043B",copyDebugInfo:"\u0421\u043A\u043E\u043F\u0438\u0440\u043E\u0432\u0430\u0442\u044C \u043E\u0442\u043B\u0430\u0434\u043E\u0447\u043D\u0443\u044E \u0438\u043D\u0444\u043E\u0440\u043C\u0430\u0446\u0438\u044E",pluginUnavailable:"\u041D\u0435\u0432\u043E\u0437\u043C\u043E\u0436\u043D\u043E \u043E\u0442\u043A\u0440\u044B\u0442\u044C \u0434\u043E\u043C\u0430\u0448\u043D\u044E\u044E \u0441\u0442\u0440\u0430\u043D\u0438\u0446\u0443: \u043F\u043B\u0430\u0433\u0438\u043D \u043D\u0435\u0434\u043E\u0441\u0442\u0443\u043F\u0435\u043D.",journalUnavailable:'\u0416\u0443\u0440\u043D\u0430\u043B "?0" \u043D\u0435 \u043D\u0430\u0439\u0434\u0435\u043D.',workspaceUnavailable:'\u0420\u0430\u0431\u043E\u0447\u0435\u0435 \u043F\u0440\u043E\u0441\u0442\u0440\u0430\u043D\u0441\u0442\u0432\u043E "?0" \u043D\u0435 \u043D\u0430\u0439\u0434\u0435\u043D\u043E.',noteUnavailable:'\u0424\u0430\u0439\u043B "?0" \u043D\u0435 \u043D\u0430\u0439\u0434\u0435\u043D.',homepageChanged:'\u0414\u043E\u043C\u0430\u0448\u043D\u044F\u044F \u0441\u0442\u0440\u0430\u043D\u0438\u0446\u0430 \u0438\u0437\u043C\u0435\u043D\u0435\u043D\u0430 \u043D\u0430 "?0".',momentUpgradeNotice:"\u0417\u0430\u043C\u0435\u0442\u043A\u0438, \u0437\u0430\u0432\u0438\u0441\u044F\u0449\u0438\u0435 \u043E\u0442 \u0434\u0430\u0442\u044B, \u0443\u0434\u0430\u043B\u0435\u043D\u044B \u0438\u0437 Homepage. \u0418\u0441\u043F\u043E\u043B\u044C\u0437\u0443\u0439\u0442\u0435 \u043F\u0435\u0440\u0438\u043E\u0434\u0438\u0447\u0435\u0441\u043A\u0443\u044E \u0438\u043B\u0438 \u0435\u0436\u0435\u0434\u043D\u0435\u0432\u043D\u0443\u044E \u0437\u0430\u043C\u0435\u0442\u043A\u0443.",openOnStartup:"\u041E\u0442\u043A\u0440\u044B\u0432\u0430\u0442\u044C \u043F\u0440\u0438 \u0437\u0430\u043F\u0443\u0441\u043A\u0435",openOnStartupDesc:"\u041E\u0442\u043A\u0440\u044B\u0432\u0430\u0442\u044C \u0434\u043E\u043C\u0430\u0448\u043D\u044E\u044E \u0441\u0442\u0440\u0430\u043D\u0438\u0446\u0443 \u043F\u0440\u0438 \u0437\u0430\u043F\u0443\u0441\u043A\u0435 Obsidian.",openOnStartupWarn:"\u042D\u0442\u043E \u043F\u0435\u0440\u0435\u043E\u043F\u0440\u0435\u0434\u0435\u043B\u044F\u0435\u0442 \u043D\u0430\u0441\u0442\u0440\u043E\u0439\u043A\u0443 \u0444\u0430\u0439\u043B\u0430 \u043F\u043E \u0443\u043C\u043E\u043B\u0447\u0430\u043D\u0438\u044E.",openWhenEmpty:"\u041E\u0442\u043A\u0440\u044B\u0432\u0430\u0442\u044C \u043F\u0440\u0438 \u043E\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0438\u0438 \u0432\u043A\u043B\u0430\u0434\u043E\u043A",openWhenEmptyDesc:"\u041E\u0442\u043A\u0440\u044B\u0432\u0430\u0442\u044C \u0434\u043E\u043C\u0430\u0448\u043D\u044E\u044E \u0441\u0442\u0440\u0430\u043D\u0438\u0446\u0443, \u0435\u0441\u043B\u0438 \u043D\u0435\u0442 \u043E\u0442\u043A\u0440\u044B\u0442\u044B\u0445 \u0432\u043A\u043B\u0430\u0434\u043E\u043A.",alwaysApply:"\u041F\u0440\u0438\u043C\u0435\u043D\u044F\u0442\u044C \u043F\u0440\u0438 \u043E\u0431\u044B\u0447\u043D\u043E\u043C \u043E\u0442\u043A\u0440\u044B\u0442\u0438\u0438",alwaysApplyDesc:"\u041F\u0440\u0438\u043C\u0435\u043D\u044F\u0442\u044C \u043D\u0430\u0441\u0442\u0440\u043E\u0439\u043A\u0438 \u0434\u043E\u043C\u0430\u0448\u043D\u0435\u0439 \u0441\u0442\u0440\u0430\u043D\u0438\u0446\u044B \u043F\u0440\u0438 \u043E\u0442\u043A\u0440\u044B\u0442\u0438\u0438 \u0438\u0437 \u0441\u0441\u044B\u043B\u043E\u043A \u0438\u043B\u0438 \u0444\u0430\u0439\u043B\u043E\u0432\u043E\u0433\u043E \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0430.",separateMobile:"\u041E\u0442\u0434\u0435\u043B\u044C\u043D\u0430\u044F \u0434\u043E\u043C\u0430\u0448\u043D\u044F\u044F \u0441\u0442\u0440\u0430\u043D\u0438\u0446\u0430 \u0434\u043B\u044F \u043C\u043E\u0431\u0438\u043B\u044C\u043D\u044B\u0445 \u0443\u0441\u0442\u0440\u043E\u0439\u0441\u0442\u0432",separateMobileDesc:"\u0425\u0440\u0430\u043D\u0438\u0442\u044C \u0434\u043E\u043C\u0430\u0448\u043D\u044E\u044E \u0441\u0442\u0440\u0430\u043D\u0438\u0446\u0443 \u0434\u043B\u044F \u043C\u043E\u0431\u0438\u043B\u044C\u043D\u044B\u0445 \u0443\u0441\u0442\u0440\u043E\u0439\u0441\u0442\u0432 \u0438 \u0435\u0451 \u043D\u0430\u0441\u0442\u0440\u043E\u0439\u043A\u0438 \u043E\u0442\u0434\u0435\u043B\u044C\u043D\u043E.",separateMobileWarnMobile:"\u041C\u043E\u0431\u0438\u043B\u044C\u043D\u044B\u0435 \u043D\u0430\u0441\u0442\u0440\u043E\u0439\u043A\u0438 \u0445\u0440\u0430\u043D\u044F\u0442\u0441\u044F \u043E\u0442\u0434\u0435\u043B\u044C\u043D\u043E. \u0418\u0437\u043C\u0435\u043D\u0435\u043D\u0438\u044F \u043D\u0435 \u043F\u043E\u0432\u043B\u0438\u044F\u044E\u0442 \u043D\u0430 \u043D\u0430\u0441\u0442\u043E\u043B\u044C\u043D\u044B\u0435 \u0443\u0441\u0442\u0440\u043E\u0439\u0441\u0442\u0432\u0430. \u0418\u0441\u043F\u043E\u043B\u044C\u0437\u0443\u0439\u0442\u0435 \u043D\u0430\u0441\u0442\u043E\u043B\u044C\u043D\u043E\u0435 \u0443\u0441\u0442\u0440\u043E\u0439\u0441\u0442\u0432\u043E \u0434\u043B\u044F \u0440\u0435\u0434\u0430\u043A\u0442\u0438\u0440\u043E\u0432\u0430\u043D\u0438\u044F.",separateMobileWarnDesktop:"\u041C\u043E\u0431\u0438\u043B\u044C\u043D\u044B\u0435 \u043D\u0430\u0441\u0442\u0440\u043E\u0439\u043A\u0438 \u0445\u0440\u0430\u043D\u044F\u0442\u0441\u044F \u043E\u0442\u0434\u0435\u043B\u044C\u043D\u043E. \u0418\u0437\u043C\u0435\u043D\u0435\u043D\u0438\u044F \u043D\u0435 \u043F\u043E\u0432\u043B\u0438\u044F\u044E\u0442 \u043D\u0430 \u043C\u043E\u0431\u0438\u043B\u044C\u043D\u044B\u0435 \u0443\u0441\u0442\u0440\u043E\u0439\u0441\u0442\u0432\u0430. \u0418\u0441\u043F\u043E\u043B\u044C\u0437\u0443\u0439\u0442\u0435 \u043C\u043E\u0431\u0438\u043B\u044C\u043D\u043E\u0435 \u0443\u0441\u0442\u0440\u043E\u0439\u0441\u0442\u0432\u043E \u0434\u043B\u044F \u0440\u0435\u0434\u0430\u043A\u0442\u0438\u0440\u043E\u0432\u0430\u043D\u0438\u044F.",commandsGroup:"\u041A\u043E\u043C\u0430\u043D\u0434\u044B",commandsDesc:"\u041A\u043E\u043C\u0430\u043D\u0434\u044B, \u0432\u044B\u043F\u043E\u043B\u043D\u044F\u0435\u043C\u044B\u0435 \u043F\u0440\u0438 \u043E\u0442\u043A\u0440\u044B\u0442\u0438\u0438 \u0434\u043E\u043C\u0430\u0448\u043D\u0435\u0439 \u0441\u0442\u0440\u0430\u043D\u0438\u0446\u044B.",commandsAddButton:"\u0414\u043E\u0431\u0430\u0432\u0438\u0442\u044C...",commandUnavailable:"\u041A\u043E\u043C\u0430\u043D\u0434\u0430 \u043D\u0435 \u043D\u0430\u0439\u0434\u0435\u043D\u0430 \u0438 \u043D\u0435 \u0431\u0443\u0434\u0435\u0442 \u0432\u044B\u043F\u043E\u043B\u043D\u0435\u043D\u0430. \u0412\u043E\u0437\u043C\u043E\u0436\u043D\u043E, \u0441\u043E\u043E\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044E\u0449\u0438\u0439 \u043F\u043B\u0430\u0433\u0438\u043D \u043E\u0442\u043A\u043B\u044E\u0447\u0435\u043D.",commandsReally:"\u0412\u044B \u0443\u0432\u0435\u0440\u0435\u043D\u044B?",vaultGroup:"\u0421\u0440\u0435\u0434\u0430 \u0445\u0440\u0430\u043D\u0438\u043B\u0438\u0449\u0430",openMode:"\u0421\u043F\u043E\u0441\u043E\u0431 \u043E\u0442\u043A\u0440\u044B\u0442\u0438\u044F",openModeDesc:"\u041E\u043F\u0440\u0435\u0434\u0435\u043B\u044F\u0435\u0442, \u043A\u0430\u043A \u043E\u0431\u0440\u0430\u0431\u0430\u0442\u044B\u0432\u0430\u044E\u0442\u0441\u044F \u043E\u0442\u043A\u0440\u044B\u0442\u044B\u0435 \u0432\u043A\u043B\u0430\u0434\u043A\u0438 \u043F\u0440\u0438 \u0437\u0430\u043F\u0443\u0441\u043A\u0435.",manualOpenMode:"\u0421\u043F\u043E\u0441\u043E\u0431 \u043E\u0442\u043A\u0440\u044B\u0442\u0438\u044F \u0432\u0440\u0443\u0447\u043D\u0443\u044E",manualOpenModeDesc:"\u041E\u043F\u0440\u0435\u0434\u0435\u043B\u044F\u0435\u0442, \u043A\u0430\u043A \u043E\u0431\u0440\u0430\u0431\u0430\u0442\u044B\u0432\u0430\u044E\u0442\u0441\u044F \u043E\u0442\u043A\u0440\u044B\u0442\u044B\u0435 \u0432\u043A\u043B\u0430\u0434\u043A\u0438 \u043F\u0440\u0438 \u043E\u0442\u043A\u0440\u044B\u0442\u0438\u0438 \u0447\u0435\u0440\u0435\u0437 \u043A\u043E\u043C\u0430\u043D\u0434\u044B \u0438\u043B\u0438 \u043A\u043D\u043E\u043F\u043A\u0443.",pin:"\u0417\u0430\u043A\u0440\u0435\u043F\u0438\u0442\u044C",pinDesc:"\u0417\u0430\u043A\u0440\u0435\u043F\u0438\u0442\u044C \u0434\u043E\u043C\u0430\u0448\u043D\u044E\u044E \u0441\u0442\u0440\u0430\u043D\u0438\u0446\u0443 \u043F\u0440\u0438 \u043E\u0442\u043A\u0440\u044B\u0442\u0438\u0438.",hideReleaseNotes:"\u0421\u043A\u0440\u044B\u0432\u0430\u0442\u044C \u043F\u0440\u0438\u043C\u0435\u0447\u0430\u043D\u0438\u044F \u043A \u0432\u044B\u043F\u0443\u0441\u043A\u0443",hideReleaseNotesDesc:"\u041D\u0435 \u043F\u043E\u043A\u0430\u0437\u044B\u0432\u0430\u0442\u044C \u043F\u0440\u0438\u043C\u0435\u0447\u0430\u043D\u0438\u044F \u043A \u0432\u044B\u043F\u0443\u0441\u043A\u0443 \u043F\u0440\u0438 \u043E\u0431\u043D\u043E\u0432\u043B\u0435\u043D\u0438\u0438 Obsidian.",autoCreate:"\u0410\u0432\u0442\u043E\u043C\u0430\u0442\u0438\u0447\u0435\u0441\u043A\u043E\u0435 \u0441\u043E\u0437\u0434\u0430\u043D\u0438\u0435",autoCreateDesc:"\u0415\u0441\u043B\u0438 \u0434\u043E\u043C\u0430\u0448\u043D\u0435\u0439 \u0441\u0442\u0440\u0430\u043D\u0438\u0446\u044B \u043D\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442, \u0441\u043E\u0437\u0434\u0430\u0435\u0442 \u0435\u0451.",autoCreateWarn:"\u041F\u0440\u0438 \u0441\u0438\u043D\u0445\u0440\u043E\u043D\u0438\u0437\u0430\u0446\u0438\u0438 \u0447\u0435\u0440\u0435\u0437 \u043D\u0435\u043E\u0444\u0438\u0446\u0438\u0430\u043B\u044C\u043D\u044B\u0435 \u0441\u0435\u0440\u0432\u0438\u0441\u044B \u0432\u043E\u0437\u043C\u043E\u0436\u043D\u0430 \u043F\u0435\u0440\u0435\u0437\u0430\u043F\u0438\u0441\u044C \u0434\u0430\u043D\u043D\u044B\u0445.",openingGroup:"\u0420\u0435\u0436\u0438\u043C \u043F\u0440\u0438 \u043E\u0442\u043A\u0440\u044B\u0442\u0438\u0438",view:"\u0420\u0435\u0436\u0438\u043C \u0434\u043E\u043C\u0430\u0448\u043D\u0435\u0439 \u0441\u0442\u0440\u0430\u043D\u0438\u0446\u044B",viewDesc:"\u0412\u044B\u0431\u0435\u0440\u0438\u0442\u0435 \u0440\u0435\u0436\u0438\u043C \u043E\u0442\u043A\u0440\u044B\u0442\u0438\u044F \u0434\u043E\u043C\u0430\u0448\u043D\u0435\u0439 \u0441\u0442\u0440\u0430\u043D\u0438\u0446\u044B.",revertView:"\u0412\u043E\u0437\u0432\u0440\u0430\u0449\u0430\u0442\u044C \u0440\u0435\u0436\u0438\u043C \u043F\u0440\u0438 \u0437\u0430\u043A\u0440\u044B\u0442\u0438\u0438",revertViewDesc:"\u0412\u043E\u0441\u0441\u0442\u0430\u043D\u0430\u0432\u043B\u0438\u0432\u0430\u0442\u044C \u0440\u0435\u0436\u0438\u043C \u043F\u043E \u0443\u043C\u043E\u043B\u0447\u0430\u043D\u0438\u044E \u043F\u0440\u0438 \u0443\u0445\u043E\u0434\u0435 \u0441 \u0434\u043E\u043C\u0430\u0448\u043D\u0435\u0439 \u0441\u0442\u0440\u0430\u043D\u0438\u0446\u044B.",autoScroll:"\u0410\u0432\u0442\u043E-scroll",autoScrollDesc:"\u041F\u0440\u043E\u043A\u0440\u0443\u0447\u0438\u0432\u0430\u0442\u044C \u0432\u043D\u0438\u0437 \u0438 \u0444\u043E\u043A\u0443\u0441\u0438\u0440\u043E\u0432\u0430\u0442\u044C\u0441\u044F \u043D\u0430 \u043F\u043E\u0441\u043B\u0435\u0434\u043D\u0435\u0439 \u0441\u0442\u0440\u043E\u043A\u0435 \u043F\u0440\u0438 \u043E\u0442\u043A\u0440\u044B\u0442\u0438\u0438.",refreshDataview:"\u041E\u0431\u043D\u043E\u0432\u043B\u044F\u0442\u044C Dataview",refreshDataviewDesc:"\u041F\u0435\u0440\u0435\u0437\u0430\u0433\u0440\u0443\u0436\u0430\u0442\u044C \u043F\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043B\u0435\u043D\u0438\u044F Dataview \u043F\u0440\u0438 \u043E\u0442\u043A\u0440\u044B\u0442\u0438\u0438 \u0434\u043E\u043C\u0430\u0448\u043D\u0435\u0439 \u0441\u0442\u0440\u0430\u043D\u0438\u0446\u044B.",refreshDataviewWarn:"\u0422\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044F \u0432\u043A\u043B\u044E\u0447\u0435\u043D\u043D\u043E\u0435 \u0430\u0432\u0442\u043E\u043E\u0431\u043D\u043E\u0432\u043B\u0435\u043D\u0438\u0435 Dataview.",FileDesc:"\u0423\u043A\u0430\u0436\u0438\u0442\u0435 \u0437\u0430\u043C\u0435\u0442\u043A\u0443, \u0431\u0430\u0437\u0443 \u0438\u043B\u0438 canvas.",WorkspaceDesc:"\u0423\u043A\u0430\u0436\u0438\u0442\u0435 \u0440\u0430\u0431\u043E\u0447\u0435\u0435 \u043F\u0440\u043E\u0441\u0442\u0440\u0430\u043D\u0441\u0442\u0432\u043E Obsidian.","New noteDesc":"\u0423\u043A\u0430\u0436\u0438\u0442\u0435 \u043F\u0440\u0435\u0444\u0438\u043A\u0441. \u041F\u0440\u0438 \u043A\u0430\u0436\u0434\u043E\u043C \u0437\u0430\u043F\u0443\u0441\u043A\u0435 Obsidian \u0431\u0443\u0434\u0435\u0442 \u0441\u043E\u0437\u0434\u0430\u0432\u0430\u0442\u044C\u0441\u044F \u043D\u043E\u0432\u0430\u044F \u0437\u0430\u043C\u0435\u0442\u043A\u0430 \u0441 \u044D\u0442\u0438\u043C \u043F\u0440\u0435\u0444\u0438\u043A\u0441\u043E\u043C.","Graph viewDesc":"\u0411\u0443\u0434\u0435\u0442 \u0438\u0441\u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u043D \u0433\u0440\u0430\u0444.",NothingDesc:"\u041F\u043E \u0443\u043C\u043E\u043B\u0447\u0430\u043D\u0438\u044E \u043D\u0438\u0447\u0435\u0433\u043E \u043D\u0435 \u043F\u0440\u043E\u0438\u0437\u043E\u0439\u0434\u0435\u0442. \u0414\u043E\u0431\u0430\u0432\u043B\u0435\u043D\u043D\u044B\u0435 \u043A\u043E\u043C\u0430\u043D\u0434\u044B \u0431\u0443\u0434\u0443\u0442 \u0432\u044B\u043F\u043E\u043B\u043D\u0435\u043D\u044B.","Random fileDesc":"\u0411\u0443\u0434\u0435\u0442 \u0432\u044B\u0431\u0440\u0430\u043D \u0441\u043B\u0443\u0447\u0430\u0439\u043D\u044B\u0439 \u0444\u0430\u0439\u043B \u0438\u0437 \u0445\u0440\u0430\u043D\u0438\u043B\u0438\u0449\u0430 Obsidian.","Random in folderDesc":"\u0423\u043A\u0430\u0436\u0438\u0442\u0435 \u043F\u0430\u043F\u043A\u0443. \u0411\u0443\u0434\u0435\u0442 \u0432\u044B\u0431\u0440\u0430\u043D \u0441\u043B\u0443\u0447\u0430\u0439\u043D\u044B\u0439 \u0444\u0430\u0439\u043B \u0438\u0437 \u043D\u0435\u0451.",JournalDesc:"\u0423\u043A\u0430\u0436\u0438\u0442\u0435 \u0436\u0443\u0440\u043D\u0430\u043B.","Daily noteDesc":"\u0411\u0443\u0434\u0435\u0442 \u0438\u0441\u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u043D\u0430 \u0435\u0436\u0435\u0434\u043D\u0435\u0432\u043D\u0430\u044F \u0437\u0430\u043C\u0435\u0442\u043A\u0430.","Weekly noteDesc":"\u0411\u0443\u0434\u0435\u0442 \u0438\u0441\u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u043D\u0430 \u0435\u0436\u0435\u043D\u0435\u0434\u0435\u043B\u044C\u043D\u0430\u044F \u0437\u0430\u043C\u0435\u0442\u043A\u0430.","Monthly noteDesc":"\u0411\u0443\u0434\u0435\u0442 \u0438\u0441\u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u043D\u0430 \u0435\u0436\u0435\u043C\u0435\u0441\u044F\u0447\u043D\u0430\u044F \u0437\u0430\u043C\u0435\u0442\u043A\u0430.","Yearly noteDesc":"\u0411\u0443\u0434\u0435\u0442 \u0438\u0441\u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u043D\u0430 \u0435\u0436\u0435\u0433\u043E\u0434\u043D\u0430\u044F \u0437\u0430\u043C\u0435\u0442\u043A\u0430.",homepageSettingTitle:"Homepage",pluginUnavailableSettings:"\u041D\u0435\u043E\u0431\u0445\u043E\u0434\u0438\u043C\u044B\u0439 \u043F\u043B\u0430\u0433\u0438\u043D \u043D\u0435\u0434\u043E\u0441\u0442\u0443\u043F\u0435\u043D.",copyDebugInfoNotice:"\u041E\u0442\u043B\u0430\u0434\u043E\u0447\u043D\u0430\u044F \u0438\u043D\u0444\u043E\u0440\u043C\u0430\u0446\u0438\u044F \u0434\u043E\u043C\u0430\u0448\u043D\u0435\u0439 \u0441\u0442\u0440\u0430\u043D\u0438\u0446\u044B \u0441\u043A\u043E\u043F\u0438\u0440\u043E\u0432\u0430\u043D\u0430 \u0432 \u0431\u0443\u0444\u0435\u0440 \u043E\u0431\u043C\u0435\u043D\u0430"};var Ft={en:ge,ru:Ke},ze,qe=!1;function r(n,...t){if(!qe){let a=localStorage.getItem("language")?.toLowerCase()?.split("-")[0]||"en";ze=Ft[a],qe=!0}n=ze?.[n]||ge[n];let e=0;for(let a of t)n=n.replace("?"+e,a),e++;return n}var D=require("obsidian");var h=require("obsidian");var $=class extends h.AbstractInputSuggest{getSuggestions(e){let a=this.app.vault.getAllLoadedFiles(),i=[],o=e.toLowerCase();return a.forEach(s=>{s instanceof h.TFile&&["md","canvas","base"].contains(s.extension)&&s.path.toLowerCase().contains(o)&&i.push(s)}),i}renderSuggestion(e,a){e.extension=="md"?a.setText(T(e)):(a.setText(e.path.split(".").slice(0,-1).join(".")),a.insertAdjacentHTML("beforeend",``))}selectSuggestion(e){this.textInputEl.value=T(e),this.textInputEl.trigger("input"),this.close()}},me=class extends h.AbstractInputSuggest{getSuggestions(e){let a=e.toLowerCase();return this.app.vault.getAllFolders().filter(i=>i.path.toLowerCase().contains(a))}renderSuggestion(e,a){a.setText(e.path)}selectSuggestion(e){this.textInputEl.value=e.path,this.textInputEl.trigger("input"),this.close()}},he=class extends h.AbstractInputSuggest{getSuggestions(e){let a=Object.keys(this.app.internalPlugins.plugins.workspaces?.instance.workspaces),i=e.toLowerCase();return a.filter(o=>o.toLowerCase().contains(i))}renderSuggestion(e,a){a.setText(e)}selectSuggestion(e){this.textInputEl.value=e,this.textInputEl.trigger("input"),this.close()}},fe=class extends h.AbstractInputSuggest{getSuggestions(e){let a=this.app.plugins.plugins.journals.journals.map(o=>o.name),i=e.toLowerCase();return a.filter(o=>o.toLowerCase().contains(i))}renderSuggestion(e,a){a.setText(e)}selectSuggestion(e){this.textInputEl.value=e,this.textInputEl.trigger("input"),this.close()}},Je={["File"]:$,["Workspace"]:he,["Random in folder"]:me,["New note"]:$,["Journal"]:fe},Q=class{constructor(t,e){this.app=t.plugin.app,this.homepage=t.plugin.homepage,this.tab=t,e.addSetting(a=>{a.settingEl.addClass("nv-command-setting"),a.descEl.addClass("nv-command-desc"),a.descEl.innerText=r("commandsDesc"),this.container=a.settingEl.createDiv({cls:"nv-command-box"})}),this.dropzone=document.createElement("div"),this.dropzone.className="nv-command-pill nv-dropzone",this.dropzone.addEventListener("dragenter",a=>a.preventDefault()),this.dropzone.addEventListener("dragover",a=>a.preventDefault()),this.dropzone.addEventListener("drop",()=>this.terminateDrag()),this.update()}update(){this.container.innerHTML="",this.activeDrag=null,this.activeCommand=null;for(let t of this.homepage.data.commands){let e=this.app.commands.findCommand(t.id),a=this.container.createDiv({cls:"nv-command-pill",attr:{draggable:!0}});a.addEventListener("dragstart",o=>{o.dataTransfer.effectAllowed="move",this.activeCommand=this.homepage.data.commands.splice(this.indexOf(a),1)[0],this.activeDrag=a,this.dropzone.style.width=`${a.clientWidth}px`,this.dropzone.style.height=`${a.clientHeight}px`}),a.addEventListener("dragover",o=>this.moveDropzone(a,o)),a.addEventListener("drop",o=>o.preventDefault()),a.addEventListener("dragend",()=>this.terminateDrag()),a.createSpan({cls:"nv-command-text",text:e?.name??t.id});let i=new h.ButtonComponent(a).setIcon("route").setClass("clickable-icon").setClass("nv-command-period").onClick(o=>this.showMenu(t,o,i));t.period!="Both"&&(i.setClass("nv-command-selected"),i.setIcon(""),i.buttonEl.createSpan({text:r(t.period)})),new h.ButtonComponent(a).setIcon("trash-2").setClass("clickable-icon").setClass("nv-command-delete").onClick(()=>this.delete(t)),e||(a.classList.add("nv-command-invalid"),a.prepend((0,h.getIcon)("ban")),(0,h.setTooltip)(a,r("commandUnavailable"),{delay:.001}))}new h.ButtonComponent(this.container).setClass("nv-command-add-button").setButtonText(r("commandsAddButton")).onClick(()=>{new we(this.tab).open()})}delete(t){this.homepage.data.commands.remove(t),this.homepage.save(),this.update()}showMenu(t,e,a){let i=new h.Menu;for(let s of Object.values(x))i.addItem(c=>{c.setTitle(r(s)),c.setChecked(t.period==s),c.onClick(()=>{t.period=s,this.homepage.save(),this.update()})});let o=a.buttonEl.getBoundingClientRect();i.showAtPosition({x:o.x-22,y:o.y+o.height+8})}indexOf(t){return Array.from(this.container.children).indexOf(t)}moveDropzone(t,e){if(!this.activeDrag)return;this.activeDrag.hidden=!0;let a=t.getBoundingClientRect();e.xawait this.copyDebugInfo()})}sanitiseNote(e){return e===null||e.match(/^\s*$/)!==null?null:(0,D.normalizePath)(e)}display(){let e=this.plugin.homepage.data.kind,a=!1,i=Je[e];this.containerEl.empty();let o=new A(this).addSetting(p=>{p.setName(r("homepageSettingTitle")).addDropdown(async u=>{for(let d of Object.values(F)){if(!this.plugin.hasRequiredPlugin(d))if(d==this.plugin.homepage.data.kind)a=!0;else{u.selectEl.createEl("option",{text:r(d),attr:{disabled:!0}});continue}u.addOption(d,r(d))}u.setValue(this.plugin.homepage.data.kind),u.onChange(async d=>{this.plugin.homepage.data.kind=d,d=="Random file"&&(this.plugin.homepage.data.value=""),await this.plugin.homepage.save(),this.display()})}),p.settingEl.id="nv-main-setting";let v=p.settingEl.createEl("article",{text:r(e+"Desc"),attr:{id:"nv-desc"}});a&&v.createDiv({text:r("pluginUnavailableSettings"),cls:"mod-warning"}),ve.includes(e)?p.addText(u=>{u.setDisabled(!0)}):p.addText(u=>{new i(this.app,u.inputEl),u.setPlaceholder(R.value),u.setValue(R.value==this.plugin.homepage.data.value?"":this.plugin.homepage.data.value),u.onChange(async d=>{this.plugin.homepage.data.value=this.sanitiseNote(d)||R.value,await this.plugin.homepage.save()})})}),s=new A(this).addToggle("openOnStartup",p=>this.display()).addToggle("openWhenEmpty").addToggle("alwaysApply").addSetting(p=>{if(p.setName(r("separateMobile")).setDesc(r("separateMobileDesc")).addToggle(v=>v.setValue(this.plugin.settings.separateMobile).onChange(async u=>{this.plugin.settings.separateMobile=u,this.plugin.homepage=this.plugin.getHomepage(),await this.plugin.saveSettings(),this.display()})),this.plugin.settings.separateMobile){let v=document.createElement("div");p.setClass("nv-mobile-setting"),v.className="mod-warning nv-mobile-info",v.innerHTML=r(D.Platform.isMobile?"separateMobileWarnMobile":"separateMobileWarnDesktop"),p.settingEl.append(v)}});s.elements.openOnStartup.descEl.createDiv({text:r("openOnStartupWarn"),attr:{class:"mod-warning"}}),this.commandBox=new Q(this,new A(this,"commandsGroup"));let c=new A(this,"vaultGroup").addDropdown("openMode",C).addDropdown("manualOpenMode",C).addToggle("pin").addToggle("hideReleaseNotes").addToggle("autoCreate");c.elements.autoCreate.descEl.createDiv({text:r("autoCreateWarn"),cls:"mod-warning"});let w=new A(this,"openingGroup").addDropdown("view",B).addToggle("revertView").addToggle("autoScroll");"dataview"in this.plugin.communityPlugins&&(w.addToggle("refreshDataview"),w.elements.refreshDataview.descEl.createDiv({text:r("refreshDataviewWarn"),attr:{class:"mod-warning"}})),D.Platform.isMobile||new D.ButtonComponent(this.containerEl).setButtonText(r("copyDebugInfo")).setClass("nv-debug-button").onClick(async()=>await this.copyDebugInfo()),["Workspace","Nothing"].includes(e)&&(s.disableSettings("openWhenEmpty","alwaysApply"),c.disableSettings("openMode","manualOpenMode","autoCreate","pin")),["Workspace","Nothing","Graph view"].includes(e)&&w.disableAll(),this.plugin.homepage.data.openOnStartup||c.disableSettings("openMode"),(J.includes(e)||e==="Journal")&&c.disableSettings("autoCreate")}async copyDebugInfo(){let e=this.app.vault.config,a={...this.settings,_defaultViewMode:e.defaultViewMode||"default",_livePreview:e.livePreview!==void 0?e.livePreview:"default",_focusNewTab:e.focusNewTab!==void 0?e.focusNewTab:"default",_plugins:Object.keys(this.plugin.communityPlugins),_internalPlugins:Object.values(this.plugin.internalPlugins).flatMap(i=>i.enabled?[i.instance.id]:[]),_obsidianVersion:window.electron?.ipcRenderer.sendSync("version")||"unknown"};await navigator.clipboard.writeText(JSON.stringify(a)),new D.Notice(r("copyDebugInfoNotice"))}},A=class extends D.SettingGroup{constructor(e,a){super(e.containerEl);this.elements={};a&&this.setHeading(r(a)),this.plugin=e.plugin,this.settings=e.settings}addDropdown(e,a,i){return this.addSetting(o=>{o.setName(r(e)).setDesc(r(e+"Desc")).addDropdown(async s=>{for(let c of Object.values(a))s.addOption(c,r(c));s.setValue(this.plugin.homepage.data[e]),s.onChange(async c=>{this.plugin.homepage.data[e]=c,await this.plugin.homepage.save(),i&&i(c)})}),this.elements[e]=o}),this}addToggle(e,a){return this.addSetting(i=>{i.setName(r(e)).setDesc(r(e+"Desc")).addToggle(o=>o.setValue(this.plugin.homepage.data[e]).onChange(async s=>{this.plugin.homepage.data[e]=s,await this.plugin.homepage.save(),a&&a(s)})),this.elements[e]=i}),this}disableAll(){this.disableSettings(...Object.keys(this.elements))}disableSettings(...e){e.forEach(a=>{this.elements[a]?.settingEl.setAttribute("nv-greyed","")})}};var At=["markdown","canvas","kanban","bases"],G="Main Homepage",K="Mobile Homepage",C=(a=>(a.ReplaceAll="Replace all open notes",a.ReplaceLast="Replace last note",a.Retain="Keep open notes",a))(C||{}),B=(i=>(i.Default="Default view",i.Reading="Reading view",i.Source="Editing view (Source)",i.LivePreview="Editing view (Live Preview)",i))(B||{}),F=(d=>(d.File="File",d.Workspace="Workspace",d.Random="Random file",d.RandomFolder="Random in folder",d.NewNote="New note",d.Graph="Graph view",d.None="Nothing",d.Journal="Journal",d.DailyNote="Daily Note",d.WeeklyNote="Weekly Note",d.MonthlyNote="Monthly Note",d.YearlyNote="Yearly Note",d))(F||{}),x=(a=>(a.Both="Both",a.Startup="Startup only",a.Manual="Manual only",a))(x||{}),ve=["Random file","Graph view","Nothing",...J],j=class{constructor(t,e){this.lastView=void 0;this.openedViews=new WeakMap;this.name=t,this.plugin=e,this.app=e.app;let a=this.plugin.settings.homepages[t];a?this.data=Object.assign({},R,a):(this.plugin.settings.homepages[t]={...R},this.data=this.plugin.settings.homepages[t])}async open(t=!1){if(this.plugin.hasRequiredPlugin(this.data.kind)){if(this.data.kind==="Journal"&&!je(this)){new b.Notice(r("journalUnavailable",this.data.value));return}}else{new b.Notice(r("pluginUnavailable"));return}if(this.data.kind==="Workspace")await this.launchWorkspace();else if(this.data.kind!=="Nothing"){let a=this.plugin.loaded?this.data.manualOpenMode:this.data.openMode;t&&(a="Keep open notes"),await this.launchLeaf(a)}if(this.data.commands.length<1)return;let e=this.plugin.loaded?"Startup only":"Manual only";await Pe(this.app);for(let{id:a,period:i}of this.data.commands)i!==e&&this.app.commands.executeCommandById(a)}async launchWorkspace(){let t=this.plugin.internalPlugins.workspaces?.instance;if(!(this.data.value in t.workspaces)){new b.Notice(r("workspaceUnavailable",this.data.value));return}t.loadWorkspace(this.data.value),await q(100)}async launchLeaf(t){let e;if(this.computedValue=await this.computeValue(),this.plugin.executing=!0,t!=="Replace all open notes"){let a=this.getOpened();if(a.length>0){this.app.workspace.setActiveLeaf(a[0]),await this.configure(a[0]);return}else t=="Keep open notes"&&ke(this.app)&&(t="Replace last note")}t!=="Keep open notes"&&this.app.workspace.getActiveViewOfType(b.View)?.leaf.setPinned(!1),t==="Replace all open notes"&&(this.app.workspace?.floatingSplit?.children&&(await q(0),this.app.workspace.floatingSplit.children.forEach(a=>a.win.close())),await Te(this.app),await q(0)),this.data.kind==="Graph view"?e=await this.launchGraph(t):e=await this.launchNote(t),e&&await this.configure(e)}async launchGraph(t){if(t==="Keep open notes"){let e=this.app.workspace.getLeaf("tab");this.app.workspace.setActiveLeaf(e)}return this.app.commands.executeCommandById("graph:open"),this.app.workspace.getActiveViewOfType(b.View)?.leaf}async launchNote(t){let e=this.app.metadataCache.getFirstLinkpathDest(this.computedValue,"/");if(!e){if(!this.data.autoCreate){new b.Notice(r("noteUnavailable",this.computedValue));return}e=await this.app.vault.create(Ne(this.computedValue),"")}let a=await this.app.vault.cachedRead(e),i=this.app.workspace.getLeaf(t=="Keep open notes");return await i.openFile(e),this.app.workspace.setActiveLeaf(i),a!==await this.app.vault.read(e)&&await this.app.vault.modify(e,a),i}async configure(t){this.plugin.executing=!1;let e=t.view;if(!(e instanceof b.MarkdownView)){this.data.pin&&e.leaf.setPinned(!0),this.configurePlugins();return}let a=e.getState();if(this.data.revertView&&(this.lastView=new WeakRef(e)),this.data.autoScroll){let i=e.editor.lineCount();a.mode=="preview"?e.previewMode.applyScroll(i-4):(e.editor.setCursor(i),e.editor.focus())}if(this.data.pin&&e.leaf.setPinned(!0),this.data.view!=="Default view"){switch(this.data.view){case"Editing view (Live Preview)":case"Editing view (Source)":a.mode="source",a.source=this.data.view!="Editing view (Live Preview)";break;case"Reading view":a.mode="preview";break}await e.leaf.setViewState({type:"markdown",state:a})}this.configurePlugins()}configurePlugins(){this.plugin.loaded&&this.data.refreshDataview&&this.plugin.communityPlugins.dataview?.index.touch(),this.plugin.communityPlugins["obsidian-file-color"]?.generateColorStyles()}getOpened(){return this.data.kind=="Graph view"?this.app.workspace.getLeavesOfType("graph"):At.flatMap(e=>this.app.workspace.getLeavesOfType(e)).filter(e=>{let a=e.view.getState().file;return ne(a.endsWith("md")?a.slice(0,-3):a,this.computedValue)})}async computeValue(){let t=this.data.value,e;switch(this.data.kind){case"Random file":e=ae(this.app),e&&(t=e);break;case"Random in folder":e=ae(this.app,t),e&&(t=e);break;case"New note":this.cachedNewFile||(this.cachedNewFile=T(await this.app.fileManager.createNewFile("",t))),t=this.cachedNewFile;break;case"Journal":t=await Ge(t,this.plugin);break;case"Daily Note":case"Weekly Note":case"Monthly Note":case"Yearly Note":t=await Ue(this.data.kind,this.plugin);break}return t}async save(){this.plugin.settings.homepages[this.name]=this.data,await this.plugin.saveSettings()}async setToActiveFile(){this.data.value=T(this.app.workspace.getActiveFile()),await this.save(),new b.Notice(r("homepageChanged",this.data.value))}canSetToFile(){return this.app.workspace.getActiveFile()!==null&&!ve.includes(this.data.kind)}async revertView(){if(this.lastView==null||this.data.view=="Default view")return;let t=this.lastView.deref();if(!t||ne(T(t.file),this.computedValue))return;let e=t.getState(),a=this.app.vault.config,i=a.defaultViewMode||"source",o=a.livePreview!==void 0?!a.livePreview:!1;t.leaf.getViewState().type=="markdown"&&(i!=e.mode||o!=e.source)&&(e.mode=i,e.source=o,await t.leaf.setViewState({type:"markdown",state:e,active:!0})),this.lastView=void 0}async openWhenEmpty(){if(!this.plugin.loaded||this.plugin.executing)return;let t=this.app.workspace.getActiveViewOfType(b.View)?.leaf;t?.getViewState().type!=="empty"||t.parentSplit.children.length!=1||await this.open(!0)}async apply(){let t=this.app.workspace.getActiveViewOfType(b.FileView);if(!t)return;let e=T(t.file);this.openedViews.get(t)!==e&&(this.openedViews.set(t,e),e===await this.computeValue()&&this.plugin.loaded&&!this.plugin.executing&&await this.configure(t.leaf))}};var Et='',X=class extends k.Plugin{constructor(){super(...arguments);this.newRelease=!1;this.loaded=!1;this.executing=!1;this.onLayoutChange=async()=>{this.homepage.data.revertView&&await this.homepage.revertView(),this.homepage.data.openWhenEmpty&&await this.homepage.openWhenEmpty(),this.homepage.data.alwaysApply&&await this.homepage.apply()}}async onload(){this.patchReleaseNotes(),this.patchOpeningBehaviour(),this.settings=await this.loadSettings(),this.internalPlugins=this.app.internalPlugins.plugins,this.communityPlugins=this.app.plugins.plugins,this.homepage=this.getHomepage(),(0,k.addIcon)("homepage",Et),this.addRibbonIcon("homepage","Open homepage",e=>this.homepage.open(e.button==1||e.button==2||k.Keymap.isModifier(e,"Mod"))).setAttribute("id","nv-homepage-icon"),this.registerEvent(this.app.workspace.on("layout-change",this.onLayoutChange)),this.addSettingTab(new Z(this.app,this)),this.addCommand({id:"open-homepage",name:r("openHomepage"),callback:()=>this.homepage.open()}),this.addCommand({id:"set-to-active-file",name:r("setToActiveFile"),checkCallback:e=>{if(e)return this.homepage.canSetToFile();this.homepage.setToActiveFile()}})}async onunload(){this.app.workspace.off("layout-change",this.onLayoutChange),this.unpatchNewTabPage(),this.unpatchOpeningBehaviour()}getHomepage(){return this.settings.separateMobile&&k.Platform.isMobile?(K in this.settings.homepages||(this.settings.homepages[K]={...this.settings.homepages?.[G]},this.settings.homepages[K].commands=[...this.settings.homepages?.[G]?.commands]),new j(K,this)):new j(G,this)}async loadSettings(){let e=await this.loadData();return e?.version!==4?e?this.upgradeSettings(e):Object.assign({},ye):e}async saveSettings(){await this.saveData(this.settings)}async hasUrlParams(){let e,a;if(k.Platform.isMobile){let i=await window.Capacitor.Plugins.App.getLaunchUrl();if(!i)return!1;let o=new URL(i.url);a=Array.from(o.searchParams.keys()),e=o.hostname}else if(window.OBS_ACT)a=Object.keys(window.OBS_ACT),e=window.OBS_ACT.action;else return!1;return["open","advanced-uri"].includes(e)&&["file","filepath","workspace"].some(i=>a.includes(i))}hasRequiredPlugin(e){switch(e){case"Workspace":return this.internalPlugins.workspaces?.enabled;case"Graph view":return this.internalPlugins.graph?.enabled;case"Journal":return this.communityPlugins.journals;case"Daily Note":case"Weekly Note":case"Monthly Note":case"Yearly Note":return Ye(e,this);default:return!0}}patchNewTabPage(){let e=this.communityPlugins["new-tab-default-page"];e&&(e.nvOrig_checkForNewTab=e.checkForNewTab,e.checkForNewTab=async a=>{if(!(this&&this.executing))return await e.nvOrig_checkForNewTab(a)})}unpatchNewTabPage(){let e=this.communityPlugins["new-tab-default-page"];e&&(e.checkForNewTab=e._checkForNewTab)}patchReleaseNotes(){this.app.nvOrig_showReleaseNotes=this.app.showReleaseNotes,this.app.showReleaseNotes=()=>this.newRelease=!0}unpatchReleaseNotes(){this.newRelease&&!this.homepage.data.hideReleaseNotes&&this.app.nvOrig_showReleaseNotes(),this.app.showReleaseNotes=this.app.nvOrig_showReleaseNotes}patchOpeningBehaviour(){this.app.nvOrig_runOpeningBehavior=this.app.runOpeningBehavior,this.app.runOpeningBehavior=async e=>{let a=this.homepage.data.openOnStartup&&!await this.hasUrlParams();this.patchNewTabPage(),a?await this.homepage.open():this.app.nvOrig_runOpeningBehavior(e),this.loaded=!0,this.unpatchReleaseNotes()}}unpatchOpeningBehaviour(){this.app.runOpeningBehavior=this.app.nvOrig_runOpeningBehavior}upgradeSettings(e){if(e.version==3){let i=e,o=!1;for(let s of Object.values(i.homepages))s.commands=s.commands.map(c=>({id:c,period:"Both"})),s.kind==Ve&&(o=!0,s.kind="Daily Note");return o&&new k.Notice(r("momentUpgradeNotice")),i.version=4,this.saveData(i),i}let a=Object.assign({},ye);return e.workspaceEnabled?(e.value=e.workspace,e.kind="Workspace"):e.momentFormat?(e.kind="Daily Note",new k.Notice(r("momentUpgradeNotice"))):(e.value=e.defaultNote,e.kind="File"),e.commands=[],delete e.workspace,delete e.momentFormat,delete e.defaultNote,delete e.useMoment,delete e.workspaceEnabled,a.homepages[G]=e,this.saveData(a),a}}; +"use strict";var $e=Object.create;var z=Object.defineProperty;var Qe=Object.getOwnPropertyDescriptor;var Ze=Object.getOwnPropertyNames;var Xe=Object.getPrototypeOf,et=Object.prototype.hasOwnProperty;var tt=(n,t)=>()=>(t||n((t={exports:{}}).exports,t),t.exports),at=(n,t)=>{for(var e in t)z(n,e,{get:t[e],enumerable:!0})},be=(n,t,e,a)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of Ze(t))!et.call(n,i)&&i!==e&&z(n,i,{get:()=>t[i],enumerable:!(a=Qe(t,i))||a.enumerable});return n};var nt=(n,t,e)=>(e=n!=null?$e(Xe(n)):{},be(t||!n||!n.__esModule?z(e,"default",{value:n,enumerable:!0}):e,n)),it=n=>be(z({},"__esModule",{value:!0}),n);var Ve=tt(l=>{"use strict";Object.defineProperty(l,"__esModule",{value:!0});var m=require("obsidian"),ie="YYYY-MM-DD",oe="gggg-[W]ww",Se="YYYY-MM",Me="YYYY-[Q]Q",Fe="YYYY";function H(n){let t=window.app.plugins.getPlugin("periodic-notes");return t&&t.settings?.[n]?.enabled}function I(){try{let{internalPlugins:n,plugins:t}=window.app;if(H("daily")){let{format:o,folder:s,template:c}=t.getPlugin("periodic-notes")?.settings?.daily||{};return{format:o||ie,folder:s?.trim()||"",template:c?.trim()||""}}let{folder:e,format:a,template:i}=n.getPluginById("daily-notes")?.instance?.options||{};return{format:a||ie,folder:e?.trim()||"",template:i?.trim()||""}}catch(n){console.info("No custom daily note settings found!",n)}}function W(){try{let n=window.app.plugins,t=n.getPlugin("calendar")?.options,e=n.getPlugin("periodic-notes")?.settings?.weekly;if(H("weekly"))return{format:e.format||oe,folder:e.folder?.trim()||"",template:e.template?.trim()||""};let a=t||{};return{format:a.weeklyNoteFormat||oe,folder:a.weeklyNoteFolder?.trim()||"",template:a.weeklyNoteTemplate?.trim()||""}}catch(n){console.info("No custom weekly note settings found!",n)}}function V(){let n=window.app.plugins;try{let t=H("monthly")&&n.getPlugin("periodic-notes")?.settings?.monthly||{};return{format:t.format||Se,folder:t.folder?.trim()||"",template:t.template?.trim()||""}}catch(t){console.info("No custom monthly note settings found!",t)}}function _(){let n=window.app.plugins;try{let t=H("quarterly")&&n.getPlugin("periodic-notes")?.settings?.quarterly||{};return{format:t.format||Me,folder:t.folder?.trim()||"",template:t.template?.trim()||""}}catch(t){console.info("No custom quarterly note settings found!",t)}}function U(){let n=window.app.plugins;try{let t=H("yearly")&&n.getPlugin("periodic-notes")?.settings?.yearly||{};return{format:t.format||Fe,folder:t.folder?.trim()||"",template:t.template?.trim()||""}}catch(t){console.info("No custom yearly note settings found!",t)}}function Ae(...n){let t=[];for(let a=0,i=n.length;a{let ee=a(),te=n.clone().set({hour:ee.get("hour"),minute:ee.get("minute"),second:ee.get("second")});return M&&te.add(parseInt(N,10),y),f?te.format(f.substring(1).trim()):te.format(o)}).replace(/{{\s*yesterday\s*}}/gi,n.clone().subtract(1,"day").format(o)).replace(/{{\s*tomorrow\s*}}/gi,n.clone().add(1,"d").format(o)));return t.foldManager.save(u,w),u}catch(u){console.error(`Failed to create file: '${v}'`,u),new m.Notice("Unable to create new file.")}}function pt(n,t){return t[P(n,"day")]??null}function dt(){let{vault:n}=window.app,{folder:t}=I(),e=n.getAbstractFileByPath(m.normalizePath(t));if(!e)throw new se("Failed to find daily notes folder");let a={};return m.Vault.recurseChildren(e,i=>{if(i instanceof m.TFile){let o=L(i,"day");if(o){let s=P(o,"day");a[s]=i}}}),a}var re=class extends Error{};function ut(){let{moment:n}=window,t=n.localeData()._week.dow,e=["sunday","monday","tuesday","wednesday","thursday","friday","saturday"];for(;t;)e.push(e.shift()),t--;return e}function gt(n){return ut().indexOf(n.toLowerCase())}async function Ce(n){let{vault:t}=window.app,{template:e,format:a,folder:i}=W(),[o,s]=await O(e),c=n.format(a),w=await Y(i,c);try{let p=await t.create(w,o.replace(/{{\s*(date|time)\s*(([+-]\d+)([yqmwdhs]))?\s*(:.+?)?}}/gi,(v,u,d,S,M,N)=>{let y=window.moment(),f=n.clone().set({hour:y.get("hour"),minute:y.get("minute"),second:y.get("second")});return d&&f.add(parseInt(S,10),M),N?f.format(N.substring(1).trim()):f.format(a)}).replace(/{{\s*title\s*}}/gi,c).replace(/{{\s*time\s*}}/gi,window.moment().format("HH:mm")).replace(/{{\s*(sunday|monday|tuesday|wednesday|thursday|friday|saturday)\s*:(.*?)}}/gi,(v,u,d)=>{let S=gt(u);return n.weekday(S).format(d.trim())}));return window.app.foldManager.save(p,s),p}catch(p){console.error(`Failed to create file: '${w}'`,p),new m.Notice("Unable to create new file.")}}function mt(n,t){return t[P(n,"week")]??null}function ht(){let n={};if(!xe())return n;let{vault:t}=window.app,{folder:e}=W(),a=t.getAbstractFileByPath(m.normalizePath(e));if(!a)throw new re("Failed to find weekly notes folder");return m.Vault.recurseChildren(a,i=>{if(i instanceof m.TFile){let o=L(i,"week");if(o){let s=P(o,"week");n[s]=i}}}),n}var le=class extends Error{};async function Re(n){let{vault:t}=window.app,{template:e,format:a,folder:i}=V(),[o,s]=await O(e),c=n.format(a),w=await Y(i,c);try{let p=await t.create(w,o.replace(/{{\s*(date|time)\s*(([+-]\d+)([yqmwdhs]))?\s*(:.+?)?}}/gi,(v,u,d,S,M,N)=>{let y=window.moment(),f=n.clone().set({hour:y.get("hour"),minute:y.get("minute"),second:y.get("second")});return d&&f.add(parseInt(S,10),M),N?f.format(N.substring(1).trim()):f.format(a)}).replace(/{{\s*date\s*}}/gi,c).replace(/{{\s*time\s*}}/gi,window.moment().format("HH:mm")).replace(/{{\s*title\s*}}/gi,c));return window.app.foldManager.save(p,s),p}catch(p){console.error(`Failed to create file: '${w}'`,p),new m.Notice("Unable to create new file.")}}function ft(n,t){return t[P(n,"month")]??null}function wt(){let n={};if(!He())return n;let{vault:t}=window.app,{folder:e}=V(),a=t.getAbstractFileByPath(m.normalizePath(e));if(!a)throw new le("Failed to find monthly notes folder");return m.Vault.recurseChildren(a,i=>{if(i instanceof m.TFile){let o=L(i,"month");if(o){let s=P(o,"month");n[s]=i}}}),n}var ce=class extends Error{};async function yt(n){let{vault:t}=window.app,{template:e,format:a,folder:i}=_(),[o,s]=await O(e),c=n.format(a),w=await Y(i,c);try{let p=await t.create(w,o.replace(/{{\s*(date|time)\s*(([+-]\d+)([yqmwdhs]))?\s*(:.+?)?}}/gi,(v,u,d,S,M,N)=>{let y=window.moment(),f=n.clone().set({hour:y.get("hour"),minute:y.get("minute"),second:y.get("second")});return d&&f.add(parseInt(S,10),M),N?f.format(N.substring(1).trim()):f.format(a)}).replace(/{{\s*date\s*}}/gi,c).replace(/{{\s*time\s*}}/gi,window.moment().format("HH:mm")).replace(/{{\s*title\s*}}/gi,c));return window.app.foldManager.save(p,s),p}catch(p){console.error(`Failed to create file: '${w}'`,p),new m.Notice("Unable to create new file.")}}function vt(n,t){return t[P(n,"quarter")]??null}function bt(){let n={};if(!Ie())return n;let{vault:t}=window.app,{folder:e}=_(),a=t.getAbstractFileByPath(m.normalizePath(e));if(!a)throw new ce("Failed to find quarterly notes folder");return m.Vault.recurseChildren(a,i=>{if(i instanceof m.TFile){let o=L(i,"quarter");if(o){let s=P(o,"quarter");n[s]=i}}}),n}var pe=class extends Error{};async function Nt(n){let{vault:t}=window.app,{template:e,format:a,folder:i}=U(),[o,s]=await O(e),c=n.format(a),w=await Y(i,c);try{let p=await t.create(w,o.replace(/{{\s*(date|time)\s*(([+-]\d+)([yqmwdhs]))?\s*(:.+?)?}}/gi,(v,u,d,S,M,N)=>{let y=window.moment(),f=n.clone().set({hour:y.get("hour"),minute:y.get("minute"),second:y.get("second")});return d&&f.add(parseInt(S,10),M),N?f.format(N.substring(1).trim()):f.format(a)}).replace(/{{\s*date\s*}}/gi,c).replace(/{{\s*time\s*}}/gi,window.moment().format("HH:mm")).replace(/{{\s*title\s*}}/gi,c));return window.app.foldManager.save(p,s),p}catch(p){console.error(`Failed to create file: '${w}'`,p),new m.Notice("Unable to create new file.")}}function Dt(n,t){return t[P(n,"year")]??null}function kt(){let n={};if(!We())return n;let{vault:t}=window.app,{folder:e}=U(),a=t.getAbstractFileByPath(m.normalizePath(e));if(!a)throw new pe("Failed to find yearly notes folder");return m.Vault.recurseChildren(a,i=>{if(i instanceof m.TFile){let o=L(i,"year");if(o){let s=P(o,"year");n[s]=i}}}),n}function Tt(){let{app:n}=window,t=n.internalPlugins.plugins["daily-notes"];if(t&&t.enabled)return!0;let e=n.plugins.getPlugin("periodic-notes");return e&&e.settings?.daily?.enabled}function xe(){let{app:n}=window;if(n.plugins.getPlugin("calendar"))return!0;let t=n.plugins.getPlugin("periodic-notes");return t&&t.settings?.weekly?.enabled}function He(){let{app:n}=window,t=n.plugins.getPlugin("periodic-notes");return t&&t.settings?.monthly?.enabled}function Ie(){let{app:n}=window,t=n.plugins.getPlugin("periodic-notes");return t&&t.settings?.quarterly?.enabled}function We(){let{app:n}=window,t=n.plugins.getPlugin("periodic-notes");return t&&t.settings?.yearly?.enabled}function Pt(n){let t={day:I,week:W,month:V,quarter:_,year:U}[n];return t()}function St(n,t){return{day:Le,month:Re,week:Ce}[n](t)}l.DEFAULT_DAILY_NOTE_FORMAT=ie;l.DEFAULT_MONTHLY_NOTE_FORMAT=Se;l.DEFAULT_QUARTERLY_NOTE_FORMAT=Me;l.DEFAULT_WEEKLY_NOTE_FORMAT=oe;l.DEFAULT_YEARLY_NOTE_FORMAT=Fe;l.appHasDailyNotesPluginLoaded=Tt;l.appHasMonthlyNotesPluginLoaded=He;l.appHasQuarterlyNotesPluginLoaded=Ie;l.appHasWeeklyNotesPluginLoaded=xe;l.appHasYearlyNotesPluginLoaded=We;l.createDailyNote=Le;l.createMonthlyNote=Re;l.createPeriodicNote=St;l.createQuarterlyNote=yt;l.createWeeklyNote=Ce;l.createYearlyNote=Nt;l.getAllDailyNotes=dt;l.getAllMonthlyNotes=wt;l.getAllQuarterlyNotes=bt;l.getAllWeeklyNotes=ht;l.getAllYearlyNotes=kt;l.getDailyNote=pt;l.getDailyNoteSettings=I;l.getDateFromFile=L;l.getDateFromPath=ct;l.getDateUID=P;l.getMonthlyNote=ft;l.getMonthlyNoteSettings=V;l.getPeriodicNoteSettings=Pt;l.getQuarterlyNote=vt;l.getQuarterlyNoteSettings=_;l.getTemplateInfo=O;l.getWeeklyNote=mt;l.getWeeklyNoteSettings=W;l.getYearlyNote=Dt;l.getYearlyNoteSettings=U});var Lt={};at(Lt,{default:()=>X});module.exports=it(Lt);var k=require("obsidian");var b=require("obsidian");var ue=require("obsidian");var E=require("obsidian");function T(n){return n?n.extension=="md"?n.path.slice(0,-3):n.path:""}function Ne(n){return n.split("/").slice(-1)[0].contains(".")?n:`${n}.md`}function ae(n,t=void 0){let e=n.vault.getFiles();if(t){let a=n.vault.getFolderByPath(t);if(!a)return;e=De(a)}if(e.filter(a=>["md","canvas","base"].contains(a.extension)),e.length){let a=Math.floor(Math.random()*e.length);return T(e[a])}}function De(n){let t=[];for(let e of n.children)e instanceof E.TFolder?t.push(...De(e)):t.push(e);return t}function ke(n){return n.workspace.getActiveViewOfType(E.View)?.getViewType()=="empty"}function ne(n,t){return n.localeCompare(t,void 0,{sensitivity:"accent"})===0}function q(n){return new Promise(t=>setTimeout(t,n))}async function Te(n){let t=n.workspace.getLayout();t.main={id:"5324373015726ba8",type:"split",children:[{id:"4509724f8bf84da7",type:"tabs",children:[{id:"e7a7b303c61786dc",type:"leaf",state:{type:"empty",state:{},icon:"lucide-file",title:"New tab"}}]}],direction:"vertical"},t.active="e7a7b303c61786dc",await n.workspace.changeLayout(t),E.Platform.isMobile&&(n.workspace.rightSplit?.updateInfo(),ot(n))}function ot(n){let t=n.internalPlugins.plugins.sync?.instance;t&&n.workspace.onLayoutReady(()=>{t.statusIconEl=n.workspace.rightSplit.addHeaderButton("sync-small",t.openStatusIconMenu.bind(t)),t.statusIconEl.addEventListener("contextmenu",t.openStatusIconMenu.bind(t)),t.statusIconEl.addClass("sync-status-icon")})}function Pe(n){let t=n.internalPlugins.plugins.sync,e=[new Promise(a=>{let i=async()=>{a(),n.workspace.off("layout-change",i)};n.workspace.on("layout-change",i)})];return t.enabled&&t.instance.syncing&&e.push(new Promise(a=>{let i=async()=>{a(),t.instance.off("status-change",i)};t.instance.on("status-change",i)})),Promise.race([Promise.all(e),new Promise(a=>setTimeout(a,1500))])}var g=nt(Ve()),Mt="custom-journal-locale",de={["Daily Note"]:{noun:"day",adjective:"daily",create:g.createDailyNote,get:g.getDailyNote,getAll:g.getAllDailyNotes},["Weekly Note"]:{noun:"week",adjective:"weekly",create:g.createWeeklyNote,get:g.getWeeklyNote,getAll:g.getAllWeeklyNotes},["Monthly Note"]:{noun:"month",adjective:"monthly",create:g.createMonthlyNote,get:g.getMonthlyNote,getAll:g.getAllMonthlyNotes},["Yearly Note"]:{noun:"year",adjective:"yearly",create:g.createYearlyNote,get:g.getYearlyNote,getAll:g.getAllYearlyNotes}},J=["Daily Note","Weekly Note","Monthly Note","Yearly Note"],_e="Date-dependent file";async function Ue(n,t){let e=t.communityPlugins["periodic-notes"],a=de[n],i=(0,ue.moment)().startOf(a.noun),o;if(Be(e)){let s=a.getAll();Object.keys(s).length?o=a.get(i,s)||await a.create(i):o=await a.create(i),o||(o=a.get(i,s))}else e.cache.initialize(),o=e.getPeriodicNote(a.noun,i)||await e.createPeriodicNote(a.noun,i);return T(o)}function Ye(n,t){if(n=="Daily Note"&&t.internalPlugins["daily-notes"]?.enabled)return!0;let e=t.communityPlugins["periodic-notes"];if(!e)return!1;if(Be(e)){let a=de[n].adjective;return e.settings[a]?.enabled}else{let a=de[n].noun;return e?.calendarSetManager?.getActiveSet()[a]?.enabled}}function Be(n){return(n?.manifest.version||"0").startsWith("0")}function je(n){return!!n.plugin.communityPlugins.journals.getJournal(n.data.value)}async function Ge(n,t){let e=t.communityPlugins.journals,a=e.getJournal(n),i=a.config.value.autoCreate;e.reprocessNotes(),a.config.value.autoCreate=!0,await a.autoCreate(),a.config.value.autoCreate=i;let o=(0,ue.moment)().locale(Mt).startOf("day");return a.getNotePath(a?.get(o)).replace(/\.md$/,"")}var ge={["Replace all open notes"]:"Replace all open notes",["Replace last note"]:"Replace last note",["Keep open notes"]:"Keep open notes",["Default view"]:"Default view",["Reading view"]:"Reading view",["Editing view (Source)"]:"Editing view (Source)",["Editing view (Live Preview)"]:"Editing view (Live Preview)",["File"]:"File",["Workspace"]:"Workspace",["Random file"]:"Random file",["Random in folder"]:"Random in folder",["New note"]:"New note",["Graph view"]:"Graph view",["Nothing"]:"Nothing",["Journal"]:"Journal",["Daily Note"]:"Daily Note",["Weekly Note"]:"Weekly Note",["Monthly Note"]:"Monthly Note",["Yearly Note"]:"Yearly Note",["Both"]:"Both",["Startup only"]:"Startup only",["Manual only"]:"Manual only",openHomepage:"Open homepage",setToActiveFile:"Set to active file",copyDebugInfo:"Copy debug info",cliOpenHomepageDesc:"Open the homepage",cliOpenHomepageResult:"Opened the homepage",cliReadHomepageDesc:"Read homepage contents",cliReadHomepageIllegible:"The current homepage cannot be viewed, as it does not match an file",pluginUnavailable:"The active homepage cannot be opened due to plugin unavailablity.",journalUnavailable:'Cannot find the journal "?0" to use as the homepage.',workspaceUnavailable:'Cannot find the workspace "?0" to use as the homepage.',noteUnavailable:'Cannot find the file "?0" to use as the homepage.',homepageChanged:'The homepage has been changed to "?0".',momentUpgradeNotice:"Date-dependent notes in Homepage have been removed. Set your homepage as a Periodic or Daily Note instead.",openOnStartup:"Open on startup",openOnStartupDesc:"When launching Obsidian, open the homepage.",openOnStartupWarn:'This will override the built-in "Default file to open" setting.',openWhenEmpty:"Open when empty",openWhenEmptyDesc:"When there are no tabs open, open the homepage.",alwaysApply:"Use when opening normally",alwaysApplyDesc:"Use homepage settings when opening it normally, such as from a link or the file browser.",separateMobile:"Separate mobile homepage",separateMobileDesc:"For mobile devices, store the homepage and its settings separately.",separateMobileWarnMobile:"Mobile settings are stored separately. Therefore, changes to other settings will not affect desktop devices. To edit desktop settings, use a desktop device.",separateMobileWarnDesktop:"Mobile settings are stored separately. Therefore, changes to other settings will not affect mobile devices. To edit mobile settings, use a mobile device.",commandsGroup:"Commands",commandsDesc:"Select commands that will be executed when opening the homepage.",commandsAddButton:"Add...",commandUnavailable:"This command can't be found, so it won't be executed. It may belong to a disabled plugin.",commandsReally:"Really?",vaultGroup:"Vault environment",openMode:"Opening method",openModeDesc:"Determine how extant tabs and views are affected on startup.",manualOpenMode:"Manual opening method",manualOpenModeDesc:"Determine how extant tabs and views are affected when opening with commands or the ribbon button.",pin:"Pin",pinDesc:"Pin the homepage when opening.",hideReleaseNotes:"Hide release notes",hideReleaseNotesDesc:"Never display release notes when Obsidian updates.",autoCreate:"Auto-create",autoCreateDesc:"When the homepage doesn't exist, create a note with its name.",autoCreateWarn:"If this vault is synced using unofficial services, this may lead to content being overwritten.",openingGroup:"Opened view",view:"Homepage view",viewDesc:"Choose what view to open the homepage in.",revertView:"Revert view on close",revertViewDesc:"When navigating away from the homepage, restore the default view.",autoScroll:"Auto-scroll",autoScrollDesc:"When opening the homepage, scroll to the bottom and focus on the last line",refreshDataview:"Refresh Dataview",refreshDataviewDesc:"Always attempt to reload Dataview views when opening the homepage",refreshDataviewWarn:"Requires Dataview auto-refresh to be enabled.",FileDesc:"Enter a note, base, or canvas to use.",WorkspaceDesc:"Enter an Obsidian workspace to use.","New noteDesc":"Enter a prefix to use. A note using that prefix will be created for each Obsidian session.","Graph viewDesc":"Your graph view will be used.",NothingDesc:"Nothing will occur by default. Any commands added will still take effect.","Random fileDesc":"A random note, base, or canvas from your Obsidian folder will be selected.","Random in folderDesc":"Enter a folder. A random note, base, or canvas from it will be selected.",JournalDesc:"Enter a Journal to use.","Daily noteDesc":"Your Daily Note or Periodic Daily Note will be used.","Weekly noteDesc":"Your Periodic Weekly Note will be used.","Monthly noteDesc":"Your Periodic Monthly Note will be used.","Yearly noteDesc":"Your Periodic Yearly Note will be used.",homepageSettingTitle:"Homepage",pluginUnavailableSettings:"The plugin required for this homepage type isn't available.",copyDebugInfoNotice:"Copied homepage debug information to clipboard"};var Ke={["Replace all open notes"]:"\u0417\u0430\u043C\u0435\u043D\u0438\u0442\u044C \u0432\u0441\u0435 \u043E\u0442\u043A\u0440\u044B\u0442\u044B\u0435 \u0437\u0430\u043C\u0435\u0442\u043A\u0438",["Replace last note"]:"\u0417\u0430\u043C\u0435\u043D\u0438\u0442\u044C \u043F\u043E\u0441\u043B\u0435\u0434\u043D\u044E\u044E \u0437\u0430\u043C\u0435\u0442\u043A\u0443",["Keep open notes"]:"\u041E\u0441\u0442\u0430\u0432\u0438\u0442\u044C \u043E\u0442\u043A\u0440\u044B\u0442\u044B\u0435 \u0437\u0430\u043C\u0435\u0442\u043A\u0438",["Default view"]:"\u041F\u043E \u0443\u043C\u043E\u043B\u0447\u0430\u043D\u0438\u044E",["Reading view"]:"\u041F\u0440\u043E\u0441\u043C\u043E\u0442\u0440",["Editing view (Source)"]:"\u041F\u0440\u043E\u0441\u043C\u043E\u0442\u0440 \u0438\u0441\u0445\u043E\u0434\u043D\u043E\u0433\u043E \u043A\u043E\u0434\u0430",["Editing view (Live Preview)"]:"\u0414\u0438\u043D\u0430\u043C\u0438\u0447\u0435\u0441\u043A\u0438\u0439 \u043F\u0440\u043E\u0441\u043C\u043E\u0442\u0440",["File"]:"\u0424\u0430\u0439\u043B",["Workspace"]:"\u0420\u0430\u0431\u043E\u0447\u0435\u0435 \u043F\u0440\u043E\u0441\u0442\u0440\u0430\u043D\u0441\u0442\u0432\u043E",["Random file"]:"\u0421\u043B\u0443\u0447\u0430\u0439\u043D\u044B\u0439 \u0444\u0430\u0439\u043B",["Random in folder"]:"\u0421\u043B\u0443\u0447\u0430\u0439\u043D\u044B\u0439 \u0444\u0430\u0439\u043B \u0438\u0437 \u043F\u0430\u043F\u043A\u0438",["New note"]:"\u041D\u043E\u0432\u0430\u044F \u0437\u0430\u043C\u0435\u0442\u043A\u0430",["Graph view"]:"\u0413\u0440\u0430\u0444",["Nothing"]:"\u041D\u0438\u0447\u0435\u0433\u043E",["Journal"]:"\u0416\u0443\u0440\u043D\u0430\u043B",["Daily Note"]:"\u0415\u0436\u0435\u0434\u043D\u0435\u0432\u043D\u0430\u044F \u0437\u0430\u043C\u0435\u0442\u043A\u0430",["Weekly Note"]:"\u0415\u0436\u0435\u043D\u0435\u0434\u0435\u043B\u044C\u043D\u0430\u044F \u0437\u0430\u043C\u0435\u0442\u043A\u0430",["Monthly Note"]:"\u0415\u0436\u0435\u043C\u0435\u0441\u044F\u0447\u043D\u0430\u044F \u0437\u0430\u043C\u0435\u0442\u043A\u0430",["Yearly Note"]:"\u0415\u0436\u0435\u0433\u043E\u0434\u043D\u0430\u044F \u0437\u0430\u043C\u0435\u0442\u043A\u0430",["Both"]:"\u041E\u0431\u0430 \u0432\u0430\u0440\u0438\u0430\u043D\u0442\u0430",["Startup only"]:"\u0422\u043E\u043B\u044C\u043A\u043E \u043F\u0440\u0438 \u0437\u0430\u043F\u0443\u0441\u043A\u0435",["Manual only"]:"\u0422\u043E\u043B\u044C\u043A\u043E \u0432\u0440\u0443\u0447\u043D\u0443\u044E",openHomepage:"\u041E\u0442\u043A\u0440\u044B\u0442\u044C \u0434\u043E\u043C\u0430\u0448\u043D\u044E\u044E \u0441\u0442\u0440\u0430\u043D\u0438\u0446\u0443",setToActiveFile:"\u0418\u0441\u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u0442\u044C \u0430\u043A\u0442\u0438\u0432\u043D\u044B\u0439 \u0444\u0430\u0439\u043B",copyDebugInfo:"\u0421\u043A\u043E\u043F\u0438\u0440\u043E\u0432\u0430\u0442\u044C \u043E\u0442\u043B\u0430\u0434\u043E\u0447\u043D\u0443\u044E \u0438\u043D\u0444\u043E\u0440\u043C\u0430\u0446\u0438\u044E",pluginUnavailable:"\u041D\u0435\u0432\u043E\u0437\u043C\u043E\u0436\u043D\u043E \u043E\u0442\u043A\u0440\u044B\u0442\u044C \u0434\u043E\u043C\u0430\u0448\u043D\u044E\u044E \u0441\u0442\u0440\u0430\u043D\u0438\u0446\u0443: \u043F\u043B\u0430\u0433\u0438\u043D \u043D\u0435\u0434\u043E\u0441\u0442\u0443\u043F\u0435\u043D.",journalUnavailable:'\u0416\u0443\u0440\u043D\u0430\u043B "?0" \u043D\u0435 \u043D\u0430\u0439\u0434\u0435\u043D.',workspaceUnavailable:'\u0420\u0430\u0431\u043E\u0447\u0435\u0435 \u043F\u0440\u043E\u0441\u0442\u0440\u0430\u043D\u0441\u0442\u0432\u043E "?0" \u043D\u0435 \u043D\u0430\u0439\u0434\u0435\u043D\u043E.',noteUnavailable:'\u0424\u0430\u0439\u043B "?0" \u043D\u0435 \u043D\u0430\u0439\u0434\u0435\u043D.',homepageChanged:'\u0414\u043E\u043C\u0430\u0448\u043D\u044F\u044F \u0441\u0442\u0440\u0430\u043D\u0438\u0446\u0430 \u0438\u0437\u043C\u0435\u043D\u0435\u043D\u0430 \u043D\u0430 "?0".',momentUpgradeNotice:"\u0417\u0430\u043C\u0435\u0442\u043A\u0438, \u0437\u0430\u0432\u0438\u0441\u044F\u0449\u0438\u0435 \u043E\u0442 \u0434\u0430\u0442\u044B, \u0443\u0434\u0430\u043B\u0435\u043D\u044B \u0438\u0437 Homepage. \u0418\u0441\u043F\u043E\u043B\u044C\u0437\u0443\u0439\u0442\u0435 \u043F\u0435\u0440\u0438\u043E\u0434\u0438\u0447\u0435\u0441\u043A\u0443\u044E \u0438\u043B\u0438 \u0435\u0436\u0435\u0434\u043D\u0435\u0432\u043D\u0443\u044E \u0437\u0430\u043C\u0435\u0442\u043A\u0443.",openOnStartup:"\u041E\u0442\u043A\u0440\u044B\u0432\u0430\u0442\u044C \u043F\u0440\u0438 \u0437\u0430\u043F\u0443\u0441\u043A\u0435",openOnStartupDesc:"\u041E\u0442\u043A\u0440\u044B\u0432\u0430\u0442\u044C \u0434\u043E\u043C\u0430\u0448\u043D\u044E\u044E \u0441\u0442\u0440\u0430\u043D\u0438\u0446\u0443 \u043F\u0440\u0438 \u0437\u0430\u043F\u0443\u0441\u043A\u0435 Obsidian.",openOnStartupWarn:"\u042D\u0442\u043E \u043F\u0435\u0440\u0435\u043E\u043F\u0440\u0435\u0434\u0435\u043B\u044F\u0435\u0442 \u043D\u0430\u0441\u0442\u0440\u043E\u0439\u043A\u0443 \u0444\u0430\u0439\u043B\u0430 \u043F\u043E \u0443\u043C\u043E\u043B\u0447\u0430\u043D\u0438\u044E.",openWhenEmpty:"\u041E\u0442\u043A\u0440\u044B\u0432\u0430\u0442\u044C \u043F\u0440\u0438 \u043E\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0438\u0438 \u0432\u043A\u043B\u0430\u0434\u043E\u043A",openWhenEmptyDesc:"\u041E\u0442\u043A\u0440\u044B\u0432\u0430\u0442\u044C \u0434\u043E\u043C\u0430\u0448\u043D\u044E\u044E \u0441\u0442\u0440\u0430\u043D\u0438\u0446\u0443, \u0435\u0441\u043B\u0438 \u043D\u0435\u0442 \u043E\u0442\u043A\u0440\u044B\u0442\u044B\u0445 \u0432\u043A\u043B\u0430\u0434\u043E\u043A.",alwaysApply:"\u041F\u0440\u0438\u043C\u0435\u043D\u044F\u0442\u044C \u043F\u0440\u0438 \u043E\u0431\u044B\u0447\u043D\u043E\u043C \u043E\u0442\u043A\u0440\u044B\u0442\u0438\u0438",alwaysApplyDesc:"\u041F\u0440\u0438\u043C\u0435\u043D\u044F\u0442\u044C \u043D\u0430\u0441\u0442\u0440\u043E\u0439\u043A\u0438 \u0434\u043E\u043C\u0430\u0448\u043D\u0435\u0439 \u0441\u0442\u0440\u0430\u043D\u0438\u0446\u044B \u043F\u0440\u0438 \u043E\u0442\u043A\u0440\u044B\u0442\u0438\u0438 \u0438\u0437 \u0441\u0441\u044B\u043B\u043E\u043A \u0438\u043B\u0438 \u0444\u0430\u0439\u043B\u043E\u0432\u043E\u0433\u043E \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0430.",separateMobile:"\u041E\u0442\u0434\u0435\u043B\u044C\u043D\u0430\u044F \u0434\u043E\u043C\u0430\u0448\u043D\u044F\u044F \u0441\u0442\u0440\u0430\u043D\u0438\u0446\u0430 \u0434\u043B\u044F \u043C\u043E\u0431\u0438\u043B\u044C\u043D\u044B\u0445 \u0443\u0441\u0442\u0440\u043E\u0439\u0441\u0442\u0432",separateMobileDesc:"\u0425\u0440\u0430\u043D\u0438\u0442\u044C \u0434\u043E\u043C\u0430\u0448\u043D\u044E\u044E \u0441\u0442\u0440\u0430\u043D\u0438\u0446\u0443 \u0434\u043B\u044F \u043C\u043E\u0431\u0438\u043B\u044C\u043D\u044B\u0445 \u0443\u0441\u0442\u0440\u043E\u0439\u0441\u0442\u0432 \u0438 \u0435\u0451 \u043D\u0430\u0441\u0442\u0440\u043E\u0439\u043A\u0438 \u043E\u0442\u0434\u0435\u043B\u044C\u043D\u043E.",separateMobileWarnMobile:"\u041C\u043E\u0431\u0438\u043B\u044C\u043D\u044B\u0435 \u043D\u0430\u0441\u0442\u0440\u043E\u0439\u043A\u0438 \u0445\u0440\u0430\u043D\u044F\u0442\u0441\u044F \u043E\u0442\u0434\u0435\u043B\u044C\u043D\u043E. \u0418\u0437\u043C\u0435\u043D\u0435\u043D\u0438\u044F \u043D\u0435 \u043F\u043E\u0432\u043B\u0438\u044F\u044E\u0442 \u043D\u0430 \u043D\u0430\u0441\u0442\u043E\u043B\u044C\u043D\u044B\u0435 \u0443\u0441\u0442\u0440\u043E\u0439\u0441\u0442\u0432\u0430. \u0418\u0441\u043F\u043E\u043B\u044C\u0437\u0443\u0439\u0442\u0435 \u043D\u0430\u0441\u0442\u043E\u043B\u044C\u043D\u043E\u0435 \u0443\u0441\u0442\u0440\u043E\u0439\u0441\u0442\u0432\u043E \u0434\u043B\u044F \u0440\u0435\u0434\u0430\u043A\u0442\u0438\u0440\u043E\u0432\u0430\u043D\u0438\u044F.",separateMobileWarnDesktop:"\u041C\u043E\u0431\u0438\u043B\u044C\u043D\u044B\u0435 \u043D\u0430\u0441\u0442\u0440\u043E\u0439\u043A\u0438 \u0445\u0440\u0430\u043D\u044F\u0442\u0441\u044F \u043E\u0442\u0434\u0435\u043B\u044C\u043D\u043E. \u0418\u0437\u043C\u0435\u043D\u0435\u043D\u0438\u044F \u043D\u0435 \u043F\u043E\u0432\u043B\u0438\u044F\u044E\u0442 \u043D\u0430 \u043C\u043E\u0431\u0438\u043B\u044C\u043D\u044B\u0435 \u0443\u0441\u0442\u0440\u043E\u0439\u0441\u0442\u0432\u0430. \u0418\u0441\u043F\u043E\u043B\u044C\u0437\u0443\u0439\u0442\u0435 \u043C\u043E\u0431\u0438\u043B\u044C\u043D\u043E\u0435 \u0443\u0441\u0442\u0440\u043E\u0439\u0441\u0442\u0432\u043E \u0434\u043B\u044F \u0440\u0435\u0434\u0430\u043A\u0442\u0438\u0440\u043E\u0432\u0430\u043D\u0438\u044F.",commandsGroup:"\u041A\u043E\u043C\u0430\u043D\u0434\u044B",commandsDesc:"\u041A\u043E\u043C\u0430\u043D\u0434\u044B, \u0432\u044B\u043F\u043E\u043B\u043D\u044F\u0435\u043C\u044B\u0435 \u043F\u0440\u0438 \u043E\u0442\u043A\u0440\u044B\u0442\u0438\u0438 \u0434\u043E\u043C\u0430\u0448\u043D\u0435\u0439 \u0441\u0442\u0440\u0430\u043D\u0438\u0446\u044B.",commandsAddButton:"\u0414\u043E\u0431\u0430\u0432\u0438\u0442\u044C...",commandUnavailable:"\u041A\u043E\u043C\u0430\u043D\u0434\u0430 \u043D\u0435 \u043D\u0430\u0439\u0434\u0435\u043D\u0430 \u0438 \u043D\u0435 \u0431\u0443\u0434\u0435\u0442 \u0432\u044B\u043F\u043E\u043B\u043D\u0435\u043D\u0430. \u0412\u043E\u0437\u043C\u043E\u0436\u043D\u043E, \u0441\u043E\u043E\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044E\u0449\u0438\u0439 \u043F\u043B\u0430\u0433\u0438\u043D \u043E\u0442\u043A\u043B\u044E\u0447\u0435\u043D.",commandsReally:"\u0412\u044B \u0443\u0432\u0435\u0440\u0435\u043D\u044B?",vaultGroup:"\u0421\u0440\u0435\u0434\u0430 \u0445\u0440\u0430\u043D\u0438\u043B\u0438\u0449\u0430",openMode:"\u0421\u043F\u043E\u0441\u043E\u0431 \u043E\u0442\u043A\u0440\u044B\u0442\u0438\u044F",openModeDesc:"\u041E\u043F\u0440\u0435\u0434\u0435\u043B\u044F\u0435\u0442, \u043A\u0430\u043A \u043E\u0431\u0440\u0430\u0431\u0430\u0442\u044B\u0432\u0430\u044E\u0442\u0441\u044F \u043E\u0442\u043A\u0440\u044B\u0442\u044B\u0435 \u0432\u043A\u043B\u0430\u0434\u043A\u0438 \u043F\u0440\u0438 \u0437\u0430\u043F\u0443\u0441\u043A\u0435.",manualOpenMode:"\u0421\u043F\u043E\u0441\u043E\u0431 \u043E\u0442\u043A\u0440\u044B\u0442\u0438\u044F \u0432\u0440\u0443\u0447\u043D\u0443\u044E",manualOpenModeDesc:"\u041E\u043F\u0440\u0435\u0434\u0435\u043B\u044F\u0435\u0442, \u043A\u0430\u043A \u043E\u0431\u0440\u0430\u0431\u0430\u0442\u044B\u0432\u0430\u044E\u0442\u0441\u044F \u043E\u0442\u043A\u0440\u044B\u0442\u044B\u0435 \u0432\u043A\u043B\u0430\u0434\u043A\u0438 \u043F\u0440\u0438 \u043E\u0442\u043A\u0440\u044B\u0442\u0438\u0438 \u0447\u0435\u0440\u0435\u0437 \u043A\u043E\u043C\u0430\u043D\u0434\u044B \u0438\u043B\u0438 \u043A\u043D\u043E\u043F\u043A\u0443.",pin:"\u0417\u0430\u043A\u0440\u0435\u043F\u0438\u0442\u044C",pinDesc:"\u0417\u0430\u043A\u0440\u0435\u043F\u0438\u0442\u044C \u0434\u043E\u043C\u0430\u0448\u043D\u044E\u044E \u0441\u0442\u0440\u0430\u043D\u0438\u0446\u0443 \u043F\u0440\u0438 \u043E\u0442\u043A\u0440\u044B\u0442\u0438\u0438.",hideReleaseNotes:"\u0421\u043A\u0440\u044B\u0432\u0430\u0442\u044C \u043F\u0440\u0438\u043C\u0435\u0447\u0430\u043D\u0438\u044F \u043A \u0432\u044B\u043F\u0443\u0441\u043A\u0443",hideReleaseNotesDesc:"\u041D\u0435 \u043F\u043E\u043A\u0430\u0437\u044B\u0432\u0430\u0442\u044C \u043F\u0440\u0438\u043C\u0435\u0447\u0430\u043D\u0438\u044F \u043A \u0432\u044B\u043F\u0443\u0441\u043A\u0443 \u043F\u0440\u0438 \u043E\u0431\u043D\u043E\u0432\u043B\u0435\u043D\u0438\u0438 Obsidian.",autoCreate:"\u0410\u0432\u0442\u043E\u043C\u0430\u0442\u0438\u0447\u0435\u0441\u043A\u043E\u0435 \u0441\u043E\u0437\u0434\u0430\u043D\u0438\u0435",autoCreateDesc:"\u0415\u0441\u043B\u0438 \u0434\u043E\u043C\u0430\u0448\u043D\u0435\u0439 \u0441\u0442\u0440\u0430\u043D\u0438\u0446\u044B \u043D\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442, \u0441\u043E\u0437\u0434\u0430\u0435\u0442 \u0435\u0451.",autoCreateWarn:"\u041F\u0440\u0438 \u0441\u0438\u043D\u0445\u0440\u043E\u043D\u0438\u0437\u0430\u0446\u0438\u0438 \u0447\u0435\u0440\u0435\u0437 \u043D\u0435\u043E\u0444\u0438\u0446\u0438\u0430\u043B\u044C\u043D\u044B\u0435 \u0441\u0435\u0440\u0432\u0438\u0441\u044B \u0432\u043E\u0437\u043C\u043E\u0436\u043D\u0430 \u043F\u0435\u0440\u0435\u0437\u0430\u043F\u0438\u0441\u044C \u0434\u0430\u043D\u043D\u044B\u0445.",openingGroup:"\u0420\u0435\u0436\u0438\u043C \u043F\u0440\u0438 \u043E\u0442\u043A\u0440\u044B\u0442\u0438\u0438",view:"\u0420\u0435\u0436\u0438\u043C \u0434\u043E\u043C\u0430\u0448\u043D\u0435\u0439 \u0441\u0442\u0440\u0430\u043D\u0438\u0446\u044B",viewDesc:"\u0412\u044B\u0431\u0435\u0440\u0438\u0442\u0435 \u0440\u0435\u0436\u0438\u043C \u043E\u0442\u043A\u0440\u044B\u0442\u0438\u044F \u0434\u043E\u043C\u0430\u0448\u043D\u0435\u0439 \u0441\u0442\u0440\u0430\u043D\u0438\u0446\u044B.",revertView:"\u0412\u043E\u0437\u0432\u0440\u0430\u0449\u0430\u0442\u044C \u0440\u0435\u0436\u0438\u043C \u043F\u0440\u0438 \u0437\u0430\u043A\u0440\u044B\u0442\u0438\u0438",revertViewDesc:"\u0412\u043E\u0441\u0441\u0442\u0430\u043D\u0430\u0432\u043B\u0438\u0432\u0430\u0442\u044C \u0440\u0435\u0436\u0438\u043C \u043F\u043E \u0443\u043C\u043E\u043B\u0447\u0430\u043D\u0438\u044E \u043F\u0440\u0438 \u0443\u0445\u043E\u0434\u0435 \u0441 \u0434\u043E\u043C\u0430\u0448\u043D\u0435\u0439 \u0441\u0442\u0440\u0430\u043D\u0438\u0446\u044B.",autoScroll:"\u0410\u0432\u0442\u043E-scroll",autoScrollDesc:"\u041F\u0440\u043E\u043A\u0440\u0443\u0447\u0438\u0432\u0430\u0442\u044C \u0432\u043D\u0438\u0437 \u0438 \u0444\u043E\u043A\u0443\u0441\u0438\u0440\u043E\u0432\u0430\u0442\u044C\u0441\u044F \u043D\u0430 \u043F\u043E\u0441\u043B\u0435\u0434\u043D\u0435\u0439 \u0441\u0442\u0440\u043E\u043A\u0435 \u043F\u0440\u0438 \u043E\u0442\u043A\u0440\u044B\u0442\u0438\u0438.",refreshDataview:"\u041E\u0431\u043D\u043E\u0432\u043B\u044F\u0442\u044C Dataview",refreshDataviewDesc:"\u041F\u0435\u0440\u0435\u0437\u0430\u0433\u0440\u0443\u0436\u0430\u0442\u044C \u043F\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043B\u0435\u043D\u0438\u044F Dataview \u043F\u0440\u0438 \u043E\u0442\u043A\u0440\u044B\u0442\u0438\u0438 \u0434\u043E\u043C\u0430\u0448\u043D\u0435\u0439 \u0441\u0442\u0440\u0430\u043D\u0438\u0446\u044B.",refreshDataviewWarn:"\u0422\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044F \u0432\u043A\u043B\u044E\u0447\u0435\u043D\u043D\u043E\u0435 \u0430\u0432\u0442\u043E\u043E\u0431\u043D\u043E\u0432\u043B\u0435\u043D\u0438\u0435 Dataview.",FileDesc:"\u0423\u043A\u0430\u0436\u0438\u0442\u0435 \u0437\u0430\u043C\u0435\u0442\u043A\u0443, \u0431\u0430\u0437\u0443 \u0438\u043B\u0438 canvas.",WorkspaceDesc:"\u0423\u043A\u0430\u0436\u0438\u0442\u0435 \u0440\u0430\u0431\u043E\u0447\u0435\u0435 \u043F\u0440\u043E\u0441\u0442\u0440\u0430\u043D\u0441\u0442\u0432\u043E Obsidian.","New noteDesc":"\u0423\u043A\u0430\u0436\u0438\u0442\u0435 \u043F\u0440\u0435\u0444\u0438\u043A\u0441. \u041F\u0440\u0438 \u043A\u0430\u0436\u0434\u043E\u043C \u0437\u0430\u043F\u0443\u0441\u043A\u0435 Obsidian \u0431\u0443\u0434\u0435\u0442 \u0441\u043E\u0437\u0434\u0430\u0432\u0430\u0442\u044C\u0441\u044F \u043D\u043E\u0432\u0430\u044F \u0437\u0430\u043C\u0435\u0442\u043A\u0430 \u0441 \u044D\u0442\u0438\u043C \u043F\u0440\u0435\u0444\u0438\u043A\u0441\u043E\u043C.","Graph viewDesc":"\u0411\u0443\u0434\u0435\u0442 \u0438\u0441\u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u043D \u0433\u0440\u0430\u0444.",NothingDesc:"\u041F\u043E \u0443\u043C\u043E\u043B\u0447\u0430\u043D\u0438\u044E \u043D\u0438\u0447\u0435\u0433\u043E \u043D\u0435 \u043F\u0440\u043E\u0438\u0437\u043E\u0439\u0434\u0435\u0442. \u0414\u043E\u0431\u0430\u0432\u043B\u0435\u043D\u043D\u044B\u0435 \u043A\u043E\u043C\u0430\u043D\u0434\u044B \u0431\u0443\u0434\u0443\u0442 \u0432\u044B\u043F\u043E\u043B\u043D\u0435\u043D\u044B.","Random fileDesc":"\u0411\u0443\u0434\u0435\u0442 \u0432\u044B\u0431\u0440\u0430\u043D \u0441\u043B\u0443\u0447\u0430\u0439\u043D\u044B\u0439 \u0444\u0430\u0439\u043B \u0438\u0437 \u0445\u0440\u0430\u043D\u0438\u043B\u0438\u0449\u0430 Obsidian.","Random in folderDesc":"\u0423\u043A\u0430\u0436\u0438\u0442\u0435 \u043F\u0430\u043F\u043A\u0443. \u0411\u0443\u0434\u0435\u0442 \u0432\u044B\u0431\u0440\u0430\u043D \u0441\u043B\u0443\u0447\u0430\u0439\u043D\u044B\u0439 \u0444\u0430\u0439\u043B \u0438\u0437 \u043D\u0435\u0451.",JournalDesc:"\u0423\u043A\u0430\u0436\u0438\u0442\u0435 \u0436\u0443\u0440\u043D\u0430\u043B.","Daily noteDesc":"\u0411\u0443\u0434\u0435\u0442 \u0438\u0441\u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u043D\u0430 \u0435\u0436\u0435\u0434\u043D\u0435\u0432\u043D\u0430\u044F \u0437\u0430\u043C\u0435\u0442\u043A\u0430.","Weekly noteDesc":"\u0411\u0443\u0434\u0435\u0442 \u0438\u0441\u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u043D\u0430 \u0435\u0436\u0435\u043D\u0435\u0434\u0435\u043B\u044C\u043D\u0430\u044F \u0437\u0430\u043C\u0435\u0442\u043A\u0430.","Monthly noteDesc":"\u0411\u0443\u0434\u0435\u0442 \u0438\u0441\u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u043D\u0430 \u0435\u0436\u0435\u043C\u0435\u0441\u044F\u0447\u043D\u0430\u044F \u0437\u0430\u043C\u0435\u0442\u043A\u0430.","Yearly noteDesc":"\u0411\u0443\u0434\u0435\u0442 \u0438\u0441\u043F\u043E\u043B\u044C\u0437\u043E\u0432\u0430\u043D\u0430 \u0435\u0436\u0435\u0433\u043E\u0434\u043D\u0430\u044F \u0437\u0430\u043C\u0435\u0442\u043A\u0430.",homepageSettingTitle:"Homepage",pluginUnavailableSettings:"\u041D\u0435\u043E\u0431\u0445\u043E\u0434\u0438\u043C\u044B\u0439 \u043F\u043B\u0430\u0433\u0438\u043D \u043D\u0435\u0434\u043E\u0441\u0442\u0443\u043F\u0435\u043D.",copyDebugInfoNotice:"\u041E\u0442\u043B\u0430\u0434\u043E\u0447\u043D\u0430\u044F \u0438\u043D\u0444\u043E\u0440\u043C\u0430\u0446\u0438\u044F \u0434\u043E\u043C\u0430\u0448\u043D\u0435\u0439 \u0441\u0442\u0440\u0430\u043D\u0438\u0446\u044B \u0441\u043A\u043E\u043F\u0438\u0440\u043E\u0432\u0430\u043D\u0430 \u0432 \u0431\u0443\u0444\u0435\u0440 \u043E\u0431\u043C\u0435\u043D\u0430"};var Ft={en:ge,ru:Ke},ze,qe=!1;function r(n,...t){if(!qe){let a=localStorage.getItem("language")?.toLowerCase()?.split("-")[0]||"en";ze=Ft[a],qe=!0}n=ze?.[n]||ge[n];let e=0;for(let a of t)n=n.replace("?"+e,a),e++;return n}var D=require("obsidian");var h=require("obsidian");var $=class extends h.AbstractInputSuggest{getSuggestions(e){let a=this.app.vault.getAllLoadedFiles(),i=[],o=e.toLowerCase();return a.forEach(s=>{s instanceof h.TFile&&["md","canvas","base"].contains(s.extension)&&s.path.toLowerCase().contains(o)&&i.push(s)}),i}renderSuggestion(e,a){e.extension=="md"?a.setText(T(e)):(a.setText(e.path.split(".").slice(0,-1).join(".")),a.insertAdjacentHTML("beforeend",``))}selectSuggestion(e){this.textInputEl.value=T(e),this.textInputEl.trigger("input"),this.close()}},me=class extends h.AbstractInputSuggest{getSuggestions(e){let a=e.toLowerCase();return this.app.vault.getAllFolders().filter(i=>i.path.toLowerCase().contains(a))}renderSuggestion(e,a){a.setText(e.path)}selectSuggestion(e){this.textInputEl.value=e.path,this.textInputEl.trigger("input"),this.close()}},he=class extends h.AbstractInputSuggest{getSuggestions(e){let a=Object.keys(this.app.internalPlugins.plugins.workspaces?.instance.workspaces),i=e.toLowerCase();return a.filter(o=>o.toLowerCase().contains(i))}renderSuggestion(e,a){a.setText(e)}selectSuggestion(e){this.textInputEl.value=e,this.textInputEl.trigger("input"),this.close()}},fe=class extends h.AbstractInputSuggest{getSuggestions(e){let a=this.app.plugins.plugins.journals.journals.map(o=>o.name),i=e.toLowerCase();return a.filter(o=>o.toLowerCase().contains(i))}renderSuggestion(e,a){a.setText(e)}selectSuggestion(e){this.textInputEl.value=e,this.textInputEl.trigger("input"),this.close()}},Je={["File"]:$,["Workspace"]:he,["Random in folder"]:me,["New note"]:$,["Journal"]:fe},Q=class{constructor(t,e){this.app=t.plugin.app,this.homepage=t.plugin.homepage,this.tab=t,e.addSetting(a=>{a.settingEl.addClass("nv-command-setting"),a.descEl.addClass("nv-command-desc"),a.descEl.innerText=r("commandsDesc"),this.container=a.settingEl.createDiv({cls:"nv-command-box"})}),this.dropzone=document.createElement("div"),this.dropzone.className="nv-command-pill nv-dropzone",this.dropzone.addEventListener("dragenter",a=>a.preventDefault()),this.dropzone.addEventListener("dragover",a=>a.preventDefault()),this.dropzone.addEventListener("drop",()=>this.terminateDrag()),this.update()}update(){this.container.innerHTML="",this.activeDrag=null,this.activeCommand=null;for(let t of this.homepage.data.commands){let e=this.app.commands.findCommand(t.id),a=this.container.createDiv({cls:"nv-command-pill",attr:{draggable:!0}});a.addEventListener("dragstart",o=>{o.dataTransfer.effectAllowed="move",this.activeCommand=this.homepage.data.commands.splice(this.indexOf(a),1)[0],this.activeDrag=a,this.dropzone.style.width=`${a.clientWidth}px`,this.dropzone.style.height=`${a.clientHeight}px`}),a.addEventListener("dragover",o=>this.moveDropzone(a,o)),a.addEventListener("drop",o=>o.preventDefault()),a.addEventListener("dragend",()=>this.terminateDrag()),a.createSpan({cls:"nv-command-text",text:e?.name??t.id});let i=new h.ButtonComponent(a).setIcon("route").setClass("clickable-icon").setClass("nv-command-period").onClick(o=>this.showMenu(t,o,i));t.period!="Both"&&(i.setClass("nv-command-selected"),i.setIcon(""),i.buttonEl.createSpan({text:r(t.period)})),new h.ButtonComponent(a).setIcon("trash-2").setClass("clickable-icon").setClass("nv-command-delete").onClick(()=>this.delete(t)),e||(a.classList.add("nv-command-invalid"),a.prepend((0,h.getIcon)("ban")),(0,h.setTooltip)(a,r("commandUnavailable"),{delay:.001}))}new h.ButtonComponent(this.container).setClass("nv-command-add-button").setButtonText(r("commandsAddButton")).onClick(()=>{new we(this.tab).open()})}delete(t){this.homepage.data.commands.remove(t),this.homepage.save(),this.update()}showMenu(t,e,a){let i=new h.Menu;for(let s of Object.values(R))i.addItem(c=>{c.setTitle(r(s)),c.setChecked(t.period==s),c.onClick(()=>{t.period=s,this.homepage.save(),this.update()})});let o=a.buttonEl.getBoundingClientRect();i.showAtPosition({x:o.x-22,y:o.y+o.height+8})}indexOf(t){return Array.from(this.container.children).indexOf(t)}moveDropzone(t,e){if(!this.activeDrag)return;this.activeDrag.hidden=!0;let a=t.getBoundingClientRect();e.xawait this.copyDebugInfo()})}sanitiseNote(e){return e===null||e.match(/^\s*$/)!==null?null:(0,D.normalizePath)(e)}display(){let e=this.plugin.homepage.data.kind,a=!1,i=Je[e];this.containerEl.empty();let o=new A(this).addSetting(p=>{p.setName(r("homepageSettingTitle")).addDropdown(async u=>{for(let d of Object.values(F)){if(!this.plugin.hasRequiredPlugin(d))if(d==this.plugin.homepage.data.kind)a=!0;else{u.selectEl.createEl("option",{text:r(d),attr:{disabled:!0}});continue}u.addOption(d,r(d))}u.setValue(this.plugin.homepage.data.kind),u.onChange(async d=>{this.plugin.homepage.data.kind=d,d=="Random file"&&(this.plugin.homepage.data.value=""),await this.plugin.homepage.save(),this.display()})}),p.settingEl.id="nv-main-setting";let v=p.settingEl.createEl("article",{text:r(e+"Desc"),attr:{id:"nv-desc"}});a&&v.createDiv({text:r("pluginUnavailableSettings"),cls:"mod-warning"}),ve.includes(e)?p.addText(u=>{u.setDisabled(!0)}):p.addText(u=>{new i(this.app,u.inputEl),u.setPlaceholder(x.value),u.setValue(x.value==this.plugin.homepage.data.value?"":this.plugin.homepage.data.value),u.onChange(async d=>{this.plugin.homepage.data.value=this.sanitiseNote(d)||x.value,await this.plugin.homepage.save()})})}),s=new A(this).addToggle("openOnStartup",p=>this.display()).addToggle("openWhenEmpty").addToggle("alwaysApply").addSetting(p=>{if(p.setName(r("separateMobile")).setDesc(r("separateMobileDesc")).addToggle(v=>v.setValue(this.plugin.settings.separateMobile).onChange(async u=>{this.plugin.settings.separateMobile=u,this.plugin.homepage=this.plugin.getHomepage(),await this.plugin.saveSettings(),this.display()})),this.plugin.settings.separateMobile){let v=document.createElement("div");p.setClass("nv-mobile-setting"),v.className="mod-warning nv-mobile-info",v.innerHTML=r(D.Platform.isMobile?"separateMobileWarnMobile":"separateMobileWarnDesktop"),p.settingEl.append(v)}});s.elements.openOnStartup.descEl.createDiv({text:r("openOnStartupWarn"),attr:{class:"mod-warning"}}),this.commandBox=new Q(this,new A(this,"commandsGroup"));let c=new A(this,"vaultGroup").addDropdown("openMode",C).addDropdown("manualOpenMode",C).addToggle("pin").addToggle("hideReleaseNotes").addToggle("autoCreate");c.elements.autoCreate.descEl.createDiv({text:r("autoCreateWarn"),cls:"mod-warning"});let w=new A(this,"openingGroup").addDropdown("view",B).addToggle("revertView").addToggle("autoScroll");"dataview"in this.plugin.communityPlugins&&(w.addToggle("refreshDataview"),w.elements.refreshDataview.descEl.createDiv({text:r("refreshDataviewWarn"),attr:{class:"mod-warning"}})),D.Platform.isMobile||new D.ButtonComponent(this.containerEl).setButtonText(r("copyDebugInfo")).setClass("nv-debug-button").onClick(async()=>await this.copyDebugInfo()),["Workspace","Nothing"].includes(e)&&(s.disableSettings("openWhenEmpty","alwaysApply"),c.disableSettings("openMode","manualOpenMode","autoCreate","pin")),["Workspace","Nothing","Graph view"].includes(e)&&w.disableAll(),this.plugin.homepage.data.openOnStartup||c.disableSettings("openMode"),(J.includes(e)||e==="Journal")&&c.disableSettings("autoCreate")}async copyDebugInfo(){let e=this.app.vault.config,a={...this.settings,_defaultViewMode:e.defaultViewMode||"default",_livePreview:e.livePreview!==void 0?e.livePreview:"default",_focusNewTab:e.focusNewTab!==void 0?e.focusNewTab:"default",_plugins:Object.keys(this.plugin.communityPlugins),_internalPlugins:Object.values(this.plugin.internalPlugins).flatMap(i=>i.enabled?[i.instance.id]:[]),_obsidianVersion:window.electron?.ipcRenderer.sendSync("version")||"unknown"};await navigator.clipboard.writeText(JSON.stringify(a)),new D.Notice(r("copyDebugInfoNotice"))}},A=class extends D.SettingGroup{constructor(e,a){super(e.containerEl);this.elements={};a&&this.setHeading(r(a)),this.plugin=e.plugin,this.settings=e.settings}addDropdown(e,a,i){return this.addSetting(o=>{o.setName(r(e)).setDesc(r(e+"Desc")).addDropdown(async s=>{for(let c of Object.values(a))s.addOption(c,r(c));s.setValue(this.plugin.homepage.data[e]),s.onChange(async c=>{this.plugin.homepage.data[e]=c,await this.plugin.homepage.save(),i&&i(c)})}),this.elements[e]=o}),this}addToggle(e,a){return this.addSetting(i=>{i.setName(r(e)).setDesc(r(e+"Desc")).addToggle(o=>o.setValue(this.plugin.homepage.data[e]).onChange(async s=>{this.plugin.homepage.data[e]=s,await this.plugin.homepage.save(),a&&a(s)})),this.elements[e]=i}),this}disableAll(){this.disableSettings(...Object.keys(this.elements))}disableSettings(...e){e.forEach(a=>{this.elements[a]?.settingEl.setAttribute("nv-greyed","")})}};var At=["markdown","canvas","kanban","bases"],G="Main Homepage",K="Mobile Homepage",C=(a=>(a.ReplaceAll="Replace all open notes",a.ReplaceLast="Replace last note",a.Retain="Keep open notes",a))(C||{}),B=(i=>(i.Default="Default view",i.Reading="Reading view",i.Source="Editing view (Source)",i.LivePreview="Editing view (Live Preview)",i))(B||{}),F=(d=>(d.File="File",d.Workspace="Workspace",d.Random="Random file",d.RandomFolder="Random in folder",d.NewNote="New note",d.Graph="Graph view",d.None="Nothing",d.Journal="Journal",d.DailyNote="Daily Note",d.WeeklyNote="Weekly Note",d.MonthlyNote="Monthly Note",d.YearlyNote="Yearly Note",d))(F||{}),R=(a=>(a.Both="Both",a.Startup="Startup only",a.Manual="Manual only",a))(R||{}),ve=["Random file","Graph view","Nothing",...J],Et=["Nothing","Graph view","Workspace"],j=class{constructor(t,e){this.lastView=void 0;this.openedViews=new WeakMap;this.name=t,this.plugin=e,this.app=e.app;let a=this.plugin.settings.homepages[t];a?this.data=Object.assign({},x,a):(this.plugin.settings.homepages[t]={...x},this.data=this.plugin.settings.homepages[t])}async open(t=!1){if(this.plugin.hasRequiredPlugin(this.data.kind)){if(this.data.kind==="Journal"&&!je(this)){new b.Notice(r("journalUnavailable",this.data.value));return}}else{new b.Notice(r("pluginUnavailable"));return}if(this.data.kind==="Workspace")await this.launchWorkspace();else if(this.data.kind!=="Nothing"){let a=this.plugin.loaded?this.data.manualOpenMode:this.data.openMode;t&&(a="Keep open notes"),await this.launchLeaf(a)}if(this.data.commands.length<1)return;let e=this.plugin.loaded?"Startup only":"Manual only";await Pe(this.app);for(let{id:a,period:i}of this.data.commands)i!==e&&this.app.commands.executeCommandById(a)}async launchWorkspace(){let t=this.plugin.internalPlugins.workspaces?.instance;if(!(this.data.value in t.workspaces)){new b.Notice(r("workspaceUnavailable",this.data.value));return}t.loadWorkspace(this.data.value),await q(100)}async launchLeaf(t){let e;if(this.computedValue=await this.computeValue(),this.plugin.executing=!0,t!=="Replace all open notes"){let a=this.getOpened();if(a.length>0){this.app.workspace.setActiveLeaf(a[0]),await this.configure(a[0]);return}else t=="Keep open notes"&&ke(this.app)&&(t="Replace last note")}t!=="Keep open notes"&&this.app.workspace.getActiveViewOfType(b.View)?.leaf.setPinned(!1),t==="Replace all open notes"&&(this.app.workspace?.floatingSplit?.children&&(await q(0),this.app.workspace.floatingSplit.children.forEach(a=>a.win.close())),await Te(this.app),await q(0)),this.data.kind==="Graph view"?e=await this.launchGraph(t):e=await this.launchNote(t),e&&await this.configure(e)}async launchGraph(t){if(t==="Keep open notes"){let e=this.app.workspace.getLeaf("tab");this.app.workspace.setActiveLeaf(e)}return this.app.commands.executeCommandById("graph:open"),this.app.workspace.getActiveViewOfType(b.View)?.leaf}async launchNote(t){let e=this.app.metadataCache.getFirstLinkpathDest(this.computedValue,"/");if(!e){if(!this.data.autoCreate){new b.Notice(r("noteUnavailable",this.computedValue));return}e=await this.app.vault.create(Ne(this.computedValue),"")}let a=await this.app.vault.cachedRead(e),i=this.app.workspace.getLeaf(t=="Keep open notes");return await i.openFile(e),this.app.workspace.setActiveLeaf(i),a!==await this.app.vault.read(e)&&await this.app.vault.modify(e,a),i}async configure(t){this.plugin.executing=!1;let e=t.view,a=e.leaf.history;if(!(e instanceof b.MarkdownView)){this.data.pin&&e.leaf.setPinned(!0),this.configurePlugins();return}let i=e.getState();if(this.data.revertView&&(this.lastView=new WeakRef(e)),this.data.autoScroll){let o=e.editor.lineCount();i.mode=="preview"?e.previewMode.applyScroll(o-4):(e.editor.setCursor(o),e.editor.focus())}if(this.data.pin&&e.leaf.setPinned(!0),this.data.view!=="Default view"){switch(this.data.view){case"Editing view (Live Preview)":case"Editing view (Source)":i.mode="source",i.source=this.data.view!="Editing view (Live Preview)";break;case"Reading view":i.mode="preview";break}await e.leaf.setViewState({type:"markdown",state:i}),e.leaf.history=a}this.configurePlugins()}configurePlugins(){this.plugin.loaded&&this.data.refreshDataview&&this.plugin.communityPlugins.dataview?.index.touch(),this.plugin.communityPlugins["obsidian-file-color"]?.generateColorStyles()}getOpened(){return this.data.kind=="Graph view"?this.app.workspace.getLeavesOfType("graph"):At.flatMap(e=>this.app.workspace.getLeavesOfType(e)).filter(e=>{let a=e.view.getState().file;return ne(a.endsWith("md")?a.slice(0,-3):a,this.computedValue)})}async computeValue(){let t=this.data.value,e;switch(this.data.kind){case"Random file":e=ae(this.app),e&&(t=e);break;case"Random in folder":e=ae(this.app,t),e&&(t=e);break;case"New note":this.cachedNewFile||(this.cachedNewFile=T(await this.app.fileManager.createNewFile("",t))),t=this.cachedNewFile;break;case"Journal":t=await Ge(t,this.plugin);break;case"Daily Note":case"Weekly Note":case"Monthly Note":case"Yearly Note":t=await Ue(this.data.kind,this.plugin);break}return t}async save(){this.plugin.settings.homepages[this.name]=this.data,await this.plugin.saveSettings()}async setToActiveFile(){this.data.value=T(this.app.workspace.getActiveFile()),await this.save(),new b.Notice(r("homepageChanged",this.data.value))}canSetToFile(){return this.app.workspace.getActiveFile()!==null&&!ve.includes(this.data.kind)}async revertView(){if(this.lastView==null||this.data.view=="Default view")return;let t=this.lastView.deref();if(!t||ne(T(t.file),this.computedValue))return;let e=t.getState(),a=this.app.vault.config,i=a.defaultViewMode||"source",o=a.livePreview!==void 0?!a.livePreview:!1;t.leaf.getViewState().type=="markdown"&&(i!=e.mode||o!=e.source)&&(e.mode=i,e.source=o,await t.leaf.setViewState({type:"markdown",state:e,active:!0})),this.lastView=void 0}async openWhenEmpty(){if(!this.plugin.loaded||this.plugin.executing)return;let t=this.app.workspace.getActiveViewOfType(b.View)?.leaf;t?.getViewState().type!=="empty"||t.parentSplit.children.length!=1||await this.open(!0)}async apply(){let t=this.app.workspace.getActiveViewOfType(b.FileView);if(!t)return;let e=T(t.file);this.openedViews.get(t)!==e&&(this.openedViews.set(t,e),e===await this.computeValue()&&this.plugin.loaded&&!this.plugin.executing&&await this.configure(t.leaf))}async read(){if(Et.includes(this.data.kind))return;let t=this.app.metadataCache.getFirstLinkpathDest(await this.computeValue(),"/");if(t)return this.app.vault.cachedRead(t)}};var Ot='',X=class extends k.Plugin{constructor(){super(...arguments);this.newRelease=!1;this.loaded=!1;this.executing=!1;this.onLayoutChange=async()=>{this.homepage.data.revertView&&await this.homepage.revertView(),this.homepage.data.openWhenEmpty&&await this.homepage.openWhenEmpty(),this.homepage.data.alwaysApply&&await this.homepage.apply()}}async onload(){this.patchReleaseNotes(),this.patchOpeningBehaviour(),this.settings=await this.loadSettings(),this.internalPlugins=this.app.internalPlugins.plugins,this.communityPlugins=this.app.plugins.plugins,this.homepage=this.getHomepage(),(0,k.addIcon)("homepage",Ot),this.addRibbonIcon("homepage","Open homepage",e=>this.homepage.open(e.button==1||e.button==2||k.Keymap.isModifier(e,"Mod"))).setAttribute("id","nv-homepage-icon"),this.registerEvent(this.app.workspace.on("layout-change",this.onLayoutChange)),this.addSettingTab(new Z(this.app,this)),this.addCommand({id:"open-homepage",name:r("openHomepage"),callback:()=>this.homepage.open()}),this.addCommand({id:"set-to-active-file",name:r("setToActiveFile"),checkCallback:e=>{if(e)return this.homepage.canSetToFile();this.homepage.setToActiveFile()}}),this?.registerCliHandler("homepage",r("cliOpenHomepageDesc"),null,async()=>(await this.homepage.open(),r("cliOpenHomepageResult"))),this?.registerCliHandler("homepage:read",r("cliReadHomepageDesc"),null,async()=>{let e=await this.homepage.read();return e!==void 0?e:r("cliReadHomepageIllegible")})}async onunload(){this.app.workspace.off("layout-change",this.onLayoutChange),this.unpatchNewTabPage(),this.unpatchOpeningBehaviour()}getHomepage(){return this.settings.separateMobile&&k.Platform.isMobile?(K in this.settings.homepages||(this.settings.homepages[K]={...this.settings.homepages?.[G]},this.settings.homepages[K].commands=[...this.settings.homepages?.[G]?.commands]),new j(K,this)):new j(G,this)}async loadSettings(){let e=await this.loadData();return e?.version!==4?e?this.upgradeSettings(e):Object.assign({},ye):e}async saveSettings(){await this.saveData(this.settings)}async hasUrlParams(){let e,a;if(k.Platform.isMobile){let i=await window.Capacitor.Plugins.App.getLaunchUrl();if(!i)return!1;let o=new URL(i.url);a=Array.from(o.searchParams.keys()),e=o.hostname}else if(window.OBS_ACT)a=Object.keys(window.OBS_ACT),e=window.OBS_ACT.action;else return!1;return["open","advanced-uri"].includes(e)&&["file","filepath","workspace"].some(i=>a.includes(i))}hasRequiredPlugin(e){switch(e){case"Workspace":return this.internalPlugins.workspaces?.enabled;case"Graph view":return this.internalPlugins.graph?.enabled;case"Journal":return this.communityPlugins.journals;case"Daily Note":case"Weekly Note":case"Monthly Note":case"Yearly Note":return Ye(e,this);default:return!0}}patchNewTabPage(){let e=this.communityPlugins["new-tab-default-page"];e&&(e.nvOrig_checkForNewTab=e.checkForNewTab,e.checkForNewTab=async a=>{if(!(this&&this.executing))return await e.nvOrig_checkForNewTab(a)})}unpatchNewTabPage(){let e=this.communityPlugins["new-tab-default-page"];e&&(e.checkForNewTab=e._checkForNewTab)}patchReleaseNotes(){this.app.nvOrig_showReleaseNotes=this.app.showReleaseNotes,this.app.showReleaseNotes=()=>this.newRelease=!0}unpatchReleaseNotes(){this.newRelease&&!this.homepage.data.hideReleaseNotes&&this.app.nvOrig_showReleaseNotes(),this.app.showReleaseNotes=this.app.nvOrig_showReleaseNotes}patchOpeningBehaviour(){this.app.nvOrig_runOpeningBehavior=this.app.runOpeningBehavior,this.app.runOpeningBehavior=async e=>{let a=this.homepage.data.openOnStartup&&!await this.hasUrlParams();this.patchNewTabPage(),a?await this.homepage.open():this.app.nvOrig_runOpeningBehavior(e),this.loaded=!0,this.unpatchReleaseNotes()}}unpatchOpeningBehaviour(){this.app.runOpeningBehavior=this.app.nvOrig_runOpeningBehavior}upgradeSettings(e){if(e.version==3){let i=e,o=!1;for(let s of Object.values(i.homepages))s.commands=s.commands.map(c=>({id:c,period:"Both"})),s.kind==_e&&(o=!0,s.kind="Daily Note");return o&&new k.Notice(r("momentUpgradeNotice")),i.version=4,this.saveData(i),i}let a=Object.assign({},ye);return e.workspaceEnabled?(e.value=e.workspace,e.kind="Workspace"):e.momentFormat?(e.kind="Daily Note",new k.Notice(r("momentUpgradeNotice"))):(e.value=e.defaultNote,e.kind="File"),e.commands=[],delete e.workspace,delete e.momentFormat,delete e.defaultNote,delete e.useMoment,delete e.workspaceEnabled,a.homepages[G]=e,this.saveData(a),a}}; /* nosourcemap */ \ No newline at end of file diff --git a/.obsidian/plugins/homepage/manifest.json b/.obsidian/plugins/homepage/manifest.json index f8a3777..330a80c 100644 --- a/.obsidian/plugins/homepage/manifest.json +++ b/.obsidian/plugins/homepage/manifest.json @@ -1,7 +1,7 @@ { "id": "homepage", "name": "Homepage", - "version": "4.3.1", + "version": "4.4.0", "minAppVersion": "1.11.0", "description": "Open a specified note, canvas, base, or workspace on startup, or set it for quick access later.", "author": "novov", diff --git a/.obsidian/plugins/obsidian-excalidraw-plugin/main.js b/.obsidian/plugins/obsidian-excalidraw-plugin/main.js index 53b983a..962a028 100644 --- a/.obsidian/plugins/obsidian-excalidraw-plugin/main.js +++ b/.obsidian/plugins/obsidian-excalidraw-plugin/main.js @@ -1,10 +1,10 @@ "use strict";var obsidian_module=require("obsidian"),view=require("@codemirror/view"),commands=require("@codemirror/commands"),lr=require("@lezer/lr"),language=require("@codemirror/language"),state=require("@codemirror/state");;const INITIAL_TIMESTAMP=Date.now();var LZString=function(){var r=String.fromCharCode,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+-$",e={};function t(r,o){if(!e[r]){e[r]={};for(var n=0;n>>8,n[2*e+1]=s%256}return n},decompressFromUint8Array:function(o){if(null==o)return i.decompress(o);for(var n=new Array(o.length/2),e=0,t=n.length;e>=1}else{for(t=1,e=0;e>=1}0==--l&&(l=Math.pow(2,h),h++),delete u[c]}else for(t=s[c],e=0;e>=1;0==--l&&(l=Math.pow(2,h),h++),s[p]=f++,c=String(a)}if(""!==c){if(Object.prototype.hasOwnProperty.call(u,c)){if(c.charCodeAt(0)<256){for(e=0;e>=1}else{for(t=1,e=0;e>=1}0==--l&&(l=Math.pow(2,h),h++),delete u[c]}else for(t=s[c],e=0;e>=1;0==--l&&(l=Math.pow(2,h),h++)}for(t=2,e=0;e>=1;for(;;){if(m<<=1,v==o-1){d.push(n(m));break}v++}return d.join("")},decompress:function(r){return null==r?"":""==r?null:i._decompress(r.length,32768,function(o){return r.charCodeAt(o)})},_decompress:function(o,n,e){var t,i,s,u,a,p,c,l=[],f=4,h=4,d=3,m="",v=[],g={val:e(0),position:n,index:1};for(t=0;t<3;t+=1)l[t]=t;for(s=0,a=Math.pow(2,2),p=1;p!=a;)u=g.val&g.position,g.position>>=1,0==g.position&&(g.position=n,g.val=e(g.index++)),s|=(u>0?1:0)*p,p<<=1;switch(s){case 0:for(s=0,a=Math.pow(2,8),p=1;p!=a;)u=g.val&g.position,g.position>>=1,0==g.position&&(g.position=n,g.val=e(g.index++)),s|=(u>0?1:0)*p,p<<=1;c=r(s);break;case 1:for(s=0,a=Math.pow(2,16),p=1;p!=a;)u=g.val&g.position,g.position>>=1,0==g.position&&(g.position=n,g.val=e(g.index++)),s|=(u>0?1:0)*p,p<<=1;c=r(s);break;case 2:return""}for(l[3]=c,i=c,v.push(c);;){if(g.index>o)return"";for(s=0,a=Math.pow(2,d),p=1;p!=a;)u=g.val&g.position,g.position>>=1,0==g.position&&(g.position=n,g.val=e(g.index++)),s|=(u>0?1:0)*p,p<<=1;switch(c=s){case 0:for(s=0,a=Math.pow(2,8),p=1;p!=a;)u=g.val&g.position,g.position>>=1,0==g.position&&(g.position=n,g.val=e(g.index++)),s|=(u>0?1:0)*p,p<<=1;l[h++]=r(s),c=h-1,f--;break;case 1:for(s=0,a=Math.pow(2,16),p=1;p!=a;)u=g.val&g.position,g.position>>=1,0==g.position&&(g.position=n,g.val=e(g.index++)),s|=(u>0?1:0)*p,p<<=1;l[h++]=r(s),c=h-1,f--;break;case 2:return v.join("")}if(0==f&&(f=Math.pow(2,d),d++),l[c])m=l[c];else{if(c!==h)return null;m=i+i.charAt(0)}v.push(m),l[h++]=i+m.charAt(0),i=m,0==--f&&(f=Math.pow(2,d),d++)}}};return i}();"function"==typeof define&&define.amd?define(function(){return LZString}):"undefined"!=typeof module&&null!=module?module.exports=LZString:"undefined"!=typeof angular&&null!=angular&&angular.module("LZString",[]).factory("LZString",function(){return LZString}); let REACT_PACKAGES = `!function(){var e,t;e=this,t=function(e){function M(e){return null!==e&&"object"==typeof e&&"function"==typeof(e=te&&e[te]||e["@@iterator"])?e:null}function t(e,t,n){this.props=e,this.context=t,this.refs=oe,this.updater=n||ne}function n(){}function r(e,t,n){this.props=e,this.context=t,this.refs=oe,this.updater=n||ne}function o(e,t,n){var r,o={},u=null,a=null;if(null!=t)for(r in void 0!==t.ref&&(a=t.ref),void 0!==t.key&&(u=""+t.key),t)ae.call(t,r)&&!ie.hasOwnProperty(r)&&(o[r]=t[r]);var i=arguments.length-2;if(1===i)o.children=n;else if(1>>1,o=e[r];if(!(0>>1;rt)||e&&!q());){var r,o=R.callback;"function"==typeof o?(R.callback=null,P=R.priorityLevel,r=o(R.expirationTime<=t),t=v(),"function"==typeof r?R.callback=r:R===i(C)&&l(C),y(t)):l(C),R=i(C)}var u,a=null!==R||(null!==(u=i(E))&&_(d,u.startTime-t),!1);return a}finally{R=null,P=n,$=!1}}function q(){return!(v()-de")?l.replace("",n.displayName):l}while(1<=u&&0<=i);break}}}finally{xo=!1,Error.prepareStackTrace=t}return(n=n?n.displayName||n.name:"")?Q(n):""}function $(e){switch(e.tag){case 5:return Q(e.type);case 16:return Q("Lazy");case 13:return Q("Suspense");case 19:return Q("SuspenseList");case 0:case 2:case 15:return e=j(e.type,!1);case 11:return e=j(e.type.render,!1);case 1:return e=j(e.type,!0);default:return""}}function q(e){if(null!=e){if("function"==typeof e)return e.displayName||e.name||null;if("string"==typeof e)return e;switch(e){case co:return"Fragment";case so:return"Portal";case po:return"Profiler";case fo:return"StrictMode";case yo:return"Suspense";case vo:return"SuspenseList"}if("object"==typeof e)switch(e.$$typeof){case ho:return(e.displayName||"Context")+".Consumer";case mo:return(e._context.displayName||"Context")+".Provider";case go:var n=e.render;return e=(e=e.displayName)?e:""!==(e=n.displayName||n.name||"")?"ForwardRef("+e+")":"ForwardRef";case bo:return null!==(n=e.displayName||null)?n:q(e.type)||"Memo";case ko:n=e._payload,e=e._init;try{return q(e(n))}catch(e){}}}return null}function K(e){var n=e.type;switch(e.tag){case 24:return"Cache";case 9:return(n.displayName||"Context")+".Consumer";case 10:return(n._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=(e=n.render).displayName||e.name||"",n.displayName||(""!==e?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return n;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return q(n);case 8:return n===fo?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if("function"==typeof n)return n.displayName||n.name||null;if("string"==typeof n)return n}return null}function Y(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":case"object":return e;default:return""}}function X(e){var n=e.type;return(e=e.nodeName)&&"input"===e.toLowerCase()&&("checkbox"===n||"radio"===n)}function G(e){var n,t,r=X(e)?"checked":"value",l=Object.getOwnPropertyDescriptor(e.constructor.prototype,r),a=""+e[r];if(!e.hasOwnProperty(r)&&void 0!==l&&"function"==typeof l.get&&"function"==typeof l.set)return n=l.get,t=l.set,Object.defineProperty(e,r,{configurable:!0,get:function(){return n.call(this)},set:function(e){a=""+e,t.call(this,e)}}),Object.defineProperty(e,r,{enumerable:l.enumerable}),{getValue:function(){return a},setValue:function(e){a=""+e},stopTracking:function(){e._valueTracker=null,delete e[r]}}}function Z(e){e._valueTracker||(e._valueTracker=G(e))}function J(e){var n,t,r;return!(!e||(n=e._valueTracker)&&(t=n.getValue(),r="",(e=r=e?X(e)?e.checked?"true":"false":e.value:r)===t||(n.setValue(e),0)))}function ee(n){if(void 0===(n=n||("undefined"!=typeof document?document:void 0)))return null;try{return n.activeElement||n.body}catch(e){return n.body}}function ne(e,n){var t=n.checked;return g({},n,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:null!=t?t:e._wrapperState.initialChecked})}function te(e,n){var t=null==n.defaultValue?"":n.defaultValue,r=null!=n.checked?n.checked:n.defaultChecked,t=Y(null!=n.value?n.value:t);e._wrapperState={initialChecked:r,initialValue:t,controlled:"checkbox"===n.type||"radio"===n.type?null!=n.checked:null!=n.value}}function re(e,n){null!=(n=n.checked)&&B(e,"checked",n,!1)}function le(e,n){re(e,n);var t=Y(n.value),r=n.type;if(null!=t)"number"===r?(0===t&&""===e.value||e.value!=t)&&(e.value=""+t):e.value!==""+t&&(e.value=""+t);else if("submit"===r||"reset"===r)return void e.removeAttribute("value");n.hasOwnProperty("value")?oe(e,n.type,t):n.hasOwnProperty("defaultValue")&&oe(e,n.type,Y(n.defaultValue)),null==n.checked&&null!=n.defaultChecked&&(e.defaultChecked=!!n.defaultChecked)}function ae(e,n,t){if(n.hasOwnProperty("value")||n.hasOwnProperty("defaultValue")){var r=n.type;if(("submit"===r||"reset"===r)&&null==n.value)return;n=""+e._wrapperState.initialValue,t||n===e.value||(e.value=n),e.defaultValue=n}""!==(t=e.name)&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,""!==t&&(e.name=t)}function oe(e,n,t){"number"===n&&ee(e.ownerDocument)===e||(null==t?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+t&&(e.defaultValue=""+t))}function ue(e,n,t,r){if(e=e.options,n){n={};for(var l=0;l>>=0)?32:31-(iu(e)/su|0)|0}function Re(e){switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return 4194240&e;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return 130023424&e;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function De(e,n){var t=e.pendingLanes;if(0===t)return 0;var r,l=0,a=e.suspendedLanes,o=e.pingedLanes,u=268435455&t;if(0!==u?0!==(r=u&~a)?l=Re(r):0!==(o&=u)&&(l=Re(o)):0!==(u=t&~a)?l=Re(u):0!==o&&(l=Re(o)),0===l)return 0;if(0!==n&&n!==l&&0==(n&a)&&((o=n&-n)<=(a=l&-l)||16===a&&0!=(4194240&o)))return n;if(0!=(4&l)&&(l|=16&t),0!==(n=e.entangledLanes))for(e=e.entanglements,n&=l;0>=r,a-=r,Xi=1<<32-uu(n)+a|t<u?(i=o,o=null):i=o.sibling;var s=y(n,o,t[u],r);if(null===s){null===o&&(o=i);break}f&&o&&null===s.alternate&&d(n,o),e=h(s,e,u),null===a?l=s:a.sibling=s,a=s,o=i}if(u===t.length)p(n,o);else if(null===o)for(;uu?(i=o,o=null):i=o.sibling;var c=y(n,o,s.value,r);if(null===c){null===o&&(o=i);break}f&&o&&null===c.alternate&&d(n,o),e=h(c,e,u),null===a?l=c:a.sibling=c,a=c,o=i}if(s.done)p(n,o);else if(null===o)for(;!s.done;u++,s=t.next())null!==(s=g(n,s.value,r))&&(e=h(s,e,u),null===a?l=s:a.sibling=s,a=s);else{for(o=m(n,o);!s.done;u++,s=t.next())null!==(s=v(o,n,u,s.value,r))&&(f&&null!==s.alternate&&o.delete(null===s.key?u:s.key),e=h(s,e,u),null===a?l=s:a.sibling=s,a=s);f&&o.forEach(function(e){return d(n,e)})}return E&&vt(n,u),l}function w(e,n,t,r){if("object"==typeof(t="object"==typeof t&&null!==t&&t.type===co&&null===t.key?t.props.children:t)&&null!==t){switch(t.$$typeof){case io:e:{for(var l=t.key,a=n;null!==a;){if(a.key===l){if((l=t.type)===co){if(7===a.tag){p(e,a.sibling),(n=o(a,t.props.children)).return=e,e=n;break e}}else if(a.elementType===l||"object"==typeof l&&null!==l&&l.$$typeof===ko&&Mt(l)===a.type){p(e,a.sibling),(n=o(a,t.props)).ref=Lt(e,a,t),n.return=e,e=n;break e}p(e,a);break}d(e,a),a=a.sibling}e=t.type===co?((n=za(t.props.children,e.mode,r,t.key)).return=e,n):((r=Na(t.type,t.key,t.props,null,e.mode,r)).ref=Lt(e,n,t),r.return=e,r)}return u(e);case so:e:{for(a=t.key;null!==n;){if(n.key===a){if(4===n.tag&&n.stateNode.containerInfo===t.containerInfo&&n.stateNode.implementation===t.implementation){p(e,n.sibling),(n=o(n,t.children||[])).return=e,e=n;break e}p(e,n);break}d(e,n),n=n.sibling}(n=La(t,e.mode,r)).return=e,e=n}return u(e);case ko:return w(e,n,(a=t._init)(t._payload),r)}if(Eo(t))return b(e,n,t,r);if(H(t))return k(e,n,t,r);Tt(e,t)}return"string"==typeof t&&""!==t||"number"==typeof t?(t=""+t,(n=null!==n&&6===n.tag?(p(e,n.sibling),o(n,t)):(p(e,n),_a(t,e.mode,r))).return=e,u(e=n)):p(e,n)}return w}function Rt(){os=as=ls=null}function Dt(e,n){n=rs.current,s(rs),e._currentValue=n}function Ot(e,n,t){for(;null!==e;){var r=e.alternate;if((e.childLanes&n)!==n?(e.childLanes|=n,null!==r&&(r.childLanes|=n)):null!==r&&(r.childLanes&n)!==n&&(r.childLanes|=n),e===t)break;e=e.return}}function It(e,n){(os=as=null)!==(e=(ls=e).dependencies)&&null!==e.firstContext&&(0!=(e.lanes&n)&&(_=!0),e.firstContext=null)}function Ut(e){var n=e._currentValue;if(os!==e)if(e={context:e,memoizedValue:n,next:null},null===as){if(null===ls)throw Error(S(308));as=e,ls.dependencies={lanes:0,firstContext:e}}else as=as.next=e;return n}function Vt(e){null===us?us=[e]:us.push(e)}function At(e,n,t,r){var l=n.interleaved;return null===l?(t.next=t,Vt(n)):(t.next=l.next,l.next=t),n.interleaved=t,Wt(e,r)}function Wt(e,n){e.lanes|=n;var t=e.alternate;for(null!==t&&(t.lanes|=n),e=(t=e).return;null!==e;)e.childLanes|=n,null!==(t=e.alternate)&&(t.childLanes|=n),e=(t=e).return;return 3===t.tag?t.stateNode:null}function Bt(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Ht(e,n){e=e.updateQueue,n.updateQueue===e&&(n.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function Qt(e,n){return{eventTime:e,lane:n,tag:0,payload:null,callback:null,next:null}}function jt(e,n,t){var r,l=e.updateQueue;return null===l?null:(l=l.shared,(0!=(2&F)?(null===(r=l.pending)?n.next=n:(n.next=r.next,r.next=n),l.pending=n,is):(null===(r=l.interleaved)?(n.next=n,Vt(l)):(n.next=r.next,r.next=n),l.interleaved=n,Wt))(e,t))}function $t(e,n,t){var r;null!==(n=n.updateQueue)&&(n=n.shared,0!=(4194240&t))&&(r=n.lanes,r&=e.pendingLanes,He(e,n.lanes=t|=r))}function qt(e,n){var t=e.updateQueue,r=e.alternate;if(null!==r&&t===(r=r.updateQueue)){var l=null,a=null;if(null!==(t=t.firstBaseUpdate)){do{var o={eventTime:t.eventTime,lane:t.lane,tag:t.tag,payload:t.payload,callback:t.callback,next:null}}while(null===a?l=a=o:a=a.next=o,null!==(t=t.next));null===a?l=a=n:a=a.next=n}else l=a=n;t={baseState:r.baseState,firstBaseUpdate:l,lastBaseUpdate:a,shared:r.shared,effects:r.effects},e.updateQueue=t}else null===(e=t.lastBaseUpdate)?t.firstBaseUpdate=n:e.next=n,t.lastBaseUpdate=n}function Kt(e,n,t,r){var l,a,o=e.updateQueue,u=(ss=!1,o.firstBaseUpdate),i=o.lastBaseUpdate;if(null!==(f=o.shared.pending)&&(o.shared.pending=null,a=(l=f).next,(l.next=null)===i?u=a:i.next=a,i=l,null!==(c=e.alternate))&&(f=(c=c.updateQueue).lastBaseUpdate)!==i&&(null===f?c.firstBaseUpdate=a:f.next=a,c.lastBaseUpdate=l),null!==u){for(var s=o.baseState,i=0,c=a=l=null,f=u;;){var d=f.lane,p=f.eventTime;if((r&d)===d){null!==c&&(c=c.next={eventTime:p,lane:0,tag:f.tag,payload:f.payload,callback:f.callback,next:null});e:{var m=e,h=f,d=n,p=t;switch(h.tag){case 1:if("function"==typeof(m=h.payload)){s=m.call(p,s,d);break e}s=m;break e;case 3:m.flags=-65537&m.flags|128;case 0:if(null==(d="function"==typeof(m=h.payload)?m.call(p,s,d):m))break e;s=g({},s,d);break e;case 2:ss=!0}}null!==f.callback&&0!==f.lane&&(e.flags|=64,null===(d=o.effects)?o.effects=[f]:d.push(f))}else p={eventTime:p,lane:d,tag:f.tag,payload:f.payload,callback:f.callback,next:null},null===c?(a=c=p,l=s):c=c.next=p,i|=d;if(null===(f=f.next)){if(null===(f=o.shared.pending))break;f=(d=f).next,d.next=null,o.lastBaseUpdate=d,o.shared.pending=null}}if(null===c&&(l=s),o.baseState=l,o.firstBaseUpdate=a,o.lastBaseUpdate=c,null!==(n=o.shared.interleaved))for(o=n;i|=o.lane,(o=o.next)!==n;);else null===u&&(o.shared.lanes=0);Qs|=i,e.lanes=i,e.memoizedState=s}}function Yt(e,n,t){if(e=n.effects,(n.effects=null)!==e)for(n=0;n<\\/script>",e=e.removeChild(e.firstChild)):"string"==typeof r.is?e=o.createElement(t,{is:r.is}):(e=o.createElement(t),"select"===t&&(o=e,r.multiple?o.multiple=!0:r.size&&(o.size=r.size))):e=o.createElementNS(e,t),e[Li]=n,e[Ti]=r,Ls(e,n,!1,!1),n.stateNode=e;e:{switch(o=ye(t,r),t){case"dialog":c("cancel",e),c("close",e),a=r;break;case"iframe":case"object":case"embed":c("load",e),a=r;break;case"video":case"audio":for(a=0;aYs&&(n.flags|=128,wl(i,!(r=!0)),n.lanes=4194304)}else{if(!r)if(null!==(e=nr(o))){if(n.flags|=128,r=!0,null!==(t=e.updateQueue)&&(n.updateQueue=t,n.flags|=4),wl(i,!0),null===i.tail&&"hidden"===i.tailMode&&!o.alternate&&!E)return p(n),null}else 2*y()-i.renderingStartTime>Ys&&1073741824!==t&&(n.flags|=128,wl(i,!(r=!0)),n.lanes=4194304);i.isBackwards?(o.sibling=n.child,n.child=o):(null!==(t=i.last)?t.sibling=o:n.child=o,i.last=o)}if(null!==i.tail)return n=i.tail,i.rendering=n,i.tail=n.sibling,i.renderingStartTime=y(),n.sibling=null,t=C.current,f(C,r?1&t|2:1&t),n}return p(n),null;case 22:case 23:return O=Bs.current,s(Bs),r=null!==n.memoizedState,null!==e&&null!==e.memoizedState!==r&&(n.flags|=8192),r&&0!=(1&n.mode)?0!=(1073741824&O)&&(p(n),6&n.subtreeFlags)&&(n.flags|=8192):p(n),null;case 24:case 25:return null}throw Error(S(156,n.tag))}function xl(e,n,t){switch(wt(n),n.tag){case 1:return h(n.type)&&(s(b),s(v)),65536&(e=n.flags)?(n.flags=-65537&e|128,n):null;case 3:return Zt(),s(b),s(v),tr(),0!=(65536&(e=n.flags))&&0==(128&e)?(n.flags=-65537&e|128,n):null;case 5:return er(n),null;case 13:if(s(C),null!==(e=n.memoizedState)&&null!==e.dehydrated){if(null===n.alternate)throw Error(S(340));Pt()}return 65536&(e=n.flags)?(n.flags=-65537&e|128,n):null;case 19:return s(C),null;case 4:return Zt(),null;case 10:return Dt(n.type._context),null;case 22:case 23:return O=Bs.current,s(Bs),null;default:return null}}function El(n,t){var e=n.ref;if(null!==e)if("function"==typeof e)try{e(null)}catch(e){w(n,t,e)}else e.current=null}function Cl(n,t,e){try{e()}catch(e){w(n,t,e)}}function Nl(e,n){if(Ei=Su,Dn(e=Rn())){if("selectionStart"in e)var t={start:e.selectionStart,end:e.selectionEnd};else e:if((a=(t=(t=e.ownerDocument)&&t.defaultView||window).getSelection&&t.getSelection())&&0!==a.rangeCount){var t=a.anchorNode,r=a.anchorOffset,l=a.focusNode,a=a.focusOffset;try{t.nodeType,l.nodeType}catch(e){t=null;break e}var o,u=0,i=-1,s=-1,c=0,f=0,d=e,p=null;n:for(;;){for(;d!==t||0!==r&&3!==d.nodeType||(i=u+r),d!==l||0!==a&&3!==d.nodeType||(s=u+a),3===d.nodeType&&(u+=d.nodeValue.length),null!==(o=d.firstChild);)p=d,d=o;for(;;){if(d===e)break n;if(p===t&&++c===r&&(i=u),p===l&&++f===a&&(s=u),null!==(o=d.nextSibling))break;p=(d=p).parentNode}d=o}t=-1===i||-1===s?null:{start:i,end:s}}else t=null;t=t||{start:0,end:0}}else t=null;for(Su=!(Ci={focusedElem:e,selectionRange:t}),T=n;null!==T;)if(e=(n=T).child,0!=(1028&n.subtreeFlags)&&null!==e)e.return=n,T=e;else for(;null!==T;){n=T;try{var m,h,g,y,v=n.alternate;if(0!=(1024&n.flags))switch(n.tag){case 0:case 11:case 15:break;case 1:null!==v&&(m=v.memoizedProps,h=v.memoizedState,y=(g=n.stateNode).getSnapshotBeforeUpdate(n.elementType===n.type?m:Ar(n.type,m),h),g.__reactInternalSnapshotBeforeUpdate=y);break;case 3:var b=n.stateNode.containerInfo;1===b.nodeType?b.textContent="":9===b.nodeType&&b.documentElement&&b.removeChild(b.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(S(163))}}catch(e){w(n,n.return,e)}if(null!==(e=n.sibling)){e.return=n.return,T=e;break}T=n.return}return v=Os,Os=!1,v}function zl(e,n,t){var r=n.updateQueue;if(null!==(r=null!==r?r.lastEffect:null)){var l,a=r=r.next;do{}while((a.tag&e)===e&&(l=a.destroy,(a.destroy=void 0)!==l)&&Cl(n,t,l),(a=a.next)!==r)}}function Pl(e,n){if(null!==(n=null!==(n=n.updateQueue)?n.lastEffect:null)){var t,r=n=n.next;do{}while((r.tag&e)===e&&(t=r.create,r.destroy=t()),(r=r.next)!==n)}}function _l(e){var n,t=e.ref;null!==t&&(n=e.stateNode,e.tag,e=n,"function"==typeof t?t(e):t.current=e)}function Ll(e){var n=e.alternate;null!==n&&(e.alternate=null,Ll(n)),e.child=null,e.deletions=null,e.sibling=null,5===e.tag&&null!==(n=e.stateNode)&&(delete n[Li],delete n[Ti],delete n[Fi],delete n[Ri],delete n[Di]),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function Tl(e){return 5===e.tag||3===e.tag||4===e.tag}function Ml(e){e:for(;;){for(;null===e.sibling;){if(null===e.return||Tl(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;5!==e.tag&&6!==e.tag&&18!==e.tag;){if(2&e.flags)continue e;if(null===e.child||4===e.tag)continue e;e=(e.child.return=e).child}if(!(2&e.flags))return e.stateNode}}function Fl(e,n,t){var r=e.tag;if(5===r||6===r)e=e.stateNode,n?(8===t.nodeType?t.parentNode:t).insertBefore(e,n):(8===t.nodeType?(n=t.parentNode).insertBefore(e,t):(n=t).appendChild(e),null==(t=t._reactRootContainer)&&null===n.onclick&&(n.onclick=Jn));else if(4!==r&&null!==(e=e.child))for(Fl(e,n,t),e=e.sibling;null!==e;)Fl(e,n,t),e=e.sibling}function Rl(e,n,t){var r=e.tag;if(5===r||6===r)e=e.stateNode,n?t.insertBefore(e,n):t.appendChild(e);else if(4!==r&&null!==(e=e.child))for(Rl(e,n,t),e=e.sibling;null!==e;)Rl(e,n,t),e=e.sibling}function Dl(e,n,t){for(t=t.child;null!==t;)Ol(e,n,t),t=t.sibling}function Ol(e,n,t){if(ou&&"function"==typeof ou.onCommitFiberUnmount)try{ou.onCommitFiberUnmount(au,t)}catch(e){}switch(t.tag){case 5:L||El(t,n);case 6:var r=M,l=Is;M=null,Dl(e,n,t),Is=l,null!==(M=r)&&(Is?(e=M,t=t.stateNode,(8===e.nodeType?e.parentNode:e).removeChild(t)):M.removeChild(t.stateNode));break;case 18:null!==M&&(Is?(e=M,t=t.stateNode,8===e.nodeType?tt(e.parentNode,t):1===e.nodeType&&tt(e,t),Je(e)):tt(M,t.stateNode));break;case 4:r=M,l=Is,M=t.stateNode.containerInfo,Is=!0,Dl(e,n,t),M=r,Is=l;break;case 0:case 11:case 14:case 15:if(!L&&null!==(r=t.updateQueue)&&null!==(r=r.lastEffect)){l=r=r.next;do{var a=(o=l).destroy,o=o.tag}while(void 0===a||0==(2&o)&&0==(4&o)||Cl(t,n,a),(l=l.next)!==r)}Dl(e,n,t);break;case 1:if(!L&&(El(t,n),"function"==typeof(r=t.stateNode).componentWillUnmount))try{r.props=t.memoizedProps,r.state=t.memoizedState,r.componentWillUnmount()}catch(e){w(t,n,e)}Dl(e,n,t);break;case 21:Dl(e,n,t);break;case 22:1&t.mode?(L=(r=L)||null!==t.memoizedState,Dl(e,n,t),L=r):Dl(e,n,t);break;default:Dl(e,n,t)}}function Il(t){var r,e=t.updateQueue;null!==e&&((t.updateQueue=null)===(r=t.stateNode)&&(r=t.stateNode=new Ds),e.forEach(function(e){var n=ka.bind(null,t,e);r.has(e)||(r.add(e),e.then(n,n))}))}function Ul(e,n,t){if(null!==(t=n.deletions))for(var r=0;r