diff --git a/.obsidian/app.json b/.obsidian/app.json index 9e26dfee..7ff841d5 100644 --- a/.obsidian/app.json +++ b/.obsidian/app.json @@ -1 +1,9 @@ -{} \ No newline at end of file +{ + "newFileLocation": "current", + "newLinkFormat": "relative", + "attachmentFolderPath": "./assets", + "strictLineBreaks": true, + "useMarkdownLinks": true, + "showLineNumber": false, + "trashOption": "local" +} \ No newline at end of file diff --git a/.obsidian/appearance.json b/.obsidian/appearance.json index 854752d4..cec7f0e7 100644 --- a/.obsidian/appearance.json +++ b/.obsidian/appearance.json @@ -1,3 +1,5 @@ { - "cssTheme": "ITS Theme" + "nativeMenus": true, + "cssTheme": "ITS Theme", + "accentColor": "" } \ No newline at end of file diff --git a/.obsidian/community-plugins.json b/.obsidian/community-plugins.json index a69b2693..15256dd0 100644 --- a/.obsidian/community-plugins.json +++ b/.obsidian/community-plugins.json @@ -1,8 +1,10 @@ [ + "consistent-attachments-and-links", + "nuke-orphans", + "hidden-folder-obsidian", + "update-relative-links", "easy-typing-obsidian", "file-explorer-note-count", "obsidian-git", - "hidden-folder-obsidian", - "nuke-orphans", - "update-relative-links" + "better-export-pdf" ] \ No newline at end of file diff --git a/.obsidian/graph.json b/.obsidian/graph.json index eec123c2..3b5e71ad 100644 --- a/.obsidian/graph.json +++ b/.obsidian/graph.json @@ -32,10 +32,6 @@ "repelStrength": 10, "linkStrength": 1, "linkDistance": 250, -<<<<<<< HEAD "scale": 0.535979599622594, -======= - "scale": 0.7514342322277586, ->>>>>>> origin/main "close": true } \ No newline at end of file diff --git a/.obsidian/plugins/better-export-pdf/data.json b/.obsidian/plugins/better-export-pdf/data.json index e751bbee..9b14404d 100644 --- a/.obsidian/plugins/better-export-pdf/data.json +++ b/.obsidian/plugins/better-export-pdf/data.json @@ -1,9 +1,5 @@ { -<<<<<<< HEAD "showTitle": true, -======= - "showTitle": false, ->>>>>>> origin/main "maxLevel": "6", "displayHeader": true, "displayFooter": true, diff --git a/.obsidian/plugins/better-export-pdf/main.js b/.obsidian/plugins/better-export-pdf/main.js index 7acb37e6..927237da 100644 --- a/.obsidian/plugins/better-export-pdf/main.js +++ b/.obsidian/plugins/better-export-pdf/main.js @@ -19928,12 +19928,6 @@ function copyAttributes(node, attributes) { node.setAttribute(attr.name, attr.value); }); } -<<<<<<< HEAD -======= -function isNumber(str) { - return !isNaN(parseFloat(str)); -} ->>>>>>> origin/main // src/pdf.ts async function getDestPosition(pdfDoc) { @@ -20160,51 +20154,27 @@ function setMetadata(pdfDoc, { title, author, keywords, subject, creator, create pdfDoc.setModificationDate(new Date(updated_at != null ? updated_at : /* @__PURE__ */ new Date())); } async function exportToPDF(outputFile, config, w, { doc, frontMatter }) { -<<<<<<< HEAD var _a, _b, _c, _d, _e, _f, _g, _h, _i; -======= - var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j; ->>>>>>> origin/main console.log("output pdf:", outputFile); let pageSize = config["pageSize"]; if (config["pageSize"] == "Custom" && config["pageWidth"] && config["pageHeight"]) { pageSize = { -<<<<<<< HEAD width: parseFloat((_a = config["pageWidth"]) != null ? _a : "0") / 25.4, height: parseFloat((_b = config["pageHeight"]) != null ? _b : "0") / 25.4 }; } -======= - width: parseFloat((_a = config["pageWidth"]) != null ? _a : "210") / 25.4, - height: parseFloat((_b = config["pageHeight"]) != null ? _b : "297") / 25.4 - }; - } - let scale2 = (_c = config == null ? void 0 : config["scale"]) != null ? _c : 100; - if (scale2 > 200 || scale2 < 10) { - scale2 = 100; - } ->>>>>>> origin/main const printOptions = { landscape: config == null ? void 0 : config["landscape"], printBackground: config == null ? void 0 : config["printBackground"], generateTaggedPDF: config == null ? void 0 : config["generateTaggedPDF"], pageSize, -<<<<<<< HEAD scale: config["scale"] / 100, -======= - scale: scale2 / 100, ->>>>>>> origin/main margins: { marginType: "default" }, displayHeaderFooter: config["displayHeader"] || config["displayFooter"], -<<<<<<< HEAD headerTemplate: config["displayHeader"] ? (_c = frontMatter == null ? void 0 : frontMatter["headerTemplate"]) != null ? _c : config["headerTemplate"] : "", footerTemplate: config["displayFooter"] ? (_d = frontMatter == null ? void 0 : frontMatter["footerTemplate"]) != null ? _d : config["footerTemplate"] : "" -======= - headerTemplate: config["displayHeader"] ? (_d = frontMatter == null ? void 0 : frontMatter["headerTemplate"]) != null ? _d : config["headerTemplate"] : "", - footerTemplate: config["displayFooter"] ? (_e = frontMatter == null ? void 0 : frontMatter["footerTemplate"]) != null ? _e : config["footerTemplate"] : "" ->>>>>>> origin/main }; if (config.marginType == "0") { printOptions["margins"] = { @@ -20229,17 +20199,10 @@ async function exportToPDF(outputFile, config, w, { doc, frontMatter }) { } else if (config.marginType == "3") { printOptions["margins"] = { marginType: "custom", -<<<<<<< HEAD top: parseFloat((_e = config["marginTop"]) != null ? _e : "0") / 25.4, bottom: parseFloat((_f = config["marginBottom"]) != null ? _f : "0") / 25.4, left: parseFloat((_g = config["marginLeft"]) != null ? _g : "0") / 25.4, right: parseFloat((_h = config["marginRight"]) != null ? _h : "0") / 25.4 -======= - top: parseFloat((_f = config["marginTop"]) != null ? _f : "0") / 25.4, - bottom: parseFloat((_g = config["marginBottom"]) != null ? _g : "0") / 25.4, - left: parseFloat((_h = config["marginLeft"]) != null ? _h : "0") / 25.4, - right: parseFloat((_i = config["marginRight"]) != null ? _i : "0") / 25.4 ->>>>>>> origin/main }; } try { @@ -20248,11 +20211,7 @@ async function exportToPDF(outputFile, config, w, { doc, frontMatter }) { headings: getHeadingTree(doc), frontMatter, displayMetadata: config == null ? void 0 : config.displayMetadata, -<<<<<<< HEAD maxLevel: parseInt((_i = config == null ? void 0 : config.maxLevel) != null ? _i : "6") -======= - maxLevel: parseInt((_j = config == null ? void 0 : config.maxLevel) != null ? _j : "6") ->>>>>>> origin/main }); await fs.writeFile(outputFile, data); if (config.open) { @@ -20349,14 +20308,6 @@ body { break-after: auto; } } -<<<<<<< HEAD -======= - -img.__canvas__ { - width: 100% !important; - height: 100% !important; -} ->>>>>>> origin/main `; function getPatchStyle() { return [CSS_PATCH, ...getPrintStyle()]; @@ -20809,12 +20760,8 @@ ${px2mm(width)}\xD7${px2mm(height)}mm`; await this.appendWebviews(el); this.togglePrintSize(); }); -<<<<<<< HEAD const contentEl = wrapper.createDiv(); contentEl.setAttribute("style", "width:320px;margin-left:16px;"); -======= - const contentEl = wrapper.createDiv({ attr: { class: "setting-wrapper" } }); ->>>>>>> origin/main contentEl.addEventListener("keyup", (event) => { if (event.key === "Enter") { handleExport(); @@ -20822,20 +20769,8 @@ ${px2mm(width)}\xD7${px2mm(height)}mm`; }); this.generateForm(contentEl); const handleExport = async () => { -<<<<<<< HEAD this.plugin.settings.prevConfig = this.config; await this.plugin.saveSettings(); -======= - var _a2, _b2; - this.plugin.settings.prevConfig = this.config; - await this.plugin.saveSettings(); - if (this.config["pageSize"] == "Custom") { - if (!isNumber((_a2 = this.config["pageWidth"]) != null ? _a2 : "") || !isNumber((_b2 = this.config["pageHeight"]) != null ? _b2 : "")) { - alert("When the page size is Custom, the Width/Height cannot be empty."); - return; - } - } ->>>>>>> origin/main if (this.multiplePdf) { const outputPath = await getOutputPath(title); console.log("output:", outputPath); diff --git a/.obsidian/plugins/better-export-pdf/manifest.json b/.obsidian/plugins/better-export-pdf/manifest.json index 222a1423..e74b4ebc 100644 --- a/.obsidian/plugins/better-export-pdf/manifest.json +++ b/.obsidian/plugins/better-export-pdf/manifest.json @@ -1,11 +1,7 @@ { "id": "better-export-pdf", "name": "Better Export PDF", -<<<<<<< HEAD "version": "1.10.0", -======= - "version": "1.10.2", ->>>>>>> origin/main "minAppVersion": "0.15.0", "description": "Export your notes to PDF, support export preview, add bookmarks outline and header/footer.", "author": "l1xnan", diff --git a/.obsidian/plugins/better-export-pdf/styles.css b/.obsidian/plugins/better-export-pdf/styles.css index 3d7017d9..1ae02d66 100644 --- a/.obsidian/plugins/better-export-pdf/styles.css +++ b/.obsidian/plugins/better-export-pdf/styles.css @@ -50,15 +50,3 @@ height: 100%; width: 100%; } -<<<<<<< HEAD -======= - -#better-export-pdf .setting-wrapper { - width: 320px; - margin-left: 16px; -} - -#better-export-pdf .setting-wrapper .setting-item[hidden] { - display: none; -} ->>>>>>> origin/main diff --git a/.obsidian/plugins/consistent-attachments-and-links/main.js b/.obsidian/plugins/consistent-attachments-and-links/main.js index 972800a9..d5d5e500 100644 --- a/.obsidian/plugins/consistent-attachments-and-links/main.js +++ b/.obsidian/plugins/consistent-attachments-and-links/main.js @@ -3,7 +3,6 @@ THIS IS A GENERATED/BUNDLED FILE BY ESBUILD if you want to view the source, please visit the github repository of this plugin */ -<<<<<<< HEAD function __extractDefault(module2) { return module2 && module2.__esModule && module2.default ? module2.default : module2; } @@ -52,125 +51,11 @@ ${t}`)}async loadSettings(){let t=await this.loadData();this._settings=this.crea `,after:` `,...o.current()}))),l.type!=="list"&&(t.bulletLastUsed=void 0),s requirePatched(id), - originalRequire, - { - __isPatched: true - } - ); - } - const newFuncs = { - __extractDefault: () => extractDefault, - process: () => { - const browserProcess = { - browser: true, - cwd: () => "/", - env: {}, - platform: "android" - }; - return browserProcess; - } - }; - for (const key of Object.keys(newFuncs)) { - globalThisRecord[key] ??= newFuncs[key]?.(); - } - function name(obj) { - return obj; - } - function extractDefault(module2) { - return module2 && module2.__esModule && module2.default ? module2.default : module2; - } - function requirePatched(id) { - const module2 = originalRequire?.(id); - if (module2) { - return extractDefault(module2); - } - if (id === "process" || id === "node:process") { - console.error(`Module not found: ${id}. Fake process object is returned instead.`); - return globalThis.process; - } - console.error(`Module not found: ${id}. Empty object is returned instead.`); - return {}; - } -})(); - -"use strict";var pp=Object.create;var ri=Object.defineProperty;var gp=Object.getOwnPropertyDescriptor;var wp=Object.getOwnPropertyNames;var kp=Object.getPrototypeOf,yp=Object.prototype.hasOwnProperty;var Xe=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),bl=(e,t)=>{for(var n in t)ri(e,n,{get:t[n],enumerable:!0})},vl=(e,t,n,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of wp(t))!yp.call(e,o)&&o!==n&&ri(e,o,{get:()=>t[o],enumerable:!(i=gp(t,o))||i.enumerable});return e};var je=(e,t,n)=>(n=e!=null?pp(kp(e)):{},vl(t||!e||!e.__esModule?ri(n,"default",{value:e,enumerable:!0}):n,e)),xp=e=>vl(ri({},"__esModule",{value:!0}),e);var Al=Xe((cy,Tl)=>{"use strict";function kt(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}function El(e,t){for(var n="",i=0,o=-1,s=0,l,u=0;u<=e.length;++u){if(u2){var f=n.lastIndexOf("/");if(f!==n.length-1){f===-1?(n="",i=0):(n=n.slice(0,f),i=n.length-1-n.lastIndexOf("/")),o=u,s=0;continue}}else if(n.length===2||n.length===1){n="",i=0,o=u,s=0;continue}}t&&(n.length>0?n+="/..":n="..",i=2)}else n.length>0?n+="/"+e.slice(o+1,u):n=e.slice(o+1,u),i=u-o-1;o=u,s=0}else l===46&&s!==-1?++s:s=-1}return n}function Sp(e,t){var n=t.dir||t.root,i=t.base||(t.name||"")+(t.ext||"");return n?n===t.root?n+i:n+e+i:i}var Mn={resolve:function(){for(var t="",n=!1,i,o=arguments.length-1;o>=-1&&!n;o--){var s;o>=0?s=arguments[o]:(i===void 0&&(i=process.cwd()),s=i),kt(s),s.length!==0&&(t=s+"/"+t,n=s.charCodeAt(0)===47)}return t=El(t,!n),n?t.length>0?"/"+t:"/":t.length>0?t:"."},normalize:function(t){if(kt(t),t.length===0)return".";var n=t.charCodeAt(0)===47,i=t.charCodeAt(t.length-1)===47;return t=El(t,!n),t.length===0&&!n&&(t="."),t.length>0&&i&&(t+="/"),n?"/"+t:t},isAbsolute:function(t){return kt(t),t.length>0&&t.charCodeAt(0)===47},join:function(){if(arguments.length===0)return".";for(var t,n=0;n0&&(t===void 0?t=i:t+="/"+i)}return t===void 0?".":Mn.normalize(t)},relative:function(t,n){if(kt(t),kt(n),t===n||(t=Mn.resolve(t),n=Mn.resolve(n),t===n))return"";for(var i=1;im){if(n.charCodeAt(l+p)===47)return n.slice(l+p+1);if(p===0)return n.slice(l+p)}else s>m&&(t.charCodeAt(i+p)===47?h=p:p===0&&(h=0));break}var w=t.charCodeAt(i+p),k=n.charCodeAt(l+p);if(w!==k)break;w===47&&(h=p)}var v="";for(p=i+h+1;p<=o;++p)(p===o||t.charCodeAt(p)===47)&&(v.length===0?v+="..":v+="/..");return v.length>0?v+n.slice(l+h):(l+=h,n.charCodeAt(l)===47&&++l,n.slice(l))},_makeLong:function(t){return t},dirname:function(t){if(kt(t),t.length===0)return".";for(var n=t.charCodeAt(0),i=n===47,o=-1,s=!0,l=t.length-1;l>=1;--l)if(n=t.charCodeAt(l),n===47){if(!s){o=l;break}}else s=!1;return o===-1?i?"/":".":i&&o===1?"//":t.slice(0,o)},basename:function(t,n){if(n!==void 0&&typeof n!="string")throw new TypeError('"ext" argument must be a string');kt(t);var i=0,o=-1,s=!0,l;if(n!==void 0&&n.length>0&&n.length<=t.length){if(n.length===t.length&&n===t)return"";var u=n.length-1,f=-1;for(l=t.length-1;l>=0;--l){var m=t.charCodeAt(l);if(m===47){if(!s){i=l+1;break}}else f===-1&&(s=!1,f=l+1),u>=0&&(m===n.charCodeAt(u)?--u===-1&&(o=l):(u=-1,o=f))}return i===o?o=f:o===-1&&(o=t.length),t.slice(i,o)}else{for(l=t.length-1;l>=0;--l)if(t.charCodeAt(l)===47){if(!s){i=l+1;break}}else o===-1&&(s=!1,o=l+1);return o===-1?"":t.slice(i,o)}},extname:function(t){kt(t);for(var n=-1,i=0,o=-1,s=!0,l=0,u=t.length-1;u>=0;--u){var f=t.charCodeAt(u);if(f===47){if(!s){i=u+1;break}continue}o===-1&&(s=!1,o=u+1),f===46?n===-1?n=u:l!==1&&(l=1):n!==-1&&(l=-1)}return n===-1||o===-1||l===0||l===1&&n===o-1&&n===i+1?"":t.slice(n,o)},format:function(t){if(t===null||typeof t!="object")throw new TypeError('The "pathObject" argument must be of type Object. Received type '+typeof t);return Sp("/",t)},parse:function(t){kt(t);var n={root:"",dir:"",base:"",ext:"",name:""};if(t.length===0)return n;var i=t.charCodeAt(0),o=i===47,s;o?(n.root="/",s=1):s=0;for(var l=-1,u=0,f=-1,m=!0,h=t.length-1,p=0;h>=s;--h){if(i=t.charCodeAt(h),i===47){if(!m){u=h+1;break}continue}f===-1&&(m=!1,f=h+1),i===46?l===-1?l=h:p!==1&&(p=1):l!==-1&&(p=-1)}return l===-1||f===-1||p===0||p===1&&l===f-1&&l===u+1?f!==-1&&(u===0&&o?n.base=n.name=t.slice(1,f):n.base=n.name=t.slice(u,f)):(u===0&&o?(n.name=t.slice(1,l),n.base=t.slice(1,f)):(n.name=t.slice(u,l),n.base=t.slice(u,f)),n.ext=t.slice(l,f)),u>0?n.dir=t.slice(0,u-1):o&&(n.dir="/"),n},sep:"/",delimiter:":",win32:null,posix:null};Mn.posix=Mn;Tl.exports=Mn});var Pl=Xe((fy,os)=>{"use strict";var _p=Object.prototype.hasOwnProperty,De="~";function dr(){}Object.create&&(dr.prototype=Object.create(null),new dr().__proto__||(De=!1));function Ep(e,t,n){this.fn=e,this.context=t,this.once=n||!1}function Fl(e,t,n,i,o){if(typeof n!="function")throw new TypeError("The listener must be a function");var s=new Ep(n,i||e,o),l=De?De+t:t;return e._events[l]?e._events[l].fn?e._events[l]=[e._events[l],s]:e._events[l].push(s):(e._events[l]=s,e._eventsCount++),e}function oi(e,t){--e._eventsCount===0?e._events=new dr:delete e._events[t]}function Ae(){this._events=new dr,this._eventsCount=0}Ae.prototype.eventNames=function(){var t=[],n,i;if(this._eventsCount===0)return t;for(i in n=this._events)_p.call(n,i)&&t.push(De?i.slice(1):i);return Object.getOwnPropertySymbols?t.concat(Object.getOwnPropertySymbols(n)):t};Ae.prototype.listeners=function(t){var n=De?De+t:t,i=this._events[n];if(!i)return[];if(i.fn)return[i.fn];for(var o=0,s=i.length,l=new Array(s);o{var On=1e3,Dn=On*60,Rn=Dn*60,fn=Rn*24,Dp=fn*7,Rp=fn*365.25;$l.exports=function(e,t){t=t||{};var n=typeof e;if(n==="string"&&e.length>0)return Np(e);if(n==="number"&&isFinite(e))return t.long?Wp(e):Yp(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))};function Np(e){if(e=String(e),!(e.length>100)){var t=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);if(t){var n=parseFloat(t[1]),i=(t[2]||"ms").toLowerCase();switch(i){case"years":case"year":case"yrs":case"yr":case"y":return n*Rp;case"weeks":case"week":case"w":return n*Dp;case"days":case"day":case"d":return n*fn;case"hours":case"hour":case"hrs":case"hr":case"h":return n*Rn;case"minutes":case"minute":case"mins":case"min":case"m":return n*Dn;case"seconds":case"second":case"secs":case"sec":case"s":return n*On;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return n;default:return}}}}function Yp(e){var t=Math.abs(e);return t>=fn?Math.round(e/fn)+"d":t>=Rn?Math.round(e/Rn)+"h":t>=Dn?Math.round(e/Dn)+"m":t>=On?Math.round(e/On)+"s":e+"ms"}function Wp(e){var t=Math.abs(e);return t>=fn?ci(e,t,fn,"day"):t>=Rn?ci(e,t,Rn,"hour"):t>=Dn?ci(e,t,Dn,"minute"):t>=On?ci(e,t,On,"second"):e+" ms"}function ci(e,t,n,i){var o=t>=n*1.5;return Math.round(e/n)+" "+i+(o?"s":"")}});var cs=Xe((Oy,Gl)=>{function zp(e){n.debug=n,n.default=n,n.coerce=f,n.disable=l,n.enable=o,n.enabled=u,n.humanize=jl(),n.destroy=m,Object.keys(e).forEach(h=>{n[h]=e[h]}),n.names=[],n.skips=[],n.formatters={};function t(h){let p=0;for(let w=0;w{if(_==="%%")return"%";Y++;let j=n.formatters[J];if(typeof j=="function"){let G=T[Y];_=j.call(C,G),T.splice(Y,1),Y--}return _}),n.formatArgs.call(C,T),(C.log||n.log).apply(C,T)}return F.namespace=h,F.useColors=n.useColors(),F.color=n.selectColor(h),F.extend=i,F.destroy=n.destroy,Object.defineProperty(F,"enabled",{enumerable:!0,configurable:!1,get:()=>w!==null?w:(k!==n.namespaces&&(k=n.namespaces,v=n.enabled(h)),v),set:T=>{w=T}}),typeof n.init=="function"&&n.init(F),F}function i(h,p){let w=n(this.namespace+(typeof p>"u"?":":p)+h);return w.log=this.log,w}function o(h){n.save(h),n.namespaces=h,n.names=[],n.skips=[];let p=(typeof h=="string"?h:"").trim().replace(" ",",").split(",").filter(Boolean);for(let w of p)w[0]==="-"?n.skips.push(w.slice(1)):n.names.push(w)}function s(h,p){let w=0,k=0,v=-1,F=0;for(;w"-"+p)].join(",");return n.enable(""),h}function u(h){for(let p of n.skips)if(s(h,p))return!1;for(let p of n.names)if(s(h,p))return!0;return!1}function f(h){return h instanceof Error?h.stack||h.message:h}function m(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return n.enable(n.load()),n}Gl.exports=zp});var ql=Xe((Ge,fi)=>{Ge.formatArgs=Hp;Ge.save=Up;Ge.load=Vp;Ge.useColors=Bp;Ge.storage=$p();Ge.destroy=(()=>{let e=!1;return()=>{e||(e=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})();Ge.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function Bp(){if(typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs))return!0;if(typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let e;return typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&(e=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(e[1],10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function Hp(e){if(e[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+e[0]+(this.useColors?"%c ":" ")+"+"+fi.exports.humanize(this.diff),!this.useColors)return;let t="color: "+this.color;e.splice(1,0,t,"color: inherit");let n=0,i=0;e[0].replace(/%[a-zA-Z%]/g,o=>{o!=="%%"&&(n++,o==="%c"&&(i=n))}),e.splice(i,0,t)}Ge.log=console.debug||console.log||(()=>{});function Up(e){try{e?Ge.storage.setItem("debug",e):Ge.storage.removeItem("debug")}catch{}}function Vp(){let e;try{e=Ge.storage.getItem("debug")}catch{}return!e&&typeof process<"u"&&"env"in process&&(e=process.env.DEBUG),e}function $p(){try{return localStorage}catch{}}fi.exports=cs()(Ge);var{formatters:jp}=fi.exports;jp.j=function(e){try{return JSON.stringify(e)}catch(t){return"[UnexpectedJSONParseError]: "+t.message}}});var Ql=Xe((Dy,Zl)=>{"use strict";Zl.exports=(e,t=process.argv)=>{let n=e.startsWith("-")?"":e.length===1?"-":"--",i=t.indexOf(n+e),o=t.indexOf("--");return i!==-1&&(o===-1||i{"use strict";var Gp=require("os"),Jl=require("tty"),nt=Ql(),{env:xe}=process,$t;nt("no-color")||nt("no-colors")||nt("color=false")||nt("color=never")?$t=0:(nt("color")||nt("colors")||nt("color=true")||nt("color=always"))&&($t=1);"FORCE_COLOR"in xe&&(xe.FORCE_COLOR==="true"?$t=1:xe.FORCE_COLOR==="false"?$t=0:$t=xe.FORCE_COLOR.length===0?1:Math.min(parseInt(xe.FORCE_COLOR,10),3));function fs(e){return e===0?!1:{level:e,hasBasic:!0,has256:e>=2,has16m:e>=3}}function ds(e,t){if($t===0)return 0;if(nt("color=16m")||nt("color=full")||nt("color=truecolor"))return 3;if(nt("color=256"))return 2;if(e&&!t&&$t===void 0)return 0;let n=$t||0;if(xe.TERM==="dumb")return n;if(process.platform==="win32"){let i=Gp.release().split(".");return Number(i[0])>=10&&Number(i[2])>=10586?Number(i[2])>=14931?3:2:1}if("CI"in xe)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE"].some(i=>i in xe)||xe.CI_NAME==="codeship"?1:n;if("TEAMCITY_VERSION"in xe)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(xe.TEAMCITY_VERSION)?1:0;if(xe.COLORTERM==="truecolor")return 3;if("TERM_PROGRAM"in xe){let i=parseInt((xe.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(xe.TERM_PROGRAM){case"iTerm.app":return i>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(xe.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(xe.TERM)||"COLORTERM"in xe?1:n}function qp(e){let t=ds(e,e&&e.isTTY);return fs(t)}Kl.exports={supportsColor:qp,stdout:fs(ds(!0,Jl.isatty(1))),stderr:fs(ds(!0,Jl.isatty(2)))}});var tu=Xe((be,hi)=>{var Zp=require("tty"),di=require("util");be.init=ng;be.log=Xp;be.formatArgs=Jp;be.save=eg;be.load=tg;be.useColors=Qp;be.destroy=di.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");be.colors=[6,2,3,4,5,1];try{let e=Xl();e&&(e.stderr||e).level>=2&&(be.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221])}catch{}be.inspectOpts=Object.keys(process.env).filter(e=>/^debug_/i.test(e)).reduce((e,t)=>{let n=t.substring(6).toLowerCase().replace(/_([a-z])/g,(o,s)=>s.toUpperCase()),i=process.env[t];return/^(yes|on|true|enabled)$/i.test(i)?i=!0:/^(no|off|false|disabled)$/i.test(i)?i=!1:i==="null"?i=null:i=Number(i),e[n]=i,e},{});function Qp(){return"colors"in be.inspectOpts?!!be.inspectOpts.colors:Zp.isatty(process.stderr.fd)}function Jp(e){let{namespace:t,useColors:n}=this;if(n){let i=this.color,o="\x1B[3"+(i<8?i:"8;5;"+i),s=` ${o};1m${t} \x1B[0m`;e[0]=s+e[0].split(` -`).join(` -`+s),e.push(o+"m+"+hi.exports.humanize(this.diff)+"\x1B[0m")}else e[0]=Kp()+t+" "+e[0]}function Kp(){return be.inspectOpts.hideDate?"":new Date().toISOString()+" "}function Xp(...e){return process.stderr.write(di.formatWithOptions(be.inspectOpts,...e)+` -`)}function eg(e){e?process.env.DEBUG=e:delete process.env.DEBUG}function tg(){return process.env.DEBUG}function ng(e){e.inspectOpts={};let t=Object.keys(be.inspectOpts);for(let n=0;nt.trim()).join(" ")};eu.O=function(e){return this.inspectOpts.colors=this.useColors,di.inspect(e,this.inspectOpts)}});var nu=Xe((Ny,hs)=>{typeof process>"u"||process.type==="renderer"||process.browser===!0||process.__nwjs?hs.exports=ql():hs.exports=tu()});var gu=Xe((xi,pu)=>{(function(e,t){typeof xi=="object"&&typeof pu<"u"?t(xi):typeof define=="function"&&define.amd?define(["exports"],t):(e=typeof globalThis<"u"?globalThis:e||self,t(e.compareVersions={}))})(xi,function(e){"use strict";let t=/^[v^~<>=]*?(\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+)(?:\.([x*]|\d+))?(?:-([\da-z\-]+(?:\.[\da-z\-]+)*))?(?:\+[\da-z\-]+(?:\.[\da-z\-]+)*)?)?)?$/i,n=T=>{if(typeof T!="string")throw new TypeError("Invalid argument expected string");let C=T.match(t);if(!C)throw new Error(`Invalid argument not valid semver ('${T}' received)`);return C.shift(),C},i=T=>T==="*"||T==="x"||T==="X",o=T=>{let C=parseInt(T,10);return isNaN(C)?T:C},s=(T,C)=>typeof T!=typeof C?[String(T),String(C)]:[T,C],l=(T,C)=>{if(i(T)||i(C))return 0;let[A,P]=s(o(T),o(C));return A>P?1:A{for(let A=0;A{let A=n(T),P=n(C),Y=A.pop(),B=P.pop(),_=u(A,P);return _!==0?_:Y&&B?u(Y.split("."),B.split(".")):Y||B?Y?-1:1:0},m=(T,C,A)=>{w(A);let P=f(T,C);return h[A].includes(P)},h={">":[1],">=":[0,1],"=":[0],"<=":[-1,0],"<":[-1],"!=":[-1,1]},p=Object.keys(h),w=T=>{if(typeof T!="string")throw new TypeError(`Invalid operator type, expected string but got ${typeof T}`);if(p.indexOf(T)===-1)throw new Error(`Invalid operator, expected one of ${p.join("|")}`)},k=(T,C)=>{if(C=C.replace(/([><=]+)\s+/g,"$1"),C.includes("||"))return C.split("||").some(ee=>k(T,ee));if(C.includes(" - ")){let[ee,ue]=C.split(" - ",2);return k(T,`>=${ee} <=${ue}`)}else if(C.includes(" "))return C.trim().replace(/\s{2,}/g," ").split(" ").every(ee=>k(T,ee));let A=C.match(/^([<>=~^]+)/),P=A?A[1]:"=";if(P!=="^"&&P!=="~")return m(T,C,P);let[Y,B,_,,J]=n(T),[j,G,ne,,oe]=n(C),X=[Y,B,_],N=[j,G??"x",ne??"x"];if(oe&&(!J||u(X,N)!==0||u(J.split("."),oe.split("."))===-1))return!1;let H=N.findIndex(ee=>ee!=="0")+1,W=P==="~"?2:H>1?H:1;return!(u(X.slice(0,W),N.slice(0,W))!==0||u(X.slice(W),N.slice(W))===-1)},v=T=>typeof T=="string"&&/^[v\d]/.test(T)&&t.test(T),F=T=>typeof T=="string"&&/^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$/.test(T);e.compare=m,e.compareVersions=f,e.satisfies=k,e.validate=v,e.validateStrict=F})});var jc=Xe((L1,$c)=>{"use strict";var $i=Object.prototype.hasOwnProperty,Vc=Object.prototype.toString,Yc=Object.defineProperty,Wc=Object.getOwnPropertyDescriptor,zc=function(t){return typeof Array.isArray=="function"?Array.isArray(t):Vc.call(t)==="[object Array]"},Bc=function(t){if(!t||Vc.call(t)!=="[object Object]")return!1;var n=$i.call(t,"constructor"),i=t.constructor&&t.constructor.prototype&&$i.call(t.constructor.prototype,"isPrototypeOf");if(t.constructor&&!n&&!i)return!1;var o;for(o in t);return typeof o>"u"||$i.call(t,o)},Hc=function(t,n){Yc&&n.name==="__proto__"?Yc(t,n.name,{enumerable:!0,configurable:!0,value:n.newValue,writable:!0}):t[n.name]=n.newValue},Uc=function(t,n){if(n==="__proto__")if($i.call(t,n)){if(Wc)return Wc(t,n).value}else return;return t[n]};$c.exports=function e(){var t,n,i,o,s,l,u=arguments[0],f=1,m=arguments.length,h=!1;for(typeof u=="boolean"&&(h=u,u=arguments[1]||{},f=2),(u==null||typeof u!="object"&&typeof u!="function")&&(u={});f{(function(e,t){typeof Pa=="object"&&typeof er<"u"?er.exports=t():typeof define=="function"&&define.amd?define(t):e.moment=t()})(Pa,function(){"use strict";var e;function t(){return e.apply(null,arguments)}function n(r){e=r}function i(r){return r instanceof Array||Object.prototype.toString.call(r)==="[object Array]"}function o(r){return r!=null&&Object.prototype.toString.call(r)==="[object Object]"}function s(r,a){return Object.prototype.hasOwnProperty.call(r,a)}function l(r){if(Object.getOwnPropertyNames)return Object.getOwnPropertyNames(r).length===0;var a;for(a in r)if(s(r,a))return!1;return!0}function u(r){return r===void 0}function f(r){return typeof r=="number"||Object.prototype.toString.call(r)==="[object Number]"}function m(r){return r instanceof Date||Object.prototype.toString.call(r)==="[object Date]"}function h(r,a){var c=[],d,g=r.length;for(d=0;d>>0,d;for(d=0;d0)for(c=0;c=0;return(x?c?"+":"":"-")+Math.pow(10,Math.max(0,g)).toString().substr(1)+d}var ze=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|N{1,5}|YYYYYY|YYYYY|YYYY|YY|y{2,4}|yo?|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,b=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,Se={},_e={};function y(r,a,c,d){var g=d;typeof d=="string"&&(g=function(){return this[d]()}),r&&(_e[r]=g),a&&(_e[a[0]]=function(){return fe(g.apply(this,arguments),a[1],a[2])}),c&&(_e[c]=function(){return this.localeData().ordinal(g.apply(this,arguments),r)})}function Pe(r){return r.match(/\[[\s\S]/)?r.replace(/^\[|\]$/g,""):r.replace(/\\/g,"")}function Ct(r){var a=r.match(ze),c,d;for(c=0,d=a.length;c=0&&b.test(r);)r=r.replace(b,d),b.lastIndex=0,c-=1;return r}var pe={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"};function nn(r){var a=this._longDateFormat[r],c=this._longDateFormat[r.toUpperCase()];return a||!c?a:(this._longDateFormat[r]=c.match(ze).map(function(d){return d==="MMMM"||d==="MM"||d==="DD"||d==="dddd"?d.slice(1):d}).join(""),this._longDateFormat[r])}var st="Invalid date";function St(){return this._invalidDate}var zt="%d",tr=/\d{1,2}/;function Do(r){return this._ordinal.replace("%d",r)}var Yr={future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",w:"a week",ww:"%d weeks",M:"a month",MM:"%d months",y:"a year",yy:"%d years"};function Wr(r,a,c,d){var g=this._relativeTime[c];return oe(g)?g(r,a,c,d):g.replace(/%d/i,r)}function zr(r,a){var c=this._relativeTime[r>0?"future":"past"];return oe(c)?c(a):c.replace(/%s/i,a)}var Br={D:"date",dates:"date",date:"date",d:"day",days:"day",day:"day",e:"weekday",weekdays:"weekday",weekday:"weekday",E:"isoWeekday",isoweekdays:"isoWeekday",isoweekday:"isoWeekday",DDD:"dayOfYear",dayofyears:"dayOfYear",dayofyear:"dayOfYear",h:"hour",hours:"hour",hour:"hour",ms:"millisecond",milliseconds:"millisecond",millisecond:"millisecond",m:"minute",minutes:"minute",minute:"minute",M:"month",months:"month",month:"month",Q:"quarter",quarters:"quarter",quarter:"quarter",s:"second",seconds:"second",second:"second",gg:"weekYear",weekyears:"weekYear",weekyear:"weekYear",GG:"isoWeekYear",isoweekyears:"isoWeekYear",isoweekyear:"isoWeekYear",w:"week",weeks:"week",week:"week",W:"isoWeek",isoweeks:"isoWeek",isoweek:"isoWeek",y:"year",years:"year",year:"year"};function Me(r){return typeof r=="string"?Br[r]||Br[r.toLowerCase()]:void 0}function Cn(r){var a={},c,d;for(d in r)s(r,d)&&(c=Me(d),c&&(a[c]=r[d]));return a}var Ro={date:9,day:11,weekday:11,isoWeekday:11,dayOfYear:4,hour:13,millisecond:16,minute:14,month:8,quarter:7,second:15,weekYear:1,isoWeekYear:1,week:5,isoWeek:5,year:1};function No(r){var a=[],c;for(c in r)s(r,c)&&a.push({unit:c,priority:Ro[c]});return a.sort(function(d,g){return d.priority-g.priority}),a}var Hr=/\d/,Ie=/\d\d/,Ur=/\d{3}/,E=/\d{4}/,I=/[+-]?\d{6}/,L=/\d\d?/,q=/\d\d\d\d?/,re=/\d\d\d\d\d\d?/,Ee=/\d{1,3}/,at=/\d{1,4}/,Be=/[+-]?\d{1,6}/,Je=/\d+/,pt=/[+-]?\d+/,Le=/Z|[+-]\d\d:?\d\d/gi,lt=/Z|[+-]\d\d(?::?\d\d)?/gi,ut=/[+-]?\d+(\.\d{1,3})?/,nr=/[0-9]{0,256}['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFF07\uFF10-\uFFEF]{1,256}|[\u0600-\u06FF\/]{1,256}(\s*?[\u0600-\u06FF]{1,256}){1,2}/i,Sn=/^[1-9]\d?/,Yo=/^([1-9]\d|\d)/,Vr;Vr={};function D(r,a,c){Vr[r]=oe(a)?a:function(d,g){return d&&c?c:a}}function Rf(r,a){return s(Vr,r)?Vr[r](a._strict,a._locale):new RegExp(Nf(r))}function Nf(r){return _t(r.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(a,c,d,g,x){return c||d||g||x}))}function _t(r){return r.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}function Ke(r){return r<0?Math.ceil(r)||0:Math.floor(r)}function Z(r){var a=+r,c=0;return a!==0&&isFinite(a)&&(c=Ke(a)),c}var Wo={};function ie(r,a){var c,d=a,g;for(typeof r=="string"&&(r=[r]),f(a)&&(d=function(x,S){S[a]=Z(x)}),g=r.length,c=0;c68?1900:2e3)};var Ra=_n("FullYear",!0);function Bf(){return $r(this.year())}function _n(r,a){return function(c){return c!=null?(Na(this,r,c),t.updateOffset(this,a),this):or(this,r)}}function or(r,a){if(!r.isValid())return NaN;var c=r._d,d=r._isUTC;switch(a){case"Milliseconds":return d?c.getUTCMilliseconds():c.getMilliseconds();case"Seconds":return d?c.getUTCSeconds():c.getSeconds();case"Minutes":return d?c.getUTCMinutes():c.getMinutes();case"Hours":return d?c.getUTCHours():c.getHours();case"Date":return d?c.getUTCDate():c.getDate();case"Day":return d?c.getUTCDay():c.getDay();case"Month":return d?c.getUTCMonth():c.getMonth();case"FullYear":return d?c.getUTCFullYear():c.getFullYear();default:return NaN}}function Na(r,a,c){var d,g,x,S,O;if(!(!r.isValid()||isNaN(c))){switch(d=r._d,g=r._isUTC,a){case"Milliseconds":return void(g?d.setUTCMilliseconds(c):d.setMilliseconds(c));case"Seconds":return void(g?d.setUTCSeconds(c):d.setSeconds(c));case"Minutes":return void(g?d.setUTCMinutes(c):d.setMinutes(c));case"Hours":return void(g?d.setUTCHours(c):d.setHours(c));case"Date":return void(g?d.setUTCDate(c):d.setDate(c));case"FullYear":break;default:return}x=c,S=r.month(),O=r.date(),O=O===29&&S===1&&!$r(x)?28:O,g?d.setUTCFullYear(x,S,O):d.setFullYear(x,S,O)}}function Hf(r){return r=Me(r),oe(this[r])?this[r]():this}function Uf(r,a){if(typeof r=="object"){r=Cn(r);var c=No(r),d,g=c.length;for(d=0;d=0?(O=new Date(r+400,a,c,d,g,x,S),isFinite(O.getFullYear())&&O.setFullYear(r)):O=new Date(r,a,c,d,g,x,S),O}function sr(r){var a,c;return r<100&&r>=0?(c=Array.prototype.slice.call(arguments),c[0]=r+400,a=new Date(Date.UTC.apply(null,c)),isFinite(a.getUTCFullYear())&&a.setUTCFullYear(r)):a=new Date(Date.UTC.apply(null,arguments)),a}function jr(r,a,c){var d=7+a-c,g=(7+sr(r,0,d).getUTCDay()-a)%7;return-g+d-1}function Ua(r,a,c,d,g){var x=(7+c-d)%7,S=jr(r,d,g),O=1+7*(a-1)+x+S,z,Q;return O<=0?(z=r-1,Q=ir(z)+O):O>ir(r)?(z=r+1,Q=O-ir(r)):(z=r,Q=O),{year:z,dayOfYear:Q}}function ar(r,a,c){var d=jr(r.year(),a,c),g=Math.floor((r.dayOfYear()-d-1)/7)+1,x,S;return g<1?(S=r.year()-1,x=g+At(S,a,c)):g>At(r.year(),a,c)?(x=g-At(r.year(),a,c),S=r.year()+1):(S=r.year(),x=g),{week:x,year:S}}function At(r,a,c){var d=jr(r,a,c),g=jr(r+1,a,c);return(ir(r)-d+g)/7}y("w",["ww",2],"wo","week"),y("W",["WW",2],"Wo","isoWeek"),D("w",L,Sn),D("ww",L,Ie),D("W",L,Sn),D("WW",L,Ie),rr(["w","ww","W","WW"],function(r,a,c,d){a[d.substr(0,1)]=Z(r)});function nd(r){return ar(r,this._week.dow,this._week.doy).week}var rd={dow:0,doy:6};function id(){return this._week.dow}function od(){return this._week.doy}function sd(r){var a=this.localeData().week(this);return r==null?a:this.add((r-a)*7,"d")}function ad(r){var a=ar(this,1,4).week;return r==null?a:this.add((r-a)*7,"d")}y("d",0,"do","day"),y("dd",0,0,function(r){return this.localeData().weekdaysMin(this,r)}),y("ddd",0,0,function(r){return this.localeData().weekdaysShort(this,r)}),y("dddd",0,0,function(r){return this.localeData().weekdays(this,r)}),y("e",0,0,"weekday"),y("E",0,0,"isoWeekday"),D("d",L),D("e",L),D("E",L),D("dd",function(r,a){return a.weekdaysMinRegex(r)}),D("ddd",function(r,a){return a.weekdaysShortRegex(r)}),D("dddd",function(r,a){return a.weekdaysRegex(r)}),rr(["dd","ddd","dddd"],function(r,a,c,d){var g=c._locale.weekdaysParse(r,d,c._strict);g!=null?a.d=g:v(c).invalidWeekday=r}),rr(["d","e","E"],function(r,a,c,d){a[d]=Z(r)});function ld(r,a){return typeof r!="string"?r:isNaN(r)?(r=a.weekdaysParse(r),typeof r=="number"?r:null):parseInt(r,10)}function ud(r,a){return typeof r=="string"?a.weekdaysParse(r)%7||7:isNaN(r)?null:r}function Bo(r,a){return r.slice(a,7).concat(r.slice(0,a))}var cd="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),Va="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),fd="Su_Mo_Tu_We_Th_Fr_Sa".split("_"),dd=nr,hd=nr,md=nr;function pd(r,a){var c=i(this._weekdays)?this._weekdays:this._weekdays[r&&r!==!0&&this._weekdays.isFormat.test(a)?"format":"standalone"];return r===!0?Bo(c,this._week.dow):r?c[r.day()]:c}function gd(r){return r===!0?Bo(this._weekdaysShort,this._week.dow):r?this._weekdaysShort[r.day()]:this._weekdaysShort}function wd(r){return r===!0?Bo(this._weekdaysMin,this._week.dow):r?this._weekdaysMin[r.day()]:this._weekdaysMin}function kd(r,a,c){var d,g,x,S=r.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],d=0;d<7;++d)x=w([2e3,1]).day(d),this._minWeekdaysParse[d]=this.weekdaysMin(x,"").toLocaleLowerCase(),this._shortWeekdaysParse[d]=this.weekdaysShort(x,"").toLocaleLowerCase(),this._weekdaysParse[d]=this.weekdays(x,"").toLocaleLowerCase();return c?a==="dddd"?(g=de.call(this._weekdaysParse,S),g!==-1?g:null):a==="ddd"?(g=de.call(this._shortWeekdaysParse,S),g!==-1?g:null):(g=de.call(this._minWeekdaysParse,S),g!==-1?g:null):a==="dddd"?(g=de.call(this._weekdaysParse,S),g!==-1||(g=de.call(this._shortWeekdaysParse,S),g!==-1)?g:(g=de.call(this._minWeekdaysParse,S),g!==-1?g:null)):a==="ddd"?(g=de.call(this._shortWeekdaysParse,S),g!==-1||(g=de.call(this._weekdaysParse,S),g!==-1)?g:(g=de.call(this._minWeekdaysParse,S),g!==-1?g:null)):(g=de.call(this._minWeekdaysParse,S),g!==-1||(g=de.call(this._weekdaysParse,S),g!==-1)?g:(g=de.call(this._shortWeekdaysParse,S),g!==-1?g:null))}function yd(r,a,c){var d,g,x;if(this._weekdaysParseExact)return kd.call(this,r,a,c);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),d=0;d<7;d++){if(g=w([2e3,1]).day(d),c&&!this._fullWeekdaysParse[d]&&(this._fullWeekdaysParse[d]=new RegExp("^"+this.weekdays(g,"").replace(".","\\.?")+"$","i"),this._shortWeekdaysParse[d]=new RegExp("^"+this.weekdaysShort(g,"").replace(".","\\.?")+"$","i"),this._minWeekdaysParse[d]=new RegExp("^"+this.weekdaysMin(g,"").replace(".","\\.?")+"$","i")),this._weekdaysParse[d]||(x="^"+this.weekdays(g,"")+"|^"+this.weekdaysShort(g,"")+"|^"+this.weekdaysMin(g,""),this._weekdaysParse[d]=new RegExp(x.replace(".",""),"i")),c&&a==="dddd"&&this._fullWeekdaysParse[d].test(r))return d;if(c&&a==="ddd"&&this._shortWeekdaysParse[d].test(r))return d;if(c&&a==="dd"&&this._minWeekdaysParse[d].test(r))return d;if(!c&&this._weekdaysParse[d].test(r))return d}}function xd(r){if(!this.isValid())return r!=null?this:NaN;var a=or(this,"Day");return r!=null?(r=ld(r,this.localeData()),this.add(r-a,"d")):a}function bd(r){if(!this.isValid())return r!=null?this:NaN;var a=(this.day()+7-this.localeData()._week.dow)%7;return r==null?a:this.add(r-a,"d")}function vd(r){if(!this.isValid())return r!=null?this:NaN;if(r!=null){var a=ud(r,this.localeData());return this.day(this.day()%7?a:a-7)}else return this.day()||7}function Cd(r){return this._weekdaysParseExact?(s(this,"_weekdaysRegex")||Ho.call(this),r?this._weekdaysStrictRegex:this._weekdaysRegex):(s(this,"_weekdaysRegex")||(this._weekdaysRegex=dd),this._weekdaysStrictRegex&&r?this._weekdaysStrictRegex:this._weekdaysRegex)}function Sd(r){return this._weekdaysParseExact?(s(this,"_weekdaysRegex")||Ho.call(this),r?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(s(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=hd),this._weekdaysShortStrictRegex&&r?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)}function _d(r){return this._weekdaysParseExact?(s(this,"_weekdaysRegex")||Ho.call(this),r?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(s(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=md),this._weekdaysMinStrictRegex&&r?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)}function Ho(){function r(Oe,Lt){return Lt.length-Oe.length}var a=[],c=[],d=[],g=[],x,S,O,z,Q;for(x=0;x<7;x++)S=w([2e3,1]).day(x),O=_t(this.weekdaysMin(S,"")),z=_t(this.weekdaysShort(S,"")),Q=_t(this.weekdays(S,"")),a.push(O),c.push(z),d.push(Q),g.push(O),g.push(z),g.push(Q);a.sort(r),c.sort(r),d.sort(r),g.sort(r),this._weekdaysRegex=new RegExp("^("+g.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+d.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+c.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+a.join("|")+")","i")}function Uo(){return this.hours()%12||12}function Ed(){return this.hours()||24}y("H",["HH",2],0,"hour"),y("h",["hh",2],0,Uo),y("k",["kk",2],0,Ed),y("hmm",0,0,function(){return""+Uo.apply(this)+fe(this.minutes(),2)}),y("hmmss",0,0,function(){return""+Uo.apply(this)+fe(this.minutes(),2)+fe(this.seconds(),2)}),y("Hmm",0,0,function(){return""+this.hours()+fe(this.minutes(),2)}),y("Hmmss",0,0,function(){return""+this.hours()+fe(this.minutes(),2)+fe(this.seconds(),2)});function $a(r,a){y(r,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),a)})}$a("a",!0),$a("A",!1);function ja(r,a){return a._meridiemParse}D("a",ja),D("A",ja),D("H",L,Yo),D("h",L,Sn),D("k",L,Sn),D("HH",L,Ie),D("hh",L,Ie),D("kk",L,Ie),D("hmm",q),D("hmmss",re),D("Hmm",q),D("Hmmss",re),ie(["H","HH"],ge),ie(["k","kk"],function(r,a,c){var d=Z(r);a[ge]=d===24?0:d}),ie(["a","A"],function(r,a,c){c._isPm=c._locale.isPM(r),c._meridiem=r}),ie(["h","hh"],function(r,a,c){a[ge]=Z(r),v(c).bigHour=!0}),ie("hmm",function(r,a,c){var d=r.length-2;a[ge]=Z(r.substr(0,d)),a[ct]=Z(r.substr(d)),v(c).bigHour=!0}),ie("hmmss",function(r,a,c){var d=r.length-4,g=r.length-2;a[ge]=Z(r.substr(0,d)),a[ct]=Z(r.substr(d,2)),a[Tt]=Z(r.substr(g)),v(c).bigHour=!0}),ie("Hmm",function(r,a,c){var d=r.length-2;a[ge]=Z(r.substr(0,d)),a[ct]=Z(r.substr(d))}),ie("Hmmss",function(r,a,c){var d=r.length-4,g=r.length-2;a[ge]=Z(r.substr(0,d)),a[ct]=Z(r.substr(d,2)),a[Tt]=Z(r.substr(g))});function Td(r){return(r+"").toLowerCase().charAt(0)==="p"}var Ad=/[ap]\.?m?\.?/i,Fd=_n("Hours",!0);function Pd(r,a,c){return r>11?c?"pm":"PM":c?"am":"AM"}var Ga={calendar:ee,longDateFormat:pe,invalidDate:st,ordinal:zt,dayOfMonthOrdinalParse:tr,relativeTime:Yr,months:$f,monthsShort:Ya,week:rd,weekdays:cd,weekdaysMin:fd,weekdaysShort:Va,meridiemParse:Ad},le={},lr={},ur;function Md(r,a){var c,d=Math.min(r.length,a.length);for(c=0;c0;){if(g=Gr(x.slice(0,c).join("-")),g)return g;if(d&&d.length>=c&&Md(x,d)>=c-1)break;c--}a++}return ur}function Ld(r){return!!(r&&r.match("^[^/\\\\]*$"))}function Gr(r){var a=null,c;if(le[r]===void 0&&typeof er<"u"&&er&&er.exports&&Ld(r))try{a=ur._abbr,c=require,c("./locale/"+r),Bt(a)}catch{le[r]=null}return le[r]}function Bt(r,a){var c;return r&&(u(a)?c=Ft(r):c=Vo(r,a),c?ur=c:typeof console<"u"&&console.warn&&console.warn("Locale "+r+" not found. Did you forget to load it?")),ur._abbr}function Vo(r,a){if(a!==null){var c,d=Ga;if(a.abbr=r,le[r]!=null)ne("defineLocaleOverride","use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale See http://momentjs.com/guides/#/warnings/define-locale/ for more info."),d=le[r]._config;else if(a.parentLocale!=null)if(le[a.parentLocale]!=null)d=le[a.parentLocale]._config;else if(c=Gr(a.parentLocale),c!=null)d=c._config;else return lr[a.parentLocale]||(lr[a.parentLocale]=[]),lr[a.parentLocale].push({name:r,config:a}),null;return le[r]=new H(N(d,a)),lr[r]&&lr[r].forEach(function(g){Vo(g.name,g.config)}),Bt(r),le[r]}else return delete le[r],null}function Od(r,a){if(a!=null){var c,d,g=Ga;le[r]!=null&&le[r].parentLocale!=null?le[r].set(N(le[r]._config,a)):(d=Gr(r),d!=null&&(g=d._config),a=N(g,a),d==null&&(a.abbr=r),c=new H(a),c.parentLocale=le[r],le[r]=c),Bt(r)}else le[r]!=null&&(le[r].parentLocale!=null?(le[r]=le[r].parentLocale,r===Bt()&&Bt(r)):le[r]!=null&&delete le[r]);return le[r]}function Ft(r){var a;if(r&&r._locale&&r._locale._abbr&&(r=r._locale._abbr),!r)return ur;if(!i(r)){if(a=Gr(r),a)return a;r=[r]}return Id(r)}function Dd(){return W(le)}function $o(r){var a,c=r._a;return c&&v(r).overflow===-2&&(a=c[Et]<0||c[Et]>11?Et:c[gt]<1||c[gt]>zo(c[Te],c[Et])?gt:c[ge]<0||c[ge]>24||c[ge]===24&&(c[ct]!==0||c[Tt]!==0||c[rn]!==0)?ge:c[ct]<0||c[ct]>59?ct:c[Tt]<0||c[Tt]>59?Tt:c[rn]<0||c[rn]>999?rn:-1,v(r)._overflowDayOfYear&&(agt)&&(a=gt),v(r)._overflowWeeks&&a===-1&&(a=Wf),v(r)._overflowWeekday&&a===-1&&(a=zf),v(r).overflow=a),r}var Rd=/^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,Nd=/^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d|))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,Yd=/Z|[+-]\d\d(?::?\d\d)?/,qr=[["YYYYYY-MM-DD",/[+-]\d{6}-\d\d-\d\d/],["YYYY-MM-DD",/\d{4}-\d\d-\d\d/],["GGGG-[W]WW-E",/\d{4}-W\d\d-\d/],["GGGG-[W]WW",/\d{4}-W\d\d/,!1],["YYYY-DDD",/\d{4}-\d{3}/],["YYYY-MM",/\d{4}-\d\d/,!1],["YYYYYYMMDD",/[+-]\d{10}/],["YYYYMMDD",/\d{8}/],["GGGG[W]WWE",/\d{4}W\d{3}/],["GGGG[W]WW",/\d{4}W\d{2}/,!1],["YYYYDDD",/\d{7}/],["YYYYMM",/\d{6}/,!1],["YYYY",/\d{4}/,!1]],jo=[["HH:mm:ss.SSSS",/\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss,SSSS",/\d\d:\d\d:\d\d,\d+/],["HH:mm:ss",/\d\d:\d\d:\d\d/],["HH:mm",/\d\d:\d\d/],["HHmmss.SSSS",/\d\d\d\d\d\d\.\d+/],["HHmmss,SSSS",/\d\d\d\d\d\d,\d+/],["HHmmss",/\d\d\d\d\d\d/],["HHmm",/\d\d\d\d/],["HH",/\d\d/]],Wd=/^\/?Date\((-?\d+)/i,zd=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|([+-]\d{4}))$/,Bd={UT:0,GMT:0,EDT:-4*60,EST:-5*60,CDT:-5*60,CST:-6*60,MDT:-6*60,MST:-7*60,PDT:-7*60,PST:-8*60};function Za(r){var a,c,d=r._i,g=Rd.exec(d)||Nd.exec(d),x,S,O,z,Q=qr.length,Oe=jo.length;if(g){for(v(r).iso=!0,a=0,c=Q;air(S)||r._dayOfYear===0)&&(v(r)._overflowDayOfYear=!0),c=sr(S,0,r._dayOfYear),r._a[Et]=c.getUTCMonth(),r._a[gt]=c.getUTCDate()),a=0;a<3&&r._a[a]==null;++a)r._a[a]=d[a]=g[a];for(;a<7;a++)r._a[a]=d[a]=r._a[a]==null?a===2?1:0:r._a[a];r._a[ge]===24&&r._a[ct]===0&&r._a[Tt]===0&&r._a[rn]===0&&(r._nextDay=!0,r._a[ge]=0),r._d=(r._useUTC?sr:td).apply(null,d),x=r._useUTC?r._d.getUTCDay():r._d.getDay(),r._tzm!=null&&r._d.setUTCMinutes(r._d.getUTCMinutes()-r._tzm),r._nextDay&&(r._a[ge]=24),r._w&&typeof r._w.d<"u"&&r._w.d!==x&&(v(r).weekdayMismatch=!0)}}function Zd(r){var a,c,d,g,x,S,O,z,Q;a=r._w,a.GG!=null||a.W!=null||a.E!=null?(x=1,S=4,c=En(a.GG,r._a[Te],ar(ae(),1,4).year),d=En(a.W,1),g=En(a.E,1),(g<1||g>7)&&(z=!0)):(x=r._locale._week.dow,S=r._locale._week.doy,Q=ar(ae(),x,S),c=En(a.gg,r._a[Te],Q.year),d=En(a.w,Q.week),a.d!=null?(g=a.d,(g<0||g>6)&&(z=!0)):a.e!=null?(g=a.e+x,(a.e<0||a.e>6)&&(z=!0)):g=x),d<1||d>At(c,x,S)?v(r)._overflowWeeks=!0:z!=null?v(r)._overflowWeekday=!0:(O=Ua(c,d,g,x,S),r._a[Te]=O.year,r._dayOfYear=O.dayOfYear)}t.ISO_8601=function(){},t.RFC_2822=function(){};function qo(r){if(r._f===t.ISO_8601){Za(r);return}if(r._f===t.RFC_2822){Qa(r);return}r._a=[],v(r).empty=!0;var a=""+r._i,c,d,g,x,S,O=a.length,z=0,Q,Oe;for(g=tn(r._f,r._locale).match(ze)||[],Oe=g.length,c=0;c0&&v(r).unusedInput.push(S),a=a.slice(a.indexOf(d)+d.length),z+=d.length),_e[x]?(d?v(r).empty=!1:v(r).unusedTokens.push(x),Yf(x,d,r)):r._strict&&!d&&v(r).unusedTokens.push(x);v(r).charsLeftOver=O-z,a.length>0&&v(r).unusedInput.push(a),r._a[ge]<=12&&v(r).bigHour===!0&&r._a[ge]>0&&(v(r).bigHour=void 0),v(r).parsedDateParts=r._a.slice(0),v(r).meridiem=r._meridiem,r._a[ge]=Qd(r._locale,r._a[ge],r._meridiem),Q=v(r).era,Q!==null&&(r._a[Te]=r._locale.erasConvertYear(Q,r._a[Te])),Go(r),$o(r)}function Qd(r,a,c){var d;return c==null?a:r.meridiemHour!=null?r.meridiemHour(a,c):(r.isPM!=null&&(d=r.isPM(c),d&&a<12&&(a+=12),!d&&a===12&&(a=0)),a)}function Jd(r){var a,c,d,g,x,S,O=!1,z=r._f.length;if(z===0){v(r).invalidFormat=!0,r._d=new Date(NaN);return}for(g=0;gthis?this:r:C()});function Xa(r,a){var c,d;if(a.length===1&&i(a[0])&&(a=a[0]),!a.length)return ae();for(c=a[0],d=1;dthis.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()}function kh(){if(!u(this._isDSTShifted))return this._isDSTShifted;var r={},a;return Y(r,this),r=Ja(r),r._a?(a=r._isUTC?w(r._a):ae(r._a),this._isDSTShifted=this.isValid()&&uh(r._a,a.toArray())>0):this._isDSTShifted=!1,this._isDSTShifted}function yh(){return this.isValid()?!this._isUTC:!1}function xh(){return this.isValid()?this._isUTC:!1}function tl(){return this.isValid()?this._isUTC&&this._offset===0:!1}var bh=/^(-|\+)?(?:(\d*)[. ])?(\d+):(\d+)(?::(\d+)(\.\d*)?)?$/,vh=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;function ft(r,a){var c=r,d=null,g,x,S;return Qr(r)?c={ms:r._milliseconds,d:r._days,M:r._months}:f(r)||!isNaN(+r)?(c={},a?c[a]=+r:c.milliseconds=+r):(d=bh.exec(r))?(g=d[1]==="-"?-1:1,c={y:0,d:Z(d[gt])*g,h:Z(d[ge])*g,m:Z(d[ct])*g,s:Z(d[Tt])*g,ms:Z(Zo(d[rn]*1e3))*g}):(d=vh.exec(r))?(g=d[1]==="-"?-1:1,c={y:on(d[2],g),M:on(d[3],g),w:on(d[4],g),d:on(d[5],g),h:on(d[6],g),m:on(d[7],g),s:on(d[8],g)}):c==null?c={}:typeof c=="object"&&("from"in c||"to"in c)&&(S=Ch(ae(c.from),ae(c.to)),c={},c.ms=S.milliseconds,c.M=S.months),x=new Zr(c),Qr(r)&&s(r,"_locale")&&(x._locale=r._locale),Qr(r)&&s(r,"_isValid")&&(x._isValid=r._isValid),x}ft.fn=Zr.prototype,ft.invalid=lh;function on(r,a){var c=r&&parseFloat(r.replace(",","."));return(isNaN(c)?0:c)*a}function nl(r,a){var c={};return c.months=a.month()-r.month()+(a.year()-r.year())*12,r.clone().add(c.months,"M").isAfter(a)&&--c.months,c.milliseconds=+a-+r.clone().add(c.months,"M"),c}function Ch(r,a){var c;return r.isValid()&&a.isValid()?(a=Jo(a,r),r.isBefore(a)?c=nl(r,a):(c=nl(a,r),c.milliseconds=-c.milliseconds,c.months=-c.months),c):{milliseconds:0,months:0}}function rl(r,a){return function(c,d){var g,x;return d!==null&&!isNaN(+d)&&(ne(a,"moment()."+a+"(period, number) is deprecated. Please use moment()."+a+"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info."),x=c,c=d,d=x),g=ft(c,d),il(this,g,r),this}}function il(r,a,c,d){var g=a._milliseconds,x=Zo(a._days),S=Zo(a._months);r.isValid()&&(d=d??!0,S&&za(r,or(r,"Month")+S*c),x&&Na(r,"Date",or(r,"Date")+x*c),g&&r._d.setTime(r._d.valueOf()+g*c),d&&t.updateOffset(r,x||S))}var Sh=rl(1,"add"),_h=rl(-1,"subtract");function ol(r){return typeof r=="string"||r instanceof String}function Eh(r){return _(r)||m(r)||ol(r)||f(r)||Ah(r)||Th(r)||r===null||r===void 0}function Th(r){var a=o(r)&&!l(r),c=!1,d=["years","year","y","months","month","M","days","day","d","dates","date","D","hours","hour","h","minutes","minute","m","seconds","second","s","milliseconds","millisecond","ms"],g,x,S=d.length;for(g=0;gc.valueOf():c.valueOf()9999?Wt(c,a?"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYYYY-MM-DD[T]HH:mm:ss.SSSZ"):oe(Date.prototype.toISOString)?a?this.toDate().toISOString():new Date(this.valueOf()+this.utcOffset()*60*1e3).toISOString().replace("Z",Wt(c,"Z")):Wt(c,a?"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYY-MM-DD[T]HH:mm:ss.SSSZ")}function Hh(){if(!this.isValid())return"moment.invalid(/* "+this._i+" */)";var r="moment",a="",c,d,g,x;return this.isLocal()||(r=this.utcOffset()===0?"moment.utc":"moment.parseZone",a="Z"),c="["+r+'("]',d=0<=this.year()&&this.year()<=9999?"YYYY":"YYYYYY",g="-MM-DD[T]HH:mm:ss.SSS",x=a+'[")]',this.format(c+d+g+x)}function Uh(r){r||(r=this.isUtc()?t.defaultFormatUtc:t.defaultFormat);var a=Wt(this,r);return this.localeData().postformat(a)}function Vh(r,a){return this.isValid()&&(_(r)&&r.isValid()||ae(r).isValid())?ft({to:this,from:r}).locale(this.locale()).humanize(!a):this.localeData().invalidDate()}function $h(r){return this.from(ae(),r)}function jh(r,a){return this.isValid()&&(_(r)&&r.isValid()||ae(r).isValid())?ft({from:this,to:r}).locale(this.locale()).humanize(!a):this.localeData().invalidDate()}function Gh(r){return this.to(ae(),r)}function sl(r){var a;return r===void 0?this._locale._abbr:(a=Ft(r),a!=null&&(this._locale=a),this)}var al=j("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",function(r){return r===void 0?this.localeData():this.locale(r)});function ll(){return this._locale}var Kr=1e3,Tn=60*Kr,Xr=60*Tn,ul=(365*400+97)*24*Xr;function An(r,a){return(r%a+a)%a}function cl(r,a,c){return r<100&&r>=0?new Date(r+400,a,c)-ul:new Date(r,a,c).valueOf()}function fl(r,a,c){return r<100&&r>=0?Date.UTC(r+400,a,c)-ul:Date.UTC(r,a,c)}function qh(r){var a,c;if(r=Me(r),r===void 0||r==="millisecond"||!this.isValid())return this;switch(c=this._isUTC?fl:cl,r){case"year":a=c(this.year(),0,1);break;case"quarter":a=c(this.year(),this.month()-this.month()%3,1);break;case"month":a=c(this.year(),this.month(),1);break;case"week":a=c(this.year(),this.month(),this.date()-this.weekday());break;case"isoWeek":a=c(this.year(),this.month(),this.date()-(this.isoWeekday()-1));break;case"day":case"date":a=c(this.year(),this.month(),this.date());break;case"hour":a=this._d.valueOf(),a-=An(a+(this._isUTC?0:this.utcOffset()*Tn),Xr);break;case"minute":a=this._d.valueOf(),a-=An(a,Tn);break;case"second":a=this._d.valueOf(),a-=An(a,Kr);break}return this._d.setTime(a),t.updateOffset(this,!0),this}function Zh(r){var a,c;if(r=Me(r),r===void 0||r==="millisecond"||!this.isValid())return this;switch(c=this._isUTC?fl:cl,r){case"year":a=c(this.year()+1,0,1)-1;break;case"quarter":a=c(this.year(),this.month()-this.month()%3+3,1)-1;break;case"month":a=c(this.year(),this.month()+1,1)-1;break;case"week":a=c(this.year(),this.month(),this.date()-this.weekday()+7)-1;break;case"isoWeek":a=c(this.year(),this.month(),this.date()-(this.isoWeekday()-1)+7)-1;break;case"day":case"date":a=c(this.year(),this.month(),this.date()+1)-1;break;case"hour":a=this._d.valueOf(),a+=Xr-An(a+(this._isUTC?0:this.utcOffset()*Tn),Xr)-1;break;case"minute":a=this._d.valueOf(),a+=Tn-An(a,Tn)-1;break;case"second":a=this._d.valueOf(),a+=Kr-An(a,Kr)-1;break}return this._d.setTime(a),t.updateOffset(this,!0),this}function Qh(){return this._d.valueOf()-(this._offset||0)*6e4}function Jh(){return Math.floor(this.valueOf()/1e3)}function Kh(){return new Date(this.valueOf())}function Xh(){var r=this;return[r.year(),r.month(),r.date(),r.hour(),r.minute(),r.second(),r.millisecond()]}function em(){var r=this;return{years:r.year(),months:r.month(),date:r.date(),hours:r.hours(),minutes:r.minutes(),seconds:r.seconds(),milliseconds:r.milliseconds()}}function tm(){return this.isValid()?this.toISOString():null}function nm(){return T(this)}function rm(){return p({},v(this))}function im(){return v(this).overflow}function om(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}}y("N",0,0,"eraAbbr"),y("NN",0,0,"eraAbbr"),y("NNN",0,0,"eraAbbr"),y("NNNN",0,0,"eraName"),y("NNNNN",0,0,"eraNarrow"),y("y",["y",1],"yo","eraYear"),y("y",["yy",2],0,"eraYear"),y("y",["yyy",3],0,"eraYear"),y("y",["yyyy",4],0,"eraYear"),D("N",Xo),D("NN",Xo),D("NNN",Xo),D("NNNN",gm),D("NNNNN",wm),ie(["N","NN","NNN","NNNN","NNNNN"],function(r,a,c,d){var g=c._locale.erasParse(r,d,c._strict);g?v(c).era=g:v(c).invalidEra=r}),D("y",Je),D("yy",Je),D("yyy",Je),D("yyyy",Je),D("yo",km),ie(["y","yy","yyy","yyyy"],Te),ie(["yo"],function(r,a,c,d){var g;c._locale._eraYearOrdinalRegex&&(g=r.match(c._locale._eraYearOrdinalRegex)),c._locale.eraYearOrdinalParse?a[Te]=c._locale.eraYearOrdinalParse(r,g):a[Te]=parseInt(r,10)});function sm(r,a){var c,d,g,x=this._eras||Ft("en")._eras;for(c=0,d=x.length;c=0)return x[d]}function lm(r,a){var c=r.since<=r.until?1:-1;return a===void 0?t(r.since).year():t(r.since).year()+(a-r.offset)*c}function um(){var r,a,c,d=this.localeData().eras();for(r=0,a=d.length;rx&&(a=x),_m.call(this,r,a,c,d,g))}function _m(r,a,c,d,g){var x=Ua(r,a,c,d,g),S=sr(x.year,0,x.dayOfYear);return this.year(S.getUTCFullYear()),this.month(S.getUTCMonth()),this.date(S.getUTCDate()),this}y("Q",0,"Qo","quarter"),D("Q",Hr),ie("Q",function(r,a){a[Et]=(Z(r)-1)*3});function Em(r){return r==null?Math.ceil((this.month()+1)/3):this.month((r-1)*3+this.month()%3)}y("D",["DD",2],"Do","date"),D("D",L,Sn),D("DD",L,Ie),D("Do",function(r,a){return r?a._dayOfMonthOrdinalParse||a._ordinalParse:a._dayOfMonthOrdinalParseLenient}),ie(["D","DD"],gt),ie("Do",function(r,a){a[gt]=Z(r.match(L)[0])});var hl=_n("Date",!0);y("DDD",["DDDD",3],"DDDo","dayOfYear"),D("DDD",Ee),D("DDDD",Ur),ie(["DDD","DDDD"],function(r,a,c){c._dayOfYear=Z(r)});function Tm(r){var a=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return r==null?a:this.add(r-a,"d")}y("m",["mm",2],0,"minute"),D("m",L,Yo),D("mm",L,Ie),ie(["m","mm"],ct);var Am=_n("Minutes",!1);y("s",["ss",2],0,"second"),D("s",L,Yo),D("ss",L,Ie),ie(["s","ss"],Tt);var Fm=_n("Seconds",!1);y("S",0,0,function(){return~~(this.millisecond()/100)}),y(0,["SS",2],0,function(){return~~(this.millisecond()/10)}),y(0,["SSS",3],0,"millisecond"),y(0,["SSSS",4],0,function(){return this.millisecond()*10}),y(0,["SSSSS",5],0,function(){return this.millisecond()*100}),y(0,["SSSSSS",6],0,function(){return this.millisecond()*1e3}),y(0,["SSSSSSS",7],0,function(){return this.millisecond()*1e4}),y(0,["SSSSSSSS",8],0,function(){return this.millisecond()*1e5}),y(0,["SSSSSSSSS",9],0,function(){return this.millisecond()*1e6}),D("S",Ee,Hr),D("SS",Ee,Ie),D("SSS",Ee,Ur);var Ht,ml;for(Ht="SSSS";Ht.length<=9;Ht+="S")D(Ht,Je);function Pm(r,a){a[rn]=Z(("0."+r)*1e3)}for(Ht="S";Ht.length<=9;Ht+="S")ie(Ht,Pm);ml=_n("Milliseconds",!1),y("z",0,0,"zoneAbbr"),y("zz",0,0,"zoneName");function Mm(){return this._isUTC?"UTC":""}function Im(){return this._isUTC?"Coordinated Universal Time":""}var M=B.prototype;M.add=Sh,M.calendar=Mh,M.clone=Ih,M.diff=Wh,M.endOf=Zh,M.format=Uh,M.from=Vh,M.fromNow=$h,M.to=jh,M.toNow=Gh,M.get=Hf,M.invalidAt=im,M.isAfter=Lh,M.isBefore=Oh,M.isBetween=Dh,M.isSame=Rh,M.isSameOrAfter=Nh,M.isSameOrBefore=Yh,M.isValid=nm,M.lang=al,M.locale=sl,M.localeData=ll,M.max=nh,M.min=th,M.parsingFlags=rm,M.set=Uf,M.startOf=qh,M.subtract=_h,M.toArray=Xh,M.toObject=em,M.toDate=Kh,M.toISOString=Bh,M.inspect=Hh,typeof Symbol<"u"&&Symbol.for!=null&&(M[Symbol.for("nodejs.util.inspect.custom")]=function(){return"Moment<"+this.format()+">"}),M.toJSON=tm,M.toString=zh,M.unix=Jh,M.valueOf=Qh,M.creationData=om,M.eraName=um,M.eraNarrow=cm,M.eraAbbr=fm,M.eraYear=dm,M.year=Ra,M.isLeapYear=Bf,M.weekYear=ym,M.isoWeekYear=xm,M.quarter=M.quarters=Em,M.month=Ba,M.daysInMonth=Kf,M.week=M.weeks=sd,M.isoWeek=M.isoWeeks=ad,M.weeksInYear=Cm,M.weeksInWeekYear=Sm,M.isoWeeksInYear=bm,M.isoWeeksInISOWeekYear=vm,M.date=hl,M.day=M.days=xd,M.weekday=bd,M.isoWeekday=vd,M.dayOfYear=Tm,M.hour=M.hours=Fd,M.minute=M.minutes=Am,M.second=M.seconds=Fm,M.millisecond=M.milliseconds=ml,M.utcOffset=fh,M.utc=hh,M.local=mh,M.parseZone=ph,M.hasAlignedHourOffset=gh,M.isDST=wh,M.isLocal=yh,M.isUtcOffset=xh,M.isUtc=tl,M.isUTC=tl,M.zoneAbbr=Mm,M.zoneName=Im,M.dates=j("dates accessor is deprecated. Use date instead.",hl),M.months=j("months accessor is deprecated. Use month instead",Ba),M.years=j("years accessor is deprecated. Use year instead",Ra),M.zone=j("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",dh),M.isDSTShifted=j("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",kh);function Lm(r){return ae(r*1e3)}function Om(){return ae.apply(null,arguments).parseZone()}function pl(r){return r}var te=H.prototype;te.calendar=ue,te.longDateFormat=nn,te.invalidDate=St,te.ordinal=Do,te.preparse=pl,te.postformat=pl,te.relativeTime=Wr,te.pastFuture=zr,te.set=X,te.eras=sm,te.erasParse=am,te.erasConvertYear=lm,te.erasAbbrRegex=mm,te.erasNameRegex=hm,te.erasNarrowRegex=pm,te.months=qf,te.monthsShort=Zf,te.monthsParse=Jf,te.monthsRegex=ed,te.monthsShortRegex=Xf,te.week=nd,te.firstDayOfYear=od,te.firstDayOfWeek=id,te.weekdays=pd,te.weekdaysMin=wd,te.weekdaysShort=gd,te.weekdaysParse=yd,te.weekdaysRegex=Cd,te.weekdaysShortRegex=Sd,te.weekdaysMinRegex=_d,te.isPM=Td,te.meridiem=Pd;function ti(r,a,c,d){var g=Ft(),x=w().set(d,a);return g[c](x,r)}function gl(r,a,c){if(f(r)&&(a=r,r=void 0),r=r||"",a!=null)return ti(r,a,c,"month");var d,g=[];for(d=0;d<12;d++)g[d]=ti(r,d,c,"month");return g}function ts(r,a,c,d){typeof r=="boolean"?(f(a)&&(c=a,a=void 0),a=a||""):(a=r,c=a,r=!1,f(a)&&(c=a,a=void 0),a=a||"");var g=Ft(),x=r?g._week.dow:0,S,O=[];if(c!=null)return ti(a,(c+x)%7,d,"day");for(S=0;S<7;S++)O[S]=ti(a,(S+x)%7,d,"day");return O}function Dm(r,a){return gl(r,a,"months")}function Rm(r,a){return gl(r,a,"monthsShort")}function Nm(r,a,c){return ts(r,a,c,"weekdays")}function Ym(r,a,c){return ts(r,a,c,"weekdaysShort")}function Wm(r,a,c){return ts(r,a,c,"weekdaysMin")}Bt("en",{eras:[{since:"0001-01-01",until:1/0,offset:1,name:"Anno Domini",narrow:"AD",abbr:"AD"},{since:"0000-12-31",until:-1/0,offset:1,name:"Before Christ",narrow:"BC",abbr:"BC"}],dayOfMonthOrdinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(r){var a=r%10,c=Z(r%100/10)===1?"th":a===1?"st":a===2?"nd":a===3?"rd":"th";return r+c}}),t.lang=j("moment.lang is deprecated. Use moment.locale instead.",Bt),t.langData=j("moment.langData is deprecated. Use moment.localeData instead.",Ft);var Pt=Math.abs;function zm(){var r=this._data;return this._milliseconds=Pt(this._milliseconds),this._days=Pt(this._days),this._months=Pt(this._months),r.milliseconds=Pt(r.milliseconds),r.seconds=Pt(r.seconds),r.minutes=Pt(r.minutes),r.hours=Pt(r.hours),r.months=Pt(r.months),r.years=Pt(r.years),this}function wl(r,a,c,d){var g=ft(a,c);return r._milliseconds+=d*g._milliseconds,r._days+=d*g._days,r._months+=d*g._months,r._bubble()}function Bm(r,a){return wl(this,r,a,1)}function Hm(r,a){return wl(this,r,a,-1)}function kl(r){return r<0?Math.floor(r):Math.ceil(r)}function Um(){var r=this._milliseconds,a=this._days,c=this._months,d=this._data,g,x,S,O,z;return r>=0&&a>=0&&c>=0||r<=0&&a<=0&&c<=0||(r+=kl(ns(c)+a)*864e5,a=0,c=0),d.milliseconds=r%1e3,g=Ke(r/1e3),d.seconds=g%60,x=Ke(g/60),d.minutes=x%60,S=Ke(x/60),d.hours=S%24,a+=Ke(S/24),z=Ke(yl(a)),c+=z,a-=kl(ns(z)),O=Ke(c/12),c%=12,d.days=a,d.months=c,d.years=O,this}function yl(r){return r*4800/146097}function ns(r){return r*146097/4800}function Vm(r){if(!this.isValid())return NaN;var a,c,d=this._milliseconds;if(r=Me(r),r==="month"||r==="quarter"||r==="year")switch(a=this._days+d/864e5,c=this._months+yl(a),r){case"month":return c;case"quarter":return c/3;case"year":return c/12}else switch(a=this._days+Math.round(ns(this._months)),r){case"week":return a/7+d/6048e5;case"day":return a+d/864e5;case"hour":return a*24+d/36e5;case"minute":return a*1440+d/6e4;case"second":return a*86400+d/1e3;case"millisecond":return Math.floor(a*864e5)+d;default:throw new Error("Unknown unit "+r)}}function Mt(r){return function(){return this.as(r)}}var xl=Mt("ms"),$m=Mt("s"),jm=Mt("m"),Gm=Mt("h"),qm=Mt("d"),Zm=Mt("w"),Qm=Mt("M"),Jm=Mt("Q"),Km=Mt("y"),Xm=xl;function ep(){return ft(this)}function tp(r){return r=Me(r),this.isValid()?this[r+"s"]():NaN}function sn(r){return function(){return this.isValid()?this._data[r]:NaN}}var np=sn("milliseconds"),rp=sn("seconds"),ip=sn("minutes"),op=sn("hours"),sp=sn("days"),ap=sn("months"),lp=sn("years");function up(){return Ke(this.days()/7)}var It=Math.round,Fn={ss:44,s:45,m:45,h:22,d:26,w:null,M:11};function cp(r,a,c,d,g){return g.relativeTime(a||1,!!c,r,d)}function fp(r,a,c,d){var g=ft(r).abs(),x=It(g.as("s")),S=It(g.as("m")),O=It(g.as("h")),z=It(g.as("d")),Q=It(g.as("M")),Oe=It(g.as("w")),Lt=It(g.as("y")),Ut=x<=c.ss&&["s",x]||x0,Ut[4]=d,cp.apply(null,Ut)}function dp(r){return r===void 0?It:typeof r=="function"?(It=r,!0):!1}function hp(r,a){return Fn[r]===void 0?!1:a===void 0?Fn[r]:(Fn[r]=a,r==="s"&&(Fn.ss=a-1),!0)}function mp(r,a){if(!this.isValid())return this.localeData().invalidDate();var c=!1,d=Fn,g,x;return typeof r=="object"&&(a=r,r=!1),typeof r=="boolean"&&(c=r),typeof a=="object"&&(d=Object.assign({},Fn,a),a.s!=null&&a.ss==null&&(d.ss=a.s-1)),g=this.localeData(),x=fp(this,!c,d,g),c&&(x=g.pastFuture(+this,x)),g.postformat(x)}var rs=Math.abs;function Pn(r){return(r>0)-(r<0)||+r}function ni(){if(!this.isValid())return this.localeData().invalidDate();var r=rs(this._milliseconds)/1e3,a=rs(this._days),c=rs(this._months),d,g,x,S,O=this.asSeconds(),z,Q,Oe,Lt;return O?(d=Ke(r/60),g=Ke(d/60),r%=60,d%=60,x=Ke(c/12),c%=12,S=r?r.toFixed(3).replace(/\.?0+$/,""):"",z=O<0?"-":"",Q=Pn(this._months)!==Pn(O)?"-":"",Oe=Pn(this._days)!==Pn(O)?"-":"",Lt=Pn(this._milliseconds)!==Pn(O)?"-":"",z+"P"+(x?Q+x+"Y":"")+(c?Q+c+"M":"")+(a?Oe+a+"D":"")+(g||d||r?"T":"")+(g?Lt+g+"H":"")+(d?Lt+d+"M":"")+(r?Lt+S+"S":"")):"P0D"}var K=Zr.prototype;K.isValid=ah,K.abs=zm,K.add=Bm,K.subtract=Hm,K.as=Vm,K.asMilliseconds=xl,K.asSeconds=$m,K.asMinutes=jm,K.asHours=Gm,K.asDays=qm,K.asWeeks=Zm,K.asMonths=Qm,K.asQuarters=Jm,K.asYears=Km,K.valueOf=Xm,K._bubble=Um,K.clone=ep,K.get=tp,K.milliseconds=np,K.seconds=rp,K.minutes=ip,K.hours=op,K.days=sp,K.weeks=up,K.months=ap,K.years=lp,K.humanize=mp,K.toISOString=ni,K.toString=ni,K.toJSON=ni,K.locale=sl,K.localeData=ll,K.toIsoString=j("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",ni),K.lang=al,y("X",0,0,"unix"),y("x",0,0,"valueOf"),D("x",pt),D("X",ut),ie("X",function(r,a,c){c._d=new Date(parseFloat(r)*1e3)}),ie("x",function(r,a,c){c._d=new Date(Z(r))});return t.version="2.30.1",n(ae),t.fn=M,t.min=rh,t.max=ih,t.now=oh,t.utc=w,t.unix=Lm,t.months=Dm,t.isDate=m,t.locale=Bt,t.invalid=C,t.duration=ft,t.isMoment=_,t.weekdays=Nm,t.parseZone=Om,t.localeData=Ft,t.isDuration=Qr,t.monthsShort=Rm,t.weekdaysMin=Wm,t.defineLocale=Vo,t.updateLocale=Od,t.locales=Dd,t.weekdaysShort=Ym,t.normalizeUnits=Me,t.relativeTimeRounding=dp,t.relativeTimeThreshold=hp,t.calendarFormat=Ph,t.prototype=M,t.HTML5_FMT={DATETIME_LOCAL:"YYYY-MM-DDTHH:mm",DATETIME_LOCAL_SECONDS:"YYYY-MM-DDTHH:mm:ss",DATETIME_LOCAL_MS:"YYYY-MM-DDTHH:mm:ss.SSS",DATE:"YYYY-MM-DD",TIME:"HH:mm",TIME_SECONDS:"HH:mm:ss",TIME_MS:"HH:mm:ss.SSS",WEEK:"GGGG-[W]WW",MONTH:"YYYY-MM"},t})});var ry={};bl(ry,{default:()=>ny});module.exports=xp(ry);var ye=require("obsidian");(function(){if(globalThis.process)return;let t={browser:!0,cwd:__name(()=>"/","cwd"),env:{},platform:"android"};globalThis.process=t})();function wt(){}async function is(){}function fr(e){return async(...t)=>{await e(...t)}}var xt=require("obsidian");var bp=require("obsidian"),Cl=require("obsidian"),Sl=require("obsidian"),ay=require("obsidian"),ly=require("obsidian");var an={AudioRecorder:"audio-recorder",Backlink:"backlink",Bookmarks:"bookmarks",Browser:"browser",Canvas:"canvas",CommandPalette:"command-palette",DailyNotes:"daily-notes",EditorStatus:"editor-status",FileExplorer:"file-explorer",FileRecovery:"file-recovery",GlobalSearch:"global-search",Graph:"graph",MarkdownImporter:"markdown-importer",NoteComposer:"note-composer",OutgoingLink:"outgoing-link",Outline:"outline",PagePreview:"page-preview",Properties:"properties",Publish:"publish",RandomNote:"random-note",SlashCommand:"slash-command",Slides:"slides",Switcher:"switcher",Sync:"sync",TagPane:"tag-pane",Templates:"templates",WordCount:"word-count",Workspaces:"workspaces",ZkPrefixer:"zk-prefixer"},sy={AllProperties:"all-properties",Audio:"audio",Backlink:an.Backlink,Bookmarks:an.Bookmarks,Browser:"browser",BrowserHistory:"browser-history",Canvas:an.Canvas,Empty:"empty",FileExplorer:an.FileExplorer,FileProperties:"file-properties",Graph:an.Graph,Image:"image",LocalGraph:"localgraph",Markdown:"markdown",OutgoingLink:an.OutgoingLink,Outline:an.Outline,Pdf:"pdf",ReleaseNotes:"release-notes",Search:"search",Sync:"sync",Tag:"tag",Video:"video"};function vp(){return Cl.TFile}function Cp(){return Sl.TFolder}function dt(e){return e.replace(/\/?[^\/]*$/,"")||"/"}function ii(e,t){let n=e.vault.getFolderByPath(t);return n||(n=new(Cp())(e.vault,t),n.parent=ii(e,dt(t)),n.deleted=!0,n)}function _l(e,t){let n=e.vault.getFileByPath(t);return n||(n=new(vp())(e.vault,t),n.parent=ii(e,dt(t)),n.deleted=!0,n)}function Vt(e){return!!e.position}function Ot(e){return!!e.key}var us=je(Al(),1);var ss=je(Pl(),1);(function(){if(globalThis.process)return;let t={browser:!0,cwd:__name(()=>"/","cwd"),env:{},platform:"android"};globalThis.process=t})();var si="asyncError",ai=new ss.default;ai.on(si,Tp);function li(e){ai.emit(si,e)}function Ml(e){return as(e).map(t=>" ".repeat(t.level)+t.message).join(` -`)}function ln(e=0){return(new Error().stack??"").split(` -`).slice(e+2).join(` -`)}function hr(e,t){t??=globalThis.console;let n=as(e);for(let i of n)i.shouldClearAnsiSequence?t.error(`\x1B[0m${i.message}\x1B[0m`):t.error(i.message)}function Il(e){return ai.on(si,e),()=>ai.off(si,e)}function un(e){throw e}function Tp(e){hr(new Error("An unhandled error occurred executing async operation",{cause:e}))}function as(e,t=0,n=[]){if(e===void 0)return n;if(!(e instanceof Error)){let o;return e===null?o="(null)":typeof e=="string"?o=e:o=JSON.stringify(e)??"undefined",n.push({level:t,message:o}),n}let i=`${e.name}: ${e.message}`;if(n.push({level:t,message:i,shouldClearAnsiSequence:!0}),e.stack){let o=e.stack.startsWith(i)?e.stack.slice(i.length+1):e.stack;n.push({level:t,message:`Error stack: -${o}`})}return e.cause!==void 0&&(n.push({level:t,message:"Caused by:"}),as(e.cause,t+1,n)),n}(function(){if(globalThis.process)return;let t={browser:!0,cwd:__name(()=>"/","cwd"),env:{},platform:"android"};globalThis.process=t})();function ls(e){return e.replaceAll(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Ll(e){try{return new RegExp(e),!0}catch{return!1}}(function(){if(globalThis.process)return;let t={browser:!0,cwd:__name(()=>"/","cwd"),env:{},platform:"android"};globalThis.process=t})();async function mr(e,...t){return Ap(e)?await e(...t):e}function Ap(e){return typeof e=="function"}(function(){if(globalThis.process)return;let t={browser:!0,cwd:__name(()=>"/","cwd"),env:{},platform:"android"};globalThis.process=t})();var Fp={"\n":"\\n","\r":"\\r"," ":"\\t","\b":"\\b","\f":"\\f","'":"\\'",'"':'\\"',"\\":"\\\\"},Pp={};for(let[e,t]of Object.entries(Fp))Pp[t]=e;function Ol(e,t,n,i){return i??=n,e.slice(0,n)+t+e.slice(i)}function pr(e){return He(e,/\u00A0|\u202F/g," ").normalize("NFC")}function He(e,t,n){return typeof n>"u"?e:(t instanceof RegExp&&!t.global&&(t=new RegExp(t.source,`${t.flags}g`)),typeof n=="string"?e.replaceAll(t,n):e.replaceAll(t,(i,...o)=>{let l=typeof o.at(-1)=="object",u=l?o.length-2:o.length-1,f={groups:l?o.at(-1):void 0,offset:o.at(u-1),source:o.at(u),substring:i},m=o.slice(0,u-1);return n(f,...m)??f.substring}))}function Dl(e,t,n){if(e.endsWith(t))return e.slice(0,-t.length);if(n)throw new Error(`String ${e} does not end with suffix ${t}`);return e}function Dt(e,t,n){if(e.startsWith(t))return e.slice(t.length);if(n)throw new Error(`String ${e} does not start with prefix ${t}`);return e}(function(){if(globalThis.process)return;let t={browser:!0,cwd:__name(()=>"/","cwd"),env:{},platform:"android"};globalThis.process=t})();var Mp=/[a-zA-Z]:\/[^:]*$/,yt=us.default.posix,Cy=yt.delimiter,Sy=us.default.posix.sep,Re=yt.basename,se=yt.dirname,et=yt.extname,_y=yt.format;var we=yt.join,Ey=yt.normalize,Ty=yt.parse,In=yt.relative;function Rl(e,t){return t?`${e}.${t}`:e}function Nl(...e){let t=yt.resolve(...e);return t=Ip(t),Mp.exec(t)?.[0]??t}function Ip(e){return He(e,"\\","/")}(function(){if(globalThis.process)return;let t={browser:!0,cwd:__name(()=>"/","cwd"),env:{},platform:"android"};globalThis.process=t})();var ui="md",Lp="canvas";function Wl(e,t,n){if(tt(t))return t.extension===n;if(typeof t=="string"){let i=ce(e,t);return i?i.extension===n:et(t).slice(1)===n}return!1}function gr(e,t,n){if(t===null)return null;if(Hl(t))return t;let i=Yl(e,t,n);if(i)return i;let o=Vl(t);return o===t?null:Yl(e,o,n)}function Ne(e,t,n,i){let o=ce(e,t,i);if(!o)if(n)o=_l(e,t);else throw new Error(`File not found: ${t}`);return o}function ce(e,t,n){let i=gr(e,t,n);return tt(i)?i:null}function Ln(e,t,n,i){let o=ht(e,t,i);if(!o)if(n)o=ii(e,t);else throw new Error(`Folder not found: ${t}`);return o}function ht(e,t,n){let i=gr(e,t,n);return wr(i)?i:null}function zl(e,t,n){let i=Ln(e,t),o=[];return n?xt.Vault.recurseChildren(i,s=>{ke(e,s)&&o.push(s)}):o=i.children.filter(s=>ke(e,s)),o=o.sort((s,l)=>s.path.localeCompare(l.path)),o}async function Bl(e,t){let n=ce(e,t);if(n)return n;let i=dt(t);return await Op(e,i),await e.vault.create(t,"")}async function Op(e,t){let n=ht(e,t);return n||await e.vault.createFolder(t)}function he(e,t){if(Hl(t))return t.path;let n=gr(e,t);return n?n.path:Vl(t)}function Hl(e){return e instanceof xt.TAbstractFile}function cn(e,t){return Wl(e,t,Lp)}function tt(e){return e instanceof xt.TFile}function wr(e){return e instanceof xt.TFolder}function ke(e,t){return Wl(e,t,ui)}function Rt(e,t){return ke(e,t)||cn(e,t)}function Ul(e,t){return ke(e,t)?Dl(t.path,`.${ui}`):t.path}function Yl(e,t,n){return n?e.vault.getAbstractFileByPathInsensitive(t):e.vault.getAbstractFileByPath(t)}function Vl(e){return(0,xt.normalizePath)(Nl("/",e))}var ws=je(nu(),1);(function(){if(globalThis.process)return;let t={browser:!0,cwd:__name(()=>"/","cwd"),env:{},platform:"android"};globalThis.process=t})();var ms="19.6.0",mi="obsidian-dev-utils",ru=`.obsidian-dev-utils :invalid { - box-shadow: 0 0 0 2px var(--text-error); -} -.obsidian-dev-utils.modal-container .ok-button { - margin-right: 10px; - margin-top: 20px; -} -.obsidian-dev-utils .multiple-dropdown-component select, -.obsidian-dev-utils .multiple-dropdown-component select:focus, -.obsidian-dev-utils .multiple-dropdown-component .dropdown { - height: auto; -} -.obsidian-dev-utils .multiple-dropdown-component select option:checked, -.obsidian-dev-utils .multiple-dropdown-component select:focus option:checked, -.obsidian-dev-utils .multiple-dropdown-component .dropdown option:checked { - background-color: #1967d2; - color: #fff; -} -.obsidian-dev-utils.prompt-modal .text-box { - width: 100%; -} - -/*# sourceMappingURL=data:application/json;charset=utf-8,%7B%22version%22:3,%22sourceRoot%22:%22%22,%22sources%22:%5B%22../src/styles/main.scss%22%5D,%22names%22:%5B%5D,%22mappings%22:%22AACE;EACE;;AAIA;EACE;EACA;;AAKF;AAAA;AAAA;EAGE;;AAEA;AAAA;AAAA;EACE;EACA;;AAMJ;EACE%22,%22file%22:%22styles.css%22,%22sourcesContent%22:%5B%22.obsidian-dev-utils%20%7B%5Cn%20%20:invalid%20%7B%5Cn%20%20%20%20box-shadow:%200%200%200%202px%20var(--text-error);%5Cn%20%20%7D%5Cn%5Cn%20%20&.modal-container%20%7B%5Cn%20%20%20%20.ok-button%20%7B%5Cn%20%20%20%20%20%20margin-right:%2010px;%5Cn%20%20%20%20%20%20margin-top:%2020px;%5Cn%20%20%20%20%7D%5Cn%20%20%7D%5Cn%5Cn%20%20.multiple-dropdown-component%20%7B%5Cn%20%20%20%20select,%5Cn%20%20%20%20select:focus,%5Cn%20%20%20%20.dropdown%20%7B%5Cn%20%20%20%20%20%20height:%20auto;%5Cn%5Cn%20%20%20%20%20%20option:checked%20%7B%5Cn%20%20%20%20%20%20%20%20background-color:%20%231967d2;%5Cn%20%20%20%20%20%20%20%20color:%20%23fff;%5Cn%20%20%20%20%20%20%7D%5Cn%20%20%20%20%7D%5Cn%20%20%7D%5Cn%5Cn%20%20&.prompt-modal%20%7B%5Cn%20%20%20%20.text-box%20%7B%5Cn%20%20%20%20%20%20width:%20100%25;%5Cn%20%20%20%20%7D%5Cn%20%20%7D%5Cn%7D%5Cn%22%5D%7D */ -`;(function(){if(globalThis.process)return;let t={browser:!0,cwd:__name(()=>"/","cwd"),env:{},platform:"android"};globalThis.process=t})();var ps=class{constructor(t){this.value=t}};function iu(){try{return globalThis.require("obsidian/app")}catch{return globalThis.app??un(new Error("Obsidian app not found"))}}function jt(e,t,n){let i=e;return i.obsidianDevUtilsState??={},i.obsidianDevUtilsState[t]??=new ps(n)}(function(){if(globalThis.process)return;let t={browser:!0,cwd:__name(()=>"/","cwd"),env:{},platform:"android"};globalThis.process=t})();var gs="__no-plugin-id-initialized__",ou=gs;function rt(){return ou}function su(e){e&&(ou=e)}(function(){if(globalThis.process)return;let t={browser:!0,cwd:__name(()=>"/","cwd"),env:{},platform:"android"};globalThis.process=t})();var au=",",pi="-";function lu(){return{disable:rg,enable:ig,get:wi,set:kr}}function gi(e,t=0){let n=Nn()(e);return n.log=(i,...o)=>{og(e,t,i,...o)},n.printStackTrace=(i,o)=>{fu(e,i,o)},n}function Ue(e){let t=rt(),n=t===gs?"":`${t}:`;return gi(`${n}${mi}:${e}`)}function uu(e){let t=Nn().enabled(e),n=t?"enabled":"disabled",i=t?"disable":"enable",o=wi();kr(e),gi(e)(`Debug messages for plugin ${e} are ${n}. See https://github.com/mnaoumov/obsidian-dev-utils/?tab=readme-ov-file#debugging how to ${i} them.`),kr(o)}function rg(e){let t=new Set(wi());for(let n of yr(e)){if(n.startsWith(pi))continue;let i=pi+n;t.has(n)&&t.delete(n),t.add(i)}kr(Array.from(t))}function ig(e){let t=new Set(wi());for(let n of yr(e)){if(!n.startsWith(pi)){let i=pi+n;t.has(i)&&t.delete(i)}t.add(n)}kr(Array.from(t))}function wi(){return yr(Nn().load()??"")}function Nn(){if(typeof window>"u")return ws.default;let e=iu();return jt(e,"debug",ws.default).value}function cu(){return typeof window<"u"}function og(e,t,n,...i){if(!Nn().enabled(e))return;let l=(new Error().stack?.split(` -`)??[])[4+t]??"";console.debug(n,...i),cu()&&fu(e,l,"Debug message caller")}function fu(e,t,n){let i=Nn()(e);if(!i.enabled)return;t||(t="(unavailable)"),n||(n="Caller stack trace"),i(n);let o=cu()?`StackTraceFakeError -`:"";console.debug(`${o}${t}`)}function kr(e){Nn().enable(yr(e).join(au))}function yr(e){return typeof e=="string"?e.split(au).filter(Boolean):e.flatMap(yr)}(function(){if(globalThis.process)return;let t={browser:!0,cwd:__name(()=>"/","cwd"),env:{},platform:"android"};globalThis.process=t})();async function dn(e){let t=e.items,n=0,i=new Notice("",0);for(let o of t){if(e.abortSignal?.aborted){i.hide();return}n++;let s=`# ${n.toString()} / ${t.length.toString()}`,l=e.buildNoticeMessage(o,s);i.setMessage(l),Ue("Loop")(l);try{await e.processItem(o)}catch(u){if(e.shouldContinueOnError)throw i.hide(),u;li(u)}}i.hide()}var mu=require("obsidian");(function(){if(globalThis.process)return;let t={browser:!0,cwd:__name(()=>"/","cwd"),env:{},platform:"android"};globalThis.process=t})();var $=(e=>(e.AlertModal="alert-modal",e.CancelButton="cancel-button",e.ConfirmModal="confirm-modal",e.DateComponent="date-component",e.DateTimeComponent="datetime-component",e.EmailComponent="email-component",e.FileComponent="file-component",e.LibraryName="obsidian-dev-utils",e.MonthComponent="month-component",e.MultipleDropdownComponent="multiple-dropdown-component",e.MultipleEmailComponent="multiple-email-component",e.MultipleFileComponent="multiple-file-component",e.MultipleTextComponent="multiple-text-component",e.NumberComponent="number-component",e.OkButton="ok-button",e.PluginSettingsTab="plugin-settings-tab",e.PromptModal="prompt-modal",e.SelectItemModal="select-item-modal",e.TextBox="text-box",e.TimeComponent="time-component",e.UrlComponent="url-component",e.WeekComponent="week-component",e))($||{});var du=require("obsidian");(function(){if(globalThis.process)return;let t={browser:!0,cwd:__name(()=>"/","cwd"),env:{},platform:"android"};globalThis.process=t})();var ki=class extends du.Modal{constructor(t,n,i){super(t.app),this.resolve=n,this.containerEl.addClass($.LibraryName,rt(),i),t.cssClass&&this.containerEl.addClass(t.cssClass)}};async function hu(e){return await new Promise(t=>{e(t).open()})}(function(){if(globalThis.process)return;let t={browser:!0,cwd:__name(()=>"/","cwd"),env:{},platform:"android"};globalThis.process=t})();var ks=class extends ki{options;constructor(t,n){super(t,n,$.AlertModal);let i={app:t.app,cssClass:"",message:t.message,okButtonText:"OK",title:""};this.options={...i,...t}}onClose(){this.resolve()}onOpen(){this.titleEl.setText(this.options.title),this.contentEl.createEl("p",{text:this.options.message});let t=new mu.ButtonComponent(this.contentEl);t.setButtonText(this.options.okButtonText),t.setCta(),t.onClick(this.close.bind(this)),t.setClass($.OkButton)}};async function yi(e){await hu(t=>new ks(e,t))}var vi=require("obsidian");var ku=je(gu(),1);(function(){if(globalThis.process)return;let t={browser:!0,cwd:__name(()=>"/","cwd"),env:{},platform:"android"};globalThis.process=t})();var wu=`${mi}-styles`;function yu(e,t){su(t),uu(t);let n=jt(e,"lastLibraryVersion","0.0.0");if((0,ku.compareVersions)(ms,n.value)<=0)return;n.value=ms;let i=sg();i.DEBUG=lu(),document.head.querySelector(`#${wu}`)?.remove(),document.head.createEl("style",{attr:{id:wu},text:ru})}function sg(){return window}(function(){if(globalThis.process)return;let t={browser:!0,cwd:__name(()=>"/","cwd"),env:{},platform:"android"};globalThis.process=t})();var bi=class extends vi.Plugin{get abortSignal(){return this._abortSignal}get settings(){return this._settings}get settingsClone(){return this.createPluginSettings(this.settings.toJSON())}_abortSignal;_settings;notice;consoleDebug(t,...n){gi(this.manifest.id,1)(t,...n)}async onExternalSettingsChange(){await this.loadSettings()}async onload(){yu(this.app,this.manifest.id),this.register(Il(()=>{this.showNotice("An unhandled error occurred. Please check the console for more information.")})),await this.loadSettings();let t=this.createPluginSettingsTab();t&&this.addSettingTab(t);let n=new AbortController;this._abortSignal=n.signal,this.register(()=>{n.abort()}),await this.onloadComplete(),setTimeout(()=>{this.app.workspace.onLayoutReady(this.onLayoutReady.bind(this))},0)}async saveSettings(t){let n=t.toJSON();this._settings=this.createPluginSettings(n),await this.saveData(n)}onLayoutReady(){}onloadComplete(){}showNotice(t){this.notice&&this.notice.hide(),this.notice=new vi.Notice(`${this.manifest.name} -${t}`)}async loadSettings(){let t=await this.loadData();this._settings=this.createPluginSettings(t),this.settings.shouldSaveAfterLoad&&await this.saveSettings(this._settings)}};(function(){if(globalThis.process)return;let t={browser:!0,cwd:__name(()=>"/","cwd"),env:{},platform:"android"};globalThis.process=t})();async function ys(e){try{await e()}catch(t){li(t)}}function xs(e){return(...t)=>{xr(()=>e(...t))}}function xr(e){ys(e)}async function br(e,t,n){let i=Ue("Async:retryWithTimeout");n??=ln(1);let s={...{retryDelayInMilliseconds:100,shouldRetryOnError:!1,timeoutInMilliseconds:5e3},...t};await bs(s.timeoutInMilliseconds,async()=>{let l=0;for(;;){s.abortSignal?.throwIfAborted(),l++;let u;try{u=await e()}catch(f){if(!s.shouldRetryOnError||f.__terminateRetry)throw f;hr(f),u=!1}if(u){l>1&&(i(`Retry completed successfully after ${l.toString()} attempts`),i.printStackTrace(n));return}i(`Retry attempt ${l.toString()} completed unsuccessfully. Trying again in ${s.retryDelayInMilliseconds.toString()} milliseconds`,{fn:e}),i.printStackTrace(n),await xu(s.retryDelayInMilliseconds)}})}async function bs(e,t){let n=!0,i=null,o=performance.now();if(await Promise.race([s(),l()]),n)throw new Error("Timed out");return i;async function s(){i=await t(),n=!1;let u=performance.now()-o;Ue("Async:runWithTimeout")(`Execution time: ${u.toString()} milliseconds`,{fn:t})}async function l(){if(!n||(await xu(e),!n))return;let u=performance.now()-o;console.warn(`Timed out in ${u.toString()} milliseconds`,{fn:t});let f=Ue("Async:runWithTimeout:timeout");f.enabled&&(f(`The execution is not terminated because debugger ${f.namespace} is enabled. See https://github.com/mnaoumov/obsidian-dev-utils/?tab=readme-ov-file#debugging for more information`),await l())}}async function xu(e){await new Promise(t=>{setTimeout(t,e)})}(function(){if(globalThis.process)return;let t={browser:!0,cwd:__name(()=>"/","cwd"),env:{},platform:"android"};globalThis.process=t})();async function bu(e,t,n){let i=Ue("Logger:invokeAsyncAndLog"),o=performance.now();n??=ln(1),i(`${e}:start`,{fn:t,timestampStart:o}),i.printStackTrace(n);try{await t();let s=performance.now();i(`${e}:end`,{duration:s-o,fn:t,timestampEnd:s,timestampStart:o}),i.printStackTrace(n)}catch(s){let l=performance.now();throw i(`${e}:error`,{duration:l-o,error:s,fn:t,timestampEnd:l,timestampStart:o}),i.printStackTrace(n),s}}(function(){if(globalThis.process)return;let t={browser:!0,cwd:__name(()=>"/","cwd"),env:{},platform:"android"};globalThis.process=t})();function it(e,t,n,i){i??=ln(1),xr(()=>ag(e,t,n,i))}async function ag(e,t,n,i){n??=6e4,i??=ln(1);let s=vu(e).value;s.items.push({fn:t,stackTrace:i,timeoutInMilliseconds:n}),s.promise=s.promise.then(()=>Cu(e)),await s.promise}function vu(e){return jt(e,"queue",{items:[],promise:Promise.resolve()})}async function Cu(e){let t=vu(e).value,n=t.items[0];n&&(await ys(()=>bs(n.timeoutInMilliseconds,()=>bu(Cu.name,n.fn,n.stackTrace))),t.items.shift())}function Su(e,t){let n=Object.keys(t).map(i=>lg(e,i,t[i]));return n.length===1?n[0]:function(){n.forEach(i=>i())}}function lg(e,t,n){let i=e[t],o=e.hasOwnProperty(t),s=o?i:function(){return Object.getPrototypeOf(e)[t].apply(this,arguments)},l=n(s);return i&&Object.setPrototypeOf(l,i),Object.setPrototypeOf(u,l),e[t]=u,f;function u(...m){return l===s&&e[t]===u&&f(),l.apply(this,m)}function f(){e[t]===u&&(o?e[t]=s:delete e[t]),l!==s&&(l=s,Object.setPrototypeOf(u,i||Function))}}var kf=require("obsidian");(function(){if(globalThis.process)return;let t={browser:!0,cwd:__name(()=>"/","cwd"),env:{},platform:"android"};globalThis.process=t})();var _u=".";function Cs(e,t){if(e===t)return!0;if(typeof e!="object"||typeof t!="object"||e===null||t===null)return!1;let n=Object.keys(e),i=Object.keys(t);if(n.length!==i.length)return!1;let o=e,s=t;for(let l of n)if(!i.includes(l)||!Cs(o[l],s[l]))return!1;return!0}function Ci(e,t){let n=e,i=t.split(_u);for(let o of i){if(n===void 0)return;n=n[o]}return n}function Eu(e,t,n){let i=new Error(`Property path ${t} not found`),o=e,s=t.split(_u);for(let u of s.slice(0,-1)){if(o===void 0)throw i;o=o[u]}let l=s.at(-1);if(o===void 0||l===void 0)throw i;o[l]=n}function Si(e,t={}){let n={functionHandlingMode:"exclude",maxDepth:-1,shouldCatchToJSONErrors:!1,shouldHandleCircularReferences:!1,shouldHandleErrors:!1,shouldHandleUndefined:!1,shouldSortKeys:!1,space:2,tokenSubstitutions:{circularReference:vs("CircularReference"),maxDepthLimitReached:vs("MaxDepthLimitReached"),toJSONFailed:vs("ToJSONFailed")}},i={...n,...t,tokenSubstitutions:{...n.tokenSubstitutions,...t.tokenSubstitutions}};i.maxDepth===-1&&(i.maxDepth=1/0);let o=[],l=_i(e,"",0,!0,i,o,new WeakSet),u=JSON.stringify(l,null,i.space)??"";return u=He(u,/"\[\[(?[A-Za-z]+)(?\d*)\]\]"/g,(f,m,h)=>ug({functionTexts:o,index:h?parseInt(h,10):0,key:m,substitutions:i.tokenSubstitutions})),u}function ug(e){switch(e.key){case"CircularReference":return e.substitutions.circularReference;case"Function":return e.functionTexts[e.index]??un(new Error(`Function with index ${e.index.toString()} not found`));case"MaxDepthLimitReached":return e.substitutions.maxDepthLimitReached;case"MaxDepthLimitReachedArray":return`Array(${e.index.toString()})`;case"ToJSONFailed":return e.substitutions.toJSONFailed;case"Undefined":return"undefined";default:break}}function cg(e,t,n,i,o,s){return t>i.maxDepth?Yn("MaxDepthLimitReachedArray",e.length):e.map((l,u)=>_i(l,u.toString(),t+1,n,i,o,s))}function fg(e,t,n){if(n.shouldHandleCircularReferences)return Yn("CircularReference");let i=e.constructor.name||"Object";throw new TypeError(`Converting circular structure to JSON ---> starting at object with constructor '${i}' ---- property '${t}' closes the circle`)}function dg(e,t,n){if(n.functionHandlingMode==="exclude")return;let i=t.length,o=n.functionHandlingMode==="full"?e.toString():`function ${e.name||"anonymous"}() { /* ... */ }`;return t.push(o),Yn("Function",i)}function hg(e,t,n,i,o,s,l){if(l.has(e))return fg(e,t,o);if(l.add(e),i){let u=pg(e,t,n,o,s,l);if(u!==void 0)return u}return Array.isArray(e)?cg(e,n,i,o,s,l):n>o.maxDepth?Yn("MaxDepthLimitReached"):e instanceof Error&&o.shouldHandleErrors?Ml(e):mg(e,n,i,o,s,l)}function mg(e,t,n,i,o,s){let l=Object.entries(e);return i.shouldSortKeys&&l.sort(([u],[f])=>u.localeCompare(f)),Object.fromEntries(l.map(([u,f])=>[u,_i(f,u,t+1,n,i,o,s)]))}function vs(e){return`{ "[[${e}]]": null }`}function Yn(e,t){return`[[${e}${t?.toString()??""}]]`}function _i(e,t,n,i,o,s,l){return e===void 0?n===0||o.shouldHandleUndefined?Yn("Undefined"):void 0:typeof e=="function"?dg(e,s,o):typeof e!="object"||e===null?e:hg(e,t,n,i,o,s,l)}function pg(e,t,n,i,o,s){let l=e.toJSON;if(typeof l=="function")try{let u=l.call(e,t);return _i(u,t,n,!1,i,o,s)}catch(u){if(i.shouldCatchToJSONErrors)return Yn("ToJSONFailed");throw u}}(function(){if(globalThis.process)return;let t={browser:!0,cwd:__name(()=>"/","cwd"),env:{},platform:"android"};globalThis.process=t})();async function Ss(e,t,n){let i=he(e,t),o=he(e,n),s=Ne(e,o,!0),l=et(i),u=Re(i,l),f=e.vault.getAvailablePathForAttachments;return f.isExtended?f(u,l.slice(1),s,!0):await gg(e,u,l.slice(1),s,!0)}async function Wn(e,t){return dt(await Ss(e,"DUMMY_FILE.pdf",t))}async function gg(e,t,n,i,o){let s=e.vault.getConfig("attachmentFolderPath"),l=s==="."||s==="./",u=null;s.startsWith("./")&&(u=Dt(s,"./")),l?s=i?i.parent?.path??"":"":u&&(s=(i?i.parent?.getParentPrefix()??"":"")+u),s=pr(Tu(s)),t=pr(Tu(t));let f=ht(e,s,!0);!f&&u&&(o?f=Ln(e,s,!0):f=await e.vault.createFolder(s));let m=f?.getParentPrefix()??"";return e.vault.getAvailablePath(m+t,n)}async function _s(e,t){let n=await Wn(e,t),i=await Wn(e,we(se(t),"DUMMY_FILE.md"));return n!==i}function Tu(e){return e=He(e,/(?:[\\/])+/g,"/"),e=He(e,/^\/+|\/+$/g,""),e||"/"}var to=require("obsidian");var wg={};function hn(e,t){let n=t||wg,i=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,o=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return Fu(e,i,o)}function Fu(e,t,n){if(kg(e)){if("value"in e)return e.type==="html"&&!n?"":e.value;if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return Au(e.children,t,n)}return Array.isArray(e)?Au(e,t,n):""}function Au(e,t,n){let i=[],o=-1;for(;++oo?0:o+t:t=t>o?o:t,n=n>0?n:0,i.length<1e4)l=Array.from(i),l.unshift(t,n),e.splice(...l);else for(n&&e.splice(t,n);s0?(Ce(e,e.length,0,t),e):t}var Mu={}.hasOwnProperty;function Iu(e){let t={},n=-1;for(;++n13&&n<32||n>126&&n<160||n>55295&&n<57344||n>64975&&n<65008||(n&65535)===65535||(n&65535)===65534||n>1114111?"\uFFFD":String.fromCodePoint(n)}function Nt(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}var qe=Gt(/[A-Za-z]/),We=Gt(/[\dA-Za-z]/),Lu=Gt(/[#-'*+\--9=?A-Z^-~]/);function vr(e){return e!==null&&(e<32||e===127)}var Cr=Gt(/\d/),Ou=Gt(/[\dA-Fa-f]/),Du=Gt(/[!-/:-@[-`{-~]/);function R(e){return e!==null&&e<-2}function me(e){return e!==null&&(e<0||e===32)}function U(e){return e===-2||e===-1||e===32}var Ru=Gt(/\p{P}|\p{S}/u),Nu=Gt(/\s/);function Gt(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function V(e,t,n,i){let o=i?i-1:Number.POSITIVE_INFINITY,s=0;return l;function l(f){return U(f)?(e.enter(n),u(f)):t(f)}function u(f){return U(f)&&s++l))return;let J=t.events.length,j=J,G,ne;for(;j--;)if(t.events[j][0]==="exit"&&t.events[j][1].type==="chunkFlow"){if(G){ne=t.events[j][1].end;break}G=!0}for(C(i),_=J;_P;){let B=n[Y];t.containerState=B[1],B[0].exit.call(t,e)}n.length=P}function A(){o.write([null]),s=void 0,o=void 0,t.containerState._closeFlow=void 0}}function Cg(e,t,n){return V(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Bn(e){if(e===null||me(e)||Nu(e))return 1;if(Ru(e))return 2}function Hn(e,t,n){let i=[],o=-1;for(;++o1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;let p={...e[i][1].end},w={...e[n][1].start};Bu(p,-f),Bu(w,f),l={type:f>1?"strongSequence":"emphasisSequence",start:p,end:{...e[i][1].end}},u={type:f>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:w},s={type:f>1?"strongText":"emphasisText",start:{...e[i][1].end},end:{...e[n][1].start}},o={type:f>1?"strong":"emphasis",start:{...l.start},end:{...u.end}},e[i][1].end={...l.start},e[n][1].start={...u.end},m=[],e[i][1].end.offset-e[i][1].start.offset&&(m=Ye(m,[["enter",e[i][1],t],["exit",e[i][1],t]])),m=Ye(m,[["enter",o,t],["enter",l,t],["exit",l,t],["enter",s,t]]),m=Ye(m,Hn(t.parser.constructs.insideSpan.null,e.slice(i+1,n),t)),m=Ye(m,[["exit",s,t],["enter",u,t],["exit",u,t],["exit",o,t]]),e[n][1].end.offset-e[n][1].start.offset?(h=2,m=Ye(m,[["enter",e[n][1],t],["exit",e[n][1],t]])):h=0,Ce(e,i-1,n-i+3,m),n=i+m.length-h-2;break}}for(n=-1;++n0&&U(_)?V(e,A,"linePrefix",s+1)(_):A(_)}function A(_){return _===null||R(_)?e.check(Hu,F,Y)(_):(e.enter("codeFlowValue"),P(_))}function P(_){return _===null||R(_)?(e.exit("codeFlowValue"),A(_)):(e.consume(_),P)}function Y(_){return e.exit("codeFenced"),t(_)}function B(_,J,j){let G=0;return ne;function ne(W){return _.enter("lineEnding"),_.consume(W),_.exit("lineEnding"),oe}function oe(W){return _.enter("codeFencedFence"),U(W)?V(_,X,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(W):X(W)}function X(W){return W===u?(_.enter("codeFencedFenceSequence"),N(W)):j(W)}function N(W){return W===u?(G++,_.consume(W),N):G>=l?(_.exit("codeFencedFenceSequence"),U(W)?V(_,H,"whitespace")(W):H(W)):j(W)}function H(W){return W===null||R(W)?(_.exit("codeFencedFence"),J(W)):j(W)}}}function Og(e,t,n){let i=this;return o;function o(l){return l===null?n(l):(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),s)}function s(l){return i.parser.lazy[i.now().line]?n(l):t(l)}}var _r={name:"codeIndented",tokenize:Rg},Dg={partial:!0,tokenize:Ng};function Rg(e,t,n){let i=this;return o;function o(m){return e.enter("codeIndented"),V(e,s,"linePrefix",5)(m)}function s(m){let h=i.events[i.events.length-1];return h&&h[1].type==="linePrefix"&&h[2].sliceSerialize(h[1],!0).length>=4?l(m):n(m)}function l(m){return m===null?f(m):R(m)?e.attempt(Dg,l,f)(m):(e.enter("codeFlowValue"),u(m))}function u(m){return m===null||R(m)?(e.exit("codeFlowValue"),l(m)):(e.consume(m),u)}function f(m){return e.exit("codeIndented"),t(m)}}function Ng(e,t,n){let i=this;return o;function o(l){return i.parser.lazy[i.now().line]?n(l):R(l)?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),o):V(e,s,"linePrefix",5)(l)}function s(l){let u=i.events[i.events.length-1];return u&&u[1].type==="linePrefix"&&u[2].sliceSerialize(u[1],!0).length>=4?t(l):R(l)?o(l):n(l)}}var Ts={name:"codeText",previous:Wg,resolve:Yg,tokenize:zg};function Yg(e){let t=e.length-4,n=3,i,o;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(i=n;++i=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return tthis.left.length?this.right.slice(this.right.length-i+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-i+this.left.length).reverse())}splice(t,n,i){let o=n||0;this.setCursor(Math.trunc(t));let s=this.right.splice(this.right.length-o,Number.POSITIVE_INFINITY);return i&&Er(this.left,i),s.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),Er(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),Er(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t=4?t(l):e.interrupt(i.parser.constructs.flow,n,t)(l)}}function Li(e,t,n,i,o,s,l,u,f){let m=f||Number.POSITIVE_INFINITY,h=0;return p;function p(C){return C===60?(e.enter(i),e.enter(o),e.enter(s),e.consume(C),e.exit(s),w):C===null||C===32||C===41||vr(C)?n(C):(e.enter(i),e.enter(l),e.enter(u),e.enter("chunkString",{contentType:"string"}),F(C))}function w(C){return C===62?(e.enter(s),e.consume(C),e.exit(s),e.exit(o),e.exit(i),t):(e.enter(u),e.enter("chunkString",{contentType:"string"}),k(C))}function k(C){return C===62?(e.exit("chunkString"),e.exit(u),w(C)):C===null||C===60||R(C)?n(C):(e.consume(C),C===92?v:k)}function v(C){return C===60||C===62||C===92?(e.consume(C),k):k(C)}function F(C){return!h&&(C===null||C===41||me(C))?(e.exit("chunkString"),e.exit(u),e.exit(l),e.exit(i),t(C)):h999||k===null||k===91||k===93&&!f||k===94&&!u&&"_hiddenFootnoteSupport"in l.parser.constructs?n(k):k===93?(e.exit(s),e.enter(o),e.consume(k),e.exit(o),e.exit(i),t):R(k)?(e.enter("lineEnding"),e.consume(k),e.exit("lineEnding"),h):(e.enter("chunkString",{contentType:"string"}),p(k))}function p(k){return k===null||k===91||k===93||R(k)||u++>999?(e.exit("chunkString"),h(k)):(e.consume(k),f||(f=!U(k)),k===92?w:p)}function w(k){return k===91||k===92||k===93?(e.consume(k),u++,p):p(k)}}function Di(e,t,n,i,o,s){let l;return u;function u(w){return w===34||w===39||w===40?(e.enter(i),e.enter(o),e.consume(w),e.exit(o),l=w===40?41:w,f):n(w)}function f(w){return w===l?(e.enter(o),e.consume(w),e.exit(o),e.exit(i),t):(e.enter(s),m(w))}function m(w){return w===l?(e.exit(s),f(l)):w===null?n(w):R(w)?(e.enter("lineEnding"),e.consume(w),e.exit("lineEnding"),V(e,m,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),h(w))}function h(w){return w===l||w===null||R(w)?(e.exit("chunkString"),m(w)):(e.consume(w),w===92?p:h)}function p(w){return w===l||w===92?(e.consume(w),h):h(w)}}function mn(e,t){let n;return i;function i(o){return R(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),n=!0,i):U(o)?V(e,i,n?"linePrefix":"lineSuffix")(o):t(o)}}var Fs={name:"definition",tokenize:Gg},jg={partial:!0,tokenize:qg};function Gg(e,t,n){let i=this,o;return s;function s(k){return e.enter("definition"),l(k)}function l(k){return Oi.call(i,e,u,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(k)}function u(k){return o=Nt(i.sliceSerialize(i.events[i.events.length-1][1]).slice(1,-1)),k===58?(e.enter("definitionMarker"),e.consume(k),e.exit("definitionMarker"),f):n(k)}function f(k){return me(k)?mn(e,m)(k):m(k)}function m(k){return Li(e,h,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(k)}function h(k){return e.attempt(jg,p,p)(k)}function p(k){return U(k)?V(e,w,"whitespace")(k):w(k)}function w(k){return k===null||R(k)?(e.exit("definition"),i.parser.defined.push(o),t(k)):n(k)}}function qg(e,t,n){return i;function i(u){return me(u)?mn(e,o)(u):n(u)}function o(u){return Di(e,s,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(u)}function s(u){return U(u)?V(e,l,"whitespace")(u):l(u)}function l(u){return u===null||R(u)?t(u):n(u)}}var Ps={name:"hardBreakEscape",tokenize:Zg};function Zg(e,t,n){return i;function i(s){return e.enter("hardBreakEscape"),e.consume(s),o}function o(s){return R(s)?(e.exit("hardBreakEscape"),t(s)):n(s)}}var Ms={name:"headingAtx",resolve:Qg,tokenize:Jg};function Qg(e,t){let n=e.length-2,i=3,o,s;return e[i][1].type==="whitespace"&&(i+=2),n-2>i&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(i===n-1||n-4>i&&e[n-2][1].type==="whitespace")&&(n-=i+1===n?2:4),n>i&&(o={type:"atxHeadingText",start:e[i][1].start,end:e[n][1].end},s={type:"chunkText",start:e[i][1].start,end:e[n][1].end,contentType:"text"},Ce(e,i,n-i+1,[["enter",o,t],["enter",s,t],["exit",s,t],["exit",o,t]])),e}function Jg(e,t,n){let i=0;return o;function o(h){return e.enter("atxHeading"),s(h)}function s(h){return e.enter("atxHeadingSequence"),l(h)}function l(h){return h===35&&i++<6?(e.consume(h),l):h===null||me(h)?(e.exit("atxHeadingSequence"),u(h)):n(h)}function u(h){return h===35?(e.enter("atxHeadingSequence"),f(h)):h===null||R(h)?(e.exit("atxHeading"),t(h)):U(h)?V(e,u,"whitespace")(h):(e.enter("atxHeadingText"),m(h))}function f(h){return h===35?(e.consume(h),f):(e.exit("atxHeadingSequence"),u(h))}function m(h){return h===null||h===35||me(h)?(e.exit("atxHeadingText"),u(h)):(e.consume(h),m)}}var Uu=["address","article","aside","base","basefont","blockquote","body","caption","center","col","colgroup","dd","details","dialog","dir","div","dl","dt","fieldset","figcaption","figure","footer","form","frame","frameset","h1","h2","h3","h4","h5","h6","head","header","hr","html","iframe","legend","li","link","main","menu","menuitem","nav","noframes","ol","optgroup","option","p","param","search","section","summary","table","tbody","td","tfoot","th","thead","title","tr","track","ul"],Is=["pre","script","style","textarea"];var Ls={concrete:!0,name:"htmlFlow",resolveTo:ew,tokenize:tw},Kg={partial:!0,tokenize:rw},Xg={partial:!0,tokenize:nw};function ew(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function tw(e,t,n){let i=this,o,s,l,u,f;return m;function m(y){return h(y)}function h(y){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(y),p}function p(y){return y===33?(e.consume(y),w):y===47?(e.consume(y),s=!0,F):y===63?(e.consume(y),o=3,i.interrupt?t:b):qe(y)?(e.consume(y),l=String.fromCharCode(y),T):n(y)}function w(y){return y===45?(e.consume(y),o=2,k):y===91?(e.consume(y),o=5,u=0,v):qe(y)?(e.consume(y),o=4,i.interrupt?t:b):n(y)}function k(y){return y===45?(e.consume(y),i.interrupt?t:b):n(y)}function v(y){let Pe="CDATA[";return y===Pe.charCodeAt(u++)?(e.consume(y),u===Pe.length?i.interrupt?t:X:v):n(y)}function F(y){return qe(y)?(e.consume(y),l=String.fromCharCode(y),T):n(y)}function T(y){if(y===null||y===47||y===62||me(y)){let Pe=y===47,Ct=l.toLowerCase();return!Pe&&!s&&Is.includes(Ct)?(o=1,i.interrupt?t(y):X(y)):Uu.includes(l.toLowerCase())?(o=6,Pe?(e.consume(y),C):i.interrupt?t(y):X(y)):(o=7,i.interrupt&&!i.parser.lazy[i.now().line]?n(y):s?A(y):P(y))}return y===45||We(y)?(e.consume(y),l+=String.fromCharCode(y),T):n(y)}function C(y){return y===62?(e.consume(y),i.interrupt?t:X):n(y)}function A(y){return U(y)?(e.consume(y),A):ne(y)}function P(y){return y===47?(e.consume(y),ne):y===58||y===95||qe(y)?(e.consume(y),Y):U(y)?(e.consume(y),P):ne(y)}function Y(y){return y===45||y===46||y===58||y===95||We(y)?(e.consume(y),Y):B(y)}function B(y){return y===61?(e.consume(y),_):U(y)?(e.consume(y),B):P(y)}function _(y){return y===null||y===60||y===61||y===62||y===96?n(y):y===34||y===39?(e.consume(y),f=y,J):U(y)?(e.consume(y),_):j(y)}function J(y){return y===f?(e.consume(y),f=null,G):y===null||R(y)?n(y):(e.consume(y),J)}function j(y){return y===null||y===34||y===39||y===47||y===60||y===61||y===62||y===96||me(y)?B(y):(e.consume(y),j)}function G(y){return y===47||y===62||U(y)?P(y):n(y)}function ne(y){return y===62?(e.consume(y),oe):n(y)}function oe(y){return y===null||R(y)?X(y):U(y)?(e.consume(y),oe):n(y)}function X(y){return y===45&&o===2?(e.consume(y),ee):y===60&&o===1?(e.consume(y),ue):y===62&&o===4?(e.consume(y),Se):y===63&&o===3?(e.consume(y),b):y===93&&o===5?(e.consume(y),ze):R(y)&&(o===6||o===7)?(e.exit("htmlFlowData"),e.check(Kg,_e,N)(y)):y===null||R(y)?(e.exit("htmlFlowData"),N(y)):(e.consume(y),X)}function N(y){return e.check(Xg,H,_e)(y)}function H(y){return e.enter("lineEnding"),e.consume(y),e.exit("lineEnding"),W}function W(y){return y===null||R(y)?N(y):(e.enter("htmlFlowData"),X(y))}function ee(y){return y===45?(e.consume(y),b):X(y)}function ue(y){return y===47?(e.consume(y),l="",fe):X(y)}function fe(y){if(y===62){let Pe=l.toLowerCase();return Is.includes(Pe)?(e.consume(y),Se):X(y)}return qe(y)&&l.length<8?(e.consume(y),l+=String.fromCharCode(y),fe):X(y)}function ze(y){return y===93?(e.consume(y),b):X(y)}function b(y){return y===62?(e.consume(y),Se):y===45&&o===2?(e.consume(y),b):X(y)}function Se(y){return y===null||R(y)?(e.exit("htmlFlowData"),_e(y)):(e.consume(y),Se)}function _e(y){return e.exit("htmlFlow"),t(y)}}function nw(e,t,n){let i=this;return o;function o(l){return R(l)?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),s):n(l)}function s(l){return i.parser.lazy[i.now().line]?n(l):t(l)}}function rw(e,t,n){return i;function i(o){return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),e.attempt(qt,t,n)}}var Os={name:"htmlText",tokenize:iw};function iw(e,t,n){let i=this,o,s,l;return u;function u(b){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(b),f}function f(b){return b===33?(e.consume(b),m):b===47?(e.consume(b),B):b===63?(e.consume(b),P):qe(b)?(e.consume(b),j):n(b)}function m(b){return b===45?(e.consume(b),h):b===91?(e.consume(b),s=0,v):qe(b)?(e.consume(b),A):n(b)}function h(b){return b===45?(e.consume(b),k):n(b)}function p(b){return b===null?n(b):b===45?(e.consume(b),w):R(b)?(l=p,ue(b)):(e.consume(b),p)}function w(b){return b===45?(e.consume(b),k):p(b)}function k(b){return b===62?ee(b):b===45?w(b):p(b)}function v(b){let Se="CDATA[";return b===Se.charCodeAt(s++)?(e.consume(b),s===Se.length?F:v):n(b)}function F(b){return b===null?n(b):b===93?(e.consume(b),T):R(b)?(l=F,ue(b)):(e.consume(b),F)}function T(b){return b===93?(e.consume(b),C):F(b)}function C(b){return b===62?ee(b):b===93?(e.consume(b),C):F(b)}function A(b){return b===null||b===62?ee(b):R(b)?(l=A,ue(b)):(e.consume(b),A)}function P(b){return b===null?n(b):b===63?(e.consume(b),Y):R(b)?(l=P,ue(b)):(e.consume(b),P)}function Y(b){return b===62?ee(b):P(b)}function B(b){return qe(b)?(e.consume(b),_):n(b)}function _(b){return b===45||We(b)?(e.consume(b),_):J(b)}function J(b){return R(b)?(l=J,ue(b)):U(b)?(e.consume(b),J):ee(b)}function j(b){return b===45||We(b)?(e.consume(b),j):b===47||b===62||me(b)?G(b):n(b)}function G(b){return b===47?(e.consume(b),ee):b===58||b===95||qe(b)?(e.consume(b),ne):R(b)?(l=G,ue(b)):U(b)?(e.consume(b),G):ee(b)}function ne(b){return b===45||b===46||b===58||b===95||We(b)?(e.consume(b),ne):oe(b)}function oe(b){return b===61?(e.consume(b),X):R(b)?(l=oe,ue(b)):U(b)?(e.consume(b),oe):G(b)}function X(b){return b===null||b===60||b===61||b===62||b===96?n(b):b===34||b===39?(e.consume(b),o=b,N):R(b)?(l=X,ue(b)):U(b)?(e.consume(b),X):(e.consume(b),H)}function N(b){return b===o?(e.consume(b),o=void 0,W):b===null?n(b):R(b)?(l=N,ue(b)):(e.consume(b),N)}function H(b){return b===null||b===34||b===39||b===60||b===61||b===96?n(b):b===47||b===62||me(b)?G(b):(e.consume(b),H)}function W(b){return b===47||b===62||me(b)?G(b):n(b)}function ee(b){return b===62?(e.consume(b),e.exit("htmlTextData"),e.exit("htmlText"),t):n(b)}function ue(b){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(b),e.exit("lineEnding"),fe}function fe(b){return U(b)?V(e,ze,"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(b):ze(b)}function ze(b){return e.enter("htmlTextData"),l(b)}}var pn={name:"labelEnd",resolveAll:lw,resolveTo:uw,tokenize:cw},ow={tokenize:fw},sw={tokenize:dw},aw={tokenize:hw};function lw(e){let t=-1,n=[];for(;++t=3&&(m===null||R(m))?(e.exit("thematicBreak"),t(m)):n(m)}function f(m){return m===o?(e.consume(m),i++,f):(e.exit("thematicBreakSequence"),U(m)?V(e,u,"whitespace")(m):u(m))}}var Fe={continuation:{tokenize:bw},exit:Cw,name:"list",tokenize:xw},kw={partial:!0,tokenize:Sw},yw={partial:!0,tokenize:vw};function xw(e,t,n){let i=this,o=i.events[i.events.length-1],s=o&&o[1].type==="linePrefix"?o[2].sliceSerialize(o[1],!0).length:0,l=0;return u;function u(k){let v=i.containerState.type||(k===42||k===43||k===45?"listUnordered":"listOrdered");if(v==="listUnordered"?!i.containerState.marker||k===i.containerState.marker:Cr(k)){if(i.containerState.type||(i.containerState.type=v,e.enter(v,{_container:!0})),v==="listUnordered")return e.enter("listItemPrefix"),k===42||k===45?e.check(gn,n,m)(k):m(k);if(!i.interrupt||k===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),f(k)}return n(k)}function f(k){return Cr(k)&&++l<10?(e.consume(k),f):(!i.interrupt||l<2)&&(i.containerState.marker?k===i.containerState.marker:k===41||k===46)?(e.exit("listItemValue"),m(k)):n(k)}function m(k){return e.enter("listItemMarker"),e.consume(k),e.exit("listItemMarker"),i.containerState.marker=i.containerState.marker||k,e.check(qt,i.interrupt?n:h,e.attempt(kw,w,p))}function h(k){return i.containerState.initialBlankLine=!0,s++,w(k)}function p(k){return U(k)?(e.enter("listItemPrefixWhitespace"),e.consume(k),e.exit("listItemPrefixWhitespace"),w):n(k)}function w(k){return i.containerState.size=s+i.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(k)}}function bw(e,t,n){let i=this;return i.containerState._closeFlow=void 0,e.check(qt,o,s);function o(u){return i.containerState.furtherBlankLines=i.containerState.furtherBlankLines||i.containerState.initialBlankLine,V(e,t,"listItemIndent",i.containerState.size+1)(u)}function s(u){return i.containerState.furtherBlankLines||!U(u)?(i.containerState.furtherBlankLines=void 0,i.containerState.initialBlankLine=void 0,l(u)):(i.containerState.furtherBlankLines=void 0,i.containerState.initialBlankLine=void 0,e.attempt(yw,t,l)(u))}function l(u){return i.containerState._closeFlow=!0,i.interrupt=void 0,V(e,e.attempt(Fe,t,n),"linePrefix",i.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(u)}}function vw(e,t,n){let i=this;return V(e,o,"listItemIndent",i.containerState.size+1);function o(s){let l=i.events[i.events.length-1];return l&&l[1].type==="listItemIndent"&&l[2].sliceSerialize(l[1],!0).length===i.containerState.size?t(s):n(s)}}function Cw(e){e.exit(this.containerState.type)}function Sw(e,t,n){let i=this;return V(e,o,"listItemPrefixWhitespace",i.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function o(s){let l=i.events[i.events.length-1];return!U(s)&&l&&l[1].type==="listItemPrefixWhitespace"?t(s):n(s)}}var Ri={name:"setextUnderline",resolveTo:_w,tokenize:Ew};function _w(e,t){let n=e.length,i,o,s;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){i=n;break}e[n][1].type==="paragraph"&&(o=n)}else e[n][1].type==="content"&&e.splice(n,1),!s&&e[n][1].type==="definition"&&(s=n);let l={type:"setextHeading",start:{...e[o][1].start},end:{...e[e.length-1][1].end}};return e[o][1].type="setextHeadingText",s?(e.splice(o,0,["enter",l,t]),e.splice(s+1,0,["exit",e[i][1],t]),e[i][1].end={...e[s][1].end}):e[i][1]=l,e.push(["exit",l,t]),e}function Ew(e,t,n){let i=this,o;return s;function s(m){let h=i.events.length,p;for(;h--;)if(i.events[h][1].type!=="lineEnding"&&i.events[h][1].type!=="linePrefix"&&i.events[h][1].type!=="content"){p=i.events[h][1].type==="paragraph";break}return!i.parser.lazy[i.now().line]&&(i.interrupt||p)?(e.enter("setextHeadingLine"),o=m,l(m)):n(m)}function l(m){return e.enter("setextHeadingLineSequence"),u(m)}function u(m){return m===o?(e.consume(m),u):(e.exit("setextHeadingLineSequence"),U(m)?V(e,f,"lineSuffix")(m):f(m))}function f(m){return m===null||R(m)?(e.exit("setextHeadingLine"),t(m)):n(m)}}var Vu={tokenize:Tw};function Tw(e){let t=this,n=e.attempt(qt,i,e.attempt(this.parser.constructs.flowInitial,o,V(e,e.attempt(this.parser.constructs.flow,o,e.attempt(As,o)),"linePrefix")));return n;function i(s){if(s===null){e.consume(s);return}return e.enter("lineEndingBlank"),e.consume(s),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function o(s){if(s===null){e.consume(s);return}return e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),t.currentConstruct=void 0,n}}var $u={resolveAll:Zu()},ju=qu("string"),Gu=qu("text");function qu(e){return{resolveAll:Zu(e==="text"?Aw:void 0),tokenize:t};function t(n){let i=this,o=this.parser.constructs[e],s=n.attempt(o,l,u);return l;function l(h){return m(h)?s(h):u(h)}function u(h){if(h===null){n.consume(h);return}return n.enter("data"),n.consume(h),f}function f(h){return m(h)?(n.exit("data"),s(h)):(n.consume(h),f)}function m(h){if(h===null)return!0;let p=o[h],w=-1;if(p)for(;++wRw,contentInitial:()=>Pw,disable:()=>Nw,document:()=>Fw,flow:()=>Iw,flowInitial:()=>Mw,insideSpan:()=>Dw,string:()=>Lw,text:()=>Ow});var Fw={42:Fe,43:Fe,45:Fe,48:Fe,49:Fe,50:Fe,51:Fe,52:Fe,53:Fe,54:Fe,55:Fe,56:Fe,57:Fe,62:Ti},Pw={91:Fs},Mw={[-2]:_r,[-1]:_r,32:_r},Iw={35:Ms,42:gn,45:[Ri,gn],60:Ls,61:Ri,95:gn,96:Pi,126:Pi},Lw={38:Fi,92:Ai},Ow={[-5]:Tr,[-4]:Tr,[-3]:Tr,33:Ds,38:Fi,42:Sr,60:[Es,Os],91:Rs,92:[Ps,Ai],93:pn,95:Sr,96:Ts},Dw={null:[Sr,$u]},Rw={null:[42,95]},Nw={null:[]};function Qu(e,t,n){let i={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0},o={},s=[],l=[],u=[],f=!0,m={attempt:G(J),check:G(j),consume:Y,enter:B,exit:_,interrupt:G(j,{interrupt:!0})},h={code:null,containerState:{},defineSkip:C,events:[],now:T,parser:e,previous:null,sliceSerialize:v,sliceStream:F,write:k},p=t.tokenize.call(h,m),w;return t.resolveAll&&s.push(t),h;function k(N){return l=Ye(l,N),A(),l[l.length-1]!==null?[]:(ne(t,0),h.events=Hn(s,h.events,h),h.events)}function v(N,H){return Ww(F(N),H)}function F(N){return Yw(l,N)}function T(){let{_bufferIndex:N,_index:H,line:W,column:ee,offset:ue}=i;return{_bufferIndex:N,_index:H,line:W,column:ee,offset:ue}}function C(N){o[N.line]=N.column,X()}function A(){let N;for(;i._index-1){let u=l[0];typeof u=="string"?l[0]=u.slice(i):l.shift()}s>0&&l.push(e[o].slice(0,s))}return l}function Ww(e,t){let n=-1,i=[],o;for(;++n0){let Ee=L.tokenStack[L.tokenStack.length-1];(Ee[1]||ec).call(L,void 0,Ee[0])}for(I.position={start:Qt(E.length>0?E[0][1].start:{line:1,column:1,offset:0}),end:Qt(E.length>0?E[E.length-2][1].end:{line:1,column:1,offset:0})},re=-1;++re "),s.shift(2);let l=n.indentLines(n.containerFlow(e,s.current()),jw);return o(),l}function jw(e,t,n){return">"+(n?"":" ")+e}function Yi(e,t){return ac(e,t.inConstruct,!0)&&!ac(e,t.notInConstruct,!1)}function ac(e,t,n){if(typeof t=="string"&&(t=[t]),!t||t.length===0)return n;let i=-1;for(;++il&&(l=s):s=1,o=i+t.length,i=n.indexOf(t,o);return l}function Ar(e,t){return!!(t.options.fences===!1&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}function uc(e){let t=e.options.fence||"`";if(t!=="`"&&t!=="~")throw new Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}function cc(e,t,n,i){let o=uc(n),s=e.value||"",l=o==="`"?"GraveAccent":"Tilde";if(Ar(e,n)){let p=n.enter("codeIndented"),w=n.indentLines(s,Gw);return p(),w}let u=n.createTracker(i),f=o.repeat(Math.max(lc(s,o)+1,3)),m=n.enter("codeFenced"),h=u.move(f);if(e.lang){let p=n.enter(`codeFencedLang${l}`);h+=u.move(n.safe(e.lang,{before:h,after:" ",encode:["`"],...u.current()})),p()}if(e.lang&&e.meta){let p=n.enter(`codeFencedMeta${l}`);h+=u.move(" "),h+=u.move(n.safe(e.meta,{before:h,after:` -`,encode:["`"],...u.current()})),p()}return h+=u.move(` -`),s&&(h+=u.move(s+` -`)),h+=u.move(f),m(),h}function Gw(e,t,n){return(n?"":" ")+e}function Vn(e){let t=e.options.quote||'"';if(t!=='"'&&t!=="'")throw new Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function fc(e,t,n,i){let o=Vn(n),s=o==='"'?"Quote":"Apostrophe",l=n.enter("definition"),u=n.enter("label"),f=n.createTracker(i),m=f.move("[");return m+=f.move(n.safe(n.associationId(e),{before:m,after:"]",...f.current()})),m+=f.move("]: "),u(),!e.url||/[\0- \u007F]/.test(e.url)?(u=n.enter("destinationLiteral"),m+=f.move("<"),m+=f.move(n.safe(e.url,{before:m,after:">",...f.current()})),m+=f.move(">")):(u=n.enter("destinationRaw"),m+=f.move(n.safe(e.url,{before:m,after:e.title?" ":` -`,...f.current()}))),u(),e.title&&(u=n.enter(`title${s}`),m+=f.move(" "+o),m+=f.move(n.safe(e.title,{before:m,after:o,...f.current()})),m+=f.move(o),u()),l(),m}function dc(e){let t=e.options.emphasis||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}function Ze(e){return"&#x"+e.toString(16).toUpperCase()+";"}function $n(e,t,n){let i=Bn(e),o=Bn(t);return i===void 0?o===void 0?n==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:o===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:i===1?o===void 0?{inside:!1,outside:!1}:o===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:o===void 0?{inside:!1,outside:!1}:o===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}$s.peek=qw;function $s(e,t,n,i){let o=dc(n),s=n.enter("emphasis"),l=n.createTracker(i),u=l.move(o),f=l.move(n.containerPhrasing(e,{after:o,before:u,...l.current()})),m=f.charCodeAt(0),h=$n(i.before.charCodeAt(i.before.length-1),m,o);h.inside&&(f=Ze(m)+f.slice(1));let p=f.charCodeAt(f.length-1),w=$n(i.after.charCodeAt(0),p,o);w.inside&&(f=f.slice(0,-1)+Ze(p));let k=l.move(o);return s(),n.attentionEncodeSurroundingInfo={after:w.outside,before:h.outside},u+f+k}function qw(e,t,n){return n.options.emphasis||"*"}var jn=function(e){if(e==null)return Kw;if(typeof e=="function")return Wi(e);if(typeof e=="object")return Array.isArray(e)?Zw(e):Qw(e);if(typeof e=="string")return Jw(e);throw new Error("Expected function, string, or object as test")};function Zw(e){let t=[],n=-1;for(;++n":""))+")"})}return w;function w(){let k=mc,v,F,T;if((!t||s(f,m,h[h.length-1]||void 0))&&(k=ek(n(f,h)),k[0]===wn))return k;if("children"in f&&f.children){let C=f;if(C.children&&k[0]!==Bi)for(F=(i?C.children.length:-1)+l,T=h.concat(C);F>-1&&F",...f.current()})),m+=f.move(">")):(u=n.enter("destinationRaw"),m+=f.move(n.safe(e.url,{before:m,after:e.title?" ":")",...f.current()}))),u(),e.title&&(u=n.enter(`title${s}`),m+=f.move(" "+o),m+=f.move(n.safe(e.title,{before:m,after:o,...f.current()})),m+=f.move(o),u()),m+=f.move(")"),l(),m}function nk(){return"!"}Qs.peek=rk;function Qs(e,t,n,i){let o=e.referenceType,s=n.enter("imageReference"),l=n.enter("label"),u=n.createTracker(i),f=u.move("!["),m=n.safe(e.alt,{before:f,after:"]",...u.current()});f+=u.move(m+"]["),l();let h=n.stack;n.stack=[],l=n.enter("reference");let p=n.safe(n.associationId(e),{before:f,after:"]",...u.current()});return l(),n.stack=h,s(),o==="full"||!m||m!==p?f+=u.move(p+"]"):o==="shortcut"?f=f.slice(0,-1):f+=u.move("]"),f}function rk(){return"!"}Js.peek=ik;function Js(e,t,n){let i=e.value||"",o="`",s=-1;for(;new RegExp("(^|[^`])"+o+"([^`]|$)").test(i);)o+="`";for(/[^ \r\n]/.test(i)&&(/^[ \r\n]/.test(i)&&/[ \r\n]$/.test(i)||/^`|`$/.test(i))&&(i=" "+i+" ");++s\u007F]/.test(e.url))}Xs.peek=ok;function Xs(e,t,n,i){let o=Vn(n),s=o==='"'?"Quote":"Apostrophe",l=n.createTracker(i),u,f;if(Ks(e,n)){let h=n.stack;n.stack=[],u=n.enter("autolink");let p=l.move("<");return p+=l.move(n.containerPhrasing(e,{before:p,after:">",...l.current()})),p+=l.move(">"),u(),n.stack=h,p}u=n.enter("link"),f=n.enter("label");let m=l.move("[");return m+=l.move(n.containerPhrasing(e,{before:m,after:"](",...l.current()})),m+=l.move("]("),f(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(f=n.enter("destinationLiteral"),m+=l.move("<"),m+=l.move(n.safe(e.url,{before:m,after:">",...l.current()})),m+=l.move(">")):(f=n.enter("destinationRaw"),m+=l.move(n.safe(e.url,{before:m,after:e.title?" ":")",...l.current()}))),f(),e.title&&(f=n.enter(`title${s}`),m+=l.move(" "+o),m+=l.move(n.safe(e.title,{before:m,after:o,...l.current()})),m+=l.move(o),f()),m+=l.move(")"),u(),m}function ok(e,t,n){return Ks(e,n)?"<":"["}ea.peek=sk;function ea(e,t,n,i){let o=e.referenceType,s=n.enter("linkReference"),l=n.enter("label"),u=n.createTracker(i),f=u.move("["),m=n.containerPhrasing(e,{before:f,after:"]",...u.current()});f+=u.move(m+"]["),l();let h=n.stack;n.stack=[],l=n.enter("reference");let p=n.safe(n.associationId(e),{before:f,after:"]",...u.current()});return l(),n.stack=h,s(),o==="full"||!m||m!==p?f+=u.move(p+"]"):o==="shortcut"?f=f.slice(0,-1):f+=u.move("]"),f}function sk(){return"["}function Gn(e){let t=e.options.bullet||"*";if(t!=="*"&&t!=="+"&&t!=="-")throw new Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function gc(e){let t=Gn(e),n=e.options.bulletOther;if(!n)return t==="*"?"-":"*";if(n!=="*"&&n!=="+"&&n!=="-")throw new Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw new Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}function wc(e){let t=e.options.bulletOrdered||".";if(t!=="."&&t!==")")throw new Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function Ui(e){let t=e.options.rule||"*";if(t!=="*"&&t!=="-"&&t!=="_")throw new Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function kc(e,t,n,i){let o=n.enter("list"),s=n.bulletCurrent,l=e.ordered?wc(n):Gn(n),u=e.ordered?l==="."?")":".":gc(n),f=t&&n.bulletLastUsed?l===n.bulletLastUsed:!1;if(!e.ordered){let h=e.children?e.children[0]:void 0;if((l==="*"||l==="-")&&h&&(!h.children||!h.children[0])&&n.stack[n.stack.length-1]==="list"&&n.stack[n.stack.length-2]==="listItem"&&n.stack[n.stack.length-3]==="list"&&n.stack[n.stack.length-4]==="listItem"&&n.indexStack[n.indexStack.length-1]===0&&n.indexStack[n.indexStack.length-2]===0&&n.indexStack[n.indexStack.length-3]===0&&(f=!0),Ui(n)===l&&h){let p=-1;for(;++p-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+s);let l=s.length+1;(o==="tab"||o==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))&&(l=Math.ceil(l/4)*4);let u=n.createTracker(i);u.move(s+" ".repeat(l-s.length)),u.shift(l);let f=n.enter("listItem"),m=n.indentLines(n.containerFlow(e,u.current()),h);return f(),m;function h(p,w,k){return w?(k?"":" ".repeat(l))+p:(k?s:s+" ".repeat(l-s.length))+p}}function bc(e,t,n,i){let o=n.enter("paragraph"),s=n.enter("phrasing"),l=n.containerPhrasing(e,i);return s(),o(),l}var ta=jn(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function vc(e,t,n,i){return(e.children.some(function(l){return ta(l)})?n.containerPhrasing:n.containerFlow).call(n,e,i)}function Cc(e){let t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}na.peek=ak;function na(e,t,n,i){let o=Cc(n),s=n.enter("strong"),l=n.createTracker(i),u=l.move(o+o),f=l.move(n.containerPhrasing(e,{after:o,before:u,...l.current()})),m=f.charCodeAt(0),h=$n(i.before.charCodeAt(i.before.length-1),m,o);h.inside&&(f=Ze(m)+f.slice(1));let p=f.charCodeAt(f.length-1),w=$n(i.after.charCodeAt(0),p,o);w.inside&&(f=f.slice(0,-1)+Ze(p));let k=l.move(o+o);return s(),n.attentionEncodeSurroundingInfo={after:w.outside,before:h.outside},u+f+k}function ak(e,t,n){return n.options.strong||"*"}function Sc(e,t,n,i){return n.safe(e.value,i)}function _c(e){let t=e.options.ruleRepetition||3;if(t<3)throw new Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function Ec(e,t,n){let i=(Ui(n)+(n.options.ruleSpaces?" ":"")).repeat(_c(n));return n.options.ruleSpaces?i.slice(0,-1):i}var Tc={blockquote:sc,break:Vs,code:cc,definition:fc,emphasis:$s,hardBreak:Vs,heading:pc,html:qs,image:Zs,imageReference:Qs,inlineCode:Js,link:Xs,linkReference:ea,list:kc,listItem:xc,paragraph:bc,root:vc,strong:na,text:Sc,thematicBreak:Ec};var Ac=[lk];function lk(e,t,n,i){if(t.type==="code"&&Ar(t,i)&&(e.type==="list"||e.type===t.type&&Ar(e,i)))return!1;if("spread"in n&&typeof n.spread=="boolean")return e.type==="paragraph"&&(e.type===t.type||t.type==="definition"||t.type==="heading"&&Hi(t,i))?void 0:n.spread?1:0}var kn=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"],Fc=[{character:" ",after:"[\\r\\n]",inConstruct:"phrasing"},{character:" ",before:"[\\r\\n]",inConstruct:"phrasing"},{character:" ",inConstruct:["codeFencedLangGraveAccent","codeFencedLangTilde"]},{character:"\r",inConstruct:["codeFencedLangGraveAccent","codeFencedLangTilde","codeFencedMetaGraveAccent","codeFencedMetaTilde","destinationLiteral","headingAtx"]},{character:` -`,inConstruct:["codeFencedLangGraveAccent","codeFencedLangTilde","codeFencedMetaGraveAccent","codeFencedMetaTilde","destinationLiteral","headingAtx"]},{character:" ",after:"[\\r\\n]",inConstruct:"phrasing"},{character:" ",before:"[\\r\\n]",inConstruct:"phrasing"},{character:" ",inConstruct:["codeFencedLangGraveAccent","codeFencedLangTilde"]},{character:"!",after:"\\[",inConstruct:"phrasing",notInConstruct:kn},{character:'"',inConstruct:"titleQuote"},{atBreak:!0,character:"#"},{character:"#",inConstruct:"headingAtx",after:`(?:[\r -]|$)`},{character:"&",after:"[#A-Za-z]",inConstruct:"phrasing"},{character:"'",inConstruct:"titleApostrophe"},{character:"(",inConstruct:"destinationRaw"},{before:"\\]",character:"(",inConstruct:"phrasing",notInConstruct:kn},{atBreak:!0,before:"\\d+",character:")"},{character:")",inConstruct:"destinationRaw"},{atBreak:!0,character:"*",after:`(?:[ \r -*])`},{character:"*",inConstruct:"phrasing",notInConstruct:kn},{atBreak:!0,character:"+",after:`(?:[ \r -])`},{atBreak:!0,character:"-",after:`(?:[ \r --])`},{atBreak:!0,before:"\\d+",character:".",after:`(?:[ \r -]|$)`},{atBreak:!0,character:"<",after:"[!/?A-Za-z]"},{character:"<",after:"[!/?A-Za-z]",inConstruct:"phrasing",notInConstruct:kn},{character:"<",inConstruct:"destinationLiteral"},{atBreak:!0,character:"="},{atBreak:!0,character:">"},{character:">",inConstruct:"destinationLiteral"},{atBreak:!0,character:"["},{character:"[",inConstruct:"phrasing",notInConstruct:kn},{character:"[",inConstruct:["label","reference"]},{character:"\\",after:"[\\r\\n]",inConstruct:"phrasing"},{character:"]",inConstruct:["label","reference"]},{atBreak:!0,character:"_"},{character:"_",inConstruct:"phrasing",notInConstruct:kn},{atBreak:!0,character:"`"},{character:"`",inConstruct:["codeFencedLangGraveAccent","codeFencedMetaGraveAccent"]},{character:"`",inConstruct:"phrasing",notInConstruct:kn},{atBreak:!0,character:"~"}];function Pc(e){return e.label||!e.identifier?e.label||"":Ni(e.identifier)}function Mc(e){if(!e._compiled){let t=(e.atBreak?"[\\r\\n][\\t ]*":"")+(e.before?"(?:"+e.before+")":"");e._compiled=new RegExp((t?"("+t+")":"")+(/[|\\{}()[\]^$+*?.-]/.test(e.character)?"\\":"")+e.character+(e.after?"(?:"+e.after+")":""),"g")}return e._compiled}function Ic(e,t,n){let i=t.indexStack,o=e.children||[],s=[],l=-1,u=n.before,f;i.push(-1);let m=t.createTracker(n);for(;++l0&&(u==="\r"||u===` -`)&&h.type==="html"&&(s[s.length-1]=s[s.length-1].replace(/(\r?\n|\r)$/," "),u=" ",m=t.createTracker(n),m.move(s.join("")));let w=t.handle(h,e,t,{...m.current(),after:p,before:u});f&&f===w.slice(0,1)&&(w=Ze(f.charCodeAt(0))+w.slice(1));let k=t.attentionEncodeSurroundingInfo;t.attentionEncodeSurroundingInfo=void 0,f=void 0,k&&(s.length>0&&k.before&&u===s[s.length-1].slice(-1)&&(s[s.length-1]=s[s.length-1].slice(0,-1)+Ze(u.charCodeAt(0))),k.after&&(f=p)),m.move(w),s.push(w),u=w.slice(-1)}return i.pop(),s.join("")}function Lc(e,t,n){let i=t.indexStack,o=e.children||[],s=t.createTracker(n),l=[],u=-1;for(i.push(-1);++u>>>>>> origin/main `}return` -<<<<<<< HEAD `}var cf=b(()=>{});function ff(e,t){let r=[],n=0,i=0,o;for(;o=Qy.exec(e);)a(e.slice(n,o.index)),r.push(o[0]),n=o.index+o[0].length,i++;return a(e.slice(n)),r.join("");function a(s){r.push(t(s,i,!s))}}var Qy,pf=b(()=>{Qy=/\r?\n|\r/g});function df(e,t,r){let n=(r.before||"")+(t||"")+(r.after||""),i=[],o=[],a={},s=-1;for(;++s=c||u+1{Nt();wo()});function gf(e){let t=e||{},r=t.now||{},n=t.lineShift||0,i=r.line||1,o=r.column||1;return{move:l,current:a,shift:s};function a(){return{now:{line:i,column:o},lineShift:n}}function s(c){n+=c}function l(c){let u=c||"",f=u.split(/\r?\n|\r/g),p=f[f.length-1];return i+=f.length-1,o=f.length===1?o+p.length:1+p.length+n,u}}var bf=b(()=>{});function Mo(e,t){let r=t||{},n={associationId:rf,containerPhrasing:ev,containerFlow:tv,createTracker:gf,compilePattern:of,enter:o,handlers:{...Yc},handle:void 0,indentLines:ff,indexStack:[],join:[...Xc],options:{},safe:rv,stack:[],unsafe:[...ef]};bo(n,r),n.options.tightDefinitions&&n.join.push(Zy),n.handle=Uu("type",{invalid:Ky,unknown:Xy,handlers:n.handlers});let i=n.handle(e,void 0,n,{before:` `,after:` `,now:{line:1,column:1},lineShift:0});return i&&i.charCodeAt(i.length-1)!==10&&i.charCodeAt(i.length-1)!==13&&(i+=` @@ -198,35 +83,5 @@ No problems found `+r),s.movedAttachments.push({newPath:r,oldPath:a}),await(0,ce.renameSafe)(this.plugin.app,t,r),await(0,ce.copySafe)(this.plugin.app,t,a);else if(!i){let f=(0,ce.getAvailablePath)(this.plugin.app,r);console.log(this.consoleLogPrefix+`copy file with new name [from, to]: `+a+` `+f),s.movedAttachments.push({newPath:f,oldPath:t.path}),await(0,ce.renameSafe)(this.plugin.app,t,f),await(0,ce.copySafe)(this.plugin.app,t,a),s.renamedFiles.push({newPath:f,oldPath:r})}return this.plugin.settingsCopy.deleteEmptyFolders&&await(0,Ch.deleteEmptyFolderHierarchy)(this.plugin.app,c),s}};var n1=globalThis.process??{browser:!0,cwd:()=>"/",env:{},platform:"android"},jn=class extends Ah.PluginBase{deletedNoteCache=new Map;fh;lh;async saveSettings(t){await super.saveSettings(t),this.lh=new br(this,"Consistent Attachments and Links: "),this.fh=new kr(this,this.lh,"Consistent Attachments and Links: ")}createPluginSettings(t){return new qn(t)}createPluginSettingsTab(){return new Rn(this)}async onLayoutReady(){await this.showBackupWarning()}onloadComplete(){this.registerEvent(this.app.metadataCache.on("deleted",(t,r)=>{r&&this.handleDeletedMetadata(t,r)})),(0,Eh.registerRenameDeleteHandlers)(this,()=>({isPathIgnored:r=>this.settings.isPathIgnored(r),shouldDeleteConflictingAttachments:this.settings.deleteExistFilesWhenMoveNote,shouldDeleteEmptyFolders:this.settings.deleteEmptyFolders,shouldHandleDeletions:this.settings.deleteAttachmentsWithNote,shouldHandleRenames:this.settings.updateLinks,shouldRenameAttachmentFolder:this.settings.moveAttachmentsWithNote,shouldUpdateFilenameAliases:this.settings.changeNoteBacklinksAlt})),this.addCommand({callback:()=>this.collectAllAttachments(),id:"collect-all-attachments",name:"Collect All Attachments"}),this.addCommand({checkCallback:t=>this.collectAttachmentsCurrentFolder(t),id:"collect-attachments-current-folder",name:"Collect Attachments in Current Folder"}),this.addCommand({checkCallback:this.collectAttachmentsCurrentNote.bind(this),id:"collect-attachments-current-note",name:"Collect Attachments in Current Note"}),this.addCommand({callback:()=>this.deleteEmptyFolders(),id:"delete-empty-folders",name:"Delete Empty Folders"}),this.addCommand({callback:()=>this.convertAllLinkPathsToRelative(),id:"convert-all-link-paths-to-relative",name:"Convert All Link Paths to Relative"}),this.addCommand({checkCallback:this.convertAllLinkPathsToRelativeCurrentNote.bind(this),id:"convert-all-link-paths-to-relative-current-note",name:"Convert All Link Paths to Relative in Current Note"}),this.addCommand({callback:()=>this.convertAllEmbedsPathsToRelative(),id:"convert-all-embed-paths-to-relative",name:"Convert All Embed Paths to Relative"}),this.addCommand({checkCallback:this.convertAllEmbedsPathsToRelativeCurrentNote.bind(this),id:"convert-all-embed-paths-to-relative-current-note",name:"Convert All Embed Paths to Relative in Current Note"}),this.addCommand({callback:()=>this.replaceAllWikilinksWithMarkdownLinks(),id:"replace-all-wikilinks-with-markdown-links",name:"Replace All Wiki Links with Markdown Links"}),this.addCommand({checkCallback:this.replaceAllWikilinksWithMarkdownLinksCurrentNote.bind(this),id:"replace-all-wikilinks-with-markdown-links-current-note",name:"Replace All Wiki Links with Markdown Links in Current Note"}),this.addCommand({callback:()=>this.replaceAllWikiEmbedsWithMarkdownEmbeds(),id:"replace-all-wiki-embeds-with-markdown-embeds",name:"Replace All Wiki Embeds with Markdown Embeds"}),this.addCommand({checkCallback:this.replaceAllWikiEmbedsWithMarkdownEmbedsCurrentNote.bind(this),id:"replace-all-wiki-embeds-with-markdown-embeds-current-note",name:"Replace All Wiki Embeds with Markdown Embeds in Current Note"}),this.addCommand({callback:()=>this.reorganizeVault(),id:"reorganize-vault",name:"Reorganize Vault"}),this.addCommand({callback:()=>this.checkConsistency(),id:"check-consistency",name:"Check Vault consistency"}),this.registerEvent(this.app.metadataCache.on("changed",t=>{(0,et.addToQueue)(this.app,()=>this.handleMetadataCacheChanged(t))})),this.registerEvent(this.app.workspace.on("file-menu",(t,r)=>{this.handleFileMenu(t,r)})),this.lh=new br(this,"Consistent Attachments and Links: "),this.fh=new kr(this,this.lh,"Consistent Attachments and Links: ")}async checkConsistency(){await this.saveAllOpenNotes();let t=new yt("Bad links"),r=new yt("Bad embeds"),n=new yt("Wiki links"),i=new yt("Wiki embeds");await(0,vt.loop)({abortSignal:this.abortSignal,buildNoticeMessage:(c,u)=>`Checking note ${u} - ${c.path}`,items:(0,tt.getMarkdownFilesSorted)(this.app),processItem:async c=>{await this.lh.checkConsistency(c,t,r,n,i)},shouldContinueOnError:!0});let o=this.settings.consistencyReportFile,a=t.toString(this.app,o)+r.toString(this.app,o)+n.toString(this.app,o)+i.toString(this.app,o);await(0,tt.createFolderSafe)(this.app,(0,Sh.dirname)(o));let s=await(0,be.getOrCreateFile)(this.app,o);await this.app.vault.modify(s,a);let l=!1;this.app.workspace.iterateAllLeaves(c=>{c.getDisplayText()!=""&&o.startsWith(c.getDisplayText())&&(l=!0)}),l||await this.app.workspace.openLinkText(o,"/",!1)}async collectAllAttachments(){await this.collectAttachmentsInFolder("/")}async collectAttachments(t,r=!0){if(this.settings.isPathIgnored(t.path)){new Z.Notice("Note path is ignored");return}await this.saveAllOpenNotes();let n=await this.fh.collectAttachmentsForCachedNote(t.path,this.settings.deleteExistFilesWhenMoveNote,this.settings.deleteEmptyFolders);n.movedAttachments.length>0&&await this.lh.updateChangedPathsInNote(t.path,n.movedAttachments),n.movedAttachments.length==0?r&&new Z.Notice("No files found that need to be moved"):new Z.Notice(`Moved ${n.movedAttachments.length.toString()} attachment${n.movedAttachments.length>1?"s":""}`)}collectAttachmentsCurrentFolder(t){let r=this.app.workspace.getActiveFile();return!r||!(0,be.isMarkdownFile)(this.app,r)?!1:(t||(0,et.addToQueue)(this.app,()=>this.collectAttachmentsInFolder(r.parent?.path??"/")),!0)}collectAttachmentsCurrentNote(t){let r=this.app.workspace.getActiveFile();return!r||!(0,be.isMarkdownFile)(this.app,r)?!1:(t||(0,et.addToQueue)(this.app,()=>this.collectAttachments(r)),!0)}async collectAttachmentsInFolder(t){let r=0,n=0;await this.saveAllOpenNotes(),await(0,vt.loop)({abortSignal:this.abortSignal,buildNoticeMessage:(i,o)=>`Collecting attachments ${o} - ${i.path}`,items:(0,be.getMarkdownFiles)(this.app,t,!0),processItem:async i=>{if(this.settings.isPathIgnored(i.path))return;let o=await this.fh.collectAttachmentsForCachedNote(i.path,this.settings.deleteExistFilesWhenMoveNote,this.settings.deleteEmptyFolders);o.movedAttachments.length>0&&(await this.lh.updateChangedPathsInNote(i.path,o.movedAttachments),r+=o.movedAttachments.length,n++)},shouldContinueOnError:!0}),r==0?new Z.Notice("No files found that need to be moved"):new Z.Notice(`Moved ${r.toString()} attachment${r>1?"s":""} from ${n.toString()} note${n>1?"s":""}`)}async convertAllEmbedsPathsToRelative(){await this.saveAllOpenNotes();let t=0,r=0;await(0,vt.loop)({abortSignal:this.abortSignal,buildNoticeMessage:(n,i)=>`Converting embed paths to relative ${i} - ${n.path}`,items:(0,tt.getMarkdownFilesSorted)(this.app),processItem:async n=>{if(this.settings.isPathIgnored(n.path))return;let i=await this.lh.convertAllNoteEmbedsPathsToRelative(n.path);i.length>0&&(t+=i.length,r++)},shouldContinueOnError:!0}),t==0?new Z.Notice("No embeds found that need to be converted"):new Z.Notice(`Converted ${t.toString()} embed${t>1?"s":""} from ${r.toString()} note${r>1?"s":""}`)}convertAllEmbedsPathsToRelativeCurrentNote(t){let r=this.app.workspace.getActiveFile();return!r||!(0,be.isMarkdownFile)(this.app,r)?!1:(t||(0,et.addToQueue)(this.app,(0,yr.omitAsyncReturnType)(()=>this.lh.convertAllNoteEmbedsPathsToRelative(r.path))),!0)}async convertAllLinkPathsToRelative(){await this.saveAllOpenNotes();let t=0,r=0;await(0,vt.loop)({abortSignal:this.abortSignal,buildNoticeMessage:(n,i)=>`Converting link paths to relative ${i} - ${n.path}`,items:(0,tt.getMarkdownFilesSorted)(this.app),processItem:async n=>{if(this.settings.isPathIgnored(n.path))return;let i=await this.lh.convertAllNoteLinksPathsToRelative(n.path);i.length>0&&(t+=i.length,r++)},shouldContinueOnError:!0}),t==0?new Z.Notice("No links found that need to be converted"):new Z.Notice(`Converted ${t.toString()} link${t>1?"s":""} from ${r.toString()} note${r>1?"s":""}`)}convertAllLinkPathsToRelativeCurrentNote(t){let r=this.app.workspace.getActiveFile();return!r||!(0,be.isMarkdownFile)(this.app,r)?!1:(t||(0,et.addToQueue)(this.app,(0,yr.omitAsyncReturnType)(()=>this.lh.convertAllNoteLinksPathsToRelative(r.path))),!0)}async deleteEmptyFolders(){await this.fh.deleteEmptyFolders("/")}handleDeletedMetadata(t,r){!this.settings.deleteAttachmentsWithNote||this.settings.isPathIgnored(t.path)||!(0,be.isMarkdownFile)(this.app,t)||this.deletedNoteCache.set(t.path,r)}handleFileMenu(t,r){(0,be.isFolder)(r)&&t.addItem(n=>{n.setTitle("Collect attachments in folder").setIcon("download").onClick(()=>this.collectAttachmentsInFolder(r.path))})}async handleMetadataCacheChanged(t){if(!this.settings.autoCollectAttachments)return;let r=document.querySelector(".suggestion-container");r&&r.style.display!=="none"||await this.collectAttachments(t,!1)}async reorganizeVault(){await this.saveAllOpenNotes(),await this.replaceAllWikilinksWithMarkdownLinks(),await this.replaceAllWikiEmbedsWithMarkdownEmbeds(),await this.convertAllEmbedsPathsToRelative(),await this.convertAllLinkPathsToRelative(),await this.collectAllAttachments(),await this.deleteEmptyFolders(),new Z.Notice("Reorganization of the vault completed")}async replaceAllWikiEmbedsWithMarkdownEmbeds(){await this.saveAllOpenNotes();let t=0,r=0;await(0,vt.loop)({abortSignal:this.abortSignal,buildNoticeMessage:(n,i)=>`Replacing wiki embeds with markdown embeds ${i} - ${n.path}`,items:(0,tt.getMarkdownFilesSorted)(this.app),processItem:async n=>{if(this.settings.isPathIgnored(n.path))return;let i=await this.lh.replaceAllNoteWikilinksWithMarkdownLinks(n.path,!0);t+=i,r++},shouldContinueOnError:!0}),t==0?new Z.Notice("No wiki embeds found that need to be replaced"):new Z.Notice(`Replaced ${t.toString()} wiki embed${t>1?"s":""} from ${r.toString()} note${r>1?"s":""}`)}replaceAllWikiEmbedsWithMarkdownEmbedsCurrentNote(t){let r=this.app.workspace.getActiveFile();return!r||!(0,be.isMarkdownFile)(this.app,r)?!1:(t||(0,et.addToQueue)(this.app,(0,yr.omitAsyncReturnType)(()=>this.lh.replaceAllNoteWikilinksWithMarkdownLinks(r.path,!0))),!0)}async replaceAllWikilinksWithMarkdownLinks(){await this.saveAllOpenNotes();let t=0,r=0;await(0,vt.loop)({abortSignal:this.abortSignal,buildNoticeMessage:(n,i)=>`Replacing wikilinks with markdown links ${i} - ${n.path}`,items:(0,tt.getMarkdownFilesSorted)(this.app),processItem:async n=>{if(this.settings.isPathIgnored(n.path))return;let i=await this.lh.replaceAllNoteWikilinksWithMarkdownLinks(n.path,!1);t+=i,r++},shouldContinueOnError:!0}),t==0?new Z.Notice("No wiki links found that need to be replaced"):new Z.Notice(`Replaced ${t.toString()} wikilink${t>1?"s":""} from ${r.toString()} note${r>1?"s":""}`)}replaceAllWikilinksWithMarkdownLinksCurrentNote(t){let r=this.app.workspace.getActiveFile();return!r||!(0,be.isMarkdownFile)(this.app,r)?!1:(t||(0,et.addToQueue)(this.app,(0,yr.omitAsyncReturnType)(()=>this.lh.replaceAllNoteWikilinksWithMarkdownLinks(r.path,!1))),!0)}async saveAllOpenNotes(){for(let t of this.app.workspace.getLeavesOfType("markdown"))t.view instanceof Z.MarkdownView&&await t.view.save()}async showBackupWarning(){this.settings.showBackupWarning&&(await(0,Ph.alert)({app:this.app,message:createFragment(t=>{t.createDiv({cls:"community-modal-readme"},r=>{r.appendText("Using 'Consistent Attachments and Links' plugin without proper configuration might lead to inconvenient attachment rearrangements or even data loss in your vault."),r.createEl("br"),r.appendText("It is "),r.createEl("strong",{text:"STRONGLY"}),r.appendText(" recommended to backup your vault before using the plugin."),r.createEl("br"),this.settings.hadDangerousSettingsReverted&&(r.appendText("Some of your plugin settings has been changed to their safe values."),r.createEl("br")),r.createEl("a",{href:"https://github.com/dy-sh/obsidian-consistent-attachments-and-links?tab=readme-ov-file",text:"Read more"}),r.appendText(" about how to use the plugin."),r.createEl("br"),r.appendText("This warning will not appear again.")})}),title:createFragment(t=>{(0,Z.setIcon)(t.createSpan(),"triangle-alert"),t.appendText(" Consistent Attachments and Links")})}),this.settings.showBackupWarning=!1,await this.saveSettings(this.settings))}};var iC=jn; -======= -`}var ck=/\r?\n|\r/g;function Oc(e,t){let n=[],i=0,o=0,s;for(;s=ck.exec(e);)l(e.slice(i,s.index)),n.push(s[0]),i=s.index+s[0].length,o++;return l(e.slice(i)),n.join("");function l(u){n.push(t(u,o,!u))}}function Rc(e,t,n){let i=(n.before||"")+(t||"")+(n.after||""),o=[],s=[],l={},u=-1;for(;++u=m||h+1l.length,f;u&&l.push(o);try{f=e.apply(this,l)}catch(m){let h=m;if(u&&n)throw h;return o(h)}u||(f&&f.then&&typeof f.then=="function"?f.then(s,o):f instanceof Error?o(f):s(f))}function o(l,...u){n||(n=!0,t(l,...u))}function s(l){o(null,l)}}var ve=class extends Error{constructor(t,n,i){super(),typeof n=="string"&&(i=n,n=void 0);let o="",s={},l=!1;if(n&&("line"in n&&"column"in n?s={place:n}:"start"in n&&"end"in n?s={place:n}:"type"in n?s={ancestors:[n],place:n.position}:s={...n}),typeof t=="string"?o=t:!s.cause&&t&&(l=!0,o=t.message,s.cause=t),!s.ruleId&&!s.source&&typeof i=="string"){let f=i.indexOf(":");f===-1?s.ruleId=i:(s.source=i.slice(0,f),s.ruleId=i.slice(f+1))}if(!s.place&&s.ancestors&&s.ancestors){let f=s.ancestors[s.ancestors.length-1];f&&(s.place=f.position)}let u=s.place&&"start"in s.place?s.place.start:s.place;this.ancestors=s.ancestors||void 0,this.cause=s.cause||void 0,this.column=u?u.column:void 0,this.fatal=void 0,this.file,this.message=o,this.line=u?u.line:void 0,this.name=Zt(s.place)||"1:1",this.place=s.place||void 0,this.reason=this.message,this.ruleId=s.ruleId||void 0,this.source=s.source||void 0,this.stack=l&&s.cause&&typeof s.cause.stack=="string"?s.cause.stack:"",this.actual,this.expected,this.note,this.url}};ve.prototype.file="";ve.prototype.name="";ve.prototype.reason="";ve.prototype.message="";ve.prototype.stack="";ve.prototype.column=void 0;ve.prototype.line=void 0;ve.prototype.ancestors=void 0;ve.prototype.cause=void 0;ve.prototype.fatal=void 0;ve.prototype.place=void 0;ve.prototype.ruleId=void 0;ve.prototype.source=void 0;var ot=je(require("node:path"),1);var sa=je(require("node:process"),1);var aa=require("node:url");function ji(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}var la=["history","path","basename","stem","extname","dirname"],Pr=class{constructor(t){let n;t?ji(t)?n={path:t}:typeof t=="string"||kk(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":sa.default.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let i=-1;for(;++i0){let[k,...v]=h,F=i[w][1];Fr(F)&&Fr(k)&&(k=(0,qi.default)(!0,F,k)),i[w]=[m,k,...v]}}}},pa=new ma().freeze();function fa(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function da(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function ha(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function Qc(e){if(!Fr(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function Jc(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function Gi(e){return xk(e)?e:new Pr(e)}function xk(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function bk(e){return typeof e=="string"||vk(e)}function vk(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}var Kc=pa().use(Un).use(Vi).freeze();var wa={d:(e,t)=>{for(var n in t)wa.o(t,n)&&!wa.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},o:(e,t)=>Object.prototype.hasOwnProperty.call(e,t)},ka={};wa.d(ka,{Z:()=>Ek,$:()=>nf});var qn={horizontalTab:-2,virtualSpace:-1,nul:0,eof:null,space:32};function Xc(e){return e{e.exports=function(t){var n,i;return t._compiled||(n=t.before?"(?:"+t.before+")":"",i=t.after?"(?:"+t.after+")":"",t.atBreak&&(n="[\\r\\n][\\t ]*"+n),t._compiled=new RegExp((n?"("+n+")":"")+(/[|\\{}()[\]^$+*?.-]/.test(t.character)?"\\":"")+t.character+(i||""),"g")),t._compiled}},112:e=>{function t(n,i,o){var s;if(!i)return o;for(typeof i=="string"&&(i=[i]),s=-1;++s{e.exports=function(u,f,m){for(var h,p,w,k,v,F,T,C,A=(m.before||"")+(f||"")+(m.after||""),P=[],Y=[],B={},_=-1;++_=C||w+1{var t=e&&e.__esModule?()=>e.default:()=>e;return bt.d(t,{a:t}),t},bt.d=(e,t)=>{for(var n in t)bt.o(t,n)&&!bt.o(e,n)&&Object.defineProperty(e,n,{enumerable:!0,get:t[n]})},bt.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);var ya={};(()=>{function e(o={}){let s=o.permalinks||[],l=o.pageResolver||(w=>[w.replace(/ /g,"_").toLowerCase()]),u=o.newClassName||"new",f=o.wikiLinkClassName||"internal",m=o.hrefTemplate||(w=>`#/page/${w}`),h;function p(w){return w[w.length-1]}return{enter:{wikiLink:function(w){h={type:"wikiLink",value:null,data:{alias:null,permalink:null,exists:null}},this.enter(h,w)}},exit:{wikiLinkTarget:function(w){let k=this.sliceSerialize(w);p(this.stack).value=k},wikiLinkAlias:function(w){let k=this.sliceSerialize(w);p(this.stack).data.alias=k},wikiLink:function(w){this.exit(w);let k=h,v=l(k.value),F=v.find(Y=>s.indexOf(Y)!==-1),T=F!==void 0,C;C=T?F:v[0]||"";let A=k.value;k.data.alias&&(A=k.data.alias);let P=f;T||(P+=" "+u),k.data.alias=A,k.data.permalink=C,k.data.exists=T,k.data.hName="a",k.data.hProperties={className:P,href:m(C)},k.data.hChildren=[{type:"text",value:A}]}}}}bt.d(ya,{V:()=>e,x:()=>i});var t=bt(113),n=bt.n(t);function i(o={}){let s=o.aliasDivider||":";return{unsafe:[{character:"[",inConstruct:["phrasing","label","reference"]},{character:"]",inConstruct:["label","reference"]}],handlers:{wikiLink:function(l,u,f){let m=f.enter("wikiLink"),h=n()(f,l.value,{before:"[",after:"]"}),p=n()(f,l.data.alias,{before:"[",after:"]"}),w;return w=p!==h?`[[${h}${s}${p}]]`:`[[${h}]]`,m(),w}}}}})();var Sk=ya.V,_k=ya.x,tf=!1;function nf(e={}){let t=this.data();function n(i,o){t[i]?t[i].push(o):t[i]=[o]}!tf&&(this.Parser&&this.Parser.prototype&&this.Parser.prototype.blockTokenizers||this.Compiler&&this.Compiler.prototype&&this.Compiler.prototype.visitors)&&(tf=!0,console.warn("[remark-wiki-link] Warning: please upgrade to remark 13 to use this plugin")),n("micromarkExtensions",function(){var i=(arguments.length>0&&arguments[0]!==void 0?arguments[0]:{}).aliasDivider||":",o="]]";return{text:{91:{tokenize:function(s,l,u){var f,m,h=0,p=0,w=0;return function(A){return A!=="[[".charCodeAt(p)?u(A):(s.enter("wikiLink"),s.enter("wikiLinkMarker"),k(A))};function k(A){return p===2?(s.exit("wikiLinkMarker"),function(P){return ga(P)||P===qn.eof?u(P):(s.enter("wikiLinkData"),s.enter("wikiLinkTarget"),v(P))}(A)):A!=="[[".charCodeAt(p)?u(A):(s.consume(A),p++,k)}function v(A){return A===i.charCodeAt(h)?f?(s.exit("wikiLinkTarget"),s.enter("wikiLinkAliasMarker"),F(A)):u(A):A===o.charCodeAt(w)?f?(s.exit("wikiLinkTarget"),s.exit("wikiLinkData"),s.enter("wikiLinkMarker"),C(A)):u(A):ga(A)||A===qn.eof?u(A):(Xc(A)||(f=!0),s.consume(A),v)}function F(A){return h===i.length?(s.exit("wikiLinkAliasMarker"),s.enter("wikiLinkAlias"),T(A)):A!==i.charCodeAt(h)?u(A):(s.consume(A),h++,F)}function T(A){return A===o.charCodeAt(w)?m?(s.exit("wikiLinkAlias"),s.exit("wikiLinkData"),s.enter("wikiLinkMarker"),C(A)):u(A):ga(A)||A===qn.eof?u(A):(Xc(A)||(m=!0),s.consume(A),T)}function C(A){return w===2?(s.exit("wikiLinkMarker"),s.exit("wikiLink"),l(A)):A!==o.charCodeAt(w)?u(A):(s.consume(A),w++,C)}}}}}}(e)),n("fromMarkdownExtensions",Sk(e)),n("toMarkdownExtensions",_k(e))}var Ek=nf,h_=ka.Z,rf=ka.$;(function(){if(globalThis.process)return;let t={browser:!0,cwd:__name(()=>"/","cwd"),env:{},platform:"android"};globalThis.process=t})();function xa(e){try{return!e.includes("://")||e.trim()!==e?!1:(new URL(e),!0)}catch{return!1}}var yn=require("obsidian");(function(){if(globalThis.process)return;let t={browser:!0,cwd:__name(()=>"/","cwd"),env:{},platform:"android"};globalThis.process=t})();function Zi(e){let t=(0,yn.getFrontMatterInfo)(e);return(0,yn.parseYaml)(t.frontmatter)??{}}function of(e,t){let n=(0,yn.getFrontMatterInfo)(e);if(Object.keys(t).length===0)return e.slice(n.contentStart);let i=(0,yn.stringifyYaml)(t);return n.exists?Ol(e,i,n.from,n.to):`--- -${i}--- -${e}`}(function(){if(globalThis.process)return;let t={browser:!0,cwd:__name(()=>"/","cwd"),env:{},platform:"android"};globalThis.process=t})();async function sf(e,t,n){let i=Ne(e,t),o=dt(n);await Zn(e,o);let s=Qi(e,n);try{await e.vault.copy(i,s)}catch(l){if(!await e.vault.exists(s))throw l}return s}async function Zn(e,t){if(await e.vault.adapter.exists(t))return!1;try{return await e.vault.createFolder(t),!0}catch(n){if(!await e.vault.exists(t))throw n;return!0}}function Qi(e,t){let n=et(t);return e.vault.getAvailablePath(we(se(t),Re(t,n)),n.slice(1))}function Qn(e){return e.vault.getMarkdownFiles().sort((t,n)=>t.path.localeCompare(n.path))}function ba(e,t,n){let i=he(e,t);if(e.vault.adapter.insensitive){let o=se(n),s=Re(n),l;for(;l=ht(e,o,!0),!l;)s=we(Re(o),s),o=se(o);n=we(l.getParentPrefix(),s)}return i.toLowerCase()===n.toLowerCase()?n:Qi(e,n)}async function va(e,t){let n=await Jn(e,he(e,t));return n.files.length===0&&n.folders.length===0}async function Jn(e,t){let n=he(e,t),i={files:[],folders:[]};if((await e.vault.adapter.stat(n))?.type!=="folder")return i;try{return await e.vault.adapter.list(n)}catch(o){if(await e.vault.exists(n))throw o;return i}}async function af(e,t,n,i={}){let s={...{shouldFailOnMissingFile:!0},...i};await br(async()=>{let l=await Ca(e,t);if(l===null)return h();let u=await mr(n,l);if(u===null)return!1;let f=!0;if(!await lf(e,t,async p=>{await e.vault.process(p,w=>w!==l?(console.warn("Content has changed since it was read. Retrying...",{actualContent:w,expectedContent:l,path:p.path}),f=!1,w):u)}))return h();return f;function h(){if(s.shouldFailOnMissingFile){let p=he(e,t);throw new Error(`File '${p}' not found`)}return!0}},s)}async function Ca(e,t){let n=null;return await lf(e,t,async i=>{n=await e.vault.read(i)}),n}async function Ji(e,t,n){let i=Ne(e,t,!1,!0),o=ba(e,t,n);if(i.path.toLowerCase()===o.toLowerCase())return i.path!==n&&await e.vault.rename(i,o),o;let s=dt(o);await Zn(e,s);try{await e.vault.rename(i,o)}catch(l){if(!await e.vault.exists(o)||await e.vault.exists(i.path))throw l}return o}async function lf(e,t,n){let i=he(e,t),o=ce(e,i);if(!o||o.deleted)return!1;try{return await n(o),!0}catch(s){if(o=ce(e,i),!o||o.deleted)return!1;throw s}}(function(){if(globalThis.process)return;let t={browser:!0,cwd:__name(()=>"/","cwd"),env:{},platform:"android"};globalThis.process=t})();async function Mr(e,t,n,i={}){await af(e,t,async o=>{let s=await mr(n),l=cn(e,t)?Tk(o):Zi(o);for(let h of s)if(xn(h)){let p=o.slice(h.startIndex,h.endIndex);if(p!==h.oldContent)return console.warn("Content mismatch",{actualContent:p,endIndex:h.endIndex,expectedContent:h.oldContent,path:he(e,t),startIndex:h.startIndex}),null}else if(Ki(h)){let p=Ci(l,h.frontmatterKey);if(p!==h.oldContent)return console.warn("Content mismatch",{actualContent:p,expectedContent:h.oldContent,frontmatterKey:h.frontmatterKey,path:he(e,t)}),null}s.sort((h,p)=>xn(h)&&xn(p)?h.startIndex-p.startIndex:Ki(h)&&Ki(p)?h.frontmatterKey.localeCompare(p.frontmatterKey):xn(h)?-1:1),s=s.filter((h,p)=>h.oldContent===h.newContent?!1:p===0?!0:!Cs(h,s[p-1]));for(let h=1;hp.startIndex)return console.warn("Overlapping changes",{change:p,previousChange:w}),null}let u="",f=0,m=!1;for(let h of s)xn(h)?(u+=o.slice(f,h.startIndex),u+=h.newContent,f=h.endIndex):Ki(h)&&(Eu(l,h.frontmatterKey,h.newContent),m=!0);return cn(e,t)?u=JSON.stringify(l,null," "):(u+=o.slice(f),m&&(u=of(u,l))),u},i)}function xn(e){return e.startIndex!==void 0}function Ki(e){return e.frontmatterKey!==void 0}function Tk(e){let t;try{t=JSON.parse(e)}catch{t=null}return(t===null||typeof t!="object")&&(t={}),t}var cf=require("obsidian");(function(){if(globalThis.process)return;let t={browser:!0,cwd:__name(()=>"/","cwd"),env:{},platform:"android"};globalThis.process=t})();function Xi(e,t){if(Vt(e))return{endIndex:e.position.end.offset,newContent:t,oldContent:e.original,startIndex:e.position.start.offset};if(Ot(e))return{frontmatterKey:e.key,newContent:t,oldContent:e.original};throw new Error("Unknown link type")}function uf(e){return e.sort((t,n)=>Ot(t)&&Ot(n)?t.key.localeCompare(n.key):Vt(t)&&Vt(n)?t.position.start.offset-n.position.start.offset:Ot(t)?1:-1)}(function(){if(globalThis.process)return;let t={browser:!0,cwd:__name(()=>"/","cwd"),env:{},platform:"android"};globalThis.process=t})();async function Ak(e){for(let[t,n]of Object.entries(e.metadataCache.fileCache))n.hash&&(e.metadataCache.metadataCache[n.hash]||await mt(e,t))}function vt(e){let t=[];return e.links&&t.push(...e.links),e.embeds&&t.push(...e.embeds),e.frontmatterLinks&&t.push(...e.frontmatterLinks),uf(t),t=t.filter((n,i)=>{if(i===0)return!0;let o=t[i-1];return o?Vt(n)&&Vt(o)?n.position.start.offset!==o.position.start.offset:Ot(n)&&Ot(o)?n.key!==o.key:!0:!0}),t}function eo(e,t){let n=Ne(e,t,!0);return Sa(e,n,()=>e.metadataCache.getBacklinksForFile(n))}async function Jt(e,t,n={}){let i=e.metadataCache.getBacklinksForFile.safe;if(i)return i(t);let o=null;return await br(async()=>{let s=Ne(e,t);await Ak(e),o=eo(e,s);for(let l of o.keys()){let u=ce(e,l);if(!u)return!1;await ff(e,u);let f=await Ca(e,u);if(!f)return!1;let m=Zi(f),h=o.get(l);if(!h)return!1;for(let p of h){let w;if(Vt(p))w=f.slice(p.position.start.offset,p.position.end.offset);else if(Ot(p)){let k=Ci(m,p.key);if(typeof k!="string")return!1;w=k}else return!0;if(w!==p.original)return!1}}return!0},n),o}async function mt(e,t,n={}){let i=Ue("MetadataCache:getCacheSafe"),o=null;return await br(async()=>{let s=ce(e,t);if(!s||s.deleted)return o=null,!0;await ff(e,s);let l=e.metadataCache.getFileInfo(s.path),u=await e.vault.adapter.stat(s.path);return l?u?s.stat.mtime{for(let o of n)delete e.vault.fileMap[o];tt(t)&&e.metadataCache.uniqueFileLookup.remove(t.name.toLowerCase(),t)}}function Sa(e,t,n){let i=Fk(e,t);try{return n()}finally{i()}}async function ff(e,t){if(!ke(e,t))return;let n=he(e,t);for(let i of e.workspace.getLeavesOfType("markdown"))i.view instanceof cf.MarkdownView&&i.view.file?.path===n&&await i.view.save()}(function(){if(globalThis.process)return;let t={browser:!0,cwd:__name(()=>"/","cwd"),env:{},platform:"android"};globalThis.process=t})();function df(e){return e.vault.getConfig("newLinkFormat")==="relative"}function hf(e){return!e.vault.getConfig("useMarkdownLinks")}(function(){if(globalThis.process)return;let t={browser:!0,cwd:__name(()=>"/","cwd"),env:{},platform:"android"};globalThis.process=t})();var Pk=/[\\\x00\x08\x0B\x0C\x0E-\x1F ]/g,Mk=/[\\[\]<>_*~=`$]/g,pf="|";function Ik(e){let t=Yt(e.app,e.link,e.oldSourcePathOrFile??e.newSourcePathOrFile);return t?Ea({app:e.app,link:e.link,newSourcePathOrFile:e.newSourcePathOrFile,newTargetPathOrFile:t,oldSourcePathOrFile:e.oldSourcePathOrFile,shouldForceMarkdownLinks:e.shouldForceMarkdownLinks,shouldUpdateFilenameAlias:e.shouldUpdateFilenameAlias}):e.link.original}async function _a(e,t,n,i={}){await Mr(e,t,async()=>{let o=await mt(e,t);if(!o)return[];let s=[];for(let l of vt(o)){let u=await n(l);u!==void 0&&s.push(Xi(l,u))}return s},i)}function Yt(e,t,n){let{linkPath:i}=Kt(t.link);return e.metadataCache.getFirstLinkpathDest(i,he(e,n))}function no(e){let{app:t}=e,i=(t.fileManager.generateMarkdownLink.defaultOptionsFn??(()=>({})))();e={...{isEmptyEmbedAliasAllowed:!0},...i,...e};let s=Ne(t,e.targetPathOrFile,e.isNonExistingFileAllowed);return Sa(t,s,()=>Nk(e))}function Ir(e){let t=Hk(e);if(t)return t;let n="!",i=e.startsWith(n);i&&(e=Dt(e,n));let s=Kc().use(Un).use(rf,{aliasDivider:pf}).parse(e);if(s.children.length!==1)return null;let l=s.children[0];if(l?.type!=="paragraph"||l.children.length!==1)return null;let u=l.children[0];if(u?.position?.start.offset!==0||u.position.end.offset!==e.length)return null;switch(u.type){case"link":return Bk(u,e,i);case"wikiLink":return Uk(u,e,i);default:return null}}function Lk(e){let{app:t,displayText:n,isWikilink:i,newSourcePathOrFile:o,oldSourcePathOrFile:s,oldTargetPath:l,targetPathOrFile:u}=e;if(i===!1)return!1;if(!n)return!0;let f=Ne(t,u,!0),m=he(t,o),h=he(t,s??o),p=se(m),w=se(h),k=new Set;for(let F of[f.path,l]){if(!F)continue;let T=he(t,F);k.add(T),k.add(Re(T)),k.add(In(p,T)),k.add(In(w,T))}for(let F of[h,m])k.add(t.metadataCache.fileToLinktext(f,F,!1));let v=He((0,to.normalizePath)(n.split(" > ")[0]??""),/^\.\//g,"").toLowerCase();for(let F of k){if(F.toLowerCase()===v)return!0;let T=se(F),C=Re(F,et(F));if(we(T,C).toLowerCase()===v)return!0}return!1}function Kt(e){let t=(0,to.parseLinktext)(pr(e));return{linkPath:t.path,subpath:t.subpath}}function Ok(e){return Ir(e)?.hasAngleBrackets??!1}function ro(e){return Ir(e)?.isEmbed??!1}function Dk(e){return Ir(e)?.url.startsWith("./")??!1}function Kn(e){return Ir(e)?.isWikilink??!1}function Ea(e){let{app:t,link:n,newSourcePathOrFile:i,newTargetPathOrFile:o,oldSourcePathOrFile:s,oldTargetPathOrFile:l,shouldForceMarkdownLinks:u,shouldUpdateFilenameAlias:f}=e;if(!o)return n.original;let m=Ne(t,o,!0),h=he(t,l??o),p=Kn(n.original)&&u!==!0,{subpath:w}=Kt(n.link),k=!f;if(cn(t,i))return m.path+w;let v;if(p){let T=Ir(n.original);T?.alias&&(v=T.alias,k=!0)}return v??=Lk({app:t,displayText:n.displayText,isWikilink:p,newSourcePathOrFile:i,oldSourcePathOrFile:s,oldTargetPath:h,targetPathOrFile:m})?void 0:n.displayText,k||(v===Re(h,et(h))?v=m.basename:v===Re(h)&&(v=m.name)),no({alias:v,app:t,isWikilink:u?!1:void 0,originalLink:n.original,sourcePathOrFile:i,subpath:w,targetPathOrFile:m})}async function io(e){let{app:t,newSourcePathOrFile:n,oldSourcePathOrFile:i,shouldForceMarkdownLinks:o,shouldUpdateEmbedOnlyLinks:s,shouldUpdateFilenameAlias:l}=e;cn(t,n)&&!t.internalPlugins.getEnabledPluginById("canvas")||await _a(t,n,u=>{let f=ro(u.original);if(!(s!==void 0&&s!==f))return Ik({app:t,link:u,newSourcePathOrFile:n,oldSourcePathOrFile:i,shouldForceMarkdownLinks:o,shouldUpdateFilenameAlias:l})},e)}function Rk(e,t,n,i,o){let s;return t.path===n&&i?s=i:o.shouldForceRelativePath?s=In(se(n),o.isWikilink?Ul(e,t):t.path)+i:s=e.metadataCache.fileToLinktext(t,n,o.isWikilink)+i,o.shouldForceRelativePath&&o.shouldUseLeadingDot&&!s.startsWith(".")&&!s.startsWith("#")&&(s=`./${s}`),s}function Nk(e){let{app:t}=e,n=Ne(t,e.targetPathOrFile,e.isNonExistingFileAllowed),i=he(t,e.sourcePathOrFile),o=e.subpath??"",s=zk(e,n),l=Rk(t,n,i,o,s);return s.isWikilink?Wk(l,e.alias,s.isEmbed):Yk(l,n,e,s)}function Yk(e,t,n,i){let{app:o}=n,s=i.isEmbed?"!":"",l=i.shouldUseAngleBrackets?`<${e}>`:He(e,Pk,({substring:m})=>encodeURIComponent(m)),u=n.alias??"";!u&&(!i.isEmbed||!n.isEmptyEmbedAliasAllowed)&&(u=!n.shouldIncludeAttachmentExtensionToEmbedAlias||ke(o,t)?t.basename:t.name);let f=He(u,Mk,"\\$&");return`${s}[${f}](${l})`}function Wk(e,t,n){let i=n?"!":"",o=t??"";if(o&&o.toLowerCase()===e.toLowerCase())return`${i}[[${o}]]`;let s=o?`|${o}`:"";return`${i}[[${e}${s}]]`}function zk(e,t){let{app:n}=e;return{isEmbed:e.isEmbed??(e.originalLink?ro(e.originalLink):void 0)??!ke(n,t),isWikilink:e.isWikilink??(e.originalLink?Kn(e.originalLink):void 0)??hf(n),shouldForceRelativePath:e.shouldForceRelativePath??df(n),shouldUseAngleBrackets:e.shouldUseAngleBrackets??(e.originalLink?Ok(e.originalLink):void 0)??!1,shouldUseLeadingDot:e.shouldUseLeadingDot??(e.originalLink?Dk(e.originalLink):void 0)??!1}}function Bk(e,t,n){let i="<",o="](",s=")",l=e.children[0],u=t.slice((l?.position?.end.offset??1)+o.length,(e.position?.end.offset??0)-s.length),f=t.startsWith(i)||u.startsWith(i),m=xa(e.url),h=e.url;if(!m&&!f)try{h=decodeURIComponent(h)}catch(p){console.error(`Failed to decode URL ${h}`,p)}return{alias:l?.value,hasAngleBrackets:f,isEmbed:n,isExternal:m,isWikilink:!1,title:e.title??void 0,url:h}}function Hk(e){return xa(e)?{isEmbed:!1,isExternal:!0,isWikilink:!1,url:e}:null}function Uk(e,t,n){return{alias:t.includes(pf)?e.data.alias:void 0,isEmbed:n,isExternal:!1,isWikilink:!0,url:e.value}}(function(){if(globalThis.process)return;let t={browser:!0,cwd:__name(()=>"/","cwd"),env:{},platform:"android"};globalThis.process=t})();async function oo(e,t){let n=ht(e,t);for(;n;){if(!await va(e,n))return;let i=n.parent;await Lr(e,n.path),n=i}}async function Lr(e,t,n,i,o){let s=gr(e,t);if(!s)return!1;let l=tt(s)||(o??!0);if(tt(s)){let u=await Jt(e,s);n&&u.clear(n),u.count()!==0&&(i&&new Notice(`Attachment ${s.path} is still used by other notes. It will not be deleted.`),l=!1)}else if(wr(s)){let u=await Jn(e,s);for(let f of[...u.files,...u.folders])l&&=await Lr(e,f,n,i);l&&=await va(e,s)}if(l)try{await e.fileManager.trashFile(s)}catch(u){await e.vault.exists(s.path)&&(hr(new Error(`Failed to delete ${s.path}`,{cause:u})),l=!1)}return l}(function(){if(globalThis.process)return;let t={browser:!0,cwd:__name(()=>"/","cwd"),env:{},platform:"android"};globalThis.process=t})();var Ta=new Map,Or=new Set,so=new Map;function yf(e,t){let n=ao(e.app),i=e.manifest.id;n.set(i,t),wf(e.app),e.register(()=>{n.delete(i),wf(e.app)});let o=e.app;e.registerEvent(o.vault.on("delete",s=>{qk(e,s)})),e.registerEvent(o.vault.on("rename",(s,l)=>{Kk(e,s,l)})),e.registerEvent(o.metadataCache.on("deleted",(s,l)=>{Qk(e,s,l)}))}async function Vk(e,t,n,i,o){let s=so.get(t);if(s){so.delete(t);for(let l of s)await Aa(e,l.oldPath,n,i,o,l.combinedBacklinksMap)}}async function $k(e,t,n,i,o){if(i.set(t,n),!Rt(e,t))return;let s=Dr(e),l=await Wn(e,t),u=s.shouldRenameAttachmentFolder?await Wn(e,n):l,f=ht(e,l);if(!f||l===u&&!s.shouldRenameAttachmentFiles)return;let m=[];if(await _s(e,t))kf.Vault.recurseChildren(f,w=>{tt(w)&&m.push(w)});else for(let w of o){let k=Yt(e,w,t);k&&k.path.startsWith(l)&&(await Jt(e,k)).keys().length===1&&m.push(k)}let h=Re(t,et(t)),p=Re(n,et(n));for(let w of m){if(Rt(e,w))continue;let k=In(l,w.path),v=we(u,se(k)),F=s.shouldRenameAttachmentFiles?He(w.basename,h,p):w.basename,T=we(v,Rl(F,w.extension));if(w.path!==T){if(s.shouldDeleteConflictingAttachments){let C=ce(e,T);C&&await e.fileManager.trashFile(C)}else T=e.vault.getAvailablePath(we(v,F),w.extension);i.set(w.path,T)}}}function ao(e){return jt(e,"renameDeleteHandlersMap",new Map).value}function Dr(e){let t=ao(e),n=Array.from(t.values()).reverse(),i={};for(let o of n){let s=o();i.shouldDeleteConflictingAttachments||=s.shouldDeleteConflictingAttachments??!1,i.shouldDeleteEmptyFolders||=s.shouldDeleteEmptyFolders??!1,i.shouldHandleDeletions||=s.shouldHandleDeletions??!1,i.shouldHandleRenames||=s.shouldHandleRenames??!1,i.shouldRenameAttachmentFiles||=s.shouldRenameAttachmentFiles??!1,i.shouldRenameAttachmentFolder||=s.shouldRenameAttachmentFolder??!1,i.shouldUpdateFilenameAliases||=s.shouldUpdateFilenameAliases??!1;let l=i.isPathIgnored;i.isPathIgnored=u=>l?.(u)??s.isPathIgnored?.(u)??!1}return i}async function jk(e,t,n,i,o){if(!e.vault.adapter.insensitive||t.toLowerCase()!==n.toLowerCase())return!1;let s=we(se(n),`__temp__${Re(n)}`);return await bf(e,n,s),await Aa(e,t,s,i,o),await e.vault.rename(Ne(e,s),n),!0}async function Gk(e,t){if(Ue("RenameDeleteHandler:handleDelete")(`Handle Delete ${t}`),!Rt(e,t))return;let n=Dr(e);if(!n.shouldHandleDeletions||n.isPathIgnored?.(t))return;let i=Ta.get(t);if(Ta.delete(t),i){let l=vt(i);for(let u of l){let f=Yt(e,u,t);f&&(Rt(e,f)||await Lr(e,f,t,n.shouldDeleteEmptyFolders))}}let o=await Wn(e,t),s=ht(e,o);s&&await _s(e,t)&&await Lr(e,s,t,!1,n.shouldDeleteEmptyFolders)}function qk(e,t){let n=e.app;if(!Fa(e))return;let i=t.path;it(n,()=>Gk(n,i))}function Zk(e,t,n){let i=Dr(e);i.isPathIgnored?.(t.path)||i.shouldHandleDeletions&&ke(e,t)&&n&&Ta.set(t.path,n)}function Qk(e,t,n){Fa(e)&&Zk(e.app,t,n)}function Jk(e,t,n){let i=xf(t,n);if(Ue("RenameDeleteHandler:handleRename")(`Handle Rename ${i}`),Or.has(i)){Or.delete(i);return}let o=Dr(e);if(!o.shouldHandleRenames||o.isPathIgnored?.(t)||o.isPathIgnored?.(n))return;let s=e.metadataCache.getCache(t)??e.metadataCache.getCache(n),l=s?vt(s):[],u=eo(e,t).data;it(e,()=>Aa(e,t,n,u,l))}async function Aa(e,t,n,i,o,s){if(await Vk(e,t,n,i,o),Xk(e,t,n,i,o),await jk(e,t,n,i,o))return;let l=Su(e.fileManager,{updateAllLinks:()=>is});try{let u=new Map;await $k(e,t,n,u,o);let f=new Map;gf(i,u,f,t);for(let p of u.keys()){if(p===t)continue;let w=(await Jt(e,p)).data;gf(w,u,f,p)}let m=new Set;for(let[p,w]of u.entries()){if(p===t)continue;let k=await bf(e,p,w);u.set(p,k),m.add(se(p))}let h=Dr(e);if(h.shouldDeleteEmptyFolders)for(let p of m)await oo(e,p);for(let[p,w]of Array.from(f.entries()).concat(Array.from(s?.entries()??[])))await _a(e,p,k=>{let v=w.get(Si(k));if(!v)return;let F=u.get(v);if(F)return Ea({app:e,link:k,newSourcePathOrFile:p,newTargetPathOrFile:F,oldTargetPathOrFile:v,shouldUpdateFilenameAlias:h.shouldUpdateFilenameAliases})},{shouldFailOnMissingFile:!1});if(Rt(e,n)&&await io({app:e,newSourcePathOrFile:n,oldSourcePathOrFile:t,shouldFailOnMissingFile:!1,shouldUpdateFilenameAlias:h.shouldUpdateFilenameAliases}),!ce(e,n)){let p=so.get(n);p||(p=[],so.set(n,p)),p.push({combinedBacklinksMap:f,oldPath:t})}}finally{l();let u=Array.from(Or);it(e,()=>{for(let f of u)Or.delete(f)})}}function Kk(e,t,n){if(!Fa(e)||!tt(t))return;let i=t.path;Jk(e.app,n,i)}function gf(e,t,n,i){for(let[o,s]of e.entries()){let l=t.get(o)??o,u=n.get(l)??new Map;n.set(l,u);for(let f of s)u.set(Si(f),i)}}function wf(e){let t=ao(e);Ue("RenameDeleteHandler:logRegisteredHandlers")(`Plugins with registered rename/delete handlers: ${JSON.stringify(Array.from(t.keys()))}`)}function xf(e,t){return`${e} -> ${t}`}function Xk(e,t,n,i,o){let s=e.metadataCache.getCache(t)??e.metadataCache.getCache(n),l=s?vt(s):[],u=eo(e,t).data;for(let f of l)o.includes(f)||o.push(f);for(let[f,m]of u.entries()){let h=i.get(f);h||(h=[],i.set(f,h));for(let p of m)h.includes(p)||h.push(p)}}async function bf(e,t,n){if(n=ba(e,t,n),t===n)return n;let i=xf(t,n);return Or.add(i),n=await Ji(e,t,n),n}function Fa(e){let t=e.app,n=e.manifest.id,i=ao(t);return Array.from(i.keys())[0]===n}(function(){if(globalThis.process)return;let t={browser:!0,cwd:__name(()=>"/","cwd"),env:{},platform:"android"};globalThis.process=t})();var Xt=class{getTransformer(t){if(t===this.id)return this;throw new Error(`Transformer with id ${t} not found`)}transformObjectRecursively(t){return this.transformValueRecursively(t,"")}getTransformerId(t,n){return this.canTransform(t,n)?this.id:null}transformValueRecursively(t,n){let i=this.getTransformerId(t,n);if(i){let s=this.transformValue(t,n);return s===void 0?void 0:{__transformerId:i,transformedValue:s}}if(t===null)return null;if(typeof t!="object")return t;if(Array.isArray(t))return t.map((s,l)=>this.transformValueRecursively(s,l.toString()));let o=t;return o.__transformerId?this.getTransformer(o.__transformerId).restoreValue(o.transformedValue,n):Object.fromEntries(Object.entries(t).map(([s,l])=>[s,this.transformValueRecursively(l,s)]))}};(function(){if(globalThis.process)return;let t={browser:!0,cwd:__name(()=>"/","cwd"),env:{},platform:"android"};globalThis.process=t})();var Xn=class extends Xt{};(function(){if(globalThis.process)return;let t={browser:!0,cwd:__name(()=>"/","cwd"),env:{},platform:"android"};globalThis.process=t})();var lo=class extends Xn{get id(){return"date"}canTransform(t){return t instanceof Date}restoreValue(t){return new Date(t)}transformValue(t){return t.toISOString()}};var vf=je(bn(),1);(function(){if(globalThis.process)return;let t={browser:!0,cwd:__name(()=>"/","cwd"),env:{},platform:"android"};globalThis.process=t})();var uo=class extends Xn{get id(){return"duration"}canTransform(t){let n=t;return!!n.asHours&&!!n.asMinutes&&!!n.asSeconds&&!!n.asMilliseconds}restoreValue(t){return(0,vf.duration)(t)}transformValue(t){return t.toISOString()}};(function(){if(globalThis.process)return;let t={browser:!0,cwd:__name(()=>"/","cwd"),env:{},platform:"android"};globalThis.process=t})();var co=class extends Xt{constructor(t){super(),this.transformers=t}get id(){return"group"}canTransform(t,n){return this.getFirstTransformerThatCanTransform(t,n)!==null}getTransformer(t){return this.transformers.find(n=>n.id===t)??un(`No transformer with id ${t} found`)}transformValue(t,n){let i=this.getFirstTransformerThatCanTransform(t,n);if(i===null)throw new Error("No transformer can transform the value");return i.transformValue(t,n)}getTransformerId(t,n){let i=this.getFirstTransformerThatCanTransform(t,n);return i===null?null:i.id}restoreValue(){throw new Error("GroupTransformer does not support restoring values")}getFirstTransformerThatCanTransform(t,n){return this.transformers.find(i=>i.canTransform(t,n))??null}};(function(){if(globalThis.process)return;let t={browser:!0,cwd:__name(()=>"/","cwd"),env:{},platform:"android"};globalThis.process=t})();var ey="_",fo=class extends Xt{get id(){return"skip-private-property"}canTransform(t,n){return n.startsWith(ey)}transformValue(){}restoreValue(){throw new Error("SkipPrivatePropertyTransformer does not support restoring values")}};(function(){if(globalThis.process)return;let t={browser:!0,cwd:__name(()=>"/","cwd"),env:{},platform:"android"};globalThis.process=t})();var ty=new co([new fo,new lo,new uo]),ho=class{get shouldSaveAfterLoad(){return this._shouldSaveAfterLoad}_shouldSaveAfterLoad=!1;init(t){if(t!=null){if(typeof t!="object"||Array.isArray(t)){let n=Array.isArray(t)?"Array":typeof t;console.error(`Invalid data type. Expected Object, got: ${n}`);return}this.initFromRecord(t)}}toJSON(){return this.getTransformer().transformObjectRecursively(this)}getTransformer(){return ty}initFromRecord(t){t=this.getTransformer().transformObjectRecursively(t);for(let[n,i]of Object.entries(t)){if(!(n in this)){console.warn(`Unknown property: ${n}`);continue}this[n]=i}}};var Cf=/(?:)/,Sf=/$./,mo=class extends ho{autoCollectAttachments=!1;changeNoteBacklinksAlt=!0;consistencyReportFile="consistency-report.md";deleteAttachmentsWithNote=!1;deleteEmptyFolders=!0;deleteExistFilesWhenMoveNote=!1;moveAttachmentsWithNote=!1;showBackupWarning=!0;updateLinks=!0;get excludePaths(){return this._excludePaths}set excludePaths(t){this._excludePaths=t.filter(Boolean),this._excludePathsRegExp=_f(this._excludePaths,Sf)}get hadDangerousSettingsReverted(){return this._hadDangerousSettingsReverted}get includePaths(){return this._includePaths}set includePaths(t){this._includePaths=t.filter(Boolean),this._includePathsRegExp=_f(this._includePaths,Cf)}_excludePaths=[];_excludePathsRegExp=Sf;_hadDangerousSettingsReverted=!1;_includePaths=[];_includePathsRegExp=Cf;constructor(t){super(),this.excludePaths=["/consistency-report\\.md$/"],this.init(t)}initFromRecord(t){let n=t;if(n.ignoreFiles||n.ignoreFolders){let i=n.excludePaths??[];for(let o of n.ignoreFiles??[])i.push(`/${o}$/`);for(let o of n.ignoreFolders??[])i.push(o);i.length>0&&(n.excludePaths=i),delete n.ignoreFiles,delete n.ignoreFolders}super.initFromRecord(n),this.showBackupWarning&&(this._hadDangerousSettingsReverted=this.deleteAttachmentsWithNote||this.deleteExistFilesWhenMoveNote||this.moveAttachmentsWithNote||this.autoCollectAttachments,this.deleteAttachmentsWithNote=!1,this.deleteExistFilesWhenMoveNote=!1,this.moveAttachmentsWithNote=!1,this.autoCollectAttachments=!1)}isPathIgnored(t){return!this._includePathsRegExp.test(t)||this._excludePathsRegExp.test(t)}toJSON(){return{...super.toJSON(),excludePaths:this.excludePaths,includePaths:this.includePaths}}};function _f(e,t){if(e.length===0)return t;let n=e.map(i=>i.startsWith("/")&&i.endsWith("/")?i.slice(1,-1):`^${ls(i)}`).map(i=>`(${i})`).join("|");return new RegExp(n)}var Of=require("obsidian");(function(){if(globalThis.process)return;let t={browser:!0,cwd:__name(()=>"/","cwd"),env:{},platform:"android"};globalThis.process=t})();function Ma(e,t){e.createEl("strong",{cls:"markdown-rendered code"},n=>{n.createEl("code",{text:t})})}var Tf=require("obsidian");var en=require("obsidian");(function(){if(globalThis.process)return;let t={browser:!0,cwd:__name(()=>"/","cwd"),env:{},platform:"android"};globalThis.process=t})();function Ef(e){let t=e;return t.validatorEl?t:e instanceof en.DropdownComponent?{get validatorEl(){return e.selectEl}}:e instanceof en.SliderComponent?{get validatorEl(){return e.sliderEl}}:e instanceof en.TextAreaComponent?{get validatorEl(){return e.inputEl}}:e instanceof en.TextComponent?{get validatorEl(){return e.inputEl}}:null}(function(){if(globalThis.process)return;let t={browser:!0,cwd:__name(()=>"/","cwd"),env:{},platform:"android"};globalThis.process=t})();var po=class extends Tf.PluginSettingTab{constructor(t){super(t.app,t),this.plugin=t,this.containerEl.addClass($.LibraryName,rt(),$.PluginSettingsTab)}validatorsMap=new WeakMap;bind(t,n,i){let s={...{componentToPluginSettingsValueConverter:m=>m,onChanged:wt,pluginSettings:void 0,pluginSettingsToComponentValueConverter:m=>m,shouldAutoSave:!0,shouldShowValidationMessage:!0,valueValidator:wt},...i},l=()=>s.pluginSettings??this.plugin.settingsClone,u=Ef(t)?.validatorEl,f=async m=>{m??=t.getValue();let h=await s.valueValidator(m);return u&&(h||(u.setCustomValidity(""),u.checkValidity(),h=u.validationMessage),u.setCustomValidity(h),u.title=h,u.isActiveElement()&&s.shouldShowValidationMessage&&u.reportValidity()),!h};return t.setValue(s.pluginSettingsToComponentValueConverter(l()[n])).onChange(async m=>{if(!await f(m))return;let h=l();h[n]=s.componentToPluginSettingsValueConverter(m),s.shouldAutoSave&&await this.plugin.saveSettings(h),await s.onChanged()}),u?.addEventListener("focus",xs(()=>f())),u?.addEventListener("blur",xs(()=>f())),this.validatorsMap.set(t,()=>f()),xr(()=>f()),t}async revalidate(t){let n=this.validatorsMap.get(t);return n?await n():!0}};var If=require("obsidian");var Ia=je(bn(),1);var go=require("obsidian");(function(){if(globalThis.process)return;let t={browser:!0,cwd:__name(()=>"/","cwd"),env:{},platform:"android"};globalThis.process=t})();var Ve=class extends go.ValueComponent{inputEl;get validatorEl(){return this.inputEl}textComponent;constructor(t,n,i){super(),this.textComponent=new go.TextComponent(t),this.inputEl=this.textComponent.inputEl,this.inputEl.type=n,t.addClass($.LibraryName,rt(),i)}getValue(){return this.valueFromString(this.inputEl.value)}onChange(t){return this.textComponent.onChange(()=>t(this.getValue())),this}onChanged(){this.textComponent.onChanged()}setDisabled(t){return this.textComponent.setDisabled(t),this.disabled=t,this}setPlaceholder(t){return this.textComponent.setPlaceholder(t),this}setValue(t){return this.inputEl.value=this.valueToString(t),this}valueToString(t){return String(t)}};(function(){if(globalThis.process)return;let t={browser:!0,cwd:__name(()=>"/","cwd"),env:{},platform:"android"};globalThis.process=t})();var $e=class extends Ve{setMax(t){return this.inputEl.max=this.valueToString(t),this}setMin(t){return this.inputEl.min=this.valueToString(t),this}setStep(t){return this.inputEl.step=t.toString(),this}};(function(){if(globalThis.process)return;let t={browser:!0,cwd:__name(()=>"/","cwd"),env:{},platform:"android"};globalThis.process=t})();var Af="YYYY-MM-DD",wo=class extends $e{constructor(t){super(t,"date",$.DateComponent)}valueFromString(t){return(0,Ia.default)(t,Af).toDate()}valueToString(t){return(0,Ia.default)(t).format(Af)}};var La=je(bn(),1);(function(){if(globalThis.process)return;let t={browser:!0,cwd:__name(()=>"/","cwd"),env:{},platform:"android"};globalThis.process=t})();var Ff="YYYY-MM-DDTHH:mm",ko=class extends $e{constructor(t){super(t,"datetime-local",$.DateTimeComponent)}valueFromString(t){return(0,La.default)(t,Ff).toDate()}valueToString(t){return(0,La.default)(t).format(Ff)}};(function(){if(globalThis.process)return;let t={browser:!0,cwd:__name(()=>"/","cwd"),env:{},platform:"android"};globalThis.process=t})();var yo=class extends Ve{constructor(t){super(t,"email",$.EmailComponent)}valueFromString(t){return t}};(function(){if(globalThis.process)return;let t={browser:!0,cwd:__name(()=>"/","cwd"),env:{},platform:"android"};globalThis.process=t})();var xo=class extends Ve{constructor(t){super(t,"file",$.FileComponent)}getValue(){return this.inputEl.files?.[0]??null}valueFromString(){return this.getValue()}valueToString(t){return t?.name??""}};var Oa=je(bn(),1);(function(){if(globalThis.process)return;let t={browser:!0,cwd:__name(()=>"/","cwd"),env:{},platform:"android"};globalThis.process=t})();var Pf="YYYY-MM",bo=class extends $e{constructor(t){super(t,"month",$.MonthComponent)}valueFromString(t){let n=(0,Oa.default)(t,Pf);if(!n.isValid())throw new Error("Invalid month");return{month:n.month()+1,year:n.year()}}valueToString(t){return(0,Oa.default)().year(t.year).month(t.month-1).format(Pf)}};var Co=require("obsidian");(function(){if(globalThis.process)return;let t={browser:!0,cwd:__name(()=>"/","cwd"),env:{},platform:"android"};globalThis.process=t})();var vo=class extends Co.ValueComponent{get validatorEl(){return this.dropdownComponent.selectEl}dropdownComponent;constructor(t){super(),this.dropdownComponent=new Co.DropdownComponent(t),this.dropdownComponent.selectEl.multiple=!0,t.addClass($.LibraryName,rt(),$.MultipleDropdownComponent)}addOption(t,n){return this.dropdownComponent.addOption(t,n),this}addOptions(t){return this.dropdownComponent.addOptions(t),this}getValue(){return Array.from(this.dropdownComponent.selectEl.selectedOptions).map(t=>t.value)}onChange(t){return this.dropdownComponent.onChange(()=>t(this.getValue())),this}setDisabled(t){return this.dropdownComponent.setDisabled(t),this.disabled=t,this}setValue(t){for(let n of Array.from(this.dropdownComponent.selectEl.options))n.selected=t.includes(n.value);return this}};(function(){if(globalThis.process)return;let t={browser:!0,cwd:__name(()=>"/","cwd"),env:{},platform:"android"};globalThis.process=t})();var So=class extends Ve{constructor(t){super(t,"email",$.MultipleEmailComponent),this.inputEl.multiple=!0}valueFromString(t){return t.split(",").map(n=>n.trim())}valueToString(t){return t.join(", ")}};(function(){if(globalThis.process)return;let t={browser:!0,cwd:__name(()=>"/","cwd"),env:{},platform:"android"};globalThis.process=t})();var _o=class extends Ve{constructor(t){super(t,"file",$.MultipleFileComponent),this.inputEl.multiple=!0}getValue(){return Array.from(this.inputEl.files??[])}valueFromString(){return this.getValue()}valueToString(t){return t[0]?.name??""}};var To=require("obsidian");(function(){if(globalThis.process)return;let t={browser:!0,cwd:__name(()=>"/","cwd"),env:{},platform:"android"};globalThis.process=t})();var Eo=class extends To.ValueComponent{get validatorEl(){return this.textAreaComponent.inputEl}textAreaComponent;constructor(t){super(),this.textAreaComponent=new To.TextAreaComponent(t),t.addClass($.LibraryName,rt(),$.MultipleTextComponent)}getValue(){return this.textAreaComponent.getValue().split(` -`)}onChange(t){return this.textAreaComponent.onChange(()=>t(this.getValue())),this}setDisabled(t){return this.textAreaComponent.setDisabled(t),this.disabled=t,this}setPlaceholder(t){return this.textAreaComponent.setPlaceholder(t),this}setValue(t){return this.textAreaComponent.setValue(t.join(` -`)),this}};(function(){if(globalThis.process)return;let t={browser:!0,cwd:__name(()=>"/","cwd"),env:{},platform:"android"};globalThis.process=t})();var Ao=class extends $e{constructor(t){super(t,"number",$.NumberComponent)}valueFromString(t){return parseInt(t,10)}};var Po=je(bn(),1);(function(){if(globalThis.process)return;let t={browser:!0,cwd:__name(()=>"/","cwd"),env:{},platform:"android"};globalThis.process=t})();var Fo=class extends $e{constructor(t){super(t,"time",$.TimeComponent)}valueFromString(t){return(0,Po.duration)(t)}valueToString(t){let n;return t.milliseconds()>0?n="HH:mm:ss.SSS":t.seconds()>0?n="HH:mm:ss":n="HH:mm",(0,Po.utc)(t.asMilliseconds()).format(n)}};(function(){if(globalThis.process)return;let t={browser:!0,cwd:__name(()=>"/","cwd"),env:{},platform:"android"};globalThis.process=t})();var Mo=class extends Ve{constructor(t){super(t,"url",$.UrlComponent)}valueFromString(t){return t}};var Da=je(bn(),1);(function(){if(globalThis.process)return;let t={browser:!0,cwd:__name(()=>"/","cwd"),env:{},platform:"android"};globalThis.process=t})();var Mf="YYYY-[W]WW",Io=class extends $e{constructor(t){super(t,"week",$.WeekComponent)}valueFromString(t){let n=(0,Da.default)(t,Mf);if(!n.isValid())throw new Error("Invalid week");return{weekNumber:n.isoWeek(),year:n.year()}}valueToString(t){return(0,Da.default)().year(t.year).isoWeek(t.weekNumber).format(Mf)}};(function(){if(globalThis.process)return;let t={browser:!0,cwd:__name(()=>"/","cwd"),env:{},platform:"android"};globalThis.process=t})();var Qe=class extends If.Setting{addComponent(t,n){let i=new t(this.controlEl);return this.components.push(i),n(i),this}addDate(t){return this.addComponent(wo,t)}addDateTime(t){return this.addComponent(ko,t)}addEmail(t){return this.addComponent(yo,t)}addFile(t){return this.addComponent(xo,t)}addMonth(t){return this.addComponent(bo,t)}addMultipleDropdown(t){return this.addComponent(vo,t)}addMultipleEmail(t){return this.addComponent(So,t)}addMultipleFile(t){return this.addComponent(_o,t)}addMultipleText(t){return this.addComponent(Eo,t)}addNumber(t){return this.addComponent(Ao,t)}addTime(t){return this.addComponent(Fo,t)}addUrl(t){return this.addComponent(Mo,t)}addWeek(t){return this.addComponent(Io,t)}};var Lo=class extends po{display(){this.containerEl.empty();let t="Move Attachments with Note";new Qe(this.containerEl).setName(t).setDesc("Automatically move attachments when a note is relocated. This includes attachments located in the same folder or any of its subfolders.").addToggle(s=>this.bind(s,"moveAttachmentsWithNote",{onChanged:async()=>{await this.checkDangerousSetting("moveAttachmentsWithNote",t)}}));let n="Delete Unused Attachments with Note";new Qe(this.containerEl).setName(n).setDesc("Automatically remove attachments that are no longer referenced in other notes when the note is deleted.").addToggle(s=>this.bind(s,"deleteAttachmentsWithNote",{onChanged:async()=>{await this.checkDangerousSetting("deleteAttachmentsWithNote",n)}})),new Qe(this.containerEl).setName("Update Links").setDesc("Automatically update links to attachments and other notes when moving notes or attachments.").addToggle(s=>this.bind(s,"updateLinks")),new Qe(this.containerEl).setName("Delete Empty Folders").setDesc("Automatically remove empty folders after moving notes with attachments.").addToggle(s=>this.bind(s,"deleteEmptyFolders"));let i="Delete Duplicate Attachments on Note Move";new Qe(this.containerEl).setName(i).setDesc("Automatically delete attachments when moving a note if a file with the same name exists in the destination folder. If disabled, the file will be renamed and moved.").addToggle(s=>this.bind(s,"deleteExistFilesWhenMoveNote",{onChanged:async()=>{await this.checkDangerousSetting("deleteExistFilesWhenMoveNote",i)}})),new Qe(this.containerEl).setName("Update Backlink Text on Note Rename").setDesc("When a note is renamed, its linked references are automatically updated. If this option is enabled, the text of backlinks to this note will also be modified.").addToggle(s=>this.bind(s,"changeNoteBacklinksAlt")),new Qe(this.containerEl).setName("Consistency Report Filename").setDesc("Specify the name of the file for the consistency report.").addText(s=>this.bind(s,"consistencyReportFile").setPlaceholder("Example: consistency-report.md"));let o="Auto Collect Attachments";new Qe(this.containerEl).setName(o).setDesc("Automatically collect attachments when the note is edited.").addToggle(s=>this.bind(s,"autoCollectAttachments",{onChanged:async()=>{await this.checkDangerousSetting("autoCollectAttachments",o)}})),new Qe(this.containerEl).setName("Include paths").setDesc(createFragment(s=>{s.appendText("Include notes from the following paths"),s.createEl("br"),s.appendText("Insert each path on a new line"),s.createEl("br"),s.appendText("You can use path string or "),Ma(s,"/regular expression/"),s.createEl("br"),s.appendText("If the setting is empty, all notes are included")})).addMultipleText(s=>{this.bind(s,"includePaths",{valueValidator:Lf})}),new Qe(this.containerEl).setName("Exclude paths").setDesc(createFragment(s=>{s.appendText("Exclude notes from the following paths"),s.createEl("br"),s.appendText("Insert each path on a new line"),s.createEl("br"),s.appendText("You can use path string or "),Ma(s,"/regular expression/"),s.createEl("br"),s.appendText("If the setting is empty, no notes are excluded")})).addMultipleText(s=>{this.bind(s,"excludePaths",{valueValidator:Lf})})}async checkDangerousSetting(t,n){this.plugin.settings[t]&&await yi({app:this.app,message:createFragment(i=>{i.createDiv({cls:"community-modal-readme"},o=>{o.appendText("You enabled "),o.createEl("strong",{cls:"markdown-rendered-code",text:n}),o.appendText(" setting. Without proper configuration it might lead to inconvenient attachment rearrangements or even data loss in your vault."),o.createEl("br"),o.appendText("It is "),o.createEl("strong",{text:"STRONGLY"}),o.appendText(" recommended to backup your vault before using the plugin."),o.createEl("br"),o.createEl("a",{href:"https://github.com/dy-sh/obsidian-consistent-attachments-and-links?tab=readme-ov-file",text:"Read more"}),o.appendText(" about how to use the plugin.")})}),title:createFragment(i=>{(0,Of.setIcon)(i.createSpan(),"triangle-alert"),i.appendText(" Consistent Attachments and Links")})})}};function Lf(e){for(let t of e)if(t.startsWith("/")&&t.endsWith("/")){let n=t.slice(1,-1);if(!Ll(n))return`Invalid regular expression ${t}`}}var yA=require("obsidian");var Df=require("obsidian");var vn=class extends Map{constructor(n){super();this.title=n}add(n,i){this.has(n)||this.set(n,[]);let o=this.get(n);o&&o.push(i)}toString(n,i){if(this.size>0){let o=`# ${this.title} (${this.size.toString()} files) -`;for(let s of this.keys()){let l=ce(n,s);if(!l)continue;let u=no({app:n,sourcePathOrFile:i,targetPathOrFile:l});o+=`${u}: -`;for(let f of this.get(s)??[])o+=`- (line ${(f.position.start.line+1).toString()}): \`${f.link}\` -`;o+=` - -`}return o}return`# ${this.title} -No problems found - -`}},Rr=class{constructor(t){this.plugin=t;}async checkConsistency(t,n,i,o,s){if(this.plugin.settings.isPathIgnored(t.path))return;let l=await mt(this.plugin.app,t.path);if(!l)return;let u=l.links??[],f=l.embeds??[];for(let m of u)await this.isValidLink(m,t.path)||n.add(t.path,m),Kn(m.original)&&o.add(t.path,m);for(let m of f)await this.isValidLink(m,t.path)||i.add(t.path,m),Kn(m.original)&&s.add(t.path,m)}async convertAllNoteEmbedsPathsToRelative(t){return await this.convertAllNoteRefPathsToRelative(t,!0)}async convertAllNoteLinksPathsToRelative(t){return await this.convertAllNoteRefPathsToRelative(t,!1)}async getCachedNotesThatHaveLinkToFile(t){let n=ce(this.plugin.app,t);return n?(await Jt(this.plugin.app,n)).keys():[]}getFullPathForLink(t,n){({linkPath:t}=Kt(t));let i=se(n);return we(i,t)}async replaceAllNoteWikilinksWithMarkdownLinks(t,n){if(this.plugin.settings.isPathIgnored(t))return 0;let i=ce(this.plugin.app,t);if(!i)return console.warn(`can't update wikilinks in note, file not found: ${t}`),0;let o=await mt(this.plugin.app,i);if(!o)return 0;let l=((n?o.embeds:o.links)??[]).filter(u=>Kn(u.original)).length;return await io({app:this.plugin.app,newSourcePathOrFile:i,shouldForceMarkdownLinks:!0,shouldUpdateEmbedOnlyLinks:n}),l}async updateChangedPathsInNote(t,n){if(this.plugin.settings.isPathIgnored(t))return;let i=ce(this.plugin.app,t);if(!i){console.warn(`can't update links in note, file not found: ${t}`);return}let o=new Map;for(let s of n)o.set(s.oldPath,s.newPath);await this.updateLinks(i,i.path,o)}async convertAllNoteRefPathsToRelative(t,n){if(this.plugin.settings.isPathIgnored(t))return[];let i=ce(this.plugin.app,t);if(!i)return[];let o=[];return await Mr(this.plugin.app,i,async()=>{let s=await mt(this.plugin.app,i);if(!s)return[];let l=(n?s.embeds:s.links)??[],u=[];for(let f of l){let m={endIndex:f.position.end.offset,newContent:this.convertLink({forceRelativePath:!0,link:f,note:i,oldNotePath:t}),oldContent:f.original,startIndex:f.position.start.offset};u.push(m),o.push({newLink:m.newContent,old:f})}return u}),o}convertLink({forceRelativePath:t,link:n,note:i,oldNotePath:o,pathChangeMap:s}){let{linkPath:l,subpath:u}=Kt(n.link),f=Yt(this.plugin.app,n,o)?.path??we(se(o),l),m=s?s.get(f):Yt(this.plugin.app,n,i.path)?.path??we(se(i.path),l);if(!m)return n.original;let h=ce(this.plugin.app,m)??ce(this.plugin.app,f);if(!h)return n.original;let p=n.displayText&&we(i.parent?.path??"",n.displayText)===f?void 0:n.displayText;return no({alias:p,app:this.plugin.app,originalLink:n.original,shouldForceRelativePath:t,sourcePathOrFile:i.path,subpath:u,targetPathOrFile:h})}async isValidLink(t,n){let{linkPath:i,subpath:o}=Kt(t.link),s;i?i.startsWith("/")?s=(0,Df.normalizePath)(i):s=we(se(n),i):s=n;let l=ce(this.plugin.app,s);if(!l)return!1;if(!o)return!0;let u=l.extension.toLocaleLowerCase();if(u==="pdf")return o.startsWith("#page=");if(u!==ui)return!1;let f=await mt(this.plugin.app,l);if(!f)return!1;let m="#^";if(o.startsWith(m))return Object.keys(f.blocks??{}).includes(Dt(o,m));let h="#";return(f.headings??[]).map(p=>p.heading.replaceAll(h," ")).includes(Dt(o,h))}async updateLinks(t,n,i){await Mr(this.plugin.app,t,async()=>{let o=await mt(this.plugin.app,t);return o?vt(o).map(l=>Xi(l,this.convertLink({link:l,note:t,oldNotePath:n,pathChangeMap:i}))):[]})}};var Nr=class{constructor(t,n){this.plugin=t;this.lh=n;}async collectAttachmentsForCachedNote(t,n,i){if(this.plugin.settings.isPathIgnored(t))return{movedAttachments:[]};let o={movedAttachments:[]},s=await mt(this.plugin.app,t);if(!s)return o;for(let l of vt(s)){let{linkPath:u}=Kt(l.link);if(!u)continue;let f=this.lh.getFullPathForLink(u,t);if(o.movedAttachments.findIndex(w=>w.oldPath===f)!==-1)continue;let m=Yt(this.plugin.app,l,t);if(!m){let w=ro(l.original)?"embed":"link";console.warn(`${t} has bad ${w} (file does not exist): ${u}`);continue}if(!this.isAttachment(m))continue;let h=await Ss(this.plugin.app,m.path,t);if(se(h)===se(m.path))continue;let p=await this.moveAttachment(m,h,[t],n,i);o.movedAttachments=o.movedAttachments.concat(p.movedAttachments)}return o}async deleteEmptyFolders(t){if(this.plugin.settings.isPathIgnored(t))return;t=Dt(t,"./");let n=await Jn(this.plugin.app,t);for(let i of n.folders)await this.deleteEmptyFolders(i);if(n=await Jn(this.plugin.app,t),n.files.length===0&&n.folders.length===0&&(this.plugin.consoleDebug(`delete empty folder: - ${t}`),await this.plugin.app.vault.exists(t)))try{await this.plugin.app.vault.adapter.rmdir(t,!1)}catch(i){if(await this.plugin.app.vault.adapter.exists(t))throw i}}async createFolderForAttachmentFromPath(t){await Zn(this.plugin.app,se(t))}async deleteFile(t,n){if(await this.plugin.app.fileManager.trashFile(t),n){let i=t.parent;for(;i&&i.children.length===0;)await this.plugin.app.fileManager.trashFile(i),i=i.parent}}isAttachment(t){return!Rt(this.plugin.app,t)}async moveAttachment(t,n,i,o,s){let l=t.path,u={movedAttachments:[]};if(this.plugin.settings.isPathIgnored(l)||!this.isAttachment(t))return u;if(l===n)return console.warn("Can't move file. Source and destination path the same."),u;await this.createFolderForAttachmentFromPath(n);let f=await this.lh.getCachedNotesThatHaveLinkToFile(l);for(let w of i)f.remove(w);if(l!==t.path)return console.warn("File was moved already"),await this.moveAttachment(t,n,i,o,s);let m=t.parent,h=f.length===0,p=ce(this.plugin.app,n);return p&&(o?(this.plugin.consoleDebug(`delete: ${n}`),await this.deleteFile(p,s)):n=Qi(this.plugin.app,n)),this.plugin.consoleDebug(`${h?"move":"copy"} - from: ${l} - to: ${n}`),u.movedAttachments.push({newPath:n,oldPath:l}),h?await Ji(this.plugin.app,t,n):await sf(this.plugin.app,t,n),this.plugin.settings.deleteEmptyFolders&&await oo(this.plugin.app,m),u}};var Oo=class extends bi{deletedNoteCache=new Map;fh;lh;async saveSettings(t){await super.saveSettings(t),this.lh=new Rr(this),this.fh=new Nr(this,this.lh)}createPluginSettings(t){return new mo(t)}createPluginSettingsTab(){return new Lo(this)}async onLayoutReady(){await this.showBackupWarning()}onloadComplete(){this.registerEvent(this.app.metadataCache.on("deleted",(t,n)=>{n&&this.handleDeletedMetadata(t,n)})),yf(this,()=>({isPathIgnored:n=>this.settings.isPathIgnored(n),shouldDeleteConflictingAttachments:this.settings.deleteExistFilesWhenMoveNote,shouldDeleteEmptyFolders:this.settings.deleteEmptyFolders,shouldHandleDeletions:this.settings.deleteAttachmentsWithNote,shouldHandleRenames:this.settings.updateLinks,shouldRenameAttachmentFolder:this.settings.moveAttachmentsWithNote,shouldUpdateFilenameAliases:this.settings.changeNoteBacklinksAlt})),this.addCommand({callback:()=>this.collectAllAttachments(),id:"collect-all-attachments",name:"Collect All Attachments"}),this.addCommand({checkCallback:t=>this.collectAttachmentsCurrentFolder(t),id:"collect-attachments-current-folder",name:"Collect Attachments in Current Folder"}),this.addCommand({checkCallback:this.collectAttachmentsCurrentNote.bind(this),id:"collect-attachments-current-note",name:"Collect Attachments in Current Note"}),this.addCommand({callback:()=>this.deleteEmptyFolders(),id:"delete-empty-folders",name:"Delete Empty Folders"}),this.addCommand({callback:()=>this.convertAllLinkPathsToRelative(),id:"convert-all-link-paths-to-relative",name:"Convert All Link Paths to Relative"}),this.addCommand({checkCallback:this.convertAllLinkPathsToRelativeCurrentNote.bind(this),id:"convert-all-link-paths-to-relative-current-note",name:"Convert All Link Paths to Relative in Current Note"}),this.addCommand({callback:()=>this.convertAllEmbedsPathsToRelative(),id:"convert-all-embed-paths-to-relative",name:"Convert All Embed Paths to Relative"}),this.addCommand({checkCallback:this.convertAllEmbedsPathsToRelativeCurrentNote.bind(this),id:"convert-all-embed-paths-to-relative-current-note",name:"Convert All Embed Paths to Relative in Current Note"}),this.addCommand({callback:()=>this.replaceAllWikilinksWithMarkdownLinks(),id:"replace-all-wikilinks-with-markdown-links",name:"Replace All Wiki Links with Markdown Links"}),this.addCommand({checkCallback:this.replaceAllWikilinksWithMarkdownLinksCurrentNote.bind(this),id:"replace-all-wikilinks-with-markdown-links-current-note",name:"Replace All Wiki Links with Markdown Links in Current Note"}),this.addCommand({callback:()=>this.replaceAllWikiEmbedsWithMarkdownEmbeds(),id:"replace-all-wiki-embeds-with-markdown-embeds",name:"Replace All Wiki Embeds with Markdown Embeds"}),this.addCommand({checkCallback:this.replaceAllWikiEmbedsWithMarkdownEmbedsCurrentNote.bind(this),id:"replace-all-wiki-embeds-with-markdown-embeds-current-note",name:"Replace All Wiki Embeds with Markdown Embeds in Current Note"}),this.addCommand({callback:()=>this.reorganizeVault(),id:"reorganize-vault",name:"Reorganize Vault"}),this.addCommand({callback:()=>this.checkConsistency(),id:"check-consistency",name:"Check Vault consistency"}),this.registerEvent(this.app.metadataCache.on("changed",t=>{it(this.app,()=>this.handleMetadataCacheChanged(t))})),this.registerEvent(this.app.workspace.on("file-menu",(t,n)=>{this.handleFileMenu(t,n)})),this.lh=new Rr(this),this.fh=new Nr(this,this.lh)}async checkConsistency(){await this.saveAllOpenNotes();let t=new vn("Bad links"),n=new vn("Bad embeds"),i=new vn("Wiki links"),o=new vn("Wiki embeds");await dn({abortSignal:this.abortSignal,buildNoticeMessage:(m,h)=>`Checking note ${h} - ${m.path}`,items:Qn(this.app),processItem:async m=>{await this.lh.checkConsistency(m,t,n,i,o)},shouldContinueOnError:!0});let s=this.settings.consistencyReportFile,l=t.toString(this.app,s)+n.toString(this.app,s)+i.toString(this.app,s)+o.toString(this.app,s);await Zn(this.app,se(s));let u=await Bl(this.app,s);await this.app.vault.modify(u,l);let f=!1;this.app.workspace.iterateAllLeaves(m=>{m.getDisplayText()!==""&&s.startsWith(m.getDisplayText())&&(f=!0)}),f||await this.app.workspace.openLinkText(s,"/",!1)}async collectAllAttachments(){await this.collectAttachmentsInFolder("/")}async collectAttachments(t,n=!0){if(this.settings.isPathIgnored(t.path)){new ye.Notice("Note path is ignored");return}await this.saveAllOpenNotes();let i=await this.fh.collectAttachmentsForCachedNote(t.path,this.settings.deleteExistFilesWhenMoveNote,this.settings.deleteEmptyFolders);i.movedAttachments.length>0&&await this.lh.updateChangedPathsInNote(t.path,i.movedAttachments),i.movedAttachments.length===0?n&&new ye.Notice("No files found that need to be moved"):new ye.Notice(`Moved ${i.movedAttachments.length.toString()} attachment${i.movedAttachments.length>1?"s":""}`)}collectAttachmentsCurrentFolder(t){let n=this.app.workspace.getActiveFile();return!n||!ke(this.app,n)?!1:(t||it(this.app,()=>this.collectAttachmentsInFolder(n.parent?.path??"/")),!0)}collectAttachmentsCurrentNote(t){let n=this.app.workspace.getActiveFile();return!n||!ke(this.app,n)?!1:(t||it(this.app,()=>this.collectAttachments(n)),!0)}async collectAttachmentsInFolder(t){let n=0,i=0;await this.saveAllOpenNotes(),await dn({abortSignal:this.abortSignal,buildNoticeMessage:(o,s)=>`Collecting attachments ${s} - ${o.path}`,items:zl(this.app,t,!0),processItem:async o=>{if(this.settings.isPathIgnored(o.path))return;let s=await this.fh.collectAttachmentsForCachedNote(o.path,this.settings.deleteExistFilesWhenMoveNote,this.settings.deleteEmptyFolders);s.movedAttachments.length>0&&(await this.lh.updateChangedPathsInNote(o.path,s.movedAttachments),n+=s.movedAttachments.length,i++)},shouldContinueOnError:!0}),n===0?new ye.Notice("No files found that need to be moved"):new ye.Notice(`Moved ${n.toString()} attachment${n>1?"s":""} from ${i.toString()} note${i>1?"s":""}`)}async convertAllEmbedsPathsToRelative(){await this.saveAllOpenNotes();let t=0,n=0;await dn({abortSignal:this.abortSignal,buildNoticeMessage:(i,o)=>`Converting embed paths to relative ${o} - ${i.path}`,items:Qn(this.app),processItem:async i=>{if(this.settings.isPathIgnored(i.path))return;let o=await this.lh.convertAllNoteEmbedsPathsToRelative(i.path);o.length>0&&(t+=o.length,n++)},shouldContinueOnError:!0}),t===0?new ye.Notice("No embeds found that need to be converted"):new ye.Notice(`Converted ${t.toString()} embed${t>1?"s":""} from ${n.toString()} note${n>1?"s":""}`)}convertAllEmbedsPathsToRelativeCurrentNote(t){let n=this.app.workspace.getActiveFile();return!n||!ke(this.app,n)?!1:(t||it(this.app,fr(()=>this.lh.convertAllNoteEmbedsPathsToRelative(n.path))),!0)}async convertAllLinkPathsToRelative(){await this.saveAllOpenNotes();let t=0,n=0;await dn({abortSignal:this.abortSignal,buildNoticeMessage:(i,o)=>`Converting link paths to relative ${o} - ${i.path}`,items:Qn(this.app),processItem:async i=>{if(this.settings.isPathIgnored(i.path))return;let o=await this.lh.convertAllNoteLinksPathsToRelative(i.path);o.length>0&&(t+=o.length,n++)},shouldContinueOnError:!0}),t===0?new ye.Notice("No links found that need to be converted"):new ye.Notice(`Converted ${t.toString()} link${t>1?"s":""} from ${n.toString()} note${n>1?"s":""}`)}convertAllLinkPathsToRelativeCurrentNote(t){let n=this.app.workspace.getActiveFile();return!n||!ke(this.app,n)?!1:(t||it(this.app,fr(()=>this.lh.convertAllNoteLinksPathsToRelative(n.path))),!0)}async deleteEmptyFolders(){await this.fh.deleteEmptyFolders("/")}handleDeletedMetadata(t,n){!this.settings.deleteAttachmentsWithNote||this.settings.isPathIgnored(t.path)||!ke(this.app,t)||this.deletedNoteCache.set(t.path,n)}handleFileMenu(t,n){wr(n)&&t.addItem(i=>{i.setTitle("Collect attachments in folder").setIcon("download").onClick(()=>this.collectAttachmentsInFolder(n.path))})}async handleMetadataCacheChanged(t){if(!this.settings.autoCollectAttachments)return;let n=document.querySelector(".suggestion-container");n&&n.style.display!=="none"||await this.collectAttachments(t,!1)}async reorganizeVault(){await this.saveAllOpenNotes(),await this.replaceAllWikilinksWithMarkdownLinks(),await this.replaceAllWikiEmbedsWithMarkdownEmbeds(),await this.convertAllEmbedsPathsToRelative(),await this.convertAllLinkPathsToRelative(),await this.collectAllAttachments(),await this.deleteEmptyFolders(),new ye.Notice("Reorganization of the vault completed")}async replaceAllWikiEmbedsWithMarkdownEmbeds(){await this.saveAllOpenNotes();let t=0,n=0;await dn({abortSignal:this.abortSignal,buildNoticeMessage:(i,o)=>`Replacing wiki embeds with markdown embeds ${o} - ${i.path}`,items:Qn(this.app),processItem:async i=>{if(this.settings.isPathIgnored(i.path))return;let o=await this.lh.replaceAllNoteWikilinksWithMarkdownLinks(i.path,!0);t+=o,n++},shouldContinueOnError:!0}),t===0?new ye.Notice("No wiki embeds found that need to be replaced"):new ye.Notice(`Replaced ${t.toString()} wiki embed${t>1?"s":""} from ${n.toString()} note${n>1?"s":""}`)}replaceAllWikiEmbedsWithMarkdownEmbedsCurrentNote(t){let n=this.app.workspace.getActiveFile();return!n||!ke(this.app,n)?!1:(t||it(this.app,fr(()=>this.lh.replaceAllNoteWikilinksWithMarkdownLinks(n.path,!0))),!0)}async replaceAllWikilinksWithMarkdownLinks(){await this.saveAllOpenNotes();let t=0,n=0;await dn({abortSignal:this.abortSignal,buildNoticeMessage:(i,o)=>`Replacing wikilinks with markdown links ${o} - ${i.path}`,items:Qn(this.app),processItem:async i=>{if(this.settings.isPathIgnored(i.path))return;let o=await this.lh.replaceAllNoteWikilinksWithMarkdownLinks(i.path,!1);t+=o,n++},shouldContinueOnError:!0}),t===0?new ye.Notice("No wiki links found that need to be replaced"):new ye.Notice(`Replaced ${t.toString()} wikilink${t>1?"s":""} from ${n.toString()} note${n>1?"s":""}`)}replaceAllWikilinksWithMarkdownLinksCurrentNote(t){let n=this.app.workspace.getActiveFile();return!n||!ke(this.app,n)?!1:(t||it(this.app,fr(()=>this.lh.replaceAllNoteWikilinksWithMarkdownLinks(n.path,!1))),!0)}async saveAllOpenNotes(){for(let t of this.app.workspace.getLeavesOfType("markdown"))t.view instanceof ye.MarkdownView&&await t.view.save()}async showBackupWarning(){if(!this.settings.showBackupWarning)return;await yi({app:this.app,message:createFragment(n=>{n.createDiv({cls:"community-modal-readme"},i=>{i.appendText("Using 'Consistent Attachments and Links' plugin without proper configuration might lead to inconvenient attachment rearrangements or even data loss in your vault."),i.createEl("br"),i.appendText("It is "),i.createEl("strong",{text:"STRONGLY"}),i.appendText(" recommended to backup your vault before using the plugin."),i.createEl("br"),this.settings.hadDangerousSettingsReverted&&(i.appendText("Some of your plugin settings has been changed to their safe values."),i.createEl("br")),i.createEl("a",{href:"https://github.com/dy-sh/obsidian-consistent-attachments-and-links?tab=readme-ov-file",text:"Read more"}),i.appendText(" about how to use the plugin."),i.createEl("br"),i.appendText("This warning will not appear again.")})}),title:createFragment(n=>{(0,ye.setIcon)(n.createSpan(),"triangle-alert"),n.appendText(" Consistent Attachments and Links")})});let t=this.settingsClone;t.showBackupWarning=!1,await this.saveSettings(t)}};var ny=Oo; -/*! Bundled license information: - -moment/moment.js: - (*! moment.js *) - (*! version : 2.30.1 *) - (*! authors : Tim Wood, Iskren Chernev, Moment.js contributors *) - (*! license : MIT *) - (*! momentjs.com *) -*/ ->>>>>>> origin/main /* nosourcemap */ \ No newline at end of file diff --git a/.obsidian/plugins/consistent-attachments-and-links/manifest.json b/.obsidian/plugins/consistent-attachments-and-links/manifest.json index eef41097..72228d95 100644 --- a/.obsidian/plugins/consistent-attachments-and-links/manifest.json +++ b/.obsidian/plugins/consistent-attachments-and-links/manifest.json @@ -1,13 +1,8 @@ { "id": "consistent-attachments-and-links", "name": "Consistent Attachments and Links", -<<<<<<< HEAD "version": "3.24.1", "minAppVersion": "1.7.7", -======= - "version": "3.24.13", - "minAppVersion": "1.8.7", ->>>>>>> origin/main "description": "This plugin ensures the consistency of attachments and links", "author": "Dmitry Savosh", "authorUrl": "https://github.com/dy-sh/",