garden/.obsidian/plugins/obsidian-linter/main.js

325 lines
522 KiB
JavaScript
Raw Normal View History

2024-11-29 21:54:26 -05:00
/*
THIS IS A GENERATED/BUNDLED FILE BY ESBUILD
if you want to view the source, please visit the github repository of this plugin
*/
var pf=Object.create;var ri=Object.defineProperty;var au=Object.getOwnPropertyDescriptor;var mf=Object.getOwnPropertyNames;var ff=Object.getPrototypeOf,gf=Object.prototype.hasOwnProperty;var En=(e,n)=>()=>(n||e((n={exports:{}}).exports,n),n.exports),ou=(e,n)=>{for(var t in n)ri(e,t,{get:n[t],enumerable:!0})},su=(e,n,t,r)=>{if(n&&typeof n=="object"||typeof n=="function")for(let i of mf(n))!gf.call(e,i)&&i!==t&&ri(e,i,{get:()=>n[i],enumerable:!(r=au(n,i))||r.enumerable});return e};var Tn=(e,n,t)=>(t=e!=null?pf(ff(e)):{},su(n||!e||!e.__esModule?ri(t,"default",{value:e,enumerable:!0}):t,e)),hf=e=>su(ri({},"__esModule",{value:!0}),e),S=(e,n,t,r)=>{for(var i=r>1?void 0:r?au(n,t):n,a=e.length-1,o;a>=0;a--)(o=e[a])&&(i=(r?o(n,t,i):o(i))||i);return r&&i&&ri(n,t,i),i};var Gs=(e,n,t)=>{if(!n.has(e))throw TypeError("Cannot "+t)};var _=(e,n,t)=>(Gs(e,n,"read from private field"),t?t.call(e):n.get(e)),Ae=(e,n,t)=>{if(n.has(e))throw TypeError("Cannot add the same private member more than once");n instanceof WeakSet?n.add(e):n.set(e,t)},Be=(e,n,t,r)=>(Gs(e,n,"write to private field"),r?r.call(e,t):n.set(e,t),t);var Zs=(e,n,t,r)=>({set _(i){Be(e,n,i,t)},get _(){return _(e,n,r)}}),me=(e,n,t)=>(Gs(e,n,"access private method"),t);var ao=En((Qu,io)=>{(function(e,n){"use strict";typeof define=="function"&&define.amd?define(n):typeof io=="object"&&io.exports?io.exports=n():e.log=n()})(Qu,function(){"use strict";var e=function(){},n="undefined",t=typeof window!==n&&typeof window.navigator!==n&&/Trident\/|MSIE /.test(window.navigator.userAgent),r=["trace","debug","info","warn","error"],i={},a=null;function o(f,b){var h=f[b];if(typeof h.bind=="function")return h.bind(f);try{return Function.prototype.bind.call(h,f)}catch{return function(){return Function.prototype.apply.apply(h,[f,arguments])}}}function s(){console.log&&(console.log.apply?console.log.apply(console,arguments):Function.prototype.apply.apply(console.log,[console,arguments])),console.trace&&console.trace()}function l(f){return f==="debug"&&(f="log"),typeof console===n?!1:f==="trace"&&t?s:console[f]!==void 0?o(console,f):console.log!==void 0?o(console,"log"):e}function c(){for(var f=this.getLevel(),b=0;b<r.length;b++){var h=r[b];this[h]=b<f?e:this.methodFactory(h,f,this.name)}if(this.log=this.debug,typeof console===n&&f<this.levels.SILENT)return"No console available for logging"}function u(f){return function(){typeof console!==n&&(c.call(this),this[f].apply(this,arguments))}}function d(f,b,h){return l(f)||u.apply(this,arguments)}function m(f,b){var h=this,k,A,L,T="loglevel";typeof f=="string"?T+=":"+f:typeof f=="symbol"&&(T=void 0);function M(K){var V=(r[K]||"silent").toUpperCase();if(!(typeof window===n||!T)){try{window.localStorage[T]=V;return}catch{}try{window.document.cookie=encodeURIComponent(T)+"="+V+";"}catch{}}}function E(){var K;if(!(typeof window===n||!T)){try{K=window.localStorage[T]}catch{}if(typeof K===n)try{var V=window.document.cookie,$=encodeURIComponent(T),D=V.indexOf($+"=");D!==-1&&(K=/^([^;]+)/.exec(V.slice(D+$.length+1))[1])}catch{}return h.levels[K]===void 0&&(K=void 0),K}}function O(){if(!(typeof window===n||!T)){try{window.localStorage.removeItem(T)}catch{}try{window.document.cookie=encodeURIComponent(T)+"=; expires=Thu, 01 Jan 1970 00:00:00 UTC"}catch{}}}function N(K){var V=K;if(typeof V=="string"&&h.levels[V.toUpperCase()]!==void 0&&(V=h.levels[V.toUpperCase()]),typeof V=="number"&&V>=0&&V<=h.levels.SILENT)return V;throw new TypeError("log.setLevel() called with invalid level: "+K)}h.name=f,h.levels={TRACE:0,DEBUG:1,INFO:2,WARN:3,ERROR:4,SILENT:5},h.methodFactory=b||d,h.getLevel=function(){return L??A??k},h.setLevel=function(K,V){return L=N(K),V!==!1&&M(L),c.call(h)},h.setDefaultLevel=function(K){A=N(K),E()||h.setLevel(K,!1)},h.resetLevel=function(){L=null,O(),c.call(h)},h.enableAll=function(K){h.setLevel(h.levels.TRACE,K)},h.disableAll=function(K){h.setLevel(h.levels.SILENT,K)},h.rebuild=function(){if(a!==h&&(k=N(a.getLevel())),c.call(h),a===h)for(var K in i)i[K].rebuild()},k=N(a?a.getLevel():"WARN");var R=E();R!=null&&(L=N(R)),c.call(h)}a=new m,a.getLogger=f
`,u),d==-1&&(d=l.length-1);var p=l.substring(u,d+1);(r.hasOwnProperty?r.hasOwnProperty(p):r[p]!==void 0)?c+=String.fromCharCode(r[p]):(m==a&&(p=l.substring(u),d=l.length),c+=String.fromCharCode(m),r[p]=m,t[m++]=p),u=d+1}return c}var a=4e4,o=i(e);a=65535;var s=i(n);return{chars1:o,chars2:s,lineArray:t}};I.prototype.diff_charsToLines_=function(e,n){for(var t=0;t<e.length;t++){for(var r=e[t][1],i=[],a=0;a<r.length;a++)i[a]=n[r.charCodeAt(a)];e[t][1]=i.join("")}};I.prototype.diff_commonPrefix=function(e,n){if(!e||!n||e.charAt(0)!=n.charAt(0))return 0;for(var t=0,r=Math.min(e.length,n.length),i=r,a=0;t<i;)e.substring(a,i)==n.substring(a,i)?(t=i,a=t):r=i,i=Math.floor((r-t)/2+t);return i};I.prototype.diff_commonSuffix=function(e,n){if(!e||!n||e.charAt(e.length-1)!=n.charAt(n.length-1))return 0;for(var t=0,r=Math.min(e.length,n.length),i=r,a=0;t<i;)e.substring(e.length-i,e.length-a)==n.substring(n.length-i,n.length-a)?(t=i,a=t):r=i,i=Math.floor((r-t)/2+t);return i};I.prototype.diff_commonOverlap_=function(e,n){var t=e.length,r=n.length;if(t==0||r==0)return 0;t>r?e=e.substring(t-r):t<r&&(n=n.substring(0,t));var i=Math.min(t,r);if(e==n)return i;for(var a=0,o=1;;){var s=e.substring(i-o),l=n.indexOf(s);if(l==-1)return a;o+=l,(l==0||e.substring(i-o)==n.substring(0,o))&&(a=o,o++)}};I.prototype.diff_halfMatch_=function(e,n){if(this.Diff_Timeout<=0)return null;var t=e.length>n.length?e:n,r=e.length>n.length?n:e;if(t.length<4||r.length*2<t.length)return null;var i=this;function a(f,b,h){for(var k=f.substring(h,h+Math.floor(f.length/4)),A=-1,L="",T,M,E,O;(A=b.indexOf(k,A+1))!=-1;){var N=i.diff_commonPrefix(f.substring(h),b.substring(A)),R=i.diff_commonSuffix(f.substring(0,h),b.substring(0,A));L.length<R+N&&(L=b.substring(A-R,A)+b.substring(A,A+N),T=f.substring(0,h-R),M=f.substring(h+N),E=b.substring(0,A-R),O=b.substring(A+N))}return L.length*2>=f.length?[T,M,E,O,L]:null}var o=a(t,r,Math.ceil(t.length/4)),s=a(t,r,Math.ceil(t.length/2)),l;if(!o&&!s)return null;s?o?l=o[4].length>s[4].length?o:s:l=s:l=o;var c,u,d,m;e.length>n.length?(c=l[0],u=l[1],d=l[2],m=l[3]):(d=l[0],m=l[1],c=l[2],u=l[3]);var p=l[4];return[c,u,d,m,p]};I.prototype.diff_cleanupSemantic=function(e){for(var n=!1,t=[],r=0,i=null,a=0,o=0,s=0,l=0,c=0;a<e.length;)e[a][0]==G?(t[r++]=a,o=l,s=c,l=0,c=0,i=e[a][1]):(e[a][0]==oe?l+=e[a][1].length:c+=e[a][1].length,i&&i.length<=Math.max(o,s)&&i.length<=Math.max(l,c)&&(e.splice(t[r-1],0,new I.Diff(re,i)),e[t[r-1]+1][0]=oe,r--,r--,a=r>0?t[r-1]:-1,o=0,s=0,l=0,c=0,i=null,n=!0)),a++;for(n&&this.diff_cleanupMerge(e),this.diff_cleanupSemanticLossless(e),a=1;a<e.length;){if(e[a-1][0]==re&&e[a][0]==oe){var u=e[a-1][1],d=e[a][1],m=this.diff_commonOverlap_(u,d),p=this.diff_commonOverlap_(d,u);m>=p?(m>=u.length/2||m>=d.length/2)&&(e.splice(a,0,new I.Diff(G,d.substring(0,m))),e[a-1][1]=u.substring(0,u.length-m),e[a+1][1]=d.substring(m),a++):(p>=u.length/2||p>=d.length/2)&&(e.splice(a,0,new I.Diff(G,u.substring(0,p))),e[a-1][0]=oe,e[a-1][1]=d.substring(0,d.length-p),e[a+1][0]=re,e[a+1][1]=u.substring(p),a++),a++}a++}};I.prototype.diff_cleanupSemanticLossless=function(e){function n(p,f){if(!p||!f)return 6;var b=p.charAt(p.length-1),h=f.charAt(0),k=b.match(I.nonAlphaNumericRegex_),A=h.match(I.nonAlphaNumericRegex_),L=k&&b.match(I.whitespaceRegex_),T=A&&h.match(I.whitespaceRegex_),M=L&&b.match(I.linebreakRegex_),E=T&&h.match(I.linebreakRegex_),O=M&&p.match(I.blanklineEndRegex_),N=E&&f.match(I.blanklineStartRegex_);return O||N?5:M||E?4:k&&!L&&T?3:L||T?2:k||A?1:0}for(var t=1;t<e.length-1;){if(e[t-1][0]==G&&e[t+1][0]==G){var r=e[t-1][1],i=e[t][1],a=e[t+1][1],o=this.diff_commonSuffix(r,i);if(o){var s=i.substring(i.length-o);r=r.substring(0,r.length-o),i=s+i.substring(0,i.length-o),a=s+a}for(var l=r,c=i,u=a,d=n(r,i)+n(i,a);i.charAt(0)===a.charAt(0);){r+=i.charAt(0),i=i.substring(1)+a.charAt(0),a=a.substring(1);var m=n(r,i)+n(i,a);m>=d&&(d=m,l=r,c=i,u=a)}e[t-1][1]!=l&&(l?e[t-1][1]=l:(e.splice(t-1,1),t--),e[t][1]=c,u?e[t+1][1]=u:(e.splice(t+1,1),t--))}t++}};I.nonAlphaNumericRegex_=/[^a-zA-Z0-9]/;I.whitespaceRegex_=/\s/;I.linebreakRegex_=/[\r\n]/;I.blanklineEnd
`),r=0,i=/^@@ -(\d+),?(\d*) \+(\d+),?(\d*) @@$/;r<t.length;){var a=t[r].match(i);if(!a)throw new Error("Invalid patch string: "+t[r]);var o=new I.patch_obj;for(n.push(o),o.start1=parseInt(a[1],10),a[2]===""?(o.start1--,o.length1=1):a[2]=="0"?o.length1=0:(o.start1--,o.length1=parseInt(a[2],10)),o.start2=parseInt(a[3],10),a[4]===""?(o.start2--,o.length2=1):a[4]=="0"?o.length2=0:(o.start2--,o.length2=parseInt(a[4],10)),r++;r<t.length;){var s=t[r].charAt(0);try{var l=decodeURI(t[r].substring(1))}catch{throw new Error("Illegal escape in patch_fromText: "+l)}if(s=="-")o.diffs.push(new I.Diff(re,l));else if(s=="+")o.diffs.push(new I.Diff(oe,l));else if(s==" ")o.diffs.push(new I.Diff(G,l));else{if(s=="@")break;if(s!=="")throw new Error('Invalid patch mode "'+s+'" in: '+l)}r++}}return n};I.patch_obj=function(){this.diffs=[],this.start1=null,this.start2=null,this.length1=0,this.length2=0};I.patch_obj.prototype.toString=function(){var e,n;this.length1===0?e=this.start1+",0":this.length1==1?e=this.start1+1:e=this.start1+1+","+this.length1,this.length2===0?n=this.start2+",0":this.length2==1?n=this.start2+1:n=this.start2+1+","+this.length2;for(var t=["@@ -"+e+" +"+n+` @@
`],r,i=0;i<this.diffs.length;i++){switch(this.diffs[i][0]){case oe:r="+";break;case re:r="-";break;case G:r=" ";break}t[i+1]=r+encodeURI(this.diffs[i][1])+`
`}return t.join("").replace(/%20/g," ")};qr.exports=I;qr.exports.diff_match_patch=I;qr.exports.DIFF_DELETE=re;qr.exports.DIFF_INSERT=oe;qr.exports.DIFF_EQUAL=G});var _m=En((uY,Nm)=>{Nm.exports=gA;var dw=["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],pw=["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],mw=["Su","Mo","Tu","We","Th","Fr","Sa"],Ms=["January","February","March","April","May","June","July","August","September","October","November","December"],fw=["ACDT","ACST","ACWT","ADT","ACT","AEDT","AEST","AFT","AKDT","AKST","ALMT","AMT","AMST","ANAT","ANAST","AQTT","ART","AST","AWDT","AWST","AZOT","AZOST","AZT","AZST","BNT","BDT","BOT","BRT","BRST","BST","BTT","B","CAST","CAT","CCT","CDT","CEDT","CEST","CET","CHADT","CHAST","CHOT","CHOST","CHsT","CHUT","CIT","CKT","CLST","CLT","COT","CST","CVT","CWST","CXT","C","DAVT","DDUT","DST","EASST","EAST","EAT","ECT","EDT","EEDT","EEST","EET","EGT","EGST","EST","E","EIT","FET","FJT","FJST","FKST","FKT","FNT","F","GALT","GAMT","GET","GFT","GILT","GMT","GST","GYT","G","HADT","HAST","HKT","HOVT","HOVST","HST","ICT","IDT","IOT","IRDT","IRKT","IRKST","IRST","IST","JST","KGT","KOST","KRAT","KRAST","KST","KUYT","LHDT","LHST","LINT","L","MAGT","MAGST","MART","MAWT","MDT","MeST","MHT","MIST","MMT","MSD","MSK","MST","MUT","MVT","MYT","NCT","NDT","NFT","N","NOVT","NOVST","NPT","NRT","NST","NT","NUT","NZDT","NZST","OMST","OMSST","ORAT","O","PDT","PET","PETT","PETST","PGT","PHT","PHOT","PKT","PMDT","PMST","PONT","PST","PWT","PYT","PYST","P","QYZT","RET","ROTT","R","SAKT","SAMT","SAST","SBT","SCT","SGT","SRT","SLT","SLST","SRET","SST","SYOT","TAHT","TFT","TJT","TKT","TLT","TMT","TOT","TRUT","TVT","T","ULAT","ULAST","UTC","UYST","UYT","UZT","U","VET","VLAT","VLAST","VOLT","VUT","V","WAKT","WAT","WAST","WDT","WEDT","WEST","WET","WFT","WGT","WGST","WIB","WIT","WITA","WST","WT","YAKT","YAKST","YAP","YEK","YEKS"],Is=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],gw=new RegExp(dw.join("|"),"i"),hw=new RegExp(pw.join("|"),"i"),yw=new RegExp("\\b("+mw.join("|")+")\\b","i"),bw=new RegExp(Ms.join("|"),"i"),vw=new RegExp(Is.join("|"),"i"),kw=new RegExp("\\b("+fw.join("|")+")\\b","i"),ww=/(\d+)(st|nd|rd|th)\b/i,Aw=/(\d{1,4})([/.-])(\d{1,2})[/.-](\d{1,4})/,xw=/((\+|-)(12:00|11:00|10:00|09:30|09:00|08:00|07:00|06:00|05:00|04:00|03:30|03:00|02:00|01:00|00:00|01:00|02:00|03:00|03:30|04:00|04:30|05:00|05:30|05:45|06:00|06:30|07:00|08:00|08:45|09:00|09:30|10:00|10:30|11:00|12:00|12:45|13:00|14:00))$/,Sw=/((\+|-)(1200|1100|1000|0930|0900|0800|0700|0600|0500|0400|0330|0300|0200|0100|0000|0100|0200|0300|0330|0400|0430|0500|0530|0545|0600|0630|0700|0800|0845|0900|0930|1000|1030|1100|1200|1245|1300|1400))$/,$r="("+["AM?","PM?"].join("|")+")",Lw=new RegExp("0\\d\\:\\d{1,2}\\:\\d{1,2}(\\s*)"+$r,"i"),Ew=new RegExp("0\\d\\:\\d{1,2}(\\s*)"+$r,"i"),Tw=new RegExp("0\\d(\\s*)"+$r,"i"),Cw=new RegExp("\\d{1,2}\\:\\d{1,2}\\:\\d{1,2}(\\s*)"+$r,"i"),Ow=new RegExp("\\d{1,2}\\:\\d{1,2}(\\s*)"+$r,"i"),Mw=new RegExp("\\d{1,2}(\\s*)"+$r,"i"),Iw=new RegExp("\\d{1,2}"),Bw=new RegExp(Ms.join("|")+"-\\d{2}","i"),Fw=new RegExp(Is.join("|")+"-\\d{2}","i"),Xc=new RegExp("(\\d{1,2})(\\D+)("+Ms.join("|")+"|"+Is.join("|")+")(\\2)('?\\d{2,4})"),Rw=/\d{2}:\d{2}:\d{2}\.\d{3}/,Dw=/\d{2}:\d{2}:\d{2}\.\d{2}/,zw=/\d{2}:\d{2}:\d{2}\.\d{1}/,Kw=/T\d{2}:\d{2}:\d{2}/,Nw=/0\d:\d{2}:\d{2}/,_w=/0\d:\d{2}/,Yw=/\b([01]?[0-9]|2[0-3]):[0-5][0-9]:\d{2}/,Pw=/\b([01]?[0-9]|2[0-3]):[0-5][0-9]:\d{2}\.\d{3}/,Hw=/\b([01]?[0-9]|2[0-3]):[0-5][0-9]:\d{2}\.\d{2}/,qw=/\b([01]?[0-9]|2[0-3]):[0-5][0-9]:\d{2}\.\d{1}/,Uw=/\b([01]?[0-9]|2[0-3]):[0-5][0-9]/,Ww=/24:00:\d{2}/,Vw=/24:00:\d{2}\.\d{3}/,jw=/24:00:\d{2}\.\d{2}/,$w=/24:00:\d{2}\.\d{1}/,Gw=/24:00/,Zw=/\d{4}/,Qw=/\d{2}/,Xw=/'\d{2}/,Fm=/0\d/,Rm=/\d{1,2}/,Jw=/0\d/,eA=/\d{1,2}/,tA=/^([1-9])\/([1-9]|0[1-9])$/,nA=/^([1-9])\/(1[012])$/,rA=/^(0[1-9]|[12][0-9]|3[01])\/([1-9])$/,iA=/^(0[1-9]|[12][0-9]|3[01])\/(1[012]|0[1-9])$/,aA=/^([1-9])(\D)([1-9][0-9])$/,oA=/^([1-9])(\D)([0][0-9])$/,sA=/^(0[1-9]|1[012])(\D)([1-9][0-9])$/,lA=/^(0[1-9]|1[012])(\D)([0][0-9])$/,Jc=/([/][M]|[M][/]|[MM]|[M
`+e.mark.snippet),r+" "+t):r}function ai(e,n){Error.call(this),this.name="YAMLException",this.reason=e,this.mark=n,this.message=Su(this,!1),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=new Error().stack||""}ai.prototype=Object.create(Error.prototype);ai.prototype.constructor=ai;ai.prototype.toString=function(n){return this.name+": "+Su(this,n)};var $e=ai;function Qs(e,n,t,r,i){var a="",o="",s=Math.floor(i/2)-1;return r-n>s&&(a=" ... ",n=r-s+a.length),t-r>s&&(o=" ...",t=r+s-o.length),{str:a+e.slice(n,t).replace(/\t/g,"\u2192")+o,pos:r-n+a.length}}function Xs(e,n){return Le.repeat(" ",n-e.length)+e}function Cf(e,n){if(n=Object.create(n||null),!e.buffer)return null;n.maxLength||(n.maxLength=79),typeof n.indent!="number"&&(n.indent=1),typeof n.linesBefore!="number"&&(n.linesBefore=3),typeof n.linesAfter!="number"&&(n.linesAfter=2);for(var t=/\r?\n|\r|\0/g,r=[0],i=[],a,o=-1;a=t.exec(e.buffer);)i.push(a.index),r.push(a.index+a[0].length),e.position<=a.index&&o<0&&(o=r.length-2);o<0&&(o=r.length-1);var s="",l,c,u=Math.min(e.line+n.linesAfter,i.length).toString().length,d=n.maxLength-(n.indent+u+3);for(l=1;l<=n.linesBefore&&!(o-l<0);l++)c=Qs(e.buffer,r[o-l],i[o-l],e.position-(r[o]-r[o-l]),d),s=Le.repeat(" ",n.indent)+Xs((e.line-l+1).toString(),u)+" | "+c.str+`
`+s;for(c=Qs(e.buffer,r[o],i[o],e.position,d),s+=Le.repeat(" ",n.indent)+Xs((e.line+1).toString(),u)+" | "+c.str+`
`,s+=Le.repeat("-",n.indent+u+3+c.pos)+`^
`,l=1;l<=n.linesAfter&&!(o+l>=i.length);l++)c=Qs(e.buffer,r[o+l],i[o+l],e.position-(r[o]-r[o+l]),d),s+=Le.repeat(" ",n.indent)+Xs((e.line+l+1).toString(),u)+" | "+c.str+`
`;return s.replace(/\n$/,"")}var Of=Cf,Mf=["kind","multi","resolve","construct","instanceOf","predicate","represent","representName","defaultStyle","styleAliases"],If=["scalar","sequence","mapping"];function Bf(e){var n={};return e!==null&&Object.keys(e).forEach(function(t){e[t].forEach(function(r){n[String(r)]=t})}),n}function Ff(e,n){if(n=n||{},Object.keys(n).forEach(function(t){if(Mf.indexOf(t)===-1)throw new $e('Unknown option "'+t+'" is met in definition of "'+e+'" YAML type.')}),this.options=n,this.tag=e,this.kind=n.kind||null,this.resolve=n.resolve||function(){return!0},this.construct=n.construct||function(t){return t},this.instanceOf=n.instanceOf||null,this.predicate=n.predicate||null,this.represent=n.represent||null,this.representName=n.representName||null,this.defaultStyle=n.defaultStyle||null,this.multi=n.multi||!1,this.styleAliases=Bf(n.styleAliases||null),If.indexOf(this.kind)===-1)throw new $e('Unknown kind "'+this.kind+'" is specified for "'+e+'" YAML type.')}var qe=Ff;function lu(e,n){var t=[];return e[n].forEach(function(r){var i=t.length;t.forEach(function(a,o){a.tag===r.tag&&a.kind===r.kind&&a.multi===r.multi&&(i=o)}),t[i]=r}),t}function Rf(){var e={scalar:{},sequence:{},mapping:{},fallback:{},multi:{scalar:[],sequence:[],mapping:[],fallback:[]}},n,t;function r(i){i.multi?(e.multi[i.kind].push(i),e.multi.fallback.push(i)):e[i.kind][i.tag]=e.fallback[i.tag]=i}for(n=0,t=arguments.length;n<t;n+=1)arguments[n].forEach(r);return e}function el(e){return this.extend(e)}el.prototype.extend=function(n){var t=[],r=[];if(n instanceof qe)r.push(n);else if(Array.isArray(n))r=r.concat(n);else if(n&&(Array.isArray(n.implicit)||Array.isArray(n.explicit)))n.implicit&&(t=t.concat(n.implicit)),n.explicit&&(r=r.concat(n.explicit));else throw new $e("Schema.extend argument should be a Type, [ Type ], or a schema definition ({ implicit: [...], explicit: [...] })");t.forEach(function(a){if(!(a instanceof qe))throw new $e("Specified list of YAML types (or a single Type object) contains a non-Type object.");if(a.loadKind&&a.loadKind!=="scalar")throw new $e("There is a non-scalar type in the implicit list of a schema. Implicit resolving of such types is not supported.");if(a.multi)throw new $e("There is a multi type in the implicit list of a schema. Multi tags can only be listed as explicit.")}),r.forEach(function(a){if(!(a instanceof qe))throw new $e("Specified list of YAML types (or a single Type object) contains a non-Type object.")});var i=Object.create(el.prototype);return i.implicit=(this.implicit||[]).concat(t),i.explicit=(this.explicit||[]).concat(r),i.compiledImplicit=lu(i,"implicit"),i.compiledExplicit=lu(i,"explicit"),i.compiledTypeMap=Rf(i.compiledImplicit,i.compiledExplicit),i};var Df=el,zf=new qe("tag:yaml.org,2002:str",{kind:"scalar",construct:function(e){return e!==null?e:""}}),Kf=new qe("tag:yaml.org,2002:seq",{kind:"sequence",construct:function(e){return e!==null?e:[]}}),Nf=new qe("tag:yaml.org,2002:map",{kind:"mapping",construct:function(e){return e!==null?e:{}}}),_f=new Df({explicit:[zf,Kf,Nf]});function Yf(e){if(e===null)return!0;var n=e.length;return n===1&&e==="~"||n===4&&(e==="null"||e==="Null"||e==="NULL")}function Pf(){return null}function Hf(e){return e===null}var qf=new qe("tag:yaml.org,2002:null",{kind:"scalar",resolve:Yf,construct:Pf,predicate:Hf,represent:{canonical:function(){return"~"},lowercase:function(){return"null"},uppercase:function(){return"NULL"},camelcase:function(){return"Null"},empty:function(){return""}},defaultStyle:"lowercase"});function Uf(e){if(e===null)return!1;var n=e.length;return n===4&&(e==="true"||e==="True"||e==="TRUE")||n===5&&(e==="false"||e==="False"||e==="FALSE")}function Wf(e){return e==="true"||e==="True"||e==="TRUE"}function Vf(e){return Object.prototype.toString.call(e)==="[object Boolean]"}var jf=new qe("tag:yaml.org,2002:bool",{kind:"scalar",resolve:Uf,construct:Wf,predicate:Vf,represent:{lowercase:function(e){return e?"true":"false"},uppercase:function(e){return e?"TRUE":"FALSE"},camelcase:function(e){return e?"True":"False"}},defaultStyle:"lowercase"});functio
\r`;function hg(e){if(e===null)return!1;var n,t,r=0,i=e.length,a=al;for(t=0;t<i;t++)if(n=a.indexOf(e.charAt(t)),!(n>64)){if(n<0)return!1;r+=6}return r%8===0}function yg(e){var n,t,r=e.replace(/[\r\n=]/g,""),i=r.length,a=al,o=0,s=[];for(n=0;n<i;n++)n%4===0&&n&&(s.push(o>>16&255),s.push(o>>8&255),s.push(o&255)),o=o<<6|a.indexOf(r.charAt(n));return t=i%4*6,t===0?(s.push(o>>16&255),s.push(o>>8&255),s.push(o&255)):t===18?(s.push(o>>10&255),s.push(o>>2&255)):t===12&&s.push(o>>4&255),new Uint8Array(s)}function bg(e){var n="",t=0,r,i,a=e.length,o=al;for(r=0;r<a;r++)r%3===0&&r&&(n+=o[t>>18&63],n+=o[t>>12&63],n+=o[t>>6&63],n+=o[t&63]),t=(t<<8)+e[r];return i=a%3,i===0?(n+=o[t>>18&63],n+=o[t>>12&63],n+=o[t>>6&63],n+=o[t&63]):i===2?(n+=o[t>>10&63],n+=o[t>>4&63],n+=o[t<<2&63],n+=o[64]):i===1&&(n+=o[t>>2&63],n+=o[t<<4&63],n+=o[64],n+=o[64]),n}function vg(e){return Object.prototype.toString.call(e)==="[object Uint8Array]"}var kg=new qe("tag:yaml.org,2002:binary",{kind:"scalar",resolve:hg,construct:yg,predicate:vg,represent:bg}),wg=Object.prototype.hasOwnProperty,Ag=Object.prototype.toString;function xg(e){if(e===null)return!0;var n=[],t,r,i,a,o,s=e;for(t=0,r=s.length;t<r;t+=1){if(i=s[t],o=!1,Ag.call(i)!=="[object Object]")return!1;for(a in i)if(wg.call(i,a))if(!o)o=!0;else return!1;if(!o)return!1;if(n.indexOf(a)===-1)n.push(a);else return!1}return!0}function Sg(e){return e!==null?e:[]}var Lg=new qe("tag:yaml.org,2002:omap",{kind:"sequence",resolve:xg,construct:Sg}),Eg=Object.prototype.toString;function Tg(e){if(e===null)return!0;var n,t,r,i,a,o=e;for(a=new Array(o.length),n=0,t=o.length;n<t;n+=1){if(r=o[n],Eg.call(r)!=="[object Object]"||(i=Object.keys(r),i.length!==1))return!1;a[n]=[i[0],r[i[0]]]}return!0}function Cg(e){if(e===null)return[];var n,t,r,i,a,o=e;for(a=new Array(o.length),n=0,t=o.length;n<t;n+=1)r=o[n],i=Object.keys(r),a[n]=[i[0],r[i[0]]];return a}var Og=new qe("tag:yaml.org,2002:pairs",{kind:"sequence",resolve:Tg,construct:Cg}),Mg=Object.prototype.hasOwnProperty;function Ig(e){if(e===null)return!0;var n,t=e;for(n in t)if(Mg.call(t,n)&&t[n]!==null)return!1;return!0}function Bg(e){return e!==null?e:{}}var Fg=new qe("tag:yaml.org,2002:set",{kind:"mapping",resolve:Ig,construct:Bg}),Tu=cg.extend({implicit:[mg,gg],explicit:[kg,Lg,Og,Fg]}),tn=Object.prototype.hasOwnProperty,Xa=1,Cu=2,Ou=3,Ja=4,Js=1,Rg=2,cu=3,Dg=/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F-\x84\x86-\x9F\uFFFE\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]/,zg=/[\x85\u2028\u2029]/,Kg=/[,\[\]\{\}]/,Mu=/^(?:!|!!|![a-z\-]+!)$/i,Iu=/^(?:!|[^,\[\]\{\}])(?:%[0-9a-f]{2}|[0-9a-z\-#;\/\?:@&=\+\$,_\.!~\*'\(\)\[\]])*$/i;function uu(e){return Object.prototype.toString.call(e)}function Mt(e){return e===10||e===13}function On(e){return e===9||e===32}function tt(e){return e===9||e===32||e===10||e===13}function xr(e){return e===44||e===91||e===93||e===123||e===125}function Ng(e){var n;return 48<=e&&e<=57?e-48:(n=e|32,97<=n&&n<=102?n-97+10:-1)}function _g(e){return e===120?2:e===117?4:e===85?8:0}function Yg(e){return 48<=e&&e<=57?e-48:-1}function du(e){return e===48?"\0":e===97?"\x07":e===98?"\b":e===116||e===9?" ":e===110?`
`:e===118?"\v":e===102?"\f":e===114?"\r":e===101?"\x1B":e===32?" ":e===34?'"':e===47?"/":e===92?"\\":e===78?"\x85":e===95?"\xA0":e===76?"\u2028":e===80?"\u2029":""}function Pg(e){return e<=65535?String.fromCharCode(e):String.fromCharCode((e-65536>>10)+55296,(e-65536&1023)+56320)}var Bu=new Array(256),Fu=new Array(256);for(Cn=0;Cn<256;Cn++)Bu[Cn]=du(Cn)?1:0,Fu[Cn]=du(Cn);var Cn;function Hg(e,n){this.input=e,this.filename=n.filename||null,this.schema=n.schema||Tu,this.onWarning=n.onWarning||null,this.legacy=n.legacy||!1,this.json=n.json||!1,this.listener=n.listener||null,this.implicitTypes=this.schema.compiledImplicit,this.typeMap=this.schema.compiledTypeMap,this.length=e.length,this.position=0,this.line=0,this.lineStart=0,this.lineIndent=0,this.firstTabInLine=-1,this.documents=[]}function Ru(e,n){var t={name:e.filename,buffer:e.input.slice(0,-1),position:e.position,line:e.line,column:e.position-e.lineStart};return t.snippet=Of(t),new $e(n,t)}function Y(e,n){throw Ru(e,n)}function eo(e,n){e.onWarning&&e.onWarning.call(null,Ru(e,n))}var pu={YAML:function(n,t,r){var i,a,o;n.version!==null&&Y(n,"duplication of %YAML directive"),r.length!==1&&Y(n,"YAML directive accepts exactly one argument"),i=/^([0-9]+)\.([0-9]+)$/.exec(r[0]),i===null&&Y(n,"ill-formed argument of the YAML directive"),a=parseInt(i[1],10),o=parseInt(i[2],10),a!==1&&Y(n,"unacceptable YAML version of the document"),n.version=r[0],n.checkLineBreaks=o<2,o!==1&&o!==2&&eo(n,"unsupported YAML version of the document")},TAG:function(n,t,r){var i,a;r.length!==2&&Y(n,"TAG directive accepts exactly two arguments"),i=r[0],a=r[1],Mu.test(i)||Y(n,"ill-formed tag handle (first argument) of the TAG directive"),tn.call(n.tagMap,i)&&Y(n,'there is a previously declared suffix for "'+i+'" tag handle'),Iu.test(a)||Y(n,"ill-formed tag prefix (second argument) of the TAG directive");try{a=decodeURIComponent(a)}catch{Y(n,"tag prefix is malformed: "+a)}n.tagMap[i]=a}};function en(e,n,t,r){var i,a,o,s;if(n<t){if(s=e.input.slice(n,t),r)for(i=0,a=s.length;i<a;i+=1)o=s.charCodeAt(i),o===9||32<=o&&o<=1114111||Y(e,"expected valid JSON character");else Dg.test(s)&&Y(e,"the stream contains non-printable characters");e.result+=s}}function mu(e,n,t,r){var i,a,o,s;for(Le.isObject(t)||Y(e,"cannot merge mappings; the provided source object is unacceptable"),i=Object.keys(t),o=0,s=i.length;o<s;o+=1)a=i[o],tn.call(n,a)||(n[a]=t[a],r[a]=!0)}function Sr(e,n,t,r,i,a,o,s,l){var c,u;if(Array.isArray(i))for(i=Array.prototype.slice.call(i),c=0,u=i.length;c<u;c+=1)Array.isArray(i[c])&&Y(e,"nested arrays are not supported inside keys"),typeof i=="object"&&uu(i[c])==="[object Object]"&&(i[c]="[object Object]");if(typeof i=="object"&&uu(i)==="[object Object]"&&(i="[object Object]"),i=String(i),n===null&&(n={}),r==="tag:yaml.org,2002:merge")if(Array.isArray(a))for(c=0,u=a.length;c<u;c+=1)mu(e,n,a[c],t);else mu(e,n,a,t);else!e.json&&!tn.call(t,i)&&tn.call(n,i)&&(e.line=o||e.line,e.lineStart=s||e.lineStart,e.position=l||e.position,Y(e,"duplicated mapping key")),i==="__proto__"?Object.defineProperty(n,i,{configurable:!0,enumerable:!0,writable:!0,value:a}):n[i]=a,delete t[i];return n}function ol(e){var n;n=e.input.charCodeAt(e.position),n===10?e.position++:n===13?(e.position++,e.input.charCodeAt(e.position)===10&&e.position++):Y(e,"a line break is expected"),e.line+=1,e.lineStart=e.position,e.firstTabInLine=-1}function xe(e,n,t){for(var r=0,i=e.input.charCodeAt(e.position);i!==0;){for(;On(i);)i===9&&e.firstTabInLine===-1&&(e.firstTabInLine=e.position),i=e.input.charCodeAt(++e.position);if(n&&i===35)do i=e.input.charCodeAt(++e.position);while(i!==10&&i!==13&&i!==0);if(Mt(i))for(ol(e),i=e.input.charCodeAt(e.position),r++,e.lineIndent=0;i===32;)e.lineIndent++,i=e.input.charCodeAt(++e.position);else break}return t!==-1&&r!==0&&e.lineIndent<t&&eo(e,"deficient indentation"),r}function ro(e){var n=e.position,t;return t=e.input.charCodeAt(n),!!((t===45||t===46)&&t===e.input.charCodeAt(n+1)&&t===e.input.charCodeAt(n+2)&&(n+=3,t=e.input.charCodeAt(n),t===0||tt(t)))}function sl(e,n){n===1?e.result+=" ":n>1&&(e.result+=Le.rep
`,n-1))}function qg(e,n,t){var r,i,a,o,s,l,c,u,d=e.kind,m=e.result,p;if(p=e.input.charCodeAt(e.position),tt(p)||xr(p)||p===35||p===38||p===42||p===33||p===124||p===62||p===39||p===34||p===37||p===64||p===96||(p===63||p===45)&&(i=e.input.charCodeAt(e.position+1),tt(i)||t&&xr(i)))return!1;for(e.kind="scalar",e.result="",a=o=e.position,s=!1;p!==0;){if(p===58){if(i=e.input.charCodeAt(e.position+1),tt(i)||t&&xr(i))break}else if(p===35){if(r=e.input.charCodeAt(e.position-1),tt(r))break}else{if(e.position===e.lineStart&&ro(e)||t&&xr(p))break;if(Mt(p))if(l=e.line,c=e.lineStart,u=e.lineIndent,xe(e,!1,-1),e.lineIndent>=n){s=!0,p=e.input.charCodeAt(e.position);continue}else{e.position=o,e.line=l,e.lineStart=c,e.lineIndent=u;break}}s&&(en(e,a,o,!1),sl(e,e.line-l),a=o=e.position,s=!1),On(p)||(o=e.position+1),p=e.input.charCodeAt(++e.position)}return en(e,a,o,!1),e.result?!0:(e.kind=d,e.result=m,!1)}function Ug(e,n){var t,r,i;if(t=e.input.charCodeAt(e.position),t!==39)return!1;for(e.kind="scalar",e.result="",e.position++,r=i=e.position;(t=e.input.charCodeAt(e.position))!==0;)if(t===39)if(en(e,r,e.position,!0),t=e.input.charCodeAt(++e.position),t===39)r=e.position,e.position++,i=e.position;else return!0;else Mt(t)?(en(e,r,i,!0),sl(e,xe(e,!1,n)),r=i=e.position):e.position===e.lineStart&&ro(e)?Y(e,"unexpected end of the document within a single quoted scalar"):(e.position++,i=e.position);Y(e,"unexpected end of the stream within a single quoted scalar")}function Wg(e,n){var t,r,i,a,o,s;if(s=e.input.charCodeAt(e.position),s!==34)return!1;for(e.kind="scalar",e.result="",e.position++,t=r=e.position;(s=e.input.charCodeAt(e.position))!==0;){if(s===34)return en(e,t,e.position,!0),e.position++,!0;if(s===92){if(en(e,t,e.position,!0),s=e.input.charCodeAt(++e.position),Mt(s))xe(e,!1,n);else if(s<256&&Bu[s])e.result+=Fu[s],e.position++;else if((o=_g(s))>0){for(i=o,a=0;i>0;i--)s=e.input.charCodeAt(++e.position),(o=Ng(s))>=0?a=(a<<4)+o:Y(e,"expected hexadecimal character");e.result+=Pg(a),e.position++}else Y(e,"unknown escape sequence");t=r=e.position}else Mt(s)?(en(e,t,r,!0),sl(e,xe(e,!1,n)),t=r=e.position):e.position===e.lineStart&&ro(e)?Y(e,"unexpected end of the document within a double quoted scalar"):(e.position++,r=e.position)}Y(e,"unexpected end of the stream within a double quoted scalar")}function Vg(e,n){var t=!0,r,i,a,o=e.tag,s,l=e.anchor,c,u,d,m,p,f=Object.create(null),b,h,k,A;if(A=e.input.charCodeAt(e.position),A===91)u=93,p=!1,s=[];else if(A===123)u=125,p=!0,s={};else return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=s),A=e.input.charCodeAt(++e.position);A!==0;){if(xe(e,!0,n),A=e.input.charCodeAt(e.position),A===u)return e.position++,e.tag=o,e.anchor=l,e.kind=p?"mapping":"sequence",e.result=s,!0;t?A===44&&Y(e,"expected the node content, but found ','"):Y(e,"missed comma between flow collection entries"),h=b=k=null,d=m=!1,A===63&&(c=e.input.charCodeAt(e.position+1),tt(c)&&(d=m=!0,e.position++,xe(e,!0,n))),r=e.line,i=e.lineStart,a=e.position,Lr(e,n,Xa,!1,!0),h=e.tag,b=e.result,xe(e,!0,n),A=e.input.charCodeAt(e.position),(m||e.line===r)&&A===58&&(d=!0,A=e.input.charCodeAt(++e.position),xe(e,!0,n),Lr(e,n,Xa,!1,!0),k=e.result),p?Sr(e,s,f,h,b,k,r,i,a):d?s.push(Sr(e,null,f,h,b,k,r,i,a)):s.push(b),xe(e,!0,n),A=e.input.charCodeAt(e.position),A===44?(t=!0,A=e.input.charCodeAt(++e.position)):t=!1}Y(e,"unexpected end of the stream within a flow collection")}function jg(e,n){var t,r,i=Js,a=!1,o=!1,s=n,l=0,c=!1,u,d;if(d=e.input.charCodeAt(e.position),d===124)r=!1;else if(d===62)r=!0;else return!1;for(e.kind="scalar",e.result="";d!==0;)if(d=e.input.charCodeAt(++e.position),d===43||d===45)Js===i?i=d===43?cu:Rg:Y(e,"repeat of a chomping mode identifier");else if((u=Yg(d))>=0)u===0?Y(e,"bad explicit indentation width of a block scalar; it cannot be less than one"):o?Y(e,"repeat of an indentation width identifier"):(s=n+u-1,o=!0);else break;if(On(d)){do d=e.input.charCodeAt(++e.position);while(On(d));if(d===35)do d=e.input.charCodeAt(++e.position);while(!Mt(d)&&d!==0)}for(;d!==0;){for(ol(e),e.lineIndent=0,d=e.input.charCodeAt(e.position);(!o||e.lineIn
`,a?1+l:l):i===Js&&a&&(e.result+=`
`);break}for(r?On(d)?(c=!0,e.result+=Le.repeat(`
`,a?1+l:l)):c?(c=!1,e.result+=Le.repeat(`
`,l+1)):l===0?a&&(e.result+=" "):e.result+=Le.repeat(`
`,l):e.result+=Le.repeat(`
`,a?1+l:l),a=!0,o=!0,l=0,t=e.position;!Mt(d)&&d!==0;)d=e.input.charCodeAt(++e.position);en(e,t,e.position,!1)}return!0}function fu(e,n){var t,r=e.tag,i=e.anchor,a=[],o,s=!1,l;if(e.firstTabInLine!==-1)return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=a),l=e.input.charCodeAt(e.position);l!==0&&(e.firstTabInLine!==-1&&(e.position=e.firstTabInLine,Y(e,"tab characters must not be used in indentation")),!(l!==45||(o=e.input.charCodeAt(e.position+1),!tt(o))));){if(s=!0,e.position++,xe(e,!0,-1)&&e.lineIndent<=n){a.push(null),l=e.input.charCodeAt(e.position);continue}if(t=e.line,Lr(e,n,Ou,!1,!0),a.push(e.result),xe(e,!0,-1),l=e.input.charCodeAt(e.position),(e.line===t||e.lineIndent>n)&&l!==0)Y(e,"bad indentation of a sequence entry");else if(e.lineIndent<n)break}return s?(e.tag=r,e.anchor=i,e.kind="sequence",e.result=a,!0):!1}function $g(e,n,t){var r,i,a,o,s,l,c=e.tag,u=e.anchor,d={},m=Object.create(null),p=null,f=null,b=null,h=!1,k=!1,A;if(e.firstTabInLine!==-1)return!1;for(e.anchor!==null&&(e.anchorMap[e.anchor]=d),A=e.input.charCodeAt(e.position);A!==0;){if(!h&&e.firstTabInLine!==-1&&(e.position=e.firstTabInLine,Y(e,"tab characters must not be used in indentation")),r=e.input.charCodeAt(e.position+1),a=e.line,(A===63||A===58)&&tt(r))A===63?(h&&(Sr(e,d,m,p,f,null,o,s,l),p=f=b=null),k=!0,h=!0,i=!0):h?(h=!1,i=!0):Y(e,"incomplete explicit mapping pair; a key node is missed; or followed by a non-tabulated empty line"),e.position+=1,A=r;else{if(o=e.line,s=e.lineStart,l=e.position,!Lr(e,t,Cu,!1,!0))break;if(e.line===a){for(A=e.input.charCodeAt(e.position);On(A);)A=e.input.charCodeAt(++e.position);if(A===58)A=e.input.charCodeAt(++e.position),tt(A)||Y(e,"a whitespace character is expected after the key-value separator within a block mapping"),h&&(Sr(e,d,m,p,f,null,o,s,l),p=f=b=null),k=!0,h=!1,i=!1,p=e.tag,f=e.result;else if(k)Y(e,"can not read an implicit mapping pair; a colon is missed");else return e.tag=c,e.anchor=u,!0}else if(k)Y(e,"can not read a block mapping entry; a multiline key may not be an implicit key");else return e.tag=c,e.anchor=u,!0}if((e.line===a||e.lineIndent>n)&&(h&&(o=e.line,s=e.lineStart,l=e.position),Lr(e,n,Ja,!0,i)&&(h?f=e.result:b=e.result),h||(Sr(e,d,m,p,f,b,o,s,l),p=f=b=null),xe(e,!0,-1),A=e.input.charCodeAt(e.position)),(e.line===a||e.lineIndent>n)&&A!==0)Y(e,"bad indentation of a mapping entry");else if(e.lineIndent<n)break}return h&&Sr(e,d,m,p,f,null,o,s,l),k&&(e.tag=c,e.anchor=u,e.kind="mapping",e.result=d),k}function Gg(e){var n,t=!1,r=!1,i,a,o;if(o=e.input.charCodeAt(e.position),o!==33)return!1;if(e.tag!==null&&Y(e,"duplication of a tag property"),o=e.input.charCodeAt(++e.position),o===60?(t=!0,o=e.input.charCodeAt(++e.position)):o===33?(r=!0,i="!!",o=e.input.charCodeAt(++e.position)):i="!",n=e.position,t){do o=e.input.charCodeAt(++e.position);while(o!==0&&o!==62);e.position<e.length?(a=e.input.slice(n,e.position),o=e.input.charCodeAt(++e.position)):Y(e,"unexpected end of the stream within a verbatim tag")}else{for(;o!==0&&!tt(o);)o===33&&(r?Y(e,"tag suffix cannot contain exclamation marks"):(i=e.input.slice(n-1,e.position+1),Mu.test(i)||Y(e,"named tag handle cannot contain such characters"),r=!0,n=e.position+1)),o=e.input.charCodeAt(++e.position);a=e.input.slice(n,e.position),Kg.test(a)&&Y(e,"tag suffix cannot contain flow indicator characters")}a&&!Iu.test(a)&&Y(e,"tag name cannot contain such characters: "+a);try{a=decodeURIComponent(a)}catch{Y(e,"tag name is malformed: "+a)}return t?e.tag=a:tn.call(e.tagMap,i)?e.tag=e.tagMap[i]+a:i==="!"?e.tag="!"+a:i==="!!"?e.tag="tag:yaml.org,2002:"+a:Y(e,'undeclared tag handle "'+i+'"'),!0}function Zg(e){var n,t;if(t=e.input.charCodeAt(e.position),t!==38)return!1;for(e.anchor!==null&&Y(e,"duplication of an anchor property"),t=e.input.charCodeAt(++e.position),n=e.position;t!==0&&!tt(t)&&!xr(t);)t=e.input.charCodeAt(++e.position);return e.position===n&&Y(e,"name of an anchor node must contain at least one character"),e.anchor=e.input.slice(n,e.position),!0}function Qg(e){var n,t,r;if(r=e.input.charCodeAt(e.position),r!==42)return!1;for(r=e.input.charCodeAt(++e.
`),e.charCodeAt(0)===65279&&(e=e.slice(1)));var t=new Hg(e,n),r=e.indexOf("\0");for(r!==-1&&(t.position=r,Y(t,"null byte is not allowed in input")),t.input+="\0";t.input.charCodeAt(t.position)===32;)t.lineIndent+=1,t.position+=1;for(;t.position<t.length-1;)Xg(t);return t.documents}function Jg(e,n,t){n!==null&&typeof n=="object"&&typeof t>"u"&&(t=n,n=null);var r=Du(e,t);if(typeof n!="function")return r;for(var i=0,a=r.length;i<a;i+=1)n(r[i])}function eh(e,n){var t=Du(e,n);if(t.length!==0){if(t.length===1)return t[0];throw new $e("expected a single document in the stream, but found more")}}var th=Jg,nh=eh,zu={loadAll:th,load:nh},Ku=Object.prototype.toString,Nu=Object.prototype.hasOwnProperty,ll=65279,rh=9,oi=10,ih=13,ah=32,oh=33,sh=34,tl=35,lh=37,ch=38,uh=39,dh=42,_u=44,ph=45,to=58,mh=61,fh=62,gh=63,hh=64,Yu=91,Pu=93,yh=96,Hu=123,bh=124,qu=125,Ue={};Ue[0]="\\0";Ue[7]="\\a";Ue[8]="\\b";Ue[9]="\\t";Ue[10]="\\n";Ue[11]="\\v";Ue[12]="\\f";Ue[13]="\\r";Ue[27]="\\e";Ue[34]='\\"';Ue[92]="\\\\";Ue[133]="\\N";Ue[160]="\\_";Ue[8232]="\\L";Ue[8233]="\\P";var vh=["y","Y","yes","Yes","YES","on","On","ON","n","N","no","No","NO","off","Off","OFF"],kh=/^[-+]?[0-9_]+(?::[0-9_]+)+(?:\.[0-9_]*)?$/;function wh(e,n){var t,r,i,a,o,s,l;if(n===null)return{};for(t={},r=Object.keys(n),i=0,a=r.length;i<a;i+=1)o=r[i],s=String(n[o]),o.slice(0,2)==="!!"&&(o="tag:yaml.org,2002:"+o.slice(2)),l=e.compiledTypeMap.fallback[o],l&&Nu.call(l.styleAliases,s)&&(s=l.styleAliases[s]),t[o]=s;return t}function Ah(e){var n,t,r;if(n=e.toString(16).toUpperCase(),e<=255)t="x",r=2;else if(e<=65535)t="u",r=4;else if(e<=4294967295)t="U",r=8;else throw new $e("code point within a string may not be greater than 0xFFFFFFFF");return"\\"+t+Le.repeat("0",r-n.length)+n}var xh=1,si=2;function Sh(e){this.schema=e.schema||Tu,this.indent=Math.max(1,e.indent||2),this.noArrayIndent=e.noArrayIndent||!1,this.skipInvalid=e.skipInvalid||!1,this.flowLevel=Le.isNothing(e.flowLevel)?-1:e.flowLevel,this.styleMap=wh(this.schema,e.styles||null),this.sortKeys=e.sortKeys||!1,this.lineWidth=e.lineWidth||80,this.noRefs=e.noRefs||!1,this.noCompatMode=e.noCompatMode||!1,this.condenseFlow=e.condenseFlow||!1,this.quotingType=e.quotingType==='"'?si:xh,this.forceQuotes=e.forceQuotes||!1,this.replacer=typeof e.replacer=="function"?e.replacer:null,this.implicitTypes=this.schema.compiledImplicit,this.explicitTypes=this.schema.compiledExplicit,this.tag=null,this.result="",this.duplicates=[],this.usedDuplicates=null}function gu(e,n){for(var t=Le.repeat(" ",n),r=0,i=-1,a="",o,s=e.length;r<s;)i=e.indexOf(`
`,r),i===-1?(o=e.slice(r),r=s):(o=e.slice(r,i+1),r=i+1),o.length&&o!==`
`&&(a+=t),a+=o;return a}function nl(e,n){return`
`+Le.repeat(" ",e.indent*n)}function Lh(e,n){var t,r,i;for(t=0,r=e.implicitTypes.length;t<r;t+=1)if(i=e.implicitTypes[t],i.resolve(n))return!0;return!1}function no(e){return e===ah||e===rh}function li(e){return 32<=e&&e<=126||161<=e&&e<=55295&&e!==8232&&e!==8233||57344<=e&&e<=65533&&e!==ll||65536<=e&&e<=1114111}function hu(e){return li(e)&&e!==ll&&e!==ih&&e!==oi}function yu(e,n,t){var r=hu(e),i=r&&!no(e);return(t?r:r&&e!==_u&&e!==Yu&&e!==Pu&&e!==Hu&&e!==qu)&&e!==tl&&!(n===to&&!i)||hu(n)&&!no(n)&&e===tl||n===to&&i}function Eh(e){return li(e)&&e!==ll&&!no(e)&&e!==ph&&e!==gh&&e!==to&&e!==_u&&e!==Yu&&e!==Pu&&e!==Hu&&e!==qu&&e!==tl&&e!==ch&&e!==dh&&e!==oh&&e!==bh&&e!==mh&&e!==fh&&e!==uh&&e!==sh&&e!==lh&&e!==hh&&e!==yh}function Th(e){return!no(e)&&e!==to}function ii(e,n){var t=e.charCodeAt(n),r;return t>=55296&&t<=56319&&n+1<e.length&&(r=e.charCodeAt(n+1),r>=56320&&r<=57343)?(t-55296)*1024+r-56320+65536:t}function Uu(e){var n=/^\n* /;return n.test(e)}var Wu=1,rl=2,Vu=3,ju=4,Ar=5;function Ch(e,n,t,r,i,a,o,s){var l,c=0,u=null,d=!1,m=!1,p=r!==-1,f=-1,b=Eh(ii(e,0))&&Th(ii(e,e.length-1));if(n||o)for(l=0;l<e.length;c>=65536?l+=2:l++){if(c=ii(e,l),!li(c))return Ar;b=b&&yu(c,u,s),u=c}else{for(l=0;l<e.length;c>=65536?l+=2:l++){if(c=ii(e,l),c===oi)d=!0,p&&(m=m||l-f-1>r&&e[f+1]!==" ",f=l);else if(!li(c))return Ar;b=b&&yu(c,u,s),u=c}m=m||p&&l-f-1>r&&e[f+1]!==" "}return!d&&!m?b&&!o&&!i(e)?Wu:a===si?Ar:rl:t>9&&Uu(e)?Ar:o?a===si?Ar:rl:m?ju:Vu}function Oh(e,n,t,r,i){e.dump=function(){if(n.length===0)return e.quotingType===si?'""':"''";if(!e.noCompatMode&&(vh.indexOf(n)!==-1||kh.test(n)))return e.quotingType===si?'"'+n+'"':"'"+n+"'";var a=e.indent*Math.max(1,t),o=e.lineWidth===-1?-1:Math.max(Math.min(e.lineWidth,40),e.lineWidth-a),s=r||e.flowLevel>-1&&t>=e.flowLevel;function l(c){return Lh(e,c)}switch(Ch(n,s,e.indent,o,l,e.quotingType,e.forceQuotes&&!r,i)){case Wu:return n;case rl:return"'"+n.replace(/'/g,"''")+"'";case Vu:return"|"+bu(n,e.indent)+vu(gu(n,a));case ju:return">"+bu(n,e.indent)+vu(gu(Mh(n,o),a));case Ar:return'"'+Ih(n)+'"';default:throw new $e("impossible error: invalid scalar style")}}()}function bu(e,n){var t=Uu(e)?String(n):"",r=e[e.length-1]===`
`,i=r&&(e[e.length-2]===`
`||e===`
`),a=i?"+":r?"":"-";return t+a+`
`}function vu(e){return e[e.length-1]===`
`?e.slice(0,-1):e}function Mh(e,n){for(var t=/(\n+)([^\n]*)/g,r=function(){var c=e.indexOf(`
`);return c=c!==-1?c:e.length,t.lastIndex=c,ku(e.slice(0,c),n)}(),i=e[0]===`
`||e[0]===" ",a,o;o=t.exec(e);){var s=o[1],l=o[2];a=l[0]===" ",r+=s+(!i&&!a&&l!==""?`
`:"")+ku(l,n),i=a}return r}function ku(e,n){if(e===""||e[0]===" ")return e;for(var t=/ [^ ]/g,r,i=0,a,o=0,s=0,l="";r=t.exec(e);)s=r.index,s-i>n&&(a=o>i?o:s,l+=`
`+e.slice(i,a),i=a+1),o=s;return l+=`
`,e.length-i>n&&o>i?l+=e.slice(i,o)+`
`+e.slice(o+1):l+=e.slice(i),l.slice(1)}function Ih(e){for(var n="",t=0,r,i=0;i<e.length;t>=65536?i+=2:i++)t=ii(e,i),r=Ue[t],!r&&li(t)?(n+=e[i],t>=65536&&(n+=e[i+1])):n+=r||Ah(t);return n}function Bh(e,n,t){var r="",i=e.tag,a,o,s;for(a=0,o=t.length;a<o;a+=1)s=t[a],e.replacer&&(s=e.replacer.call(t,String(a),s)),(Ut(e,n,s,!1,!1)||typeof s>"u"&&Ut(e,n,null,!1,!1))&&(r!==""&&(r+=","+(e.condenseFlow?"":" ")),r+=e.dump);e.tag=i,e.dump="["+r+"]"}function wu(e,n,t,r){var i="",a=e.tag,o,s,l;for(o=0,s=t.length;o<s;o+=1)l=t[o],e.replacer&&(l=e.replacer.call(t,String(o),l)),(Ut(e,n+1,l,!0,!0,!1,!0)||typeof l>"u"&&Ut(e,n+1,null,!0,!0,!1,!0))&&((!r||i!=="")&&(i+=nl(e,n)),e.dump&&oi===e.dump.charCodeAt(0)?i+="-":i+="- ",i+=e.dump);e.tag=a,e.dump=i||"[]"}function Fh(e,n,t){var r="",i=e.tag,a=Object.keys(t),o,s,l,c,u;for(o=0,s=a.length;o<s;o+=1)u="",r!==""&&(u+=", "),e.condenseFlow&&(u+='"'),l=a[o],c=t[l],e.replacer&&(c=e.replacer.call(t,l,c)),Ut(e,n,l,!1,!1)&&(e.dump.length>1024&&(u+="? "),u+=e.dump+(e.condenseFlow?'"':"")+":"+(e.condenseFlow?"":" "),Ut(e,n,c,!1,!1)&&(u+=e.dump,r+=u));e.tag=i,e.dump="{"+r+"}"}function Rh(e,n,t,r){var i="",a=e.tag,o=Object.keys(t),s,l,c,u,d,m;if(e.sortKeys===!0)o.sort();else if(typeof e.sortKeys=="function")o.sort(e.sortKeys);else if(e.sortKeys)throw new $e("sortKeys must be a boolean or a function");for(s=0,l=o.length;s<l;s+=1)m="",(!r||i!=="")&&(m+=nl(e,n)),c=o[s],u=t[c],e.replacer&&(u=e.replacer.call(t,c,u)),Ut(e,n+1,c,!0,!0,!0)&&(d=e.tag!==null&&e.tag!=="?"||e.dump&&e.dump.length>1024,d&&(e.dump&&oi===e.dump.charCodeAt(0)?m+="?":m+="? "),m+=e.dump,d&&(m+=nl(e,n)),Ut(e,n+1,u,!0,d)&&(e.dump&&oi===e.dump.charCodeAt(0)?m+=":":m+=": ",m+=e.dump,i+=m));e.tag=a,e.dump=i||"{}"}function Au(e,n,t){var r,i,a,o,s,l;for(i=t?e.explicitTypes:e.implicitTypes,a=0,o=i.length;a<o;a+=1)if(s=i[a],(s.instanceOf||s.predicate)&&(!s.instanceOf||typeof n=="object"&&n instanceof s.instanceOf)&&(!s.predicate||s.predicate(n))){if(t?s.multi&&s.representName?e.tag=s.representName(n):e.tag=s.tag:e.tag="?",s.represent){if(l=e.styleMap[s.tag]||s.defaultStyle,Ku.call(s.represent)==="[object Function]")r=s.represent(n,l);else if(Nu.call(s.represent,l))r=s.represent[l](n,l);else throw new $e("!<"+s.tag+'> tag resolver accepts not "'+l+'" style');e.dump=r}return!0}return!1}function Ut(e,n,t,r,i,a,o){e.tag=null,e.dump=t,Au(e,t,!1)||Au(e,t,!0);var s=Ku.call(e.dump),l=r,c;r&&(r=e.flowLevel<0||e.flowLevel>n);var u=s==="[object Object]"||s==="[object Array]",d,m;if(u&&(d=e.duplicates.indexOf(t),m=d!==-1),(e.tag!==null&&e.tag!=="?"||m||e.indent!==2&&n>0)&&(i=!1),m&&e.usedDuplicates[d])e.dump="*ref_"+d;else{if(u&&m&&!e.usedDuplicates[d]&&(e.usedDuplicates[d]=!0),s==="[object Object]")r&&Object.keys(e.dump).length!==0?(Rh(e,n,e.dump,i),m&&(e.dump="&ref_"+d+e.dump)):(Fh(e,n,e.dump),m&&(e.dump="&ref_"+d+" "+e.dump));else if(s==="[object Array]")r&&e.dump.length!==0?(e.noArrayIndent&&!o&&n>0?wu(e,n-1,e.dump,i):wu(e,n,e.dump,i),m&&(e.dump="&ref_"+d+e.dump)):(Bh(e,n,e.dump),m&&(e.dump="&ref_"+d+" "+e.dump));else if(s==="[object String]")e.tag!=="?"&&Oh(e,e.dump,n,a,l);else{if(s==="[object Undefined]")return!1;if(e.skipInvalid)return!1;throw new $e("unacceptable kind of an object to dump "+s)}e.tag!==null&&e.tag!=="?"&&(c=encodeURI(e.tag[0]==="!"?e.tag.slice(1):e.tag).replace(/!/g,"%21"),e.tag[0]==="!"?c="!"+c:c.slice(0,18)==="tag:yaml.org,2002:"?c="!!"+c.slice(18):c="!<"+c+">",e.dump=c+" "+e.dump)}return!0}function Dh(e,n){var t=[],r=[],i,a;for(il(e,t,r),i=0,a=r.length;i<a;i+=1)n.duplicates.push(t[r[i]]);n.usedDuplicates=new Array(a)}function il(e,n,t){var r,i,a;if(e!==null&&typeof e=="object")if(i=n.indexOf(e),i!==-1)t.indexOf(i)===-1&&t.push(i);else if(n.push(e),Array.isArray(e))for(i=0,a=e.length;i<a;i+=1)il(e[i],n,t);else for(r=Object.keys(e),i=0,a=r.length;i<a;i+=1)il(e[r[i]],n,t)}function zh(e,n){n=n||{};var t=new Sh(n);t.noRefs||Dh(e,t);var r=e;return t.replacer&&(r=t.replacer.call({"":r},"",r)),Ut(t,0,r,!0,!0)?t.dump+`
`:""}var Kh=zh,Nh={dump:Kh};function cl(e,n){return function(){throw new Error("Function yaml."+e+" is removed in js-yaml 4. Use yaml."+n+" instead, which is now safe by default.")}}var ul=zu.load,VA=zu.loadAll,dl=Nh.dump,$u=$e;var jA=cl("safeLoad","load"),$A=cl("safeLoadAll","loadAll"),GA=cl("safeDump","dump");function ci(e,n){if(e==null)return null;let t=pl(e,n);return typeof t=="string"?t:null}function Gu(e,n){if(e==null)return null;let t=pl(e,n);return typeof t=="number"?t:null}function Zu(e,n){if(e==null)return null;let t=pl(e,n);return typeof t=="boolean"?t:null}function pl(e,n){n=n.replace("..",".");let t=n.split(".");t!=null&&t[t.length-1]==""&&(t[t.length-1]=".");let r=e;for(let i of t)if(r=r[i],r==null)return null;return r}var ie=Tn(ao());var oo="[Obsidian Linter]",ml=new Map,ui=!1;var so=[];function lo(e,n){let t=`${oo} ${e}:
`;t+=`${n.name} ${n.message}`,n.stack&&(t+=`
`+n.stack),ie.default.error(t),ui&&co(t.substring(t.indexOf("]")+2),ie.default.levels.TRACE)}function nn(e){ie.default.info(`${oo} ${e}`),ui&&co(e,ie.default.levels.INFO)}function nt(e){ie.default.debug(`${oo} ${e}`),ui&&co(e,ie.default.levels.DEBUG)}function pt(e){ie.default.warn(`${oo} ${e}`),ui&&co(e,ie.default.levels.WARN)}function Mn(e){ie.default.getLevel()>ie.default.levels.DEBUG||ml.set(e,performance.now())}function rn(e){if(ie.default.getLevel()>ie.default.levels.DEBUG)return;ml.has(e)||pt(x("logs.timing-key-not-found").replace("{TIMING_KEY}",e));let n=performance.now()-ml.get(e);nt(`${e}: ${n} `+x("logs.milliseconds-abbreviation"))}function co(e,n){ie.default.getLevel()<=n&&so.push(e)}function Xu(){so=[]}function fl(e){ui=e}function uo(e){switch(e){case"INFO":{ie.default.setLevel("info");break}case"TRACE":{ie.default.setLevel("trace");break}case"DEBUG":{ie.default.setLevel("debug");break}case"SILENT":{ie.default.setLevel("silent");break}case"ERROR":{ie.default.setLevel("error");break}case"WARN":{ie.default.setLevel("warn");break}}}function Ju(e){switch(e){case ie.default.levels.INFO:return"INFO";case ie.default.levels.TRACE:return"TRACE";case ie.default.levels.DEBUG:return"DEBUG";case ie.default.levels.SILENT:return"SILENT";case ie.default.levels.ERROR:return"ERROR";case ie.default.levels.WARN:return"WARN"}}var ed={};var td={};var nd={};var rd={commands:{"lint-file":{name:"Linten Sie die aktuelle Datei","error-message":"Lint-Datei-Fehler in der Datei"},"lint-file-unless-ignored":{name:"Linten Sie die aktuelle Datei, es sei denn, sie wird ignoriert"},"lint-all-files":{name:"Linten Sie alle Dateien im Vault","error-message":"Beim Linten aller Dateien Fehler in der Datei","success-message":"Alle Dateien gelinted","errors-message-singular":"Beim Linten aller Dateien gab es einen Fehler.","errors-message-plural":"Beim Linten aller Dateien gab es {NUM} Fehler.","start-message":"Dadurch werden alle Ihre Dateien ver\xE4ndert und es k\xF6nnen Fehler entstehen.","submit-button-text":"Linte alle","submit-button-notice-text":"Linte alle Dateien..."},"lint-all-files-in-folder":{name:"Linte alle Dateien im aktuellen Ordner","start-message":"Dadurch werden alle Ihre Dateien in {FOLDER_NAME} bearbeitet, einschlie\xDFlich der Dateien in den Unterordnern, was zu Fehlern f\xFChren kann.","submit-button-text":"Linte alle Dateien in {FOLDER_NAME}","submit-button-notice-text":"Linten aller Dateien in {FOLDER_NAME}...","error-message":"Beim Linten aller Dateien im Ordner gab es Fehler in der Datei","success-message":"Alle {NUM}-Dateien in {FOLDER_NAME} wurden gelinted.","message-singular":"Alle {NUM}-Dateien in {FOLDER_NAME} wurden gelinted und es trat ein Fehler auf.","message-plural":"Alle {FILE_COUNT}-Dateien in {FOLDER_NAME} wurden gelinted und es gab {ERROR_COUNT} Fehler."},"paste-as-plain-text":{name:"Einf\xFCgen als reiner Text und ohne \xC4nderungen"},"lint-file-pop-up-menu-text":{name:"Linte Datei"},"lint-folder-pop-up-menu-text":{name:"Linte Ordner"}},logs:{"plugin-load":"Plugin wird geladen","plugin-unload":"Plugin entladen","folder-lint":"Linting-Ordner ","linter-run":"Laufender Linter","paste-link-warning":"Abgebrochenes Einf\xFCgen des Lints, da der Inhalt der Zwischenablage ein Link ist, wodurch Konflikte mit anderen Plugins vermieden werden, die das Einf\xFCgen \xE4ndern.","see-console":"Weitere Informationen finden Sie in der Konsole.","unknown-error":"Beim Linten ist ein unbekannter Fehler aufgetreten.","moment-locale-not-found":"Beim Versuch, Moment.js locale auf {MOMENT_LOCALE} umzustellen, wurde {CURRENT_LOCALE} angezeigt","file-change-lint-message-start":"Linted","pre-rules":"Regeln vor regul\xE4ren Regeln","post-rules":"Regeln nach regul\xE4ren Regeln","rule-running":"Laufende Regeln","custom-regex":"Benutzerdefinierte Regex-Regeln","running-custom-regex":"Ausf\xFChren von benutzerdefinierten Regex","running-custom-lint-command":"Ausf\xFChren von benutzerdefinierten Lint-Befehlen","custom-lint-duplicate-warning":'Sie k\xF6nnen denselben Befehl ("{COMMAND_NAME}") nicht zweimal als benutzerdefinierte Lint-Regel
`)break;i.trim()===""||i===">"?t=i+t:t="",r--}return[t,r]}function vl(e=""){let[n]=Er(e,e.length);return`
`+n.trim()}function Ld(e="",n=!1,t=1){let r=vl(e),i=sn(r,">");return(n||ko.test(e))&&t===i||t<i?r.substring(0,r.lastIndexOf(">")):r}function Wh(e,n){if(n===0)return e;let t=n,r=n;for(;t>=0;){let i=e.charAt(t);if(i.trim()!=="")break;i===`
`&&(r=t),t--}return t<0||r===0?e.substring(n+1):e.substring(0,r)+`
`+e.substring(n)}function Vh(e,n,t,r=!1,i=!1){if(t===0)return e;let a=n.split(">").length-1,o=t,s=t,l=0,c=!1,u="";for(;o>=0;){let A=e.charAt(o);if(A.trim()!==""&&A!==">")break;if(A===">"){if(c)break;l++}else if(A===`
`)if(l===0||l===a||l+1===a)s=o,l=0,u===`
`&&(c=!0);else break;o--,u=A}if(o<0||s===0)return e.substring(t+1);let d=e.substring(s,t);if(d===`
`||d.startsWith(`
`))return e.substring(0,s)+`
`+e.substring(t);let p=e.lastIndexOf(`
`,s-1),f="";p===-1?f=e.substring(0,s):f=e.substring(p,s);let b,h=e.indexOf(`
`,t+1);h===-1?b=e.substring(t):b=e.substring(t,h);let k;return i?k=Ld(f,r,a):sn(f,">")!=0&&!ko.test(f)&&(di.test(f)||di.test(b))?k=e.substring(s,t).trimEnd():k=vl(f),e.substring(0,s)+k+e.substring(t)}function jh(e,n){if(n===e.length-1)return e;let t=n,r=n,i=!0;for(;t<e.length;){let a=e.charAt(t);if(a.trim()!=="")break;a===`
`&&(i?i=!1:r=t),t++}return t===e.length||r===e.length-1?e.substring(0,n):e.substring(0,n)+`
`+e.substring(r)}function $h(e,n,t,r=!1,i=!1){if(t===e.length-1)return e;let a=n.split(">").length-1,o=t,s=t,l=!0,c=0,u=!1,d="",m=!0,p=e.charAt(o-1);for(;o<e.length;){let M=e.charAt(o);if(M.trim()!==""&&M!==">")break;if(M===">"){if(u)break;c++}else if(M===`
`)if(c===0||c===a||c+1===a)c=0,l?l=!1:s=o,d===`
`&&(u=!0);else break;if(o++,d=M,m&&M===`
`&&i&&p===`
`){s=o;break}m=!1}if(o===e.length||s===e.length-1)return e.substring(0,t);let f=e.substring(t,s);if(f===`
`||f.endsWith(`
`))return e.substring(0,t)+`
`+e.substring(s);let h=e.indexOf(`
`,s+1),k="";h===-1?k=e.substring(s):k=e.substring(s+1,h);let A,L=e.lastIndexOf(`
`,t-1);L===-1?A=e.substring(0,s):A=e.substring(L+1,t);let T;return i?T=Ld(k,r,a):di.test(k)||di.test(A)?T=e.substring(t,s).trimEnd():T=vl(k),e.substring(0,t)+T+e.substring(s)}function on(e,n,t,r=!1){let[i,a]=Er(e,n);if(i.trim()!==""){let s=ko.test(e.substring(n,t)),l=sn(i,">"),c=Zh(e,t,l),u=$h(e,i,c,s,r);return a=Gh(u,a,l),Vh(u,i,a,s,r)}let o=jh(e,t);return Wh(o,a)}function Ed(e,n=0){let t=3735928559^n,r=1103547991^n;for(let i=0,a;i<e.length;i++)a=e.charCodeAt(i),t=Math.imul(t^a,2654435761),r=Math.imul(r^a,1597334677);return t=Math.imul(t^t>>>16,2246822507)^Math.imul(r^r>>>13,3266489909),r=Math.imul(r^r>>>16,2246822507)^Math.imul(t^t>>>13,3266489909),4294967296*(2097151&r)+(t>>>0)}function Td(e){return e=e.replaceAll("\\b","\b"),e=e.replaceAll("\\f","\f"),e=e.replaceAll("\\n",`
`),e=e.replaceAll("\\r","\r"),e=e.replaceAll("\\t"," "),e=e.replaceAll("\\v","\v"),e}function pi(e,n){if(n==0)return n;let t=n;for(;t>0&&e.charAt(t-1)!==`
`;)t--;return t}function Cd(e,n,t,r){return r>e.length-1?e:e.slice(0,r)+e.slice(r,e.length).replace(n,t)}function sn(e,n){let t=0;for(let r=0,i=e.length;r<i;r++){let a=e.indexOf(n,r);a>-1&&(t++,r=a)}return t}function vo(e){let n=typeof e;return n!="string"?n==="number":!isNaN(e)&&!isNaN(parseFloat(e))}function Od(e,n){let t=[],r=-1;for(;(r=n.indexOf(e,r+1))>=0;)t.push(r);return t}function Gh(e,n,t){let r=n,i=n+1,a="",o=!1,s=0;for(;i<e.length;){if(a=e.charAt(i),a.trim()!==""&&a!==">"){o=!0;break}else if(a===`
`){if(s!==t)break;s=0,r=i}else a===">"&&s++;i++}return o?r:n}function Zh(e,n,t){let r=n,i=n-1,a="",o=!1,s=0;for(;i>=0;){if(a=e.charAt(i),a.trim()!==""&&a!==">"){o=!0;break}else if(a===`
`){if(s!==t)break;s=0,r=i}else a===">"&&s++;i--}return o?r:n}function Tr(e){let n=Cr(e),t=new Map,r="",i=[],a=[];for(let o of n){r=e.substring(o.startIndex,o.endIndex),i=r.split(`
`),i.splice(0,2);for(let s of i){if(a=s.split("|"),a.length!==4){pt(x("options.custom-auto-correct.custom-row-parse-warning").replace("{ROW}",s));continue}t.set(a[1].trim().toLowerCase(),a[2].trim())}}return t}function Ke(e,n,t,r){let i=e.length,a=0,o;if(n<0?n=-n>i?0:i+n:n=n>i?i:n,t=t>0?t:0,r.length<1e4)o=Array.from(r),o.unshift(n,t),e.splice(...o);else for(t&&e.splice(n,t);a<r.length;)o=r.slice(a,a+1e4),o.unshift(n,0),e.splice(...o),a+=1e4,n+=1e4}function Ge(e,n){return e.length>0?(Ke(e,e.length,0,n),e):n}var Qh=ln(/\p{P}/u),at=ln(/[A-Za-z]/),Ze=ln(/[\dA-Za-z]/),Md=ln(/[#-'*+\--9=?A-Z^-~]/);function mi(e){return e!==null&&(e<32||e===127)}var fi=ln(/\d/),Id=ln(/[\dA-Fa-f]/),kl=ln(/[!-/:-@[-`{-~]/);function B(e){return e!==null&&e<-2}function ne(e){return e!==null&&(e<0||e===32)}function H(e){return e===-2||e===-1||e===32}function Bd(e){return kl(e)||Qh(e)}var Fd=ln(/\s/);function ln(e){return n;function n(t){return t!==null&&t>-1&&e.test(String.fromCharCode(t))}}function wl(e){if(e===null||ne(e)||Fd(e))return 1;if(Bd(e))return 2}function Or(e,n,t){let r=[],i=-1;for(;++i<e.length;){let a=e[i].resolveAll;a&&!r.includes(a)&&(n=a(n,t),r.push(a))}return n}var gi={name:"attention",tokenize:Jh,resolveAll:Xh};function Xh(e,n){let t=-1,r,i,a,o,s,l,c,u;for(;++t<e.length;)if(e[t][0]==="enter"&&e[t][1].type==="attentionSequence"&&e[t][1]._close){for(r=t;r--;)if(e[r][0]==="exit"&&e[r][1].type==="attentionSequence"&&e[r][1]._open&&n.sliceSerialize(e[r][1]).charCodeAt(0)===n.sliceSerialize(e[t][1]).charCodeAt(0)){if((e[r][1]._close||e[t][1]._open)&&(e[t][1].end.offset-e[t][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[t][1].end.offset-e[t][1].start.offset)%3))continue;l=e[r][1].end.offset-e[r][1].start.offset>1&&e[t][1].end.offset-e[t][1].start.offset>1?2:1;let d=Object.assign({},e[r][1].end),m=Object.assign({},e[t][1].start);Rd(d,-l),Rd(m,l),o={type:l>1?"strongSequence":"emphasisSequence",start:d,end:Object.assign({},e[r][1].end)},s={type:l>1?"strongSequence":"emphasisSequence",start:Object.assign({},e[t][1].start),end:m},a={type:l>1?"strongText":"emphasisText",start:Object.assign({},e[r][1].end),end:Object.assign({},e[t][1].start)},i={type:l>1?"strong":"emphasis",start:Object.assign({},o.start),end:Object.assign({},s.end)},e[r][1].end=Object.assign({},o.start),e[t][1].start=Object.assign({},s.end),c=[],e[r][1].end.offset-e[r][1].start.offset&&(c=Ge(c,[["enter",e[r][1],n],["exit",e[r][1],n]])),c=Ge(c,[["enter",i,n],["enter",o,n],["exit",o,n],["enter",a,n]]),c=Ge(c,Or(n.parser.constructs.insideSpan.null,e.slice(r+1,t),n)),c=Ge(c,[["exit",a,n],["enter",s,n],["exit",s,n],["exit",i,n]]),e[t][1].end.offset-e[t][1].start.offset?(u=2,c=Ge(c,[["enter",e[t][1],n],["exit",e[t][1],n]])):u=0,Ke(e,r-1,t-r+3,c),t=r+c.length-u-2;break}}for(t=-1;++t<e.length;)e[t][1].type==="attentionSequence"&&(e[t][1].type="data");return e}function Jh(e,n){let t=this.parser.constructs.attentionMarkers.null,r=this.previous,i=wl(r),a;return o;function o(l){return a=l,e.enter("attentionSequence"),s(l)}function s(l){if(l===a)return e.consume(l),s;let c=e.exit("attentionSequence"),u=wl(l),d=!u||u===2&&i||t.includes(l),m=!i||i===2&&u||t.includes(r);return c._open=!!(a===42?d:d&&(i||!m)),c._close=!!(a===42?m:m&&(u||!d)),n(l)}}function Rd(e,n){e.column+=n,e.offset+=n,e._bufferIndex+=n}var Al={name:"autolink",tokenize:ey};function ey(e,n,t){let r=0;return i;function i(p){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(p),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),a}function a(p){return at(p)?(e.consume(p),o):c(p)}function o(p){return p===43||p===45||p===46||Ze(p)?(r=1,s(p)):c(p)}function s(p){return p===58?(e.consume(p),r=0,l):(p===43||p===45||p===46||Ze(p))&&r++<32?(e.consume(p),s):(r=0,c(p))}function l(p){return p===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(p),e.exit("autolinkMarker"),e.exit("autolink"),n):p===null||p===32||p===60||mi(p)?t(p):(e.consume(p),l)}function c(p){return p===64?(e.consume(p),u):Md(p)?(e.consume(p),c):t(p)}function u(p){return Ze(p)?d(p):t(p)}function d(p){return p===46?(e.consu
`;break}case-3:{o=`\r
`;break}case-2:{o=n?" ":" ";break}case-1:{if(!n&&i)continue;o=" ";break}default:o=String.fromCharCode(a)}i=a===-2,r.push(o)}return r.join("")}var Hl={};ou(Hl,{attentionMarkers:()=>_b,contentInitial:()=>Fb,disable:()=>Yb,document:()=>Bb,flow:()=>Db,flowInitial:()=>Rb,insideSpan:()=>Nb,string:()=>zb,text:()=>Kb});var Bb={42:Ve,43:Ve,45:Ve,48:Ve,49:Ve,50:Ve,51:Ve,52:Ve,53:Ve,54:Ve,55:Ve,56:Ve,57:Ve,62:wo},Fb={91:Ll},Rb={[-2]:hi,[-1]:hi,32:hi},Db={35:Tl,42:Rn,45:[Oo,Rn],60:Ol,61:Oo,95:Rn,96:So,126:So},zb={38:xo,92:Ao},Kb={[-5]:yi,[-4]:yi,[-3]:yi,33:Il,38:xo,42:gi,60:[Al,Ml],91:Bl,92:[El,Ao],93:Fn,95:gi,96:xl},Nb={null:[gi,Xd]},_b={null:[42,95]},Yb={null:[]};function ql(e){let t=Io([Hl,...(e||{}).extensions||[]]),r={defined:[],lazy:{},constructs:t,content:i($d),document:i(Zd),flow:i(Qd),string:i(Jd),text:i(ep)};return r;function i(a){return o;function o(s){return rp(r,a,s)}}}function Ul(e){for(;!Lo(e););return e}var ip=/[\0\t\n\r]/g;function Wl(){let e=1,n="",t=!0,r;return i;function i(a,o,s){let l=[],c,u,d,m,p;for(a=n+(typeof a=="string"?a.toString():new TextDecoder(o||void 0).decode(a)),d=0,n="",t&&(a.charCodeAt(0)===65279&&d++,t=void 0);d<a.length;){if(ip.lastIndex=d,c=ip.exec(a),m=c&&c.index!==void 0?c.index:a.length,p=a.charCodeAt(m),!c){n=a.slice(d);break}if(p===10&&d===m&&r)l.push(-3),r=void 0;else switch(r&&(l.push(-5),r=void 0),d<m&&(l.push(a.slice(d,m)),e+=m-d),p){case 0:{l.push(65533),e++;break}case 9:{for(u=Math.ceil(e/4)*4,l.push(-2);e++<u;)l.push(-1);break}case 10:{l.push(-4),e=1;break}default:r=!0,e=1}d=m+1}return s&&(r&&l.push(-5),n&&l.push(n),l.push(null)),l}}var Pb=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function ap(e){return e.replace(Pb,Hb)}function Hb(e,n,t){if(n)return n;if(t.charCodeAt(0)===35){let i=t.charCodeAt(1),a=i===120||i===88;return Bo(t.slice(a?2:1),a?16:10)}return Mr(t)||e}function Ir(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?op(e.position):"start"in e||"end"in e?op(e):"line"in e||"column"in e?Vl(e):""}function Vl(e){return sp(e&&e.line)+":"+sp(e&&e.column)}function op(e){return Vl(e&&e.start)+"-"+Vl(e&&e.end)}function sp(e){return e&&typeof e=="number"?e:1}var cp={}.hasOwnProperty;function jl(e,n,t){return typeof n!="string"&&(t=n,n=void 0),qb(t)(Ul(ql(t).document().write(Wl()(e,n,!0))))}function qb(e){let n={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:a($a),autolinkProtocol:R,autolinkEmail:R,atxHeading:a(Wa),blockQuote:a(Yt),characterEscape:R,characterReference:R,codeFenced:a(dt),codeFencedFenceInfo:o,codeFencedFenceMeta:o,codeIndented:a(dt,o),codeText:a(Ot,o),codeTextData:R,data:R,codeFlowValue:R,definition:a(Jt),definitionDestinationString:o,definitionLabelString:o,definitionTitleString:o,emphasis:a(vr),hardBreakEscape:a(Va),hardBreakTrailing:a(Va),htmlFlow:a(Jr,o),htmlFlowData:R,htmlText:a(Jr,o),htmlTextData:R,image:a(ja),label:o,link:a($a),listItem:a(Pt),listItemValue:m,listOrdered:a(Ga,d),listUnordered:a(Ga),paragraph:a(kr),reference:w,referenceString:o,resourceDestinationString:o,resourceTitleString:o,setextHeading:a(Wa),strong:a(Za),thematicBreak:a(ei)},exit:{atxHeading:l(),atxHeadingSequence:M,autolink:l(),autolinkEmail:se,autolinkProtocol:_t,blockQuote:l(),characterEscapeValue:K,characterReferenceMarkerHexadecimal:He,characterReferenceMarkerNumeric:He,characterReferenceValue:Nt,codeFenced:l(h),codeFencedFence:b,codeFencedFenceInfo:p,codeFencedFenceMeta:f,codeFlowValue:K,codeIndented:l(k),codeText:l(W),codeTextData:K,data:K,definition:l(),definitionDestinationString:T,definitionLabelString:A,definitionTitleString:L,emphasis:l(),hardBreakEscape:l($),hardBreakTrailing:l($),htmlFlow:l(D),htmlFlowData:K,htmlText:l(U),htmlTextData:K,image:l(ee),label:Ie,labelText:Ye,lineEnding:V,link:l(Q),listItem:l(),listOrdered:l(),listUnordered:l(),paragraph:l(),referenceString:we,resourceDestinationString:v,resourceTitleString:Pe,resource:je,setextHeading:l(N),setextHeadingLineSequence:O,setextHeadingText:E,strong:l(),thematicBreak:l()}};up(n,(e||{}).mdastExtensions||[]);let t={};return r;function
`&&(e=e.substring(0,o.end.offset)+e.substring(o.end.offset+1)),o.end.offset<e.length&&e[o.end.offset]===`
`&&(e=e.substring(0,o.end.offset)+e.substring(o.end.offset+1)),e=e.substring(0,o.start.offset)+e.substring(o.end.offset),a(e,s,o.start.offset)}for(let o of r){let s=o[1],l=s.referencePositions.length-s.footnotesReferencingKey.length;l=l>=0?l:0;let c=0;for(let u of s.footnotesReferencingKey){if(c+l>=s.referencePositions.length)throw new Error(x("logs.missing-footnote-error-message").replace("{FOOTNOTE}",u));i.set(u,s.referencePositions[l+c++])}}t=t.sort((o,s)=>i.get(o)-i.get(s)),t.length>0&&(e=e.trimEnd()+`
`);for(let o of t)e+=`
`+o;return e}function bp(e){let n=ge("footnoteDefinition",e),t=[],r=new Map,i=new Map,a=[],o=new Set,s=[],l=function(d,m,p){let f=m.match(/\[\^.*?\]/)[0];r.set(m,f);let b=o.has(f);if(b&&t.includes(m)){s.unshift(m);return}else if(b)throw new Error(x("logs.too-many-footnotes-error-message").replace("{FOOTNOTE_KEY}",f));let h;do h=d.lastIndexOf(f,p),h!==-1&&((h+m.length>d.length||d.substring(h,h+m.length)!==m)&&a.push({key:f,position:h}),p=h-1);while(h>0);o.add(f)};for(let d of n){let m=e.substring(d.start.offset,d.end.offset);t.unshift(m),l(e,m,d.start.offset)}let c=1,u=new Set;for(let d of t){if(u.has(d))continue;u.add(d);let m=r.get(d),p=`[^${c++}]`;i.set(m,p)}a.sort((d,m)=>m.position-d.position);for(let d of a){let m=i.get(d.key);e=Cd(e,d.key,m,d.position)}for(let d of u){let m=r.get(d),p=i.get(m);e=e.replace(d,d.replace(m,p))}for(let d of s){let m=e.replace(`
${d}
`,`
`);e===m&&(m=e.replace(d,"")),e=m}return e}function Do(e,n,t){let r=ge(t,e);if(r.length===0)return e;let i="";if(n==="underscore")i="_";else if(n==="asterisk")i="*";else{let a=r[r.length-1];i=e.substring(a.start.offset,a.start.offset+1)}t==="strong"&&(i+=i);for(let a of r){let o=i+e.substring(a.start.offset+i.length,a.end.offset-i.length)+i;e=le(e,a.start.offset,a.end.offset,o)}return e}function vp(e,n){let t=ge("paragraph",e);if(t.length===0)return e;for(let r of t){let i=e.substring(r.start.offset,r.end.offset).split(`
`),a=i.length-1;if(!(a<1)){for(let o=0;o<a;o++){let s=i[o];rv(s,n)||(i[o]=iv(s,n))}e=le(e,r.start.offset,r.end.offset,i.join(`
`))}}return e}function rv(e,n){return!!(e.endsWith("<br>")&&n=="<br>"||e.endsWith("<br/>")&&n=="<br/>"||e.endsWith(" ")&&n==" "||!e.endsWith("\\\\")&&e.endsWith("\\")&&n=="\\")}function iv(e,n){e=e.trimEnd();let t=0;return e.endsWith("<br>")&&(t=4),e.endsWith("<br/>")&&(t=5),!e.endsWith("\\\\")&&e.endsWith("\\")&&(t=1),t&&(e=e.substring(0,e.length-t)),e.trimEnd()+n}function kp(e){let n=e.endsWith(`
`),t=ge("paragraph",e);if(t.length===0)return e;for(let r of t){let i=r.start.offset;for(i>0&&i--;i>=0&&e.charAt(i)!=`
`;)i--;i++;let a=e.substring(i,r.end.offset).split(`
`),o=a[0].trimStart();if(o.startsWith(">")||o.match(Ko)||o.match(No))continue;let s=a.length,l=[],c=!1;for(let f=0;f<s;f++){let b=a[f];if(c){let h=l.length-1;l[h]+=`
`+b}else l.push(b);c=b.endsWith("<br>")||b.endsWith("<br/>")||b.endsWith(" ")||!b.endsWith("\\\\")&&b.endsWith("\\")}for(;i>0&&e.charAt(i-1)==`
`;)i--;let u=e.length,d=r.end.offset;for(d<u&&d++;d<u&&e.charAt(d)==`
`;)d++;let m=`
`;i==0&&(m="");let p=`
`;d==u&&(p=""),e=le(e,i,d,m+l.join(`
`)+p)}return n&&!e.endsWith(`
`)&&(e+=`
`),e}function wp(e){let n=ge("link",e);for(let t of n){if(t==null)continue;let r=e.substring(t.start.offset,t.end.offset);if(!r.match(Ti))continue;let i=r.indexOf("]"),a=r.substring(0,1)+r.substring(1,i).trim()+r.substring(i);e=le(e,t.start.offset,t.end.offset,a)}return e}function Ap(e,n){let t=ge("emphasis",e);for(let r of t){let i=e.substring(r.start.offset+1,r.end.offset-1);i=n(i),e=le(e,r.start.offset+1,r.end.offset-1,i)}return e}function xp(e,n){let t=ge("strong",e);for(let r of t){let i=e.substring(r.start.offset+2,r.end.offset-2);i=n(i),e=le(e,r.start.offset+2,r.end.offset-2,i)}return e}function zo(e,n){let t=nv(e);for(let r of t){let i=r.start.offset;for(;i>0&&e.charAt(i-1).trim()==="";)i--;(i===0||e.charAt(i-1).trim()!="")&&i++;let a=e.substring(i,r.end.offset);Np.test(a)&&(i+=4,a=a.substring(4)),a=n(a),e=le(e,i,r.end.offset,a)}return e}function Sp(e){let n=ge("code",e);for(let t of n){let r=e.substring(t.start.offset,t.end.offset);!r.startsWith("```")&&!r.startsWith("~~~")||(e=on(e,t.start.offset,t.end.offset))}return e}function Lp(e,n){let t=ge("math",e);for(let r of t)e=on(e,r.start.offset,r.end.offset);t=ge("inlineMath",e);for(let r of t)e.substring(r.start.offset,r.end.offset).startsWith("$".repeat(n))&&(e=on(e,r.start.offset,r.end.offset));return e}function Ep(e){let n=ge("blockquote",e);for(let t of n){let r=t.end.offset;for(;r<e.length-1&&e.charAt(r)!==`
`;)r++;e=on(e,t.start.offset,r,!0)}return e}function Tp(e){let n=ge("thematicBreak",e);for(let t of n)e=on(e,t.start.offset,t.end.offset);return e}function Cp(e,n,t,r){let i=ge("list",e);if(!i)return e;for(let a of i){let o=a.start.offset;for(;o>0&&e.charAt(o-1)!==`
`;)o--;let s=e.substring(o,a.end.offset),l=function(m){let p=m.lastIndexOf("> ");return p!==-1&&(m=m.substring(p+2)),m=m.replaceAll(" "," "),Math.floor((m.split(" ").length-1)/2)+1},c=new Map,u=function(m,p){let f=p;for(;f>m;)c.delete(f--)},d=-1;s=s.replace(/^(( |\t|> )*)((\d+(\.|\)))|[-*+])([^\n]*)$/gm,(m,p="",f,b,h,k,A)=>{let L=n==="preserve"||r?Number(h):1,T=l(p);if(!/^\d/.test(b)){let M=T>d?T:d;return u(T,M),m}return c.has(T)?n==="ascending"?(L=c.get(T)+1,c.set(T,L)):r&&(L=c.get(T)):c.set(T,L),d>T&&u(T,d),d=T,`${p}${L}${t}${A}`}),e=le(e,o,a.end.offset,s)}return e}function Op(e,n){let t=ge("listItem",e);if(!t)return e;let r=/^((\d+[.)])|(- \[[ x]\]))/m,i=n;if(n=="consistent"){let a=t.length-1;for(;a>=0;){let o=e.substring(t[a].start.offset,t[a].end.offset);if(a--,!o.match(r)){i=o.charAt(0);break}}if(a==-1)return e}for(let a of t){let o=e.substring(a.start.offset,a.end.offset);o.match(r)||(o=i+o.substring(1),e=le(e,a.start.offset,a.end.offset,o))}return e}function ic(e,n){let t=ge("blockquote",e);for(let r of t){let i=r.end.offset;for(;i<e.length-1&&e.charAt(i)!==`
`;)i++;let a=e.substring(r.start.offset,i);a=n(a),e=le(e,r.start.offset,i,a)}return e}function Mp(e,n){let t=ge("math",e),r=new RegExp("^(\\${"+n+",})(\\n*)"),i=new RegExp("(\\n*)(\\${"+n+",})([^\\$]*)$");for(let a of t){let o=e.substring(a.start.offset,a.end.offset),s=av(o,n,a.start.offset);for(let l of s)e=fp(e,l.startIndex,l.endIndex,r,i)}t=ge("inlineMath",e);for(let a of t)e.substring(a.start.offset,a.end.offset).startsWith("$".repeat(n))&&(e=fp(e,a.start.offset,a.end.offset,r,i));return e}function av(e,n,t){let r="$".repeat(n),i=n;for(;e.charAt(i)==="$";)r+="$",i++;let a=[],o=sn(e,r);if(o<=1)return[];if(o===2)return a.unshift({startIndex:t,endIndex:t+e.length}),a;o===3&&a.unshift({startIndex:t,endIndex:t+e.indexOf(r,r.length)+r.length}),o%2===1&&o--;let s=t,l=r.length;for(;o>2;){let c=e.indexOf(r,l)+r.length;a.unshift({startIndex:s,endIndex:t+c}),s=t+c+1,l=c+1,o-=2}return a.unshift({startIndex:t+e.indexOf(r,l),endIndex:t+e.length}),a}function fp(e,n,t,r,i){let a=e.substring(pi(e,n),n)??"",[o]=Er(a,a.length),s=e.substring(pi(e,t),t)??"",l=e.substring(n,t),c=Fp.test(a.trim()),u=!1;for(l=l.replace(r,(d,m,p="")=>{let f="";return!c&&a.trim()!=""?(f+=`
`,u=!0):c&&!nc.test(a)&&(f+=`
`+o,u=!0),f+=m+`
`,p===""&&c&&(f+=o),f}),l=l.replace(i,(d,m="",p,f)=>{let b=m==="";return b&&c&&nc.test(s.trim())?d:b&&c?`
`+o+p+f:`
`+p+f});u&&n>0;){let d=e[n-1];if(d!==" "&&d!==" ")break;n--}return le(e,n,t,l)}function Cr(e){let n=[...e.matchAll(Rp)],t=[];for(let r of n){let i=pi(e,r.index);if(i===0)continue;let a=pi(e,i-1),o=r[0],s=e.substring(i,r.index+o.length);if(ov(s,o))continue;let l=a,c=e.substring(a,i-1);if(!o.includes("|")&&!c.includes("|"))continue;c=c.replace(rc,f=>{let b=f.trim();return b===""||b==="|"||(l+=f.length-1),""});let u=o.replace(rc,"");if(c.endsWith("|")&&(c=c.slice(0,-1)),u.endsWith("|")&&(u=u.slice(0,-1)),gp(c)!==gp(u))continue;let d=r.index+r[0].length;if(d>=e.length-1){t.push({startIndex:l,endIndex:e.length});continue}let m=e.substring(d+1).split(`
`),p=0;for(;p<m.length&&Dp.test(m[p]);)d+=m[p].length+1,p++;t.push({startIndex:l,endIndex:d})}return t.reverse()}function ov(e,n){if(e.trim()===""||n.includes("||"))return!0;let t=e.replace(n,"");return/[^\s>]/.test(t)}function gp(e){let n=!1,t=0,r=0,i="";for(let a=0;a<e.length;a++)i=e[a],i==="\\"?(t++,n=t%2==1):(t=0,i==="|"&&!n&&r++,n=!1);return r}function Ip(e){let n=0,t=[],r=[...e.matchAll(zp)];if(!r||r.length===0)return t;let i=[...e.matchAll(Kp)];return r.forEach(a=>{n=a.index;let o=!1,s=e.length-1;for(;i&&i.length!==0&&!o;)if(i[0].index<=n)i.shift();else{o=!0;let l=i[0];s=l.index+l[0].length}t.push({startIndex:n,endIndex:s}),!i||i.length}),t.reverse()}function Bp(e,n){let t=ge("code",e);for(let r of t){let i=e.substring(r.start.offset,r.end.offset);!i.startsWith("```")||i.substring(3,i.indexOf(`
`)).trim()!==""||(e=le(e,r.start.offset+3,r.start.offset+3,n))}return e}var pn=/^([ \t]*)(#+)([ \t]+)([^\n\r]*?)([ \t]+#+)?$/gm,_p=`^XXX\\.*?
(?:((?:.|
)*?)
)?XXX(?=\\s|$)$`,Qe=/^---\n((?:(((?!---)(?:.|\n)*?)\n)?))---(?=\n|$)/,sv=_p.replaceAll("X","`"),lv=_p.replaceAll("X","~"),cv=`^(( |( {4})).*
)+`,$T=new RegExp(`${sv}|${lv}|${cv}`,"gm"),_o=/(!?)\[{2}([^\][\n|]+)(\|([^\][\n|]+))?(\|([^\][\n|]+))?\]{2}/g,Ti=/(!?)\[([^[]*)\](\(.*\))/g,Ci=/(\s|^)(#[\p{L}\-_\d/\p{Emoji_Presentation}]+)/gu,Yp=/^%%\n[^%]*\n%%/gm,Oi=/[,\s]+/,Yo=/(\. ?){2}\./g,Mi="\\s*(>\\s*)*",nc=/^(>( |\t)*)+\$*?$/m,Fp=/^\s*(>\s*)+/m,Rp=/(\|? *:?-{1,}:? *\|?)(\| *:?-{1,}:? *\|?)*( |\t)*$/gm,rc=/^(((>[ ]?)*)|([ ]{0,3}))\|/m,Dp=/[^\n]*?\|[^\n]*?(\n|$)/m,Pp=/(([a-z\-0-9]+:)\/{2,3})([^\s/?#]*[^\s")'.?!/]|[/])?(([/?#][^\s")']*[^\s")'.?!])|[/])?/gi,zn=/(?:(?:(?:[a-z]+:)?\/\/)|www\.)(?:localhost|(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)){3}|(?:(?:[a-fA-F\d]{1,4}:){7}(?:[a-fA-F\d]{1,4}|:)|(?:[a-fA-F\d]{1,4}:){6}(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)){3}|:[a-fA-F\d]{1,4}|:)|(?:[a-fA-F\d]{1,4}:){5}(?::(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)){3}|(?::[a-fA-F\d]{1,4}){1,2}|:)|(?:[a-fA-F\d]{1,4}:){4}(?:(?::[a-fA-F\d]{1,4}){0,1}:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)){3}|(?::[a-fA-F\d]{1,4}){1,3}|:)|(?:[a-fA-F\d]{1,4}:){3}(?:(?::[a-fA-F\d]{1,4}){0,2}:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)){3}|(?::[a-fA-F\d]{1,4}){1,4}|:)|(?:[a-fA-F\d]{1,4}:){2}(?:(?::[a-fA-F\d]{1,4}){0,3}:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)){3}|(?::[a-fA-F\d]{1,4}){1,5}|:)|(?:[a-fA-F\d]{1,4}:){1}(?:(?::[a-fA-F\d]{1,4}){0,4}:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)){3}|(?::[a-fA-F\d]{1,4}){1,6}|:)|(?::(?:(?::[a-fA-F\d]{1,4}){0,5}:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)){3}|(?::[a-fA-F\d]{1,4}){1,7}|:)))(?:%[0-9a-zA-Z]{1,})?|(?:(?:[a-z0-9][-_]*)*[a-z0-9]+)(?:\.(?:[a-z0-9]-*)*[a-z0-9]+)*(?:\.(?:[a-z]{2,})))(?::\d{2,5})?(?:(?:[/?#][a-z0-9-_%/&=?$.+~!*(,#@]*[a-z0-9-%_/$+~!*(,])|[/])?/gi,GT=new RegExp("^"+zn.source+"$","si"),Hp=/<a[\s]+([^>]+)>((?:.(?!<\/a>))*.)<\/a>/g,qp=/[\p{L}\p{N}\p{Pc}\p{M}\-'`]+/gu,Up=/&[^\s]+;$/mi,zp=Xp(!0),Kp=Xp(!1),Wp=/[“”„«»]/g,Vp=/[]/g,jp=/<%[^]*?%>/g,Kn="\\[.\\]",Np=new RegExp(`^${Kn}`),$p=new RegExp(`^${Mi}- ${Kn} `),Po=new RegExp(`^\\s*- ${Kn} `),Ko=new RegExp(`^\\s*(-|\\*|\\+|\\d+[.)]|- (${Kn}))`,"m"),No=/^(\[\^[^\]]*\]) ?([,.;!:?])/gm,ko=/^(>\s*)+\[![^\s]*\]/m,di=/^\n?(>\s*)+((```)|(~~~))/m,ac=RegExp(/\p{L}/,"u");function Xe(e){return e.replace(/\$/g,"$$$$")}function mn(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Gp(e){let n=e.match(_o);if(n){for(let t of n)if(t.includes("|")){let r=t.indexOf("|"),i=t.substring(0,r+1)+t.substring(r+1,t.length-2).trim()+"]]";e=e.replace(t,i)}}return e}function Zp(e){let n=Cr(e);if(n.length===0)return e;for(let t of n)e=on(e,t.startIndex,t.endIndex);return e}function Ho(e){let n=e.match(/^#\s+(.*)/m);if(n&&n[1]){let t=n[1];return t=t.replaceAll(_o,(r,i,a,o)=>o!=null?o.replace("|",""):a),t.replaceAll(Ti,"$2")}return""}function Qp(e){return[...e.matchAll(Ci)].map(n=>n[2])}function Xp(e){let n="(?:<!-{2,}|%%) *linter-{ENDING_TEXT} *(?:-{2,}>|%%)",t="";return e?t+="disable":t+="enable",new RegExp(n.replace("{ENDING_TEXT}",t),"g")}var oc="tag",Ii="tags",kt=[oc,Ii],uv="alias",sc="aliases",wt=[uv,sc],lc="linter-yaml-title-alias",Br="disabled rules";function Bt(e){return e.match(Qe)===null&&(e=`---
---
`+e),e}function Fr(e){let n=e.match(Qe);return n?n[1]:null}function he(e,n){if(!e.match(Qe))return e;let t=e.match(Qe)[0],r=n(t);return e=e.replace(t,Xe(r)),e}function cc(e,n=!0){return n?new RegExp(`^([\\t ]*)${e}:[ \\t]*(\\S.*|(?:(?:\\n *- \\S.*)|((?:\\n *- *))*|(\\n([ \\t]+[^\\n]*))*)*)\\n`,"m"):new RegExp(`^${e}:[ \\t]*(\\S.*|(?:(?:\\n *- \\S.*)|((?:\\n *- *))*|(\\n([ \\t]+[^\\n]*))*)*)\\n`,"m")}function ae(e,n,t){let r=`${n}:${t}
`,i=!1,a=e.replace(cc(n),(o,s)=>(i=!0,s+r));return i||(a=`${e}${r}`),a}function ue(e,n,t=!0){let r=e.match(cc(n,t));if(r==null)return null;let i=r[2];return t||(i=r[1]),i}function Nn(e,n,t=!0){return e.replace(cc(n,t),"")}function st(e){if(e==null)return null;let n=ul(e.replace(/\n(\t)+/g,`
`));return n??{}}function be(e,n,t,r,i=!1){if(typeof e=="string"&&(e=[e]),e==null||e.length===0)return dv(n);let a=r&&(n=="multi-line"||n=="single string to multi-line"&&e.length>1);if(i||a)for(let o=0;o<e.length;o++){let s=e[o],l=Rr(s);l&&(s=s.substring(1,s.length-1));let c=i&&vo(s);l&&c||(c||l&&a)&&(e[o]=At(s,t,c))}switch(n){case"single string to single-line":if(e.length===1)return" "+e[0];case"single-line":return" "+Jp(e);case"single string to multi-line":if(e.length===1)return" "+e[0];case"multi-line":return pv(e);case"single string space delimited":return e.length===1?" "+e[0]:" "+e.join(" ");case"single string comma delimited":return e.length===1?" "+e[0]:" "+e.join(", ");case"single-line space delimited":return e.length===1?" "+e[0]:" "+Jp(e).replaceAll(", "," ")}}function dv(e){switch(e){case"single-line":case"single-line space delimited":case"multi-line":return" []";case"single string to single-line":case"single string to multi-line":case"single string space delimited":case"single string comma delimited":return" "}}function Jp(e){return e==null||e.length===0?"[]":"["+e.join(", ")+"]"}function pv(e){return e==null||e.length===0?"[]":`
- `+e.join(`
- `)}function Fe(e){if(e==null||e.length===0)return null;if(e=e.trimEnd(),e.startsWith("["))return e=e.substring(1),e.endsWith("]")&&(e=e.substring(0,e.length-1)),e.length===0?null:qo(e,",").filter(t=>t!="");if(e.includes(`
`)){let n=e.split(/[ \t]*\n[ \t]*-[ \t]*/);return n.splice(0,1),n=n.filter(t=>t!=""),n==null||n.length===0?null:n}return e}function fn(e){if(e==null)return[];let n=[],t=[];Array.isArray(e)?t=e:e.includes(",")?t=qo(e,","):t=qo(e," ");for(let r of t)n.push(r.trim());return n}function gn(e){return typeof e=="string"?qo(e,","):e}function qo(e,n=","){if(e==""||e==null)return null;if(n.length>1)throw new Error(x("logs.invalid-delimiter-error-message"));let t=[],r="",i=0;for(;i<e.length;){let a=e.charAt(i);if(a===n)t.push(r.trim()),r="";else if(a==='"'||a==="'"){let o=e.indexOf(a,i+1);o!=-1?(r+=e.substring(i,o+1),i=o):r+=a}else r+=a;i++}return r.trim()!=""&&t.push(r.trim()),t}function Rr(e){return e.length>1&&(e.startsWith("'")&&e.endsWith("'")||e.startsWith('"')&&e.endsWith('"'))}function At(e,n,t=!1,r=!1){let i=mv(e,n,t);if(r)return i;try{if(ul(i)===e)return i}catch{}let a=dl(e,{lineWidth:-1,quotingType:n,forceQuotes:t}).slice(0,-1),o=dl(e,{lineWidth:-1,quotingType:n=='"'?"'":'"',forceQuotes:t}).slice(0,-1);return o===e||o.length<a.length?o:a}function mv(e,n,t=!1){if(Rr(e))return e;let r=e.includes("'"),i=e.includes('"'),a=e.includes(": ");return!r&&!i&&!a&&!t||r&&i?e:r?`"${e}"`:i?`'${e}'`:`${n}${e}${n}`}function em(e){let n=ue(e,Br);if(n==null)return[];let t=n.includes(`
`)?`${Br}:
`:`${Br}: `;t+=n;let i=st(t)["disabled rules"];return i?(typeof i=="string"&&(i=[i]),i):[]}var Pr=require("obsidian");function Ee(e){e.addClass("linter-visually-hidden")}function Ne(e){e.removeClass("linter-visually-hidden")}function rt(e,n){if(e.includes("</")){let t=document.createRange();n.append(t.createContextualFragment(e))}else n.setText(e)}var Yr=require("obsidian");var tm=require("obsidian");var Uo=class{constructor(n,t,r,i,a,o,s,l,c,u){this.containerEl=n;this.name=t;this.description=r;this.warning=i;this.addInputTooltip=a;this.refreshBtnTooltip=o;this.app=s;this.saveSettings=l;this.onAddInput=c;this.onRefresh=u}display(){this.containerEl.createDiv({cls:"setting-item-name",text:this.name});let n=this.containerEl.createDiv({cls:"setting-item-description"});rt(this.description,n.createEl("p",{cls:"custom-row-description"})),new tm.Setting(this.containerEl).addButton(t=>{t.setIcon("plus-with-circle").setTooltip(this.addInputTooltip).onClick(()=>this.onAddInput()),t.buttonEl.addClass("clickable-icon")}).addButton(t=>{t.setIcon("reset").setTooltip(this.refreshBtnTooltip).onClick(()=>this.onRefresh()),t.buttonEl.addClass("clickable-icon")}).setClass("linter-border-bottom").setDesc(this.warning??"").descEl.addClass("mod-warning"),this.inputElDiv=this.containerEl.createDiv(),this.showInputEls()}resetInputEls(){this.inputElDiv.empty(),this.showInputEls()}};var xm=require("obsidian");var ye="top",Te="bottom",Se="right",ve="left",Wo="auto",hn=[ye,Te,Se,ve],Wt="start",_n="end",nm="clippingParents",Vo="viewport",Dr="popper",rm="reference",uc=hn.reduce(function(e,n){return e.concat([n+"-"+Wt,n+"-"+_n])},[]),jo=[].concat(hn,[Wo]).reduce(function(e,n){return e.concat([n,n+"-"+Wt,n+"-"+_n])},[]),fv="beforeRead",gv="read",hv="afterRead",yv="beforeMain",bv="main",vv="afterMain",kv="beforeWrite",wv="write",Av="afterWrite",im=[fv,gv,hv,yv,bv,vv,kv,wv,Av];function Re(e){return e?(e.nodeName||"").toLowerCase():null}function de(e){if(e==null)return window;if(e.toString()!=="[object Window]"){var n=e.ownerDocument;return n&&n.defaultView||window}return e}function ft(e){var n=de(e).Element;return e instanceof n||e instanceof Element}function Ce(e){var n=de(e).HTMLElement;return e instanceof n||e instanceof HTMLElement}function zr(e){if(typeof ShadowRoot>"u")return!1;var n=de(e).ShadowRoot;return e instanceof n||e instanceof ShadowRoot}function xv(e){var n=e.state;Object.keys(n.elements).forEach(function(t){var r=n.styles[t]||{},i=n.attributes[t]||{},a=n.elements[t];!Ce(a)||!Re(a)||(Object.assign(a.style,r),Object.keys(i).forEach(function(o){var s=i[o];s===!1?a.removeAttribute(o):a.setAttribute(o,s===!0?"":s)}))})}function Sv(e){var n=e.state,t={popper:{position:n.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(n.elements.popper.style,t.popper),n.styles=t,n.elements.arrow&&Object.assign(n.elements.arrow.style,t.arrow),function(){Object.keys(n.elements).forEach(function(r){var i=n.elements[r],a=n.attributes[r]||{},o=Object.keys(n.styles.hasOwnProperty(r)?n.styles[r]:t[r]),s=o.reduce(function(l,c){return l[c]="",l},{});!Ce(i)||!Re(i)||(Object.assign(i.style,s),Object.keys(a).forEach(function(l){i.removeAttribute(l)}))})}}var am={name:"applyStyles",enabled:!0,phase:"write",fn:xv,effect:Sv,requires:["computeStyles"]};function De(e){return e.split("-")[0]}var xt=Math.max,Yn=Math.min,Vt=Math.round;function Kr(){var e=navigator.userAgentData;return e!=null&&e.brands&&Array.isArray(e.brands)?e.brands.map(function(n){return n.brand+"/"+n.version}).join(" "):navigator.userAgent}function Bi(){return!/^((?!chrome|android).)*safari/i.test(Kr())}function gt(e,n,t){n===void 0&&(n=!1),t===void 0&&(t=!1);var r=e.getBoundingClientRect(),i=1,a=1;n&&Ce(e)&&(i=e.offsetWidth>0&&Vt(r.width)/e.offsetWidth||1,a=e.offsetHeight>0&&Vt(r.height)/e.offsetHeight||1);var o=ft(e)?de(e):window,s=o.visualViewport,l=!Bi()&&t,c=(r.left+(l&&s?s.offsetLeft:0))/i,u=(r.top+(l&&s?s.offsetTop:0))/a,d=r.width/i,m=r.height/a;return{width:d,height:m,top:u,right:c+d,bottom:u+m,left:c,x:c,y:u}}function Pn(e){var n=gt(e),t=e.
---`)},wikiLink:{replaceAction:_o,placeholder:"{WIKI_LINK_PLACEHOLDER}"},obsidianMultiLineComments:{replaceAction:Yp,placeholder:"{OBSIDIAN_COMMENT_PLACEHOLDER}"},footnoteAtStartOfLine:{replaceAction:No,placeholder:"{FOOTNOTE_AT_START_OF_LINE_PLACEHOLDER}"},footnoteAfterATask:{replaceAction:/- \[.] (\[\^\w+\]) ?([,.;!:?])/gm,placeholder:"{FOOTNOTE_AFTER_A_TASK_PLACEHOLDER}"},url:{replaceAction:zn,placeholder:"{URL_PLACEHOLDER}"},anchorTag:{replaceAction:Hp,placeholder:"{ANCHOR_PLACEHOLDER}"},templaterCommand:{replaceAction:jp,placeholder:"{TEMPLATER_PLACEHOLDER}"},link:{replaceAction:Zv,placeholder:"{REGULAR_LINK_PLACEHOLDER}"},tag:{replaceAction:Qv,placeholder:"#tag-placeholder"},table:{replaceAction:Xv,placeholder:"{TABLE_PLACEHOLDER}"},customIgnore:{replaceAction:Jv,placeholder:"{CUSTOM_IGNORE_PLACEHOLDER}"}};function Oe(e,n,t){let r=[];for(let i of e){let a;if(typeof i.replaceAction=="string")a=$v(n,i.placeholder,i.replaceAction);else if(i.replaceAction instanceof RegExp)a=Gv(n,i.placeholder,i.replaceAction);else if(typeof i.replaceAction=="function"){let o=i.replaceAction;a=o(n,i.placeholder)}n=a.newText,r.push({replacedValues:a.replacedValues,placeholder:i.placeholder})}return n=t(n),r=r.reverse(),r!=null&&r.length>0&&r.forEach(i=>{i.replacedValues.forEach(a=>{n=n.replace(new RegExp(i.placeholder,"i"),Xe(a))})}),n}function $v(e,n,t){let r=ge(t,e),i=[];for(let a of r){let o=e.substring(a.start.offset,a.end.offset);i.push(o),e=le(e,a.start.offset,a.end.offset,n)}return i.reverse(),{newText:e,replacedValues:i}}function Gv(e,n,t){let r=e.match(t),i=[];if(t.flags.includes("g")){if(e=e.replaceAll(t,n),r)for(let a of r)i.push(a)}else e=e.replace(t,n),r&&i.push(r[0]);return{newText:e,replacedValues:i}}function Zv(e,n){let t=ge("link",e),r=[];for(let i of t){if(i==null)continue;let a=e.substring(i.start.offset,i.end.offset);a.match(Ti)&&(r.push(a),e=le(e,i.start.offset,i.end.offset,n))}return r.reverse(),{newText:e,replacedValues:r}}function Qv(e,n){let t=[];return e=e.replace(Ci,(r,i,a)=>(t.push(a),i+n)),{newText:e,replacedValues:t}}function Xv(e,n){let t=Cr(e),r=new Array(t.length),i=0,a=r.length;for(let o of t)r[a-1-i++]=e.substring(o.startIndex,o.endIndex),e=le(e,o.startIndex,o.endIndex,n);return{newText:e,replacedValues:r}}function Jv(e,n){let t=Ip(e),r=new Array(t.length),i=0,a=r.length;for(let o of t)r[a-1-i++]=e.substring(o.startIndex,o.endIndex),e=le(e,o.startIndex,o.endIndex,n);return{newText:e,replacedValues:r}}var z=(o=>(o.YAML="YAML",o.HEADING="Heading",o.FOOTNOTE="Footnote",o.CONTENT="Content",o.SPACING="Spacing",o.PASTE="Paste",o))(z||{}),is=class{constructor(n,t,r,i,a,o,s=[],l=!1,c=[],u=null){this.nameKey=n;this.descriptionKey=t;this.settingsKey=r;this.alias=i;this.type=a;this.applyAfterIgnore=o;this.options=s;this.hasSpecialExecutionOrder=l;this.ignoreTypes=c;this.ruleHeading=this.getName().toLowerCase().replaceAll(" ","-"),s.unshift(new kn("enabled",this.descriptionKey,"",!1,i,(d,m)=>{if(d&&u&&u(d,m),s.length>1)for(let p=1;p<s.length;p++)d?s[p].unhide():s[p].hide()}));for(let d of s)d.ruleAlias=i}getDefaultOptions(){let n={};for(let t of this.options)n[t.configKey]=t.defaultValue;return n}getOptions(n){return n.ruleConfigs[this.settingsKey]}getName(){return x(this.nameKey)}getDescription(){return x(this.descriptionKey)}getURL(){return"https://platers.github.io/obsidian-linter/settings/"+this.type.toLowerCase()+"-rules/#"+this.ruleHeading}enabledOptionName(){return this.options[0].configKey}apply(n,t){return Oe(this.ignoreTypes,n,r=>this.applyAfterIgnore(r,t))}};var Tm=Object.values(z);function as(e){let n=Fr(e);if(n===null)return[[],!1];let t=em(n);return t.includes("all")?[Ft.map(r=>r.alias),!0]:[t,!1]}var Ft=[],lt={},jn=new Map;function Cm(e){Ft.push(e),lt[e.alias]=e,jn.has(e.type)?jn.get(e.type).push(e):jn.set(e.type,[e])}function Om(){Ft.sort((e,n)=>Tm.indexOf(e.type)-Tm.indexOf(n.type)||e.settingsKey.localeCompare(n.settingsKey))}function os(e,n){let t;throw e instanceof $u?(t=e.toString(),t=x("logs.wrapper-yaml-error").replace("{ERROR_MESSAGE}",t.substring(t.indexOf(":")+1))):t=x("logs.wrapper-unkno
[ ]{`+Math.min.apply(Math,i)+"}","g");r=r.map(function(s){return s.replace(a,`
`)})}r[0]=r[0].replace(/^\r?\n/,"");var o=r[0];return n.forEach(function(s,l){var c=o.match(/(?:^|\n)( *)$/),u=c?c[1]:"",d=s;typeof s=="string"&&s.includes(`
`)&&(d=String(s).split(`
`).map(function(m,p){return p===0?m:""+u+m}).join(`
`)),o+=d+r[l+1]}),o}var Im=ek;var js=require("obsidian");var Ur,Yi,wn,et=class et{static getRule(){if(!_(et,Ur).has(this.name)){let n=new this,t=new is(n.nameKey,n.descriptionKey,n.settingsKey,n.alias,n.type,n.safeApply.bind(n),n.optionBuilders.map(r=>r.option),n.hasSpecialExecutionOrder,n.ignoreTypes,n.disableConflictingOptions);_(et,Ur).set(this.name,t),_(et,Yi).set(n.alias,n)}return _(et,Ur).get(this.name)}static applyIfEnabledBase(n,t,r,i){let a=n.getOptions(r);if(a[n.enabledOptionName()]){Mn(n.alias);let o=Object.assign({},a,i);nt(`${x("logs.run-rule-text")} ${n.getName()}`);try{let s=n.apply(t,o);return rn(n.alias),nt(s),[s,!0]}catch(s){rn(n.alias),os(s,n.getName())}}else return[t,!1]}static getBuilderByName(n){return _(et,Yi).get(n)}static setNoSettingControl(n,t){_(et,wn).has(n)||_(et,wn).set(n,[]),_(et,wn).get(n).push(t)}static hasSettingControl(n,t){return!_(et,wn).has(n)||!_(et,wn).get(n).includes(t)}};Ur=new WeakMap,Yi=new WeakMap,wn=new WeakMap,Ae(et,Ur,new Map),Ae(et,Yi,new Map),Ae(et,wn,new Map);var An=et,y=class extends An{constructor(n){super(),this.alias=n.nameKey.substring(6,n.nameKey.length-5),this.settingsKey=this.alias,this.nameKey=n.nameKey,this.descriptionKey=n.descriptionKey,this.type=n.type,this.hasSpecialExecutionOrder=n.hasSpecialExecutionOrder??!1,this.disableConflictingOptions=n.disableConflictingOptions??null,n.ruleIgnoreTypes?this.ignoreTypes=[g.customIgnore,...n.ruleIgnoreTypes]:this.ignoreTypes=[g.customIgnore]}static register(n){let t=n.getRule();Cm(t)}safeApply(n,t){return this.apply(n,this.buildRuleOptions(t))}buildRuleOptions(n){n=n??{};let t=new this.OptionsClass,r=Object.assign(t,n);for(let i of this.optionBuilders)i.setRuleOption(r,n);return r}static applyIfEnabled(n,t,r,i){let a=this.getRule();return r.includes(a.alias)?(nt(a.alias+" "+x("logs.disabled-text")),[n,!1]):An.applyIfEnabledBase(a,n,t,i)}static getRuleOptions(n){let t=An.getRule.bind(this)(),r=new this,i=t.getOptions(n);return r.buildRuleOptions(i)}static noSettingControl(){return(n,t)=>{let r=n.constructor.name;An.setNoSettingControl(r,t)}}};var Wr,$t=class{constructor(n){Ae(this,Wr,void 0);this.OptionsClass=n.OptionsClass;let t=n.nameKey.split(".");t.length==1?this.configKey=t[0]:this.configKey=t[t.length-2],this.nameKey=n.nameKey,this.descriptionKey=n.descriptionKey,this.optionsKey=n.optionsKey}get defaultValue(){return new this.OptionsClass()[this.optionsKey]}get option(){return _(this,Wr)||Be(this,Wr,this.buildOption()),_(this,Wr)}setRuleOption(n,t){let r=t[this.configKey];r!==void 0&&(n[this.optionsKey]=r)}};Wr=new WeakMap;var q=class extends $t{constructor(n){super(n),this.onChange=n.onChange??null}buildOption(){return new kn(this.configKey,this.nameKey,this.descriptionKey,this.defaultValue,null,this.onChange)}},ss=class extends $t{buildOption(){return new _i(this.configKey,this.nameKey,this.descriptionKey,this.defaultValue)}},X=class extends $t{constructor(n){super(n),this.records=n.records.map(t=>new ts("enums."+t.value,t.description))}buildOption(){return new ns(this.configKey,this.nameKey,this.descriptionKey,this.defaultValue,this.records)}},pe=class extends $t{constructor(n){super(n),this.separator=n.separator??`
`,this.splitter=n.splitter??/\n/}buildOption(){return new Jo(this.configKey,this.nameKey,this.descriptionKey,this.defaultValue.join(this.separator))}setRuleOption(n,t){if(t[this.configKey]!==void 0){let r=t[this.configKey].split(this.splitter).filter(function(i){return i!=""});n[this.optionsKey]=r}}},ke=class extends $t{buildOption(){return new _i(this.configKey,this.nameKey,this.descriptionKey,this.defaultValue)}},ls=class extends $t{buildOption(){return new es(this.configKey,this.nameKey,this.descriptionKey,this.defaultValue)}},cs=class extends $t{buildOption(){return new rs(this.configKey,this.nameKey,this.descriptionKey)}};var Lc=class{},Pi=class extends y{constructor(){super({nameKey:"rules.add-blank-line-after-yaml.name",descriptionKey:"rules.add-blank-line-after-yaml.description",type:"YAML"})}get OptionsClass(){return Lc}apply(n,t){let r=n.match(Qe);if(r===null)return n;let i=r[0],a=n.indexOf(i)+i.length;return a+1>=n.length||n.trimEnd()===i.trimEnd()||n.charAt(a+1)===`
`?n:n.replace(i,i+`
`)}get optionBuilders(){return[]}};Pi=S([y.register],Pi);var $n=class{constructor(){this.ignoreWords=[];this.extraAutoCorrectFiles=[];this.skipWordsWithMultipleCapitals=!1;this.misspellingToCorrection=new Map}};S([y.noSettingControl()],$n.prototype,"misspellingToCorrection",2);var Gn=class extends y{constructor(){super({nameKey:"rules.auto-correct-common-misspellings.name",descriptionKey:"rules.auto-correct-common-misspellings.description",type:"Content",hasSpecialExecutionOrder:!0,ruleIgnoreTypes:[g.yaml,g.code,g.inlineCode,g.math,g.inlineMath,g.link,g.wikiLink,g.tag,g.image,g.url]})}get OptionsClass(){return $n}apply(n,t){return n.replaceAll(qp,r=>this.replaceWordWithCorrectCasing(r,t))}replaceWordWithCorrectCasing(n,t){let r=n.toLowerCase();if(t.ignoreWords.includes(r)||t.skipWordsWithMultipleCapitals&&n.length>1&&r.substring(1)!==n.substring(1))return n;if(t.misspellingToCorrection.has(r))return this.determineCorrectedWord(n,t.misspellingToCorrection.get(r));if(t.extraAutoCorrectFiles){for(let i=0;i<t.extraAutoCorrectFiles.length;i++)if(t.extraAutoCorrectFiles[i].customReplacements instanceof Map&&t.extraAutoCorrectFiles[i].customReplacements?.has(r))return this.determineCorrectedWord(n,t.extraAutoCorrectFiles[i].customReplacements.get(r))}return n}determineCorrectedWord(n,t){return n.charAt(0)==n.charAt(0).toUpperCase()&&(t=t.charAt(0).toUpperCase()+t.substring(1)),t}get optionBuilders(){return[new pe({OptionsClass:$n,nameKey:"rules.auto-correct-common-misspellings.ignore-words.name",descriptionKey:"rules.auto-correct-common-misspellings.ignore-words.description",optionsKey:"ignoreWords",splitter:Oi,separator:", "}),new q({OptionsClass:$n,nameKey:"rules.auto-correct-common-misspellings.skip-words-with-multiple-capitals.name",descriptionKey:"rules.auto-correct-common-misspellings.skip-words-with-multiple-capitals.description",optionsKey:"skipWordsWithMultipleCapitals"}),new cs({OptionsClass:$n,nameKey:"rules.auto-correct-common-misspellings.extra-auto-correct-files.name",descriptionKey:"rules.auto-correct-common-misspellings.extra-auto-correct-files.description",optionsKey:"extraAutoCorrectFiles"})]}};Gn=S([y.register],Gn);var us=class{constructor(){this.style="space"}},Zn=class extends y{constructor(){super({nameKey:"rules.blockquote-style.name",descriptionKey:"rules.blockquote-style.description",type:"Content",hasSpecialExecutionOrder:!0,ruleIgnoreTypes:[g.html,g.code,g.math]})}get OptionsClass(){return us}apply(n,t){return t.style==="space"?ic(n,r=>this.updateBlockquoteLines(r,this.addSpaceToIndicator)):ic(n,r=>this.updateBlockquoteLines(r,this.removeSpaceFromIndicator))}removeSpaceFromIndicator(n,t){return t?n.replace(/>[ \t]+>/g,">>"):n.replace(/>[ \t]+/g,">")}addSpaceToIndicator(n,t){let r=n.replace(/>([^ ]|$)/g,"> $1").replace(/>>/g,"> >");return t?r:r.replace(/>(?:[ \t]{2,}|\t+)/g,"> ")}updateBlockquoteLines(n,t){let r=0,i=0,a="",o="",s=0,l=n,c=!1;do{i=l.indexOf(`
`,r),i===-1&&(i=l.length-1,c=!0),[a,s]=Er(l,i-1);let u=s+a.length+1,d=i;c&&d++;let m=l.substring(u,d);if(m.includes(g.math.placeholder)||m.includes(g.code.placeholder)){r++;continue}let p=Ko.test(m);o=t(a,p),s++,l=le(l,s,s+a.length,o),r=i+1+o.length-a.length}while(!c);return l}get optionBuilders(){return[new X({OptionsClass:us,nameKey:"rules.blockquote-style.style.name",descriptionKey:"rules.blockquote-style.style.description",optionsKey:"style",records:[{value:"space",description:"> indicator is followed by a space"},{value:"no space",description:">indicator is not followed by a space"}]})]}};Zn=S([y.register],Zn);var ds=class{};S([y.noSettingControl()],ds.prototype,"lineContent",2);var Qn=class extends y{constructor(){super({nameKey:"rules.add-blockquote-indentation-on-paste.name",descriptionKey:"rules.add-blockquote-indentation-on-paste.description",type:"Paste"})}get OptionsClass(){return ds}apply(n,t){let r=/^(\s*)((> ?)+) .*/,i=t.lineContent.match(r);if(!i)return n;let a=i[1]??"",o=i[2]??"";return n.trim().replace(/\n/gm,`
${a}${o} `)}get optionBuilders(){return[]}};Qn=S([y.register],Qn);var Xn=class{constructor(){this.style="Title Case";this.ignoreWords=["macOS","iOS","iPhone","iPad","JavaScript","TypeScript","AppleScript","I"];this.lowercaseWords=["a","an","the","aboard","about","abt.","above","abreast","absent","across","after","against","along","aloft","alongside","amid","amidst","mid","midst","among","amongst","anti","apropos","around","round","as","aslant","astride","at","atop","ontop","bar","barring","before","B4","behind","below","beneath","neath","beside","besides","between","'tween","beyond","but","by","chez","circa","c.","ca.","come","concerning","contra","counting","cum","despite","spite","down","during","effective","ere","except","excepting","excluding","failing","following","for","from","in","including","inside","into","less","like","minus","modulo","mod","near","nearer","nearest","next","notwithstanding","of","o'","off","offshore","on","onto","opposite","out","outside","over","o'er","pace","past","pending","per","plus","post","pre","pro","qua","re","regarding","respecting","sans","save","saving","short","since","sub","than","through","thru","throughout","thruout","till","times","to","t'","touching","toward","towards","under","underneath","unlike","until","unto","up","upon","versus","vs.","v.","via","vice","vis-\xE0-vis","wanting","with","w/","w.","c\u0304","within","w/i","without","'thout","w/o","abroad","adrift","aft","afterward","afterwards","ahead","apart","ashore","aside","away","back","backward","backwards","beforehand","downhill","downstage","downstairs","downstream","downward","downwards","downwind","east","eastward","eastwards","forth","forward","forwards","heavenward","heavenwards","hence","henceforth","here","hereby","herein","hereof","hereto","herewith","home","homeward","homewards","indoors","inward","inwards","leftward","leftwards","north","northeast","northward","northwards","northwest","now","onward","onwards","outdoors","outward","outwards","overboard","overhead","overland","overseas","rightward","rightwards","seaward","seawards","skywards","skyward","south","southeast","southwards","southward","southwest","then","thence","thenceforth","there","thereby","therein","thereof","thereto","therewith","together","underfoot","underground","uphill","upstage","upstairs","upstream","upward","upwards","upwind","west","westward","westwards","when","whence","where","whereby","wherein","whereto","wherewith","although","because","considering","given","granted","if","lest","once","provided","providing","seeing","so","supposing","though","unless","whenever","whereas","wherever","while","whilst","ago","according to","as regards","counter to","instead of","owing to","pertaining to","at the behest of","at the expense of","at the hands of","at risk of","at the risk of","at variance with","by dint of","by means of","by virtue of","by way of","for the sake of","for sake of","for lack of","for want of","from want of","in accordance with","in addition to","in case of","in charge of","in compliance with","in conformity with","in contact with","in exchange for","in favor of","in front of","in lieu of","in light of","in the light of","in line with","in place of","in point of","in quest of","in relation to","in regard to","with regard to","in respect to","with respect to","in return for","in search of","in step with","in touch with","in terms of","in the name of","in view of","on account of","on behalf of","on grounds of","on the grounds of","on the part of","on top of","with a view to","with the exception of","\xE0 la","a la","as soon as","as well as","close to","due to","far from","in case","other than","prior to","pursuant to","regardless of","subsequent to","as long as","as much as","as far as","by the time","in as much as","inasmuch","in order to","in order that","even","provide that","if only","whether","whose","whoever","why","how","or not","whatever","what","both","and","or","not only","but also","either","neither","nor","just","rather","no sooner","such","that","yet","is","it"];this.ignoreCasedWords=!0}},Jn=class extends y{const
`),r=r.replace(/\n+---/,`
---`),t.innerNewLines&&(r=r.replaceAll(/\n{2,}/g,`
`)),r))}get optionBuilders(){return[new q({OptionsClass:ps,nameKey:"rules.compact-yaml.inner-new-lines.name",descriptionKey:"rules.compact-yaml.inner-new-lines.description",optionsKey:"innerNewLines"})]}};Hi=S([y.register],Hi);var Ec=class{},qi=class extends y{constructor(){super({nameKey:"rules.consecutive-blank-lines.name",descriptionKey:"rules.consecutive-blank-lines.description",type:"Spacing",ruleIgnoreTypes:[g.code,g.math,g.yaml,g.link,g.wikiLink,g.tag]})}get OptionsClass(){return Ec}apply(n,t){return n.replace(/(\n([\t\v\f\r \u00a0\u2000-\u200b\u2028-\u2029\u3000]+)?){2,}\n/g,`
`)}get optionBuilders(){return[]}};qi=S([y.register],qi);var Tc=class{},Ui=class extends y{constructor(){super({nameKey:"rules.convert-bullet-list-markers.name",descriptionKey:"rules.convert-bullet-list-markers.description",type:"Content",ruleIgnoreTypes:[g.code,g.math,g.yaml,g.link,g.wikiLink,g.tag]})}get OptionsClass(){return Tc}apply(n,t){return n.replace(/^([^\S\n]*)([•§])([^\S\n]*)/gm,"$1-$3")}get optionBuilders(){return[]}};Ui=S([y.register],Ui);var ms=class{constructor(){this.tabsize=4}},Wi=class extends y{constructor(){super({nameKey:"rules.convert-spaces-to-tabs.name",descriptionKey:"rules.convert-spaces-to-tabs.description",type:"Spacing",ruleIgnoreTypes:[g.code,g.math,g.yaml,g.link,g.wikiLink,g.tag]})}get OptionsClass(){return ms}apply(n,t){let r=String(t.tabsize),i=new RegExp("^( *) {"+r+"}","gm");n=this.replaceAllRegexMatches(n,i);let a=new RegExp("^((>( | *))*(>( | )) *) {"+r+"}","gm");return n=this.replaceAllRegexMatches(n,a),n}replaceAllRegexMatches(n,t){for(;n.match(t)!=null;)n=n.replace(t,"$1 ");return n}get optionBuilders(){return[new ss({OptionsClass:ms,nameKey:"rules.convert-spaces-to-tabs.tabsize.name",descriptionKey:"rules.convert-spaces-to-tabs.tabsize.description",optionsKey:"tabsize"})]}};Wi=S([y.register],Wi);var Et=class{constructor(){this.aliasArrayStyle="single-line";this.dedupeAliasKey=!0;this.tagArrayStyle="single-line";this.dedupeTagKey=!0;this.dedupeArrayKeys=!0;this.ignoreDedupeArrayKeys=[];this.defaultEscapeCharacter='"';this.removeUnnecessaryEscapeCharsForMultiLineArrays=!1}};S([y.noSettingControl()],Et.prototype,"aliasArrayStyle",2),S([y.noSettingControl()],Et.prototype,"tagArrayStyle",2),S([y.noSettingControl()],Et.prototype,"defaultEscapeCharacter",2),S([y.noSettingControl()],Et.prototype,"removeUnnecessaryEscapeCharsForMultiLineArrays",2);var Vi=class extends y{constructor(){super({nameKey:"rules.dedupe-yaml-array-values.name",descriptionKey:"rules.dedupe-yaml-array-values.description",type:"YAML"})}get OptionsClass(){return Et}apply(n,t){return he(n,r=>{let i=st(r.replace(`---
`,"").replace(`
---`,""));if(!i)return r;for(let a of wt)if(t.dedupeAliasKey&&Object.keys(i).includes(a)){r=ae(r,a,be(gn(this.getUniqueArray(Fe(ue(r,a)))),t.aliasArrayStyle,t.defaultEscapeCharacter,t.removeUnnecessaryEscapeCharsForMultiLineArrays,!0));break}for(let a of kt)if(t.dedupeTagKey&&Object.keys(i).includes(a)){r=ae(r,a,be(fn(this.getUniqueArray(Fe(ue(r,a)))),t.tagArrayStyle,t.defaultEscapeCharacter,t.removeUnnecessaryEscapeCharsForMultiLineArrays));break}if(t.dedupeArrayKeys){let a=[...wt,...kt,...t.ignoreDedupeArrayKeys];for(let o of Object.keys(i)){if(a.includes(o)||!Array.isArray(i[o])||i[o].length!==0&&typeof i[o][0]=="object"&&i[o][0]!==null)continue;let s=ue(r,o),l="single-line";s.includes(`
`)&&(l="multi-line");let c=this.getUniqueArray(Fe(s));r=ae(r,o,be(c,l,t.defaultEscapeCharacter,t.removeUnnecessaryEscapeCharsForMultiLineArrays))}}return r})}getUniqueArray(n){return n==null||typeof n=="string"||n.length<=1?n:[...new Set(n)]}get optionBuilders(){return[new q({OptionsClass:Et,nameKey:"rules.dedupe-yaml-array-values.dedupe-alias-key.name",descriptionKey:"rules.dedupe-yaml-array-values.dedupe-alias-key.description",optionsKey:"dedupeAliasKey"}),new q({OptionsClass:Et,nameKey:"rules.dedupe-yaml-array-values.dedupe-tag-key.name",descriptionKey:"rules.dedupe-yaml-array-values.dedupe-tag-key.description",optionsKey:"dedupeTagKey"}),new q({OptionsClass:Et,nameKey:"rules.dedupe-yaml-array-values.dedupe-array-keys.name",descriptionKey:"rules.dedupe-yaml-array-values.dedupe-array-keys.description",optionsKey:"dedupeArrayKeys"}),new pe({OptionsClass:Et,nameKey:"rules.dedupe-yaml-array-values.ignore-keys.name",descriptionKey:"rules.dedupe-yaml-array-values.ignore-keys.description",optionsKey:"ignoreDedupeArrayKeys"})]}};Vi=S([y.register],Vi);var fs=class{constructor(){this.defaultLanguage=""}},ji=class extends y{constructor(){super({nameKey:"rules.default-language-for-code-fences.name",descriptionKey:"rules.default-language-for-code-fences.description",type:"Content",ruleIgnoreTypes:[g.yaml,g.math,g.yaml,g.link,g.wikiLink,g.tag]})}get OptionsClass(){return fs}apply(n,t){return Bp(n,t.defaultLanguage)}get optionBuilders(){return[new ke({OptionsClass:fs,nameKey:"rules.default-language-for-code-fences.default-language.name",descriptionKey:"rules.default-language-for-code-fences.default-language.description",optionsKey:"defaultLanguage"})]}};ji=S([y.register],ji);var gs=class{constructor(){this.style="consistent"}},$i=class extends y{constructor(){super({nameKey:"rules.emphasis-style.name",descriptionKey:"rules.emphasis-style.description",type:"Content",ruleIgnoreTypes:[g.code,g.math,g.yaml,g.link,g.wikiLink,g.tag,g.math,g.inlineMath]})}get OptionsClass(){return gs}apply(n,t){return Do(n,t.style,"emphasis")}get optionBuilders(){return[new X({OptionsClass:gs,nameKey:"rules.emphasis-style.style.name",descriptionKey:"rules.emphasis-style.style.description",optionsKey:"style",records:[{value:"consistent",description:"Makes sure the first instance of emphasis is the style that will be used throughout the document"},{value:"asterisk",description:"Makes sure * is the emphasis indicator"},{value:"underscore",description:"Makes sure _ is the emphasis indicator"}]})]}};$i=S([y.register],$i);var Cc=class{},Gi=class extends y{constructor(){super({nameKey:"rules.empty-line-around-blockquotes.name",descriptionKey:"rules.empty-line-around-blockquotes.description",type:"Spacing"})}get OptionsClass(){return Cc}apply(n,t){return Ep(n)}get optionBuilders(){return[]}};Gi=S([y.register],Gi);var Oc=class{},Zi=class extends y{constructor(){super({nameKey:"rules.empty-line-around-code-fences.name",descriptionKey:"rules.empty-line-around-code-fences.description",type:"Spacing"})}get OptionsClass(){return Oc}apply(n,t){return Sp(n)}get optionBuilders(){return[]}};Zi=S([y.register],Zi);var Mc=class{},Qi=class extends y{constructor(){super({nameKey:"rules.empty-line-around-horizontal-rules.name",descriptionKey:"rules.empty-line-around-horizontal-rules.description",type:"Spacing"})}get OptionsClass(){return Mc}apply(n,t){return Tp(n)}get optionBuilders(){return[]}};Qi=S([y.register],Qi);var hs=class{constructor(){this.minimumNumberOfDollarSignsToBeAMathBlock=2}};S([y.noSettingControl()],hs.prototype,"minimumNumberOfDollarSignsToBeAMathBlock",2);var Xi=class extends y{constructor(){super({nameKey:"rules.empty-line-around-math-blocks.name",descriptionKey:"rules.empty-line-around-math-blocks.description",type:"Spacing",ruleIgnoreTypes:[g.yaml,g.code]})}get OptionsClass(){return hs}apply(n,t){return Lp(n,t.minimumNumberOfDollarSignsToBeAMathBlock)}get optionBuilders(){return[]}};Xi=S([y.register],Xi);var Ic=class{},Ji=class extends y{constructor(){super({nameKey:"rules.empty-line-around-tables.name",descriptionKey:"rules.empty-line-around-tables.descri
`),a=i.length;if(a<1)return r;for(let o=0;o<a;o++){let s=i[o].trim(),l=s.indexOf(":"),c=l<0||l+1>=s.length,u=s.startsWith("-"),d=u&&s.length<2;if(c&&d)continue;let m=1;if(!u)m+=l;else if(l!==-1&&o+1<a){let f=i[o],b=f.indexOf("-")+1;for(;b<f.length&&f.charAt(b)===" ";)b++;let h=0,k=i[o+1];for(;h<k.length&&k.charAt(h)===" ";)h++;b<=h&&(m+=l)}let p=s.substring(m).trim();if(p.startsWith("[")){if(t.tryToEscapeSingleLineArrays){if(p.length<3)continue;let f=p.substring(1,p.length-1).split(","),b=f.length;for(let h=0;h<b;h++){let k=f[h].trim();k.startsWith("[")&&(k=k.substring(1).trimStart()),k.endsWith("]")&&(k=k.substring(0,k.length-1).trimEnd()),f[h]=f[h].replace(k,At(k,t.defaultEscapeCharacter,!1,!0))}i[o]=i[o].replace(p,"["+f.join(",")+"]")}continue}i[o]=i[o].replace(p,At(p,t.defaultEscapeCharacter,!1,!0))}return i.join(`
`)})}get optionBuilders(){return[new q({OptionsClass:ea,nameKey:"rules.escape-yaml-special-characters.try-to-escape-single-line-arrays.name",descriptionKey:"rules.escape-yaml-special-characters.try-to-escape-single-line-arrays.description",optionsKey:"tryToEscapeSingleLineArrays"})]}};er=S([y.register],er);var Bm=require("obsidian");var Rt=class extends Bm.Modal{constructor(n,t,r,i,a){super(n),this.modalEl.addClass("confirm-modal"),this.contentEl.createEl("h3",{text:x("warning-text"),cls:"modal-heading"});let o=this.contentEl.createEl("p");o.id="confirm-dialog",rt(x("disabled-other-rule-notice").replace("{NAME_1}",x(t)).replace("{NAME_2}",x(r)),o),this.contentEl.createDiv("modal-button-container",s=>{s.createEl("button",{text:x("cancel-button-text")}).addEventListener("click",()=>{a(),this.close()});let l=s.createEl("button",{attr:{type:"submit"},cls:"mod-cta",text:x("ok")});l.addEventListener("click",()=>{this.close(),i()}),setTimeout(()=>{l.focus()},50)})}};var ys=class{};S([y.noSettingControl()],ys.prototype,"fileName",2);var ta=class extends y{constructor(){super({nameKey:"rules.file-name-heading.name",descriptionKey:"rules.file-name-heading.description",type:"Heading",ruleIgnoreTypes:[g.code,g.math,g.yaml,g.link,g.wikiLink,g.tag],disableConflictingOptions(n,t){let r=lt["header-increment"],i=r.options[0],a=r.options[1];n&&i.getValue()&&new Rt(t,"rules.file-name-heading.name","rules.header-increment.start-at-h2.name",()=>{a.setValue(!1)},()=>{lt["file-name-heading"].options[0].setValue(!1)}).open()}})}get OptionsClass(){return ys}apply(n,t){if(n.match(/^#\s.*/m))return n;let i=t.fileName,a=n.indexOf(`
---`);a=a==-1||!n.startsWith(`---
`)?0:a+5;let o=`# ${i}
`;return n.length<a&&(o=`
`+o),In(n,a,o)}get optionBuilders(){return[]}};ta=S([y.register],ta);var Bc=class{},na=class extends y{constructor(){super({nameKey:"rules.footnote-after-punctuation.name",descriptionKey:"rules.footnote-after-punctuation.description",type:"Footnote",ruleIgnoreTypes:[g.code,g.inlineCode,g.math,g.yaml,g.link,g.wikiLink,g.tag,g.footnoteAtStartOfLine,g.footnoteAfterATask]})}get OptionsClass(){return Bc}apply(n,t){return n.replace(/(\[\^[^\]]+\]) ?([,.;!:?])/gm,"$2$1")}get optionBuilders(){return[]}};na=S([y.register],na);var ra=class{constructor(){this.defaultEscapeCharacter='"';this.forceYamlEscape=[]}};S([y.noSettingControl()],ra.prototype,"defaultEscapeCharacter",2);var tr=class extends y{constructor(){super({nameKey:"rules.force-yaml-escape.name",descriptionKey:"rules.force-yaml-escape.description",type:"YAML",hasSpecialExecutionOrder:!0})}get OptionsClass(){return ra}apply(n,t){return he(n,r=>{for(let i of t.forceYamlEscape){let a=ue(r,i);if(a!=null){if(a.includes(`
`)||a.startsWith(" [")||Rr(a))continue;a=At(a,t.defaultEscapeCharacter,!0),r=ae(r,i," "+a)}}return r})}get optionBuilders(){return[new pe({OptionsClass:ra,nameKey:"rules.force-yaml-escape.force-yaml-escape-keys.name",descriptionKey:"rules.force-yaml-escape.force-yaml-escape-keys.description",optionsKey:"forceYamlEscape"})]}};tr=S([y.register],tr);var Fc=class{},nr=class extends y{constructor(){super({nameKey:"rules.format-tags-in-yaml.name",descriptionKey:"rules.format-tags-in-yaml.description",type:"YAML",hasSpecialExecutionOrder:!0})}get OptionsClass(){return Fc}apply(n,t){return he(n,r=>r.replace(new RegExp(`^(${Ii}|${oc}):[ \\t]*(\\S.*|(?:(?:\\n *- \\S.*)|((?:\\n *- *))*|(\\n([ \\t]+[^\\n]*))*)*)\\n`,"m"),function(i){return i.replaceAll("#","")}))}get optionBuilders(){return[]}};nr=S([y.register],nr);var ct=class{constructor(){this.aliasArrayStyle="single-line";this.formatAliasKey=!0;this.tagArrayStyle="single-line";this.formatTagKey=!0;this.defaultArrayStyle="single-line";this.formatArrayKeys=!0;this.forceSingleLineArrayStyle=[];this.forceMultiLineArrayStyle=[];this.defaultEscapeCharacter='"';this.removeUnnecessaryEscapeCharsForMultiLineArrays=!1}};S([y.noSettingControl()],ct.prototype,"aliasArrayStyle",2),S([y.noSettingControl()],ct.prototype,"tagArrayStyle",2),S([y.noSettingControl()],ct.prototype,"defaultEscapeCharacter",2),S([y.noSettingControl()],ct.prototype,"removeUnnecessaryEscapeCharsForMultiLineArrays",2);var ia=class extends y{constructor(){super({nameKey:"rules.format-yaml-array.name",descriptionKey:"rules.format-yaml-array.description",type:"YAML"})}get OptionsClass(){return ct}apply(n,t){return he(n,r=>{let i=st(r.replace(`---
`,"").replace(`
---`,""));if(!i)return r;for(let a of wt)if(t.formatAliasKey&&Object.keys(i).includes(a)){r=ae(r,a,be(gn(Fe(ue(r,a))),t.aliasArrayStyle,t.defaultEscapeCharacter,t.removeUnnecessaryEscapeCharsForMultiLineArrays,!0));break}for(let a of kt)if(t.formatTagKey&&Object.keys(i).includes(a)){r=ae(r,a,be(fn(Fe(ue(r,a))),t.tagArrayStyle,t.defaultEscapeCharacter,t.removeUnnecessaryEscapeCharsForMultiLineArrays));break}if(t.formatArrayKeys){let a=[...wt,...kt,...t.forceMultiLineArrayStyle,...t.forceSingleLineArrayStyle];for(let o of Object.keys(i))a.includes(o)||!Array.isArray(i[o])||i[o].length!==0&&typeof i[o][0]=="object"&&i[o][0]!==null||(r=ae(r,o,be(Fe(ue(r,o)),t.defaultArrayStyle,t.defaultEscapeCharacter,t.removeUnnecessaryEscapeCharsForMultiLineArrays)))}for(let a of t.forceSingleLineArrayStyle)Object.keys(i).includes(a)&&(r=ae(r,a,be(Fe(ue(r,a)),"single-line",t.defaultEscapeCharacter,t.removeUnnecessaryEscapeCharsForMultiLineArrays)));for(let a of t.forceMultiLineArrayStyle)Object.keys(i).includes(a)&&(r=ae(r,a,be(Fe(ue(r,a)),"multi-line",t.defaultEscapeCharacter,t.removeUnnecessaryEscapeCharsForMultiLineArrays)));return r})}get optionBuilders(){return[new q({OptionsClass:ct,nameKey:"rules.format-yaml-array.alias-key.name",descriptionKey:"rules.format-yaml-array.alias-key.description",optionsKey:"formatAliasKey"}),new q({OptionsClass:ct,nameKey:"rules.format-yaml-array.tag-key.name",descriptionKey:"rules.format-yaml-array.tag-key.description",optionsKey:"formatTagKey"}),new X({OptionsClass:ct,nameKey:"rules.format-yaml-array.default-array-style.name",descriptionKey:"rules.format-yaml-array.default-array-style.description",optionsKey:"defaultArrayStyle",records:[{value:"multi-line",description:"```key:\\n - value```"},{value:"single-line",description:"```key: [value]```"}]}),new q({OptionsClass:ct,nameKey:"rules.format-yaml-array.default-array-keys.name",descriptionKey:"rules.format-yaml-array.default-array-keys.description",optionsKey:"formatArrayKeys"}),new pe({OptionsClass:ct,nameKey:"rules.format-yaml-array.force-single-line-array-style.name",descriptionKey:"rules.format-yaml-array.force-single-line-array-style.description",optionsKey:"forceSingleLineArrayStyle"}),new pe({OptionsClass:ct,nameKey:"rules.format-yaml-array.force-multi-line-array-style.name",descriptionKey:"rules.format-yaml-array.force-multi-line-array-style.description",optionsKey:"forceMultiLineArrayStyle"})]}};ia=S([y.register],ia);var bs=class{constructor(){this.startAtH2=!1}},aa=class extends y{constructor(){super({nameKey:"rules.header-increment.name",descriptionKey:"rules.header-increment.description",type:"Heading",ruleIgnoreTypes:[g.code,g.math,g.yaml,g.link,g.wikiLink,g.tag]})}get OptionsClass(){return bs}apply(n,t){let r=0,i=t.startAtH2?2:1,a=[],o=[0,0,0,0,0,0],s=o.length;return n.replace(pn,(l,c="",u="",d="",m="",p="")=>{let f=u.length;if(f=f<=s?f:s,o[f-1]>=0&&f<r){let b=o.length;for(;a.length!==0&&f<=a[a.length-1];)b=a.pop();a.length===0?b=0:b--;for(let h=o.length-1;h>=b;h--)o[h]=0}if(o[f-1]<=0){let b=r,h=a.length+i;h=h<=s?h:s;for(let k=b;k<f-1;k++)o[k]=h-1;a.push(f),o[f-1]=h}return r=f,c+"#".repeat(o[f-1])+d+m+p})}get optionBuilders(){return[new q({OptionsClass:bs,nameKey:"rules.header-increment.start-at-h2.name",descriptionKey:"rules.header-increment.start-at-h2.description",optionsKey:"startAtH2",onChange(n,t){let r=lt["file-name-heading"].options[0];n&&r.getValue()&&new Rt(t,"rules.header-increment.start-at-h2.name","rules.file-name-heading.name",()=>{r.setValue(!1)},()=>{lt["header-increment"].options[1].setValue(!1)}).open()}})]}};aa=S([y.register],aa);var sa=class{constructor(){this.bottom=!0;this.emptyLineAfterYaml=!0}},oa=class extends y{constructor(){super({nameKey:"rules.heading-blank-lines.name",descriptionKey:"rules.heading-blank-lines.description",type:"Spacing",ruleIgnoreTypes:[g.code,g.math,g.yaml,g.link,g.wikiLink]})}get OptionsClass(){return sa}apply(n,t){return t.bottom?(n=n.replace(/^(#+\s.*)/gm,`
$1
`),n=n.replace(/\n+(#+\s.*)/g,`
$1`),n=n.replace(/(^#+\s.*)\n+/gm,`$1
`)):n=n.replace(/^([^#\n][^\n]+)\n+(#+\s.*)/gm,`$1
$2`),n=n.replace(/^\n+(#+\s.*)/,"$1"),n=n.replace(/(#+\s.*)\n+$/,"$1"),t.emptyLineAfterYaml||(n=n.replace(new RegExp("("+Qe.source+")\\n+(#+\\s.*)"),`$1
$5`)),n}get optionBuilders(){return[new q({OptionsClass:sa,nameKey:"rules.heading-blank-lines.bottom.name",descriptionKey:"rules.heading-blank-lines.bottom.description",optionsKey:"bottom"}),new q({OptionsClass:sa,nameKey:"rules.heading-blank-lines.empty-line-after-yaml.name",descriptionKey:"rules.heading-blank-lines.empty-line-after-yaml.description",optionsKey:"emptyLineAfterYaml"})]}};oa=S([y.register],oa);var Rc=class{},la=class extends y{constructor(){super({nameKey:"rules.headings-start-line.name",descriptionKey:"rules.headings-start-line.description",type:"Heading",ruleIgnoreTypes:[g.code,g.math,g.yaml]})}get OptionsClass(){return Rc}apply(n,t){return n.replaceAll(pn,r=>r.trimStart())}get optionBuilders(){return[]}};la=S([y.register],la);var vs=class{constructor(){this.textToInsert=["aliases: ","tags: "]}},ca=class extends y{constructor(){super({nameKey:"rules.insert-yaml-attributes.name",descriptionKey:"rules.insert-yaml-attributes.description",type:"YAML"})}get OptionsClass(){return vs}apply(n,t){return n=Bt(n),he(n,r=>{let i=t.textToInsert.reverse(),a=st(r.match(Qe)[1]);for(let o of i){let s=o.split(":")[0];Object.prototype.hasOwnProperty.call(a,s)||(r=r.replace(/^---\n/,Xe(`---
${o}
`)))}return r})}get optionBuilders(){return[new pe({OptionsClass:vs,nameKey:"rules.insert-yaml-attributes.text-to-insert.name",descriptionKey:"rules.insert-yaml-attributes.text-to-insert.description",optionsKey:"textToInsert"})]}};ca=S([y.register],ca);var Dc=class{},ua=class extends y{constructor(){super({nameKey:"rules.line-break-at-document-end.name",descriptionKey:"rules.line-break-at-document-end.description",type:"Spacing"})}get OptionsClass(){return Dc}apply(n,t){return n=n.replace(/\n+$/g,""),n+=`
`,n}get optionBuilders(){return[]}};ua=S([y.register],ua);var zc=class{},da=class extends y{constructor(){super({nameKey:"rules.move-footnotes-to-the-bottom.name",descriptionKey:"rules.move-footnotes-to-the-bottom.description",type:"Footnote",ruleIgnoreTypes:[g.code,g.inlineCode,g.math,g.yaml]})}get OptionsClass(){return zc}apply(n,t){return yp(n)}get optionBuilders(){return[]}};da=S([y.register],da);var ks=class{constructor(){this.minimumNumberOfDollarSignsToBeAMathBlock=2}};S([y.noSettingControl()],ks.prototype,"minimumNumberOfDollarSignsToBeAMathBlock",2);var rr=class extends y{constructor(){super({nameKey:"rules.move-math-block-indicators-to-their-own-line.name",descriptionKey:"rules.move-math-block-indicators-to-their-own-line.description",type:"Spacing",ruleIgnoreTypes:[g.code,g.inlineCode],hasSpecialExecutionOrder:!0})}get OptionsClass(){return ks}apply(n,t){return Mp(n,t.minimumNumberOfDollarSignsToBeAMathBlock)}get optionBuilders(){return[]}};rr=S([y.register],rr);var xn=class{constructor(){this.tagArrayStyle="single-line";this.howToHandleExistingTags="Nothing";this.tagsToIgnore=[];this.defaultEscapeCharacter='"';this.removeUnnecessaryEscapeCharsForMultiLineArrays=!1}};S([y.noSettingControl()],xn.prototype,"tagArrayStyle",2),S([y.noSettingControl()],xn.prototype,"defaultEscapeCharacter",2),S([y.noSettingControl()],xn.prototype,"removeUnnecessaryEscapeCharsForMultiLineArrays",2);var pa=class extends y{constructor(){super({nameKey:"rules.move-tags-to-yaml.name",descriptionKey:"rules.move-tags-to-yaml.description",type:"YAML",ruleIgnoreTypes:[g.code,g.inlineCode,g.math,g.html,g.wikiLink,g.link]})}get OptionsClass(){return xn}apply(n,t){let r;return Oe([g.yaml],n,i=>(r=Qp(i),i)),r.length===0||(n=Bt(n),n=he(n,i=>{i=i.replace(`---
`,"").replace("---","");let a=[],o=Ii;for(let c of kt){let u=ue(i,c);if(u!=null){a=fn(Fe(u)),o=c;break}}let s=new Set;if(typeof a=="string")s.add(a),a=[a];else if(a!=null)for(let c of a)s.add(c);else a=[];for(let c of r){let u=c.trim().substring(1);!s.has(u)&&!t.tagsToIgnore.includes(u)&&(s.add(u),a.push(u))}return`---
${ae(i,o,be(a,t.tagArrayStyle,t.defaultEscapeCharacter,t.removeUnnecessaryEscapeCharsForMultiLineArrays))}---`}),n=Oe([g.yaml],n,i=>(t.howToHandleExistingTags!=="Nothing"&&(i=i.replace(Ci,a=>{let o=a.indexOf("#"),s=a.substring(o+1);return t.tagsToIgnore.includes(s)?a:t.howToHandleExistingTags==="Remove hashtag"?a.substring(0,o)+s:""})),i)),n=n.replace(/(\n---)( |\t)+/,"$1")),n}get optionBuilders(){return[new X({OptionsClass:xn,nameKey:"rules.move-tags-to-yaml.how-to-handle-existing-tags.name",descriptionKey:"rules.move-tags-to-yaml.how-to-handle-existing-tags.description",optionsKey:"howToHandleExistingTags",records:[{value:"Nothing",description:"Leaves tags in the body of the file alone"},{value:"Remove hashtag",description:"Removes `#` from tags in content body after moving them to the YAML frontmatter"},{value:"Remove whole tag",description:"Removes the whole tag in content body after moving them to the YAML frontmatter. _Note that this removes the first space prior to the tag as well_"}]}),new pe({OptionsClass:xn,nameKey:"rules.move-tags-to-yaml.tags-to-ignore.name",descriptionKey:"rules.move-tags-to-yaml.tags-to-ignore.description",optionsKey:"tagsToIgnore"})]}};pa=S([y.register],pa);var As=class{constructor(){this.noBareURIs=!1}},ws="'\"\u2018\u2019\u201C\u201D`[]",Fk=["http","ftp","https","smtp"],ma=class extends y{constructor(){super({nameKey:"rules.no-bare-urls.name",descriptionKey:"rules.no-bare-urls.description",type:"Content",ruleIgnoreTypes:[g.code,g.math,g.yaml,g.link,g.wikiLink,g.tag,g.image,g.inlineCode,g.anchorTag,g.html]})}get OptionsClass(){return As}apply(n,t){let r=n.match(zn);if(r&&(n=this.handleMatches(n,r,!1)),t.noBareURIs){let i=n.match(Pp);i&&(n=this.handleMatches(n,i,!0))}return n}handleMatches(n,t,r){let i=0,a=t.length;for(let o=0;o<a;o++){let s=t[o],l=n.indexOf(s,i),c=l+s.length;s.charAt(0)==="<"&&(s=s.substring(1),l++),s.charAt(s.length-1)===">"&&(s=s.substring(0,s.length-1),c--);let u=l===0?void 0:n.charAt(l-1),d=c>=n.length?void 0:n.charAt(c),m=sn(s,"(");if(m!=0&&m!=sn(s,")")&&d==")"?(s+=d,c++,d=c>=n.length?void 0:n.charAt(c)):m==0&&s.endsWith(")")&&(d=")",c--,s=s.substring(0,s.length-1)),this.skipMatch(u,d,s,r)){i=l+s.length;continue}if(u!=null&&u==="<"&&d!=null&&d===">"){let p=l-1;for(;p>0&&n.charAt(p-1)==="<";)p--;let f=c;for(;f<n.length-1&&n.charAt(f+1)===">";)f++;n=le(n,p,f+1,"<"+s+">"),i=l+s.length;continue}n=le(n,l,l+s.length,"<"+s+">"),i=l+s.length+2}return n}skipMatch(n,t,r,i){let a=n!=null&&ws.includes(n)||ws.includes(r.charAt(0)),o=t!=null&&ws.includes(t)||ws.includes(r.charAt(r.length-1));return a&&o?!0:i?Fk.includes(r.substring(0,r.indexOf(":"))):!1}get optionBuilders(){return[new q({OptionsClass:As,nameKey:"rules.no-bare-urls.no-bare-uris.name",descriptionKey:"rules.no-bare-urls.no-bare-uris.description",optionsKey:"noBareURIs"})]}};ma=S([y.register],ma);var jr=class{constructor(){this.numberStyle="ascending";this.listEndStyle="."}},fa=class extends y{constructor(){super({nameKey:"rules.ordered-list-style.name",descriptionKey:"rules.ordered-list-style.description",type:"Content",ruleIgnoreTypes:[g.code,g.math,g.yaml,g.tag]})}get OptionsClass(){return jr}apply(n,t){return Cp(n,t.numberStyle,t.listEndStyle,t.preserveStart)}get optionBuilders(){return[new X({OptionsClass:jr,nameKey:"rules.ordered-list-style.number-style.name",descriptionKey:"rules.ordered-list-style.number-style.description",optionsKey:"numberStyle",records:[{value:"ascending",description:"Makes sure ordered list items are ascending (i.e. 1, 2, 3, etc.)"},{value:"lazy",description:"Makes sure ordered list item indicators all are the same"},{value:"preserve",description:"Preserves ordered list item indicators as they are"}]}),new X({OptionsClass:jr,nameKey:"rules.ordered-list-style.list-end-style.name",descriptionKey:"rules.ordered-list-style.list-end-style.description",optionsKey:"listEndStyle",records:[{value:".",description:"Makes sure ordered list items indicators end in '.' (i.e `1.`)"},{value:")",description:"Makes sure ordered list item indicators end in ')' (i.e. `1)`)"}]}),new q({OptionsClass:jr,nameKey
{2,}${r}$`,"gm"),a,o=t;do a=o.match(i),o=o.replaceAll(i,`$1
$4`);while(a);return o}}get OptionsClass(){return Hc}apply(t,r){let i=`(( |\\t)*- ${Kn}( |\\t)+.+)`;t=this.replaceEmptyLinesBetweenList(t,i),t=this.replaceEmptyLinesBetweenList(t,"(( |\\t)*\\d+\\.( |\\t)+.+)"),t=this.replaceEmptyLinesBetweenList(t,"(( |\\t)*\\+( |\\t)+.+)");let s=`(( |\\t)*-(?! ${Kn})( |\\t)+.+)`;return t=this.replaceEmptyLinesBetweenList(t,s),this.replaceEmptyLinesBetweenList(t,"(( |\\t)*\\*( |\\t)+.+)")}get optionBuilders(){return[]}};Aa=S([y.register],Aa);var qc=class{},xa=class extends y{constructor(){super({nameKey:"rules.remove-empty-list-markers.name",descriptionKey:"rules.remove-empty-list-markers.description",type:"Content",ruleIgnoreTypes:[g.code,g.math,g.yaml,g.link,g.wikiLink,g.tag]})}get OptionsClass(){return qc}apply(n,t){let r=new RegExp(`^${Mi}(-|\\*|\\+|\\d+[.)]|- (\\[(.)\\]))\\s*?$`,"gm");return n=n.replace(new RegExp(r.source+"\\n","gm"),""),n=n.replace(new RegExp("\\n"+r.source,"gm"),""),n.replace(r,"")}get optionBuilders(){return[]}};xa=S([y.register],xa);var Uc=class{},Sa=class extends y{constructor(){super({nameKey:"rules.remove-hyphenated-line-breaks.name",descriptionKey:"rules.remove-hyphenated-line-breaks.description",type:"Content",ruleIgnoreTypes:[g.code,g.math,g.yaml,g.link,g.wikiLink,g.tag]})}get OptionsClass(){return Uc}apply(n,t){return n.replace(/\b[-] \b/g,"")}get optionBuilders(){return[]}};Sa=S([y.register],Sa);var Wc=class{},lr=class extends y{constructor(){super({nameKey:"rules.remove-hyphens-on-paste.name",descriptionKey:"rules.remove-hyphens-on-paste.description",type:"Paste"})}get OptionsClass(){return Wc}apply(n,t){return n.replace(/([^\s-])[-]\s+\n?(?=\w)/g,"$1")}get optionBuilders(){return[]}};lr=S([y.register],lr);var Vc=class{},cr=class extends y{constructor(){super({nameKey:"rules.remove-leading-or-trailing-whitespace-on-paste.name",descriptionKey:"rules.remove-leading-or-trailing-whitespace-on-paste.description",type:"Paste"})}get OptionsClass(){return Vc}apply(n,t){return n.replace(/^[\n ]+|\s+$/g,"")}get optionBuilders(){return[]}};cr=S([y.register],cr);var jc=class{},ur=class extends y{constructor(){super({nameKey:"rules.remove-leftover-footnotes-from-quote-on-paste.name",descriptionKey:"rules.remove-leftover-footnotes-from-quote-on-paste.description",ruleIgnoreTypes:[g.wikiLink,g.link,g.image],type:"Paste"})}get OptionsClass(){return jc}apply(n,t){return n.replace(/(\D)[.,]\d+/g,"$1")}get optionBuilders(){return[]}};ur=S([y.register],ur);var $c=class{},La=class extends y{constructor(){super({nameKey:"rules.remove-link-spacing.name",descriptionKey:"rules.remove-link-spacing.description",type:"Spacing"})}get OptionsClass(){return $c}apply(n,t){return n=wp(n),Gp(n)}get optionBuilders(){return[]}};La=S([y.register],La);var Gc=class{},dr=class extends y{constructor(){super({nameKey:"rules.remove-multiple-blank-lines-on-paste.name",descriptionKey:"rules.remove-multiple-blank-lines-on-paste.description",type:"Paste"})}get OptionsClass(){return Gc}apply(n,t){return n.replace(/\n{3,}/g,`
`)}get optionBuilders(){return[]}};dr=S([y.register],dr);var Zc=class{},Ea=class extends y{constructor(){super({nameKey:"rules.remove-multiple-spaces.name",descriptionKey:"rules.remove-multiple-spaces.description",type:"Content",ruleIgnoreTypes:[g.code,g.inlineCode,g.math,g.inlineMath,g.yaml,g.link,g.wikiLink,g.tag,g.table]})}get OptionsClass(){return Zc}apply(n,t){return n=n.replace(/(?!^>)([^\s])( ){2,}([^\s])/gm,"$1 $3"),n}get optionBuilders(){return[]}};Ea=S([y.register],Ea);var pr=class{constructor(){this.includeFullwidthForms=!0;this.includeCJKSymbolsAndPunctuation=!0;this.includeDashes=!0;this.otherSymbols=""}},Ta=class extends y{constructor(){super({nameKey:"rules.remove-space-around-characters.name",descriptionKey:"rules.remove-space-around-characters.description",type:"Spacing",ruleIgnoreTypes:[g.code,g.inlineCode,g.math,g.yaml,g.link,g.wikiLink,g.tag]})}get OptionsClass(){return pr}apply(n,t){let r="";if(t.includeFullwidthForms&&(r+="\uFF01-\uFF5E"),t.includeCJKSymbolsAndPunctuation&&(r+="\u3000-\u303F"),t.includeDashes&&(r+="\u2013\u2014"),r+=mn(t.otherSymbols),!r)return n;let i=new RegExp(`([ ])+([${r}])`,"g"),a=new RegExp(`([${r}])([ ])+`,"g"),o=function(l){return l.replace(i,"$2").replace(a,"$1")},s=Oe([g.list],n,o);return s=zo(s,o),s}get optionBuilders(){return[new q({nameKey:"rules.remove-space-around-characters.include-fullwidth-forms.name",descriptionKey:"rules.remove-space-around-characters.include-fullwidth-forms.description",OptionsClass:pr,optionsKey:"includeFullwidthForms"}),new q({nameKey:"rules.remove-space-around-characters.include-cjk-symbols-and-punctuation.name",descriptionKey:"rules.remove-space-around-characters.include-cjk-symbols-and-punctuation.description",OptionsClass:pr,optionsKey:"includeCJKSymbolsAndPunctuation"}),new q({nameKey:"rules.remove-space-around-characters.include-dashes.name",descriptionKey:"rules.remove-space-around-characters.include-dashes.description",OptionsClass:pr,optionsKey:"includeDashes"}),new ke({nameKey:"rules.remove-space-around-characters.other-symbols.name",descriptionKey:"rules.remove-space-around-characters.other-symbols.description",OptionsClass:pr,optionsKey:"otherSymbols"})]}};Ta=S([y.register],Ta);var Oa=class{constructor(){this.charactersToRemoveSpacesBefore=",!?;:).\u2019\u201D]";this.charactersToRemoveSpacesAfter="\xBF\xA1\u2018\u201C(["}},Ca=class extends y{constructor(){super({nameKey:"rules.remove-space-before-or-after-characters.name",descriptionKey:"rules.remove-space-before-or-after-characters.description",type:"Spacing",ruleIgnoreTypes:[g.code,g.math,g.yaml,g.link,g.wikiLink,g.tag]})}get OptionsClass(){return Oa}apply(n,t){let r=mn(t.charactersToRemoveSpacesBefore),i=mn(t.charactersToRemoveSpacesAfter);if(!r&&!i)return n;let a=new RegExp(`([ ])+([${r}])`,"g"),o=new RegExp(`([${i}])([ ])+`,"g"),s=function(c){return c.replace(a,"$2").replace(o,"$1")},l=Oe([g.list,g.html],n,s);return l=zo(l,s),l}get optionBuilders(){return[new ke({nameKey:"rules.remove-space-before-or-after-characters.characters-to-remove-space-before.name",descriptionKey:"rules.remove-space-before-or-after-characters.characters-to-remove-space-before.description",OptionsClass:Oa,optionsKey:"charactersToRemoveSpacesBefore"}),new ke({nameKey:"rules.remove-space-before-or-after-characters.characters-to-remove-space-after.name",descriptionKey:"rules.remove-space-before-or-after-characters.characters-to-remove-space-after.description",OptionsClass:Oa,optionsKey:"charactersToRemoveSpacesAfter"})]}};Ca=S([y.register],Ca);var xs=class{constructor(){this.punctuationToRemove=".,;:!\u3002\uFF0C\uFF1B\uFF1A\uFF01"}},Ma=class extends y{constructor(){super({nameKey:"rules.remove-trailing-punctuation-in-heading.name",descriptionKey:"rules.remove-trailing-punctuation-in-heading.description",type:"Heading",ruleIgnoreTypes:[g.code,g.math,g.yaml]})}get OptionsClass(){return xs}apply(n,t){return n.replaceAll(pn,(r,i="",a="",o="",s="",l="")=>{if(s==""||s.match(Up))return r;let c=s.trimEnd(),u=c.charAt(c.length-1);return t.punctuationToRemove.includes(u)?i+a+o+s.substring(0,c.length-1)+s.subs
`,"").replace(`
---`,""));if(!i)return r;for(let a of wt)if(t.sortAliasKey&&Object.keys(i).includes(a)){r=ae(r,a,be(gn(this.sortArray(Fe(ue(r,a)),t.sortOrder)),t.aliasArrayStyle,t.defaultEscapeCharacter,t.removeUnnecessaryEscapeCharsForMultiLineArrays,!0));break}for(let a of kt)if(t.sortTagKey&&Object.keys(i).includes(a)){r=ae(r,a,be(fn(this.sortArray(Fe(ue(r,a)),t.sortOrder)),t.tagArrayStyle,t.defaultEscapeCharacter,t.removeUnnecessaryEscapeCharsForMultiLineArrays));break}if(t.sortArrayKeys){let a=[...wt,...kt,...t.ignoreSortArrayKeys];for(let o of Object.keys(i)){if(a.includes(o)||!Array.isArray(i[o])||i[o].length!==0&&typeof i[o][0]=="object"&&i[o][0]!==null)continue;let s=ue(r,o),l="single-line";s.includes(`
`)&&(l="multi-line");let c=this.sortArray(Fe(s),t.sortOrder);r=ae(r,o,be(c,l,t.defaultEscapeCharacter,t.removeUnnecessaryEscapeCharsForMultiLineArrays))}}return r})}sortArray(n,t){return n==null||typeof n=="string"||n.length<=1||(n.sort(function(r,i){let a=r.toLowerCase().localeCompare(i.toLowerCase());return a===0?r.localeCompare(i):a}),t==="Ascending Alphabetical")||n.reverse(),n}get optionBuilders(){return[new q({OptionsClass:yt,nameKey:"rules.sort-yaml-array-values.sort-alias-key.name",descriptionKey:"rules.sort-yaml-array-values.sort-alias-key.description",optionsKey:"sortAliasKey"}),new q({OptionsClass:yt,nameKey:"rules.sort-yaml-array-values.sort-tag-key.name",descriptionKey:"rules.sort-yaml-array-values.sort-tag-key.description",optionsKey:"sortTagKey"}),new q({OptionsClass:yt,nameKey:"rules.sort-yaml-array-values.sort-array-keys.name",descriptionKey:"rules.sort-yaml-array-values.sort-array-keys.description",optionsKey:"sortArrayKeys"}),new pe({OptionsClass:yt,nameKey:"rules.sort-yaml-array-values.ignore-keys.name",descriptionKey:"rules.sort-yaml-array-values.ignore-keys.description",optionsKey:"ignoreSortArrayKeys"}),new X({OptionsClass:yt,nameKey:"rules.sort-yaml-array-values.sort-order.name",descriptionKey:"rules.sort-yaml-array-values.sort-order.description",optionsKey:"sortOrder",records:[{value:"Ascending Alphabetical",description:"Sorts the array values from a to z"},{value:"Descending Alphabetical",description:"Sorts the array values from z to a"}]})]}};Ba=S([y.register],Ba);var Qc=class{},Fa=class extends y{constructor(){super({nameKey:"rules.space-after-list-markers.name",descriptionKey:"rules.space-after-list-markers.description",type:"Spacing",ruleIgnoreTypes:[g.code,g.math,g.yaml,g.link,g.wikiLink,g.tag]})}get OptionsClass(){return Qc}apply(n,t){return n=n.replace(/^(\s*\d+\.|\s*[-+*])[^\S\r\n]+/gm,"$1 "),n.replace(/^(\s*\d+\.|\s*[-+*]\s+\[[ xX]\])[^\S\r\n]+/gm,"$1 ")}get optionBuilders(){return[]}};Fa=S([y.register],Fa);var Da=class{constructor(){this.englishNonLetterCharactersAfterCJKCharacters=`-+'"([\xA5$`;this.englishNonLetterCharactersBeforeCJKCharacters=`-+;:'"\xB0%$)]`}},Ra=class extends y{constructor(){super({nameKey:"rules.space-between-chinese-japanese-or-korean-and-english-or-numbers.name",descriptionKey:"rules.space-between-chinese-japanese-or-korean-and-english-or-numbers.description",type:"Spacing",ruleIgnoreTypes:[g.code,g.inlineCode,g.yaml,g.image,g.link,g.wikiLink,g.tag,g.math,g.inlineMath,g.html]})}get OptionsClass(){return Da}apply(n,t){let r=this.buildHeadRegex(t.englishNonLetterCharactersAfterCJKCharacters),i=this.buildTailRegex(t.englishNonLetterCharactersBeforeCJKCharacters),a=`${g.link.placeholder}|${g.inlineMath.placeholder}|${g.inlineCode.placeholder}|${g.wikiLink.placeholder}`.replaceAll("{","\\{").replaceAll("}","\\}"),o=new RegExp(`(\\p{sc=Han}|\\p{sc=Katakana}|\\p{sc=Hiragana}|\\p{sc=Hangul})( *)(${a})`,"gmu"),s=new RegExp(`(${a})( *)(\\p{sc=Han}|\\p{sc=Katakana}|\\p{sc=Hiragana}|\\p{sc=Hangul})`,"gmu"),l=function(u){return u.replace(r,"$1 $3").replace(i,"$1 $3")},c=Oe([g.italics,g.bold],n,l);return c=c.replace(o,"$1 $3").replace(s,"$1 $3"),c=Ap(c,l),c=xp(c,l),c}buildHeadRegex(n){n&&n!==""&&(n=n.replaceAll(/\s/g,""));let t="";return n&&n.length!=0&&(t=`|[${mn(n)}]`),new RegExp(`(\\p{sc=Han}|\\p{sc=Katakana}|\\p{sc=Hiragana}|\\p{sc=Hangul})( *)(\\[[^[]*\\]\\(.*\\)|\`[^\`]*\`|\\w+${t}|\\*[^*])`,"gmu")}buildTailRegex(n){n&&n!==""&&(n=n.replaceAll(/\s/g,""));let t="";return n&&n.length!=0&&(t=`|[${mn(n)}]`),new RegExp(`(\\[[^[]*\\]\\(.*\\)|\`[^\`]*\`|\\w+${t}|[^*]\\*)( *)(\\p{sc=Han}|\\p{sc=Katakana}|\\p{sc=Hiragana}|\\p{sc=Hangul})`,"gmu")}get optionBuilders(){return[new ke({OptionsClass:Da,nameKey:"rules.space-between-chinese-japanese-or-korean-and-english-or-numbers.english-symbols-punctuation-before.name",descriptionKey:"rules.space-between-chinese-japanese-or-korean-and-english-or-numbers.english-symbols-punctuation-before.description",optionsKey:"englishNonLetterCharactersBeforeCJKCharacters"}),new ke({OptionsClass:Da,nameKey:"rules.space-between-chinese-japanese-or-
`)?i+=`${a}:${o}
`:i+=`${a}: ${o}
`,n=Nn(n,a,!1))}return{remainingYaml:n,sortedYamlKeyValues:i}}updateDateModifiedIfYamlChanged(n,t,r,i){return n==t?t:ae(t,r," "+i)}getTextWithNewYamlFrontmatter(n,t,r,i,a,o,s,l){let c=`${i}${r}`;return a&&(c=`${r}${i}`),l&&(c=this.updateDateModifiedIfYamlChanged(t,c,o,s)),n.replace(t,c)}sortAlphabeticallyAsc(n,t){return n=n.toLowerCase(),t=t.toLowerCase(),n<t?-1:t<n?1:0}sortAlphabeticallyDesc(n,t){return n=n.toLowerCase(),t=t.toLowerCase(),n>t?-1:t>n?1:0}get optionBuilders(){return[new pe({OptionsClass:Gt,nameKey:"rules.yaml-key-sort.yaml-key-priority-sort-order.name",descriptionKey:"rules.yaml-key-sort.yaml-key-priority-sort-order.description",optionsKey:"yamlKeyPrioritySortOrder"}),new q({OptionsClass:Gt,nameKey:"rules.yaml-key-sort.priority-keys-at-start-of-yaml.name",descriptionKey:"rules.yaml-key-sort.priority-keys-at-start-of-yaml.description",optionsKey:"priorityKeysAtStartOfYaml"}),new X({OptionsClass:Gt,nameKey:"rules.yaml-key-sort.yaml-sort-order-for-other-keys.name",descriptionKey:"rules.yaml-key-sort.yaml-sort-order-for-other-keys.description",optionsKey:"yamlSortOrderForOtherKeys",records:[{value:"None",description:"No sorting other than what is in the YAML Key Priority Sort Order text area"},{value:"Ascending Alphabetical",description:"Sorts the keys based on key value from a to z"},{value:"Descending Alphabetical",description:"Sorts the keys based on key value from z to a"}]})]}};fr=S([y.register],fr);var Tt=require("obsidian");var tu=Tn(Hm());var _a={ruleConfigs:{},lintOnSave:!1,recordLintOnSaveLogs:!1,displayChanged:!0,lintOnFileChange:!1,displayLintOnFileChangeNotice:!1,settingsConvertedToConfigKeyValues:!1,foldersToIgnore:[],filesToIgnore:[],linterLocale:"system-default",logLevel:"ERROR",lintCommands:[],customRegexes:[],commonStyles:{aliasArrayStyle:"single-line",tagArrayStyle:"single-line",minimumNumberOfDollarSignsToBeAMathBlock:2,escapeCharacter:'"',removeUnnecessaryEscapeCharsForMultiLineArrays:!1}};var ze=class{constructor(){this.dateCreatedKey="date created";this.dateCreated=!0;this.dateCreatedSourceOfTruth="file system";this.dateModifiedSourceOfTruth="file system";this.format="dddd, MMMM Do YYYY, h:mm:ss a";this.dateModified=!0;this.dateModifiedKey="date modified";this.convertToUTC=!1;this.timestampUpdateOnFileContentUpdated="never";this.locale="en"}};S([y.noSettingControl()],ze.prototype,"alreadyModified",2),S([y.noSettingControl()],ze.prototype,"fileCreatedTime",2),S([y.noSettingControl()],ze.prototype,"fileModifiedTime",2),S([y.noSettingControl()],ze.prototype,"locale",2),S([y.noSettingControl()],ze.prototype,"currentTime",2),S([y.noSettingControl()],ze.prototype,"fileName",2);var Zt=class extends y{constructor(){super({nameKey:"rules.yaml-timestamp.name",descriptionKey:"rules.yaml-timestamp.description",type:"YAML",hasSpecialExecutionOrder:!0})}get OptionsClass(){return ze}apply(n,t){let r=t.alreadyModified,i=Bt(n);return r=r||i!==n,t.format=t.format.trimEnd(),he(i,a=>{if(t.dateCreated){let o=!1;[a,o]=this.handleDateCreatedValue(a,t),r=r||o}return t.dateModified&&(a=this.handleDateModifiedValue(a,r,t)),a})}handleDateCreatedValue(n,t){let r=!1,i=`
${t.dateCreatedKey}: [^
]+
`,a=`
${t.dateCreatedKey}:[ ]*
`,o=new RegExp(a),s=new RegExp(i),l=(0,Tt.moment)(t.fileCreatedTime);l.locale(t.locale);let c=t.convertToUTC?l.utc().format(t.format):l.format(t.format),u=`
${t.dateCreatedKey}: ${c}`,d=s.test(n);if(!d&&o.test(n))n=n.replace(o,Xe(u)+`
`),r=!0;else if(d){if(d){let m=this.getYAMLTimestampString(n,s,t.dateCreatedKey),p=(0,tu.default)(m);if(t.dateCreatedSourceOfTruth=="frontmatter"&&t.format!==p){let f=this.parseValueToCurrentFormatIfPossible(m,t.format,t.locale,t.convertToUTC);if(f==null)throw new Error(x("logs.invalid-date-format-error").replace("{DATE}",m).replace("{FILE_NAME}",t.fileName));let b=t.convertToUTC?f.utc().format(t.format):f.format(t.format);if(b!==m){let h=`
${t.dateCreatedKey}: ${b}`;n=n.replace(s,Xe(h)+`
`),r=!0}}else if(t.dateCreatedSourceOfTruth!="frontmatter"){let f=(0,Tt.moment)(m,t.format,t.locale,!0);(f==null||!f.isValid())&&(n=n.replace(s,Xe(u)+`
`),r=!0)}}}else{let m=n.indexOf(`
---`);n=In(n,m,`
${t.dateCreatedKey}: ${c}`),r=!0}return[n,r]}handleDateModifiedValue(n,t,r){let i=`
${r.dateModifiedKey}: [^
]+
`,a=`
${r.dateModifiedKey}:[ ]*
`,o=new RegExp(a),s=new RegExp(i),l=(0,Tt.moment)(r.fileModifiedTime);l.locale(r.locale);let c=r.convertToUTC?r.currentTime.utc().format(r.format):r.currentTime.format(r.format),u=`
${r.dateModifiedKey}: ${c}`,d=s.test(n);if(d){let m=(0,Tt.moment)(this.getYAMLTimestampString(n,s,r.dateModifiedKey),r.format,r.locale,!0);(t||m==null||!m.isValid()||r.dateModifiedSourceOfTruth!="user or Linter edits"&&this.getTimeDifferenceInSeconds(m,l,r)>5)&&(n=n.replace(s,Xe(u)+`
`))}else if(o.test(n))n=n.replace(o,Xe(u)+`
`);else if(!d){let m=n.indexOf(`
---`);n=In(n,m,u)}return n}parseValueToCurrentFormatIfPossible(n,t,r,i){if(n==null)return null;let a=i?Tt.moment.utc(n,t,r,!0):(0,Tt.moment)(n,t,r,!0);if(a!=null&&a.isValid())return a;let o=(0,tu.default)(n);if(o!=null){let s=i?Tt.moment.utc(n,o):(0,Tt.moment)(n,o);s.locale(r);let l=i?s.utc().format(t):s.format(t);return(0,Tt.moment)(l,t,r,!0)}return null}getYAMLTimestampString(n,t,r){return n.match(t)[0].replace(r+":","").trim()}getTimeDifferenceInSeconds(n,t,r){let i=(0,Tt.moment)(t.format(r.format),r.format,r.locale,!0);return Math.abs(n.diff(i,"seconds"))}get optionBuilders(){return[new q({OptionsClass:ze,nameKey:"rules.yaml-timestamp.date-created.name",descriptionKey:"rules.yaml-timestamp.date-created.description",optionsKey:"dateCreated"}),new ke({OptionsClass:ze,nameKey:"rules.yaml-timestamp.date-created-key.name",descriptionKey:"rules.yaml-timestamp.date-created-key.description",optionsKey:"dateCreatedKey"}),new X({OptionsClass:ze,nameKey:"rules.yaml-timestamp.date-created-source-of-truth.name",descriptionKey:"rules.yaml-timestamp.date-created-source-of-truth.description",optionsKey:"dateCreatedSourceOfTruth",records:[{value:"file system",description:"The file system date created value is used to set the value of date created in the frontmatter"},{value:"frontmatter",description:"When a value is present in the frontmatter for date created, this value is used as the value for the date created"}]}),new q({OptionsClass:ze,nameKey:"rules.yaml-timestamp.date-modified.name",descriptionKey:"rules.yaml-timestamp.date-modified.description",optionsKey:"dateModified"}),new ke({OptionsClass:ze,nameKey:"rules.yaml-timestamp.date-modified-key.name",descriptionKey:"rules.yaml-timestamp.date-modified-key.description",optionsKey:"dateModifiedKey"}),new X({OptionsClass:ze,nameKey:"rules.yaml-timestamp.date-modified-source-of-truth.name",descriptionKey:"rules.yaml-timestamp.date-modified-source-of-truth.description",optionsKey:"dateModifiedSourceOfTruth",records:[{value:"file system",description:"The file system date modified value is used to set the value of date modified in the frontmatter"},{value:"user or Linter edits",description:"When a value is present in the frontmatter for date modified, date modified is kept as is unless the user or the Linter makes a change to the file"}]}),new ls({OptionsClass:ze,nameKey:"rules.yaml-timestamp.format.name",descriptionKey:"rules.yaml-timestamp.format.description",optionsKey:"format"}),new q({OptionsClass:ze,nameKey:"rules.yaml-timestamp.convert-to-utc.name",descriptionKey:"rules.yaml-timestamp.convert-to-utc.description",optionsKey:"convertToUTC"}),new X({OptionsClass:ze,nameKey:"rules.yaml-timestamp.update-on-file-contents-updated.name",descriptionKey:"rules.yaml-timestamp.update-on-file-contents-updated.description",optionsKey:"timestampUpdateOnFileContentUpdated",records:[{value:"never",description:"never"},{value:"after 5 seconds",description:"after 5 seconds"},{value:"after 10 seconds",description:"after 10 seconds"},{value:"after 15 seconds",description:"after 15 seconds"},{value:"after 30 seconds",description:"after 30 seconds"},{value:"after 1 minute",description:"after 1 minute"}]})]}};Zt=S([y.register],Zt);var Ct=class{constructor(){this.preserveExistingAliasesSectionStyle=!0;this.keepAliasThatMatchesTheFilename=!1;this.useYamlKeyToKeepTrackOfOldFilenameOrHeading=!0;this.aliasHelperKey=lc;this.aliasArrayStyle="multi-line";this.defaultEscapeCharacter='"';this.removeUnnecessaryEscapeCharsForMultiLineArrays=!1}};S([y.noSettingControl()],Ct.prototype,"aliasArrayStyle",2),S([y.noSettingControl()],Ct.prototype,"fileName",2),S([y.noSettingControl()],Ct.prototype,"defaultEscapeCharacter",2),S([y.noSettingControl()],Ct.prototype,"removeUnnecessaryEscapeCharsForMultiLineArrays",2);var gr=class extends y{constructor(){super({nameKey:"rules.yaml-title-alias.name",descriptionKey:"rules.yaml-title-alias.description",type:"YAML",hasSpecialExecutionOrder:!0})}get OptionsClass(){return Ct}apply(n,t){n=Bt(n);let[r,i]=this.getTitleInfo(n,t.fileName,t.aliasArrayStyle,t.defaultEscapeCharacter),a=nu
`,"").replace(`
---`,""),c=st(o),u=t.aliasHelperKey??lc;u.endsWith(":")&&(u=u.substring(0,u.length-1)),a=c[u]??null,a!=null&&(a=a+"",a=At(a,t.defaultEscapeCharacter,this.forceEscape(a,t.aliasArrayStyle)));let d=null,m=Object.keys(c);for(let p of wt)if(m.includes(p)){d=p;break}if(d!=null){let p=ue(l,d),f="multi-line",b=p==="",h=!1;!p.includes(`
`)&&!(p==="[]"&&t.aliasArrayStyle==="multi-line")&&(p.match(/^\[.*\]/)===null?(f="single string to single-line",h=!0):f="single-line");let k=gn(Fe(p)),A=this.getNewAliasValue(k,s,i,a);A===""?l=Nn(l,d):t.preserveExistingAliasesSectionStyle?!b&&(h&&i==A||!h||k==A)?l=ae(l,d,be(A,f,t.defaultEscapeCharacter,t.removeUnnecessaryEscapeCharsForMultiLineArrays,!0)):l=ae(l,d,be(A,t.aliasArrayStyle,t.defaultEscapeCharacter,t.removeUnnecessaryEscapeCharsForMultiLineArrays,!0)):l=ae(l,d,be(A,t.aliasArrayStyle,t.defaultEscapeCharacter,t.removeUnnecessaryEscapeCharsForMultiLineArrays,!0))}else s||(l=ae(l,sc,be(i,t.aliasArrayStyle,t.defaultEscapeCharacter,t.removeUnnecessaryEscapeCharsForMultiLineArrays,!0)));return!t.useYamlKeyToKeepTrackOfOldFilenameOrHeading||s?l=Nn(l,u):l=ae(l,u,` ${i}`),n=n.replace(`---
${o}---`,`---
${l}---`),n}getTitleInfo(n,t,r,i){let a=Oe([g.code,g.math,g.yaml,g.tag],n,Ho);a=a||t;let o=At(a,i,this.forceEscape(a,r));return[a,o]}forceEscape(n,t){return vo(n)||n.includes(",")&&(t==="single-line"||t==="single string to single-line"||t==="single string comma delimited")}getNewAliasValue(n,t,r,i){if(n==null)return t?"":r;if(typeof n=="string")t?n===r&&(n=""):i===n?n=r:n=[r,n];else if(i!==null){let a=n.indexOf(i);a===-1&&Rr(i)&&(a=n.indexOf(i.substring(1,i.length-1))),a!==-1?t?n.splice(a,1):n[a]=r:n=[r,...n]}else{let a=n.indexOf(r);a!==-1?t&&n.splice(a,1):t||(n=[r,...n])}return n===""||n.length===0?"":n}get optionBuilders(){return[new q({OptionsClass:Ct,nameKey:"rules.yaml-title-alias.preserve-existing-alias-section-style.name",descriptionKey:"rules.yaml-title-alias.preserve-existing-alias-section-style.description",optionsKey:"preserveExistingAliasesSectionStyle"}),new q({OptionsClass:Ct,nameKey:"rules.yaml-title-alias.keep-alias-that-matches-the-filename.name",descriptionKey:"rules.yaml-title-alias.keep-alias-that-matches-the-filename.description",optionsKey:"keepAliasThatMatchesTheFilename"}),new q({OptionsClass:Ct,nameKey:"rules.yaml-title-alias.use-yaml-key-to-keep-track-of-old-filename-or-heading.name",descriptionKey:"rules.yaml-title-alias.use-yaml-key-to-keep-track-of-old-filename-or-heading.description",optionsKey:"useYamlKeyToKeepTrackOfOldFilenameOrHeading"}),new ke({OptionsClass:Ct,nameKey:"rules.yaml-title-alias.alias-helper-key.name",descriptionKey:"rules.yaml-title-alias.alias-helper-key.description",optionsKey:"aliasHelperKey"})]}};gr=S([y.register],gr);var hr=class{constructor(){this.defaultEscapeCharacter='"';this.titleKey="title";this.mode="first-h1-or-filename-if-h1-missing"}};S([y.noSettingControl()],hr.prototype,"fileName",2),S([y.noSettingControl()],hr.prototype,"defaultEscapeCharacter",2);var yr=class extends y{constructor(){super({nameKey:"rules.yaml-title.name",descriptionKey:"rules.yaml-title.description",type:"YAML",hasSpecialExecutionOrder:!0})}get OptionsClass(){return hr}apply(n,t){n=Bt(n);let r="";switch(t.mode){case"filename":r=t.fileName;break;case"first-h1":r=this.getFirstH1Header(n);break;default:r=this.getFirstH1Header(n),r=r||t.fileName}return r=At(r,t.defaultEscapeCharacter),he(n,i=>{let a=`
${t.titleKey}.*
`,o=new RegExp(a);if(o.test(i))i=i.replace(o,Xe(`
${t.titleKey}: ${r}
`));else{let s=i.indexOf(`
---`);i=In(i,s,`
${t.titleKey}: ${r}`)}return i})}getFirstH1Header(n){return Oe([g.code,g.math,g.yaml,g.tag],n,Ho)}get optionBuilders(){return[new ke({OptionsClass:hr,nameKey:"rules.yaml-title.title-key.name",descriptionKey:"rules.yaml-title.title-key.description",optionsKey:"titleKey"}),new X({OptionsClass:hr,nameKey:"rules.yaml-title.mode.name",descriptionKey:"rules.yaml-title.mode.description",optionsKey:"mode",records:[{value:"first-h1-or-filename-if-h1-missing",description:"Uses the first H1 in the file or the filename of the file if there is not H1"},{value:"filename",description:"Uses the filename as the title"},{value:"first-h1",description:"Uses the first H1 in the file as the title"}]})]}};yr=S([y.register],yr);var AA=`<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-file-cog">
<circle cx="6" cy="13" r="3"/>
<path d="m9.7 14.4-.9-.3"/>
<path d="m3.2 11.9-.9-.3"/>
<path d="m4.6 16.7.3-.9"/>
<path d="m7.6 16.7-.4-1"/>
<path d="m4.8 10.3-.4-1"/>
<path d="m2.3 14.6 1-.4"/>
<path d="m8.7 11.8 1-.4"/>
<path d="m7.4 9.3-.3.9"/>
<path d="M14 2v6h6"/>
<path d="M4 5.5V4a2 2 0 0 1 2-2h8.5L20 7.5V20a2 2 0 0 1-2 2H6a2 2 0 0 1-2-1.5"/>
</svg>`,xA=`<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-folder-cog">
<circle cx="18" cy="18" r="3"/>
<path d="M10.5 20H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H20a2 2 0 0 1 2 2v3.5"/>
<path d="m21.7 19.4-.9-.3"/>
<path d="m15.2 16.9-.9-.3"/>
<path d="m16.6 21.7.3-.9"/>
<path d="m19.1 15.2.3-.9"/>
<path d="m19.6 21.7-.4-1"/>
<path d="m16.8 15.3-.4-1"/>
<path d="m14.3 19.6 1-.4"/>
<path d="m20.7 16.8 1-.4"/>
</svg>`,SA=`<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-server-cog">
<circle cx="12" cy="12" r="3"/><path d="M4.5 10H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v4a2 2 0 0 1-2 2h-.5"/>
<path d="M4.5 14H4a2 2 0 0 0-2 2v4a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-4a2 2 0 0 0-2-2h-.5"/>
<path d="M6 6h.01"/><path d="M6 18h.01"/>
<path d="m15.7 13.4-.9-.3"/>
<path d="m9.2 10.9-.9-.3"/>
<path d="m10.6 15.7.3-.9"/>
<path d="m13.6 15.7-.4-1"/>
<path d="m10.8 9.3-.4-1"/>
<path d="m8.3 13.6 1-.4"/>
<path d="m14.7 10.8 1-.4"/>
<path d="m13.4 8.3-.3.9"/>
</svg>`,LA=`<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-pilcrow">
<path d="M13 4v16"/>
<path d="M17 4v16"/>
<path d="M19 4H9.5a4.5 4.5 0 0 0 0 9H13"/>
</svg>`,EA=`<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-function-square">
<rect width="18" height="18" x="3" y="3" rx="2" ry="2"/>
<path d="M9 17c2 0 2.8-1 2.8-2.8V10c0-2 1-3.3 3.2-3"/>
<path d="M9 11.2h5.7"/>
</svg>`,TA=`<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-gantt-chart-square">
<rect width="18" height="18" x="3" y="3" rx="2"/>
<path d="M9 8h7"/>
<path d="M8 12h6"/>
<path d="M11 16h5"/>
</svg>`,CA=`<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-clipboard-list">
<rect width="8" height="4" x="8" y="2" rx="1" ry="1"/>
<path d="M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2"/>
<path d="M12 11h4"/>
<path d="M12 16h4"/>
<path d="M8 11h.01"/>
<path d="M8 16h.01"/>
</svg>`,OA=`<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-book-plus">
<path d="M4 19.5v-15A2.5 2.5 0 0 1 6.5 2H20v20H6.5a2.5 2.5 0 0 1 0-5H20"/>
<path d="M9 10h6"/>
<path d="M12 7v6"/>
</svg>`,MA=`<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-heading-1">
<path d="M4 12h8"/>
<path d="M4 18V6"/>
<path d="M12 18V6"/>
<path d="m17 12 3-2v8"/>
</svg>`,IA=`<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-superscript">
<path d="m4 19 8-8"/>
<path d="m12 19-8-8"/>
<path d="M20 12h-4c0-1.5.442-2 1.5-2.5S20 8.334 20 7.002c0-.472-.17-.93-.484-1.29a2.105 2.105 0 0 0-2.617-.436c-.42.239-.738.614-.899 1.06"/>
</svg>`,BA=`<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-file-code-2">
<path d="M4 22h14a2 2 0 0 0 2-2V7.5L14.5 2H6a2 2 0 0 0-2 2v4"/>
<polyline points="14 2 14 8 20 8"/>
<path d="m9 18 3-3-3-3"/>
<path d="m5 12-3 3 3 3"/>
</svg>`,FA=`<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-settings">
<path d="M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z"/>
<circle cx="12" cy="12" r="3"/>
</svg>`,RA=`<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-bug-play">
<path d="m8 2 1.88 1.88"/>
<path d="M14.12 3.88 16 2"/>
<path d="M9 7.13v-1a3.003 3.003 0 1 1 6 0v1"/>
<path d="M18 11a4 4 0 0 0-4-4h-4a4 4 0 0 0-4 4v3a6.1 6.1 0 0 0 2 4.5"/>
<path d="M6.53 9C4.6 8.8 3 7.1 3 5"/>
<path d="M6 13H2"/>
<path d="M3 21c0-2.1 1.7-3.9 3.8-4"/>
<path d="M20.97 5c0 2.1-1.6 3.8-3.5 4"/>
<path d="m12 12 8 5-8 5Z"/>
</svg>`,DA=`<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-clipboard">
<rect width="8" height="4" x="8" y="2" rx="1" ry="1"/>
<path d="M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2"/>
</svg>`,zA=`<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="lucide lucide-check">
<polyline points="20 6 9 17 4 12"/>
</svg>`,Me={folder:{id:"lint-folder",source:xA},file:{id:"lint-file",source:AA},vault:{id:"lint-vault",source:SA},whitespace:{id:"lint-whitespace",source:LA},math:{id:"lint-math",source:EA},content:{id:"lint-content",source:TA},paste:{id:"lint-paste",source:CA},custom:{id:"lint-custom",source:OA},heading:{id:"lint-heading",source:MA},footer:{id:"lint-footer",source:IA},yaml:{id:"lint-yaml",source:BA},general:{id:"lint-general",source:FA},debug:{id:"lint-debug",source:RA},clipboard:{id:"linter-clipboard",source:DA},success:{id:"linter-success",source:zA}};var Gr=require("obsidian");var Bs=class{constructor(){this.disabledRules=[]}lintText(n){this.skipFile=!1;let t=n.oldText;if([this.disabledRules,this.skipFile]=as(t),this.skipFile)return t;Mn(x("logs.rule-running"));let r=x("logs.pre-rules");Mn(r);let i=this.runBeforeRegularRules(n);rn(r);let a=!1;for(let l of n.settings.ruleConfigs["auto-correct-common-misspellings"]["extra-auto-correct-files"]??[])if(l.filePath!=""){a=!0;break}let o=x("logs.disabled-text");for(let l of Ft){if(this.disabledRules.includes(l.alias)){nt(l.alias+" "+o);continue}else if(l.hasSpecialExecutionOrder||l.type==="Paste")continue;if(l.alias==="auto-correct-common-misspellings"&&a){let c=!1;for(let u of n.settings.ruleConfigs["auto-correct-common-misspellings"]["extra-auto-correct-files"]??[])if(u.filePath==n.fileInfo.path){c=!0;break}if(c){nt(l.alias+" "+o);continue}}[i]=An.applyIfEnabledBase(l,i,n.settings,{fileCreatedTime:n.fileInfo.createdAtFormatted,fileModifiedTime:n.fileInfo.modifiedAtFormatted,fileName:n.fileInfo.name,locale:n.momentLocale,minimumNumberOfDollarSignsToBeAMathBlock:n.settings.commonStyles.minimumNumberOfDollarSignsToBeAMathBlock,aliasArrayStyle:n.settings.commonStyles.aliasArrayStyle,tagArrayStyle:n.settings.commonStyles.tagArrayStyle,defaultEscapeCharacter:n.settings.commonStyles.escapeCharacter,removeUnnecessaryEscapeCharsForMultiLineArrays:n.settings.commonStyles.removeUnnecessaryEscapeCharsForMultiLineArrays})}let s=x("logs.custom-regex");return Mn(s),i=this.runCustomRegexReplacement(n.settings.customRegexes,i),rn(s),n.oldText=i,this.runAfterRegularRules(t,n)}runBeforeRegularRules(n){let t=n.oldText;return[t]=nr.applyIfEnabled(t,n.settings,this.disabledRules),[t]=er.applyIfEnabled(t,n.settings,this.disabledRules,{defaultEscapeCharacter:n.settings.commonStyles.escapeCharacter}),[t]=rr.applyIfEnabled(t,n.settings,this.disabledRules,{minimumNumberOfDollarSignsToBeAMathBlock:n.settings.commonStyles.minimumNumberOfDollarSignsToBeAMathBlock}),[t]=Gn.applyIfEnabled(t,n.settings,this.disabledRules,{misspellingToCorrection:n.defaultMisspellings}),t}runAfterRegularRules(n,t){let r=t.oldText,i=x("logs.post-rules");Mn(i),[r]=Jn.applyIfEnabled(r,t.settings,this.disabledRules),[r]=yr.applyIfEnabled(r,t.settings,this.disabledRules,{fileName:t.fileInfo.name,defaultEscapeCharacter:t.settings.commonStyles.escapeCharacter}),[r]=gr.applyIfEnabled(r,t.settings,this.disabledRules,{fileName:t.fileInfo.name,aliasArrayStyle:t.settings.commonStyles.aliasArrayStyle,defaultEscapeCharacter:t.settings.commonStyles.escapeCharacter,removeUnnecessaryEscapeCharsForMultiLineArrays:t.settings.commonStyles.removeUnnecessaryEscapeCharsForMultiLineArrays}),[r]=Zn.applyIfEnabled(r,t.settings,this.disabledRules),[r]=tr.applyIfEnabled(r,t.settings,this.disabledRules,{defaultEscapeCharacter:t.settings.commonStyles.escapeCharacter}),[r]=mr.applyIfEnabled(r,t.settings,this.disabledRules);let a=t.getCurrentTime(),o;[r,o]=Zt.applyIfEnabled(r,t.settings,this.disabledRules,{fileCreatedTime:t.fileInfo.createdAtFormatted,fileModifiedTime:t.fileInfo.modifiedAtFormatted,currentTime:a,alreadyModified:n!=r,locale:t.momentLocale});let s=Zt.getRuleOptions(t.settings);return a=t.getCurrentTime(),s.convertToUTC&&(a=a.utc()),[r]=fr.applyIfEnabled(r,t.settings,this.disabledRules,{currentTimeFormatted:a.format(s.format.trimEnd()),yamlTimestampDateModifiedEnabled:o&&s.dateModified,dateModifiedKey:s.dateModifiedKey}),rn(i),rn(x("logs.rule-running")),r}runCustomCommands(n,t){if(this.skipFile)return;nt(x("logs.running-custom-lint-command
`),c+=`/${o.find}/${o.flags}/${o.replace}/`,nt(c);let u=new RegExp(`${o.find}`,o.flags);i=i.replace(u,Td(o.replace)),a!=i&&nt(i),a=i}return i})}runPasteLint(n,t,r){let i=r.oldText;return[i]=lr.applyIfEnabled(i,r.settings,[]),[i]=dr.applyIfEnabled(i,r.settings,[]),[i]=ur.applyIfEnabled(i,r.settings,[]),[i]=or.applyIfEnabled(i,r.settings,[]),[i]=cr.applyIfEnabled(i,r.settings,[]),[i]=ir.applyIfEnabled(i,r.settings,[],{lineContent:n,selectedText:t}),[i]=ar.applyIfEnabled(i,r.settings,[],{lineContent:n,selectedText:t}),[i]=Qn.applyIfEnabled(i,r.settings,[],{lineContent:n}),i}runYAMLTimestampByItself(n){let t=n.oldText,r=n.getCurrentTime();return[t]=Zt.applyIfEnabled(t,n.settings,this.disabledRules,{fileCreatedTime:n.fileInfo.createdAtFormatted,fileModifiedTime:n.fileInfo.modifiedAtFormatted,currentTime:r,alreadyModified:!0,locale:n.momentLocale}),t}};function Zr(e,n=null,t,r,i){let a=n&&n.stat.ctime!==0?(0,Gr.moment)(n.stat.ctime):(0,Gr.moment)();a.locale(t);let o=n?(0,Gr.moment)(n.stat.mtime):(0,Gr.moment)();o.locale(t);let s=o.format(),l=a.format();return{oldText:e,fileInfo:{name:n?n.basename:"",createdAtFormatted:l,modifiedAtFormatted:s,path:n?n.path:""},settings:r,momentLocale:t,getCurrentTime:()=>{let c=(0,Gr.moment)();return c.locale(t),c},defaultMisspellings:i}}var Fs=require("obsidian");var Ya=class extends Fs.Modal{constructor(n,t,r,i,a,o=!1){super(n),this.modalEl.addClass("confirm-modal"),this.contentEl.createEl("h3",{text:x("warning-text"),cls:"modal-heading"}),o&&this.contentEl.createEl("p",{text:x("custom-command-warning"),cls:"modal-warn"}),this.contentEl.createEl("p",{text:t+" "+x("file-backup-text")}).id="confirm-dialog",this.contentEl.createDiv("modal-button-container",s=>{s.createEl("button",{text:x("cancel-button-text")}).addEventListener("click",()=>this.close());let l=s.createEl("button",{attr:{type:"submit"},cls:"mod-cta",text:r});l.addEventListener("click",async c=>{new Fs.Notice(i),this.close(),await a()}),setTimeout(()=>{l.focus()},50)})}};var Ua=require("obsidian");var Rs=require("obsidian");var KA={General:Me.general.id,Custom:Me.custom.id,YAML:Me.yaml.id,Heading:Me.heading.id,Footnote:Me.footer.id,Content:Me.content.id,Spacing:Me.whitespace.id,Paste:Me.paste.id,Debug:Me.debug.id},NA={General:"tabs.names.general",Custom:"tabs.names.custom",YAML:"tabs.names.yaml",Heading:"tabs.names.heading",Footnote:"tabs.names.footnote",Content:"tabs.names.content",Spacing:"tabs.names.spacing",Paste:"tabs.names.paste",Debug:"tabs.names.debug"},Dt=class{constructor(n,t,r,i,a){this.name=r;this.isMobile=i;this.plugin=a;this.searchSettingInfo=[];this.navButton=n.createDiv("linter-navigation-item");let o="linter-desktop";i&&(o="linter-mobile"),this.navButton.addClass(o),(0,Rs.setIcon)(this.navButton.createSpan({cls:"linter-navigation-item-icon"}),KA[r]);let s=x(NA[r]);this.navButton.createSpan().setText(s),this.contentEl=t.createDiv("linter-tab-settings"),this.contentEl.id=r.toLowerCase().replace(" ","-"),this.headingEl=new Rs.Setting(this.contentEl).setName(s).setHeading().nameEl,Ee(this.headingEl)}addSettingSearchInfo(n,t="",r="",i=null,a=null){this.searchSettingInfo.push({containerEl:n,name:t.toLowerCase(),description:r.toLowerCase(),options:i,alias:a})}addSettingSearchInfoForGeneralSettings(n){this.searchSettingInfo.push({containerEl:n.containerEl,name:n.name.toLowerCase(),description:n.description.toLowerCase(),options:null,alias:null})}updateTabDisplayMode(n,t="the status is still the same"){switch(n?(this.navButton.addClass("linter-navigation-item-selected"),Ne(this.contentEl)):(this.navButton.removeClass("linter-navigation-item-selected"),Ee(this.contentEl)),t){case"entering search mode by focusing on the search input box":Ne(this.contentEl),Ne(this.headingEl);for(let r of this.searchSettingInfo)Ne(r.containerEl);break;case"leaving search mode by selecting a tab":Ee(this.headingEl);for(let r of this.searchSettingInfo)Ne(r.containerEl);break}}};var Zm=require("obsidian");var qm=require("obsidian");var Sn=class{constructor(n,t,r,i,a,o=null){this.containerEl=n;this.keyToUpdate=i;this.plugin=a;this.beforeSave=o;th
`," "));let k=this.contentEl.createDiv(),A=new Ks(k,this.plugin.settings.filesToIgnore,this.app,()=>{this.plugin.saveSettings()});this.addSettingSearchInfo(k,A.name,A.description.replaceAll(`
`," "))}};var Qm=require("obsidian"),_s=class extends Dt{constructor(t,r,i,a,o,s){super(t,r,i,o,s);this.rules=a;this.display()}display(){for(let t of this.rules){let r=this.contentEl.createDiv();r.id=t.alias,new Qm.Setting(r).setHeading().nameEl.createEl("a",{href:t.getURL(),text:t.getName()});let i=[],a=!0,o=!1;for(let s of t.options)s.display(r,this.plugin.settings,this.plugin),i.push(s.getSearchInfo()),a?(a=!1,s instanceof kn&&(o=!this.plugin.settings.ruleConfigs[s.ruleAlias][s.configKey])):o&&s.hide();this.addSettingSearchInfo(r,t.getName().toLowerCase(),t.getDescription().toLowerCase(),i,r.id)}}};var Xm=require("obsidian");var Ha=class extends bn{constructor(t,r,i=[]){super(t,r);this.app=t;this.inputEl=r;this.valuesToExclude=i}getSuggestions(t){let r=this.app.commands.listCommands();if(!r)return[];let i=r.filter(s=>{for(let l of this.valuesToExclude)if(l.id==s.id&&!(this.inputEl.hasAttribute("commandId")&&this.inputEl.getAttribute("commandId")==s.id))return!1;return!0}),a=[],o=t.toLowerCase();return i.forEach(s=>{(s.id.contains(o)||s.name.toLowerCase().contains(o))&&a.push(s)}),a}renderSuggestion(t,r){r.setText(t.name)}selectSuggestion(t){this.inputEl.value=t.name,this.inputEl.setAttribute("commandId",t.id),this.inputEl.trigger("input"),this.close()}};var Ys=class extends Kt{constructor(t,r,i,a){super(t,x("options.custom-command.name"),x("options.custom-command.description"),x("options.custom-command.warning"),x("options.custom-command.add-input-button-text"),i,a,()=>{let o={id:"",name:""};this.lintCommands.push(o),this.saveSettings(),this.addCommand(o,this.lintCommands.length-1,!0)});this.lintCommands=r;this.display()}showInputEls(){this.lintCommands.forEach((t,r)=>{this.addCommand(t,r)})}addCommand(t,r,i=!1){new Xm.Setting(this.inputElDiv).addSearch(a=>{new Ha(this.app,a.inputEl,this.lintCommands),a.setPlaceholder(x("options.custom-command.command-search-placeholder-text")).setValue(t.name).onChange(o=>{let s={id:a.inputEl.getAttribute("commandId"),name:o};s.name&&s.id?(this.lintCommands[r]=s,this.saveSettings()):!s.name&&!s.id&&(this.lintCommands[r]=s,this.saveSettings())}),a.inputEl.setAttr("tabIndex",r),a.inputEl.addClass("linter-custom-command"),i&&a.inputEl.focus()}).addExtraButton(a=>{a.setIcon("up-chevron-glyph").setTooltip(x("options.custom-command.move-up-tooltip")).onClick(()=>{this.arrayMove(r,r-1),this.saveSettings(),this.resetInputEls()})}).addExtraButton(a=>{a.setIcon("down-chevron-glyph").setTooltip(x("options.custom-command.move-down-tooltip")).onClick(()=>{this.arrayMove(r,r+1),this.saveSettings(),this.resetInputEls()})}).addExtraButton(a=>{a.setIcon("cross").setTooltip(x("options.custom-command.delete-tooltip")).onClick(()=>{this.lintCommands.splice(r,1),this.saveSettings(),this.resetInputEls()})})}arrayMove(t,r){if(r<0||r===this.lintCommands.length)return;let i=this.lintCommands[t];this.lintCommands[t]=this.lintCommands[r],this.lintCommands[r]=i}};var nu=require("obsidian");var YA="gm",Ps=class extends Kt{constructor(t,r,i,a){super(t,x("options.custom-replace.name"),x("options.custom-replace.description"),x("options.custom-replace.warning"),x("options.custom-replace.add-input-button-text"),i,a,()=>{let o={label:"",find:"",replace:"",flags:YA};this.regexes.push(o),this.saveSettings(),this.addRegex(o,this.regexes.length-1,!0)});this.regexes=r;this.display(),this.inputElDiv.addClass("linter-custom-regex-replacement-container")}showInputEls(){this.regexes.forEach((t,r)=>{this.addRegex(t,r)})}addRegex(t,r,i=!1){let a=this.inputElDiv.createDiv({cls:"linter-custom-regex-replacement"}),o=a.createDiv(),s=new nu.Setting(o).addText(u=>{u.setPlaceholder(x("options.custom-replace.label-placeholder-text")).setValue(t.label).onChange(d=>{this.regexes[r].label=d,this.saveSettings()}),u.inputEl.setAttr("inputIndex",r),u.inputEl.addClass("linter-custom-regex-replacement-label-input"),i&&u.inputEl.focus()});s.controlEl.addClass("linter-custom-regex-replacement-label"),s.descEl.remove(),s.infoEl.remove(),s.nameEl.remove();let l=a.createDiv();new nu.Setting(l).addText(u=>{u.setPlaceholder(x("options.custom-replace.
`," ")+r.warning.replaceAll(`
`," "));let i=this.contentEl.createDiv(),a=new Ps(i,this.plugin.settings.customRegexes,this.app,()=>{this.plugin.saveSettings()});this.addSettingSearchInfo(i,a.name,a.description.replaceAll(`
`," ")+a.warning.replaceAll(`
`," "))}};var Jm=require("obsidian");var qs=class{constructor(n,t,r,i){this.containerEl=n;this.searchZeroState=t;this.tabNameToTab=r;this.onFocus=i;this.searchSettingInfo=new Map;for(let[a,o]of r)this.searchSettingInfo.set(a,o.searchSettingInfo);this.display()}display(){let n=new Jm.Setting(this.containerEl);n.settingEl.addClass("linter-no-border"),n.addSearch(t=>{this.search=t}),this.search.setPlaceholder(x("tabs.default-search-bar-text")),this.search.inputEl.onfocus=()=>{this.onFocus()},this.search.onChange(t=>{this.searchSettings(t.toLowerCase())})}searchSettings(n){let t=new Set,r=function(i,a){Ne(i),t.has(a)||t.add(a)};for(let[i,a]of this.searchSettingInfo)for(let o of a)if(n.trim()===""||o.alias?.includes(n)||o.description.includes(n)||o.name.includes(n))r(o.containerEl,i);else if(o.options)for(let s of o.options){if(s.description.toLowerCase().includes(n)||s.name.toLowerCase().includes(n)){r(o.containerEl,i);break}else if(s.options){for(let l of s.options)if(l.description.toLowerCase().includes(n)||l.value.toLowerCase().includes(n)){r(o.containerEl,i);break}}Ee(o.containerEl)}else Ee(o.containerEl);for(let[i,a]of this.tabNameToTab)t.has(i)?Ne(a.headingEl):Ee(a.headingEl);t.size===0?Ne(this.searchZeroState):Ee(this.searchZeroState)}focusOnInput(){this.search.inputEl.focus()}};var ef=Tn(ao());var Qr=require("obsidian");var qa=class{constructor(n,t,r,i=!0){this.containerEl=n;this.name=t;this.description=r;this.disabled=i;this.display()}display(){this.settingEl=this.containerEl.createDiv();let n=this.settingEl.createDiv("setting-item-info");this.nameEl=n.createDiv("setting-item-name"),this.nameEl.setText(this.name),this.descEl=n.createDiv("setting-item-description"),this.descEl.setText(this.description),this.inputContainerEl=this.settingEl.createDiv("full-width-textbox-input-wrapper"),this.inputContainerEl.onmouseover=()=>{this.getInput().trim()!=""&&this.copyEl.removeClass("linter-visually-hidden")},this.inputContainerEl.onmouseleave=()=>{this.copyEl.addClass("linter-visually-hidden")},this.inputEl=this.inputContainerEl.createEl("textarea",{cls:"full-width"}),this.inputEl.spellcheck=!1,this.inputEl.disabled=this.disabled,this.copyEl=this.inputContainerEl.createDiv({cls:"settings-copy-button linter-visually-hidden ",attr:{"aria-label":x("copy-aria-label")}}),this.copyIconEl=this.copyEl.createSpan(),(0,Qr.setIcon)(this.copyIconEl,"linter-clipboard"),this.copyIconEl.onclick=()=>{this.handleCopy(this.copyIconEl)}}getInput(){return this.inputEl.value}handleCopy(n){navigator.clipboard.writeText(this.getInput()).then(()=>{(0,Qr.setIcon)(n,"linter-success"),setTimeout(()=>{(0,Qr.setIcon)(n,"linter-clipboard")},1500)},t=>{new Qr.Notice(`${x("notice-text.copy-to-clipboard-failed")+t}`,0)})}hide(){Ee(this.settingEl)}unhide(){Ne(this.settingEl)}};var PA=Object.keys(ef.default.levels),Us=class extends Dt{constructor(n,t,r,i){super(n,t,"Debug",r,i),this.display()}display(){let n=this.contentEl.createDiv(),t={isForEnum:!0,values:PA,descriptions:[]};this.addSettingSearchInfoForGeneralSettings(new Qt(n,"tabs.debug.log-level.name","tabs.debug.log-level.description","logLevel",this.plugin,t,async()=>{uo(this.plugin.settings.logLevel)})),n=this.contentEl.createDiv();let r=x("tabs.debug.linter-config.name"),i=x("tabs.debug.linter-config.description");new qa(n,r,i).inputEl.setText(JSON.stringify(this.plugin.settings,null,2)),this.addSettingSearchInfo(n,r,i);let o=null;n=this.contentEl.createDiv();let s=new zt(n,"tabs.debug.log-collection.name","tabs.debug.log-collection.description","recordLintOnSaveLogs",this.plugin,l=>{l?o.unhide():o.hide()});this.addSettingSearchInfoForGeneralSettings(s),n=this.contentEl.createDiv(),r=x("tabs.debug.linter-logs.name"),i=x("tabs.debug.linter-logs.description"),o=new qa(n,r,""),o.inputEl.setText(so.join(`
`)),rt(i,o.descEl),s.getBoolean()||o.hide(),this.addSettingSearchInfo(n,r,i)}};var Ws=class extends Ua.PluginSettingTab{constructor(t,r){super(t,r);this.plugin=r;this.tabNameToTab=new Map;this.selectedTab="General"}display(){let{containerEl:t}=this;t.empty();let r=t.createDiv("linter-setting-title");Ua.Platform.isMobile?r.addClass("linter-mobile"):r.createEl("h1").setText(x("linter-title")),this.navContainer=t.createEl("nav",{cls:"linter-setting-header"}),this.tabNavEl=this.navContainer.createDiv("linter-setting-tab-group"),this.settingsContentEl=t.createDiv("linter-setting-content"),this.addTabs(Ua.Platform.isMobile),this.createSearchZeroState(),this.generateSearchBar(r),this.selectedTab==""&&this.tabSearcher.focusOnInput()}addTabs(t){this.addTab(new Ns(this.tabNavEl,this.settingsContentEl,t,this.plugin,this.app));for(let r of Object.values(z))this.addTab(new _s(this.tabNavEl,this.settingsContentEl,r,jn.get(r),t,this.plugin));this.addTab(new Hs(this.tabNavEl,this.settingsContentEl,t,this.app,this.plugin)),this.addTab(new Us(this.tabNavEl,this.settingsContentEl,t,this.plugin))}generateSearchBar(t){this.tabSearcher=new qs(t,this.searchZeroState,this.tabNameToTab,()=>{for(let r of this.tabNameToTab.values()){r.updateTabDisplayMode(!1,"entering search mode by focusing on the search input box");let i=this.tabSearcher.search.getValue();this.selectedTab==""&&i.trim()!=""&&this.tabSearcher.searchSettings(i.toLowerCase()),this.selectedTab=""}})}createSearchZeroState(){this.searchZeroState=this.settingsContentEl.createDiv({cls:"search-zero-state"}),Ee(this.searchZeroState),this.searchZeroState.createEl("p",{text:x("empty-search-results-text")})}addTab(t){t.navButton.onclick=()=>{this.onTabClick(t.name)},t.updateTabDisplayMode(this.selectedTab===t.name,"the status is still the same"),this.tabNameToTab.set(t.name,t)}onTabClick(t){if(this.selectedTab!==t){if(this.selectedTab=="")for(let[r,i]of this.tabNameToTab)i.updateTabDisplayMode(r===t,"leaving search mode by selecting a tab");else Ee(this.searchZeroState),this.tabNameToTab.get(t).updateTabDisplayMode(!0),this.tabNameToTab.get(this.selectedTab).updateTabDisplayMode(!1);this.selectedTab=t}}};var nf=require("obsidian");var HA=/^---\n/gm,tf=`${Br}:`,Vs=class extends nf.EditorSuggest{constructor(t){super(t.app);this.plugin=t;this.inline=!1;let r=x("all-rules-option");this.ruleInfo=[{displayName:r,name:r.toLowerCase(),alias:"all"}];for(let i of Ft){let a=i.getName();this.ruleInfo.push({displayName:a,name:a.toLowerCase(),alias:i.alias})}}onTrigger(t,r,i){let a=r.getLine(t.line).toLowerCase();if(a.startsWith(tf)||this.disabledRulesIsEndOfStartOfFileToCursor(r.getRange({line:0,ch:0},t))){this.inline=a.startsWith(tf);let s=r.getLine(t.line).substring(0,t.ch),l=s.match(/(\S+)$/)?.first().replaceAll("[","").replaceAll("]","");if(l)return{end:t,start:{ch:s.lastIndexOf(l),line:t.line},query:l}}return null}getSuggestions(t){let[r,i]=as(t.editor.getValue());if(i)return[];let a=t.query.toLowerCase();return this.ruleInfo.filter(s=>(s.name.contains(a)||s.alias.contains(a))&&!r.includes(s.alias))}renderSuggestion(t,r){r.addClass("mod-complex");let i=r.createDiv({cls:"suggestion-content"});i.createDiv({cls:"suggestion-title"}).setText(`${t.displayName}`),i.createDiv({cls:"suggestion-note"}).setText(`${t.alias}`)}selectSuggestion(t){if(this.context){let r=t.alias;this.inline?r=`${r},`:r=`${r}
-`,this.context.editor.replaceRange(`${r} `,this.context.start,this.context.end)}}disabledRulesIsEndOfStartOfFileToCursor(t){if(!t||!t.length||t.match(HA)?.length!=1)return!1;let r=ue(t+`
`,Br)?.trimEnd();return r===null?!1:t.trimEnd().endsWith(r)}};var uf=Tn(sf()),df=Tn(ao());var br=require("obsidian");var iu="default-misspellings.md",ru=`https://raw.githubusercontent.com/platers/obsidian-linter/refs/heads/master/src/utils/${iu}`;async function lf(e,n){let t=e.app,r=e.manifest.dir??"",i=(0,br.normalizePath)(r+"/"+iu);if(await t.vault.adapter.exists(i))return;let a=new br.Notice(x("rules.auto-correct-common-misspellings.default-install")),o;try{o=await(0,br.requestUrl)(ru)}catch(s){lo(x("rules.auto-correct-common-misspellings.default-install-failed").replace("{URL}",ru),s)}if(!o||o.status!==200){let s=x("rules.auto-correct-common-misspellings.default-install-failed").replace("{URL}",ru)+x("logs.see-console");await n(s);return}await t.vault.adapter.exists(r)||await t.vault.adapter.mkdir(r),await t.vault.adapter.writeBinary(i,o.arrayBuffer),a.hide()}async function cf(e){let n=e.app,t=e.manifest.dir??"",r=(0,br.normalizePath)(t+"/"+iu);return await n.vault.adapter.exists(r)?await n.vault.adapter.read(r):(pt(x("rules.auto-correct-common-misspellings.defaults-missing").replace("{FILE}",r)),"")}var qA={en:"en-gb",zh:"zh-cn","zh-TW":"zh-tw",ru:"ru",ko:"ko",it:"it",id:"id",ro:"ro","pt-BR":"pt-br",cz:"cs",da:"da",de:"de",es:"es",fr:"fr",no:"nn",pl:"pl",pt:"pt",tr:"tr",hi:"hi",nl:"nl",ar:"ar",ja:"ja"},Xt=0,$s=class extends J.Plugin{constructor(){super(...arguments);this.eventRefs=[];this.isEnabled=!0;this.rulesRunner=new Bs;this.overridePaste=!1;this.hasCustomCommands=!1;this.customCommandsLock=new uf.default;this.originalSaveCallback=null;this.editorLintFiles=[];this.fileLintFiles=new Set;this.customCommandsCallback=null;this.currentlyOpeningSidebar=!1;this.activeFileChangeDebouncer=new Map;this.defaultAutoCorrectMisspellings=new Map;this.hasLoadedMisspellingFiles=!1}async onload(){Om(),fo(window.localStorage.getItem("language")),nn(x("logs.plugin-load")),this.isEnabled=!0;for(let t in Me){let r=Me[t];(0,J.addIcon)(r.id,r.source)}await this.loadSettings(),this.addCommands(),this.registerEventsAndSaveCallback(),this.registerEditorSuggest(new Vs(this)),this.settingsTab=new Ws(this.app,this),this.addSettingTab(this.settingsTab)}async onunload(){nn(x("logs.plugin-unload")),this.isEnabled=!1;for(let r of this.eventRefs)this.app.workspace.offref(r);let t=this.app.commands?.commands?.["editor:save-file"];t&&t.callback&&this.originalSaveCallback&&(t.callback=this.originalSaveCallback)}async loadSettings(){let t=await this.loadData();this.settings=Object.assign({},_a,t),typeof this.settings.logLevel=="number"&&(this.settings.logLevel=Ju(this.settings.logLevel)),uo(this.settings.logLevel),await this.setOrUpdateMomentInstance(),this.updatePasteOverrideStatus(),this.updateHasCustomCommandStatus()}async saveSettings(){this.hasLoadedMisspellingFiles||await this.loadAutoCorrectFiles(!1),await this.saveData(this.settings),this.updatePasteOverrideStatus(),this.updateHasCustomCommandStatus()}addCommands(){let t=this;this.addCommand({id:"lint-file",name:x("commands.lint-file.name"),editorCheckCallback(r,i,a){if(r)return t.isMarkdownFile(a.file)&&i.cm!=null;t.runLinterEditor(i)},icon:Me.file.id}),this.addCommand({id:"lint-file-unless-ignored",name:x("commands.lint-file-unless-ignored.name"),editorCheckCallback(r,i,a){if(r)return t.isMarkdownFile(a.file);!t.shouldIgnoreFile(a.file)&&i.cm&&t.runLinterEditor(i)},icon:Me.file.id}),this.addCommand({id:"lint-all-files",name:x("commands.lint-all-files.name"),icon:Me.vault.id,callback:()=>{let r=x("commands.lint-all-files.start-message"),i=x("commands.lint-all-files.submit-button-text"),a=x("commands.lint-all-files.submit-button-notice-text");new Ya(this.app,r,i,a,()=>this.runLinterAllFiles(this.app),this.settings.lintCommands&&this.settings.lintCommands.length>0).open()}}),this.addCommand({id:"lint-all-files-in-folder",name:x("commands.lint-all-files-in-folder.name"),icon:Me.folder.id,editorCheckCallback:(r,i,a)=>{if(r)return a&&a.file&&a.file instanceof J.TFile&&a.file.parent?!a.file.parent.isRoot():!1;this.createFolderLintModal(a.file.parent)}}),this.addCommand({id:"paste-as-plain-text",
`+i),new J.Notice(i),this.settings.ruleConfigs["auto-correct-common-misspellings"].enabled=!1,await this.saveSettings()}),!!this.settings.ruleConfigs["auto-correct-common-misspellings"].enabled)){this.defaultAutoCorrectMisspellings=Tr(an(await cf(this)));for(let i of this.settings.ruleConfigs["auto-correct-common-misspellings"]["extra-auto-correct-files"]??[])if(i.filePath!=""){let a=this.getFileFromPath(i.filePath);a&&(i.customReplacements=Tr(an(await this.app.vault.cachedRead(a))))}this.hasLoadedMisspellingFiles=!0}}onMenuOpenCallback(t,r,i){r instanceof J.TFile&&this.isMarkdownFile(r)?t.addItem(a=>{a.setIcon(Me.file.id).setTitle(x("commands.lint-file-pop-up-menu-text.name")).onClick(()=>{let o=this.app.workspace.getActiveFile(),s=this.getEditor();o===r&&s&&s.cm?this.runLinterEditor(s):this.runLinterFile(r)})}):r instanceof J.TFolder&&t.addItem(a=>{a.setTitle(x("commands.lint-folder-pop-up-menu-text.name")).setIcon(Me.folder.id).onClick(()=>this.createFolderLintModal(r))})}async onActiveLeafChange(){if(!this.isEnabled||this.currentlyOpeningSidebar)return;let t=this.app.workspace.getActiveFile(),r=this.lastActiveFile==null?!1:await this.app.vault.adapter.exists(this.lastActiveFile.path);if(!this.settings.lintOnFileChange||!r||this.lastActiveFile===t||!this.isMarkdownFile(this.lastActiveFile)||this.shouldIgnoreFile(this.lastActiveFile)){this.lastActiveFile=t;return}try{await this.runLinterFile(this.lastActiveFile,!0)}catch(i){this.handleLintError(this.lastActiveFile,i,x("commands.lint-file.error-message")+" '{FILE_PATH}'",!1)}finally{this.lastActiveFile=t}}shouldIgnoreFile(t){for(let r of this.settings.foldersToIgnore)if(r.length>0&&t.path.startsWith(r))return!0;for(let r of this.settings.filesToIgnore){if(!r.match)continue;if(new RegExp(`${r.match}`,r.flags).test(t.path))return!0}return!1}isMarkdownFile(t){return t&&t.extension==="md"}async runLinterFile(t,r=!1){let i=an(await this.app.vault.read(t)),a=this.rulesRunner.lintText(Zr(i,t,this.momentLocale,this.settings,this.defaultAutoCorrectMisspellings));if(i!=a){if(await this.app.vault.modify(t,a),r){let o=x("logs.file-change-lint-message-start")+" "+this.lastActiveFile.path;this.settings.displayLintOnFileChangeNotice&&new J.Notice(o),nn(o)}this.fileLintFiles.add(t);return}await this.runCustomCommandsInSidebar(t)}async runLinterAllFiles(t){let r=0;if(await Promise.all(t.vault.getMarkdownFiles().map(async i=>{if(!this.shouldIgnoreFile(i))try{await this.runLinterFile(i)}catch(a){this.handleLintError(i,a,x("commands.lint-all-files.error-message")+" '{FILE_PATH}'"),r+=1}})),r===0)new J.Notice(x("commands.lint-all-files.success-message"),Xt);else{let i=r===1?x("commands.lint-all-files.errors-message-singular"):x("commands.lint-all-files.errors-message-plural").replace("{NUM}",r.toString());new J.Notice(i,Xt)}}async runLinterAllFilesInFolder(t){nn(x("logs.folder-lint")+t.name);let r=0,i=0,a=this.getAllFilesInFolder(t);if(await Promise.all(a.map(async o=>{if(!this.shouldIgnoreFile(o)){try{await this.runLinterFile(o)}catch(s){this.handleLintError(o,s,x("commands.lint-all-files-in-folder.error-message")+" '{FILE_PATH}'"),r+=1}i++}})),r===0)new J.Notice(x("commands.lint-all-files-in-folder.success-message").replace("{NUM}",i.toString()).replace("{FOLDER_NAME}",t.name),Xt);else{let o=r===1?x("commands.lint-all-files-in-folder.message-singular").replace("{NUM}",i.toString()).replace("{FOLDER_NAME}",t.name):x("commands.lint-all-files-in-folder.message-plural").replace("{FILE_COUNT}",i.toString()).replace("{FOLDER_NAME}",t.name).replace("{ERROR_COUNT}",r.toString());new J.Notice(o,Xt)}}createFolderLintModal(t){let r=x("commands.lint-all-files-in-folder.start-message").replace("{FOLDER_NAME}",t.name),i=x("commands.lint-all-files-in-folder.submit-button-text").replace("{FOLDER_NAME}",t.name),a=x("commands.lint-all-files-in-folder.submit-button-notice-text").replace("{FOLDER_NAME}",t.name);new Ya(this.app,r,i,a,()=>this.runLinterAllFilesInFolder(t),this.settings.lintCommands&&this.settings.lintCommands.length>0).open()}async runLinterEditor(t){fl(this.settings.recordLintOnSaveLogs),Xu(
`+x("disabled-conflicting-rule-notice").replace("{NAME_1}",x("rules.header-increment.start-at-h2.name")).replace("{NAME_2}",x("rules.file-name-heading.name"))),this.settings.ruleConfigs["paragraph-blank-lines"]&&this.settings.ruleConfigs["paragraph-blank-lines"].enabled&&this.settings.ruleConfigs["two-spaces-between-lines-with-content"]&&this.settings.ruleConfigs["two-spaces-between-lines-with-content"].enabled&&(this.settings.ruleConfigs["paragraph-blank-lines"].enabled=!1,t=!0,i&&(r+=`
`),i=!0,r+=`
`+x("disabled-conflicting-rule-notice").replace("{NAME_1}",x("rules.paragraph-blank-lines.name")).replace("{NAME_2}",x("rules.two-spaces-between-lines-with-content.name"))),i&&new J.Notice(r,Xt);for(let a of Ft){let o=a.getDefaultOptions();if(!this.settings.ruleConfigs[a.alias]){this.settings.ruleConfigs[a.alias]=o,t=!0;continue}if(a.alias=="space-between-chinese-japanese-or-korean-and-english-or-numbers")"english-symbols-punctuation-before"in this.settings.ruleConfigs[a.alias]||(this.settings.ruleConfigs[a.alias]["english-symbols-punctuation-before"]=o["english-symbols-punctuation-before"],t=!0),"english-symbols-punctuation-after"in this.settings.ruleConfigs[a.alias]||(this.settings.ruleConfigs[a.alias]["english-symbols-punctuation-after"]=o["english-symbols-punctuation-after"],t=!0);else if(a.alias=="yaml-timestamp"){let s=a.getDefaultOptions();"force-retention-of-create-value"in this.settings.ruleConfigs[a.alias]&&("date-created-source-of-truth"in this.settings.ruleConfigs[a.alias]||(this.settings.ruleConfigs[a.alias]["force-retention-of-create-value"]?this.settings.ruleConfigs[a.alias]["date-created-source-of-truth"]="frontmatter":this.settings.ruleConfigs[a.alias]["date-created-source-of-truth"]=s["date-created-source-of-truth"]),delete this.settings.ruleConfigs[a.alias]["force-retention-of-create-value"],t=!0),"date-modified-source-of-truth"in this.settings.ruleConfigs[a.alias]||(this.settings.ruleConfigs[a.alias]["date-modified-source-of-truth"]=s["date-modified-source-of-truth"],t=!0)}for(let s of Object.keys(o))Object.hasOwn(this.settings.ruleConfigs[a.alias],s)||(this.settings.ruleConfigs[a.alias][s]=o[s],t=!0)}t&&await this.saveSettings()}createDebouncedFileUpdate(){let t=5e3;switch(this.settings.ruleConfigs["yaml-timestamp"]["update-on-file-contents-updated"]??"never"){case"after 10 seconds":t=1e4;break;case"after 15 seconds":t=15e3;break;case"after 30 seconds":t=3e4;break;case"after 1 minute":t=6e4;break}return(0,J.debounce)(async(r,i)=>{if(!this.activeFileChangeDebouncer.has(r)){pt(x("logs.file-change-yaml-lint-warning"));return}let a=this.activeFileChangeDebouncer.get(r);a.isRunning=!0;let o=i.getValue(),s=o;if(o!=a.originalText){nn(x("logs.file-change-yaml-lint-run"));try{s=this.rulesRunner.runYAMLTimestampByItself(Zr(o,r,this.momentLocale,this.settings,null))}catch(l){this.handleLintError(r,l,x("commands.lint-file.error-message")+" '{FILE_PATH}'",!1);return}this.updateEditor(o,s,i)}else nn(x("logs.file-change-yaml-lint-skipped"));a.isRunning=!1,this.activeFileChangeDebouncer.delete(r)},t,!0)}updateEditor(t,r,i){let o=new Xr.default.diff_match_patch().diff_main(t,r),s="";return o.forEach(l=>{let[c,u]=l;if(c==Xr.default.DIFF_INSERT)i.cm.dispatch({changes:[{from:i.posToOffset(this.endOfDocument(s)),insert:u}],filter:!1}),s+=u;else if(c==Xr.default.DIFF_DELETE){let d=this.endOfDocument(s),m=s;m+=u;let p=this.endOfDocument(m);i.cm.dispatch({changes:[{from:i.posToOffset(d),to:i.posToOffset(p),insert:""}],filter:!1})}else s+=u}),o}displayChangedMessage(t,r){if(this.settings.displayChanged){let i=Im`
${t} ${x("notice-text.characters-added")}
${r} ${x("notice-text.characters-removed")}
`;new J.Notice(i)}}handleLintError(t,r,i,a=!0){let o=i.replace("{FILE_PATH}",t.path),s=x("logs.see-console");r instanceof Hr?a?new J.Notice(`${o} ${r.message}.
${s}`,Xt):new J.Notice(`${r.message}.
${s}`,Xt):new J.Notice(`${x("logs.unknown-error")} ${s}`,Xt),lo(o,r)}async modifyPasteEvent(t){let r=this.getEditor();if(!r)return;let i=t.clipboardData.getData("text/plain");if(!i)return;let a=i.trim();if(zn.test(a)){pt(x("logs.paste-link-warning"));return}if(t.stopPropagation(),t.preventDefault(),!t.defaultPrevented)return;let o=this.app.vault.getConfig("autoConvertHtml"),s=t.clipboardData.getData("text/html"),l=s&&o?(0,J.htmlToMarkdown)(s):i,c=r.listSelections();if(c.length===1){let u=c[0];l=this.rulesRunner.runPasteLint(this.getLineContent(r,u),r.getSelection()??"",Zr(l,null,this.momentLocale,this.settings,null)),r.replaceSelection(l)}else this.handleMultiCursorPaste(r,c,l)}handleMultiCursorPaste(t,r,i){let a=this.convertContentIntoProperPasteContent(r,i),o=[];r.forEach((s,l)=>{i=this.rulesRunner.runPasteLint(this.getLineContent(t,s),t.getRange(s.anchor,s.head)??"",Zr(a[l],null,this.momentLocale,this.settings,null)),o.push({text:i,from:s.anchor,to:s.head})}),t.transaction({changes:o})}convertContentIntoProperPasteContent(t,r){let i=r.split(`
`),a=[];if(i.length%t.length!==0)for(let o=0;o<t.length;o++)a.push(r);else{let o=i.length/t.length,s="";for(let l=0;l<i.length;l++)s+=i[l],(l+1===t.length||(l+1)%o===0)&&(a.push(s),s="")}return a}async pasteAsPlainText(t){let r=await navigator.clipboard.readText();if(!r){new J.Notice(x("notice-text.empty-clipboard"),Xt);return}t.replaceSelection(r)}setCustomCommandCallback(t){(0,df.warn)(x("logs.custom-command-callback-warning")),this.customCommandsCallback=t}async runCustomCommandsInSidebar(t){if(!this.settings.lintCommands||this.settings.lintCommands.length==0||!this.hasCustomCommands)return;let r=this.app.workspace.getRightLeaf(!1),i=this.getEditor();await this.customCommandsLock.acquire("command",async()=>{this.currentlyOpeningSidebar=!0,await r.openFile(t),this.rulesRunner.runCustomCommands(this.settings.lintCommands,this.app.commands),this.customCommandsCallback&&await this.customCommandsCallback(t)}),r.detach(),i&&i.focus(),this.currentlyOpeningSidebar=!1}async runCustomCommands(t){!this.settings.lintCommands||this.settings.lintCommands.length==0||!this.hasCustomCommands||(await this.customCommandsLock.acquire("command",async()=>{try{this.rulesRunner.runCustomCommands(this.settings.lintCommands,this.app.commands)}catch(r){this.handleLintError(t,r,x("commands.lint-file.error-message")+" '{FILE_PATH}'",!1)}this.customCommandsCallback&&await this.customCommandsCallback(t)}),this.updateFileDebouncerText(t,an(await this.app.vault.read(t))))}getEditor(){let t=this.app.workspace.getActiveViewOfType(J.MarkdownView);return t?t.editor:null}getLineContent(t,r){return t.getLine(r.anchor.line)}async moveConfigValuesToKeyBasedFormat(){fo("en");let t=!1;for(let r of Ft){let i=x("rules."+r.alias+".name"),a=this.settings.ruleConfigs[i];if(a!=null){let o=x("rules."+r.alias+".description"),s={enabled:a[o]??!1};for(let l of r.options){if(l.configKey==="enabled")continue;let c=x("rules."+r.alias+"."+l.configKey+".name");s[l.configKey]=a[c]??l.defaultValue}this.settings.ruleConfigs[r.alias]=s,delete this.settings.ruleConfigs[i],t=!0}}return this.settings.settingsConvertedToConfigKeyValues=!0,await this.saveSettings(),fo(window.localStorage.getItem("language")),t}getAllFilesInFolder(t){let r=[],i=[t];for(let a of i)for(let o of a.children)o instanceof J.TFile&&this.isMarkdownFile(o)?r.push(o):o instanceof J.TFolder&&i.push(o);return r}updatePasteOverrideStatus(){for(let t of jn.get("Paste"))if(t.getOptions(this.settings)?.enabled){this.overridePaste=!0;return}this.overridePaste=!1}updateHasCustomCommandStatus(){for(let t of this.settings.lintCommands)if(t.id&&t.id.trim()!=""){this.hasCustomCommands=!0;return}this.hasCustomCommands=!1}endOfDocument(t){let r=t.split(`
`);return{line:r.length-1,ch:r[r.length-1].length}}getFileFromPath(t){let r=this.app.vault.getAbstractFileByPath((0,J.normalizePath)(t));return r instanceof J.TFile?r:null}updateFileDebouncerText(t,r){this.activeFileChangeDebouncer.has(t)&&(this.activeFileChangeDebouncer.get(t).originalText=r)}};
/*! Bundled license information:
js-yaml/dist/js-yaml.mjs:
(*! js-yaml 4.1.0 https://github.com/nodeca/js-yaml @license MIT *)
*/
/* nosourcemap */